diff --git a/.release-please-manifest.json b/.release-please-manifest.json index 47e5693eba4..1b8ad314a69 100644 --- a/.release-please-manifest.json +++ b/.release-please-manifest.json @@ -1,19 +1,24 @@ { "packages/gapic-node-templating": "0.0.0", + "packages/google-ai-generativelanguage": "1.1.0", "packages/google-analytics-admin": "6.0.0", "packages/google-analytics-data": "4.0.1", "packages/google-api-apikeys": "1.0.1", "packages/google-api-servicecontrol": "3.0.1", "packages/google-api-servicemanagement": "2.0.1", - "packages/google-api-serviceusage": "3.0.1", + "packages/google-api-serviceusage": "3.1.0", "packages/google-appengine": "3.0.1", "packages/google-area120-tables": "3.0.1", "packages/google-cloud-accessapproval": "3.0.1", - "packages/google-cloud-aiplatform": "3.1.0", + "packages/google-cloud-advisorynotifications": "1.0.1", + "packages/google-cloud-aiplatform": "3.2.0", + "packages/google-cloud-alloydb": "1.2.0", "packages/google-cloud-apigateway": "3.0.1", "packages/google-cloud-apigeeconnect": "3.0.1", + "packages/google-cloud-apigeeregistry": "1.0.1", "packages/google-cloud-asset": "5.0.2", "packages/google-cloud-assuredworkloads": "4.0.1", + "packages/google-cloud-automl": "4.0.2", "packages/google-cloud-baremetalsolution": "1.1.1", "packages/google-cloud-batch": "1.2.0", "packages/google-cloud-beyondcorp-appconnections": "1.0.1", @@ -31,24 +36,28 @@ "packages/google-cloud-billing-budgets": "5.1.0", "packages/google-cloud-binaryauthorization": "3.1.0", "packages/google-cloud-certificatemanager": "1.0.1", - "packages/google-cloud-channel": "3.0.1", + "packages/google-cloud-channel": "3.1.0", "packages/google-cloud-clouddms": "3.1.0", + "packages/google-cloud-commerce-consumer-procurement": "0.1.1", "packages/google-cloud-compute": "4.0.1", + "packages/google-cloud-confidentialcomputing": "1.1.0", + "packages/google-cloud-config": "0.1.1", "packages/google-cloud-contactcenterinsights": "3.0.1", - "packages/google-cloud-contentwarehouse": "1.1.0", + "packages/google-cloud-contentwarehouse": "1.2.0", "packages/google-cloud-datacatalog": "4.0.1", "packages/google-cloud-datacatalog-lineage": "1.0.1", - "packages/google-cloud-dataform": "0.4.1", + "packages/google-cloud-dataform": "1.0.2", "packages/google-cloud-datafusion": "3.0.1", "packages/google-cloud-datalabeling": "4.0.1", - "packages/google-cloud-dataplex": "3.0.1", - "packages/google-cloud-dataproc": "5.1.0", + "packages/google-cloud-dataplex": "3.1.0", + "packages/google-cloud-dataproc": "5.2.0", "packages/google-cloud-dataqna": "3.0.1", "packages/google-cloud-datastream": "3.0.1", "packages/google-cloud-deploy": "3.0.1", "packages/google-cloud-dialogflow": "6.1.0", "packages/google-cloud-dialogflow-cx": "4.1.0", "packages/google-cloud-discoveryengine": "1.1.0", + "packages/google-cloud-dns": "4.0.0", "packages/google-cloud-documentai": "8.0.1", "packages/google-cloud-domains": "3.0.1", "packages/google-cloud-essentialcontacts": "3.0.1", @@ -61,18 +70,21 @@ "packages/google-cloud-gkehub": "4.0.1", "packages/google-cloud-gkemulticloud": "1.0.1", "packages/google-cloud-gsuiteaddons": "1.0.1", - "packages/google-cloud-iap": "3.0.1", + "packages/google-cloud-iap": "3.1.0", "packages/google-cloud-ids": "3.0.1", "packages/google-cloud-iot": "4.0.1", "packages/google-cloud-kms": "4.0.1", + "packages/google-cloud-kms-inventory": "1.0.1", "packages/google-cloud-language": "6.1.0", "packages/google-cloud-lifesciences": "3.0.1", "packages/google-cloud-managedidentities": "3.0.1", "packages/google-cloud-mediatranslation": "4.0.1", "packages/google-cloud-memcache": "3.0.1", "packages/google-cloud-metastore": "4.0.1", + "packages/google-cloud-migrationcenter": "1.1.0", "packages/google-cloud-monitoring": "4.0.0", - "packages/google-cloud-networkconnectivity": "3.0.1", + "packages/google-cloud-netapp": "0.1.0", + "packages/google-cloud-networkconnectivity": "3.1.0", "packages/google-cloud-networkmanagement": "3.1.0", "packages/google-cloud-networksecurity": "2.0.1", "packages/google-cloud-notebooks": "3.1.0", @@ -83,7 +95,9 @@ "packages/google-cloud-oslogin": "5.1.0", "packages/google-cloud-phishingprotection": "4.0.1", "packages/google-cloud-policytroubleshooter": "3.1.1", + "packages/google-cloud-policytroubleshooter-iam": "0.2.1", "packages/google-cloud-privatecatalog": "3.0.1", + "packages/google-cloud-rapidmigrationassessment": "1.0.1", "packages/google-cloud-recaptchaenterprise": "4.0.1", "packages/google-cloud-recommender": "6.1.0", "packages/google-cloud-redis": "4.0.1", @@ -99,10 +113,13 @@ "packages/google-cloud-servicedirectory": "5.0.1", "packages/google-cloud-shell": "3.0.1", "packages/google-cloud-speech": "6.0.2", + "packages/google-cloud-sql": "0.1.0", + "packages/google-cloud-storageinsights": "1.0.1", + "packages/google-cloud-support": "1.0.1", "packages/google-cloud-talent": "6.0.1", "packages/google-cloud-tasks": "4.0.1", "packages/google-cloud-texttospeech": "5.0.1", - "packages/google-cloud-tpu": "3.1.0", + "packages/google-cloud-tpu": "3.2.0", "packages/google-cloud-translate": "8.0.2", "packages/google-cloud-video-livestream": "1.0.1", "packages/google-cloud-video-stitcher": "2.0.0", @@ -115,36 +132,27 @@ "packages/google-cloud-webrisk": "4.0.1", "packages/google-cloud-websecurityscanner": "3.0.1", "packages/google-cloud-workflows-executions": "3.1.0", - "packages/google-container": "5.2.0", + "packages/google-cloud-workstations": "1.1.0", + "packages/google-container": "5.3.0", "packages/google-dataflow": "3.0.1", "packages/google-devtools-artifactregistry": "3.0.1", "packages/google-devtools-cloudbuild": "4.0.1", - "packages/google-devtools-containeranalysis": "5.1.0", + "packages/google-devtools-containeranalysis": "5.1.1", "packages/google-iam": "1.0.1", "packages/google-iam-credentials": "3.0.1", "packages/google-identity-accesscontextmanager": "3.0.1", "packages/google-maps-addressvalidation": "2.0.1", "packages/google-maps-mapsplatformdatasets": "1.0.1", + "packages/google-maps-places": "1.0.1", "packages/google-maps-routing": "1.0.1", "packages/google-monitoring-dashboard": "3.0.1", "packages/google-privacy-dlp": "5.0.1", "packages/google-storagetransfer": "3.0.1", "packages/grafeas": "5.0.1", "packages/typeless-sample-bot": "2.0.0", - "packages/google-cloud-advisorynotifications": "1.0.1", - "packages/google-cloud-kms-inventory": "1.0.1", - "packages/google-cloud-alloydb": "1.0.1", - "packages/google-cloud-workstations": "1.1.0", - "packages/google-cloud-confidentialcomputing": "1.1.0", - "packages/google-ai-generativelanguage": "1.0.1", - "packages/google-cloud-storageinsights": "1.0.1", - "packages/google-maps-places": "1.0.1", - "packages/google-cloud-support": "1.0.1", - "packages/google-cloud-rapidmigrationassessment": "1.0.1", - "packages/google-cloud-migrationcenter": "1.0.1", - "packages/google-cloud-commerce-consumer-procurement": "0.1.1", - "packages/google-cloud-policytroubleshooter-iam": "0.2.0", - "packages/google-cloud-sql": "0.1.0", - "packages/google-cloud-config": "0.1.0", - "packages/google-cloud-netapp": "0.1.0" + "packages/google-cloud-connectors": "0.1.0", + "packages/google-cloud-edgecontainer": "0.1.0", + "packages/google-cloud-networkservices": "0.1.0", + "packages/google-cloud-policysimulator": "0.1.0", + "packages/google-devtools-cloudprofiler": "0.1.0" } diff --git a/README.md b/README.md index 07c5f48d361..ed2a8aeea64 100644 --- a/README.md +++ b/README.md @@ -18,7 +18,7 @@ applications that interact with individual Google Cloud services: | [Artifact Registry](https://github.com/googleapis/google-cloud-node/tree/main/packages/google-devtools-artifactregistry) | [![Stable][stable-stability]][launch-stages] | [![npm](https://img.shields.io/npm/v/@google-cloud/artifact-registry)](https://npm.im/@google-cloud/artifact-registry) | | [Asset Inventory](https://github.com/googleapis/google-cloud-node/tree/main/packages/google-cloud-asset) | [![Stable][stable-stability]][launch-stages] | [![npm](https://img.shields.io/npm/v/@google-cloud/asset)](https://npm.im/@google-cloud/asset) | | [Assured Workloads for Government](https://github.com/googleapis/google-cloud-node/tree/main/packages/google-cloud-assuredworkloads) | [![Stable][stable-stability]][launch-stages] | [![npm](https://img.shields.io/npm/v/@google-cloud/assured-workloads)](https://npm.im/@google-cloud/assured-workloads) | -| [AutoML](https://github.com/googleapis/nodejs-automl) | [![Stable][stable-stability]][launch-stages] | [![npm](https://img.shields.io/npm/v/@google-cloud/automl)](https://npm.im/@google-cloud/automl) | +| [AutoML](https://github.com/googleapis/google-cloud-node/tree/main/packages/google-cloud-automl) | [![Stable][stable-stability]][launch-stages] | [![npm](https://img.shields.io/npm/v/@google-cloud/automl)](https://npm.im/@google-cloud/automl) | | [Backup for GKE API](https://github.com/googleapis/google-cloud-node/tree/main/packages/google-cloud-gkebackup) | [![Stable][stable-stability]][launch-stages] | [![npm](https://img.shields.io/npm/v/@google-cloud/gke-backup)](https://npm.im/@google-cloud/gke-backup) | | [Bigtable](https://github.com/googleapis/nodejs-bigtable) | [![Stable][stable-stability]][launch-stages] | [![npm](https://img.shields.io/npm/v/@google-cloud/bigtable)](https://npm.im/@google-cloud/bigtable) | | [Billing](https://github.com/googleapis/google-cloud-node/tree/main/packages/google-cloud-billing) | [![Stable][stable-stability]][launch-stages] | [![npm](https://img.shields.io/npm/v/@google-cloud/billing)](https://npm.im/@google-cloud/billing) | @@ -44,7 +44,7 @@ applications that interact with individual Google Cloud services: | [Deploy](https://github.com/googleapis/google-cloud-node/tree/main/packages/google-cloud-deploy) | [![Stable][stable-stability]][launch-stages] | [![npm](https://img.shields.io/npm/v/@google-cloud/deploy)](https://npm.im/@google-cloud/deploy) | | [Dialogflow API](https://github.com/googleapis/google-cloud-node/tree/main/packages/google-cloud-dialogflow) | [![Stable][stable-stability]][launch-stages] | [![npm](https://img.shields.io/npm/v/@google-cloud/dialogflow)](https://npm.im/@google-cloud/dialogflow) | | [Dialogflow CX API](https://github.com/googleapis/google-cloud-node/tree/main/packages/google-cloud-dialogflow-cx) | [![Stable][stable-stability]][launch-stages] | [![npm](https://img.shields.io/npm/v/@google-cloud/dialogflow-cx)](https://npm.im/@google-cloud/dialogflow-cx) | -| [DNS](https://github.com/googleapis/nodejs-dns) | [![Stable][stable-stability]][launch-stages] | [![npm](https://img.shields.io/npm/v/@google-cloud/dns)](https://npm.im/@google-cloud/dns) | +| [DNS](https://github.com/googleapis/google-cloud-node/tree/main/packages/google-cloud-dns) | [![Stable][stable-stability]][launch-stages] | [![npm](https://img.shields.io/npm/v/@google-cloud/dns)](https://npm.im/@google-cloud/dns) | | [Document AI](https://github.com/googleapis/google-cloud-node/tree/main/packages/google-cloud-documentai) | [![Stable][stable-stability]][launch-stages] | [![npm](https://img.shields.io/npm/v/@google-cloud/documentai)](https://npm.im/@google-cloud/documentai) | | [Document AI Warehouse](https://github.com/googleapis/google-cloud-node/tree/main/packages/google-cloud-contentwarehouse) | [![Stable][stable-stability]][launch-stages] | [![npm](https://img.shields.io/npm/v/@google-cloud/contentwarehouse)](https://npm.im/@google-cloud/contentwarehouse) | | [Domains](https://github.com/googleapis/google-cloud-node/tree/main/packages/google-cloud-domains) | [![Stable][stable-stability]][launch-stages] | [![npm](https://img.shields.io/npm/v/@google-cloud/domains)](https://npm.im/@google-cloud/domains) | @@ -125,14 +125,14 @@ applications that interact with individual Google Cloud services: | [VMware Engine API](https://github.com/googleapis/google-cloud-node/tree/main/packages/google-cloud-vmwareengine) | [![Stable][stable-stability]][launch-stages] | [![npm](https://img.shields.io/npm/v/@google-cloud/vmwareengine)](https://npm.im/@google-cloud/vmwareengine) | | [Web Risk API](https://github.com/googleapis/google-cloud-node/tree/main/packages/google-cloud-webrisk) | [![Stable][stable-stability]][launch-stages] | [![npm](https://img.shields.io/npm/v/@google-cloud/web-risk)](https://npm.im/@google-cloud/web-risk) | | [Web Security Scanner](https://github.com/googleapis/google-cloud-node/tree/main/packages/google-cloud-websecurityscanner) | [![Stable][stable-stability]][launch-stages] | [![npm](https://img.shields.io/npm/v/@google-cloud/web-security-scanner)](https://npm.im/@google-cloud/web-security-scanner) | -| [Workflows](https://github.com/googleapis/google-cloud-node/tree/main/packages/google-cloud-workflows-executions) | [![Stable][stable-stability]][launch-stages] | [![npm](https://img.shields.io/npm/v/@google-cloud/workflows)](https://npm.im/@google-cloud/workflows) | +| [Workflow Executions](https://github.com/googleapis/google-cloud-node/tree/main/packages/google-cloud-workflows-executions) | [![Stable][stable-stability]][launch-stages] | [![npm](https://img.shields.io/npm/v/@google-cloud/workflows)](https://npm.im/@google-cloud/workflows) | | [](https://github.com/googleapis/google-cloud-node/tree/main/packages/google-cloud-bigquery-datapolicies) | [![Preview][preview-stability]][launch-stages] | [![npm](https://img.shields.io/npm/v/@google-cloud/bigquery-datapolicies)](https://npm.im/@google-cloud/bigquery-datapolicies) | | [Advisory Notifications API](https://github.com/googleapis/google-cloud-node/tree/main/packages/google-cloud-advisorynotifications) | [![Preview][preview-stability]][launch-stages] | [![npm](https://img.shields.io/npm/v/@google-cloud/advisorynotifications)](https://npm.im/@google-cloud/advisorynotifications) | | [AlloyDB API](https://github.com/googleapis/google-cloud-node/tree/main/packages/google-cloud-alloydb) | [![Preview][preview-stability]][launch-stages] | [![npm](https://img.shields.io/npm/v/@google-cloud/alloydb)](https://npm.im/@google-cloud/alloydb) | | [Analytics Hub API](https://github.com/googleapis/google-cloud-node/tree/main/packages/google-cloud-bigquery-dataexchange) | [![Preview][preview-stability]][launch-stages] | [![npm](https://img.shields.io/npm/v/@google-cloud/bigquery-data-exchange)](https://npm.im/@google-cloud/bigquery-data-exchange) | | [Anthos Multi-Cloud API](https://github.com/googleapis/google-cloud-node/tree/main/packages/google-cloud-gkemulticloud) | [![Preview][preview-stability]][launch-stages] | [![npm](https://img.shields.io/npm/v/@google-cloud/gkemulticloud)](https://npm.im/@google-cloud/gkemulticloud) | | [API Keys API](https://github.com/googleapis/google-cloud-node/tree/main/packages/google-api-apikeys) | [![Preview][preview-stability]][launch-stages] | [![npm](https://img.shields.io/npm/v/@google-cloud/apikeys)](https://npm.im/@google-cloud/apikeys) | -| [Apigee Registry API](https://github.com/googleapis/nodejs-apigee-registry) | [![Preview][preview-stability]][launch-stages] | [![npm](https://img.shields.io/npm/v/@google-cloud/apigee-registry)](https://npm.im/@google-cloud/apigee-registry) | +| [Apigee Registry API](https://github.com/googleapis/google-cloud-node/tree/main/packages/google-cloud-apigeeregistry) | [![Preview][preview-stability]][launch-stages] | [![npm](https://img.shields.io/npm/v/@google-cloud/apigee-registry)](https://npm.im/@google-cloud/apigee-registry) | | [Area120 Tables API](https://github.com/googleapis/google-cloud-node/tree/main/packages/google-area120-tables) | [![Preview][preview-stability]][launch-stages] | [![npm](https://img.shields.io/npm/v/@google/area120-tables)](https://npm.im/@google/area120-tables) | | [Bare Metal Solution API](https://github.com/googleapis/google-cloud-node/tree/main/packages/google-cloud-baremetalsolution) | [![Preview][preview-stability]][launch-stages] | [![npm](https://img.shields.io/npm/v/@google-cloud/bare-metal-solution)](https://npm.im/@google-cloud/bare-metal-solution) | | [Batch](https://github.com/googleapis/google-cloud-node/tree/main/packages/google-cloud-batch) | [![Preview][preview-stability]][launch-stages] | [![npm](https://img.shields.io/npm/v/@google-cloud/batch)](https://npm.im/@google-cloud/batch) | @@ -144,24 +144,32 @@ applications that interact with individual Google Cloud services: | [BigQuery Migration API](https://github.com/googleapis/nodejs-bigquery-migration) | [![Preview][preview-stability]][launch-stages] | [![npm](https://img.shields.io/npm/v/@google-cloud/bigquery-migration)](https://npm.im/@google-cloud/bigquery-migration) | | [Commerce Consumer Procurement API](https://github.com/googleapis/google-cloud-node/tree/main/packages/google-cloud-commerce-consumer-procurement) | [![Preview][preview-stability]][launch-stages] | [![npm](https://img.shields.io/npm/v/@google-cloud/procurement)](https://npm.im/@google-cloud/procurement) | | [Confidential Computing API](https://github.com/googleapis/google-cloud-node/tree/main/packages/google-cloud-confidentialcomputing) | [![Preview][preview-stability]][launch-stages] | [![npm](https://img.shields.io/npm/v/@google-cloud/confidentialcomputing)](https://npm.im/@google-cloud/confidentialcomputing) | +| [Connectors API](https://github.com/googleapis/google-cloud-node/tree/main/packages/google-cloud-connectors) | [![Preview][preview-stability]][launch-stages] | [![npm](https://img.shields.io/npm/v/@google-cloud/connectors)](https://npm.im/@google-cloud/connectors) | | [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 Lineage API](https://github.com/googleapis/google-cloud-node/tree/main/packages/google-cloud-datacatalog-lineage) | [![Preview][preview-stability]][launch-stages] | [![npm](https://img.shields.io/npm/v/@google-cloud/lineage)](https://npm.im/@google-cloud/lineage) | | [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) | | [Dataflow](https://github.com/googleapis/google-cloud-node/tree/main/packages/google-dataflow) | [![Preview][preview-stability]][launch-stages] | [![npm](https://img.shields.io/npm/v/@google-cloud/dataflow)](https://npm.im/@google-cloud/dataflow) | | [Dataform API](https://github.com/googleapis/google-cloud-node/tree/main/packages/google-cloud-dataform) | [![Preview][preview-stability]][launch-stages] | [![npm](https://img.shields.io/npm/v/@google-cloud/dataform)](https://npm.im/@google-cloud/dataform) | | [Discovery Engine API](https://github.com/googleapis/google-cloud-node/tree/main/packages/google-cloud-discoveryengine) | [![Preview][preview-stability]][launch-stages] | [![npm](https://img.shields.io/npm/v/@google-cloud/discoveryengine)](https://npm.im/@google-cloud/discoveryengine) | +| [Distributed Cloud Edge Container API](https://github.com/googleapis/google-cloud-node/tree/main/packages/google-cloud-edgecontainer) | [![Preview][preview-stability]][launch-stages] | [![npm](https://img.shields.io/npm/v/@google-cloud/edgecontainer)](https://npm.im/@google-cloud/edgecontainer) | | [Generative Language API](https://github.com/googleapis/google-cloud-node/tree/main/packages/google-ai-generativelanguage) | [![Preview][preview-stability]][launch-stages] | [![npm](https://img.shields.io/npm/v/@google-ai/generativelanguage)](https://npm.im/@google-ai/generativelanguage) | | [GKE Connect Gateway](https://github.com/googleapis/google-cloud-node/tree/main/packages/google-cloud-gkeconnect-gateway) | [![Preview][preview-stability]][launch-stages] | [![npm](https://img.shields.io/npm/v/@google-cloud/gke-connect-gateway)](https://npm.im/@google-cloud/gke-connect-gateway) | | [Google Analytics Admin](https://github.com/googleapis/google-cloud-node/tree/main/packages/google-analytics-admin) | [![Preview][preview-stability]][launch-stages] | [![npm](https://img.shields.io/npm/v/@google-analytics/admin)](https://npm.im/@google-analytics/admin) | | [Google Analytics Data](https://github.com/googleapis/google-cloud-node/tree/main/packages/google-analytics-data) | [![Preview][preview-stability]][launch-stages] | [![npm](https://img.shields.io/npm/v/@google-analytics/data)](https://npm.im/@google-analytics/data) | | [Google Maps Routing](https://github.com/googleapis/google-cloud-node/tree/main/packages/google-maps-routing) | [![Preview][preview-stability]][launch-stages] | [![npm](https://img.shields.io/npm/v/@googlemaps/routing)](https://npm.im/@googlemaps/routing) | | [Google Workspace Add-ons API](https://github.com/googleapis/google-cloud-node/tree/main/packages/google-cloud-gsuiteaddons) | [![Preview][preview-stability]][launch-stages] | [![npm](https://img.shields.io/npm/v/@google-cloud/gsuiteaddons)](https://npm.im/@google-cloud/gsuiteaddons) | +| [Infrastructure Manager API](https://github.com/googleapis/google-cloud-node/tree/main/packages/google-cloud-config) | [![Preview][preview-stability]][launch-stages] | [![npm](https://img.shields.io/npm/v/@google-cloud/config)](https://npm.im/@google-cloud/config) | | [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) | | [Migration Center API](https://github.com/googleapis/google-cloud-node/tree/main/packages/google-cloud-migrationcenter) | [![Preview][preview-stability]][launch-stages] | [![npm](https://img.shields.io/npm/v/@google-cloud/migrationcenter)](https://npm.im/@google-cloud/migrationcenter) | +| [NetApp API](https://github.com/googleapis/google-cloud-node/tree/main/packages/google-cloud-netapp) | [![Preview][preview-stability]][launch-stages] | [![npm](https://img.shields.io/npm/v/@google-cloud/netapp)](https://npm.im/@google-cloud/netapp) | | [Network Security API](https://github.com/googleapis/google-cloud-node/tree/main/packages/google-cloud-networksecurity) | [![Preview][preview-stability]][launch-stages] | [![npm](https://img.shields.io/npm/v/@google-cloud/network-security)](https://npm.im/@google-cloud/network-security) | +| [Network Services API](https://github.com/googleapis/google-cloud-node/tree/main/packages/google-cloud-networkservices) | [![Preview][preview-stability]][launch-stages] | [![npm](https://img.shields.io/npm/v/@google-cloud/networkservices)](https://npm.im/@google-cloud/networkservices) | | [Phishing Protection](https://github.com/googleapis/google-cloud-node/tree/main/packages/google-cloud-phishingprotection) | [![Preview][preview-stability]][launch-stages] | [![npm](https://img.shields.io/npm/v/@google-cloud/phishing-protection)](https://npm.im/@google-cloud/phishing-protection) | | [Places API (New)](https://github.com/googleapis/google-cloud-node/tree/main/packages/google-maps-places) | [![Preview][preview-stability]][launch-stages] | [![npm](https://img.shields.io/npm/v/@googlemaps/places)](https://npm.im/@googlemaps/places) | +| [Policy Simulator API](https://github.com/googleapis/google-cloud-node/tree/main/packages/google-cloud-policysimulator) | [![Preview][preview-stability]][launch-stages] | [![npm](https://img.shields.io/npm/v/@google-cloud/policysimulator)](https://npm.im/@google-cloud/policysimulator) | +| [Policy Troubleshooter API](https://github.com/googleapis/google-cloud-node/tree/main/packages/google-cloud-policytroubleshooter-iam) | [![Preview][preview-stability]][launch-stages] | [![npm](https://img.shields.io/npm/v/@google-cloud/policy-troubleshooter-iam)](https://npm.im/@google-cloud/policy-troubleshooter-iam) | | [Private Catalog](https://github.com/googleapis/google-cloud-node/tree/main/packages/google-cloud-privatecatalog) | [![Preview][preview-stability]][launch-stages] | [![npm](https://img.shields.io/npm/v/@google-cloud/private-catalog)](https://npm.im/@google-cloud/private-catalog) | +| [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) | | [Public Certificate Authority](https://github.com/googleapis/google-cloud-node/tree/main/packages/google-cloud-security-publicca) | [![Preview][preview-stability]][launch-stages] | [![npm](https://img.shields.io/npm/v/@google-cloud/publicca)](https://npm.im/@google-cloud/publicca) | | [Rapid Migration Assessment API](https://github.com/googleapis/google-cloud-node/tree/main/packages/google-cloud-rapidmigrationassessment) | [![Preview][preview-stability]][launch-stages] | [![npm](https://img.shields.io/npm/v/@google-cloud/rapidmigrationassessment)](https://npm.im/@google-cloud/rapidmigrationassessment) | | [SQL Admin API](https://github.com/googleapis/google-cloud-node/tree/main/packages/google-cloud-sql) | [![Preview][preview-stability]][launch-stages] | [![npm](https://img.shields.io/npm/v/@google-cloud/sql)](https://npm.im/@google-cloud/sql) | diff --git a/changelog.json b/changelog.json index c19736443ca..a91c40075b8 100644 --- a/changelog.json +++ b/changelog.json @@ -1,6 +1,700 @@ { "repository": "googleapis/google-cloud-node", "entries": [ + { + "changes": [ + { + "type": "feat", + "sha": "f8dcd673bbc0c28e2b2d08acd1bca1183781951b", + "message": "[tpu] added new WAITING_FOR_RESOURCES state for QueuedResourceState", + "issues": [ + "4682" + ] + } + ], + "version": "3.2.0", + "language": "JAVASCRIPT", + "artifactName": "@google-cloud/tpu", + "id": "33eddb29-d522-4b28-85e7-b014e23e9f5b", + "createTime": "2023-09-20T00:11:06.049Z" + }, + { + "changes": [ + { + "type": "feat", + "sha": "fb6e827399bad7b39d3a058c2eb8ad2275e967d1", + "message": "[dataplex] additional HTTP bindings for IAM methods", + "issues": [ + "4683" + ] + } + ], + "version": "3.1.0", + "language": "JAVASCRIPT", + "artifactName": "@google-cloud/dataplex", + "id": "d51efc0f-fb13-4552-8b1b-c3fbb91e8b81", + "createTime": "2023-09-20T00:11:06.043Z" + }, + { + "changes": [ + { + "type": "fix", + "sha": "d611d3ffada146439d3badebd2b4627b0ac45376", + "message": "[infra-manager] change the config service's Ruby namespace to avoid a collision with a base class in the Ruby client platform", + "issues": [ + "4684" + ] + } + ], + "version": "0.1.1", + "language": "JAVASCRIPT", + "artifactName": "@google-cloud/config", + "id": "c01348a2-3e00-42e5-93f1-bd473d282e17", + "createTime": "2023-09-20T00:11:06.037Z" + }, + { + "changes": [ + { + "type": "feat", + "sha": "bf0f0e27911d56cb3e24ae8fb7ef29a2ae9ab9a6", + "message": "[generativelanguage] Upgrade to API v1beta3", + "issues": [ + "4681" + ] + } + ], + "version": "1.1.0", + "language": "JAVASCRIPT", + "artifactName": "@google-ai/generativelanguage", + "id": "77b0d4ea-000b-4acc-8d58-b63247e517cb", + "createTime": "2023-09-20T00:11:06.028Z" + }, + { + "changes": [ + { + "type": "fix", + "sha": "240a69f10d1d5e3fe45169dedfc5f1c2d6492df9", + "message": "Dataform version", + "issues": [] + }, + { + "type": "fix", + "sha": "7d4c40ffab7fe98257560f2986acfcb888f15747", + "message": "Update dependency @google-cloud/dataform to v1", + "issues": [ + "4631" + ], + "scope": "deps" + }, + { + "type": "fix", + "sha": "b6cea45d03faaa7bd6e5daa36ebd0063a1e1f251", + "message": "[Many APIs] simplify logic for HTTP/1.1 REST fallback option", + "issues": [ + "4585" + ] + }, + { + "type": "fix", + "sha": "a4507aa1166832c2d9624cb55879a543f65ec4cb", + "message": "Update dependency @google-cloud/dataform to v1", + "issues": [ + "4532" + ], + "scope": "deps" + }, + { + "type": "chore", + "sha": "2260f12543d171bda95345e53475f5f0fdc45770", + "message": "Migrate to Node 14", + "issues": [ + "4443" + ], + "breakingChangeNote": "migrate to Node 14 ([#4443](https://github.com/googleapis/google-cloud-node/issues/4443))" + }, + { + "type": "fix", + "sha": "c32965c0c4a5975ba37371ecd819d9cffb080aa5", + "message": "[Many APIs] fix typings for IAM methods", + "issues": [ + "4460" + ] + }, + { + "type": "fix", + "sha": "170f7d57b8fd344d182a8e758867b8124722eebc", + "message": "Minify JSON and JS files, and remove .map files", + "issues": [ + "4143" + ] + }, + { + "type": "fix", + "sha": "0b67d883963643ce1b4f6d2ccd3e8d37adf6e029", + "message": "Bump `google-gax` to ^3.5.8", + "issues": [ + "4117" + ], + "scope": "deps" + } + ], + "version": "1.0.2", + "language": "JAVASCRIPT", + "artifactName": "@google-cloud/dataform", + "id": "0a9d822b-772b-457d-a7a9-2bc1db872033", + "createTime": "2023-09-19T20:28:26.883Z" + }, + { + "changes": [ + { + "type": "feat", + "sha": "0057f4eaa3b73c24b5e2eadaaf92338e357a82f0", + "message": "[alloydb] Added enum value for PG15", + "issues": [ + "4680" + ] + }, + { + "type": "feat", + "sha": "b1c7da692c0c62d74f66158ea965dca0500db27f", + "message": "[alloydb] Added enum value for PG15", + "issues": [ + "4674" + ] + } + ], + "version": "1.2.0", + "language": "JAVASCRIPT", + "artifactName": "@google-cloud/alloydb", + "id": "9ca11328-5c4b-45f7-a382-0a1621dd851b", + "createTime": "2023-09-19T20:28:26.875Z" + }, + { + "changes": [ + { + "type": "feat", + "sha": "9876892176c305a67b64af4c8481563ee1633576", + "message": "[container] add SecurityPostureConfig Enterprise vuln mode to allow customers to enable Advanced Vulnerability Scanning for their clusters", + "issues": [ + "4666" + ] + } + ], + "version": "5.3.0", + "language": "JAVASCRIPT", + "artifactName": "@google-cloud/container", + "id": "af6c2ba0-17c9-493a-929e-7bb0dc361440", + "createTime": "2023-09-19T00:45:48.057Z" + }, + { + "changes": [ + { + "type": "feat", + "sha": "89a29560ab1d89e57aa72708101debff835f45c8", + "message": "[migrationcenter] added GenericInsight which exposes generic insights on assets", + "issues": [ + "4670" + ] + } + ], + "version": "1.1.0", + "language": "JAVASCRIPT", + "artifactName": "@google-cloud/migrationcenter", + "id": "8d755cb0-afd9-4f84-91b5-32f300704a07", + "createTime": "2023-09-19T00:45:48.051Z" + }, + { + "changes": [ + { + "type": "feat", + "sha": "53d275509ced91ba753e7e66ac9c86ef264d82b6", + "message": "[iap] Adding programmatic_clients attribute to UpdateIapSettings API request", + "issues": [ + "4668" + ] + } + ], + "version": "3.1.0", + "language": "JAVASCRIPT", + "artifactName": "@google-cloud/iap", + "id": "2e5f5890-5647-4465-8086-2c3cb8e731f4", + "createTime": "2023-09-19T00:45:48.044Z" + }, + { + "changes": [ + { + "type": "feat", + "sha": "9c2bd8e3675ef4021fe166a514e022fe70821f02", + "message": "[dataproc] add optional parameters (tarball_gcs_dir, diagnosis_interval, jobs, yarn_application_ids) in DiagnoseClusterRequest", + "issues": [ + "4661" + ] + } + ], + "version": "5.2.0", + "language": "JAVASCRIPT", + "artifactName": "@google-cloud/dataproc", + "id": "6482b8b9-9f98-4dc5-a9ab-453271528b0a", + "createTime": "2023-09-19T00:45:48.038Z" + }, + { + "changes": [ + { + "type": "fix", + "sha": "240a69f10d1d5e3fe45169dedfc5f1c2d6492df9", + "message": "Dataform version", + "issues": [] + }, + { + "type": "fix", + "sha": "7d4c40ffab7fe98257560f2986acfcb888f15747", + "message": "Update dependency @google-cloud/dataform to v1", + "issues": [ + "4631" + ], + "scope": "deps" + }, + { + "type": "fix", + "sha": "b6cea45d03faaa7bd6e5daa36ebd0063a1e1f251", + "message": "[Many APIs] simplify logic for HTTP/1.1 REST fallback option", + "issues": [ + "4585" + ] + }, + { + "type": "fix", + "sha": "a4507aa1166832c2d9624cb55879a543f65ec4cb", + "message": "Update dependency @google-cloud/dataform to v1", + "issues": [ + "4532" + ], + "scope": "deps" + }, + { + "type": "chore", + "sha": "2260f12543d171bda95345e53475f5f0fdc45770", + "message": "Migrate to Node 14", + "issues": [ + "4443" + ], + "breakingChangeNote": "migrate to Node 14 ([#4443](https://github.com/googleapis/google-cloud-node/issues/4443))" + }, + { + "type": "fix", + "sha": "c32965c0c4a5975ba37371ecd819d9cffb080aa5", + "message": "[Many APIs] fix typings for IAM methods", + "issues": [ + "4460" + ] + }, + { + "type": "fix", + "sha": "170f7d57b8fd344d182a8e758867b8124722eebc", + "message": "Minify JSON and JS files, and remove .map files", + "issues": [ + "4143" + ] + }, + { + "type": "fix", + "sha": "0b67d883963643ce1b4f6d2ccd3e8d37adf6e029", + "message": "Bump `google-gax` to ^3.5.8", + "issues": [ + "4117" + ], + "scope": "deps" + } + ], + "version": "1.0.1", + "language": "JAVASCRIPT", + "artifactName": "@google-cloud/dataform", + "id": "a7c47d76-d39f-4af9-9719-aa6740055c4a", + "createTime": "2023-09-19T00:45:48.032Z" + }, + { + "changes": [ + { + "type": "feat", + "sha": "998711e948c717d5b0bd878d1e0e8cf861831d52", + "message": "[contentwarehouse] add `ROOT_FOLDER` field to Document Warehouse API v1", + "issues": [ + "4672" + ] + } + ], + "version": "1.2.0", + "language": "JAVASCRIPT", + "artifactName": "@google-cloud/contentwarehouse", + "id": "14605a0f-edf0-45ec-becd-ba8d3eac2db5", + "createTime": "2023-09-19T00:45:48.025Z" + }, + { + "changes": [ + { + "type": "fix", + "sha": "e2ee9178272268f38adeaf428d8f50779ad86290", + "message": "Update dependency yargs to v17", + "issues": [ + "4659" + ], + "scope": "deps" + } + ], + "version": "4.0.2", + "language": "JAVASCRIPT", + "artifactName": "@google-cloud/automl", + "id": "b0b325d5-bf97-408e-9c75-4fe637077cc6", + "createTime": "2023-09-19T00:45:48.019Z" + }, + { + "changes": [ + { + "type": "feat", + "sha": "12528e16d13a4aeca66162bd5f51bb1547ec410e", + "message": "[alloydb] Changed description for recovery_window_days in ContinuousBackupConfig", + "issues": [ + "4671" + ] + } + ], + "version": "1.1.0", + "language": "JAVASCRIPT", + "artifactName": "@google-cloud/alloydb", + "id": "05994949-d9f5-4713-8e6e-9c7e253c6985", + "createTime": "2023-09-19T00:45:48.011Z" + }, + { + "changes": [ + { + "type": "feat", + "sha": "4e7f9efde9d5dd76e785a736063948247eede501", + "message": "[serviceusage] introduce resource class serviceusage.googleapis.com/Service", + "issues": [ + "4669" + ] + } + ], + "version": "3.1.0", + "language": "JAVASCRIPT", + "artifactName": "@google-cloud/service-usage", + "id": "2269e22e-058c-4820-a28f-3dc571755f38", + "createTime": "2023-09-19T00:45:48.004Z" + }, + { + "changes": [ + { + "type": "feat", + "sha": "38140975dcfc5936032d05083eb3f7b9bfe93a7c", + "message": "Add initial files for google.devtools.cloudprofiler.v2", + "issues": [ + "4647" + ] + } + ], + "version": "0.1.0", + "language": "JAVASCRIPT", + "artifactName": "@google-cloud/cloudprofiler", + "id": "0c320b60-7087-4465-8f6d-08a151ceebe0", + "createTime": "2023-09-14T19:51:47.211Z" + }, + { + "changes": [ + { + "type": "feat", + "sha": "21bc46a9615e0c54538ad852ea4478797be7c453", + "message": "Add initial files for google.cloud.policysimulator.v1", + "issues": [ + "4642" + ] + } + ], + "version": "0.1.0", + "language": "JAVASCRIPT", + "artifactName": "@google-cloud/policysimulator", + "id": "84ea939a-16f4-4a0b-807a-2442f2b478f6", + "createTime": "2023-09-14T19:51:47.205Z" + }, + { + "changes": [ + { + "type": "feat", + "sha": "c01dd83a6b89c069eb16ffcb79d21b2b8e684278", + "message": "Add initial files for google.cloud.networkservices.v1", + "issues": [ + "4638" + ] + } + ], + "version": "0.1.0", + "language": "JAVASCRIPT", + "artifactName": "@google-cloud/networkservices", + "id": "02506480-9bb5-4985-95db-6b929a38409f", + "createTime": "2023-09-14T19:51:47.197Z" + }, + { + "changes": [ + { + "type": "feat", + "sha": "7f6f62557446160c96677b72185deb9f2794d4cf", + "message": "[networkconnectivity] add PolicyBasedRouting APIs", + "issues": [ + "4636" + ] + } + ], + "version": "3.1.0", + "language": "JAVASCRIPT", + "artifactName": "@google-cloud/network-connectivity", + "id": "c3347686-f4aa-4b87-aa40-692e248bdfa8", + "createTime": "2023-09-14T19:51:47.191Z" + }, + { + "changes": [ + { + "type": "feat", + "sha": "f826ea9f8e1325d48dd8b343b9af5e994e871108", + "message": "Add initial files for google.cloud.edgecontainer.v1", + "issues": [ + "4649" + ] + } + ], + "version": "0.1.0", + "language": "JAVASCRIPT", + "artifactName": "@google-cloud/edgecontainer", + "id": "31a8e961-30bb-460d-a74a-52da59605855", + "createTime": "2023-09-14T19:51:47.181Z" + }, + { + "changes": [ + { + "type": "fix", + "sha": "7d4c40ffab7fe98257560f2986acfcb888f15747", + "message": "Update dependency @google-cloud/dataform to v1", + "issues": [ + "4631" + ], + "scope": "deps" + }, + { + "type": "fix", + "sha": "b6cea45d03faaa7bd6e5daa36ebd0063a1e1f251", + "message": "[Many APIs] simplify logic for HTTP/1.1 REST fallback option", + "issues": [ + "4585" + ] + }, + { + "type": "fix", + "sha": "a4507aa1166832c2d9624cb55879a543f65ec4cb", + "message": "Update dependency @google-cloud/dataform to v1", + "issues": [ + "4532" + ], + "scope": "deps" + }, + { + "type": "chore", + "sha": "2260f12543d171bda95345e53475f5f0fdc45770", + "message": "Migrate to Node 14", + "issues": [ + "4443" + ], + "breakingChangeNote": "migrate to Node 14 ([#4443](https://github.com/googleapis/google-cloud-node/issues/4443))" + }, + { + "type": "fix", + "sha": "c32965c0c4a5975ba37371ecd819d9cffb080aa5", + "message": "[Many APIs] fix typings for IAM methods", + "issues": [ + "4460" + ] + }, + { + "type": "fix", + "sha": "170f7d57b8fd344d182a8e758867b8124722eebc", + "message": "Minify JSON and JS files, and remove .map files", + "issues": [ + "4143" + ] + }, + { + "type": "fix", + "sha": "0b67d883963643ce1b4f6d2ccd3e8d37adf6e029", + "message": "Bump `google-gax` to ^3.5.8", + "issues": [ + "4117" + ], + "scope": "deps" + }, + { + "type": "fix", + "sha": "65ee10e09d7c69e00bdfd7be2a591c866873ceda", + "message": "Revert package.json version", + "issues": [] + } + ], + "version": "0.4.1", + "language": "JAVASCRIPT", + "artifactName": "@google-cloud/dataform", + "id": "6994c16c-5a91-4083-8705-5a95b0c32cc4", + "createTime": "2023-09-14T19:51:47.169Z" + }, + { + "changes": [ + { + "type": "feat", + "sha": "6f5461ac147e39c7028cabe3a7943a2e48f06196", + "message": "Add initial files for google.cloud.connectors.v1", + "issues": [ + "4641" + ] + } + ], + "version": "0.1.0", + "language": "JAVASCRIPT", + "artifactName": "@google-cloud/connectors", + "id": "ef1a0879-5454-4a05-9fe5-6fd6e12e9b68", + "createTime": "2023-09-14T19:51:47.161Z" + }, + { + "changes": [ + { + "type": "fix", + "sha": "2ba7b489e6109e5bf3d5e7276a0b94558ebd48d0", + "message": "Publication issues with containeranalysis and policytroubleshooter", + "issues": [ + "4628" + ] + } + ], + "version": "0.2.1", + "language": "JAVASCRIPT", + "artifactName": "@google-cloud/policy-troubleshooter-iam", + "id": "87b6854d-c52e-4806-a534-c65af8240326", + "createTime": "2023-09-11T17:58:23.549Z" + }, + { + "changes": [ + { + "type": "fix", + "sha": "2ba7b489e6109e5bf3d5e7276a0b94558ebd48d0", + "message": "Publication issues with containeranalysis and policytroubleshooter", + "issues": [ + "4628" + ] + } + ], + "version": "5.1.1", + "language": "JAVASCRIPT", + "artifactName": "@google-cloud/containeranalysis", + "id": "e8f47a9c-a50c-40f6-bde4-fe68063e13f4", + "createTime": "2023-09-11T17:58:23.543Z" + }, + { + "changes": [ + { + "type": "fix", + "sha": "7d4c40ffab7fe98257560f2986acfcb888f15747", + "message": "Update dependency @google-cloud/dataform to v1", + "issues": [ + "4631" + ], + "scope": "deps" + }, + { + "type": "fix", + "sha": "b6cea45d03faaa7bd6e5daa36ebd0063a1e1f251", + "message": "[Many APIs] simplify logic for HTTP/1.1 REST fallback option", + "issues": [ + "4585" + ] + }, + { + "type": "fix", + "sha": "a4507aa1166832c2d9624cb55879a543f65ec4cb", + "message": "Update dependency @google-cloud/dataform to v1", + "issues": [ + "4532" + ], + "scope": "deps" + }, + { + "type": "chore", + "sha": "2260f12543d171bda95345e53475f5f0fdc45770", + "message": "Migrate to Node 14", + "issues": [ + "4443" + ], + "breakingChangeNote": "migrate to Node 14 ([#4443](https://github.com/googleapis/google-cloud-node/issues/4443))" + }, + { + "type": "fix", + "sha": "c32965c0c4a5975ba37371ecd819d9cffb080aa5", + "message": "[Many APIs] fix typings for IAM methods", + "issues": [ + "4460" + ] + }, + { + "type": "fix", + "sha": "170f7d57b8fd344d182a8e758867b8124722eebc", + "message": "Minify JSON and JS files, and remove .map files", + "issues": [ + "4143" + ] + }, + { + "type": "fix", + "sha": "0b67d883963643ce1b4f6d2ccd3e8d37adf6e029", + "message": "Bump `google-gax` to ^3.5.8", + "issues": [ + "4117" + ], + "scope": "deps" + } + ], + "version": "1.0.0", + "language": "JAVASCRIPT", + "artifactName": "@google-cloud/dataform", + "id": "837f5fb7-2785-48e5-8cd2-1e18d77c0cf1", + "createTime": "2023-09-11T17:58:23.534Z" + }, + { + "changes": [ + { + "type": "feat", + "sha": "0805d0f4417a853f5c0f365f357f078f8c481c17", + "message": "[channel] mark ChannelPartnerGranularity as deprecated and offer alternatives", + "issues": [ + "4623" + ] + } + ], + "version": "3.1.0", + "language": "JAVASCRIPT", + "artifactName": "@google-cloud/channel", + "id": "6d83562e-f819-4029-9ef8-198da00b8a3e", + "createTime": "2023-09-11T17:58:23.528Z" + }, + { + "changes": [ + { + "type": "feat", + "sha": "32d823a8ea1613ebb653978a7cd0686f9af2724b", + "message": "Add encryption_spec to index.proto and index_endpoint.proto", + "issues": [ + "4596" + ] + } + ], + "version": "3.2.0", + "language": "JAVASCRIPT", + "artifactName": "@google-cloud/aiplatform", + "id": "92574196-9798-4eaf-877d-e2342a1d0da2", + "createTime": "2023-09-11T17:58:23.522Z" + }, { "changes": [ { @@ -18618,5 +19312,5 @@ "createTime": "2023-01-28T04:18:24.718Z" } ], - "updateTime": "2023-09-08T00:22:54.021Z" + "updateTime": "2023-09-20T00:11:06.049Z" } \ No newline at end of file diff --git a/libraries.json b/libraries.json index 9d34960dae8..4e041efd3c7 100644 --- a/libraries.json +++ b/libraries.json @@ -169,7 +169,7 @@ "distribution_name": "@google-cloud/automl", "release_level": "stable", "product_documentation": "https://cloud.google.com/automl/docs/", - "repo": "googleapis/nodejs-automl", + "repo": "googleapis/google-cloud-node", "default_version": "v1", "language": "nodejs", "requires_billing": true, @@ -181,7 +181,7 @@ "codeowner_team": "@googleapis/ml-apis", "api_shortname": "automl", "library_type": "GAPIC_COMBO", - "linkToRepoHomepage": "https://github.com/googleapis/nodejs-automl", + "linkToRepoHomepage": "https://github.com/googleapis/google-cloud-node/tree/main/packages/google-cloud-automl", "support_documentation": "https://cloud.google.com/automl/docs/getting-support" }, { @@ -645,13 +645,13 @@ "issue_tracker": "https://issuetracker.google.com/savedsearches/559772", "release_level": "stable", "language": "nodejs", - "repo": "googleapis/nodejs-dns", + "repo": "googleapis/google-cloud-node", "distribution_name": "@google-cloud/dns", "api_id": "dns.googleapis.com", "requires_billing": true, "api_shortname": "dns", "library_type": "REST", - "linkToRepoHomepage": "https://github.com/googleapis/nodejs-dns", + "linkToRepoHomepage": "https://github.com/googleapis/google-cloud-node/tree/main/packages/google-cloud-dns", "support_documentation": "https://cloud.google.com/dns/docs/getting-support" }, { @@ -2116,8 +2116,8 @@ "support_documentation": "https://cloud.google.com/security-scanner/docs/getting-support" }, { - "name": "workflows", - "name_pretty": "Workflows", + "name": "workflowexecutions", + "name_pretty": "Workflow Executions", "product_documentation": "https://cloud.google.com/workflows/docs/", "client_documentation": "https://cloud.google.com/nodejs/docs/reference/workflows/latest", "issue_tracker": "https://github.com/googleapis/google-cloud-node/issues", @@ -2125,10 +2125,10 @@ "language": "nodejs", "repo": "googleapis/google-cloud-node", "distribution_name": "@google-cloud/workflows", - "api_id": "workflows.googleapis.com", + "api_id": "workflowexecutions.googleapis.com", "requires_billing": true, "default_version": "v1", - "api_shortname": "workflows", + "api_shortname": "workflowexecutions", "library_type": "GAPIC_AUTO", "codeowner_team": "@googleapis/aap-dpes", "linkToRepoHomepage": "https://github.com/googleapis/google-cloud-node/tree/main/packages/google-cloud-workflows-executions", @@ -2245,15 +2245,15 @@ "name_pretty": "Apigee Registry API", "product_documentation": "https://cloud.google.com/apigee/docs/api-hub/get-started-registry-api", "client_documentation": "https://cloud.google.com/nodejs/docs/reference/apigee-registry/latest", - "issue_tracker": "https://github.com/googleapis/nodejs-apigee-registry/issues", + "issue_tracker": "https://github.com/googleapis/google-cloud-node/issues", "release_level": "beta", "language": "nodejs", - "repo": "googleapis/nodejs-apigee-registry", + "repo": "googleapis/google-cloud-node", "distribution_name": "@google-cloud/apigee-registry", "api_id": "apigeeregistry.googleapis.com", "default_version": "v1", "requires_billing": true, - "linkToRepoHomepage": "https://github.com/googleapis/nodejs-apigee-registry", + "linkToRepoHomepage": "https://github.com/googleapis/google-cloud-node/tree/main/packages/google-cloud-apigeeregistry", "support_documentation": "https://cloud.google.com/apigee/docs/getting-support" }, { @@ -2450,6 +2450,23 @@ "linkToRepoHomepage": "https://github.com/googleapis/google-cloud-node/tree/main/packages/google-cloud-confidentialcomputing", "support_documentation": "https://cloud.google.com/confidential-computing/docs/getting-support" }, + { + "name": "connectors", + "name_pretty": "Connectors API", + "product_documentation": "", + "client_documentation": "https://cloud.google.com/nodejs/docs/reference/connectors/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/connectors", + "api_id": "connectors.googleapis.com", + "default_version": "v1", + "requires_billing": true, + "library_type": "GAPIC_AUTO", + "api_shortname": "connectors", + "linkToRepoHomepage": "https://github.com/googleapis/google-cloud-node/tree/main/packages/google-cloud-connectors" + }, { "default_version": "v1beta1", "release_level": "preview", @@ -2558,6 +2575,23 @@ "linkToRepoHomepage": "https://github.com/googleapis/google-cloud-node/tree/main/packages/google-cloud-discoveryengine", "support_documentation": "https://cloud.google.com/discovery-engine/docs/getting-support" }, + { + "name": "edgecontainer", + "name_pretty": "Distributed Cloud Edge Container API", + "product_documentation": "", + "client_documentation": "https://cloud.google.com/nodejs/docs/reference/edgecontainer/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/edgecontainer", + "api_id": "edgecontainer.googleapis.com", + "default_version": "v1", + "requires_billing": true, + "library_type": "GAPIC_AUTO", + "api_shortname": "edgecontainer", + "linkToRepoHomepage": "https://github.com/googleapis/google-cloud-node/tree/main/packages/google-cloud-edgecontainer" + }, { "name": "generativelanguage", "name_pretty": "Generative Language API", @@ -2666,6 +2700,24 @@ "linkToRepoHomepage": "https://github.com/googleapis/google-cloud-node/tree/main/packages/google-cloud-gsuiteaddons", "support_documentation": "https://developers.google.com/workspace/add-ons/docs/getting-support" }, + { + "name": "infra-manager", + "name_pretty": "Infrastructure Manager API", + "product_documentation": "https://cloud.google.com/infrastructure-manager/docs/overview", + "client_documentation": "https://cloud.google.com/nodejs/docs/reference/infra-manager/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/config", + "api_id": "config.googleapis.com", + "default_version": "v1", + "requires_billing": true, + "library_type": "GAPIC_AUTO", + "api_shortname": "config", + "linkToRepoHomepage": "https://github.com/googleapis/google-cloud-node/tree/main/packages/google-cloud-config", + "support_documentation": "https://cloud.google.com/infrastructure-manager/docs/getting-support" + }, { "name": "lifesciences", "name_pretty": "Life Sciences", @@ -2702,6 +2754,24 @@ "linkToRepoHomepage": "https://github.com/googleapis/google-cloud-node/tree/main/packages/google-cloud-migrationcenter", "support_documentation": "https://cloud.google.com/migration-center/docs/getting-support" }, + { + "name": "netapp", + "name_pretty": "NetApp API", + "product_documentation": "https://cloud.google.com/netapp/volumes/docs/discover/overview", + "client_documentation": "https://cloud.google.com/nodejs/docs/reference/netapp/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/netapp", + "api_id": "netapp.googleapis.com", + "default_version": "v1", + "requires_billing": true, + "library_type": "GAPIC_AUTO", + "api_shortname": "netapp", + "linkToRepoHomepage": "https://github.com/googleapis/google-cloud-node/tree/main/packages/google-cloud-netapp", + "support_documentation": "https://cloud.google.com/netapp/volumes/docs/getting-support" + }, { "name": "networksecurity", "name_pretty": "Network Security API", @@ -2720,6 +2790,24 @@ "linkToRepoHomepage": "https://github.com/googleapis/google-cloud-node/tree/main/packages/google-cloud-networksecurity", "support_documentation": "https://cloud.google.com/traffic-director/docs/getting-support" }, + { + "name": "networkservices", + "name_pretty": "Network Services API", + "product_documentation": "cloud.google.com/media-cdn/", + "client_documentation": "https://cloud.google.com/nodejs/docs/reference/networkservices/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/networkservices", + "api_id": "networkservices.googleapis.com", + "default_version": "v1", + "requires_billing": true, + "library_type": "GAPIC_AUTO", + "api_shortname": "networkservices", + "linkToRepoHomepage": "https://github.com/googleapis/google-cloud-node/tree/main/packages/google-cloud-networkservices", + "support_documentation": "https://cloud.google.com/media-cdn/docs/getting-support" + }, { "name": "phishing-protection", "name_pretty": "Phishing Protection", @@ -2756,6 +2844,42 @@ "linkToRepoHomepage": "https://github.com/googleapis/google-cloud-node/tree/main/packages/google-maps-places", "support_documentation": "https://developers.google.com/maps/documentation/places/web-service/docs/getting-support" }, + { + "name": "policysimulator", + "name_pretty": "Policy Simulator API", + "product_documentation": "https://cloud.google.com/policy-intelligence/docs/iam-simulator-overview", + "client_documentation": "https://cloud.google.com/nodejs/docs/reference/policysimulator/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/policysimulator", + "api_id": "policysimulator.googleapis.com", + "default_version": "v1", + "requires_billing": true, + "library_type": "GAPIC_AUTO", + "api_shortname": "policysimulator", + "linkToRepoHomepage": "https://github.com/googleapis/google-cloud-node/tree/main/packages/google-cloud-policysimulator", + "support_documentation": "https://cloud.google.com/policy-intelligence/docs/getting-support" + }, + { + "name": "iam", + "name_pretty": "Policy Troubleshooter API", + "product_documentation": "cloud.google.com/iam/", + "client_documentation": "https://cloud.google.com/nodejs/docs/reference/iam/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/policy-troubleshooter-iam", + "api_id": "policytroubleshooter.googleapis.com", + "default_version": "v3beta", + "requires_billing": true, + "library_type": "GAPIC_AUTO", + "api_shortname": "iam", + "linkToRepoHomepage": "https://github.com/googleapis/google-cloud-node/tree/main/packages/google-cloud-policytroubleshooter-iam", + "support_documentation": "https://cloud.google.com/iam/docs/getting-support" + }, { "name": "cloudprivatecatalog", "name_pretty": "Private Catalog", @@ -2774,6 +2898,24 @@ "linkToRepoHomepage": "https://github.com/googleapis/google-cloud-node/tree/main/packages/google-cloud-privatecatalog", "support_documentation": "https://cloud.google.com/private-catalog/docs/getting-support" }, + { + "name": "cloudprofiler", + "name_pretty": "Profiler API", + "product_documentation": "cloud.google.com/profiler/", + "client_documentation": "https://cloud.google.com/nodejs/docs/reference/cloudprofiler/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/cloudprofiler", + "api_id": "cloudprofiler.googleapis.com", + "default_version": "v2", + "requires_billing": true, + "library_type": "GAPIC_AUTO", + "api_shortname": "cloudprofiler", + "linkToRepoHomepage": "https://github.com/googleapis/google-cloud-node/tree/main/packages/google-devtools-cloudprofiler", + "support_documentation": "https://cloud.google.com/profiler/docs/getting-support" + }, { "name": "publicca", "name_pretty": "Public Certificate Authority", diff --git a/packages/google-ai-generativelanguage/CHANGELOG.md b/packages/google-ai-generativelanguage/CHANGELOG.md index f58f19e498f..81440a4ecad 100644 --- a/packages/google-ai-generativelanguage/CHANGELOG.md +++ b/packages/google-ai-generativelanguage/CHANGELOG.md @@ -1,5 +1,12 @@ # Changelog +## [1.1.0](https://github.com/googleapis/google-cloud-node/compare/generativelanguage-v1.0.1...generativelanguage-v1.1.0) (2023-09-20) + + +### Features + +* [generativelanguage] Upgrade to API v1beta3 ([#4681](https://github.com/googleapis/google-cloud-node/issues/4681)) ([bf0f0e2](https://github.com/googleapis/google-cloud-node/commit/bf0f0e27911d56cb3e24ae8fb7ef29a2ae9ab9a6)) + ## [1.0.1](https://github.com/googleapis/google-cloud-node/compare/generativelanguage-v1.0.0...generativelanguage-v1.0.1) (2023-09-06) diff --git a/packages/google-ai-generativelanguage/README.md b/packages/google-ai-generativelanguage/README.md index 70868d70a50..e36a099bf39 100644 --- a/packages/google-ai-generativelanguage/README.md +++ b/packages/google-ai-generativelanguage/README.md @@ -159,6 +159,25 @@ Samples are in the [`samples/`](https://github.com/googleapis/google-cloud-node/ | Model_service.list_models | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-ai-generativelanguage/samples/generated/v1beta2/model_service.list_models.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-ai-generativelanguage/samples/generated/v1beta2/model_service.list_models.js,packages/google-ai-generativelanguage/samples/README.md) | | Text_service.embed_text | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-ai-generativelanguage/samples/generated/v1beta2/text_service.embed_text.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-ai-generativelanguage/samples/generated/v1beta2/text_service.embed_text.js,packages/google-ai-generativelanguage/samples/README.md) | | Text_service.generate_text | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-ai-generativelanguage/samples/generated/v1beta2/text_service.generate_text.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-ai-generativelanguage/samples/generated/v1beta2/text_service.generate_text.js,packages/google-ai-generativelanguage/samples/README.md) | +| Discuss_service.count_message_tokens | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-ai-generativelanguage/samples/generated/v1beta3/discuss_service.count_message_tokens.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-ai-generativelanguage/samples/generated/v1beta3/discuss_service.count_message_tokens.js,packages/google-ai-generativelanguage/samples/README.md) | +| Discuss_service.generate_message | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-ai-generativelanguage/samples/generated/v1beta3/discuss_service.generate_message.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-ai-generativelanguage/samples/generated/v1beta3/discuss_service.generate_message.js,packages/google-ai-generativelanguage/samples/README.md) | +| Model_service.create_tuned_model | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-ai-generativelanguage/samples/generated/v1beta3/model_service.create_tuned_model.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-ai-generativelanguage/samples/generated/v1beta3/model_service.create_tuned_model.js,packages/google-ai-generativelanguage/samples/README.md) | +| Model_service.delete_tuned_model | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-ai-generativelanguage/samples/generated/v1beta3/model_service.delete_tuned_model.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-ai-generativelanguage/samples/generated/v1beta3/model_service.delete_tuned_model.js,packages/google-ai-generativelanguage/samples/README.md) | +| Model_service.get_model | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-ai-generativelanguage/samples/generated/v1beta3/model_service.get_model.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-ai-generativelanguage/samples/generated/v1beta3/model_service.get_model.js,packages/google-ai-generativelanguage/samples/README.md) | +| Model_service.get_tuned_model | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-ai-generativelanguage/samples/generated/v1beta3/model_service.get_tuned_model.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-ai-generativelanguage/samples/generated/v1beta3/model_service.get_tuned_model.js,packages/google-ai-generativelanguage/samples/README.md) | +| Model_service.list_models | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-ai-generativelanguage/samples/generated/v1beta3/model_service.list_models.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-ai-generativelanguage/samples/generated/v1beta3/model_service.list_models.js,packages/google-ai-generativelanguage/samples/README.md) | +| Model_service.list_tuned_models | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-ai-generativelanguage/samples/generated/v1beta3/model_service.list_tuned_models.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-ai-generativelanguage/samples/generated/v1beta3/model_service.list_tuned_models.js,packages/google-ai-generativelanguage/samples/README.md) | +| Model_service.update_tuned_model | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-ai-generativelanguage/samples/generated/v1beta3/model_service.update_tuned_model.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-ai-generativelanguage/samples/generated/v1beta3/model_service.update_tuned_model.js,packages/google-ai-generativelanguage/samples/README.md) | +| Permission_service.create_permission | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-ai-generativelanguage/samples/generated/v1beta3/permission_service.create_permission.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-ai-generativelanguage/samples/generated/v1beta3/permission_service.create_permission.js,packages/google-ai-generativelanguage/samples/README.md) | +| Permission_service.delete_permission | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-ai-generativelanguage/samples/generated/v1beta3/permission_service.delete_permission.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-ai-generativelanguage/samples/generated/v1beta3/permission_service.delete_permission.js,packages/google-ai-generativelanguage/samples/README.md) | +| Permission_service.get_permission | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-ai-generativelanguage/samples/generated/v1beta3/permission_service.get_permission.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-ai-generativelanguage/samples/generated/v1beta3/permission_service.get_permission.js,packages/google-ai-generativelanguage/samples/README.md) | +| Permission_service.list_permissions | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-ai-generativelanguage/samples/generated/v1beta3/permission_service.list_permissions.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-ai-generativelanguage/samples/generated/v1beta3/permission_service.list_permissions.js,packages/google-ai-generativelanguage/samples/README.md) | +| Permission_service.transfer_ownership | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-ai-generativelanguage/samples/generated/v1beta3/permission_service.transfer_ownership.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-ai-generativelanguage/samples/generated/v1beta3/permission_service.transfer_ownership.js,packages/google-ai-generativelanguage/samples/README.md) | +| Permission_service.update_permission | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-ai-generativelanguage/samples/generated/v1beta3/permission_service.update_permission.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-ai-generativelanguage/samples/generated/v1beta3/permission_service.update_permission.js,packages/google-ai-generativelanguage/samples/README.md) | +| Text_service.batch_embed_text | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-ai-generativelanguage/samples/generated/v1beta3/text_service.batch_embed_text.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-ai-generativelanguage/samples/generated/v1beta3/text_service.batch_embed_text.js,packages/google-ai-generativelanguage/samples/README.md) | +| Text_service.count_text_tokens | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-ai-generativelanguage/samples/generated/v1beta3/text_service.count_text_tokens.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-ai-generativelanguage/samples/generated/v1beta3/text_service.count_text_tokens.js,packages/google-ai-generativelanguage/samples/README.md) | +| Text_service.embed_text | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-ai-generativelanguage/samples/generated/v1beta3/text_service.embed_text.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-ai-generativelanguage/samples/generated/v1beta3/text_service.embed_text.js,packages/google-ai-generativelanguage/samples/README.md) | +| Text_service.generate_text | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-ai-generativelanguage/samples/generated/v1beta3/text_service.generate_text.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-ai-generativelanguage/samples/generated/v1beta3/text_service.generate_text.js,packages/google-ai-generativelanguage/samples/README.md) | | Quickstart | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-ai-generativelanguage/samples/quickstart.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-ai-generativelanguage/samples/quickstart.js,packages/google-ai-generativelanguage/samples/README.md) | diff --git a/packages/google-ai-generativelanguage/package.json b/packages/google-ai-generativelanguage/package.json index 705b74f103a..191c38b800d 100644 --- a/packages/google-ai-generativelanguage/package.json +++ b/packages/google-ai-generativelanguage/package.json @@ -1,6 +1,6 @@ { "name": "@google-ai/generativelanguage", - "version": "1.0.1", + "version": "1.1.0", "description": "Generative Language API client for Node.js", "repository": { "type": "git", diff --git a/packages/google-ai-generativelanguage/protos/google/ai/generativelanguage/v1beta3/citation.proto b/packages/google-ai-generativelanguage/protos/google/ai/generativelanguage/v1beta3/citation.proto new file mode 100644 index 00000000000..0d8b3b9e7bc --- /dev/null +++ b/packages/google-ai-generativelanguage/protos/google/ai/generativelanguage/v1beta3/citation.proto @@ -0,0 +1,51 @@ +// Copyright 2023 Google LLC +// +// Licensed under the Apache License, Version 2.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.ai.generativelanguage.v1beta3; + +import "google/api/field_behavior.proto"; + +option go_package = "cloud.google.com/go/ai/generativelanguage/apiv1beta3/generativelanguagepb;generativelanguagepb"; +option java_multiple_files = true; +option java_outer_classname = "CitationProto"; +option java_package = "com.google.ai.generativelanguage.v1beta3"; + +// A collection of source attributions for a piece of content. +message CitationMetadata { + // Citations to sources for a specific response. + repeated CitationSource citation_sources = 1; +} + +// A citation to a source for a portion of a specific response. +message CitationSource { + // Optional. Start of segment of the response that is attributed to this + // source. + // + // Index indicates the start of the segment, measured in bytes. + optional int32 start_index = 1 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. End of the attributed segment, exclusive. + optional int32 end_index = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. URI that is attributed as a source for a portion of the text. + optional string uri = 3 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. License for the GitHub project that is attributed as a source for + // segment. + // + // License info is required for code citations. + optional string license = 4 [(google.api.field_behavior) = OPTIONAL]; +} diff --git a/packages/google-ai-generativelanguage/protos/google/ai/generativelanguage/v1beta3/discuss_service.proto b/packages/google-ai-generativelanguage/protos/google/ai/generativelanguage/v1beta3/discuss_service.proto new file mode 100644 index 00000000000..2862cde2d1c --- /dev/null +++ b/packages/google-ai-generativelanguage/protos/google/ai/generativelanguage/v1beta3/discuss_service.proto @@ -0,0 +1,246 @@ +// Copyright 2023 Google LLC +// +// Licensed under the Apache License, Version 2.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.ai.generativelanguage.v1beta3; + +import "google/ai/generativelanguage/v1beta3/citation.proto"; +import "google/ai/generativelanguage/v1beta3/safety.proto"; +import "google/api/annotations.proto"; +import "google/api/client.proto"; +import "google/api/field_behavior.proto"; +import "google/api/resource.proto"; + +option go_package = "cloud.google.com/go/ai/generativelanguage/apiv1beta3/generativelanguagepb;generativelanguagepb"; +option java_multiple_files = true; +option java_outer_classname = "DiscussServiceProto"; +option java_package = "com.google.ai.generativelanguage.v1beta3"; + +// An API for using Generative Language Models (GLMs) in dialog applications. +// +// Also known as large language models (LLMs), this API provides models that +// are trained for multi-turn dialog. +service DiscussService { + option (google.api.default_host) = "generativelanguage.googleapis.com"; + + // Generates a response from the model given an input `MessagePrompt`. + rpc GenerateMessage(GenerateMessageRequest) + returns (GenerateMessageResponse) { + option (google.api.http) = { + post: "/v1beta3/{model=models/*}:generateMessage" + body: "*" + }; + option (google.api.method_signature) = + "model,prompt,temperature,candidate_count,top_p,top_k"; + } + + // Runs a model's tokenizer on a string and returns the token count. + rpc CountMessageTokens(CountMessageTokensRequest) + returns (CountMessageTokensResponse) { + option (google.api.http) = { + post: "/v1beta3/{model=models/*}:countMessageTokens" + body: "*" + }; + option (google.api.method_signature) = "model,prompt"; + } +} + +// Request to generate a message response from the model. +message GenerateMessageRequest { + // Required. The name of the model to use. + // + // Format: `name=models/{model}`. + string model = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "generativelanguage.googleapis.com/Model" + } + ]; + + // Required. The structured textual input given to the model as a prompt. + // + // Given a + // prompt, the model will return what it predicts is the next message in the + // discussion. + MessagePrompt prompt = 2 [(google.api.field_behavior) = REQUIRED]; + + // Optional. Controls the randomness of the output. + // + // Values can range over `[0.0,1.0]`, + // inclusive. A value closer to `1.0` will produce responses that are more + // varied, while a value closer to `0.0` will typically result in + // less surprising responses from the model. + optional float temperature = 3 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The number of generated response messages to return. + // + // This value must be between + // `[1, 8]`, inclusive. If unset, this will default to `1`. + optional int32 candidate_count = 4 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The maximum cumulative probability of tokens to consider when + // sampling. + // + // The model uses combined Top-k and nucleus sampling. + // + // Nucleus sampling considers the smallest set of tokens whose probability + // sum is at least `top_p`. + optional float top_p = 5 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The maximum number of tokens to consider when sampling. + // + // The model uses combined Top-k and nucleus sampling. + // + // Top-k sampling considers the set of `top_k` most probable tokens. + optional int32 top_k = 6 [(google.api.field_behavior) = OPTIONAL]; +} + +// The response from the model. +// +// This includes candidate messages and +// conversation history in the form of chronologically-ordered messages. +message GenerateMessageResponse { + // Candidate response messages from the model. + repeated Message candidates = 1; + + // The conversation history used by the model. + repeated Message messages = 2; + + // A set of content filtering metadata for the prompt and response + // text. + // + // This indicates which `SafetyCategory`(s) blocked a + // candidate from this response, the lowest `HarmProbability` + // that triggered a block, and the HarmThreshold setting for that category. + repeated ContentFilter filters = 3; +} + +// The base unit of structured text. +// +// A `Message` includes an `author` and the `content` of +// the `Message`. +// +// The `author` is used to tag messages when they are fed to the +// model as text. +message Message { + // Optional. The author of this Message. + // + // This serves as a key for tagging + // the content of this Message when it is fed to the model as text. + // + // The author can be any alphanumeric string. + string author = 1 [(google.api.field_behavior) = OPTIONAL]; + + // Required. The text content of the structured `Message`. + string content = 2 [(google.api.field_behavior) = REQUIRED]; + + // Output only. Citation information for model-generated `content` in this + // `Message`. + // + // If this `Message` was generated as output from the model, this field may be + // populated with attribution information for any text included in the + // `content`. This field is used only on output. + optional CitationMetadata citation_metadata = 3 + [(google.api.field_behavior) = OUTPUT_ONLY]; +} + +// All of the structured input text passed to the model as a prompt. +// +// A `MessagePrompt` contains a structured set of fields that provide context +// for the conversation, examples of user input/model output message pairs that +// prime the model to respond in different ways, and the conversation history +// or list of messages representing the alternating turns of the conversation +// between the user and the model. +message MessagePrompt { + // Optional. Text that should be provided to the model first to ground the + // response. + // + // If not empty, this `context` will be given to the model first before the + // `examples` and `messages`. When using a `context` be sure to provide it + // with every request to maintain continuity. + // + // This field can be a description of your prompt to the model to help provide + // context and guide the responses. Examples: "Translate the phrase from + // English to French." or "Given a statement, classify the sentiment as happy, + // sad or neutral." + // + // Anything included in this field will take precedence over message history + // if the total input size exceeds the model's `input_token_limit` and the + // input request is truncated. + string context = 1 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Examples of what the model should generate. + // + // This includes both user input and the response that the model should + // emulate. + // + // These `examples` are treated identically to conversation messages except + // that they take precedence over the history in `messages`: + // If the total input size exceeds the model's `input_token_limit` the input + // will be truncated. Items will be dropped from `messages` before `examples`. + repeated Example examples = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Required. A snapshot of the recent conversation history sorted + // chronologically. + // + // Turns alternate between two authors. + // + // If the total input size exceeds the model's `input_token_limit` the input + // will be truncated: The oldest items will be dropped from `messages`. + repeated Message messages = 3 [(google.api.field_behavior) = REQUIRED]; +} + +// An input/output example used to instruct the Model. +// +// It demonstrates how the model should respond or format its response. +message Example { + // Required. An example of an input `Message` from the user. + Message input = 1 [(google.api.field_behavior) = REQUIRED]; + + // Required. An example of what the model should output given the input. + Message output = 2 [(google.api.field_behavior) = REQUIRED]; +} + +// Counts the number of tokens in the `prompt` sent to a model. +// +// Models may tokenize text differently, so each model may return a different +// `token_count`. +message CountMessageTokensRequest { + // Required. The model's resource name. This serves as an ID for the Model to + // use. + // + // This name should match a model name returned by the `ListModels` method. + // + // Format: `models/{model}` + string model = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "generativelanguage.googleapis.com/Model" + } + ]; + + // Required. The prompt, whose token count is to be returned. + MessagePrompt prompt = 2 [(google.api.field_behavior) = REQUIRED]; +} + +// A response from `CountMessageTokens`. +// +// It returns the model's `token_count` for the `prompt`. +message CountMessageTokensResponse { + // The number of tokens that the `model` tokenizes the `prompt` into. + // + // Always non-negative. + int32 token_count = 1; +} diff --git a/packages/google-ai-generativelanguage/protos/google/ai/generativelanguage/v1beta3/model.proto b/packages/google-ai-generativelanguage/protos/google/ai/generativelanguage/v1beta3/model.proto new file mode 100644 index 00000000000..7a85cb5b775 --- /dev/null +++ b/packages/google-ai-generativelanguage/protos/google/ai/generativelanguage/v1beta3/model.proto @@ -0,0 +1,101 @@ +// Copyright 2023 Google LLC +// +// Licensed under the Apache License, Version 2.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.ai.generativelanguage.v1beta3; + +import "google/api/field_behavior.proto"; +import "google/api/resource.proto"; + +option go_package = "cloud.google.com/go/ai/generativelanguage/apiv1beta3/generativelanguagepb;generativelanguagepb"; +option java_multiple_files = true; +option java_outer_classname = "ModelProto"; +option java_package = "com.google.ai.generativelanguage.v1beta3"; + +// Information about a Generative Language Model. +message Model { + option (google.api.resource) = { + type: "generativelanguage.googleapis.com/Model" + pattern: "models/{model}" + }; + + // Required. The resource name of the `Model`. + // + // Format: `models/{model}` with a `{model}` naming convention of: + // + // * "{base_model_id}-{version}" + // + // Examples: + // + // * `models/chat-bison-001` + string name = 1 [(google.api.field_behavior) = REQUIRED]; + + // Required. The name of the base model, pass this to the generation request. + // + // Examples: + // + // * `chat-bison` + string base_model_id = 2 [(google.api.field_behavior) = REQUIRED]; + + // Required. The version number of the model. + // + // This represents the major version + string version = 3 [(google.api.field_behavior) = REQUIRED]; + + // The human-readable name of the model. E.g. "Chat Bison". + // + // The name can be up to 128 characters long and can consist of any UTF-8 + // characters. + string display_name = 4; + + // A short description of the model. + string description = 5; + + // Maximum number of input tokens allowed for this model. + int32 input_token_limit = 6; + + // Maximum number of output tokens available for this model. + int32 output_token_limit = 7; + + // The model's supported generation methods. + // + // The method names are defined as Pascal case + // strings, such as `generateMessage` which correspond to API methods. + repeated string supported_generation_methods = 8; + + // Controls the randomness of the output. + // + // Values can range over `[0.0,1.0]`, inclusive. A value closer to `1.0` will + // produce responses that are more varied, while a value closer to `0.0` will + // typically result in less surprising responses from the model. + // This value specifies default to be used by the backend while making the + // call to the model. + optional float temperature = 9; + + // For Nucleus sampling. + // + // Nucleus sampling considers the smallest set of tokens whose probability + // sum is at least `top_p`. + // This value specifies default to be used by the backend while making the + // call to the model. + optional float top_p = 10; + + // For Top-k sampling. + // + // Top-k sampling considers the set of `top_k` most probable tokens. + // This value specifies default to be used by the backend while making the + // call to the model. + optional int32 top_k = 11; +} diff --git a/packages/google-ai-generativelanguage/protos/google/ai/generativelanguage/v1beta3/model_service.proto b/packages/google-ai-generativelanguage/protos/google/ai/generativelanguage/v1beta3/model_service.proto new file mode 100644 index 00000000000..713ef3437ff --- /dev/null +++ b/packages/google-ai-generativelanguage/protos/google/ai/generativelanguage/v1beta3/model_service.proto @@ -0,0 +1,254 @@ +// Copyright 2023 Google LLC +// +// Licensed under the Apache License, Version 2.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.ai.generativelanguage.v1beta3; + +import "google/ai/generativelanguage/v1beta3/model.proto"; +import "google/ai/generativelanguage/v1beta3/tuned_model.proto"; +import "google/api/annotations.proto"; +import "google/api/client.proto"; +import "google/api/field_behavior.proto"; +import "google/api/resource.proto"; +import "google/longrunning/operations.proto"; +import "google/protobuf/empty.proto"; +import "google/protobuf/field_mask.proto"; + +option go_package = "cloud.google.com/go/ai/generativelanguage/apiv1beta3/generativelanguagepb;generativelanguagepb"; +option java_multiple_files = true; +option java_outer_classname = "ModelServiceProto"; +option java_package = "com.google.ai.generativelanguage.v1beta3"; + +// Provides methods for getting metadata information about Generative Models. +service ModelService { + option (google.api.default_host) = "generativelanguage.googleapis.com"; + + // Gets information about a specific Model. + rpc GetModel(GetModelRequest) returns (Model) { + option (google.api.http) = { + get: "/v1beta3/{name=models/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Lists models available through the API. + rpc ListModels(ListModelsRequest) returns (ListModelsResponse) { + option (google.api.http) = { + get: "/v1beta3/models" + }; + option (google.api.method_signature) = "page_size,page_token"; + } + + // Gets information about a specific TunedModel. + rpc GetTunedModel(GetTunedModelRequest) returns (TunedModel) { + option (google.api.http) = { + get: "/v1beta3/{name=tunedModels/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Lists tuned models owned by the user. + rpc ListTunedModels(ListTunedModelsRequest) + returns (ListTunedModelsResponse) { + option (google.api.http) = { + get: "/v1beta3/tunedModels" + }; + option (google.api.method_signature) = "page_size,page_token"; + } + + // Creates a tuned model. + // Intermediate tuning progress (if any) is accessed through the + // [google.longrunning.Operations] service. + // + // Status and results can be accessed through the Operations service. + // Example: + // GET /v1/tunedModels/az2mb0bpw6i/operations/000-111-222 + rpc CreateTunedModel(CreateTunedModelRequest) + returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v1beta3/tunedModels" + body: "tuned_model" + }; + option (google.api.method_signature) = "tuned_model"; + option (google.api.method_signature) = "tuned_model_id,tuned_model"; + option (google.longrunning.operation_info) = { + response_type: "TunedModel" + metadata_type: "CreateTunedModelMetadata" + }; + } + + // Updates a tuned model. + rpc UpdateTunedModel(UpdateTunedModelRequest) returns (TunedModel) { + option (google.api.http) = { + patch: "/v1beta3/{tuned_model.name=tunedModels/*}" + body: "tuned_model" + }; + option (google.api.method_signature) = "tuned_model,update_mask"; + } + + // Deletes a tuned model. + rpc DeleteTunedModel(DeleteTunedModelRequest) + returns (google.protobuf.Empty) { + option (google.api.http) = { + delete: "/v1beta3/{name=tunedModels/*}" + }; + option (google.api.method_signature) = "name"; + } +} + +// Request for getting information about a specific Model. +message GetModelRequest { + // Required. The resource name of the model. + // + // This name should match a model name returned by the `ListModels` method. + // + // Format: `models/{model}` + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "generativelanguage.googleapis.com/Model" + } + ]; +} + +// Request for listing all Models. +message ListModelsRequest { + // The maximum number of `Models` to return (per page). + // + // The service may return fewer models. + // If unspecified, at most 50 models will be returned per page. + // This method returns at most 1000 models per page, even if you pass a larger + // page_size. + int32 page_size = 2; + + // A page token, received from a previous `ListModels` call. + // + // Provide the `page_token` returned by one request as an argument to the next + // request to retrieve the next page. + // + // When paginating, all other parameters provided to `ListModels` must match + // the call that provided the page token. + string page_token = 3; +} + +// Response from `ListModel` containing a paginated list of Models. +message ListModelsResponse { + // The returned Models. + repeated Model models = 1; + + // A token, which can be sent as `page_token` to retrieve the next page. + // + // If this field is omitted, there are no more pages. + string next_page_token = 2; +} + +// Request for getting information about a specific Model. +message GetTunedModelRequest { + // Required. The resource name of the model. + // + // Format: `tunedModels/my-model-id` + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "generativelanguage.googleapis.com/TunedModel" + } + ]; +} + +// Request for listing TunedModels. +message ListTunedModelsRequest { + // Optional. The maximum number of `TunedModels` to return (per page). + // The service may return fewer tuned models. + // + // If unspecified, at most 10 tuned models will be returned. + // This method returns at most 1000 models per page, even if you pass a larger + // page_size. + int32 page_size = 1 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. A page token, received from a previous `ListTunedModels` call. + // + // Provide the `page_token` returned by one request as an argument to the next + // request to retrieve the next page. + // + // When paginating, all other parameters provided to `ListTunedModels` + // must match the call that provided the page token. + string page_token = 2 [(google.api.field_behavior) = OPTIONAL]; +} + +// Response from `ListTunedModels` containing a paginated list of Models. +message ListTunedModelsResponse { + // The returned Models. + repeated TunedModel tuned_models = 1; + + // A token, which can be sent as `page_token` to retrieve the next page. + // + // If this field is omitted, there are no more pages. + string next_page_token = 2; +} + +// Request to create a TunedModel. +message CreateTunedModelRequest { + // Optional. The unique id for the tuned model if specified. + // This value should be up to 40 characters, the first character must be a + // letter, the last could be a letter or a number. The id must match the + // regular expression: [a-z]([a-z0-9-]{0,38}[a-z0-9])?. + optional string tuned_model_id = 1 [(google.api.field_behavior) = OPTIONAL]; + + // Required. The tuned model to create. + TunedModel tuned_model = 2 [(google.api.field_behavior) = REQUIRED]; +} + +// Metadata about the state and progress of creating a tuned model returned from +// the long-running operation +message CreateTunedModelMetadata { + // Name of the tuned model associated with the tuning operation. + string tuned_model = 5 [(google.api.resource_reference) = { + type: "generativelanguage.googleapis.com/TunedModel" + }]; + + // The total number of tuning steps. + int32 total_steps = 1; + + // The number of steps completed. + int32 completed_steps = 2; + + // The completed percentage for the tuning operation. + float completed_percent = 3; + + // Metrics collected during tuning. + repeated TuningSnapshot snapshots = 4; +} + +// Request to update a TunedModel. +message UpdateTunedModelRequest { + // Required. The tuned model to update. + TunedModel tuned_model = 1 [(google.api.field_behavior) = REQUIRED]; + + // Required. The list of fields to update. + google.protobuf.FieldMask update_mask = 2 + [(google.api.field_behavior) = REQUIRED]; +} + +// Request to delete a TunedModel. +message DeleteTunedModelRequest { + // Required. The resource name of the model. + // Format: `tunedModels/my-model-id` + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "generativelanguage.googleapis.com/TunedModel" + } + ]; +} diff --git a/packages/google-ai-generativelanguage/protos/google/ai/generativelanguage/v1beta3/permission.proto b/packages/google-ai-generativelanguage/protos/google/ai/generativelanguage/v1beta3/permission.proto new file mode 100644 index 00000000000..2f287a16341 --- /dev/null +++ b/packages/google-ai-generativelanguage/protos/google/ai/generativelanguage/v1beta3/permission.proto @@ -0,0 +1,100 @@ +// Copyright 2023 Google LLC +// +// Licensed under the Apache License, Version 2.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.ai.generativelanguage.v1beta3; + +import "google/api/field_behavior.proto"; +import "google/api/resource.proto"; + +option go_package = "cloud.google.com/go/ai/generativelanguage/apiv1beta3/generativelanguagepb;generativelanguagepb"; +option java_multiple_files = true; +option java_outer_classname = "PermissionProto"; +option java_package = "com.google.ai.generativelanguage.v1beta3"; + +// Permission resource grants user, group or the rest of the world access to the +// PaLM API resource (e.g. a tuned model, file). +// +// A role is a collection of permitted operations that allows users to perform +// specific actions on PaLM API resources. To make them available to users, +// groups, or service accounts, you assign roles. When you assign a role, you +// grant permissions that the role contains. +// +// There are three concentric roles. Each role is a superset of the previous +// role's permitted operations: +// - reader can use the resource (e.g. tuned model) for inference +// - writer has reader's permissions and additionally can edit and share +// - owner has writer's permissions and additionally can delete +message Permission { + option (google.api.resource) = { + type: "generativelanguage.googleapis.com/Permission" + pattern: "tunedModels/{tuned_model}/permissions/{permission}" + plural: "permissions" + singular: "permission" + }; + + // Defines types of the grantee of this permission. + enum GranteeType { + // The default value. This value is unused. + GRANTEE_TYPE_UNSPECIFIED = 0; + + // Represents a user. When set, you must provide email_address for the user. + USER = 1; + + // Represents a group. When set, you must provide email_address for the + // group. + GROUP = 2; + + // Represents access to everyone. No extra information is required. + EVERYONE = 3; + } + + // Defines the role granted by this permission. + enum Role { + // The default value. This value is unused. + ROLE_UNSPECIFIED = 0; + + // Owner can use, update, share and delete the resource. + OWNER = 1; + + // Writer can use, update and share the resource. + WRITER = 2; + + // Reader can use the resource. + READER = 3; + } + + // Output only. The permission name. A unique name will be generated on + // create. Example: tunedModels/{tuned_model}permssions/{permission} Output + // only. + string name = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Required. Immutable. The type of the grantee. + optional GranteeType grantee_type = 2 [ + (google.api.field_behavior) = REQUIRED, + (google.api.field_behavior) = IMMUTABLE + ]; + + // Optional. Immutable. The email address of the user of group which this + // permission refers. Field is not set when permission's grantee type is + // EVERYONE. + optional string email_address = 3 [ + (google.api.field_behavior) = OPTIONAL, + (google.api.field_behavior) = IMMUTABLE + ]; + + // Required. The role granted by this permission. + optional Role role = 4 [(google.api.field_behavior) = REQUIRED]; +} diff --git a/packages/google-ai-generativelanguage/protos/google/ai/generativelanguage/v1beta3/permission_service.proto b/packages/google-ai-generativelanguage/protos/google/ai/generativelanguage/v1beta3/permission_service.proto new file mode 100644 index 00000000000..4250ff628f4 --- /dev/null +++ b/packages/google-ai-generativelanguage/protos/google/ai/generativelanguage/v1beta3/permission_service.proto @@ -0,0 +1,202 @@ +// Copyright 2023 Google LLC +// +// Licensed under the Apache License, Version 2.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.ai.generativelanguage.v1beta3; + +import "google/ai/generativelanguage/v1beta3/permission.proto"; +import "google/api/annotations.proto"; +import "google/api/client.proto"; +import "google/api/field_behavior.proto"; +import "google/api/resource.proto"; +import "google/protobuf/empty.proto"; +import "google/protobuf/field_mask.proto"; + +option go_package = "cloud.google.com/go/ai/generativelanguage/apiv1beta3/generativelanguagepb;generativelanguagepb"; +option java_multiple_files = true; +option java_outer_classname = "PermissionServiceProto"; +option java_package = "com.google.ai.generativelanguage.v1beta3"; + +// Provides methods for managing permissions to PaLM API resources. +service PermissionService { + option (google.api.default_host) = "generativelanguage.googleapis.com"; + + // Create a permission to a specific resource. + rpc CreatePermission(CreatePermissionRequest) returns (Permission) { + option (google.api.http) = { + post: "/v1beta3/{parent=tunedModels/*}/permissions" + body: "permission" + }; + option (google.api.method_signature) = "parent,permission"; + } + + // Gets information about a specific Permission. + rpc GetPermission(GetPermissionRequest) returns (Permission) { + option (google.api.http) = { + get: "/v1beta3/{name=tunedModels/*/permissions/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Lists permissions for the specific resource. + rpc ListPermissions(ListPermissionsRequest) + returns (ListPermissionsResponse) { + option (google.api.http) = { + get: "/v1beta3/{parent=tunedModels/*}/permissions" + }; + option (google.api.method_signature) = "parent"; + } + + // Updates the permission. + rpc UpdatePermission(UpdatePermissionRequest) returns (Permission) { + option (google.api.http) = { + patch: "/v1beta3/{permission.name=tunedModels/*/permissions/*}" + body: "permission" + }; + option (google.api.method_signature) = "permission,update_mask"; + } + + // Deletes the permission. + rpc DeletePermission(DeletePermissionRequest) + returns (google.protobuf.Empty) { + option (google.api.http) = { + delete: "/v1beta3/{name=tunedModels/*/permissions/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Transfers ownership of the tuned model. + // This is the only way to change ownership of the tuned model. + // The current owner will be downgraded to writer role. + rpc TransferOwnership(TransferOwnershipRequest) + returns (TransferOwnershipResponse) { + option (google.api.http) = { + post: "/v1beta3/{name=tunedModels/*}:transferOwnership" + body: "*" + }; + } +} + +// Request to create a `Permission`. +message CreatePermissionRequest { + // Required. The parent resource of the `Permission`. + // Format: tunedModels/{tuned_model} + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "generativelanguage.googleapis.com/Permission" + } + ]; + + // Required. The permission to create. + Permission permission = 2 [(google.api.field_behavior) = REQUIRED]; +} + +// Request for getting information about a specific `Permission`. +message GetPermissionRequest { + // Required. The resource name of the permission. + // + // Format: `tunedModels/{tuned_model}permissions/{permission}` + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "generativelanguage.googleapis.com/Permission" + } + ]; +} + +// Request for listing permissions. +message ListPermissionsRequest { + // Required. The parent resource of the permissions. + // Format: tunedModels/{tuned_model} + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { type: "*" } + ]; + + // Optional. The maximum number of `Permission`s to return (per page). + // The service may return fewer permissions. + // + // If unspecified, at most 10 permissions will be returned. + // This method returns at most 1000 permissions per page, even if you pass + // larger page_size. + int32 page_size = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. A page token, received from a previous `ListPermissions` call. + // + // Provide the `page_token` returned by one request as an argument to the + // next request to retrieve the next page. + // + // When paginating, all other parameters provided to `ListPermissions` + // must match the call that provided the page token. + string page_token = 3 [(google.api.field_behavior) = OPTIONAL]; +} + +// Response from `ListPermissions` containing a paginated list of +// permissions. +message ListPermissionsResponse { + // Returned permissions. + repeated Permission permissions = 1; + + // A token, which can be sent as `page_token` to retrieve the next page. + // + // If this field is omitted, there are no more pages. + string next_page_token = 2; +} + +// Request to update the `Permission`. +message UpdatePermissionRequest { + // Required. The permission to update. + // + // The permission's `name` field is used to identify the permission to update. + Permission permission = 1 [(google.api.field_behavior) = REQUIRED]; + + // Required. The list of fields to update. Accepted ones: + // - role (`Permission.role` field) + google.protobuf.FieldMask update_mask = 2 + [(google.api.field_behavior) = REQUIRED]; +} + +// Request to delete the `Permission`. +message DeletePermissionRequest { + // Required. The resource name of the permission. + // Format: `tunedModels/{tuned_model}/permissions/{permission}` + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "generativelanguage.googleapis.com/Permission" + } + ]; +} + +// Request to transfer the ownership of the tuned model. +message TransferOwnershipRequest { + // Required. The resource name of the tuned model to transfer ownership . + // + // Format: `tunedModels/my-model-id` + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "generativelanguage.googleapis.com/TunedModel" + } + ]; + + // Required. The email address of the user to whom the tuned model is being + // transferred to. + string email_address = 2 [(google.api.field_behavior) = REQUIRED]; +} + +// Response from `TransferOwnership`. +message TransferOwnershipResponse {} diff --git a/packages/google-ai-generativelanguage/protos/google/ai/generativelanguage/v1beta3/safety.proto b/packages/google-ai-generativelanguage/protos/google/ai/generativelanguage/v1beta3/safety.proto new file mode 100644 index 00000000000..45ccfc87e77 --- /dev/null +++ b/packages/google-ai-generativelanguage/protos/google/ai/generativelanguage/v1beta3/safety.proto @@ -0,0 +1,157 @@ +// Copyright 2023 Google LLC +// +// Licensed under the Apache License, Version 2.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.ai.generativelanguage.v1beta3; + +import "google/api/field_behavior.proto"; + +option go_package = "cloud.google.com/go/ai/generativelanguage/apiv1beta3/generativelanguagepb;generativelanguagepb"; +option java_multiple_files = true; +option java_outer_classname = "SafetyProto"; +option java_package = "com.google.ai.generativelanguage.v1beta3"; + +// The category of a rating. +// +// These categories cover various kinds of harms that developers +// may wish to adjust. +enum HarmCategory { + // Category is unspecified. + HARM_CATEGORY_UNSPECIFIED = 0; + + // Negative or harmful comments targeting identity and/or protected attribute. + HARM_CATEGORY_DEROGATORY = 1; + + // Content that is rude, disrepspectful, or profane. + HARM_CATEGORY_TOXICITY = 2; + + // Describes scenarios depictng violence against an individual or group, or + // general descriptions of gore. + HARM_CATEGORY_VIOLENCE = 3; + + // Contains references to sexual acts or other lewd content. + HARM_CATEGORY_SEXUAL = 4; + + // Promotes unchecked medical advice. + HARM_CATEGORY_MEDICAL = 5; + + // Dangerous content that promotes, facilitates, or encourages harmful acts. + HARM_CATEGORY_DANGEROUS = 6; +} + +// Content filtering metadata associated with processing a single request. +// +// ContentFilter contains a reason and an optional supporting string. The reason +// may be unspecified. +message ContentFilter { + // A list of reasons why content may have been blocked. + enum BlockedReason { + // A blocked reason was not specified. + BLOCKED_REASON_UNSPECIFIED = 0; + + // Content was blocked by safety settings. + SAFETY = 1; + + // Content was blocked, but the reason is uncategorized. + OTHER = 2; + } + + // The reason content was blocked during request processing. + BlockedReason reason = 1; + + // A string that describes the filtering behavior in more detail. + optional string message = 2; +} + +// Safety feedback for an entire request. +// +// This field is populated if content in the input and/or response is blocked +// due to safety settings. SafetyFeedback may not exist for every HarmCategory. +// Each SafetyFeedback will return the safety settings used by the request as +// well as the lowest HarmProbability that should be allowed in order to return +// a result. +message SafetyFeedback { + // Safety rating evaluated from content. + SafetyRating rating = 1; + + // Safety settings applied to the request. + SafetySetting setting = 2; +} + +// Safety rating for a piece of content. +// +// The safety rating contains the category of harm and the +// harm probability level in that category for a piece of content. +// Content is classified for safety across a number of +// harm categories and the probability of the harm classification is included +// here. +message SafetyRating { + // The probability that a piece of content is harmful. + // + // The classification system gives the probability of the content being + // unsafe. This does not indicate the severity of harm for a piece of content. + enum HarmProbability { + // Probability is unspecified. + HARM_PROBABILITY_UNSPECIFIED = 0; + + // Content has a negligible chance of being unsafe. + NEGLIGIBLE = 1; + + // Content has a low chance of being unsafe. + LOW = 2; + + // Content has a medium chance of being unsafe. + MEDIUM = 3; + + // Content has a high chance of being unsafe. + HIGH = 4; + } + + // Required. The category for this rating. + HarmCategory category = 3 [(google.api.field_behavior) = REQUIRED]; + + // Required. The probability of harm for this content. + HarmProbability probability = 4 [(google.api.field_behavior) = REQUIRED]; +} + +// Safety setting, affecting the safety-blocking behavior. +// +// Passing a safety setting for a category changes the allowed proability that +// content is blocked. +message SafetySetting { + // Block at and beyond a specified harm probability. + enum HarmBlockThreshold { + // Threshold is unspecified. + HARM_BLOCK_THRESHOLD_UNSPECIFIED = 0; + + // Content with NEGLIGIBLE will be allowed. + BLOCK_LOW_AND_ABOVE = 1; + + // Content with NEGLIGIBLE and LOW will be allowed. + BLOCK_MEDIUM_AND_ABOVE = 2; + + // Content with NEGLIGIBLE, LOW, and MEDIUM will be allowed. + BLOCK_ONLY_HIGH = 3; + + // All content will be allowed. + BLOCK_NONE = 4; + } + + // Required. The category for this setting. + HarmCategory category = 3 [(google.api.field_behavior) = REQUIRED]; + + // Required. Controls the probability threshold at which harm is blocked. + HarmBlockThreshold threshold = 4 [(google.api.field_behavior) = REQUIRED]; +} diff --git a/packages/google-ai-generativelanguage/protos/google/ai/generativelanguage/v1beta3/text_service.proto b/packages/google-ai-generativelanguage/protos/google/ai/generativelanguage/v1beta3/text_service.proto new file mode 100644 index 00000000000..c86e1f647bf --- /dev/null +++ b/packages/google-ai-generativelanguage/protos/google/ai/generativelanguage/v1beta3/text_service.proto @@ -0,0 +1,292 @@ +// Copyright 2023 Google LLC +// +// Licensed under the Apache License, Version 2.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.ai.generativelanguage.v1beta3; + +import "google/ai/generativelanguage/v1beta3/citation.proto"; +import "google/ai/generativelanguage/v1beta3/safety.proto"; +import "google/api/annotations.proto"; +import "google/api/client.proto"; +import "google/api/field_behavior.proto"; +import "google/api/resource.proto"; + +option go_package = "cloud.google.com/go/ai/generativelanguage/apiv1beta3/generativelanguagepb;generativelanguagepb"; +option java_multiple_files = true; +option java_outer_classname = "TextServiceProto"; +option java_package = "com.google.ai.generativelanguage.v1beta3"; + +// API for using Generative Language Models (GLMs) trained to generate text. +// +// Also known as Large Language Models (LLM)s, these generate text given an +// input prompt from the user. +service TextService { + option (google.api.default_host) = "generativelanguage.googleapis.com"; + + // Generates a response from the model given an input message. + rpc GenerateText(GenerateTextRequest) returns (GenerateTextResponse) { + option (google.api.http) = { + post: "/v1beta3/{model=models/*}:generateText" + body: "*" + additional_bindings { + post: "/v1beta3/{model=tunedModels/*}:generateText" + body: "*" + } + }; + option (google.api.method_signature) = + "model,prompt,temperature,candidate_count,max_output_tokens,top_p,top_k"; + } + + // Generates an embedding from the model given an input message. + rpc EmbedText(EmbedTextRequest) returns (EmbedTextResponse) { + option (google.api.http) = { + post: "/v1beta3/{model=models/*}:embedText" + body: "*" + }; + option (google.api.method_signature) = "model,text"; + } + + // Generates multiple embeddings from the model given input text in a + // synchronous call. + rpc BatchEmbedText(BatchEmbedTextRequest) returns (BatchEmbedTextResponse) { + option (google.api.http) = { + post: "/v1beta3/{model=models/*}:batchEmbedText" + body: "*" + }; + option (google.api.method_signature) = "model,texts"; + } + + // Runs a model's tokenizer on a text and returns the token count. + rpc CountTextTokens(CountTextTokensRequest) + returns (CountTextTokensResponse) { + option (google.api.http) = { + post: "/v1beta3/{model=models/*}:countTextTokens" + body: "*" + }; + option (google.api.method_signature) = "model,prompt"; + } +} + +// Request to generate a text completion response from the model. +message GenerateTextRequest { + // Required. The name of the `Model` or `TunedModel` to use for generating the + // completion. + // Examples: + // models/text-bison-001 + // tunedModels/sentence-translator-u3b7m + string model = 1 [(google.api.field_behavior) = REQUIRED]; + + // Required. The free-form input text given to the model as a prompt. + // + // Given a prompt, the model will generate a TextCompletion response it + // predicts as the completion of the input text. + TextPrompt prompt = 2 [(google.api.field_behavior) = REQUIRED]; + + // Optional. Controls the randomness of the output. + // Note: The default value varies by model, see the `Model.temperature` + // attribute of the `Model` returned the `getModel` function. + // + // Values can range from [0.0,1.0], + // inclusive. A value closer to 1.0 will produce responses that are more + // varied and creative, while a value closer to 0.0 will typically result in + // more straightforward responses from the model. + optional float temperature = 3 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Number of generated responses to return. + // + // This value must be between [1, 8], inclusive. If unset, this will default + // to 1. + optional int32 candidate_count = 4 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The maximum number of tokens to include in a candidate. + // + // If unset, this will default to output_token_limit specified in the `Model` + // specification. + optional int32 max_output_tokens = 5 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The maximum cumulative probability of tokens to consider when + // sampling. + // + // The model uses combined Top-k and nucleus sampling. + // + // Tokens are sorted based on their assigned probabilities so that only the + // most likely tokens are considered. Top-k sampling directly limits the + // maximum number of tokens to consider, while Nucleus sampling limits number + // of tokens based on the cumulative probability. + // + // Note: The default value varies by model, see the `Model.top_p` + // attribute of the `Model` returned the `getModel` function. + optional float top_p = 6 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The maximum number of tokens to consider when sampling. + // + // The model uses combined Top-k and nucleus sampling. + // + // Top-k sampling considers the set of `top_k` most probable tokens. + // Defaults to 40. + // + // Note: The default value varies by model, see the `Model.top_k` + // attribute of the `Model` returned the `getModel` function. + optional int32 top_k = 7 [(google.api.field_behavior) = OPTIONAL]; + + // A list of unique `SafetySetting` instances for blocking unsafe content. + // + // that will be enforced on the `GenerateTextRequest.prompt` and + // `GenerateTextResponse.candidates`. There should not be more than one + // setting for each `SafetyCategory` type. The API will block any prompts and + // responses that fail to meet the thresholds set by these settings. This list + // overrides the default settings for each `SafetyCategory` specified in the + // safety_settings. If there is no `SafetySetting` for a given + // `SafetyCategory` provided in the list, the API will use the default safety + // setting for that category. + repeated SafetySetting safety_settings = 8; + + // The set of character sequences (up to 5) that will stop output generation. + // If specified, the API will stop at the first appearance of a stop + // sequence. The stop sequence will not be included as part of the response. + repeated string stop_sequences = 9; +} + +// The response from the model, including candidate completions. +message GenerateTextResponse { + // Candidate responses from the model. + repeated TextCompletion candidates = 1; + + // A set of content filtering metadata for the prompt and response + // text. + // + // This indicates which `SafetyCategory`(s) blocked a + // candidate from this response, the lowest `HarmProbability` + // that triggered a block, and the HarmThreshold setting for that category. + // This indicates the smallest change to the `SafetySettings` that would be + // necessary to unblock at least 1 response. + // + // The blocking is configured by the `SafetySettings` in the request (or the + // default `SafetySettings` of the API). + repeated ContentFilter filters = 3; + + // Returns any safety feedback related to content filtering. + repeated SafetyFeedback safety_feedback = 4; +} + +// Text given to the model as a prompt. +// +// The Model will use this TextPrompt to Generate a text completion. +message TextPrompt { + // Required. The prompt text. + string text = 1 [(google.api.field_behavior) = REQUIRED]; +} + +// Output text returned from a model. +message TextCompletion { + // Output only. The generated text returned from the model. + string output = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Ratings for the safety of a response. + // + // There is at most one rating per category. + repeated SafetyRating safety_ratings = 2; + + // Output only. Citation information for model-generated `output` in this + // `TextCompletion`. + // + // This field may be populated with attribution information for any text + // included in the `output`. + optional CitationMetadata citation_metadata = 3 + [(google.api.field_behavior) = OUTPUT_ONLY]; +} + +// Request to get a text embedding from the model. +message EmbedTextRequest { + // Required. The model name to use with the format model=models/{model}. + string model = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "generativelanguage.googleapis.com/Model" + } + ]; + + // Required. The free-form input text that the model will turn into an + // embedding. + string text = 2 [(google.api.field_behavior) = REQUIRED]; +} + +// The response to a EmbedTextRequest. +message EmbedTextResponse { + // Output only. The embedding generated from the input text. + optional Embedding embedding = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; +} + +// Batch request to get a text embedding from the model. +message BatchEmbedTextRequest { + // Required. The name of the `Model` to use for generating the embedding. + // Examples: + // models/embedding-gecko-001 + string model = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "generativelanguage.googleapis.com/Model" + } + ]; + + // Required. The free-form input texts that the model will turn into an + // embedding. The current limit is 100 texts, over which an error will be + // thrown. + repeated string texts = 2 [(google.api.field_behavior) = REQUIRED]; +} + +// The response to a EmbedTextRequest. +message BatchEmbedTextResponse { + // Output only. The embeddings generated from the input text. + repeated Embedding embeddings = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; +} + +// A list of floats representing the embedding. +message Embedding { + // The embedding values. + repeated float value = 1; +} + +// Counts the number of tokens in the `prompt` sent to a model. +// +// Models may tokenize text differently, so each model may return a different +// `token_count`. +message CountTextTokensRequest { + // Required. The model's resource name. This serves as an ID for the Model to + // use. + // + // This name should match a model name returned by the `ListModels` method. + // + // Format: `models/{model}` + string model = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "generativelanguage.googleapis.com/Model" + } + ]; + + // Required. The free-form input text given to the model as a prompt. + TextPrompt prompt = 2 [(google.api.field_behavior) = REQUIRED]; +} + +// A response from `CountTextTokens`. +// +// It returns the model's `token_count` for the `prompt`. +message CountTextTokensResponse { + // The number of tokens that the `model` tokenizes the `prompt` into. + // + // Always non-negative. + int32 token_count = 1; +} diff --git a/packages/google-ai-generativelanguage/protos/google/ai/generativelanguage/v1beta3/tuned_model.proto b/packages/google-ai-generativelanguage/protos/google/ai/generativelanguage/v1beta3/tuned_model.proto new file mode 100644 index 00000000000..e291bf7ba62 --- /dev/null +++ b/packages/google-ai-generativelanguage/protos/google/ai/generativelanguage/v1beta3/tuned_model.proto @@ -0,0 +1,236 @@ +// Copyright 2023 Google LLC +// +// Licensed under the Apache License, Version 2.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.ai.generativelanguage.v1beta3; + +import "google/api/field_behavior.proto"; +import "google/api/resource.proto"; +import "google/protobuf/timestamp.proto"; + +option go_package = "cloud.google.com/go/ai/generativelanguage/apiv1beta3/generativelanguagepb;generativelanguagepb"; +option java_multiple_files = true; +option java_outer_classname = "TunedModelProto"; +option java_package = "com.google.ai.generativelanguage.v1beta3"; + +// A fine-tuned model created using ModelService.CreateTunedModel. +message TunedModel { + option (google.api.resource) = { + type: "generativelanguage.googleapis.com/TunedModel" + pattern: "tunedModels/{tuned_model}" + plural: "tunedModels" + singular: "tunedModel" + }; + + // The state of the tuned model. + enum State { + // The default value. This value is unused. + STATE_UNSPECIFIED = 0; + + // The model is being created. + CREATING = 1; + + // The model is ready to be used. + ACTIVE = 2; + + // The model failed to be created. + FAILED = 3; + } + + // The model used as the starting point for tuning. + oneof source_model { + // Optional. TunedModel to use as the starting point for training the new + // model. + TunedModelSource tuned_model_source = 3 + [(google.api.field_behavior) = OPTIONAL]; + + // Immutable. The name of the `Model` to tune. + // Example: `models/text-bison-001` + string base_model = 4 [ + (google.api.field_behavior) = IMMUTABLE, + (google.api.resource_reference) = { + type: "generativelanguage.googleapis.com/Model" + } + ]; + } + + // Output only. The tuned model name. A unique name will be generated on + // create. Example: `tunedModels/az2mb0bpw6i` If display_name is set on + // create, the id portion of the name will be set by concatenating the words + // of the display_name with hyphens and adding a random portion for + // uniqueness. Example: + // display_name = "Sentence Translator" + // name = "tunedModels/sentence-translator-u3b7m" + string name = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Optional. The name to display for this model in user interfaces. + // The display name must be up to 40 characters including spaces. + string display_name = 5 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. A short description of this model. + string description = 6 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Controls the randomness of the output. + // + // Values can range over `[0.0,1.0]`, inclusive. A value closer to `1.0` will + // produce responses that are more varied, while a value closer to `0.0` will + // typically result in less surprising responses from the model. + // + // This value specifies default to be the one used by the base model while + // creating the model. + optional float temperature = 11 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. For Nucleus sampling. + // + // Nucleus sampling considers the smallest set of tokens whose probability + // sum is at least `top_p`. + // + // This value specifies default to be the one used by the base model while + // creating the model. + optional float top_p = 12 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. For Top-k sampling. + // + // Top-k sampling considers the set of `top_k` most probable tokens. + // This value specifies default to be used by the backend while making the + // call to the model. + // + // This value specifies default to be the one used by the base model while + // creating the model. + optional int32 top_k = 13 [(google.api.field_behavior) = OPTIONAL]; + + // Output only. The state of the tuned model. + State state = 7 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The timestamp when this model was created. + google.protobuf.Timestamp create_time = 8 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The timestamp when this model was updated. + google.protobuf.Timestamp update_time = 9 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Required. The tuning task that creates the tuned model. + TuningTask tuning_task = 10 [(google.api.field_behavior) = REQUIRED]; +} + +// Tuned model as a source for training a new model. +message TunedModelSource { + // Immutable. The name of the `TunedModel` to use as the starting point for + // training the new model. + // Example: `tunedModels/my-tuned-model` + string tuned_model = 1 [ + (google.api.field_behavior) = IMMUTABLE, + (google.api.resource_reference) = { + type: "generativelanguage.googleapis.com/TunedModel" + } + ]; + + // Output only. The name of the base `Model` this `TunedModel` was tuned from. + // Example: `models/text-bison-001` + string base_model = 2 [ + (google.api.field_behavior) = OUTPUT_ONLY, + (google.api.resource_reference) = { + type: "generativelanguage.googleapis.com/Model" + } + ]; +} + +// Tuning tasks that create tuned models. +message TuningTask { + // Output only. The timestamp when tuning this model started. + google.protobuf.Timestamp start_time = 1 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The timestamp when tuning this model completed. + google.protobuf.Timestamp complete_time = 2 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Metrics collected during tuning. + repeated TuningSnapshot snapshots = 3 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Required. Input only. Immutable. The model training data. + Dataset training_data = 4 [ + (google.api.field_behavior) = INPUT_ONLY, + (google.api.field_behavior) = REQUIRED, + (google.api.field_behavior) = IMMUTABLE + ]; + + // Immutable. Hyperparameters controlling the tuning process. If not provided, + // default values will be used. + Hyperparameters hyperparameters = 5 [(google.api.field_behavior) = IMMUTABLE]; +} + +// Hyperparameters controlling the tuning process. +message Hyperparameters { + // Immutable. The number of training epochs. An epoch is one pass through the + // training data. If not set, a default of 10 will be used. + optional int32 epoch_count = 14 [(google.api.field_behavior) = IMMUTABLE]; + + // Immutable. The batch size hyperparameter for tuning. + // If not set, a default of 16 or 64 will be used based on the number of + // training examples. + optional int32 batch_size = 15 [(google.api.field_behavior) = IMMUTABLE]; + + // Immutable. The learning rate hyperparameter for tuning. + // If not set, a default of 0.0002 or 0.002 will be calculated based on the + // number of training examples. + optional float learning_rate = 16 [(google.api.field_behavior) = IMMUTABLE]; +} + +// Dataset for training or validation. +message Dataset { + // Inline data or a reference to the data. + oneof dataset { + // Optional. Inline examples. + TuningExamples examples = 1 [(google.api.field_behavior) = OPTIONAL]; + } +} + +// A set of tuning examples. Can be training or validatation data. +message TuningExamples { + // Required. The examples. Example input can be for text or discuss, but all + // examples in a set must be of the same type. + repeated TuningExample examples = 1 [(google.api.field_behavior) = REQUIRED]; +} + +// A single example for tuning. +message TuningExample { + // The input to the model for this example. + oneof model_input { + // Optional. Text model input. + string text_input = 1 [(google.api.field_behavior) = OPTIONAL]; + } + + // Required. The expected model output. + string output = 3 [(google.api.field_behavior) = REQUIRED]; +} + +// Record for a single tuning step. +message TuningSnapshot { + // Output only. The tuning step. + int32 step = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The epoch this step was part of. + int32 epoch = 2 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The mean loss of the training examples for this step. + float mean_loss = 3 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The timestamp when this metric was computed. + google.protobuf.Timestamp compute_time = 4 + [(google.api.field_behavior) = OUTPUT_ONLY]; +} diff --git a/packages/google-ai-generativelanguage/protos/protos.d.ts b/packages/google-ai-generativelanguage/protos/protos.d.ts index de2063b2355..d864d03fe8f 100644 --- a/packages/google-ai-generativelanguage/protos/protos.d.ts +++ b/packages/google-ai-generativelanguage/protos/protos.d.ts @@ -2926,1791 +2926,9550 @@ export namespace google { public static getTypeUrl(typeUrlPrefix?: string): string; } } - } - } - - /** 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 - } + /** Namespace v1beta3. */ + namespace v1beta3 { - /** Properties of a Http. */ - interface IHttp { + /** Properties of a CitationMetadata. */ + interface ICitationMetadata { - /** Http rules */ - rules?: (google.api.IHttpRule[]|null); + /** CitationMetadata citationSources */ + citationSources?: (google.ai.generativelanguage.v1beta3.ICitationSource[]|null); + } - /** Http fullyDecodeReservedExpansion */ - fullyDecodeReservedExpansion?: (boolean|null); - } + /** Represents a CitationMetadata. */ + class CitationMetadata implements ICitationMetadata { - /** Represents a Http. */ - class Http implements IHttp { + /** + * Constructs a new CitationMetadata. + * @param [properties] Properties to set + */ + constructor(properties?: google.ai.generativelanguage.v1beta3.ICitationMetadata); - /** - * Constructs a new Http. - * @param [properties] Properties to set - */ - constructor(properties?: google.api.IHttp); + /** CitationMetadata citationSources. */ + public citationSources: google.ai.generativelanguage.v1beta3.ICitationSource[]; - /** Http rules. */ - public rules: google.api.IHttpRule[]; + /** + * Creates a new CitationMetadata instance using the specified properties. + * @param [properties] Properties to set + * @returns CitationMetadata instance + */ + public static create(properties?: google.ai.generativelanguage.v1beta3.ICitationMetadata): google.ai.generativelanguage.v1beta3.CitationMetadata; - /** Http fullyDecodeReservedExpansion. */ - public fullyDecodeReservedExpansion: boolean; + /** + * Encodes the specified CitationMetadata message. Does not implicitly {@link google.ai.generativelanguage.v1beta3.CitationMetadata.verify|verify} messages. + * @param message CitationMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.ai.generativelanguage.v1beta3.ICitationMetadata, writer?: $protobuf.Writer): $protobuf.Writer; - /** - * 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 CitationMetadata message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1beta3.CitationMetadata.verify|verify} messages. + * @param message CitationMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.ai.generativelanguage.v1beta3.ICitationMetadata, writer?: $protobuf.Writer): $protobuf.Writer; - /** - * 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; + /** + * Decodes a CitationMetadata message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CitationMetadata + * @throws {Error} If the payload is not 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.v1beta3.CitationMetadata; - /** - * 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 CitationMetadata message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CitationMetadata + * @throws {Error} If the payload 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.v1beta3.CitationMetadata; - /** - * 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; + /** + * Verifies a CitationMetadata message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); - /** - * 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; + /** + * Creates a CitationMetadata message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CitationMetadata + */ + public static fromObject(object: { [k: string]: any }): google.ai.generativelanguage.v1beta3.CitationMetadata; - /** - * 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 plain object from a CitationMetadata message. Also converts values to other types if specified. + * @param message CitationMetadata + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.ai.generativelanguage.v1beta3.CitationMetadata, options?: $protobuf.IConversionOptions): { [k: string]: any }; - /** - * 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; + /** + * Converts this CitationMetadata to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; - /** - * 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 }; + /** + * Gets the default type url for CitationMetadata + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } - /** - * Converts this Http to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; + /** Properties of a CitationSource. */ + interface ICitationSource { - /** - * 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; - } + /** CitationSource startIndex */ + startIndex?: (number|null); - /** Properties of a HttpRule. */ - interface IHttpRule { + /** CitationSource endIndex */ + endIndex?: (number|null); - /** HttpRule selector */ - selector?: (string|null); + /** CitationSource uri */ + uri?: (string|null); - /** HttpRule get */ - get?: (string|null); + /** CitationSource license */ + license?: (string|null); + } - /** HttpRule put */ - put?: (string|null); + /** Represents a CitationSource. */ + class CitationSource implements ICitationSource { - /** HttpRule post */ - post?: (string|null); + /** + * Constructs a new CitationSource. + * @param [properties] Properties to set + */ + constructor(properties?: google.ai.generativelanguage.v1beta3.ICitationSource); - /** HttpRule delete */ - "delete"?: (string|null); + /** CitationSource startIndex. */ + public startIndex?: (number|null); - /** HttpRule patch */ - patch?: (string|null); + /** CitationSource endIndex. */ + public endIndex?: (number|null); - /** HttpRule custom */ - custom?: (google.api.ICustomHttpPattern|null); + /** CitationSource uri. */ + public uri?: (string|null); - /** HttpRule body */ - body?: (string|null); + /** CitationSource license. */ + public license?: (string|null); - /** HttpRule responseBody */ - responseBody?: (string|null); + /** CitationSource _startIndex. */ + public _startIndex?: "startIndex"; - /** HttpRule additionalBindings */ - additionalBindings?: (google.api.IHttpRule[]|null); - } + /** CitationSource _endIndex. */ + public _endIndex?: "endIndex"; - /** Represents a HttpRule. */ - class HttpRule implements IHttpRule { + /** CitationSource _uri. */ + public _uri?: "uri"; - /** - * Constructs a new HttpRule. - * @param [properties] Properties to set - */ - constructor(properties?: google.api.IHttpRule); + /** CitationSource _license. */ + public _license?: "license"; - /** HttpRule selector. */ - public selector: string; + /** + * Creates a new CitationSource instance using the specified properties. + * @param [properties] Properties to set + * @returns CitationSource instance + */ + public static create(properties?: google.ai.generativelanguage.v1beta3.ICitationSource): google.ai.generativelanguage.v1beta3.CitationSource; - /** HttpRule get. */ - public get?: (string|null); + /** + * Encodes the specified CitationSource message. Does not implicitly {@link google.ai.generativelanguage.v1beta3.CitationSource.verify|verify} messages. + * @param message CitationSource message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.ai.generativelanguage.v1beta3.ICitationSource, writer?: $protobuf.Writer): $protobuf.Writer; - /** HttpRule put. */ - public put?: (string|null); + /** + * Encodes the specified CitationSource message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1beta3.CitationSource.verify|verify} messages. + * @param message CitationSource message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.ai.generativelanguage.v1beta3.ICitationSource, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CitationSource message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CitationSource + * @throws {Error} If the payload is not 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.v1beta3.CitationSource; + + /** + * Decodes a CitationSource message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CitationSource + * @throws {Error} If the payload 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.v1beta3.CitationSource; + + /** + * Verifies a CitationSource message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CitationSource message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CitationSource + */ + public static fromObject(object: { [k: string]: any }): google.ai.generativelanguage.v1beta3.CitationSource; + + /** + * Creates a plain object from a CitationSource message. Also converts values to other types if specified. + * @param message CitationSource + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.ai.generativelanguage.v1beta3.CitationSource, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CitationSource to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CitationSource + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Represents a DiscussService */ + class DiscussService extends $protobuf.rpc.Service { + + /** + * Constructs a new DiscussService 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 DiscussService 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): DiscussService; + + /** + * Calls GenerateMessage. + * @param request GenerateMessageRequest message or plain object + * @param callback Node-style callback called with the error, if any, and GenerateMessageResponse + */ + public generateMessage(request: google.ai.generativelanguage.v1beta3.IGenerateMessageRequest, callback: google.ai.generativelanguage.v1beta3.DiscussService.GenerateMessageCallback): void; + + /** + * Calls GenerateMessage. + * @param request GenerateMessageRequest message or plain object + * @returns Promise + */ + public generateMessage(request: google.ai.generativelanguage.v1beta3.IGenerateMessageRequest): Promise; + + /** + * Calls CountMessageTokens. + * @param request CountMessageTokensRequest message or plain object + * @param callback Node-style callback called with the error, if any, and CountMessageTokensResponse + */ + public countMessageTokens(request: google.ai.generativelanguage.v1beta3.ICountMessageTokensRequest, callback: google.ai.generativelanguage.v1beta3.DiscussService.CountMessageTokensCallback): void; + + /** + * Calls CountMessageTokens. + * @param request CountMessageTokensRequest message or plain object + * @returns Promise + */ + public countMessageTokens(request: google.ai.generativelanguage.v1beta3.ICountMessageTokensRequest): Promise; + } + + namespace DiscussService { + + /** + * Callback as used by {@link google.ai.generativelanguage.v1beta3.DiscussService|generateMessage}. + * @param error Error, if any + * @param [response] GenerateMessageResponse + */ + type GenerateMessageCallback = (error: (Error|null), response?: google.ai.generativelanguage.v1beta3.GenerateMessageResponse) => void; + + /** + * Callback as used by {@link google.ai.generativelanguage.v1beta3.DiscussService|countMessageTokens}. + * @param error Error, if any + * @param [response] CountMessageTokensResponse + */ + type CountMessageTokensCallback = (error: (Error|null), response?: google.ai.generativelanguage.v1beta3.CountMessageTokensResponse) => void; + } + + /** Properties of a GenerateMessageRequest. */ + interface IGenerateMessageRequest { + + /** GenerateMessageRequest model */ + model?: (string|null); + + /** GenerateMessageRequest prompt */ + prompt?: (google.ai.generativelanguage.v1beta3.IMessagePrompt|null); + + /** GenerateMessageRequest temperature */ + temperature?: (number|null); + + /** GenerateMessageRequest candidateCount */ + candidateCount?: (number|null); + + /** GenerateMessageRequest topP */ + topP?: (number|null); + + /** GenerateMessageRequest topK */ + topK?: (number|null); + } + + /** Represents a GenerateMessageRequest. */ + class GenerateMessageRequest implements IGenerateMessageRequest { + + /** + * Constructs a new GenerateMessageRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.ai.generativelanguage.v1beta3.IGenerateMessageRequest); + + /** GenerateMessageRequest model. */ + public model: string; + + /** GenerateMessageRequest prompt. */ + public prompt?: (google.ai.generativelanguage.v1beta3.IMessagePrompt|null); + + /** GenerateMessageRequest temperature. */ + public temperature?: (number|null); + + /** GenerateMessageRequest candidateCount. */ + public candidateCount?: (number|null); + + /** GenerateMessageRequest topP. */ + public topP?: (number|null); + + /** GenerateMessageRequest topK. */ + public topK?: (number|null); + + /** GenerateMessageRequest _temperature. */ + public _temperature?: "temperature"; + + /** GenerateMessageRequest _candidateCount. */ + public _candidateCount?: "candidateCount"; + + /** GenerateMessageRequest _topP. */ + public _topP?: "topP"; + + /** GenerateMessageRequest _topK. */ + public _topK?: "topK"; + + /** + * Creates a new GenerateMessageRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GenerateMessageRequest instance + */ + public static create(properties?: google.ai.generativelanguage.v1beta3.IGenerateMessageRequest): google.ai.generativelanguage.v1beta3.GenerateMessageRequest; + + /** + * Encodes the specified GenerateMessageRequest message. Does not implicitly {@link google.ai.generativelanguage.v1beta3.GenerateMessageRequest.verify|verify} messages. + * @param message GenerateMessageRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.ai.generativelanguage.v1beta3.IGenerateMessageRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GenerateMessageRequest message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1beta3.GenerateMessageRequest.verify|verify} messages. + * @param message GenerateMessageRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.ai.generativelanguage.v1beta3.IGenerateMessageRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GenerateMessageRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GenerateMessageRequest + * @throws {Error} If the payload is not 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.v1beta3.GenerateMessageRequest; + + /** + * Decodes a GenerateMessageRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GenerateMessageRequest + * @throws {Error} If the payload 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.v1beta3.GenerateMessageRequest; + + /** + * Verifies a GenerateMessageRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GenerateMessageRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GenerateMessageRequest + */ + public static fromObject(object: { [k: string]: any }): google.ai.generativelanguage.v1beta3.GenerateMessageRequest; + + /** + * Creates a plain object from a GenerateMessageRequest message. Also converts values to other types if specified. + * @param message GenerateMessageRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.ai.generativelanguage.v1beta3.GenerateMessageRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GenerateMessageRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GenerateMessageRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a GenerateMessageResponse. */ + interface IGenerateMessageResponse { + + /** GenerateMessageResponse candidates */ + candidates?: (google.ai.generativelanguage.v1beta3.IMessage[]|null); + + /** GenerateMessageResponse messages */ + messages?: (google.ai.generativelanguage.v1beta3.IMessage[]|null); + + /** GenerateMessageResponse filters */ + filters?: (google.ai.generativelanguage.v1beta3.IContentFilter[]|null); + } + + /** Represents a GenerateMessageResponse. */ + class GenerateMessageResponse implements IGenerateMessageResponse { + + /** + * Constructs a new GenerateMessageResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.ai.generativelanguage.v1beta3.IGenerateMessageResponse); + + /** GenerateMessageResponse candidates. */ + public candidates: google.ai.generativelanguage.v1beta3.IMessage[]; + + /** GenerateMessageResponse messages. */ + public messages: google.ai.generativelanguage.v1beta3.IMessage[]; + + /** GenerateMessageResponse filters. */ + public filters: google.ai.generativelanguage.v1beta3.IContentFilter[]; + + /** + * Creates a new GenerateMessageResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns GenerateMessageResponse instance + */ + public static create(properties?: google.ai.generativelanguage.v1beta3.IGenerateMessageResponse): google.ai.generativelanguage.v1beta3.GenerateMessageResponse; + + /** + * Encodes the specified GenerateMessageResponse message. Does not implicitly {@link google.ai.generativelanguage.v1beta3.GenerateMessageResponse.verify|verify} messages. + * @param message GenerateMessageResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.ai.generativelanguage.v1beta3.IGenerateMessageResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GenerateMessageResponse message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1beta3.GenerateMessageResponse.verify|verify} messages. + * @param message GenerateMessageResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.ai.generativelanguage.v1beta3.IGenerateMessageResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GenerateMessageResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GenerateMessageResponse + * @throws {Error} If the payload is not 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.v1beta3.GenerateMessageResponse; + + /** + * Decodes a GenerateMessageResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GenerateMessageResponse + * @throws {Error} If the payload 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.v1beta3.GenerateMessageResponse; + + /** + * Verifies a GenerateMessageResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GenerateMessageResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GenerateMessageResponse + */ + public static fromObject(object: { [k: string]: any }): google.ai.generativelanguage.v1beta3.GenerateMessageResponse; + + /** + * Creates a plain object from a GenerateMessageResponse message. Also converts values to other types if specified. + * @param message GenerateMessageResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.ai.generativelanguage.v1beta3.GenerateMessageResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GenerateMessageResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GenerateMessageResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Message. */ + interface IMessage { + + /** Message author */ + author?: (string|null); + + /** Message content */ + content?: (string|null); + + /** Message citationMetadata */ + citationMetadata?: (google.ai.generativelanguage.v1beta3.ICitationMetadata|null); + } + + /** Represents a Message. */ + class Message implements IMessage { + + /** + * Constructs a new Message. + * @param [properties] Properties to set + */ + constructor(properties?: google.ai.generativelanguage.v1beta3.IMessage); + + /** Message author. */ + public author: string; + + /** Message content. */ + public content: string; + + /** Message citationMetadata. */ + public citationMetadata?: (google.ai.generativelanguage.v1beta3.ICitationMetadata|null); + + /** Message _citationMetadata. */ + public _citationMetadata?: "citationMetadata"; + + /** + * Creates a new Message instance using the specified properties. + * @param [properties] Properties to set + * @returns Message instance + */ + public static create(properties?: google.ai.generativelanguage.v1beta3.IMessage): google.ai.generativelanguage.v1beta3.Message; + + /** + * Encodes the specified Message message. Does not implicitly {@link google.ai.generativelanguage.v1beta3.Message.verify|verify} messages. + * @param message Message message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.ai.generativelanguage.v1beta3.IMessage, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Message message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1beta3.Message.verify|verify} messages. + * @param message Message message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.ai.generativelanguage.v1beta3.IMessage, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Message message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Message + * @throws {Error} If the payload is not 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.v1beta3.Message; + + /** + * Decodes a Message message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Message + * @throws {Error} If the payload 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.v1beta3.Message; + + /** + * Verifies a Message message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Message message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Message + */ + public static fromObject(object: { [k: string]: any }): google.ai.generativelanguage.v1beta3.Message; + + /** + * Creates a plain object from a Message message. Also converts values to other types if specified. + * @param message Message + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.ai.generativelanguage.v1beta3.Message, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Message to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Message + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a MessagePrompt. */ + interface IMessagePrompt { + + /** MessagePrompt context */ + context?: (string|null); + + /** MessagePrompt examples */ + examples?: (google.ai.generativelanguage.v1beta3.IExample[]|null); + + /** MessagePrompt messages */ + messages?: (google.ai.generativelanguage.v1beta3.IMessage[]|null); + } + + /** Represents a MessagePrompt. */ + class MessagePrompt implements IMessagePrompt { + + /** + * Constructs a new MessagePrompt. + * @param [properties] Properties to set + */ + constructor(properties?: google.ai.generativelanguage.v1beta3.IMessagePrompt); + + /** MessagePrompt context. */ + public context: string; + + /** MessagePrompt examples. */ + public examples: google.ai.generativelanguage.v1beta3.IExample[]; + + /** MessagePrompt messages. */ + public messages: google.ai.generativelanguage.v1beta3.IMessage[]; + + /** + * Creates a new MessagePrompt instance using the specified properties. + * @param [properties] Properties to set + * @returns MessagePrompt instance + */ + public static create(properties?: google.ai.generativelanguage.v1beta3.IMessagePrompt): google.ai.generativelanguage.v1beta3.MessagePrompt; + + /** + * Encodes the specified MessagePrompt message. Does not implicitly {@link google.ai.generativelanguage.v1beta3.MessagePrompt.verify|verify} messages. + * @param message MessagePrompt message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.ai.generativelanguage.v1beta3.IMessagePrompt, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified MessagePrompt message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1beta3.MessagePrompt.verify|verify} messages. + * @param message MessagePrompt message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.ai.generativelanguage.v1beta3.IMessagePrompt, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a MessagePrompt message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns MessagePrompt + * @throws {Error} If the payload is not 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.v1beta3.MessagePrompt; + + /** + * Decodes a MessagePrompt message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns MessagePrompt + * @throws {Error} If the payload 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.v1beta3.MessagePrompt; + + /** + * Verifies a MessagePrompt message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a MessagePrompt message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns MessagePrompt + */ + public static fromObject(object: { [k: string]: any }): google.ai.generativelanguage.v1beta3.MessagePrompt; + + /** + * Creates a plain object from a MessagePrompt message. Also converts values to other types if specified. + * @param message MessagePrompt + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.ai.generativelanguage.v1beta3.MessagePrompt, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this MessagePrompt to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for MessagePrompt + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an Example. */ + interface IExample { + + /** Example input */ + input?: (google.ai.generativelanguage.v1beta3.IMessage|null); + + /** Example output */ + output?: (google.ai.generativelanguage.v1beta3.IMessage|null); + } + + /** Represents an Example. */ + class Example implements IExample { + + /** + * Constructs a new Example. + * @param [properties] Properties to set + */ + constructor(properties?: google.ai.generativelanguage.v1beta3.IExample); + + /** Example input. */ + public input?: (google.ai.generativelanguage.v1beta3.IMessage|null); + + /** Example output. */ + public output?: (google.ai.generativelanguage.v1beta3.IMessage|null); + + /** + * Creates a new Example instance using the specified properties. + * @param [properties] Properties to set + * @returns Example instance + */ + public static create(properties?: google.ai.generativelanguage.v1beta3.IExample): google.ai.generativelanguage.v1beta3.Example; + + /** + * Encodes the specified Example message. Does not implicitly {@link google.ai.generativelanguage.v1beta3.Example.verify|verify} messages. + * @param message Example message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.ai.generativelanguage.v1beta3.IExample, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Example message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1beta3.Example.verify|verify} messages. + * @param message Example message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.ai.generativelanguage.v1beta3.IExample, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an Example message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Example + * @throws {Error} If the payload is not 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.v1beta3.Example; + + /** + * Decodes an Example message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Example + * @throws {Error} If the payload 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.v1beta3.Example; + + /** + * Verifies an Example message. + * @param message Plain 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 Example message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Example + */ + public static fromObject(object: { [k: string]: any }): google.ai.generativelanguage.v1beta3.Example; + + /** + * Creates a plain object from an Example message. Also converts values to other types if specified. + * @param message Example + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.ai.generativelanguage.v1beta3.Example, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Example to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Example + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a CountMessageTokensRequest. */ + interface ICountMessageTokensRequest { + + /** CountMessageTokensRequest model */ + model?: (string|null); + + /** CountMessageTokensRequest prompt */ + prompt?: (google.ai.generativelanguage.v1beta3.IMessagePrompt|null); + } + + /** Represents a CountMessageTokensRequest. */ + class CountMessageTokensRequest implements ICountMessageTokensRequest { + + /** + * Constructs a new CountMessageTokensRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.ai.generativelanguage.v1beta3.ICountMessageTokensRequest); + + /** CountMessageTokensRequest model. */ + public model: string; + + /** CountMessageTokensRequest prompt. */ + public prompt?: (google.ai.generativelanguage.v1beta3.IMessagePrompt|null); + + /** + * Creates a new CountMessageTokensRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns CountMessageTokensRequest instance + */ + public static create(properties?: google.ai.generativelanguage.v1beta3.ICountMessageTokensRequest): google.ai.generativelanguage.v1beta3.CountMessageTokensRequest; + + /** + * Encodes the specified CountMessageTokensRequest message. Does not implicitly {@link google.ai.generativelanguage.v1beta3.CountMessageTokensRequest.verify|verify} messages. + * @param message CountMessageTokensRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.ai.generativelanguage.v1beta3.ICountMessageTokensRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CountMessageTokensRequest message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1beta3.CountMessageTokensRequest.verify|verify} messages. + * @param message CountMessageTokensRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.ai.generativelanguage.v1beta3.ICountMessageTokensRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CountMessageTokensRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CountMessageTokensRequest + * @throws {Error} If the payload is not 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.v1beta3.CountMessageTokensRequest; + + /** + * Decodes a CountMessageTokensRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CountMessageTokensRequest + * @throws {Error} If the payload 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.v1beta3.CountMessageTokensRequest; + + /** + * Verifies a CountMessageTokensRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CountMessageTokensRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CountMessageTokensRequest + */ + public static fromObject(object: { [k: string]: any }): google.ai.generativelanguage.v1beta3.CountMessageTokensRequest; + + /** + * Creates a plain object from a CountMessageTokensRequest message. Also converts values to other types if specified. + * @param message CountMessageTokensRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.ai.generativelanguage.v1beta3.CountMessageTokensRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CountMessageTokensRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CountMessageTokensRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a CountMessageTokensResponse. */ + interface ICountMessageTokensResponse { + + /** CountMessageTokensResponse tokenCount */ + tokenCount?: (number|null); + } + + /** Represents a CountMessageTokensResponse. */ + class CountMessageTokensResponse implements ICountMessageTokensResponse { + + /** + * Constructs a new CountMessageTokensResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.ai.generativelanguage.v1beta3.ICountMessageTokensResponse); + + /** CountMessageTokensResponse tokenCount. */ + public tokenCount: number; + + /** + * Creates a new CountMessageTokensResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns CountMessageTokensResponse instance + */ + public static create(properties?: google.ai.generativelanguage.v1beta3.ICountMessageTokensResponse): google.ai.generativelanguage.v1beta3.CountMessageTokensResponse; + + /** + * Encodes the specified CountMessageTokensResponse message. Does not implicitly {@link google.ai.generativelanguage.v1beta3.CountMessageTokensResponse.verify|verify} messages. + * @param message CountMessageTokensResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.ai.generativelanguage.v1beta3.ICountMessageTokensResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CountMessageTokensResponse message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1beta3.CountMessageTokensResponse.verify|verify} messages. + * @param message CountMessageTokensResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.ai.generativelanguage.v1beta3.ICountMessageTokensResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CountMessageTokensResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CountMessageTokensResponse + * @throws {Error} If the payload is not 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.v1beta3.CountMessageTokensResponse; + + /** + * Decodes a CountMessageTokensResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CountMessageTokensResponse + * @throws {Error} If the payload 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.v1beta3.CountMessageTokensResponse; + + /** + * Verifies a CountMessageTokensResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CountMessageTokensResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CountMessageTokensResponse + */ + public static fromObject(object: { [k: string]: any }): google.ai.generativelanguage.v1beta3.CountMessageTokensResponse; + + /** + * Creates a plain object from a CountMessageTokensResponse message. Also converts values to other types if specified. + * @param message CountMessageTokensResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.ai.generativelanguage.v1beta3.CountMessageTokensResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CountMessageTokensResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CountMessageTokensResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** HarmCategory enum. */ + enum HarmCategory { + HARM_CATEGORY_UNSPECIFIED = 0, + HARM_CATEGORY_DEROGATORY = 1, + HARM_CATEGORY_TOXICITY = 2, + HARM_CATEGORY_VIOLENCE = 3, + HARM_CATEGORY_SEXUAL = 4, + HARM_CATEGORY_MEDICAL = 5, + HARM_CATEGORY_DANGEROUS = 6 + } + + /** Properties of a ContentFilter. */ + interface IContentFilter { + + /** ContentFilter reason */ + reason?: (google.ai.generativelanguage.v1beta3.ContentFilter.BlockedReason|keyof typeof google.ai.generativelanguage.v1beta3.ContentFilter.BlockedReason|null); + + /** ContentFilter message */ + message?: (string|null); + } + + /** Represents a ContentFilter. */ + class ContentFilter implements IContentFilter { + + /** + * Constructs a new ContentFilter. + * @param [properties] Properties to set + */ + constructor(properties?: google.ai.generativelanguage.v1beta3.IContentFilter); + + /** ContentFilter reason. */ + public reason: (google.ai.generativelanguage.v1beta3.ContentFilter.BlockedReason|keyof typeof google.ai.generativelanguage.v1beta3.ContentFilter.BlockedReason); + + /** ContentFilter message. */ + public message?: (string|null); + + /** ContentFilter _message. */ + public _message?: "message"; + + /** + * Creates a new ContentFilter instance using the specified properties. + * @param [properties] Properties to set + * @returns ContentFilter instance + */ + public static create(properties?: google.ai.generativelanguage.v1beta3.IContentFilter): google.ai.generativelanguage.v1beta3.ContentFilter; + + /** + * Encodes the specified ContentFilter message. Does not implicitly {@link google.ai.generativelanguage.v1beta3.ContentFilter.verify|verify} messages. + * @param message ContentFilter message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.ai.generativelanguage.v1beta3.IContentFilter, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ContentFilter message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1beta3.ContentFilter.verify|verify} messages. + * @param message ContentFilter message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.ai.generativelanguage.v1beta3.IContentFilter, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ContentFilter message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ContentFilter + * @throws {Error} If the payload is not 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.v1beta3.ContentFilter; + + /** + * Decodes a ContentFilter message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ContentFilter + * @throws {Error} If the payload 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.v1beta3.ContentFilter; + + /** + * Verifies a ContentFilter message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ContentFilter message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ContentFilter + */ + public static fromObject(object: { [k: string]: any }): google.ai.generativelanguage.v1beta3.ContentFilter; + + /** + * Creates a plain object from a ContentFilter message. Also converts values to other types if specified. + * @param message ContentFilter + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.ai.generativelanguage.v1beta3.ContentFilter, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ContentFilter to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ContentFilter + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace ContentFilter { + + /** BlockedReason enum. */ + enum BlockedReason { + BLOCKED_REASON_UNSPECIFIED = 0, + SAFETY = 1, + OTHER = 2 + } + } + + /** Properties of a SafetyFeedback. */ + interface ISafetyFeedback { + + /** SafetyFeedback rating */ + rating?: (google.ai.generativelanguage.v1beta3.ISafetyRating|null); + + /** SafetyFeedback setting */ + setting?: (google.ai.generativelanguage.v1beta3.ISafetySetting|null); + } + + /** Represents a SafetyFeedback. */ + class SafetyFeedback implements ISafetyFeedback { + + /** + * Constructs a new SafetyFeedback. + * @param [properties] Properties to set + */ + constructor(properties?: google.ai.generativelanguage.v1beta3.ISafetyFeedback); + + /** SafetyFeedback rating. */ + public rating?: (google.ai.generativelanguage.v1beta3.ISafetyRating|null); + + /** SafetyFeedback setting. */ + public setting?: (google.ai.generativelanguage.v1beta3.ISafetySetting|null); + + /** + * Creates a new SafetyFeedback instance using the specified properties. + * @param [properties] Properties to set + * @returns SafetyFeedback instance + */ + public static create(properties?: google.ai.generativelanguage.v1beta3.ISafetyFeedback): google.ai.generativelanguage.v1beta3.SafetyFeedback; + + /** + * Encodes the specified SafetyFeedback message. Does not implicitly {@link google.ai.generativelanguage.v1beta3.SafetyFeedback.verify|verify} messages. + * @param message SafetyFeedback message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.ai.generativelanguage.v1beta3.ISafetyFeedback, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified SafetyFeedback message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1beta3.SafetyFeedback.verify|verify} messages. + * @param message SafetyFeedback message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.ai.generativelanguage.v1beta3.ISafetyFeedback, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SafetyFeedback message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns SafetyFeedback + * @throws {Error} If the payload is not 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.v1beta3.SafetyFeedback; + + /** + * Decodes a SafetyFeedback message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns SafetyFeedback + * @throws {Error} If the payload 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.v1beta3.SafetyFeedback; + + /** + * Verifies a SafetyFeedback message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a SafetyFeedback message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns SafetyFeedback + */ + public static fromObject(object: { [k: string]: any }): google.ai.generativelanguage.v1beta3.SafetyFeedback; + + /** + * Creates a plain object from a SafetyFeedback message. Also converts values to other types if specified. + * @param message SafetyFeedback + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.ai.generativelanguage.v1beta3.SafetyFeedback, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this SafetyFeedback to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for SafetyFeedback + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a SafetyRating. */ + interface ISafetyRating { + + /** SafetyRating category */ + category?: (google.ai.generativelanguage.v1beta3.HarmCategory|keyof typeof google.ai.generativelanguage.v1beta3.HarmCategory|null); + + /** SafetyRating probability */ + probability?: (google.ai.generativelanguage.v1beta3.SafetyRating.HarmProbability|keyof typeof google.ai.generativelanguage.v1beta3.SafetyRating.HarmProbability|null); + } + + /** Represents a SafetyRating. */ + class SafetyRating implements ISafetyRating { + + /** + * Constructs a new SafetyRating. + * @param [properties] Properties to set + */ + constructor(properties?: google.ai.generativelanguage.v1beta3.ISafetyRating); + + /** SafetyRating category. */ + public category: (google.ai.generativelanguage.v1beta3.HarmCategory|keyof typeof google.ai.generativelanguage.v1beta3.HarmCategory); + + /** SafetyRating probability. */ + public probability: (google.ai.generativelanguage.v1beta3.SafetyRating.HarmProbability|keyof typeof google.ai.generativelanguage.v1beta3.SafetyRating.HarmProbability); + + /** + * Creates a new SafetyRating instance using the specified properties. + * @param [properties] Properties to set + * @returns SafetyRating instance + */ + public static create(properties?: google.ai.generativelanguage.v1beta3.ISafetyRating): google.ai.generativelanguage.v1beta3.SafetyRating; + + /** + * Encodes the specified SafetyRating message. Does not implicitly {@link google.ai.generativelanguage.v1beta3.SafetyRating.verify|verify} messages. + * @param message SafetyRating message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.ai.generativelanguage.v1beta3.ISafetyRating, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified SafetyRating message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1beta3.SafetyRating.verify|verify} messages. + * @param message SafetyRating message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.ai.generativelanguage.v1beta3.ISafetyRating, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SafetyRating message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns SafetyRating + * @throws {Error} If the payload is not 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.v1beta3.SafetyRating; + + /** + * Decodes a SafetyRating message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns SafetyRating + * @throws {Error} If the payload 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.v1beta3.SafetyRating; + + /** + * Verifies a SafetyRating message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a SafetyRating message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns SafetyRating + */ + public static fromObject(object: { [k: string]: any }): google.ai.generativelanguage.v1beta3.SafetyRating; + + /** + * Creates a plain object from a SafetyRating message. Also converts values to other types if specified. + * @param message SafetyRating + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.ai.generativelanguage.v1beta3.SafetyRating, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this SafetyRating to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for SafetyRating + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace SafetyRating { + + /** HarmProbability enum. */ + enum HarmProbability { + HARM_PROBABILITY_UNSPECIFIED = 0, + NEGLIGIBLE = 1, + LOW = 2, + MEDIUM = 3, + HIGH = 4 + } + } + + /** Properties of a SafetySetting. */ + interface ISafetySetting { + + /** SafetySetting category */ + category?: (google.ai.generativelanguage.v1beta3.HarmCategory|keyof typeof google.ai.generativelanguage.v1beta3.HarmCategory|null); + + /** SafetySetting threshold */ + threshold?: (google.ai.generativelanguage.v1beta3.SafetySetting.HarmBlockThreshold|keyof typeof google.ai.generativelanguage.v1beta3.SafetySetting.HarmBlockThreshold|null); + } + + /** Represents a SafetySetting. */ + class SafetySetting implements ISafetySetting { + + /** + * Constructs a new SafetySetting. + * @param [properties] Properties to set + */ + constructor(properties?: google.ai.generativelanguage.v1beta3.ISafetySetting); + + /** SafetySetting category. */ + public category: (google.ai.generativelanguage.v1beta3.HarmCategory|keyof typeof google.ai.generativelanguage.v1beta3.HarmCategory); + + /** SafetySetting threshold. */ + public threshold: (google.ai.generativelanguage.v1beta3.SafetySetting.HarmBlockThreshold|keyof typeof google.ai.generativelanguage.v1beta3.SafetySetting.HarmBlockThreshold); + + /** + * Creates a new SafetySetting instance using the specified properties. + * @param [properties] Properties to set + * @returns SafetySetting instance + */ + public static create(properties?: google.ai.generativelanguage.v1beta3.ISafetySetting): google.ai.generativelanguage.v1beta3.SafetySetting; + + /** + * Encodes the specified SafetySetting message. Does not implicitly {@link google.ai.generativelanguage.v1beta3.SafetySetting.verify|verify} messages. + * @param message SafetySetting message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.ai.generativelanguage.v1beta3.ISafetySetting, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified SafetySetting message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1beta3.SafetySetting.verify|verify} messages. + * @param message SafetySetting message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.ai.generativelanguage.v1beta3.ISafetySetting, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SafetySetting message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns SafetySetting + * @throws {Error} If the payload is not 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.v1beta3.SafetySetting; + + /** + * Decodes a SafetySetting message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns SafetySetting + * @throws {Error} If the payload 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.v1beta3.SafetySetting; + + /** + * Verifies a SafetySetting message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a SafetySetting message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns SafetySetting + */ + public static fromObject(object: { [k: string]: any }): google.ai.generativelanguage.v1beta3.SafetySetting; + + /** + * Creates a plain object from a SafetySetting message. Also converts values to other types if specified. + * @param message SafetySetting + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.ai.generativelanguage.v1beta3.SafetySetting, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this SafetySetting to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for SafetySetting + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace SafetySetting { + + /** HarmBlockThreshold enum. */ + enum HarmBlockThreshold { + HARM_BLOCK_THRESHOLD_UNSPECIFIED = 0, + BLOCK_LOW_AND_ABOVE = 1, + BLOCK_MEDIUM_AND_ABOVE = 2, + BLOCK_ONLY_HIGH = 3, + BLOCK_NONE = 4 + } + } + + /** Properties of a Model. */ + interface IModel { + + /** Model name */ + name?: (string|null); + + /** Model baseModelId */ + baseModelId?: (string|null); + + /** Model version */ + version?: (string|null); + + /** Model displayName */ + displayName?: (string|null); + + /** Model description */ + description?: (string|null); + + /** Model inputTokenLimit */ + inputTokenLimit?: (number|null); + + /** Model outputTokenLimit */ + outputTokenLimit?: (number|null); + + /** Model supportedGenerationMethods */ + supportedGenerationMethods?: (string[]|null); + + /** Model temperature */ + temperature?: (number|null); + + /** Model topP */ + topP?: (number|null); + + /** Model topK */ + topK?: (number|null); + } + + /** Represents a Model. */ + class Model implements IModel { + + /** + * Constructs a new Model. + * @param [properties] Properties to set + */ + constructor(properties?: google.ai.generativelanguage.v1beta3.IModel); + + /** Model name. */ + public name: string; + + /** Model baseModelId. */ + public baseModelId: string; + + /** Model version. */ + public version: string; + + /** Model displayName. */ + public displayName: string; + + /** Model description. */ + public description: string; + + /** Model inputTokenLimit. */ + public inputTokenLimit: number; + + /** Model outputTokenLimit. */ + public outputTokenLimit: number; + + /** Model supportedGenerationMethods. */ + public supportedGenerationMethods: string[]; + + /** Model temperature. */ + public temperature?: (number|null); + + /** Model topP. */ + public topP?: (number|null); + + /** Model topK. */ + public topK?: (number|null); + + /** Model _temperature. */ + public _temperature?: "temperature"; + + /** Model _topP. */ + public _topP?: "topP"; + + /** Model _topK. */ + public _topK?: "topK"; + + /** + * Creates a new Model instance using the specified properties. + * @param [properties] Properties to set + * @returns Model instance + */ + public static create(properties?: google.ai.generativelanguage.v1beta3.IModel): google.ai.generativelanguage.v1beta3.Model; + + /** + * Encodes the specified Model message. Does not implicitly {@link google.ai.generativelanguage.v1beta3.Model.verify|verify} messages. + * @param message Model message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.ai.generativelanguage.v1beta3.IModel, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Model message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1beta3.Model.verify|verify} messages. + * @param message Model message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.ai.generativelanguage.v1beta3.IModel, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Model message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Model + * @throws {Error} If the payload is not 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.v1beta3.Model; + + /** + * Decodes a Model message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Model + * @throws {Error} If the payload 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.v1beta3.Model; + + /** + * Verifies a Model message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Model message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Model + */ + public static fromObject(object: { [k: string]: any }): google.ai.generativelanguage.v1beta3.Model; + + /** + * Creates a plain object from a Model message. Also converts values to other types if specified. + * @param message Model + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.ai.generativelanguage.v1beta3.Model, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Model to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Model + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Represents a ModelService */ + class ModelService extends $protobuf.rpc.Service { + + /** + * Constructs a new ModelService 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 ModelService 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): ModelService; + + /** + * Calls GetModel. + * @param request GetModelRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Model + */ + public getModel(request: google.ai.generativelanguage.v1beta3.IGetModelRequest, callback: google.ai.generativelanguage.v1beta3.ModelService.GetModelCallback): void; + + /** + * Calls GetModel. + * @param request GetModelRequest message or plain object + * @returns Promise + */ + public getModel(request: google.ai.generativelanguage.v1beta3.IGetModelRequest): Promise; + + /** + * Calls ListModels. + * @param request ListModelsRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ListModelsResponse + */ + public listModels(request: google.ai.generativelanguage.v1beta3.IListModelsRequest, callback: google.ai.generativelanguage.v1beta3.ModelService.ListModelsCallback): void; + + /** + * Calls ListModels. + * @param request ListModelsRequest message or plain object + * @returns Promise + */ + public listModels(request: google.ai.generativelanguage.v1beta3.IListModelsRequest): Promise; + + /** + * Calls GetTunedModel. + * @param request GetTunedModelRequest message or plain object + * @param callback Node-style callback called with the error, if any, and TunedModel + */ + public getTunedModel(request: google.ai.generativelanguage.v1beta3.IGetTunedModelRequest, callback: google.ai.generativelanguage.v1beta3.ModelService.GetTunedModelCallback): void; + + /** + * Calls GetTunedModel. + * @param request GetTunedModelRequest message or plain object + * @returns Promise + */ + public getTunedModel(request: google.ai.generativelanguage.v1beta3.IGetTunedModelRequest): Promise; + + /** + * Calls ListTunedModels. + * @param request ListTunedModelsRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ListTunedModelsResponse + */ + public listTunedModels(request: google.ai.generativelanguage.v1beta3.IListTunedModelsRequest, callback: google.ai.generativelanguage.v1beta3.ModelService.ListTunedModelsCallback): void; + + /** + * Calls ListTunedModels. + * @param request ListTunedModelsRequest message or plain object + * @returns Promise + */ + public listTunedModels(request: google.ai.generativelanguage.v1beta3.IListTunedModelsRequest): Promise; + + /** + * Calls CreateTunedModel. + * @param request CreateTunedModelRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public createTunedModel(request: google.ai.generativelanguage.v1beta3.ICreateTunedModelRequest, callback: google.ai.generativelanguage.v1beta3.ModelService.CreateTunedModelCallback): void; + + /** + * Calls CreateTunedModel. + * @param request CreateTunedModelRequest message or plain object + * @returns Promise + */ + public createTunedModel(request: google.ai.generativelanguage.v1beta3.ICreateTunedModelRequest): Promise; + + /** + * Calls UpdateTunedModel. + * @param request UpdateTunedModelRequest message or plain object + * @param callback Node-style callback called with the error, if any, and TunedModel + */ + public updateTunedModel(request: google.ai.generativelanguage.v1beta3.IUpdateTunedModelRequest, callback: google.ai.generativelanguage.v1beta3.ModelService.UpdateTunedModelCallback): void; + + /** + * Calls UpdateTunedModel. + * @param request UpdateTunedModelRequest message or plain object + * @returns Promise + */ + public updateTunedModel(request: google.ai.generativelanguage.v1beta3.IUpdateTunedModelRequest): Promise; + + /** + * Calls DeleteTunedModel. + * @param request DeleteTunedModelRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Empty + */ + public deleteTunedModel(request: google.ai.generativelanguage.v1beta3.IDeleteTunedModelRequest, callback: google.ai.generativelanguage.v1beta3.ModelService.DeleteTunedModelCallback): void; + + /** + * Calls DeleteTunedModel. + * @param request DeleteTunedModelRequest message or plain object + * @returns Promise + */ + public deleteTunedModel(request: google.ai.generativelanguage.v1beta3.IDeleteTunedModelRequest): Promise; + } + + namespace ModelService { + + /** + * Callback as used by {@link google.ai.generativelanguage.v1beta3.ModelService|getModel}. + * @param error Error, if any + * @param [response] Model + */ + type GetModelCallback = (error: (Error|null), response?: google.ai.generativelanguage.v1beta3.Model) => void; + + /** + * Callback as used by {@link google.ai.generativelanguage.v1beta3.ModelService|listModels}. + * @param error Error, if any + * @param [response] ListModelsResponse + */ + type ListModelsCallback = (error: (Error|null), response?: google.ai.generativelanguage.v1beta3.ListModelsResponse) => void; + + /** + * Callback as used by {@link google.ai.generativelanguage.v1beta3.ModelService|getTunedModel}. + * @param error Error, if any + * @param [response] TunedModel + */ + type GetTunedModelCallback = (error: (Error|null), response?: google.ai.generativelanguage.v1beta3.TunedModel) => void; + + /** + * Callback as used by {@link google.ai.generativelanguage.v1beta3.ModelService|listTunedModels}. + * @param error Error, if any + * @param [response] ListTunedModelsResponse + */ + type ListTunedModelsCallback = (error: (Error|null), response?: google.ai.generativelanguage.v1beta3.ListTunedModelsResponse) => void; + + /** + * Callback as used by {@link google.ai.generativelanguage.v1beta3.ModelService|createTunedModel}. + * @param error Error, if any + * @param [response] Operation + */ + type CreateTunedModelCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.ai.generativelanguage.v1beta3.ModelService|updateTunedModel}. + * @param error Error, if any + * @param [response] TunedModel + */ + type UpdateTunedModelCallback = (error: (Error|null), response?: google.ai.generativelanguage.v1beta3.TunedModel) => void; + + /** + * Callback as used by {@link google.ai.generativelanguage.v1beta3.ModelService|deleteTunedModel}. + * @param error Error, if any + * @param [response] Empty + */ + type DeleteTunedModelCallback = (error: (Error|null), response?: google.protobuf.Empty) => void; + } + + /** Properties of a GetModelRequest. */ + interface IGetModelRequest { + + /** GetModelRequest name */ + name?: (string|null); + } + + /** Represents a GetModelRequest. */ + class GetModelRequest implements IGetModelRequest { + + /** + * Constructs a new GetModelRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.ai.generativelanguage.v1beta3.IGetModelRequest); + + /** GetModelRequest name. */ + public name: string; + + /** + * Creates a new GetModelRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GetModelRequest instance + */ + public static create(properties?: google.ai.generativelanguage.v1beta3.IGetModelRequest): google.ai.generativelanguage.v1beta3.GetModelRequest; + + /** + * Encodes the specified GetModelRequest message. Does not implicitly {@link google.ai.generativelanguage.v1beta3.GetModelRequest.verify|verify} messages. + * @param message GetModelRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.ai.generativelanguage.v1beta3.IGetModelRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GetModelRequest message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1beta3.GetModelRequest.verify|verify} messages. + * @param message GetModelRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.ai.generativelanguage.v1beta3.IGetModelRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GetModelRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GetModelRequest + * @throws {Error} If the payload is not 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.v1beta3.GetModelRequest; + + /** + * Decodes a GetModelRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GetModelRequest + * @throws {Error} If the payload 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.v1beta3.GetModelRequest; + + /** + * Verifies a GetModelRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GetModelRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GetModelRequest + */ + public static fromObject(object: { [k: string]: any }): google.ai.generativelanguage.v1beta3.GetModelRequest; + + /** + * Creates a plain object from a GetModelRequest message. Also converts values to other types if specified. + * @param message GetModelRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.ai.generativelanguage.v1beta3.GetModelRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GetModelRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GetModelRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListModelsRequest. */ + interface IListModelsRequest { + + /** ListModelsRequest pageSize */ + pageSize?: (number|null); + + /** ListModelsRequest pageToken */ + pageToken?: (string|null); + } + + /** Represents a ListModelsRequest. */ + class ListModelsRequest implements IListModelsRequest { + + /** + * Constructs a new ListModelsRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.ai.generativelanguage.v1beta3.IListModelsRequest); + + /** ListModelsRequest pageSize. */ + public pageSize: number; + + /** ListModelsRequest pageToken. */ + public pageToken: string; + + /** + * Creates a new ListModelsRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ListModelsRequest instance + */ + public static create(properties?: google.ai.generativelanguage.v1beta3.IListModelsRequest): google.ai.generativelanguage.v1beta3.ListModelsRequest; + + /** + * Encodes the specified ListModelsRequest message. Does not implicitly {@link google.ai.generativelanguage.v1beta3.ListModelsRequest.verify|verify} messages. + * @param message ListModelsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.ai.generativelanguage.v1beta3.IListModelsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListModelsRequest message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1beta3.ListModelsRequest.verify|verify} messages. + * @param message ListModelsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.ai.generativelanguage.v1beta3.IListModelsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListModelsRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListModelsRequest + * @throws {Error} If the payload is not 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.v1beta3.ListModelsRequest; + + /** + * Decodes a ListModelsRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListModelsRequest + * @throws {Error} If the payload 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.v1beta3.ListModelsRequest; + + /** + * Verifies a ListModelsRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListModelsRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListModelsRequest + */ + public static fromObject(object: { [k: string]: any }): google.ai.generativelanguage.v1beta3.ListModelsRequest; + + /** + * Creates a plain object from a ListModelsRequest message. Also converts values to other types if specified. + * @param message ListModelsRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.ai.generativelanguage.v1beta3.ListModelsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListModelsRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListModelsRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListModelsResponse. */ + interface IListModelsResponse { + + /** ListModelsResponse models */ + models?: (google.ai.generativelanguage.v1beta3.IModel[]|null); + + /** ListModelsResponse nextPageToken */ + nextPageToken?: (string|null); + } + + /** Represents a ListModelsResponse. */ + class ListModelsResponse implements IListModelsResponse { + + /** + * Constructs a new ListModelsResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.ai.generativelanguage.v1beta3.IListModelsResponse); + + /** ListModelsResponse models. */ + public models: google.ai.generativelanguage.v1beta3.IModel[]; + + /** ListModelsResponse nextPageToken. */ + public nextPageToken: string; + + /** + * Creates a new ListModelsResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ListModelsResponse instance + */ + public static create(properties?: google.ai.generativelanguage.v1beta3.IListModelsResponse): google.ai.generativelanguage.v1beta3.ListModelsResponse; + + /** + * Encodes the specified ListModelsResponse message. Does not implicitly {@link google.ai.generativelanguage.v1beta3.ListModelsResponse.verify|verify} messages. + * @param message ListModelsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.ai.generativelanguage.v1beta3.IListModelsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListModelsResponse message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1beta3.ListModelsResponse.verify|verify} messages. + * @param message ListModelsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.ai.generativelanguage.v1beta3.IListModelsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListModelsResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListModelsResponse + * @throws {Error} If the payload is not 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.v1beta3.ListModelsResponse; + + /** + * Decodes a ListModelsResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListModelsResponse + * @throws {Error} If the payload 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.v1beta3.ListModelsResponse; + + /** + * Verifies a ListModelsResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListModelsResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListModelsResponse + */ + public static fromObject(object: { [k: string]: any }): google.ai.generativelanguage.v1beta3.ListModelsResponse; + + /** + * Creates a plain object from a ListModelsResponse message. Also converts values to other types if specified. + * @param message ListModelsResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.ai.generativelanguage.v1beta3.ListModelsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListModelsResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListModelsResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a GetTunedModelRequest. */ + interface IGetTunedModelRequest { + + /** GetTunedModelRequest name */ + name?: (string|null); + } + + /** Represents a GetTunedModelRequest. */ + class GetTunedModelRequest implements IGetTunedModelRequest { + + /** + * Constructs a new GetTunedModelRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.ai.generativelanguage.v1beta3.IGetTunedModelRequest); + + /** GetTunedModelRequest name. */ + public name: string; + + /** + * Creates a new GetTunedModelRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GetTunedModelRequest instance + */ + public static create(properties?: google.ai.generativelanguage.v1beta3.IGetTunedModelRequest): google.ai.generativelanguage.v1beta3.GetTunedModelRequest; + + /** + * Encodes the specified GetTunedModelRequest message. Does not implicitly {@link google.ai.generativelanguage.v1beta3.GetTunedModelRequest.verify|verify} messages. + * @param message GetTunedModelRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.ai.generativelanguage.v1beta3.IGetTunedModelRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GetTunedModelRequest message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1beta3.GetTunedModelRequest.verify|verify} messages. + * @param message GetTunedModelRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.ai.generativelanguage.v1beta3.IGetTunedModelRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GetTunedModelRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GetTunedModelRequest + * @throws {Error} If the payload is not 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.v1beta3.GetTunedModelRequest; + + /** + * Decodes a GetTunedModelRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GetTunedModelRequest + * @throws {Error} If the payload 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.v1beta3.GetTunedModelRequest; + + /** + * Verifies a GetTunedModelRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GetTunedModelRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GetTunedModelRequest + */ + public static fromObject(object: { [k: string]: any }): google.ai.generativelanguage.v1beta3.GetTunedModelRequest; + + /** + * Creates a plain object from a GetTunedModelRequest message. Also converts values to other types if specified. + * @param message GetTunedModelRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.ai.generativelanguage.v1beta3.GetTunedModelRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GetTunedModelRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GetTunedModelRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListTunedModelsRequest. */ + interface IListTunedModelsRequest { + + /** ListTunedModelsRequest pageSize */ + pageSize?: (number|null); + + /** ListTunedModelsRequest pageToken */ + pageToken?: (string|null); + } + + /** Represents a ListTunedModelsRequest. */ + class ListTunedModelsRequest implements IListTunedModelsRequest { + + /** + * Constructs a new ListTunedModelsRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.ai.generativelanguage.v1beta3.IListTunedModelsRequest); + + /** ListTunedModelsRequest pageSize. */ + public pageSize: number; + + /** ListTunedModelsRequest pageToken. */ + public pageToken: string; + + /** + * Creates a new ListTunedModelsRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ListTunedModelsRequest instance + */ + public static create(properties?: google.ai.generativelanguage.v1beta3.IListTunedModelsRequest): google.ai.generativelanguage.v1beta3.ListTunedModelsRequest; + + /** + * Encodes the specified ListTunedModelsRequest message. Does not implicitly {@link google.ai.generativelanguage.v1beta3.ListTunedModelsRequest.verify|verify} messages. + * @param message ListTunedModelsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.ai.generativelanguage.v1beta3.IListTunedModelsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListTunedModelsRequest message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1beta3.ListTunedModelsRequest.verify|verify} messages. + * @param message ListTunedModelsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.ai.generativelanguage.v1beta3.IListTunedModelsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListTunedModelsRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListTunedModelsRequest + * @throws {Error} If the payload is not 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.v1beta3.ListTunedModelsRequest; + + /** + * Decodes a ListTunedModelsRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListTunedModelsRequest + * @throws {Error} If the payload 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.v1beta3.ListTunedModelsRequest; + + /** + * Verifies a ListTunedModelsRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListTunedModelsRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListTunedModelsRequest + */ + public static fromObject(object: { [k: string]: any }): google.ai.generativelanguage.v1beta3.ListTunedModelsRequest; + + /** + * Creates a plain object from a ListTunedModelsRequest message. Also converts values to other types if specified. + * @param message ListTunedModelsRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.ai.generativelanguage.v1beta3.ListTunedModelsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListTunedModelsRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListTunedModelsRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListTunedModelsResponse. */ + interface IListTunedModelsResponse { + + /** ListTunedModelsResponse tunedModels */ + tunedModels?: (google.ai.generativelanguage.v1beta3.ITunedModel[]|null); + + /** ListTunedModelsResponse nextPageToken */ + nextPageToken?: (string|null); + } + + /** Represents a ListTunedModelsResponse. */ + class ListTunedModelsResponse implements IListTunedModelsResponse { + + /** + * Constructs a new ListTunedModelsResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.ai.generativelanguage.v1beta3.IListTunedModelsResponse); + + /** ListTunedModelsResponse tunedModels. */ + public tunedModels: google.ai.generativelanguage.v1beta3.ITunedModel[]; + + /** ListTunedModelsResponse nextPageToken. */ + public nextPageToken: string; + + /** + * Creates a new ListTunedModelsResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ListTunedModelsResponse instance + */ + public static create(properties?: google.ai.generativelanguage.v1beta3.IListTunedModelsResponse): google.ai.generativelanguage.v1beta3.ListTunedModelsResponse; + + /** + * Encodes the specified ListTunedModelsResponse message. Does not implicitly {@link google.ai.generativelanguage.v1beta3.ListTunedModelsResponse.verify|verify} messages. + * @param message ListTunedModelsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.ai.generativelanguage.v1beta3.IListTunedModelsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListTunedModelsResponse message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1beta3.ListTunedModelsResponse.verify|verify} messages. + * @param message ListTunedModelsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.ai.generativelanguage.v1beta3.IListTunedModelsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListTunedModelsResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListTunedModelsResponse + * @throws {Error} If the payload is not 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.v1beta3.ListTunedModelsResponse; + + /** + * Decodes a ListTunedModelsResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListTunedModelsResponse + * @throws {Error} If the payload 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.v1beta3.ListTunedModelsResponse; + + /** + * Verifies a ListTunedModelsResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListTunedModelsResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListTunedModelsResponse + */ + public static fromObject(object: { [k: string]: any }): google.ai.generativelanguage.v1beta3.ListTunedModelsResponse; + + /** + * Creates a plain object from a ListTunedModelsResponse message. Also converts values to other types if specified. + * @param message ListTunedModelsResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.ai.generativelanguage.v1beta3.ListTunedModelsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListTunedModelsResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListTunedModelsResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a CreateTunedModelRequest. */ + interface ICreateTunedModelRequest { + + /** CreateTunedModelRequest tunedModelId */ + tunedModelId?: (string|null); + + /** CreateTunedModelRequest tunedModel */ + tunedModel?: (google.ai.generativelanguage.v1beta3.ITunedModel|null); + } + + /** Represents a CreateTunedModelRequest. */ + class CreateTunedModelRequest implements ICreateTunedModelRequest { + + /** + * Constructs a new CreateTunedModelRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.ai.generativelanguage.v1beta3.ICreateTunedModelRequest); + + /** CreateTunedModelRequest tunedModelId. */ + public tunedModelId?: (string|null); + + /** CreateTunedModelRequest tunedModel. */ + public tunedModel?: (google.ai.generativelanguage.v1beta3.ITunedModel|null); + + /** CreateTunedModelRequest _tunedModelId. */ + public _tunedModelId?: "tunedModelId"; + + /** + * Creates a new CreateTunedModelRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns CreateTunedModelRequest instance + */ + public static create(properties?: google.ai.generativelanguage.v1beta3.ICreateTunedModelRequest): google.ai.generativelanguage.v1beta3.CreateTunedModelRequest; + + /** + * Encodes the specified CreateTunedModelRequest message. Does not implicitly {@link google.ai.generativelanguage.v1beta3.CreateTunedModelRequest.verify|verify} messages. + * @param message CreateTunedModelRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.ai.generativelanguage.v1beta3.ICreateTunedModelRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CreateTunedModelRequest message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1beta3.CreateTunedModelRequest.verify|verify} messages. + * @param message CreateTunedModelRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.ai.generativelanguage.v1beta3.ICreateTunedModelRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CreateTunedModelRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CreateTunedModelRequest + * @throws {Error} If the payload is not 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.v1beta3.CreateTunedModelRequest; + + /** + * Decodes a CreateTunedModelRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CreateTunedModelRequest + * @throws {Error} If the payload 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.v1beta3.CreateTunedModelRequest; + + /** + * Verifies a CreateTunedModelRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CreateTunedModelRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CreateTunedModelRequest + */ + public static fromObject(object: { [k: string]: any }): google.ai.generativelanguage.v1beta3.CreateTunedModelRequest; + + /** + * Creates a plain object from a CreateTunedModelRequest message. Also converts values to other types if specified. + * @param message CreateTunedModelRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.ai.generativelanguage.v1beta3.CreateTunedModelRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CreateTunedModelRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CreateTunedModelRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a CreateTunedModelMetadata. */ + interface ICreateTunedModelMetadata { + + /** CreateTunedModelMetadata tunedModel */ + tunedModel?: (string|null); + + /** CreateTunedModelMetadata totalSteps */ + totalSteps?: (number|null); + + /** CreateTunedModelMetadata completedSteps */ + completedSteps?: (number|null); + + /** CreateTunedModelMetadata completedPercent */ + completedPercent?: (number|null); + + /** CreateTunedModelMetadata snapshots */ + snapshots?: (google.ai.generativelanguage.v1beta3.ITuningSnapshot[]|null); + } + + /** Represents a CreateTunedModelMetadata. */ + class CreateTunedModelMetadata implements ICreateTunedModelMetadata { + + /** + * Constructs a new CreateTunedModelMetadata. + * @param [properties] Properties to set + */ + constructor(properties?: google.ai.generativelanguage.v1beta3.ICreateTunedModelMetadata); + + /** CreateTunedModelMetadata tunedModel. */ + public tunedModel: string; + + /** CreateTunedModelMetadata totalSteps. */ + public totalSteps: number; + + /** CreateTunedModelMetadata completedSteps. */ + public completedSteps: number; + + /** CreateTunedModelMetadata completedPercent. */ + public completedPercent: number; + + /** CreateTunedModelMetadata snapshots. */ + public snapshots: google.ai.generativelanguage.v1beta3.ITuningSnapshot[]; + + /** + * Creates a new CreateTunedModelMetadata instance using the specified properties. + * @param [properties] Properties to set + * @returns CreateTunedModelMetadata instance + */ + public static create(properties?: google.ai.generativelanguage.v1beta3.ICreateTunedModelMetadata): google.ai.generativelanguage.v1beta3.CreateTunedModelMetadata; + + /** + * Encodes the specified CreateTunedModelMetadata message. Does not implicitly {@link google.ai.generativelanguage.v1beta3.CreateTunedModelMetadata.verify|verify} messages. + * @param message CreateTunedModelMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.ai.generativelanguage.v1beta3.ICreateTunedModelMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CreateTunedModelMetadata message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1beta3.CreateTunedModelMetadata.verify|verify} messages. + * @param message CreateTunedModelMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.ai.generativelanguage.v1beta3.ICreateTunedModelMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CreateTunedModelMetadata message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CreateTunedModelMetadata + * @throws {Error} If the payload is not 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.v1beta3.CreateTunedModelMetadata; + + /** + * Decodes a CreateTunedModelMetadata message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CreateTunedModelMetadata + * @throws {Error} If the payload 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.v1beta3.CreateTunedModelMetadata; + + /** + * Verifies a CreateTunedModelMetadata message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CreateTunedModelMetadata message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CreateTunedModelMetadata + */ + public static fromObject(object: { [k: string]: any }): google.ai.generativelanguage.v1beta3.CreateTunedModelMetadata; + + /** + * Creates a plain object from a CreateTunedModelMetadata message. Also converts values to other types if specified. + * @param message CreateTunedModelMetadata + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.ai.generativelanguage.v1beta3.CreateTunedModelMetadata, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CreateTunedModelMetadata to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CreateTunedModelMetadata + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an UpdateTunedModelRequest. */ + interface IUpdateTunedModelRequest { + + /** UpdateTunedModelRequest tunedModel */ + tunedModel?: (google.ai.generativelanguage.v1beta3.ITunedModel|null); + + /** UpdateTunedModelRequest updateMask */ + updateMask?: (google.protobuf.IFieldMask|null); + } + + /** Represents an UpdateTunedModelRequest. */ + class UpdateTunedModelRequest implements IUpdateTunedModelRequest { + + /** + * Constructs a new UpdateTunedModelRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.ai.generativelanguage.v1beta3.IUpdateTunedModelRequest); + + /** UpdateTunedModelRequest tunedModel. */ + public tunedModel?: (google.ai.generativelanguage.v1beta3.ITunedModel|null); + + /** UpdateTunedModelRequest updateMask. */ + public updateMask?: (google.protobuf.IFieldMask|null); + + /** + * Creates a new UpdateTunedModelRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns UpdateTunedModelRequest instance + */ + public static create(properties?: google.ai.generativelanguage.v1beta3.IUpdateTunedModelRequest): google.ai.generativelanguage.v1beta3.UpdateTunedModelRequest; + + /** + * Encodes the specified UpdateTunedModelRequest message. Does not implicitly {@link google.ai.generativelanguage.v1beta3.UpdateTunedModelRequest.verify|verify} messages. + * @param message UpdateTunedModelRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.ai.generativelanguage.v1beta3.IUpdateTunedModelRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified UpdateTunedModelRequest message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1beta3.UpdateTunedModelRequest.verify|verify} messages. + * @param message UpdateTunedModelRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.ai.generativelanguage.v1beta3.IUpdateTunedModelRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an UpdateTunedModelRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns UpdateTunedModelRequest + * @throws {Error} If the payload is not 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.v1beta3.UpdateTunedModelRequest; + + /** + * Decodes an UpdateTunedModelRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns UpdateTunedModelRequest + * @throws {Error} If the payload 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.v1beta3.UpdateTunedModelRequest; + + /** + * Verifies an UpdateTunedModelRequest message. + * @param message Plain 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 UpdateTunedModelRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns UpdateTunedModelRequest + */ + public static fromObject(object: { [k: string]: any }): google.ai.generativelanguage.v1beta3.UpdateTunedModelRequest; + + /** + * Creates a plain object from an UpdateTunedModelRequest message. Also converts values to other types if specified. + * @param message UpdateTunedModelRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.ai.generativelanguage.v1beta3.UpdateTunedModelRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this UpdateTunedModelRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for UpdateTunedModelRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a DeleteTunedModelRequest. */ + interface IDeleteTunedModelRequest { + + /** DeleteTunedModelRequest name */ + name?: (string|null); + } + + /** Represents a DeleteTunedModelRequest. */ + class DeleteTunedModelRequest implements IDeleteTunedModelRequest { + + /** + * Constructs a new DeleteTunedModelRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.ai.generativelanguage.v1beta3.IDeleteTunedModelRequest); + + /** DeleteTunedModelRequest name. */ + public name: string; + + /** + * Creates a new DeleteTunedModelRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns DeleteTunedModelRequest instance + */ + public static create(properties?: google.ai.generativelanguage.v1beta3.IDeleteTunedModelRequest): google.ai.generativelanguage.v1beta3.DeleteTunedModelRequest; + + /** + * Encodes the specified DeleteTunedModelRequest message. Does not implicitly {@link google.ai.generativelanguage.v1beta3.DeleteTunedModelRequest.verify|verify} messages. + * @param message DeleteTunedModelRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.ai.generativelanguage.v1beta3.IDeleteTunedModelRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DeleteTunedModelRequest message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1beta3.DeleteTunedModelRequest.verify|verify} messages. + * @param message DeleteTunedModelRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.ai.generativelanguage.v1beta3.IDeleteTunedModelRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DeleteTunedModelRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DeleteTunedModelRequest + * @throws {Error} If the payload is not 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.v1beta3.DeleteTunedModelRequest; + + /** + * Decodes a DeleteTunedModelRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DeleteTunedModelRequest + * @throws {Error} If the payload 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.v1beta3.DeleteTunedModelRequest; + + /** + * Verifies a DeleteTunedModelRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DeleteTunedModelRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DeleteTunedModelRequest + */ + public static fromObject(object: { [k: string]: any }): google.ai.generativelanguage.v1beta3.DeleteTunedModelRequest; + + /** + * Creates a plain object from a DeleteTunedModelRequest message. Also converts values to other types if specified. + * @param message DeleteTunedModelRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.ai.generativelanguage.v1beta3.DeleteTunedModelRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DeleteTunedModelRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DeleteTunedModelRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TunedModel. */ + interface ITunedModel { + + /** TunedModel tunedModelSource */ + tunedModelSource?: (google.ai.generativelanguage.v1beta3.ITunedModelSource|null); + + /** TunedModel baseModel */ + baseModel?: (string|null); + + /** TunedModel name */ + name?: (string|null); + + /** TunedModel displayName */ + displayName?: (string|null); + + /** TunedModel description */ + description?: (string|null); + + /** TunedModel temperature */ + temperature?: (number|null); + + /** TunedModel topP */ + topP?: (number|null); + + /** TunedModel topK */ + topK?: (number|null); + + /** TunedModel state */ + state?: (google.ai.generativelanguage.v1beta3.TunedModel.State|keyof typeof google.ai.generativelanguage.v1beta3.TunedModel.State|null); + + /** TunedModel createTime */ + createTime?: (google.protobuf.ITimestamp|null); + + /** TunedModel updateTime */ + updateTime?: (google.protobuf.ITimestamp|null); + + /** TunedModel tuningTask */ + tuningTask?: (google.ai.generativelanguage.v1beta3.ITuningTask|null); + } + + /** Represents a TunedModel. */ + class TunedModel implements ITunedModel { + + /** + * Constructs a new TunedModel. + * @param [properties] Properties to set + */ + constructor(properties?: google.ai.generativelanguage.v1beta3.ITunedModel); + + /** TunedModel tunedModelSource. */ + public tunedModelSource?: (google.ai.generativelanguage.v1beta3.ITunedModelSource|null); + + /** TunedModel baseModel. */ + public baseModel?: (string|null); + + /** TunedModel name. */ + public name: string; + + /** TunedModel displayName. */ + public displayName: string; + + /** TunedModel description. */ + public description: string; + + /** TunedModel temperature. */ + public temperature?: (number|null); + + /** TunedModel topP. */ + public topP?: (number|null); + + /** TunedModel topK. */ + public topK?: (number|null); + + /** TunedModel state. */ + public state: (google.ai.generativelanguage.v1beta3.TunedModel.State|keyof typeof google.ai.generativelanguage.v1beta3.TunedModel.State); + + /** TunedModel createTime. */ + public createTime?: (google.protobuf.ITimestamp|null); + + /** TunedModel updateTime. */ + public updateTime?: (google.protobuf.ITimestamp|null); + + /** TunedModel tuningTask. */ + public tuningTask?: (google.ai.generativelanguage.v1beta3.ITuningTask|null); + + /** TunedModel sourceModel. */ + public sourceModel?: ("tunedModelSource"|"baseModel"); + + /** TunedModel _temperature. */ + public _temperature?: "temperature"; + + /** TunedModel _topP. */ + public _topP?: "topP"; + + /** TunedModel _topK. */ + public _topK?: "topK"; + + /** + * Creates a new TunedModel instance using the specified properties. + * @param [properties] Properties to set + * @returns TunedModel instance + */ + public static create(properties?: google.ai.generativelanguage.v1beta3.ITunedModel): google.ai.generativelanguage.v1beta3.TunedModel; + + /** + * Encodes the specified TunedModel message. Does not implicitly {@link google.ai.generativelanguage.v1beta3.TunedModel.verify|verify} messages. + * @param message TunedModel message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.ai.generativelanguage.v1beta3.ITunedModel, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified TunedModel message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1beta3.TunedModel.verify|verify} messages. + * @param message TunedModel message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.ai.generativelanguage.v1beta3.ITunedModel, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TunedModel message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns TunedModel + * @throws {Error} If the payload is not 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.v1beta3.TunedModel; + + /** + * Decodes a TunedModel message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns TunedModel + * @throws {Error} If the payload 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.v1beta3.TunedModel; + + /** + * Verifies a TunedModel message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a TunedModel message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns TunedModel + */ + public static fromObject(object: { [k: string]: any }): google.ai.generativelanguage.v1beta3.TunedModel; + + /** + * Creates a plain object from a TunedModel message. Also converts values to other types if specified. + * @param message TunedModel + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.ai.generativelanguage.v1beta3.TunedModel, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this TunedModel to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for TunedModel + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace TunedModel { + + /** State enum. */ + enum State { + STATE_UNSPECIFIED = 0, + CREATING = 1, + ACTIVE = 2, + FAILED = 3 + } + } + + /** Properties of a TunedModelSource. */ + interface ITunedModelSource { + + /** TunedModelSource tunedModel */ + tunedModel?: (string|null); + + /** TunedModelSource baseModel */ + baseModel?: (string|null); + } + + /** Represents a TunedModelSource. */ + class TunedModelSource implements ITunedModelSource { + + /** + * Constructs a new TunedModelSource. + * @param [properties] Properties to set + */ + constructor(properties?: google.ai.generativelanguage.v1beta3.ITunedModelSource); + + /** TunedModelSource tunedModel. */ + public tunedModel: string; + + /** TunedModelSource baseModel. */ + public baseModel: string; + + /** + * Creates a new TunedModelSource instance using the specified properties. + * @param [properties] Properties to set + * @returns TunedModelSource instance + */ + public static create(properties?: google.ai.generativelanguage.v1beta3.ITunedModelSource): google.ai.generativelanguage.v1beta3.TunedModelSource; + + /** + * Encodes the specified TunedModelSource message. Does not implicitly {@link google.ai.generativelanguage.v1beta3.TunedModelSource.verify|verify} messages. + * @param message TunedModelSource message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.ai.generativelanguage.v1beta3.ITunedModelSource, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified TunedModelSource message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1beta3.TunedModelSource.verify|verify} messages. + * @param message TunedModelSource message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.ai.generativelanguage.v1beta3.ITunedModelSource, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TunedModelSource message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns TunedModelSource + * @throws {Error} If the payload is not 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.v1beta3.TunedModelSource; + + /** + * Decodes a TunedModelSource message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns TunedModelSource + * @throws {Error} If the payload 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.v1beta3.TunedModelSource; + + /** + * Verifies a TunedModelSource message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a TunedModelSource message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns TunedModelSource + */ + public static fromObject(object: { [k: string]: any }): google.ai.generativelanguage.v1beta3.TunedModelSource; + + /** + * Creates a plain object from a TunedModelSource message. Also converts values to other types if specified. + * @param message TunedModelSource + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.ai.generativelanguage.v1beta3.TunedModelSource, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this TunedModelSource to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for TunedModelSource + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TuningTask. */ + interface ITuningTask { + + /** TuningTask startTime */ + startTime?: (google.protobuf.ITimestamp|null); + + /** TuningTask completeTime */ + completeTime?: (google.protobuf.ITimestamp|null); + + /** TuningTask snapshots */ + snapshots?: (google.ai.generativelanguage.v1beta3.ITuningSnapshot[]|null); + + /** TuningTask trainingData */ + trainingData?: (google.ai.generativelanguage.v1beta3.IDataset|null); + + /** TuningTask hyperparameters */ + hyperparameters?: (google.ai.generativelanguage.v1beta3.IHyperparameters|null); + } + + /** Represents a TuningTask. */ + class TuningTask implements ITuningTask { + + /** + * Constructs a new TuningTask. + * @param [properties] Properties to set + */ + constructor(properties?: google.ai.generativelanguage.v1beta3.ITuningTask); + + /** TuningTask startTime. */ + public startTime?: (google.protobuf.ITimestamp|null); + + /** TuningTask completeTime. */ + public completeTime?: (google.protobuf.ITimestamp|null); + + /** TuningTask snapshots. */ + public snapshots: google.ai.generativelanguage.v1beta3.ITuningSnapshot[]; + + /** TuningTask trainingData. */ + public trainingData?: (google.ai.generativelanguage.v1beta3.IDataset|null); + + /** TuningTask hyperparameters. */ + public hyperparameters?: (google.ai.generativelanguage.v1beta3.IHyperparameters|null); + + /** + * Creates a new TuningTask instance using the specified properties. + * @param [properties] Properties to set + * @returns TuningTask instance + */ + public static create(properties?: google.ai.generativelanguage.v1beta3.ITuningTask): google.ai.generativelanguage.v1beta3.TuningTask; + + /** + * Encodes the specified TuningTask message. Does not implicitly {@link google.ai.generativelanguage.v1beta3.TuningTask.verify|verify} messages. + * @param message TuningTask message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.ai.generativelanguage.v1beta3.ITuningTask, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified TuningTask message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1beta3.TuningTask.verify|verify} messages. + * @param message TuningTask message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.ai.generativelanguage.v1beta3.ITuningTask, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TuningTask message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns TuningTask + * @throws {Error} If the payload is not 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.v1beta3.TuningTask; + + /** + * Decodes a TuningTask message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns TuningTask + * @throws {Error} If the payload 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.v1beta3.TuningTask; + + /** + * Verifies a TuningTask message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a TuningTask message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns TuningTask + */ + public static fromObject(object: { [k: string]: any }): google.ai.generativelanguage.v1beta3.TuningTask; + + /** + * Creates a plain object from a TuningTask message. Also converts values to other types if specified. + * @param message TuningTask + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.ai.generativelanguage.v1beta3.TuningTask, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this TuningTask to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for TuningTask + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Hyperparameters. */ + interface IHyperparameters { + + /** Hyperparameters epochCount */ + epochCount?: (number|null); + + /** Hyperparameters batchSize */ + batchSize?: (number|null); + + /** Hyperparameters learningRate */ + learningRate?: (number|null); + } + + /** Represents a Hyperparameters. */ + class Hyperparameters implements IHyperparameters { + + /** + * Constructs a new Hyperparameters. + * @param [properties] Properties to set + */ + constructor(properties?: google.ai.generativelanguage.v1beta3.IHyperparameters); + + /** Hyperparameters epochCount. */ + public epochCount?: (number|null); + + /** Hyperparameters batchSize. */ + public batchSize?: (number|null); + + /** Hyperparameters learningRate. */ + public learningRate?: (number|null); + + /** Hyperparameters _epochCount. */ + public _epochCount?: "epochCount"; + + /** Hyperparameters _batchSize. */ + public _batchSize?: "batchSize"; + + /** Hyperparameters _learningRate. */ + public _learningRate?: "learningRate"; + + /** + * Creates a new Hyperparameters instance using the specified properties. + * @param [properties] Properties to set + * @returns Hyperparameters instance + */ + public static create(properties?: google.ai.generativelanguage.v1beta3.IHyperparameters): google.ai.generativelanguage.v1beta3.Hyperparameters; + + /** + * Encodes the specified Hyperparameters message. Does not implicitly {@link google.ai.generativelanguage.v1beta3.Hyperparameters.verify|verify} messages. + * @param message Hyperparameters message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.ai.generativelanguage.v1beta3.IHyperparameters, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Hyperparameters message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1beta3.Hyperparameters.verify|verify} messages. + * @param message Hyperparameters message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.ai.generativelanguage.v1beta3.IHyperparameters, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Hyperparameters message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Hyperparameters + * @throws {Error} If the payload is not 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.v1beta3.Hyperparameters; + + /** + * Decodes a Hyperparameters message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Hyperparameters + * @throws {Error} If the payload 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.v1beta3.Hyperparameters; + + /** + * Verifies a Hyperparameters message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Hyperparameters message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Hyperparameters + */ + public static fromObject(object: { [k: string]: any }): google.ai.generativelanguage.v1beta3.Hyperparameters; + + /** + * Creates a plain object from a Hyperparameters message. Also converts values to other types if specified. + * @param message Hyperparameters + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.ai.generativelanguage.v1beta3.Hyperparameters, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Hyperparameters to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Hyperparameters + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Dataset. */ + interface IDataset { + + /** Dataset examples */ + examples?: (google.ai.generativelanguage.v1beta3.ITuningExamples|null); + } + + /** Represents a Dataset. */ + class Dataset implements IDataset { + + /** + * Constructs a new Dataset. + * @param [properties] Properties to set + */ + constructor(properties?: google.ai.generativelanguage.v1beta3.IDataset); + + /** Dataset examples. */ + public examples?: (google.ai.generativelanguage.v1beta3.ITuningExamples|null); + + /** Dataset dataset. */ + public dataset?: "examples"; + + /** + * Creates a new Dataset instance using the specified properties. + * @param [properties] Properties to set + * @returns Dataset instance + */ + public static create(properties?: google.ai.generativelanguage.v1beta3.IDataset): google.ai.generativelanguage.v1beta3.Dataset; + + /** + * Encodes the specified Dataset message. Does not implicitly {@link google.ai.generativelanguage.v1beta3.Dataset.verify|verify} messages. + * @param message Dataset message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.ai.generativelanguage.v1beta3.IDataset, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Dataset message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1beta3.Dataset.verify|verify} messages. + * @param message Dataset message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.ai.generativelanguage.v1beta3.IDataset, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Dataset message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Dataset + * @throws {Error} If the payload is not 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.v1beta3.Dataset; + + /** + * Decodes a Dataset message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Dataset + * @throws {Error} If the payload 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.v1beta3.Dataset; + + /** + * Verifies a Dataset message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Dataset message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Dataset + */ + public static fromObject(object: { [k: string]: any }): google.ai.generativelanguage.v1beta3.Dataset; + + /** + * Creates a plain object from a Dataset message. Also converts values to other types if specified. + * @param message Dataset + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.ai.generativelanguage.v1beta3.Dataset, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Dataset to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Dataset + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TuningExamples. */ + interface ITuningExamples { + + /** TuningExamples examples */ + examples?: (google.ai.generativelanguage.v1beta3.ITuningExample[]|null); + } + + /** Represents a TuningExamples. */ + class TuningExamples implements ITuningExamples { + + /** + * Constructs a new TuningExamples. + * @param [properties] Properties to set + */ + constructor(properties?: google.ai.generativelanguage.v1beta3.ITuningExamples); + + /** TuningExamples examples. */ + public examples: google.ai.generativelanguage.v1beta3.ITuningExample[]; + + /** + * Creates a new TuningExamples instance using the specified properties. + * @param [properties] Properties to set + * @returns TuningExamples instance + */ + public static create(properties?: google.ai.generativelanguage.v1beta3.ITuningExamples): google.ai.generativelanguage.v1beta3.TuningExamples; + + /** + * Encodes the specified TuningExamples message. Does not implicitly {@link google.ai.generativelanguage.v1beta3.TuningExamples.verify|verify} messages. + * @param message TuningExamples message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.ai.generativelanguage.v1beta3.ITuningExamples, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified TuningExamples message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1beta3.TuningExamples.verify|verify} messages. + * @param message TuningExamples message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.ai.generativelanguage.v1beta3.ITuningExamples, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TuningExamples message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns TuningExamples + * @throws {Error} If the payload is not 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.v1beta3.TuningExamples; + + /** + * Decodes a TuningExamples message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns TuningExamples + * @throws {Error} If the payload 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.v1beta3.TuningExamples; + + /** + * Verifies a TuningExamples message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a TuningExamples message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns TuningExamples + */ + public static fromObject(object: { [k: string]: any }): google.ai.generativelanguage.v1beta3.TuningExamples; + + /** + * Creates a plain object from a TuningExamples message. Also converts values to other types if specified. + * @param message TuningExamples + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.ai.generativelanguage.v1beta3.TuningExamples, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this TuningExamples to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for TuningExamples + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TuningExample. */ + interface ITuningExample { + + /** TuningExample textInput */ + textInput?: (string|null); + + /** TuningExample output */ + output?: (string|null); + } + + /** Represents a TuningExample. */ + class TuningExample implements ITuningExample { + + /** + * Constructs a new TuningExample. + * @param [properties] Properties to set + */ + constructor(properties?: google.ai.generativelanguage.v1beta3.ITuningExample); + + /** TuningExample textInput. */ + public textInput?: (string|null); + + /** TuningExample output. */ + public output: string; + + /** TuningExample modelInput. */ + public modelInput?: "textInput"; + + /** + * Creates a new TuningExample instance using the specified properties. + * @param [properties] Properties to set + * @returns TuningExample instance + */ + public static create(properties?: google.ai.generativelanguage.v1beta3.ITuningExample): google.ai.generativelanguage.v1beta3.TuningExample; + + /** + * Encodes the specified TuningExample message. Does not implicitly {@link google.ai.generativelanguage.v1beta3.TuningExample.verify|verify} messages. + * @param message TuningExample message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.ai.generativelanguage.v1beta3.ITuningExample, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified TuningExample message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1beta3.TuningExample.verify|verify} messages. + * @param message TuningExample message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.ai.generativelanguage.v1beta3.ITuningExample, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TuningExample message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns TuningExample + * @throws {Error} If the payload is not 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.v1beta3.TuningExample; + + /** + * Decodes a TuningExample message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns TuningExample + * @throws {Error} If the payload 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.v1beta3.TuningExample; + + /** + * Verifies a TuningExample message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a TuningExample message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns TuningExample + */ + public static fromObject(object: { [k: string]: any }): google.ai.generativelanguage.v1beta3.TuningExample; + + /** + * Creates a plain object from a TuningExample message. Also converts values to other types if specified. + * @param message TuningExample + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.ai.generativelanguage.v1beta3.TuningExample, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this TuningExample to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for TuningExample + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TuningSnapshot. */ + interface ITuningSnapshot { + + /** TuningSnapshot step */ + step?: (number|null); + + /** TuningSnapshot epoch */ + epoch?: (number|null); + + /** TuningSnapshot meanLoss */ + meanLoss?: (number|null); + + /** TuningSnapshot computeTime */ + computeTime?: (google.protobuf.ITimestamp|null); + } + + /** Represents a TuningSnapshot. */ + class TuningSnapshot implements ITuningSnapshot { + + /** + * Constructs a new TuningSnapshot. + * @param [properties] Properties to set + */ + constructor(properties?: google.ai.generativelanguage.v1beta3.ITuningSnapshot); + + /** TuningSnapshot step. */ + public step: number; + + /** TuningSnapshot epoch. */ + public epoch: number; + + /** TuningSnapshot meanLoss. */ + public meanLoss: number; + + /** TuningSnapshot computeTime. */ + public computeTime?: (google.protobuf.ITimestamp|null); + + /** + * Creates a new TuningSnapshot instance using the specified properties. + * @param [properties] Properties to set + * @returns TuningSnapshot instance + */ + public static create(properties?: google.ai.generativelanguage.v1beta3.ITuningSnapshot): google.ai.generativelanguage.v1beta3.TuningSnapshot; + + /** + * Encodes the specified TuningSnapshot message. Does not implicitly {@link google.ai.generativelanguage.v1beta3.TuningSnapshot.verify|verify} messages. + * @param message TuningSnapshot message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.ai.generativelanguage.v1beta3.ITuningSnapshot, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified TuningSnapshot message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1beta3.TuningSnapshot.verify|verify} messages. + * @param message TuningSnapshot message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.ai.generativelanguage.v1beta3.ITuningSnapshot, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TuningSnapshot message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns TuningSnapshot + * @throws {Error} If the payload is not 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.v1beta3.TuningSnapshot; + + /** + * Decodes a TuningSnapshot message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns TuningSnapshot + * @throws {Error} If the payload 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.v1beta3.TuningSnapshot; + + /** + * Verifies a TuningSnapshot message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a TuningSnapshot message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns TuningSnapshot + */ + public static fromObject(object: { [k: string]: any }): google.ai.generativelanguage.v1beta3.TuningSnapshot; + + /** + * Creates a plain object from a TuningSnapshot message. Also converts values to other types if specified. + * @param message TuningSnapshot + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.ai.generativelanguage.v1beta3.TuningSnapshot, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this TuningSnapshot to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for TuningSnapshot + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Permission. */ + interface IPermission { + + /** Permission name */ + name?: (string|null); + + /** Permission granteeType */ + granteeType?: (google.ai.generativelanguage.v1beta3.Permission.GranteeType|keyof typeof google.ai.generativelanguage.v1beta3.Permission.GranteeType|null); + + /** Permission emailAddress */ + emailAddress?: (string|null); + + /** Permission role */ + role?: (google.ai.generativelanguage.v1beta3.Permission.Role|keyof typeof google.ai.generativelanguage.v1beta3.Permission.Role|null); + } + + /** Represents a Permission. */ + class Permission implements IPermission { + + /** + * Constructs a new Permission. + * @param [properties] Properties to set + */ + constructor(properties?: google.ai.generativelanguage.v1beta3.IPermission); + + /** Permission name. */ + public name: string; + + /** Permission granteeType. */ + public granteeType?: (google.ai.generativelanguage.v1beta3.Permission.GranteeType|keyof typeof google.ai.generativelanguage.v1beta3.Permission.GranteeType|null); + + /** Permission emailAddress. */ + public emailAddress?: (string|null); + + /** Permission role. */ + public role?: (google.ai.generativelanguage.v1beta3.Permission.Role|keyof typeof google.ai.generativelanguage.v1beta3.Permission.Role|null); + + /** Permission _granteeType. */ + public _granteeType?: "granteeType"; + + /** Permission _emailAddress. */ + public _emailAddress?: "emailAddress"; + + /** Permission _role. */ + public _role?: "role"; + + /** + * Creates a new Permission instance using the specified properties. + * @param [properties] Properties to set + * @returns Permission instance + */ + public static create(properties?: google.ai.generativelanguage.v1beta3.IPermission): google.ai.generativelanguage.v1beta3.Permission; + + /** + * Encodes the specified Permission message. Does not implicitly {@link google.ai.generativelanguage.v1beta3.Permission.verify|verify} messages. + * @param message Permission message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.ai.generativelanguage.v1beta3.IPermission, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Permission message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1beta3.Permission.verify|verify} messages. + * @param message Permission message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.ai.generativelanguage.v1beta3.IPermission, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Permission message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Permission + * @throws {Error} If the payload is not 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.v1beta3.Permission; + + /** + * Decodes a Permission message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Permission + * @throws {Error} If the payload 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.v1beta3.Permission; + + /** + * Verifies a Permission message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Permission message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Permission + */ + public static fromObject(object: { [k: string]: any }): google.ai.generativelanguage.v1beta3.Permission; + + /** + * Creates a plain object from a Permission message. Also converts values to other types if specified. + * @param message Permission + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.ai.generativelanguage.v1beta3.Permission, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Permission to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Permission + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace Permission { + + /** GranteeType enum. */ + enum GranteeType { + GRANTEE_TYPE_UNSPECIFIED = 0, + USER = 1, + GROUP = 2, + EVERYONE = 3 + } + + /** Role enum. */ + enum Role { + ROLE_UNSPECIFIED = 0, + OWNER = 1, + WRITER = 2, + READER = 3 + } + } + + /** Represents a PermissionService */ + class PermissionService extends $protobuf.rpc.Service { + + /** + * Constructs a new PermissionService 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 PermissionService 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): PermissionService; + + /** + * Calls CreatePermission. + * @param request CreatePermissionRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Permission + */ + public createPermission(request: google.ai.generativelanguage.v1beta3.ICreatePermissionRequest, callback: google.ai.generativelanguage.v1beta3.PermissionService.CreatePermissionCallback): void; + + /** + * Calls CreatePermission. + * @param request CreatePermissionRequest message or plain object + * @returns Promise + */ + public createPermission(request: google.ai.generativelanguage.v1beta3.ICreatePermissionRequest): Promise; + + /** + * Calls GetPermission. + * @param request GetPermissionRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Permission + */ + public getPermission(request: google.ai.generativelanguage.v1beta3.IGetPermissionRequest, callback: google.ai.generativelanguage.v1beta3.PermissionService.GetPermissionCallback): void; + + /** + * Calls GetPermission. + * @param request GetPermissionRequest message or plain object + * @returns Promise + */ + public getPermission(request: google.ai.generativelanguage.v1beta3.IGetPermissionRequest): Promise; + + /** + * Calls ListPermissions. + * @param request ListPermissionsRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ListPermissionsResponse + */ + public listPermissions(request: google.ai.generativelanguage.v1beta3.IListPermissionsRequest, callback: google.ai.generativelanguage.v1beta3.PermissionService.ListPermissionsCallback): void; + + /** + * Calls ListPermissions. + * @param request ListPermissionsRequest message or plain object + * @returns Promise + */ + public listPermissions(request: google.ai.generativelanguage.v1beta3.IListPermissionsRequest): Promise; + + /** + * Calls UpdatePermission. + * @param request UpdatePermissionRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Permission + */ + public updatePermission(request: google.ai.generativelanguage.v1beta3.IUpdatePermissionRequest, callback: google.ai.generativelanguage.v1beta3.PermissionService.UpdatePermissionCallback): void; + + /** + * Calls UpdatePermission. + * @param request UpdatePermissionRequest message or plain object + * @returns Promise + */ + public updatePermission(request: google.ai.generativelanguage.v1beta3.IUpdatePermissionRequest): Promise; + + /** + * Calls DeletePermission. + * @param request DeletePermissionRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Empty + */ + public deletePermission(request: google.ai.generativelanguage.v1beta3.IDeletePermissionRequest, callback: google.ai.generativelanguage.v1beta3.PermissionService.DeletePermissionCallback): void; + + /** + * Calls DeletePermission. + * @param request DeletePermissionRequest message or plain object + * @returns Promise + */ + public deletePermission(request: google.ai.generativelanguage.v1beta3.IDeletePermissionRequest): Promise; + + /** + * Calls TransferOwnership. + * @param request TransferOwnershipRequest message or plain object + * @param callback Node-style callback called with the error, if any, and TransferOwnershipResponse + */ + public transferOwnership(request: google.ai.generativelanguage.v1beta3.ITransferOwnershipRequest, callback: google.ai.generativelanguage.v1beta3.PermissionService.TransferOwnershipCallback): void; + + /** + * Calls TransferOwnership. + * @param request TransferOwnershipRequest message or plain object + * @returns Promise + */ + public transferOwnership(request: google.ai.generativelanguage.v1beta3.ITransferOwnershipRequest): Promise; + } + + namespace PermissionService { + + /** + * Callback as used by {@link google.ai.generativelanguage.v1beta3.PermissionService|createPermission}. + * @param error Error, if any + * @param [response] Permission + */ + type CreatePermissionCallback = (error: (Error|null), response?: google.ai.generativelanguage.v1beta3.Permission) => void; + + /** + * Callback as used by {@link google.ai.generativelanguage.v1beta3.PermissionService|getPermission}. + * @param error Error, if any + * @param [response] Permission + */ + type GetPermissionCallback = (error: (Error|null), response?: google.ai.generativelanguage.v1beta3.Permission) => void; + + /** + * Callback as used by {@link google.ai.generativelanguage.v1beta3.PermissionService|listPermissions}. + * @param error Error, if any + * @param [response] ListPermissionsResponse + */ + type ListPermissionsCallback = (error: (Error|null), response?: google.ai.generativelanguage.v1beta3.ListPermissionsResponse) => void; + + /** + * Callback as used by {@link google.ai.generativelanguage.v1beta3.PermissionService|updatePermission}. + * @param error Error, if any + * @param [response] Permission + */ + type UpdatePermissionCallback = (error: (Error|null), response?: google.ai.generativelanguage.v1beta3.Permission) => void; + + /** + * Callback as used by {@link google.ai.generativelanguage.v1beta3.PermissionService|deletePermission}. + * @param error Error, if any + * @param [response] Empty + */ + type DeletePermissionCallback = (error: (Error|null), response?: google.protobuf.Empty) => void; + + /** + * Callback as used by {@link google.ai.generativelanguage.v1beta3.PermissionService|transferOwnership}. + * @param error Error, if any + * @param [response] TransferOwnershipResponse + */ + type TransferOwnershipCallback = (error: (Error|null), response?: google.ai.generativelanguage.v1beta3.TransferOwnershipResponse) => void; + } + + /** Properties of a CreatePermissionRequest. */ + interface ICreatePermissionRequest { + + /** CreatePermissionRequest parent */ + parent?: (string|null); + + /** CreatePermissionRequest permission */ + permission?: (google.ai.generativelanguage.v1beta3.IPermission|null); + } + + /** Represents a CreatePermissionRequest. */ + class CreatePermissionRequest implements ICreatePermissionRequest { + + /** + * Constructs a new CreatePermissionRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.ai.generativelanguage.v1beta3.ICreatePermissionRequest); + + /** CreatePermissionRequest parent. */ + public parent: string; + + /** CreatePermissionRequest permission. */ + public permission?: (google.ai.generativelanguage.v1beta3.IPermission|null); + + /** + * Creates a new CreatePermissionRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns CreatePermissionRequest instance + */ + public static create(properties?: google.ai.generativelanguage.v1beta3.ICreatePermissionRequest): google.ai.generativelanguage.v1beta3.CreatePermissionRequest; + + /** + * Encodes the specified CreatePermissionRequest message. Does not implicitly {@link google.ai.generativelanguage.v1beta3.CreatePermissionRequest.verify|verify} messages. + * @param message CreatePermissionRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.ai.generativelanguage.v1beta3.ICreatePermissionRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CreatePermissionRequest message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1beta3.CreatePermissionRequest.verify|verify} messages. + * @param message CreatePermissionRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.ai.generativelanguage.v1beta3.ICreatePermissionRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CreatePermissionRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CreatePermissionRequest + * @throws {Error} If the payload is not 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.v1beta3.CreatePermissionRequest; + + /** + * Decodes a CreatePermissionRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CreatePermissionRequest + * @throws {Error} If the payload 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.v1beta3.CreatePermissionRequest; + + /** + * Verifies a CreatePermissionRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CreatePermissionRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CreatePermissionRequest + */ + public static fromObject(object: { [k: string]: any }): google.ai.generativelanguage.v1beta3.CreatePermissionRequest; + + /** + * Creates a plain object from a CreatePermissionRequest message. Also converts values to other types if specified. + * @param message CreatePermissionRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.ai.generativelanguage.v1beta3.CreatePermissionRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CreatePermissionRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CreatePermissionRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a GetPermissionRequest. */ + interface IGetPermissionRequest { + + /** GetPermissionRequest name */ + name?: (string|null); + } + + /** Represents a GetPermissionRequest. */ + class GetPermissionRequest implements IGetPermissionRequest { + + /** + * Constructs a new GetPermissionRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.ai.generativelanguage.v1beta3.IGetPermissionRequest); + + /** GetPermissionRequest name. */ + public name: string; + + /** + * Creates a new GetPermissionRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GetPermissionRequest instance + */ + public static create(properties?: google.ai.generativelanguage.v1beta3.IGetPermissionRequest): google.ai.generativelanguage.v1beta3.GetPermissionRequest; + + /** + * Encodes the specified GetPermissionRequest message. Does not implicitly {@link google.ai.generativelanguage.v1beta3.GetPermissionRequest.verify|verify} messages. + * @param message GetPermissionRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.ai.generativelanguage.v1beta3.IGetPermissionRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GetPermissionRequest message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1beta3.GetPermissionRequest.verify|verify} messages. + * @param message GetPermissionRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.ai.generativelanguage.v1beta3.IGetPermissionRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GetPermissionRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GetPermissionRequest + * @throws {Error} If the payload is not 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.v1beta3.GetPermissionRequest; + + /** + * Decodes a GetPermissionRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GetPermissionRequest + * @throws {Error} If the payload 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.v1beta3.GetPermissionRequest; + + /** + * Verifies a GetPermissionRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GetPermissionRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GetPermissionRequest + */ + public static fromObject(object: { [k: string]: any }): google.ai.generativelanguage.v1beta3.GetPermissionRequest; + + /** + * Creates a plain object from a GetPermissionRequest message. Also converts values to other types if specified. + * @param message GetPermissionRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.ai.generativelanguage.v1beta3.GetPermissionRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GetPermissionRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GetPermissionRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListPermissionsRequest. */ + interface IListPermissionsRequest { + + /** ListPermissionsRequest parent */ + parent?: (string|null); + + /** ListPermissionsRequest pageSize */ + pageSize?: (number|null); + + /** ListPermissionsRequest pageToken */ + pageToken?: (string|null); + } + + /** Represents a ListPermissionsRequest. */ + class ListPermissionsRequest implements IListPermissionsRequest { + + /** + * Constructs a new ListPermissionsRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.ai.generativelanguage.v1beta3.IListPermissionsRequest); + + /** ListPermissionsRequest parent. */ + public parent: string; + + /** ListPermissionsRequest pageSize. */ + public pageSize: number; + + /** ListPermissionsRequest pageToken. */ + public pageToken: string; + + /** + * Creates a new ListPermissionsRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ListPermissionsRequest instance + */ + public static create(properties?: google.ai.generativelanguage.v1beta3.IListPermissionsRequest): google.ai.generativelanguage.v1beta3.ListPermissionsRequest; + + /** + * Encodes the specified ListPermissionsRequest message. Does not implicitly {@link google.ai.generativelanguage.v1beta3.ListPermissionsRequest.verify|verify} messages. + * @param message ListPermissionsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.ai.generativelanguage.v1beta3.IListPermissionsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListPermissionsRequest message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1beta3.ListPermissionsRequest.verify|verify} messages. + * @param message ListPermissionsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.ai.generativelanguage.v1beta3.IListPermissionsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListPermissionsRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListPermissionsRequest + * @throws {Error} If the payload is not 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.v1beta3.ListPermissionsRequest; + + /** + * Decodes a ListPermissionsRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListPermissionsRequest + * @throws {Error} If the payload 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.v1beta3.ListPermissionsRequest; + + /** + * Verifies a ListPermissionsRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListPermissionsRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListPermissionsRequest + */ + public static fromObject(object: { [k: string]: any }): google.ai.generativelanguage.v1beta3.ListPermissionsRequest; + + /** + * Creates a plain object from a ListPermissionsRequest message. Also converts values to other types if specified. + * @param message ListPermissionsRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.ai.generativelanguage.v1beta3.ListPermissionsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListPermissionsRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListPermissionsRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListPermissionsResponse. */ + interface IListPermissionsResponse { + + /** ListPermissionsResponse permissions */ + permissions?: (google.ai.generativelanguage.v1beta3.IPermission[]|null); + + /** ListPermissionsResponse nextPageToken */ + nextPageToken?: (string|null); + } + + /** Represents a ListPermissionsResponse. */ + class ListPermissionsResponse implements IListPermissionsResponse { + + /** + * Constructs a new ListPermissionsResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.ai.generativelanguage.v1beta3.IListPermissionsResponse); + + /** ListPermissionsResponse permissions. */ + public permissions: google.ai.generativelanguage.v1beta3.IPermission[]; + + /** ListPermissionsResponse nextPageToken. */ + public nextPageToken: string; + + /** + * Creates a new ListPermissionsResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ListPermissionsResponse instance + */ + public static create(properties?: google.ai.generativelanguage.v1beta3.IListPermissionsResponse): google.ai.generativelanguage.v1beta3.ListPermissionsResponse; + + /** + * Encodes the specified ListPermissionsResponse message. Does not implicitly {@link google.ai.generativelanguage.v1beta3.ListPermissionsResponse.verify|verify} messages. + * @param message ListPermissionsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.ai.generativelanguage.v1beta3.IListPermissionsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListPermissionsResponse message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1beta3.ListPermissionsResponse.verify|verify} messages. + * @param message ListPermissionsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.ai.generativelanguage.v1beta3.IListPermissionsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListPermissionsResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListPermissionsResponse + * @throws {Error} If the payload is not 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.v1beta3.ListPermissionsResponse; + + /** + * Decodes a ListPermissionsResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListPermissionsResponse + * @throws {Error} If the payload 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.v1beta3.ListPermissionsResponse; + + /** + * Verifies a ListPermissionsResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListPermissionsResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListPermissionsResponse + */ + public static fromObject(object: { [k: string]: any }): google.ai.generativelanguage.v1beta3.ListPermissionsResponse; + + /** + * Creates a plain object from a ListPermissionsResponse message. Also converts values to other types if specified. + * @param message ListPermissionsResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.ai.generativelanguage.v1beta3.ListPermissionsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListPermissionsResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListPermissionsResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an UpdatePermissionRequest. */ + interface IUpdatePermissionRequest { + + /** UpdatePermissionRequest permission */ + permission?: (google.ai.generativelanguage.v1beta3.IPermission|null); + + /** UpdatePermissionRequest updateMask */ + updateMask?: (google.protobuf.IFieldMask|null); + } + + /** Represents an UpdatePermissionRequest. */ + class UpdatePermissionRequest implements IUpdatePermissionRequest { + + /** + * Constructs a new UpdatePermissionRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.ai.generativelanguage.v1beta3.IUpdatePermissionRequest); + + /** UpdatePermissionRequest permission. */ + public permission?: (google.ai.generativelanguage.v1beta3.IPermission|null); + + /** UpdatePermissionRequest updateMask. */ + public updateMask?: (google.protobuf.IFieldMask|null); + + /** + * Creates a new UpdatePermissionRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns UpdatePermissionRequest instance + */ + public static create(properties?: google.ai.generativelanguage.v1beta3.IUpdatePermissionRequest): google.ai.generativelanguage.v1beta3.UpdatePermissionRequest; + + /** + * Encodes the specified UpdatePermissionRequest message. Does not implicitly {@link google.ai.generativelanguage.v1beta3.UpdatePermissionRequest.verify|verify} messages. + * @param message UpdatePermissionRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.ai.generativelanguage.v1beta3.IUpdatePermissionRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified UpdatePermissionRequest message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1beta3.UpdatePermissionRequest.verify|verify} messages. + * @param message UpdatePermissionRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.ai.generativelanguage.v1beta3.IUpdatePermissionRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an UpdatePermissionRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns UpdatePermissionRequest + * @throws {Error} If the payload is not 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.v1beta3.UpdatePermissionRequest; + + /** + * Decodes an UpdatePermissionRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns UpdatePermissionRequest + * @throws {Error} If the payload 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.v1beta3.UpdatePermissionRequest; + + /** + * Verifies an UpdatePermissionRequest message. + * @param message Plain 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 UpdatePermissionRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns UpdatePermissionRequest + */ + public static fromObject(object: { [k: string]: any }): google.ai.generativelanguage.v1beta3.UpdatePermissionRequest; + + /** + * Creates a plain object from an UpdatePermissionRequest message. Also converts values to other types if specified. + * @param message UpdatePermissionRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.ai.generativelanguage.v1beta3.UpdatePermissionRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this UpdatePermissionRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for UpdatePermissionRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a DeletePermissionRequest. */ + interface IDeletePermissionRequest { + + /** DeletePermissionRequest name */ + name?: (string|null); + } + + /** Represents a DeletePermissionRequest. */ + class DeletePermissionRequest implements IDeletePermissionRequest { + + /** + * Constructs a new DeletePermissionRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.ai.generativelanguage.v1beta3.IDeletePermissionRequest); + + /** DeletePermissionRequest name. */ + public name: string; + + /** + * Creates a new DeletePermissionRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns DeletePermissionRequest instance + */ + public static create(properties?: google.ai.generativelanguage.v1beta3.IDeletePermissionRequest): google.ai.generativelanguage.v1beta3.DeletePermissionRequest; + + /** + * Encodes the specified DeletePermissionRequest message. Does not implicitly {@link google.ai.generativelanguage.v1beta3.DeletePermissionRequest.verify|verify} messages. + * @param message DeletePermissionRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.ai.generativelanguage.v1beta3.IDeletePermissionRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DeletePermissionRequest message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1beta3.DeletePermissionRequest.verify|verify} messages. + * @param message DeletePermissionRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.ai.generativelanguage.v1beta3.IDeletePermissionRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DeletePermissionRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DeletePermissionRequest + * @throws {Error} If the payload is not 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.v1beta3.DeletePermissionRequest; + + /** + * Decodes a DeletePermissionRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DeletePermissionRequest + * @throws {Error} If the payload 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.v1beta3.DeletePermissionRequest; + + /** + * Verifies a DeletePermissionRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DeletePermissionRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DeletePermissionRequest + */ + public static fromObject(object: { [k: string]: any }): google.ai.generativelanguage.v1beta3.DeletePermissionRequest; + + /** + * Creates a plain object from a DeletePermissionRequest message. Also converts values to other types if specified. + * @param message DeletePermissionRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.ai.generativelanguage.v1beta3.DeletePermissionRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DeletePermissionRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DeletePermissionRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TransferOwnershipRequest. */ + interface ITransferOwnershipRequest { + + /** TransferOwnershipRequest name */ + name?: (string|null); + + /** TransferOwnershipRequest emailAddress */ + emailAddress?: (string|null); + } + + /** Represents a TransferOwnershipRequest. */ + class TransferOwnershipRequest implements ITransferOwnershipRequest { + + /** + * Constructs a new TransferOwnershipRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.ai.generativelanguage.v1beta3.ITransferOwnershipRequest); + + /** TransferOwnershipRequest name. */ + public name: string; + + /** TransferOwnershipRequest emailAddress. */ + public emailAddress: string; + + /** + * Creates a new TransferOwnershipRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns TransferOwnershipRequest instance + */ + public static create(properties?: google.ai.generativelanguage.v1beta3.ITransferOwnershipRequest): google.ai.generativelanguage.v1beta3.TransferOwnershipRequest; + + /** + * Encodes the specified TransferOwnershipRequest message. Does not implicitly {@link google.ai.generativelanguage.v1beta3.TransferOwnershipRequest.verify|verify} messages. + * @param message TransferOwnershipRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.ai.generativelanguage.v1beta3.ITransferOwnershipRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified TransferOwnershipRequest message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1beta3.TransferOwnershipRequest.verify|verify} messages. + * @param message TransferOwnershipRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.ai.generativelanguage.v1beta3.ITransferOwnershipRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TransferOwnershipRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns TransferOwnershipRequest + * @throws {Error} If the payload is not 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.v1beta3.TransferOwnershipRequest; + + /** + * Decodes a TransferOwnershipRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns TransferOwnershipRequest + * @throws {Error} If the payload 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.v1beta3.TransferOwnershipRequest; + + /** + * Verifies a TransferOwnershipRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a TransferOwnershipRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns TransferOwnershipRequest + */ + public static fromObject(object: { [k: string]: any }): google.ai.generativelanguage.v1beta3.TransferOwnershipRequest; + + /** + * Creates a plain object from a TransferOwnershipRequest message. Also converts values to other types if specified. + * @param message TransferOwnershipRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.ai.generativelanguage.v1beta3.TransferOwnershipRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this TransferOwnershipRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for TransferOwnershipRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TransferOwnershipResponse. */ + interface ITransferOwnershipResponse { + } + + /** Represents a TransferOwnershipResponse. */ + class TransferOwnershipResponse implements ITransferOwnershipResponse { + + /** + * Constructs a new TransferOwnershipResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.ai.generativelanguage.v1beta3.ITransferOwnershipResponse); + + /** + * Creates a new TransferOwnershipResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns TransferOwnershipResponse instance + */ + public static create(properties?: google.ai.generativelanguage.v1beta3.ITransferOwnershipResponse): google.ai.generativelanguage.v1beta3.TransferOwnershipResponse; + + /** + * Encodes the specified TransferOwnershipResponse message. Does not implicitly {@link google.ai.generativelanguage.v1beta3.TransferOwnershipResponse.verify|verify} messages. + * @param message TransferOwnershipResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.ai.generativelanguage.v1beta3.ITransferOwnershipResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified TransferOwnershipResponse message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1beta3.TransferOwnershipResponse.verify|verify} messages. + * @param message TransferOwnershipResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.ai.generativelanguage.v1beta3.ITransferOwnershipResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TransferOwnershipResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns TransferOwnershipResponse + * @throws {Error} If the payload is not 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.v1beta3.TransferOwnershipResponse; + + /** + * Decodes a TransferOwnershipResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns TransferOwnershipResponse + * @throws {Error} If the payload 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.v1beta3.TransferOwnershipResponse; + + /** + * Verifies a TransferOwnershipResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a TransferOwnershipResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns TransferOwnershipResponse + */ + public static fromObject(object: { [k: string]: any }): google.ai.generativelanguage.v1beta3.TransferOwnershipResponse; + + /** + * Creates a plain object from a TransferOwnershipResponse message. Also converts values to other types if specified. + * @param message TransferOwnershipResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.ai.generativelanguage.v1beta3.TransferOwnershipResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this TransferOwnershipResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for TransferOwnershipResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Represents a TextService */ + class TextService extends $protobuf.rpc.Service { + + /** + * Constructs a new TextService 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 TextService 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): TextService; + + /** + * Calls GenerateText. + * @param request GenerateTextRequest message or plain object + * @param callback Node-style callback called with the error, if any, and GenerateTextResponse + */ + public generateText(request: google.ai.generativelanguage.v1beta3.IGenerateTextRequest, callback: google.ai.generativelanguage.v1beta3.TextService.GenerateTextCallback): void; + + /** + * Calls GenerateText. + * @param request GenerateTextRequest message or plain object + * @returns Promise + */ + public generateText(request: google.ai.generativelanguage.v1beta3.IGenerateTextRequest): Promise; + + /** + * Calls EmbedText. + * @param request EmbedTextRequest message or plain object + * @param callback Node-style callback called with the error, if any, and EmbedTextResponse + */ + public embedText(request: google.ai.generativelanguage.v1beta3.IEmbedTextRequest, callback: google.ai.generativelanguage.v1beta3.TextService.EmbedTextCallback): void; + + /** + * Calls EmbedText. + * @param request EmbedTextRequest message or plain object + * @returns Promise + */ + public embedText(request: google.ai.generativelanguage.v1beta3.IEmbedTextRequest): Promise; + + /** + * Calls BatchEmbedText. + * @param request BatchEmbedTextRequest message or plain object + * @param callback Node-style callback called with the error, if any, and BatchEmbedTextResponse + */ + public batchEmbedText(request: google.ai.generativelanguage.v1beta3.IBatchEmbedTextRequest, callback: google.ai.generativelanguage.v1beta3.TextService.BatchEmbedTextCallback): void; + + /** + * Calls BatchEmbedText. + * @param request BatchEmbedTextRequest message or plain object + * @returns Promise + */ + public batchEmbedText(request: google.ai.generativelanguage.v1beta3.IBatchEmbedTextRequest): Promise; + + /** + * Calls CountTextTokens. + * @param request CountTextTokensRequest message or plain object + * @param callback Node-style callback called with the error, if any, and CountTextTokensResponse + */ + public countTextTokens(request: google.ai.generativelanguage.v1beta3.ICountTextTokensRequest, callback: google.ai.generativelanguage.v1beta3.TextService.CountTextTokensCallback): void; + + /** + * Calls CountTextTokens. + * @param request CountTextTokensRequest message or plain object + * @returns Promise + */ + public countTextTokens(request: google.ai.generativelanguage.v1beta3.ICountTextTokensRequest): Promise; + } + + namespace TextService { + + /** + * Callback as used by {@link google.ai.generativelanguage.v1beta3.TextService|generateText}. + * @param error Error, if any + * @param [response] GenerateTextResponse + */ + type GenerateTextCallback = (error: (Error|null), response?: google.ai.generativelanguage.v1beta3.GenerateTextResponse) => void; + + /** + * Callback as used by {@link google.ai.generativelanguage.v1beta3.TextService|embedText}. + * @param error Error, if any + * @param [response] EmbedTextResponse + */ + type EmbedTextCallback = (error: (Error|null), response?: google.ai.generativelanguage.v1beta3.EmbedTextResponse) => void; + + /** + * Callback as used by {@link google.ai.generativelanguage.v1beta3.TextService|batchEmbedText}. + * @param error Error, if any + * @param [response] BatchEmbedTextResponse + */ + type BatchEmbedTextCallback = (error: (Error|null), response?: google.ai.generativelanguage.v1beta3.BatchEmbedTextResponse) => void; + + /** + * Callback as used by {@link google.ai.generativelanguage.v1beta3.TextService|countTextTokens}. + * @param error Error, if any + * @param [response] CountTextTokensResponse + */ + type CountTextTokensCallback = (error: (Error|null), response?: google.ai.generativelanguage.v1beta3.CountTextTokensResponse) => void; + } + + /** Properties of a GenerateTextRequest. */ + interface IGenerateTextRequest { + + /** GenerateTextRequest model */ + model?: (string|null); + + /** GenerateTextRequest prompt */ + prompt?: (google.ai.generativelanguage.v1beta3.ITextPrompt|null); + + /** GenerateTextRequest temperature */ + temperature?: (number|null); + + /** GenerateTextRequest candidateCount */ + candidateCount?: (number|null); + + /** GenerateTextRequest maxOutputTokens */ + maxOutputTokens?: (number|null); + + /** GenerateTextRequest topP */ + topP?: (number|null); + + /** GenerateTextRequest topK */ + topK?: (number|null); + + /** GenerateTextRequest safetySettings */ + safetySettings?: (google.ai.generativelanguage.v1beta3.ISafetySetting[]|null); + + /** GenerateTextRequest stopSequences */ + stopSequences?: (string[]|null); + } + + /** Represents a GenerateTextRequest. */ + class GenerateTextRequest implements IGenerateTextRequest { + + /** + * Constructs a new GenerateTextRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.ai.generativelanguage.v1beta3.IGenerateTextRequest); + + /** GenerateTextRequest model. */ + public model: string; + + /** GenerateTextRequest prompt. */ + public prompt?: (google.ai.generativelanguage.v1beta3.ITextPrompt|null); + + /** GenerateTextRequest temperature. */ + public temperature?: (number|null); + + /** GenerateTextRequest candidateCount. */ + public candidateCount?: (number|null); + + /** GenerateTextRequest maxOutputTokens. */ + public maxOutputTokens?: (number|null); + + /** GenerateTextRequest topP. */ + public topP?: (number|null); + + /** GenerateTextRequest topK. */ + public topK?: (number|null); + + /** GenerateTextRequest safetySettings. */ + public safetySettings: google.ai.generativelanguage.v1beta3.ISafetySetting[]; + + /** GenerateTextRequest stopSequences. */ + public stopSequences: string[]; + + /** GenerateTextRequest _temperature. */ + public _temperature?: "temperature"; + + /** GenerateTextRequest _candidateCount. */ + public _candidateCount?: "candidateCount"; + + /** GenerateTextRequest _maxOutputTokens. */ + public _maxOutputTokens?: "maxOutputTokens"; + + /** GenerateTextRequest _topP. */ + public _topP?: "topP"; + + /** GenerateTextRequest _topK. */ + public _topK?: "topK"; + + /** + * Creates a new GenerateTextRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GenerateTextRequest instance + */ + public static create(properties?: google.ai.generativelanguage.v1beta3.IGenerateTextRequest): google.ai.generativelanguage.v1beta3.GenerateTextRequest; + + /** + * Encodes the specified GenerateTextRequest message. Does not implicitly {@link google.ai.generativelanguage.v1beta3.GenerateTextRequest.verify|verify} messages. + * @param message GenerateTextRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.ai.generativelanguage.v1beta3.IGenerateTextRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GenerateTextRequest message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1beta3.GenerateTextRequest.verify|verify} messages. + * @param message GenerateTextRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.ai.generativelanguage.v1beta3.IGenerateTextRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GenerateTextRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GenerateTextRequest + * @throws {Error} If the payload is not 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.v1beta3.GenerateTextRequest; + + /** + * Decodes a GenerateTextRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GenerateTextRequest + * @throws {Error} If the payload 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.v1beta3.GenerateTextRequest; + + /** + * Verifies a GenerateTextRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GenerateTextRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GenerateTextRequest + */ + public static fromObject(object: { [k: string]: any }): google.ai.generativelanguage.v1beta3.GenerateTextRequest; + + /** + * Creates a plain object from a GenerateTextRequest message. Also converts values to other types if specified. + * @param message GenerateTextRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.ai.generativelanguage.v1beta3.GenerateTextRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GenerateTextRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GenerateTextRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a GenerateTextResponse. */ + interface IGenerateTextResponse { + + /** GenerateTextResponse candidates */ + candidates?: (google.ai.generativelanguage.v1beta3.ITextCompletion[]|null); + + /** GenerateTextResponse filters */ + filters?: (google.ai.generativelanguage.v1beta3.IContentFilter[]|null); + + /** GenerateTextResponse safetyFeedback */ + safetyFeedback?: (google.ai.generativelanguage.v1beta3.ISafetyFeedback[]|null); + } + + /** Represents a GenerateTextResponse. */ + class GenerateTextResponse implements IGenerateTextResponse { + + /** + * Constructs a new GenerateTextResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.ai.generativelanguage.v1beta3.IGenerateTextResponse); + + /** GenerateTextResponse candidates. */ + public candidates: google.ai.generativelanguage.v1beta3.ITextCompletion[]; + + /** GenerateTextResponse filters. */ + public filters: google.ai.generativelanguage.v1beta3.IContentFilter[]; + + /** GenerateTextResponse safetyFeedback. */ + public safetyFeedback: google.ai.generativelanguage.v1beta3.ISafetyFeedback[]; + + /** + * Creates a new GenerateTextResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns GenerateTextResponse instance + */ + public static create(properties?: google.ai.generativelanguage.v1beta3.IGenerateTextResponse): google.ai.generativelanguage.v1beta3.GenerateTextResponse; + + /** + * Encodes the specified GenerateTextResponse message. Does not implicitly {@link google.ai.generativelanguage.v1beta3.GenerateTextResponse.verify|verify} messages. + * @param message GenerateTextResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.ai.generativelanguage.v1beta3.IGenerateTextResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GenerateTextResponse message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1beta3.GenerateTextResponse.verify|verify} messages. + * @param message GenerateTextResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.ai.generativelanguage.v1beta3.IGenerateTextResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GenerateTextResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GenerateTextResponse + * @throws {Error} If the payload is not 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.v1beta3.GenerateTextResponse; + + /** + * Decodes a GenerateTextResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GenerateTextResponse + * @throws {Error} If the payload 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.v1beta3.GenerateTextResponse; + + /** + * Verifies a GenerateTextResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GenerateTextResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GenerateTextResponse + */ + public static fromObject(object: { [k: string]: any }): google.ai.generativelanguage.v1beta3.GenerateTextResponse; + + /** + * Creates a plain object from a GenerateTextResponse message. Also converts values to other types if specified. + * @param message GenerateTextResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.ai.generativelanguage.v1beta3.GenerateTextResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GenerateTextResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GenerateTextResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TextPrompt. */ + interface ITextPrompt { + + /** TextPrompt text */ + text?: (string|null); + } + + /** Represents a TextPrompt. */ + class TextPrompt implements ITextPrompt { + + /** + * Constructs a new TextPrompt. + * @param [properties] Properties to set + */ + constructor(properties?: google.ai.generativelanguage.v1beta3.ITextPrompt); + + /** TextPrompt text. */ + public text: string; + + /** + * Creates a new TextPrompt instance using the specified properties. + * @param [properties] Properties to set + * @returns TextPrompt instance + */ + public static create(properties?: google.ai.generativelanguage.v1beta3.ITextPrompt): google.ai.generativelanguage.v1beta3.TextPrompt; + + /** + * Encodes the specified TextPrompt message. Does not implicitly {@link google.ai.generativelanguage.v1beta3.TextPrompt.verify|verify} messages. + * @param message TextPrompt message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.ai.generativelanguage.v1beta3.ITextPrompt, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified TextPrompt message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1beta3.TextPrompt.verify|verify} messages. + * @param message TextPrompt message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.ai.generativelanguage.v1beta3.ITextPrompt, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TextPrompt message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns TextPrompt + * @throws {Error} If the payload is not 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.v1beta3.TextPrompt; + + /** + * Decodes a TextPrompt message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns TextPrompt + * @throws {Error} If the payload 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.v1beta3.TextPrompt; + + /** + * Verifies a TextPrompt message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a TextPrompt message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns TextPrompt + */ + public static fromObject(object: { [k: string]: any }): google.ai.generativelanguage.v1beta3.TextPrompt; + + /** + * Creates a plain object from a TextPrompt message. Also converts values to other types if specified. + * @param message TextPrompt + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.ai.generativelanguage.v1beta3.TextPrompt, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this TextPrompt to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for TextPrompt + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TextCompletion. */ + interface ITextCompletion { + + /** TextCompletion output */ + output?: (string|null); + + /** TextCompletion safetyRatings */ + safetyRatings?: (google.ai.generativelanguage.v1beta3.ISafetyRating[]|null); + + /** TextCompletion citationMetadata */ + citationMetadata?: (google.ai.generativelanguage.v1beta3.ICitationMetadata|null); + } + + /** Represents a TextCompletion. */ + class TextCompletion implements ITextCompletion { + + /** + * Constructs a new TextCompletion. + * @param [properties] Properties to set + */ + constructor(properties?: google.ai.generativelanguage.v1beta3.ITextCompletion); + + /** TextCompletion output. */ + public output: string; + + /** TextCompletion safetyRatings. */ + public safetyRatings: google.ai.generativelanguage.v1beta3.ISafetyRating[]; + + /** TextCompletion citationMetadata. */ + public citationMetadata?: (google.ai.generativelanguage.v1beta3.ICitationMetadata|null); + + /** TextCompletion _citationMetadata. */ + public _citationMetadata?: "citationMetadata"; + + /** + * Creates a new TextCompletion instance using the specified properties. + * @param [properties] Properties to set + * @returns TextCompletion instance + */ + public static create(properties?: google.ai.generativelanguage.v1beta3.ITextCompletion): google.ai.generativelanguage.v1beta3.TextCompletion; + + /** + * Encodes the specified TextCompletion message. Does not implicitly {@link google.ai.generativelanguage.v1beta3.TextCompletion.verify|verify} messages. + * @param message TextCompletion message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.ai.generativelanguage.v1beta3.ITextCompletion, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified TextCompletion message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1beta3.TextCompletion.verify|verify} messages. + * @param message TextCompletion message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.ai.generativelanguage.v1beta3.ITextCompletion, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TextCompletion message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns TextCompletion + * @throws {Error} If the payload is not 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.v1beta3.TextCompletion; + + /** + * Decodes a TextCompletion message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns TextCompletion + * @throws {Error} If the payload 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.v1beta3.TextCompletion; + + /** + * Verifies a TextCompletion message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a TextCompletion message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns TextCompletion + */ + public static fromObject(object: { [k: string]: any }): google.ai.generativelanguage.v1beta3.TextCompletion; + + /** + * Creates a plain object from a TextCompletion message. Also converts values to other types if specified. + * @param message TextCompletion + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.ai.generativelanguage.v1beta3.TextCompletion, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this TextCompletion to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for TextCompletion + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an EmbedTextRequest. */ + interface IEmbedTextRequest { + + /** EmbedTextRequest model */ + model?: (string|null); + + /** EmbedTextRequest text */ + text?: (string|null); + } + + /** Represents an EmbedTextRequest. */ + class EmbedTextRequest implements IEmbedTextRequest { + + /** + * Constructs a new EmbedTextRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.ai.generativelanguage.v1beta3.IEmbedTextRequest); + + /** EmbedTextRequest model. */ + public model: string; + + /** EmbedTextRequest text. */ + public text: string; + + /** + * Creates a new EmbedTextRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns EmbedTextRequest instance + */ + public static create(properties?: google.ai.generativelanguage.v1beta3.IEmbedTextRequest): google.ai.generativelanguage.v1beta3.EmbedTextRequest; + + /** + * Encodes the specified EmbedTextRequest message. Does not implicitly {@link google.ai.generativelanguage.v1beta3.EmbedTextRequest.verify|verify} messages. + * @param message EmbedTextRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.ai.generativelanguage.v1beta3.IEmbedTextRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified EmbedTextRequest message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1beta3.EmbedTextRequest.verify|verify} messages. + * @param message EmbedTextRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.ai.generativelanguage.v1beta3.IEmbedTextRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an EmbedTextRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns EmbedTextRequest + * @throws {Error} If the payload is not 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.v1beta3.EmbedTextRequest; + + /** + * Decodes an EmbedTextRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns EmbedTextRequest + * @throws {Error} If the payload 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.v1beta3.EmbedTextRequest; + + /** + * Verifies an EmbedTextRequest message. + * @param message Plain 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 EmbedTextRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns EmbedTextRequest + */ + public static fromObject(object: { [k: string]: any }): google.ai.generativelanguage.v1beta3.EmbedTextRequest; + + /** + * Creates a plain object from an EmbedTextRequest message. Also converts values to other types if specified. + * @param message EmbedTextRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.ai.generativelanguage.v1beta3.EmbedTextRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this EmbedTextRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for EmbedTextRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an EmbedTextResponse. */ + interface IEmbedTextResponse { + + /** EmbedTextResponse embedding */ + embedding?: (google.ai.generativelanguage.v1beta3.IEmbedding|null); + } + + /** Represents an EmbedTextResponse. */ + class EmbedTextResponse implements IEmbedTextResponse { + + /** + * Constructs a new EmbedTextResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.ai.generativelanguage.v1beta3.IEmbedTextResponse); + + /** EmbedTextResponse embedding. */ + public embedding?: (google.ai.generativelanguage.v1beta3.IEmbedding|null); + + /** EmbedTextResponse _embedding. */ + public _embedding?: "embedding"; + + /** + * Creates a new EmbedTextResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns EmbedTextResponse instance + */ + public static create(properties?: google.ai.generativelanguage.v1beta3.IEmbedTextResponse): google.ai.generativelanguage.v1beta3.EmbedTextResponse; + + /** + * Encodes the specified EmbedTextResponse message. Does not implicitly {@link google.ai.generativelanguage.v1beta3.EmbedTextResponse.verify|verify} messages. + * @param message EmbedTextResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.ai.generativelanguage.v1beta3.IEmbedTextResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified EmbedTextResponse message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1beta3.EmbedTextResponse.verify|verify} messages. + * @param message EmbedTextResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.ai.generativelanguage.v1beta3.IEmbedTextResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an EmbedTextResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns EmbedTextResponse + * @throws {Error} If the payload is not 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.v1beta3.EmbedTextResponse; + + /** + * Decodes an EmbedTextResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns EmbedTextResponse + * @throws {Error} If the payload 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.v1beta3.EmbedTextResponse; + + /** + * Verifies an EmbedTextResponse message. + * @param message Plain 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 EmbedTextResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns EmbedTextResponse + */ + public static fromObject(object: { [k: string]: any }): google.ai.generativelanguage.v1beta3.EmbedTextResponse; + + /** + * Creates a plain object from an EmbedTextResponse message. Also converts values to other types if specified. + * @param message EmbedTextResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.ai.generativelanguage.v1beta3.EmbedTextResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this EmbedTextResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for EmbedTextResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a BatchEmbedTextRequest. */ + interface IBatchEmbedTextRequest { + + /** BatchEmbedTextRequest model */ + model?: (string|null); + + /** BatchEmbedTextRequest texts */ + texts?: (string[]|null); + } + + /** Represents a BatchEmbedTextRequest. */ + class BatchEmbedTextRequest implements IBatchEmbedTextRequest { + + /** + * Constructs a new BatchEmbedTextRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.ai.generativelanguage.v1beta3.IBatchEmbedTextRequest); + + /** BatchEmbedTextRequest model. */ + public model: string; + + /** BatchEmbedTextRequest texts. */ + public texts: string[]; + + /** + * Creates a new BatchEmbedTextRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns BatchEmbedTextRequest instance + */ + public static create(properties?: google.ai.generativelanguage.v1beta3.IBatchEmbedTextRequest): google.ai.generativelanguage.v1beta3.BatchEmbedTextRequest; + + /** + * Encodes the specified BatchEmbedTextRequest message. Does not implicitly {@link google.ai.generativelanguage.v1beta3.BatchEmbedTextRequest.verify|verify} messages. + * @param message BatchEmbedTextRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.ai.generativelanguage.v1beta3.IBatchEmbedTextRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified BatchEmbedTextRequest message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1beta3.BatchEmbedTextRequest.verify|verify} messages. + * @param message BatchEmbedTextRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.ai.generativelanguage.v1beta3.IBatchEmbedTextRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a BatchEmbedTextRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns BatchEmbedTextRequest + * @throws {Error} If the payload is not 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.v1beta3.BatchEmbedTextRequest; + + /** + * Decodes a BatchEmbedTextRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns BatchEmbedTextRequest + * @throws {Error} If the payload 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.v1beta3.BatchEmbedTextRequest; + + /** + * Verifies a BatchEmbedTextRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a BatchEmbedTextRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns BatchEmbedTextRequest + */ + public static fromObject(object: { [k: string]: any }): google.ai.generativelanguage.v1beta3.BatchEmbedTextRequest; + + /** + * Creates a plain object from a BatchEmbedTextRequest message. Also converts values to other types if specified. + * @param message BatchEmbedTextRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.ai.generativelanguage.v1beta3.BatchEmbedTextRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this BatchEmbedTextRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for BatchEmbedTextRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a BatchEmbedTextResponse. */ + interface IBatchEmbedTextResponse { + + /** BatchEmbedTextResponse embeddings */ + embeddings?: (google.ai.generativelanguage.v1beta3.IEmbedding[]|null); + } + + /** Represents a BatchEmbedTextResponse. */ + class BatchEmbedTextResponse implements IBatchEmbedTextResponse { + + /** + * Constructs a new BatchEmbedTextResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.ai.generativelanguage.v1beta3.IBatchEmbedTextResponse); + + /** BatchEmbedTextResponse embeddings. */ + public embeddings: google.ai.generativelanguage.v1beta3.IEmbedding[]; + + /** + * Creates a new BatchEmbedTextResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns BatchEmbedTextResponse instance + */ + public static create(properties?: google.ai.generativelanguage.v1beta3.IBatchEmbedTextResponse): google.ai.generativelanguage.v1beta3.BatchEmbedTextResponse; + + /** + * Encodes the specified BatchEmbedTextResponse message. Does not implicitly {@link google.ai.generativelanguage.v1beta3.BatchEmbedTextResponse.verify|verify} messages. + * @param message BatchEmbedTextResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.ai.generativelanguage.v1beta3.IBatchEmbedTextResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified BatchEmbedTextResponse message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1beta3.BatchEmbedTextResponse.verify|verify} messages. + * @param message BatchEmbedTextResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.ai.generativelanguage.v1beta3.IBatchEmbedTextResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a BatchEmbedTextResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns BatchEmbedTextResponse + * @throws {Error} If the payload is not 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.v1beta3.BatchEmbedTextResponse; + + /** + * Decodes a BatchEmbedTextResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns BatchEmbedTextResponse + * @throws {Error} If the payload 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.v1beta3.BatchEmbedTextResponse; + + /** + * Verifies a BatchEmbedTextResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a BatchEmbedTextResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns BatchEmbedTextResponse + */ + public static fromObject(object: { [k: string]: any }): google.ai.generativelanguage.v1beta3.BatchEmbedTextResponse; + + /** + * Creates a plain object from a BatchEmbedTextResponse message. Also converts values to other types if specified. + * @param message BatchEmbedTextResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.ai.generativelanguage.v1beta3.BatchEmbedTextResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this BatchEmbedTextResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for BatchEmbedTextResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an Embedding. */ + interface IEmbedding { + + /** Embedding value */ + value?: (number[]|null); + } + + /** Represents an Embedding. */ + class Embedding implements IEmbedding { + + /** + * Constructs a new Embedding. + * @param [properties] Properties to set + */ + constructor(properties?: google.ai.generativelanguage.v1beta3.IEmbedding); + + /** Embedding value. */ + public value: number[]; + + /** + * Creates a new Embedding instance using the specified properties. + * @param [properties] Properties to set + * @returns Embedding instance + */ + public static create(properties?: google.ai.generativelanguage.v1beta3.IEmbedding): google.ai.generativelanguage.v1beta3.Embedding; + + /** + * Encodes the specified Embedding message. Does not implicitly {@link google.ai.generativelanguage.v1beta3.Embedding.verify|verify} messages. + * @param message Embedding message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.ai.generativelanguage.v1beta3.IEmbedding, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Embedding message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1beta3.Embedding.verify|verify} messages. + * @param message Embedding message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.ai.generativelanguage.v1beta3.IEmbedding, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an Embedding message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Embedding + * @throws {Error} If the payload is not 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.v1beta3.Embedding; + + /** + * Decodes an Embedding message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Embedding + * @throws {Error} If the payload 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.v1beta3.Embedding; + + /** + * Verifies an Embedding message. + * @param message Plain 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 Embedding message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Embedding + */ + public static fromObject(object: { [k: string]: any }): google.ai.generativelanguage.v1beta3.Embedding; + + /** + * Creates a plain object from an Embedding message. Also converts values to other types if specified. + * @param message Embedding + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.ai.generativelanguage.v1beta3.Embedding, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Embedding to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Embedding + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a CountTextTokensRequest. */ + interface ICountTextTokensRequest { + + /** CountTextTokensRequest model */ + model?: (string|null); + + /** CountTextTokensRequest prompt */ + prompt?: (google.ai.generativelanguage.v1beta3.ITextPrompt|null); + } + + /** Represents a CountTextTokensRequest. */ + class CountTextTokensRequest implements ICountTextTokensRequest { + + /** + * Constructs a new CountTextTokensRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.ai.generativelanguage.v1beta3.ICountTextTokensRequest); + + /** CountTextTokensRequest model. */ + public model: string; + + /** CountTextTokensRequest prompt. */ + public prompt?: (google.ai.generativelanguage.v1beta3.ITextPrompt|null); + + /** + * Creates a new CountTextTokensRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns CountTextTokensRequest instance + */ + public static create(properties?: google.ai.generativelanguage.v1beta3.ICountTextTokensRequest): google.ai.generativelanguage.v1beta3.CountTextTokensRequest; + + /** + * Encodes the specified CountTextTokensRequest message. Does not implicitly {@link google.ai.generativelanguage.v1beta3.CountTextTokensRequest.verify|verify} messages. + * @param message CountTextTokensRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.ai.generativelanguage.v1beta3.ICountTextTokensRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CountTextTokensRequest message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1beta3.CountTextTokensRequest.verify|verify} messages. + * @param message CountTextTokensRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.ai.generativelanguage.v1beta3.ICountTextTokensRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CountTextTokensRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CountTextTokensRequest + * @throws {Error} If the payload is not 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.v1beta3.CountTextTokensRequest; + + /** + * Decodes a CountTextTokensRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CountTextTokensRequest + * @throws {Error} If the payload 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.v1beta3.CountTextTokensRequest; + + /** + * Verifies a CountTextTokensRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CountTextTokensRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CountTextTokensRequest + */ + public static fromObject(object: { [k: string]: any }): google.ai.generativelanguage.v1beta3.CountTextTokensRequest; + + /** + * Creates a plain object from a CountTextTokensRequest message. Also converts values to other types if specified. + * @param message CountTextTokensRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.ai.generativelanguage.v1beta3.CountTextTokensRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CountTextTokensRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CountTextTokensRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a CountTextTokensResponse. */ + interface ICountTextTokensResponse { + + /** CountTextTokensResponse tokenCount */ + tokenCount?: (number|null); + } + + /** Represents a CountTextTokensResponse. */ + class CountTextTokensResponse implements ICountTextTokensResponse { + + /** + * Constructs a new CountTextTokensResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.ai.generativelanguage.v1beta3.ICountTextTokensResponse); + + /** CountTextTokensResponse tokenCount. */ + public tokenCount: number; + + /** + * Creates a new CountTextTokensResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns CountTextTokensResponse instance + */ + public static create(properties?: google.ai.generativelanguage.v1beta3.ICountTextTokensResponse): google.ai.generativelanguage.v1beta3.CountTextTokensResponse; + + /** + * Encodes the specified CountTextTokensResponse message. Does not implicitly {@link google.ai.generativelanguage.v1beta3.CountTextTokensResponse.verify|verify} messages. + * @param message CountTextTokensResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.ai.generativelanguage.v1beta3.ICountTextTokensResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CountTextTokensResponse message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1beta3.CountTextTokensResponse.verify|verify} messages. + * @param message CountTextTokensResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.ai.generativelanguage.v1beta3.ICountTextTokensResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CountTextTokensResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CountTextTokensResponse + * @throws {Error} If the payload is not 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.v1beta3.CountTextTokensResponse; + + /** + * Decodes a CountTextTokensResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CountTextTokensResponse + * @throws {Error} If the payload 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.v1beta3.CountTextTokensResponse; + + /** + * Verifies a CountTextTokensResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CountTextTokensResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CountTextTokensResponse + */ + public static fromObject(object: { [k: string]: any }): google.ai.generativelanguage.v1beta3.CountTextTokensResponse; + + /** + * Creates a plain object from a CountTextTokensResponse message. Also converts values to other types if specified. + * @param message CountTextTokensResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.ai.generativelanguage.v1beta3.CountTextTokensResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CountTextTokensResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CountTextTokensResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + } + } + + /** 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 + } + + /** 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 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); + } + + /** 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[]; + + /** + * 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; - /** HttpRule patch. */ - public patch?: (string|null); + /** + * 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; - /** HttpRule custom. */ - public custom?: (google.api.ICustomHttpPattern|null); + /** + * 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; - /** HttpRule body. */ - public body: string; + /** + * 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; - /** HttpRule responseBody. */ - public responseBody: string; + /** + * 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; - /** HttpRule additionalBindings. */ - public additionalBindings: google.api.IHttpRule[]; + /** + * 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); - /** HttpRule pattern. */ - public pattern?: ("get"|"put"|"post"|"delete"|"patch"|"custom"); + /** + * 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 new HttpRule instance using the specified properties. + * 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); + } + + /** Represents a DotnetSettings. */ + class DotnetSettings implements IDotnetSettings { + + /** + * Constructs a new DotnetSettings. * @param [properties] Properties to set - * @returns HttpRule instance */ - public static create(properties?: google.api.IHttpRule): google.api.HttpRule; + constructor(properties?: google.api.IDotnetSettings); + + /** DotnetSettings common. */ + public common?: (google.api.ICommonLanguageSettings|null); /** - * Encodes the specified HttpRule message. Does not implicitly {@link google.api.HttpRule.verify|verify} messages. - * @param message HttpRule message or plain object to encode + * 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.IHttpRule, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.api.IDotnetSettings, 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 + * 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.IHttpRule, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.api.IDotnetSettings, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a HttpRule message from the specified reader or buffer. + * 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 HttpRule + * @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.HttpRule; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.DotnetSettings; /** - * Decodes a HttpRule message from the specified reader or buffer, length delimited. + * Decodes a DotnetSettings message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns HttpRule + * @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.HttpRule; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.DotnetSettings; /** - * Verifies a HttpRule message. + * 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 HttpRule message from a plain object. Also converts values to their respective internal types. + * Creates a DotnetSettings message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns HttpRule + * @returns DotnetSettings */ - public static fromObject(object: { [k: string]: any }): google.api.HttpRule; + public static fromObject(object: { [k: string]: any }): google.api.DotnetSettings; /** - * Creates a plain object from a HttpRule message. Also converts values to other types if specified. - * @param message HttpRule + * 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.HttpRule, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.api.DotnetSettings, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this HttpRule to JSON. + * Converts this DotnetSettings to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; /** - * Gets the default type url for HttpRule + * 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 CustomHttpPattern. */ - interface ICustomHttpPattern { + /** Properties of a RubySettings. */ + interface IRubySettings { - /** CustomHttpPattern kind */ - kind?: (string|null); + /** 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 { - /** CustomHttpPattern path */ - path?: (string|null); + /** GoSettings common */ + common?: (google.api.ICommonLanguageSettings|null); } - /** Represents a CustomHttpPattern. */ - class CustomHttpPattern implements ICustomHttpPattern { + /** Represents a GoSettings. */ + class GoSettings implements IGoSettings { /** - * Constructs a new CustomHttpPattern. + * Constructs a new GoSettings. * @param [properties] Properties to set */ - constructor(properties?: google.api.ICustomHttpPattern); - - /** CustomHttpPattern kind. */ - public kind: string; + constructor(properties?: google.api.IGoSettings); - /** CustomHttpPattern path. */ - public path: string; + /** GoSettings common. */ + public common?: (google.api.ICommonLanguageSettings|null); /** - * Creates a new CustomHttpPattern instance using the specified properties. + * Creates a new GoSettings instance using the specified properties. * @param [properties] Properties to set - * @returns CustomHttpPattern instance + * @returns GoSettings instance */ - public static create(properties?: google.api.ICustomHttpPattern): google.api.CustomHttpPattern; + public static create(properties?: google.api.IGoSettings): google.api.GoSettings; /** - * Encodes the specified CustomHttpPattern message. Does not implicitly {@link google.api.CustomHttpPattern.verify|verify} messages. - * @param message CustomHttpPattern message or plain object to encode + * 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.ICustomHttpPattern, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.api.IGoSettings, 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 + * 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.ICustomHttpPattern, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.api.IGoSettings, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a CustomHttpPattern message from the specified reader or buffer. + * 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 CustomHttpPattern + * @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.CustomHttpPattern; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.GoSettings; /** - * Decodes a CustomHttpPattern message from the specified reader or buffer, length delimited. + * Decodes a GoSettings message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns CustomHttpPattern + * @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.CustomHttpPattern; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.GoSettings; /** - * Verifies a CustomHttpPattern message. + * 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 CustomHttpPattern message from a plain object. Also converts values to their respective internal types. + * Creates a GoSettings message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns CustomHttpPattern + * @returns GoSettings */ - public static fromObject(object: { [k: string]: any }): google.api.CustomHttpPattern; + public static fromObject(object: { [k: string]: any }): google.api.GoSettings; /** - * Creates a plain object from a CustomHttpPattern message. Also converts values to other types if specified. - * @param message CustomHttpPattern + * 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.CustomHttpPattern, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.api.GoSettings, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this CustomHttpPattern to JSON. + * Converts this GoSettings to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; /** - * Gets the default type url for CustomHttpPattern + * 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 CommonLanguageSettings. */ - interface ICommonLanguageSettings { + /** Properties of a MethodSettings. */ + interface IMethodSettings { - /** CommonLanguageSettings referenceDocsUri */ - referenceDocsUri?: (string|null); + /** MethodSettings selector */ + selector?: (string|null); - /** CommonLanguageSettings destinations */ - destinations?: (google.api.ClientLibraryDestination[]|null); + /** MethodSettings longRunning */ + longRunning?: (google.api.MethodSettings.ILongRunning|null); } - /** Represents a CommonLanguageSettings. */ - class CommonLanguageSettings implements ICommonLanguageSettings { + /** Represents a MethodSettings. */ + class MethodSettings implements IMethodSettings { /** - * Constructs a new CommonLanguageSettings. + * Constructs a new MethodSettings. * @param [properties] Properties to set */ - constructor(properties?: google.api.ICommonLanguageSettings); + constructor(properties?: google.api.IMethodSettings); - /** CommonLanguageSettings referenceDocsUri. */ - public referenceDocsUri: string; + /** MethodSettings selector. */ + public selector: string; - /** CommonLanguageSettings destinations. */ - public destinations: google.api.ClientLibraryDestination[]; + /** MethodSettings longRunning. */ + public longRunning?: (google.api.MethodSettings.ILongRunning|null); /** - * Creates a new CommonLanguageSettings instance using the specified properties. + * Creates a new MethodSettings instance using the specified properties. * @param [properties] Properties to set - * @returns CommonLanguageSettings instance + * @returns MethodSettings instance */ - public static create(properties?: google.api.ICommonLanguageSettings): google.api.CommonLanguageSettings; + public static create(properties?: google.api.IMethodSettings): google.api.MethodSettings; /** - * Encodes the specified CommonLanguageSettings message. Does not implicitly {@link google.api.CommonLanguageSettings.verify|verify} messages. - * @param message CommonLanguageSettings message or plain object to encode + * 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.ICommonLanguageSettings, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.api.IMethodSettings, 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 + * 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.ICommonLanguageSettings, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.api.IMethodSettings, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a CommonLanguageSettings message from the specified reader or buffer. + * 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 CommonLanguageSettings + * @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.CommonLanguageSettings; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.MethodSettings; /** - * Decodes a CommonLanguageSettings message from the specified reader or buffer, length delimited. + * Decodes a MethodSettings message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns CommonLanguageSettings + * @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.CommonLanguageSettings; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.MethodSettings; /** - * Verifies a CommonLanguageSettings message. + * 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 CommonLanguageSettings message from a plain object. Also converts values to their respective internal types. + * Creates a MethodSettings message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns CommonLanguageSettings + * @returns MethodSettings */ - public static fromObject(object: { [k: string]: any }): google.api.CommonLanguageSettings; + public static fromObject(object: { [k: string]: any }): google.api.MethodSettings; /** - * Creates a plain object from a CommonLanguageSettings message. Also converts values to other types if specified. - * @param message CommonLanguageSettings + * 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.CommonLanguageSettings, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.api.MethodSettings, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this CommonLanguageSettings to JSON. + * Converts this MethodSettings 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; + /** + * 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; + } } - /** Properties of a ClientLibrarySettings. */ - interface IClientLibrarySettings { - - /** ClientLibrarySettings version */ - version?: (string|null); + /** ClientLibraryOrganization enum. */ + enum ClientLibraryOrganization { + CLIENT_LIBRARY_ORGANIZATION_UNSPECIFIED = 0, + CLOUD = 1, + ADS = 2, + PHOTOS = 3, + STREET_VIEW = 4 + } - /** ClientLibrarySettings launchStage */ - launchStage?: (google.api.LaunchStage|keyof typeof google.api.LaunchStage|null); + /** ClientLibraryDestination enum. */ + enum ClientLibraryDestination { + CLIENT_LIBRARY_DESTINATION_UNSPECIFIED = 0, + GITHUB = 10, + PACKAGE_MANAGER = 20 + } - /** ClientLibrarySettings restNumericEnums */ - restNumericEnums?: (boolean|null); + /** LaunchStage enum. */ + enum LaunchStage { + LAUNCH_STAGE_UNSPECIFIED = 0, + UNIMPLEMENTED = 6, + PRELAUNCH = 7, + EARLY_ACCESS = 1, + ALPHA = 2, + BETA = 3, + GA = 4, + DEPRECATED = 5 + } - /** ClientLibrarySettings javaSettings */ - javaSettings?: (google.api.IJavaSettings|null); + /** Properties of a ResourceDescriptor. */ + interface IResourceDescriptor { - /** ClientLibrarySettings cppSettings */ - cppSettings?: (google.api.ICppSettings|null); + /** ResourceDescriptor type */ + type?: (string|null); - /** ClientLibrarySettings phpSettings */ - phpSettings?: (google.api.IPhpSettings|null); + /** ResourceDescriptor pattern */ + pattern?: (string[]|null); - /** ClientLibrarySettings pythonSettings */ - pythonSettings?: (google.api.IPythonSettings|null); + /** ResourceDescriptor nameField */ + nameField?: (string|null); - /** ClientLibrarySettings nodeSettings */ - nodeSettings?: (google.api.INodeSettings|null); + /** ResourceDescriptor history */ + history?: (google.api.ResourceDescriptor.History|keyof typeof google.api.ResourceDescriptor.History|null); - /** ClientLibrarySettings dotnetSettings */ - dotnetSettings?: (google.api.IDotnetSettings|null); + /** ResourceDescriptor plural */ + plural?: (string|null); - /** ClientLibrarySettings rubySettings */ - rubySettings?: (google.api.IRubySettings|null); + /** ResourceDescriptor singular */ + singular?: (string|null); - /** ClientLibrarySettings goSettings */ - goSettings?: (google.api.IGoSettings|null); + /** ResourceDescriptor style */ + style?: (google.api.ResourceDescriptor.Style[]|null); } - /** Represents a ClientLibrarySettings. */ - class ClientLibrarySettings implements IClientLibrarySettings { + /** Represents a ResourceDescriptor. */ + class ResourceDescriptor implements IResourceDescriptor { /** - * Constructs a new ClientLibrarySettings. + * Constructs a new ResourceDescriptor. * @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); + constructor(properties?: google.api.IResourceDescriptor); - /** ClientLibrarySettings cppSettings. */ - public cppSettings?: (google.api.ICppSettings|null); + /** ResourceDescriptor type. */ + public type: string; - /** ClientLibrarySettings phpSettings. */ - public phpSettings?: (google.api.IPhpSettings|null); + /** ResourceDescriptor pattern. */ + public pattern: string[]; - /** ClientLibrarySettings pythonSettings. */ - public pythonSettings?: (google.api.IPythonSettings|null); + /** ResourceDescriptor nameField. */ + public nameField: string; - /** ClientLibrarySettings nodeSettings. */ - public nodeSettings?: (google.api.INodeSettings|null); + /** ResourceDescriptor history. */ + public history: (google.api.ResourceDescriptor.History|keyof typeof google.api.ResourceDescriptor.History); - /** ClientLibrarySettings dotnetSettings. */ - public dotnetSettings?: (google.api.IDotnetSettings|null); + /** ResourceDescriptor plural. */ + public plural: string; - /** ClientLibrarySettings rubySettings. */ - public rubySettings?: (google.api.IRubySettings|null); + /** ResourceDescriptor singular. */ + public singular: string; - /** ClientLibrarySettings goSettings. */ - public goSettings?: (google.api.IGoSettings|null); + /** ResourceDescriptor style. */ + public style: google.api.ResourceDescriptor.Style[]; /** - * Creates a new ClientLibrarySettings instance using the specified properties. + * Creates a new ResourceDescriptor instance using the specified properties. * @param [properties] Properties to set - * @returns ClientLibrarySettings instance + * @returns ResourceDescriptor instance */ - public static create(properties?: google.api.IClientLibrarySettings): google.api.ClientLibrarySettings; + public static create(properties?: google.api.IResourceDescriptor): google.api.ResourceDescriptor; /** - * Encodes the specified ClientLibrarySettings message. Does not implicitly {@link google.api.ClientLibrarySettings.verify|verify} messages. - * @param message ClientLibrarySettings message or plain object to encode + * 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.IClientLibrarySettings, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.api.IResourceDescriptor, 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 + * 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.IClientLibrarySettings, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.api.IResourceDescriptor, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a ClientLibrarySettings message from the specified reader or buffer. + * 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 ClientLibrarySettings + * @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.ClientLibrarySettings; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.ResourceDescriptor; /** - * Decodes a ClientLibrarySettings message from the specified reader or buffer, length delimited. + * Decodes a ResourceDescriptor message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns ClientLibrarySettings + * @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.ClientLibrarySettings; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.ResourceDescriptor; /** - * Verifies a ClientLibrarySettings message. + * 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 ClientLibrarySettings message from a plain object. Also converts values to their respective internal types. + * Creates a ResourceDescriptor message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns ClientLibrarySettings + * @returns ResourceDescriptor */ - public static fromObject(object: { [k: string]: any }): google.api.ClientLibrarySettings; + public static fromObject(object: { [k: string]: any }): google.api.ResourceDescriptor; /** - * Creates a plain object from a ClientLibrarySettings message. Also converts values to other types if specified. - * @param message ClientLibrarySettings + * 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.ClientLibrarySettings, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.api.ResourceDescriptor, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this ClientLibrarySettings to JSON. + * Converts this ResourceDescriptor to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; /** - * Gets the default type url for ClientLibrarySettings + * 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; } - /** 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); + namespace ResourceDescriptor { - /** Publishing githubLabel */ - githubLabel?: (string|null); + /** History enum. */ + enum History { + HISTORY_UNSPECIFIED = 0, + ORIGINALLY_SINGLE_PATTERN = 1, + FUTURE_MULTI_PATTERN = 2 + } - /** Publishing codeownerGithubTeams */ - codeownerGithubTeams?: (string[]|null); + /** Style enum. */ + enum Style { + STYLE_UNSPECIFIED = 0, + DECLARATIVE_FRIENDLY = 1 + } + } - /** Publishing docTagPrefix */ - docTagPrefix?: (string|null); + /** Properties of a ResourceReference. */ + interface IResourceReference { - /** Publishing organization */ - organization?: (google.api.ClientLibraryOrganization|keyof typeof google.api.ClientLibraryOrganization|null); + /** ResourceReference type */ + type?: (string|null); - /** Publishing librarySettings */ - librarySettings?: (google.api.IClientLibrarySettings[]|null); + /** ResourceReference childType */ + childType?: (string|null); } - /** Represents a Publishing. */ - class Publishing implements IPublishing { + /** Represents a ResourceReference. */ + class ResourceReference implements IResourceReference { /** - * Constructs a new Publishing. + * Constructs a new ResourceReference. * @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); + constructor(properties?: google.api.IResourceReference); - /** Publishing librarySettings. */ - public librarySettings: google.api.IClientLibrarySettings[]; + /** ResourceReference type. */ + public type: string; + + /** ResourceReference childType. */ + public childType: string; /** - * Creates a new Publishing instance using the specified properties. + * Creates a new ResourceReference instance using the specified properties. * @param [properties] Properties to set - * @returns Publishing instance + * @returns ResourceReference instance */ - public static create(properties?: google.api.IPublishing): google.api.Publishing; + public static create(properties?: google.api.IResourceReference): google.api.ResourceReference; /** - * Encodes the specified Publishing message. Does not implicitly {@link google.api.Publishing.verify|verify} messages. - * @param message Publishing message or plain object to encode + * 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.IPublishing, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.api.IResourceReference, 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 + * 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.IPublishing, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.api.IResourceReference, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a Publishing message from the specified reader or buffer. + * 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 Publishing + * @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.Publishing; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.ResourceReference; /** - * Decodes a Publishing message from the specified reader or buffer, length delimited. + * Decodes a ResourceReference message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns Publishing + * @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.Publishing; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.ResourceReference; /** - * Verifies a Publishing message. + * 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 Publishing message from a plain object. Also converts values to their respective internal types. + * Creates a ResourceReference message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns Publishing + * @returns ResourceReference */ - public static fromObject(object: { [k: string]: any }): google.api.Publishing; + public static fromObject(object: { [k: string]: any }): google.api.ResourceReference; /** - * Creates a plain object from a Publishing message. Also converts values to other types if specified. - * @param message Publishing + * 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.Publishing, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.api.ResourceReference, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this Publishing to JSON. + * Converts this ResourceReference to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; /** - * Gets the default type url for Publishing + * 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; } + } - /** Properties of a JavaSettings. */ - interface IJavaSettings { - - /** JavaSettings libraryPackage */ - libraryPackage?: (string|null); + /** Namespace protobuf. */ + namespace protobuf { - /** JavaSettings serviceClassNames */ - serviceClassNames?: ({ [k: string]: string }|null); + /** Properties of a FileDescriptorSet. */ + interface IFileDescriptorSet { - /** JavaSettings common */ - common?: (google.api.ICommonLanguageSettings|null); + /** FileDescriptorSet file */ + file?: (google.protobuf.IFileDescriptorProto[]|null); } - /** Represents a JavaSettings. */ - class JavaSettings implements IJavaSettings { + /** Represents a FileDescriptorSet. */ + class FileDescriptorSet implements IFileDescriptorSet { /** - * Constructs a new JavaSettings. + * Constructs a new FileDescriptorSet. * @param [properties] Properties to set */ - constructor(properties?: google.api.IJavaSettings); - - /** JavaSettings libraryPackage. */ - public libraryPackage: string; - - /** JavaSettings serviceClassNames. */ - public serviceClassNames: { [k: string]: string }; + constructor(properties?: google.protobuf.IFileDescriptorSet); - /** JavaSettings common. */ - public common?: (google.api.ICommonLanguageSettings|null); + /** FileDescriptorSet file. */ + public file: google.protobuf.IFileDescriptorProto[]; /** - * Creates a new JavaSettings instance using the specified properties. + * Creates a new FileDescriptorSet instance using the specified properties. * @param [properties] Properties to set - * @returns JavaSettings instance + * @returns FileDescriptorSet instance */ - public static create(properties?: google.api.IJavaSettings): google.api.JavaSettings; + public static create(properties?: google.protobuf.IFileDescriptorSet): google.protobuf.FileDescriptorSet; /** - * Encodes the specified JavaSettings message. Does not implicitly {@link google.api.JavaSettings.verify|verify} messages. - * @param message JavaSettings message or plain object to encode + * 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.api.IJavaSettings, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.protobuf.IFileDescriptorSet, 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 + * 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.api.IJavaSettings, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.protobuf.IFileDescriptorSet, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a JavaSettings message from the specified reader or buffer. + * 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 JavaSettings + * @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.api.JavaSettings; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.FileDescriptorSet; /** - * Decodes a JavaSettings message from the specified reader or buffer, length delimited. + * Decodes a FileDescriptorSet message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns JavaSettings + * @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.api.JavaSettings; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.FileDescriptorSet; /** - * Verifies a JavaSettings message. + * 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 JavaSettings message from a plain object. Also converts values to their respective internal types. + * Creates a FileDescriptorSet message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns JavaSettings + * @returns FileDescriptorSet */ - public static fromObject(object: { [k: string]: any }): google.api.JavaSettings; + public static fromObject(object: { [k: string]: any }): google.protobuf.FileDescriptorSet; /** - * Creates a plain object from a JavaSettings message. Also converts values to other types if specified. - * @param message JavaSettings + * 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.api.JavaSettings, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.protobuf.FileDescriptorSet, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this JavaSettings to JSON. + * Converts this FileDescriptorSet to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; /** - * Gets the default type url for JavaSettings + * 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; } - /** Properties of a CppSettings. */ - interface ICppSettings { + /** Properties of a FileDescriptorProto. */ + interface IFileDescriptorProto { - /** CppSettings common */ - common?: (google.api.ICommonLanguageSettings|null); + /** 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?: (string|null); } - /** Represents a CppSettings. */ - class CppSettings implements ICppSettings { + /** Represents a FileDescriptorProto. */ + class FileDescriptorProto implements IFileDescriptorProto { /** - * Constructs a new CppSettings. + * Constructs a new FileDescriptorProto. * @param [properties] Properties to set */ - constructor(properties?: google.api.ICppSettings); + constructor(properties?: google.protobuf.IFileDescriptorProto); - /** CppSettings common. */ - public common?: (google.api.ICommonLanguageSettings|null); + /** 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: string; /** - * Creates a new CppSettings instance using the specified properties. + * Creates a new FileDescriptorProto instance using the specified properties. * @param [properties] Properties to set - * @returns CppSettings instance + * @returns FileDescriptorProto instance */ - public static create(properties?: google.api.ICppSettings): google.api.CppSettings; + public static create(properties?: google.protobuf.IFileDescriptorProto): google.protobuf.FileDescriptorProto; /** - * Encodes the specified CppSettings message. Does not implicitly {@link google.api.CppSettings.verify|verify} messages. - * @param message CppSettings message or plain object to encode + * 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.api.ICppSettings, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.protobuf.IFileDescriptorProto, 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 + * 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.api.ICppSettings, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.protobuf.IFileDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a CppSettings message from the specified reader or buffer. + * 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 CppSettings + * @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.api.CppSettings; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.FileDescriptorProto; /** - * Decodes a CppSettings message from the specified reader or buffer, length delimited. + * Decodes a FileDescriptorProto message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns CppSettings + * @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.api.CppSettings; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.FileDescriptorProto; /** - * Verifies a CppSettings message. + * 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 CppSettings message from a plain object. Also converts values to their respective internal types. + * Creates a FileDescriptorProto message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns CppSettings + * @returns FileDescriptorProto */ - public static fromObject(object: { [k: string]: any }): google.api.CppSettings; + public static fromObject(object: { [k: string]: any }): google.protobuf.FileDescriptorProto; /** - * Creates a plain object from a CppSettings message. Also converts values to other types if specified. - * @param message CppSettings + * 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.api.CppSettings, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.protobuf.FileDescriptorProto, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this CppSettings to JSON. + * Converts this FileDescriptorProto to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; /** - * Gets the default type url for CppSettings + * 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 PhpSettings. */ - interface IPhpSettings { + /** Properties of a DescriptorProto. */ + interface IDescriptorProto { - /** PhpSettings common */ - common?: (google.api.ICommonLanguageSettings|null); + /** 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 PhpSettings. */ - class PhpSettings implements IPhpSettings { + /** Represents a DescriptorProto. */ + class DescriptorProto implements IDescriptorProto { /** - * Constructs a new PhpSettings. + * Constructs a new DescriptorProto. * @param [properties] Properties to set */ - constructor(properties?: google.api.IPhpSettings); + constructor(properties?: google.protobuf.IDescriptorProto); - /** PhpSettings common. */ - public common?: (google.api.ICommonLanguageSettings|null); + /** 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 PhpSettings instance using the specified properties. + * Creates a new DescriptorProto instance using the specified properties. * @param [properties] Properties to set - * @returns PhpSettings instance + * @returns DescriptorProto instance */ - public static create(properties?: google.api.IPhpSettings): google.api.PhpSettings; + public static create(properties?: google.protobuf.IDescriptorProto): google.protobuf.DescriptorProto; /** - * Encodes the specified PhpSettings message. Does not implicitly {@link google.api.PhpSettings.verify|verify} messages. - * @param message PhpSettings message or plain object to encode + * 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.api.IPhpSettings, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.protobuf.IDescriptorProto, 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 + * 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.api.IPhpSettings, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.protobuf.IDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a PhpSettings message from the specified reader or buffer. + * 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 PhpSettings + * @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.api.PhpSettings; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.DescriptorProto; /** - * Decodes a PhpSettings message from the specified reader or buffer, length delimited. + * Decodes a DescriptorProto message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns PhpSettings + * @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.api.PhpSettings; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.DescriptorProto; /** - * Verifies a PhpSettings message. + * 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 PhpSettings message from a plain object. Also converts values to their respective internal types. + * Creates a DescriptorProto message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns PhpSettings + * @returns DescriptorProto */ - public static fromObject(object: { [k: string]: any }): google.api.PhpSettings; + public static fromObject(object: { [k: string]: any }): google.protobuf.DescriptorProto; /** - * Creates a plain object from a PhpSettings message. Also converts values to other types if specified. - * @param message PhpSettings + * 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.api.PhpSettings, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.protobuf.DescriptorProto, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this PhpSettings to JSON. + * Converts this DescriptorProto to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; /** - * Gets the default type url for PhpSettings + * 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; } - /** Properties of a PythonSettings. */ - interface IPythonSettings { + namespace DescriptorProto { - /** PythonSettings common */ - common?: (google.api.ICommonLanguageSettings|null); - } + /** Properties of an ExtensionRange. */ + interface IExtensionRange { - /** Represents a PythonSettings. */ - class PythonSettings implements IPythonSettings { + /** ExtensionRange start */ + start?: (number|null); - /** - * Constructs a new PythonSettings. - * @param [properties] Properties to set - */ - constructor(properties?: google.api.IPythonSettings); + /** ExtensionRange end */ + end?: (number|null); - /** PythonSettings common. */ - public common?: (google.api.ICommonLanguageSettings|null); + /** ExtensionRange options */ + options?: (google.protobuf.IExtensionRangeOptions|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; + /** Represents an ExtensionRange. */ + class ExtensionRange implements IExtensionRange { - /** - * 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; + /** + * Constructs a new ExtensionRange. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.DescriptorProto.IExtensionRange); - /** - * 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; + /** ExtensionRange start. */ + public start: number; - /** - * 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; + /** ExtensionRange end. */ + public end: number; - /** - * 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; + /** 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); - /** - * 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 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 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 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 }; - /** - * 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 ExtensionRange to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; - /** - * Converts this PythonSettings 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; + } - /** - * 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 ReservedRange. */ + interface IReservedRange { - /** Properties of a NodeSettings. */ - interface INodeSettings { + /** ReservedRange start */ + start?: (number|null); - /** NodeSettings common */ - common?: (google.api.ICommonLanguageSettings|null); - } + /** ReservedRange end */ + end?: (number|null); + } - /** Represents a NodeSettings. */ - class NodeSettings implements INodeSettings { + /** Represents a ReservedRange. */ + class ReservedRange implements IReservedRange { - /** - * Constructs a new NodeSettings. - * @param [properties] Properties to set - */ - constructor(properties?: google.api.INodeSettings); + /** + * Constructs a new ReservedRange. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.DescriptorProto.IReservedRange); - /** NodeSettings common. */ - public common?: (google.api.ICommonLanguageSettings|null); + /** ReservedRange start. */ + public start: number; - /** - * 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; + /** ReservedRange end. */ + public end: number; - /** - * 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; + /** + * 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 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; + /** + * 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; - /** - * 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; + /** + * 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 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; + /** + * 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; - /** - * 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); + /** + * 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; - /** - * 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; + /** + * 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 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 }; + /** + * 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; - /** - * Converts this NodeSettings to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; + /** + * 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 }; - /** - * 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; + /** + * 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 a DotnetSettings. */ - interface IDotnetSettings { + /** Properties of an ExtensionRangeOptions. */ + interface IExtensionRangeOptions { - /** DotnetSettings common */ - common?: (google.api.ICommonLanguageSettings|null); + /** ExtensionRangeOptions uninterpretedOption */ + uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); } - /** Represents a DotnetSettings. */ - class DotnetSettings implements IDotnetSettings { + /** Represents an ExtensionRangeOptions. */ + class ExtensionRangeOptions implements IExtensionRangeOptions { /** - * Constructs a new DotnetSettings. + * Constructs a new ExtensionRangeOptions. * @param [properties] Properties to set */ - constructor(properties?: google.api.IDotnetSettings); + constructor(properties?: google.protobuf.IExtensionRangeOptions); - /** DotnetSettings common. */ - public common?: (google.api.ICommonLanguageSettings|null); + /** ExtensionRangeOptions uninterpretedOption. */ + public uninterpretedOption: google.protobuf.IUninterpretedOption[]; /** - * Creates a new DotnetSettings instance using the specified properties. + * Creates a new ExtensionRangeOptions instance using the specified properties. * @param [properties] Properties to set - * @returns DotnetSettings instance + * @returns ExtensionRangeOptions instance */ - public static create(properties?: google.api.IDotnetSettings): google.api.DotnetSettings; + public static create(properties?: google.protobuf.IExtensionRangeOptions): google.protobuf.ExtensionRangeOptions; /** - * Encodes the specified DotnetSettings message. Does not implicitly {@link google.api.DotnetSettings.verify|verify} messages. - * @param message DotnetSettings message or plain object to encode + * 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.api.IDotnetSettings, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.protobuf.IExtensionRangeOptions, 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 + * 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.api.IDotnetSettings, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.protobuf.IExtensionRangeOptions, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a DotnetSettings message from the specified reader or buffer. + * 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 DotnetSettings + * @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.api.DotnetSettings; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.ExtensionRangeOptions; /** - * Decodes a DotnetSettings message from the specified reader or buffer, length delimited. + * Decodes an ExtensionRangeOptions message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns DotnetSettings + * @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.api.DotnetSettings; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.ExtensionRangeOptions; /** - * Verifies a DotnetSettings message. + * 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 a DotnetSettings message from a plain object. Also converts values to their respective internal types. + * Creates an ExtensionRangeOptions message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns DotnetSettings + * @returns ExtensionRangeOptions */ - public static fromObject(object: { [k: string]: any }): google.api.DotnetSettings; + public static fromObject(object: { [k: string]: any }): google.protobuf.ExtensionRangeOptions; /** - * Creates a plain object from a DotnetSettings message. Also converts values to other types if specified. - * @param message DotnetSettings + * 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.api.DotnetSettings, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.protobuf.ExtensionRangeOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this DotnetSettings to JSON. + * Converts this ExtensionRangeOptions to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; /** - * Gets the default type url for DotnetSettings + * 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; } - /** Properties of a RubySettings. */ - interface IRubySettings { + /** Properties of a FieldDescriptorProto. */ + interface IFieldDescriptorProto { - /** RubySettings common */ - common?: (google.api.ICommonLanguageSettings|null); + /** 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 RubySettings. */ - class RubySettings implements IRubySettings { + /** Represents a FieldDescriptorProto. */ + class FieldDescriptorProto implements IFieldDescriptorProto { /** - * Constructs a new RubySettings. + * Constructs a new FieldDescriptorProto. * @param [properties] Properties to set */ - constructor(properties?: google.api.IRubySettings); + constructor(properties?: google.protobuf.IFieldDescriptorProto); - /** RubySettings common. */ - public common?: (google.api.ICommonLanguageSettings|null); + /** 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 RubySettings instance using the specified properties. + * Creates a new FieldDescriptorProto instance using the specified properties. * @param [properties] Properties to set - * @returns RubySettings instance + * @returns FieldDescriptorProto instance */ - public static create(properties?: google.api.IRubySettings): google.api.RubySettings; + public static create(properties?: google.protobuf.IFieldDescriptorProto): google.protobuf.FieldDescriptorProto; /** - * Encodes the specified RubySettings message. Does not implicitly {@link google.api.RubySettings.verify|verify} messages. - * @param message RubySettings message or plain object to encode + * 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.api.IRubySettings, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.protobuf.IFieldDescriptorProto, 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 + * 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.api.IRubySettings, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.protobuf.IFieldDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a RubySettings message from the specified reader or buffer. + * 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 RubySettings + * @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.api.RubySettings; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.FieldDescriptorProto; /** - * Decodes a RubySettings message from the specified reader or buffer, length delimited. + * Decodes a FieldDescriptorProto message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns RubySettings + * @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.api.RubySettings; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.FieldDescriptorProto; /** - * Verifies a RubySettings message. + * 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 RubySettings message from a plain object. Also converts values to their respective internal types. + * Creates a FieldDescriptorProto message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns RubySettings + * @returns FieldDescriptorProto */ - public static fromObject(object: { [k: string]: any }): google.api.RubySettings; + public static fromObject(object: { [k: string]: any }): google.protobuf.FieldDescriptorProto; /** - * Creates a plain object from a RubySettings message. Also converts values to other types if specified. - * @param message RubySettings + * 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.api.RubySettings, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.protobuf.FieldDescriptorProto, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this RubySettings to JSON. + * Converts this FieldDescriptorProto to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; /** - * Gets the default type url for RubySettings + * 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; } - /** Properties of a GoSettings. */ - interface IGoSettings { + namespace FieldDescriptorProto { - /** GoSettings common */ - common?: (google.api.ICommonLanguageSettings|null); + /** 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_REQUIRED = 2, + LABEL_REPEATED = 3 + } } - /** Represents a GoSettings. */ - class GoSettings implements IGoSettings { + /** 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 GoSettings. + * Constructs a new OneofDescriptorProto. * @param [properties] Properties to set */ - constructor(properties?: google.api.IGoSettings); + constructor(properties?: google.protobuf.IOneofDescriptorProto); - /** GoSettings common. */ - public common?: (google.api.ICommonLanguageSettings|null); + /** OneofDescriptorProto name. */ + public name: string; + + /** OneofDescriptorProto options. */ + public options?: (google.protobuf.IOneofOptions|null); /** - * Creates a new GoSettings instance using the specified properties. + * Creates a new OneofDescriptorProto instance using the specified properties. * @param [properties] Properties to set - * @returns GoSettings instance + * @returns OneofDescriptorProto instance */ - public static create(properties?: google.api.IGoSettings): google.api.GoSettings; + public static create(properties?: google.protobuf.IOneofDescriptorProto): google.protobuf.OneofDescriptorProto; /** - * Encodes the specified GoSettings message. Does not implicitly {@link google.api.GoSettings.verify|verify} messages. - * @param message GoSettings message or plain object to encode + * 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.api.IGoSettings, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.protobuf.IOneofDescriptorProto, 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 + * 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.api.IGoSettings, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.protobuf.IOneofDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a GoSettings message from the specified reader or buffer. + * 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 GoSettings + * @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.api.GoSettings; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.OneofDescriptorProto; /** - * Decodes a GoSettings message from the specified reader or buffer, length delimited. + * Decodes an OneofDescriptorProto message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns GoSettings + * @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.api.GoSettings; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.OneofDescriptorProto; /** - * Verifies a GoSettings message. + * 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 a GoSettings message from a plain object. Also converts values to their respective internal types. + * Creates an OneofDescriptorProto message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns GoSettings + * @returns OneofDescriptorProto */ - public static fromObject(object: { [k: string]: any }): google.api.GoSettings; + public static fromObject(object: { [k: string]: any }): google.protobuf.OneofDescriptorProto; /** - * Creates a plain object from a GoSettings message. Also converts values to other types if specified. - * @param message GoSettings + * 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.api.GoSettings, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.protobuf.OneofDescriptorProto, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this GoSettings to JSON. + * Converts this OneofDescriptorProto to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; /** - * Gets the default type url for GoSettings + * 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 a MethodSettings. */ - interface IMethodSettings { + /** Properties of an EnumDescriptorProto. */ + interface IEnumDescriptorProto { - /** MethodSettings selector */ - selector?: (string|null); + /** EnumDescriptorProto name */ + name?: (string|null); - /** MethodSettings longRunning */ - longRunning?: (google.api.MethodSettings.ILongRunning|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 a MethodSettings. */ - class MethodSettings implements IMethodSettings { + /** Represents an EnumDescriptorProto. */ + class EnumDescriptorProto implements IEnumDescriptorProto { /** - * Constructs a new MethodSettings. + * Constructs a new EnumDescriptorProto. * @param [properties] Properties to set */ - constructor(properties?: google.api.IMethodSettings); + constructor(properties?: google.protobuf.IEnumDescriptorProto); - /** MethodSettings selector. */ - public selector: string; + /** EnumDescriptorProto name. */ + public name: string; - /** MethodSettings longRunning. */ - public longRunning?: (google.api.MethodSettings.ILongRunning|null); + /** 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 MethodSettings instance using the specified properties. + * Creates a new EnumDescriptorProto instance using the specified properties. * @param [properties] Properties to set - * @returns MethodSettings instance + * @returns EnumDescriptorProto instance */ - public static create(properties?: google.api.IMethodSettings): google.api.MethodSettings; + public static create(properties?: google.protobuf.IEnumDescriptorProto): google.protobuf.EnumDescriptorProto; /** - * Encodes the specified MethodSettings message. Does not implicitly {@link google.api.MethodSettings.verify|verify} messages. - * @param message MethodSettings message or plain object to encode + * 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.api.IMethodSettings, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.protobuf.IEnumDescriptorProto, 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 + * 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.api.IMethodSettings, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.protobuf.IEnumDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a MethodSettings message from the specified reader or buffer. + * 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 MethodSettings + * @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.api.MethodSettings; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.EnumDescriptorProto; /** - * Decodes a MethodSettings message from the specified reader or buffer, length delimited. + * Decodes an EnumDescriptorProto message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns MethodSettings + * @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.api.MethodSettings; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.EnumDescriptorProto; /** - * Verifies a MethodSettings message. + * 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 a MethodSettings message from a plain object. Also converts values to their respective internal types. + * Creates an EnumDescriptorProto message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns MethodSettings + * @returns EnumDescriptorProto */ - public static fromObject(object: { [k: string]: any }): google.api.MethodSettings; + public static fromObject(object: { [k: string]: any }): google.protobuf.EnumDescriptorProto; /** - * Creates a plain object from a MethodSettings message. Also converts values to other types if specified. - * @param message MethodSettings + * 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.api.MethodSettings, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.protobuf.EnumDescriptorProto, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this MethodSettings to JSON. + * Converts this EnumDescriptorProto to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; /** - * Gets the default type url for MethodSettings + * 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 MethodSettings { - - /** Properties of a LongRunning. */ - interface ILongRunning { - - /** LongRunning initialPollDelay */ - initialPollDelay?: (google.protobuf.IDuration|null); + namespace EnumDescriptorProto { - /** LongRunning pollDelayMultiplier */ - pollDelayMultiplier?: (number|null); + /** Properties of an EnumReservedRange. */ + interface IEnumReservedRange { - /** LongRunning maxPollDelay */ - maxPollDelay?: (google.protobuf.IDuration|null); + /** EnumReservedRange start */ + start?: (number|null); - /** LongRunning totalPollTimeout */ - totalPollTimeout?: (google.protobuf.IDuration|null); + /** EnumReservedRange end */ + end?: (number|null); } - /** Represents a LongRunning. */ - class LongRunning implements ILongRunning { + /** Represents an EnumReservedRange. */ + class EnumReservedRange implements IEnumReservedRange { /** - * Constructs a new LongRunning. + * Constructs a new EnumReservedRange. * @param [properties] Properties to set */ - constructor(properties?: google.api.MethodSettings.ILongRunning); - - /** LongRunning initialPollDelay. */ - public initialPollDelay?: (google.protobuf.IDuration|null); - - /** LongRunning pollDelayMultiplier. */ - public pollDelayMultiplier: number; + constructor(properties?: google.protobuf.EnumDescriptorProto.IEnumReservedRange); - /** LongRunning maxPollDelay. */ - public maxPollDelay?: (google.protobuf.IDuration|null); + /** EnumReservedRange start. */ + public start: number; - /** LongRunning totalPollTimeout. */ - public totalPollTimeout?: (google.protobuf.IDuration|null); + /** EnumReservedRange end. */ + public end: number; /** - * Creates a new LongRunning instance using the specified properties. + * Creates a new EnumReservedRange instance using the specified properties. * @param [properties] Properties to set - * @returns LongRunning instance + * @returns EnumReservedRange instance */ - public static create(properties?: google.api.MethodSettings.ILongRunning): google.api.MethodSettings.LongRunning; + public static create(properties?: google.protobuf.EnumDescriptorProto.IEnumReservedRange): google.protobuf.EnumDescriptorProto.EnumReservedRange; /** - * 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 + * 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.api.MethodSettings.ILongRunning, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.protobuf.EnumDescriptorProto.IEnumReservedRange, 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 + * 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.api.MethodSettings.ILongRunning, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.protobuf.EnumDescriptorProto.IEnumReservedRange, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a LongRunning message from the specified reader or buffer. + * 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 LongRunning + * @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.api.MethodSettings.LongRunning; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.EnumDescriptorProto.EnumReservedRange; /** - * Decodes a LongRunning message from the specified reader or buffer, length delimited. + * Decodes an EnumReservedRange message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns LongRunning + * @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.api.MethodSettings.LongRunning; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.EnumDescriptorProto.EnumReservedRange; /** - * Verifies a LongRunning message. + * 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 a LongRunning message from a plain object. Also converts values to their respective internal types. + * Creates an EnumReservedRange message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns LongRunning + * @returns EnumReservedRange */ - public static fromObject(object: { [k: string]: any }): google.api.MethodSettings.LongRunning; + public static fromObject(object: { [k: string]: any }): google.protobuf.EnumDescriptorProto.EnumReservedRange; /** - * Creates a plain object from a LongRunning message. Also converts values to other types if specified. - * @param message LongRunning + * 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.api.MethodSettings.LongRunning, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.protobuf.EnumDescriptorProto.EnumReservedRange, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this LongRunning to JSON. + * Converts this EnumReservedRange to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; /** - * Gets the default type url for LongRunning + * Gets the default type url for EnumReservedRange * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns The default type url */ @@ -4718,3781 +12477,3731 @@ export namespace google { } } - /** ClientLibraryOrganization enum. */ - enum ClientLibraryOrganization { - CLIENT_LIBRARY_ORGANIZATION_UNSPECIFIED = 0, - CLOUD = 1, - ADS = 2, - PHOTOS = 3, - STREET_VIEW = 4 - } + /** 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; - /** ClientLibraryDestination enum. */ - enum ClientLibraryDestination { - CLIENT_LIBRARY_DESTINATION_UNSPECIFIED = 0, - GITHUB = 10, - PACKAGE_MANAGER = 20 - } + /** + * 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; - /** LaunchStage enum. */ - enum LaunchStage { - LAUNCH_STAGE_UNSPECIFIED = 0, - UNIMPLEMENTED = 6, - PRELAUNCH = 7, - EARLY_ACCESS = 1, - ALPHA = 2, - BETA = 3, - GA = 4, - DEPRECATED = 5 - } + /** + * 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); - /** Properties of a ResourceDescriptor. */ - interface IResourceDescriptor { + /** + * 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; - /** ResourceDescriptor type */ - type?: (string|null); + /** + * 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 }; - /** ResourceDescriptor pattern */ - pattern?: (string[]|null); + /** + * Converts this EnumValueDescriptorProto to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; - /** ResourceDescriptor nameField */ - nameField?: (string|null); + /** + * 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; + } - /** ResourceDescriptor history */ - history?: (google.api.ResourceDescriptor.History|keyof typeof google.api.ResourceDescriptor.History|null); + /** Properties of a ServiceDescriptorProto. */ + interface IServiceDescriptorProto { - /** ResourceDescriptor plural */ - plural?: (string|null); + /** ServiceDescriptorProto name */ + name?: (string|null); - /** ResourceDescriptor singular */ - singular?: (string|null); + /** ServiceDescriptorProto method */ + method?: (google.protobuf.IMethodDescriptorProto[]|null); - /** ResourceDescriptor style */ - style?: (google.api.ResourceDescriptor.Style[]|null); + /** ServiceDescriptorProto options */ + options?: (google.protobuf.IServiceOptions|null); } - /** Represents a ResourceDescriptor. */ - class ResourceDescriptor implements IResourceDescriptor { + /** Represents a ServiceDescriptorProto. */ + class ServiceDescriptorProto implements IServiceDescriptorProto { /** - * Constructs a new ResourceDescriptor. + * Constructs a new ServiceDescriptorProto. * @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); + constructor(properties?: google.protobuf.IServiceDescriptorProto); - /** ResourceDescriptor plural. */ - public plural: string; + /** ServiceDescriptorProto name. */ + public name: string; - /** ResourceDescriptor singular. */ - public singular: string; + /** ServiceDescriptorProto method. */ + public method: google.protobuf.IMethodDescriptorProto[]; - /** ResourceDescriptor style. */ - public style: google.api.ResourceDescriptor.Style[]; + /** ServiceDescriptorProto options. */ + public options?: (google.protobuf.IServiceOptions|null); /** - * Creates a new ResourceDescriptor instance using the specified properties. + * Creates a new ServiceDescriptorProto instance using the specified properties. * @param [properties] Properties to set - * @returns ResourceDescriptor instance + * @returns ServiceDescriptorProto instance */ - public static create(properties?: google.api.IResourceDescriptor): google.api.ResourceDescriptor; + public static create(properties?: google.protobuf.IServiceDescriptorProto): google.protobuf.ServiceDescriptorProto; /** - * Encodes the specified ResourceDescriptor message. Does not implicitly {@link google.api.ResourceDescriptor.verify|verify} messages. - * @param message ResourceDescriptor message or plain object to encode + * 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.api.IResourceDescriptor, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.protobuf.IServiceDescriptorProto, 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 + * 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.api.IResourceDescriptor, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.protobuf.IServiceDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a ResourceDescriptor message from the specified reader or buffer. + * 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 ResourceDescriptor + * @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.api.ResourceDescriptor; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.ServiceDescriptorProto; /** - * Decodes a ResourceDescriptor message from the specified reader or buffer, length delimited. + * Decodes a ServiceDescriptorProto message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns ResourceDescriptor + * @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.api.ResourceDescriptor; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.ServiceDescriptorProto; /** - * Verifies a ResourceDescriptor message. + * 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 ResourceDescriptor message from a plain object. Also converts values to their respective internal types. + * Creates a ServiceDescriptorProto message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns ResourceDescriptor + * @returns ServiceDescriptorProto */ - public static fromObject(object: { [k: string]: any }): google.api.ResourceDescriptor; + public static fromObject(object: { [k: string]: any }): google.protobuf.ServiceDescriptorProto; /** - * Creates a plain object from a ResourceDescriptor message. Also converts values to other types if specified. - * @param message ResourceDescriptor + * 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.api.ResourceDescriptor, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.protobuf.ServiceDescriptorProto, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this ResourceDescriptor to JSON. + * Converts this ServiceDescriptorProto to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; /** - * Gets the default type url for ResourceDescriptor + * 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; } - namespace ResourceDescriptor { + /** Properties of a MethodDescriptorProto. */ + interface IMethodDescriptorProto { - /** History enum. */ - enum History { - HISTORY_UNSPECIFIED = 0, - ORIGINALLY_SINGLE_PATTERN = 1, - FUTURE_MULTI_PATTERN = 2 - } + /** MethodDescriptorProto name */ + name?: (string|null); - /** Style enum. */ - enum Style { - STYLE_UNSPECIFIED = 0, - DECLARATIVE_FRIENDLY = 1 - } - } + /** MethodDescriptorProto inputType */ + inputType?: (string|null); - /** Properties of a ResourceReference. */ - interface IResourceReference { + /** MethodDescriptorProto outputType */ + outputType?: (string|null); - /** ResourceReference type */ - type?: (string|null); + /** MethodDescriptorProto options */ + options?: (google.protobuf.IMethodOptions|null); - /** ResourceReference childType */ - childType?: (string|null); + /** MethodDescriptorProto clientStreaming */ + clientStreaming?: (boolean|null); + + /** MethodDescriptorProto serverStreaming */ + serverStreaming?: (boolean|null); } - /** Represents a ResourceReference. */ - class ResourceReference implements IResourceReference { + /** Represents a MethodDescriptorProto. */ + class MethodDescriptorProto implements IMethodDescriptorProto { /** - * Constructs a new ResourceReference. + * Constructs a new MethodDescriptorProto. * @param [properties] Properties to set */ - constructor(properties?: google.api.IResourceReference); + constructor(properties?: google.protobuf.IMethodDescriptorProto); - /** ResourceReference type. */ - public type: string; + /** MethodDescriptorProto name. */ + public name: string; - /** ResourceReference childType. */ - public childType: 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 ResourceReference instance using the specified properties. + * Creates a new MethodDescriptorProto instance using the specified properties. * @param [properties] Properties to set - * @returns ResourceReference instance + * @returns MethodDescriptorProto instance */ - public static create(properties?: google.api.IResourceReference): google.api.ResourceReference; + public static create(properties?: google.protobuf.IMethodDescriptorProto): google.protobuf.MethodDescriptorProto; /** - * Encodes the specified ResourceReference message. Does not implicitly {@link google.api.ResourceReference.verify|verify} messages. - * @param message ResourceReference message or plain object to encode + * 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.api.IResourceReference, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.protobuf.IMethodDescriptorProto, 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 + /** + * 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.api.IResourceReference, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.protobuf.IMethodDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a ResourceReference message from the specified reader or buffer. + * 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 ResourceReference + * @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.api.ResourceReference; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.MethodDescriptorProto; /** - * Decodes a ResourceReference message from the specified reader or buffer, length delimited. + * Decodes a MethodDescriptorProto message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns ResourceReference + * @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.api.ResourceReference; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.MethodDescriptorProto; /** - * Verifies a ResourceReference message. + * 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 ResourceReference message from a plain object. Also converts values to their respective internal types. + * Creates a MethodDescriptorProto message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns ResourceReference + * @returns MethodDescriptorProto */ - public static fromObject(object: { [k: string]: any }): google.api.ResourceReference; + public static fromObject(object: { [k: string]: any }): google.protobuf.MethodDescriptorProto; /** - * Creates a plain object from a ResourceReference message. Also converts values to other types if specified. - * @param message ResourceReference + * 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.api.ResourceReference, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.protobuf.MethodDescriptorProto, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this ResourceReference to JSON. + * Converts this MethodDescriptorProto to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; /** - * Gets the default type url for ResourceReference + * 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; } - } - /** Namespace protobuf. */ - namespace protobuf { + /** Properties of a FileOptions. */ + interface IFileOptions { - /** Properties of a FileDescriptorSet. */ - interface IFileDescriptorSet { + /** FileOptions javaPackage */ + javaPackage?: (string|null); - /** FileDescriptorSet file */ - file?: (google.protobuf.IFileDescriptorProto[]|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 phpGenericServices */ + phpGenericServices?: (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 uninterpretedOption */ + uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); + + /** FileOptions .google.api.resourceDefinition */ + ".google.api.resourceDefinition"?: (google.api.IResourceDescriptor[]|null); } - /** Represents a FileDescriptorSet. */ - class FileDescriptorSet implements IFileDescriptorSet { + /** Represents a FileOptions. */ + class FileOptions implements IFileOptions { /** - * Constructs a new FileDescriptorSet. + * Constructs a new FileOptions. * @param [properties] Properties to set */ - constructor(properties?: google.protobuf.IFileDescriptorSet); + constructor(properties?: google.protobuf.IFileOptions); - /** FileDescriptorSet file. */ - public file: google.protobuf.IFileDescriptorProto[]; + /** 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 phpGenericServices. */ + public phpGenericServices: 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 uninterpretedOption. */ + public uninterpretedOption: google.protobuf.IUninterpretedOption[]; /** - * Creates a new FileDescriptorSet instance using the specified properties. + * Creates a new FileOptions instance using the specified properties. * @param [properties] Properties to set - * @returns FileDescriptorSet instance + * @returns FileOptions instance */ - public static create(properties?: google.protobuf.IFileDescriptorSet): google.protobuf.FileDescriptorSet; + public static create(properties?: google.protobuf.IFileOptions): google.protobuf.FileOptions; /** - * Encodes the specified FileDescriptorSet message. Does not implicitly {@link google.protobuf.FileDescriptorSet.verify|verify} messages. - * @param message FileDescriptorSet message or plain object to encode + * 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.IFileDescriptorSet, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.protobuf.IFileOptions, 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 + * 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.IFileDescriptorSet, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.protobuf.IFileOptions, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a FileDescriptorSet message from the specified reader or buffer. + * 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 FileDescriptorSet + * @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.FileDescriptorSet; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.FileOptions; /** - * Decodes a FileDescriptorSet message from the specified reader or buffer, length delimited. + * Decodes a FileOptions message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns FileDescriptorSet + * @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.FileDescriptorSet; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.FileOptions; /** - * Verifies a FileDescriptorSet message. + * 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 FileDescriptorSet message from a plain object. Also converts values to their respective internal types. + * Creates a FileOptions message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns FileDescriptorSet + * @returns FileOptions */ - public static fromObject(object: { [k: string]: any }): google.protobuf.FileDescriptorSet; + public static fromObject(object: { [k: string]: any }): google.protobuf.FileOptions; /** - * Creates a plain object from a FileDescriptorSet message. Also converts values to other types if specified. - * @param message FileDescriptorSet + * 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.FileDescriptorSet, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.protobuf.FileOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this FileDescriptorSet to JSON. + * Converts this FileOptions to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; /** - * Gets the default type url for FileDescriptorSet + * 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; } - /** 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); + namespace FileOptions { - /** FileDescriptorProto weakDependency */ - weakDependency?: (number[]|null); + /** OptimizeMode enum. */ + enum OptimizeMode { + SPEED = 1, + CODE_SIZE = 2, + LITE_RUNTIME = 3 + } + } - /** FileDescriptorProto messageType */ - messageType?: (google.protobuf.IDescriptorProto[]|null); + /** Properties of a MessageOptions. */ + interface IMessageOptions { - /** FileDescriptorProto enumType */ - enumType?: (google.protobuf.IEnumDescriptorProto[]|null); + /** MessageOptions messageSetWireFormat */ + messageSetWireFormat?: (boolean|null); - /** FileDescriptorProto service */ - service?: (google.protobuf.IServiceDescriptorProto[]|null); + /** MessageOptions noStandardDescriptorAccessor */ + noStandardDescriptorAccessor?: (boolean|null); - /** FileDescriptorProto extension */ - extension?: (google.protobuf.IFieldDescriptorProto[]|null); + /** MessageOptions deprecated */ + deprecated?: (boolean|null); - /** FileDescriptorProto options */ - options?: (google.protobuf.IFileOptions|null); + /** MessageOptions mapEntry */ + mapEntry?: (boolean|null); - /** FileDescriptorProto sourceCodeInfo */ - sourceCodeInfo?: (google.protobuf.ISourceCodeInfo|null); + /** MessageOptions deprecatedLegacyJsonFieldConflicts */ + deprecatedLegacyJsonFieldConflicts?: (boolean|null); - /** FileDescriptorProto syntax */ - syntax?: (string|null); + /** MessageOptions uninterpretedOption */ + uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); - /** FileDescriptorProto edition */ - edition?: (string|null); + /** MessageOptions .google.api.resource */ + ".google.api.resource"?: (google.api.IResourceDescriptor|null); } - /** Represents a FileDescriptorProto. */ - class FileDescriptorProto implements IFileDescriptorProto { + /** Represents a MessageOptions. */ + class MessageOptions implements IMessageOptions { /** - * Constructs a new FileDescriptorProto. + * Constructs a new MessageOptions. * @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[]; + constructor(properties?: google.protobuf.IMessageOptions); - /** FileDescriptorProto service. */ - public service: google.protobuf.IServiceDescriptorProto[]; + /** MessageOptions messageSetWireFormat. */ + public messageSetWireFormat: boolean; - /** FileDescriptorProto extension. */ - public extension: google.protobuf.IFieldDescriptorProto[]; + /** MessageOptions noStandardDescriptorAccessor. */ + public noStandardDescriptorAccessor: boolean; - /** FileDescriptorProto options. */ - public options?: (google.protobuf.IFileOptions|null); + /** MessageOptions deprecated. */ + public deprecated: boolean; - /** FileDescriptorProto sourceCodeInfo. */ - public sourceCodeInfo?: (google.protobuf.ISourceCodeInfo|null); + /** MessageOptions mapEntry. */ + public mapEntry: boolean; - /** FileDescriptorProto syntax. */ - public syntax: string; + /** MessageOptions deprecatedLegacyJsonFieldConflicts. */ + public deprecatedLegacyJsonFieldConflicts: boolean; - /** FileDescriptorProto edition. */ - public edition: string; + /** MessageOptions uninterpretedOption. */ + public uninterpretedOption: google.protobuf.IUninterpretedOption[]; /** - * Creates a new FileDescriptorProto instance using the specified properties. + * Creates a new MessageOptions instance using the specified properties. * @param [properties] Properties to set - * @returns FileDescriptorProto instance + * @returns MessageOptions instance */ - public static create(properties?: google.protobuf.IFileDescriptorProto): google.protobuf.FileDescriptorProto; + public static create(properties?: google.protobuf.IMessageOptions): google.protobuf.MessageOptions; /** - * Encodes the specified FileDescriptorProto message. Does not implicitly {@link google.protobuf.FileDescriptorProto.verify|verify} messages. - * @param message FileDescriptorProto message or plain object to encode + * 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.IFileDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.protobuf.IMessageOptions, 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 + * 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.IFileDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.protobuf.IMessageOptions, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a FileDescriptorProto message from the specified reader or buffer. + * 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 FileDescriptorProto + * @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.FileDescriptorProto; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.MessageOptions; /** - * Decodes a FileDescriptorProto message from the specified reader or buffer, length delimited. + * Decodes a MessageOptions message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns FileDescriptorProto + * @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.FileDescriptorProto; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.MessageOptions; /** - * Verifies a FileDescriptorProto message. + * 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 FileDescriptorProto message from a plain object. Also converts values to their respective internal types. + * Creates a MessageOptions message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns FileDescriptorProto + * @returns MessageOptions */ - public static fromObject(object: { [k: string]: any }): google.protobuf.FileDescriptorProto; + public static fromObject(object: { [k: string]: any }): google.protobuf.MessageOptions; /** - * Creates a plain object from a FileDescriptorProto message. Also converts values to other types if specified. - * @param message FileDescriptorProto + * 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.FileDescriptorProto, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.protobuf.MessageOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this FileDescriptorProto to JSON. + * Converts this MessageOptions to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; /** - * Gets the default type url for FileDescriptorProto + * 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 DescriptorProto. */ - interface IDescriptorProto { + /** Properties of a FieldOptions. */ + interface IFieldOptions { - /** DescriptorProto name */ - name?: (string|null); + /** FieldOptions ctype */ + ctype?: (google.protobuf.FieldOptions.CType|keyof typeof google.protobuf.FieldOptions.CType|null); - /** DescriptorProto field */ - field?: (google.protobuf.IFieldDescriptorProto[]|null); + /** FieldOptions packed */ + packed?: (boolean|null); - /** DescriptorProto extension */ - extension?: (google.protobuf.IFieldDescriptorProto[]|null); + /** FieldOptions jstype */ + jstype?: (google.protobuf.FieldOptions.JSType|keyof typeof google.protobuf.FieldOptions.JSType|null); - /** DescriptorProto nestedType */ - nestedType?: (google.protobuf.IDescriptorProto[]|null); + /** FieldOptions lazy */ + lazy?: (boolean|null); - /** DescriptorProto enumType */ - enumType?: (google.protobuf.IEnumDescriptorProto[]|null); + /** FieldOptions unverifiedLazy */ + unverifiedLazy?: (boolean|null); - /** DescriptorProto extensionRange */ - extensionRange?: (google.protobuf.DescriptorProto.IExtensionRange[]|null); + /** FieldOptions deprecated */ + deprecated?: (boolean|null); - /** DescriptorProto oneofDecl */ - oneofDecl?: (google.protobuf.IOneofDescriptorProto[]|null); + /** FieldOptions weak */ + weak?: (boolean|null); - /** DescriptorProto options */ - options?: (google.protobuf.IMessageOptions|null); + /** FieldOptions debugRedact */ + debugRedact?: (boolean|null); - /** DescriptorProto reservedRange */ - reservedRange?: (google.protobuf.DescriptorProto.IReservedRange[]|null); + /** FieldOptions retention */ + retention?: (google.protobuf.FieldOptions.OptionRetention|keyof typeof google.protobuf.FieldOptions.OptionRetention|null); - /** DescriptorProto reservedName */ - reservedName?: (string[]|null); + /** FieldOptions target */ + target?: (google.protobuf.FieldOptions.OptionTargetType|keyof typeof google.protobuf.FieldOptions.OptionTargetType|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 DescriptorProto. */ - class DescriptorProto implements IDescriptorProto { + /** Represents a FieldOptions. */ + class FieldOptions implements IFieldOptions { /** - * Constructs a new DescriptorProto. + * Constructs a new FieldOptions. * @param [properties] Properties to set */ - constructor(properties?: google.protobuf.IDescriptorProto); + constructor(properties?: google.protobuf.IFieldOptions); - /** DescriptorProto name. */ - public name: string; + /** FieldOptions ctype. */ + public ctype: (google.protobuf.FieldOptions.CType|keyof typeof google.protobuf.FieldOptions.CType); - /** DescriptorProto field. */ - public field: google.protobuf.IFieldDescriptorProto[]; + /** FieldOptions packed. */ + public packed: boolean; - /** DescriptorProto extension. */ - public extension: google.protobuf.IFieldDescriptorProto[]; + /** FieldOptions jstype. */ + public jstype: (google.protobuf.FieldOptions.JSType|keyof typeof google.protobuf.FieldOptions.JSType); - /** DescriptorProto nestedType. */ - public nestedType: google.protobuf.IDescriptorProto[]; + /** FieldOptions lazy. */ + public lazy: boolean; - /** DescriptorProto enumType. */ - public enumType: google.protobuf.IEnumDescriptorProto[]; + /** FieldOptions unverifiedLazy. */ + public unverifiedLazy: boolean; - /** DescriptorProto extensionRange. */ - public extensionRange: google.protobuf.DescriptorProto.IExtensionRange[]; + /** FieldOptions deprecated. */ + public deprecated: boolean; - /** DescriptorProto oneofDecl. */ - public oneofDecl: google.protobuf.IOneofDescriptorProto[]; + /** FieldOptions weak. */ + public weak: boolean; - /** DescriptorProto options. */ - public options?: (google.protobuf.IMessageOptions|null); + /** FieldOptions debugRedact. */ + public debugRedact: boolean; - /** DescriptorProto reservedRange. */ - public reservedRange: google.protobuf.DescriptorProto.IReservedRange[]; + /** FieldOptions retention. */ + public retention: (google.protobuf.FieldOptions.OptionRetention|keyof typeof google.protobuf.FieldOptions.OptionRetention); - /** DescriptorProto reservedName. */ - public reservedName: string[]; + /** FieldOptions target. */ + public target: (google.protobuf.FieldOptions.OptionTargetType|keyof typeof google.protobuf.FieldOptions.OptionTargetType); + + /** FieldOptions uninterpretedOption. */ + public uninterpretedOption: google.protobuf.IUninterpretedOption[]; /** - * Creates a new DescriptorProto instance using the specified properties. + * Creates a new FieldOptions instance using the specified properties. * @param [properties] Properties to set - * @returns DescriptorProto instance + * @returns FieldOptions instance */ - public static create(properties?: google.protobuf.IDescriptorProto): google.protobuf.DescriptorProto; + public static create(properties?: google.protobuf.IFieldOptions): google.protobuf.FieldOptions; /** - * Encodes the specified DescriptorProto message. Does not implicitly {@link google.protobuf.DescriptorProto.verify|verify} messages. - * @param message DescriptorProto message or plain object to encode + * 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.IDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.protobuf.IFieldOptions, 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 + * 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.IDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.protobuf.IFieldOptions, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a DescriptorProto message from the specified reader or buffer. + * 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 DescriptorProto + * @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.DescriptorProto; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.FieldOptions; /** - * Decodes a DescriptorProto message from the specified reader or buffer, length delimited. + * Decodes a FieldOptions message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns DescriptorProto + * @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.DescriptorProto; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.FieldOptions; /** - * Verifies a DescriptorProto message. + * 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 DescriptorProto message from a plain object. Also converts values to their respective internal types. + * Creates a FieldOptions message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns DescriptorProto + * @returns FieldOptions */ - public static fromObject(object: { [k: string]: any }): google.protobuf.DescriptorProto; + public static fromObject(object: { [k: string]: any }): google.protobuf.FieldOptions; /** - * Creates a plain object from a DescriptorProto message. Also converts values to other types if specified. - * @param message DescriptorProto + * 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.DescriptorProto, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.protobuf.FieldOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this DescriptorProto to JSON. + * Converts this FieldOptions to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; /** - * Gets the default type url for DescriptorProto + * 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 DescriptorProto { - - /** Properties of an ExtensionRange. */ - interface IExtensionRange { - - /** ExtensionRange start */ - start?: (number|null); - - /** ExtensionRange end */ - end?: (number|null); + namespace FieldOptions { - /** ExtensionRange options */ - options?: (google.protobuf.IExtensionRangeOptions|null); + /** CType enum. */ + enum CType { + STRING = 0, + CORD = 1, + STRING_PIECE = 2 } - /** 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; + /** JSType enum. */ + enum JSType { + JS_NORMAL = 0, + JS_STRING = 1, + JS_NUMBER = 2 } - /** Properties of a ReservedRange. */ - interface IReservedRange { - - /** ReservedRange start */ - start?: (number|null); - - /** ReservedRange end */ - end?: (number|null); + /** OptionRetention enum. */ + enum OptionRetention { + RETENTION_UNKNOWN = 0, + RETENTION_RUNTIME = 1, + RETENTION_SOURCE = 2 } - /** 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; + /** 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 ExtensionRangeOptions. */ - interface IExtensionRangeOptions { + /** Properties of an OneofOptions. */ + interface IOneofOptions { - /** ExtensionRangeOptions uninterpretedOption */ + /** OneofOptions uninterpretedOption */ uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); } - /** Represents an ExtensionRangeOptions. */ - class ExtensionRangeOptions implements IExtensionRangeOptions { + /** Represents an OneofOptions. */ + class OneofOptions implements IOneofOptions { /** - * Constructs a new ExtensionRangeOptions. + * Constructs a new OneofOptions. * @param [properties] Properties to set */ - constructor(properties?: google.protobuf.IExtensionRangeOptions); + constructor(properties?: google.protobuf.IOneofOptions); - /** ExtensionRangeOptions uninterpretedOption. */ + /** OneofOptions uninterpretedOption. */ public uninterpretedOption: google.protobuf.IUninterpretedOption[]; /** - * Creates a new ExtensionRangeOptions instance using the specified properties. + * Creates a new OneofOptions instance using the specified properties. * @param [properties] Properties to set - * @returns ExtensionRangeOptions instance + * @returns OneofOptions instance */ - public static create(properties?: google.protobuf.IExtensionRangeOptions): google.protobuf.ExtensionRangeOptions; + public static create(properties?: google.protobuf.IOneofOptions): google.protobuf.OneofOptions; /** - * Encodes the specified ExtensionRangeOptions message. Does not implicitly {@link google.protobuf.ExtensionRangeOptions.verify|verify} messages. - * @param message ExtensionRangeOptions message or plain object to encode + * 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.IExtensionRangeOptions, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.protobuf.IOneofOptions, 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 + * 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.IExtensionRangeOptions, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.protobuf.IOneofOptions, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes an ExtensionRangeOptions message from the specified reader or buffer. + * 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 ExtensionRangeOptions + * @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.ExtensionRangeOptions; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.OneofOptions; /** - * Decodes an ExtensionRangeOptions message from the specified reader or buffer, length delimited. + * Decodes an OneofOptions message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns ExtensionRangeOptions + * @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.ExtensionRangeOptions; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.OneofOptions; /** - * Verifies an ExtensionRangeOptions message. + * 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 ExtensionRangeOptions message from a plain object. Also converts values to their respective internal types. + * Creates an OneofOptions message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns ExtensionRangeOptions + * @returns OneofOptions */ - public static fromObject(object: { [k: string]: any }): google.protobuf.ExtensionRangeOptions; + public static fromObject(object: { [k: string]: any }): google.protobuf.OneofOptions; /** - * Creates a plain object from an ExtensionRangeOptions message. Also converts values to other types if specified. - * @param message ExtensionRangeOptions + * 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.ExtensionRangeOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.protobuf.OneofOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this ExtensionRangeOptions to JSON. + * Converts this OneofOptions to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; /** - * Gets the default type url for ExtensionRangeOptions + * 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 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); + /** Properties of an EnumOptions. */ + interface IEnumOptions { - /** FieldDescriptorProto oneofIndex */ - oneofIndex?: (number|null); + /** EnumOptions allowAlias */ + allowAlias?: (boolean|null); - /** FieldDescriptorProto jsonName */ - jsonName?: (string|null); + /** EnumOptions deprecated */ + deprecated?: (boolean|null); - /** FieldDescriptorProto options */ - options?: (google.protobuf.IFieldOptions|null); + /** EnumOptions deprecatedLegacyJsonFieldConflicts */ + deprecatedLegacyJsonFieldConflicts?: (boolean|null); - /** FieldDescriptorProto proto3Optional */ - proto3Optional?: (boolean|null); + /** EnumOptions uninterpretedOption */ + uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); } - /** Represents a FieldDescriptorProto. */ - class FieldDescriptorProto implements IFieldDescriptorProto { + /** Represents an EnumOptions. */ + class EnumOptions implements IEnumOptions { /** - * Constructs a new FieldDescriptorProto. + * Constructs a new EnumOptions. * @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; + constructor(properties?: google.protobuf.IEnumOptions); - /** FieldDescriptorProto oneofIndex. */ - public oneofIndex: number; + /** EnumOptions allowAlias. */ + public allowAlias: boolean; - /** FieldDescriptorProto jsonName. */ - public jsonName: string; + /** EnumOptions deprecated. */ + public deprecated: boolean; - /** FieldDescriptorProto options. */ - public options?: (google.protobuf.IFieldOptions|null); + /** EnumOptions deprecatedLegacyJsonFieldConflicts. */ + public deprecatedLegacyJsonFieldConflicts: boolean; - /** FieldDescriptorProto proto3Optional. */ - public proto3Optional: boolean; + /** EnumOptions uninterpretedOption. */ + public uninterpretedOption: google.protobuf.IUninterpretedOption[]; /** - * Creates a new FieldDescriptorProto instance using the specified properties. + * Creates a new EnumOptions instance using the specified properties. * @param [properties] Properties to set - * @returns FieldDescriptorProto instance + * @returns EnumOptions instance */ - public static create(properties?: google.protobuf.IFieldDescriptorProto): google.protobuf.FieldDescriptorProto; + public static create(properties?: google.protobuf.IEnumOptions): google.protobuf.EnumOptions; /** - * Encodes the specified FieldDescriptorProto message. Does not implicitly {@link google.protobuf.FieldDescriptorProto.verify|verify} messages. - * @param message FieldDescriptorProto message or plain object to encode + * 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.IFieldDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.protobuf.IEnumOptions, 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 + * 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.IFieldDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.protobuf.IEnumOptions, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a FieldDescriptorProto message from the specified reader or buffer. + * 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 FieldDescriptorProto + * @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.FieldDescriptorProto; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.EnumOptions; /** - * Decodes a FieldDescriptorProto message from the specified reader or buffer, length delimited. + * Decodes an EnumOptions message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns FieldDescriptorProto + * @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.FieldDescriptorProto; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.EnumOptions; /** - * Verifies a FieldDescriptorProto message. + * 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 a FieldDescriptorProto message from a plain object. Also converts values to their respective internal types. + * Creates an EnumOptions message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns FieldDescriptorProto + * @returns EnumOptions */ - public static fromObject(object: { [k: string]: any }): google.protobuf.FieldDescriptorProto; + public static fromObject(object: { [k: string]: any }): google.protobuf.EnumOptions; /** - * Creates a plain object from a FieldDescriptorProto message. Also converts values to other types if specified. - * @param message FieldDescriptorProto + * 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.FieldDescriptorProto, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.protobuf.EnumOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this FieldDescriptorProto to JSON. + * Converts this EnumOptions to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; /** - * Gets the default type url for FieldDescriptorProto + * 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; } - 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_REQUIRED = 2, - LABEL_REPEATED = 3 - } - } - - /** Properties of an OneofDescriptorProto. */ - interface IOneofDescriptorProto { + /** Properties of an EnumValueOptions. */ + interface IEnumValueOptions { - /** OneofDescriptorProto name */ - name?: (string|null); + /** EnumValueOptions deprecated */ + deprecated?: (boolean|null); - /** OneofDescriptorProto options */ - options?: (google.protobuf.IOneofOptions|null); + /** EnumValueOptions uninterpretedOption */ + uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); } - /** Represents an OneofDescriptorProto. */ - class OneofDescriptorProto implements IOneofDescriptorProto { + /** Represents an EnumValueOptions. */ + class EnumValueOptions implements IEnumValueOptions { /** - * Constructs a new OneofDescriptorProto. + * Constructs a new EnumValueOptions. * @param [properties] Properties to set */ - constructor(properties?: google.protobuf.IOneofDescriptorProto); + constructor(properties?: google.protobuf.IEnumValueOptions); - /** OneofDescriptorProto name. */ - public name: string; + /** EnumValueOptions deprecated. */ + public deprecated: boolean; - /** OneofDescriptorProto options. */ - public options?: (google.protobuf.IOneofOptions|null); + /** EnumValueOptions uninterpretedOption. */ + public uninterpretedOption: google.protobuf.IUninterpretedOption[]; /** - * Creates a new OneofDescriptorProto instance using the specified properties. + * Creates a new EnumValueOptions instance using the specified properties. * @param [properties] Properties to set - * @returns OneofDescriptorProto instance + * @returns EnumValueOptions instance */ - public static create(properties?: google.protobuf.IOneofDescriptorProto): google.protobuf.OneofDescriptorProto; + public static create(properties?: google.protobuf.IEnumValueOptions): google.protobuf.EnumValueOptions; /** - * Encodes the specified OneofDescriptorProto message. Does not implicitly {@link google.protobuf.OneofDescriptorProto.verify|verify} messages. - * @param message OneofDescriptorProto message or plain object to encode + * 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.IOneofDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.protobuf.IEnumValueOptions, 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 + * 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.IOneofDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.protobuf.IEnumValueOptions, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes an OneofDescriptorProto message from the specified reader or buffer. + * 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 OneofDescriptorProto + * @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.OneofDescriptorProto; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.EnumValueOptions; /** - * Decodes an OneofDescriptorProto message from the specified reader or buffer, length delimited. + * Decodes an EnumValueOptions message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns OneofDescriptorProto + * @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.OneofDescriptorProto; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.EnumValueOptions; /** - * Verifies an OneofDescriptorProto message. + * 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 OneofDescriptorProto message from a plain object. Also converts values to their respective internal types. + * Creates an EnumValueOptions message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns OneofDescriptorProto + * @returns EnumValueOptions */ - public static fromObject(object: { [k: string]: any }): google.protobuf.OneofDescriptorProto; + public static fromObject(object: { [k: string]: any }): google.protobuf.EnumValueOptions; /** - * Creates a plain object from an OneofDescriptorProto message. Also converts values to other types if specified. - * @param message OneofDescriptorProto + * 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.OneofDescriptorProto, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.protobuf.EnumValueOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this OneofDescriptorProto to JSON. + * Converts this EnumValueOptions to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; /** - * Gets the default type url for OneofDescriptorProto + * 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 an EnumDescriptorProto. */ - interface IEnumDescriptorProto { - - /** EnumDescriptorProto name */ - name?: (string|null); + /** Properties of a ServiceOptions. */ + interface IServiceOptions { - /** EnumDescriptorProto value */ - value?: (google.protobuf.IEnumValueDescriptorProto[]|null); + /** ServiceOptions deprecated */ + deprecated?: (boolean|null); - /** EnumDescriptorProto options */ - options?: (google.protobuf.IEnumOptions|null); + /** ServiceOptions uninterpretedOption */ + uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); - /** EnumDescriptorProto reservedRange */ - reservedRange?: (google.protobuf.EnumDescriptorProto.IEnumReservedRange[]|null); + /** ServiceOptions .google.api.defaultHost */ + ".google.api.defaultHost"?: (string|null); - /** EnumDescriptorProto reservedName */ - reservedName?: (string[]|null); + /** ServiceOptions .google.api.oauthScopes */ + ".google.api.oauthScopes"?: (string|null); } - /** Represents an EnumDescriptorProto. */ - class EnumDescriptorProto implements IEnumDescriptorProto { + /** Represents a ServiceOptions. */ + class ServiceOptions implements IServiceOptions { /** - * Constructs a new EnumDescriptorProto. + * Constructs a new ServiceOptions. * @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); + constructor(properties?: google.protobuf.IServiceOptions); - /** EnumDescriptorProto reservedRange. */ - public reservedRange: google.protobuf.EnumDescriptorProto.IEnumReservedRange[]; + /** ServiceOptions deprecated. */ + public deprecated: boolean; - /** EnumDescriptorProto reservedName. */ - public reservedName: string[]; + /** ServiceOptions uninterpretedOption. */ + public uninterpretedOption: google.protobuf.IUninterpretedOption[]; /** - * Creates a new EnumDescriptorProto instance using the specified properties. + * Creates a new ServiceOptions instance using the specified properties. * @param [properties] Properties to set - * @returns EnumDescriptorProto instance + * @returns ServiceOptions instance */ - public static create(properties?: google.protobuf.IEnumDescriptorProto): google.protobuf.EnumDescriptorProto; + public static create(properties?: google.protobuf.IServiceOptions): google.protobuf.ServiceOptions; /** - * Encodes the specified EnumDescriptorProto message. Does not implicitly {@link google.protobuf.EnumDescriptorProto.verify|verify} messages. - * @param message EnumDescriptorProto message or plain object to encode + * 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.IEnumDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.protobuf.IServiceOptions, 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 + * 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.IEnumDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.protobuf.IServiceOptions, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes an EnumDescriptorProto message from the specified reader or buffer. + * 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 EnumDescriptorProto + * @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.EnumDescriptorProto; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.ServiceOptions; /** - * Decodes an EnumDescriptorProto message from the specified reader or buffer, length delimited. + * Decodes a ServiceOptions message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns EnumDescriptorProto + * @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.EnumDescriptorProto; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.ServiceOptions; /** - * Verifies an EnumDescriptorProto message. + * 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 an EnumDescriptorProto message from a plain object. Also converts values to their respective internal types. + * Creates a ServiceOptions message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns EnumDescriptorProto + * @returns ServiceOptions */ - public static fromObject(object: { [k: string]: any }): google.protobuf.EnumDescriptorProto; + public static fromObject(object: { [k: string]: any }): google.protobuf.ServiceOptions; /** - * Creates a plain object from an EnumDescriptorProto message. Also converts values to other types if specified. - * @param message EnumDescriptorProto + * 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.EnumDescriptorProto, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.protobuf.ServiceOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this EnumDescriptorProto to JSON. + * Converts this ServiceOptions to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; /** - * Gets the default type url for EnumDescriptorProto + * 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; } - 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 }; + /** Properties of a MethodOptions. */ + interface IMethodOptions { - /** - * Converts this EnumReservedRange to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; + /** MethodOptions deprecated */ + deprecated?: (boolean|null); - /** - * 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; - } - } + /** MethodOptions idempotencyLevel */ + idempotencyLevel?: (google.protobuf.MethodOptions.IdempotencyLevel|keyof typeof google.protobuf.MethodOptions.IdempotencyLevel|null); - /** Properties of an EnumValueDescriptorProto. */ - interface IEnumValueDescriptorProto { + /** MethodOptions uninterpretedOption */ + uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); - /** EnumValueDescriptorProto name */ - name?: (string|null); + /** MethodOptions .google.api.http */ + ".google.api.http"?: (google.api.IHttpRule|null); - /** EnumValueDescriptorProto number */ - number?: (number|null); + /** MethodOptions .google.api.methodSignature */ + ".google.api.methodSignature"?: (string[]|null); - /** EnumValueDescriptorProto options */ - options?: (google.protobuf.IEnumValueOptions|null); + /** MethodOptions .google.longrunning.operationInfo */ + ".google.longrunning.operationInfo"?: (google.longrunning.IOperationInfo|null); } - /** Represents an EnumValueDescriptorProto. */ - class EnumValueDescriptorProto implements IEnumValueDescriptorProto { + /** Represents a MethodOptions. */ + class MethodOptions implements IMethodOptions { /** - * Constructs a new EnumValueDescriptorProto. + * Constructs a new MethodOptions. * @param [properties] Properties to set */ - constructor(properties?: google.protobuf.IEnumValueDescriptorProto); + constructor(properties?: google.protobuf.IMethodOptions); - /** EnumValueDescriptorProto name. */ - public name: string; + /** MethodOptions deprecated. */ + public deprecated: boolean; - /** EnumValueDescriptorProto number. */ - public number: number; + /** MethodOptions idempotencyLevel. */ + public idempotencyLevel: (google.protobuf.MethodOptions.IdempotencyLevel|keyof typeof google.protobuf.MethodOptions.IdempotencyLevel); - /** EnumValueDescriptorProto options. */ - public options?: (google.protobuf.IEnumValueOptions|null); + /** MethodOptions uninterpretedOption. */ + public uninterpretedOption: google.protobuf.IUninterpretedOption[]; /** - * Creates a new EnumValueDescriptorProto instance using the specified properties. + * Creates a new MethodOptions instance using the specified properties. * @param [properties] Properties to set - * @returns EnumValueDescriptorProto instance + * @returns MethodOptions instance */ - public static create(properties?: google.protobuf.IEnumValueDescriptorProto): google.protobuf.EnumValueDescriptorProto; + public static create(properties?: google.protobuf.IMethodOptions): google.protobuf.MethodOptions; /** - * Encodes the specified EnumValueDescriptorProto message. Does not implicitly {@link google.protobuf.EnumValueDescriptorProto.verify|verify} messages. - * @param message EnumValueDescriptorProto message or plain object to encode + * 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.IEnumValueDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.protobuf.IMethodOptions, 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 + * 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.IEnumValueDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.protobuf.IMethodOptions, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes an EnumValueDescriptorProto message from the specified reader or buffer. + * 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 EnumValueDescriptorProto + * @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.EnumValueDescriptorProto; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.MethodOptions; /** - * Decodes an EnumValueDescriptorProto message from the specified reader or buffer, length delimited. + * Decodes a MethodOptions message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns EnumValueDescriptorProto + * @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.EnumValueDescriptorProto; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.MethodOptions; /** - * Verifies an EnumValueDescriptorProto message. + * 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 an EnumValueDescriptorProto message from a plain object. Also converts values to their respective internal types. + * Creates a MethodOptions message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns EnumValueDescriptorProto + * @returns MethodOptions */ - public static fromObject(object: { [k: string]: any }): google.protobuf.EnumValueDescriptorProto; + public static fromObject(object: { [k: string]: any }): google.protobuf.MethodOptions; /** - * Creates a plain object from an EnumValueDescriptorProto message. Also converts values to other types if specified. - * @param message EnumValueDescriptorProto + * 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.EnumValueDescriptorProto, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.protobuf.MethodOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this EnumValueDescriptorProto to JSON. + * Converts this MethodOptions to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; /** - * Gets the default type url for EnumValueDescriptorProto + * 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; } - /** Properties of a ServiceDescriptorProto. */ - interface IServiceDescriptorProto { + namespace MethodOptions { - /** ServiceDescriptorProto name */ - name?: (string|null); + /** IdempotencyLevel enum. */ + enum IdempotencyLevel { + IDEMPOTENCY_UNKNOWN = 0, + NO_SIDE_EFFECTS = 1, + IDEMPOTENT = 2 + } + } - /** ServiceDescriptorProto method */ - method?: (google.protobuf.IMethodDescriptorProto[]|null); + /** Properties of an UninterpretedOption. */ + interface IUninterpretedOption { - /** ServiceDescriptorProto options */ - options?: (google.protobuf.IServiceOptions|null); + /** 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|string|null); + + /** UninterpretedOption aggregateValue */ + aggregateValue?: (string|null); } - /** Represents a ServiceDescriptorProto. */ - class ServiceDescriptorProto implements IServiceDescriptorProto { + /** Represents an UninterpretedOption. */ + class UninterpretedOption implements IUninterpretedOption { /** - * Constructs a new ServiceDescriptorProto. + * Constructs a new UninterpretedOption. * @param [properties] Properties to set */ - constructor(properties?: google.protobuf.IServiceDescriptorProto); + constructor(properties?: google.protobuf.IUninterpretedOption); - /** ServiceDescriptorProto name. */ - public name: string; + /** UninterpretedOption name. */ + public name: google.protobuf.UninterpretedOption.INamePart[]; - /** ServiceDescriptorProto method. */ - public method: google.protobuf.IMethodDescriptorProto[]; + /** UninterpretedOption identifierValue. */ + public identifierValue: string; - /** ServiceDescriptorProto options. */ - public options?: (google.protobuf.IServiceOptions|null); + /** UninterpretedOption positiveIntValue. */ + public positiveIntValue: (number|Long|string); + + /** UninterpretedOption negativeIntValue. */ + public negativeIntValue: (number|Long|string); + + /** UninterpretedOption doubleValue. */ + public doubleValue: number; + + /** UninterpretedOption stringValue. */ + public stringValue: (Uint8Array|string); + + /** UninterpretedOption aggregateValue. */ + public aggregateValue: string; /** - * Creates a new ServiceDescriptorProto instance using the specified properties. + * Creates a new UninterpretedOption instance using the specified properties. * @param [properties] Properties to set - * @returns ServiceDescriptorProto instance + * @returns UninterpretedOption instance */ - public static create(properties?: google.protobuf.IServiceDescriptorProto): google.protobuf.ServiceDescriptorProto; + public static create(properties?: google.protobuf.IUninterpretedOption): google.protobuf.UninterpretedOption; /** - * Encodes the specified ServiceDescriptorProto message. Does not implicitly {@link google.protobuf.ServiceDescriptorProto.verify|verify} messages. - * @param message ServiceDescriptorProto message or plain object to encode + * 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.IServiceDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.protobuf.IUninterpretedOption, 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 + * 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.IServiceDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.protobuf.IUninterpretedOption, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a ServiceDescriptorProto message from the specified reader or buffer. + * 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 ServiceDescriptorProto + * @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.ServiceDescriptorProto; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.UninterpretedOption; /** - * Decodes a ServiceDescriptorProto message from the specified reader or buffer, length delimited. + * Decodes an UninterpretedOption message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns ServiceDescriptorProto + * @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.ServiceDescriptorProto; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.UninterpretedOption; /** - * Verifies a ServiceDescriptorProto message. + * 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 a ServiceDescriptorProto message from a plain object. Also converts values to their respective internal types. + * Creates an UninterpretedOption message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns ServiceDescriptorProto + * @returns UninterpretedOption */ - public static fromObject(object: { [k: string]: any }): google.protobuf.ServiceDescriptorProto; + public static fromObject(object: { [k: string]: any }): google.protobuf.UninterpretedOption; /** - * Creates a plain object from a ServiceDescriptorProto message. Also converts values to other types if specified. - * @param message ServiceDescriptorProto + * 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.ServiceDescriptorProto, options?: $protobuf.IConversionOptions): { [k: string]: any }; + 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; - /** - * Converts this ServiceDescriptorProto to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; + /** + * 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; - /** - * 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; - } + /** + * 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; - /** Properties of a MethodDescriptorProto. */ - interface IMethodDescriptorProto { + /** + * 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); - /** MethodDescriptorProto name */ - name?: (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; - /** MethodDescriptorProto inputType */ - inputType?: (string|null); + /** + * 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 }; - /** MethodDescriptorProto outputType */ - outputType?: (string|null); + /** + * Converts this NamePart to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; - /** MethodDescriptorProto options */ - options?: (google.protobuf.IMethodOptions|null); + /** + * 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; + } + } - /** MethodDescriptorProto clientStreaming */ - clientStreaming?: (boolean|null); + /** Properties of a SourceCodeInfo. */ + interface ISourceCodeInfo { - /** MethodDescriptorProto serverStreaming */ - serverStreaming?: (boolean|null); + /** SourceCodeInfo location */ + location?: (google.protobuf.SourceCodeInfo.ILocation[]|null); } - /** Represents a MethodDescriptorProto. */ - class MethodDescriptorProto implements IMethodDescriptorProto { + /** Represents a SourceCodeInfo. */ + class SourceCodeInfo implements ISourceCodeInfo { /** - * Constructs a new MethodDescriptorProto. + * Constructs a new SourceCodeInfo. * @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; + constructor(properties?: google.protobuf.ISourceCodeInfo); - /** MethodDescriptorProto serverStreaming. */ - public serverStreaming: boolean; + /** SourceCodeInfo location. */ + public location: google.protobuf.SourceCodeInfo.ILocation[]; /** - * Creates a new MethodDescriptorProto instance using the specified properties. + * Creates a new SourceCodeInfo instance using the specified properties. * @param [properties] Properties to set - * @returns MethodDescriptorProto instance + * @returns SourceCodeInfo instance */ - public static create(properties?: google.protobuf.IMethodDescriptorProto): google.protobuf.MethodDescriptorProto; + public static create(properties?: google.protobuf.ISourceCodeInfo): google.protobuf.SourceCodeInfo; /** - * Encodes the specified MethodDescriptorProto message. Does not implicitly {@link google.protobuf.MethodDescriptorProto.verify|verify} messages. - * @param message MethodDescriptorProto message or plain object to encode + * 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.IMethodDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.protobuf.ISourceCodeInfo, 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 + * 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.IMethodDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.protobuf.ISourceCodeInfo, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a MethodDescriptorProto message from the specified reader or buffer. + * 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 MethodDescriptorProto + * @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.MethodDescriptorProto; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.SourceCodeInfo; /** - * Decodes a MethodDescriptorProto message from the specified reader or buffer, length delimited. + * Decodes a SourceCodeInfo message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns MethodDescriptorProto + * @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.MethodDescriptorProto; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.SourceCodeInfo; /** - * Verifies a MethodDescriptorProto message. + * 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 MethodDescriptorProto message from a plain object. Also converts values to their respective internal types. + * Creates a SourceCodeInfo message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns MethodDescriptorProto + * @returns SourceCodeInfo */ - public static fromObject(object: { [k: string]: any }): google.protobuf.MethodDescriptorProto; + public static fromObject(object: { [k: string]: any }): google.protobuf.SourceCodeInfo; /** - * Creates a plain object from a MethodDescriptorProto message. Also converts values to other types if specified. - * @param message MethodDescriptorProto + * 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.MethodDescriptorProto, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.protobuf.SourceCodeInfo, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this MethodDescriptorProto to JSON. + * Converts this SourceCodeInfo to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; /** - * Gets the default type url for MethodDescriptorProto + * 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; } - /** 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 phpGenericServices */ - phpGenericServices?: (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); + namespace SourceCodeInfo { - /** FileOptions phpNamespace */ - phpNamespace?: (string|null); + /** Properties of a Location. */ + interface ILocation { - /** FileOptions phpMetadataNamespace */ - phpMetadataNamespace?: (string|null); + /** Location path */ + path?: (number[]|null); - /** FileOptions rubyPackage */ - rubyPackage?: (string|null); + /** Location span */ + span?: (number[]|null); - /** FileOptions uninterpretedOption */ - uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); + /** Location leadingComments */ + leadingComments?: (string|null); - /** FileOptions .google.api.resourceDefinition */ - ".google.api.resourceDefinition"?: (google.api.IResourceDescriptor[]|null); - } + /** Location trailingComments */ + trailingComments?: (string|null); - /** Represents a FileOptions. */ - class FileOptions implements IFileOptions { + /** Location leadingDetachedComments */ + leadingDetachedComments?: (string[]|null); + } - /** - * Constructs a new FileOptions. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.IFileOptions); + /** Represents a Location. */ + class Location implements ILocation { - /** FileOptions javaPackage. */ - public javaPackage: string; + /** + * Constructs a new Location. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.SourceCodeInfo.ILocation); - /** FileOptions javaOuterClassname. */ - public javaOuterClassname: string; + /** Location path. */ + public path: number[]; - /** FileOptions javaMultipleFiles. */ - public javaMultipleFiles: boolean; + /** Location span. */ + public span: number[]; - /** FileOptions javaGenerateEqualsAndHash. */ - public javaGenerateEqualsAndHash: boolean; + /** Location leadingComments. */ + public leadingComments: string; - /** FileOptions javaStringCheckUtf8. */ - public javaStringCheckUtf8: boolean; + /** Location trailingComments. */ + public trailingComments: string; - /** FileOptions optimizeFor. */ - public optimizeFor: (google.protobuf.FileOptions.OptimizeMode|keyof typeof google.protobuf.FileOptions.OptimizeMode); + /** Location leadingDetachedComments. */ + public leadingDetachedComments: string[]; - /** FileOptions goPackage. */ - public goPackage: 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; - /** FileOptions ccGenericServices. */ - public ccGenericServices: boolean; + /** + * 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; - /** FileOptions javaGenericServices. */ - public javaGenericServices: boolean; + /** + * 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; - /** FileOptions pyGenericServices. */ - public pyGenericServices: boolean; + /** + * 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; - /** FileOptions phpGenericServices. */ - public phpGenericServices: boolean; + /** + * 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; - /** FileOptions deprecated. */ - public deprecated: boolean; + /** + * 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); - /** FileOptions ccEnableArenas. */ - public ccEnableArenas: boolean; + /** + * 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; - /** FileOptions objcClassPrefix. */ - public objcClassPrefix: string; + /** + * 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 }; - /** FileOptions csharpNamespace. */ - public csharpNamespace: string; + /** + * Converts this Location to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; - /** FileOptions swiftPrefix. */ - public swiftPrefix: string; + /** + * 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; + } + } - /** FileOptions phpClassPrefix. */ - public phpClassPrefix: string; + /** Properties of a GeneratedCodeInfo. */ + interface IGeneratedCodeInfo { - /** FileOptions phpNamespace. */ - public phpNamespace: string; + /** GeneratedCodeInfo annotation */ + annotation?: (google.protobuf.GeneratedCodeInfo.IAnnotation[]|null); + } - /** FileOptions phpMetadataNamespace. */ - public phpMetadataNamespace: string; + /** Represents a GeneratedCodeInfo. */ + class GeneratedCodeInfo implements IGeneratedCodeInfo { - /** FileOptions rubyPackage. */ - public rubyPackage: string; + /** + * Constructs a new GeneratedCodeInfo. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IGeneratedCodeInfo); - /** FileOptions uninterpretedOption. */ - public uninterpretedOption: google.protobuf.IUninterpretedOption[]; + /** GeneratedCodeInfo annotation. */ + public annotation: google.protobuf.GeneratedCodeInfo.IAnnotation[]; /** - * Creates a new FileOptions instance using the specified properties. + * Creates a new GeneratedCodeInfo instance using the specified properties. * @param [properties] Properties to set - * @returns FileOptions instance + * @returns GeneratedCodeInfo instance */ - public static create(properties?: google.protobuf.IFileOptions): google.protobuf.FileOptions; + public static create(properties?: google.protobuf.IGeneratedCodeInfo): google.protobuf.GeneratedCodeInfo; /** - * Encodes the specified FileOptions message. Does not implicitly {@link google.protobuf.FileOptions.verify|verify} messages. - * @param message FileOptions message or plain object to encode + * 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.IFileOptions, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.protobuf.IGeneratedCodeInfo, 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 + * 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.IFileOptions, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.protobuf.IGeneratedCodeInfo, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a FileOptions message from the specified reader or buffer. + * 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 FileOptions + * @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.FileOptions; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.GeneratedCodeInfo; /** - * Decodes a FileOptions message from the specified reader or buffer, length delimited. + * Decodes a GeneratedCodeInfo message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns FileOptions + * @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.FileOptions; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.GeneratedCodeInfo; /** - * Verifies a FileOptions message. + * 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 FileOptions message from a plain object. Also converts values to their respective internal types. + * Creates a GeneratedCodeInfo message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns FileOptions + * @returns GeneratedCodeInfo */ - public static fromObject(object: { [k: string]: any }): google.protobuf.FileOptions; + public static fromObject(object: { [k: string]: any }): google.protobuf.GeneratedCodeInfo; /** - * Creates a plain object from a FileOptions message. Also converts values to other types if specified. - * @param message FileOptions + * 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.FileOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; + 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; - /** - * Converts this FileOptions to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; + /** + * 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; - /** - * 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; - } + /** + * 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; - namespace FileOptions { + /** + * 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); - /** OptimizeMode enum. */ - enum OptimizeMode { - SPEED = 1, - CODE_SIZE = 2, - LITE_RUNTIME = 3 - } - } + /** + * 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; - /** Properties of a MessageOptions. */ - interface IMessageOptions { + /** + * 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 }; - /** MessageOptions messageSetWireFormat */ - messageSetWireFormat?: (boolean|null); + /** + * Converts this Annotation to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; - /** MessageOptions noStandardDescriptorAccessor */ - noStandardDescriptorAccessor?: (boolean|null); + /** + * 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; + } - /** MessageOptions deprecated */ - deprecated?: (boolean|null); + namespace Annotation { - /** MessageOptions mapEntry */ - mapEntry?: (boolean|null); + /** Semantic enum. */ + enum Semantic { + NONE = 0, + SET = 1, + ALIAS = 2 + } + } + } - /** MessageOptions deprecatedLegacyJsonFieldConflicts */ - deprecatedLegacyJsonFieldConflicts?: (boolean|null); + /** Properties of a Duration. */ + interface IDuration { - /** MessageOptions uninterpretedOption */ - uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); + /** Duration seconds */ + seconds?: (number|Long|string|null); - /** MessageOptions .google.api.resource */ - ".google.api.resource"?: (google.api.IResourceDescriptor|null); + /** Duration nanos */ + nanos?: (number|null); } - /** Represents a MessageOptions. */ - class MessageOptions implements IMessageOptions { + /** Represents a Duration. */ + class Duration implements IDuration { /** - * Constructs a new MessageOptions. + * Constructs a new Duration. * @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; + constructor(properties?: google.protobuf.IDuration); - /** MessageOptions deprecatedLegacyJsonFieldConflicts. */ - public deprecatedLegacyJsonFieldConflicts: boolean; + /** Duration seconds. */ + public seconds: (number|Long|string); - /** MessageOptions uninterpretedOption. */ - public uninterpretedOption: google.protobuf.IUninterpretedOption[]; + /** Duration nanos. */ + public nanos: number; /** - * Creates a new MessageOptions instance using the specified properties. + * Creates a new Duration instance using the specified properties. * @param [properties] Properties to set - * @returns MessageOptions instance + * @returns Duration instance */ - public static create(properties?: google.protobuf.IMessageOptions): google.protobuf.MessageOptions; + public static create(properties?: google.protobuf.IDuration): google.protobuf.Duration; /** - * Encodes the specified MessageOptions message. Does not implicitly {@link google.protobuf.MessageOptions.verify|verify} messages. - * @param message MessageOptions message or plain object to encode + * 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.IMessageOptions, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.protobuf.IDuration, 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 + * 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.IMessageOptions, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.protobuf.IDuration, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a MessageOptions message from the specified reader or buffer. + * 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 MessageOptions + * @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.MessageOptions; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.Duration; /** - * Decodes a MessageOptions message from the specified reader or buffer, length delimited. + * Decodes a Duration message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns MessageOptions + * @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.MessageOptions; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.Duration; /** - * Verifies a MessageOptions message. + * 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 MessageOptions message from a plain object. Also converts values to their respective internal types. + * Creates a Duration message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns MessageOptions + * @returns Duration */ - public static fromObject(object: { [k: string]: any }): google.protobuf.MessageOptions; + public static fromObject(object: { [k: string]: any }): google.protobuf.Duration; /** - * Creates a plain object from a MessageOptions message. Also converts values to other types if specified. - * @param message MessageOptions + * 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.MessageOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.protobuf.Duration, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this MessageOptions to JSON. + * Converts this Duration to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; /** - * Gets the default type url for MessageOptions + * 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 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 target */ - target?: (google.protobuf.FieldOptions.OptionTargetType|keyof typeof google.protobuf.FieldOptions.OptionTargetType|null); - - /** FieldOptions uninterpretedOption */ - uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); + /** Properties of a Timestamp. */ + interface ITimestamp { - /** FieldOptions .google.api.fieldBehavior */ - ".google.api.fieldBehavior"?: (google.api.FieldBehavior[]|null); + /** Timestamp seconds */ + seconds?: (number|Long|string|null); - /** FieldOptions .google.api.resourceReference */ - ".google.api.resourceReference"?: (google.api.IResourceReference|null); + /** Timestamp nanos */ + nanos?: (number|null); } - /** Represents a FieldOptions. */ - class FieldOptions implements IFieldOptions { + /** Represents a Timestamp. */ + class Timestamp implements ITimestamp { /** - * Constructs a new FieldOptions. + * Constructs a new Timestamp. * @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; + constructor(properties?: google.protobuf.ITimestamp); - /** FieldOptions retention. */ - public retention: (google.protobuf.FieldOptions.OptionRetention|keyof typeof google.protobuf.FieldOptions.OptionRetention); - - /** FieldOptions target. */ - public target: (google.protobuf.FieldOptions.OptionTargetType|keyof typeof google.protobuf.FieldOptions.OptionTargetType); + /** Timestamp seconds. */ + public seconds: (number|Long|string); - /** FieldOptions uninterpretedOption. */ - public uninterpretedOption: google.protobuf.IUninterpretedOption[]; + /** Timestamp nanos. */ + public nanos: number; /** - * Creates a new FieldOptions instance using the specified properties. + * Creates a new Timestamp instance using the specified properties. * @param [properties] Properties to set - * @returns FieldOptions instance + * @returns Timestamp instance */ - public static create(properties?: google.protobuf.IFieldOptions): google.protobuf.FieldOptions; + public static create(properties?: google.protobuf.ITimestamp): google.protobuf.Timestamp; /** - * Encodes the specified FieldOptions message. Does not implicitly {@link google.protobuf.FieldOptions.verify|verify} messages. - * @param message FieldOptions message or plain object to encode + * 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.IFieldOptions, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.protobuf.ITimestamp, 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 + * 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.IFieldOptions, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.protobuf.ITimestamp, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a FieldOptions message from the specified reader or buffer. + * 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 FieldOptions + * @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.FieldOptions; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.Timestamp; /** - * Decodes a FieldOptions message from the specified reader or buffer, length delimited. + * Decodes a Timestamp message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns FieldOptions + * @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.FieldOptions; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.Timestamp; /** - * Verifies a FieldOptions message. + * 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 FieldOptions message from a plain object. Also converts values to their respective internal types. + * Creates a Timestamp message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns FieldOptions + * @returns Timestamp */ - public static fromObject(object: { [k: string]: any }): google.protobuf.FieldOptions; + public static fromObject(object: { [k: string]: any }): google.protobuf.Timestamp; /** - * Creates a plain object from a FieldOptions message. Also converts values to other types if specified. - * @param message FieldOptions + * 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.FieldOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.protobuf.Timestamp, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this FieldOptions to JSON. + * Converts this Timestamp to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; /** - * Gets the default type url for FieldOptions + * 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 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 Any. */ + interface IAny { - /** Properties of an OneofOptions. */ - interface IOneofOptions { + /** Any type_url */ + type_url?: (string|null); - /** OneofOptions uninterpretedOption */ - uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); + /** Any value */ + value?: (Uint8Array|string|null); } - /** Represents an OneofOptions. */ - class OneofOptions implements IOneofOptions { + /** Represents an Any. */ + class Any implements IAny { /** - * Constructs a new OneofOptions. + * Constructs a new Any. * @param [properties] Properties to set */ - constructor(properties?: google.protobuf.IOneofOptions); + constructor(properties?: google.protobuf.IAny); - /** OneofOptions uninterpretedOption. */ - public uninterpretedOption: google.protobuf.IUninterpretedOption[]; + /** Any type_url. */ + public type_url: string; + + /** Any value. */ + public value: (Uint8Array|string); /** - * Creates a new OneofOptions instance using the specified properties. + * Creates a new Any instance using the specified properties. * @param [properties] Properties to set - * @returns OneofOptions instance + * @returns Any instance */ - public static create(properties?: google.protobuf.IOneofOptions): google.protobuf.OneofOptions; + public static create(properties?: google.protobuf.IAny): google.protobuf.Any; /** - * Encodes the specified OneofOptions message. Does not implicitly {@link google.protobuf.OneofOptions.verify|verify} messages. - * @param message OneofOptions message or plain object to encode + * 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.IOneofOptions, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.protobuf.IAny, 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 + * 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.IOneofOptions, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.protobuf.IAny, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes an OneofOptions message from the specified reader or buffer. + * 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 OneofOptions + * @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.OneofOptions; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.Any; /** - * Decodes an OneofOptions message from the specified reader or buffer, length delimited. + * Decodes an Any message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns OneofOptions + * @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.OneofOptions; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.Any; /** - * Verifies an OneofOptions message. + * 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 OneofOptions message from a plain object. Also converts values to their respective internal types. + * Creates an Any message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns OneofOptions + * @returns Any */ - public static fromObject(object: { [k: string]: any }): google.protobuf.OneofOptions; + public static fromObject(object: { [k: string]: any }): google.protobuf.Any; /** - * Creates a plain object from an OneofOptions message. Also converts values to other types if specified. - * @param message OneofOptions + * 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.OneofOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.protobuf.Any, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this OneofOptions to JSON. + * Converts this Any to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; /** - * Gets the default type url for OneofOptions + * 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 EnumOptions. */ - interface IEnumOptions { - - /** EnumOptions allowAlias */ - allowAlias?: (boolean|null); - - /** EnumOptions deprecated */ - deprecated?: (boolean|null); - - /** EnumOptions deprecatedLegacyJsonFieldConflicts */ - deprecatedLegacyJsonFieldConflicts?: (boolean|null); - - /** EnumOptions uninterpretedOption */ - uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); + /** Properties of an Empty. */ + interface IEmpty { } - /** Represents an EnumOptions. */ - class EnumOptions implements IEnumOptions { + /** Represents an Empty. */ + class Empty implements IEmpty { /** - * Constructs a new EnumOptions. + * Constructs a new Empty. * @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 uninterpretedOption. */ - public uninterpretedOption: google.protobuf.IUninterpretedOption[]; + constructor(properties?: google.protobuf.IEmpty); /** - * Creates a new EnumOptions instance using the specified properties. + * Creates a new Empty instance using the specified properties. * @param [properties] Properties to set - * @returns EnumOptions instance + * @returns Empty instance */ - public static create(properties?: google.protobuf.IEnumOptions): google.protobuf.EnumOptions; + public static create(properties?: google.protobuf.IEmpty): google.protobuf.Empty; /** - * Encodes the specified EnumOptions message. Does not implicitly {@link google.protobuf.EnumOptions.verify|verify} messages. - * @param message EnumOptions message or plain object to encode + * 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.IEnumOptions, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.protobuf.IEmpty, 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 + * 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.IEnumOptions, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.protobuf.IEmpty, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes an EnumOptions message from the specified reader or buffer. + * 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 EnumOptions + * @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.EnumOptions; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.Empty; /** - * Decodes an EnumOptions message from the specified reader or buffer, length delimited. + * Decodes an Empty message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns EnumOptions + * @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.EnumOptions; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.Empty; /** - * Verifies an EnumOptions message. + * 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 EnumOptions message from a plain object. Also converts values to their respective internal types. + * Creates an Empty message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns EnumOptions + * @returns Empty */ - public static fromObject(object: { [k: string]: any }): google.protobuf.EnumOptions; + public static fromObject(object: { [k: string]: any }): google.protobuf.Empty; /** - * Creates a plain object from an EnumOptions message. Also converts values to other types if specified. - * @param message EnumOptions + * 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.EnumOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.protobuf.Empty, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this EnumOptions to JSON. + * Converts this Empty to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; /** - * Gets the default type url for EnumOptions + * 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 an EnumValueOptions. */ - interface IEnumValueOptions { - - /** EnumValueOptions deprecated */ - deprecated?: (boolean|null); + /** Properties of a FieldMask. */ + interface IFieldMask { - /** EnumValueOptions uninterpretedOption */ - uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); + /** FieldMask paths */ + paths?: (string[]|null); } - /** Represents an EnumValueOptions. */ - class EnumValueOptions implements IEnumValueOptions { + /** Represents a FieldMask. */ + class FieldMask implements IFieldMask { /** - * Constructs a new EnumValueOptions. + * Constructs a new FieldMask. * @param [properties] Properties to set */ - constructor(properties?: google.protobuf.IEnumValueOptions); - - /** EnumValueOptions deprecated. */ - public deprecated: boolean; + constructor(properties?: google.protobuf.IFieldMask); - /** EnumValueOptions uninterpretedOption. */ - public uninterpretedOption: google.protobuf.IUninterpretedOption[]; + /** FieldMask paths. */ + public paths: string[]; /** - * Creates a new EnumValueOptions instance using the specified properties. + * Creates a new FieldMask instance using the specified properties. * @param [properties] Properties to set - * @returns EnumValueOptions instance + * @returns FieldMask instance */ - public static create(properties?: google.protobuf.IEnumValueOptions): google.protobuf.EnumValueOptions; + public static create(properties?: google.protobuf.IFieldMask): google.protobuf.FieldMask; /** - * Encodes the specified EnumValueOptions message. Does not implicitly {@link google.protobuf.EnumValueOptions.verify|verify} messages. - * @param message EnumValueOptions message or plain object to encode + * 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.IEnumValueOptions, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.protobuf.IFieldMask, 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 + * 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.IEnumValueOptions, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.protobuf.IFieldMask, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes an EnumValueOptions message from the specified reader or buffer. + * 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 EnumValueOptions + * @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.EnumValueOptions; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.FieldMask; /** - * Decodes an EnumValueOptions message from the specified reader or buffer, length delimited. + * Decodes a FieldMask message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns EnumValueOptions + * @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.EnumValueOptions; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.FieldMask; /** - * Verifies an EnumValueOptions message. + * 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 an EnumValueOptions message from a plain object. Also converts values to their respective internal types. + * Creates a FieldMask message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns EnumValueOptions + * @returns FieldMask */ - public static fromObject(object: { [k: string]: any }): google.protobuf.EnumValueOptions; + public static fromObject(object: { [k: string]: any }): google.protobuf.FieldMask; /** - * Creates a plain object from an EnumValueOptions message. Also converts values to other types if specified. - * @param message EnumValueOptions + * 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.EnumValueOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.protobuf.FieldMask, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this EnumValueOptions to JSON. + * Converts this FieldMask to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; /** - * Gets the default type url for EnumValueOptions + * 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 ServiceOptions. */ - interface IServiceOptions { - - /** ServiceOptions deprecated */ - deprecated?: (boolean|null); + /** Namespace longrunning. */ + namespace longrunning { - /** ServiceOptions uninterpretedOption */ - uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); + /** Represents an Operations */ + class Operations extends $protobuf.rpc.Service { - /** ServiceOptions .google.api.defaultHost */ - ".google.api.defaultHost"?: (string|null); + /** + * 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); - /** ServiceOptions .google.api.oauthScopes */ - ".google.api.oauthScopes"?: (string|null); - } + /** + * 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; - /** Represents a ServiceOptions. */ - class ServiceOptions implements IServiceOptions { + /** + * 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; /** - * Constructs a new ServiceOptions. - * @param [properties] Properties to set + * Calls ListOperations. + * @param request ListOperationsRequest message or plain object + * @returns Promise */ - constructor(properties?: google.protobuf.IServiceOptions); + public listOperations(request: google.longrunning.IListOperationsRequest): Promise; - /** ServiceOptions deprecated. */ - public deprecated: boolean; + /** + * 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; - /** ServiceOptions uninterpretedOption. */ - public uninterpretedOption: google.protobuf.IUninterpretedOption[]; + /** + * Calls GetOperation. + * @param request GetOperationRequest message or plain object + * @returns Promise + */ + public getOperation(request: google.longrunning.IGetOperationRequest): Promise; /** - * Creates a new ServiceOptions instance using the specified properties. - * @param [properties] Properties to set - * @returns ServiceOptions instance + * Calls DeleteOperation. + * @param request DeleteOperationRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Empty */ - public static create(properties?: google.protobuf.IServiceOptions): google.protobuf.ServiceOptions; + public deleteOperation(request: google.longrunning.IDeleteOperationRequest, callback: google.longrunning.Operations.DeleteOperationCallback): void; /** - * 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 + * Calls DeleteOperation. + * @param request DeleteOperationRequest message or plain object + * @returns Promise */ - public static encode(message: google.protobuf.IServiceOptions, writer?: $protobuf.Writer): $protobuf.Writer; + public deleteOperation(request: google.longrunning.IDeleteOperationRequest): Promise; /** - * 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 + * Calls CancelOperation. + * @param request CancelOperationRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Empty */ - public static encodeDelimited(message: google.protobuf.IServiceOptions, writer?: $protobuf.Writer): $protobuf.Writer; + public cancelOperation(request: google.longrunning.ICancelOperationRequest, callback: google.longrunning.Operations.CancelOperationCallback): void; /** - * 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 + * Calls CancelOperation. + * @param request CancelOperationRequest message or plain object + * @returns Promise */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.ServiceOptions; + public cancelOperation(request: google.longrunning.ICancelOperationRequest): Promise; /** - * 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 + * Calls WaitOperation. + * @param request WaitOperationRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.ServiceOptions; + public waitOperation(request: google.longrunning.IWaitOperationRequest, callback: google.longrunning.Operations.WaitOperationCallback): void; /** - * Verifies a ServiceOptions message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not + * Calls WaitOperation. + * @param request WaitOperationRequest message or plain object + * @returns Promise */ - public static verify(message: { [k: string]: any }): (string|null); + public waitOperation(request: google.longrunning.IWaitOperationRequest): Promise; + } + + namespace Operations { /** - * Creates a ServiceOptions message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ServiceOptions + * 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 */ - public static fromObject(object: { [k: string]: any }): google.protobuf.ServiceOptions; + type GetOperationCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; /** - * 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 + * Callback as used by {@link google.longrunning.Operations|deleteOperation}. + * @param error Error, if any + * @param [response] Empty */ - public static toObject(message: google.protobuf.ServiceOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; + type DeleteOperationCallback = (error: (Error|null), response?: google.protobuf.Empty) => void; /** - * Converts this ServiceOptions to JSON. - * @returns JSON object + * Callback as used by {@link google.longrunning.Operations|cancelOperation}. + * @param error Error, if any + * @param [response] Empty */ - public toJSON(): { [k: string]: any }; + type CancelOperationCallback = (error: (Error|null), response?: google.protobuf.Empty) => void; /** - * Gets the default type url for ServiceOptions - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url + * Callback as used by {@link google.longrunning.Operations|waitOperation}. + * @param error Error, if any + * @param [response] Operation */ - public static getTypeUrl(typeUrlPrefix?: string): string; + type WaitOperationCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; } - /** Properties of a MethodOptions. */ - interface IMethodOptions { + /** Properties of an Operation. */ + interface IOperation { - /** MethodOptions deprecated */ - deprecated?: (boolean|null); + /** Operation name */ + name?: (string|null); - /** MethodOptions idempotencyLevel */ - idempotencyLevel?: (google.protobuf.MethodOptions.IdempotencyLevel|keyof typeof google.protobuf.MethodOptions.IdempotencyLevel|null); + /** Operation metadata */ + metadata?: (google.protobuf.IAny|null); - /** MethodOptions uninterpretedOption */ - uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); + /** Operation done */ + done?: (boolean|null); - /** MethodOptions .google.api.http */ - ".google.api.http"?: (google.api.IHttpRule|null); + /** Operation error */ + error?: (google.rpc.IStatus|null); - /** MethodOptions .google.api.methodSignature */ - ".google.api.methodSignature"?: (string[]|null); + /** Operation response */ + response?: (google.protobuf.IAny|null); } - /** Represents a MethodOptions. */ - class MethodOptions implements IMethodOptions { + /** Represents an Operation. */ + class Operation implements IOperation { /** - * Constructs a new MethodOptions. + * Constructs a new Operation. * @param [properties] Properties to set */ - constructor(properties?: google.protobuf.IMethodOptions); + constructor(properties?: google.longrunning.IOperation); - /** MethodOptions deprecated. */ - public deprecated: boolean; + /** Operation name. */ + public name: string; - /** MethodOptions idempotencyLevel. */ - public idempotencyLevel: (google.protobuf.MethodOptions.IdempotencyLevel|keyof typeof google.protobuf.MethodOptions.IdempotencyLevel); + /** Operation metadata. */ + public metadata?: (google.protobuf.IAny|null); - /** MethodOptions uninterpretedOption. */ - public uninterpretedOption: google.protobuf.IUninterpretedOption[]; + /** 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 MethodOptions instance using the specified properties. + * Creates a new Operation instance using the specified properties. * @param [properties] Properties to set - * @returns MethodOptions instance + * @returns Operation instance */ - public static create(properties?: google.protobuf.IMethodOptions): google.protobuf.MethodOptions; + public static create(properties?: google.longrunning.IOperation): google.longrunning.Operation; /** - * Encodes the specified MethodOptions message. Does not implicitly {@link google.protobuf.MethodOptions.verify|verify} messages. - * @param message MethodOptions message or plain object to encode + * 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.protobuf.IMethodOptions, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.longrunning.IOperation, 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 + * 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.protobuf.IMethodOptions, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.longrunning.IOperation, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a MethodOptions message from the specified reader or buffer. + * 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 MethodOptions + * @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.protobuf.MethodOptions; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.longrunning.Operation; /** - * Decodes a MethodOptions message from the specified reader or buffer, length delimited. + * Decodes an Operation message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns MethodOptions + * @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.protobuf.MethodOptions; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.longrunning.Operation; /** - * Verifies a MethodOptions message. + * 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 a MethodOptions message from a plain object. Also converts values to their respective internal types. + * Creates an Operation message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns MethodOptions + * @returns Operation */ - public static fromObject(object: { [k: string]: any }): google.protobuf.MethodOptions; + public static fromObject(object: { [k: string]: any }): google.longrunning.Operation; /** - * Creates a plain object from a MethodOptions message. Also converts values to other types if specified. - * @param message MethodOptions + * 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.protobuf.MethodOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.longrunning.Operation, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this MethodOptions to JSON. + * Converts this Operation to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; /** - * Gets the default type url for MethodOptions + * 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; } - 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|string|null); + /** Properties of a GetOperationRequest. */ + interface IGetOperationRequest { - /** UninterpretedOption aggregateValue */ - aggregateValue?: (string|null); + /** GetOperationRequest name */ + name?: (string|null); } - /** Represents an UninterpretedOption. */ - class UninterpretedOption implements IUninterpretedOption { + /** Represents a GetOperationRequest. */ + class GetOperationRequest implements IGetOperationRequest { /** - * Constructs a new UninterpretedOption. + * Constructs a new GetOperationRequest. * @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); + constructor(properties?: google.longrunning.IGetOperationRequest); - /** UninterpretedOption negativeIntValue. */ - public negativeIntValue: (number|Long|string); - - /** UninterpretedOption doubleValue. */ - public doubleValue: number; - - /** UninterpretedOption stringValue. */ - public stringValue: (Uint8Array|string); - - /** UninterpretedOption aggregateValue. */ - public aggregateValue: string; + /** GetOperationRequest name. */ + public name: string; /** - * Creates a new UninterpretedOption instance using the specified properties. + * Creates a new GetOperationRequest instance using the specified properties. * @param [properties] Properties to set - * @returns UninterpretedOption instance + * @returns GetOperationRequest instance */ - public static create(properties?: google.protobuf.IUninterpretedOption): google.protobuf.UninterpretedOption; + public static create(properties?: google.longrunning.IGetOperationRequest): google.longrunning.GetOperationRequest; /** - * Encodes the specified UninterpretedOption message. Does not implicitly {@link google.protobuf.UninterpretedOption.verify|verify} messages. - * @param message UninterpretedOption message or plain object to encode + * 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.protobuf.IUninterpretedOption, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.longrunning.IGetOperationRequest, 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 + * 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.protobuf.IUninterpretedOption, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.longrunning.IGetOperationRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes an UninterpretedOption message from the specified reader or buffer. + * 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 UninterpretedOption + * @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.protobuf.UninterpretedOption; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.longrunning.GetOperationRequest; /** - * Decodes an UninterpretedOption message from the specified reader or buffer, length delimited. + * Decodes a GetOperationRequest message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns UninterpretedOption + * @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.protobuf.UninterpretedOption; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.longrunning.GetOperationRequest; /** - * Verifies an UninterpretedOption message. + * 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 an UninterpretedOption message from a plain object. Also converts values to their respective internal types. + * Creates a GetOperationRequest message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns UninterpretedOption + * @returns GetOperationRequest */ - public static fromObject(object: { [k: string]: any }): google.protobuf.UninterpretedOption; + public static fromObject(object: { [k: string]: any }): google.longrunning.GetOperationRequest; /** - * Creates a plain object from an UninterpretedOption message. Also converts values to other types if specified. - * @param message UninterpretedOption + * 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.protobuf.UninterpretedOption, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.longrunning.GetOperationRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this UninterpretedOption to JSON. + * Converts this GetOperationRequest to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; /** - * Gets the default type url for UninterpretedOption + * 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; } - namespace UninterpretedOption { + /** Properties of a ListOperationsRequest. */ + interface IListOperationsRequest { - /** Properties of a NamePart. */ - interface INamePart { + /** ListOperationsRequest name */ + name?: (string|null); - /** NamePart namePart */ - namePart: string; + /** ListOperationsRequest filter */ + filter?: (string|null); - /** NamePart isExtension */ - isExtension: boolean; - } + /** ListOperationsRequest pageSize */ + pageSize?: (number|null); - /** Represents a NamePart. */ - class NamePart implements INamePart { + /** ListOperationsRequest pageToken */ + pageToken?: (string|null); + } - /** - * Constructs a new NamePart. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.UninterpretedOption.INamePart); + /** Represents a ListOperationsRequest. */ + class ListOperationsRequest implements IListOperationsRequest { - /** NamePart namePart. */ - public namePart: string; + /** + * Constructs a new ListOperationsRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.longrunning.IListOperationsRequest); - /** NamePart isExtension. */ - public isExtension: boolean; + /** ListOperationsRequest name. */ + public name: string; - /** - * 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; + /** ListOperationsRequest filter. */ + public filter: string; - /** - * 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; + /** ListOperationsRequest pageSize. */ + public pageSize: number; - /** - * 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; + /** ListOperationsRequest pageToken. */ + public pageToken: string; - /** - * 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; + /** + * 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; - /** - * 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; + /** + * 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; - /** - * 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); + /** + * 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; - /** - * 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; + /** + * 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; - /** - * 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 }; + /** + * 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); - /** - * Converts this NamePart to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; + /** + * 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; - /** - * 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; - } + /** + * 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 SourceCodeInfo. */ - interface ISourceCodeInfo { + /** Properties of a ListOperationsResponse. */ + interface IListOperationsResponse { - /** SourceCodeInfo location */ - location?: (google.protobuf.SourceCodeInfo.ILocation[]|null); + /** ListOperationsResponse operations */ + operations?: (google.longrunning.IOperation[]|null); + + /** ListOperationsResponse nextPageToken */ + nextPageToken?: (string|null); } - /** Represents a SourceCodeInfo. */ - class SourceCodeInfo implements ISourceCodeInfo { + /** Represents a ListOperationsResponse. */ + class ListOperationsResponse implements IListOperationsResponse { /** - * Constructs a new SourceCodeInfo. + * Constructs a new ListOperationsResponse. * @param [properties] Properties to set */ - constructor(properties?: google.protobuf.ISourceCodeInfo); + constructor(properties?: google.longrunning.IListOperationsResponse); - /** SourceCodeInfo location. */ - public location: google.protobuf.SourceCodeInfo.ILocation[]; + /** ListOperationsResponse operations. */ + public operations: google.longrunning.IOperation[]; + + /** ListOperationsResponse nextPageToken. */ + public nextPageToken: string; /** - * Creates a new SourceCodeInfo instance using the specified properties. + * Creates a new ListOperationsResponse instance using the specified properties. * @param [properties] Properties to set - * @returns SourceCodeInfo instance + * @returns ListOperationsResponse instance */ - public static create(properties?: google.protobuf.ISourceCodeInfo): google.protobuf.SourceCodeInfo; + public static create(properties?: google.longrunning.IListOperationsResponse): google.longrunning.ListOperationsResponse; /** - * Encodes the specified SourceCodeInfo message. Does not implicitly {@link google.protobuf.SourceCodeInfo.verify|verify} messages. - * @param message SourceCodeInfo message or plain object to encode + * 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.protobuf.ISourceCodeInfo, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.longrunning.IListOperationsResponse, 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 + * 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.protobuf.ISourceCodeInfo, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.longrunning.IListOperationsResponse, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a SourceCodeInfo message from the specified reader or buffer. + * 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 SourceCodeInfo + * @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.protobuf.SourceCodeInfo; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.longrunning.ListOperationsResponse; /** - * Decodes a SourceCodeInfo message from the specified reader or buffer, length delimited. + * Decodes a ListOperationsResponse message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns SourceCodeInfo + * @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.protobuf.SourceCodeInfo; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.longrunning.ListOperationsResponse; /** - * Verifies a SourceCodeInfo message. + * 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 SourceCodeInfo message from a plain object. Also converts values to their respective internal types. + * Creates a ListOperationsResponse message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns SourceCodeInfo + * @returns ListOperationsResponse */ - public static fromObject(object: { [k: string]: any }): google.protobuf.SourceCodeInfo; + public static fromObject(object: { [k: string]: any }): google.longrunning.ListOperationsResponse; /** - * Creates a plain object from a SourceCodeInfo message. Also converts values to other types if specified. - * @param message SourceCodeInfo + * 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.protobuf.SourceCodeInfo, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.longrunning.ListOperationsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this SourceCodeInfo to JSON. + * Converts this ListOperationsResponse to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; /** - * Gets the default type url for SourceCodeInfo + * 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; } - namespace SourceCodeInfo { + /** Properties of a CancelOperationRequest. */ + interface ICancelOperationRequest { - /** Properties of a Location. */ - interface ILocation { + /** CancelOperationRequest name */ + name?: (string|null); + } - /** Location path */ - path?: (number[]|null); + /** Represents a CancelOperationRequest. */ + class CancelOperationRequest implements ICancelOperationRequest { - /** Location span */ - span?: (number[]|null); + /** + * Constructs a new CancelOperationRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.longrunning.ICancelOperationRequest); - /** Location leadingComments */ - leadingComments?: (string|null); + /** CancelOperationRequest name. */ + public name: string; - /** Location trailingComments */ - trailingComments?: (string|null); + /** + * 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; - /** Location leadingDetachedComments */ - leadingDetachedComments?: (string[]|null); - } + /** + * 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; - /** Represents a Location. */ - class Location implements ILocation { + /** + * 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; - /** - * Constructs a new Location. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.SourceCodeInfo.ILocation); + /** + * 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; - /** Location path. */ - public path: number[]; + /** + * 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; - /** Location span. */ - public span: number[]; + /** + * 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); - /** Location leadingComments. */ - public leadingComments: string; + /** + * 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; - /** Location trailingComments. */ - public trailingComments: string; + /** + * 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 }; - /** Location leadingDetachedComments. */ - public leadingDetachedComments: string[]; + /** + * Converts this CancelOperationRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; - /** - * 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; + /** + * 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; + } - /** - * 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; + /** Properties of a DeleteOperationRequest. */ + interface IDeleteOperationRequest { - /** - * 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; + /** DeleteOperationRequest name */ + name?: (string|null); + } - /** - * 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; + /** Represents a DeleteOperationRequest. */ + class DeleteOperationRequest implements IDeleteOperationRequest { - /** - * 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; + /** + * Constructs a new DeleteOperationRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.longrunning.IDeleteOperationRequest); - /** - * 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); + /** DeleteOperationRequest name. */ + public name: string; - /** - * 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 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; - /** - * 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 }; + /** + * 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; - /** - * Converts this Location to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; + /** + * 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 Location - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } + /** + * 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 GeneratedCodeInfo. */ - interface IGeneratedCodeInfo { + /** Properties of a WaitOperationRequest. */ + interface IWaitOperationRequest { - /** GeneratedCodeInfo annotation */ - annotation?: (google.protobuf.GeneratedCodeInfo.IAnnotation[]|null); + /** WaitOperationRequest name */ + name?: (string|null); + + /** WaitOperationRequest timeout */ + timeout?: (google.protobuf.IDuration|null); } - /** Represents a GeneratedCodeInfo. */ - class GeneratedCodeInfo implements IGeneratedCodeInfo { + /** Represents a WaitOperationRequest. */ + class WaitOperationRequest implements IWaitOperationRequest { /** - * Constructs a new GeneratedCodeInfo. + * Constructs a new WaitOperationRequest. * @param [properties] Properties to set */ - constructor(properties?: google.protobuf.IGeneratedCodeInfo); + constructor(properties?: google.longrunning.IWaitOperationRequest); - /** GeneratedCodeInfo annotation. */ - public annotation: google.protobuf.GeneratedCodeInfo.IAnnotation[]; + /** WaitOperationRequest name. */ + public name: string; + + /** WaitOperationRequest timeout. */ + public timeout?: (google.protobuf.IDuration|null); /** - * Creates a new GeneratedCodeInfo instance using the specified properties. + * Creates a new WaitOperationRequest instance using the specified properties. * @param [properties] Properties to set - * @returns GeneratedCodeInfo instance + * @returns WaitOperationRequest instance */ - public static create(properties?: google.protobuf.IGeneratedCodeInfo): google.protobuf.GeneratedCodeInfo; + public static create(properties?: google.longrunning.IWaitOperationRequest): google.longrunning.WaitOperationRequest; /** - * Encodes the specified GeneratedCodeInfo message. Does not implicitly {@link google.protobuf.GeneratedCodeInfo.verify|verify} messages. - * @param message GeneratedCodeInfo message or plain object to encode + * 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.protobuf.IGeneratedCodeInfo, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.longrunning.IWaitOperationRequest, 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 + * 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.protobuf.IGeneratedCodeInfo, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.longrunning.IWaitOperationRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a GeneratedCodeInfo message from the specified reader or buffer. + * 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 GeneratedCodeInfo + * @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.protobuf.GeneratedCodeInfo; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.longrunning.WaitOperationRequest; /** - * Decodes a GeneratedCodeInfo message from the specified reader or buffer, length delimited. + * Decodes a WaitOperationRequest message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns GeneratedCodeInfo + * @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.protobuf.GeneratedCodeInfo; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.longrunning.WaitOperationRequest; /** - * Verifies a GeneratedCodeInfo message. + * 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 GeneratedCodeInfo message from a plain object. Also converts values to their respective internal types. + * Creates a WaitOperationRequest message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns GeneratedCodeInfo + * @returns WaitOperationRequest */ - public static fromObject(object: { [k: string]: any }): google.protobuf.GeneratedCodeInfo; + public static fromObject(object: { [k: string]: any }): google.longrunning.WaitOperationRequest; /** - * Creates a plain object from a GeneratedCodeInfo message. Also converts values to other types if specified. - * @param message GeneratedCodeInfo + * 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.protobuf.GeneratedCodeInfo, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.longrunning.WaitOperationRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this GeneratedCodeInfo to JSON. + * Converts this WaitOperationRequest to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; /** - * Gets the default type url for GeneratedCodeInfo + * 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; } - 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 { + /** Properties of an OperationInfo. */ + interface IOperationInfo { - /** - * Constructs a new Annotation. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.GeneratedCodeInfo.IAnnotation); + /** OperationInfo responseType */ + responseType?: (string|null); - /** Annotation path. */ - public path: number[]; + /** OperationInfo metadataType */ + metadataType?: (string|null); + } - /** Annotation sourceFile. */ - public sourceFile: string; + /** Represents an OperationInfo. */ + class OperationInfo implements IOperationInfo { - /** Annotation begin. */ - public begin: number; + /** + * Constructs a new OperationInfo. + * @param [properties] Properties to set + */ + constructor(properties?: google.longrunning.IOperationInfo); - /** Annotation end. */ - public end: number; + /** OperationInfo responseType. */ + public responseType: string; - /** Annotation semantic. */ - public semantic: (google.protobuf.GeneratedCodeInfo.Annotation.Semantic|keyof typeof google.protobuf.GeneratedCodeInfo.Annotation.Semantic); + /** OperationInfo metadataType. */ + public metadataType: string; - /** - * 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; + /** + * 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 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 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 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; + /** + * 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 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 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 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; + /** + * 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 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); + /** + * 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 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 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 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 }; + /** + * 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 Annotation to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; + /** + * Converts this OperationInfo 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; - } + /** + * 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 Annotation { + /** Namespace rpc. */ + namespace rpc { - /** Semantic enum. */ - enum Semantic { - NONE = 0, - SET = 1, - ALIAS = 2 - } - } - } + /** Properties of a Status. */ + interface IStatus { - /** Properties of a Duration. */ - interface IDuration { + /** Status code */ + code?: (number|null); - /** Duration seconds */ - seconds?: (number|Long|string|null); + /** Status message */ + message?: (string|null); - /** Duration nanos */ - nanos?: (number|null); + /** Status details */ + details?: (google.protobuf.IAny[]|null); } - /** Represents a Duration. */ - class Duration implements IDuration { + /** Represents a Status. */ + class Status implements IStatus { /** - * Constructs a new Duration. + * Constructs a new Status. * @param [properties] Properties to set */ - constructor(properties?: google.protobuf.IDuration); + constructor(properties?: google.rpc.IStatus); - /** Duration seconds. */ - public seconds: (number|Long|string); + /** Status code. */ + public code: number; - /** Duration nanos. */ - public nanos: number; + /** Status message. */ + public message: string; + + /** Status details. */ + public details: google.protobuf.IAny[]; /** - * Creates a new Duration instance using the specified properties. + * Creates a new Status instance using the specified properties. * @param [properties] Properties to set - * @returns Duration instance + * @returns Status instance */ - public static create(properties?: google.protobuf.IDuration): google.protobuf.Duration; + public static create(properties?: google.rpc.IStatus): google.rpc.Status; /** - * Encodes the specified Duration message. Does not implicitly {@link google.protobuf.Duration.verify|verify} messages. - * @param message Duration message or plain object to encode + * 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.protobuf.IDuration, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.rpc.IStatus, 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 + * 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.protobuf.IDuration, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.rpc.IStatus, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a Duration message from the specified reader or buffer. + * 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 Duration + * @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.protobuf.Duration; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.rpc.Status; /** - * Decodes a Duration message from the specified reader or buffer, length delimited. + * Decodes a Status message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns Duration + * @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.protobuf.Duration; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.rpc.Status; /** - * Verifies a Duration message. + * 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 Duration message from a plain object. Also converts values to their respective internal types. + * Creates a Status message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns Duration + * @returns Status */ - public static fromObject(object: { [k: string]: any }): google.protobuf.Duration; + public static fromObject(object: { [k: string]: any }): google.rpc.Status; /** - * Creates a plain object from a Duration message. Also converts values to other types if specified. - * @param message Duration + * 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.protobuf.Duration, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.rpc.Status, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this Duration to JSON. + * Converts this Status to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; /** - * Gets the default type url for Duration + * Gets the default type url for Status * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns The default type url */ diff --git a/packages/google-ai-generativelanguage/protos/protos.js b/packages/google-ai-generativelanguage/protos/protos.js index 544ad789126..79e01fe77a7 100644 --- a/packages/google-ai-generativelanguage/protos/protos.js +++ b/packages/google-ai-generativelanguage/protos/protos.js @@ -7243,6377 +7243,23321 @@ return v1beta2; })(); - return generativelanguage; - })(); + generativelanguage.v1beta3 = (function() { - return ai; - })(); + /** + * Namespace v1beta3. + * @memberof google.ai.generativelanguage + * @namespace + */ + var v1beta3 = {}; - google.api = (function() { + v1beta3.CitationMetadata = (function() { - /** - * Namespace api. - * @memberof google - * @namespace - */ - var api = {}; + /** + * Properties of a CitationMetadata. + * @memberof google.ai.generativelanguage.v1beta3 + * @interface ICitationMetadata + * @property {Array.|null} [citationSources] CitationMetadata citationSources + */ - /** - * 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 - */ - 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; - return values; - })(); + /** + * Constructs a new CitationMetadata. + * @memberof google.ai.generativelanguage.v1beta3 + * @classdesc Represents a CitationMetadata. + * @implements ICitationMetadata + * @constructor + * @param {google.ai.generativelanguage.v1beta3.ICitationMetadata=} [properties] Properties to set + */ + function CitationMetadata(properties) { + this.citationSources = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } - api.Http = (function() { + /** + * CitationMetadata citationSources. + * @member {Array.} citationSources + * @memberof google.ai.generativelanguage.v1beta3.CitationMetadata + * @instance + */ + CitationMetadata.prototype.citationSources = $util.emptyArray; - /** - * Properties of a Http. - * @memberof google.api - * @interface IHttp - * @property {Array.|null} [rules] Http rules - * @property {boolean|null} [fullyDecodeReservedExpansion] Http fullyDecodeReservedExpansion - */ + /** + * Creates a new CitationMetadata instance using the specified properties. + * @function create + * @memberof google.ai.generativelanguage.v1beta3.CitationMetadata + * @static + * @param {google.ai.generativelanguage.v1beta3.ICitationMetadata=} [properties] Properties to set + * @returns {google.ai.generativelanguage.v1beta3.CitationMetadata} CitationMetadata instance + */ + CitationMetadata.create = function create(properties) { + return new CitationMetadata(properties); + }; - /** - * 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]]; - } + /** + * Encodes the specified CitationMetadata message. Does not implicitly {@link google.ai.generativelanguage.v1beta3.CitationMetadata.verify|verify} messages. + * @function encode + * @memberof google.ai.generativelanguage.v1beta3.CitationMetadata + * @static + * @param {google.ai.generativelanguage.v1beta3.ICitationMetadata} message CitationMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CitationMetadata.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.citationSources != null && message.citationSources.length) + for (var i = 0; i < message.citationSources.length; ++i) + $root.google.ai.generativelanguage.v1beta3.CitationSource.encode(message.citationSources[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; - /** - * Http rules. - * @member {Array.} rules - * @memberof google.api.Http - * @instance - */ - Http.prototype.rules = $util.emptyArray; + /** + * Encodes the specified CitationMetadata message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1beta3.CitationMetadata.verify|verify} messages. + * @function encodeDelimited + * @memberof google.ai.generativelanguage.v1beta3.CitationMetadata + * @static + * @param {google.ai.generativelanguage.v1beta3.ICitationMetadata} message CitationMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CitationMetadata.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; - /** - * Http fullyDecodeReservedExpansion. - * @member {boolean} fullyDecodeReservedExpansion - * @memberof google.api.Http - * @instance - */ - Http.prototype.fullyDecodeReservedExpansion = false; + /** + * Decodes a CitationMetadata message from the specified reader or buffer. + * @function decode + * @memberof google.ai.generativelanguage.v1beta3.CitationMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.ai.generativelanguage.v1beta3.CitationMetadata} CitationMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CitationMetadata.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.ai.generativelanguage.v1beta3.CitationMetadata(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.citationSources && message.citationSources.length)) + message.citationSources = []; + message.citationSources.push($root.google.ai.generativelanguage.v1beta3.CitationSource.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; - /** - * 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); - }; + /** + * Decodes a CitationMetadata message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.ai.generativelanguage.v1beta3.CitationMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.ai.generativelanguage.v1beta3.CitationMetadata} CitationMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CitationMetadata.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; - /** - * 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; - }; + /** + * Verifies a CitationMetadata message. + * @function verify + * @memberof google.ai.generativelanguage.v1beta3.CitationMetadata + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CitationMetadata.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.citationSources != null && message.hasOwnProperty("citationSources")) { + if (!Array.isArray(message.citationSources)) + return "citationSources: array expected"; + for (var i = 0; i < message.citationSources.length; ++i) { + var error = $root.google.ai.generativelanguage.v1beta3.CitationSource.verify(message.citationSources[i]); + if (error) + return "citationSources." + error; + } + } + return null; + }; - /** - * 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(); - }; + /** + * Creates a CitationMetadata message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.ai.generativelanguage.v1beta3.CitationMetadata + * @static + * @param {Object.} object Plain object + * @returns {google.ai.generativelanguage.v1beta3.CitationMetadata} CitationMetadata + */ + CitationMetadata.fromObject = function fromObject(object) { + if (object instanceof $root.google.ai.generativelanguage.v1beta3.CitationMetadata) + return object; + var message = new $root.google.ai.generativelanguage.v1beta3.CitationMetadata(); + if (object.citationSources) { + if (!Array.isArray(object.citationSources)) + throw TypeError(".google.ai.generativelanguage.v1beta3.CitationMetadata.citationSources: array expected"); + message.citationSources = []; + for (var i = 0; i < object.citationSources.length; ++i) { + if (typeof object.citationSources[i] !== "object") + throw TypeError(".google.ai.generativelanguage.v1beta3.CitationMetadata.citationSources: object expected"); + message.citationSources[i] = $root.google.ai.generativelanguage.v1beta3.CitationSource.fromObject(object.citationSources[i]); + } + } + return message; + }; - /** - * 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) { - 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(); - 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; + /** + * Creates a plain object from a CitationMetadata message. Also converts values to other types if specified. + * @function toObject + * @memberof google.ai.generativelanguage.v1beta3.CitationMetadata + * @static + * @param {google.ai.generativelanguage.v1beta3.CitationMetadata} message CitationMetadata + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CitationMetadata.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.citationSources = []; + if (message.citationSources && message.citationSources.length) { + object.citationSources = []; + for (var j = 0; j < message.citationSources.length; ++j) + object.citationSources[j] = $root.google.ai.generativelanguage.v1beta3.CitationSource.toObject(message.citationSources[j], options); } - case 2: { - message.fullyDecodeReservedExpansion = reader.bool(); - break; + return object; + }; + + /** + * Converts this CitationMetadata to JSON. + * @function toJSON + * @memberof google.ai.generativelanguage.v1beta3.CitationMetadata + * @instance + * @returns {Object.} JSON object + */ + CitationMetadata.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CitationMetadata + * @function getTypeUrl + * @memberof google.ai.generativelanguage.v1beta3.CitationMetadata + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CitationMetadata.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; + return typeUrlPrefix + "/google.ai.generativelanguage.v1beta3.CitationMetadata"; + }; - /** - * 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()); - }; + return CitationMetadata; + })(); - /** - * 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; - }; + v1beta3.CitationSource = (function() { - /** - * 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]); + /** + * Properties of a CitationSource. + * @memberof google.ai.generativelanguage.v1beta3 + * @interface ICitationSource + * @property {number|null} [startIndex] CitationSource startIndex + * @property {number|null} [endIndex] CitationSource endIndex + * @property {string|null} [uri] CitationSource uri + * @property {string|null} [license] CitationSource license + */ + + /** + * Constructs a new CitationSource. + * @memberof google.ai.generativelanguage.v1beta3 + * @classdesc Represents a CitationSource. + * @implements ICitationSource + * @constructor + * @param {google.ai.generativelanguage.v1beta3.ICitationSource=} [properties] Properties to set + */ + function CitationSource(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[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; - }; + /** + * CitationSource startIndex. + * @member {number|null|undefined} startIndex + * @memberof google.ai.generativelanguage.v1beta3.CitationSource + * @instance + */ + CitationSource.prototype.startIndex = null; - /** - * 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); - }; + /** + * CitationSource endIndex. + * @member {number|null|undefined} endIndex + * @memberof google.ai.generativelanguage.v1beta3.CitationSource + * @instance + */ + CitationSource.prototype.endIndex = null; - /** - * 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"; - }; + /** + * CitationSource uri. + * @member {string|null|undefined} uri + * @memberof google.ai.generativelanguage.v1beta3.CitationSource + * @instance + */ + CitationSource.prototype.uri = null; - return Http; - })(); + /** + * CitationSource license. + * @member {string|null|undefined} license + * @memberof google.ai.generativelanguage.v1beta3.CitationSource + * @instance + */ + CitationSource.prototype.license = null; - api.HttpRule = (function() { + // OneOf field names bound to virtual getters and setters + var $oneOfFields; - /** - * 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 - */ + /** + * CitationSource _startIndex. + * @member {"startIndex"|undefined} _startIndex + * @memberof google.ai.generativelanguage.v1beta3.CitationSource + * @instance + */ + Object.defineProperty(CitationSource.prototype, "_startIndex", { + get: $util.oneOfGetter($oneOfFields = ["startIndex"]), + set: $util.oneOfSetter($oneOfFields) + }); - /** - * 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; + /** + * CitationSource _endIndex. + * @member {"endIndex"|undefined} _endIndex + * @memberof google.ai.generativelanguage.v1beta3.CitationSource + * @instance + */ + Object.defineProperty(CitationSource.prototype, "_endIndex", { + get: $util.oneOfGetter($oneOfFields = ["endIndex"]), + set: $util.oneOfSetter($oneOfFields) + }); - /** - * HttpRule put. - * @member {string|null|undefined} put - * @memberof google.api.HttpRule - * @instance - */ - HttpRule.prototype.put = null; + /** + * CitationSource _uri. + * @member {"uri"|undefined} _uri + * @memberof google.ai.generativelanguage.v1beta3.CitationSource + * @instance + */ + Object.defineProperty(CitationSource.prototype, "_uri", { + get: $util.oneOfGetter($oneOfFields = ["uri"]), + set: $util.oneOfSetter($oneOfFields) + }); - /** - * HttpRule post. - * @member {string|null|undefined} post - * @memberof google.api.HttpRule - * @instance - */ - HttpRule.prototype.post = null; + /** + * CitationSource _license. + * @member {"license"|undefined} _license + * @memberof google.ai.generativelanguage.v1beta3.CitationSource + * @instance + */ + Object.defineProperty(CitationSource.prototype, "_license", { + get: $util.oneOfGetter($oneOfFields = ["license"]), + set: $util.oneOfSetter($oneOfFields) + }); - /** - * HttpRule delete. - * @member {string|null|undefined} delete - * @memberof google.api.HttpRule - * @instance - */ - HttpRule.prototype["delete"] = null; + /** + * Creates a new CitationSource instance using the specified properties. + * @function create + * @memberof google.ai.generativelanguage.v1beta3.CitationSource + * @static + * @param {google.ai.generativelanguage.v1beta3.ICitationSource=} [properties] Properties to set + * @returns {google.ai.generativelanguage.v1beta3.CitationSource} CitationSource instance + */ + CitationSource.create = function create(properties) { + return new CitationSource(properties); + }; - /** - * HttpRule patch. - * @member {string|null|undefined} patch - * @memberof google.api.HttpRule - * @instance - */ - HttpRule.prototype.patch = null; + /** + * Encodes the specified CitationSource message. Does not implicitly {@link google.ai.generativelanguage.v1beta3.CitationSource.verify|verify} messages. + * @function encode + * @memberof google.ai.generativelanguage.v1beta3.CitationSource + * @static + * @param {google.ai.generativelanguage.v1beta3.ICitationSource} message CitationSource message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CitationSource.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.startIndex != null && Object.hasOwnProperty.call(message, "startIndex")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.startIndex); + if (message.endIndex != null && Object.hasOwnProperty.call(message, "endIndex")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.endIndex); + if (message.uri != null && Object.hasOwnProperty.call(message, "uri")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.uri); + if (message.license != null && Object.hasOwnProperty.call(message, "license")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.license); + return writer; + }; - /** - * HttpRule custom. - * @member {google.api.ICustomHttpPattern|null|undefined} custom - * @memberof google.api.HttpRule - * @instance - */ - HttpRule.prototype.custom = null; + /** + * Encodes the specified CitationSource message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1beta3.CitationSource.verify|verify} messages. + * @function encodeDelimited + * @memberof google.ai.generativelanguage.v1beta3.CitationSource + * @static + * @param {google.ai.generativelanguage.v1beta3.ICitationSource} message CitationSource message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CitationSource.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; - /** - * HttpRule body. - * @member {string} body - * @memberof google.api.HttpRule - * @instance - */ - HttpRule.prototype.body = ""; + /** + * Decodes a CitationSource message from the specified reader or buffer. + * @function decode + * @memberof google.ai.generativelanguage.v1beta3.CitationSource + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.ai.generativelanguage.v1beta3.CitationSource} CitationSource + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CitationSource.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.ai.generativelanguage.v1beta3.CitationSource(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.startIndex = reader.int32(); + break; + } + case 2: { + message.endIndex = reader.int32(); + break; + } + case 3: { + message.uri = reader.string(); + break; + } + case 4: { + message.license = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; - /** - * HttpRule responseBody. - * @member {string} responseBody - * @memberof google.api.HttpRule - * @instance - */ - HttpRule.prototype.responseBody = ""; + /** + * Decodes a CitationSource message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.ai.generativelanguage.v1beta3.CitationSource + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.ai.generativelanguage.v1beta3.CitationSource} CitationSource + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CitationSource.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; - /** - * HttpRule additionalBindings. - * @member {Array.} additionalBindings - * @memberof google.api.HttpRule - * @instance - */ - HttpRule.prototype.additionalBindings = $util.emptyArray; + /** + * Verifies a CitationSource message. + * @function verify + * @memberof google.ai.generativelanguage.v1beta3.CitationSource + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CitationSource.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.startIndex != null && message.hasOwnProperty("startIndex")) { + properties._startIndex = 1; + if (!$util.isInteger(message.startIndex)) + return "startIndex: integer expected"; + } + if (message.endIndex != null && message.hasOwnProperty("endIndex")) { + properties._endIndex = 1; + if (!$util.isInteger(message.endIndex)) + return "endIndex: integer expected"; + } + if (message.uri != null && message.hasOwnProperty("uri")) { + properties._uri = 1; + if (!$util.isString(message.uri)) + return "uri: string expected"; + } + if (message.license != null && message.hasOwnProperty("license")) { + properties._license = 1; + if (!$util.isString(message.license)) + return "license: string expected"; + } + return null; + }; - // OneOf field names bound to virtual getters and setters - var $oneOfFields; + /** + * Creates a CitationSource message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.ai.generativelanguage.v1beta3.CitationSource + * @static + * @param {Object.} object Plain object + * @returns {google.ai.generativelanguage.v1beta3.CitationSource} CitationSource + */ + CitationSource.fromObject = function fromObject(object) { + if (object instanceof $root.google.ai.generativelanguage.v1beta3.CitationSource) + return object; + var message = new $root.google.ai.generativelanguage.v1beta3.CitationSource(); + if (object.startIndex != null) + message.startIndex = object.startIndex | 0; + if (object.endIndex != null) + message.endIndex = object.endIndex | 0; + if (object.uri != null) + message.uri = String(object.uri); + if (object.license != null) + message.license = String(object.license); + return message; + }; - /** - * 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) { - 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(); - 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; + /** + * Creates a plain object from a CitationSource message. Also converts values to other types if specified. + * @function toObject + * @memberof google.ai.generativelanguage.v1beta3.CitationSource + * @static + * @param {google.ai.generativelanguage.v1beta3.CitationSource} message CitationSource + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CitationSource.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.startIndex != null && message.hasOwnProperty("startIndex")) { + object.startIndex = message.startIndex; + if (options.oneofs) + object._startIndex = "startIndex"; } - case 8: { - message.custom = $root.google.api.CustomHttpPattern.decode(reader, reader.uint32()); - break; + if (message.endIndex != null && message.hasOwnProperty("endIndex")) { + object.endIndex = message.endIndex; + if (options.oneofs) + object._endIndex = "endIndex"; } - case 7: { - message.body = reader.string(); - break; + if (message.uri != null && message.hasOwnProperty("uri")) { + object.uri = message.uri; + if (options.oneofs) + object._uri = "uri"; } - case 12: { - message.responseBody = reader.string(); - break; + if (message.license != null && message.hasOwnProperty("license")) { + object.license = message.license; + if (options.oneofs) + object._license = "license"; } - case 11: { - if (!(message.additionalBindings && message.additionalBindings.length)) - message.additionalBindings = []; - message.additionalBindings.push($root.google.api.HttpRule.decode(reader, reader.uint32())); - break; + return object; + }; + + /** + * Converts this CitationSource to JSON. + * @function toJSON + * @memberof google.ai.generativelanguage.v1beta3.CitationSource + * @instance + * @returns {Object.} JSON object + */ + CitationSource.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CitationSource + * @function getTypeUrl + * @memberof google.ai.generativelanguage.v1beta3.CitationSource + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CitationSource.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; } - default: - reader.skipType(tag & 7); - break; + return typeUrlPrefix + "/google.ai.generativelanguage.v1beta3.CitationSource"; + }; + + return CitationSource; + })(); + + v1beta3.DiscussService = (function() { + + /** + * Constructs a new DiscussService service. + * @memberof google.ai.generativelanguage.v1beta3 + * @classdesc Represents a DiscussService + * @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 DiscussService(rpcImpl, requestDelimited, responseDelimited) { + $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); } - } - 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()); - }; + (DiscussService.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = DiscussService; - /** - * 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 new DiscussService service using the specified rpc implementation. + * @function create + * @memberof google.ai.generativelanguage.v1beta3.DiscussService + * @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 {DiscussService} RPC service. Useful where requests and/or responses are streamed. + */ + DiscussService.create = function create(rpcImpl, requestDelimited, responseDelimited) { + return new this(rpcImpl, requestDelimited, responseDelimited); + }; - /** - * 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; - }; + /** + * Callback as used by {@link google.ai.generativelanguage.v1beta3.DiscussService|generateMessage}. + * @memberof google.ai.generativelanguage.v1beta3.DiscussService + * @typedef GenerateMessageCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.ai.generativelanguage.v1beta3.GenerateMessageResponse} [response] GenerateMessageResponse + */ - /** - * 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); - }; + /** + * Calls GenerateMessage. + * @function generateMessage + * @memberof google.ai.generativelanguage.v1beta3.DiscussService + * @instance + * @param {google.ai.generativelanguage.v1beta3.IGenerateMessageRequest} request GenerateMessageRequest message or plain object + * @param {google.ai.generativelanguage.v1beta3.DiscussService.GenerateMessageCallback} callback Node-style callback called with the error, if any, and GenerateMessageResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(DiscussService.prototype.generateMessage = function generateMessage(request, callback) { + return this.rpcCall(generateMessage, $root.google.ai.generativelanguage.v1beta3.GenerateMessageRequest, $root.google.ai.generativelanguage.v1beta3.GenerateMessageResponse, request, callback); + }, "name", { value: "GenerateMessage" }); - /** - * 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"; - }; + /** + * Calls GenerateMessage. + * @function generateMessage + * @memberof google.ai.generativelanguage.v1beta3.DiscussService + * @instance + * @param {google.ai.generativelanguage.v1beta3.IGenerateMessageRequest} request GenerateMessageRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ - return HttpRule; - })(); + /** + * Callback as used by {@link google.ai.generativelanguage.v1beta3.DiscussService|countMessageTokens}. + * @memberof google.ai.generativelanguage.v1beta3.DiscussService + * @typedef CountMessageTokensCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.ai.generativelanguage.v1beta3.CountMessageTokensResponse} [response] CountMessageTokensResponse + */ - api.CustomHttpPattern = (function() { + /** + * Calls CountMessageTokens. + * @function countMessageTokens + * @memberof google.ai.generativelanguage.v1beta3.DiscussService + * @instance + * @param {google.ai.generativelanguage.v1beta3.ICountMessageTokensRequest} request CountMessageTokensRequest message or plain object + * @param {google.ai.generativelanguage.v1beta3.DiscussService.CountMessageTokensCallback} callback Node-style callback called with the error, if any, and CountMessageTokensResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(DiscussService.prototype.countMessageTokens = function countMessageTokens(request, callback) { + return this.rpcCall(countMessageTokens, $root.google.ai.generativelanguage.v1beta3.CountMessageTokensRequest, $root.google.ai.generativelanguage.v1beta3.CountMessageTokensResponse, request, callback); + }, "name", { value: "CountMessageTokens" }); - /** - * Properties of a CustomHttpPattern. - * @memberof google.api - * @interface ICustomHttpPattern - * @property {string|null} [kind] CustomHttpPattern kind - * @property {string|null} [path] CustomHttpPattern path - */ + /** + * Calls CountMessageTokens. + * @function countMessageTokens + * @memberof google.ai.generativelanguage.v1beta3.DiscussService + * @instance + * @param {google.ai.generativelanguage.v1beta3.ICountMessageTokensRequest} request CountMessageTokensRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ - /** - * 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]]; - } + return DiscussService; + })(); - /** - * CustomHttpPattern kind. - * @member {string} kind - * @memberof google.api.CustomHttpPattern - * @instance - */ - CustomHttpPattern.prototype.kind = ""; + v1beta3.GenerateMessageRequest = (function() { - /** - * 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(); - }; + /** + * Properties of a GenerateMessageRequest. + * @memberof google.ai.generativelanguage.v1beta3 + * @interface IGenerateMessageRequest + * @property {string|null} [model] GenerateMessageRequest model + * @property {google.ai.generativelanguage.v1beta3.IMessagePrompt|null} [prompt] GenerateMessageRequest prompt + * @property {number|null} [temperature] GenerateMessageRequest temperature + * @property {number|null} [candidateCount] GenerateMessageRequest candidateCount + * @property {number|null} [topP] GenerateMessageRequest topP + * @property {number|null} [topK] GenerateMessageRequest topK + */ - /** - * 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) { - 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(); - switch (tag >>> 3) { - case 1: { - message.kind = reader.string(); - break; - } - case 2: { - message.path = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; + /** + * Constructs a new GenerateMessageRequest. + * @memberof google.ai.generativelanguage.v1beta3 + * @classdesc Represents a GenerateMessageRequest. + * @implements IGenerateMessageRequest + * @constructor + * @param {google.ai.generativelanguage.v1beta3.IGenerateMessageRequest=} [properties] Properties to set + */ + function GenerateMessageRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; } - } - 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; - }; + /** + * GenerateMessageRequest model. + * @member {string} model + * @memberof google.ai.generativelanguage.v1beta3.GenerateMessageRequest + * @instance + */ + GenerateMessageRequest.prototype.model = ""; - /** - * 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; - }; + /** + * GenerateMessageRequest prompt. + * @member {google.ai.generativelanguage.v1beta3.IMessagePrompt|null|undefined} prompt + * @memberof google.ai.generativelanguage.v1beta3.GenerateMessageRequest + * @instance + */ + GenerateMessageRequest.prototype.prompt = null; - /** - * 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; - }; + /** + * GenerateMessageRequest temperature. + * @member {number|null|undefined} temperature + * @memberof google.ai.generativelanguage.v1beta3.GenerateMessageRequest + * @instance + */ + GenerateMessageRequest.prototype.temperature = null; - /** - * 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); - }; + /** + * GenerateMessageRequest candidateCount. + * @member {number|null|undefined} candidateCount + * @memberof google.ai.generativelanguage.v1beta3.GenerateMessageRequest + * @instance + */ + GenerateMessageRequest.prototype.candidateCount = null; - /** - * 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"; - }; + /** + * GenerateMessageRequest topP. + * @member {number|null|undefined} topP + * @memberof google.ai.generativelanguage.v1beta3.GenerateMessageRequest + * @instance + */ + GenerateMessageRequest.prototype.topP = null; - return CustomHttpPattern; - })(); + /** + * GenerateMessageRequest topK. + * @member {number|null|undefined} topK + * @memberof google.ai.generativelanguage.v1beta3.GenerateMessageRequest + * @instance + */ + GenerateMessageRequest.prototype.topK = null; - api.CommonLanguageSettings = (function() { + // OneOf field names bound to virtual getters and setters + var $oneOfFields; - /** - * Properties of a CommonLanguageSettings. - * @memberof google.api - * @interface ICommonLanguageSettings - * @property {string|null} [referenceDocsUri] CommonLanguageSettings referenceDocsUri - * @property {Array.|null} [destinations] CommonLanguageSettings destinations - */ + /** + * GenerateMessageRequest _temperature. + * @member {"temperature"|undefined} _temperature + * @memberof google.ai.generativelanguage.v1beta3.GenerateMessageRequest + * @instance + */ + Object.defineProperty(GenerateMessageRequest.prototype, "_temperature", { + get: $util.oneOfGetter($oneOfFields = ["temperature"]), + set: $util.oneOfSetter($oneOfFields) + }); - /** - * 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]]; - } + /** + * GenerateMessageRequest _candidateCount. + * @member {"candidateCount"|undefined} _candidateCount + * @memberof google.ai.generativelanguage.v1beta3.GenerateMessageRequest + * @instance + */ + Object.defineProperty(GenerateMessageRequest.prototype, "_candidateCount", { + get: $util.oneOfGetter($oneOfFields = ["candidateCount"]), + set: $util.oneOfSetter($oneOfFields) + }); - /** - * CommonLanguageSettings referenceDocsUri. - * @member {string} referenceDocsUri - * @memberof google.api.CommonLanguageSettings - * @instance - */ - CommonLanguageSettings.prototype.referenceDocsUri = ""; + /** + * GenerateMessageRequest _topP. + * @member {"topP"|undefined} _topP + * @memberof google.ai.generativelanguage.v1beta3.GenerateMessageRequest + * @instance + */ + Object.defineProperty(GenerateMessageRequest.prototype, "_topP", { + get: $util.oneOfGetter($oneOfFields = ["topP"]), + set: $util.oneOfSetter($oneOfFields) + }); - /** - * CommonLanguageSettings destinations. - * @member {Array.} destinations - * @memberof google.api.CommonLanguageSettings - * @instance - */ - CommonLanguageSettings.prototype.destinations = $util.emptyArray; + /** + * GenerateMessageRequest _topK. + * @member {"topK"|undefined} _topK + * @memberof google.ai.generativelanguage.v1beta3.GenerateMessageRequest + * @instance + */ + Object.defineProperty(GenerateMessageRequest.prototype, "_topK", { + get: $util.oneOfGetter($oneOfFields = ["topK"]), + set: $util.oneOfSetter($oneOfFields) + }); - /** - * 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); - }; + /** + * Creates a new GenerateMessageRequest instance using the specified properties. + * @function create + * @memberof google.ai.generativelanguage.v1beta3.GenerateMessageRequest + * @static + * @param {google.ai.generativelanguage.v1beta3.IGenerateMessageRequest=} [properties] Properties to set + * @returns {google.ai.generativelanguage.v1beta3.GenerateMessageRequest} GenerateMessageRequest instance + */ + GenerateMessageRequest.create = function create(properties) { + return new GenerateMessageRequest(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 GenerateMessageRequest message. Does not implicitly {@link google.ai.generativelanguage.v1beta3.GenerateMessageRequest.verify|verify} messages. + * @function encode + * @memberof google.ai.generativelanguage.v1beta3.GenerateMessageRequest + * @static + * @param {google.ai.generativelanguage.v1beta3.IGenerateMessageRequest} message GenerateMessageRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GenerateMessageRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.model != null && Object.hasOwnProperty.call(message, "model")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.model); + if (message.prompt != null && Object.hasOwnProperty.call(message, "prompt")) + $root.google.ai.generativelanguage.v1beta3.MessagePrompt.encode(message.prompt, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.temperature != null && Object.hasOwnProperty.call(message, "temperature")) + writer.uint32(/* id 3, wireType 5 =*/29).float(message.temperature); + if (message.candidateCount != null && Object.hasOwnProperty.call(message, "candidateCount")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.candidateCount); + if (message.topP != null && Object.hasOwnProperty.call(message, "topP")) + writer.uint32(/* id 5, wireType 5 =*/45).float(message.topP); + if (message.topK != null && Object.hasOwnProperty.call(message, "topK")) + writer.uint32(/* id 6, wireType 0 =*/48).int32(message.topK); + 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(); - }; + /** + * Encodes the specified GenerateMessageRequest message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1beta3.GenerateMessageRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.ai.generativelanguage.v1beta3.GenerateMessageRequest + * @static + * @param {google.ai.generativelanguage.v1beta3.IGenerateMessageRequest} message GenerateMessageRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GenerateMessageRequest.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) { - 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(); - 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; + /** + * Decodes a GenerateMessageRequest message from the specified reader or buffer. + * @function decode + * @memberof google.ai.generativelanguage.v1beta3.GenerateMessageRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.ai.generativelanguage.v1beta3.GenerateMessageRequest} GenerateMessageRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GenerateMessageRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.ai.generativelanguage.v1beta3.GenerateMessageRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.model = reader.string(); + break; + } + case 2: { + message.prompt = $root.google.ai.generativelanguage.v1beta3.MessagePrompt.decode(reader, reader.uint32()); + break; + } + case 3: { + message.temperature = reader.float(); + break; + } + case 4: { + message.candidateCount = reader.int32(); + break; + } + case 5: { + message.topP = reader.float(); + break; + } + case 6: { + message.topK = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; + 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()); - }; + /** + * Decodes a GenerateMessageRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.ai.generativelanguage.v1beta3.GenerateMessageRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.ai.generativelanguage.v1beta3.GenerateMessageRequest} GenerateMessageRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GenerateMessageRequest.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; + /** + * Verifies a GenerateMessageRequest message. + * @function verify + * @memberof google.ai.generativelanguage.v1beta3.GenerateMessageRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GenerateMessageRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.model != null && message.hasOwnProperty("model")) + if (!$util.isString(message.model)) + return "model: string expected"; + if (message.prompt != null && message.hasOwnProperty("prompt")) { + var error = $root.google.ai.generativelanguage.v1beta3.MessagePrompt.verify(message.prompt); + if (error) + return "prompt." + error; } - } - 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; + if (message.temperature != null && message.hasOwnProperty("temperature")) { + properties._temperature = 1; + if (typeof message.temperature !== "number") + return "temperature: number expected"; } - } - return message; - }; + if (message.candidateCount != null && message.hasOwnProperty("candidateCount")) { + properties._candidateCount = 1; + if (!$util.isInteger(message.candidateCount)) + return "candidateCount: integer expected"; + } + if (message.topP != null && message.hasOwnProperty("topP")) { + properties._topP = 1; + if (typeof message.topP !== "number") + return "topP: number expected"; + } + if (message.topK != null && message.hasOwnProperty("topK")) { + properties._topK = 1; + if (!$util.isInteger(message.topK)) + return "topK: integer expected"; + } + return null; + }; - /** - * 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; - }; + /** + * Creates a GenerateMessageRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.ai.generativelanguage.v1beta3.GenerateMessageRequest + * @static + * @param {Object.} object Plain object + * @returns {google.ai.generativelanguage.v1beta3.GenerateMessageRequest} GenerateMessageRequest + */ + GenerateMessageRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.ai.generativelanguage.v1beta3.GenerateMessageRequest) + return object; + var message = new $root.google.ai.generativelanguage.v1beta3.GenerateMessageRequest(); + if (object.model != null) + message.model = String(object.model); + if (object.prompt != null) { + if (typeof object.prompt !== "object") + throw TypeError(".google.ai.generativelanguage.v1beta3.GenerateMessageRequest.prompt: object expected"); + message.prompt = $root.google.ai.generativelanguage.v1beta3.MessagePrompt.fromObject(object.prompt); + } + if (object.temperature != null) + message.temperature = Number(object.temperature); + if (object.candidateCount != null) + message.candidateCount = object.candidateCount | 0; + if (object.topP != null) + message.topP = Number(object.topP); + if (object.topK != null) + message.topK = object.topK | 0; + return message; + }; - /** - * 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); - }; + /** + * Creates a plain object from a GenerateMessageRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.ai.generativelanguage.v1beta3.GenerateMessageRequest + * @static + * @param {google.ai.generativelanguage.v1beta3.GenerateMessageRequest} message GenerateMessageRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GenerateMessageRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.model = ""; + object.prompt = null; + } + if (message.model != null && message.hasOwnProperty("model")) + object.model = message.model; + if (message.prompt != null && message.hasOwnProperty("prompt")) + object.prompt = $root.google.ai.generativelanguage.v1beta3.MessagePrompt.toObject(message.prompt, options); + if (message.temperature != null && message.hasOwnProperty("temperature")) { + object.temperature = options.json && !isFinite(message.temperature) ? String(message.temperature) : message.temperature; + if (options.oneofs) + object._temperature = "temperature"; + } + if (message.candidateCount != null && message.hasOwnProperty("candidateCount")) { + object.candidateCount = message.candidateCount; + if (options.oneofs) + object._candidateCount = "candidateCount"; + } + if (message.topP != null && message.hasOwnProperty("topP")) { + object.topP = options.json && !isFinite(message.topP) ? String(message.topP) : message.topP; + if (options.oneofs) + object._topP = "topP"; + } + if (message.topK != null && message.hasOwnProperty("topK")) { + object.topK = message.topK; + if (options.oneofs) + object._topK = "topK"; + } + return object; + }; - /** - * 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"; - }; + /** + * Converts this GenerateMessageRequest to JSON. + * @function toJSON + * @memberof google.ai.generativelanguage.v1beta3.GenerateMessageRequest + * @instance + * @returns {Object.} JSON object + */ + GenerateMessageRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; - return CommonLanguageSettings; - })(); + /** + * Gets the default type url for GenerateMessageRequest + * @function getTypeUrl + * @memberof google.ai.generativelanguage.v1beta3.GenerateMessageRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GenerateMessageRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.ai.generativelanguage.v1beta3.GenerateMessageRequest"; + }; - api.ClientLibrarySettings = (function() { + return GenerateMessageRequest; + })(); - /** - * 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 - */ + v1beta3.GenerateMessageResponse = (function() { - /** - * 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; + /** + * Properties of a GenerateMessageResponse. + * @memberof google.ai.generativelanguage.v1beta3 + * @interface IGenerateMessageResponse + * @property {Array.|null} [candidates] GenerateMessageResponse candidates + * @property {Array.|null} [messages] GenerateMessageResponse messages + * @property {Array.|null} [filters] GenerateMessageResponse filters + */ - /** - * ClientLibrarySettings restNumericEnums. - * @member {boolean} restNumericEnums - * @memberof google.api.ClientLibrarySettings - * @instance - */ - ClientLibrarySettings.prototype.restNumericEnums = false; + /** + * Constructs a new GenerateMessageResponse. + * @memberof google.ai.generativelanguage.v1beta3 + * @classdesc Represents a GenerateMessageResponse. + * @implements IGenerateMessageResponse + * @constructor + * @param {google.ai.generativelanguage.v1beta3.IGenerateMessageResponse=} [properties] Properties to set + */ + function GenerateMessageResponse(properties) { + this.candidates = []; + this.messages = []; + this.filters = []; + if (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 javaSettings. - * @member {google.api.IJavaSettings|null|undefined} javaSettings - * @memberof google.api.ClientLibrarySettings - * @instance - */ - ClientLibrarySettings.prototype.javaSettings = null; + /** + * GenerateMessageResponse candidates. + * @member {Array.} candidates + * @memberof google.ai.generativelanguage.v1beta3.GenerateMessageResponse + * @instance + */ + GenerateMessageResponse.prototype.candidates = $util.emptyArray; - /** - * ClientLibrarySettings cppSettings. - * @member {google.api.ICppSettings|null|undefined} cppSettings - * @memberof google.api.ClientLibrarySettings - * @instance - */ - ClientLibrarySettings.prototype.cppSettings = null; + /** + * GenerateMessageResponse messages. + * @member {Array.} messages + * @memberof google.ai.generativelanguage.v1beta3.GenerateMessageResponse + * @instance + */ + GenerateMessageResponse.prototype.messages = $util.emptyArray; - /** - * ClientLibrarySettings phpSettings. - * @member {google.api.IPhpSettings|null|undefined} phpSettings - * @memberof google.api.ClientLibrarySettings - * @instance - */ - ClientLibrarySettings.prototype.phpSettings = null; + /** + * GenerateMessageResponse filters. + * @member {Array.} filters + * @memberof google.ai.generativelanguage.v1beta3.GenerateMessageResponse + * @instance + */ + GenerateMessageResponse.prototype.filters = $util.emptyArray; - /** - * ClientLibrarySettings pythonSettings. - * @member {google.api.IPythonSettings|null|undefined} pythonSettings - * @memberof google.api.ClientLibrarySettings - * @instance - */ - ClientLibrarySettings.prototype.pythonSettings = null; + /** + * Creates a new GenerateMessageResponse instance using the specified properties. + * @function create + * @memberof google.ai.generativelanguage.v1beta3.GenerateMessageResponse + * @static + * @param {google.ai.generativelanguage.v1beta3.IGenerateMessageResponse=} [properties] Properties to set + * @returns {google.ai.generativelanguage.v1beta3.GenerateMessageResponse} GenerateMessageResponse instance + */ + GenerateMessageResponse.create = function create(properties) { + return new GenerateMessageResponse(properties); + }; - /** - * ClientLibrarySettings nodeSettings. - * @member {google.api.INodeSettings|null|undefined} nodeSettings - * @memberof google.api.ClientLibrarySettings - * @instance - */ - ClientLibrarySettings.prototype.nodeSettings = null; + /** + * Encodes the specified GenerateMessageResponse message. Does not implicitly {@link google.ai.generativelanguage.v1beta3.GenerateMessageResponse.verify|verify} messages. + * @function encode + * @memberof google.ai.generativelanguage.v1beta3.GenerateMessageResponse + * @static + * @param {google.ai.generativelanguage.v1beta3.IGenerateMessageResponse} message GenerateMessageResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GenerateMessageResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.candidates != null && message.candidates.length) + for (var i = 0; i < message.candidates.length; ++i) + $root.google.ai.generativelanguage.v1beta3.Message.encode(message.candidates[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.messages != null && message.messages.length) + for (var i = 0; i < message.messages.length; ++i) + $root.google.ai.generativelanguage.v1beta3.Message.encode(message.messages[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.filters != null && message.filters.length) + for (var i = 0; i < message.filters.length; ++i) + $root.google.ai.generativelanguage.v1beta3.ContentFilter.encode(message.filters[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; - /** - * ClientLibrarySettings dotnetSettings. - * @member {google.api.IDotnetSettings|null|undefined} dotnetSettings - * @memberof google.api.ClientLibrarySettings - * @instance - */ - ClientLibrarySettings.prototype.dotnetSettings = null; + /** + * Encodes the specified GenerateMessageResponse message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1beta3.GenerateMessageResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.ai.generativelanguage.v1beta3.GenerateMessageResponse + * @static + * @param {google.ai.generativelanguage.v1beta3.IGenerateMessageResponse} message GenerateMessageResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GenerateMessageResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; - /** - * ClientLibrarySettings rubySettings. - * @member {google.api.IRubySettings|null|undefined} rubySettings - * @memberof google.api.ClientLibrarySettings - * @instance - */ - ClientLibrarySettings.prototype.rubySettings = null; + /** + * Decodes a GenerateMessageResponse message from the specified reader or buffer. + * @function decode + * @memberof google.ai.generativelanguage.v1beta3.GenerateMessageResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.ai.generativelanguage.v1beta3.GenerateMessageResponse} GenerateMessageResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GenerateMessageResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.ai.generativelanguage.v1beta3.GenerateMessageResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.candidates && message.candidates.length)) + message.candidates = []; + message.candidates.push($root.google.ai.generativelanguage.v1beta3.Message.decode(reader, reader.uint32())); + break; + } + case 2: { + if (!(message.messages && message.messages.length)) + message.messages = []; + message.messages.push($root.google.ai.generativelanguage.v1beta3.Message.decode(reader, reader.uint32())); + break; + } + case 3: { + if (!(message.filters && message.filters.length)) + message.filters = []; + message.filters.push($root.google.ai.generativelanguage.v1beta3.ContentFilter.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; - /** - * ClientLibrarySettings goSettings. - * @member {google.api.IGoSettings|null|undefined} goSettings - * @memberof google.api.ClientLibrarySettings - * @instance - */ - ClientLibrarySettings.prototype.goSettings = null; + /** + * Decodes a GenerateMessageResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.ai.generativelanguage.v1beta3.GenerateMessageResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.ai.generativelanguage.v1beta3.GenerateMessageResponse} GenerateMessageResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GenerateMessageResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; - /** - * 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); - }; + /** + * Verifies a GenerateMessageResponse message. + * @function verify + * @memberof google.ai.generativelanguage.v1beta3.GenerateMessageResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GenerateMessageResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.candidates != null && message.hasOwnProperty("candidates")) { + if (!Array.isArray(message.candidates)) + return "candidates: array expected"; + for (var i = 0; i < message.candidates.length; ++i) { + var error = $root.google.ai.generativelanguage.v1beta3.Message.verify(message.candidates[i]); + if (error) + return "candidates." + error; + } + } + if (message.messages != null && message.hasOwnProperty("messages")) { + if (!Array.isArray(message.messages)) + return "messages: array expected"; + for (var i = 0; i < message.messages.length; ++i) { + var error = $root.google.ai.generativelanguage.v1beta3.Message.verify(message.messages[i]); + if (error) + return "messages." + error; + } + } + if (message.filters != null && message.hasOwnProperty("filters")) { + if (!Array.isArray(message.filters)) + return "filters: array expected"; + for (var i = 0; i < message.filters.length; ++i) { + var error = $root.google.ai.generativelanguage.v1beta3.ContentFilter.verify(message.filters[i]); + if (error) + return "filters." + error; + } + } + return null; + }; - /** - * 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) { - 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(); - 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; + /** + * Creates a GenerateMessageResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.ai.generativelanguage.v1beta3.GenerateMessageResponse + * @static + * @param {Object.} object Plain object + * @returns {google.ai.generativelanguage.v1beta3.GenerateMessageResponse} GenerateMessageResponse + */ + GenerateMessageResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.ai.generativelanguage.v1beta3.GenerateMessageResponse) + return object; + var message = new $root.google.ai.generativelanguage.v1beta3.GenerateMessageResponse(); + if (object.candidates) { + if (!Array.isArray(object.candidates)) + throw TypeError(".google.ai.generativelanguage.v1beta3.GenerateMessageResponse.candidates: array expected"); + message.candidates = []; + for (var i = 0; i < object.candidates.length; ++i) { + if (typeof object.candidates[i] !== "object") + throw TypeError(".google.ai.generativelanguage.v1beta3.GenerateMessageResponse.candidates: object expected"); + message.candidates[i] = $root.google.ai.generativelanguage.v1beta3.Message.fromObject(object.candidates[i]); + } } - case 22: { - message.cppSettings = $root.google.api.CppSettings.decode(reader, reader.uint32()); - break; + if (object.messages) { + if (!Array.isArray(object.messages)) + throw TypeError(".google.ai.generativelanguage.v1beta3.GenerateMessageResponse.messages: array expected"); + message.messages = []; + for (var i = 0; i < object.messages.length; ++i) { + if (typeof object.messages[i] !== "object") + throw TypeError(".google.ai.generativelanguage.v1beta3.GenerateMessageResponse.messages: object expected"); + message.messages[i] = $root.google.ai.generativelanguage.v1beta3.Message.fromObject(object.messages[i]); + } } - case 23: { - message.phpSettings = $root.google.api.PhpSettings.decode(reader, reader.uint32()); - break; + if (object.filters) { + if (!Array.isArray(object.filters)) + throw TypeError(".google.ai.generativelanguage.v1beta3.GenerateMessageResponse.filters: array expected"); + message.filters = []; + for (var i = 0; i < object.filters.length; ++i) { + if (typeof object.filters[i] !== "object") + throw TypeError(".google.ai.generativelanguage.v1beta3.GenerateMessageResponse.filters: object expected"); + message.filters[i] = $root.google.ai.generativelanguage.v1beta3.ContentFilter.fromObject(object.filters[i]); + } } - case 24: { - message.pythonSettings = $root.google.api.PythonSettings.decode(reader, reader.uint32()); - break; + return message; + }; + + /** + * Creates a plain object from a GenerateMessageResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.ai.generativelanguage.v1beta3.GenerateMessageResponse + * @static + * @param {google.ai.generativelanguage.v1beta3.GenerateMessageResponse} message GenerateMessageResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GenerateMessageResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.candidates = []; + object.messages = []; + object.filters = []; } - case 25: { - message.nodeSettings = $root.google.api.NodeSettings.decode(reader, reader.uint32()); - break; + if (message.candidates && message.candidates.length) { + object.candidates = []; + for (var j = 0; j < message.candidates.length; ++j) + object.candidates[j] = $root.google.ai.generativelanguage.v1beta3.Message.toObject(message.candidates[j], options); } - case 26: { - message.dotnetSettings = $root.google.api.DotnetSettings.decode(reader, reader.uint32()); - break; + if (message.messages && message.messages.length) { + object.messages = []; + for (var j = 0; j < message.messages.length; ++j) + object.messages[j] = $root.google.ai.generativelanguage.v1beta3.Message.toObject(message.messages[j], options); } - case 27: { - message.rubySettings = $root.google.api.RubySettings.decode(reader, reader.uint32()); - break; + if (message.filters && message.filters.length) { + object.filters = []; + for (var j = 0; j < message.filters.length; ++j) + object.filters[j] = $root.google.ai.generativelanguage.v1beta3.ContentFilter.toObject(message.filters[j], options); } - case 28: { - message.goSettings = $root.google.api.GoSettings.decode(reader, reader.uint32()); - break; + return object; + }; + + /** + * Converts this GenerateMessageResponse to JSON. + * @function toJSON + * @memberof google.ai.generativelanguage.v1beta3.GenerateMessageResponse + * @instance + * @returns {Object.} JSON object + */ + GenerateMessageResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GenerateMessageResponse + * @function getTypeUrl + * @memberof google.ai.generativelanguage.v1beta3.GenerateMessageResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GenerateMessageResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; + return typeUrlPrefix + "/google.ai.generativelanguage.v1beta3.GenerateMessageResponse"; + }; - /** - * 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()); - }; + return GenerateMessageResponse; + })(); - /** - * 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; + v1beta3.Message = (function() { + + /** + * Properties of a Message. + * @memberof google.ai.generativelanguage.v1beta3 + * @interface IMessage + * @property {string|null} [author] Message author + * @property {string|null} [content] Message content + * @property {google.ai.generativelanguage.v1beta3.ICitationMetadata|null} [citationMetadata] Message citationMetadata + */ + + /** + * Constructs a new Message. + * @memberof google.ai.generativelanguage.v1beta3 + * @classdesc Represents a Message. + * @implements IMessage + * @constructor + * @param {google.ai.generativelanguage.v1beta3.IMessage=} [properties] Properties to set + */ + function Message(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; } - 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; - }; + /** + * Message author. + * @member {string} author + * @memberof google.ai.generativelanguage.v1beta3.Message + * @instance + */ + Message.prototype.author = ""; - /** - * 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; - }; + /** + * Message content. + * @member {string} content + * @memberof google.ai.generativelanguage.v1beta3.Message + * @instance + */ + Message.prototype.content = ""; - /** - * 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); - }; + /** + * Message citationMetadata. + * @member {google.ai.generativelanguage.v1beta3.ICitationMetadata|null|undefined} citationMetadata + * @memberof google.ai.generativelanguage.v1beta3.Message + * @instance + */ + Message.prototype.citationMetadata = null; - /** - * 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"; - }; + // OneOf field names bound to virtual getters and setters + var $oneOfFields; - return ClientLibrarySettings; - })(); + /** + * Message _citationMetadata. + * @member {"citationMetadata"|undefined} _citationMetadata + * @memberof google.ai.generativelanguage.v1beta3.Message + * @instance + */ + Object.defineProperty(Message.prototype, "_citationMetadata", { + get: $util.oneOfGetter($oneOfFields = ["citationMetadata"]), + set: $util.oneOfSetter($oneOfFields) + }); - api.Publishing = (function() { + /** + * Creates a new Message instance using the specified properties. + * @function create + * @memberof google.ai.generativelanguage.v1beta3.Message + * @static + * @param {google.ai.generativelanguage.v1beta3.IMessage=} [properties] Properties to set + * @returns {google.ai.generativelanguage.v1beta3.Message} Message instance + */ + Message.create = function create(properties) { + return new Message(properties); + }; - /** - * 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 - */ + /** + * Encodes the specified Message message. Does not implicitly {@link google.ai.generativelanguage.v1beta3.Message.verify|verify} messages. + * @function encode + * @memberof google.ai.generativelanguage.v1beta3.Message + * @static + * @param {google.ai.generativelanguage.v1beta3.IMessage} message Message message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Message.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.author != null && Object.hasOwnProperty.call(message, "author")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.author); + if (message.content != null && Object.hasOwnProperty.call(message, "content")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.content); + if (message.citationMetadata != null && Object.hasOwnProperty.call(message, "citationMetadata")) + $root.google.ai.generativelanguage.v1beta3.CitationMetadata.encode(message.citationMetadata, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; - /** - * 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]]; - } + /** + * Encodes the specified Message message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1beta3.Message.verify|verify} messages. + * @function encodeDelimited + * @memberof google.ai.generativelanguage.v1beta3.Message + * @static + * @param {google.ai.generativelanguage.v1beta3.IMessage} message Message message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Message.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; - /** - * Publishing methodSettings. - * @member {Array.} methodSettings - * @memberof google.api.Publishing - * @instance - */ - Publishing.prototype.methodSettings = $util.emptyArray; + /** + * Decodes a Message message from the specified reader or buffer. + * @function decode + * @memberof google.ai.generativelanguage.v1beta3.Message + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.ai.generativelanguage.v1beta3.Message} Message + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Message.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.ai.generativelanguage.v1beta3.Message(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.author = reader.string(); + break; + } + case 2: { + message.content = reader.string(); + break; + } + case 3: { + message.citationMetadata = $root.google.ai.generativelanguage.v1beta3.CitationMetadata.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; - /** - * Publishing newIssueUri. - * @member {string} newIssueUri - * @memberof google.api.Publishing - * @instance - */ - Publishing.prototype.newIssueUri = ""; + /** + * Decodes a Message message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.ai.generativelanguage.v1beta3.Message + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.ai.generativelanguage.v1beta3.Message} Message + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Message.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; - /** - * Publishing documentationUri. - * @member {string} documentationUri - * @memberof google.api.Publishing - * @instance - */ - Publishing.prototype.documentationUri = ""; + /** + * Verifies a Message message. + * @function verify + * @memberof google.ai.generativelanguage.v1beta3.Message + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Message.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.author != null && message.hasOwnProperty("author")) + if (!$util.isString(message.author)) + return "author: string expected"; + if (message.content != null && message.hasOwnProperty("content")) + if (!$util.isString(message.content)) + return "content: string expected"; + if (message.citationMetadata != null && message.hasOwnProperty("citationMetadata")) { + properties._citationMetadata = 1; + { + var error = $root.google.ai.generativelanguage.v1beta3.CitationMetadata.verify(message.citationMetadata); + if (error) + return "citationMetadata." + error; + } + } + return null; + }; - /** - * Publishing apiShortName. - * @member {string} apiShortName - * @memberof google.api.Publishing - * @instance - */ - Publishing.prototype.apiShortName = ""; + /** + * Creates a Message message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.ai.generativelanguage.v1beta3.Message + * @static + * @param {Object.} object Plain object + * @returns {google.ai.generativelanguage.v1beta3.Message} Message + */ + Message.fromObject = function fromObject(object) { + if (object instanceof $root.google.ai.generativelanguage.v1beta3.Message) + return object; + var message = new $root.google.ai.generativelanguage.v1beta3.Message(); + if (object.author != null) + message.author = String(object.author); + if (object.content != null) + message.content = String(object.content); + if (object.citationMetadata != null) { + if (typeof object.citationMetadata !== "object") + throw TypeError(".google.ai.generativelanguage.v1beta3.Message.citationMetadata: object expected"); + message.citationMetadata = $root.google.ai.generativelanguage.v1beta3.CitationMetadata.fromObject(object.citationMetadata); + } + return message; + }; - /** - * Publishing githubLabel. - * @member {string} githubLabel - * @memberof google.api.Publishing - * @instance - */ - Publishing.prototype.githubLabel = ""; + /** + * Creates a plain object from a Message message. Also converts values to other types if specified. + * @function toObject + * @memberof google.ai.generativelanguage.v1beta3.Message + * @static + * @param {google.ai.generativelanguage.v1beta3.Message} message Message + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Message.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.author = ""; + object.content = ""; + } + if (message.author != null && message.hasOwnProperty("author")) + object.author = message.author; + if (message.content != null && message.hasOwnProperty("content")) + object.content = message.content; + if (message.citationMetadata != null && message.hasOwnProperty("citationMetadata")) { + object.citationMetadata = $root.google.ai.generativelanguage.v1beta3.CitationMetadata.toObject(message.citationMetadata, options); + if (options.oneofs) + object._citationMetadata = "citationMetadata"; + } + return object; + }; - /** - * Publishing codeownerGithubTeams. - * @member {Array.} codeownerGithubTeams - * @memberof google.api.Publishing - * @instance - */ - Publishing.prototype.codeownerGithubTeams = $util.emptyArray; + /** + * Converts this Message to JSON. + * @function toJSON + * @memberof google.ai.generativelanguage.v1beta3.Message + * @instance + * @returns {Object.} JSON object + */ + Message.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; - /** - * Publishing docTagPrefix. - * @member {string} docTagPrefix - * @memberof google.api.Publishing - * @instance - */ - Publishing.prototype.docTagPrefix = ""; + /** + * Gets the default type url for Message + * @function getTypeUrl + * @memberof google.ai.generativelanguage.v1beta3.Message + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Message.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.ai.generativelanguage.v1beta3.Message"; + }; - /** - * Publishing organization. - * @member {google.api.ClientLibraryOrganization} organization - * @memberof google.api.Publishing - * @instance - */ - Publishing.prototype.organization = 0; + return Message; + })(); - /** - * Publishing librarySettings. - * @member {Array.} librarySettings - * @memberof google.api.Publishing - * @instance - */ - Publishing.prototype.librarySettings = $util.emptyArray; + v1beta3.MessagePrompt = (function() { - /** - * 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); - }; + /** + * Properties of a MessagePrompt. + * @memberof google.ai.generativelanguage.v1beta3 + * @interface IMessagePrompt + * @property {string|null} [context] MessagePrompt context + * @property {Array.|null} [examples] MessagePrompt examples + * @property {Array.|null} [messages] MessagePrompt messages + */ - /** - * 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(); - return writer; - }; + /** + * Constructs a new MessagePrompt. + * @memberof google.ai.generativelanguage.v1beta3 + * @classdesc Represents a MessagePrompt. + * @implements IMessagePrompt + * @constructor + * @param {google.ai.generativelanguage.v1beta3.IMessagePrompt=} [properties] Properties to set + */ + function MessagePrompt(properties) { + this.examples = []; + this.messages = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } - /** - * 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(); - }; + /** + * MessagePrompt context. + * @member {string} context + * @memberof google.ai.generativelanguage.v1beta3.MessagePrompt + * @instance + */ + MessagePrompt.prototype.context = ""; - /** - * 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) { - 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(); - 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; + /** + * MessagePrompt examples. + * @member {Array.} examples + * @memberof google.ai.generativelanguage.v1beta3.MessagePrompt + * @instance + */ + MessagePrompt.prototype.examples = $util.emptyArray; + + /** + * MessagePrompt messages. + * @member {Array.} messages + * @memberof google.ai.generativelanguage.v1beta3.MessagePrompt + * @instance + */ + MessagePrompt.prototype.messages = $util.emptyArray; + + /** + * Creates a new MessagePrompt instance using the specified properties. + * @function create + * @memberof google.ai.generativelanguage.v1beta3.MessagePrompt + * @static + * @param {google.ai.generativelanguage.v1beta3.IMessagePrompt=} [properties] Properties to set + * @returns {google.ai.generativelanguage.v1beta3.MessagePrompt} MessagePrompt instance + */ + MessagePrompt.create = function create(properties) { + return new MessagePrompt(properties); + }; + + /** + * Encodes the specified MessagePrompt message. Does not implicitly {@link google.ai.generativelanguage.v1beta3.MessagePrompt.verify|verify} messages. + * @function encode + * @memberof google.ai.generativelanguage.v1beta3.MessagePrompt + * @static + * @param {google.ai.generativelanguage.v1beta3.IMessagePrompt} message MessagePrompt message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MessagePrompt.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.context != null && Object.hasOwnProperty.call(message, "context")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.context); + if (message.examples != null && message.examples.length) + for (var i = 0; i < message.examples.length; ++i) + $root.google.ai.generativelanguage.v1beta3.Example.encode(message.examples[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.messages != null && message.messages.length) + for (var i = 0; i < message.messages.length; ++i) + $root.google.ai.generativelanguage.v1beta3.Message.encode(message.messages[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified MessagePrompt message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1beta3.MessagePrompt.verify|verify} messages. + * @function encodeDelimited + * @memberof google.ai.generativelanguage.v1beta3.MessagePrompt + * @static + * @param {google.ai.generativelanguage.v1beta3.IMessagePrompt} message MessagePrompt message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MessagePrompt.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a MessagePrompt message from the specified reader or buffer. + * @function decode + * @memberof google.ai.generativelanguage.v1beta3.MessagePrompt + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.ai.generativelanguage.v1beta3.MessagePrompt} MessagePrompt + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MessagePrompt.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.ai.generativelanguage.v1beta3.MessagePrompt(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.context = reader.string(); + break; + } + case 2: { + if (!(message.examples && message.examples.length)) + message.examples = []; + message.examples.push($root.google.ai.generativelanguage.v1beta3.Example.decode(reader, reader.uint32())); + break; + } + case 3: { + if (!(message.messages && message.messages.length)) + message.messages = []; + message.messages.push($root.google.ai.generativelanguage.v1beta3.Message.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } } - case 101: { - message.newIssueUri = reader.string(); - break; + return message; + }; + + /** + * Decodes a MessagePrompt message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.ai.generativelanguage.v1beta3.MessagePrompt + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.ai.generativelanguage.v1beta3.MessagePrompt} MessagePrompt + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MessagePrompt.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a MessagePrompt message. + * @function verify + * @memberof google.ai.generativelanguage.v1beta3.MessagePrompt + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + MessagePrompt.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.context != null && message.hasOwnProperty("context")) + if (!$util.isString(message.context)) + return "context: string expected"; + if (message.examples != null && message.hasOwnProperty("examples")) { + if (!Array.isArray(message.examples)) + return "examples: array expected"; + for (var i = 0; i < message.examples.length; ++i) { + var error = $root.google.ai.generativelanguage.v1beta3.Example.verify(message.examples[i]); + if (error) + return "examples." + error; + } } - case 102: { - message.documentationUri = reader.string(); - break; + if (message.messages != null && message.hasOwnProperty("messages")) { + if (!Array.isArray(message.messages)) + return "messages: array expected"; + for (var i = 0; i < message.messages.length; ++i) { + var error = $root.google.ai.generativelanguage.v1beta3.Message.verify(message.messages[i]); + if (error) + return "messages." + error; + } } - case 103: { - message.apiShortName = reader.string(); - break; + return null; + }; + + /** + * Creates a MessagePrompt message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.ai.generativelanguage.v1beta3.MessagePrompt + * @static + * @param {Object.} object Plain object + * @returns {google.ai.generativelanguage.v1beta3.MessagePrompt} MessagePrompt + */ + MessagePrompt.fromObject = function fromObject(object) { + if (object instanceof $root.google.ai.generativelanguage.v1beta3.MessagePrompt) + return object; + var message = new $root.google.ai.generativelanguage.v1beta3.MessagePrompt(); + if (object.context != null) + message.context = String(object.context); + if (object.examples) { + if (!Array.isArray(object.examples)) + throw TypeError(".google.ai.generativelanguage.v1beta3.MessagePrompt.examples: array expected"); + message.examples = []; + for (var i = 0; i < object.examples.length; ++i) { + if (typeof object.examples[i] !== "object") + throw TypeError(".google.ai.generativelanguage.v1beta3.MessagePrompt.examples: object expected"); + message.examples[i] = $root.google.ai.generativelanguage.v1beta3.Example.fromObject(object.examples[i]); + } } - case 104: { - message.githubLabel = reader.string(); - break; + if (object.messages) { + if (!Array.isArray(object.messages)) + throw TypeError(".google.ai.generativelanguage.v1beta3.MessagePrompt.messages: array expected"); + message.messages = []; + for (var i = 0; i < object.messages.length; ++i) { + if (typeof object.messages[i] !== "object") + throw TypeError(".google.ai.generativelanguage.v1beta3.MessagePrompt.messages: object expected"); + message.messages[i] = $root.google.ai.generativelanguage.v1beta3.Message.fromObject(object.messages[i]); + } } - case 105: { - if (!(message.codeownerGithubTeams && message.codeownerGithubTeams.length)) - message.codeownerGithubTeams = []; - message.codeownerGithubTeams.push(reader.string()); - break; + return message; + }; + + /** + * Creates a plain object from a MessagePrompt message. Also converts values to other types if specified. + * @function toObject + * @memberof google.ai.generativelanguage.v1beta3.MessagePrompt + * @static + * @param {google.ai.generativelanguage.v1beta3.MessagePrompt} message MessagePrompt + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + MessagePrompt.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.examples = []; + object.messages = []; } - case 106: { - message.docTagPrefix = reader.string(); - break; + if (options.defaults) + object.context = ""; + if (message.context != null && message.hasOwnProperty("context")) + object.context = message.context; + if (message.examples && message.examples.length) { + object.examples = []; + for (var j = 0; j < message.examples.length; ++j) + object.examples[j] = $root.google.ai.generativelanguage.v1beta3.Example.toObject(message.examples[j], options); } - case 107: { - message.organization = reader.int32(); - break; + if (message.messages && message.messages.length) { + object.messages = []; + for (var j = 0; j < message.messages.length; ++j) + object.messages[j] = $root.google.ai.generativelanguage.v1beta3.Message.toObject(message.messages[j], options); } - case 109: { - if (!(message.librarySettings && message.librarySettings.length)) - message.librarySettings = []; - message.librarySettings.push($root.google.api.ClientLibrarySettings.decode(reader, reader.uint32())); - break; + return object; + }; + + /** + * Converts this MessagePrompt to JSON. + * @function toJSON + * @memberof google.ai.generativelanguage.v1beta3.MessagePrompt + * @instance + * @returns {Object.} JSON object + */ + MessagePrompt.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for MessagePrompt + * @function getTypeUrl + * @memberof google.ai.generativelanguage.v1beta3.MessagePrompt + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + MessagePrompt.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; + return typeUrlPrefix + "/google.ai.generativelanguage.v1beta3.MessagePrompt"; + }; - /** - * 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()); - }; + return MessagePrompt; + })(); - /** - * 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: - 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; - } - } - return null; - }; + v1beta3.Example = (function() { - /** - * 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; - } - 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]); - } - } - return message; - }; + /** + * Properties of an Example. + * @memberof google.ai.generativelanguage.v1beta3 + * @interface IExample + * @property {google.ai.generativelanguage.v1beta3.IMessage|null} [input] Example input + * @property {google.ai.generativelanguage.v1beta3.IMessage|null} [output] Example output + */ - /** - * 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; - } - 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); - } - return object; - }; + /** + * Constructs a new Example. + * @memberof google.ai.generativelanguage.v1beta3 + * @classdesc Represents an Example. + * @implements IExample + * @constructor + * @param {google.ai.generativelanguage.v1beta3.IExample=} [properties] Properties to set + */ + function Example(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } - /** - * 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); - }; + /** + * Example input. + * @member {google.ai.generativelanguage.v1beta3.IMessage|null|undefined} input + * @memberof google.ai.generativelanguage.v1beta3.Example + * @instance + */ + Example.prototype.input = null; - /** - * 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"; - }; + /** + * Example output. + * @member {google.ai.generativelanguage.v1beta3.IMessage|null|undefined} output + * @memberof google.ai.generativelanguage.v1beta3.Example + * @instance + */ + Example.prototype.output = null; - return Publishing; - })(); + /** + * Creates a new Example instance using the specified properties. + * @function create + * @memberof google.ai.generativelanguage.v1beta3.Example + * @static + * @param {google.ai.generativelanguage.v1beta3.IExample=} [properties] Properties to set + * @returns {google.ai.generativelanguage.v1beta3.Example} Example instance + */ + Example.create = function create(properties) { + return new Example(properties); + }; - api.JavaSettings = (function() { + /** + * Encodes the specified Example message. Does not implicitly {@link google.ai.generativelanguage.v1beta3.Example.verify|verify} messages. + * @function encode + * @memberof google.ai.generativelanguage.v1beta3.Example + * @static + * @param {google.ai.generativelanguage.v1beta3.IExample} message Example message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Example.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.input != null && Object.hasOwnProperty.call(message, "input")) + $root.google.ai.generativelanguage.v1beta3.Message.encode(message.input, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.output != null && Object.hasOwnProperty.call(message, "output")) + $root.google.ai.generativelanguage.v1beta3.Message.encode(message.output, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; - /** - * 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 - */ + /** + * Encodes the specified Example message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1beta3.Example.verify|verify} messages. + * @function encodeDelimited + * @memberof google.ai.generativelanguage.v1beta3.Example + * @static + * @param {google.ai.generativelanguage.v1beta3.IExample} message Example message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Example.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; - /** - * 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]]; - } + /** + * Decodes an Example message from the specified reader or buffer. + * @function decode + * @memberof google.ai.generativelanguage.v1beta3.Example + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.ai.generativelanguage.v1beta3.Example} Example + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Example.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.ai.generativelanguage.v1beta3.Example(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.input = $root.google.ai.generativelanguage.v1beta3.Message.decode(reader, reader.uint32()); + break; + } + case 2: { + message.output = $root.google.ai.generativelanguage.v1beta3.Message.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; - /** - * JavaSettings libraryPackage. - * @member {string} libraryPackage - * @memberof google.api.JavaSettings - * @instance - */ - JavaSettings.prototype.libraryPackage = ""; + /** + * Decodes an Example message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.ai.generativelanguage.v1beta3.Example + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.ai.generativelanguage.v1beta3.Example} Example + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Example.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; - /** - * JavaSettings serviceClassNames. - * @member {Object.} serviceClassNames - * @memberof google.api.JavaSettings - * @instance - */ - JavaSettings.prototype.serviceClassNames = $util.emptyObject; + /** + * Verifies an Example message. + * @function verify + * @memberof google.ai.generativelanguage.v1beta3.Example + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Example.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.input != null && message.hasOwnProperty("input")) { + var error = $root.google.ai.generativelanguage.v1beta3.Message.verify(message.input); + if (error) + return "input." + error; + } + if (message.output != null && message.hasOwnProperty("output")) { + var error = $root.google.ai.generativelanguage.v1beta3.Message.verify(message.output); + if (error) + return "output." + error; + } + return null; + }; - /** - * JavaSettings common. - * @member {google.api.ICommonLanguageSettings|null|undefined} common - * @memberof google.api.JavaSettings - * @instance - */ - JavaSettings.prototype.common = null; + /** + * Creates an Example message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.ai.generativelanguage.v1beta3.Example + * @static + * @param {Object.} object Plain object + * @returns {google.ai.generativelanguage.v1beta3.Example} Example + */ + Example.fromObject = function fromObject(object) { + if (object instanceof $root.google.ai.generativelanguage.v1beta3.Example) + return object; + var message = new $root.google.ai.generativelanguage.v1beta3.Example(); + if (object.input != null) { + if (typeof object.input !== "object") + throw TypeError(".google.ai.generativelanguage.v1beta3.Example.input: object expected"); + message.input = $root.google.ai.generativelanguage.v1beta3.Message.fromObject(object.input); + } + if (object.output != null) { + if (typeof object.output !== "object") + throw TypeError(".google.ai.generativelanguage.v1beta3.Example.output: object expected"); + message.output = $root.google.ai.generativelanguage.v1beta3.Message.fromObject(object.output); + } + return message; + }; - /** - * 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; - }; + /** + * Creates a plain object from an Example message. Also converts values to other types if specified. + * @function toObject + * @memberof google.ai.generativelanguage.v1beta3.Example + * @static + * @param {google.ai.generativelanguage.v1beta3.Example} message Example + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Example.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.input = null; + object.output = null; + } + if (message.input != null && message.hasOwnProperty("input")) + object.input = $root.google.ai.generativelanguage.v1beta3.Message.toObject(message.input, options); + if (message.output != null && message.hasOwnProperty("output")) + object.output = $root.google.ai.generativelanguage.v1beta3.Message.toObject(message.output, options); + return object; + }; - /** - * 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(); - }; + /** + * Converts this Example to JSON. + * @function toJSON + * @memberof google.ai.generativelanguage.v1beta3.Example + * @instance + * @returns {Object.} JSON object + */ + Example.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; - /** - * 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) { - 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(); - switch (tag >>> 3) { - case 1: { - message.libraryPackage = reader.string(); - break; + /** + * Gets the default type url for Example + * @function getTypeUrl + * @memberof google.ai.generativelanguage.v1beta3.Example + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Example.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; } - 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(); + return typeUrlPrefix + "/google.ai.generativelanguage.v1beta3.Example"; + }; + + return Example; + })(); + + v1beta3.CountMessageTokensRequest = (function() { + + /** + * Properties of a CountMessageTokensRequest. + * @memberof google.ai.generativelanguage.v1beta3 + * @interface ICountMessageTokensRequest + * @property {string|null} [model] CountMessageTokensRequest model + * @property {google.ai.generativelanguage.v1beta3.IMessagePrompt|null} [prompt] CountMessageTokensRequest prompt + */ + + /** + * Constructs a new CountMessageTokensRequest. + * @memberof google.ai.generativelanguage.v1beta3 + * @classdesc Represents a CountMessageTokensRequest. + * @implements ICountMessageTokensRequest + * @constructor + * @param {google.ai.generativelanguage.v1beta3.ICountMessageTokensRequest=} [properties] Properties to set + */ + function CountMessageTokensRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * CountMessageTokensRequest model. + * @member {string} model + * @memberof google.ai.generativelanguage.v1beta3.CountMessageTokensRequest + * @instance + */ + CountMessageTokensRequest.prototype.model = ""; + + /** + * CountMessageTokensRequest prompt. + * @member {google.ai.generativelanguage.v1beta3.IMessagePrompt|null|undefined} prompt + * @memberof google.ai.generativelanguage.v1beta3.CountMessageTokensRequest + * @instance + */ + CountMessageTokensRequest.prototype.prompt = null; + + /** + * Creates a new CountMessageTokensRequest instance using the specified properties. + * @function create + * @memberof google.ai.generativelanguage.v1beta3.CountMessageTokensRequest + * @static + * @param {google.ai.generativelanguage.v1beta3.ICountMessageTokensRequest=} [properties] Properties to set + * @returns {google.ai.generativelanguage.v1beta3.CountMessageTokensRequest} CountMessageTokensRequest instance + */ + CountMessageTokensRequest.create = function create(properties) { + return new CountMessageTokensRequest(properties); + }; + + /** + * Encodes the specified CountMessageTokensRequest message. Does not implicitly {@link google.ai.generativelanguage.v1beta3.CountMessageTokensRequest.verify|verify} messages. + * @function encode + * @memberof google.ai.generativelanguage.v1beta3.CountMessageTokensRequest + * @static + * @param {google.ai.generativelanguage.v1beta3.ICountMessageTokensRequest} message CountMessageTokensRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CountMessageTokensRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.model != null && Object.hasOwnProperty.call(message, "model")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.model); + if (message.prompt != null && Object.hasOwnProperty.call(message, "prompt")) + $root.google.ai.generativelanguage.v1beta3.MessagePrompt.encode(message.prompt, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified CountMessageTokensRequest message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1beta3.CountMessageTokensRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.ai.generativelanguage.v1beta3.CountMessageTokensRequest + * @static + * @param {google.ai.generativelanguage.v1beta3.ICountMessageTokensRequest} message CountMessageTokensRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CountMessageTokensRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CountMessageTokensRequest message from the specified reader or buffer. + * @function decode + * @memberof google.ai.generativelanguage.v1beta3.CountMessageTokensRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.ai.generativelanguage.v1beta3.CountMessageTokensRequest} CountMessageTokensRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CountMessageTokensRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.ai.generativelanguage.v1beta3.CountMessageTokensRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.model = reader.string(); break; - default: - reader.skipType(tag2 & 7); + } + case 2: { + message.prompt = $root.google.ai.generativelanguage.v1beta3.MessagePrompt.decode(reader, reader.uint32()); break; } + default: + reader.skipType(tag & 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; - }; + 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()); - }; + /** + * Decodes a CountMessageTokensRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.ai.generativelanguage.v1beta3.CountMessageTokensRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.ai.generativelanguage.v1beta3.CountMessageTokensRequest} CountMessageTokensRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CountMessageTokensRequest.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; - }; + /** + * Verifies a CountMessageTokensRequest message. + * @function verify + * @memberof google.ai.generativelanguage.v1beta3.CountMessageTokensRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CountMessageTokensRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.model != null && message.hasOwnProperty("model")) + if (!$util.isString(message.model)) + return "model: string expected"; + if (message.prompt != null && message.hasOwnProperty("prompt")) { + var error = $root.google.ai.generativelanguage.v1beta3.MessagePrompt.verify(message.prompt); + if (error) + return "prompt." + 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 CountMessageTokensRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.ai.generativelanguage.v1beta3.CountMessageTokensRequest + * @static + * @param {Object.} object Plain object + * @returns {google.ai.generativelanguage.v1beta3.CountMessageTokensRequest} CountMessageTokensRequest + */ + CountMessageTokensRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.ai.generativelanguage.v1beta3.CountMessageTokensRequest) + return object; + var message = new $root.google.ai.generativelanguage.v1beta3.CountMessageTokensRequest(); + if (object.model != null) + message.model = String(object.model); + if (object.prompt != null) { + if (typeof object.prompt !== "object") + throw TypeError(".google.ai.generativelanguage.v1beta3.CountMessageTokensRequest.prompt: object expected"); + message.prompt = $root.google.ai.generativelanguage.v1beta3.MessagePrompt.fromObject(object.prompt); + } + 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; - }; + /** + * Creates a plain object from a CountMessageTokensRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.ai.generativelanguage.v1beta3.CountMessageTokensRequest + * @static + * @param {google.ai.generativelanguage.v1beta3.CountMessageTokensRequest} message CountMessageTokensRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CountMessageTokensRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.model = ""; + object.prompt = null; + } + if (message.model != null && message.hasOwnProperty("model")) + object.model = message.model; + if (message.prompt != null && message.hasOwnProperty("prompt")) + object.prompt = $root.google.ai.generativelanguage.v1beta3.MessagePrompt.toObject(message.prompt, 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); - }; + /** + * Converts this CountMessageTokensRequest to JSON. + * @function toJSON + * @memberof google.ai.generativelanguage.v1beta3.CountMessageTokensRequest + * @instance + * @returns {Object.} JSON object + */ + CountMessageTokensRequest.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"; - }; + /** + * Gets the default type url for CountMessageTokensRequest + * @function getTypeUrl + * @memberof google.ai.generativelanguage.v1beta3.CountMessageTokensRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CountMessageTokensRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.ai.generativelanguage.v1beta3.CountMessageTokensRequest"; + }; - return JavaSettings; - })(); + return CountMessageTokensRequest; + })(); - api.CppSettings = (function() { + v1beta3.CountMessageTokensResponse = (function() { - /** - * Properties of a CppSettings. - * @memberof google.api - * @interface ICppSettings - * @property {google.api.ICommonLanguageSettings|null} [common] CppSettings common - */ + /** + * Properties of a CountMessageTokensResponse. + * @memberof google.ai.generativelanguage.v1beta3 + * @interface ICountMessageTokensResponse + * @property {number|null} [tokenCount] CountMessageTokensResponse tokenCount + */ - /** - * 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]]; - } + /** + * Constructs a new CountMessageTokensResponse. + * @memberof google.ai.generativelanguage.v1beta3 + * @classdesc Represents a CountMessageTokensResponse. + * @implements ICountMessageTokensResponse + * @constructor + * @param {google.ai.generativelanguage.v1beta3.ICountMessageTokensResponse=} [properties] Properties to set + */ + function CountMessageTokensResponse(properties) { + if (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; + /** + * CountMessageTokensResponse tokenCount. + * @member {number} tokenCount + * @memberof google.ai.generativelanguage.v1beta3.CountMessageTokensResponse + * @instance + */ + CountMessageTokensResponse.prototype.tokenCount = 0; - /** - * 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); - }; + /** + * Creates a new CountMessageTokensResponse instance using the specified properties. + * @function create + * @memberof google.ai.generativelanguage.v1beta3.CountMessageTokensResponse + * @static + * @param {google.ai.generativelanguage.v1beta3.ICountMessageTokensResponse=} [properties] Properties to set + * @returns {google.ai.generativelanguage.v1beta3.CountMessageTokensResponse} CountMessageTokensResponse instance + */ + CountMessageTokensResponse.create = function create(properties) { + return new CountMessageTokensResponse(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 CountMessageTokensResponse message. Does not implicitly {@link google.ai.generativelanguage.v1beta3.CountMessageTokensResponse.verify|verify} messages. + * @function encode + * @memberof google.ai.generativelanguage.v1beta3.CountMessageTokensResponse + * @static + * @param {google.ai.generativelanguage.v1beta3.ICountMessageTokensResponse} message CountMessageTokensResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CountMessageTokensResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.tokenCount != null && Object.hasOwnProperty.call(message, "tokenCount")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.tokenCount); + 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(); - }; + /** + * Encodes the specified CountMessageTokensResponse message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1beta3.CountMessageTokensResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.ai.generativelanguage.v1beta3.CountMessageTokensResponse + * @static + * @param {google.ai.generativelanguage.v1beta3.ICountMessageTokensResponse} message CountMessageTokensResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CountMessageTokensResponse.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) { - 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(); - switch (tag >>> 3) { - case 1: { - message.common = $root.google.api.CommonLanguageSettings.decode(reader, reader.uint32()); - break; + /** + * Decodes a CountMessageTokensResponse message from the specified reader or buffer. + * @function decode + * @memberof google.ai.generativelanguage.v1beta3.CountMessageTokensResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.ai.generativelanguage.v1beta3.CountMessageTokensResponse} CountMessageTokensResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CountMessageTokensResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.ai.generativelanguage.v1beta3.CountMessageTokensResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.tokenCount = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; + 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()); - }; + /** + * Decodes a CountMessageTokensResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.ai.generativelanguage.v1beta3.CountMessageTokensResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.ai.generativelanguage.v1beta3.CountMessageTokensResponse} CountMessageTokensResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CountMessageTokensResponse.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; - }; + /** + * Verifies a CountMessageTokensResponse message. + * @function verify + * @memberof google.ai.generativelanguage.v1beta3.CountMessageTokensResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CountMessageTokensResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.tokenCount != null && message.hasOwnProperty("tokenCount")) + if (!$util.isInteger(message.tokenCount)) + return "tokenCount: integer expected"; + 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 CountMessageTokensResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.ai.generativelanguage.v1beta3.CountMessageTokensResponse + * @static + * @param {Object.} object Plain object + * @returns {google.ai.generativelanguage.v1beta3.CountMessageTokensResponse} CountMessageTokensResponse + */ + CountMessageTokensResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.ai.generativelanguage.v1beta3.CountMessageTokensResponse) + return object; + var message = new $root.google.ai.generativelanguage.v1beta3.CountMessageTokensResponse(); + if (object.tokenCount != null) + message.tokenCount = object.tokenCount | 0; + 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; - }; + /** + * Creates a plain object from a CountMessageTokensResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.ai.generativelanguage.v1beta3.CountMessageTokensResponse + * @static + * @param {google.ai.generativelanguage.v1beta3.CountMessageTokensResponse} message CountMessageTokensResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CountMessageTokensResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.tokenCount = 0; + if (message.tokenCount != null && message.hasOwnProperty("tokenCount")) + object.tokenCount = message.tokenCount; + 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); - }; + /** + * Converts this CountMessageTokensResponse to JSON. + * @function toJSON + * @memberof google.ai.generativelanguage.v1beta3.CountMessageTokensResponse + * @instance + * @returns {Object.} JSON object + */ + CountMessageTokensResponse.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; - })(); + /** + * Gets the default type url for CountMessageTokensResponse + * @function getTypeUrl + * @memberof google.ai.generativelanguage.v1beta3.CountMessageTokensResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CountMessageTokensResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.ai.generativelanguage.v1beta3.CountMessageTokensResponse"; + }; - api.PhpSettings = (function() { + return CountMessageTokensResponse; + })(); - /** - * Properties of a PhpSettings. - * @memberof google.api - * @interface IPhpSettings - * @property {google.api.ICommonLanguageSettings|null} [common] PhpSettings common - */ + /** + * HarmCategory enum. + * @name google.ai.generativelanguage.v1beta3.HarmCategory + * @enum {number} + * @property {number} HARM_CATEGORY_UNSPECIFIED=0 HARM_CATEGORY_UNSPECIFIED value + * @property {number} HARM_CATEGORY_DEROGATORY=1 HARM_CATEGORY_DEROGATORY value + * @property {number} HARM_CATEGORY_TOXICITY=2 HARM_CATEGORY_TOXICITY value + * @property {number} HARM_CATEGORY_VIOLENCE=3 HARM_CATEGORY_VIOLENCE value + * @property {number} HARM_CATEGORY_SEXUAL=4 HARM_CATEGORY_SEXUAL value + * @property {number} HARM_CATEGORY_MEDICAL=5 HARM_CATEGORY_MEDICAL value + * @property {number} HARM_CATEGORY_DANGEROUS=6 HARM_CATEGORY_DANGEROUS value + */ + v1beta3.HarmCategory = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "HARM_CATEGORY_UNSPECIFIED"] = 0; + values[valuesById[1] = "HARM_CATEGORY_DEROGATORY"] = 1; + values[valuesById[2] = "HARM_CATEGORY_TOXICITY"] = 2; + values[valuesById[3] = "HARM_CATEGORY_VIOLENCE"] = 3; + values[valuesById[4] = "HARM_CATEGORY_SEXUAL"] = 4; + values[valuesById[5] = "HARM_CATEGORY_MEDICAL"] = 5; + values[valuesById[6] = "HARM_CATEGORY_DANGEROUS"] = 6; + return values; + })(); - /** - * 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]]; - } + v1beta3.ContentFilter = (function() { - /** - * PhpSettings common. - * @member {google.api.ICommonLanguageSettings|null|undefined} common - * @memberof google.api.PhpSettings - * @instance - */ - PhpSettings.prototype.common = null; + /** + * Properties of a ContentFilter. + * @memberof google.ai.generativelanguage.v1beta3 + * @interface IContentFilter + * @property {google.ai.generativelanguage.v1beta3.ContentFilter.BlockedReason|null} [reason] ContentFilter reason + * @property {string|null} [message] ContentFilter message + */ - /** - * 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); - }; + /** + * Constructs a new ContentFilter. + * @memberof google.ai.generativelanguage.v1beta3 + * @classdesc Represents a ContentFilter. + * @implements IContentFilter + * @constructor + * @param {google.ai.generativelanguage.v1beta3.IContentFilter=} [properties] Properties to set + */ + function ContentFilter(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } - /** - * 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; - }; + /** + * ContentFilter reason. + * @member {google.ai.generativelanguage.v1beta3.ContentFilter.BlockedReason} reason + * @memberof google.ai.generativelanguage.v1beta3.ContentFilter + * @instance + */ + ContentFilter.prototype.reason = 0; - /** - * 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(); - }; + /** + * ContentFilter message. + * @member {string|null|undefined} message + * @memberof google.ai.generativelanguage.v1beta3.ContentFilter + * @instance + */ + ContentFilter.prototype.message = null; - /** - * 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) { - 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(); - switch (tag >>> 3) { - case 1: { - message.common = $root.google.api.CommonLanguageSettings.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; + // OneOf field names bound to virtual getters and setters + var $oneOfFields; - /** - * 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()); - }; + /** + * ContentFilter _message. + * @member {"message"|undefined} _message + * @memberof google.ai.generativelanguage.v1beta3.ContentFilter + * @instance + */ + Object.defineProperty(ContentFilter.prototype, "_message", { + get: $util.oneOfGetter($oneOfFields = ["message"]), + set: $util.oneOfSetter($oneOfFields) + }); - /** - * 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 new ContentFilter instance using the specified properties. + * @function create + * @memberof google.ai.generativelanguage.v1beta3.ContentFilter + * @static + * @param {google.ai.generativelanguage.v1beta3.IContentFilter=} [properties] Properties to set + * @returns {google.ai.generativelanguage.v1beta3.ContentFilter} ContentFilter instance + */ + ContentFilter.create = function create(properties) { + return new ContentFilter(properties); + }; - /** - * 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; - }; + /** + * Encodes the specified ContentFilter message. Does not implicitly {@link google.ai.generativelanguage.v1beta3.ContentFilter.verify|verify} messages. + * @function encode + * @memberof google.ai.generativelanguage.v1beta3.ContentFilter + * @static + * @param {google.ai.generativelanguage.v1beta3.IContentFilter} message ContentFilter message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ContentFilter.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.reason != null && Object.hasOwnProperty.call(message, "reason")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.reason); + if (message.message != null && Object.hasOwnProperty.call(message, "message")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.message); + return writer; + }; - /** - * 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; - }; + /** + * Encodes the specified ContentFilter message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1beta3.ContentFilter.verify|verify} messages. + * @function encodeDelimited + * @memberof google.ai.generativelanguage.v1beta3.ContentFilter + * @static + * @param {google.ai.generativelanguage.v1beta3.IContentFilter} message ContentFilter message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ContentFilter.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; - /** - * 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); - }; + /** + * Decodes a ContentFilter message from the specified reader or buffer. + * @function decode + * @memberof google.ai.generativelanguage.v1beta3.ContentFilter + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.ai.generativelanguage.v1beta3.ContentFilter} ContentFilter + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ContentFilter.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.ai.generativelanguage.v1beta3.ContentFilter(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.reason = reader.int32(); + break; + } + case 2: { + message.message = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; - /** - * 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"; - }; + /** + * Decodes a ContentFilter message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.ai.generativelanguage.v1beta3.ContentFilter + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.ai.generativelanguage.v1beta3.ContentFilter} ContentFilter + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ContentFilter.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; - return PhpSettings; - })(); + /** + * Verifies a ContentFilter message. + * @function verify + * @memberof google.ai.generativelanguage.v1beta3.ContentFilter + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ContentFilter.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.reason != null && message.hasOwnProperty("reason")) + switch (message.reason) { + default: + return "reason: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.message != null && message.hasOwnProperty("message")) { + properties._message = 1; + if (!$util.isString(message.message)) + return "message: string expected"; + } + return null; + }; - api.PythonSettings = (function() { + /** + * Creates a ContentFilter message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.ai.generativelanguage.v1beta3.ContentFilter + * @static + * @param {Object.} object Plain object + * @returns {google.ai.generativelanguage.v1beta3.ContentFilter} ContentFilter + */ + ContentFilter.fromObject = function fromObject(object) { + if (object instanceof $root.google.ai.generativelanguage.v1beta3.ContentFilter) + return object; + var message = new $root.google.ai.generativelanguage.v1beta3.ContentFilter(); + switch (object.reason) { + default: + if (typeof object.reason === "number") { + message.reason = object.reason; + break; + } + break; + case "BLOCKED_REASON_UNSPECIFIED": + case 0: + message.reason = 0; + break; + case "SAFETY": + case 1: + message.reason = 1; + break; + case "OTHER": + case 2: + message.reason = 2; + break; + } + if (object.message != null) + message.message = String(object.message); + return message; + }; - /** - * Properties of a PythonSettings. - * @memberof google.api - * @interface IPythonSettings - * @property {google.api.ICommonLanguageSettings|null} [common] PythonSettings common - */ + /** + * Creates a plain object from a ContentFilter message. Also converts values to other types if specified. + * @function toObject + * @memberof google.ai.generativelanguage.v1beta3.ContentFilter + * @static + * @param {google.ai.generativelanguage.v1beta3.ContentFilter} message ContentFilter + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ContentFilter.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.reason = options.enums === String ? "BLOCKED_REASON_UNSPECIFIED" : 0; + if (message.reason != null && message.hasOwnProperty("reason")) + object.reason = options.enums === String ? $root.google.ai.generativelanguage.v1beta3.ContentFilter.BlockedReason[message.reason] === undefined ? message.reason : $root.google.ai.generativelanguage.v1beta3.ContentFilter.BlockedReason[message.reason] : message.reason; + if (message.message != null && message.hasOwnProperty("message")) { + object.message = message.message; + if (options.oneofs) + object._message = "message"; + } + return object; + }; - /** - * 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]]; - } + /** + * Converts this ContentFilter to JSON. + * @function toJSON + * @memberof google.ai.generativelanguage.v1beta3.ContentFilter + * @instance + * @returns {Object.} JSON object + */ + ContentFilter.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; - /** - * PythonSettings common. - * @member {google.api.ICommonLanguageSettings|null|undefined} common - * @memberof google.api.PythonSettings - * @instance - */ - PythonSettings.prototype.common = null; + /** + * Gets the default type url for ContentFilter + * @function getTypeUrl + * @memberof google.ai.generativelanguage.v1beta3.ContentFilter + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ContentFilter.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.ai.generativelanguage.v1beta3.ContentFilter"; + }; - /** - * 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); - }; + /** + * BlockedReason enum. + * @name google.ai.generativelanguage.v1beta3.ContentFilter.BlockedReason + * @enum {number} + * @property {number} BLOCKED_REASON_UNSPECIFIED=0 BLOCKED_REASON_UNSPECIFIED value + * @property {number} SAFETY=1 SAFETY value + * @property {number} OTHER=2 OTHER value + */ + ContentFilter.BlockedReason = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "BLOCKED_REASON_UNSPECIFIED"] = 0; + values[valuesById[1] = "SAFETY"] = 1; + values[valuesById[2] = "OTHER"] = 2; + return values; + })(); - /** - * 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(); - }; + return ContentFilter; + })(); - /** - * 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) { - 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(); - switch (tag >>> 3) { - case 1: { - message.common = $root.google.api.CommonLanguageSettings.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; + v1beta3.SafetyFeedback = (function() { - /** - * 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()); - }; + /** + * Properties of a SafetyFeedback. + * @memberof google.ai.generativelanguage.v1beta3 + * @interface ISafetyFeedback + * @property {google.ai.generativelanguage.v1beta3.ISafetyRating|null} [rating] SafetyFeedback rating + * @property {google.ai.generativelanguage.v1beta3.ISafetySetting|null} [setting] SafetyFeedback setting + */ - /** - * 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; - }; + /** + * Constructs a new SafetyFeedback. + * @memberof google.ai.generativelanguage.v1beta3 + * @classdesc Represents a SafetyFeedback. + * @implements ISafetyFeedback + * @constructor + * @param {google.ai.generativelanguage.v1beta3.ISafetyFeedback=} [properties] Properties to set + */ + function SafetyFeedback(properties) { + if (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 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; - }; + /** + * SafetyFeedback rating. + * @member {google.ai.generativelanguage.v1beta3.ISafetyRating|null|undefined} rating + * @memberof google.ai.generativelanguage.v1beta3.SafetyFeedback + * @instance + */ + SafetyFeedback.prototype.rating = null; - /** - * 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; - }; + /** + * SafetyFeedback setting. + * @member {google.ai.generativelanguage.v1beta3.ISafetySetting|null|undefined} setting + * @memberof google.ai.generativelanguage.v1beta3.SafetyFeedback + * @instance + */ + SafetyFeedback.prototype.setting = null; - /** - * 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); - }; + /** + * Creates a new SafetyFeedback instance using the specified properties. + * @function create + * @memberof google.ai.generativelanguage.v1beta3.SafetyFeedback + * @static + * @param {google.ai.generativelanguage.v1beta3.ISafetyFeedback=} [properties] Properties to set + * @returns {google.ai.generativelanguage.v1beta3.SafetyFeedback} SafetyFeedback instance + */ + SafetyFeedback.create = function create(properties) { + return new SafetyFeedback(properties); + }; - /** - * 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"; - }; + /** + * Encodes the specified SafetyFeedback message. Does not implicitly {@link google.ai.generativelanguage.v1beta3.SafetyFeedback.verify|verify} messages. + * @function encode + * @memberof google.ai.generativelanguage.v1beta3.SafetyFeedback + * @static + * @param {google.ai.generativelanguage.v1beta3.ISafetyFeedback} message SafetyFeedback message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SafetyFeedback.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.rating != null && Object.hasOwnProperty.call(message, "rating")) + $root.google.ai.generativelanguage.v1beta3.SafetyRating.encode(message.rating, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.setting != null && Object.hasOwnProperty.call(message, "setting")) + $root.google.ai.generativelanguage.v1beta3.SafetySetting.encode(message.setting, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; - return PythonSettings; - })(); + /** + * Encodes the specified SafetyFeedback message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1beta3.SafetyFeedback.verify|verify} messages. + * @function encodeDelimited + * @memberof google.ai.generativelanguage.v1beta3.SafetyFeedback + * @static + * @param {google.ai.generativelanguage.v1beta3.ISafetyFeedback} message SafetyFeedback message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SafetyFeedback.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; - api.NodeSettings = (function() { + /** + * Decodes a SafetyFeedback message from the specified reader or buffer. + * @function decode + * @memberof google.ai.generativelanguage.v1beta3.SafetyFeedback + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.ai.generativelanguage.v1beta3.SafetyFeedback} SafetyFeedback + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SafetyFeedback.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.ai.generativelanguage.v1beta3.SafetyFeedback(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.rating = $root.google.ai.generativelanguage.v1beta3.SafetyRating.decode(reader, reader.uint32()); + break; + } + case 2: { + message.setting = $root.google.ai.generativelanguage.v1beta3.SafetySetting.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; - /** - * Properties of a NodeSettings. - * @memberof google.api - * @interface INodeSettings - * @property {google.api.ICommonLanguageSettings|null} [common] NodeSettings common - */ + /** + * Decodes a SafetyFeedback message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.ai.generativelanguage.v1beta3.SafetyFeedback + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.ai.generativelanguage.v1beta3.SafetyFeedback} SafetyFeedback + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SafetyFeedback.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; - /** - * 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; + /** + * Verifies a SafetyFeedback message. + * @function verify + * @memberof google.ai.generativelanguage.v1beta3.SafetyFeedback + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + SafetyFeedback.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.rating != null && message.hasOwnProperty("rating")) { + var error = $root.google.ai.generativelanguage.v1beta3.SafetyRating.verify(message.rating); + if (error) + return "rating." + error; + } + if (message.setting != null && message.hasOwnProperty("setting")) { + var error = $root.google.ai.generativelanguage.v1beta3.SafetySetting.verify(message.setting); + if (error) + return "setting." + error; + } + return 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); - }; + /** + * Creates a SafetyFeedback message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.ai.generativelanguage.v1beta3.SafetyFeedback + * @static + * @param {Object.} object Plain object + * @returns {google.ai.generativelanguage.v1beta3.SafetyFeedback} SafetyFeedback + */ + SafetyFeedback.fromObject = function fromObject(object) { + if (object instanceof $root.google.ai.generativelanguage.v1beta3.SafetyFeedback) + return object; + var message = new $root.google.ai.generativelanguage.v1beta3.SafetyFeedback(); + if (object.rating != null) { + if (typeof object.rating !== "object") + throw TypeError(".google.ai.generativelanguage.v1beta3.SafetyFeedback.rating: object expected"); + message.rating = $root.google.ai.generativelanguage.v1beta3.SafetyRating.fromObject(object.rating); + } + if (object.setting != null) { + if (typeof object.setting !== "object") + throw TypeError(".google.ai.generativelanguage.v1beta3.SafetyFeedback.setting: object expected"); + message.setting = $root.google.ai.generativelanguage.v1beta3.SafetySetting.fromObject(object.setting); + } + return message; + }; - /** - * 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; - }; + /** + * Creates a plain object from a SafetyFeedback message. Also converts values to other types if specified. + * @function toObject + * @memberof google.ai.generativelanguage.v1beta3.SafetyFeedback + * @static + * @param {google.ai.generativelanguage.v1beta3.SafetyFeedback} message SafetyFeedback + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + SafetyFeedback.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.rating = null; + object.setting = null; + } + if (message.rating != null && message.hasOwnProperty("rating")) + object.rating = $root.google.ai.generativelanguage.v1beta3.SafetyRating.toObject(message.rating, options); + if (message.setting != null && message.hasOwnProperty("setting")) + object.setting = $root.google.ai.generativelanguage.v1beta3.SafetySetting.toObject(message.setting, options); + return object; + }; - /** - * 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(); - }; + /** + * Converts this SafetyFeedback to JSON. + * @function toJSON + * @memberof google.ai.generativelanguage.v1beta3.SafetyFeedback + * @instance + * @returns {Object.} JSON object + */ + SafetyFeedback.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; - /** - * 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) { - 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(); - switch (tag >>> 3) { - case 1: { - message.common = $root.google.api.CommonLanguageSettings.decode(reader, reader.uint32()); - break; + /** + * Gets the default type url for SafetyFeedback + * @function getTypeUrl + * @memberof google.ai.generativelanguage.v1beta3.SafetyFeedback + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + SafetyFeedback.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; + return typeUrlPrefix + "/google.ai.generativelanguage.v1beta3.SafetyFeedback"; + }; - /** - * 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()); - }; + return SafetyFeedback; + })(); - /** - * 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; - }; + v1beta3.SafetyRating = (function() { - /** - * 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; - }; + /** + * Properties of a SafetyRating. + * @memberof google.ai.generativelanguage.v1beta3 + * @interface ISafetyRating + * @property {google.ai.generativelanguage.v1beta3.HarmCategory|null} [category] SafetyRating category + * @property {google.ai.generativelanguage.v1beta3.SafetyRating.HarmProbability|null} [probability] SafetyRating probability + */ - /** - * 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; - }; + /** + * Constructs a new SafetyRating. + * @memberof google.ai.generativelanguage.v1beta3 + * @classdesc Represents a SafetyRating. + * @implements ISafetyRating + * @constructor + * @param {google.ai.generativelanguage.v1beta3.ISafetyRating=} [properties] Properties to set + */ + function SafetyRating(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } - /** - * 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; - })(); + /** + * SafetyRating category. + * @member {google.ai.generativelanguage.v1beta3.HarmCategory} category + * @memberof google.ai.generativelanguage.v1beta3.SafetyRating + * @instance + */ + SafetyRating.prototype.category = 0; - api.DotnetSettings = (function() { + /** + * SafetyRating probability. + * @member {google.ai.generativelanguage.v1beta3.SafetyRating.HarmProbability} probability + * @memberof google.ai.generativelanguage.v1beta3.SafetyRating + * @instance + */ + SafetyRating.prototype.probability = 0; - /** - * Properties of a DotnetSettings. - * @memberof google.api - * @interface IDotnetSettings - * @property {google.api.ICommonLanguageSettings|null} [common] DotnetSettings common - */ + /** + * Creates a new SafetyRating instance using the specified properties. + * @function create + * @memberof google.ai.generativelanguage.v1beta3.SafetyRating + * @static + * @param {google.ai.generativelanguage.v1beta3.ISafetyRating=} [properties] Properties to set + * @returns {google.ai.generativelanguage.v1beta3.SafetyRating} SafetyRating instance + */ + SafetyRating.create = function create(properties) { + return new SafetyRating(properties); + }; - /** - * 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) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } + /** + * Encodes the specified SafetyRating message. Does not implicitly {@link google.ai.generativelanguage.v1beta3.SafetyRating.verify|verify} messages. + * @function encode + * @memberof google.ai.generativelanguage.v1beta3.SafetyRating + * @static + * @param {google.ai.generativelanguage.v1beta3.ISafetyRating} message SafetyRating message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SafetyRating.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.category != null && Object.hasOwnProperty.call(message, "category")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.category); + if (message.probability != null && Object.hasOwnProperty.call(message, "probability")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.probability); + return writer; + }; - /** - * DotnetSettings common. - * @member {google.api.ICommonLanguageSettings|null|undefined} common - * @memberof google.api.DotnetSettings - * @instance - */ - DotnetSettings.prototype.common = null; + /** + * Encodes the specified SafetyRating message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1beta3.SafetyRating.verify|verify} messages. + * @function encodeDelimited + * @memberof google.ai.generativelanguage.v1beta3.SafetyRating + * @static + * @param {google.ai.generativelanguage.v1beta3.ISafetyRating} message SafetyRating message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SafetyRating.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; - /** - * 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); - }; + /** + * Decodes a SafetyRating message from the specified reader or buffer. + * @function decode + * @memberof google.ai.generativelanguage.v1beta3.SafetyRating + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.ai.generativelanguage.v1beta3.SafetyRating} SafetyRating + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SafetyRating.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.ai.generativelanguage.v1beta3.SafetyRating(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 3: { + message.category = reader.int32(); + break; + } + case 4: { + message.probability = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; - /** - * 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(); - return writer; - }; + /** + * Decodes a SafetyRating message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.ai.generativelanguage.v1beta3.SafetyRating + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.ai.generativelanguage.v1beta3.SafetyRating} SafetyRating + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SafetyRating.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; - /** - * 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(); - }; + /** + * Verifies a SafetyRating message. + * @function verify + * @memberof google.ai.generativelanguage.v1beta3.SafetyRating + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + SafetyRating.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.category != null && message.hasOwnProperty("category")) + switch (message.category) { + default: + return "category: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + case 5: + case 6: + break; + } + if (message.probability != null && message.hasOwnProperty("probability")) + switch (message.probability) { + default: + return "probability: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + break; + } + return null; + }; - /** - * 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) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.DotnetSettings(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - message.common = $root.google.api.CommonLanguageSettings.decode(reader, reader.uint32()); + /** + * Creates a SafetyRating message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.ai.generativelanguage.v1beta3.SafetyRating + * @static + * @param {Object.} object Plain object + * @returns {google.ai.generativelanguage.v1beta3.SafetyRating} SafetyRating + */ + SafetyRating.fromObject = function fromObject(object) { + if (object instanceof $root.google.ai.generativelanguage.v1beta3.SafetyRating) + return object; + var message = new $root.google.ai.generativelanguage.v1beta3.SafetyRating(); + switch (object.category) { + default: + if (typeof object.category === "number") { + message.category = object.category; + break; + } 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()); - }; + case "HARM_CATEGORY_UNSPECIFIED": + case 0: + message.category = 0; + break; + case "HARM_CATEGORY_DEROGATORY": + case 1: + message.category = 1; + break; + case "HARM_CATEGORY_TOXICITY": + case 2: + message.category = 2; + break; + case "HARM_CATEGORY_VIOLENCE": + case 3: + message.category = 3; + break; + case "HARM_CATEGORY_SEXUAL": + case 4: + message.category = 4; + break; + case "HARM_CATEGORY_MEDICAL": + case 5: + message.category = 5; + break; + case "HARM_CATEGORY_DANGEROUS": + case 6: + message.category = 6; + break; + } + switch (object.probability) { + default: + if (typeof object.probability === "number") { + message.probability = object.probability; + break; + } + break; + case "HARM_PROBABILITY_UNSPECIFIED": + case 0: + message.probability = 0; + break; + case "NEGLIGIBLE": + case 1: + message.probability = 1; + break; + case "LOW": + case 2: + message.probability = 2; + break; + case "MEDIUM": + case 3: + message.probability = 3; + break; + case "HIGH": + case 4: + message.probability = 4; + break; + } + return message; + }; - /** - * 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; - } - return null; - }; + /** + * Creates a plain object from a SafetyRating message. Also converts values to other types if specified. + * @function toObject + * @memberof google.ai.generativelanguage.v1beta3.SafetyRating + * @static + * @param {google.ai.generativelanguage.v1beta3.SafetyRating} message SafetyRating + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + SafetyRating.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.category = options.enums === String ? "HARM_CATEGORY_UNSPECIFIED" : 0; + object.probability = options.enums === String ? "HARM_PROBABILITY_UNSPECIFIED" : 0; + } + if (message.category != null && message.hasOwnProperty("category")) + object.category = options.enums === String ? $root.google.ai.generativelanguage.v1beta3.HarmCategory[message.category] === undefined ? message.category : $root.google.ai.generativelanguage.v1beta3.HarmCategory[message.category] : message.category; + if (message.probability != null && message.hasOwnProperty("probability")) + object.probability = options.enums === String ? $root.google.ai.generativelanguage.v1beta3.SafetyRating.HarmProbability[message.probability] === undefined ? message.probability : $root.google.ai.generativelanguage.v1beta3.SafetyRating.HarmProbability[message.probability] : message.probability; + return object; + }; - /** - * 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); - } - return message; - }; + /** + * Converts this SafetyRating to JSON. + * @function toJSON + * @memberof google.ai.generativelanguage.v1beta3.SafetyRating + * @instance + * @returns {Object.} JSON object + */ + SafetyRating.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; - /** - * 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.defaults) - object.common = null; - if (message.common != null && message.hasOwnProperty("common")) - object.common = $root.google.api.CommonLanguageSettings.toObject(message.common, options); - return object; - }; + /** + * Gets the default type url for SafetyRating + * @function getTypeUrl + * @memberof google.ai.generativelanguage.v1beta3.SafetyRating + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + SafetyRating.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.ai.generativelanguage.v1beta3.SafetyRating"; + }; - /** - * 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); - }; + /** + * HarmProbability enum. + * @name google.ai.generativelanguage.v1beta3.SafetyRating.HarmProbability + * @enum {number} + * @property {number} HARM_PROBABILITY_UNSPECIFIED=0 HARM_PROBABILITY_UNSPECIFIED value + * @property {number} NEGLIGIBLE=1 NEGLIGIBLE value + * @property {number} LOW=2 LOW value + * @property {number} MEDIUM=3 MEDIUM value + * @property {number} HIGH=4 HIGH value + */ + SafetyRating.HarmProbability = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "HARM_PROBABILITY_UNSPECIFIED"] = 0; + values[valuesById[1] = "NEGLIGIBLE"] = 1; + values[valuesById[2] = "LOW"] = 2; + values[valuesById[3] = "MEDIUM"] = 3; + values[valuesById[4] = "HIGH"] = 4; + return values; + })(); - /** - * 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 SafetyRating; + })(); - return DotnetSettings; - })(); + v1beta3.SafetySetting = (function() { - api.RubySettings = (function() { + /** + * Properties of a SafetySetting. + * @memberof google.ai.generativelanguage.v1beta3 + * @interface ISafetySetting + * @property {google.ai.generativelanguage.v1beta3.HarmCategory|null} [category] SafetySetting category + * @property {google.ai.generativelanguage.v1beta3.SafetySetting.HarmBlockThreshold|null} [threshold] SafetySetting threshold + */ - /** - * Properties of a RubySettings. - * @memberof google.api - * @interface IRubySettings - * @property {google.api.ICommonLanguageSettings|null} [common] RubySettings common - */ + /** + * Constructs a new SafetySetting. + * @memberof google.ai.generativelanguage.v1beta3 + * @classdesc Represents a SafetySetting. + * @implements ISafetySetting + * @constructor + * @param {google.ai.generativelanguage.v1beta3.ISafetySetting=} [properties] Properties to set + */ + function SafetySetting(properties) { + if (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 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]]; - } + /** + * SafetySetting category. + * @member {google.ai.generativelanguage.v1beta3.HarmCategory} category + * @memberof google.ai.generativelanguage.v1beta3.SafetySetting + * @instance + */ + SafetySetting.prototype.category = 0; - /** - * RubySettings common. - * @member {google.api.ICommonLanguageSettings|null|undefined} common - * @memberof google.api.RubySettings - * @instance - */ - RubySettings.prototype.common = null; + /** + * SafetySetting threshold. + * @member {google.ai.generativelanguage.v1beta3.SafetySetting.HarmBlockThreshold} threshold + * @memberof google.ai.generativelanguage.v1beta3.SafetySetting + * @instance + */ + SafetySetting.prototype.threshold = 0; - /** - * 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); - }; + /** + * Creates a new SafetySetting instance using the specified properties. + * @function create + * @memberof google.ai.generativelanguage.v1beta3.SafetySetting + * @static + * @param {google.ai.generativelanguage.v1beta3.ISafetySetting=} [properties] Properties to set + * @returns {google.ai.generativelanguage.v1beta3.SafetySetting} SafetySetting instance + */ + SafetySetting.create = function create(properties) { + return new SafetySetting(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 SafetySetting message. Does not implicitly {@link google.ai.generativelanguage.v1beta3.SafetySetting.verify|verify} messages. + * @function encode + * @memberof google.ai.generativelanguage.v1beta3.SafetySetting + * @static + * @param {google.ai.generativelanguage.v1beta3.ISafetySetting} message SafetySetting message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SafetySetting.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.category != null && Object.hasOwnProperty.call(message, "category")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.category); + if (message.threshold != null && Object.hasOwnProperty.call(message, "threshold")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.threshold); + 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(); - }; + /** + * Encodes the specified SafetySetting message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1beta3.SafetySetting.verify|verify} messages. + * @function encodeDelimited + * @memberof google.ai.generativelanguage.v1beta3.SafetySetting + * @static + * @param {google.ai.generativelanguage.v1beta3.ISafetySetting} message SafetySetting message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SafetySetting.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) { - 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(); - switch (tag >>> 3) { - case 1: { - message.common = $root.google.api.CommonLanguageSettings.decode(reader, reader.uint32()); - break; + /** + * Decodes a SafetySetting message from the specified reader or buffer. + * @function decode + * @memberof google.ai.generativelanguage.v1beta3.SafetySetting + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.ai.generativelanguage.v1beta3.SafetySetting} SafetySetting + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SafetySetting.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.ai.generativelanguage.v1beta3.SafetySetting(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 3: { + message.category = reader.int32(); + break; + } + case 4: { + message.threshold = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + 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()); - }; + return message; + }; - /** - * 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; - }; + /** + * Decodes a SafetySetting message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.ai.generativelanguage.v1beta3.SafetySetting + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.ai.generativelanguage.v1beta3.SafetySetting} SafetySetting + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SafetySetting.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; - /** - * 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; - }; + /** + * Verifies a SafetySetting message. + * @function verify + * @memberof google.ai.generativelanguage.v1beta3.SafetySetting + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + SafetySetting.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.category != null && message.hasOwnProperty("category")) + switch (message.category) { + default: + return "category: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + case 5: + case 6: + break; + } + if (message.threshold != null && message.hasOwnProperty("threshold")) + switch (message.threshold) { + default: + return "threshold: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + break; + } + return null; + }; - /** - * 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; - }; + /** + * Creates a SafetySetting message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.ai.generativelanguage.v1beta3.SafetySetting + * @static + * @param {Object.} object Plain object + * @returns {google.ai.generativelanguage.v1beta3.SafetySetting} SafetySetting + */ + SafetySetting.fromObject = function fromObject(object) { + if (object instanceof $root.google.ai.generativelanguage.v1beta3.SafetySetting) + return object; + var message = new $root.google.ai.generativelanguage.v1beta3.SafetySetting(); + switch (object.category) { + default: + if (typeof object.category === "number") { + message.category = object.category; + break; + } + break; + case "HARM_CATEGORY_UNSPECIFIED": + case 0: + message.category = 0; + break; + case "HARM_CATEGORY_DEROGATORY": + case 1: + message.category = 1; + break; + case "HARM_CATEGORY_TOXICITY": + case 2: + message.category = 2; + break; + case "HARM_CATEGORY_VIOLENCE": + case 3: + message.category = 3; + break; + case "HARM_CATEGORY_SEXUAL": + case 4: + message.category = 4; + break; + case "HARM_CATEGORY_MEDICAL": + case 5: + message.category = 5; + break; + case "HARM_CATEGORY_DANGEROUS": + case 6: + message.category = 6; + break; + } + switch (object.threshold) { + default: + if (typeof object.threshold === "number") { + message.threshold = object.threshold; + break; + } + break; + case "HARM_BLOCK_THRESHOLD_UNSPECIFIED": + case 0: + message.threshold = 0; + break; + case "BLOCK_LOW_AND_ABOVE": + case 1: + message.threshold = 1; + break; + case "BLOCK_MEDIUM_AND_ABOVE": + case 2: + message.threshold = 2; + break; + case "BLOCK_ONLY_HIGH": + case 3: + message.threshold = 3; + break; + case "BLOCK_NONE": + case 4: + message.threshold = 4; + break; + } + return message; + }; - /** - * 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); - }; + /** + * Creates a plain object from a SafetySetting message. Also converts values to other types if specified. + * @function toObject + * @memberof google.ai.generativelanguage.v1beta3.SafetySetting + * @static + * @param {google.ai.generativelanguage.v1beta3.SafetySetting} message SafetySetting + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + SafetySetting.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.category = options.enums === String ? "HARM_CATEGORY_UNSPECIFIED" : 0; + object.threshold = options.enums === String ? "HARM_BLOCK_THRESHOLD_UNSPECIFIED" : 0; + } + if (message.category != null && message.hasOwnProperty("category")) + object.category = options.enums === String ? $root.google.ai.generativelanguage.v1beta3.HarmCategory[message.category] === undefined ? message.category : $root.google.ai.generativelanguage.v1beta3.HarmCategory[message.category] : message.category; + if (message.threshold != null && message.hasOwnProperty("threshold")) + object.threshold = options.enums === String ? $root.google.ai.generativelanguage.v1beta3.SafetySetting.HarmBlockThreshold[message.threshold] === undefined ? message.threshold : $root.google.ai.generativelanguage.v1beta3.SafetySetting.HarmBlockThreshold[message.threshold] : message.threshold; + return object; + }; - /** - * 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"; - }; + /** + * Converts this SafetySetting to JSON. + * @function toJSON + * @memberof google.ai.generativelanguage.v1beta3.SafetySetting + * @instance + * @returns {Object.} JSON object + */ + SafetySetting.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; - return RubySettings; - })(); + /** + * Gets the default type url for SafetySetting + * @function getTypeUrl + * @memberof google.ai.generativelanguage.v1beta3.SafetySetting + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + SafetySetting.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.ai.generativelanguage.v1beta3.SafetySetting"; + }; - api.GoSettings = (function() { + /** + * HarmBlockThreshold enum. + * @name google.ai.generativelanguage.v1beta3.SafetySetting.HarmBlockThreshold + * @enum {number} + * @property {number} HARM_BLOCK_THRESHOLD_UNSPECIFIED=0 HARM_BLOCK_THRESHOLD_UNSPECIFIED value + * @property {number} BLOCK_LOW_AND_ABOVE=1 BLOCK_LOW_AND_ABOVE value + * @property {number} BLOCK_MEDIUM_AND_ABOVE=2 BLOCK_MEDIUM_AND_ABOVE value + * @property {number} BLOCK_ONLY_HIGH=3 BLOCK_ONLY_HIGH value + * @property {number} BLOCK_NONE=4 BLOCK_NONE value + */ + SafetySetting.HarmBlockThreshold = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "HARM_BLOCK_THRESHOLD_UNSPECIFIED"] = 0; + values[valuesById[1] = "BLOCK_LOW_AND_ABOVE"] = 1; + values[valuesById[2] = "BLOCK_MEDIUM_AND_ABOVE"] = 2; + values[valuesById[3] = "BLOCK_ONLY_HIGH"] = 3; + values[valuesById[4] = "BLOCK_NONE"] = 4; + return values; + })(); - /** - * Properties of a GoSettings. - * @memberof google.api - * @interface IGoSettings - * @property {google.api.ICommonLanguageSettings|null} [common] GoSettings common - */ + return SafetySetting; + })(); - /** - * 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]]; - } + v1beta3.Model = (function() { - /** - * GoSettings common. - * @member {google.api.ICommonLanguageSettings|null|undefined} common - * @memberof google.api.GoSettings - * @instance - */ - GoSettings.prototype.common = null; + /** + * Properties of a Model. + * @memberof google.ai.generativelanguage.v1beta3 + * @interface IModel + * @property {string|null} [name] Model name + * @property {string|null} [baseModelId] Model baseModelId + * @property {string|null} [version] Model version + * @property {string|null} [displayName] Model displayName + * @property {string|null} [description] Model description + * @property {number|null} [inputTokenLimit] Model inputTokenLimit + * @property {number|null} [outputTokenLimit] Model outputTokenLimit + * @property {Array.|null} [supportedGenerationMethods] Model supportedGenerationMethods + * @property {number|null} [temperature] Model temperature + * @property {number|null} [topP] Model topP + * @property {number|null} [topK] Model topK + */ - /** - * 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); - }; + /** + * Constructs a new Model. + * @memberof google.ai.generativelanguage.v1beta3 + * @classdesc Represents a Model. + * @implements IModel + * @constructor + * @param {google.ai.generativelanguage.v1beta3.IModel=} [properties] Properties to set + */ + function Model(properties) { + this.supportedGenerationMethods = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } - /** - * 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; - }; + /** + * Model name. + * @member {string} name + * @memberof google.ai.generativelanguage.v1beta3.Model + * @instance + */ + Model.prototype.name = ""; - /** - * 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(); - }; + /** + * Model baseModelId. + * @member {string} baseModelId + * @memberof google.ai.generativelanguage.v1beta3.Model + * @instance + */ + Model.prototype.baseModelId = ""; - /** - * 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) { - 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(); - switch (tag >>> 3) { - case 1: { - message.common = $root.google.api.CommonLanguageSettings.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; + /** + * Model version. + * @member {string} version + * @memberof google.ai.generativelanguage.v1beta3.Model + * @instance + */ + Model.prototype.version = ""; - /** - * 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()); - }; + /** + * Model displayName. + * @member {string} displayName + * @memberof google.ai.generativelanguage.v1beta3.Model + * @instance + */ + Model.prototype.displayName = ""; - /** - * 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; - }; + /** + * Model description. + * @member {string} description + * @memberof google.ai.generativelanguage.v1beta3.Model + * @instance + */ + Model.prototype.description = ""; - /** - * 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; - }; + /** + * Model inputTokenLimit. + * @member {number} inputTokenLimit + * @memberof google.ai.generativelanguage.v1beta3.Model + * @instance + */ + Model.prototype.inputTokenLimit = 0; - /** - * 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; - }; + /** + * Model outputTokenLimit. + * @member {number} outputTokenLimit + * @memberof google.ai.generativelanguage.v1beta3.Model + * @instance + */ + Model.prototype.outputTokenLimit = 0; - /** - * 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); - }; + /** + * Model supportedGenerationMethods. + * @member {Array.} supportedGenerationMethods + * @memberof google.ai.generativelanguage.v1beta3.Model + * @instance + */ + Model.prototype.supportedGenerationMethods = $util.emptyArray; - /** - * 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"; - }; + /** + * Model temperature. + * @member {number|null|undefined} temperature + * @memberof google.ai.generativelanguage.v1beta3.Model + * @instance + */ + Model.prototype.temperature = null; - return GoSettings; - })(); + /** + * Model topP. + * @member {number|null|undefined} topP + * @memberof google.ai.generativelanguage.v1beta3.Model + * @instance + */ + Model.prototype.topP = null; - api.MethodSettings = (function() { + /** + * Model topK. + * @member {number|null|undefined} topK + * @memberof google.ai.generativelanguage.v1beta3.Model + * @instance + */ + Model.prototype.topK = null; - /** - * Properties of a MethodSettings. - * @memberof google.api - * @interface IMethodSettings - * @property {string|null} [selector] MethodSettings selector - * @property {google.api.MethodSettings.ILongRunning|null} [longRunning] MethodSettings longRunning - */ + // OneOf field names bound to virtual getters and setters + var $oneOfFields; - /** - * 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) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } + /** + * Model _temperature. + * @member {"temperature"|undefined} _temperature + * @memberof google.ai.generativelanguage.v1beta3.Model + * @instance + */ + Object.defineProperty(Model.prototype, "_temperature", { + get: $util.oneOfGetter($oneOfFields = ["temperature"]), + set: $util.oneOfSetter($oneOfFields) + }); - /** - * MethodSettings selector. - * @member {string} selector - * @memberof google.api.MethodSettings - * @instance - */ - MethodSettings.prototype.selector = ""; + /** + * Model _topP. + * @member {"topP"|undefined} _topP + * @memberof google.ai.generativelanguage.v1beta3.Model + * @instance + */ + Object.defineProperty(Model.prototype, "_topP", { + get: $util.oneOfGetter($oneOfFields = ["topP"]), + set: $util.oneOfSetter($oneOfFields) + }); - /** - * MethodSettings longRunning. - * @member {google.api.MethodSettings.ILongRunning|null|undefined} longRunning - * @memberof google.api.MethodSettings - * @instance - */ - MethodSettings.prototype.longRunning = null; + /** + * Model _topK. + * @member {"topK"|undefined} _topK + * @memberof google.ai.generativelanguage.v1beta3.Model + * @instance + */ + Object.defineProperty(Model.prototype, "_topK", { + get: $util.oneOfGetter($oneOfFields = ["topK"]), + set: $util.oneOfSetter($oneOfFields) + }); - /** - * 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); - }; + /** + * Creates a new Model instance using the specified properties. + * @function create + * @memberof google.ai.generativelanguage.v1beta3.Model + * @static + * @param {google.ai.generativelanguage.v1beta3.IModel=} [properties] Properties to set + * @returns {google.ai.generativelanguage.v1beta3.Model} Model instance + */ + Model.create = function create(properties) { + return new Model(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(); - return writer; - }; + /** + * Encodes the specified Model message. Does not implicitly {@link google.ai.generativelanguage.v1beta3.Model.verify|verify} messages. + * @function encode + * @memberof google.ai.generativelanguage.v1beta3.Model + * @static + * @param {google.ai.generativelanguage.v1beta3.IModel} message Model message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Model.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.baseModelId != null && Object.hasOwnProperty.call(message, "baseModelId")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.baseModelId); + if (message.version != null && Object.hasOwnProperty.call(message, "version")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.version); + if (message.displayName != null && Object.hasOwnProperty.call(message, "displayName")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.displayName); + if (message.description != null && Object.hasOwnProperty.call(message, "description")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.description); + if (message.inputTokenLimit != null && Object.hasOwnProperty.call(message, "inputTokenLimit")) + writer.uint32(/* id 6, wireType 0 =*/48).int32(message.inputTokenLimit); + if (message.outputTokenLimit != null && Object.hasOwnProperty.call(message, "outputTokenLimit")) + writer.uint32(/* id 7, wireType 0 =*/56).int32(message.outputTokenLimit); + if (message.supportedGenerationMethods != null && message.supportedGenerationMethods.length) + for (var i = 0; i < message.supportedGenerationMethods.length; ++i) + writer.uint32(/* id 8, wireType 2 =*/66).string(message.supportedGenerationMethods[i]); + if (message.temperature != null && Object.hasOwnProperty.call(message, "temperature")) + writer.uint32(/* id 9, wireType 5 =*/77).float(message.temperature); + if (message.topP != null && Object.hasOwnProperty.call(message, "topP")) + writer.uint32(/* id 10, wireType 5 =*/85).float(message.topP); + if (message.topK != null && Object.hasOwnProperty.call(message, "topK")) + writer.uint32(/* id 11, wireType 0 =*/88).int32(message.topK); + 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(); - }; + /** + * Encodes the specified Model message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1beta3.Model.verify|verify} messages. + * @function encodeDelimited + * @memberof google.ai.generativelanguage.v1beta3.Model + * @static + * @param {google.ai.generativelanguage.v1beta3.IModel} message Model message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Model.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) { - 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(); - switch (tag >>> 3) { - case 1: { - message.selector = reader.string(); - break; - } - case 2: { - message.longRunning = $root.google.api.MethodSettings.LongRunning.decode(reader, reader.uint32()); - break; + /** + * Decodes a Model message from the specified reader or buffer. + * @function decode + * @memberof google.ai.generativelanguage.v1beta3.Model + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.ai.generativelanguage.v1beta3.Model} Model + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Model.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.ai.generativelanguage.v1beta3.Model(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.baseModelId = reader.string(); + break; + } + case 3: { + message.version = reader.string(); + break; + } + case 4: { + message.displayName = reader.string(); + break; + } + case 5: { + message.description = reader.string(); + break; + } + case 6: { + message.inputTokenLimit = reader.int32(); + break; + } + case 7: { + message.outputTokenLimit = reader.int32(); + break; + } + case 8: { + if (!(message.supportedGenerationMethods && message.supportedGenerationMethods.length)) + message.supportedGenerationMethods = []; + message.supportedGenerationMethods.push(reader.string()); + break; + } + case 9: { + message.temperature = reader.float(); + break; + } + case 10: { + message.topP = reader.float(); + break; + } + case 11: { + message.topK = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + 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()); - }; + return message; + }; - /** - * 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; - } - return null; - }; + /** + * Decodes a Model message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.ai.generativelanguage.v1beta3.Model + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.ai.generativelanguage.v1beta3.Model} Model + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Model.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; - /** - * 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); - } - 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.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); - return object; - }; + /** + * Verifies a Model message. + * @function verify + * @memberof google.ai.generativelanguage.v1beta3.Model + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Model.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.baseModelId != null && message.hasOwnProperty("baseModelId")) + if (!$util.isString(message.baseModelId)) + return "baseModelId: string expected"; + if (message.version != null && message.hasOwnProperty("version")) + if (!$util.isString(message.version)) + return "version: string expected"; + if (message.displayName != null && message.hasOwnProperty("displayName")) + if (!$util.isString(message.displayName)) + return "displayName: string expected"; + if (message.description != null && message.hasOwnProperty("description")) + if (!$util.isString(message.description)) + return "description: string expected"; + if (message.inputTokenLimit != null && message.hasOwnProperty("inputTokenLimit")) + if (!$util.isInteger(message.inputTokenLimit)) + return "inputTokenLimit: integer expected"; + if (message.outputTokenLimit != null && message.hasOwnProperty("outputTokenLimit")) + if (!$util.isInteger(message.outputTokenLimit)) + return "outputTokenLimit: integer expected"; + if (message.supportedGenerationMethods != null && message.hasOwnProperty("supportedGenerationMethods")) { + if (!Array.isArray(message.supportedGenerationMethods)) + return "supportedGenerationMethods: array expected"; + for (var i = 0; i < message.supportedGenerationMethods.length; ++i) + if (!$util.isString(message.supportedGenerationMethods[i])) + return "supportedGenerationMethods: string[] expected"; + } + if (message.temperature != null && message.hasOwnProperty("temperature")) { + properties._temperature = 1; + if (typeof message.temperature !== "number") + return "temperature: number expected"; + } + if (message.topP != null && message.hasOwnProperty("topP")) { + properties._topP = 1; + if (typeof message.topP !== "number") + return "topP: number expected"; + } + if (message.topK != null && message.hasOwnProperty("topK")) { + properties._topK = 1; + if (!$util.isInteger(message.topK)) + return "topK: integer expected"; + } + return null; + }; - /** - * 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); - }; + /** + * Creates a Model message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.ai.generativelanguage.v1beta3.Model + * @static + * @param {Object.} object Plain object + * @returns {google.ai.generativelanguage.v1beta3.Model} Model + */ + Model.fromObject = function fromObject(object) { + if (object instanceof $root.google.ai.generativelanguage.v1beta3.Model) + return object; + var message = new $root.google.ai.generativelanguage.v1beta3.Model(); + if (object.name != null) + message.name = String(object.name); + if (object.baseModelId != null) + message.baseModelId = String(object.baseModelId); + if (object.version != null) + message.version = String(object.version); + if (object.displayName != null) + message.displayName = String(object.displayName); + if (object.description != null) + message.description = String(object.description); + if (object.inputTokenLimit != null) + message.inputTokenLimit = object.inputTokenLimit | 0; + if (object.outputTokenLimit != null) + message.outputTokenLimit = object.outputTokenLimit | 0; + if (object.supportedGenerationMethods) { + if (!Array.isArray(object.supportedGenerationMethods)) + throw TypeError(".google.ai.generativelanguage.v1beta3.Model.supportedGenerationMethods: array expected"); + message.supportedGenerationMethods = []; + for (var i = 0; i < object.supportedGenerationMethods.length; ++i) + message.supportedGenerationMethods[i] = String(object.supportedGenerationMethods[i]); + } + if (object.temperature != null) + message.temperature = Number(object.temperature); + if (object.topP != null) + message.topP = Number(object.topP); + if (object.topK != null) + message.topK = object.topK | 0; + return message; + }; - /** - * 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"; - }; + /** + * Creates a plain object from a Model message. Also converts values to other types if specified. + * @function toObject + * @memberof google.ai.generativelanguage.v1beta3.Model + * @static + * @param {google.ai.generativelanguage.v1beta3.Model} message Model + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Model.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.supportedGenerationMethods = []; + if (options.defaults) { + object.name = ""; + object.baseModelId = ""; + object.version = ""; + object.displayName = ""; + object.description = ""; + object.inputTokenLimit = 0; + object.outputTokenLimit = 0; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.baseModelId != null && message.hasOwnProperty("baseModelId")) + object.baseModelId = message.baseModelId; + if (message.version != null && message.hasOwnProperty("version")) + object.version = message.version; + if (message.displayName != null && message.hasOwnProperty("displayName")) + object.displayName = message.displayName; + if (message.description != null && message.hasOwnProperty("description")) + object.description = message.description; + if (message.inputTokenLimit != null && message.hasOwnProperty("inputTokenLimit")) + object.inputTokenLimit = message.inputTokenLimit; + if (message.outputTokenLimit != null && message.hasOwnProperty("outputTokenLimit")) + object.outputTokenLimit = message.outputTokenLimit; + if (message.supportedGenerationMethods && message.supportedGenerationMethods.length) { + object.supportedGenerationMethods = []; + for (var j = 0; j < message.supportedGenerationMethods.length; ++j) + object.supportedGenerationMethods[j] = message.supportedGenerationMethods[j]; + } + if (message.temperature != null && message.hasOwnProperty("temperature")) { + object.temperature = options.json && !isFinite(message.temperature) ? String(message.temperature) : message.temperature; + if (options.oneofs) + object._temperature = "temperature"; + } + if (message.topP != null && message.hasOwnProperty("topP")) { + object.topP = options.json && !isFinite(message.topP) ? String(message.topP) : message.topP; + if (options.oneofs) + object._topP = "topP"; + } + if (message.topK != null && message.hasOwnProperty("topK")) { + object.topK = message.topK; + if (options.oneofs) + object._topK = "topK"; + } + return object; + }; - MethodSettings.LongRunning = (function() { + /** + * Converts this Model to JSON. + * @function toJSON + * @memberof google.ai.generativelanguage.v1beta3.Model + * @instance + * @returns {Object.} JSON object + */ + Model.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; - /** - * 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 - */ + /** + * Gets the default type url for Model + * @function getTypeUrl + * @memberof google.ai.generativelanguage.v1beta3.Model + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Model.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.ai.generativelanguage.v1beta3.Model"; + }; - /** - * 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]]; - } + return Model; + })(); - /** - * LongRunning initialPollDelay. - * @member {google.protobuf.IDuration|null|undefined} initialPollDelay - * @memberof google.api.MethodSettings.LongRunning - * @instance - */ - LongRunning.prototype.initialPollDelay = null; + v1beta3.ModelService = (function() { - /** - * LongRunning pollDelayMultiplier. - * @member {number} pollDelayMultiplier - * @memberof google.api.MethodSettings.LongRunning - * @instance - */ - LongRunning.prototype.pollDelayMultiplier = 0; + /** + * Constructs a new ModelService service. + * @memberof google.ai.generativelanguage.v1beta3 + * @classdesc Represents a ModelService + * @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 ModelService(rpcImpl, requestDelimited, responseDelimited) { + $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); + } - /** - * LongRunning maxPollDelay. - * @member {google.protobuf.IDuration|null|undefined} maxPollDelay - * @memberof google.api.MethodSettings.LongRunning - * @instance - */ - LongRunning.prototype.maxPollDelay = null; + (ModelService.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = ModelService; - /** - * LongRunning totalPollTimeout. - * @member {google.protobuf.IDuration|null|undefined} totalPollTimeout - * @memberof google.api.MethodSettings.LongRunning - * @instance - */ - LongRunning.prototype.totalPollTimeout = null; + /** + * Creates new ModelService service using the specified rpc implementation. + * @function create + * @memberof google.ai.generativelanguage.v1beta3.ModelService + * @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 {ModelService} RPC service. Useful where requests and/or responses are streamed. + */ + ModelService.create = function create(rpcImpl, requestDelimited, responseDelimited) { + return new this(rpcImpl, requestDelimited, responseDelimited); + }; - /** - * 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); - }; + /** + * Callback as used by {@link google.ai.generativelanguage.v1beta3.ModelService|getModel}. + * @memberof google.ai.generativelanguage.v1beta3.ModelService + * @typedef GetModelCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.ai.generativelanguage.v1beta3.Model} [response] Model + */ - /** - * 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; - }; + /** + * Calls GetModel. + * @function getModel + * @memberof google.ai.generativelanguage.v1beta3.ModelService + * @instance + * @param {google.ai.generativelanguage.v1beta3.IGetModelRequest} request GetModelRequest message or plain object + * @param {google.ai.generativelanguage.v1beta3.ModelService.GetModelCallback} callback Node-style callback called with the error, if any, and Model + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(ModelService.prototype.getModel = function getModel(request, callback) { + return this.rpcCall(getModel, $root.google.ai.generativelanguage.v1beta3.GetModelRequest, $root.google.ai.generativelanguage.v1beta3.Model, request, callback); + }, "name", { value: "GetModel" }); - /** - * 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(); - }; + /** + * Calls GetModel. + * @function getModel + * @memberof google.ai.generativelanguage.v1beta3.ModelService + * @instance + * @param {google.ai.generativelanguage.v1beta3.IGetModelRequest} request GetModelRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ - /** - * 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) { - 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(); - 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; - }; + /** + * Callback as used by {@link google.ai.generativelanguage.v1beta3.ModelService|listModels}. + * @memberof google.ai.generativelanguage.v1beta3.ModelService + * @typedef ListModelsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.ai.generativelanguage.v1beta3.ListModelsResponse} [response] ListModelsResponse + */ - /** - * 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()); - }; + /** + * Calls ListModels. + * @function listModels + * @memberof google.ai.generativelanguage.v1beta3.ModelService + * @instance + * @param {google.ai.generativelanguage.v1beta3.IListModelsRequest} request ListModelsRequest message or plain object + * @param {google.ai.generativelanguage.v1beta3.ModelService.ListModelsCallback} callback Node-style callback called with the error, if any, and ListModelsResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(ModelService.prototype.listModels = function listModels(request, callback) { + return this.rpcCall(listModels, $root.google.ai.generativelanguage.v1beta3.ListModelsRequest, $root.google.ai.generativelanguage.v1beta3.ListModelsResponse, request, callback); + }, "name", { value: "ListModels" }); - /** - * 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; - }; + /** + * Calls ListModels. + * @function listModels + * @memberof google.ai.generativelanguage.v1beta3.ModelService + * @instance + * @param {google.ai.generativelanguage.v1beta3.IListModelsRequest} request ListModelsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ - /** - * 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; - }; + /** + * Callback as used by {@link google.ai.generativelanguage.v1beta3.ModelService|getTunedModel}. + * @memberof google.ai.generativelanguage.v1beta3.ModelService + * @typedef GetTunedModelCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.ai.generativelanguage.v1beta3.TunedModel} [response] TunedModel + */ - /** - * 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; - }; + /** + * Calls GetTunedModel. + * @function getTunedModel + * @memberof google.ai.generativelanguage.v1beta3.ModelService + * @instance + * @param {google.ai.generativelanguage.v1beta3.IGetTunedModelRequest} request GetTunedModelRequest message or plain object + * @param {google.ai.generativelanguage.v1beta3.ModelService.GetTunedModelCallback} callback Node-style callback called with the error, if any, and TunedModel + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(ModelService.prototype.getTunedModel = function getTunedModel(request, callback) { + return this.rpcCall(getTunedModel, $root.google.ai.generativelanguage.v1beta3.GetTunedModelRequest, $root.google.ai.generativelanguage.v1beta3.TunedModel, request, callback); + }, "name", { value: "GetTunedModel" }); - /** - * 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); - }; + /** + * Calls GetTunedModel. + * @function getTunedModel + * @memberof google.ai.generativelanguage.v1beta3.ModelService + * @instance + * @param {google.ai.generativelanguage.v1beta3.IGetTunedModelRequest} request GetTunedModelRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ - /** - * 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"; - }; + /** + * Callback as used by {@link google.ai.generativelanguage.v1beta3.ModelService|listTunedModels}. + * @memberof google.ai.generativelanguage.v1beta3.ModelService + * @typedef ListTunedModelsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.ai.generativelanguage.v1beta3.ListTunedModelsResponse} [response] ListTunedModelsResponse + */ - return LongRunning; - })(); + /** + * Calls ListTunedModels. + * @function listTunedModels + * @memberof google.ai.generativelanguage.v1beta3.ModelService + * @instance + * @param {google.ai.generativelanguage.v1beta3.IListTunedModelsRequest} request ListTunedModelsRequest message or plain object + * @param {google.ai.generativelanguage.v1beta3.ModelService.ListTunedModelsCallback} callback Node-style callback called with the error, if any, and ListTunedModelsResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(ModelService.prototype.listTunedModels = function listTunedModels(request, callback) { + return this.rpcCall(listTunedModels, $root.google.ai.generativelanguage.v1beta3.ListTunedModelsRequest, $root.google.ai.generativelanguage.v1beta3.ListTunedModelsResponse, request, callback); + }, "name", { value: "ListTunedModels" }); - return MethodSettings; - })(); + /** + * Calls ListTunedModels. + * @function listTunedModels + * @memberof google.ai.generativelanguage.v1beta3.ModelService + * @instance + * @param {google.ai.generativelanguage.v1beta3.IListTunedModelsRequest} request ListTunedModelsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ - /** - * 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 - */ - 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; - return values; - })(); + /** + * Callback as used by {@link google.ai.generativelanguage.v1beta3.ModelService|createTunedModel}. + * @memberof google.ai.generativelanguage.v1beta3.ModelService + * @typedef CreateTunedModelCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ - /** - * 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; - })(); + /** + * Calls CreateTunedModel. + * @function createTunedModel + * @memberof google.ai.generativelanguage.v1beta3.ModelService + * @instance + * @param {google.ai.generativelanguage.v1beta3.ICreateTunedModelRequest} request CreateTunedModelRequest message or plain object + * @param {google.ai.generativelanguage.v1beta3.ModelService.CreateTunedModelCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(ModelService.prototype.createTunedModel = function createTunedModel(request, callback) { + return this.rpcCall(createTunedModel, $root.google.ai.generativelanguage.v1beta3.CreateTunedModelRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "CreateTunedModel" }); - /** - * 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; - })(); + /** + * Calls CreateTunedModel. + * @function createTunedModel + * @memberof google.ai.generativelanguage.v1beta3.ModelService + * @instance + * @param {google.ai.generativelanguage.v1beta3.ICreateTunedModelRequest} request CreateTunedModelRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ - api.ResourceDescriptor = (function() { + /** + * Callback as used by {@link google.ai.generativelanguage.v1beta3.ModelService|updateTunedModel}. + * @memberof google.ai.generativelanguage.v1beta3.ModelService + * @typedef UpdateTunedModelCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.ai.generativelanguage.v1beta3.TunedModel} [response] TunedModel + */ - /** - * 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 - */ + /** + * Calls UpdateTunedModel. + * @function updateTunedModel + * @memberof google.ai.generativelanguage.v1beta3.ModelService + * @instance + * @param {google.ai.generativelanguage.v1beta3.IUpdateTunedModelRequest} request UpdateTunedModelRequest message or plain object + * @param {google.ai.generativelanguage.v1beta3.ModelService.UpdateTunedModelCallback} callback Node-style callback called with the error, if any, and TunedModel + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(ModelService.prototype.updateTunedModel = function updateTunedModel(request, callback) { + return this.rpcCall(updateTunedModel, $root.google.ai.generativelanguage.v1beta3.UpdateTunedModelRequest, $root.google.ai.generativelanguage.v1beta3.TunedModel, request, callback); + }, "name", { value: "UpdateTunedModel" }); - /** - * 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]]; - } + /** + * Calls UpdateTunedModel. + * @function updateTunedModel + * @memberof google.ai.generativelanguage.v1beta3.ModelService + * @instance + * @param {google.ai.generativelanguage.v1beta3.IUpdateTunedModelRequest} request UpdateTunedModelRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ - /** - * ResourceDescriptor type. - * @member {string} type - * @memberof google.api.ResourceDescriptor - * @instance - */ - ResourceDescriptor.prototype.type = ""; + /** + * Callback as used by {@link google.ai.generativelanguage.v1beta3.ModelService|deleteTunedModel}. + * @memberof google.ai.generativelanguage.v1beta3.ModelService + * @typedef DeleteTunedModelCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.protobuf.Empty} [response] Empty + */ - /** - * ResourceDescriptor pattern. - * @member {Array.} pattern - * @memberof google.api.ResourceDescriptor - * @instance - */ - ResourceDescriptor.prototype.pattern = $util.emptyArray; + /** + * Calls DeleteTunedModel. + * @function deleteTunedModel + * @memberof google.ai.generativelanguage.v1beta3.ModelService + * @instance + * @param {google.ai.generativelanguage.v1beta3.IDeleteTunedModelRequest} request DeleteTunedModelRequest message or plain object + * @param {google.ai.generativelanguage.v1beta3.ModelService.DeleteTunedModelCallback} callback Node-style callback called with the error, if any, and Empty + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(ModelService.prototype.deleteTunedModel = function deleteTunedModel(request, callback) { + return this.rpcCall(deleteTunedModel, $root.google.ai.generativelanguage.v1beta3.DeleteTunedModelRequest, $root.google.protobuf.Empty, request, callback); + }, "name", { value: "DeleteTunedModel" }); - /** - * ResourceDescriptor nameField. - * @member {string} nameField - * @memberof google.api.ResourceDescriptor - * @instance - */ - ResourceDescriptor.prototype.nameField = ""; + /** + * Calls DeleteTunedModel. + * @function deleteTunedModel + * @memberof google.ai.generativelanguage.v1beta3.ModelService + * @instance + * @param {google.ai.generativelanguage.v1beta3.IDeleteTunedModelRequest} request DeleteTunedModelRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ - /** - * ResourceDescriptor history. - * @member {google.api.ResourceDescriptor.History} history - * @memberof google.api.ResourceDescriptor - * @instance - */ - ResourceDescriptor.prototype.history = 0; + return ModelService; + })(); - /** - * ResourceDescriptor plural. - * @member {string} plural - * @memberof google.api.ResourceDescriptor - * @instance - */ - ResourceDescriptor.prototype.plural = ""; + v1beta3.GetModelRequest = (function() { - /** - * ResourceDescriptor singular. - * @member {string} singular - * @memberof google.api.ResourceDescriptor - * @instance - */ - ResourceDescriptor.prototype.singular = ""; + /** + * Properties of a GetModelRequest. + * @memberof google.ai.generativelanguage.v1beta3 + * @interface IGetModelRequest + * @property {string|null} [name] GetModelRequest name + */ - /** - * ResourceDescriptor style. - * @member {Array.} style - * @memberof google.api.ResourceDescriptor - * @instance - */ - ResourceDescriptor.prototype.style = $util.emptyArray; + /** + * Constructs a new GetModelRequest. + * @memberof google.ai.generativelanguage.v1beta3 + * @classdesc Represents a GetModelRequest. + * @implements IGetModelRequest + * @constructor + * @param {google.ai.generativelanguage.v1beta3.IGetModelRequest=} [properties] Properties to set + */ + function GetModelRequest(properties) { + if (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 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); - }; + /** + * GetModelRequest name. + * @member {string} name + * @memberof google.ai.generativelanguage.v1beta3.GetModelRequest + * @instance + */ + GetModelRequest.prototype.name = ""; - /** - * 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; - }; + /** + * Creates a new GetModelRequest instance using the specified properties. + * @function create + * @memberof google.ai.generativelanguage.v1beta3.GetModelRequest + * @static + * @param {google.ai.generativelanguage.v1beta3.IGetModelRequest=} [properties] Properties to set + * @returns {google.ai.generativelanguage.v1beta3.GetModelRequest} GetModelRequest instance + */ + GetModelRequest.create = function create(properties) { + return new GetModelRequest(properties); + }; - /** - * 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(); - }; + /** + * Encodes the specified GetModelRequest message. Does not implicitly {@link google.ai.generativelanguage.v1beta3.GetModelRequest.verify|verify} messages. + * @function encode + * @memberof google.ai.generativelanguage.v1beta3.GetModelRequest + * @static + * @param {google.ai.generativelanguage.v1beta3.IGetModelRequest} message GetModelRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetModelRequest.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; + }; - /** - * 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) { - 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(); - 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; + /** + * Encodes the specified GetModelRequest message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1beta3.GetModelRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.ai.generativelanguage.v1beta3.GetModelRequest + * @static + * @param {google.ai.generativelanguage.v1beta3.IGetModelRequest} message GetModelRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetModelRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetModelRequest message from the specified reader or buffer. + * @function decode + * @memberof google.ai.generativelanguage.v1beta3.GetModelRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.ai.generativelanguage.v1beta3.GetModelRequest} GetModelRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetModelRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.ai.generativelanguage.v1beta3.GetModelRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; + 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()); - }; + /** + * Decodes a GetModelRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.ai.generativelanguage.v1beta3.GetModelRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.ai.generativelanguage.v1beta3.GetModelRequest} GetModelRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetModelRequest.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; - }; + /** + * Verifies a GetModelRequest message. + * @function verify + * @memberof google.ai.generativelanguage.v1beta3.GetModelRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetModelRequest.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 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 GetModelRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.ai.generativelanguage.v1beta3.GetModelRequest + * @static + * @param {Object.} object Plain object + * @returns {google.ai.generativelanguage.v1beta3.GetModelRequest} GetModelRequest + */ + GetModelRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.ai.generativelanguage.v1beta3.GetModelRequest) + return object; + var message = new $root.google.ai.generativelanguage.v1beta3.GetModelRequest(); + if (object.name != null) + message.name = String(object.name); + 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; - }; + /** + * Creates a plain object from a GetModelRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.ai.generativelanguage.v1beta3.GetModelRequest + * @static + * @param {google.ai.generativelanguage.v1beta3.GetModelRequest} message GetModelRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetModelRequest.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 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); - }; + /** + * Converts this GetModelRequest to JSON. + * @function toJSON + * @memberof google.ai.generativelanguage.v1beta3.GetModelRequest + * @instance + * @returns {Object.} JSON object + */ + GetModelRequest.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"; - }; + /** + * Gets the default type url for GetModelRequest + * @function getTypeUrl + * @memberof google.ai.generativelanguage.v1beta3.GetModelRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GetModelRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.ai.generativelanguage.v1beta3.GetModelRequest"; + }; - /** - * 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; - })(); + return GetModelRequest; + })(); - /** - * 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; - })(); + v1beta3.ListModelsRequest = (function() { - 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 - */ + /** + * Properties of a ListModelsRequest. + * @memberof google.ai.generativelanguage.v1beta3 + * @interface IListModelsRequest + * @property {number|null} [pageSize] ListModelsRequest pageSize + * @property {string|null} [pageToken] ListModelsRequest pageToken + */ - /** - * 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]]; - } + /** + * Constructs a new ListModelsRequest. + * @memberof google.ai.generativelanguage.v1beta3 + * @classdesc Represents a ListModelsRequest. + * @implements IListModelsRequest + * @constructor + * @param {google.ai.generativelanguage.v1beta3.IListModelsRequest=} [properties] Properties to set + */ + function ListModelsRequest(properties) { + if (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 = ""; + /** + * ListModelsRequest pageSize. + * @member {number} pageSize + * @memberof google.ai.generativelanguage.v1beta3.ListModelsRequest + * @instance + */ + ListModelsRequest.prototype.pageSize = 0; - /** - * ResourceReference childType. - * @member {string} childType - * @memberof google.api.ResourceReference - * @instance - */ - ResourceReference.prototype.childType = ""; + /** + * ListModelsRequest pageToken. + * @member {string} pageToken + * @memberof google.ai.generativelanguage.v1beta3.ListModelsRequest + * @instance + */ + ListModelsRequest.prototype.pageToken = ""; - /** - * 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); - }; + /** + * Creates a new ListModelsRequest instance using the specified properties. + * @function create + * @memberof google.ai.generativelanguage.v1beta3.ListModelsRequest + * @static + * @param {google.ai.generativelanguage.v1beta3.IListModelsRequest=} [properties] Properties to set + * @returns {google.ai.generativelanguage.v1beta3.ListModelsRequest} ListModelsRequest instance + */ + ListModelsRequest.create = function create(properties) { + return new ListModelsRequest(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 ListModelsRequest message. Does not implicitly {@link google.ai.generativelanguage.v1beta3.ListModelsRequest.verify|verify} messages. + * @function encode + * @memberof google.ai.generativelanguage.v1beta3.ListModelsRequest + * @static + * @param {google.ai.generativelanguage.v1beta3.IListModelsRequest} message ListModelsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListModelsRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + 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 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(); - }; + /** + * Encodes the specified ListModelsRequest message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1beta3.ListModelsRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.ai.generativelanguage.v1beta3.ListModelsRequest + * @static + * @param {google.ai.generativelanguage.v1beta3.IListModelsRequest} message ListModelsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListModelsRequest.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) { - 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(); - switch (tag >>> 3) { - case 1: { - message.type = reader.string(); - break; - } - case 2: { - message.childType = reader.string(); - break; + /** + * Decodes a ListModelsRequest message from the specified reader or buffer. + * @function decode + * @memberof google.ai.generativelanguage.v1beta3.ListModelsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.ai.generativelanguage.v1beta3.ListModelsRequest} ListModelsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListModelsRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.ai.generativelanguage.v1beta3.ListModelsRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 2: { + message.pageSize = reader.int32(); + break; + } + case 3: { + message.pageToken = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + 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()); - }; + return message; + }; - /** - * 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; - }; + /** + * Decodes a ListModelsRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.ai.generativelanguage.v1beta3.ListModelsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.ai.generativelanguage.v1beta3.ListModelsRequest} ListModelsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListModelsRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; - /** - * 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; - }; + /** + * Verifies a ListModelsRequest message. + * @function verify + * @memberof google.ai.generativelanguage.v1beta3.ListModelsRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListModelsRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object 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; + }; - /** - * 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); - }; + /** + * Creates a ListModelsRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.ai.generativelanguage.v1beta3.ListModelsRequest + * @static + * @param {Object.} object Plain object + * @returns {google.ai.generativelanguage.v1beta3.ListModelsRequest} ListModelsRequest + */ + ListModelsRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.ai.generativelanguage.v1beta3.ListModelsRequest) + return object; + var message = new $root.google.ai.generativelanguage.v1beta3.ListModelsRequest(); + if (object.pageSize != null) + message.pageSize = object.pageSize | 0; + if (object.pageToken != null) + message.pageToken = String(object.pageToken); + return message; + }; - /** - * 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"; - }; + /** + * Creates a plain object from a ListModelsRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.ai.generativelanguage.v1beta3.ListModelsRequest + * @static + * @param {google.ai.generativelanguage.v1beta3.ListModelsRequest} message ListModelsRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListModelsRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.pageSize = 0; + object.pageToken = ""; + } + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + object.pageSize = message.pageSize; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + object.pageToken = message.pageToken; + return object; + }; - return ResourceReference; - })(); + /** + * Converts this ListModelsRequest to JSON. + * @function toJSON + * @memberof google.ai.generativelanguage.v1beta3.ListModelsRequest + * @instance + * @returns {Object.} JSON object + */ + ListModelsRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; - return api; - })(); + /** + * Gets the default type url for ListModelsRequest + * @function getTypeUrl + * @memberof google.ai.generativelanguage.v1beta3.ListModelsRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListModelsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.ai.generativelanguage.v1beta3.ListModelsRequest"; + }; - google.protobuf = (function() { + return ListModelsRequest; + })(); - /** - * Namespace protobuf. - * @memberof google - * @namespace - */ - var protobuf = {}; + v1beta3.ListModelsResponse = (function() { - protobuf.FileDescriptorSet = (function() { + /** + * Properties of a ListModelsResponse. + * @memberof google.ai.generativelanguage.v1beta3 + * @interface IListModelsResponse + * @property {Array.|null} [models] ListModelsResponse models + * @property {string|null} [nextPageToken] ListModelsResponse nextPageToken + */ - /** - * Properties of a FileDescriptorSet. - * @memberof google.protobuf - * @interface IFileDescriptorSet - * @property {Array.|null} [file] FileDescriptorSet file - */ + /** + * Constructs a new ListModelsResponse. + * @memberof google.ai.generativelanguage.v1beta3 + * @classdesc Represents a ListModelsResponse. + * @implements IListModelsResponse + * @constructor + * @param {google.ai.generativelanguage.v1beta3.IListModelsResponse=} [properties] Properties to set + */ + function ListModelsResponse(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]]; + } - /** - * 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]]; - } + /** + * ListModelsResponse models. + * @member {Array.} models + * @memberof google.ai.generativelanguage.v1beta3.ListModelsResponse + * @instance + */ + ListModelsResponse.prototype.models = $util.emptyArray; - /** - * FileDescriptorSet file. - * @member {Array.} file - * @memberof google.protobuf.FileDescriptorSet - * @instance - */ - FileDescriptorSet.prototype.file = $util.emptyArray; + /** + * ListModelsResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.ai.generativelanguage.v1beta3.ListModelsResponse + * @instance + */ + ListModelsResponse.prototype.nextPageToken = ""; - /** - * 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); - }; + /** + * Creates a new ListModelsResponse instance using the specified properties. + * @function create + * @memberof google.ai.generativelanguage.v1beta3.ListModelsResponse + * @static + * @param {google.ai.generativelanguage.v1beta3.IListModelsResponse=} [properties] Properties to set + * @returns {google.ai.generativelanguage.v1beta3.ListModelsResponse} ListModelsResponse instance + */ + ListModelsResponse.create = function create(properties) { + return new ListModelsResponse(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 ListModelsResponse message. Does not implicitly {@link google.ai.generativelanguage.v1beta3.ListModelsResponse.verify|verify} messages. + * @function encode + * @memberof google.ai.generativelanguage.v1beta3.ListModelsResponse + * @static + * @param {google.ai.generativelanguage.v1beta3.IListModelsResponse} message ListModelsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListModelsResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.models != null && message.models.length) + for (var i = 0; i < message.models.length; ++i) + $root.google.ai.generativelanguage.v1beta3.Model.encode(message.models[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 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(); - }; + /** + * Encodes the specified ListModelsResponse message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1beta3.ListModelsResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.ai.generativelanguage.v1beta3.ListModelsResponse + * @static + * @param {google.ai.generativelanguage.v1beta3.IListModelsResponse} message ListModelsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListModelsResponse.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) { - 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(); - 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; + /** + * Decodes a ListModelsResponse message from the specified reader or buffer. + * @function decode + * @memberof google.ai.generativelanguage.v1beta3.ListModelsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.ai.generativelanguage.v1beta3.ListModelsResponse} ListModelsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListModelsResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.ai.generativelanguage.v1beta3.ListModelsResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.models && message.models.length)) + message.models = []; + message.models.push($root.google.ai.generativelanguage.v1beta3.Model.decode(reader, reader.uint32())); + break; + } + case 2: { + message.nextPageToken = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + 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()); - }; + return message; + }; - /** - * 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; - }; + /** + * Decodes a ListModelsResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.ai.generativelanguage.v1beta3.ListModelsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.ai.generativelanguage.v1beta3.ListModelsResponse} ListModelsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListModelsResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; - /** - * 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; - }; + /** + * Verifies a ListModelsResponse message. + * @function verify + * @memberof google.ai.generativelanguage.v1beta3.ListModelsResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListModelsResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.models != null && message.hasOwnProperty("models")) { + if (!Array.isArray(message.models)) + return "models: array expected"; + for (var i = 0; i < message.models.length; ++i) { + var error = $root.google.ai.generativelanguage.v1beta3.Model.verify(message.models[i]); + if (error) + return "models." + error; + } + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + return null; + }; - /** - * 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; - }; + /** + * Creates a ListModelsResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.ai.generativelanguage.v1beta3.ListModelsResponse + * @static + * @param {Object.} object Plain object + * @returns {google.ai.generativelanguage.v1beta3.ListModelsResponse} ListModelsResponse + */ + ListModelsResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.ai.generativelanguage.v1beta3.ListModelsResponse) + return object; + var message = new $root.google.ai.generativelanguage.v1beta3.ListModelsResponse(); + if (object.models) { + if (!Array.isArray(object.models)) + throw TypeError(".google.ai.generativelanguage.v1beta3.ListModelsResponse.models: array expected"); + message.models = []; + for (var i = 0; i < object.models.length; ++i) { + if (typeof object.models[i] !== "object") + throw TypeError(".google.ai.generativelanguage.v1beta3.ListModelsResponse.models: object expected"); + message.models[i] = $root.google.ai.generativelanguage.v1beta3.Model.fromObject(object.models[i]); + } + } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + return message; + }; - /** - * 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); - }; + /** + * Creates a plain object from a ListModelsResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.ai.generativelanguage.v1beta3.ListModelsResponse + * @static + * @param {google.ai.generativelanguage.v1beta3.ListModelsResponse} message ListModelsResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListModelsResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.models = []; + if (options.defaults) + object.nextPageToken = ""; + if (message.models && message.models.length) { + object.models = []; + for (var j = 0; j < message.models.length; ++j) + object.models[j] = $root.google.ai.generativelanguage.v1beta3.Model.toObject(message.models[j], options); + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + object.nextPageToken = message.nextPageToken; + return object; + }; - /** - * 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; - })(); - - protobuf.FileDescriptorProto = (function() { + /** + * Converts this ListModelsResponse to JSON. + * @function toJSON + * @memberof google.ai.generativelanguage.v1beta3.ListModelsResponse + * @instance + * @returns {Object.} JSON object + */ + ListModelsResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; - /** - * 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 {string|null} [edition] FileDescriptorProto edition - */ + /** + * Gets the default type url for ListModelsResponse + * @function getTypeUrl + * @memberof google.ai.generativelanguage.v1beta3.ListModelsResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListModelsResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.ai.generativelanguage.v1beta3.ListModelsResponse"; + }; - /** - * 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]]; - } + return ListModelsResponse; + })(); - /** - * FileDescriptorProto name. - * @member {string} name - * @memberof google.protobuf.FileDescriptorProto - * @instance - */ - FileDescriptorProto.prototype.name = ""; + v1beta3.GetTunedModelRequest = (function() { - /** - * FileDescriptorProto package. - * @member {string} package - * @memberof google.protobuf.FileDescriptorProto - * @instance - */ - FileDescriptorProto.prototype["package"] = ""; + /** + * Properties of a GetTunedModelRequest. + * @memberof google.ai.generativelanguage.v1beta3 + * @interface IGetTunedModelRequest + * @property {string|null} [name] GetTunedModelRequest name + */ - /** - * FileDescriptorProto dependency. - * @member {Array.} dependency - * @memberof google.protobuf.FileDescriptorProto - * @instance - */ - FileDescriptorProto.prototype.dependency = $util.emptyArray; + /** + * Constructs a new GetTunedModelRequest. + * @memberof google.ai.generativelanguage.v1beta3 + * @classdesc Represents a GetTunedModelRequest. + * @implements IGetTunedModelRequest + * @constructor + * @param {google.ai.generativelanguage.v1beta3.IGetTunedModelRequest=} [properties] Properties to set + */ + function GetTunedModelRequest(properties) { + if (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 publicDependency. - * @member {Array.} publicDependency - * @memberof google.protobuf.FileDescriptorProto - * @instance - */ - FileDescriptorProto.prototype.publicDependency = $util.emptyArray; + /** + * GetTunedModelRequest name. + * @member {string} name + * @memberof google.ai.generativelanguage.v1beta3.GetTunedModelRequest + * @instance + */ + GetTunedModelRequest.prototype.name = ""; - /** - * FileDescriptorProto weakDependency. - * @member {Array.} weakDependency - * @memberof google.protobuf.FileDescriptorProto - * @instance - */ - FileDescriptorProto.prototype.weakDependency = $util.emptyArray; + /** + * Creates a new GetTunedModelRequest instance using the specified properties. + * @function create + * @memberof google.ai.generativelanguage.v1beta3.GetTunedModelRequest + * @static + * @param {google.ai.generativelanguage.v1beta3.IGetTunedModelRequest=} [properties] Properties to set + * @returns {google.ai.generativelanguage.v1beta3.GetTunedModelRequest} GetTunedModelRequest instance + */ + GetTunedModelRequest.create = function create(properties) { + return new GetTunedModelRequest(properties); + }; - /** - * FileDescriptorProto messageType. - * @member {Array.} messageType - * @memberof google.protobuf.FileDescriptorProto - * @instance - */ - FileDescriptorProto.prototype.messageType = $util.emptyArray; + /** + * Encodes the specified GetTunedModelRequest message. Does not implicitly {@link google.ai.generativelanguage.v1beta3.GetTunedModelRequest.verify|verify} messages. + * @function encode + * @memberof google.ai.generativelanguage.v1beta3.GetTunedModelRequest + * @static + * @param {google.ai.generativelanguage.v1beta3.IGetTunedModelRequest} message GetTunedModelRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetTunedModelRequest.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; + }; - /** - * FileDescriptorProto enumType. - * @member {Array.} enumType - * @memberof google.protobuf.FileDescriptorProto - * @instance - */ - FileDescriptorProto.prototype.enumType = $util.emptyArray; + /** + * Encodes the specified GetTunedModelRequest message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1beta3.GetTunedModelRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.ai.generativelanguage.v1beta3.GetTunedModelRequest + * @static + * @param {google.ai.generativelanguage.v1beta3.IGetTunedModelRequest} message GetTunedModelRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetTunedModelRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; - /** - * FileDescriptorProto service. - * @member {Array.} service - * @memberof google.protobuf.FileDescriptorProto - * @instance - */ - FileDescriptorProto.prototype.service = $util.emptyArray; + /** + * Decodes a GetTunedModelRequest message from the specified reader or buffer. + * @function decode + * @memberof google.ai.generativelanguage.v1beta3.GetTunedModelRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.ai.generativelanguage.v1beta3.GetTunedModelRequest} GetTunedModelRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetTunedModelRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.ai.generativelanguage.v1beta3.GetTunedModelRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; - /** - * FileDescriptorProto extension. - * @member {Array.} extension - * @memberof google.protobuf.FileDescriptorProto - * @instance - */ - FileDescriptorProto.prototype.extension = $util.emptyArray; + /** + * Decodes a GetTunedModelRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.ai.generativelanguage.v1beta3.GetTunedModelRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.ai.generativelanguage.v1beta3.GetTunedModelRequest} GetTunedModelRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetTunedModelRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; - /** - * FileDescriptorProto options. - * @member {google.protobuf.IFileOptions|null|undefined} options - * @memberof google.protobuf.FileDescriptorProto - * @instance - */ - FileDescriptorProto.prototype.options = null; + /** + * Verifies a GetTunedModelRequest message. + * @function verify + * @memberof google.ai.generativelanguage.v1beta3.GetTunedModelRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetTunedModelRequest.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; + }; - /** - * FileDescriptorProto sourceCodeInfo. - * @member {google.protobuf.ISourceCodeInfo|null|undefined} sourceCodeInfo - * @memberof google.protobuf.FileDescriptorProto - * @instance - */ - FileDescriptorProto.prototype.sourceCodeInfo = null; + /** + * Creates a GetTunedModelRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.ai.generativelanguage.v1beta3.GetTunedModelRequest + * @static + * @param {Object.} object Plain object + * @returns {google.ai.generativelanguage.v1beta3.GetTunedModelRequest} GetTunedModelRequest + */ + GetTunedModelRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.ai.generativelanguage.v1beta3.GetTunedModelRequest) + return object; + var message = new $root.google.ai.generativelanguage.v1beta3.GetTunedModelRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; - /** - * FileDescriptorProto syntax. - * @member {string} syntax - * @memberof google.protobuf.FileDescriptorProto - * @instance - */ - FileDescriptorProto.prototype.syntax = ""; + /** + * Creates a plain object from a GetTunedModelRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.ai.generativelanguage.v1beta3.GetTunedModelRequest + * @static + * @param {google.ai.generativelanguage.v1beta3.GetTunedModelRequest} message GetTunedModelRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetTunedModelRequest.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; + }; - /** - * FileDescriptorProto edition. - * @member {string} edition - * @memberof google.protobuf.FileDescriptorProto - * @instance - */ - FileDescriptorProto.prototype.edition = ""; + /** + * Converts this GetTunedModelRequest to JSON. + * @function toJSON + * @memberof google.ai.generativelanguage.v1beta3.GetTunedModelRequest + * @instance + * @returns {Object.} JSON object + */ + GetTunedModelRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; - /** - * 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); - }; + /** + * Gets the default type url for GetTunedModelRequest + * @function getTypeUrl + * @memberof google.ai.generativelanguage.v1beta3.GetTunedModelRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GetTunedModelRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.ai.generativelanguage.v1beta3.GetTunedModelRequest"; + }; - /** - * 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 13, wireType 2 =*/106).string(message.edition); - return writer; - }; + return GetTunedModelRequest; + })(); - /** - * 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(); - }; + v1beta3.ListTunedModelsRequest = (function() { - /** - * 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) { - 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(); - 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 13: { - message.edition = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; + /** + * Properties of a ListTunedModelsRequest. + * @memberof google.ai.generativelanguage.v1beta3 + * @interface IListTunedModelsRequest + * @property {number|null} [pageSize] ListTunedModelsRequest pageSize + * @property {string|null} [pageToken] ListTunedModelsRequest pageToken + */ + + /** + * Constructs a new ListTunedModelsRequest. + * @memberof google.ai.generativelanguage.v1beta3 + * @classdesc Represents a ListTunedModelsRequest. + * @implements IListTunedModelsRequest + * @constructor + * @param {google.ai.generativelanguage.v1beta3.IListTunedModelsRequest=} [properties] Properties to set + */ + function ListTunedModelsRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; } - } - 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()); - }; + /** + * ListTunedModelsRequest pageSize. + * @member {number} pageSize + * @memberof google.ai.generativelanguage.v1beta3.ListTunedModelsRequest + * @instance + */ + ListTunedModelsRequest.prototype.pageSize = 0; - /** - * 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"; + /** + * ListTunedModelsRequest pageToken. + * @member {string} pageToken + * @memberof google.ai.generativelanguage.v1beta3.ListTunedModelsRequest + * @instance + */ + ListTunedModelsRequest.prototype.pageToken = ""; + + /** + * Creates a new ListTunedModelsRequest instance using the specified properties. + * @function create + * @memberof google.ai.generativelanguage.v1beta3.ListTunedModelsRequest + * @static + * @param {google.ai.generativelanguage.v1beta3.IListTunedModelsRequest=} [properties] Properties to set + * @returns {google.ai.generativelanguage.v1beta3.ListTunedModelsRequest} ListTunedModelsRequest instance + */ + ListTunedModelsRequest.create = function create(properties) { + return new ListTunedModelsRequest(properties); + }; + + /** + * Encodes the specified ListTunedModelsRequest message. Does not implicitly {@link google.ai.generativelanguage.v1beta3.ListTunedModelsRequest.verify|verify} messages. + * @function encode + * @memberof google.ai.generativelanguage.v1beta3.ListTunedModelsRequest + * @static + * @param {google.ai.generativelanguage.v1beta3.IListTunedModelsRequest} message ListTunedModelsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListTunedModelsRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.pageSize); + if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.pageToken); + return writer; + }; + + /** + * Encodes the specified ListTunedModelsRequest message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1beta3.ListTunedModelsRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.ai.generativelanguage.v1beta3.ListTunedModelsRequest + * @static + * @param {google.ai.generativelanguage.v1beta3.IListTunedModelsRequest} message ListTunedModelsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListTunedModelsRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListTunedModelsRequest message from the specified reader or buffer. + * @function decode + * @memberof google.ai.generativelanguage.v1beta3.ListTunedModelsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.ai.generativelanguage.v1beta3.ListTunedModelsRequest} ListTunedModelsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListTunedModelsRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.ai.generativelanguage.v1beta3.ListTunedModelsRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.pageSize = reader.int32(); + break; + } + case 2: { + message.pageToken = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListTunedModelsRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.ai.generativelanguage.v1beta3.ListTunedModelsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.ai.generativelanguage.v1beta3.ListTunedModelsRequest} ListTunedModelsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListTunedModelsRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListTunedModelsRequest message. + * @function verify + * @memberof google.ai.generativelanguage.v1beta3.ListTunedModelsRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListTunedModelsRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object 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 ListTunedModelsRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.ai.generativelanguage.v1beta3.ListTunedModelsRequest + * @static + * @param {Object.} object Plain object + * @returns {google.ai.generativelanguage.v1beta3.ListTunedModelsRequest} ListTunedModelsRequest + */ + ListTunedModelsRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.ai.generativelanguage.v1beta3.ListTunedModelsRequest) + return object; + var message = new $root.google.ai.generativelanguage.v1beta3.ListTunedModelsRequest(); + 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 ListTunedModelsRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.ai.generativelanguage.v1beta3.ListTunedModelsRequest + * @static + * @param {google.ai.generativelanguage.v1beta3.ListTunedModelsRequest} message ListTunedModelsRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListTunedModelsRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.pageSize = 0; + object.pageToken = ""; + } + 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 ListTunedModelsRequest to JSON. + * @function toJSON + * @memberof google.ai.generativelanguage.v1beta3.ListTunedModelsRequest + * @instance + * @returns {Object.} JSON object + */ + ListTunedModelsRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListTunedModelsRequest + * @function getTypeUrl + * @memberof google.ai.generativelanguage.v1beta3.ListTunedModelsRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListTunedModelsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.ai.generativelanguage.v1beta3.ListTunedModelsRequest"; + }; + + return ListTunedModelsRequest; + })(); + + v1beta3.ListTunedModelsResponse = (function() { + + /** + * Properties of a ListTunedModelsResponse. + * @memberof google.ai.generativelanguage.v1beta3 + * @interface IListTunedModelsResponse + * @property {Array.|null} [tunedModels] ListTunedModelsResponse tunedModels + * @property {string|null} [nextPageToken] ListTunedModelsResponse nextPageToken + */ + + /** + * Constructs a new ListTunedModelsResponse. + * @memberof google.ai.generativelanguage.v1beta3 + * @classdesc Represents a ListTunedModelsResponse. + * @implements IListTunedModelsResponse + * @constructor + * @param {google.ai.generativelanguage.v1beta3.IListTunedModelsResponse=} [properties] Properties to set + */ + function ListTunedModelsResponse(properties) { + this.tunedModels = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListTunedModelsResponse tunedModels. + * @member {Array.} tunedModels + * @memberof google.ai.generativelanguage.v1beta3.ListTunedModelsResponse + * @instance + */ + ListTunedModelsResponse.prototype.tunedModels = $util.emptyArray; + + /** + * ListTunedModelsResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.ai.generativelanguage.v1beta3.ListTunedModelsResponse + * @instance + */ + ListTunedModelsResponse.prototype.nextPageToken = ""; + + /** + * Creates a new ListTunedModelsResponse instance using the specified properties. + * @function create + * @memberof google.ai.generativelanguage.v1beta3.ListTunedModelsResponse + * @static + * @param {google.ai.generativelanguage.v1beta3.IListTunedModelsResponse=} [properties] Properties to set + * @returns {google.ai.generativelanguage.v1beta3.ListTunedModelsResponse} ListTunedModelsResponse instance + */ + ListTunedModelsResponse.create = function create(properties) { + return new ListTunedModelsResponse(properties); + }; + + /** + * Encodes the specified ListTunedModelsResponse message. Does not implicitly {@link google.ai.generativelanguage.v1beta3.ListTunedModelsResponse.verify|verify} messages. + * @function encode + * @memberof google.ai.generativelanguage.v1beta3.ListTunedModelsResponse + * @static + * @param {google.ai.generativelanguage.v1beta3.IListTunedModelsResponse} message ListTunedModelsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListTunedModelsResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.tunedModels != null && message.tunedModels.length) + for (var i = 0; i < message.tunedModels.length; ++i) + $root.google.ai.generativelanguage.v1beta3.TunedModel.encode(message.tunedModels[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 ListTunedModelsResponse message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1beta3.ListTunedModelsResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.ai.generativelanguage.v1beta3.ListTunedModelsResponse + * @static + * @param {google.ai.generativelanguage.v1beta3.IListTunedModelsResponse} message ListTunedModelsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListTunedModelsResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListTunedModelsResponse message from the specified reader or buffer. + * @function decode + * @memberof google.ai.generativelanguage.v1beta3.ListTunedModelsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.ai.generativelanguage.v1beta3.ListTunedModelsResponse} ListTunedModelsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListTunedModelsResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.ai.generativelanguage.v1beta3.ListTunedModelsResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.tunedModels && message.tunedModels.length)) + message.tunedModels = []; + message.tunedModels.push($root.google.ai.generativelanguage.v1beta3.TunedModel.decode(reader, reader.uint32())); + break; + } + case 2: { + message.nextPageToken = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListTunedModelsResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.ai.generativelanguage.v1beta3.ListTunedModelsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.ai.generativelanguage.v1beta3.ListTunedModelsResponse} ListTunedModelsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListTunedModelsResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListTunedModelsResponse message. + * @function verify + * @memberof google.ai.generativelanguage.v1beta3.ListTunedModelsResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListTunedModelsResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.tunedModels != null && message.hasOwnProperty("tunedModels")) { + if (!Array.isArray(message.tunedModels)) + return "tunedModels: array expected"; + for (var i = 0; i < message.tunedModels.length; ++i) { + var error = $root.google.ai.generativelanguage.v1beta3.TunedModel.verify(message.tunedModels[i]); + if (error) + return "tunedModels." + error; + } + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + return null; + }; + + /** + * Creates a ListTunedModelsResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.ai.generativelanguage.v1beta3.ListTunedModelsResponse + * @static + * @param {Object.} object Plain object + * @returns {google.ai.generativelanguage.v1beta3.ListTunedModelsResponse} ListTunedModelsResponse + */ + ListTunedModelsResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.ai.generativelanguage.v1beta3.ListTunedModelsResponse) + return object; + var message = new $root.google.ai.generativelanguage.v1beta3.ListTunedModelsResponse(); + if (object.tunedModels) { + if (!Array.isArray(object.tunedModels)) + throw TypeError(".google.ai.generativelanguage.v1beta3.ListTunedModelsResponse.tunedModels: array expected"); + message.tunedModels = []; + for (var i = 0; i < object.tunedModels.length; ++i) { + if (typeof object.tunedModels[i] !== "object") + throw TypeError(".google.ai.generativelanguage.v1beta3.ListTunedModelsResponse.tunedModels: object expected"); + message.tunedModels[i] = $root.google.ai.generativelanguage.v1beta3.TunedModel.fromObject(object.tunedModels[i]); + } + } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + return message; + }; + + /** + * Creates a plain object from a ListTunedModelsResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.ai.generativelanguage.v1beta3.ListTunedModelsResponse + * @static + * @param {google.ai.generativelanguage.v1beta3.ListTunedModelsResponse} message ListTunedModelsResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListTunedModelsResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.tunedModels = []; + if (options.defaults) + object.nextPageToken = ""; + if (message.tunedModels && message.tunedModels.length) { + object.tunedModels = []; + for (var j = 0; j < message.tunedModels.length; ++j) + object.tunedModels[j] = $root.google.ai.generativelanguage.v1beta3.TunedModel.toObject(message.tunedModels[j], options); + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + object.nextPageToken = message.nextPageToken; + return object; + }; + + /** + * Converts this ListTunedModelsResponse to JSON. + * @function toJSON + * @memberof google.ai.generativelanguage.v1beta3.ListTunedModelsResponse + * @instance + * @returns {Object.} JSON object + */ + ListTunedModelsResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListTunedModelsResponse + * @function getTypeUrl + * @memberof google.ai.generativelanguage.v1beta3.ListTunedModelsResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListTunedModelsResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.ai.generativelanguage.v1beta3.ListTunedModelsResponse"; + }; + + return ListTunedModelsResponse; + })(); + + v1beta3.CreateTunedModelRequest = (function() { + + /** + * Properties of a CreateTunedModelRequest. + * @memberof google.ai.generativelanguage.v1beta3 + * @interface ICreateTunedModelRequest + * @property {string|null} [tunedModelId] CreateTunedModelRequest tunedModelId + * @property {google.ai.generativelanguage.v1beta3.ITunedModel|null} [tunedModel] CreateTunedModelRequest tunedModel + */ + + /** + * Constructs a new CreateTunedModelRequest. + * @memberof google.ai.generativelanguage.v1beta3 + * @classdesc Represents a CreateTunedModelRequest. + * @implements ICreateTunedModelRequest + * @constructor + * @param {google.ai.generativelanguage.v1beta3.ICreateTunedModelRequest=} [properties] Properties to set + */ + function CreateTunedModelRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * CreateTunedModelRequest tunedModelId. + * @member {string|null|undefined} tunedModelId + * @memberof google.ai.generativelanguage.v1beta3.CreateTunedModelRequest + * @instance + */ + CreateTunedModelRequest.prototype.tunedModelId = null; + + /** + * CreateTunedModelRequest tunedModel. + * @member {google.ai.generativelanguage.v1beta3.ITunedModel|null|undefined} tunedModel + * @memberof google.ai.generativelanguage.v1beta3.CreateTunedModelRequest + * @instance + */ + CreateTunedModelRequest.prototype.tunedModel = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * CreateTunedModelRequest _tunedModelId. + * @member {"tunedModelId"|undefined} _tunedModelId + * @memberof google.ai.generativelanguage.v1beta3.CreateTunedModelRequest + * @instance + */ + Object.defineProperty(CreateTunedModelRequest.prototype, "_tunedModelId", { + get: $util.oneOfGetter($oneOfFields = ["tunedModelId"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new CreateTunedModelRequest instance using the specified properties. + * @function create + * @memberof google.ai.generativelanguage.v1beta3.CreateTunedModelRequest + * @static + * @param {google.ai.generativelanguage.v1beta3.ICreateTunedModelRequest=} [properties] Properties to set + * @returns {google.ai.generativelanguage.v1beta3.CreateTunedModelRequest} CreateTunedModelRequest instance + */ + CreateTunedModelRequest.create = function create(properties) { + return new CreateTunedModelRequest(properties); + }; + + /** + * Encodes the specified CreateTunedModelRequest message. Does not implicitly {@link google.ai.generativelanguage.v1beta3.CreateTunedModelRequest.verify|verify} messages. + * @function encode + * @memberof google.ai.generativelanguage.v1beta3.CreateTunedModelRequest + * @static + * @param {google.ai.generativelanguage.v1beta3.ICreateTunedModelRequest} message CreateTunedModelRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateTunedModelRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.tunedModelId != null && Object.hasOwnProperty.call(message, "tunedModelId")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.tunedModelId); + if (message.tunedModel != null && Object.hasOwnProperty.call(message, "tunedModel")) + $root.google.ai.generativelanguage.v1beta3.TunedModel.encode(message.tunedModel, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified CreateTunedModelRequest message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1beta3.CreateTunedModelRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.ai.generativelanguage.v1beta3.CreateTunedModelRequest + * @static + * @param {google.ai.generativelanguage.v1beta3.ICreateTunedModelRequest} message CreateTunedModelRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateTunedModelRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CreateTunedModelRequest message from the specified reader or buffer. + * @function decode + * @memberof google.ai.generativelanguage.v1beta3.CreateTunedModelRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.ai.generativelanguage.v1beta3.CreateTunedModelRequest} CreateTunedModelRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateTunedModelRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.ai.generativelanguage.v1beta3.CreateTunedModelRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.tunedModelId = reader.string(); + break; + } + case 2: { + message.tunedModel = $root.google.ai.generativelanguage.v1beta3.TunedModel.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CreateTunedModelRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.ai.generativelanguage.v1beta3.CreateTunedModelRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.ai.generativelanguage.v1beta3.CreateTunedModelRequest} CreateTunedModelRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateTunedModelRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CreateTunedModelRequest message. + * @function verify + * @memberof google.ai.generativelanguage.v1beta3.CreateTunedModelRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CreateTunedModelRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.tunedModelId != null && message.hasOwnProperty("tunedModelId")) { + properties._tunedModelId = 1; + if (!$util.isString(message.tunedModelId)) + return "tunedModelId: string expected"; + } + if (message.tunedModel != null && message.hasOwnProperty("tunedModel")) { + var error = $root.google.ai.generativelanguage.v1beta3.TunedModel.verify(message.tunedModel); + if (error) + return "tunedModel." + error; + } + return null; + }; + + /** + * Creates a CreateTunedModelRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.ai.generativelanguage.v1beta3.CreateTunedModelRequest + * @static + * @param {Object.} object Plain object + * @returns {google.ai.generativelanguage.v1beta3.CreateTunedModelRequest} CreateTunedModelRequest + */ + CreateTunedModelRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.ai.generativelanguage.v1beta3.CreateTunedModelRequest) + return object; + var message = new $root.google.ai.generativelanguage.v1beta3.CreateTunedModelRequest(); + if (object.tunedModelId != null) + message.tunedModelId = String(object.tunedModelId); + if (object.tunedModel != null) { + if (typeof object.tunedModel !== "object") + throw TypeError(".google.ai.generativelanguage.v1beta3.CreateTunedModelRequest.tunedModel: object expected"); + message.tunedModel = $root.google.ai.generativelanguage.v1beta3.TunedModel.fromObject(object.tunedModel); + } + return message; + }; + + /** + * Creates a plain object from a CreateTunedModelRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.ai.generativelanguage.v1beta3.CreateTunedModelRequest + * @static + * @param {google.ai.generativelanguage.v1beta3.CreateTunedModelRequest} message CreateTunedModelRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CreateTunedModelRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.tunedModel = null; + if (message.tunedModelId != null && message.hasOwnProperty("tunedModelId")) { + object.tunedModelId = message.tunedModelId; + if (options.oneofs) + object._tunedModelId = "tunedModelId"; + } + if (message.tunedModel != null && message.hasOwnProperty("tunedModel")) + object.tunedModel = $root.google.ai.generativelanguage.v1beta3.TunedModel.toObject(message.tunedModel, options); + return object; + }; + + /** + * Converts this CreateTunedModelRequest to JSON. + * @function toJSON + * @memberof google.ai.generativelanguage.v1beta3.CreateTunedModelRequest + * @instance + * @returns {Object.} JSON object + */ + CreateTunedModelRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CreateTunedModelRequest + * @function getTypeUrl + * @memberof google.ai.generativelanguage.v1beta3.CreateTunedModelRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CreateTunedModelRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.ai.generativelanguage.v1beta3.CreateTunedModelRequest"; + }; + + return CreateTunedModelRequest; + })(); + + v1beta3.CreateTunedModelMetadata = (function() { + + /** + * Properties of a CreateTunedModelMetadata. + * @memberof google.ai.generativelanguage.v1beta3 + * @interface ICreateTunedModelMetadata + * @property {string|null} [tunedModel] CreateTunedModelMetadata tunedModel + * @property {number|null} [totalSteps] CreateTunedModelMetadata totalSteps + * @property {number|null} [completedSteps] CreateTunedModelMetadata completedSteps + * @property {number|null} [completedPercent] CreateTunedModelMetadata completedPercent + * @property {Array.|null} [snapshots] CreateTunedModelMetadata snapshots + */ + + /** + * Constructs a new CreateTunedModelMetadata. + * @memberof google.ai.generativelanguage.v1beta3 + * @classdesc Represents a CreateTunedModelMetadata. + * @implements ICreateTunedModelMetadata + * @constructor + * @param {google.ai.generativelanguage.v1beta3.ICreateTunedModelMetadata=} [properties] Properties to set + */ + function CreateTunedModelMetadata(properties) { + this.snapshots = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * CreateTunedModelMetadata tunedModel. + * @member {string} tunedModel + * @memberof google.ai.generativelanguage.v1beta3.CreateTunedModelMetadata + * @instance + */ + CreateTunedModelMetadata.prototype.tunedModel = ""; + + /** + * CreateTunedModelMetadata totalSteps. + * @member {number} totalSteps + * @memberof google.ai.generativelanguage.v1beta3.CreateTunedModelMetadata + * @instance + */ + CreateTunedModelMetadata.prototype.totalSteps = 0; + + /** + * CreateTunedModelMetadata completedSteps. + * @member {number} completedSteps + * @memberof google.ai.generativelanguage.v1beta3.CreateTunedModelMetadata + * @instance + */ + CreateTunedModelMetadata.prototype.completedSteps = 0; + + /** + * CreateTunedModelMetadata completedPercent. + * @member {number} completedPercent + * @memberof google.ai.generativelanguage.v1beta3.CreateTunedModelMetadata + * @instance + */ + CreateTunedModelMetadata.prototype.completedPercent = 0; + + /** + * CreateTunedModelMetadata snapshots. + * @member {Array.} snapshots + * @memberof google.ai.generativelanguage.v1beta3.CreateTunedModelMetadata + * @instance + */ + CreateTunedModelMetadata.prototype.snapshots = $util.emptyArray; + + /** + * Creates a new CreateTunedModelMetadata instance using the specified properties. + * @function create + * @memberof google.ai.generativelanguage.v1beta3.CreateTunedModelMetadata + * @static + * @param {google.ai.generativelanguage.v1beta3.ICreateTunedModelMetadata=} [properties] Properties to set + * @returns {google.ai.generativelanguage.v1beta3.CreateTunedModelMetadata} CreateTunedModelMetadata instance + */ + CreateTunedModelMetadata.create = function create(properties) { + return new CreateTunedModelMetadata(properties); + }; + + /** + * Encodes the specified CreateTunedModelMetadata message. Does not implicitly {@link google.ai.generativelanguage.v1beta3.CreateTunedModelMetadata.verify|verify} messages. + * @function encode + * @memberof google.ai.generativelanguage.v1beta3.CreateTunedModelMetadata + * @static + * @param {google.ai.generativelanguage.v1beta3.ICreateTunedModelMetadata} message CreateTunedModelMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateTunedModelMetadata.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.totalSteps != null && Object.hasOwnProperty.call(message, "totalSteps")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.totalSteps); + if (message.completedSteps != null && Object.hasOwnProperty.call(message, "completedSteps")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.completedSteps); + if (message.completedPercent != null && Object.hasOwnProperty.call(message, "completedPercent")) + writer.uint32(/* id 3, wireType 5 =*/29).float(message.completedPercent); + if (message.snapshots != null && message.snapshots.length) + for (var i = 0; i < message.snapshots.length; ++i) + $root.google.ai.generativelanguage.v1beta3.TuningSnapshot.encode(message.snapshots[i], writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.tunedModel != null && Object.hasOwnProperty.call(message, "tunedModel")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.tunedModel); + return writer; + }; + + /** + * Encodes the specified CreateTunedModelMetadata message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1beta3.CreateTunedModelMetadata.verify|verify} messages. + * @function encodeDelimited + * @memberof google.ai.generativelanguage.v1beta3.CreateTunedModelMetadata + * @static + * @param {google.ai.generativelanguage.v1beta3.ICreateTunedModelMetadata} message CreateTunedModelMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateTunedModelMetadata.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CreateTunedModelMetadata message from the specified reader or buffer. + * @function decode + * @memberof google.ai.generativelanguage.v1beta3.CreateTunedModelMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.ai.generativelanguage.v1beta3.CreateTunedModelMetadata} CreateTunedModelMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateTunedModelMetadata.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.ai.generativelanguage.v1beta3.CreateTunedModelMetadata(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 5: { + message.tunedModel = reader.string(); + break; + } + case 1: { + message.totalSteps = reader.int32(); + break; + } + case 2: { + message.completedSteps = reader.int32(); + break; + } + case 3: { + message.completedPercent = reader.float(); + break; + } + case 4: { + if (!(message.snapshots && message.snapshots.length)) + message.snapshots = []; + message.snapshots.push($root.google.ai.generativelanguage.v1beta3.TuningSnapshot.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CreateTunedModelMetadata message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.ai.generativelanguage.v1beta3.CreateTunedModelMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.ai.generativelanguage.v1beta3.CreateTunedModelMetadata} CreateTunedModelMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateTunedModelMetadata.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CreateTunedModelMetadata message. + * @function verify + * @memberof google.ai.generativelanguage.v1beta3.CreateTunedModelMetadata + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CreateTunedModelMetadata.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.tunedModel != null && message.hasOwnProperty("tunedModel")) + if (!$util.isString(message.tunedModel)) + return "tunedModel: string expected"; + if (message.totalSteps != null && message.hasOwnProperty("totalSteps")) + if (!$util.isInteger(message.totalSteps)) + return "totalSteps: integer expected"; + if (message.completedSteps != null && message.hasOwnProperty("completedSteps")) + if (!$util.isInteger(message.completedSteps)) + return "completedSteps: integer expected"; + if (message.completedPercent != null && message.hasOwnProperty("completedPercent")) + if (typeof message.completedPercent !== "number") + return "completedPercent: number expected"; + if (message.snapshots != null && message.hasOwnProperty("snapshots")) { + if (!Array.isArray(message.snapshots)) + return "snapshots: array expected"; + for (var i = 0; i < message.snapshots.length; ++i) { + var error = $root.google.ai.generativelanguage.v1beta3.TuningSnapshot.verify(message.snapshots[i]); + if (error) + return "snapshots." + error; + } + } + return null; + }; + + /** + * Creates a CreateTunedModelMetadata message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.ai.generativelanguage.v1beta3.CreateTunedModelMetadata + * @static + * @param {Object.} object Plain object + * @returns {google.ai.generativelanguage.v1beta3.CreateTunedModelMetadata} CreateTunedModelMetadata + */ + CreateTunedModelMetadata.fromObject = function fromObject(object) { + if (object instanceof $root.google.ai.generativelanguage.v1beta3.CreateTunedModelMetadata) + return object; + var message = new $root.google.ai.generativelanguage.v1beta3.CreateTunedModelMetadata(); + if (object.tunedModel != null) + message.tunedModel = String(object.tunedModel); + if (object.totalSteps != null) + message.totalSteps = object.totalSteps | 0; + if (object.completedSteps != null) + message.completedSteps = object.completedSteps | 0; + if (object.completedPercent != null) + message.completedPercent = Number(object.completedPercent); + if (object.snapshots) { + if (!Array.isArray(object.snapshots)) + throw TypeError(".google.ai.generativelanguage.v1beta3.CreateTunedModelMetadata.snapshots: array expected"); + message.snapshots = []; + for (var i = 0; i < object.snapshots.length; ++i) { + if (typeof object.snapshots[i] !== "object") + throw TypeError(".google.ai.generativelanguage.v1beta3.CreateTunedModelMetadata.snapshots: object expected"); + message.snapshots[i] = $root.google.ai.generativelanguage.v1beta3.TuningSnapshot.fromObject(object.snapshots[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a CreateTunedModelMetadata message. Also converts values to other types if specified. + * @function toObject + * @memberof google.ai.generativelanguage.v1beta3.CreateTunedModelMetadata + * @static + * @param {google.ai.generativelanguage.v1beta3.CreateTunedModelMetadata} message CreateTunedModelMetadata + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CreateTunedModelMetadata.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.snapshots = []; + if (options.defaults) { + object.totalSteps = 0; + object.completedSteps = 0; + object.completedPercent = 0; + object.tunedModel = ""; + } + if (message.totalSteps != null && message.hasOwnProperty("totalSteps")) + object.totalSteps = message.totalSteps; + if (message.completedSteps != null && message.hasOwnProperty("completedSteps")) + object.completedSteps = message.completedSteps; + if (message.completedPercent != null && message.hasOwnProperty("completedPercent")) + object.completedPercent = options.json && !isFinite(message.completedPercent) ? String(message.completedPercent) : message.completedPercent; + if (message.snapshots && message.snapshots.length) { + object.snapshots = []; + for (var j = 0; j < message.snapshots.length; ++j) + object.snapshots[j] = $root.google.ai.generativelanguage.v1beta3.TuningSnapshot.toObject(message.snapshots[j], options); + } + if (message.tunedModel != null && message.hasOwnProperty("tunedModel")) + object.tunedModel = message.tunedModel; + return object; + }; + + /** + * Converts this CreateTunedModelMetadata to JSON. + * @function toJSON + * @memberof google.ai.generativelanguage.v1beta3.CreateTunedModelMetadata + * @instance + * @returns {Object.} JSON object + */ + CreateTunedModelMetadata.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CreateTunedModelMetadata + * @function getTypeUrl + * @memberof google.ai.generativelanguage.v1beta3.CreateTunedModelMetadata + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CreateTunedModelMetadata.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.ai.generativelanguage.v1beta3.CreateTunedModelMetadata"; + }; + + return CreateTunedModelMetadata; + })(); + + v1beta3.UpdateTunedModelRequest = (function() { + + /** + * Properties of an UpdateTunedModelRequest. + * @memberof google.ai.generativelanguage.v1beta3 + * @interface IUpdateTunedModelRequest + * @property {google.ai.generativelanguage.v1beta3.ITunedModel|null} [tunedModel] UpdateTunedModelRequest tunedModel + * @property {google.protobuf.IFieldMask|null} [updateMask] UpdateTunedModelRequest updateMask + */ + + /** + * Constructs a new UpdateTunedModelRequest. + * @memberof google.ai.generativelanguage.v1beta3 + * @classdesc Represents an UpdateTunedModelRequest. + * @implements IUpdateTunedModelRequest + * @constructor + * @param {google.ai.generativelanguage.v1beta3.IUpdateTunedModelRequest=} [properties] Properties to set + */ + function UpdateTunedModelRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * UpdateTunedModelRequest tunedModel. + * @member {google.ai.generativelanguage.v1beta3.ITunedModel|null|undefined} tunedModel + * @memberof google.ai.generativelanguage.v1beta3.UpdateTunedModelRequest + * @instance + */ + UpdateTunedModelRequest.prototype.tunedModel = null; + + /** + * UpdateTunedModelRequest updateMask. + * @member {google.protobuf.IFieldMask|null|undefined} updateMask + * @memberof google.ai.generativelanguage.v1beta3.UpdateTunedModelRequest + * @instance + */ + UpdateTunedModelRequest.prototype.updateMask = null; + + /** + * Creates a new UpdateTunedModelRequest instance using the specified properties. + * @function create + * @memberof google.ai.generativelanguage.v1beta3.UpdateTunedModelRequest + * @static + * @param {google.ai.generativelanguage.v1beta3.IUpdateTunedModelRequest=} [properties] Properties to set + * @returns {google.ai.generativelanguage.v1beta3.UpdateTunedModelRequest} UpdateTunedModelRequest instance + */ + UpdateTunedModelRequest.create = function create(properties) { + return new UpdateTunedModelRequest(properties); + }; + + /** + * Encodes the specified UpdateTunedModelRequest message. Does not implicitly {@link google.ai.generativelanguage.v1beta3.UpdateTunedModelRequest.verify|verify} messages. + * @function encode + * @memberof google.ai.generativelanguage.v1beta3.UpdateTunedModelRequest + * @static + * @param {google.ai.generativelanguage.v1beta3.IUpdateTunedModelRequest} message UpdateTunedModelRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateTunedModelRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.tunedModel != null && Object.hasOwnProperty.call(message, "tunedModel")) + $root.google.ai.generativelanguage.v1beta3.TunedModel.encode(message.tunedModel, 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 UpdateTunedModelRequest message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1beta3.UpdateTunedModelRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.ai.generativelanguage.v1beta3.UpdateTunedModelRequest + * @static + * @param {google.ai.generativelanguage.v1beta3.IUpdateTunedModelRequest} message UpdateTunedModelRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateTunedModelRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an UpdateTunedModelRequest message from the specified reader or buffer. + * @function decode + * @memberof google.ai.generativelanguage.v1beta3.UpdateTunedModelRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.ai.generativelanguage.v1beta3.UpdateTunedModelRequest} UpdateTunedModelRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateTunedModelRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.ai.generativelanguage.v1beta3.UpdateTunedModelRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.tunedModel = $root.google.ai.generativelanguage.v1beta3.TunedModel.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 UpdateTunedModelRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.ai.generativelanguage.v1beta3.UpdateTunedModelRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.ai.generativelanguage.v1beta3.UpdateTunedModelRequest} UpdateTunedModelRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateTunedModelRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an UpdateTunedModelRequest message. + * @function verify + * @memberof google.ai.generativelanguage.v1beta3.UpdateTunedModelRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + UpdateTunedModelRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.tunedModel != null && message.hasOwnProperty("tunedModel")) { + var error = $root.google.ai.generativelanguage.v1beta3.TunedModel.verify(message.tunedModel); + if (error) + return "tunedModel." + 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 UpdateTunedModelRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.ai.generativelanguage.v1beta3.UpdateTunedModelRequest + * @static + * @param {Object.} object Plain object + * @returns {google.ai.generativelanguage.v1beta3.UpdateTunedModelRequest} UpdateTunedModelRequest + */ + UpdateTunedModelRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.ai.generativelanguage.v1beta3.UpdateTunedModelRequest) + return object; + var message = new $root.google.ai.generativelanguage.v1beta3.UpdateTunedModelRequest(); + if (object.tunedModel != null) { + if (typeof object.tunedModel !== "object") + throw TypeError(".google.ai.generativelanguage.v1beta3.UpdateTunedModelRequest.tunedModel: object expected"); + message.tunedModel = $root.google.ai.generativelanguage.v1beta3.TunedModel.fromObject(object.tunedModel); + } + if (object.updateMask != null) { + if (typeof object.updateMask !== "object") + throw TypeError(".google.ai.generativelanguage.v1beta3.UpdateTunedModelRequest.updateMask: object expected"); + message.updateMask = $root.google.protobuf.FieldMask.fromObject(object.updateMask); + } + return message; + }; + + /** + * Creates a plain object from an UpdateTunedModelRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.ai.generativelanguage.v1beta3.UpdateTunedModelRequest + * @static + * @param {google.ai.generativelanguage.v1beta3.UpdateTunedModelRequest} message UpdateTunedModelRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + UpdateTunedModelRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.tunedModel = null; + object.updateMask = null; + } + if (message.tunedModel != null && message.hasOwnProperty("tunedModel")) + object.tunedModel = $root.google.ai.generativelanguage.v1beta3.TunedModel.toObject(message.tunedModel, options); + if (message.updateMask != null && message.hasOwnProperty("updateMask")) + object.updateMask = $root.google.protobuf.FieldMask.toObject(message.updateMask, options); + return object; + }; + + /** + * Converts this UpdateTunedModelRequest to JSON. + * @function toJSON + * @memberof google.ai.generativelanguage.v1beta3.UpdateTunedModelRequest + * @instance + * @returns {Object.} JSON object + */ + UpdateTunedModelRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for UpdateTunedModelRequest + * @function getTypeUrl + * @memberof google.ai.generativelanguage.v1beta3.UpdateTunedModelRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + UpdateTunedModelRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.ai.generativelanguage.v1beta3.UpdateTunedModelRequest"; + }; + + return UpdateTunedModelRequest; + })(); + + v1beta3.DeleteTunedModelRequest = (function() { + + /** + * Properties of a DeleteTunedModelRequest. + * @memberof google.ai.generativelanguage.v1beta3 + * @interface IDeleteTunedModelRequest + * @property {string|null} [name] DeleteTunedModelRequest name + */ + + /** + * Constructs a new DeleteTunedModelRequest. + * @memberof google.ai.generativelanguage.v1beta3 + * @classdesc Represents a DeleteTunedModelRequest. + * @implements IDeleteTunedModelRequest + * @constructor + * @param {google.ai.generativelanguage.v1beta3.IDeleteTunedModelRequest=} [properties] Properties to set + */ + function DeleteTunedModelRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * DeleteTunedModelRequest name. + * @member {string} name + * @memberof google.ai.generativelanguage.v1beta3.DeleteTunedModelRequest + * @instance + */ + DeleteTunedModelRequest.prototype.name = ""; + + /** + * Creates a new DeleteTunedModelRequest instance using the specified properties. + * @function create + * @memberof google.ai.generativelanguage.v1beta3.DeleteTunedModelRequest + * @static + * @param {google.ai.generativelanguage.v1beta3.IDeleteTunedModelRequest=} [properties] Properties to set + * @returns {google.ai.generativelanguage.v1beta3.DeleteTunedModelRequest} DeleteTunedModelRequest instance + */ + DeleteTunedModelRequest.create = function create(properties) { + return new DeleteTunedModelRequest(properties); + }; + + /** + * Encodes the specified DeleteTunedModelRequest message. Does not implicitly {@link google.ai.generativelanguage.v1beta3.DeleteTunedModelRequest.verify|verify} messages. + * @function encode + * @memberof google.ai.generativelanguage.v1beta3.DeleteTunedModelRequest + * @static + * @param {google.ai.generativelanguage.v1beta3.IDeleteTunedModelRequest} message DeleteTunedModelRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteTunedModelRequest.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 DeleteTunedModelRequest message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1beta3.DeleteTunedModelRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.ai.generativelanguage.v1beta3.DeleteTunedModelRequest + * @static + * @param {google.ai.generativelanguage.v1beta3.IDeleteTunedModelRequest} message DeleteTunedModelRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteTunedModelRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DeleteTunedModelRequest message from the specified reader or buffer. + * @function decode + * @memberof google.ai.generativelanguage.v1beta3.DeleteTunedModelRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.ai.generativelanguage.v1beta3.DeleteTunedModelRequest} DeleteTunedModelRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteTunedModelRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.ai.generativelanguage.v1beta3.DeleteTunedModelRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DeleteTunedModelRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.ai.generativelanguage.v1beta3.DeleteTunedModelRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.ai.generativelanguage.v1beta3.DeleteTunedModelRequest} DeleteTunedModelRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteTunedModelRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DeleteTunedModelRequest message. + * @function verify + * @memberof google.ai.generativelanguage.v1beta3.DeleteTunedModelRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DeleteTunedModelRequest.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 DeleteTunedModelRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.ai.generativelanguage.v1beta3.DeleteTunedModelRequest + * @static + * @param {Object.} object Plain object + * @returns {google.ai.generativelanguage.v1beta3.DeleteTunedModelRequest} DeleteTunedModelRequest + */ + DeleteTunedModelRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.ai.generativelanguage.v1beta3.DeleteTunedModelRequest) + return object; + var message = new $root.google.ai.generativelanguage.v1beta3.DeleteTunedModelRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a DeleteTunedModelRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.ai.generativelanguage.v1beta3.DeleteTunedModelRequest + * @static + * @param {google.ai.generativelanguage.v1beta3.DeleteTunedModelRequest} message DeleteTunedModelRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DeleteTunedModelRequest.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 DeleteTunedModelRequest to JSON. + * @function toJSON + * @memberof google.ai.generativelanguage.v1beta3.DeleteTunedModelRequest + * @instance + * @returns {Object.} JSON object + */ + DeleteTunedModelRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DeleteTunedModelRequest + * @function getTypeUrl + * @memberof google.ai.generativelanguage.v1beta3.DeleteTunedModelRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DeleteTunedModelRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.ai.generativelanguage.v1beta3.DeleteTunedModelRequest"; + }; + + return DeleteTunedModelRequest; + })(); + + v1beta3.TunedModel = (function() { + + /** + * Properties of a TunedModel. + * @memberof google.ai.generativelanguage.v1beta3 + * @interface ITunedModel + * @property {google.ai.generativelanguage.v1beta3.ITunedModelSource|null} [tunedModelSource] TunedModel tunedModelSource + * @property {string|null} [baseModel] TunedModel baseModel + * @property {string|null} [name] TunedModel name + * @property {string|null} [displayName] TunedModel displayName + * @property {string|null} [description] TunedModel description + * @property {number|null} [temperature] TunedModel temperature + * @property {number|null} [topP] TunedModel topP + * @property {number|null} [topK] TunedModel topK + * @property {google.ai.generativelanguage.v1beta3.TunedModel.State|null} [state] TunedModel state + * @property {google.protobuf.ITimestamp|null} [createTime] TunedModel createTime + * @property {google.protobuf.ITimestamp|null} [updateTime] TunedModel updateTime + * @property {google.ai.generativelanguage.v1beta3.ITuningTask|null} [tuningTask] TunedModel tuningTask + */ + + /** + * Constructs a new TunedModel. + * @memberof google.ai.generativelanguage.v1beta3 + * @classdesc Represents a TunedModel. + * @implements ITunedModel + * @constructor + * @param {google.ai.generativelanguage.v1beta3.ITunedModel=} [properties] Properties to set + */ + function TunedModel(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * TunedModel tunedModelSource. + * @member {google.ai.generativelanguage.v1beta3.ITunedModelSource|null|undefined} tunedModelSource + * @memberof google.ai.generativelanguage.v1beta3.TunedModel + * @instance + */ + TunedModel.prototype.tunedModelSource = null; + + /** + * TunedModel baseModel. + * @member {string|null|undefined} baseModel + * @memberof google.ai.generativelanguage.v1beta3.TunedModel + * @instance + */ + TunedModel.prototype.baseModel = null; + + /** + * TunedModel name. + * @member {string} name + * @memberof google.ai.generativelanguage.v1beta3.TunedModel + * @instance + */ + TunedModel.prototype.name = ""; + + /** + * TunedModel displayName. + * @member {string} displayName + * @memberof google.ai.generativelanguage.v1beta3.TunedModel + * @instance + */ + TunedModel.prototype.displayName = ""; + + /** + * TunedModel description. + * @member {string} description + * @memberof google.ai.generativelanguage.v1beta3.TunedModel + * @instance + */ + TunedModel.prototype.description = ""; + + /** + * TunedModel temperature. + * @member {number|null|undefined} temperature + * @memberof google.ai.generativelanguage.v1beta3.TunedModel + * @instance + */ + TunedModel.prototype.temperature = null; + + /** + * TunedModel topP. + * @member {number|null|undefined} topP + * @memberof google.ai.generativelanguage.v1beta3.TunedModel + * @instance + */ + TunedModel.prototype.topP = null; + + /** + * TunedModel topK. + * @member {number|null|undefined} topK + * @memberof google.ai.generativelanguage.v1beta3.TunedModel + * @instance + */ + TunedModel.prototype.topK = null; + + /** + * TunedModel state. + * @member {google.ai.generativelanguage.v1beta3.TunedModel.State} state + * @memberof google.ai.generativelanguage.v1beta3.TunedModel + * @instance + */ + TunedModel.prototype.state = 0; + + /** + * TunedModel createTime. + * @member {google.protobuf.ITimestamp|null|undefined} createTime + * @memberof google.ai.generativelanguage.v1beta3.TunedModel + * @instance + */ + TunedModel.prototype.createTime = null; + + /** + * TunedModel updateTime. + * @member {google.protobuf.ITimestamp|null|undefined} updateTime + * @memberof google.ai.generativelanguage.v1beta3.TunedModel + * @instance + */ + TunedModel.prototype.updateTime = null; + + /** + * TunedModel tuningTask. + * @member {google.ai.generativelanguage.v1beta3.ITuningTask|null|undefined} tuningTask + * @memberof google.ai.generativelanguage.v1beta3.TunedModel + * @instance + */ + TunedModel.prototype.tuningTask = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * TunedModel sourceModel. + * @member {"tunedModelSource"|"baseModel"|undefined} sourceModel + * @memberof google.ai.generativelanguage.v1beta3.TunedModel + * @instance + */ + Object.defineProperty(TunedModel.prototype, "sourceModel", { + get: $util.oneOfGetter($oneOfFields = ["tunedModelSource", "baseModel"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * TunedModel _temperature. + * @member {"temperature"|undefined} _temperature + * @memberof google.ai.generativelanguage.v1beta3.TunedModel + * @instance + */ + Object.defineProperty(TunedModel.prototype, "_temperature", { + get: $util.oneOfGetter($oneOfFields = ["temperature"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * TunedModel _topP. + * @member {"topP"|undefined} _topP + * @memberof google.ai.generativelanguage.v1beta3.TunedModel + * @instance + */ + Object.defineProperty(TunedModel.prototype, "_topP", { + get: $util.oneOfGetter($oneOfFields = ["topP"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * TunedModel _topK. + * @member {"topK"|undefined} _topK + * @memberof google.ai.generativelanguage.v1beta3.TunedModel + * @instance + */ + Object.defineProperty(TunedModel.prototype, "_topK", { + get: $util.oneOfGetter($oneOfFields = ["topK"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new TunedModel instance using the specified properties. + * @function create + * @memberof google.ai.generativelanguage.v1beta3.TunedModel + * @static + * @param {google.ai.generativelanguage.v1beta3.ITunedModel=} [properties] Properties to set + * @returns {google.ai.generativelanguage.v1beta3.TunedModel} TunedModel instance + */ + TunedModel.create = function create(properties) { + return new TunedModel(properties); + }; + + /** + * Encodes the specified TunedModel message. Does not implicitly {@link google.ai.generativelanguage.v1beta3.TunedModel.verify|verify} messages. + * @function encode + * @memberof google.ai.generativelanguage.v1beta3.TunedModel + * @static + * @param {google.ai.generativelanguage.v1beta3.ITunedModel} message TunedModel message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TunedModel.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.tunedModelSource != null && Object.hasOwnProperty.call(message, "tunedModelSource")) + $root.google.ai.generativelanguage.v1beta3.TunedModelSource.encode(message.tunedModelSource, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.baseModel != null && Object.hasOwnProperty.call(message, "baseModel")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.baseModel); + if (message.displayName != null && Object.hasOwnProperty.call(message, "displayName")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.displayName); + if (message.description != null && Object.hasOwnProperty.call(message, "description")) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.description); + if (message.state != null && Object.hasOwnProperty.call(message, "state")) + writer.uint32(/* id 7, wireType 0 =*/56).int32(message.state); + if (message.createTime != null && Object.hasOwnProperty.call(message, "createTime")) + $root.google.protobuf.Timestamp.encode(message.createTime, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); + if (message.updateTime != null && Object.hasOwnProperty.call(message, "updateTime")) + $root.google.protobuf.Timestamp.encode(message.updateTime, writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim(); + if (message.tuningTask != null && Object.hasOwnProperty.call(message, "tuningTask")) + $root.google.ai.generativelanguage.v1beta3.TuningTask.encode(message.tuningTask, writer.uint32(/* id 10, wireType 2 =*/82).fork()).ldelim(); + if (message.temperature != null && Object.hasOwnProperty.call(message, "temperature")) + writer.uint32(/* id 11, wireType 5 =*/93).float(message.temperature); + if (message.topP != null && Object.hasOwnProperty.call(message, "topP")) + writer.uint32(/* id 12, wireType 5 =*/101).float(message.topP); + if (message.topK != null && Object.hasOwnProperty.call(message, "topK")) + writer.uint32(/* id 13, wireType 0 =*/104).int32(message.topK); + return writer; + }; + + /** + * Encodes the specified TunedModel message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1beta3.TunedModel.verify|verify} messages. + * @function encodeDelimited + * @memberof google.ai.generativelanguage.v1beta3.TunedModel + * @static + * @param {google.ai.generativelanguage.v1beta3.ITunedModel} message TunedModel message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TunedModel.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a TunedModel message from the specified reader or buffer. + * @function decode + * @memberof google.ai.generativelanguage.v1beta3.TunedModel + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.ai.generativelanguage.v1beta3.TunedModel} TunedModel + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TunedModel.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.ai.generativelanguage.v1beta3.TunedModel(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 3: { + message.tunedModelSource = $root.google.ai.generativelanguage.v1beta3.TunedModelSource.decode(reader, reader.uint32()); + break; + } + case 4: { + message.baseModel = reader.string(); + break; + } + case 1: { + message.name = reader.string(); + break; + } + case 5: { + message.displayName = reader.string(); + break; + } + case 6: { + message.description = reader.string(); + break; + } + case 11: { + message.temperature = reader.float(); + break; + } + case 12: { + message.topP = reader.float(); + break; + } + case 13: { + message.topK = reader.int32(); + break; + } + case 7: { + message.state = reader.int32(); + break; + } + case 8: { + message.createTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 9: { + message.updateTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 10: { + message.tuningTask = $root.google.ai.generativelanguage.v1beta3.TuningTask.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a TunedModel message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.ai.generativelanguage.v1beta3.TunedModel + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.ai.generativelanguage.v1beta3.TunedModel} TunedModel + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TunedModel.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a TunedModel message. + * @function verify + * @memberof google.ai.generativelanguage.v1beta3.TunedModel + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + TunedModel.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.tunedModelSource != null && message.hasOwnProperty("tunedModelSource")) { + properties.sourceModel = 1; + { + var error = $root.google.ai.generativelanguage.v1beta3.TunedModelSource.verify(message.tunedModelSource); + if (error) + return "tunedModelSource." + error; + } + } + if (message.baseModel != null && message.hasOwnProperty("baseModel")) { + if (properties.sourceModel === 1) + return "sourceModel: multiple values"; + properties.sourceModel = 1; + if (!$util.isString(message.baseModel)) + return "baseModel: string expected"; + } + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.displayName != null && message.hasOwnProperty("displayName")) + if (!$util.isString(message.displayName)) + return "displayName: string expected"; + if (message.description != null && message.hasOwnProperty("description")) + if (!$util.isString(message.description)) + return "description: string expected"; + if (message.temperature != null && message.hasOwnProperty("temperature")) { + properties._temperature = 1; + if (typeof message.temperature !== "number") + return "temperature: number expected"; + } + if (message.topP != null && message.hasOwnProperty("topP")) { + properties._topP = 1; + if (typeof message.topP !== "number") + return "topP: number expected"; + } + if (message.topK != null && message.hasOwnProperty("topK")) { + properties._topK = 1; + if (!$util.isInteger(message.topK)) + return "topK: integer expected"; + } + if (message.state != null && message.hasOwnProperty("state")) + switch (message.state) { + default: + return "state: enum value expected"; + case 0: + case 1: + case 2: + case 3: + 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.tuningTask != null && message.hasOwnProperty("tuningTask")) { + var error = $root.google.ai.generativelanguage.v1beta3.TuningTask.verify(message.tuningTask); + if (error) + return "tuningTask." + error; + } + return null; + }; + + /** + * Creates a TunedModel message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.ai.generativelanguage.v1beta3.TunedModel + * @static + * @param {Object.} object Plain object + * @returns {google.ai.generativelanguage.v1beta3.TunedModel} TunedModel + */ + TunedModel.fromObject = function fromObject(object) { + if (object instanceof $root.google.ai.generativelanguage.v1beta3.TunedModel) + return object; + var message = new $root.google.ai.generativelanguage.v1beta3.TunedModel(); + if (object.tunedModelSource != null) { + if (typeof object.tunedModelSource !== "object") + throw TypeError(".google.ai.generativelanguage.v1beta3.TunedModel.tunedModelSource: object expected"); + message.tunedModelSource = $root.google.ai.generativelanguage.v1beta3.TunedModelSource.fromObject(object.tunedModelSource); + } + if (object.baseModel != null) + message.baseModel = String(object.baseModel); + if (object.name != null) + message.name = String(object.name); + if (object.displayName != null) + message.displayName = String(object.displayName); + if (object.description != null) + message.description = String(object.description); + if (object.temperature != null) + message.temperature = Number(object.temperature); + if (object.topP != null) + message.topP = Number(object.topP); + if (object.topK != null) + message.topK = object.topK | 0; + 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 "CREATING": + case 1: + message.state = 1; + break; + case "ACTIVE": + case 2: + message.state = 2; + break; + case "FAILED": + case 3: + message.state = 3; + break; + } + if (object.createTime != null) { + if (typeof object.createTime !== "object") + throw TypeError(".google.ai.generativelanguage.v1beta3.TunedModel.createTime: object expected"); + message.createTime = $root.google.protobuf.Timestamp.fromObject(object.createTime); + } + if (object.updateTime != null) { + if (typeof object.updateTime !== "object") + throw TypeError(".google.ai.generativelanguage.v1beta3.TunedModel.updateTime: object expected"); + message.updateTime = $root.google.protobuf.Timestamp.fromObject(object.updateTime); + } + if (object.tuningTask != null) { + if (typeof object.tuningTask !== "object") + throw TypeError(".google.ai.generativelanguage.v1beta3.TunedModel.tuningTask: object expected"); + message.tuningTask = $root.google.ai.generativelanguage.v1beta3.TuningTask.fromObject(object.tuningTask); + } + return message; + }; + + /** + * Creates a plain object from a TunedModel message. Also converts values to other types if specified. + * @function toObject + * @memberof google.ai.generativelanguage.v1beta3.TunedModel + * @static + * @param {google.ai.generativelanguage.v1beta3.TunedModel} message TunedModel + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + TunedModel.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.displayName = ""; + object.description = ""; + object.state = options.enums === String ? "STATE_UNSPECIFIED" : 0; + object.createTime = null; + object.updateTime = null; + object.tuningTask = null; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.tunedModelSource != null && message.hasOwnProperty("tunedModelSource")) { + object.tunedModelSource = $root.google.ai.generativelanguage.v1beta3.TunedModelSource.toObject(message.tunedModelSource, options); + if (options.oneofs) + object.sourceModel = "tunedModelSource"; + } + if (message.baseModel != null && message.hasOwnProperty("baseModel")) { + object.baseModel = message.baseModel; + if (options.oneofs) + object.sourceModel = "baseModel"; + } + if (message.displayName != null && message.hasOwnProperty("displayName")) + object.displayName = message.displayName; + if (message.description != null && message.hasOwnProperty("description")) + object.description = message.description; + if (message.state != null && message.hasOwnProperty("state")) + object.state = options.enums === String ? $root.google.ai.generativelanguage.v1beta3.TunedModel.State[message.state] === undefined ? message.state : $root.google.ai.generativelanguage.v1beta3.TunedModel.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.tuningTask != null && message.hasOwnProperty("tuningTask")) + object.tuningTask = $root.google.ai.generativelanguage.v1beta3.TuningTask.toObject(message.tuningTask, options); + if (message.temperature != null && message.hasOwnProperty("temperature")) { + object.temperature = options.json && !isFinite(message.temperature) ? String(message.temperature) : message.temperature; + if (options.oneofs) + object._temperature = "temperature"; + } + if (message.topP != null && message.hasOwnProperty("topP")) { + object.topP = options.json && !isFinite(message.topP) ? String(message.topP) : message.topP; + if (options.oneofs) + object._topP = "topP"; + } + if (message.topK != null && message.hasOwnProperty("topK")) { + object.topK = message.topK; + if (options.oneofs) + object._topK = "topK"; + } + return object; + }; + + /** + * Converts this TunedModel to JSON. + * @function toJSON + * @memberof google.ai.generativelanguage.v1beta3.TunedModel + * @instance + * @returns {Object.} JSON object + */ + TunedModel.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for TunedModel + * @function getTypeUrl + * @memberof google.ai.generativelanguage.v1beta3.TunedModel + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TunedModel.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.ai.generativelanguage.v1beta3.TunedModel"; + }; + + /** + * State enum. + * @name google.ai.generativelanguage.v1beta3.TunedModel.State + * @enum {number} + * @property {number} STATE_UNSPECIFIED=0 STATE_UNSPECIFIED value + * @property {number} CREATING=1 CREATING value + * @property {number} ACTIVE=2 ACTIVE value + * @property {number} FAILED=3 FAILED value + */ + TunedModel.State = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "STATE_UNSPECIFIED"] = 0; + values[valuesById[1] = "CREATING"] = 1; + values[valuesById[2] = "ACTIVE"] = 2; + values[valuesById[3] = "FAILED"] = 3; + return values; + })(); + + return TunedModel; + })(); + + v1beta3.TunedModelSource = (function() { + + /** + * Properties of a TunedModelSource. + * @memberof google.ai.generativelanguage.v1beta3 + * @interface ITunedModelSource + * @property {string|null} [tunedModel] TunedModelSource tunedModel + * @property {string|null} [baseModel] TunedModelSource baseModel + */ + + /** + * Constructs a new TunedModelSource. + * @memberof google.ai.generativelanguage.v1beta3 + * @classdesc Represents a TunedModelSource. + * @implements ITunedModelSource + * @constructor + * @param {google.ai.generativelanguage.v1beta3.ITunedModelSource=} [properties] Properties to set + */ + function TunedModelSource(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * TunedModelSource tunedModel. + * @member {string} tunedModel + * @memberof google.ai.generativelanguage.v1beta3.TunedModelSource + * @instance + */ + TunedModelSource.prototype.tunedModel = ""; + + /** + * TunedModelSource baseModel. + * @member {string} baseModel + * @memberof google.ai.generativelanguage.v1beta3.TunedModelSource + * @instance + */ + TunedModelSource.prototype.baseModel = ""; + + /** + * Creates a new TunedModelSource instance using the specified properties. + * @function create + * @memberof google.ai.generativelanguage.v1beta3.TunedModelSource + * @static + * @param {google.ai.generativelanguage.v1beta3.ITunedModelSource=} [properties] Properties to set + * @returns {google.ai.generativelanguage.v1beta3.TunedModelSource} TunedModelSource instance + */ + TunedModelSource.create = function create(properties) { + return new TunedModelSource(properties); + }; + + /** + * Encodes the specified TunedModelSource message. Does not implicitly {@link google.ai.generativelanguage.v1beta3.TunedModelSource.verify|verify} messages. + * @function encode + * @memberof google.ai.generativelanguage.v1beta3.TunedModelSource + * @static + * @param {google.ai.generativelanguage.v1beta3.ITunedModelSource} message TunedModelSource message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TunedModelSource.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.tunedModel != null && Object.hasOwnProperty.call(message, "tunedModel")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.tunedModel); + if (message.baseModel != null && Object.hasOwnProperty.call(message, "baseModel")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.baseModel); + return writer; + }; + + /** + * Encodes the specified TunedModelSource message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1beta3.TunedModelSource.verify|verify} messages. + * @function encodeDelimited + * @memberof google.ai.generativelanguage.v1beta3.TunedModelSource + * @static + * @param {google.ai.generativelanguage.v1beta3.ITunedModelSource} message TunedModelSource message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TunedModelSource.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a TunedModelSource message from the specified reader or buffer. + * @function decode + * @memberof google.ai.generativelanguage.v1beta3.TunedModelSource + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.ai.generativelanguage.v1beta3.TunedModelSource} TunedModelSource + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TunedModelSource.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.ai.generativelanguage.v1beta3.TunedModelSource(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.tunedModel = reader.string(); + break; + } + case 2: { + message.baseModel = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a TunedModelSource message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.ai.generativelanguage.v1beta3.TunedModelSource + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.ai.generativelanguage.v1beta3.TunedModelSource} TunedModelSource + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TunedModelSource.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a TunedModelSource message. + * @function verify + * @memberof google.ai.generativelanguage.v1beta3.TunedModelSource + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + TunedModelSource.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.tunedModel != null && message.hasOwnProperty("tunedModel")) + if (!$util.isString(message.tunedModel)) + return "tunedModel: string expected"; + if (message.baseModel != null && message.hasOwnProperty("baseModel")) + if (!$util.isString(message.baseModel)) + return "baseModel: string expected"; + return null; + }; + + /** + * Creates a TunedModelSource message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.ai.generativelanguage.v1beta3.TunedModelSource + * @static + * @param {Object.} object Plain object + * @returns {google.ai.generativelanguage.v1beta3.TunedModelSource} TunedModelSource + */ + TunedModelSource.fromObject = function fromObject(object) { + if (object instanceof $root.google.ai.generativelanguage.v1beta3.TunedModelSource) + return object; + var message = new $root.google.ai.generativelanguage.v1beta3.TunedModelSource(); + if (object.tunedModel != null) + message.tunedModel = String(object.tunedModel); + if (object.baseModel != null) + message.baseModel = String(object.baseModel); + return message; + }; + + /** + * Creates a plain object from a TunedModelSource message. Also converts values to other types if specified. + * @function toObject + * @memberof google.ai.generativelanguage.v1beta3.TunedModelSource + * @static + * @param {google.ai.generativelanguage.v1beta3.TunedModelSource} message TunedModelSource + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + TunedModelSource.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.tunedModel = ""; + object.baseModel = ""; + } + if (message.tunedModel != null && message.hasOwnProperty("tunedModel")) + object.tunedModel = message.tunedModel; + if (message.baseModel != null && message.hasOwnProperty("baseModel")) + object.baseModel = message.baseModel; + return object; + }; + + /** + * Converts this TunedModelSource to JSON. + * @function toJSON + * @memberof google.ai.generativelanguage.v1beta3.TunedModelSource + * @instance + * @returns {Object.} JSON object + */ + TunedModelSource.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for TunedModelSource + * @function getTypeUrl + * @memberof google.ai.generativelanguage.v1beta3.TunedModelSource + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TunedModelSource.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.ai.generativelanguage.v1beta3.TunedModelSource"; + }; + + return TunedModelSource; + })(); + + v1beta3.TuningTask = (function() { + + /** + * Properties of a TuningTask. + * @memberof google.ai.generativelanguage.v1beta3 + * @interface ITuningTask + * @property {google.protobuf.ITimestamp|null} [startTime] TuningTask startTime + * @property {google.protobuf.ITimestamp|null} [completeTime] TuningTask completeTime + * @property {Array.|null} [snapshots] TuningTask snapshots + * @property {google.ai.generativelanguage.v1beta3.IDataset|null} [trainingData] TuningTask trainingData + * @property {google.ai.generativelanguage.v1beta3.IHyperparameters|null} [hyperparameters] TuningTask hyperparameters + */ + + /** + * Constructs a new TuningTask. + * @memberof google.ai.generativelanguage.v1beta3 + * @classdesc Represents a TuningTask. + * @implements ITuningTask + * @constructor + * @param {google.ai.generativelanguage.v1beta3.ITuningTask=} [properties] Properties to set + */ + function TuningTask(properties) { + this.snapshots = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * TuningTask startTime. + * @member {google.protobuf.ITimestamp|null|undefined} startTime + * @memberof google.ai.generativelanguage.v1beta3.TuningTask + * @instance + */ + TuningTask.prototype.startTime = null; + + /** + * TuningTask completeTime. + * @member {google.protobuf.ITimestamp|null|undefined} completeTime + * @memberof google.ai.generativelanguage.v1beta3.TuningTask + * @instance + */ + TuningTask.prototype.completeTime = null; + + /** + * TuningTask snapshots. + * @member {Array.} snapshots + * @memberof google.ai.generativelanguage.v1beta3.TuningTask + * @instance + */ + TuningTask.prototype.snapshots = $util.emptyArray; + + /** + * TuningTask trainingData. + * @member {google.ai.generativelanguage.v1beta3.IDataset|null|undefined} trainingData + * @memberof google.ai.generativelanguage.v1beta3.TuningTask + * @instance + */ + TuningTask.prototype.trainingData = null; + + /** + * TuningTask hyperparameters. + * @member {google.ai.generativelanguage.v1beta3.IHyperparameters|null|undefined} hyperparameters + * @memberof google.ai.generativelanguage.v1beta3.TuningTask + * @instance + */ + TuningTask.prototype.hyperparameters = null; + + /** + * Creates a new TuningTask instance using the specified properties. + * @function create + * @memberof google.ai.generativelanguage.v1beta3.TuningTask + * @static + * @param {google.ai.generativelanguage.v1beta3.ITuningTask=} [properties] Properties to set + * @returns {google.ai.generativelanguage.v1beta3.TuningTask} TuningTask instance + */ + TuningTask.create = function create(properties) { + return new TuningTask(properties); + }; + + /** + * Encodes the specified TuningTask message. Does not implicitly {@link google.ai.generativelanguage.v1beta3.TuningTask.verify|verify} messages. + * @function encode + * @memberof google.ai.generativelanguage.v1beta3.TuningTask + * @static + * @param {google.ai.generativelanguage.v1beta3.ITuningTask} message TuningTask message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TuningTask.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.completeTime != null && Object.hasOwnProperty.call(message, "completeTime")) + $root.google.protobuf.Timestamp.encode(message.completeTime, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.snapshots != null && message.snapshots.length) + for (var i = 0; i < message.snapshots.length; ++i) + $root.google.ai.generativelanguage.v1beta3.TuningSnapshot.encode(message.snapshots[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.trainingData != null && Object.hasOwnProperty.call(message, "trainingData")) + $root.google.ai.generativelanguage.v1beta3.Dataset.encode(message.trainingData, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.hyperparameters != null && Object.hasOwnProperty.call(message, "hyperparameters")) + $root.google.ai.generativelanguage.v1beta3.Hyperparameters.encode(message.hyperparameters, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified TuningTask message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1beta3.TuningTask.verify|verify} messages. + * @function encodeDelimited + * @memberof google.ai.generativelanguage.v1beta3.TuningTask + * @static + * @param {google.ai.generativelanguage.v1beta3.ITuningTask} message TuningTask message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TuningTask.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a TuningTask message from the specified reader or buffer. + * @function decode + * @memberof google.ai.generativelanguage.v1beta3.TuningTask + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.ai.generativelanguage.v1beta3.TuningTask} TuningTask + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TuningTask.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.ai.generativelanguage.v1beta3.TuningTask(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.startTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 2: { + message.completeTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 3: { + if (!(message.snapshots && message.snapshots.length)) + message.snapshots = []; + message.snapshots.push($root.google.ai.generativelanguage.v1beta3.TuningSnapshot.decode(reader, reader.uint32())); + break; + } + case 4: { + message.trainingData = $root.google.ai.generativelanguage.v1beta3.Dataset.decode(reader, reader.uint32()); + break; + } + case 5: { + message.hyperparameters = $root.google.ai.generativelanguage.v1beta3.Hyperparameters.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a TuningTask message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.ai.generativelanguage.v1beta3.TuningTask + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.ai.generativelanguage.v1beta3.TuningTask} TuningTask + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TuningTask.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a TuningTask message. + * @function verify + * @memberof google.ai.generativelanguage.v1beta3.TuningTask + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + TuningTask.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.completeTime != null && message.hasOwnProperty("completeTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.completeTime); + if (error) + return "completeTime." + error; + } + if (message.snapshots != null && message.hasOwnProperty("snapshots")) { + if (!Array.isArray(message.snapshots)) + return "snapshots: array expected"; + for (var i = 0; i < message.snapshots.length; ++i) { + var error = $root.google.ai.generativelanguage.v1beta3.TuningSnapshot.verify(message.snapshots[i]); + if (error) + return "snapshots." + error; + } + } + if (message.trainingData != null && message.hasOwnProperty("trainingData")) { + var error = $root.google.ai.generativelanguage.v1beta3.Dataset.verify(message.trainingData); + if (error) + return "trainingData." + error; + } + if (message.hyperparameters != null && message.hasOwnProperty("hyperparameters")) { + var error = $root.google.ai.generativelanguage.v1beta3.Hyperparameters.verify(message.hyperparameters); + if (error) + return "hyperparameters." + error; + } + return null; + }; + + /** + * Creates a TuningTask message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.ai.generativelanguage.v1beta3.TuningTask + * @static + * @param {Object.} object Plain object + * @returns {google.ai.generativelanguage.v1beta3.TuningTask} TuningTask + */ + TuningTask.fromObject = function fromObject(object) { + if (object instanceof $root.google.ai.generativelanguage.v1beta3.TuningTask) + return object; + var message = new $root.google.ai.generativelanguage.v1beta3.TuningTask(); + if (object.startTime != null) { + if (typeof object.startTime !== "object") + throw TypeError(".google.ai.generativelanguage.v1beta3.TuningTask.startTime: object expected"); + message.startTime = $root.google.protobuf.Timestamp.fromObject(object.startTime); + } + if (object.completeTime != null) { + if (typeof object.completeTime !== "object") + throw TypeError(".google.ai.generativelanguage.v1beta3.TuningTask.completeTime: object expected"); + message.completeTime = $root.google.protobuf.Timestamp.fromObject(object.completeTime); + } + if (object.snapshots) { + if (!Array.isArray(object.snapshots)) + throw TypeError(".google.ai.generativelanguage.v1beta3.TuningTask.snapshots: array expected"); + message.snapshots = []; + for (var i = 0; i < object.snapshots.length; ++i) { + if (typeof object.snapshots[i] !== "object") + throw TypeError(".google.ai.generativelanguage.v1beta3.TuningTask.snapshots: object expected"); + message.snapshots[i] = $root.google.ai.generativelanguage.v1beta3.TuningSnapshot.fromObject(object.snapshots[i]); + } + } + if (object.trainingData != null) { + if (typeof object.trainingData !== "object") + throw TypeError(".google.ai.generativelanguage.v1beta3.TuningTask.trainingData: object expected"); + message.trainingData = $root.google.ai.generativelanguage.v1beta3.Dataset.fromObject(object.trainingData); + } + if (object.hyperparameters != null) { + if (typeof object.hyperparameters !== "object") + throw TypeError(".google.ai.generativelanguage.v1beta3.TuningTask.hyperparameters: object expected"); + message.hyperparameters = $root.google.ai.generativelanguage.v1beta3.Hyperparameters.fromObject(object.hyperparameters); + } + return message; + }; + + /** + * Creates a plain object from a TuningTask message. Also converts values to other types if specified. + * @function toObject + * @memberof google.ai.generativelanguage.v1beta3.TuningTask + * @static + * @param {google.ai.generativelanguage.v1beta3.TuningTask} message TuningTask + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + TuningTask.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.snapshots = []; + if (options.defaults) { + object.startTime = null; + object.completeTime = null; + object.trainingData = null; + object.hyperparameters = null; + } + if (message.startTime != null && message.hasOwnProperty("startTime")) + object.startTime = $root.google.protobuf.Timestamp.toObject(message.startTime, options); + if (message.completeTime != null && message.hasOwnProperty("completeTime")) + object.completeTime = $root.google.protobuf.Timestamp.toObject(message.completeTime, options); + if (message.snapshots && message.snapshots.length) { + object.snapshots = []; + for (var j = 0; j < message.snapshots.length; ++j) + object.snapshots[j] = $root.google.ai.generativelanguage.v1beta3.TuningSnapshot.toObject(message.snapshots[j], options); + } + if (message.trainingData != null && message.hasOwnProperty("trainingData")) + object.trainingData = $root.google.ai.generativelanguage.v1beta3.Dataset.toObject(message.trainingData, options); + if (message.hyperparameters != null && message.hasOwnProperty("hyperparameters")) + object.hyperparameters = $root.google.ai.generativelanguage.v1beta3.Hyperparameters.toObject(message.hyperparameters, options); + return object; + }; + + /** + * Converts this TuningTask to JSON. + * @function toJSON + * @memberof google.ai.generativelanguage.v1beta3.TuningTask + * @instance + * @returns {Object.} JSON object + */ + TuningTask.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for TuningTask + * @function getTypeUrl + * @memberof google.ai.generativelanguage.v1beta3.TuningTask + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TuningTask.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.ai.generativelanguage.v1beta3.TuningTask"; + }; + + return TuningTask; + })(); + + v1beta3.Hyperparameters = (function() { + + /** + * Properties of a Hyperparameters. + * @memberof google.ai.generativelanguage.v1beta3 + * @interface IHyperparameters + * @property {number|null} [epochCount] Hyperparameters epochCount + * @property {number|null} [batchSize] Hyperparameters batchSize + * @property {number|null} [learningRate] Hyperparameters learningRate + */ + + /** + * Constructs a new Hyperparameters. + * @memberof google.ai.generativelanguage.v1beta3 + * @classdesc Represents a Hyperparameters. + * @implements IHyperparameters + * @constructor + * @param {google.ai.generativelanguage.v1beta3.IHyperparameters=} [properties] Properties to set + */ + function Hyperparameters(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Hyperparameters epochCount. + * @member {number|null|undefined} epochCount + * @memberof google.ai.generativelanguage.v1beta3.Hyperparameters + * @instance + */ + Hyperparameters.prototype.epochCount = null; + + /** + * Hyperparameters batchSize. + * @member {number|null|undefined} batchSize + * @memberof google.ai.generativelanguage.v1beta3.Hyperparameters + * @instance + */ + Hyperparameters.prototype.batchSize = null; + + /** + * Hyperparameters learningRate. + * @member {number|null|undefined} learningRate + * @memberof google.ai.generativelanguage.v1beta3.Hyperparameters + * @instance + */ + Hyperparameters.prototype.learningRate = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * Hyperparameters _epochCount. + * @member {"epochCount"|undefined} _epochCount + * @memberof google.ai.generativelanguage.v1beta3.Hyperparameters + * @instance + */ + Object.defineProperty(Hyperparameters.prototype, "_epochCount", { + get: $util.oneOfGetter($oneOfFields = ["epochCount"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Hyperparameters _batchSize. + * @member {"batchSize"|undefined} _batchSize + * @memberof google.ai.generativelanguage.v1beta3.Hyperparameters + * @instance + */ + Object.defineProperty(Hyperparameters.prototype, "_batchSize", { + get: $util.oneOfGetter($oneOfFields = ["batchSize"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Hyperparameters _learningRate. + * @member {"learningRate"|undefined} _learningRate + * @memberof google.ai.generativelanguage.v1beta3.Hyperparameters + * @instance + */ + Object.defineProperty(Hyperparameters.prototype, "_learningRate", { + get: $util.oneOfGetter($oneOfFields = ["learningRate"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new Hyperparameters instance using the specified properties. + * @function create + * @memberof google.ai.generativelanguage.v1beta3.Hyperparameters + * @static + * @param {google.ai.generativelanguage.v1beta3.IHyperparameters=} [properties] Properties to set + * @returns {google.ai.generativelanguage.v1beta3.Hyperparameters} Hyperparameters instance + */ + Hyperparameters.create = function create(properties) { + return new Hyperparameters(properties); + }; + + /** + * Encodes the specified Hyperparameters message. Does not implicitly {@link google.ai.generativelanguage.v1beta3.Hyperparameters.verify|verify} messages. + * @function encode + * @memberof google.ai.generativelanguage.v1beta3.Hyperparameters + * @static + * @param {google.ai.generativelanguage.v1beta3.IHyperparameters} message Hyperparameters message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Hyperparameters.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.epochCount != null && Object.hasOwnProperty.call(message, "epochCount")) + writer.uint32(/* id 14, wireType 0 =*/112).int32(message.epochCount); + if (message.batchSize != null && Object.hasOwnProperty.call(message, "batchSize")) + writer.uint32(/* id 15, wireType 0 =*/120).int32(message.batchSize); + if (message.learningRate != null && Object.hasOwnProperty.call(message, "learningRate")) + writer.uint32(/* id 16, wireType 5 =*/133).float(message.learningRate); + return writer; + }; + + /** + * Encodes the specified Hyperparameters message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1beta3.Hyperparameters.verify|verify} messages. + * @function encodeDelimited + * @memberof google.ai.generativelanguage.v1beta3.Hyperparameters + * @static + * @param {google.ai.generativelanguage.v1beta3.IHyperparameters} message Hyperparameters message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Hyperparameters.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Hyperparameters message from the specified reader or buffer. + * @function decode + * @memberof google.ai.generativelanguage.v1beta3.Hyperparameters + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.ai.generativelanguage.v1beta3.Hyperparameters} Hyperparameters + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Hyperparameters.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.ai.generativelanguage.v1beta3.Hyperparameters(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 14: { + message.epochCount = reader.int32(); + break; + } + case 15: { + message.batchSize = reader.int32(); + break; + } + case 16: { + message.learningRate = reader.float(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Hyperparameters message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.ai.generativelanguage.v1beta3.Hyperparameters + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.ai.generativelanguage.v1beta3.Hyperparameters} Hyperparameters + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Hyperparameters.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Hyperparameters message. + * @function verify + * @memberof google.ai.generativelanguage.v1beta3.Hyperparameters + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Hyperparameters.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.epochCount != null && message.hasOwnProperty("epochCount")) { + properties._epochCount = 1; + if (!$util.isInteger(message.epochCount)) + return "epochCount: integer expected"; + } + if (message.batchSize != null && message.hasOwnProperty("batchSize")) { + properties._batchSize = 1; + if (!$util.isInteger(message.batchSize)) + return "batchSize: integer expected"; + } + if (message.learningRate != null && message.hasOwnProperty("learningRate")) { + properties._learningRate = 1; + if (typeof message.learningRate !== "number") + return "learningRate: number expected"; + } + return null; + }; + + /** + * Creates a Hyperparameters message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.ai.generativelanguage.v1beta3.Hyperparameters + * @static + * @param {Object.} object Plain object + * @returns {google.ai.generativelanguage.v1beta3.Hyperparameters} Hyperparameters + */ + Hyperparameters.fromObject = function fromObject(object) { + if (object instanceof $root.google.ai.generativelanguage.v1beta3.Hyperparameters) + return object; + var message = new $root.google.ai.generativelanguage.v1beta3.Hyperparameters(); + if (object.epochCount != null) + message.epochCount = object.epochCount | 0; + if (object.batchSize != null) + message.batchSize = object.batchSize | 0; + if (object.learningRate != null) + message.learningRate = Number(object.learningRate); + return message; + }; + + /** + * Creates a plain object from a Hyperparameters message. Also converts values to other types if specified. + * @function toObject + * @memberof google.ai.generativelanguage.v1beta3.Hyperparameters + * @static + * @param {google.ai.generativelanguage.v1beta3.Hyperparameters} message Hyperparameters + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Hyperparameters.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.epochCount != null && message.hasOwnProperty("epochCount")) { + object.epochCount = message.epochCount; + if (options.oneofs) + object._epochCount = "epochCount"; + } + if (message.batchSize != null && message.hasOwnProperty("batchSize")) { + object.batchSize = message.batchSize; + if (options.oneofs) + object._batchSize = "batchSize"; + } + if (message.learningRate != null && message.hasOwnProperty("learningRate")) { + object.learningRate = options.json && !isFinite(message.learningRate) ? String(message.learningRate) : message.learningRate; + if (options.oneofs) + object._learningRate = "learningRate"; + } + return object; + }; + + /** + * Converts this Hyperparameters to JSON. + * @function toJSON + * @memberof google.ai.generativelanguage.v1beta3.Hyperparameters + * @instance + * @returns {Object.} JSON object + */ + Hyperparameters.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Hyperparameters + * @function getTypeUrl + * @memberof google.ai.generativelanguage.v1beta3.Hyperparameters + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Hyperparameters.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.ai.generativelanguage.v1beta3.Hyperparameters"; + }; + + return Hyperparameters; + })(); + + v1beta3.Dataset = (function() { + + /** + * Properties of a Dataset. + * @memberof google.ai.generativelanguage.v1beta3 + * @interface IDataset + * @property {google.ai.generativelanguage.v1beta3.ITuningExamples|null} [examples] Dataset examples + */ + + /** + * Constructs a new Dataset. + * @memberof google.ai.generativelanguage.v1beta3 + * @classdesc Represents a Dataset. + * @implements IDataset + * @constructor + * @param {google.ai.generativelanguage.v1beta3.IDataset=} [properties] Properties to set + */ + function Dataset(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Dataset examples. + * @member {google.ai.generativelanguage.v1beta3.ITuningExamples|null|undefined} examples + * @memberof google.ai.generativelanguage.v1beta3.Dataset + * @instance + */ + Dataset.prototype.examples = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * Dataset dataset. + * @member {"examples"|undefined} dataset + * @memberof google.ai.generativelanguage.v1beta3.Dataset + * @instance + */ + Object.defineProperty(Dataset.prototype, "dataset", { + get: $util.oneOfGetter($oneOfFields = ["examples"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new Dataset instance using the specified properties. + * @function create + * @memberof google.ai.generativelanguage.v1beta3.Dataset + * @static + * @param {google.ai.generativelanguage.v1beta3.IDataset=} [properties] Properties to set + * @returns {google.ai.generativelanguage.v1beta3.Dataset} Dataset instance + */ + Dataset.create = function create(properties) { + return new Dataset(properties); + }; + + /** + * Encodes the specified Dataset message. Does not implicitly {@link google.ai.generativelanguage.v1beta3.Dataset.verify|verify} messages. + * @function encode + * @memberof google.ai.generativelanguage.v1beta3.Dataset + * @static + * @param {google.ai.generativelanguage.v1beta3.IDataset} message Dataset message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Dataset.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.examples != null && Object.hasOwnProperty.call(message, "examples")) + $root.google.ai.generativelanguage.v1beta3.TuningExamples.encode(message.examples, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified Dataset message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1beta3.Dataset.verify|verify} messages. + * @function encodeDelimited + * @memberof google.ai.generativelanguage.v1beta3.Dataset + * @static + * @param {google.ai.generativelanguage.v1beta3.IDataset} message Dataset message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Dataset.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Dataset message from the specified reader or buffer. + * @function decode + * @memberof google.ai.generativelanguage.v1beta3.Dataset + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.ai.generativelanguage.v1beta3.Dataset} Dataset + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Dataset.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.ai.generativelanguage.v1beta3.Dataset(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.examples = $root.google.ai.generativelanguage.v1beta3.TuningExamples.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Dataset message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.ai.generativelanguage.v1beta3.Dataset + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.ai.generativelanguage.v1beta3.Dataset} Dataset + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Dataset.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Dataset message. + * @function verify + * @memberof google.ai.generativelanguage.v1beta3.Dataset + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Dataset.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.examples != null && message.hasOwnProperty("examples")) { + properties.dataset = 1; + { + var error = $root.google.ai.generativelanguage.v1beta3.TuningExamples.verify(message.examples); + if (error) + return "examples." + error; + } + } + return null; + }; + + /** + * Creates a Dataset message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.ai.generativelanguage.v1beta3.Dataset + * @static + * @param {Object.} object Plain object + * @returns {google.ai.generativelanguage.v1beta3.Dataset} Dataset + */ + Dataset.fromObject = function fromObject(object) { + if (object instanceof $root.google.ai.generativelanguage.v1beta3.Dataset) + return object; + var message = new $root.google.ai.generativelanguage.v1beta3.Dataset(); + if (object.examples != null) { + if (typeof object.examples !== "object") + throw TypeError(".google.ai.generativelanguage.v1beta3.Dataset.examples: object expected"); + message.examples = $root.google.ai.generativelanguage.v1beta3.TuningExamples.fromObject(object.examples); + } + return message; + }; + + /** + * Creates a plain object from a Dataset message. Also converts values to other types if specified. + * @function toObject + * @memberof google.ai.generativelanguage.v1beta3.Dataset + * @static + * @param {google.ai.generativelanguage.v1beta3.Dataset} message Dataset + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Dataset.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.examples != null && message.hasOwnProperty("examples")) { + object.examples = $root.google.ai.generativelanguage.v1beta3.TuningExamples.toObject(message.examples, options); + if (options.oneofs) + object.dataset = "examples"; + } + return object; + }; + + /** + * Converts this Dataset to JSON. + * @function toJSON + * @memberof google.ai.generativelanguage.v1beta3.Dataset + * @instance + * @returns {Object.} JSON object + */ + Dataset.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Dataset + * @function getTypeUrl + * @memberof google.ai.generativelanguage.v1beta3.Dataset + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Dataset.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.ai.generativelanguage.v1beta3.Dataset"; + }; + + return Dataset; + })(); + + v1beta3.TuningExamples = (function() { + + /** + * Properties of a TuningExamples. + * @memberof google.ai.generativelanguage.v1beta3 + * @interface ITuningExamples + * @property {Array.|null} [examples] TuningExamples examples + */ + + /** + * Constructs a new TuningExamples. + * @memberof google.ai.generativelanguage.v1beta3 + * @classdesc Represents a TuningExamples. + * @implements ITuningExamples + * @constructor + * @param {google.ai.generativelanguage.v1beta3.ITuningExamples=} [properties] Properties to set + */ + function TuningExamples(properties) { + this.examples = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * TuningExamples examples. + * @member {Array.} examples + * @memberof google.ai.generativelanguage.v1beta3.TuningExamples + * @instance + */ + TuningExamples.prototype.examples = $util.emptyArray; + + /** + * Creates a new TuningExamples instance using the specified properties. + * @function create + * @memberof google.ai.generativelanguage.v1beta3.TuningExamples + * @static + * @param {google.ai.generativelanguage.v1beta3.ITuningExamples=} [properties] Properties to set + * @returns {google.ai.generativelanguage.v1beta3.TuningExamples} TuningExamples instance + */ + TuningExamples.create = function create(properties) { + return new TuningExamples(properties); + }; + + /** + * Encodes the specified TuningExamples message. Does not implicitly {@link google.ai.generativelanguage.v1beta3.TuningExamples.verify|verify} messages. + * @function encode + * @memberof google.ai.generativelanguage.v1beta3.TuningExamples + * @static + * @param {google.ai.generativelanguage.v1beta3.ITuningExamples} message TuningExamples message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TuningExamples.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.examples != null && message.examples.length) + for (var i = 0; i < message.examples.length; ++i) + $root.google.ai.generativelanguage.v1beta3.TuningExample.encode(message.examples[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified TuningExamples message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1beta3.TuningExamples.verify|verify} messages. + * @function encodeDelimited + * @memberof google.ai.generativelanguage.v1beta3.TuningExamples + * @static + * @param {google.ai.generativelanguage.v1beta3.ITuningExamples} message TuningExamples message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TuningExamples.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a TuningExamples message from the specified reader or buffer. + * @function decode + * @memberof google.ai.generativelanguage.v1beta3.TuningExamples + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.ai.generativelanguage.v1beta3.TuningExamples} TuningExamples + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TuningExamples.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.ai.generativelanguage.v1beta3.TuningExamples(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.examples && message.examples.length)) + message.examples = []; + message.examples.push($root.google.ai.generativelanguage.v1beta3.TuningExample.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a TuningExamples message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.ai.generativelanguage.v1beta3.TuningExamples + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.ai.generativelanguage.v1beta3.TuningExamples} TuningExamples + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TuningExamples.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a TuningExamples message. + * @function verify + * @memberof google.ai.generativelanguage.v1beta3.TuningExamples + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + TuningExamples.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.examples != null && message.hasOwnProperty("examples")) { + if (!Array.isArray(message.examples)) + return "examples: array expected"; + for (var i = 0; i < message.examples.length; ++i) { + var error = $root.google.ai.generativelanguage.v1beta3.TuningExample.verify(message.examples[i]); + if (error) + return "examples." + error; + } + } + return null; + }; + + /** + * Creates a TuningExamples message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.ai.generativelanguage.v1beta3.TuningExamples + * @static + * @param {Object.} object Plain object + * @returns {google.ai.generativelanguage.v1beta3.TuningExamples} TuningExamples + */ + TuningExamples.fromObject = function fromObject(object) { + if (object instanceof $root.google.ai.generativelanguage.v1beta3.TuningExamples) + return object; + var message = new $root.google.ai.generativelanguage.v1beta3.TuningExamples(); + if (object.examples) { + if (!Array.isArray(object.examples)) + throw TypeError(".google.ai.generativelanguage.v1beta3.TuningExamples.examples: array expected"); + message.examples = []; + for (var i = 0; i < object.examples.length; ++i) { + if (typeof object.examples[i] !== "object") + throw TypeError(".google.ai.generativelanguage.v1beta3.TuningExamples.examples: object expected"); + message.examples[i] = $root.google.ai.generativelanguage.v1beta3.TuningExample.fromObject(object.examples[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a TuningExamples message. Also converts values to other types if specified. + * @function toObject + * @memberof google.ai.generativelanguage.v1beta3.TuningExamples + * @static + * @param {google.ai.generativelanguage.v1beta3.TuningExamples} message TuningExamples + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + TuningExamples.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.examples = []; + if (message.examples && message.examples.length) { + object.examples = []; + for (var j = 0; j < message.examples.length; ++j) + object.examples[j] = $root.google.ai.generativelanguage.v1beta3.TuningExample.toObject(message.examples[j], options); + } + return object; + }; + + /** + * Converts this TuningExamples to JSON. + * @function toJSON + * @memberof google.ai.generativelanguage.v1beta3.TuningExamples + * @instance + * @returns {Object.} JSON object + */ + TuningExamples.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for TuningExamples + * @function getTypeUrl + * @memberof google.ai.generativelanguage.v1beta3.TuningExamples + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TuningExamples.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.ai.generativelanguage.v1beta3.TuningExamples"; + }; + + return TuningExamples; + })(); + + v1beta3.TuningExample = (function() { + + /** + * Properties of a TuningExample. + * @memberof google.ai.generativelanguage.v1beta3 + * @interface ITuningExample + * @property {string|null} [textInput] TuningExample textInput + * @property {string|null} [output] TuningExample output + */ + + /** + * Constructs a new TuningExample. + * @memberof google.ai.generativelanguage.v1beta3 + * @classdesc Represents a TuningExample. + * @implements ITuningExample + * @constructor + * @param {google.ai.generativelanguage.v1beta3.ITuningExample=} [properties] Properties to set + */ + function TuningExample(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * TuningExample textInput. + * @member {string|null|undefined} textInput + * @memberof google.ai.generativelanguage.v1beta3.TuningExample + * @instance + */ + TuningExample.prototype.textInput = null; + + /** + * TuningExample output. + * @member {string} output + * @memberof google.ai.generativelanguage.v1beta3.TuningExample + * @instance + */ + TuningExample.prototype.output = ""; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * TuningExample modelInput. + * @member {"textInput"|undefined} modelInput + * @memberof google.ai.generativelanguage.v1beta3.TuningExample + * @instance + */ + Object.defineProperty(TuningExample.prototype, "modelInput", { + get: $util.oneOfGetter($oneOfFields = ["textInput"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new TuningExample instance using the specified properties. + * @function create + * @memberof google.ai.generativelanguage.v1beta3.TuningExample + * @static + * @param {google.ai.generativelanguage.v1beta3.ITuningExample=} [properties] Properties to set + * @returns {google.ai.generativelanguage.v1beta3.TuningExample} TuningExample instance + */ + TuningExample.create = function create(properties) { + return new TuningExample(properties); + }; + + /** + * Encodes the specified TuningExample message. Does not implicitly {@link google.ai.generativelanguage.v1beta3.TuningExample.verify|verify} messages. + * @function encode + * @memberof google.ai.generativelanguage.v1beta3.TuningExample + * @static + * @param {google.ai.generativelanguage.v1beta3.ITuningExample} message TuningExample message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TuningExample.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.textInput != null && Object.hasOwnProperty.call(message, "textInput")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.textInput); + if (message.output != null && Object.hasOwnProperty.call(message, "output")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.output); + return writer; + }; + + /** + * Encodes the specified TuningExample message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1beta3.TuningExample.verify|verify} messages. + * @function encodeDelimited + * @memberof google.ai.generativelanguage.v1beta3.TuningExample + * @static + * @param {google.ai.generativelanguage.v1beta3.ITuningExample} message TuningExample message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TuningExample.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a TuningExample message from the specified reader or buffer. + * @function decode + * @memberof google.ai.generativelanguage.v1beta3.TuningExample + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.ai.generativelanguage.v1beta3.TuningExample} TuningExample + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TuningExample.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.ai.generativelanguage.v1beta3.TuningExample(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.textInput = reader.string(); + break; + } + case 3: { + message.output = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a TuningExample message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.ai.generativelanguage.v1beta3.TuningExample + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.ai.generativelanguage.v1beta3.TuningExample} TuningExample + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TuningExample.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a TuningExample message. + * @function verify + * @memberof google.ai.generativelanguage.v1beta3.TuningExample + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + TuningExample.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.textInput != null && message.hasOwnProperty("textInput")) { + properties.modelInput = 1; + if (!$util.isString(message.textInput)) + return "textInput: string expected"; + } + if (message.output != null && message.hasOwnProperty("output")) + if (!$util.isString(message.output)) + return "output: string expected"; + return null; + }; + + /** + * Creates a TuningExample message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.ai.generativelanguage.v1beta3.TuningExample + * @static + * @param {Object.} object Plain object + * @returns {google.ai.generativelanguage.v1beta3.TuningExample} TuningExample + */ + TuningExample.fromObject = function fromObject(object) { + if (object instanceof $root.google.ai.generativelanguage.v1beta3.TuningExample) + return object; + var message = new $root.google.ai.generativelanguage.v1beta3.TuningExample(); + if (object.textInput != null) + message.textInput = String(object.textInput); + if (object.output != null) + message.output = String(object.output); + return message; + }; + + /** + * Creates a plain object from a TuningExample message. Also converts values to other types if specified. + * @function toObject + * @memberof google.ai.generativelanguage.v1beta3.TuningExample + * @static + * @param {google.ai.generativelanguage.v1beta3.TuningExample} message TuningExample + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + TuningExample.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.output = ""; + if (message.textInput != null && message.hasOwnProperty("textInput")) { + object.textInput = message.textInput; + if (options.oneofs) + object.modelInput = "textInput"; + } + if (message.output != null && message.hasOwnProperty("output")) + object.output = message.output; + return object; + }; + + /** + * Converts this TuningExample to JSON. + * @function toJSON + * @memberof google.ai.generativelanguage.v1beta3.TuningExample + * @instance + * @returns {Object.} JSON object + */ + TuningExample.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for TuningExample + * @function getTypeUrl + * @memberof google.ai.generativelanguage.v1beta3.TuningExample + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TuningExample.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.ai.generativelanguage.v1beta3.TuningExample"; + }; + + return TuningExample; + })(); + + v1beta3.TuningSnapshot = (function() { + + /** + * Properties of a TuningSnapshot. + * @memberof google.ai.generativelanguage.v1beta3 + * @interface ITuningSnapshot + * @property {number|null} [step] TuningSnapshot step + * @property {number|null} [epoch] TuningSnapshot epoch + * @property {number|null} [meanLoss] TuningSnapshot meanLoss + * @property {google.protobuf.ITimestamp|null} [computeTime] TuningSnapshot computeTime + */ + + /** + * Constructs a new TuningSnapshot. + * @memberof google.ai.generativelanguage.v1beta3 + * @classdesc Represents a TuningSnapshot. + * @implements ITuningSnapshot + * @constructor + * @param {google.ai.generativelanguage.v1beta3.ITuningSnapshot=} [properties] Properties to set + */ + function TuningSnapshot(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * TuningSnapshot step. + * @member {number} step + * @memberof google.ai.generativelanguage.v1beta3.TuningSnapshot + * @instance + */ + TuningSnapshot.prototype.step = 0; + + /** + * TuningSnapshot epoch. + * @member {number} epoch + * @memberof google.ai.generativelanguage.v1beta3.TuningSnapshot + * @instance + */ + TuningSnapshot.prototype.epoch = 0; + + /** + * TuningSnapshot meanLoss. + * @member {number} meanLoss + * @memberof google.ai.generativelanguage.v1beta3.TuningSnapshot + * @instance + */ + TuningSnapshot.prototype.meanLoss = 0; + + /** + * TuningSnapshot computeTime. + * @member {google.protobuf.ITimestamp|null|undefined} computeTime + * @memberof google.ai.generativelanguage.v1beta3.TuningSnapshot + * @instance + */ + TuningSnapshot.prototype.computeTime = null; + + /** + * Creates a new TuningSnapshot instance using the specified properties. + * @function create + * @memberof google.ai.generativelanguage.v1beta3.TuningSnapshot + * @static + * @param {google.ai.generativelanguage.v1beta3.ITuningSnapshot=} [properties] Properties to set + * @returns {google.ai.generativelanguage.v1beta3.TuningSnapshot} TuningSnapshot instance + */ + TuningSnapshot.create = function create(properties) { + return new TuningSnapshot(properties); + }; + + /** + * Encodes the specified TuningSnapshot message. Does not implicitly {@link google.ai.generativelanguage.v1beta3.TuningSnapshot.verify|verify} messages. + * @function encode + * @memberof google.ai.generativelanguage.v1beta3.TuningSnapshot + * @static + * @param {google.ai.generativelanguage.v1beta3.ITuningSnapshot} message TuningSnapshot message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TuningSnapshot.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.step != null && Object.hasOwnProperty.call(message, "step")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.step); + if (message.epoch != null && Object.hasOwnProperty.call(message, "epoch")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.epoch); + if (message.meanLoss != null && Object.hasOwnProperty.call(message, "meanLoss")) + writer.uint32(/* id 3, wireType 5 =*/29).float(message.meanLoss); + if (message.computeTime != null && Object.hasOwnProperty.call(message, "computeTime")) + $root.google.protobuf.Timestamp.encode(message.computeTime, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified TuningSnapshot message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1beta3.TuningSnapshot.verify|verify} messages. + * @function encodeDelimited + * @memberof google.ai.generativelanguage.v1beta3.TuningSnapshot + * @static + * @param {google.ai.generativelanguage.v1beta3.ITuningSnapshot} message TuningSnapshot message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TuningSnapshot.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a TuningSnapshot message from the specified reader or buffer. + * @function decode + * @memberof google.ai.generativelanguage.v1beta3.TuningSnapshot + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.ai.generativelanguage.v1beta3.TuningSnapshot} TuningSnapshot + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TuningSnapshot.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.ai.generativelanguage.v1beta3.TuningSnapshot(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.step = reader.int32(); + break; + } + case 2: { + message.epoch = reader.int32(); + break; + } + case 3: { + message.meanLoss = reader.float(); + break; + } + case 4: { + message.computeTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a TuningSnapshot message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.ai.generativelanguage.v1beta3.TuningSnapshot + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.ai.generativelanguage.v1beta3.TuningSnapshot} TuningSnapshot + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TuningSnapshot.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a TuningSnapshot message. + * @function verify + * @memberof google.ai.generativelanguage.v1beta3.TuningSnapshot + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + TuningSnapshot.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.step != null && message.hasOwnProperty("step")) + if (!$util.isInteger(message.step)) + return "step: integer expected"; + if (message.epoch != null && message.hasOwnProperty("epoch")) + if (!$util.isInteger(message.epoch)) + return "epoch: integer expected"; + if (message.meanLoss != null && message.hasOwnProperty("meanLoss")) + if (typeof message.meanLoss !== "number") + return "meanLoss: number expected"; + if (message.computeTime != null && message.hasOwnProperty("computeTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.computeTime); + if (error) + return "computeTime." + error; + } + return null; + }; + + /** + * Creates a TuningSnapshot message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.ai.generativelanguage.v1beta3.TuningSnapshot + * @static + * @param {Object.} object Plain object + * @returns {google.ai.generativelanguage.v1beta3.TuningSnapshot} TuningSnapshot + */ + TuningSnapshot.fromObject = function fromObject(object) { + if (object instanceof $root.google.ai.generativelanguage.v1beta3.TuningSnapshot) + return object; + var message = new $root.google.ai.generativelanguage.v1beta3.TuningSnapshot(); + if (object.step != null) + message.step = object.step | 0; + if (object.epoch != null) + message.epoch = object.epoch | 0; + if (object.meanLoss != null) + message.meanLoss = Number(object.meanLoss); + if (object.computeTime != null) { + if (typeof object.computeTime !== "object") + throw TypeError(".google.ai.generativelanguage.v1beta3.TuningSnapshot.computeTime: object expected"); + message.computeTime = $root.google.protobuf.Timestamp.fromObject(object.computeTime); + } + return message; + }; + + /** + * Creates a plain object from a TuningSnapshot message. Also converts values to other types if specified. + * @function toObject + * @memberof google.ai.generativelanguage.v1beta3.TuningSnapshot + * @static + * @param {google.ai.generativelanguage.v1beta3.TuningSnapshot} message TuningSnapshot + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + TuningSnapshot.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.step = 0; + object.epoch = 0; + object.meanLoss = 0; + object.computeTime = null; + } + if (message.step != null && message.hasOwnProperty("step")) + object.step = message.step; + if (message.epoch != null && message.hasOwnProperty("epoch")) + object.epoch = message.epoch; + if (message.meanLoss != null && message.hasOwnProperty("meanLoss")) + object.meanLoss = options.json && !isFinite(message.meanLoss) ? String(message.meanLoss) : message.meanLoss; + if (message.computeTime != null && message.hasOwnProperty("computeTime")) + object.computeTime = $root.google.protobuf.Timestamp.toObject(message.computeTime, options); + return object; + }; + + /** + * Converts this TuningSnapshot to JSON. + * @function toJSON + * @memberof google.ai.generativelanguage.v1beta3.TuningSnapshot + * @instance + * @returns {Object.} JSON object + */ + TuningSnapshot.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for TuningSnapshot + * @function getTypeUrl + * @memberof google.ai.generativelanguage.v1beta3.TuningSnapshot + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TuningSnapshot.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.ai.generativelanguage.v1beta3.TuningSnapshot"; + }; + + return TuningSnapshot; + })(); + + v1beta3.Permission = (function() { + + /** + * Properties of a Permission. + * @memberof google.ai.generativelanguage.v1beta3 + * @interface IPermission + * @property {string|null} [name] Permission name + * @property {google.ai.generativelanguage.v1beta3.Permission.GranteeType|null} [granteeType] Permission granteeType + * @property {string|null} [emailAddress] Permission emailAddress + * @property {google.ai.generativelanguage.v1beta3.Permission.Role|null} [role] Permission role + */ + + /** + * Constructs a new Permission. + * @memberof google.ai.generativelanguage.v1beta3 + * @classdesc Represents a Permission. + * @implements IPermission + * @constructor + * @param {google.ai.generativelanguage.v1beta3.IPermission=} [properties] Properties to set + */ + function Permission(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Permission name. + * @member {string} name + * @memberof google.ai.generativelanguage.v1beta3.Permission + * @instance + */ + Permission.prototype.name = ""; + + /** + * Permission granteeType. + * @member {google.ai.generativelanguage.v1beta3.Permission.GranteeType|null|undefined} granteeType + * @memberof google.ai.generativelanguage.v1beta3.Permission + * @instance + */ + Permission.prototype.granteeType = null; + + /** + * Permission emailAddress. + * @member {string|null|undefined} emailAddress + * @memberof google.ai.generativelanguage.v1beta3.Permission + * @instance + */ + Permission.prototype.emailAddress = null; + + /** + * Permission role. + * @member {google.ai.generativelanguage.v1beta3.Permission.Role|null|undefined} role + * @memberof google.ai.generativelanguage.v1beta3.Permission + * @instance + */ + Permission.prototype.role = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * Permission _granteeType. + * @member {"granteeType"|undefined} _granteeType + * @memberof google.ai.generativelanguage.v1beta3.Permission + * @instance + */ + Object.defineProperty(Permission.prototype, "_granteeType", { + get: $util.oneOfGetter($oneOfFields = ["granteeType"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Permission _emailAddress. + * @member {"emailAddress"|undefined} _emailAddress + * @memberof google.ai.generativelanguage.v1beta3.Permission + * @instance + */ + Object.defineProperty(Permission.prototype, "_emailAddress", { + get: $util.oneOfGetter($oneOfFields = ["emailAddress"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Permission _role. + * @member {"role"|undefined} _role + * @memberof google.ai.generativelanguage.v1beta3.Permission + * @instance + */ + Object.defineProperty(Permission.prototype, "_role", { + get: $util.oneOfGetter($oneOfFields = ["role"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new Permission instance using the specified properties. + * @function create + * @memberof google.ai.generativelanguage.v1beta3.Permission + * @static + * @param {google.ai.generativelanguage.v1beta3.IPermission=} [properties] Properties to set + * @returns {google.ai.generativelanguage.v1beta3.Permission} Permission instance + */ + Permission.create = function create(properties) { + return new Permission(properties); + }; + + /** + * Encodes the specified Permission message. Does not implicitly {@link google.ai.generativelanguage.v1beta3.Permission.verify|verify} messages. + * @function encode + * @memberof google.ai.generativelanguage.v1beta3.Permission + * @static + * @param {google.ai.generativelanguage.v1beta3.IPermission} message Permission message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Permission.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.granteeType != null && Object.hasOwnProperty.call(message, "granteeType")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.granteeType); + if (message.emailAddress != null && Object.hasOwnProperty.call(message, "emailAddress")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.emailAddress); + if (message.role != null && Object.hasOwnProperty.call(message, "role")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.role); + return writer; + }; + + /** + * Encodes the specified Permission message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1beta3.Permission.verify|verify} messages. + * @function encodeDelimited + * @memberof google.ai.generativelanguage.v1beta3.Permission + * @static + * @param {google.ai.generativelanguage.v1beta3.IPermission} message Permission message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Permission.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Permission message from the specified reader or buffer. + * @function decode + * @memberof google.ai.generativelanguage.v1beta3.Permission + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.ai.generativelanguage.v1beta3.Permission} Permission + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Permission.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.ai.generativelanguage.v1beta3.Permission(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.granteeType = reader.int32(); + break; + } + case 3: { + message.emailAddress = reader.string(); + break; + } + case 4: { + message.role = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Permission message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.ai.generativelanguage.v1beta3.Permission + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.ai.generativelanguage.v1beta3.Permission} Permission + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Permission.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Permission message. + * @function verify + * @memberof google.ai.generativelanguage.v1beta3.Permission + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Permission.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.granteeType != null && message.hasOwnProperty("granteeType")) { + properties._granteeType = 1; + switch (message.granteeType) { + default: + return "granteeType: enum value expected"; + case 0: + case 1: + case 2: + case 3: + break; + } + } + if (message.emailAddress != null && message.hasOwnProperty("emailAddress")) { + properties._emailAddress = 1; + if (!$util.isString(message.emailAddress)) + return "emailAddress: string expected"; + } + if (message.role != null && message.hasOwnProperty("role")) { + properties._role = 1; + switch (message.role) { + default: + return "role: enum value expected"; + case 0: + case 1: + case 2: + case 3: + break; + } + } + return null; + }; + + /** + * Creates a Permission message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.ai.generativelanguage.v1beta3.Permission + * @static + * @param {Object.} object Plain object + * @returns {google.ai.generativelanguage.v1beta3.Permission} Permission + */ + Permission.fromObject = function fromObject(object) { + if (object instanceof $root.google.ai.generativelanguage.v1beta3.Permission) + return object; + var message = new $root.google.ai.generativelanguage.v1beta3.Permission(); + if (object.name != null) + message.name = String(object.name); + switch (object.granteeType) { + default: + if (typeof object.granteeType === "number") { + message.granteeType = object.granteeType; + break; + } + break; + case "GRANTEE_TYPE_UNSPECIFIED": + case 0: + message.granteeType = 0; + break; + case "USER": + case 1: + message.granteeType = 1; + break; + case "GROUP": + case 2: + message.granteeType = 2; + break; + case "EVERYONE": + case 3: + message.granteeType = 3; + break; + } + if (object.emailAddress != null) + message.emailAddress = String(object.emailAddress); + switch (object.role) { + default: + if (typeof object.role === "number") { + message.role = object.role; + break; + } + break; + case "ROLE_UNSPECIFIED": + case 0: + message.role = 0; + break; + case "OWNER": + case 1: + message.role = 1; + break; + case "WRITER": + case 2: + message.role = 2; + break; + case "READER": + case 3: + message.role = 3; + break; + } + return message; + }; + + /** + * Creates a plain object from a Permission message. Also converts values to other types if specified. + * @function toObject + * @memberof google.ai.generativelanguage.v1beta3.Permission + * @static + * @param {google.ai.generativelanguage.v1beta3.Permission} message Permission + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Permission.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; + if (message.granteeType != null && message.hasOwnProperty("granteeType")) { + object.granteeType = options.enums === String ? $root.google.ai.generativelanguage.v1beta3.Permission.GranteeType[message.granteeType] === undefined ? message.granteeType : $root.google.ai.generativelanguage.v1beta3.Permission.GranteeType[message.granteeType] : message.granteeType; + if (options.oneofs) + object._granteeType = "granteeType"; + } + if (message.emailAddress != null && message.hasOwnProperty("emailAddress")) { + object.emailAddress = message.emailAddress; + if (options.oneofs) + object._emailAddress = "emailAddress"; + } + if (message.role != null && message.hasOwnProperty("role")) { + object.role = options.enums === String ? $root.google.ai.generativelanguage.v1beta3.Permission.Role[message.role] === undefined ? message.role : $root.google.ai.generativelanguage.v1beta3.Permission.Role[message.role] : message.role; + if (options.oneofs) + object._role = "role"; + } + return object; + }; + + /** + * Converts this Permission to JSON. + * @function toJSON + * @memberof google.ai.generativelanguage.v1beta3.Permission + * @instance + * @returns {Object.} JSON object + */ + Permission.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Permission + * @function getTypeUrl + * @memberof google.ai.generativelanguage.v1beta3.Permission + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Permission.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.ai.generativelanguage.v1beta3.Permission"; + }; + + /** + * GranteeType enum. + * @name google.ai.generativelanguage.v1beta3.Permission.GranteeType + * @enum {number} + * @property {number} GRANTEE_TYPE_UNSPECIFIED=0 GRANTEE_TYPE_UNSPECIFIED value + * @property {number} USER=1 USER value + * @property {number} GROUP=2 GROUP value + * @property {number} EVERYONE=3 EVERYONE value + */ + Permission.GranteeType = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "GRANTEE_TYPE_UNSPECIFIED"] = 0; + values[valuesById[1] = "USER"] = 1; + values[valuesById[2] = "GROUP"] = 2; + values[valuesById[3] = "EVERYONE"] = 3; + return values; + })(); + + /** + * Role enum. + * @name google.ai.generativelanguage.v1beta3.Permission.Role + * @enum {number} + * @property {number} ROLE_UNSPECIFIED=0 ROLE_UNSPECIFIED value + * @property {number} OWNER=1 OWNER value + * @property {number} WRITER=2 WRITER value + * @property {number} READER=3 READER value + */ + Permission.Role = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "ROLE_UNSPECIFIED"] = 0; + values[valuesById[1] = "OWNER"] = 1; + values[valuesById[2] = "WRITER"] = 2; + values[valuesById[3] = "READER"] = 3; + return values; + })(); + + return Permission; + })(); + + v1beta3.PermissionService = (function() { + + /** + * Constructs a new PermissionService service. + * @memberof google.ai.generativelanguage.v1beta3 + * @classdesc Represents a PermissionService + * @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 PermissionService(rpcImpl, requestDelimited, responseDelimited) { + $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); + } + + (PermissionService.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = PermissionService; + + /** + * Creates new PermissionService service using the specified rpc implementation. + * @function create + * @memberof google.ai.generativelanguage.v1beta3.PermissionService + * @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 {PermissionService} RPC service. Useful where requests and/or responses are streamed. + */ + PermissionService.create = function create(rpcImpl, requestDelimited, responseDelimited) { + return new this(rpcImpl, requestDelimited, responseDelimited); + }; + + /** + * Callback as used by {@link google.ai.generativelanguage.v1beta3.PermissionService|createPermission}. + * @memberof google.ai.generativelanguage.v1beta3.PermissionService + * @typedef CreatePermissionCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.ai.generativelanguage.v1beta3.Permission} [response] Permission + */ + + /** + * Calls CreatePermission. + * @function createPermission + * @memberof google.ai.generativelanguage.v1beta3.PermissionService + * @instance + * @param {google.ai.generativelanguage.v1beta3.ICreatePermissionRequest} request CreatePermissionRequest message or plain object + * @param {google.ai.generativelanguage.v1beta3.PermissionService.CreatePermissionCallback} callback Node-style callback called with the error, if any, and Permission + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(PermissionService.prototype.createPermission = function createPermission(request, callback) { + return this.rpcCall(createPermission, $root.google.ai.generativelanguage.v1beta3.CreatePermissionRequest, $root.google.ai.generativelanguage.v1beta3.Permission, request, callback); + }, "name", { value: "CreatePermission" }); + + /** + * Calls CreatePermission. + * @function createPermission + * @memberof google.ai.generativelanguage.v1beta3.PermissionService + * @instance + * @param {google.ai.generativelanguage.v1beta3.ICreatePermissionRequest} request CreatePermissionRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.ai.generativelanguage.v1beta3.PermissionService|getPermission}. + * @memberof google.ai.generativelanguage.v1beta3.PermissionService + * @typedef GetPermissionCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.ai.generativelanguage.v1beta3.Permission} [response] Permission + */ + + /** + * Calls GetPermission. + * @function getPermission + * @memberof google.ai.generativelanguage.v1beta3.PermissionService + * @instance + * @param {google.ai.generativelanguage.v1beta3.IGetPermissionRequest} request GetPermissionRequest message or plain object + * @param {google.ai.generativelanguage.v1beta3.PermissionService.GetPermissionCallback} callback Node-style callback called with the error, if any, and Permission + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(PermissionService.prototype.getPermission = function getPermission(request, callback) { + return this.rpcCall(getPermission, $root.google.ai.generativelanguage.v1beta3.GetPermissionRequest, $root.google.ai.generativelanguage.v1beta3.Permission, request, callback); + }, "name", { value: "GetPermission" }); + + /** + * Calls GetPermission. + * @function getPermission + * @memberof google.ai.generativelanguage.v1beta3.PermissionService + * @instance + * @param {google.ai.generativelanguage.v1beta3.IGetPermissionRequest} request GetPermissionRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.ai.generativelanguage.v1beta3.PermissionService|listPermissions}. + * @memberof google.ai.generativelanguage.v1beta3.PermissionService + * @typedef ListPermissionsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.ai.generativelanguage.v1beta3.ListPermissionsResponse} [response] ListPermissionsResponse + */ + + /** + * Calls ListPermissions. + * @function listPermissions + * @memberof google.ai.generativelanguage.v1beta3.PermissionService + * @instance + * @param {google.ai.generativelanguage.v1beta3.IListPermissionsRequest} request ListPermissionsRequest message or plain object + * @param {google.ai.generativelanguage.v1beta3.PermissionService.ListPermissionsCallback} callback Node-style callback called with the error, if any, and ListPermissionsResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(PermissionService.prototype.listPermissions = function listPermissions(request, callback) { + return this.rpcCall(listPermissions, $root.google.ai.generativelanguage.v1beta3.ListPermissionsRequest, $root.google.ai.generativelanguage.v1beta3.ListPermissionsResponse, request, callback); + }, "name", { value: "ListPermissions" }); + + /** + * Calls ListPermissions. + * @function listPermissions + * @memberof google.ai.generativelanguage.v1beta3.PermissionService + * @instance + * @param {google.ai.generativelanguage.v1beta3.IListPermissionsRequest} request ListPermissionsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.ai.generativelanguage.v1beta3.PermissionService|updatePermission}. + * @memberof google.ai.generativelanguage.v1beta3.PermissionService + * @typedef UpdatePermissionCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.ai.generativelanguage.v1beta3.Permission} [response] Permission + */ + + /** + * Calls UpdatePermission. + * @function updatePermission + * @memberof google.ai.generativelanguage.v1beta3.PermissionService + * @instance + * @param {google.ai.generativelanguage.v1beta3.IUpdatePermissionRequest} request UpdatePermissionRequest message or plain object + * @param {google.ai.generativelanguage.v1beta3.PermissionService.UpdatePermissionCallback} callback Node-style callback called with the error, if any, and Permission + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(PermissionService.prototype.updatePermission = function updatePermission(request, callback) { + return this.rpcCall(updatePermission, $root.google.ai.generativelanguage.v1beta3.UpdatePermissionRequest, $root.google.ai.generativelanguage.v1beta3.Permission, request, callback); + }, "name", { value: "UpdatePermission" }); + + /** + * Calls UpdatePermission. + * @function updatePermission + * @memberof google.ai.generativelanguage.v1beta3.PermissionService + * @instance + * @param {google.ai.generativelanguage.v1beta3.IUpdatePermissionRequest} request UpdatePermissionRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.ai.generativelanguage.v1beta3.PermissionService|deletePermission}. + * @memberof google.ai.generativelanguage.v1beta3.PermissionService + * @typedef DeletePermissionCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.protobuf.Empty} [response] Empty + */ + + /** + * Calls DeletePermission. + * @function deletePermission + * @memberof google.ai.generativelanguage.v1beta3.PermissionService + * @instance + * @param {google.ai.generativelanguage.v1beta3.IDeletePermissionRequest} request DeletePermissionRequest message or plain object + * @param {google.ai.generativelanguage.v1beta3.PermissionService.DeletePermissionCallback} callback Node-style callback called with the error, if any, and Empty + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(PermissionService.prototype.deletePermission = function deletePermission(request, callback) { + return this.rpcCall(deletePermission, $root.google.ai.generativelanguage.v1beta3.DeletePermissionRequest, $root.google.protobuf.Empty, request, callback); + }, "name", { value: "DeletePermission" }); + + /** + * Calls DeletePermission. + * @function deletePermission + * @memberof google.ai.generativelanguage.v1beta3.PermissionService + * @instance + * @param {google.ai.generativelanguage.v1beta3.IDeletePermissionRequest} request DeletePermissionRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.ai.generativelanguage.v1beta3.PermissionService|transferOwnership}. + * @memberof google.ai.generativelanguage.v1beta3.PermissionService + * @typedef TransferOwnershipCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.ai.generativelanguage.v1beta3.TransferOwnershipResponse} [response] TransferOwnershipResponse + */ + + /** + * Calls TransferOwnership. + * @function transferOwnership + * @memberof google.ai.generativelanguage.v1beta3.PermissionService + * @instance + * @param {google.ai.generativelanguage.v1beta3.ITransferOwnershipRequest} request TransferOwnershipRequest message or plain object + * @param {google.ai.generativelanguage.v1beta3.PermissionService.TransferOwnershipCallback} callback Node-style callback called with the error, if any, and TransferOwnershipResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(PermissionService.prototype.transferOwnership = function transferOwnership(request, callback) { + return this.rpcCall(transferOwnership, $root.google.ai.generativelanguage.v1beta3.TransferOwnershipRequest, $root.google.ai.generativelanguage.v1beta3.TransferOwnershipResponse, request, callback); + }, "name", { value: "TransferOwnership" }); + + /** + * Calls TransferOwnership. + * @function transferOwnership + * @memberof google.ai.generativelanguage.v1beta3.PermissionService + * @instance + * @param {google.ai.generativelanguage.v1beta3.ITransferOwnershipRequest} request TransferOwnershipRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + return PermissionService; + })(); + + v1beta3.CreatePermissionRequest = (function() { + + /** + * Properties of a CreatePermissionRequest. + * @memberof google.ai.generativelanguage.v1beta3 + * @interface ICreatePermissionRequest + * @property {string|null} [parent] CreatePermissionRequest parent + * @property {google.ai.generativelanguage.v1beta3.IPermission|null} [permission] CreatePermissionRequest permission + */ + + /** + * Constructs a new CreatePermissionRequest. + * @memberof google.ai.generativelanguage.v1beta3 + * @classdesc Represents a CreatePermissionRequest. + * @implements ICreatePermissionRequest + * @constructor + * @param {google.ai.generativelanguage.v1beta3.ICreatePermissionRequest=} [properties] Properties to set + */ + function CreatePermissionRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * CreatePermissionRequest parent. + * @member {string} parent + * @memberof google.ai.generativelanguage.v1beta3.CreatePermissionRequest + * @instance + */ + CreatePermissionRequest.prototype.parent = ""; + + /** + * CreatePermissionRequest permission. + * @member {google.ai.generativelanguage.v1beta3.IPermission|null|undefined} permission + * @memberof google.ai.generativelanguage.v1beta3.CreatePermissionRequest + * @instance + */ + CreatePermissionRequest.prototype.permission = null; + + /** + * Creates a new CreatePermissionRequest instance using the specified properties. + * @function create + * @memberof google.ai.generativelanguage.v1beta3.CreatePermissionRequest + * @static + * @param {google.ai.generativelanguage.v1beta3.ICreatePermissionRequest=} [properties] Properties to set + * @returns {google.ai.generativelanguage.v1beta3.CreatePermissionRequest} CreatePermissionRequest instance + */ + CreatePermissionRequest.create = function create(properties) { + return new CreatePermissionRequest(properties); + }; + + /** + * Encodes the specified CreatePermissionRequest message. Does not implicitly {@link google.ai.generativelanguage.v1beta3.CreatePermissionRequest.verify|verify} messages. + * @function encode + * @memberof google.ai.generativelanguage.v1beta3.CreatePermissionRequest + * @static + * @param {google.ai.generativelanguage.v1beta3.ICreatePermissionRequest} message CreatePermissionRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreatePermissionRequest.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.permission != null && Object.hasOwnProperty.call(message, "permission")) + $root.google.ai.generativelanguage.v1beta3.Permission.encode(message.permission, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified CreatePermissionRequest message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1beta3.CreatePermissionRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.ai.generativelanguage.v1beta3.CreatePermissionRequest + * @static + * @param {google.ai.generativelanguage.v1beta3.ICreatePermissionRequest} message CreatePermissionRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreatePermissionRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CreatePermissionRequest message from the specified reader or buffer. + * @function decode + * @memberof google.ai.generativelanguage.v1beta3.CreatePermissionRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.ai.generativelanguage.v1beta3.CreatePermissionRequest} CreatePermissionRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreatePermissionRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.ai.generativelanguage.v1beta3.CreatePermissionRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.permission = $root.google.ai.generativelanguage.v1beta3.Permission.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CreatePermissionRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.ai.generativelanguage.v1beta3.CreatePermissionRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.ai.generativelanguage.v1beta3.CreatePermissionRequest} CreatePermissionRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreatePermissionRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CreatePermissionRequest message. + * @function verify + * @memberof google.ai.generativelanguage.v1beta3.CreatePermissionRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CreatePermissionRequest.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.permission != null && message.hasOwnProperty("permission")) { + var error = $root.google.ai.generativelanguage.v1beta3.Permission.verify(message.permission); + if (error) + return "permission." + error; + } + return null; + }; + + /** + * Creates a CreatePermissionRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.ai.generativelanguage.v1beta3.CreatePermissionRequest + * @static + * @param {Object.} object Plain object + * @returns {google.ai.generativelanguage.v1beta3.CreatePermissionRequest} CreatePermissionRequest + */ + CreatePermissionRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.ai.generativelanguage.v1beta3.CreatePermissionRequest) + return object; + var message = new $root.google.ai.generativelanguage.v1beta3.CreatePermissionRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.permission != null) { + if (typeof object.permission !== "object") + throw TypeError(".google.ai.generativelanguage.v1beta3.CreatePermissionRequest.permission: object expected"); + message.permission = $root.google.ai.generativelanguage.v1beta3.Permission.fromObject(object.permission); + } + return message; + }; + + /** + * Creates a plain object from a CreatePermissionRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.ai.generativelanguage.v1beta3.CreatePermissionRequest + * @static + * @param {google.ai.generativelanguage.v1beta3.CreatePermissionRequest} message CreatePermissionRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CreatePermissionRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.permission = null; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.permission != null && message.hasOwnProperty("permission")) + object.permission = $root.google.ai.generativelanguage.v1beta3.Permission.toObject(message.permission, options); + return object; + }; + + /** + * Converts this CreatePermissionRequest to JSON. + * @function toJSON + * @memberof google.ai.generativelanguage.v1beta3.CreatePermissionRequest + * @instance + * @returns {Object.} JSON object + */ + CreatePermissionRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CreatePermissionRequest + * @function getTypeUrl + * @memberof google.ai.generativelanguage.v1beta3.CreatePermissionRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CreatePermissionRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.ai.generativelanguage.v1beta3.CreatePermissionRequest"; + }; + + return CreatePermissionRequest; + })(); + + v1beta3.GetPermissionRequest = (function() { + + /** + * Properties of a GetPermissionRequest. + * @memberof google.ai.generativelanguage.v1beta3 + * @interface IGetPermissionRequest + * @property {string|null} [name] GetPermissionRequest name + */ + + /** + * Constructs a new GetPermissionRequest. + * @memberof google.ai.generativelanguage.v1beta3 + * @classdesc Represents a GetPermissionRequest. + * @implements IGetPermissionRequest + * @constructor + * @param {google.ai.generativelanguage.v1beta3.IGetPermissionRequest=} [properties] Properties to set + */ + function GetPermissionRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetPermissionRequest name. + * @member {string} name + * @memberof google.ai.generativelanguage.v1beta3.GetPermissionRequest + * @instance + */ + GetPermissionRequest.prototype.name = ""; + + /** + * Creates a new GetPermissionRequest instance using the specified properties. + * @function create + * @memberof google.ai.generativelanguage.v1beta3.GetPermissionRequest + * @static + * @param {google.ai.generativelanguage.v1beta3.IGetPermissionRequest=} [properties] Properties to set + * @returns {google.ai.generativelanguage.v1beta3.GetPermissionRequest} GetPermissionRequest instance + */ + GetPermissionRequest.create = function create(properties) { + return new GetPermissionRequest(properties); + }; + + /** + * Encodes the specified GetPermissionRequest message. Does not implicitly {@link google.ai.generativelanguage.v1beta3.GetPermissionRequest.verify|verify} messages. + * @function encode + * @memberof google.ai.generativelanguage.v1beta3.GetPermissionRequest + * @static + * @param {google.ai.generativelanguage.v1beta3.IGetPermissionRequest} message GetPermissionRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetPermissionRequest.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 GetPermissionRequest message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1beta3.GetPermissionRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.ai.generativelanguage.v1beta3.GetPermissionRequest + * @static + * @param {google.ai.generativelanguage.v1beta3.IGetPermissionRequest} message GetPermissionRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetPermissionRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetPermissionRequest message from the specified reader or buffer. + * @function decode + * @memberof google.ai.generativelanguage.v1beta3.GetPermissionRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.ai.generativelanguage.v1beta3.GetPermissionRequest} GetPermissionRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetPermissionRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.ai.generativelanguage.v1beta3.GetPermissionRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetPermissionRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.ai.generativelanguage.v1beta3.GetPermissionRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.ai.generativelanguage.v1beta3.GetPermissionRequest} GetPermissionRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetPermissionRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetPermissionRequest message. + * @function verify + * @memberof google.ai.generativelanguage.v1beta3.GetPermissionRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetPermissionRequest.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 GetPermissionRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.ai.generativelanguage.v1beta3.GetPermissionRequest + * @static + * @param {Object.} object Plain object + * @returns {google.ai.generativelanguage.v1beta3.GetPermissionRequest} GetPermissionRequest + */ + GetPermissionRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.ai.generativelanguage.v1beta3.GetPermissionRequest) + return object; + var message = new $root.google.ai.generativelanguage.v1beta3.GetPermissionRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a GetPermissionRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.ai.generativelanguage.v1beta3.GetPermissionRequest + * @static + * @param {google.ai.generativelanguage.v1beta3.GetPermissionRequest} message GetPermissionRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetPermissionRequest.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 GetPermissionRequest to JSON. + * @function toJSON + * @memberof google.ai.generativelanguage.v1beta3.GetPermissionRequest + * @instance + * @returns {Object.} JSON object + */ + GetPermissionRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GetPermissionRequest + * @function getTypeUrl + * @memberof google.ai.generativelanguage.v1beta3.GetPermissionRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GetPermissionRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.ai.generativelanguage.v1beta3.GetPermissionRequest"; + }; + + return GetPermissionRequest; + })(); + + v1beta3.ListPermissionsRequest = (function() { + + /** + * Properties of a ListPermissionsRequest. + * @memberof google.ai.generativelanguage.v1beta3 + * @interface IListPermissionsRequest + * @property {string|null} [parent] ListPermissionsRequest parent + * @property {number|null} [pageSize] ListPermissionsRequest pageSize + * @property {string|null} [pageToken] ListPermissionsRequest pageToken + */ + + /** + * Constructs a new ListPermissionsRequest. + * @memberof google.ai.generativelanguage.v1beta3 + * @classdesc Represents a ListPermissionsRequest. + * @implements IListPermissionsRequest + * @constructor + * @param {google.ai.generativelanguage.v1beta3.IListPermissionsRequest=} [properties] Properties to set + */ + function ListPermissionsRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListPermissionsRequest parent. + * @member {string} parent + * @memberof google.ai.generativelanguage.v1beta3.ListPermissionsRequest + * @instance + */ + ListPermissionsRequest.prototype.parent = ""; + + /** + * ListPermissionsRequest pageSize. + * @member {number} pageSize + * @memberof google.ai.generativelanguage.v1beta3.ListPermissionsRequest + * @instance + */ + ListPermissionsRequest.prototype.pageSize = 0; + + /** + * ListPermissionsRequest pageToken. + * @member {string} pageToken + * @memberof google.ai.generativelanguage.v1beta3.ListPermissionsRequest + * @instance + */ + ListPermissionsRequest.prototype.pageToken = ""; + + /** + * Creates a new ListPermissionsRequest instance using the specified properties. + * @function create + * @memberof google.ai.generativelanguage.v1beta3.ListPermissionsRequest + * @static + * @param {google.ai.generativelanguage.v1beta3.IListPermissionsRequest=} [properties] Properties to set + * @returns {google.ai.generativelanguage.v1beta3.ListPermissionsRequest} ListPermissionsRequest instance + */ + ListPermissionsRequest.create = function create(properties) { + return new ListPermissionsRequest(properties); + }; + + /** + * Encodes the specified ListPermissionsRequest message. Does not implicitly {@link google.ai.generativelanguage.v1beta3.ListPermissionsRequest.verify|verify} messages. + * @function encode + * @memberof google.ai.generativelanguage.v1beta3.ListPermissionsRequest + * @static + * @param {google.ai.generativelanguage.v1beta3.IListPermissionsRequest} message ListPermissionsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListPermissionsRequest.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 ListPermissionsRequest message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1beta3.ListPermissionsRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.ai.generativelanguage.v1beta3.ListPermissionsRequest + * @static + * @param {google.ai.generativelanguage.v1beta3.IListPermissionsRequest} message ListPermissionsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListPermissionsRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListPermissionsRequest message from the specified reader or buffer. + * @function decode + * @memberof google.ai.generativelanguage.v1beta3.ListPermissionsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.ai.generativelanguage.v1beta3.ListPermissionsRequest} ListPermissionsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListPermissionsRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.ai.generativelanguage.v1beta3.ListPermissionsRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + 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 ListPermissionsRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.ai.generativelanguage.v1beta3.ListPermissionsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.ai.generativelanguage.v1beta3.ListPermissionsRequest} ListPermissionsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListPermissionsRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListPermissionsRequest message. + * @function verify + * @memberof google.ai.generativelanguage.v1beta3.ListPermissionsRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListPermissionsRequest.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 ListPermissionsRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.ai.generativelanguage.v1beta3.ListPermissionsRequest + * @static + * @param {Object.} object Plain object + * @returns {google.ai.generativelanguage.v1beta3.ListPermissionsRequest} ListPermissionsRequest + */ + ListPermissionsRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.ai.generativelanguage.v1beta3.ListPermissionsRequest) + return object; + var message = new $root.google.ai.generativelanguage.v1beta3.ListPermissionsRequest(); + 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 ListPermissionsRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.ai.generativelanguage.v1beta3.ListPermissionsRequest + * @static + * @param {google.ai.generativelanguage.v1beta3.ListPermissionsRequest} message ListPermissionsRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListPermissionsRequest.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 ListPermissionsRequest to JSON. + * @function toJSON + * @memberof google.ai.generativelanguage.v1beta3.ListPermissionsRequest + * @instance + * @returns {Object.} JSON object + */ + ListPermissionsRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListPermissionsRequest + * @function getTypeUrl + * @memberof google.ai.generativelanguage.v1beta3.ListPermissionsRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListPermissionsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.ai.generativelanguage.v1beta3.ListPermissionsRequest"; + }; + + return ListPermissionsRequest; + })(); + + v1beta3.ListPermissionsResponse = (function() { + + /** + * Properties of a ListPermissionsResponse. + * @memberof google.ai.generativelanguage.v1beta3 + * @interface IListPermissionsResponse + * @property {Array.|null} [permissions] ListPermissionsResponse permissions + * @property {string|null} [nextPageToken] ListPermissionsResponse nextPageToken + */ + + /** + * Constructs a new ListPermissionsResponse. + * @memberof google.ai.generativelanguage.v1beta3 + * @classdesc Represents a ListPermissionsResponse. + * @implements IListPermissionsResponse + * @constructor + * @param {google.ai.generativelanguage.v1beta3.IListPermissionsResponse=} [properties] Properties to set + */ + function ListPermissionsResponse(properties) { + this.permissions = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListPermissionsResponse permissions. + * @member {Array.} permissions + * @memberof google.ai.generativelanguage.v1beta3.ListPermissionsResponse + * @instance + */ + ListPermissionsResponse.prototype.permissions = $util.emptyArray; + + /** + * ListPermissionsResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.ai.generativelanguage.v1beta3.ListPermissionsResponse + * @instance + */ + ListPermissionsResponse.prototype.nextPageToken = ""; + + /** + * Creates a new ListPermissionsResponse instance using the specified properties. + * @function create + * @memberof google.ai.generativelanguage.v1beta3.ListPermissionsResponse + * @static + * @param {google.ai.generativelanguage.v1beta3.IListPermissionsResponse=} [properties] Properties to set + * @returns {google.ai.generativelanguage.v1beta3.ListPermissionsResponse} ListPermissionsResponse instance + */ + ListPermissionsResponse.create = function create(properties) { + return new ListPermissionsResponse(properties); + }; + + /** + * Encodes the specified ListPermissionsResponse message. Does not implicitly {@link google.ai.generativelanguage.v1beta3.ListPermissionsResponse.verify|verify} messages. + * @function encode + * @memberof google.ai.generativelanguage.v1beta3.ListPermissionsResponse + * @static + * @param {google.ai.generativelanguage.v1beta3.IListPermissionsResponse} message ListPermissionsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListPermissionsResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.permissions != null && message.permissions.length) + for (var i = 0; i < message.permissions.length; ++i) + $root.google.ai.generativelanguage.v1beta3.Permission.encode(message.permissions[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 ListPermissionsResponse message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1beta3.ListPermissionsResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.ai.generativelanguage.v1beta3.ListPermissionsResponse + * @static + * @param {google.ai.generativelanguage.v1beta3.IListPermissionsResponse} message ListPermissionsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListPermissionsResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListPermissionsResponse message from the specified reader or buffer. + * @function decode + * @memberof google.ai.generativelanguage.v1beta3.ListPermissionsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.ai.generativelanguage.v1beta3.ListPermissionsResponse} ListPermissionsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListPermissionsResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.ai.generativelanguage.v1beta3.ListPermissionsResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.permissions && message.permissions.length)) + message.permissions = []; + message.permissions.push($root.google.ai.generativelanguage.v1beta3.Permission.decode(reader, reader.uint32())); + break; + } + case 2: { + message.nextPageToken = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListPermissionsResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.ai.generativelanguage.v1beta3.ListPermissionsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.ai.generativelanguage.v1beta3.ListPermissionsResponse} ListPermissionsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListPermissionsResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListPermissionsResponse message. + * @function verify + * @memberof google.ai.generativelanguage.v1beta3.ListPermissionsResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListPermissionsResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.permissions != null && message.hasOwnProperty("permissions")) { + if (!Array.isArray(message.permissions)) + return "permissions: array expected"; + for (var i = 0; i < message.permissions.length; ++i) { + var error = $root.google.ai.generativelanguage.v1beta3.Permission.verify(message.permissions[i]); + if (error) + return "permissions." + error; + } + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + return null; + }; + + /** + * Creates a ListPermissionsResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.ai.generativelanguage.v1beta3.ListPermissionsResponse + * @static + * @param {Object.} object Plain object + * @returns {google.ai.generativelanguage.v1beta3.ListPermissionsResponse} ListPermissionsResponse + */ + ListPermissionsResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.ai.generativelanguage.v1beta3.ListPermissionsResponse) + return object; + var message = new $root.google.ai.generativelanguage.v1beta3.ListPermissionsResponse(); + if (object.permissions) { + if (!Array.isArray(object.permissions)) + throw TypeError(".google.ai.generativelanguage.v1beta3.ListPermissionsResponse.permissions: array expected"); + message.permissions = []; + for (var i = 0; i < object.permissions.length; ++i) { + if (typeof object.permissions[i] !== "object") + throw TypeError(".google.ai.generativelanguage.v1beta3.ListPermissionsResponse.permissions: object expected"); + message.permissions[i] = $root.google.ai.generativelanguage.v1beta3.Permission.fromObject(object.permissions[i]); + } + } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + return message; + }; + + /** + * Creates a plain object from a ListPermissionsResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.ai.generativelanguage.v1beta3.ListPermissionsResponse + * @static + * @param {google.ai.generativelanguage.v1beta3.ListPermissionsResponse} message ListPermissionsResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListPermissionsResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.permissions = []; + if (options.defaults) + object.nextPageToken = ""; + if (message.permissions && message.permissions.length) { + object.permissions = []; + for (var j = 0; j < message.permissions.length; ++j) + object.permissions[j] = $root.google.ai.generativelanguage.v1beta3.Permission.toObject(message.permissions[j], options); + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + object.nextPageToken = message.nextPageToken; + return object; + }; + + /** + * Converts this ListPermissionsResponse to JSON. + * @function toJSON + * @memberof google.ai.generativelanguage.v1beta3.ListPermissionsResponse + * @instance + * @returns {Object.} JSON object + */ + ListPermissionsResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListPermissionsResponse + * @function getTypeUrl + * @memberof google.ai.generativelanguage.v1beta3.ListPermissionsResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListPermissionsResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.ai.generativelanguage.v1beta3.ListPermissionsResponse"; + }; + + return ListPermissionsResponse; + })(); + + v1beta3.UpdatePermissionRequest = (function() { + + /** + * Properties of an UpdatePermissionRequest. + * @memberof google.ai.generativelanguage.v1beta3 + * @interface IUpdatePermissionRequest + * @property {google.ai.generativelanguage.v1beta3.IPermission|null} [permission] UpdatePermissionRequest permission + * @property {google.protobuf.IFieldMask|null} [updateMask] UpdatePermissionRequest updateMask + */ + + /** + * Constructs a new UpdatePermissionRequest. + * @memberof google.ai.generativelanguage.v1beta3 + * @classdesc Represents an UpdatePermissionRequest. + * @implements IUpdatePermissionRequest + * @constructor + * @param {google.ai.generativelanguage.v1beta3.IUpdatePermissionRequest=} [properties] Properties to set + */ + function UpdatePermissionRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * UpdatePermissionRequest permission. + * @member {google.ai.generativelanguage.v1beta3.IPermission|null|undefined} permission + * @memberof google.ai.generativelanguage.v1beta3.UpdatePermissionRequest + * @instance + */ + UpdatePermissionRequest.prototype.permission = null; + + /** + * UpdatePermissionRequest updateMask. + * @member {google.protobuf.IFieldMask|null|undefined} updateMask + * @memberof google.ai.generativelanguage.v1beta3.UpdatePermissionRequest + * @instance + */ + UpdatePermissionRequest.prototype.updateMask = null; + + /** + * Creates a new UpdatePermissionRequest instance using the specified properties. + * @function create + * @memberof google.ai.generativelanguage.v1beta3.UpdatePermissionRequest + * @static + * @param {google.ai.generativelanguage.v1beta3.IUpdatePermissionRequest=} [properties] Properties to set + * @returns {google.ai.generativelanguage.v1beta3.UpdatePermissionRequest} UpdatePermissionRequest instance + */ + UpdatePermissionRequest.create = function create(properties) { + return new UpdatePermissionRequest(properties); + }; + + /** + * Encodes the specified UpdatePermissionRequest message. Does not implicitly {@link google.ai.generativelanguage.v1beta3.UpdatePermissionRequest.verify|verify} messages. + * @function encode + * @memberof google.ai.generativelanguage.v1beta3.UpdatePermissionRequest + * @static + * @param {google.ai.generativelanguage.v1beta3.IUpdatePermissionRequest} message UpdatePermissionRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdatePermissionRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.permission != null && Object.hasOwnProperty.call(message, "permission")) + $root.google.ai.generativelanguage.v1beta3.Permission.encode(message.permission, 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 UpdatePermissionRequest message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1beta3.UpdatePermissionRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.ai.generativelanguage.v1beta3.UpdatePermissionRequest + * @static + * @param {google.ai.generativelanguage.v1beta3.IUpdatePermissionRequest} message UpdatePermissionRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdatePermissionRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an UpdatePermissionRequest message from the specified reader or buffer. + * @function decode + * @memberof google.ai.generativelanguage.v1beta3.UpdatePermissionRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.ai.generativelanguage.v1beta3.UpdatePermissionRequest} UpdatePermissionRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdatePermissionRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.ai.generativelanguage.v1beta3.UpdatePermissionRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.permission = $root.google.ai.generativelanguage.v1beta3.Permission.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 UpdatePermissionRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.ai.generativelanguage.v1beta3.UpdatePermissionRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.ai.generativelanguage.v1beta3.UpdatePermissionRequest} UpdatePermissionRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdatePermissionRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an UpdatePermissionRequest message. + * @function verify + * @memberof google.ai.generativelanguage.v1beta3.UpdatePermissionRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + UpdatePermissionRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.permission != null && message.hasOwnProperty("permission")) { + var error = $root.google.ai.generativelanguage.v1beta3.Permission.verify(message.permission); + if (error) + return "permission." + 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 UpdatePermissionRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.ai.generativelanguage.v1beta3.UpdatePermissionRequest + * @static + * @param {Object.} object Plain object + * @returns {google.ai.generativelanguage.v1beta3.UpdatePermissionRequest} UpdatePermissionRequest + */ + UpdatePermissionRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.ai.generativelanguage.v1beta3.UpdatePermissionRequest) + return object; + var message = new $root.google.ai.generativelanguage.v1beta3.UpdatePermissionRequest(); + if (object.permission != null) { + if (typeof object.permission !== "object") + throw TypeError(".google.ai.generativelanguage.v1beta3.UpdatePermissionRequest.permission: object expected"); + message.permission = $root.google.ai.generativelanguage.v1beta3.Permission.fromObject(object.permission); + } + if (object.updateMask != null) { + if (typeof object.updateMask !== "object") + throw TypeError(".google.ai.generativelanguage.v1beta3.UpdatePermissionRequest.updateMask: object expected"); + message.updateMask = $root.google.protobuf.FieldMask.fromObject(object.updateMask); + } + return message; + }; + + /** + * Creates a plain object from an UpdatePermissionRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.ai.generativelanguage.v1beta3.UpdatePermissionRequest + * @static + * @param {google.ai.generativelanguage.v1beta3.UpdatePermissionRequest} message UpdatePermissionRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + UpdatePermissionRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.permission = null; + object.updateMask = null; + } + if (message.permission != null && message.hasOwnProperty("permission")) + object.permission = $root.google.ai.generativelanguage.v1beta3.Permission.toObject(message.permission, options); + if (message.updateMask != null && message.hasOwnProperty("updateMask")) + object.updateMask = $root.google.protobuf.FieldMask.toObject(message.updateMask, options); + return object; + }; + + /** + * Converts this UpdatePermissionRequest to JSON. + * @function toJSON + * @memberof google.ai.generativelanguage.v1beta3.UpdatePermissionRequest + * @instance + * @returns {Object.} JSON object + */ + UpdatePermissionRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for UpdatePermissionRequest + * @function getTypeUrl + * @memberof google.ai.generativelanguage.v1beta3.UpdatePermissionRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + UpdatePermissionRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.ai.generativelanguage.v1beta3.UpdatePermissionRequest"; + }; + + return UpdatePermissionRequest; + })(); + + v1beta3.DeletePermissionRequest = (function() { + + /** + * Properties of a DeletePermissionRequest. + * @memberof google.ai.generativelanguage.v1beta3 + * @interface IDeletePermissionRequest + * @property {string|null} [name] DeletePermissionRequest name + */ + + /** + * Constructs a new DeletePermissionRequest. + * @memberof google.ai.generativelanguage.v1beta3 + * @classdesc Represents a DeletePermissionRequest. + * @implements IDeletePermissionRequest + * @constructor + * @param {google.ai.generativelanguage.v1beta3.IDeletePermissionRequest=} [properties] Properties to set + */ + function DeletePermissionRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * DeletePermissionRequest name. + * @member {string} name + * @memberof google.ai.generativelanguage.v1beta3.DeletePermissionRequest + * @instance + */ + DeletePermissionRequest.prototype.name = ""; + + /** + * Creates a new DeletePermissionRequest instance using the specified properties. + * @function create + * @memberof google.ai.generativelanguage.v1beta3.DeletePermissionRequest + * @static + * @param {google.ai.generativelanguage.v1beta3.IDeletePermissionRequest=} [properties] Properties to set + * @returns {google.ai.generativelanguage.v1beta3.DeletePermissionRequest} DeletePermissionRequest instance + */ + DeletePermissionRequest.create = function create(properties) { + return new DeletePermissionRequest(properties); + }; + + /** + * Encodes the specified DeletePermissionRequest message. Does not implicitly {@link google.ai.generativelanguage.v1beta3.DeletePermissionRequest.verify|verify} messages. + * @function encode + * @memberof google.ai.generativelanguage.v1beta3.DeletePermissionRequest + * @static + * @param {google.ai.generativelanguage.v1beta3.IDeletePermissionRequest} message DeletePermissionRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeletePermissionRequest.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 DeletePermissionRequest message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1beta3.DeletePermissionRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.ai.generativelanguage.v1beta3.DeletePermissionRequest + * @static + * @param {google.ai.generativelanguage.v1beta3.IDeletePermissionRequest} message DeletePermissionRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeletePermissionRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DeletePermissionRequest message from the specified reader or buffer. + * @function decode + * @memberof google.ai.generativelanguage.v1beta3.DeletePermissionRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.ai.generativelanguage.v1beta3.DeletePermissionRequest} DeletePermissionRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeletePermissionRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.ai.generativelanguage.v1beta3.DeletePermissionRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DeletePermissionRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.ai.generativelanguage.v1beta3.DeletePermissionRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.ai.generativelanguage.v1beta3.DeletePermissionRequest} DeletePermissionRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeletePermissionRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DeletePermissionRequest message. + * @function verify + * @memberof google.ai.generativelanguage.v1beta3.DeletePermissionRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DeletePermissionRequest.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 DeletePermissionRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.ai.generativelanguage.v1beta3.DeletePermissionRequest + * @static + * @param {Object.} object Plain object + * @returns {google.ai.generativelanguage.v1beta3.DeletePermissionRequest} DeletePermissionRequest + */ + DeletePermissionRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.ai.generativelanguage.v1beta3.DeletePermissionRequest) + return object; + var message = new $root.google.ai.generativelanguage.v1beta3.DeletePermissionRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a DeletePermissionRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.ai.generativelanguage.v1beta3.DeletePermissionRequest + * @static + * @param {google.ai.generativelanguage.v1beta3.DeletePermissionRequest} message DeletePermissionRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DeletePermissionRequest.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 DeletePermissionRequest to JSON. + * @function toJSON + * @memberof google.ai.generativelanguage.v1beta3.DeletePermissionRequest + * @instance + * @returns {Object.} JSON object + */ + DeletePermissionRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DeletePermissionRequest + * @function getTypeUrl + * @memberof google.ai.generativelanguage.v1beta3.DeletePermissionRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DeletePermissionRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.ai.generativelanguage.v1beta3.DeletePermissionRequest"; + }; + + return DeletePermissionRequest; + })(); + + v1beta3.TransferOwnershipRequest = (function() { + + /** + * Properties of a TransferOwnershipRequest. + * @memberof google.ai.generativelanguage.v1beta3 + * @interface ITransferOwnershipRequest + * @property {string|null} [name] TransferOwnershipRequest name + * @property {string|null} [emailAddress] TransferOwnershipRequest emailAddress + */ + + /** + * Constructs a new TransferOwnershipRequest. + * @memberof google.ai.generativelanguage.v1beta3 + * @classdesc Represents a TransferOwnershipRequest. + * @implements ITransferOwnershipRequest + * @constructor + * @param {google.ai.generativelanguage.v1beta3.ITransferOwnershipRequest=} [properties] Properties to set + */ + function TransferOwnershipRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * TransferOwnershipRequest name. + * @member {string} name + * @memberof google.ai.generativelanguage.v1beta3.TransferOwnershipRequest + * @instance + */ + TransferOwnershipRequest.prototype.name = ""; + + /** + * TransferOwnershipRequest emailAddress. + * @member {string} emailAddress + * @memberof google.ai.generativelanguage.v1beta3.TransferOwnershipRequest + * @instance + */ + TransferOwnershipRequest.prototype.emailAddress = ""; + + /** + * Creates a new TransferOwnershipRequest instance using the specified properties. + * @function create + * @memberof google.ai.generativelanguage.v1beta3.TransferOwnershipRequest + * @static + * @param {google.ai.generativelanguage.v1beta3.ITransferOwnershipRequest=} [properties] Properties to set + * @returns {google.ai.generativelanguage.v1beta3.TransferOwnershipRequest} TransferOwnershipRequest instance + */ + TransferOwnershipRequest.create = function create(properties) { + return new TransferOwnershipRequest(properties); + }; + + /** + * Encodes the specified TransferOwnershipRequest message. Does not implicitly {@link google.ai.generativelanguage.v1beta3.TransferOwnershipRequest.verify|verify} messages. + * @function encode + * @memberof google.ai.generativelanguage.v1beta3.TransferOwnershipRequest + * @static + * @param {google.ai.generativelanguage.v1beta3.ITransferOwnershipRequest} message TransferOwnershipRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TransferOwnershipRequest.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.emailAddress != null && Object.hasOwnProperty.call(message, "emailAddress")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.emailAddress); + return writer; + }; + + /** + * Encodes the specified TransferOwnershipRequest message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1beta3.TransferOwnershipRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.ai.generativelanguage.v1beta3.TransferOwnershipRequest + * @static + * @param {google.ai.generativelanguage.v1beta3.ITransferOwnershipRequest} message TransferOwnershipRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TransferOwnershipRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a TransferOwnershipRequest message from the specified reader or buffer. + * @function decode + * @memberof google.ai.generativelanguage.v1beta3.TransferOwnershipRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.ai.generativelanguage.v1beta3.TransferOwnershipRequest} TransferOwnershipRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TransferOwnershipRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.ai.generativelanguage.v1beta3.TransferOwnershipRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.emailAddress = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a TransferOwnershipRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.ai.generativelanguage.v1beta3.TransferOwnershipRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.ai.generativelanguage.v1beta3.TransferOwnershipRequest} TransferOwnershipRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TransferOwnershipRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a TransferOwnershipRequest message. + * @function verify + * @memberof google.ai.generativelanguage.v1beta3.TransferOwnershipRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + TransferOwnershipRequest.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.emailAddress != null && message.hasOwnProperty("emailAddress")) + if (!$util.isString(message.emailAddress)) + return "emailAddress: string expected"; + return null; + }; + + /** + * Creates a TransferOwnershipRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.ai.generativelanguage.v1beta3.TransferOwnershipRequest + * @static + * @param {Object.} object Plain object + * @returns {google.ai.generativelanguage.v1beta3.TransferOwnershipRequest} TransferOwnershipRequest + */ + TransferOwnershipRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.ai.generativelanguage.v1beta3.TransferOwnershipRequest) + return object; + var message = new $root.google.ai.generativelanguage.v1beta3.TransferOwnershipRequest(); + if (object.name != null) + message.name = String(object.name); + if (object.emailAddress != null) + message.emailAddress = String(object.emailAddress); + return message; + }; + + /** + * Creates a plain object from a TransferOwnershipRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.ai.generativelanguage.v1beta3.TransferOwnershipRequest + * @static + * @param {google.ai.generativelanguage.v1beta3.TransferOwnershipRequest} message TransferOwnershipRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + TransferOwnershipRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.emailAddress = ""; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.emailAddress != null && message.hasOwnProperty("emailAddress")) + object.emailAddress = message.emailAddress; + return object; + }; + + /** + * Converts this TransferOwnershipRequest to JSON. + * @function toJSON + * @memberof google.ai.generativelanguage.v1beta3.TransferOwnershipRequest + * @instance + * @returns {Object.} JSON object + */ + TransferOwnershipRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for TransferOwnershipRequest + * @function getTypeUrl + * @memberof google.ai.generativelanguage.v1beta3.TransferOwnershipRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TransferOwnershipRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.ai.generativelanguage.v1beta3.TransferOwnershipRequest"; + }; + + return TransferOwnershipRequest; + })(); + + v1beta3.TransferOwnershipResponse = (function() { + + /** + * Properties of a TransferOwnershipResponse. + * @memberof google.ai.generativelanguage.v1beta3 + * @interface ITransferOwnershipResponse + */ + + /** + * Constructs a new TransferOwnershipResponse. + * @memberof google.ai.generativelanguage.v1beta3 + * @classdesc Represents a TransferOwnershipResponse. + * @implements ITransferOwnershipResponse + * @constructor + * @param {google.ai.generativelanguage.v1beta3.ITransferOwnershipResponse=} [properties] Properties to set + */ + function TransferOwnershipResponse(properties) { + if (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 TransferOwnershipResponse instance using the specified properties. + * @function create + * @memberof google.ai.generativelanguage.v1beta3.TransferOwnershipResponse + * @static + * @param {google.ai.generativelanguage.v1beta3.ITransferOwnershipResponse=} [properties] Properties to set + * @returns {google.ai.generativelanguage.v1beta3.TransferOwnershipResponse} TransferOwnershipResponse instance + */ + TransferOwnershipResponse.create = function create(properties) { + return new TransferOwnershipResponse(properties); + }; + + /** + * Encodes the specified TransferOwnershipResponse message. Does not implicitly {@link google.ai.generativelanguage.v1beta3.TransferOwnershipResponse.verify|verify} messages. + * @function encode + * @memberof google.ai.generativelanguage.v1beta3.TransferOwnershipResponse + * @static + * @param {google.ai.generativelanguage.v1beta3.ITransferOwnershipResponse} message TransferOwnershipResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TransferOwnershipResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + return writer; + }; + + /** + * Encodes the specified TransferOwnershipResponse message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1beta3.TransferOwnershipResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.ai.generativelanguage.v1beta3.TransferOwnershipResponse + * @static + * @param {google.ai.generativelanguage.v1beta3.ITransferOwnershipResponse} message TransferOwnershipResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TransferOwnershipResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a TransferOwnershipResponse message from the specified reader or buffer. + * @function decode + * @memberof google.ai.generativelanguage.v1beta3.TransferOwnershipResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.ai.generativelanguage.v1beta3.TransferOwnershipResponse} TransferOwnershipResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TransferOwnershipResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.ai.generativelanguage.v1beta3.TransferOwnershipResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a TransferOwnershipResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.ai.generativelanguage.v1beta3.TransferOwnershipResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.ai.generativelanguage.v1beta3.TransferOwnershipResponse} TransferOwnershipResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TransferOwnershipResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a TransferOwnershipResponse message. + * @function verify + * @memberof google.ai.generativelanguage.v1beta3.TransferOwnershipResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + TransferOwnershipResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + return null; + }; + + /** + * Creates a TransferOwnershipResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.ai.generativelanguage.v1beta3.TransferOwnershipResponse + * @static + * @param {Object.} object Plain object + * @returns {google.ai.generativelanguage.v1beta3.TransferOwnershipResponse} TransferOwnershipResponse + */ + TransferOwnershipResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.ai.generativelanguage.v1beta3.TransferOwnershipResponse) + return object; + return new $root.google.ai.generativelanguage.v1beta3.TransferOwnershipResponse(); + }; + + /** + * Creates a plain object from a TransferOwnershipResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.ai.generativelanguage.v1beta3.TransferOwnershipResponse + * @static + * @param {google.ai.generativelanguage.v1beta3.TransferOwnershipResponse} message TransferOwnershipResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + TransferOwnershipResponse.toObject = function toObject() { + return {}; + }; + + /** + * Converts this TransferOwnershipResponse to JSON. + * @function toJSON + * @memberof google.ai.generativelanguage.v1beta3.TransferOwnershipResponse + * @instance + * @returns {Object.} JSON object + */ + TransferOwnershipResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for TransferOwnershipResponse + * @function getTypeUrl + * @memberof google.ai.generativelanguage.v1beta3.TransferOwnershipResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TransferOwnershipResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.ai.generativelanguage.v1beta3.TransferOwnershipResponse"; + }; + + return TransferOwnershipResponse; + })(); + + v1beta3.TextService = (function() { + + /** + * Constructs a new TextService service. + * @memberof google.ai.generativelanguage.v1beta3 + * @classdesc Represents a TextService + * @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 TextService(rpcImpl, requestDelimited, responseDelimited) { + $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); + } + + (TextService.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = TextService; + + /** + * Creates new TextService service using the specified rpc implementation. + * @function create + * @memberof google.ai.generativelanguage.v1beta3.TextService + * @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 {TextService} RPC service. Useful where requests and/or responses are streamed. + */ + TextService.create = function create(rpcImpl, requestDelimited, responseDelimited) { + return new this(rpcImpl, requestDelimited, responseDelimited); + }; + + /** + * Callback as used by {@link google.ai.generativelanguage.v1beta3.TextService|generateText}. + * @memberof google.ai.generativelanguage.v1beta3.TextService + * @typedef GenerateTextCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.ai.generativelanguage.v1beta3.GenerateTextResponse} [response] GenerateTextResponse + */ + + /** + * Calls GenerateText. + * @function generateText + * @memberof google.ai.generativelanguage.v1beta3.TextService + * @instance + * @param {google.ai.generativelanguage.v1beta3.IGenerateTextRequest} request GenerateTextRequest message or plain object + * @param {google.ai.generativelanguage.v1beta3.TextService.GenerateTextCallback} callback Node-style callback called with the error, if any, and GenerateTextResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(TextService.prototype.generateText = function generateText(request, callback) { + return this.rpcCall(generateText, $root.google.ai.generativelanguage.v1beta3.GenerateTextRequest, $root.google.ai.generativelanguage.v1beta3.GenerateTextResponse, request, callback); + }, "name", { value: "GenerateText" }); + + /** + * Calls GenerateText. + * @function generateText + * @memberof google.ai.generativelanguage.v1beta3.TextService + * @instance + * @param {google.ai.generativelanguage.v1beta3.IGenerateTextRequest} request GenerateTextRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.ai.generativelanguage.v1beta3.TextService|embedText}. + * @memberof google.ai.generativelanguage.v1beta3.TextService + * @typedef EmbedTextCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.ai.generativelanguage.v1beta3.EmbedTextResponse} [response] EmbedTextResponse + */ + + /** + * Calls EmbedText. + * @function embedText + * @memberof google.ai.generativelanguage.v1beta3.TextService + * @instance + * @param {google.ai.generativelanguage.v1beta3.IEmbedTextRequest} request EmbedTextRequest message or plain object + * @param {google.ai.generativelanguage.v1beta3.TextService.EmbedTextCallback} callback Node-style callback called with the error, if any, and EmbedTextResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(TextService.prototype.embedText = function embedText(request, callback) { + return this.rpcCall(embedText, $root.google.ai.generativelanguage.v1beta3.EmbedTextRequest, $root.google.ai.generativelanguage.v1beta3.EmbedTextResponse, request, callback); + }, "name", { value: "EmbedText" }); + + /** + * Calls EmbedText. + * @function embedText + * @memberof google.ai.generativelanguage.v1beta3.TextService + * @instance + * @param {google.ai.generativelanguage.v1beta3.IEmbedTextRequest} request EmbedTextRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.ai.generativelanguage.v1beta3.TextService|batchEmbedText}. + * @memberof google.ai.generativelanguage.v1beta3.TextService + * @typedef BatchEmbedTextCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.ai.generativelanguage.v1beta3.BatchEmbedTextResponse} [response] BatchEmbedTextResponse + */ + + /** + * Calls BatchEmbedText. + * @function batchEmbedText + * @memberof google.ai.generativelanguage.v1beta3.TextService + * @instance + * @param {google.ai.generativelanguage.v1beta3.IBatchEmbedTextRequest} request BatchEmbedTextRequest message or plain object + * @param {google.ai.generativelanguage.v1beta3.TextService.BatchEmbedTextCallback} callback Node-style callback called with the error, if any, and BatchEmbedTextResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(TextService.prototype.batchEmbedText = function batchEmbedText(request, callback) { + return this.rpcCall(batchEmbedText, $root.google.ai.generativelanguage.v1beta3.BatchEmbedTextRequest, $root.google.ai.generativelanguage.v1beta3.BatchEmbedTextResponse, request, callback); + }, "name", { value: "BatchEmbedText" }); + + /** + * Calls BatchEmbedText. + * @function batchEmbedText + * @memberof google.ai.generativelanguage.v1beta3.TextService + * @instance + * @param {google.ai.generativelanguage.v1beta3.IBatchEmbedTextRequest} request BatchEmbedTextRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.ai.generativelanguage.v1beta3.TextService|countTextTokens}. + * @memberof google.ai.generativelanguage.v1beta3.TextService + * @typedef CountTextTokensCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.ai.generativelanguage.v1beta3.CountTextTokensResponse} [response] CountTextTokensResponse + */ + + /** + * Calls CountTextTokens. + * @function countTextTokens + * @memberof google.ai.generativelanguage.v1beta3.TextService + * @instance + * @param {google.ai.generativelanguage.v1beta3.ICountTextTokensRequest} request CountTextTokensRequest message or plain object + * @param {google.ai.generativelanguage.v1beta3.TextService.CountTextTokensCallback} callback Node-style callback called with the error, if any, and CountTextTokensResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(TextService.prototype.countTextTokens = function countTextTokens(request, callback) { + return this.rpcCall(countTextTokens, $root.google.ai.generativelanguage.v1beta3.CountTextTokensRequest, $root.google.ai.generativelanguage.v1beta3.CountTextTokensResponse, request, callback); + }, "name", { value: "CountTextTokens" }); + + /** + * Calls CountTextTokens. + * @function countTextTokens + * @memberof google.ai.generativelanguage.v1beta3.TextService + * @instance + * @param {google.ai.generativelanguage.v1beta3.ICountTextTokensRequest} request CountTextTokensRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + return TextService; + })(); + + v1beta3.GenerateTextRequest = (function() { + + /** + * Properties of a GenerateTextRequest. + * @memberof google.ai.generativelanguage.v1beta3 + * @interface IGenerateTextRequest + * @property {string|null} [model] GenerateTextRequest model + * @property {google.ai.generativelanguage.v1beta3.ITextPrompt|null} [prompt] GenerateTextRequest prompt + * @property {number|null} [temperature] GenerateTextRequest temperature + * @property {number|null} [candidateCount] GenerateTextRequest candidateCount + * @property {number|null} [maxOutputTokens] GenerateTextRequest maxOutputTokens + * @property {number|null} [topP] GenerateTextRequest topP + * @property {number|null} [topK] GenerateTextRequest topK + * @property {Array.|null} [safetySettings] GenerateTextRequest safetySettings + * @property {Array.|null} [stopSequences] GenerateTextRequest stopSequences + */ + + /** + * Constructs a new GenerateTextRequest. + * @memberof google.ai.generativelanguage.v1beta3 + * @classdesc Represents a GenerateTextRequest. + * @implements IGenerateTextRequest + * @constructor + * @param {google.ai.generativelanguage.v1beta3.IGenerateTextRequest=} [properties] Properties to set + */ + function GenerateTextRequest(properties) { + this.safetySettings = []; + this.stopSequences = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GenerateTextRequest model. + * @member {string} model + * @memberof google.ai.generativelanguage.v1beta3.GenerateTextRequest + * @instance + */ + GenerateTextRequest.prototype.model = ""; + + /** + * GenerateTextRequest prompt. + * @member {google.ai.generativelanguage.v1beta3.ITextPrompt|null|undefined} prompt + * @memberof google.ai.generativelanguage.v1beta3.GenerateTextRequest + * @instance + */ + GenerateTextRequest.prototype.prompt = null; + + /** + * GenerateTextRequest temperature. + * @member {number|null|undefined} temperature + * @memberof google.ai.generativelanguage.v1beta3.GenerateTextRequest + * @instance + */ + GenerateTextRequest.prototype.temperature = null; + + /** + * GenerateTextRequest candidateCount. + * @member {number|null|undefined} candidateCount + * @memberof google.ai.generativelanguage.v1beta3.GenerateTextRequest + * @instance + */ + GenerateTextRequest.prototype.candidateCount = null; + + /** + * GenerateTextRequest maxOutputTokens. + * @member {number|null|undefined} maxOutputTokens + * @memberof google.ai.generativelanguage.v1beta3.GenerateTextRequest + * @instance + */ + GenerateTextRequest.prototype.maxOutputTokens = null; + + /** + * GenerateTextRequest topP. + * @member {number|null|undefined} topP + * @memberof google.ai.generativelanguage.v1beta3.GenerateTextRequest + * @instance + */ + GenerateTextRequest.prototype.topP = null; + + /** + * GenerateTextRequest topK. + * @member {number|null|undefined} topK + * @memberof google.ai.generativelanguage.v1beta3.GenerateTextRequest + * @instance + */ + GenerateTextRequest.prototype.topK = null; + + /** + * GenerateTextRequest safetySettings. + * @member {Array.} safetySettings + * @memberof google.ai.generativelanguage.v1beta3.GenerateTextRequest + * @instance + */ + GenerateTextRequest.prototype.safetySettings = $util.emptyArray; + + /** + * GenerateTextRequest stopSequences. + * @member {Array.} stopSequences + * @memberof google.ai.generativelanguage.v1beta3.GenerateTextRequest + * @instance + */ + GenerateTextRequest.prototype.stopSequences = $util.emptyArray; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * GenerateTextRequest _temperature. + * @member {"temperature"|undefined} _temperature + * @memberof google.ai.generativelanguage.v1beta3.GenerateTextRequest + * @instance + */ + Object.defineProperty(GenerateTextRequest.prototype, "_temperature", { + get: $util.oneOfGetter($oneOfFields = ["temperature"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * GenerateTextRequest _candidateCount. + * @member {"candidateCount"|undefined} _candidateCount + * @memberof google.ai.generativelanguage.v1beta3.GenerateTextRequest + * @instance + */ + Object.defineProperty(GenerateTextRequest.prototype, "_candidateCount", { + get: $util.oneOfGetter($oneOfFields = ["candidateCount"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * GenerateTextRequest _maxOutputTokens. + * @member {"maxOutputTokens"|undefined} _maxOutputTokens + * @memberof google.ai.generativelanguage.v1beta3.GenerateTextRequest + * @instance + */ + Object.defineProperty(GenerateTextRequest.prototype, "_maxOutputTokens", { + get: $util.oneOfGetter($oneOfFields = ["maxOutputTokens"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * GenerateTextRequest _topP. + * @member {"topP"|undefined} _topP + * @memberof google.ai.generativelanguage.v1beta3.GenerateTextRequest + * @instance + */ + Object.defineProperty(GenerateTextRequest.prototype, "_topP", { + get: $util.oneOfGetter($oneOfFields = ["topP"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * GenerateTextRequest _topK. + * @member {"topK"|undefined} _topK + * @memberof google.ai.generativelanguage.v1beta3.GenerateTextRequest + * @instance + */ + Object.defineProperty(GenerateTextRequest.prototype, "_topK", { + get: $util.oneOfGetter($oneOfFields = ["topK"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new GenerateTextRequest instance using the specified properties. + * @function create + * @memberof google.ai.generativelanguage.v1beta3.GenerateTextRequest + * @static + * @param {google.ai.generativelanguage.v1beta3.IGenerateTextRequest=} [properties] Properties to set + * @returns {google.ai.generativelanguage.v1beta3.GenerateTextRequest} GenerateTextRequest instance + */ + GenerateTextRequest.create = function create(properties) { + return new GenerateTextRequest(properties); + }; + + /** + * Encodes the specified GenerateTextRequest message. Does not implicitly {@link google.ai.generativelanguage.v1beta3.GenerateTextRequest.verify|verify} messages. + * @function encode + * @memberof google.ai.generativelanguage.v1beta3.GenerateTextRequest + * @static + * @param {google.ai.generativelanguage.v1beta3.IGenerateTextRequest} message GenerateTextRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GenerateTextRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.model != null && Object.hasOwnProperty.call(message, "model")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.model); + if (message.prompt != null && Object.hasOwnProperty.call(message, "prompt")) + $root.google.ai.generativelanguage.v1beta3.TextPrompt.encode(message.prompt, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.temperature != null && Object.hasOwnProperty.call(message, "temperature")) + writer.uint32(/* id 3, wireType 5 =*/29).float(message.temperature); + if (message.candidateCount != null && Object.hasOwnProperty.call(message, "candidateCount")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.candidateCount); + if (message.maxOutputTokens != null && Object.hasOwnProperty.call(message, "maxOutputTokens")) + writer.uint32(/* id 5, wireType 0 =*/40).int32(message.maxOutputTokens); + if (message.topP != null && Object.hasOwnProperty.call(message, "topP")) + writer.uint32(/* id 6, wireType 5 =*/53).float(message.topP); + if (message.topK != null && Object.hasOwnProperty.call(message, "topK")) + writer.uint32(/* id 7, wireType 0 =*/56).int32(message.topK); + if (message.safetySettings != null && message.safetySettings.length) + for (var i = 0; i < message.safetySettings.length; ++i) + $root.google.ai.generativelanguage.v1beta3.SafetySetting.encode(message.safetySettings[i], writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); + if (message.stopSequences != null && message.stopSequences.length) + for (var i = 0; i < message.stopSequences.length; ++i) + writer.uint32(/* id 9, wireType 2 =*/74).string(message.stopSequences[i]); + return writer; + }; + + /** + * Encodes the specified GenerateTextRequest message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1beta3.GenerateTextRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.ai.generativelanguage.v1beta3.GenerateTextRequest + * @static + * @param {google.ai.generativelanguage.v1beta3.IGenerateTextRequest} message GenerateTextRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GenerateTextRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GenerateTextRequest message from the specified reader or buffer. + * @function decode + * @memberof google.ai.generativelanguage.v1beta3.GenerateTextRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.ai.generativelanguage.v1beta3.GenerateTextRequest} GenerateTextRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GenerateTextRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.ai.generativelanguage.v1beta3.GenerateTextRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.model = reader.string(); + break; + } + case 2: { + message.prompt = $root.google.ai.generativelanguage.v1beta3.TextPrompt.decode(reader, reader.uint32()); + break; + } + case 3: { + message.temperature = reader.float(); + break; + } + case 4: { + message.candidateCount = reader.int32(); + break; + } + case 5: { + message.maxOutputTokens = reader.int32(); + break; + } + case 6: { + message.topP = reader.float(); + break; + } + case 7: { + message.topK = reader.int32(); + break; + } + case 8: { + if (!(message.safetySettings && message.safetySettings.length)) + message.safetySettings = []; + message.safetySettings.push($root.google.ai.generativelanguage.v1beta3.SafetySetting.decode(reader, reader.uint32())); + break; + } + case 9: { + if (!(message.stopSequences && message.stopSequences.length)) + message.stopSequences = []; + message.stopSequences.push(reader.string()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GenerateTextRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.ai.generativelanguage.v1beta3.GenerateTextRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.ai.generativelanguage.v1beta3.GenerateTextRequest} GenerateTextRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GenerateTextRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GenerateTextRequest message. + * @function verify + * @memberof google.ai.generativelanguage.v1beta3.GenerateTextRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GenerateTextRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.model != null && message.hasOwnProperty("model")) + if (!$util.isString(message.model)) + return "model: string expected"; + if (message.prompt != null && message.hasOwnProperty("prompt")) { + var error = $root.google.ai.generativelanguage.v1beta3.TextPrompt.verify(message.prompt); + if (error) + return "prompt." + error; + } + if (message.temperature != null && message.hasOwnProperty("temperature")) { + properties._temperature = 1; + if (typeof message.temperature !== "number") + return "temperature: number expected"; + } + if (message.candidateCount != null && message.hasOwnProperty("candidateCount")) { + properties._candidateCount = 1; + if (!$util.isInteger(message.candidateCount)) + return "candidateCount: integer expected"; + } + if (message.maxOutputTokens != null && message.hasOwnProperty("maxOutputTokens")) { + properties._maxOutputTokens = 1; + if (!$util.isInteger(message.maxOutputTokens)) + return "maxOutputTokens: integer expected"; + } + if (message.topP != null && message.hasOwnProperty("topP")) { + properties._topP = 1; + if (typeof message.topP !== "number") + return "topP: number expected"; + } + if (message.topK != null && message.hasOwnProperty("topK")) { + properties._topK = 1; + if (!$util.isInteger(message.topK)) + return "topK: integer expected"; + } + if (message.safetySettings != null && message.hasOwnProperty("safetySettings")) { + if (!Array.isArray(message.safetySettings)) + return "safetySettings: array expected"; + for (var i = 0; i < message.safetySettings.length; ++i) { + var error = $root.google.ai.generativelanguage.v1beta3.SafetySetting.verify(message.safetySettings[i]); + if (error) + return "safetySettings." + error; + } + } + if (message.stopSequences != null && message.hasOwnProperty("stopSequences")) { + if (!Array.isArray(message.stopSequences)) + return "stopSequences: array expected"; + for (var i = 0; i < message.stopSequences.length; ++i) + if (!$util.isString(message.stopSequences[i])) + return "stopSequences: string[] expected"; + } + return null; + }; + + /** + * Creates a GenerateTextRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.ai.generativelanguage.v1beta3.GenerateTextRequest + * @static + * @param {Object.} object Plain object + * @returns {google.ai.generativelanguage.v1beta3.GenerateTextRequest} GenerateTextRequest + */ + GenerateTextRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.ai.generativelanguage.v1beta3.GenerateTextRequest) + return object; + var message = new $root.google.ai.generativelanguage.v1beta3.GenerateTextRequest(); + if (object.model != null) + message.model = String(object.model); + if (object.prompt != null) { + if (typeof object.prompt !== "object") + throw TypeError(".google.ai.generativelanguage.v1beta3.GenerateTextRequest.prompt: object expected"); + message.prompt = $root.google.ai.generativelanguage.v1beta3.TextPrompt.fromObject(object.prompt); + } + if (object.temperature != null) + message.temperature = Number(object.temperature); + if (object.candidateCount != null) + message.candidateCount = object.candidateCount | 0; + if (object.maxOutputTokens != null) + message.maxOutputTokens = object.maxOutputTokens | 0; + if (object.topP != null) + message.topP = Number(object.topP); + if (object.topK != null) + message.topK = object.topK | 0; + if (object.safetySettings) { + if (!Array.isArray(object.safetySettings)) + throw TypeError(".google.ai.generativelanguage.v1beta3.GenerateTextRequest.safetySettings: array expected"); + message.safetySettings = []; + for (var i = 0; i < object.safetySettings.length; ++i) { + if (typeof object.safetySettings[i] !== "object") + throw TypeError(".google.ai.generativelanguage.v1beta3.GenerateTextRequest.safetySettings: object expected"); + message.safetySettings[i] = $root.google.ai.generativelanguage.v1beta3.SafetySetting.fromObject(object.safetySettings[i]); + } + } + if (object.stopSequences) { + if (!Array.isArray(object.stopSequences)) + throw TypeError(".google.ai.generativelanguage.v1beta3.GenerateTextRequest.stopSequences: array expected"); + message.stopSequences = []; + for (var i = 0; i < object.stopSequences.length; ++i) + message.stopSequences[i] = String(object.stopSequences[i]); + } + return message; + }; + + /** + * Creates a plain object from a GenerateTextRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.ai.generativelanguage.v1beta3.GenerateTextRequest + * @static + * @param {google.ai.generativelanguage.v1beta3.GenerateTextRequest} message GenerateTextRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GenerateTextRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.safetySettings = []; + object.stopSequences = []; + } + if (options.defaults) { + object.model = ""; + object.prompt = null; + } + if (message.model != null && message.hasOwnProperty("model")) + object.model = message.model; + if (message.prompt != null && message.hasOwnProperty("prompt")) + object.prompt = $root.google.ai.generativelanguage.v1beta3.TextPrompt.toObject(message.prompt, options); + if (message.temperature != null && message.hasOwnProperty("temperature")) { + object.temperature = options.json && !isFinite(message.temperature) ? String(message.temperature) : message.temperature; + if (options.oneofs) + object._temperature = "temperature"; + } + if (message.candidateCount != null && message.hasOwnProperty("candidateCount")) { + object.candidateCount = message.candidateCount; + if (options.oneofs) + object._candidateCount = "candidateCount"; + } + if (message.maxOutputTokens != null && message.hasOwnProperty("maxOutputTokens")) { + object.maxOutputTokens = message.maxOutputTokens; + if (options.oneofs) + object._maxOutputTokens = "maxOutputTokens"; + } + if (message.topP != null && message.hasOwnProperty("topP")) { + object.topP = options.json && !isFinite(message.topP) ? String(message.topP) : message.topP; + if (options.oneofs) + object._topP = "topP"; + } + if (message.topK != null && message.hasOwnProperty("topK")) { + object.topK = message.topK; + if (options.oneofs) + object._topK = "topK"; + } + if (message.safetySettings && message.safetySettings.length) { + object.safetySettings = []; + for (var j = 0; j < message.safetySettings.length; ++j) + object.safetySettings[j] = $root.google.ai.generativelanguage.v1beta3.SafetySetting.toObject(message.safetySettings[j], options); + } + if (message.stopSequences && message.stopSequences.length) { + object.stopSequences = []; + for (var j = 0; j < message.stopSequences.length; ++j) + object.stopSequences[j] = message.stopSequences[j]; + } + return object; + }; + + /** + * Converts this GenerateTextRequest to JSON. + * @function toJSON + * @memberof google.ai.generativelanguage.v1beta3.GenerateTextRequest + * @instance + * @returns {Object.} JSON object + */ + GenerateTextRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GenerateTextRequest + * @function getTypeUrl + * @memberof google.ai.generativelanguage.v1beta3.GenerateTextRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GenerateTextRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.ai.generativelanguage.v1beta3.GenerateTextRequest"; + }; + + return GenerateTextRequest; + })(); + + v1beta3.GenerateTextResponse = (function() { + + /** + * Properties of a GenerateTextResponse. + * @memberof google.ai.generativelanguage.v1beta3 + * @interface IGenerateTextResponse + * @property {Array.|null} [candidates] GenerateTextResponse candidates + * @property {Array.|null} [filters] GenerateTextResponse filters + * @property {Array.|null} [safetyFeedback] GenerateTextResponse safetyFeedback + */ + + /** + * Constructs a new GenerateTextResponse. + * @memberof google.ai.generativelanguage.v1beta3 + * @classdesc Represents a GenerateTextResponse. + * @implements IGenerateTextResponse + * @constructor + * @param {google.ai.generativelanguage.v1beta3.IGenerateTextResponse=} [properties] Properties to set + */ + function GenerateTextResponse(properties) { + this.candidates = []; + this.filters = []; + this.safetyFeedback = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GenerateTextResponse candidates. + * @member {Array.} candidates + * @memberof google.ai.generativelanguage.v1beta3.GenerateTextResponse + * @instance + */ + GenerateTextResponse.prototype.candidates = $util.emptyArray; + + /** + * GenerateTextResponse filters. + * @member {Array.} filters + * @memberof google.ai.generativelanguage.v1beta3.GenerateTextResponse + * @instance + */ + GenerateTextResponse.prototype.filters = $util.emptyArray; + + /** + * GenerateTextResponse safetyFeedback. + * @member {Array.} safetyFeedback + * @memberof google.ai.generativelanguage.v1beta3.GenerateTextResponse + * @instance + */ + GenerateTextResponse.prototype.safetyFeedback = $util.emptyArray; + + /** + * Creates a new GenerateTextResponse instance using the specified properties. + * @function create + * @memberof google.ai.generativelanguage.v1beta3.GenerateTextResponse + * @static + * @param {google.ai.generativelanguage.v1beta3.IGenerateTextResponse=} [properties] Properties to set + * @returns {google.ai.generativelanguage.v1beta3.GenerateTextResponse} GenerateTextResponse instance + */ + GenerateTextResponse.create = function create(properties) { + return new GenerateTextResponse(properties); + }; + + /** + * Encodes the specified GenerateTextResponse message. Does not implicitly {@link google.ai.generativelanguage.v1beta3.GenerateTextResponse.verify|verify} messages. + * @function encode + * @memberof google.ai.generativelanguage.v1beta3.GenerateTextResponse + * @static + * @param {google.ai.generativelanguage.v1beta3.IGenerateTextResponse} message GenerateTextResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GenerateTextResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.candidates != null && message.candidates.length) + for (var i = 0; i < message.candidates.length; ++i) + $root.google.ai.generativelanguage.v1beta3.TextCompletion.encode(message.candidates[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.filters != null && message.filters.length) + for (var i = 0; i < message.filters.length; ++i) + $root.google.ai.generativelanguage.v1beta3.ContentFilter.encode(message.filters[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.safetyFeedback != null && message.safetyFeedback.length) + for (var i = 0; i < message.safetyFeedback.length; ++i) + $root.google.ai.generativelanguage.v1beta3.SafetyFeedback.encode(message.safetyFeedback[i], writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified GenerateTextResponse message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1beta3.GenerateTextResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.ai.generativelanguage.v1beta3.GenerateTextResponse + * @static + * @param {google.ai.generativelanguage.v1beta3.IGenerateTextResponse} message GenerateTextResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GenerateTextResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GenerateTextResponse message from the specified reader or buffer. + * @function decode + * @memberof google.ai.generativelanguage.v1beta3.GenerateTextResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.ai.generativelanguage.v1beta3.GenerateTextResponse} GenerateTextResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GenerateTextResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.ai.generativelanguage.v1beta3.GenerateTextResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.candidates && message.candidates.length)) + message.candidates = []; + message.candidates.push($root.google.ai.generativelanguage.v1beta3.TextCompletion.decode(reader, reader.uint32())); + break; + } + case 3: { + if (!(message.filters && message.filters.length)) + message.filters = []; + message.filters.push($root.google.ai.generativelanguage.v1beta3.ContentFilter.decode(reader, reader.uint32())); + break; + } + case 4: { + if (!(message.safetyFeedback && message.safetyFeedback.length)) + message.safetyFeedback = []; + message.safetyFeedback.push($root.google.ai.generativelanguage.v1beta3.SafetyFeedback.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GenerateTextResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.ai.generativelanguage.v1beta3.GenerateTextResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.ai.generativelanguage.v1beta3.GenerateTextResponse} GenerateTextResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GenerateTextResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GenerateTextResponse message. + * @function verify + * @memberof google.ai.generativelanguage.v1beta3.GenerateTextResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GenerateTextResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.candidates != null && message.hasOwnProperty("candidates")) { + if (!Array.isArray(message.candidates)) + return "candidates: array expected"; + for (var i = 0; i < message.candidates.length; ++i) { + var error = $root.google.ai.generativelanguage.v1beta3.TextCompletion.verify(message.candidates[i]); + if (error) + return "candidates." + error; + } + } + if (message.filters != null && message.hasOwnProperty("filters")) { + if (!Array.isArray(message.filters)) + return "filters: array expected"; + for (var i = 0; i < message.filters.length; ++i) { + var error = $root.google.ai.generativelanguage.v1beta3.ContentFilter.verify(message.filters[i]); + if (error) + return "filters." + error; + } + } + if (message.safetyFeedback != null && message.hasOwnProperty("safetyFeedback")) { + if (!Array.isArray(message.safetyFeedback)) + return "safetyFeedback: array expected"; + for (var i = 0; i < message.safetyFeedback.length; ++i) { + var error = $root.google.ai.generativelanguage.v1beta3.SafetyFeedback.verify(message.safetyFeedback[i]); + if (error) + return "safetyFeedback." + error; + } + } + return null; + }; + + /** + * Creates a GenerateTextResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.ai.generativelanguage.v1beta3.GenerateTextResponse + * @static + * @param {Object.} object Plain object + * @returns {google.ai.generativelanguage.v1beta3.GenerateTextResponse} GenerateTextResponse + */ + GenerateTextResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.ai.generativelanguage.v1beta3.GenerateTextResponse) + return object; + var message = new $root.google.ai.generativelanguage.v1beta3.GenerateTextResponse(); + if (object.candidates) { + if (!Array.isArray(object.candidates)) + throw TypeError(".google.ai.generativelanguage.v1beta3.GenerateTextResponse.candidates: array expected"); + message.candidates = []; + for (var i = 0; i < object.candidates.length; ++i) { + if (typeof object.candidates[i] !== "object") + throw TypeError(".google.ai.generativelanguage.v1beta3.GenerateTextResponse.candidates: object expected"); + message.candidates[i] = $root.google.ai.generativelanguage.v1beta3.TextCompletion.fromObject(object.candidates[i]); + } + } + if (object.filters) { + if (!Array.isArray(object.filters)) + throw TypeError(".google.ai.generativelanguage.v1beta3.GenerateTextResponse.filters: array expected"); + message.filters = []; + for (var i = 0; i < object.filters.length; ++i) { + if (typeof object.filters[i] !== "object") + throw TypeError(".google.ai.generativelanguage.v1beta3.GenerateTextResponse.filters: object expected"); + message.filters[i] = $root.google.ai.generativelanguage.v1beta3.ContentFilter.fromObject(object.filters[i]); + } + } + if (object.safetyFeedback) { + if (!Array.isArray(object.safetyFeedback)) + throw TypeError(".google.ai.generativelanguage.v1beta3.GenerateTextResponse.safetyFeedback: array expected"); + message.safetyFeedback = []; + for (var i = 0; i < object.safetyFeedback.length; ++i) { + if (typeof object.safetyFeedback[i] !== "object") + throw TypeError(".google.ai.generativelanguage.v1beta3.GenerateTextResponse.safetyFeedback: object expected"); + message.safetyFeedback[i] = $root.google.ai.generativelanguage.v1beta3.SafetyFeedback.fromObject(object.safetyFeedback[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a GenerateTextResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.ai.generativelanguage.v1beta3.GenerateTextResponse + * @static + * @param {google.ai.generativelanguage.v1beta3.GenerateTextResponse} message GenerateTextResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GenerateTextResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.candidates = []; + object.filters = []; + object.safetyFeedback = []; + } + if (message.candidates && message.candidates.length) { + object.candidates = []; + for (var j = 0; j < message.candidates.length; ++j) + object.candidates[j] = $root.google.ai.generativelanguage.v1beta3.TextCompletion.toObject(message.candidates[j], options); + } + if (message.filters && message.filters.length) { + object.filters = []; + for (var j = 0; j < message.filters.length; ++j) + object.filters[j] = $root.google.ai.generativelanguage.v1beta3.ContentFilter.toObject(message.filters[j], options); + } + if (message.safetyFeedback && message.safetyFeedback.length) { + object.safetyFeedback = []; + for (var j = 0; j < message.safetyFeedback.length; ++j) + object.safetyFeedback[j] = $root.google.ai.generativelanguage.v1beta3.SafetyFeedback.toObject(message.safetyFeedback[j], options); + } + return object; + }; + + /** + * Converts this GenerateTextResponse to JSON. + * @function toJSON + * @memberof google.ai.generativelanguage.v1beta3.GenerateTextResponse + * @instance + * @returns {Object.} JSON object + */ + GenerateTextResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GenerateTextResponse + * @function getTypeUrl + * @memberof google.ai.generativelanguage.v1beta3.GenerateTextResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GenerateTextResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.ai.generativelanguage.v1beta3.GenerateTextResponse"; + }; + + return GenerateTextResponse; + })(); + + v1beta3.TextPrompt = (function() { + + /** + * Properties of a TextPrompt. + * @memberof google.ai.generativelanguage.v1beta3 + * @interface ITextPrompt + * @property {string|null} [text] TextPrompt text + */ + + /** + * Constructs a new TextPrompt. + * @memberof google.ai.generativelanguage.v1beta3 + * @classdesc Represents a TextPrompt. + * @implements ITextPrompt + * @constructor + * @param {google.ai.generativelanguage.v1beta3.ITextPrompt=} [properties] Properties to set + */ + function TextPrompt(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * TextPrompt text. + * @member {string} text + * @memberof google.ai.generativelanguage.v1beta3.TextPrompt + * @instance + */ + TextPrompt.prototype.text = ""; + + /** + * Creates a new TextPrompt instance using the specified properties. + * @function create + * @memberof google.ai.generativelanguage.v1beta3.TextPrompt + * @static + * @param {google.ai.generativelanguage.v1beta3.ITextPrompt=} [properties] Properties to set + * @returns {google.ai.generativelanguage.v1beta3.TextPrompt} TextPrompt instance + */ + TextPrompt.create = function create(properties) { + return new TextPrompt(properties); + }; + + /** + * Encodes the specified TextPrompt message. Does not implicitly {@link google.ai.generativelanguage.v1beta3.TextPrompt.verify|verify} messages. + * @function encode + * @memberof google.ai.generativelanguage.v1beta3.TextPrompt + * @static + * @param {google.ai.generativelanguage.v1beta3.ITextPrompt} message TextPrompt message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TextPrompt.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.text != null && Object.hasOwnProperty.call(message, "text")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.text); + return writer; + }; + + /** + * Encodes the specified TextPrompt message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1beta3.TextPrompt.verify|verify} messages. + * @function encodeDelimited + * @memberof google.ai.generativelanguage.v1beta3.TextPrompt + * @static + * @param {google.ai.generativelanguage.v1beta3.ITextPrompt} message TextPrompt message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TextPrompt.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a TextPrompt message from the specified reader or buffer. + * @function decode + * @memberof google.ai.generativelanguage.v1beta3.TextPrompt + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.ai.generativelanguage.v1beta3.TextPrompt} TextPrompt + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TextPrompt.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.ai.generativelanguage.v1beta3.TextPrompt(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.text = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a TextPrompt message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.ai.generativelanguage.v1beta3.TextPrompt + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.ai.generativelanguage.v1beta3.TextPrompt} TextPrompt + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TextPrompt.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a TextPrompt message. + * @function verify + * @memberof google.ai.generativelanguage.v1beta3.TextPrompt + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + TextPrompt.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.text != null && message.hasOwnProperty("text")) + if (!$util.isString(message.text)) + return "text: string expected"; + return null; + }; + + /** + * Creates a TextPrompt message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.ai.generativelanguage.v1beta3.TextPrompt + * @static + * @param {Object.} object Plain object + * @returns {google.ai.generativelanguage.v1beta3.TextPrompt} TextPrompt + */ + TextPrompt.fromObject = function fromObject(object) { + if (object instanceof $root.google.ai.generativelanguage.v1beta3.TextPrompt) + return object; + var message = new $root.google.ai.generativelanguage.v1beta3.TextPrompt(); + if (object.text != null) + message.text = String(object.text); + return message; + }; + + /** + * Creates a plain object from a TextPrompt message. Also converts values to other types if specified. + * @function toObject + * @memberof google.ai.generativelanguage.v1beta3.TextPrompt + * @static + * @param {google.ai.generativelanguage.v1beta3.TextPrompt} message TextPrompt + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + TextPrompt.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.text = ""; + if (message.text != null && message.hasOwnProperty("text")) + object.text = message.text; + return object; + }; + + /** + * Converts this TextPrompt to JSON. + * @function toJSON + * @memberof google.ai.generativelanguage.v1beta3.TextPrompt + * @instance + * @returns {Object.} JSON object + */ + TextPrompt.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for TextPrompt + * @function getTypeUrl + * @memberof google.ai.generativelanguage.v1beta3.TextPrompt + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TextPrompt.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.ai.generativelanguage.v1beta3.TextPrompt"; + }; + + return TextPrompt; + })(); + + v1beta3.TextCompletion = (function() { + + /** + * Properties of a TextCompletion. + * @memberof google.ai.generativelanguage.v1beta3 + * @interface ITextCompletion + * @property {string|null} [output] TextCompletion output + * @property {Array.|null} [safetyRatings] TextCompletion safetyRatings + * @property {google.ai.generativelanguage.v1beta3.ICitationMetadata|null} [citationMetadata] TextCompletion citationMetadata + */ + + /** + * Constructs a new TextCompletion. + * @memberof google.ai.generativelanguage.v1beta3 + * @classdesc Represents a TextCompletion. + * @implements ITextCompletion + * @constructor + * @param {google.ai.generativelanguage.v1beta3.ITextCompletion=} [properties] Properties to set + */ + function TextCompletion(properties) { + this.safetyRatings = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * TextCompletion output. + * @member {string} output + * @memberof google.ai.generativelanguage.v1beta3.TextCompletion + * @instance + */ + TextCompletion.prototype.output = ""; + + /** + * TextCompletion safetyRatings. + * @member {Array.} safetyRatings + * @memberof google.ai.generativelanguage.v1beta3.TextCompletion + * @instance + */ + TextCompletion.prototype.safetyRatings = $util.emptyArray; + + /** + * TextCompletion citationMetadata. + * @member {google.ai.generativelanguage.v1beta3.ICitationMetadata|null|undefined} citationMetadata + * @memberof google.ai.generativelanguage.v1beta3.TextCompletion + * @instance + */ + TextCompletion.prototype.citationMetadata = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * TextCompletion _citationMetadata. + * @member {"citationMetadata"|undefined} _citationMetadata + * @memberof google.ai.generativelanguage.v1beta3.TextCompletion + * @instance + */ + Object.defineProperty(TextCompletion.prototype, "_citationMetadata", { + get: $util.oneOfGetter($oneOfFields = ["citationMetadata"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new TextCompletion instance using the specified properties. + * @function create + * @memberof google.ai.generativelanguage.v1beta3.TextCompletion + * @static + * @param {google.ai.generativelanguage.v1beta3.ITextCompletion=} [properties] Properties to set + * @returns {google.ai.generativelanguage.v1beta3.TextCompletion} TextCompletion instance + */ + TextCompletion.create = function create(properties) { + return new TextCompletion(properties); + }; + + /** + * Encodes the specified TextCompletion message. Does not implicitly {@link google.ai.generativelanguage.v1beta3.TextCompletion.verify|verify} messages. + * @function encode + * @memberof google.ai.generativelanguage.v1beta3.TextCompletion + * @static + * @param {google.ai.generativelanguage.v1beta3.ITextCompletion} message TextCompletion message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TextCompletion.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.output != null && Object.hasOwnProperty.call(message, "output")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.output); + if (message.safetyRatings != null && message.safetyRatings.length) + for (var i = 0; i < message.safetyRatings.length; ++i) + $root.google.ai.generativelanguage.v1beta3.SafetyRating.encode(message.safetyRatings[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.citationMetadata != null && Object.hasOwnProperty.call(message, "citationMetadata")) + $root.google.ai.generativelanguage.v1beta3.CitationMetadata.encode(message.citationMetadata, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified TextCompletion message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1beta3.TextCompletion.verify|verify} messages. + * @function encodeDelimited + * @memberof google.ai.generativelanguage.v1beta3.TextCompletion + * @static + * @param {google.ai.generativelanguage.v1beta3.ITextCompletion} message TextCompletion message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TextCompletion.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a TextCompletion message from the specified reader or buffer. + * @function decode + * @memberof google.ai.generativelanguage.v1beta3.TextCompletion + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.ai.generativelanguage.v1beta3.TextCompletion} TextCompletion + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TextCompletion.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.ai.generativelanguage.v1beta3.TextCompletion(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.output = reader.string(); + break; + } + case 2: { + if (!(message.safetyRatings && message.safetyRatings.length)) + message.safetyRatings = []; + message.safetyRatings.push($root.google.ai.generativelanguage.v1beta3.SafetyRating.decode(reader, reader.uint32())); + break; + } + case 3: { + message.citationMetadata = $root.google.ai.generativelanguage.v1beta3.CitationMetadata.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a TextCompletion message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.ai.generativelanguage.v1beta3.TextCompletion + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.ai.generativelanguage.v1beta3.TextCompletion} TextCompletion + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TextCompletion.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a TextCompletion message. + * @function verify + * @memberof google.ai.generativelanguage.v1beta3.TextCompletion + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + TextCompletion.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.output != null && message.hasOwnProperty("output")) + if (!$util.isString(message.output)) + return "output: string expected"; + if (message.safetyRatings != null && message.hasOwnProperty("safetyRatings")) { + if (!Array.isArray(message.safetyRatings)) + return "safetyRatings: array expected"; + for (var i = 0; i < message.safetyRatings.length; ++i) { + var error = $root.google.ai.generativelanguage.v1beta3.SafetyRating.verify(message.safetyRatings[i]); + if (error) + return "safetyRatings." + error; + } + } + if (message.citationMetadata != null && message.hasOwnProperty("citationMetadata")) { + properties._citationMetadata = 1; + { + var error = $root.google.ai.generativelanguage.v1beta3.CitationMetadata.verify(message.citationMetadata); + if (error) + return "citationMetadata." + error; + } + } + return null; + }; + + /** + * Creates a TextCompletion message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.ai.generativelanguage.v1beta3.TextCompletion + * @static + * @param {Object.} object Plain object + * @returns {google.ai.generativelanguage.v1beta3.TextCompletion} TextCompletion + */ + TextCompletion.fromObject = function fromObject(object) { + if (object instanceof $root.google.ai.generativelanguage.v1beta3.TextCompletion) + return object; + var message = new $root.google.ai.generativelanguage.v1beta3.TextCompletion(); + if (object.output != null) + message.output = String(object.output); + if (object.safetyRatings) { + if (!Array.isArray(object.safetyRatings)) + throw TypeError(".google.ai.generativelanguage.v1beta3.TextCompletion.safetyRatings: array expected"); + message.safetyRatings = []; + for (var i = 0; i < object.safetyRatings.length; ++i) { + if (typeof object.safetyRatings[i] !== "object") + throw TypeError(".google.ai.generativelanguage.v1beta3.TextCompletion.safetyRatings: object expected"); + message.safetyRatings[i] = $root.google.ai.generativelanguage.v1beta3.SafetyRating.fromObject(object.safetyRatings[i]); + } + } + if (object.citationMetadata != null) { + if (typeof object.citationMetadata !== "object") + throw TypeError(".google.ai.generativelanguage.v1beta3.TextCompletion.citationMetadata: object expected"); + message.citationMetadata = $root.google.ai.generativelanguage.v1beta3.CitationMetadata.fromObject(object.citationMetadata); + } + return message; + }; + + /** + * Creates a plain object from a TextCompletion message. Also converts values to other types if specified. + * @function toObject + * @memberof google.ai.generativelanguage.v1beta3.TextCompletion + * @static + * @param {google.ai.generativelanguage.v1beta3.TextCompletion} message TextCompletion + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + TextCompletion.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.safetyRatings = []; + if (options.defaults) + object.output = ""; + if (message.output != null && message.hasOwnProperty("output")) + object.output = message.output; + if (message.safetyRatings && message.safetyRatings.length) { + object.safetyRatings = []; + for (var j = 0; j < message.safetyRatings.length; ++j) + object.safetyRatings[j] = $root.google.ai.generativelanguage.v1beta3.SafetyRating.toObject(message.safetyRatings[j], options); + } + if (message.citationMetadata != null && message.hasOwnProperty("citationMetadata")) { + object.citationMetadata = $root.google.ai.generativelanguage.v1beta3.CitationMetadata.toObject(message.citationMetadata, options); + if (options.oneofs) + object._citationMetadata = "citationMetadata"; + } + return object; + }; + + /** + * Converts this TextCompletion to JSON. + * @function toJSON + * @memberof google.ai.generativelanguage.v1beta3.TextCompletion + * @instance + * @returns {Object.} JSON object + */ + TextCompletion.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for TextCompletion + * @function getTypeUrl + * @memberof google.ai.generativelanguage.v1beta3.TextCompletion + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TextCompletion.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.ai.generativelanguage.v1beta3.TextCompletion"; + }; + + return TextCompletion; + })(); + + v1beta3.EmbedTextRequest = (function() { + + /** + * Properties of an EmbedTextRequest. + * @memberof google.ai.generativelanguage.v1beta3 + * @interface IEmbedTextRequest + * @property {string|null} [model] EmbedTextRequest model + * @property {string|null} [text] EmbedTextRequest text + */ + + /** + * Constructs a new EmbedTextRequest. + * @memberof google.ai.generativelanguage.v1beta3 + * @classdesc Represents an EmbedTextRequest. + * @implements IEmbedTextRequest + * @constructor + * @param {google.ai.generativelanguage.v1beta3.IEmbedTextRequest=} [properties] Properties to set + */ + function EmbedTextRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * EmbedTextRequest model. + * @member {string} model + * @memberof google.ai.generativelanguage.v1beta3.EmbedTextRequest + * @instance + */ + EmbedTextRequest.prototype.model = ""; + + /** + * EmbedTextRequest text. + * @member {string} text + * @memberof google.ai.generativelanguage.v1beta3.EmbedTextRequest + * @instance + */ + EmbedTextRequest.prototype.text = ""; + + /** + * Creates a new EmbedTextRequest instance using the specified properties. + * @function create + * @memberof google.ai.generativelanguage.v1beta3.EmbedTextRequest + * @static + * @param {google.ai.generativelanguage.v1beta3.IEmbedTextRequest=} [properties] Properties to set + * @returns {google.ai.generativelanguage.v1beta3.EmbedTextRequest} EmbedTextRequest instance + */ + EmbedTextRequest.create = function create(properties) { + return new EmbedTextRequest(properties); + }; + + /** + * Encodes the specified EmbedTextRequest message. Does not implicitly {@link google.ai.generativelanguage.v1beta3.EmbedTextRequest.verify|verify} messages. + * @function encode + * @memberof google.ai.generativelanguage.v1beta3.EmbedTextRequest + * @static + * @param {google.ai.generativelanguage.v1beta3.IEmbedTextRequest} message EmbedTextRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EmbedTextRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.model != null && Object.hasOwnProperty.call(message, "model")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.model); + if (message.text != null && Object.hasOwnProperty.call(message, "text")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.text); + return writer; + }; + + /** + * Encodes the specified EmbedTextRequest message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1beta3.EmbedTextRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.ai.generativelanguage.v1beta3.EmbedTextRequest + * @static + * @param {google.ai.generativelanguage.v1beta3.IEmbedTextRequest} message EmbedTextRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EmbedTextRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an EmbedTextRequest message from the specified reader or buffer. + * @function decode + * @memberof google.ai.generativelanguage.v1beta3.EmbedTextRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.ai.generativelanguage.v1beta3.EmbedTextRequest} EmbedTextRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EmbedTextRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.ai.generativelanguage.v1beta3.EmbedTextRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.model = reader.string(); + break; + } + case 2: { + message.text = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an EmbedTextRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.ai.generativelanguage.v1beta3.EmbedTextRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.ai.generativelanguage.v1beta3.EmbedTextRequest} EmbedTextRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EmbedTextRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an EmbedTextRequest message. + * @function verify + * @memberof google.ai.generativelanguage.v1beta3.EmbedTextRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + EmbedTextRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.model != null && message.hasOwnProperty("model")) + if (!$util.isString(message.model)) + return "model: string expected"; + if (message.text != null && message.hasOwnProperty("text")) + if (!$util.isString(message.text)) + return "text: string expected"; + return null; + }; + + /** + * Creates an EmbedTextRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.ai.generativelanguage.v1beta3.EmbedTextRequest + * @static + * @param {Object.} object Plain object + * @returns {google.ai.generativelanguage.v1beta3.EmbedTextRequest} EmbedTextRequest + */ + EmbedTextRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.ai.generativelanguage.v1beta3.EmbedTextRequest) + return object; + var message = new $root.google.ai.generativelanguage.v1beta3.EmbedTextRequest(); + if (object.model != null) + message.model = String(object.model); + if (object.text != null) + message.text = String(object.text); + return message; + }; + + /** + * Creates a plain object from an EmbedTextRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.ai.generativelanguage.v1beta3.EmbedTextRequest + * @static + * @param {google.ai.generativelanguage.v1beta3.EmbedTextRequest} message EmbedTextRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + EmbedTextRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.model = ""; + object.text = ""; + } + if (message.model != null && message.hasOwnProperty("model")) + object.model = message.model; + if (message.text != null && message.hasOwnProperty("text")) + object.text = message.text; + return object; + }; + + /** + * Converts this EmbedTextRequest to JSON. + * @function toJSON + * @memberof google.ai.generativelanguage.v1beta3.EmbedTextRequest + * @instance + * @returns {Object.} JSON object + */ + EmbedTextRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for EmbedTextRequest + * @function getTypeUrl + * @memberof google.ai.generativelanguage.v1beta3.EmbedTextRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + EmbedTextRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.ai.generativelanguage.v1beta3.EmbedTextRequest"; + }; + + return EmbedTextRequest; + })(); + + v1beta3.EmbedTextResponse = (function() { + + /** + * Properties of an EmbedTextResponse. + * @memberof google.ai.generativelanguage.v1beta3 + * @interface IEmbedTextResponse + * @property {google.ai.generativelanguage.v1beta3.IEmbedding|null} [embedding] EmbedTextResponse embedding + */ + + /** + * Constructs a new EmbedTextResponse. + * @memberof google.ai.generativelanguage.v1beta3 + * @classdesc Represents an EmbedTextResponse. + * @implements IEmbedTextResponse + * @constructor + * @param {google.ai.generativelanguage.v1beta3.IEmbedTextResponse=} [properties] Properties to set + */ + function EmbedTextResponse(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * EmbedTextResponse embedding. + * @member {google.ai.generativelanguage.v1beta3.IEmbedding|null|undefined} embedding + * @memberof google.ai.generativelanguage.v1beta3.EmbedTextResponse + * @instance + */ + EmbedTextResponse.prototype.embedding = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * EmbedTextResponse _embedding. + * @member {"embedding"|undefined} _embedding + * @memberof google.ai.generativelanguage.v1beta3.EmbedTextResponse + * @instance + */ + Object.defineProperty(EmbedTextResponse.prototype, "_embedding", { + get: $util.oneOfGetter($oneOfFields = ["embedding"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new EmbedTextResponse instance using the specified properties. + * @function create + * @memberof google.ai.generativelanguage.v1beta3.EmbedTextResponse + * @static + * @param {google.ai.generativelanguage.v1beta3.IEmbedTextResponse=} [properties] Properties to set + * @returns {google.ai.generativelanguage.v1beta3.EmbedTextResponse} EmbedTextResponse instance + */ + EmbedTextResponse.create = function create(properties) { + return new EmbedTextResponse(properties); + }; + + /** + * Encodes the specified EmbedTextResponse message. Does not implicitly {@link google.ai.generativelanguage.v1beta3.EmbedTextResponse.verify|verify} messages. + * @function encode + * @memberof google.ai.generativelanguage.v1beta3.EmbedTextResponse + * @static + * @param {google.ai.generativelanguage.v1beta3.IEmbedTextResponse} message EmbedTextResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EmbedTextResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.embedding != null && Object.hasOwnProperty.call(message, "embedding")) + $root.google.ai.generativelanguage.v1beta3.Embedding.encode(message.embedding, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified EmbedTextResponse message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1beta3.EmbedTextResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.ai.generativelanguage.v1beta3.EmbedTextResponse + * @static + * @param {google.ai.generativelanguage.v1beta3.IEmbedTextResponse} message EmbedTextResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EmbedTextResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an EmbedTextResponse message from the specified reader or buffer. + * @function decode + * @memberof google.ai.generativelanguage.v1beta3.EmbedTextResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.ai.generativelanguage.v1beta3.EmbedTextResponse} EmbedTextResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EmbedTextResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.ai.generativelanguage.v1beta3.EmbedTextResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.embedding = $root.google.ai.generativelanguage.v1beta3.Embedding.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an EmbedTextResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.ai.generativelanguage.v1beta3.EmbedTextResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.ai.generativelanguage.v1beta3.EmbedTextResponse} EmbedTextResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EmbedTextResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an EmbedTextResponse message. + * @function verify + * @memberof google.ai.generativelanguage.v1beta3.EmbedTextResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + EmbedTextResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.embedding != null && message.hasOwnProperty("embedding")) { + properties._embedding = 1; + { + var error = $root.google.ai.generativelanguage.v1beta3.Embedding.verify(message.embedding); + if (error) + return "embedding." + error; + } + } + return null; + }; + + /** + * Creates an EmbedTextResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.ai.generativelanguage.v1beta3.EmbedTextResponse + * @static + * @param {Object.} object Plain object + * @returns {google.ai.generativelanguage.v1beta3.EmbedTextResponse} EmbedTextResponse + */ + EmbedTextResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.ai.generativelanguage.v1beta3.EmbedTextResponse) + return object; + var message = new $root.google.ai.generativelanguage.v1beta3.EmbedTextResponse(); + if (object.embedding != null) { + if (typeof object.embedding !== "object") + throw TypeError(".google.ai.generativelanguage.v1beta3.EmbedTextResponse.embedding: object expected"); + message.embedding = $root.google.ai.generativelanguage.v1beta3.Embedding.fromObject(object.embedding); + } + return message; + }; + + /** + * Creates a plain object from an EmbedTextResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.ai.generativelanguage.v1beta3.EmbedTextResponse + * @static + * @param {google.ai.generativelanguage.v1beta3.EmbedTextResponse} message EmbedTextResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + EmbedTextResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.embedding != null && message.hasOwnProperty("embedding")) { + object.embedding = $root.google.ai.generativelanguage.v1beta3.Embedding.toObject(message.embedding, options); + if (options.oneofs) + object._embedding = "embedding"; + } + return object; + }; + + /** + * Converts this EmbedTextResponse to JSON. + * @function toJSON + * @memberof google.ai.generativelanguage.v1beta3.EmbedTextResponse + * @instance + * @returns {Object.} JSON object + */ + EmbedTextResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for EmbedTextResponse + * @function getTypeUrl + * @memberof google.ai.generativelanguage.v1beta3.EmbedTextResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + EmbedTextResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.ai.generativelanguage.v1beta3.EmbedTextResponse"; + }; + + return EmbedTextResponse; + })(); + + v1beta3.BatchEmbedTextRequest = (function() { + + /** + * Properties of a BatchEmbedTextRequest. + * @memberof google.ai.generativelanguage.v1beta3 + * @interface IBatchEmbedTextRequest + * @property {string|null} [model] BatchEmbedTextRequest model + * @property {Array.|null} [texts] BatchEmbedTextRequest texts + */ + + /** + * Constructs a new BatchEmbedTextRequest. + * @memberof google.ai.generativelanguage.v1beta3 + * @classdesc Represents a BatchEmbedTextRequest. + * @implements IBatchEmbedTextRequest + * @constructor + * @param {google.ai.generativelanguage.v1beta3.IBatchEmbedTextRequest=} [properties] Properties to set + */ + function BatchEmbedTextRequest(properties) { + this.texts = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * BatchEmbedTextRequest model. + * @member {string} model + * @memberof google.ai.generativelanguage.v1beta3.BatchEmbedTextRequest + * @instance + */ + BatchEmbedTextRequest.prototype.model = ""; + + /** + * BatchEmbedTextRequest texts. + * @member {Array.} texts + * @memberof google.ai.generativelanguage.v1beta3.BatchEmbedTextRequest + * @instance + */ + BatchEmbedTextRequest.prototype.texts = $util.emptyArray; + + /** + * Creates a new BatchEmbedTextRequest instance using the specified properties. + * @function create + * @memberof google.ai.generativelanguage.v1beta3.BatchEmbedTextRequest + * @static + * @param {google.ai.generativelanguage.v1beta3.IBatchEmbedTextRequest=} [properties] Properties to set + * @returns {google.ai.generativelanguage.v1beta3.BatchEmbedTextRequest} BatchEmbedTextRequest instance + */ + BatchEmbedTextRequest.create = function create(properties) { + return new BatchEmbedTextRequest(properties); + }; + + /** + * Encodes the specified BatchEmbedTextRequest message. Does not implicitly {@link google.ai.generativelanguage.v1beta3.BatchEmbedTextRequest.verify|verify} messages. + * @function encode + * @memberof google.ai.generativelanguage.v1beta3.BatchEmbedTextRequest + * @static + * @param {google.ai.generativelanguage.v1beta3.IBatchEmbedTextRequest} message BatchEmbedTextRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BatchEmbedTextRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.model != null && Object.hasOwnProperty.call(message, "model")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.model); + if (message.texts != null && message.texts.length) + for (var i = 0; i < message.texts.length; ++i) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.texts[i]); + return writer; + }; + + /** + * Encodes the specified BatchEmbedTextRequest message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1beta3.BatchEmbedTextRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.ai.generativelanguage.v1beta3.BatchEmbedTextRequest + * @static + * @param {google.ai.generativelanguage.v1beta3.IBatchEmbedTextRequest} message BatchEmbedTextRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BatchEmbedTextRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a BatchEmbedTextRequest message from the specified reader or buffer. + * @function decode + * @memberof google.ai.generativelanguage.v1beta3.BatchEmbedTextRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.ai.generativelanguage.v1beta3.BatchEmbedTextRequest} BatchEmbedTextRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BatchEmbedTextRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.ai.generativelanguage.v1beta3.BatchEmbedTextRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.model = reader.string(); + break; + } + case 2: { + if (!(message.texts && message.texts.length)) + message.texts = []; + message.texts.push(reader.string()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a BatchEmbedTextRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.ai.generativelanguage.v1beta3.BatchEmbedTextRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.ai.generativelanguage.v1beta3.BatchEmbedTextRequest} BatchEmbedTextRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BatchEmbedTextRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a BatchEmbedTextRequest message. + * @function verify + * @memberof google.ai.generativelanguage.v1beta3.BatchEmbedTextRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + BatchEmbedTextRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.model != null && message.hasOwnProperty("model")) + if (!$util.isString(message.model)) + return "model: string expected"; + if (message.texts != null && message.hasOwnProperty("texts")) { + if (!Array.isArray(message.texts)) + return "texts: array expected"; + for (var i = 0; i < message.texts.length; ++i) + if (!$util.isString(message.texts[i])) + return "texts: string[] expected"; + } + return null; + }; + + /** + * Creates a BatchEmbedTextRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.ai.generativelanguage.v1beta3.BatchEmbedTextRequest + * @static + * @param {Object.} object Plain object + * @returns {google.ai.generativelanguage.v1beta3.BatchEmbedTextRequest} BatchEmbedTextRequest + */ + BatchEmbedTextRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.ai.generativelanguage.v1beta3.BatchEmbedTextRequest) + return object; + var message = new $root.google.ai.generativelanguage.v1beta3.BatchEmbedTextRequest(); + if (object.model != null) + message.model = String(object.model); + if (object.texts) { + if (!Array.isArray(object.texts)) + throw TypeError(".google.ai.generativelanguage.v1beta3.BatchEmbedTextRequest.texts: array expected"); + message.texts = []; + for (var i = 0; i < object.texts.length; ++i) + message.texts[i] = String(object.texts[i]); + } + return message; + }; + + /** + * Creates a plain object from a BatchEmbedTextRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.ai.generativelanguage.v1beta3.BatchEmbedTextRequest + * @static + * @param {google.ai.generativelanguage.v1beta3.BatchEmbedTextRequest} message BatchEmbedTextRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + BatchEmbedTextRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.texts = []; + if (options.defaults) + object.model = ""; + if (message.model != null && message.hasOwnProperty("model")) + object.model = message.model; + if (message.texts && message.texts.length) { + object.texts = []; + for (var j = 0; j < message.texts.length; ++j) + object.texts[j] = message.texts[j]; + } + return object; + }; + + /** + * Converts this BatchEmbedTextRequest to JSON. + * @function toJSON + * @memberof google.ai.generativelanguage.v1beta3.BatchEmbedTextRequest + * @instance + * @returns {Object.} JSON object + */ + BatchEmbedTextRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for BatchEmbedTextRequest + * @function getTypeUrl + * @memberof google.ai.generativelanguage.v1beta3.BatchEmbedTextRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + BatchEmbedTextRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.ai.generativelanguage.v1beta3.BatchEmbedTextRequest"; + }; + + return BatchEmbedTextRequest; + })(); + + v1beta3.BatchEmbedTextResponse = (function() { + + /** + * Properties of a BatchEmbedTextResponse. + * @memberof google.ai.generativelanguage.v1beta3 + * @interface IBatchEmbedTextResponse + * @property {Array.|null} [embeddings] BatchEmbedTextResponse embeddings + */ + + /** + * Constructs a new BatchEmbedTextResponse. + * @memberof google.ai.generativelanguage.v1beta3 + * @classdesc Represents a BatchEmbedTextResponse. + * @implements IBatchEmbedTextResponse + * @constructor + * @param {google.ai.generativelanguage.v1beta3.IBatchEmbedTextResponse=} [properties] Properties to set + */ + function BatchEmbedTextResponse(properties) { + this.embeddings = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * BatchEmbedTextResponse embeddings. + * @member {Array.} embeddings + * @memberof google.ai.generativelanguage.v1beta3.BatchEmbedTextResponse + * @instance + */ + BatchEmbedTextResponse.prototype.embeddings = $util.emptyArray; + + /** + * Creates a new BatchEmbedTextResponse instance using the specified properties. + * @function create + * @memberof google.ai.generativelanguage.v1beta3.BatchEmbedTextResponse + * @static + * @param {google.ai.generativelanguage.v1beta3.IBatchEmbedTextResponse=} [properties] Properties to set + * @returns {google.ai.generativelanguage.v1beta3.BatchEmbedTextResponse} BatchEmbedTextResponse instance + */ + BatchEmbedTextResponse.create = function create(properties) { + return new BatchEmbedTextResponse(properties); + }; + + /** + * Encodes the specified BatchEmbedTextResponse message. Does not implicitly {@link google.ai.generativelanguage.v1beta3.BatchEmbedTextResponse.verify|verify} messages. + * @function encode + * @memberof google.ai.generativelanguage.v1beta3.BatchEmbedTextResponse + * @static + * @param {google.ai.generativelanguage.v1beta3.IBatchEmbedTextResponse} message BatchEmbedTextResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BatchEmbedTextResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.embeddings != null && message.embeddings.length) + for (var i = 0; i < message.embeddings.length; ++i) + $root.google.ai.generativelanguage.v1beta3.Embedding.encode(message.embeddings[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified BatchEmbedTextResponse message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1beta3.BatchEmbedTextResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.ai.generativelanguage.v1beta3.BatchEmbedTextResponse + * @static + * @param {google.ai.generativelanguage.v1beta3.IBatchEmbedTextResponse} message BatchEmbedTextResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BatchEmbedTextResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a BatchEmbedTextResponse message from the specified reader or buffer. + * @function decode + * @memberof google.ai.generativelanguage.v1beta3.BatchEmbedTextResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.ai.generativelanguage.v1beta3.BatchEmbedTextResponse} BatchEmbedTextResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BatchEmbedTextResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.ai.generativelanguage.v1beta3.BatchEmbedTextResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.embeddings && message.embeddings.length)) + message.embeddings = []; + message.embeddings.push($root.google.ai.generativelanguage.v1beta3.Embedding.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a BatchEmbedTextResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.ai.generativelanguage.v1beta3.BatchEmbedTextResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.ai.generativelanguage.v1beta3.BatchEmbedTextResponse} BatchEmbedTextResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BatchEmbedTextResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a BatchEmbedTextResponse message. + * @function verify + * @memberof google.ai.generativelanguage.v1beta3.BatchEmbedTextResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + BatchEmbedTextResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.embeddings != null && message.hasOwnProperty("embeddings")) { + if (!Array.isArray(message.embeddings)) + return "embeddings: array expected"; + for (var i = 0; i < message.embeddings.length; ++i) { + var error = $root.google.ai.generativelanguage.v1beta3.Embedding.verify(message.embeddings[i]); + if (error) + return "embeddings." + error; + } + } + return null; + }; + + /** + * Creates a BatchEmbedTextResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.ai.generativelanguage.v1beta3.BatchEmbedTextResponse + * @static + * @param {Object.} object Plain object + * @returns {google.ai.generativelanguage.v1beta3.BatchEmbedTextResponse} BatchEmbedTextResponse + */ + BatchEmbedTextResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.ai.generativelanguage.v1beta3.BatchEmbedTextResponse) + return object; + var message = new $root.google.ai.generativelanguage.v1beta3.BatchEmbedTextResponse(); + if (object.embeddings) { + if (!Array.isArray(object.embeddings)) + throw TypeError(".google.ai.generativelanguage.v1beta3.BatchEmbedTextResponse.embeddings: array expected"); + message.embeddings = []; + for (var i = 0; i < object.embeddings.length; ++i) { + if (typeof object.embeddings[i] !== "object") + throw TypeError(".google.ai.generativelanguage.v1beta3.BatchEmbedTextResponse.embeddings: object expected"); + message.embeddings[i] = $root.google.ai.generativelanguage.v1beta3.Embedding.fromObject(object.embeddings[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a BatchEmbedTextResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.ai.generativelanguage.v1beta3.BatchEmbedTextResponse + * @static + * @param {google.ai.generativelanguage.v1beta3.BatchEmbedTextResponse} message BatchEmbedTextResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + BatchEmbedTextResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.embeddings = []; + if (message.embeddings && message.embeddings.length) { + object.embeddings = []; + for (var j = 0; j < message.embeddings.length; ++j) + object.embeddings[j] = $root.google.ai.generativelanguage.v1beta3.Embedding.toObject(message.embeddings[j], options); + } + return object; + }; + + /** + * Converts this BatchEmbedTextResponse to JSON. + * @function toJSON + * @memberof google.ai.generativelanguage.v1beta3.BatchEmbedTextResponse + * @instance + * @returns {Object.} JSON object + */ + BatchEmbedTextResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for BatchEmbedTextResponse + * @function getTypeUrl + * @memberof google.ai.generativelanguage.v1beta3.BatchEmbedTextResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + BatchEmbedTextResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.ai.generativelanguage.v1beta3.BatchEmbedTextResponse"; + }; + + return BatchEmbedTextResponse; + })(); + + v1beta3.Embedding = (function() { + + /** + * Properties of an Embedding. + * @memberof google.ai.generativelanguage.v1beta3 + * @interface IEmbedding + * @property {Array.|null} [value] Embedding value + */ + + /** + * Constructs a new Embedding. + * @memberof google.ai.generativelanguage.v1beta3 + * @classdesc Represents an Embedding. + * @implements IEmbedding + * @constructor + * @param {google.ai.generativelanguage.v1beta3.IEmbedding=} [properties] Properties to set + */ + function Embedding(properties) { + this.value = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Embedding value. + * @member {Array.} value + * @memberof google.ai.generativelanguage.v1beta3.Embedding + * @instance + */ + Embedding.prototype.value = $util.emptyArray; + + /** + * Creates a new Embedding instance using the specified properties. + * @function create + * @memberof google.ai.generativelanguage.v1beta3.Embedding + * @static + * @param {google.ai.generativelanguage.v1beta3.IEmbedding=} [properties] Properties to set + * @returns {google.ai.generativelanguage.v1beta3.Embedding} Embedding instance + */ + Embedding.create = function create(properties) { + return new Embedding(properties); + }; + + /** + * Encodes the specified Embedding message. Does not implicitly {@link google.ai.generativelanguage.v1beta3.Embedding.verify|verify} messages. + * @function encode + * @memberof google.ai.generativelanguage.v1beta3.Embedding + * @static + * @param {google.ai.generativelanguage.v1beta3.IEmbedding} message Embedding message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Embedding.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.value != null && message.value.length) { + writer.uint32(/* id 1, wireType 2 =*/10).fork(); + for (var i = 0; i < message.value.length; ++i) + writer.float(message.value[i]); + writer.ldelim(); + } + return writer; + }; + + /** + * Encodes the specified Embedding message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1beta3.Embedding.verify|verify} messages. + * @function encodeDelimited + * @memberof google.ai.generativelanguage.v1beta3.Embedding + * @static + * @param {google.ai.generativelanguage.v1beta3.IEmbedding} message Embedding message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Embedding.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an Embedding message from the specified reader or buffer. + * @function decode + * @memberof google.ai.generativelanguage.v1beta3.Embedding + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.ai.generativelanguage.v1beta3.Embedding} Embedding + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Embedding.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.ai.generativelanguage.v1beta3.Embedding(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.value && message.value.length)) + message.value = []; + if ((tag & 7) === 2) { + var end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) + message.value.push(reader.float()); + } else + message.value.push(reader.float()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an Embedding message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.ai.generativelanguage.v1beta3.Embedding + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.ai.generativelanguage.v1beta3.Embedding} Embedding + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Embedding.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an Embedding message. + * @function verify + * @memberof google.ai.generativelanguage.v1beta3.Embedding + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Embedding.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object 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) + if (typeof message.value[i] !== "number") + return "value: number[] expected"; + } + return null; + }; + + /** + * Creates an Embedding message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.ai.generativelanguage.v1beta3.Embedding + * @static + * @param {Object.} object Plain object + * @returns {google.ai.generativelanguage.v1beta3.Embedding} Embedding + */ + Embedding.fromObject = function fromObject(object) { + if (object instanceof $root.google.ai.generativelanguage.v1beta3.Embedding) + return object; + var message = new $root.google.ai.generativelanguage.v1beta3.Embedding(); + if (object.value) { + if (!Array.isArray(object.value)) + throw TypeError(".google.ai.generativelanguage.v1beta3.Embedding.value: array expected"); + message.value = []; + for (var i = 0; i < object.value.length; ++i) + message.value[i] = Number(object.value[i]); + } + return message; + }; + + /** + * Creates a plain object from an Embedding message. Also converts values to other types if specified. + * @function toObject + * @memberof google.ai.generativelanguage.v1beta3.Embedding + * @static + * @param {google.ai.generativelanguage.v1beta3.Embedding} message Embedding + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Embedding.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.value = []; + if (message.value && message.value.length) { + object.value = []; + for (var j = 0; j < message.value.length; ++j) + object.value[j] = options.json && !isFinite(message.value[j]) ? String(message.value[j]) : message.value[j]; + } + return object; + }; + + /** + * Converts this Embedding to JSON. + * @function toJSON + * @memberof google.ai.generativelanguage.v1beta3.Embedding + * @instance + * @returns {Object.} JSON object + */ + Embedding.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Embedding + * @function getTypeUrl + * @memberof google.ai.generativelanguage.v1beta3.Embedding + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Embedding.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.ai.generativelanguage.v1beta3.Embedding"; + }; + + return Embedding; + })(); + + v1beta3.CountTextTokensRequest = (function() { + + /** + * Properties of a CountTextTokensRequest. + * @memberof google.ai.generativelanguage.v1beta3 + * @interface ICountTextTokensRequest + * @property {string|null} [model] CountTextTokensRequest model + * @property {google.ai.generativelanguage.v1beta3.ITextPrompt|null} [prompt] CountTextTokensRequest prompt + */ + + /** + * Constructs a new CountTextTokensRequest. + * @memberof google.ai.generativelanguage.v1beta3 + * @classdesc Represents a CountTextTokensRequest. + * @implements ICountTextTokensRequest + * @constructor + * @param {google.ai.generativelanguage.v1beta3.ICountTextTokensRequest=} [properties] Properties to set + */ + function CountTextTokensRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * CountTextTokensRequest model. + * @member {string} model + * @memberof google.ai.generativelanguage.v1beta3.CountTextTokensRequest + * @instance + */ + CountTextTokensRequest.prototype.model = ""; + + /** + * CountTextTokensRequest prompt. + * @member {google.ai.generativelanguage.v1beta3.ITextPrompt|null|undefined} prompt + * @memberof google.ai.generativelanguage.v1beta3.CountTextTokensRequest + * @instance + */ + CountTextTokensRequest.prototype.prompt = null; + + /** + * Creates a new CountTextTokensRequest instance using the specified properties. + * @function create + * @memberof google.ai.generativelanguage.v1beta3.CountTextTokensRequest + * @static + * @param {google.ai.generativelanguage.v1beta3.ICountTextTokensRequest=} [properties] Properties to set + * @returns {google.ai.generativelanguage.v1beta3.CountTextTokensRequest} CountTextTokensRequest instance + */ + CountTextTokensRequest.create = function create(properties) { + return new CountTextTokensRequest(properties); + }; + + /** + * Encodes the specified CountTextTokensRequest message. Does not implicitly {@link google.ai.generativelanguage.v1beta3.CountTextTokensRequest.verify|verify} messages. + * @function encode + * @memberof google.ai.generativelanguage.v1beta3.CountTextTokensRequest + * @static + * @param {google.ai.generativelanguage.v1beta3.ICountTextTokensRequest} message CountTextTokensRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CountTextTokensRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.model != null && Object.hasOwnProperty.call(message, "model")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.model); + if (message.prompt != null && Object.hasOwnProperty.call(message, "prompt")) + $root.google.ai.generativelanguage.v1beta3.TextPrompt.encode(message.prompt, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified CountTextTokensRequest message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1beta3.CountTextTokensRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.ai.generativelanguage.v1beta3.CountTextTokensRequest + * @static + * @param {google.ai.generativelanguage.v1beta3.ICountTextTokensRequest} message CountTextTokensRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CountTextTokensRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CountTextTokensRequest message from the specified reader or buffer. + * @function decode + * @memberof google.ai.generativelanguage.v1beta3.CountTextTokensRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.ai.generativelanguage.v1beta3.CountTextTokensRequest} CountTextTokensRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CountTextTokensRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.ai.generativelanguage.v1beta3.CountTextTokensRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.model = reader.string(); + break; + } + case 2: { + message.prompt = $root.google.ai.generativelanguage.v1beta3.TextPrompt.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CountTextTokensRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.ai.generativelanguage.v1beta3.CountTextTokensRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.ai.generativelanguage.v1beta3.CountTextTokensRequest} CountTextTokensRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CountTextTokensRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CountTextTokensRequest message. + * @function verify + * @memberof google.ai.generativelanguage.v1beta3.CountTextTokensRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CountTextTokensRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.model != null && message.hasOwnProperty("model")) + if (!$util.isString(message.model)) + return "model: string expected"; + if (message.prompt != null && message.hasOwnProperty("prompt")) { + var error = $root.google.ai.generativelanguage.v1beta3.TextPrompt.verify(message.prompt); + if (error) + return "prompt." + error; + } + return null; + }; + + /** + * Creates a CountTextTokensRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.ai.generativelanguage.v1beta3.CountTextTokensRequest + * @static + * @param {Object.} object Plain object + * @returns {google.ai.generativelanguage.v1beta3.CountTextTokensRequest} CountTextTokensRequest + */ + CountTextTokensRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.ai.generativelanguage.v1beta3.CountTextTokensRequest) + return object; + var message = new $root.google.ai.generativelanguage.v1beta3.CountTextTokensRequest(); + if (object.model != null) + message.model = String(object.model); + if (object.prompt != null) { + if (typeof object.prompt !== "object") + throw TypeError(".google.ai.generativelanguage.v1beta3.CountTextTokensRequest.prompt: object expected"); + message.prompt = $root.google.ai.generativelanguage.v1beta3.TextPrompt.fromObject(object.prompt); + } + return message; + }; + + /** + * Creates a plain object from a CountTextTokensRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.ai.generativelanguage.v1beta3.CountTextTokensRequest + * @static + * @param {google.ai.generativelanguage.v1beta3.CountTextTokensRequest} message CountTextTokensRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CountTextTokensRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.model = ""; + object.prompt = null; + } + if (message.model != null && message.hasOwnProperty("model")) + object.model = message.model; + if (message.prompt != null && message.hasOwnProperty("prompt")) + object.prompt = $root.google.ai.generativelanguage.v1beta3.TextPrompt.toObject(message.prompt, options); + return object; + }; + + /** + * Converts this CountTextTokensRequest to JSON. + * @function toJSON + * @memberof google.ai.generativelanguage.v1beta3.CountTextTokensRequest + * @instance + * @returns {Object.} JSON object + */ + CountTextTokensRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CountTextTokensRequest + * @function getTypeUrl + * @memberof google.ai.generativelanguage.v1beta3.CountTextTokensRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CountTextTokensRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.ai.generativelanguage.v1beta3.CountTextTokensRequest"; + }; + + return CountTextTokensRequest; + })(); + + v1beta3.CountTextTokensResponse = (function() { + + /** + * Properties of a CountTextTokensResponse. + * @memberof google.ai.generativelanguage.v1beta3 + * @interface ICountTextTokensResponse + * @property {number|null} [tokenCount] CountTextTokensResponse tokenCount + */ + + /** + * Constructs a new CountTextTokensResponse. + * @memberof google.ai.generativelanguage.v1beta3 + * @classdesc Represents a CountTextTokensResponse. + * @implements ICountTextTokensResponse + * @constructor + * @param {google.ai.generativelanguage.v1beta3.ICountTextTokensResponse=} [properties] Properties to set + */ + function CountTextTokensResponse(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * CountTextTokensResponse tokenCount. + * @member {number} tokenCount + * @memberof google.ai.generativelanguage.v1beta3.CountTextTokensResponse + * @instance + */ + CountTextTokensResponse.prototype.tokenCount = 0; + + /** + * Creates a new CountTextTokensResponse instance using the specified properties. + * @function create + * @memberof google.ai.generativelanguage.v1beta3.CountTextTokensResponse + * @static + * @param {google.ai.generativelanguage.v1beta3.ICountTextTokensResponse=} [properties] Properties to set + * @returns {google.ai.generativelanguage.v1beta3.CountTextTokensResponse} CountTextTokensResponse instance + */ + CountTextTokensResponse.create = function create(properties) { + return new CountTextTokensResponse(properties); + }; + + /** + * Encodes the specified CountTextTokensResponse message. Does not implicitly {@link google.ai.generativelanguage.v1beta3.CountTextTokensResponse.verify|verify} messages. + * @function encode + * @memberof google.ai.generativelanguage.v1beta3.CountTextTokensResponse + * @static + * @param {google.ai.generativelanguage.v1beta3.ICountTextTokensResponse} message CountTextTokensResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CountTextTokensResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.tokenCount != null && Object.hasOwnProperty.call(message, "tokenCount")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.tokenCount); + return writer; + }; + + /** + * Encodes the specified CountTextTokensResponse message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1beta3.CountTextTokensResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.ai.generativelanguage.v1beta3.CountTextTokensResponse + * @static + * @param {google.ai.generativelanguage.v1beta3.ICountTextTokensResponse} message CountTextTokensResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CountTextTokensResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CountTextTokensResponse message from the specified reader or buffer. + * @function decode + * @memberof google.ai.generativelanguage.v1beta3.CountTextTokensResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.ai.generativelanguage.v1beta3.CountTextTokensResponse} CountTextTokensResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CountTextTokensResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.ai.generativelanguage.v1beta3.CountTextTokensResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.tokenCount = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CountTextTokensResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.ai.generativelanguage.v1beta3.CountTextTokensResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.ai.generativelanguage.v1beta3.CountTextTokensResponse} CountTextTokensResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CountTextTokensResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CountTextTokensResponse message. + * @function verify + * @memberof google.ai.generativelanguage.v1beta3.CountTextTokensResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CountTextTokensResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.tokenCount != null && message.hasOwnProperty("tokenCount")) + if (!$util.isInteger(message.tokenCount)) + return "tokenCount: integer expected"; + return null; + }; + + /** + * Creates a CountTextTokensResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.ai.generativelanguage.v1beta3.CountTextTokensResponse + * @static + * @param {Object.} object Plain object + * @returns {google.ai.generativelanguage.v1beta3.CountTextTokensResponse} CountTextTokensResponse + */ + CountTextTokensResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.ai.generativelanguage.v1beta3.CountTextTokensResponse) + return object; + var message = new $root.google.ai.generativelanguage.v1beta3.CountTextTokensResponse(); + if (object.tokenCount != null) + message.tokenCount = object.tokenCount | 0; + return message; + }; + + /** + * Creates a plain object from a CountTextTokensResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.ai.generativelanguage.v1beta3.CountTextTokensResponse + * @static + * @param {google.ai.generativelanguage.v1beta3.CountTextTokensResponse} message CountTextTokensResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CountTextTokensResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.tokenCount = 0; + if (message.tokenCount != null && message.hasOwnProperty("tokenCount")) + object.tokenCount = message.tokenCount; + return object; + }; + + /** + * Converts this CountTextTokensResponse to JSON. + * @function toJSON + * @memberof google.ai.generativelanguage.v1beta3.CountTextTokensResponse + * @instance + * @returns {Object.} JSON object + */ + CountTextTokensResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CountTextTokensResponse + * @function getTypeUrl + * @memberof google.ai.generativelanguage.v1beta3.CountTextTokensResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CountTextTokensResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.ai.generativelanguage.v1beta3.CountTextTokensResponse"; + }; + + return CountTextTokensResponse; + })(); + + return v1beta3; + })(); + + return generativelanguage; + })(); + + return ai; + })(); + + google.api = (function() { + + /** + * Namespace api. + * @memberof google + * @namespace + */ + var api = {}; + + /** + * 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 + */ + 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; + return values; + })(); + + 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) { + 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(); + 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) { + 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(); + 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) { + 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(); + 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) { + 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(); + 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) { + 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(); + 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 + */ + + /** + * 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; + + /** + * 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(); + 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) { + 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(); + 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; + } + 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: + 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; + } + } + 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; + } + 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]); + } + } + 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; + } + 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); + } + 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) { + 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(); + 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) { + 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(); + 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) { + 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(); + 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) { + 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(); + 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) { + 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(); + 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 + */ + + /** + * 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) { + if (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; + + /** + * 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(); + 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) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.DotnetSettings(); + while (reader.pos < end) { + var tag = reader.uint32(); + 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 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; + } + 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); + } + 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.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 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) { + 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(); + 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) { + 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(); + 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 + */ + + /** + * 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) { + if (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; + + /** + * 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(); + 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) { + 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(); + switch (tag >>> 3) { + case 1: { + message.selector = reader.string(); + break; + } + case 2: { + message.longRunning = $root.google.api.MethodSettings.LongRunning.decode(reader, reader.uint32()); + 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; + } + 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); + } + 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.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); + 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) { + 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(); + 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 + */ + 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; + 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; + })(); + + 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) { + 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(); + 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) { + 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(); + 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) { + 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(); + 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; + })(); + + 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 {string|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 {string} edition + * @memberof google.protobuf.FileDescriptorProto + * @instance + */ + FileDescriptorProto.prototype.edition = ""; + + /** + * 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 13, wireType 2 =*/106).string(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) { + 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(); + 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 13: { + message.edition = reader.string(); + 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")) + if (!$util.isString(message.edition)) + return "edition: string expected"; + 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); + if (object.edition != null) + message.edition = String(object.edition); + 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 = ""; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; 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"; + 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 = 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) { + 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(); + 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) { + 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(); + 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) { + 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(); + 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 + */ + + /** + * 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 = []; + if (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; + + /** + * 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.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) { + 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(); + 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; + } + default: + reader.skipType(tag & 7); + break; + } } - 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"; + 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.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"; + 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]); + } + } + 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.uninterpretedOption = []; + 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"; + }; + + 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) { + 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(); + 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; + } } - 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; + 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 2: + case 3: + 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.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.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_REQUIRED": + case 2: + message.label = 2; + break; + case "LABEL_REPEATED": + case 3: + message.label = 3; + break; } - 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; + 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"; } - 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; + 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_REQUIRED=2 LABEL_REQUIRED value + * @property {number} LABEL_REPEATED=3 LABEL_REPEATED value + */ + FieldDescriptorProto.Label = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[1] = "LABEL_OPTIONAL"] = 1; + values[valuesById[2] = "LABEL_REQUIRED"] = 2; + values[valuesById[3] = "LABEL_REPEATED"] = 3; + 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) { + 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(); + 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.FileOptions.verify(message.options); + var error = $root.google.protobuf.OneofOptions.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")) - if (!$util.isString(message.edition)) - return "edition: string expected"; return null; }; /** - * Creates a FileDescriptorProto message from a plain object. Also converts values to their respective internal types. + * Creates an OneofDescriptorProto message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.protobuf.FileDescriptorProto + * @memberof google.protobuf.OneofDescriptorProto * @static * @param {Object.} object Plain object - * @returns {google.protobuf.FileDescriptorProto} FileDescriptorProto + * @returns {google.protobuf.OneofDescriptorProto} OneofDescriptorProto */ - FileDescriptorProto.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.FileDescriptorProto) + OneofDescriptorProto.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.OneofDescriptorProto) return object; - var message = new $root.google.protobuf.FileDescriptorProto(); + var message = new $root.google.protobuf.OneofDescriptorProto(); 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); + throw TypeError(".google.protobuf.OneofDescriptorProto.options: object expected"); + message.options = $root.google.protobuf.OneofOptions.fromObject(object.options); } - if (object.syntax != null) - message.syntax = String(object.syntax); - if (object.edition != null) - message.edition = String(object.edition); return message; }; /** - * Creates a plain object from a FileDescriptorProto message. Also converts values to other types if specified. + * Creates a plain object from an OneofDescriptorProto message. Also converts values to other types if specified. * @function toObject - * @memberof google.protobuf.FileDescriptorProto + * @memberof google.protobuf.OneofDescriptorProto * @static - * @param {google.protobuf.FileDescriptorProto} message FileDescriptorProto + * @param {google.protobuf.OneofDescriptorProto} message OneofDescriptorProto * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - FileDescriptorProto.toObject = function toObject(message, options) { + OneofDescriptorProto.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 = ""; } 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 = message.edition; + object.options = $root.google.protobuf.OneofOptions.toObject(message.options, options); return object; }; /** - * Converts this FileDescriptorProto to JSON. + * Converts this OneofDescriptorProto to JSON. * @function toJSON - * @memberof google.protobuf.FileDescriptorProto + * @memberof google.protobuf.OneofDescriptorProto * @instance * @returns {Object.} JSON object */ - FileDescriptorProto.prototype.toJSON = function toJSON() { + OneofDescriptorProto.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for FileDescriptorProto + * Gets the default type url for OneofDescriptorProto * @function getTypeUrl - * @memberof google.protobuf.FileDescriptorProto + * @memberof google.protobuf.OneofDescriptorProto * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - FileDescriptorProto.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + OneofDescriptorProto.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.protobuf.FileDescriptorProto"; + return typeUrlPrefix + "/google.protobuf.OneofDescriptorProto"; }; - return FileDescriptorProto; + return OneofDescriptorProto; })(); - 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 + 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 */ - DescriptorProto.prototype.nestedType = $util.emptyArray; /** - * DescriptorProto enumType. - * @member {Array.} enumType - * @memberof google.protobuf.DescriptorProto - * @instance + * Constructs a new EnumDescriptorProto. + * @memberof google.protobuf + * @classdesc Represents an EnumDescriptorProto. + * @implements IEnumDescriptorProto + * @constructor + * @param {google.protobuf.IEnumDescriptorProto=} [properties] Properties to set */ - DescriptorProto.prototype.enumType = $util.emptyArray; + 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]]; + } /** - * DescriptorProto extensionRange. - * @member {Array.} extensionRange - * @memberof google.protobuf.DescriptorProto + * EnumDescriptorProto name. + * @member {string} name + * @memberof google.protobuf.EnumDescriptorProto * @instance */ - DescriptorProto.prototype.extensionRange = $util.emptyArray; + EnumDescriptorProto.prototype.name = ""; /** - * DescriptorProto oneofDecl. - * @member {Array.} oneofDecl - * @memberof google.protobuf.DescriptorProto + * EnumDescriptorProto value. + * @member {Array.} value + * @memberof google.protobuf.EnumDescriptorProto * @instance */ - DescriptorProto.prototype.oneofDecl = $util.emptyArray; + EnumDescriptorProto.prototype.value = $util.emptyArray; /** - * DescriptorProto options. - * @member {google.protobuf.IMessageOptions|null|undefined} options - * @memberof google.protobuf.DescriptorProto + * EnumDescriptorProto options. + * @member {google.protobuf.IEnumOptions|null|undefined} options + * @memberof google.protobuf.EnumDescriptorProto * @instance */ - DescriptorProto.prototype.options = null; + EnumDescriptorProto.prototype.options = null; /** - * DescriptorProto reservedRange. - * @member {Array.} reservedRange - * @memberof google.protobuf.DescriptorProto + * EnumDescriptorProto reservedRange. + * @member {Array.} reservedRange + * @memberof google.protobuf.EnumDescriptorProto * @instance */ - DescriptorProto.prototype.reservedRange = $util.emptyArray; + EnumDescriptorProto.prototype.reservedRange = $util.emptyArray; /** - * DescriptorProto reservedName. + * EnumDescriptorProto reservedName. * @member {Array.} reservedName - * @memberof google.protobuf.DescriptorProto + * @memberof google.protobuf.EnumDescriptorProto * @instance */ - DescriptorProto.prototype.reservedName = $util.emptyArray; + EnumDescriptorProto.prototype.reservedName = $util.emptyArray; /** - * Creates a new DescriptorProto instance using the specified properties. + * Creates a new EnumDescriptorProto instance using the specified properties. * @function create - * @memberof google.protobuf.DescriptorProto + * @memberof google.protobuf.EnumDescriptorProto * @static - * @param {google.protobuf.IDescriptorProto=} [properties] Properties to set - * @returns {google.protobuf.DescriptorProto} DescriptorProto instance + * @param {google.protobuf.IEnumDescriptorProto=} [properties] Properties to set + * @returns {google.protobuf.EnumDescriptorProto} EnumDescriptorProto instance */ - DescriptorProto.create = function create(properties) { - return new DescriptorProto(properties); + EnumDescriptorProto.create = function create(properties) { + return new EnumDescriptorProto(properties); }; /** - * Encodes the specified DescriptorProto message. Does not implicitly {@link google.protobuf.DescriptorProto.verify|verify} messages. + * Encodes the specified EnumDescriptorProto message. Does not implicitly {@link google.protobuf.EnumDescriptorProto.verify|verify} messages. * @function encode - * @memberof google.protobuf.DescriptorProto + * @memberof google.protobuf.EnumDescriptorProto * @static - * @param {google.protobuf.IDescriptorProto} message DescriptorProto message or plain object to encode + * @param {google.protobuf.IEnumDescriptorProto} message EnumDescriptorProto message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - DescriptorProto.encode = function encode(message, 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.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.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.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(); + $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.DescriptorProto.ReservedRange.encode(message.reservedRange[i], writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim(); + $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 10, wireType 2 =*/82).string(message.reservedName[i]); + writer.uint32(/* id 5, wireType 2 =*/42).string(message.reservedName[i]); return writer; }; /** - * Encodes the specified DescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.DescriptorProto.verify|verify} messages. + * Encodes the specified EnumDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.EnumDescriptorProto.verify|verify} messages. * @function encodeDelimited - * @memberof google.protobuf.DescriptorProto + * @memberof google.protobuf.EnumDescriptorProto * @static - * @param {google.protobuf.IDescriptorProto} message DescriptorProto message or plain object to encode + * @param {google.protobuf.IEnumDescriptorProto} message EnumDescriptorProto message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - DescriptorProto.encodeDelimited = function encodeDelimited(message, writer) { + EnumDescriptorProto.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a DescriptorProto message from the specified reader or buffer. + * Decodes an EnumDescriptorProto message from the specified reader or buffer. * @function decode - * @memberof google.protobuf.DescriptorProto + * @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.DescriptorProto} DescriptorProto + * @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 */ - DescriptorProto.decode = function decode(reader, length) { + EnumDescriptorProto.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.DescriptorProto(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.EnumDescriptorProto(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { @@ -13622,151 +30566,76 @@ 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())); + if (!(message.value && message.value.length)) + message.value = []; + message.value.push($root.google.protobuf.EnumValueDescriptorProto.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())); + message.options = $root.google.protobuf.EnumOptions.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())); + message.reservedRange.push($root.google.protobuf.EnumDescriptorProto.EnumReservedRange.decode(reader, reader.uint32())); break; } - case 10: { + 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 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; + reader.skipType(tag & 7); + break; } } - 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]); + 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 "oneofDecl." + error; + return "value." + error; } } if (message.options != null && message.hasOwnProperty("options")) { - var error = $root.google.protobuf.MessageOptions.verify(message.options); + var error = $root.google.protobuf.EnumOptions.verify(message.options); if (error) return "options." + error; } @@ -13774,7 +30643,7 @@ 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]); + var error = $root.google.protobuf.EnumDescriptorProto.EnumReservedRange.verify(message.reservedRange[i]); if (error) return "reservedRange." + error; } @@ -13790,97 +30659,47 @@ }; /** - * Creates a DescriptorProto message from a plain object. Also converts values to their respective internal types. + * Creates an EnumDescriptorProto message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.protobuf.DescriptorProto + * @memberof google.protobuf.EnumDescriptorProto * @static * @param {Object.} object Plain object - * @returns {google.protobuf.DescriptorProto} DescriptorProto + * @returns {google.protobuf.EnumDescriptorProto} EnumDescriptorProto */ - DescriptorProto.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.DescriptorProto) + EnumDescriptorProto.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.EnumDescriptorProto) return object; - var message = new $root.google.protobuf.DescriptorProto(); + var message = new $root.google.protobuf.EnumDescriptorProto(); 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.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.DescriptorProto.options: object expected"); - message.options = $root.google.protobuf.MessageOptions.fromObject(object.options); + 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.DescriptorProto.reservedRange: array expected"); + 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.DescriptorProto.reservedRange: object expected"); - message.reservedRange[i] = $root.google.protobuf.DescriptorProto.ReservedRange.fromObject(object.reservedRange[i]); + 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.DescriptorProto.reservedName: array expected"); + 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]); @@ -13889,25 +30708,20 @@ }; /** - * Creates a plain object from a DescriptorProto message. Also converts values to other types if specified. + * Creates a plain object from an EnumDescriptorProto message. Also converts values to other types if specified. * @function toObject - * @memberof google.protobuf.DescriptorProto + * @memberof google.protobuf.EnumDescriptorProto * @static - * @param {google.protobuf.DescriptorProto} message DescriptorProto + * @param {google.protobuf.EnumDescriptorProto} message EnumDescriptorProto * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - DescriptorProto.toObject = function toObject(message, options) { + EnumDescriptorProto.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.value = []; object.reservedRange = []; object.reservedName = []; } @@ -13917,42 +30731,17 @@ } 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.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.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); - } + 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.DescriptorProto.ReservedRange.toObject(message.reservedRange[j], options); + object.reservedRange[j] = $root.google.protobuf.EnumDescriptorProto.EnumReservedRange.toObject(message.reservedRange[j], options); } if (message.reservedName && message.reservedName.length) { object.reservedName = []; @@ -13963,51 +30752,50 @@ }; /** - * Converts this DescriptorProto to JSON. + * Converts this EnumDescriptorProto to JSON. * @function toJSON - * @memberof google.protobuf.DescriptorProto + * @memberof google.protobuf.EnumDescriptorProto * @instance * @returns {Object.} JSON object */ - DescriptorProto.prototype.toJSON = function toJSON() { + EnumDescriptorProto.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for DescriptorProto + * Gets the default type url for EnumDescriptorProto * @function getTypeUrl - * @memberof google.protobuf.DescriptorProto + * @memberof google.protobuf.EnumDescriptorProto * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - DescriptorProto.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + EnumDescriptorProto.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.protobuf.DescriptorProto"; + return typeUrlPrefix + "/google.protobuf.EnumDescriptorProto"; }; - DescriptorProto.ExtensionRange = (function() { + EnumDescriptorProto.EnumReservedRange = (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 + * 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 ExtensionRange. - * @memberof google.protobuf.DescriptorProto - * @classdesc Represents an ExtensionRange. - * @implements IExtensionRange + * Constructs a new EnumReservedRange. + * @memberof google.protobuf.EnumDescriptorProto + * @classdesc Represents an EnumReservedRange. + * @implements IEnumReservedRange * @constructor - * @param {google.protobuf.DescriptorProto.IExtensionRange=} [properties] Properties to set + * @param {google.protobuf.EnumDescriptorProto.IEnumReservedRange=} [properties] Properties to set */ - function ExtensionRange(properties) { + function EnumReservedRange(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -14015,90 +30803,80 @@ } /** - * ExtensionRange start. + * EnumReservedRange start. * @member {number} start - * @memberof google.protobuf.DescriptorProto.ExtensionRange + * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange * @instance */ - ExtensionRange.prototype.start = 0; + EnumReservedRange.prototype.start = 0; /** - * ExtensionRange end. + * EnumReservedRange 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 + * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange * @instance */ - ExtensionRange.prototype.options = null; + EnumReservedRange.prototype.end = 0; /** - * Creates a new ExtensionRange instance using the specified properties. + * Creates a new EnumReservedRange instance using the specified properties. * @function create - * @memberof google.protobuf.DescriptorProto.ExtensionRange + * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange * @static - * @param {google.protobuf.DescriptorProto.IExtensionRange=} [properties] Properties to set - * @returns {google.protobuf.DescriptorProto.ExtensionRange} ExtensionRange instance + * @param {google.protobuf.EnumDescriptorProto.IEnumReservedRange=} [properties] Properties to set + * @returns {google.protobuf.EnumDescriptorProto.EnumReservedRange} EnumReservedRange instance */ - ExtensionRange.create = function create(properties) { - return new ExtensionRange(properties); + EnumReservedRange.create = function create(properties) { + return new EnumReservedRange(properties); }; /** - * Encodes the specified ExtensionRange message. Does not implicitly {@link google.protobuf.DescriptorProto.ExtensionRange.verify|verify} messages. + * Encodes the specified EnumReservedRange message. Does not implicitly {@link google.protobuf.EnumDescriptorProto.EnumReservedRange.verify|verify} messages. * @function encode - * @memberof google.protobuf.DescriptorProto.ExtensionRange + * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange * @static - * @param {google.protobuf.DescriptorProto.IExtensionRange} message ExtensionRange message or plain object to encode + * @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 */ - ExtensionRange.encode = function encode(message, 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); - 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. + * Encodes the specified EnumReservedRange message, length delimited. Does not implicitly {@link google.protobuf.EnumDescriptorProto.EnumReservedRange.verify|verify} messages. * @function encodeDelimited - * @memberof google.protobuf.DescriptorProto.ExtensionRange + * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange * @static - * @param {google.protobuf.DescriptorProto.IExtensionRange} message ExtensionRange message or plain object to encode + * @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 */ - ExtensionRange.encodeDelimited = function encodeDelimited(message, writer) { + EnumReservedRange.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes an ExtensionRange message from the specified reader or buffer. + * Decodes an EnumReservedRange message from the specified reader or buffer. * @function decode - * @memberof google.protobuf.DescriptorProto.ExtensionRange + * @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.DescriptorProto.ExtensionRange} ExtensionRange + * @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 */ - ExtensionRange.decode = function decode(reader, length) { + EnumReservedRange.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.DescriptorProto.ExtensionRange(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.EnumDescriptorProto.EnumReservedRange(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { @@ -14110,10 +30888,6 @@ message.end = reader.int32(); break; } - case 3: { - message.options = $root.google.protobuf.ExtensionRangeOptions.decode(reader, reader.uint32()); - break; - } default: reader.skipType(tag & 7); break; @@ -14123,30 +30897,30 @@ }; /** - * Decodes an ExtensionRange message from the specified reader or buffer, length delimited. + * Decodes an EnumReservedRange message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.protobuf.DescriptorProto.ExtensionRange + * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.DescriptorProto.ExtensionRange} ExtensionRange + * @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 */ - ExtensionRange.decodeDelimited = function decodeDelimited(reader) { + EnumReservedRange.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies an ExtensionRange message. + * Verifies an EnumReservedRange message. * @function verify - * @memberof google.protobuf.DescriptorProto.ExtensionRange + * @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 */ - ExtensionRange.verify = function verify(message) { + EnumReservedRange.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; if (message.start != null && message.hasOwnProperty("start")) @@ -14155,343 +30929,639 @@ 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. + * Creates an EnumReservedRange message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.protobuf.DescriptorProto.ExtensionRange + * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange * @static * @param {Object.} object Plain object - * @returns {google.protobuf.DescriptorProto.ExtensionRange} ExtensionRange + * @returns {google.protobuf.EnumDescriptorProto.EnumReservedRange} EnumReservedRange */ - ExtensionRange.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.DescriptorProto.ExtensionRange) + EnumReservedRange.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.EnumDescriptorProto.EnumReservedRange) return object; - var message = new $root.google.protobuf.DescriptorProto.ExtensionRange(); + 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; - 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 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) { + 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(); + 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; - }; + } + 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); + /** + * 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; + }; - /** - * 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); - }; + /** + * 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; + }; - /** - * 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"; - }; + /** + * 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); + }; - return ExtensionRange; - })(); + /** + * 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"; + }; - DescriptorProto.ReservedRange = (function() { + return EnumValueDescriptorProto; + })(); - /** - * Properties of a ReservedRange. - * @memberof google.protobuf.DescriptorProto - * @interface IReservedRange - * @property {number|null} [start] ReservedRange start - * @property {number|null} [end] ReservedRange end - */ + protobuf.ServiceDescriptorProto = (function() { - /** - * 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]]; - } + /** + * 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 + */ - /** - * ReservedRange start. - * @member {number} start - * @memberof google.protobuf.DescriptorProto.ReservedRange - * @instance - */ - ReservedRange.prototype.start = 0; + /** + * 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]]; + } - /** - * ReservedRange end. - * @member {number} end - * @memberof google.protobuf.DescriptorProto.ReservedRange - * @instance - */ - ReservedRange.prototype.end = 0; + /** + * 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 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); - }; + /** + * 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 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 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 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(); - }; + /** + * 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 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) { - 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(); - switch (tag >>> 3) { - case 1: { - message.start = reader.int32(); - break; - } - case 2: { - message.end = reader.int32(); - break; - } - default: - reader.skipType(tag & 7); + /** + * 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) { + 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(); + 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 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; - }; + } + return message; + }; - /** - * 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; - }; + /** + * 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()); + }; - /** - * 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; + /** + * 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.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")) { + 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; + }; - /** - * 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); - }; + /** + * 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; + }; - /** - * 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"; - }; + /** + * 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); + }; - return ReservedRange; - })(); + /** + * 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 DescriptorProto; + return ServiceDescriptorProto; })(); - protobuf.ExtensionRangeOptions = (function() { + protobuf.MethodDescriptorProto = (function() { /** - * Properties of an ExtensionRangeOptions. + * Properties of a MethodDescriptorProto. * @memberof google.protobuf - * @interface IExtensionRangeOptions - * @property {Array.|null} [uninterpretedOption] ExtensionRangeOptions uninterpretedOption + * @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 ExtensionRangeOptions. + * Constructs a new MethodDescriptorProto. * @memberof google.protobuf - * @classdesc Represents an ExtensionRangeOptions. - * @implements IExtensionRangeOptions + * @classdesc Represents a MethodDescriptorProto. + * @implements IMethodDescriptorProto * @constructor - * @param {google.protobuf.IExtensionRangeOptions=} [properties] Properties to set + * @param {google.protobuf.IMethodDescriptorProto=} [properties] Properties to set */ - function ExtensionRangeOptions(properties) { - this.uninterpretedOption = []; + function MethodDescriptorProto(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -14499,78 +31569,145 @@ } /** - * ExtensionRangeOptions uninterpretedOption. - * @member {Array.} uninterpretedOption - * @memberof google.protobuf.ExtensionRangeOptions + * MethodDescriptorProto name. + * @member {string} name + * @memberof google.protobuf.MethodDescriptorProto * @instance */ - ExtensionRangeOptions.prototype.uninterpretedOption = $util.emptyArray; + MethodDescriptorProto.prototype.name = ""; /** - * Creates a new ExtensionRangeOptions instance using the specified properties. + * 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.ExtensionRangeOptions + * @memberof google.protobuf.MethodDescriptorProto * @static - * @param {google.protobuf.IExtensionRangeOptions=} [properties] Properties to set - * @returns {google.protobuf.ExtensionRangeOptions} ExtensionRangeOptions instance + * @param {google.protobuf.IMethodDescriptorProto=} [properties] Properties to set + * @returns {google.protobuf.MethodDescriptorProto} MethodDescriptorProto instance */ - ExtensionRangeOptions.create = function create(properties) { - return new ExtensionRangeOptions(properties); + MethodDescriptorProto.create = function create(properties) { + return new MethodDescriptorProto(properties); }; /** - * Encodes the specified ExtensionRangeOptions message. Does not implicitly {@link google.protobuf.ExtensionRangeOptions.verify|verify} messages. + * Encodes the specified MethodDescriptorProto message. Does not implicitly {@link google.protobuf.MethodDescriptorProto.verify|verify} messages. * @function encode - * @memberof google.protobuf.ExtensionRangeOptions + * @memberof google.protobuf.MethodDescriptorProto * @static - * @param {google.protobuf.IExtensionRangeOptions} message ExtensionRangeOptions message or plain object to encode + * @param {google.protobuf.IMethodDescriptorProto} message MethodDescriptorProto message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ExtensionRangeOptions.encode = function encode(message, writer) { + MethodDescriptorProto.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - 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.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 ExtensionRangeOptions message, length delimited. Does not implicitly {@link google.protobuf.ExtensionRangeOptions.verify|verify} messages. + * Encodes the specified MethodDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.MethodDescriptorProto.verify|verify} messages. * @function encodeDelimited - * @memberof google.protobuf.ExtensionRangeOptions + * @memberof google.protobuf.MethodDescriptorProto * @static - * @param {google.protobuf.IExtensionRangeOptions} message ExtensionRangeOptions message or plain object to encode + * @param {google.protobuf.IMethodDescriptorProto} message MethodDescriptorProto message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ExtensionRangeOptions.encodeDelimited = function encodeDelimited(message, writer) { + MethodDescriptorProto.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes an ExtensionRangeOptions message from the specified reader or buffer. + * Decodes a MethodDescriptorProto message from the specified reader or buffer. * @function decode - * @memberof google.protobuf.ExtensionRangeOptions + * @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.ExtensionRangeOptions} ExtensionRangeOptions + * @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 */ - ExtensionRangeOptions.decode = function decode(reader, length) { + MethodDescriptorProto.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.ExtensionRangeOptions(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.MethodDescriptorProto(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 999: { - if (!(message.uninterpretedOption && message.uninterpretedOption.length)) - message.uninterpretedOption = []; - message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); + 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: @@ -14582,365 +31719,567 @@ }; /** - * Decodes an ExtensionRangeOptions message from the specified reader or buffer, length delimited. + * Decodes a MethodDescriptorProto message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.protobuf.ExtensionRangeOptions + * @memberof google.protobuf.MethodDescriptorProto * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.ExtensionRangeOptions} ExtensionRangeOptions + * @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 */ - ExtensionRangeOptions.decodeDelimited = function decodeDelimited(reader) { + MethodDescriptorProto.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies an ExtensionRangeOptions message. + * Verifies a MethodDescriptorProto message. * @function verify - * @memberof google.protobuf.ExtensionRangeOptions + * @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 */ - ExtensionRangeOptions.verify = function verify(message) { + MethodDescriptorProto.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.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 an ExtensionRangeOptions message from a plain object. Also converts values to their respective internal types. + * Creates a MethodDescriptorProto message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.protobuf.ExtensionRangeOptions + * @memberof google.protobuf.MethodDescriptorProto * @static * @param {Object.} object Plain object - * @returns {google.protobuf.ExtensionRangeOptions} ExtensionRangeOptions + * @returns {google.protobuf.MethodDescriptorProto} MethodDescriptorProto */ - ExtensionRangeOptions.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.ExtensionRangeOptions) + MethodDescriptorProto.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.MethodDescriptorProto) 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]); - } + 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 an ExtensionRangeOptions message. Also converts values to other types if specified. + * Creates a plain object from a MethodDescriptorProto message. Also converts values to other types if specified. * @function toObject - * @memberof google.protobuf.ExtensionRangeOptions + * @memberof google.protobuf.MethodDescriptorProto * @static - * @param {google.protobuf.ExtensionRangeOptions} message ExtensionRangeOptions + * @param {google.protobuf.MethodDescriptorProto} message MethodDescriptorProto * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - ExtensionRangeOptions.toObject = function toObject(message, options) { + MethodDescriptorProto.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.arrays || options.defaults) - object.uninterpretedOption = []; - 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 (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 ExtensionRangeOptions to JSON. + * Converts this MethodDescriptorProto to JSON. * @function toJSON - * @memberof google.protobuf.ExtensionRangeOptions + * @memberof google.protobuf.MethodDescriptorProto * @instance * @returns {Object.} JSON object */ - ExtensionRangeOptions.prototype.toJSON = function toJSON() { + MethodDescriptorProto.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for ExtensionRangeOptions + * Gets the default type url for MethodDescriptorProto * @function getTypeUrl - * @memberof google.protobuf.ExtensionRangeOptions + * @memberof google.protobuf.MethodDescriptorProto * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - ExtensionRangeOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + MethodDescriptorProto.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.protobuf.ExtensionRangeOptions"; + return typeUrlPrefix + "/google.protobuf.MethodDescriptorProto"; }; - return ExtensionRangeOptions; - })(); + 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} [phpGenericServices] FileOptions phpGenericServices + * @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 {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; - protobuf.FieldDescriptorProto = (function() { + /** + * FileOptions javaGenericServices. + * @member {boolean} javaGenericServices + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.javaGenericServices = false; /** - * 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 + * FileOptions pyGenericServices. + * @member {boolean} pyGenericServices + * @memberof google.protobuf.FileOptions + * @instance */ + FileOptions.prototype.pyGenericServices = false; /** - * Constructs a new FieldDescriptorProto. - * @memberof google.protobuf - * @classdesc Represents a FieldDescriptorProto. - * @implements IFieldDescriptorProto - * @constructor - * @param {google.protobuf.IFieldDescriptorProto=} [properties] Properties to set + * FileOptions phpGenericServices. + * @member {boolean} phpGenericServices + * @memberof google.protobuf.FileOptions + * @instance */ - 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]]; - } + FileOptions.prototype.phpGenericServices = false; /** - * FieldDescriptorProto name. - * @member {string} name - * @memberof google.protobuf.FieldDescriptorProto + * FileOptions deprecated. + * @member {boolean} deprecated + * @memberof google.protobuf.FileOptions * @instance */ - FieldDescriptorProto.prototype.name = ""; + FileOptions.prototype.deprecated = false; /** - * FieldDescriptorProto number. - * @member {number} number - * @memberof google.protobuf.FieldDescriptorProto + * FileOptions ccEnableArenas. + * @member {boolean} ccEnableArenas + * @memberof google.protobuf.FileOptions * @instance */ - FieldDescriptorProto.prototype.number = 0; + FileOptions.prototype.ccEnableArenas = true; /** - * FieldDescriptorProto label. - * @member {google.protobuf.FieldDescriptorProto.Label} label - * @memberof google.protobuf.FieldDescriptorProto + * FileOptions objcClassPrefix. + * @member {string} objcClassPrefix + * @memberof google.protobuf.FileOptions * @instance */ - FieldDescriptorProto.prototype.label = 1; + FileOptions.prototype.objcClassPrefix = ""; /** - * FieldDescriptorProto type. - * @member {google.protobuf.FieldDescriptorProto.Type} type - * @memberof google.protobuf.FieldDescriptorProto + * FileOptions csharpNamespace. + * @member {string} csharpNamespace + * @memberof google.protobuf.FileOptions * @instance */ - FieldDescriptorProto.prototype.type = 1; + FileOptions.prototype.csharpNamespace = ""; /** - * FieldDescriptorProto typeName. - * @member {string} typeName - * @memberof google.protobuf.FieldDescriptorProto + * FileOptions swiftPrefix. + * @member {string} swiftPrefix + * @memberof google.protobuf.FileOptions * @instance */ - FieldDescriptorProto.prototype.typeName = ""; + FileOptions.prototype.swiftPrefix = ""; /** - * FieldDescriptorProto extendee. - * @member {string} extendee - * @memberof google.protobuf.FieldDescriptorProto + * FileOptions phpClassPrefix. + * @member {string} phpClassPrefix + * @memberof google.protobuf.FileOptions * @instance */ - FieldDescriptorProto.prototype.extendee = ""; + FileOptions.prototype.phpClassPrefix = ""; /** - * FieldDescriptorProto defaultValue. - * @member {string} defaultValue - * @memberof google.protobuf.FieldDescriptorProto + * FileOptions phpNamespace. + * @member {string} phpNamespace + * @memberof google.protobuf.FileOptions * @instance */ - FieldDescriptorProto.prototype.defaultValue = ""; + FileOptions.prototype.phpNamespace = ""; /** - * FieldDescriptorProto oneofIndex. - * @member {number} oneofIndex - * @memberof google.protobuf.FieldDescriptorProto + * FileOptions phpMetadataNamespace. + * @member {string} phpMetadataNamespace + * @memberof google.protobuf.FileOptions * @instance */ - FieldDescriptorProto.prototype.oneofIndex = 0; + FileOptions.prototype.phpMetadataNamespace = ""; /** - * FieldDescriptorProto jsonName. - * @member {string} jsonName - * @memberof google.protobuf.FieldDescriptorProto + * FileOptions rubyPackage. + * @member {string} rubyPackage + * @memberof google.protobuf.FileOptions * @instance */ - FieldDescriptorProto.prototype.jsonName = ""; + FileOptions.prototype.rubyPackage = ""; /** - * FieldDescriptorProto options. - * @member {google.protobuf.IFieldOptions|null|undefined} options - * @memberof google.protobuf.FieldDescriptorProto + * FileOptions uninterpretedOption. + * @member {Array.} uninterpretedOption + * @memberof google.protobuf.FileOptions * @instance */ - FieldDescriptorProto.prototype.options = null; + FileOptions.prototype.uninterpretedOption = $util.emptyArray; /** - * FieldDescriptorProto proto3Optional. - * @member {boolean} proto3Optional - * @memberof google.protobuf.FieldDescriptorProto + * FileOptions .google.api.resourceDefinition. + * @member {Array.} .google.api.resourceDefinition + * @memberof google.protobuf.FileOptions * @instance */ - FieldDescriptorProto.prototype.proto3Optional = false; + FileOptions.prototype[".google.api.resourceDefinition"] = $util.emptyArray; /** - * Creates a new FieldDescriptorProto instance using the specified properties. + * Creates a new FileOptions instance using the specified properties. * @function create - * @memberof google.protobuf.FieldDescriptorProto + * @memberof google.protobuf.FileOptions * @static - * @param {google.protobuf.IFieldDescriptorProto=} [properties] Properties to set - * @returns {google.protobuf.FieldDescriptorProto} FieldDescriptorProto instance + * @param {google.protobuf.IFileOptions=} [properties] Properties to set + * @returns {google.protobuf.FileOptions} FileOptions instance */ - FieldDescriptorProto.create = function create(properties) { - return new FieldDescriptorProto(properties); + FileOptions.create = function create(properties) { + return new FileOptions(properties); }; /** - * Encodes the specified FieldDescriptorProto message. Does not implicitly {@link google.protobuf.FieldDescriptorProto.verify|verify} messages. + * Encodes the specified FileOptions message. Does not implicitly {@link google.protobuf.FileOptions.verify|verify} messages. * @function encode - * @memberof google.protobuf.FieldDescriptorProto + * @memberof google.protobuf.FileOptions * @static - * @param {google.protobuf.IFieldDescriptorProto} message FieldDescriptorProto message or plain object to encode + * @param {google.protobuf.IFileOptions} message FileOptions message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - FieldDescriptorProto.encode = function encode(message, writer) { + FileOptions.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); + 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.phpGenericServices != null && Object.hasOwnProperty.call(message, "phpGenericServices")) + writer.uint32(/* id 42, wireType 0 =*/336).bool(message.phpGenericServices); + 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.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 FieldDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.FieldDescriptorProto.verify|verify} messages. + * Encodes the specified FileOptions message, length delimited. Does not implicitly {@link google.protobuf.FileOptions.verify|verify} messages. * @function encodeDelimited - * @memberof google.protobuf.FieldDescriptorProto + * @memberof google.protobuf.FileOptions * @static - * @param {google.protobuf.IFieldDescriptorProto} message FieldDescriptorProto message or plain object to encode + * @param {google.protobuf.IFileOptions} message FileOptions message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - FieldDescriptorProto.encodeDelimited = function encodeDelimited(message, writer) { + FileOptions.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a FieldDescriptorProto message from the specified reader or buffer. + * Decodes a FileOptions message from the specified reader or buffer. * @function decode - * @memberof google.protobuf.FieldDescriptorProto + * @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.FieldDescriptorProto} FieldDescriptorProto + * @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 */ - FieldDescriptorProto.decode = function decode(reader, length) { + FileOptions.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.FieldDescriptorProto(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.FileOptions(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: { - message.name = reader.string(); + message.javaPackage = reader.string(); + break; + } + case 8: { + message.javaOuterClassname = reader.string(); + break; + } + case 10: { + message.javaMultipleFiles = reader.bool(); break; } - case 3: { - message.number = reader.int32(); + case 20: { + message.javaGenerateEqualsAndHash = reader.bool(); break; } - case 4: { - message.label = reader.int32(); + case 27: { + message.javaStringCheckUtf8 = reader.bool(); break; } - case 5: { - message.type = reader.int32(); + case 9: { + message.optimizeFor = reader.int32(); break; } - case 6: { - message.typeName = reader.string(); + case 11: { + message.goPackage = reader.string(); break; } - case 2: { - message.extendee = reader.string(); + case 16: { + message.ccGenericServices = reader.bool(); break; } - case 7: { - message.defaultValue = reader.string(); + case 17: { + message.javaGenericServices = reader.bool(); break; } - case 9: { - message.oneofIndex = reader.int32(); + case 18: { + message.pyGenericServices = reader.bool(); break; } - case 10: { - message.jsonName = reader.string(); + case 42: { + message.phpGenericServices = reader.bool(); break; } - case 8: { - message.options = $root.google.protobuf.FieldOptions.decode(reader, reader.uint32()); + case 23: { + message.deprecated = reader.bool(); break; } - case 17: { - message.proto3Optional = reader.bool(); + 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 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: @@ -14952,394 +32291,374 @@ }; /** - * Decodes a FieldDescriptorProto message from the specified reader or buffer, length delimited. + * Decodes a FileOptions message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.protobuf.FieldDescriptorProto + * @memberof google.protobuf.FileOptions * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.FieldDescriptorProto} FieldDescriptorProto + * @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 */ - FieldDescriptorProto.decodeDelimited = function decodeDelimited(reader) { + FileOptions.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a FieldDescriptorProto message. + * Verifies a FileOptions message. * @function verify - * @memberof google.protobuf.FieldDescriptorProto + * @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 */ - FieldDescriptorProto.verify = function verify(message) { + FileOptions.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) { + 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 "label: enum value expected"; + return "optimizeFor: enum value expected"; case 1: case 2: case 3: 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.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.phpGenericServices != null && message.hasOwnProperty("phpGenericServices")) + if (typeof message.phpGenericServices !== "boolean") + return "phpGenericServices: 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.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; } - 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. + * Creates a FileOptions message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.protobuf.FieldDescriptorProto + * @memberof google.protobuf.FileOptions * @static * @param {Object.} object Plain object - * @returns {google.protobuf.FieldDescriptorProto} FieldDescriptorProto + * @returns {google.protobuf.FileOptions} FileOptions */ - FieldDescriptorProto.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.FieldDescriptorProto) + FileOptions.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.FileOptions) 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) { + 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.label === "number") { - message.label = object.label; + if (typeof object.optimizeFor === "number") { + message.optimizeFor = object.optimizeFor; break; } break; - case "LABEL_OPTIONAL": + case "SPEED": case 1: - message.label = 1; + message.optimizeFor = 1; break; - case "LABEL_REQUIRED": + case "CODE_SIZE": case 2: - message.label = 2; + message.optimizeFor = 2; break; - case "LABEL_REPEATED": + case "LITE_RUNTIME": case 3: - message.label = 3; + message.optimizeFor = 3; break; } - switch (object.type) { - default: - if (typeof object.type === "number") { - message.type = object.type; - 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.phpGenericServices != null) + message.phpGenericServices = Boolean(object.phpGenericServices); + 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.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]); } - 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[".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]); + } } - 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. + * Creates a plain object from a FileOptions message. Also converts values to other types if specified. * @function toObject - * @memberof google.protobuf.FieldDescriptorProto + * @memberof google.protobuf.FileOptions * @static - * @param {google.protobuf.FieldDescriptorProto} message FieldDescriptorProto + * @param {google.protobuf.FileOptions} message FileOptions * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - FieldDescriptorProto.toObject = function toObject(message, options) { + 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.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; + 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.phpGenericServices = false; + object.phpMetadataNamespace = ""; + object.rubyPackage = ""; + } + 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.phpGenericServices != null && message.hasOwnProperty("phpGenericServices")) + object.phpGenericServices = message.phpGenericServices; + if (message.phpMetadataNamespace != null && message.hasOwnProperty("phpMetadataNamespace")) + object.phpMetadataNamespace = message.phpMetadataNamespace; + if (message.rubyPackage != null && message.hasOwnProperty("rubyPackage")) + object.rubyPackage = message.rubyPackage; + 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); } - 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. + * Converts this FileOptions to JSON. * @function toJSON - * @memberof google.protobuf.FieldDescriptorProto + * @memberof google.protobuf.FileOptions * @instance * @returns {Object.} JSON object */ - FieldDescriptorProto.prototype.toJSON = function toJSON() { + FileOptions.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for FieldDescriptorProto + * Gets the default type url for FileOptions * @function getTypeUrl - * @memberof google.protobuf.FieldDescriptorProto + * @memberof google.protobuf.FileOptions * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - FieldDescriptorProto.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + FileOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.protobuf.FieldDescriptorProto"; + return typeUrlPrefix + "/google.protobuf.FileOptions"; }; /** - * 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 + * OptimizeMode enum. + * @name google.protobuf.FileOptions.OptimizeMode * @enum {number} - * @property {number} LABEL_OPTIONAL=1 LABEL_OPTIONAL value - * @property {number} LABEL_REQUIRED=2 LABEL_REQUIRED value - * @property {number} LABEL_REPEATED=3 LABEL_REPEATED value + * @property {number} SPEED=1 SPEED value + * @property {number} CODE_SIZE=2 CODE_SIZE value + * @property {number} LITE_RUNTIME=3 LITE_RUNTIME value */ - FieldDescriptorProto.Label = (function() { + FileOptions.OptimizeMode = (function() { var valuesById = {}, values = Object.create(valuesById); - values[valuesById[1] = "LABEL_OPTIONAL"] = 1; - values[valuesById[2] = "LABEL_REQUIRED"] = 2; - values[valuesById[3] = "LABEL_REPEATED"] = 3; + values[valuesById[1] = "SPEED"] = 1; + values[valuesById[2] = "CODE_SIZE"] = 2; + values[valuesById[3] = "LITE_RUNTIME"] = 3; return values; })(); - return FieldDescriptorProto; + return FileOptions; })(); - protobuf.OneofDescriptorProto = (function() { + protobuf.MessageOptions = (function() { /** - * Properties of an OneofDescriptorProto. + * Properties of a MessageOptions. * @memberof google.protobuf - * @interface IOneofDescriptorProto - * @property {string|null} [name] OneofDescriptorProto name - * @property {google.protobuf.IOneofOptions|null} [options] OneofDescriptorProto options + * @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 {Array.|null} [uninterpretedOption] MessageOptions uninterpretedOption + * @property {google.api.IResourceDescriptor|null} [".google.api.resource"] MessageOptions .google.api.resource */ /** - * Constructs a new OneofDescriptorProto. + * Constructs a new MessageOptions. * @memberof google.protobuf - * @classdesc Represents an OneofDescriptorProto. - * @implements IOneofDescriptorProto + * @classdesc Represents a MessageOptions. + * @implements IMessageOptions * @constructor - * @param {google.protobuf.IOneofDescriptorProto=} [properties] Properties to set + * @param {google.protobuf.IMessageOptions=} [properties] Properties to set */ - function OneofDescriptorProto(properties) { + function MessageOptions(properties) { + this.uninterpretedOption = []; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -15347,89 +32666,162 @@ } /** - * OneofDescriptorProto name. - * @member {string} name - * @memberof google.protobuf.OneofDescriptorProto + * MessageOptions messageSetWireFormat. + * @member {boolean} messageSetWireFormat + * @memberof google.protobuf.MessageOptions * @instance */ - OneofDescriptorProto.prototype.name = ""; + MessageOptions.prototype.messageSetWireFormat = false; /** - * OneofDescriptorProto options. - * @member {google.protobuf.IOneofOptions|null|undefined} options - * @memberof google.protobuf.OneofDescriptorProto + * MessageOptions noStandardDescriptorAccessor. + * @member {boolean} noStandardDescriptorAccessor + * @memberof google.protobuf.MessageOptions * @instance */ - OneofDescriptorProto.prototype.options = null; + MessageOptions.prototype.noStandardDescriptorAccessor = false; /** - * Creates a new OneofDescriptorProto instance using the specified properties. + * 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 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.OneofDescriptorProto + * @memberof google.protobuf.MessageOptions * @static - * @param {google.protobuf.IOneofDescriptorProto=} [properties] Properties to set - * @returns {google.protobuf.OneofDescriptorProto} OneofDescriptorProto instance + * @param {google.protobuf.IMessageOptions=} [properties] Properties to set + * @returns {google.protobuf.MessageOptions} MessageOptions instance */ - OneofDescriptorProto.create = function create(properties) { - return new OneofDescriptorProto(properties); + MessageOptions.create = function create(properties) { + return new MessageOptions(properties); }; /** - * Encodes the specified OneofDescriptorProto message. Does not implicitly {@link google.protobuf.OneofDescriptorProto.verify|verify} messages. + * Encodes the specified MessageOptions message. Does not implicitly {@link google.protobuf.MessageOptions.verify|verify} messages. * @function encode - * @memberof google.protobuf.OneofDescriptorProto + * @memberof google.protobuf.MessageOptions * @static - * @param {google.protobuf.IOneofDescriptorProto} message OneofDescriptorProto message or plain object to encode + * @param {google.protobuf.IMessageOptions} message MessageOptions message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - OneofDescriptorProto.encode = function encode(message, writer) { + MessageOptions.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(); + 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.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 OneofDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.OneofDescriptorProto.verify|verify} messages. + * Encodes the specified MessageOptions message, length delimited. Does not implicitly {@link google.protobuf.MessageOptions.verify|verify} messages. * @function encodeDelimited - * @memberof google.protobuf.OneofDescriptorProto + * @memberof google.protobuf.MessageOptions * @static - * @param {google.protobuf.IOneofDescriptorProto} message OneofDescriptorProto message or plain object to encode + * @param {google.protobuf.IMessageOptions} message MessageOptions message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - OneofDescriptorProto.encodeDelimited = function encodeDelimited(message, writer) { + MessageOptions.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes an OneofDescriptorProto message from the specified reader or buffer. + * Decodes a MessageOptions message from the specified reader or buffer. * @function decode - * @memberof google.protobuf.OneofDescriptorProto + * @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.OneofDescriptorProto} OneofDescriptorProto + * @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 */ - OneofDescriptorProto.decode = function decode(reader, length) { + MessageOptions.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.OneofDescriptorProto(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.MessageOptions(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: { - message.name = reader.string(); + message.messageSetWireFormat = reader.bool(); break; } case 2: { - message.options = $root.google.protobuf.OneofOptions.decode(reader, reader.uint32()); + 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 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: @@ -15441,143 +32833,208 @@ }; /** - * Decodes an OneofDescriptorProto message from the specified reader or buffer, length delimited. + * Decodes a MessageOptions message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.protobuf.OneofDescriptorProto + * @memberof google.protobuf.MessageOptions * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.OneofDescriptorProto} OneofDescriptorProto + * @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 */ - OneofDescriptorProto.decodeDelimited = function decodeDelimited(reader) { + MessageOptions.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies an OneofDescriptorProto message. + * Verifies a MessageOptions message. * @function verify - * @memberof google.protobuf.OneofDescriptorProto + * @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 */ - OneofDescriptorProto.verify = function verify(message) { + MessageOptions.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 (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.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 "options." + error; + return ".google.api.resource." + error; } return null; }; /** - * Creates an OneofDescriptorProto message from a plain object. Also converts values to their respective internal types. + * Creates a MessageOptions message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.protobuf.OneofDescriptorProto + * @memberof google.protobuf.MessageOptions * @static * @param {Object.} object Plain object - * @returns {google.protobuf.OneofDescriptorProto} OneofDescriptorProto + * @returns {google.protobuf.MessageOptions} MessageOptions */ - OneofDescriptorProto.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.OneofDescriptorProto) + MessageOptions.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.MessageOptions) 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); + 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.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 an OneofDescriptorProto message. Also converts values to other types if specified. + * Creates a plain object from a MessageOptions message. Also converts values to other types if specified. * @function toObject - * @memberof google.protobuf.OneofDescriptorProto + * @memberof google.protobuf.MessageOptions * @static - * @param {google.protobuf.OneofDescriptorProto} message OneofDescriptorProto + * @param {google.protobuf.MessageOptions} message MessageOptions * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - OneofDescriptorProto.toObject = function toObject(message, options) { + MessageOptions.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; + if (options.arrays || options.defaults) + object.uninterpretedOption = []; if (options.defaults) { - object.name = ""; - object.options = null; + object.messageSetWireFormat = false; + object.noStandardDescriptorAccessor = false; + object.deprecated = false; + object.mapEntry = false; + object.deprecatedLegacyJsonFieldConflicts = false; + object[".google.api.resource"] = 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); + 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.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 OneofDescriptorProto to JSON. + * Converts this MessageOptions to JSON. * @function toJSON - * @memberof google.protobuf.OneofDescriptorProto + * @memberof google.protobuf.MessageOptions * @instance * @returns {Object.} JSON object */ - OneofDescriptorProto.prototype.toJSON = function toJSON() { + MessageOptions.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for OneofDescriptorProto + * Gets the default type url for MessageOptions * @function getTypeUrl - * @memberof google.protobuf.OneofDescriptorProto + * @memberof google.protobuf.MessageOptions * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - OneofDescriptorProto.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + MessageOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.protobuf.OneofDescriptorProto"; + return typeUrlPrefix + "/google.protobuf.MessageOptions"; }; - return OneofDescriptorProto; + return MessageOptions; })(); - protobuf.EnumDescriptorProto = (function() { + protobuf.FieldOptions = (function() { /** - * Properties of an EnumDescriptorProto. + * Properties of a FieldOptions. * @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 + * @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 {google.protobuf.FieldOptions.OptionTargetType|null} [target] FieldOptions target + * @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 EnumDescriptorProto. + * Constructs a new FieldOptions. * @memberof google.protobuf - * @classdesc Represents an EnumDescriptorProto. - * @implements IEnumDescriptorProto + * @classdesc Represents a FieldOptions. + * @implements IFieldOptions * @constructor - * @param {google.protobuf.IEnumDescriptorProto=} [properties] Properties to set + * @param {google.protobuf.IFieldOptions=} [properties] Properties to set */ - function EnumDescriptorProto(properties) { - this.value = []; - this.reservedRange = []; - this.reservedName = []; + function FieldOptions(properties) { + 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) @@ -15585,582 +33042,1003 @@ } /** - * EnumDescriptorProto name. - * @member {string} name - * @memberof google.protobuf.EnumDescriptorProto + * FieldOptions ctype. + * @member {google.protobuf.FieldOptions.CType} ctype + * @memberof google.protobuf.FieldOptions * @instance */ - EnumDescriptorProto.prototype.name = ""; + FieldOptions.prototype.ctype = 0; /** - * EnumDescriptorProto value. - * @member {Array.} value - * @memberof google.protobuf.EnumDescriptorProto + * 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 target. + * @member {google.protobuf.FieldOptions.OptionTargetType} target + * @memberof google.protobuf.FieldOptions * @instance */ - EnumDescriptorProto.prototype.value = $util.emptyArray; + FieldOptions.prototype.target = 0; /** - * EnumDescriptorProto options. - * @member {google.protobuf.IEnumOptions|null|undefined} options - * @memberof google.protobuf.EnumDescriptorProto + * FieldOptions uninterpretedOption. + * @member {Array.} uninterpretedOption + * @memberof google.protobuf.FieldOptions * @instance */ - EnumDescriptorProto.prototype.options = null; + FieldOptions.prototype.uninterpretedOption = $util.emptyArray; /** - * EnumDescriptorProto reservedRange. - * @member {Array.} reservedRange - * @memberof google.protobuf.EnumDescriptorProto + * FieldOptions .google.api.fieldBehavior. + * @member {Array.} .google.api.fieldBehavior + * @memberof google.protobuf.FieldOptions * @instance */ - EnumDescriptorProto.prototype.reservedRange = $util.emptyArray; + FieldOptions.prototype[".google.api.fieldBehavior"] = $util.emptyArray; /** - * EnumDescriptorProto reservedName. - * @member {Array.} reservedName - * @memberof google.protobuf.EnumDescriptorProto + * FieldOptions .google.api.resourceReference. + * @member {google.api.IResourceReference|null|undefined} .google.api.resourceReference + * @memberof google.protobuf.FieldOptions * @instance */ - EnumDescriptorProto.prototype.reservedName = $util.emptyArray; + FieldOptions.prototype[".google.api.resourceReference"] = null; /** - * Creates a new EnumDescriptorProto instance using the specified properties. + * Creates a new FieldOptions instance using the specified properties. * @function create - * @memberof google.protobuf.EnumDescriptorProto + * @memberof google.protobuf.FieldOptions * @static - * @param {google.protobuf.IEnumDescriptorProto=} [properties] Properties to set - * @returns {google.protobuf.EnumDescriptorProto} EnumDescriptorProto instance + * @param {google.protobuf.IFieldOptions=} [properties] Properties to set + * @returns {google.protobuf.FieldOptions} FieldOptions instance */ - EnumDescriptorProto.create = function create(properties) { - return new EnumDescriptorProto(properties); + FieldOptions.create = function create(properties) { + return new FieldOptions(properties); }; /** - * Encodes the specified EnumDescriptorProto message. Does not implicitly {@link google.protobuf.EnumDescriptorProto.verify|verify} messages. + * Encodes the specified FieldOptions message. Does not implicitly {@link google.protobuf.FieldOptions.verify|verify} messages. * @function encode - * @memberof google.protobuf.EnumDescriptorProto + * @memberof google.protobuf.FieldOptions * @static - * @param {google.protobuf.IEnumDescriptorProto} message EnumDescriptorProto message or plain object to encode + * @param {google.protobuf.IFieldOptions} message FieldOptions message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - EnumDescriptorProto.encode = function encode(message, writer) { + FieldOptions.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]); + 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.target != null && Object.hasOwnProperty.call(message, "target")) + writer.uint32(/* id 18, wireType 0 =*/144).int32(message.target); + 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) { + writer.uint32(/* id 1052, wireType 2 =*/8418).fork(); + for (var i = 0; i < message[".google.api.fieldBehavior"].length; ++i) + writer.int32(message[".google.api.fieldBehavior"][i]); + writer.ldelim(); + } + 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 EnumDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.EnumDescriptorProto.verify|verify} messages. + * Encodes the specified FieldOptions message, length delimited. Does not implicitly {@link google.protobuf.FieldOptions.verify|verify} messages. * @function encodeDelimited - * @memberof google.protobuf.EnumDescriptorProto + * @memberof google.protobuf.FieldOptions * @static - * @param {google.protobuf.IEnumDescriptorProto} message EnumDescriptorProto message or plain object to encode + * @param {google.protobuf.IFieldOptions} message FieldOptions message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - EnumDescriptorProto.encodeDelimited = function encodeDelimited(message, writer) { + FieldOptions.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes an EnumDescriptorProto message from the specified reader or buffer. + * Decodes a FieldOptions message from the specified reader or buffer. * @function decode - * @memberof google.protobuf.EnumDescriptorProto + * @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.EnumDescriptorProto} EnumDescriptorProto + * @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 */ - EnumDescriptorProto.decode = function decode(reader, length) { + FieldOptions.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.EnumDescriptorProto(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.FieldOptions(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: { - message.name = reader.string(); + message.ctype = reader.int32(); break; } case 2: { - if (!(message.value && message.value.length)) - message.value = []; - message.value.push($root.google.protobuf.EnumValueDescriptorProto.decode(reader, reader.uint32())); + 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.options = $root.google.protobuf.EnumOptions.decode(reader, reader.uint32()); + message.deprecated = reader.bool(); break; } - case 4: { - if (!(message.reservedRange && message.reservedRange.length)) - message.reservedRange = []; - message.reservedRange.push($root.google.protobuf.EnumDescriptorProto.EnumReservedRange.decode(reader, reader.uint32())); + case 10: { + message.weak = reader.bool(); break; } - case 5: { - if (!(message.reservedName && message.reservedName.length)) - message.reservedName = []; - message.reservedName.push(reader.string()); + case 16: { + message.debugRedact = reader.bool(); + break; + } + case 17: { + message.retention = reader.int32(); + break; + } + case 18: { + message.target = reader.int32(); + 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 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]); + } + 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.target != null && message.hasOwnProperty("target")) + switch (message.target) { + default: + return "target: 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.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 "value." + error; + return "uninterpretedOption." + 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[".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: + break; + } } - 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"; + 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 an EnumDescriptorProto message from a plain object. Also converts values to their respective internal types. + * Creates a FieldOptions message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.protobuf.EnumDescriptorProto + * @memberof google.protobuf.FieldOptions * @static * @param {Object.} object Plain object - * @returns {google.protobuf.EnumDescriptorProto} EnumDescriptorProto + * @returns {google.protobuf.FieldOptions} FieldOptions */ - EnumDescriptorProto.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.EnumDescriptorProto) + FieldOptions.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.FieldOptions) 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]); + 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.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.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.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]); + switch (object.target) { + default: + if (typeof object.target === "number") { + message.target = object.target; + break; + } + break; + case "TARGET_TYPE_UNKNOWN": + case 0: + message.target = 0; + break; + case "TARGET_TYPE_FILE": + case 1: + message.target = 1; + break; + case "TARGET_TYPE_EXTENSION_RANGE": + case 2: + message.target = 2; + break; + case "TARGET_TYPE_MESSAGE": + case 3: + message.target = 3; + break; + case "TARGET_TYPE_FIELD": + case 4: + message.target = 4; + break; + case "TARGET_TYPE_ONEOF": + case 5: + message.target = 5; + break; + case "TARGET_TYPE_ENUM": + case 6: + message.target = 6; + break; + case "TARGET_TYPE_ENUM_ENTRY": + case 7: + message.target = 7; + break; + case "TARGET_TYPE_SERVICE": + case 8: + message.target = 8; + break; + case "TARGET_TYPE_METHOD": + case 9: + message.target = 9; + break; + } + 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.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]); + 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; + } + } + 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 an EnumDescriptorProto message. Also converts values to other types if specified. + * Creates a plain object from a FieldOptions message. Also converts values to other types if specified. * @function toObject - * @memberof google.protobuf.EnumDescriptorProto + * @memberof google.protobuf.FieldOptions * @static - * @param {google.protobuf.EnumDescriptorProto} message EnumDescriptorProto + * @param {google.protobuf.FieldOptions} message FieldOptions * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - EnumDescriptorProto.toObject = function toObject(message, options) { + FieldOptions.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; if (options.arrays || options.defaults) { - object.value = []; - object.reservedRange = []; - object.reservedName = []; + object.uninterpretedOption = []; + object[".google.api.fieldBehavior"] = []; } 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); + 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.target = options.enums === String ? "TARGET_TYPE_UNKNOWN" : 0; + object[".google.api.resourceReference"] = null; } - 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.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.target != null && message.hasOwnProperty("target")) + object.target = options.enums === String ? $root.google.protobuf.FieldOptions.OptionTargetType[message.target] === undefined ? message.target : $root.google.protobuf.FieldOptions.OptionTargetType[message.target] : message.target; + 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.reservedName && message.reservedName.length) { - object.reservedName = []; - for (var j = 0; j < message.reservedName.length; ++j) - object.reservedName[j] = message.reservedName[j]; + 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 EnumDescriptorProto to JSON. - * @function toJSON - * @memberof google.protobuf.EnumDescriptorProto + * 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; + })(); + + return FieldOptions; + })(); + + protobuf.OneofOptions = (function() { + + /** + * Properties of an OneofOptions. + * @memberof google.protobuf + * @interface IOneofOptions + * @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 uninterpretedOption. + * @member {Array.} uninterpretedOption + * @memberof google.protobuf.OneofOptions * @instance - * @returns {Object.} JSON object */ - EnumDescriptorProto.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; + OneofOptions.prototype.uninterpretedOption = $util.emptyArray; /** - * Gets the default type url for EnumDescriptorProto - * @function getTypeUrl - * @memberof google.protobuf.EnumDescriptorProto + * Creates a new OneofOptions instance using the specified properties. + * @function create + * @memberof google.protobuf.OneofOptions * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url + * @param {google.protobuf.IOneofOptions=} [properties] Properties to set + * @returns {google.protobuf.OneofOptions} OneofOptions instance */ - EnumDescriptorProto.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.protobuf.EnumDescriptorProto"; + OneofOptions.create = function create(properties) { + return new OneofOptions(properties); }; - 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 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.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 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(); - }; + /** + * 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 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) { - 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(); - switch (tag >>> 3) { - case 1: { - message.start = reader.int32(); - break; - } - case 2: { - message.end = reader.int32(); - break; - } - default: - reader.skipType(tag & 7); + /** + * 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) { + 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(); + 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; } + 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; - }; + } + return message; + }; - /** - * 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; - }; + /** + * 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()); + }; - /** - * 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; + /** + * 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.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.start != null && message.hasOwnProperty("start")) - object.start = message.start; - if (message.end != null && message.hasOwnProperty("end")) - object.end = message.end; + } + 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.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; + }; - /** - * 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); - }; + /** + * 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 (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; + }; - /** - * 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"; - }; + /** + * 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); + }; - return EnumReservedRange; - })(); + /** + * 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 EnumDescriptorProto; + return OneofOptions; })(); - protobuf.EnumValueDescriptorProto = (function() { + protobuf.EnumOptions = (function() { /** - * Properties of an EnumValueDescriptorProto. + * Properties of an EnumOptions. * @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 + * @interface IEnumOptions + * @property {boolean|null} [allowAlias] EnumOptions allowAlias + * @property {boolean|null} [deprecated] EnumOptions deprecated + * @property {boolean|null} [deprecatedLegacyJsonFieldConflicts] EnumOptions deprecatedLegacyJsonFieldConflicts + * @property {Array.|null} [uninterpretedOption] EnumOptions uninterpretedOption */ /** - * Constructs a new EnumValueDescriptorProto. + * Constructs a new EnumOptions. * @memberof google.protobuf - * @classdesc Represents an EnumValueDescriptorProto. - * @implements IEnumValueDescriptorProto + * @classdesc Represents an EnumOptions. + * @implements IEnumOptions * @constructor - * @param {google.protobuf.IEnumValueDescriptorProto=} [properties] Properties to set + * @param {google.protobuf.IEnumOptions=} [properties] Properties to set */ - function EnumValueDescriptorProto(properties) { + function EnumOptions(properties) { + this.uninterpretedOption = []; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -16168,103 +34046,120 @@ } /** - * EnumValueDescriptorProto name. - * @member {string} name - * @memberof google.protobuf.EnumValueDescriptorProto + * EnumOptions allowAlias. + * @member {boolean} allowAlias + * @memberof google.protobuf.EnumOptions * @instance */ - EnumValueDescriptorProto.prototype.name = ""; + EnumOptions.prototype.allowAlias = false; /** - * EnumValueDescriptorProto number. - * @member {number} number - * @memberof google.protobuf.EnumValueDescriptorProto + * EnumOptions deprecated. + * @member {boolean} deprecated + * @memberof google.protobuf.EnumOptions * @instance */ - EnumValueDescriptorProto.prototype.number = 0; + EnumOptions.prototype.deprecated = false; /** - * EnumValueDescriptorProto options. - * @member {google.protobuf.IEnumValueOptions|null|undefined} options - * @memberof google.protobuf.EnumValueDescriptorProto + * EnumOptions deprecatedLegacyJsonFieldConflicts. + * @member {boolean} deprecatedLegacyJsonFieldConflicts + * @memberof google.protobuf.EnumOptions * @instance */ - EnumValueDescriptorProto.prototype.options = null; + EnumOptions.prototype.deprecatedLegacyJsonFieldConflicts = false; /** - * Creates a new EnumValueDescriptorProto instance using the specified properties. + * 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.EnumValueDescriptorProto + * @memberof google.protobuf.EnumOptions * @static - * @param {google.protobuf.IEnumValueDescriptorProto=} [properties] Properties to set - * @returns {google.protobuf.EnumValueDescriptorProto} EnumValueDescriptorProto instance + * @param {google.protobuf.IEnumOptions=} [properties] Properties to set + * @returns {google.protobuf.EnumOptions} EnumOptions instance */ - EnumValueDescriptorProto.create = function create(properties) { - return new EnumValueDescriptorProto(properties); + EnumOptions.create = function create(properties) { + return new EnumOptions(properties); }; /** - * Encodes the specified EnumValueDescriptorProto message. Does not implicitly {@link google.protobuf.EnumValueDescriptorProto.verify|verify} messages. + * Encodes the specified EnumOptions message. Does not implicitly {@link google.protobuf.EnumOptions.verify|verify} messages. * @function encode - * @memberof google.protobuf.EnumValueDescriptorProto + * @memberof google.protobuf.EnumOptions * @static - * @param {google.protobuf.IEnumValueDescriptorProto} message EnumValueDescriptorProto message or plain object to encode + * @param {google.protobuf.IEnumOptions} message EnumOptions message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - EnumValueDescriptorProto.encode = function encode(message, writer) { + EnumOptions.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(); + 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.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 EnumValueDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.EnumValueDescriptorProto.verify|verify} messages. + * Encodes the specified EnumOptions message, length delimited. Does not implicitly {@link google.protobuf.EnumOptions.verify|verify} messages. * @function encodeDelimited - * @memberof google.protobuf.EnumValueDescriptorProto + * @memberof google.protobuf.EnumOptions * @static - * @param {google.protobuf.IEnumValueDescriptorProto} message EnumValueDescriptorProto message or plain object to encode + * @param {google.protobuf.IEnumOptions} message EnumOptions message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - EnumValueDescriptorProto.encodeDelimited = function encodeDelimited(message, writer) { + EnumOptions.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes an EnumValueDescriptorProto message from the specified reader or buffer. + * Decodes an EnumOptions message from the specified reader or buffer. * @function decode - * @memberof google.protobuf.EnumValueDescriptorProto + * @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.EnumValueDescriptorProto} EnumValueDescriptorProto + * @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 */ - EnumValueDescriptorProto.decode = function decode(reader, length) { + EnumOptions.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.EnumValueDescriptorProto(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.EnumOptions(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: { - message.name = reader.string(); - break; - } case 2: { - message.number = reader.int32(); + message.allowAlias = reader.bool(); break; } case 3: { - message.options = $root.google.protobuf.EnumValueOptions.decode(reader, reader.uint32()); + message.deprecated = reader.bool(); + break; + } + case 6: { + message.deprecatedLegacyJsonFieldConflicts = 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: @@ -16276,147 +34171,167 @@ }; /** - * Decodes an EnumValueDescriptorProto message from the specified reader or buffer, length delimited. + * Decodes an EnumOptions message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.protobuf.EnumValueDescriptorProto + * @memberof google.protobuf.EnumOptions * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.EnumValueDescriptorProto} EnumValueDescriptorProto + * @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 */ - EnumValueDescriptorProto.decodeDelimited = function decodeDelimited(reader) { + EnumOptions.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies an EnumValueDescriptorProto message. + * Verifies an EnumOptions message. * @function verify - * @memberof google.protobuf.EnumValueDescriptorProto + * @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 */ - EnumValueDescriptorProto.verify = function verify(message) { + EnumOptions.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; + 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.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 EnumValueDescriptorProto message from a plain object. Also converts values to their respective internal types. + * Creates an EnumOptions message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.protobuf.EnumValueDescriptorProto + * @memberof google.protobuf.EnumOptions * @static * @param {Object.} object Plain object - * @returns {google.protobuf.EnumValueDescriptorProto} EnumValueDescriptorProto + * @returns {google.protobuf.EnumOptions} EnumOptions */ - EnumValueDescriptorProto.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.EnumValueDescriptorProto) + EnumOptions.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.EnumOptions) 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); + 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.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 EnumValueDescriptorProto message. Also converts values to other types if specified. + * Creates a plain object from an EnumOptions message. Also converts values to other types if specified. * @function toObject - * @memberof google.protobuf.EnumValueDescriptorProto + * @memberof google.protobuf.EnumOptions * @static - * @param {google.protobuf.EnumValueDescriptorProto} message EnumValueDescriptorProto + * @param {google.protobuf.EnumOptions} message EnumOptions * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - EnumValueDescriptorProto.toObject = function toObject(message, options) { + EnumOptions.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; + if (options.arrays || options.defaults) + object.uninterpretedOption = []; if (options.defaults) { - object.name = ""; - object.number = 0; - object.options = null; + object.allowAlias = false; + object.deprecated = false; + object.deprecatedLegacyJsonFieldConflicts = false; + } + 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.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.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. + * Converts this EnumOptions to JSON. * @function toJSON - * @memberof google.protobuf.EnumValueDescriptorProto + * @memberof google.protobuf.EnumOptions * @instance * @returns {Object.} JSON object */ - EnumValueDescriptorProto.prototype.toJSON = function toJSON() { + EnumOptions.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for EnumValueDescriptorProto + * Gets the default type url for EnumOptions * @function getTypeUrl - * @memberof google.protobuf.EnumValueDescriptorProto + * @memberof google.protobuf.EnumOptions * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - EnumValueDescriptorProto.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + EnumOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.protobuf.EnumValueDescriptorProto"; + return typeUrlPrefix + "/google.protobuf.EnumOptions"; }; - return EnumValueDescriptorProto; + return EnumOptions; })(); - protobuf.ServiceDescriptorProto = (function() { + protobuf.EnumValueOptions = (function() { /** - * Properties of a ServiceDescriptorProto. + * Properties of an EnumValueOptions. * @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 + * @interface IEnumValueOptions + * @property {boolean|null} [deprecated] EnumValueOptions deprecated + * @property {Array.|null} [uninterpretedOption] EnumValueOptions uninterpretedOption */ /** - * Constructs a new ServiceDescriptorProto. + * Constructs a new EnumValueOptions. * @memberof google.protobuf - * @classdesc Represents a ServiceDescriptorProto. - * @implements IServiceDescriptorProto + * @classdesc Represents an EnumValueOptions. + * @implements IEnumValueOptions * @constructor - * @param {google.protobuf.IServiceDescriptorProto=} [properties] Properties to set + * @param {google.protobuf.IEnumValueOptions=} [properties] Properties to set */ - function ServiceDescriptorProto(properties) { - this.method = []; + function EnumValueOptions(properties) { + this.uninterpretedOption = []; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -16424,106 +34339,92 @@ } /** - * ServiceDescriptorProto name. - * @member {string} name - * @memberof google.protobuf.ServiceDescriptorProto - * @instance - */ - ServiceDescriptorProto.prototype.name = ""; - - /** - * ServiceDescriptorProto method. - * @member {Array.} method - * @memberof google.protobuf.ServiceDescriptorProto + * EnumValueOptions deprecated. + * @member {boolean} deprecated + * @memberof google.protobuf.EnumValueOptions * @instance */ - ServiceDescriptorProto.prototype.method = $util.emptyArray; + EnumValueOptions.prototype.deprecated = false; /** - * ServiceDescriptorProto options. - * @member {google.protobuf.IServiceOptions|null|undefined} options - * @memberof google.protobuf.ServiceDescriptorProto + * EnumValueOptions uninterpretedOption. + * @member {Array.} uninterpretedOption + * @memberof google.protobuf.EnumValueOptions * @instance */ - ServiceDescriptorProto.prototype.options = null; + EnumValueOptions.prototype.uninterpretedOption = $util.emptyArray; /** - * Creates a new ServiceDescriptorProto instance using the specified properties. + * Creates a new EnumValueOptions instance using the specified properties. * @function create - * @memberof google.protobuf.ServiceDescriptorProto + * @memberof google.protobuf.EnumValueOptions * @static - * @param {google.protobuf.IServiceDescriptorProto=} [properties] Properties to set - * @returns {google.protobuf.ServiceDescriptorProto} ServiceDescriptorProto instance + * @param {google.protobuf.IEnumValueOptions=} [properties] Properties to set + * @returns {google.protobuf.EnumValueOptions} EnumValueOptions instance */ - ServiceDescriptorProto.create = function create(properties) { - return new ServiceDescriptorProto(properties); + EnumValueOptions.create = function create(properties) { + return new EnumValueOptions(properties); }; /** - * Encodes the specified ServiceDescriptorProto message. Does not implicitly {@link google.protobuf.ServiceDescriptorProto.verify|verify} messages. + * Encodes the specified EnumValueOptions message. Does not implicitly {@link google.protobuf.EnumValueOptions.verify|verify} messages. * @function encode - * @memberof google.protobuf.ServiceDescriptorProto + * @memberof google.protobuf.EnumValueOptions * @static - * @param {google.protobuf.IServiceDescriptorProto} message ServiceDescriptorProto message or plain object to encode + * @param {google.protobuf.IEnumValueOptions} message EnumValueOptions message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ServiceDescriptorProto.encode = function encode(message, writer) { + EnumValueOptions.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(); + if (message.deprecated != null && Object.hasOwnProperty.call(message, "deprecated")) + writer.uint32(/* id 1, wireType 0 =*/8).bool(message.deprecated); + 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 ServiceDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.ServiceDescriptorProto.verify|verify} messages. + * Encodes the specified EnumValueOptions message, length delimited. Does not implicitly {@link google.protobuf.EnumValueOptions.verify|verify} messages. * @function encodeDelimited - * @memberof google.protobuf.ServiceDescriptorProto + * @memberof google.protobuf.EnumValueOptions * @static - * @param {google.protobuf.IServiceDescriptorProto} message ServiceDescriptorProto message or plain object to encode + * @param {google.protobuf.IEnumValueOptions} message EnumValueOptions message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ServiceDescriptorProto.encodeDelimited = function encodeDelimited(message, writer) { + EnumValueOptions.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a ServiceDescriptorProto message from the specified reader or buffer. + * Decodes an EnumValueOptions message from the specified reader or buffer. * @function decode - * @memberof google.protobuf.ServiceDescriptorProto + * @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.ServiceDescriptorProto} ServiceDescriptorProto + * @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 */ - ServiceDescriptorProto.decode = function decode(reader, length) { + EnumValueOptions.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.ServiceDescriptorProto(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.EnumValueOptions(); while (reader.pos < end) { var tag = reader.uint32(); - 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())); + switch (tag >>> 3) { + case 1: { + message.deprecated = reader.bool(); break; } - case 3: { - message.options = $root.google.protobuf.ServiceOptions.decode(reader, reader.uint32()); + case 999: { + if (!(message.uninterpretedOption && message.uninterpretedOption.length)) + message.uninterpretedOption = []; + message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); break; } default: @@ -16535,167 +34436,152 @@ }; /** - * Decodes a ServiceDescriptorProto message from the specified reader or buffer, length delimited. + * Decodes an EnumValueOptions message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.protobuf.ServiceDescriptorProto + * @memberof google.protobuf.EnumValueOptions * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.ServiceDescriptorProto} ServiceDescriptorProto + * @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 */ - ServiceDescriptorProto.decodeDelimited = function decodeDelimited(reader) { + EnumValueOptions.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a ServiceDescriptorProto message. + * Verifies an EnumValueOptions message. * @function verify - * @memberof google.protobuf.ServiceDescriptorProto + * @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 */ - ServiceDescriptorProto.verify = function verify(message) { + EnumValueOptions.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 (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 "method." + error; + return "uninterpretedOption." + 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. + * Creates an EnumValueOptions message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.protobuf.ServiceDescriptorProto + * @memberof google.protobuf.EnumValueOptions * @static * @param {Object.} object Plain object - * @returns {google.protobuf.ServiceDescriptorProto} ServiceDescriptorProto + * @returns {google.protobuf.EnumValueOptions} EnumValueOptions */ - ServiceDescriptorProto.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.ServiceDescriptorProto) + EnumValueOptions.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.EnumValueOptions) 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]); + var message = new $root.google.protobuf.EnumValueOptions(); + if (object.deprecated != null) + message.deprecated = Boolean(object.deprecated); + 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]); } } - 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. + * Creates a plain object from an EnumValueOptions message. Also converts values to other types if specified. * @function toObject - * @memberof google.protobuf.ServiceDescriptorProto + * @memberof google.protobuf.EnumValueOptions * @static - * @param {google.protobuf.ServiceDescriptorProto} message ServiceDescriptorProto + * @param {google.protobuf.EnumValueOptions} message EnumValueOptions * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - ServiceDescriptorProto.toObject = function toObject(message, options) { + EnumValueOptions.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); + object.uninterpretedOption = []; + if (options.defaults) + object.deprecated = false; + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + object.deprecated = message.deprecated; + 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.options != null && message.hasOwnProperty("options")) - object.options = $root.google.protobuf.ServiceOptions.toObject(message.options, options); return object; }; /** - * Converts this ServiceDescriptorProto to JSON. + * Converts this EnumValueOptions to JSON. * @function toJSON - * @memberof google.protobuf.ServiceDescriptorProto + * @memberof google.protobuf.EnumValueOptions * @instance * @returns {Object.} JSON object */ - ServiceDescriptorProto.prototype.toJSON = function toJSON() { + EnumValueOptions.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for ServiceDescriptorProto + * Gets the default type url for EnumValueOptions * @function getTypeUrl - * @memberof google.protobuf.ServiceDescriptorProto + * @memberof google.protobuf.EnumValueOptions * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - ServiceDescriptorProto.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + EnumValueOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.protobuf.ServiceDescriptorProto"; + return typeUrlPrefix + "/google.protobuf.EnumValueOptions"; }; - return ServiceDescriptorProto; + return EnumValueOptions; })(); - protobuf.MethodDescriptorProto = (function() { + protobuf.ServiceOptions = (function() { /** - * Properties of a MethodDescriptorProto. + * Properties of a ServiceOptions. * @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 + * @interface IServiceOptions + * @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 */ /** - * Constructs a new MethodDescriptorProto. + * Constructs a new ServiceOptions. * @memberof google.protobuf - * @classdesc Represents a MethodDescriptorProto. - * @implements IMethodDescriptorProto + * @classdesc Represents a ServiceOptions. + * @implements IServiceOptions * @constructor - * @param {google.protobuf.IMethodDescriptorProto=} [properties] Properties to set + * @param {google.protobuf.IServiceOptions=} [properties] Properties to set */ - function MethodDescriptorProto(properties) { + function ServiceOptions(properties) { + this.uninterpretedOption = []; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -16703,145 +34589,120 @@ } /** - * 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 + * ServiceOptions deprecated. + * @member {boolean} deprecated + * @memberof google.protobuf.ServiceOptions * @instance */ - MethodDescriptorProto.prototype.outputType = ""; + ServiceOptions.prototype.deprecated = false; /** - * MethodDescriptorProto options. - * @member {google.protobuf.IMethodOptions|null|undefined} options - * @memberof google.protobuf.MethodDescriptorProto + * ServiceOptions uninterpretedOption. + * @member {Array.} uninterpretedOption + * @memberof google.protobuf.ServiceOptions * @instance */ - MethodDescriptorProto.prototype.options = null; + ServiceOptions.prototype.uninterpretedOption = $util.emptyArray; /** - * MethodDescriptorProto clientStreaming. - * @member {boolean} clientStreaming - * @memberof google.protobuf.MethodDescriptorProto + * ServiceOptions .google.api.defaultHost. + * @member {string} .google.api.defaultHost + * @memberof google.protobuf.ServiceOptions * @instance */ - MethodDescriptorProto.prototype.clientStreaming = false; + ServiceOptions.prototype[".google.api.defaultHost"] = ""; /** - * MethodDescriptorProto serverStreaming. - * @member {boolean} serverStreaming - * @memberof google.protobuf.MethodDescriptorProto + * ServiceOptions .google.api.oauthScopes. + * @member {string} .google.api.oauthScopes + * @memberof google.protobuf.ServiceOptions * @instance */ - MethodDescriptorProto.prototype.serverStreaming = false; + ServiceOptions.prototype[".google.api.oauthScopes"] = ""; /** - * Creates a new MethodDescriptorProto instance using the specified properties. + * Creates a new ServiceOptions instance using the specified properties. * @function create - * @memberof google.protobuf.MethodDescriptorProto + * @memberof google.protobuf.ServiceOptions * @static - * @param {google.protobuf.IMethodDescriptorProto=} [properties] Properties to set - * @returns {google.protobuf.MethodDescriptorProto} MethodDescriptorProto instance + * @param {google.protobuf.IServiceOptions=} [properties] Properties to set + * @returns {google.protobuf.ServiceOptions} ServiceOptions instance */ - MethodDescriptorProto.create = function create(properties) { - return new MethodDescriptorProto(properties); + ServiceOptions.create = function create(properties) { + return new ServiceOptions(properties); }; /** - * Encodes the specified MethodDescriptorProto message. Does not implicitly {@link google.protobuf.MethodDescriptorProto.verify|verify} messages. + * Encodes the specified ServiceOptions message. Does not implicitly {@link google.protobuf.ServiceOptions.verify|verify} messages. * @function encode - * @memberof google.protobuf.MethodDescriptorProto + * @memberof google.protobuf.ServiceOptions * @static - * @param {google.protobuf.IMethodDescriptorProto} message MethodDescriptorProto message or plain object to encode + * @param {google.protobuf.IServiceOptions} message ServiceOptions message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - MethodDescriptorProto.encode = function encode(message, writer) { + ServiceOptions.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); + if (message.deprecated != null && Object.hasOwnProperty.call(message, "deprecated")) + writer.uint32(/* id 33, wireType 0 =*/264).bool(message.deprecated); + 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"]); return writer; }; /** - * Encodes the specified MethodDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.MethodDescriptorProto.verify|verify} messages. + * Encodes the specified ServiceOptions message, length delimited. Does not implicitly {@link google.protobuf.ServiceOptions.verify|verify} messages. * @function encodeDelimited - * @memberof google.protobuf.MethodDescriptorProto + * @memberof google.protobuf.ServiceOptions * @static - * @param {google.protobuf.IMethodDescriptorProto} message MethodDescriptorProto message or plain object to encode + * @param {google.protobuf.IServiceOptions} message ServiceOptions message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - MethodDescriptorProto.encodeDelimited = function encodeDelimited(message, writer) { + ServiceOptions.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a MethodDescriptorProto message from the specified reader or buffer. + * Decodes a ServiceOptions message from the specified reader or buffer. * @function decode - * @memberof google.protobuf.MethodDescriptorProto + * @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.MethodDescriptorProto} MethodDescriptorProto + * @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 */ - MethodDescriptorProto.decode = function decode(reader, length) { + ServiceOptions.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.MethodDescriptorProto(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.ServiceOptions(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: { - message.name = reader.string(); - break; - } - case 2: { - message.inputType = reader.string(); - break; - } - case 3: { - message.outputType = reader.string(); + case 33: { + message.deprecated = reader.bool(); break; } - case 4: { - message.options = $root.google.protobuf.MethodOptions.decode(reader, reader.uint32()); + case 999: { + if (!(message.uninterpretedOption && message.uninterpretedOption.length)) + message.uninterpretedOption = []; + message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); break; } - case 5: { - message.clientStreaming = reader.bool(); + case 1049: { + message[".google.api.defaultHost"] = reader.string(); break; } - case 6: { - message.serverStreaming = reader.bool(); + case 1050: { + message[".google.api.oauthScopes"] = reader.string(); break; } default: @@ -16853,191 +34714,172 @@ }; /** - * Decodes a MethodDescriptorProto message from the specified reader or buffer, length delimited. + * Decodes a ServiceOptions message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.protobuf.MethodDescriptorProto + * @memberof google.protobuf.ServiceOptions * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.MethodDescriptorProto} MethodDescriptorProto + * @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 */ - MethodDescriptorProto.decodeDelimited = function decodeDelimited(reader) { + ServiceOptions.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a MethodDescriptorProto message. + * Verifies a ServiceOptions message. * @function verify - * @memberof google.protobuf.MethodDescriptorProto + * @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 */ - MethodDescriptorProto.verify = function verify(message) { + ServiceOptions.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.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.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"; + 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"; return null; }; /** - * Creates a MethodDescriptorProto message from a plain object. Also converts values to their respective internal types. + * Creates a ServiceOptions message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.protobuf.MethodDescriptorProto + * @memberof google.protobuf.ServiceOptions * @static * @param {Object.} object Plain object - * @returns {google.protobuf.MethodDescriptorProto} MethodDescriptorProto + * @returns {google.protobuf.ServiceOptions} ServiceOptions */ - MethodDescriptorProto.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.MethodDescriptorProto) + ServiceOptions.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.ServiceOptions) 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); + var message = new $root.google.protobuf.ServiceOptions(); + 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.clientStreaming != null) - message.clientStreaming = Boolean(object.clientStreaming); - if (object.serverStreaming != null) - message.serverStreaming = Boolean(object.serverStreaming); + 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"]); return message; }; /** - * Creates a plain object from a MethodDescriptorProto message. Also converts values to other types if specified. + * Creates a plain object from a ServiceOptions message. Also converts values to other types if specified. * @function toObject - * @memberof google.protobuf.MethodDescriptorProto + * @memberof google.protobuf.ServiceOptions * @static - * @param {google.protobuf.MethodDescriptorProto} message MethodDescriptorProto + * @param {google.protobuf.ServiceOptions} message ServiceOptions * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - MethodDescriptorProto.toObject = function toObject(message, options) { + ServiceOptions.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; + if (options.arrays || options.defaults) + object.uninterpretedOption = []; if (options.defaults) { - object.name = ""; - object.inputType = ""; - object.outputType = ""; - object.options = null; - object.clientStreaming = false; - object.serverStreaming = false; + object.deprecated = false; + object[".google.api.defaultHost"] = ""; + object[".google.api.oauthScopes"] = ""; } - 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; + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + object.deprecated = message.deprecated; + 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"]; return object; }; /** - * Converts this MethodDescriptorProto to JSON. + * Converts this ServiceOptions to JSON. * @function toJSON - * @memberof google.protobuf.MethodDescriptorProto + * @memberof google.protobuf.ServiceOptions * @instance * @returns {Object.} JSON object */ - MethodDescriptorProto.prototype.toJSON = function toJSON() { + ServiceOptions.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for MethodDescriptorProto + * Gets the default type url for ServiceOptions * @function getTypeUrl - * @memberof google.protobuf.MethodDescriptorProto + * @memberof google.protobuf.ServiceOptions * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - MethodDescriptorProto.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + ServiceOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.protobuf.MethodDescriptorProto"; + return typeUrlPrefix + "/google.protobuf.ServiceOptions"; }; - return MethodDescriptorProto; + return ServiceOptions; })(); - protobuf.FileOptions = (function() { + protobuf.MethodOptions = (function() { /** - * Properties of a FileOptions. + * Properties of a MethodOptions. * @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} [phpGenericServices] FileOptions phpGenericServices - * @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 {Array.|null} [uninterpretedOption] FileOptions uninterpretedOption - * @property {Array.|null} [".google.api.resourceDefinition"] FileOptions .google.api.resourceDefinition + * @interface IMethodOptions + * @property {boolean|null} [deprecated] MethodOptions deprecated + * @property {google.protobuf.MethodOptions.IdempotencyLevel|null} [idempotencyLevel] MethodOptions idempotencyLevel + * @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 FileOptions. + * Constructs a new MethodOptions. * @memberof google.protobuf - * @classdesc Represents a FileOptions. - * @implements IFileOptions + * @classdesc Represents a MethodOptions. + * @implements IMethodOptions * @constructor - * @param {google.protobuf.IFileOptions=} [properties] Properties to set + * @param {google.protobuf.IMethodOptions=} [properties] Properties to set */ - function FileOptions(properties) { + function MethodOptions(properties) { this.uninterpretedOption = []; - this[".google.api.resourceDefinition"] = []; + this[".google.api.methodSignature"] = []; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -17045,375 +34887,570 @@ } /** - * FileOptions javaPackage. - * @member {string} javaPackage - * @memberof google.protobuf.FileOptions + * 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 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 */ - FileOptions.prototype.javaPackage = ""; + MethodOptions.prototype[".google.api.methodSignature"] = $util.emptyArray; /** - * FileOptions javaOuterClassname. - * @member {string} javaOuterClassname - * @memberof google.protobuf.FileOptions + * MethodOptions .google.longrunning.operationInfo. + * @member {google.longrunning.IOperationInfo|null|undefined} .google.longrunning.operationInfo + * @memberof google.protobuf.MethodOptions * @instance */ - FileOptions.prototype.javaOuterClassname = ""; + MethodOptions.prototype[".google.longrunning.operationInfo"] = null; /** - * FileOptions javaMultipleFiles. - * @member {boolean} javaMultipleFiles - * @memberof google.protobuf.FileOptions - * @instance + * 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 */ - FileOptions.prototype.javaMultipleFiles = false; + MethodOptions.create = function create(properties) { + return new MethodOptions(properties); + }; /** - * FileOptions javaGenerateEqualsAndHash. - * @member {boolean} javaGenerateEqualsAndHash - * @memberof google.protobuf.FileOptions - * @instance + * 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 */ - FileOptions.prototype.javaGenerateEqualsAndHash = false; + 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.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; + }; /** - * FileOptions javaStringCheckUtf8. - * @member {boolean} javaStringCheckUtf8 - * @memberof google.protobuf.FileOptions - * @instance + * 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 */ - FileOptions.prototype.javaStringCheckUtf8 = false; + MethodOptions.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; /** - * FileOptions optimizeFor. - * @member {google.protobuf.FileOptions.OptimizeMode} optimizeFor - * @memberof google.protobuf.FileOptions - * @instance + * 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 */ - FileOptions.prototype.optimizeFor = 1; + MethodOptions.decode = function decode(reader, length) { + 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(); + switch (tag >>> 3) { + case 33: { + message.deprecated = reader.bool(); + break; + } + case 34: { + message.idempotencyLevel = reader.int32(); + 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; + }; /** - * FileOptions goPackage. - * @member {string} goPackage - * @memberof google.protobuf.FileOptions - * @instance + * 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 */ - FileOptions.prototype.goPackage = ""; + MethodOptions.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; /** - * FileOptions ccGenericServices. - * @member {boolean} ccGenericServices - * @memberof google.protobuf.FileOptions - * @instance + * 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 */ - FileOptions.prototype.ccGenericServices = false; + 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.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; + }; /** - * FileOptions javaGenericServices. - * @member {boolean} javaGenericServices - * @memberof google.protobuf.FileOptions - * @instance + * 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 */ - FileOptions.prototype.javaGenericServices = false; + 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.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; + }; /** - * FileOptions pyGenericServices. - * @member {boolean} pyGenericServices - * @memberof google.protobuf.FileOptions - * @instance + * 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 */ - FileOptions.prototype.pyGenericServices = false; + 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[".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.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; + }; /** - * FileOptions phpGenericServices. - * @member {boolean} phpGenericServices - * @memberof google.protobuf.FileOptions + * Converts this MethodOptions to JSON. + * @function toJSON + * @memberof google.protobuf.MethodOptions * @instance + * @returns {Object.} JSON object */ - FileOptions.prototype.phpGenericServices = false; + MethodOptions.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; /** - * FileOptions deprecated. - * @member {boolean} deprecated - * @memberof google.protobuf.FileOptions - * @instance + * 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 */ - FileOptions.prototype.deprecated = false; + MethodOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.MethodOptions"; + }; /** - * FileOptions ccEnableArenas. - * @member {boolean} ccEnableArenas - * @memberof google.protobuf.FileOptions - * @instance + * 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 */ - FileOptions.prototype.ccEnableArenas = true; + 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; + })(); - /** - * FileOptions objcClassPrefix. - * @member {string} objcClassPrefix - * @memberof google.protobuf.FileOptions - * @instance - */ - FileOptions.prototype.objcClassPrefix = ""; + return MethodOptions; + })(); + + protobuf.UninterpretedOption = (function() { /** - * FileOptions csharpNamespace. - * @member {string} csharpNamespace - * @memberof google.protobuf.FileOptions - * @instance + * 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 */ - FileOptions.prototype.csharpNamespace = ""; /** - * FileOptions swiftPrefix. - * @member {string} swiftPrefix - * @memberof google.protobuf.FileOptions - * @instance + * Constructs a new UninterpretedOption. + * @memberof google.protobuf + * @classdesc Represents an UninterpretedOption. + * @implements IUninterpretedOption + * @constructor + * @param {google.protobuf.IUninterpretedOption=} [properties] Properties to set */ - FileOptions.prototype.swiftPrefix = ""; + 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]]; + } /** - * FileOptions phpClassPrefix. - * @member {string} phpClassPrefix - * @memberof google.protobuf.FileOptions + * UninterpretedOption name. + * @member {Array.} name + * @memberof google.protobuf.UninterpretedOption * @instance */ - FileOptions.prototype.phpClassPrefix = ""; + UninterpretedOption.prototype.name = $util.emptyArray; /** - * FileOptions phpNamespace. - * @member {string} phpNamespace - * @memberof google.protobuf.FileOptions + * UninterpretedOption identifierValue. + * @member {string} identifierValue + * @memberof google.protobuf.UninterpretedOption * @instance */ - FileOptions.prototype.phpNamespace = ""; + UninterpretedOption.prototype.identifierValue = ""; /** - * FileOptions phpMetadataNamespace. - * @member {string} phpMetadataNamespace - * @memberof google.protobuf.FileOptions + * UninterpretedOption positiveIntValue. + * @member {number|Long} positiveIntValue + * @memberof google.protobuf.UninterpretedOption * @instance */ - FileOptions.prototype.phpMetadataNamespace = ""; + UninterpretedOption.prototype.positiveIntValue = $util.Long ? $util.Long.fromBits(0,0,true) : 0; /** - * FileOptions rubyPackage. - * @member {string} rubyPackage - * @memberof google.protobuf.FileOptions + * UninterpretedOption negativeIntValue. + * @member {number|Long} negativeIntValue + * @memberof google.protobuf.UninterpretedOption * @instance */ - FileOptions.prototype.rubyPackage = ""; + UninterpretedOption.prototype.negativeIntValue = $util.Long ? $util.Long.fromBits(0,0,false) : 0; /** - * FileOptions uninterpretedOption. - * @member {Array.} uninterpretedOption - * @memberof google.protobuf.FileOptions + * UninterpretedOption doubleValue. + * @member {number} doubleValue + * @memberof google.protobuf.UninterpretedOption * @instance */ - FileOptions.prototype.uninterpretedOption = $util.emptyArray; + UninterpretedOption.prototype.doubleValue = 0; /** - * FileOptions .google.api.resourceDefinition. - * @member {Array.} .google.api.resourceDefinition - * @memberof google.protobuf.FileOptions + * UninterpretedOption stringValue. + * @member {Uint8Array} stringValue + * @memberof google.protobuf.UninterpretedOption * @instance */ - FileOptions.prototype[".google.api.resourceDefinition"] = $util.emptyArray; + UninterpretedOption.prototype.stringValue = $util.newBuffer([]); /** - * 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 + * UninterpretedOption aggregateValue. + * @member {string} aggregateValue + * @memberof google.protobuf.UninterpretedOption + * @instance */ - FileOptions.create = function create(properties) { - return new FileOptions(properties); - }; + UninterpretedOption.prototype.aggregateValue = ""; /** - * 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.phpGenericServices != null && Object.hasOwnProperty.call(message, "phpGenericServices")) - writer.uint32(/* id 42, wireType 0 =*/336).bool(message.phpGenericServices); - 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.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(); + * 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 FileOptions message, length delimited. Does not implicitly {@link google.protobuf.FileOptions.verify|verify} messages. + * Encodes the specified UninterpretedOption message, length delimited. Does not implicitly {@link google.protobuf.UninterpretedOption.verify|verify} messages. * @function encodeDelimited - * @memberof google.protobuf.FileOptions + * @memberof google.protobuf.UninterpretedOption * @static - * @param {google.protobuf.IFileOptions} message FileOptions message or plain object to encode + * @param {google.protobuf.IUninterpretedOption} message UninterpretedOption message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - FileOptions.encodeDelimited = function encodeDelimited(message, writer) { + UninterpretedOption.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a FileOptions message from the specified reader or buffer. + * Decodes an UninterpretedOption message from the specified reader or buffer. * @function decode - * @memberof google.protobuf.FileOptions + * @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.FileOptions} FileOptions + * @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 */ - FileOptions.decode = function decode(reader, length) { + UninterpretedOption.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.FileOptions(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.UninterpretedOption(); while (reader.pos < end) { var tag = reader.uint32(); 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 42: { - message.phpGenericServices = 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(); + case 2: { + if (!(message.name && message.name.length)) + message.name = []; + message.name.push($root.google.protobuf.UninterpretedOption.NamePart.decode(reader, reader.uint32())); break; } - case 40: { - message.phpClassPrefix = reader.string(); + case 3: { + message.identifierValue = reader.string(); break; } - case 41: { - message.phpNamespace = reader.string(); + case 4: { + message.positiveIntValue = reader.uint64(); break; } - case 44: { - message.phpMetadataNamespace = reader.string(); + case 5: { + message.negativeIntValue = reader.int64(); break; } - case 45: { - message.rubyPackage = reader.string(); + case 6: { + message.doubleValue = reader.double(); break; } - case 999: { - if (!(message.uninterpretedOption && message.uninterpretedOption.length)) - message.uninterpretedOption = []; - message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); + case 7: { + message.stringValue = reader.bytes(); 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())); + case 8: { + message.aggregateValue = reader.string(); break; } default: @@ -17425,374 +35462,454 @@ }; /** - * Decodes a FileOptions message from the specified reader or buffer, length delimited. + * Decodes an UninterpretedOption 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.phpGenericServices != null && message.hasOwnProperty("phpGenericServices")) - if (typeof message.phpGenericServices !== "boolean") - return "phpGenericServices: 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.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]); + * @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 ".google.api.resourceDefinition." + 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 a FileOptions message from a plain object. Also converts values to their respective internal types. + * Creates an UninterpretedOption message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.protobuf.FileOptions + * @memberof google.protobuf.UninterpretedOption * @static * @param {Object.} object Plain object - * @returns {google.protobuf.FileOptions} FileOptions + * @returns {google.protobuf.UninterpretedOption} UninterpretedOption */ - FileOptions.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.FileOptions) + UninterpretedOption.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.UninterpretedOption) 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.phpGenericServices != null) - message.phpGenericServices = Boolean(object.phpGenericServices); - 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.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]); + 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 a FileOptions message. Also converts values to other types if specified. + * Creates a plain object from an UninterpretedOption message. Also converts values to other types if specified. * @function toObject - * @memberof google.protobuf.FileOptions + * @memberof google.protobuf.UninterpretedOption * @static - * @param {google.protobuf.FileOptions} message FileOptions + * @param {google.protobuf.UninterpretedOption} message UninterpretedOption * @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.phpGenericServices = false; - object.phpMetadataNamespace = ""; - object.rubyPackage = ""; - } - 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.phpGenericServices != null && message.hasOwnProperty("phpGenericServices")) - object.phpGenericServices = message.phpGenericServices; - if (message.phpMetadataNamespace != null && message.hasOwnProperty("phpMetadataNamespace")) - object.phpMetadataNamespace = message.phpMetadataNamespace; - if (message.rubyPackage != null && message.hasOwnProperty("rubyPackage")) - object.rubyPackage = message.rubyPackage; - 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); + * @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[".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); + 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 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); - }; + /** + * 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) { + 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(); + 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 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"; - }; + /** + * 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"; + }; - /** - * 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 NamePart; })(); - return FileOptions; + return UninterpretedOption; })(); - protobuf.MessageOptions = (function() { + protobuf.SourceCodeInfo = (function() { /** - * Properties of a MessageOptions. + * Properties of a SourceCodeInfo. * @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 {Array.|null} [uninterpretedOption] MessageOptions uninterpretedOption - * @property {google.api.IResourceDescriptor|null} [".google.api.resource"] MessageOptions .google.api.resource + * @interface ISourceCodeInfo + * @property {Array.|null} [location] SourceCodeInfo location */ /** - * Constructs a new MessageOptions. + * Constructs a new SourceCodeInfo. * @memberof google.protobuf - * @classdesc Represents a MessageOptions. - * @implements IMessageOptions + * @classdesc Represents a SourceCodeInfo. + * @implements ISourceCodeInfo * @constructor - * @param {google.protobuf.IMessageOptions=} [properties] Properties to set + * @param {google.protobuf.ISourceCodeInfo=} [properties] Properties to set */ - function MessageOptions(properties) { - this.uninterpretedOption = []; + function SourceCodeInfo(properties) { + this.location = []; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -17800,162 +35917,78 @@ } /** - * 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 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 + * SourceCodeInfo location. + * @member {Array.} location + * @memberof google.protobuf.SourceCodeInfo * @instance */ - MessageOptions.prototype[".google.api.resource"] = null; + SourceCodeInfo.prototype.location = $util.emptyArray; /** - * Creates a new MessageOptions instance using the specified properties. + * Creates a new SourceCodeInfo instance using the specified properties. * @function create - * @memberof google.protobuf.MessageOptions + * @memberof google.protobuf.SourceCodeInfo * @static - * @param {google.protobuf.IMessageOptions=} [properties] Properties to set - * @returns {google.protobuf.MessageOptions} MessageOptions instance + * @param {google.protobuf.ISourceCodeInfo=} [properties] Properties to set + * @returns {google.protobuf.SourceCodeInfo} SourceCodeInfo instance */ - MessageOptions.create = function create(properties) { - return new MessageOptions(properties); + SourceCodeInfo.create = function create(properties) { + return new SourceCodeInfo(properties); }; /** - * Encodes the specified MessageOptions message. Does not implicitly {@link google.protobuf.MessageOptions.verify|verify} messages. + * Encodes the specified SourceCodeInfo message. Does not implicitly {@link google.protobuf.SourceCodeInfo.verify|verify} messages. * @function encode - * @memberof google.protobuf.MessageOptions + * @memberof google.protobuf.SourceCodeInfo * @static - * @param {google.protobuf.IMessageOptions} message MessageOptions message or plain object to encode + * @param {google.protobuf.ISourceCodeInfo} message SourceCodeInfo message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - MessageOptions.encode = function encode(message, writer) { + SourceCodeInfo.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.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(); + 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 MessageOptions message, length delimited. Does not implicitly {@link google.protobuf.MessageOptions.verify|verify} messages. + * Encodes the specified SourceCodeInfo message, length delimited. Does not implicitly {@link google.protobuf.SourceCodeInfo.verify|verify} messages. * @function encodeDelimited - * @memberof google.protobuf.MessageOptions + * @memberof google.protobuf.SourceCodeInfo * @static - * @param {google.protobuf.IMessageOptions} message MessageOptions message or plain object to encode + * @param {google.protobuf.ISourceCodeInfo} message SourceCodeInfo message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - MessageOptions.encodeDelimited = function encodeDelimited(message, writer) { + SourceCodeInfo.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a MessageOptions message from the specified reader or buffer. + * Decodes a SourceCodeInfo message from the specified reader or buffer. * @function decode - * @memberof google.protobuf.MessageOptions + * @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.MessageOptions} MessageOptions + * @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 */ - MessageOptions.decode = function decode(reader, length) { + SourceCodeInfo.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.MessageOptions(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.SourceCodeInfo(); while (reader.pos < end) { var tag = reader.uint32(); 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 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()); + if (!(message.location && message.location.length)) + message.location = []; + message.location.push($root.google.protobuf.SourceCodeInfo.Location.decode(reader, reader.uint32())); break; } default: @@ -17967,466 +36000,581 @@ }; /** - * Decodes a MessageOptions message from the specified reader or buffer, length delimited. + * Decodes a SourceCodeInfo message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.protobuf.MessageOptions + * @memberof google.protobuf.SourceCodeInfo * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.MessageOptions} MessageOptions + * @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 */ - MessageOptions.decodeDelimited = function decodeDelimited(reader) { + SourceCodeInfo.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a MessageOptions message. + * Verifies a SourceCodeInfo message. * @function verify - * @memberof google.protobuf.MessageOptions + * @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 */ - MessageOptions.verify = function verify(message) { + SourceCodeInfo.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.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 (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 "uninterpretedOption." + error; + return "location." + 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. + * Creates a SourceCodeInfo message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.protobuf.MessageOptions + * @memberof google.protobuf.SourceCodeInfo * @static * @param {Object.} object Plain object - * @returns {google.protobuf.MessageOptions} MessageOptions + * @returns {google.protobuf.SourceCodeInfo} SourceCodeInfo */ - MessageOptions.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.MessageOptions) + SourceCodeInfo.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.SourceCodeInfo) 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.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]); + 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]); } } - 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. + * Creates a plain object from a SourceCodeInfo message. Also converts values to other types if specified. * @function toObject - * @memberof google.protobuf.MessageOptions + * @memberof google.protobuf.SourceCodeInfo * @static - * @param {google.protobuf.MessageOptions} message MessageOptions + * @param {google.protobuf.SourceCodeInfo} message SourceCodeInfo * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - MessageOptions.toObject = function toObject(message, options) { + SourceCodeInfo.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[".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.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); + 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); } - 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. + * Converts this SourceCodeInfo to JSON. * @function toJSON - * @memberof google.protobuf.MessageOptions + * @memberof google.protobuf.SourceCodeInfo * @instance * @returns {Object.} JSON object */ - MessageOptions.prototype.toJSON = function toJSON() { + SourceCodeInfo.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for MessageOptions + * Gets the default type url for SourceCodeInfo * @function getTypeUrl - * @memberof google.protobuf.MessageOptions + * @memberof google.protobuf.SourceCodeInfo * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - MessageOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + SourceCodeInfo.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.protobuf.MessageOptions"; + return typeUrlPrefix + "/google.protobuf.SourceCodeInfo"; }; - return MessageOptions; - })(); + SourceCodeInfo.Location = (function() { - protobuf.FieldOptions = (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 + */ - /** - * 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 {google.protobuf.FieldOptions.OptionTargetType|null} [target] FieldOptions target - * @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 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; + }; - /** - * 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.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]]; - } + /** + * 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(); + }; - /** - * FieldOptions ctype. - * @member {google.protobuf.FieldOptions.CType} ctype - * @memberof google.protobuf.FieldOptions - * @instance - */ - FieldOptions.prototype.ctype = 0; + /** + * 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) { + 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(); + 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; + }; - /** - * FieldOptions packed. - * @member {boolean} packed - * @memberof google.protobuf.FieldOptions - * @instance - */ - FieldOptions.prototype.packed = false; + /** + * 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()); + }; - /** - * FieldOptions jstype. - * @member {google.protobuf.FieldOptions.JSType} jstype - * @memberof google.protobuf.FieldOptions - * @instance - */ - FieldOptions.prototype.jstype = 0; + /** + * 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; + }; - /** - * FieldOptions lazy. - * @member {boolean} lazy - * @memberof google.protobuf.FieldOptions - * @instance - */ - FieldOptions.prototype.lazy = false; + /** + * 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; + }; - /** - * FieldOptions unverifiedLazy. - * @member {boolean} unverifiedLazy - * @memberof google.protobuf.FieldOptions - * @instance - */ - FieldOptions.prototype.unverifiedLazy = false; + /** + * 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; + }; - /** - * FieldOptions deprecated. - * @member {boolean} deprecated - * @memberof google.protobuf.FieldOptions - * @instance - */ - FieldOptions.prototype.deprecated = false; + /** + * 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); + }; - /** - * FieldOptions weak. - * @member {boolean} weak - * @memberof google.protobuf.FieldOptions - * @instance - */ - FieldOptions.prototype.weak = false; + /** + * 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"; + }; - /** - * FieldOptions debugRedact. - * @member {boolean} debugRedact - * @memberof google.protobuf.FieldOptions - * @instance - */ - FieldOptions.prototype.debugRedact = false; + return Location; + })(); - /** - * FieldOptions retention. - * @member {google.protobuf.FieldOptions.OptionRetention} retention - * @memberof google.protobuf.FieldOptions - * @instance - */ - FieldOptions.prototype.retention = 0; + return SourceCodeInfo; + })(); - /** - * FieldOptions target. - * @member {google.protobuf.FieldOptions.OptionTargetType} target - * @memberof google.protobuf.FieldOptions - * @instance - */ - FieldOptions.prototype.target = 0; + protobuf.GeneratedCodeInfo = (function() { /** - * FieldOptions uninterpretedOption. - * @member {Array.} uninterpretedOption - * @memberof google.protobuf.FieldOptions - * @instance + * Properties of a GeneratedCodeInfo. + * @memberof google.protobuf + * @interface IGeneratedCodeInfo + * @property {Array.|null} [annotation] GeneratedCodeInfo annotation */ - FieldOptions.prototype.uninterpretedOption = $util.emptyArray; /** - * FieldOptions .google.api.fieldBehavior. - * @member {Array.} .google.api.fieldBehavior - * @memberof google.protobuf.FieldOptions - * @instance + * Constructs a new GeneratedCodeInfo. + * @memberof google.protobuf + * @classdesc Represents a GeneratedCodeInfo. + * @implements IGeneratedCodeInfo + * @constructor + * @param {google.protobuf.IGeneratedCodeInfo=} [properties] Properties to set */ - FieldOptions.prototype[".google.api.fieldBehavior"] = $util.emptyArray; + 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]]; + } /** - * FieldOptions .google.api.resourceReference. - * @member {google.api.IResourceReference|null|undefined} .google.api.resourceReference - * @memberof google.protobuf.FieldOptions + * GeneratedCodeInfo annotation. + * @member {Array.} annotation + * @memberof google.protobuf.GeneratedCodeInfo * @instance */ - FieldOptions.prototype[".google.api.resourceReference"] = null; + GeneratedCodeInfo.prototype.annotation = $util.emptyArray; /** - * Creates a new FieldOptions instance using the specified properties. + * Creates a new GeneratedCodeInfo instance using the specified properties. * @function create - * @memberof google.protobuf.FieldOptions + * @memberof google.protobuf.GeneratedCodeInfo * @static - * @param {google.protobuf.IFieldOptions=} [properties] Properties to set - * @returns {google.protobuf.FieldOptions} FieldOptions instance + * @param {google.protobuf.IGeneratedCodeInfo=} [properties] Properties to set + * @returns {google.protobuf.GeneratedCodeInfo} GeneratedCodeInfo instance */ - FieldOptions.create = function create(properties) { - return new FieldOptions(properties); + GeneratedCodeInfo.create = function create(properties) { + return new GeneratedCodeInfo(properties); }; /** - * Encodes the specified FieldOptions message. Does not implicitly {@link google.protobuf.FieldOptions.verify|verify} messages. + * Encodes the specified GeneratedCodeInfo message. Does not implicitly {@link google.protobuf.GeneratedCodeInfo.verify|verify} messages. * @function encode - * @memberof google.protobuf.FieldOptions + * @memberof google.protobuf.GeneratedCodeInfo * @static - * @param {google.protobuf.IFieldOptions} message FieldOptions message or plain object to encode + * @param {google.protobuf.IGeneratedCodeInfo} message GeneratedCodeInfo message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - FieldOptions.encode = function encode(message, writer) { + GeneratedCodeInfo.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.target != null && Object.hasOwnProperty.call(message, "target")) - writer.uint32(/* id 18, wireType 0 =*/144).int32(message.target); - 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) { - writer.uint32(/* id 1052, wireType 2 =*/8418).fork(); - for (var i = 0; i < message[".google.api.fieldBehavior"].length; ++i) - writer.int32(message[".google.api.fieldBehavior"][i]); - writer.ldelim(); - } - 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.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 FieldOptions message, length delimited. Does not implicitly {@link google.protobuf.FieldOptions.verify|verify} messages. + * Encodes the specified GeneratedCodeInfo message, length delimited. Does not implicitly {@link google.protobuf.GeneratedCodeInfo.verify|verify} messages. * @function encodeDelimited - * @memberof google.protobuf.FieldOptions + * @memberof google.protobuf.GeneratedCodeInfo * @static - * @param {google.protobuf.IFieldOptions} message FieldOptions message or plain object to encode + * @param {google.protobuf.IGeneratedCodeInfo} message GeneratedCodeInfo message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - FieldOptions.encodeDelimited = function encodeDelimited(message, writer) { + GeneratedCodeInfo.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a FieldOptions message from the specified reader or buffer. + * Decodes a GeneratedCodeInfo message from the specified reader or buffer. * @function decode - * @memberof google.protobuf.FieldOptions + * @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.FieldOptions} FieldOptions + * @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 */ - FieldOptions.decode = function decode(reader, length) { + GeneratedCodeInfo.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.FieldOptions(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.GeneratedCodeInfo(); while (reader.pos < end) { var tag = reader.uint32(); 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 18: { - message.target = reader.int32(); - 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()); + if (!(message.annotation && message.annotation.length)) + message.annotation = []; + message.annotation.push($root.google.protobuf.GeneratedCodeInfo.Annotation.decode(reader, reader.uint32())); break; } default: @@ -18438,514 +36586,501 @@ }; /** - * Decodes a FieldOptions message from the specified reader or buffer, length delimited. + * Decodes a GeneratedCodeInfo message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.protobuf.FieldOptions + * @memberof google.protobuf.GeneratedCodeInfo * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.FieldOptions} FieldOptions + * @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 */ - FieldOptions.decodeDelimited = function decodeDelimited(reader) { + GeneratedCodeInfo.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a FieldOptions message. + * Verifies a GeneratedCodeInfo message. * @function verify - * @memberof google.protobuf.FieldOptions + * @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 */ - FieldOptions.verify = function verify(message) { + GeneratedCodeInfo.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.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; } - if (message.target != null && message.hasOwnProperty("target")) - switch (message.target) { - default: - return "target: enum value expected"; - case 0: - case 1: - case 2: - case 3: - case 4: - case 5: - case 6: - case 7: - case 8: - case 9: - break; + } + 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]); } - 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 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[".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]) { + 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) { + 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(); + 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: - return ".google.api.fieldBehavior: enum value[] expected"; - case 0: - case 1: - case 2: - case 3: - case 4: - case 5: - case 6: - case 7: + reader.skipType(tag & 7); 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; - } - switch (object.target) { - default: - if (typeof object.target === "number") { - message.target = object.target; - break; } - break; - case "TARGET_TYPE_UNKNOWN": - case 0: - message.target = 0; - break; - case "TARGET_TYPE_FILE": - case 1: - message.target = 1; - break; - case "TARGET_TYPE_EXTENSION_RANGE": - case 2: - message.target = 2; - break; - case "TARGET_TYPE_MESSAGE": - case 3: - message.target = 3; - break; - case "TARGET_TYPE_FIELD": - case 4: - message.target = 4; - break; - case "TARGET_TYPE_ONEOF": - case 5: - message.target = 5; - break; - case "TARGET_TYPE_ENUM": - case 6: - message.target = 6; - break; - case "TARGET_TYPE_ENUM_ENTRY": - case 7: - message.target = 7; - break; - case "TARGET_TYPE_SERVICE": - case 8: - message.target = 8; - break; - case "TARGET_TYPE_METHOD": - case 9: - message.target = 9; - break; - } - 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]); + 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 (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]) { + 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: - if (typeof object[".google.api.fieldBehavior"][i] === "number") { - message[".google.api.fieldBehavior"][i] = object[".google.api.fieldBehavior"][i]; - break; - } - case "FIELD_BEHAVIOR_UNSPECIFIED": + return "semantic: enum value expected"; 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; } - } - 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.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.target = options.enums === String ? "TARGET_TYPE_UNKNOWN" : 0; - 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.target != null && message.hasOwnProperty("target")) - object.target = options.enums === String ? $root.google.protobuf.FieldOptions.OptionTargetType[message.target] === undefined ? message.target : $root.google.protobuf.FieldOptions.OptionTargetType[message.target] : message.target; - 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); - }; + return null; + }; - /** - * 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"; - }; + /** + * 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; + }; - /** - * 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; - })(); + /** + * 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; + }; - /** - * 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; - })(); + /** + * 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); + }; - /** - * 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; - })(); + /** + * 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"; + }; - /** - * 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; + /** + * 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 FieldOptions; + return GeneratedCodeInfo; })(); - protobuf.OneofOptions = (function() { + protobuf.Duration = (function() { /** - * Properties of an OneofOptions. + * Properties of a Duration. * @memberof google.protobuf - * @interface IOneofOptions - * @property {Array.|null} [uninterpretedOption] OneofOptions uninterpretedOption + * @interface IDuration + * @property {number|Long|null} [seconds] Duration seconds + * @property {number|null} [nanos] Duration nanos */ /** - * Constructs a new OneofOptions. + * Constructs a new Duration. * @memberof google.protobuf - * @classdesc Represents an OneofOptions. - * @implements IOneofOptions + * @classdesc Represents a Duration. + * @implements IDuration * @constructor - * @param {google.protobuf.IOneofOptions=} [properties] Properties to set + * @param {google.protobuf.IDuration=} [properties] Properties to set */ - function OneofOptions(properties) { - this.uninterpretedOption = []; + function Duration(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -18953,78 +37088,89 @@ } /** - * OneofOptions uninterpretedOption. - * @member {Array.} uninterpretedOption - * @memberof google.protobuf.OneofOptions + * Duration seconds. + * @member {number|Long} seconds + * @memberof google.protobuf.Duration * @instance */ - OneofOptions.prototype.uninterpretedOption = $util.emptyArray; + Duration.prototype.seconds = $util.Long ? $util.Long.fromBits(0,0,false) : 0; /** - * Creates a new OneofOptions instance using the specified properties. + * 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.OneofOptions + * @memberof google.protobuf.Duration * @static - * @param {google.protobuf.IOneofOptions=} [properties] Properties to set - * @returns {google.protobuf.OneofOptions} OneofOptions instance + * @param {google.protobuf.IDuration=} [properties] Properties to set + * @returns {google.protobuf.Duration} Duration instance */ - OneofOptions.create = function create(properties) { - return new OneofOptions(properties); + Duration.create = function create(properties) { + return new Duration(properties); }; /** - * Encodes the specified OneofOptions message. Does not implicitly {@link google.protobuf.OneofOptions.verify|verify} messages. + * Encodes the specified Duration message. Does not implicitly {@link google.protobuf.Duration.verify|verify} messages. * @function encode - * @memberof google.protobuf.OneofOptions + * @memberof google.protobuf.Duration * @static - * @param {google.protobuf.IOneofOptions} message OneofOptions message or plain object to encode + * @param {google.protobuf.IDuration} message Duration message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - OneofOptions.encode = function encode(message, writer) { + Duration.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - 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.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 OneofOptions message, length delimited. Does not implicitly {@link google.protobuf.OneofOptions.verify|verify} messages. + * Encodes the specified Duration message, length delimited. Does not implicitly {@link google.protobuf.Duration.verify|verify} messages. * @function encodeDelimited - * @memberof google.protobuf.OneofOptions + * @memberof google.protobuf.Duration * @static - * @param {google.protobuf.IOneofOptions} message OneofOptions message or plain object to encode + * @param {google.protobuf.IDuration} message Duration message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - OneofOptions.encodeDelimited = function encodeDelimited(message, writer) { + Duration.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes an OneofOptions message from the specified reader or buffer. + * Decodes a Duration message from the specified reader or buffer. * @function decode - * @memberof google.protobuf.OneofOptions + * @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.OneofOptions} OneofOptions + * @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 */ - OneofOptions.decode = function decode(reader, length) { + Duration.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.OneofOptions(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.Duration(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 999: { - if (!(message.uninterpretedOption && message.uninterpretedOption.length)) - message.uninterpretedOption = []; - message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); + case 1: { + message.seconds = reader.int64(); + break; + } + case 2: { + message.nanos = reader.int32(); break; } default: @@ -19036,143 +37182,146 @@ }; /** - * Decodes an OneofOptions message from the specified reader or buffer, length delimited. + * Decodes a Duration message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.protobuf.OneofOptions + * @memberof google.protobuf.Duration * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.OneofOptions} OneofOptions + * @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 */ - OneofOptions.decodeDelimited = function decodeDelimited(reader) { + Duration.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies an OneofOptions message. + * Verifies a Duration message. * @function verify - * @memberof google.protobuf.OneofOptions + * @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 */ - OneofOptions.verify = function verify(message) { + Duration.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.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 an OneofOptions message from a plain object. Also converts values to their respective internal types. + * Creates a Duration 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.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]); - } - } + * @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 an OneofOptions message. Also converts values to other types if specified. + * Creates a plain object from a Duration message. Also converts values to other types if specified. * @function toObject - * @memberof google.protobuf.OneofOptions + * @memberof google.protobuf.Duration * @static - * @param {google.protobuf.OneofOptions} message OneofOptions + * @param {google.protobuf.Duration} message Duration * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - OneofOptions.toObject = function toObject(message, options) { + Duration.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.arrays || options.defaults) - object.uninterpretedOption = []; - 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 (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 OneofOptions to JSON. + * Converts this Duration to JSON. * @function toJSON - * @memberof google.protobuf.OneofOptions + * @memberof google.protobuf.Duration * @instance * @returns {Object.} JSON object */ - OneofOptions.prototype.toJSON = function toJSON() { + Duration.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for OneofOptions + * Gets the default type url for Duration * @function getTypeUrl - * @memberof google.protobuf.OneofOptions + * @memberof google.protobuf.Duration * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - OneofOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + Duration.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.protobuf.OneofOptions"; + return typeUrlPrefix + "/google.protobuf.Duration"; }; - return OneofOptions; + return Duration; })(); - protobuf.EnumOptions = (function() { + protobuf.Timestamp = (function() { /** - * Properties of an EnumOptions. + * Properties of a Timestamp. * @memberof google.protobuf - * @interface IEnumOptions - * @property {boolean|null} [allowAlias] EnumOptions allowAlias - * @property {boolean|null} [deprecated] EnumOptions deprecated - * @property {boolean|null} [deprecatedLegacyJsonFieldConflicts] EnumOptions deprecatedLegacyJsonFieldConflicts - * @property {Array.|null} [uninterpretedOption] EnumOptions uninterpretedOption + * @interface ITimestamp + * @property {number|Long|null} [seconds] Timestamp seconds + * @property {number|null} [nanos] Timestamp nanos */ /** - * Constructs a new EnumOptions. + * Constructs a new Timestamp. * @memberof google.protobuf - * @classdesc Represents an EnumOptions. - * @implements IEnumOptions + * @classdesc Represents a Timestamp. + * @implements ITimestamp * @constructor - * @param {google.protobuf.IEnumOptions=} [properties] Properties to set + * @param {google.protobuf.ITimestamp=} [properties] Properties to set */ - function EnumOptions(properties) { - this.uninterpretedOption = []; + function Timestamp(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -19180,120 +37329,89 @@ } /** - * 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 + * Timestamp seconds. + * @member {number|Long} seconds + * @memberof google.protobuf.Timestamp * @instance */ - EnumOptions.prototype.deprecatedLegacyJsonFieldConflicts = false; + Timestamp.prototype.seconds = $util.Long ? $util.Long.fromBits(0,0,false) : 0; /** - * EnumOptions uninterpretedOption. - * @member {Array.} uninterpretedOption - * @memberof google.protobuf.EnumOptions + * Timestamp nanos. + * @member {number} nanos + * @memberof google.protobuf.Timestamp * @instance */ - EnumOptions.prototype.uninterpretedOption = $util.emptyArray; + Timestamp.prototype.nanos = 0; /** - * Creates a new EnumOptions instance using the specified properties. + * Creates a new Timestamp instance using the specified properties. * @function create - * @memberof google.protobuf.EnumOptions + * @memberof google.protobuf.Timestamp * @static - * @param {google.protobuf.IEnumOptions=} [properties] Properties to set - * @returns {google.protobuf.EnumOptions} EnumOptions instance + * @param {google.protobuf.ITimestamp=} [properties] Properties to set + * @returns {google.protobuf.Timestamp} Timestamp instance */ - EnumOptions.create = function create(properties) { - return new EnumOptions(properties); + Timestamp.create = function create(properties) { + return new Timestamp(properties); }; /** - * Encodes the specified EnumOptions message. Does not implicitly {@link google.protobuf.EnumOptions.verify|verify} messages. + * Encodes the specified Timestamp message. Does not implicitly {@link google.protobuf.Timestamp.verify|verify} messages. * @function encode - * @memberof google.protobuf.EnumOptions + * @memberof google.protobuf.Timestamp * @static - * @param {google.protobuf.IEnumOptions} message EnumOptions message or plain object to encode + * @param {google.protobuf.ITimestamp} message Timestamp message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - EnumOptions.encode = function encode(message, writer) { + Timestamp.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.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.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 EnumOptions message, length delimited. Does not implicitly {@link google.protobuf.EnumOptions.verify|verify} messages. + * Encodes the specified Timestamp message, length delimited. Does not implicitly {@link google.protobuf.Timestamp.verify|verify} messages. * @function encodeDelimited - * @memberof google.protobuf.EnumOptions + * @memberof google.protobuf.Timestamp * @static - * @param {google.protobuf.IEnumOptions} message EnumOptions message or plain object to encode + * @param {google.protobuf.ITimestamp} message Timestamp message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - EnumOptions.encodeDelimited = function encodeDelimited(message, writer) { + Timestamp.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes an EnumOptions message from the specified reader or buffer. + * Decodes a Timestamp message from the specified reader or buffer. * @function decode - * @memberof google.protobuf.EnumOptions + * @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.EnumOptions} EnumOptions + * @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 */ - EnumOptions.decode = function decode(reader, length) { + Timestamp.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.EnumOptions(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.Timestamp(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 2: { - message.allowAlias = reader.bool(); - break; - } - case 3: { - message.deprecated = reader.bool(); - break; - } - case 6: { - message.deprecatedLegacyJsonFieldConflicts = reader.bool(); + case 1: { + message.seconds = reader.int64(); break; } - case 999: { - if (!(message.uninterpretedOption && message.uninterpretedOption.length)) - message.uninterpretedOption = []; - message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); + case 2: { + message.nanos = reader.int32(); break; } default: @@ -19305,167 +37423,146 @@ }; /** - * Decodes an EnumOptions message from the specified reader or buffer, length delimited. + * Decodes a Timestamp message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.protobuf.EnumOptions + * @memberof google.protobuf.Timestamp * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.EnumOptions} EnumOptions + * @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 */ - EnumOptions.decodeDelimited = function decodeDelimited(reader) { + Timestamp.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies an EnumOptions message. + * Verifies a Timestamp message. * @function verify - * @memberof google.protobuf.EnumOptions + * @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 */ - EnumOptions.verify = function verify(message) { + Timestamp.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.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.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 an EnumOptions message from a plain object. Also converts values to their respective internal types. + * Creates a Timestamp message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.protobuf.EnumOptions + * @memberof google.protobuf.Timestamp * @static * @param {Object.} object Plain object - * @returns {google.protobuf.EnumOptions} EnumOptions + * @returns {google.protobuf.Timestamp} Timestamp */ - EnumOptions.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.EnumOptions) + Timestamp.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.Timestamp) 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.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]); - } - } + 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 an EnumOptions message. Also converts values to other types if specified. + * Creates a plain object from a Timestamp message. Also converts values to other types if specified. * @function toObject - * @memberof google.protobuf.EnumOptions + * @memberof google.protobuf.Timestamp * @static - * @param {google.protobuf.EnumOptions} message EnumOptions + * @param {google.protobuf.Timestamp} message Timestamp * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - EnumOptions.toObject = function toObject(message, options) { + Timestamp.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; - } - 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.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 ($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 EnumOptions to JSON. + * Converts this Timestamp to JSON. * @function toJSON - * @memberof google.protobuf.EnumOptions + * @memberof google.protobuf.Timestamp * @instance * @returns {Object.} JSON object */ - EnumOptions.prototype.toJSON = function toJSON() { + Timestamp.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for EnumOptions + * Gets the default type url for Timestamp * @function getTypeUrl - * @memberof google.protobuf.EnumOptions + * @memberof google.protobuf.Timestamp * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - EnumOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + Timestamp.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.protobuf.EnumOptions"; + return typeUrlPrefix + "/google.protobuf.Timestamp"; }; - return EnumOptions; + return Timestamp; })(); - protobuf.EnumValueOptions = (function() { + protobuf.Any = (function() { /** - * Properties of an EnumValueOptions. + * Properties of an Any. * @memberof google.protobuf - * @interface IEnumValueOptions - * @property {boolean|null} [deprecated] EnumValueOptions deprecated - * @property {Array.|null} [uninterpretedOption] EnumValueOptions uninterpretedOption + * @interface IAny + * @property {string|null} [type_url] Any type_url + * @property {Uint8Array|null} [value] Any value */ /** - * Constructs a new EnumValueOptions. + * Constructs a new Any. * @memberof google.protobuf - * @classdesc Represents an EnumValueOptions. - * @implements IEnumValueOptions + * @classdesc Represents an Any. + * @implements IAny * @constructor - * @param {google.protobuf.IEnumValueOptions=} [properties] Properties to set + * @param {google.protobuf.IAny=} [properties] Properties to set */ - function EnumValueOptions(properties) { - this.uninterpretedOption = []; + function Any(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -19473,92 +37570,89 @@ } /** - * EnumValueOptions deprecated. - * @member {boolean} deprecated - * @memberof google.protobuf.EnumValueOptions + * Any type_url. + * @member {string} type_url + * @memberof google.protobuf.Any * @instance */ - EnumValueOptions.prototype.deprecated = false; + Any.prototype.type_url = ""; /** - * EnumValueOptions uninterpretedOption. - * @member {Array.} uninterpretedOption - * @memberof google.protobuf.EnumValueOptions + * Any value. + * @member {Uint8Array} value + * @memberof google.protobuf.Any * @instance */ - EnumValueOptions.prototype.uninterpretedOption = $util.emptyArray; + Any.prototype.value = $util.newBuffer([]); /** - * Creates a new EnumValueOptions instance using the specified properties. + * Creates a new Any instance using the specified properties. * @function create - * @memberof google.protobuf.EnumValueOptions + * @memberof google.protobuf.Any * @static - * @param {google.protobuf.IEnumValueOptions=} [properties] Properties to set - * @returns {google.protobuf.EnumValueOptions} EnumValueOptions instance + * @param {google.protobuf.IAny=} [properties] Properties to set + * @returns {google.protobuf.Any} Any instance */ - EnumValueOptions.create = function create(properties) { - return new EnumValueOptions(properties); + Any.create = function create(properties) { + return new Any(properties); }; /** - * Encodes the specified EnumValueOptions message. Does not implicitly {@link google.protobuf.EnumValueOptions.verify|verify} messages. + * Encodes the specified Any message. Does not implicitly {@link google.protobuf.Any.verify|verify} messages. * @function encode - * @memberof google.protobuf.EnumValueOptions + * @memberof google.protobuf.Any * @static - * @param {google.protobuf.IEnumValueOptions} message EnumValueOptions message or plain object to encode + * @param {google.protobuf.IAny} message Any message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - EnumValueOptions.encode = function encode(message, writer) { + Any.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.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.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 EnumValueOptions message, length delimited. Does not implicitly {@link google.protobuf.EnumValueOptions.verify|verify} messages. + * Encodes the specified Any message, length delimited. Does not implicitly {@link google.protobuf.Any.verify|verify} messages. * @function encodeDelimited - * @memberof google.protobuf.EnumValueOptions + * @memberof google.protobuf.Any * @static - * @param {google.protobuf.IEnumValueOptions} message EnumValueOptions message or plain object to encode + * @param {google.protobuf.IAny} message Any message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - EnumValueOptions.encodeDelimited = function encodeDelimited(message, writer) { + Any.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes an EnumValueOptions message from the specified reader or buffer. + * Decodes an Any message from the specified reader or buffer. * @function decode - * @memberof google.protobuf.EnumValueOptions + * @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.EnumValueOptions} EnumValueOptions + * @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 */ - EnumValueOptions.decode = function decode(reader, length) { + Any.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.EnumValueOptions(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.Any(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: { - message.deprecated = reader.bool(); + message.type_url = reader.string(); break; } - case 999: { - if (!(message.uninterpretedOption && message.uninterpretedOption.length)) - message.uninterpretedOption = []; - message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); + case 2: { + message.value = reader.bytes(); break; } default: @@ -19570,152 +37664,139 @@ }; /** - * Decodes an EnumValueOptions message from the specified reader or buffer, length delimited. + * Decodes an Any message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.protobuf.EnumValueOptions + * @memberof google.protobuf.Any * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.EnumValueOptions} EnumValueOptions + * @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 */ - EnumValueOptions.decodeDelimited = function decodeDelimited(reader) { + Any.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies an EnumValueOptions message. + * Verifies an Any message. * @function verify - * @memberof google.protobuf.EnumValueOptions + * @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 */ - EnumValueOptions.verify = function verify(message) { + Any.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.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.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 EnumValueOptions message from a plain object. Also converts values to their respective internal types. + * Creates an Any message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.protobuf.EnumValueOptions + * @memberof google.protobuf.Any * @static * @param {Object.} object Plain object - * @returns {google.protobuf.EnumValueOptions} EnumValueOptions + * @returns {google.protobuf.Any} Any */ - EnumValueOptions.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.EnumValueOptions) + Any.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.Any) return object; - var message = new $root.google.protobuf.EnumValueOptions(); - if (object.deprecated != null) - message.deprecated = Boolean(object.deprecated); - 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]); - } - } + 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 EnumValueOptions message. Also converts values to other types if specified. + * Creates a plain object from an Any message. Also converts values to other types if specified. * @function toObject - * @memberof google.protobuf.EnumValueOptions + * @memberof google.protobuf.Any * @static - * @param {google.protobuf.EnumValueOptions} message EnumValueOptions + * @param {google.protobuf.Any} message Any * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - EnumValueOptions.toObject = function toObject(message, options) { + Any.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.arrays || options.defaults) - object.uninterpretedOption = []; - if (options.defaults) - object.deprecated = false; - if (message.deprecated != null && message.hasOwnProperty("deprecated")) - object.deprecated = message.deprecated; - 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 (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 EnumValueOptions to JSON. + * Converts this Any to JSON. * @function toJSON - * @memberof google.protobuf.EnumValueOptions + * @memberof google.protobuf.Any * @instance * @returns {Object.} JSON object */ - EnumValueOptions.prototype.toJSON = function toJSON() { + Any.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for EnumValueOptions + * Gets the default type url for Any * @function getTypeUrl - * @memberof google.protobuf.EnumValueOptions + * @memberof google.protobuf.Any * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - EnumValueOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + Any.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.protobuf.EnumValueOptions"; + return typeUrlPrefix + "/google.protobuf.Any"; }; - return EnumValueOptions; + return Any; })(); - protobuf.ServiceOptions = (function() { + protobuf.Empty = (function() { /** - * Properties of a ServiceOptions. + * Properties of an Empty. * @memberof google.protobuf - * @interface IServiceOptions - * @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 + * @interface IEmpty */ /** - * Constructs a new ServiceOptions. + * Constructs a new Empty. * @memberof google.protobuf - * @classdesc Represents a ServiceOptions. - * @implements IServiceOptions + * @classdesc Represents an Empty. + * @implements IEmpty * @constructor - * @param {google.protobuf.IServiceOptions=} [properties] Properties to set + * @param {google.protobuf.IEmpty=} [properties] Properties to set */ - function ServiceOptions(properties) { - this.uninterpretedOption = []; + function Empty(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -19723,122 +37804,63 @@ } /** - * 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"] = ""; - - /** - * Creates a new ServiceOptions instance using the specified properties. + * Creates a new Empty instance using the specified properties. * @function create - * @memberof google.protobuf.ServiceOptions + * @memberof google.protobuf.Empty * @static - * @param {google.protobuf.IServiceOptions=} [properties] Properties to set - * @returns {google.protobuf.ServiceOptions} ServiceOptions instance + * @param {google.protobuf.IEmpty=} [properties] Properties to set + * @returns {google.protobuf.Empty} Empty instance */ - ServiceOptions.create = function create(properties) { - return new ServiceOptions(properties); + Empty.create = function create(properties) { + return new Empty(properties); }; /** - * Encodes the specified ServiceOptions message. Does not implicitly {@link google.protobuf.ServiceOptions.verify|verify} messages. + * Encodes the specified Empty message. Does not implicitly {@link google.protobuf.Empty.verify|verify} messages. * @function encode - * @memberof google.protobuf.ServiceOptions + * @memberof google.protobuf.Empty * @static - * @param {google.protobuf.IServiceOptions} message ServiceOptions message or plain object to encode + * @param {google.protobuf.IEmpty} message Empty message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ServiceOptions.encode = function encode(message, writer) { + Empty.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.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"]); return writer; }; /** - * Encodes the specified ServiceOptions message, length delimited. Does not implicitly {@link google.protobuf.ServiceOptions.verify|verify} messages. + * Encodes the specified Empty message, length delimited. Does not implicitly {@link google.protobuf.Empty.verify|verify} messages. * @function encodeDelimited - * @memberof google.protobuf.ServiceOptions + * @memberof google.protobuf.Empty * @static - * @param {google.protobuf.IServiceOptions} message ServiceOptions message or plain object to encode + * @param {google.protobuf.IEmpty} message Empty message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ServiceOptions.encodeDelimited = function encodeDelimited(message, writer) { + Empty.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a ServiceOptions message from the specified reader or buffer. + * Decodes an Empty message from the specified reader or buffer. * @function decode - * @memberof google.protobuf.ServiceOptions + * @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.ServiceOptions} ServiceOptions + * @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 */ - ServiceOptions.decode = function decode(reader, length) { + Empty.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.ServiceOptions(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.Empty(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - 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; - } default: reader.skipType(tag & 7); break; @@ -19848,171 +37870,110 @@ }; /** - * Decodes a ServiceOptions message from the specified reader or buffer, length delimited. + * Decodes an Empty message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.protobuf.ServiceOptions + * @memberof google.protobuf.Empty * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.ServiceOptions} ServiceOptions + * @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 */ - ServiceOptions.decodeDelimited = function decodeDelimited(reader) { + Empty.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a ServiceOptions message. + * Verifies an Empty message. * @function verify - * @memberof google.protobuf.ServiceOptions + * @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 */ - ServiceOptions.verify = function verify(message) { + Empty.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.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"; return null; }; /** - * Creates a ServiceOptions message from a plain object. Also converts values to their respective internal types. + * Creates an Empty message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.protobuf.ServiceOptions + * @memberof google.protobuf.Empty * @static * @param {Object.} object Plain object - * @returns {google.protobuf.ServiceOptions} ServiceOptions + * @returns {google.protobuf.Empty} Empty */ - ServiceOptions.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.ServiceOptions) + Empty.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.Empty) return object; - var message = new $root.google.protobuf.ServiceOptions(); - 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"]); - return message; + return new $root.google.protobuf.Empty(); }; /** - * Creates a plain object from a ServiceOptions message. Also converts values to other types if specified. + * Creates a plain object from an Empty message. Also converts values to other types if specified. * @function toObject - * @memberof google.protobuf.ServiceOptions + * @memberof google.protobuf.Empty * @static - * @param {google.protobuf.ServiceOptions} message ServiceOptions + * @param {google.protobuf.Empty} message Empty * @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[".google.api.defaultHost"] = ""; - object[".google.api.oauthScopes"] = ""; - } - if (message.deprecated != null && message.hasOwnProperty("deprecated")) - object.deprecated = message.deprecated; - 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"]; - return object; + Empty.toObject = function toObject() { + return {}; }; /** - * Converts this ServiceOptions to JSON. + * Converts this Empty to JSON. * @function toJSON - * @memberof google.protobuf.ServiceOptions + * @memberof google.protobuf.Empty * @instance * @returns {Object.} JSON object */ - ServiceOptions.prototype.toJSON = function toJSON() { + Empty.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for ServiceOptions + * Gets the default type url for Empty * @function getTypeUrl - * @memberof google.protobuf.ServiceOptions + * @memberof google.protobuf.Empty * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - ServiceOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + Empty.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.protobuf.ServiceOptions"; + return typeUrlPrefix + "/google.protobuf.Empty"; }; - return ServiceOptions; + return Empty; })(); - protobuf.MethodOptions = (function() { + protobuf.FieldMask = (function() { /** - * Properties of a MethodOptions. + * Properties of a FieldMask. * @memberof google.protobuf - * @interface IMethodOptions - * @property {boolean|null} [deprecated] MethodOptions deprecated - * @property {google.protobuf.MethodOptions.IdempotencyLevel|null} [idempotencyLevel] MethodOptions idempotencyLevel - * @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 + * @interface IFieldMask + * @property {Array.|null} [paths] FieldMask paths */ /** - * Constructs a new MethodOptions. + * Constructs a new FieldMask. * @memberof google.protobuf - * @classdesc Represents a MethodOptions. - * @implements IMethodOptions + * @classdesc Represents a FieldMask. + * @implements IFieldMask * @constructor - * @param {google.protobuf.IMethodOptions=} [properties] Properties to set + * @param {google.protobuf.IFieldMask=} [properties] Properties to set */ - function MethodOptions(properties) { - this.uninterpretedOption = []; - this[".google.api.methodSignature"] = []; + function FieldMask(properties) { + this.paths = []; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -20020,137 +37981,78 @@ } /** - * 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 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 + * FieldMask paths. + * @member {Array.} paths + * @memberof google.protobuf.FieldMask * @instance */ - MethodOptions.prototype[".google.api.methodSignature"] = $util.emptyArray; + FieldMask.prototype.paths = $util.emptyArray; /** - * Creates a new MethodOptions instance using the specified properties. + * Creates a new FieldMask instance using the specified properties. * @function create - * @memberof google.protobuf.MethodOptions + * @memberof google.protobuf.FieldMask * @static - * @param {google.protobuf.IMethodOptions=} [properties] Properties to set - * @returns {google.protobuf.MethodOptions} MethodOptions instance + * @param {google.protobuf.IFieldMask=} [properties] Properties to set + * @returns {google.protobuf.FieldMask} FieldMask instance */ - MethodOptions.create = function create(properties) { - return new MethodOptions(properties); + FieldMask.create = function create(properties) { + return new FieldMask(properties); }; /** - * Encodes the specified MethodOptions message. Does not implicitly {@link google.protobuf.MethodOptions.verify|verify} messages. + * Encodes the specified FieldMask message. Does not implicitly {@link google.protobuf.FieldMask.verify|verify} messages. * @function encode - * @memberof google.protobuf.MethodOptions + * @memberof google.protobuf.FieldMask * @static - * @param {google.protobuf.IMethodOptions} message MethodOptions message or plain object to encode + * @param {google.protobuf.IFieldMask} message FieldMask message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - MethodOptions.encode = function encode(message, writer) { + FieldMask.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.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.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(); + 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 MethodOptions message, length delimited. Does not implicitly {@link google.protobuf.MethodOptions.verify|verify} messages. + * Encodes the specified FieldMask message, length delimited. Does not implicitly {@link google.protobuf.FieldMask.verify|verify} messages. * @function encodeDelimited - * @memberof google.protobuf.MethodOptions + * @memberof google.protobuf.FieldMask * @static - * @param {google.protobuf.IMethodOptions} message MethodOptions message or plain object to encode + * @param {google.protobuf.IFieldMask} message FieldMask message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - MethodOptions.encodeDelimited = function encodeDelimited(message, writer) { + FieldMask.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a MethodOptions message from the specified reader or buffer. + * Decodes a FieldMask message from the specified reader or buffer. * @function decode - * @memberof google.protobuf.MethodOptions + * @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.MethodOptions} MethodOptions + * @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 */ - MethodOptions.decode = function decode(reader, length) { + FieldMask.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.MethodOptions(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.FieldMask(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 33: { - message.deprecated = reader.bool(); - break; - } - case 34: { - message.idempotencyLevel = reader.int32(); - 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()); + case 1: { + if (!(message.paths && message.paths.length)) + message.paths = []; + message.paths.push(reader.string()); break; } default: @@ -20162,238 +38064,350 @@ }; /** - * Decodes a MethodOptions message from the specified reader or buffer, length delimited. + * Decodes a FieldMask message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.protobuf.MethodOptions + * @memberof google.protobuf.FieldMask * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.MethodOptions} MethodOptions + * @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 */ - MethodOptions.decodeDelimited = function decodeDelimited(reader) { + FieldMask.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a MethodOptions message. + * Verifies a FieldMask message. * @function verify - * @memberof google.protobuf.MethodOptions + * @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 */ - MethodOptions.verify = function verify(message) { + FieldMask.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.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.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 MethodOptions message from a plain object. Also converts values to their respective internal types. + * Creates a FieldMask message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.protobuf.MethodOptions + * @memberof google.protobuf.FieldMask * @static * @param {Object.} object Plain object - * @returns {google.protobuf.MethodOptions} MethodOptions + * @returns {google.protobuf.FieldMask} FieldMask */ - MethodOptions.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.MethodOptions) + FieldMask.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.FieldMask) 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.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]); + 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 MethodOptions message. Also converts values to other types if specified. + * Creates a plain object from a FieldMask message. Also converts values to other types if specified. * @function toObject - * @memberof google.protobuf.MethodOptions + * @memberof google.protobuf.FieldMask * @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[".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.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.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]; + * @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]; } - 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. + * Converts this FieldMask to JSON. * @function toJSON - * @memberof google.protobuf.MethodOptions + * @memberof google.protobuf.FieldMask * @instance * @returns {Object.} JSON object */ - MethodOptions.prototype.toJSON = function toJSON() { + FieldMask.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for MethodOptions + * Gets the default type url for FieldMask * @function getTypeUrl - * @memberof google.protobuf.MethodOptions + * @memberof google.protobuf.FieldMask * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - MethodOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + FieldMask.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.protobuf.MethodOptions"; + return typeUrlPrefix + "/google.protobuf.FieldMask"; }; + return FieldMask; + })(); + + return protobuf; + })(); + + google.longrunning = (function() { + + /** + * Namespace longrunning. + * @memberof google + * @namespace + */ + var longrunning = {}; + + longrunning.Operations = (function() { + /** - * 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 + * 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 */ - 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; - })(); + function Operations(rpcImpl, requestDelimited, responseDelimited) { + $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); + } - return MethodOptions; + (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; })(); - protobuf.UninterpretedOption = (function() { + longrunning.Operation = (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 + * 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 UninterpretedOption. - * @memberof google.protobuf - * @classdesc Represents an UninterpretedOption. - * @implements IUninterpretedOption + * Constructs a new Operation. + * @memberof google.longrunning + * @classdesc Represents an Operation. + * @implements IOperation * @constructor - * @param {google.protobuf.IUninterpretedOption=} [properties] Properties to set + * @param {google.longrunning.IOperation=} [properties] Properties to set */ - function UninterpretedOption(properties) { - this.name = []; + function Operation(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -20401,162 +38415,145 @@ } /** - * UninterpretedOption name. - * @member {Array.} name - * @memberof google.protobuf.UninterpretedOption + * Operation name. + * @member {string} name + * @memberof google.longrunning.Operation * @instance */ - UninterpretedOption.prototype.name = $util.emptyArray; + Operation.prototype.name = ""; /** - * UninterpretedOption identifierValue. - * @member {string} identifierValue - * @memberof google.protobuf.UninterpretedOption + * Operation metadata. + * @member {google.protobuf.IAny|null|undefined} metadata + * @memberof google.longrunning.Operation * @instance */ - UninterpretedOption.prototype.identifierValue = ""; + Operation.prototype.metadata = null; /** - * UninterpretedOption positiveIntValue. - * @member {number|Long} positiveIntValue - * @memberof google.protobuf.UninterpretedOption + * Operation done. + * @member {boolean} done + * @memberof google.longrunning.Operation * @instance */ - UninterpretedOption.prototype.positiveIntValue = $util.Long ? $util.Long.fromBits(0,0,true) : 0; + Operation.prototype.done = false; /** - * UninterpretedOption negativeIntValue. - * @member {number|Long} negativeIntValue - * @memberof google.protobuf.UninterpretedOption + * Operation error. + * @member {google.rpc.IStatus|null|undefined} error + * @memberof google.longrunning.Operation * @instance */ - UninterpretedOption.prototype.negativeIntValue = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + Operation.prototype.error = null; /** - * UninterpretedOption doubleValue. - * @member {number} doubleValue - * @memberof google.protobuf.UninterpretedOption + * Operation response. + * @member {google.protobuf.IAny|null|undefined} response + * @memberof google.longrunning.Operation * @instance */ - UninterpretedOption.prototype.doubleValue = 0; + Operation.prototype.response = null; - /** - * UninterpretedOption stringValue. - * @member {Uint8Array} stringValue - * @memberof google.protobuf.UninterpretedOption - * @instance - */ - UninterpretedOption.prototype.stringValue = $util.newBuffer([]); + // OneOf field names bound to virtual getters and setters + var $oneOfFields; /** - * UninterpretedOption aggregateValue. - * @member {string} aggregateValue - * @memberof google.protobuf.UninterpretedOption + * Operation result. + * @member {"error"|"response"|undefined} result + * @memberof google.longrunning.Operation * @instance */ - UninterpretedOption.prototype.aggregateValue = ""; + Object.defineProperty(Operation.prototype, "result", { + get: $util.oneOfGetter($oneOfFields = ["error", "response"]), + set: $util.oneOfSetter($oneOfFields) + }); /** - * Creates a new UninterpretedOption instance using the specified properties. + * Creates a new Operation instance using the specified properties. * @function create - * @memberof google.protobuf.UninterpretedOption + * @memberof google.longrunning.Operation * @static - * @param {google.protobuf.IUninterpretedOption=} [properties] Properties to set - * @returns {google.protobuf.UninterpretedOption} UninterpretedOption instance + * @param {google.longrunning.IOperation=} [properties] Properties to set + * @returns {google.longrunning.Operation} Operation instance */ - UninterpretedOption.create = function create(properties) { - return new UninterpretedOption(properties); + Operation.create = function create(properties) { + return new Operation(properties); }; /** - * Encodes the specified UninterpretedOption message. Does not implicitly {@link google.protobuf.UninterpretedOption.verify|verify} messages. + * Encodes the specified Operation message. Does not implicitly {@link google.longrunning.Operation.verify|verify} messages. * @function encode - * @memberof google.protobuf.UninterpretedOption + * @memberof google.longrunning.Operation * @static - * @param {google.protobuf.IUninterpretedOption} message UninterpretedOption message or plain object to encode + * @param {google.longrunning.IOperation} message Operation message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - UninterpretedOption.encode = function encode(message, writer) { + Operation.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); + 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 UninterpretedOption message, length delimited. Does not implicitly {@link google.protobuf.UninterpretedOption.verify|verify} messages. + * Encodes the specified Operation message, length delimited. Does not implicitly {@link google.longrunning.Operation.verify|verify} messages. * @function encodeDelimited - * @memberof google.protobuf.UninterpretedOption + * @memberof google.longrunning.Operation * @static - * @param {google.protobuf.IUninterpretedOption} message UninterpretedOption message or plain object to encode + * @param {google.longrunning.IOperation} message Operation message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - UninterpretedOption.encodeDelimited = function encodeDelimited(message, writer) { + Operation.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes an UninterpretedOption message from the specified reader or buffer. + * Decodes an Operation message from the specified reader or buffer. * @function decode - * @memberof google.protobuf.UninterpretedOption + * @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.protobuf.UninterpretedOption} UninterpretedOption + * @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 */ - UninterpretedOption.decode = function decode(reader, length) { + Operation.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.UninterpretedOption(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.longrunning.Operation(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } case 2: { - if (!(message.name && message.name.length)) - message.name = []; - message.name.push($root.google.protobuf.UninterpretedOption.NamePart.decode(reader, reader.uint32())); + message.metadata = $root.google.protobuf.Any.decode(reader, reader.uint32()); break; } case 3: { - message.identifierValue = reader.string(); + message.done = reader.bool(); break; } case 4: { - message.positiveIntValue = reader.uint64(); + message.error = $root.google.rpc.Status.decode(reader, reader.uint32()); 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(); + message.response = $root.google.protobuf.Any.decode(reader, reader.uint32()); break; } default: @@ -20568,454 +38565,389 @@ }; /** - * Decodes an UninterpretedOption message from the specified reader or buffer, length delimited. + * Decodes an Operation message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.protobuf.UninterpretedOption + * @memberof google.longrunning.Operation * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.UninterpretedOption} UninterpretedOption + * @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 */ - UninterpretedOption.decodeDelimited = function decodeDelimited(reader) { + Operation.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies an UninterpretedOption message. + * Verifies an Operation message. * @function verify - * @memberof google.protobuf.UninterpretedOption + * @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 */ - UninterpretedOption.verify = function verify(message) { + Operation.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; - } + 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; + } } - 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. + * Creates an Operation message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.protobuf.UninterpretedOption + * @memberof google.longrunning.Operation * @static * @param {Object.} object Plain object - * @returns {google.protobuf.UninterpretedOption} UninterpretedOption + * @returns {google.longrunning.Operation} Operation */ - UninterpretedOption.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.UninterpretedOption) + Operation.fromObject = function fromObject(object) { + if (object instanceof $root.google.longrunning.Operation) 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]); - } + 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); } - 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. + * Creates a plain object from an Operation message. Also converts values to other types if specified. * @function toObject - * @memberof google.protobuf.UninterpretedOption + * @memberof google.longrunning.Operation * @static - * @param {google.protobuf.UninterpretedOption} message UninterpretedOption + * @param {google.longrunning.Operation} message Operation * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - UninterpretedOption.toObject = function toObject(message, options) { + Operation.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 = ""; + object.name = ""; + object.metadata = null; + object.done = false; } - 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.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"; } - 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. + * Converts this Operation to JSON. * @function toJSON - * @memberof google.protobuf.UninterpretedOption + * @memberof google.longrunning.Operation * @instance * @returns {Object.} JSON object */ - UninterpretedOption.prototype.toJSON = function toJSON() { + Operation.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for UninterpretedOption + * Gets the default type url for Operation * @function getTypeUrl - * @memberof google.protobuf.UninterpretedOption + * @memberof google.longrunning.Operation * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - UninterpretedOption.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + Operation.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.protobuf.UninterpretedOption"; + return typeUrlPrefix + "/google.longrunning.Operation"; }; - UninterpretedOption.NamePart = (function() { - - /** - * Properties of a NamePart. - * @memberof google.protobuf.UninterpretedOption - * @interface INamePart - * @property {string} namePart NamePart namePart - * @property {boolean} isExtension NamePart isExtension - */ + return Operation; + })(); - /** - * 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]]; - } + longrunning.GetOperationRequest = (function() { - /** - * NamePart namePart. - * @member {string} namePart - * @memberof google.protobuf.UninterpretedOption.NamePart - * @instance - */ - NamePart.prototype.namePart = ""; + /** + * Properties of a GetOperationRequest. + * @memberof google.longrunning + * @interface IGetOperationRequest + * @property {string|null} [name] GetOperationRequest name + */ - /** - * NamePart isExtension. - * @member {boolean} isExtension - * @memberof google.protobuf.UninterpretedOption.NamePart - * @instance - */ - NamePart.prototype.isExtension = false; + /** + * 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]]; + } - /** - * 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); - }; + /** + * GetOperationRequest name. + * @member {string} name + * @memberof google.longrunning.GetOperationRequest + * @instance + */ + GetOperationRequest.prototype.name = ""; - /** - * 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; - }; + /** + * 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 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(); - }; + /** + * 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; + }; - /** - * 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) { - 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(); - switch (tag >>> 3) { - case 1: { - message.namePart = reader.string(); - break; - } - case 2: { - message.isExtension = reader.bool(); - break; - } - default: - reader.skipType(tag & 7); + /** + * 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) { + 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(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); 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()); - }; + } + return message; + }; - /** - * 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; - }; + /** + * 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()); + }; - /** - * 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; - }; + /** + * 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 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; + /** + * 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; + }; - /** - * 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); - }; + /** + * 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; + }; - /** - * 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"; - }; + /** + * 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); + }; - return NamePart; - })(); + /** + * 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 UninterpretedOption; + return GetOperationRequest; })(); - protobuf.SourceCodeInfo = (function() { + longrunning.ListOperationsRequest = (function() { /** - * Properties of a SourceCodeInfo. - * @memberof google.protobuf - * @interface ISourceCodeInfo - * @property {Array.|null} [location] SourceCodeInfo location + * 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 SourceCodeInfo. - * @memberof google.protobuf - * @classdesc Represents a SourceCodeInfo. - * @implements ISourceCodeInfo + * Constructs a new ListOperationsRequest. + * @memberof google.longrunning + * @classdesc Represents a ListOperationsRequest. + * @implements IListOperationsRequest * @constructor - * @param {google.protobuf.ISourceCodeInfo=} [properties] Properties to set + * @param {google.longrunning.IListOperationsRequest=} [properties] Properties to set */ - function SourceCodeInfo(properties) { - this.location = []; + function ListOperationsRequest(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -21023,78 +38955,117 @@ } /** - * SourceCodeInfo location. - * @member {Array.} location - * @memberof google.protobuf.SourceCodeInfo + * ListOperationsRequest name. + * @member {string} name + * @memberof google.longrunning.ListOperationsRequest * @instance */ - SourceCodeInfo.prototype.location = $util.emptyArray; + ListOperationsRequest.prototype.name = ""; /** - * Creates a new SourceCodeInfo instance using the specified properties. + * 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.protobuf.SourceCodeInfo + * @memberof google.longrunning.ListOperationsRequest * @static - * @param {google.protobuf.ISourceCodeInfo=} [properties] Properties to set - * @returns {google.protobuf.SourceCodeInfo} SourceCodeInfo instance + * @param {google.longrunning.IListOperationsRequest=} [properties] Properties to set + * @returns {google.longrunning.ListOperationsRequest} ListOperationsRequest instance */ - SourceCodeInfo.create = function create(properties) { - return new SourceCodeInfo(properties); + ListOperationsRequest.create = function create(properties) { + return new ListOperationsRequest(properties); }; /** - * Encodes the specified SourceCodeInfo message. Does not implicitly {@link google.protobuf.SourceCodeInfo.verify|verify} messages. + * Encodes the specified ListOperationsRequest message. Does not implicitly {@link google.longrunning.ListOperationsRequest.verify|verify} messages. * @function encode - * @memberof google.protobuf.SourceCodeInfo + * @memberof google.longrunning.ListOperationsRequest * @static - * @param {google.protobuf.ISourceCodeInfo} message SourceCodeInfo message or plain object to encode + * @param {google.longrunning.IListOperationsRequest} message ListOperationsRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - SourceCodeInfo.encode = function encode(message, writer) { + ListOperationsRequest.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(); + 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 SourceCodeInfo message, length delimited. Does not implicitly {@link google.protobuf.SourceCodeInfo.verify|verify} messages. + * Encodes the specified ListOperationsRequest message, length delimited. Does not implicitly {@link google.longrunning.ListOperationsRequest.verify|verify} messages. * @function encodeDelimited - * @memberof google.protobuf.SourceCodeInfo + * @memberof google.longrunning.ListOperationsRequest * @static - * @param {google.protobuf.ISourceCodeInfo} message SourceCodeInfo message or plain object to encode + * @param {google.longrunning.IListOperationsRequest} message ListOperationsRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - SourceCodeInfo.encodeDelimited = function encodeDelimited(message, writer) { + ListOperationsRequest.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a SourceCodeInfo message from the specified reader or buffer. + * Decodes a ListOperationsRequest message from the specified reader or buffer. * @function decode - * @memberof google.protobuf.SourceCodeInfo + * @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.protobuf.SourceCodeInfo} SourceCodeInfo + * @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 */ - SourceCodeInfo.decode = function decode(reader, length) { + ListOperationsRequest.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.SourceCodeInfo(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.longrunning.ListOperationsRequest(); while (reader.pos < end) { var tag = reader.uint32(); 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())); + 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: @@ -21106,502 +39077,395 @@ }; /** - * Decodes a SourceCodeInfo message from the specified reader or buffer, length delimited. + * Decodes a ListOperationsRequest message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.protobuf.SourceCodeInfo + * @memberof google.longrunning.ListOperationsRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.SourceCodeInfo} SourceCodeInfo + * @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 */ - SourceCodeInfo.decodeDelimited = function decodeDelimited(reader) { + ListOperationsRequest.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a SourceCodeInfo message. + * Verifies a ListOperationsRequest message. * @function verify - * @memberof google.protobuf.SourceCodeInfo + * @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 */ - SourceCodeInfo.verify = function verify(message) { + ListOperationsRequest.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; - } - } + 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 SourceCodeInfo message from a plain object. Also converts values to their respective internal types. + * Creates a ListOperationsRequest message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.protobuf.SourceCodeInfo + * @memberof google.longrunning.ListOperationsRequest * @static * @param {Object.} object Plain object - * @returns {google.protobuf.SourceCodeInfo} SourceCodeInfo + * @returns {google.longrunning.ListOperationsRequest} ListOperationsRequest */ - SourceCodeInfo.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.SourceCodeInfo) + ListOperationsRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.longrunning.ListOperationsRequest) 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]); - } - } + 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 SourceCodeInfo message. Also converts values to other types if specified. + * Creates a plain object from a ListOperationsRequest message. Also converts values to other types if specified. * @function toObject - * @memberof google.protobuf.SourceCodeInfo + * @memberof google.longrunning.ListOperationsRequest * @static - * @param {google.protobuf.SourceCodeInfo} message SourceCodeInfo + * @param {google.longrunning.ListOperationsRequest} message ListOperationsRequest * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - SourceCodeInfo.toObject = function toObject(message, options) { + ListOperationsRequest.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); + 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 SourceCodeInfo to JSON. + * Converts this ListOperationsRequest to JSON. * @function toJSON - * @memberof google.protobuf.SourceCodeInfo + * @memberof google.longrunning.ListOperationsRequest * @instance * @returns {Object.} JSON object */ - SourceCodeInfo.prototype.toJSON = function toJSON() { + ListOperationsRequest.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for SourceCodeInfo + * Gets the default type url for ListOperationsRequest * @function getTypeUrl - * @memberof google.protobuf.SourceCodeInfo + * @memberof google.longrunning.ListOperationsRequest * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - SourceCodeInfo.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + ListOperationsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.protobuf.SourceCodeInfo"; + return typeUrlPrefix + "/google.longrunning.ListOperationsRequest"; }; - 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) { - 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(); - 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; - }; + return ListOperationsRequest; + })(); - /** - * 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()); - }; + longrunning.ListOperationsResponse = (function() { - /** - * 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; - }; + /** + * Properties of a ListOperationsResponse. + * @memberof google.longrunning + * @interface IListOperationsResponse + * @property {Array.|null} [operations] ListOperationsResponse operations + * @property {string|null} [nextPageToken] ListOperationsResponse nextPageToken + */ - /** - * 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; - }; + /** + * 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]]; + } - /** - * 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]; + /** + * 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) { + 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(); + 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 object; - }; + } + return message; + }; - /** - * 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); - }; + /** + * 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()); + }; - /** - * 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"; + /** + * 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]); } - return typeUrlPrefix + "/google.protobuf.SourceCodeInfo.Location"; - }; + } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + return message; + }; - return Location; - })(); + /** + * 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; + }; - return SourceCodeInfo; + /** + * 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; })(); - protobuf.GeneratedCodeInfo = (function() { + longrunning.CancelOperationRequest = (function() { /** - * Properties of a GeneratedCodeInfo. - * @memberof google.protobuf - * @interface IGeneratedCodeInfo - * @property {Array.|null} [annotation] GeneratedCodeInfo annotation + * Properties of a CancelOperationRequest. + * @memberof google.longrunning + * @interface ICancelOperationRequest + * @property {string|null} [name] CancelOperationRequest name */ /** - * Constructs a new GeneratedCodeInfo. - * @memberof google.protobuf - * @classdesc Represents a GeneratedCodeInfo. - * @implements IGeneratedCodeInfo + * Constructs a new CancelOperationRequest. + * @memberof google.longrunning + * @classdesc Represents a CancelOperationRequest. + * @implements ICancelOperationRequest * @constructor - * @param {google.protobuf.IGeneratedCodeInfo=} [properties] Properties to set + * @param {google.longrunning.ICancelOperationRequest=} [properties] Properties to set */ - function GeneratedCodeInfo(properties) { - this.annotation = []; + function CancelOperationRequest(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -21609,78 +39473,75 @@ } /** - * GeneratedCodeInfo annotation. - * @member {Array.} annotation - * @memberof google.protobuf.GeneratedCodeInfo + * CancelOperationRequest name. + * @member {string} name + * @memberof google.longrunning.CancelOperationRequest * @instance */ - GeneratedCodeInfo.prototype.annotation = $util.emptyArray; + CancelOperationRequest.prototype.name = ""; /** - * Creates a new GeneratedCodeInfo instance using the specified properties. + * Creates a new CancelOperationRequest instance using the specified properties. * @function create - * @memberof google.protobuf.GeneratedCodeInfo + * @memberof google.longrunning.CancelOperationRequest * @static - * @param {google.protobuf.IGeneratedCodeInfo=} [properties] Properties to set - * @returns {google.protobuf.GeneratedCodeInfo} GeneratedCodeInfo instance + * @param {google.longrunning.ICancelOperationRequest=} [properties] Properties to set + * @returns {google.longrunning.CancelOperationRequest} CancelOperationRequest instance */ - GeneratedCodeInfo.create = function create(properties) { - return new GeneratedCodeInfo(properties); + CancelOperationRequest.create = function create(properties) { + return new CancelOperationRequest(properties); }; /** - * Encodes the specified GeneratedCodeInfo message. Does not implicitly {@link google.protobuf.GeneratedCodeInfo.verify|verify} messages. + * Encodes the specified CancelOperationRequest message. Does not implicitly {@link google.longrunning.CancelOperationRequest.verify|verify} messages. * @function encode - * @memberof google.protobuf.GeneratedCodeInfo + * @memberof google.longrunning.CancelOperationRequest * @static - * @param {google.protobuf.IGeneratedCodeInfo} message GeneratedCodeInfo message or plain object to encode + * @param {google.longrunning.ICancelOperationRequest} message CancelOperationRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - GeneratedCodeInfo.encode = function encode(message, writer) { + CancelOperationRequest.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(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); return writer; }; /** - * Encodes the specified GeneratedCodeInfo message, length delimited. Does not implicitly {@link google.protobuf.GeneratedCodeInfo.verify|verify} messages. + * Encodes the specified CancelOperationRequest message, length delimited. Does not implicitly {@link google.longrunning.CancelOperationRequest.verify|verify} messages. * @function encodeDelimited - * @memberof google.protobuf.GeneratedCodeInfo + * @memberof google.longrunning.CancelOperationRequest * @static - * @param {google.protobuf.IGeneratedCodeInfo} message GeneratedCodeInfo message or plain object to encode + * @param {google.longrunning.ICancelOperationRequest} message CancelOperationRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - GeneratedCodeInfo.encodeDelimited = function encodeDelimited(message, writer) { + CancelOperationRequest.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a GeneratedCodeInfo message from the specified reader or buffer. + * Decodes a CancelOperationRequest message from the specified reader or buffer. * @function decode - * @memberof google.protobuf.GeneratedCodeInfo + * @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.protobuf.GeneratedCodeInfo} GeneratedCodeInfo + * @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 */ - GeneratedCodeInfo.decode = function decode(reader, length) { + CancelOperationRequest.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.GeneratedCodeInfo(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.longrunning.CancelOperationRequest(); while (reader.pos < end) { var tag = reader.uint32(); 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())); + message.name = reader.string(); break; } default: @@ -21692,501 +39553,799 @@ }; /** - * Decodes a GeneratedCodeInfo message from the specified reader or buffer, length delimited. + * Decodes a CancelOperationRequest message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.protobuf.GeneratedCodeInfo + * @memberof google.longrunning.CancelOperationRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.GeneratedCodeInfo} GeneratedCodeInfo + * @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 */ - GeneratedCodeInfo.decodeDelimited = function decodeDelimited(reader) { + CancelOperationRequest.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a GeneratedCodeInfo message. + * Verifies a CancelOperationRequest message. * @function verify - * @memberof google.protobuf.GeneratedCodeInfo + * @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 */ - GeneratedCodeInfo.verify = function verify(message) { + CancelOperationRequest.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; - } - } + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; return null; }; /** - * Creates a GeneratedCodeInfo message from a plain object. Also converts values to their respective internal types. + * Creates a CancelOperationRequest message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.protobuf.GeneratedCodeInfo + * @memberof google.longrunning.CancelOperationRequest * @static * @param {Object.} object Plain object - * @returns {google.protobuf.GeneratedCodeInfo} GeneratedCodeInfo + * @returns {google.longrunning.CancelOperationRequest} CancelOperationRequest */ - GeneratedCodeInfo.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.GeneratedCodeInfo) + CancelOperationRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.longrunning.CancelOperationRequest) 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]); + 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) { + 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(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; } } return message; }; /** - * Creates a plain object from a GeneratedCodeInfo message. Also converts values to other types if specified. + * 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.protobuf.GeneratedCodeInfo + * @memberof google.longrunning.DeleteOperationRequest * @static - * @param {google.protobuf.GeneratedCodeInfo} message GeneratedCodeInfo + * @param {google.longrunning.DeleteOperationRequest} message DeleteOperationRequest * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - GeneratedCodeInfo.toObject = function toObject(message, options) { + DeleteOperationRequest.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); - } + if (options.defaults) + object.name = ""; + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; return object; }; /** - * Converts this GeneratedCodeInfo to JSON. + * Converts this DeleteOperationRequest to JSON. * @function toJSON - * @memberof google.protobuf.GeneratedCodeInfo + * @memberof google.longrunning.DeleteOperationRequest * @instance * @returns {Object.} JSON object */ - GeneratedCodeInfo.prototype.toJSON = function toJSON() { + DeleteOperationRequest.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for GeneratedCodeInfo + * Gets the default type url for DeleteOperationRequest * @function getTypeUrl - * @memberof google.protobuf.GeneratedCodeInfo + * @memberof google.longrunning.DeleteOperationRequest * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - GeneratedCodeInfo.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + DeleteOperationRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.protobuf.GeneratedCodeInfo"; + return typeUrlPrefix + "/google.longrunning.DeleteOperationRequest"; }; - 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 = ""; + return DeleteOperationRequest; + })(); - /** - * Annotation begin. - * @member {number} begin - * @memberof google.protobuf.GeneratedCodeInfo.Annotation - * @instance - */ - Annotation.prototype.begin = 0; + longrunning.WaitOperationRequest = (function() { - /** - * Annotation end. - * @member {number} end - * @memberof google.protobuf.GeneratedCodeInfo.Annotation - * @instance - */ - Annotation.prototype.end = 0; + /** + * Properties of a WaitOperationRequest. + * @memberof google.longrunning + * @interface IWaitOperationRequest + * @property {string|null} [name] WaitOperationRequest name + * @property {google.protobuf.IDuration|null} [timeout] WaitOperationRequest timeout + */ - /** - * Annotation semantic. - * @member {google.protobuf.GeneratedCodeInfo.Annotation.Semantic} semantic - * @memberof google.protobuf.GeneratedCodeInfo.Annotation - * @instance - */ - Annotation.prototype.semantic = 0; + /** + * 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]]; + } - /** - * 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); - }; + /** + * WaitOperationRequest name. + * @member {string} name + * @memberof google.longrunning.WaitOperationRequest + * @instance + */ + WaitOperationRequest.prototype.name = ""; - /** - * 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; - }; + /** + * WaitOperationRequest timeout. + * @member {google.protobuf.IDuration|null|undefined} timeout + * @memberof google.longrunning.WaitOperationRequest + * @instance + */ + WaitOperationRequest.prototype.timeout = null; - /** - * 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(); - }; + /** + * 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); + }; - /** - * 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) { - 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(); - 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; - }; + /** + * 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; + }; - /** - * 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()); - }; + /** + * 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(); + }; - /** - * 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: + /** + * 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) { + 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(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); 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; + case 2: { + message.timeout = $root.google.protobuf.Duration.decode(reader, reader.uint32()); 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; + default: + reader.skipType(tag & 7); break; } - return message; - }; + } + 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]; + /** + * 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) { + 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(); + switch (tag >>> 3) { + case 1: { + message.responseType = reader.string(); + break; + } + case 2: { + message.metadataType = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; } - 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; - }; + } + return message; + }; - /** - * 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); - }; + /** + * 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()); + }; - /** - * 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"; - }; + /** + * 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; + }; - /** - * 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; - })(); + /** + * 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; + }; - return Annotation; - })(); + /** + * 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; + }; - return GeneratedCodeInfo; + /** + * 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; })(); - protobuf.Duration = (function() { + return longrunning; + })(); + + google.rpc = (function() { + + /** + * Namespace rpc. + * @memberof google + * @namespace + */ + var rpc = {}; + + rpc.Status = (function() { /** - * Properties of a Duration. - * @memberof google.protobuf - * @interface IDuration - * @property {number|Long|null} [seconds] Duration seconds - * @property {number|null} [nanos] Duration nanos + * 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 Duration. - * @memberof google.protobuf - * @classdesc Represents a Duration. - * @implements IDuration + * Constructs a new Status. + * @memberof google.rpc + * @classdesc Represents a Status. + * @implements IStatus * @constructor - * @param {google.protobuf.IDuration=} [properties] Properties to set + * @param {google.rpc.IStatus=} [properties] Properties to set */ - function Duration(properties) { + function Status(properties) { + this.details = []; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -22194,89 +40353,106 @@ } /** - * Duration seconds. - * @member {number|Long} seconds - * @memberof google.protobuf.Duration + * Status code. + * @member {number} code + * @memberof google.rpc.Status * @instance */ - Duration.prototype.seconds = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + Status.prototype.code = 0; /** - * Duration nanos. - * @member {number} nanos - * @memberof google.protobuf.Duration + * Status message. + * @member {string} message + * @memberof google.rpc.Status * @instance */ - Duration.prototype.nanos = 0; + Status.prototype.message = ""; /** - * Creates a new Duration instance using the specified properties. + * 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.protobuf.Duration + * @memberof google.rpc.Status * @static - * @param {google.protobuf.IDuration=} [properties] Properties to set - * @returns {google.protobuf.Duration} Duration instance + * @param {google.rpc.IStatus=} [properties] Properties to set + * @returns {google.rpc.Status} Status instance */ - Duration.create = function create(properties) { - return new Duration(properties); + Status.create = function create(properties) { + return new Status(properties); }; /** - * Encodes the specified Duration message. Does not implicitly {@link google.protobuf.Duration.verify|verify} messages. + * Encodes the specified Status message. Does not implicitly {@link google.rpc.Status.verify|verify} messages. * @function encode - * @memberof google.protobuf.Duration + * @memberof google.rpc.Status * @static - * @param {google.protobuf.IDuration} message Duration message or plain object to encode + * @param {google.rpc.IStatus} message Status message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - Duration.encode = function encode(message, writer) { + Status.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); + 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 Duration message, length delimited. Does not implicitly {@link google.protobuf.Duration.verify|verify} messages. + * Encodes the specified Status message, length delimited. Does not implicitly {@link google.rpc.Status.verify|verify} messages. * @function encodeDelimited - * @memberof google.protobuf.Duration + * @memberof google.rpc.Status * @static - * @param {google.protobuf.IDuration} message Duration message or plain object to encode + * @param {google.rpc.IStatus} message Status message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - Duration.encodeDelimited = function encodeDelimited(message, writer) { + Status.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a Duration message from the specified reader or buffer. + * Decodes a Status message from the specified reader or buffer. * @function decode - * @memberof google.protobuf.Duration + * @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.protobuf.Duration} Duration + * @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 */ - Duration.decode = function decode(reader, length) { + Status.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.Duration(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.rpc.Status(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: { - message.seconds = reader.int64(); + message.code = reader.int32(); break; } case 2: { - message.nanos = reader.int32(); + 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: @@ -22288,128 +40464,140 @@ }; /** - * Decodes a Duration message from the specified reader or buffer, length delimited. + * Decodes a Status message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.protobuf.Duration + * @memberof google.rpc.Status * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.Duration} Duration + * @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 */ - Duration.decodeDelimited = function decodeDelimited(reader) { + Status.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a Duration message. + * Verifies a Status message. * @function verify - * @memberof google.protobuf.Duration + * @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 */ - Duration.verify = function verify(message) { + Status.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"; + 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 Duration message from a plain object. Also converts values to their respective internal types. + * Creates a Status message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.protobuf.Duration + * @memberof google.rpc.Status * @static * @param {Object.} object Plain object - * @returns {google.protobuf.Duration} Duration + * @returns {google.rpc.Status} Status */ - Duration.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.Duration) + Status.fromObject = function fromObject(object) { + if (object instanceof $root.google.rpc.Status) 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; + 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 Duration message. Also converts values to other types if specified. + * Creates a plain object from a Status message. Also converts values to other types if specified. * @function toObject - * @memberof google.protobuf.Duration + * @memberof google.rpc.Status * @static - * @param {google.protobuf.Duration} message Duration + * @param {google.rpc.Status} message Status * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - Duration.toObject = function toObject(message, options) { + Status.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; + if (options.arrays || options.defaults) + object.details = []; 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; + 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); } - 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. + * Converts this Status to JSON. * @function toJSON - * @memberof google.protobuf.Duration + * @memberof google.rpc.Status * @instance * @returns {Object.} JSON object */ - Duration.prototype.toJSON = function toJSON() { + Status.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for Duration + * Gets the default type url for Status * @function getTypeUrl - * @memberof google.protobuf.Duration + * @memberof google.rpc.Status * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - Duration.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + Status.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.protobuf.Duration"; + return typeUrlPrefix + "/google.rpc.Status"; }; - return Duration; + return Status; })(); - return protobuf; + return rpc; })(); return google; diff --git a/packages/google-ai-generativelanguage/protos/protos.json b/packages/google-ai-generativelanguage/protos/protos.json index 5d063446647..98ca7d83606 100644 --- a/packages/google-ai-generativelanguage/protos/protos.json +++ b/packages/google-ai-generativelanguage/protos/protos.json @@ -851,6 +851,1832 @@ } } } + }, + "v1beta3": { + "options": { + "go_package": "cloud.google.com/go/ai/generativelanguage/apiv1beta3/generativelanguagepb;generativelanguagepb", + "java_multiple_files": true, + "java_outer_classname": "TextServiceProto", + "java_package": "com.google.ai.generativelanguage.v1beta3" + }, + "nested": { + "CitationMetadata": { + "fields": { + "citationSources": { + "rule": "repeated", + "type": "CitationSource", + "id": 1 + } + } + }, + "CitationSource": { + "oneofs": { + "_startIndex": { + "oneof": [ + "startIndex" + ] + }, + "_endIndex": { + "oneof": [ + "endIndex" + ] + }, + "_uri": { + "oneof": [ + "uri" + ] + }, + "_license": { + "oneof": [ + "license" + ] + } + }, + "fields": { + "startIndex": { + "type": "int32", + "id": 1, + "options": { + "(google.api.field_behavior)": "OPTIONAL", + "proto3_optional": true + } + }, + "endIndex": { + "type": "int32", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL", + "proto3_optional": true + } + }, + "uri": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL", + "proto3_optional": true + } + }, + "license": { + "type": "string", + "id": 4, + "options": { + "(google.api.field_behavior)": "OPTIONAL", + "proto3_optional": true + } + } + } + }, + "DiscussService": { + "options": { + "(google.api.default_host)": "generativelanguage.googleapis.com" + }, + "methods": { + "GenerateMessage": { + "requestType": "GenerateMessageRequest", + "responseType": "GenerateMessageResponse", + "options": { + "(google.api.http).post": "/v1beta3/{model=models/*}:generateMessage", + "(google.api.http).body": "*", + "(google.api.method_signature)": "model,prompt,temperature,candidate_count,top_p,top_k" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1beta3/{model=models/*}:generateMessage", + "body": "*" + } + }, + { + "(google.api.method_signature)": "model,prompt,temperature,candidate_count,top_p,top_k" + } + ] + }, + "CountMessageTokens": { + "requestType": "CountMessageTokensRequest", + "responseType": "CountMessageTokensResponse", + "options": { + "(google.api.http).post": "/v1beta3/{model=models/*}:countMessageTokens", + "(google.api.http).body": "*", + "(google.api.method_signature)": "model,prompt" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1beta3/{model=models/*}:countMessageTokens", + "body": "*" + } + }, + { + "(google.api.method_signature)": "model,prompt" + } + ] + } + } + }, + "GenerateMessageRequest": { + "oneofs": { + "_temperature": { + "oneof": [ + "temperature" + ] + }, + "_candidateCount": { + "oneof": [ + "candidateCount" + ] + }, + "_topP": { + "oneof": [ + "topP" + ] + }, + "_topK": { + "oneof": [ + "topK" + ] + } + }, + "fields": { + "model": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "generativelanguage.googleapis.com/Model" + } + }, + "prompt": { + "type": "MessagePrompt", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "temperature": { + "type": "float", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL", + "proto3_optional": true + } + }, + "candidateCount": { + "type": "int32", + "id": 4, + "options": { + "(google.api.field_behavior)": "OPTIONAL", + "proto3_optional": true + } + }, + "topP": { + "type": "float", + "id": 5, + "options": { + "(google.api.field_behavior)": "OPTIONAL", + "proto3_optional": true + } + }, + "topK": { + "type": "int32", + "id": 6, + "options": { + "(google.api.field_behavior)": "OPTIONAL", + "proto3_optional": true + } + } + } + }, + "GenerateMessageResponse": { + "fields": { + "candidates": { + "rule": "repeated", + "type": "Message", + "id": 1 + }, + "messages": { + "rule": "repeated", + "type": "Message", + "id": 2 + }, + "filters": { + "rule": "repeated", + "type": "ContentFilter", + "id": 3 + } + } + }, + "Message": { + "oneofs": { + "_citationMetadata": { + "oneof": [ + "citationMetadata" + ] + } + }, + "fields": { + "author": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "content": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "citationMetadata": { + "type": "CitationMetadata", + "id": 3, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY", + "proto3_optional": true + } + } + } + }, + "MessagePrompt": { + "fields": { + "context": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "examples": { + "rule": "repeated", + "type": "Example", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "messages": { + "rule": "repeated", + "type": "Message", + "id": 3, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "Example": { + "fields": { + "input": { + "type": "Message", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "output": { + "type": "Message", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "CountMessageTokensRequest": { + "fields": { + "model": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "generativelanguage.googleapis.com/Model" + } + }, + "prompt": { + "type": "MessagePrompt", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "CountMessageTokensResponse": { + "fields": { + "tokenCount": { + "type": "int32", + "id": 1 + } + } + }, + "HarmCategory": { + "values": { + "HARM_CATEGORY_UNSPECIFIED": 0, + "HARM_CATEGORY_DEROGATORY": 1, + "HARM_CATEGORY_TOXICITY": 2, + "HARM_CATEGORY_VIOLENCE": 3, + "HARM_CATEGORY_SEXUAL": 4, + "HARM_CATEGORY_MEDICAL": 5, + "HARM_CATEGORY_DANGEROUS": 6 + } + }, + "ContentFilter": { + "oneofs": { + "_message": { + "oneof": [ + "message" + ] + } + }, + "fields": { + "reason": { + "type": "BlockedReason", + "id": 1 + }, + "message": { + "type": "string", + "id": 2, + "options": { + "proto3_optional": true + } + } + }, + "nested": { + "BlockedReason": { + "values": { + "BLOCKED_REASON_UNSPECIFIED": 0, + "SAFETY": 1, + "OTHER": 2 + } + } + } + }, + "SafetyFeedback": { + "fields": { + "rating": { + "type": "SafetyRating", + "id": 1 + }, + "setting": { + "type": "SafetySetting", + "id": 2 + } + } + }, + "SafetyRating": { + "fields": { + "category": { + "type": "HarmCategory", + "id": 3, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "probability": { + "type": "HarmProbability", + "id": 4, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + }, + "nested": { + "HarmProbability": { + "values": { + "HARM_PROBABILITY_UNSPECIFIED": 0, + "NEGLIGIBLE": 1, + "LOW": 2, + "MEDIUM": 3, + "HIGH": 4 + } + } + } + }, + "SafetySetting": { + "fields": { + "category": { + "type": "HarmCategory", + "id": 3, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "threshold": { + "type": "HarmBlockThreshold", + "id": 4, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + }, + "nested": { + "HarmBlockThreshold": { + "values": { + "HARM_BLOCK_THRESHOLD_UNSPECIFIED": 0, + "BLOCK_LOW_AND_ABOVE": 1, + "BLOCK_MEDIUM_AND_ABOVE": 2, + "BLOCK_ONLY_HIGH": 3, + "BLOCK_NONE": 4 + } + } + } + }, + "Model": { + "options": { + "(google.api.resource).type": "generativelanguage.googleapis.com/Model", + "(google.api.resource).pattern": "models/{model}" + }, + "oneofs": { + "_temperature": { + "oneof": [ + "temperature" + ] + }, + "_topP": { + "oneof": [ + "topP" + ] + }, + "_topK": { + "oneof": [ + "topK" + ] + } + }, + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "baseModelId": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "version": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "displayName": { + "type": "string", + "id": 4 + }, + "description": { + "type": "string", + "id": 5 + }, + "inputTokenLimit": { + "type": "int32", + "id": 6 + }, + "outputTokenLimit": { + "type": "int32", + "id": 7 + }, + "supportedGenerationMethods": { + "rule": "repeated", + "type": "string", + "id": 8 + }, + "temperature": { + "type": "float", + "id": 9, + "options": { + "proto3_optional": true + } + }, + "topP": { + "type": "float", + "id": 10, + "options": { + "proto3_optional": true + } + }, + "topK": { + "type": "int32", + "id": 11, + "options": { + "proto3_optional": true + } + } + } + }, + "ModelService": { + "options": { + "(google.api.default_host)": "generativelanguage.googleapis.com" + }, + "methods": { + "GetModel": { + "requestType": "GetModelRequest", + "responseType": "Model", + "options": { + "(google.api.http).get": "/v1beta3/{name=models/*}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1beta3/{name=models/*}" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "ListModels": { + "requestType": "ListModelsRequest", + "responseType": "ListModelsResponse", + "options": { + "(google.api.http).get": "/v1beta3/models", + "(google.api.method_signature)": "page_size,page_token" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1beta3/models" + } + }, + { + "(google.api.method_signature)": "page_size,page_token" + } + ] + }, + "GetTunedModel": { + "requestType": "GetTunedModelRequest", + "responseType": "TunedModel", + "options": { + "(google.api.http).get": "/v1beta3/{name=tunedModels/*}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1beta3/{name=tunedModels/*}" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "ListTunedModels": { + "requestType": "ListTunedModelsRequest", + "responseType": "ListTunedModelsResponse", + "options": { + "(google.api.http).get": "/v1beta3/tunedModels", + "(google.api.method_signature)": "page_size,page_token" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1beta3/tunedModels" + } + }, + { + "(google.api.method_signature)": "page_size,page_token" + } + ] + }, + "CreateTunedModel": { + "requestType": "CreateTunedModelRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).post": "/v1beta3/tunedModels", + "(google.api.http).body": "tuned_model", + "(google.api.method_signature)": "tuned_model_id,tuned_model", + "(google.longrunning.operation_info).response_type": "TunedModel", + "(google.longrunning.operation_info).metadata_type": "CreateTunedModelMetadata" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1beta3/tunedModels", + "body": "tuned_model" + } + }, + { + "(google.api.method_signature)": "tuned_model" + }, + { + "(google.api.method_signature)": "tuned_model_id,tuned_model" + }, + { + "(google.longrunning.operation_info)": { + "response_type": "TunedModel", + "metadata_type": "CreateTunedModelMetadata" + } + } + ] + }, + "UpdateTunedModel": { + "requestType": "UpdateTunedModelRequest", + "responseType": "TunedModel", + "options": { + "(google.api.http).patch": "/v1beta3/{tuned_model.name=tunedModels/*}", + "(google.api.http).body": "tuned_model", + "(google.api.method_signature)": "tuned_model,update_mask" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "patch": "/v1beta3/{tuned_model.name=tunedModels/*}", + "body": "tuned_model" + } + }, + { + "(google.api.method_signature)": "tuned_model,update_mask" + } + ] + }, + "DeleteTunedModel": { + "requestType": "DeleteTunedModelRequest", + "responseType": "google.protobuf.Empty", + "options": { + "(google.api.http).delete": "/v1beta3/{name=tunedModels/*}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "delete": "/v1beta3/{name=tunedModels/*}" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + } + } + }, + "GetModelRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "generativelanguage.googleapis.com/Model" + } + } + } + }, + "ListModelsRequest": { + "fields": { + "pageSize": { + "type": "int32", + "id": 2 + }, + "pageToken": { + "type": "string", + "id": 3 + } + } + }, + "ListModelsResponse": { + "fields": { + "models": { + "rule": "repeated", + "type": "Model", + "id": 1 + }, + "nextPageToken": { + "type": "string", + "id": 2 + } + } + }, + "GetTunedModelRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "generativelanguage.googleapis.com/TunedModel" + } + } + } + }, + "ListTunedModelsRequest": { + "fields": { + "pageSize": { + "type": "int32", + "id": 1, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "pageToken": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "ListTunedModelsResponse": { + "fields": { + "tunedModels": { + "rule": "repeated", + "type": "TunedModel", + "id": 1 + }, + "nextPageToken": { + "type": "string", + "id": 2 + } + } + }, + "CreateTunedModelRequest": { + "oneofs": { + "_tunedModelId": { + "oneof": [ + "tunedModelId" + ] + } + }, + "fields": { + "tunedModelId": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "OPTIONAL", + "proto3_optional": true + } + }, + "tunedModel": { + "type": "TunedModel", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "CreateTunedModelMetadata": { + "fields": { + "tunedModel": { + "type": "string", + "id": 5, + "options": { + "(google.api.resource_reference).type": "generativelanguage.googleapis.com/TunedModel" + } + }, + "totalSteps": { + "type": "int32", + "id": 1 + }, + "completedSteps": { + "type": "int32", + "id": 2 + }, + "completedPercent": { + "type": "float", + "id": 3 + }, + "snapshots": { + "rule": "repeated", + "type": "TuningSnapshot", + "id": 4 + } + } + }, + "UpdateTunedModelRequest": { + "fields": { + "tunedModel": { + "type": "TunedModel", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "updateMask": { + "type": "google.protobuf.FieldMask", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "DeleteTunedModelRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "generativelanguage.googleapis.com/TunedModel" + } + } + } + }, + "TunedModel": { + "options": { + "(google.api.resource).type": "generativelanguage.googleapis.com/TunedModel", + "(google.api.resource).pattern": "tunedModels/{tuned_model}", + "(google.api.resource).plural": "tunedModels", + "(google.api.resource).singular": "tunedModel" + }, + "oneofs": { + "sourceModel": { + "oneof": [ + "tunedModelSource", + "baseModel" + ] + }, + "_temperature": { + "oneof": [ + "temperature" + ] + }, + "_topP": { + "oneof": [ + "topP" + ] + }, + "_topK": { + "oneof": [ + "topK" + ] + } + }, + "fields": { + "tunedModelSource": { + "type": "TunedModelSource", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "baseModel": { + "type": "string", + "id": 4, + "options": { + "(google.api.field_behavior)": "IMMUTABLE", + "(google.api.resource_reference).type": "generativelanguage.googleapis.com/Model" + } + }, + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "displayName": { + "type": "string", + "id": 5, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "description": { + "type": "string", + "id": 6, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "temperature": { + "type": "float", + "id": 11, + "options": { + "(google.api.field_behavior)": "OPTIONAL", + "proto3_optional": true + } + }, + "topP": { + "type": "float", + "id": 12, + "options": { + "(google.api.field_behavior)": "OPTIONAL", + "proto3_optional": true + } + }, + "topK": { + "type": "int32", + "id": 13, + "options": { + "(google.api.field_behavior)": "OPTIONAL", + "proto3_optional": true + } + }, + "state": { + "type": "State", + "id": 7, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "createTime": { + "type": "google.protobuf.Timestamp", + "id": 8, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "updateTime": { + "type": "google.protobuf.Timestamp", + "id": 9, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "tuningTask": { + "type": "TuningTask", + "id": 10, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + }, + "nested": { + "State": { + "values": { + "STATE_UNSPECIFIED": 0, + "CREATING": 1, + "ACTIVE": 2, + "FAILED": 3 + } + } + } + }, + "TunedModelSource": { + "fields": { + "tunedModel": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "IMMUTABLE", + "(google.api.resource_reference).type": "generativelanguage.googleapis.com/TunedModel" + } + }, + "baseModel": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY", + "(google.api.resource_reference).type": "generativelanguage.googleapis.com/Model" + } + } + } + }, + "TuningTask": { + "fields": { + "startTime": { + "type": "google.protobuf.Timestamp", + "id": 1, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "completeTime": { + "type": "google.protobuf.Timestamp", + "id": 2, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "snapshots": { + "rule": "repeated", + "type": "TuningSnapshot", + "id": 3, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "trainingData": { + "type": "Dataset", + "id": 4, + "options": { + "(google.api.field_behavior)": "IMMUTABLE" + } + }, + "hyperparameters": { + "type": "Hyperparameters", + "id": 5, + "options": { + "(google.api.field_behavior)": "IMMUTABLE" + } + } + } + }, + "Hyperparameters": { + "oneofs": { + "_epochCount": { + "oneof": [ + "epochCount" + ] + }, + "_batchSize": { + "oneof": [ + "batchSize" + ] + }, + "_learningRate": { + "oneof": [ + "learningRate" + ] + } + }, + "fields": { + "epochCount": { + "type": "int32", + "id": 14, + "options": { + "(google.api.field_behavior)": "IMMUTABLE", + "proto3_optional": true + } + }, + "batchSize": { + "type": "int32", + "id": 15, + "options": { + "(google.api.field_behavior)": "IMMUTABLE", + "proto3_optional": true + } + }, + "learningRate": { + "type": "float", + "id": 16, + "options": { + "(google.api.field_behavior)": "IMMUTABLE", + "proto3_optional": true + } + } + } + }, + "Dataset": { + "oneofs": { + "dataset": { + "oneof": [ + "examples" + ] + } + }, + "fields": { + "examples": { + "type": "TuningExamples", + "id": 1, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "TuningExamples": { + "fields": { + "examples": { + "rule": "repeated", + "type": "TuningExample", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "TuningExample": { + "oneofs": { + "modelInput": { + "oneof": [ + "textInput" + ] + } + }, + "fields": { + "textInput": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "output": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "TuningSnapshot": { + "fields": { + "step": { + "type": "int32", + "id": 1, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "epoch": { + "type": "int32", + "id": 2, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "meanLoss": { + "type": "float", + "id": 3, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "computeTime": { + "type": "google.protobuf.Timestamp", + "id": 4, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + } + } + }, + "Permission": { + "options": { + "(google.api.resource).type": "generativelanguage.googleapis.com/Permission", + "(google.api.resource).pattern": "tunedModels/{tuned_model}/permissions/{permission}", + "(google.api.resource).plural": "permissions", + "(google.api.resource).singular": "permission" + }, + "oneofs": { + "_granteeType": { + "oneof": [ + "granteeType" + ] + }, + "_emailAddress": { + "oneof": [ + "emailAddress" + ] + }, + "_role": { + "oneof": [ + "role" + ] + } + }, + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "granteeType": { + "type": "GranteeType", + "id": 2, + "options": { + "(google.api.field_behavior)": "IMMUTABLE", + "proto3_optional": true + } + }, + "emailAddress": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "IMMUTABLE", + "proto3_optional": true + } + }, + "role": { + "type": "Role", + "id": 4, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "proto3_optional": true + } + } + }, + "nested": { + "GranteeType": { + "values": { + "GRANTEE_TYPE_UNSPECIFIED": 0, + "USER": 1, + "GROUP": 2, + "EVERYONE": 3 + } + }, + "Role": { + "values": { + "ROLE_UNSPECIFIED": 0, + "OWNER": 1, + "WRITER": 2, + "READER": 3 + } + } + } + }, + "PermissionService": { + "options": { + "(google.api.default_host)": "generativelanguage.googleapis.com" + }, + "methods": { + "CreatePermission": { + "requestType": "CreatePermissionRequest", + "responseType": "Permission", + "options": { + "(google.api.http).post": "/v1beta3/{parent=tunedModels/*}/permissions", + "(google.api.http).body": "permission", + "(google.api.method_signature)": "parent,permission" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1beta3/{parent=tunedModels/*}/permissions", + "body": "permission" + } + }, + { + "(google.api.method_signature)": "parent,permission" + } + ] + }, + "GetPermission": { + "requestType": "GetPermissionRequest", + "responseType": "Permission", + "options": { + "(google.api.http).get": "/v1beta3/{name=tunedModels/*/permissions/*}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1beta3/{name=tunedModels/*/permissions/*}" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "ListPermissions": { + "requestType": "ListPermissionsRequest", + "responseType": "ListPermissionsResponse", + "options": { + "(google.api.http).get": "/v1beta3/{parent=tunedModels/*}/permissions", + "(google.api.method_signature)": "parent" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1beta3/{parent=tunedModels/*}/permissions" + } + }, + { + "(google.api.method_signature)": "parent" + } + ] + }, + "UpdatePermission": { + "requestType": "UpdatePermissionRequest", + "responseType": "Permission", + "options": { + "(google.api.http).patch": "/v1beta3/{permission.name=tunedModels/*/permissions/*}", + "(google.api.http).body": "permission", + "(google.api.method_signature)": "permission,update_mask" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "patch": "/v1beta3/{permission.name=tunedModels/*/permissions/*}", + "body": "permission" + } + }, + { + "(google.api.method_signature)": "permission,update_mask" + } + ] + }, + "DeletePermission": { + "requestType": "DeletePermissionRequest", + "responseType": "google.protobuf.Empty", + "options": { + "(google.api.http).delete": "/v1beta3/{name=tunedModels/*/permissions/*}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "delete": "/v1beta3/{name=tunedModels/*/permissions/*}" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "TransferOwnership": { + "requestType": "TransferOwnershipRequest", + "responseType": "TransferOwnershipResponse", + "options": { + "(google.api.http).post": "/v1beta3/{name=tunedModels/*}:transferOwnership", + "(google.api.http).body": "*" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1beta3/{name=tunedModels/*}:transferOwnership", + "body": "*" + } + } + ] + } + } + }, + "CreatePermissionRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).child_type": "generativelanguage.googleapis.com/Permission" + } + }, + "permission": { + "type": "Permission", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "GetPermissionRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "generativelanguage.googleapis.com/Permission" + } + } + } + }, + "ListPermissionsRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "*" + } + }, + "pageSize": { + "type": "int32", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "pageToken": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "ListPermissionsResponse": { + "fields": { + "permissions": { + "rule": "repeated", + "type": "Permission", + "id": 1 + }, + "nextPageToken": { + "type": "string", + "id": 2 + } + } + }, + "UpdatePermissionRequest": { + "fields": { + "permission": { + "type": "Permission", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "updateMask": { + "type": "google.protobuf.FieldMask", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "DeletePermissionRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "generativelanguage.googleapis.com/Permission" + } + } + } + }, + "TransferOwnershipRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "generativelanguage.googleapis.com/TunedModel" + } + }, + "emailAddress": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "TransferOwnershipResponse": { + "fields": {} + }, + "TextService": { + "options": { + "(google.api.default_host)": "generativelanguage.googleapis.com" + }, + "methods": { + "GenerateText": { + "requestType": "GenerateTextRequest", + "responseType": "GenerateTextResponse", + "options": { + "(google.api.http).post": "/v1beta3/{model=models/*}:generateText", + "(google.api.http).body": "*", + "(google.api.http).additional_bindings.post": "/v1beta3/{model=tunedModels/*}:generateText", + "(google.api.http).additional_bindings.body": "*", + "(google.api.method_signature)": "model,prompt,temperature,candidate_count,max_output_tokens,top_p,top_k" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1beta3/{model=models/*}:generateText", + "body": "*", + "additional_bindings": { + "post": "/v1beta3/{model=tunedModels/*}:generateText", + "body": "*" + } + } + }, + { + "(google.api.method_signature)": "model,prompt,temperature,candidate_count,max_output_tokens,top_p,top_k" + } + ] + }, + "EmbedText": { + "requestType": "EmbedTextRequest", + "responseType": "EmbedTextResponse", + "options": { + "(google.api.http).post": "/v1beta3/{model=models/*}:embedText", + "(google.api.http).body": "*", + "(google.api.method_signature)": "model,text" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1beta3/{model=models/*}:embedText", + "body": "*" + } + }, + { + "(google.api.method_signature)": "model,text" + } + ] + }, + "BatchEmbedText": { + "requestType": "BatchEmbedTextRequest", + "responseType": "BatchEmbedTextResponse", + "options": { + "(google.api.http).post": "/v1beta3/{model=models/*}:batchEmbedText", + "(google.api.http).body": "*", + "(google.api.method_signature)": "model,texts" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1beta3/{model=models/*}:batchEmbedText", + "body": "*" + } + }, + { + "(google.api.method_signature)": "model,texts" + } + ] + }, + "CountTextTokens": { + "requestType": "CountTextTokensRequest", + "responseType": "CountTextTokensResponse", + "options": { + "(google.api.http).post": "/v1beta3/{model=models/*}:countTextTokens", + "(google.api.http).body": "*", + "(google.api.method_signature)": "model,prompt" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1beta3/{model=models/*}:countTextTokens", + "body": "*" + } + }, + { + "(google.api.method_signature)": "model,prompt" + } + ] + } + } + }, + "GenerateTextRequest": { + "oneofs": { + "_temperature": { + "oneof": [ + "temperature" + ] + }, + "_candidateCount": { + "oneof": [ + "candidateCount" + ] + }, + "_maxOutputTokens": { + "oneof": [ + "maxOutputTokens" + ] + }, + "_topP": { + "oneof": [ + "topP" + ] + }, + "_topK": { + "oneof": [ + "topK" + ] + } + }, + "fields": { + "model": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "prompt": { + "type": "TextPrompt", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "temperature": { + "type": "float", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL", + "proto3_optional": true + } + }, + "candidateCount": { + "type": "int32", + "id": 4, + "options": { + "(google.api.field_behavior)": "OPTIONAL", + "proto3_optional": true + } + }, + "maxOutputTokens": { + "type": "int32", + "id": 5, + "options": { + "(google.api.field_behavior)": "OPTIONAL", + "proto3_optional": true + } + }, + "topP": { + "type": "float", + "id": 6, + "options": { + "(google.api.field_behavior)": "OPTIONAL", + "proto3_optional": true + } + }, + "topK": { + "type": "int32", + "id": 7, + "options": { + "(google.api.field_behavior)": "OPTIONAL", + "proto3_optional": true + } + }, + "safetySettings": { + "rule": "repeated", + "type": "SafetySetting", + "id": 8 + }, + "stopSequences": { + "rule": "repeated", + "type": "string", + "id": 9 + } + } + }, + "GenerateTextResponse": { + "fields": { + "candidates": { + "rule": "repeated", + "type": "TextCompletion", + "id": 1 + }, + "filters": { + "rule": "repeated", + "type": "ContentFilter", + "id": 3 + }, + "safetyFeedback": { + "rule": "repeated", + "type": "SafetyFeedback", + "id": 4 + } + } + }, + "TextPrompt": { + "fields": { + "text": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "TextCompletion": { + "oneofs": { + "_citationMetadata": { + "oneof": [ + "citationMetadata" + ] + } + }, + "fields": { + "output": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "safetyRatings": { + "rule": "repeated", + "type": "SafetyRating", + "id": 2 + }, + "citationMetadata": { + "type": "CitationMetadata", + "id": 3, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY", + "proto3_optional": true + } + } + } + }, + "EmbedTextRequest": { + "fields": { + "model": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "generativelanguage.googleapis.com/Model" + } + }, + "text": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "EmbedTextResponse": { + "oneofs": { + "_embedding": { + "oneof": [ + "embedding" + ] + } + }, + "fields": { + "embedding": { + "type": "Embedding", + "id": 1, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY", + "proto3_optional": true + } + } + } + }, + "BatchEmbedTextRequest": { + "fields": { + "model": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "generativelanguage.googleapis.com/Model" + } + }, + "texts": { + "rule": "repeated", + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "BatchEmbedTextResponse": { + "fields": { + "embeddings": { + "rule": "repeated", + "type": "Embedding", + "id": 1, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + } + } + }, + "Embedding": { + "fields": { + "value": { + "rule": "repeated", + "type": "float", + "id": 1 + } + } + }, + "CountTextTokensRequest": { + "fields": { + "model": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "generativelanguage.googleapis.com/Model" + } + }, + "prompt": { + "type": "TextPrompt", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "CountTextTokensResponse": { + "fields": { + "tokenCount": { + "type": "int32", + "id": 1 + } + } + } + } } } } @@ -2300,6 +4126,287 @@ "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": {} + }, + "FieldMask": { + "fields": { + "paths": { + "rule": "repeated", + "type": "string", + "id": 1 + } + } + } + } + }, + "longrunning": { + "options": { + "cc_enable_arenas": true, + "csharp_namespace": "Google.LongRunning", + "go_package": "google.golang.org/genproto/googleapis/longrunning;longrunning", + "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 + } + } } } } diff --git a/packages/google-ai-generativelanguage/samples/README.md b/packages/google-ai-generativelanguage/samples/README.md index 143d911e9f0..388b784369c 100644 --- a/packages/google-ai-generativelanguage/samples/README.md +++ b/packages/google-ai-generativelanguage/samples/README.md @@ -18,6 +18,25 @@ * [Model_service.list_models](#model_service.list_models) * [Text_service.embed_text](#text_service.embed_text) * [Text_service.generate_text](#text_service.generate_text) + * [Discuss_service.count_message_tokens](#discuss_service.count_message_tokens) + * [Discuss_service.generate_message](#discuss_service.generate_message) + * [Model_service.create_tuned_model](#model_service.create_tuned_model) + * [Model_service.delete_tuned_model](#model_service.delete_tuned_model) + * [Model_service.get_model](#model_service.get_model) + * [Model_service.get_tuned_model](#model_service.get_tuned_model) + * [Model_service.list_models](#model_service.list_models) + * [Model_service.list_tuned_models](#model_service.list_tuned_models) + * [Model_service.update_tuned_model](#model_service.update_tuned_model) + * [Permission_service.create_permission](#permission_service.create_permission) + * [Permission_service.delete_permission](#permission_service.delete_permission) + * [Permission_service.get_permission](#permission_service.get_permission) + * [Permission_service.list_permissions](#permission_service.list_permissions) + * [Permission_service.transfer_ownership](#permission_service.transfer_ownership) + * [Permission_service.update_permission](#permission_service.update_permission) + * [Text_service.batch_embed_text](#text_service.batch_embed_text) + * [Text_service.count_text_tokens](#text_service.count_text_tokens) + * [Text_service.embed_text](#text_service.embed_text) + * [Text_service.generate_text](#text_service.generate_text) * [Quickstart](#quickstart) ## Before you begin @@ -137,6 +156,329 @@ __Usage:__ +### Discuss_service.count_message_tokens + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-ai-generativelanguage/samples/generated/v1beta3/discuss_service.count_message_tokens.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-ai-generativelanguage/samples/generated/v1beta3/discuss_service.count_message_tokens.js,samples/README.md) + +__Usage:__ + + +`node packages/google-ai-generativelanguage/samples/generated/v1beta3/discuss_service.count_message_tokens.js` + + +----- + + + + +### Discuss_service.generate_message + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-ai-generativelanguage/samples/generated/v1beta3/discuss_service.generate_message.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-ai-generativelanguage/samples/generated/v1beta3/discuss_service.generate_message.js,samples/README.md) + +__Usage:__ + + +`node packages/google-ai-generativelanguage/samples/generated/v1beta3/discuss_service.generate_message.js` + + +----- + + + + +### Model_service.create_tuned_model + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-ai-generativelanguage/samples/generated/v1beta3/model_service.create_tuned_model.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-ai-generativelanguage/samples/generated/v1beta3/model_service.create_tuned_model.js,samples/README.md) + +__Usage:__ + + +`node packages/google-ai-generativelanguage/samples/generated/v1beta3/model_service.create_tuned_model.js` + + +----- + + + + +### Model_service.delete_tuned_model + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-ai-generativelanguage/samples/generated/v1beta3/model_service.delete_tuned_model.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-ai-generativelanguage/samples/generated/v1beta3/model_service.delete_tuned_model.js,samples/README.md) + +__Usage:__ + + +`node packages/google-ai-generativelanguage/samples/generated/v1beta3/model_service.delete_tuned_model.js` + + +----- + + + + +### Model_service.get_model + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-ai-generativelanguage/samples/generated/v1beta3/model_service.get_model.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-ai-generativelanguage/samples/generated/v1beta3/model_service.get_model.js,samples/README.md) + +__Usage:__ + + +`node packages/google-ai-generativelanguage/samples/generated/v1beta3/model_service.get_model.js` + + +----- + + + + +### Model_service.get_tuned_model + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-ai-generativelanguage/samples/generated/v1beta3/model_service.get_tuned_model.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-ai-generativelanguage/samples/generated/v1beta3/model_service.get_tuned_model.js,samples/README.md) + +__Usage:__ + + +`node packages/google-ai-generativelanguage/samples/generated/v1beta3/model_service.get_tuned_model.js` + + +----- + + + + +### Model_service.list_models + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-ai-generativelanguage/samples/generated/v1beta3/model_service.list_models.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-ai-generativelanguage/samples/generated/v1beta3/model_service.list_models.js,samples/README.md) + +__Usage:__ + + +`node packages/google-ai-generativelanguage/samples/generated/v1beta3/model_service.list_models.js` + + +----- + + + + +### Model_service.list_tuned_models + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-ai-generativelanguage/samples/generated/v1beta3/model_service.list_tuned_models.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-ai-generativelanguage/samples/generated/v1beta3/model_service.list_tuned_models.js,samples/README.md) + +__Usage:__ + + +`node packages/google-ai-generativelanguage/samples/generated/v1beta3/model_service.list_tuned_models.js` + + +----- + + + + +### Model_service.update_tuned_model + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-ai-generativelanguage/samples/generated/v1beta3/model_service.update_tuned_model.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-ai-generativelanguage/samples/generated/v1beta3/model_service.update_tuned_model.js,samples/README.md) + +__Usage:__ + + +`node packages/google-ai-generativelanguage/samples/generated/v1beta3/model_service.update_tuned_model.js` + + +----- + + + + +### Permission_service.create_permission + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-ai-generativelanguage/samples/generated/v1beta3/permission_service.create_permission.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-ai-generativelanguage/samples/generated/v1beta3/permission_service.create_permission.js,samples/README.md) + +__Usage:__ + + +`node packages/google-ai-generativelanguage/samples/generated/v1beta3/permission_service.create_permission.js` + + +----- + + + + +### Permission_service.delete_permission + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-ai-generativelanguage/samples/generated/v1beta3/permission_service.delete_permission.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-ai-generativelanguage/samples/generated/v1beta3/permission_service.delete_permission.js,samples/README.md) + +__Usage:__ + + +`node packages/google-ai-generativelanguage/samples/generated/v1beta3/permission_service.delete_permission.js` + + +----- + + + + +### Permission_service.get_permission + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-ai-generativelanguage/samples/generated/v1beta3/permission_service.get_permission.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-ai-generativelanguage/samples/generated/v1beta3/permission_service.get_permission.js,samples/README.md) + +__Usage:__ + + +`node packages/google-ai-generativelanguage/samples/generated/v1beta3/permission_service.get_permission.js` + + +----- + + + + +### Permission_service.list_permissions + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-ai-generativelanguage/samples/generated/v1beta3/permission_service.list_permissions.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-ai-generativelanguage/samples/generated/v1beta3/permission_service.list_permissions.js,samples/README.md) + +__Usage:__ + + +`node packages/google-ai-generativelanguage/samples/generated/v1beta3/permission_service.list_permissions.js` + + +----- + + + + +### Permission_service.transfer_ownership + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-ai-generativelanguage/samples/generated/v1beta3/permission_service.transfer_ownership.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-ai-generativelanguage/samples/generated/v1beta3/permission_service.transfer_ownership.js,samples/README.md) + +__Usage:__ + + +`node packages/google-ai-generativelanguage/samples/generated/v1beta3/permission_service.transfer_ownership.js` + + +----- + + + + +### Permission_service.update_permission + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-ai-generativelanguage/samples/generated/v1beta3/permission_service.update_permission.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-ai-generativelanguage/samples/generated/v1beta3/permission_service.update_permission.js,samples/README.md) + +__Usage:__ + + +`node packages/google-ai-generativelanguage/samples/generated/v1beta3/permission_service.update_permission.js` + + +----- + + + + +### Text_service.batch_embed_text + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-ai-generativelanguage/samples/generated/v1beta3/text_service.batch_embed_text.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-ai-generativelanguage/samples/generated/v1beta3/text_service.batch_embed_text.js,samples/README.md) + +__Usage:__ + + +`node packages/google-ai-generativelanguage/samples/generated/v1beta3/text_service.batch_embed_text.js` + + +----- + + + + +### Text_service.count_text_tokens + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-ai-generativelanguage/samples/generated/v1beta3/text_service.count_text_tokens.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-ai-generativelanguage/samples/generated/v1beta3/text_service.count_text_tokens.js,samples/README.md) + +__Usage:__ + + +`node packages/google-ai-generativelanguage/samples/generated/v1beta3/text_service.count_text_tokens.js` + + +----- + + + + +### Text_service.embed_text + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-ai-generativelanguage/samples/generated/v1beta3/text_service.embed_text.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-ai-generativelanguage/samples/generated/v1beta3/text_service.embed_text.js,samples/README.md) + +__Usage:__ + + +`node packages/google-ai-generativelanguage/samples/generated/v1beta3/text_service.embed_text.js` + + +----- + + + + +### Text_service.generate_text + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-ai-generativelanguage/samples/generated/v1beta3/text_service.generate_text.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-ai-generativelanguage/samples/generated/v1beta3/text_service.generate_text.js,samples/README.md) + +__Usage:__ + + +`node packages/google-ai-generativelanguage/samples/generated/v1beta3/text_service.generate_text.js` + + +----- + + + + ### Quickstart View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-ai-generativelanguage/samples/quickstart.js). 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 c33587df163..1c43be73e72 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": "1.0.1", + "version": "1.1.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 c33587df163..1c43be73e72 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": "1.0.1", + "version": "1.1.0", "language": "TYPESCRIPT", "apis": [ { diff --git a/packages/google-ai-generativelanguage/samples/generated/v1beta3/discuss_service.count_message_tokens.js b/packages/google-ai-generativelanguage/samples/generated/v1beta3/discuss_service.count_message_tokens.js new file mode 100644 index 00000000000..6ef28deab39 --- /dev/null +++ b/packages/google-ai-generativelanguage/samples/generated/v1beta3/discuss_service.count_message_tokens.js @@ -0,0 +1,69 @@ +// Copyright 2023 Google LLC +// +// Licensed under the Apache License, Version 2.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(model, prompt) { + // [START generativelanguage_v1beta3_generated_DiscussService_CountMessageTokens_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 model's resource name. This serves as an ID for the Model to + * use. + * This name should match a model name returned by the `ListModels` method. + * Format: `models/{model}` + */ + // const model = 'abc123' + /** + * Required. The prompt, whose token count is to be returned. + */ + // const prompt = {} + + // Imports the Generativelanguage library + const {DiscussServiceClient} = require('@google-ai/generativelanguage').v1beta3; + + // Instantiates a client + const generativelanguageClient = new DiscussServiceClient(); + + async function callCountMessageTokens() { + // Construct request + const request = { + model, + prompt, + }; + + // Run request + const response = await generativelanguageClient.countMessageTokens(request); + console.log(response); + } + + callCountMessageTokens(); + // [END generativelanguage_v1beta3_generated_DiscussService_CountMessageTokens_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-ai-generativelanguage/samples/generated/v1beta3/discuss_service.generate_message.js b/packages/google-ai-generativelanguage/samples/generated/v1beta3/discuss_service.generate_message.js new file mode 100644 index 00000000000..7ba5eb59892 --- /dev/null +++ b/packages/google-ai-generativelanguage/samples/generated/v1beta3/discuss_service.generate_message.js @@ -0,0 +1,98 @@ +// Copyright 2023 Google LLC +// +// Licensed under the Apache License, Version 2.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(model, prompt) { + // [START generativelanguage_v1beta3_generated_DiscussService_GenerateMessage_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 model to use. + * Format: `name=models/{model}`. + */ + // const model = 'abc123' + /** + * Required. The structured textual input given to the model as a prompt. + * Given a + * prompt, the model will return what it predicts is the next message in the + * discussion. + */ + // const prompt = {} + /** + * Optional. Controls the randomness of the output. + * Values can range over `[0.0,1.0]`, + * inclusive. A value closer to `1.0` will produce responses that are more + * varied, while a value closer to `0.0` will typically result in + * less surprising responses from the model. + */ + // const temperature = 1234 + /** + * Optional. The number of generated response messages to return. + * This value must be between + * `[1, 8]`, inclusive. If unset, this will default to `1`. + */ + // const candidateCount = 1234 + /** + * Optional. The maximum cumulative probability of tokens to consider when + * sampling. + * The model uses combined Top-k and nucleus sampling. + * Nucleus sampling considers the smallest set of tokens whose probability + * sum is at least `top_p`. + */ + // const topP = 1234 + /** + * Optional. The maximum number of tokens to consider when sampling. + * The model uses combined Top-k and nucleus sampling. + * Top-k sampling considers the set of `top_k` most probable tokens. + */ + // const topK = 1234 + + // Imports the Generativelanguage library + const {DiscussServiceClient} = require('@google-ai/generativelanguage').v1beta3; + + // Instantiates a client + const generativelanguageClient = new DiscussServiceClient(); + + async function callGenerateMessage() { + // Construct request + const request = { + model, + prompt, + }; + + // Run request + const response = await generativelanguageClient.generateMessage(request); + console.log(response); + } + + callGenerateMessage(); + // [END generativelanguage_v1beta3_generated_DiscussService_GenerateMessage_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-ai-generativelanguage/samples/generated/v1beta3/model_service.create_tuned_model.js b/packages/google-ai-generativelanguage/samples/generated/v1beta3/model_service.create_tuned_model.js new file mode 100644 index 00000000000..911b81bdabc --- /dev/null +++ b/packages/google-ai-generativelanguage/samples/generated/v1beta3/model_service.create_tuned_model.js @@ -0,0 +1,69 @@ +// Copyright 2023 Google LLC +// +// Licensed under the Apache License, Version 2.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(tunedModel) { + // [START generativelanguage_v1beta3_generated_ModelService_CreateTunedModel_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. + */ + /** + * Optional. The unique id for the tuned model if specified. + * This value should be up to 40 characters, the first character must be a + * letter, the last could be a letter or a number. The id must match the + * regular expression: [a-z]([a-z0-9-]{0,38}[a-z0-9])?. + */ + // const tunedModelId = 'abc123' + /** + * Required. The tuned model to create. + */ + // const tunedModel = {} + + // Imports the Generativelanguage library + const {ModelServiceClient} = require('@google-ai/generativelanguage').v1beta3; + + // Instantiates a client + const generativelanguageClient = new ModelServiceClient(); + + async function callCreateTunedModel() { + // Construct request + const request = { + tunedModel, + }; + + // Run request + const [operation] = await generativelanguageClient.createTunedModel(request); + const [response] = await operation.promise(); + console.log(response); + } + + callCreateTunedModel(); + // [END generativelanguage_v1beta3_generated_ModelService_CreateTunedModel_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-ai-generativelanguage/samples/generated/v1beta3/model_service.delete_tuned_model.js b/packages/google-ai-generativelanguage/samples/generated/v1beta3/model_service.delete_tuned_model.js new file mode 100644 index 00000000000..0972c0623aa --- /dev/null +++ b/packages/google-ai-generativelanguage/samples/generated/v1beta3/model_service.delete_tuned_model.js @@ -0,0 +1,62 @@ +// Copyright 2023 Google LLC +// +// Licensed under the Apache License, Version 2.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 generativelanguage_v1beta3_generated_ModelService_DeleteTunedModel_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 resource name of the model. + * Format: `tunedModels/my-model-id` + */ + // const name = 'abc123' + + // Imports the Generativelanguage library + const {ModelServiceClient} = require('@google-ai/generativelanguage').v1beta3; + + // Instantiates a client + const generativelanguageClient = new ModelServiceClient(); + + async function callDeleteTunedModel() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await generativelanguageClient.deleteTunedModel(request); + console.log(response); + } + + callDeleteTunedModel(); + // [END generativelanguage_v1beta3_generated_ModelService_DeleteTunedModel_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-ai-generativelanguage/samples/generated/v1beta3/model_service.get_model.js b/packages/google-ai-generativelanguage/samples/generated/v1beta3/model_service.get_model.js new file mode 100644 index 00000000000..9f21ec34cb6 --- /dev/null +++ b/packages/google-ai-generativelanguage/samples/generated/v1beta3/model_service.get_model.js @@ -0,0 +1,63 @@ +// Copyright 2023 Google LLC +// +// Licensed under the Apache License, Version 2.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 generativelanguage_v1beta3_generated_ModelService_GetModel_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 resource name of the model. + * This name should match a model name returned by the `ListModels` method. + * Format: `models/{model}` + */ + // const name = 'abc123' + + // Imports the Generativelanguage library + const {ModelServiceClient} = require('@google-ai/generativelanguage').v1beta3; + + // Instantiates a client + const generativelanguageClient = new ModelServiceClient(); + + async function callGetModel() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await generativelanguageClient.getModel(request); + console.log(response); + } + + callGetModel(); + // [END generativelanguage_v1beta3_generated_ModelService_GetModel_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-ai-generativelanguage/samples/generated/v1beta3/model_service.get_tuned_model.js b/packages/google-ai-generativelanguage/samples/generated/v1beta3/model_service.get_tuned_model.js new file mode 100644 index 00000000000..461e356a52e --- /dev/null +++ b/packages/google-ai-generativelanguage/samples/generated/v1beta3/model_service.get_tuned_model.js @@ -0,0 +1,62 @@ +// Copyright 2023 Google LLC +// +// Licensed under the Apache License, Version 2.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 generativelanguage_v1beta3_generated_ModelService_GetTunedModel_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 resource name of the model. + * Format: `tunedModels/my-model-id` + */ + // const name = 'abc123' + + // Imports the Generativelanguage library + const {ModelServiceClient} = require('@google-ai/generativelanguage').v1beta3; + + // Instantiates a client + const generativelanguageClient = new ModelServiceClient(); + + async function callGetTunedModel() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await generativelanguageClient.getTunedModel(request); + console.log(response); + } + + callGetTunedModel(); + // [END generativelanguage_v1beta3_generated_ModelService_GetTunedModel_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-ai-generativelanguage/samples/generated/v1beta3/model_service.list_models.js b/packages/google-ai-generativelanguage/samples/generated/v1beta3/model_service.list_models.js new file mode 100644 index 00000000000..b44306eec0a --- /dev/null +++ b/packages/google-ai-generativelanguage/samples/generated/v1beta3/model_service.list_models.js @@ -0,0 +1,74 @@ +// Copyright 2023 Google LLC +// +// Licensed under the Apache License, Version 2.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 generativelanguage_v1beta3_generated_ModelService_ListModels_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. + */ + /** + * The maximum number of `Models` to return (per page). + * The service may return fewer models. + * If unspecified, at most 50 models will be returned per page. + * This method returns at most 1000 models per page, even if you pass a larger + * page_size. + */ + // const pageSize = 1234 + /** + * A page token, received from a previous `ListModels` call. + * Provide the `page_token` returned by one request as an argument to the next + * request to retrieve the next page. + * When paginating, all other parameters provided to `ListModels` must match + * the call that provided the page token. + */ + // const pageToken = 'abc123' + + // Imports the Generativelanguage library + const {ModelServiceClient} = require('@google-ai/generativelanguage').v1beta3; + + // Instantiates a client + const generativelanguageClient = new ModelServiceClient(); + + async function callListModels() { + // Construct request + const request = { + }; + + // Run request + const iterable = await generativelanguageClient.listModelsAsync(request); + for await (const response of iterable) { + console.log(response); + } + } + + callListModels(); + // [END generativelanguage_v1beta3_generated_ModelService_ListModels_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-ai-generativelanguage/samples/generated/v1beta3/model_service.list_tuned_models.js b/packages/google-ai-generativelanguage/samples/generated/v1beta3/model_service.list_tuned_models.js new file mode 100644 index 00000000000..25291ad9dd7 --- /dev/null +++ b/packages/google-ai-generativelanguage/samples/generated/v1beta3/model_service.list_tuned_models.js @@ -0,0 +1,74 @@ +// Copyright 2023 Google LLC +// +// Licensed under the Apache License, Version 2.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 generativelanguage_v1beta3_generated_ModelService_ListTunedModels_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. + */ + /** + * Optional. The maximum number of `TunedModels` to return (per page). + * The service may return fewer tuned models. + * If unspecified, at most 10 tuned models will be returned. + * This method returns at most 1000 models per page, even if you pass a larger + * page_size. + */ + // const pageSize = 1234 + /** + * Optional. A page token, received from a previous `ListTunedModels` call. + * Provide the `page_token` returned by one request as an argument to the next + * request to retrieve the next page. + * When paginating, all other parameters provided to `ListTunedModels` + * must match the call that provided the page token. + */ + // const pageToken = 'abc123' + + // Imports the Generativelanguage library + const {ModelServiceClient} = require('@google-ai/generativelanguage').v1beta3; + + // Instantiates a client + const generativelanguageClient = new ModelServiceClient(); + + async function callListTunedModels() { + // Construct request + const request = { + }; + + // Run request + const iterable = await generativelanguageClient.listTunedModelsAsync(request); + for await (const response of iterable) { + console.log(response); + } + } + + callListTunedModels(); + // [END generativelanguage_v1beta3_generated_ModelService_ListTunedModels_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-ai-generativelanguage/samples/generated/v1beta3/model_service.update_tuned_model.js b/packages/google-ai-generativelanguage/samples/generated/v1beta3/model_service.update_tuned_model.js new file mode 100644 index 00000000000..e872ef3eaa0 --- /dev/null +++ b/packages/google-ai-generativelanguage/samples/generated/v1beta3/model_service.update_tuned_model.js @@ -0,0 +1,66 @@ +// Copyright 2023 Google LLC +// +// Licensed under the Apache License, Version 2.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(tunedModel, updateMask) { + // [START generativelanguage_v1beta3_generated_ModelService_UpdateTunedModel_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 tuned model to update. + */ + // const tunedModel = {} + /** + * Required. The list of fields to update. + */ + // const updateMask = {} + + // Imports the Generativelanguage library + const {ModelServiceClient} = require('@google-ai/generativelanguage').v1beta3; + + // Instantiates a client + const generativelanguageClient = new ModelServiceClient(); + + async function callUpdateTunedModel() { + // Construct request + const request = { + tunedModel, + updateMask, + }; + + // Run request + const response = await generativelanguageClient.updateTunedModel(request); + console.log(response); + } + + callUpdateTunedModel(); + // [END generativelanguage_v1beta3_generated_ModelService_UpdateTunedModel_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-ai-generativelanguage/samples/generated/v1beta3/permission_service.create_permission.js b/packages/google-ai-generativelanguage/samples/generated/v1beta3/permission_service.create_permission.js new file mode 100644 index 00000000000..ab54e864fc2 --- /dev/null +++ b/packages/google-ai-generativelanguage/samples/generated/v1beta3/permission_service.create_permission.js @@ -0,0 +1,67 @@ +// Copyright 2023 Google LLC +// +// Licensed under the Apache License, Version 2.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, permission) { + // [START generativelanguage_v1beta3_generated_PermissionService_CreatePermission_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 of the `Permission`. + * Format: tunedModels/{tuned_model} + */ + // const parent = 'abc123' + /** + * Required. The permission to create. + */ + // const permission = {} + + // Imports the Generativelanguage library + const {PermissionServiceClient} = require('@google-ai/generativelanguage').v1beta3; + + // Instantiates a client + const generativelanguageClient = new PermissionServiceClient(); + + async function callCreatePermission() { + // Construct request + const request = { + parent, + permission, + }; + + // Run request + const response = await generativelanguageClient.createPermission(request); + console.log(response); + } + + callCreatePermission(); + // [END generativelanguage_v1beta3_generated_PermissionService_CreatePermission_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-ai-generativelanguage/samples/generated/v1beta3/permission_service.delete_permission.js b/packages/google-ai-generativelanguage/samples/generated/v1beta3/permission_service.delete_permission.js new file mode 100644 index 00000000000..7f93c67239d --- /dev/null +++ b/packages/google-ai-generativelanguage/samples/generated/v1beta3/permission_service.delete_permission.js @@ -0,0 +1,62 @@ +// Copyright 2023 Google LLC +// +// Licensed under the Apache License, Version 2.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 generativelanguage_v1beta3_generated_PermissionService_DeletePermission_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 resource name of the permission. + * Format: `tunedModels/{tuned_model}/permissions/{permission}` + */ + // const name = 'abc123' + + // Imports the Generativelanguage library + const {PermissionServiceClient} = require('@google-ai/generativelanguage').v1beta3; + + // Instantiates a client + const generativelanguageClient = new PermissionServiceClient(); + + async function callDeletePermission() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await generativelanguageClient.deletePermission(request); + console.log(response); + } + + callDeletePermission(); + // [END generativelanguage_v1beta3_generated_PermissionService_DeletePermission_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-ai-generativelanguage/samples/generated/v1beta3/permission_service.get_permission.js b/packages/google-ai-generativelanguage/samples/generated/v1beta3/permission_service.get_permission.js new file mode 100644 index 00000000000..5a2f8ad3788 --- /dev/null +++ b/packages/google-ai-generativelanguage/samples/generated/v1beta3/permission_service.get_permission.js @@ -0,0 +1,62 @@ +// Copyright 2023 Google LLC +// +// Licensed under the Apache License, Version 2.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 generativelanguage_v1beta3_generated_PermissionService_GetPermission_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 resource name of the permission. + * Format: `tunedModels/{tuned_model}permissions/{permission}` + */ + // const name = 'abc123' + + // Imports the Generativelanguage library + const {PermissionServiceClient} = require('@google-ai/generativelanguage').v1beta3; + + // Instantiates a client + const generativelanguageClient = new PermissionServiceClient(); + + async function callGetPermission() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await generativelanguageClient.getPermission(request); + console.log(response); + } + + callGetPermission(); + // [END generativelanguage_v1beta3_generated_PermissionService_GetPermission_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-ai-generativelanguage/samples/generated/v1beta3/permission_service.list_permissions.js b/packages/google-ai-generativelanguage/samples/generated/v1beta3/permission_service.list_permissions.js new file mode 100644 index 00000000000..f5dac15615d --- /dev/null +++ b/packages/google-ai-generativelanguage/samples/generated/v1beta3/permission_service.list_permissions.js @@ -0,0 +1,80 @@ +// Copyright 2023 Google LLC +// +// Licensed under the Apache License, Version 2.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 generativelanguage_v1beta3_generated_PermissionService_ListPermissions_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 of the permissions. + * Format: tunedModels/{tuned_model} + */ + // const parent = 'abc123' + /** + * Optional. The maximum number of `Permission`s to return (per page). + * The service may return fewer permissions. + * If unspecified, at most 10 permissions will be returned. + * This method returns at most 1000 permissions per page, even if you pass + * larger page_size. + */ + // const pageSize = 1234 + /** + * Optional. A page token, received from a previous `ListPermissions` call. + * Provide the `page_token` returned by one request as an argument to the + * next request to retrieve the next page. + * When paginating, all other parameters provided to `ListPermissions` + * must match the call that provided the page token. + */ + // const pageToken = 'abc123' + + // Imports the Generativelanguage library + const {PermissionServiceClient} = require('@google-ai/generativelanguage').v1beta3; + + // Instantiates a client + const generativelanguageClient = new PermissionServiceClient(); + + async function callListPermissions() { + // Construct request + const request = { + parent, + }; + + // Run request + const iterable = await generativelanguageClient.listPermissionsAsync(request); + for await (const response of iterable) { + console.log(response); + } + } + + callListPermissions(); + // [END generativelanguage_v1beta3_generated_PermissionService_ListPermissions_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-ai-generativelanguage/samples/generated/v1beta3/permission_service.transfer_ownership.js b/packages/google-ai-generativelanguage/samples/generated/v1beta3/permission_service.transfer_ownership.js new file mode 100644 index 00000000000..af1788913cc --- /dev/null +++ b/packages/google-ai-generativelanguage/samples/generated/v1beta3/permission_service.transfer_ownership.js @@ -0,0 +1,68 @@ +// Copyright 2023 Google LLC +// +// Licensed under the Apache License, Version 2.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, emailAddress) { + // [START generativelanguage_v1beta3_generated_PermissionService_TransferOwnership_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 resource name of the tuned model to transfer ownership . + * Format: `tunedModels/my-model-id` + */ + // const name = 'abc123' + /** + * Required. The email address of the user to whom the tuned model is being + * transferred to. + */ + // const emailAddress = 'abc123' + + // Imports the Generativelanguage library + const {PermissionServiceClient} = require('@google-ai/generativelanguage').v1beta3; + + // Instantiates a client + const generativelanguageClient = new PermissionServiceClient(); + + async function callTransferOwnership() { + // Construct request + const request = { + name, + emailAddress, + }; + + // Run request + const response = await generativelanguageClient.transferOwnership(request); + console.log(response); + } + + callTransferOwnership(); + // [END generativelanguage_v1beta3_generated_PermissionService_TransferOwnership_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-ai-generativelanguage/samples/generated/v1beta3/permission_service.update_permission.js b/packages/google-ai-generativelanguage/samples/generated/v1beta3/permission_service.update_permission.js new file mode 100644 index 00000000000..e4efb8ce31b --- /dev/null +++ b/packages/google-ai-generativelanguage/samples/generated/v1beta3/permission_service.update_permission.js @@ -0,0 +1,68 @@ +// Copyright 2023 Google LLC +// +// Licensed under the Apache License, Version 2.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(permission, updateMask) { + // [START generativelanguage_v1beta3_generated_PermissionService_UpdatePermission_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 permission to update. + * The permission's `name` field is used to identify the permission to update. + */ + // const permission = {} + /** + * Required. The list of fields to update. Accepted ones: + * - role (`Permission.role` field) + */ + // const updateMask = {} + + // Imports the Generativelanguage library + const {PermissionServiceClient} = require('@google-ai/generativelanguage').v1beta3; + + // Instantiates a client + const generativelanguageClient = new PermissionServiceClient(); + + async function callUpdatePermission() { + // Construct request + const request = { + permission, + updateMask, + }; + + // Run request + const response = await generativelanguageClient.updatePermission(request); + console.log(response); + } + + callUpdatePermission(); + // [END generativelanguage_v1beta3_generated_PermissionService_UpdatePermission_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); 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 new file mode 100644 index 00000000000..3a2127492d9 --- /dev/null +++ b/packages/google-ai-generativelanguage/samples/generated/v1beta3/snippet_metadata_google.ai.generativelanguage.v1beta3.json @@ -0,0 +1,879 @@ +{ + "clientLibrary": { + "name": "nodejs-generativelanguage", + "version": "1.1.0", + "language": "TYPESCRIPT", + "apis": [ + { + "id": "google.ai.generativelanguage.v1beta3", + "version": "v1beta3" + } + ] + }, + "snippets": [ + { + "regionTag": "generativelanguage_v1beta3_generated_DiscussService_GenerateMessage_async", + "title": "DiscussService generateMessage Sample", + "origin": "API_DEFINITION", + "description": " Generates a response from the model given an input `MessagePrompt`.", + "canonical": true, + "file": "discuss_service.generate_message.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 90, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "GenerateMessage", + "fullName": "google.ai.generativelanguage.v1beta3.DiscussService.GenerateMessage", + "async": true, + "parameters": [ + { + "name": "model", + "type": "TYPE_STRING" + }, + { + "name": "prompt", + "type": ".google.ai.generativelanguage.v1beta3.MessagePrompt" + }, + { + "name": "temperature", + "type": "TYPE_FLOAT" + }, + { + "name": "candidate_count", + "type": "TYPE_INT32" + }, + { + "name": "top_p", + "type": "TYPE_FLOAT" + }, + { + "name": "top_k", + "type": "TYPE_INT32" + } + ], + "resultType": ".google.ai.generativelanguage.v1beta3.GenerateMessageResponse", + "client": { + "shortName": "DiscussServiceClient", + "fullName": "google.ai.generativelanguage.v1beta3.DiscussServiceClient" + }, + "method": { + "shortName": "GenerateMessage", + "fullName": "google.ai.generativelanguage.v1beta3.DiscussService.GenerateMessage", + "service": { + "shortName": "DiscussService", + "fullName": "google.ai.generativelanguage.v1beta3.DiscussService" + } + } + } + }, + { + "regionTag": "generativelanguage_v1beta3_generated_DiscussService_CountMessageTokens_async", + "title": "DiscussService countMessageTokens Sample", + "origin": "API_DEFINITION", + "description": " Runs a model's tokenizer on a string and returns the token count.", + "canonical": true, + "file": "discuss_service.count_message_tokens.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 61, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "CountMessageTokens", + "fullName": "google.ai.generativelanguage.v1beta3.DiscussService.CountMessageTokens", + "async": true, + "parameters": [ + { + "name": "model", + "type": "TYPE_STRING" + }, + { + "name": "prompt", + "type": ".google.ai.generativelanguage.v1beta3.MessagePrompt" + } + ], + "resultType": ".google.ai.generativelanguage.v1beta3.CountMessageTokensResponse", + "client": { + "shortName": "DiscussServiceClient", + "fullName": "google.ai.generativelanguage.v1beta3.DiscussServiceClient" + }, + "method": { + "shortName": "CountMessageTokens", + "fullName": "google.ai.generativelanguage.v1beta3.DiscussService.CountMessageTokens", + "service": { + "shortName": "DiscussService", + "fullName": "google.ai.generativelanguage.v1beta3.DiscussService" + } + } + } + }, + { + "regionTag": "generativelanguage_v1beta3_generated_ModelService_GetModel_async", + "title": "DiscussService getModel Sample", + "origin": "API_DEFINITION", + "description": " Gets information about a specific Model.", + "canonical": true, + "file": "model_service.get_model.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 55, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "GetModel", + "fullName": "google.ai.generativelanguage.v1beta3.ModelService.GetModel", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.ai.generativelanguage.v1beta3.Model", + "client": { + "shortName": "ModelServiceClient", + "fullName": "google.ai.generativelanguage.v1beta3.ModelServiceClient" + }, + "method": { + "shortName": "GetModel", + "fullName": "google.ai.generativelanguage.v1beta3.ModelService.GetModel", + "service": { + "shortName": "ModelService", + "fullName": "google.ai.generativelanguage.v1beta3.ModelService" + } + } + } + }, + { + "regionTag": "generativelanguage_v1beta3_generated_ModelService_ListModels_async", + "title": "DiscussService listModels Sample", + "origin": "API_DEFINITION", + "description": " Lists models available through the API.", + "canonical": true, + "file": "model_service.list_models.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 66, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "ListModels", + "fullName": "google.ai.generativelanguage.v1beta3.ModelService.ListModels", + "async": true, + "parameters": [ + { + "name": "page_size", + "type": "TYPE_INT32" + }, + { + "name": "page_token", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.ai.generativelanguage.v1beta3.ListModelsResponse", + "client": { + "shortName": "ModelServiceClient", + "fullName": "google.ai.generativelanguage.v1beta3.ModelServiceClient" + }, + "method": { + "shortName": "ListModels", + "fullName": "google.ai.generativelanguage.v1beta3.ModelService.ListModels", + "service": { + "shortName": "ModelService", + "fullName": "google.ai.generativelanguage.v1beta3.ModelService" + } + } + } + }, + { + "regionTag": "generativelanguage_v1beta3_generated_ModelService_GetTunedModel_async", + "title": "DiscussService getTunedModel Sample", + "origin": "API_DEFINITION", + "description": " Gets information about a specific TunedModel.", + "canonical": true, + "file": "model_service.get_tuned_model.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 54, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "GetTunedModel", + "fullName": "google.ai.generativelanguage.v1beta3.ModelService.GetTunedModel", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.ai.generativelanguage.v1beta3.TunedModel", + "client": { + "shortName": "ModelServiceClient", + "fullName": "google.ai.generativelanguage.v1beta3.ModelServiceClient" + }, + "method": { + "shortName": "GetTunedModel", + "fullName": "google.ai.generativelanguage.v1beta3.ModelService.GetTunedModel", + "service": { + "shortName": "ModelService", + "fullName": "google.ai.generativelanguage.v1beta3.ModelService" + } + } + } + }, + { + "regionTag": "generativelanguage_v1beta3_generated_ModelService_ListTunedModels_async", + "title": "DiscussService listTunedModels Sample", + "origin": "API_DEFINITION", + "description": " Lists tuned models owned by the user.", + "canonical": true, + "file": "model_service.list_tuned_models.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 66, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "ListTunedModels", + "fullName": "google.ai.generativelanguage.v1beta3.ModelService.ListTunedModels", + "async": true, + "parameters": [ + { + "name": "page_size", + "type": "TYPE_INT32" + }, + { + "name": "page_token", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.ai.generativelanguage.v1beta3.ListTunedModelsResponse", + "client": { + "shortName": "ModelServiceClient", + "fullName": "google.ai.generativelanguage.v1beta3.ModelServiceClient" + }, + "method": { + "shortName": "ListTunedModels", + "fullName": "google.ai.generativelanguage.v1beta3.ModelService.ListTunedModels", + "service": { + "shortName": "ModelService", + "fullName": "google.ai.generativelanguage.v1beta3.ModelService" + } + } + } + }, + { + "regionTag": "generativelanguage_v1beta3_generated_ModelService_CreateTunedModel_async", + "title": "DiscussService createTunedModel Sample", + "origin": "API_DEFINITION", + "description": " Creates a tuned model. Intermediate tuning progress (if any) is accessed through the [google.longrunning.Operations] service. Status and results can be accessed through the Operations service. Example: GET /v1/tunedModels/az2mb0bpw6i/operations/000-111-222", + "canonical": true, + "file": "model_service.create_tuned_model.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 61, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "CreateTunedModel", + "fullName": "google.ai.generativelanguage.v1beta3.ModelService.CreateTunedModel", + "async": true, + "parameters": [ + { + "name": "tuned_model_id", + "type": "TYPE_STRING" + }, + { + "name": "tuned_model", + "type": ".google.ai.generativelanguage.v1beta3.TunedModel" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "ModelServiceClient", + "fullName": "google.ai.generativelanguage.v1beta3.ModelServiceClient" + }, + "method": { + "shortName": "CreateTunedModel", + "fullName": "google.ai.generativelanguage.v1beta3.ModelService.CreateTunedModel", + "service": { + "shortName": "ModelService", + "fullName": "google.ai.generativelanguage.v1beta3.ModelService" + } + } + } + }, + { + "regionTag": "generativelanguage_v1beta3_generated_ModelService_UpdateTunedModel_async", + "title": "DiscussService updateTunedModel Sample", + "origin": "API_DEFINITION", + "description": " Updates a tuned model.", + "canonical": true, + "file": "model_service.update_tuned_model.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 58, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "UpdateTunedModel", + "fullName": "google.ai.generativelanguage.v1beta3.ModelService.UpdateTunedModel", + "async": true, + "parameters": [ + { + "name": "tuned_model", + "type": ".google.ai.generativelanguage.v1beta3.TunedModel" + }, + { + "name": "update_mask", + "type": ".google.protobuf.FieldMask" + } + ], + "resultType": ".google.ai.generativelanguage.v1beta3.TunedModel", + "client": { + "shortName": "ModelServiceClient", + "fullName": "google.ai.generativelanguage.v1beta3.ModelServiceClient" + }, + "method": { + "shortName": "UpdateTunedModel", + "fullName": "google.ai.generativelanguage.v1beta3.ModelService.UpdateTunedModel", + "service": { + "shortName": "ModelService", + "fullName": "google.ai.generativelanguage.v1beta3.ModelService" + } + } + } + }, + { + "regionTag": "generativelanguage_v1beta3_generated_ModelService_DeleteTunedModel_async", + "title": "DiscussService deleteTunedModel Sample", + "origin": "API_DEFINITION", + "description": " Deletes a tuned model.", + "canonical": true, + "file": "model_service.delete_tuned_model.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 54, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "DeleteTunedModel", + "fullName": "google.ai.generativelanguage.v1beta3.ModelService.DeleteTunedModel", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.protobuf.Empty", + "client": { + "shortName": "ModelServiceClient", + "fullName": "google.ai.generativelanguage.v1beta3.ModelServiceClient" + }, + "method": { + "shortName": "DeleteTunedModel", + "fullName": "google.ai.generativelanguage.v1beta3.ModelService.DeleteTunedModel", + "service": { + "shortName": "ModelService", + "fullName": "google.ai.generativelanguage.v1beta3.ModelService" + } + } + } + }, + { + "regionTag": "generativelanguage_v1beta3_generated_PermissionService_CreatePermission_async", + "title": "DiscussService createPermission Sample", + "origin": "API_DEFINITION", + "description": " Create a permission to a specific resource.", + "canonical": true, + "file": "permission_service.create_permission.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 59, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "CreatePermission", + "fullName": "google.ai.generativelanguage.v1beta3.PermissionService.CreatePermission", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "permission", + "type": ".google.ai.generativelanguage.v1beta3.Permission" + } + ], + "resultType": ".google.ai.generativelanguage.v1beta3.Permission", + "client": { + "shortName": "PermissionServiceClient", + "fullName": "google.ai.generativelanguage.v1beta3.PermissionServiceClient" + }, + "method": { + "shortName": "CreatePermission", + "fullName": "google.ai.generativelanguage.v1beta3.PermissionService.CreatePermission", + "service": { + "shortName": "PermissionService", + "fullName": "google.ai.generativelanguage.v1beta3.PermissionService" + } + } + } + }, + { + "regionTag": "generativelanguage_v1beta3_generated_PermissionService_GetPermission_async", + "title": "DiscussService getPermission Sample", + "origin": "API_DEFINITION", + "description": " Gets information about a specific Permission.", + "canonical": true, + "file": "permission_service.get_permission.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 54, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "GetPermission", + "fullName": "google.ai.generativelanguage.v1beta3.PermissionService.GetPermission", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.ai.generativelanguage.v1beta3.Permission", + "client": { + "shortName": "PermissionServiceClient", + "fullName": "google.ai.generativelanguage.v1beta3.PermissionServiceClient" + }, + "method": { + "shortName": "GetPermission", + "fullName": "google.ai.generativelanguage.v1beta3.PermissionService.GetPermission", + "service": { + "shortName": "PermissionService", + "fullName": "google.ai.generativelanguage.v1beta3.PermissionService" + } + } + } + }, + { + "regionTag": "generativelanguage_v1beta3_generated_PermissionService_ListPermissions_async", + "title": "DiscussService listPermissions Sample", + "origin": "API_DEFINITION", + "description": " Lists permissions for the specific resource.", + "canonical": true, + "file": "permission_service.list_permissions.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 72, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "ListPermissions", + "fullName": "google.ai.generativelanguage.v1beta3.PermissionService.ListPermissions", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "page_size", + "type": "TYPE_INT32" + }, + { + "name": "page_token", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.ai.generativelanguage.v1beta3.ListPermissionsResponse", + "client": { + "shortName": "PermissionServiceClient", + "fullName": "google.ai.generativelanguage.v1beta3.PermissionServiceClient" + }, + "method": { + "shortName": "ListPermissions", + "fullName": "google.ai.generativelanguage.v1beta3.PermissionService.ListPermissions", + "service": { + "shortName": "PermissionService", + "fullName": "google.ai.generativelanguage.v1beta3.PermissionService" + } + } + } + }, + { + "regionTag": "generativelanguage_v1beta3_generated_PermissionService_UpdatePermission_async", + "title": "DiscussService updatePermission Sample", + "origin": "API_DEFINITION", + "description": " Updates the permission.", + "canonical": true, + "file": "permission_service.update_permission.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 60, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "UpdatePermission", + "fullName": "google.ai.generativelanguage.v1beta3.PermissionService.UpdatePermission", + "async": true, + "parameters": [ + { + "name": "permission", + "type": ".google.ai.generativelanguage.v1beta3.Permission" + }, + { + "name": "update_mask", + "type": ".google.protobuf.FieldMask" + } + ], + "resultType": ".google.ai.generativelanguage.v1beta3.Permission", + "client": { + "shortName": "PermissionServiceClient", + "fullName": "google.ai.generativelanguage.v1beta3.PermissionServiceClient" + }, + "method": { + "shortName": "UpdatePermission", + "fullName": "google.ai.generativelanguage.v1beta3.PermissionService.UpdatePermission", + "service": { + "shortName": "PermissionService", + "fullName": "google.ai.generativelanguage.v1beta3.PermissionService" + } + } + } + }, + { + "regionTag": "generativelanguage_v1beta3_generated_PermissionService_DeletePermission_async", + "title": "DiscussService deletePermission Sample", + "origin": "API_DEFINITION", + "description": " Deletes the permission.", + "canonical": true, + "file": "permission_service.delete_permission.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 54, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "DeletePermission", + "fullName": "google.ai.generativelanguage.v1beta3.PermissionService.DeletePermission", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.protobuf.Empty", + "client": { + "shortName": "PermissionServiceClient", + "fullName": "google.ai.generativelanguage.v1beta3.PermissionServiceClient" + }, + "method": { + "shortName": "DeletePermission", + "fullName": "google.ai.generativelanguage.v1beta3.PermissionService.DeletePermission", + "service": { + "shortName": "PermissionService", + "fullName": "google.ai.generativelanguage.v1beta3.PermissionService" + } + } + } + }, + { + "regionTag": "generativelanguage_v1beta3_generated_PermissionService_TransferOwnership_async", + "title": "DiscussService transferOwnership Sample", + "origin": "API_DEFINITION", + "description": " Transfers ownership of the tuned model. This is the only way to change ownership of the tuned model. The current owner will be downgraded to writer role.", + "canonical": true, + "file": "permission_service.transfer_ownership.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 60, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "TransferOwnership", + "fullName": "google.ai.generativelanguage.v1beta3.PermissionService.TransferOwnership", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + }, + { + "name": "email_address", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.ai.generativelanguage.v1beta3.TransferOwnershipResponse", + "client": { + "shortName": "PermissionServiceClient", + "fullName": "google.ai.generativelanguage.v1beta3.PermissionServiceClient" + }, + "method": { + "shortName": "TransferOwnership", + "fullName": "google.ai.generativelanguage.v1beta3.PermissionService.TransferOwnership", + "service": { + "shortName": "PermissionService", + "fullName": "google.ai.generativelanguage.v1beta3.PermissionService" + } + } + } + }, + { + "regionTag": "generativelanguage_v1beta3_generated_TextService_GenerateText_async", + "title": "DiscussService generateText Sample", + "origin": "API_DEFINITION", + "description": " Generates a response from the model given an input message.", + "canonical": true, + "file": "text_service.generate_text.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 125, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "GenerateText", + "fullName": "google.ai.generativelanguage.v1beta3.TextService.GenerateText", + "async": true, + "parameters": [ + { + "name": "model", + "type": "TYPE_STRING" + }, + { + "name": "prompt", + "type": ".google.ai.generativelanguage.v1beta3.TextPrompt" + }, + { + "name": "temperature", + "type": "TYPE_FLOAT" + }, + { + "name": "candidate_count", + "type": "TYPE_INT32" + }, + { + "name": "max_output_tokens", + "type": "TYPE_INT32" + }, + { + "name": "top_p", + "type": "TYPE_FLOAT" + }, + { + "name": "top_k", + "type": "TYPE_INT32" + }, + { + "name": "safety_settings", + "type": "TYPE_MESSAGE[]" + }, + { + "name": "stop_sequences", + "type": "TYPE_STRING[]" + } + ], + "resultType": ".google.ai.generativelanguage.v1beta3.GenerateTextResponse", + "client": { + "shortName": "TextServiceClient", + "fullName": "google.ai.generativelanguage.v1beta3.TextServiceClient" + }, + "method": { + "shortName": "GenerateText", + "fullName": "google.ai.generativelanguage.v1beta3.TextService.GenerateText", + "service": { + "shortName": "TextService", + "fullName": "google.ai.generativelanguage.v1beta3.TextService" + } + } + } + }, + { + "regionTag": "generativelanguage_v1beta3_generated_TextService_EmbedText_async", + "title": "DiscussService embedText Sample", + "origin": "API_DEFINITION", + "description": " Generates an embedding from the model given an input message.", + "canonical": true, + "file": "text_service.embed_text.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 59, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "EmbedText", + "fullName": "google.ai.generativelanguage.v1beta3.TextService.EmbedText", + "async": true, + "parameters": [ + { + "name": "model", + "type": "TYPE_STRING" + }, + { + "name": "text", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.ai.generativelanguage.v1beta3.EmbedTextResponse", + "client": { + "shortName": "TextServiceClient", + "fullName": "google.ai.generativelanguage.v1beta3.TextServiceClient" + }, + "method": { + "shortName": "EmbedText", + "fullName": "google.ai.generativelanguage.v1beta3.TextService.EmbedText", + "service": { + "shortName": "TextService", + "fullName": "google.ai.generativelanguage.v1beta3.TextService" + } + } + } + }, + { + "regionTag": "generativelanguage_v1beta3_generated_TextService_BatchEmbedText_async", + "title": "DiscussService batchEmbedText Sample", + "origin": "API_DEFINITION", + "description": " Generates multiple embeddings from the model given input text in a synchronous call.", + "canonical": true, + "file": "text_service.batch_embed_text.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 62, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "BatchEmbedText", + "fullName": "google.ai.generativelanguage.v1beta3.TextService.BatchEmbedText", + "async": true, + "parameters": [ + { + "name": "model", + "type": "TYPE_STRING" + }, + { + "name": "texts", + "type": "TYPE_STRING[]" + } + ], + "resultType": ".google.ai.generativelanguage.v1beta3.BatchEmbedTextResponse", + "client": { + "shortName": "TextServiceClient", + "fullName": "google.ai.generativelanguage.v1beta3.TextServiceClient" + }, + "method": { + "shortName": "BatchEmbedText", + "fullName": "google.ai.generativelanguage.v1beta3.TextService.BatchEmbedText", + "service": { + "shortName": "TextService", + "fullName": "google.ai.generativelanguage.v1beta3.TextService" + } + } + } + }, + { + "regionTag": "generativelanguage_v1beta3_generated_TextService_CountTextTokens_async", + "title": "DiscussService countTextTokens Sample", + "origin": "API_DEFINITION", + "description": " Runs a model's tokenizer on a text and returns the token count.", + "canonical": true, + "file": "text_service.count_text_tokens.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 61, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "CountTextTokens", + "fullName": "google.ai.generativelanguage.v1beta3.TextService.CountTextTokens", + "async": true, + "parameters": [ + { + "name": "model", + "type": "TYPE_STRING" + }, + { + "name": "prompt", + "type": ".google.ai.generativelanguage.v1beta3.TextPrompt" + } + ], + "resultType": ".google.ai.generativelanguage.v1beta3.CountTextTokensResponse", + "client": { + "shortName": "TextServiceClient", + "fullName": "google.ai.generativelanguage.v1beta3.TextServiceClient" + }, + "method": { + "shortName": "CountTextTokens", + "fullName": "google.ai.generativelanguage.v1beta3.TextService.CountTextTokens", + "service": { + "shortName": "TextService", + "fullName": "google.ai.generativelanguage.v1beta3.TextService" + } + } + } + } + ] +} \ No newline at end of file diff --git a/packages/google-ai-generativelanguage/samples/generated/v1beta3/text_service.batch_embed_text.js b/packages/google-ai-generativelanguage/samples/generated/v1beta3/text_service.batch_embed_text.js new file mode 100644 index 00000000000..57744086c6e --- /dev/null +++ b/packages/google-ai-generativelanguage/samples/generated/v1beta3/text_service.batch_embed_text.js @@ -0,0 +1,70 @@ +// Copyright 2023 Google LLC +// +// Licensed under the Apache License, Version 2.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(model, texts) { + // [START generativelanguage_v1beta3_generated_TextService_BatchEmbedText_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 `Model` to use for generating the embedding. + * Examples: + * models/embedding-gecko-001 + */ + // const model = 'abc123' + /** + * Required. The free-form input texts that the model will turn into an + * embedding. The current limit is 100 texts, over which an error will be + * thrown. + */ + // const texts = ['abc','def'] + + // Imports the Generativelanguage library + const {TextServiceClient} = require('@google-ai/generativelanguage').v1beta3; + + // Instantiates a client + const generativelanguageClient = new TextServiceClient(); + + async function callBatchEmbedText() { + // Construct request + const request = { + model, + texts, + }; + + // Run request + const response = await generativelanguageClient.batchEmbedText(request); + console.log(response); + } + + callBatchEmbedText(); + // [END generativelanguage_v1beta3_generated_TextService_BatchEmbedText_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-ai-generativelanguage/samples/generated/v1beta3/text_service.count_text_tokens.js b/packages/google-ai-generativelanguage/samples/generated/v1beta3/text_service.count_text_tokens.js new file mode 100644 index 00000000000..87ca0c5294a --- /dev/null +++ b/packages/google-ai-generativelanguage/samples/generated/v1beta3/text_service.count_text_tokens.js @@ -0,0 +1,69 @@ +// Copyright 2023 Google LLC +// +// Licensed under the Apache License, Version 2.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(model, prompt) { + // [START generativelanguage_v1beta3_generated_TextService_CountTextTokens_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 model's resource name. This serves as an ID for the Model to + * use. + * This name should match a model name returned by the `ListModels` method. + * Format: `models/{model}` + */ + // const model = 'abc123' + /** + * Required. The free-form input text given to the model as a prompt. + */ + // const prompt = {} + + // Imports the Generativelanguage library + const {TextServiceClient} = require('@google-ai/generativelanguage').v1beta3; + + // Instantiates a client + const generativelanguageClient = new TextServiceClient(); + + async function callCountTextTokens() { + // Construct request + const request = { + model, + prompt, + }; + + // Run request + const response = await generativelanguageClient.countTextTokens(request); + console.log(response); + } + + callCountTextTokens(); + // [END generativelanguage_v1beta3_generated_TextService_CountTextTokens_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-ai-generativelanguage/samples/generated/v1beta3/text_service.embed_text.js b/packages/google-ai-generativelanguage/samples/generated/v1beta3/text_service.embed_text.js new file mode 100644 index 00000000000..42d7a9cdbe5 --- /dev/null +++ b/packages/google-ai-generativelanguage/samples/generated/v1beta3/text_service.embed_text.js @@ -0,0 +1,67 @@ +// Copyright 2023 Google LLC +// +// Licensed under the Apache License, Version 2.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(model, text) { + // [START generativelanguage_v1beta3_generated_TextService_EmbedText_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 model name to use with the format model=models/{model}. + */ + // const model = 'abc123' + /** + * Required. The free-form input text that the model will turn into an + * embedding. + */ + // const text = 'abc123' + + // Imports the Generativelanguage library + const {TextServiceClient} = require('@google-ai/generativelanguage').v1beta3; + + // Instantiates a client + const generativelanguageClient = new TextServiceClient(); + + async function callEmbedText() { + // Construct request + const request = { + model, + text, + }; + + // Run request + const response = await generativelanguageClient.embedText(request); + console.log(response); + } + + callEmbedText(); + // [END generativelanguage_v1beta3_generated_TextService_EmbedText_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-ai-generativelanguage/samples/generated/v1beta3/text_service.generate_text.js b/packages/google-ai-generativelanguage/samples/generated/v1beta3/text_service.generate_text.js new file mode 100644 index 00000000000..5be397d442b --- /dev/null +++ b/packages/google-ai-generativelanguage/samples/generated/v1beta3/text_service.generate_text.js @@ -0,0 +1,133 @@ +// Copyright 2023 Google LLC +// +// Licensed under the Apache License, Version 2.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(model, prompt) { + // [START generativelanguage_v1beta3_generated_TextService_GenerateText_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 `Model` or `TunedModel` to use for generating the + * completion. + * Examples: + * models/text-bison-001 + * tunedModels/sentence-translator-u3b7m + */ + // const model = 'abc123' + /** + * Required. The free-form input text given to the model as a prompt. + * Given a prompt, the model will generate a TextCompletion response it + * predicts as the completion of the input text. + */ + // const prompt = {} + /** + * Optional. Controls the randomness of the output. + * Note: The default value varies by model, see the `Model.temperature` + * attribute of the `Model` returned the `getModel` function. + * Values can range from 0.0,1.0, + * inclusive. A value closer to 1.0 will produce responses that are more + * varied and creative, while a value closer to 0.0 will typically result in + * more straightforward responses from the model. + */ + // const temperature = 1234 + /** + * Optional. Number of generated responses to return. + * This value must be between 1, 8, inclusive. If unset, this will default + * to 1. + */ + // const candidateCount = 1234 + /** + * Optional. The maximum number of tokens to include in a candidate. + * If unset, this will default to output_token_limit specified in the `Model` + * specification. + */ + // const maxOutputTokens = 1234 + /** + * Optional. The maximum cumulative probability of tokens to consider when + * sampling. + * The model uses combined Top-k and nucleus sampling. + * Tokens are sorted based on their assigned probabilities so that only the + * most likely tokens are considered. Top-k sampling directly limits the + * maximum number of tokens to consider, while Nucleus sampling limits number + * of tokens based on the cumulative probability. + * Note: The default value varies by model, see the `Model.top_p` + * attribute of the `Model` returned the `getModel` function. + */ + // const topP = 1234 + /** + * Optional. The maximum number of tokens to consider when sampling. + * The model uses combined Top-k and nucleus sampling. + * Top-k sampling considers the set of `top_k` most probable tokens. + * Defaults to 40. + * Note: The default value varies by model, see the `Model.top_k` + * attribute of the `Model` returned the `getModel` function. + */ + // const topK = 1234 + /** + * A list of unique `SafetySetting` instances for blocking unsafe content. + * that will be enforced on the `GenerateTextRequest.prompt` and + * `GenerateTextResponse.candidates`. There should not be more than one + * setting for each `SafetyCategory` type. The API will block any prompts and + * responses that fail to meet the thresholds set by these settings. This list + * overrides the default settings for each `SafetyCategory` specified in the + * safety_settings. If there is no `SafetySetting` for a given + * `SafetyCategory` provided in the list, the API will use the default safety + * setting for that category. + */ + // const safetySettings = [1,2,3,4] + /** + * The set of character sequences (up to 5) that will stop output generation. + * If specified, the API will stop at the first appearance of a stop + * sequence. The stop sequence will not be included as part of the response. + */ + // const stopSequences = ['abc','def'] + + // Imports the Generativelanguage library + const {TextServiceClient} = require('@google-ai/generativelanguage').v1beta3; + + // Instantiates a client + const generativelanguageClient = new TextServiceClient(); + + async function callGenerateText() { + // Construct request + const request = { + model, + prompt, + }; + + // Run request + const response = await generativelanguageClient.generateText(request); + console.log(response); + } + + callGenerateText(); + // [END generativelanguage_v1beta3_generated_TextService_GenerateText_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-ai-generativelanguage/samples/package.json b/packages/google-ai-generativelanguage/samples/package.json index c64ae78fbb2..0fde7358f2d 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": "^1.0.1" + "@google-ai/generativelanguage": "^1.1.0" }, "devDependencies": { "c8": "^7.1.0", diff --git a/packages/google-ai-generativelanguage/src/index.ts b/packages/google-ai-generativelanguage/src/index.ts index 7390786245f..76750fe8341 100644 --- a/packages/google-ai-generativelanguage/src/index.ts +++ b/packages/google-ai-generativelanguage/src/index.ts @@ -17,6 +17,7 @@ // ** All changes to this file may be overwritten. ** import * as v1beta2 from './v1beta2'; +import * as v1beta3 from './v1beta3'; const DiscussServiceClient = v1beta2.DiscussServiceClient; type DiscussServiceClient = v1beta2.DiscussServiceClient; @@ -25,9 +26,16 @@ type ModelServiceClient = v1beta2.ModelServiceClient; const TextServiceClient = v1beta2.TextServiceClient; type TextServiceClient = v1beta2.TextServiceClient; -export {v1beta2, DiscussServiceClient, ModelServiceClient, TextServiceClient}; +export { + v1beta2, + v1beta3, + DiscussServiceClient, + ModelServiceClient, + TextServiceClient, +}; export default { v1beta2, + v1beta3, DiscussServiceClient, ModelServiceClient, TextServiceClient, diff --git a/packages/google-ai-generativelanguage/src/v1beta3/discuss_service_client.ts b/packages/google-ai-generativelanguage/src/v1beta3/discuss_service_client.ts new file mode 100644 index 00000000000..39e3a807dec --- /dev/null +++ b/packages/google-ai-generativelanguage/src/v1beta3/discuss_service_client.ts @@ -0,0 +1,661 @@ +// Copyright 2023 Google LLC +// +// Licensed under the Apache License, Version 2.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, +} from 'google-gax'; + +import * as protos from '../../protos/protos'; +import jsonProtos = require('../../protos/protos.json'); +/** + * Client JSON configuration object, loaded from + * `src/v1beta3/discuss_service_client_config.json`. + * This file defines retry strategy and timeouts for all API methods in this library. + */ +import * as gapicConfig from './discuss_service_client_config.json'; +const version = require('../../../package.json').version; + +/** + * An API for using Generative Language Models (GLMs) in dialog applications. + * + * Also known as large language models (LLMs), this API provides models that + * are trained for multi-turn dialog. + * @class + * @memberof v1beta3 + */ +export class DiscussServiceClient { + 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}; + 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}; + discussServiceStub?: Promise<{[name: string]: Function}>; + + /** + * Construct an instance of DiscussServiceClient. + * + * @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://developers.google.com/identity/protocols/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 DiscussServiceClient({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 DiscussServiceClient; + const servicePath = + opts?.servicePath || opts?.apiEndpoint || staticMembers.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 !== staticMembers.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 = staticMembers.servicePath; + + // Set the default scopes in auth client if needed. + if (servicePath === staticMembers.servicePath) { + this.auth.defaultScopes = staticMembers.scopes; + } + + // Determine the client header string. + const clientHeader = [`gax/${this._gaxModule.version}`, `gapic/${version}`]; + if (typeof process !== 'undefined' && '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 = { + modelPathTemplate: new this._gaxModule.PathTemplate('models/{model}'), + permissionPathTemplate: new this._gaxModule.PathTemplate( + 'tunedModels/{tuned_model}/permissions/{permission}' + ), + tunedModelPathTemplate: new this._gaxModule.PathTemplate( + 'tunedModels/{tuned_model}' + ), + }; + + // Put together the default options sent with requests. + this._defaults = this._gaxGrpc.constructSettings( + 'google.ai.generativelanguage.v1beta3.DiscussService', + 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.discussServiceStub) { + return this.discussServiceStub; + } + + // Put together the "service stub" for + // google.ai.generativelanguage.v1beta3.DiscussService. + this.discussServiceStub = this._gaxGrpc.createStub( + this._opts.fallback + ? (this._protos as protobuf.Root).lookupService( + 'google.ai.generativelanguage.v1beta3.DiscussService' + ) + : // eslint-disable-next-line @typescript-eslint/no-explicit-any + (this._protos as any).google.ai.generativelanguage.v1beta3 + .DiscussService, + 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 discussServiceStubMethods = ['generateMessage', 'countMessageTokens']; + for (const methodName of discussServiceStubMethods) { + const callPromise = this.discussServiceStub.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 = undefined; + const apiCall = this._gaxModule.createApiCall( + callPromise, + this._defaults[methodName], + descriptor, + this._opts.fallback + ); + + this.innerApiCalls[methodName] = apiCall; + } + + return this.discussServiceStub; + } + + /** + * The DNS address for this API service. + * @returns {string} The DNS address for this service. + */ + static get servicePath() { + return 'generativelanguage.googleapis.com'; + } + + /** + * The DNS address for this API service - same as servicePath(), + * exists for compatibility reasons. + * @returns {string} The DNS address for this service. + */ + static get apiEndpoint() { + return 'generativelanguage.googleapis.com'; + } + + /** + * 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 []; + } + + 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 -- + // ------------------- + /** + * Generates a response from the model given an input `MessagePrompt`. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.model + * Required. The name of the model to use. + * + * Format: `name=models/{model}`. + * @param {google.ai.generativelanguage.v1beta3.MessagePrompt} request.prompt + * Required. The structured textual input given to the model as a prompt. + * + * Given a + * prompt, the model will return what it predicts is the next message in the + * discussion. + * @param {number} [request.temperature] + * Optional. Controls the randomness of the output. + * + * Values can range over `[0.0,1.0]`, + * inclusive. A value closer to `1.0` will produce responses that are more + * varied, while a value closer to `0.0` will typically result in + * less surprising responses from the model. + * @param {number} [request.candidateCount] + * Optional. The number of generated response messages to return. + * + * This value must be between + * `[1, 8]`, inclusive. If unset, this will default to `1`. + * @param {number} [request.topP] + * Optional. The maximum cumulative probability of tokens to consider when + * sampling. + * + * The model uses combined Top-k and nucleus sampling. + * + * Nucleus sampling considers the smallest set of tokens whose probability + * sum is at least `top_p`. + * @param {number} [request.topK] + * Optional. The maximum number of tokens to consider when sampling. + * + * The model uses combined Top-k and nucleus sampling. + * + * Top-k sampling considers the set of `top_k` most probable tokens. + * @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.ai.generativelanguage.v1beta3.GenerateMessageResponse|GenerateMessageResponse}. + * 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/v1beta3/discuss_service.generate_message.js + * region_tag:generativelanguage_v1beta3_generated_DiscussService_GenerateMessage_async + */ + generateMessage( + request?: protos.google.ai.generativelanguage.v1beta3.IGenerateMessageRequest, + options?: CallOptions + ): Promise< + [ + protos.google.ai.generativelanguage.v1beta3.IGenerateMessageResponse, + ( + | protos.google.ai.generativelanguage.v1beta3.IGenerateMessageRequest + | undefined + ), + {} | undefined, + ] + >; + generateMessage( + request: protos.google.ai.generativelanguage.v1beta3.IGenerateMessageRequest, + options: CallOptions, + callback: Callback< + protos.google.ai.generativelanguage.v1beta3.IGenerateMessageResponse, + | protos.google.ai.generativelanguage.v1beta3.IGenerateMessageRequest + | null + | undefined, + {} | null | undefined + > + ): void; + generateMessage( + request: protos.google.ai.generativelanguage.v1beta3.IGenerateMessageRequest, + callback: Callback< + protos.google.ai.generativelanguage.v1beta3.IGenerateMessageResponse, + | protos.google.ai.generativelanguage.v1beta3.IGenerateMessageRequest + | null + | undefined, + {} | null | undefined + > + ): void; + generateMessage( + request?: protos.google.ai.generativelanguage.v1beta3.IGenerateMessageRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.ai.generativelanguage.v1beta3.IGenerateMessageResponse, + | protos.google.ai.generativelanguage.v1beta3.IGenerateMessageRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.ai.generativelanguage.v1beta3.IGenerateMessageResponse, + | protos.google.ai.generativelanguage.v1beta3.IGenerateMessageRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.ai.generativelanguage.v1beta3.IGenerateMessageResponse, + ( + | protos.google.ai.generativelanguage.v1beta3.IGenerateMessageRequest + | 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({ + model: request.model ?? '', + }); + this.initialize(); + return this.innerApiCalls.generateMessage(request, options, callback); + } + /** + * Runs a model's tokenizer on a string and returns the token count. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.model + * Required. The model's resource name. This serves as an ID for the Model to + * use. + * + * This name should match a model name returned by the `ListModels` method. + * + * Format: `models/{model}` + * @param {google.ai.generativelanguage.v1beta3.MessagePrompt} request.prompt + * Required. The prompt, whose token count is to be returned. + * @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.ai.generativelanguage.v1beta3.CountMessageTokensResponse|CountMessageTokensResponse}. + * 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/v1beta3/discuss_service.count_message_tokens.js + * region_tag:generativelanguage_v1beta3_generated_DiscussService_CountMessageTokens_async + */ + countMessageTokens( + request?: protos.google.ai.generativelanguage.v1beta3.ICountMessageTokensRequest, + options?: CallOptions + ): Promise< + [ + protos.google.ai.generativelanguage.v1beta3.ICountMessageTokensResponse, + ( + | protos.google.ai.generativelanguage.v1beta3.ICountMessageTokensRequest + | undefined + ), + {} | undefined, + ] + >; + countMessageTokens( + request: protos.google.ai.generativelanguage.v1beta3.ICountMessageTokensRequest, + options: CallOptions, + callback: Callback< + protos.google.ai.generativelanguage.v1beta3.ICountMessageTokensResponse, + | protos.google.ai.generativelanguage.v1beta3.ICountMessageTokensRequest + | null + | undefined, + {} | null | undefined + > + ): void; + countMessageTokens( + request: protos.google.ai.generativelanguage.v1beta3.ICountMessageTokensRequest, + callback: Callback< + protos.google.ai.generativelanguage.v1beta3.ICountMessageTokensResponse, + | protos.google.ai.generativelanguage.v1beta3.ICountMessageTokensRequest + | null + | undefined, + {} | null | undefined + > + ): void; + countMessageTokens( + request?: protos.google.ai.generativelanguage.v1beta3.ICountMessageTokensRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.ai.generativelanguage.v1beta3.ICountMessageTokensResponse, + | protos.google.ai.generativelanguage.v1beta3.ICountMessageTokensRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.ai.generativelanguage.v1beta3.ICountMessageTokensResponse, + | protos.google.ai.generativelanguage.v1beta3.ICountMessageTokensRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.ai.generativelanguage.v1beta3.ICountMessageTokensResponse, + ( + | protos.google.ai.generativelanguage.v1beta3.ICountMessageTokensRequest + | 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({ + model: request.model ?? '', + }); + this.initialize(); + return this.innerApiCalls.countMessageTokens(request, options, callback); + } + + // -------------------- + // -- Path templates -- + // -------------------- + + /** + * Return a fully-qualified model resource name string. + * + * @param {string} model + * @returns {string} Resource name string. + */ + modelPath(model: string) { + return this.pathTemplates.modelPathTemplate.render({ + model: model, + }); + } + + /** + * Parse the model from Model resource. + * + * @param {string} modelName + * A fully-qualified path representing Model resource. + * @returns {string} A string representing the model. + */ + matchModelFromModelName(modelName: string) { + return this.pathTemplates.modelPathTemplate.match(modelName).model; + } + + /** + * Return a fully-qualified permission resource name string. + * + * @param {string} tuned_model + * @param {string} permission + * @returns {string} Resource name string. + */ + permissionPath(tunedModel: string, permission: string) { + return this.pathTemplates.permissionPathTemplate.render({ + tuned_model: tunedModel, + permission: permission, + }); + } + + /** + * Parse the tuned_model from Permission resource. + * + * @param {string} permissionName + * A fully-qualified path representing Permission resource. + * @returns {string} A string representing the tuned_model. + */ + matchTunedModelFromPermissionName(permissionName: string) { + return this.pathTemplates.permissionPathTemplate.match(permissionName) + .tuned_model; + } + + /** + * Parse the permission from Permission resource. + * + * @param {string} permissionName + * A fully-qualified path representing Permission resource. + * @returns {string} A string representing the permission. + */ + matchPermissionFromPermissionName(permissionName: string) { + return this.pathTemplates.permissionPathTemplate.match(permissionName) + .permission; + } + + /** + * Return a fully-qualified tunedModel resource name string. + * + * @param {string} tuned_model + * @returns {string} Resource name string. + */ + tunedModelPath(tunedModel: string) { + return this.pathTemplates.tunedModelPathTemplate.render({ + tuned_model: tunedModel, + }); + } + + /** + * Parse the tuned_model from TunedModel resource. + * + * @param {string} tunedModelName + * A fully-qualified path representing TunedModel resource. + * @returns {string} A string representing the tuned_model. + */ + matchTunedModelFromTunedModelName(tunedModelName: string) { + return this.pathTemplates.tunedModelPathTemplate.match(tunedModelName) + .tuned_model; + } + + /** + * 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.discussServiceStub && !this._terminated) { + return this.discussServiceStub.then(stub => { + this._terminated = true; + stub.close(); + }); + } + return Promise.resolve(); + } +} diff --git a/packages/google-ai-generativelanguage/src/v1beta3/discuss_service_client_config.json b/packages/google-ai-generativelanguage/src/v1beta3/discuss_service_client_config.json new file mode 100644 index 00000000000..29b02faf295 --- /dev/null +++ b/packages/google-ai-generativelanguage/src/v1beta3/discuss_service_client_config.json @@ -0,0 +1,34 @@ +{ + "interfaces": { + "google.ai.generativelanguage.v1beta3.DiscussService": { + "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": { + "GenerateMessage": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "CountMessageTokens": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + } + } + } + } +} diff --git a/packages/google-ai-generativelanguage/src/v1beta3/discuss_service_proto_list.json b/packages/google-ai-generativelanguage/src/v1beta3/discuss_service_proto_list.json new file mode 100644 index 00000000000..088075193e9 --- /dev/null +++ b/packages/google-ai-generativelanguage/src/v1beta3/discuss_service_proto_list.json @@ -0,0 +1,11 @@ +[ + "../../protos/google/ai/generativelanguage/v1beta3/citation.proto", + "../../protos/google/ai/generativelanguage/v1beta3/discuss_service.proto", + "../../protos/google/ai/generativelanguage/v1beta3/model.proto", + "../../protos/google/ai/generativelanguage/v1beta3/model_service.proto", + "../../protos/google/ai/generativelanguage/v1beta3/permission.proto", + "../../protos/google/ai/generativelanguage/v1beta3/permission_service.proto", + "../../protos/google/ai/generativelanguage/v1beta3/safety.proto", + "../../protos/google/ai/generativelanguage/v1beta3/text_service.proto", + "../../protos/google/ai/generativelanguage/v1beta3/tuned_model.proto" +] diff --git a/packages/google-ai-generativelanguage/src/v1beta3/gapic_metadata.json b/packages/google-ai-generativelanguage/src/v1beta3/gapic_metadata.json new file mode 100644 index 00000000000..9c6d2e52316 --- /dev/null +++ b/packages/google-ai-generativelanguage/src/v1beta3/gapic_metadata.json @@ -0,0 +1,267 @@ +{ + "schema": "1.0", + "comment": "This file maps proto services/RPCs to the corresponding library clients/methods", + "language": "typescript", + "protoPackage": "google.ai.generativelanguage.v1beta3", + "libraryPackage": "@google-ai/generativelanguage", + "services": { + "DiscussService": { + "clients": { + "grpc": { + "libraryClient": "DiscussServiceClient", + "rpcs": { + "GenerateMessage": { + "methods": [ + "generateMessage" + ] + }, + "CountMessageTokens": { + "methods": [ + "countMessageTokens" + ] + } + } + }, + "grpc-fallback": { + "libraryClient": "DiscussServiceClient", + "rpcs": { + "GenerateMessage": { + "methods": [ + "generateMessage" + ] + }, + "CountMessageTokens": { + "methods": [ + "countMessageTokens" + ] + } + } + } + } + }, + "ModelService": { + "clients": { + "grpc": { + "libraryClient": "ModelServiceClient", + "rpcs": { + "GetModel": { + "methods": [ + "getModel" + ] + }, + "GetTunedModel": { + "methods": [ + "getTunedModel" + ] + }, + "UpdateTunedModel": { + "methods": [ + "updateTunedModel" + ] + }, + "DeleteTunedModel": { + "methods": [ + "deleteTunedModel" + ] + }, + "CreateTunedModel": { + "methods": [ + "createTunedModel" + ] + }, + "ListModels": { + "methods": [ + "listModels", + "listModelsStream", + "listModelsAsync" + ] + }, + "ListTunedModels": { + "methods": [ + "listTunedModels", + "listTunedModelsStream", + "listTunedModelsAsync" + ] + } + } + }, + "grpc-fallback": { + "libraryClient": "ModelServiceClient", + "rpcs": { + "GetModel": { + "methods": [ + "getModel" + ] + }, + "GetTunedModel": { + "methods": [ + "getTunedModel" + ] + }, + "UpdateTunedModel": { + "methods": [ + "updateTunedModel" + ] + }, + "DeleteTunedModel": { + "methods": [ + "deleteTunedModel" + ] + }, + "CreateTunedModel": { + "methods": [ + "createTunedModel" + ] + }, + "ListModels": { + "methods": [ + "listModels", + "listModelsStream", + "listModelsAsync" + ] + }, + "ListTunedModels": { + "methods": [ + "listTunedModels", + "listTunedModelsStream", + "listTunedModelsAsync" + ] + } + } + } + } + }, + "PermissionService": { + "clients": { + "grpc": { + "libraryClient": "PermissionServiceClient", + "rpcs": { + "CreatePermission": { + "methods": [ + "createPermission" + ] + }, + "GetPermission": { + "methods": [ + "getPermission" + ] + }, + "UpdatePermission": { + "methods": [ + "updatePermission" + ] + }, + "DeletePermission": { + "methods": [ + "deletePermission" + ] + }, + "TransferOwnership": { + "methods": [ + "transferOwnership" + ] + }, + "ListPermissions": { + "methods": [ + "listPermissions", + "listPermissionsStream", + "listPermissionsAsync" + ] + } + } + }, + "grpc-fallback": { + "libraryClient": "PermissionServiceClient", + "rpcs": { + "CreatePermission": { + "methods": [ + "createPermission" + ] + }, + "GetPermission": { + "methods": [ + "getPermission" + ] + }, + "UpdatePermission": { + "methods": [ + "updatePermission" + ] + }, + "DeletePermission": { + "methods": [ + "deletePermission" + ] + }, + "TransferOwnership": { + "methods": [ + "transferOwnership" + ] + }, + "ListPermissions": { + "methods": [ + "listPermissions", + "listPermissionsStream", + "listPermissionsAsync" + ] + } + } + } + } + }, + "TextService": { + "clients": { + "grpc": { + "libraryClient": "TextServiceClient", + "rpcs": { + "GenerateText": { + "methods": [ + "generateText" + ] + }, + "EmbedText": { + "methods": [ + "embedText" + ] + }, + "BatchEmbedText": { + "methods": [ + "batchEmbedText" + ] + }, + "CountTextTokens": { + "methods": [ + "countTextTokens" + ] + } + } + }, + "grpc-fallback": { + "libraryClient": "TextServiceClient", + "rpcs": { + "GenerateText": { + "methods": [ + "generateText" + ] + }, + "EmbedText": { + "methods": [ + "embedText" + ] + }, + "BatchEmbedText": { + "methods": [ + "batchEmbedText" + ] + }, + "CountTextTokens": { + "methods": [ + "countTextTokens" + ] + } + } + } + } + } + } +} diff --git a/packages/google-ai-generativelanguage/src/v1beta3/index.ts b/packages/google-ai-generativelanguage/src/v1beta3/index.ts new file mode 100644 index 00000000000..b259620a72c --- /dev/null +++ b/packages/google-ai-generativelanguage/src/v1beta3/index.ts @@ -0,0 +1,22 @@ +// Copyright 2023 Google LLC +// +// Licensed under the Apache License, Version 2.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 {DiscussServiceClient} from './discuss_service_client'; +export {ModelServiceClient} from './model_service_client'; +export {PermissionServiceClient} from './permission_service_client'; +export {TextServiceClient} from './text_service_client'; diff --git a/packages/google-ai-generativelanguage/src/v1beta3/model_service_client.ts b/packages/google-ai-generativelanguage/src/v1beta3/model_service_client.ts new file mode 100644 index 00000000000..d091652352e --- /dev/null +++ b/packages/google-ai-generativelanguage/src/v1beta3/model_service_client.ts @@ -0,0 +1,1595 @@ +// Copyright 2023 Google LLC +// +// Licensed under the Apache License, Version 2.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, +} from 'google-gax'; +import {Transform} from 'stream'; +import * as protos from '../../protos/protos'; +import jsonProtos = require('../../protos/protos.json'); +/** + * Client JSON configuration object, loaded from + * `src/v1beta3/model_service_client_config.json`. + * This file defines retry strategy and timeouts for all API methods in this library. + */ +import * as gapicConfig from './model_service_client_config.json'; +const version = require('../../../package.json').version; + +/** + * Provides methods for getting metadata information about Generative Models. + * @class + * @memberof v1beta3 + */ +export class ModelServiceClient { + 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}; + 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; + modelServiceStub?: Promise<{[name: string]: Function}>; + + /** + * Construct an instance of ModelServiceClient. + * + * @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://developers.google.com/identity/protocols/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 ModelServiceClient({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 ModelServiceClient; + const servicePath = + opts?.servicePath || opts?.apiEndpoint || staticMembers.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 !== staticMembers.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 = staticMembers.servicePath; + + // Set the default scopes in auth client if needed. + if (servicePath === staticMembers.servicePath) { + this.auth.defaultScopes = staticMembers.scopes; + } + + // Determine the client header string. + const clientHeader = [`gax/${this._gaxModule.version}`, `gapic/${version}`]; + if (typeof process !== 'undefined' && '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 = { + modelPathTemplate: new this._gaxModule.PathTemplate('models/{model}'), + permissionPathTemplate: new this._gaxModule.PathTemplate( + 'tunedModels/{tuned_model}/permissions/{permission}' + ), + tunedModelPathTemplate: new this._gaxModule.PathTemplate( + 'tunedModels/{tuned_model}' + ), + }; + + // 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 = { + listModels: new this._gaxModule.PageDescriptor( + 'pageToken', + 'nextPageToken', + 'models' + ), + listTunedModels: new this._gaxModule.PageDescriptor( + 'pageToken', + 'nextPageToken', + 'tunedModels' + ), + }; + + const protoFilesRoot = this._gaxModule.protobuf.Root.fromJSON(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 = []; + } + this.operationsClient = this._gaxModule + .lro(lroOptions) + .operationsClient(opts); + const createTunedModelResponse = protoFilesRoot.lookup( + '.google.ai.generativelanguage.v1beta3.TunedModel' + ) as gax.protobuf.Type; + const createTunedModelMetadata = protoFilesRoot.lookup( + '.google.ai.generativelanguage.v1beta3.CreateTunedModelMetadata' + ) as gax.protobuf.Type; + + this.descriptors.longrunning = { + createTunedModel: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + createTunedModelResponse.decode.bind(createTunedModelResponse), + createTunedModelMetadata.decode.bind(createTunedModelMetadata) + ), + }; + + // Put together the default options sent with requests. + this._defaults = this._gaxGrpc.constructSettings( + 'google.ai.generativelanguage.v1beta3.ModelService', + 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.modelServiceStub) { + return this.modelServiceStub; + } + + // Put together the "service stub" for + // google.ai.generativelanguage.v1beta3.ModelService. + this.modelServiceStub = this._gaxGrpc.createStub( + this._opts.fallback + ? (this._protos as protobuf.Root).lookupService( + 'google.ai.generativelanguage.v1beta3.ModelService' + ) + : // eslint-disable-next-line @typescript-eslint/no-explicit-any + (this._protos as any).google.ai.generativelanguage.v1beta3 + .ModelService, + 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 modelServiceStubMethods = [ + 'getModel', + 'listModels', + 'getTunedModel', + 'listTunedModels', + 'createTunedModel', + 'updateTunedModel', + 'deleteTunedModel', + ]; + for (const methodName of modelServiceStubMethods) { + const callPromise = this.modelServiceStub.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] || + this.descriptors.longrunning[methodName] || + undefined; + const apiCall = this._gaxModule.createApiCall( + callPromise, + this._defaults[methodName], + descriptor, + this._opts.fallback + ); + + this.innerApiCalls[methodName] = apiCall; + } + + return this.modelServiceStub; + } + + /** + * The DNS address for this API service. + * @returns {string} The DNS address for this service. + */ + static get servicePath() { + return 'generativelanguage.googleapis.com'; + } + + /** + * The DNS address for this API service - same as servicePath(), + * exists for compatibility reasons. + * @returns {string} The DNS address for this service. + */ + static get apiEndpoint() { + return 'generativelanguage.googleapis.com'; + } + + /** + * 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 []; + } + + 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 -- + // ------------------- + /** + * Gets information about a specific Model. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The resource name of the model. + * + * This name should match a model name returned by the `ListModels` method. + * + * Format: `models/{model}` + * @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.ai.generativelanguage.v1beta3.Model|Model}. + * 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/v1beta3/model_service.get_model.js + * region_tag:generativelanguage_v1beta3_generated_ModelService_GetModel_async + */ + getModel( + request?: protos.google.ai.generativelanguage.v1beta3.IGetModelRequest, + options?: CallOptions + ): Promise< + [ + protos.google.ai.generativelanguage.v1beta3.IModel, + protos.google.ai.generativelanguage.v1beta3.IGetModelRequest | undefined, + {} | undefined, + ] + >; + getModel( + request: protos.google.ai.generativelanguage.v1beta3.IGetModelRequest, + options: CallOptions, + callback: Callback< + protos.google.ai.generativelanguage.v1beta3.IModel, + | protos.google.ai.generativelanguage.v1beta3.IGetModelRequest + | null + | undefined, + {} | null | undefined + > + ): void; + getModel( + request: protos.google.ai.generativelanguage.v1beta3.IGetModelRequest, + callback: Callback< + protos.google.ai.generativelanguage.v1beta3.IModel, + | protos.google.ai.generativelanguage.v1beta3.IGetModelRequest + | null + | undefined, + {} | null | undefined + > + ): void; + getModel( + request?: protos.google.ai.generativelanguage.v1beta3.IGetModelRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.ai.generativelanguage.v1beta3.IModel, + | protos.google.ai.generativelanguage.v1beta3.IGetModelRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.ai.generativelanguage.v1beta3.IModel, + | protos.google.ai.generativelanguage.v1beta3.IGetModelRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.ai.generativelanguage.v1beta3.IModel, + protos.google.ai.generativelanguage.v1beta3.IGetModelRequest | 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(); + return this.innerApiCalls.getModel(request, options, callback); + } + /** + * Gets information about a specific TunedModel. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The resource name of the model. + * + * Format: `tunedModels/my-model-id` + * @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.ai.generativelanguage.v1beta3.TunedModel|TunedModel}. + * 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/v1beta3/model_service.get_tuned_model.js + * region_tag:generativelanguage_v1beta3_generated_ModelService_GetTunedModel_async + */ + getTunedModel( + request?: protos.google.ai.generativelanguage.v1beta3.IGetTunedModelRequest, + options?: CallOptions + ): Promise< + [ + protos.google.ai.generativelanguage.v1beta3.ITunedModel, + ( + | protos.google.ai.generativelanguage.v1beta3.IGetTunedModelRequest + | undefined + ), + {} | undefined, + ] + >; + getTunedModel( + request: protos.google.ai.generativelanguage.v1beta3.IGetTunedModelRequest, + options: CallOptions, + callback: Callback< + protos.google.ai.generativelanguage.v1beta3.ITunedModel, + | protos.google.ai.generativelanguage.v1beta3.IGetTunedModelRequest + | null + | undefined, + {} | null | undefined + > + ): void; + getTunedModel( + request: protos.google.ai.generativelanguage.v1beta3.IGetTunedModelRequest, + callback: Callback< + protos.google.ai.generativelanguage.v1beta3.ITunedModel, + | protos.google.ai.generativelanguage.v1beta3.IGetTunedModelRequest + | null + | undefined, + {} | null | undefined + > + ): void; + getTunedModel( + request?: protos.google.ai.generativelanguage.v1beta3.IGetTunedModelRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.ai.generativelanguage.v1beta3.ITunedModel, + | protos.google.ai.generativelanguage.v1beta3.IGetTunedModelRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.ai.generativelanguage.v1beta3.ITunedModel, + | protos.google.ai.generativelanguage.v1beta3.IGetTunedModelRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.ai.generativelanguage.v1beta3.ITunedModel, + ( + | protos.google.ai.generativelanguage.v1beta3.IGetTunedModelRequest + | 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(); + return this.innerApiCalls.getTunedModel(request, options, callback); + } + /** + * Updates a tuned model. + * + * @param {Object} request + * The request object that will be sent. + * @param {google.ai.generativelanguage.v1beta3.TunedModel} request.tunedModel + * Required. The tuned model to update. + * @param {google.protobuf.FieldMask} request.updateMask + * Required. The list of fields to update. + * @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.ai.generativelanguage.v1beta3.TunedModel|TunedModel}. + * 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/v1beta3/model_service.update_tuned_model.js + * region_tag:generativelanguage_v1beta3_generated_ModelService_UpdateTunedModel_async + */ + updateTunedModel( + request?: protos.google.ai.generativelanguage.v1beta3.IUpdateTunedModelRequest, + options?: CallOptions + ): Promise< + [ + protos.google.ai.generativelanguage.v1beta3.ITunedModel, + ( + | protos.google.ai.generativelanguage.v1beta3.IUpdateTunedModelRequest + | undefined + ), + {} | undefined, + ] + >; + updateTunedModel( + request: protos.google.ai.generativelanguage.v1beta3.IUpdateTunedModelRequest, + options: CallOptions, + callback: Callback< + protos.google.ai.generativelanguage.v1beta3.ITunedModel, + | protos.google.ai.generativelanguage.v1beta3.IUpdateTunedModelRequest + | null + | undefined, + {} | null | undefined + > + ): void; + updateTunedModel( + request: protos.google.ai.generativelanguage.v1beta3.IUpdateTunedModelRequest, + callback: Callback< + protos.google.ai.generativelanguage.v1beta3.ITunedModel, + | protos.google.ai.generativelanguage.v1beta3.IUpdateTunedModelRequest + | null + | undefined, + {} | null | undefined + > + ): void; + updateTunedModel( + request?: protos.google.ai.generativelanguage.v1beta3.IUpdateTunedModelRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.ai.generativelanguage.v1beta3.ITunedModel, + | protos.google.ai.generativelanguage.v1beta3.IUpdateTunedModelRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.ai.generativelanguage.v1beta3.ITunedModel, + | protos.google.ai.generativelanguage.v1beta3.IUpdateTunedModelRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.ai.generativelanguage.v1beta3.ITunedModel, + ( + | protos.google.ai.generativelanguage.v1beta3.IUpdateTunedModelRequest + | 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({ + 'tuned_model.name': request.tunedModel!.name ?? '', + }); + this.initialize(); + return this.innerApiCalls.updateTunedModel(request, options, callback); + } + /** + * Deletes a tuned model. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The resource name of the model. + * Format: `tunedModels/my-model-id` + * @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/v1beta3/model_service.delete_tuned_model.js + * region_tag:generativelanguage_v1beta3_generated_ModelService_DeleteTunedModel_async + */ + deleteTunedModel( + request?: protos.google.ai.generativelanguage.v1beta3.IDeleteTunedModelRequest, + options?: CallOptions + ): Promise< + [ + protos.google.protobuf.IEmpty, + ( + | protos.google.ai.generativelanguage.v1beta3.IDeleteTunedModelRequest + | undefined + ), + {} | undefined, + ] + >; + deleteTunedModel( + request: protos.google.ai.generativelanguage.v1beta3.IDeleteTunedModelRequest, + options: CallOptions, + callback: Callback< + protos.google.protobuf.IEmpty, + | protos.google.ai.generativelanguage.v1beta3.IDeleteTunedModelRequest + | null + | undefined, + {} | null | undefined + > + ): void; + deleteTunedModel( + request: protos.google.ai.generativelanguage.v1beta3.IDeleteTunedModelRequest, + callback: Callback< + protos.google.protobuf.IEmpty, + | protos.google.ai.generativelanguage.v1beta3.IDeleteTunedModelRequest + | null + | undefined, + {} | null | undefined + > + ): void; + deleteTunedModel( + request?: protos.google.ai.generativelanguage.v1beta3.IDeleteTunedModelRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.protobuf.IEmpty, + | protos.google.ai.generativelanguage.v1beta3.IDeleteTunedModelRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.protobuf.IEmpty, + | protos.google.ai.generativelanguage.v1beta3.IDeleteTunedModelRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.protobuf.IEmpty, + ( + | protos.google.ai.generativelanguage.v1beta3.IDeleteTunedModelRequest + | 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(); + return this.innerApiCalls.deleteTunedModel(request, options, callback); + } + + /** + * Creates a tuned model. + * Intermediate tuning progress (if any) is accessed through the + * [google.longrunning.Operations] service. + * + * Status and results can be accessed through the Operations service. + * Example: + * GET /v1/tunedModels/az2mb0bpw6i/operations/000-111-222 + * + * @param {Object} request + * The request object that will be sent. + * @param {string} [request.tunedModelId] + * Optional. The unique id for the tuned model if specified. + * This value should be up to 40 characters, the first character must be a + * letter, the last could be a letter or a number. The id must match the + * regular expression: [a-z]([a-z0-9-]{0,38}[a-z0-9])?. + * @param {google.ai.generativelanguage.v1beta3.TunedModel} request.tunedModel + * Required. The tuned model 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 + * 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/v1beta3/model_service.create_tuned_model.js + * region_tag:generativelanguage_v1beta3_generated_ModelService_CreateTunedModel_async + */ + createTunedModel( + request?: protos.google.ai.generativelanguage.v1beta3.ICreateTunedModelRequest, + options?: CallOptions + ): Promise< + [ + LROperation< + protos.google.ai.generativelanguage.v1beta3.ITunedModel, + protos.google.ai.generativelanguage.v1beta3.ICreateTunedModelMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined, + ] + >; + createTunedModel( + request: protos.google.ai.generativelanguage.v1beta3.ICreateTunedModelRequest, + options: CallOptions, + callback: Callback< + LROperation< + protos.google.ai.generativelanguage.v1beta3.ITunedModel, + protos.google.ai.generativelanguage.v1beta3.ICreateTunedModelMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + createTunedModel( + request: protos.google.ai.generativelanguage.v1beta3.ICreateTunedModelRequest, + callback: Callback< + LROperation< + protos.google.ai.generativelanguage.v1beta3.ITunedModel, + protos.google.ai.generativelanguage.v1beta3.ICreateTunedModelMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + createTunedModel( + request?: protos.google.ai.generativelanguage.v1beta3.ICreateTunedModelRequest, + optionsOrCallback?: + | CallOptions + | Callback< + LROperation< + protos.google.ai.generativelanguage.v1beta3.ITunedModel, + protos.google.ai.generativelanguage.v1beta3.ICreateTunedModelMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + callback?: Callback< + LROperation< + protos.google.ai.generativelanguage.v1beta3.ITunedModel, + protos.google.ai.generativelanguage.v1beta3.ICreateTunedModelMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): Promise< + [ + LROperation< + protos.google.ai.generativelanguage.v1beta3.ITunedModel, + protos.google.ai.generativelanguage.v1beta3.ICreateTunedModelMetadata + >, + 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(); + return this.innerApiCalls.createTunedModel(request, options, callback); + } + /** + * Check the status of the long running operation returned by `createTunedModel()`. + * @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/v1beta3/model_service.create_tuned_model.js + * region_tag:generativelanguage_v1beta3_generated_ModelService_CreateTunedModel_async + */ + async checkCreateTunedModelProgress( + name: string + ): Promise< + LROperation< + protos.google.ai.generativelanguage.v1beta3.TunedModel, + protos.google.ai.generativelanguage.v1beta3.CreateTunedModelMetadata + > + > { + 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.createTunedModel, + this._gaxModule.createDefaultBackoffSettings() + ); + return decodeOperation as LROperation< + protos.google.ai.generativelanguage.v1beta3.TunedModel, + protos.google.ai.generativelanguage.v1beta3.CreateTunedModelMetadata + >; + } + /** + * Lists models available through the API. + * + * @param {Object} request + * The request object that will be sent. + * @param {number} request.pageSize + * The maximum number of `Models` to return (per page). + * + * The service may return fewer models. + * If unspecified, at most 50 models will be returned per page. + * This method returns at most 1000 models per page, even if you pass a larger + * page_size. + * @param {string} request.pageToken + * A page token, received from a previous `ListModels` call. + * + * Provide the `page_token` returned by one request as an argument to the next + * request to retrieve the next page. + * + * When paginating, all other parameters provided to `ListModels` 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.ai.generativelanguage.v1beta3.Model|Model}. + * 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 `listModelsAsync()` + * 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. + */ + listModels( + request?: protos.google.ai.generativelanguage.v1beta3.IListModelsRequest, + options?: CallOptions + ): Promise< + [ + protos.google.ai.generativelanguage.v1beta3.IModel[], + protos.google.ai.generativelanguage.v1beta3.IListModelsRequest | null, + protos.google.ai.generativelanguage.v1beta3.IListModelsResponse, + ] + >; + listModels( + request: protos.google.ai.generativelanguage.v1beta3.IListModelsRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.ai.generativelanguage.v1beta3.IListModelsRequest, + | protos.google.ai.generativelanguage.v1beta3.IListModelsResponse + | null + | undefined, + protos.google.ai.generativelanguage.v1beta3.IModel + > + ): void; + listModels( + request: protos.google.ai.generativelanguage.v1beta3.IListModelsRequest, + callback: PaginationCallback< + protos.google.ai.generativelanguage.v1beta3.IListModelsRequest, + | protos.google.ai.generativelanguage.v1beta3.IListModelsResponse + | null + | undefined, + protos.google.ai.generativelanguage.v1beta3.IModel + > + ): void; + listModels( + request?: protos.google.ai.generativelanguage.v1beta3.IListModelsRequest, + optionsOrCallback?: + | CallOptions + | PaginationCallback< + protos.google.ai.generativelanguage.v1beta3.IListModelsRequest, + | protos.google.ai.generativelanguage.v1beta3.IListModelsResponse + | null + | undefined, + protos.google.ai.generativelanguage.v1beta3.IModel + >, + callback?: PaginationCallback< + protos.google.ai.generativelanguage.v1beta3.IListModelsRequest, + | protos.google.ai.generativelanguage.v1beta3.IListModelsResponse + | null + | undefined, + protos.google.ai.generativelanguage.v1beta3.IModel + > + ): Promise< + [ + protos.google.ai.generativelanguage.v1beta3.IModel[], + protos.google.ai.generativelanguage.v1beta3.IListModelsRequest | null, + protos.google.ai.generativelanguage.v1beta3.IListModelsResponse, + ] + > | 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(); + return this.innerApiCalls.listModels(request, options, callback); + } + + /** + * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. + * @param {Object} request + * The request object that will be sent. + * @param {number} request.pageSize + * The maximum number of `Models` to return (per page). + * + * The service may return fewer models. + * If unspecified, at most 50 models will be returned per page. + * This method returns at most 1000 models per page, even if you pass a larger + * page_size. + * @param {string} request.pageToken + * A page token, received from a previous `ListModels` call. + * + * Provide the `page_token` returned by one request as an argument to the next + * request to retrieve the next page. + * + * When paginating, all other parameters provided to `ListModels` 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.ai.generativelanguage.v1beta3.Model|Model} 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 `listModelsAsync()` + * 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. + */ + listModelsStream( + request?: protos.google.ai.generativelanguage.v1beta3.IListModelsRequest, + options?: CallOptions + ): Transform { + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + const defaultCallSettings = this._defaults['listModels']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.listModels.createStream( + this.innerApiCalls.listModels as GaxCall, + request, + callSettings + ); + } + + /** + * Equivalent to `listModels`, 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 {number} request.pageSize + * The maximum number of `Models` to return (per page). + * + * The service may return fewer models. + * If unspecified, at most 50 models will be returned per page. + * This method returns at most 1000 models per page, even if you pass a larger + * page_size. + * @param {string} request.pageToken + * A page token, received from a previous `ListModels` call. + * + * Provide the `page_token` returned by one request as an argument to the next + * request to retrieve the next page. + * + * When paginating, all other parameters provided to `ListModels` 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.ai.generativelanguage.v1beta3.Model|Model}. 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/v1beta3/model_service.list_models.js + * region_tag:generativelanguage_v1beta3_generated_ModelService_ListModels_async + */ + listModelsAsync( + request?: protos.google.ai.generativelanguage.v1beta3.IListModelsRequest, + options?: CallOptions + ): AsyncIterable { + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + const defaultCallSettings = this._defaults['listModels']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.listModels.asyncIterate( + this.innerApiCalls['listModels'] as GaxCall, + request as {}, + callSettings + ) as AsyncIterable; + } + /** + * Lists tuned models owned by the user. + * + * @param {Object} request + * The request object that will be sent. + * @param {number} [request.pageSize] + * Optional. The maximum number of `TunedModels` to return (per page). + * The service may return fewer tuned models. + * + * If unspecified, at most 10 tuned models will be returned. + * This method returns at most 1000 models per page, even if you pass a larger + * page_size. + * @param {string} [request.pageToken] + * Optional. A page token, received from a previous `ListTunedModels` call. + * + * Provide the `page_token` returned by one request as an argument to the next + * request to retrieve the next page. + * + * When paginating, all other parameters provided to `ListTunedModels` + * 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.ai.generativelanguage.v1beta3.TunedModel|TunedModel}. + * 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 `listTunedModelsAsync()` + * 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. + */ + listTunedModels( + request?: protos.google.ai.generativelanguage.v1beta3.IListTunedModelsRequest, + options?: CallOptions + ): Promise< + [ + protos.google.ai.generativelanguage.v1beta3.ITunedModel[], + protos.google.ai.generativelanguage.v1beta3.IListTunedModelsRequest | null, + protos.google.ai.generativelanguage.v1beta3.IListTunedModelsResponse, + ] + >; + listTunedModels( + request: protos.google.ai.generativelanguage.v1beta3.IListTunedModelsRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.ai.generativelanguage.v1beta3.IListTunedModelsRequest, + | protos.google.ai.generativelanguage.v1beta3.IListTunedModelsResponse + | null + | undefined, + protos.google.ai.generativelanguage.v1beta3.ITunedModel + > + ): void; + listTunedModels( + request: protos.google.ai.generativelanguage.v1beta3.IListTunedModelsRequest, + callback: PaginationCallback< + protos.google.ai.generativelanguage.v1beta3.IListTunedModelsRequest, + | protos.google.ai.generativelanguage.v1beta3.IListTunedModelsResponse + | null + | undefined, + protos.google.ai.generativelanguage.v1beta3.ITunedModel + > + ): void; + listTunedModels( + request?: protos.google.ai.generativelanguage.v1beta3.IListTunedModelsRequest, + optionsOrCallback?: + | CallOptions + | PaginationCallback< + protos.google.ai.generativelanguage.v1beta3.IListTunedModelsRequest, + | protos.google.ai.generativelanguage.v1beta3.IListTunedModelsResponse + | null + | undefined, + protos.google.ai.generativelanguage.v1beta3.ITunedModel + >, + callback?: PaginationCallback< + protos.google.ai.generativelanguage.v1beta3.IListTunedModelsRequest, + | protos.google.ai.generativelanguage.v1beta3.IListTunedModelsResponse + | null + | undefined, + protos.google.ai.generativelanguage.v1beta3.ITunedModel + > + ): Promise< + [ + protos.google.ai.generativelanguage.v1beta3.ITunedModel[], + protos.google.ai.generativelanguage.v1beta3.IListTunedModelsRequest | null, + protos.google.ai.generativelanguage.v1beta3.IListTunedModelsResponse, + ] + > | 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(); + return this.innerApiCalls.listTunedModels(request, options, callback); + } + + /** + * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. + * @param {Object} request + * The request object that will be sent. + * @param {number} [request.pageSize] + * Optional. The maximum number of `TunedModels` to return (per page). + * The service may return fewer tuned models. + * + * If unspecified, at most 10 tuned models will be returned. + * This method returns at most 1000 models per page, even if you pass a larger + * page_size. + * @param {string} [request.pageToken] + * Optional. A page token, received from a previous `ListTunedModels` call. + * + * Provide the `page_token` returned by one request as an argument to the next + * request to retrieve the next page. + * + * When paginating, all other parameters provided to `ListTunedModels` + * 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.ai.generativelanguage.v1beta3.TunedModel|TunedModel} 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 `listTunedModelsAsync()` + * 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. + */ + listTunedModelsStream( + request?: protos.google.ai.generativelanguage.v1beta3.IListTunedModelsRequest, + options?: CallOptions + ): Transform { + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + const defaultCallSettings = this._defaults['listTunedModels']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.listTunedModels.createStream( + this.innerApiCalls.listTunedModels as GaxCall, + request, + callSettings + ); + } + + /** + * Equivalent to `listTunedModels`, 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 {number} [request.pageSize] + * Optional. The maximum number of `TunedModels` to return (per page). + * The service may return fewer tuned models. + * + * If unspecified, at most 10 tuned models will be returned. + * This method returns at most 1000 models per page, even if you pass a larger + * page_size. + * @param {string} [request.pageToken] + * Optional. A page token, received from a previous `ListTunedModels` call. + * + * Provide the `page_token` returned by one request as an argument to the next + * request to retrieve the next page. + * + * When paginating, all other parameters provided to `ListTunedModels` + * 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.ai.generativelanguage.v1beta3.TunedModel|TunedModel}. 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/v1beta3/model_service.list_tuned_models.js + * region_tag:generativelanguage_v1beta3_generated_ModelService_ListTunedModels_async + */ + listTunedModelsAsync( + request?: protos.google.ai.generativelanguage.v1beta3.IListTunedModelsRequest, + options?: CallOptions + ): AsyncIterable { + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + const defaultCallSettings = this._defaults['listTunedModels']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.listTunedModels.asyncIterate( + this.innerApiCalls['listTunedModels'] as GaxCall, + request as {}, + callSettings + ) as AsyncIterable; + } + /** + * 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, + options?: + | 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]> { + 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 { + 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, + options?: + | gax.CallOptions + | Callback< + protos.google.protobuf.Empty, + protos.google.longrunning.CancelOperationRequest, + {} | undefined | null + >, + callback?: Callback< + protos.google.longrunning.CancelOperationRequest, + protos.google.protobuf.Empty, + {} | undefined | null + > + ): Promise { + 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, + options?: + | 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 { + return this.operationsClient.deleteOperation(request, options, callback); + } + + // -------------------- + // -- Path templates -- + // -------------------- + + /** + * Return a fully-qualified model resource name string. + * + * @param {string} model + * @returns {string} Resource name string. + */ + modelPath(model: string) { + return this.pathTemplates.modelPathTemplate.render({ + model: model, + }); + } + + /** + * Parse the model from Model resource. + * + * @param {string} modelName + * A fully-qualified path representing Model resource. + * @returns {string} A string representing the model. + */ + matchModelFromModelName(modelName: string) { + return this.pathTemplates.modelPathTemplate.match(modelName).model; + } + + /** + * Return a fully-qualified permission resource name string. + * + * @param {string} tuned_model + * @param {string} permission + * @returns {string} Resource name string. + */ + permissionPath(tunedModel: string, permission: string) { + return this.pathTemplates.permissionPathTemplate.render({ + tuned_model: tunedModel, + permission: permission, + }); + } + + /** + * Parse the tuned_model from Permission resource. + * + * @param {string} permissionName + * A fully-qualified path representing Permission resource. + * @returns {string} A string representing the tuned_model. + */ + matchTunedModelFromPermissionName(permissionName: string) { + return this.pathTemplates.permissionPathTemplate.match(permissionName) + .tuned_model; + } + + /** + * Parse the permission from Permission resource. + * + * @param {string} permissionName + * A fully-qualified path representing Permission resource. + * @returns {string} A string representing the permission. + */ + matchPermissionFromPermissionName(permissionName: string) { + return this.pathTemplates.permissionPathTemplate.match(permissionName) + .permission; + } + + /** + * Return a fully-qualified tunedModel resource name string. + * + * @param {string} tuned_model + * @returns {string} Resource name string. + */ + tunedModelPath(tunedModel: string) { + return this.pathTemplates.tunedModelPathTemplate.render({ + tuned_model: tunedModel, + }); + } + + /** + * Parse the tuned_model from TunedModel resource. + * + * @param {string} tunedModelName + * A fully-qualified path representing TunedModel resource. + * @returns {string} A string representing the tuned_model. + */ + matchTunedModelFromTunedModelName(tunedModelName: string) { + return this.pathTemplates.tunedModelPathTemplate.match(tunedModelName) + .tuned_model; + } + + /** + * 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.modelServiceStub && !this._terminated) { + return this.modelServiceStub.then(stub => { + this._terminated = true; + stub.close(); + this.operationsClient.close(); + }); + } + return Promise.resolve(); + } +} diff --git a/packages/google-ai-generativelanguage/src/v1beta3/model_service_client_config.json b/packages/google-ai-generativelanguage/src/v1beta3/model_service_client_config.json new file mode 100644 index 00000000000..f9b15003e33 --- /dev/null +++ b/packages/google-ai-generativelanguage/src/v1beta3/model_service_client_config.json @@ -0,0 +1,54 @@ +{ + "interfaces": { + "google.ai.generativelanguage.v1beta3.ModelService": { + "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": { + "GetModel": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "ListModels": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "GetTunedModel": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "ListTunedModels": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "CreateTunedModel": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "UpdateTunedModel": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "DeleteTunedModel": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + } + } + } + } +} diff --git a/packages/google-ai-generativelanguage/src/v1beta3/model_service_proto_list.json b/packages/google-ai-generativelanguage/src/v1beta3/model_service_proto_list.json new file mode 100644 index 00000000000..088075193e9 --- /dev/null +++ b/packages/google-ai-generativelanguage/src/v1beta3/model_service_proto_list.json @@ -0,0 +1,11 @@ +[ + "../../protos/google/ai/generativelanguage/v1beta3/citation.proto", + "../../protos/google/ai/generativelanguage/v1beta3/discuss_service.proto", + "../../protos/google/ai/generativelanguage/v1beta3/model.proto", + "../../protos/google/ai/generativelanguage/v1beta3/model_service.proto", + "../../protos/google/ai/generativelanguage/v1beta3/permission.proto", + "../../protos/google/ai/generativelanguage/v1beta3/permission_service.proto", + "../../protos/google/ai/generativelanguage/v1beta3/safety.proto", + "../../protos/google/ai/generativelanguage/v1beta3/text_service.proto", + "../../protos/google/ai/generativelanguage/v1beta3/tuned_model.proto" +] diff --git a/packages/google-ai-generativelanguage/src/v1beta3/permission_service_client.ts b/packages/google-ai-generativelanguage/src/v1beta3/permission_service_client.ts new file mode 100644 index 00000000000..d1b06874e83 --- /dev/null +++ b/packages/google-ai-generativelanguage/src/v1beta3/permission_service_client.ts @@ -0,0 +1,1165 @@ +// Copyright 2023 Google LLC +// +// Licensed under the Apache License, Version 2.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'); +/** + * Client JSON configuration object, loaded from + * `src/v1beta3/permission_service_client_config.json`. + * This file defines retry strategy and timeouts for all API methods in this library. + */ +import * as gapicConfig from './permission_service_client_config.json'; +const version = require('../../../package.json').version; + +/** + * Provides methods for managing permissions to PaLM API resources. + * @class + * @memberof v1beta3 + */ +export class PermissionServiceClient { + 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}; + 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}; + permissionServiceStub?: Promise<{[name: string]: Function}>; + + /** + * Construct an instance of PermissionServiceClient. + * + * @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://developers.google.com/identity/protocols/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 PermissionServiceClient({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 PermissionServiceClient; + const servicePath = + opts?.servicePath || opts?.apiEndpoint || staticMembers.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 !== staticMembers.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 = staticMembers.servicePath; + + // Set the default scopes in auth client if needed. + if (servicePath === staticMembers.servicePath) { + this.auth.defaultScopes = staticMembers.scopes; + } + + // Determine the client header string. + const clientHeader = [`gax/${this._gaxModule.version}`, `gapic/${version}`]; + if (typeof process !== 'undefined' && '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 = { + modelPathTemplate: new this._gaxModule.PathTemplate('models/{model}'), + permissionPathTemplate: new this._gaxModule.PathTemplate( + 'tunedModels/{tuned_model}/permissions/{permission}' + ), + tunedModelPathTemplate: new this._gaxModule.PathTemplate( + 'tunedModels/{tuned_model}' + ), + }; + + // 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 = { + listPermissions: new this._gaxModule.PageDescriptor( + 'pageToken', + 'nextPageToken', + 'permissions' + ), + }; + + // Put together the default options sent with requests. + this._defaults = this._gaxGrpc.constructSettings( + 'google.ai.generativelanguage.v1beta3.PermissionService', + 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.permissionServiceStub) { + return this.permissionServiceStub; + } + + // Put together the "service stub" for + // google.ai.generativelanguage.v1beta3.PermissionService. + this.permissionServiceStub = this._gaxGrpc.createStub( + this._opts.fallback + ? (this._protos as protobuf.Root).lookupService( + 'google.ai.generativelanguage.v1beta3.PermissionService' + ) + : // eslint-disable-next-line @typescript-eslint/no-explicit-any + (this._protos as any).google.ai.generativelanguage.v1beta3 + .PermissionService, + 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 permissionServiceStubMethods = [ + 'createPermission', + 'getPermission', + 'listPermissions', + 'updatePermission', + 'deletePermission', + 'transferOwnership', + ]; + for (const methodName of permissionServiceStubMethods) { + const callPromise = this.permissionServiceStub.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.permissionServiceStub; + } + + /** + * The DNS address for this API service. + * @returns {string} The DNS address for this service. + */ + static get servicePath() { + return 'generativelanguage.googleapis.com'; + } + + /** + * The DNS address for this API service - same as servicePath(), + * exists for compatibility reasons. + * @returns {string} The DNS address for this service. + */ + static get apiEndpoint() { + return 'generativelanguage.googleapis.com'; + } + + /** + * 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 []; + } + + 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 permission to a specific resource. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The parent resource of the `Permission`. + * Format: tunedModels/{tuned_model} + * @param {google.ai.generativelanguage.v1beta3.Permission} request.permission + * Required. The permission 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.ai.generativelanguage.v1beta3.Permission|Permission}. + * 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/v1beta3/permission_service.create_permission.js + * region_tag:generativelanguage_v1beta3_generated_PermissionService_CreatePermission_async + */ + createPermission( + request?: protos.google.ai.generativelanguage.v1beta3.ICreatePermissionRequest, + options?: CallOptions + ): Promise< + [ + protos.google.ai.generativelanguage.v1beta3.IPermission, + ( + | protos.google.ai.generativelanguage.v1beta3.ICreatePermissionRequest + | undefined + ), + {} | undefined, + ] + >; + createPermission( + request: protos.google.ai.generativelanguage.v1beta3.ICreatePermissionRequest, + options: CallOptions, + callback: Callback< + protos.google.ai.generativelanguage.v1beta3.IPermission, + | protos.google.ai.generativelanguage.v1beta3.ICreatePermissionRequest + | null + | undefined, + {} | null | undefined + > + ): void; + createPermission( + request: protos.google.ai.generativelanguage.v1beta3.ICreatePermissionRequest, + callback: Callback< + protos.google.ai.generativelanguage.v1beta3.IPermission, + | protos.google.ai.generativelanguage.v1beta3.ICreatePermissionRequest + | null + | undefined, + {} | null | undefined + > + ): void; + createPermission( + request?: protos.google.ai.generativelanguage.v1beta3.ICreatePermissionRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.ai.generativelanguage.v1beta3.IPermission, + | protos.google.ai.generativelanguage.v1beta3.ICreatePermissionRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.ai.generativelanguage.v1beta3.IPermission, + | protos.google.ai.generativelanguage.v1beta3.ICreatePermissionRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.ai.generativelanguage.v1beta3.IPermission, + ( + | protos.google.ai.generativelanguage.v1beta3.ICreatePermissionRequest + | 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(); + return this.innerApiCalls.createPermission(request, options, callback); + } + /** + * Gets information about a specific Permission. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The resource name of the permission. + * + * Format: `tunedModels/{tuned_model}permissions/{permission}` + * @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.ai.generativelanguage.v1beta3.Permission|Permission}. + * 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/v1beta3/permission_service.get_permission.js + * region_tag:generativelanguage_v1beta3_generated_PermissionService_GetPermission_async + */ + getPermission( + request?: protos.google.ai.generativelanguage.v1beta3.IGetPermissionRequest, + options?: CallOptions + ): Promise< + [ + protos.google.ai.generativelanguage.v1beta3.IPermission, + ( + | protos.google.ai.generativelanguage.v1beta3.IGetPermissionRequest + | undefined + ), + {} | undefined, + ] + >; + getPermission( + request: protos.google.ai.generativelanguage.v1beta3.IGetPermissionRequest, + options: CallOptions, + callback: Callback< + protos.google.ai.generativelanguage.v1beta3.IPermission, + | protos.google.ai.generativelanguage.v1beta3.IGetPermissionRequest + | null + | undefined, + {} | null | undefined + > + ): void; + getPermission( + request: protos.google.ai.generativelanguage.v1beta3.IGetPermissionRequest, + callback: Callback< + protos.google.ai.generativelanguage.v1beta3.IPermission, + | protos.google.ai.generativelanguage.v1beta3.IGetPermissionRequest + | null + | undefined, + {} | null | undefined + > + ): void; + getPermission( + request?: protos.google.ai.generativelanguage.v1beta3.IGetPermissionRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.ai.generativelanguage.v1beta3.IPermission, + | protos.google.ai.generativelanguage.v1beta3.IGetPermissionRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.ai.generativelanguage.v1beta3.IPermission, + | protos.google.ai.generativelanguage.v1beta3.IGetPermissionRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.ai.generativelanguage.v1beta3.IPermission, + ( + | protos.google.ai.generativelanguage.v1beta3.IGetPermissionRequest + | 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(); + return this.innerApiCalls.getPermission(request, options, callback); + } + /** + * Updates the permission. + * + * @param {Object} request + * The request object that will be sent. + * @param {google.ai.generativelanguage.v1beta3.Permission} request.permission + * Required. The permission to update. + * + * The permission's `name` field is used to identify the permission to update. + * @param {google.protobuf.FieldMask} request.updateMask + * Required. The list of fields to update. Accepted ones: + * - role (`Permission.role` field) + * @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.ai.generativelanguage.v1beta3.Permission|Permission}. + * 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/v1beta3/permission_service.update_permission.js + * region_tag:generativelanguage_v1beta3_generated_PermissionService_UpdatePermission_async + */ + updatePermission( + request?: protos.google.ai.generativelanguage.v1beta3.IUpdatePermissionRequest, + options?: CallOptions + ): Promise< + [ + protos.google.ai.generativelanguage.v1beta3.IPermission, + ( + | protos.google.ai.generativelanguage.v1beta3.IUpdatePermissionRequest + | undefined + ), + {} | undefined, + ] + >; + updatePermission( + request: protos.google.ai.generativelanguage.v1beta3.IUpdatePermissionRequest, + options: CallOptions, + callback: Callback< + protos.google.ai.generativelanguage.v1beta3.IPermission, + | protos.google.ai.generativelanguage.v1beta3.IUpdatePermissionRequest + | null + | undefined, + {} | null | undefined + > + ): void; + updatePermission( + request: protos.google.ai.generativelanguage.v1beta3.IUpdatePermissionRequest, + callback: Callback< + protos.google.ai.generativelanguage.v1beta3.IPermission, + | protos.google.ai.generativelanguage.v1beta3.IUpdatePermissionRequest + | null + | undefined, + {} | null | undefined + > + ): void; + updatePermission( + request?: protos.google.ai.generativelanguage.v1beta3.IUpdatePermissionRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.ai.generativelanguage.v1beta3.IPermission, + | protos.google.ai.generativelanguage.v1beta3.IUpdatePermissionRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.ai.generativelanguage.v1beta3.IPermission, + | protos.google.ai.generativelanguage.v1beta3.IUpdatePermissionRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.ai.generativelanguage.v1beta3.IPermission, + ( + | protos.google.ai.generativelanguage.v1beta3.IUpdatePermissionRequest + | 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({ + 'permission.name': request.permission!.name ?? '', + }); + this.initialize(); + return this.innerApiCalls.updatePermission(request, options, callback); + } + /** + * Deletes the permission. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The resource name of the permission. + * Format: `tunedModels/{tuned_model}/permissions/{permission}` + * @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/v1beta3/permission_service.delete_permission.js + * region_tag:generativelanguage_v1beta3_generated_PermissionService_DeletePermission_async + */ + deletePermission( + request?: protos.google.ai.generativelanguage.v1beta3.IDeletePermissionRequest, + options?: CallOptions + ): Promise< + [ + protos.google.protobuf.IEmpty, + ( + | protos.google.ai.generativelanguage.v1beta3.IDeletePermissionRequest + | undefined + ), + {} | undefined, + ] + >; + deletePermission( + request: protos.google.ai.generativelanguage.v1beta3.IDeletePermissionRequest, + options: CallOptions, + callback: Callback< + protos.google.protobuf.IEmpty, + | protos.google.ai.generativelanguage.v1beta3.IDeletePermissionRequest + | null + | undefined, + {} | null | undefined + > + ): void; + deletePermission( + request: protos.google.ai.generativelanguage.v1beta3.IDeletePermissionRequest, + callback: Callback< + protos.google.protobuf.IEmpty, + | protos.google.ai.generativelanguage.v1beta3.IDeletePermissionRequest + | null + | undefined, + {} | null | undefined + > + ): void; + deletePermission( + request?: protos.google.ai.generativelanguage.v1beta3.IDeletePermissionRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.protobuf.IEmpty, + | protos.google.ai.generativelanguage.v1beta3.IDeletePermissionRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.protobuf.IEmpty, + | protos.google.ai.generativelanguage.v1beta3.IDeletePermissionRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.protobuf.IEmpty, + ( + | protos.google.ai.generativelanguage.v1beta3.IDeletePermissionRequest + | 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(); + return this.innerApiCalls.deletePermission(request, options, callback); + } + /** + * Transfers ownership of the tuned model. + * This is the only way to change ownership of the tuned model. + * The current owner will be downgraded to writer role. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The resource name of the tuned model to transfer ownership . + * + * Format: `tunedModels/my-model-id` + * @param {string} request.emailAddress + * Required. The email address of the user to whom the tuned model is being + * transferred to. + * @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.ai.generativelanguage.v1beta3.TransferOwnershipResponse|TransferOwnershipResponse}. + * 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/v1beta3/permission_service.transfer_ownership.js + * region_tag:generativelanguage_v1beta3_generated_PermissionService_TransferOwnership_async + */ + transferOwnership( + request?: protos.google.ai.generativelanguage.v1beta3.ITransferOwnershipRequest, + options?: CallOptions + ): Promise< + [ + protos.google.ai.generativelanguage.v1beta3.ITransferOwnershipResponse, + ( + | protos.google.ai.generativelanguage.v1beta3.ITransferOwnershipRequest + | undefined + ), + {} | undefined, + ] + >; + transferOwnership( + request: protos.google.ai.generativelanguage.v1beta3.ITransferOwnershipRequest, + options: CallOptions, + callback: Callback< + protos.google.ai.generativelanguage.v1beta3.ITransferOwnershipResponse, + | protos.google.ai.generativelanguage.v1beta3.ITransferOwnershipRequest + | null + | undefined, + {} | null | undefined + > + ): void; + transferOwnership( + request: protos.google.ai.generativelanguage.v1beta3.ITransferOwnershipRequest, + callback: Callback< + protos.google.ai.generativelanguage.v1beta3.ITransferOwnershipResponse, + | protos.google.ai.generativelanguage.v1beta3.ITransferOwnershipRequest + | null + | undefined, + {} | null | undefined + > + ): void; + transferOwnership( + request?: protos.google.ai.generativelanguage.v1beta3.ITransferOwnershipRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.ai.generativelanguage.v1beta3.ITransferOwnershipResponse, + | protos.google.ai.generativelanguage.v1beta3.ITransferOwnershipRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.ai.generativelanguage.v1beta3.ITransferOwnershipResponse, + | protos.google.ai.generativelanguage.v1beta3.ITransferOwnershipRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.ai.generativelanguage.v1beta3.ITransferOwnershipResponse, + ( + | protos.google.ai.generativelanguage.v1beta3.ITransferOwnershipRequest + | 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(); + return this.innerApiCalls.transferOwnership(request, options, callback); + } + + /** + * Lists permissions for the specific resource. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The parent resource of the permissions. + * Format: tunedModels/{tuned_model} + * @param {number} [request.pageSize] + * Optional. The maximum number of `Permission`s to return (per page). + * The service may return fewer permissions. + * + * If unspecified, at most 10 permissions will be returned. + * This method returns at most 1000 permissions per page, even if you pass + * larger page_size. + * @param {string} [request.pageToken] + * Optional. A page token, received from a previous `ListPermissions` call. + * + * Provide the `page_token` returned by one request as an argument to the + * next request to retrieve the next page. + * + * When paginating, all other parameters provided to `ListPermissions` + * 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.ai.generativelanguage.v1beta3.Permission|Permission}. + * 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 `listPermissionsAsync()` + * 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. + */ + listPermissions( + request?: protos.google.ai.generativelanguage.v1beta3.IListPermissionsRequest, + options?: CallOptions + ): Promise< + [ + protos.google.ai.generativelanguage.v1beta3.IPermission[], + protos.google.ai.generativelanguage.v1beta3.IListPermissionsRequest | null, + protos.google.ai.generativelanguage.v1beta3.IListPermissionsResponse, + ] + >; + listPermissions( + request: protos.google.ai.generativelanguage.v1beta3.IListPermissionsRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.ai.generativelanguage.v1beta3.IListPermissionsRequest, + | protos.google.ai.generativelanguage.v1beta3.IListPermissionsResponse + | null + | undefined, + protos.google.ai.generativelanguage.v1beta3.IPermission + > + ): void; + listPermissions( + request: protos.google.ai.generativelanguage.v1beta3.IListPermissionsRequest, + callback: PaginationCallback< + protos.google.ai.generativelanguage.v1beta3.IListPermissionsRequest, + | protos.google.ai.generativelanguage.v1beta3.IListPermissionsResponse + | null + | undefined, + protos.google.ai.generativelanguage.v1beta3.IPermission + > + ): void; + listPermissions( + request?: protos.google.ai.generativelanguage.v1beta3.IListPermissionsRequest, + optionsOrCallback?: + | CallOptions + | PaginationCallback< + protos.google.ai.generativelanguage.v1beta3.IListPermissionsRequest, + | protos.google.ai.generativelanguage.v1beta3.IListPermissionsResponse + | null + | undefined, + protos.google.ai.generativelanguage.v1beta3.IPermission + >, + callback?: PaginationCallback< + protos.google.ai.generativelanguage.v1beta3.IListPermissionsRequest, + | protos.google.ai.generativelanguage.v1beta3.IListPermissionsResponse + | null + | undefined, + protos.google.ai.generativelanguage.v1beta3.IPermission + > + ): Promise< + [ + protos.google.ai.generativelanguage.v1beta3.IPermission[], + protos.google.ai.generativelanguage.v1beta3.IListPermissionsRequest | null, + protos.google.ai.generativelanguage.v1beta3.IListPermissionsResponse, + ] + > | 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(); + return this.innerApiCalls.listPermissions(request, options, callback); + } + + /** + * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The parent resource of the permissions. + * Format: tunedModels/{tuned_model} + * @param {number} [request.pageSize] + * Optional. The maximum number of `Permission`s to return (per page). + * The service may return fewer permissions. + * + * If unspecified, at most 10 permissions will be returned. + * This method returns at most 1000 permissions per page, even if you pass + * larger page_size. + * @param {string} [request.pageToken] + * Optional. A page token, received from a previous `ListPermissions` call. + * + * Provide the `page_token` returned by one request as an argument to the + * next request to retrieve the next page. + * + * When paginating, all other parameters provided to `ListPermissions` + * 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.ai.generativelanguage.v1beta3.Permission|Permission} 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 `listPermissionsAsync()` + * 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. + */ + listPermissionsStream( + request?: protos.google.ai.generativelanguage.v1beta3.IListPermissionsRequest, + 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['listPermissions']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.listPermissions.createStream( + this.innerApiCalls.listPermissions as GaxCall, + request, + callSettings + ); + } + + /** + * Equivalent to `listPermissions`, 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 resource of the permissions. + * Format: tunedModels/{tuned_model} + * @param {number} [request.pageSize] + * Optional. The maximum number of `Permission`s to return (per page). + * The service may return fewer permissions. + * + * If unspecified, at most 10 permissions will be returned. + * This method returns at most 1000 permissions per page, even if you pass + * larger page_size. + * @param {string} [request.pageToken] + * Optional. A page token, received from a previous `ListPermissions` call. + * + * Provide the `page_token` returned by one request as an argument to the + * next request to retrieve the next page. + * + * When paginating, all other parameters provided to `ListPermissions` + * 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.ai.generativelanguage.v1beta3.Permission|Permission}. 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/v1beta3/permission_service.list_permissions.js + * region_tag:generativelanguage_v1beta3_generated_PermissionService_ListPermissions_async + */ + listPermissionsAsync( + request?: protos.google.ai.generativelanguage.v1beta3.IListPermissionsRequest, + 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['listPermissions']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.listPermissions.asyncIterate( + this.innerApiCalls['listPermissions'] as GaxCall, + request as {}, + callSettings + ) as AsyncIterable; + } + // -------------------- + // -- Path templates -- + // -------------------- + + /** + * Return a fully-qualified model resource name string. + * + * @param {string} model + * @returns {string} Resource name string. + */ + modelPath(model: string) { + return this.pathTemplates.modelPathTemplate.render({ + model: model, + }); + } + + /** + * Parse the model from Model resource. + * + * @param {string} modelName + * A fully-qualified path representing Model resource. + * @returns {string} A string representing the model. + */ + matchModelFromModelName(modelName: string) { + return this.pathTemplates.modelPathTemplate.match(modelName).model; + } + + /** + * Return a fully-qualified permission resource name string. + * + * @param {string} tuned_model + * @param {string} permission + * @returns {string} Resource name string. + */ + permissionPath(tunedModel: string, permission: string) { + return this.pathTemplates.permissionPathTemplate.render({ + tuned_model: tunedModel, + permission: permission, + }); + } + + /** + * Parse the tuned_model from Permission resource. + * + * @param {string} permissionName + * A fully-qualified path representing Permission resource. + * @returns {string} A string representing the tuned_model. + */ + matchTunedModelFromPermissionName(permissionName: string) { + return this.pathTemplates.permissionPathTemplate.match(permissionName) + .tuned_model; + } + + /** + * Parse the permission from Permission resource. + * + * @param {string} permissionName + * A fully-qualified path representing Permission resource. + * @returns {string} A string representing the permission. + */ + matchPermissionFromPermissionName(permissionName: string) { + return this.pathTemplates.permissionPathTemplate.match(permissionName) + .permission; + } + + /** + * Return a fully-qualified tunedModel resource name string. + * + * @param {string} tuned_model + * @returns {string} Resource name string. + */ + tunedModelPath(tunedModel: string) { + return this.pathTemplates.tunedModelPathTemplate.render({ + tuned_model: tunedModel, + }); + } + + /** + * Parse the tuned_model from TunedModel resource. + * + * @param {string} tunedModelName + * A fully-qualified path representing TunedModel resource. + * @returns {string} A string representing the tuned_model. + */ + matchTunedModelFromTunedModelName(tunedModelName: string) { + return this.pathTemplates.tunedModelPathTemplate.match(tunedModelName) + .tuned_model; + } + + /** + * 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.permissionServiceStub && !this._terminated) { + return this.permissionServiceStub.then(stub => { + this._terminated = true; + stub.close(); + }); + } + return Promise.resolve(); + } +} diff --git a/packages/google-ai-generativelanguage/src/v1beta3/permission_service_client_config.json b/packages/google-ai-generativelanguage/src/v1beta3/permission_service_client_config.json new file mode 100644 index 00000000000..7ff64302874 --- /dev/null +++ b/packages/google-ai-generativelanguage/src/v1beta3/permission_service_client_config.json @@ -0,0 +1,50 @@ +{ + "interfaces": { + "google.ai.generativelanguage.v1beta3.PermissionService": { + "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": { + "CreatePermission": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "GetPermission": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "ListPermissions": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "UpdatePermission": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "DeletePermission": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "TransferOwnership": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + } + } + } + } +} diff --git a/packages/google-ai-generativelanguage/src/v1beta3/permission_service_proto_list.json b/packages/google-ai-generativelanguage/src/v1beta3/permission_service_proto_list.json new file mode 100644 index 00000000000..088075193e9 --- /dev/null +++ b/packages/google-ai-generativelanguage/src/v1beta3/permission_service_proto_list.json @@ -0,0 +1,11 @@ +[ + "../../protos/google/ai/generativelanguage/v1beta3/citation.proto", + "../../protos/google/ai/generativelanguage/v1beta3/discuss_service.proto", + "../../protos/google/ai/generativelanguage/v1beta3/model.proto", + "../../protos/google/ai/generativelanguage/v1beta3/model_service.proto", + "../../protos/google/ai/generativelanguage/v1beta3/permission.proto", + "../../protos/google/ai/generativelanguage/v1beta3/permission_service.proto", + "../../protos/google/ai/generativelanguage/v1beta3/safety.proto", + "../../protos/google/ai/generativelanguage/v1beta3/text_service.proto", + "../../protos/google/ai/generativelanguage/v1beta3/tuned_model.proto" +] diff --git a/packages/google-ai-generativelanguage/src/v1beta3/text_service_client.ts b/packages/google-ai-generativelanguage/src/v1beta3/text_service_client.ts new file mode 100644 index 00000000000..1a71d3704c4 --- /dev/null +++ b/packages/google-ai-generativelanguage/src/v1beta3/text_service_client.ts @@ -0,0 +1,894 @@ +// Copyright 2023 Google LLC +// +// Licensed under the Apache License, Version 2.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, +} from 'google-gax'; + +import * as protos from '../../protos/protos'; +import jsonProtos = require('../../protos/protos.json'); +/** + * Client JSON configuration object, loaded from + * `src/v1beta3/text_service_client_config.json`. + * This file defines retry strategy and timeouts for all API methods in this library. + */ +import * as gapicConfig from './text_service_client_config.json'; +const version = require('../../../package.json').version; + +/** + * API for using Generative Language Models (GLMs) trained to generate text. + * + * Also known as Large Language Models (LLM)s, these generate text given an + * input prompt from the user. + * @class + * @memberof v1beta3 + */ +export class TextServiceClient { + 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}; + 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}; + textServiceStub?: Promise<{[name: string]: Function}>; + + /** + * Construct an instance of TextServiceClient. + * + * @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://developers.google.com/identity/protocols/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 TextServiceClient({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 TextServiceClient; + const servicePath = + opts?.servicePath || opts?.apiEndpoint || staticMembers.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 !== staticMembers.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 = staticMembers.servicePath; + + // Set the default scopes in auth client if needed. + if (servicePath === staticMembers.servicePath) { + this.auth.defaultScopes = staticMembers.scopes; + } + + // Determine the client header string. + const clientHeader = [`gax/${this._gaxModule.version}`, `gapic/${version}`]; + if (typeof process !== 'undefined' && '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 = { + modelPathTemplate: new this._gaxModule.PathTemplate('models/{model}'), + permissionPathTemplate: new this._gaxModule.PathTemplate( + 'tunedModels/{tuned_model}/permissions/{permission}' + ), + tunedModelPathTemplate: new this._gaxModule.PathTemplate( + 'tunedModels/{tuned_model}' + ), + }; + + // Put together the default options sent with requests. + this._defaults = this._gaxGrpc.constructSettings( + 'google.ai.generativelanguage.v1beta3.TextService', + 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.textServiceStub) { + return this.textServiceStub; + } + + // Put together the "service stub" for + // google.ai.generativelanguage.v1beta3.TextService. + this.textServiceStub = this._gaxGrpc.createStub( + this._opts.fallback + ? (this._protos as protobuf.Root).lookupService( + 'google.ai.generativelanguage.v1beta3.TextService' + ) + : // eslint-disable-next-line @typescript-eslint/no-explicit-any + (this._protos as any).google.ai.generativelanguage.v1beta3 + .TextService, + 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 textServiceStubMethods = [ + 'generateText', + 'embedText', + 'batchEmbedText', + 'countTextTokens', + ]; + for (const methodName of textServiceStubMethods) { + const callPromise = this.textServiceStub.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 = undefined; + const apiCall = this._gaxModule.createApiCall( + callPromise, + this._defaults[methodName], + descriptor, + this._opts.fallback + ); + + this.innerApiCalls[methodName] = apiCall; + } + + return this.textServiceStub; + } + + /** + * The DNS address for this API service. + * @returns {string} The DNS address for this service. + */ + static get servicePath() { + return 'generativelanguage.googleapis.com'; + } + + /** + * The DNS address for this API service - same as servicePath(), + * exists for compatibility reasons. + * @returns {string} The DNS address for this service. + */ + static get apiEndpoint() { + return 'generativelanguage.googleapis.com'; + } + + /** + * 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 []; + } + + 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 -- + // ------------------- + /** + * Generates a response from the model given an input message. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.model + * Required. The name of the `Model` or `TunedModel` to use for generating the + * completion. + * Examples: + * models/text-bison-001 + * tunedModels/sentence-translator-u3b7m + * @param {google.ai.generativelanguage.v1beta3.TextPrompt} request.prompt + * Required. The free-form input text given to the model as a prompt. + * + * Given a prompt, the model will generate a TextCompletion response it + * predicts as the completion of the input text. + * @param {number} [request.temperature] + * Optional. Controls the randomness of the output. + * Note: The default value varies by model, see the `Model.temperature` + * attribute of the `Model` returned the `getModel` function. + * + * Values can range from [0.0,1.0], + * inclusive. A value closer to 1.0 will produce responses that are more + * varied and creative, while a value closer to 0.0 will typically result in + * more straightforward responses from the model. + * @param {number} [request.candidateCount] + * Optional. Number of generated responses to return. + * + * This value must be between [1, 8], inclusive. If unset, this will default + * to 1. + * @param {number} [request.maxOutputTokens] + * Optional. The maximum number of tokens to include in a candidate. + * + * If unset, this will default to output_token_limit specified in the `Model` + * specification. + * @param {number} [request.topP] + * Optional. The maximum cumulative probability of tokens to consider when + * sampling. + * + * The model uses combined Top-k and nucleus sampling. + * + * Tokens are sorted based on their assigned probabilities so that only the + * most likely tokens are considered. Top-k sampling directly limits the + * maximum number of tokens to consider, while Nucleus sampling limits number + * of tokens based on the cumulative probability. + * + * Note: The default value varies by model, see the `Model.top_p` + * attribute of the `Model` returned the `getModel` function. + * @param {number} [request.topK] + * Optional. The maximum number of tokens to consider when sampling. + * + * The model uses combined Top-k and nucleus sampling. + * + * Top-k sampling considers the set of `top_k` most probable tokens. + * Defaults to 40. + * + * Note: The default value varies by model, see the `Model.top_k` + * attribute of the `Model` returned the `getModel` function. + * @param {number[]} request.safetySettings + * A list of unique `SafetySetting` instances for blocking unsafe content. + * + * that will be enforced on the `GenerateTextRequest.prompt` and + * `GenerateTextResponse.candidates`. There should not be more than one + * setting for each `SafetyCategory` type. The API will block any prompts and + * responses that fail to meet the thresholds set by these settings. This list + * overrides the default settings for each `SafetyCategory` specified in the + * safety_settings. If there is no `SafetySetting` for a given + * `SafetyCategory` provided in the list, the API will use the default safety + * setting for that category. + * @param {string[]} request.stopSequences + * The set of character sequences (up to 5) that will stop output generation. + * If specified, the API will stop at the first appearance of a stop + * sequence. The stop sequence will not be included as part of the response. + * @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.ai.generativelanguage.v1beta3.GenerateTextResponse|GenerateTextResponse}. + * 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/v1beta3/text_service.generate_text.js + * region_tag:generativelanguage_v1beta3_generated_TextService_GenerateText_async + */ + generateText( + request?: protos.google.ai.generativelanguage.v1beta3.IGenerateTextRequest, + options?: CallOptions + ): Promise< + [ + protos.google.ai.generativelanguage.v1beta3.IGenerateTextResponse, + ( + | protos.google.ai.generativelanguage.v1beta3.IGenerateTextRequest + | undefined + ), + {} | undefined, + ] + >; + generateText( + request: protos.google.ai.generativelanguage.v1beta3.IGenerateTextRequest, + options: CallOptions, + callback: Callback< + protos.google.ai.generativelanguage.v1beta3.IGenerateTextResponse, + | protos.google.ai.generativelanguage.v1beta3.IGenerateTextRequest + | null + | undefined, + {} | null | undefined + > + ): void; + generateText( + request: protos.google.ai.generativelanguage.v1beta3.IGenerateTextRequest, + callback: Callback< + protos.google.ai.generativelanguage.v1beta3.IGenerateTextResponse, + | protos.google.ai.generativelanguage.v1beta3.IGenerateTextRequest + | null + | undefined, + {} | null | undefined + > + ): void; + generateText( + request?: protos.google.ai.generativelanguage.v1beta3.IGenerateTextRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.ai.generativelanguage.v1beta3.IGenerateTextResponse, + | protos.google.ai.generativelanguage.v1beta3.IGenerateTextRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.ai.generativelanguage.v1beta3.IGenerateTextResponse, + | protos.google.ai.generativelanguage.v1beta3.IGenerateTextRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.ai.generativelanguage.v1beta3.IGenerateTextResponse, + ( + | protos.google.ai.generativelanguage.v1beta3.IGenerateTextRequest + | 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({ + model: request.model ?? '', + }); + this.initialize(); + return this.innerApiCalls.generateText(request, options, callback); + } + /** + * Generates an embedding from the model given an input message. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.model + * Required. The model name to use with the format model=models/{model}. + * @param {string} request.text + * Required. The free-form input text that the model will turn into an + * embedding. + * @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.ai.generativelanguage.v1beta3.EmbedTextResponse|EmbedTextResponse}. + * 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/v1beta3/text_service.embed_text.js + * region_tag:generativelanguage_v1beta3_generated_TextService_EmbedText_async + */ + embedText( + request?: protos.google.ai.generativelanguage.v1beta3.IEmbedTextRequest, + options?: CallOptions + ): Promise< + [ + protos.google.ai.generativelanguage.v1beta3.IEmbedTextResponse, + protos.google.ai.generativelanguage.v1beta3.IEmbedTextRequest | undefined, + {} | undefined, + ] + >; + embedText( + request: protos.google.ai.generativelanguage.v1beta3.IEmbedTextRequest, + options: CallOptions, + callback: Callback< + protos.google.ai.generativelanguage.v1beta3.IEmbedTextResponse, + | protos.google.ai.generativelanguage.v1beta3.IEmbedTextRequest + | null + | undefined, + {} | null | undefined + > + ): void; + embedText( + request: protos.google.ai.generativelanguage.v1beta3.IEmbedTextRequest, + callback: Callback< + protos.google.ai.generativelanguage.v1beta3.IEmbedTextResponse, + | protos.google.ai.generativelanguage.v1beta3.IEmbedTextRequest + | null + | undefined, + {} | null | undefined + > + ): void; + embedText( + request?: protos.google.ai.generativelanguage.v1beta3.IEmbedTextRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.ai.generativelanguage.v1beta3.IEmbedTextResponse, + | protos.google.ai.generativelanguage.v1beta3.IEmbedTextRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.ai.generativelanguage.v1beta3.IEmbedTextResponse, + | protos.google.ai.generativelanguage.v1beta3.IEmbedTextRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.ai.generativelanguage.v1beta3.IEmbedTextResponse, + protos.google.ai.generativelanguage.v1beta3.IEmbedTextRequest | 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({ + model: request.model ?? '', + }); + this.initialize(); + return this.innerApiCalls.embedText(request, options, callback); + } + /** + * Generates multiple embeddings from the model given input text in a + * synchronous call. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.model + * Required. The name of the `Model` to use for generating the embedding. + * Examples: + * models/embedding-gecko-001 + * @param {string[]} request.texts + * Required. The free-form input texts that the model will turn into an + * embedding. The current limit is 100 texts, over which an error will be + * thrown. + * @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.ai.generativelanguage.v1beta3.BatchEmbedTextResponse|BatchEmbedTextResponse}. + * 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/v1beta3/text_service.batch_embed_text.js + * region_tag:generativelanguage_v1beta3_generated_TextService_BatchEmbedText_async + */ + batchEmbedText( + request?: protos.google.ai.generativelanguage.v1beta3.IBatchEmbedTextRequest, + options?: CallOptions + ): Promise< + [ + protos.google.ai.generativelanguage.v1beta3.IBatchEmbedTextResponse, + ( + | protos.google.ai.generativelanguage.v1beta3.IBatchEmbedTextRequest + | undefined + ), + {} | undefined, + ] + >; + batchEmbedText( + request: protos.google.ai.generativelanguage.v1beta3.IBatchEmbedTextRequest, + options: CallOptions, + callback: Callback< + protos.google.ai.generativelanguage.v1beta3.IBatchEmbedTextResponse, + | protos.google.ai.generativelanguage.v1beta3.IBatchEmbedTextRequest + | null + | undefined, + {} | null | undefined + > + ): void; + batchEmbedText( + request: protos.google.ai.generativelanguage.v1beta3.IBatchEmbedTextRequest, + callback: Callback< + protos.google.ai.generativelanguage.v1beta3.IBatchEmbedTextResponse, + | protos.google.ai.generativelanguage.v1beta3.IBatchEmbedTextRequest + | null + | undefined, + {} | null | undefined + > + ): void; + batchEmbedText( + request?: protos.google.ai.generativelanguage.v1beta3.IBatchEmbedTextRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.ai.generativelanguage.v1beta3.IBatchEmbedTextResponse, + | protos.google.ai.generativelanguage.v1beta3.IBatchEmbedTextRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.ai.generativelanguage.v1beta3.IBatchEmbedTextResponse, + | protos.google.ai.generativelanguage.v1beta3.IBatchEmbedTextRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.ai.generativelanguage.v1beta3.IBatchEmbedTextResponse, + ( + | protos.google.ai.generativelanguage.v1beta3.IBatchEmbedTextRequest + | 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({ + model: request.model ?? '', + }); + this.initialize(); + return this.innerApiCalls.batchEmbedText(request, options, callback); + } + /** + * Runs a model's tokenizer on a text and returns the token count. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.model + * Required. The model's resource name. This serves as an ID for the Model to + * use. + * + * This name should match a model name returned by the `ListModels` method. + * + * Format: `models/{model}` + * @param {google.ai.generativelanguage.v1beta3.TextPrompt} request.prompt + * Required. The free-form input text given to the model as a prompt. + * @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.ai.generativelanguage.v1beta3.CountTextTokensResponse|CountTextTokensResponse}. + * 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/v1beta3/text_service.count_text_tokens.js + * region_tag:generativelanguage_v1beta3_generated_TextService_CountTextTokens_async + */ + countTextTokens( + request?: protos.google.ai.generativelanguage.v1beta3.ICountTextTokensRequest, + options?: CallOptions + ): Promise< + [ + protos.google.ai.generativelanguage.v1beta3.ICountTextTokensResponse, + ( + | protos.google.ai.generativelanguage.v1beta3.ICountTextTokensRequest + | undefined + ), + {} | undefined, + ] + >; + countTextTokens( + request: protos.google.ai.generativelanguage.v1beta3.ICountTextTokensRequest, + options: CallOptions, + callback: Callback< + protos.google.ai.generativelanguage.v1beta3.ICountTextTokensResponse, + | protos.google.ai.generativelanguage.v1beta3.ICountTextTokensRequest + | null + | undefined, + {} | null | undefined + > + ): void; + countTextTokens( + request: protos.google.ai.generativelanguage.v1beta3.ICountTextTokensRequest, + callback: Callback< + protos.google.ai.generativelanguage.v1beta3.ICountTextTokensResponse, + | protos.google.ai.generativelanguage.v1beta3.ICountTextTokensRequest + | null + | undefined, + {} | null | undefined + > + ): void; + countTextTokens( + request?: protos.google.ai.generativelanguage.v1beta3.ICountTextTokensRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.ai.generativelanguage.v1beta3.ICountTextTokensResponse, + | protos.google.ai.generativelanguage.v1beta3.ICountTextTokensRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.ai.generativelanguage.v1beta3.ICountTextTokensResponse, + | protos.google.ai.generativelanguage.v1beta3.ICountTextTokensRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.ai.generativelanguage.v1beta3.ICountTextTokensResponse, + ( + | protos.google.ai.generativelanguage.v1beta3.ICountTextTokensRequest + | 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({ + model: request.model ?? '', + }); + this.initialize(); + return this.innerApiCalls.countTextTokens(request, options, callback); + } + + // -------------------- + // -- Path templates -- + // -------------------- + + /** + * Return a fully-qualified model resource name string. + * + * @param {string} model + * @returns {string} Resource name string. + */ + modelPath(model: string) { + return this.pathTemplates.modelPathTemplate.render({ + model: model, + }); + } + + /** + * Parse the model from Model resource. + * + * @param {string} modelName + * A fully-qualified path representing Model resource. + * @returns {string} A string representing the model. + */ + matchModelFromModelName(modelName: string) { + return this.pathTemplates.modelPathTemplate.match(modelName).model; + } + + /** + * Return a fully-qualified permission resource name string. + * + * @param {string} tuned_model + * @param {string} permission + * @returns {string} Resource name string. + */ + permissionPath(tunedModel: string, permission: string) { + return this.pathTemplates.permissionPathTemplate.render({ + tuned_model: tunedModel, + permission: permission, + }); + } + + /** + * Parse the tuned_model from Permission resource. + * + * @param {string} permissionName + * A fully-qualified path representing Permission resource. + * @returns {string} A string representing the tuned_model. + */ + matchTunedModelFromPermissionName(permissionName: string) { + return this.pathTemplates.permissionPathTemplate.match(permissionName) + .tuned_model; + } + + /** + * Parse the permission from Permission resource. + * + * @param {string} permissionName + * A fully-qualified path representing Permission resource. + * @returns {string} A string representing the permission. + */ + matchPermissionFromPermissionName(permissionName: string) { + return this.pathTemplates.permissionPathTemplate.match(permissionName) + .permission; + } + + /** + * Return a fully-qualified tunedModel resource name string. + * + * @param {string} tuned_model + * @returns {string} Resource name string. + */ + tunedModelPath(tunedModel: string) { + return this.pathTemplates.tunedModelPathTemplate.render({ + tuned_model: tunedModel, + }); + } + + /** + * Parse the tuned_model from TunedModel resource. + * + * @param {string} tunedModelName + * A fully-qualified path representing TunedModel resource. + * @returns {string} A string representing the tuned_model. + */ + matchTunedModelFromTunedModelName(tunedModelName: string) { + return this.pathTemplates.tunedModelPathTemplate.match(tunedModelName) + .tuned_model; + } + + /** + * 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.textServiceStub && !this._terminated) { + return this.textServiceStub.then(stub => { + this._terminated = true; + stub.close(); + }); + } + return Promise.resolve(); + } +} diff --git a/packages/google-ai-generativelanguage/src/v1beta3/text_service_client_config.json b/packages/google-ai-generativelanguage/src/v1beta3/text_service_client_config.json new file mode 100644 index 00000000000..ad86c70c7c0 --- /dev/null +++ b/packages/google-ai-generativelanguage/src/v1beta3/text_service_client_config.json @@ -0,0 +1,42 @@ +{ + "interfaces": { + "google.ai.generativelanguage.v1beta3.TextService": { + "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": { + "GenerateText": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "EmbedText": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "BatchEmbedText": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "CountTextTokens": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + } + } + } + } +} diff --git a/packages/google-ai-generativelanguage/src/v1beta3/text_service_proto_list.json b/packages/google-ai-generativelanguage/src/v1beta3/text_service_proto_list.json new file mode 100644 index 00000000000..088075193e9 --- /dev/null +++ b/packages/google-ai-generativelanguage/src/v1beta3/text_service_proto_list.json @@ -0,0 +1,11 @@ +[ + "../../protos/google/ai/generativelanguage/v1beta3/citation.proto", + "../../protos/google/ai/generativelanguage/v1beta3/discuss_service.proto", + "../../protos/google/ai/generativelanguage/v1beta3/model.proto", + "../../protos/google/ai/generativelanguage/v1beta3/model_service.proto", + "../../protos/google/ai/generativelanguage/v1beta3/permission.proto", + "../../protos/google/ai/generativelanguage/v1beta3/permission_service.proto", + "../../protos/google/ai/generativelanguage/v1beta3/safety.proto", + "../../protos/google/ai/generativelanguage/v1beta3/text_service.proto", + "../../protos/google/ai/generativelanguage/v1beta3/tuned_model.proto" +] diff --git a/packages/google-ai-generativelanguage/test/gapic_discuss_service_v1beta3.ts b/packages/google-ai-generativelanguage/test/gapic_discuss_service_v1beta3.ts new file mode 100644 index 00000000000..d559ef0d810 --- /dev/null +++ b/packages/google-ai-generativelanguage/test/gapic_discuss_service_v1beta3.ts @@ -0,0 +1,557 @@ +// Copyright 2023 Google LLC +// +// Licensed under the Apache License, Version 2.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 discussserviceModule from '../src'; + +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); +} + +describe('v1beta3.DiscussServiceClient', () => { + describe('Common methods', () => { + it('has servicePath', () => { + const servicePath = + discussserviceModule.v1beta3.DiscussServiceClient.servicePath; + assert(servicePath); + }); + + it('has apiEndpoint', () => { + const apiEndpoint = + discussserviceModule.v1beta3.DiscussServiceClient.apiEndpoint; + assert(apiEndpoint); + }); + + it('has port', () => { + const port = discussserviceModule.v1beta3.DiscussServiceClient.port; + assert(port); + assert(typeof port === 'number'); + }); + + it('should create a client with no option', () => { + const client = new discussserviceModule.v1beta3.DiscussServiceClient(); + assert(client); + }); + + it('should create a client with gRPC fallback', () => { + const client = new discussserviceModule.v1beta3.DiscussServiceClient({ + fallback: true, + }); + assert(client); + }); + + it('has initialize method and supports deferred initialization', async () => { + const client = new discussserviceModule.v1beta3.DiscussServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + assert.strictEqual(client.discussServiceStub, undefined); + await client.initialize(); + assert(client.discussServiceStub); + }); + + it('has close method for the initialized client', done => { + const client = new discussserviceModule.v1beta3.DiscussServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + assert(client.discussServiceStub); + client.close().then(() => { + done(); + }); + }); + + it('has close method for the non-initialized client', done => { + const client = new discussserviceModule.v1beta3.DiscussServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + assert.strictEqual(client.discussServiceStub, undefined); + client.close().then(() => { + done(); + }); + }); + + it('has getProjectId method', async () => { + const fakeProjectId = 'fake-project-id'; + const client = new discussserviceModule.v1beta3.DiscussServiceClient({ + 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 discussserviceModule.v1beta3.DiscussServiceClient({ + 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('generateMessage', () => { + it('invokes generateMessage without error', async () => { + const client = new discussserviceModule.v1beta3.DiscussServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.ai.generativelanguage.v1beta3.GenerateMessageRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.ai.generativelanguage.v1beta3.GenerateMessageRequest', + ['model'] + ); + request.model = defaultValue1; + const expectedHeaderRequestParams = `model=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.ai.generativelanguage.v1beta3.GenerateMessageResponse() + ); + client.innerApiCalls.generateMessage = stubSimpleCall(expectedResponse); + const [response] = await client.generateMessage(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.generateMessage as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.generateMessage as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes generateMessage without error using callback', async () => { + const client = new discussserviceModule.v1beta3.DiscussServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.ai.generativelanguage.v1beta3.GenerateMessageRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.ai.generativelanguage.v1beta3.GenerateMessageRequest', + ['model'] + ); + request.model = defaultValue1; + const expectedHeaderRequestParams = `model=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.ai.generativelanguage.v1beta3.GenerateMessageResponse() + ); + client.innerApiCalls.generateMessage = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.generateMessage( + request, + ( + err?: Error | null, + result?: protos.google.ai.generativelanguage.v1beta3.IGenerateMessageResponse | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.generateMessage as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.generateMessage as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes generateMessage with error', async () => { + const client = new discussserviceModule.v1beta3.DiscussServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.ai.generativelanguage.v1beta3.GenerateMessageRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.ai.generativelanguage.v1beta3.GenerateMessageRequest', + ['model'] + ); + request.model = defaultValue1; + const expectedHeaderRequestParams = `model=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.generateMessage = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.generateMessage(request), expectedError); + const actualRequest = ( + client.innerApiCalls.generateMessage as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.generateMessage as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes generateMessage with closed client', async () => { + const client = new discussserviceModule.v1beta3.DiscussServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.ai.generativelanguage.v1beta3.GenerateMessageRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.ai.generativelanguage.v1beta3.GenerateMessageRequest', + ['model'] + ); + request.model = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.generateMessage(request), expectedError); + }); + }); + + describe('countMessageTokens', () => { + it('invokes countMessageTokens without error', async () => { + const client = new discussserviceModule.v1beta3.DiscussServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.ai.generativelanguage.v1beta3.CountMessageTokensRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.ai.generativelanguage.v1beta3.CountMessageTokensRequest', + ['model'] + ); + request.model = defaultValue1; + const expectedHeaderRequestParams = `model=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.ai.generativelanguage.v1beta3.CountMessageTokensResponse() + ); + client.innerApiCalls.countMessageTokens = + stubSimpleCall(expectedResponse); + const [response] = await client.countMessageTokens(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.countMessageTokens as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.countMessageTokens as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes countMessageTokens without error using callback', async () => { + const client = new discussserviceModule.v1beta3.DiscussServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.ai.generativelanguage.v1beta3.CountMessageTokensRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.ai.generativelanguage.v1beta3.CountMessageTokensRequest', + ['model'] + ); + request.model = defaultValue1; + const expectedHeaderRequestParams = `model=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.ai.generativelanguage.v1beta3.CountMessageTokensResponse() + ); + client.innerApiCalls.countMessageTokens = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.countMessageTokens( + request, + ( + err?: Error | null, + result?: protos.google.ai.generativelanguage.v1beta3.ICountMessageTokensResponse | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.countMessageTokens as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.countMessageTokens as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes countMessageTokens with error', async () => { + const client = new discussserviceModule.v1beta3.DiscussServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.ai.generativelanguage.v1beta3.CountMessageTokensRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.ai.generativelanguage.v1beta3.CountMessageTokensRequest', + ['model'] + ); + request.model = defaultValue1; + const expectedHeaderRequestParams = `model=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.countMessageTokens = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.countMessageTokens(request), expectedError); + const actualRequest = ( + client.innerApiCalls.countMessageTokens as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.countMessageTokens as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes countMessageTokens with closed client', async () => { + const client = new discussserviceModule.v1beta3.DiscussServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.ai.generativelanguage.v1beta3.CountMessageTokensRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.ai.generativelanguage.v1beta3.CountMessageTokensRequest', + ['model'] + ); + request.model = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.countMessageTokens(request), expectedError); + }); + }); + + describe('Path templates', () => { + describe('model', () => { + const fakePath = '/rendered/path/model'; + const expectedParameters = { + model: 'modelValue', + }; + const client = new discussserviceModule.v1beta3.DiscussServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.modelPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.modelPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('modelPath', () => { + const result = client.modelPath('modelValue'); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.modelPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchModelFromModelName', () => { + const result = client.matchModelFromModelName(fakePath); + assert.strictEqual(result, 'modelValue'); + assert( + (client.pathTemplates.modelPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('permission', () => { + const fakePath = '/rendered/path/permission'; + const expectedParameters = { + tuned_model: 'tunedModelValue', + permission: 'permissionValue', + }; + const client = new discussserviceModule.v1beta3.DiscussServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.permissionPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.permissionPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('permissionPath', () => { + const result = client.permissionPath( + 'tunedModelValue', + 'permissionValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.permissionPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchTunedModelFromPermissionName', () => { + const result = client.matchTunedModelFromPermissionName(fakePath); + assert.strictEqual(result, 'tunedModelValue'); + assert( + (client.pathTemplates.permissionPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchPermissionFromPermissionName', () => { + const result = client.matchPermissionFromPermissionName(fakePath); + assert.strictEqual(result, 'permissionValue'); + assert( + (client.pathTemplates.permissionPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('tunedModel', () => { + const fakePath = '/rendered/path/tunedModel'; + const expectedParameters = { + tuned_model: 'tunedModelValue', + }; + const client = new discussserviceModule.v1beta3.DiscussServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.tunedModelPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.tunedModelPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('tunedModelPath', () => { + const result = client.tunedModelPath('tunedModelValue'); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.tunedModelPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchTunedModelFromTunedModelName', () => { + const result = client.matchTunedModelFromTunedModelName(fakePath); + assert.strictEqual(result, 'tunedModelValue'); + assert( + (client.pathTemplates.tunedModelPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + }); +}); diff --git a/packages/google-ai-generativelanguage/test/gapic_model_service_v1beta3.ts b/packages/google-ai-generativelanguage/test/gapic_model_service_v1beta3.ts new file mode 100644 index 00000000000..4e12a475d40 --- /dev/null +++ b/packages/google-ai-generativelanguage/test/gapic_model_service_v1beta3.ts @@ -0,0 +1,1835 @@ +// Copyright 2023 Google LLC +// +// Licensed under the Apache License, Version 2.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 modelserviceModule 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 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('v1beta3.ModelServiceClient', () => { + describe('Common methods', () => { + it('has servicePath', () => { + const servicePath = + modelserviceModule.v1beta3.ModelServiceClient.servicePath; + assert(servicePath); + }); + + it('has apiEndpoint', () => { + const apiEndpoint = + modelserviceModule.v1beta3.ModelServiceClient.apiEndpoint; + assert(apiEndpoint); + }); + + it('has port', () => { + const port = modelserviceModule.v1beta3.ModelServiceClient.port; + assert(port); + assert(typeof port === 'number'); + }); + + it('should create a client with no option', () => { + const client = new modelserviceModule.v1beta3.ModelServiceClient(); + assert(client); + }); + + it('should create a client with gRPC fallback', () => { + const client = new modelserviceModule.v1beta3.ModelServiceClient({ + fallback: true, + }); + assert(client); + }); + + it('has initialize method and supports deferred initialization', async () => { + const client = new modelserviceModule.v1beta3.ModelServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + assert.strictEqual(client.modelServiceStub, undefined); + await client.initialize(); + assert(client.modelServiceStub); + }); + + it('has close method for the initialized client', done => { + const client = new modelserviceModule.v1beta3.ModelServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + assert(client.modelServiceStub); + client.close().then(() => { + done(); + }); + }); + + it('has close method for the non-initialized client', done => { + const client = new modelserviceModule.v1beta3.ModelServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + assert.strictEqual(client.modelServiceStub, undefined); + client.close().then(() => { + done(); + }); + }); + + it('has getProjectId method', async () => { + const fakeProjectId = 'fake-project-id'; + const client = new modelserviceModule.v1beta3.ModelServiceClient({ + 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 modelserviceModule.v1beta3.ModelServiceClient({ + 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('getModel', () => { + it('invokes getModel without error', async () => { + const client = new modelserviceModule.v1beta3.ModelServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.ai.generativelanguage.v1beta3.GetModelRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.ai.generativelanguage.v1beta3.GetModelRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.ai.generativelanguage.v1beta3.Model() + ); + client.innerApiCalls.getModel = stubSimpleCall(expectedResponse); + const [response] = await client.getModel(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.getModel as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getModel as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getModel without error using callback', async () => { + const client = new modelserviceModule.v1beta3.ModelServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.ai.generativelanguage.v1beta3.GetModelRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.ai.generativelanguage.v1beta3.GetModelRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.ai.generativelanguage.v1beta3.Model() + ); + client.innerApiCalls.getModel = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getModel( + request, + ( + err?: Error | null, + result?: protos.google.ai.generativelanguage.v1beta3.IModel | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.getModel as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getModel as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getModel with error', async () => { + const client = new modelserviceModule.v1beta3.ModelServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.ai.generativelanguage.v1beta3.GetModelRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.ai.generativelanguage.v1beta3.GetModelRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.getModel = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.getModel(request), expectedError); + const actualRequest = ( + client.innerApiCalls.getModel as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getModel as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getModel with closed client', async () => { + const client = new modelserviceModule.v1beta3.ModelServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.ai.generativelanguage.v1beta3.GetModelRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.ai.generativelanguage.v1beta3.GetModelRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.getModel(request), expectedError); + }); + }); + + describe('getTunedModel', () => { + it('invokes getTunedModel without error', async () => { + const client = new modelserviceModule.v1beta3.ModelServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.ai.generativelanguage.v1beta3.GetTunedModelRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.ai.generativelanguage.v1beta3.GetTunedModelRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.ai.generativelanguage.v1beta3.TunedModel() + ); + client.innerApiCalls.getTunedModel = stubSimpleCall(expectedResponse); + const [response] = await client.getTunedModel(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.getTunedModel as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getTunedModel as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getTunedModel without error using callback', async () => { + const client = new modelserviceModule.v1beta3.ModelServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.ai.generativelanguage.v1beta3.GetTunedModelRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.ai.generativelanguage.v1beta3.GetTunedModelRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.ai.generativelanguage.v1beta3.TunedModel() + ); + client.innerApiCalls.getTunedModel = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getTunedModel( + request, + ( + err?: Error | null, + result?: protos.google.ai.generativelanguage.v1beta3.ITunedModel | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.getTunedModel as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getTunedModel as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getTunedModel with error', async () => { + const client = new modelserviceModule.v1beta3.ModelServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.ai.generativelanguage.v1beta3.GetTunedModelRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.ai.generativelanguage.v1beta3.GetTunedModelRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.getTunedModel = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.getTunedModel(request), expectedError); + const actualRequest = ( + client.innerApiCalls.getTunedModel as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getTunedModel as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getTunedModel with closed client', async () => { + const client = new modelserviceModule.v1beta3.ModelServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.ai.generativelanguage.v1beta3.GetTunedModelRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.ai.generativelanguage.v1beta3.GetTunedModelRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.getTunedModel(request), expectedError); + }); + }); + + describe('updateTunedModel', () => { + it('invokes updateTunedModel without error', async () => { + const client = new modelserviceModule.v1beta3.ModelServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.ai.generativelanguage.v1beta3.UpdateTunedModelRequest() + ); + request.tunedModel ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.ai.generativelanguage.v1beta3.UpdateTunedModelRequest', + ['tunedModel', 'name'] + ); + request.tunedModel.name = defaultValue1; + const expectedHeaderRequestParams = `tuned_model.name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.ai.generativelanguage.v1beta3.TunedModel() + ); + client.innerApiCalls.updateTunedModel = stubSimpleCall(expectedResponse); + const [response] = await client.updateTunedModel(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.updateTunedModel as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateTunedModel as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateTunedModel without error using callback', async () => { + const client = new modelserviceModule.v1beta3.ModelServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.ai.generativelanguage.v1beta3.UpdateTunedModelRequest() + ); + request.tunedModel ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.ai.generativelanguage.v1beta3.UpdateTunedModelRequest', + ['tunedModel', 'name'] + ); + request.tunedModel.name = defaultValue1; + const expectedHeaderRequestParams = `tuned_model.name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.ai.generativelanguage.v1beta3.TunedModel() + ); + client.innerApiCalls.updateTunedModel = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.updateTunedModel( + request, + ( + err?: Error | null, + result?: protos.google.ai.generativelanguage.v1beta3.ITunedModel | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.updateTunedModel as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateTunedModel as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateTunedModel with error', async () => { + const client = new modelserviceModule.v1beta3.ModelServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.ai.generativelanguage.v1beta3.UpdateTunedModelRequest() + ); + request.tunedModel ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.ai.generativelanguage.v1beta3.UpdateTunedModelRequest', + ['tunedModel', 'name'] + ); + request.tunedModel.name = defaultValue1; + const expectedHeaderRequestParams = `tuned_model.name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.updateTunedModel = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.updateTunedModel(request), expectedError); + const actualRequest = ( + client.innerApiCalls.updateTunedModel as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateTunedModel as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateTunedModel with closed client', async () => { + const client = new modelserviceModule.v1beta3.ModelServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.ai.generativelanguage.v1beta3.UpdateTunedModelRequest() + ); + request.tunedModel ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.ai.generativelanguage.v1beta3.UpdateTunedModelRequest', + ['tunedModel', 'name'] + ); + request.tunedModel.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.updateTunedModel(request), expectedError); + }); + }); + + describe('deleteTunedModel', () => { + it('invokes deleteTunedModel without error', async () => { + const client = new modelserviceModule.v1beta3.ModelServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.ai.generativelanguage.v1beta3.DeleteTunedModelRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.ai.generativelanguage.v1beta3.DeleteTunedModelRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.innerApiCalls.deleteTunedModel = stubSimpleCall(expectedResponse); + const [response] = await client.deleteTunedModel(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.deleteTunedModel as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteTunedModel as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteTunedModel without error using callback', async () => { + const client = new modelserviceModule.v1beta3.ModelServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.ai.generativelanguage.v1beta3.DeleteTunedModelRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.ai.generativelanguage.v1beta3.DeleteTunedModelRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.innerApiCalls.deleteTunedModel = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.deleteTunedModel( + 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.deleteTunedModel as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteTunedModel as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteTunedModel with error', async () => { + const client = new modelserviceModule.v1beta3.ModelServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.ai.generativelanguage.v1beta3.DeleteTunedModelRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.ai.generativelanguage.v1beta3.DeleteTunedModelRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteTunedModel = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.deleteTunedModel(request), expectedError); + const actualRequest = ( + client.innerApiCalls.deleteTunedModel as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteTunedModel as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteTunedModel with closed client', async () => { + const client = new modelserviceModule.v1beta3.ModelServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.ai.generativelanguage.v1beta3.DeleteTunedModelRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.ai.generativelanguage.v1beta3.DeleteTunedModelRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.deleteTunedModel(request), expectedError); + }); + }); + + describe('createTunedModel', () => { + it('invokes createTunedModel without error', async () => { + const client = new modelserviceModule.v1beta3.ModelServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.ai.generativelanguage.v1beta3.CreateTunedModelRequest() + ); + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.createTunedModel = + stubLongRunningCall(expectedResponse); + const [operation] = await client.createTunedModel(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + }); + + it('invokes createTunedModel without error using callback', async () => { + const client = new modelserviceModule.v1beta3.ModelServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.ai.generativelanguage.v1beta3.CreateTunedModelRequest() + ); + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.createTunedModel = + stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.createTunedModel( + request, + ( + err?: Error | null, + result?: LROperation< + protos.google.ai.generativelanguage.v1beta3.ITunedModel, + protos.google.ai.generativelanguage.v1beta3.ICreateTunedModelMetadata + > | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const operation = (await promise) as LROperation< + protos.google.ai.generativelanguage.v1beta3.ITunedModel, + protos.google.ai.generativelanguage.v1beta3.ICreateTunedModelMetadata + >; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + }); + + it('invokes createTunedModel with call error', async () => { + const client = new modelserviceModule.v1beta3.ModelServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.ai.generativelanguage.v1beta3.CreateTunedModelRequest() + ); + const expectedError = new Error('expected'); + client.innerApiCalls.createTunedModel = stubLongRunningCall( + undefined, + expectedError + ); + await assert.rejects(client.createTunedModel(request), expectedError); + }); + + it('invokes createTunedModel with LRO error', async () => { + const client = new modelserviceModule.v1beta3.ModelServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.ai.generativelanguage.v1beta3.CreateTunedModelRequest() + ); + const expectedError = new Error('expected'); + client.innerApiCalls.createTunedModel = stubLongRunningCall( + undefined, + undefined, + expectedError + ); + const [operation] = await client.createTunedModel(request); + await assert.rejects(operation.promise(), expectedError); + }); + + it('invokes checkCreateTunedModelProgress without error', async () => { + const client = new modelserviceModule.v1beta3.ModelServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + 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.checkCreateTunedModelProgress( + expectedResponse.name + ); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkCreateTunedModelProgress with error', async () => { + const client = new modelserviceModule.v1beta3.ModelServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const expectedError = new Error('expected'); + + client.operationsClient.getOperation = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects( + client.checkCreateTunedModelProgress(''), + expectedError + ); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + }); + + describe('listModels', () => { + it('invokes listModels without error', async () => { + const client = new modelserviceModule.v1beta3.ModelServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.ai.generativelanguage.v1beta3.ListModelsRequest() + ); + const expectedResponse = [ + generateSampleMessage( + new protos.google.ai.generativelanguage.v1beta3.Model() + ), + generateSampleMessage( + new protos.google.ai.generativelanguage.v1beta3.Model() + ), + generateSampleMessage( + new protos.google.ai.generativelanguage.v1beta3.Model() + ), + ]; + client.innerApiCalls.listModels = stubSimpleCall(expectedResponse); + const [response] = await client.listModels(request); + assert.deepStrictEqual(response, expectedResponse); + }); + + it('invokes listModels without error using callback', async () => { + const client = new modelserviceModule.v1beta3.ModelServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.ai.generativelanguage.v1beta3.ListModelsRequest() + ); + const expectedResponse = [ + generateSampleMessage( + new protos.google.ai.generativelanguage.v1beta3.Model() + ), + generateSampleMessage( + new protos.google.ai.generativelanguage.v1beta3.Model() + ), + generateSampleMessage( + new protos.google.ai.generativelanguage.v1beta3.Model() + ), + ]; + client.innerApiCalls.listModels = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.listModels( + request, + ( + err?: Error | null, + result?: protos.google.ai.generativelanguage.v1beta3.IModel[] | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + }); + + it('invokes listModels with error', async () => { + const client = new modelserviceModule.v1beta3.ModelServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.ai.generativelanguage.v1beta3.ListModelsRequest() + ); + const expectedError = new Error('expected'); + client.innerApiCalls.listModels = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.listModels(request), expectedError); + }); + + it('invokes listModelsStream without error', async () => { + const client = new modelserviceModule.v1beta3.ModelServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.ai.generativelanguage.v1beta3.ListModelsRequest() + ); + const expectedResponse = [ + generateSampleMessage( + new protos.google.ai.generativelanguage.v1beta3.Model() + ), + generateSampleMessage( + new protos.google.ai.generativelanguage.v1beta3.Model() + ), + generateSampleMessage( + new protos.google.ai.generativelanguage.v1beta3.Model() + ), + ]; + client.descriptors.page.listModels.createStream = + stubPageStreamingCall(expectedResponse); + const stream = client.listModelsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.ai.generativelanguage.v1beta3.Model[] = + []; + stream.on( + 'data', + (response: protos.google.ai.generativelanguage.v1beta3.Model) => { + 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.listModels.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.listModels, request) + ); + }); + + it('invokes listModelsStream with error', async () => { + const client = new modelserviceModule.v1beta3.ModelServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.ai.generativelanguage.v1beta3.ListModelsRequest() + ); + const expectedError = new Error('expected'); + client.descriptors.page.listModels.createStream = stubPageStreamingCall( + undefined, + expectedError + ); + const stream = client.listModelsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.ai.generativelanguage.v1beta3.Model[] = + []; + stream.on( + 'data', + (response: protos.google.ai.generativelanguage.v1beta3.Model) => { + responses.push(response); + } + ); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert( + (client.descriptors.page.listModels.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.listModels, request) + ); + }); + + it('uses async iteration with listModels without error', async () => { + const client = new modelserviceModule.v1beta3.ModelServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.ai.generativelanguage.v1beta3.ListModelsRequest() + ); + const expectedResponse = [ + generateSampleMessage( + new protos.google.ai.generativelanguage.v1beta3.Model() + ), + generateSampleMessage( + new protos.google.ai.generativelanguage.v1beta3.Model() + ), + generateSampleMessage( + new protos.google.ai.generativelanguage.v1beta3.Model() + ), + ]; + client.descriptors.page.listModels.asyncIterate = + stubAsyncIterationCall(expectedResponse); + const responses: protos.google.ai.generativelanguage.v1beta3.IModel[] = + []; + const iterable = client.listModelsAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + (client.descriptors.page.listModels.asyncIterate as SinonStub).getCall( + 0 + ).args[1], + request + ); + }); + + it('uses async iteration with listModels with error', async () => { + const client = new modelserviceModule.v1beta3.ModelServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.ai.generativelanguage.v1beta3.ListModelsRequest() + ); + const expectedError = new Error('expected'); + client.descriptors.page.listModels.asyncIterate = stubAsyncIterationCall( + undefined, + expectedError + ); + const iterable = client.listModelsAsync(request); + await assert.rejects(async () => { + const responses: protos.google.ai.generativelanguage.v1beta3.IModel[] = + []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + (client.descriptors.page.listModels.asyncIterate as SinonStub).getCall( + 0 + ).args[1], + request + ); + }); + }); + + describe('listTunedModels', () => { + it('invokes listTunedModels without error', async () => { + const client = new modelserviceModule.v1beta3.ModelServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.ai.generativelanguage.v1beta3.ListTunedModelsRequest() + ); + const expectedResponse = [ + generateSampleMessage( + new protos.google.ai.generativelanguage.v1beta3.TunedModel() + ), + generateSampleMessage( + new protos.google.ai.generativelanguage.v1beta3.TunedModel() + ), + generateSampleMessage( + new protos.google.ai.generativelanguage.v1beta3.TunedModel() + ), + ]; + client.innerApiCalls.listTunedModels = stubSimpleCall(expectedResponse); + const [response] = await client.listTunedModels(request); + assert.deepStrictEqual(response, expectedResponse); + }); + + it('invokes listTunedModels without error using callback', async () => { + const client = new modelserviceModule.v1beta3.ModelServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.ai.generativelanguage.v1beta3.ListTunedModelsRequest() + ); + const expectedResponse = [ + generateSampleMessage( + new protos.google.ai.generativelanguage.v1beta3.TunedModel() + ), + generateSampleMessage( + new protos.google.ai.generativelanguage.v1beta3.TunedModel() + ), + generateSampleMessage( + new protos.google.ai.generativelanguage.v1beta3.TunedModel() + ), + ]; + client.innerApiCalls.listTunedModels = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.listTunedModels( + request, + ( + err?: Error | null, + result?: + | protos.google.ai.generativelanguage.v1beta3.ITunedModel[] + | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + }); + + it('invokes listTunedModels with error', async () => { + const client = new modelserviceModule.v1beta3.ModelServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.ai.generativelanguage.v1beta3.ListTunedModelsRequest() + ); + const expectedError = new Error('expected'); + client.innerApiCalls.listTunedModels = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.listTunedModels(request), expectedError); + }); + + it('invokes listTunedModelsStream without error', async () => { + const client = new modelserviceModule.v1beta3.ModelServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.ai.generativelanguage.v1beta3.ListTunedModelsRequest() + ); + const expectedResponse = [ + generateSampleMessage( + new protos.google.ai.generativelanguage.v1beta3.TunedModel() + ), + generateSampleMessage( + new protos.google.ai.generativelanguage.v1beta3.TunedModel() + ), + generateSampleMessage( + new protos.google.ai.generativelanguage.v1beta3.TunedModel() + ), + ]; + client.descriptors.page.listTunedModels.createStream = + stubPageStreamingCall(expectedResponse); + const stream = client.listTunedModelsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.ai.generativelanguage.v1beta3.TunedModel[] = + []; + stream.on( + 'data', + ( + response: protos.google.ai.generativelanguage.v1beta3.TunedModel + ) => { + 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.listTunedModels.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.listTunedModels, request) + ); + }); + + it('invokes listTunedModelsStream with error', async () => { + const client = new modelserviceModule.v1beta3.ModelServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.ai.generativelanguage.v1beta3.ListTunedModelsRequest() + ); + const expectedError = new Error('expected'); + client.descriptors.page.listTunedModels.createStream = + stubPageStreamingCall(undefined, expectedError); + const stream = client.listTunedModelsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.ai.generativelanguage.v1beta3.TunedModel[] = + []; + stream.on( + 'data', + ( + response: protos.google.ai.generativelanguage.v1beta3.TunedModel + ) => { + responses.push(response); + } + ); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert( + (client.descriptors.page.listTunedModels.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.listTunedModels, request) + ); + }); + + it('uses async iteration with listTunedModels without error', async () => { + const client = new modelserviceModule.v1beta3.ModelServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.ai.generativelanguage.v1beta3.ListTunedModelsRequest() + ); + const expectedResponse = [ + generateSampleMessage( + new protos.google.ai.generativelanguage.v1beta3.TunedModel() + ), + generateSampleMessage( + new protos.google.ai.generativelanguage.v1beta3.TunedModel() + ), + generateSampleMessage( + new protos.google.ai.generativelanguage.v1beta3.TunedModel() + ), + ]; + client.descriptors.page.listTunedModels.asyncIterate = + stubAsyncIterationCall(expectedResponse); + const responses: protos.google.ai.generativelanguage.v1beta3.ITunedModel[] = + []; + const iterable = client.listTunedModelsAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + ( + client.descriptors.page.listTunedModels.asyncIterate as SinonStub + ).getCall(0).args[1], + request + ); + }); + + it('uses async iteration with listTunedModels with error', async () => { + const client = new modelserviceModule.v1beta3.ModelServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.ai.generativelanguage.v1beta3.ListTunedModelsRequest() + ); + const expectedError = new Error('expected'); + client.descriptors.page.listTunedModels.asyncIterate = + stubAsyncIterationCall(undefined, expectedError); + const iterable = client.listTunedModelsAsync(request); + await assert.rejects(async () => { + const responses: protos.google.ai.generativelanguage.v1beta3.ITunedModel[] = + []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + ( + client.descriptors.page.listTunedModels.asyncIterate as SinonStub + ).getCall(0).args[1], + request + ); + }); + }); + describe('getOperation', () => { + it('invokes getOperation without error', async () => { + const client = new modelserviceModule.v1beta3.ModelServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + 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 modelserviceModule.v1beta3.ModelServiceClient({ + 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); + } + } + ); + }); + 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 modelserviceModule.v1beta3.ModelServiceClient({ + 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 modelserviceModule.v1beta3.ModelServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + 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 modelserviceModule.v1beta3.ModelServiceClient({ + 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); + } + } + ); + }); + 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 modelserviceModule.v1beta3.ModelServiceClient({ + 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 modelserviceModule.v1beta3.ModelServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + 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 modelserviceModule.v1beta3.ModelServiceClient({ + 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); + } + } + ); + }); + 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 modelserviceModule.v1beta3.ModelServiceClient({ + 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 modelserviceModule.v1beta3.ModelServiceClient({ + 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.ListOperationsResponse[] = + []; + 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 modelserviceModule.v1beta3.ModelServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + 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.ListOperationsResponse[] = + []; + 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('model', () => { + const fakePath = '/rendered/path/model'; + const expectedParameters = { + model: 'modelValue', + }; + const client = new modelserviceModule.v1beta3.ModelServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.modelPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.modelPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('modelPath', () => { + const result = client.modelPath('modelValue'); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.modelPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchModelFromModelName', () => { + const result = client.matchModelFromModelName(fakePath); + assert.strictEqual(result, 'modelValue'); + assert( + (client.pathTemplates.modelPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('permission', () => { + const fakePath = '/rendered/path/permission'; + const expectedParameters = { + tuned_model: 'tunedModelValue', + permission: 'permissionValue', + }; + const client = new modelserviceModule.v1beta3.ModelServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.permissionPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.permissionPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('permissionPath', () => { + const result = client.permissionPath( + 'tunedModelValue', + 'permissionValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.permissionPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchTunedModelFromPermissionName', () => { + const result = client.matchTunedModelFromPermissionName(fakePath); + assert.strictEqual(result, 'tunedModelValue'); + assert( + (client.pathTemplates.permissionPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchPermissionFromPermissionName', () => { + const result = client.matchPermissionFromPermissionName(fakePath); + assert.strictEqual(result, 'permissionValue'); + assert( + (client.pathTemplates.permissionPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('tunedModel', () => { + const fakePath = '/rendered/path/tunedModel'; + const expectedParameters = { + tuned_model: 'tunedModelValue', + }; + const client = new modelserviceModule.v1beta3.ModelServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.tunedModelPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.tunedModelPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('tunedModelPath', () => { + const result = client.tunedModelPath('tunedModelValue'); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.tunedModelPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchTunedModelFromTunedModelName', () => { + const result = client.matchTunedModelFromTunedModelName(fakePath); + assert.strictEqual(result, 'tunedModelValue'); + assert( + (client.pathTemplates.tunedModelPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + }); +}); diff --git a/packages/google-ai-generativelanguage/test/gapic_permission_service_v1beta3.ts b/packages/google-ai-generativelanguage/test/gapic_permission_service_v1beta3.ts new file mode 100644 index 00000000000..80f6b5842b1 --- /dev/null +++ b/packages/google-ai-generativelanguage/test/gapic_permission_service_v1beta3.ts @@ -0,0 +1,1385 @@ +// Copyright 2023 Google LLC +// +// Licensed under the Apache License, Version 2.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 permissionserviceModule 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('v1beta3.PermissionServiceClient', () => { + describe('Common methods', () => { + it('has servicePath', () => { + const servicePath = + permissionserviceModule.v1beta3.PermissionServiceClient.servicePath; + assert(servicePath); + }); + + it('has apiEndpoint', () => { + const apiEndpoint = + permissionserviceModule.v1beta3.PermissionServiceClient.apiEndpoint; + assert(apiEndpoint); + }); + + it('has port', () => { + const port = permissionserviceModule.v1beta3.PermissionServiceClient.port; + assert(port); + assert(typeof port === 'number'); + }); + + it('should create a client with no option', () => { + const client = + new permissionserviceModule.v1beta3.PermissionServiceClient(); + assert(client); + }); + + it('should create a client with gRPC fallback', () => { + const client = + new permissionserviceModule.v1beta3.PermissionServiceClient({ + fallback: true, + }); + assert(client); + }); + + it('has initialize method and supports deferred initialization', async () => { + const client = + new permissionserviceModule.v1beta3.PermissionServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + assert.strictEqual(client.permissionServiceStub, undefined); + await client.initialize(); + assert(client.permissionServiceStub); + }); + + it('has close method for the initialized client', done => { + const client = + new permissionserviceModule.v1beta3.PermissionServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + assert(client.permissionServiceStub); + client.close().then(() => { + done(); + }); + }); + + it('has close method for the non-initialized client', done => { + const client = + new permissionserviceModule.v1beta3.PermissionServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + assert.strictEqual(client.permissionServiceStub, undefined); + client.close().then(() => { + done(); + }); + }); + + it('has getProjectId method', async () => { + const fakeProjectId = 'fake-project-id'; + const client = + new permissionserviceModule.v1beta3.PermissionServiceClient({ + 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 permissionserviceModule.v1beta3.PermissionServiceClient({ + 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('createPermission', () => { + it('invokes createPermission without error', async () => { + const client = + new permissionserviceModule.v1beta3.PermissionServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.ai.generativelanguage.v1beta3.CreatePermissionRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.ai.generativelanguage.v1beta3.CreatePermissionRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.ai.generativelanguage.v1beta3.Permission() + ); + client.innerApiCalls.createPermission = stubSimpleCall(expectedResponse); + const [response] = await client.createPermission(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.createPermission as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createPermission as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createPermission without error using callback', async () => { + const client = + new permissionserviceModule.v1beta3.PermissionServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.ai.generativelanguage.v1beta3.CreatePermissionRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.ai.generativelanguage.v1beta3.CreatePermissionRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.ai.generativelanguage.v1beta3.Permission() + ); + client.innerApiCalls.createPermission = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.createPermission( + request, + ( + err?: Error | null, + result?: protos.google.ai.generativelanguage.v1beta3.IPermission | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.createPermission as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createPermission as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createPermission with error', async () => { + const client = + new permissionserviceModule.v1beta3.PermissionServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.ai.generativelanguage.v1beta3.CreatePermissionRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.ai.generativelanguage.v1beta3.CreatePermissionRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.createPermission = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.createPermission(request), expectedError); + const actualRequest = ( + client.innerApiCalls.createPermission as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createPermission as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createPermission with closed client', async () => { + const client = + new permissionserviceModule.v1beta3.PermissionServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.ai.generativelanguage.v1beta3.CreatePermissionRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.ai.generativelanguage.v1beta3.CreatePermissionRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.createPermission(request), expectedError); + }); + }); + + describe('getPermission', () => { + it('invokes getPermission without error', async () => { + const client = + new permissionserviceModule.v1beta3.PermissionServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.ai.generativelanguage.v1beta3.GetPermissionRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.ai.generativelanguage.v1beta3.GetPermissionRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.ai.generativelanguage.v1beta3.Permission() + ); + client.innerApiCalls.getPermission = stubSimpleCall(expectedResponse); + const [response] = await client.getPermission(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.getPermission as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getPermission as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getPermission without error using callback', async () => { + const client = + new permissionserviceModule.v1beta3.PermissionServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.ai.generativelanguage.v1beta3.GetPermissionRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.ai.generativelanguage.v1beta3.GetPermissionRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.ai.generativelanguage.v1beta3.Permission() + ); + client.innerApiCalls.getPermission = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getPermission( + request, + ( + err?: Error | null, + result?: protos.google.ai.generativelanguage.v1beta3.IPermission | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.getPermission as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getPermission as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getPermission with error', async () => { + const client = + new permissionserviceModule.v1beta3.PermissionServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.ai.generativelanguage.v1beta3.GetPermissionRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.ai.generativelanguage.v1beta3.GetPermissionRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.getPermission = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.getPermission(request), expectedError); + const actualRequest = ( + client.innerApiCalls.getPermission as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getPermission as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getPermission with closed client', async () => { + const client = + new permissionserviceModule.v1beta3.PermissionServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.ai.generativelanguage.v1beta3.GetPermissionRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.ai.generativelanguage.v1beta3.GetPermissionRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.getPermission(request), expectedError); + }); + }); + + describe('updatePermission', () => { + it('invokes updatePermission without error', async () => { + const client = + new permissionserviceModule.v1beta3.PermissionServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.ai.generativelanguage.v1beta3.UpdatePermissionRequest() + ); + request.permission ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.ai.generativelanguage.v1beta3.UpdatePermissionRequest', + ['permission', 'name'] + ); + request.permission.name = defaultValue1; + const expectedHeaderRequestParams = `permission.name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.ai.generativelanguage.v1beta3.Permission() + ); + client.innerApiCalls.updatePermission = stubSimpleCall(expectedResponse); + const [response] = await client.updatePermission(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.updatePermission as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updatePermission as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updatePermission without error using callback', async () => { + const client = + new permissionserviceModule.v1beta3.PermissionServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.ai.generativelanguage.v1beta3.UpdatePermissionRequest() + ); + request.permission ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.ai.generativelanguage.v1beta3.UpdatePermissionRequest', + ['permission', 'name'] + ); + request.permission.name = defaultValue1; + const expectedHeaderRequestParams = `permission.name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.ai.generativelanguage.v1beta3.Permission() + ); + client.innerApiCalls.updatePermission = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.updatePermission( + request, + ( + err?: Error | null, + result?: protos.google.ai.generativelanguage.v1beta3.IPermission | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.updatePermission as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updatePermission as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updatePermission with error', async () => { + const client = + new permissionserviceModule.v1beta3.PermissionServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.ai.generativelanguage.v1beta3.UpdatePermissionRequest() + ); + request.permission ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.ai.generativelanguage.v1beta3.UpdatePermissionRequest', + ['permission', 'name'] + ); + request.permission.name = defaultValue1; + const expectedHeaderRequestParams = `permission.name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.updatePermission = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.updatePermission(request), expectedError); + const actualRequest = ( + client.innerApiCalls.updatePermission as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updatePermission as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updatePermission with closed client', async () => { + const client = + new permissionserviceModule.v1beta3.PermissionServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.ai.generativelanguage.v1beta3.UpdatePermissionRequest() + ); + request.permission ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.ai.generativelanguage.v1beta3.UpdatePermissionRequest', + ['permission', 'name'] + ); + request.permission.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.updatePermission(request), expectedError); + }); + }); + + describe('deletePermission', () => { + it('invokes deletePermission without error', async () => { + const client = + new permissionserviceModule.v1beta3.PermissionServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.ai.generativelanguage.v1beta3.DeletePermissionRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.ai.generativelanguage.v1beta3.DeletePermissionRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.innerApiCalls.deletePermission = stubSimpleCall(expectedResponse); + const [response] = await client.deletePermission(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.deletePermission as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deletePermission as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deletePermission without error using callback', async () => { + const client = + new permissionserviceModule.v1beta3.PermissionServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.ai.generativelanguage.v1beta3.DeletePermissionRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.ai.generativelanguage.v1beta3.DeletePermissionRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.innerApiCalls.deletePermission = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.deletePermission( + 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.deletePermission as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deletePermission as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deletePermission with error', async () => { + const client = + new permissionserviceModule.v1beta3.PermissionServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.ai.generativelanguage.v1beta3.DeletePermissionRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.ai.generativelanguage.v1beta3.DeletePermissionRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.deletePermission = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.deletePermission(request), expectedError); + const actualRequest = ( + client.innerApiCalls.deletePermission as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deletePermission as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deletePermission with closed client', async () => { + const client = + new permissionserviceModule.v1beta3.PermissionServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.ai.generativelanguage.v1beta3.DeletePermissionRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.ai.generativelanguage.v1beta3.DeletePermissionRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.deletePermission(request), expectedError); + }); + }); + + describe('transferOwnership', () => { + it('invokes transferOwnership without error', async () => { + const client = + new permissionserviceModule.v1beta3.PermissionServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.ai.generativelanguage.v1beta3.TransferOwnershipRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.ai.generativelanguage.v1beta3.TransferOwnershipRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.ai.generativelanguage.v1beta3.TransferOwnershipResponse() + ); + client.innerApiCalls.transferOwnership = stubSimpleCall(expectedResponse); + const [response] = await client.transferOwnership(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.transferOwnership as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.transferOwnership as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes transferOwnership without error using callback', async () => { + const client = + new permissionserviceModule.v1beta3.PermissionServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.ai.generativelanguage.v1beta3.TransferOwnershipRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.ai.generativelanguage.v1beta3.TransferOwnershipRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.ai.generativelanguage.v1beta3.TransferOwnershipResponse() + ); + client.innerApiCalls.transferOwnership = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.transferOwnership( + request, + ( + err?: Error | null, + result?: protos.google.ai.generativelanguage.v1beta3.ITransferOwnershipResponse | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.transferOwnership as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.transferOwnership as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes transferOwnership with error', async () => { + const client = + new permissionserviceModule.v1beta3.PermissionServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.ai.generativelanguage.v1beta3.TransferOwnershipRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.ai.generativelanguage.v1beta3.TransferOwnershipRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.transferOwnership = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.transferOwnership(request), expectedError); + const actualRequest = ( + client.innerApiCalls.transferOwnership as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.transferOwnership as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes transferOwnership with closed client', async () => { + const client = + new permissionserviceModule.v1beta3.PermissionServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.ai.generativelanguage.v1beta3.TransferOwnershipRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.ai.generativelanguage.v1beta3.TransferOwnershipRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.transferOwnership(request), expectedError); + }); + }); + + describe('listPermissions', () => { + it('invokes listPermissions without error', async () => { + const client = + new permissionserviceModule.v1beta3.PermissionServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.ai.generativelanguage.v1beta3.ListPermissionsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.ai.generativelanguage.v1beta3.ListPermissionsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.ai.generativelanguage.v1beta3.Permission() + ), + generateSampleMessage( + new protos.google.ai.generativelanguage.v1beta3.Permission() + ), + generateSampleMessage( + new protos.google.ai.generativelanguage.v1beta3.Permission() + ), + ]; + client.innerApiCalls.listPermissions = stubSimpleCall(expectedResponse); + const [response] = await client.listPermissions(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.listPermissions as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listPermissions as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listPermissions without error using callback', async () => { + const client = + new permissionserviceModule.v1beta3.PermissionServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.ai.generativelanguage.v1beta3.ListPermissionsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.ai.generativelanguage.v1beta3.ListPermissionsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.ai.generativelanguage.v1beta3.Permission() + ), + generateSampleMessage( + new protos.google.ai.generativelanguage.v1beta3.Permission() + ), + generateSampleMessage( + new protos.google.ai.generativelanguage.v1beta3.Permission() + ), + ]; + client.innerApiCalls.listPermissions = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.listPermissions( + request, + ( + err?: Error | null, + result?: + | protos.google.ai.generativelanguage.v1beta3.IPermission[] + | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.listPermissions as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listPermissions as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listPermissions with error', async () => { + const client = + new permissionserviceModule.v1beta3.PermissionServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.ai.generativelanguage.v1beta3.ListPermissionsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.ai.generativelanguage.v1beta3.ListPermissionsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.listPermissions = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.listPermissions(request), expectedError); + const actualRequest = ( + client.innerApiCalls.listPermissions as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listPermissions as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listPermissionsStream without error', async () => { + const client = + new permissionserviceModule.v1beta3.PermissionServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.ai.generativelanguage.v1beta3.ListPermissionsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.ai.generativelanguage.v1beta3.ListPermissionsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.ai.generativelanguage.v1beta3.Permission() + ), + generateSampleMessage( + new protos.google.ai.generativelanguage.v1beta3.Permission() + ), + generateSampleMessage( + new protos.google.ai.generativelanguage.v1beta3.Permission() + ), + ]; + client.descriptors.page.listPermissions.createStream = + stubPageStreamingCall(expectedResponse); + const stream = client.listPermissionsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.ai.generativelanguage.v1beta3.Permission[] = + []; + stream.on( + 'data', + ( + response: protos.google.ai.generativelanguage.v1beta3.Permission + ) => { + 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.listPermissions.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.listPermissions, request) + ); + assert( + (client.descriptors.page.listPermissions.createStream as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('invokes listPermissionsStream with error', async () => { + const client = + new permissionserviceModule.v1beta3.PermissionServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.ai.generativelanguage.v1beta3.ListPermissionsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.ai.generativelanguage.v1beta3.ListPermissionsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.descriptors.page.listPermissions.createStream = + stubPageStreamingCall(undefined, expectedError); + const stream = client.listPermissionsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.ai.generativelanguage.v1beta3.Permission[] = + []; + stream.on( + 'data', + ( + response: protos.google.ai.generativelanguage.v1beta3.Permission + ) => { + responses.push(response); + } + ); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert( + (client.descriptors.page.listPermissions.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.listPermissions, request) + ); + assert( + (client.descriptors.page.listPermissions.createStream as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listPermissions without error', async () => { + const client = + new permissionserviceModule.v1beta3.PermissionServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.ai.generativelanguage.v1beta3.ListPermissionsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.ai.generativelanguage.v1beta3.ListPermissionsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.ai.generativelanguage.v1beta3.Permission() + ), + generateSampleMessage( + new protos.google.ai.generativelanguage.v1beta3.Permission() + ), + generateSampleMessage( + new protos.google.ai.generativelanguage.v1beta3.Permission() + ), + ]; + client.descriptors.page.listPermissions.asyncIterate = + stubAsyncIterationCall(expectedResponse); + const responses: protos.google.ai.generativelanguage.v1beta3.IPermission[] = + []; + const iterable = client.listPermissionsAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + ( + client.descriptors.page.listPermissions.asyncIterate as SinonStub + ).getCall(0).args[1], + request + ); + assert( + (client.descriptors.page.listPermissions.asyncIterate as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listPermissions with error', async () => { + const client = + new permissionserviceModule.v1beta3.PermissionServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.ai.generativelanguage.v1beta3.ListPermissionsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.ai.generativelanguage.v1beta3.ListPermissionsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.descriptors.page.listPermissions.asyncIterate = + stubAsyncIterationCall(undefined, expectedError); + const iterable = client.listPermissionsAsync(request); + await assert.rejects(async () => { + const responses: protos.google.ai.generativelanguage.v1beta3.IPermission[] = + []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + ( + client.descriptors.page.listPermissions.asyncIterate as SinonStub + ).getCall(0).args[1], + request + ); + assert( + (client.descriptors.page.listPermissions.asyncIterate as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + }); + + describe('Path templates', () => { + describe('model', () => { + const fakePath = '/rendered/path/model'; + const expectedParameters = { + model: 'modelValue', + }; + const client = + new permissionserviceModule.v1beta3.PermissionServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.modelPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.modelPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('modelPath', () => { + const result = client.modelPath('modelValue'); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.modelPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchModelFromModelName', () => { + const result = client.matchModelFromModelName(fakePath); + assert.strictEqual(result, 'modelValue'); + assert( + (client.pathTemplates.modelPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('permission', () => { + const fakePath = '/rendered/path/permission'; + const expectedParameters = { + tuned_model: 'tunedModelValue', + permission: 'permissionValue', + }; + const client = + new permissionserviceModule.v1beta3.PermissionServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.permissionPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.permissionPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('permissionPath', () => { + const result = client.permissionPath( + 'tunedModelValue', + 'permissionValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.permissionPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchTunedModelFromPermissionName', () => { + const result = client.matchTunedModelFromPermissionName(fakePath); + assert.strictEqual(result, 'tunedModelValue'); + assert( + (client.pathTemplates.permissionPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchPermissionFromPermissionName', () => { + const result = client.matchPermissionFromPermissionName(fakePath); + assert.strictEqual(result, 'permissionValue'); + assert( + (client.pathTemplates.permissionPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('tunedModel', () => { + const fakePath = '/rendered/path/tunedModel'; + const expectedParameters = { + tuned_model: 'tunedModelValue', + }; + const client = + new permissionserviceModule.v1beta3.PermissionServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.tunedModelPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.tunedModelPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('tunedModelPath', () => { + const result = client.tunedModelPath('tunedModelValue'); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.tunedModelPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchTunedModelFromTunedModelName', () => { + const result = client.matchTunedModelFromTunedModelName(fakePath); + assert.strictEqual(result, 'tunedModelValue'); + assert( + (client.pathTemplates.tunedModelPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + }); +}); diff --git a/packages/google-ai-generativelanguage/test/gapic_text_service_v1beta3.ts b/packages/google-ai-generativelanguage/test/gapic_text_service_v1beta3.ts new file mode 100644 index 00000000000..b3c2d164da4 --- /dev/null +++ b/packages/google-ai-generativelanguage/test/gapic_text_service_v1beta3.ts @@ -0,0 +1,813 @@ +// Copyright 2023 Google LLC +// +// Licensed under the Apache License, Version 2.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 textserviceModule from '../src'; + +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); +} + +describe('v1beta3.TextServiceClient', () => { + describe('Common methods', () => { + it('has servicePath', () => { + const servicePath = + textserviceModule.v1beta3.TextServiceClient.servicePath; + assert(servicePath); + }); + + it('has apiEndpoint', () => { + const apiEndpoint = + textserviceModule.v1beta3.TextServiceClient.apiEndpoint; + assert(apiEndpoint); + }); + + it('has port', () => { + const port = textserviceModule.v1beta3.TextServiceClient.port; + assert(port); + assert(typeof port === 'number'); + }); + + it('should create a client with no option', () => { + const client = new textserviceModule.v1beta3.TextServiceClient(); + assert(client); + }); + + it('should create a client with gRPC fallback', () => { + const client = new textserviceModule.v1beta3.TextServiceClient({ + fallback: true, + }); + assert(client); + }); + + it('has initialize method and supports deferred initialization', async () => { + const client = new textserviceModule.v1beta3.TextServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + assert.strictEqual(client.textServiceStub, undefined); + await client.initialize(); + assert(client.textServiceStub); + }); + + it('has close method for the initialized client', done => { + const client = new textserviceModule.v1beta3.TextServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + assert(client.textServiceStub); + client.close().then(() => { + done(); + }); + }); + + it('has close method for the non-initialized client', done => { + const client = new textserviceModule.v1beta3.TextServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + assert.strictEqual(client.textServiceStub, undefined); + client.close().then(() => { + done(); + }); + }); + + it('has getProjectId method', async () => { + const fakeProjectId = 'fake-project-id'; + const client = new textserviceModule.v1beta3.TextServiceClient({ + 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 textserviceModule.v1beta3.TextServiceClient({ + 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('generateText', () => { + it('invokes generateText without error', async () => { + const client = new textserviceModule.v1beta3.TextServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.ai.generativelanguage.v1beta3.GenerateTextRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.ai.generativelanguage.v1beta3.GenerateTextRequest', + ['model'] + ); + request.model = defaultValue1; + const expectedHeaderRequestParams = `model=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.ai.generativelanguage.v1beta3.GenerateTextResponse() + ); + client.innerApiCalls.generateText = stubSimpleCall(expectedResponse); + const [response] = await client.generateText(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.generateText as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.generateText as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes generateText without error using callback', async () => { + const client = new textserviceModule.v1beta3.TextServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.ai.generativelanguage.v1beta3.GenerateTextRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.ai.generativelanguage.v1beta3.GenerateTextRequest', + ['model'] + ); + request.model = defaultValue1; + const expectedHeaderRequestParams = `model=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.ai.generativelanguage.v1beta3.GenerateTextResponse() + ); + client.innerApiCalls.generateText = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.generateText( + request, + ( + err?: Error | null, + result?: protos.google.ai.generativelanguage.v1beta3.IGenerateTextResponse | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.generateText as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.generateText as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes generateText with error', async () => { + const client = new textserviceModule.v1beta3.TextServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.ai.generativelanguage.v1beta3.GenerateTextRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.ai.generativelanguage.v1beta3.GenerateTextRequest', + ['model'] + ); + request.model = defaultValue1; + const expectedHeaderRequestParams = `model=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.generateText = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.generateText(request), expectedError); + const actualRequest = ( + client.innerApiCalls.generateText as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.generateText as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes generateText with closed client', async () => { + const client = new textserviceModule.v1beta3.TextServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.ai.generativelanguage.v1beta3.GenerateTextRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.ai.generativelanguage.v1beta3.GenerateTextRequest', + ['model'] + ); + request.model = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.generateText(request), expectedError); + }); + }); + + describe('embedText', () => { + it('invokes embedText without error', async () => { + const client = new textserviceModule.v1beta3.TextServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.ai.generativelanguage.v1beta3.EmbedTextRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.ai.generativelanguage.v1beta3.EmbedTextRequest', + ['model'] + ); + request.model = defaultValue1; + const expectedHeaderRequestParams = `model=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.ai.generativelanguage.v1beta3.EmbedTextResponse() + ); + client.innerApiCalls.embedText = stubSimpleCall(expectedResponse); + const [response] = await client.embedText(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.embedText as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.embedText as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes embedText without error using callback', async () => { + const client = new textserviceModule.v1beta3.TextServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.ai.generativelanguage.v1beta3.EmbedTextRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.ai.generativelanguage.v1beta3.EmbedTextRequest', + ['model'] + ); + request.model = defaultValue1; + const expectedHeaderRequestParams = `model=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.ai.generativelanguage.v1beta3.EmbedTextResponse() + ); + client.innerApiCalls.embedText = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.embedText( + request, + ( + err?: Error | null, + result?: protos.google.ai.generativelanguage.v1beta3.IEmbedTextResponse | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.embedText as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.embedText as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes embedText with error', async () => { + const client = new textserviceModule.v1beta3.TextServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.ai.generativelanguage.v1beta3.EmbedTextRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.ai.generativelanguage.v1beta3.EmbedTextRequest', + ['model'] + ); + request.model = defaultValue1; + const expectedHeaderRequestParams = `model=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.embedText = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.embedText(request), expectedError); + const actualRequest = ( + client.innerApiCalls.embedText as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.embedText as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes embedText with closed client', async () => { + const client = new textserviceModule.v1beta3.TextServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.ai.generativelanguage.v1beta3.EmbedTextRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.ai.generativelanguage.v1beta3.EmbedTextRequest', + ['model'] + ); + request.model = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.embedText(request), expectedError); + }); + }); + + describe('batchEmbedText', () => { + it('invokes batchEmbedText without error', async () => { + const client = new textserviceModule.v1beta3.TextServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.ai.generativelanguage.v1beta3.BatchEmbedTextRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.ai.generativelanguage.v1beta3.BatchEmbedTextRequest', + ['model'] + ); + request.model = defaultValue1; + const expectedHeaderRequestParams = `model=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.ai.generativelanguage.v1beta3.BatchEmbedTextResponse() + ); + client.innerApiCalls.batchEmbedText = stubSimpleCall(expectedResponse); + const [response] = await client.batchEmbedText(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.batchEmbedText as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.batchEmbedText as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes batchEmbedText without error using callback', async () => { + const client = new textserviceModule.v1beta3.TextServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.ai.generativelanguage.v1beta3.BatchEmbedTextRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.ai.generativelanguage.v1beta3.BatchEmbedTextRequest', + ['model'] + ); + request.model = defaultValue1; + const expectedHeaderRequestParams = `model=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.ai.generativelanguage.v1beta3.BatchEmbedTextResponse() + ); + client.innerApiCalls.batchEmbedText = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.batchEmbedText( + request, + ( + err?: Error | null, + result?: protos.google.ai.generativelanguage.v1beta3.IBatchEmbedTextResponse | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.batchEmbedText as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.batchEmbedText as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes batchEmbedText with error', async () => { + const client = new textserviceModule.v1beta3.TextServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.ai.generativelanguage.v1beta3.BatchEmbedTextRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.ai.generativelanguage.v1beta3.BatchEmbedTextRequest', + ['model'] + ); + request.model = defaultValue1; + const expectedHeaderRequestParams = `model=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.batchEmbedText = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.batchEmbedText(request), expectedError); + const actualRequest = ( + client.innerApiCalls.batchEmbedText as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.batchEmbedText as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes batchEmbedText with closed client', async () => { + const client = new textserviceModule.v1beta3.TextServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.ai.generativelanguage.v1beta3.BatchEmbedTextRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.ai.generativelanguage.v1beta3.BatchEmbedTextRequest', + ['model'] + ); + request.model = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.batchEmbedText(request), expectedError); + }); + }); + + describe('countTextTokens', () => { + it('invokes countTextTokens without error', async () => { + const client = new textserviceModule.v1beta3.TextServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.ai.generativelanguage.v1beta3.CountTextTokensRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.ai.generativelanguage.v1beta3.CountTextTokensRequest', + ['model'] + ); + request.model = defaultValue1; + const expectedHeaderRequestParams = `model=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.ai.generativelanguage.v1beta3.CountTextTokensResponse() + ); + client.innerApiCalls.countTextTokens = stubSimpleCall(expectedResponse); + const [response] = await client.countTextTokens(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.countTextTokens as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.countTextTokens as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes countTextTokens without error using callback', async () => { + const client = new textserviceModule.v1beta3.TextServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.ai.generativelanguage.v1beta3.CountTextTokensRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.ai.generativelanguage.v1beta3.CountTextTokensRequest', + ['model'] + ); + request.model = defaultValue1; + const expectedHeaderRequestParams = `model=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.ai.generativelanguage.v1beta3.CountTextTokensResponse() + ); + client.innerApiCalls.countTextTokens = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.countTextTokens( + request, + ( + err?: Error | null, + result?: protos.google.ai.generativelanguage.v1beta3.ICountTextTokensResponse | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.countTextTokens as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.countTextTokens as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes countTextTokens with error', async () => { + const client = new textserviceModule.v1beta3.TextServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.ai.generativelanguage.v1beta3.CountTextTokensRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.ai.generativelanguage.v1beta3.CountTextTokensRequest', + ['model'] + ); + request.model = defaultValue1; + const expectedHeaderRequestParams = `model=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.countTextTokens = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.countTextTokens(request), expectedError); + const actualRequest = ( + client.innerApiCalls.countTextTokens as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.countTextTokens as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes countTextTokens with closed client', async () => { + const client = new textserviceModule.v1beta3.TextServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.ai.generativelanguage.v1beta3.CountTextTokensRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.ai.generativelanguage.v1beta3.CountTextTokensRequest', + ['model'] + ); + request.model = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.countTextTokens(request), expectedError); + }); + }); + + describe('Path templates', () => { + describe('model', () => { + const fakePath = '/rendered/path/model'; + const expectedParameters = { + model: 'modelValue', + }; + const client = new textserviceModule.v1beta3.TextServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.modelPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.modelPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('modelPath', () => { + const result = client.modelPath('modelValue'); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.modelPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchModelFromModelName', () => { + const result = client.matchModelFromModelName(fakePath); + assert.strictEqual(result, 'modelValue'); + assert( + (client.pathTemplates.modelPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('permission', () => { + const fakePath = '/rendered/path/permission'; + const expectedParameters = { + tuned_model: 'tunedModelValue', + permission: 'permissionValue', + }; + const client = new textserviceModule.v1beta3.TextServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.permissionPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.permissionPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('permissionPath', () => { + const result = client.permissionPath( + 'tunedModelValue', + 'permissionValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.permissionPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchTunedModelFromPermissionName', () => { + const result = client.matchTunedModelFromPermissionName(fakePath); + assert.strictEqual(result, 'tunedModelValue'); + assert( + (client.pathTemplates.permissionPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchPermissionFromPermissionName', () => { + const result = client.matchPermissionFromPermissionName(fakePath); + assert.strictEqual(result, 'permissionValue'); + assert( + (client.pathTemplates.permissionPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('tunedModel', () => { + const fakePath = '/rendered/path/tunedModel'; + const expectedParameters = { + tuned_model: 'tunedModelValue', + }; + const client = new textserviceModule.v1beta3.TextServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.tunedModelPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.tunedModelPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('tunedModelPath', () => { + const result = client.tunedModelPath('tunedModelValue'); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.tunedModelPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchTunedModelFromTunedModelName', () => { + const result = client.matchTunedModelFromTunedModelName(fakePath); + assert.strictEqual(result, 'tunedModelValue'); + assert( + (client.pathTemplates.tunedModelPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + }); +}); diff --git a/packages/google-api-apikeys/protos/google/api/apikeys/v2/apikeys.proto b/packages/google-api-apikeys/protos/google/api/apikeys/v2/apikeys.proto index e29636d12d1..132a03a4552 100644 --- a/packages/google-api-apikeys/protos/google/api/apikeys/v2/apikeys.proto +++ b/packages/google-api-apikeys/protos/google/api/apikeys/v2/apikeys.proto @@ -1,4 +1,4 @@ -// Copyright 2022 Google LLC +// Copyright 2023 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -22,6 +22,7 @@ import "google/api/client.proto"; import "google/api/field_behavior.proto"; import "google/api/resource.proto"; import "google/longrunning/operations.proto"; +import "google/protobuf/empty.proto"; import "google/protobuf/field_mask.proto"; option csharp_namespace = "Google.Cloud.ApiKeys.V2"; diff --git a/packages/google-api-apikeys/protos/google/api/apikeys/v2/resources.proto b/packages/google-api-apikeys/protos/google/api/apikeys/v2/resources.proto index a13d0863c20..a4f39c7aed7 100644 --- a/packages/google-api-apikeys/protos/google/api/apikeys/v2/resources.proto +++ b/packages/google-api-apikeys/protos/google/api/apikeys/v2/resources.proto @@ -1,4 +1,4 @@ -// Copyright 2022 Google LLC +// Copyright 2023 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -61,15 +61,18 @@ message Key { // Output only. A timestamp identifying the time this key was originally // created. - google.protobuf.Timestamp create_time = 4 [(google.api.field_behavior) = OUTPUT_ONLY]; + google.protobuf.Timestamp create_time = 4 + [(google.api.field_behavior) = OUTPUT_ONLY]; // Output only. A timestamp identifying the time this key was last // updated. - google.protobuf.Timestamp update_time = 6 [(google.api.field_behavior) = OUTPUT_ONLY]; + google.protobuf.Timestamp update_time = 6 + [(google.api.field_behavior) = OUTPUT_ONLY]; - // Output only. A timestamp when this key was deleted. If the resource is not deleted, - // this must be empty. - google.protobuf.Timestamp delete_time = 7 [(google.api.field_behavior) = OUTPUT_ONLY]; + // Output only. A timestamp when this key was deleted. If the resource is not + // deleted, this must be empty. + google.protobuf.Timestamp delete_time = 7 + [(google.api.field_behavior) = OUTPUT_ONLY]; // Annotations is an unstructured key-value map stored with a policy that // may be set by external tools to store and retrieve arbitrary metadata. @@ -79,10 +82,10 @@ message Key { // Key restrictions. Restrictions restrictions = 9; - // Output only. A checksum computed by the server based on the current value of the Key - // resource. This may be sent on update and delete requests to ensure the - // client has an up-to-date value before proceeding. - // See https://google.aip.dev/154. + // Output only. A checksum computed by the server based on the current value + // of the Key resource. This may be sent on update and delete requests to + // ensure the client has an up-to-date value before proceeding. See + // https://google.aip.dev/154. string etag = 11 [(google.api.field_behavior) = OUTPUT_ONLY]; } diff --git a/packages/google-api-serviceusage/CHANGELOG.md b/packages/google-api-serviceusage/CHANGELOG.md index 59cbaccd27b..67abf047840 100644 --- a/packages/google-api-serviceusage/CHANGELOG.md +++ b/packages/google-api-serviceusage/CHANGELOG.md @@ -1,5 +1,12 @@ # Changelog +## [3.1.0](https://github.com/googleapis/google-cloud-node/compare/service-usage-v3.0.1...service-usage-v3.1.0) (2023-09-19) + + +### Features + +* [serviceusage] introduce resource class serviceusage.googleapis.com/Service ([#4669](https://github.com/googleapis/google-cloud-node/issues/4669)) ([4e7f9ef](https://github.com/googleapis/google-cloud-node/commit/4e7f9efde9d5dd76e785a736063948247eede501)) + ## [3.0.1](https://github.com/googleapis/google-cloud-node/compare/service-usage-v3.0.0...service-usage-v3.0.1) (2023-09-06) diff --git a/packages/google-api-serviceusage/package.json b/packages/google-api-serviceusage/package.json index d2b3a72c94b..97d2feaf2a4 100644 --- a/packages/google-api-serviceusage/package.json +++ b/packages/google-api-serviceusage/package.json @@ -1,6 +1,6 @@ { "name": "@google-cloud/service-usage", - "version": "3.0.1", + "version": "3.1.0", "description": "Serviceusage client for Node.js", "repository": { "type": "git", diff --git a/packages/google-api-serviceusage/protos/google/api/serviceusage/v1/resources.proto b/packages/google-api-serviceusage/protos/google/api/serviceusage/v1/resources.proto index a2165a89c4c..e7c54052ebc 100644 --- a/packages/google-api-serviceusage/protos/google/api/serviceusage/v1/resources.proto +++ b/packages/google-api-serviceusage/protos/google/api/serviceusage/v1/resources.proto @@ -1,4 +1,4 @@ -// Copyright 2021 Google LLC +// Copyright 2023 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -22,6 +22,7 @@ import "google/api/endpoint.proto"; import "google/api/monitored_resource.proto"; import "google/api/monitoring.proto"; import "google/api/quota.proto"; +import "google/api/resource.proto"; import "google/api/usage.proto"; import "google/protobuf/api.proto"; @@ -35,6 +36,13 @@ option ruby_package = "Google::Cloud::ServiceUsage::V1"; // A service that is available for use by the consumer. message Service { + option (google.api.resource) = { + type: "serviceusage.googleapis.com/Service" + pattern: "projects/{project}/services/{service}" + pattern: "folders/{folder}/services/{service}" + pattern: "organizations/{organization}/services/{service}" + }; + // The resource name of the consumer and service. // // A valid name would be: @@ -105,7 +113,8 @@ message ServiceConfig { repeated google.api.Endpoint endpoints = 18; // Defines the monitored resources used by this service. This is required - // by the [Service.monitoring][google.api.Service.monitoring] and [Service.logging][google.api.Service.logging] configurations. + // by the [Service.monitoring][google.api.Service.monitoring] and + // [Service.logging][google.api.Service.logging] configurations. repeated google.api.MonitoredResourceDescriptor monitored_resources = 25; // Monitoring configuration. diff --git a/packages/google-api-serviceusage/protos/google/api/serviceusage/v1/serviceusage.proto b/packages/google-api-serviceusage/protos/google/api/serviceusage/v1/serviceusage.proto index 7a24f96039a..d6a079ef112 100644 --- a/packages/google-api-serviceusage/protos/google/api/serviceusage/v1/serviceusage.proto +++ b/packages/google-api-serviceusage/protos/google/api/serviceusage/v1/serviceusage.proto @@ -1,4 +1,4 @@ -// Copyright 2021 Google LLC +// Copyright 2023 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -17,9 +17,9 @@ syntax = "proto3"; package google.api.serviceusage.v1; import "google/api/annotations.proto"; +import "google/api/client.proto"; import "google/api/serviceusage/v1/resources.proto"; import "google/longrunning/operations.proto"; -import "google/api/client.proto"; option csharp_namespace = "Google.Cloud.ServiceUsage.V1"; option go_package = "cloud.google.com/go/serviceusage/apiv1/serviceusagepb;serviceusagepb"; @@ -42,7 +42,8 @@ service ServiceUsage { "https://www.googleapis.com/auth/service.management"; // Enable a service so that it can be used with a project. - rpc EnableService(EnableServiceRequest) returns (google.longrunning.Operation) { + rpc EnableService(EnableServiceRequest) + returns (google.longrunning.Operation) { option (google.api.http) = { post: "/v1/{name=*/*/services/*}:enable" body: "*" @@ -60,7 +61,8 @@ service ServiceUsage { // It is not valid to call the disable method on a service that is not // currently enabled. Callers will receive a `FAILED_PRECONDITION` status if // the target service is not currently enabled. - rpc DisableService(DisableServiceRequest) returns (google.longrunning.Operation) { + rpc DisableService(DisableServiceRequest) + returns (google.longrunning.Operation) { option (google.api.http) = { post: "/v1/{name=*/*/services/*}:disable" body: "*" @@ -100,7 +102,8 @@ service ServiceUsage { // Enable multiple services on a project. The operation is atomic: if enabling // any service fails, then the entire batch fails, and no state changes occur. // To enable a single service, use the `EnableService` method instead. - rpc BatchEnableServices(BatchEnableServicesRequest) returns (google.longrunning.Operation) { + rpc BatchEnableServices(BatchEnableServicesRequest) + returns (google.longrunning.Operation) { option (google.api.http) = { post: "/v1/{parent=*/*}/services:batchEnable" body: "*" @@ -113,7 +116,8 @@ service ServiceUsage { // Returns the service configurations and enabled states for a given list of // services. - rpc BatchGetServices(BatchGetServicesRequest) returns (BatchGetServicesResponse) { + rpc BatchGetServices(BatchGetServicesRequest) + returns (BatchGetServicesResponse) { option (google.api.http) = { get: "/v1/{parent=*/*}/services:batchGet" }; diff --git a/packages/google-api-serviceusage/protos/google/api/serviceusage/v1beta1/resources.proto b/packages/google-api-serviceusage/protos/google/api/serviceusage/v1beta1/resources.proto index a68437c3c40..74116587aa7 100644 --- a/packages/google-api-serviceusage/protos/google/api/serviceusage/v1beta1/resources.proto +++ b/packages/google-api-serviceusage/protos/google/api/serviceusage/v1beta1/resources.proto @@ -1,4 +1,4 @@ -// Copyright 2021 Google LLC +// Copyright 2023 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -105,7 +105,8 @@ message ServiceConfig { repeated google.api.Endpoint endpoints = 18; // Defines the monitored resources used by this service. This is required - // by the [Service.monitoring][google.api.Service.monitoring] and [Service.logging][google.api.Service.logging] configurations. + // by the [Service.monitoring][google.api.Service.monitoring] and + // [Service.logging][google.api.Service.logging] configurations. repeated google.api.MonitoredResourceDescriptor monitored_resources = 25; // Monitoring configuration. @@ -196,6 +197,10 @@ message ConsumerQuotaLimit { // ordered from least specific to most specific (for example, the global // default bucket, with no quota dimensions, will always appear first). repeated QuotaBucket quota_buckets = 9; + + // List of all supported locations. + // This field is present only if the limit has a {region} or {zone} dimension. + repeated string supported_locations = 11; } // Selected view of quota. Can be used to request more detailed quota @@ -236,6 +241,9 @@ message QuotaBucket { // Admin override on this quota bucket. QuotaOverride admin_override = 5; + // Producer policy inherited from the closet ancestor of the current consumer. + ProducerQuotaPolicy producer_quota_policy = 7; + // The dimensions of this quota bucket. // // If this map is empty, this is the global bucket, which is the default quota @@ -334,6 +342,62 @@ enum QuotaSafetyCheck { LIMIT_DECREASE_PERCENTAGE_TOO_HIGH = 2; } +// Quota policy created by service producer. +message ProducerQuotaPolicy { + // The resource name of the policy. + // This name is generated by the server when the policy is created. + // + // Example names would be: + // `organizations/123/services/compute.googleapis.com/consumerQuotaMetrics/compute.googleapis.com%2Fcpus/limits/%2Fproject%2Fregion/producerQuotaPolicies/4a3f2c1d` + string name = 1; + + // The quota policy value. + // Can be any nonnegative integer, or -1 (unlimited quota). + int64 policy_value = 2; + + // + // If this map is nonempty, then this policy applies only to specific values + // for dimensions defined in the limit unit. + // + // For example, a policy on a limit with the unit `1/{project}/{region}` + // could contain an entry with the key `region` and the value `us-east-1`; + // the policy is only applied to quota consumed in that region. + // + // This map has the following restrictions: + // + // * Keys that are not defined in the limit's unit are not valid keys. + // Any string appearing in {brackets} in the unit (besides {project} or + // {user}) is a defined key. + // * `project` is not a valid key; the project is already specified in + // the parent resource name. + // * `user` is not a valid key; the API does not support quota policies + // that apply only to a specific user. + // * If `region` appears as a key, its value must be a valid Cloud region. + // * If `zone` appears as a key, its value must be a valid Cloud zone. + // * If any valid key other than `region` or `zone` appears in the map, then + // all valid keys other than `region` or `zone` must also appear in the + // map. + map dimensions = 3; + + // The name of the metric to which this policy applies. + // + // An example name would be: + // `compute.googleapis.com/cpus` + string metric = 4; + + // The limit unit of the limit to which this policy applies. + // + // An example unit would be: + // `1/{project}/{region}` + // Note that `{project}` and `{region}` are not placeholders in this example; + // the literal characters `{` and `}` occur in the string. + string unit = 5; + + // The cloud resource container at which the quota policy is created. The + // format is `{container_type}/{container_number}` + string container = 6; +} + // Quota policy created by quota administrator. message AdminQuotaPolicy { // The resource name of the policy. @@ -351,7 +415,7 @@ message AdminQuotaPolicy { // If this map is nonempty, then this policy applies only to specific values // for dimensions defined in the limit unit. // - // For example, an policy on a limit with the unit `1/{project}/{region}` + // For example, a policy on a limit with the unit `1/{project}/{region}` // could contain an entry with the key `region` and the value `us-east-1`; // the policy is only applied to quota consumed in that region. // diff --git a/packages/google-api-serviceusage/protos/google/api/serviceusage/v1beta1/serviceusage.proto b/packages/google-api-serviceusage/protos/google/api/serviceusage/v1beta1/serviceusage.proto index 2051224882d..5db546509fe 100644 --- a/packages/google-api-serviceusage/protos/google/api/serviceusage/v1beta1/serviceusage.proto +++ b/packages/google-api-serviceusage/protos/google/api/serviceusage/v1beta1/serviceusage.proto @@ -1,4 +1,4 @@ -// Copyright 2021 Google LLC +// Copyright 2023 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -18,8 +18,10 @@ package google.api.serviceusage.v1beta1; import "google/api/annotations.proto"; import "google/api/client.proto"; +import "google/api/field_behavior.proto"; import "google/api/serviceusage/v1beta1/resources.proto"; import "google/longrunning/operations.proto"; +import "google/protobuf/empty.proto"; import "google/protobuf/field_mask.proto"; option csharp_namespace = "Google.Api.ServiceUsage.V1Beta1"; @@ -41,7 +43,8 @@ service ServiceUsage { // Enables a service so that it can be used with a project. // // Operation response type: `google.protobuf.Empty` - rpc EnableService(EnableServiceRequest) returns (google.longrunning.Operation) { + rpc EnableService(EnableServiceRequest) + returns (google.longrunning.Operation) { option deprecated = true; option (google.api.http) = { post: "/v1beta1/{name=*/*/services/*}:enable" @@ -62,7 +65,8 @@ service ServiceUsage { // the target service is not currently enabled. // // Operation response type: `google.protobuf.Empty` - rpc DisableService(DisableServiceRequest) returns (google.longrunning.Operation) { + rpc DisableService(DisableServiceRequest) + returns (google.longrunning.Operation) { option deprecated = true; option (google.api.http) = { post: "/v1beta1/{name=*/*/services/*}:disable" @@ -101,7 +105,8 @@ service ServiceUsage { // changes occur. // // Operation response type: `google.protobuf.Empty` - rpc BatchEnableServices(BatchEnableServicesRequest) returns (google.longrunning.Operation) { + rpc BatchEnableServices(BatchEnableServicesRequest) + returns (google.longrunning.Operation) { option deprecated = true; option (google.api.http) = { post: "/v1beta1/{parent=*/*}/services:batchEnable" @@ -118,21 +123,24 @@ service ServiceUsage { // about all of its defined limits. Each limit includes the limit // configuration (quota unit, preciseness, default value), the current // effective limit value, and all of the overrides applied to the limit. - rpc ListConsumerQuotaMetrics(ListConsumerQuotaMetricsRequest) returns (ListConsumerQuotaMetricsResponse) { + rpc ListConsumerQuotaMetrics(ListConsumerQuotaMetricsRequest) + returns (ListConsumerQuotaMetricsResponse) { option (google.api.http) = { get: "/v1beta1/{parent=*/*/services/*}/consumerQuotaMetrics" }; } // Retrieves a summary of quota information for a specific quota metric - rpc GetConsumerQuotaMetric(GetConsumerQuotaMetricRequest) returns (ConsumerQuotaMetric) { + rpc GetConsumerQuotaMetric(GetConsumerQuotaMetricRequest) + returns (ConsumerQuotaMetric) { option (google.api.http) = { get: "/v1beta1/{name=*/*/services/*/consumerQuotaMetrics/*}" }; } // Retrieves a summary of quota information for a specific quota limit. - rpc GetConsumerQuotaLimit(GetConsumerQuotaLimitRequest) returns (ConsumerQuotaLimit) { + rpc GetConsumerQuotaLimit(GetConsumerQuotaLimitRequest) + returns (ConsumerQuotaLimit) { option (google.api.http) = { get: "/v1beta1/{name=*/*/services/*/consumerQuotaMetrics/*/limits/*}" }; @@ -144,7 +152,8 @@ service ServiceUsage { // override is intended to limit the amount of quota the consumer can use out // of the total quota pool allocated to all children of the folder or // organization. - rpc CreateAdminOverride(CreateAdminOverrideRequest) returns (google.longrunning.Operation) { + rpc CreateAdminOverride(CreateAdminOverrideRequest) + returns (google.longrunning.Operation) { option (google.api.http) = { post: "/v1beta1/{parent=*/*/services/*/consumerQuotaMetrics/*/limits/*}/adminOverrides" body: "override" @@ -156,7 +165,8 @@ service ServiceUsage { } // Updates an admin override. - rpc UpdateAdminOverride(UpdateAdminOverrideRequest) returns (google.longrunning.Operation) { + rpc UpdateAdminOverride(UpdateAdminOverrideRequest) + returns (google.longrunning.Operation) { option (google.api.http) = { patch: "/v1beta1/{name=*/*/services/*/consumerQuotaMetrics/*/limits/*/adminOverrides/*}" body: "override" @@ -168,7 +178,8 @@ service ServiceUsage { } // Deletes an admin override. - rpc DeleteAdminOverride(DeleteAdminOverrideRequest) returns (google.longrunning.Operation) { + rpc DeleteAdminOverride(DeleteAdminOverrideRequest) + returns (google.longrunning.Operation) { option (google.api.http) = { delete: "/v1beta1/{name=*/*/services/*/consumerQuotaMetrics/*/limits/*/adminOverrides/*}" }; @@ -179,7 +190,8 @@ service ServiceUsage { } // Lists all admin overrides on this limit. - rpc ListAdminOverrides(ListAdminOverridesRequest) returns (ListAdminOverridesResponse) { + rpc ListAdminOverrides(ListAdminOverridesRequest) + returns (ListAdminOverridesResponse) { option (google.api.http) = { get: "/v1beta1/{parent=*/*/services/*/consumerQuotaMetrics/*/limits/*}/adminOverrides" }; @@ -188,7 +200,8 @@ service ServiceUsage { // Creates or updates multiple admin overrides atomically, all on the // same consumer, but on many different metrics or limits. // The name field in the quota override message should not be set. - rpc ImportAdminOverrides(ImportAdminOverridesRequest) returns (google.longrunning.Operation) { + rpc ImportAdminOverrides(ImportAdminOverridesRequest) + returns (google.longrunning.Operation) { option (google.api.http) = { post: "/v1beta1/{parent=*/*/services/*}/consumerQuotaMetrics:importAdminOverrides" body: "*" @@ -204,7 +217,8 @@ service ServiceUsage { // limit its own quota usage. Consumer overrides cannot be used to grant more // quota than would be allowed by admin overrides, producer overrides, or the // default limit of the service. - rpc CreateConsumerOverride(CreateConsumerOverrideRequest) returns (google.longrunning.Operation) { + rpc CreateConsumerOverride(CreateConsumerOverrideRequest) + returns (google.longrunning.Operation) { option (google.api.http) = { post: "/v1beta1/{parent=*/*/services/*/consumerQuotaMetrics/*/limits/*}/consumerOverrides" body: "override" @@ -216,7 +230,8 @@ service ServiceUsage { } // Updates a consumer override. - rpc UpdateConsumerOverride(UpdateConsumerOverrideRequest) returns (google.longrunning.Operation) { + rpc UpdateConsumerOverride(UpdateConsumerOverrideRequest) + returns (google.longrunning.Operation) { option (google.api.http) = { patch: "/v1beta1/{name=*/*/services/*/consumerQuotaMetrics/*/limits/*/consumerOverrides/*}" body: "override" @@ -228,7 +243,8 @@ service ServiceUsage { } // Deletes a consumer override. - rpc DeleteConsumerOverride(DeleteConsumerOverrideRequest) returns (google.longrunning.Operation) { + rpc DeleteConsumerOverride(DeleteConsumerOverrideRequest) + returns (google.longrunning.Operation) { option (google.api.http) = { delete: "/v1beta1/{name=*/*/services/*/consumerQuotaMetrics/*/limits/*/consumerOverrides/*}" }; @@ -239,7 +255,8 @@ service ServiceUsage { } // Lists all consumer overrides on this limit. - rpc ListConsumerOverrides(ListConsumerOverridesRequest) returns (ListConsumerOverridesResponse) { + rpc ListConsumerOverrides(ListConsumerOverridesRequest) + returns (ListConsumerOverridesResponse) { option (google.api.http) = { get: "/v1beta1/{parent=*/*/services/*/consumerQuotaMetrics/*/limits/*}/consumerOverrides" }; @@ -248,7 +265,8 @@ service ServiceUsage { // Creates or updates multiple consumer overrides atomically, all on the // same consumer, but on many different metrics or limits. // The name field in the quota override message should not be set. - rpc ImportConsumerOverrides(ImportConsumerOverridesRequest) returns (google.longrunning.Operation) { + rpc ImportConsumerOverrides(ImportConsumerOverridesRequest) + returns (google.longrunning.Operation) { option (google.api.http) = { post: "/v1beta1/{parent=*/*/services/*}/consumerQuotaMetrics:importConsumerOverrides" body: "*" @@ -260,7 +278,8 @@ service ServiceUsage { } // Generates service identity for service. - rpc GenerateServiceIdentity(GenerateServiceIdentityRequest) returns (google.longrunning.Operation) { + rpc GenerateServiceIdentity(GenerateServiceIdentityRequest) + returns (google.longrunning.Operation) { option (google.api.http) = { post: "/v1beta1/{parent=*/*/services/*}:generateServiceIdentity" }; @@ -565,9 +584,7 @@ message ImportAdminOverridesResponse { // Metadata message that provides information such as progress, // partial failures, and similar information on each GetOperation call // of LRO returned by ImportAdminOverrides. -message ImportAdminOverridesMetadata { - -} +message ImportAdminOverridesMetadata {} // Request message for CreateConsumerOverride. message CreateConsumerOverrideRequest { @@ -709,9 +726,7 @@ message ImportConsumerOverridesResponse { // Metadata message that provides information such as progress, // partial failures, and similar information on each GetOperation call // of LRO returned by ImportConsumerOverrides. -message ImportConsumerOverridesMetadata { - -} +message ImportConsumerOverridesMetadata {} // Response message for ImportAdminQuotaPolicies message ImportAdminQuotaPoliciesResponse { @@ -722,40 +737,34 @@ message ImportAdminQuotaPoliciesResponse { // Metadata message that provides information such as progress, // partial failures, and similar information on each GetOperation call // of LRO returned by ImportAdminQuotaPolicies. -message ImportAdminQuotaPoliciesMetadata { - -} +message ImportAdminQuotaPoliciesMetadata {} // Metadata message that provides information such as progress, // partial failures, and similar information on each GetOperation call // of LRO returned by CreateAdminQuotaPolicy. -message CreateAdminQuotaPolicyMetadata { - -} +message CreateAdminQuotaPolicyMetadata {} // Metadata message that provides information such as progress, // partial failures, and similar information on each GetOperation call // of LRO returned by UpdateAdminQuotaPolicy. -message UpdateAdminQuotaPolicyMetadata { - -} +message UpdateAdminQuotaPolicyMetadata {} // Metadata message that provides information such as progress, // partial failures, and similar information on each GetOperation call // of LRO returned by DeleteAdminQuotaPolicy. -message DeleteAdminQuotaPolicyMetadata { - -} +message DeleteAdminQuotaPolicyMetadata {} // Request message for generating service identity. message GenerateServiceIdentityRequest { // Name of the consumer and service to generate an identity for. // - // The `GenerateServiceIdentity` methods currently only support projects. + // The `GenerateServiceIdentity` methods currently support projects, folders, + // organizations. // - // An example name would be: - // `projects/123/services/example.googleapis.com` where `123` is the - // project number. + // Example parents would be: + // `projects/123/services/example.googleapis.com` + // `folders/123/services/example.googleapis.com` + // `organizations/123/services/example.googleapis.com` string parent = 1; } @@ -781,6 +790,4 @@ message GetServiceIdentityResponse { } // Metadata for the `GetServiceIdentity` method. -message GetServiceIdentityMetadata { - -} +message GetServiceIdentityMetadata {} diff --git a/packages/google-api-serviceusage/protos/protos.d.ts b/packages/google-api-serviceusage/protos/protos.d.ts index d40c7cc3e35..4ef63f2aedb 100644 --- a/packages/google-api-serviceusage/protos/protos.d.ts +++ b/packages/google-api-serviceusage/protos/protos.d.ts @@ -349,4609 +349,4621 @@ export namespace google { public static getTypeUrl(typeUrlPrefix?: string): string; } - /** Properties of an Api. */ - interface IApi { - - /** Api name */ - name?: (string|null); - - /** Api methods */ - methods?: (google.protobuf.IMethod[]|null); - - /** Api options */ - options?: (google.protobuf.IOption[]|null); - - /** Api version */ - version?: (string|null); - - /** Api sourceContext */ - sourceContext?: (google.protobuf.ISourceContext|null); - - /** Api mixins */ - mixins?: (google.protobuf.IMixin[]|null); + /** Properties of a FileDescriptorSet. */ + interface IFileDescriptorSet { - /** Api syntax */ - syntax?: (google.protobuf.Syntax|keyof typeof google.protobuf.Syntax|null); + /** FileDescriptorSet file */ + file?: (google.protobuf.IFileDescriptorProto[]|null); } - /** Represents an Api. */ - class Api implements IApi { + /** Represents a FileDescriptorSet. */ + class FileDescriptorSet implements IFileDescriptorSet { /** - * Constructs a new Api. + * Constructs a new FileDescriptorSet. * @param [properties] Properties to set */ - constructor(properties?: google.protobuf.IApi); - - /** Api name. */ - public name: string; - - /** Api methods. */ - public methods: google.protobuf.IMethod[]; - - /** Api options. */ - public options: google.protobuf.IOption[]; - - /** Api version. */ - public version: string; - - /** Api sourceContext. */ - public sourceContext?: (google.protobuf.ISourceContext|null); - - /** Api mixins. */ - public mixins: google.protobuf.IMixin[]; + constructor(properties?: google.protobuf.IFileDescriptorSet); - /** Api syntax. */ - public syntax: (google.protobuf.Syntax|keyof typeof google.protobuf.Syntax); + /** FileDescriptorSet file. */ + public file: google.protobuf.IFileDescriptorProto[]; /** - * Creates a new Api instance using the specified properties. + * Creates a new FileDescriptorSet instance using the specified properties. * @param [properties] Properties to set - * @returns Api instance + * @returns FileDescriptorSet instance */ - public static create(properties?: google.protobuf.IApi): google.protobuf.Api; + public static create(properties?: google.protobuf.IFileDescriptorSet): google.protobuf.FileDescriptorSet; /** - * Encodes the specified Api message. Does not implicitly {@link google.protobuf.Api.verify|verify} messages. - * @param message Api message or plain object to encode + * 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.IApi, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.protobuf.IFileDescriptorSet, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified Api message, length delimited. Does not implicitly {@link google.protobuf.Api.verify|verify} messages. - * @param message Api message or plain object to encode + * 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.IApi, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.protobuf.IFileDescriptorSet, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes an Api message from the specified reader or buffer. + * 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 Api + * @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.Api; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.FileDescriptorSet; /** - * Decodes an Api message from the specified reader or buffer, length delimited. + * Decodes a FileDescriptorSet message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns Api + * @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.Api; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.FileDescriptorSet; /** - * Verifies an Api message. + * 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 an Api message from a plain object. Also converts values to their respective internal types. + * Creates a FileDescriptorSet message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns Api + * @returns FileDescriptorSet */ - public static fromObject(object: { [k: string]: any }): google.protobuf.Api; + public static fromObject(object: { [k: string]: any }): google.protobuf.FileDescriptorSet; /** - * Creates a plain object from an Api message. Also converts values to other types if specified. - * @param message Api + * 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.Api, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.protobuf.FileDescriptorSet, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this Api to JSON. + * Converts this FileDescriptorSet to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; /** - * Gets the default type url for Api + * 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; } - /** Properties of a Method. */ - interface IMethod { + /** Properties of a FileDescriptorProto. */ + interface IFileDescriptorProto { - /** Method name */ + /** FileDescriptorProto name */ name?: (string|null); - /** Method requestTypeUrl */ - requestTypeUrl?: (string|null); + /** FileDescriptorProto package */ + "package"?: (string|null); - /** Method requestStreaming */ - requestStreaming?: (boolean|null); + /** FileDescriptorProto dependency */ + dependency?: (string[]|null); - /** Method responseTypeUrl */ - responseTypeUrl?: (string|null); + /** FileDescriptorProto publicDependency */ + publicDependency?: (number[]|null); - /** Method responseStreaming */ - responseStreaming?: (boolean|null); + /** FileDescriptorProto weakDependency */ + weakDependency?: (number[]|null); - /** Method options */ - options?: (google.protobuf.IOption[]|null); + /** FileDescriptorProto messageType */ + messageType?: (google.protobuf.IDescriptorProto[]|null); - /** Method syntax */ - syntax?: (google.protobuf.Syntax|keyof typeof google.protobuf.Syntax|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?: (string|null); } - /** Represents a Method. */ - class Method implements IMethod { + /** Represents a FileDescriptorProto. */ + class FileDescriptorProto implements IFileDescriptorProto { /** - * Constructs a new Method. + * Constructs a new FileDescriptorProto. * @param [properties] Properties to set */ - constructor(properties?: google.protobuf.IMethod); + constructor(properties?: google.protobuf.IFileDescriptorProto); - /** Method name. */ + /** FileDescriptorProto name. */ public name: string; - /** Method requestTypeUrl. */ - public requestTypeUrl: string; + /** FileDescriptorProto package. */ + public package: string; - /** Method requestStreaming. */ - public requestStreaming: boolean; + /** FileDescriptorProto dependency. */ + public dependency: string[]; - /** Method responseTypeUrl. */ - public responseTypeUrl: string; + /** FileDescriptorProto publicDependency. */ + public publicDependency: number[]; - /** Method responseStreaming. */ - public responseStreaming: boolean; + /** FileDescriptorProto weakDependency. */ + public weakDependency: number[]; - /** Method options. */ - public options: google.protobuf.IOption[]; + /** FileDescriptorProto messageType. */ + public messageType: google.protobuf.IDescriptorProto[]; - /** Method syntax. */ - public syntax: (google.protobuf.Syntax|keyof typeof google.protobuf.Syntax); + /** 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: string; /** - * Creates a new Method instance using the specified properties. + * Creates a new FileDescriptorProto instance using the specified properties. * @param [properties] Properties to set - * @returns Method instance + * @returns FileDescriptorProto instance */ - public static create(properties?: google.protobuf.IMethod): google.protobuf.Method; + public static create(properties?: google.protobuf.IFileDescriptorProto): google.protobuf.FileDescriptorProto; /** - * Encodes the specified Method message. Does not implicitly {@link google.protobuf.Method.verify|verify} messages. - * @param message Method message or plain object to encode + * 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.IMethod, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.protobuf.IFileDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified Method message, length delimited. Does not implicitly {@link google.protobuf.Method.verify|verify} messages. - * @param message Method message or plain object to encode + * 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.IMethod, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.protobuf.IFileDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a Method message from the specified reader or buffer. + * 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 Method + * @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.Method; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.FileDescriptorProto; /** - * Decodes a Method message from the specified reader or buffer, length delimited. + * Decodes a FileDescriptorProto message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns Method + * @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.Method; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.FileDescriptorProto; /** - * Verifies a Method message. + * 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 Method message from a plain object. Also converts values to their respective internal types. + * Creates a FileDescriptorProto message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns Method + * @returns FileDescriptorProto */ - public static fromObject(object: { [k: string]: any }): google.protobuf.Method; + public static fromObject(object: { [k: string]: any }): google.protobuf.FileDescriptorProto; /** - * Creates a plain object from a Method message. Also converts values to other types if specified. - * @param message Method + * 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.Method, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.protobuf.FileDescriptorProto, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this Method to JSON. + * Converts this FileDescriptorProto to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; /** - * Gets the default type url for Method + * 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 Mixin. */ - interface IMixin { + /** Properties of a DescriptorProto. */ + interface IDescriptorProto { - /** Mixin name */ + /** DescriptorProto name */ name?: (string|null); - /** Mixin root */ - root?: (string|null); - } + /** DescriptorProto field */ + field?: (google.protobuf.IFieldDescriptorProto[]|null); - /** Represents a Mixin. */ - class Mixin implements IMixin { + /** DescriptorProto extension */ + extension?: (google.protobuf.IFieldDescriptorProto[]|null); - /** - * Constructs a new Mixin. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.IMixin); + /** DescriptorProto nestedType */ + nestedType?: (google.protobuf.IDescriptorProto[]|null); - /** Mixin name. */ - public name: string; + /** DescriptorProto enumType */ + enumType?: (google.protobuf.IEnumDescriptorProto[]|null); - /** Mixin root. */ - public root: string; + /** DescriptorProto extensionRange */ + extensionRange?: (google.protobuf.DescriptorProto.IExtensionRange[]|null); - /** - * Creates a new Mixin instance using the specified properties. - * @param [properties] Properties to set - * @returns Mixin instance - */ - public static create(properties?: google.protobuf.IMixin): google.protobuf.Mixin; + /** DescriptorProto oneofDecl */ + oneofDecl?: (google.protobuf.IOneofDescriptorProto[]|null); - /** - * Encodes the specified Mixin message. Does not implicitly {@link google.protobuf.Mixin.verify|verify} messages. - * @param message Mixin message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.protobuf.IMixin, writer?: $protobuf.Writer): $protobuf.Writer; + /** DescriptorProto options */ + options?: (google.protobuf.IMessageOptions|null); - /** - * Encodes the specified Mixin message, length delimited. Does not implicitly {@link google.protobuf.Mixin.verify|verify} messages. - * @param message Mixin message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.protobuf.IMixin, writer?: $protobuf.Writer): $protobuf.Writer; + /** DescriptorProto reservedRange */ + reservedRange?: (google.protobuf.DescriptorProto.IReservedRange[]|null); - /** - * Decodes a Mixin message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns Mixin - * @throws {Error} If the payload is not 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.Mixin; + /** DescriptorProto reservedName */ + reservedName?: (string[]|null); + } - /** - * Decodes a Mixin message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns Mixin - * @throws {Error} If the payload 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.Mixin; + /** Represents a DescriptorProto. */ + class DescriptorProto implements IDescriptorProto { /** - * Verifies a Mixin message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not + * Constructs a new DescriptorProto. + * @param [properties] Properties to set */ - public static verify(message: { [k: string]: any }): (string|null); + constructor(properties?: google.protobuf.IDescriptorProto); - /** - * Creates a Mixin message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns Mixin - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.Mixin; + /** DescriptorProto name. */ + public name: string; - /** - * Creates a plain object from a Mixin message. Also converts values to other types if specified. - * @param message Mixin - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.Mixin, options?: $protobuf.IConversionOptions): { [k: string]: any }; + /** DescriptorProto field. */ + public field: google.protobuf.IFieldDescriptorProto[]; - /** - * Converts this Mixin to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; + /** DescriptorProto extension. */ + public extension: google.protobuf.IFieldDescriptorProto[]; - /** - * Gets the default type url for Mixin - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } + /** DescriptorProto nestedType. */ + public nestedType: google.protobuf.IDescriptorProto[]; - /** Properties of a SourceContext. */ - interface ISourceContext { + /** DescriptorProto enumType. */ + public enumType: google.protobuf.IEnumDescriptorProto[]; - /** SourceContext fileName */ - fileName?: (string|null); - } + /** DescriptorProto extensionRange. */ + public extensionRange: google.protobuf.DescriptorProto.IExtensionRange[]; - /** Represents a SourceContext. */ - class SourceContext implements ISourceContext { + /** DescriptorProto oneofDecl. */ + public oneofDecl: google.protobuf.IOneofDescriptorProto[]; - /** - * Constructs a new SourceContext. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.ISourceContext); + /** DescriptorProto options. */ + public options?: (google.protobuf.IMessageOptions|null); - /** SourceContext fileName. */ - public fileName: string; + /** DescriptorProto reservedRange. */ + public reservedRange: google.protobuf.DescriptorProto.IReservedRange[]; + + /** DescriptorProto reservedName. */ + public reservedName: string[]; /** - * Creates a new SourceContext instance using the specified properties. + * Creates a new DescriptorProto instance using the specified properties. * @param [properties] Properties to set - * @returns SourceContext instance + * @returns DescriptorProto instance */ - public static create(properties?: google.protobuf.ISourceContext): google.protobuf.SourceContext; + public static create(properties?: google.protobuf.IDescriptorProto): google.protobuf.DescriptorProto; /** - * Encodes the specified SourceContext message. Does not implicitly {@link google.protobuf.SourceContext.verify|verify} messages. - * @param message SourceContext message or plain object to encode + * 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.ISourceContext, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.protobuf.IDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified SourceContext message, length delimited. Does not implicitly {@link google.protobuf.SourceContext.verify|verify} messages. - * @param message SourceContext message or plain object to encode + * 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.ISourceContext, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.protobuf.IDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a SourceContext message from the specified reader or buffer. + * 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 SourceContext + * @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.SourceContext; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.DescriptorProto; /** - * Decodes a SourceContext message from the specified reader or buffer, length delimited. + * Decodes a DescriptorProto message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns SourceContext + * @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.SourceContext; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.DescriptorProto; /** - * Verifies a SourceContext message. + * 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 SourceContext message from a plain object. Also converts values to their respective internal types. + * Creates a DescriptorProto message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns SourceContext + * @returns DescriptorProto */ - public static fromObject(object: { [k: string]: any }): google.protobuf.SourceContext; + public static fromObject(object: { [k: string]: any }): google.protobuf.DescriptorProto; /** - * Creates a plain object from a SourceContext message. Also converts values to other types if specified. - * @param message SourceContext + * 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.SourceContext, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.protobuf.DescriptorProto, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this SourceContext to JSON. + * Converts this DescriptorProto to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; /** - * Gets the default type url for SourceContext + * 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; } - /** Properties of a Type. */ - interface IType { - - /** Type name */ - name?: (string|null); + namespace DescriptorProto { - /** Type fields */ - fields?: (google.protobuf.IField[]|null); + /** Properties of an ExtensionRange. */ + interface IExtensionRange { - /** Type oneofs */ - oneofs?: (string[]|null); + /** ExtensionRange start */ + start?: (number|null); - /** Type options */ - options?: (google.protobuf.IOption[]|null); + /** ExtensionRange end */ + end?: (number|null); - /** Type sourceContext */ - sourceContext?: (google.protobuf.ISourceContext|null); + /** ExtensionRange options */ + options?: (google.protobuf.IExtensionRangeOptions|null); + } - /** Type syntax */ - syntax?: (google.protobuf.Syntax|keyof typeof google.protobuf.Syntax|null); - } + /** Represents an ExtensionRange. */ + class ExtensionRange implements IExtensionRange { - /** Represents a Type. */ - class Type implements IType { + /** + * Constructs a new ExtensionRange. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.DescriptorProto.IExtensionRange); - /** - * Constructs a new Type. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.IType); + /** ExtensionRange start. */ + public start: number; - /** Type name. */ - public name: string; + /** ExtensionRange end. */ + public end: number; - /** Type fields. */ - public fields: google.protobuf.IField[]; + /** ExtensionRange options. */ + public options?: (google.protobuf.IExtensionRangeOptions|null); - /** Type oneofs. */ - public oneofs: string[]; + /** + * 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; - /** Type options. */ - public options: google.protobuf.IOption[]; + /** + * 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; - /** Type sourceContext. */ - public sourceContext?: (google.protobuf.ISourceContext|null); - - /** Type syntax. */ - public syntax: (google.protobuf.Syntax|keyof typeof google.protobuf.Syntax); - - /** - * Creates a new Type instance using the specified properties. - * @param [properties] Properties to set - * @returns Type instance - */ - public static create(properties?: google.protobuf.IType): google.protobuf.Type; - - /** - * Encodes the specified Type message. Does not implicitly {@link google.protobuf.Type.verify|verify} messages. - * @param message Type message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.protobuf.IType, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified Type message, length delimited. Does not implicitly {@link google.protobuf.Type.verify|verify} messages. - * @param message Type message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.protobuf.IType, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a Type message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns Type - * @throws {Error} If the payload is not 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.Type; - - /** - * Decodes a Type message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns Type - * @throws {Error} If the payload 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.Type; - - /** - * Verifies a Type message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a Type message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns Type - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.Type; - - /** - * Creates a plain object from a Type message. Also converts values to other types if specified. - * @param message Type - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.Type, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this Type to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for Type - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a Field. */ - interface IField { - - /** Field kind */ - kind?: (google.protobuf.Field.Kind|keyof typeof google.protobuf.Field.Kind|null); - - /** Field cardinality */ - cardinality?: (google.protobuf.Field.Cardinality|keyof typeof google.protobuf.Field.Cardinality|null); - - /** Field number */ - number?: (number|null); - - /** Field name */ - name?: (string|null); - - /** Field typeUrl */ - typeUrl?: (string|null); - - /** Field oneofIndex */ - oneofIndex?: (number|null); - - /** Field packed */ - packed?: (boolean|null); - - /** Field options */ - options?: (google.protobuf.IOption[]|null); - - /** Field jsonName */ - jsonName?: (string|null); - - /** Field defaultValue */ - defaultValue?: (string|null); - } - - /** Represents a Field. */ - class Field implements IField { + /** + * 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; - /** - * Constructs a new Field. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.IField); + /** + * 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; - /** Field kind. */ - public kind: (google.protobuf.Field.Kind|keyof typeof google.protobuf.Field.Kind); + /** + * 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; - /** Field cardinality. */ - public cardinality: (google.protobuf.Field.Cardinality|keyof typeof google.protobuf.Field.Cardinality); + /** + * 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); - /** Field number. */ - public number: number; + /** + * 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; - /** Field name. */ - public name: string; + /** + * 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 }; - /** Field typeUrl. */ - public typeUrl: string; + /** + * Converts this ExtensionRange to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; - /** Field oneofIndex. */ - public oneofIndex: number; + /** + * 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; + } - /** Field packed. */ - public packed: boolean; + /** Properties of a ReservedRange. */ + interface IReservedRange { - /** Field options. */ - public options: google.protobuf.IOption[]; + /** ReservedRange start */ + start?: (number|null); - /** Field jsonName. */ - public jsonName: string; + /** ReservedRange end */ + end?: (number|null); + } - /** Field defaultValue. */ - public defaultValue: string; + /** Represents a ReservedRange. */ + class ReservedRange implements IReservedRange { - /** - * Creates a new Field instance using the specified properties. - * @param [properties] Properties to set - * @returns Field instance - */ - public static create(properties?: google.protobuf.IField): google.protobuf.Field; + /** + * Constructs a new ReservedRange. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.DescriptorProto.IReservedRange); - /** - * Encodes the specified Field message. Does not implicitly {@link google.protobuf.Field.verify|verify} messages. - * @param message Field message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.protobuf.IField, writer?: $protobuf.Writer): $protobuf.Writer; + /** ReservedRange start. */ + public start: number; - /** - * Encodes the specified Field message, length delimited. Does not implicitly {@link google.protobuf.Field.verify|verify} messages. - * @param message Field message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.protobuf.IField, writer?: $protobuf.Writer): $protobuf.Writer; + /** ReservedRange end. */ + public end: number; - /** - * Decodes a Field message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns Field - * @throws {Error} If the payload is not 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.Field; + /** + * 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; - /** - * Decodes a Field message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns Field - * @throws {Error} If the payload 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.Field; + /** + * 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; - /** - * Verifies a Field message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); + /** + * 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; - /** - * Creates a Field message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns Field - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.Field; + /** + * 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; - /** - * Creates a plain object from a Field message. Also converts values to other types if specified. - * @param message Field - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.Field, options?: $protobuf.IConversionOptions): { [k: string]: any }; + /** + * 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; - /** - * Converts this Field to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; + /** + * 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); - /** - * Gets the default type url for Field - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } + /** + * 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; - namespace Field { + /** + * 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 }; - /** Kind enum. */ - enum Kind { - TYPE_UNKNOWN = 0, - 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 - } + /** + * Converts this ReservedRange to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; - /** Cardinality enum. */ - enum Cardinality { - CARDINALITY_UNKNOWN = 0, - CARDINALITY_OPTIONAL = 1, - CARDINALITY_REQUIRED = 2, - CARDINALITY_REPEATED = 3 + /** + * 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 Enum. */ - interface IEnum { - - /** Enum name */ - name?: (string|null); - - /** Enum enumvalue */ - enumvalue?: (google.protobuf.IEnumValue[]|null); - - /** Enum options */ - options?: (google.protobuf.IOption[]|null); - - /** Enum sourceContext */ - sourceContext?: (google.protobuf.ISourceContext|null); + /** Properties of an ExtensionRangeOptions. */ + interface IExtensionRangeOptions { - /** Enum syntax */ - syntax?: (google.protobuf.Syntax|keyof typeof google.protobuf.Syntax|null); + /** ExtensionRangeOptions uninterpretedOption */ + uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); } - /** Represents an Enum. */ - class Enum implements IEnum { + /** Represents an ExtensionRangeOptions. */ + class ExtensionRangeOptions implements IExtensionRangeOptions { /** - * Constructs a new Enum. + * Constructs a new ExtensionRangeOptions. * @param [properties] Properties to set */ - constructor(properties?: google.protobuf.IEnum); - - /** Enum name. */ - public name: string; - - /** Enum enumvalue. */ - public enumvalue: google.protobuf.IEnumValue[]; - - /** Enum options. */ - public options: google.protobuf.IOption[]; - - /** Enum sourceContext. */ - public sourceContext?: (google.protobuf.ISourceContext|null); + constructor(properties?: google.protobuf.IExtensionRangeOptions); - /** Enum syntax. */ - public syntax: (google.protobuf.Syntax|keyof typeof google.protobuf.Syntax); + /** ExtensionRangeOptions uninterpretedOption. */ + public uninterpretedOption: google.protobuf.IUninterpretedOption[]; /** - * Creates a new Enum instance using the specified properties. + * Creates a new ExtensionRangeOptions instance using the specified properties. * @param [properties] Properties to set - * @returns Enum instance + * @returns ExtensionRangeOptions instance */ - public static create(properties?: google.protobuf.IEnum): google.protobuf.Enum; + public static create(properties?: google.protobuf.IExtensionRangeOptions): google.protobuf.ExtensionRangeOptions; /** - * Encodes the specified Enum message. Does not implicitly {@link google.protobuf.Enum.verify|verify} messages. - * @param message Enum message or plain object to encode + * 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.IEnum, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.protobuf.IExtensionRangeOptions, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified Enum message, length delimited. Does not implicitly {@link google.protobuf.Enum.verify|verify} messages. - * @param message Enum message or plain object to encode + * 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.IEnum, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.protobuf.IExtensionRangeOptions, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes an Enum message from the specified reader or buffer. + * 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 Enum + * @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.Enum; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.ExtensionRangeOptions; /** - * Decodes an Enum message from the specified reader or buffer, length delimited. + * Decodes an ExtensionRangeOptions message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns Enum + * @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.Enum; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.ExtensionRangeOptions; /** - * Verifies an Enum message. + * 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 Enum message from a plain object. Also converts values to their respective internal types. + * Creates an ExtensionRangeOptions message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns Enum + * @returns ExtensionRangeOptions */ - public static fromObject(object: { [k: string]: any }): google.protobuf.Enum; + public static fromObject(object: { [k: string]: any }): google.protobuf.ExtensionRangeOptions; /** - * Creates a plain object from an Enum message. Also converts values to other types if specified. - * @param message Enum + * 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.Enum, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.protobuf.ExtensionRangeOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this Enum to JSON. + * Converts this ExtensionRangeOptions to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; /** - * Gets the default type url for Enum + * 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; } - /** Properties of an EnumValue. */ - interface IEnumValue { + /** Properties of a FieldDescriptorProto. */ + interface IFieldDescriptorProto { - /** EnumValue name */ + /** FieldDescriptorProto name */ name?: (string|null); - /** EnumValue number */ + /** FieldDescriptorProto number */ number?: (number|null); - /** EnumValue options */ - options?: (google.protobuf.IOption[]|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 an EnumValue. */ - class EnumValue implements IEnumValue { + /** Represents a FieldDescriptorProto. */ + class FieldDescriptorProto implements IFieldDescriptorProto { /** - * Constructs a new EnumValue. + * Constructs a new FieldDescriptorProto. * @param [properties] Properties to set */ - constructor(properties?: google.protobuf.IEnumValue); + constructor(properties?: google.protobuf.IFieldDescriptorProto); - /** EnumValue name. */ + /** FieldDescriptorProto name. */ public name: string; - /** EnumValue number. */ + /** FieldDescriptorProto number. */ public number: number; - /** EnumValue options. */ - public options: google.protobuf.IOption[]; + /** 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 EnumValue instance using the specified properties. + * Creates a new FieldDescriptorProto instance using the specified properties. * @param [properties] Properties to set - * @returns EnumValue instance + * @returns FieldDescriptorProto instance */ - public static create(properties?: google.protobuf.IEnumValue): google.protobuf.EnumValue; + public static create(properties?: google.protobuf.IFieldDescriptorProto): google.protobuf.FieldDescriptorProto; /** - * Encodes the specified EnumValue message. Does not implicitly {@link google.protobuf.EnumValue.verify|verify} messages. - * @param message EnumValue message or plain object to encode + * 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.IEnumValue, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.protobuf.IFieldDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified EnumValue message, length delimited. Does not implicitly {@link google.protobuf.EnumValue.verify|verify} messages. - * @param message EnumValue message or plain object to encode + * 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.IEnumValue, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.protobuf.IFieldDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes an EnumValue message from the specified reader or buffer. + * 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 EnumValue + * @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.EnumValue; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.FieldDescriptorProto; /** - * Decodes an EnumValue message from the specified reader or buffer, length delimited. + * Decodes a FieldDescriptorProto message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns EnumValue + * @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.EnumValue; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.FieldDescriptorProto; /** - * Verifies an EnumValue message. + * 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 an EnumValue message from a plain object. Also converts values to their respective internal types. + * Creates a FieldDescriptorProto message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns EnumValue + * @returns FieldDescriptorProto */ - public static fromObject(object: { [k: string]: any }): google.protobuf.EnumValue; + public static fromObject(object: { [k: string]: any }): google.protobuf.FieldDescriptorProto; /** - * Creates a plain object from an EnumValue message. Also converts values to other types if specified. - * @param message EnumValue + * 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.EnumValue, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.protobuf.FieldDescriptorProto, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this EnumValue to JSON. + * Converts this FieldDescriptorProto to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; /** - * Gets the default type url for EnumValue + * 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; } - /** Properties of an Option. */ - interface IOption { + namespace FieldDescriptorProto { - /** Option name */ + /** 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_REQUIRED = 2, + LABEL_REPEATED = 3 + } + } + + /** Properties of an OneofDescriptorProto. */ + interface IOneofDescriptorProto { + + /** OneofDescriptorProto name */ name?: (string|null); - /** Option value */ - value?: (google.protobuf.IAny|null); + /** OneofDescriptorProto options */ + options?: (google.protobuf.IOneofOptions|null); } - /** Represents an Option. */ - class Option implements IOption { + /** Represents an OneofDescriptorProto. */ + class OneofDescriptorProto implements IOneofDescriptorProto { /** - * Constructs a new Option. + * Constructs a new OneofDescriptorProto. * @param [properties] Properties to set */ - constructor(properties?: google.protobuf.IOption); + constructor(properties?: google.protobuf.IOneofDescriptorProto); - /** Option name. */ + /** OneofDescriptorProto name. */ public name: string; - /** Option value. */ - public value?: (google.protobuf.IAny|null); + /** OneofDescriptorProto options. */ + public options?: (google.protobuf.IOneofOptions|null); /** - * Creates a new Option instance using the specified properties. + * Creates a new OneofDescriptorProto instance using the specified properties. * @param [properties] Properties to set - * @returns Option instance + * @returns OneofDescriptorProto instance */ - public static create(properties?: google.protobuf.IOption): google.protobuf.Option; + public static create(properties?: google.protobuf.IOneofDescriptorProto): google.protobuf.OneofDescriptorProto; /** - * Encodes the specified Option message. Does not implicitly {@link google.protobuf.Option.verify|verify} messages. - * @param message Option message or plain object to encode + * 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.IOption, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.protobuf.IOneofDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified Option message, length delimited. Does not implicitly {@link google.protobuf.Option.verify|verify} messages. - * @param message Option message or plain object to encode + * 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.IOption, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.protobuf.IOneofDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes an Option message from the specified reader or buffer. + * 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 Option + * @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.Option; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.OneofDescriptorProto; /** - * Decodes an Option message from the specified reader or buffer, length delimited. + * Decodes an OneofDescriptorProto message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns Option + * @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.Option; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.OneofDescriptorProto; /** - * Verifies an Option message. + * 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 Option message from a plain object. Also converts values to their respective internal types. + * Creates an OneofDescriptorProto message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns Option + * @returns OneofDescriptorProto */ - public static fromObject(object: { [k: string]: any }): google.protobuf.Option; + public static fromObject(object: { [k: string]: any }): google.protobuf.OneofDescriptorProto; /** - * Creates a plain object from an Option message. Also converts values to other types if specified. - * @param message Option + * 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.Option, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.protobuf.OneofDescriptorProto, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this Option to JSON. + * Converts this OneofDescriptorProto to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; /** - * Gets the default type url for Option + * 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; } - /** Syntax enum. */ - enum Syntax { - SYNTAX_PROTO2 = 0, - SYNTAX_PROTO3 = 1 - } + /** Properties of an EnumDescriptorProto. */ + interface IEnumDescriptorProto { - /** Properties of an Any. */ - interface IAny { + /** EnumDescriptorProto name */ + name?: (string|null); - /** Any type_url */ - type_url?: (string|null); + /** EnumDescriptorProto value */ + value?: (google.protobuf.IEnumValueDescriptorProto[]|null); - /** Any value */ - value?: (Uint8Array|string|null); + /** EnumDescriptorProto options */ + options?: (google.protobuf.IEnumOptions|null); + + /** EnumDescriptorProto reservedRange */ + reservedRange?: (google.protobuf.EnumDescriptorProto.IEnumReservedRange[]|null); + + /** EnumDescriptorProto reservedName */ + reservedName?: (string[]|null); } - /** Represents an Any. */ - class Any implements IAny { + /** Represents an EnumDescriptorProto. */ + class EnumDescriptorProto implements IEnumDescriptorProto { /** - * Constructs a new Any. + * Constructs a new EnumDescriptorProto. * @param [properties] Properties to set */ - constructor(properties?: google.protobuf.IAny); + constructor(properties?: google.protobuf.IEnumDescriptorProto); - /** Any type_url. */ - public type_url: string; + /** EnumDescriptorProto name. */ + public name: string; - /** Any value. */ - public value: (Uint8Array|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 Any instance using the specified properties. + * Creates a new EnumDescriptorProto instance using the specified properties. * @param [properties] Properties to set - * @returns Any instance + * @returns EnumDescriptorProto instance */ - public static create(properties?: google.protobuf.IAny): google.protobuf.Any; + public static create(properties?: google.protobuf.IEnumDescriptorProto): google.protobuf.EnumDescriptorProto; /** - * Encodes the specified Any message. Does not implicitly {@link google.protobuf.Any.verify|verify} messages. - * @param message Any message or plain object to encode + * 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.IAny, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.protobuf.IEnumDescriptorProto, 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 + * 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.IAny, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.protobuf.IEnumDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes an Any message from the specified reader or buffer. + * 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 Any + * @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.Any; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.EnumDescriptorProto; /** - * Decodes an Any message from the specified reader or buffer, length delimited. + * Decodes an EnumDescriptorProto message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns Any + * @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.Any; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.EnumDescriptorProto; /** - * Verifies an Any message. + * 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 Any message from a plain object. Also converts values to their respective internal types. + * Creates an EnumDescriptorProto message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns Any + * @returns EnumDescriptorProto */ - public static fromObject(object: { [k: string]: any }): google.protobuf.Any; + public static fromObject(object: { [k: string]: any }): google.protobuf.EnumDescriptorProto; /** - * Creates a plain object from an Any message. Also converts values to other types if specified. - * @param message Any + * 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.Any, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.protobuf.EnumDescriptorProto, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this Any to JSON. + * Converts this EnumDescriptorProto to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; /** - * Gets the default type url for 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; } - /** Properties of a FileDescriptorSet. */ - interface IFileDescriptorSet { + namespace EnumDescriptorProto { - /** FileDescriptorSet file */ - file?: (google.protobuf.IFileDescriptorProto[]|null); + /** 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; + } } - /** Represents a FileDescriptorSet. */ - class FileDescriptorSet implements IFileDescriptorSet { + /** 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 FileDescriptorSet. + * Constructs a new EnumValueDescriptorProto. * @param [properties] Properties to set */ - constructor(properties?: google.protobuf.IFileDescriptorSet); + constructor(properties?: google.protobuf.IEnumValueDescriptorProto); - /** FileDescriptorSet file. */ - public file: google.protobuf.IFileDescriptorProto[]; + /** EnumValueDescriptorProto name. */ + public name: string; + + /** EnumValueDescriptorProto number. */ + public number: number; + + /** EnumValueDescriptorProto options. */ + public options?: (google.protobuf.IEnumValueOptions|null); /** - * Creates a new FileDescriptorSet instance using the specified properties. + * Creates a new EnumValueDescriptorProto instance using the specified properties. * @param [properties] Properties to set - * @returns FileDescriptorSet instance + * @returns EnumValueDescriptorProto instance */ - public static create(properties?: google.protobuf.IFileDescriptorSet): google.protobuf.FileDescriptorSet; + public static create(properties?: google.protobuf.IEnumValueDescriptorProto): google.protobuf.EnumValueDescriptorProto; /** - * Encodes the specified FileDescriptorSet message. Does not implicitly {@link google.protobuf.FileDescriptorSet.verify|verify} messages. - * @param message FileDescriptorSet message or plain object to encode + * 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.IFileDescriptorSet, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.protobuf.IEnumValueDescriptorProto, 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 + * 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.IFileDescriptorSet, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.protobuf.IEnumValueDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a FileDescriptorSet message from the specified reader or buffer. + * 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 FileDescriptorSet + * @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.FileDescriptorSet; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.EnumValueDescriptorProto; /** - * Decodes a FileDescriptorSet message from the specified reader or buffer, length delimited. + * Decodes an EnumValueDescriptorProto message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns FileDescriptorSet + * @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.FileDescriptorSet; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.EnumValueDescriptorProto; /** - * Verifies a FileDescriptorSet message. + * 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 a FileDescriptorSet message from a plain object. Also converts values to their respective internal types. + * Creates an EnumValueDescriptorProto message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns FileDescriptorSet + * @returns EnumValueDescriptorProto */ - public static fromObject(object: { [k: string]: any }): google.protobuf.FileDescriptorSet; + public static fromObject(object: { [k: string]: any }): google.protobuf.EnumValueDescriptorProto; /** - * Creates a plain object from a FileDescriptorSet message. Also converts values to other types if specified. - * @param message FileDescriptorSet + * 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.FileDescriptorSet, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.protobuf.EnumValueDescriptorProto, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this FileDescriptorSet to JSON. + * Converts this EnumValueDescriptorProto to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; /** - * Gets the default type url for FileDescriptorSet + * 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 FileDescriptorProto. */ - interface IFileDescriptorProto { + /** Properties of a ServiceDescriptorProto. */ + interface IServiceDescriptorProto { - /** FileDescriptorProto name */ + /** ServiceDescriptorProto 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); + /** ServiceDescriptorProto method */ + method?: (google.protobuf.IMethodDescriptorProto[]|null); - /** FileDescriptorProto edition */ - edition?: (string|null); + /** ServiceDescriptorProto options */ + options?: (google.protobuf.IServiceOptions|null); } - /** Represents a FileDescriptorProto. */ - class FileDescriptorProto implements IFileDescriptorProto { + /** Represents a ServiceDescriptorProto. */ + class ServiceDescriptorProto implements IServiceDescriptorProto { /** - * Constructs a new FileDescriptorProto. + * Constructs a new ServiceDescriptorProto. * @param [properties] Properties to set */ - constructor(properties?: google.protobuf.IFileDescriptorProto); + constructor(properties?: google.protobuf.IServiceDescriptorProto); - /** FileDescriptorProto name. */ + /** ServiceDescriptorProto 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; + /** ServiceDescriptorProto method. */ + public method: google.protobuf.IMethodDescriptorProto[]; - /** FileDescriptorProto edition. */ - public edition: string; + /** ServiceDescriptorProto options. */ + public options?: (google.protobuf.IServiceOptions|null); /** - * Creates a new FileDescriptorProto instance using the specified properties. + * Creates a new ServiceDescriptorProto instance using the specified properties. * @param [properties] Properties to set - * @returns FileDescriptorProto instance + * @returns ServiceDescriptorProto instance */ - public static create(properties?: google.protobuf.IFileDescriptorProto): google.protobuf.FileDescriptorProto; + public static create(properties?: google.protobuf.IServiceDescriptorProto): google.protobuf.ServiceDescriptorProto; /** - * Encodes the specified FileDescriptorProto message. Does not implicitly {@link google.protobuf.FileDescriptorProto.verify|verify} messages. - * @param message FileDescriptorProto message or plain object to encode + * 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.IFileDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.protobuf.IServiceDescriptorProto, 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 + * 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.IFileDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.protobuf.IServiceDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a FileDescriptorProto message from the specified reader or buffer. + * 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 FileDescriptorProto + * @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.FileDescriptorProto; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.ServiceDescriptorProto; /** - * Decodes a FileDescriptorProto message from the specified reader or buffer, length delimited. + * Decodes a ServiceDescriptorProto message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns FileDescriptorProto + * @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.FileDescriptorProto; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.ServiceDescriptorProto; /** - * Verifies a FileDescriptorProto message. + * 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 FileDescriptorProto message from a plain object. Also converts values to their respective internal types. + * Creates a ServiceDescriptorProto message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns FileDescriptorProto + * @returns ServiceDescriptorProto */ - public static fromObject(object: { [k: string]: any }): google.protobuf.FileDescriptorProto; + public static fromObject(object: { [k: string]: any }): google.protobuf.ServiceDescriptorProto; /** - * Creates a plain object from a FileDescriptorProto message. Also converts values to other types if specified. - * @param message FileDescriptorProto + * 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.FileDescriptorProto, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.protobuf.ServiceDescriptorProto, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this FileDescriptorProto to JSON. + * Converts this ServiceDescriptorProto to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; /** - * Gets the default type url for FileDescriptorProto + * 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 DescriptorProto. */ - interface IDescriptorProto { + /** Properties of a MethodDescriptorProto. */ + interface IMethodDescriptorProto { - /** DescriptorProto name */ + /** MethodDescriptorProto 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); + /** MethodDescriptorProto inputType */ + inputType?: (string|null); - /** DescriptorProto oneofDecl */ - oneofDecl?: (google.protobuf.IOneofDescriptorProto[]|null); + /** MethodDescriptorProto outputType */ + outputType?: (string|null); - /** DescriptorProto options */ - options?: (google.protobuf.IMessageOptions|null); + /** MethodDescriptorProto options */ + options?: (google.protobuf.IMethodOptions|null); - /** DescriptorProto reservedRange */ - reservedRange?: (google.protobuf.DescriptorProto.IReservedRange[]|null); + /** MethodDescriptorProto clientStreaming */ + clientStreaming?: (boolean|null); - /** DescriptorProto reservedName */ - reservedName?: (string[]|null); + /** MethodDescriptorProto serverStreaming */ + serverStreaming?: (boolean|null); } - /** Represents a DescriptorProto. */ - class DescriptorProto implements IDescriptorProto { + /** Represents a MethodDescriptorProto. */ + class MethodDescriptorProto implements IMethodDescriptorProto { /** - * Constructs a new DescriptorProto. + * Constructs a new MethodDescriptorProto. * @param [properties] Properties to set */ - constructor(properties?: google.protobuf.IDescriptorProto); + constructor(properties?: google.protobuf.IMethodDescriptorProto); - /** DescriptorProto name. */ + /** MethodDescriptorProto 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[]; + /** MethodDescriptorProto inputType. */ + public inputType: string; - /** DescriptorProto oneofDecl. */ - public oneofDecl: google.protobuf.IOneofDescriptorProto[]; + /** MethodDescriptorProto outputType. */ + public outputType: string; - /** DescriptorProto options. */ - public options?: (google.protobuf.IMessageOptions|null); + /** MethodDescriptorProto options. */ + public options?: (google.protobuf.IMethodOptions|null); - /** DescriptorProto reservedRange. */ - public reservedRange: google.protobuf.DescriptorProto.IReservedRange[]; + /** MethodDescriptorProto clientStreaming. */ + public clientStreaming: boolean; - /** DescriptorProto reservedName. */ - public reservedName: string[]; + /** MethodDescriptorProto serverStreaming. */ + public serverStreaming: boolean; /** - * Creates a new DescriptorProto instance using the specified properties. + * Creates a new MethodDescriptorProto instance using the specified properties. * @param [properties] Properties to set - * @returns DescriptorProto instance + * @returns MethodDescriptorProto instance */ - public static create(properties?: google.protobuf.IDescriptorProto): google.protobuf.DescriptorProto; + public static create(properties?: google.protobuf.IMethodDescriptorProto): google.protobuf.MethodDescriptorProto; /** - * Encodes the specified DescriptorProto message. Does not implicitly {@link google.protobuf.DescriptorProto.verify|verify} messages. - * @param message DescriptorProto message or plain object to encode + * 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.IDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.protobuf.IMethodDescriptorProto, 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 + /** + * 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.IDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.protobuf.IMethodDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a DescriptorProto message from the specified reader or buffer. + * 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 DescriptorProto + * @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.DescriptorProto; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.MethodDescriptorProto; /** - * Decodes a DescriptorProto message from the specified reader or buffer, length delimited. + * Decodes a MethodDescriptorProto message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns DescriptorProto + * @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.DescriptorProto; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.MethodDescriptorProto; /** - * Verifies a DescriptorProto message. + * 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 DescriptorProto message from a plain object. Also converts values to their respective internal types. + * Creates a MethodDescriptorProto message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns DescriptorProto + * @returns MethodDescriptorProto */ - public static fromObject(object: { [k: string]: any }): google.protobuf.DescriptorProto; + public static fromObject(object: { [k: string]: any }): google.protobuf.MethodDescriptorProto; /** - * Creates a plain object from a DescriptorProto message. Also converts values to other types if specified. - * @param message DescriptorProto + * 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.DescriptorProto, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.protobuf.MethodDescriptorProto, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this DescriptorProto to JSON. + * Converts this MethodDescriptorProto to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; /** - * Gets the default type url for DescriptorProto + * 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; } - namespace DescriptorProto { + /** Properties of a FileOptions. */ + interface IFileOptions { - /** Properties of an ExtensionRange. */ - interface IExtensionRange { + /** FileOptions javaPackage */ + javaPackage?: (string|null); - /** ExtensionRange start */ - start?: (number|null); + /** FileOptions javaOuterClassname */ + javaOuterClassname?: (string|null); - /** ExtensionRange end */ - end?: (number|null); + /** FileOptions javaMultipleFiles */ + javaMultipleFiles?: (boolean|null); - /** ExtensionRange options */ - options?: (google.protobuf.IExtensionRangeOptions|null); - } + /** FileOptions javaGenerateEqualsAndHash */ + javaGenerateEqualsAndHash?: (boolean|null); - /** Represents an ExtensionRange. */ - class ExtensionRange implements IExtensionRange { + /** FileOptions javaStringCheckUtf8 */ + javaStringCheckUtf8?: (boolean|null); - /** - * Constructs a new ExtensionRange. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.DescriptorProto.IExtensionRange); + /** FileOptions optimizeFor */ + optimizeFor?: (google.protobuf.FileOptions.OptimizeMode|keyof typeof google.protobuf.FileOptions.OptimizeMode|null); - /** ExtensionRange start. */ - public start: number; + /** FileOptions goPackage */ + goPackage?: (string|null); - /** ExtensionRange end. */ - public end: number; + /** FileOptions ccGenericServices */ + ccGenericServices?: (boolean|null); - /** ExtensionRange options. */ - public options?: (google.protobuf.IExtensionRangeOptions|null); + /** FileOptions javaGenericServices */ + javaGenericServices?: (boolean|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; + /** FileOptions pyGenericServices */ + pyGenericServices?: (boolean|null); - /** - * 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; + /** FileOptions phpGenericServices */ + phpGenericServices?: (boolean|null); - /** - * 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; + /** FileOptions deprecated */ + deprecated?: (boolean|null); - /** - * 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; + /** FileOptions ccEnableArenas */ + ccEnableArenas?: (boolean|null); - /** - * 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; + /** FileOptions objcClassPrefix */ + objcClassPrefix?: (string|null); - /** - * 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); + /** FileOptions csharpNamespace */ + csharpNamespace?: (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; + /** FileOptions swiftPrefix */ + swiftPrefix?: (string|null); - /** - * 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 }; + /** FileOptions phpClassPrefix */ + phpClassPrefix?: (string|null); - /** - * Converts this ExtensionRange to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; + /** FileOptions phpNamespace */ + phpNamespace?: (string|null); - /** - * 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; - } + /** FileOptions phpMetadataNamespace */ + phpMetadataNamespace?: (string|null); - /** Properties of a ReservedRange. */ - interface IReservedRange { + /** FileOptions rubyPackage */ + rubyPackage?: (string|null); - /** ReservedRange start */ - start?: (number|null); + /** FileOptions uninterpretedOption */ + uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); - /** ReservedRange end */ - end?: (number|null); - } + /** FileOptions .google.api.resourceDefinition */ + ".google.api.resourceDefinition"?: (google.api.IResourceDescriptor[]|null); + } - /** Represents a ReservedRange. */ - class ReservedRange implements IReservedRange { + /** Represents a FileOptions. */ + class FileOptions implements IFileOptions { - /** - * Constructs a new ReservedRange. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.DescriptorProto.IReservedRange); + /** + * Constructs a new FileOptions. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IFileOptions); - /** ReservedRange start. */ - public start: number; + /** FileOptions javaPackage. */ + public javaPackage: string; - /** ReservedRange end. */ - public end: number; + /** FileOptions javaOuterClassname. */ + public javaOuterClassname: string; - /** - * 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; + /** FileOptions javaMultipleFiles. */ + public javaMultipleFiles: boolean; - /** - * 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; + /** FileOptions javaGenerateEqualsAndHash. */ + public javaGenerateEqualsAndHash: boolean; - /** - * 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; + /** FileOptions javaStringCheckUtf8. */ + public javaStringCheckUtf8: boolean; - /** - * 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; + /** FileOptions optimizeFor. */ + public optimizeFor: (google.protobuf.FileOptions.OptimizeMode|keyof typeof google.protobuf.FileOptions.OptimizeMode); - /** - * 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; + /** FileOptions goPackage. */ + public goPackage: string; + + /** FileOptions ccGenericServices. */ + public ccGenericServices: boolean; + + /** FileOptions javaGenericServices. */ + public javaGenericServices: boolean; + + /** FileOptions pyGenericServices. */ + public pyGenericServices: boolean; - /** - * 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); + /** FileOptions phpGenericServices. */ + public phpGenericServices: boolean; - /** - * 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; + /** FileOptions deprecated. */ + public deprecated: boolean; - /** - * 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 }; + /** FileOptions ccEnableArenas. */ + public ccEnableArenas: boolean; - /** - * Converts this ReservedRange to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; + /** FileOptions objcClassPrefix. */ + public objcClassPrefix: string; - /** - * 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; - } - } + /** FileOptions csharpNamespace. */ + public csharpNamespace: string; - /** Properties of an ExtensionRangeOptions. */ - interface IExtensionRangeOptions { + /** FileOptions swiftPrefix. */ + public swiftPrefix: string; - /** ExtensionRangeOptions uninterpretedOption */ - uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); - } + /** FileOptions phpClassPrefix. */ + public phpClassPrefix: string; - /** Represents an ExtensionRangeOptions. */ - class ExtensionRangeOptions implements IExtensionRangeOptions { + /** FileOptions phpNamespace. */ + public phpNamespace: string; - /** - * Constructs a new ExtensionRangeOptions. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.IExtensionRangeOptions); + /** FileOptions phpMetadataNamespace. */ + public phpMetadataNamespace: string; - /** ExtensionRangeOptions uninterpretedOption. */ + /** FileOptions rubyPackage. */ + public rubyPackage: string; + + /** FileOptions uninterpretedOption. */ public uninterpretedOption: google.protobuf.IUninterpretedOption[]; /** - * Creates a new ExtensionRangeOptions instance using the specified properties. + * Creates a new FileOptions instance using the specified properties. * @param [properties] Properties to set - * @returns ExtensionRangeOptions instance + * @returns FileOptions instance */ - public static create(properties?: google.protobuf.IExtensionRangeOptions): google.protobuf.ExtensionRangeOptions; + public static create(properties?: google.protobuf.IFileOptions): google.protobuf.FileOptions; /** - * Encodes the specified ExtensionRangeOptions message. Does not implicitly {@link google.protobuf.ExtensionRangeOptions.verify|verify} messages. - * @param message ExtensionRangeOptions message or plain object to encode + * 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.IExtensionRangeOptions, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.protobuf.IFileOptions, 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 + * 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.IExtensionRangeOptions, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.protobuf.IFileOptions, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes an ExtensionRangeOptions message from the specified reader or buffer. + * 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 ExtensionRangeOptions + * @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.ExtensionRangeOptions; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.FileOptions; /** - * Decodes an ExtensionRangeOptions message from the specified reader or buffer, length delimited. + * Decodes a FileOptions message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns ExtensionRangeOptions + * @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.ExtensionRangeOptions; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.FileOptions; /** - * Verifies an ExtensionRangeOptions message. + * 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 an ExtensionRangeOptions message from a plain object. Also converts values to their respective internal types. + * Creates a FileOptions message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns ExtensionRangeOptions + * @returns FileOptions */ - public static fromObject(object: { [k: string]: any }): google.protobuf.ExtensionRangeOptions; + public static fromObject(object: { [k: string]: any }): google.protobuf.FileOptions; /** - * Creates a plain object from an ExtensionRangeOptions message. Also converts values to other types if specified. - * @param message ExtensionRangeOptions + * 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.ExtensionRangeOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.protobuf.FileOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this ExtensionRangeOptions to JSON. + * Converts this FileOptions to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; /** - * Gets the default type url for ExtensionRangeOptions + * 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; } - /** Properties of a FieldDescriptorProto. */ - interface IFieldDescriptorProto { - - /** FieldDescriptorProto name */ - name?: (string|null); - - /** FieldDescriptorProto number */ - number?: (number|null); + namespace FileOptions { - /** FieldDescriptorProto label */ - label?: (google.protobuf.FieldDescriptorProto.Label|keyof typeof google.protobuf.FieldDescriptorProto.Label|null); + /** OptimizeMode enum. */ + enum OptimizeMode { + SPEED = 1, + CODE_SIZE = 2, + LITE_RUNTIME = 3 + } + } - /** FieldDescriptorProto type */ - type?: (google.protobuf.FieldDescriptorProto.Type|keyof typeof google.protobuf.FieldDescriptorProto.Type|null); + /** Properties of a MessageOptions. */ + interface IMessageOptions { - /** FieldDescriptorProto typeName */ - typeName?: (string|null); + /** MessageOptions messageSetWireFormat */ + messageSetWireFormat?: (boolean|null); - /** FieldDescriptorProto extendee */ - extendee?: (string|null); + /** MessageOptions noStandardDescriptorAccessor */ + noStandardDescriptorAccessor?: (boolean|null); - /** FieldDescriptorProto defaultValue */ - defaultValue?: (string|null); + /** MessageOptions deprecated */ + deprecated?: (boolean|null); - /** FieldDescriptorProto oneofIndex */ - oneofIndex?: (number|null); + /** MessageOptions mapEntry */ + mapEntry?: (boolean|null); - /** FieldDescriptorProto jsonName */ - jsonName?: (string|null); + /** MessageOptions deprecatedLegacyJsonFieldConflicts */ + deprecatedLegacyJsonFieldConflicts?: (boolean|null); - /** FieldDescriptorProto options */ - options?: (google.protobuf.IFieldOptions|null); + /** MessageOptions uninterpretedOption */ + uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); - /** FieldDescriptorProto proto3Optional */ - proto3Optional?: (boolean|null); + /** MessageOptions .google.api.resource */ + ".google.api.resource"?: (google.api.IResourceDescriptor|null); } - /** Represents a FieldDescriptorProto. */ - class FieldDescriptorProto implements IFieldDescriptorProto { + /** Represents a MessageOptions. */ + class MessageOptions implements IMessageOptions { /** - * Constructs a new FieldDescriptorProto. + * Constructs a new MessageOptions. * @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; + constructor(properties?: google.protobuf.IMessageOptions); - /** FieldDescriptorProto extendee. */ - public extendee: string; + /** MessageOptions messageSetWireFormat. */ + public messageSetWireFormat: boolean; - /** FieldDescriptorProto defaultValue. */ - public defaultValue: string; + /** MessageOptions noStandardDescriptorAccessor. */ + public noStandardDescriptorAccessor: boolean; - /** FieldDescriptorProto oneofIndex. */ - public oneofIndex: number; + /** MessageOptions deprecated. */ + public deprecated: boolean; - /** FieldDescriptorProto jsonName. */ - public jsonName: string; + /** MessageOptions mapEntry. */ + public mapEntry: boolean; - /** FieldDescriptorProto options. */ - public options?: (google.protobuf.IFieldOptions|null); + /** MessageOptions deprecatedLegacyJsonFieldConflicts. */ + public deprecatedLegacyJsonFieldConflicts: boolean; - /** FieldDescriptorProto proto3Optional. */ - public proto3Optional: boolean; + /** MessageOptions uninterpretedOption. */ + public uninterpretedOption: google.protobuf.IUninterpretedOption[]; /** - * Creates a new FieldDescriptorProto instance using the specified properties. + * Creates a new MessageOptions instance using the specified properties. * @param [properties] Properties to set - * @returns FieldDescriptorProto instance + * @returns MessageOptions instance */ - public static create(properties?: google.protobuf.IFieldDescriptorProto): google.protobuf.FieldDescriptorProto; + public static create(properties?: google.protobuf.IMessageOptions): google.protobuf.MessageOptions; /** - * Encodes the specified FieldDescriptorProto message. Does not implicitly {@link google.protobuf.FieldDescriptorProto.verify|verify} messages. - * @param message FieldDescriptorProto message or plain object to encode + * 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.IFieldDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.protobuf.IMessageOptions, 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 + * 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.IFieldDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.protobuf.IMessageOptions, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a FieldDescriptorProto message from the specified reader or buffer. + * 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 FieldDescriptorProto + * @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.FieldDescriptorProto; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.MessageOptions; /** - * Decodes a FieldDescriptorProto message from the specified reader or buffer, length delimited. + * Decodes a MessageOptions message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns FieldDescriptorProto + * @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.FieldDescriptorProto; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.MessageOptions; /** - * Verifies a FieldDescriptorProto message. + * 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 FieldDescriptorProto message from a plain object. Also converts values to their respective internal types. + * Creates a MessageOptions message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns FieldDescriptorProto + * @returns MessageOptions */ - public static fromObject(object: { [k: string]: any }): google.protobuf.FieldDescriptorProto; + public static fromObject(object: { [k: string]: any }): google.protobuf.MessageOptions; /** - * Creates a plain object from a FieldDescriptorProto message. Also converts values to other types if specified. - * @param message FieldDescriptorProto + * 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.FieldDescriptorProto, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.protobuf.MessageOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this FieldDescriptorProto to JSON. + * Converts this MessageOptions to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; /** - * Gets the default type url for FieldDescriptorProto + * 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; } - namespace FieldDescriptorProto { + /** Properties of a FieldOptions. */ + interface IFieldOptions { - /** 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 - } + /** FieldOptions ctype */ + ctype?: (google.protobuf.FieldOptions.CType|keyof typeof google.protobuf.FieldOptions.CType|null); - /** Label enum. */ - enum Label { - LABEL_OPTIONAL = 1, - LABEL_REQUIRED = 2, - LABEL_REPEATED = 3 - } - } + /** FieldOptions packed */ + packed?: (boolean|null); - /** Properties of an OneofDescriptorProto. */ - interface IOneofDescriptorProto { + /** FieldOptions jstype */ + jstype?: (google.protobuf.FieldOptions.JSType|keyof typeof google.protobuf.FieldOptions.JSType|null); - /** OneofDescriptorProto name */ - name?: (string|null); + /** FieldOptions lazy */ + lazy?: (boolean|null); - /** OneofDescriptorProto options */ - options?: (google.protobuf.IOneofOptions|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 target */ + target?: (google.protobuf.FieldOptions.OptionTargetType|keyof typeof google.protobuf.FieldOptions.OptionTargetType|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); } - /** Represents an OneofDescriptorProto. */ - class OneofDescriptorProto implements IOneofDescriptorProto { + /** Represents a FieldOptions. */ + class FieldOptions implements IFieldOptions { /** - * Constructs a new OneofDescriptorProto. + * Constructs a new FieldOptions. * @param [properties] Properties to set */ - constructor(properties?: google.protobuf.IOneofDescriptorProto); + constructor(properties?: google.protobuf.IFieldOptions); - /** OneofDescriptorProto name. */ - public name: string; + /** FieldOptions ctype. */ + public ctype: (google.protobuf.FieldOptions.CType|keyof typeof google.protobuf.FieldOptions.CType); - /** OneofDescriptorProto options. */ - public options?: (google.protobuf.IOneofOptions|null); + /** 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 target. */ + public target: (google.protobuf.FieldOptions.OptionTargetType|keyof typeof google.protobuf.FieldOptions.OptionTargetType); + + /** FieldOptions uninterpretedOption. */ + public uninterpretedOption: google.protobuf.IUninterpretedOption[]; /** - * Creates a new OneofDescriptorProto instance using the specified properties. + * Creates a new FieldOptions instance using the specified properties. * @param [properties] Properties to set - * @returns OneofDescriptorProto instance + * @returns FieldOptions instance */ - public static create(properties?: google.protobuf.IOneofDescriptorProto): google.protobuf.OneofDescriptorProto; + public static create(properties?: google.protobuf.IFieldOptions): google.protobuf.FieldOptions; /** - * Encodes the specified OneofDescriptorProto message. Does not implicitly {@link google.protobuf.OneofDescriptorProto.verify|verify} messages. - * @param message OneofDescriptorProto message or plain object to encode + * 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.IOneofDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.protobuf.IFieldOptions, 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 + * 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.IOneofDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.protobuf.IFieldOptions, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes an OneofDescriptorProto message from the specified reader or buffer. + * 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 OneofDescriptorProto + * @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.OneofDescriptorProto; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.FieldOptions; /** - * Decodes an OneofDescriptorProto message from the specified reader or buffer, length delimited. + * Decodes a FieldOptions message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns OneofDescriptorProto + * @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.OneofDescriptorProto; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.FieldOptions; /** - * Verifies an OneofDescriptorProto message. + * 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 an OneofDescriptorProto message from a plain object. Also converts values to their respective internal types. + * Creates a FieldOptions message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns OneofDescriptorProto + * @returns FieldOptions */ - public static fromObject(object: { [k: string]: any }): google.protobuf.OneofDescriptorProto; + public static fromObject(object: { [k: string]: any }): google.protobuf.FieldOptions; /** - * Creates a plain object from an OneofDescriptorProto message. Also converts values to other types if specified. - * @param message OneofDescriptorProto + * 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.OneofDescriptorProto, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.protobuf.FieldOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this OneofDescriptorProto to JSON. + * Converts this FieldOptions to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; /** - * Gets the default type url for OneofDescriptorProto + * 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; } - /** Properties of an EnumDescriptorProto. */ - interface IEnumDescriptorProto { + namespace FieldOptions { - /** EnumDescriptorProto name */ - name?: (string|null); + /** CType enum. */ + enum CType { + STRING = 0, + CORD = 1, + STRING_PIECE = 2 + } - /** EnumDescriptorProto value */ - value?: (google.protobuf.IEnumValueDescriptorProto[]|null); + /** JSType enum. */ + enum JSType { + JS_NORMAL = 0, + JS_STRING = 1, + JS_NUMBER = 2 + } - /** EnumDescriptorProto options */ - options?: (google.protobuf.IEnumOptions|null); + /** OptionRetention enum. */ + enum OptionRetention { + RETENTION_UNKNOWN = 0, + RETENTION_RUNTIME = 1, + RETENTION_SOURCE = 2 + } - /** EnumDescriptorProto reservedRange */ - reservedRange?: (google.protobuf.EnumDescriptorProto.IEnumReservedRange[]|null); + /** 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 + } + } - /** EnumDescriptorProto reservedName */ - reservedName?: (string[]|null); + /** Properties of an OneofOptions. */ + interface IOneofOptions { + + /** OneofOptions uninterpretedOption */ + uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); } - /** Represents an EnumDescriptorProto. */ - class EnumDescriptorProto implements IEnumDescriptorProto { + /** Represents an OneofOptions. */ + class OneofOptions implements IOneofOptions { /** - * Constructs a new EnumDescriptorProto. + * Constructs a new OneofOptions. * @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[]; + constructor(properties?: google.protobuf.IOneofOptions); - /** EnumDescriptorProto reservedName. */ - public reservedName: string[]; + /** OneofOptions uninterpretedOption. */ + public uninterpretedOption: google.protobuf.IUninterpretedOption[]; /** - * Creates a new EnumDescriptorProto instance using the specified properties. + * Creates a new OneofOptions instance using the specified properties. * @param [properties] Properties to set - * @returns EnumDescriptorProto instance + * @returns OneofOptions instance */ - public static create(properties?: google.protobuf.IEnumDescriptorProto): google.protobuf.EnumDescriptorProto; + public static create(properties?: google.protobuf.IOneofOptions): google.protobuf.OneofOptions; /** - * Encodes the specified EnumDescriptorProto message. Does not implicitly {@link google.protobuf.EnumDescriptorProto.verify|verify} messages. - * @param message EnumDescriptorProto message or plain object to encode + * 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.IEnumDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.protobuf.IOneofOptions, 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 + * 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.IEnumDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.protobuf.IOneofOptions, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes an EnumDescriptorProto message from the specified reader or buffer. + * 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 EnumDescriptorProto + * @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.EnumDescriptorProto; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.OneofOptions; /** - * Decodes an EnumDescriptorProto message from the specified reader or buffer, length delimited. + * Decodes an OneofOptions message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns EnumDescriptorProto + * @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.EnumDescriptorProto; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.OneofOptions; /** - * Verifies an EnumDescriptorProto message. + * 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 EnumDescriptorProto message from a plain object. Also converts values to their respective internal types. + * Creates an OneofOptions message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns EnumDescriptorProto + * @returns OneofOptions */ - public static fromObject(object: { [k: string]: any }): google.protobuf.EnumDescriptorProto; + public static fromObject(object: { [k: string]: any }): google.protobuf.OneofOptions; /** - * Creates a plain object from an EnumDescriptorProto message. Also converts values to other types if specified. - * @param message EnumDescriptorProto + * 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.EnumDescriptorProto, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.protobuf.OneofOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this EnumDescriptorProto to JSON. + * Converts this OneofOptions to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; /** - * Gets the default type url for EnumDescriptorProto + * 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; } - 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 EnumOptions. */ + interface IEnumOptions { - /** Properties of an EnumValueDescriptorProto. */ - interface IEnumValueDescriptorProto { + /** EnumOptions allowAlias */ + allowAlias?: (boolean|null); - /** EnumValueDescriptorProto name */ - name?: (string|null); + /** EnumOptions deprecated */ + deprecated?: (boolean|null); - /** EnumValueDescriptorProto number */ - number?: (number|null); + /** EnumOptions deprecatedLegacyJsonFieldConflicts */ + deprecatedLegacyJsonFieldConflicts?: (boolean|null); - /** EnumValueDescriptorProto options */ - options?: (google.protobuf.IEnumValueOptions|null); + /** EnumOptions uninterpretedOption */ + uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); } - /** Represents an EnumValueDescriptorProto. */ - class EnumValueDescriptorProto implements IEnumValueDescriptorProto { + /** Represents an EnumOptions. */ + class EnumOptions implements IEnumOptions { /** - * Constructs a new EnumValueDescriptorProto. + * Constructs a new EnumOptions. * @param [properties] Properties to set */ - constructor(properties?: google.protobuf.IEnumValueDescriptorProto); + constructor(properties?: google.protobuf.IEnumOptions); - /** EnumValueDescriptorProto name. */ - public name: string; + /** EnumOptions allowAlias. */ + public allowAlias: boolean; - /** EnumValueDescriptorProto number. */ - public number: number; + /** EnumOptions deprecated. */ + public deprecated: boolean; - /** EnumValueDescriptorProto options. */ - public options?: (google.protobuf.IEnumValueOptions|null); + /** EnumOptions deprecatedLegacyJsonFieldConflicts. */ + public deprecatedLegacyJsonFieldConflicts: boolean; + + /** EnumOptions uninterpretedOption. */ + public uninterpretedOption: google.protobuf.IUninterpretedOption[]; /** - * Creates a new EnumValueDescriptorProto instance using the specified properties. + * Creates a new EnumOptions instance using the specified properties. * @param [properties] Properties to set - * @returns EnumValueDescriptorProto instance + * @returns EnumOptions instance */ - public static create(properties?: google.protobuf.IEnumValueDescriptorProto): google.protobuf.EnumValueDescriptorProto; + public static create(properties?: google.protobuf.IEnumOptions): google.protobuf.EnumOptions; /** - * Encodes the specified EnumValueDescriptorProto message. Does not implicitly {@link google.protobuf.EnumValueDescriptorProto.verify|verify} messages. - * @param message EnumValueDescriptorProto message or plain object to encode + * 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.IEnumValueDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.protobuf.IEnumOptions, 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 + * 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.IEnumValueDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.protobuf.IEnumOptions, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes an EnumValueDescriptorProto message from the specified reader or buffer. + * 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 EnumValueDescriptorProto + * @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.EnumValueDescriptorProto; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.EnumOptions; /** - * Decodes an EnumValueDescriptorProto message from the specified reader or buffer, length delimited. + * Decodes an EnumOptions message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns EnumValueDescriptorProto + * @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.EnumValueDescriptorProto; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.EnumOptions; /** - * Verifies an EnumValueDescriptorProto message. + * 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 EnumValueDescriptorProto message from a plain object. Also converts values to their respective internal types. + * Creates an EnumOptions message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns EnumValueDescriptorProto + * @returns EnumOptions */ - public static fromObject(object: { [k: string]: any }): google.protobuf.EnumValueDescriptorProto; + public static fromObject(object: { [k: string]: any }): google.protobuf.EnumOptions; /** - * Creates a plain object from an EnumValueDescriptorProto message. Also converts values to other types if specified. - * @param message EnumValueDescriptorProto + * 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.EnumValueDescriptorProto, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.protobuf.EnumOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this EnumValueDescriptorProto to JSON. + * Converts this EnumOptions to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; /** - * Gets the default type url for EnumValueDescriptorProto + * 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 a ServiceDescriptorProto. */ - interface IServiceDescriptorProto { - - /** ServiceDescriptorProto name */ - name?: (string|null); + /** Properties of an EnumValueOptions. */ + interface IEnumValueOptions { - /** ServiceDescriptorProto method */ - method?: (google.protobuf.IMethodDescriptorProto[]|null); + /** EnumValueOptions deprecated */ + deprecated?: (boolean|null); - /** ServiceDescriptorProto options */ - options?: (google.protobuf.IServiceOptions|null); + /** EnumValueOptions uninterpretedOption */ + uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); } - /** Represents a ServiceDescriptorProto. */ - class ServiceDescriptorProto implements IServiceDescriptorProto { + /** Represents an EnumValueOptions. */ + class EnumValueOptions implements IEnumValueOptions { /** - * Constructs a new ServiceDescriptorProto. + * Constructs a new EnumValueOptions. * @param [properties] Properties to set */ - constructor(properties?: google.protobuf.IServiceDescriptorProto); - - /** ServiceDescriptorProto name. */ - public name: string; + constructor(properties?: google.protobuf.IEnumValueOptions); - /** ServiceDescriptorProto method. */ - public method: google.protobuf.IMethodDescriptorProto[]; + /** EnumValueOptions deprecated. */ + public deprecated: boolean; - /** ServiceDescriptorProto options. */ - public options?: (google.protobuf.IServiceOptions|null); + /** EnumValueOptions uninterpretedOption. */ + public uninterpretedOption: google.protobuf.IUninterpretedOption[]; /** - * Creates a new ServiceDescriptorProto instance using the specified properties. + * Creates a new EnumValueOptions instance using the specified properties. * @param [properties] Properties to set - * @returns ServiceDescriptorProto instance + * @returns EnumValueOptions instance */ - public static create(properties?: google.protobuf.IServiceDescriptorProto): google.protobuf.ServiceDescriptorProto; + public static create(properties?: google.protobuf.IEnumValueOptions): google.protobuf.EnumValueOptions; /** - * Encodes the specified ServiceDescriptorProto message. Does not implicitly {@link google.protobuf.ServiceDescriptorProto.verify|verify} messages. - * @param message ServiceDescriptorProto message or plain object to encode + * 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.IServiceDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.protobuf.IEnumValueOptions, 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 + * 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.IServiceDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.protobuf.IEnumValueOptions, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a ServiceDescriptorProto message from the specified reader or buffer. + * 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 ServiceDescriptorProto + * @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.ServiceDescriptorProto; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.EnumValueOptions; /** - * Decodes a ServiceDescriptorProto message from the specified reader or buffer, length delimited. + * Decodes an EnumValueOptions message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns ServiceDescriptorProto + * @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.ServiceDescriptorProto; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.EnumValueOptions; /** - * Verifies a ServiceDescriptorProto message. + * 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 a ServiceDescriptorProto message from a plain object. Also converts values to their respective internal types. + * Creates an EnumValueOptions message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns ServiceDescriptorProto + * @returns EnumValueOptions */ - public static fromObject(object: { [k: string]: any }): google.protobuf.ServiceDescriptorProto; + public static fromObject(object: { [k: string]: any }): google.protobuf.EnumValueOptions; /** - * Creates a plain object from a ServiceDescriptorProto message. Also converts values to other types if specified. - * @param message ServiceDescriptorProto + * 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.ServiceDescriptorProto, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.protobuf.EnumValueOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this ServiceDescriptorProto to JSON. + * Converts this EnumValueOptions to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; /** - * Gets the default type url for ServiceDescriptorProto + * 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 MethodDescriptorProto. */ - interface IMethodDescriptorProto { - - /** MethodDescriptorProto name */ - name?: (string|null); - - /** MethodDescriptorProto inputType */ - inputType?: (string|null); + /** Properties of a ServiceOptions. */ + interface IServiceOptions { - /** MethodDescriptorProto outputType */ - outputType?: (string|null); + /** ServiceOptions deprecated */ + deprecated?: (boolean|null); - /** MethodDescriptorProto options */ - options?: (google.protobuf.IMethodOptions|null); + /** ServiceOptions uninterpretedOption */ + uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); - /** MethodDescriptorProto clientStreaming */ - clientStreaming?: (boolean|null); + /** ServiceOptions .google.api.defaultHost */ + ".google.api.defaultHost"?: (string|null); - /** MethodDescriptorProto serverStreaming */ - serverStreaming?: (boolean|null); + /** ServiceOptions .google.api.oauthScopes */ + ".google.api.oauthScopes"?: (string|null); } - /** Represents a MethodDescriptorProto. */ - class MethodDescriptorProto implements IMethodDescriptorProto { + /** Represents a ServiceOptions. */ + class ServiceOptions implements IServiceOptions { /** - * Constructs a new MethodDescriptorProto. + * Constructs a new ServiceOptions. * @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); + constructor(properties?: google.protobuf.IServiceOptions); - /** MethodDescriptorProto clientStreaming. */ - public clientStreaming: boolean; + /** ServiceOptions deprecated. */ + public deprecated: boolean; - /** MethodDescriptorProto serverStreaming. */ - public serverStreaming: boolean; + /** ServiceOptions uninterpretedOption. */ + public uninterpretedOption: google.protobuf.IUninterpretedOption[]; /** - * Creates a new MethodDescriptorProto instance using the specified properties. + * Creates a new ServiceOptions instance using the specified properties. * @param [properties] Properties to set - * @returns MethodDescriptorProto instance + * @returns ServiceOptions instance */ - public static create(properties?: google.protobuf.IMethodDescriptorProto): google.protobuf.MethodDescriptorProto; + public static create(properties?: google.protobuf.IServiceOptions): google.protobuf.ServiceOptions; /** - * Encodes the specified MethodDescriptorProto message. Does not implicitly {@link google.protobuf.MethodDescriptorProto.verify|verify} messages. - * @param message MethodDescriptorProto message or plain object to encode + * 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.IMethodDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.protobuf.IServiceOptions, 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 + * 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.IMethodDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.protobuf.IServiceOptions, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a MethodDescriptorProto message from the specified reader or buffer. + * 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 MethodDescriptorProto + * @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.MethodDescriptorProto; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.ServiceOptions; /** - * Decodes a MethodDescriptorProto message from the specified reader or buffer, length delimited. + * Decodes a ServiceOptions message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns MethodDescriptorProto + * @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.MethodDescriptorProto; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.ServiceOptions; /** - * Verifies a MethodDescriptorProto message. + * 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 MethodDescriptorProto message from a plain object. Also converts values to their respective internal types. + * Creates a ServiceOptions message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns MethodDescriptorProto + * @returns ServiceOptions */ - public static fromObject(object: { [k: string]: any }): google.protobuf.MethodDescriptorProto; + public static fromObject(object: { [k: string]: any }): google.protobuf.ServiceOptions; /** - * Creates a plain object from a MethodDescriptorProto message. Also converts values to other types if specified. - * @param message MethodDescriptorProto + * 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.MethodDescriptorProto, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.protobuf.ServiceOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this MethodDescriptorProto to JSON. + * Converts this ServiceOptions to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; /** - * Gets the default type url for MethodDescriptorProto + * 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 FileOptions. */ - interface IFileOptions { - - /** FileOptions javaPackage */ - javaPackage?: (string|null); - - /** FileOptions javaOuterClassname */ - javaOuterClassname?: (string|null); - - /** FileOptions javaMultipleFiles */ - javaMultipleFiles?: (boolean|null); - - /** FileOptions javaGenerateEqualsAndHash */ - javaGenerateEqualsAndHash?: (boolean|null); + /** Properties of a MethodOptions. */ + interface IMethodOptions { - /** FileOptions javaStringCheckUtf8 */ - javaStringCheckUtf8?: (boolean|null); + /** MethodOptions deprecated */ + deprecated?: (boolean|null); - /** FileOptions optimizeFor */ - optimizeFor?: (google.protobuf.FileOptions.OptimizeMode|keyof typeof google.protobuf.FileOptions.OptimizeMode|null); + /** MethodOptions idempotencyLevel */ + idempotencyLevel?: (google.protobuf.MethodOptions.IdempotencyLevel|keyof typeof google.protobuf.MethodOptions.IdempotencyLevel|null); - /** FileOptions goPackage */ - goPackage?: (string|null); + /** MethodOptions uninterpretedOption */ + uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); - /** FileOptions ccGenericServices */ - ccGenericServices?: (boolean|null); + /** MethodOptions .google.api.http */ + ".google.api.http"?: (google.api.IHttpRule|null); - /** FileOptions javaGenericServices */ - javaGenericServices?: (boolean|null); + /** MethodOptions .google.api.methodSignature */ + ".google.api.methodSignature"?: (string[]|null); - /** FileOptions pyGenericServices */ - pyGenericServices?: (boolean|null); + /** MethodOptions .google.longrunning.operationInfo */ + ".google.longrunning.operationInfo"?: (google.longrunning.IOperationInfo|null); + } - /** FileOptions phpGenericServices */ - phpGenericServices?: (boolean|null); + /** Represents a MethodOptions. */ + class MethodOptions implements IMethodOptions { - /** FileOptions deprecated */ - deprecated?: (boolean|null); + /** + * Constructs a new MethodOptions. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IMethodOptions); - /** FileOptions ccEnableArenas */ - ccEnableArenas?: (boolean|null); + /** MethodOptions deprecated. */ + public deprecated: boolean; - /** FileOptions objcClassPrefix */ - objcClassPrefix?: (string|null); + /** MethodOptions idempotencyLevel. */ + public idempotencyLevel: (google.protobuf.MethodOptions.IdempotencyLevel|keyof typeof google.protobuf.MethodOptions.IdempotencyLevel); - /** FileOptions csharpNamespace */ - csharpNamespace?: (string|null); + /** MethodOptions uninterpretedOption. */ + public uninterpretedOption: google.protobuf.IUninterpretedOption[]; - /** FileOptions swiftPrefix */ - swiftPrefix?: (string|null); + /** + * 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; - /** FileOptions phpClassPrefix */ - phpClassPrefix?: (string|null); + /** + * 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; - /** FileOptions phpNamespace */ - phpNamespace?: (string|null); + /** + * 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; - /** FileOptions phpMetadataNamespace */ - phpMetadataNamespace?: (string|null); + /** + * 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; - /** FileOptions rubyPackage */ - rubyPackage?: (string|null); + /** + * 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; - /** FileOptions uninterpretedOption */ - uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); - } + /** + * 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); - /** Represents a FileOptions. */ - class FileOptions implements IFileOptions { + /** + * 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; /** - * Constructs a new FileOptions. - * @param [properties] Properties to set + * 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 */ - constructor(properties?: google.protobuf.IFileOptions); + public static toObject(message: google.protobuf.MethodOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; - /** FileOptions javaPackage. */ - public javaPackage: string; + /** + * Converts this MethodOptions to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; - /** FileOptions javaOuterClassname. */ - public javaOuterClassname: string; + /** + * 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; + } - /** FileOptions javaMultipleFiles. */ - public javaMultipleFiles: boolean; + namespace MethodOptions { - /** FileOptions javaGenerateEqualsAndHash. */ - public javaGenerateEqualsAndHash: boolean; + /** IdempotencyLevel enum. */ + enum IdempotencyLevel { + IDEMPOTENCY_UNKNOWN = 0, + NO_SIDE_EFFECTS = 1, + IDEMPOTENT = 2 + } + } - /** FileOptions javaStringCheckUtf8. */ - public javaStringCheckUtf8: boolean; + /** Properties of an UninterpretedOption. */ + interface IUninterpretedOption { - /** FileOptions optimizeFor. */ - public optimizeFor: (google.protobuf.FileOptions.OptimizeMode|keyof typeof google.protobuf.FileOptions.OptimizeMode); + /** UninterpretedOption name */ + name?: (google.protobuf.UninterpretedOption.INamePart[]|null); - /** FileOptions goPackage. */ - public goPackage: string; + /** UninterpretedOption identifierValue */ + identifierValue?: (string|null); - /** FileOptions ccGenericServices. */ - public ccGenericServices: boolean; + /** UninterpretedOption positiveIntValue */ + positiveIntValue?: (number|Long|string|null); - /** FileOptions javaGenericServices. */ - public javaGenericServices: boolean; + /** UninterpretedOption negativeIntValue */ + negativeIntValue?: (number|Long|string|null); - /** FileOptions pyGenericServices. */ - public pyGenericServices: boolean; + /** UninterpretedOption doubleValue */ + doubleValue?: (number|null); - /** FileOptions phpGenericServices. */ - public phpGenericServices: boolean; + /** UninterpretedOption stringValue */ + stringValue?: (Uint8Array|string|null); - /** FileOptions deprecated. */ - public deprecated: boolean; + /** UninterpretedOption aggregateValue */ + aggregateValue?: (string|null); + } - /** FileOptions ccEnableArenas. */ - public ccEnableArenas: boolean; + /** Represents an UninterpretedOption. */ + class UninterpretedOption implements IUninterpretedOption { - /** FileOptions objcClassPrefix. */ - public objcClassPrefix: string; + /** + * Constructs a new UninterpretedOption. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IUninterpretedOption); - /** FileOptions csharpNamespace. */ - public csharpNamespace: string; + /** UninterpretedOption name. */ + public name: google.protobuf.UninterpretedOption.INamePart[]; - /** FileOptions swiftPrefix. */ - public swiftPrefix: string; + /** UninterpretedOption identifierValue. */ + public identifierValue: string; - /** FileOptions phpClassPrefix. */ - public phpClassPrefix: string; + /** UninterpretedOption positiveIntValue. */ + public positiveIntValue: (number|Long|string); - /** FileOptions phpNamespace. */ - public phpNamespace: string; + /** UninterpretedOption negativeIntValue. */ + public negativeIntValue: (number|Long|string); - /** FileOptions phpMetadataNamespace. */ - public phpMetadataNamespace: string; + /** UninterpretedOption doubleValue. */ + public doubleValue: number; - /** FileOptions rubyPackage. */ - public rubyPackage: string; + /** UninterpretedOption stringValue. */ + public stringValue: (Uint8Array|string); - /** FileOptions uninterpretedOption. */ - public uninterpretedOption: google.protobuf.IUninterpretedOption[]; + /** UninterpretedOption aggregateValue. */ + public aggregateValue: string; /** - * Creates a new FileOptions instance using the specified properties. + * Creates a new UninterpretedOption instance using the specified properties. * @param [properties] Properties to set - * @returns FileOptions instance + * @returns UninterpretedOption instance */ - public static create(properties?: google.protobuf.IFileOptions): google.protobuf.FileOptions; + public static create(properties?: google.protobuf.IUninterpretedOption): google.protobuf.UninterpretedOption; /** - * Encodes the specified FileOptions message. Does not implicitly {@link google.protobuf.FileOptions.verify|verify} messages. - * @param message FileOptions message or plain object to encode + * 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.IFileOptions, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.protobuf.IUninterpretedOption, 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 + * 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.IFileOptions, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.protobuf.IUninterpretedOption, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a FileOptions message from the specified reader or buffer. + * 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 FileOptions + * @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.FileOptions; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.UninterpretedOption; /** - * Decodes a FileOptions message from the specified reader or buffer, length delimited. + * Decodes an UninterpretedOption message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns FileOptions + * @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.FileOptions; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.UninterpretedOption; /** - * Verifies a FileOptions message. + * 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 a FileOptions message from a plain object. Also converts values to their respective internal types. + * Creates an UninterpretedOption message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns FileOptions + * @returns UninterpretedOption */ - public static fromObject(object: { [k: string]: any }): google.protobuf.FileOptions; + public static fromObject(object: { [k: string]: any }): google.protobuf.UninterpretedOption; /** - * Creates a plain object from a FileOptions message. Also converts values to other types if specified. - * @param message FileOptions + * 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.FileOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.protobuf.UninterpretedOption, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this FileOptions to JSON. + * Converts this UninterpretedOption to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; /** - * Gets the default type url for FileOptions + * 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 FileOptions { + namespace UninterpretedOption { - /** OptimizeMode enum. */ - enum OptimizeMode { - SPEED = 1, - CODE_SIZE = 2, - LITE_RUNTIME = 3 + /** Properties of a NamePart. */ + interface INamePart { + + /** NamePart namePart */ + namePart: string; + + /** NamePart isExtension */ + isExtension: boolean; } - } - /** Properties of a MessageOptions. */ - interface IMessageOptions { + /** 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); - /** MessageOptions messageSetWireFormat */ - messageSetWireFormat?: (boolean|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; - /** MessageOptions noStandardDescriptorAccessor */ - noStandardDescriptorAccessor?: (boolean|null); + /** + * 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 }; - /** MessageOptions deprecated */ - deprecated?: (boolean|null); + /** + * Converts this NamePart to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; - /** MessageOptions mapEntry */ - mapEntry?: (boolean|null); + /** + * 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; + } + } - /** MessageOptions deprecatedLegacyJsonFieldConflicts */ - deprecatedLegacyJsonFieldConflicts?: (boolean|null); + /** Properties of a SourceCodeInfo. */ + interface ISourceCodeInfo { - /** MessageOptions uninterpretedOption */ - uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); + /** SourceCodeInfo location */ + location?: (google.protobuf.SourceCodeInfo.ILocation[]|null); } - /** Represents a MessageOptions. */ - class MessageOptions implements IMessageOptions { + /** Represents a SourceCodeInfo. */ + class SourceCodeInfo implements ISourceCodeInfo { /** - * Constructs a new MessageOptions. + * Constructs a new SourceCodeInfo. * @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; + constructor(properties?: google.protobuf.ISourceCodeInfo); - /** MessageOptions uninterpretedOption. */ - public uninterpretedOption: google.protobuf.IUninterpretedOption[]; + /** SourceCodeInfo location. */ + public location: google.protobuf.SourceCodeInfo.ILocation[]; /** - * Creates a new MessageOptions instance using the specified properties. + * Creates a new SourceCodeInfo instance using the specified properties. * @param [properties] Properties to set - * @returns MessageOptions instance + * @returns SourceCodeInfo instance */ - public static create(properties?: google.protobuf.IMessageOptions): google.protobuf.MessageOptions; + public static create(properties?: google.protobuf.ISourceCodeInfo): google.protobuf.SourceCodeInfo; /** - * Encodes the specified MessageOptions message. Does not implicitly {@link google.protobuf.MessageOptions.verify|verify} messages. - * @param message MessageOptions message or plain object to encode + * 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.IMessageOptions, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.protobuf.ISourceCodeInfo, 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 + * 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.IMessageOptions, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.protobuf.ISourceCodeInfo, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a MessageOptions message from the specified reader or buffer. + * 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 MessageOptions + * @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.MessageOptions; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.SourceCodeInfo; /** - * Decodes a MessageOptions message from the specified reader or buffer, length delimited. + * Decodes a SourceCodeInfo message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns MessageOptions + * @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.MessageOptions; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.SourceCodeInfo; /** - * Verifies a MessageOptions message. + * 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 MessageOptions message from a plain object. Also converts values to their respective internal types. + * Creates a SourceCodeInfo message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns MessageOptions + * @returns SourceCodeInfo */ - public static fromObject(object: { [k: string]: any }): google.protobuf.MessageOptions; + public static fromObject(object: { [k: string]: any }): google.protobuf.SourceCodeInfo; /** - * Creates a plain object from a MessageOptions message. Also converts values to other types if specified. - * @param message MessageOptions + * 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.MessageOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.protobuf.SourceCodeInfo, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this MessageOptions to JSON. + * Converts this SourceCodeInfo to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; /** - * Gets the default type url for MessageOptions + * 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; } - /** Properties of a FieldOptions. */ - interface IFieldOptions { + namespace SourceCodeInfo { - /** FieldOptions ctype */ - ctype?: (google.protobuf.FieldOptions.CType|keyof typeof google.protobuf.FieldOptions.CType|null); + /** Properties of a Location. */ + interface ILocation { - /** FieldOptions packed */ - packed?: (boolean|null); + /** Location path */ + path?: (number[]|null); - /** FieldOptions jstype */ - jstype?: (google.protobuf.FieldOptions.JSType|keyof typeof google.protobuf.FieldOptions.JSType|null); + /** Location span */ + span?: (number[]|null); - /** FieldOptions lazy */ - lazy?: (boolean|null); + /** Location leadingComments */ + leadingComments?: (string|null); - /** FieldOptions unverifiedLazy */ - unverifiedLazy?: (boolean|null); + /** Location trailingComments */ + trailingComments?: (string|null); - /** FieldOptions deprecated */ - deprecated?: (boolean|null); + /** Location leadingDetachedComments */ + leadingDetachedComments?: (string[]|null); + } - /** FieldOptions weak */ - weak?: (boolean|null); + /** Represents a Location. */ + class Location implements ILocation { - /** FieldOptions debugRedact */ - debugRedact?: (boolean|null); + /** + * Constructs a new Location. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.SourceCodeInfo.ILocation); - /** FieldOptions retention */ - retention?: (google.protobuf.FieldOptions.OptionRetention|keyof typeof google.protobuf.FieldOptions.OptionRetention|null); + /** Location path. */ + public path: number[]; - /** FieldOptions target */ - target?: (google.protobuf.FieldOptions.OptionTargetType|keyof typeof google.protobuf.FieldOptions.OptionTargetType|null); + /** 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 { - /** FieldOptions uninterpretedOption */ - uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); + /** GeneratedCodeInfo annotation */ + annotation?: (google.protobuf.GeneratedCodeInfo.IAnnotation[]|null); } - /** Represents a FieldOptions. */ - class FieldOptions implements IFieldOptions { + /** Represents a GeneratedCodeInfo. */ + class GeneratedCodeInfo implements IGeneratedCodeInfo { /** - * Constructs a new FieldOptions. + * Constructs a new GeneratedCodeInfo. * @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 target. */ - public target: (google.protobuf.FieldOptions.OptionTargetType|keyof typeof google.protobuf.FieldOptions.OptionTargetType); + constructor(properties?: google.protobuf.IGeneratedCodeInfo); - /** FieldOptions uninterpretedOption. */ - public uninterpretedOption: google.protobuf.IUninterpretedOption[]; + /** GeneratedCodeInfo annotation. */ + public annotation: google.protobuf.GeneratedCodeInfo.IAnnotation[]; /** - * Creates a new FieldOptions instance using the specified properties. + * Creates a new GeneratedCodeInfo instance using the specified properties. * @param [properties] Properties to set - * @returns FieldOptions instance + * @returns GeneratedCodeInfo instance */ - public static create(properties?: google.protobuf.IFieldOptions): google.protobuf.FieldOptions; + public static create(properties?: google.protobuf.IGeneratedCodeInfo): google.protobuf.GeneratedCodeInfo; /** - * Encodes the specified FieldOptions message. Does not implicitly {@link google.protobuf.FieldOptions.verify|verify} messages. - * @param message FieldOptions message or plain object to encode + * 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.IFieldOptions, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.protobuf.IGeneratedCodeInfo, 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 + * 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.IFieldOptions, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.protobuf.IGeneratedCodeInfo, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a FieldOptions message from the specified reader or buffer. + * 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 FieldOptions + * @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.FieldOptions; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.GeneratedCodeInfo; /** - * Decodes a FieldOptions message from the specified reader or buffer, length delimited. + * Decodes a GeneratedCodeInfo message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns FieldOptions + * @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.FieldOptions; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.GeneratedCodeInfo; /** - * Verifies a FieldOptions message. + * 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 FieldOptions message from a plain object. Also converts values to their respective internal types. + * Creates a GeneratedCodeInfo message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns FieldOptions + * @returns GeneratedCodeInfo */ - public static fromObject(object: { [k: string]: any }): google.protobuf.FieldOptions; + public static fromObject(object: { [k: string]: any }): google.protobuf.GeneratedCodeInfo; /** - * Creates a plain object from a FieldOptions message. Also converts values to other types if specified. - * @param message FieldOptions + * 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.FieldOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.protobuf.GeneratedCodeInfo, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this FieldOptions to JSON. + * Converts this GeneratedCodeInfo to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; /** - * Gets the default type url for FieldOptions + * 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 FieldOptions { + namespace GeneratedCodeInfo { - /** CType enum. */ - enum CType { - STRING = 0, - CORD = 1, - STRING_PIECE = 2 - } + /** Properties of an Annotation. */ + interface IAnnotation { - /** JSType enum. */ - enum JSType { - JS_NORMAL = 0, - JS_STRING = 1, - JS_NUMBER = 2 + /** 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); } - /** OptionRetention enum. */ - enum OptionRetention { - RETENTION_UNKNOWN = 0, - RETENTION_RUNTIME = 1, - RETENTION_SOURCE = 2 + /** 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; } - /** 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 + namespace Annotation { + + /** Semantic enum. */ + enum Semantic { + NONE = 0, + SET = 1, + ALIAS = 2 + } } } - /** Properties of an OneofOptions. */ - interface IOneofOptions { + /** Properties of an Api. */ + interface IApi { + + /** Api name */ + name?: (string|null); + + /** Api methods */ + methods?: (google.protobuf.IMethod[]|null); + + /** Api options */ + options?: (google.protobuf.IOption[]|null); - /** OneofOptions uninterpretedOption */ - uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); + /** Api version */ + version?: (string|null); + + /** Api sourceContext */ + sourceContext?: (google.protobuf.ISourceContext|null); + + /** Api mixins */ + mixins?: (google.protobuf.IMixin[]|null); + + /** Api syntax */ + syntax?: (google.protobuf.Syntax|keyof typeof google.protobuf.Syntax|null); } - /** Represents an OneofOptions. */ - class OneofOptions implements IOneofOptions { + /** Represents an Api. */ + class Api implements IApi { /** - * Constructs a new OneofOptions. + * Constructs a new Api. * @param [properties] Properties to set */ - constructor(properties?: google.protobuf.IOneofOptions); + constructor(properties?: google.protobuf.IApi); - /** OneofOptions uninterpretedOption. */ - public uninterpretedOption: google.protobuf.IUninterpretedOption[]; + /** Api name. */ + public name: string; + + /** Api methods. */ + public methods: google.protobuf.IMethod[]; + + /** Api options. */ + public options: google.protobuf.IOption[]; + + /** Api version. */ + public version: string; + + /** Api sourceContext. */ + public sourceContext?: (google.protobuf.ISourceContext|null); + + /** Api mixins. */ + public mixins: google.protobuf.IMixin[]; + + /** Api syntax. */ + public syntax: (google.protobuf.Syntax|keyof typeof google.protobuf.Syntax); /** - * Creates a new OneofOptions instance using the specified properties. + * Creates a new Api instance using the specified properties. * @param [properties] Properties to set - * @returns OneofOptions instance + * @returns Api instance */ - public static create(properties?: google.protobuf.IOneofOptions): google.protobuf.OneofOptions; + public static create(properties?: google.protobuf.IApi): google.protobuf.Api; /** - * Encodes the specified OneofOptions message. Does not implicitly {@link google.protobuf.OneofOptions.verify|verify} messages. - * @param message OneofOptions message or plain object to encode + * Encodes the specified Api message. Does not implicitly {@link google.protobuf.Api.verify|verify} messages. + * @param message Api 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; + public static encode(message: google.protobuf.IApi, 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 + * Encodes the specified Api message, length delimited. Does not implicitly {@link google.protobuf.Api.verify|verify} messages. + * @param message Api 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; + public static encodeDelimited(message: google.protobuf.IApi, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes an OneofOptions message from the specified reader or buffer. + * Decodes an Api message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns OneofOptions + * @returns Api * @throws {Error} If the payload is not 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; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.Api; /** - * Decodes an OneofOptions message from the specified reader or buffer, length delimited. + * Decodes an Api message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns OneofOptions + * @returns Api * @throws {Error} If the payload 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; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.Api; /** - * Verifies an OneofOptions message. + * Verifies an Api message. * @param message Plain 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. + * Creates an Api message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns OneofOptions + * @returns Api */ - public static fromObject(object: { [k: string]: any }): google.protobuf.OneofOptions; + public static fromObject(object: { [k: string]: any }): google.protobuf.Api; /** - * Creates a plain object from an OneofOptions message. Also converts values to other types if specified. - * @param message OneofOptions + * Creates a plain object from an Api message. Also converts values to other types if specified. + * @param message Api * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.protobuf.OneofOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.protobuf.Api, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this OneofOptions to JSON. + * Converts this Api to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; /** - * Gets the default type url for OneofOptions + * Gets the default type url for Api * @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 { + /** Properties of a Method. */ + interface IMethod { - /** EnumOptions allowAlias */ - allowAlias?: (boolean|null); + /** Method name */ + name?: (string|null); - /** EnumOptions deprecated */ - deprecated?: (boolean|null); + /** Method requestTypeUrl */ + requestTypeUrl?: (string|null); - /** EnumOptions deprecatedLegacyJsonFieldConflicts */ - deprecatedLegacyJsonFieldConflicts?: (boolean|null); + /** Method requestStreaming */ + requestStreaming?: (boolean|null); - /** EnumOptions uninterpretedOption */ - uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); + /** Method responseTypeUrl */ + responseTypeUrl?: (string|null); + + /** Method responseStreaming */ + responseStreaming?: (boolean|null); + + /** Method options */ + options?: (google.protobuf.IOption[]|null); + + /** Method syntax */ + syntax?: (google.protobuf.Syntax|keyof typeof google.protobuf.Syntax|null); } - /** Represents an EnumOptions. */ - class EnumOptions implements IEnumOptions { + /** Represents a Method. */ + class Method implements IMethod { /** - * Constructs a new EnumOptions. + * Constructs a new Method. * @param [properties] Properties to set */ - constructor(properties?: google.protobuf.IEnumOptions); + constructor(properties?: google.protobuf.IMethod); - /** EnumOptions allowAlias. */ - public allowAlias: boolean; + /** Method name. */ + public name: string; - /** EnumOptions deprecated. */ - public deprecated: boolean; + /** Method requestTypeUrl. */ + public requestTypeUrl: string; - /** EnumOptions deprecatedLegacyJsonFieldConflicts. */ - public deprecatedLegacyJsonFieldConflicts: boolean; + /** Method requestStreaming. */ + public requestStreaming: boolean; - /** EnumOptions uninterpretedOption. */ - public uninterpretedOption: google.protobuf.IUninterpretedOption[]; + /** Method responseTypeUrl. */ + public responseTypeUrl: string; + + /** Method responseStreaming. */ + public responseStreaming: boolean; + + /** Method options. */ + public options: google.protobuf.IOption[]; + + /** Method syntax. */ + public syntax: (google.protobuf.Syntax|keyof typeof google.protobuf.Syntax); /** - * Creates a new EnumOptions instance using the specified properties. + * Creates a new Method instance using the specified properties. * @param [properties] Properties to set - * @returns EnumOptions instance + * @returns Method instance */ - public static create(properties?: google.protobuf.IEnumOptions): google.protobuf.EnumOptions; + public static create(properties?: google.protobuf.IMethod): google.protobuf.Method; /** - * Encodes the specified EnumOptions message. Does not implicitly {@link google.protobuf.EnumOptions.verify|verify} messages. - * @param message EnumOptions message or plain object to encode + * Encodes the specified Method message. Does not implicitly {@link google.protobuf.Method.verify|verify} messages. + * @param message Method 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; + public static encode(message: google.protobuf.IMethod, 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 + * Encodes the specified Method message, length delimited. Does not implicitly {@link google.protobuf.Method.verify|verify} messages. + * @param message Method 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; + public static encodeDelimited(message: google.protobuf.IMethod, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes an EnumOptions message from the specified reader or buffer. + * Decodes a Method message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns EnumOptions + * @returns Method * @throws {Error} If the payload is not 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; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.Method; /** - * Decodes an EnumOptions message from the specified reader or buffer, length delimited. + * Decodes a Method message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns EnumOptions + * @returns Method * @throws {Error} If the payload 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; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.Method; /** - * Verifies an EnumOptions message. + * Verifies a Method message. * @param message Plain 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. + * Creates a Method message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns EnumOptions + * @returns Method */ - public static fromObject(object: { [k: string]: any }): google.protobuf.EnumOptions; + public static fromObject(object: { [k: string]: any }): google.protobuf.Method; /** - * Creates a plain object from an EnumOptions message. Also converts values to other types if specified. - * @param message EnumOptions + * Creates a plain object from a Method message. Also converts values to other types if specified. + * @param message Method * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.protobuf.EnumOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.protobuf.Method, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this EnumOptions to JSON. + * Converts this Method to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; /** - * Gets the default type url for EnumOptions + * Gets the default type url for Method * @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 { + /** Properties of a Mixin. */ + interface IMixin { - /** EnumValueOptions deprecated */ - deprecated?: (boolean|null); + /** Mixin name */ + name?: (string|null); - /** EnumValueOptions uninterpretedOption */ - uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); + /** Mixin root */ + root?: (string|null); } - /** Represents an EnumValueOptions. */ - class EnumValueOptions implements IEnumValueOptions { + /** Represents a Mixin. */ + class Mixin implements IMixin { /** - * Constructs a new EnumValueOptions. + * Constructs a new Mixin. * @param [properties] Properties to set */ - constructor(properties?: google.protobuf.IEnumValueOptions); + constructor(properties?: google.protobuf.IMixin); - /** EnumValueOptions deprecated. */ - public deprecated: boolean; + /** Mixin name. */ + public name: string; - /** EnumValueOptions uninterpretedOption. */ - public uninterpretedOption: google.protobuf.IUninterpretedOption[]; + /** Mixin root. */ + public root: string; /** - * Creates a new EnumValueOptions instance using the specified properties. + * Creates a new Mixin instance using the specified properties. * @param [properties] Properties to set - * @returns EnumValueOptions instance + * @returns Mixin instance */ - public static create(properties?: google.protobuf.IEnumValueOptions): google.protobuf.EnumValueOptions; + public static create(properties?: google.protobuf.IMixin): google.protobuf.Mixin; /** - * Encodes the specified EnumValueOptions message. Does not implicitly {@link google.protobuf.EnumValueOptions.verify|verify} messages. - * @param message EnumValueOptions message or plain object to encode + * Encodes the specified Mixin message. Does not implicitly {@link google.protobuf.Mixin.verify|verify} messages. + * @param message Mixin 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; + public static encode(message: google.protobuf.IMixin, 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 + * Encodes the specified Mixin message, length delimited. Does not implicitly {@link google.protobuf.Mixin.verify|verify} messages. + * @param message Mixin 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; + public static encodeDelimited(message: google.protobuf.IMixin, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes an EnumValueOptions message from the specified reader or buffer. + * Decodes a Mixin message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns EnumValueOptions + * @returns Mixin * @throws {Error} If the payload is not 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; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.Mixin; /** - * Decodes an EnumValueOptions message from the specified reader or buffer, length delimited. + * Decodes a Mixin message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns EnumValueOptions + * @returns Mixin * @throws {Error} If the payload 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; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.Mixin; /** - * Verifies an EnumValueOptions message. + * Verifies a Mixin message. * @param message Plain 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. + * Creates a Mixin message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns EnumValueOptions + * @returns Mixin */ - public static fromObject(object: { [k: string]: any }): google.protobuf.EnumValueOptions; + public static fromObject(object: { [k: string]: any }): google.protobuf.Mixin; /** - * Creates a plain object from an EnumValueOptions message. Also converts values to other types if specified. - * @param message EnumValueOptions + * Creates a plain object from a Mixin message. Also converts values to other types if specified. + * @param message Mixin * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.protobuf.EnumValueOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.protobuf.Mixin, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this EnumValueOptions to JSON. + * Converts this Mixin to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; /** - * Gets the default type url for EnumValueOptions + * Gets the default type url for Mixin * @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 deprecated */ - deprecated?: (boolean|null); - - /** ServiceOptions uninterpretedOption */ - uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); - - /** ServiceOptions .google.api.defaultHost */ - ".google.api.defaultHost"?: (string|null); + /** Properties of a SourceContext. */ + interface ISourceContext { - /** ServiceOptions .google.api.oauthScopes */ - ".google.api.oauthScopes"?: (string|null); + /** SourceContext fileName */ + fileName?: (string|null); } - /** Represents a ServiceOptions. */ - class ServiceOptions implements IServiceOptions { + /** Represents a SourceContext. */ + class SourceContext implements ISourceContext { /** - * Constructs a new ServiceOptions. + * Constructs a new SourceContext. * @param [properties] Properties to set */ - constructor(properties?: google.protobuf.IServiceOptions); - - /** ServiceOptions deprecated. */ - public deprecated: boolean; + constructor(properties?: google.protobuf.ISourceContext); - /** ServiceOptions uninterpretedOption. */ - public uninterpretedOption: google.protobuf.IUninterpretedOption[]; + /** SourceContext fileName. */ + public fileName: string; /** - * Creates a new ServiceOptions instance using the specified properties. + * Creates a new SourceContext instance using the specified properties. * @param [properties] Properties to set - * @returns ServiceOptions instance + * @returns SourceContext instance */ - public static create(properties?: google.protobuf.IServiceOptions): google.protobuf.ServiceOptions; + public static create(properties?: google.protobuf.ISourceContext): google.protobuf.SourceContext; /** - * Encodes the specified ServiceOptions message. Does not implicitly {@link google.protobuf.ServiceOptions.verify|verify} messages. - * @param message ServiceOptions message or plain object to encode + * Encodes the specified SourceContext message. Does not implicitly {@link google.protobuf.SourceContext.verify|verify} messages. + * @param message SourceContext 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; + public static encode(message: google.protobuf.ISourceContext, 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 + * Encodes the specified SourceContext message, length delimited. Does not implicitly {@link google.protobuf.SourceContext.verify|verify} messages. + * @param message SourceContext 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; + public static encodeDelimited(message: google.protobuf.ISourceContext, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a ServiceOptions message from the specified reader or buffer. + * Decodes a SourceContext message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns ServiceOptions + * @returns SourceContext * @throws {Error} If the payload is not 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; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.SourceContext; /** - * Decodes a ServiceOptions message from the specified reader or buffer, length delimited. + * Decodes a SourceContext message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns ServiceOptions + * @returns SourceContext * @throws {Error} If the payload 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; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.SourceContext; /** - * Verifies a ServiceOptions message. + * Verifies a SourceContext message. * @param message Plain object 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. + * Creates a SourceContext message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns ServiceOptions + * @returns SourceContext */ - public static fromObject(object: { [k: string]: any }): google.protobuf.ServiceOptions; + public static fromObject(object: { [k: string]: any }): google.protobuf.SourceContext; /** - * Creates a plain object from a ServiceOptions message. Also converts values to other types if specified. - * @param message ServiceOptions + * Creates a plain object from a SourceContext message. Also converts values to other types if specified. + * @param message SourceContext * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.protobuf.ServiceOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.protobuf.SourceContext, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this ServiceOptions to JSON. + * Converts this SourceContext to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; /** - * Gets the default type url for ServiceOptions + * Gets the default type url for SourceContext * @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 { + /** Properties of a Type. */ + interface IType { - /** MethodOptions deprecated */ - deprecated?: (boolean|null); + /** Type name */ + name?: (string|null); - /** MethodOptions idempotencyLevel */ - idempotencyLevel?: (google.protobuf.MethodOptions.IdempotencyLevel|keyof typeof google.protobuf.MethodOptions.IdempotencyLevel|null); + /** Type fields */ + fields?: (google.protobuf.IField[]|null); - /** MethodOptions uninterpretedOption */ - uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); + /** Type oneofs */ + oneofs?: (string[]|null); - /** MethodOptions .google.api.http */ - ".google.api.http"?: (google.api.IHttpRule|null); + /** Type options */ + options?: (google.protobuf.IOption[]|null); - /** MethodOptions .google.api.methodSignature */ - ".google.api.methodSignature"?: (string[]|null); + /** Type sourceContext */ + sourceContext?: (google.protobuf.ISourceContext|null); - /** MethodOptions .google.longrunning.operationInfo */ - ".google.longrunning.operationInfo"?: (google.longrunning.IOperationInfo|null); + /** Type syntax */ + syntax?: (google.protobuf.Syntax|keyof typeof google.protobuf.Syntax|null); } - /** Represents a MethodOptions. */ - class MethodOptions implements IMethodOptions { + /** Represents a Type. */ + class Type implements IType { /** - * Constructs a new MethodOptions. + * Constructs a new Type. * @param [properties] Properties to set */ - constructor(properties?: google.protobuf.IMethodOptions); + constructor(properties?: google.protobuf.IType); - /** MethodOptions deprecated. */ - public deprecated: boolean; + /** Type name. */ + public name: string; - /** MethodOptions idempotencyLevel. */ - public idempotencyLevel: (google.protobuf.MethodOptions.IdempotencyLevel|keyof typeof google.protobuf.MethodOptions.IdempotencyLevel); + /** Type fields. */ + public fields: google.protobuf.IField[]; - /** MethodOptions uninterpretedOption. */ - public uninterpretedOption: google.protobuf.IUninterpretedOption[]; + /** Type oneofs. */ + public oneofs: string[]; + + /** Type options. */ + public options: google.protobuf.IOption[]; + + /** Type sourceContext. */ + public sourceContext?: (google.protobuf.ISourceContext|null); + + /** Type syntax. */ + public syntax: (google.protobuf.Syntax|keyof typeof google.protobuf.Syntax); /** - * Creates a new MethodOptions instance using the specified properties. + * Creates a new Type instance using the specified properties. * @param [properties] Properties to set - * @returns MethodOptions instance + * @returns Type instance */ - public static create(properties?: google.protobuf.IMethodOptions): google.protobuf.MethodOptions; + public static create(properties?: google.protobuf.IType): google.protobuf.Type; /** - * Encodes the specified MethodOptions message. Does not implicitly {@link google.protobuf.MethodOptions.verify|verify} messages. - * @param message MethodOptions message or plain object to encode + * Encodes the specified Type message. Does not implicitly {@link google.protobuf.Type.verify|verify} messages. + * @param message Type 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; + public static encode(message: google.protobuf.IType, 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 + * Encodes the specified Type message, length delimited. Does not implicitly {@link google.protobuf.Type.verify|verify} messages. + * @param message Type 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; + public static encodeDelimited(message: google.protobuf.IType, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a MethodOptions message from the specified reader or buffer. + * Decodes a Type message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns MethodOptions + * @returns Type * @throws {Error} If the payload is not 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; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.Type; /** - * Decodes a MethodOptions message from the specified reader or buffer, length delimited. + * Decodes a Type message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns MethodOptions + * @returns Type * @throws {Error} If the payload 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; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.Type; /** - * Verifies a MethodOptions message. + * Verifies a Type message. * @param message Plain object 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. + * Creates a Type message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns MethodOptions + * @returns Type */ - public static fromObject(object: { [k: string]: any }): google.protobuf.MethodOptions; + public static fromObject(object: { [k: string]: any }): google.protobuf.Type; /** - * Creates a plain object from a MethodOptions message. Also converts values to other types if specified. - * @param message MethodOptions + * Creates a plain object from a Type message. Also converts values to other types if specified. + * @param message Type * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.protobuf.MethodOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.protobuf.Type, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this MethodOptions to JSON. + * Converts this Type to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; /** - * Gets the default type url for MethodOptions + * Gets the default type url for Type * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns The default type url */ public static getTypeUrl(typeUrlPrefix?: string): string; } - namespace MethodOptions { + /** Properties of a Field. */ + interface IField { - /** IdempotencyLevel enum. */ - enum IdempotencyLevel { - IDEMPOTENCY_UNKNOWN = 0, - NO_SIDE_EFFECTS = 1, - IDEMPOTENT = 2 - } - } + /** Field kind */ + kind?: (google.protobuf.Field.Kind|keyof typeof google.protobuf.Field.Kind|null); - /** Properties of an UninterpretedOption. */ - interface IUninterpretedOption { + /** Field cardinality */ + cardinality?: (google.protobuf.Field.Cardinality|keyof typeof google.protobuf.Field.Cardinality|null); - /** UninterpretedOption name */ - name?: (google.protobuf.UninterpretedOption.INamePart[]|null); + /** Field number */ + number?: (number|null); - /** UninterpretedOption identifierValue */ - identifierValue?: (string|null); + /** Field name */ + name?: (string|null); - /** UninterpretedOption positiveIntValue */ - positiveIntValue?: (number|Long|string|null); + /** Field typeUrl */ + typeUrl?: (string|null); - /** UninterpretedOption negativeIntValue */ - negativeIntValue?: (number|Long|string|null); + /** Field oneofIndex */ + oneofIndex?: (number|null); - /** UninterpretedOption doubleValue */ - doubleValue?: (number|null); + /** Field packed */ + packed?: (boolean|null); - /** UninterpretedOption stringValue */ - stringValue?: (Uint8Array|string|null); + /** Field options */ + options?: (google.protobuf.IOption[]|null); - /** UninterpretedOption aggregateValue */ - aggregateValue?: (string|null); + /** Field jsonName */ + jsonName?: (string|null); + + /** Field defaultValue */ + defaultValue?: (string|null); } - /** Represents an UninterpretedOption. */ - class UninterpretedOption implements IUninterpretedOption { + /** Represents a Field. */ + class Field implements IField { /** - * Constructs a new UninterpretedOption. + * Constructs a new Field. * @param [properties] Properties to set */ - constructor(properties?: google.protobuf.IUninterpretedOption); + constructor(properties?: google.protobuf.IField); - /** UninterpretedOption name. */ - public name: google.protobuf.UninterpretedOption.INamePart[]; + /** Field kind. */ + public kind: (google.protobuf.Field.Kind|keyof typeof google.protobuf.Field.Kind); - /** UninterpretedOption identifierValue. */ - public identifierValue: string; + /** Field cardinality. */ + public cardinality: (google.protobuf.Field.Cardinality|keyof typeof google.protobuf.Field.Cardinality); - /** UninterpretedOption positiveIntValue. */ - public positiveIntValue: (number|Long|string); + /** Field number. */ + public number: number; - /** UninterpretedOption negativeIntValue. */ - public negativeIntValue: (number|Long|string); + /** Field name. */ + public name: string; - /** UninterpretedOption doubleValue. */ - public doubleValue: number; + /** Field typeUrl. */ + public typeUrl: string; - /** UninterpretedOption stringValue. */ - public stringValue: (Uint8Array|string); + /** Field oneofIndex. */ + public oneofIndex: number; - /** UninterpretedOption aggregateValue. */ - public aggregateValue: string; + /** Field packed. */ + public packed: boolean; + + /** Field options. */ + public options: google.protobuf.IOption[]; + + /** Field jsonName. */ + public jsonName: string; + + /** Field defaultValue. */ + public defaultValue: string; /** - * Creates a new UninterpretedOption instance using the specified properties. + * Creates a new Field instance using the specified properties. * @param [properties] Properties to set - * @returns UninterpretedOption instance + * @returns Field instance */ - public static create(properties?: google.protobuf.IUninterpretedOption): google.protobuf.UninterpretedOption; + public static create(properties?: google.protobuf.IField): google.protobuf.Field; /** - * Encodes the specified UninterpretedOption message. Does not implicitly {@link google.protobuf.UninterpretedOption.verify|verify} messages. - * @param message UninterpretedOption message or plain object to encode + * Encodes the specified Field message. Does not implicitly {@link google.protobuf.Field.verify|verify} messages. + * @param message Field 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; + public static encode(message: google.protobuf.IField, 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 + * Encodes the specified Field message, length delimited. Does not implicitly {@link google.protobuf.Field.verify|verify} messages. + * @param message Field 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; + public static encodeDelimited(message: google.protobuf.IField, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes an UninterpretedOption message from the specified reader or buffer. + * Decodes a Field message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns UninterpretedOption + * @returns Field * @throws {Error} If the payload is not 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; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.Field; /** - * Decodes an UninterpretedOption message from the specified reader or buffer, length delimited. + * Decodes a Field message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns UninterpretedOption + * @returns Field * @throws {Error} If the payload 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; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.Field; /** - * Verifies an UninterpretedOption message. + * Verifies a Field message. * @param message Plain 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. + * Creates a Field message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns UninterpretedOption + * @returns Field */ - public static fromObject(object: { [k: string]: any }): google.protobuf.UninterpretedOption; + public static fromObject(object: { [k: string]: any }): google.protobuf.Field; /** - * Creates a plain object from an UninterpretedOption message. Also converts values to other types if specified. - * @param message UninterpretedOption + * Creates a plain object from a Field message. Also converts values to other types if specified. + * @param message Field * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.protobuf.UninterpretedOption, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.protobuf.Field, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this UninterpretedOption to JSON. + * Converts this Field to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; /** - * Gets the default type url for UninterpretedOption + * Gets the default type url for Field * @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; + namespace Field { - /** NamePart isExtension */ - isExtension: boolean; + /** Kind enum. */ + enum Kind { + TYPE_UNKNOWN = 0, + 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 } - /** 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); + /** Cardinality enum. */ + enum Cardinality { + CARDINALITY_UNKNOWN = 0, + CARDINALITY_OPTIONAL = 1, + CARDINALITY_REQUIRED = 2, + CARDINALITY_REPEATED = 3 + } + } - /** - * 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; + /** Properties of an Enum. */ + interface IEnum { - /** - * 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 }; + /** Enum name */ + name?: (string|null); - /** - * Converts this NamePart to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; + /** Enum enumvalue */ + enumvalue?: (google.protobuf.IEnumValue[]|null); - /** - * 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; - } - } + /** Enum options */ + options?: (google.protobuf.IOption[]|null); - /** Properties of a SourceCodeInfo. */ - interface ISourceCodeInfo { + /** Enum sourceContext */ + sourceContext?: (google.protobuf.ISourceContext|null); - /** SourceCodeInfo location */ - location?: (google.protobuf.SourceCodeInfo.ILocation[]|null); + /** Enum syntax */ + syntax?: (google.protobuf.Syntax|keyof typeof google.protobuf.Syntax|null); } - /** Represents a SourceCodeInfo. */ - class SourceCodeInfo implements ISourceCodeInfo { + /** Represents an Enum. */ + class Enum implements IEnum { /** - * Constructs a new SourceCodeInfo. + * Constructs a new Enum. * @param [properties] Properties to set */ - constructor(properties?: google.protobuf.ISourceCodeInfo); + constructor(properties?: google.protobuf.IEnum); + + /** Enum name. */ + public name: string; + + /** Enum enumvalue. */ + public enumvalue: google.protobuf.IEnumValue[]; + + /** Enum options. */ + public options: google.protobuf.IOption[]; - /** SourceCodeInfo location. */ - public location: google.protobuf.SourceCodeInfo.ILocation[]; + /** Enum sourceContext. */ + public sourceContext?: (google.protobuf.ISourceContext|null); + + /** Enum syntax. */ + public syntax: (google.protobuf.Syntax|keyof typeof google.protobuf.Syntax); /** - * Creates a new SourceCodeInfo instance using the specified properties. + * Creates a new Enum instance using the specified properties. * @param [properties] Properties to set - * @returns SourceCodeInfo instance + * @returns Enum instance */ - public static create(properties?: google.protobuf.ISourceCodeInfo): google.protobuf.SourceCodeInfo; + public static create(properties?: google.protobuf.IEnum): google.protobuf.Enum; /** - * Encodes the specified SourceCodeInfo message. Does not implicitly {@link google.protobuf.SourceCodeInfo.verify|verify} messages. - * @param message SourceCodeInfo message or plain object to encode + * Encodes the specified Enum message. Does not implicitly {@link google.protobuf.Enum.verify|verify} messages. + * @param message Enum 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; + public static encode(message: google.protobuf.IEnum, 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 + * Encodes the specified Enum message, length delimited. Does not implicitly {@link google.protobuf.Enum.verify|verify} messages. + * @param message Enum 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; + public static encodeDelimited(message: google.protobuf.IEnum, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a SourceCodeInfo message from the specified reader or buffer. + * Decodes an Enum message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns SourceCodeInfo + * @returns Enum * @throws {Error} If the payload is not 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; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.Enum; /** - * Decodes a SourceCodeInfo message from the specified reader or buffer, length delimited. + * Decodes an Enum message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns SourceCodeInfo + * @returns Enum * @throws {Error} If the payload 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; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.Enum; /** - * Verifies a SourceCodeInfo message. + * Verifies an Enum message. * @param message Plain object 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. + * Creates an Enum message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns SourceCodeInfo + * @returns Enum */ - public static fromObject(object: { [k: string]: any }): google.protobuf.SourceCodeInfo; + public static fromObject(object: { [k: string]: any }): google.protobuf.Enum; /** - * Creates a plain object from a SourceCodeInfo message. Also converts values to other types if specified. - * @param message SourceCodeInfo + * Creates a plain object from an Enum message. Also converts values to other types if specified. + * @param message Enum * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.protobuf.SourceCodeInfo, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.protobuf.Enum, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this SourceCodeInfo to JSON. + * Converts this Enum to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; /** - * Gets the default type url for SourceCodeInfo + * Gets the default type url for Enum * @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); + /** Properties of an EnumValue. */ + interface IEnumValue { - /** Location leadingDetachedComments */ - leadingDetachedComments?: (string[]|null); - } + /** EnumValue name */ + name?: (string|null); - /** Represents a Location. */ - class Location implements ILocation { + /** EnumValue number */ + number?: (number|null); - /** - * Constructs a new Location. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.SourceCodeInfo.ILocation); + /** EnumValue options */ + options?: (google.protobuf.IOption[]|null); + } - /** Location path. */ - public path: number[]; + /** Represents an EnumValue. */ + class EnumValue implements IEnumValue { - /** Location span. */ - public span: number[]; + /** + * Constructs a new EnumValue. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IEnumValue); - /** Location leadingComments. */ - public leadingComments: string; + /** EnumValue name. */ + public name: string; - /** Location trailingComments. */ - public trailingComments: string; + /** EnumValue number. */ + public number: number; - /** Location leadingDetachedComments. */ - public leadingDetachedComments: string[]; + /** EnumValue options. */ + public options: google.protobuf.IOption[]; - /** - * 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; + /** + * Creates a new EnumValue instance using the specified properties. + * @param [properties] Properties to set + * @returns EnumValue instance + */ + public static create(properties?: google.protobuf.IEnumValue): google.protobuf.EnumValue; - /** - * 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 EnumValue message. Does not implicitly {@link google.protobuf.EnumValue.verify|verify} messages. + * @param message EnumValue message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IEnumValue, 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; + /** + * Encodes the specified EnumValue message, length delimited. Does not implicitly {@link google.protobuf.EnumValue.verify|verify} messages. + * @param message EnumValue message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IEnumValue, 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 an EnumValue message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns EnumValue + * @throws {Error} If the payload is not 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.EnumValue; - /** - * 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; + /** + * Decodes an EnumValue message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns EnumValue + * @throws {Error} If the payload 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.EnumValue; - /** - * 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); + /** + * Verifies an EnumValue message. + * @param message Plain object 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 an EnumValue message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns EnumValue + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.EnumValue; - /** - * 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 }; + /** + * Creates a plain object from an EnumValue message. Also converts values to other types if specified. + * @param message EnumValue + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.EnumValue, options?: $protobuf.IConversionOptions): { [k: string]: any }; - /** - * Converts this Location to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; + /** + * Converts this EnumValue 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; - } + /** + * Gets the default type url for EnumValue + * @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 { + /** Properties of an Option. */ + interface IOption { - /** GeneratedCodeInfo annotation */ - annotation?: (google.protobuf.GeneratedCodeInfo.IAnnotation[]|null); + /** Option name */ + name?: (string|null); + + /** Option value */ + value?: (google.protobuf.IAny|null); } - /** Represents a GeneratedCodeInfo. */ - class GeneratedCodeInfo implements IGeneratedCodeInfo { + /** Represents an Option. */ + class Option implements IOption { /** - * Constructs a new GeneratedCodeInfo. + * Constructs a new Option. * @param [properties] Properties to set */ - constructor(properties?: google.protobuf.IGeneratedCodeInfo); + constructor(properties?: google.protobuf.IOption); - /** GeneratedCodeInfo annotation. */ - public annotation: google.protobuf.GeneratedCodeInfo.IAnnotation[]; + /** Option name. */ + public name: string; + + /** Option value. */ + public value?: (google.protobuf.IAny|null); /** - * Creates a new GeneratedCodeInfo instance using the specified properties. + * Creates a new Option instance using the specified properties. * @param [properties] Properties to set - * @returns GeneratedCodeInfo instance + * @returns Option instance */ - public static create(properties?: google.protobuf.IGeneratedCodeInfo): google.protobuf.GeneratedCodeInfo; + public static create(properties?: google.protobuf.IOption): google.protobuf.Option; /** - * Encodes the specified GeneratedCodeInfo message. Does not implicitly {@link google.protobuf.GeneratedCodeInfo.verify|verify} messages. - * @param message GeneratedCodeInfo message or plain object to encode + * Encodes the specified Option message. Does not implicitly {@link google.protobuf.Option.verify|verify} messages. + * @param message Option 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; + public static encode(message: google.protobuf.IOption, 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 + * Encodes the specified Option message, length delimited. Does not implicitly {@link google.protobuf.Option.verify|verify} messages. + * @param message Option 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; + public static encodeDelimited(message: google.protobuf.IOption, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a GeneratedCodeInfo message from the specified reader or buffer. + * Decodes an Option message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns GeneratedCodeInfo + * @returns Option * @throws {Error} If the payload is not 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; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.Option; /** - * Decodes a GeneratedCodeInfo message from the specified reader or buffer, length delimited. + * Decodes an Option message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns GeneratedCodeInfo + * @returns Option * @throws {Error} If the payload 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; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.Option; /** - * Verifies a GeneratedCodeInfo message. + * Verifies an Option message. * @param message Plain object 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. + * Creates an Option message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns GeneratedCodeInfo + * @returns Option */ - public static fromObject(object: { [k: string]: any }): google.protobuf.GeneratedCodeInfo; + public static fromObject(object: { [k: string]: any }): google.protobuf.Option; /** - * Creates a plain object from a GeneratedCodeInfo message. Also converts values to other types if specified. - * @param message GeneratedCodeInfo + * Creates a plain object from an Option message. Also converts values to other types if specified. + * @param message Option * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.protobuf.GeneratedCodeInfo, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.protobuf.Option, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this GeneratedCodeInfo to JSON. + * Converts this Option to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; /** - * Gets the default type url for GeneratedCodeInfo + * Gets the default type url for Option * @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); + /** Syntax enum. */ + enum Syntax { + SYNTAX_PROTO2 = 0, + SYNTAX_PROTO3 = 1 + } - /** Annotation path. */ - public path: number[]; + /** Properties of an Any. */ + interface IAny { - /** Annotation sourceFile. */ - public sourceFile: string; + /** Any type_url */ + type_url?: (string|null); - /** Annotation begin. */ - public begin: number; + /** Any value */ + value?: (Uint8Array|string|null); + } - /** Annotation end. */ - public end: number; + /** Represents an Any. */ + class Any implements IAny { - /** Annotation semantic. */ - public semantic: (google.protobuf.GeneratedCodeInfo.Annotation.Semantic|keyof typeof google.protobuf.GeneratedCodeInfo.Annotation.Semantic); + /** + * Constructs a new Any. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IAny); - /** - * 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; + /** Any type_url. */ + public type_url: string; - /** - * 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; + /** Any value. */ + public value: (Uint8Array|string); - /** - * 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; + /** + * 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; - /** - * 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; + /** + * 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; - /** - * 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; + /** + * 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; - /** - * 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); + /** + * 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; - /** - * 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; + /** + * 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; - /** - * 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 }; + /** + * 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); - /** - * Converts this Annotation to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; + /** + * 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; - /** - * 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; - } + /** + * 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 }; - namespace Annotation { + /** + * Converts this Any to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; - /** Semantic enum. */ - enum Semantic { - NONE = 0, - SET = 1, - ALIAS = 2 - } - } + /** + * 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 a Duration. */ @@ -7533,6 +7545,9 @@ export namespace google { /** ConsumerQuotaLimit quotaBuckets */ quotaBuckets?: (google.api.serviceusage.v1beta1.IQuotaBucket[]|null); + + /** ConsumerQuotaLimit supportedLocations */ + supportedLocations?: (string[]|null); } /** Represents a ConsumerQuotaLimit. */ @@ -7562,6 +7577,9 @@ export namespace google { /** ConsumerQuotaLimit quotaBuckets. */ public quotaBuckets: google.api.serviceusage.v1beta1.IQuotaBucket[]; + /** ConsumerQuotaLimit supportedLocations. */ + public supportedLocations: string[]; + /** * Creates a new ConsumerQuotaLimit instance using the specified properties. * @param [properties] Properties to set @@ -7665,6 +7683,9 @@ export namespace google { /** QuotaBucket adminOverride */ adminOverride?: (google.api.serviceusage.v1beta1.IQuotaOverride|null); + /** QuotaBucket producerQuotaPolicy */ + producerQuotaPolicy?: (google.api.serviceusage.v1beta1.IProducerQuotaPolicy|null); + /** QuotaBucket dimensions */ dimensions?: ({ [k: string]: string }|null); } @@ -7693,6 +7714,9 @@ export namespace google { /** QuotaBucket adminOverride. */ public adminOverride?: (google.api.serviceusage.v1beta1.IQuotaOverride|null); + /** QuotaBucket producerQuotaPolicy. */ + public producerQuotaPolicy?: (google.api.serviceusage.v1beta1.IProducerQuotaPolicy|null); + /** QuotaBucket dimensions. */ public dimensions: { [k: string]: string }; @@ -8005,6 +8029,133 @@ export namespace google { LIMIT_DECREASE_PERCENTAGE_TOO_HIGH = 2 } + /** Properties of a ProducerQuotaPolicy. */ + interface IProducerQuotaPolicy { + + /** ProducerQuotaPolicy name */ + name?: (string|null); + + /** ProducerQuotaPolicy policyValue */ + policyValue?: (number|Long|string|null); + + /** ProducerQuotaPolicy dimensions */ + dimensions?: ({ [k: string]: string }|null); + + /** ProducerQuotaPolicy metric */ + metric?: (string|null); + + /** ProducerQuotaPolicy unit */ + unit?: (string|null); + + /** ProducerQuotaPolicy container */ + container?: (string|null); + } + + /** Represents a ProducerQuotaPolicy. */ + class ProducerQuotaPolicy implements IProducerQuotaPolicy { + + /** + * Constructs a new ProducerQuotaPolicy. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.serviceusage.v1beta1.IProducerQuotaPolicy); + + /** ProducerQuotaPolicy name. */ + public name: string; + + /** ProducerQuotaPolicy policyValue. */ + public policyValue: (number|Long|string); + + /** ProducerQuotaPolicy dimensions. */ + public dimensions: { [k: string]: string }; + + /** ProducerQuotaPolicy metric. */ + public metric: string; + + /** ProducerQuotaPolicy unit. */ + public unit: string; + + /** ProducerQuotaPolicy container. */ + public container: string; + + /** + * Creates a new ProducerQuotaPolicy instance using the specified properties. + * @param [properties] Properties to set + * @returns ProducerQuotaPolicy instance + */ + public static create(properties?: google.api.serviceusage.v1beta1.IProducerQuotaPolicy): google.api.serviceusage.v1beta1.ProducerQuotaPolicy; + + /** + * Encodes the specified ProducerQuotaPolicy message. Does not implicitly {@link google.api.serviceusage.v1beta1.ProducerQuotaPolicy.verify|verify} messages. + * @param message ProducerQuotaPolicy message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.api.serviceusage.v1beta1.IProducerQuotaPolicy, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ProducerQuotaPolicy message, length delimited. Does not implicitly {@link google.api.serviceusage.v1beta1.ProducerQuotaPolicy.verify|verify} messages. + * @param message ProducerQuotaPolicy message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.api.serviceusage.v1beta1.IProducerQuotaPolicy, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ProducerQuotaPolicy message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ProducerQuotaPolicy + * @throws {Error} If the payload is not 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.serviceusage.v1beta1.ProducerQuotaPolicy; + + /** + * Decodes a ProducerQuotaPolicy message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ProducerQuotaPolicy + * @throws {Error} If the payload 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.serviceusage.v1beta1.ProducerQuotaPolicy; + + /** + * Verifies a ProducerQuotaPolicy message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ProducerQuotaPolicy message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ProducerQuotaPolicy + */ + public static fromObject(object: { [k: string]: any }): google.api.serviceusage.v1beta1.ProducerQuotaPolicy; + + /** + * Creates a plain object from a ProducerQuotaPolicy message. Also converts values to other types if specified. + * @param message ProducerQuotaPolicy + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.api.serviceusage.v1beta1.ProducerQuotaPolicy, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ProducerQuotaPolicy to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ProducerQuotaPolicy + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + /** Properties of an AdminQuotaPolicy. */ interface IAdminQuotaPolicy { @@ -14530,6 +14681,258 @@ export namespace google { public static getTypeUrl(typeUrlPrefix?: string): string; } + /** 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; + } + /** Properties of a Usage. */ interface IUsage { @@ -16537,6 +16940,18 @@ export namespace google { GITHUB = 10, PACKAGE_MANAGER = 20 } + + /** 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 + } } /** Namespace longrunning. */ diff --git a/packages/google-api-serviceusage/protos/protos.js b/packages/google-api-serviceusage/protos/protos.js index b9e77af6435..5596039b721 100644 --- a/packages/google-api-serviceusage/protos/protos.js +++ b/packages/google-api-serviceusage/protos/protos.js @@ -921,33 +921,25 @@ return ListValue; })(); - protobuf.Api = (function() { + protobuf.FileDescriptorSet = (function() { /** - * Properties of an Api. + * Properties of a FileDescriptorSet. * @memberof google.protobuf - * @interface IApi - * @property {string|null} [name] Api name - * @property {Array.|null} [methods] Api methods - * @property {Array.|null} [options] Api options - * @property {string|null} [version] Api version - * @property {google.protobuf.ISourceContext|null} [sourceContext] Api sourceContext - * @property {Array.|null} [mixins] Api mixins - * @property {google.protobuf.Syntax|null} [syntax] Api syntax + * @interface IFileDescriptorSet + * @property {Array.|null} [file] FileDescriptorSet file */ /** - * Constructs a new Api. + * Constructs a new FileDescriptorSet. * @memberof google.protobuf - * @classdesc Represents an Api. - * @implements IApi + * @classdesc Represents a FileDescriptorSet. + * @implements IFileDescriptorSet * @constructor - * @param {google.protobuf.IApi=} [properties] Properties to set + * @param {google.protobuf.IFileDescriptorSet=} [properties] Properties to set */ - function Api(properties) { - this.methods = []; - this.options = []; - this.mixins = []; + function FileDescriptorSet(properties) { + this.file = []; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -955,168 +947,78 @@ } /** - * Api name. - * @member {string} name - * @memberof google.protobuf.Api - * @instance - */ - Api.prototype.name = ""; - - /** - * Api methods. - * @member {Array.} methods - * @memberof google.protobuf.Api - * @instance - */ - Api.prototype.methods = $util.emptyArray; - - /** - * Api options. - * @member {Array.} options - * @memberof google.protobuf.Api - * @instance - */ - Api.prototype.options = $util.emptyArray; - - /** - * Api version. - * @member {string} version - * @memberof google.protobuf.Api - * @instance - */ - Api.prototype.version = ""; - - /** - * Api sourceContext. - * @member {google.protobuf.ISourceContext|null|undefined} sourceContext - * @memberof google.protobuf.Api - * @instance - */ - Api.prototype.sourceContext = null; - - /** - * Api mixins. - * @member {Array.} mixins - * @memberof google.protobuf.Api - * @instance - */ - Api.prototype.mixins = $util.emptyArray; - - /** - * Api syntax. - * @member {google.protobuf.Syntax} syntax - * @memberof google.protobuf.Api + * FileDescriptorSet file. + * @member {Array.} file + * @memberof google.protobuf.FileDescriptorSet * @instance */ - Api.prototype.syntax = 0; + FileDescriptorSet.prototype.file = $util.emptyArray; /** - * Creates a new Api instance using the specified properties. + * Creates a new FileDescriptorSet instance using the specified properties. * @function create - * @memberof google.protobuf.Api + * @memberof google.protobuf.FileDescriptorSet * @static - * @param {google.protobuf.IApi=} [properties] Properties to set - * @returns {google.protobuf.Api} Api instance + * @param {google.protobuf.IFileDescriptorSet=} [properties] Properties to set + * @returns {google.protobuf.FileDescriptorSet} FileDescriptorSet instance */ - Api.create = function create(properties) { - return new Api(properties); + FileDescriptorSet.create = function create(properties) { + return new FileDescriptorSet(properties); }; /** - * Encodes the specified Api message. Does not implicitly {@link google.protobuf.Api.verify|verify} messages. + * Encodes the specified FileDescriptorSet message. Does not implicitly {@link google.protobuf.FileDescriptorSet.verify|verify} messages. * @function encode - * @memberof google.protobuf.Api + * @memberof google.protobuf.FileDescriptorSet * @static - * @param {google.protobuf.IApi} message Api message or plain object to encode + * @param {google.protobuf.IFileDescriptorSet} message FileDescriptorSet message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - Api.encode = function encode(message, writer) { + FileDescriptorSet.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.methods != null && message.methods.length) - for (var i = 0; i < message.methods.length; ++i) - $root.google.protobuf.Method.encode(message.methods[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.options != null && message.options.length) - for (var i = 0; i < message.options.length; ++i) - $root.google.protobuf.Option.encode(message.options[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - if (message.version != null && Object.hasOwnProperty.call(message, "version")) - writer.uint32(/* id 4, wireType 2 =*/34).string(message.version); - if (message.sourceContext != null && Object.hasOwnProperty.call(message, "sourceContext")) - $root.google.protobuf.SourceContext.encode(message.sourceContext, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); - if (message.mixins != null && message.mixins.length) - for (var i = 0; i < message.mixins.length; ++i) - $root.google.protobuf.Mixin.encode(message.mixins[i], writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); - if (message.syntax != null && Object.hasOwnProperty.call(message, "syntax")) - writer.uint32(/* id 7, wireType 0 =*/56).int32(message.syntax); + 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 Api message, length delimited. Does not implicitly {@link google.protobuf.Api.verify|verify} messages. + * Encodes the specified FileDescriptorSet message, length delimited. Does not implicitly {@link google.protobuf.FileDescriptorSet.verify|verify} messages. * @function encodeDelimited - * @memberof google.protobuf.Api + * @memberof google.protobuf.FileDescriptorSet * @static - * @param {google.protobuf.IApi} message Api message or plain object to encode + * @param {google.protobuf.IFileDescriptorSet} message FileDescriptorSet message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - Api.encodeDelimited = function encodeDelimited(message, writer) { + FileDescriptorSet.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes an Api message from the specified reader or buffer. + * Decodes a FileDescriptorSet message from the specified reader or buffer. * @function decode - * @memberof google.protobuf.Api + * @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.Api} Api + * @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 */ - Api.decode = function decode(reader, length) { + FileDescriptorSet.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.Api(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.FileDescriptorSet(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: { - message.name = reader.string(); - break; - } - case 2: { - if (!(message.methods && message.methods.length)) - message.methods = []; - message.methods.push($root.google.protobuf.Method.decode(reader, reader.uint32())); - break; - } - case 3: { - if (!(message.options && message.options.length)) - message.options = []; - message.options.push($root.google.protobuf.Option.decode(reader, reader.uint32())); - break; - } - case 4: { - message.version = reader.string(); - break; - } - case 5: { - message.sourceContext = $root.google.protobuf.SourceContext.decode(reader, reader.uint32()); - break; - } - case 6: { - if (!(message.mixins && message.mixins.length)) - message.mixins = []; - message.mixins.push($root.google.protobuf.Mixin.decode(reader, reader.uint32())); - break; - } - case 7: { - message.syntax = reader.int32(); + if (!(message.file && message.file.length)) + message.file = []; + message.file.push($root.google.protobuf.FileDescriptorProto.decode(reader, reader.uint32())); break; } default: @@ -1128,255 +1030,158 @@ }; /** - * Decodes an Api message from the specified reader or buffer, length delimited. + * Decodes a FileDescriptorSet message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.protobuf.Api + * @memberof google.protobuf.FileDescriptorSet * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.Api} Api + * @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 */ - Api.decodeDelimited = function decodeDelimited(reader) { + FileDescriptorSet.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies an Api message. + * Verifies a FileDescriptorSet message. * @function verify - * @memberof google.protobuf.Api + * @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 */ - Api.verify = function verify(message) { + FileDescriptorSet.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.methods != null && message.hasOwnProperty("methods")) { - if (!Array.isArray(message.methods)) - return "methods: array expected"; - for (var i = 0; i < message.methods.length; ++i) { - var error = $root.google.protobuf.Method.verify(message.methods[i]); - if (error) - return "methods." + error; - } - } - if (message.options != null && message.hasOwnProperty("options")) { - if (!Array.isArray(message.options)) - return "options: array expected"; - for (var i = 0; i < message.options.length; ++i) { - var error = $root.google.protobuf.Option.verify(message.options[i]); - if (error) - return "options." + error; - } - } - if (message.version != null && message.hasOwnProperty("version")) - if (!$util.isString(message.version)) - return "version: string expected"; - if (message.sourceContext != null && message.hasOwnProperty("sourceContext")) { - var error = $root.google.protobuf.SourceContext.verify(message.sourceContext); - if (error) - return "sourceContext." + error; - } - if (message.mixins != null && message.hasOwnProperty("mixins")) { - if (!Array.isArray(message.mixins)) - return "mixins: array expected"; - for (var i = 0; i < message.mixins.length; ++i) { - var error = $root.google.protobuf.Mixin.verify(message.mixins[i]); + 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 "mixins." + error; + return "file." + error; } } - if (message.syntax != null && message.hasOwnProperty("syntax")) - switch (message.syntax) { - default: - return "syntax: enum value expected"; - case 0: - case 1: - break; - } return null; }; /** - * Creates an Api message from a plain object. Also converts values to their respective internal types. + * Creates a FileDescriptorSet message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.protobuf.Api + * @memberof google.protobuf.FileDescriptorSet * @static * @param {Object.} object Plain object - * @returns {google.protobuf.Api} Api + * @returns {google.protobuf.FileDescriptorSet} FileDescriptorSet */ - Api.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.Api) + FileDescriptorSet.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.FileDescriptorSet) return object; - var message = new $root.google.protobuf.Api(); - if (object.name != null) - message.name = String(object.name); - if (object.methods) { - if (!Array.isArray(object.methods)) - throw TypeError(".google.protobuf.Api.methods: array expected"); - message.methods = []; - for (var i = 0; i < object.methods.length; ++i) { - if (typeof object.methods[i] !== "object") - throw TypeError(".google.protobuf.Api.methods: object expected"); - message.methods[i] = $root.google.protobuf.Method.fromObject(object.methods[i]); - } - } - if (object.options) { - if (!Array.isArray(object.options)) - throw TypeError(".google.protobuf.Api.options: array expected"); - message.options = []; - for (var i = 0; i < object.options.length; ++i) { - if (typeof object.options[i] !== "object") - throw TypeError(".google.protobuf.Api.options: object expected"); - message.options[i] = $root.google.protobuf.Option.fromObject(object.options[i]); - } - } - if (object.version != null) - message.version = String(object.version); - if (object.sourceContext != null) { - if (typeof object.sourceContext !== "object") - throw TypeError(".google.protobuf.Api.sourceContext: object expected"); - message.sourceContext = $root.google.protobuf.SourceContext.fromObject(object.sourceContext); - } - if (object.mixins) { - if (!Array.isArray(object.mixins)) - throw TypeError(".google.protobuf.Api.mixins: array expected"); - message.mixins = []; - for (var i = 0; i < object.mixins.length; ++i) { - if (typeof object.mixins[i] !== "object") - throw TypeError(".google.protobuf.Api.mixins: object expected"); - message.mixins[i] = $root.google.protobuf.Mixin.fromObject(object.mixins[i]); - } - } - switch (object.syntax) { - default: - if (typeof object.syntax === "number") { - message.syntax = object.syntax; - break; + 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]); } - break; - case "SYNTAX_PROTO2": - case 0: - message.syntax = 0; - break; - case "SYNTAX_PROTO3": - case 1: - message.syntax = 1; - break; } return message; }; /** - * Creates a plain object from an Api message. Also converts values to other types if specified. + * Creates a plain object from a FileDescriptorSet message. Also converts values to other types if specified. * @function toObject - * @memberof google.protobuf.Api + * @memberof google.protobuf.FileDescriptorSet * @static - * @param {google.protobuf.Api} message Api + * @param {google.protobuf.FileDescriptorSet} message FileDescriptorSet * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - Api.toObject = function toObject(message, options) { + FileDescriptorSet.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.arrays || options.defaults) { - object.methods = []; - object.options = []; - object.mixins = []; - } - if (options.defaults) { - object.name = ""; - object.version = ""; - object.sourceContext = null; - object.syntax = options.enums === String ? "SYNTAX_PROTO2" : 0; - } - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - if (message.methods && message.methods.length) { - object.methods = []; - for (var j = 0; j < message.methods.length; ++j) - object.methods[j] = $root.google.protobuf.Method.toObject(message.methods[j], options); - } - if (message.options && message.options.length) { - object.options = []; - for (var j = 0; j < message.options.length; ++j) - object.options[j] = $root.google.protobuf.Option.toObject(message.options[j], options); - } - if (message.version != null && message.hasOwnProperty("version")) - object.version = message.version; - if (message.sourceContext != null && message.hasOwnProperty("sourceContext")) - object.sourceContext = $root.google.protobuf.SourceContext.toObject(message.sourceContext, options); - if (message.mixins && message.mixins.length) { - object.mixins = []; - for (var j = 0; j < message.mixins.length; ++j) - object.mixins[j] = $root.google.protobuf.Mixin.toObject(message.mixins[j], options); + 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); } - if (message.syntax != null && message.hasOwnProperty("syntax")) - object.syntax = options.enums === String ? $root.google.protobuf.Syntax[message.syntax] === undefined ? message.syntax : $root.google.protobuf.Syntax[message.syntax] : message.syntax; return object; }; /** - * Converts this Api to JSON. + * Converts this FileDescriptorSet to JSON. * @function toJSON - * @memberof google.protobuf.Api + * @memberof google.protobuf.FileDescriptorSet * @instance * @returns {Object.} JSON object */ - Api.prototype.toJSON = function toJSON() { + FileDescriptorSet.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for Api + * Gets the default type url for FileDescriptorSet * @function getTypeUrl - * @memberof google.protobuf.Api + * @memberof google.protobuf.FileDescriptorSet * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - Api.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + FileDescriptorSet.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.protobuf.Api"; + return typeUrlPrefix + "/google.protobuf.FileDescriptorSet"; }; - return Api; + return FileDescriptorSet; })(); - protobuf.Method = (function() { + protobuf.FileDescriptorProto = (function() { /** - * Properties of a Method. + * Properties of a FileDescriptorProto. * @memberof google.protobuf - * @interface IMethod - * @property {string|null} [name] Method name - * @property {string|null} [requestTypeUrl] Method requestTypeUrl - * @property {boolean|null} [requestStreaming] Method requestStreaming - * @property {string|null} [responseTypeUrl] Method responseTypeUrl - * @property {boolean|null} [responseStreaming] Method responseStreaming - * @property {Array.|null} [options] Method options - * @property {google.protobuf.Syntax|null} [syntax] Method syntax + * @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 {string|null} [edition] FileDescriptorProto edition */ /** - * Constructs a new Method. + * Constructs a new FileDescriptorProto. * @memberof google.protobuf - * @classdesc Represents a Method. - * @implements IMethod + * @classdesc Represents a FileDescriptorProto. + * @implements IFileDescriptorProto * @constructor - * @param {google.protobuf.IMethod=} [properties] Properties to set + * @param {google.protobuf.IFileDescriptorProto=} [properties] Properties to set */ - function Method(properties) { - this.options = []; + 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) @@ -1384,131 +1189,197 @@ } /** - * Method name. + * FileDescriptorProto name. * @member {string} name - * @memberof google.protobuf.Method + * @memberof google.protobuf.FileDescriptorProto * @instance */ - Method.prototype.name = ""; + FileDescriptorProto.prototype.name = ""; /** - * Method requestTypeUrl. - * @member {string} requestTypeUrl - * @memberof google.protobuf.Method + * FileDescriptorProto package. + * @member {string} package + * @memberof google.protobuf.FileDescriptorProto * @instance */ - Method.prototype.requestTypeUrl = ""; + FileDescriptorProto.prototype["package"] = ""; /** - * Method requestStreaming. - * @member {boolean} requestStreaming - * @memberof google.protobuf.Method + * FileDescriptorProto dependency. + * @member {Array.} dependency + * @memberof google.protobuf.FileDescriptorProto * @instance */ - Method.prototype.requestStreaming = false; + FileDescriptorProto.prototype.dependency = $util.emptyArray; /** - * Method responseTypeUrl. - * @member {string} responseTypeUrl - * @memberof google.protobuf.Method + * FileDescriptorProto publicDependency. + * @member {Array.} publicDependency + * @memberof google.protobuf.FileDescriptorProto * @instance */ - Method.prototype.responseTypeUrl = ""; + FileDescriptorProto.prototype.publicDependency = $util.emptyArray; /** - * Method responseStreaming. - * @member {boolean} responseStreaming - * @memberof google.protobuf.Method + * FileDescriptorProto weakDependency. + * @member {Array.} weakDependency + * @memberof google.protobuf.FileDescriptorProto * @instance */ - Method.prototype.responseStreaming = false; + FileDescriptorProto.prototype.weakDependency = $util.emptyArray; /** - * Method options. - * @member {Array.} options - * @memberof google.protobuf.Method + * FileDescriptorProto messageType. + * @member {Array.} messageType + * @memberof google.protobuf.FileDescriptorProto * @instance */ - Method.prototype.options = $util.emptyArray; + FileDescriptorProto.prototype.messageType = $util.emptyArray; /** - * Method syntax. - * @member {google.protobuf.Syntax} syntax - * @memberof google.protobuf.Method + * FileDescriptorProto enumType. + * @member {Array.} enumType + * @memberof google.protobuf.FileDescriptorProto * @instance */ - Method.prototype.syntax = 0; + FileDescriptorProto.prototype.enumType = $util.emptyArray; /** - * Creates a new Method instance using the specified properties. - * @function create - * @memberof google.protobuf.Method - * @static - * @param {google.protobuf.IMethod=} [properties] Properties to set - * @returns {google.protobuf.Method} Method instance + * FileDescriptorProto service. + * @member {Array.} service + * @memberof google.protobuf.FileDescriptorProto + * @instance */ - Method.create = function create(properties) { - return new Method(properties); - }; + FileDescriptorProto.prototype.service = $util.emptyArray; /** - * Encodes the specified Method message. Does not implicitly {@link google.protobuf.Method.verify|verify} messages. - * @function encode - * @memberof google.protobuf.Method - * @static - * @param {google.protobuf.IMethod} message Method message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer + * FileDescriptorProto extension. + * @member {Array.} extension + * @memberof google.protobuf.FileDescriptorProto + * @instance */ - Method.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.requestTypeUrl != null && Object.hasOwnProperty.call(message, "requestTypeUrl")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.requestTypeUrl); - if (message.requestStreaming != null && Object.hasOwnProperty.call(message, "requestStreaming")) - writer.uint32(/* id 3, wireType 0 =*/24).bool(message.requestStreaming); - if (message.responseTypeUrl != null && Object.hasOwnProperty.call(message, "responseTypeUrl")) - writer.uint32(/* id 4, wireType 2 =*/34).string(message.responseTypeUrl); - if (message.responseStreaming != null && Object.hasOwnProperty.call(message, "responseStreaming")) - writer.uint32(/* id 5, wireType 0 =*/40).bool(message.responseStreaming); - if (message.options != null && message.options.length) - for (var i = 0; i < message.options.length; ++i) - $root.google.protobuf.Option.encode(message.options[i], writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + 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 {string} edition + * @memberof google.protobuf.FileDescriptorProto + * @instance + */ + FileDescriptorProto.prototype.edition = ""; + + /** + * 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 7, wireType 0 =*/56).int32(message.syntax); + writer.uint32(/* id 12, wireType 2 =*/98).string(message.syntax); + if (message.edition != null && Object.hasOwnProperty.call(message, "edition")) + writer.uint32(/* id 13, wireType 2 =*/106).string(message.edition); return writer; }; /** - * Encodes the specified Method message, length delimited. Does not implicitly {@link google.protobuf.Method.verify|verify} messages. + * Encodes the specified FileDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.FileDescriptorProto.verify|verify} messages. * @function encodeDelimited - * @memberof google.protobuf.Method + * @memberof google.protobuf.FileDescriptorProto * @static - * @param {google.protobuf.IMethod} message Method message or plain object to encode + * @param {google.protobuf.IFileDescriptorProto} message FileDescriptorProto message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - Method.encodeDelimited = function encodeDelimited(message, writer) { + FileDescriptorProto.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a Method message from the specified reader or buffer. + * Decodes a FileDescriptorProto message from the specified reader or buffer. * @function decode - * @memberof google.protobuf.Method + * @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.Method} Method + * @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 */ - Method.decode = function decode(reader, length) { + FileDescriptorProto.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.Method(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.FileDescriptorProto(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { @@ -1517,29 +1388,75 @@ break; } case 2: { - message.requestTypeUrl = reader.string(); + message["package"] = reader.string(); break; } case 3: { - message.requestStreaming = reader.bool(); + 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: { - message.responseTypeUrl = reader.string(); + if (!(message.messageType && message.messageType.length)) + message.messageType = []; + message.messageType.push($root.google.protobuf.DescriptorProto.decode(reader, reader.uint32())); break; } case 5: { - message.responseStreaming = reader.bool(); + if (!(message.enumType && message.enumType.length)) + message.enumType = []; + message.enumType.push($root.google.protobuf.EnumDescriptorProto.decode(reader, reader.uint32())); break; } case 6: { - if (!(message.options && message.options.length)) - message.options = []; - message.options.push($root.google.protobuf.Option.decode(reader, reader.uint32())); + if (!(message.service && message.service.length)) + message.service = []; + message.service.push($root.google.protobuf.ServiceDescriptorProto.decode(reader, reader.uint32())); break; } case 7: { - message.syntax = reader.int32(); + 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 13: { + message.edition = reader.string(); break; } default: @@ -1551,209 +1468,352 @@ }; /** - * Decodes a Method message from the specified reader or buffer, length delimited. + * Decodes a FileDescriptorProto message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.protobuf.Method + * @memberof google.protobuf.FileDescriptorProto * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.Method} Method + * @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 */ - Method.decodeDelimited = function decodeDelimited(reader) { + FileDescriptorProto.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a Method message. + * Verifies a FileDescriptorProto message. * @function verify - * @memberof google.protobuf.Method + * @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 */ - Method.verify = function verify(message) { + 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.requestTypeUrl != null && message.hasOwnProperty("requestTypeUrl")) - if (!$util.isString(message.requestTypeUrl)) - return "requestTypeUrl: string expected"; - if (message.requestStreaming != null && message.hasOwnProperty("requestStreaming")) - if (typeof message.requestStreaming !== "boolean") - return "requestStreaming: boolean expected"; - if (message.responseTypeUrl != null && message.hasOwnProperty("responseTypeUrl")) - if (!$util.isString(message.responseTypeUrl)) - return "responseTypeUrl: string expected"; - if (message.responseStreaming != null && message.hasOwnProperty("responseStreaming")) - if (typeof message.responseStreaming !== "boolean") - return "responseStreaming: boolean expected"; - if (message.options != null && message.hasOwnProperty("options")) { - if (!Array.isArray(message.options)) - return "options: array expected"; - for (var i = 0; i < message.options.length; ++i) { - var error = $root.google.protobuf.Option.verify(message.options[i]); + 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 "options." + error; + return "messageType." + error; } } - if (message.syntax != null && message.hasOwnProperty("syntax")) - switch (message.syntax) { - default: - return "syntax: enum value expected"; - case 0: - case 1: - break; + 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")) + if (!$util.isString(message.edition)) + return "edition: string expected"; return null; }; /** - * Creates a Method message from a plain object. Also converts values to their respective internal types. + * Creates a FileDescriptorProto message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.protobuf.Method + * @memberof google.protobuf.FileDescriptorProto * @static * @param {Object.} object Plain object - * @returns {google.protobuf.Method} Method + * @returns {google.protobuf.FileDescriptorProto} FileDescriptorProto */ - Method.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.Method) + FileDescriptorProto.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.FileDescriptorProto) return object; - var message = new $root.google.protobuf.Method(); + var message = new $root.google.protobuf.FileDescriptorProto(); if (object.name != null) message.name = String(object.name); - if (object.requestTypeUrl != null) - message.requestTypeUrl = String(object.requestTypeUrl); - if (object.requestStreaming != null) - message.requestStreaming = Boolean(object.requestStreaming); - if (object.responseTypeUrl != null) - message.responseTypeUrl = String(object.responseTypeUrl); - if (object.responseStreaming != null) - message.responseStreaming = Boolean(object.responseStreaming); - if (object.options) { - if (!Array.isArray(object.options)) - throw TypeError(".google.protobuf.Method.options: array expected"); - message.options = []; - for (var i = 0; i < object.options.length; ++i) { - if (typeof object.options[i] !== "object") - throw TypeError(".google.protobuf.Method.options: object expected"); - message.options[i] = $root.google.protobuf.Option.fromObject(object.options[i]); + 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]); } } - switch (object.syntax) { - default: - if (typeof object.syntax === "number") { - message.syntax = object.syntax; - break; + 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]); } - break; - case "SYNTAX_PROTO2": - case 0: - message.syntax = 0; - break; - case "SYNTAX_PROTO3": - case 1: - message.syntax = 1; - break; } + 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); + if (object.edition != null) + message.edition = String(object.edition); return message; }; /** - * Creates a plain object from a Method message. Also converts values to other types if specified. + * Creates a plain object from a FileDescriptorProto message. Also converts values to other types if specified. * @function toObject - * @memberof google.protobuf.Method + * @memberof google.protobuf.FileDescriptorProto * @static - * @param {google.protobuf.Method} message Method + * @param {google.protobuf.FileDescriptorProto} message FileDescriptorProto * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - Method.toObject = function toObject(message, options) { + FileDescriptorProto.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.arrays || options.defaults) - object.options = []; + 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.requestTypeUrl = ""; - object.requestStreaming = false; - object.responseTypeUrl = ""; - object.responseStreaming = false; - object.syntax = options.enums === String ? "SYNTAX_PROTO2" : 0; + object["package"] = ""; + object.options = null; + object.sourceCodeInfo = null; + object.syntax = ""; + object.edition = ""; } if (message.name != null && message.hasOwnProperty("name")) object.name = message.name; - if (message.requestTypeUrl != null && message.hasOwnProperty("requestTypeUrl")) - object.requestTypeUrl = message.requestTypeUrl; - if (message.requestStreaming != null && message.hasOwnProperty("requestStreaming")) - object.requestStreaming = message.requestStreaming; - if (message.responseTypeUrl != null && message.hasOwnProperty("responseTypeUrl")) - object.responseTypeUrl = message.responseTypeUrl; - if (message.responseStreaming != null && message.hasOwnProperty("responseStreaming")) - object.responseStreaming = message.responseStreaming; - if (message.options && message.options.length) { - object.options = []; - for (var j = 0; j < message.options.length; ++j) - object.options[j] = $root.google.protobuf.Option.toObject(message.options[j], options); + 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 = options.enums === String ? $root.google.protobuf.Syntax[message.syntax] === undefined ? message.syntax : $root.google.protobuf.Syntax[message.syntax] : message.syntax; + object.syntax = message.syntax; + if (message.edition != null && message.hasOwnProperty("edition")) + object.edition = message.edition; return object; }; /** - * Converts this Method to JSON. + * Converts this FileDescriptorProto to JSON. * @function toJSON - * @memberof google.protobuf.Method + * @memberof google.protobuf.FileDescriptorProto * @instance * @returns {Object.} JSON object */ - Method.prototype.toJSON = function toJSON() { + FileDescriptorProto.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for Method + * Gets the default type url for FileDescriptorProto * @function getTypeUrl - * @memberof google.protobuf.Method + * @memberof google.protobuf.FileDescriptorProto * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - Method.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + FileDescriptorProto.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.protobuf.Method"; + return typeUrlPrefix + "/google.protobuf.FileDescriptorProto"; }; - return Method; + return FileDescriptorProto; })(); - protobuf.Mixin = (function() { - - /** - * Properties of a Mixin. - * @memberof google.protobuf - * @interface IMixin - * @property {string|null} [name] Mixin name - * @property {string|null} [root] Mixin root - */ + protobuf.DescriptorProto = (function() { /** - * Constructs a new Mixin. + * Properties of a DescriptorProto. * @memberof google.protobuf - * @classdesc Represents a Mixin. - * @implements IMixin + * @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.IMixin=} [properties] Properties to set + * @param {google.protobuf.IDescriptorProto=} [properties] Properties to set */ - function Mixin(properties) { + 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) @@ -1761,80 +1821,168 @@ } /** - * Mixin name. + * DescriptorProto name. * @member {string} name - * @memberof google.protobuf.Mixin + * @memberof google.protobuf.DescriptorProto * @instance */ - Mixin.prototype.name = ""; + DescriptorProto.prototype.name = ""; /** - * Mixin root. - * @member {string} root - * @memberof google.protobuf.Mixin + * DescriptorProto field. + * @member {Array.} field + * @memberof google.protobuf.DescriptorProto * @instance */ - Mixin.prototype.root = ""; + DescriptorProto.prototype.field = $util.emptyArray; /** - * Creates a new Mixin instance using the specified properties. + * 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.Mixin + * @memberof google.protobuf.DescriptorProto * @static - * @param {google.protobuf.IMixin=} [properties] Properties to set - * @returns {google.protobuf.Mixin} Mixin instance + * @param {google.protobuf.IDescriptorProto=} [properties] Properties to set + * @returns {google.protobuf.DescriptorProto} DescriptorProto instance */ - Mixin.create = function create(properties) { - return new Mixin(properties); + DescriptorProto.create = function create(properties) { + return new DescriptorProto(properties); }; /** - * Encodes the specified Mixin message. Does not implicitly {@link google.protobuf.Mixin.verify|verify} messages. + * Encodes the specified DescriptorProto message. Does not implicitly {@link google.protobuf.DescriptorProto.verify|verify} messages. * @function encode - * @memberof google.protobuf.Mixin + * @memberof google.protobuf.DescriptorProto * @static - * @param {google.protobuf.IMixin} message Mixin message or plain object to encode + * @param {google.protobuf.IDescriptorProto} message DescriptorProto message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - Mixin.encode = function encode(message, 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.root != null && Object.hasOwnProperty.call(message, "root")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.root); + 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 Mixin message, length delimited. Does not implicitly {@link google.protobuf.Mixin.verify|verify} messages. + * Encodes the specified DescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.DescriptorProto.verify|verify} messages. * @function encodeDelimited - * @memberof google.protobuf.Mixin + * @memberof google.protobuf.DescriptorProto * @static - * @param {google.protobuf.IMixin} message Mixin message or plain object to encode + * @param {google.protobuf.IDescriptorProto} message DescriptorProto message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - Mixin.encodeDelimited = function encodeDelimited(message, writer) { + DescriptorProto.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a Mixin message from the specified reader or buffer. + * Decodes a DescriptorProto message from the specified reader or buffer. * @function decode - * @memberof google.protobuf.Mixin + * @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.Mixin} Mixin + * @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 */ - Mixin.decode = function decode(reader, length) { + DescriptorProto.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.Mixin(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.DescriptorProto(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { @@ -1843,7 +1991,55 @@ break; } case 2: { - message.root = reader.string(); + 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: @@ -1855,497 +2051,895 @@ }; /** - * Decodes a Mixin message from the specified reader or buffer, length delimited. + * Decodes a DescriptorProto message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.protobuf.Mixin + * @memberof google.protobuf.DescriptorProto * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.Mixin} Mixin + * @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 */ - Mixin.decodeDelimited = function decodeDelimited(reader) { + DescriptorProto.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a Mixin message. + * Verifies a DescriptorProto message. * @function verify - * @memberof google.protobuf.Mixin + * @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 */ - Mixin.verify = function verify(message) { + 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.root != null && message.hasOwnProperty("root")) - if (!$util.isString(message.root)) - return "root: 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 Mixin message from a plain object. Also converts values to their respective internal types. + * Creates a DescriptorProto message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.protobuf.Mixin + * @memberof google.protobuf.DescriptorProto * @static * @param {Object.} object Plain object - * @returns {google.protobuf.Mixin} Mixin + * @returns {google.protobuf.DescriptorProto} DescriptorProto */ - Mixin.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.Mixin) + DescriptorProto.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.DescriptorProto) return object; - var message = new $root.google.protobuf.Mixin(); + var message = new $root.google.protobuf.DescriptorProto(); if (object.name != null) message.name = String(object.name); - if (object.root != null) - message.root = String(object.root); + 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 Mixin message. Also converts values to other types if specified. + * Creates a plain object from a DescriptorProto message. Also converts values to other types if specified. * @function toObject - * @memberof google.protobuf.Mixin + * @memberof google.protobuf.DescriptorProto * @static - * @param {google.protobuf.Mixin} message Mixin + * @param {google.protobuf.DescriptorProto} message DescriptorProto * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - Mixin.toObject = function toObject(message, options) { + 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.root = ""; + object.options = null; } if (message.name != null && message.hasOwnProperty("name")) object.name = message.name; - if (message.root != null && message.hasOwnProperty("root")) - object.root = message.root; + 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 Mixin to JSON. + * Converts this DescriptorProto to JSON. * @function toJSON - * @memberof google.protobuf.Mixin + * @memberof google.protobuf.DescriptorProto * @instance * @returns {Object.} JSON object */ - Mixin.prototype.toJSON = function toJSON() { + DescriptorProto.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for Mixin + * Gets the default type url for DescriptorProto * @function getTypeUrl - * @memberof google.protobuf.Mixin + * @memberof google.protobuf.DescriptorProto * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - Mixin.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + DescriptorProto.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.protobuf.Mixin"; + return typeUrlPrefix + "/google.protobuf.DescriptorProto"; }; - return Mixin; - })(); - - protobuf.SourceContext = (function() { + DescriptorProto.ExtensionRange = (function() { - /** - * Properties of a SourceContext. - * @memberof google.protobuf - * @interface ISourceContext - * @property {string|null} [fileName] SourceContext fileName - */ + /** + * 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 SourceContext. - * @memberof google.protobuf - * @classdesc Represents a SourceContext. - * @implements ISourceContext - * @constructor - * @param {google.protobuf.ISourceContext=} [properties] Properties to set - */ - function SourceContext(properties) { - if (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 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]]; + } - /** - * SourceContext fileName. - * @member {string} fileName - * @memberof google.protobuf.SourceContext - * @instance - */ - SourceContext.prototype.fileName = ""; + /** + * ExtensionRange start. + * @member {number} start + * @memberof google.protobuf.DescriptorProto.ExtensionRange + * @instance + */ + ExtensionRange.prototype.start = 0; - /** - * Creates a new SourceContext instance using the specified properties. - * @function create - * @memberof google.protobuf.SourceContext - * @static - * @param {google.protobuf.ISourceContext=} [properties] Properties to set - * @returns {google.protobuf.SourceContext} SourceContext instance - */ - SourceContext.create = function create(properties) { - return new SourceContext(properties); - }; + /** + * ExtensionRange end. + * @member {number} end + * @memberof google.protobuf.DescriptorProto.ExtensionRange + * @instance + */ + ExtensionRange.prototype.end = 0; - /** - * Encodes the specified SourceContext message. Does not implicitly {@link google.protobuf.SourceContext.verify|verify} messages. - * @function encode - * @memberof google.protobuf.SourceContext - * @static - * @param {google.protobuf.ISourceContext} message SourceContext message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - SourceContext.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.fileName != null && Object.hasOwnProperty.call(message, "fileName")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.fileName); - return writer; - }; + /** + * ExtensionRange options. + * @member {google.protobuf.IExtensionRangeOptions|null|undefined} options + * @memberof google.protobuf.DescriptorProto.ExtensionRange + * @instance + */ + ExtensionRange.prototype.options = null; - /** - * Encodes the specified SourceContext message, length delimited. Does not implicitly {@link google.protobuf.SourceContext.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.SourceContext - * @static - * @param {google.protobuf.ISourceContext} message SourceContext message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - SourceContext.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; + /** + * 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); + }; - /** - * Decodes a SourceContext message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.SourceContext - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.SourceContext} SourceContext - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - SourceContext.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.SourceContext(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - message.fileName = reader.string(); + /** + * 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) { + 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(); + 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; } - default: - reader.skipType(tag & 7); - break; } - } - return message; - }; - - /** - * Decodes a SourceContext message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.SourceContext - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.SourceContext} SourceContext - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - SourceContext.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; + return message; + }; - /** - * Verifies a SourceContext message. - * @function verify - * @memberof google.protobuf.SourceContext - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - SourceContext.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.fileName != null && message.hasOwnProperty("fileName")) - if (!$util.isString(message.fileName)) - return "fileName: string expected"; - return null; - }; + /** + * 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()); + }; - /** - * Creates a SourceContext message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.SourceContext - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.SourceContext} SourceContext - */ - SourceContext.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.SourceContext) - return object; - var message = new $root.google.protobuf.SourceContext(); - if (object.fileName != null) - message.fileName = String(object.fileName); - return message; - }; + /** + * 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 a plain object from a SourceContext message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.SourceContext - * @static - * @param {google.protobuf.SourceContext} message SourceContext - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - SourceContext.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - object.fileName = ""; - if (message.fileName != null && message.hasOwnProperty("fileName")) - object.fileName = message.fileName; - return object; - }; + /** + * 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; + }; - /** - * Converts this SourceContext to JSON. - * @function toJSON - * @memberof google.protobuf.SourceContext - * @instance - * @returns {Object.} JSON object - */ - SourceContext.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; + /** + * 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; + }; - /** - * Gets the default type url for SourceContext - * @function getTypeUrl - * @memberof google.protobuf.SourceContext - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - SourceContext.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.protobuf.SourceContext"; - }; + /** + * 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); + }; - return SourceContext; - })(); + /** + * 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"; + }; - protobuf.Type = (function() { + return ExtensionRange; + })(); - /** - * Properties of a Type. - * @memberof google.protobuf - * @interface IType - * @property {string|null} [name] Type name - * @property {Array.|null} [fields] Type fields - * @property {Array.|null} [oneofs] Type oneofs - * @property {Array.|null} [options] Type options - * @property {google.protobuf.ISourceContext|null} [sourceContext] Type sourceContext - * @property {google.protobuf.Syntax|null} [syntax] Type syntax - */ + DescriptorProto.ReservedRange = (function() { - /** - * Constructs a new Type. - * @memberof google.protobuf - * @classdesc Represents a Type. - * @implements IType - * @constructor - * @param {google.protobuf.IType=} [properties] Properties to set - */ - function Type(properties) { - this.fields = []; - this.oneofs = []; - this.options = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } + /** + * Properties of a ReservedRange. + * @memberof google.protobuf.DescriptorProto + * @interface IReservedRange + * @property {number|null} [start] ReservedRange start + * @property {number|null} [end] ReservedRange end + */ - /** - * Type name. - * @member {string} name - * @memberof google.protobuf.Type - * @instance - */ - Type.prototype.name = ""; + /** + * 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]]; + } - /** - * Type fields. - * @member {Array.} fields - * @memberof google.protobuf.Type - * @instance - */ - Type.prototype.fields = $util.emptyArray; + /** + * ReservedRange start. + * @member {number} start + * @memberof google.protobuf.DescriptorProto.ReservedRange + * @instance + */ + ReservedRange.prototype.start = 0; - /** - * Type oneofs. - * @member {Array.} oneofs - * @memberof google.protobuf.Type - * @instance - */ - Type.prototype.oneofs = $util.emptyArray; + /** + * ReservedRange end. + * @member {number} end + * @memberof google.protobuf.DescriptorProto.ReservedRange + * @instance + */ + ReservedRange.prototype.end = 0; - /** - * Type options. - * @member {Array.} options - * @memberof google.protobuf.Type - * @instance - */ - Type.prototype.options = $util.emptyArray; + /** + * 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); + }; - /** - * Type sourceContext. - * @member {google.protobuf.ISourceContext|null|undefined} sourceContext - * @memberof google.protobuf.Type - * @instance + /** + * 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) { + 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(); + 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 */ - Type.prototype.sourceContext = null; /** - * Type syntax. - * @member {google.protobuf.Syntax} syntax - * @memberof google.protobuf.Type + * 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 = []; + if (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 */ - Type.prototype.syntax = 0; + ExtensionRangeOptions.prototype.uninterpretedOption = $util.emptyArray; /** - * Creates a new Type instance using the specified properties. + * Creates a new ExtensionRangeOptions instance using the specified properties. * @function create - * @memberof google.protobuf.Type + * @memberof google.protobuf.ExtensionRangeOptions * @static - * @param {google.protobuf.IType=} [properties] Properties to set - * @returns {google.protobuf.Type} Type instance + * @param {google.protobuf.IExtensionRangeOptions=} [properties] Properties to set + * @returns {google.protobuf.ExtensionRangeOptions} ExtensionRangeOptions instance */ - Type.create = function create(properties) { - return new Type(properties); + ExtensionRangeOptions.create = function create(properties) { + return new ExtensionRangeOptions(properties); }; /** - * Encodes the specified Type message. Does not implicitly {@link google.protobuf.Type.verify|verify} messages. + * Encodes the specified ExtensionRangeOptions message. Does not implicitly {@link google.protobuf.ExtensionRangeOptions.verify|verify} messages. * @function encode - * @memberof google.protobuf.Type + * @memberof google.protobuf.ExtensionRangeOptions * @static - * @param {google.protobuf.IType} message Type message or plain object to encode + * @param {google.protobuf.IExtensionRangeOptions} message ExtensionRangeOptions message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - Type.encode = function encode(message, writer) { + ExtensionRangeOptions.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.fields != null && message.fields.length) - for (var i = 0; i < message.fields.length; ++i) - $root.google.protobuf.Field.encode(message.fields[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.oneofs != null && message.oneofs.length) - for (var i = 0; i < message.oneofs.length; ++i) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.oneofs[i]); - if (message.options != null && message.options.length) - for (var i = 0; i < message.options.length; ++i) - $root.google.protobuf.Option.encode(message.options[i], writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); - if (message.sourceContext != null && Object.hasOwnProperty.call(message, "sourceContext")) - $root.google.protobuf.SourceContext.encode(message.sourceContext, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); - if (message.syntax != null && Object.hasOwnProperty.call(message, "syntax")) - writer.uint32(/* id 6, wireType 0 =*/48).int32(message.syntax); + 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 Type message, length delimited. Does not implicitly {@link google.protobuf.Type.verify|verify} messages. + * Encodes the specified ExtensionRangeOptions message, length delimited. Does not implicitly {@link google.protobuf.ExtensionRangeOptions.verify|verify} messages. * @function encodeDelimited - * @memberof google.protobuf.Type + * @memberof google.protobuf.ExtensionRangeOptions * @static - * @param {google.protobuf.IType} message Type message or plain object to encode + * @param {google.protobuf.IExtensionRangeOptions} message ExtensionRangeOptions message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - Type.encodeDelimited = function encodeDelimited(message, writer) { + ExtensionRangeOptions.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a Type message from the specified reader or buffer. + * Decodes an ExtensionRangeOptions message from the specified reader or buffer. * @function decode - * @memberof google.protobuf.Type + * @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.Type} Type + * @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 */ - Type.decode = function decode(reader, length) { + ExtensionRangeOptions.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.Type(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.ExtensionRangeOptions(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: { - message.name = reader.string(); - break; - } - case 2: { - if (!(message.fields && message.fields.length)) - message.fields = []; - message.fields.push($root.google.protobuf.Field.decode(reader, reader.uint32())); - break; - } - case 3: { - if (!(message.oneofs && message.oneofs.length)) - message.oneofs = []; - message.oneofs.push(reader.string()); - break; - } - case 4: { - if (!(message.options && message.options.length)) - message.options = []; - message.options.push($root.google.protobuf.Option.decode(reader, reader.uint32())); - break; - } - case 5: { - message.sourceContext = $root.google.protobuf.SourceContext.decode(reader, reader.uint32()); - break; - } - case 6: { - message.syntax = reader.int32(); + case 999: { + if (!(message.uninterpretedOption && message.uninterpretedOption.length)) + message.uninterpretedOption = []; + message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); break; } default: @@ -2357,245 +2951,149 @@ }; /** - * Decodes a Type message from the specified reader or buffer, length delimited. + * Decodes an ExtensionRangeOptions message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.protobuf.Type + * @memberof google.protobuf.ExtensionRangeOptions * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.Type} Type + * @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 */ - Type.decodeDelimited = function decodeDelimited(reader) { + ExtensionRangeOptions.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a Type message. + * Verifies an ExtensionRangeOptions message. * @function verify - * @memberof google.protobuf.Type + * @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 */ - Type.verify = function verify(message) { + ExtensionRangeOptions.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.fields != null && message.hasOwnProperty("fields")) { - if (!Array.isArray(message.fields)) - return "fields: array expected"; - for (var i = 0; i < message.fields.length; ++i) { - var error = $root.google.protobuf.Field.verify(message.fields[i]); - if (error) - return "fields." + error; - } - } - if (message.oneofs != null && message.hasOwnProperty("oneofs")) { - if (!Array.isArray(message.oneofs)) - return "oneofs: array expected"; - for (var i = 0; i < message.oneofs.length; ++i) - if (!$util.isString(message.oneofs[i])) - return "oneofs: string[] expected"; - } - if (message.options != null && message.hasOwnProperty("options")) { - if (!Array.isArray(message.options)) - return "options: array expected"; - for (var i = 0; i < message.options.length; ++i) { - var error = $root.google.protobuf.Option.verify(message.options[i]); + 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 "options." + error; + return "uninterpretedOption." + error; } } - if (message.sourceContext != null && message.hasOwnProperty("sourceContext")) { - var error = $root.google.protobuf.SourceContext.verify(message.sourceContext); - if (error) - return "sourceContext." + error; - } - if (message.syntax != null && message.hasOwnProperty("syntax")) - switch (message.syntax) { - default: - return "syntax: enum value expected"; - case 0: - case 1: - break; - } return null; }; /** - * Creates a Type message from a plain object. Also converts values to their respective internal types. + * Creates an ExtensionRangeOptions message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.protobuf.Type + * @memberof google.protobuf.ExtensionRangeOptions * @static * @param {Object.} object Plain object - * @returns {google.protobuf.Type} Type + * @returns {google.protobuf.ExtensionRangeOptions} ExtensionRangeOptions */ - Type.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.Type) + ExtensionRangeOptions.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.ExtensionRangeOptions) return object; - var message = new $root.google.protobuf.Type(); - if (object.name != null) - message.name = String(object.name); - if (object.fields) { - if (!Array.isArray(object.fields)) - throw TypeError(".google.protobuf.Type.fields: array expected"); - message.fields = []; - for (var i = 0; i < object.fields.length; ++i) { - if (typeof object.fields[i] !== "object") - throw TypeError(".google.protobuf.Type.fields: object expected"); - message.fields[i] = $root.google.protobuf.Field.fromObject(object.fields[i]); - } - } - if (object.oneofs) { - if (!Array.isArray(object.oneofs)) - throw TypeError(".google.protobuf.Type.oneofs: array expected"); - message.oneofs = []; - for (var i = 0; i < object.oneofs.length; ++i) - message.oneofs[i] = String(object.oneofs[i]); - } - if (object.options) { - if (!Array.isArray(object.options)) - throw TypeError(".google.protobuf.Type.options: array expected"); - message.options = []; - for (var i = 0; i < object.options.length; ++i) { - if (typeof object.options[i] !== "object") - throw TypeError(".google.protobuf.Type.options: object expected"); - message.options[i] = $root.google.protobuf.Option.fromObject(object.options[i]); - } - } - if (object.sourceContext != null) { - if (typeof object.sourceContext !== "object") - throw TypeError(".google.protobuf.Type.sourceContext: object expected"); - message.sourceContext = $root.google.protobuf.SourceContext.fromObject(object.sourceContext); - } - switch (object.syntax) { - default: - if (typeof object.syntax === "number") { - message.syntax = object.syntax; - break; + 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]); } - break; - case "SYNTAX_PROTO2": - case 0: - message.syntax = 0; - break; - case "SYNTAX_PROTO3": - case 1: - message.syntax = 1; - break; } return message; }; /** - * Creates a plain object from a Type message. Also converts values to other types if specified. + * Creates a plain object from an ExtensionRangeOptions message. Also converts values to other types if specified. * @function toObject - * @memberof google.protobuf.Type + * @memberof google.protobuf.ExtensionRangeOptions * @static - * @param {google.protobuf.Type} message Type + * @param {google.protobuf.ExtensionRangeOptions} message ExtensionRangeOptions * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - Type.toObject = function toObject(message, options) { + ExtensionRangeOptions.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.arrays || options.defaults) { - object.fields = []; - object.oneofs = []; - object.options = []; - } - if (options.defaults) { - object.name = ""; - object.sourceContext = null; - object.syntax = options.enums === String ? "SYNTAX_PROTO2" : 0; - } - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - if (message.fields && message.fields.length) { - object.fields = []; - for (var j = 0; j < message.fields.length; ++j) - object.fields[j] = $root.google.protobuf.Field.toObject(message.fields[j], options); - } - if (message.oneofs && message.oneofs.length) { - object.oneofs = []; - for (var j = 0; j < message.oneofs.length; ++j) - object.oneofs[j] = message.oneofs[j]; - } - if (message.options && message.options.length) { - object.options = []; - for (var j = 0; j < message.options.length; ++j) - object.options[j] = $root.google.protobuf.Option.toObject(message.options[j], options); + if (options.arrays || options.defaults) + object.uninterpretedOption = []; + 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.sourceContext != null && message.hasOwnProperty("sourceContext")) - object.sourceContext = $root.google.protobuf.SourceContext.toObject(message.sourceContext, options); - if (message.syntax != null && message.hasOwnProperty("syntax")) - object.syntax = options.enums === String ? $root.google.protobuf.Syntax[message.syntax] === undefined ? message.syntax : $root.google.protobuf.Syntax[message.syntax] : message.syntax; return object; }; /** - * Converts this Type to JSON. + * Converts this ExtensionRangeOptions to JSON. * @function toJSON - * @memberof google.protobuf.Type + * @memberof google.protobuf.ExtensionRangeOptions * @instance * @returns {Object.} JSON object */ - Type.prototype.toJSON = function toJSON() { + ExtensionRangeOptions.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for Type + * Gets the default type url for ExtensionRangeOptions * @function getTypeUrl - * @memberof google.protobuf.Type + * @memberof google.protobuf.ExtensionRangeOptions * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - Type.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + ExtensionRangeOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.protobuf.Type"; + return typeUrlPrefix + "/google.protobuf.ExtensionRangeOptions"; }; - return Type; + return ExtensionRangeOptions; })(); - protobuf.Field = (function() { - - /** - * Properties of a Field. - * @memberof google.protobuf - * @interface IField - * @property {google.protobuf.Field.Kind|null} [kind] Field kind - * @property {google.protobuf.Field.Cardinality|null} [cardinality] Field cardinality - * @property {number|null} [number] Field number - * @property {string|null} [name] Field name - * @property {string|null} [typeUrl] Field typeUrl - * @property {number|null} [oneofIndex] Field oneofIndex - * @property {boolean|null} [packed] Field packed - * @property {Array.|null} [options] Field options - * @property {string|null} [jsonName] Field jsonName - * @property {string|null} [defaultValue] Field defaultValue - */ + protobuf.FieldDescriptorProto = (function() { /** - * Constructs a new Field. + * Properties of a FieldDescriptorProto. * @memberof google.protobuf - * @classdesc Represents a Field. - * @implements IField - * @constructor - * @param {google.protobuf.IField=} [properties] Properties to set - */ - function Field(properties) { - this.options = []; + * @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) @@ -2603,170 +3101,175 @@ } /** - * Field kind. - * @member {google.protobuf.Field.Kind} kind - * @memberof google.protobuf.Field + * FieldDescriptorProto name. + * @member {string} name + * @memberof google.protobuf.FieldDescriptorProto * @instance */ - Field.prototype.kind = 0; + FieldDescriptorProto.prototype.name = ""; /** - * Field cardinality. - * @member {google.protobuf.Field.Cardinality} cardinality - * @memberof google.protobuf.Field + * FieldDescriptorProto number. + * @member {number} number + * @memberof google.protobuf.FieldDescriptorProto * @instance */ - Field.prototype.cardinality = 0; + FieldDescriptorProto.prototype.number = 0; /** - * Field number. - * @member {number} number - * @memberof google.protobuf.Field + * FieldDescriptorProto label. + * @member {google.protobuf.FieldDescriptorProto.Label} label + * @memberof google.protobuf.FieldDescriptorProto * @instance */ - Field.prototype.number = 0; + FieldDescriptorProto.prototype.label = 1; /** - * Field name. - * @member {string} name - * @memberof google.protobuf.Field + * FieldDescriptorProto type. + * @member {google.protobuf.FieldDescriptorProto.Type} type + * @memberof google.protobuf.FieldDescriptorProto * @instance */ - Field.prototype.name = ""; + FieldDescriptorProto.prototype.type = 1; /** - * Field typeUrl. - * @member {string} typeUrl - * @memberof google.protobuf.Field + * FieldDescriptorProto typeName. + * @member {string} typeName + * @memberof google.protobuf.FieldDescriptorProto * @instance */ - Field.prototype.typeUrl = ""; + FieldDescriptorProto.prototype.typeName = ""; /** - * Field oneofIndex. - * @member {number} oneofIndex - * @memberof google.protobuf.Field + * FieldDescriptorProto extendee. + * @member {string} extendee + * @memberof google.protobuf.FieldDescriptorProto * @instance */ - Field.prototype.oneofIndex = 0; + FieldDescriptorProto.prototype.extendee = ""; /** - * Field packed. - * @member {boolean} packed - * @memberof google.protobuf.Field + * FieldDescriptorProto defaultValue. + * @member {string} defaultValue + * @memberof google.protobuf.FieldDescriptorProto * @instance */ - Field.prototype.packed = false; + FieldDescriptorProto.prototype.defaultValue = ""; /** - * Field options. - * @member {Array.} options - * @memberof google.protobuf.Field + * FieldDescriptorProto oneofIndex. + * @member {number} oneofIndex + * @memberof google.protobuf.FieldDescriptorProto * @instance */ - Field.prototype.options = $util.emptyArray; + FieldDescriptorProto.prototype.oneofIndex = 0; /** - * Field jsonName. + * FieldDescriptorProto jsonName. * @member {string} jsonName - * @memberof google.protobuf.Field + * @memberof google.protobuf.FieldDescriptorProto * @instance */ - Field.prototype.jsonName = ""; + FieldDescriptorProto.prototype.jsonName = ""; /** - * Field defaultValue. - * @member {string} defaultValue - * @memberof google.protobuf.Field + * FieldDescriptorProto options. + * @member {google.protobuf.IFieldOptions|null|undefined} options + * @memberof google.protobuf.FieldDescriptorProto * @instance */ - Field.prototype.defaultValue = ""; + FieldDescriptorProto.prototype.options = null; /** - * Creates a new Field instance using the specified properties. + * 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.Field + * @memberof google.protobuf.FieldDescriptorProto * @static - * @param {google.protobuf.IField=} [properties] Properties to set - * @returns {google.protobuf.Field} Field instance + * @param {google.protobuf.IFieldDescriptorProto=} [properties] Properties to set + * @returns {google.protobuf.FieldDescriptorProto} FieldDescriptorProto instance */ - Field.create = function create(properties) { - return new Field(properties); + FieldDescriptorProto.create = function create(properties) { + return new FieldDescriptorProto(properties); }; /** - * Encodes the specified Field message. Does not implicitly {@link google.protobuf.Field.verify|verify} messages. + * Encodes the specified FieldDescriptorProto message. Does not implicitly {@link google.protobuf.FieldDescriptorProto.verify|verify} messages. * @function encode - * @memberof google.protobuf.Field + * @memberof google.protobuf.FieldDescriptorProto * @static - * @param {google.protobuf.IField} message Field message or plain object to encode + * @param {google.protobuf.IFieldDescriptorProto} message FieldDescriptorProto message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - Field.encode = function encode(message, writer) { + FieldDescriptorProto.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.kind != null && Object.hasOwnProperty.call(message, "kind")) - writer.uint32(/* id 1, wireType 0 =*/8).int32(message.kind); - if (message.cardinality != null && Object.hasOwnProperty.call(message, "cardinality")) - writer.uint32(/* id 2, wireType 0 =*/16).int32(message.cardinality); + 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.name != null && Object.hasOwnProperty.call(message, "name")) - writer.uint32(/* id 4, wireType 2 =*/34).string(message.name); - if (message.typeUrl != null && Object.hasOwnProperty.call(message, "typeUrl")) - writer.uint32(/* id 6, wireType 2 =*/50).string(message.typeUrl); + 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 7, wireType 0 =*/56).int32(message.oneofIndex); - if (message.packed != null && Object.hasOwnProperty.call(message, "packed")) - writer.uint32(/* id 8, wireType 0 =*/64).bool(message.packed); - if (message.options != null && message.options.length) - for (var i = 0; i < message.options.length; ++i) - $root.google.protobuf.Option.encode(message.options[i], writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim(); + 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.defaultValue != null && Object.hasOwnProperty.call(message, "defaultValue")) - writer.uint32(/* id 11, wireType 2 =*/90).string(message.defaultValue); + if (message.proto3Optional != null && Object.hasOwnProperty.call(message, "proto3Optional")) + writer.uint32(/* id 17, wireType 0 =*/136).bool(message.proto3Optional); return writer; }; /** - * Encodes the specified Field message, length delimited. Does not implicitly {@link google.protobuf.Field.verify|verify} messages. + * Encodes the specified FieldDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.FieldDescriptorProto.verify|verify} messages. * @function encodeDelimited - * @memberof google.protobuf.Field + * @memberof google.protobuf.FieldDescriptorProto * @static - * @param {google.protobuf.IField} message Field message or plain object to encode + * @param {google.protobuf.IFieldDescriptorProto} message FieldDescriptorProto message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - Field.encodeDelimited = function encodeDelimited(message, writer) { + FieldDescriptorProto.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a Field message from the specified reader or buffer. + * Decodes a FieldDescriptorProto message from the specified reader or buffer. * @function decode - * @memberof google.protobuf.Field + * @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.Field} Field + * @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 */ - Field.decode = function decode(reader, length) { + FieldDescriptorProto.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.Field(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.FieldDescriptorProto(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: { - message.kind = reader.int32(); - break; - } - case 2: { - message.cardinality = reader.int32(); + message.name = reader.string(); break; } case 3: { @@ -2774,33 +3277,39 @@ break; } case 4: { - message.name = reader.string(); + message.label = reader.int32(); + break; + } + case 5: { + message.type = reader.int32(); break; } case 6: { - message.typeUrl = reader.string(); + message.typeName = reader.string(); break; } - case 7: { - message.oneofIndex = reader.int32(); + case 2: { + message.extendee = reader.string(); break; } - case 8: { - message.packed = reader.bool(); + case 7: { + message.defaultValue = reader.string(); break; } case 9: { - if (!(message.options && message.options.length)) - message.options = []; - message.options.push($root.google.protobuf.Option.decode(reader, reader.uint32())); + message.oneofIndex = reader.int32(); break; } case 10: { message.jsonName = reader.string(); break; } - case 11: { - message.defaultValue = reader.string(); + case 8: { + message.options = $root.google.protobuf.FieldOptions.decode(reader, reader.uint32()); + break; + } + case 17: { + message.proto3Optional = reader.bool(); break; } default: @@ -2812,37 +3321,51 @@ }; /** - * Decodes a Field message from the specified reader or buffer, length delimited. + * Decodes a FieldDescriptorProto message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.protobuf.Field + * @memberof google.protobuf.FieldDescriptorProto * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.Field} Field + * @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 */ - Field.decodeDelimited = function decodeDelimited(reader) { + FieldDescriptorProto.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a Field message. + * Verifies a FieldDescriptorProto message. * @function verify - * @memberof google.protobuf.Field + * @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 */ - Field.verify = function verify(message) { + FieldDescriptorProto.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.kind != null && message.hasOwnProperty("kind")) - switch (message.kind) { + 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 "kind: enum value expected"; - case 0: + return "label: enum value expected"; + case 1: + case 2: + case 3: + break; + } + if (message.type != null && message.hasOwnProperty("type")) + switch (message.type) { + default: + return "type: enum value expected"; case 1: case 2: case 3: @@ -2863,279 +3386,249 @@ case 18: break; } - if (message.cardinality != null && message.hasOwnProperty("cardinality")) - switch (message.cardinality) { - default: - return "cardinality: enum value expected"; - case 0: - case 1: - case 2: - case 3: - break; - } - if (message.number != null && message.hasOwnProperty("number")) - if (!$util.isInteger(message.number)) - return "number: integer expected"; - if (message.name != null && message.hasOwnProperty("name")) - if (!$util.isString(message.name)) - return "name: string expected"; - if (message.typeUrl != null && message.hasOwnProperty("typeUrl")) - if (!$util.isString(message.typeUrl)) - return "typeUrl: string expected"; + 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.packed != null && message.hasOwnProperty("packed")) - if (typeof message.packed !== "boolean") - return "packed: boolean expected"; - if (message.options != null && message.hasOwnProperty("options")) { - if (!Array.isArray(message.options)) - return "options: array expected"; - for (var i = 0; i < message.options.length; ++i) { - var error = $root.google.protobuf.Option.verify(message.options[i]); - if (error) - return "options." + error; - } - } if (message.jsonName != null && message.hasOwnProperty("jsonName")) if (!$util.isString(message.jsonName)) return "jsonName: string expected"; - if (message.defaultValue != null && message.hasOwnProperty("defaultValue")) - if (!$util.isString(message.defaultValue)) - return "defaultValue: 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 Field message from a plain object. Also converts values to their respective internal types. + * Creates a FieldDescriptorProto message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.protobuf.Field + * @memberof google.protobuf.FieldDescriptorProto * @static * @param {Object.} object Plain object - * @returns {google.protobuf.Field} Field + * @returns {google.protobuf.FieldDescriptorProto} FieldDescriptorProto */ - Field.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.Field) + FieldDescriptorProto.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.FieldDescriptorProto) return object; - var message = new $root.google.protobuf.Field(); - switch (object.kind) { + 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.kind === "number") { - message.kind = object.kind; + if (typeof object.label === "number") { + message.label = object.label; break; } break; - case "TYPE_UNKNOWN": - case 0: - message.kind = 0; + case "LABEL_OPTIONAL": + case 1: + message.label = 1; + break; + case "LABEL_REQUIRED": + case 2: + message.label = 2; + break; + case "LABEL_REPEATED": + case 3: + message.label = 3; + break; + } + switch (object.type) { + default: + if (typeof object.type === "number") { + message.type = object.type; + break; + } break; case "TYPE_DOUBLE": case 1: - message.kind = 1; + message.type = 1; break; case "TYPE_FLOAT": case 2: - message.kind = 2; + message.type = 2; break; case "TYPE_INT64": case 3: - message.kind = 3; + message.type = 3; break; case "TYPE_UINT64": case 4: - message.kind = 4; + message.type = 4; break; case "TYPE_INT32": case 5: - message.kind = 5; + message.type = 5; break; case "TYPE_FIXED64": case 6: - message.kind = 6; + message.type = 6; break; case "TYPE_FIXED32": case 7: - message.kind = 7; + message.type = 7; break; case "TYPE_BOOL": case 8: - message.kind = 8; + message.type = 8; break; case "TYPE_STRING": case 9: - message.kind = 9; + message.type = 9; break; case "TYPE_GROUP": case 10: - message.kind = 10; + message.type = 10; break; case "TYPE_MESSAGE": case 11: - message.kind = 11; + message.type = 11; break; case "TYPE_BYTES": case 12: - message.kind = 12; + message.type = 12; break; case "TYPE_UINT32": case 13: - message.kind = 13; + message.type = 13; break; case "TYPE_ENUM": case 14: - message.kind = 14; + message.type = 14; break; case "TYPE_SFIXED32": case 15: - message.kind = 15; + message.type = 15; break; case "TYPE_SFIXED64": case 16: - message.kind = 16; + message.type = 16; break; case "TYPE_SINT32": case 17: - message.kind = 17; + message.type = 17; break; case "TYPE_SINT64": case 18: - message.kind = 18; - break; - } - switch (object.cardinality) { - default: - if (typeof object.cardinality === "number") { - message.cardinality = object.cardinality; - break; - } - break; - case "CARDINALITY_UNKNOWN": - case 0: - message.cardinality = 0; - break; - case "CARDINALITY_OPTIONAL": - case 1: - message.cardinality = 1; - break; - case "CARDINALITY_REQUIRED": - case 2: - message.cardinality = 2; - break; - case "CARDINALITY_REPEATED": - case 3: - message.cardinality = 3; + message.type = 18; break; } - if (object.number != null) - message.number = object.number | 0; - if (object.name != null) - message.name = String(object.name); - if (object.typeUrl != null) - message.typeUrl = String(object.typeUrl); + 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.packed != null) - message.packed = Boolean(object.packed); - if (object.options) { - if (!Array.isArray(object.options)) - throw TypeError(".google.protobuf.Field.options: array expected"); - message.options = []; - for (var i = 0; i < object.options.length; ++i) { - if (typeof object.options[i] !== "object") - throw TypeError(".google.protobuf.Field.options: object expected"); - message.options[i] = $root.google.protobuf.Option.fromObject(object.options[i]); - } - } if (object.jsonName != null) message.jsonName = String(object.jsonName); - if (object.defaultValue != null) - message.defaultValue = String(object.defaultValue); + 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 Field message. Also converts values to other types if specified. + * Creates a plain object from a FieldDescriptorProto message. Also converts values to other types if specified. * @function toObject - * @memberof google.protobuf.Field + * @memberof google.protobuf.FieldDescriptorProto * @static - * @param {google.protobuf.Field} message Field + * @param {google.protobuf.FieldDescriptorProto} message FieldDescriptorProto * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - Field.toObject = function toObject(message, options) { + FieldDescriptorProto.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.arrays || options.defaults) - object.options = []; if (options.defaults) { - object.kind = options.enums === String ? "TYPE_UNKNOWN" : 0; - object.cardinality = options.enums === String ? "CARDINALITY_UNKNOWN" : 0; - object.number = 0; object.name = ""; - object.typeUrl = ""; + 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.packed = false; object.jsonName = ""; - object.defaultValue = ""; + object.proto3Optional = false; } - if (message.kind != null && message.hasOwnProperty("kind")) - object.kind = options.enums === String ? $root.google.protobuf.Field.Kind[message.kind] === undefined ? message.kind : $root.google.protobuf.Field.Kind[message.kind] : message.kind; - if (message.cardinality != null && message.hasOwnProperty("cardinality")) - object.cardinality = options.enums === String ? $root.google.protobuf.Field.Cardinality[message.cardinality] === undefined ? message.cardinality : $root.google.protobuf.Field.Cardinality[message.cardinality] : message.cardinality; - if (message.number != null && message.hasOwnProperty("number")) - object.number = message.number; if (message.name != null && message.hasOwnProperty("name")) object.name = message.name; - if (message.typeUrl != null && message.hasOwnProperty("typeUrl")) - object.typeUrl = message.typeUrl; + 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.packed != null && message.hasOwnProperty("packed")) - object.packed = message.packed; - if (message.options && message.options.length) { - object.options = []; - for (var j = 0; j < message.options.length; ++j) - object.options[j] = $root.google.protobuf.Option.toObject(message.options[j], options); - } if (message.jsonName != null && message.hasOwnProperty("jsonName")) object.jsonName = message.jsonName; - if (message.defaultValue != null && message.hasOwnProperty("defaultValue")) - object.defaultValue = message.defaultValue; + if (message.proto3Optional != null && message.hasOwnProperty("proto3Optional")) + object.proto3Optional = message.proto3Optional; return object; }; /** - * Converts this Field to JSON. + * Converts this FieldDescriptorProto to JSON. * @function toJSON - * @memberof google.protobuf.Field + * @memberof google.protobuf.FieldDescriptorProto * @instance * @returns {Object.} JSON object */ - Field.prototype.toJSON = function toJSON() { + FieldDescriptorProto.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for Field + * Gets the default type url for FieldDescriptorProto * @function getTypeUrl - * @memberof google.protobuf.Field + * @memberof google.protobuf.FieldDescriptorProto * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - Field.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + FieldDescriptorProto.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.protobuf.Field"; + return typeUrlPrefix + "/google.protobuf.FieldDescriptorProto"; }; /** - * Kind enum. - * @name google.protobuf.Field.Kind + * Type enum. + * @name google.protobuf.FieldDescriptorProto.Type * @enum {number} - * @property {number} TYPE_UNKNOWN=0 TYPE_UNKNOWN value * @property {number} TYPE_DOUBLE=1 TYPE_DOUBLE value * @property {number} TYPE_FLOAT=2 TYPE_FLOAT value * @property {number} TYPE_INT64=3 TYPE_INT64 value @@ -3155,9 +3648,8 @@ * @property {number} TYPE_SINT32=17 TYPE_SINT32 value * @property {number} TYPE_SINT64=18 TYPE_SINT64 value */ - Field.Kind = (function() { + FieldDescriptorProto.Type = (function() { var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "TYPE_UNKNOWN"] = 0; values[valuesById[1] = "TYPE_DOUBLE"] = 1; values[valuesById[2] = "TYPE_FLOAT"] = 2; values[valuesById[3] = "TYPE_INT64"] = 3; @@ -3180,50 +3672,43 @@ })(); /** - * Cardinality enum. - * @name google.protobuf.Field.Cardinality + * Label enum. + * @name google.protobuf.FieldDescriptorProto.Label * @enum {number} - * @property {number} CARDINALITY_UNKNOWN=0 CARDINALITY_UNKNOWN value - * @property {number} CARDINALITY_OPTIONAL=1 CARDINALITY_OPTIONAL value - * @property {number} CARDINALITY_REQUIRED=2 CARDINALITY_REQUIRED value - * @property {number} CARDINALITY_REPEATED=3 CARDINALITY_REPEATED value + * @property {number} LABEL_OPTIONAL=1 LABEL_OPTIONAL value + * @property {number} LABEL_REQUIRED=2 LABEL_REQUIRED value + * @property {number} LABEL_REPEATED=3 LABEL_REPEATED value */ - Field.Cardinality = (function() { + FieldDescriptorProto.Label = (function() { var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "CARDINALITY_UNKNOWN"] = 0; - values[valuesById[1] = "CARDINALITY_OPTIONAL"] = 1; - values[valuesById[2] = "CARDINALITY_REQUIRED"] = 2; - values[valuesById[3] = "CARDINALITY_REPEATED"] = 3; + values[valuesById[1] = "LABEL_OPTIONAL"] = 1; + values[valuesById[2] = "LABEL_REQUIRED"] = 2; + values[valuesById[3] = "LABEL_REPEATED"] = 3; return values; })(); - return Field; + return FieldDescriptorProto; })(); - protobuf.Enum = (function() { + protobuf.OneofDescriptorProto = (function() { /** - * Properties of an Enum. + * Properties of an OneofDescriptorProto. * @memberof google.protobuf - * @interface IEnum - * @property {string|null} [name] Enum name - * @property {Array.|null} [enumvalue] Enum enumvalue - * @property {Array.|null} [options] Enum options - * @property {google.protobuf.ISourceContext|null} [sourceContext] Enum sourceContext - * @property {google.protobuf.Syntax|null} [syntax] Enum syntax + * @interface IOneofDescriptorProto + * @property {string|null} [name] OneofDescriptorProto name + * @property {google.protobuf.IOneofOptions|null} [options] OneofDescriptorProto options */ /** - * Constructs a new Enum. + * Constructs a new OneofDescriptorProto. * @memberof google.protobuf - * @classdesc Represents an Enum. - * @implements IEnum + * @classdesc Represents an OneofDescriptorProto. + * @implements IOneofDescriptorProto * @constructor - * @param {google.protobuf.IEnum=} [properties] Properties to set + * @param {google.protobuf.IOneofDescriptorProto=} [properties] Properties to set */ - function Enum(properties) { - this.enumvalue = []; - this.options = []; + function OneofDescriptorProto(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -3231,112 +3716,80 @@ } /** - * Enum name. + * OneofDescriptorProto name. * @member {string} name - * @memberof google.protobuf.Enum - * @instance - */ - Enum.prototype.name = ""; - - /** - * Enum enumvalue. - * @member {Array.} enumvalue - * @memberof google.protobuf.Enum - * @instance - */ - Enum.prototype.enumvalue = $util.emptyArray; - - /** - * Enum options. - * @member {Array.} options - * @memberof google.protobuf.Enum - * @instance - */ - Enum.prototype.options = $util.emptyArray; - - /** - * Enum sourceContext. - * @member {google.protobuf.ISourceContext|null|undefined} sourceContext - * @memberof google.protobuf.Enum + * @memberof google.protobuf.OneofDescriptorProto * @instance */ - Enum.prototype.sourceContext = null; + OneofDescriptorProto.prototype.name = ""; /** - * Enum syntax. - * @member {google.protobuf.Syntax} syntax - * @memberof google.protobuf.Enum + * OneofDescriptorProto options. + * @member {google.protobuf.IOneofOptions|null|undefined} options + * @memberof google.protobuf.OneofDescriptorProto * @instance */ - Enum.prototype.syntax = 0; + OneofDescriptorProto.prototype.options = null; /** - * Creates a new Enum instance using the specified properties. + * Creates a new OneofDescriptorProto instance using the specified properties. * @function create - * @memberof google.protobuf.Enum + * @memberof google.protobuf.OneofDescriptorProto * @static - * @param {google.protobuf.IEnum=} [properties] Properties to set - * @returns {google.protobuf.Enum} Enum instance + * @param {google.protobuf.IOneofDescriptorProto=} [properties] Properties to set + * @returns {google.protobuf.OneofDescriptorProto} OneofDescriptorProto instance */ - Enum.create = function create(properties) { - return new Enum(properties); + OneofDescriptorProto.create = function create(properties) { + return new OneofDescriptorProto(properties); }; /** - * Encodes the specified Enum message. Does not implicitly {@link google.protobuf.Enum.verify|verify} messages. + * Encodes the specified OneofDescriptorProto message. Does not implicitly {@link google.protobuf.OneofDescriptorProto.verify|verify} messages. * @function encode - * @memberof google.protobuf.Enum + * @memberof google.protobuf.OneofDescriptorProto * @static - * @param {google.protobuf.IEnum} message Enum message or plain object to encode + * @param {google.protobuf.IOneofDescriptorProto} message OneofDescriptorProto message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - Enum.encode = function encode(message, 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.enumvalue != null && message.enumvalue.length) - for (var i = 0; i < message.enumvalue.length; ++i) - $root.google.protobuf.EnumValue.encode(message.enumvalue[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.options != null && message.options.length) - for (var i = 0; i < message.options.length; ++i) - $root.google.protobuf.Option.encode(message.options[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - if (message.sourceContext != null && Object.hasOwnProperty.call(message, "sourceContext")) - $root.google.protobuf.SourceContext.encode(message.sourceContext, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); - if (message.syntax != null && Object.hasOwnProperty.call(message, "syntax")) - writer.uint32(/* id 5, wireType 0 =*/40).int32(message.syntax); + 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 Enum message, length delimited. Does not implicitly {@link google.protobuf.Enum.verify|verify} messages. + * Encodes the specified OneofDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.OneofDescriptorProto.verify|verify} messages. * @function encodeDelimited - * @memberof google.protobuf.Enum + * @memberof google.protobuf.OneofDescriptorProto * @static - * @param {google.protobuf.IEnum} message Enum message or plain object to encode + * @param {google.protobuf.IOneofDescriptorProto} message OneofDescriptorProto message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - Enum.encodeDelimited = function encodeDelimited(message, writer) { + OneofDescriptorProto.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes an Enum message from the specified reader or buffer. + * Decodes an OneofDescriptorProto message from the specified reader or buffer. * @function decode - * @memberof google.protobuf.Enum + * @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.Enum} Enum + * @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 */ - Enum.decode = function decode(reader, length) { + OneofDescriptorProto.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.Enum(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.OneofDescriptorProto(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { @@ -3345,23 +3798,7 @@ break; } case 2: { - if (!(message.enumvalue && message.enumvalue.length)) - message.enumvalue = []; - message.enumvalue.push($root.google.protobuf.EnumValue.decode(reader, reader.uint32())); - break; - } - case 3: { - if (!(message.options && message.options.length)) - message.options = []; - message.options.push($root.google.protobuf.Option.decode(reader, reader.uint32())); - break; - } - case 4: { - message.sourceContext = $root.google.protobuf.SourceContext.decode(reader, reader.uint32()); - break; - } - case 5: { - message.syntax = reader.int32(); + message.options = $root.google.protobuf.OneofOptions.decode(reader, reader.uint32()); break; } default: @@ -3373,218 +3810,143 @@ }; /** - * Decodes an Enum message from the specified reader or buffer, length delimited. + * Decodes an OneofDescriptorProto message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.protobuf.Enum + * @memberof google.protobuf.OneofDescriptorProto * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.Enum} Enum + * @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 */ - Enum.decodeDelimited = function decodeDelimited(reader) { + OneofDescriptorProto.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies an Enum message. + * Verifies an OneofDescriptorProto message. * @function verify - * @memberof google.protobuf.Enum + * @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 */ - Enum.verify = function verify(message) { + 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.enumvalue != null && message.hasOwnProperty("enumvalue")) { - if (!Array.isArray(message.enumvalue)) - return "enumvalue: array expected"; - for (var i = 0; i < message.enumvalue.length; ++i) { - var error = $root.google.protobuf.EnumValue.verify(message.enumvalue[i]); - if (error) - return "enumvalue." + error; - } - } if (message.options != null && message.hasOwnProperty("options")) { - if (!Array.isArray(message.options)) - return "options: array expected"; - for (var i = 0; i < message.options.length; ++i) { - var error = $root.google.protobuf.Option.verify(message.options[i]); - if (error) - return "options." + error; - } - } - if (message.sourceContext != null && message.hasOwnProperty("sourceContext")) { - var error = $root.google.protobuf.SourceContext.verify(message.sourceContext); + var error = $root.google.protobuf.OneofOptions.verify(message.options); if (error) - return "sourceContext." + error; + return "options." + error; } - if (message.syntax != null && message.hasOwnProperty("syntax")) - switch (message.syntax) { - default: - return "syntax: enum value expected"; - case 0: - case 1: - break; - } return null; }; /** - * Creates an Enum message from a plain object. Also converts values to their respective internal types. + * Creates an OneofDescriptorProto message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.protobuf.Enum + * @memberof google.protobuf.OneofDescriptorProto * @static * @param {Object.} object Plain object - * @returns {google.protobuf.Enum} Enum + * @returns {google.protobuf.OneofDescriptorProto} OneofDescriptorProto */ - Enum.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.Enum) + OneofDescriptorProto.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.OneofDescriptorProto) return object; - var message = new $root.google.protobuf.Enum(); + var message = new $root.google.protobuf.OneofDescriptorProto(); if (object.name != null) message.name = String(object.name); - if (object.enumvalue) { - if (!Array.isArray(object.enumvalue)) - throw TypeError(".google.protobuf.Enum.enumvalue: array expected"); - message.enumvalue = []; - for (var i = 0; i < object.enumvalue.length; ++i) { - if (typeof object.enumvalue[i] !== "object") - throw TypeError(".google.protobuf.Enum.enumvalue: object expected"); - message.enumvalue[i] = $root.google.protobuf.EnumValue.fromObject(object.enumvalue[i]); - } - } - if (object.options) { - if (!Array.isArray(object.options)) - throw TypeError(".google.protobuf.Enum.options: array expected"); - message.options = []; - for (var i = 0; i < object.options.length; ++i) { - if (typeof object.options[i] !== "object") - throw TypeError(".google.protobuf.Enum.options: object expected"); - message.options[i] = $root.google.protobuf.Option.fromObject(object.options[i]); - } - } - if (object.sourceContext != null) { - if (typeof object.sourceContext !== "object") - throw TypeError(".google.protobuf.Enum.sourceContext: object expected"); - message.sourceContext = $root.google.protobuf.SourceContext.fromObject(object.sourceContext); - } - switch (object.syntax) { - default: - if (typeof object.syntax === "number") { - message.syntax = object.syntax; - break; - } - break; - case "SYNTAX_PROTO2": - case 0: - message.syntax = 0; - break; - case "SYNTAX_PROTO3": - case 1: - message.syntax = 1; - break; + 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 Enum message. Also converts values to other types if specified. + * Creates a plain object from an OneofDescriptorProto message. Also converts values to other types if specified. * @function toObject - * @memberof google.protobuf.Enum + * @memberof google.protobuf.OneofDescriptorProto * @static - * @param {google.protobuf.Enum} message Enum + * @param {google.protobuf.OneofDescriptorProto} message OneofDescriptorProto * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - Enum.toObject = function toObject(message, options) { + OneofDescriptorProto.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.arrays || options.defaults) { - object.enumvalue = []; - object.options = []; - } if (options.defaults) { object.name = ""; - object.sourceContext = null; - object.syntax = options.enums === String ? "SYNTAX_PROTO2" : 0; + object.options = null; } if (message.name != null && message.hasOwnProperty("name")) object.name = message.name; - if (message.enumvalue && message.enumvalue.length) { - object.enumvalue = []; - for (var j = 0; j < message.enumvalue.length; ++j) - object.enumvalue[j] = $root.google.protobuf.EnumValue.toObject(message.enumvalue[j], options); - } - if (message.options && message.options.length) { - object.options = []; - for (var j = 0; j < message.options.length; ++j) - object.options[j] = $root.google.protobuf.Option.toObject(message.options[j], options); - } - if (message.sourceContext != null && message.hasOwnProperty("sourceContext")) - object.sourceContext = $root.google.protobuf.SourceContext.toObject(message.sourceContext, options); - if (message.syntax != null && message.hasOwnProperty("syntax")) - object.syntax = options.enums === String ? $root.google.protobuf.Syntax[message.syntax] === undefined ? message.syntax : $root.google.protobuf.Syntax[message.syntax] : message.syntax; + if (message.options != null && message.hasOwnProperty("options")) + object.options = $root.google.protobuf.OneofOptions.toObject(message.options, options); return object; }; /** - * Converts this Enum to JSON. + * Converts this OneofDescriptorProto to JSON. * @function toJSON - * @memberof google.protobuf.Enum + * @memberof google.protobuf.OneofDescriptorProto * @instance * @returns {Object.} JSON object */ - Enum.prototype.toJSON = function toJSON() { + OneofDescriptorProto.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for Enum + * Gets the default type url for OneofDescriptorProto * @function getTypeUrl - * @memberof google.protobuf.Enum + * @memberof google.protobuf.OneofDescriptorProto * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - Enum.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + OneofDescriptorProto.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.protobuf.Enum"; + return typeUrlPrefix + "/google.protobuf.OneofDescriptorProto"; }; - return Enum; + return OneofDescriptorProto; })(); - protobuf.EnumValue = (function() { + protobuf.EnumDescriptorProto = (function() { /** - * Properties of an EnumValue. + * Properties of an EnumDescriptorProto. * @memberof google.protobuf - * @interface IEnumValue - * @property {string|null} [name] EnumValue name - * @property {number|null} [number] EnumValue number - * @property {Array.|null} [options] EnumValue options + * @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 EnumValue. + * Constructs a new EnumDescriptorProto. * @memberof google.protobuf - * @classdesc Represents an EnumValue. - * @implements IEnumValue + * @classdesc Represents an EnumDescriptorProto. + * @implements IEnumDescriptorProto * @constructor - * @param {google.protobuf.IEnumValue=} [properties] Properties to set + * @param {google.protobuf.IEnumDescriptorProto=} [properties] Properties to set */ - function EnumValue(properties) { - this.options = []; + 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) @@ -3592,91 +3954,113 @@ } /** - * EnumValue name. + * EnumDescriptorProto name. * @member {string} name - * @memberof google.protobuf.EnumValue + * @memberof google.protobuf.EnumDescriptorProto * @instance */ - EnumValue.prototype.name = ""; + EnumDescriptorProto.prototype.name = ""; /** - * EnumValue number. - * @member {number} number - * @memberof google.protobuf.EnumValue + * EnumDescriptorProto value. + * @member {Array.} value + * @memberof google.protobuf.EnumDescriptorProto * @instance */ - EnumValue.prototype.number = 0; + EnumDescriptorProto.prototype.value = $util.emptyArray; /** - * EnumValue options. - * @member {Array.} options - * @memberof google.protobuf.EnumValue + * EnumDescriptorProto options. + * @member {google.protobuf.IEnumOptions|null|undefined} options + * @memberof google.protobuf.EnumDescriptorProto * @instance */ - EnumValue.prototype.options = $util.emptyArray; + EnumDescriptorProto.prototype.options = null; /** - * Creates a new EnumValue instance using the specified properties. + * 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.EnumValue + * @memberof google.protobuf.EnumDescriptorProto * @static - * @param {google.protobuf.IEnumValue=} [properties] Properties to set - * @returns {google.protobuf.EnumValue} EnumValue instance + * @param {google.protobuf.IEnumDescriptorProto=} [properties] Properties to set + * @returns {google.protobuf.EnumDescriptorProto} EnumDescriptorProto instance */ - EnumValue.create = function create(properties) { - return new EnumValue(properties); + EnumDescriptorProto.create = function create(properties) { + return new EnumDescriptorProto(properties); }; /** - * Encodes the specified EnumValue message. Does not implicitly {@link google.protobuf.EnumValue.verify|verify} messages. + * Encodes the specified EnumDescriptorProto message. Does not implicitly {@link google.protobuf.EnumDescriptorProto.verify|verify} messages. * @function encode - * @memberof google.protobuf.EnumValue + * @memberof google.protobuf.EnumDescriptorProto * @static - * @param {google.protobuf.IEnumValue} message EnumValue message or plain object to encode + * @param {google.protobuf.IEnumDescriptorProto} message EnumDescriptorProto message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - EnumValue.encode = function encode(message, 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.number != null && Object.hasOwnProperty.call(message, "number")) - writer.uint32(/* id 2, wireType 0 =*/16).int32(message.number); - if (message.options != null && message.options.length) - for (var i = 0; i < message.options.length; ++i) - $root.google.protobuf.Option.encode(message.options[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + 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 EnumValue message, length delimited. Does not implicitly {@link google.protobuf.EnumValue.verify|verify} messages. + * Encodes the specified EnumDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.EnumDescriptorProto.verify|verify} messages. * @function encodeDelimited - * @memberof google.protobuf.EnumValue + * @memberof google.protobuf.EnumDescriptorProto * @static - * @param {google.protobuf.IEnumValue} message EnumValue message or plain object to encode + * @param {google.protobuf.IEnumDescriptorProto} message EnumDescriptorProto message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - EnumValue.encodeDelimited = function encodeDelimited(message, writer) { + EnumDescriptorProto.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes an EnumValue message from the specified reader or buffer. + * Decodes an EnumDescriptorProto message from the specified reader or buffer. * @function decode - * @memberof google.protobuf.EnumValue + * @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.EnumValue} EnumValue + * @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 */ - EnumValue.decode = function decode(reader, length) { + EnumDescriptorProto.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.EnumValue(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.EnumDescriptorProto(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { @@ -3685,13 +4069,25 @@ break; } case 2: { - message.number = reader.int32(); + if (!(message.value && message.value.length)) + message.value = []; + message.value.push($root.google.protobuf.EnumValueDescriptorProto.decode(reader, reader.uint32())); break; } case 3: { - if (!(message.options && message.options.length)) - message.options = []; - message.options.push($root.google.protobuf.Option.decode(reader, reader.uint32())); + 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: @@ -3703,158 +4099,437 @@ }; /** - * Decodes an EnumValue message from the specified reader or buffer, length delimited. + * Decodes an EnumDescriptorProto message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.protobuf.EnumValue + * @memberof google.protobuf.EnumDescriptorProto * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.EnumValue} EnumValue + * @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 */ - EnumValue.decodeDelimited = function decodeDelimited(reader) { + EnumDescriptorProto.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies an EnumValue message. + * Verifies an EnumDescriptorProto message. * @function verify - * @memberof google.protobuf.EnumValue + * @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 */ - EnumValue.verify = function verify(message) { + 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.number != null && message.hasOwnProperty("number")) - if (!$util.isInteger(message.number)) - return "number: integer 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")) { - if (!Array.isArray(message.options)) - return "options: array expected"; - for (var i = 0; i < message.options.length; ++i) { - var error = $root.google.protobuf.Option.verify(message.options[i]); + 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 "options." + 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 EnumValue message from a plain object. Also converts values to their respective internal types. + * Creates an EnumDescriptorProto message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.protobuf.EnumValue + * @memberof google.protobuf.EnumDescriptorProto * @static * @param {Object.} object Plain object - * @returns {google.protobuf.EnumValue} EnumValue + * @returns {google.protobuf.EnumDescriptorProto} EnumDescriptorProto */ - EnumValue.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.EnumValue) + EnumDescriptorProto.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.EnumDescriptorProto) return object; - var message = new $root.google.protobuf.EnumValue(); + var message = new $root.google.protobuf.EnumDescriptorProto(); if (object.name != null) message.name = String(object.name); - if (object.number != null) - message.number = object.number | 0; - if (object.options) { - if (!Array.isArray(object.options)) - throw TypeError(".google.protobuf.EnumValue.options: array expected"); - message.options = []; - for (var i = 0; i < object.options.length; ++i) { - if (typeof object.options[i] !== "object") - throw TypeError(".google.protobuf.EnumValue.options: object expected"); - message.options[i] = $root.google.protobuf.Option.fromObject(object.options[i]); + 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 EnumValue message. Also converts values to other types if specified. + * Creates a plain object from an EnumDescriptorProto message. Also converts values to other types if specified. * @function toObject - * @memberof google.protobuf.EnumValue + * @memberof google.protobuf.EnumDescriptorProto * @static - * @param {google.protobuf.EnumValue} message EnumValue + * @param {google.protobuf.EnumDescriptorProto} message EnumDescriptorProto * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - EnumValue.toObject = function toObject(message, options) { + EnumDescriptorProto.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.arrays || options.defaults) - object.options = []; + if (options.arrays || options.defaults) { + object.value = []; + object.reservedRange = []; + object.reservedName = []; + } 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 && message.options.length) { - object.options = []; - for (var j = 0; j < message.options.length; ++j) - object.options[j] = $root.google.protobuf.Option.toObject(message.options[j], options); + 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 EnumValue to JSON. + * Converts this EnumDescriptorProto to JSON. * @function toJSON - * @memberof google.protobuf.EnumValue + * @memberof google.protobuf.EnumDescriptorProto * @instance * @returns {Object.} JSON object */ - EnumValue.prototype.toJSON = function toJSON() { + EnumDescriptorProto.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for EnumValue + * Gets the default type url for EnumDescriptorProto * @function getTypeUrl - * @memberof google.protobuf.EnumValue + * @memberof google.protobuf.EnumDescriptorProto * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - EnumValue.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + EnumDescriptorProto.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.protobuf.EnumValue"; + return typeUrlPrefix + "/google.protobuf.EnumDescriptorProto"; }; - return EnumValue; + 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) { + 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(); + 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.Option = (function() { + protobuf.EnumValueDescriptorProto = (function() { /** - * Properties of an Option. + * Properties of an EnumValueDescriptorProto. * @memberof google.protobuf - * @interface IOption - * @property {string|null} [name] Option name - * @property {google.protobuf.IAny|null} [value] Option value + * @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 Option. + * Constructs a new EnumValueDescriptorProto. * @memberof google.protobuf - * @classdesc Represents an Option. - * @implements IOption + * @classdesc Represents an EnumValueDescriptorProto. + * @implements IEnumValueDescriptorProto * @constructor - * @param {google.protobuf.IOption=} [properties] Properties to set + * @param {google.protobuf.IEnumValueDescriptorProto=} [properties] Properties to set */ - function Option(properties) { + function EnumValueDescriptorProto(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -3862,80 +4537,90 @@ } /** - * Option name. + * EnumValueDescriptorProto name. * @member {string} name - * @memberof google.protobuf.Option + * @memberof google.protobuf.EnumValueDescriptorProto * @instance */ - Option.prototype.name = ""; + EnumValueDescriptorProto.prototype.name = ""; /** - * Option value. - * @member {google.protobuf.IAny|null|undefined} value - * @memberof google.protobuf.Option + * EnumValueDescriptorProto number. + * @member {number} number + * @memberof google.protobuf.EnumValueDescriptorProto * @instance */ - Option.prototype.value = null; + EnumValueDescriptorProto.prototype.number = 0; /** - * Creates a new Option instance using the specified properties. + * 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.Option + * @memberof google.protobuf.EnumValueDescriptorProto * @static - * @param {google.protobuf.IOption=} [properties] Properties to set - * @returns {google.protobuf.Option} Option instance + * @param {google.protobuf.IEnumValueDescriptorProto=} [properties] Properties to set + * @returns {google.protobuf.EnumValueDescriptorProto} EnumValueDescriptorProto instance */ - Option.create = function create(properties) { - return new Option(properties); + EnumValueDescriptorProto.create = function create(properties) { + return new EnumValueDescriptorProto(properties); }; /** - * Encodes the specified Option message. Does not implicitly {@link google.protobuf.Option.verify|verify} messages. + * Encodes the specified EnumValueDescriptorProto message. Does not implicitly {@link google.protobuf.EnumValueDescriptorProto.verify|verify} messages. * @function encode - * @memberof google.protobuf.Option + * @memberof google.protobuf.EnumValueDescriptorProto * @static - * @param {google.protobuf.IOption} message Option message or plain object to encode + * @param {google.protobuf.IEnumValueDescriptorProto} message EnumValueDescriptorProto message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - Option.encode = function encode(message, 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.value != null && Object.hasOwnProperty.call(message, "value")) - $root.google.protobuf.Any.encode(message.value, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + 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 Option message, length delimited. Does not implicitly {@link google.protobuf.Option.verify|verify} messages. + * Encodes the specified EnumValueDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.EnumValueDescriptorProto.verify|verify} messages. * @function encodeDelimited - * @memberof google.protobuf.Option + * @memberof google.protobuf.EnumValueDescriptorProto * @static - * @param {google.protobuf.IOption} message Option message or plain object to encode + * @param {google.protobuf.IEnumValueDescriptorProto} message EnumValueDescriptorProto message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - Option.encodeDelimited = function encodeDelimited(message, writer) { + EnumValueDescriptorProto.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes an Option message from the specified reader or buffer. + * Decodes an EnumValueDescriptorProto message from the specified reader or buffer. * @function decode - * @memberof google.protobuf.Option + * @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.Option} Option + * @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 */ - Option.decode = function decode(reader, length) { + EnumValueDescriptorProto.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.Option(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.EnumValueDescriptorProto(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { @@ -3944,7 +4629,11 @@ break; } case 2: { - message.value = $root.google.protobuf.Any.decode(reader, reader.uint32()); + message.number = reader.int32(); + break; + } + case 3: { + message.options = $root.google.protobuf.EnumValueOptions.decode(reader, reader.uint32()); break; } default: @@ -3956,151 +4645,147 @@ }; /** - * Decodes an Option message from the specified reader or buffer, length delimited. + * Decodes an EnumValueDescriptorProto message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.protobuf.Option + * @memberof google.protobuf.EnumValueDescriptorProto * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.Option} Option + * @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 */ - Option.decodeDelimited = function decodeDelimited(reader) { + EnumValueDescriptorProto.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies an Option message. + * Verifies an EnumValueDescriptorProto message. * @function verify - * @memberof google.protobuf.Option + * @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 */ - Option.verify = function verify(message) { + 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.value != null && message.hasOwnProperty("value")) { - var error = $root.google.protobuf.Any.verify(message.value); + 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 "value." + error; + return "options." + error; } return null; }; /** - * Creates an Option message from a plain object. Also converts values to their respective internal types. + * Creates an EnumValueDescriptorProto message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.protobuf.Option + * @memberof google.protobuf.EnumValueDescriptorProto * @static * @param {Object.} object Plain object - * @returns {google.protobuf.Option} Option + * @returns {google.protobuf.EnumValueDescriptorProto} EnumValueDescriptorProto */ - Option.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.Option) + EnumValueDescriptorProto.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.EnumValueDescriptorProto) return object; - var message = new $root.google.protobuf.Option(); + var message = new $root.google.protobuf.EnumValueDescriptorProto(); if (object.name != null) message.name = String(object.name); - if (object.value != null) { - if (typeof object.value !== "object") - throw TypeError(".google.protobuf.Option.value: object expected"); - message.value = $root.google.protobuf.Any.fromObject(object.value); + 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 Option message. Also converts values to other types if specified. + * Creates a plain object from an EnumValueDescriptorProto message. Also converts values to other types if specified. * @function toObject - * @memberof google.protobuf.Option + * @memberof google.protobuf.EnumValueDescriptorProto * @static - * @param {google.protobuf.Option} message Option + * @param {google.protobuf.EnumValueDescriptorProto} message EnumValueDescriptorProto * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - Option.toObject = function toObject(message, options) { + EnumValueDescriptorProto.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; if (options.defaults) { object.name = ""; - object.value = null; + object.number = 0; + object.options = null; } if (message.name != null && message.hasOwnProperty("name")) object.name = message.name; - if (message.value != null && message.hasOwnProperty("value")) - object.value = $root.google.protobuf.Any.toObject(message.value, options); + 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 Option to JSON. + * Converts this EnumValueDescriptorProto to JSON. * @function toJSON - * @memberof google.protobuf.Option + * @memberof google.protobuf.EnumValueDescriptorProto * @instance * @returns {Object.} JSON object */ - Option.prototype.toJSON = function toJSON() { + EnumValueDescriptorProto.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for Option + * Gets the default type url for EnumValueDescriptorProto * @function getTypeUrl - * @memberof google.protobuf.Option + * @memberof google.protobuf.EnumValueDescriptorProto * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - Option.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + EnumValueDescriptorProto.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.protobuf.Option"; + return typeUrlPrefix + "/google.protobuf.EnumValueDescriptorProto"; }; - return Option; - })(); - - /** - * Syntax enum. - * @name google.protobuf.Syntax - * @enum {number} - * @property {number} SYNTAX_PROTO2=0 SYNTAX_PROTO2 value - * @property {number} SYNTAX_PROTO3=1 SYNTAX_PROTO3 value - */ - protobuf.Syntax = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "SYNTAX_PROTO2"] = 0; - values[valuesById[1] = "SYNTAX_PROTO3"] = 1; - return values; + return EnumValueDescriptorProto; })(); - protobuf.Any = (function() { + protobuf.ServiceDescriptorProto = (function() { /** - * Properties of an Any. + * Properties of a ServiceDescriptorProto. * @memberof google.protobuf - * @interface IAny - * @property {string|null} [type_url] Any type_url - * @property {Uint8Array|null} [value] Any value + * @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 Any. + * Constructs a new ServiceDescriptorProto. * @memberof google.protobuf - * @classdesc Represents an Any. - * @implements IAny + * @classdesc Represents a ServiceDescriptorProto. + * @implements IServiceDescriptorProto * @constructor - * @param {google.protobuf.IAny=} [properties] Properties to set + * @param {google.protobuf.IServiceDescriptorProto=} [properties] Properties to set */ - function Any(properties) { + function ServiceDescriptorProto(properties) { + this.method = []; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -4108,89 +4793,106 @@ } /** - * Any type_url. - * @member {string} type_url - * @memberof google.protobuf.Any + * ServiceDescriptorProto name. + * @member {string} name + * @memberof google.protobuf.ServiceDescriptorProto * @instance */ - Any.prototype.type_url = ""; + ServiceDescriptorProto.prototype.name = ""; /** - * Any value. - * @member {Uint8Array} value - * @memberof google.protobuf.Any + * ServiceDescriptorProto method. + * @member {Array.} method + * @memberof google.protobuf.ServiceDescriptorProto * @instance */ - Any.prototype.value = $util.newBuffer([]); + ServiceDescriptorProto.prototype.method = $util.emptyArray; /** - * Creates a new Any instance using the specified properties. + * 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.Any + * @memberof google.protobuf.ServiceDescriptorProto * @static - * @param {google.protobuf.IAny=} [properties] Properties to set - * @returns {google.protobuf.Any} Any instance + * @param {google.protobuf.IServiceDescriptorProto=} [properties] Properties to set + * @returns {google.protobuf.ServiceDescriptorProto} ServiceDescriptorProto instance */ - Any.create = function create(properties) { - return new Any(properties); + ServiceDescriptorProto.create = function create(properties) { + return new ServiceDescriptorProto(properties); }; /** - * Encodes the specified Any message. Does not implicitly {@link google.protobuf.Any.verify|verify} messages. + * Encodes the specified ServiceDescriptorProto message. Does not implicitly {@link google.protobuf.ServiceDescriptorProto.verify|verify} messages. * @function encode - * @memberof google.protobuf.Any + * @memberof google.protobuf.ServiceDescriptorProto * @static - * @param {google.protobuf.IAny} message Any message or plain object to encode + * @param {google.protobuf.IServiceDescriptorProto} message ServiceDescriptorProto message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - Any.encode = function encode(message, writer) { + ServiceDescriptorProto.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); + 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 Any message, length delimited. Does not implicitly {@link google.protobuf.Any.verify|verify} messages. + * Encodes the specified ServiceDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.ServiceDescriptorProto.verify|verify} messages. * @function encodeDelimited - * @memberof google.protobuf.Any + * @memberof google.protobuf.ServiceDescriptorProto * @static - * @param {google.protobuf.IAny} message Any message or plain object to encode + * @param {google.protobuf.IServiceDescriptorProto} message ServiceDescriptorProto message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - Any.encodeDelimited = function encodeDelimited(message, writer) { + ServiceDescriptorProto.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes an Any message from the specified reader or buffer. + * Decodes a ServiceDescriptorProto message from the specified reader or buffer. * @function decode - * @memberof google.protobuf.Any + * @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.Any} Any + * @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 */ - Any.decode = function decode(reader, length) { + ServiceDescriptorProto.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.Any(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.ServiceDescriptorProto(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: { - message.type_url = reader.string(); + message.name = reader.string(); break; } case 2: { - message.value = reader.bytes(); + 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: @@ -4202,141 +4904,167 @@ }; /** - * Decodes an Any message from the specified reader or buffer, length delimited. + * Decodes a ServiceDescriptorProto message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.protobuf.Any + * @memberof google.protobuf.ServiceDescriptorProto * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.Any} Any + * @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 */ - Any.decodeDelimited = function decodeDelimited(reader) { + ServiceDescriptorProto.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies an Any message. + * Verifies a ServiceDescriptorProto message. * @function verify - * @memberof google.protobuf.Any + * @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 */ - Any.verify = function verify(message) { + ServiceDescriptorProto.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"; + 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 an Any message from a plain object. Also converts values to their respective internal types. + * Creates a ServiceDescriptorProto message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.protobuf.Any + * @memberof google.protobuf.ServiceDescriptorProto * @static * @param {Object.} object Plain object - * @returns {google.protobuf.Any} Any + * @returns {google.protobuf.ServiceDescriptorProto} ServiceDescriptorProto */ - Any.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.Any) + ServiceDescriptorProto.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.ServiceDescriptorProto) 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; + 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 an Any message. Also converts values to other types if specified. + * Creates a plain object from a ServiceDescriptorProto message. Also converts values to other types if specified. * @function toObject - * @memberof google.protobuf.Any + * @memberof google.protobuf.ServiceDescriptorProto * @static - * @param {google.protobuf.Any} message Any + * @param {google.protobuf.ServiceDescriptorProto} message ServiceDescriptorProto * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - Any.toObject = function toObject(message, options) { + ServiceDescriptorProto.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; + if (options.arrays || options.defaults) + object.method = []; 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); - } + object.name = ""; + object.options = null; } - 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; + 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 Any to JSON. + * Converts this ServiceDescriptorProto to JSON. * @function toJSON - * @memberof google.protobuf.Any + * @memberof google.protobuf.ServiceDescriptorProto * @instance * @returns {Object.} JSON object */ - Any.prototype.toJSON = function toJSON() { + ServiceDescriptorProto.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for Any + * Gets the default type url for ServiceDescriptorProto * @function getTypeUrl - * @memberof google.protobuf.Any + * @memberof google.protobuf.ServiceDescriptorProto * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - Any.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + ServiceDescriptorProto.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.protobuf.Any"; + return typeUrlPrefix + "/google.protobuf.ServiceDescriptorProto"; }; - return Any; + return ServiceDescriptorProto; })(); - protobuf.FileDescriptorSet = (function() { + protobuf.MethodDescriptorProto = (function() { /** - * Properties of a FileDescriptorSet. + * Properties of a MethodDescriptorProto. * @memberof google.protobuf - * @interface IFileDescriptorSet - * @property {Array.|null} [file] FileDescriptorSet file + * @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 FileDescriptorSet. + * Constructs a new MethodDescriptorProto. * @memberof google.protobuf - * @classdesc Represents a FileDescriptorSet. - * @implements IFileDescriptorSet + * @classdesc Represents a MethodDescriptorProto. + * @implements IMethodDescriptorProto * @constructor - * @param {google.protobuf.IFileDescriptorSet=} [properties] Properties to set + * @param {google.protobuf.IMethodDescriptorProto=} [properties] Properties to set */ - function FileDescriptorSet(properties) { - this.file = []; + function MethodDescriptorProto(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -4344,78 +5072,145 @@ } /** - * FileDescriptorSet file. - * @member {Array.} file - * @memberof google.protobuf.FileDescriptorSet + * MethodDescriptorProto name. + * @member {string} name + * @memberof google.protobuf.MethodDescriptorProto * @instance */ - FileDescriptorSet.prototype.file = $util.emptyArray; + MethodDescriptorProto.prototype.name = ""; /** - * Creates a new FileDescriptorSet instance using the specified properties. + * 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.FileDescriptorSet + * @memberof google.protobuf.MethodDescriptorProto * @static - * @param {google.protobuf.IFileDescriptorSet=} [properties] Properties to set - * @returns {google.protobuf.FileDescriptorSet} FileDescriptorSet instance + * @param {google.protobuf.IMethodDescriptorProto=} [properties] Properties to set + * @returns {google.protobuf.MethodDescriptorProto} MethodDescriptorProto instance */ - FileDescriptorSet.create = function create(properties) { - return new FileDescriptorSet(properties); + MethodDescriptorProto.create = function create(properties) { + return new MethodDescriptorProto(properties); }; /** - * Encodes the specified FileDescriptorSet message. Does not implicitly {@link google.protobuf.FileDescriptorSet.verify|verify} messages. + * Encodes the specified MethodDescriptorProto message. Does not implicitly {@link google.protobuf.MethodDescriptorProto.verify|verify} messages. * @function encode - * @memberof google.protobuf.FileDescriptorSet + * @memberof google.protobuf.MethodDescriptorProto * @static - * @param {google.protobuf.IFileDescriptorSet} message FileDescriptorSet message or plain object to encode + * @param {google.protobuf.IMethodDescriptorProto} message MethodDescriptorProto message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - FileDescriptorSet.encode = function encode(message, writer) { + MethodDescriptorProto.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.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 FileDescriptorSet message, length delimited. Does not implicitly {@link google.protobuf.FileDescriptorSet.verify|verify} messages. + * Encodes the specified MethodDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.MethodDescriptorProto.verify|verify} messages. * @function encodeDelimited - * @memberof google.protobuf.FileDescriptorSet + * @memberof google.protobuf.MethodDescriptorProto * @static - * @param {google.protobuf.IFileDescriptorSet} message FileDescriptorSet message or plain object to encode + * @param {google.protobuf.IMethodDescriptorProto} message MethodDescriptorProto message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - FileDescriptorSet.encodeDelimited = function encodeDelimited(message, writer) { + MethodDescriptorProto.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a FileDescriptorSet message from the specified reader or buffer. + * Decodes a MethodDescriptorProto message from the specified reader or buffer. * @function decode - * @memberof google.protobuf.FileDescriptorSet + * @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.FileDescriptorSet} FileDescriptorSet + * @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 */ - FileDescriptorSet.decode = function decode(reader, length) { + MethodDescriptorProto.decode = function decode(reader, length) { 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.protobuf.MethodDescriptorProto(); while (reader.pos < end) { var tag = reader.uint32(); 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.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: @@ -4427,158 +5222,191 @@ }; /** - * Decodes a FileDescriptorSet message from the specified reader or buffer, length delimited. + * Decodes a MethodDescriptorProto message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.protobuf.FileDescriptorSet + * @memberof google.protobuf.MethodDescriptorProto * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.FileDescriptorSet} FileDescriptorSet + * @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 */ - FileDescriptorSet.decodeDelimited = function decodeDelimited(reader) { + MethodDescriptorProto.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a FileDescriptorSet message. + * Verifies a MethodDescriptorProto message. * @function verify - * @memberof google.protobuf.FileDescriptorSet + * @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 */ - FileDescriptorSet.verify = function verify(message) { + MethodDescriptorProto.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.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 FileDescriptorSet message from a plain object. Also converts values to their respective internal types. + * Creates a MethodDescriptorProto message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.protobuf.FileDescriptorSet + * @memberof google.protobuf.MethodDescriptorProto * @static * @param {Object.} object Plain object - * @returns {google.protobuf.FileDescriptorSet} FileDescriptorSet + * @returns {google.protobuf.MethodDescriptorProto} MethodDescriptorProto */ - FileDescriptorSet.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.FileDescriptorSet) + MethodDescriptorProto.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.MethodDescriptorProto) 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]); - } + 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 FileDescriptorSet message. Also converts values to other types if specified. + * Creates a plain object from a MethodDescriptorProto message. Also converts values to other types if specified. * @function toObject - * @memberof google.protobuf.FileDescriptorSet + * @memberof google.protobuf.MethodDescriptorProto * @static - * @param {google.protobuf.FileDescriptorSet} message FileDescriptorSet + * @param {google.protobuf.MethodDescriptorProto} message MethodDescriptorProto * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - FileDescriptorSet.toObject = function toObject(message, options) { + MethodDescriptorProto.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); + 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 FileDescriptorSet to JSON. + * Converts this MethodDescriptorProto to JSON. * @function toJSON - * @memberof google.protobuf.FileDescriptorSet + * @memberof google.protobuf.MethodDescriptorProto * @instance * @returns {Object.} JSON object */ - FileDescriptorSet.prototype.toJSON = function toJSON() { + MethodDescriptorProto.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for FileDescriptorSet + * Gets the default type url for MethodDescriptorProto * @function getTypeUrl - * @memberof google.protobuf.FileDescriptorSet + * @memberof google.protobuf.MethodDescriptorProto * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - FileDescriptorSet.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + MethodDescriptorProto.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.protobuf.FileDescriptorSet"; + return typeUrlPrefix + "/google.protobuf.MethodDescriptorProto"; }; - return FileDescriptorSet; + return MethodDescriptorProto; })(); - protobuf.FileDescriptorProto = (function() { + protobuf.FileOptions = (function() { /** - * Properties of a FileDescriptorProto. + * Properties of a FileOptions. * @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 {string|null} [edition] FileDescriptorProto edition - */ - - /** - * Constructs a new FileDescriptorProto. + * @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} [phpGenericServices] FileOptions phpGenericServices + * @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 {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 FileDescriptorProto. - * @implements IFileDescriptorProto + * @classdesc Represents a FileOptions. + * @implements IFileOptions * @constructor - * @param {google.protobuf.IFileDescriptorProto=} [properties] Properties to set + * @param {google.protobuf.IFileOptions=} [properties] Properties to set */ - function FileDescriptorProto(properties) { - this.dependency = []; - this.publicDependency = []; - this.weakDependency = []; - this.messageType = []; - this.enumType = []; - this.service = []; - this.extension = []; + 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) @@ -4586,274 +5414,375 @@ } /** - * FileDescriptorProto name. - * @member {string} name - * @memberof google.protobuf.FileDescriptorProto + * FileOptions javaPackage. + * @member {string} javaPackage + * @memberof google.protobuf.FileOptions * @instance */ - FileDescriptorProto.prototype.name = ""; + FileOptions.prototype.javaPackage = ""; /** - * FileDescriptorProto package. - * @member {string} package - * @memberof google.protobuf.FileDescriptorProto + * FileOptions javaOuterClassname. + * @member {string} javaOuterClassname + * @memberof google.protobuf.FileOptions * @instance */ - FileDescriptorProto.prototype["package"] = ""; + FileOptions.prototype.javaOuterClassname = ""; /** - * FileDescriptorProto dependency. - * @member {Array.} dependency - * @memberof google.protobuf.FileDescriptorProto + * FileOptions javaMultipleFiles. + * @member {boolean} javaMultipleFiles + * @memberof google.protobuf.FileOptions * @instance */ - FileDescriptorProto.prototype.dependency = $util.emptyArray; + FileOptions.prototype.javaMultipleFiles = false; /** - * FileDescriptorProto publicDependency. - * @member {Array.} publicDependency - * @memberof google.protobuf.FileDescriptorProto + * FileOptions javaGenerateEqualsAndHash. + * @member {boolean} javaGenerateEqualsAndHash + * @memberof google.protobuf.FileOptions * @instance */ - FileDescriptorProto.prototype.publicDependency = $util.emptyArray; + FileOptions.prototype.javaGenerateEqualsAndHash = false; /** - * FileDescriptorProto weakDependency. - * @member {Array.} weakDependency - * @memberof google.protobuf.FileDescriptorProto + * FileOptions javaStringCheckUtf8. + * @member {boolean} javaStringCheckUtf8 + * @memberof google.protobuf.FileOptions * @instance */ - FileDescriptorProto.prototype.weakDependency = $util.emptyArray; + FileOptions.prototype.javaStringCheckUtf8 = false; /** - * FileDescriptorProto messageType. - * @member {Array.} messageType - * @memberof google.protobuf.FileDescriptorProto + * FileOptions optimizeFor. + * @member {google.protobuf.FileOptions.OptimizeMode} optimizeFor + * @memberof google.protobuf.FileOptions * @instance */ - FileDescriptorProto.prototype.messageType = $util.emptyArray; + FileOptions.prototype.optimizeFor = 1; /** - * FileDescriptorProto enumType. - * @member {Array.} enumType - * @memberof google.protobuf.FileDescriptorProto + * FileOptions goPackage. + * @member {string} goPackage + * @memberof google.protobuf.FileOptions * @instance */ - FileDescriptorProto.prototype.enumType = $util.emptyArray; + FileOptions.prototype.goPackage = ""; /** - * FileDescriptorProto service. - * @member {Array.} service - * @memberof google.protobuf.FileDescriptorProto + * FileOptions ccGenericServices. + * @member {boolean} ccGenericServices + * @memberof google.protobuf.FileOptions * @instance */ - FileDescriptorProto.prototype.service = $util.emptyArray; + FileOptions.prototype.ccGenericServices = false; /** - * FileDescriptorProto extension. - * @member {Array.} extension - * @memberof google.protobuf.FileDescriptorProto + * FileOptions javaGenericServices. + * @member {boolean} javaGenericServices + * @memberof google.protobuf.FileOptions * @instance */ - FileDescriptorProto.prototype.extension = $util.emptyArray; + FileOptions.prototype.javaGenericServices = false; /** - * FileDescriptorProto options. - * @member {google.protobuf.IFileOptions|null|undefined} options - * @memberof google.protobuf.FileDescriptorProto + * FileOptions pyGenericServices. + * @member {boolean} pyGenericServices + * @memberof google.protobuf.FileOptions * @instance */ - FileDescriptorProto.prototype.options = null; + FileOptions.prototype.pyGenericServices = false; /** - * FileDescriptorProto sourceCodeInfo. - * @member {google.protobuf.ISourceCodeInfo|null|undefined} sourceCodeInfo - * @memberof google.protobuf.FileDescriptorProto + * FileOptions phpGenericServices. + * @member {boolean} phpGenericServices + * @memberof google.protobuf.FileOptions * @instance */ - FileDescriptorProto.prototype.sourceCodeInfo = null; + FileOptions.prototype.phpGenericServices = false; /** - * FileDescriptorProto syntax. - * @member {string} syntax - * @memberof google.protobuf.FileDescriptorProto + * FileOptions deprecated. + * @member {boolean} deprecated + * @memberof google.protobuf.FileOptions * @instance */ - FileDescriptorProto.prototype.syntax = ""; + FileOptions.prototype.deprecated = false; /** - * FileDescriptorProto edition. - * @member {string} edition - * @memberof google.protobuf.FileDescriptorProto + * FileOptions ccEnableArenas. + * @member {boolean} ccEnableArenas + * @memberof google.protobuf.FileOptions * @instance */ - FileDescriptorProto.prototype.edition = ""; + FileOptions.prototype.ccEnableArenas = true; /** - * Creates a new FileDescriptorProto instance using the specified properties. + * 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 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.FileDescriptorProto + * @memberof google.protobuf.FileOptions * @static - * @param {google.protobuf.IFileDescriptorProto=} [properties] Properties to set - * @returns {google.protobuf.FileDescriptorProto} FileDescriptorProto instance + * @param {google.protobuf.IFileOptions=} [properties] Properties to set + * @returns {google.protobuf.FileOptions} FileOptions instance */ - FileDescriptorProto.create = function create(properties) { - return new FileDescriptorProto(properties); + FileOptions.create = function create(properties) { + return new FileOptions(properties); }; /** - * Encodes the specified FileDescriptorProto message. Does not implicitly {@link google.protobuf.FileDescriptorProto.verify|verify} messages. + * Encodes the specified FileOptions message. Does not implicitly {@link google.protobuf.FileOptions.verify|verify} messages. * @function encode - * @memberof google.protobuf.FileDescriptorProto + * @memberof google.protobuf.FileOptions * @static - * @param {google.protobuf.IFileDescriptorProto} message FileDescriptorProto message or plain object to encode + * @param {google.protobuf.IFileOptions} message FileOptions message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - FileDescriptorProto.encode = function encode(message, writer) { + FileOptions.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 13, wireType 2 =*/106).string(message.edition); + 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.phpGenericServices != null && Object.hasOwnProperty.call(message, "phpGenericServices")) + writer.uint32(/* id 42, wireType 0 =*/336).bool(message.phpGenericServices); + 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.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 FileDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.FileDescriptorProto.verify|verify} messages. + * Encodes the specified FileOptions message, length delimited. Does not implicitly {@link google.protobuf.FileOptions.verify|verify} messages. * @function encodeDelimited - * @memberof google.protobuf.FileDescriptorProto + * @memberof google.protobuf.FileOptions * @static - * @param {google.protobuf.IFileDescriptorProto} message FileDescriptorProto message or plain object to encode + * @param {google.protobuf.IFileOptions} message FileOptions message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - FileDescriptorProto.encodeDelimited = function encodeDelimited(message, writer) { + FileOptions.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a FileDescriptorProto message from the specified reader or buffer. + * Decodes a FileOptions message from the specified reader or buffer. * @function decode - * @memberof google.protobuf.FileDescriptorProto + * @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.FileDescriptorProto} FileDescriptorProto + * @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 */ - FileDescriptorProto.decode = function decode(reader, length) { + FileOptions.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.FileDescriptorProto(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.FileOptions(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: { - message.name = reader.string(); + message.javaPackage = reader.string(); break; } - case 2: { - message["package"] = reader.string(); + case 8: { + message.javaOuterClassname = reader.string(); break; } - case 3: { - if (!(message.dependency && message.dependency.length)) - message.dependency = []; - message.dependency.push(reader.string()); + case 10: { + message.javaMultipleFiles = reader.bool(); 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()); + case 20: { + message.javaGenerateEqualsAndHash = reader.bool(); + break; + } + case 27: { + message.javaStringCheckUtf8 = reader.bool(); + break; + } + case 9: { + message.optimizeFor = 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()); + message.goPackage = reader.string(); break; } - case 4: { - if (!(message.messageType && message.messageType.length)) - message.messageType = []; - message.messageType.push($root.google.protobuf.DescriptorProto.decode(reader, reader.uint32())); + case 16: { + message.ccGenericServices = reader.bool(); break; } - case 5: { - if (!(message.enumType && message.enumType.length)) - message.enumType = []; - message.enumType.push($root.google.protobuf.EnumDescriptorProto.decode(reader, reader.uint32())); + case 17: { + message.javaGenericServices = reader.bool(); break; } - case 6: { - if (!(message.service && message.service.length)) - message.service = []; - message.service.push($root.google.protobuf.ServiceDescriptorProto.decode(reader, reader.uint32())); + case 18: { + message.pyGenericServices = reader.bool(); break; } - case 7: { - if (!(message.extension && message.extension.length)) - message.extension = []; - message.extension.push($root.google.protobuf.FieldDescriptorProto.decode(reader, reader.uint32())); + case 42: { + message.phpGenericServices = reader.bool(); break; } - case 8: { - message.options = $root.google.protobuf.FileOptions.decode(reader, reader.uint32()); + case 23: { + message.deprecated = reader.bool(); break; } - case 9: { - message.sourceCodeInfo = $root.google.protobuf.SourceCodeInfo.decode(reader, reader.uint32()); + case 31: { + message.ccEnableArenas = reader.bool(); break; } - case 12: { - message.syntax = reader.string(); + case 36: { + message.objcClassPrefix = reader.string(); break; } - case 13: { - message.edition = reader.string(); + 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 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: @@ -4865,352 +5794,374 @@ }; /** - * Decodes a FileDescriptorProto message from the specified reader or buffer, length delimited. + * Decodes a FileOptions message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.protobuf.FileDescriptorProto + * @memberof google.protobuf.FileOptions * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.FileDescriptorProto} FileDescriptorProto + * @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 */ - FileDescriptorProto.decodeDelimited = function decodeDelimited(reader) { + FileOptions.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a FileDescriptorProto message. + * Verifies a FileOptions message. * @function verify - * @memberof google.protobuf.FileDescriptorProto + * @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 */ - FileDescriptorProto.verify = function verify(message) { + FileOptions.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.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.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 (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.phpGenericServices != null && message.hasOwnProperty("phpGenericServices")) + if (typeof message.phpGenericServices !== "boolean") + return "phpGenericServices: 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.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 "service." + error; + return "uninterpretedOption." + 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 (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 "extension." + error; + return ".google.api.resourceDefinition." + 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")) - if (!$util.isString(message.edition)) - return "edition: string expected"; return null; }; /** - * Creates a FileDescriptorProto message from a plain object. Also converts values to their respective internal types. + * Creates a FileOptions message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.protobuf.FileDescriptorProto + * @memberof google.protobuf.FileOptions * @static * @param {Object.} object Plain object - * @returns {google.protobuf.FileDescriptorProto} FileDescriptorProto + * @returns {google.protobuf.FileOptions} FileOptions */ - FileDescriptorProto.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.FileDescriptorProto) + FileOptions.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.FileOptions) 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]); + 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.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.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.phpGenericServices != null) + message.phpGenericServices = Boolean(object.phpGenericServices); + 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.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.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[".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]); } } - 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); - if (object.edition != null) - message.edition = String(object.edition); return message; }; /** - * Creates a plain object from a FileDescriptorProto message. Also converts values to other types if specified. + * Creates a plain object from a FileOptions message. Also converts values to other types if specified. * @function toObject - * @memberof google.protobuf.FileDescriptorProto + * @memberof google.protobuf.FileOptions * @static - * @param {google.protobuf.FileDescriptorProto} message FileDescriptorProto + * @param {google.protobuf.FileOptions} message FileOptions * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - FileDescriptorProto.toObject = function toObject(message, options) { + FileOptions.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 = []; + object.uninterpretedOption = []; + object[".google.api.resourceDefinition"] = []; } if (options.defaults) { - object.name = ""; - object["package"] = ""; - object.options = null; - object.sourceCodeInfo = null; - object.syntax = ""; - object.edition = ""; - } - 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); + 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.phpGenericServices = false; + object.phpMetadataNamespace = ""; + object.rubyPackage = ""; } - 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.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.phpGenericServices != null && message.hasOwnProperty("phpGenericServices")) + object.phpGenericServices = message.phpGenericServices; + if (message.phpMetadataNamespace != null && message.hasOwnProperty("phpMetadataNamespace")) + object.phpMetadataNamespace = message.phpMetadataNamespace; + if (message.rubyPackage != null && message.hasOwnProperty("rubyPackage")) + object.rubyPackage = message.rubyPackage; + 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.weakDependency && message.weakDependency.length) { - object.weakDependency = []; - for (var j = 0; j < message.weakDependency.length; ++j) - object.weakDependency[j] = message.weakDependency[j]; + 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); } - if (message.syntax != null && message.hasOwnProperty("syntax")) - object.syntax = message.syntax; - if (message.edition != null && message.hasOwnProperty("edition")) - object.edition = message.edition; return object; }; /** - * Converts this FileDescriptorProto to JSON. + * Converts this FileOptions to JSON. * @function toJSON - * @memberof google.protobuf.FileDescriptorProto + * @memberof google.protobuf.FileOptions * @instance * @returns {Object.} JSON object */ - FileDescriptorProto.prototype.toJSON = function toJSON() { + FileOptions.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for FileDescriptorProto + * Gets the default type url for FileOptions * @function getTypeUrl - * @memberof google.protobuf.FileDescriptorProto + * @memberof google.protobuf.FileOptions * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - FileDescriptorProto.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + FileOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.protobuf.FileDescriptorProto"; + return typeUrlPrefix + "/google.protobuf.FileOptions"; }; - return FileDescriptorProto; + /** + * 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.DescriptorProto = (function() { + protobuf.MessageOptions = (function() { /** - * Properties of a DescriptorProto. + * Properties of a MessageOptions. * @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 + * @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 {Array.|null} [uninterpretedOption] MessageOptions uninterpretedOption + * @property {google.api.IResourceDescriptor|null} [".google.api.resource"] MessageOptions .google.api.resource */ /** - * Constructs a new DescriptorProto. + * Constructs a new MessageOptions. * @memberof google.protobuf - * @classdesc Represents a DescriptorProto. - * @implements IDescriptorProto + * @classdesc Represents a MessageOptions. + * @implements IMessageOptions * @constructor - * @param {google.protobuf.IDescriptorProto=} [properties] Properties to set + * @param {google.protobuf.IMessageOptions=} [properties] Properties to set */ - function DescriptorProto(properties) { - this.field = []; - this.extension = []; - this.nestedType = []; - this.enumType = []; - this.extensionRange = []; - this.oneofDecl = []; - this.reservedRange = []; - this.reservedName = []; + function MessageOptions(properties) { + this.uninterpretedOption = []; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -5218,225 +6169,162 @@ } /** - * DescriptorProto name. - * @member {string} name - * @memberof google.protobuf.DescriptorProto - * @instance - */ - DescriptorProto.prototype.name = ""; - - /** - * DescriptorProto field. - * @member {Array.} field - * @memberof google.protobuf.DescriptorProto + * MessageOptions messageSetWireFormat. + * @member {boolean} messageSetWireFormat + * @memberof google.protobuf.MessageOptions * @instance */ - DescriptorProto.prototype.field = $util.emptyArray; + MessageOptions.prototype.messageSetWireFormat = false; /** - * DescriptorProto extension. - * @member {Array.} extension - * @memberof google.protobuf.DescriptorProto + * MessageOptions noStandardDescriptorAccessor. + * @member {boolean} noStandardDescriptorAccessor + * @memberof google.protobuf.MessageOptions * @instance */ - DescriptorProto.prototype.extension = $util.emptyArray; + MessageOptions.prototype.noStandardDescriptorAccessor = false; /** - * DescriptorProto nestedType. - * @member {Array.} nestedType - * @memberof google.protobuf.DescriptorProto + * MessageOptions deprecated. + * @member {boolean} deprecated + * @memberof google.protobuf.MessageOptions * @instance */ - DescriptorProto.prototype.nestedType = $util.emptyArray; + MessageOptions.prototype.deprecated = false; /** - * DescriptorProto enumType. - * @member {Array.} enumType - * @memberof google.protobuf.DescriptorProto + * MessageOptions mapEntry. + * @member {boolean} mapEntry + * @memberof google.protobuf.MessageOptions * @instance */ - DescriptorProto.prototype.enumType = $util.emptyArray; + MessageOptions.prototype.mapEntry = false; /** - * DescriptorProto extensionRange. - * @member {Array.} extensionRange - * @memberof google.protobuf.DescriptorProto + * MessageOptions deprecatedLegacyJsonFieldConflicts. + * @member {boolean} deprecatedLegacyJsonFieldConflicts + * @memberof google.protobuf.MessageOptions * @instance */ - DescriptorProto.prototype.extensionRange = $util.emptyArray; + MessageOptions.prototype.deprecatedLegacyJsonFieldConflicts = false; /** - * DescriptorProto oneofDecl. - * @member {Array.} oneofDecl - * @memberof google.protobuf.DescriptorProto + * MessageOptions uninterpretedOption. + * @member {Array.} uninterpretedOption + * @memberof google.protobuf.MessageOptions * @instance */ - DescriptorProto.prototype.oneofDecl = $util.emptyArray; + MessageOptions.prototype.uninterpretedOption = $util.emptyArray; /** - * DescriptorProto options. - * @member {google.protobuf.IMessageOptions|null|undefined} options - * @memberof google.protobuf.DescriptorProto + * MessageOptions .google.api.resource. + * @member {google.api.IResourceDescriptor|null|undefined} .google.api.resource + * @memberof google.protobuf.MessageOptions * @instance */ - DescriptorProto.prototype.options = null; + MessageOptions.prototype[".google.api.resource"] = null; /** - * DescriptorProto reservedRange. - * @member {Array.} reservedRange - * @memberof google.protobuf.DescriptorProto - * @instance + * 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 */ - DescriptorProto.prototype.reservedRange = $util.emptyArray; + MessageOptions.create = function create(properties) { + return new MessageOptions(properties); + }; /** - * 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. + * Encodes the specified MessageOptions message. Does not implicitly {@link google.protobuf.MessageOptions.verify|verify} messages. * @function encode - * @memberof google.protobuf.DescriptorProto + * @memberof google.protobuf.MessageOptions * @static - * @param {google.protobuf.IDescriptorProto} message DescriptorProto message or plain object to encode + * @param {google.protobuf.IMessageOptions} message MessageOptions message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - DescriptorProto.encode = function encode(message, writer) { + MessageOptions.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]); + 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.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 DescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.DescriptorProto.verify|verify} messages. + * Encodes the specified MessageOptions message, length delimited. Does not implicitly {@link google.protobuf.MessageOptions.verify|verify} messages. * @function encodeDelimited - * @memberof google.protobuf.DescriptorProto + * @memberof google.protobuf.MessageOptions * @static - * @param {google.protobuf.IDescriptorProto} message DescriptorProto message or plain object to encode + * @param {google.protobuf.IMessageOptions} message MessageOptions message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - DescriptorProto.encodeDelimited = function encodeDelimited(message, writer) { + MessageOptions.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a DescriptorProto message from the specified reader or buffer. + * Decodes a MessageOptions message from the specified reader or buffer. * @function decode - * @memberof google.protobuf.DescriptorProto + * @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.DescriptorProto} DescriptorProto + * @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 */ - DescriptorProto.decode = function decode(reader, length) { + MessageOptions.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.DescriptorProto(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.MessageOptions(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: { - message.name = reader.string(); + message.messageSetWireFormat = reader.bool(); 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())); + message.noStandardDescriptorAccessor = reader.bool(); 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())); + message.deprecated = reader.bool(); break; } - case 8: { - if (!(message.oneofDecl && message.oneofDecl.length)) - message.oneofDecl = []; - message.oneofDecl.push($root.google.protobuf.OneofDescriptorProto.decode(reader, reader.uint32())); + case 7: { + message.mapEntry = reader.bool(); break; } - case 7: { - message.options = $root.google.protobuf.MessageOptions.decode(reader, reader.uint32()); + case 11: { + message.deprecatedLegacyJsonFieldConflicts = reader.bool(); break; } - case 9: { - if (!(message.reservedRange && message.reservedRange.length)) - message.reservedRange = []; - message.reservedRange.push($root.google.protobuf.DescriptorProto.ReservedRange.decode(reader, reader.uint32())); + case 999: { + if (!(message.uninterpretedOption && message.uninterpretedOption.length)) + message.uninterpretedOption = []; + message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); break; } - case 10: { - if (!(message.reservedName && message.reservedName.length)) - message.reservedName = []; - message.reservedName.push(reader.string()); + case 1053: { + message[".google.api.resource"] = $root.google.api.ResourceDescriptor.decode(reader, reader.uint32()); break; } default: @@ -5448,815 +6336,984 @@ }; /** - * Decodes a DescriptorProto message from the specified reader or buffer, length delimited. + * Decodes a MessageOptions message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.protobuf.DescriptorProto + * @memberof google.protobuf.MessageOptions * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.DescriptorProto} DescriptorProto + * @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 */ - DescriptorProto.decodeDelimited = function decodeDelimited(reader) { + MessageOptions.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a DescriptorProto message. + * Verifies a MessageOptions message. * @function verify - * @memberof google.protobuf.DescriptorProto + * @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 */ - DescriptorProto.verify = function verify(message) { + MessageOptions.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 (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.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 "oneofDecl." + error; + return "uninterpretedOption." + error; } } - if (message.options != null && message.hasOwnProperty("options")) { - var error = $root.google.protobuf.MessageOptions.verify(message.options); + 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 "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 ".google.api.resource." + error; } return null; }; /** - * Creates a DescriptorProto message from a plain object. Also converts values to their respective internal types. + * Creates a MessageOptions message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.protobuf.DescriptorProto + * @memberof google.protobuf.MessageOptions * @static * @param {Object.} object Plain object - * @returns {google.protobuf.DescriptorProto} DescriptorProto + * @returns {google.protobuf.MessageOptions} MessageOptions */ - DescriptorProto.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.DescriptorProto) + MessageOptions.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.MessageOptions) 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]); + 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.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.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]); + 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 DescriptorProto message. Also converts values to other types if specified. + * Creates a plain object from a MessageOptions message. Also converts values to other types if specified. * @function toObject - * @memberof google.protobuf.DescriptorProto + * @memberof google.protobuf.MessageOptions * @static - * @param {google.protobuf.DescriptorProto} message DescriptorProto + * @param {google.protobuf.MessageOptions} message MessageOptions * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - DescriptorProto.toObject = function toObject(message, options) { + MessageOptions.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.arrays || options.defaults) + object.uninterpretedOption = []; 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); + object.messageSetWireFormat = false; + object.noStandardDescriptorAccessor = false; + object.deprecated = false; + object.mapEntry = false; + object.deprecatedLegacyJsonFieldConflicts = false; + object[".google.api.resource"] = null; } - if (message.reservedName && message.reservedName.length) { - object.reservedName = []; - for (var j = 0; j < message.reservedName.length; ++j) - object.reservedName[j] = message.reservedName[j]; + 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.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 DescriptorProto to JSON. + * Converts this MessageOptions to JSON. * @function toJSON - * @memberof google.protobuf.DescriptorProto + * @memberof google.protobuf.MessageOptions * @instance * @returns {Object.} JSON object */ - DescriptorProto.prototype.toJSON = function toJSON() { + MessageOptions.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for DescriptorProto + * Gets the default type url for MessageOptions * @function getTypeUrl - * @memberof google.protobuf.DescriptorProto + * @memberof google.protobuf.MessageOptions * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - DescriptorProto.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + MessageOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.protobuf.DescriptorProto"; + return typeUrlPrefix + "/google.protobuf.MessageOptions"; }; - 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]]; - } + return MessageOptions; + })(); - /** - * ExtensionRange start. - * @member {number} start - * @memberof google.protobuf.DescriptorProto.ExtensionRange - * @instance - */ - ExtensionRange.prototype.start = 0; + protobuf.FieldOptions = (function() { - /** - * ExtensionRange end. - * @member {number} end - * @memberof google.protobuf.DescriptorProto.ExtensionRange - * @instance - */ - ExtensionRange.prototype.end = 0; + /** + * 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 {google.protobuf.FieldOptions.OptionTargetType|null} [target] FieldOptions target + * @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 + */ - /** - * ExtensionRange options. - * @member {google.protobuf.IExtensionRangeOptions|null|undefined} options - * @memberof google.protobuf.DescriptorProto.ExtensionRange - * @instance - */ - ExtensionRange.prototype.options = null; + /** + * 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.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]]; + } - /** - * 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); - }; + /** + * FieldOptions ctype. + * @member {google.protobuf.FieldOptions.CType} ctype + * @memberof google.protobuf.FieldOptions + * @instance + */ + FieldOptions.prototype.ctype = 0; - /** - * 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; - }; + /** + * FieldOptions packed. + * @member {boolean} packed + * @memberof google.protobuf.FieldOptions + * @instance + */ + FieldOptions.prototype.packed = false; - /** - * 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(); - }; + /** + * FieldOptions jstype. + * @member {google.protobuf.FieldOptions.JSType} jstype + * @memberof google.protobuf.FieldOptions + * @instance + */ + FieldOptions.prototype.jstype = 0; - /** - * 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) { - 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(); - 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); + /** + * 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 target. + * @member {google.protobuf.FieldOptions.OptionTargetType} target + * @memberof google.protobuf.FieldOptions + * @instance + */ + FieldOptions.prototype.target = 0; + + /** + * FieldOptions uninterpretedOption. + * @member {Array.} uninterpretedOption + * @memberof google.protobuf.FieldOptions + * @instance + */ + FieldOptions.prototype.uninterpretedOption = $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; + + /** + * FieldOptions .google.api.fieldBehavior. + * @member {Array.} .google.api.fieldBehavior + * @memberof google.protobuf.FieldOptions + * @instance + */ + FieldOptions.prototype[".google.api.fieldBehavior"] = $util.emptyArray; + + /** + * 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.target != null && Object.hasOwnProperty.call(message, "target")) + writer.uint32(/* id 18, wireType 0 =*/144).int32(message.target); + 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) { + writer.uint32(/* id 1052, wireType 2 =*/8418).fork(); + for (var i = 0; i < message[".google.api.fieldBehavior"].length; ++i) + writer.int32(message[".google.api.fieldBehavior"][i]); + writer.ldelim(); + } + 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) { + 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(); + 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 18: { + message.target = reader.int32(); + break; + } + case 999: { + if (!(message.uninterpretedOption && message.uninterpretedOption.length)) + message.uninterpretedOption = []; + message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); + break; + } + case 1055: { + message[".google.api.resourceReference"] = $root.google.api.ResourceReference.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; + } + default: + reader.skipType(tag & 7); + break; } - return message; - }; + } + 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()); - }; + /** + * 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 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); + /** + * 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.target != null && message.hasOwnProperty("target")) + switch (message.target) { + default: + return "target: 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.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 "options." + error; + return "uninterpretedOption." + error; } - return null; - }; + } + 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; + } + 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: + break; + } + } + 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); + /** + * 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; } - 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; + 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; } - 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"; + 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; + } + switch (object.target) { + default: + if (typeof object.target === "number") { + message.target = object.target; + break; + } + break; + case "TARGET_TYPE_UNKNOWN": + case 0: + message.target = 0; + break; + case "TARGET_TYPE_FILE": + case 1: + message.target = 1; + break; + case "TARGET_TYPE_EXTENSION_RANGE": + case 2: + message.target = 2; + break; + case "TARGET_TYPE_MESSAGE": + case 3: + message.target = 3; + break; + case "TARGET_TYPE_FIELD": + case 4: + message.target = 4; + break; + case "TARGET_TYPE_ONEOF": + case 5: + message.target = 5; + break; + case "TARGET_TYPE_ENUM": + case 6: + message.target = 6; + break; + case "TARGET_TYPE_ENUM_ENTRY": + case 7: + message.target = 7; + break; + case "TARGET_TYPE_SERVICE": + case 8: + message.target = 8; + break; + case "TARGET_TYPE_METHOD": + case 9: + message.target = 9; + break; + } + 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]); } - 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) { - 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(); - switch (tag >>> 3) { - case 1: { - message.start = reader.int32(); - break; - } - case 2: { - message.end = reader.int32(); + 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"]); + } + 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; } - default: - reader.skipType(tag & 7); + 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; } - } - return message; - }; + } + 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()); - }; + /** + * 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.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.target = options.enums === String ? "TARGET_TYPE_UNKNOWN" : 0; + 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.target != null && message.hasOwnProperty("target")) + object.target = options.enums === String ? $root.google.protobuf.FieldOptions.OptionTargetType[message.target] === undefined ? message.target : $root.google.protobuf.FieldOptions.OptionTargetType[message.target] : message.target; + 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; + }; - /** - * 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; - }; + /** + * 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); + }; - /** - * 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; - }; + /** + * 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"; + }; - /** - * 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; - }; + /** + * 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; + })(); - /** - * 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); - }; + /** + * 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; + })(); - /** - * 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"; - }; + /** + * 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; + })(); - return ReservedRange; + /** + * 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 DescriptorProto; + return FieldOptions; })(); - protobuf.ExtensionRangeOptions = (function() { + protobuf.OneofOptions = (function() { /** - * Properties of an ExtensionRangeOptions. + * Properties of an OneofOptions. * @memberof google.protobuf - * @interface IExtensionRangeOptions - * @property {Array.|null} [uninterpretedOption] ExtensionRangeOptions uninterpretedOption + * @interface IOneofOptions + * @property {Array.|null} [uninterpretedOption] OneofOptions uninterpretedOption */ /** - * Constructs a new ExtensionRangeOptions. + * Constructs a new OneofOptions. * @memberof google.protobuf - * @classdesc Represents an ExtensionRangeOptions. - * @implements IExtensionRangeOptions + * @classdesc Represents an OneofOptions. + * @implements IOneofOptions * @constructor - * @param {google.protobuf.IExtensionRangeOptions=} [properties] Properties to set + * @param {google.protobuf.IOneofOptions=} [properties] Properties to set */ - function ExtensionRangeOptions(properties) { + function OneofOptions(properties) { this.uninterpretedOption = []; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) @@ -6265,35 +7322,35 @@ } /** - * ExtensionRangeOptions uninterpretedOption. + * OneofOptions uninterpretedOption. * @member {Array.} uninterpretedOption - * @memberof google.protobuf.ExtensionRangeOptions + * @memberof google.protobuf.OneofOptions * @instance */ - ExtensionRangeOptions.prototype.uninterpretedOption = $util.emptyArray; + OneofOptions.prototype.uninterpretedOption = $util.emptyArray; /** - * Creates a new ExtensionRangeOptions instance using the specified properties. + * Creates a new OneofOptions instance using the specified properties. * @function create - * @memberof google.protobuf.ExtensionRangeOptions + * @memberof google.protobuf.OneofOptions * @static - * @param {google.protobuf.IExtensionRangeOptions=} [properties] Properties to set - * @returns {google.protobuf.ExtensionRangeOptions} ExtensionRangeOptions instance + * @param {google.protobuf.IOneofOptions=} [properties] Properties to set + * @returns {google.protobuf.OneofOptions} OneofOptions instance */ - ExtensionRangeOptions.create = function create(properties) { - return new ExtensionRangeOptions(properties); + OneofOptions.create = function create(properties) { + return new OneofOptions(properties); }; /** - * Encodes the specified ExtensionRangeOptions message. Does not implicitly {@link google.protobuf.ExtensionRangeOptions.verify|verify} messages. + * Encodes the specified OneofOptions message. Does not implicitly {@link google.protobuf.OneofOptions.verify|verify} messages. * @function encode - * @memberof google.protobuf.ExtensionRangeOptions + * @memberof google.protobuf.OneofOptions * @static - * @param {google.protobuf.IExtensionRangeOptions} message ExtensionRangeOptions message or plain object to encode + * @param {google.protobuf.IOneofOptions} message OneofOptions message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ExtensionRangeOptions.encode = function encode(message, writer) { + OneofOptions.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); if (message.uninterpretedOption != null && message.uninterpretedOption.length) @@ -6303,33 +7360,33 @@ }; /** - * Encodes the specified ExtensionRangeOptions message, length delimited. Does not implicitly {@link google.protobuf.ExtensionRangeOptions.verify|verify} messages. + * Encodes the specified OneofOptions message, length delimited. Does not implicitly {@link google.protobuf.OneofOptions.verify|verify} messages. * @function encodeDelimited - * @memberof google.protobuf.ExtensionRangeOptions + * @memberof google.protobuf.OneofOptions * @static - * @param {google.protobuf.IExtensionRangeOptions} message ExtensionRangeOptions message or plain object to encode + * @param {google.protobuf.IOneofOptions} message OneofOptions message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ExtensionRangeOptions.encodeDelimited = function encodeDelimited(message, writer) { + OneofOptions.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes an ExtensionRangeOptions message from the specified reader or buffer. + * Decodes an OneofOptions message from the specified reader or buffer. * @function decode - * @memberof google.protobuf.ExtensionRangeOptions + * @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.ExtensionRangeOptions} ExtensionRangeOptions + * @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 */ - ExtensionRangeOptions.decode = function decode(reader, length) { + OneofOptions.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.ExtensionRangeOptions(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.OneofOptions(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { @@ -6348,30 +7405,30 @@ }; /** - * Decodes an ExtensionRangeOptions message from the specified reader or buffer, length delimited. + * Decodes an OneofOptions message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.protobuf.ExtensionRangeOptions + * @memberof google.protobuf.OneofOptions * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.ExtensionRangeOptions} ExtensionRangeOptions + * @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 */ - ExtensionRangeOptions.decodeDelimited = function decodeDelimited(reader) { + OneofOptions.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies an ExtensionRangeOptions message. + * Verifies an OneofOptions message. * @function verify - * @memberof google.protobuf.ExtensionRangeOptions + * @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 */ - ExtensionRangeOptions.verify = function verify(message) { + OneofOptions.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; if (message.uninterpretedOption != null && message.hasOwnProperty("uninterpretedOption")) { @@ -6387,24 +7444,24 @@ }; /** - * Creates an ExtensionRangeOptions message from a plain object. Also converts values to their respective internal types. + * Creates an OneofOptions message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.protobuf.ExtensionRangeOptions + * @memberof google.protobuf.OneofOptions * @static * @param {Object.} object Plain object - * @returns {google.protobuf.ExtensionRangeOptions} ExtensionRangeOptions + * @returns {google.protobuf.OneofOptions} OneofOptions */ - ExtensionRangeOptions.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.ExtensionRangeOptions) + OneofOptions.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.OneofOptions) return object; - var message = new $root.google.protobuf.ExtensionRangeOptions(); + var message = new $root.google.protobuf.OneofOptions(); if (object.uninterpretedOption) { if (!Array.isArray(object.uninterpretedOption)) - throw TypeError(".google.protobuf.ExtensionRangeOptions.uninterpretedOption: array expected"); + 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.ExtensionRangeOptions.uninterpretedOption: object expected"); + throw TypeError(".google.protobuf.OneofOptions.uninterpretedOption: object expected"); message.uninterpretedOption[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpretedOption[i]); } } @@ -6412,15 +7469,15 @@ }; /** - * Creates a plain object from an ExtensionRangeOptions message. Also converts values to other types if specified. + * Creates a plain object from an OneofOptions message. Also converts values to other types if specified. * @function toObject - * @memberof google.protobuf.ExtensionRangeOptions + * @memberof google.protobuf.OneofOptions * @static - * @param {google.protobuf.ExtensionRangeOptions} message ExtensionRangeOptions + * @param {google.protobuf.OneofOptions} message OneofOptions * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - ExtensionRangeOptions.toObject = function toObject(message, options) { + OneofOptions.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; @@ -6435,62 +7492,56 @@ }; /** - * Converts this ExtensionRangeOptions to JSON. + * Converts this OneofOptions to JSON. * @function toJSON - * @memberof google.protobuf.ExtensionRangeOptions + * @memberof google.protobuf.OneofOptions * @instance * @returns {Object.} JSON object */ - ExtensionRangeOptions.prototype.toJSON = function toJSON() { + OneofOptions.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for ExtensionRangeOptions + * Gets the default type url for OneofOptions * @function getTypeUrl - * @memberof google.protobuf.ExtensionRangeOptions + * @memberof google.protobuf.OneofOptions * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - ExtensionRangeOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + OneofOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.protobuf.ExtensionRangeOptions"; + return typeUrlPrefix + "/google.protobuf.OneofOptions"; }; - return ExtensionRangeOptions; + return OneofOptions; })(); - protobuf.FieldDescriptorProto = (function() { + protobuf.EnumOptions = (function() { /** - * Properties of a FieldDescriptorProto. + * Properties of an EnumOptions. * @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 + * @interface IEnumOptions + * @property {boolean|null} [allowAlias] EnumOptions allowAlias + * @property {boolean|null} [deprecated] EnumOptions deprecated + * @property {boolean|null} [deprecatedLegacyJsonFieldConflicts] EnumOptions deprecatedLegacyJsonFieldConflicts + * @property {Array.|null} [uninterpretedOption] EnumOptions uninterpretedOption */ /** - * Constructs a new FieldDescriptorProto. + * Constructs a new EnumOptions. * @memberof google.protobuf - * @classdesc Represents a FieldDescriptorProto. - * @implements IFieldDescriptorProto + * @classdesc Represents an EnumOptions. + * @implements IEnumOptions * @constructor - * @param {google.protobuf.IFieldDescriptorProto=} [properties] Properties to set + * @param {google.protobuf.IEnumOptions=} [properties] Properties to set */ - function FieldDescriptorProto(properties) { + function EnumOptions(properties) { + this.uninterpretedOption = []; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -6498,215 +7549,120 @@ } /** - * 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 + * EnumOptions allowAlias. + * @member {boolean} allowAlias + * @memberof google.protobuf.EnumOptions * @instance */ - FieldDescriptorProto.prototype.oneofIndex = 0; + EnumOptions.prototype.allowAlias = false; /** - * FieldDescriptorProto jsonName. - * @member {string} jsonName - * @memberof google.protobuf.FieldDescriptorProto + * EnumOptions deprecated. + * @member {boolean} deprecated + * @memberof google.protobuf.EnumOptions * @instance */ - FieldDescriptorProto.prototype.jsonName = ""; + EnumOptions.prototype.deprecated = false; /** - * FieldDescriptorProto options. - * @member {google.protobuf.IFieldOptions|null|undefined} options - * @memberof google.protobuf.FieldDescriptorProto + * EnumOptions deprecatedLegacyJsonFieldConflicts. + * @member {boolean} deprecatedLegacyJsonFieldConflicts + * @memberof google.protobuf.EnumOptions * @instance */ - FieldDescriptorProto.prototype.options = null; + EnumOptions.prototype.deprecatedLegacyJsonFieldConflicts = false; /** - * FieldDescriptorProto proto3Optional. - * @member {boolean} proto3Optional - * @memberof google.protobuf.FieldDescriptorProto + * EnumOptions uninterpretedOption. + * @member {Array.} uninterpretedOption + * @memberof google.protobuf.EnumOptions * @instance */ - FieldDescriptorProto.prototype.proto3Optional = false; + EnumOptions.prototype.uninterpretedOption = $util.emptyArray; /** - * Creates a new FieldDescriptorProto instance using the specified properties. + * Creates a new EnumOptions instance using the specified properties. * @function create - * @memberof google.protobuf.FieldDescriptorProto + * @memberof google.protobuf.EnumOptions * @static - * @param {google.protobuf.IFieldDescriptorProto=} [properties] Properties to set - * @returns {google.protobuf.FieldDescriptorProto} FieldDescriptorProto instance + * @param {google.protobuf.IEnumOptions=} [properties] Properties to set + * @returns {google.protobuf.EnumOptions} EnumOptions instance */ - FieldDescriptorProto.create = function create(properties) { - return new FieldDescriptorProto(properties); + EnumOptions.create = function create(properties) { + return new EnumOptions(properties); }; /** - * Encodes the specified FieldDescriptorProto message. Does not implicitly {@link google.protobuf.FieldDescriptorProto.verify|verify} messages. + * Encodes the specified EnumOptions message. Does not implicitly {@link google.protobuf.EnumOptions.verify|verify} messages. * @function encode - * @memberof google.protobuf.FieldDescriptorProto + * @memberof google.protobuf.EnumOptions * @static - * @param {google.protobuf.IFieldDescriptorProto} message FieldDescriptorProto message or plain object to encode + * @param {google.protobuf.IEnumOptions} message EnumOptions message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - FieldDescriptorProto.encode = function encode(message, writer) { + EnumOptions.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); + 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.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 FieldDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.FieldDescriptorProto.verify|verify} messages. + * Encodes the specified EnumOptions message, length delimited. Does not implicitly {@link google.protobuf.EnumOptions.verify|verify} messages. * @function encodeDelimited - * @memberof google.protobuf.FieldDescriptorProto + * @memberof google.protobuf.EnumOptions * @static - * @param {google.protobuf.IFieldDescriptorProto} message FieldDescriptorProto message or plain object to encode + * @param {google.protobuf.IEnumOptions} message EnumOptions message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - FieldDescriptorProto.encodeDelimited = function encodeDelimited(message, writer) { + EnumOptions.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a FieldDescriptorProto message from the specified reader or buffer. + * Decodes an EnumOptions message from the specified reader or buffer. * @function decode - * @memberof google.protobuf.FieldDescriptorProto + * @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.FieldDescriptorProto} FieldDescriptorProto + * @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 */ - FieldDescriptorProto.decode = function decode(reader, length) { + EnumOptions.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.FieldDescriptorProto(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.EnumOptions(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: { - message.name = reader.string(); + case 2: { + message.allowAlias = reader.bool(); break; } case 3: { - message.number = reader.int32(); - break; - } - case 4: { - message.label = reader.int32(); - break; - } - case 5: { - message.type = reader.int32(); + message.deprecated = reader.bool(); 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()); + message.deprecatedLegacyJsonFieldConflicts = reader.bool(); break; } - case 17: { - message.proto3Optional = reader.bool(); + case 999: { + if (!(message.uninterpretedOption && message.uninterpretedOption.length)) + message.uninterpretedOption = []; + message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); break; } default: @@ -6718,394 +7674,167 @@ }; /** - * Decodes a FieldDescriptorProto message from the specified reader or buffer, length delimited. + * Decodes an EnumOptions message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.protobuf.FieldDescriptorProto + * @memberof google.protobuf.EnumOptions * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.FieldDescriptorProto} FieldDescriptorProto + * @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 */ - FieldDescriptorProto.decodeDelimited = function decodeDelimited(reader) { + EnumOptions.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a FieldDescriptorProto message. + * Verifies an EnumOptions message. * @function verify - * @memberof google.protobuf.FieldDescriptorProto + * @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 */ - FieldDescriptorProto.verify = function verify(message) { + EnumOptions.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 2: - case 3: - 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.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.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.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. + * Creates an EnumOptions message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.protobuf.FieldDescriptorProto + * @memberof google.protobuf.EnumOptions * @static * @param {Object.} object Plain object - * @returns {google.protobuf.FieldDescriptorProto} FieldDescriptorProto + * @returns {google.protobuf.EnumOptions} EnumOptions */ - FieldDescriptorProto.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.FieldDescriptorProto) + EnumOptions.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.EnumOptions) 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_REQUIRED": - case 2: - message.label = 2; - break; - case "LABEL_REPEATED": - case 3: - message.label = 3; - break; - } - switch (object.type) { - default: - if (typeof object.type === "number") { - message.type = object.type; - break; + 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.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]); } - 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. + * Creates a plain object from an EnumOptions message. Also converts values to other types if specified. * @function toObject - * @memberof google.protobuf.FieldDescriptorProto + * @memberof google.protobuf.EnumOptions * @static - * @param {google.protobuf.FieldDescriptorProto} message FieldDescriptorProto + * @param {google.protobuf.EnumOptions} message EnumOptions * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - FieldDescriptorProto.toObject = function toObject(message, options) { + EnumOptions.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 (options.arrays || options.defaults) + object.uninterpretedOption = []; + if (options.defaults) { + object.allowAlias = false; + object.deprecated = false; + object.deprecatedLegacyJsonFieldConflicts = false; + } + 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.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.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. + * Converts this EnumOptions to JSON. * @function toJSON - * @memberof google.protobuf.FieldDescriptorProto + * @memberof google.protobuf.EnumOptions * @instance * @returns {Object.} JSON object */ - FieldDescriptorProto.prototype.toJSON = function toJSON() { + EnumOptions.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for FieldDescriptorProto + * Gets the default type url for EnumOptions * @function getTypeUrl - * @memberof google.protobuf.FieldDescriptorProto + * @memberof google.protobuf.EnumOptions * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - FieldDescriptorProto.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + EnumOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.protobuf.FieldDescriptorProto"; + return typeUrlPrefix + "/google.protobuf.EnumOptions"; }; - /** - * 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_REQUIRED=2 LABEL_REQUIRED value - * @property {number} LABEL_REPEATED=3 LABEL_REPEATED value - */ - FieldDescriptorProto.Label = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[1] = "LABEL_OPTIONAL"] = 1; - values[valuesById[2] = "LABEL_REQUIRED"] = 2; - values[valuesById[3] = "LABEL_REPEATED"] = 3; - return values; - })(); - - return FieldDescriptorProto; + return EnumOptions; })(); - protobuf.OneofDescriptorProto = (function() { + protobuf.EnumValueOptions = (function() { /** - * Properties of an OneofDescriptorProto. + * Properties of an EnumValueOptions. * @memberof google.protobuf - * @interface IOneofDescriptorProto - * @property {string|null} [name] OneofDescriptorProto name - * @property {google.protobuf.IOneofOptions|null} [options] OneofDescriptorProto options + * @interface IEnumValueOptions + * @property {boolean|null} [deprecated] EnumValueOptions deprecated + * @property {Array.|null} [uninterpretedOption] EnumValueOptions uninterpretedOption */ /** - * Constructs a new OneofDescriptorProto. + * Constructs a new EnumValueOptions. * @memberof google.protobuf - * @classdesc Represents an OneofDescriptorProto. - * @implements IOneofDescriptorProto + * @classdesc Represents an EnumValueOptions. + * @implements IEnumValueOptions * @constructor - * @param {google.protobuf.IOneofDescriptorProto=} [properties] Properties to set + * @param {google.protobuf.IEnumValueOptions=} [properties] Properties to set */ - function OneofDescriptorProto(properties) { + function EnumValueOptions(properties) { + this.uninterpretedOption = []; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -7113,89 +7842,92 @@ } /** - * OneofDescriptorProto name. - * @member {string} name - * @memberof google.protobuf.OneofDescriptorProto + * EnumValueOptions deprecated. + * @member {boolean} deprecated + * @memberof google.protobuf.EnumValueOptions * @instance */ - OneofDescriptorProto.prototype.name = ""; + EnumValueOptions.prototype.deprecated = false; /** - * OneofDescriptorProto options. - * @member {google.protobuf.IOneofOptions|null|undefined} options - * @memberof google.protobuf.OneofDescriptorProto + * EnumValueOptions uninterpretedOption. + * @member {Array.} uninterpretedOption + * @memberof google.protobuf.EnumValueOptions * @instance */ - OneofDescriptorProto.prototype.options = null; + EnumValueOptions.prototype.uninterpretedOption = $util.emptyArray; /** - * Creates a new OneofDescriptorProto instance using the specified properties. + * Creates a new EnumValueOptions instance using the specified properties. * @function create - * @memberof google.protobuf.OneofDescriptorProto + * @memberof google.protobuf.EnumValueOptions * @static - * @param {google.protobuf.IOneofDescriptorProto=} [properties] Properties to set - * @returns {google.protobuf.OneofDescriptorProto} OneofDescriptorProto instance + * @param {google.protobuf.IEnumValueOptions=} [properties] Properties to set + * @returns {google.protobuf.EnumValueOptions} EnumValueOptions instance */ - OneofDescriptorProto.create = function create(properties) { - return new OneofDescriptorProto(properties); + EnumValueOptions.create = function create(properties) { + return new EnumValueOptions(properties); }; /** - * Encodes the specified OneofDescriptorProto message. Does not implicitly {@link google.protobuf.OneofDescriptorProto.verify|verify} messages. + * Encodes the specified EnumValueOptions message. Does not implicitly {@link google.protobuf.EnumValueOptions.verify|verify} messages. * @function encode - * @memberof google.protobuf.OneofDescriptorProto + * @memberof google.protobuf.EnumValueOptions * @static - * @param {google.protobuf.IOneofDescriptorProto} message OneofDescriptorProto message or plain object to encode + * @param {google.protobuf.IEnumValueOptions} message EnumValueOptions message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - OneofDescriptorProto.encode = function encode(message, writer) { + EnumValueOptions.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(); + if (message.deprecated != null && Object.hasOwnProperty.call(message, "deprecated")) + writer.uint32(/* id 1, wireType 0 =*/8).bool(message.deprecated); + 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 OneofDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.OneofDescriptorProto.verify|verify} messages. + * Encodes the specified EnumValueOptions message, length delimited. Does not implicitly {@link google.protobuf.EnumValueOptions.verify|verify} messages. * @function encodeDelimited - * @memberof google.protobuf.OneofDescriptorProto + * @memberof google.protobuf.EnumValueOptions * @static - * @param {google.protobuf.IOneofDescriptorProto} message OneofDescriptorProto message or plain object to encode + * @param {google.protobuf.IEnumValueOptions} message EnumValueOptions message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - OneofDescriptorProto.encodeDelimited = function encodeDelimited(message, writer) { + EnumValueOptions.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes an OneofDescriptorProto message from the specified reader or buffer. + * Decodes an EnumValueOptions message from the specified reader or buffer. * @function decode - * @memberof google.protobuf.OneofDescriptorProto + * @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.OneofDescriptorProto} OneofDescriptorProto + * @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 */ - OneofDescriptorProto.decode = function decode(reader, length) { + EnumValueOptions.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.OneofDescriptorProto(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.EnumValueOptions(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: { - message.name = reader.string(); + message.deprecated = reader.bool(); break; } - case 2: { - message.options = $root.google.protobuf.OneofOptions.decode(reader, reader.uint32()); + case 999: { + if (!(message.uninterpretedOption && message.uninterpretedOption.length)) + message.uninterpretedOption = []; + message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); break; } default: @@ -7207,143 +7939,152 @@ }; /** - * Decodes an OneofDescriptorProto message from the specified reader or buffer, length delimited. + * Decodes an EnumValueOptions message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.protobuf.OneofDescriptorProto + * @memberof google.protobuf.EnumValueOptions * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.OneofDescriptorProto} OneofDescriptorProto + * @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 */ - OneofDescriptorProto.decodeDelimited = function decodeDelimited(reader) { + EnumValueOptions.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies an OneofDescriptorProto message. + * Verifies an EnumValueOptions message. * @function verify - * @memberof google.protobuf.OneofDescriptorProto + * @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 */ - OneofDescriptorProto.verify = function verify(message) { + EnumValueOptions.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; + 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; + } } return null; }; /** - * Creates an OneofDescriptorProto message from a plain object. Also converts values to their respective internal types. + * Creates an EnumValueOptions message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.protobuf.OneofDescriptorProto + * @memberof google.protobuf.EnumValueOptions * @static * @param {Object.} object Plain object - * @returns {google.protobuf.OneofDescriptorProto} OneofDescriptorProto + * @returns {google.protobuf.EnumValueOptions} EnumValueOptions */ - OneofDescriptorProto.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.OneofDescriptorProto) + EnumValueOptions.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.EnumValueOptions) 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); + var message = new $root.google.protobuf.EnumValueOptions(); + if (object.deprecated != null) + message.deprecated = Boolean(object.deprecated); + 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 OneofDescriptorProto message. Also converts values to other types if specified. + * Creates a plain object from an EnumValueOptions message. Also converts values to other types if specified. * @function toObject - * @memberof google.protobuf.OneofDescriptorProto + * @memberof google.protobuf.EnumValueOptions * @static - * @param {google.protobuf.OneofDescriptorProto} message OneofDescriptorProto + * @param {google.protobuf.EnumValueOptions} message EnumValueOptions * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - OneofDescriptorProto.toObject = function toObject(message, options) { + EnumValueOptions.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.defaults) { - object.name = ""; - object.options = null; + if (options.arrays || options.defaults) + object.uninterpretedOption = []; + if (options.defaults) + object.deprecated = false; + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + object.deprecated = message.deprecated; + 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.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. + * Converts this EnumValueOptions to JSON. * @function toJSON - * @memberof google.protobuf.OneofDescriptorProto + * @memberof google.protobuf.EnumValueOptions * @instance * @returns {Object.} JSON object */ - OneofDescriptorProto.prototype.toJSON = function toJSON() { + EnumValueOptions.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for OneofDescriptorProto + * Gets the default type url for EnumValueOptions * @function getTypeUrl - * @memberof google.protobuf.OneofDescriptorProto + * @memberof google.protobuf.EnumValueOptions * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - OneofDescriptorProto.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + EnumValueOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.protobuf.OneofDescriptorProto"; + return typeUrlPrefix + "/google.protobuf.EnumValueOptions"; }; - return OneofDescriptorProto; + return EnumValueOptions; })(); - protobuf.EnumDescriptorProto = (function() { + protobuf.ServiceOptions = (function() { /** - * Properties of an EnumDescriptorProto. + * Properties of a ServiceOptions. * @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 + * @interface IServiceOptions + * @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 */ /** - * Constructs a new EnumDescriptorProto. + * Constructs a new ServiceOptions. * @memberof google.protobuf - * @classdesc Represents an EnumDescriptorProto. - * @implements IEnumDescriptorProto + * @classdesc Represents a ServiceOptions. + * @implements IServiceOptions * @constructor - * @param {google.protobuf.IEnumDescriptorProto=} [properties] Properties to set + * @param {google.protobuf.IServiceOptions=} [properties] Properties to set */ - function EnumDescriptorProto(properties) { - this.value = []; - this.reservedRange = []; - this.reservedName = []; + function ServiceOptions(properties) { + this.uninterpretedOption = []; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -7351,140 +8092,120 @@ } /** - * EnumDescriptorProto name. - * @member {string} name - * @memberof google.protobuf.EnumDescriptorProto - * @instance - */ - EnumDescriptorProto.prototype.name = ""; - - /** - * EnumDescriptorProto value. - * @member {Array.} value - * @memberof google.protobuf.EnumDescriptorProto + * ServiceOptions deprecated. + * @member {boolean} deprecated + * @memberof google.protobuf.ServiceOptions * @instance */ - EnumDescriptorProto.prototype.value = $util.emptyArray; + ServiceOptions.prototype.deprecated = false; /** - * EnumDescriptorProto options. - * @member {google.protobuf.IEnumOptions|null|undefined} options - * @memberof google.protobuf.EnumDescriptorProto + * ServiceOptions uninterpretedOption. + * @member {Array.} uninterpretedOption + * @memberof google.protobuf.ServiceOptions * @instance */ - EnumDescriptorProto.prototype.options = null; + ServiceOptions.prototype.uninterpretedOption = $util.emptyArray; /** - * EnumDescriptorProto reservedRange. - * @member {Array.} reservedRange - * @memberof google.protobuf.EnumDescriptorProto + * ServiceOptions .google.api.defaultHost. + * @member {string} .google.api.defaultHost + * @memberof google.protobuf.ServiceOptions * @instance */ - EnumDescriptorProto.prototype.reservedRange = $util.emptyArray; + ServiceOptions.prototype[".google.api.defaultHost"] = ""; /** - * EnumDescriptorProto reservedName. - * @member {Array.} reservedName - * @memberof google.protobuf.EnumDescriptorProto + * ServiceOptions .google.api.oauthScopes. + * @member {string} .google.api.oauthScopes + * @memberof google.protobuf.ServiceOptions * @instance */ - EnumDescriptorProto.prototype.reservedName = $util.emptyArray; + ServiceOptions.prototype[".google.api.oauthScopes"] = ""; /** - * Creates a new EnumDescriptorProto instance using the specified properties. + * Creates a new ServiceOptions instance using the specified properties. * @function create - * @memberof google.protobuf.EnumDescriptorProto + * @memberof google.protobuf.ServiceOptions * @static - * @param {google.protobuf.IEnumDescriptorProto=} [properties] Properties to set - * @returns {google.protobuf.EnumDescriptorProto} EnumDescriptorProto instance + * @param {google.protobuf.IServiceOptions=} [properties] Properties to set + * @returns {google.protobuf.ServiceOptions} ServiceOptions instance */ - EnumDescriptorProto.create = function create(properties) { - return new EnumDescriptorProto(properties); + ServiceOptions.create = function create(properties) { + return new ServiceOptions(properties); }; /** - * Encodes the specified EnumDescriptorProto message. Does not implicitly {@link google.protobuf.EnumDescriptorProto.verify|verify} messages. + * Encodes the specified ServiceOptions message. Does not implicitly {@link google.protobuf.ServiceOptions.verify|verify} messages. * @function encode - * @memberof google.protobuf.EnumDescriptorProto + * @memberof google.protobuf.ServiceOptions * @static - * @param {google.protobuf.IEnumDescriptorProto} message EnumDescriptorProto message or plain object to encode + * @param {google.protobuf.IServiceOptions} message ServiceOptions message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - EnumDescriptorProto.encode = function encode(message, writer) { + ServiceOptions.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]); + if (message.deprecated != null && Object.hasOwnProperty.call(message, "deprecated")) + writer.uint32(/* id 33, wireType 0 =*/264).bool(message.deprecated); + 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"]); return writer; }; /** - * Encodes the specified EnumDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.EnumDescriptorProto.verify|verify} messages. + * Encodes the specified ServiceOptions message, length delimited. Does not implicitly {@link google.protobuf.ServiceOptions.verify|verify} messages. * @function encodeDelimited - * @memberof google.protobuf.EnumDescriptorProto + * @memberof google.protobuf.ServiceOptions * @static - * @param {google.protobuf.IEnumDescriptorProto} message EnumDescriptorProto message or plain object to encode + * @param {google.protobuf.IServiceOptions} message ServiceOptions message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - EnumDescriptorProto.encodeDelimited = function encodeDelimited(message, writer) { + ServiceOptions.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes an EnumDescriptorProto message from the specified reader or buffer. + * Decodes a ServiceOptions message from the specified reader or buffer. * @function decode - * @memberof google.protobuf.EnumDescriptorProto + * @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.EnumDescriptorProto} EnumDescriptorProto + * @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 */ - EnumDescriptorProto.decode = function decode(reader, length) { + ServiceOptions.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.EnumDescriptorProto(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.ServiceOptions(); while (reader.pos < end) { var tag = reader.uint32(); 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())); + case 33: { + message.deprecated = reader.bool(); break; } - case 3: { - message.options = $root.google.protobuf.EnumOptions.decode(reader, reader.uint32()); + case 999: { + if (!(message.uninterpretedOption && message.uninterpretedOption.length)) + message.uninterpretedOption = []; + message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.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())); + case 1049: { + message[".google.api.defaultHost"] = reader.string(); break; } - case 5: { - if (!(message.reservedName && message.reservedName.length)) - message.reservedName = []; - message.reservedName.push(reader.string()); + case 1050: { + message[".google.api.oauthScopes"] = reader.string(); break; } default: @@ -7496,437 +8217,172 @@ }; /** - * Decodes an EnumDescriptorProto message from the specified reader or buffer, length delimited. + * Decodes a ServiceOptions message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.protobuf.EnumDescriptorProto + * @memberof google.protobuf.ServiceOptions * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.EnumDescriptorProto} EnumDescriptorProto + * @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 */ - EnumDescriptorProto.decodeDelimited = function decodeDelimited(reader) { + ServiceOptions.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]); + 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.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 "reservedRange." + error; + return "uninterpretedOption." + 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"; - } + 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"; return null; }; /** - * Creates an EnumDescriptorProto message from a plain object. Also converts values to their respective internal types. + * Creates a ServiceOptions message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.protobuf.EnumDescriptorProto + * @memberof google.protobuf.ServiceOptions * @static * @param {Object.} object Plain object - * @returns {google.protobuf.EnumDescriptorProto} EnumDescriptorProto + * @returns {google.protobuf.ServiceOptions} ServiceOptions */ - EnumDescriptorProto.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.EnumDescriptorProto) + ServiceOptions.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.ServiceOptions) 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]); + var message = new $root.google.protobuf.ServiceOptions(); + 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.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]); - } + 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"]); return message; }; /** - * Creates a plain object from an EnumDescriptorProto message. Also converts values to other types if specified. + * Creates a plain object from a ServiceOptions message. Also converts values to other types if specified. * @function toObject - * @memberof google.protobuf.EnumDescriptorProto + * @memberof google.protobuf.ServiceOptions * @static - * @param {google.protobuf.EnumDescriptorProto} message EnumDescriptorProto + * @param {google.protobuf.ServiceOptions} message ServiceOptions * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - EnumDescriptorProto.toObject = function toObject(message, options) { + ServiceOptions.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.arrays || options.defaults) { - object.value = []; - object.reservedRange = []; - object.reservedName = []; - } + if (options.arrays || options.defaults) + object.uninterpretedOption = []; 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); + object.deprecated = false; + object[".google.api.defaultHost"] = ""; + object[".google.api.oauthScopes"] = ""; } - if (message.reservedName && message.reservedName.length) { - object.reservedName = []; - for (var j = 0; j < message.reservedName.length; ++j) - object.reservedName[j] = message.reservedName[j]; + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + object.deprecated = message.deprecated; + 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"]; return object; }; /** - * Converts this EnumDescriptorProto to JSON. + * Converts this ServiceOptions to JSON. * @function toJSON - * @memberof google.protobuf.EnumDescriptorProto + * @memberof google.protobuf.ServiceOptions * @instance * @returns {Object.} JSON object */ - EnumDescriptorProto.prototype.toJSON = function toJSON() { + ServiceOptions.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for EnumDescriptorProto + * Gets the default type url for ServiceOptions * @function getTypeUrl - * @memberof google.protobuf.EnumDescriptorProto + * @memberof google.protobuf.ServiceOptions * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - EnumDescriptorProto.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + ServiceOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.protobuf.EnumDescriptorProto"; + return typeUrlPrefix + "/google.protobuf.ServiceOptions"; }; - 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) { - 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(); - 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; + return ServiceOptions; })(); - protobuf.EnumValueDescriptorProto = (function() { + protobuf.MethodOptions = (function() { /** - * Properties of an EnumValueDescriptorProto. + * Properties of a MethodOptions. * @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 + * @interface IMethodOptions + * @property {boolean|null} [deprecated] MethodOptions deprecated + * @property {google.protobuf.MethodOptions.IdempotencyLevel|null} [idempotencyLevel] MethodOptions idempotencyLevel + * @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 EnumValueDescriptorProto. + * Constructs a new MethodOptions. * @memberof google.protobuf - * @classdesc Represents an EnumValueDescriptorProto. - * @implements IEnumValueDescriptorProto + * @classdesc Represents a MethodOptions. + * @implements IMethodOptions * @constructor - * @param {google.protobuf.IEnumValueDescriptorProto=} [properties] Properties to set + * @param {google.protobuf.IMethodOptions=} [properties] Properties to set */ - function EnumValueDescriptorProto(properties) { + 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) @@ -7934,103 +8390,151 @@ } /** - * EnumValueDescriptorProto name. - * @member {string} name - * @memberof google.protobuf.EnumValueDescriptorProto + * MethodOptions deprecated. + * @member {boolean} deprecated + * @memberof google.protobuf.MethodOptions * @instance */ - EnumValueDescriptorProto.prototype.name = ""; + MethodOptions.prototype.deprecated = false; /** - * EnumValueDescriptorProto number. - * @member {number} number - * @memberof google.protobuf.EnumValueDescriptorProto + * MethodOptions idempotencyLevel. + * @member {google.protobuf.MethodOptions.IdempotencyLevel} idempotencyLevel + * @memberof google.protobuf.MethodOptions * @instance */ - EnumValueDescriptorProto.prototype.number = 0; + MethodOptions.prototype.idempotencyLevel = 0; /** - * EnumValueDescriptorProto options. - * @member {google.protobuf.IEnumValueOptions|null|undefined} options - * @memberof google.protobuf.EnumValueDescriptorProto + * MethodOptions uninterpretedOption. + * @member {Array.} uninterpretedOption + * @memberof google.protobuf.MethodOptions * @instance */ - EnumValueDescriptorProto.prototype.options = null; + MethodOptions.prototype.uninterpretedOption = $util.emptyArray; /** - * Creates a new EnumValueDescriptorProto instance using the specified properties. + * 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.EnumValueDescriptorProto + * @memberof google.protobuf.MethodOptions * @static - * @param {google.protobuf.IEnumValueDescriptorProto=} [properties] Properties to set - * @returns {google.protobuf.EnumValueDescriptorProto} EnumValueDescriptorProto instance + * @param {google.protobuf.IMethodOptions=} [properties] Properties to set + * @returns {google.protobuf.MethodOptions} MethodOptions instance */ - EnumValueDescriptorProto.create = function create(properties) { - return new EnumValueDescriptorProto(properties); + MethodOptions.create = function create(properties) { + return new MethodOptions(properties); }; /** - * Encodes the specified EnumValueDescriptorProto message. Does not implicitly {@link google.protobuf.EnumValueDescriptorProto.verify|verify} messages. + * Encodes the specified MethodOptions message. Does not implicitly {@link google.protobuf.MethodOptions.verify|verify} messages. * @function encode - * @memberof google.protobuf.EnumValueDescriptorProto + * @memberof google.protobuf.MethodOptions * @static - * @param {google.protobuf.IEnumValueDescriptorProto} message EnumValueDescriptorProto message or plain object to encode + * @param {google.protobuf.IMethodOptions} message MethodOptions message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - EnumValueDescriptorProto.encode = function encode(message, writer) { + MethodOptions.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(); + 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.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 EnumValueDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.EnumValueDescriptorProto.verify|verify} messages. + * Encodes the specified MethodOptions message, length delimited. Does not implicitly {@link google.protobuf.MethodOptions.verify|verify} messages. * @function encodeDelimited - * @memberof google.protobuf.EnumValueDescriptorProto + * @memberof google.protobuf.MethodOptions * @static - * @param {google.protobuf.IEnumValueDescriptorProto} message EnumValueDescriptorProto message or plain object to encode + * @param {google.protobuf.IMethodOptions} message MethodOptions message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - EnumValueDescriptorProto.encodeDelimited = function encodeDelimited(message, writer) { + MethodOptions.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes an EnumValueDescriptorProto message from the specified reader or buffer. + * Decodes a MethodOptions message from the specified reader or buffer. * @function decode - * @memberof google.protobuf.EnumValueDescriptorProto + * @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.EnumValueDescriptorProto} EnumValueDescriptorProto + * @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 */ - EnumValueDescriptorProto.decode = function decode(reader, length) { + MethodOptions.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.EnumValueDescriptorProto(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.MethodOptions(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: { - message.name = reader.string(); + case 33: { + message.deprecated = reader.bool(); break; } - case 2: { - message.number = reader.int32(); + case 34: { + message.idempotencyLevel = reader.int32(); break; } - case 3: { - message.options = $root.google.protobuf.EnumValueOptions.decode(reader, reader.uint32()); + 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: @@ -8042,147 +8546,251 @@ }; /** - * Decodes an EnumValueDescriptorProto message from the specified reader or buffer, length delimited. + * Decodes a MethodOptions message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.protobuf.EnumValueDescriptorProto + * @memberof google.protobuf.MethodOptions * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.EnumValueDescriptorProto} EnumValueDescriptorProto + * @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 */ - EnumValueDescriptorProto.decodeDelimited = function decodeDelimited(reader) { + MethodOptions.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies an EnumValueDescriptorProto message. + * Verifies a MethodOptions message. * @function verify - * @memberof google.protobuf.EnumValueDescriptorProto + * @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 */ - EnumValueDescriptorProto.verify = function verify(message) { + MethodOptions.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 (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.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 "options." + 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 an EnumValueDescriptorProto message from a plain object. Also converts values to their respective internal types. + * Creates a MethodOptions message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.protobuf.EnumValueDescriptorProto + * @memberof google.protobuf.MethodOptions * @static * @param {Object.} object Plain object - * @returns {google.protobuf.EnumValueDescriptorProto} EnumValueDescriptorProto + * @returns {google.protobuf.MethodOptions} MethodOptions */ - EnumValueDescriptorProto.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.EnumValueDescriptorProto) + MethodOptions.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.MethodOptions) 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); + 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.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 an EnumValueDescriptorProto message. Also converts values to other types if specified. + * Creates a plain object from a MethodOptions message. Also converts values to other types if specified. * @function toObject - * @memberof google.protobuf.EnumValueDescriptorProto + * @memberof google.protobuf.MethodOptions * @static - * @param {google.protobuf.EnumValueDescriptorProto} message EnumValueDescriptorProto + * @param {google.protobuf.MethodOptions} message MethodOptions * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - EnumValueDescriptorProto.toObject = function toObject(message, options) { + 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.name = ""; - object.number = 0; - object.options = null; + object.deprecated = false; + object.idempotencyLevel = options.enums === String ? "IDEMPOTENCY_UNKNOWN" : 0; + object[".google.longrunning.operationInfo"] = null; + object[".google.api.http"] = 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); + 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.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 EnumValueDescriptorProto to JSON. + * Converts this MethodOptions to JSON. * @function toJSON - * @memberof google.protobuf.EnumValueDescriptorProto + * @memberof google.protobuf.MethodOptions * @instance * @returns {Object.} JSON object */ - EnumValueDescriptorProto.prototype.toJSON = function toJSON() { + MethodOptions.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for EnumValueDescriptorProto + * Gets the default type url for MethodOptions * @function getTypeUrl - * @memberof google.protobuf.EnumValueDescriptorProto + * @memberof google.protobuf.MethodOptions * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - EnumValueDescriptorProto.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + MethodOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.protobuf.EnumValueDescriptorProto"; + return typeUrlPrefix + "/google.protobuf.MethodOptions"; }; - return EnumValueDescriptorProto; + /** + * 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.ServiceDescriptorProto = (function() { + protobuf.UninterpretedOption = (function() { /** - * Properties of a ServiceDescriptorProto. + * Properties of an UninterpretedOption. * @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 + * @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 ServiceDescriptorProto. + * Constructs a new UninterpretedOption. * @memberof google.protobuf - * @classdesc Represents a ServiceDescriptorProto. - * @implements IServiceDescriptorProto + * @classdesc Represents an UninterpretedOption. + * @implements IUninterpretedOption * @constructor - * @param {google.protobuf.IServiceDescriptorProto=} [properties] Properties to set + * @param {google.protobuf.IUninterpretedOption=} [properties] Properties to set */ - function ServiceDescriptorProto(properties) { - this.method = []; + function UninterpretedOption(properties) { + this.name = []; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -8190,106 +8798,162 @@ } /** - * ServiceDescriptorProto name. - * @member {string} name - * @memberof google.protobuf.ServiceDescriptorProto + * UninterpretedOption name. + * @member {Array.} name + * @memberof google.protobuf.UninterpretedOption * @instance */ - ServiceDescriptorProto.prototype.name = ""; + UninterpretedOption.prototype.name = $util.emptyArray; /** - * ServiceDescriptorProto method. - * @member {Array.} method - * @memberof google.protobuf.ServiceDescriptorProto + * UninterpretedOption identifierValue. + * @member {string} identifierValue + * @memberof google.protobuf.UninterpretedOption * @instance */ - ServiceDescriptorProto.prototype.method = $util.emptyArray; + UninterpretedOption.prototype.identifierValue = ""; /** - * ServiceDescriptorProto options. - * @member {google.protobuf.IServiceOptions|null|undefined} options - * @memberof google.protobuf.ServiceDescriptorProto + * UninterpretedOption positiveIntValue. + * @member {number|Long} positiveIntValue + * @memberof google.protobuf.UninterpretedOption * @instance */ - ServiceDescriptorProto.prototype.options = null; + UninterpretedOption.prototype.positiveIntValue = $util.Long ? $util.Long.fromBits(0,0,true) : 0; /** - * Creates a new ServiceDescriptorProto instance using the specified properties. + * 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.ServiceDescriptorProto + * @memberof google.protobuf.UninterpretedOption * @static - * @param {google.protobuf.IServiceDescriptorProto=} [properties] Properties to set - * @returns {google.protobuf.ServiceDescriptorProto} ServiceDescriptorProto instance + * @param {google.protobuf.IUninterpretedOption=} [properties] Properties to set + * @returns {google.protobuf.UninterpretedOption} UninterpretedOption instance */ - ServiceDescriptorProto.create = function create(properties) { - return new ServiceDescriptorProto(properties); + UninterpretedOption.create = function create(properties) { + return new UninterpretedOption(properties); }; /** - * Encodes the specified ServiceDescriptorProto message. Does not implicitly {@link google.protobuf.ServiceDescriptorProto.verify|verify} messages. + * Encodes the specified UninterpretedOption message. Does not implicitly {@link google.protobuf.UninterpretedOption.verify|verify} messages. * @function encode - * @memberof google.protobuf.ServiceDescriptorProto + * @memberof google.protobuf.UninterpretedOption * @static - * @param {google.protobuf.IServiceDescriptorProto} message ServiceDescriptorProto message or plain object to encode + * @param {google.protobuf.IUninterpretedOption} message UninterpretedOption message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ServiceDescriptorProto.encode = function encode(message, writer) { + UninterpretedOption.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(); + 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 ServiceDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.ServiceDescriptorProto.verify|verify} messages. + * Encodes the specified UninterpretedOption message, length delimited. Does not implicitly {@link google.protobuf.UninterpretedOption.verify|verify} messages. * @function encodeDelimited - * @memberof google.protobuf.ServiceDescriptorProto + * @memberof google.protobuf.UninterpretedOption * @static - * @param {google.protobuf.IServiceDescriptorProto} message ServiceDescriptorProto message or plain object to encode + * @param {google.protobuf.IUninterpretedOption} message UninterpretedOption message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ServiceDescriptorProto.encodeDelimited = function encodeDelimited(message, writer) { + UninterpretedOption.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a ServiceDescriptorProto message from the specified reader or buffer. + * Decodes an UninterpretedOption message from the specified reader or buffer. * @function decode - * @memberof google.protobuf.ServiceDescriptorProto + * @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.ServiceDescriptorProto} ServiceDescriptorProto + * @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 */ - ServiceDescriptorProto.decode = function decode(reader, length) { + UninterpretedOption.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.ServiceDescriptorProto(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.UninterpretedOption(); while (reader.pos < end) { var tag = reader.uint32(); 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())); + if (!(message.name && message.name.length)) + message.name = []; + message.name.push($root.google.protobuf.UninterpretedOption.NamePart.decode(reader, reader.uint32())); break; } case 3: { - message.options = $root.google.protobuf.ServiceOptions.decode(reader, reader.uint32()); + 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: @@ -8301,167 +8965,454 @@ }; /** - * Decodes a ServiceDescriptorProto message from the specified reader or buffer, length delimited. + * Decodes an UninterpretedOption message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.protobuf.ServiceDescriptorProto + * @memberof google.protobuf.UninterpretedOption * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.ServiceDescriptorProto} ServiceDescriptorProto + * @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 */ - ServiceDescriptorProto.decodeDelimited = function decodeDelimited(reader) { + UninterpretedOption.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a ServiceDescriptorProto message. + * Verifies an UninterpretedOption message. * @function verify - * @memberof google.protobuf.ServiceDescriptorProto + * @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 */ - ServiceDescriptorProto.verify = function verify(message) { + UninterpretedOption.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 (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 "method." + error; + return "name." + error; } } - if (message.options != null && message.hasOwnProperty("options")) { - var error = $root.google.protobuf.ServiceOptions.verify(message.options); - if (error) - return "options." + 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 a ServiceDescriptorProto message from a plain object. Also converts values to their respective internal types. + * Creates an UninterpretedOption message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.protobuf.ServiceDescriptorProto + * @memberof google.protobuf.UninterpretedOption * @static * @param {Object.} object Plain object - * @returns {google.protobuf.ServiceDescriptorProto} ServiceDescriptorProto + * @returns {google.protobuf.UninterpretedOption} UninterpretedOption */ - ServiceDescriptorProto.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.ServiceDescriptorProto) + UninterpretedOption.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.UninterpretedOption) 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]); + 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.options != null) { - if (typeof object.options !== "object") - throw TypeError(".google.protobuf.ServiceDescriptorProto.options: object expected"); - message.options = $root.google.protobuf.ServiceOptions.fromObject(object.options); - } + 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 a ServiceDescriptorProto message. Also converts values to other types if specified. + * Creates a plain object from an UninterpretedOption message. Also converts values to other types if specified. * @function toObject - * @memberof google.protobuf.ServiceDescriptorProto + * @memberof google.protobuf.UninterpretedOption * @static - * @param {google.protobuf.ServiceDescriptorProto} message ServiceDescriptorProto + * @param {google.protobuf.UninterpretedOption} message UninterpretedOption * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - ServiceDescriptorProto.toObject = function toObject(message, options) { + UninterpretedOption.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; if (options.arrays || options.defaults) - object.method = []; + object.name = []; if (options.defaults) { - object.name = ""; - object.options = null; + 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 != 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.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.options != null && message.hasOwnProperty("options")) - object.options = $root.google.protobuf.ServiceOptions.toObject(message.options, 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 ServiceDescriptorProto to JSON. + * Converts this UninterpretedOption to JSON. * @function toJSON - * @memberof google.protobuf.ServiceDescriptorProto + * @memberof google.protobuf.UninterpretedOption * @instance * @returns {Object.} JSON object */ - ServiceDescriptorProto.prototype.toJSON = function toJSON() { + UninterpretedOption.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for ServiceDescriptorProto + * Gets the default type url for UninterpretedOption * @function getTypeUrl - * @memberof google.protobuf.ServiceDescriptorProto + * @memberof google.protobuf.UninterpretedOption * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - ServiceDescriptorProto.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + UninterpretedOption.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.protobuf.ServiceDescriptorProto"; + return typeUrlPrefix + "/google.protobuf.UninterpretedOption"; }; - return ServiceDescriptorProto; + 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) { + 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(); + 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.MethodDescriptorProto = (function() { + protobuf.SourceCodeInfo = (function() { /** - * Properties of a MethodDescriptorProto. + * Properties of a SourceCodeInfo. * @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 + * @interface ISourceCodeInfo + * @property {Array.|null} [location] SourceCodeInfo location */ /** - * Constructs a new MethodDescriptorProto. + * Constructs a new SourceCodeInfo. * @memberof google.protobuf - * @classdesc Represents a MethodDescriptorProto. - * @implements IMethodDescriptorProto + * @classdesc Represents a SourceCodeInfo. + * @implements ISourceCodeInfo * @constructor - * @param {google.protobuf.IMethodDescriptorProto=} [properties] Properties to set + * @param {google.protobuf.ISourceCodeInfo=} [properties] Properties to set */ - function MethodDescriptorProto(properties) { + function SourceCodeInfo(properties) { + this.location = []; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -8469,145 +9420,78 @@ } /** - * 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 + * SourceCodeInfo location. + * @member {Array.} location + * @memberof google.protobuf.SourceCodeInfo * @instance */ - MethodDescriptorProto.prototype.serverStreaming = false; + SourceCodeInfo.prototype.location = $util.emptyArray; /** - * Creates a new MethodDescriptorProto instance using the specified properties. + * Creates a new SourceCodeInfo instance using the specified properties. * @function create - * @memberof google.protobuf.MethodDescriptorProto + * @memberof google.protobuf.SourceCodeInfo * @static - * @param {google.protobuf.IMethodDescriptorProto=} [properties] Properties to set - * @returns {google.protobuf.MethodDescriptorProto} MethodDescriptorProto instance + * @param {google.protobuf.ISourceCodeInfo=} [properties] Properties to set + * @returns {google.protobuf.SourceCodeInfo} SourceCodeInfo instance */ - MethodDescriptorProto.create = function create(properties) { - return new MethodDescriptorProto(properties); + SourceCodeInfo.create = function create(properties) { + return new SourceCodeInfo(properties); }; /** - * Encodes the specified MethodDescriptorProto message. Does not implicitly {@link google.protobuf.MethodDescriptorProto.verify|verify} messages. + * Encodes the specified SourceCodeInfo message. Does not implicitly {@link google.protobuf.SourceCodeInfo.verify|verify} messages. * @function encode - * @memberof google.protobuf.MethodDescriptorProto + * @memberof google.protobuf.SourceCodeInfo * @static - * @param {google.protobuf.IMethodDescriptorProto} message MethodDescriptorProto message or plain object to encode + * @param {google.protobuf.ISourceCodeInfo} message SourceCodeInfo message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - MethodDescriptorProto.encode = function encode(message, writer) { + SourceCodeInfo.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); + 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 MethodDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.MethodDescriptorProto.verify|verify} messages. + * Encodes the specified SourceCodeInfo message, length delimited. Does not implicitly {@link google.protobuf.SourceCodeInfo.verify|verify} messages. * @function encodeDelimited - * @memberof google.protobuf.MethodDescriptorProto + * @memberof google.protobuf.SourceCodeInfo * @static - * @param {google.protobuf.IMethodDescriptorProto} message MethodDescriptorProto message or plain object to encode + * @param {google.protobuf.ISourceCodeInfo} message SourceCodeInfo message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - MethodDescriptorProto.encodeDelimited = function encodeDelimited(message, writer) { + SourceCodeInfo.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a MethodDescriptorProto message from the specified reader or buffer. + * Decodes a SourceCodeInfo message from the specified reader or buffer. * @function decode - * @memberof google.protobuf.MethodDescriptorProto + * @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.MethodDescriptorProto} MethodDescriptorProto + * @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 */ - MethodDescriptorProto.decode = function decode(reader, length) { + SourceCodeInfo.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.MethodDescriptorProto(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.SourceCodeInfo(); while (reader.pos < end) { var tag = reader.uint32(); 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(); + if (!(message.location && message.location.length)) + message.location = []; + message.location.push($root.google.protobuf.SourceCodeInfo.Location.decode(reader, reader.uint32())); break; } default: @@ -8619,548 +9503,581 @@ }; /** - * Decodes a MethodDescriptorProto message from the specified reader or buffer, length delimited. + * Decodes a SourceCodeInfo message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.protobuf.MethodDescriptorProto + * @memberof google.protobuf.SourceCodeInfo * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.MethodDescriptorProto} MethodDescriptorProto + * @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 */ - MethodDescriptorProto.decodeDelimited = function decodeDelimited(reader) { + SourceCodeInfo.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a MethodDescriptorProto message. + * Verifies a SourceCodeInfo message. * @function verify - * @memberof google.protobuf.MethodDescriptorProto + * @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 */ - MethodDescriptorProto.verify = function verify(message) { + SourceCodeInfo.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"; + 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 MethodDescriptorProto message from a plain object. Also converts values to their respective internal types. + * Creates a SourceCodeInfo message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.protobuf.MethodDescriptorProto + * @memberof google.protobuf.SourceCodeInfo * @static * @param {Object.} object Plain object - * @returns {google.protobuf.MethodDescriptorProto} MethodDescriptorProto + * @returns {google.protobuf.SourceCodeInfo} SourceCodeInfo */ - MethodDescriptorProto.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.MethodDescriptorProto) + SourceCodeInfo.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.SourceCodeInfo) 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); + 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]); + } } - 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. + * Creates a plain object from a SourceCodeInfo message. Also converts values to other types if specified. * @function toObject - * @memberof google.protobuf.MethodDescriptorProto + * @memberof google.protobuf.SourceCodeInfo * @static - * @param {google.protobuf.MethodDescriptorProto} message MethodDescriptorProto + * @param {google.protobuf.SourceCodeInfo} message SourceCodeInfo * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - MethodDescriptorProto.toObject = function toObject(message, options) { + SourceCodeInfo.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 (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); } - 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. + * Converts this SourceCodeInfo to JSON. * @function toJSON - * @memberof google.protobuf.MethodDescriptorProto + * @memberof google.protobuf.SourceCodeInfo * @instance * @returns {Object.} JSON object */ - MethodDescriptorProto.prototype.toJSON = function toJSON() { + SourceCodeInfo.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for MethodDescriptorProto + * Gets the default type url for SourceCodeInfo * @function getTypeUrl - * @memberof google.protobuf.MethodDescriptorProto + * @memberof google.protobuf.SourceCodeInfo * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - MethodDescriptorProto.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + SourceCodeInfo.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.protobuf.MethodDescriptorProto"; + return typeUrlPrefix + "/google.protobuf.SourceCodeInfo"; }; - return MethodDescriptorProto; - })(); - - protobuf.FileOptions = (function() { + SourceCodeInfo.Location = (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} [phpGenericServices] FileOptions phpGenericServices - * @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 {Array.|null} [uninterpretedOption] FileOptions uninterpretedOption - */ + /** + * 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 FileOptions. - * @memberof google.protobuf - * @classdesc Represents a FileOptions. - * @implements IFileOptions - * @constructor - * @param {google.protobuf.IFileOptions=} [properties] Properties to set - */ - function FileOptions(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]]; - } + /** + * 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]]; + } - /** - * FileOptions javaPackage. - * @member {string} javaPackage - * @memberof google.protobuf.FileOptions - * @instance - */ - FileOptions.prototype.javaPackage = ""; + /** + * Location path. + * @member {Array.} path + * @memberof google.protobuf.SourceCodeInfo.Location + * @instance + */ + Location.prototype.path = $util.emptyArray; - /** - * FileOptions javaOuterClassname. - * @member {string} javaOuterClassname - * @memberof google.protobuf.FileOptions - * @instance - */ - FileOptions.prototype.javaOuterClassname = ""; + /** + * Location span. + * @member {Array.} span + * @memberof google.protobuf.SourceCodeInfo.Location + * @instance + */ + Location.prototype.span = $util.emptyArray; - /** - * FileOptions javaMultipleFiles. - * @member {boolean} javaMultipleFiles - * @memberof google.protobuf.FileOptions - * @instance - */ - FileOptions.prototype.javaMultipleFiles = false; + /** + * Location leadingComments. + * @member {string} leadingComments + * @memberof google.protobuf.SourceCodeInfo.Location + * @instance + */ + Location.prototype.leadingComments = ""; - /** - * FileOptions javaGenerateEqualsAndHash. - * @member {boolean} javaGenerateEqualsAndHash - * @memberof google.protobuf.FileOptions - * @instance - */ - FileOptions.prototype.javaGenerateEqualsAndHash = false; + /** + * Location trailingComments. + * @member {string} trailingComments + * @memberof google.protobuf.SourceCodeInfo.Location + * @instance + */ + Location.prototype.trailingComments = ""; - /** - * FileOptions javaStringCheckUtf8. - * @member {boolean} javaStringCheckUtf8 - * @memberof google.protobuf.FileOptions - * @instance - */ - FileOptions.prototype.javaStringCheckUtf8 = false; + /** + * Location leadingDetachedComments. + * @member {Array.} leadingDetachedComments + * @memberof google.protobuf.SourceCodeInfo.Location + * @instance + */ + Location.prototype.leadingDetachedComments = $util.emptyArray; - /** - * FileOptions optimizeFor. - * @member {google.protobuf.FileOptions.OptimizeMode} optimizeFor - * @memberof google.protobuf.FileOptions - * @instance - */ - FileOptions.prototype.optimizeFor = 1; + /** + * 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); + }; - /** - * FileOptions goPackage. - * @member {string} goPackage - * @memberof google.protobuf.FileOptions - * @instance - */ - FileOptions.prototype.goPackage = ""; + /** + * 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; + }; - /** - * FileOptions ccGenericServices. - * @member {boolean} ccGenericServices - * @memberof google.protobuf.FileOptions - * @instance - */ - FileOptions.prototype.ccGenericServices = false; + /** + * 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(); + }; - /** - * FileOptions javaGenericServices. - * @member {boolean} javaGenericServices - * @memberof google.protobuf.FileOptions - * @instance - */ - FileOptions.prototype.javaGenericServices = false; + /** + * 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) { + 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(); + 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; + }; - /** - * FileOptions pyGenericServices. - * @member {boolean} pyGenericServices - * @memberof google.protobuf.FileOptions - * @instance - */ - FileOptions.prototype.pyGenericServices = false; + /** + * 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()); + }; - /** - * FileOptions phpGenericServices. - * @member {boolean} phpGenericServices - * @memberof google.protobuf.FileOptions - * @instance - */ - FileOptions.prototype.phpGenericServices = false; + /** + * 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; + }; - /** - * FileOptions deprecated. - * @member {boolean} deprecated - * @memberof google.protobuf.FileOptions - * @instance - */ - FileOptions.prototype.deprecated = false; + /** + * 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; + }; - /** - * FileOptions ccEnableArenas. - * @member {boolean} ccEnableArenas - * @memberof google.protobuf.FileOptions - * @instance - */ - FileOptions.prototype.ccEnableArenas = true; + /** + * 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; + }; - /** - * FileOptions objcClassPrefix. - * @member {string} objcClassPrefix - * @memberof google.protobuf.FileOptions - * @instance - */ - FileOptions.prototype.objcClassPrefix = ""; + /** + * 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); + }; - /** - * FileOptions csharpNamespace. - * @member {string} csharpNamespace - * @memberof google.protobuf.FileOptions - * @instance - */ - FileOptions.prototype.csharpNamespace = ""; + /** + * 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"; + }; - /** - * FileOptions swiftPrefix. - * @member {string} swiftPrefix - * @memberof google.protobuf.FileOptions - * @instance - */ - FileOptions.prototype.swiftPrefix = ""; + return Location; + })(); - /** - * FileOptions phpClassPrefix. - * @member {string} phpClassPrefix - * @memberof google.protobuf.FileOptions - * @instance - */ - FileOptions.prototype.phpClassPrefix = ""; + return SourceCodeInfo; + })(); - /** - * FileOptions phpNamespace. - * @member {string} phpNamespace - * @memberof google.protobuf.FileOptions - * @instance - */ - FileOptions.prototype.phpNamespace = ""; + protobuf.GeneratedCodeInfo = (function() { /** - * FileOptions phpMetadataNamespace. - * @member {string} phpMetadataNamespace - * @memberof google.protobuf.FileOptions - * @instance + * Properties of a GeneratedCodeInfo. + * @memberof google.protobuf + * @interface IGeneratedCodeInfo + * @property {Array.|null} [annotation] GeneratedCodeInfo annotation */ - FileOptions.prototype.phpMetadataNamespace = ""; /** - * FileOptions rubyPackage. - * @member {string} rubyPackage - * @memberof google.protobuf.FileOptions - * @instance + * Constructs a new GeneratedCodeInfo. + * @memberof google.protobuf + * @classdesc Represents a GeneratedCodeInfo. + * @implements IGeneratedCodeInfo + * @constructor + * @param {google.protobuf.IGeneratedCodeInfo=} [properties] Properties to set */ - FileOptions.prototype.rubyPackage = ""; + 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]]; + } /** - * FileOptions uninterpretedOption. - * @member {Array.} uninterpretedOption - * @memberof google.protobuf.FileOptions + * GeneratedCodeInfo annotation. + * @member {Array.} annotation + * @memberof google.protobuf.GeneratedCodeInfo * @instance */ - FileOptions.prototype.uninterpretedOption = $util.emptyArray; + GeneratedCodeInfo.prototype.annotation = $util.emptyArray; /** - * Creates a new FileOptions instance using the specified properties. + * Creates a new GeneratedCodeInfo instance using the specified properties. * @function create - * @memberof google.protobuf.FileOptions + * @memberof google.protobuf.GeneratedCodeInfo * @static - * @param {google.protobuf.IFileOptions=} [properties] Properties to set - * @returns {google.protobuf.FileOptions} FileOptions instance + * @param {google.protobuf.IGeneratedCodeInfo=} [properties] Properties to set + * @returns {google.protobuf.GeneratedCodeInfo} GeneratedCodeInfo instance */ - FileOptions.create = function create(properties) { - return new FileOptions(properties); + GeneratedCodeInfo.create = function create(properties) { + return new GeneratedCodeInfo(properties); }; /** - * Encodes the specified FileOptions message. Does not implicitly {@link google.protobuf.FileOptions.verify|verify} messages. + * Encodes the specified GeneratedCodeInfo message. Does not implicitly {@link google.protobuf.GeneratedCodeInfo.verify|verify} messages. * @function encode - * @memberof google.protobuf.FileOptions + * @memberof google.protobuf.GeneratedCodeInfo * @static - * @param {google.protobuf.IFileOptions} message FileOptions message or plain object to encode + * @param {google.protobuf.IGeneratedCodeInfo} message GeneratedCodeInfo message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - FileOptions.encode = function encode(message, writer) { + GeneratedCodeInfo.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.phpGenericServices != null && Object.hasOwnProperty.call(message, "phpGenericServices")) - writer.uint32(/* id 42, wireType 0 =*/336).bool(message.phpGenericServices); - 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.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.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 FileOptions message, length delimited. Does not implicitly {@link google.protobuf.FileOptions.verify|verify} messages. + * Encodes the specified GeneratedCodeInfo message, length delimited. Does not implicitly {@link google.protobuf.GeneratedCodeInfo.verify|verify} messages. * @function encodeDelimited - * @memberof google.protobuf.FileOptions + * @memberof google.protobuf.GeneratedCodeInfo * @static - * @param {google.protobuf.IFileOptions} message FileOptions message or plain object to encode + * @param {google.protobuf.IGeneratedCodeInfo} message GeneratedCodeInfo message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - FileOptions.encodeDelimited = function encodeDelimited(message, writer) { + GeneratedCodeInfo.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a FileOptions message from the specified reader or buffer. + * Decodes a GeneratedCodeInfo message from the specified reader or buffer. * @function decode - * @memberof google.protobuf.FileOptions + * @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.FileOptions} FileOptions + * @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 */ - FileOptions.decode = function decode(reader, length) { + GeneratedCodeInfo.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.FileOptions(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.GeneratedCodeInfo(); while (reader.pos < end) { var tag = reader.uint32(); 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 42: { - message.phpGenericServices = 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 999: { - if (!(message.uninterpretedOption && message.uninterpretedOption.length)) - message.uninterpretedOption = []; - message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); + if (!(message.annotation && message.annotation.length)) + message.annotation = []; + message.annotation.push($root.google.protobuf.GeneratedCodeInfo.Annotation.decode(reader, reader.uint32())); break; } default: @@ -9172,347 +10089,509 @@ }; /** - * Decodes a FileOptions message from the specified reader or buffer, length delimited. + * Decodes a GeneratedCodeInfo message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.protobuf.FileOptions + * @memberof google.protobuf.GeneratedCodeInfo * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.FileOptions} FileOptions + * @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 */ - FileOptions.decodeDelimited = function decodeDelimited(reader) { + GeneratedCodeInfo.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a FileOptions message. + * Verifies a GeneratedCodeInfo message. * @function verify - * @memberof google.protobuf.FileOptions + * @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 */ - FileOptions.verify = function verify(message) { + GeneratedCodeInfo.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.phpGenericServices != null && message.hasOwnProperty("phpGenericServices")) - if (typeof message.phpGenericServices !== "boolean") - return "phpGenericServices: 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.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 (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 "uninterpretedOption." + error; + return "annotation." + error; } } return null; }; /** - * Creates a FileOptions message from a plain object. Also converts values to their respective internal types. + * Creates a GeneratedCodeInfo message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.protobuf.FileOptions + * @memberof google.protobuf.GeneratedCodeInfo * @static * @param {Object.} object Plain object - * @returns {google.protobuf.FileOptions} FileOptions + * @returns {google.protobuf.GeneratedCodeInfo} GeneratedCodeInfo */ - FileOptions.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.FileOptions) + GeneratedCodeInfo.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.GeneratedCodeInfo) 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.phpGenericServices != null) - message.phpGenericServices = Boolean(object.phpGenericServices); - 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.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]); - } - } - 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 = []; - 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.phpGenericServices = false; - object.phpMetadataNamespace = ""; - object.rubyPackage = ""; + 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]); + } } - 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.phpGenericServices != null && message.hasOwnProperty("phpGenericServices")) - object.phpGenericServices = message.phpGenericServices; - if (message.phpMetadataNamespace != null && message.hasOwnProperty("phpMetadataNamespace")) - object.phpMetadataNamespace = message.phpMetadataNamespace; - if (message.rubyPackage != null && message.hasOwnProperty("rubyPackage")) - object.rubyPackage = message.rubyPackage; - 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 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 FileOptions to JSON. + * Converts this GeneratedCodeInfo to JSON. * @function toJSON - * @memberof google.protobuf.FileOptions + * @memberof google.protobuf.GeneratedCodeInfo * @instance * @returns {Object.} JSON object */ - FileOptions.prototype.toJSON = function toJSON() { + GeneratedCodeInfo.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for FileOptions + * Gets the default type url for GeneratedCodeInfo * @function getTypeUrl - * @memberof google.protobuf.FileOptions + * @memberof google.protobuf.GeneratedCodeInfo * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - FileOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + GeneratedCodeInfo.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.protobuf.FileOptions"; + return typeUrlPrefix + "/google.protobuf.GeneratedCodeInfo"; }; - /** - * 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; + 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) { + 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(); + 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 FileOptions; + return GeneratedCodeInfo; })(); - protobuf.MessageOptions = (function() { + protobuf.Api = (function() { /** - * Properties of a MessageOptions. + * Properties of an Api. * @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 {Array.|null} [uninterpretedOption] MessageOptions uninterpretedOption + * @interface IApi + * @property {string|null} [name] Api name + * @property {Array.|null} [methods] Api methods + * @property {Array.|null} [options] Api options + * @property {string|null} [version] Api version + * @property {google.protobuf.ISourceContext|null} [sourceContext] Api sourceContext + * @property {Array.|null} [mixins] Api mixins + * @property {google.protobuf.Syntax|null} [syntax] Api syntax */ /** - * Constructs a new MessageOptions. + * Constructs a new Api. * @memberof google.protobuf - * @classdesc Represents a MessageOptions. - * @implements IMessageOptions + * @classdesc Represents an Api. + * @implements IApi * @constructor - * @param {google.protobuf.IMessageOptions=} [properties] Properties to set + * @param {google.protobuf.IApi=} [properties] Properties to set */ - function MessageOptions(properties) { - this.uninterpretedOption = []; + function Api(properties) { + this.methods = []; + this.options = []; + this.mixins = []; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -9520,148 +10599,168 @@ } /** - * MessageOptions messageSetWireFormat. - * @member {boolean} messageSetWireFormat - * @memberof google.protobuf.MessageOptions + * Api name. + * @member {string} name + * @memberof google.protobuf.Api * @instance */ - MessageOptions.prototype.messageSetWireFormat = false; + Api.prototype.name = ""; /** - * MessageOptions noStandardDescriptorAccessor. - * @member {boolean} noStandardDescriptorAccessor - * @memberof google.protobuf.MessageOptions + * Api methods. + * @member {Array.} methods + * @memberof google.protobuf.Api + * @instance + */ + Api.prototype.methods = $util.emptyArray; + + /** + * Api options. + * @member {Array.} options + * @memberof google.protobuf.Api * @instance */ - MessageOptions.prototype.noStandardDescriptorAccessor = false; + Api.prototype.options = $util.emptyArray; /** - * MessageOptions deprecated. - * @member {boolean} deprecated - * @memberof google.protobuf.MessageOptions + * Api version. + * @member {string} version + * @memberof google.protobuf.Api * @instance */ - MessageOptions.prototype.deprecated = false; + Api.prototype.version = ""; /** - * MessageOptions mapEntry. - * @member {boolean} mapEntry - * @memberof google.protobuf.MessageOptions + * Api sourceContext. + * @member {google.protobuf.ISourceContext|null|undefined} sourceContext + * @memberof google.protobuf.Api * @instance */ - MessageOptions.prototype.mapEntry = false; + Api.prototype.sourceContext = null; /** - * MessageOptions deprecatedLegacyJsonFieldConflicts. - * @member {boolean} deprecatedLegacyJsonFieldConflicts - * @memberof google.protobuf.MessageOptions + * Api mixins. + * @member {Array.} mixins + * @memberof google.protobuf.Api * @instance */ - MessageOptions.prototype.deprecatedLegacyJsonFieldConflicts = false; + Api.prototype.mixins = $util.emptyArray; /** - * MessageOptions uninterpretedOption. - * @member {Array.} uninterpretedOption - * @memberof google.protobuf.MessageOptions + * Api syntax. + * @member {google.protobuf.Syntax} syntax + * @memberof google.protobuf.Api * @instance */ - MessageOptions.prototype.uninterpretedOption = $util.emptyArray; + Api.prototype.syntax = 0; /** - * Creates a new MessageOptions instance using the specified properties. + * Creates a new Api instance using the specified properties. * @function create - * @memberof google.protobuf.MessageOptions + * @memberof google.protobuf.Api * @static - * @param {google.protobuf.IMessageOptions=} [properties] Properties to set - * @returns {google.protobuf.MessageOptions} MessageOptions instance + * @param {google.protobuf.IApi=} [properties] Properties to set + * @returns {google.protobuf.Api} Api instance */ - MessageOptions.create = function create(properties) { - return new MessageOptions(properties); + Api.create = function create(properties) { + return new Api(properties); }; /** - * Encodes the specified MessageOptions message. Does not implicitly {@link google.protobuf.MessageOptions.verify|verify} messages. + * Encodes the specified Api message. Does not implicitly {@link google.protobuf.Api.verify|verify} messages. * @function encode - * @memberof google.protobuf.MessageOptions + * @memberof google.protobuf.Api * @static - * @param {google.protobuf.IMessageOptions} message MessageOptions message or plain object to encode + * @param {google.protobuf.IApi} message Api message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - MessageOptions.encode = function encode(message, writer) { + Api.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.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.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.methods != null && message.methods.length) + for (var i = 0; i < message.methods.length; ++i) + $root.google.protobuf.Method.encode(message.methods[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.options != null && message.options.length) + for (var i = 0; i < message.options.length; ++i) + $root.google.protobuf.Option.encode(message.options[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.version != null && Object.hasOwnProperty.call(message, "version")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.version); + if (message.sourceContext != null && Object.hasOwnProperty.call(message, "sourceContext")) + $root.google.protobuf.SourceContext.encode(message.sourceContext, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.mixins != null && message.mixins.length) + for (var i = 0; i < message.mixins.length; ++i) + $root.google.protobuf.Mixin.encode(message.mixins[i], writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + if (message.syntax != null && Object.hasOwnProperty.call(message, "syntax")) + writer.uint32(/* id 7, wireType 0 =*/56).int32(message.syntax); return writer; }; /** - * Encodes the specified MessageOptions message, length delimited. Does not implicitly {@link google.protobuf.MessageOptions.verify|verify} messages. + * Encodes the specified Api message, length delimited. Does not implicitly {@link google.protobuf.Api.verify|verify} messages. * @function encodeDelimited - * @memberof google.protobuf.MessageOptions + * @memberof google.protobuf.Api * @static - * @param {google.protobuf.IMessageOptions} message MessageOptions message or plain object to encode + * @param {google.protobuf.IApi} message Api message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - MessageOptions.encodeDelimited = function encodeDelimited(message, writer) { + Api.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a MessageOptions message from the specified reader or buffer. + * Decodes an Api message from the specified reader or buffer. * @function decode - * @memberof google.protobuf.MessageOptions + * @memberof google.protobuf.Api * @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 + * @returns {google.protobuf.Api} Api * @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) { + Api.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.MessageOptions(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.Api(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: { - message.messageSetWireFormat = reader.bool(); + message.name = reader.string(); break; } case 2: { - message.noStandardDescriptorAccessor = reader.bool(); + if (!(message.methods && message.methods.length)) + message.methods = []; + message.methods.push($root.google.protobuf.Method.decode(reader, reader.uint32())); break; } case 3: { - message.deprecated = reader.bool(); + if (!(message.options && message.options.length)) + message.options = []; + message.options.push($root.google.protobuf.Option.decode(reader, reader.uint32())); break; } - case 7: { - message.mapEntry = reader.bool(); + case 4: { + message.version = reader.string(); break; } - case 11: { - message.deprecatedLegacyJsonFieldConflicts = reader.bool(); + case 5: { + message.sourceContext = $root.google.protobuf.SourceContext.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())); + case 6: { + if (!(message.mixins && message.mixins.length)) + message.mixins = []; + message.mixins.push($root.google.protobuf.Mixin.decode(reader, reader.uint32())); + break; + } + case 7: { + message.syntax = reader.int32(); break; } default: @@ -9673,192 +10772,255 @@ }; /** - * Decodes a MessageOptions message from the specified reader or buffer, length delimited. + * Decodes an Api message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.protobuf.MessageOptions + * @memberof google.protobuf.Api * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.MessageOptions} MessageOptions + * @returns {google.protobuf.Api} Api * @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) { + Api.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a MessageOptions message. + * Verifies an Api message. * @function verify - * @memberof google.protobuf.MessageOptions + * @memberof google.protobuf.Api * @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) { + Api.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.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 (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string 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) { + var error = $root.google.protobuf.Method.verify(message.methods[i]); if (error) - return "uninterpretedOption." + error; + return "methods." + error; + } + } + if (message.options != null && message.hasOwnProperty("options")) { + if (!Array.isArray(message.options)) + return "options: array expected"; + for (var i = 0; i < message.options.length; ++i) { + var error = $root.google.protobuf.Option.verify(message.options[i]); + if (error) + return "options." + error; + } + } + if (message.version != null && message.hasOwnProperty("version")) + if (!$util.isString(message.version)) + return "version: string expected"; + if (message.sourceContext != null && message.hasOwnProperty("sourceContext")) { + var error = $root.google.protobuf.SourceContext.verify(message.sourceContext); + if (error) + return "sourceContext." + error; + } + if (message.mixins != null && message.hasOwnProperty("mixins")) { + if (!Array.isArray(message.mixins)) + return "mixins: array expected"; + for (var i = 0; i < message.mixins.length; ++i) { + var error = $root.google.protobuf.Mixin.verify(message.mixins[i]); + if (error) + return "mixins." + error; } } + if (message.syntax != null && message.hasOwnProperty("syntax")) + switch (message.syntax) { + default: + return "syntax: enum value expected"; + case 0: + case 1: + break; + } return null; }; /** - * Creates a MessageOptions message from a plain object. Also converts values to their respective internal types. + * Creates an Api message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.protobuf.MessageOptions + * @memberof google.protobuf.Api * @static * @param {Object.} object Plain object - * @returns {google.protobuf.MessageOptions} MessageOptions + * @returns {google.protobuf.Api} Api */ - MessageOptions.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.MessageOptions) + Api.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.Api) 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.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]); + var message = new $root.google.protobuf.Api(); + if (object.name != null) + message.name = String(object.name); + if (object.methods) { + if (!Array.isArray(object.methods)) + throw TypeError(".google.protobuf.Api.methods: array expected"); + message.methods = []; + for (var i = 0; i < object.methods.length; ++i) { + if (typeof object.methods[i] !== "object") + throw TypeError(".google.protobuf.Api.methods: object expected"); + message.methods[i] = $root.google.protobuf.Method.fromObject(object.methods[i]); + } + } + if (object.options) { + if (!Array.isArray(object.options)) + throw TypeError(".google.protobuf.Api.options: array expected"); + message.options = []; + for (var i = 0; i < object.options.length; ++i) { + if (typeof object.options[i] !== "object") + throw TypeError(".google.protobuf.Api.options: object expected"); + message.options[i] = $root.google.protobuf.Option.fromObject(object.options[i]); + } + } + if (object.version != null) + message.version = String(object.version); + if (object.sourceContext != null) { + if (typeof object.sourceContext !== "object") + throw TypeError(".google.protobuf.Api.sourceContext: object expected"); + message.sourceContext = $root.google.protobuf.SourceContext.fromObject(object.sourceContext); + } + if (object.mixins) { + if (!Array.isArray(object.mixins)) + throw TypeError(".google.protobuf.Api.mixins: array expected"); + message.mixins = []; + for (var i = 0; i < object.mixins.length; ++i) { + if (typeof object.mixins[i] !== "object") + throw TypeError(".google.protobuf.Api.mixins: object expected"); + message.mixins[i] = $root.google.protobuf.Mixin.fromObject(object.mixins[i]); + } + } + switch (object.syntax) { + default: + if (typeof object.syntax === "number") { + message.syntax = object.syntax; + break; } + break; + case "SYNTAX_PROTO2": + case 0: + message.syntax = 0; + break; + case "SYNTAX_PROTO3": + case 1: + message.syntax = 1; + break; } return message; }; /** - * Creates a plain object from a MessageOptions message. Also converts values to other types if specified. + * Creates a plain object from an Api message. Also converts values to other types if specified. * @function toObject - * @memberof google.protobuf.MessageOptions + * @memberof google.protobuf.Api * @static - * @param {google.protobuf.MessageOptions} message MessageOptions + * @param {google.protobuf.Api} message Api * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - MessageOptions.toObject = function toObject(message, options) { + Api.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.arrays || options.defaults) - object.uninterpretedOption = []; + if (options.arrays || options.defaults) { + object.methods = []; + object.options = []; + object.mixins = []; + } if (options.defaults) { - object.messageSetWireFormat = false; - object.noStandardDescriptorAccessor = false; - object.deprecated = false; - object.mapEntry = false; - object.deprecatedLegacyJsonFieldConflicts = false; + object.name = ""; + object.version = ""; + object.sourceContext = null; + object.syntax = options.enums === String ? "SYNTAX_PROTO2" : 0; } - 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.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.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.methods && message.methods.length) { + object.methods = []; + for (var j = 0; j < message.methods.length; ++j) + object.methods[j] = $root.google.protobuf.Method.toObject(message.methods[j], options); + } + if (message.options && message.options.length) { + object.options = []; + for (var j = 0; j < message.options.length; ++j) + object.options[j] = $root.google.protobuf.Option.toObject(message.options[j], options); + } + if (message.version != null && message.hasOwnProperty("version")) + object.version = message.version; + if (message.sourceContext != null && message.hasOwnProperty("sourceContext")) + object.sourceContext = $root.google.protobuf.SourceContext.toObject(message.sourceContext, options); + if (message.mixins && message.mixins.length) { + object.mixins = []; + for (var j = 0; j < message.mixins.length; ++j) + object.mixins[j] = $root.google.protobuf.Mixin.toObject(message.mixins[j], options); } + if (message.syntax != null && message.hasOwnProperty("syntax")) + object.syntax = options.enums === String ? $root.google.protobuf.Syntax[message.syntax] === undefined ? message.syntax : $root.google.protobuf.Syntax[message.syntax] : message.syntax; return object; }; /** - * Converts this MessageOptions to JSON. + * Converts this Api to JSON. * @function toJSON - * @memberof google.protobuf.MessageOptions + * @memberof google.protobuf.Api * @instance * @returns {Object.} JSON object */ - MessageOptions.prototype.toJSON = function toJSON() { + Api.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for MessageOptions + * Gets the default type url for Api * @function getTypeUrl - * @memberof google.protobuf.MessageOptions + * @memberof google.protobuf.Api * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - MessageOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + Api.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.protobuf.MessageOptions"; + return typeUrlPrefix + "/google.protobuf.Api"; }; - return MessageOptions; + return Api; })(); - protobuf.FieldOptions = (function() { + protobuf.Method = (function() { /** - * Properties of a FieldOptions. + * Properties of a Method. * @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 {google.protobuf.FieldOptions.OptionTargetType|null} [target] FieldOptions target - * @property {Array.|null} [uninterpretedOption] FieldOptions uninterpretedOption + * @interface IMethod + * @property {string|null} [name] Method name + * @property {string|null} [requestTypeUrl] Method requestTypeUrl + * @property {boolean|null} [requestStreaming] Method requestStreaming + * @property {string|null} [responseTypeUrl] Method responseTypeUrl + * @property {boolean|null} [responseStreaming] Method responseStreaming + * @property {Array.|null} [options] Method options + * @property {google.protobuf.Syntax|null} [syntax] Method syntax */ /** - * Constructs a new FieldOptions. + * Constructs a new Method. * @memberof google.protobuf - * @classdesc Represents a FieldOptions. - * @implements IFieldOptions + * @classdesc Represents a Method. + * @implements IMethod * @constructor - * @param {google.protobuf.IFieldOptions=} [properties] Properties to set + * @param {google.protobuf.IMethod=} [properties] Properties to set */ - function FieldOptions(properties) { - this.uninterpretedOption = []; + function Method(properties) { + this.options = []; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -9866,218 +11028,162 @@ } /** - * 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 + * Method name. + * @member {string} name + * @memberof google.protobuf.Method * @instance */ - FieldOptions.prototype.unverifiedLazy = false; + Method.prototype.name = ""; /** - * FieldOptions deprecated. - * @member {boolean} deprecated - * @memberof google.protobuf.FieldOptions + * Method requestTypeUrl. + * @member {string} requestTypeUrl + * @memberof google.protobuf.Method * @instance */ - FieldOptions.prototype.deprecated = false; + Method.prototype.requestTypeUrl = ""; /** - * FieldOptions weak. - * @member {boolean} weak - * @memberof google.protobuf.FieldOptions + * Method requestStreaming. + * @member {boolean} requestStreaming + * @memberof google.protobuf.Method * @instance */ - FieldOptions.prototype.weak = false; + Method.prototype.requestStreaming = false; /** - * FieldOptions debugRedact. - * @member {boolean} debugRedact - * @memberof google.protobuf.FieldOptions + * Method responseTypeUrl. + * @member {string} responseTypeUrl + * @memberof google.protobuf.Method * @instance */ - FieldOptions.prototype.debugRedact = false; + Method.prototype.responseTypeUrl = ""; /** - * FieldOptions retention. - * @member {google.protobuf.FieldOptions.OptionRetention} retention - * @memberof google.protobuf.FieldOptions + * Method responseStreaming. + * @member {boolean} responseStreaming + * @memberof google.protobuf.Method * @instance */ - FieldOptions.prototype.retention = 0; + Method.prototype.responseStreaming = false; /** - * FieldOptions target. - * @member {google.protobuf.FieldOptions.OptionTargetType} target - * @memberof google.protobuf.FieldOptions + * Method options. + * @member {Array.} options + * @memberof google.protobuf.Method * @instance */ - FieldOptions.prototype.target = 0; + Method.prototype.options = $util.emptyArray; /** - * FieldOptions uninterpretedOption. - * @member {Array.} uninterpretedOption - * @memberof google.protobuf.FieldOptions + * Method syntax. + * @member {google.protobuf.Syntax} syntax + * @memberof google.protobuf.Method * @instance */ - FieldOptions.prototype.uninterpretedOption = $util.emptyArray; + Method.prototype.syntax = 0; /** - * Creates a new FieldOptions instance using the specified properties. + * Creates a new Method instance using the specified properties. * @function create - * @memberof google.protobuf.FieldOptions + * @memberof google.protobuf.Method * @static - * @param {google.protobuf.IFieldOptions=} [properties] Properties to set - * @returns {google.protobuf.FieldOptions} FieldOptions instance + * @param {google.protobuf.IMethod=} [properties] Properties to set + * @returns {google.protobuf.Method} Method instance */ - FieldOptions.create = function create(properties) { - return new FieldOptions(properties); + Method.create = function create(properties) { + return new Method(properties); }; /** - * Encodes the specified FieldOptions message. Does not implicitly {@link google.protobuf.FieldOptions.verify|verify} messages. + * Encodes the specified Method message. Does not implicitly {@link google.protobuf.Method.verify|verify} messages. * @function encode - * @memberof google.protobuf.FieldOptions + * @memberof google.protobuf.Method * @static - * @param {google.protobuf.IFieldOptions} message FieldOptions message or plain object to encode + * @param {google.protobuf.IMethod} message Method message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - FieldOptions.encode = function encode(message, writer) { + Method.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.target != null && Object.hasOwnProperty.call(message, "target")) - writer.uint32(/* id 18, wireType 0 =*/144).int32(message.target); - 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.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.requestTypeUrl != null && Object.hasOwnProperty.call(message, "requestTypeUrl")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.requestTypeUrl); + if (message.requestStreaming != null && Object.hasOwnProperty.call(message, "requestStreaming")) + writer.uint32(/* id 3, wireType 0 =*/24).bool(message.requestStreaming); + if (message.responseTypeUrl != null && Object.hasOwnProperty.call(message, "responseTypeUrl")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.responseTypeUrl); + if (message.responseStreaming != null && Object.hasOwnProperty.call(message, "responseStreaming")) + writer.uint32(/* id 5, wireType 0 =*/40).bool(message.responseStreaming); + if (message.options != null && message.options.length) + for (var i = 0; i < message.options.length; ++i) + $root.google.protobuf.Option.encode(message.options[i], writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + if (message.syntax != null && Object.hasOwnProperty.call(message, "syntax")) + writer.uint32(/* id 7, wireType 0 =*/56).int32(message.syntax); return writer; }; /** - * Encodes the specified FieldOptions message, length delimited. Does not implicitly {@link google.protobuf.FieldOptions.verify|verify} messages. + * Encodes the specified Method message, length delimited. Does not implicitly {@link google.protobuf.Method.verify|verify} messages. * @function encodeDelimited - * @memberof google.protobuf.FieldOptions + * @memberof google.protobuf.Method * @static - * @param {google.protobuf.IFieldOptions} message FieldOptions message or plain object to encode + * @param {google.protobuf.IMethod} message Method message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - FieldOptions.encodeDelimited = function encodeDelimited(message, writer) { + Method.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a FieldOptions message from the specified reader or buffer. + * Decodes a Method message from the specified reader or buffer. * @function decode - * @memberof google.protobuf.FieldOptions + * @memberof google.protobuf.Method * @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 + * @returns {google.protobuf.Method} Method * @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) { + Method.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.FieldOptions(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.Method(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: { - message.ctype = reader.int32(); + message.name = reader.string(); 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(); + message.requestTypeUrl = reader.string(); break; } case 3: { - message.deprecated = reader.bool(); - break; - } - case 10: { - message.weak = reader.bool(); + message.requestStreaming = reader.bool(); break; } - case 16: { - message.debugRedact = reader.bool(); + case 4: { + message.responseTypeUrl = reader.string(); break; } - case 17: { - message.retention = reader.int32(); + case 5: { + message.responseStreaming = reader.bool(); break; } - case 18: { - message.target = reader.int32(); + case 6: { + if (!(message.options && message.options.length)) + message.options = []; + message.options.push($root.google.protobuf.Option.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())); + case 7: { + message.syntax = reader.int32(); break; } default: @@ -10089,431 +11195,209 @@ }; /** - * Decodes a FieldOptions message from the specified reader or buffer, length delimited. + * Decodes a Method message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.protobuf.FieldOptions + * @memberof google.protobuf.Method * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.FieldOptions} FieldOptions + * @returns {google.protobuf.Method} Method * @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) { + Method.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a FieldOptions message. + * Verifies a Method message. * @function verify - * @memberof google.protobuf.FieldOptions + * @memberof google.protobuf.Method * @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) { + Method.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.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.requestTypeUrl != null && message.hasOwnProperty("requestTypeUrl")) + if (!$util.isString(message.requestTypeUrl)) + return "requestTypeUrl: string expected"; + if (message.requestStreaming != null && message.hasOwnProperty("requestStreaming")) + if (typeof message.requestStreaming !== "boolean") + return "requestStreaming: boolean expected"; + if (message.responseTypeUrl != null && message.hasOwnProperty("responseTypeUrl")) + if (!$util.isString(message.responseTypeUrl)) + return "responseTypeUrl: string expected"; + if (message.responseStreaming != null && message.hasOwnProperty("responseStreaming")) + if (typeof message.responseStreaming !== "boolean") + return "responseStreaming: boolean expected"; + if (message.options != null && message.hasOwnProperty("options")) { + if (!Array.isArray(message.options)) + return "options: array expected"; + for (var i = 0; i < message.options.length; ++i) { + var error = $root.google.protobuf.Option.verify(message.options[i]); + if (error) + return "options." + error; } - if (message.target != null && message.hasOwnProperty("target")) - switch (message.target) { + } + if (message.syntax != null && message.hasOwnProperty("syntax")) + switch (message.syntax) { default: - return "target: enum value expected"; + return "syntax: 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.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 a FieldOptions message from a plain object. Also converts values to their respective internal types. + * Creates a Method message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.protobuf.FieldOptions + * @memberof google.protobuf.Method * @static * @param {Object.} object Plain object - * @returns {google.protobuf.FieldOptions} FieldOptions + * @returns {google.protobuf.Method} Method */ - FieldOptions.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.FieldOptions) + Method.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.Method) 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; + var message = new $root.google.protobuf.Method(); + if (object.name != null) + message.name = String(object.name); + if (object.requestTypeUrl != null) + message.requestTypeUrl = String(object.requestTypeUrl); + if (object.requestStreaming != null) + message.requestStreaming = Boolean(object.requestStreaming); + if (object.responseTypeUrl != null) + message.responseTypeUrl = String(object.responseTypeUrl); + if (object.responseStreaming != null) + message.responseStreaming = Boolean(object.responseStreaming); + if (object.options) { + if (!Array.isArray(object.options)) + throw TypeError(".google.protobuf.Method.options: array expected"); + message.options = []; + for (var i = 0; i < object.options.length; ++i) { + if (typeof object.options[i] !== "object") + throw TypeError(".google.protobuf.Method.options: object expected"); + message.options[i] = $root.google.protobuf.Option.fromObject(object.options[i]); } - 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; } - switch (object.target) { + switch (object.syntax) { default: - if (typeof object.target === "number") { - message.target = object.target; + if (typeof object.syntax === "number") { + message.syntax = object.syntax; break; } break; - case "TARGET_TYPE_UNKNOWN": + case "SYNTAX_PROTO2": case 0: - message.target = 0; + message.syntax = 0; break; - case "TARGET_TYPE_FILE": + case "SYNTAX_PROTO3": case 1: - message.target = 1; - break; - case "TARGET_TYPE_EXTENSION_RANGE": - case 2: - message.target = 2; - break; - case "TARGET_TYPE_MESSAGE": - case 3: - message.target = 3; - break; - case "TARGET_TYPE_FIELD": - case 4: - message.target = 4; - break; - case "TARGET_TYPE_ONEOF": - case 5: - message.target = 5; - break; - case "TARGET_TYPE_ENUM": - case 6: - message.target = 6; - break; - case "TARGET_TYPE_ENUM_ENTRY": - case 7: - message.target = 7; - break; - case "TARGET_TYPE_SERVICE": - case 8: - message.target = 8; - break; - case "TARGET_TYPE_METHOD": - case 9: - message.target = 9; + message.syntax = 1; break; } - 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]); - } - } return message; }; /** - * Creates a plain object from a FieldOptions message. Also converts values to other types if specified. + * Creates a plain object from a Method message. Also converts values to other types if specified. * @function toObject - * @memberof google.protobuf.FieldOptions + * @memberof google.protobuf.Method * @static - * @param {google.protobuf.FieldOptions} message FieldOptions + * @param {google.protobuf.Method} message Method * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - FieldOptions.toObject = function toObject(message, options) { + Method.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; if (options.arrays || options.defaults) - object.uninterpretedOption = []; + object.options = []; 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.target = options.enums === String ? "TARGET_TYPE_UNKNOWN" : 0; + object.name = ""; + object.requestTypeUrl = ""; + object.requestStreaming = false; + object.responseTypeUrl = ""; + object.responseStreaming = false; + object.syntax = options.enums === String ? "SYNTAX_PROTO2" : 0; } - 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.target != null && message.hasOwnProperty("target")) - object.target = options.enums === String ? $root.google.protobuf.FieldOptions.OptionTargetType[message.target] === undefined ? message.target : $root.google.protobuf.FieldOptions.OptionTargetType[message.target] : message.target; - 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.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.requestTypeUrl != null && message.hasOwnProperty("requestTypeUrl")) + object.requestTypeUrl = message.requestTypeUrl; + if (message.requestStreaming != null && message.hasOwnProperty("requestStreaming")) + object.requestStreaming = message.requestStreaming; + if (message.responseTypeUrl != null && message.hasOwnProperty("responseTypeUrl")) + object.responseTypeUrl = message.responseTypeUrl; + if (message.responseStreaming != null && message.hasOwnProperty("responseStreaming")) + object.responseStreaming = message.responseStreaming; + if (message.options && message.options.length) { + object.options = []; + for (var j = 0; j < message.options.length; ++j) + object.options[j] = $root.google.protobuf.Option.toObject(message.options[j], options); } + if (message.syntax != null && message.hasOwnProperty("syntax")) + object.syntax = options.enums === String ? $root.google.protobuf.Syntax[message.syntax] === undefined ? message.syntax : $root.google.protobuf.Syntax[message.syntax] : message.syntax; return object; }; /** - * Converts this FieldOptions to JSON. + * Converts this Method 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 + * @memberof google.protobuf.Method + * @instance + * @returns {Object.} JSON object */ - 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; - })(); + Method.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; - return FieldOptions; + /** + * Gets the default type url for Method + * @function getTypeUrl + * @memberof google.protobuf.Method + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Method.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.Method"; + }; + + return Method; })(); - protobuf.OneofOptions = (function() { + protobuf.Mixin = (function() { /** - * Properties of an OneofOptions. + * Properties of a Mixin. * @memberof google.protobuf - * @interface IOneofOptions - * @property {Array.|null} [uninterpretedOption] OneofOptions uninterpretedOption + * @interface IMixin + * @property {string|null} [name] Mixin name + * @property {string|null} [root] Mixin root */ /** - * Constructs a new OneofOptions. + * Constructs a new Mixin. * @memberof google.protobuf - * @classdesc Represents an OneofOptions. - * @implements IOneofOptions + * @classdesc Represents a Mixin. + * @implements IMixin * @constructor - * @param {google.protobuf.IOneofOptions=} [properties] Properties to set + * @param {google.protobuf.IMixin=} [properties] Properties to set */ - function OneofOptions(properties) { - this.uninterpretedOption = []; + function Mixin(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -10521,78 +11405,89 @@ } /** - * OneofOptions uninterpretedOption. - * @member {Array.} uninterpretedOption - * @memberof google.protobuf.OneofOptions + * Mixin name. + * @member {string} name + * @memberof google.protobuf.Mixin * @instance */ - OneofOptions.prototype.uninterpretedOption = $util.emptyArray; + Mixin.prototype.name = ""; /** - * Creates a new OneofOptions instance using the specified properties. + * Mixin root. + * @member {string} root + * @memberof google.protobuf.Mixin + * @instance + */ + Mixin.prototype.root = ""; + + /** + * Creates a new Mixin instance using the specified properties. * @function create - * @memberof google.protobuf.OneofOptions + * @memberof google.protobuf.Mixin * @static - * @param {google.protobuf.IOneofOptions=} [properties] Properties to set - * @returns {google.protobuf.OneofOptions} OneofOptions instance + * @param {google.protobuf.IMixin=} [properties] Properties to set + * @returns {google.protobuf.Mixin} Mixin instance */ - OneofOptions.create = function create(properties) { - return new OneofOptions(properties); + Mixin.create = function create(properties) { + return new Mixin(properties); }; /** - * Encodes the specified OneofOptions message. Does not implicitly {@link google.protobuf.OneofOptions.verify|verify} messages. + * Encodes the specified Mixin message. Does not implicitly {@link google.protobuf.Mixin.verify|verify} messages. * @function encode - * @memberof google.protobuf.OneofOptions + * @memberof google.protobuf.Mixin * @static - * @param {google.protobuf.IOneofOptions} message OneofOptions message or plain object to encode + * @param {google.protobuf.IMixin} message Mixin message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - OneofOptions.encode = function encode(message, writer) { + Mixin.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - 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.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.root != null && Object.hasOwnProperty.call(message, "root")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.root); return writer; }; /** - * Encodes the specified OneofOptions message, length delimited. Does not implicitly {@link google.protobuf.OneofOptions.verify|verify} messages. + * Encodes the specified Mixin message, length delimited. Does not implicitly {@link google.protobuf.Mixin.verify|verify} messages. * @function encodeDelimited - * @memberof google.protobuf.OneofOptions + * @memberof google.protobuf.Mixin * @static - * @param {google.protobuf.IOneofOptions} message OneofOptions message or plain object to encode + * @param {google.protobuf.IMixin} message Mixin message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - OneofOptions.encodeDelimited = function encodeDelimited(message, writer) { + Mixin.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes an OneofOptions message from the specified reader or buffer. + * Decodes a Mixin message from the specified reader or buffer. * @function decode - * @memberof google.protobuf.OneofOptions + * @memberof google.protobuf.Mixin * @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 + * @returns {google.protobuf.Mixin} Mixin * @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) { + Mixin.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.OneofOptions(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.Mixin(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 999: { - if (!(message.uninterpretedOption && message.uninterpretedOption.length)) - message.uninterpretedOption = []; - message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.root = reader.string(); break; } default: @@ -10604,143 +11499,131 @@ }; /** - * Decodes an OneofOptions message from the specified reader or buffer, length delimited. + * Decodes a Mixin message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.protobuf.OneofOptions + * @memberof google.protobuf.Mixin * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.OneofOptions} OneofOptions + * @returns {google.protobuf.Mixin} Mixin * @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) { + Mixin.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies an OneofOptions message. + * Verifies a Mixin message. * @function verify - * @memberof google.protobuf.OneofOptions + * @memberof google.protobuf.Mixin * @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) { + Mixin.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.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.root != null && message.hasOwnProperty("root")) + if (!$util.isString(message.root)) + return "root: string expected"; return null; }; /** - * Creates an OneofOptions message from a plain object. Also converts values to their respective internal types. + * Creates a Mixin message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.protobuf.OneofOptions + * @memberof google.protobuf.Mixin * @static * @param {Object.} object Plain object - * @returns {google.protobuf.OneofOptions} OneofOptions + * @returns {google.protobuf.Mixin} Mixin */ - OneofOptions.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.OneofOptions) + Mixin.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.Mixin) return object; - var message = new $root.google.protobuf.OneofOptions(); - 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]); - } - } + var message = new $root.google.protobuf.Mixin(); + if (object.name != null) + message.name = String(object.name); + if (object.root != null) + message.root = String(object.root); return message; }; /** - * Creates a plain object from an OneofOptions message. Also converts values to other types if specified. + * Creates a plain object from a Mixin message. Also converts values to other types if specified. * @function toObject - * @memberof google.protobuf.OneofOptions + * @memberof google.protobuf.Mixin * @static - * @param {google.protobuf.OneofOptions} message OneofOptions + * @param {google.protobuf.Mixin} message Mixin * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - OneofOptions.toObject = function toObject(message, options) { + Mixin.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.arrays || options.defaults) - object.uninterpretedOption = []; - 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 (options.defaults) { + object.name = ""; + object.root = ""; } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.root != null && message.hasOwnProperty("root")) + object.root = message.root; return object; }; /** - * Converts this OneofOptions to JSON. + * Converts this Mixin to JSON. * @function toJSON - * @memberof google.protobuf.OneofOptions + * @memberof google.protobuf.Mixin * @instance * @returns {Object.} JSON object */ - OneofOptions.prototype.toJSON = function toJSON() { + Mixin.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for OneofOptions + * Gets the default type url for Mixin * @function getTypeUrl - * @memberof google.protobuf.OneofOptions + * @memberof google.protobuf.Mixin * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - OneofOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + Mixin.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.protobuf.OneofOptions"; + return typeUrlPrefix + "/google.protobuf.Mixin"; }; - return OneofOptions; + return Mixin; })(); - protobuf.EnumOptions = (function() { + protobuf.SourceContext = (function() { /** - * Properties of an EnumOptions. + * Properties of a SourceContext. * @memberof google.protobuf - * @interface IEnumOptions - * @property {boolean|null} [allowAlias] EnumOptions allowAlias - * @property {boolean|null} [deprecated] EnumOptions deprecated - * @property {boolean|null} [deprecatedLegacyJsonFieldConflicts] EnumOptions deprecatedLegacyJsonFieldConflicts - * @property {Array.|null} [uninterpretedOption] EnumOptions uninterpretedOption + * @interface ISourceContext + * @property {string|null} [fileName] SourceContext fileName */ /** - * Constructs a new EnumOptions. + * Constructs a new SourceContext. * @memberof google.protobuf - * @classdesc Represents an EnumOptions. - * @implements IEnumOptions + * @classdesc Represents a SourceContext. + * @implements ISourceContext * @constructor - * @param {google.protobuf.IEnumOptions=} [properties] Properties to set + * @param {google.protobuf.ISourceContext=} [properties] Properties to set */ - function EnumOptions(properties) { - this.uninterpretedOption = []; + function SourceContext(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -10748,120 +11631,75 @@ } /** - * 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 uninterpretedOption. - * @member {Array.} uninterpretedOption - * @memberof google.protobuf.EnumOptions + * SourceContext fileName. + * @member {string} fileName + * @memberof google.protobuf.SourceContext * @instance */ - EnumOptions.prototype.uninterpretedOption = $util.emptyArray; + SourceContext.prototype.fileName = ""; /** - * Creates a new EnumOptions instance using the specified properties. + * Creates a new SourceContext instance using the specified properties. * @function create - * @memberof google.protobuf.EnumOptions + * @memberof google.protobuf.SourceContext * @static - * @param {google.protobuf.IEnumOptions=} [properties] Properties to set - * @returns {google.protobuf.EnumOptions} EnumOptions instance + * @param {google.protobuf.ISourceContext=} [properties] Properties to set + * @returns {google.protobuf.SourceContext} SourceContext instance */ - EnumOptions.create = function create(properties) { - return new EnumOptions(properties); + SourceContext.create = function create(properties) { + return new SourceContext(properties); }; /** - * Encodes the specified EnumOptions message. Does not implicitly {@link google.protobuf.EnumOptions.verify|verify} messages. + * Encodes the specified SourceContext message. Does not implicitly {@link google.protobuf.SourceContext.verify|verify} messages. * @function encode - * @memberof google.protobuf.EnumOptions + * @memberof google.protobuf.SourceContext * @static - * @param {google.protobuf.IEnumOptions} message EnumOptions message or plain object to encode + * @param {google.protobuf.ISourceContext} message SourceContext message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - EnumOptions.encode = function encode(message, writer) { + SourceContext.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.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.fileName != null && Object.hasOwnProperty.call(message, "fileName")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.fileName); return writer; }; /** - * Encodes the specified EnumOptions message, length delimited. Does not implicitly {@link google.protobuf.EnumOptions.verify|verify} messages. + * Encodes the specified SourceContext message, length delimited. Does not implicitly {@link google.protobuf.SourceContext.verify|verify} messages. * @function encodeDelimited - * @memberof google.protobuf.EnumOptions + * @memberof google.protobuf.SourceContext * @static - * @param {google.protobuf.IEnumOptions} message EnumOptions message or plain object to encode + * @param {google.protobuf.ISourceContext} message SourceContext message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - EnumOptions.encodeDelimited = function encodeDelimited(message, writer) { + SourceContext.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes an EnumOptions message from the specified reader or buffer. + * Decodes a SourceContext message from the specified reader or buffer. * @function decode - * @memberof google.protobuf.EnumOptions + * @memberof google.protobuf.SourceContext * @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 + * @returns {google.protobuf.SourceContext} SourceContext * @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) { + SourceContext.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.EnumOptions(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.SourceContext(); while (reader.pos < end) { var tag = reader.uint32(); 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 999: { - if (!(message.uninterpretedOption && message.uninterpretedOption.length)) - message.uninterpretedOption = []; - message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); + case 1: { + message.fileName = reader.string(); break; } default: @@ -10873,167 +11711,130 @@ }; /** - * Decodes an EnumOptions message from the specified reader or buffer, length delimited. + * Decodes a SourceContext message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.protobuf.EnumOptions + * @memberof google.protobuf.SourceContext * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.EnumOptions} EnumOptions + * @returns {google.protobuf.SourceContext} SourceContext * @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) { + SourceContext.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies an EnumOptions message. + * Verifies a SourceContext message. * @function verify - * @memberof google.protobuf.EnumOptions + * @memberof google.protobuf.SourceContext * @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) { + SourceContext.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.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.fileName != null && message.hasOwnProperty("fileName")) + if (!$util.isString(message.fileName)) + return "fileName: string expected"; return null; }; /** - * Creates an EnumOptions message from a plain object. Also converts values to their respective internal types. + * Creates a SourceContext message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.protobuf.EnumOptions + * @memberof google.protobuf.SourceContext * @static * @param {Object.} object Plain object - * @returns {google.protobuf.EnumOptions} EnumOptions + * @returns {google.protobuf.SourceContext} SourceContext */ - EnumOptions.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.EnumOptions) + SourceContext.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.SourceContext) 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.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]); - } - } + var message = new $root.google.protobuf.SourceContext(); + if (object.fileName != null) + message.fileName = String(object.fileName); return message; }; /** - * Creates a plain object from an EnumOptions message. Also converts values to other types if specified. + * Creates a plain object from a SourceContext message. Also converts values to other types if specified. * @function toObject - * @memberof google.protobuf.EnumOptions + * @memberof google.protobuf.SourceContext * @static - * @param {google.protobuf.EnumOptions} message EnumOptions + * @param {google.protobuf.SourceContext} message SourceContext * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - EnumOptions.toObject = function toObject(message, options) { + SourceContext.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; - } - 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.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 (options.defaults) + object.fileName = ""; + if (message.fileName != null && message.hasOwnProperty("fileName")) + object.fileName = message.fileName; return object; }; /** - * Converts this EnumOptions to JSON. + * Converts this SourceContext to JSON. * @function toJSON - * @memberof google.protobuf.EnumOptions + * @memberof google.protobuf.SourceContext * @instance * @returns {Object.} JSON object */ - EnumOptions.prototype.toJSON = function toJSON() { + SourceContext.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for EnumOptions + * Gets the default type url for SourceContext * @function getTypeUrl - * @memberof google.protobuf.EnumOptions + * @memberof google.protobuf.SourceContext * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - EnumOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + SourceContext.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.protobuf.EnumOptions"; + return typeUrlPrefix + "/google.protobuf.SourceContext"; }; - return EnumOptions; + return SourceContext; })(); - protobuf.EnumValueOptions = (function() { + protobuf.Type = (function() { /** - * Properties of an EnumValueOptions. + * Properties of a Type. * @memberof google.protobuf - * @interface IEnumValueOptions - * @property {boolean|null} [deprecated] EnumValueOptions deprecated - * @property {Array.|null} [uninterpretedOption] EnumValueOptions uninterpretedOption + * @interface IType + * @property {string|null} [name] Type name + * @property {Array.|null} [fields] Type fields + * @property {Array.|null} [oneofs] Type oneofs + * @property {Array.|null} [options] Type options + * @property {google.protobuf.ISourceContext|null} [sourceContext] Type sourceContext + * @property {google.protobuf.Syntax|null} [syntax] Type syntax */ /** - * Constructs a new EnumValueOptions. + * Constructs a new Type. * @memberof google.protobuf - * @classdesc Represents an EnumValueOptions. - * @implements IEnumValueOptions + * @classdesc Represents a Type. + * @implements IType * @constructor - * @param {google.protobuf.IEnumValueOptions=} [properties] Properties to set + * @param {google.protobuf.IType=} [properties] Properties to set */ - function EnumValueOptions(properties) { - this.uninterpretedOption = []; + function Type(properties) { + this.fields = []; + this.oneofs = []; + this.options = []; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -11041,92 +11842,154 @@ } /** - * EnumValueOptions deprecated. - * @member {boolean} deprecated - * @memberof google.protobuf.EnumValueOptions + * Type name. + * @member {string} name + * @memberof google.protobuf.Type + * @instance + */ + Type.prototype.name = ""; + + /** + * Type fields. + * @member {Array.} fields + * @memberof google.protobuf.Type + * @instance + */ + Type.prototype.fields = $util.emptyArray; + + /** + * Type oneofs. + * @member {Array.} oneofs + * @memberof google.protobuf.Type + * @instance + */ + Type.prototype.oneofs = $util.emptyArray; + + /** + * Type options. + * @member {Array.} options + * @memberof google.protobuf.Type + * @instance + */ + Type.prototype.options = $util.emptyArray; + + /** + * Type sourceContext. + * @member {google.protobuf.ISourceContext|null|undefined} sourceContext + * @memberof google.protobuf.Type * @instance */ - EnumValueOptions.prototype.deprecated = false; + Type.prototype.sourceContext = null; /** - * EnumValueOptions uninterpretedOption. - * @member {Array.} uninterpretedOption - * @memberof google.protobuf.EnumValueOptions + * Type syntax. + * @member {google.protobuf.Syntax} syntax + * @memberof google.protobuf.Type * @instance */ - EnumValueOptions.prototype.uninterpretedOption = $util.emptyArray; + Type.prototype.syntax = 0; /** - * Creates a new EnumValueOptions instance using the specified properties. + * Creates a new Type instance using the specified properties. * @function create - * @memberof google.protobuf.EnumValueOptions + * @memberof google.protobuf.Type * @static - * @param {google.protobuf.IEnumValueOptions=} [properties] Properties to set - * @returns {google.protobuf.EnumValueOptions} EnumValueOptions instance + * @param {google.protobuf.IType=} [properties] Properties to set + * @returns {google.protobuf.Type} Type instance */ - EnumValueOptions.create = function create(properties) { - return new EnumValueOptions(properties); + Type.create = function create(properties) { + return new Type(properties); }; /** - * Encodes the specified EnumValueOptions message. Does not implicitly {@link google.protobuf.EnumValueOptions.verify|verify} messages. + * Encodes the specified Type message. Does not implicitly {@link google.protobuf.Type.verify|verify} messages. * @function encode - * @memberof google.protobuf.EnumValueOptions + * @memberof google.protobuf.Type * @static - * @param {google.protobuf.IEnumValueOptions} message EnumValueOptions message or plain object to encode + * @param {google.protobuf.IType} message Type message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - EnumValueOptions.encode = function encode(message, writer) { + Type.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.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.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.fields != null && message.fields.length) + for (var i = 0; i < message.fields.length; ++i) + $root.google.protobuf.Field.encode(message.fields[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.oneofs != null && message.oneofs.length) + for (var i = 0; i < message.oneofs.length; ++i) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.oneofs[i]); + if (message.options != null && message.options.length) + for (var i = 0; i < message.options.length; ++i) + $root.google.protobuf.Option.encode(message.options[i], writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.sourceContext != null && Object.hasOwnProperty.call(message, "sourceContext")) + $root.google.protobuf.SourceContext.encode(message.sourceContext, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.syntax != null && Object.hasOwnProperty.call(message, "syntax")) + writer.uint32(/* id 6, wireType 0 =*/48).int32(message.syntax); return writer; }; /** - * Encodes the specified EnumValueOptions message, length delimited. Does not implicitly {@link google.protobuf.EnumValueOptions.verify|verify} messages. + * Encodes the specified Type message, length delimited. Does not implicitly {@link google.protobuf.Type.verify|verify} messages. * @function encodeDelimited - * @memberof google.protobuf.EnumValueOptions + * @memberof google.protobuf.Type * @static - * @param {google.protobuf.IEnumValueOptions} message EnumValueOptions message or plain object to encode + * @param {google.protobuf.IType} message Type message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - EnumValueOptions.encodeDelimited = function encodeDelimited(message, writer) { + Type.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes an EnumValueOptions message from the specified reader or buffer. + * Decodes a Type message from the specified reader or buffer. * @function decode - * @memberof google.protobuf.EnumValueOptions + * @memberof google.protobuf.Type * @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 + * @returns {google.protobuf.Type} Type * @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) { + Type.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.EnumValueOptions(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.Type(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: { - message.deprecated = reader.bool(); + message.name = reader.string(); break; } - case 999: { - if (!(message.uninterpretedOption && message.uninterpretedOption.length)) - message.uninterpretedOption = []; - message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); + case 2: { + if (!(message.fields && message.fields.length)) + message.fields = []; + message.fields.push($root.google.protobuf.Field.decode(reader, reader.uint32())); + break; + } + case 3: { + if (!(message.oneofs && message.oneofs.length)) + message.oneofs = []; + message.oneofs.push(reader.string()); + break; + } + case 4: { + if (!(message.options && message.options.length)) + message.options = []; + message.options.push($root.google.protobuf.Option.decode(reader, reader.uint32())); + break; + } + case 5: { + message.sourceContext = $root.google.protobuf.SourceContext.decode(reader, reader.uint32()); + break; + } + case 6: { + message.syntax = reader.int32(); break; } default: @@ -11138,152 +12001,245 @@ }; /** - * Decodes an EnumValueOptions message from the specified reader or buffer, length delimited. + * Decodes a Type message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.protobuf.EnumValueOptions + * @memberof google.protobuf.Type * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.EnumValueOptions} EnumValueOptions + * @returns {google.protobuf.Type} Type * @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) { + Type.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies an EnumValueOptions message. + * Verifies a Type message. * @function verify - * @memberof google.protobuf.EnumValueOptions + * @memberof google.protobuf.Type * @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) { + Type.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.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 (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.fields != null && message.hasOwnProperty("fields")) { + if (!Array.isArray(message.fields)) + return "fields: array expected"; + for (var i = 0; i < message.fields.length; ++i) { + var error = $root.google.protobuf.Field.verify(message.fields[i]); if (error) - return "uninterpretedOption." + error; + return "fields." + error; + } + } + if (message.oneofs != null && message.hasOwnProperty("oneofs")) { + if (!Array.isArray(message.oneofs)) + return "oneofs: array expected"; + for (var i = 0; i < message.oneofs.length; ++i) + if (!$util.isString(message.oneofs[i])) + return "oneofs: string[] expected"; + } + if (message.options != null && message.hasOwnProperty("options")) { + if (!Array.isArray(message.options)) + return "options: array expected"; + for (var i = 0; i < message.options.length; ++i) { + var error = $root.google.protobuf.Option.verify(message.options[i]); + if (error) + return "options." + error; } } + if (message.sourceContext != null && message.hasOwnProperty("sourceContext")) { + var error = $root.google.protobuf.SourceContext.verify(message.sourceContext); + if (error) + return "sourceContext." + error; + } + if (message.syntax != null && message.hasOwnProperty("syntax")) + switch (message.syntax) { + default: + return "syntax: enum value expected"; + case 0: + case 1: + break; + } return null; }; /** - * Creates an EnumValueOptions message from a plain object. Also converts values to their respective internal types. + * Creates a Type message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.protobuf.EnumValueOptions + * @memberof google.protobuf.Type * @static * @param {Object.} object Plain object - * @returns {google.protobuf.EnumValueOptions} EnumValueOptions + * @returns {google.protobuf.Type} Type */ - EnumValueOptions.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.EnumValueOptions) + Type.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.Type) return object; - var message = new $root.google.protobuf.EnumValueOptions(); - if (object.deprecated != null) - message.deprecated = Boolean(object.deprecated); - 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]); + var message = new $root.google.protobuf.Type(); + if (object.name != null) + message.name = String(object.name); + if (object.fields) { + if (!Array.isArray(object.fields)) + throw TypeError(".google.protobuf.Type.fields: array expected"); + message.fields = []; + for (var i = 0; i < object.fields.length; ++i) { + if (typeof object.fields[i] !== "object") + throw TypeError(".google.protobuf.Type.fields: object expected"); + message.fields[i] = $root.google.protobuf.Field.fromObject(object.fields[i]); + } + } + if (object.oneofs) { + if (!Array.isArray(object.oneofs)) + throw TypeError(".google.protobuf.Type.oneofs: array expected"); + message.oneofs = []; + for (var i = 0; i < object.oneofs.length; ++i) + message.oneofs[i] = String(object.oneofs[i]); + } + if (object.options) { + if (!Array.isArray(object.options)) + throw TypeError(".google.protobuf.Type.options: array expected"); + message.options = []; + for (var i = 0; i < object.options.length; ++i) { + if (typeof object.options[i] !== "object") + throw TypeError(".google.protobuf.Type.options: object expected"); + message.options[i] = $root.google.protobuf.Option.fromObject(object.options[i]); + } + } + if (object.sourceContext != null) { + if (typeof object.sourceContext !== "object") + throw TypeError(".google.protobuf.Type.sourceContext: object expected"); + message.sourceContext = $root.google.protobuf.SourceContext.fromObject(object.sourceContext); + } + switch (object.syntax) { + default: + if (typeof object.syntax === "number") { + message.syntax = object.syntax; + break; } + break; + case "SYNTAX_PROTO2": + case 0: + message.syntax = 0; + break; + case "SYNTAX_PROTO3": + case 1: + message.syntax = 1; + break; } return message; }; /** - * Creates a plain object from an EnumValueOptions message. Also converts values to other types if specified. + * Creates a plain object from a Type message. Also converts values to other types if specified. * @function toObject - * @memberof google.protobuf.EnumValueOptions + * @memberof google.protobuf.Type * @static - * @param {google.protobuf.EnumValueOptions} message EnumValueOptions + * @param {google.protobuf.Type} message Type * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - EnumValueOptions.toObject = function toObject(message, options) { + Type.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.arrays || options.defaults) - object.uninterpretedOption = []; - if (options.defaults) - object.deprecated = false; - if (message.deprecated != null && message.hasOwnProperty("deprecated")) - object.deprecated = message.deprecated; - 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 (options.arrays || options.defaults) { + object.fields = []; + object.oneofs = []; + object.options = []; + } + if (options.defaults) { + object.name = ""; + object.sourceContext = null; + object.syntax = options.enums === String ? "SYNTAX_PROTO2" : 0; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.fields && message.fields.length) { + object.fields = []; + for (var j = 0; j < message.fields.length; ++j) + object.fields[j] = $root.google.protobuf.Field.toObject(message.fields[j], options); + } + if (message.oneofs && message.oneofs.length) { + object.oneofs = []; + for (var j = 0; j < message.oneofs.length; ++j) + object.oneofs[j] = message.oneofs[j]; + } + if (message.options && message.options.length) { + object.options = []; + for (var j = 0; j < message.options.length; ++j) + object.options[j] = $root.google.protobuf.Option.toObject(message.options[j], options); } + if (message.sourceContext != null && message.hasOwnProperty("sourceContext")) + object.sourceContext = $root.google.protobuf.SourceContext.toObject(message.sourceContext, options); + if (message.syntax != null && message.hasOwnProperty("syntax")) + object.syntax = options.enums === String ? $root.google.protobuf.Syntax[message.syntax] === undefined ? message.syntax : $root.google.protobuf.Syntax[message.syntax] : message.syntax; return object; }; /** - * Converts this EnumValueOptions to JSON. + * Converts this Type to JSON. * @function toJSON - * @memberof google.protobuf.EnumValueOptions + * @memberof google.protobuf.Type * @instance * @returns {Object.} JSON object */ - EnumValueOptions.prototype.toJSON = function toJSON() { + Type.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for EnumValueOptions + * Gets the default type url for Type * @function getTypeUrl - * @memberof google.protobuf.EnumValueOptions + * @memberof google.protobuf.Type * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - EnumValueOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + Type.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.protobuf.EnumValueOptions"; + return typeUrlPrefix + "/google.protobuf.Type"; }; - return EnumValueOptions; + return Type; })(); - protobuf.ServiceOptions = (function() { + protobuf.Field = (function() { /** - * Properties of a ServiceOptions. + * Properties of a Field. * @memberof google.protobuf - * @interface IServiceOptions - * @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 + * @interface IField + * @property {google.protobuf.Field.Kind|null} [kind] Field kind + * @property {google.protobuf.Field.Cardinality|null} [cardinality] Field cardinality + * @property {number|null} [number] Field number + * @property {string|null} [name] Field name + * @property {string|null} [typeUrl] Field typeUrl + * @property {number|null} [oneofIndex] Field oneofIndex + * @property {boolean|null} [packed] Field packed + * @property {Array.|null} [options] Field options + * @property {string|null} [jsonName] Field jsonName + * @property {string|null} [defaultValue] Field defaultValue */ /** - * Constructs a new ServiceOptions. + * Constructs a new Field. * @memberof google.protobuf - * @classdesc Represents a ServiceOptions. - * @implements IServiceOptions + * @classdesc Represents a Field. + * @implements IField * @constructor - * @param {google.protobuf.IServiceOptions=} [properties] Properties to set + * @param {google.protobuf.IField=} [properties] Properties to set */ - function ServiceOptions(properties) { - this.uninterpretedOption = []; + function Field(properties) { + this.options = []; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -11291,120 +12247,204 @@ } /** - * ServiceOptions deprecated. - * @member {boolean} deprecated - * @memberof google.protobuf.ServiceOptions + * Field kind. + * @member {google.protobuf.Field.Kind} kind + * @memberof google.protobuf.Field * @instance */ - ServiceOptions.prototype.deprecated = false; + Field.prototype.kind = 0; /** - * ServiceOptions uninterpretedOption. - * @member {Array.} uninterpretedOption - * @memberof google.protobuf.ServiceOptions + * Field cardinality. + * @member {google.protobuf.Field.Cardinality} cardinality + * @memberof google.protobuf.Field * @instance */ - ServiceOptions.prototype.uninterpretedOption = $util.emptyArray; + Field.prototype.cardinality = 0; /** - * ServiceOptions .google.api.defaultHost. - * @member {string} .google.api.defaultHost - * @memberof google.protobuf.ServiceOptions + * Field number. + * @member {number} number + * @memberof google.protobuf.Field * @instance */ - ServiceOptions.prototype[".google.api.defaultHost"] = ""; + Field.prototype.number = 0; /** - * ServiceOptions .google.api.oauthScopes. - * @member {string} .google.api.oauthScopes - * @memberof google.protobuf.ServiceOptions + * Field name. + * @member {string} name + * @memberof google.protobuf.Field * @instance */ - ServiceOptions.prototype[".google.api.oauthScopes"] = ""; + Field.prototype.name = ""; /** - * Creates a new ServiceOptions instance using the specified properties. + * Field typeUrl. + * @member {string} typeUrl + * @memberof google.protobuf.Field + * @instance + */ + Field.prototype.typeUrl = ""; + + /** + * Field oneofIndex. + * @member {number} oneofIndex + * @memberof google.protobuf.Field + * @instance + */ + Field.prototype.oneofIndex = 0; + + /** + * Field packed. + * @member {boolean} packed + * @memberof google.protobuf.Field + * @instance + */ + Field.prototype.packed = false; + + /** + * Field options. + * @member {Array.} options + * @memberof google.protobuf.Field + * @instance + */ + Field.prototype.options = $util.emptyArray; + + /** + * Field jsonName. + * @member {string} jsonName + * @memberof google.protobuf.Field + * @instance + */ + Field.prototype.jsonName = ""; + + /** + * Field defaultValue. + * @member {string} defaultValue + * @memberof google.protobuf.Field + * @instance + */ + Field.prototype.defaultValue = ""; + + /** + * Creates a new Field instance using the specified properties. * @function create - * @memberof google.protobuf.ServiceOptions + * @memberof google.protobuf.Field * @static - * @param {google.protobuf.IServiceOptions=} [properties] Properties to set - * @returns {google.protobuf.ServiceOptions} ServiceOptions instance + * @param {google.protobuf.IField=} [properties] Properties to set + * @returns {google.protobuf.Field} Field instance */ - ServiceOptions.create = function create(properties) { - return new ServiceOptions(properties); + Field.create = function create(properties) { + return new Field(properties); }; /** - * Encodes the specified ServiceOptions message. Does not implicitly {@link google.protobuf.ServiceOptions.verify|verify} messages. + * Encodes the specified Field message. Does not implicitly {@link google.protobuf.Field.verify|verify} messages. * @function encode - * @memberof google.protobuf.ServiceOptions + * @memberof google.protobuf.Field * @static - * @param {google.protobuf.IServiceOptions} message ServiceOptions message or plain object to encode + * @param {google.protobuf.IField} message Field message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ServiceOptions.encode = function encode(message, writer) { + Field.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.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.kind != null && Object.hasOwnProperty.call(message, "kind")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.kind); + if (message.cardinality != null && Object.hasOwnProperty.call(message, "cardinality")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.cardinality); + if (message.number != null && Object.hasOwnProperty.call(message, "number")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.number); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.name); + if (message.typeUrl != null && Object.hasOwnProperty.call(message, "typeUrl")) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.typeUrl); + if (message.oneofIndex != null && Object.hasOwnProperty.call(message, "oneofIndex")) + writer.uint32(/* id 7, wireType 0 =*/56).int32(message.oneofIndex); + if (message.packed != null && Object.hasOwnProperty.call(message, "packed")) + writer.uint32(/* id 8, wireType 0 =*/64).bool(message.packed); + if (message.options != null && message.options.length) + for (var i = 0; i < message.options.length; ++i) + $root.google.protobuf.Option.encode(message.options[i], writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim(); + if (message.jsonName != null && Object.hasOwnProperty.call(message, "jsonName")) + writer.uint32(/* id 10, wireType 2 =*/82).string(message.jsonName); + if (message.defaultValue != null && Object.hasOwnProperty.call(message, "defaultValue")) + writer.uint32(/* id 11, wireType 2 =*/90).string(message.defaultValue); return writer; }; /** - * Encodes the specified ServiceOptions message, length delimited. Does not implicitly {@link google.protobuf.ServiceOptions.verify|verify} messages. + * Encodes the specified Field message, length delimited. Does not implicitly {@link google.protobuf.Field.verify|verify} messages. * @function encodeDelimited - * @memberof google.protobuf.ServiceOptions + * @memberof google.protobuf.Field * @static - * @param {google.protobuf.IServiceOptions} message ServiceOptions message or plain object to encode + * @param {google.protobuf.IField} message Field message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ServiceOptions.encodeDelimited = function encodeDelimited(message, writer) { + Field.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a ServiceOptions message from the specified reader or buffer. + * Decodes a Field message from the specified reader or buffer. * @function decode - * @memberof google.protobuf.ServiceOptions + * @memberof google.protobuf.Field * @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 + * @returns {google.protobuf.Field} Field * @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) { + Field.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.ServiceOptions(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.Field(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 33: { - message.deprecated = reader.bool(); + case 1: { + message.kind = reader.int32(); break; } - case 999: { - if (!(message.uninterpretedOption && message.uninterpretedOption.length)) - message.uninterpretedOption = []; - message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); + case 2: { + message.cardinality = reader.int32(); + break; + } + case 3: { + message.number = reader.int32(); + break; + } + case 4: { + message.name = reader.string(); + break; + } + case 6: { + message.typeUrl = reader.string(); + break; + } + case 7: { + message.oneofIndex = reader.int32(); + break; + } + case 8: { + message.packed = reader.bool(); + break; + } + case 9: { + if (!(message.options && message.options.length)) + message.options = []; + message.options.push($root.google.protobuf.Option.decode(reader, reader.uint32())); break; } - case 1049: { - message[".google.api.defaultHost"] = reader.string(); + case 10: { + message.jsonName = reader.string(); break; } - case 1050: { - message[".google.api.oauthScopes"] = reader.string(); + case 11: { + message.defaultValue = reader.string(); break; } default: @@ -11416,172 +12456,418 @@ }; /** - * Decodes a ServiceOptions message from the specified reader or buffer, length delimited. + * Decodes a Field message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.protobuf.ServiceOptions + * @memberof google.protobuf.Field * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.ServiceOptions} ServiceOptions + * @returns {google.protobuf.Field} Field * @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) { + Field.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a ServiceOptions message. + * Verifies a Field message. * @function verify - * @memberof google.protobuf.ServiceOptions + * @memberof google.protobuf.Field * @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) { + Field.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.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 (message.kind != null && message.hasOwnProperty("kind")) + switch (message.kind) { + default: + return "kind: 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: + case 13: + case 14: + case 15: + case 16: + case 17: + case 18: + break; + } + if (message.cardinality != null && message.hasOwnProperty("cardinality")) + switch (message.cardinality) { + default: + return "cardinality: enum value expected"; + case 0: + case 1: + case 2: + case 3: + break; + } + if (message.number != null && message.hasOwnProperty("number")) + if (!$util.isInteger(message.number)) + return "number: integer expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.typeUrl != null && message.hasOwnProperty("typeUrl")) + if (!$util.isString(message.typeUrl)) + return "typeUrl: string expected"; + if (message.oneofIndex != null && message.hasOwnProperty("oneofIndex")) + if (!$util.isInteger(message.oneofIndex)) + return "oneofIndex: integer expected"; + if (message.packed != null && message.hasOwnProperty("packed")) + if (typeof message.packed !== "boolean") + return "packed: boolean expected"; + if (message.options != null && message.hasOwnProperty("options")) { + if (!Array.isArray(message.options)) + return "options: array expected"; + for (var i = 0; i < message.options.length; ++i) { + var error = $root.google.protobuf.Option.verify(message.options[i]); if (error) - return "uninterpretedOption." + error; + return "options." + 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.jsonName != null && message.hasOwnProperty("jsonName")) + if (!$util.isString(message.jsonName)) + return "jsonName: string expected"; + if (message.defaultValue != null && message.hasOwnProperty("defaultValue")) + if (!$util.isString(message.defaultValue)) + return "defaultValue: string expected"; return null; }; /** - * Creates a ServiceOptions message from a plain object. Also converts values to their respective internal types. + * Creates a Field message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.protobuf.ServiceOptions + * @memberof google.protobuf.Field * @static * @param {Object.} object Plain object - * @returns {google.protobuf.ServiceOptions} ServiceOptions + * @returns {google.protobuf.Field} Field */ - ServiceOptions.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.ServiceOptions) + Field.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.Field) return object; - var message = new $root.google.protobuf.ServiceOptions(); - 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]); + var message = new $root.google.protobuf.Field(); + switch (object.kind) { + default: + if (typeof object.kind === "number") { + message.kind = object.kind; + break; + } + break; + case "TYPE_UNKNOWN": + case 0: + message.kind = 0; + break; + case "TYPE_DOUBLE": + case 1: + message.kind = 1; + break; + case "TYPE_FLOAT": + case 2: + message.kind = 2; + break; + case "TYPE_INT64": + case 3: + message.kind = 3; + break; + case "TYPE_UINT64": + case 4: + message.kind = 4; + break; + case "TYPE_INT32": + case 5: + message.kind = 5; + break; + case "TYPE_FIXED64": + case 6: + message.kind = 6; + break; + case "TYPE_FIXED32": + case 7: + message.kind = 7; + break; + case "TYPE_BOOL": + case 8: + message.kind = 8; + break; + case "TYPE_STRING": + case 9: + message.kind = 9; + break; + case "TYPE_GROUP": + case 10: + message.kind = 10; + break; + case "TYPE_MESSAGE": + case 11: + message.kind = 11; + break; + case "TYPE_BYTES": + case 12: + message.kind = 12; + break; + case "TYPE_UINT32": + case 13: + message.kind = 13; + break; + case "TYPE_ENUM": + case 14: + message.kind = 14; + break; + case "TYPE_SFIXED32": + case 15: + message.kind = 15; + break; + case "TYPE_SFIXED64": + case 16: + message.kind = 16; + break; + case "TYPE_SINT32": + case 17: + message.kind = 17; + break; + case "TYPE_SINT64": + case 18: + message.kind = 18; + break; + } + switch (object.cardinality) { + default: + if (typeof object.cardinality === "number") { + message.cardinality = object.cardinality; + break; + } + break; + case "CARDINALITY_UNKNOWN": + case 0: + message.cardinality = 0; + break; + case "CARDINALITY_OPTIONAL": + case 1: + message.cardinality = 1; + break; + case "CARDINALITY_REQUIRED": + case 2: + message.cardinality = 2; + break; + case "CARDINALITY_REPEATED": + case 3: + message.cardinality = 3; + break; + } + if (object.number != null) + message.number = object.number | 0; + if (object.name != null) + message.name = String(object.name); + if (object.typeUrl != null) + message.typeUrl = String(object.typeUrl); + if (object.oneofIndex != null) + message.oneofIndex = object.oneofIndex | 0; + if (object.packed != null) + message.packed = Boolean(object.packed); + if (object.options) { + if (!Array.isArray(object.options)) + throw TypeError(".google.protobuf.Field.options: array expected"); + message.options = []; + for (var i = 0; i < object.options.length; ++i) { + if (typeof object.options[i] !== "object") + throw TypeError(".google.protobuf.Field.options: object expected"); + message.options[i] = $root.google.protobuf.Option.fromObject(object.options[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.jsonName != null) + message.jsonName = String(object.jsonName); + if (object.defaultValue != null) + message.defaultValue = String(object.defaultValue); return message; }; /** - * Creates a plain object from a ServiceOptions message. Also converts values to other types if specified. + * Creates a plain object from a Field message. Also converts values to other types if specified. * @function toObject - * @memberof google.protobuf.ServiceOptions + * @memberof google.protobuf.Field * @static - * @param {google.protobuf.ServiceOptions} message ServiceOptions + * @param {google.protobuf.Field} message Field * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - ServiceOptions.toObject = function toObject(message, options) { + Field.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; if (options.arrays || options.defaults) - object.uninterpretedOption = []; + object.options = []; if (options.defaults) { - object.deprecated = false; - object[".google.api.defaultHost"] = ""; - object[".google.api.oauthScopes"] = ""; + object.kind = options.enums === String ? "TYPE_UNKNOWN" : 0; + object.cardinality = options.enums === String ? "CARDINALITY_UNKNOWN" : 0; + object.number = 0; + object.name = ""; + object.typeUrl = ""; + object.oneofIndex = 0; + object.packed = false; + object.jsonName = ""; + object.defaultValue = ""; } - if (message.deprecated != null && message.hasOwnProperty("deprecated")) - object.deprecated = message.deprecated; - 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.kind != null && message.hasOwnProperty("kind")) + object.kind = options.enums === String ? $root.google.protobuf.Field.Kind[message.kind] === undefined ? message.kind : $root.google.protobuf.Field.Kind[message.kind] : message.kind; + if (message.cardinality != null && message.hasOwnProperty("cardinality")) + object.cardinality = options.enums === String ? $root.google.protobuf.Field.Cardinality[message.cardinality] === undefined ? message.cardinality : $root.google.protobuf.Field.Cardinality[message.cardinality] : message.cardinality; + if (message.number != null && message.hasOwnProperty("number")) + object.number = message.number; + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.typeUrl != null && message.hasOwnProperty("typeUrl")) + object.typeUrl = message.typeUrl; + if (message.oneofIndex != null && message.hasOwnProperty("oneofIndex")) + object.oneofIndex = message.oneofIndex; + if (message.packed != null && message.hasOwnProperty("packed")) + object.packed = message.packed; + if (message.options && message.options.length) { + object.options = []; + for (var j = 0; j < message.options.length; ++j) + object.options[j] = $root.google.protobuf.Option.toObject(message.options[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.jsonName != null && message.hasOwnProperty("jsonName")) + object.jsonName = message.jsonName; + if (message.defaultValue != null && message.hasOwnProperty("defaultValue")) + object.defaultValue = message.defaultValue; return object; }; /** - * Converts this ServiceOptions to JSON. + * Converts this Field to JSON. * @function toJSON - * @memberof google.protobuf.ServiceOptions + * @memberof google.protobuf.Field * @instance * @returns {Object.} JSON object */ - ServiceOptions.prototype.toJSON = function toJSON() { + Field.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for ServiceOptions + * Gets the default type url for Field * @function getTypeUrl - * @memberof google.protobuf.ServiceOptions + * @memberof google.protobuf.Field * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - ServiceOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + Field.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.protobuf.ServiceOptions"; + return typeUrlPrefix + "/google.protobuf.Field"; }; - return ServiceOptions; + /** + * Kind enum. + * @name google.protobuf.Field.Kind + * @enum {number} + * @property {number} TYPE_UNKNOWN=0 TYPE_UNKNOWN value + * @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 + */ + Field.Kind = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "TYPE_UNKNOWN"] = 0; + 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; + })(); + + /** + * Cardinality enum. + * @name google.protobuf.Field.Cardinality + * @enum {number} + * @property {number} CARDINALITY_UNKNOWN=0 CARDINALITY_UNKNOWN value + * @property {number} CARDINALITY_OPTIONAL=1 CARDINALITY_OPTIONAL value + * @property {number} CARDINALITY_REQUIRED=2 CARDINALITY_REQUIRED value + * @property {number} CARDINALITY_REPEATED=3 CARDINALITY_REPEATED value + */ + Field.Cardinality = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "CARDINALITY_UNKNOWN"] = 0; + values[valuesById[1] = "CARDINALITY_OPTIONAL"] = 1; + values[valuesById[2] = "CARDINALITY_REQUIRED"] = 2; + values[valuesById[3] = "CARDINALITY_REPEATED"] = 3; + return values; + })(); + + return Field; })(); - protobuf.MethodOptions = (function() { + protobuf.Enum = (function() { /** - * Properties of a MethodOptions. + * Properties of an Enum. * @memberof google.protobuf - * @interface IMethodOptions - * @property {boolean|null} [deprecated] MethodOptions deprecated - * @property {google.protobuf.MethodOptions.IdempotencyLevel|null} [idempotencyLevel] MethodOptions idempotencyLevel - * @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 + * @interface IEnum + * @property {string|null} [name] Enum name + * @property {Array.|null} [enumvalue] Enum enumvalue + * @property {Array.|null} [options] Enum options + * @property {google.protobuf.ISourceContext|null} [sourceContext] Enum sourceContext + * @property {google.protobuf.Syntax|null} [syntax] Enum syntax */ /** - * Constructs a new MethodOptions. + * Constructs a new Enum. * @memberof google.protobuf - * @classdesc Represents a MethodOptions. - * @implements IMethodOptions + * @classdesc Represents an Enum. + * @implements IEnum * @constructor - * @param {google.protobuf.IMethodOptions=} [properties] Properties to set + * @param {google.protobuf.IEnum=} [properties] Properties to set */ - function MethodOptions(properties) { - this.uninterpretedOption = []; - this[".google.api.methodSignature"] = []; + function Enum(properties) { + this.enumvalue = []; + this.options = []; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -11589,151 +12875,137 @@ } /** - * 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 + * Enum name. + * @member {string} name + * @memberof google.protobuf.Enum * @instance */ - MethodOptions.prototype.idempotencyLevel = 0; + Enum.prototype.name = ""; /** - * MethodOptions uninterpretedOption. - * @member {Array.} uninterpretedOption - * @memberof google.protobuf.MethodOptions + * Enum enumvalue. + * @member {Array.} enumvalue + * @memberof google.protobuf.Enum * @instance */ - MethodOptions.prototype.uninterpretedOption = $util.emptyArray; + Enum.prototype.enumvalue = $util.emptyArray; /** - * MethodOptions .google.api.http. - * @member {google.api.IHttpRule|null|undefined} .google.api.http - * @memberof google.protobuf.MethodOptions + * Enum options. + * @member {Array.} options + * @memberof google.protobuf.Enum * @instance */ - MethodOptions.prototype[".google.api.http"] = null; + Enum.prototype.options = $util.emptyArray; /** - * MethodOptions .google.api.methodSignature. - * @member {Array.} .google.api.methodSignature - * @memberof google.protobuf.MethodOptions + * Enum sourceContext. + * @member {google.protobuf.ISourceContext|null|undefined} sourceContext + * @memberof google.protobuf.Enum * @instance */ - MethodOptions.prototype[".google.api.methodSignature"] = $util.emptyArray; + Enum.prototype.sourceContext = null; /** - * MethodOptions .google.longrunning.operationInfo. - * @member {google.longrunning.IOperationInfo|null|undefined} .google.longrunning.operationInfo - * @memberof google.protobuf.MethodOptions + * Enum syntax. + * @member {google.protobuf.Syntax} syntax + * @memberof google.protobuf.Enum * @instance */ - MethodOptions.prototype[".google.longrunning.operationInfo"] = null; + Enum.prototype.syntax = 0; /** - * Creates a new MethodOptions instance using the specified properties. + * Creates a new Enum instance using the specified properties. * @function create - * @memberof google.protobuf.MethodOptions + * @memberof google.protobuf.Enum * @static - * @param {google.protobuf.IMethodOptions=} [properties] Properties to set - * @returns {google.protobuf.MethodOptions} MethodOptions instance + * @param {google.protobuf.IEnum=} [properties] Properties to set + * @returns {google.protobuf.Enum} Enum instance */ - MethodOptions.create = function create(properties) { - return new MethodOptions(properties); + Enum.create = function create(properties) { + return new Enum(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.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(); + + /** + * Encodes the specified Enum message. Does not implicitly {@link google.protobuf.Enum.verify|verify} messages. + * @function encode + * @memberof google.protobuf.Enum + * @static + * @param {google.protobuf.IEnum} message Enum message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Enum.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.enumvalue != null && message.enumvalue.length) + for (var i = 0; i < message.enumvalue.length; ++i) + $root.google.protobuf.EnumValue.encode(message.enumvalue[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.options != null && message.options.length) + for (var i = 0; i < message.options.length; ++i) + $root.google.protobuf.Option.encode(message.options[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.sourceContext != null && Object.hasOwnProperty.call(message, "sourceContext")) + $root.google.protobuf.SourceContext.encode(message.sourceContext, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.syntax != null && Object.hasOwnProperty.call(message, "syntax")) + writer.uint32(/* id 5, wireType 0 =*/40).int32(message.syntax); return writer; }; /** - * Encodes the specified MethodOptions message, length delimited. Does not implicitly {@link google.protobuf.MethodOptions.verify|verify} messages. + * Encodes the specified Enum message, length delimited. Does not implicitly {@link google.protobuf.Enum.verify|verify} messages. * @function encodeDelimited - * @memberof google.protobuf.MethodOptions + * @memberof google.protobuf.Enum * @static - * @param {google.protobuf.IMethodOptions} message MethodOptions message or plain object to encode + * @param {google.protobuf.IEnum} message Enum message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - MethodOptions.encodeDelimited = function encodeDelimited(message, writer) { + Enum.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a MethodOptions message from the specified reader or buffer. + * Decodes an Enum message from the specified reader or buffer. * @function decode - * @memberof google.protobuf.MethodOptions + * @memberof google.protobuf.Enum * @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 + * @returns {google.protobuf.Enum} Enum * @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) { + Enum.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.MethodOptions(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.Enum(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 33: { - message.deprecated = reader.bool(); - break; - } - case 34: { - message.idempotencyLevel = reader.int32(); + case 1: { + message.name = reader.string(); break; } - case 999: { - if (!(message.uninterpretedOption && message.uninterpretedOption.length)) - message.uninterpretedOption = []; - message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); + case 2: { + if (!(message.enumvalue && message.enumvalue.length)) + message.enumvalue = []; + message.enumvalue.push($root.google.protobuf.EnumValue.decode(reader, reader.uint32())); break; } - case 72295728: { - message[".google.api.http"] = $root.google.api.HttpRule.decode(reader, reader.uint32()); + case 3: { + if (!(message.options && message.options.length)) + message.options = []; + message.options.push($root.google.protobuf.Option.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()); + case 4: { + message.sourceContext = $root.google.protobuf.SourceContext.decode(reader, reader.uint32()); break; } - case 1049: { - message[".google.longrunning.operationInfo"] = $root.google.longrunning.OperationInfo.decode(reader, reader.uint32()); + case 5: { + message.syntax = reader.int32(); break; } default: @@ -11745,251 +13017,218 @@ }; /** - * Decodes a MethodOptions message from the specified reader or buffer, length delimited. + * Decodes an Enum message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.protobuf.MethodOptions + * @memberof google.protobuf.Enum * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.MethodOptions} MethodOptions + * @returns {google.protobuf.Enum} Enum * @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) { + Enum.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a MethodOptions message. + * Verifies an Enum message. * @function verify - * @memberof google.protobuf.MethodOptions + * @memberof google.protobuf.Enum * @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) { + Enum.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.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 (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.enumvalue != null && message.hasOwnProperty("enumvalue")) { + if (!Array.isArray(message.enumvalue)) + return "enumvalue: array expected"; + for (var i = 0; i < message.enumvalue.length; ++i) { + var error = $root.google.protobuf.EnumValue.verify(message.enumvalue[i]); if (error) - return "uninterpretedOption." + error; + return "enumvalue." + 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.options != null && message.hasOwnProperty("options")) { + if (!Array.isArray(message.options)) + return "options: array expected"; + for (var i = 0; i < message.options.length; ++i) { + var error = $root.google.protobuf.Option.verify(message.options[i]); + if (error) + return "options." + error; + } } - if (message[".google.longrunning.operationInfo"] != null && message.hasOwnProperty(".google.longrunning.operationInfo")) { - var error = $root.google.longrunning.OperationInfo.verify(message[".google.longrunning.operationInfo"]); + if (message.sourceContext != null && message.hasOwnProperty("sourceContext")) { + var error = $root.google.protobuf.SourceContext.verify(message.sourceContext); if (error) - return ".google.longrunning.operationInfo." + error; + return "sourceContext." + error; } + if (message.syntax != null && message.hasOwnProperty("syntax")) + switch (message.syntax) { + default: + return "syntax: enum value expected"; + case 0: + case 1: + break; + } return null; }; /** - * Creates a MethodOptions message from a plain object. Also converts values to their respective internal types. + * Creates an Enum message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.protobuf.MethodOptions + * @memberof google.protobuf.Enum * @static * @param {Object.} object Plain object - * @returns {google.protobuf.MethodOptions} MethodOptions + * @returns {google.protobuf.Enum} Enum */ - MethodOptions.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.MethodOptions) + Enum.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.Enum) return object; - var message = new $root.google.protobuf.MethodOptions(); - if (object.deprecated != null) - message.deprecated = Boolean(object.deprecated); - switch (object.idempotencyLevel) { + var message = new $root.google.protobuf.Enum(); + if (object.name != null) + message.name = String(object.name); + if (object.enumvalue) { + if (!Array.isArray(object.enumvalue)) + throw TypeError(".google.protobuf.Enum.enumvalue: array expected"); + message.enumvalue = []; + for (var i = 0; i < object.enumvalue.length; ++i) { + if (typeof object.enumvalue[i] !== "object") + throw TypeError(".google.protobuf.Enum.enumvalue: object expected"); + message.enumvalue[i] = $root.google.protobuf.EnumValue.fromObject(object.enumvalue[i]); + } + } + if (object.options) { + if (!Array.isArray(object.options)) + throw TypeError(".google.protobuf.Enum.options: array expected"); + message.options = []; + for (var i = 0; i < object.options.length; ++i) { + if (typeof object.options[i] !== "object") + throw TypeError(".google.protobuf.Enum.options: object expected"); + message.options[i] = $root.google.protobuf.Option.fromObject(object.options[i]); + } + } + if (object.sourceContext != null) { + if (typeof object.sourceContext !== "object") + throw TypeError(".google.protobuf.Enum.sourceContext: object expected"); + message.sourceContext = $root.google.protobuf.SourceContext.fromObject(object.sourceContext); + } + switch (object.syntax) { default: - if (typeof object.idempotencyLevel === "number") { - message.idempotencyLevel = object.idempotencyLevel; + if (typeof object.syntax === "number") { + message.syntax = object.syntax; break; } break; - case "IDEMPOTENCY_UNKNOWN": + case "SYNTAX_PROTO2": case 0: - message.idempotencyLevel = 0; + message.syntax = 0; break; - case "NO_SIDE_EFFECTS": + case "SYNTAX_PROTO3": case 1: - message.idempotencyLevel = 1; - break; - case "IDEMPOTENT": - case 2: - message.idempotencyLevel = 2; + message.syntax = 1; break; } - 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. + * Creates a plain object from an Enum message. Also converts values to other types if specified. * @function toObject - * @memberof google.protobuf.MethodOptions + * @memberof google.protobuf.Enum * @static - * @param {google.protobuf.MethodOptions} message MethodOptions + * @param {google.protobuf.Enum} message Enum * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - MethodOptions.toObject = function toObject(message, options) { + Enum.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; if (options.arrays || options.defaults) { - object.uninterpretedOption = []; - object[".google.api.methodSignature"] = []; + object.enumvalue = []; + object.options = []; } if (options.defaults) { - object.deprecated = false; - object.idempotencyLevel = options.enums === String ? "IDEMPOTENCY_UNKNOWN" : 0; - object[".google.longrunning.operationInfo"] = null; - object[".google.api.http"] = null; + object.name = ""; + object.sourceContext = null; + object.syntax = options.enums === String ? "SYNTAX_PROTO2" : 0; } - 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.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.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.enumvalue && message.enumvalue.length) { + object.enumvalue = []; + for (var j = 0; j < message.enumvalue.length; ++j) + object.enumvalue[j] = $root.google.protobuf.EnumValue.toObject(message.enumvalue[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.options && message.options.length) { + object.options = []; + for (var j = 0; j < message.options.length; ++j) + object.options[j] = $root.google.protobuf.Option.toObject(message.options[j], options); } - 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); + if (message.sourceContext != null && message.hasOwnProperty("sourceContext")) + object.sourceContext = $root.google.protobuf.SourceContext.toObject(message.sourceContext, options); + if (message.syntax != null && message.hasOwnProperty("syntax")) + object.syntax = options.enums === String ? $root.google.protobuf.Syntax[message.syntax] === undefined ? message.syntax : $root.google.protobuf.Syntax[message.syntax] : message.syntax; return object; }; /** - * Converts this MethodOptions to JSON. + * Converts this Enum to JSON. * @function toJSON - * @memberof google.protobuf.MethodOptions + * @memberof google.protobuf.Enum * @instance * @returns {Object.} JSON object */ - MethodOptions.prototype.toJSON = function toJSON() { + Enum.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for MethodOptions + * Gets the default type url for Enum * @function getTypeUrl - * @memberof google.protobuf.MethodOptions + * @memberof google.protobuf.Enum * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - MethodOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + Enum.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.protobuf.MethodOptions"; + return typeUrlPrefix + "/google.protobuf.Enum"; }; - /** - * 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; + return Enum; })(); - protobuf.UninterpretedOption = (function() { + protobuf.EnumValue = (function() { /** - * Properties of an UninterpretedOption. + * Properties of an EnumValue. * @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 + * @interface IEnumValue + * @property {string|null} [name] EnumValue name + * @property {number|null} [number] EnumValue number + * @property {Array.|null} [options] EnumValue options */ /** - * Constructs a new UninterpretedOption. + * Constructs a new EnumValue. * @memberof google.protobuf - * @classdesc Represents an UninterpretedOption. - * @implements IUninterpretedOption + * @classdesc Represents an EnumValue. + * @implements IEnumValue * @constructor - * @param {google.protobuf.IUninterpretedOption=} [properties] Properties to set + * @param {google.protobuf.IEnumValue=} [properties] Properties to set */ - function UninterpretedOption(properties) { - this.name = []; + function EnumValue(properties) { + this.options = []; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -11997,162 +13236,106 @@ } /** - * 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 + * EnumValue name. + * @member {string} name + * @memberof google.protobuf.EnumValue * @instance */ - UninterpretedOption.prototype.doubleValue = 0; + EnumValue.prototype.name = ""; /** - * UninterpretedOption stringValue. - * @member {Uint8Array} stringValue - * @memberof google.protobuf.UninterpretedOption + * EnumValue number. + * @member {number} number + * @memberof google.protobuf.EnumValue * @instance */ - UninterpretedOption.prototype.stringValue = $util.newBuffer([]); + EnumValue.prototype.number = 0; /** - * UninterpretedOption aggregateValue. - * @member {string} aggregateValue - * @memberof google.protobuf.UninterpretedOption + * EnumValue options. + * @member {Array.} options + * @memberof google.protobuf.EnumValue * @instance */ - UninterpretedOption.prototype.aggregateValue = ""; + EnumValue.prototype.options = $util.emptyArray; /** - * Creates a new UninterpretedOption instance using the specified properties. + * Creates a new EnumValue instance using the specified properties. * @function create - * @memberof google.protobuf.UninterpretedOption + * @memberof google.protobuf.EnumValue * @static - * @param {google.protobuf.IUninterpretedOption=} [properties] Properties to set - * @returns {google.protobuf.UninterpretedOption} UninterpretedOption instance + * @param {google.protobuf.IEnumValue=} [properties] Properties to set + * @returns {google.protobuf.EnumValue} EnumValue instance */ - UninterpretedOption.create = function create(properties) { - return new UninterpretedOption(properties); + EnumValue.create = function create(properties) { + return new EnumValue(properties); }; /** - * Encodes the specified UninterpretedOption message. Does not implicitly {@link google.protobuf.UninterpretedOption.verify|verify} messages. + * Encodes the specified EnumValue message. Does not implicitly {@link google.protobuf.EnumValue.verify|verify} messages. * @function encode - * @memberof google.protobuf.UninterpretedOption + * @memberof google.protobuf.EnumValue * @static - * @param {google.protobuf.IUninterpretedOption} message UninterpretedOption message or plain object to encode + * @param {google.protobuf.IEnumValue} message EnumValue message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - UninterpretedOption.encode = function encode(message, writer) { + EnumValue.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); + 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 && message.options.length) + for (var i = 0; i < message.options.length; ++i) + $root.google.protobuf.Option.encode(message.options[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); return writer; }; /** - * Encodes the specified UninterpretedOption message, length delimited. Does not implicitly {@link google.protobuf.UninterpretedOption.verify|verify} messages. + * Encodes the specified EnumValue message, length delimited. Does not implicitly {@link google.protobuf.EnumValue.verify|verify} messages. * @function encodeDelimited - * @memberof google.protobuf.UninterpretedOption + * @memberof google.protobuf.EnumValue * @static - * @param {google.protobuf.IUninterpretedOption} message UninterpretedOption message or plain object to encode + * @param {google.protobuf.IEnumValue} message EnumValue message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - UninterpretedOption.encodeDelimited = function encodeDelimited(message, writer) { + EnumValue.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes an UninterpretedOption message from the specified reader or buffer. + * Decodes an EnumValue message from the specified reader or buffer. * @function decode - * @memberof google.protobuf.UninterpretedOption + * @memberof google.protobuf.EnumValue * @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 + * @returns {google.protobuf.EnumValue} EnumValue * @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) { + EnumValue.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.UninterpretedOption(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.EnumValue(); while (reader.pos < end) { var tag = reader.uint32(); 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(); + case 1: { + message.name = reader.string(); break; } - case 7: { - message.stringValue = reader.bytes(); + case 2: { + message.number = reader.int32(); break; } - case 8: { - message.aggregateValue = reader.string(); + case 3: { + if (!(message.options && message.options.length)) + message.options = []; + message.options.push($root.google.protobuf.Option.decode(reader, reader.uint32())); break; } default: @@ -12164,454 +13347,158 @@ }; /** - * Decodes an UninterpretedOption message from the specified reader or buffer, length delimited. + * Decodes an EnumValue message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.protobuf.UninterpretedOption + * @memberof google.protobuf.EnumValue * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.UninterpretedOption} UninterpretedOption + * @returns {google.protobuf.EnumValue} EnumValue * @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) { + EnumValue.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies an UninterpretedOption message. + * Verifies an EnumValue message. * @function verify - * @memberof google.protobuf.UninterpretedOption + * @memberof google.protobuf.EnumValue * @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]); + EnumValue.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")) { + if (!Array.isArray(message.options)) + return "options: array expected"; + for (var i = 0; i < message.options.length; ++i) { + var error = $root.google.protobuf.Option.verify(message.options[i]); if (error) - return "name." + error; + return "options." + 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. + * Creates an EnumValue message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.protobuf.UninterpretedOption + * @memberof google.protobuf.EnumValue * @static * @param {Object.} object Plain object - * @returns {google.protobuf.UninterpretedOption} UninterpretedOption + * @returns {google.protobuf.EnumValue} EnumValue */ - UninterpretedOption.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.UninterpretedOption) + EnumValue.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.EnumValue) 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]); + var message = new $root.google.protobuf.EnumValue(); + if (object.name != null) + message.name = String(object.name); + if (object.number != null) + message.number = object.number | 0; + if (object.options) { + if (!Array.isArray(object.options)) + throw TypeError(".google.protobuf.EnumValue.options: array expected"); + message.options = []; + for (var i = 0; i < object.options.length; ++i) { + if (typeof object.options[i] !== "object") + throw TypeError(".google.protobuf.EnumValue.options: object expected"); + message.options[i] = $root.google.protobuf.Option.fromObject(object.options[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. + * Creates a plain object from an EnumValue message. Also converts values to other types if specified. * @function toObject - * @memberof google.protobuf.UninterpretedOption + * @memberof google.protobuf.EnumValue * @static - * @param {google.protobuf.UninterpretedOption} message UninterpretedOption + * @param {google.protobuf.EnumValue} message EnumValue * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - UninterpretedOption.toObject = function toObject(message, options) { + EnumValue.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; if (options.arrays || options.defaults) - object.name = []; + object.options = []; 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 = ""; + object.name = ""; + object.number = 0; } - 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.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.number != null && message.hasOwnProperty("number")) + object.number = message.number; + if (message.options && message.options.length) { + object.options = []; + for (var j = 0; j < message.options.length; ++j) + object.options[j] = $root.google.protobuf.Option.toObject(message.options[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. + * Converts this EnumValue to JSON. * @function toJSON - * @memberof google.protobuf.UninterpretedOption + * @memberof google.protobuf.EnumValue * @instance * @returns {Object.} JSON object */ - UninterpretedOption.prototype.toJSON = function toJSON() { + EnumValue.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for UninterpretedOption + * Gets the default type url for EnumValue * @function getTypeUrl - * @memberof google.protobuf.UninterpretedOption + * @memberof google.protobuf.EnumValue * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - UninterpretedOption.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + EnumValue.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.protobuf.UninterpretedOption"; + return typeUrlPrefix + "/google.protobuf.EnumValue"; }; - 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) { - 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(); - 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; + return EnumValue; })(); - protobuf.SourceCodeInfo = (function() { + protobuf.Option = (function() { /** - * Properties of a SourceCodeInfo. + * Properties of an Option. * @memberof google.protobuf - * @interface ISourceCodeInfo - * @property {Array.|null} [location] SourceCodeInfo location + * @interface IOption + * @property {string|null} [name] Option name + * @property {google.protobuf.IAny|null} [value] Option value */ /** - * Constructs a new SourceCodeInfo. + * Constructs a new Option. * @memberof google.protobuf - * @classdesc Represents a SourceCodeInfo. - * @implements ISourceCodeInfo + * @classdesc Represents an Option. + * @implements IOption * @constructor - * @param {google.protobuf.ISourceCodeInfo=} [properties] Properties to set + * @param {google.protobuf.IOption=} [properties] Properties to set */ - function SourceCodeInfo(properties) { - this.location = []; + function Option(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -12619,78 +13506,89 @@ } /** - * SourceCodeInfo location. - * @member {Array.} location - * @memberof google.protobuf.SourceCodeInfo + * Option name. + * @member {string} name + * @memberof google.protobuf.Option * @instance */ - SourceCodeInfo.prototype.location = $util.emptyArray; + Option.prototype.name = ""; /** - * Creates a new SourceCodeInfo instance using the specified properties. + * Option value. + * @member {google.protobuf.IAny|null|undefined} value + * @memberof google.protobuf.Option + * @instance + */ + Option.prototype.value = null; + + /** + * Creates a new Option instance using the specified properties. * @function create - * @memberof google.protobuf.SourceCodeInfo + * @memberof google.protobuf.Option * @static - * @param {google.protobuf.ISourceCodeInfo=} [properties] Properties to set - * @returns {google.protobuf.SourceCodeInfo} SourceCodeInfo instance + * @param {google.protobuf.IOption=} [properties] Properties to set + * @returns {google.protobuf.Option} Option instance */ - SourceCodeInfo.create = function create(properties) { - return new SourceCodeInfo(properties); + Option.create = function create(properties) { + return new Option(properties); }; /** - * Encodes the specified SourceCodeInfo message. Does not implicitly {@link google.protobuf.SourceCodeInfo.verify|verify} messages. + * Encodes the specified Option message. Does not implicitly {@link google.protobuf.Option.verify|verify} messages. * @function encode - * @memberof google.protobuf.SourceCodeInfo + * @memberof google.protobuf.Option * @static - * @param {google.protobuf.ISourceCodeInfo} message SourceCodeInfo message or plain object to encode + * @param {google.protobuf.IOption} message Option message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - SourceCodeInfo.encode = function encode(message, writer) { + Option.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(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.value != null && Object.hasOwnProperty.call(message, "value")) + $root.google.protobuf.Any.encode(message.value, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); return writer; }; /** - * Encodes the specified SourceCodeInfo message, length delimited. Does not implicitly {@link google.protobuf.SourceCodeInfo.verify|verify} messages. + * Encodes the specified Option message, length delimited. Does not implicitly {@link google.protobuf.Option.verify|verify} messages. * @function encodeDelimited - * @memberof google.protobuf.SourceCodeInfo + * @memberof google.protobuf.Option * @static - * @param {google.protobuf.ISourceCodeInfo} message SourceCodeInfo message or plain object to encode + * @param {google.protobuf.IOption} message Option message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - SourceCodeInfo.encodeDelimited = function encodeDelimited(message, writer) { + Option.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a SourceCodeInfo message from the specified reader or buffer. + * Decodes an Option message from the specified reader or buffer. * @function decode - * @memberof google.protobuf.SourceCodeInfo + * @memberof google.protobuf.Option * @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 + * @returns {google.protobuf.Option} Option * @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) { + Option.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.SourceCodeInfo(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.Option(); while (reader.pos < end) { var tag = reader.uint32(); 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())); + message.name = reader.string(); + break; + } + case 2: { + message.value = $root.google.protobuf.Any.decode(reader, reader.uint32()); break; } default: @@ -12702,502 +13600,151 @@ }; /** - * Decodes a SourceCodeInfo message from the specified reader or buffer, length delimited. + * Decodes an Option message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.protobuf.SourceCodeInfo + * @memberof google.protobuf.Option * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.SourceCodeInfo} SourceCodeInfo + * @returns {google.protobuf.Option} Option * @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) { + Option.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a SourceCodeInfo message. + * Verifies an Option message. * @function verify - * @memberof google.protobuf.SourceCodeInfo + * @memberof google.protobuf.Option * @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; - } + Option.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")) { + var error = $root.google.protobuf.Any.verify(message.value); + if (error) + return "value." + error; } return null; }; /** - * Creates a SourceCodeInfo message from a plain object. Also converts values to their respective internal types. + * Creates an Option message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.protobuf.SourceCodeInfo + * @memberof google.protobuf.Option * @static * @param {Object.} object Plain object - * @returns {google.protobuf.SourceCodeInfo} SourceCodeInfo + * @returns {google.protobuf.Option} Option */ - SourceCodeInfo.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.SourceCodeInfo) + Option.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.Option) 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]); - } + var message = new $root.google.protobuf.Option(); + if (object.name != null) + message.name = String(object.name); + if (object.value != null) { + if (typeof object.value !== "object") + throw TypeError(".google.protobuf.Option.value: object expected"); + message.value = $root.google.protobuf.Any.fromObject(object.value); } return message; }; /** - * Creates a plain object from a SourceCodeInfo message. Also converts values to other types if specified. + * Creates a plain object from an Option message. Also converts values to other types if specified. * @function toObject - * @memberof google.protobuf.SourceCodeInfo + * @memberof google.protobuf.Option * @static - * @param {google.protobuf.SourceCodeInfo} message SourceCodeInfo + * @param {google.protobuf.Option} message Option * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - SourceCodeInfo.toObject = function toObject(message, options) { + Option.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); + if (options.defaults) { + object.name = ""; + object.value = null; } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.value != null && message.hasOwnProperty("value")) + object.value = $root.google.protobuf.Any.toObject(message.value, options); return object; }; /** - * Converts this SourceCodeInfo to JSON. + * Converts this Option to JSON. * @function toJSON - * @memberof google.protobuf.SourceCodeInfo + * @memberof google.protobuf.Option * @instance * @returns {Object.} JSON object */ - SourceCodeInfo.prototype.toJSON = function toJSON() { + Option.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for SourceCodeInfo + * Gets the default type url for Option * @function getTypeUrl - * @memberof google.protobuf.SourceCodeInfo + * @memberof google.protobuf.Option * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - SourceCodeInfo.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + Option.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.protobuf.SourceCodeInfo"; + return typeUrlPrefix + "/google.protobuf.Option"; }; - 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) { - 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(); - 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 Option; + })(); - return SourceCodeInfo; + /** + * Syntax enum. + * @name google.protobuf.Syntax + * @enum {number} + * @property {number} SYNTAX_PROTO2=0 SYNTAX_PROTO2 value + * @property {number} SYNTAX_PROTO3=1 SYNTAX_PROTO3 value + */ + protobuf.Syntax = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "SYNTAX_PROTO2"] = 0; + values[valuesById[1] = "SYNTAX_PROTO3"] = 1; + return values; })(); - protobuf.GeneratedCodeInfo = (function() { + protobuf.Any = (function() { /** - * Properties of a GeneratedCodeInfo. + * Properties of an Any. * @memberof google.protobuf - * @interface IGeneratedCodeInfo - * @property {Array.|null} [annotation] GeneratedCodeInfo annotation + * @interface IAny + * @property {string|null} [type_url] Any type_url + * @property {Uint8Array|null} [value] Any value */ /** - * Constructs a new GeneratedCodeInfo. + * Constructs a new Any. * @memberof google.protobuf - * @classdesc Represents a GeneratedCodeInfo. - * @implements IGeneratedCodeInfo + * @classdesc Represents an Any. + * @implements IAny * @constructor - * @param {google.protobuf.IGeneratedCodeInfo=} [properties] Properties to set + * @param {google.protobuf.IAny=} [properties] Properties to set */ - function GeneratedCodeInfo(properties) { - this.annotation = []; + function Any(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -13205,78 +13752,89 @@ } /** - * GeneratedCodeInfo annotation. - * @member {Array.} annotation - * @memberof google.protobuf.GeneratedCodeInfo + * Any type_url. + * @member {string} type_url + * @memberof google.protobuf.Any * @instance */ - GeneratedCodeInfo.prototype.annotation = $util.emptyArray; + Any.prototype.type_url = ""; /** - * Creates a new GeneratedCodeInfo instance using the specified properties. + * 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.GeneratedCodeInfo + * @memberof google.protobuf.Any * @static - * @param {google.protobuf.IGeneratedCodeInfo=} [properties] Properties to set - * @returns {google.protobuf.GeneratedCodeInfo} GeneratedCodeInfo instance + * @param {google.protobuf.IAny=} [properties] Properties to set + * @returns {google.protobuf.Any} Any instance */ - GeneratedCodeInfo.create = function create(properties) { - return new GeneratedCodeInfo(properties); + Any.create = function create(properties) { + return new Any(properties); }; /** - * Encodes the specified GeneratedCodeInfo message. Does not implicitly {@link google.protobuf.GeneratedCodeInfo.verify|verify} messages. + * Encodes the specified Any message. Does not implicitly {@link google.protobuf.Any.verify|verify} messages. * @function encode - * @memberof google.protobuf.GeneratedCodeInfo + * @memberof google.protobuf.Any * @static - * @param {google.protobuf.IGeneratedCodeInfo} message GeneratedCodeInfo message or plain object to encode + * @param {google.protobuf.IAny} message Any message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - GeneratedCodeInfo.encode = function encode(message, writer) { + Any.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(); + 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 GeneratedCodeInfo message, length delimited. Does not implicitly {@link google.protobuf.GeneratedCodeInfo.verify|verify} messages. + * Encodes the specified Any message, length delimited. Does not implicitly {@link google.protobuf.Any.verify|verify} messages. * @function encodeDelimited - * @memberof google.protobuf.GeneratedCodeInfo + * @memberof google.protobuf.Any * @static - * @param {google.protobuf.IGeneratedCodeInfo} message GeneratedCodeInfo message or plain object to encode + * @param {google.protobuf.IAny} message Any message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - GeneratedCodeInfo.encodeDelimited = function encodeDelimited(message, writer) { + Any.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a GeneratedCodeInfo message from the specified reader or buffer. + * Decodes an Any message from the specified reader or buffer. * @function decode - * @memberof google.protobuf.GeneratedCodeInfo + * @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.GeneratedCodeInfo} GeneratedCodeInfo + * @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 */ - GeneratedCodeInfo.decode = function decode(reader, length) { + Any.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.GeneratedCodeInfo(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.Any(); while (reader.pos < end) { var tag = reader.uint32(); 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())); + message.type_url = reader.string(); + break; + } + case 2: { + message.value = reader.bytes(); break; } default: @@ -13288,480 +13846,120 @@ }; /** - * Decodes a GeneratedCodeInfo message from the specified reader or buffer, length delimited. + * Decodes an Any message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.protobuf.GeneratedCodeInfo + * @memberof google.protobuf.Any * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.GeneratedCodeInfo} GeneratedCodeInfo + * @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 */ - GeneratedCodeInfo.decodeDelimited = function decodeDelimited(reader) { + Any.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a GeneratedCodeInfo message. + * Verifies an Any message. * @function verify - * @memberof google.protobuf.GeneratedCodeInfo + * @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 */ - GeneratedCodeInfo.verify = function verify(message) { + Any.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; - } - } + 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 a GeneratedCodeInfo message from a plain object. Also converts values to their respective internal types. + * Creates an Any message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.protobuf.GeneratedCodeInfo + * @memberof google.protobuf.Any * @static * @param {Object.} object Plain object - * @returns {google.protobuf.GeneratedCodeInfo} GeneratedCodeInfo + * @returns {google.protobuf.Any} Any */ - GeneratedCodeInfo.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.GeneratedCodeInfo) + Any.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.Any) 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]); - } - } + 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 a GeneratedCodeInfo message. Also converts values to other types if specified. + * Creates a plain object from an Any message. Also converts values to other types if specified. * @function toObject - * @memberof google.protobuf.GeneratedCodeInfo + * @memberof google.protobuf.Any * @static - * @param {google.protobuf.GeneratedCodeInfo} message GeneratedCodeInfo + * @param {google.protobuf.Any} message Any * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - GeneratedCodeInfo.toObject = function toObject(message, options) { + Any.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); + 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 GeneratedCodeInfo to JSON. + * Converts this Any to JSON. * @function toJSON - * @memberof google.protobuf.GeneratedCodeInfo + * @memberof google.protobuf.Any * @instance * @returns {Object.} JSON object */ - GeneratedCodeInfo.prototype.toJSON = function toJSON() { + Any.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for GeneratedCodeInfo + * Gets the default type url for Any * @function getTypeUrl - * @memberof google.protobuf.GeneratedCodeInfo + * @memberof google.protobuf.Any * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - GeneratedCodeInfo.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + Any.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.protobuf.GeneratedCodeInfo"; + return typeUrlPrefix + "/google.protobuf.Any"; }; - 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) { - 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(); - 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; + return Any; })(); protobuf.Duration = (function() { @@ -19964,6 +20162,7 @@ * @property {boolean|null} [isPrecise] ConsumerQuotaLimit isPrecise * @property {boolean|null} [allowsAdminOverrides] ConsumerQuotaLimit allowsAdminOverrides * @property {Array.|null} [quotaBuckets] ConsumerQuotaLimit quotaBuckets + * @property {Array.|null} [supportedLocations] ConsumerQuotaLimit supportedLocations */ /** @@ -19976,6 +20175,7 @@ */ function ConsumerQuotaLimit(properties) { this.quotaBuckets = []; + this.supportedLocations = []; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -20030,6 +20230,14 @@ */ ConsumerQuotaLimit.prototype.quotaBuckets = $util.emptyArray; + /** + * ConsumerQuotaLimit supportedLocations. + * @member {Array.} supportedLocations + * @memberof google.api.serviceusage.v1beta1.ConsumerQuotaLimit + * @instance + */ + ConsumerQuotaLimit.prototype.supportedLocations = $util.emptyArray; + /** * Creates a new ConsumerQuotaLimit instance using the specified properties. * @function create @@ -20067,6 +20275,9 @@ if (message.quotaBuckets != null && message.quotaBuckets.length) for (var i = 0; i < message.quotaBuckets.length; ++i) $root.google.api.serviceusage.v1beta1.QuotaBucket.encode(message.quotaBuckets[i], writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim(); + if (message.supportedLocations != null && message.supportedLocations.length) + for (var i = 0; i < message.supportedLocations.length; ++i) + writer.uint32(/* id 11, wireType 2 =*/90).string(message.supportedLocations[i]); return writer; }; @@ -20127,6 +20338,12 @@ message.quotaBuckets.push($root.google.api.serviceusage.v1beta1.QuotaBucket.decode(reader, reader.uint32())); break; } + case 11: { + if (!(message.supportedLocations && message.supportedLocations.length)) + message.supportedLocations = []; + message.supportedLocations.push(reader.string()); + break; + } default: reader.skipType(tag & 7); break; @@ -20186,6 +20403,13 @@ return "quotaBuckets." + error; } } + if (message.supportedLocations != null && message.hasOwnProperty("supportedLocations")) { + if (!Array.isArray(message.supportedLocations)) + return "supportedLocations: array expected"; + for (var i = 0; i < message.supportedLocations.length; ++i) + if (!$util.isString(message.supportedLocations[i])) + return "supportedLocations: string[] expected"; + } return null; }; @@ -20221,6 +20445,13 @@ message.quotaBuckets[i] = $root.google.api.serviceusage.v1beta1.QuotaBucket.fromObject(object.quotaBuckets[i]); } } + if (object.supportedLocations) { + if (!Array.isArray(object.supportedLocations)) + throw TypeError(".google.api.serviceusage.v1beta1.ConsumerQuotaLimit.supportedLocations: array expected"); + message.supportedLocations = []; + for (var i = 0; i < object.supportedLocations.length; ++i) + message.supportedLocations[i] = String(object.supportedLocations[i]); + } return message; }; @@ -20237,8 +20468,10 @@ if (!options) options = {}; var object = {}; - if (options.arrays || options.defaults) + if (options.arrays || options.defaults) { object.quotaBuckets = []; + object.supportedLocations = []; + } if (options.defaults) { object.name = ""; object.unit = ""; @@ -20261,6 +20494,11 @@ for (var j = 0; j < message.quotaBuckets.length; ++j) object.quotaBuckets[j] = $root.google.api.serviceusage.v1beta1.QuotaBucket.toObject(message.quotaBuckets[j], options); } + if (message.supportedLocations && message.supportedLocations.length) { + object.supportedLocations = []; + for (var j = 0; j < message.supportedLocations.length; ++j) + object.supportedLocations[j] = message.supportedLocations[j]; + } return object; }; @@ -20320,6 +20558,7 @@ * @property {google.api.serviceusage.v1beta1.IQuotaOverride|null} [producerOverride] QuotaBucket producerOverride * @property {google.api.serviceusage.v1beta1.IQuotaOverride|null} [consumerOverride] QuotaBucket consumerOverride * @property {google.api.serviceusage.v1beta1.IQuotaOverride|null} [adminOverride] QuotaBucket adminOverride + * @property {google.api.serviceusage.v1beta1.IProducerQuotaPolicy|null} [producerQuotaPolicy] QuotaBucket producerQuotaPolicy * @property {Object.|null} [dimensions] QuotaBucket dimensions */ @@ -20379,6 +20618,14 @@ */ QuotaBucket.prototype.adminOverride = null; + /** + * QuotaBucket producerQuotaPolicy. + * @member {google.api.serviceusage.v1beta1.IProducerQuotaPolicy|null|undefined} producerQuotaPolicy + * @memberof google.api.serviceusage.v1beta1.QuotaBucket + * @instance + */ + QuotaBucket.prototype.producerQuotaPolicy = null; + /** * QuotaBucket dimensions. * @member {Object.} dimensions @@ -20424,6 +20671,8 @@ if (message.dimensions != null && Object.hasOwnProperty.call(message, "dimensions")) for (var keys = Object.keys(message.dimensions), i = 0; i < keys.length; ++i) writer.uint32(/* id 6, wireType 2 =*/50).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.dimensions[keys[i]]).ldelim(); + if (message.producerQuotaPolicy != null && Object.hasOwnProperty.call(message, "producerQuotaPolicy")) + $root.google.api.serviceusage.v1beta1.ProducerQuotaPolicy.encode(message.producerQuotaPolicy, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); return writer; }; @@ -20478,6 +20727,10 @@ message.adminOverride = $root.google.api.serviceusage.v1beta1.QuotaOverride.decode(reader, reader.uint32()); break; } + case 7: { + message.producerQuotaPolicy = $root.google.api.serviceusage.v1beta1.ProducerQuotaPolicy.decode(reader, reader.uint32()); + break; + } case 6: { if (message.dimensions === $util.emptyObject) message.dimensions = {}; @@ -20557,6 +20810,11 @@ if (error) return "adminOverride." + error; } + if (message.producerQuotaPolicy != null && message.hasOwnProperty("producerQuotaPolicy")) { + var error = $root.google.api.serviceusage.v1beta1.ProducerQuotaPolicy.verify(message.producerQuotaPolicy); + if (error) + return "producerQuotaPolicy." + error; + } if (message.dimensions != null && message.hasOwnProperty("dimensions")) { if (!$util.isObject(message.dimensions)) return "dimensions: object expected"; @@ -20613,6 +20871,11 @@ throw TypeError(".google.api.serviceusage.v1beta1.QuotaBucket.adminOverride: object expected"); message.adminOverride = $root.google.api.serviceusage.v1beta1.QuotaOverride.fromObject(object.adminOverride); } + if (object.producerQuotaPolicy != null) { + if (typeof object.producerQuotaPolicy !== "object") + throw TypeError(".google.api.serviceusage.v1beta1.QuotaBucket.producerQuotaPolicy: object expected"); + message.producerQuotaPolicy = $root.google.api.serviceusage.v1beta1.ProducerQuotaPolicy.fromObject(object.producerQuotaPolicy); + } if (object.dimensions) { if (typeof object.dimensions !== "object") throw TypeError(".google.api.serviceusage.v1beta1.QuotaBucket.dimensions: object expected"); @@ -20652,6 +20915,7 @@ object.producerOverride = null; object.consumerOverride = null; object.adminOverride = null; + object.producerQuotaPolicy = null; } if (message.effectiveLimit != null && message.hasOwnProperty("effectiveLimit")) if (typeof message.effectiveLimit === "number") @@ -20675,6 +20939,8 @@ for (var j = 0; j < keys2.length; ++j) object.dimensions[keys2[j]] = message.dimensions[keys2[j]]; } + if (message.producerQuotaPolicy != null && message.hasOwnProperty("producerQuotaPolicy")) + object.producerQuotaPolicy = $root.google.api.serviceusage.v1beta1.ProducerQuotaPolicy.toObject(message.producerQuotaPolicy, options); return object; }; @@ -21316,6 +21582,375 @@ return values; })(); + v1beta1.ProducerQuotaPolicy = (function() { + + /** + * Properties of a ProducerQuotaPolicy. + * @memberof google.api.serviceusage.v1beta1 + * @interface IProducerQuotaPolicy + * @property {string|null} [name] ProducerQuotaPolicy name + * @property {number|Long|null} [policyValue] ProducerQuotaPolicy policyValue + * @property {Object.|null} [dimensions] ProducerQuotaPolicy dimensions + * @property {string|null} [metric] ProducerQuotaPolicy metric + * @property {string|null} [unit] ProducerQuotaPolicy unit + * @property {string|null} [container] ProducerQuotaPolicy container + */ + + /** + * Constructs a new ProducerQuotaPolicy. + * @memberof google.api.serviceusage.v1beta1 + * @classdesc Represents a ProducerQuotaPolicy. + * @implements IProducerQuotaPolicy + * @constructor + * @param {google.api.serviceusage.v1beta1.IProducerQuotaPolicy=} [properties] Properties to set + */ + function ProducerQuotaPolicy(properties) { + this.dimensions = {}; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ProducerQuotaPolicy name. + * @member {string} name + * @memberof google.api.serviceusage.v1beta1.ProducerQuotaPolicy + * @instance + */ + ProducerQuotaPolicy.prototype.name = ""; + + /** + * ProducerQuotaPolicy policyValue. + * @member {number|Long} policyValue + * @memberof google.api.serviceusage.v1beta1.ProducerQuotaPolicy + * @instance + */ + ProducerQuotaPolicy.prototype.policyValue = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * ProducerQuotaPolicy dimensions. + * @member {Object.} dimensions + * @memberof google.api.serviceusage.v1beta1.ProducerQuotaPolicy + * @instance + */ + ProducerQuotaPolicy.prototype.dimensions = $util.emptyObject; + + /** + * ProducerQuotaPolicy metric. + * @member {string} metric + * @memberof google.api.serviceusage.v1beta1.ProducerQuotaPolicy + * @instance + */ + ProducerQuotaPolicy.prototype.metric = ""; + + /** + * ProducerQuotaPolicy unit. + * @member {string} unit + * @memberof google.api.serviceusage.v1beta1.ProducerQuotaPolicy + * @instance + */ + ProducerQuotaPolicy.prototype.unit = ""; + + /** + * ProducerQuotaPolicy container. + * @member {string} container + * @memberof google.api.serviceusage.v1beta1.ProducerQuotaPolicy + * @instance + */ + ProducerQuotaPolicy.prototype.container = ""; + + /** + * Creates a new ProducerQuotaPolicy instance using the specified properties. + * @function create + * @memberof google.api.serviceusage.v1beta1.ProducerQuotaPolicy + * @static + * @param {google.api.serviceusage.v1beta1.IProducerQuotaPolicy=} [properties] Properties to set + * @returns {google.api.serviceusage.v1beta1.ProducerQuotaPolicy} ProducerQuotaPolicy instance + */ + ProducerQuotaPolicy.create = function create(properties) { + return new ProducerQuotaPolicy(properties); + }; + + /** + * Encodes the specified ProducerQuotaPolicy message. Does not implicitly {@link google.api.serviceusage.v1beta1.ProducerQuotaPolicy.verify|verify} messages. + * @function encode + * @memberof google.api.serviceusage.v1beta1.ProducerQuotaPolicy + * @static + * @param {google.api.serviceusage.v1beta1.IProducerQuotaPolicy} message ProducerQuotaPolicy message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ProducerQuotaPolicy.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.policyValue != null && Object.hasOwnProperty.call(message, "policyValue")) + writer.uint32(/* id 2, wireType 0 =*/16).int64(message.policyValue); + if (message.dimensions != null && Object.hasOwnProperty.call(message, "dimensions")) + for (var keys = Object.keys(message.dimensions), 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.dimensions[keys[i]]).ldelim(); + if (message.metric != null && Object.hasOwnProperty.call(message, "metric")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.metric); + if (message.unit != null && Object.hasOwnProperty.call(message, "unit")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.unit); + if (message.container != null && Object.hasOwnProperty.call(message, "container")) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.container); + return writer; + }; + + /** + * Encodes the specified ProducerQuotaPolicy message, length delimited. Does not implicitly {@link google.api.serviceusage.v1beta1.ProducerQuotaPolicy.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.serviceusage.v1beta1.ProducerQuotaPolicy + * @static + * @param {google.api.serviceusage.v1beta1.IProducerQuotaPolicy} message ProducerQuotaPolicy message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ProducerQuotaPolicy.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ProducerQuotaPolicy message from the specified reader or buffer. + * @function decode + * @memberof google.api.serviceusage.v1beta1.ProducerQuotaPolicy + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.serviceusage.v1beta1.ProducerQuotaPolicy} ProducerQuotaPolicy + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ProducerQuotaPolicy.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.serviceusage.v1beta1.ProducerQuotaPolicy(), key, value; + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.policyValue = reader.int64(); + break; + } + case 3: { + if (message.dimensions === $util.emptyObject) + message.dimensions = {}; + 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.dimensions[key] = value; + break; + } + case 4: { + message.metric = reader.string(); + break; + } + case 5: { + message.unit = reader.string(); + break; + } + case 6: { + message.container = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ProducerQuotaPolicy message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.serviceusage.v1beta1.ProducerQuotaPolicy + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.serviceusage.v1beta1.ProducerQuotaPolicy} ProducerQuotaPolicy + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ProducerQuotaPolicy.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ProducerQuotaPolicy message. + * @function verify + * @memberof google.api.serviceusage.v1beta1.ProducerQuotaPolicy + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ProducerQuotaPolicy.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.policyValue != null && message.hasOwnProperty("policyValue")) + if (!$util.isInteger(message.policyValue) && !(message.policyValue && $util.isInteger(message.policyValue.low) && $util.isInteger(message.policyValue.high))) + return "policyValue: integer|Long expected"; + if (message.dimensions != null && message.hasOwnProperty("dimensions")) { + if (!$util.isObject(message.dimensions)) + return "dimensions: object expected"; + var key = Object.keys(message.dimensions); + for (var i = 0; i < key.length; ++i) + if (!$util.isString(message.dimensions[key[i]])) + return "dimensions: string{k:string} expected"; + } + if (message.metric != null && message.hasOwnProperty("metric")) + if (!$util.isString(message.metric)) + return "metric: string expected"; + if (message.unit != null && message.hasOwnProperty("unit")) + if (!$util.isString(message.unit)) + return "unit: string expected"; + if (message.container != null && message.hasOwnProperty("container")) + if (!$util.isString(message.container)) + return "container: string expected"; + return null; + }; + + /** + * Creates a ProducerQuotaPolicy message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.serviceusage.v1beta1.ProducerQuotaPolicy + * @static + * @param {Object.} object Plain object + * @returns {google.api.serviceusage.v1beta1.ProducerQuotaPolicy} ProducerQuotaPolicy + */ + ProducerQuotaPolicy.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.serviceusage.v1beta1.ProducerQuotaPolicy) + return object; + var message = new $root.google.api.serviceusage.v1beta1.ProducerQuotaPolicy(); + if (object.name != null) + message.name = String(object.name); + if (object.policyValue != null) + if ($util.Long) + (message.policyValue = $util.Long.fromValue(object.policyValue)).unsigned = false; + else if (typeof object.policyValue === "string") + message.policyValue = parseInt(object.policyValue, 10); + else if (typeof object.policyValue === "number") + message.policyValue = object.policyValue; + else if (typeof object.policyValue === "object") + message.policyValue = new $util.LongBits(object.policyValue.low >>> 0, object.policyValue.high >>> 0).toNumber(); + if (object.dimensions) { + if (typeof object.dimensions !== "object") + throw TypeError(".google.api.serviceusage.v1beta1.ProducerQuotaPolicy.dimensions: object expected"); + message.dimensions = {}; + for (var keys = Object.keys(object.dimensions), i = 0; i < keys.length; ++i) + message.dimensions[keys[i]] = String(object.dimensions[keys[i]]); + } + if (object.metric != null) + message.metric = String(object.metric); + if (object.unit != null) + message.unit = String(object.unit); + if (object.container != null) + message.container = String(object.container); + return message; + }; + + /** + * Creates a plain object from a ProducerQuotaPolicy message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.serviceusage.v1beta1.ProducerQuotaPolicy + * @static + * @param {google.api.serviceusage.v1beta1.ProducerQuotaPolicy} message ProducerQuotaPolicy + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ProducerQuotaPolicy.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.objects || options.defaults) + object.dimensions = {}; + if (options.defaults) { + object.name = ""; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.policyValue = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.policyValue = options.longs === String ? "0" : 0; + object.metric = ""; + object.unit = ""; + object.container = ""; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.policyValue != null && message.hasOwnProperty("policyValue")) + if (typeof message.policyValue === "number") + object.policyValue = options.longs === String ? String(message.policyValue) : message.policyValue; + else + object.policyValue = options.longs === String ? $util.Long.prototype.toString.call(message.policyValue) : options.longs === Number ? new $util.LongBits(message.policyValue.low >>> 0, message.policyValue.high >>> 0).toNumber() : message.policyValue; + var keys2; + if (message.dimensions && (keys2 = Object.keys(message.dimensions)).length) { + object.dimensions = {}; + for (var j = 0; j < keys2.length; ++j) + object.dimensions[keys2[j]] = message.dimensions[keys2[j]]; + } + if (message.metric != null && message.hasOwnProperty("metric")) + object.metric = message.metric; + if (message.unit != null && message.hasOwnProperty("unit")) + object.unit = message.unit; + if (message.container != null && message.hasOwnProperty("container")) + object.container = message.container; + return object; + }; + + /** + * Converts this ProducerQuotaPolicy to JSON. + * @function toJSON + * @memberof google.api.serviceusage.v1beta1.ProducerQuotaPolicy + * @instance + * @returns {Object.} JSON object + */ + ProducerQuotaPolicy.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ProducerQuotaPolicy + * @function getTypeUrl + * @memberof google.api.serviceusage.v1beta1.ProducerQuotaPolicy + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ProducerQuotaPolicy.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.serviceusage.v1beta1.ProducerQuotaPolicy"; + }; + + return ProducerQuotaPolicy; + })(); + v1beta1.AdminQuotaPolicy = (function() { /** @@ -37070,6 +37705,690 @@ return QuotaLimit; })(); + 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) { + 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(); + 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) { + 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(); + 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; + })(); + api.Usage = (function() { /** @@ -42154,6 +43473,32 @@ 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 + */ + 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; + return values; + })(); + return api; })(); diff --git a/packages/google-api-serviceusage/protos/protos.json b/packages/google-api-serviceusage/protos/protos.json index ebbb0ca2a38..62aaa334314 100644 --- a/packages/google-api-serviceusage/protos/protos.json +++ b/packages/google-api-serviceusage/protos/protos.json @@ -4,14 +4,14 @@ "nested": { "protobuf": { "options": { + "go_package": "google.golang.org/protobuf/types/known/typepb", "java_package": "com.google.protobuf", - "java_outer_classname": "DescriptorProtos", - "java_multiple_files": true, + "java_outer_classname": "TypeProto", + "csharp_namespace": "Google.Protobuf.WellKnownTypes", "objc_class_prefix": "GPB", - "csharp_namespace": "Google.Protobuf.Reflection", - "go_package": "google.golang.org/protobuf/types/descriptorpb", "cc_enable_arenas": true, - "optimize_for": "SPEED" + "optimize_for": "SPEED", + "java_multiple_files": true }, "nested": { "Struct": { @@ -77,173 +77,231 @@ } } }, - "Api": { + "FileDescriptorSet": { + "fields": { + "file": { + "rule": "repeated", + "type": "FileDescriptorProto", + "id": 1 + } + } + }, + "FileDescriptorProto": { "fields": { "name": { "type": "string", "id": 1 }, - "methods": { - "rule": "repeated", - "type": "Method", + "package": { + "type": "string", "id": 2 }, - "options": { + "dependency": { "rule": "repeated", - "type": "Option", + "type": "string", "id": 3 }, - "version": { - "type": "string", + "publicDependency": { + "rule": "repeated", + "type": "int32", + "id": 10, + "options": { + "packed": false + } + }, + "weakDependency": { + "rule": "repeated", + "type": "int32", + "id": 11, + "options": { + "packed": false + } + }, + "messageType": { + "rule": "repeated", + "type": "DescriptorProto", "id": 4 }, - "sourceContext": { - "type": "SourceContext", + "enumType": { + "rule": "repeated", + "type": "EnumDescriptorProto", "id": 5 }, - "mixins": { + "service": { "rule": "repeated", - "type": "Mixin", + "type": "ServiceDescriptorProto", "id": 6 }, - "syntax": { - "type": "Syntax", + "extension": { + "rule": "repeated", + "type": "FieldDescriptorProto", "id": 7 + }, + "options": { + "type": "FileOptions", + "id": 8 + }, + "sourceCodeInfo": { + "type": "SourceCodeInfo", + "id": 9 + }, + "syntax": { + "type": "string", + "id": 12 + }, + "edition": { + "type": "string", + "id": 13 } } }, - "Method": { + "DescriptorProto": { "fields": { "name": { "type": "string", "id": 1 }, - "requestTypeUrl": { - "type": "string", + "field": { + "rule": "repeated", + "type": "FieldDescriptorProto", "id": 2 }, - "requestStreaming": { - "type": "bool", + "extension": { + "rule": "repeated", + "type": "FieldDescriptorProto", + "id": 6 + }, + "nestedType": { + "rule": "repeated", + "type": "DescriptorProto", "id": 3 }, - "responseTypeUrl": { - "type": "string", + "enumType": { + "rule": "repeated", + "type": "EnumDescriptorProto", "id": 4 }, - "responseStreaming": { - "type": "bool", + "extensionRange": { + "rule": "repeated", + "type": "ExtensionRange", "id": 5 }, - "options": { + "oneofDecl": { "rule": "repeated", - "type": "Option", - "id": 6 + "type": "OneofDescriptorProto", + "id": 8 }, - "syntax": { - "type": "Syntax", + "options": { + "type": "MessageOptions", "id": 7 - } - } - }, - "Mixin": { - "fields": { - "name": { - "type": "string", - "id": 1 }, - "root": { + "reservedRange": { + "rule": "repeated", + "type": "ReservedRange", + "id": 9 + }, + "reservedName": { + "rule": "repeated", "type": "string", - "id": 2 + "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 + } + } } } }, - "SourceContext": { + "ExtensionRangeOptions": { "fields": { - "fileName": { - "type": "string", - "id": 1 + "uninterpretedOption": { + "rule": "repeated", + "type": "UninterpretedOption", + "id": 999 } - } + }, + "extensions": [ + [ + 1000, + 536870911 + ] + ] }, - "Type": { + "FieldDescriptorProto": { "fields": { "name": { "type": "string", "id": 1 }, - "fields": { - "rule": "repeated", - "type": "Field", - "id": 2 - }, - "oneofs": { - "rule": "repeated", - "type": "string", + "number": { + "type": "int32", "id": 3 }, - "options": { - "rule": "repeated", - "type": "Option", + "label": { + "type": "Label", "id": 4 }, - "sourceContext": { - "type": "SourceContext", + "type": { + "type": "Type", "id": 5 }, - "syntax": { - "type": "Syntax", + "typeName": { + "type": "string", "id": 6 - } - } - }, - "Field": { - "fields": { - "kind": { - "type": "Kind", - "id": 1 - }, - "cardinality": { - "type": "Cardinality", - "id": 2 - }, - "number": { - "type": "int32", - "id": 3 }, - "name": { + "extendee": { "type": "string", - "id": 4 + "id": 2 }, - "typeUrl": { + "defaultValue": { "type": "string", - "id": 6 + "id": 7 }, "oneofIndex": { "type": "int32", - "id": 7 - }, - "packed": { - "type": "bool", - "id": 8 - }, - "options": { - "rule": "repeated", - "type": "Option", "id": 9 }, "jsonName": { "type": "string", "id": 10 }, - "defaultValue": { - "type": "string", - "id": 11 + "options": { + "type": "FieldOptions", + "id": 8 + }, + "proto3Optional": { + "type": "bool", + "id": 17 } }, "nested": { - "Kind": { + "Type": { "values": { - "TYPE_UNKNOWN": 0, "TYPE_DOUBLE": 1, "TYPE_FLOAT": 2, "TYPE_INT64": 3, @@ -264,43 +322,69 @@ "TYPE_SINT64": 18 } }, - "Cardinality": { + "Label": { "values": { - "CARDINALITY_UNKNOWN": 0, - "CARDINALITY_OPTIONAL": 1, - "CARDINALITY_REQUIRED": 2, - "CARDINALITY_REPEATED": 3 + "LABEL_OPTIONAL": 1, + "LABEL_REQUIRED": 2, + "LABEL_REPEATED": 3 } } } }, - "Enum": { + "OneofDescriptorProto": { "fields": { "name": { "type": "string", "id": 1 }, - "enumvalue": { + "options": { + "type": "OneofOptions", + "id": 2 + } + } + }, + "EnumDescriptorProto": { + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "value": { "rule": "repeated", - "type": "EnumValue", + "type": "EnumValueDescriptorProto", "id": 2 }, "options": { - "rule": "repeated", - "type": "Option", + "type": "EnumOptions", "id": 3 }, - "sourceContext": { - "type": "SourceContext", + "reservedRange": { + "rule": "repeated", + "type": "EnumReservedRange", "id": 4 }, - "syntax": { - "type": "Syntax", + "reservedName": { + "rule": "repeated", + "type": "string", "id": 5 } + }, + "nested": { + "EnumReservedRange": { + "fields": { + "start": { + "type": "int32", + "id": 1 + }, + "end": { + "type": "int32", + "id": 2 + } + } + } } }, - "EnumValue": { + "EnumValueDescriptorProto": { "fields": { "name": { "type": "string", @@ -311,204 +395,236 @@ "id": 2 }, "options": { - "rule": "repeated", - "type": "Option", + "type": "EnumValueOptions", "id": 3 } } }, - "Option": { + "ServiceDescriptorProto": { "fields": { "name": { "type": "string", "id": 1 }, - "value": { - "type": "Any", + "method": { + "rule": "repeated", + "type": "MethodDescriptorProto", "id": 2 + }, + "options": { + "type": "ServiceOptions", + "id": 3 } } }, - "Syntax": { - "values": { - "SYNTAX_PROTO2": 0, - "SYNTAX_PROTO3": 1 - } - }, - "Any": { + "MethodDescriptorProto": { "fields": { - "type_url": { + "name": { "type": "string", "id": 1 }, - "value": { - "type": "bytes", + "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 + } } } }, - "FileDescriptorSet": { - "fields": { - "file": { - "rule": "repeated", - "type": "FileDescriptorProto", - "id": 1 - } - } - }, - "FileDescriptorProto": { + "FileOptions": { "fields": { - "name": { + "javaPackage": { "type": "string", "id": 1 }, - "package": { - "type": "string", - "id": 2 - }, - "dependency": { - "rule": "repeated", + "javaOuterClassname": { "type": "string", - "id": 3 + "id": 8 }, - "publicDependency": { - "rule": "repeated", - "type": "int32", + "javaMultipleFiles": { + "type": "bool", "id": 10, "options": { - "packed": false + "default": false } }, - "weakDependency": { - "rule": "repeated", - "type": "int32", - "id": 11, + "javaGenerateEqualsAndHash": { + "type": "bool", + "id": 20, "options": { - "packed": false + "deprecated": true } }, - "messageType": { - "rule": "repeated", - "type": "DescriptorProto", - "id": 4 + "javaStringCheckUtf8": { + "type": "bool", + "id": 27, + "options": { + "default": false + } }, - "enumType": { - "rule": "repeated", - "type": "EnumDescriptorProto", - "id": 5 + "optimizeFor": { + "type": "OptimizeMode", + "id": 9, + "options": { + "default": "SPEED" + } }, - "service": { - "rule": "repeated", - "type": "ServiceDescriptorProto", - "id": 6 + "goPackage": { + "type": "string", + "id": 11 }, - "extension": { - "rule": "repeated", - "type": "FieldDescriptorProto", - "id": 7 + "ccGenericServices": { + "type": "bool", + "id": 16, + "options": { + "default": false + } }, - "options": { - "type": "FileOptions", - "id": 8 + "javaGenericServices": { + "type": "bool", + "id": 17, + "options": { + "default": false + } }, - "sourceCodeInfo": { - "type": "SourceCodeInfo", - "id": 9 + "pyGenericServices": { + "type": "bool", + "id": 18, + "options": { + "default": false + } }, - "syntax": { + "phpGenericServices": { + "type": "bool", + "id": 42, + "options": { + "default": false + } + }, + "deprecated": { + "type": "bool", + "id": 23, + "options": { + "default": false + } + }, + "ccEnableArenas": { + "type": "bool", + "id": 31, + "options": { + "default": true + } + }, + "objcClassPrefix": { "type": "string", - "id": 12 + "id": 36 }, - "edition": { + "csharpNamespace": { "type": "string", - "id": 13 - } - } - }, - "DescriptorProto": { - "fields": { - "name": { + "id": 37 + }, + "swiftPrefix": { "type": "string", - "id": 1 + "id": 39 }, - "field": { - "rule": "repeated", - "type": "FieldDescriptorProto", - "id": 2 + "phpClassPrefix": { + "type": "string", + "id": 40 }, - "extension": { - "rule": "repeated", - "type": "FieldDescriptorProto", - "id": 6 + "phpNamespace": { + "type": "string", + "id": 41 }, - "nestedType": { - "rule": "repeated", - "type": "DescriptorProto", - "id": 3 + "phpMetadataNamespace": { + "type": "string", + "id": 44 }, - "enumType": { - "rule": "repeated", - "type": "EnumDescriptorProto", - "id": 4 + "rubyPackage": { + "type": "string", + "id": 45 }, - "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": { + "uninterpretedOption": { "rule": "repeated", - "type": "string", - "id": 10 + "type": "UninterpretedOption", + "id": 999 } }, + "extensions": [ + [ + 1000, + 536870911 + ] + ], + "reserved": [ + [ + 38, + 38 + ] + ], "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 - } + "OptimizeMode": { + "values": { + "SPEED": 1, + "CODE_SIZE": 2, + "LITE_RUNTIME": 3 } } } }, - "ExtensionRangeOptions": { + "MessageOptions": { "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 + } + }, "uninterpretedOption": { "rule": "repeated", "type": "UninterpretedOption", @@ -520,800 +636,684 @@ 1000, 536870911 ] + ], + "reserved": [ + [ + 4, + 4 + ], + [ + 5, + 5 + ], + [ + 6, + 6 + ], + [ + 8, + 8 + ], + [ + 9, + 9 + ] ] }, - "FieldDescriptorProto": { + "FieldOptions": { "fields": { - "name": { - "type": "string", - "id": 1 + "ctype": { + "type": "CType", + "id": 1, + "options": { + "default": "STRING" + } }, - "number": { - "type": "int32", - "id": 3 + "packed": { + "type": "bool", + "id": 2 }, - "label": { - "type": "Label", - "id": 4 + "jstype": { + "type": "JSType", + "id": 6, + "options": { + "default": "JS_NORMAL" + } }, - "type": { - "type": "Type", - "id": 5 + "lazy": { + "type": "bool", + "id": 5, + "options": { + "default": false + } }, - "typeName": { - "type": "string", - "id": 6 + "unverifiedLazy": { + "type": "bool", + "id": 15, + "options": { + "default": false + } }, - "extendee": { - "type": "string", - "id": 2 + "deprecated": { + "type": "bool", + "id": 3, + "options": { + "default": false + } }, - "defaultValue": { - "type": "string", - "id": 7 + "weak": { + "type": "bool", + "id": 10, + "options": { + "default": false + } }, - "oneofIndex": { - "type": "int32", - "id": 9 + "debugRedact": { + "type": "bool", + "id": 16, + "options": { + "default": false + } }, - "jsonName": { - "type": "string", - "id": 10 + "retention": { + "type": "OptionRetention", + "id": 17 }, - "options": { - "type": "FieldOptions", - "id": 8 + "target": { + "type": "OptionTargetType", + "id": 18 }, - "proto3Optional": { - "type": "bool", - "id": 17 + "uninterpretedOption": { + "rule": "repeated", + "type": "UninterpretedOption", + "id": 999 } }, + "extensions": [ + [ + 1000, + 536870911 + ] + ], + "reserved": [ + [ + 4, + 4 + ] + ], "nested": { - "Type": { + "CType": { "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 + "STRING": 0, + "CORD": 1, + "STRING_PIECE": 2 } }, - "Label": { + "JSType": { "values": { - "LABEL_OPTIONAL": 1, - "LABEL_REQUIRED": 2, - "LABEL_REPEATED": 3 + "JS_NORMAL": 0, + "JS_STRING": 1, + "JS_NUMBER": 2 } - } - } - }, - "OneofDescriptorProto": { - "fields": { - "name": { - "type": "string", - "id": 1 - }, - "options": { - "type": "OneofOptions", - "id": 2 - } - } - }, - "EnumDescriptorProto": { - "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 - } + "OptionRetention": { + "values": { + "RETENTION_UNKNOWN": 0, + "RETENTION_RUNTIME": 1, + "RETENTION_SOURCE": 2 } - } - } - }, - "EnumValueDescriptorProto": { - "fields": { - "name": { - "type": "string", - "id": 1 }, - "number": { - "type": "int32", - "id": 2 - }, - "options": { - "type": "EnumValueOptions", - "id": 3 + "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 + } } } }, - "ServiceDescriptorProto": { + "OneofOptions": { "fields": { - "name": { - "type": "string", - "id": 1 - }, - "method": { + "uninterpretedOption": { "rule": "repeated", - "type": "MethodDescriptorProto", - "id": 2 - }, - "options": { - "type": "ServiceOptions", - "id": 3 + "type": "UninterpretedOption", + "id": 999 } - } + }, + "extensions": [ + [ + 1000, + 536870911 + ] + ] }, - "MethodDescriptorProto": { + "EnumOptions": { "fields": { - "name": { - "type": "string", - "id": 1 - }, - "inputType": { - "type": "string", + "allowAlias": { + "type": "bool", "id": 2 }, - "outputType": { - "type": "string", - "id": 3 - }, - "options": { - "type": "MethodOptions", - "id": 4 - }, - "clientStreaming": { + "deprecated": { "type": "bool", - "id": 5, + "id": 3, "options": { "default": false } }, - "serverStreaming": { + "deprecatedLegacyJsonFieldConflicts": { "type": "bool", "id": 6, "options": { - "default": false + "deprecated": true } + }, + "uninterpretedOption": { + "rule": "repeated", + "type": "UninterpretedOption", + "id": 999 } - } + }, + "extensions": [ + [ + 1000, + 536870911 + ] + ], + "reserved": [ + [ + 5, + 5 + ] + ] }, - "FileOptions": { + "EnumValueOptions": { "fields": { - "javaPackage": { - "type": "string", - "id": 1 - }, - "javaOuterClassname": { - "type": "string", - "id": 8 - }, - "javaMultipleFiles": { + "deprecated": { "type": "bool", - "id": 10, + "id": 1, "options": { "default": false } }, - "javaGenerateEqualsAndHash": { - "type": "bool", - "id": 20, - "options": { - "deprecated": true - } - }, - "javaStringCheckUtf8": { + "uninterpretedOption": { + "rule": "repeated", + "type": "UninterpretedOption", + "id": 999 + } + }, + "extensions": [ + [ + 1000, + 536870911 + ] + ] + }, + "ServiceOptions": { + "fields": { + "deprecated": { "type": "bool", - "id": 27, + "id": 33, "options": { "default": false } }, - "optimizeFor": { - "type": "OptimizeMode", - "id": 9, - "options": { - "default": "SPEED" - } - }, - "goPackage": { - "type": "string", - "id": 11 - }, - "ccGenericServices": { + "uninterpretedOption": { + "rule": "repeated", + "type": "UninterpretedOption", + "id": 999 + } + }, + "extensions": [ + [ + 1000, + 536870911 + ] + ] + }, + "MethodOptions": { + "fields": { + "deprecated": { "type": "bool", - "id": 16, + "id": 33, "options": { "default": false } }, - "javaGenericServices": { - "type": "bool", - "id": 17, + "idempotencyLevel": { + "type": "IdempotencyLevel", + "id": 34, "options": { - "default": false + "default": "IDEMPOTENCY_UNKNOWN" } }, - "pyGenericServices": { - "type": "bool", - "id": 18, - "options": { - "default": false + "uninterpretedOption": { + "rule": "repeated", + "type": "UninterpretedOption", + "id": 999 + } + }, + "extensions": [ + [ + 1000, + 536870911 + ] + ], + "nested": { + "IdempotencyLevel": { + "values": { + "IDEMPOTENCY_UNKNOWN": 0, + "NO_SIDE_EFFECTS": 1, + "IDEMPOTENT": 2 } + } + } + }, + "UninterpretedOption": { + "fields": { + "name": { + "rule": "repeated", + "type": "NamePart", + "id": 2 }, - "phpGenericServices": { - "type": "bool", - "id": 42, - "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": { + "identifierValue": { "type": "string", - "id": 37 + "id": 3 }, - "swiftPrefix": { - "type": "string", - "id": 39 + "positiveIntValue": { + "type": "uint64", + "id": 4 }, - "phpClassPrefix": { - "type": "string", - "id": 40 + "negativeIntValue": { + "type": "int64", + "id": 5 }, - "phpNamespace": { - "type": "string", - "id": 41 + "doubleValue": { + "type": "double", + "id": 6 }, - "phpMetadataNamespace": { - "type": "string", - "id": 44 + "stringValue": { + "type": "bytes", + "id": 7 }, - "rubyPackage": { + "aggregateValue": { "type": "string", - "id": 45 - }, - "uninterpretedOption": { - "rule": "repeated", - "type": "UninterpretedOption", - "id": 999 + "id": 8 } }, - "extensions": [ - [ - 1000, - 536870911 - ] - ], - "reserved": [ - [ - 38, - 38 - ] - ], "nested": { - "OptimizeMode": { - "values": { - "SPEED": 1, - "CODE_SIZE": 2, - "LITE_RUNTIME": 3 + "NamePart": { + "fields": { + "namePart": { + "rule": "required", + "type": "string", + "id": 1 + }, + "isExtension": { + "rule": "required", + "type": "bool", + "id": 2 + } } } } }, - "MessageOptions": { + "SourceCodeInfo": { "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 - } - }, - "uninterpretedOption": { + "location": { "rule": "repeated", - "type": "UninterpretedOption", - "id": 999 + "type": "Location", + "id": 1 } }, - "extensions": [ - [ - 1000, - 536870911 - ] - ], - "reserved": [ - [ - 4, - 4 - ], - [ - 5, - 5 - ], - [ - 6, - 6 - ], - [ - 8, - 8 - ], - [ - 9, - 9 - ] - ] + "nested": { + "Location": { + "fields": { + "path": { + "rule": "repeated", + "type": "int32", + "id": 1 + }, + "span": { + "rule": "repeated", + "type": "int32", + "id": 2 + }, + "leadingComments": { + "type": "string", + "id": 3 + }, + "trailingComments": { + "type": "string", + "id": 4 + }, + "leadingDetachedComments": { + "rule": "repeated", + "type": "string", + "id": 6 + } + } + } + } }, - "FieldOptions": { + "GeneratedCodeInfo": { "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 - }, - "target": { - "type": "OptionTargetType", - "id": 18 - }, - "uninterpretedOption": { + "annotation": { "rule": "repeated", - "type": "UninterpretedOption", - "id": 999 + "type": "Annotation", + "id": 1 } }, - "extensions": [ - [ - 1000, - 536870911 - ] - ], - "reserved": [ - [ - 4, - 4 - ] - ], "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 + "Annotation": { + "fields": { + "path": { + "rule": "repeated", + "type": "int32", + "id": 1 + }, + "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 + } + } } } } }, - "OneofOptions": { + "Api": { "fields": { - "uninterpretedOption": { + "name": { + "type": "string", + "id": 1 + }, + "methods": { "rule": "repeated", - "type": "UninterpretedOption", - "id": 999 + "type": "Method", + "id": 2 + }, + "options": { + "rule": "repeated", + "type": "Option", + "id": 3 + }, + "version": { + "type": "string", + "id": 4 + }, + "sourceContext": { + "type": "SourceContext", + "id": 5 + }, + "mixins": { + "rule": "repeated", + "type": "Mixin", + "id": 6 + }, + "syntax": { + "type": "Syntax", + "id": 7 } - }, - "extensions": [ - [ - 1000, - 536870911 - ] - ] + } }, - "EnumOptions": { + "Method": { "fields": { - "allowAlias": { - "type": "bool", + "name": { + "type": "string", + "id": 1 + }, + "requestTypeUrl": { + "type": "string", "id": 2 }, - "deprecated": { + "requestStreaming": { "type": "bool", - "id": 3, - "options": { - "default": false - } + "id": 3 }, - "deprecatedLegacyJsonFieldConflicts": { + "responseTypeUrl": { + "type": "string", + "id": 4 + }, + "responseStreaming": { "type": "bool", - "id": 6, - "options": { - "deprecated": true - } + "id": 5 }, - "uninterpretedOption": { + "options": { "rule": "repeated", - "type": "UninterpretedOption", - "id": 999 + "type": "Option", + "id": 6 + }, + "syntax": { + "type": "Syntax", + "id": 7 } - }, - "extensions": [ - [ - 1000, - 536870911 - ] - ], - "reserved": [ - [ - 5, - 5 - ] - ] + } }, - "EnumValueOptions": { + "Mixin": { "fields": { - "deprecated": { - "type": "bool", - "id": 1, - "options": { - "default": false - } + "name": { + "type": "string", + "id": 1 }, - "uninterpretedOption": { - "rule": "repeated", - "type": "UninterpretedOption", - "id": 999 + "root": { + "type": "string", + "id": 2 } - }, - "extensions": [ - [ - 1000, - 536870911 - ] - ] + } }, - "ServiceOptions": { + "SourceContext": { "fields": { - "deprecated": { - "type": "bool", - "id": 33, - "options": { - "default": false - } + "fileName": { + "type": "string", + "id": 1 + } + } + }, + "Type": { + "fields": { + "name": { + "type": "string", + "id": 1 }, - "uninterpretedOption": { + "fields": { "rule": "repeated", - "type": "UninterpretedOption", - "id": 999 + "type": "Field", + "id": 2 + }, + "oneofs": { + "rule": "repeated", + "type": "string", + "id": 3 + }, + "options": { + "rule": "repeated", + "type": "Option", + "id": 4 + }, + "sourceContext": { + "type": "SourceContext", + "id": 5 + }, + "syntax": { + "type": "Syntax", + "id": 6 } - }, - "extensions": [ - [ - 1000, - 536870911 - ] - ] + } }, - "MethodOptions": { + "Field": { "fields": { - "deprecated": { - "type": "bool", - "id": 33, - "options": { - "default": false - } + "kind": { + "type": "Kind", + "id": 1 }, - "idempotencyLevel": { - "type": "IdempotencyLevel", - "id": 34, - "options": { - "default": "IDEMPOTENCY_UNKNOWN" - } + "cardinality": { + "type": "Cardinality", + "id": 2 }, - "uninterpretedOption": { + "number": { + "type": "int32", + "id": 3 + }, + "name": { + "type": "string", + "id": 4 + }, + "typeUrl": { + "type": "string", + "id": 6 + }, + "oneofIndex": { + "type": "int32", + "id": 7 + }, + "packed": { + "type": "bool", + "id": 8 + }, + "options": { "rule": "repeated", - "type": "UninterpretedOption", - "id": 999 + "type": "Option", + "id": 9 + }, + "jsonName": { + "type": "string", + "id": 10 + }, + "defaultValue": { + "type": "string", + "id": 11 } }, - "extensions": [ - [ - 1000, - 536870911 - ] - ], "nested": { - "IdempotencyLevel": { + "Kind": { + "values": { + "TYPE_UNKNOWN": 0, + "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 + } + }, + "Cardinality": { "values": { - "IDEMPOTENCY_UNKNOWN": 0, - "NO_SIDE_EFFECTS": 1, - "IDEMPOTENT": 2 + "CARDINALITY_UNKNOWN": 0, + "CARDINALITY_OPTIONAL": 1, + "CARDINALITY_REQUIRED": 2, + "CARDINALITY_REPEATED": 3 } } } }, - "UninterpretedOption": { + "Enum": { "fields": { "name": { + "type": "string", + "id": 1 + }, + "enumvalue": { "rule": "repeated", - "type": "NamePart", + "type": "EnumValue", "id": 2 }, - "identifierValue": { - "type": "string", + "options": { + "rule": "repeated", + "type": "Option", "id": 3 }, - "positiveIntValue": { - "type": "uint64", + "sourceContext": { + "type": "SourceContext", "id": 4 }, - "negativeIntValue": { - "type": "int64", + "syntax": { + "type": "Syntax", "id": 5 + } + } + }, + "EnumValue": { + "fields": { + "name": { + "type": "string", + "id": 1 }, - "doubleValue": { - "type": "double", - "id": 6 - }, - "stringValue": { - "type": "bytes", - "id": 7 + "number": { + "type": "int32", + "id": 2 }, - "aggregateValue": { - "type": "string", - "id": 8 - } - }, - "nested": { - "NamePart": { - "fields": { - "namePart": { - "rule": "required", - "type": "string", - "id": 1 - }, - "isExtension": { - "rule": "required", - "type": "bool", - "id": 2 - } - } + "options": { + "rule": "repeated", + "type": "Option", + "id": 3 } } }, - "SourceCodeInfo": { + "Option": { "fields": { - "location": { - "rule": "repeated", - "type": "Location", + "name": { + "type": "string", "id": 1 - } - }, - "nested": { - "Location": { - "fields": { - "path": { - "rule": "repeated", - "type": "int32", - "id": 1 - }, - "span": { - "rule": "repeated", - "type": "int32", - "id": 2 - }, - "leadingComments": { - "type": "string", - "id": 3 - }, - "trailingComments": { - "type": "string", - "id": 4 - }, - "leadingDetachedComments": { - "rule": "repeated", - "type": "string", - "id": 6 - } - } + }, + "value": { + "type": "Any", + "id": 2 } } }, - "GeneratedCodeInfo": { + "Syntax": { + "values": { + "SYNTAX_PROTO2": 0, + "SYNTAX_PROTO3": 1 + } + }, + "Any": { "fields": { - "annotation": { - "rule": "repeated", - "type": "Annotation", + "type_url": { + "type": "string", "id": 1 - } - }, - "nested": { - "Annotation": { - "fields": { - "path": { - "rule": "repeated", - "type": "int32", - "id": 1 - }, - "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 - } - } - } + }, + "value": { + "type": "bytes", + "id": 2 } } }, @@ -1347,7 +1347,7 @@ "options": { "go_package": "google.golang.org/genproto/googleapis/api/annotations;annotations", "java_multiple_files": true, - "java_outer_classname": "ClientProto", + "java_outer_classname": "FieldBehaviorProto", "java_package": "com.google.api", "objc_class_prefix": "GAPI", "cc_enable_arenas": true @@ -1367,6 +1367,10 @@ }, "nested": { "Service": { + "options": { + "(google.api.resource).type": "serviceusage.googleapis.com/Service", + "(google.api.resource).pattern": "organizations/{organization}/services/{service}" + }, "fields": { "name": { "type": "string", @@ -1876,6 +1880,11 @@ "rule": "repeated", "type": "QuotaBucket", "id": 9 + }, + "supportedLocations": { + "rule": "repeated", + "type": "string", + "id": 11 } } }, @@ -1908,6 +1917,10 @@ "type": "QuotaOverride", "id": 5 }, + "producerQuotaPolicy": { + "type": "ProducerQuotaPolicy", + "id": 7 + }, "dimensions": { "keyType": "string", "type": "string", @@ -1960,6 +1973,35 @@ "LIMIT_DECREASE_PERCENTAGE_TOO_HIGH": 2 } }, + "ProducerQuotaPolicy": { + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "policyValue": { + "type": "int64", + "id": 2 + }, + "dimensions": { + "keyType": "string", + "type": "string", + "id": 3 + }, + "metric": { + "type": "string", + "id": 4 + }, + "unit": { + "type": "string", + "id": 5 + }, + "container": { + "type": "string", + "id": 6 + } + } + }, "AdminQuotaPolicy": { "fields": { "name": { @@ -3267,6 +3309,83 @@ } } }, + "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 + } + } + }, "Usage": { "fields": { "requirements": { @@ -3633,6 +3752,24 @@ "GITHUB": 10, "PACKAGE_MANAGER": 20 } + }, + "fieldBehavior": { + "rule": "repeated", + "type": "google.api.FieldBehavior", + "id": 1052, + "extend": "google.protobuf.FieldOptions" + }, + "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 + } } } }, diff --git a/packages/google-api-serviceusage/samples/generated/v1/snippet_metadata.google.api.serviceusage.v1.json b/packages/google-api-serviceusage/samples/generated/v1/snippet_metadata.google.api.serviceusage.v1.json index fff6b870715..d82f9539de2 100644 --- a/packages/google-api-serviceusage/samples/generated/v1/snippet_metadata.google.api.serviceusage.v1.json +++ b/packages/google-api-serviceusage/samples/generated/v1/snippet_metadata.google.api.serviceusage.v1.json @@ -1,7 +1,7 @@ { "clientLibrary": { "name": "nodejs-serviceusage", - "version": "3.0.1", + "version": "3.1.0", "language": "TYPESCRIPT", "apis": [ { diff --git a/packages/google-api-serviceusage/samples/generated/v1/snippet_metadata_google.api.serviceusage.v1.json b/packages/google-api-serviceusage/samples/generated/v1/snippet_metadata_google.api.serviceusage.v1.json index fff6b870715..d82f9539de2 100644 --- a/packages/google-api-serviceusage/samples/generated/v1/snippet_metadata_google.api.serviceusage.v1.json +++ b/packages/google-api-serviceusage/samples/generated/v1/snippet_metadata_google.api.serviceusage.v1.json @@ -1,7 +1,7 @@ { "clientLibrary": { "name": "nodejs-serviceusage", - "version": "3.0.1", + "version": "3.1.0", "language": "TYPESCRIPT", "apis": [ { diff --git a/packages/google-api-serviceusage/samples/generated/v1beta1/service_usage.generate_service_identity.js b/packages/google-api-serviceusage/samples/generated/v1beta1/service_usage.generate_service_identity.js index 0de8f65d05a..f1adc61af90 100644 --- a/packages/google-api-serviceusage/samples/generated/v1beta1/service_usage.generate_service_identity.js +++ b/packages/google-api-serviceusage/samples/generated/v1beta1/service_usage.generate_service_identity.js @@ -30,10 +30,12 @@ function main() { */ /** * Name of the consumer and service to generate an identity for. - * The `GenerateServiceIdentity` methods currently only support projects. - * An example name would be: - * `projects/123/services/example.googleapis.com` where `123` is the - * project number. + * The `GenerateServiceIdentity` methods currently support projects, folders, + * organizations. + * Example parents would be: + * `projects/123/services/example.googleapis.com` + * `folders/123/services/example.googleapis.com` + * `organizations/123/services/example.googleapis.com` */ // const parent = 'abc123' diff --git a/packages/google-api-serviceusage/samples/generated/v1beta1/snippet_metadata.google.api.serviceusage.v1beta1.json b/packages/google-api-serviceusage/samples/generated/v1beta1/snippet_metadata.google.api.serviceusage.v1beta1.json index 812195c9523..66da78fc9ab 100644 --- a/packages/google-api-serviceusage/samples/generated/v1beta1/snippet_metadata.google.api.serviceusage.v1beta1.json +++ b/packages/google-api-serviceusage/samples/generated/v1beta1/snippet_metadata.google.api.serviceusage.v1beta1.json @@ -1,7 +1,7 @@ { "clientLibrary": { "name": "nodejs-serviceusage", - "version": "3.0.1", + "version": "3.1.0", "language": "TYPESCRIPT", "apis": [ { diff --git a/packages/google-api-serviceusage/samples/generated/v1beta1/snippet_metadata_google.api.serviceusage.v1beta1.json b/packages/google-api-serviceusage/samples/generated/v1beta1/snippet_metadata_google.api.serviceusage.v1beta1.json index 812195c9523..4c687975f54 100644 --- a/packages/google-api-serviceusage/samples/generated/v1beta1/snippet_metadata_google.api.serviceusage.v1beta1.json +++ b/packages/google-api-serviceusage/samples/generated/v1beta1/snippet_metadata_google.api.serviceusage.v1beta1.json @@ -1,7 +1,7 @@ { "clientLibrary": { "name": "nodejs-serviceusage", - "version": "3.0.1", + "version": "3.1.0", "language": "TYPESCRIPT", "apis": [ { @@ -890,7 +890,7 @@ "segments": [ { "start": 25, - "end": 57, + "end": 59, "type": "FULL" } ], diff --git a/packages/google-api-serviceusage/samples/package.json b/packages/google-api-serviceusage/samples/package.json index 3a3e86293a9..0b7152e69ca 100644 --- a/packages/google-api-serviceusage/samples/package.json +++ b/packages/google-api-serviceusage/samples/package.json @@ -13,7 +13,7 @@ "test": "c8 mocha --timeout 600000 test/*.js" }, "dependencies": { - "@google-cloud/service-usage": "^3.0.1" + "@google-cloud/service-usage": "^3.1.0" }, "devDependencies": { "c8": "^7.1.0", diff --git a/packages/google-api-serviceusage/src/v1/service_usage_client.ts b/packages/google-api-serviceusage/src/v1/service_usage_client.ts index 165dc524ce0..d8ed44c1826 100644 --- a/packages/google-api-serviceusage/src/v1/service_usage_client.ts +++ b/packages/google-api-serviceusage/src/v1/service_usage_client.ts @@ -65,6 +65,7 @@ export class ServiceUsageClient { }; warn: (code: string, message: string, warnType?: string) => void; innerApiCalls: {[name: string]: Function}; + pathTemplates: {[name: string]: gax.PathTemplate}; operationsClient: gax.OperationsClient; serviceUsageStub?: Promise<{[name: string]: Function}>; @@ -179,6 +180,21 @@ export class ServiceUsageClient { // 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 = { + folderServicePathTemplate: new this._gaxModule.PathTemplate( + 'folders/{folder}/services/{service}' + ), + organizationServicePathTemplate: new this._gaxModule.PathTemplate( + 'organizations/{organization}/services/{service}' + ), + projectServicePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/services/{service}' + ), + }; + // 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. @@ -1270,6 +1286,304 @@ export class ServiceUsageClient { callSettings ) as AsyncIterable; } + /** + * 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, + options?: + | 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]> { + 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 { + 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, + options?: + | gax.CallOptions + | Callback< + protos.google.protobuf.Empty, + protos.google.longrunning.CancelOperationRequest, + {} | undefined | null + >, + callback?: Callback< + protos.google.longrunning.CancelOperationRequest, + protos.google.protobuf.Empty, + {} | undefined | null + > + ): Promise { + 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, + options?: + | 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 { + return this.operationsClient.deleteOperation(request, options, callback); + } + + // -------------------- + // -- Path templates -- + // -------------------- + + /** + * Return a fully-qualified folderService resource name string. + * + * @param {string} folder + * @param {string} service + * @returns {string} Resource name string. + */ + folderServicePath(folder: string, service: string) { + return this.pathTemplates.folderServicePathTemplate.render({ + folder: folder, + service: service, + }); + } + + /** + * Parse the folder from FolderService resource. + * + * @param {string} folderServiceName + * A fully-qualified path representing folder_service resource. + * @returns {string} A string representing the folder. + */ + matchFolderFromFolderServiceName(folderServiceName: string) { + return this.pathTemplates.folderServicePathTemplate.match(folderServiceName) + .folder; + } + + /** + * Parse the service from FolderService resource. + * + * @param {string} folderServiceName + * A fully-qualified path representing folder_service resource. + * @returns {string} A string representing the service. + */ + matchServiceFromFolderServiceName(folderServiceName: string) { + return this.pathTemplates.folderServicePathTemplate.match(folderServiceName) + .service; + } + + /** + * Return a fully-qualified organizationService resource name string. + * + * @param {string} organization + * @param {string} service + * @returns {string} Resource name string. + */ + organizationServicePath(organization: string, service: string) { + return this.pathTemplates.organizationServicePathTemplate.render({ + organization: organization, + service: service, + }); + } + + /** + * Parse the organization from OrganizationService resource. + * + * @param {string} organizationServiceName + * A fully-qualified path representing organization_service resource. + * @returns {string} A string representing the organization. + */ + matchOrganizationFromOrganizationServiceName( + organizationServiceName: string + ) { + return this.pathTemplates.organizationServicePathTemplate.match( + organizationServiceName + ).organization; + } + + /** + * Parse the service from OrganizationService resource. + * + * @param {string} organizationServiceName + * A fully-qualified path representing organization_service resource. + * @returns {string} A string representing the service. + */ + matchServiceFromOrganizationServiceName(organizationServiceName: string) { + return this.pathTemplates.organizationServicePathTemplate.match( + organizationServiceName + ).service; + } + + /** + * Return a fully-qualified projectService resource name string. + * + * @param {string} project + * @param {string} service + * @returns {string} Resource name string. + */ + projectServicePath(project: string, service: string) { + return this.pathTemplates.projectServicePathTemplate.render({ + project: project, + service: service, + }); + } + + /** + * Parse the project from ProjectService resource. + * + * @param {string} projectServiceName + * A fully-qualified path representing project_service resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectServiceName(projectServiceName: string) { + return this.pathTemplates.projectServicePathTemplate.match( + projectServiceName + ).project; + } + + /** + * Parse the service from ProjectService resource. + * + * @param {string} projectServiceName + * A fully-qualified path representing project_service resource. + * @returns {string} A string representing the service. + */ + matchServiceFromProjectServiceName(projectServiceName: string) { + return this.pathTemplates.projectServicePathTemplate.match( + projectServiceName + ).service; + } /** * Terminate the gRPC channel and close the client. diff --git a/packages/google-api-serviceusage/src/v1beta1/service_usage_client.ts b/packages/google-api-serviceusage/src/v1beta1/service_usage_client.ts index ea62bc06a68..8e7640d73a8 100644 --- a/packages/google-api-serviceusage/src/v1beta1/service_usage_client.ts +++ b/packages/google-api-serviceusage/src/v1beta1/service_usage_client.ts @@ -2585,11 +2585,13 @@ export class ServiceUsageClient { * @param {string} request.parent * Name of the consumer and service to generate an identity for. * - * The `GenerateServiceIdentity` methods currently only support projects. + * The `GenerateServiceIdentity` methods currently support projects, folders, + * organizations. * - * An example name would be: - * `projects/123/services/example.googleapis.com` where `123` is the - * project number. + * Example parents would be: + * `projects/123/services/example.googleapis.com` + * `folders/123/services/example.googleapis.com` + * `organizations/123/services/example.googleapis.com` * @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. @@ -3583,6 +3585,180 @@ export class ServiceUsageClient { callSettings ) as AsyncIterable; } + /** + * 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, + options?: + | 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]> { + 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 { + 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, + options?: + | gax.CallOptions + | Callback< + protos.google.protobuf.Empty, + protos.google.longrunning.CancelOperationRequest, + {} | undefined | null + >, + callback?: Callback< + protos.google.longrunning.CancelOperationRequest, + protos.google.protobuf.Empty, + {} | undefined | null + > + ): Promise { + 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, + options?: + | 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 { + return this.operationsClient.deleteOperation(request, options, callback); + } /** * Terminate the gRPC channel and close the client. diff --git a/packages/google-api-serviceusage/test/gapic_service_usage_v1.ts b/packages/google-api-serviceusage/test/gapic_service_usage_v1.ts index cd7ad310dfd..e9fccb2d653 100644 --- a/packages/google-api-serviceusage/test/gapic_service_usage_v1.ts +++ b/packages/google-api-serviceusage/test/gapic_service_usage_v1.ts @@ -1401,4 +1401,474 @@ describe('v1.ServiceUsageClient', () => { ); }); }); + describe('getOperation', () => { + it('invokes getOperation without error', async () => { + const client = new serviceusageModule.v1.ServiceUsageClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + 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 serviceusageModule.v1.ServiceUsageClient({ + 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); + } + } + ); + }); + 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 serviceusageModule.v1.ServiceUsageClient({ + 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 serviceusageModule.v1.ServiceUsageClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + 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 serviceusageModule.v1.ServiceUsageClient({ + 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); + } + } + ); + }); + 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 serviceusageModule.v1.ServiceUsageClient({ + 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 serviceusageModule.v1.ServiceUsageClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + 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 serviceusageModule.v1.ServiceUsageClient({ + 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); + } + } + ); + }); + 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 serviceusageModule.v1.ServiceUsageClient({ + 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 serviceusageModule.v1.ServiceUsageClient({ + 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.ListOperationsResponse[] = + []; + 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 serviceusageModule.v1.ServiceUsageClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + 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.ListOperationsResponse[] = + []; + 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('folderService', () => { + const fakePath = '/rendered/path/folderService'; + const expectedParameters = { + folder: 'folderValue', + service: 'serviceValue', + }; + const client = new serviceusageModule.v1.ServiceUsageClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.folderServicePathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.folderServicePathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('folderServicePath', () => { + const result = client.folderServicePath('folderValue', 'serviceValue'); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.folderServicePathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchFolderFromFolderServiceName', () => { + const result = client.matchFolderFromFolderServiceName(fakePath); + assert.strictEqual(result, 'folderValue'); + assert( + (client.pathTemplates.folderServicePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchServiceFromFolderServiceName', () => { + const result = client.matchServiceFromFolderServiceName(fakePath); + assert.strictEqual(result, 'serviceValue'); + assert( + (client.pathTemplates.folderServicePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('organizationService', () => { + const fakePath = '/rendered/path/organizationService'; + const expectedParameters = { + organization: 'organizationValue', + service: 'serviceValue', + }; + const client = new serviceusageModule.v1.ServiceUsageClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.organizationServicePathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.organizationServicePathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('organizationServicePath', () => { + const result = client.organizationServicePath( + 'organizationValue', + 'serviceValue' + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates.organizationServicePathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchOrganizationFromOrganizationServiceName', () => { + const result = + client.matchOrganizationFromOrganizationServiceName(fakePath); + assert.strictEqual(result, 'organizationValue'); + assert( + ( + client.pathTemplates.organizationServicePathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchServiceFromOrganizationServiceName', () => { + const result = client.matchServiceFromOrganizationServiceName(fakePath); + assert.strictEqual(result, 'serviceValue'); + assert( + ( + client.pathTemplates.organizationServicePathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('projectService', () => { + const fakePath = '/rendered/path/projectService'; + const expectedParameters = { + project: 'projectValue', + service: 'serviceValue', + }; + const client = new serviceusageModule.v1.ServiceUsageClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.projectServicePathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.projectServicePathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('projectServicePath', () => { + const result = client.projectServicePath( + 'projectValue', + 'serviceValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.projectServicePathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromProjectServiceName', () => { + const result = client.matchProjectFromProjectServiceName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.projectServicePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchServiceFromProjectServiceName', () => { + const result = client.matchServiceFromProjectServiceName(fakePath); + assert.strictEqual(result, 'serviceValue'); + assert( + (client.pathTemplates.projectServicePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + }); }); diff --git a/packages/google-api-serviceusage/test/gapic_service_usage_v1beta1.ts b/packages/google-api-serviceusage/test/gapic_service_usage_v1beta1.ts index 1d7c8c9b17c..7f91b611a47 100644 --- a/packages/google-api-serviceusage/test/gapic_service_usage_v1beta1.ts +++ b/packages/google-api-serviceusage/test/gapic_service_usage_v1beta1.ts @@ -4438,4 +4438,309 @@ describe('v1beta1.ServiceUsageClient', () => { ); }); }); + describe('getOperation', () => { + it('invokes getOperation without error', async () => { + const client = new serviceusageModule.v1beta1.ServiceUsageClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + 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 serviceusageModule.v1beta1.ServiceUsageClient({ + 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); + } + } + ); + }); + 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 serviceusageModule.v1beta1.ServiceUsageClient({ + 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 serviceusageModule.v1beta1.ServiceUsageClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + 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 serviceusageModule.v1beta1.ServiceUsageClient({ + 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); + } + } + ); + }); + 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 serviceusageModule.v1beta1.ServiceUsageClient({ + 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 serviceusageModule.v1beta1.ServiceUsageClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + 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 serviceusageModule.v1beta1.ServiceUsageClient({ + 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); + } + } + ); + }); + 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 serviceusageModule.v1beta1.ServiceUsageClient({ + 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 serviceusageModule.v1beta1.ServiceUsageClient({ + 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.ListOperationsResponse[] = + []; + 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 serviceusageModule.v1beta1.ServiceUsageClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + 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.ListOperationsResponse[] = + []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + ( + client.operationsClient.descriptor.listOperations + .asyncIterate as SinonStub + ).getCall(0).args[1], + request + ); + }); + }); }); diff --git a/packages/google-cloud-aiplatform/CHANGELOG.md b/packages/google-cloud-aiplatform/CHANGELOG.md index d44766948bc..fdff3ffd6f9 100644 --- a/packages/google-cloud-aiplatform/CHANGELOG.md +++ b/packages/google-cloud-aiplatform/CHANGELOG.md @@ -1,5 +1,12 @@ # Changelog +## [3.2.0](https://github.com/googleapis/google-cloud-node/compare/aiplatform-v3.1.0...aiplatform-v3.2.0) (2023-09-11) + + +### Features + +* Add encryption_spec to index.proto and index_endpoint.proto ([#4596](https://github.com/googleapis/google-cloud-node/issues/4596)) ([32d823a](https://github.com/googleapis/google-cloud-node/commit/32d823a8ea1613ebb653978a7cd0686f9af2724b)) + ## [3.1.0](https://github.com/googleapis/google-cloud-node/compare/aiplatform-v3.0.0...aiplatform-v3.1.0) (2023-09-06) diff --git a/packages/google-cloud-aiplatform/README.md b/packages/google-cloud-aiplatform/README.md index d301d8bacf7..d4fe8e6554b 100644 --- a/packages/google-cloud-aiplatform/README.md +++ b/packages/google-cloud-aiplatform/README.md @@ -482,6 +482,7 @@ Samples are in the [`samples/`](https://github.com/googleapis/google-cloud-node/ | Persistent_resource_service.delete_persistent_resource | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-aiplatform/samples/generated/v1beta1/persistent_resource_service.delete_persistent_resource.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-cloud-aiplatform/samples/generated/v1beta1/persistent_resource_service.delete_persistent_resource.js,packages/google-cloud-aiplatform/samples/README.md) | | Persistent_resource_service.get_persistent_resource | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-aiplatform/samples/generated/v1beta1/persistent_resource_service.get_persistent_resource.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-cloud-aiplatform/samples/generated/v1beta1/persistent_resource_service.get_persistent_resource.js,packages/google-cloud-aiplatform/samples/README.md) | | Persistent_resource_service.list_persistent_resources | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-aiplatform/samples/generated/v1beta1/persistent_resource_service.list_persistent_resources.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-cloud-aiplatform/samples/generated/v1beta1/persistent_resource_service.list_persistent_resources.js,packages/google-cloud-aiplatform/samples/README.md) | +| Persistent_resource_service.update_persistent_resource | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-aiplatform/samples/generated/v1beta1/persistent_resource_service.update_persistent_resource.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-cloud-aiplatform/samples/generated/v1beta1/persistent_resource_service.update_persistent_resource.js,packages/google-cloud-aiplatform/samples/README.md) | | Pipeline_service.cancel_pipeline_job | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-aiplatform/samples/generated/v1beta1/pipeline_service.cancel_pipeline_job.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-cloud-aiplatform/samples/generated/v1beta1/pipeline_service.cancel_pipeline_job.js,packages/google-cloud-aiplatform/samples/README.md) | | Pipeline_service.cancel_training_pipeline | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-aiplatform/samples/generated/v1beta1/pipeline_service.cancel_training_pipeline.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-cloud-aiplatform/samples/generated/v1beta1/pipeline_service.cancel_training_pipeline.js,packages/google-cloud-aiplatform/samples/README.md) | | Pipeline_service.create_pipeline_job | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-aiplatform/samples/generated/v1beta1/pipeline_service.create_pipeline_job.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-cloud-aiplatform/samples/generated/v1beta1/pipeline_service.create_pipeline_job.js,packages/google-cloud-aiplatform/samples/README.md) | diff --git a/packages/google-cloud-aiplatform/package.json b/packages/google-cloud-aiplatform/package.json index 2f16301455e..94d404bcef0 100644 --- a/packages/google-cloud-aiplatform/package.json +++ b/packages/google-cloud-aiplatform/package.json @@ -1,6 +1,6 @@ { "name": "@google-cloud/aiplatform", - "version": "3.1.0", + "version": "3.2.0", "description": "Vertex AI client for Node.js", "repository": { "type": "git", diff --git a/packages/google-cloud-aiplatform/protos/google/cloud/aiplatform/v1/endpoint_service.proto b/packages/google-cloud-aiplatform/protos/google/cloud/aiplatform/v1/endpoint_service.proto index 6ac193dabf8..c1bd96271d9 100644 --- a/packages/google-cloud-aiplatform/protos/google/cloud/aiplatform/v1/endpoint_service.proto +++ b/packages/google-cloud-aiplatform/protos/google/cloud/aiplatform/v1/endpoint_service.proto @@ -220,6 +220,7 @@ message ListEndpointsRequest { // * A key including a space must be quoted. `labels."a key"`. // // Some examples: + // // * `endpoint=1` // * `displayName="myDisplayName"` // * `labels.myKey="myValue"` @@ -243,6 +244,7 @@ message ListEndpointsRequest { // A comma-separated list of fields to order by, sorted in ascending order. // Use "desc" after a field name for descending. // Supported fields: + // // * `display_name` // * `create_time` // * `update_time` diff --git a/packages/google-cloud-aiplatform/protos/google/cloud/aiplatform/v1/index.proto b/packages/google-cloud-aiplatform/protos/google/cloud/aiplatform/v1/index.proto index 6f21672aa48..192a8d53bcf 100644 --- a/packages/google-cloud-aiplatform/protos/google/cloud/aiplatform/v1/index.proto +++ b/packages/google-cloud-aiplatform/protos/google/cloud/aiplatform/v1/index.proto @@ -19,6 +19,7 @@ package google.cloud.aiplatform.v1; import "google/api/field_behavior.proto"; import "google/api/resource.proto"; import "google/cloud/aiplatform/v1/deployed_index_ref.proto"; +import "google/cloud/aiplatform/v1/encryption_spec.proto"; import "google/protobuf/struct.proto"; import "google/protobuf/timestamp.proto"; @@ -120,6 +121,10 @@ message Index { // BATCH_UPDATE will be used by default. IndexUpdateMethod index_update_method = 16 [(google.api.field_behavior) = IMMUTABLE]; + + // Immutable. Customer-managed encryption key spec for an Index. If set, this + // Index and all sub-resources of this Index will be secured by this key. + EncryptionSpec encryption_spec = 17 [(google.api.field_behavior) = IMMUTABLE]; } // A datapoint of Index. diff --git a/packages/google-cloud-aiplatform/protos/google/cloud/aiplatform/v1/index_endpoint.proto b/packages/google-cloud-aiplatform/protos/google/cloud/aiplatform/v1/index_endpoint.proto index 49a30b966aa..89672421d00 100644 --- a/packages/google-cloud-aiplatform/protos/google/cloud/aiplatform/v1/index_endpoint.proto +++ b/packages/google-cloud-aiplatform/protos/google/cloud/aiplatform/v1/index_endpoint.proto @@ -18,6 +18,7 @@ package google.cloud.aiplatform.v1; import "google/api/field_behavior.proto"; import "google/api/resource.proto"; +import "google/cloud/aiplatform/v1/encryption_spec.proto"; import "google/cloud/aiplatform/v1/machine_resources.proto"; import "google/cloud/aiplatform/v1/service_networking.proto"; import "google/protobuf/timestamp.proto"; @@ -122,6 +123,11 @@ message IndexEndpoint { // index endpoint. string public_endpoint_domain_name = 14 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Immutable. Customer-managed encryption key spec for an IndexEndpoint. If + // set, this IndexEndpoint and all sub-resources of this IndexEndpoint will be + // secured by this key. + EncryptionSpec encryption_spec = 15 [(google.api.field_behavior) = IMMUTABLE]; } // A deployment of an Index. IndexEndpoints contain one or more DeployedIndexes. diff --git a/packages/google-cloud-aiplatform/protos/google/cloud/aiplatform/v1/study.proto b/packages/google-cloud-aiplatform/protos/google/cloud/aiplatform/v1/study.proto index 5f998a027f1..d4e33d3f678 100644 --- a/packages/google-cloud-aiplatform/protos/google/cloud/aiplatform/v1/study.proto +++ b/packages/google-cloud-aiplatform/protos/google/cloud/aiplatform/v1/study.proto @@ -195,6 +195,24 @@ message Trial { [(google.api.field_behavior) = OUTPUT_ONLY]; } +// Next ID: 3 +message TrialContext { + // A human-readable field which can store a description of this context. + // This will become part of the resulting Trial's description field. + string description = 1; + + // If/when a Trial is generated or selected from this Context, + // its Parameters will match any parameters specified here. + // (I.e. if this context specifies parameter name:'a' int_value:3, + // then a resulting Trial will have int_value:3 for its parameter named + // 'a'.) Note that we first attempt to match existing REQUESTED Trials with + // contexts, and if there are no matches, we generate suggestions in the + // subspace defined by the parameters specified here. + // NOTE: a Context without any Parameters matches the entire feasible search + // space. + repeated Trial.Parameter parameters = 2; +} + // Represents specification of a Study. message StudySpec { // Represents a metric to optimize. diff --git a/packages/google-cloud-aiplatform/protos/google/cloud/aiplatform/v1/vizier_service.proto b/packages/google-cloud-aiplatform/protos/google/cloud/aiplatform/v1/vizier_service.proto index e45b733f0ae..60465ee96b9 100644 --- a/packages/google-cloud-aiplatform/protos/google/cloud/aiplatform/v1/vizier_service.proto +++ b/packages/google-cloud-aiplatform/protos/google/cloud/aiplatform/v1/vizier_service.proto @@ -306,6 +306,44 @@ message SuggestTrialsRequest { // the service will return the identical suggested Trial if the Trial is // pending, and provide a new Trial if the last suggested Trial was completed. string client_id = 3 [(google.api.field_behavior) = REQUIRED]; + + // Optional. This allows you to specify the "context" for a Trial; a context + // is a slice (a subspace) of the search space. + // + // Typical uses for contexts: + // 1) You are using Vizier to tune a server for best performance, but there's + // a strong weekly cycle. The context specifies the day-of-week. + // This allows Tuesday to generalize from Wednesday without assuming that + // everything is identical. + // 2) Imagine you're optimizing some medical treatment for people. + // As they walk in the door, you know certain facts about them + // (e.g. sex, weight, height, blood-pressure). Put that information in the + // context, and Vizier will adapt its suggestions to the patient. + // 3) You want to do a fair A/B test efficiently. Specify the "A" and "B" + // conditions as contexts, and Vizier will generalize between "A" and "B" + // conditions. If they are similar, this will allow Vizier to converge + // to the optimum faster than if "A" and "B" were separate Studies. + // NOTE: You can also enter contexts as REQUESTED Trials, e.g. via the + // CreateTrial() RPC; that's the asynchronous option where you don't need a + // close association between contexts and suggestions. + // + // NOTE: All the Parameters you set in a context MUST be defined in the + // Study. + // NOTE: You must supply 0 or $suggestion_count contexts. + // If you don't supply any contexts, Vizier will make suggestions + // from the full search space specified in the StudySpec; if you supply + // a full set of context, each suggestion will match the corresponding + // context. + // NOTE: A Context with no features set matches anything, and allows + // suggestions from the full search space. + // NOTE: Contexts MUST lie within the search space specified in the + // StudySpec. It's an error if they don't. + // NOTE: Contexts preferentially match ACTIVE then REQUESTED trials before + // new suggestions are generated. + // NOTE: Generation of suggestions involves a match between a Context and + // (optionally) a REQUESTED trial; if that match is not fully specified, a + // suggestion will be geneated in the merged subspace. + repeated TrialContext contexts = 4 [(google.api.field_behavior) = OPTIONAL]; } // Response message for diff --git a/packages/google-cloud-aiplatform/protos/google/cloud/aiplatform/v1beta1/index.proto b/packages/google-cloud-aiplatform/protos/google/cloud/aiplatform/v1beta1/index.proto index bd37178673b..5799c03e662 100644 --- a/packages/google-cloud-aiplatform/protos/google/cloud/aiplatform/v1beta1/index.proto +++ b/packages/google-cloud-aiplatform/protos/google/cloud/aiplatform/v1beta1/index.proto @@ -19,6 +19,7 @@ package google.cloud.aiplatform.v1beta1; import "google/api/field_behavior.proto"; import "google/api/resource.proto"; import "google/cloud/aiplatform/v1beta1/deployed_index_ref.proto"; +import "google/cloud/aiplatform/v1beta1/encryption_spec.proto"; import "google/protobuf/struct.proto"; import "google/protobuf/timestamp.proto"; @@ -120,6 +121,10 @@ message Index { // BATCH_UPDATE will be used by default. IndexUpdateMethod index_update_method = 16 [(google.api.field_behavior) = IMMUTABLE]; + + // Immutable. Customer-managed encryption key spec for an Index. If set, this + // Index and all sub-resources of this Index will be secured by this key. + EncryptionSpec encryption_spec = 17 [(google.api.field_behavior) = IMMUTABLE]; } // A datapoint of Index. diff --git a/packages/google-cloud-aiplatform/protos/google/cloud/aiplatform/v1beta1/index_endpoint.proto b/packages/google-cloud-aiplatform/protos/google/cloud/aiplatform/v1beta1/index_endpoint.proto index 14af3b80940..dbc652abf32 100644 --- a/packages/google-cloud-aiplatform/protos/google/cloud/aiplatform/v1beta1/index_endpoint.proto +++ b/packages/google-cloud-aiplatform/protos/google/cloud/aiplatform/v1beta1/index_endpoint.proto @@ -18,6 +18,7 @@ package google.cloud.aiplatform.v1beta1; import "google/api/field_behavior.proto"; import "google/api/resource.proto"; +import "google/cloud/aiplatform/v1beta1/encryption_spec.proto"; import "google/cloud/aiplatform/v1beta1/machine_resources.proto"; import "google/cloud/aiplatform/v1beta1/service_networking.proto"; import "google/protobuf/timestamp.proto"; @@ -122,6 +123,11 @@ message IndexEndpoint { // index endpoint. string public_endpoint_domain_name = 14 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Immutable. Customer-managed encryption key spec for an IndexEndpoint. If + // set, this IndexEndpoint and all sub-resources of this IndexEndpoint will be + // secured by this key. + EncryptionSpec encryption_spec = 15 [(google.api.field_behavior) = IMMUTABLE]; } // A deployment of an Index. IndexEndpoints contain one or more DeployedIndexes. diff --git a/packages/google-cloud-aiplatform/protos/google/cloud/aiplatform/v1beta1/persistent_resource.proto b/packages/google-cloud-aiplatform/protos/google/cloud/aiplatform/v1beta1/persistent_resource.proto index e97c6865ef9..5cc2b3bf61d 100644 --- a/packages/google-cloud-aiplatform/protos/google/cloud/aiplatform/v1beta1/persistent_resource.proto +++ b/packages/google-cloud-aiplatform/protos/google/cloud/aiplatform/v1beta1/persistent_resource.proto @@ -217,6 +217,25 @@ message RaySpec { // you need all the resource pools to have the same Ray image, Otherwise, use // the {@code resource_pool_images} field. string image_uri = 1 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Required if image_uri is not set. A map of resource_pool_id to + // prebuild Ray image if user need to use different images for different + // head/worker pools. This map needs to cover all the resource pool ids. + // Example: + // { + // "ray_head_node_pool": "head image" + // "ray_worker_node_pool1": "worker image" + // "ray_worker_node_pool2": "another worker image" + // } + map resource_pool_images = 6 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. This will be used to indicate which resource pool will serve as + // the Ray head node(the first node within that pool). Will use the machine + // from the first workerpool as the head node by default if this field is not + // set. + string head_node_resource_pool_id = 7 + [(google.api.field_behavior) = OPTIONAL]; } // Persistent Cluster runtime information as output diff --git a/packages/google-cloud-aiplatform/protos/google/cloud/aiplatform/v1beta1/persistent_resource_service.proto b/packages/google-cloud-aiplatform/protos/google/cloud/aiplatform/v1beta1/persistent_resource_service.proto index d610cb40f8d..0da3cb87783 100644 --- a/packages/google-cloud-aiplatform/protos/google/cloud/aiplatform/v1beta1/persistent_resource_service.proto +++ b/packages/google-cloud-aiplatform/protos/google/cloud/aiplatform/v1beta1/persistent_resource_service.proto @@ -24,6 +24,7 @@ import "google/cloud/aiplatform/v1beta1/operation.proto"; import "google/cloud/aiplatform/v1beta1/persistent_resource.proto"; import "google/longrunning/operations.proto"; import "google/protobuf/empty.proto"; +import "google/protobuf/field_mask.proto"; option csharp_namespace = "Google.Cloud.AIPlatform.V1Beta1"; option go_package = "cloud.google.com/go/aiplatform/apiv1beta1/aiplatformpb;aiplatformpb"; @@ -84,6 +85,20 @@ service PersistentResourceService { metadata_type: "DeleteOperationMetadata" }; } + + // Updates a PersistentResource. + rpc UpdatePersistentResource(UpdatePersistentResourceRequest) + returns (google.longrunning.Operation) { + option (google.api.http) = { + patch: "/v1beta1/{persistent_resource.name=projects/*/locations/*/persistentResources/*}" + body: "persistent_resource" + }; + option (google.api.method_signature) = "persistent_resource,update_mask"; + option (google.longrunning.operation_info) = { + response_type: "PersistentResource" + metadata_type: "UpdatePersistentResourceOperationMetadata" + }; + } } // Request message for @@ -116,6 +131,12 @@ message CreatePersistentResourceOperationMetadata { GenericOperationMetadata generic_metadata = 1; } +// Details of operations that perform update PersistentResource. +message UpdatePersistentResourceOperationMetadata { + // Operation metadata for PersistentResource. + GenericOperationMetadata generic_metadata = 1; +} + // Request message for // [PersistentResourceService.GetPersistentResource][google.cloud.aiplatform.v1beta1.PersistentResourceService.GetPersistentResource]. message GetPersistentResourceRequest { @@ -176,3 +197,19 @@ message DeletePersistentResourceRequest { } ]; } + +// Request message for UpdatePersistentResource method. +message UpdatePersistentResourceRequest { + // Required. The PersistentResource to update. + // + // The PersistentResource's `name` field is used to identify the + // PersistentResource to update. Format: + // `projects/{project}/locations/{location}/persistentResources/{persistent_resource}` + PersistentResource persistent_resource = 1 + [(google.api.field_behavior) = REQUIRED]; + + // Required. Specify the fields to be overwritten in the PersistentResource by + // the update method. + google.protobuf.FieldMask update_mask = 2 + [(google.api.field_behavior) = REQUIRED]; +} diff --git a/packages/google-cloud-aiplatform/protos/google/cloud/aiplatform/v1beta1/study.proto b/packages/google-cloud-aiplatform/protos/google/cloud/aiplatform/v1beta1/study.proto index 46a85557113..1075216a6c2 100644 --- a/packages/google-cloud-aiplatform/protos/google/cloud/aiplatform/v1beta1/study.proto +++ b/packages/google-cloud-aiplatform/protos/google/cloud/aiplatform/v1beta1/study.proto @@ -195,6 +195,24 @@ message Trial { [(google.api.field_behavior) = OUTPUT_ONLY]; } +// Next ID: 3 +message TrialContext { + // A human-readable field which can store a description of this context. + // This will become part of the resulting Trial's description field. + string description = 1; + + // If/when a Trial is generated or selected from this Context, + // its Parameters will match any parameters specified here. + // (I.e. if this context specifies parameter name:'a' int_value:3, + // then a resulting Trial will have int_value:3 for its parameter named + // 'a'.) Note that we first attempt to match existing REQUESTED Trials with + // contexts, and if there are no matches, we generate suggestions in the + // subspace defined by the parameters specified here. + // NOTE: a Context without any Parameters matches the entire feasible search + // space. + repeated Trial.Parameter parameters = 2; +} + // Represents specification of a Study. message StudySpec { // Represents a metric to optimize. diff --git a/packages/google-cloud-aiplatform/protos/google/cloud/aiplatform/v1beta1/vizier_service.proto b/packages/google-cloud-aiplatform/protos/google/cloud/aiplatform/v1beta1/vizier_service.proto index 7936b1af9e2..af0d3e616ce 100644 --- a/packages/google-cloud-aiplatform/protos/google/cloud/aiplatform/v1beta1/vizier_service.proto +++ b/packages/google-cloud-aiplatform/protos/google/cloud/aiplatform/v1beta1/vizier_service.proto @@ -306,6 +306,44 @@ message SuggestTrialsRequest { // the service will return the identical suggested Trial if the Trial is // pending, and provide a new Trial if the last suggested Trial was completed. string client_id = 3 [(google.api.field_behavior) = REQUIRED]; + + // Optional. This allows you to specify the "context" for a Trial; a context + // is a slice (a subspace) of the search space. + // + // Typical uses for contexts: + // 1) You are using Vizier to tune a server for best performance, but there's + // a strong weekly cycle. The context specifies the day-of-week. + // This allows Tuesday to generalize from Wednesday without assuming that + // everything is identical. + // 2) Imagine you're optimizing some medical treatment for people. + // As they walk in the door, you know certain facts about them + // (e.g. sex, weight, height, blood-pressure). Put that information in the + // context, and Vizier will adapt its suggestions to the patient. + // 3) You want to do a fair A/B test efficiently. Specify the "A" and "B" + // conditions as contexts, and Vizier will generalize between "A" and "B" + // conditions. If they are similar, this will allow Vizier to converge + // to the optimum faster than if "A" and "B" were separate Studies. + // NOTE: You can also enter contexts as REQUESTED Trials, e.g. via the + // CreateTrial() RPC; that's the asynchronous option where you don't need a + // close association between contexts and suggestions. + // + // NOTE: All the Parameters you set in a context MUST be defined in the + // Study. + // NOTE: You must supply 0 or $suggestion_count contexts. + // If you don't supply any contexts, Vizier will make suggestions + // from the full search space specified in the StudySpec; if you supply + // a full set of context, each suggestion will match the corresponding + // context. + // NOTE: A Context with no features set matches anything, and allows + // suggestions from the full search space. + // NOTE: Contexts MUST lie within the search space specified in the + // StudySpec. It's an error if they don't. + // NOTE: Contexts preferentially match ACTIVE then REQUESTED trials before + // new suggestions are generated. + // NOTE: Generation of suggestions involves a match between a Context and + // (optionally) a REQUESTED trial; if that match is not fully specified, a + // suggestion will be geneated in the merged subspace. + repeated TrialContext contexts = 4 [(google.api.field_behavior) = OPTIONAL]; } // Response message for diff --git a/packages/google-cloud-aiplatform/protos/protos.d.ts b/packages/google-cloud-aiplatform/protos/protos.d.ts index a5fe49770ad..0cd77d4109d 100644 --- a/packages/google-cloud-aiplatform/protos/protos.d.ts +++ b/packages/google-cloud-aiplatform/protos/protos.d.ts @@ -26787,6 +26787,109 @@ export namespace google { } } + /** Properties of a TrialContext. */ + interface ITrialContext { + + /** TrialContext description */ + description?: (string|null); + + /** TrialContext parameters */ + parameters?: (google.cloud.aiplatform.v1.Trial.IParameter[]|null); + } + + /** Represents a TrialContext. */ + class TrialContext implements ITrialContext { + + /** + * Constructs a new TrialContext. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.aiplatform.v1.ITrialContext); + + /** TrialContext description. */ + public description: string; + + /** TrialContext parameters. */ + public parameters: google.cloud.aiplatform.v1.Trial.IParameter[]; + + /** + * Creates a new TrialContext instance using the specified properties. + * @param [properties] Properties to set + * @returns TrialContext instance + */ + public static create(properties?: google.cloud.aiplatform.v1.ITrialContext): google.cloud.aiplatform.v1.TrialContext; + + /** + * Encodes the specified TrialContext message. Does not implicitly {@link google.cloud.aiplatform.v1.TrialContext.verify|verify} messages. + * @param message TrialContext message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.aiplatform.v1.ITrialContext, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified TrialContext message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1.TrialContext.verify|verify} messages. + * @param message TrialContext message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.aiplatform.v1.ITrialContext, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TrialContext message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns TrialContext + * @throws {Error} If the payload is not 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.aiplatform.v1.TrialContext; + + /** + * Decodes a TrialContext message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns TrialContext + * @throws {Error} If the payload 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.aiplatform.v1.TrialContext; + + /** + * Verifies a TrialContext message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a TrialContext message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns TrialContext + */ + public static fromObject(object: { [k: string]: any }): google.cloud.aiplatform.v1.TrialContext; + + /** + * Creates a plain object from a TrialContext message. Also converts values to other types if specified. + * @param message TrialContext + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.aiplatform.v1.TrialContext, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this TrialContext to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for TrialContext + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + /** Properties of a StudySpec. */ interface IStudySpec { @@ -28753,6 +28856,9 @@ export namespace google { /** Index indexUpdateMethod */ indexUpdateMethod?: (google.cloud.aiplatform.v1.Index.IndexUpdateMethod|keyof typeof google.cloud.aiplatform.v1.Index.IndexUpdateMethod|null); + + /** Index encryptionSpec */ + encryptionSpec?: (google.cloud.aiplatform.v1.IEncryptionSpec|null); } /** Represents an Index. */ @@ -28800,6 +28906,9 @@ export namespace google { /** Index indexUpdateMethod. */ public indexUpdateMethod: (google.cloud.aiplatform.v1.Index.IndexUpdateMethod|keyof typeof google.cloud.aiplatform.v1.Index.IndexUpdateMethod); + /** Index encryptionSpec. */ + public encryptionSpec?: (google.cloud.aiplatform.v1.IEncryptionSpec|null); + /** * Creates a new Index instance using the specified properties. * @param [properties] Properties to set @@ -29356,6 +29465,9 @@ export namespace google { /** IndexEndpoint publicEndpointDomainName */ publicEndpointDomainName?: (string|null); + + /** IndexEndpoint encryptionSpec */ + encryptionSpec?: (google.cloud.aiplatform.v1.IEncryptionSpec|null); } /** Represents an IndexEndpoint. */ @@ -29406,6 +29518,9 @@ export namespace google { /** IndexEndpoint publicEndpointDomainName. */ public publicEndpointDomainName: string; + /** IndexEndpoint encryptionSpec. */ + public encryptionSpec?: (google.cloud.aiplatform.v1.IEncryptionSpec|null); + /** * Creates a new IndexEndpoint instance using the specified properties. * @param [properties] Properties to set @@ -79030,6 +79145,9 @@ export namespace google { /** SuggestTrialsRequest clientId */ clientId?: (string|null); + + /** SuggestTrialsRequest contexts */ + contexts?: (google.cloud.aiplatform.v1.ITrialContext[]|null); } /** Represents a SuggestTrialsRequest. */ @@ -79050,6 +79168,9 @@ export namespace google { /** SuggestTrialsRequest clientId. */ public clientId: string; + /** SuggestTrialsRequest contexts. */ + public contexts: google.cloud.aiplatform.v1.ITrialContext[]; + /** * Creates a new SuggestTrialsRequest instance using the specified properties. * @param [properties] Properties to set @@ -110997,6 +111118,109 @@ export namespace google { } } + /** Properties of a TrialContext. */ + interface ITrialContext { + + /** TrialContext description */ + description?: (string|null); + + /** TrialContext parameters */ + parameters?: (google.cloud.aiplatform.v1beta1.Trial.IParameter[]|null); + } + + /** Represents a TrialContext. */ + class TrialContext implements ITrialContext { + + /** + * Constructs a new TrialContext. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.aiplatform.v1beta1.ITrialContext); + + /** TrialContext description. */ + public description: string; + + /** TrialContext parameters. */ + public parameters: google.cloud.aiplatform.v1beta1.Trial.IParameter[]; + + /** + * Creates a new TrialContext instance using the specified properties. + * @param [properties] Properties to set + * @returns TrialContext instance + */ + public static create(properties?: google.cloud.aiplatform.v1beta1.ITrialContext): google.cloud.aiplatform.v1beta1.TrialContext; + + /** + * Encodes the specified TrialContext message. Does not implicitly {@link google.cloud.aiplatform.v1beta1.TrialContext.verify|verify} messages. + * @param message TrialContext message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.aiplatform.v1beta1.ITrialContext, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified TrialContext message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1beta1.TrialContext.verify|verify} messages. + * @param message TrialContext message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.aiplatform.v1beta1.ITrialContext, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TrialContext message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns TrialContext + * @throws {Error} If the payload is not 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.aiplatform.v1beta1.TrialContext; + + /** + * Decodes a TrialContext message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns TrialContext + * @throws {Error} If the payload 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.aiplatform.v1beta1.TrialContext; + + /** + * Verifies a TrialContext message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a TrialContext message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns TrialContext + */ + public static fromObject(object: { [k: string]: any }): google.cloud.aiplatform.v1beta1.TrialContext; + + /** + * Creates a plain object from a TrialContext message. Also converts values to other types if specified. + * @param message TrialContext + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.aiplatform.v1beta1.TrialContext, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this TrialContext to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for TrialContext + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + /** Properties of a StudySpec. */ interface IStudySpec { @@ -113199,6 +113423,9 @@ export namespace google { /** Index indexUpdateMethod */ indexUpdateMethod?: (google.cloud.aiplatform.v1beta1.Index.IndexUpdateMethod|keyof typeof google.cloud.aiplatform.v1beta1.Index.IndexUpdateMethod|null); + + /** Index encryptionSpec */ + encryptionSpec?: (google.cloud.aiplatform.v1beta1.IEncryptionSpec|null); } /** Represents an Index. */ @@ -113246,6 +113473,9 @@ export namespace google { /** Index indexUpdateMethod. */ public indexUpdateMethod: (google.cloud.aiplatform.v1beta1.Index.IndexUpdateMethod|keyof typeof google.cloud.aiplatform.v1beta1.Index.IndexUpdateMethod); + /** Index encryptionSpec. */ + public encryptionSpec?: (google.cloud.aiplatform.v1beta1.IEncryptionSpec|null); + /** * Creates a new Index instance using the specified properties. * @param [properties] Properties to set @@ -113802,6 +114032,9 @@ export namespace google { /** IndexEndpoint publicEndpointDomainName */ publicEndpointDomainName?: (string|null); + + /** IndexEndpoint encryptionSpec */ + encryptionSpec?: (google.cloud.aiplatform.v1beta1.IEncryptionSpec|null); } /** Represents an IndexEndpoint. */ @@ -113852,6 +114085,9 @@ export namespace google { /** IndexEndpoint publicEndpointDomainName. */ public publicEndpointDomainName: string; + /** IndexEndpoint encryptionSpec. */ + public encryptionSpec?: (google.cloud.aiplatform.v1beta1.IEncryptionSpec|null); + /** * Creates a new IndexEndpoint instance using the specified properties. * @param [properties] Properties to set @@ -140530,6 +140766,12 @@ export namespace google { /** RaySpec imageUri */ imageUri?: (string|null); + + /** RaySpec resourcePoolImages */ + resourcePoolImages?: ({ [k: string]: string }|null); + + /** RaySpec headNodeResourcePoolId */ + headNodeResourcePoolId?: (string|null); } /** Represents a RaySpec. */ @@ -140544,6 +140786,12 @@ export namespace google { /** RaySpec imageUri. */ public imageUri: string; + /** RaySpec resourcePoolImages. */ + public resourcePoolImages: { [k: string]: string }; + + /** RaySpec headNodeResourcePoolId. */ + public headNodeResourcePoolId: string; + /** * Creates a new RaySpec instance using the specified properties. * @param [properties] Properties to set @@ -140897,6 +141145,20 @@ export namespace google { * @returns Promise */ public deletePersistentResource(request: google.cloud.aiplatform.v1beta1.IDeletePersistentResourceRequest): Promise; + + /** + * Calls UpdatePersistentResource. + * @param request UpdatePersistentResourceRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public updatePersistentResource(request: google.cloud.aiplatform.v1beta1.IUpdatePersistentResourceRequest, callback: google.cloud.aiplatform.v1beta1.PersistentResourceService.UpdatePersistentResourceCallback): void; + + /** + * Calls UpdatePersistentResource. + * @param request UpdatePersistentResourceRequest message or plain object + * @returns Promise + */ + public updatePersistentResource(request: google.cloud.aiplatform.v1beta1.IUpdatePersistentResourceRequest): Promise; } namespace PersistentResourceService { @@ -140928,6 +141190,13 @@ export namespace google { * @param [response] Operation */ type DeletePersistentResourceCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.cloud.aiplatform.v1beta1.PersistentResourceService|updatePersistentResource}. + * @param error Error, if any + * @param [response] Operation + */ + type UpdatePersistentResourceCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; } /** Properties of a CreatePersistentResourceRequest. */ @@ -141136,6 +141405,103 @@ export namespace google { public static getTypeUrl(typeUrlPrefix?: string): string; } + /** Properties of an UpdatePersistentResourceOperationMetadata. */ + interface IUpdatePersistentResourceOperationMetadata { + + /** UpdatePersistentResourceOperationMetadata genericMetadata */ + genericMetadata?: (google.cloud.aiplatform.v1beta1.IGenericOperationMetadata|null); + } + + /** Represents an UpdatePersistentResourceOperationMetadata. */ + class UpdatePersistentResourceOperationMetadata implements IUpdatePersistentResourceOperationMetadata { + + /** + * Constructs a new UpdatePersistentResourceOperationMetadata. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.aiplatform.v1beta1.IUpdatePersistentResourceOperationMetadata); + + /** UpdatePersistentResourceOperationMetadata genericMetadata. */ + public genericMetadata?: (google.cloud.aiplatform.v1beta1.IGenericOperationMetadata|null); + + /** + * Creates a new UpdatePersistentResourceOperationMetadata instance using the specified properties. + * @param [properties] Properties to set + * @returns UpdatePersistentResourceOperationMetadata instance + */ + public static create(properties?: google.cloud.aiplatform.v1beta1.IUpdatePersistentResourceOperationMetadata): google.cloud.aiplatform.v1beta1.UpdatePersistentResourceOperationMetadata; + + /** + * Encodes the specified UpdatePersistentResourceOperationMetadata message. Does not implicitly {@link google.cloud.aiplatform.v1beta1.UpdatePersistentResourceOperationMetadata.verify|verify} messages. + * @param message UpdatePersistentResourceOperationMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.aiplatform.v1beta1.IUpdatePersistentResourceOperationMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified UpdatePersistentResourceOperationMetadata message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1beta1.UpdatePersistentResourceOperationMetadata.verify|verify} messages. + * @param message UpdatePersistentResourceOperationMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.aiplatform.v1beta1.IUpdatePersistentResourceOperationMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an UpdatePersistentResourceOperationMetadata message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns UpdatePersistentResourceOperationMetadata + * @throws {Error} If the payload is not 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.aiplatform.v1beta1.UpdatePersistentResourceOperationMetadata; + + /** + * Decodes an UpdatePersistentResourceOperationMetadata message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns UpdatePersistentResourceOperationMetadata + * @throws {Error} If the payload 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.aiplatform.v1beta1.UpdatePersistentResourceOperationMetadata; + + /** + * Verifies an UpdatePersistentResourceOperationMetadata message. + * @param message Plain 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 UpdatePersistentResourceOperationMetadata message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns UpdatePersistentResourceOperationMetadata + */ + public static fromObject(object: { [k: string]: any }): google.cloud.aiplatform.v1beta1.UpdatePersistentResourceOperationMetadata; + + /** + * Creates a plain object from an UpdatePersistentResourceOperationMetadata message. Also converts values to other types if specified. + * @param message UpdatePersistentResourceOperationMetadata + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.aiplatform.v1beta1.UpdatePersistentResourceOperationMetadata, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this UpdatePersistentResourceOperationMetadata to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for UpdatePersistentResourceOperationMetadata + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + /** Properties of a GetPersistentResourceRequest. */ interface IGetPersistentResourceRequest { @@ -141542,6 +141908,109 @@ export namespace google { public static getTypeUrl(typeUrlPrefix?: string): string; } + /** Properties of an UpdatePersistentResourceRequest. */ + interface IUpdatePersistentResourceRequest { + + /** UpdatePersistentResourceRequest persistentResource */ + persistentResource?: (google.cloud.aiplatform.v1beta1.IPersistentResource|null); + + /** UpdatePersistentResourceRequest updateMask */ + updateMask?: (google.protobuf.IFieldMask|null); + } + + /** Represents an UpdatePersistentResourceRequest. */ + class UpdatePersistentResourceRequest implements IUpdatePersistentResourceRequest { + + /** + * Constructs a new UpdatePersistentResourceRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.aiplatform.v1beta1.IUpdatePersistentResourceRequest); + + /** UpdatePersistentResourceRequest persistentResource. */ + public persistentResource?: (google.cloud.aiplatform.v1beta1.IPersistentResource|null); + + /** UpdatePersistentResourceRequest updateMask. */ + public updateMask?: (google.protobuf.IFieldMask|null); + + /** + * Creates a new UpdatePersistentResourceRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns UpdatePersistentResourceRequest instance + */ + public static create(properties?: google.cloud.aiplatform.v1beta1.IUpdatePersistentResourceRequest): google.cloud.aiplatform.v1beta1.UpdatePersistentResourceRequest; + + /** + * Encodes the specified UpdatePersistentResourceRequest message. Does not implicitly {@link google.cloud.aiplatform.v1beta1.UpdatePersistentResourceRequest.verify|verify} messages. + * @param message UpdatePersistentResourceRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.aiplatform.v1beta1.IUpdatePersistentResourceRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified UpdatePersistentResourceRequest message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1beta1.UpdatePersistentResourceRequest.verify|verify} messages. + * @param message UpdatePersistentResourceRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.aiplatform.v1beta1.IUpdatePersistentResourceRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an UpdatePersistentResourceRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns UpdatePersistentResourceRequest + * @throws {Error} If the payload is not 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.aiplatform.v1beta1.UpdatePersistentResourceRequest; + + /** + * Decodes an UpdatePersistentResourceRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns UpdatePersistentResourceRequest + * @throws {Error} If the payload 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.aiplatform.v1beta1.UpdatePersistentResourceRequest; + + /** + * Verifies an UpdatePersistentResourceRequest message. + * @param message Plain 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 UpdatePersistentResourceRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns UpdatePersistentResourceRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.aiplatform.v1beta1.UpdatePersistentResourceRequest; + + /** + * Creates a plain object from an UpdatePersistentResourceRequest message. Also converts values to other types if specified. + * @param message UpdatePersistentResourceRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.aiplatform.v1beta1.UpdatePersistentResourceRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this UpdatePersistentResourceRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for UpdatePersistentResourceRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + /** PipelineFailurePolicy enum. */ enum PipelineFailurePolicy { PIPELINE_FAILURE_POLICY_UNSPECIFIED = 0, @@ -167750,6 +168219,9 @@ export namespace google { /** SuggestTrialsRequest clientId */ clientId?: (string|null); + + /** SuggestTrialsRequest contexts */ + contexts?: (google.cloud.aiplatform.v1beta1.ITrialContext[]|null); } /** Represents a SuggestTrialsRequest. */ @@ -167770,6 +168242,9 @@ export namespace google { /** SuggestTrialsRequest clientId. */ public clientId: string; + /** SuggestTrialsRequest contexts. */ + public contexts: google.cloud.aiplatform.v1beta1.ITrialContext[]; + /** * Creates a new SuggestTrialsRequest instance using the specified properties. * @param [properties] Properties to set diff --git a/packages/google-cloud-aiplatform/protos/protos.js b/packages/google-cloud-aiplatform/protos/protos.js index 4b86d64a9b0..25caab943c2 100644 --- a/packages/google-cloud-aiplatform/protos/protos.js +++ b/packages/google-cloud-aiplatform/protos/protos.js @@ -67869,6 +67869,254 @@ return Trial; })(); + v1.TrialContext = (function() { + + /** + * Properties of a TrialContext. + * @memberof google.cloud.aiplatform.v1 + * @interface ITrialContext + * @property {string|null} [description] TrialContext description + * @property {Array.|null} [parameters] TrialContext parameters + */ + + /** + * Constructs a new TrialContext. + * @memberof google.cloud.aiplatform.v1 + * @classdesc Represents a TrialContext. + * @implements ITrialContext + * @constructor + * @param {google.cloud.aiplatform.v1.ITrialContext=} [properties] Properties to set + */ + function TrialContext(properties) { + this.parameters = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * TrialContext description. + * @member {string} description + * @memberof google.cloud.aiplatform.v1.TrialContext + * @instance + */ + TrialContext.prototype.description = ""; + + /** + * TrialContext parameters. + * @member {Array.} parameters + * @memberof google.cloud.aiplatform.v1.TrialContext + * @instance + */ + TrialContext.prototype.parameters = $util.emptyArray; + + /** + * Creates a new TrialContext instance using the specified properties. + * @function create + * @memberof google.cloud.aiplatform.v1.TrialContext + * @static + * @param {google.cloud.aiplatform.v1.ITrialContext=} [properties] Properties to set + * @returns {google.cloud.aiplatform.v1.TrialContext} TrialContext instance + */ + TrialContext.create = function create(properties) { + return new TrialContext(properties); + }; + + /** + * Encodes the specified TrialContext message. Does not implicitly {@link google.cloud.aiplatform.v1.TrialContext.verify|verify} messages. + * @function encode + * @memberof google.cloud.aiplatform.v1.TrialContext + * @static + * @param {google.cloud.aiplatform.v1.ITrialContext} message TrialContext message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TrialContext.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.description != null && Object.hasOwnProperty.call(message, "description")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.description); + if (message.parameters != null && message.parameters.length) + for (var i = 0; i < message.parameters.length; ++i) + $root.google.cloud.aiplatform.v1.Trial.Parameter.encode(message.parameters[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified TrialContext message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1.TrialContext.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.aiplatform.v1.TrialContext + * @static + * @param {google.cloud.aiplatform.v1.ITrialContext} message TrialContext message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TrialContext.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a TrialContext message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.aiplatform.v1.TrialContext + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.aiplatform.v1.TrialContext} TrialContext + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TrialContext.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.aiplatform.v1.TrialContext(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.description = reader.string(); + break; + } + case 2: { + if (!(message.parameters && message.parameters.length)) + message.parameters = []; + message.parameters.push($root.google.cloud.aiplatform.v1.Trial.Parameter.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a TrialContext message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.aiplatform.v1.TrialContext + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.aiplatform.v1.TrialContext} TrialContext + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TrialContext.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a TrialContext message. + * @function verify + * @memberof google.cloud.aiplatform.v1.TrialContext + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + TrialContext.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.description != null && message.hasOwnProperty("description")) + if (!$util.isString(message.description)) + return "description: string expected"; + if (message.parameters != null && message.hasOwnProperty("parameters")) { + if (!Array.isArray(message.parameters)) + return "parameters: array expected"; + for (var i = 0; i < message.parameters.length; ++i) { + var error = $root.google.cloud.aiplatform.v1.Trial.Parameter.verify(message.parameters[i]); + if (error) + return "parameters." + error; + } + } + return null; + }; + + /** + * Creates a TrialContext message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.aiplatform.v1.TrialContext + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.aiplatform.v1.TrialContext} TrialContext + */ + TrialContext.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.aiplatform.v1.TrialContext) + return object; + var message = new $root.google.cloud.aiplatform.v1.TrialContext(); + if (object.description != null) + message.description = String(object.description); + if (object.parameters) { + if (!Array.isArray(object.parameters)) + throw TypeError(".google.cloud.aiplatform.v1.TrialContext.parameters: array expected"); + message.parameters = []; + for (var i = 0; i < object.parameters.length; ++i) { + if (typeof object.parameters[i] !== "object") + throw TypeError(".google.cloud.aiplatform.v1.TrialContext.parameters: object expected"); + message.parameters[i] = $root.google.cloud.aiplatform.v1.Trial.Parameter.fromObject(object.parameters[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a TrialContext message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.aiplatform.v1.TrialContext + * @static + * @param {google.cloud.aiplatform.v1.TrialContext} message TrialContext + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + TrialContext.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.parameters = []; + if (options.defaults) + object.description = ""; + if (message.description != null && message.hasOwnProperty("description")) + object.description = message.description; + if (message.parameters && message.parameters.length) { + object.parameters = []; + for (var j = 0; j < message.parameters.length; ++j) + object.parameters[j] = $root.google.cloud.aiplatform.v1.Trial.Parameter.toObject(message.parameters[j], options); + } + return object; + }; + + /** + * Converts this TrialContext to JSON. + * @function toJSON + * @memberof google.cloud.aiplatform.v1.TrialContext + * @instance + * @returns {Object.} JSON object + */ + TrialContext.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for TrialContext + * @function getTypeUrl + * @memberof google.cloud.aiplatform.v1.TrialContext + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TrialContext.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.aiplatform.v1.TrialContext"; + }; + + return TrialContext; + })(); + v1.StudySpec = (function() { /** @@ -72916,6 +73164,7 @@ * @property {google.protobuf.ITimestamp|null} [updateTime] Index updateTime * @property {google.cloud.aiplatform.v1.IIndexStats|null} [indexStats] Index indexStats * @property {google.cloud.aiplatform.v1.Index.IndexUpdateMethod|null} [indexUpdateMethod] Index indexUpdateMethod + * @property {google.cloud.aiplatform.v1.IEncryptionSpec|null} [encryptionSpec] Index encryptionSpec */ /** @@ -73031,6 +73280,14 @@ */ Index.prototype.indexUpdateMethod = 0; + /** + * Index encryptionSpec. + * @member {google.cloud.aiplatform.v1.IEncryptionSpec|null|undefined} encryptionSpec + * @memberof google.cloud.aiplatform.v1.Index + * @instance + */ + Index.prototype.encryptionSpec = null; + /** * Creates a new Index instance using the specified properties. * @function create @@ -73081,6 +73338,8 @@ $root.google.cloud.aiplatform.v1.IndexStats.encode(message.indexStats, writer.uint32(/* id 14, wireType 2 =*/114).fork()).ldelim(); if (message.indexUpdateMethod != null && Object.hasOwnProperty.call(message, "indexUpdateMethod")) writer.uint32(/* id 16, wireType 0 =*/128).int32(message.indexUpdateMethod); + if (message.encryptionSpec != null && Object.hasOwnProperty.call(message, "encryptionSpec")) + $root.google.cloud.aiplatform.v1.EncryptionSpec.encode(message.encryptionSpec, writer.uint32(/* id 17, wireType 2 =*/138).fork()).ldelim(); return writer; }; @@ -73184,6 +73443,10 @@ message.indexUpdateMethod = reader.int32(); break; } + case 17: { + message.encryptionSpec = $root.google.cloud.aiplatform.v1.EncryptionSpec.decode(reader, reader.uint32()); + break; + } default: reader.skipType(tag & 7); break; @@ -73280,6 +73543,11 @@ case 2: break; } + if (message.encryptionSpec != null && message.hasOwnProperty("encryptionSpec")) { + var error = $root.google.cloud.aiplatform.v1.EncryptionSpec.verify(message.encryptionSpec); + if (error) + return "encryptionSpec." + error; + } return null; }; @@ -73362,6 +73630,11 @@ message.indexUpdateMethod = 2; break; } + if (object.encryptionSpec != null) { + if (typeof object.encryptionSpec !== "object") + throw TypeError(".google.cloud.aiplatform.v1.Index.encryptionSpec: object expected"); + message.encryptionSpec = $root.google.cloud.aiplatform.v1.EncryptionSpec.fromObject(object.encryptionSpec); + } return message; }; @@ -73393,6 +73666,7 @@ object.updateTime = null; object.indexStats = null; object.indexUpdateMethod = options.enums === String ? "INDEX_UPDATE_METHOD_UNSPECIFIED" : 0; + object.encryptionSpec = null; } if (message.name != null && message.hasOwnProperty("name")) object.name = message.name; @@ -73425,6 +73699,8 @@ object.indexStats = $root.google.cloud.aiplatform.v1.IndexStats.toObject(message.indexStats, options); if (message.indexUpdateMethod != null && message.hasOwnProperty("indexUpdateMethod")) object.indexUpdateMethod = options.enums === String ? $root.google.cloud.aiplatform.v1.Index.IndexUpdateMethod[message.indexUpdateMethod] === undefined ? message.indexUpdateMethod : $root.google.cloud.aiplatform.v1.Index.IndexUpdateMethod[message.indexUpdateMethod] : message.indexUpdateMethod; + if (message.encryptionSpec != null && message.hasOwnProperty("encryptionSpec")) + object.encryptionSpec = $root.google.cloud.aiplatform.v1.EncryptionSpec.toObject(message.encryptionSpec, options); return object; }; @@ -74544,6 +74820,7 @@ * @property {google.cloud.aiplatform.v1.IPrivateServiceConnectConfig|null} [privateServiceConnectConfig] IndexEndpoint privateServiceConnectConfig * @property {boolean|null} [publicEndpointEnabled] IndexEndpoint publicEndpointEnabled * @property {string|null} [publicEndpointDomainName] IndexEndpoint publicEndpointDomainName + * @property {google.cloud.aiplatform.v1.IEncryptionSpec|null} [encryptionSpec] IndexEndpoint encryptionSpec */ /** @@ -74667,6 +74944,14 @@ */ IndexEndpoint.prototype.publicEndpointDomainName = ""; + /** + * IndexEndpoint encryptionSpec. + * @member {google.cloud.aiplatform.v1.IEncryptionSpec|null|undefined} encryptionSpec + * @memberof google.cloud.aiplatform.v1.IndexEndpoint + * @instance + */ + IndexEndpoint.prototype.encryptionSpec = null; + /** * Creates a new IndexEndpoint instance using the specified properties. * @function create @@ -74719,6 +75004,8 @@ writer.uint32(/* id 13, wireType 0 =*/104).bool(message.publicEndpointEnabled); if (message.publicEndpointDomainName != null && Object.hasOwnProperty.call(message, "publicEndpointDomainName")) writer.uint32(/* id 14, wireType 2 =*/114).string(message.publicEndpointDomainName); + if (message.encryptionSpec != null && Object.hasOwnProperty.call(message, "encryptionSpec")) + $root.google.cloud.aiplatform.v1.EncryptionSpec.encode(message.encryptionSpec, writer.uint32(/* id 15, wireType 2 =*/122).fork()).ldelim(); return writer; }; @@ -74826,6 +75113,10 @@ message.publicEndpointDomainName = reader.string(); break; } + case 15: { + message.encryptionSpec = $root.google.cloud.aiplatform.v1.EncryptionSpec.decode(reader, reader.uint32()); + break; + } default: reader.skipType(tag & 7); break; @@ -74917,6 +75208,11 @@ if (message.publicEndpointDomainName != null && message.hasOwnProperty("publicEndpointDomainName")) if (!$util.isString(message.publicEndpointDomainName)) return "publicEndpointDomainName: string expected"; + if (message.encryptionSpec != null && message.hasOwnProperty("encryptionSpec")) { + var error = $root.google.cloud.aiplatform.v1.EncryptionSpec.verify(message.encryptionSpec); + if (error) + return "encryptionSpec." + error; + } return null; }; @@ -74980,6 +75276,11 @@ message.publicEndpointEnabled = Boolean(object.publicEndpointEnabled); if (object.publicEndpointDomainName != null) message.publicEndpointDomainName = String(object.publicEndpointDomainName); + if (object.encryptionSpec != null) { + if (typeof object.encryptionSpec !== "object") + throw TypeError(".google.cloud.aiplatform.v1.IndexEndpoint.encryptionSpec: object expected"); + message.encryptionSpec = $root.google.cloud.aiplatform.v1.EncryptionSpec.fromObject(object.encryptionSpec); + } return message; }; @@ -75012,6 +75313,7 @@ object.privateServiceConnectConfig = null; object.publicEndpointEnabled = false; object.publicEndpointDomainName = ""; + object.encryptionSpec = null; } if (message.name != null && message.hasOwnProperty("name")) object.name = message.name; @@ -75046,6 +75348,8 @@ object.publicEndpointEnabled = message.publicEndpointEnabled; if (message.publicEndpointDomainName != null && message.hasOwnProperty("publicEndpointDomainName")) object.publicEndpointDomainName = message.publicEndpointDomainName; + if (message.encryptionSpec != null && message.hasOwnProperty("encryptionSpec")) + object.encryptionSpec = $root.google.cloud.aiplatform.v1.EncryptionSpec.toObject(message.encryptionSpec, options); return object; }; @@ -190999,6 +191303,7 @@ * @property {string|null} [parent] SuggestTrialsRequest parent * @property {number|null} [suggestionCount] SuggestTrialsRequest suggestionCount * @property {string|null} [clientId] SuggestTrialsRequest clientId + * @property {Array.|null} [contexts] SuggestTrialsRequest contexts */ /** @@ -191010,6 +191315,7 @@ * @param {google.cloud.aiplatform.v1.ISuggestTrialsRequest=} [properties] Properties to set */ function SuggestTrialsRequest(properties) { + this.contexts = []; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -191040,6 +191346,14 @@ */ SuggestTrialsRequest.prototype.clientId = ""; + /** + * SuggestTrialsRequest contexts. + * @member {Array.} contexts + * @memberof google.cloud.aiplatform.v1.SuggestTrialsRequest + * @instance + */ + SuggestTrialsRequest.prototype.contexts = $util.emptyArray; + /** * Creates a new SuggestTrialsRequest instance using the specified properties. * @function create @@ -191070,6 +191384,9 @@ writer.uint32(/* id 2, wireType 0 =*/16).int32(message.suggestionCount); if (message.clientId != null && Object.hasOwnProperty.call(message, "clientId")) writer.uint32(/* id 3, wireType 2 =*/26).string(message.clientId); + if (message.contexts != null && message.contexts.length) + for (var i = 0; i < message.contexts.length; ++i) + $root.google.cloud.aiplatform.v1.TrialContext.encode(message.contexts[i], writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); return writer; }; @@ -191116,6 +191433,12 @@ message.clientId = reader.string(); break; } + case 4: { + if (!(message.contexts && message.contexts.length)) + message.contexts = []; + message.contexts.push($root.google.cloud.aiplatform.v1.TrialContext.decode(reader, reader.uint32())); + break; + } default: reader.skipType(tag & 7); break; @@ -191160,6 +191483,15 @@ if (message.clientId != null && message.hasOwnProperty("clientId")) if (!$util.isString(message.clientId)) return "clientId: string expected"; + if (message.contexts != null && message.hasOwnProperty("contexts")) { + if (!Array.isArray(message.contexts)) + return "contexts: array expected"; + for (var i = 0; i < message.contexts.length; ++i) { + var error = $root.google.cloud.aiplatform.v1.TrialContext.verify(message.contexts[i]); + if (error) + return "contexts." + error; + } + } return null; }; @@ -191181,6 +191513,16 @@ message.suggestionCount = object.suggestionCount | 0; if (object.clientId != null) message.clientId = String(object.clientId); + if (object.contexts) { + if (!Array.isArray(object.contexts)) + throw TypeError(".google.cloud.aiplatform.v1.SuggestTrialsRequest.contexts: array expected"); + message.contexts = []; + for (var i = 0; i < object.contexts.length; ++i) { + if (typeof object.contexts[i] !== "object") + throw TypeError(".google.cloud.aiplatform.v1.SuggestTrialsRequest.contexts: object expected"); + message.contexts[i] = $root.google.cloud.aiplatform.v1.TrialContext.fromObject(object.contexts[i]); + } + } return message; }; @@ -191197,6 +191539,8 @@ if (!options) options = {}; var object = {}; + if (options.arrays || options.defaults) + object.contexts = []; if (options.defaults) { object.parent = ""; object.suggestionCount = 0; @@ -191208,6 +191552,11 @@ object.suggestionCount = message.suggestionCount; if (message.clientId != null && message.hasOwnProperty("clientId")) object.clientId = message.clientId; + if (message.contexts && message.contexts.length) { + object.contexts = []; + for (var j = 0; j < message.contexts.length; ++j) + object.contexts[j] = $root.google.cloud.aiplatform.v1.TrialContext.toObject(message.contexts[j], options); + } return object; }; @@ -271697,6 +272046,254 @@ return Trial; })(); + v1beta1.TrialContext = (function() { + + /** + * Properties of a TrialContext. + * @memberof google.cloud.aiplatform.v1beta1 + * @interface ITrialContext + * @property {string|null} [description] TrialContext description + * @property {Array.|null} [parameters] TrialContext parameters + */ + + /** + * Constructs a new TrialContext. + * @memberof google.cloud.aiplatform.v1beta1 + * @classdesc Represents a TrialContext. + * @implements ITrialContext + * @constructor + * @param {google.cloud.aiplatform.v1beta1.ITrialContext=} [properties] Properties to set + */ + function TrialContext(properties) { + this.parameters = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * TrialContext description. + * @member {string} description + * @memberof google.cloud.aiplatform.v1beta1.TrialContext + * @instance + */ + TrialContext.prototype.description = ""; + + /** + * TrialContext parameters. + * @member {Array.} parameters + * @memberof google.cloud.aiplatform.v1beta1.TrialContext + * @instance + */ + TrialContext.prototype.parameters = $util.emptyArray; + + /** + * Creates a new TrialContext instance using the specified properties. + * @function create + * @memberof google.cloud.aiplatform.v1beta1.TrialContext + * @static + * @param {google.cloud.aiplatform.v1beta1.ITrialContext=} [properties] Properties to set + * @returns {google.cloud.aiplatform.v1beta1.TrialContext} TrialContext instance + */ + TrialContext.create = function create(properties) { + return new TrialContext(properties); + }; + + /** + * Encodes the specified TrialContext message. Does not implicitly {@link google.cloud.aiplatform.v1beta1.TrialContext.verify|verify} messages. + * @function encode + * @memberof google.cloud.aiplatform.v1beta1.TrialContext + * @static + * @param {google.cloud.aiplatform.v1beta1.ITrialContext} message TrialContext message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TrialContext.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.description != null && Object.hasOwnProperty.call(message, "description")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.description); + if (message.parameters != null && message.parameters.length) + for (var i = 0; i < message.parameters.length; ++i) + $root.google.cloud.aiplatform.v1beta1.Trial.Parameter.encode(message.parameters[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified TrialContext message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1beta1.TrialContext.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.aiplatform.v1beta1.TrialContext + * @static + * @param {google.cloud.aiplatform.v1beta1.ITrialContext} message TrialContext message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TrialContext.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a TrialContext message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.aiplatform.v1beta1.TrialContext + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.aiplatform.v1beta1.TrialContext} TrialContext + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TrialContext.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.aiplatform.v1beta1.TrialContext(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.description = reader.string(); + break; + } + case 2: { + if (!(message.parameters && message.parameters.length)) + message.parameters = []; + message.parameters.push($root.google.cloud.aiplatform.v1beta1.Trial.Parameter.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a TrialContext message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.aiplatform.v1beta1.TrialContext + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.aiplatform.v1beta1.TrialContext} TrialContext + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TrialContext.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a TrialContext message. + * @function verify + * @memberof google.cloud.aiplatform.v1beta1.TrialContext + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + TrialContext.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.description != null && message.hasOwnProperty("description")) + if (!$util.isString(message.description)) + return "description: string expected"; + if (message.parameters != null && message.hasOwnProperty("parameters")) { + if (!Array.isArray(message.parameters)) + return "parameters: array expected"; + for (var i = 0; i < message.parameters.length; ++i) { + var error = $root.google.cloud.aiplatform.v1beta1.Trial.Parameter.verify(message.parameters[i]); + if (error) + return "parameters." + error; + } + } + return null; + }; + + /** + * Creates a TrialContext message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.aiplatform.v1beta1.TrialContext + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.aiplatform.v1beta1.TrialContext} TrialContext + */ + TrialContext.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.aiplatform.v1beta1.TrialContext) + return object; + var message = new $root.google.cloud.aiplatform.v1beta1.TrialContext(); + if (object.description != null) + message.description = String(object.description); + if (object.parameters) { + if (!Array.isArray(object.parameters)) + throw TypeError(".google.cloud.aiplatform.v1beta1.TrialContext.parameters: array expected"); + message.parameters = []; + for (var i = 0; i < object.parameters.length; ++i) { + if (typeof object.parameters[i] !== "object") + throw TypeError(".google.cloud.aiplatform.v1beta1.TrialContext.parameters: object expected"); + message.parameters[i] = $root.google.cloud.aiplatform.v1beta1.Trial.Parameter.fromObject(object.parameters[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a TrialContext message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.aiplatform.v1beta1.TrialContext + * @static + * @param {google.cloud.aiplatform.v1beta1.TrialContext} message TrialContext + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + TrialContext.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.parameters = []; + if (options.defaults) + object.description = ""; + if (message.description != null && message.hasOwnProperty("description")) + object.description = message.description; + if (message.parameters && message.parameters.length) { + object.parameters = []; + for (var j = 0; j < message.parameters.length; ++j) + object.parameters[j] = $root.google.cloud.aiplatform.v1beta1.Trial.Parameter.toObject(message.parameters[j], options); + } + return object; + }; + + /** + * Converts this TrialContext to JSON. + * @function toJSON + * @memberof google.cloud.aiplatform.v1beta1.TrialContext + * @instance + * @returns {Object.} JSON object + */ + TrialContext.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for TrialContext + * @function getTypeUrl + * @memberof google.cloud.aiplatform.v1beta1.TrialContext + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TrialContext.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.aiplatform.v1beta1.TrialContext"; + }; + + return TrialContext; + })(); + v1beta1.StudySpec = (function() { /** @@ -277388,6 +277985,7 @@ * @property {google.protobuf.ITimestamp|null} [updateTime] Index updateTime * @property {google.cloud.aiplatform.v1beta1.IIndexStats|null} [indexStats] Index indexStats * @property {google.cloud.aiplatform.v1beta1.Index.IndexUpdateMethod|null} [indexUpdateMethod] Index indexUpdateMethod + * @property {google.cloud.aiplatform.v1beta1.IEncryptionSpec|null} [encryptionSpec] Index encryptionSpec */ /** @@ -277503,6 +278101,14 @@ */ Index.prototype.indexUpdateMethod = 0; + /** + * Index encryptionSpec. + * @member {google.cloud.aiplatform.v1beta1.IEncryptionSpec|null|undefined} encryptionSpec + * @memberof google.cloud.aiplatform.v1beta1.Index + * @instance + */ + Index.prototype.encryptionSpec = null; + /** * Creates a new Index instance using the specified properties. * @function create @@ -277553,6 +278159,8 @@ $root.google.cloud.aiplatform.v1beta1.IndexStats.encode(message.indexStats, writer.uint32(/* id 14, wireType 2 =*/114).fork()).ldelim(); if (message.indexUpdateMethod != null && Object.hasOwnProperty.call(message, "indexUpdateMethod")) writer.uint32(/* id 16, wireType 0 =*/128).int32(message.indexUpdateMethod); + if (message.encryptionSpec != null && Object.hasOwnProperty.call(message, "encryptionSpec")) + $root.google.cloud.aiplatform.v1beta1.EncryptionSpec.encode(message.encryptionSpec, writer.uint32(/* id 17, wireType 2 =*/138).fork()).ldelim(); return writer; }; @@ -277656,6 +278264,10 @@ message.indexUpdateMethod = reader.int32(); break; } + case 17: { + message.encryptionSpec = $root.google.cloud.aiplatform.v1beta1.EncryptionSpec.decode(reader, reader.uint32()); + break; + } default: reader.skipType(tag & 7); break; @@ -277752,6 +278364,11 @@ case 2: break; } + if (message.encryptionSpec != null && message.hasOwnProperty("encryptionSpec")) { + var error = $root.google.cloud.aiplatform.v1beta1.EncryptionSpec.verify(message.encryptionSpec); + if (error) + return "encryptionSpec." + error; + } return null; }; @@ -277834,6 +278451,11 @@ message.indexUpdateMethod = 2; break; } + if (object.encryptionSpec != null) { + if (typeof object.encryptionSpec !== "object") + throw TypeError(".google.cloud.aiplatform.v1beta1.Index.encryptionSpec: object expected"); + message.encryptionSpec = $root.google.cloud.aiplatform.v1beta1.EncryptionSpec.fromObject(object.encryptionSpec); + } return message; }; @@ -277865,6 +278487,7 @@ object.updateTime = null; object.indexStats = null; object.indexUpdateMethod = options.enums === String ? "INDEX_UPDATE_METHOD_UNSPECIFIED" : 0; + object.encryptionSpec = null; } if (message.name != null && message.hasOwnProperty("name")) object.name = message.name; @@ -277897,6 +278520,8 @@ object.indexStats = $root.google.cloud.aiplatform.v1beta1.IndexStats.toObject(message.indexStats, options); if (message.indexUpdateMethod != null && message.hasOwnProperty("indexUpdateMethod")) object.indexUpdateMethod = options.enums === String ? $root.google.cloud.aiplatform.v1beta1.Index.IndexUpdateMethod[message.indexUpdateMethod] === undefined ? message.indexUpdateMethod : $root.google.cloud.aiplatform.v1beta1.Index.IndexUpdateMethod[message.indexUpdateMethod] : message.indexUpdateMethod; + if (message.encryptionSpec != null && message.hasOwnProperty("encryptionSpec")) + object.encryptionSpec = $root.google.cloud.aiplatform.v1beta1.EncryptionSpec.toObject(message.encryptionSpec, options); return object; }; @@ -279016,6 +279641,7 @@ * @property {google.cloud.aiplatform.v1beta1.IPrivateServiceConnectConfig|null} [privateServiceConnectConfig] IndexEndpoint privateServiceConnectConfig * @property {boolean|null} [publicEndpointEnabled] IndexEndpoint publicEndpointEnabled * @property {string|null} [publicEndpointDomainName] IndexEndpoint publicEndpointDomainName + * @property {google.cloud.aiplatform.v1beta1.IEncryptionSpec|null} [encryptionSpec] IndexEndpoint encryptionSpec */ /** @@ -279139,6 +279765,14 @@ */ IndexEndpoint.prototype.publicEndpointDomainName = ""; + /** + * IndexEndpoint encryptionSpec. + * @member {google.cloud.aiplatform.v1beta1.IEncryptionSpec|null|undefined} encryptionSpec + * @memberof google.cloud.aiplatform.v1beta1.IndexEndpoint + * @instance + */ + IndexEndpoint.prototype.encryptionSpec = null; + /** * Creates a new IndexEndpoint instance using the specified properties. * @function create @@ -279191,6 +279825,8 @@ writer.uint32(/* id 13, wireType 0 =*/104).bool(message.publicEndpointEnabled); if (message.publicEndpointDomainName != null && Object.hasOwnProperty.call(message, "publicEndpointDomainName")) writer.uint32(/* id 14, wireType 2 =*/114).string(message.publicEndpointDomainName); + if (message.encryptionSpec != null && Object.hasOwnProperty.call(message, "encryptionSpec")) + $root.google.cloud.aiplatform.v1beta1.EncryptionSpec.encode(message.encryptionSpec, writer.uint32(/* id 15, wireType 2 =*/122).fork()).ldelim(); return writer; }; @@ -279298,6 +279934,10 @@ message.publicEndpointDomainName = reader.string(); break; } + case 15: { + message.encryptionSpec = $root.google.cloud.aiplatform.v1beta1.EncryptionSpec.decode(reader, reader.uint32()); + break; + } default: reader.skipType(tag & 7); break; @@ -279389,6 +280029,11 @@ if (message.publicEndpointDomainName != null && message.hasOwnProperty("publicEndpointDomainName")) if (!$util.isString(message.publicEndpointDomainName)) return "publicEndpointDomainName: string expected"; + if (message.encryptionSpec != null && message.hasOwnProperty("encryptionSpec")) { + var error = $root.google.cloud.aiplatform.v1beta1.EncryptionSpec.verify(message.encryptionSpec); + if (error) + return "encryptionSpec." + error; + } return null; }; @@ -279452,6 +280097,11 @@ message.publicEndpointEnabled = Boolean(object.publicEndpointEnabled); if (object.publicEndpointDomainName != null) message.publicEndpointDomainName = String(object.publicEndpointDomainName); + if (object.encryptionSpec != null) { + if (typeof object.encryptionSpec !== "object") + throw TypeError(".google.cloud.aiplatform.v1beta1.IndexEndpoint.encryptionSpec: object expected"); + message.encryptionSpec = $root.google.cloud.aiplatform.v1beta1.EncryptionSpec.fromObject(object.encryptionSpec); + } return message; }; @@ -279484,6 +280134,7 @@ object.privateServiceConnectConfig = null; object.publicEndpointEnabled = false; object.publicEndpointDomainName = ""; + object.encryptionSpec = null; } if (message.name != null && message.hasOwnProperty("name")) object.name = message.name; @@ -279518,6 +280169,8 @@ object.publicEndpointEnabled = message.publicEndpointEnabled; if (message.publicEndpointDomainName != null && message.hasOwnProperty("publicEndpointDomainName")) object.publicEndpointDomainName = message.publicEndpointDomainName; + if (message.encryptionSpec != null && message.hasOwnProperty("encryptionSpec")) + object.encryptionSpec = $root.google.cloud.aiplatform.v1beta1.EncryptionSpec.toObject(message.encryptionSpec, options); return object; }; @@ -340530,6 +341183,8 @@ * @memberof google.cloud.aiplatform.v1beta1 * @interface IRaySpec * @property {string|null} [imageUri] RaySpec imageUri + * @property {Object.|null} [resourcePoolImages] RaySpec resourcePoolImages + * @property {string|null} [headNodeResourcePoolId] RaySpec headNodeResourcePoolId */ /** @@ -340541,6 +341196,7 @@ * @param {google.cloud.aiplatform.v1beta1.IRaySpec=} [properties] Properties to set */ function RaySpec(properties) { + this.resourcePoolImages = {}; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -340555,6 +341211,22 @@ */ RaySpec.prototype.imageUri = ""; + /** + * RaySpec resourcePoolImages. + * @member {Object.} resourcePoolImages + * @memberof google.cloud.aiplatform.v1beta1.RaySpec + * @instance + */ + RaySpec.prototype.resourcePoolImages = $util.emptyObject; + + /** + * RaySpec headNodeResourcePoolId. + * @member {string} headNodeResourcePoolId + * @memberof google.cloud.aiplatform.v1beta1.RaySpec + * @instance + */ + RaySpec.prototype.headNodeResourcePoolId = ""; + /** * Creates a new RaySpec instance using the specified properties. * @function create @@ -340581,6 +341253,11 @@ writer = $Writer.create(); if (message.imageUri != null && Object.hasOwnProperty.call(message, "imageUri")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.imageUri); + if (message.resourcePoolImages != null && Object.hasOwnProperty.call(message, "resourcePoolImages")) + for (var keys = Object.keys(message.resourcePoolImages), i = 0; i < keys.length; ++i) + writer.uint32(/* id 6, wireType 2 =*/50).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.resourcePoolImages[keys[i]]).ldelim(); + if (message.headNodeResourcePoolId != null && Object.hasOwnProperty.call(message, "headNodeResourcePoolId")) + writer.uint32(/* id 7, wireType 2 =*/58).string(message.headNodeResourcePoolId); return writer; }; @@ -340611,7 +341288,7 @@ RaySpec.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.aiplatform.v1beta1.RaySpec(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.aiplatform.v1beta1.RaySpec(), key, value; while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { @@ -340619,6 +341296,33 @@ message.imageUri = reader.string(); break; } + case 6: { + if (message.resourcePoolImages === $util.emptyObject) + message.resourcePoolImages = {}; + 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.resourcePoolImages[key] = value; + break; + } + case 7: { + message.headNodeResourcePoolId = reader.string(); + break; + } default: reader.skipType(tag & 7); break; @@ -340657,6 +341361,17 @@ if (message.imageUri != null && message.hasOwnProperty("imageUri")) if (!$util.isString(message.imageUri)) return "imageUri: string expected"; + if (message.resourcePoolImages != null && message.hasOwnProperty("resourcePoolImages")) { + if (!$util.isObject(message.resourcePoolImages)) + return "resourcePoolImages: object expected"; + var key = Object.keys(message.resourcePoolImages); + for (var i = 0; i < key.length; ++i) + if (!$util.isString(message.resourcePoolImages[key[i]])) + return "resourcePoolImages: string{k:string} expected"; + } + if (message.headNodeResourcePoolId != null && message.hasOwnProperty("headNodeResourcePoolId")) + if (!$util.isString(message.headNodeResourcePoolId)) + return "headNodeResourcePoolId: string expected"; return null; }; @@ -340674,6 +341389,15 @@ var message = new $root.google.cloud.aiplatform.v1beta1.RaySpec(); if (object.imageUri != null) message.imageUri = String(object.imageUri); + if (object.resourcePoolImages) { + if (typeof object.resourcePoolImages !== "object") + throw TypeError(".google.cloud.aiplatform.v1beta1.RaySpec.resourcePoolImages: object expected"); + message.resourcePoolImages = {}; + for (var keys = Object.keys(object.resourcePoolImages), i = 0; i < keys.length; ++i) + message.resourcePoolImages[keys[i]] = String(object.resourcePoolImages[keys[i]]); + } + if (object.headNodeResourcePoolId != null) + message.headNodeResourcePoolId = String(object.headNodeResourcePoolId); return message; }; @@ -340690,10 +341414,22 @@ if (!options) options = {}; var object = {}; - if (options.defaults) + if (options.objects || options.defaults) + object.resourcePoolImages = {}; + if (options.defaults) { object.imageUri = ""; + object.headNodeResourcePoolId = ""; + } if (message.imageUri != null && message.hasOwnProperty("imageUri")) object.imageUri = message.imageUri; + var keys2; + if (message.resourcePoolImages && (keys2 = Object.keys(message.resourcePoolImages)).length) { + object.resourcePoolImages = {}; + for (var j = 0; j < keys2.length; ++j) + object.resourcePoolImages[keys2[j]] = message.resourcePoolImages[keys2[j]]; + } + if (message.headNodeResourcePoolId != null && message.hasOwnProperty("headNodeResourcePoolId")) + object.headNodeResourcePoolId = message.headNodeResourcePoolId; return object; }; @@ -341355,6 +342091,39 @@ * @variation 2 */ + /** + * Callback as used by {@link google.cloud.aiplatform.v1beta1.PersistentResourceService|updatePersistentResource}. + * @memberof google.cloud.aiplatform.v1beta1.PersistentResourceService + * @typedef UpdatePersistentResourceCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls UpdatePersistentResource. + * @function updatePersistentResource + * @memberof google.cloud.aiplatform.v1beta1.PersistentResourceService + * @instance + * @param {google.cloud.aiplatform.v1beta1.IUpdatePersistentResourceRequest} request UpdatePersistentResourceRequest message or plain object + * @param {google.cloud.aiplatform.v1beta1.PersistentResourceService.UpdatePersistentResourceCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(PersistentResourceService.prototype.updatePersistentResource = function updatePersistentResource(request, callback) { + return this.rpcCall(updatePersistentResource, $root.google.cloud.aiplatform.v1beta1.UpdatePersistentResourceRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "UpdatePersistentResource" }); + + /** + * Calls UpdatePersistentResource. + * @function updatePersistentResource + * @memberof google.cloud.aiplatform.v1beta1.PersistentResourceService + * @instance + * @param {google.cloud.aiplatform.v1beta1.IUpdatePersistentResourceRequest} request UpdatePersistentResourceRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + return PersistentResourceService; })(); @@ -341821,6 +342590,214 @@ return CreatePersistentResourceOperationMetadata; })(); + v1beta1.UpdatePersistentResourceOperationMetadata = (function() { + + /** + * Properties of an UpdatePersistentResourceOperationMetadata. + * @memberof google.cloud.aiplatform.v1beta1 + * @interface IUpdatePersistentResourceOperationMetadata + * @property {google.cloud.aiplatform.v1beta1.IGenericOperationMetadata|null} [genericMetadata] UpdatePersistentResourceOperationMetadata genericMetadata + */ + + /** + * Constructs a new UpdatePersistentResourceOperationMetadata. + * @memberof google.cloud.aiplatform.v1beta1 + * @classdesc Represents an UpdatePersistentResourceOperationMetadata. + * @implements IUpdatePersistentResourceOperationMetadata + * @constructor + * @param {google.cloud.aiplatform.v1beta1.IUpdatePersistentResourceOperationMetadata=} [properties] Properties to set + */ + function UpdatePersistentResourceOperationMetadata(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * UpdatePersistentResourceOperationMetadata genericMetadata. + * @member {google.cloud.aiplatform.v1beta1.IGenericOperationMetadata|null|undefined} genericMetadata + * @memberof google.cloud.aiplatform.v1beta1.UpdatePersistentResourceOperationMetadata + * @instance + */ + UpdatePersistentResourceOperationMetadata.prototype.genericMetadata = null; + + /** + * Creates a new UpdatePersistentResourceOperationMetadata instance using the specified properties. + * @function create + * @memberof google.cloud.aiplatform.v1beta1.UpdatePersistentResourceOperationMetadata + * @static + * @param {google.cloud.aiplatform.v1beta1.IUpdatePersistentResourceOperationMetadata=} [properties] Properties to set + * @returns {google.cloud.aiplatform.v1beta1.UpdatePersistentResourceOperationMetadata} UpdatePersistentResourceOperationMetadata instance + */ + UpdatePersistentResourceOperationMetadata.create = function create(properties) { + return new UpdatePersistentResourceOperationMetadata(properties); + }; + + /** + * Encodes the specified UpdatePersistentResourceOperationMetadata message. Does not implicitly {@link google.cloud.aiplatform.v1beta1.UpdatePersistentResourceOperationMetadata.verify|verify} messages. + * @function encode + * @memberof google.cloud.aiplatform.v1beta1.UpdatePersistentResourceOperationMetadata + * @static + * @param {google.cloud.aiplatform.v1beta1.IUpdatePersistentResourceOperationMetadata} message UpdatePersistentResourceOperationMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdatePersistentResourceOperationMetadata.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.genericMetadata != null && Object.hasOwnProperty.call(message, "genericMetadata")) + $root.google.cloud.aiplatform.v1beta1.GenericOperationMetadata.encode(message.genericMetadata, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified UpdatePersistentResourceOperationMetadata message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1beta1.UpdatePersistentResourceOperationMetadata.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.aiplatform.v1beta1.UpdatePersistentResourceOperationMetadata + * @static + * @param {google.cloud.aiplatform.v1beta1.IUpdatePersistentResourceOperationMetadata} message UpdatePersistentResourceOperationMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdatePersistentResourceOperationMetadata.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an UpdatePersistentResourceOperationMetadata message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.aiplatform.v1beta1.UpdatePersistentResourceOperationMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.aiplatform.v1beta1.UpdatePersistentResourceOperationMetadata} UpdatePersistentResourceOperationMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdatePersistentResourceOperationMetadata.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.aiplatform.v1beta1.UpdatePersistentResourceOperationMetadata(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.genericMetadata = $root.google.cloud.aiplatform.v1beta1.GenericOperationMetadata.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an UpdatePersistentResourceOperationMetadata message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.aiplatform.v1beta1.UpdatePersistentResourceOperationMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.aiplatform.v1beta1.UpdatePersistentResourceOperationMetadata} UpdatePersistentResourceOperationMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdatePersistentResourceOperationMetadata.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an UpdatePersistentResourceOperationMetadata message. + * @function verify + * @memberof google.cloud.aiplatform.v1beta1.UpdatePersistentResourceOperationMetadata + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + UpdatePersistentResourceOperationMetadata.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.genericMetadata != null && message.hasOwnProperty("genericMetadata")) { + var error = $root.google.cloud.aiplatform.v1beta1.GenericOperationMetadata.verify(message.genericMetadata); + if (error) + return "genericMetadata." + error; + } + return null; + }; + + /** + * Creates an UpdatePersistentResourceOperationMetadata message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.aiplatform.v1beta1.UpdatePersistentResourceOperationMetadata + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.aiplatform.v1beta1.UpdatePersistentResourceOperationMetadata} UpdatePersistentResourceOperationMetadata + */ + UpdatePersistentResourceOperationMetadata.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.aiplatform.v1beta1.UpdatePersistentResourceOperationMetadata) + return object; + var message = new $root.google.cloud.aiplatform.v1beta1.UpdatePersistentResourceOperationMetadata(); + if (object.genericMetadata != null) { + if (typeof object.genericMetadata !== "object") + throw TypeError(".google.cloud.aiplatform.v1beta1.UpdatePersistentResourceOperationMetadata.genericMetadata: object expected"); + message.genericMetadata = $root.google.cloud.aiplatform.v1beta1.GenericOperationMetadata.fromObject(object.genericMetadata); + } + return message; + }; + + /** + * Creates a plain object from an UpdatePersistentResourceOperationMetadata message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.aiplatform.v1beta1.UpdatePersistentResourceOperationMetadata + * @static + * @param {google.cloud.aiplatform.v1beta1.UpdatePersistentResourceOperationMetadata} message UpdatePersistentResourceOperationMetadata + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + UpdatePersistentResourceOperationMetadata.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.genericMetadata = null; + if (message.genericMetadata != null && message.hasOwnProperty("genericMetadata")) + object.genericMetadata = $root.google.cloud.aiplatform.v1beta1.GenericOperationMetadata.toObject(message.genericMetadata, options); + return object; + }; + + /** + * Converts this UpdatePersistentResourceOperationMetadata to JSON. + * @function toJSON + * @memberof google.cloud.aiplatform.v1beta1.UpdatePersistentResourceOperationMetadata + * @instance + * @returns {Object.} JSON object + */ + UpdatePersistentResourceOperationMetadata.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for UpdatePersistentResourceOperationMetadata + * @function getTypeUrl + * @memberof google.cloud.aiplatform.v1beta1.UpdatePersistentResourceOperationMetadata + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + UpdatePersistentResourceOperationMetadata.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.aiplatform.v1beta1.UpdatePersistentResourceOperationMetadata"; + }; + + return UpdatePersistentResourceOperationMetadata; + })(); + v1beta1.GetPersistentResourceRequest = (function() { /** @@ -342725,6 +343702,243 @@ return DeletePersistentResourceRequest; })(); + v1beta1.UpdatePersistentResourceRequest = (function() { + + /** + * Properties of an UpdatePersistentResourceRequest. + * @memberof google.cloud.aiplatform.v1beta1 + * @interface IUpdatePersistentResourceRequest + * @property {google.cloud.aiplatform.v1beta1.IPersistentResource|null} [persistentResource] UpdatePersistentResourceRequest persistentResource + * @property {google.protobuf.IFieldMask|null} [updateMask] UpdatePersistentResourceRequest updateMask + */ + + /** + * Constructs a new UpdatePersistentResourceRequest. + * @memberof google.cloud.aiplatform.v1beta1 + * @classdesc Represents an UpdatePersistentResourceRequest. + * @implements IUpdatePersistentResourceRequest + * @constructor + * @param {google.cloud.aiplatform.v1beta1.IUpdatePersistentResourceRequest=} [properties] Properties to set + */ + function UpdatePersistentResourceRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * UpdatePersistentResourceRequest persistentResource. + * @member {google.cloud.aiplatform.v1beta1.IPersistentResource|null|undefined} persistentResource + * @memberof google.cloud.aiplatform.v1beta1.UpdatePersistentResourceRequest + * @instance + */ + UpdatePersistentResourceRequest.prototype.persistentResource = null; + + /** + * UpdatePersistentResourceRequest updateMask. + * @member {google.protobuf.IFieldMask|null|undefined} updateMask + * @memberof google.cloud.aiplatform.v1beta1.UpdatePersistentResourceRequest + * @instance + */ + UpdatePersistentResourceRequest.prototype.updateMask = null; + + /** + * Creates a new UpdatePersistentResourceRequest instance using the specified properties. + * @function create + * @memberof google.cloud.aiplatform.v1beta1.UpdatePersistentResourceRequest + * @static + * @param {google.cloud.aiplatform.v1beta1.IUpdatePersistentResourceRequest=} [properties] Properties to set + * @returns {google.cloud.aiplatform.v1beta1.UpdatePersistentResourceRequest} UpdatePersistentResourceRequest instance + */ + UpdatePersistentResourceRequest.create = function create(properties) { + return new UpdatePersistentResourceRequest(properties); + }; + + /** + * Encodes the specified UpdatePersistentResourceRequest message. Does not implicitly {@link google.cloud.aiplatform.v1beta1.UpdatePersistentResourceRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.aiplatform.v1beta1.UpdatePersistentResourceRequest + * @static + * @param {google.cloud.aiplatform.v1beta1.IUpdatePersistentResourceRequest} message UpdatePersistentResourceRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdatePersistentResourceRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.persistentResource != null && Object.hasOwnProperty.call(message, "persistentResource")) + $root.google.cloud.aiplatform.v1beta1.PersistentResource.encode(message.persistentResource, 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 UpdatePersistentResourceRequest message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1beta1.UpdatePersistentResourceRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.aiplatform.v1beta1.UpdatePersistentResourceRequest + * @static + * @param {google.cloud.aiplatform.v1beta1.IUpdatePersistentResourceRequest} message UpdatePersistentResourceRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdatePersistentResourceRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an UpdatePersistentResourceRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.aiplatform.v1beta1.UpdatePersistentResourceRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.aiplatform.v1beta1.UpdatePersistentResourceRequest} UpdatePersistentResourceRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdatePersistentResourceRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.aiplatform.v1beta1.UpdatePersistentResourceRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.persistentResource = $root.google.cloud.aiplatform.v1beta1.PersistentResource.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 UpdatePersistentResourceRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.aiplatform.v1beta1.UpdatePersistentResourceRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.aiplatform.v1beta1.UpdatePersistentResourceRequest} UpdatePersistentResourceRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdatePersistentResourceRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an UpdatePersistentResourceRequest message. + * @function verify + * @memberof google.cloud.aiplatform.v1beta1.UpdatePersistentResourceRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + UpdatePersistentResourceRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.persistentResource != null && message.hasOwnProperty("persistentResource")) { + var error = $root.google.cloud.aiplatform.v1beta1.PersistentResource.verify(message.persistentResource); + if (error) + return "persistentResource." + 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 UpdatePersistentResourceRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.aiplatform.v1beta1.UpdatePersistentResourceRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.aiplatform.v1beta1.UpdatePersistentResourceRequest} UpdatePersistentResourceRequest + */ + UpdatePersistentResourceRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.aiplatform.v1beta1.UpdatePersistentResourceRequest) + return object; + var message = new $root.google.cloud.aiplatform.v1beta1.UpdatePersistentResourceRequest(); + if (object.persistentResource != null) { + if (typeof object.persistentResource !== "object") + throw TypeError(".google.cloud.aiplatform.v1beta1.UpdatePersistentResourceRequest.persistentResource: object expected"); + message.persistentResource = $root.google.cloud.aiplatform.v1beta1.PersistentResource.fromObject(object.persistentResource); + } + if (object.updateMask != null) { + if (typeof object.updateMask !== "object") + throw TypeError(".google.cloud.aiplatform.v1beta1.UpdatePersistentResourceRequest.updateMask: object expected"); + message.updateMask = $root.google.protobuf.FieldMask.fromObject(object.updateMask); + } + return message; + }; + + /** + * Creates a plain object from an UpdatePersistentResourceRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.aiplatform.v1beta1.UpdatePersistentResourceRequest + * @static + * @param {google.cloud.aiplatform.v1beta1.UpdatePersistentResourceRequest} message UpdatePersistentResourceRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + UpdatePersistentResourceRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.persistentResource = null; + object.updateMask = null; + } + if (message.persistentResource != null && message.hasOwnProperty("persistentResource")) + object.persistentResource = $root.google.cloud.aiplatform.v1beta1.PersistentResource.toObject(message.persistentResource, options); + if (message.updateMask != null && message.hasOwnProperty("updateMask")) + object.updateMask = $root.google.protobuf.FieldMask.toObject(message.updateMask, options); + return object; + }; + + /** + * Converts this UpdatePersistentResourceRequest to JSON. + * @function toJSON + * @memberof google.cloud.aiplatform.v1beta1.UpdatePersistentResourceRequest + * @instance + * @returns {Object.} JSON object + */ + UpdatePersistentResourceRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for UpdatePersistentResourceRequest + * @function getTypeUrl + * @memberof google.cloud.aiplatform.v1beta1.UpdatePersistentResourceRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + UpdatePersistentResourceRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.aiplatform.v1beta1.UpdatePersistentResourceRequest"; + }; + + return UpdatePersistentResourceRequest; + })(); + /** * PipelineFailurePolicy enum. * @name google.cloud.aiplatform.v1beta1.PipelineFailurePolicy @@ -405043,6 +406257,7 @@ * @property {string|null} [parent] SuggestTrialsRequest parent * @property {number|null} [suggestionCount] SuggestTrialsRequest suggestionCount * @property {string|null} [clientId] SuggestTrialsRequest clientId + * @property {Array.|null} [contexts] SuggestTrialsRequest contexts */ /** @@ -405054,6 +406269,7 @@ * @param {google.cloud.aiplatform.v1beta1.ISuggestTrialsRequest=} [properties] Properties to set */ function SuggestTrialsRequest(properties) { + this.contexts = []; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -405084,6 +406300,14 @@ */ SuggestTrialsRequest.prototype.clientId = ""; + /** + * SuggestTrialsRequest contexts. + * @member {Array.} contexts + * @memberof google.cloud.aiplatform.v1beta1.SuggestTrialsRequest + * @instance + */ + SuggestTrialsRequest.prototype.contexts = $util.emptyArray; + /** * Creates a new SuggestTrialsRequest instance using the specified properties. * @function create @@ -405114,6 +406338,9 @@ writer.uint32(/* id 2, wireType 0 =*/16).int32(message.suggestionCount); if (message.clientId != null && Object.hasOwnProperty.call(message, "clientId")) writer.uint32(/* id 3, wireType 2 =*/26).string(message.clientId); + if (message.contexts != null && message.contexts.length) + for (var i = 0; i < message.contexts.length; ++i) + $root.google.cloud.aiplatform.v1beta1.TrialContext.encode(message.contexts[i], writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); return writer; }; @@ -405160,6 +406387,12 @@ message.clientId = reader.string(); break; } + case 4: { + if (!(message.contexts && message.contexts.length)) + message.contexts = []; + message.contexts.push($root.google.cloud.aiplatform.v1beta1.TrialContext.decode(reader, reader.uint32())); + break; + } default: reader.skipType(tag & 7); break; @@ -405204,6 +406437,15 @@ if (message.clientId != null && message.hasOwnProperty("clientId")) if (!$util.isString(message.clientId)) return "clientId: string expected"; + if (message.contexts != null && message.hasOwnProperty("contexts")) { + if (!Array.isArray(message.contexts)) + return "contexts: array expected"; + for (var i = 0; i < message.contexts.length; ++i) { + var error = $root.google.cloud.aiplatform.v1beta1.TrialContext.verify(message.contexts[i]); + if (error) + return "contexts." + error; + } + } return null; }; @@ -405225,6 +406467,16 @@ message.suggestionCount = object.suggestionCount | 0; if (object.clientId != null) message.clientId = String(object.clientId); + if (object.contexts) { + if (!Array.isArray(object.contexts)) + throw TypeError(".google.cloud.aiplatform.v1beta1.SuggestTrialsRequest.contexts: array expected"); + message.contexts = []; + for (var i = 0; i < object.contexts.length; ++i) { + if (typeof object.contexts[i] !== "object") + throw TypeError(".google.cloud.aiplatform.v1beta1.SuggestTrialsRequest.contexts: object expected"); + message.contexts[i] = $root.google.cloud.aiplatform.v1beta1.TrialContext.fromObject(object.contexts[i]); + } + } return message; }; @@ -405241,6 +406493,8 @@ if (!options) options = {}; var object = {}; + if (options.arrays || options.defaults) + object.contexts = []; if (options.defaults) { object.parent = ""; object.suggestionCount = 0; @@ -405252,6 +406506,11 @@ object.suggestionCount = message.suggestionCount; if (message.clientId != null && message.hasOwnProperty("clientId")) object.clientId = message.clientId; + if (message.contexts && message.contexts.length) { + object.contexts = []; + for (var j = 0; j < message.contexts.length; ++j) + object.contexts[j] = $root.google.cloud.aiplatform.v1beta1.TrialContext.toObject(message.contexts[j], options); + } return object; }; diff --git a/packages/google-cloud-aiplatform/protos/protos.json b/packages/google-cloud-aiplatform/protos/protos.json index b89a017a4f8..4af1f21e69a 100644 --- a/packages/google-cloud-aiplatform/protos/protos.json +++ b/packages/google-cloud-aiplatform/protos/protos.json @@ -7163,6 +7163,19 @@ } } }, + "TrialContext": { + "fields": { + "description": { + "type": "string", + "id": 1 + }, + "parameters": { + "rule": "repeated", + "type": "Trial.Parameter", + "id": 2 + } + } + }, "StudySpec": { "oneofs": { "automatedStoppingSpec": { @@ -7723,6 +7736,13 @@ "options": { "(google.api.field_behavior)": "IMMUTABLE" } + }, + "encryptionSpec": { + "type": "EncryptionSpec", + "id": 17, + "options": { + "(google.api.field_behavior)": "IMMUTABLE" + } } }, "nested": { @@ -7905,6 +7925,13 @@ "options": { "(google.api.field_behavior)": "OUTPUT_ONLY" } + }, + "encryptionSpec": { + "type": "EncryptionSpec", + "id": 15, + "options": { + "(google.api.field_behavior)": "IMMUTABLE" + } } } }, @@ -20440,6 +20467,14 @@ "options": { "(google.api.field_behavior)": "REQUIRED" } + }, + "contexts": { + "rule": "repeated", + "type": "TrialContext", + "id": 4, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } } } }, @@ -28712,6 +28747,19 @@ } } }, + "TrialContext": { + "fields": { + "description": { + "type": "string", + "id": 1 + }, + "parameters": { + "rule": "repeated", + "type": "Trial.Parameter", + "id": 2 + } + } + }, "StudySpec": { "oneofs": { "automatedStoppingSpec": { @@ -29327,6 +29375,13 @@ "options": { "(google.api.field_behavior)": "IMMUTABLE" } + }, + "encryptionSpec": { + "type": "EncryptionSpec", + "id": 17, + "options": { + "(google.api.field_behavior)": "IMMUTABLE" + } } }, "nested": { @@ -29509,6 +29564,13 @@ "options": { "(google.api.field_behavior)": "OUTPUT_ONLY" } + }, + "encryptionSpec": { + "type": "EncryptionSpec", + "id": 15, + "options": { + "(google.api.field_behavior)": "IMMUTABLE" + } } } }, @@ -36393,6 +36455,21 @@ "options": { "(google.api.field_behavior)": "OPTIONAL" } + }, + "resourcePoolImages": { + "keyType": "string", + "type": "string", + "id": 6, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "headNodeResourcePoolId": { + "type": "string", + "id": 7, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } } } }, @@ -36521,6 +36598,34 @@ } } ] + }, + "UpdatePersistentResource": { + "requestType": "UpdatePersistentResourceRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).patch": "/v1beta1/{persistent_resource.name=projects/*/locations/*/persistentResources/*}", + "(google.api.http).body": "persistent_resource", + "(google.api.method_signature)": "persistent_resource,update_mask", + "(google.longrunning.operation_info).response_type": "PersistentResource", + "(google.longrunning.operation_info).metadata_type": "UpdatePersistentResourceOperationMetadata" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "patch": "/v1beta1/{persistent_resource.name=projects/*/locations/*/persistentResources/*}", + "body": "persistent_resource" + } + }, + { + "(google.api.method_signature)": "persistent_resource,update_mask" + }, + { + "(google.longrunning.operation_info)": { + "response_type": "PersistentResource", + "metadata_type": "UpdatePersistentResourceOperationMetadata" + } + } + ] } } }, @@ -36558,6 +36663,14 @@ } } }, + "UpdatePersistentResourceOperationMetadata": { + "fields": { + "genericMetadata": { + "type": "GenericOperationMetadata", + "id": 1 + } + } + }, "GetPersistentResourceRequest": { "fields": { "name": { @@ -36621,6 +36734,24 @@ } } }, + "UpdatePersistentResourceRequest": { + "fields": { + "persistentResource": { + "type": "PersistentResource", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "updateMask": { + "type": "google.protobuf.FieldMask", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, "PipelineFailurePolicy": { "values": { "PIPELINE_FAILURE_POLICY_UNSPECIFIED": 0, @@ -42788,6 +42919,14 @@ "options": { "(google.api.field_behavior)": "REQUIRED" } + }, + "contexts": { + "rule": "repeated", + "type": "TrialContext", + "id": 4, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } } } }, diff --git a/packages/google-cloud-aiplatform/samples/README.md b/packages/google-cloud-aiplatform/samples/README.md index a06319dbda3..4550c646085 100644 --- a/packages/google-cloud-aiplatform/samples/README.md +++ b/packages/google-cloud-aiplatform/samples/README.md @@ -392,6 +392,7 @@ * [Persistent_resource_service.delete_persistent_resource](#persistent_resource_service.delete_persistent_resource) * [Persistent_resource_service.get_persistent_resource](#persistent_resource_service.get_persistent_resource) * [Persistent_resource_service.list_persistent_resources](#persistent_resource_service.list_persistent_resources) + * [Persistent_resource_service.update_persistent_resource](#persistent_resource_service.update_persistent_resource) * [Pipeline_service.cancel_pipeline_job](#pipeline_service.cancel_pipeline_job) * [Pipeline_service.cancel_training_pipeline](#pipeline_service.cancel_training_pipeline) * [Pipeline_service.create_pipeline_job](#pipeline_service.create_pipeline_job) @@ -6941,6 +6942,23 @@ __Usage:__ +### Persistent_resource_service.update_persistent_resource + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-aiplatform/samples/generated/v1beta1/persistent_resource_service.update_persistent_resource.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-cloud-aiplatform/samples/generated/v1beta1/persistent_resource_service.update_persistent_resource.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-aiplatform/samples/generated/v1beta1/persistent_resource_service.update_persistent_resource.js` + + +----- + + + + ### Pipeline_service.cancel_pipeline_job View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-aiplatform/samples/generated/v1beta1/pipeline_service.cancel_pipeline_job.js). diff --git a/packages/google-cloud-aiplatform/samples/generated/v1/snippet_metadata.google.cloud.aiplatform.v1.json b/packages/google-cloud-aiplatform/samples/generated/v1/snippet_metadata.google.cloud.aiplatform.v1.json index d0d631b3d25..7eb5003e9c2 100644 --- a/packages/google-cloud-aiplatform/samples/generated/v1/snippet_metadata.google.cloud.aiplatform.v1.json +++ b/packages/google-cloud-aiplatform/samples/generated/v1/snippet_metadata.google.cloud.aiplatform.v1.json @@ -1,7 +1,7 @@ { "clientLibrary": { "name": "nodejs-aiplatform", - "version": "3.1.0", + "version": "3.2.0", "language": "TYPESCRIPT", "apis": [ { diff --git a/packages/google-cloud-aiplatform/samples/generated/v1/snippet_metadata_google.cloud.aiplatform.v1.json b/packages/google-cloud-aiplatform/samples/generated/v1/snippet_metadata_google.cloud.aiplatform.v1.json index 2da45e88ab8..9242a63bdf7 100644 --- a/packages/google-cloud-aiplatform/samples/generated/v1/snippet_metadata_google.cloud.aiplatform.v1.json +++ b/packages/google-cloud-aiplatform/samples/generated/v1/snippet_metadata_google.cloud.aiplatform.v1.json @@ -1,7 +1,7 @@ { "clientLibrary": { "name": "nodejs-aiplatform", - "version": "3.1.0", + "version": "3.2.0", "language": "TYPESCRIPT", "apis": [ { @@ -9842,7 +9842,7 @@ "segments": [ { "start": 25, - "end": 68, + "end": 105, "type": "FULL" } ], @@ -9862,6 +9862,10 @@ { "name": "client_id", "type": "TYPE_STRING" + }, + { + "name": "contexts", + "type": "TYPE_MESSAGE[]" } ], "resultType": ".google.longrunning.Operation", diff --git a/packages/google-cloud-aiplatform/samples/generated/v1/vizier_service.suggest_trials.js b/packages/google-cloud-aiplatform/samples/generated/v1/vizier_service.suggest_trials.js index 20472f0a1d4..1e2a1d9c5a8 100644 --- a/packages/google-cloud-aiplatform/samples/generated/v1/vizier_service.suggest_trials.js +++ b/packages/google-cloud-aiplatform/samples/generated/v1/vizier_service.suggest_trials.js @@ -44,6 +44,43 @@ function main(parent, suggestionCount, clientId) { * pending, and provide a new Trial if the last suggested Trial was completed. */ // const clientId = 'abc123' + /** + * Optional. This allows you to specify the "context" for a Trial; a context + * is a slice (a subspace) of the search space. + * Typical uses for contexts: + * 1) You are using Vizier to tune a server for best performance, but there's + * a strong weekly cycle. The context specifies the day-of-week. + * This allows Tuesday to generalize from Wednesday without assuming that + * everything is identical. + * 2) Imagine you're optimizing some medical treatment for people. + * As they walk in the door, you know certain facts about them + * (e.g. sex, weight, height, blood-pressure). Put that information in the + * context, and Vizier will adapt its suggestions to the patient. + * 3) You want to do a fair A/B test efficiently. Specify the "A" and "B" + * conditions as contexts, and Vizier will generalize between "A" and "B" + * conditions. If they are similar, this will allow Vizier to converge + * to the optimum faster than if "A" and "B" were separate Studies. + * NOTE: You can also enter contexts as REQUESTED Trials, e.g. via the + * CreateTrial() RPC; that's the asynchronous option where you don't need a + * close association between contexts and suggestions. + * NOTE: All the Parameters you set in a context MUST be defined in the + * Study. + * NOTE: You must supply 0 or $suggestion_count contexts. + * If you don't supply any contexts, Vizier will make suggestions + * from the full search space specified in the StudySpec; if you supply + * a full set of context, each suggestion will match the corresponding + * context. + * NOTE: A Context with no features set matches anything, and allows + * suggestions from the full search space. + * NOTE: Contexts MUST lie within the search space specified in the + * StudySpec. It's an error if they don't. + * NOTE: Contexts preferentially match ACTIVE then REQUESTED trials before + * new suggestions are generated. + * NOTE: Generation of suggestions involves a match between a Context and + * (optionally) a REQUESTED trial; if that match is not fully specified, a + * suggestion will be geneated in the merged subspace. + */ + // const contexts = [1,2,3,4] // Imports the Aiplatform library const {VizierServiceClient} = require('@google-cloud/aiplatform').v1; diff --git a/packages/google-cloud-aiplatform/samples/generated/v1beta1/persistent_resource_service.update_persistent_resource.js b/packages/google-cloud-aiplatform/samples/generated/v1beta1/persistent_resource_service.update_persistent_resource.js new file mode 100644 index 00000000000..1b71a92081b --- /dev/null +++ b/packages/google-cloud-aiplatform/samples/generated/v1beta1/persistent_resource_service.update_persistent_resource.js @@ -0,0 +1,71 @@ +// Copyright 2023 Google LLC +// +// Licensed under the Apache License, Version 2.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(persistentResource, updateMask) { + // [START aiplatform_v1beta1_generated_PersistentResourceService_UpdatePersistentResource_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 PersistentResource to update. + * The PersistentResource's `name` field is used to identify the + * PersistentResource to update. Format: + * `projects/{project}/locations/{location}/persistentResources/{persistent_resource}` + */ + // const persistentResource = {} + /** + * Required. Specify the fields to be overwritten in the PersistentResource by + * the update method. + */ + // const updateMask = {} + + // Imports the Aiplatform library + const {PersistentResourceServiceClient} = require('@google-cloud/aiplatform').v1beta1; + + // Instantiates a client + const aiplatformClient = new PersistentResourceServiceClient(); + + async function callUpdatePersistentResource() { + // Construct request + const request = { + persistentResource, + updateMask, + }; + + // Run request + const [operation] = await aiplatformClient.updatePersistentResource(request); + const [response] = await operation.promise(); + console.log(response); + } + + callUpdatePersistentResource(); + // [END aiplatform_v1beta1_generated_PersistentResourceService_UpdatePersistentResource_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-aiplatform/samples/generated/v1beta1/snippet_metadata.google.cloud.aiplatform.v1beta1.json b/packages/google-cloud-aiplatform/samples/generated/v1beta1/snippet_metadata.google.cloud.aiplatform.v1beta1.json index c209adce673..e1a1b5bf3b5 100644 --- a/packages/google-cloud-aiplatform/samples/generated/v1beta1/snippet_metadata.google.cloud.aiplatform.v1beta1.json +++ b/packages/google-cloud-aiplatform/samples/generated/v1beta1/snippet_metadata.google.cloud.aiplatform.v1beta1.json @@ -1,7 +1,7 @@ { "clientLibrary": { "name": "nodejs-aiplatform", - "version": "3.1.0", + "version": "3.2.0", "language": "TYPESCRIPT", "apis": [ { diff --git a/packages/google-cloud-aiplatform/samples/generated/v1beta1/snippet_metadata_google.cloud.aiplatform.v1beta1.json b/packages/google-cloud-aiplatform/samples/generated/v1beta1/snippet_metadata_google.cloud.aiplatform.v1beta1.json index 7e734ed61b7..5e6e141e6ad 100644 --- a/packages/google-cloud-aiplatform/samples/generated/v1beta1/snippet_metadata_google.cloud.aiplatform.v1beta1.json +++ b/packages/google-cloud-aiplatform/samples/generated/v1beta1/snippet_metadata_google.cloud.aiplatform.v1beta1.json @@ -1,7 +1,7 @@ { "clientLibrary": { "name": "nodejs-aiplatform", - "version": "3.1.0", + "version": "3.2.0", "language": "TYPESCRIPT", "apis": [ { @@ -7459,6 +7459,50 @@ } } }, + { + "regionTag": "aiplatform_v1beta1_generated_PersistentResourceService_UpdatePersistentResource_async", + "title": "DatasetService updatePersistentResource Sample", + "origin": "API_DEFINITION", + "description": " Updates a PersistentResource.", + "canonical": true, + "file": "persistent_resource_service.update_persistent_resource.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 63, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "UpdatePersistentResource", + "fullName": "google.cloud.aiplatform.v1beta1.PersistentResourceService.UpdatePersistentResource", + "async": true, + "parameters": [ + { + "name": "persistent_resource", + "type": ".google.cloud.aiplatform.v1beta1.PersistentResource" + }, + { + "name": "update_mask", + "type": ".google.protobuf.FieldMask" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "PersistentResourceServiceClient", + "fullName": "google.cloud.aiplatform.v1beta1.PersistentResourceServiceClient" + }, + "method": { + "shortName": "UpdatePersistentResource", + "fullName": "google.cloud.aiplatform.v1beta1.PersistentResourceService.UpdatePersistentResource", + "service": { + "shortName": "PersistentResourceService", + "fullName": "google.cloud.aiplatform.v1beta1.PersistentResourceService" + } + } + } + }, { "regionTag": "aiplatform_v1beta1_generated_PipelineService_CreateTrainingPipeline_async", "title": "DatasetService createTrainingPipeline Sample", @@ -10278,7 +10322,7 @@ "segments": [ { "start": 25, - "end": 68, + "end": 105, "type": "FULL" } ], @@ -10298,6 +10342,10 @@ { "name": "client_id", "type": "TYPE_STRING" + }, + { + "name": "contexts", + "type": "TYPE_MESSAGE[]" } ], "resultType": ".google.longrunning.Operation", diff --git a/packages/google-cloud-aiplatform/samples/generated/v1beta1/vizier_service.suggest_trials.js b/packages/google-cloud-aiplatform/samples/generated/v1beta1/vizier_service.suggest_trials.js index 308d06c8a01..2ff2e055124 100644 --- a/packages/google-cloud-aiplatform/samples/generated/v1beta1/vizier_service.suggest_trials.js +++ b/packages/google-cloud-aiplatform/samples/generated/v1beta1/vizier_service.suggest_trials.js @@ -44,6 +44,43 @@ function main(parent, suggestionCount, clientId) { * pending, and provide a new Trial if the last suggested Trial was completed. */ // const clientId = 'abc123' + /** + * Optional. This allows you to specify the "context" for a Trial; a context + * is a slice (a subspace) of the search space. + * Typical uses for contexts: + * 1) You are using Vizier to tune a server for best performance, but there's + * a strong weekly cycle. The context specifies the day-of-week. + * This allows Tuesday to generalize from Wednesday without assuming that + * everything is identical. + * 2) Imagine you're optimizing some medical treatment for people. + * As they walk in the door, you know certain facts about them + * (e.g. sex, weight, height, blood-pressure). Put that information in the + * context, and Vizier will adapt its suggestions to the patient. + * 3) You want to do a fair A/B test efficiently. Specify the "A" and "B" + * conditions as contexts, and Vizier will generalize between "A" and "B" + * conditions. If they are similar, this will allow Vizier to converge + * to the optimum faster than if "A" and "B" were separate Studies. + * NOTE: You can also enter contexts as REQUESTED Trials, e.g. via the + * CreateTrial() RPC; that's the asynchronous option where you don't need a + * close association between contexts and suggestions. + * NOTE: All the Parameters you set in a context MUST be defined in the + * Study. + * NOTE: You must supply 0 or $suggestion_count contexts. + * If you don't supply any contexts, Vizier will make suggestions + * from the full search space specified in the StudySpec; if you supply + * a full set of context, each suggestion will match the corresponding + * context. + * NOTE: A Context with no features set matches anything, and allows + * suggestions from the full search space. + * NOTE: Contexts MUST lie within the search space specified in the + * StudySpec. It's an error if they don't. + * NOTE: Contexts preferentially match ACTIVE then REQUESTED trials before + * new suggestions are generated. + * NOTE: Generation of suggestions involves a match between a Context and + * (optionally) a REQUESTED trial; if that match is not fully specified, a + * suggestion will be geneated in the merged subspace. + */ + // const contexts = [1,2,3,4] // Imports the Aiplatform library const {VizierServiceClient} = require('@google-cloud/aiplatform').v1beta1; diff --git a/packages/google-cloud-aiplatform/samples/package.json b/packages/google-cloud-aiplatform/samples/package.json index 88b91df541b..c7191cdb37e 100644 --- a/packages/google-cloud-aiplatform/samples/package.json +++ b/packages/google-cloud-aiplatform/samples/package.json @@ -13,7 +13,7 @@ "test": "mocha --timeout 1200000 test/*.js" }, "dependencies": { - "@google-cloud/aiplatform": "^3.1.0" + "@google-cloud/aiplatform": "^3.2.0" }, "devDependencies": { "chai": "^4.2.0", diff --git a/packages/google-cloud-aiplatform/src/v1/endpoint_service_client.ts b/packages/google-cloud-aiplatform/src/v1/endpoint_service_client.ts index e557587f662..dc902032182 100644 --- a/packages/google-cloud-aiplatform/src/v1/endpoint_service_client.ts +++ b/packages/google-cloud-aiplatform/src/v1/endpoint_service_client.ts @@ -2525,6 +2525,7 @@ export class EndpointServiceClient { * * A key including a space must be quoted. `labels."a key"`. * * Some examples: + * * * `endpoint=1` * * `displayName="myDisplayName"` * * `labels.myKey="myValue"` @@ -2543,6 +2544,7 @@ export class EndpointServiceClient { * A comma-separated list of fields to order by, sorted in ascending order. * Use "desc" after a field name for descending. * Supported fields: + * * * `display_name` * * `create_time` * * `update_time` @@ -2656,6 +2658,7 @@ export class EndpointServiceClient { * * A key including a space must be quoted. `labels."a key"`. * * Some examples: + * * * `endpoint=1` * * `displayName="myDisplayName"` * * `labels.myKey="myValue"` @@ -2674,6 +2677,7 @@ export class EndpointServiceClient { * A comma-separated list of fields to order by, sorted in ascending order. * Use "desc" after a field name for descending. * Supported fields: + * * * `display_name` * * `create_time` * * `update_time` @@ -2735,6 +2739,7 @@ export class EndpointServiceClient { * * A key including a space must be quoted. `labels."a key"`. * * Some examples: + * * * `endpoint=1` * * `displayName="myDisplayName"` * * `labels.myKey="myValue"` @@ -2753,6 +2758,7 @@ export class EndpointServiceClient { * A comma-separated list of fields to order by, sorted in ascending order. * Use "desc" after a field name for descending. * Supported fields: + * * * `display_name` * * `create_time` * * `update_time` diff --git a/packages/google-cloud-aiplatform/src/v1/vizier_service_client.ts b/packages/google-cloud-aiplatform/src/v1/vizier_service_client.ts index 5fb12abd98e..dcc7424a020 100644 --- a/packages/google-cloud-aiplatform/src/v1/vizier_service_client.ts +++ b/packages/google-cloud-aiplatform/src/v1/vizier_service_client.ts @@ -2553,6 +2553,43 @@ export class VizierServiceClient { * If multiple SuggestTrialsRequests have the same `client_id`, * the service will return the identical suggested Trial if the Trial is * pending, and provide a new Trial if the last suggested Trial was completed. + * @param {number[]} [request.contexts] + * Optional. This allows you to specify the "context" for a Trial; a context + * is a slice (a subspace) of the search space. + * + * Typical uses for contexts: + * 1) You are using Vizier to tune a server for best performance, but there's + * a strong weekly cycle. The context specifies the day-of-week. + * This allows Tuesday to generalize from Wednesday without assuming that + * everything is identical. + * 2) Imagine you're optimizing some medical treatment for people. + * As they walk in the door, you know certain facts about them + * (e.g. sex, weight, height, blood-pressure). Put that information in the + * context, and Vizier will adapt its suggestions to the patient. + * 3) You want to do a fair A/B test efficiently. Specify the "A" and "B" + * conditions as contexts, and Vizier will generalize between "A" and "B" + * conditions. If they are similar, this will allow Vizier to converge + * to the optimum faster than if "A" and "B" were separate Studies. + * NOTE: You can also enter contexts as REQUESTED Trials, e.g. via the + * CreateTrial() RPC; that's the asynchronous option where you don't need a + * close association between contexts and suggestions. + * + * NOTE: All the Parameters you set in a context MUST be defined in the + * Study. + * NOTE: You must supply 0 or $suggestion_count contexts. + * If you don't supply any contexts, Vizier will make suggestions + * from the full search space specified in the StudySpec; if you supply + * a full set of context, each suggestion will match the corresponding + * context. + * NOTE: A Context with no features set matches anything, and allows + * suggestions from the full search space. + * NOTE: Contexts MUST lie within the search space specified in the + * StudySpec. It's an error if they don't. + * NOTE: Contexts preferentially match ACTIVE then REQUESTED trials before + * new suggestions are generated. + * NOTE: Generation of suggestions involves a match between a Context and + * (optionally) a REQUESTED trial; if that match is not fully specified, a + * suggestion will be geneated in the merged subspace. * @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. diff --git a/packages/google-cloud-aiplatform/src/v1beta1/dataset_service_client.ts b/packages/google-cloud-aiplatform/src/v1beta1/dataset_service_client.ts index 4331a6dc3a8..96083f9453b 100644 --- a/packages/google-cloud-aiplatform/src/v1beta1/dataset_service_client.ts +++ b/packages/google-cloud-aiplatform/src/v1beta1/dataset_service_client.ts @@ -605,6 +605,15 @@ export class DatasetServiceClient { { post: '/v1beta1/{name=projects/*/locations/*/endpoints/*/operations/*}:cancel', }, + { + post: '/v1beta1/{name=projects/*/locations/*/extensionControllers/*/operations/*}:cancel', + }, + { + post: '/v1beta1/{name=projects/*/locations/*/extensions/*/operations/*}:cancel', + }, + { + post: '/v1beta1/{name=projects/*/locations/*/extensions/*/deployments/*/operations/*}:cancel', + }, { post: '/v1beta1/{name=projects/*/locations/*/featurestores/*/operations/*}:cancel', }, @@ -857,6 +866,18 @@ export class DatasetServiceClient { delete: '/v1beta1/{name=projects/*/locations/*/dataLabelingJobs/*/operations/*}', }, + { + delete: + '/v1beta1/{name=projects/*/locations/*/extensionControllers/*/operations/*}', + }, + { + delete: + '/v1beta1/{name=projects/*/locations/*/extensions/*/operations/*}', + }, + { + delete: + '/v1beta1/{name=projects/*/locations/*/extensions/*/deployments/*/operations/*}', + }, { delete: '/v1beta1/{name=projects/*/locations/*/hyperparameterTuningJobs/*/operations/*}', @@ -941,6 +962,14 @@ export class DatasetServiceClient { delete: '/v1beta1/{name=projects/*/locations/*/featureOnlineStores/*/operations/*}', }, + { + delete: + '/v1beta1/{name=projects/*/locations/*/featureGroups/*/operations/*}', + }, + { + delete: + '/v1beta1/{name=projects/*/locations/*/featureGroups/*/features/*/operations/*}', + }, { delete: '/v1beta1/{name=projects/*/locations/*/featureOnlineStores/*/featureViews/*/operations/*}', @@ -1060,6 +1089,15 @@ export class DatasetServiceClient { { get: '/v1beta1/{name=projects/*/locations/*/endpoints/*/operations/*}', }, + { + get: '/v1beta1/{name=projects/*/locations/*/extensionControllers/*/operations/*}', + }, + { + get: '/v1beta1/{name=projects/*/locations/*/extensions/*/operations/*}', + }, + { + get: '/v1beta1/{name=projects/*/locations/*/extensions/*/deployments/*/operations/*}', + }, { get: '/v1beta1/{name=projects/*/locations/*/featurestores/*/operations/*}', }, @@ -1141,6 +1179,12 @@ export class DatasetServiceClient { { get: '/v1beta1/{name=projects/*/locations/*/featureOnlineStores/*/featureViews/*/operations/*}', }, + { + get: '/v1beta1/{name=projects/*/locations/*/featureGroups/*/operations/*}', + }, + { + get: '/v1beta1/{name=projects/*/locations/*/featureGroups/*/features/*/operations/*}', + }, ], }, { @@ -1249,6 +1293,15 @@ export class DatasetServiceClient { { get: '/v1beta1/{name=projects/*/locations/*/endpoints/*}/operations', }, + { + get: '/v1beta1/{name=projects/*/locations/*/extensionControllers/*}/operations', + }, + { + get: '/v1beta1/{name=projects/*/locations/*/extensions/*}/operations', + }, + { + get: '/v1beta1/{name=projects/*/locations/*/extensions/*/deployments/*}/operations', + }, { get: '/v1beta1/{name=projects/*/locations/*/featurestores/*}/operations', }, @@ -1328,6 +1381,12 @@ export class DatasetServiceClient { { get: '/v1beta1/{name=projects/*/locations/*/featureOnlineStores/*/featureViews/*}/operations', }, + { + get: '/v1beta1/{name=projects/*/locations/*/featureGroups/*}/operations', + }, + { + get: '/v1beta1/{name=projects/*/locations/*/featureGroups/*/features/*}/operations', + }, ], }, { @@ -1452,6 +1511,15 @@ export class DatasetServiceClient { { post: '/v1beta1/{name=projects/*/locations/*/endpoints/*/operations/*}:wait', }, + { + post: '/v1beta1/{name=projects/*/locations/*/extensionControllers/*/operations/*}:wait', + }, + { + post: '/v1beta1/{name=projects/*/locations/*/extensions/*/operations/*}:wait', + }, + { + post: '/v1beta1/{name=projects/*/locations/*/extensions/*/deployments/*/operations/*}:wait', + }, { post: '/v1beta1/{name=projects/*/locations/*/featurestores/*/operations/*}:wait', }, @@ -1530,6 +1598,12 @@ export class DatasetServiceClient { { post: '/v1beta1/{name=projects/*/locations/*/featureOnlineStores/*/featureViews/*/operations/*}:wait', }, + { + post: '/v1beta1/{name=projects/*/locations/*/featureGroups/*/operations/*}:wait', + }, + { + post: '/v1beta1/{name=projects/*/locations/*/featureGroups/*/features/*/operations/*}:wait', + }, ], }, ]; diff --git a/packages/google-cloud-aiplatform/src/v1beta1/deployment_resource_pool_service_client.ts b/packages/google-cloud-aiplatform/src/v1beta1/deployment_resource_pool_service_client.ts index 27a286a3744..a17a193310e 100644 --- a/packages/google-cloud-aiplatform/src/v1beta1/deployment_resource_pool_service_client.ts +++ b/packages/google-cloud-aiplatform/src/v1beta1/deployment_resource_pool_service_client.ts @@ -594,6 +594,15 @@ export class DeploymentResourcePoolServiceClient { { post: '/v1beta1/{name=projects/*/locations/*/endpoints/*/operations/*}:cancel', }, + { + post: '/v1beta1/{name=projects/*/locations/*/extensionControllers/*/operations/*}:cancel', + }, + { + post: '/v1beta1/{name=projects/*/locations/*/extensions/*/operations/*}:cancel', + }, + { + post: '/v1beta1/{name=projects/*/locations/*/extensions/*/deployments/*/operations/*}:cancel', + }, { post: '/v1beta1/{name=projects/*/locations/*/featurestores/*/operations/*}:cancel', }, @@ -846,6 +855,18 @@ export class DeploymentResourcePoolServiceClient { delete: '/v1beta1/{name=projects/*/locations/*/dataLabelingJobs/*/operations/*}', }, + { + delete: + '/v1beta1/{name=projects/*/locations/*/extensionControllers/*/operations/*}', + }, + { + delete: + '/v1beta1/{name=projects/*/locations/*/extensions/*/operations/*}', + }, + { + delete: + '/v1beta1/{name=projects/*/locations/*/extensions/*/deployments/*/operations/*}', + }, { delete: '/v1beta1/{name=projects/*/locations/*/hyperparameterTuningJobs/*/operations/*}', @@ -930,6 +951,14 @@ export class DeploymentResourcePoolServiceClient { delete: '/v1beta1/{name=projects/*/locations/*/featureOnlineStores/*/operations/*}', }, + { + delete: + '/v1beta1/{name=projects/*/locations/*/featureGroups/*/operations/*}', + }, + { + delete: + '/v1beta1/{name=projects/*/locations/*/featureGroups/*/features/*/operations/*}', + }, { delete: '/v1beta1/{name=projects/*/locations/*/featureOnlineStores/*/featureViews/*/operations/*}', @@ -1049,6 +1078,15 @@ export class DeploymentResourcePoolServiceClient { { get: '/v1beta1/{name=projects/*/locations/*/endpoints/*/operations/*}', }, + { + get: '/v1beta1/{name=projects/*/locations/*/extensionControllers/*/operations/*}', + }, + { + get: '/v1beta1/{name=projects/*/locations/*/extensions/*/operations/*}', + }, + { + get: '/v1beta1/{name=projects/*/locations/*/extensions/*/deployments/*/operations/*}', + }, { get: '/v1beta1/{name=projects/*/locations/*/featurestores/*/operations/*}', }, @@ -1130,6 +1168,12 @@ export class DeploymentResourcePoolServiceClient { { get: '/v1beta1/{name=projects/*/locations/*/featureOnlineStores/*/featureViews/*/operations/*}', }, + { + get: '/v1beta1/{name=projects/*/locations/*/featureGroups/*/operations/*}', + }, + { + get: '/v1beta1/{name=projects/*/locations/*/featureGroups/*/features/*/operations/*}', + }, ], }, { @@ -1238,6 +1282,15 @@ export class DeploymentResourcePoolServiceClient { { get: '/v1beta1/{name=projects/*/locations/*/endpoints/*}/operations', }, + { + get: '/v1beta1/{name=projects/*/locations/*/extensionControllers/*}/operations', + }, + { + get: '/v1beta1/{name=projects/*/locations/*/extensions/*}/operations', + }, + { + get: '/v1beta1/{name=projects/*/locations/*/extensions/*/deployments/*}/operations', + }, { get: '/v1beta1/{name=projects/*/locations/*/featurestores/*}/operations', }, @@ -1317,6 +1370,12 @@ export class DeploymentResourcePoolServiceClient { { get: '/v1beta1/{name=projects/*/locations/*/featureOnlineStores/*/featureViews/*}/operations', }, + { + get: '/v1beta1/{name=projects/*/locations/*/featureGroups/*}/operations', + }, + { + get: '/v1beta1/{name=projects/*/locations/*/featureGroups/*/features/*}/operations', + }, ], }, { @@ -1441,6 +1500,15 @@ export class DeploymentResourcePoolServiceClient { { post: '/v1beta1/{name=projects/*/locations/*/endpoints/*/operations/*}:wait', }, + { + post: '/v1beta1/{name=projects/*/locations/*/extensionControllers/*/operations/*}:wait', + }, + { + post: '/v1beta1/{name=projects/*/locations/*/extensions/*/operations/*}:wait', + }, + { + post: '/v1beta1/{name=projects/*/locations/*/extensions/*/deployments/*/operations/*}:wait', + }, { post: '/v1beta1/{name=projects/*/locations/*/featurestores/*/operations/*}:wait', }, @@ -1519,6 +1587,12 @@ export class DeploymentResourcePoolServiceClient { { post: '/v1beta1/{name=projects/*/locations/*/featureOnlineStores/*/featureViews/*/operations/*}:wait', }, + { + post: '/v1beta1/{name=projects/*/locations/*/featureGroups/*/operations/*}:wait', + }, + { + post: '/v1beta1/{name=projects/*/locations/*/featureGroups/*/features/*/operations/*}:wait', + }, ], }, ]; diff --git a/packages/google-cloud-aiplatform/src/v1beta1/endpoint_service_client.ts b/packages/google-cloud-aiplatform/src/v1beta1/endpoint_service_client.ts index b0e60762a10..ce3494d3e51 100644 --- a/packages/google-cloud-aiplatform/src/v1beta1/endpoint_service_client.ts +++ b/packages/google-cloud-aiplatform/src/v1beta1/endpoint_service_client.ts @@ -585,6 +585,15 @@ export class EndpointServiceClient { { post: '/v1beta1/{name=projects/*/locations/*/endpoints/*/operations/*}:cancel', }, + { + post: '/v1beta1/{name=projects/*/locations/*/extensionControllers/*/operations/*}:cancel', + }, + { + post: '/v1beta1/{name=projects/*/locations/*/extensions/*/operations/*}:cancel', + }, + { + post: '/v1beta1/{name=projects/*/locations/*/extensions/*/deployments/*/operations/*}:cancel', + }, { post: '/v1beta1/{name=projects/*/locations/*/featurestores/*/operations/*}:cancel', }, @@ -837,6 +846,18 @@ export class EndpointServiceClient { delete: '/v1beta1/{name=projects/*/locations/*/dataLabelingJobs/*/operations/*}', }, + { + delete: + '/v1beta1/{name=projects/*/locations/*/extensionControllers/*/operations/*}', + }, + { + delete: + '/v1beta1/{name=projects/*/locations/*/extensions/*/operations/*}', + }, + { + delete: + '/v1beta1/{name=projects/*/locations/*/extensions/*/deployments/*/operations/*}', + }, { delete: '/v1beta1/{name=projects/*/locations/*/hyperparameterTuningJobs/*/operations/*}', @@ -921,6 +942,14 @@ export class EndpointServiceClient { delete: '/v1beta1/{name=projects/*/locations/*/featureOnlineStores/*/operations/*}', }, + { + delete: + '/v1beta1/{name=projects/*/locations/*/featureGroups/*/operations/*}', + }, + { + delete: + '/v1beta1/{name=projects/*/locations/*/featureGroups/*/features/*/operations/*}', + }, { delete: '/v1beta1/{name=projects/*/locations/*/featureOnlineStores/*/featureViews/*/operations/*}', @@ -1040,6 +1069,15 @@ export class EndpointServiceClient { { get: '/v1beta1/{name=projects/*/locations/*/endpoints/*/operations/*}', }, + { + get: '/v1beta1/{name=projects/*/locations/*/extensionControllers/*/operations/*}', + }, + { + get: '/v1beta1/{name=projects/*/locations/*/extensions/*/operations/*}', + }, + { + get: '/v1beta1/{name=projects/*/locations/*/extensions/*/deployments/*/operations/*}', + }, { get: '/v1beta1/{name=projects/*/locations/*/featurestores/*/operations/*}', }, @@ -1121,6 +1159,12 @@ export class EndpointServiceClient { { get: '/v1beta1/{name=projects/*/locations/*/featureOnlineStores/*/featureViews/*/operations/*}', }, + { + get: '/v1beta1/{name=projects/*/locations/*/featureGroups/*/operations/*}', + }, + { + get: '/v1beta1/{name=projects/*/locations/*/featureGroups/*/features/*/operations/*}', + }, ], }, { @@ -1229,6 +1273,15 @@ export class EndpointServiceClient { { get: '/v1beta1/{name=projects/*/locations/*/endpoints/*}/operations', }, + { + get: '/v1beta1/{name=projects/*/locations/*/extensionControllers/*}/operations', + }, + { + get: '/v1beta1/{name=projects/*/locations/*/extensions/*}/operations', + }, + { + get: '/v1beta1/{name=projects/*/locations/*/extensions/*/deployments/*}/operations', + }, { get: '/v1beta1/{name=projects/*/locations/*/featurestores/*}/operations', }, @@ -1308,6 +1361,12 @@ export class EndpointServiceClient { { get: '/v1beta1/{name=projects/*/locations/*/featureOnlineStores/*/featureViews/*}/operations', }, + { + get: '/v1beta1/{name=projects/*/locations/*/featureGroups/*}/operations', + }, + { + get: '/v1beta1/{name=projects/*/locations/*/featureGroups/*/features/*}/operations', + }, ], }, { @@ -1432,6 +1491,15 @@ export class EndpointServiceClient { { post: '/v1beta1/{name=projects/*/locations/*/endpoints/*/operations/*}:wait', }, + { + post: '/v1beta1/{name=projects/*/locations/*/extensionControllers/*/operations/*}:wait', + }, + { + post: '/v1beta1/{name=projects/*/locations/*/extensions/*/operations/*}:wait', + }, + { + post: '/v1beta1/{name=projects/*/locations/*/extensions/*/deployments/*/operations/*}:wait', + }, { post: '/v1beta1/{name=projects/*/locations/*/featurestores/*/operations/*}:wait', }, @@ -1510,6 +1578,12 @@ export class EndpointServiceClient { { post: '/v1beta1/{name=projects/*/locations/*/featureOnlineStores/*/featureViews/*/operations/*}:wait', }, + { + post: '/v1beta1/{name=projects/*/locations/*/featureGroups/*/operations/*}:wait', + }, + { + post: '/v1beta1/{name=projects/*/locations/*/featureGroups/*/features/*/operations/*}:wait', + }, ], }, ]; diff --git a/packages/google-cloud-aiplatform/src/v1beta1/featurestore_service_client.ts b/packages/google-cloud-aiplatform/src/v1beta1/featurestore_service_client.ts index b61638cf698..222c0bd2ed8 100644 --- a/packages/google-cloud-aiplatform/src/v1beta1/featurestore_service_client.ts +++ b/packages/google-cloud-aiplatform/src/v1beta1/featurestore_service_client.ts @@ -603,6 +603,15 @@ export class FeaturestoreServiceClient { { post: '/v1beta1/{name=projects/*/locations/*/endpoints/*/operations/*}:cancel', }, + { + post: '/v1beta1/{name=projects/*/locations/*/extensionControllers/*/operations/*}:cancel', + }, + { + post: '/v1beta1/{name=projects/*/locations/*/extensions/*/operations/*}:cancel', + }, + { + post: '/v1beta1/{name=projects/*/locations/*/extensions/*/deployments/*/operations/*}:cancel', + }, { post: '/v1beta1/{name=projects/*/locations/*/featurestores/*/operations/*}:cancel', }, @@ -855,6 +864,18 @@ export class FeaturestoreServiceClient { delete: '/v1beta1/{name=projects/*/locations/*/dataLabelingJobs/*/operations/*}', }, + { + delete: + '/v1beta1/{name=projects/*/locations/*/extensionControllers/*/operations/*}', + }, + { + delete: + '/v1beta1/{name=projects/*/locations/*/extensions/*/operations/*}', + }, + { + delete: + '/v1beta1/{name=projects/*/locations/*/extensions/*/deployments/*/operations/*}', + }, { delete: '/v1beta1/{name=projects/*/locations/*/hyperparameterTuningJobs/*/operations/*}', @@ -939,6 +960,14 @@ export class FeaturestoreServiceClient { delete: '/v1beta1/{name=projects/*/locations/*/featureOnlineStores/*/operations/*}', }, + { + delete: + '/v1beta1/{name=projects/*/locations/*/featureGroups/*/operations/*}', + }, + { + delete: + '/v1beta1/{name=projects/*/locations/*/featureGroups/*/features/*/operations/*}', + }, { delete: '/v1beta1/{name=projects/*/locations/*/featureOnlineStores/*/featureViews/*/operations/*}', @@ -1058,6 +1087,15 @@ export class FeaturestoreServiceClient { { get: '/v1beta1/{name=projects/*/locations/*/endpoints/*/operations/*}', }, + { + get: '/v1beta1/{name=projects/*/locations/*/extensionControllers/*/operations/*}', + }, + { + get: '/v1beta1/{name=projects/*/locations/*/extensions/*/operations/*}', + }, + { + get: '/v1beta1/{name=projects/*/locations/*/extensions/*/deployments/*/operations/*}', + }, { get: '/v1beta1/{name=projects/*/locations/*/featurestores/*/operations/*}', }, @@ -1139,6 +1177,12 @@ export class FeaturestoreServiceClient { { get: '/v1beta1/{name=projects/*/locations/*/featureOnlineStores/*/featureViews/*/operations/*}', }, + { + get: '/v1beta1/{name=projects/*/locations/*/featureGroups/*/operations/*}', + }, + { + get: '/v1beta1/{name=projects/*/locations/*/featureGroups/*/features/*/operations/*}', + }, ], }, { @@ -1247,6 +1291,15 @@ export class FeaturestoreServiceClient { { get: '/v1beta1/{name=projects/*/locations/*/endpoints/*}/operations', }, + { + get: '/v1beta1/{name=projects/*/locations/*/extensionControllers/*}/operations', + }, + { + get: '/v1beta1/{name=projects/*/locations/*/extensions/*}/operations', + }, + { + get: '/v1beta1/{name=projects/*/locations/*/extensions/*/deployments/*}/operations', + }, { get: '/v1beta1/{name=projects/*/locations/*/featurestores/*}/operations', }, @@ -1326,6 +1379,12 @@ export class FeaturestoreServiceClient { { get: '/v1beta1/{name=projects/*/locations/*/featureOnlineStores/*/featureViews/*}/operations', }, + { + get: '/v1beta1/{name=projects/*/locations/*/featureGroups/*}/operations', + }, + { + get: '/v1beta1/{name=projects/*/locations/*/featureGroups/*/features/*}/operations', + }, ], }, { @@ -1450,6 +1509,15 @@ export class FeaturestoreServiceClient { { post: '/v1beta1/{name=projects/*/locations/*/endpoints/*/operations/*}:wait', }, + { + post: '/v1beta1/{name=projects/*/locations/*/extensionControllers/*/operations/*}:wait', + }, + { + post: '/v1beta1/{name=projects/*/locations/*/extensions/*/operations/*}:wait', + }, + { + post: '/v1beta1/{name=projects/*/locations/*/extensions/*/deployments/*/operations/*}:wait', + }, { post: '/v1beta1/{name=projects/*/locations/*/featurestores/*/operations/*}:wait', }, @@ -1528,6 +1596,12 @@ export class FeaturestoreServiceClient { { post: '/v1beta1/{name=projects/*/locations/*/featureOnlineStores/*/featureViews/*/operations/*}:wait', }, + { + post: '/v1beta1/{name=projects/*/locations/*/featureGroups/*/operations/*}:wait', + }, + { + post: '/v1beta1/{name=projects/*/locations/*/featureGroups/*/features/*/operations/*}:wait', + }, ], }, ]; diff --git a/packages/google-cloud-aiplatform/src/v1beta1/gapic_metadata.json b/packages/google-cloud-aiplatform/src/v1beta1/gapic_metadata.json index 39d3daf02f6..0158c4e7934 100644 --- a/packages/google-cloud-aiplatform/src/v1beta1/gapic_metadata.json +++ b/packages/google-cloud-aiplatform/src/v1beta1/gapic_metadata.json @@ -1880,6 +1880,11 @@ "deletePersistentResource" ] }, + "UpdatePersistentResource": { + "methods": [ + "updatePersistentResource" + ] + }, "ListPersistentResources": { "methods": [ "listPersistentResources", @@ -1907,6 +1912,11 @@ "deletePersistentResource" ] }, + "UpdatePersistentResource": { + "methods": [ + "updatePersistentResource" + ] + }, "ListPersistentResources": { "methods": [ "listPersistentResources", diff --git a/packages/google-cloud-aiplatform/src/v1beta1/index_endpoint_service_client.ts b/packages/google-cloud-aiplatform/src/v1beta1/index_endpoint_service_client.ts index b22ad00f427..6bff7137ee2 100644 --- a/packages/google-cloud-aiplatform/src/v1beta1/index_endpoint_service_client.ts +++ b/packages/google-cloud-aiplatform/src/v1beta1/index_endpoint_service_client.ts @@ -585,6 +585,15 @@ export class IndexEndpointServiceClient { { post: '/v1beta1/{name=projects/*/locations/*/endpoints/*/operations/*}:cancel', }, + { + post: '/v1beta1/{name=projects/*/locations/*/extensionControllers/*/operations/*}:cancel', + }, + { + post: '/v1beta1/{name=projects/*/locations/*/extensions/*/operations/*}:cancel', + }, + { + post: '/v1beta1/{name=projects/*/locations/*/extensions/*/deployments/*/operations/*}:cancel', + }, { post: '/v1beta1/{name=projects/*/locations/*/featurestores/*/operations/*}:cancel', }, @@ -837,6 +846,18 @@ export class IndexEndpointServiceClient { delete: '/v1beta1/{name=projects/*/locations/*/dataLabelingJobs/*/operations/*}', }, + { + delete: + '/v1beta1/{name=projects/*/locations/*/extensionControllers/*/operations/*}', + }, + { + delete: + '/v1beta1/{name=projects/*/locations/*/extensions/*/operations/*}', + }, + { + delete: + '/v1beta1/{name=projects/*/locations/*/extensions/*/deployments/*/operations/*}', + }, { delete: '/v1beta1/{name=projects/*/locations/*/hyperparameterTuningJobs/*/operations/*}', @@ -921,6 +942,14 @@ export class IndexEndpointServiceClient { delete: '/v1beta1/{name=projects/*/locations/*/featureOnlineStores/*/operations/*}', }, + { + delete: + '/v1beta1/{name=projects/*/locations/*/featureGroups/*/operations/*}', + }, + { + delete: + '/v1beta1/{name=projects/*/locations/*/featureGroups/*/features/*/operations/*}', + }, { delete: '/v1beta1/{name=projects/*/locations/*/featureOnlineStores/*/featureViews/*/operations/*}', @@ -1040,6 +1069,15 @@ export class IndexEndpointServiceClient { { get: '/v1beta1/{name=projects/*/locations/*/endpoints/*/operations/*}', }, + { + get: '/v1beta1/{name=projects/*/locations/*/extensionControllers/*/operations/*}', + }, + { + get: '/v1beta1/{name=projects/*/locations/*/extensions/*/operations/*}', + }, + { + get: '/v1beta1/{name=projects/*/locations/*/extensions/*/deployments/*/operations/*}', + }, { get: '/v1beta1/{name=projects/*/locations/*/featurestores/*/operations/*}', }, @@ -1121,6 +1159,12 @@ export class IndexEndpointServiceClient { { get: '/v1beta1/{name=projects/*/locations/*/featureOnlineStores/*/featureViews/*/operations/*}', }, + { + get: '/v1beta1/{name=projects/*/locations/*/featureGroups/*/operations/*}', + }, + { + get: '/v1beta1/{name=projects/*/locations/*/featureGroups/*/features/*/operations/*}', + }, ], }, { @@ -1229,6 +1273,15 @@ export class IndexEndpointServiceClient { { get: '/v1beta1/{name=projects/*/locations/*/endpoints/*}/operations', }, + { + get: '/v1beta1/{name=projects/*/locations/*/extensionControllers/*}/operations', + }, + { + get: '/v1beta1/{name=projects/*/locations/*/extensions/*}/operations', + }, + { + get: '/v1beta1/{name=projects/*/locations/*/extensions/*/deployments/*}/operations', + }, { get: '/v1beta1/{name=projects/*/locations/*/featurestores/*}/operations', }, @@ -1308,6 +1361,12 @@ export class IndexEndpointServiceClient { { get: '/v1beta1/{name=projects/*/locations/*/featureOnlineStores/*/featureViews/*}/operations', }, + { + get: '/v1beta1/{name=projects/*/locations/*/featureGroups/*}/operations', + }, + { + get: '/v1beta1/{name=projects/*/locations/*/featureGroups/*/features/*}/operations', + }, ], }, { @@ -1432,6 +1491,15 @@ export class IndexEndpointServiceClient { { post: '/v1beta1/{name=projects/*/locations/*/endpoints/*/operations/*}:wait', }, + { + post: '/v1beta1/{name=projects/*/locations/*/extensionControllers/*/operations/*}:wait', + }, + { + post: '/v1beta1/{name=projects/*/locations/*/extensions/*/operations/*}:wait', + }, + { + post: '/v1beta1/{name=projects/*/locations/*/extensions/*/deployments/*/operations/*}:wait', + }, { post: '/v1beta1/{name=projects/*/locations/*/featurestores/*/operations/*}:wait', }, @@ -1510,6 +1578,12 @@ export class IndexEndpointServiceClient { { post: '/v1beta1/{name=projects/*/locations/*/featureOnlineStores/*/featureViews/*/operations/*}:wait', }, + { + post: '/v1beta1/{name=projects/*/locations/*/featureGroups/*/operations/*}:wait', + }, + { + post: '/v1beta1/{name=projects/*/locations/*/featureGroups/*/features/*/operations/*}:wait', + }, ], }, ]; diff --git a/packages/google-cloud-aiplatform/src/v1beta1/index_service_client.ts b/packages/google-cloud-aiplatform/src/v1beta1/index_service_client.ts index 32f97b495c1..77c05b2c432 100644 --- a/packages/google-cloud-aiplatform/src/v1beta1/index_service_client.ts +++ b/packages/google-cloud-aiplatform/src/v1beta1/index_service_client.ts @@ -585,6 +585,15 @@ export class IndexServiceClient { { post: '/v1beta1/{name=projects/*/locations/*/endpoints/*/operations/*}:cancel', }, + { + post: '/v1beta1/{name=projects/*/locations/*/extensionControllers/*/operations/*}:cancel', + }, + { + post: '/v1beta1/{name=projects/*/locations/*/extensions/*/operations/*}:cancel', + }, + { + post: '/v1beta1/{name=projects/*/locations/*/extensions/*/deployments/*/operations/*}:cancel', + }, { post: '/v1beta1/{name=projects/*/locations/*/featurestores/*/operations/*}:cancel', }, @@ -837,6 +846,18 @@ export class IndexServiceClient { delete: '/v1beta1/{name=projects/*/locations/*/dataLabelingJobs/*/operations/*}', }, + { + delete: + '/v1beta1/{name=projects/*/locations/*/extensionControllers/*/operations/*}', + }, + { + delete: + '/v1beta1/{name=projects/*/locations/*/extensions/*/operations/*}', + }, + { + delete: + '/v1beta1/{name=projects/*/locations/*/extensions/*/deployments/*/operations/*}', + }, { delete: '/v1beta1/{name=projects/*/locations/*/hyperparameterTuningJobs/*/operations/*}', @@ -921,6 +942,14 @@ export class IndexServiceClient { delete: '/v1beta1/{name=projects/*/locations/*/featureOnlineStores/*/operations/*}', }, + { + delete: + '/v1beta1/{name=projects/*/locations/*/featureGroups/*/operations/*}', + }, + { + delete: + '/v1beta1/{name=projects/*/locations/*/featureGroups/*/features/*/operations/*}', + }, { delete: '/v1beta1/{name=projects/*/locations/*/featureOnlineStores/*/featureViews/*/operations/*}', @@ -1040,6 +1069,15 @@ export class IndexServiceClient { { get: '/v1beta1/{name=projects/*/locations/*/endpoints/*/operations/*}', }, + { + get: '/v1beta1/{name=projects/*/locations/*/extensionControllers/*/operations/*}', + }, + { + get: '/v1beta1/{name=projects/*/locations/*/extensions/*/operations/*}', + }, + { + get: '/v1beta1/{name=projects/*/locations/*/extensions/*/deployments/*/operations/*}', + }, { get: '/v1beta1/{name=projects/*/locations/*/featurestores/*/operations/*}', }, @@ -1121,6 +1159,12 @@ export class IndexServiceClient { { get: '/v1beta1/{name=projects/*/locations/*/featureOnlineStores/*/featureViews/*/operations/*}', }, + { + get: '/v1beta1/{name=projects/*/locations/*/featureGroups/*/operations/*}', + }, + { + get: '/v1beta1/{name=projects/*/locations/*/featureGroups/*/features/*/operations/*}', + }, ], }, { @@ -1229,6 +1273,15 @@ export class IndexServiceClient { { get: '/v1beta1/{name=projects/*/locations/*/endpoints/*}/operations', }, + { + get: '/v1beta1/{name=projects/*/locations/*/extensionControllers/*}/operations', + }, + { + get: '/v1beta1/{name=projects/*/locations/*/extensions/*}/operations', + }, + { + get: '/v1beta1/{name=projects/*/locations/*/extensions/*/deployments/*}/operations', + }, { get: '/v1beta1/{name=projects/*/locations/*/featurestores/*}/operations', }, @@ -1308,6 +1361,12 @@ export class IndexServiceClient { { get: '/v1beta1/{name=projects/*/locations/*/featureOnlineStores/*/featureViews/*}/operations', }, + { + get: '/v1beta1/{name=projects/*/locations/*/featureGroups/*}/operations', + }, + { + get: '/v1beta1/{name=projects/*/locations/*/featureGroups/*/features/*}/operations', + }, ], }, { @@ -1432,6 +1491,15 @@ export class IndexServiceClient { { post: '/v1beta1/{name=projects/*/locations/*/endpoints/*/operations/*}:wait', }, + { + post: '/v1beta1/{name=projects/*/locations/*/extensionControllers/*/operations/*}:wait', + }, + { + post: '/v1beta1/{name=projects/*/locations/*/extensions/*/operations/*}:wait', + }, + { + post: '/v1beta1/{name=projects/*/locations/*/extensions/*/deployments/*/operations/*}:wait', + }, { post: '/v1beta1/{name=projects/*/locations/*/featurestores/*/operations/*}:wait', }, @@ -1510,6 +1578,12 @@ export class IndexServiceClient { { post: '/v1beta1/{name=projects/*/locations/*/featureOnlineStores/*/featureViews/*/operations/*}:wait', }, + { + post: '/v1beta1/{name=projects/*/locations/*/featureGroups/*/operations/*}:wait', + }, + { + post: '/v1beta1/{name=projects/*/locations/*/featureGroups/*/features/*/operations/*}:wait', + }, ], }, ]; diff --git a/packages/google-cloud-aiplatform/src/v1beta1/job_service_client.ts b/packages/google-cloud-aiplatform/src/v1beta1/job_service_client.ts index fb4a32d2b65..3e63b00cd5f 100644 --- a/packages/google-cloud-aiplatform/src/v1beta1/job_service_client.ts +++ b/packages/google-cloud-aiplatform/src/v1beta1/job_service_client.ts @@ -621,6 +621,15 @@ export class JobServiceClient { { post: '/v1beta1/{name=projects/*/locations/*/endpoints/*/operations/*}:cancel', }, + { + post: '/v1beta1/{name=projects/*/locations/*/extensionControllers/*/operations/*}:cancel', + }, + { + post: '/v1beta1/{name=projects/*/locations/*/extensions/*/operations/*}:cancel', + }, + { + post: '/v1beta1/{name=projects/*/locations/*/extensions/*/deployments/*/operations/*}:cancel', + }, { post: '/v1beta1/{name=projects/*/locations/*/featurestores/*/operations/*}:cancel', }, @@ -873,6 +882,18 @@ export class JobServiceClient { delete: '/v1beta1/{name=projects/*/locations/*/dataLabelingJobs/*/operations/*}', }, + { + delete: + '/v1beta1/{name=projects/*/locations/*/extensionControllers/*/operations/*}', + }, + { + delete: + '/v1beta1/{name=projects/*/locations/*/extensions/*/operations/*}', + }, + { + delete: + '/v1beta1/{name=projects/*/locations/*/extensions/*/deployments/*/operations/*}', + }, { delete: '/v1beta1/{name=projects/*/locations/*/hyperparameterTuningJobs/*/operations/*}', @@ -957,6 +978,14 @@ export class JobServiceClient { delete: '/v1beta1/{name=projects/*/locations/*/featureOnlineStores/*/operations/*}', }, + { + delete: + '/v1beta1/{name=projects/*/locations/*/featureGroups/*/operations/*}', + }, + { + delete: + '/v1beta1/{name=projects/*/locations/*/featureGroups/*/features/*/operations/*}', + }, { delete: '/v1beta1/{name=projects/*/locations/*/featureOnlineStores/*/featureViews/*/operations/*}', @@ -1076,6 +1105,15 @@ export class JobServiceClient { { get: '/v1beta1/{name=projects/*/locations/*/endpoints/*/operations/*}', }, + { + get: '/v1beta1/{name=projects/*/locations/*/extensionControllers/*/operations/*}', + }, + { + get: '/v1beta1/{name=projects/*/locations/*/extensions/*/operations/*}', + }, + { + get: '/v1beta1/{name=projects/*/locations/*/extensions/*/deployments/*/operations/*}', + }, { get: '/v1beta1/{name=projects/*/locations/*/featurestores/*/operations/*}', }, @@ -1157,6 +1195,12 @@ export class JobServiceClient { { get: '/v1beta1/{name=projects/*/locations/*/featureOnlineStores/*/featureViews/*/operations/*}', }, + { + get: '/v1beta1/{name=projects/*/locations/*/featureGroups/*/operations/*}', + }, + { + get: '/v1beta1/{name=projects/*/locations/*/featureGroups/*/features/*/operations/*}', + }, ], }, { @@ -1265,6 +1309,15 @@ export class JobServiceClient { { get: '/v1beta1/{name=projects/*/locations/*/endpoints/*}/operations', }, + { + get: '/v1beta1/{name=projects/*/locations/*/extensionControllers/*}/operations', + }, + { + get: '/v1beta1/{name=projects/*/locations/*/extensions/*}/operations', + }, + { + get: '/v1beta1/{name=projects/*/locations/*/extensions/*/deployments/*}/operations', + }, { get: '/v1beta1/{name=projects/*/locations/*/featurestores/*}/operations', }, @@ -1344,6 +1397,12 @@ export class JobServiceClient { { get: '/v1beta1/{name=projects/*/locations/*/featureOnlineStores/*/featureViews/*}/operations', }, + { + get: '/v1beta1/{name=projects/*/locations/*/featureGroups/*}/operations', + }, + { + get: '/v1beta1/{name=projects/*/locations/*/featureGroups/*/features/*}/operations', + }, ], }, { @@ -1468,6 +1527,15 @@ export class JobServiceClient { { post: '/v1beta1/{name=projects/*/locations/*/endpoints/*/operations/*}:wait', }, + { + post: '/v1beta1/{name=projects/*/locations/*/extensionControllers/*/operations/*}:wait', + }, + { + post: '/v1beta1/{name=projects/*/locations/*/extensions/*/operations/*}:wait', + }, + { + post: '/v1beta1/{name=projects/*/locations/*/extensions/*/deployments/*/operations/*}:wait', + }, { post: '/v1beta1/{name=projects/*/locations/*/featurestores/*/operations/*}:wait', }, @@ -1546,6 +1614,12 @@ export class JobServiceClient { { post: '/v1beta1/{name=projects/*/locations/*/featureOnlineStores/*/featureViews/*/operations/*}:wait', }, + { + post: '/v1beta1/{name=projects/*/locations/*/featureGroups/*/operations/*}:wait', + }, + { + post: '/v1beta1/{name=projects/*/locations/*/featureGroups/*/features/*/operations/*}:wait', + }, ], }, ]; diff --git a/packages/google-cloud-aiplatform/src/v1beta1/metadata_service_client.ts b/packages/google-cloud-aiplatform/src/v1beta1/metadata_service_client.ts index 0ef77f28d0b..e53e7f562af 100644 --- a/packages/google-cloud-aiplatform/src/v1beta1/metadata_service_client.ts +++ b/packages/google-cloud-aiplatform/src/v1beta1/metadata_service_client.ts @@ -608,6 +608,15 @@ export class MetadataServiceClient { { post: '/v1beta1/{name=projects/*/locations/*/endpoints/*/operations/*}:cancel', }, + { + post: '/v1beta1/{name=projects/*/locations/*/extensionControllers/*/operations/*}:cancel', + }, + { + post: '/v1beta1/{name=projects/*/locations/*/extensions/*/operations/*}:cancel', + }, + { + post: '/v1beta1/{name=projects/*/locations/*/extensions/*/deployments/*/operations/*}:cancel', + }, { post: '/v1beta1/{name=projects/*/locations/*/featurestores/*/operations/*}:cancel', }, @@ -860,6 +869,18 @@ export class MetadataServiceClient { delete: '/v1beta1/{name=projects/*/locations/*/dataLabelingJobs/*/operations/*}', }, + { + delete: + '/v1beta1/{name=projects/*/locations/*/extensionControllers/*/operations/*}', + }, + { + delete: + '/v1beta1/{name=projects/*/locations/*/extensions/*/operations/*}', + }, + { + delete: + '/v1beta1/{name=projects/*/locations/*/extensions/*/deployments/*/operations/*}', + }, { delete: '/v1beta1/{name=projects/*/locations/*/hyperparameterTuningJobs/*/operations/*}', @@ -944,6 +965,14 @@ export class MetadataServiceClient { delete: '/v1beta1/{name=projects/*/locations/*/featureOnlineStores/*/operations/*}', }, + { + delete: + '/v1beta1/{name=projects/*/locations/*/featureGroups/*/operations/*}', + }, + { + delete: + '/v1beta1/{name=projects/*/locations/*/featureGroups/*/features/*/operations/*}', + }, { delete: '/v1beta1/{name=projects/*/locations/*/featureOnlineStores/*/featureViews/*/operations/*}', @@ -1063,6 +1092,15 @@ export class MetadataServiceClient { { get: '/v1beta1/{name=projects/*/locations/*/endpoints/*/operations/*}', }, + { + get: '/v1beta1/{name=projects/*/locations/*/extensionControllers/*/operations/*}', + }, + { + get: '/v1beta1/{name=projects/*/locations/*/extensions/*/operations/*}', + }, + { + get: '/v1beta1/{name=projects/*/locations/*/extensions/*/deployments/*/operations/*}', + }, { get: '/v1beta1/{name=projects/*/locations/*/featurestores/*/operations/*}', }, @@ -1144,6 +1182,12 @@ export class MetadataServiceClient { { get: '/v1beta1/{name=projects/*/locations/*/featureOnlineStores/*/featureViews/*/operations/*}', }, + { + get: '/v1beta1/{name=projects/*/locations/*/featureGroups/*/operations/*}', + }, + { + get: '/v1beta1/{name=projects/*/locations/*/featureGroups/*/features/*/operations/*}', + }, ], }, { @@ -1252,6 +1296,15 @@ export class MetadataServiceClient { { get: '/v1beta1/{name=projects/*/locations/*/endpoints/*}/operations', }, + { + get: '/v1beta1/{name=projects/*/locations/*/extensionControllers/*}/operations', + }, + { + get: '/v1beta1/{name=projects/*/locations/*/extensions/*}/operations', + }, + { + get: '/v1beta1/{name=projects/*/locations/*/extensions/*/deployments/*}/operations', + }, { get: '/v1beta1/{name=projects/*/locations/*/featurestores/*}/operations', }, @@ -1331,6 +1384,12 @@ export class MetadataServiceClient { { get: '/v1beta1/{name=projects/*/locations/*/featureOnlineStores/*/featureViews/*}/operations', }, + { + get: '/v1beta1/{name=projects/*/locations/*/featureGroups/*}/operations', + }, + { + get: '/v1beta1/{name=projects/*/locations/*/featureGroups/*/features/*}/operations', + }, ], }, { @@ -1455,6 +1514,15 @@ export class MetadataServiceClient { { post: '/v1beta1/{name=projects/*/locations/*/endpoints/*/operations/*}:wait', }, + { + post: '/v1beta1/{name=projects/*/locations/*/extensionControllers/*/operations/*}:wait', + }, + { + post: '/v1beta1/{name=projects/*/locations/*/extensions/*/operations/*}:wait', + }, + { + post: '/v1beta1/{name=projects/*/locations/*/extensions/*/deployments/*/operations/*}:wait', + }, { post: '/v1beta1/{name=projects/*/locations/*/featurestores/*/operations/*}:wait', }, @@ -1533,6 +1601,12 @@ export class MetadataServiceClient { { post: '/v1beta1/{name=projects/*/locations/*/featureOnlineStores/*/featureViews/*/operations/*}:wait', }, + { + post: '/v1beta1/{name=projects/*/locations/*/featureGroups/*/operations/*}:wait', + }, + { + post: '/v1beta1/{name=projects/*/locations/*/featureGroups/*/features/*/operations/*}:wait', + }, ], }, ]; diff --git a/packages/google-cloud-aiplatform/src/v1beta1/migration_service_client.ts b/packages/google-cloud-aiplatform/src/v1beta1/migration_service_client.ts index 6920b50675f..45be0041b49 100644 --- a/packages/google-cloud-aiplatform/src/v1beta1/migration_service_client.ts +++ b/packages/google-cloud-aiplatform/src/v1beta1/migration_service_client.ts @@ -586,6 +586,15 @@ export class MigrationServiceClient { { post: '/v1beta1/{name=projects/*/locations/*/endpoints/*/operations/*}:cancel', }, + { + post: '/v1beta1/{name=projects/*/locations/*/extensionControllers/*/operations/*}:cancel', + }, + { + post: '/v1beta1/{name=projects/*/locations/*/extensions/*/operations/*}:cancel', + }, + { + post: '/v1beta1/{name=projects/*/locations/*/extensions/*/deployments/*/operations/*}:cancel', + }, { post: '/v1beta1/{name=projects/*/locations/*/featurestores/*/operations/*}:cancel', }, @@ -838,6 +847,18 @@ export class MigrationServiceClient { delete: '/v1beta1/{name=projects/*/locations/*/dataLabelingJobs/*/operations/*}', }, + { + delete: + '/v1beta1/{name=projects/*/locations/*/extensionControllers/*/operations/*}', + }, + { + delete: + '/v1beta1/{name=projects/*/locations/*/extensions/*/operations/*}', + }, + { + delete: + '/v1beta1/{name=projects/*/locations/*/extensions/*/deployments/*/operations/*}', + }, { delete: '/v1beta1/{name=projects/*/locations/*/hyperparameterTuningJobs/*/operations/*}', @@ -922,6 +943,14 @@ export class MigrationServiceClient { delete: '/v1beta1/{name=projects/*/locations/*/featureOnlineStores/*/operations/*}', }, + { + delete: + '/v1beta1/{name=projects/*/locations/*/featureGroups/*/operations/*}', + }, + { + delete: + '/v1beta1/{name=projects/*/locations/*/featureGroups/*/features/*/operations/*}', + }, { delete: '/v1beta1/{name=projects/*/locations/*/featureOnlineStores/*/featureViews/*/operations/*}', @@ -1041,6 +1070,15 @@ export class MigrationServiceClient { { get: '/v1beta1/{name=projects/*/locations/*/endpoints/*/operations/*}', }, + { + get: '/v1beta1/{name=projects/*/locations/*/extensionControllers/*/operations/*}', + }, + { + get: '/v1beta1/{name=projects/*/locations/*/extensions/*/operations/*}', + }, + { + get: '/v1beta1/{name=projects/*/locations/*/extensions/*/deployments/*/operations/*}', + }, { get: '/v1beta1/{name=projects/*/locations/*/featurestores/*/operations/*}', }, @@ -1122,6 +1160,12 @@ export class MigrationServiceClient { { get: '/v1beta1/{name=projects/*/locations/*/featureOnlineStores/*/featureViews/*/operations/*}', }, + { + get: '/v1beta1/{name=projects/*/locations/*/featureGroups/*/operations/*}', + }, + { + get: '/v1beta1/{name=projects/*/locations/*/featureGroups/*/features/*/operations/*}', + }, ], }, { @@ -1230,6 +1274,15 @@ export class MigrationServiceClient { { get: '/v1beta1/{name=projects/*/locations/*/endpoints/*}/operations', }, + { + get: '/v1beta1/{name=projects/*/locations/*/extensionControllers/*}/operations', + }, + { + get: '/v1beta1/{name=projects/*/locations/*/extensions/*}/operations', + }, + { + get: '/v1beta1/{name=projects/*/locations/*/extensions/*/deployments/*}/operations', + }, { get: '/v1beta1/{name=projects/*/locations/*/featurestores/*}/operations', }, @@ -1309,6 +1362,12 @@ export class MigrationServiceClient { { get: '/v1beta1/{name=projects/*/locations/*/featureOnlineStores/*/featureViews/*}/operations', }, + { + get: '/v1beta1/{name=projects/*/locations/*/featureGroups/*}/operations', + }, + { + get: '/v1beta1/{name=projects/*/locations/*/featureGroups/*/features/*}/operations', + }, ], }, { @@ -1433,6 +1492,15 @@ export class MigrationServiceClient { { post: '/v1beta1/{name=projects/*/locations/*/endpoints/*/operations/*}:wait', }, + { + post: '/v1beta1/{name=projects/*/locations/*/extensionControllers/*/operations/*}:wait', + }, + { + post: '/v1beta1/{name=projects/*/locations/*/extensions/*/operations/*}:wait', + }, + { + post: '/v1beta1/{name=projects/*/locations/*/extensions/*/deployments/*/operations/*}:wait', + }, { post: '/v1beta1/{name=projects/*/locations/*/featurestores/*/operations/*}:wait', }, @@ -1511,6 +1579,12 @@ export class MigrationServiceClient { { post: '/v1beta1/{name=projects/*/locations/*/featureOnlineStores/*/featureViews/*/operations/*}:wait', }, + { + post: '/v1beta1/{name=projects/*/locations/*/featureGroups/*/operations/*}:wait', + }, + { + post: '/v1beta1/{name=projects/*/locations/*/featureGroups/*/features/*/operations/*}:wait', + }, ], }, ]; diff --git a/packages/google-cloud-aiplatform/src/v1beta1/model_service_client.ts b/packages/google-cloud-aiplatform/src/v1beta1/model_service_client.ts index 508a2ca347d..857becf2883 100644 --- a/packages/google-cloud-aiplatform/src/v1beta1/model_service_client.ts +++ b/packages/google-cloud-aiplatform/src/v1beta1/model_service_client.ts @@ -600,6 +600,15 @@ export class ModelServiceClient { { post: '/v1beta1/{name=projects/*/locations/*/endpoints/*/operations/*}:cancel', }, + { + post: '/v1beta1/{name=projects/*/locations/*/extensionControllers/*/operations/*}:cancel', + }, + { + post: '/v1beta1/{name=projects/*/locations/*/extensions/*/operations/*}:cancel', + }, + { + post: '/v1beta1/{name=projects/*/locations/*/extensions/*/deployments/*/operations/*}:cancel', + }, { post: '/v1beta1/{name=projects/*/locations/*/featurestores/*/operations/*}:cancel', }, @@ -852,6 +861,18 @@ export class ModelServiceClient { delete: '/v1beta1/{name=projects/*/locations/*/dataLabelingJobs/*/operations/*}', }, + { + delete: + '/v1beta1/{name=projects/*/locations/*/extensionControllers/*/operations/*}', + }, + { + delete: + '/v1beta1/{name=projects/*/locations/*/extensions/*/operations/*}', + }, + { + delete: + '/v1beta1/{name=projects/*/locations/*/extensions/*/deployments/*/operations/*}', + }, { delete: '/v1beta1/{name=projects/*/locations/*/hyperparameterTuningJobs/*/operations/*}', @@ -936,6 +957,14 @@ export class ModelServiceClient { delete: '/v1beta1/{name=projects/*/locations/*/featureOnlineStores/*/operations/*}', }, + { + delete: + '/v1beta1/{name=projects/*/locations/*/featureGroups/*/operations/*}', + }, + { + delete: + '/v1beta1/{name=projects/*/locations/*/featureGroups/*/features/*/operations/*}', + }, { delete: '/v1beta1/{name=projects/*/locations/*/featureOnlineStores/*/featureViews/*/operations/*}', @@ -1055,6 +1084,15 @@ export class ModelServiceClient { { get: '/v1beta1/{name=projects/*/locations/*/endpoints/*/operations/*}', }, + { + get: '/v1beta1/{name=projects/*/locations/*/extensionControllers/*/operations/*}', + }, + { + get: '/v1beta1/{name=projects/*/locations/*/extensions/*/operations/*}', + }, + { + get: '/v1beta1/{name=projects/*/locations/*/extensions/*/deployments/*/operations/*}', + }, { get: '/v1beta1/{name=projects/*/locations/*/featurestores/*/operations/*}', }, @@ -1136,6 +1174,12 @@ export class ModelServiceClient { { get: '/v1beta1/{name=projects/*/locations/*/featureOnlineStores/*/featureViews/*/operations/*}', }, + { + get: '/v1beta1/{name=projects/*/locations/*/featureGroups/*/operations/*}', + }, + { + get: '/v1beta1/{name=projects/*/locations/*/featureGroups/*/features/*/operations/*}', + }, ], }, { @@ -1244,6 +1288,15 @@ export class ModelServiceClient { { get: '/v1beta1/{name=projects/*/locations/*/endpoints/*}/operations', }, + { + get: '/v1beta1/{name=projects/*/locations/*/extensionControllers/*}/operations', + }, + { + get: '/v1beta1/{name=projects/*/locations/*/extensions/*}/operations', + }, + { + get: '/v1beta1/{name=projects/*/locations/*/extensions/*/deployments/*}/operations', + }, { get: '/v1beta1/{name=projects/*/locations/*/featurestores/*}/operations', }, @@ -1323,6 +1376,12 @@ export class ModelServiceClient { { get: '/v1beta1/{name=projects/*/locations/*/featureOnlineStores/*/featureViews/*}/operations', }, + { + get: '/v1beta1/{name=projects/*/locations/*/featureGroups/*}/operations', + }, + { + get: '/v1beta1/{name=projects/*/locations/*/featureGroups/*/features/*}/operations', + }, ], }, { @@ -1447,6 +1506,15 @@ export class ModelServiceClient { { post: '/v1beta1/{name=projects/*/locations/*/endpoints/*/operations/*}:wait', }, + { + post: '/v1beta1/{name=projects/*/locations/*/extensionControllers/*/operations/*}:wait', + }, + { + post: '/v1beta1/{name=projects/*/locations/*/extensions/*/operations/*}:wait', + }, + { + post: '/v1beta1/{name=projects/*/locations/*/extensions/*/deployments/*/operations/*}:wait', + }, { post: '/v1beta1/{name=projects/*/locations/*/featurestores/*/operations/*}:wait', }, @@ -1525,6 +1593,12 @@ export class ModelServiceClient { { post: '/v1beta1/{name=projects/*/locations/*/featureOnlineStores/*/featureViews/*/operations/*}:wait', }, + { + post: '/v1beta1/{name=projects/*/locations/*/featureGroups/*/operations/*}:wait', + }, + { + post: '/v1beta1/{name=projects/*/locations/*/featureGroups/*/features/*/operations/*}:wait', + }, ], }, ]; diff --git a/packages/google-cloud-aiplatform/src/v1beta1/persistent_resource_service_client.ts b/packages/google-cloud-aiplatform/src/v1beta1/persistent_resource_service_client.ts index aaf5f450387..2144aeb6b8f 100644 --- a/packages/google-cloud-aiplatform/src/v1beta1/persistent_resource_service_client.ts +++ b/packages/google-cloud-aiplatform/src/v1beta1/persistent_resource_service_client.ts @@ -586,6 +586,15 @@ export class PersistentResourceServiceClient { { post: '/v1beta1/{name=projects/*/locations/*/endpoints/*/operations/*}:cancel', }, + { + post: '/v1beta1/{name=projects/*/locations/*/extensionControllers/*/operations/*}:cancel', + }, + { + post: '/v1beta1/{name=projects/*/locations/*/extensions/*/operations/*}:cancel', + }, + { + post: '/v1beta1/{name=projects/*/locations/*/extensions/*/deployments/*/operations/*}:cancel', + }, { post: '/v1beta1/{name=projects/*/locations/*/featurestores/*/operations/*}:cancel', }, @@ -838,6 +847,18 @@ export class PersistentResourceServiceClient { delete: '/v1beta1/{name=projects/*/locations/*/dataLabelingJobs/*/operations/*}', }, + { + delete: + '/v1beta1/{name=projects/*/locations/*/extensionControllers/*/operations/*}', + }, + { + delete: + '/v1beta1/{name=projects/*/locations/*/extensions/*/operations/*}', + }, + { + delete: + '/v1beta1/{name=projects/*/locations/*/extensions/*/deployments/*/operations/*}', + }, { delete: '/v1beta1/{name=projects/*/locations/*/hyperparameterTuningJobs/*/operations/*}', @@ -922,6 +943,14 @@ export class PersistentResourceServiceClient { delete: '/v1beta1/{name=projects/*/locations/*/featureOnlineStores/*/operations/*}', }, + { + delete: + '/v1beta1/{name=projects/*/locations/*/featureGroups/*/operations/*}', + }, + { + delete: + '/v1beta1/{name=projects/*/locations/*/featureGroups/*/features/*/operations/*}', + }, { delete: '/v1beta1/{name=projects/*/locations/*/featureOnlineStores/*/featureViews/*/operations/*}', @@ -1041,6 +1070,15 @@ export class PersistentResourceServiceClient { { get: '/v1beta1/{name=projects/*/locations/*/endpoints/*/operations/*}', }, + { + get: '/v1beta1/{name=projects/*/locations/*/extensionControllers/*/operations/*}', + }, + { + get: '/v1beta1/{name=projects/*/locations/*/extensions/*/operations/*}', + }, + { + get: '/v1beta1/{name=projects/*/locations/*/extensions/*/deployments/*/operations/*}', + }, { get: '/v1beta1/{name=projects/*/locations/*/featurestores/*/operations/*}', }, @@ -1122,6 +1160,12 @@ export class PersistentResourceServiceClient { { get: '/v1beta1/{name=projects/*/locations/*/featureOnlineStores/*/featureViews/*/operations/*}', }, + { + get: '/v1beta1/{name=projects/*/locations/*/featureGroups/*/operations/*}', + }, + { + get: '/v1beta1/{name=projects/*/locations/*/featureGroups/*/features/*/operations/*}', + }, ], }, { @@ -1230,6 +1274,15 @@ export class PersistentResourceServiceClient { { get: '/v1beta1/{name=projects/*/locations/*/endpoints/*}/operations', }, + { + get: '/v1beta1/{name=projects/*/locations/*/extensionControllers/*}/operations', + }, + { + get: '/v1beta1/{name=projects/*/locations/*/extensions/*}/operations', + }, + { + get: '/v1beta1/{name=projects/*/locations/*/extensions/*/deployments/*}/operations', + }, { get: '/v1beta1/{name=projects/*/locations/*/featurestores/*}/operations', }, @@ -1309,6 +1362,12 @@ export class PersistentResourceServiceClient { { get: '/v1beta1/{name=projects/*/locations/*/featureOnlineStores/*/featureViews/*}/operations', }, + { + get: '/v1beta1/{name=projects/*/locations/*/featureGroups/*}/operations', + }, + { + get: '/v1beta1/{name=projects/*/locations/*/featureGroups/*/features/*}/operations', + }, ], }, { @@ -1433,6 +1492,15 @@ export class PersistentResourceServiceClient { { post: '/v1beta1/{name=projects/*/locations/*/endpoints/*/operations/*}:wait', }, + { + post: '/v1beta1/{name=projects/*/locations/*/extensionControllers/*/operations/*}:wait', + }, + { + post: '/v1beta1/{name=projects/*/locations/*/extensions/*/operations/*}:wait', + }, + { + post: '/v1beta1/{name=projects/*/locations/*/extensions/*/deployments/*/operations/*}:wait', + }, { post: '/v1beta1/{name=projects/*/locations/*/featurestores/*/operations/*}:wait', }, @@ -1511,6 +1579,12 @@ export class PersistentResourceServiceClient { { post: '/v1beta1/{name=projects/*/locations/*/featureOnlineStores/*/featureViews/*/operations/*}:wait', }, + { + post: '/v1beta1/{name=projects/*/locations/*/featureGroups/*/operations/*}:wait', + }, + { + post: '/v1beta1/{name=projects/*/locations/*/featureGroups/*/features/*/operations/*}:wait', + }, ], }, ]; @@ -1530,6 +1604,12 @@ export class PersistentResourceServiceClient { const deletePersistentResourceMetadata = protoFilesRoot.lookup( '.google.cloud.aiplatform.v1beta1.DeleteOperationMetadata' ) as gax.protobuf.Type; + const updatePersistentResourceResponse = protoFilesRoot.lookup( + '.google.cloud.aiplatform.v1beta1.PersistentResource' + ) as gax.protobuf.Type; + const updatePersistentResourceMetadata = protoFilesRoot.lookup( + '.google.cloud.aiplatform.v1beta1.UpdatePersistentResourceOperationMetadata' + ) as gax.protobuf.Type; this.descriptors.longrunning = { createPersistentResource: new this._gaxModule.LongrunningDescriptor( @@ -1550,6 +1630,15 @@ export class PersistentResourceServiceClient { deletePersistentResourceMetadata ) ), + updatePersistentResource: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + updatePersistentResourceResponse.decode.bind( + updatePersistentResourceResponse + ), + updatePersistentResourceMetadata.decode.bind( + updatePersistentResourceMetadata + ) + ), }; // Put together the default options sent with requests. @@ -1607,6 +1696,7 @@ export class PersistentResourceServiceClient { 'getPersistentResource', 'listPersistentResources', 'deletePersistentResource', + 'updatePersistentResource', ]; for (const methodName of persistentResourceServiceStubMethods) { const callPromise = this.persistentResourceServiceStub.then( @@ -2083,6 +2173,153 @@ export class PersistentResourceServiceClient { protos.google.cloud.aiplatform.v1beta1.DeleteOperationMetadata >; } + /** + * Updates a PersistentResource. + * + * @param {Object} request + * The request object that will be sent. + * @param {google.cloud.aiplatform.v1beta1.PersistentResource} request.persistentResource + * Required. The PersistentResource to update. + * + * The PersistentResource's `name` field is used to identify the + * PersistentResource to update. Format: + * `projects/{project}/locations/{location}/persistentResources/{persistent_resource}` + * @param {google.protobuf.FieldMask} request.updateMask + * Required. Specify the fields to be overwritten in the PersistentResource by + * the update method. + * @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/v1beta1/persistent_resource_service.update_persistent_resource.js + * region_tag:aiplatform_v1beta1_generated_PersistentResourceService_UpdatePersistentResource_async + */ + updatePersistentResource( + request?: protos.google.cloud.aiplatform.v1beta1.IUpdatePersistentResourceRequest, + options?: CallOptions + ): Promise< + [ + LROperation< + protos.google.cloud.aiplatform.v1beta1.IPersistentResource, + protos.google.cloud.aiplatform.v1beta1.IUpdatePersistentResourceOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined, + ] + >; + updatePersistentResource( + request: protos.google.cloud.aiplatform.v1beta1.IUpdatePersistentResourceRequest, + options: CallOptions, + callback: Callback< + LROperation< + protos.google.cloud.aiplatform.v1beta1.IPersistentResource, + protos.google.cloud.aiplatform.v1beta1.IUpdatePersistentResourceOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + updatePersistentResource( + request: protos.google.cloud.aiplatform.v1beta1.IUpdatePersistentResourceRequest, + callback: Callback< + LROperation< + protos.google.cloud.aiplatform.v1beta1.IPersistentResource, + protos.google.cloud.aiplatform.v1beta1.IUpdatePersistentResourceOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + updatePersistentResource( + request?: protos.google.cloud.aiplatform.v1beta1.IUpdatePersistentResourceRequest, + optionsOrCallback?: + | CallOptions + | Callback< + LROperation< + protos.google.cloud.aiplatform.v1beta1.IPersistentResource, + protos.google.cloud.aiplatform.v1beta1.IUpdatePersistentResourceOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + callback?: Callback< + LROperation< + protos.google.cloud.aiplatform.v1beta1.IPersistentResource, + protos.google.cloud.aiplatform.v1beta1.IUpdatePersistentResourceOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): Promise< + [ + LROperation< + protos.google.cloud.aiplatform.v1beta1.IPersistentResource, + protos.google.cloud.aiplatform.v1beta1.IUpdatePersistentResourceOperationMetadata + >, + 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({ + 'persistent_resource.name': request.persistentResource!.name ?? '', + }); + this.initialize(); + return this.innerApiCalls.updatePersistentResource( + request, + options, + callback + ); + } + /** + * Check the status of the long running operation returned by `updatePersistentResource()`. + * @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/v1beta1/persistent_resource_service.update_persistent_resource.js + * region_tag:aiplatform_v1beta1_generated_PersistentResourceService_UpdatePersistentResource_async + */ + async checkUpdatePersistentResourceProgress( + name: string + ): Promise< + LROperation< + protos.google.cloud.aiplatform.v1beta1.PersistentResource, + protos.google.cloud.aiplatform.v1beta1.UpdatePersistentResourceOperationMetadata + > + > { + 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.updatePersistentResource, + this._gaxModule.createDefaultBackoffSettings() + ); + return decodeOperation as LROperation< + protos.google.cloud.aiplatform.v1beta1.PersistentResource, + protos.google.cloud.aiplatform.v1beta1.UpdatePersistentResourceOperationMetadata + >; + } /** * Lists PersistentResources in a Location. * diff --git a/packages/google-cloud-aiplatform/src/v1beta1/persistent_resource_service_client_config.json b/packages/google-cloud-aiplatform/src/v1beta1/persistent_resource_service_client_config.json index 7c78985843d..8fd0c9c0e2c 100644 --- a/packages/google-cloud-aiplatform/src/v1beta1/persistent_resource_service_client_config.json +++ b/packages/google-cloud-aiplatform/src/v1beta1/persistent_resource_service_client_config.json @@ -35,6 +35,10 @@ "DeletePersistentResource": { "retry_codes_name": "non_idempotent", "retry_params_name": "default" + }, + "UpdatePersistentResource": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" } } } diff --git a/packages/google-cloud-aiplatform/src/v1beta1/pipeline_service_client.ts b/packages/google-cloud-aiplatform/src/v1beta1/pipeline_service_client.ts index 339de351f4e..3a785466a67 100644 --- a/packages/google-cloud-aiplatform/src/v1beta1/pipeline_service_client.ts +++ b/packages/google-cloud-aiplatform/src/v1beta1/pipeline_service_client.ts @@ -592,6 +592,15 @@ export class PipelineServiceClient { { post: '/v1beta1/{name=projects/*/locations/*/endpoints/*/operations/*}:cancel', }, + { + post: '/v1beta1/{name=projects/*/locations/*/extensionControllers/*/operations/*}:cancel', + }, + { + post: '/v1beta1/{name=projects/*/locations/*/extensions/*/operations/*}:cancel', + }, + { + post: '/v1beta1/{name=projects/*/locations/*/extensions/*/deployments/*/operations/*}:cancel', + }, { post: '/v1beta1/{name=projects/*/locations/*/featurestores/*/operations/*}:cancel', }, @@ -844,6 +853,18 @@ export class PipelineServiceClient { delete: '/v1beta1/{name=projects/*/locations/*/dataLabelingJobs/*/operations/*}', }, + { + delete: + '/v1beta1/{name=projects/*/locations/*/extensionControllers/*/operations/*}', + }, + { + delete: + '/v1beta1/{name=projects/*/locations/*/extensions/*/operations/*}', + }, + { + delete: + '/v1beta1/{name=projects/*/locations/*/extensions/*/deployments/*/operations/*}', + }, { delete: '/v1beta1/{name=projects/*/locations/*/hyperparameterTuningJobs/*/operations/*}', @@ -928,6 +949,14 @@ export class PipelineServiceClient { delete: '/v1beta1/{name=projects/*/locations/*/featureOnlineStores/*/operations/*}', }, + { + delete: + '/v1beta1/{name=projects/*/locations/*/featureGroups/*/operations/*}', + }, + { + delete: + '/v1beta1/{name=projects/*/locations/*/featureGroups/*/features/*/operations/*}', + }, { delete: '/v1beta1/{name=projects/*/locations/*/featureOnlineStores/*/featureViews/*/operations/*}', @@ -1047,6 +1076,15 @@ export class PipelineServiceClient { { get: '/v1beta1/{name=projects/*/locations/*/endpoints/*/operations/*}', }, + { + get: '/v1beta1/{name=projects/*/locations/*/extensionControllers/*/operations/*}', + }, + { + get: '/v1beta1/{name=projects/*/locations/*/extensions/*/operations/*}', + }, + { + get: '/v1beta1/{name=projects/*/locations/*/extensions/*/deployments/*/operations/*}', + }, { get: '/v1beta1/{name=projects/*/locations/*/featurestores/*/operations/*}', }, @@ -1128,6 +1166,12 @@ export class PipelineServiceClient { { get: '/v1beta1/{name=projects/*/locations/*/featureOnlineStores/*/featureViews/*/operations/*}', }, + { + get: '/v1beta1/{name=projects/*/locations/*/featureGroups/*/operations/*}', + }, + { + get: '/v1beta1/{name=projects/*/locations/*/featureGroups/*/features/*/operations/*}', + }, ], }, { @@ -1236,6 +1280,15 @@ export class PipelineServiceClient { { get: '/v1beta1/{name=projects/*/locations/*/endpoints/*}/operations', }, + { + get: '/v1beta1/{name=projects/*/locations/*/extensionControllers/*}/operations', + }, + { + get: '/v1beta1/{name=projects/*/locations/*/extensions/*}/operations', + }, + { + get: '/v1beta1/{name=projects/*/locations/*/extensions/*/deployments/*}/operations', + }, { get: '/v1beta1/{name=projects/*/locations/*/featurestores/*}/operations', }, @@ -1315,6 +1368,12 @@ export class PipelineServiceClient { { get: '/v1beta1/{name=projects/*/locations/*/featureOnlineStores/*/featureViews/*}/operations', }, + { + get: '/v1beta1/{name=projects/*/locations/*/featureGroups/*}/operations', + }, + { + get: '/v1beta1/{name=projects/*/locations/*/featureGroups/*/features/*}/operations', + }, ], }, { @@ -1439,6 +1498,15 @@ export class PipelineServiceClient { { post: '/v1beta1/{name=projects/*/locations/*/endpoints/*/operations/*}:wait', }, + { + post: '/v1beta1/{name=projects/*/locations/*/extensionControllers/*/operations/*}:wait', + }, + { + post: '/v1beta1/{name=projects/*/locations/*/extensions/*/operations/*}:wait', + }, + { + post: '/v1beta1/{name=projects/*/locations/*/extensions/*/deployments/*/operations/*}:wait', + }, { post: '/v1beta1/{name=projects/*/locations/*/featurestores/*/operations/*}:wait', }, @@ -1517,6 +1585,12 @@ export class PipelineServiceClient { { post: '/v1beta1/{name=projects/*/locations/*/featureOnlineStores/*/featureViews/*/operations/*}:wait', }, + { + post: '/v1beta1/{name=projects/*/locations/*/featureGroups/*/operations/*}:wait', + }, + { + post: '/v1beta1/{name=projects/*/locations/*/featureGroups/*/features/*/operations/*}:wait', + }, ], }, ]; diff --git a/packages/google-cloud-aiplatform/src/v1beta1/schedule_service_client.ts b/packages/google-cloud-aiplatform/src/v1beta1/schedule_service_client.ts index 9a24adad109..0a0a99aaa5d 100644 --- a/packages/google-cloud-aiplatform/src/v1beta1/schedule_service_client.ts +++ b/packages/google-cloud-aiplatform/src/v1beta1/schedule_service_client.ts @@ -586,6 +586,15 @@ export class ScheduleServiceClient { { post: '/v1beta1/{name=projects/*/locations/*/endpoints/*/operations/*}:cancel', }, + { + post: '/v1beta1/{name=projects/*/locations/*/extensionControllers/*/operations/*}:cancel', + }, + { + post: '/v1beta1/{name=projects/*/locations/*/extensions/*/operations/*}:cancel', + }, + { + post: '/v1beta1/{name=projects/*/locations/*/extensions/*/deployments/*/operations/*}:cancel', + }, { post: '/v1beta1/{name=projects/*/locations/*/featurestores/*/operations/*}:cancel', }, @@ -838,6 +847,18 @@ export class ScheduleServiceClient { delete: '/v1beta1/{name=projects/*/locations/*/dataLabelingJobs/*/operations/*}', }, + { + delete: + '/v1beta1/{name=projects/*/locations/*/extensionControllers/*/operations/*}', + }, + { + delete: + '/v1beta1/{name=projects/*/locations/*/extensions/*/operations/*}', + }, + { + delete: + '/v1beta1/{name=projects/*/locations/*/extensions/*/deployments/*/operations/*}', + }, { delete: '/v1beta1/{name=projects/*/locations/*/hyperparameterTuningJobs/*/operations/*}', @@ -922,6 +943,14 @@ export class ScheduleServiceClient { delete: '/v1beta1/{name=projects/*/locations/*/featureOnlineStores/*/operations/*}', }, + { + delete: + '/v1beta1/{name=projects/*/locations/*/featureGroups/*/operations/*}', + }, + { + delete: + '/v1beta1/{name=projects/*/locations/*/featureGroups/*/features/*/operations/*}', + }, { delete: '/v1beta1/{name=projects/*/locations/*/featureOnlineStores/*/featureViews/*/operations/*}', @@ -1041,6 +1070,15 @@ export class ScheduleServiceClient { { get: '/v1beta1/{name=projects/*/locations/*/endpoints/*/operations/*}', }, + { + get: '/v1beta1/{name=projects/*/locations/*/extensionControllers/*/operations/*}', + }, + { + get: '/v1beta1/{name=projects/*/locations/*/extensions/*/operations/*}', + }, + { + get: '/v1beta1/{name=projects/*/locations/*/extensions/*/deployments/*/operations/*}', + }, { get: '/v1beta1/{name=projects/*/locations/*/featurestores/*/operations/*}', }, @@ -1122,6 +1160,12 @@ export class ScheduleServiceClient { { get: '/v1beta1/{name=projects/*/locations/*/featureOnlineStores/*/featureViews/*/operations/*}', }, + { + get: '/v1beta1/{name=projects/*/locations/*/featureGroups/*/operations/*}', + }, + { + get: '/v1beta1/{name=projects/*/locations/*/featureGroups/*/features/*/operations/*}', + }, ], }, { @@ -1230,6 +1274,15 @@ export class ScheduleServiceClient { { get: '/v1beta1/{name=projects/*/locations/*/endpoints/*}/operations', }, + { + get: '/v1beta1/{name=projects/*/locations/*/extensionControllers/*}/operations', + }, + { + get: '/v1beta1/{name=projects/*/locations/*/extensions/*}/operations', + }, + { + get: '/v1beta1/{name=projects/*/locations/*/extensions/*/deployments/*}/operations', + }, { get: '/v1beta1/{name=projects/*/locations/*/featurestores/*}/operations', }, @@ -1309,6 +1362,12 @@ export class ScheduleServiceClient { { get: '/v1beta1/{name=projects/*/locations/*/featureOnlineStores/*/featureViews/*}/operations', }, + { + get: '/v1beta1/{name=projects/*/locations/*/featureGroups/*}/operations', + }, + { + get: '/v1beta1/{name=projects/*/locations/*/featureGroups/*/features/*}/operations', + }, ], }, { @@ -1433,6 +1492,15 @@ export class ScheduleServiceClient { { post: '/v1beta1/{name=projects/*/locations/*/endpoints/*/operations/*}:wait', }, + { + post: '/v1beta1/{name=projects/*/locations/*/extensionControllers/*/operations/*}:wait', + }, + { + post: '/v1beta1/{name=projects/*/locations/*/extensions/*/operations/*}:wait', + }, + { + post: '/v1beta1/{name=projects/*/locations/*/extensions/*/deployments/*/operations/*}:wait', + }, { post: '/v1beta1/{name=projects/*/locations/*/featurestores/*/operations/*}:wait', }, @@ -1511,6 +1579,12 @@ export class ScheduleServiceClient { { post: '/v1beta1/{name=projects/*/locations/*/featureOnlineStores/*/featureViews/*/operations/*}:wait', }, + { + post: '/v1beta1/{name=projects/*/locations/*/featureGroups/*/operations/*}:wait', + }, + { + post: '/v1beta1/{name=projects/*/locations/*/featureGroups/*/features/*/operations/*}:wait', + }, ], }, ]; diff --git a/packages/google-cloud-aiplatform/src/v1beta1/specialist_pool_service_client.ts b/packages/google-cloud-aiplatform/src/v1beta1/specialist_pool_service_client.ts index a8a3841d333..4ddf6fd4867 100644 --- a/packages/google-cloud-aiplatform/src/v1beta1/specialist_pool_service_client.ts +++ b/packages/google-cloud-aiplatform/src/v1beta1/specialist_pool_service_client.ts @@ -591,6 +591,15 @@ export class SpecialistPoolServiceClient { { post: '/v1beta1/{name=projects/*/locations/*/endpoints/*/operations/*}:cancel', }, + { + post: '/v1beta1/{name=projects/*/locations/*/extensionControllers/*/operations/*}:cancel', + }, + { + post: '/v1beta1/{name=projects/*/locations/*/extensions/*/operations/*}:cancel', + }, + { + post: '/v1beta1/{name=projects/*/locations/*/extensions/*/deployments/*/operations/*}:cancel', + }, { post: '/v1beta1/{name=projects/*/locations/*/featurestores/*/operations/*}:cancel', }, @@ -843,6 +852,18 @@ export class SpecialistPoolServiceClient { delete: '/v1beta1/{name=projects/*/locations/*/dataLabelingJobs/*/operations/*}', }, + { + delete: + '/v1beta1/{name=projects/*/locations/*/extensionControllers/*/operations/*}', + }, + { + delete: + '/v1beta1/{name=projects/*/locations/*/extensions/*/operations/*}', + }, + { + delete: + '/v1beta1/{name=projects/*/locations/*/extensions/*/deployments/*/operations/*}', + }, { delete: '/v1beta1/{name=projects/*/locations/*/hyperparameterTuningJobs/*/operations/*}', @@ -927,6 +948,14 @@ export class SpecialistPoolServiceClient { delete: '/v1beta1/{name=projects/*/locations/*/featureOnlineStores/*/operations/*}', }, + { + delete: + '/v1beta1/{name=projects/*/locations/*/featureGroups/*/operations/*}', + }, + { + delete: + '/v1beta1/{name=projects/*/locations/*/featureGroups/*/features/*/operations/*}', + }, { delete: '/v1beta1/{name=projects/*/locations/*/featureOnlineStores/*/featureViews/*/operations/*}', @@ -1046,6 +1075,15 @@ export class SpecialistPoolServiceClient { { get: '/v1beta1/{name=projects/*/locations/*/endpoints/*/operations/*}', }, + { + get: '/v1beta1/{name=projects/*/locations/*/extensionControllers/*/operations/*}', + }, + { + get: '/v1beta1/{name=projects/*/locations/*/extensions/*/operations/*}', + }, + { + get: '/v1beta1/{name=projects/*/locations/*/extensions/*/deployments/*/operations/*}', + }, { get: '/v1beta1/{name=projects/*/locations/*/featurestores/*/operations/*}', }, @@ -1127,6 +1165,12 @@ export class SpecialistPoolServiceClient { { get: '/v1beta1/{name=projects/*/locations/*/featureOnlineStores/*/featureViews/*/operations/*}', }, + { + get: '/v1beta1/{name=projects/*/locations/*/featureGroups/*/operations/*}', + }, + { + get: '/v1beta1/{name=projects/*/locations/*/featureGroups/*/features/*/operations/*}', + }, ], }, { @@ -1235,6 +1279,15 @@ export class SpecialistPoolServiceClient { { get: '/v1beta1/{name=projects/*/locations/*/endpoints/*}/operations', }, + { + get: '/v1beta1/{name=projects/*/locations/*/extensionControllers/*}/operations', + }, + { + get: '/v1beta1/{name=projects/*/locations/*/extensions/*}/operations', + }, + { + get: '/v1beta1/{name=projects/*/locations/*/extensions/*/deployments/*}/operations', + }, { get: '/v1beta1/{name=projects/*/locations/*/featurestores/*}/operations', }, @@ -1314,6 +1367,12 @@ export class SpecialistPoolServiceClient { { get: '/v1beta1/{name=projects/*/locations/*/featureOnlineStores/*/featureViews/*}/operations', }, + { + get: '/v1beta1/{name=projects/*/locations/*/featureGroups/*}/operations', + }, + { + get: '/v1beta1/{name=projects/*/locations/*/featureGroups/*/features/*}/operations', + }, ], }, { @@ -1438,6 +1497,15 @@ export class SpecialistPoolServiceClient { { post: '/v1beta1/{name=projects/*/locations/*/endpoints/*/operations/*}:wait', }, + { + post: '/v1beta1/{name=projects/*/locations/*/extensionControllers/*/operations/*}:wait', + }, + { + post: '/v1beta1/{name=projects/*/locations/*/extensions/*/operations/*}:wait', + }, + { + post: '/v1beta1/{name=projects/*/locations/*/extensions/*/deployments/*/operations/*}:wait', + }, { post: '/v1beta1/{name=projects/*/locations/*/featurestores/*/operations/*}:wait', }, @@ -1516,6 +1584,12 @@ export class SpecialistPoolServiceClient { { post: '/v1beta1/{name=projects/*/locations/*/featureOnlineStores/*/featureViews/*/operations/*}:wait', }, + { + post: '/v1beta1/{name=projects/*/locations/*/featureGroups/*/operations/*}:wait', + }, + { + post: '/v1beta1/{name=projects/*/locations/*/featureGroups/*/features/*/operations/*}:wait', + }, ], }, ]; diff --git a/packages/google-cloud-aiplatform/src/v1beta1/tensorboard_service_client.ts b/packages/google-cloud-aiplatform/src/v1beta1/tensorboard_service_client.ts index ac0fc6e3c45..92135fa7bf6 100644 --- a/packages/google-cloud-aiplatform/src/v1beta1/tensorboard_service_client.ts +++ b/packages/google-cloud-aiplatform/src/v1beta1/tensorboard_service_client.ts @@ -617,6 +617,15 @@ export class TensorboardServiceClient { { post: '/v1beta1/{name=projects/*/locations/*/endpoints/*/operations/*}:cancel', }, + { + post: '/v1beta1/{name=projects/*/locations/*/extensionControllers/*/operations/*}:cancel', + }, + { + post: '/v1beta1/{name=projects/*/locations/*/extensions/*/operations/*}:cancel', + }, + { + post: '/v1beta1/{name=projects/*/locations/*/extensions/*/deployments/*/operations/*}:cancel', + }, { post: '/v1beta1/{name=projects/*/locations/*/featurestores/*/operations/*}:cancel', }, @@ -869,6 +878,18 @@ export class TensorboardServiceClient { delete: '/v1beta1/{name=projects/*/locations/*/dataLabelingJobs/*/operations/*}', }, + { + delete: + '/v1beta1/{name=projects/*/locations/*/extensionControllers/*/operations/*}', + }, + { + delete: + '/v1beta1/{name=projects/*/locations/*/extensions/*/operations/*}', + }, + { + delete: + '/v1beta1/{name=projects/*/locations/*/extensions/*/deployments/*/operations/*}', + }, { delete: '/v1beta1/{name=projects/*/locations/*/hyperparameterTuningJobs/*/operations/*}', @@ -953,6 +974,14 @@ export class TensorboardServiceClient { delete: '/v1beta1/{name=projects/*/locations/*/featureOnlineStores/*/operations/*}', }, + { + delete: + '/v1beta1/{name=projects/*/locations/*/featureGroups/*/operations/*}', + }, + { + delete: + '/v1beta1/{name=projects/*/locations/*/featureGroups/*/features/*/operations/*}', + }, { delete: '/v1beta1/{name=projects/*/locations/*/featureOnlineStores/*/featureViews/*/operations/*}', @@ -1072,6 +1101,15 @@ export class TensorboardServiceClient { { get: '/v1beta1/{name=projects/*/locations/*/endpoints/*/operations/*}', }, + { + get: '/v1beta1/{name=projects/*/locations/*/extensionControllers/*/operations/*}', + }, + { + get: '/v1beta1/{name=projects/*/locations/*/extensions/*/operations/*}', + }, + { + get: '/v1beta1/{name=projects/*/locations/*/extensions/*/deployments/*/operations/*}', + }, { get: '/v1beta1/{name=projects/*/locations/*/featurestores/*/operations/*}', }, @@ -1153,6 +1191,12 @@ export class TensorboardServiceClient { { get: '/v1beta1/{name=projects/*/locations/*/featureOnlineStores/*/featureViews/*/operations/*}', }, + { + get: '/v1beta1/{name=projects/*/locations/*/featureGroups/*/operations/*}', + }, + { + get: '/v1beta1/{name=projects/*/locations/*/featureGroups/*/features/*/operations/*}', + }, ], }, { @@ -1261,6 +1305,15 @@ export class TensorboardServiceClient { { get: '/v1beta1/{name=projects/*/locations/*/endpoints/*}/operations', }, + { + get: '/v1beta1/{name=projects/*/locations/*/extensionControllers/*}/operations', + }, + { + get: '/v1beta1/{name=projects/*/locations/*/extensions/*}/operations', + }, + { + get: '/v1beta1/{name=projects/*/locations/*/extensions/*/deployments/*}/operations', + }, { get: '/v1beta1/{name=projects/*/locations/*/featurestores/*}/operations', }, @@ -1340,6 +1393,12 @@ export class TensorboardServiceClient { { get: '/v1beta1/{name=projects/*/locations/*/featureOnlineStores/*/featureViews/*}/operations', }, + { + get: '/v1beta1/{name=projects/*/locations/*/featureGroups/*}/operations', + }, + { + get: '/v1beta1/{name=projects/*/locations/*/featureGroups/*/features/*}/operations', + }, ], }, { @@ -1464,6 +1523,15 @@ export class TensorboardServiceClient { { post: '/v1beta1/{name=projects/*/locations/*/endpoints/*/operations/*}:wait', }, + { + post: '/v1beta1/{name=projects/*/locations/*/extensionControllers/*/operations/*}:wait', + }, + { + post: '/v1beta1/{name=projects/*/locations/*/extensions/*/operations/*}:wait', + }, + { + post: '/v1beta1/{name=projects/*/locations/*/extensions/*/deployments/*/operations/*}:wait', + }, { post: '/v1beta1/{name=projects/*/locations/*/featurestores/*/operations/*}:wait', }, @@ -1542,6 +1610,12 @@ export class TensorboardServiceClient { { post: '/v1beta1/{name=projects/*/locations/*/featureOnlineStores/*/featureViews/*/operations/*}:wait', }, + { + post: '/v1beta1/{name=projects/*/locations/*/featureGroups/*/operations/*}:wait', + }, + { + post: '/v1beta1/{name=projects/*/locations/*/featureGroups/*/features/*/operations/*}:wait', + }, ], }, ]; diff --git a/packages/google-cloud-aiplatform/src/v1beta1/vizier_service_client.ts b/packages/google-cloud-aiplatform/src/v1beta1/vizier_service_client.ts index a913e8d07ad..cdb3039e24e 100644 --- a/packages/google-cloud-aiplatform/src/v1beta1/vizier_service_client.ts +++ b/packages/google-cloud-aiplatform/src/v1beta1/vizier_service_client.ts @@ -594,6 +594,15 @@ export class VizierServiceClient { { post: '/v1beta1/{name=projects/*/locations/*/endpoints/*/operations/*}:cancel', }, + { + post: '/v1beta1/{name=projects/*/locations/*/extensionControllers/*/operations/*}:cancel', + }, + { + post: '/v1beta1/{name=projects/*/locations/*/extensions/*/operations/*}:cancel', + }, + { + post: '/v1beta1/{name=projects/*/locations/*/extensions/*/deployments/*/operations/*}:cancel', + }, { post: '/v1beta1/{name=projects/*/locations/*/featurestores/*/operations/*}:cancel', }, @@ -846,6 +855,18 @@ export class VizierServiceClient { delete: '/v1beta1/{name=projects/*/locations/*/dataLabelingJobs/*/operations/*}', }, + { + delete: + '/v1beta1/{name=projects/*/locations/*/extensionControllers/*/operations/*}', + }, + { + delete: + '/v1beta1/{name=projects/*/locations/*/extensions/*/operations/*}', + }, + { + delete: + '/v1beta1/{name=projects/*/locations/*/extensions/*/deployments/*/operations/*}', + }, { delete: '/v1beta1/{name=projects/*/locations/*/hyperparameterTuningJobs/*/operations/*}', @@ -930,6 +951,14 @@ export class VizierServiceClient { delete: '/v1beta1/{name=projects/*/locations/*/featureOnlineStores/*/operations/*}', }, + { + delete: + '/v1beta1/{name=projects/*/locations/*/featureGroups/*/operations/*}', + }, + { + delete: + '/v1beta1/{name=projects/*/locations/*/featureGroups/*/features/*/operations/*}', + }, { delete: '/v1beta1/{name=projects/*/locations/*/featureOnlineStores/*/featureViews/*/operations/*}', @@ -1049,6 +1078,15 @@ export class VizierServiceClient { { get: '/v1beta1/{name=projects/*/locations/*/endpoints/*/operations/*}', }, + { + get: '/v1beta1/{name=projects/*/locations/*/extensionControllers/*/operations/*}', + }, + { + get: '/v1beta1/{name=projects/*/locations/*/extensions/*/operations/*}', + }, + { + get: '/v1beta1/{name=projects/*/locations/*/extensions/*/deployments/*/operations/*}', + }, { get: '/v1beta1/{name=projects/*/locations/*/featurestores/*/operations/*}', }, @@ -1130,6 +1168,12 @@ export class VizierServiceClient { { get: '/v1beta1/{name=projects/*/locations/*/featureOnlineStores/*/featureViews/*/operations/*}', }, + { + get: '/v1beta1/{name=projects/*/locations/*/featureGroups/*/operations/*}', + }, + { + get: '/v1beta1/{name=projects/*/locations/*/featureGroups/*/features/*/operations/*}', + }, ], }, { @@ -1238,6 +1282,15 @@ export class VizierServiceClient { { get: '/v1beta1/{name=projects/*/locations/*/endpoints/*}/operations', }, + { + get: '/v1beta1/{name=projects/*/locations/*/extensionControllers/*}/operations', + }, + { + get: '/v1beta1/{name=projects/*/locations/*/extensions/*}/operations', + }, + { + get: '/v1beta1/{name=projects/*/locations/*/extensions/*/deployments/*}/operations', + }, { get: '/v1beta1/{name=projects/*/locations/*/featurestores/*}/operations', }, @@ -1317,6 +1370,12 @@ export class VizierServiceClient { { get: '/v1beta1/{name=projects/*/locations/*/featureOnlineStores/*/featureViews/*}/operations', }, + { + get: '/v1beta1/{name=projects/*/locations/*/featureGroups/*}/operations', + }, + { + get: '/v1beta1/{name=projects/*/locations/*/featureGroups/*/features/*}/operations', + }, ], }, { @@ -1441,6 +1500,15 @@ export class VizierServiceClient { { post: '/v1beta1/{name=projects/*/locations/*/endpoints/*/operations/*}:wait', }, + { + post: '/v1beta1/{name=projects/*/locations/*/extensionControllers/*/operations/*}:wait', + }, + { + post: '/v1beta1/{name=projects/*/locations/*/extensions/*/operations/*}:wait', + }, + { + post: '/v1beta1/{name=projects/*/locations/*/extensions/*/deployments/*/operations/*}:wait', + }, { post: '/v1beta1/{name=projects/*/locations/*/featurestores/*/operations/*}:wait', }, @@ -1519,6 +1587,12 @@ export class VizierServiceClient { { post: '/v1beta1/{name=projects/*/locations/*/featureOnlineStores/*/featureViews/*/operations/*}:wait', }, + { + post: '/v1beta1/{name=projects/*/locations/*/featureGroups/*/operations/*}:wait', + }, + { + post: '/v1beta1/{name=projects/*/locations/*/featureGroups/*/features/*/operations/*}:wait', + }, ], }, ]; @@ -2770,6 +2844,43 @@ export class VizierServiceClient { * If multiple SuggestTrialsRequests have the same `client_id`, * the service will return the identical suggested Trial if the Trial is * pending, and provide a new Trial if the last suggested Trial was completed. + * @param {number[]} [request.contexts] + * Optional. This allows you to specify the "context" for a Trial; a context + * is a slice (a subspace) of the search space. + * + * Typical uses for contexts: + * 1) You are using Vizier to tune a server for best performance, but there's + * a strong weekly cycle. The context specifies the day-of-week. + * This allows Tuesday to generalize from Wednesday without assuming that + * everything is identical. + * 2) Imagine you're optimizing some medical treatment for people. + * As they walk in the door, you know certain facts about them + * (e.g. sex, weight, height, blood-pressure). Put that information in the + * context, and Vizier will adapt its suggestions to the patient. + * 3) You want to do a fair A/B test efficiently. Specify the "A" and "B" + * conditions as contexts, and Vizier will generalize between "A" and "B" + * conditions. If they are similar, this will allow Vizier to converge + * to the optimum faster than if "A" and "B" were separate Studies. + * NOTE: You can also enter contexts as REQUESTED Trials, e.g. via the + * CreateTrial() RPC; that's the asynchronous option where you don't need a + * close association between contexts and suggestions. + * + * NOTE: All the Parameters you set in a context MUST be defined in the + * Study. + * NOTE: You must supply 0 or $suggestion_count contexts. + * If you don't supply any contexts, Vizier will make suggestions + * from the full search space specified in the StudySpec; if you supply + * a full set of context, each suggestion will match the corresponding + * context. + * NOTE: A Context with no features set matches anything, and allows + * suggestions from the full search space. + * NOTE: Contexts MUST lie within the search space specified in the + * StudySpec. It's an error if they don't. + * NOTE: Contexts preferentially match ACTIVE then REQUESTED trials before + * new suggestions are generated. + * NOTE: Generation of suggestions involves a match between a Context and + * (optionally) a REQUESTED trial; if that match is not fully specified, a + * suggestion will be geneated in the merged subspace. * @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. diff --git a/packages/google-cloud-aiplatform/test/gapic_persistent_resource_service_v1beta1.ts b/packages/google-cloud-aiplatform/test/gapic_persistent_resource_service_v1beta1.ts index d6c99b5c753..5b789ab1384 100644 --- a/packages/google-cloud-aiplatform/test/gapic_persistent_resource_service_v1beta1.ts +++ b/packages/google-cloud-aiplatform/test/gapic_persistent_resource_service_v1beta1.ts @@ -869,6 +869,226 @@ describe('v1beta1.PersistentResourceServiceClient', () => { }); }); + describe('updatePersistentResource', () => { + it('invokes updatePersistentResource without error', async () => { + const client = + new persistentresourceserviceModule.v1beta1.PersistentResourceServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.aiplatform.v1beta1.UpdatePersistentResourceRequest() + ); + request.persistentResource ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.aiplatform.v1beta1.UpdatePersistentResourceRequest', + ['persistentResource', 'name'] + ); + request.persistentResource.name = defaultValue1; + const expectedHeaderRequestParams = `persistent_resource.name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.updatePersistentResource = + stubLongRunningCall(expectedResponse); + const [operation] = await client.updatePersistentResource(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.updatePersistentResource as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updatePersistentResource as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updatePersistentResource without error using callback', async () => { + const client = + new persistentresourceserviceModule.v1beta1.PersistentResourceServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.aiplatform.v1beta1.UpdatePersistentResourceRequest() + ); + request.persistentResource ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.aiplatform.v1beta1.UpdatePersistentResourceRequest', + ['persistentResource', 'name'] + ); + request.persistentResource.name = defaultValue1; + const expectedHeaderRequestParams = `persistent_resource.name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.updatePersistentResource = + stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.updatePersistentResource( + request, + ( + err?: Error | null, + result?: LROperation< + protos.google.cloud.aiplatform.v1beta1.IPersistentResource, + protos.google.cloud.aiplatform.v1beta1.IUpdatePersistentResourceOperationMetadata + > | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const operation = (await promise) as LROperation< + protos.google.cloud.aiplatform.v1beta1.IPersistentResource, + protos.google.cloud.aiplatform.v1beta1.IUpdatePersistentResourceOperationMetadata + >; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.updatePersistentResource as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updatePersistentResource as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updatePersistentResource with call error', async () => { + const client = + new persistentresourceserviceModule.v1beta1.PersistentResourceServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.aiplatform.v1beta1.UpdatePersistentResourceRequest() + ); + request.persistentResource ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.aiplatform.v1beta1.UpdatePersistentResourceRequest', + ['persistentResource', 'name'] + ); + request.persistentResource.name = defaultValue1; + const expectedHeaderRequestParams = `persistent_resource.name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.updatePersistentResource = stubLongRunningCall( + undefined, + expectedError + ); + await assert.rejects( + client.updatePersistentResource(request), + expectedError + ); + const actualRequest = ( + client.innerApiCalls.updatePersistentResource as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updatePersistentResource as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updatePersistentResource with LRO error', async () => { + const client = + new persistentresourceserviceModule.v1beta1.PersistentResourceServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.aiplatform.v1beta1.UpdatePersistentResourceRequest() + ); + request.persistentResource ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.aiplatform.v1beta1.UpdatePersistentResourceRequest', + ['persistentResource', 'name'] + ); + request.persistentResource.name = defaultValue1; + const expectedHeaderRequestParams = `persistent_resource.name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.updatePersistentResource = stubLongRunningCall( + undefined, + undefined, + expectedError + ); + const [operation] = await client.updatePersistentResource(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = ( + client.innerApiCalls.updatePersistentResource as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updatePersistentResource as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkUpdatePersistentResourceProgress without error', async () => { + const client = + new persistentresourceserviceModule.v1beta1.PersistentResourceServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + 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.checkUpdatePersistentResourceProgress( + expectedResponse.name + ); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkUpdatePersistentResourceProgress with error', async () => { + const client = + new persistentresourceserviceModule.v1beta1.PersistentResourceServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const expectedError = new Error('expected'); + + client.operationsClient.getOperation = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects( + client.checkUpdatePersistentResourceProgress(''), + expectedError + ); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + }); + describe('listPersistentResources', () => { it('invokes listPersistentResources without error', async () => { const client = diff --git a/packages/google-cloud-alloydb/CHANGELOG.md b/packages/google-cloud-alloydb/CHANGELOG.md index 41338cbbdc1..c66de444c89 100644 --- a/packages/google-cloud-alloydb/CHANGELOG.md +++ b/packages/google-cloud-alloydb/CHANGELOG.md @@ -1,5 +1,20 @@ # Changelog +## [1.2.0](https://github.com/googleapis/google-cloud-node/compare/alloydb-v1.1.0...alloydb-v1.2.0) (2023-09-19) + + +### Features + +* [alloydb] Added enum value for PG15 ([#4674](https://github.com/googleapis/google-cloud-node/issues/4674)) ([b1c7da6](https://github.com/googleapis/google-cloud-node/commit/b1c7da692c0c62d74f66158ea965dca0500db27f)) +* [alloydb] Added enum value for PG15 ([#4680](https://github.com/googleapis/google-cloud-node/issues/4680)) ([0057f4e](https://github.com/googleapis/google-cloud-node/commit/0057f4eaa3b73c24b5e2eadaaf92338e357a82f0)) + +## [1.1.0](https://github.com/googleapis/google-cloud-node/compare/alloydb-v1.0.1...alloydb-v1.1.0) (2023-09-19) + + +### Features + +* [alloydb] Changed description for recovery_window_days in ContinuousBackupConfig ([#4671](https://github.com/googleapis/google-cloud-node/issues/4671)) ([12528e1](https://github.com/googleapis/google-cloud-node/commit/12528e16d13a4aeca66162bd5f51bb1547ec410e)) + ## [1.0.1](https://github.com/googleapis/google-cloud-node/compare/alloydb-v1.0.0...alloydb-v1.0.1) (2023-09-06) diff --git a/packages/google-cloud-alloydb/package.json b/packages/google-cloud-alloydb/package.json index b37982c3daf..5b22950c87c 100644 --- a/packages/google-cloud-alloydb/package.json +++ b/packages/google-cloud-alloydb/package.json @@ -1,6 +1,6 @@ { "name": "@google-cloud/alloydb", - "version": "1.0.1", + "version": "1.2.0", "description": "AlloyDB API client for Node.js", "repository": { "type": "git", diff --git a/packages/google-cloud-alloydb/protos/google/cloud/alloydb/v1/resources.proto b/packages/google-cloud-alloydb/protos/google/cloud/alloydb/v1/resources.proto index 22b82d56d0f..874ac489ee8 100644 --- a/packages/google-cloud-alloydb/protos/google/cloud/alloydb/v1/resources.proto +++ b/packages/google-cloud-alloydb/protos/google/cloud/alloydb/v1/resources.proto @@ -308,9 +308,9 @@ message ContinuousBackupConfig { // Whether ContinuousBackup is enabled. optional bool enabled = 1; - // The number of days backups and logs will be retained, which determines the - // window of time that data is recoverable for. If not set, it defaults to 14 - // days. + // The number of days that are eligible to restore from using PITR. To support + // the entire recovery window, backups and logs are retained for one day more + // than the recovery window. If not set, defaults to 14 days. int32 recovery_window_days = 4; // The encryption config can be specified to encrypt the @@ -381,6 +381,31 @@ message Cluster { style: DECLARATIVE_FRIENDLY }; + // Metadata related to network configuration. + message NetworkConfig { + // Required. The resource link for the VPC network in which cluster + // resources are created and from which they are accessible via Private IP. + // The network must belong to the same project as the cluster. It is + // specified in the form: + // "projects/{project_number}/global/networks/{network_id}". This is + // required to create a cluster. + string network = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "compute.googleapis.com/Network" + } + ]; + + // Optional. Name of the allocated IP range for the private IP AlloyDB + // cluster, for example: "google-managed-services-default". If set, the + // instance IPs for this cluster will be created in the allocated range. The + // range name must comply with RFC 1035. Specifically, the name must be 1-63 + // characters long and match the regular expression + // [a-z]([-a-z0-9]*[a-z0-9])?. + // Field name is intended to be consistent with CloudSQL. + string allocated_ip_range = 2 [(google.api.field_behavior) = OPTIONAL]; + } + // Configuration information for the secondary cluster. This should be set // if and only if the cluster is of type SECONDARY. message SecondaryConfig { @@ -503,18 +528,21 @@ message Cluster { // the cluster (i.e. `CreateCluster` vs. `CreateSecondaryCluster` ClusterType cluster_type = 24 [(google.api.field_behavior) = OUTPUT_ONLY]; - // Output only. The database engine major version. This is an output-only - // field and it's populated at the Cluster creation time. This field cannot be - // changed after cluster creation. - DatabaseVersion database_version = 9 - [(google.api.field_behavior) = OUTPUT_ONLY]; + // Optional. The database engine major version. This is an optional field and + // it is populated at the Cluster creation time. If a database version is not + // supplied at cluster creation time, then a default database version will + // be used. + DatabaseVersion database_version = 9 [(google.api.field_behavior) = OPTIONAL]; + + NetworkConfig network_config = 29 [(google.api.field_behavior) = OPTIONAL]; // Required. The resource link for the VPC network in which cluster resources // are created and from which they are accessible via Private IP. The network // must belong to the same project as the cluster. It is specified in the - // form: "projects/{project_number}/global/networks/{network_id}". This is - // required to create a cluster. It can be updated, but it cannot be removed. + // form: "projects/{project}/global/networks/{network_id}". This is required + // to create a cluster. Deprecated, use network_config.network instead. string network = 10 [ + deprecated = true, (google.api.field_behavior) = REQUIRED, (google.api.resource_reference) = { type: "compute.googleapis.com/Network" } ]; @@ -638,6 +666,16 @@ message Instance { int32 node_count = 1; } + // Client connection configuration + message ClientConnectionConfig { + // Optional. Configuration to enforce connectors only (ex: AuthProxy) + // connections to the database. + bool require_connectors = 1 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. SSL config option for this instance. + SslConfig ssl_config = 2 [(google.api.field_behavior) = OPTIONAL]; + } + // Instance State enum State { // The state of the instance is unknown. @@ -818,6 +856,10 @@ message Instance { // This is distinct from labels. // https://google.aip.dev/128 map annotations = 18; + + // Optional. Client connection specific configurations + ClientConnectionConfig client_connection_config = 23 + [(google.api.field_behavior) = OPTIONAL]; } // Message describing Backup object @@ -828,6 +870,29 @@ message Backup { style: DECLARATIVE_FRIENDLY }; + // A backup's position in a quantity-based retention queue, of backups with + // the same source cluster and type, with length, retention, specified by the + // backup's retention policy. + // Once the position is greater than the retention, the backup is eligible to + // be garbage collected. + // + // Example: 5 backups from the same source cluster and type with a + // quantity-based retention of 3 and denoted by backup_id (position, + // retention). + // + // Safe: backup_5 (1, 3), backup_4, (2, 3), backup_3 (3, 3). + // Awaiting garbage collection: backup_2 (4, 3), backup_1 (5, 3) + message QuantityBasedExpiry { + // Output only. The backup's position among its backups with the same source + // cluster and type, by descending chronological order create time(i.e. + // newest first). + int32 retention_count = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The length of the quantity-based queue, specified by the + // backup's retention policy. + int32 total_retention_count = 2 [(google.api.field_behavior) = OUTPUT_ONLY]; + } + // Backup State enum State { // The state of the backup is unknown. @@ -950,6 +1015,18 @@ message Backup { // added to the backup's create_time. google.protobuf.Timestamp expiry_time = 19 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The QuantityBasedExpiry of the backup, specified by the + // backup's retention policy. Once the expiry quantity is over retention, the + // backup is eligible to be garbage collected. + QuantityBasedExpiry expiry_quantity = 20 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The database engine major version of the cluster this backup + // was created from. Any restored cluster created from this backup will have + // the same database version. + DatabaseVersion database_version = 22 + [(google.api.field_behavior) = OUTPUT_ONLY]; } // SupportedDatabaseFlag gives general information about a database flag, diff --git a/packages/google-cloud-alloydb/protos/google/cloud/alloydb/v1alpha/resources.proto b/packages/google-cloud-alloydb/protos/google/cloud/alloydb/v1alpha/resources.proto index 5845279f7ed..30b9e7ab9c0 100644 --- a/packages/google-cloud-alloydb/protos/google/cloud/alloydb/v1alpha/resources.proto +++ b/packages/google-cloud-alloydb/protos/google/cloud/alloydb/v1alpha/resources.proto @@ -83,6 +83,9 @@ enum DatabaseVersion { // The database version is Postgres 14. POSTGRES_14 = 2; + + // The database version is Postgres 15. + POSTGRES_15 = 3; } // The username/password for a database user. Used for specifying initial @@ -388,8 +391,7 @@ message Cluster { // The network must belong to the same project as the cluster. It is // specified in the form: // "projects/{project_number}/global/networks/{network_id}". This is - // required to create a cluster. It can be updated, but it cannot be - // removed. + // required to create a cluster. string network = 1 [ (google.api.field_behavior) = REQUIRED, (google.api.resource_reference) = { @@ -397,8 +399,8 @@ message Cluster { } ]; - // Optional. The name of the allocated IP range for the private IP AlloyDB - // cluster. For example: "google-managed-services-default". If set, the + // Optional. Name of the allocated IP range for the private IP AlloyDB + // cluster, for example: "google-managed-services-default". If set, the // instance IPs for this cluster will be created in the allocated range. The // range name must comply with RFC 1035. Specifically, the name must be 1-63 // characters long and match the regular expression @@ -540,9 +542,10 @@ message Cluster { // Required. The resource link for the VPC network in which cluster resources // are created and from which they are accessible via Private IP. The network // must belong to the same project as the cluster. It is specified in the - // form: "projects/{project_number}/global/networks/{network_id}". This is - // required to create a cluster. It can be updated, but it cannot be removed. + // form: "projects/{project}/global/networks/{network_id}". This is required + // to create a cluster. Deprecated, use network_config.network instead. string network = 10 [ + deprecated = true, (google.api.field_behavior) = REQUIRED, (google.api.resource_reference) = { type: "compute.googleapis.com/Network" } ]; @@ -688,6 +691,16 @@ message Instance { Mode mode = 1; } + // Client connection configuration + message ClientConnectionConfig { + // Optional. Configuration to enforce connectors only (ex: AuthProxy) + // connections to the database. + bool require_connectors = 1 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. SSL config option for this instance. + SslConfig ssl_config = 2 [(google.api.field_behavior) = OPTIONAL]; + } + // Instance State enum State { // The state of the instance is unknown. @@ -875,6 +888,10 @@ message Instance { // specify explicitly specify the value in each update request. UpdatePolicy update_policy = 22; + // Optional. Client connection specific configurations + ClientConnectionConfig client_connection_config = 23 + [(google.api.field_behavior) = OPTIONAL]; + // Reserved for future use. bool satisfies_pzs = 24; } @@ -892,8 +909,9 @@ message ConnectionInfo { // This field currently has no semantic meaning. string name = 1; - // Output only. The IP address for the Instance. - // This is the connection endpoint for an end-user application. + // Output only. The private network IP address for the Instance. This is the + // default IP for the instance and is always created (even if enable_public_ip + // is set). This is the connection endpoint for an end-user application. string ip_address = 2 [(google.api.field_behavior) = OUTPUT_ONLY]; // Output only. The pem-encoded chain that may be used to verify the X.509 @@ -1067,6 +1085,12 @@ message Backup { // Reserved for future use. bool satisfies_pzs = 21; + + // Output only. The database engine major version of the cluster this backup + // was created from. Any restored cluster created from this backup will have + // the same database version. + DatabaseVersion database_version = 22 + [(google.api.field_behavior) = OUTPUT_ONLY]; } // SupportedDatabaseFlag gives general information about a database flag, diff --git a/packages/google-cloud-alloydb/protos/google/cloud/alloydb/v1beta/resources.proto b/packages/google-cloud-alloydb/protos/google/cloud/alloydb/v1beta/resources.proto index eb98358425e..bbcfd96d33a 100644 --- a/packages/google-cloud-alloydb/protos/google/cloud/alloydb/v1beta/resources.proto +++ b/packages/google-cloud-alloydb/protos/google/cloud/alloydb/v1beta/resources.proto @@ -83,6 +83,9 @@ enum DatabaseVersion { // The database version is Postgres 14. POSTGRES_14 = 2; + + // The database version is Postgres 15. + POSTGRES_15 = 3; } // The username/password for a database user. Used for specifying initial @@ -308,9 +311,9 @@ message ContinuousBackupConfig { // Whether ContinuousBackup is enabled. optional bool enabled = 1; - // The number of days backups and logs will be retained, which determines the - // window of time that data is recoverable for. If not set, it defaults to 14 - // days. + // The number of days that are eligible to restore from using PITR. To support + // the entire recovery window, backups and logs are retained for one day more + // than the recovery window. If not set, defaults to 14 days. int32 recovery_window_days = 4; // The encryption config can be specified to encrypt the @@ -388,8 +391,7 @@ message Cluster { // The network must belong to the same project as the cluster. It is // specified in the form: // "projects/{project_number}/global/networks/{network_id}". This is - // required to create a cluster. It can be updated, but it cannot be - // removed. + // required to create a cluster. string network = 1 [ (google.api.field_behavior) = REQUIRED, (google.api.resource_reference) = { @@ -397,8 +399,8 @@ message Cluster { } ]; - // Optional. The name of the allocated IP range for the private IP AlloyDB - // cluster. For example: "google-managed-services-default". If set, the + // Optional. Name of the allocated IP range for the private IP AlloyDB + // cluster, for example: "google-managed-services-default". If set, the // instance IPs for this cluster will be created in the allocated range. The // range name must comply with RFC 1035. Specifically, the name must be 1-63 // characters long and match the regular expression @@ -529,20 +531,21 @@ message Cluster { // the cluster (i.e. `CreateCluster` vs. `CreateSecondaryCluster` ClusterType cluster_type = 24 [(google.api.field_behavior) = OUTPUT_ONLY]; - // Output only. The database engine major version. This is an output-only - // field and it's populated at the Cluster creation time. This field cannot be - // changed after cluster creation. - DatabaseVersion database_version = 9 - [(google.api.field_behavior) = OUTPUT_ONLY]; + // Optional. The database engine major version. This is an optional field and + // it is populated at the Cluster creation time. If a database version is not + // supplied at cluster creation time, then a default database version will + // be used. + DatabaseVersion database_version = 9 [(google.api.field_behavior) = OPTIONAL]; NetworkConfig network_config = 29 [(google.api.field_behavior) = OPTIONAL]; // Required. The resource link for the VPC network in which cluster resources // are created and from which they are accessible via Private IP. The network // must belong to the same project as the cluster. It is specified in the - // form: "projects/{project_number}/global/networks/{network_id}". This is - // required to create a cluster. It can be updated, but it cannot be removed. + // form: "projects/{project}/global/networks/{network_id}". This is required + // to create a cluster. Deprecated, use network_config.network instead. string network = 10 [ + deprecated = true, (google.api.field_behavior) = REQUIRED, (google.api.resource_reference) = { type: "compute.googleapis.com/Network" } ]; @@ -685,6 +688,16 @@ message Instance { Mode mode = 1; } + // Client connection configuration + message ClientConnectionConfig { + // Optional. Configuration to enforce connectors only (ex: AuthProxy) + // connections to the database. + bool require_connectors = 1 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. SSL config option for this instance. + SslConfig ssl_config = 2 [(google.api.field_behavior) = OPTIONAL]; + } + // Instance State enum State { // The state of the instance is unknown. @@ -871,6 +884,10 @@ message Instance { // To use a non-default update policy, you must // specify explicitly specify the value in each update request. UpdatePolicy update_policy = 22; + + // Optional. Client connection specific configurations + ClientConnectionConfig client_connection_config = 23 + [(google.api.field_behavior) = OPTIONAL]; } // ConnectionInfo singleton resource. @@ -886,8 +903,9 @@ message ConnectionInfo { // This field currently has no semantic meaning. string name = 1; - // Output only. The IP address for the Instance. - // This is the connection endpoint for an end-user application. + // Output only. The private network IP address for the Instance. This is the + // default IP for the instance and is always created (even if enable_public_ip + // is set). This is the connection endpoint for an end-user application. string ip_address = 2 [(google.api.field_behavior) = OUTPUT_ONLY]; // Output only. The pem-encoded chain that may be used to verify the X.509 @@ -907,6 +925,29 @@ message Backup { style: DECLARATIVE_FRIENDLY }; + // A backup's position in a quantity-based retention queue, of backups with + // the same source cluster and type, with length, retention, specified by the + // backup's retention policy. + // Once the position is greater than the retention, the backup is eligible to + // be garbage collected. + // + // Example: 5 backups from the same source cluster and type with a + // quantity-based retention of 3 and denoted by backup_id (position, + // retention). + // + // Safe: backup_5 (1, 3), backup_4, (2, 3), backup_3 (3, 3). + // Awaiting garbage collection: backup_2 (4, 3), backup_1 (5, 3) + message QuantityBasedExpiry { + // Output only. The backup's position among its backups with the same source + // cluster and type, by descending chronological order create time(i.e. + // newest first). + int32 retention_count = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The length of the quantity-based queue, specified by the + // backup's retention policy. + int32 total_retention_count = 2 [(google.api.field_behavior) = OUTPUT_ONLY]; + } + // Backup State enum State { // The state of the backup is unknown. @@ -1029,6 +1070,18 @@ message Backup { // added to the backup's create_time. google.protobuf.Timestamp expiry_time = 19 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The QuantityBasedExpiry of the backup, specified by the + // backup's retention policy. Once the expiry quantity is over retention, the + // backup is eligible to be garbage collected. + QuantityBasedExpiry expiry_quantity = 20 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The database engine major version of the cluster this backup + // was created from. Any restored cluster created from this backup will have + // the same database version. + DatabaseVersion database_version = 22 + [(google.api.field_behavior) = OUTPUT_ONLY]; } // SupportedDatabaseFlag gives general information about a database flag, diff --git a/packages/google-cloud-alloydb/protos/google/cloud/alloydb/v1beta/service.proto b/packages/google-cloud-alloydb/protos/google/cloud/alloydb/v1beta/service.proto index f262636186f..df23a56f11f 100644 --- a/packages/google-cloud-alloydb/protos/google/cloud/alloydb/v1beta/service.proto +++ b/packages/google-cloud-alloydb/protos/google/cloud/alloydb/v1beta/service.proto @@ -348,10 +348,10 @@ service AlloyDBAdmin { } // Generate a client certificate signed by a Cluster CA. - // The sole purpose of this endpoint is to support the Auth Proxy client and - // the endpoint's behavior is subject to change without notice, so do not rely - // on its behavior remaining constant. Future changes will not break the Auth - // Proxy client. + // The sole purpose of this endpoint is to support AlloyDB connectors and the + // Auth Proxy client. The endpoint's behavior is subject to change without + // notice, so do not rely on its behavior remaining constant. Future changes + // will not break AlloyDB connectors or the Auth Proxy client. rpc GenerateClientCertificate(GenerateClientCertificateRequest) returns (GenerateClientCertificateResponse) { option (google.api.http) = { @@ -1362,6 +1362,11 @@ message GenerateClientCertificateRequest { // Optional. The public key from the client. string public_key = 5 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. An optional hint to the endpoint to generate a client + // ceritificate that can be used by AlloyDB connectors to exchange additional + // metadata with the server after TLS handshake. + bool use_metadata_exchange = 6 [(google.api.field_behavior) = OPTIONAL]; } // Message returned by a GenerateClientCertificate operation. diff --git a/packages/google-cloud-alloydb/protos/protos.d.ts b/packages/google-cloud-alloydb/protos/protos.d.ts index 04ae91efe43..6fb1f1c16d3 100644 --- a/packages/google-cloud-alloydb/protos/protos.d.ts +++ b/packages/google-cloud-alloydb/protos/protos.d.ts @@ -1520,6 +1520,9 @@ export namespace google { /** Cluster databaseVersion */ databaseVersion?: (google.cloud.alloydb.v1.DatabaseVersion|keyof typeof google.cloud.alloydb.v1.DatabaseVersion|null); + /** Cluster networkConfig */ + networkConfig?: (google.cloud.alloydb.v1.Cluster.INetworkConfig|null); + /** Cluster network */ network?: (string|null); @@ -1605,6 +1608,9 @@ export namespace google { /** Cluster databaseVersion. */ public databaseVersion: (google.cloud.alloydb.v1.DatabaseVersion|keyof typeof google.cloud.alloydb.v1.DatabaseVersion); + /** Cluster networkConfig. */ + public networkConfig?: (google.cloud.alloydb.v1.Cluster.INetworkConfig|null); + /** Cluster network. */ public network: string; @@ -1727,6 +1733,109 @@ export namespace google { namespace Cluster { + /** Properties of a NetworkConfig. */ + interface INetworkConfig { + + /** NetworkConfig network */ + network?: (string|null); + + /** NetworkConfig allocatedIpRange */ + allocatedIpRange?: (string|null); + } + + /** Represents a NetworkConfig. */ + class NetworkConfig implements INetworkConfig { + + /** + * Constructs a new NetworkConfig. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.alloydb.v1.Cluster.INetworkConfig); + + /** NetworkConfig network. */ + public network: string; + + /** NetworkConfig allocatedIpRange. */ + public allocatedIpRange: string; + + /** + * Creates a new NetworkConfig instance using the specified properties. + * @param [properties] Properties to set + * @returns NetworkConfig instance + */ + public static create(properties?: google.cloud.alloydb.v1.Cluster.INetworkConfig): google.cloud.alloydb.v1.Cluster.NetworkConfig; + + /** + * Encodes the specified NetworkConfig message. Does not implicitly {@link google.cloud.alloydb.v1.Cluster.NetworkConfig.verify|verify} messages. + * @param message NetworkConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.alloydb.v1.Cluster.INetworkConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified NetworkConfig message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1.Cluster.NetworkConfig.verify|verify} messages. + * @param message NetworkConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.alloydb.v1.Cluster.INetworkConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a NetworkConfig message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns NetworkConfig + * @throws {Error} If the payload is not 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.alloydb.v1.Cluster.NetworkConfig; + + /** + * Decodes a NetworkConfig message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns NetworkConfig + * @throws {Error} If the payload 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.alloydb.v1.Cluster.NetworkConfig; + + /** + * Verifies a NetworkConfig message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a NetworkConfig message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns NetworkConfig + */ + public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1.Cluster.NetworkConfig; + + /** + * Creates a plain object from a NetworkConfig message. Also converts values to other types if specified. + * @param message NetworkConfig + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.alloydb.v1.Cluster.NetworkConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this NetworkConfig to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for NetworkConfig + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + /** Properties of a SecondaryConfig. */ interface ISecondaryConfig { @@ -2008,6 +2117,9 @@ export namespace google { /** Instance annotations */ annotations?: ({ [k: string]: string }|null); + + /** Instance clientConnectionConfig */ + clientConnectionConfig?: (google.cloud.alloydb.v1.Instance.IClientConnectionConfig|null); } /** Represents an Instance. */ @@ -2082,6 +2194,9 @@ export namespace google { /** Instance annotations. */ public annotations: { [k: string]: string }; + /** Instance clientConnectionConfig. */ + public clientConnectionConfig?: (google.cloud.alloydb.v1.Instance.IClientConnectionConfig|null); + /** * Creates a new Instance instance using the specified properties. * @param [properties] Properties to set @@ -2595,6 +2710,109 @@ export namespace google { public static getTypeUrl(typeUrlPrefix?: string): string; } + /** Properties of a ClientConnectionConfig. */ + interface IClientConnectionConfig { + + /** ClientConnectionConfig requireConnectors */ + requireConnectors?: (boolean|null); + + /** ClientConnectionConfig sslConfig */ + sslConfig?: (google.cloud.alloydb.v1.ISslConfig|null); + } + + /** Represents a ClientConnectionConfig. */ + class ClientConnectionConfig implements IClientConnectionConfig { + + /** + * Constructs a new ClientConnectionConfig. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.alloydb.v1.Instance.IClientConnectionConfig); + + /** ClientConnectionConfig requireConnectors. */ + public requireConnectors: boolean; + + /** ClientConnectionConfig sslConfig. */ + public sslConfig?: (google.cloud.alloydb.v1.ISslConfig|null); + + /** + * Creates a new ClientConnectionConfig instance using the specified properties. + * @param [properties] Properties to set + * @returns ClientConnectionConfig instance + */ + public static create(properties?: google.cloud.alloydb.v1.Instance.IClientConnectionConfig): google.cloud.alloydb.v1.Instance.ClientConnectionConfig; + + /** + * Encodes the specified ClientConnectionConfig message. Does not implicitly {@link google.cloud.alloydb.v1.Instance.ClientConnectionConfig.verify|verify} messages. + * @param message ClientConnectionConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.alloydb.v1.Instance.IClientConnectionConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ClientConnectionConfig message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1.Instance.ClientConnectionConfig.verify|verify} messages. + * @param message ClientConnectionConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.alloydb.v1.Instance.IClientConnectionConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ClientConnectionConfig message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ClientConnectionConfig + * @throws {Error} If the payload is not 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.alloydb.v1.Instance.ClientConnectionConfig; + + /** + * Decodes a ClientConnectionConfig message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ClientConnectionConfig + * @throws {Error} If the payload 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.alloydb.v1.Instance.ClientConnectionConfig; + + /** + * Verifies a ClientConnectionConfig message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ClientConnectionConfig message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ClientConnectionConfig + */ + public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1.Instance.ClientConnectionConfig; + + /** + * Creates a plain object from a ClientConnectionConfig message. Also converts values to other types if specified. + * @param message ClientConnectionConfig + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.alloydb.v1.Instance.ClientConnectionConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ClientConnectionConfig to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ClientConnectionConfig + * @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, @@ -2683,6 +2901,12 @@ export namespace google { /** Backup expiryTime */ expiryTime?: (google.protobuf.ITimestamp|null); + + /** Backup expiryQuantity */ + expiryQuantity?: (google.cloud.alloydb.v1.Backup.IQuantityBasedExpiry|null); + + /** Backup databaseVersion */ + databaseVersion?: (google.cloud.alloydb.v1.DatabaseVersion|keyof typeof google.cloud.alloydb.v1.DatabaseVersion|null); } /** Represents a Backup. */ @@ -2751,6 +2975,12 @@ export namespace google { /** Backup expiryTime. */ public expiryTime?: (google.protobuf.ITimestamp|null); + /** Backup expiryQuantity. */ + public expiryQuantity?: (google.cloud.alloydb.v1.Backup.IQuantityBasedExpiry|null); + + /** Backup databaseVersion. */ + public databaseVersion: (google.cloud.alloydb.v1.DatabaseVersion|keyof typeof google.cloud.alloydb.v1.DatabaseVersion); + /** * Creates a new Backup instance using the specified properties. * @param [properties] Properties to set @@ -2831,6 +3061,109 @@ export namespace google { namespace Backup { + /** Properties of a QuantityBasedExpiry. */ + interface IQuantityBasedExpiry { + + /** QuantityBasedExpiry retentionCount */ + retentionCount?: (number|null); + + /** QuantityBasedExpiry totalRetentionCount */ + totalRetentionCount?: (number|null); + } + + /** Represents a QuantityBasedExpiry. */ + class QuantityBasedExpiry implements IQuantityBasedExpiry { + + /** + * Constructs a new QuantityBasedExpiry. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.alloydb.v1.Backup.IQuantityBasedExpiry); + + /** QuantityBasedExpiry retentionCount. */ + public retentionCount: number; + + /** QuantityBasedExpiry totalRetentionCount. */ + public totalRetentionCount: number; + + /** + * Creates a new QuantityBasedExpiry instance using the specified properties. + * @param [properties] Properties to set + * @returns QuantityBasedExpiry instance + */ + public static create(properties?: google.cloud.alloydb.v1.Backup.IQuantityBasedExpiry): google.cloud.alloydb.v1.Backup.QuantityBasedExpiry; + + /** + * Encodes the specified QuantityBasedExpiry message. Does not implicitly {@link google.cloud.alloydb.v1.Backup.QuantityBasedExpiry.verify|verify} messages. + * @param message QuantityBasedExpiry message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.alloydb.v1.Backup.IQuantityBasedExpiry, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified QuantityBasedExpiry message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1.Backup.QuantityBasedExpiry.verify|verify} messages. + * @param message QuantityBasedExpiry message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.alloydb.v1.Backup.IQuantityBasedExpiry, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a QuantityBasedExpiry message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns QuantityBasedExpiry + * @throws {Error} If the payload is not 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.alloydb.v1.Backup.QuantityBasedExpiry; + + /** + * Decodes a QuantityBasedExpiry message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns QuantityBasedExpiry + * @throws {Error} If the payload 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.alloydb.v1.Backup.QuantityBasedExpiry; + + /** + * Verifies a QuantityBasedExpiry message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a QuantityBasedExpiry message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns QuantityBasedExpiry + */ + public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1.Backup.QuantityBasedExpiry; + + /** + * Creates a plain object from a QuantityBasedExpiry message. Also converts values to other types if specified. + * @param message QuantityBasedExpiry + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.alloydb.v1.Backup.QuantityBasedExpiry, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this QuantityBasedExpiry to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for QuantityBasedExpiry + * @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, @@ -8455,7 +8788,8 @@ export namespace google { enum DatabaseVersion { DATABASE_VERSION_UNSPECIFIED = 0, POSTGRES_13 = 1, - POSTGRES_14 = 2 + POSTGRES_14 = 2, + POSTGRES_15 = 3 } /** Properties of a UserPassword. */ @@ -10538,6 +10872,9 @@ export namespace google { /** Instance updatePolicy */ updatePolicy?: (google.cloud.alloydb.v1alpha.Instance.IUpdatePolicy|null); + /** Instance clientConnectionConfig */ + clientConnectionConfig?: (google.cloud.alloydb.v1alpha.Instance.IClientConnectionConfig|null); + /** Instance satisfiesPzs */ satisfiesPzs?: (boolean|null); } @@ -10617,6 +10954,9 @@ export namespace google { /** Instance updatePolicy. */ public updatePolicy?: (google.cloud.alloydb.v1alpha.Instance.IUpdatePolicy|null); + /** Instance clientConnectionConfig. */ + public clientConnectionConfig?: (google.cloud.alloydb.v1alpha.Instance.IClientConnectionConfig|null); + /** Instance satisfiesPzs. */ public satisfiesPzs: boolean; @@ -11240,6 +11580,109 @@ export namespace google { } } + /** Properties of a ClientConnectionConfig. */ + interface IClientConnectionConfig { + + /** ClientConnectionConfig requireConnectors */ + requireConnectors?: (boolean|null); + + /** ClientConnectionConfig sslConfig */ + sslConfig?: (google.cloud.alloydb.v1alpha.ISslConfig|null); + } + + /** Represents a ClientConnectionConfig. */ + class ClientConnectionConfig implements IClientConnectionConfig { + + /** + * Constructs a new ClientConnectionConfig. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.alloydb.v1alpha.Instance.IClientConnectionConfig); + + /** ClientConnectionConfig requireConnectors. */ + public requireConnectors: boolean; + + /** ClientConnectionConfig sslConfig. */ + public sslConfig?: (google.cloud.alloydb.v1alpha.ISslConfig|null); + + /** + * Creates a new ClientConnectionConfig instance using the specified properties. + * @param [properties] Properties to set + * @returns ClientConnectionConfig instance + */ + public static create(properties?: google.cloud.alloydb.v1alpha.Instance.IClientConnectionConfig): google.cloud.alloydb.v1alpha.Instance.ClientConnectionConfig; + + /** + * Encodes the specified ClientConnectionConfig message. Does not implicitly {@link google.cloud.alloydb.v1alpha.Instance.ClientConnectionConfig.verify|verify} messages. + * @param message ClientConnectionConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.alloydb.v1alpha.Instance.IClientConnectionConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ClientConnectionConfig message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1alpha.Instance.ClientConnectionConfig.verify|verify} messages. + * @param message ClientConnectionConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.alloydb.v1alpha.Instance.IClientConnectionConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ClientConnectionConfig message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ClientConnectionConfig + * @throws {Error} If the payload is not 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.alloydb.v1alpha.Instance.ClientConnectionConfig; + + /** + * Decodes a ClientConnectionConfig message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ClientConnectionConfig + * @throws {Error} If the payload 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.alloydb.v1alpha.Instance.ClientConnectionConfig; + + /** + * Verifies a ClientConnectionConfig message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ClientConnectionConfig message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ClientConnectionConfig + */ + public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1alpha.Instance.ClientConnectionConfig; + + /** + * Creates a plain object from a ClientConnectionConfig message. Also converts values to other types if specified. + * @param message ClientConnectionConfig + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.alloydb.v1alpha.Instance.ClientConnectionConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ClientConnectionConfig to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ClientConnectionConfig + * @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, @@ -11449,6 +11892,9 @@ export namespace google { /** Backup satisfiesPzs */ satisfiesPzs?: (boolean|null); + + /** Backup databaseVersion */ + databaseVersion?: (google.cloud.alloydb.v1alpha.DatabaseVersion|keyof typeof google.cloud.alloydb.v1alpha.DatabaseVersion|null); } /** Represents a Backup. */ @@ -11523,6 +11969,9 @@ export namespace google { /** Backup satisfiesPzs. */ public satisfiesPzs: boolean; + /** Backup databaseVersion. */ + public databaseVersion: (google.cloud.alloydb.v1alpha.DatabaseVersion|keyof typeof google.cloud.alloydb.v1alpha.DatabaseVersion); + /** * Creates a new Backup instance using the specified properties. * @param [properties] Properties to set @@ -17711,7 +18160,8 @@ export namespace google { enum DatabaseVersion { DATABASE_VERSION_UNSPECIFIED = 0, POSTGRES_13 = 1, - POSTGRES_14 = 2 + POSTGRES_14 = 2, + POSTGRES_15 = 3 } /** Properties of a UserPassword. */ @@ -19787,6 +20237,9 @@ export namespace google { /** Instance updatePolicy */ updatePolicy?: (google.cloud.alloydb.v1beta.Instance.IUpdatePolicy|null); + + /** Instance clientConnectionConfig */ + clientConnectionConfig?: (google.cloud.alloydb.v1beta.Instance.IClientConnectionConfig|null); } /** Represents an Instance. */ @@ -19864,6 +20317,9 @@ export namespace google { /** Instance updatePolicy. */ public updatePolicy?: (google.cloud.alloydb.v1beta.Instance.IUpdatePolicy|null); + /** Instance clientConnectionConfig. */ + public clientConnectionConfig?: (google.cloud.alloydb.v1beta.Instance.IClientConnectionConfig|null); + /** * Creates a new Instance instance using the specified properties. * @param [properties] Properties to set @@ -20484,6 +20940,109 @@ export namespace google { } } + /** Properties of a ClientConnectionConfig. */ + interface IClientConnectionConfig { + + /** ClientConnectionConfig requireConnectors */ + requireConnectors?: (boolean|null); + + /** ClientConnectionConfig sslConfig */ + sslConfig?: (google.cloud.alloydb.v1beta.ISslConfig|null); + } + + /** Represents a ClientConnectionConfig. */ + class ClientConnectionConfig implements IClientConnectionConfig { + + /** + * Constructs a new ClientConnectionConfig. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.alloydb.v1beta.Instance.IClientConnectionConfig); + + /** ClientConnectionConfig requireConnectors. */ + public requireConnectors: boolean; + + /** ClientConnectionConfig sslConfig. */ + public sslConfig?: (google.cloud.alloydb.v1beta.ISslConfig|null); + + /** + * Creates a new ClientConnectionConfig instance using the specified properties. + * @param [properties] Properties to set + * @returns ClientConnectionConfig instance + */ + public static create(properties?: google.cloud.alloydb.v1beta.Instance.IClientConnectionConfig): google.cloud.alloydb.v1beta.Instance.ClientConnectionConfig; + + /** + * Encodes the specified ClientConnectionConfig message. Does not implicitly {@link google.cloud.alloydb.v1beta.Instance.ClientConnectionConfig.verify|verify} messages. + * @param message ClientConnectionConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.alloydb.v1beta.Instance.IClientConnectionConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ClientConnectionConfig message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1beta.Instance.ClientConnectionConfig.verify|verify} messages. + * @param message ClientConnectionConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.alloydb.v1beta.Instance.IClientConnectionConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ClientConnectionConfig message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ClientConnectionConfig + * @throws {Error} If the payload is not 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.alloydb.v1beta.Instance.ClientConnectionConfig; + + /** + * Decodes a ClientConnectionConfig message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ClientConnectionConfig + * @throws {Error} If the payload 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.alloydb.v1beta.Instance.ClientConnectionConfig; + + /** + * Verifies a ClientConnectionConfig message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ClientConnectionConfig message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ClientConnectionConfig + */ + public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1beta.Instance.ClientConnectionConfig; + + /** + * Creates a plain object from a ClientConnectionConfig message. Also converts values to other types if specified. + * @param message ClientConnectionConfig + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.alloydb.v1beta.Instance.ClientConnectionConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ClientConnectionConfig to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ClientConnectionConfig + * @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, @@ -20687,6 +21246,12 @@ export namespace google { /** Backup expiryTime */ expiryTime?: (google.protobuf.ITimestamp|null); + + /** Backup expiryQuantity */ + expiryQuantity?: (google.cloud.alloydb.v1beta.Backup.IQuantityBasedExpiry|null); + + /** Backup databaseVersion */ + databaseVersion?: (google.cloud.alloydb.v1beta.DatabaseVersion|keyof typeof google.cloud.alloydb.v1beta.DatabaseVersion|null); } /** Represents a Backup. */ @@ -20755,6 +21320,12 @@ export namespace google { /** Backup expiryTime. */ public expiryTime?: (google.protobuf.ITimestamp|null); + /** Backup expiryQuantity. */ + public expiryQuantity?: (google.cloud.alloydb.v1beta.Backup.IQuantityBasedExpiry|null); + + /** Backup databaseVersion. */ + public databaseVersion: (google.cloud.alloydb.v1beta.DatabaseVersion|keyof typeof google.cloud.alloydb.v1beta.DatabaseVersion); + /** * Creates a new Backup instance using the specified properties. * @param [properties] Properties to set @@ -20835,6 +21406,109 @@ export namespace google { namespace Backup { + /** Properties of a QuantityBasedExpiry. */ + interface IQuantityBasedExpiry { + + /** QuantityBasedExpiry retentionCount */ + retentionCount?: (number|null); + + /** QuantityBasedExpiry totalRetentionCount */ + totalRetentionCount?: (number|null); + } + + /** Represents a QuantityBasedExpiry. */ + class QuantityBasedExpiry implements IQuantityBasedExpiry { + + /** + * Constructs a new QuantityBasedExpiry. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.alloydb.v1beta.Backup.IQuantityBasedExpiry); + + /** QuantityBasedExpiry retentionCount. */ + public retentionCount: number; + + /** QuantityBasedExpiry totalRetentionCount. */ + public totalRetentionCount: number; + + /** + * Creates a new QuantityBasedExpiry instance using the specified properties. + * @param [properties] Properties to set + * @returns QuantityBasedExpiry instance + */ + public static create(properties?: google.cloud.alloydb.v1beta.Backup.IQuantityBasedExpiry): google.cloud.alloydb.v1beta.Backup.QuantityBasedExpiry; + + /** + * Encodes the specified QuantityBasedExpiry message. Does not implicitly {@link google.cloud.alloydb.v1beta.Backup.QuantityBasedExpiry.verify|verify} messages. + * @param message QuantityBasedExpiry message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.alloydb.v1beta.Backup.IQuantityBasedExpiry, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified QuantityBasedExpiry message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1beta.Backup.QuantityBasedExpiry.verify|verify} messages. + * @param message QuantityBasedExpiry message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.alloydb.v1beta.Backup.IQuantityBasedExpiry, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a QuantityBasedExpiry message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns QuantityBasedExpiry + * @throws {Error} If the payload is not 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.alloydb.v1beta.Backup.QuantityBasedExpiry; + + /** + * Decodes a QuantityBasedExpiry message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns QuantityBasedExpiry + * @throws {Error} If the payload 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.alloydb.v1beta.Backup.QuantityBasedExpiry; + + /** + * Verifies a QuantityBasedExpiry message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a QuantityBasedExpiry message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns QuantityBasedExpiry + */ + public static fromObject(object: { [k: string]: any }): google.cloud.alloydb.v1beta.Backup.QuantityBasedExpiry; + + /** + * Creates a plain object from a QuantityBasedExpiry message. Also converts values to other types if specified. + * @param message QuantityBasedExpiry + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.alloydb.v1beta.Backup.QuantityBasedExpiry, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this QuantityBasedExpiry to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for QuantityBasedExpiry + * @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, @@ -25676,6 +26350,9 @@ export namespace google { /** GenerateClientCertificateRequest publicKey */ publicKey?: (string|null); + + /** GenerateClientCertificateRequest useMetadataExchange */ + useMetadataExchange?: (boolean|null); } /** Represents a GenerateClientCertificateRequest. */ @@ -25702,6 +26379,9 @@ export namespace google { /** GenerateClientCertificateRequest publicKey. */ public publicKey: string; + /** GenerateClientCertificateRequest useMetadataExchange. */ + public useMetadataExchange: boolean; + /** * Creates a new GenerateClientCertificateRequest instance using the specified properties. * @param [properties] Properties to set diff --git a/packages/google-cloud-alloydb/protos/protos.js b/packages/google-cloud-alloydb/protos/protos.js index 9db93d6209a..3206b3b79b2 100644 --- a/packages/google-cloud-alloydb/protos/protos.js +++ b/packages/google-cloud-alloydb/protos/protos.js @@ -3760,6 +3760,7 @@ * @property {google.cloud.alloydb.v1.Cluster.State|null} [state] Cluster state * @property {google.cloud.alloydb.v1.Cluster.ClusterType|null} [clusterType] Cluster clusterType * @property {google.cloud.alloydb.v1.DatabaseVersion|null} [databaseVersion] Cluster databaseVersion + * @property {google.cloud.alloydb.v1.Cluster.INetworkConfig|null} [networkConfig] Cluster networkConfig * @property {string|null} [network] Cluster network * @property {string|null} [etag] Cluster etag * @property {Object.|null} [annotations] Cluster annotations @@ -3888,6 +3889,14 @@ */ Cluster.prototype.databaseVersion = 0; + /** + * Cluster networkConfig. + * @member {google.cloud.alloydb.v1.Cluster.INetworkConfig|null|undefined} networkConfig + * @memberof google.cloud.alloydb.v1.Cluster + * @instance + */ + Cluster.prototype.networkConfig = null; + /** * Cluster network. * @member {string} network @@ -4082,6 +4091,8 @@ $root.google.cloud.alloydb.v1.ContinuousBackupConfig.encode(message.continuousBackupConfig, writer.uint32(/* id 27, wireType 2 =*/218).fork()).ldelim(); if (message.continuousBackupInfo != null && Object.hasOwnProperty.call(message, "continuousBackupInfo")) $root.google.cloud.alloydb.v1.ContinuousBackupInfo.encode(message.continuousBackupInfo, writer.uint32(/* id 28, wireType 2 =*/226).fork()).ldelim(); + if (message.networkConfig != null && Object.hasOwnProperty.call(message, "networkConfig")) + $root.google.cloud.alloydb.v1.Cluster.NetworkConfig.encode(message.networkConfig, writer.uint32(/* id 29, wireType 2 =*/234).fork()).ldelim(); return writer; }; @@ -4183,6 +4194,10 @@ message.databaseVersion = reader.int32(); break; } + case 29: { + message.networkConfig = $root.google.cloud.alloydb.v1.Cluster.NetworkConfig.decode(reader, reader.uint32()); + break; + } case 10: { message.network = reader.string(); break; @@ -4374,6 +4389,11 @@ case 2: break; } + if (message.networkConfig != null && message.hasOwnProperty("networkConfig")) { + var error = $root.google.cloud.alloydb.v1.Cluster.NetworkConfig.verify(message.networkConfig); + if (error) + return "networkConfig." + error; + } if (message.network != null && message.hasOwnProperty("network")) if (!$util.isString(message.network)) return "network: string expected"; @@ -4577,6 +4597,11 @@ message.databaseVersion = 2; break; } + if (object.networkConfig != null) { + if (typeof object.networkConfig !== "object") + throw TypeError(".google.cloud.alloydb.v1.Cluster.networkConfig: object expected"); + message.networkConfig = $root.google.cloud.alloydb.v1.Cluster.NetworkConfig.fromObject(object.networkConfig); + } if (object.network != null) message.network = String(object.network); if (object.etag != null) @@ -4677,6 +4702,7 @@ object.clusterType = options.enums === String ? "CLUSTER_TYPE_UNSPECIFIED" : 0; object.continuousBackupConfig = null; object.continuousBackupInfo = null; + object.networkConfig = null; } if (message.name != null && message.hasOwnProperty("name")) object.name = message.name; @@ -4741,6 +4767,8 @@ object.continuousBackupConfig = $root.google.cloud.alloydb.v1.ContinuousBackupConfig.toObject(message.continuousBackupConfig, options); if (message.continuousBackupInfo != null && message.hasOwnProperty("continuousBackupInfo")) object.continuousBackupInfo = $root.google.cloud.alloydb.v1.ContinuousBackupInfo.toObject(message.continuousBackupInfo, options); + if (message.networkConfig != null && message.hasOwnProperty("networkConfig")) + object.networkConfig = $root.google.cloud.alloydb.v1.Cluster.NetworkConfig.toObject(message.networkConfig, options); return object; }; @@ -4770,6 +4798,233 @@ return typeUrlPrefix + "/google.cloud.alloydb.v1.Cluster"; }; + Cluster.NetworkConfig = (function() { + + /** + * Properties of a NetworkConfig. + * @memberof google.cloud.alloydb.v1.Cluster + * @interface INetworkConfig + * @property {string|null} [network] NetworkConfig network + * @property {string|null} [allocatedIpRange] NetworkConfig allocatedIpRange + */ + + /** + * Constructs a new NetworkConfig. + * @memberof google.cloud.alloydb.v1.Cluster + * @classdesc Represents a NetworkConfig. + * @implements INetworkConfig + * @constructor + * @param {google.cloud.alloydb.v1.Cluster.INetworkConfig=} [properties] Properties to set + */ + function NetworkConfig(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * NetworkConfig network. + * @member {string} network + * @memberof google.cloud.alloydb.v1.Cluster.NetworkConfig + * @instance + */ + NetworkConfig.prototype.network = ""; + + /** + * NetworkConfig allocatedIpRange. + * @member {string} allocatedIpRange + * @memberof google.cloud.alloydb.v1.Cluster.NetworkConfig + * @instance + */ + NetworkConfig.prototype.allocatedIpRange = ""; + + /** + * Creates a new NetworkConfig instance using the specified properties. + * @function create + * @memberof google.cloud.alloydb.v1.Cluster.NetworkConfig + * @static + * @param {google.cloud.alloydb.v1.Cluster.INetworkConfig=} [properties] Properties to set + * @returns {google.cloud.alloydb.v1.Cluster.NetworkConfig} NetworkConfig instance + */ + NetworkConfig.create = function create(properties) { + return new NetworkConfig(properties); + }; + + /** + * Encodes the specified NetworkConfig message. Does not implicitly {@link google.cloud.alloydb.v1.Cluster.NetworkConfig.verify|verify} messages. + * @function encode + * @memberof google.cloud.alloydb.v1.Cluster.NetworkConfig + * @static + * @param {google.cloud.alloydb.v1.Cluster.INetworkConfig} message NetworkConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + NetworkConfig.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.network != null && Object.hasOwnProperty.call(message, "network")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.network); + if (message.allocatedIpRange != null && Object.hasOwnProperty.call(message, "allocatedIpRange")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.allocatedIpRange); + return writer; + }; + + /** + * Encodes the specified NetworkConfig message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1.Cluster.NetworkConfig.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.alloydb.v1.Cluster.NetworkConfig + * @static + * @param {google.cloud.alloydb.v1.Cluster.INetworkConfig} message NetworkConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + NetworkConfig.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a NetworkConfig message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.alloydb.v1.Cluster.NetworkConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.alloydb.v1.Cluster.NetworkConfig} NetworkConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + NetworkConfig.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1.Cluster.NetworkConfig(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.network = reader.string(); + break; + } + case 2: { + message.allocatedIpRange = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a NetworkConfig message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.alloydb.v1.Cluster.NetworkConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.alloydb.v1.Cluster.NetworkConfig} NetworkConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + NetworkConfig.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a NetworkConfig message. + * @function verify + * @memberof google.cloud.alloydb.v1.Cluster.NetworkConfig + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + NetworkConfig.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.network != null && message.hasOwnProperty("network")) + if (!$util.isString(message.network)) + return "network: string expected"; + if (message.allocatedIpRange != null && message.hasOwnProperty("allocatedIpRange")) + if (!$util.isString(message.allocatedIpRange)) + return "allocatedIpRange: string expected"; + return null; + }; + + /** + * Creates a NetworkConfig message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.alloydb.v1.Cluster.NetworkConfig + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.alloydb.v1.Cluster.NetworkConfig} NetworkConfig + */ + NetworkConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.alloydb.v1.Cluster.NetworkConfig) + return object; + var message = new $root.google.cloud.alloydb.v1.Cluster.NetworkConfig(); + if (object.network != null) + message.network = String(object.network); + if (object.allocatedIpRange != null) + message.allocatedIpRange = String(object.allocatedIpRange); + return message; + }; + + /** + * Creates a plain object from a NetworkConfig message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.alloydb.v1.Cluster.NetworkConfig + * @static + * @param {google.cloud.alloydb.v1.Cluster.NetworkConfig} message NetworkConfig + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + NetworkConfig.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.network = ""; + object.allocatedIpRange = ""; + } + if (message.network != null && message.hasOwnProperty("network")) + object.network = message.network; + if (message.allocatedIpRange != null && message.hasOwnProperty("allocatedIpRange")) + object.allocatedIpRange = message.allocatedIpRange; + return object; + }; + + /** + * Converts this NetworkConfig to JSON. + * @function toJSON + * @memberof google.cloud.alloydb.v1.Cluster.NetworkConfig + * @instance + * @returns {Object.} JSON object + */ + NetworkConfig.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for NetworkConfig + * @function getTypeUrl + * @memberof google.cloud.alloydb.v1.Cluster.NetworkConfig + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + NetworkConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.alloydb.v1.Cluster.NetworkConfig"; + }; + + return NetworkConfig; + })(); + Cluster.SecondaryConfig = (function() { /** @@ -5268,6 +5523,7 @@ * @property {boolean|null} [reconciling] Instance reconciling * @property {string|null} [etag] Instance etag * @property {Object.|null} [annotations] Instance annotations + * @property {google.cloud.alloydb.v1.Instance.IClientConnectionConfig|null} [clientConnectionConfig] Instance clientConnectionConfig */ /** @@ -5457,6 +5713,14 @@ */ Instance.prototype.annotations = $util.emptyObject; + /** + * Instance clientConnectionConfig. + * @member {google.cloud.alloydb.v1.Instance.IClientConnectionConfig|null|undefined} clientConnectionConfig + * @memberof google.cloud.alloydb.v1.Instance + * @instance + */ + Instance.prototype.clientConnectionConfig = null; + /** * Creates a new Instance instance using the specified properties. * @function create @@ -5527,6 +5791,8 @@ $root.google.cloud.alloydb.v1.Instance.Node.encode(message.nodes[i], writer.uint32(/* id 20, wireType 2 =*/162).fork()).ldelim(); if (message.queryInsightsConfig != null && Object.hasOwnProperty.call(message, "queryInsightsConfig")) $root.google.cloud.alloydb.v1.Instance.QueryInsightsInstanceConfig.encode(message.queryInsightsConfig, writer.uint32(/* id 21, wireType 2 =*/170).fork()).ldelim(); + if (message.clientConnectionConfig != null && Object.hasOwnProperty.call(message, "clientConnectionConfig")) + $root.google.cloud.alloydb.v1.Instance.ClientConnectionConfig.encode(message.clientConnectionConfig, writer.uint32(/* id 23, wireType 2 =*/186).fork()).ldelim(); return writer; }; @@ -5704,6 +5970,10 @@ message.annotations[key] = value; break; } + case 23: { + message.clientConnectionConfig = $root.google.cloud.alloydb.v1.Instance.ClientConnectionConfig.decode(reader, reader.uint32()); + break; + } default: reader.skipType(tag & 7); break; @@ -5862,6 +6132,11 @@ if (!$util.isString(message.annotations[key[i]])) return "annotations: string{k:string} expected"; } + if (message.clientConnectionConfig != null && message.hasOwnProperty("clientConnectionConfig")) { + var error = $root.google.cloud.alloydb.v1.Instance.ClientConnectionConfig.verify(message.clientConnectionConfig); + if (error) + return "clientConnectionConfig." + error; + } return null; }; @@ -6045,6 +6320,11 @@ for (var keys = Object.keys(object.annotations), i = 0; i < keys.length; ++i) message.annotations[keys[i]] = String(object.annotations[keys[i]]); } + if (object.clientConnectionConfig != null) { + if (typeof object.clientConnectionConfig !== "object") + throw TypeError(".google.cloud.alloydb.v1.Instance.clientConnectionConfig: object expected"); + message.clientConnectionConfig = $root.google.cloud.alloydb.v1.Instance.ClientConnectionConfig.fromObject(object.clientConnectionConfig); + } return message; }; @@ -6086,6 +6366,7 @@ object.etag = ""; object.writableNode = null; object.queryInsightsConfig = null; + object.clientConnectionConfig = null; } if (message.name != null && message.hasOwnProperty("name")) object.name = message.name; @@ -6142,6 +6423,8 @@ } if (message.queryInsightsConfig != null && message.hasOwnProperty("queryInsightsConfig")) object.queryInsightsConfig = $root.google.cloud.alloydb.v1.Instance.QueryInsightsInstanceConfig.toObject(message.queryInsightsConfig, options); + if (message.clientConnectionConfig != null && message.hasOwnProperty("clientConnectionConfig")) + object.clientConnectionConfig = $root.google.cloud.alloydb.v1.Instance.ClientConnectionConfig.toObject(message.clientConnectionConfig, options); return object; }; @@ -7171,6 +7454,238 @@ return ReadPoolConfig; })(); + Instance.ClientConnectionConfig = (function() { + + /** + * Properties of a ClientConnectionConfig. + * @memberof google.cloud.alloydb.v1.Instance + * @interface IClientConnectionConfig + * @property {boolean|null} [requireConnectors] ClientConnectionConfig requireConnectors + * @property {google.cloud.alloydb.v1.ISslConfig|null} [sslConfig] ClientConnectionConfig sslConfig + */ + + /** + * Constructs a new ClientConnectionConfig. + * @memberof google.cloud.alloydb.v1.Instance + * @classdesc Represents a ClientConnectionConfig. + * @implements IClientConnectionConfig + * @constructor + * @param {google.cloud.alloydb.v1.Instance.IClientConnectionConfig=} [properties] Properties to set + */ + function ClientConnectionConfig(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ClientConnectionConfig requireConnectors. + * @member {boolean} requireConnectors + * @memberof google.cloud.alloydb.v1.Instance.ClientConnectionConfig + * @instance + */ + ClientConnectionConfig.prototype.requireConnectors = false; + + /** + * ClientConnectionConfig sslConfig. + * @member {google.cloud.alloydb.v1.ISslConfig|null|undefined} sslConfig + * @memberof google.cloud.alloydb.v1.Instance.ClientConnectionConfig + * @instance + */ + ClientConnectionConfig.prototype.sslConfig = null; + + /** + * Creates a new ClientConnectionConfig instance using the specified properties. + * @function create + * @memberof google.cloud.alloydb.v1.Instance.ClientConnectionConfig + * @static + * @param {google.cloud.alloydb.v1.Instance.IClientConnectionConfig=} [properties] Properties to set + * @returns {google.cloud.alloydb.v1.Instance.ClientConnectionConfig} ClientConnectionConfig instance + */ + ClientConnectionConfig.create = function create(properties) { + return new ClientConnectionConfig(properties); + }; + + /** + * Encodes the specified ClientConnectionConfig message. Does not implicitly {@link google.cloud.alloydb.v1.Instance.ClientConnectionConfig.verify|verify} messages. + * @function encode + * @memberof google.cloud.alloydb.v1.Instance.ClientConnectionConfig + * @static + * @param {google.cloud.alloydb.v1.Instance.IClientConnectionConfig} message ClientConnectionConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ClientConnectionConfig.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.requireConnectors != null && Object.hasOwnProperty.call(message, "requireConnectors")) + writer.uint32(/* id 1, wireType 0 =*/8).bool(message.requireConnectors); + if (message.sslConfig != null && Object.hasOwnProperty.call(message, "sslConfig")) + $root.google.cloud.alloydb.v1.SslConfig.encode(message.sslConfig, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified ClientConnectionConfig message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1.Instance.ClientConnectionConfig.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.alloydb.v1.Instance.ClientConnectionConfig + * @static + * @param {google.cloud.alloydb.v1.Instance.IClientConnectionConfig} message ClientConnectionConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ClientConnectionConfig.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ClientConnectionConfig message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.alloydb.v1.Instance.ClientConnectionConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.alloydb.v1.Instance.ClientConnectionConfig} ClientConnectionConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ClientConnectionConfig.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1.Instance.ClientConnectionConfig(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.requireConnectors = reader.bool(); + break; + } + case 2: { + message.sslConfig = $root.google.cloud.alloydb.v1.SslConfig.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ClientConnectionConfig message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.alloydb.v1.Instance.ClientConnectionConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.alloydb.v1.Instance.ClientConnectionConfig} ClientConnectionConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ClientConnectionConfig.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ClientConnectionConfig message. + * @function verify + * @memberof google.cloud.alloydb.v1.Instance.ClientConnectionConfig + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ClientConnectionConfig.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.requireConnectors != null && message.hasOwnProperty("requireConnectors")) + if (typeof message.requireConnectors !== "boolean") + return "requireConnectors: boolean expected"; + if (message.sslConfig != null && message.hasOwnProperty("sslConfig")) { + var error = $root.google.cloud.alloydb.v1.SslConfig.verify(message.sslConfig); + if (error) + return "sslConfig." + error; + } + return null; + }; + + /** + * Creates a ClientConnectionConfig message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.alloydb.v1.Instance.ClientConnectionConfig + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.alloydb.v1.Instance.ClientConnectionConfig} ClientConnectionConfig + */ + ClientConnectionConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.alloydb.v1.Instance.ClientConnectionConfig) + return object; + var message = new $root.google.cloud.alloydb.v1.Instance.ClientConnectionConfig(); + if (object.requireConnectors != null) + message.requireConnectors = Boolean(object.requireConnectors); + if (object.sslConfig != null) { + if (typeof object.sslConfig !== "object") + throw TypeError(".google.cloud.alloydb.v1.Instance.ClientConnectionConfig.sslConfig: object expected"); + message.sslConfig = $root.google.cloud.alloydb.v1.SslConfig.fromObject(object.sslConfig); + } + return message; + }; + + /** + * Creates a plain object from a ClientConnectionConfig message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.alloydb.v1.Instance.ClientConnectionConfig + * @static + * @param {google.cloud.alloydb.v1.Instance.ClientConnectionConfig} message ClientConnectionConfig + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ClientConnectionConfig.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.requireConnectors = false; + object.sslConfig = null; + } + if (message.requireConnectors != null && message.hasOwnProperty("requireConnectors")) + object.requireConnectors = message.requireConnectors; + if (message.sslConfig != null && message.hasOwnProperty("sslConfig")) + object.sslConfig = $root.google.cloud.alloydb.v1.SslConfig.toObject(message.sslConfig, options); + return object; + }; + + /** + * Converts this ClientConnectionConfig to JSON. + * @function toJSON + * @memberof google.cloud.alloydb.v1.Instance.ClientConnectionConfig + * @instance + * @returns {Object.} JSON object + */ + ClientConnectionConfig.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ClientConnectionConfig + * @function getTypeUrl + * @memberof google.cloud.alloydb.v1.Instance.ClientConnectionConfig + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ClientConnectionConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.alloydb.v1.Instance.ClientConnectionConfig"; + }; + + return ClientConnectionConfig; + })(); + /** * State enum. * @name google.cloud.alloydb.v1.Instance.State @@ -7261,6 +7776,8 @@ * @property {Object.|null} [annotations] Backup annotations * @property {number|Long|null} [sizeBytes] Backup sizeBytes * @property {google.protobuf.ITimestamp|null} [expiryTime] Backup expiryTime + * @property {google.cloud.alloydb.v1.Backup.IQuantityBasedExpiry|null} [expiryQuantity] Backup expiryQuantity + * @property {google.cloud.alloydb.v1.DatabaseVersion|null} [databaseVersion] Backup databaseVersion */ /** @@ -7432,6 +7949,22 @@ */ Backup.prototype.expiryTime = null; + /** + * Backup expiryQuantity. + * @member {google.cloud.alloydb.v1.Backup.IQuantityBasedExpiry|null|undefined} expiryQuantity + * @memberof google.cloud.alloydb.v1.Backup + * @instance + */ + Backup.prototype.expiryQuantity = null; + + /** + * Backup databaseVersion. + * @member {google.cloud.alloydb.v1.DatabaseVersion} databaseVersion + * @memberof google.cloud.alloydb.v1.Backup + * @instance + */ + Backup.prototype.databaseVersion = 0; + /** * Creates a new Backup instance using the specified properties. * @function create @@ -7496,6 +8029,10 @@ writer.uint32(/* id 18, wireType 2 =*/146).string(message.clusterUid); if (message.expiryTime != null && Object.hasOwnProperty.call(message, "expiryTime")) $root.google.protobuf.Timestamp.encode(message.expiryTime, writer.uint32(/* id 19, wireType 2 =*/154).fork()).ldelim(); + if (message.expiryQuantity != null && Object.hasOwnProperty.call(message, "expiryQuantity")) + $root.google.cloud.alloydb.v1.Backup.QuantityBasedExpiry.encode(message.expiryQuantity, writer.uint32(/* id 20, wireType 2 =*/162).fork()).ldelim(); + if (message.databaseVersion != null && Object.hasOwnProperty.call(message, "databaseVersion")) + writer.uint32(/* id 22, wireType 0 =*/176).int32(message.databaseVersion); return writer; }; @@ -7644,6 +8181,14 @@ message.expiryTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); break; } + case 20: { + message.expiryQuantity = $root.google.cloud.alloydb.v1.Backup.QuantityBasedExpiry.decode(reader, reader.uint32()); + break; + } + case 22: { + message.databaseVersion = reader.int32(); + break; + } default: reader.skipType(tag & 7); break; @@ -7773,6 +8318,20 @@ if (error) return "expiryTime." + error; } + if (message.expiryQuantity != null && message.hasOwnProperty("expiryQuantity")) { + var error = $root.google.cloud.alloydb.v1.Backup.QuantityBasedExpiry.verify(message.expiryQuantity); + if (error) + return "expiryQuantity." + error; + } + if (message.databaseVersion != null && message.hasOwnProperty("databaseVersion")) + switch (message.databaseVersion) { + default: + return "databaseVersion: enum value expected"; + case 0: + case 1: + case 2: + break; + } return null; }; @@ -7909,6 +8468,31 @@ throw TypeError(".google.cloud.alloydb.v1.Backup.expiryTime: object expected"); message.expiryTime = $root.google.protobuf.Timestamp.fromObject(object.expiryTime); } + if (object.expiryQuantity != null) { + if (typeof object.expiryQuantity !== "object") + throw TypeError(".google.cloud.alloydb.v1.Backup.expiryQuantity: object expected"); + message.expiryQuantity = $root.google.cloud.alloydb.v1.Backup.QuantityBasedExpiry.fromObject(object.expiryQuantity); + } + switch (object.databaseVersion) { + default: + if (typeof object.databaseVersion === "number") { + message.databaseVersion = object.databaseVersion; + break; + } + break; + case "DATABASE_VERSION_UNSPECIFIED": + case 0: + message.databaseVersion = 0; + break; + case "POSTGRES_13": + case 1: + message.databaseVersion = 1; + break; + case "POSTGRES_14": + case 2: + message.databaseVersion = 2; + break; + } return message; }; @@ -7951,6 +8535,8 @@ object.sizeBytes = options.longs === String ? "0" : 0; object.clusterUid = ""; object.expiryTime = null; + object.expiryQuantity = null; + object.databaseVersion = options.enums === String ? "DATABASE_VERSION_UNSPECIFIED" : 0; } if (message.name != null && message.hasOwnProperty("name")) object.name = message.name; @@ -8000,6 +8586,10 @@ object.clusterUid = message.clusterUid; if (message.expiryTime != null && message.hasOwnProperty("expiryTime")) object.expiryTime = $root.google.protobuf.Timestamp.toObject(message.expiryTime, options); + if (message.expiryQuantity != null && message.hasOwnProperty("expiryQuantity")) + object.expiryQuantity = $root.google.cloud.alloydb.v1.Backup.QuantityBasedExpiry.toObject(message.expiryQuantity, options); + if (message.databaseVersion != null && message.hasOwnProperty("databaseVersion")) + object.databaseVersion = options.enums === String ? $root.google.cloud.alloydb.v1.DatabaseVersion[message.databaseVersion] === undefined ? message.databaseVersion : $root.google.cloud.alloydb.v1.DatabaseVersion[message.databaseVersion] : message.databaseVersion; return object; }; @@ -8029,6 +8619,233 @@ return typeUrlPrefix + "/google.cloud.alloydb.v1.Backup"; }; + Backup.QuantityBasedExpiry = (function() { + + /** + * Properties of a QuantityBasedExpiry. + * @memberof google.cloud.alloydb.v1.Backup + * @interface IQuantityBasedExpiry + * @property {number|null} [retentionCount] QuantityBasedExpiry retentionCount + * @property {number|null} [totalRetentionCount] QuantityBasedExpiry totalRetentionCount + */ + + /** + * Constructs a new QuantityBasedExpiry. + * @memberof google.cloud.alloydb.v1.Backup + * @classdesc Represents a QuantityBasedExpiry. + * @implements IQuantityBasedExpiry + * @constructor + * @param {google.cloud.alloydb.v1.Backup.IQuantityBasedExpiry=} [properties] Properties to set + */ + function QuantityBasedExpiry(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * QuantityBasedExpiry retentionCount. + * @member {number} retentionCount + * @memberof google.cloud.alloydb.v1.Backup.QuantityBasedExpiry + * @instance + */ + QuantityBasedExpiry.prototype.retentionCount = 0; + + /** + * QuantityBasedExpiry totalRetentionCount. + * @member {number} totalRetentionCount + * @memberof google.cloud.alloydb.v1.Backup.QuantityBasedExpiry + * @instance + */ + QuantityBasedExpiry.prototype.totalRetentionCount = 0; + + /** + * Creates a new QuantityBasedExpiry instance using the specified properties. + * @function create + * @memberof google.cloud.alloydb.v1.Backup.QuantityBasedExpiry + * @static + * @param {google.cloud.alloydb.v1.Backup.IQuantityBasedExpiry=} [properties] Properties to set + * @returns {google.cloud.alloydb.v1.Backup.QuantityBasedExpiry} QuantityBasedExpiry instance + */ + QuantityBasedExpiry.create = function create(properties) { + return new QuantityBasedExpiry(properties); + }; + + /** + * Encodes the specified QuantityBasedExpiry message. Does not implicitly {@link google.cloud.alloydb.v1.Backup.QuantityBasedExpiry.verify|verify} messages. + * @function encode + * @memberof google.cloud.alloydb.v1.Backup.QuantityBasedExpiry + * @static + * @param {google.cloud.alloydb.v1.Backup.IQuantityBasedExpiry} message QuantityBasedExpiry message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + QuantityBasedExpiry.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.retentionCount != null && Object.hasOwnProperty.call(message, "retentionCount")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.retentionCount); + if (message.totalRetentionCount != null && Object.hasOwnProperty.call(message, "totalRetentionCount")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.totalRetentionCount); + return writer; + }; + + /** + * Encodes the specified QuantityBasedExpiry message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1.Backup.QuantityBasedExpiry.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.alloydb.v1.Backup.QuantityBasedExpiry + * @static + * @param {google.cloud.alloydb.v1.Backup.IQuantityBasedExpiry} message QuantityBasedExpiry message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + QuantityBasedExpiry.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a QuantityBasedExpiry message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.alloydb.v1.Backup.QuantityBasedExpiry + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.alloydb.v1.Backup.QuantityBasedExpiry} QuantityBasedExpiry + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + QuantityBasedExpiry.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1.Backup.QuantityBasedExpiry(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.retentionCount = reader.int32(); + break; + } + case 2: { + message.totalRetentionCount = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a QuantityBasedExpiry message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.alloydb.v1.Backup.QuantityBasedExpiry + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.alloydb.v1.Backup.QuantityBasedExpiry} QuantityBasedExpiry + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + QuantityBasedExpiry.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a QuantityBasedExpiry message. + * @function verify + * @memberof google.cloud.alloydb.v1.Backup.QuantityBasedExpiry + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + QuantityBasedExpiry.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.retentionCount != null && message.hasOwnProperty("retentionCount")) + if (!$util.isInteger(message.retentionCount)) + return "retentionCount: integer expected"; + if (message.totalRetentionCount != null && message.hasOwnProperty("totalRetentionCount")) + if (!$util.isInteger(message.totalRetentionCount)) + return "totalRetentionCount: integer expected"; + return null; + }; + + /** + * Creates a QuantityBasedExpiry message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.alloydb.v1.Backup.QuantityBasedExpiry + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.alloydb.v1.Backup.QuantityBasedExpiry} QuantityBasedExpiry + */ + QuantityBasedExpiry.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.alloydb.v1.Backup.QuantityBasedExpiry) + return object; + var message = new $root.google.cloud.alloydb.v1.Backup.QuantityBasedExpiry(); + if (object.retentionCount != null) + message.retentionCount = object.retentionCount | 0; + if (object.totalRetentionCount != null) + message.totalRetentionCount = object.totalRetentionCount | 0; + return message; + }; + + /** + * Creates a plain object from a QuantityBasedExpiry message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.alloydb.v1.Backup.QuantityBasedExpiry + * @static + * @param {google.cloud.alloydb.v1.Backup.QuantityBasedExpiry} message QuantityBasedExpiry + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + QuantityBasedExpiry.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.retentionCount = 0; + object.totalRetentionCount = 0; + } + if (message.retentionCount != null && message.hasOwnProperty("retentionCount")) + object.retentionCount = message.retentionCount; + if (message.totalRetentionCount != null && message.hasOwnProperty("totalRetentionCount")) + object.totalRetentionCount = message.totalRetentionCount; + return object; + }; + + /** + * Converts this QuantityBasedExpiry to JSON. + * @function toJSON + * @memberof google.cloud.alloydb.v1.Backup.QuantityBasedExpiry + * @instance + * @returns {Object.} JSON object + */ + QuantityBasedExpiry.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for QuantityBasedExpiry + * @function getTypeUrl + * @memberof google.cloud.alloydb.v1.Backup.QuantityBasedExpiry + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + QuantityBasedExpiry.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.alloydb.v1.Backup.QuantityBasedExpiry"; + }; + + return QuantityBasedExpiry; + })(); + /** * State enum. * @name google.cloud.alloydb.v1.Backup.State @@ -21494,12 +22311,14 @@ * @property {number} DATABASE_VERSION_UNSPECIFIED=0 DATABASE_VERSION_UNSPECIFIED value * @property {number} POSTGRES_13=1 POSTGRES_13 value * @property {number} POSTGRES_14=2 POSTGRES_14 value + * @property {number} POSTGRES_15=3 POSTGRES_15 value */ v1alpha.DatabaseVersion = (function() { var valuesById = {}, values = Object.create(valuesById); values[valuesById[0] = "DATABASE_VERSION_UNSPECIFIED"] = 0; values[valuesById[1] = "POSTGRES_13"] = 1; values[valuesById[2] = "POSTGRES_14"] = 2; + values[valuesById[3] = "POSTGRES_15"] = 3; return values; })(); @@ -25791,6 +26610,7 @@ case 0: case 1: case 2: + case 3: break; } if (message.networkConfig != null && message.hasOwnProperty("networkConfig")) { @@ -26003,6 +26823,10 @@ case 2: message.databaseVersion = 2; break; + case "POSTGRES_15": + case 3: + message.databaseVersion = 3; + break; } if (object.networkConfig != null) { if (typeof object.networkConfig !== "object") @@ -26936,6 +27760,7 @@ * @property {string|null} [etag] Instance etag * @property {Object.|null} [annotations] Instance annotations * @property {google.cloud.alloydb.v1alpha.Instance.IUpdatePolicy|null} [updatePolicy] Instance updatePolicy + * @property {google.cloud.alloydb.v1alpha.Instance.IClientConnectionConfig|null} [clientConnectionConfig] Instance clientConnectionConfig * @property {boolean|null} [satisfiesPzs] Instance satisfiesPzs */ @@ -27134,6 +27959,14 @@ */ Instance.prototype.updatePolicy = null; + /** + * Instance clientConnectionConfig. + * @member {google.cloud.alloydb.v1alpha.Instance.IClientConnectionConfig|null|undefined} clientConnectionConfig + * @memberof google.cloud.alloydb.v1alpha.Instance + * @instance + */ + Instance.prototype.clientConnectionConfig = null; + /** * Instance satisfiesPzs. * @member {boolean} satisfiesPzs @@ -27214,6 +28047,8 @@ $root.google.cloud.alloydb.v1alpha.Instance.QueryInsightsInstanceConfig.encode(message.queryInsightsConfig, writer.uint32(/* id 21, wireType 2 =*/170).fork()).ldelim(); if (message.updatePolicy != null && Object.hasOwnProperty.call(message, "updatePolicy")) $root.google.cloud.alloydb.v1alpha.Instance.UpdatePolicy.encode(message.updatePolicy, writer.uint32(/* id 22, wireType 2 =*/178).fork()).ldelim(); + if (message.clientConnectionConfig != null && Object.hasOwnProperty.call(message, "clientConnectionConfig")) + $root.google.cloud.alloydb.v1alpha.Instance.ClientConnectionConfig.encode(message.clientConnectionConfig, writer.uint32(/* id 23, wireType 2 =*/186).fork()).ldelim(); if (message.satisfiesPzs != null && Object.hasOwnProperty.call(message, "satisfiesPzs")) writer.uint32(/* id 24, wireType 0 =*/192).bool(message.satisfiesPzs); return writer; @@ -27397,6 +28232,10 @@ message.updatePolicy = $root.google.cloud.alloydb.v1alpha.Instance.UpdatePolicy.decode(reader, reader.uint32()); break; } + case 23: { + message.clientConnectionConfig = $root.google.cloud.alloydb.v1alpha.Instance.ClientConnectionConfig.decode(reader, reader.uint32()); + break; + } case 24: { message.satisfiesPzs = reader.bool(); break; @@ -27564,6 +28403,11 @@ if (error) return "updatePolicy." + error; } + if (message.clientConnectionConfig != null && message.hasOwnProperty("clientConnectionConfig")) { + var error = $root.google.cloud.alloydb.v1alpha.Instance.ClientConnectionConfig.verify(message.clientConnectionConfig); + if (error) + return "clientConnectionConfig." + error; + } if (message.satisfiesPzs != null && message.hasOwnProperty("satisfiesPzs")) if (typeof message.satisfiesPzs !== "boolean") return "satisfiesPzs: boolean expected"; @@ -27755,6 +28599,11 @@ throw TypeError(".google.cloud.alloydb.v1alpha.Instance.updatePolicy: object expected"); message.updatePolicy = $root.google.cloud.alloydb.v1alpha.Instance.UpdatePolicy.fromObject(object.updatePolicy); } + if (object.clientConnectionConfig != null) { + if (typeof object.clientConnectionConfig !== "object") + throw TypeError(".google.cloud.alloydb.v1alpha.Instance.clientConnectionConfig: object expected"); + message.clientConnectionConfig = $root.google.cloud.alloydb.v1alpha.Instance.ClientConnectionConfig.fromObject(object.clientConnectionConfig); + } if (object.satisfiesPzs != null) message.satisfiesPzs = Boolean(object.satisfiesPzs); return message; @@ -27799,6 +28648,7 @@ object.writableNode = null; object.queryInsightsConfig = null; object.updatePolicy = null; + object.clientConnectionConfig = null; object.satisfiesPzs = false; } if (message.name != null && message.hasOwnProperty("name")) @@ -27858,6 +28708,8 @@ object.queryInsightsConfig = $root.google.cloud.alloydb.v1alpha.Instance.QueryInsightsInstanceConfig.toObject(message.queryInsightsConfig, options); if (message.updatePolicy != null && message.hasOwnProperty("updatePolicy")) object.updatePolicy = $root.google.cloud.alloydb.v1alpha.Instance.UpdatePolicy.toObject(message.updatePolicy, options); + if (message.clientConnectionConfig != null && message.hasOwnProperty("clientConnectionConfig")) + object.clientConnectionConfig = $root.google.cloud.alloydb.v1alpha.Instance.ClientConnectionConfig.toObject(message.clientConnectionConfig, options); if (message.satisfiesPzs != null && message.hasOwnProperty("satisfiesPzs")) object.satisfiesPzs = message.satisfiesPzs; return object; @@ -29132,6 +29984,238 @@ return UpdatePolicy; })(); + Instance.ClientConnectionConfig = (function() { + + /** + * Properties of a ClientConnectionConfig. + * @memberof google.cloud.alloydb.v1alpha.Instance + * @interface IClientConnectionConfig + * @property {boolean|null} [requireConnectors] ClientConnectionConfig requireConnectors + * @property {google.cloud.alloydb.v1alpha.ISslConfig|null} [sslConfig] ClientConnectionConfig sslConfig + */ + + /** + * Constructs a new ClientConnectionConfig. + * @memberof google.cloud.alloydb.v1alpha.Instance + * @classdesc Represents a ClientConnectionConfig. + * @implements IClientConnectionConfig + * @constructor + * @param {google.cloud.alloydb.v1alpha.Instance.IClientConnectionConfig=} [properties] Properties to set + */ + function ClientConnectionConfig(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ClientConnectionConfig requireConnectors. + * @member {boolean} requireConnectors + * @memberof google.cloud.alloydb.v1alpha.Instance.ClientConnectionConfig + * @instance + */ + ClientConnectionConfig.prototype.requireConnectors = false; + + /** + * ClientConnectionConfig sslConfig. + * @member {google.cloud.alloydb.v1alpha.ISslConfig|null|undefined} sslConfig + * @memberof google.cloud.alloydb.v1alpha.Instance.ClientConnectionConfig + * @instance + */ + ClientConnectionConfig.prototype.sslConfig = null; + + /** + * Creates a new ClientConnectionConfig instance using the specified properties. + * @function create + * @memberof google.cloud.alloydb.v1alpha.Instance.ClientConnectionConfig + * @static + * @param {google.cloud.alloydb.v1alpha.Instance.IClientConnectionConfig=} [properties] Properties to set + * @returns {google.cloud.alloydb.v1alpha.Instance.ClientConnectionConfig} ClientConnectionConfig instance + */ + ClientConnectionConfig.create = function create(properties) { + return new ClientConnectionConfig(properties); + }; + + /** + * Encodes the specified ClientConnectionConfig message. Does not implicitly {@link google.cloud.alloydb.v1alpha.Instance.ClientConnectionConfig.verify|verify} messages. + * @function encode + * @memberof google.cloud.alloydb.v1alpha.Instance.ClientConnectionConfig + * @static + * @param {google.cloud.alloydb.v1alpha.Instance.IClientConnectionConfig} message ClientConnectionConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ClientConnectionConfig.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.requireConnectors != null && Object.hasOwnProperty.call(message, "requireConnectors")) + writer.uint32(/* id 1, wireType 0 =*/8).bool(message.requireConnectors); + if (message.sslConfig != null && Object.hasOwnProperty.call(message, "sslConfig")) + $root.google.cloud.alloydb.v1alpha.SslConfig.encode(message.sslConfig, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified ClientConnectionConfig message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1alpha.Instance.ClientConnectionConfig.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.alloydb.v1alpha.Instance.ClientConnectionConfig + * @static + * @param {google.cloud.alloydb.v1alpha.Instance.IClientConnectionConfig} message ClientConnectionConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ClientConnectionConfig.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ClientConnectionConfig message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.alloydb.v1alpha.Instance.ClientConnectionConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.alloydb.v1alpha.Instance.ClientConnectionConfig} ClientConnectionConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ClientConnectionConfig.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1alpha.Instance.ClientConnectionConfig(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.requireConnectors = reader.bool(); + break; + } + case 2: { + message.sslConfig = $root.google.cloud.alloydb.v1alpha.SslConfig.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ClientConnectionConfig message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.alloydb.v1alpha.Instance.ClientConnectionConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.alloydb.v1alpha.Instance.ClientConnectionConfig} ClientConnectionConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ClientConnectionConfig.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ClientConnectionConfig message. + * @function verify + * @memberof google.cloud.alloydb.v1alpha.Instance.ClientConnectionConfig + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ClientConnectionConfig.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.requireConnectors != null && message.hasOwnProperty("requireConnectors")) + if (typeof message.requireConnectors !== "boolean") + return "requireConnectors: boolean expected"; + if (message.sslConfig != null && message.hasOwnProperty("sslConfig")) { + var error = $root.google.cloud.alloydb.v1alpha.SslConfig.verify(message.sslConfig); + if (error) + return "sslConfig." + error; + } + return null; + }; + + /** + * Creates a ClientConnectionConfig message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.alloydb.v1alpha.Instance.ClientConnectionConfig + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.alloydb.v1alpha.Instance.ClientConnectionConfig} ClientConnectionConfig + */ + ClientConnectionConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.alloydb.v1alpha.Instance.ClientConnectionConfig) + return object; + var message = new $root.google.cloud.alloydb.v1alpha.Instance.ClientConnectionConfig(); + if (object.requireConnectors != null) + message.requireConnectors = Boolean(object.requireConnectors); + if (object.sslConfig != null) { + if (typeof object.sslConfig !== "object") + throw TypeError(".google.cloud.alloydb.v1alpha.Instance.ClientConnectionConfig.sslConfig: object expected"); + message.sslConfig = $root.google.cloud.alloydb.v1alpha.SslConfig.fromObject(object.sslConfig); + } + return message; + }; + + /** + * Creates a plain object from a ClientConnectionConfig message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.alloydb.v1alpha.Instance.ClientConnectionConfig + * @static + * @param {google.cloud.alloydb.v1alpha.Instance.ClientConnectionConfig} message ClientConnectionConfig + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ClientConnectionConfig.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.requireConnectors = false; + object.sslConfig = null; + } + if (message.requireConnectors != null && message.hasOwnProperty("requireConnectors")) + object.requireConnectors = message.requireConnectors; + if (message.sslConfig != null && message.hasOwnProperty("sslConfig")) + object.sslConfig = $root.google.cloud.alloydb.v1alpha.SslConfig.toObject(message.sslConfig, options); + return object; + }; + + /** + * Converts this ClientConnectionConfig to JSON. + * @function toJSON + * @memberof google.cloud.alloydb.v1alpha.Instance.ClientConnectionConfig + * @instance + * @returns {Object.} JSON object + */ + ClientConnectionConfig.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ClientConnectionConfig + * @function getTypeUrl + * @memberof google.cloud.alloydb.v1alpha.Instance.ClientConnectionConfig + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ClientConnectionConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.alloydb.v1alpha.Instance.ClientConnectionConfig"; + }; + + return ClientConnectionConfig; + })(); + /** * State enum. * @name google.cloud.alloydb.v1alpha.Instance.State @@ -29514,6 +30598,7 @@ * @property {google.protobuf.ITimestamp|null} [expiryTime] Backup expiryTime * @property {google.cloud.alloydb.v1alpha.Backup.IQuantityBasedExpiry|null} [expiryQuantity] Backup expiryQuantity * @property {boolean|null} [satisfiesPzs] Backup satisfiesPzs + * @property {google.cloud.alloydb.v1alpha.DatabaseVersion|null} [databaseVersion] Backup databaseVersion */ /** @@ -29701,6 +30786,14 @@ */ Backup.prototype.satisfiesPzs = false; + /** + * Backup databaseVersion. + * @member {google.cloud.alloydb.v1alpha.DatabaseVersion} databaseVersion + * @memberof google.cloud.alloydb.v1alpha.Backup + * @instance + */ + Backup.prototype.databaseVersion = 0; + /** * Creates a new Backup instance using the specified properties. * @function create @@ -29769,6 +30862,8 @@ $root.google.cloud.alloydb.v1alpha.Backup.QuantityBasedExpiry.encode(message.expiryQuantity, writer.uint32(/* id 20, wireType 2 =*/162).fork()).ldelim(); if (message.satisfiesPzs != null && Object.hasOwnProperty.call(message, "satisfiesPzs")) writer.uint32(/* id 21, wireType 0 =*/168).bool(message.satisfiesPzs); + if (message.databaseVersion != null && Object.hasOwnProperty.call(message, "databaseVersion")) + writer.uint32(/* id 22, wireType 0 =*/176).int32(message.databaseVersion); return writer; }; @@ -29925,6 +31020,10 @@ message.satisfiesPzs = reader.bool(); break; } + case 22: { + message.databaseVersion = reader.int32(); + break; + } default: reader.skipType(tag & 7); break; @@ -30062,6 +31161,16 @@ if (message.satisfiesPzs != null && message.hasOwnProperty("satisfiesPzs")) if (typeof message.satisfiesPzs !== "boolean") return "satisfiesPzs: boolean expected"; + if (message.databaseVersion != null && message.hasOwnProperty("databaseVersion")) + switch (message.databaseVersion) { + default: + return "databaseVersion: enum value expected"; + case 0: + case 1: + case 2: + case 3: + break; + } return null; }; @@ -30205,6 +31314,30 @@ } if (object.satisfiesPzs != null) message.satisfiesPzs = Boolean(object.satisfiesPzs); + switch (object.databaseVersion) { + default: + if (typeof object.databaseVersion === "number") { + message.databaseVersion = object.databaseVersion; + break; + } + break; + case "DATABASE_VERSION_UNSPECIFIED": + case 0: + message.databaseVersion = 0; + break; + case "POSTGRES_13": + case 1: + message.databaseVersion = 1; + break; + case "POSTGRES_14": + case 2: + message.databaseVersion = 2; + break; + case "POSTGRES_15": + case 3: + message.databaseVersion = 3; + break; + } return message; }; @@ -30249,6 +31382,7 @@ object.expiryTime = null; object.expiryQuantity = null; object.satisfiesPzs = false; + object.databaseVersion = options.enums === String ? "DATABASE_VERSION_UNSPECIFIED" : 0; } if (message.name != null && message.hasOwnProperty("name")) object.name = message.name; @@ -30302,6 +31436,8 @@ object.expiryQuantity = $root.google.cloud.alloydb.v1alpha.Backup.QuantityBasedExpiry.toObject(message.expiryQuantity, options); if (message.satisfiesPzs != null && message.hasOwnProperty("satisfiesPzs")) object.satisfiesPzs = message.satisfiesPzs; + if (message.databaseVersion != null && message.hasOwnProperty("databaseVersion")) + object.databaseVersion = options.enums === String ? $root.google.cloud.alloydb.v1alpha.DatabaseVersion[message.databaseVersion] === undefined ? message.databaseVersion : $root.google.cloud.alloydb.v1alpha.DatabaseVersion[message.databaseVersion] : message.databaseVersion; return object; }; @@ -30910,6 +32046,7 @@ case 0: case 1: case 2: + case 3: break; } } @@ -30998,6 +32135,10 @@ case 2: message.supportedDbVersions[i] = 2; break; + case "POSTGRES_15": + case 3: + message.supportedDbVersions[i] = 3; + break; } } if (object.requiresDbRestart != null) @@ -44907,12 +46048,14 @@ * @property {number} DATABASE_VERSION_UNSPECIFIED=0 DATABASE_VERSION_UNSPECIFIED value * @property {number} POSTGRES_13=1 POSTGRES_13 value * @property {number} POSTGRES_14=2 POSTGRES_14 value + * @property {number} POSTGRES_15=3 POSTGRES_15 value */ v1beta.DatabaseVersion = (function() { var valuesById = {}, values = Object.create(valuesById); values[valuesById[0] = "DATABASE_VERSION_UNSPECIFIED"] = 0; values[valuesById[1] = "POSTGRES_13"] = 1; values[valuesById[2] = "POSTGRES_14"] = 2; + values[valuesById[3] = "POSTGRES_15"] = 3; return values; })(); @@ -49189,6 +50332,7 @@ case 0: case 1: case 2: + case 3: break; } if (message.networkConfig != null && message.hasOwnProperty("networkConfig")) { @@ -49398,6 +50542,10 @@ case 2: message.databaseVersion = 2; break; + case "POSTGRES_15": + case 3: + message.databaseVersion = 3; + break; } if (object.networkConfig != null) { if (typeof object.networkConfig !== "object") @@ -50326,6 +51474,7 @@ * @property {string|null} [etag] Instance etag * @property {Object.|null} [annotations] Instance annotations * @property {google.cloud.alloydb.v1beta.Instance.IUpdatePolicy|null} [updatePolicy] Instance updatePolicy + * @property {google.cloud.alloydb.v1beta.Instance.IClientConnectionConfig|null} [clientConnectionConfig] Instance clientConnectionConfig */ /** @@ -50523,6 +51672,14 @@ */ Instance.prototype.updatePolicy = null; + /** + * Instance clientConnectionConfig. + * @member {google.cloud.alloydb.v1beta.Instance.IClientConnectionConfig|null|undefined} clientConnectionConfig + * @memberof google.cloud.alloydb.v1beta.Instance + * @instance + */ + Instance.prototype.clientConnectionConfig = null; + /** * Creates a new Instance instance using the specified properties. * @function create @@ -50595,6 +51752,8 @@ $root.google.cloud.alloydb.v1beta.Instance.QueryInsightsInstanceConfig.encode(message.queryInsightsConfig, writer.uint32(/* id 21, wireType 2 =*/170).fork()).ldelim(); if (message.updatePolicy != null && Object.hasOwnProperty.call(message, "updatePolicy")) $root.google.cloud.alloydb.v1beta.Instance.UpdatePolicy.encode(message.updatePolicy, writer.uint32(/* id 22, wireType 2 =*/178).fork()).ldelim(); + if (message.clientConnectionConfig != null && Object.hasOwnProperty.call(message, "clientConnectionConfig")) + $root.google.cloud.alloydb.v1beta.Instance.ClientConnectionConfig.encode(message.clientConnectionConfig, writer.uint32(/* id 23, wireType 2 =*/186).fork()).ldelim(); return writer; }; @@ -50776,6 +51935,10 @@ message.updatePolicy = $root.google.cloud.alloydb.v1beta.Instance.UpdatePolicy.decode(reader, reader.uint32()); break; } + case 23: { + message.clientConnectionConfig = $root.google.cloud.alloydb.v1beta.Instance.ClientConnectionConfig.decode(reader, reader.uint32()); + break; + } default: reader.skipType(tag & 7); break; @@ -50939,6 +52102,11 @@ if (error) return "updatePolicy." + error; } + if (message.clientConnectionConfig != null && message.hasOwnProperty("clientConnectionConfig")) { + var error = $root.google.cloud.alloydb.v1beta.Instance.ClientConnectionConfig.verify(message.clientConnectionConfig); + if (error) + return "clientConnectionConfig." + error; + } return null; }; @@ -51127,6 +52295,11 @@ throw TypeError(".google.cloud.alloydb.v1beta.Instance.updatePolicy: object expected"); message.updatePolicy = $root.google.cloud.alloydb.v1beta.Instance.UpdatePolicy.fromObject(object.updatePolicy); } + if (object.clientConnectionConfig != null) { + if (typeof object.clientConnectionConfig !== "object") + throw TypeError(".google.cloud.alloydb.v1beta.Instance.clientConnectionConfig: object expected"); + message.clientConnectionConfig = $root.google.cloud.alloydb.v1beta.Instance.ClientConnectionConfig.fromObject(object.clientConnectionConfig); + } return message; }; @@ -51169,6 +52342,7 @@ object.writableNode = null; object.queryInsightsConfig = null; object.updatePolicy = null; + object.clientConnectionConfig = null; } if (message.name != null && message.hasOwnProperty("name")) object.name = message.name; @@ -51227,6 +52401,8 @@ object.queryInsightsConfig = $root.google.cloud.alloydb.v1beta.Instance.QueryInsightsInstanceConfig.toObject(message.queryInsightsConfig, options); if (message.updatePolicy != null && message.hasOwnProperty("updatePolicy")) object.updatePolicy = $root.google.cloud.alloydb.v1beta.Instance.UpdatePolicy.toObject(message.updatePolicy, options); + if (message.clientConnectionConfig != null && message.hasOwnProperty("clientConnectionConfig")) + object.clientConnectionConfig = $root.google.cloud.alloydb.v1beta.Instance.ClientConnectionConfig.toObject(message.clientConnectionConfig, options); return object; }; @@ -52499,6 +53675,238 @@ return UpdatePolicy; })(); + Instance.ClientConnectionConfig = (function() { + + /** + * Properties of a ClientConnectionConfig. + * @memberof google.cloud.alloydb.v1beta.Instance + * @interface IClientConnectionConfig + * @property {boolean|null} [requireConnectors] ClientConnectionConfig requireConnectors + * @property {google.cloud.alloydb.v1beta.ISslConfig|null} [sslConfig] ClientConnectionConfig sslConfig + */ + + /** + * Constructs a new ClientConnectionConfig. + * @memberof google.cloud.alloydb.v1beta.Instance + * @classdesc Represents a ClientConnectionConfig. + * @implements IClientConnectionConfig + * @constructor + * @param {google.cloud.alloydb.v1beta.Instance.IClientConnectionConfig=} [properties] Properties to set + */ + function ClientConnectionConfig(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ClientConnectionConfig requireConnectors. + * @member {boolean} requireConnectors + * @memberof google.cloud.alloydb.v1beta.Instance.ClientConnectionConfig + * @instance + */ + ClientConnectionConfig.prototype.requireConnectors = false; + + /** + * ClientConnectionConfig sslConfig. + * @member {google.cloud.alloydb.v1beta.ISslConfig|null|undefined} sslConfig + * @memberof google.cloud.alloydb.v1beta.Instance.ClientConnectionConfig + * @instance + */ + ClientConnectionConfig.prototype.sslConfig = null; + + /** + * Creates a new ClientConnectionConfig instance using the specified properties. + * @function create + * @memberof google.cloud.alloydb.v1beta.Instance.ClientConnectionConfig + * @static + * @param {google.cloud.alloydb.v1beta.Instance.IClientConnectionConfig=} [properties] Properties to set + * @returns {google.cloud.alloydb.v1beta.Instance.ClientConnectionConfig} ClientConnectionConfig instance + */ + ClientConnectionConfig.create = function create(properties) { + return new ClientConnectionConfig(properties); + }; + + /** + * Encodes the specified ClientConnectionConfig message. Does not implicitly {@link google.cloud.alloydb.v1beta.Instance.ClientConnectionConfig.verify|verify} messages. + * @function encode + * @memberof google.cloud.alloydb.v1beta.Instance.ClientConnectionConfig + * @static + * @param {google.cloud.alloydb.v1beta.Instance.IClientConnectionConfig} message ClientConnectionConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ClientConnectionConfig.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.requireConnectors != null && Object.hasOwnProperty.call(message, "requireConnectors")) + writer.uint32(/* id 1, wireType 0 =*/8).bool(message.requireConnectors); + if (message.sslConfig != null && Object.hasOwnProperty.call(message, "sslConfig")) + $root.google.cloud.alloydb.v1beta.SslConfig.encode(message.sslConfig, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified ClientConnectionConfig message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1beta.Instance.ClientConnectionConfig.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.alloydb.v1beta.Instance.ClientConnectionConfig + * @static + * @param {google.cloud.alloydb.v1beta.Instance.IClientConnectionConfig} message ClientConnectionConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ClientConnectionConfig.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ClientConnectionConfig message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.alloydb.v1beta.Instance.ClientConnectionConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.alloydb.v1beta.Instance.ClientConnectionConfig} ClientConnectionConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ClientConnectionConfig.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1beta.Instance.ClientConnectionConfig(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.requireConnectors = reader.bool(); + break; + } + case 2: { + message.sslConfig = $root.google.cloud.alloydb.v1beta.SslConfig.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ClientConnectionConfig message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.alloydb.v1beta.Instance.ClientConnectionConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.alloydb.v1beta.Instance.ClientConnectionConfig} ClientConnectionConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ClientConnectionConfig.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ClientConnectionConfig message. + * @function verify + * @memberof google.cloud.alloydb.v1beta.Instance.ClientConnectionConfig + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ClientConnectionConfig.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.requireConnectors != null && message.hasOwnProperty("requireConnectors")) + if (typeof message.requireConnectors !== "boolean") + return "requireConnectors: boolean expected"; + if (message.sslConfig != null && message.hasOwnProperty("sslConfig")) { + var error = $root.google.cloud.alloydb.v1beta.SslConfig.verify(message.sslConfig); + if (error) + return "sslConfig." + error; + } + return null; + }; + + /** + * Creates a ClientConnectionConfig message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.alloydb.v1beta.Instance.ClientConnectionConfig + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.alloydb.v1beta.Instance.ClientConnectionConfig} ClientConnectionConfig + */ + ClientConnectionConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.alloydb.v1beta.Instance.ClientConnectionConfig) + return object; + var message = new $root.google.cloud.alloydb.v1beta.Instance.ClientConnectionConfig(); + if (object.requireConnectors != null) + message.requireConnectors = Boolean(object.requireConnectors); + if (object.sslConfig != null) { + if (typeof object.sslConfig !== "object") + throw TypeError(".google.cloud.alloydb.v1beta.Instance.ClientConnectionConfig.sslConfig: object expected"); + message.sslConfig = $root.google.cloud.alloydb.v1beta.SslConfig.fromObject(object.sslConfig); + } + return message; + }; + + /** + * Creates a plain object from a ClientConnectionConfig message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.alloydb.v1beta.Instance.ClientConnectionConfig + * @static + * @param {google.cloud.alloydb.v1beta.Instance.ClientConnectionConfig} message ClientConnectionConfig + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ClientConnectionConfig.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.requireConnectors = false; + object.sslConfig = null; + } + if (message.requireConnectors != null && message.hasOwnProperty("requireConnectors")) + object.requireConnectors = message.requireConnectors; + if (message.sslConfig != null && message.hasOwnProperty("sslConfig")) + object.sslConfig = $root.google.cloud.alloydb.v1beta.SslConfig.toObject(message.sslConfig, options); + return object; + }; + + /** + * Converts this ClientConnectionConfig to JSON. + * @function toJSON + * @memberof google.cloud.alloydb.v1beta.Instance.ClientConnectionConfig + * @instance + * @returns {Object.} JSON object + */ + ClientConnectionConfig.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ClientConnectionConfig + * @function getTypeUrl + * @memberof google.cloud.alloydb.v1beta.Instance.ClientConnectionConfig + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ClientConnectionConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.alloydb.v1beta.Instance.ClientConnectionConfig"; + }; + + return ClientConnectionConfig; + })(); + /** * State enum. * @name google.cloud.alloydb.v1beta.Instance.State @@ -52879,6 +54287,8 @@ * @property {Object.|null} [annotations] Backup annotations * @property {number|Long|null} [sizeBytes] Backup sizeBytes * @property {google.protobuf.ITimestamp|null} [expiryTime] Backup expiryTime + * @property {google.cloud.alloydb.v1beta.Backup.IQuantityBasedExpiry|null} [expiryQuantity] Backup expiryQuantity + * @property {google.cloud.alloydb.v1beta.DatabaseVersion|null} [databaseVersion] Backup databaseVersion */ /** @@ -53050,6 +54460,22 @@ */ Backup.prototype.expiryTime = null; + /** + * Backup expiryQuantity. + * @member {google.cloud.alloydb.v1beta.Backup.IQuantityBasedExpiry|null|undefined} expiryQuantity + * @memberof google.cloud.alloydb.v1beta.Backup + * @instance + */ + Backup.prototype.expiryQuantity = null; + + /** + * Backup databaseVersion. + * @member {google.cloud.alloydb.v1beta.DatabaseVersion} databaseVersion + * @memberof google.cloud.alloydb.v1beta.Backup + * @instance + */ + Backup.prototype.databaseVersion = 0; + /** * Creates a new Backup instance using the specified properties. * @function create @@ -53114,6 +54540,10 @@ writer.uint32(/* id 18, wireType 2 =*/146).string(message.clusterUid); if (message.expiryTime != null && Object.hasOwnProperty.call(message, "expiryTime")) $root.google.protobuf.Timestamp.encode(message.expiryTime, writer.uint32(/* id 19, wireType 2 =*/154).fork()).ldelim(); + if (message.expiryQuantity != null && Object.hasOwnProperty.call(message, "expiryQuantity")) + $root.google.cloud.alloydb.v1beta.Backup.QuantityBasedExpiry.encode(message.expiryQuantity, writer.uint32(/* id 20, wireType 2 =*/162).fork()).ldelim(); + if (message.databaseVersion != null && Object.hasOwnProperty.call(message, "databaseVersion")) + writer.uint32(/* id 22, wireType 0 =*/176).int32(message.databaseVersion); return writer; }; @@ -53262,6 +54692,14 @@ message.expiryTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); break; } + case 20: { + message.expiryQuantity = $root.google.cloud.alloydb.v1beta.Backup.QuantityBasedExpiry.decode(reader, reader.uint32()); + break; + } + case 22: { + message.databaseVersion = reader.int32(); + break; + } default: reader.skipType(tag & 7); break; @@ -53391,6 +54829,21 @@ if (error) return "expiryTime." + error; } + if (message.expiryQuantity != null && message.hasOwnProperty("expiryQuantity")) { + var error = $root.google.cloud.alloydb.v1beta.Backup.QuantityBasedExpiry.verify(message.expiryQuantity); + if (error) + return "expiryQuantity." + error; + } + if (message.databaseVersion != null && message.hasOwnProperty("databaseVersion")) + switch (message.databaseVersion) { + default: + return "databaseVersion: enum value expected"; + case 0: + case 1: + case 2: + case 3: + break; + } return null; }; @@ -53527,6 +54980,35 @@ throw TypeError(".google.cloud.alloydb.v1beta.Backup.expiryTime: object expected"); message.expiryTime = $root.google.protobuf.Timestamp.fromObject(object.expiryTime); } + if (object.expiryQuantity != null) { + if (typeof object.expiryQuantity !== "object") + throw TypeError(".google.cloud.alloydb.v1beta.Backup.expiryQuantity: object expected"); + message.expiryQuantity = $root.google.cloud.alloydb.v1beta.Backup.QuantityBasedExpiry.fromObject(object.expiryQuantity); + } + switch (object.databaseVersion) { + default: + if (typeof object.databaseVersion === "number") { + message.databaseVersion = object.databaseVersion; + break; + } + break; + case "DATABASE_VERSION_UNSPECIFIED": + case 0: + message.databaseVersion = 0; + break; + case "POSTGRES_13": + case 1: + message.databaseVersion = 1; + break; + case "POSTGRES_14": + case 2: + message.databaseVersion = 2; + break; + case "POSTGRES_15": + case 3: + message.databaseVersion = 3; + break; + } return message; }; @@ -53569,6 +55051,8 @@ object.sizeBytes = options.longs === String ? "0" : 0; object.clusterUid = ""; object.expiryTime = null; + object.expiryQuantity = null; + object.databaseVersion = options.enums === String ? "DATABASE_VERSION_UNSPECIFIED" : 0; } if (message.name != null && message.hasOwnProperty("name")) object.name = message.name; @@ -53618,6 +55102,10 @@ object.clusterUid = message.clusterUid; if (message.expiryTime != null && message.hasOwnProperty("expiryTime")) object.expiryTime = $root.google.protobuf.Timestamp.toObject(message.expiryTime, options); + if (message.expiryQuantity != null && message.hasOwnProperty("expiryQuantity")) + object.expiryQuantity = $root.google.cloud.alloydb.v1beta.Backup.QuantityBasedExpiry.toObject(message.expiryQuantity, options); + if (message.databaseVersion != null && message.hasOwnProperty("databaseVersion")) + object.databaseVersion = options.enums === String ? $root.google.cloud.alloydb.v1beta.DatabaseVersion[message.databaseVersion] === undefined ? message.databaseVersion : $root.google.cloud.alloydb.v1beta.DatabaseVersion[message.databaseVersion] : message.databaseVersion; return object; }; @@ -53647,6 +55135,233 @@ return typeUrlPrefix + "/google.cloud.alloydb.v1beta.Backup"; }; + Backup.QuantityBasedExpiry = (function() { + + /** + * Properties of a QuantityBasedExpiry. + * @memberof google.cloud.alloydb.v1beta.Backup + * @interface IQuantityBasedExpiry + * @property {number|null} [retentionCount] QuantityBasedExpiry retentionCount + * @property {number|null} [totalRetentionCount] QuantityBasedExpiry totalRetentionCount + */ + + /** + * Constructs a new QuantityBasedExpiry. + * @memberof google.cloud.alloydb.v1beta.Backup + * @classdesc Represents a QuantityBasedExpiry. + * @implements IQuantityBasedExpiry + * @constructor + * @param {google.cloud.alloydb.v1beta.Backup.IQuantityBasedExpiry=} [properties] Properties to set + */ + function QuantityBasedExpiry(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * QuantityBasedExpiry retentionCount. + * @member {number} retentionCount + * @memberof google.cloud.alloydb.v1beta.Backup.QuantityBasedExpiry + * @instance + */ + QuantityBasedExpiry.prototype.retentionCount = 0; + + /** + * QuantityBasedExpiry totalRetentionCount. + * @member {number} totalRetentionCount + * @memberof google.cloud.alloydb.v1beta.Backup.QuantityBasedExpiry + * @instance + */ + QuantityBasedExpiry.prototype.totalRetentionCount = 0; + + /** + * Creates a new QuantityBasedExpiry instance using the specified properties. + * @function create + * @memberof google.cloud.alloydb.v1beta.Backup.QuantityBasedExpiry + * @static + * @param {google.cloud.alloydb.v1beta.Backup.IQuantityBasedExpiry=} [properties] Properties to set + * @returns {google.cloud.alloydb.v1beta.Backup.QuantityBasedExpiry} QuantityBasedExpiry instance + */ + QuantityBasedExpiry.create = function create(properties) { + return new QuantityBasedExpiry(properties); + }; + + /** + * Encodes the specified QuantityBasedExpiry message. Does not implicitly {@link google.cloud.alloydb.v1beta.Backup.QuantityBasedExpiry.verify|verify} messages. + * @function encode + * @memberof google.cloud.alloydb.v1beta.Backup.QuantityBasedExpiry + * @static + * @param {google.cloud.alloydb.v1beta.Backup.IQuantityBasedExpiry} message QuantityBasedExpiry message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + QuantityBasedExpiry.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.retentionCount != null && Object.hasOwnProperty.call(message, "retentionCount")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.retentionCount); + if (message.totalRetentionCount != null && Object.hasOwnProperty.call(message, "totalRetentionCount")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.totalRetentionCount); + return writer; + }; + + /** + * Encodes the specified QuantityBasedExpiry message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1beta.Backup.QuantityBasedExpiry.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.alloydb.v1beta.Backup.QuantityBasedExpiry + * @static + * @param {google.cloud.alloydb.v1beta.Backup.IQuantityBasedExpiry} message QuantityBasedExpiry message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + QuantityBasedExpiry.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a QuantityBasedExpiry message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.alloydb.v1beta.Backup.QuantityBasedExpiry + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.alloydb.v1beta.Backup.QuantityBasedExpiry} QuantityBasedExpiry + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + QuantityBasedExpiry.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.alloydb.v1beta.Backup.QuantityBasedExpiry(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.retentionCount = reader.int32(); + break; + } + case 2: { + message.totalRetentionCount = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a QuantityBasedExpiry message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.alloydb.v1beta.Backup.QuantityBasedExpiry + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.alloydb.v1beta.Backup.QuantityBasedExpiry} QuantityBasedExpiry + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + QuantityBasedExpiry.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a QuantityBasedExpiry message. + * @function verify + * @memberof google.cloud.alloydb.v1beta.Backup.QuantityBasedExpiry + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + QuantityBasedExpiry.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.retentionCount != null && message.hasOwnProperty("retentionCount")) + if (!$util.isInteger(message.retentionCount)) + return "retentionCount: integer expected"; + if (message.totalRetentionCount != null && message.hasOwnProperty("totalRetentionCount")) + if (!$util.isInteger(message.totalRetentionCount)) + return "totalRetentionCount: integer expected"; + return null; + }; + + /** + * Creates a QuantityBasedExpiry message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.alloydb.v1beta.Backup.QuantityBasedExpiry + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.alloydb.v1beta.Backup.QuantityBasedExpiry} QuantityBasedExpiry + */ + QuantityBasedExpiry.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.alloydb.v1beta.Backup.QuantityBasedExpiry) + return object; + var message = new $root.google.cloud.alloydb.v1beta.Backup.QuantityBasedExpiry(); + if (object.retentionCount != null) + message.retentionCount = object.retentionCount | 0; + if (object.totalRetentionCount != null) + message.totalRetentionCount = object.totalRetentionCount | 0; + return message; + }; + + /** + * Creates a plain object from a QuantityBasedExpiry message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.alloydb.v1beta.Backup.QuantityBasedExpiry + * @static + * @param {google.cloud.alloydb.v1beta.Backup.QuantityBasedExpiry} message QuantityBasedExpiry + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + QuantityBasedExpiry.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.retentionCount = 0; + object.totalRetentionCount = 0; + } + if (message.retentionCount != null && message.hasOwnProperty("retentionCount")) + object.retentionCount = message.retentionCount; + if (message.totalRetentionCount != null && message.hasOwnProperty("totalRetentionCount")) + object.totalRetentionCount = message.totalRetentionCount; + return object; + }; + + /** + * Converts this QuantityBasedExpiry to JSON. + * @function toJSON + * @memberof google.cloud.alloydb.v1beta.Backup.QuantityBasedExpiry + * @instance + * @returns {Object.} JSON object + */ + QuantityBasedExpiry.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for QuantityBasedExpiry + * @function getTypeUrl + * @memberof google.cloud.alloydb.v1beta.Backup.QuantityBasedExpiry + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + QuantityBasedExpiry.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.alloydb.v1beta.Backup.QuantityBasedExpiry"; + }; + + return QuantityBasedExpiry; + })(); + /** * State enum. * @name google.cloud.alloydb.v1beta.Backup.State @@ -53999,6 +55714,7 @@ case 0: case 1: case 2: + case 3: break; } } @@ -54087,6 +55803,10 @@ case 2: message.supportedDbVersions[i] = 2; break; + case "POSTGRES_15": + case 3: + message.supportedDbVersions[i] = 3; + break; } } if (object.requiresDbRestart != null) @@ -65094,6 +66814,7 @@ * @property {string|null} [pemCsr] GenerateClientCertificateRequest pemCsr * @property {google.protobuf.IDuration|null} [certDuration] GenerateClientCertificateRequest certDuration * @property {string|null} [publicKey] GenerateClientCertificateRequest publicKey + * @property {boolean|null} [useMetadataExchange] GenerateClientCertificateRequest useMetadataExchange */ /** @@ -65151,6 +66872,14 @@ */ GenerateClientCertificateRequest.prototype.publicKey = ""; + /** + * GenerateClientCertificateRequest useMetadataExchange. + * @member {boolean} useMetadataExchange + * @memberof google.cloud.alloydb.v1beta.GenerateClientCertificateRequest + * @instance + */ + GenerateClientCertificateRequest.prototype.useMetadataExchange = false; + /** * Creates a new GenerateClientCertificateRequest instance using the specified properties. * @function create @@ -65185,6 +66914,8 @@ $root.google.protobuf.Duration.encode(message.certDuration, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); if (message.publicKey != null && Object.hasOwnProperty.call(message, "publicKey")) writer.uint32(/* id 5, wireType 2 =*/42).string(message.publicKey); + if (message.useMetadataExchange != null && Object.hasOwnProperty.call(message, "useMetadataExchange")) + writer.uint32(/* id 6, wireType 0 =*/48).bool(message.useMetadataExchange); return writer; }; @@ -65239,6 +66970,10 @@ message.publicKey = reader.string(); break; } + case 6: { + message.useMetadataExchange = reader.bool(); + break; + } default: reader.skipType(tag & 7); break; @@ -65291,6 +67026,9 @@ if (message.publicKey != null && message.hasOwnProperty("publicKey")) if (!$util.isString(message.publicKey)) return "publicKey: string expected"; + if (message.useMetadataExchange != null && message.hasOwnProperty("useMetadataExchange")) + if (typeof message.useMetadataExchange !== "boolean") + return "useMetadataExchange: boolean expected"; return null; }; @@ -65319,6 +67057,8 @@ } if (object.publicKey != null) message.publicKey = String(object.publicKey); + if (object.useMetadataExchange != null) + message.useMetadataExchange = Boolean(object.useMetadataExchange); return message; }; @@ -65341,6 +67081,7 @@ object.pemCsr = ""; object.certDuration = null; object.publicKey = ""; + object.useMetadataExchange = false; } if (message.parent != null && message.hasOwnProperty("parent")) object.parent = message.parent; @@ -65352,6 +67093,8 @@ object.certDuration = $root.google.protobuf.Duration.toObject(message.certDuration, options); if (message.publicKey != null && message.hasOwnProperty("publicKey")) object.publicKey = message.publicKey; + if (message.useMetadataExchange != null && message.hasOwnProperty("useMetadataExchange")) + object.useMetadataExchange = message.useMetadataExchange; return object; }; diff --git a/packages/google-cloud-alloydb/protos/protos.json b/packages/google-cloud-alloydb/protos/protos.json index 20083797b65..1ed7c3b253d 100644 --- a/packages/google-cloud-alloydb/protos/protos.json +++ b/packages/google-cloud-alloydb/protos/protos.json @@ -454,13 +454,21 @@ "type": "DatabaseVersion", "id": 9, "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "networkConfig": { + "type": "NetworkConfig", + "id": 29, + "options": { + "(google.api.field_behavior)": "OPTIONAL" } }, "network": { "type": "string", "id": 10, "options": { + "deprecated": true, "(google.api.field_behavior)": "REQUIRED", "(google.api.resource_reference).type": "compute.googleapis.com/Network" } @@ -540,6 +548,25 @@ } }, "nested": { + "NetworkConfig": { + "fields": { + "network": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "compute.googleapis.com/Network" + } + }, + "allocatedIpRange": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, "SecondaryConfig": { "fields": { "primaryClusterName": { @@ -710,6 +737,13 @@ "keyType": "string", "type": "string", "id": 18 + }, + "clientConnectionConfig": { + "type": "ClientConnectionConfig", + "id": 23, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } } }, "nested": { @@ -795,6 +829,24 @@ } } }, + "ClientConnectionConfig": { + "fields": { + "requireConnectors": { + "type": "bool", + "id": 1, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "sslConfig": { + "type": "SslConfig", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, "State": { "values": { "STATE_UNSPECIFIED": 0, @@ -949,9 +1001,41 @@ "options": { "(google.api.field_behavior)": "OUTPUT_ONLY" } + }, + "expiryQuantity": { + "type": "QuantityBasedExpiry", + "id": 20, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "databaseVersion": { + "type": "DatabaseVersion", + "id": 22, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } } }, "nested": { + "QuantityBasedExpiry": { + "fields": { + "retentionCount": { + "type": "int32", + "id": 1, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "totalRetentionCount": { + "type": "int32", + "id": 2, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + } + } + }, "State": { "values": { "STATE_UNSPECIFIED": 0, @@ -3004,7 +3088,8 @@ "values": { "DATABASE_VERSION_UNSPECIFIED": 0, "POSTGRES_13": 1, - "POSTGRES_14": 2 + "POSTGRES_14": 2, + "POSTGRES_15": 3 } }, "UserPassword": { @@ -3430,6 +3515,7 @@ "type": "string", "id": 10, "options": { + "deprecated": true, "(google.api.field_behavior)": "REQUIRED", "(google.api.resource_reference).type": "compute.googleapis.com/Network" } @@ -3707,6 +3793,13 @@ "type": "UpdatePolicy", "id": 22 }, + "clientConnectionConfig": { + "type": "ClientConnectionConfig", + "id": 23, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, "satisfiesPzs": { "type": "bool", "id": 24 @@ -3812,6 +3905,24 @@ } } }, + "ClientConnectionConfig": { + "fields": { + "requireConnectors": { + "type": "bool", + "id": 1, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "sslConfig": { + "type": "SslConfig", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, "State": { "values": { "STATE_UNSPECIFIED": 0, @@ -4012,6 +4123,13 @@ "satisfiesPzs": { "type": "bool", "id": 21 + }, + "databaseVersion": { + "type": "DatabaseVersion", + "id": 22, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } } }, "nested": { @@ -6216,7 +6334,8 @@ "values": { "DATABASE_VERSION_UNSPECIFIED": 0, "POSTGRES_13": 1, - "POSTGRES_14": 2 + "POSTGRES_14": 2, + "POSTGRES_15": 3 } }, "UserPassword": { @@ -6628,7 +6747,7 @@ "type": "DatabaseVersion", "id": 9, "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" + "(google.api.field_behavior)": "OPTIONAL" } }, "networkConfig": { @@ -6642,6 +6761,7 @@ "type": "string", "id": 10, "options": { + "deprecated": true, "(google.api.field_behavior)": "REQUIRED", "(google.api.resource_reference).type": "compute.googleapis.com/Network" } @@ -6914,6 +7034,13 @@ "updatePolicy": { "type": "UpdatePolicy", "id": 22 + }, + "clientConnectionConfig": { + "type": "ClientConnectionConfig", + "id": 23, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } } }, "nested": { @@ -7016,6 +7143,24 @@ } } }, + "ClientConnectionConfig": { + "fields": { + "requireConnectors": { + "type": "bool", + "id": 1, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "sslConfig": { + "type": "SslConfig", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, "State": { "values": { "STATE_UNSPECIFIED": 0, @@ -7205,9 +7350,41 @@ "options": { "(google.api.field_behavior)": "OUTPUT_ONLY" } + }, + "expiryQuantity": { + "type": "QuantityBasedExpiry", + "id": 20, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "databaseVersion": { + "type": "DatabaseVersion", + "id": 22, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } } }, "nested": { + "QuantityBasedExpiry": { + "fields": { + "retentionCount": { + "type": "int32", + "id": 1, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "totalRetentionCount": { + "type": "int32", + "id": 2, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + } + } + }, "State": { "values": { "STATE_UNSPECIFIED": 0, @@ -9056,6 +9233,13 @@ "options": { "(google.api.field_behavior)": "OPTIONAL" } + }, + "useMetadataExchange": { + "type": "bool", + "id": 6, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } } } }, diff --git a/packages/google-cloud-alloydb/samples/generated/v1/snippet_metadata.google.cloud.alloydb.v1.json b/packages/google-cloud-alloydb/samples/generated/v1/snippet_metadata.google.cloud.alloydb.v1.json index ac0cc6de048..880f2ae9f79 100644 --- a/packages/google-cloud-alloydb/samples/generated/v1/snippet_metadata.google.cloud.alloydb.v1.json +++ b/packages/google-cloud-alloydb/samples/generated/v1/snippet_metadata.google.cloud.alloydb.v1.json @@ -1,7 +1,7 @@ { "clientLibrary": { "name": "nodejs-alloydb", - "version": "1.0.1", + "version": "1.2.0", "language": "TYPESCRIPT", "apis": [ { diff --git a/packages/google-cloud-alloydb/samples/generated/v1/snippet_metadata_google.cloud.alloydb.v1.json b/packages/google-cloud-alloydb/samples/generated/v1/snippet_metadata_google.cloud.alloydb.v1.json index ac0cc6de048..880f2ae9f79 100644 --- a/packages/google-cloud-alloydb/samples/generated/v1/snippet_metadata_google.cloud.alloydb.v1.json +++ b/packages/google-cloud-alloydb/samples/generated/v1/snippet_metadata_google.cloud.alloydb.v1.json @@ -1,7 +1,7 @@ { "clientLibrary": { "name": "nodejs-alloydb", - "version": "1.0.1", + "version": "1.2.0", "language": "TYPESCRIPT", "apis": [ { diff --git a/packages/google-cloud-alloydb/samples/generated/v1alpha/snippet_metadata.google.cloud.alloydb.v1alpha.json b/packages/google-cloud-alloydb/samples/generated/v1alpha/snippet_metadata.google.cloud.alloydb.v1alpha.json index 9df07b4eb59..7f8e2c49193 100644 --- a/packages/google-cloud-alloydb/samples/generated/v1alpha/snippet_metadata.google.cloud.alloydb.v1alpha.json +++ b/packages/google-cloud-alloydb/samples/generated/v1alpha/snippet_metadata.google.cloud.alloydb.v1alpha.json @@ -1,7 +1,7 @@ { "clientLibrary": { "name": "nodejs-alloydb", - "version": "1.0.1", + "version": "1.2.0", "language": "TYPESCRIPT", "apis": [ { diff --git a/packages/google-cloud-alloydb/samples/generated/v1alpha/snippet_metadata_google.cloud.alloydb.v1alpha.json b/packages/google-cloud-alloydb/samples/generated/v1alpha/snippet_metadata_google.cloud.alloydb.v1alpha.json index 9df07b4eb59..7f8e2c49193 100644 --- a/packages/google-cloud-alloydb/samples/generated/v1alpha/snippet_metadata_google.cloud.alloydb.v1alpha.json +++ b/packages/google-cloud-alloydb/samples/generated/v1alpha/snippet_metadata_google.cloud.alloydb.v1alpha.json @@ -1,7 +1,7 @@ { "clientLibrary": { "name": "nodejs-alloydb", - "version": "1.0.1", + "version": "1.2.0", "language": "TYPESCRIPT", "apis": [ { diff --git a/packages/google-cloud-alloydb/samples/generated/v1beta/alloy_d_b_admin.generate_client_certificate.js b/packages/google-cloud-alloydb/samples/generated/v1beta/alloy_d_b_admin.generate_client_certificate.js index dc803703ca1..b93701df1aa 100644 --- a/packages/google-cloud-alloydb/samples/generated/v1beta/alloy_d_b_admin.generate_client_certificate.js +++ b/packages/google-cloud-alloydb/samples/generated/v1beta/alloy_d_b_admin.generate_client_certificate.js @@ -63,6 +63,12 @@ function main(parent) { * Optional. The public key from the client. */ // const publicKey = 'abc123' + /** + * Optional. An optional hint to the endpoint to generate a client + * ceritificate that can be used by AlloyDB connectors to exchange additional + * metadata with the server after TLS handshake. + */ + // const useMetadataExchange = true // Imports the Alloydb library const {AlloyDBAdminClient} = require('@google-cloud/alloydb').v1beta; diff --git a/packages/google-cloud-alloydb/samples/generated/v1beta/snippet_metadata.google.cloud.alloydb.v1beta.json b/packages/google-cloud-alloydb/samples/generated/v1beta/snippet_metadata.google.cloud.alloydb.v1beta.json index 219d20da9b5..7a25552617e 100644 --- a/packages/google-cloud-alloydb/samples/generated/v1beta/snippet_metadata.google.cloud.alloydb.v1beta.json +++ b/packages/google-cloud-alloydb/samples/generated/v1beta/snippet_metadata.google.cloud.alloydb.v1beta.json @@ -1,7 +1,7 @@ { "clientLibrary": { "name": "nodejs-alloydb", - "version": "1.0.1", + "version": "1.2.0", "language": "TYPESCRIPT", "apis": [ { diff --git a/packages/google-cloud-alloydb/samples/generated/v1beta/snippet_metadata_google.cloud.alloydb.v1beta.json b/packages/google-cloud-alloydb/samples/generated/v1beta/snippet_metadata_google.cloud.alloydb.v1beta.json index 219d20da9b5..ebaa21938ae 100644 --- a/packages/google-cloud-alloydb/samples/generated/v1beta/snippet_metadata_google.cloud.alloydb.v1beta.json +++ b/packages/google-cloud-alloydb/samples/generated/v1beta/snippet_metadata_google.cloud.alloydb.v1beta.json @@ -1,7 +1,7 @@ { "clientLibrary": { "name": "nodejs-alloydb", - "version": "1.0.1", + "version": "1.2.0", "language": "TYPESCRIPT", "apis": [ { @@ -1279,14 +1279,14 @@ "regionTag": "alloydb_v1beta_generated_AlloyDBAdmin_GenerateClientCertificate_async", "title": "AlloyDBAdmin generateClientCertificate Sample", "origin": "API_DEFINITION", - "description": " Generate a client certificate signed by a Cluster CA. The sole purpose of this endpoint is to support the Auth Proxy client and the endpoint's behavior is subject to change without notice, so do not rely on its behavior remaining constant. Future changes will not break the Auth Proxy client.", + "description": " Generate a client certificate signed by a Cluster CA. The sole purpose of this endpoint is to support AlloyDB connectors and the Auth Proxy client. The endpoint's behavior is subject to change without notice, so do not rely on its behavior remaining constant. Future changes will not break AlloyDB connectors or the Auth Proxy client.", "canonical": true, "file": "alloy_d_b_admin.generate_client_certificate.js", "language": "JAVASCRIPT", "segments": [ { "start": 25, - "end": 84, + "end": 90, "type": "FULL" } ], @@ -1314,6 +1314,10 @@ { "name": "public_key", "type": "TYPE_STRING" + }, + { + "name": "use_metadata_exchange", + "type": "TYPE_BOOL" } ], "resultType": ".google.cloud.alloydb.v1beta.GenerateClientCertificateResponse", diff --git a/packages/google-cloud-alloydb/samples/package.json b/packages/google-cloud-alloydb/samples/package.json index 592a2cfdb64..9153da13ed1 100644 --- a/packages/google-cloud-alloydb/samples/package.json +++ b/packages/google-cloud-alloydb/samples/package.json @@ -14,7 +14,7 @@ "publish": "echo 'sample test; do not publish'" }, "dependencies": { - "@google-cloud/alloydb": "^1.0.1" + "@google-cloud/alloydb": "^1.2.0" }, "devDependencies": { "c8": "^7.1.0", diff --git a/packages/google-cloud-alloydb/src/v1beta/alloy_d_b_admin_client.ts b/packages/google-cloud-alloydb/src/v1beta/alloy_d_b_admin_client.ts index a7eff7d6eda..bd7263ee96c 100644 --- a/packages/google-cloud-alloydb/src/v1beta/alloy_d_b_admin_client.ts +++ b/packages/google-cloud-alloydb/src/v1beta/alloy_d_b_admin_client.ts @@ -916,10 +916,10 @@ export class AlloyDBAdminClient { } /** * Generate a client certificate signed by a Cluster CA. - * The sole purpose of this endpoint is to support the Auth Proxy client and - * the endpoint's behavior is subject to change without notice, so do not rely - * on its behavior remaining constant. Future changes will not break the Auth - * Proxy client. + * The sole purpose of this endpoint is to support AlloyDB connectors and the + * Auth Proxy client. The endpoint's behavior is subject to change without + * notice, so do not rely on its behavior remaining constant. Future changes + * will not break AlloyDB connectors or the Auth Proxy client. * * @param {Object} request * The request object that will be sent. @@ -950,6 +950,10 @@ export class AlloyDBAdminClient { * default duration. * @param {string} [request.publicKey] * Optional. The public key from the client. + * @param {boolean} [request.useMetadataExchange] + * Optional. An optional hint to the endpoint to generate a client + * ceritificate that can be used by AlloyDB connectors to exchange additional + * metadata with the server after TLS handshake. * @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. diff --git a/packages/google-cloud-apigeeregistry/.OwlBot.yaml b/packages/google-cloud-apigeeregistry/.OwlBot.yaml new file mode 100644 index 00000000000..2fc15cc2a0b --- /dev/null +++ b/packages/google-cloud-apigeeregistry/.OwlBot.yaml @@ -0,0 +1,20 @@ +# 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 +# +# 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. + +deep-remove-regex: + - /owl-bot-staging + +deep-copy-regex: + - source: /google/cloud/apigeeregistry/(.*)/.*-nodejs + dest: /owl-bot-staging/google-cloud-apigeeregistry/$1 diff --git a/packages/google-cloud-apigeeregistry/.eslintignore b/packages/google-cloud-apigeeregistry/.eslintignore new file mode 100644 index 00000000000..ea5b04aebe6 --- /dev/null +++ b/packages/google-cloud-apigeeregistry/.eslintignore @@ -0,0 +1,7 @@ +**/node_modules +**/coverage +test/fixtures +build/ +docs/ +protos/ +samples/generated/ diff --git a/packages/google-cloud-apigeeregistry/.eslintrc.json b/packages/google-cloud-apigeeregistry/.eslintrc.json new file mode 100644 index 00000000000..78215349546 --- /dev/null +++ b/packages/google-cloud-apigeeregistry/.eslintrc.json @@ -0,0 +1,3 @@ +{ + "extends": "./node_modules/gts" +} diff --git a/packages/google-cloud-apigeeregistry/.gitattributes b/packages/google-cloud-apigeeregistry/.gitattributes new file mode 100644 index 00000000000..33739cb74e4 --- /dev/null +++ b/packages/google-cloud-apigeeregistry/.gitattributes @@ -0,0 +1,4 @@ +*.ts text eol=lf +*.js text eol=lf +protos/* linguist-generated +**/api-extractor.json linguist-language=JSON-with-Comments diff --git a/packages/google-cloud-apigeeregistry/.gitignore b/packages/google-cloud-apigeeregistry/.gitignore new file mode 100644 index 00000000000..d4f03a0df2e --- /dev/null +++ b/packages/google-cloud-apigeeregistry/.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/google-cloud-apigeeregistry/.jsdoc.js b/packages/google-cloud-apigeeregistry/.jsdoc.js new file mode 100644 index 00000000000..671ff23ae00 --- /dev/null +++ b/packages/google-cloud-apigeeregistry/.jsdoc.js @@ -0,0 +1,55 @@ +// Copyright 2023 Google LLC +// +// Licensed under the Apache License, Version 2.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 2023 Google LLC', + includeDate: false, + sourceFiles: false, + systemName: '@google-cloud/apigee-registry', + theme: 'lumen', + default: { + outputSourceFiles: false + } + }, + markdown: { + idInHeadings: true + } +}; diff --git a/packages/google-cloud-apigeeregistry/.mocharc.js b/packages/google-cloud-apigeeregistry/.mocharc.js new file mode 100644 index 00000000000..49e7e228701 --- /dev/null +++ b/packages/google-cloud-apigeeregistry/.mocharc.js @@ -0,0 +1,29 @@ +// Copyright 2023 Google LLC +// +// Licensed under the Apache License, Version 2.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. +const config = { + "enable-source-maps": true, + "throw-deprecation": true, + "timeout": 10000, + "recursive": true +} +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/google-cloud-apigeeregistry/.nycrc b/packages/google-cloud-apigeeregistry/.nycrc new file mode 100644 index 00000000000..b18d5472b62 --- /dev/null +++ b/packages/google-cloud-apigeeregistry/.nycrc @@ -0,0 +1,24 @@ +{ + "report-dir": "./.coverage", + "reporter": ["text", "lcov"], + "exclude": [ + "**/*-test", + "**/.coverage", + "**/apis", + "**/benchmark", + "**/conformance", + "**/docs", + "**/samples", + "**/scripts", + "**/protos", + "**/test", + "**/*.d.ts", + ".jsdoc.js", + "**/.jsdoc.js", + "karma.conf.js", + "webpack-tests.config.js", + "webpack.config.js" + ], + "exclude-after-remap": false, + "all": true +} diff --git a/packages/google-cloud-apigeeregistry/.prettierignore b/packages/google-cloud-apigeeregistry/.prettierignore new file mode 100644 index 00000000000..9340ad9b86d --- /dev/null +++ b/packages/google-cloud-apigeeregistry/.prettierignore @@ -0,0 +1,6 @@ +**/node_modules +**/coverage +test/fixtures +build/ +docs/ +protos/ diff --git a/packages/google-cloud-apigeeregistry/.prettierrc.js b/packages/google-cloud-apigeeregistry/.prettierrc.js new file mode 100644 index 00000000000..1e6cec783e4 --- /dev/null +++ b/packages/google-cloud-apigeeregistry/.prettierrc.js @@ -0,0 +1,17 @@ +// Copyright 2023 Google LLC +// +// Licensed under the Apache License, Version 2.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. + +module.exports = { + ...require('gts/.prettierrc.json') +} diff --git a/packages/google-cloud-apigeeregistry/.repo-metadata.json b/packages/google-cloud-apigeeregistry/.repo-metadata.json new file mode 100644 index 00000000000..71e1696543b --- /dev/null +++ b/packages/google-cloud-apigeeregistry/.repo-metadata.json @@ -0,0 +1,14 @@ +{ + "name": "apigeeregistry", + "name_pretty": "Apigee Registry API", + "product_documentation": "https://cloud.google.com/apigee/docs/api-hub/get-started-registry-api", + "client_documentation": "https://cloud.google.com/nodejs/docs/reference/apigee-registry/latest", + "issue_tracker": "https://github.com/googleapis/google-cloud-node/issues", + "release_level": "beta", + "language": "nodejs", + "repo": "googleapis/google-cloud-node", + "distribution_name": "@google-cloud/apigee-registry", + "api_id": "apigeeregistry.googleapis.com", + "default_version": "v1", + "requires_billing": true +} diff --git a/packages/google-cloud-apigeeregistry/CHANGELOG.md b/packages/google-cloud-apigeeregistry/CHANGELOG.md new file mode 100644 index 00000000000..7d6ef629a77 --- /dev/null +++ b/packages/google-cloud-apigeeregistry/CHANGELOG.md @@ -0,0 +1,63 @@ +# Changelog + +## [1.0.1](https://github.com/googleapis/nodejs-apigee-registry/compare/v1.0.0...v1.0.1) (2023-09-07) + + +### Bug Fixes + +* Simplify logic for HTTP/1.1 REST fallback option ([#54](https://github.com/googleapis/nodejs-apigee-registry/issues/54)) ([c873226](https://github.com/googleapis/nodejs-apigee-registry/commit/c87322645e01d1e1cf989aa5f8502876d7b77230)) + +## [1.0.0](https://github.com/googleapis/nodejs-apigee-registry/compare/v0.3.0...v1.0.0) (2023-08-15) + + +### ⚠ BREAKING CHANGES + +* update to Node 14 ([#50](https://github.com/googleapis/nodejs-apigee-registry/issues/50)) + +### Miscellaneous Chores + +* Update to Node 14 ([#50](https://github.com/googleapis/nodejs-apigee-registry/issues/50)) ([ae2c7ea](https://github.com/googleapis/nodejs-apigee-registry/commit/ae2c7ea278d037c3ba020192ab8913b0659191e8)) + +## [0.3.0](https://github.com/googleapis/nodejs-apigee-registry/compare/v0.2.1...v0.3.0) (2023-02-09) + + +### Features + +* Added SuggestConversationSummary RPC ([8110940](https://github.com/googleapis/nodejs-apigee-registry/commit/8110940e67c72bd94776c17863fa52d714b270ae)) + + +### Bug Fixes + +* **deps:** Use google-gax v3.5.2 ([#25](https://github.com/googleapis/nodejs-apigee-registry/issues/25)) ([1ee9a1d](https://github.com/googleapis/nodejs-apigee-registry/commit/1ee9a1d07a6cd4930c07651a0e17bb41c0663777)) + +## [0.2.1](https://github.com/googleapis/nodejs-apigee-registry/compare/v0.2.0...v0.2.1) (2022-09-21) + + +### Bug Fixes + +* Additional error codes added to service configuration for retry ([#16](https://github.com/googleapis/nodejs-apigee-registry/issues/16)) ([4be826d](https://github.com/googleapis/nodejs-apigee-registry/commit/4be826ddc63cd21391a7c204fc361156c5c0b673)) +* Preserve default values in x-goog-request-params header ([#18](https://github.com/googleapis/nodejs-apigee-registry/issues/18)) ([19c2bf9](https://github.com/googleapis/nodejs-apigee-registry/commit/19c2bf9e6bc00d99fd3b07c9c71ca946ece94695)) + +## [0.2.0](https://github.com/googleapis/nodejs-apigee-registry/compare/v0.1.0...v0.2.0) (2022-08-30) + + +### Features + +* added support for force field for API and API version deletion ([c0bf481](https://github.com/googleapis/nodejs-apigee-registry/commit/c0bf48111db1e05f88cb68fac40584e60bbdf6f6)) + + +### Bug Fixes + +* change import long to require ([#12](https://github.com/googleapis/nodejs-apigee-registry/issues/12)) ([c04237e](https://github.com/googleapis/nodejs-apigee-registry/commit/c04237ebc9dc76016f9017ee6f8cdf938fd14da8)) +* do not import the whole google-gax from proto JS ([#1553](https://github.com/googleapis/nodejs-apigee-registry/issues/1553)) ([#15](https://github.com/googleapis/nodejs-apigee-registry/issues/15)) ([34da6db](https://github.com/googleapis/nodejs-apigee-registry/commit/34da6dbc51476bf7a30fae332233c76527f9e9ff)) +* remove pip install statements ([#1546](https://github.com/googleapis/nodejs-apigee-registry/issues/1546)) ([#14](https://github.com/googleapis/nodejs-apigee-registry/issues/14)) ([a6dba15](https://github.com/googleapis/nodejs-apigee-registry/commit/a6dba15c574a7537771ee95a50785b30b83eb4a2)) +* use google-gax v3.3.0 ([34da6db](https://github.com/googleapis/nodejs-apigee-registry/commit/34da6dbc51476bf7a30fae332233c76527f9e9ff)) + +## 0.1.0 (2022-07-21) + + +### Features + +* add initial samples and tests ([77257a4](https://github.com/googleapis/nodejs-apigee-registry/commit/77257a467f559529416327d362ba46aaef41b037)) +* add templated files from docker image ([4999fc5](https://github.com/googleapis/nodejs-apigee-registry/commit/4999fc5f4b8150c2b2d3bcdb15d17c6ac400bfb2)) +* initial stub of library ([81efd1e](https://github.com/googleapis/nodejs-apigee-registry/commit/81efd1e2ac2c301b1a95fca58b83c9ab61103f19)) diff --git a/packages/google-cloud-apigeeregistry/CODE_OF_CONDUCT.md b/packages/google-cloud-apigeeregistry/CODE_OF_CONDUCT.md new file mode 100644 index 00000000000..2add2547a81 --- /dev/null +++ b/packages/google-cloud-apigeeregistry/CODE_OF_CONDUCT.md @@ -0,0 +1,94 @@ + +# Code of Conduct + +## Our Pledge + +In the interest of fostering an open and welcoming environment, we as +contributors and maintainers pledge to making participation in our project and +our community a harassment-free experience for everyone, regardless of age, body +size, disability, ethnicity, gender identity and expression, level of +experience, education, socio-economic status, nationality, personal appearance, +race, religion, or sexual identity and orientation. + +## Our Standards + +Examples of behavior that contributes to creating a positive environment +include: + +* Using welcoming and inclusive language +* Being respectful of differing viewpoints and experiences +* Gracefully accepting constructive criticism +* Focusing on what is best for the community +* Showing empathy towards other community members + +Examples of unacceptable behavior by participants include: + +* The use of sexualized language or imagery and unwelcome sexual attention or + advances +* Trolling, insulting/derogatory comments, and personal or political attacks +* Public or private harassment +* Publishing others' private information, such as a physical or electronic + address, without explicit permission +* Other conduct which could reasonably be considered inappropriate in a + professional setting + +## Our Responsibilities + +Project maintainers are responsible for clarifying the standards of acceptable +behavior and are expected to take appropriate and fair corrective action in +response to any instances of unacceptable behavior. + +Project maintainers have the right and responsibility to remove, edit, or reject +comments, commits, code, wiki edits, issues, and other contributions that are +not aligned to this Code of Conduct, or to ban temporarily or permanently any +contributor for other behaviors that they deem inappropriate, threatening, +offensive, or harmful. + +## Scope + +This Code of Conduct applies both within project spaces and in public spaces +when an individual is representing the project or its community. Examples of +representing a project or community include using an official project e-mail +address, posting via an official social media account, or acting as an appointed +representative at an online or offline event. Representation of a project may be +further defined and clarified by project maintainers. + +This Code of Conduct also applies outside the project spaces when the Project +Steward has a reasonable belief that an individual's behavior may have a +negative impact on the project or its community. + +## Conflict Resolution + +We do not believe that all conflict is bad; healthy debate and disagreement +often yield positive results. However, it is never okay to be disrespectful or +to engage in behavior that violates the project’s code of conduct. + +If you see someone violating the code of conduct, you are encouraged to address +the behavior directly with those involved. Many issues can be resolved quickly +and easily, and this gives people more control over the outcome of their +dispute. If you are unable to resolve the matter for any reason, or if the +behavior is threatening or harassing, report it. We are dedicated to providing +an environment where participants feel welcome and safe. + +Reports should be directed to *googleapis-stewards@google.com*, the +Project Steward(s) for *Google Cloud Client Libraries*. It is the Project Steward’s duty to +receive and address reported violations of the code of conduct. They will then +work with a committee consisting of representatives from the Open Source +Programs Office and the Google Open Source Strategy team. If for any reason you +are uncomfortable reaching out to the Project Steward, please email +opensource@google.com. + +We will investigate every complaint, but you may not receive a direct response. +We will use our discretion in determining when and how to follow up on reported +incidents, which may range from not taking action to permanent expulsion from +the project and project-sponsored spaces. We will notify the accused of the +report and provide them an opportunity to discuss it before any action is taken. +The identity of the reporter will be omitted from the details of the report +supplied to the accused. In potentially harmful situations, such as ongoing +harassment or threats to anyone's safety, we may take action without notice. + +## Attribution + +This Code of Conduct is adapted from the Contributor Covenant, version 1.4, +available at +https://www.contributor-covenant.org/version/1/4/code-of-conduct.html \ No newline at end of file diff --git a/packages/google-cloud-apigeeregistry/CONTRIBUTING.md b/packages/google-cloud-apigeeregistry/CONTRIBUTING.md new file mode 100644 index 00000000000..0a19fb4c70f --- /dev/null +++ b/packages/google-cloud-apigeeregistry/CONTRIBUTING.md @@ -0,0 +1,76 @@ +# How to become a contributor and submit your own code + +**Table of contents** + +* [Contributor License Agreements](#contributor-license-agreements) +* [Contributing a patch](#contributing-a-patch) +* [Running the tests](#running-the-tests) +* [Releasing the library](#releasing-the-library) + +## Contributor License Agreements + +We'd love to accept your sample apps and patches! Before we can take them, we +have to jump a couple of legal hurdles. + +Please fill out either the individual or corporate Contributor License Agreement +(CLA). + + * If you are an individual writing original source code and you're sure you + own the intellectual property, then you'll need to sign an [individual CLA](https://developers.google.com/open-source/cla/individual). + * If you work for a company that wants to allow you to contribute your work, + then you'll need to sign a [corporate CLA](https://developers.google.com/open-source/cla/corporate). + +Follow either of the two links above to access the appropriate CLA and +instructions for how to sign and return it. Once we receive it, we'll be able to +accept your pull requests. + +## Contributing A Patch + +1. Submit an issue describing your proposed change to the repo in question. +1. The repo owner will respond to your issue promptly. +1. If your proposed change is accepted, and you haven't already done so, sign a + Contributor License Agreement (see details above). +1. Fork the desired repo, develop and test your code changes. +1. Ensure that your code adheres to the existing style in the code to which + you are contributing. +1. Ensure that your code has an appropriate set of tests which all pass. +1. Title your pull request following [Conventional Commits](https://www.conventionalcommits.org/) styling. +1. Submit a pull request. + +### Before you begin + +1. [Select or create a Cloud Platform project][projects]. +1. [Enable billing for your project][billing]. +1. [Enable the Apigee Registry API API][enable_api]. +1. [Set up authentication with a service account][auth] so you can access the + API from your local workstation. + + +## Running the tests + +1. [Prepare your environment for Node.js setup][setup]. + +1. Install dependencies: + + npm install + +1. Run the tests: + + # Run unit tests. + npm test + + # Run sample integration tests. + npm run samples-test + + # Run all system tests. + npm run system-test + +1. Lint (and maybe fix) any changes: + + npm run fix + +[setup]: https://cloud.google.com/nodejs/docs/setup +[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=apigeeregistry.googleapis.com +[auth]: https://cloud.google.com/docs/authentication/getting-started \ No newline at end of file diff --git a/packages/google-cloud-apigeeregistry/LICENSE b/packages/google-cloud-apigeeregistry/LICENSE new file mode 100644 index 00000000000..d6456956733 --- /dev/null +++ b/packages/google-cloud-apigeeregistry/LICENSE @@ -0,0 +1,202 @@ + + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright [yyyy] [name of copyright owner] + + Licensed under the Apache License, Version 2.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. diff --git a/packages/google-cloud-apigeeregistry/README.md b/packages/google-cloud-apigeeregistry/README.md new file mode 100644 index 00000000000..0a9caf86a87 --- /dev/null +++ b/packages/google-cloud-apigeeregistry/README.md @@ -0,0 +1,173 @@ +[//]: # "This README.md file is auto-generated, all changes to this file will be lost." +[//]: # "To regenerate it, use `python -m synthtool`." +Google Cloud Platform logo + +# [Apigee Registry API: Node.js Client](https://github.com/googleapis/google-cloud-node/tree/main/packages/google-cloud-apigeeregistry) + +[![release level](https://img.shields.io/badge/release%20level-beta-yellow.svg?style=flat)](https://cloud.google.com/terms/launch-stages) +[![npm version](https://img.shields.io/npm/v/@google-cloud/apigee-registry.svg)](https://www.npmjs.org/package/@google-cloud/apigee-registry) + + + + +apigeeregistry client for Node.js + + +A comprehensive list of changes in each version may be found in +[the CHANGELOG](https://github.com/googleapis/google-cloud-node/tree/main/packages/google-cloud-apigeeregistry/CHANGELOG.md). + +* [Apigee Registry API Node.js Client API Reference][client-docs] +* [Apigee Registry API Documentation][product-docs] +* [github.com/googleapis/google-cloud-node/packages/google-cloud-apigeeregistry](https://github.com/googleapis/google-cloud-node/tree/main/packages/google-cloud-apigeeregistry) + +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) + +* [Samples](#samples) +* [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 Apigee Registry API API][enable_api]. +1. [Set up authentication with a service account][auth] so you can access the + API from your local workstation. + +### Installing the client library + +```bash +npm install @google-cloud/apigee-registry +``` + + + + +## Samples + +Samples are in the [`samples/`](https://github.com/googleapis/google-cloud-node/tree/main/packages/google-cloud-apigeeregistry/samples) directory. Each sample's `README.md` has instructions for running its sample. + +| Sample | Source Code | Try it | +| --------------------------- | --------------------------------- | ------ | +| Provisioning.create_instance | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-apigeeregistry/samples/generated/v1/provisioning.create_instance.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-cloud-apigeeregistry/samples/generated/v1/provisioning.create_instance.js,packages/google-cloud-apigeeregistry/samples/README.md) | +| Provisioning.delete_instance | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-apigeeregistry/samples/generated/v1/provisioning.delete_instance.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-cloud-apigeeregistry/samples/generated/v1/provisioning.delete_instance.js,packages/google-cloud-apigeeregistry/samples/README.md) | +| Provisioning.get_instance | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-apigeeregistry/samples/generated/v1/provisioning.get_instance.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-cloud-apigeeregistry/samples/generated/v1/provisioning.get_instance.js,packages/google-cloud-apigeeregistry/samples/README.md) | +| Registry.create_api | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-apigeeregistry/samples/generated/v1/registry.create_api.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-cloud-apigeeregistry/samples/generated/v1/registry.create_api.js,packages/google-cloud-apigeeregistry/samples/README.md) | +| Registry.create_api_deployment | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-apigeeregistry/samples/generated/v1/registry.create_api_deployment.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-cloud-apigeeregistry/samples/generated/v1/registry.create_api_deployment.js,packages/google-cloud-apigeeregistry/samples/README.md) | +| Registry.create_api_spec | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-apigeeregistry/samples/generated/v1/registry.create_api_spec.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-cloud-apigeeregistry/samples/generated/v1/registry.create_api_spec.js,packages/google-cloud-apigeeregistry/samples/README.md) | +| Registry.create_api_version | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-apigeeregistry/samples/generated/v1/registry.create_api_version.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-cloud-apigeeregistry/samples/generated/v1/registry.create_api_version.js,packages/google-cloud-apigeeregistry/samples/README.md) | +| Registry.create_artifact | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-apigeeregistry/samples/generated/v1/registry.create_artifact.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-cloud-apigeeregistry/samples/generated/v1/registry.create_artifact.js,packages/google-cloud-apigeeregistry/samples/README.md) | +| Registry.delete_api | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-apigeeregistry/samples/generated/v1/registry.delete_api.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-cloud-apigeeregistry/samples/generated/v1/registry.delete_api.js,packages/google-cloud-apigeeregistry/samples/README.md) | +| Registry.delete_api_deployment | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-apigeeregistry/samples/generated/v1/registry.delete_api_deployment.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-cloud-apigeeregistry/samples/generated/v1/registry.delete_api_deployment.js,packages/google-cloud-apigeeregistry/samples/README.md) | +| Registry.delete_api_deployment_revision | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-apigeeregistry/samples/generated/v1/registry.delete_api_deployment_revision.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-cloud-apigeeregistry/samples/generated/v1/registry.delete_api_deployment_revision.js,packages/google-cloud-apigeeregistry/samples/README.md) | +| Registry.delete_api_spec | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-apigeeregistry/samples/generated/v1/registry.delete_api_spec.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-cloud-apigeeregistry/samples/generated/v1/registry.delete_api_spec.js,packages/google-cloud-apigeeregistry/samples/README.md) | +| Registry.delete_api_spec_revision | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-apigeeregistry/samples/generated/v1/registry.delete_api_spec_revision.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-cloud-apigeeregistry/samples/generated/v1/registry.delete_api_spec_revision.js,packages/google-cloud-apigeeregistry/samples/README.md) | +| Registry.delete_api_version | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-apigeeregistry/samples/generated/v1/registry.delete_api_version.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-cloud-apigeeregistry/samples/generated/v1/registry.delete_api_version.js,packages/google-cloud-apigeeregistry/samples/README.md) | +| Registry.delete_artifact | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-apigeeregistry/samples/generated/v1/registry.delete_artifact.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-cloud-apigeeregistry/samples/generated/v1/registry.delete_artifact.js,packages/google-cloud-apigeeregistry/samples/README.md) | +| Registry.get_api | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-apigeeregistry/samples/generated/v1/registry.get_api.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-cloud-apigeeregistry/samples/generated/v1/registry.get_api.js,packages/google-cloud-apigeeregistry/samples/README.md) | +| Registry.get_api_deployment | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-apigeeregistry/samples/generated/v1/registry.get_api_deployment.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-cloud-apigeeregistry/samples/generated/v1/registry.get_api_deployment.js,packages/google-cloud-apigeeregistry/samples/README.md) | +| Registry.get_api_spec | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-apigeeregistry/samples/generated/v1/registry.get_api_spec.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-cloud-apigeeregistry/samples/generated/v1/registry.get_api_spec.js,packages/google-cloud-apigeeregistry/samples/README.md) | +| Registry.get_api_spec_contents | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-apigeeregistry/samples/generated/v1/registry.get_api_spec_contents.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-cloud-apigeeregistry/samples/generated/v1/registry.get_api_spec_contents.js,packages/google-cloud-apigeeregistry/samples/README.md) | +| Registry.get_api_version | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-apigeeregistry/samples/generated/v1/registry.get_api_version.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-cloud-apigeeregistry/samples/generated/v1/registry.get_api_version.js,packages/google-cloud-apigeeregistry/samples/README.md) | +| Registry.get_artifact | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-apigeeregistry/samples/generated/v1/registry.get_artifact.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-cloud-apigeeregistry/samples/generated/v1/registry.get_artifact.js,packages/google-cloud-apigeeregistry/samples/README.md) | +| Registry.get_artifact_contents | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-apigeeregistry/samples/generated/v1/registry.get_artifact_contents.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-cloud-apigeeregistry/samples/generated/v1/registry.get_artifact_contents.js,packages/google-cloud-apigeeregistry/samples/README.md) | +| Registry.list_api_deployment_revisions | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-apigeeregistry/samples/generated/v1/registry.list_api_deployment_revisions.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-cloud-apigeeregistry/samples/generated/v1/registry.list_api_deployment_revisions.js,packages/google-cloud-apigeeregistry/samples/README.md) | +| Registry.list_api_deployments | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-apigeeregistry/samples/generated/v1/registry.list_api_deployments.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-cloud-apigeeregistry/samples/generated/v1/registry.list_api_deployments.js,packages/google-cloud-apigeeregistry/samples/README.md) | +| Registry.list_api_spec_revisions | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-apigeeregistry/samples/generated/v1/registry.list_api_spec_revisions.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-cloud-apigeeregistry/samples/generated/v1/registry.list_api_spec_revisions.js,packages/google-cloud-apigeeregistry/samples/README.md) | +| Registry.list_api_specs | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-apigeeregistry/samples/generated/v1/registry.list_api_specs.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-cloud-apigeeregistry/samples/generated/v1/registry.list_api_specs.js,packages/google-cloud-apigeeregistry/samples/README.md) | +| Registry.list_api_versions | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-apigeeregistry/samples/generated/v1/registry.list_api_versions.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-cloud-apigeeregistry/samples/generated/v1/registry.list_api_versions.js,packages/google-cloud-apigeeregistry/samples/README.md) | +| Registry.list_apis | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-apigeeregistry/samples/generated/v1/registry.list_apis.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-cloud-apigeeregistry/samples/generated/v1/registry.list_apis.js,packages/google-cloud-apigeeregistry/samples/README.md) | +| Registry.list_artifacts | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-apigeeregistry/samples/generated/v1/registry.list_artifacts.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-cloud-apigeeregistry/samples/generated/v1/registry.list_artifacts.js,packages/google-cloud-apigeeregistry/samples/README.md) | +| Registry.replace_artifact | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-apigeeregistry/samples/generated/v1/registry.replace_artifact.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-cloud-apigeeregistry/samples/generated/v1/registry.replace_artifact.js,packages/google-cloud-apigeeregistry/samples/README.md) | +| Registry.rollback_api_deployment | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-apigeeregistry/samples/generated/v1/registry.rollback_api_deployment.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-cloud-apigeeregistry/samples/generated/v1/registry.rollback_api_deployment.js,packages/google-cloud-apigeeregistry/samples/README.md) | +| Registry.rollback_api_spec | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-apigeeregistry/samples/generated/v1/registry.rollback_api_spec.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-cloud-apigeeregistry/samples/generated/v1/registry.rollback_api_spec.js,packages/google-cloud-apigeeregistry/samples/README.md) | +| Registry.tag_api_deployment_revision | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-apigeeregistry/samples/generated/v1/registry.tag_api_deployment_revision.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-cloud-apigeeregistry/samples/generated/v1/registry.tag_api_deployment_revision.js,packages/google-cloud-apigeeregistry/samples/README.md) | +| Registry.tag_api_spec_revision | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-apigeeregistry/samples/generated/v1/registry.tag_api_spec_revision.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-cloud-apigeeregistry/samples/generated/v1/registry.tag_api_spec_revision.js,packages/google-cloud-apigeeregistry/samples/README.md) | +| Registry.update_api | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-apigeeregistry/samples/generated/v1/registry.update_api.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-cloud-apigeeregistry/samples/generated/v1/registry.update_api.js,packages/google-cloud-apigeeregistry/samples/README.md) | +| Registry.update_api_deployment | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-apigeeregistry/samples/generated/v1/registry.update_api_deployment.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-cloud-apigeeregistry/samples/generated/v1/registry.update_api_deployment.js,packages/google-cloud-apigeeregistry/samples/README.md) | +| Registry.update_api_spec | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-apigeeregistry/samples/generated/v1/registry.update_api_spec.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-cloud-apigeeregistry/samples/generated/v1/registry.update_api_spec.js,packages/google-cloud-apigeeregistry/samples/README.md) | +| Registry.update_api_version | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-apigeeregistry/samples/generated/v1/registry.update_api_version.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-cloud-apigeeregistry/samples/generated/v1/registry.update_api_version.js,packages/google-cloud-apigeeregistry/samples/README.md) | +| Quickstart | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-apigeeregistry/samples/quickstart.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-cloud-apigeeregistry/samples/quickstart.js,packages/google-cloud-apigeeregistry/samples/README.md) | + + + +The [Apigee Registry API Node.js Client API Reference][client-docs] documentation +also contains 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/apigee-registry@legacy-8` installs client libraries +for versions compatible with Node.js 8. + +## Versioning + +This library follows [Semantic Versioning](http://semver.org/). + + + + +This library is considered to be in **beta**. This means it is expected to be +mostly stable while we work toward a general availability release; however, +complete stability is not guaranteed. We will address issues and requests +against beta libraries with a high priority. + + + + + +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](https://github.com/googleapis/google-cloud-node/blob/main/CONTRIBUTING.md). + +Please note that this `README.md`, the `samples/README.md`, +and a variety of configuration files in this repository (including `.nycrc` and `tsconfig.json`) +are generated from a central template. To edit one of these files, make an edit +to its templates in +[directory](https://github.com/googleapis/synthtool). + +## License + +Apache Version 2.0 + +See [LICENSE](https://github.com/googleapis/google-cloud-node/blob/main/LICENSE) + +[client-docs]: https://cloud.google.com/nodejs/docs/reference/apigee-registry/latest +[product-docs]: https://cloud.google.com/apigee/docs/api-hub/get-started-registry-api +[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=apigeeregistry.googleapis.com +[auth]: https://cloud.google.com/docs/authentication/getting-started diff --git a/packages/google-cloud-apigeeregistry/linkinator.config.json b/packages/google-cloud-apigeeregistry/linkinator.config.json new file mode 100644 index 00000000000..befd23c8633 --- /dev/null +++ b/packages/google-cloud-apigeeregistry/linkinator.config.json @@ -0,0 +1,16 @@ +{ + "recurse": true, + "skip": [ + "https://codecov.io/gh/googleapis/", + "www.googleapis.com", + "img.shields.io", + "https://console.cloud.google.com/cloudshell", + "https://support.google.com" + ], + "silent": true, + "concurrency": 5, + "retry": true, + "retryErrors": true, + "retryErrorsCount": 5, + "retryErrorsJitter": 3000 +} diff --git a/packages/google-cloud-apigeeregistry/package.json b/packages/google-cloud-apigeeregistry/package.json new file mode 100644 index 00000000000..784f801f898 --- /dev/null +++ b/packages/google-cloud-apigeeregistry/package.json @@ -0,0 +1,73 @@ +{ + "name": "@google-cloud/apigee-registry", + "version": "1.0.1", + "description": "apigeeregistry client for Node.js", + "repository": { + "type": "git", + "directory": "packages/google-cloud-apigeeregistry", + "url": "https://github.com/googleapis/google-cloud-node.git" + }, + "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 apigeeregistry", + "apigeeregistry", + "apigeeregistry service" + ], + "scripts": { + "clean": "gts clean", + "compile": "tsc -p . && cp -r protos build/", + "compile-protos": "compileProtos src", + "docs": "jsdoc -c .jsdoc.js", + "predocs-test": "npm run docs", + "docs-test": "linkinator docs", + "fix": "gts fix", + "lint": "gts check", + "prepare": "npm run compile-protos && npm run compile", + "system-test": "npm run compile && c8 mocha build/system-test", + "test": "c8 mocha build/test", + "samples-test": "npm run compile && cd samples/ && npm link ../ && npm i && npm test", + "prelint": "cd samples; npm link ../; npm i" + }, + "dependencies": { + "google-gax": "^4.0.3" + }, + "devDependencies": { + "@types/mocha": "^10.0.0", + "@types/node": "^20.4.9", + "@types/sinon": "^10.0.0", + "c8": "^8.0.1", + "gapic-tools": "^0.1.8", + "gts": "^5.0.0", + "jsdoc": "^4.0.0", + "jsdoc-fresh": "^3.0.0", + "jsdoc-region-tag": "^3.0.0", + "linkinator": "4.1.2", + "long": "^5.2.3", + "mocha": "^10.0.0", + "null-loader": "^4.0.1", + "pack-n-play": "^1.0.0-2", + "sinon": "^15.0.0", + "ts-loader": "^9.1.2", + "typescript": "^5.1.6", + "webpack": "^5.36.2", + "webpack-cli": "^5.0.0" + }, + "engines": { + "node": ">=14.0.0" + }, + "homepage": "https://github.com/googleapis/google-cloud-node/tree/main/packages/google-cloud-apigeeregistry" +} diff --git a/packages/google-cloud-apigeeregistry/protos/google/cloud/apigeeregistry/v1/provisioning_service.proto b/packages/google-cloud-apigeeregistry/protos/google/cloud/apigeeregistry/v1/provisioning_service.proto new file mode 100644 index 00000000000..cca6753c6bc --- /dev/null +++ b/packages/google-cloud-apigeeregistry/protos/google/cloud/apigeeregistry/v1/provisioning_service.proto @@ -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. + +syntax = "proto3"; + +package google.cloud.apigeeregistry.v1; + +import "google/api/annotations.proto"; +import "google/api/client.proto"; +import "google/api/field_behavior.proto"; +import "google/api/resource.proto"; +import "google/longrunning/operations.proto"; +import "google/protobuf/timestamp.proto"; + +option csharp_namespace = "Google.Cloud.ApigeeRegistry.V1"; +option go_package = "cloud.google.com/go/apigeeregistry/apiv1/apigeeregistrypb;apigeeregistrypb"; +option java_multiple_files = true; +option java_outer_classname = "ProvisioningServiceProto"; +option java_package = "com.google.cloud.apigeeregistry.v1"; +option php_namespace = "Google\\Cloud\\ApigeeRegistry\\V1"; +option ruby_package = "Google::Cloud::ApigeeRegistry::V1"; + +// The service that is used for managing the data plane provisioning of the +// Registry. +service Provisioning { + option (google.api.default_host) = "apigeeregistry.googleapis.com"; + option (google.api.oauth_scopes) = "https://www.googleapis.com/auth/cloud-platform"; + + // Provisions instance resources for the Registry. + rpc CreateInstance(CreateInstanceRequest) returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v1/{parent=projects/*/locations/*}/instances" + body: "instance" + }; + option (google.api.method_signature) = "parent,instance,instance_id"; + option (google.longrunning.operation_info) = { + response_type: "Instance" + metadata_type: "OperationMetadata" + }; + } + + // Deletes the Registry instance. + rpc DeleteInstance(DeleteInstanceRequest) returns (google.longrunning.Operation) { + option (google.api.http) = { + delete: "/v1/{name=projects/*/locations/*/instances/*}" + }; + option (google.api.method_signature) = "name"; + option (google.longrunning.operation_info) = { + response_type: "google.protobuf.Empty" + metadata_type: "OperationMetadata" + }; + } + + // Gets details of a single Instance. + rpc GetInstance(GetInstanceRequest) returns (Instance) { + option (google.api.http) = { + get: "/v1/{name=projects/*/locations/*/instances/*}" + }; + option (google.api.method_signature) = "name"; + } +} + +// Request message for CreateInstance. +message CreateInstanceRequest { + // Required. Parent resource of the Instance, of the form: `projects/*/locations/*` + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "locations.googleapis.com/Location" + } + ]; + + // Required. Identifier to assign to the Instance. Must be unique within scope of the + // parent resource. + string instance_id = 2 [(google.api.field_behavior) = REQUIRED]; + + // Required. The Instance. + Instance instance = 3 [(google.api.field_behavior) = REQUIRED]; +} + +// Request message for DeleteInstance. +message DeleteInstanceRequest { + // Required. The name of the Instance to delete. + // Format: `projects/*/locations/*/instances/*`. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "apigeeregistry.googleapis.com/Instance" + } + ]; +} + +// Request message for GetInstance. +message GetInstanceRequest { + // Required. The name of the Instance to retrieve. + // Format: `projects/*/locations/*/instances/*`. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "apigeeregistry.googleapis.com/Instance" + } + ]; +} + +// Represents the metadata of the long-running operation. +message OperationMetadata { + // The time the operation was created. + google.protobuf.Timestamp create_time = 1; + + // The time the operation finished running. + google.protobuf.Timestamp end_time = 2; + + // Server-defined resource path for the target of the operation. + string target = 3; + + // Name of the verb executed by the operation. + string verb = 4; + + // Human-readable status of the operation, if any. + string status_message = 5; + + // Identifies whether the user has requested cancellation + // of the operation. Operations that have successfully been cancelled + // have [Operation.error][] value with a [google.rpc.Status.code][google.rpc.Status.code] of 1, + // corresponding to `Code.CANCELLED`. + bool cancellation_requested = 6; + + // API version used to start the operation. + string api_version = 7; +} + +// An Instance represents the instance resources of the Registry. +// Currently, only one instance is allowed for each project. +message Instance { + option (google.api.resource) = { + type: "apigeeregistry.googleapis.com/Instance" + pattern: "projects/{project}/locations/{location}/instances/{instance}" + }; + + // State of the Instance. + enum State { + // The default value. This value is used if the state is omitted. + STATE_UNSPECIFIED = 0; + + // The Instance has not been initialized or has been deleted. + INACTIVE = 1; + + // The Instance is being created. + CREATING = 2; + + // The Instance has been created and is ready for use. + ACTIVE = 3; + + // The Instance is being updated. + UPDATING = 4; + + // The Instance is being deleted. + DELETING = 5; + + // The Instance encountered an error during a state change. + FAILED = 6; + } + + // Available configurations to provision an Instance. + message Config { + // Output only. The GCP location where the Instance resides. + string location = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Required. The Customer Managed Encryption Key (CMEK) used for data encryption. + // The CMEK name should follow the format of + // `projects/([^/]+)/locations/([^/]+)/keyRings/([^/]+)/cryptoKeys/([^/]+)`, + // where the `location` must match InstanceConfig.location. + string cmek_key_name = 2 [(google.api.field_behavior) = REQUIRED]; + } + + // Format: `projects/*/locations/*/instance`. + // Currently only `locations/global` is supported. + string name = 1; + + // Output only. Creation timestamp. + google.protobuf.Timestamp create_time = 2 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Last update timestamp. + google.protobuf.Timestamp update_time = 3 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The current state of the Instance. + State state = 4 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Extra information of Instance.State if the state is `FAILED`. + string state_message = 5 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Required. Config of the Instance. + Config config = 6 [(google.api.field_behavior) = REQUIRED]; +} diff --git a/packages/google-cloud-apigeeregistry/protos/google/cloud/apigeeregistry/v1/registry_models.proto b/packages/google-cloud-apigeeregistry/protos/google/cloud/apigeeregistry/v1/registry_models.proto new file mode 100644 index 00000000000..a1c29b4d5b9 --- /dev/null +++ b/packages/google-cloud-apigeeregistry/protos/google/cloud/apigeeregistry/v1/registry_models.proto @@ -0,0 +1,364 @@ +// 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. + +syntax = "proto3"; + +package google.cloud.apigeeregistry.v1; + +import "google/api/field_behavior.proto"; +import "google/api/resource.proto"; +import "google/protobuf/timestamp.proto"; + +option csharp_namespace = "Google.Cloud.ApigeeRegistry.V1"; +option go_package = "cloud.google.com/go/apigeeregistry/apiv1/apigeeregistrypb;apigeeregistrypb"; +option java_multiple_files = true; +option java_outer_classname = "RegistryModelsProto"; +option java_package = "com.google.cloud.apigeeregistry.v1"; +option php_namespace = "Google\\Cloud\\ApigeeRegistry\\V1"; +option ruby_package = "Google::Cloud::ApigeeRegistry::V1"; + +// A top-level description of an API. +// Produced by producers and are commitments to provide services. +message Api { + option (google.api.resource) = { + type: "apigeeregistry.googleapis.com/Api" + pattern: "projects/{project}/locations/{location}/apis/{api}" + }; + + // Resource name. + string name = 1; + + // Human-meaningful name. + string display_name = 2; + + // A detailed description. + string description = 3; + + // Output only. Creation timestamp. + google.protobuf.Timestamp create_time = 4 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Last update timestamp. + google.protobuf.Timestamp update_time = 5 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // A user-definable description of the availability of this service. + // Format: free-form, but we expect single words that describe availability, + // e.g., "NONE", "TESTING", "PREVIEW", "GENERAL", "DEPRECATED", "SHUTDOWN". + string availability = 6; + + // The recommended version of the API. + // Format: `apis/{api}/versions/{version}` + string recommended_version = 7 [(google.api.resource_reference) = { + type: "apigeeregistry.googleapis.com/ApiVersion" + }]; + + // The recommended deployment of the API. + // Format: `apis/{api}/deployments/{deployment}` + string recommended_deployment = 8 [(google.api.resource_reference) = { + type: "apigeeregistry.googleapis.com/ApiDeployment" + }]; + + // Labels attach identifying metadata to resources. Identifying metadata can + // be used to filter list operations. + // + // Label keys and values can be no longer than 64 characters + // (Unicode codepoints), can only contain lowercase letters, numeric + // characters, underscores, and dashes. International characters are allowed. + // No more than 64 user labels can be associated with one resource (System + // labels are excluded). + // + // See https://goo.gl/xmQnxf for more information and examples of labels. + // System reserved label keys are prefixed with + // `apigeeregistry.googleapis.com/` and cannot be changed. + map labels = 9; + + // Annotations attach non-identifying metadata to resources. + // + // Annotation keys and values are less restricted than those of labels, but + // should be generally used for small values of broad interest. Larger, topic- + // specific metadata should be stored in Artifacts. + map annotations = 10; +} + +// Describes a particular version of an API. +// ApiVersions are what consumers actually use. +message ApiVersion { + option (google.api.resource) = { + type: "apigeeregistry.googleapis.com/ApiVersion" + pattern: "projects/{project}/locations/{location}/apis/{api}/versions/{version}" + }; + + // Resource name. + string name = 1; + + // Human-meaningful name. + string display_name = 2; + + // A detailed description. + string description = 3; + + // Output only. Creation timestamp. + google.protobuf.Timestamp create_time = 4 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Last update timestamp. + google.protobuf.Timestamp update_time = 5 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // A user-definable description of the lifecycle phase of this API version. + // Format: free-form, but we expect single words that describe API maturity, + // e.g., "CONCEPT", "DESIGN", "DEVELOPMENT", "STAGING", "PRODUCTION", + // "DEPRECATED", "RETIRED". + string state = 6; + + // Labels attach identifying metadata to resources. Identifying metadata can + // be used to filter list operations. + // + // Label keys and values can be no longer than 64 characters + // (Unicode codepoints), can only contain lowercase letters, numeric + // characters, underscores and dashes. International characters are allowed. + // No more than 64 user labels can be associated with one resource (System + // labels are excluded). + // + // See https://goo.gl/xmQnxf for more information and examples of labels. + // System reserved label keys are prefixed with + // `apigeeregistry.googleapis.com/` and cannot be changed. + map labels = 7; + + // Annotations attach non-identifying metadata to resources. + // + // Annotation keys and values are less restricted than those of labels, but + // should be generally used for small values of broad interest. Larger, topic- + // specific metadata should be stored in Artifacts. + map annotations = 8; +} + +// Describes a version of an API in a structured way. +// ApiSpecs provide formal descriptions that consumers can use to use a version. +// ApiSpec resources are intended to be fully-resolved descriptions of an +// ApiVersion. When specs consist of multiple files, these should be bundled +// together (e.g., in a zip archive) and stored as a unit. Multiple specs can +// exist to provide representations in different API description formats. +// Synchronization of these representations would be provided by tooling and +// background services. +message ApiSpec { + option (google.api.resource) = { + type: "apigeeregistry.googleapis.com/ApiSpec" + pattern: "projects/{project}/locations/{location}/apis/{api}/versions/{version}/specs/{spec}" + }; + + // Resource name. + string name = 1; + + // A possibly-hierarchical name used to refer to the spec from other specs. + string filename = 2; + + // A detailed description. + string description = 3; + + // Output only. Immutable. The revision ID of the spec. + // A new revision is committed whenever the spec contents are changed. + // The format is an 8-character hexadecimal string. + string revision_id = 4 [ + (google.api.field_behavior) = IMMUTABLE, + (google.api.field_behavior) = OUTPUT_ONLY + ]; + + // Output only. Creation timestamp; when the spec resource was created. + google.protobuf.Timestamp create_time = 5 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Revision creation timestamp; when the represented revision was created. + google.protobuf.Timestamp revision_create_time = 6 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Last update timestamp: when the represented revision was last modified. + google.protobuf.Timestamp revision_update_time = 7 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // A style (format) descriptor for this spec that is specified as a Media Type + // (https://en.wikipedia.org/wiki/Media_type). Possible values include + // `application/vnd.apigee.proto`, `application/vnd.apigee.openapi`, and + // `application/vnd.apigee.graphql`, with possible suffixes representing + // compression types. These hypothetical names are defined in the vendor tree + // defined in RFC6838 (https://tools.ietf.org/html/rfc6838) and are not final. + // Content types can specify compression. Currently only GZip compression is + // supported (indicated with "+gzip"). + string mime_type = 8; + + // Output only. The size of the spec file in bytes. If the spec is gzipped, this is the + // size of the uncompressed spec. + int32 size_bytes = 9 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. A SHA-256 hash of the spec's contents. If the spec is gzipped, this is + // the hash of the uncompressed spec. + string hash = 10 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // The original source URI of the spec (if one exists). + // This is an external location that can be used for reference purposes + // but which may not be authoritative since this external resource may + // change after the spec is retrieved. + string source_uri = 11; + + // Input only. The contents of the spec. + // Provided by API callers when specs are created or updated. + // To access the contents of a spec, use GetApiSpecContents. + bytes contents = 12 [(google.api.field_behavior) = INPUT_ONLY]; + + // Labels attach identifying metadata to resources. Identifying metadata can + // be used to filter list operations. + // + // Label keys and values can be no longer than 64 characters + // (Unicode codepoints), can only contain lowercase letters, numeric + // characters, underscores and dashes. International characters are allowed. + // No more than 64 user labels can be associated with one resource (System + // labels are excluded). + // + // See https://goo.gl/xmQnxf for more information and examples of labels. + // System reserved label keys are prefixed with + // `apigeeregistry.googleapis.com/` and cannot be changed. + map labels = 14; + + // Annotations attach non-identifying metadata to resources. + // + // Annotation keys and values are less restricted than those of labels, but + // should be generally used for small values of broad interest. Larger, topic- + // specific metadata should be stored in Artifacts. + map annotations = 15; +} + +// Describes a service running at particular address that +// provides a particular version of an API. ApiDeployments have revisions which +// correspond to different configurations of a single deployment in time. +// Revision identifiers should be updated whenever the served API spec or +// endpoint address changes. +message ApiDeployment { + option (google.api.resource) = { + type: "apigeeregistry.googleapis.com/ApiDeployment" + pattern: "projects/{project}/locations/{location}/apis/{api}/deployments/{deployment}" + }; + + // Resource name. + string name = 1; + + // Human-meaningful name. + string display_name = 2; + + // A detailed description. + string description = 3; + + // Output only. Immutable. The revision ID of the deployment. + // A new revision is committed whenever the deployment contents are changed. + // The format is an 8-character hexadecimal string. + string revision_id = 4 [ + (google.api.field_behavior) = IMMUTABLE, + (google.api.field_behavior) = OUTPUT_ONLY + ]; + + // Output only. Creation timestamp; when the deployment resource was created. + google.protobuf.Timestamp create_time = 5 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Revision creation timestamp; when the represented revision was created. + google.protobuf.Timestamp revision_create_time = 6 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Last update timestamp: when the represented revision was last modified. + google.protobuf.Timestamp revision_update_time = 7 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // The full resource name (including revision ID) of the spec of the API being + // served by the deployment. Changes to this value will update the revision. + // Format: `apis/{api}/deployments/{deployment}` + string api_spec_revision = 8 [(google.api.resource_reference) = { + type: "apigeeregistry.googleapis.com/ApiSpec" + }]; + + // The address where the deployment is serving. Changes to this value will + // update the revision. + string endpoint_uri = 9; + + // The address of the external channel of the API (e.g., the Developer + // Portal). Changes to this value will not affect the revision. + string external_channel_uri = 10; + + // Text briefly identifying the intended audience of the API. Changes to this + // value will not affect the revision. + string intended_audience = 11; + + // Text briefly describing how to access the endpoint. Changes to this value + // will not affect the revision. + string access_guidance = 12; + + // Labels attach identifying metadata to resources. Identifying metadata can + // be used to filter list operations. + // + // Label keys and values can be no longer than 64 characters + // (Unicode codepoints), can only contain lowercase letters, numeric + // characters, underscores and dashes. International characters are allowed. + // No more than 64 user labels can be associated with one resource (System + // labels are excluded). + // + // See https://goo.gl/xmQnxf for more information and examples of labels. + // System reserved label keys are prefixed with + // `apigeeregistry.googleapis.com/` and cannot be changed. + map labels = 14; + + // Annotations attach non-identifying metadata to resources. + // + // Annotation keys and values are less restricted than those of labels, but + // should be generally used for small values of broad interest. Larger, topic- + // specific metadata should be stored in Artifacts. + map annotations = 15; +} + +// Artifacts of resources. Artifacts are unique (single-value) per resource +// and are used to store metadata that is too large or numerous to be stored +// directly on the resource. Since artifacts are stored separately from parent +// resources, they should generally be used for metadata that is needed +// infrequently, i.e., not for display in primary views of the resource but +// perhaps displayed or downloaded upon request. The `ListArtifacts` method +// allows artifacts to be quickly enumerated and checked for presence without +// downloading their (potentially-large) contents. +message Artifact { + option (google.api.resource) = { + type: "apigeeregistry.googleapis.com/Artifact" + pattern: "projects/{project}/locations/{location}/artifacts/{artifact}" + pattern: "projects/{project}/locations/{location}/apis/{api}/artifacts/{artifact}" + pattern: "projects/{project}/locations/{location}/apis/{api}/versions/{version}/artifacts/{artifact}" + pattern: "projects/{project}/locations/{location}/apis/{api}/versions/{version}/specs/{spec}/artifacts/{artifact}" + pattern: "projects/{project}/locations/{location}/apis/{api}/deployments/{deployment}/artifacts/{artifact}" + }; + + // Resource name. + string name = 1; + + // Output only. Creation timestamp. + google.protobuf.Timestamp create_time = 2 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Last update timestamp. + google.protobuf.Timestamp update_time = 3 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // A content type specifier for the artifact. + // Content type specifiers are Media Types + // (https://en.wikipedia.org/wiki/Media_type) with a possible "schema" + // parameter that specifies a schema for the stored information. + // Content types can specify compression. Currently only GZip compression is + // supported (indicated with "+gzip"). + string mime_type = 4; + + // Output only. The size of the artifact in bytes. If the artifact is gzipped, this is + // the size of the uncompressed artifact. + int32 size_bytes = 5 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. A SHA-256 hash of the artifact's contents. If the artifact is gzipped, + // this is the hash of the uncompressed artifact. + string hash = 6 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Input only. The contents of the artifact. + // Provided by API callers when artifacts are created or replaced. + // To access the contents of an artifact, use GetArtifactContents. + bytes contents = 7 [(google.api.field_behavior) = INPUT_ONLY]; +} diff --git a/packages/google-cloud-apigeeregistry/protos/google/cloud/apigeeregistry/v1/registry_service.proto b/packages/google-cloud-apigeeregistry/protos/google/cloud/apigeeregistry/v1/registry_service.proto new file mode 100644 index 00000000000..041796be41f --- /dev/null +++ b/packages/google-cloud-apigeeregistry/protos/google/cloud/apigeeregistry/v1/registry_service.proto @@ -0,0 +1,1133 @@ +// 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. + +syntax = "proto3"; + +package google.cloud.apigeeregistry.v1; + +import "google/api/annotations.proto"; +import "google/api/client.proto"; +import "google/api/field_behavior.proto"; +import "google/api/httpbody.proto"; +import "google/api/resource.proto"; +import "google/cloud/apigeeregistry/v1/registry_models.proto"; +import "google/protobuf/empty.proto"; +import "google/protobuf/field_mask.proto"; + +option csharp_namespace = "Google.Cloud.ApigeeRegistry.V1"; +option go_package = "cloud.google.com/go/apigeeregistry/apiv1/apigeeregistrypb;apigeeregistrypb"; +option java_multiple_files = true; +option java_outer_classname = "RegistryServiceProto"; +option java_package = "com.google.cloud.apigeeregistry.v1"; +option php_namespace = "Google\\Cloud\\ApigeeRegistry\\V1"; +option ruby_package = "Google::Cloud::ApigeeRegistry::V1"; + +// The Registry service allows teams to manage descriptions of APIs. +service Registry { + option (google.api.default_host) = "apigeeregistry.googleapis.com"; + option (google.api.oauth_scopes) = "https://www.googleapis.com/auth/cloud-platform"; + + // Returns matching APIs. + rpc ListApis(ListApisRequest) returns (ListApisResponse) { + option (google.api.http) = { + get: "/v1/{parent=projects/*/locations/*}/apis" + }; + option (google.api.method_signature) = "parent"; + } + + // Returns a specified API. + rpc GetApi(GetApiRequest) returns (Api) { + option (google.api.http) = { + get: "/v1/{name=projects/*/locations/*/apis/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Creates a specified API. + rpc CreateApi(CreateApiRequest) returns (Api) { + option (google.api.http) = { + post: "/v1/{parent=projects/*/locations/*}/apis" + body: "api" + }; + option (google.api.method_signature) = "parent,api,api_id"; + } + + // Used to modify a specified API. + rpc UpdateApi(UpdateApiRequest) returns (Api) { + option (google.api.http) = { + patch: "/v1/{api.name=projects/*/locations/*/apis/*}" + body: "api" + }; + option (google.api.method_signature) = "api,update_mask"; + } + + // Removes a specified API and all of the resources that it + // owns. + rpc DeleteApi(DeleteApiRequest) returns (google.protobuf.Empty) { + option (google.api.http) = { + delete: "/v1/{name=projects/*/locations/*/apis/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Returns matching versions. + rpc ListApiVersions(ListApiVersionsRequest) returns (ListApiVersionsResponse) { + option (google.api.http) = { + get: "/v1/{parent=projects/*/locations/*/apis/*}/versions" + }; + option (google.api.method_signature) = "parent"; + } + + // Returns a specified version. + rpc GetApiVersion(GetApiVersionRequest) returns (ApiVersion) { + option (google.api.http) = { + get: "/v1/{name=projects/*/locations/*/apis/*/versions/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Creates a specified version. + rpc CreateApiVersion(CreateApiVersionRequest) returns (ApiVersion) { + option (google.api.http) = { + post: "/v1/{parent=projects/*/locations/*/apis/*}/versions" + body: "api_version" + }; + option (google.api.method_signature) = "parent,api_version,api_version_id"; + } + + // Used to modify a specified version. + rpc UpdateApiVersion(UpdateApiVersionRequest) returns (ApiVersion) { + option (google.api.http) = { + patch: "/v1/{api_version.name=projects/*/locations/*/apis/*/versions/*}" + body: "api_version" + }; + option (google.api.method_signature) = "api_version,update_mask"; + } + + // Removes a specified version and all of the resources that + // it owns. + rpc DeleteApiVersion(DeleteApiVersionRequest) returns (google.protobuf.Empty) { + option (google.api.http) = { + delete: "/v1/{name=projects/*/locations/*/apis/*/versions/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Returns matching specs. + rpc ListApiSpecs(ListApiSpecsRequest) returns (ListApiSpecsResponse) { + option (google.api.http) = { + get: "/v1/{parent=projects/*/locations/*/apis/*/versions/*}/specs" + }; + option (google.api.method_signature) = "parent"; + } + + // Returns a specified spec. + rpc GetApiSpec(GetApiSpecRequest) returns (ApiSpec) { + option (google.api.http) = { + get: "/v1/{name=projects/*/locations/*/apis/*/versions/*/specs/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Returns the contents of a specified spec. + // If specs are stored with GZip compression, the default behavior + // is to return the spec uncompressed (the mime_type response field + // indicates the exact format returned). + rpc GetApiSpecContents(GetApiSpecContentsRequest) returns (google.api.HttpBody) { + option (google.api.http) = { + get: "/v1/{name=projects/*/locations/*/apis/*/versions/*/specs/*}:getContents" + }; + option (google.api.method_signature) = "name"; + } + + // Creates a specified spec. + rpc CreateApiSpec(CreateApiSpecRequest) returns (ApiSpec) { + option (google.api.http) = { + post: "/v1/{parent=projects/*/locations/*/apis/*/versions/*}/specs" + body: "api_spec" + }; + option (google.api.method_signature) = "parent,api_spec,api_spec_id"; + } + + // Used to modify a specified spec. + rpc UpdateApiSpec(UpdateApiSpecRequest) returns (ApiSpec) { + option (google.api.http) = { + patch: "/v1/{api_spec.name=projects/*/locations/*/apis/*/versions/*/specs/*}" + body: "api_spec" + }; + option (google.api.method_signature) = "api_spec,update_mask"; + } + + // Removes a specified spec, all revisions, and all child + // resources (e.g., artifacts). + rpc DeleteApiSpec(DeleteApiSpecRequest) returns (google.protobuf.Empty) { + option (google.api.http) = { + delete: "/v1/{name=projects/*/locations/*/apis/*/versions/*/specs/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Adds a tag to a specified revision of a spec. + rpc TagApiSpecRevision(TagApiSpecRevisionRequest) returns (ApiSpec) { + option (google.api.http) = { + post: "/v1/{name=projects/*/locations/*/apis/*/versions/*/specs/*}:tagRevision" + body: "*" + }; + } + + // Lists all revisions of a spec. + // Revisions are returned in descending order of revision creation time. + rpc ListApiSpecRevisions(ListApiSpecRevisionsRequest) returns (ListApiSpecRevisionsResponse) { + option (google.api.http) = { + get: "/v1/{name=projects/*/locations/*/apis/*/versions/*/specs/*}:listRevisions" + }; + } + + // Sets the current revision to a specified prior revision. + // Note that this creates a new revision with a new revision ID. + rpc RollbackApiSpec(RollbackApiSpecRequest) returns (ApiSpec) { + option (google.api.http) = { + post: "/v1/{name=projects/*/locations/*/apis/*/versions/*/specs/*}:rollback" + body: "*" + }; + } + + // Deletes a revision of a spec. + rpc DeleteApiSpecRevision(DeleteApiSpecRevisionRequest) returns (ApiSpec) { + option (google.api.http) = { + delete: "/v1/{name=projects/*/locations/*/apis/*/versions/*/specs/*}:deleteRevision" + }; + option (google.api.method_signature) = "name"; + } + + // Returns matching deployments. + rpc ListApiDeployments(ListApiDeploymentsRequest) returns (ListApiDeploymentsResponse) { + option (google.api.http) = { + get: "/v1/{parent=projects/*/locations/*/apis/*}/deployments" + }; + option (google.api.method_signature) = "parent"; + } + + // Returns a specified deployment. + rpc GetApiDeployment(GetApiDeploymentRequest) returns (ApiDeployment) { + option (google.api.http) = { + get: "/v1/{name=projects/*/locations/*/apis/*/deployments/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Creates a specified deployment. + rpc CreateApiDeployment(CreateApiDeploymentRequest) returns (ApiDeployment) { + option (google.api.http) = { + post: "/v1/{parent=projects/*/locations/*/apis/*}/deployments" + body: "api_deployment" + }; + option (google.api.method_signature) = "parent,api_deployment,api_deployment_id"; + } + + // Used to modify a specified deployment. + rpc UpdateApiDeployment(UpdateApiDeploymentRequest) returns (ApiDeployment) { + option (google.api.http) = { + patch: "/v1/{api_deployment.name=projects/*/locations/*/apis/*/deployments/*}" + body: "api_deployment" + }; + option (google.api.method_signature) = "api_deployment,update_mask"; + } + + // Removes a specified deployment, all revisions, and all + // child resources (e.g., artifacts). + rpc DeleteApiDeployment(DeleteApiDeploymentRequest) returns (google.protobuf.Empty) { + option (google.api.http) = { + delete: "/v1/{name=projects/*/locations/*/apis/*/deployments/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Adds a tag to a specified revision of a + // deployment. + rpc TagApiDeploymentRevision(TagApiDeploymentRevisionRequest) returns (ApiDeployment) { + option (google.api.http) = { + post: "/v1/{name=projects/*/locations/*/apis/*/deployments/*}:tagRevision" + body: "*" + }; + } + + // Lists all revisions of a deployment. + // Revisions are returned in descending order of revision creation time. + rpc ListApiDeploymentRevisions(ListApiDeploymentRevisionsRequest) returns (ListApiDeploymentRevisionsResponse) { + option (google.api.http) = { + get: "/v1/{name=projects/*/locations/*/apis/*/deployments/*}:listRevisions" + }; + } + + // Sets the current revision to a specified prior + // revision. Note that this creates a new revision with a new revision ID. + rpc RollbackApiDeployment(RollbackApiDeploymentRequest) returns (ApiDeployment) { + option (google.api.http) = { + post: "/v1/{name=projects/*/locations/*/apis/*/deployments/*}:rollback" + body: "*" + }; + } + + // Deletes a revision of a deployment. + rpc DeleteApiDeploymentRevision(DeleteApiDeploymentRevisionRequest) returns (ApiDeployment) { + option (google.api.http) = { + delete: "/v1/{name=projects/*/locations/*/apis/*/deployments/*}:deleteRevision" + }; + option (google.api.method_signature) = "name"; + } + + // Returns matching artifacts. + rpc ListArtifacts(ListArtifactsRequest) returns (ListArtifactsResponse) { + option (google.api.http) = { + get: "/v1/{parent=projects/*/locations/*}/artifacts" + additional_bindings { + get: "/v1/{parent=projects/*/locations/*/apis/*}/artifacts" + } + additional_bindings { + get: "/v1/{parent=projects/*/locations/*/apis/*/versions/*}/artifacts" + } + additional_bindings { + get: "/v1/{parent=projects/*/locations/*/apis/*/versions/*/specs/*}/artifacts" + } + additional_bindings { + get: "/v1/{parent=projects/*/locations/*/apis/*/deployments/*}/artifacts" + } + }; + option (google.api.method_signature) = "parent"; + } + + // Returns a specified artifact. + rpc GetArtifact(GetArtifactRequest) returns (Artifact) { + option (google.api.http) = { + get: "/v1/{name=projects/*/locations/*/artifacts/*}" + additional_bindings { + get: "/v1/{name=projects/*/locations/*/apis/*/artifacts/*}" + } + additional_bindings { + get: "/v1/{name=projects/*/locations/*/apis/*/versions/*/artifacts/*}" + } + additional_bindings { + get: "/v1/{name=projects/*/locations/*/apis/*/versions/*/specs/*/artifacts/*}" + } + additional_bindings { + get: "/v1/{name=projects/*/locations/*/apis/*/deployments/*/artifacts/*}" + } + }; + option (google.api.method_signature) = "name"; + } + + // Returns the contents of a specified artifact. + // If artifacts are stored with GZip compression, the default behavior + // is to return the artifact uncompressed (the mime_type response field + // indicates the exact format returned). + rpc GetArtifactContents(GetArtifactContentsRequest) returns (google.api.HttpBody) { + option (google.api.http) = { + get: "/v1/{name=projects/*/locations/*/artifacts/*}:getContents" + additional_bindings { + get: "/v1/{name=projects/*/locations/*/apis/*/artifacts/*}:getContents" + } + additional_bindings { + get: "/v1/{name=projects/*/locations/*/apis/*/versions/*/artifacts/*}:getContents" + } + additional_bindings { + get: "/v1/{name=projects/*/locations/*/apis/*/versions/*/specs/*/artifacts/*}:getContents" + } + additional_bindings { + get: "/v1/{name=projects/*/locations/*/apis/*/deployments/*/artifacts/*}:getContents" + } + }; + option (google.api.method_signature) = "name"; + } + + // Creates a specified artifact. + rpc CreateArtifact(CreateArtifactRequest) returns (Artifact) { + option (google.api.http) = { + post: "/v1/{parent=projects/*/locations/*}/artifacts" + body: "artifact" + additional_bindings { + post: "/v1/{parent=projects/*/locations/*/apis/*}/artifacts" + body: "artifact" + } + additional_bindings { + post: "/v1/{parent=projects/*/locations/*/apis/*/versions/*}/artifacts" + body: "artifact" + } + additional_bindings { + post: "/v1/{parent=projects/*/locations/*/apis/*/versions/*/specs/*}/artifacts" + body: "artifact" + } + additional_bindings { + post: "/v1/{parent=projects/*/locations/*/apis/*/deployments/*}/artifacts" + body: "artifact" + } + }; + option (google.api.method_signature) = "parent,artifact,artifact_id"; + } + + // Used to replace a specified artifact. + rpc ReplaceArtifact(ReplaceArtifactRequest) returns (Artifact) { + option (google.api.http) = { + put: "/v1/{artifact.name=projects/*/locations/*/artifacts/*}" + body: "artifact" + additional_bindings { + put: "/v1/{artifact.name=projects/*/locations/*/apis/*/artifacts/*}" + body: "artifact" + } + additional_bindings { + put: "/v1/{artifact.name=projects/*/locations/*/apis/*/versions/*/artifacts/*}" + body: "artifact" + } + additional_bindings { + put: "/v1/{artifact.name=projects/*/locations/*/apis/*/versions/*/specs/*/artifacts/*}" + body: "artifact" + } + additional_bindings { + put: "/v1/{artifact.name=projects/*/locations/*/apis/*/deployments/*/artifacts/*}" + body: "artifact" + } + }; + option (google.api.method_signature) = "artifact"; + } + + // Removes a specified artifact. + rpc DeleteArtifact(DeleteArtifactRequest) returns (google.protobuf.Empty) { + option (google.api.http) = { + delete: "/v1/{name=projects/*/locations/*/artifacts/*}" + additional_bindings { + delete: "/v1/{name=projects/*/locations/*/apis/*/artifacts/*}" + } + additional_bindings { + delete: "/v1/{name=projects/*/locations/*/apis/*/versions/*/artifacts/*}" + } + additional_bindings { + delete: "/v1/{name=projects/*/locations/*/apis/*/versions/*/specs/*/artifacts/*}" + } + additional_bindings { + delete: "/v1/{name=projects/*/locations/*/apis/*/deployments/*/artifacts/*}" + } + }; + option (google.api.method_signature) = "name"; + } +} + +// Request message for ListApis. +message ListApisRequest { + // Required. The parent, which owns this collection of APIs. + // Format: `projects/*/locations/*` + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "apigeeregistry.googleapis.com/Api" + } + ]; + + // The maximum number of APIs to return. + // The service may return fewer than this value. + // If unspecified, at most 50 values will be returned. + // The maximum is 1000; values above 1000 will be coerced to 1000. + int32 page_size = 2; + + // A page token, received from a previous `ListApis` call. + // Provide this to retrieve the subsequent page. + // + // When paginating, all other parameters provided to `ListApis` must match + // the call that provided the page token. + string page_token = 3; + + // An expression that can be used to filter the list. Filters use the Common + // Expression Language and can refer to all message fields. + string filter = 4; +} + +// Response message for ListApis. +message ListApisResponse { + // The APIs from the specified publisher. + repeated Api apis = 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; +} + +// Request message for GetApi. +message GetApiRequest { + // Required. The name of the API to retrieve. + // Format: `projects/*/locations/*/apis/*` + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "apigeeregistry.googleapis.com/Api" + } + ]; +} + +// Request message for CreateApi. +message CreateApiRequest { + // Required. The parent, which owns this collection of APIs. + // Format: `projects/*/locations/*` + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "apigeeregistry.googleapis.com/Api" + } + ]; + + // Required. The API to create. + Api api = 2 [(google.api.field_behavior) = REQUIRED]; + + // Required. The ID to use for the API, which will become the final component of + // the API's resource name. + // + // This value should be 4-63 characters, and valid characters + // are /[a-z][0-9]-/. + // + // Following AIP-162, IDs must not have the form of a UUID. + string api_id = 3 [(google.api.field_behavior) = REQUIRED]; +} + +// Request message for UpdateApi. +message UpdateApiRequest { + // Required. The API to update. + // + // The `name` field is used to identify the API to update. + // Format: `projects/*/locations/*/apis/*` + Api api = 1 [(google.api.field_behavior) = REQUIRED]; + + // The list of fields to be updated. If omitted, all fields are updated that + // are set in the request message (fields set to default values are ignored). + // If an asterisk "*" is specified, all fields are updated, including fields + // that are unspecified/default in the request. + google.protobuf.FieldMask update_mask = 2; + + // If set to true, and the API is not found, a new API will be created. + // In this situation, `update_mask` is ignored. + bool allow_missing = 3; +} + +// Request message for DeleteApi. +message DeleteApiRequest { + // Required. The name of the API to delete. + // Format: `projects/*/locations/*/apis/*` + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "apigeeregistry.googleapis.com/Api" + } + ]; + + // If set to true, any child resources will also be deleted. + // (Otherwise, the request will only work if there are no child resources.) + bool force = 2; +} + +// Request message for ListApiVersions. +message ListApiVersionsRequest { + // Required. The parent, which owns this collection of versions. + // Format: `projects/*/locations/*/apis/*` + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "apigeeregistry.googleapis.com/ApiVersion" + } + ]; + + // The maximum number of versions to return. + // The service may return fewer than this value. + // If unspecified, at most 50 values will be returned. + // The maximum is 1000; values above 1000 will be coerced to 1000. + int32 page_size = 2; + + // A page token, received from a previous `ListApiVersions` call. + // Provide this to retrieve the subsequent page. + // + // When paginating, all other parameters provided to `ListApiVersions` must + // match the call that provided the page token. + string page_token = 3; + + // An expression that can be used to filter the list. Filters use the Common + // Expression Language and can refer to all message fields. + string filter = 4; +} + +// Response message for ListApiVersions. +message ListApiVersionsResponse { + // The versions from the specified publisher. + repeated ApiVersion api_versions = 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; +} + +// Request message for GetApiVersion. +message GetApiVersionRequest { + // Required. The name of the version to retrieve. + // Format: `projects/*/locations/*/apis/*/versions/*` + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "apigeeregistry.googleapis.com/ApiVersion" + } + ]; +} + +// Request message for CreateApiVersion. +message CreateApiVersionRequest { + // Required. The parent, which owns this collection of versions. + // Format: `projects/*/locations/*/apis/*` + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "apigeeregistry.googleapis.com/ApiVersion" + } + ]; + + // Required. The version to create. + ApiVersion api_version = 2 [(google.api.field_behavior) = REQUIRED]; + + // Required. The ID to use for the version, which will become the final component of + // the version's resource name. + // + // This value should be 1-63 characters, and valid characters + // are /[a-z][0-9]-/. + // + // Following AIP-162, IDs must not have the form of a UUID. + string api_version_id = 3 [(google.api.field_behavior) = REQUIRED]; +} + +// Request message for UpdateApiVersion. +message UpdateApiVersionRequest { + // Required. The version to update. + // + // The `name` field is used to identify the version to update. + // Format: `projects/*/locations/*/apis/*/versions/*` + ApiVersion api_version = 1 [(google.api.field_behavior) = REQUIRED]; + + // The list of fields to be updated. If omitted, all fields are updated that + // are set in the request message (fields set to default values are ignored). + // If an asterisk "*" is specified, all fields are updated, including fields + // that are unspecified/default in the request. + google.protobuf.FieldMask update_mask = 2; + + // If set to true, and the version is not found, a new version will be + // created. In this situation, `update_mask` is ignored. + bool allow_missing = 3; +} + +// Request message for DeleteApiVersion. +message DeleteApiVersionRequest { + // Required. The name of the version to delete. + // Format: `projects/*/locations/*/apis/*/versions/*` + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "apigeeregistry.googleapis.com/ApiVersion" + } + ]; + + // If set to true, any child resources will also be deleted. + // (Otherwise, the request will only work if there are no child resources.) + bool force = 2; +} + +// Request message for ListApiSpecs. +message ListApiSpecsRequest { + // Required. The parent, which owns this collection of specs. + // Format: `projects/*/locations/*/apis/*/versions/*` + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "apigeeregistry.googleapis.com/ApiSpec" + } + ]; + + // The maximum number of specs to return. + // The service may return fewer than this value. + // If unspecified, at most 50 values will be returned. + // The maximum is 1000; values above 1000 will be coerced to 1000. + int32 page_size = 2; + + // A page token, received from a previous `ListApiSpecs` call. + // Provide this to retrieve the subsequent page. + // + // When paginating, all other parameters provided to `ListApiSpecs` must match + // the call that provided the page token. + string page_token = 3; + + // An expression that can be used to filter the list. Filters use the Common + // Expression Language and can refer to all message fields except contents. + string filter = 4; +} + +// Response message for ListApiSpecs. +message ListApiSpecsResponse { + // The specs from the specified publisher. + repeated ApiSpec api_specs = 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; +} + +// Request message for GetApiSpec. +message GetApiSpecRequest { + // Required. The name of the spec to retrieve. + // Format: `projects/*/locations/*/apis/*/versions/*/specs/*` + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "apigeeregistry.googleapis.com/ApiSpec" + } + ]; +} + +// Request message for GetApiSpecContents. +message GetApiSpecContentsRequest { + // Required. The name of the spec whose contents should be retrieved. + // Format: `projects/*/locations/*/apis/*/versions/*/specs/*` + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "apigeeregistry.googleapis.com/ApiSpec" + } + ]; +} + +// Request message for CreateApiSpec. +message CreateApiSpecRequest { + // Required. The parent, which owns this collection of specs. + // Format: `projects/*/locations/*/apis/*/versions/*` + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "apigeeregistry.googleapis.com/ApiSpec" + } + ]; + + // Required. The spec to create. + ApiSpec api_spec = 2 [(google.api.field_behavior) = REQUIRED]; + + // Required. The ID to use for the spec, which will become the final component of + // the spec's resource name. + // + // This value should be 4-63 characters, and valid characters + // are /[a-z][0-9]-/. + // + // Following AIP-162, IDs must not have the form of a UUID. + string api_spec_id = 3 [(google.api.field_behavior) = REQUIRED]; +} + +// Request message for UpdateApiSpec. +message UpdateApiSpecRequest { + // Required. The spec to update. + // + // The `name` field is used to identify the spec to update. + // Format: `projects/*/locations/*/apis/*/versions/*/specs/*` + ApiSpec api_spec = 1 [(google.api.field_behavior) = REQUIRED]; + + // The list of fields to be updated. If omitted, all fields are updated that + // are set in the request message (fields set to default values are ignored). + // If an asterisk "*" is specified, all fields are updated, including fields + // that are unspecified/default in the request. + google.protobuf.FieldMask update_mask = 2; + + // If set to true, and the spec is not found, a new spec will be created. + // In this situation, `update_mask` is ignored. + bool allow_missing = 3; +} + +// Request message for DeleteApiSpec. +message DeleteApiSpecRequest { + // Required. The name of the spec to delete. + // Format: `projects/*/locations/*/apis/*/versions/*/specs/*` + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "apigeeregistry.googleapis.com/ApiSpec" + } + ]; + + // If set to true, any child resources will also be deleted. + // (Otherwise, the request will only work if there are no child resources.) + bool force = 2; +} + +// Request message for TagApiSpecRevision. +message TagApiSpecRevisionRequest { + // Required. The name of the spec to be tagged, including the revision ID. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "apigeeregistry.googleapis.com/ApiSpec" + } + ]; + + // Required. The tag to apply. + // The tag should be at most 40 characters, and match `[a-z][a-z0-9-]{3,39}`. + string tag = 2 [(google.api.field_behavior) = REQUIRED]; +} + +// Request message for ListApiSpecRevisions. +message ListApiSpecRevisionsRequest { + // Required. The name of the spec to list revisions for. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "apigeeregistry.googleapis.com/ApiSpec" + } + ]; + + // The maximum number of revisions to return per page. + int32 page_size = 2; + + // The page token, received from a previous ListApiSpecRevisions call. + // Provide this to retrieve the subsequent page. + string page_token = 3; +} + +// Response message for ListApiSpecRevisionsResponse. +message ListApiSpecRevisionsResponse { + // The revisions of the spec. + repeated ApiSpec api_specs = 1; + + // A token that 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; +} + +// Request message for RollbackApiSpec. +message RollbackApiSpecRequest { + // Required. The spec being rolled back. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "apigeeregistry.googleapis.com/ApiSpec" + } + ]; + + // Required. The revision ID to roll back to. + // It must be a revision of the same spec. + // + // Example: `c7cfa2a8` + string revision_id = 2 [(google.api.field_behavior) = REQUIRED]; +} + +// Request message for DeleteApiSpecRevision. +message DeleteApiSpecRevisionRequest { + // Required. The name of the spec revision to be deleted, + // with a revision ID explicitly included. + // + // Example: + // `projects/sample/locations/global/apis/petstore/versions/1.0.0/specs/openapi.yaml@c7cfa2a8` + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "apigeeregistry.googleapis.com/ApiSpec" + } + ]; +} + +// Request message for ListApiDeployments. +message ListApiDeploymentsRequest { + // Required. The parent, which owns this collection of deployments. + // Format: `projects/*/locations/*/apis/*` + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "apigeeregistry.googleapis.com/ApiDeployment" + } + ]; + + // The maximum number of deployments to return. + // The service may return fewer than this value. + // If unspecified, at most 50 values will be returned. + // The maximum is 1000; values above 1000 will be coerced to 1000. + int32 page_size = 2; + + // A page token, received from a previous `ListApiDeployments` call. + // Provide this to retrieve the subsequent page. + // + // When paginating, all other parameters provided to `ListApiDeployments` must + // match the call that provided the page token. + string page_token = 3; + + // An expression that can be used to filter the list. Filters use the Common + // Expression Language and can refer to all message fields. + string filter = 4; +} + +// Response message for ListApiDeployments. +message ListApiDeploymentsResponse { + // The deployments from the specified publisher. + repeated ApiDeployment api_deployments = 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; +} + +// Request message for GetApiDeployment. +message GetApiDeploymentRequest { + // Required. The name of the deployment to retrieve. + // Format: `projects/*/locations/*/apis/*/deployments/*` + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "apigeeregistry.googleapis.com/ApiDeployment" + } + ]; +} + +// Request message for CreateApiDeployment. +message CreateApiDeploymentRequest { + // Required. The parent, which owns this collection of deployments. + // Format: `projects/*/locations/*/apis/*` + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "apigeeregistry.googleapis.com/ApiDeployment" + } + ]; + + // Required. The deployment to create. + ApiDeployment api_deployment = 2 [(google.api.field_behavior) = REQUIRED]; + + // Required. The ID to use for the deployment, which will become the final component of + // the deployment's resource name. + // + // This value should be 4-63 characters, and valid characters + // are /[a-z][0-9]-/. + // + // Following AIP-162, IDs must not have the form of a UUID. + string api_deployment_id = 3 [(google.api.field_behavior) = REQUIRED]; +} + +// Request message for UpdateApiDeployment. +message UpdateApiDeploymentRequest { + // Required. The deployment to update. + // + // The `name` field is used to identify the deployment to update. + // Format: `projects/*/locations/*/apis/*/deployments/*` + ApiDeployment api_deployment = 1 [(google.api.field_behavior) = REQUIRED]; + + // The list of fields to be updated. If omitted, all fields are updated that + // are set in the request message (fields set to default values are ignored). + // If an asterisk "*" is specified, all fields are updated, including fields + // that are unspecified/default in the request. + google.protobuf.FieldMask update_mask = 2; + + // If set to true, and the deployment is not found, a new deployment will be + // created. In this situation, `update_mask` is ignored. + bool allow_missing = 3; +} + +// Request message for DeleteApiDeployment. +message DeleteApiDeploymentRequest { + // Required. The name of the deployment to delete. + // Format: `projects/*/locations/*/apis/*/deployments/*` + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "apigeeregistry.googleapis.com/ApiDeployment" + } + ]; + + // If set to true, any child resources will also be deleted. + // (Otherwise, the request will only work if there are no child resources.) + bool force = 2; +} + +// Request message for TagApiDeploymentRevision. +message TagApiDeploymentRevisionRequest { + // Required. The name of the deployment to be tagged, including the revision ID. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "apigeeregistry.googleapis.com/ApiDeployment" + } + ]; + + // Required. The tag to apply. + // The tag should be at most 40 characters, and match `[a-z][a-z0-9-]{3,39}`. + string tag = 2 [(google.api.field_behavior) = REQUIRED]; +} + +// Request message for ListApiDeploymentRevisions. +message ListApiDeploymentRevisionsRequest { + // Required. The name of the deployment to list revisions for. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "apigeeregistry.googleapis.com/ApiDeployment" + } + ]; + + // The maximum number of revisions to return per page. + int32 page_size = 2; + + // The page token, received from a previous ListApiDeploymentRevisions call. + // Provide this to retrieve the subsequent page. + string page_token = 3; +} + +// Response message for ListApiDeploymentRevisionsResponse. +message ListApiDeploymentRevisionsResponse { + // The revisions of the deployment. + repeated ApiDeployment api_deployments = 1; + + // A token that 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; +} + +// Request message for RollbackApiDeployment. +message RollbackApiDeploymentRequest { + // Required. The deployment being rolled back. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "apigeeregistry.googleapis.com/ApiDeployment" + } + ]; + + // Required. The revision ID to roll back to. + // It must be a revision of the same deployment. + // + // Example: `c7cfa2a8` + string revision_id = 2 [(google.api.field_behavior) = REQUIRED]; +} + +// Request message for DeleteApiDeploymentRevision. +message DeleteApiDeploymentRevisionRequest { + // Required. The name of the deployment revision to be deleted, + // with a revision ID explicitly included. + // + // Example: + // `projects/sample/locations/global/apis/petstore/deployments/prod@c7cfa2a8` + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "apigeeregistry.googleapis.com/ApiDeployment" + } + ]; +} + +// Request message for ListArtifacts. +message ListArtifactsRequest { + // Required. The parent, which owns this collection of artifacts. + // Format: `{parent}` + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "apigeeregistry.googleapis.com/Artifact" + } + ]; + + // The maximum number of artifacts to return. + // The service may return fewer than this value. + // If unspecified, at most 50 values will be returned. + // The maximum is 1000; values above 1000 will be coerced to 1000. + int32 page_size = 2; + + // A page token, received from a previous `ListArtifacts` call. + // Provide this to retrieve the subsequent page. + // + // When paginating, all other parameters provided to `ListArtifacts` must + // match the call that provided the page token. + string page_token = 3; + + // An expression that can be used to filter the list. Filters use the Common + // Expression Language and can refer to all message fields except contents. + string filter = 4; +} + +// Response message for ListArtifacts. +message ListArtifactsResponse { + // The artifacts from the specified publisher. + repeated Artifact artifacts = 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; +} + +// Request message for GetArtifact. +message GetArtifactRequest { + // Required. The name of the artifact to retrieve. + // Format: `{parent}/artifacts/*` + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "apigeeregistry.googleapis.com/Artifact" + } + ]; +} + +// Request message for GetArtifactContents. +message GetArtifactContentsRequest { + // Required. The name of the artifact whose contents should be retrieved. + // Format: `{parent}/artifacts/*` + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "apigeeregistry.googleapis.com/Artifact" + } + ]; +} + +// Request message for CreateArtifact. +message CreateArtifactRequest { + // Required. The parent, which owns this collection of artifacts. + // Format: `{parent}` + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "apigeeregistry.googleapis.com/Artifact" + } + ]; + + // Required. The artifact to create. + Artifact artifact = 2 [(google.api.field_behavior) = REQUIRED]; + + // Required. The ID to use for the artifact, which will become the final component of + // the artifact's resource name. + // + // This value should be 4-63 characters, and valid characters + // are /[a-z][0-9]-/. + // + // Following AIP-162, IDs must not have the form of a UUID. + string artifact_id = 3 [(google.api.field_behavior) = REQUIRED]; +} + +// Request message for ReplaceArtifact. +message ReplaceArtifactRequest { + // Required. The artifact to replace. + // + // The `name` field is used to identify the artifact to replace. + // Format: `{parent}/artifacts/*` + Artifact artifact = 1 [(google.api.field_behavior) = REQUIRED]; +} + +// Request message for DeleteArtifact. +message DeleteArtifactRequest { + // Required. The name of the artifact to delete. + // Format: `{parent}/artifacts/*` + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "apigeeregistry.googleapis.com/Artifact" + } + ]; +} diff --git a/packages/google-cloud-apigeeregistry/protos/protos.d.ts b/packages/google-cloud-apigeeregistry/protos/protos.d.ts new file mode 100644 index 00000000000..8a72b619b04 --- /dev/null +++ b/packages/google-cloud-apigeeregistry/protos/protos.d.ts @@ -0,0 +1,13878 @@ +// Copyright 2023 Google LLC +// +// Licensed under the Apache License, Version 2.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 apigeeregistry. */ + namespace apigeeregistry { + + /** Namespace v1. */ + namespace v1 { + + /** Represents a Provisioning */ + class Provisioning extends $protobuf.rpc.Service { + + /** + * Constructs a new Provisioning 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 Provisioning 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): Provisioning; + + /** + * Calls CreateInstance. + * @param request CreateInstanceRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public createInstance(request: google.cloud.apigeeregistry.v1.ICreateInstanceRequest, callback: google.cloud.apigeeregistry.v1.Provisioning.CreateInstanceCallback): void; + + /** + * Calls CreateInstance. + * @param request CreateInstanceRequest message or plain object + * @returns Promise + */ + public createInstance(request: google.cloud.apigeeregistry.v1.ICreateInstanceRequest): Promise; + + /** + * Calls DeleteInstance. + * @param request DeleteInstanceRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public deleteInstance(request: google.cloud.apigeeregistry.v1.IDeleteInstanceRequest, callback: google.cloud.apigeeregistry.v1.Provisioning.DeleteInstanceCallback): void; + + /** + * Calls DeleteInstance. + * @param request DeleteInstanceRequest message or plain object + * @returns Promise + */ + public deleteInstance(request: google.cloud.apigeeregistry.v1.IDeleteInstanceRequest): Promise; + + /** + * Calls GetInstance. + * @param request GetInstanceRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Instance + */ + public getInstance(request: google.cloud.apigeeregistry.v1.IGetInstanceRequest, callback: google.cloud.apigeeregistry.v1.Provisioning.GetInstanceCallback): void; + + /** + * Calls GetInstance. + * @param request GetInstanceRequest message or plain object + * @returns Promise + */ + public getInstance(request: google.cloud.apigeeregistry.v1.IGetInstanceRequest): Promise; + } + + namespace Provisioning { + + /** + * Callback as used by {@link google.cloud.apigeeregistry.v1.Provisioning|createInstance}. + * @param error Error, if any + * @param [response] Operation + */ + type CreateInstanceCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.cloud.apigeeregistry.v1.Provisioning|deleteInstance}. + * @param error Error, if any + * @param [response] Operation + */ + type DeleteInstanceCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.cloud.apigeeregistry.v1.Provisioning|getInstance}. + * @param error Error, if any + * @param [response] Instance + */ + type GetInstanceCallback = (error: (Error|null), response?: google.cloud.apigeeregistry.v1.Instance) => void; + } + + /** Properties of a CreateInstanceRequest. */ + interface ICreateInstanceRequest { + + /** CreateInstanceRequest parent */ + parent?: (string|null); + + /** CreateInstanceRequest instanceId */ + instanceId?: (string|null); + + /** CreateInstanceRequest instance */ + instance?: (google.cloud.apigeeregistry.v1.IInstance|null); + } + + /** Represents a CreateInstanceRequest. */ + class CreateInstanceRequest implements ICreateInstanceRequest { + + /** + * Constructs a new CreateInstanceRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.apigeeregistry.v1.ICreateInstanceRequest); + + /** CreateInstanceRequest parent. */ + public parent: string; + + /** CreateInstanceRequest instanceId. */ + public instanceId: string; + + /** CreateInstanceRequest instance. */ + public instance?: (google.cloud.apigeeregistry.v1.IInstance|null); + + /** + * Creates a new CreateInstanceRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns CreateInstanceRequest instance + */ + public static create(properties?: google.cloud.apigeeregistry.v1.ICreateInstanceRequest): google.cloud.apigeeregistry.v1.CreateInstanceRequest; + + /** + * Encodes the specified CreateInstanceRequest message. Does not implicitly {@link google.cloud.apigeeregistry.v1.CreateInstanceRequest.verify|verify} messages. + * @param message CreateInstanceRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.apigeeregistry.v1.ICreateInstanceRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CreateInstanceRequest message, length delimited. Does not implicitly {@link google.cloud.apigeeregistry.v1.CreateInstanceRequest.verify|verify} messages. + * @param message CreateInstanceRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.apigeeregistry.v1.ICreateInstanceRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CreateInstanceRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CreateInstanceRequest + * @throws {Error} If the payload is not 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.apigeeregistry.v1.CreateInstanceRequest; + + /** + * Decodes a CreateInstanceRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CreateInstanceRequest + * @throws {Error} If the payload 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.apigeeregistry.v1.CreateInstanceRequest; + + /** + * Verifies a CreateInstanceRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CreateInstanceRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CreateInstanceRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.apigeeregistry.v1.CreateInstanceRequest; + + /** + * Creates a plain object from a CreateInstanceRequest message. Also converts values to other types if specified. + * @param message CreateInstanceRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.apigeeregistry.v1.CreateInstanceRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CreateInstanceRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CreateInstanceRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a DeleteInstanceRequest. */ + interface IDeleteInstanceRequest { + + /** DeleteInstanceRequest name */ + name?: (string|null); + } + + /** Represents a DeleteInstanceRequest. */ + class DeleteInstanceRequest implements IDeleteInstanceRequest { + + /** + * Constructs a new DeleteInstanceRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.apigeeregistry.v1.IDeleteInstanceRequest); + + /** DeleteInstanceRequest name. */ + public name: string; + + /** + * Creates a new DeleteInstanceRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns DeleteInstanceRequest instance + */ + public static create(properties?: google.cloud.apigeeregistry.v1.IDeleteInstanceRequest): google.cloud.apigeeregistry.v1.DeleteInstanceRequest; + + /** + * Encodes the specified DeleteInstanceRequest message. Does not implicitly {@link google.cloud.apigeeregistry.v1.DeleteInstanceRequest.verify|verify} messages. + * @param message DeleteInstanceRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.apigeeregistry.v1.IDeleteInstanceRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DeleteInstanceRequest message, length delimited. Does not implicitly {@link google.cloud.apigeeregistry.v1.DeleteInstanceRequest.verify|verify} messages. + * @param message DeleteInstanceRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.apigeeregistry.v1.IDeleteInstanceRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DeleteInstanceRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DeleteInstanceRequest + * @throws {Error} If the payload is not 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.apigeeregistry.v1.DeleteInstanceRequest; + + /** + * Decodes a DeleteInstanceRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DeleteInstanceRequest + * @throws {Error} If the payload 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.apigeeregistry.v1.DeleteInstanceRequest; + + /** + * Verifies a DeleteInstanceRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DeleteInstanceRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DeleteInstanceRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.apigeeregistry.v1.DeleteInstanceRequest; + + /** + * Creates a plain object from a DeleteInstanceRequest message. Also converts values to other types if specified. + * @param message DeleteInstanceRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.apigeeregistry.v1.DeleteInstanceRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DeleteInstanceRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DeleteInstanceRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a GetInstanceRequest. */ + interface IGetInstanceRequest { + + /** GetInstanceRequest name */ + name?: (string|null); + } + + /** Represents a GetInstanceRequest. */ + class GetInstanceRequest implements IGetInstanceRequest { + + /** + * Constructs a new GetInstanceRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.apigeeregistry.v1.IGetInstanceRequest); + + /** GetInstanceRequest name. */ + public name: string; + + /** + * Creates a new GetInstanceRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GetInstanceRequest instance + */ + public static create(properties?: google.cloud.apigeeregistry.v1.IGetInstanceRequest): google.cloud.apigeeregistry.v1.GetInstanceRequest; + + /** + * Encodes the specified GetInstanceRequest message. Does not implicitly {@link google.cloud.apigeeregistry.v1.GetInstanceRequest.verify|verify} messages. + * @param message GetInstanceRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.apigeeregistry.v1.IGetInstanceRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GetInstanceRequest message, length delimited. Does not implicitly {@link google.cloud.apigeeregistry.v1.GetInstanceRequest.verify|verify} messages. + * @param message GetInstanceRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.apigeeregistry.v1.IGetInstanceRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GetInstanceRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GetInstanceRequest + * @throws {Error} If the payload is not 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.apigeeregistry.v1.GetInstanceRequest; + + /** + * Decodes a GetInstanceRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GetInstanceRequest + * @throws {Error} If the payload 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.apigeeregistry.v1.GetInstanceRequest; + + /** + * Verifies a GetInstanceRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GetInstanceRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GetInstanceRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.apigeeregistry.v1.GetInstanceRequest; + + /** + * Creates a plain object from a GetInstanceRequest message. Also converts values to other types if specified. + * @param message GetInstanceRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.apigeeregistry.v1.GetInstanceRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GetInstanceRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GetInstanceRequest + * @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 endTime */ + endTime?: (google.protobuf.ITimestamp|null); + + /** OperationMetadata target */ + target?: (string|null); + + /** OperationMetadata verb */ + verb?: (string|null); + + /** OperationMetadata statusMessage */ + statusMessage?: (string|null); + + /** OperationMetadata cancellationRequested */ + cancellationRequested?: (boolean|null); + + /** OperationMetadata apiVersion */ + apiVersion?: (string|null); + } + + /** Represents an OperationMetadata. */ + class OperationMetadata implements IOperationMetadata { + + /** + * Constructs a new OperationMetadata. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.apigeeregistry.v1.IOperationMetadata); + + /** OperationMetadata createTime. */ + public createTime?: (google.protobuf.ITimestamp|null); + + /** OperationMetadata endTime. */ + public endTime?: (google.protobuf.ITimestamp|null); + + /** OperationMetadata target. */ + public target: string; + + /** OperationMetadata verb. */ + public verb: string; + + /** OperationMetadata statusMessage. */ + public statusMessage: string; + + /** OperationMetadata cancellationRequested. */ + public cancellationRequested: boolean; + + /** OperationMetadata apiVersion. */ + public apiVersion: string; + + /** + * Creates a new OperationMetadata instance using the specified properties. + * @param [properties] Properties to set + * @returns OperationMetadata instance + */ + public static create(properties?: google.cloud.apigeeregistry.v1.IOperationMetadata): google.cloud.apigeeregistry.v1.OperationMetadata; + + /** + * Encodes the specified OperationMetadata message. Does not implicitly {@link google.cloud.apigeeregistry.v1.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.apigeeregistry.v1.IOperationMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified OperationMetadata message, length delimited. Does not implicitly {@link google.cloud.apigeeregistry.v1.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.apigeeregistry.v1.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.apigeeregistry.v1.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.apigeeregistry.v1.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.apigeeregistry.v1.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.apigeeregistry.v1.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 an Instance. */ + interface IInstance { + + /** Instance name */ + name?: (string|null); + + /** Instance createTime */ + createTime?: (google.protobuf.ITimestamp|null); + + /** Instance updateTime */ + updateTime?: (google.protobuf.ITimestamp|null); + + /** Instance state */ + state?: (google.cloud.apigeeregistry.v1.Instance.State|keyof typeof google.cloud.apigeeregistry.v1.Instance.State|null); + + /** Instance stateMessage */ + stateMessage?: (string|null); + + /** Instance config */ + config?: (google.cloud.apigeeregistry.v1.Instance.IConfig|null); + } + + /** Represents an Instance. */ + class Instance implements IInstance { + + /** + * Constructs a new Instance. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.apigeeregistry.v1.IInstance); + + /** Instance name. */ + public name: string; + + /** Instance createTime. */ + public createTime?: (google.protobuf.ITimestamp|null); + + /** Instance updateTime. */ + public updateTime?: (google.protobuf.ITimestamp|null); + + /** Instance state. */ + public state: (google.cloud.apigeeregistry.v1.Instance.State|keyof typeof google.cloud.apigeeregistry.v1.Instance.State); + + /** Instance stateMessage. */ + public stateMessage: string; + + /** Instance config. */ + public config?: (google.cloud.apigeeregistry.v1.Instance.IConfig|null); + + /** + * Creates a new Instance instance using the specified properties. + * @param [properties] Properties to set + * @returns Instance instance + */ + public static create(properties?: google.cloud.apigeeregistry.v1.IInstance): google.cloud.apigeeregistry.v1.Instance; + + /** + * Encodes the specified Instance message. Does not implicitly {@link google.cloud.apigeeregistry.v1.Instance.verify|verify} messages. + * @param message Instance message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.apigeeregistry.v1.IInstance, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Instance message, length delimited. Does not implicitly {@link google.cloud.apigeeregistry.v1.Instance.verify|verify} messages. + * @param message Instance message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.apigeeregistry.v1.IInstance, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an Instance message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Instance + * @throws {Error} If the payload is not 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.apigeeregistry.v1.Instance; + + /** + * Decodes an Instance message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Instance + * @throws {Error} If the payload 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.apigeeregistry.v1.Instance; + + /** + * Verifies an Instance message. + * @param message Plain 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 Instance message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Instance + */ + public static fromObject(object: { [k: string]: any }): google.cloud.apigeeregistry.v1.Instance; + + /** + * Creates a plain object from an Instance message. Also converts values to other types if specified. + * @param message Instance + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.apigeeregistry.v1.Instance, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Instance to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Instance + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace Instance { + + /** State enum. */ + enum State { + STATE_UNSPECIFIED = 0, + INACTIVE = 1, + CREATING = 2, + ACTIVE = 3, + UPDATING = 4, + DELETING = 5, + FAILED = 6 + } + + /** Properties of a Config. */ + interface IConfig { + + /** Config location */ + location?: (string|null); + + /** Config cmekKeyName */ + cmekKeyName?: (string|null); + } + + /** Represents a Config. */ + class Config implements IConfig { + + /** + * Constructs a new Config. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.apigeeregistry.v1.Instance.IConfig); + + /** Config location. */ + public location: string; + + /** Config cmekKeyName. */ + public cmekKeyName: string; + + /** + * Creates a new Config instance using the specified properties. + * @param [properties] Properties to set + * @returns Config instance + */ + public static create(properties?: google.cloud.apigeeregistry.v1.Instance.IConfig): google.cloud.apigeeregistry.v1.Instance.Config; + + /** + * Encodes the specified Config message. Does not implicitly {@link google.cloud.apigeeregistry.v1.Instance.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.apigeeregistry.v1.Instance.IConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Config message, length delimited. Does not implicitly {@link google.cloud.apigeeregistry.v1.Instance.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.apigeeregistry.v1.Instance.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.apigeeregistry.v1.Instance.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.apigeeregistry.v1.Instance.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.apigeeregistry.v1.Instance.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.apigeeregistry.v1.Instance.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 an Api. */ + interface IApi { + + /** Api name */ + name?: (string|null); + + /** Api displayName */ + displayName?: (string|null); + + /** Api description */ + description?: (string|null); + + /** Api createTime */ + createTime?: (google.protobuf.ITimestamp|null); + + /** Api updateTime */ + updateTime?: (google.protobuf.ITimestamp|null); + + /** Api availability */ + availability?: (string|null); + + /** Api recommendedVersion */ + recommendedVersion?: (string|null); + + /** Api recommendedDeployment */ + recommendedDeployment?: (string|null); + + /** Api labels */ + labels?: ({ [k: string]: string }|null); + + /** Api annotations */ + annotations?: ({ [k: string]: string }|null); + } + + /** Represents an Api. */ + class Api implements IApi { + + /** + * Constructs a new Api. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.apigeeregistry.v1.IApi); + + /** Api name. */ + public name: string; + + /** Api displayName. */ + public displayName: string; + + /** Api description. */ + public description: string; + + /** Api createTime. */ + public createTime?: (google.protobuf.ITimestamp|null); + + /** Api updateTime. */ + public updateTime?: (google.protobuf.ITimestamp|null); + + /** Api availability. */ + public availability: string; + + /** Api recommendedVersion. */ + public recommendedVersion: string; + + /** Api recommendedDeployment. */ + public recommendedDeployment: string; + + /** Api labels. */ + public labels: { [k: string]: string }; + + /** Api annotations. */ + public annotations: { [k: string]: string }; + + /** + * Creates a new Api instance using the specified properties. + * @param [properties] Properties to set + * @returns Api instance + */ + public static create(properties?: google.cloud.apigeeregistry.v1.IApi): google.cloud.apigeeregistry.v1.Api; + + /** + * Encodes the specified Api message. Does not implicitly {@link google.cloud.apigeeregistry.v1.Api.verify|verify} messages. + * @param message Api message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.apigeeregistry.v1.IApi, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Api message, length delimited. Does not implicitly {@link google.cloud.apigeeregistry.v1.Api.verify|verify} messages. + * @param message Api message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.apigeeregistry.v1.IApi, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an Api message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Api + * @throws {Error} If the payload is not 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.apigeeregistry.v1.Api; + + /** + * Decodes an Api message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Api + * @throws {Error} If the payload 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.apigeeregistry.v1.Api; + + /** + * Verifies an Api message. + * @param message Plain 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 Api message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Api + */ + public static fromObject(object: { [k: string]: any }): google.cloud.apigeeregistry.v1.Api; + + /** + * Creates a plain object from an Api message. Also converts values to other types if specified. + * @param message Api + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.apigeeregistry.v1.Api, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Api to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Api + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an ApiVersion. */ + interface IApiVersion { + + /** ApiVersion name */ + name?: (string|null); + + /** ApiVersion displayName */ + displayName?: (string|null); + + /** ApiVersion description */ + description?: (string|null); + + /** ApiVersion createTime */ + createTime?: (google.protobuf.ITimestamp|null); + + /** ApiVersion updateTime */ + updateTime?: (google.protobuf.ITimestamp|null); + + /** ApiVersion state */ + state?: (string|null); + + /** ApiVersion labels */ + labels?: ({ [k: string]: string }|null); + + /** ApiVersion annotations */ + annotations?: ({ [k: string]: string }|null); + } + + /** Represents an ApiVersion. */ + class ApiVersion implements IApiVersion { + + /** + * Constructs a new ApiVersion. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.apigeeregistry.v1.IApiVersion); + + /** ApiVersion name. */ + public name: string; + + /** ApiVersion displayName. */ + public displayName: string; + + /** ApiVersion description. */ + public description: string; + + /** ApiVersion createTime. */ + public createTime?: (google.protobuf.ITimestamp|null); + + /** ApiVersion updateTime. */ + public updateTime?: (google.protobuf.ITimestamp|null); + + /** ApiVersion state. */ + public state: string; + + /** ApiVersion labels. */ + public labels: { [k: string]: string }; + + /** ApiVersion annotations. */ + public annotations: { [k: string]: string }; + + /** + * Creates a new ApiVersion instance using the specified properties. + * @param [properties] Properties to set + * @returns ApiVersion instance + */ + public static create(properties?: google.cloud.apigeeregistry.v1.IApiVersion): google.cloud.apigeeregistry.v1.ApiVersion; + + /** + * Encodes the specified ApiVersion message. Does not implicitly {@link google.cloud.apigeeregistry.v1.ApiVersion.verify|verify} messages. + * @param message ApiVersion message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.apigeeregistry.v1.IApiVersion, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ApiVersion message, length delimited. Does not implicitly {@link google.cloud.apigeeregistry.v1.ApiVersion.verify|verify} messages. + * @param message ApiVersion message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.apigeeregistry.v1.IApiVersion, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an ApiVersion message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ApiVersion + * @throws {Error} If the payload is not 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.apigeeregistry.v1.ApiVersion; + + /** + * Decodes an ApiVersion message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ApiVersion + * @throws {Error} If the payload 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.apigeeregistry.v1.ApiVersion; + + /** + * Verifies an ApiVersion message. + * @param message Plain 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 ApiVersion message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ApiVersion + */ + public static fromObject(object: { [k: string]: any }): google.cloud.apigeeregistry.v1.ApiVersion; + + /** + * Creates a plain object from an ApiVersion message. Also converts values to other types if specified. + * @param message ApiVersion + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.apigeeregistry.v1.ApiVersion, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ApiVersion to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ApiVersion + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an ApiSpec. */ + interface IApiSpec { + + /** ApiSpec name */ + name?: (string|null); + + /** ApiSpec filename */ + filename?: (string|null); + + /** ApiSpec description */ + description?: (string|null); + + /** ApiSpec revisionId */ + revisionId?: (string|null); + + /** ApiSpec createTime */ + createTime?: (google.protobuf.ITimestamp|null); + + /** ApiSpec revisionCreateTime */ + revisionCreateTime?: (google.protobuf.ITimestamp|null); + + /** ApiSpec revisionUpdateTime */ + revisionUpdateTime?: (google.protobuf.ITimestamp|null); + + /** ApiSpec mimeType */ + mimeType?: (string|null); + + /** ApiSpec sizeBytes */ + sizeBytes?: (number|null); + + /** ApiSpec hash */ + hash?: (string|null); + + /** ApiSpec sourceUri */ + sourceUri?: (string|null); + + /** ApiSpec contents */ + contents?: (Uint8Array|string|null); + + /** ApiSpec labels */ + labels?: ({ [k: string]: string }|null); + + /** ApiSpec annotations */ + annotations?: ({ [k: string]: string }|null); + } + + /** Represents an ApiSpec. */ + class ApiSpec implements IApiSpec { + + /** + * Constructs a new ApiSpec. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.apigeeregistry.v1.IApiSpec); + + /** ApiSpec name. */ + public name: string; + + /** ApiSpec filename. */ + public filename: string; + + /** ApiSpec description. */ + public description: string; + + /** ApiSpec revisionId. */ + public revisionId: string; + + /** ApiSpec createTime. */ + public createTime?: (google.protobuf.ITimestamp|null); + + /** ApiSpec revisionCreateTime. */ + public revisionCreateTime?: (google.protobuf.ITimestamp|null); + + /** ApiSpec revisionUpdateTime. */ + public revisionUpdateTime?: (google.protobuf.ITimestamp|null); + + /** ApiSpec mimeType. */ + public mimeType: string; + + /** ApiSpec sizeBytes. */ + public sizeBytes: number; + + /** ApiSpec hash. */ + public hash: string; + + /** ApiSpec sourceUri. */ + public sourceUri: string; + + /** ApiSpec contents. */ + public contents: (Uint8Array|string); + + /** ApiSpec labels. */ + public labels: { [k: string]: string }; + + /** ApiSpec annotations. */ + public annotations: { [k: string]: string }; + + /** + * Creates a new ApiSpec instance using the specified properties. + * @param [properties] Properties to set + * @returns ApiSpec instance + */ + public static create(properties?: google.cloud.apigeeregistry.v1.IApiSpec): google.cloud.apigeeregistry.v1.ApiSpec; + + /** + * Encodes the specified ApiSpec message. Does not implicitly {@link google.cloud.apigeeregistry.v1.ApiSpec.verify|verify} messages. + * @param message ApiSpec message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.apigeeregistry.v1.IApiSpec, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ApiSpec message, length delimited. Does not implicitly {@link google.cloud.apigeeregistry.v1.ApiSpec.verify|verify} messages. + * @param message ApiSpec message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.apigeeregistry.v1.IApiSpec, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an ApiSpec message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ApiSpec + * @throws {Error} If the payload is not 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.apigeeregistry.v1.ApiSpec; + + /** + * Decodes an ApiSpec message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ApiSpec + * @throws {Error} If the payload 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.apigeeregistry.v1.ApiSpec; + + /** + * Verifies an ApiSpec message. + * @param message Plain 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 ApiSpec message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ApiSpec + */ + public static fromObject(object: { [k: string]: any }): google.cloud.apigeeregistry.v1.ApiSpec; + + /** + * Creates a plain object from an ApiSpec message. Also converts values to other types if specified. + * @param message ApiSpec + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.apigeeregistry.v1.ApiSpec, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ApiSpec to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ApiSpec + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an ApiDeployment. */ + interface IApiDeployment { + + /** ApiDeployment name */ + name?: (string|null); + + /** ApiDeployment displayName */ + displayName?: (string|null); + + /** ApiDeployment description */ + description?: (string|null); + + /** ApiDeployment revisionId */ + revisionId?: (string|null); + + /** ApiDeployment createTime */ + createTime?: (google.protobuf.ITimestamp|null); + + /** ApiDeployment revisionCreateTime */ + revisionCreateTime?: (google.protobuf.ITimestamp|null); + + /** ApiDeployment revisionUpdateTime */ + revisionUpdateTime?: (google.protobuf.ITimestamp|null); + + /** ApiDeployment apiSpecRevision */ + apiSpecRevision?: (string|null); + + /** ApiDeployment endpointUri */ + endpointUri?: (string|null); + + /** ApiDeployment externalChannelUri */ + externalChannelUri?: (string|null); + + /** ApiDeployment intendedAudience */ + intendedAudience?: (string|null); + + /** ApiDeployment accessGuidance */ + accessGuidance?: (string|null); + + /** ApiDeployment labels */ + labels?: ({ [k: string]: string }|null); + + /** ApiDeployment annotations */ + annotations?: ({ [k: string]: string }|null); + } + + /** Represents an ApiDeployment. */ + class ApiDeployment implements IApiDeployment { + + /** + * Constructs a new ApiDeployment. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.apigeeregistry.v1.IApiDeployment); + + /** ApiDeployment name. */ + public name: string; + + /** ApiDeployment displayName. */ + public displayName: string; + + /** ApiDeployment description. */ + public description: string; + + /** ApiDeployment revisionId. */ + public revisionId: string; + + /** ApiDeployment createTime. */ + public createTime?: (google.protobuf.ITimestamp|null); + + /** ApiDeployment revisionCreateTime. */ + public revisionCreateTime?: (google.protobuf.ITimestamp|null); + + /** ApiDeployment revisionUpdateTime. */ + public revisionUpdateTime?: (google.protobuf.ITimestamp|null); + + /** ApiDeployment apiSpecRevision. */ + public apiSpecRevision: string; + + /** ApiDeployment endpointUri. */ + public endpointUri: string; + + /** ApiDeployment externalChannelUri. */ + public externalChannelUri: string; + + /** ApiDeployment intendedAudience. */ + public intendedAudience: string; + + /** ApiDeployment accessGuidance. */ + public accessGuidance: string; + + /** ApiDeployment labels. */ + public labels: { [k: string]: string }; + + /** ApiDeployment annotations. */ + public annotations: { [k: string]: string }; + + /** + * Creates a new ApiDeployment instance using the specified properties. + * @param [properties] Properties to set + * @returns ApiDeployment instance + */ + public static create(properties?: google.cloud.apigeeregistry.v1.IApiDeployment): google.cloud.apigeeregistry.v1.ApiDeployment; + + /** + * Encodes the specified ApiDeployment message. Does not implicitly {@link google.cloud.apigeeregistry.v1.ApiDeployment.verify|verify} messages. + * @param message ApiDeployment message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.apigeeregistry.v1.IApiDeployment, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ApiDeployment message, length delimited. Does not implicitly {@link google.cloud.apigeeregistry.v1.ApiDeployment.verify|verify} messages. + * @param message ApiDeployment message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.apigeeregistry.v1.IApiDeployment, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an ApiDeployment message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ApiDeployment + * @throws {Error} If the payload is not 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.apigeeregistry.v1.ApiDeployment; + + /** + * Decodes an ApiDeployment message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ApiDeployment + * @throws {Error} If the payload 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.apigeeregistry.v1.ApiDeployment; + + /** + * Verifies an ApiDeployment message. + * @param message Plain 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 ApiDeployment message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ApiDeployment + */ + public static fromObject(object: { [k: string]: any }): google.cloud.apigeeregistry.v1.ApiDeployment; + + /** + * Creates a plain object from an ApiDeployment message. Also converts values to other types if specified. + * @param message ApiDeployment + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.apigeeregistry.v1.ApiDeployment, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ApiDeployment to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ApiDeployment + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an Artifact. */ + interface IArtifact { + + /** Artifact name */ + name?: (string|null); + + /** Artifact createTime */ + createTime?: (google.protobuf.ITimestamp|null); + + /** Artifact updateTime */ + updateTime?: (google.protobuf.ITimestamp|null); + + /** Artifact mimeType */ + mimeType?: (string|null); + + /** Artifact sizeBytes */ + sizeBytes?: (number|null); + + /** Artifact hash */ + hash?: (string|null); + + /** Artifact contents */ + contents?: (Uint8Array|string|null); + } + + /** Represents an Artifact. */ + class Artifact implements IArtifact { + + /** + * Constructs a new Artifact. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.apigeeregistry.v1.IArtifact); + + /** Artifact name. */ + public name: string; + + /** Artifact createTime. */ + public createTime?: (google.protobuf.ITimestamp|null); + + /** Artifact updateTime. */ + public updateTime?: (google.protobuf.ITimestamp|null); + + /** Artifact mimeType. */ + public mimeType: string; + + /** Artifact sizeBytes. */ + public sizeBytes: number; + + /** Artifact hash. */ + public hash: string; + + /** Artifact contents. */ + public contents: (Uint8Array|string); + + /** + * Creates a new Artifact instance using the specified properties. + * @param [properties] Properties to set + * @returns Artifact instance + */ + public static create(properties?: google.cloud.apigeeregistry.v1.IArtifact): google.cloud.apigeeregistry.v1.Artifact; + + /** + * Encodes the specified Artifact message. Does not implicitly {@link google.cloud.apigeeregistry.v1.Artifact.verify|verify} messages. + * @param message Artifact message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.apigeeregistry.v1.IArtifact, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Artifact message, length delimited. Does not implicitly {@link google.cloud.apigeeregistry.v1.Artifact.verify|verify} messages. + * @param message Artifact message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.apigeeregistry.v1.IArtifact, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an Artifact message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Artifact + * @throws {Error} If the payload is not 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.apigeeregistry.v1.Artifact; + + /** + * Decodes an Artifact message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Artifact + * @throws {Error} If the payload 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.apigeeregistry.v1.Artifact; + + /** + * Verifies an Artifact message. + * @param message Plain 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 Artifact message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Artifact + */ + public static fromObject(object: { [k: string]: any }): google.cloud.apigeeregistry.v1.Artifact; + + /** + * Creates a plain object from an Artifact message. Also converts values to other types if specified. + * @param message Artifact + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.apigeeregistry.v1.Artifact, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Artifact to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Artifact + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Represents a Registry */ + class Registry extends $protobuf.rpc.Service { + + /** + * Constructs a new Registry 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 Registry 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): Registry; + + /** + * Calls ListApis. + * @param request ListApisRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ListApisResponse + */ + public listApis(request: google.cloud.apigeeregistry.v1.IListApisRequest, callback: google.cloud.apigeeregistry.v1.Registry.ListApisCallback): void; + + /** + * Calls ListApis. + * @param request ListApisRequest message or plain object + * @returns Promise + */ + public listApis(request: google.cloud.apigeeregistry.v1.IListApisRequest): Promise; + + /** + * Calls GetApi. + * @param request GetApiRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Api + */ + public getApi(request: google.cloud.apigeeregistry.v1.IGetApiRequest, callback: google.cloud.apigeeregistry.v1.Registry.GetApiCallback): void; + + /** + * Calls GetApi. + * @param request GetApiRequest message or plain object + * @returns Promise + */ + public getApi(request: google.cloud.apigeeregistry.v1.IGetApiRequest): Promise; + + /** + * Calls CreateApi. + * @param request CreateApiRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Api + */ + public createApi(request: google.cloud.apigeeregistry.v1.ICreateApiRequest, callback: google.cloud.apigeeregistry.v1.Registry.CreateApiCallback): void; + + /** + * Calls CreateApi. + * @param request CreateApiRequest message or plain object + * @returns Promise + */ + public createApi(request: google.cloud.apigeeregistry.v1.ICreateApiRequest): Promise; + + /** + * Calls UpdateApi. + * @param request UpdateApiRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Api + */ + public updateApi(request: google.cloud.apigeeregistry.v1.IUpdateApiRequest, callback: google.cloud.apigeeregistry.v1.Registry.UpdateApiCallback): void; + + /** + * Calls UpdateApi. + * @param request UpdateApiRequest message or plain object + * @returns Promise + */ + public updateApi(request: google.cloud.apigeeregistry.v1.IUpdateApiRequest): Promise; + + /** + * Calls DeleteApi. + * @param request DeleteApiRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Empty + */ + public deleteApi(request: google.cloud.apigeeregistry.v1.IDeleteApiRequest, callback: google.cloud.apigeeregistry.v1.Registry.DeleteApiCallback): void; + + /** + * Calls DeleteApi. + * @param request DeleteApiRequest message or plain object + * @returns Promise + */ + public deleteApi(request: google.cloud.apigeeregistry.v1.IDeleteApiRequest): Promise; + + /** + * Calls ListApiVersions. + * @param request ListApiVersionsRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ListApiVersionsResponse + */ + public listApiVersions(request: google.cloud.apigeeregistry.v1.IListApiVersionsRequest, callback: google.cloud.apigeeregistry.v1.Registry.ListApiVersionsCallback): void; + + /** + * Calls ListApiVersions. + * @param request ListApiVersionsRequest message or plain object + * @returns Promise + */ + public listApiVersions(request: google.cloud.apigeeregistry.v1.IListApiVersionsRequest): Promise; + + /** + * Calls GetApiVersion. + * @param request GetApiVersionRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ApiVersion + */ + public getApiVersion(request: google.cloud.apigeeregistry.v1.IGetApiVersionRequest, callback: google.cloud.apigeeregistry.v1.Registry.GetApiVersionCallback): void; + + /** + * Calls GetApiVersion. + * @param request GetApiVersionRequest message or plain object + * @returns Promise + */ + public getApiVersion(request: google.cloud.apigeeregistry.v1.IGetApiVersionRequest): Promise; + + /** + * Calls CreateApiVersion. + * @param request CreateApiVersionRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ApiVersion + */ + public createApiVersion(request: google.cloud.apigeeregistry.v1.ICreateApiVersionRequest, callback: google.cloud.apigeeregistry.v1.Registry.CreateApiVersionCallback): void; + + /** + * Calls CreateApiVersion. + * @param request CreateApiVersionRequest message or plain object + * @returns Promise + */ + public createApiVersion(request: google.cloud.apigeeregistry.v1.ICreateApiVersionRequest): Promise; + + /** + * Calls UpdateApiVersion. + * @param request UpdateApiVersionRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ApiVersion + */ + public updateApiVersion(request: google.cloud.apigeeregistry.v1.IUpdateApiVersionRequest, callback: google.cloud.apigeeregistry.v1.Registry.UpdateApiVersionCallback): void; + + /** + * Calls UpdateApiVersion. + * @param request UpdateApiVersionRequest message or plain object + * @returns Promise + */ + public updateApiVersion(request: google.cloud.apigeeregistry.v1.IUpdateApiVersionRequest): Promise; + + /** + * Calls DeleteApiVersion. + * @param request DeleteApiVersionRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Empty + */ + public deleteApiVersion(request: google.cloud.apigeeregistry.v1.IDeleteApiVersionRequest, callback: google.cloud.apigeeregistry.v1.Registry.DeleteApiVersionCallback): void; + + /** + * Calls DeleteApiVersion. + * @param request DeleteApiVersionRequest message or plain object + * @returns Promise + */ + public deleteApiVersion(request: google.cloud.apigeeregistry.v1.IDeleteApiVersionRequest): Promise; + + /** + * Calls ListApiSpecs. + * @param request ListApiSpecsRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ListApiSpecsResponse + */ + public listApiSpecs(request: google.cloud.apigeeregistry.v1.IListApiSpecsRequest, callback: google.cloud.apigeeregistry.v1.Registry.ListApiSpecsCallback): void; + + /** + * Calls ListApiSpecs. + * @param request ListApiSpecsRequest message or plain object + * @returns Promise + */ + public listApiSpecs(request: google.cloud.apigeeregistry.v1.IListApiSpecsRequest): Promise; + + /** + * Calls GetApiSpec. + * @param request GetApiSpecRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ApiSpec + */ + public getApiSpec(request: google.cloud.apigeeregistry.v1.IGetApiSpecRequest, callback: google.cloud.apigeeregistry.v1.Registry.GetApiSpecCallback): void; + + /** + * Calls GetApiSpec. + * @param request GetApiSpecRequest message or plain object + * @returns Promise + */ + public getApiSpec(request: google.cloud.apigeeregistry.v1.IGetApiSpecRequest): Promise; + + /** + * Calls GetApiSpecContents. + * @param request GetApiSpecContentsRequest message or plain object + * @param callback Node-style callback called with the error, if any, and HttpBody + */ + public getApiSpecContents(request: google.cloud.apigeeregistry.v1.IGetApiSpecContentsRequest, callback: google.cloud.apigeeregistry.v1.Registry.GetApiSpecContentsCallback): void; + + /** + * Calls GetApiSpecContents. + * @param request GetApiSpecContentsRequest message or plain object + * @returns Promise + */ + public getApiSpecContents(request: google.cloud.apigeeregistry.v1.IGetApiSpecContentsRequest): Promise; + + /** + * Calls CreateApiSpec. + * @param request CreateApiSpecRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ApiSpec + */ + public createApiSpec(request: google.cloud.apigeeregistry.v1.ICreateApiSpecRequest, callback: google.cloud.apigeeregistry.v1.Registry.CreateApiSpecCallback): void; + + /** + * Calls CreateApiSpec. + * @param request CreateApiSpecRequest message or plain object + * @returns Promise + */ + public createApiSpec(request: google.cloud.apigeeregistry.v1.ICreateApiSpecRequest): Promise; + + /** + * Calls UpdateApiSpec. + * @param request UpdateApiSpecRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ApiSpec + */ + public updateApiSpec(request: google.cloud.apigeeregistry.v1.IUpdateApiSpecRequest, callback: google.cloud.apigeeregistry.v1.Registry.UpdateApiSpecCallback): void; + + /** + * Calls UpdateApiSpec. + * @param request UpdateApiSpecRequest message or plain object + * @returns Promise + */ + public updateApiSpec(request: google.cloud.apigeeregistry.v1.IUpdateApiSpecRequest): Promise; + + /** + * Calls DeleteApiSpec. + * @param request DeleteApiSpecRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Empty + */ + public deleteApiSpec(request: google.cloud.apigeeregistry.v1.IDeleteApiSpecRequest, callback: google.cloud.apigeeregistry.v1.Registry.DeleteApiSpecCallback): void; + + /** + * Calls DeleteApiSpec. + * @param request DeleteApiSpecRequest message or plain object + * @returns Promise + */ + public deleteApiSpec(request: google.cloud.apigeeregistry.v1.IDeleteApiSpecRequest): Promise; + + /** + * Calls TagApiSpecRevision. + * @param request TagApiSpecRevisionRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ApiSpec + */ + public tagApiSpecRevision(request: google.cloud.apigeeregistry.v1.ITagApiSpecRevisionRequest, callback: google.cloud.apigeeregistry.v1.Registry.TagApiSpecRevisionCallback): void; + + /** + * Calls TagApiSpecRevision. + * @param request TagApiSpecRevisionRequest message or plain object + * @returns Promise + */ + public tagApiSpecRevision(request: google.cloud.apigeeregistry.v1.ITagApiSpecRevisionRequest): Promise; + + /** + * Calls ListApiSpecRevisions. + * @param request ListApiSpecRevisionsRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ListApiSpecRevisionsResponse + */ + public listApiSpecRevisions(request: google.cloud.apigeeregistry.v1.IListApiSpecRevisionsRequest, callback: google.cloud.apigeeregistry.v1.Registry.ListApiSpecRevisionsCallback): void; + + /** + * Calls ListApiSpecRevisions. + * @param request ListApiSpecRevisionsRequest message or plain object + * @returns Promise + */ + public listApiSpecRevisions(request: google.cloud.apigeeregistry.v1.IListApiSpecRevisionsRequest): Promise; + + /** + * Calls RollbackApiSpec. + * @param request RollbackApiSpecRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ApiSpec + */ + public rollbackApiSpec(request: google.cloud.apigeeregistry.v1.IRollbackApiSpecRequest, callback: google.cloud.apigeeregistry.v1.Registry.RollbackApiSpecCallback): void; + + /** + * Calls RollbackApiSpec. + * @param request RollbackApiSpecRequest message or plain object + * @returns Promise + */ + public rollbackApiSpec(request: google.cloud.apigeeregistry.v1.IRollbackApiSpecRequest): Promise; + + /** + * Calls DeleteApiSpecRevision. + * @param request DeleteApiSpecRevisionRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ApiSpec + */ + public deleteApiSpecRevision(request: google.cloud.apigeeregistry.v1.IDeleteApiSpecRevisionRequest, callback: google.cloud.apigeeregistry.v1.Registry.DeleteApiSpecRevisionCallback): void; + + /** + * Calls DeleteApiSpecRevision. + * @param request DeleteApiSpecRevisionRequest message or plain object + * @returns Promise + */ + public deleteApiSpecRevision(request: google.cloud.apigeeregistry.v1.IDeleteApiSpecRevisionRequest): Promise; + + /** + * Calls ListApiDeployments. + * @param request ListApiDeploymentsRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ListApiDeploymentsResponse + */ + public listApiDeployments(request: google.cloud.apigeeregistry.v1.IListApiDeploymentsRequest, callback: google.cloud.apigeeregistry.v1.Registry.ListApiDeploymentsCallback): void; + + /** + * Calls ListApiDeployments. + * @param request ListApiDeploymentsRequest message or plain object + * @returns Promise + */ + public listApiDeployments(request: google.cloud.apigeeregistry.v1.IListApiDeploymentsRequest): Promise; + + /** + * Calls GetApiDeployment. + * @param request GetApiDeploymentRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ApiDeployment + */ + public getApiDeployment(request: google.cloud.apigeeregistry.v1.IGetApiDeploymentRequest, callback: google.cloud.apigeeregistry.v1.Registry.GetApiDeploymentCallback): void; + + /** + * Calls GetApiDeployment. + * @param request GetApiDeploymentRequest message or plain object + * @returns Promise + */ + public getApiDeployment(request: google.cloud.apigeeregistry.v1.IGetApiDeploymentRequest): Promise; + + /** + * Calls CreateApiDeployment. + * @param request CreateApiDeploymentRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ApiDeployment + */ + public createApiDeployment(request: google.cloud.apigeeregistry.v1.ICreateApiDeploymentRequest, callback: google.cloud.apigeeregistry.v1.Registry.CreateApiDeploymentCallback): void; + + /** + * Calls CreateApiDeployment. + * @param request CreateApiDeploymentRequest message or plain object + * @returns Promise + */ + public createApiDeployment(request: google.cloud.apigeeregistry.v1.ICreateApiDeploymentRequest): Promise; + + /** + * Calls UpdateApiDeployment. + * @param request UpdateApiDeploymentRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ApiDeployment + */ + public updateApiDeployment(request: google.cloud.apigeeregistry.v1.IUpdateApiDeploymentRequest, callback: google.cloud.apigeeregistry.v1.Registry.UpdateApiDeploymentCallback): void; + + /** + * Calls UpdateApiDeployment. + * @param request UpdateApiDeploymentRequest message or plain object + * @returns Promise + */ + public updateApiDeployment(request: google.cloud.apigeeregistry.v1.IUpdateApiDeploymentRequest): Promise; + + /** + * Calls DeleteApiDeployment. + * @param request DeleteApiDeploymentRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Empty + */ + public deleteApiDeployment(request: google.cloud.apigeeregistry.v1.IDeleteApiDeploymentRequest, callback: google.cloud.apigeeregistry.v1.Registry.DeleteApiDeploymentCallback): void; + + /** + * Calls DeleteApiDeployment. + * @param request DeleteApiDeploymentRequest message or plain object + * @returns Promise + */ + public deleteApiDeployment(request: google.cloud.apigeeregistry.v1.IDeleteApiDeploymentRequest): Promise; + + /** + * Calls TagApiDeploymentRevision. + * @param request TagApiDeploymentRevisionRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ApiDeployment + */ + public tagApiDeploymentRevision(request: google.cloud.apigeeregistry.v1.ITagApiDeploymentRevisionRequest, callback: google.cloud.apigeeregistry.v1.Registry.TagApiDeploymentRevisionCallback): void; + + /** + * Calls TagApiDeploymentRevision. + * @param request TagApiDeploymentRevisionRequest message or plain object + * @returns Promise + */ + public tagApiDeploymentRevision(request: google.cloud.apigeeregistry.v1.ITagApiDeploymentRevisionRequest): Promise; + + /** + * Calls ListApiDeploymentRevisions. + * @param request ListApiDeploymentRevisionsRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ListApiDeploymentRevisionsResponse + */ + public listApiDeploymentRevisions(request: google.cloud.apigeeregistry.v1.IListApiDeploymentRevisionsRequest, callback: google.cloud.apigeeregistry.v1.Registry.ListApiDeploymentRevisionsCallback): void; + + /** + * Calls ListApiDeploymentRevisions. + * @param request ListApiDeploymentRevisionsRequest message or plain object + * @returns Promise + */ + public listApiDeploymentRevisions(request: google.cloud.apigeeregistry.v1.IListApiDeploymentRevisionsRequest): Promise; + + /** + * Calls RollbackApiDeployment. + * @param request RollbackApiDeploymentRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ApiDeployment + */ + public rollbackApiDeployment(request: google.cloud.apigeeregistry.v1.IRollbackApiDeploymentRequest, callback: google.cloud.apigeeregistry.v1.Registry.RollbackApiDeploymentCallback): void; + + /** + * Calls RollbackApiDeployment. + * @param request RollbackApiDeploymentRequest message or plain object + * @returns Promise + */ + public rollbackApiDeployment(request: google.cloud.apigeeregistry.v1.IRollbackApiDeploymentRequest): Promise; + + /** + * Calls DeleteApiDeploymentRevision. + * @param request DeleteApiDeploymentRevisionRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ApiDeployment + */ + public deleteApiDeploymentRevision(request: google.cloud.apigeeregistry.v1.IDeleteApiDeploymentRevisionRequest, callback: google.cloud.apigeeregistry.v1.Registry.DeleteApiDeploymentRevisionCallback): void; + + /** + * Calls DeleteApiDeploymentRevision. + * @param request DeleteApiDeploymentRevisionRequest message or plain object + * @returns Promise + */ + public deleteApiDeploymentRevision(request: google.cloud.apigeeregistry.v1.IDeleteApiDeploymentRevisionRequest): Promise; + + /** + * Calls ListArtifacts. + * @param request ListArtifactsRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ListArtifactsResponse + */ + public listArtifacts(request: google.cloud.apigeeregistry.v1.IListArtifactsRequest, callback: google.cloud.apigeeregistry.v1.Registry.ListArtifactsCallback): void; + + /** + * Calls ListArtifacts. + * @param request ListArtifactsRequest message or plain object + * @returns Promise + */ + public listArtifacts(request: google.cloud.apigeeregistry.v1.IListArtifactsRequest): Promise; + + /** + * Calls GetArtifact. + * @param request GetArtifactRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Artifact + */ + public getArtifact(request: google.cloud.apigeeregistry.v1.IGetArtifactRequest, callback: google.cloud.apigeeregistry.v1.Registry.GetArtifactCallback): void; + + /** + * Calls GetArtifact. + * @param request GetArtifactRequest message or plain object + * @returns Promise + */ + public getArtifact(request: google.cloud.apigeeregistry.v1.IGetArtifactRequest): Promise; + + /** + * Calls GetArtifactContents. + * @param request GetArtifactContentsRequest message or plain object + * @param callback Node-style callback called with the error, if any, and HttpBody + */ + public getArtifactContents(request: google.cloud.apigeeregistry.v1.IGetArtifactContentsRequest, callback: google.cloud.apigeeregistry.v1.Registry.GetArtifactContentsCallback): void; + + /** + * Calls GetArtifactContents. + * @param request GetArtifactContentsRequest message or plain object + * @returns Promise + */ + public getArtifactContents(request: google.cloud.apigeeregistry.v1.IGetArtifactContentsRequest): Promise; + + /** + * Calls CreateArtifact. + * @param request CreateArtifactRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Artifact + */ + public createArtifact(request: google.cloud.apigeeregistry.v1.ICreateArtifactRequest, callback: google.cloud.apigeeregistry.v1.Registry.CreateArtifactCallback): void; + + /** + * Calls CreateArtifact. + * @param request CreateArtifactRequest message or plain object + * @returns Promise + */ + public createArtifact(request: google.cloud.apigeeregistry.v1.ICreateArtifactRequest): Promise; + + /** + * Calls ReplaceArtifact. + * @param request ReplaceArtifactRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Artifact + */ + public replaceArtifact(request: google.cloud.apigeeregistry.v1.IReplaceArtifactRequest, callback: google.cloud.apigeeregistry.v1.Registry.ReplaceArtifactCallback): void; + + /** + * Calls ReplaceArtifact. + * @param request ReplaceArtifactRequest message or plain object + * @returns Promise + */ + public replaceArtifact(request: google.cloud.apigeeregistry.v1.IReplaceArtifactRequest): Promise; + + /** + * Calls DeleteArtifact. + * @param request DeleteArtifactRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Empty + */ + public deleteArtifact(request: google.cloud.apigeeregistry.v1.IDeleteArtifactRequest, callback: google.cloud.apigeeregistry.v1.Registry.DeleteArtifactCallback): void; + + /** + * Calls DeleteArtifact. + * @param request DeleteArtifactRequest message or plain object + * @returns Promise + */ + public deleteArtifact(request: google.cloud.apigeeregistry.v1.IDeleteArtifactRequest): Promise; + } + + namespace Registry { + + /** + * Callback as used by {@link google.cloud.apigeeregistry.v1.Registry|listApis}. + * @param error Error, if any + * @param [response] ListApisResponse + */ + type ListApisCallback = (error: (Error|null), response?: google.cloud.apigeeregistry.v1.ListApisResponse) => void; + + /** + * Callback as used by {@link google.cloud.apigeeregistry.v1.Registry|getApi}. + * @param error Error, if any + * @param [response] Api + */ + type GetApiCallback = (error: (Error|null), response?: google.cloud.apigeeregistry.v1.Api) => void; + + /** + * Callback as used by {@link google.cloud.apigeeregistry.v1.Registry|createApi}. + * @param error Error, if any + * @param [response] Api + */ + type CreateApiCallback = (error: (Error|null), response?: google.cloud.apigeeregistry.v1.Api) => void; + + /** + * Callback as used by {@link google.cloud.apigeeregistry.v1.Registry|updateApi}. + * @param error Error, if any + * @param [response] Api + */ + type UpdateApiCallback = (error: (Error|null), response?: google.cloud.apigeeregistry.v1.Api) => void; + + /** + * Callback as used by {@link google.cloud.apigeeregistry.v1.Registry|deleteApi}. + * @param error Error, if any + * @param [response] Empty + */ + type DeleteApiCallback = (error: (Error|null), response?: google.protobuf.Empty) => void; + + /** + * Callback as used by {@link google.cloud.apigeeregistry.v1.Registry|listApiVersions}. + * @param error Error, if any + * @param [response] ListApiVersionsResponse + */ + type ListApiVersionsCallback = (error: (Error|null), response?: google.cloud.apigeeregistry.v1.ListApiVersionsResponse) => void; + + /** + * Callback as used by {@link google.cloud.apigeeregistry.v1.Registry|getApiVersion}. + * @param error Error, if any + * @param [response] ApiVersion + */ + type GetApiVersionCallback = (error: (Error|null), response?: google.cloud.apigeeregistry.v1.ApiVersion) => void; + + /** + * Callback as used by {@link google.cloud.apigeeregistry.v1.Registry|createApiVersion}. + * @param error Error, if any + * @param [response] ApiVersion + */ + type CreateApiVersionCallback = (error: (Error|null), response?: google.cloud.apigeeregistry.v1.ApiVersion) => void; + + /** + * Callback as used by {@link google.cloud.apigeeregistry.v1.Registry|updateApiVersion}. + * @param error Error, if any + * @param [response] ApiVersion + */ + type UpdateApiVersionCallback = (error: (Error|null), response?: google.cloud.apigeeregistry.v1.ApiVersion) => void; + + /** + * Callback as used by {@link google.cloud.apigeeregistry.v1.Registry|deleteApiVersion}. + * @param error Error, if any + * @param [response] Empty + */ + type DeleteApiVersionCallback = (error: (Error|null), response?: google.protobuf.Empty) => void; + + /** + * Callback as used by {@link google.cloud.apigeeregistry.v1.Registry|listApiSpecs}. + * @param error Error, if any + * @param [response] ListApiSpecsResponse + */ + type ListApiSpecsCallback = (error: (Error|null), response?: google.cloud.apigeeregistry.v1.ListApiSpecsResponse) => void; + + /** + * Callback as used by {@link google.cloud.apigeeregistry.v1.Registry|getApiSpec}. + * @param error Error, if any + * @param [response] ApiSpec + */ + type GetApiSpecCallback = (error: (Error|null), response?: google.cloud.apigeeregistry.v1.ApiSpec) => void; + + /** + * Callback as used by {@link google.cloud.apigeeregistry.v1.Registry|getApiSpecContents}. + * @param error Error, if any + * @param [response] HttpBody + */ + type GetApiSpecContentsCallback = (error: (Error|null), response?: google.api.HttpBody) => void; + + /** + * Callback as used by {@link google.cloud.apigeeregistry.v1.Registry|createApiSpec}. + * @param error Error, if any + * @param [response] ApiSpec + */ + type CreateApiSpecCallback = (error: (Error|null), response?: google.cloud.apigeeregistry.v1.ApiSpec) => void; + + /** + * Callback as used by {@link google.cloud.apigeeregistry.v1.Registry|updateApiSpec}. + * @param error Error, if any + * @param [response] ApiSpec + */ + type UpdateApiSpecCallback = (error: (Error|null), response?: google.cloud.apigeeregistry.v1.ApiSpec) => void; + + /** + * Callback as used by {@link google.cloud.apigeeregistry.v1.Registry|deleteApiSpec}. + * @param error Error, if any + * @param [response] Empty + */ + type DeleteApiSpecCallback = (error: (Error|null), response?: google.protobuf.Empty) => void; + + /** + * Callback as used by {@link google.cloud.apigeeregistry.v1.Registry|tagApiSpecRevision}. + * @param error Error, if any + * @param [response] ApiSpec + */ + type TagApiSpecRevisionCallback = (error: (Error|null), response?: google.cloud.apigeeregistry.v1.ApiSpec) => void; + + /** + * Callback as used by {@link google.cloud.apigeeregistry.v1.Registry|listApiSpecRevisions}. + * @param error Error, if any + * @param [response] ListApiSpecRevisionsResponse + */ + type ListApiSpecRevisionsCallback = (error: (Error|null), response?: google.cloud.apigeeregistry.v1.ListApiSpecRevisionsResponse) => void; + + /** + * Callback as used by {@link google.cloud.apigeeregistry.v1.Registry|rollbackApiSpec}. + * @param error Error, if any + * @param [response] ApiSpec + */ + type RollbackApiSpecCallback = (error: (Error|null), response?: google.cloud.apigeeregistry.v1.ApiSpec) => void; + + /** + * Callback as used by {@link google.cloud.apigeeregistry.v1.Registry|deleteApiSpecRevision}. + * @param error Error, if any + * @param [response] ApiSpec + */ + type DeleteApiSpecRevisionCallback = (error: (Error|null), response?: google.cloud.apigeeregistry.v1.ApiSpec) => void; + + /** + * Callback as used by {@link google.cloud.apigeeregistry.v1.Registry|listApiDeployments}. + * @param error Error, if any + * @param [response] ListApiDeploymentsResponse + */ + type ListApiDeploymentsCallback = (error: (Error|null), response?: google.cloud.apigeeregistry.v1.ListApiDeploymentsResponse) => void; + + /** + * Callback as used by {@link google.cloud.apigeeregistry.v1.Registry|getApiDeployment}. + * @param error Error, if any + * @param [response] ApiDeployment + */ + type GetApiDeploymentCallback = (error: (Error|null), response?: google.cloud.apigeeregistry.v1.ApiDeployment) => void; + + /** + * Callback as used by {@link google.cloud.apigeeregistry.v1.Registry|createApiDeployment}. + * @param error Error, if any + * @param [response] ApiDeployment + */ + type CreateApiDeploymentCallback = (error: (Error|null), response?: google.cloud.apigeeregistry.v1.ApiDeployment) => void; + + /** + * Callback as used by {@link google.cloud.apigeeregistry.v1.Registry|updateApiDeployment}. + * @param error Error, if any + * @param [response] ApiDeployment + */ + type UpdateApiDeploymentCallback = (error: (Error|null), response?: google.cloud.apigeeregistry.v1.ApiDeployment) => void; + + /** + * Callback as used by {@link google.cloud.apigeeregistry.v1.Registry|deleteApiDeployment}. + * @param error Error, if any + * @param [response] Empty + */ + type DeleteApiDeploymentCallback = (error: (Error|null), response?: google.protobuf.Empty) => void; + + /** + * Callback as used by {@link google.cloud.apigeeregistry.v1.Registry|tagApiDeploymentRevision}. + * @param error Error, if any + * @param [response] ApiDeployment + */ + type TagApiDeploymentRevisionCallback = (error: (Error|null), response?: google.cloud.apigeeregistry.v1.ApiDeployment) => void; + + /** + * Callback as used by {@link google.cloud.apigeeregistry.v1.Registry|listApiDeploymentRevisions}. + * @param error Error, if any + * @param [response] ListApiDeploymentRevisionsResponse + */ + type ListApiDeploymentRevisionsCallback = (error: (Error|null), response?: google.cloud.apigeeregistry.v1.ListApiDeploymentRevisionsResponse) => void; + + /** + * Callback as used by {@link google.cloud.apigeeregistry.v1.Registry|rollbackApiDeployment}. + * @param error Error, if any + * @param [response] ApiDeployment + */ + type RollbackApiDeploymentCallback = (error: (Error|null), response?: google.cloud.apigeeregistry.v1.ApiDeployment) => void; + + /** + * Callback as used by {@link google.cloud.apigeeregistry.v1.Registry|deleteApiDeploymentRevision}. + * @param error Error, if any + * @param [response] ApiDeployment + */ + type DeleteApiDeploymentRevisionCallback = (error: (Error|null), response?: google.cloud.apigeeregistry.v1.ApiDeployment) => void; + + /** + * Callback as used by {@link google.cloud.apigeeregistry.v1.Registry|listArtifacts}. + * @param error Error, if any + * @param [response] ListArtifactsResponse + */ + type ListArtifactsCallback = (error: (Error|null), response?: google.cloud.apigeeregistry.v1.ListArtifactsResponse) => void; + + /** + * Callback as used by {@link google.cloud.apigeeregistry.v1.Registry|getArtifact}. + * @param error Error, if any + * @param [response] Artifact + */ + type GetArtifactCallback = (error: (Error|null), response?: google.cloud.apigeeregistry.v1.Artifact) => void; + + /** + * Callback as used by {@link google.cloud.apigeeregistry.v1.Registry|getArtifactContents}. + * @param error Error, if any + * @param [response] HttpBody + */ + type GetArtifactContentsCallback = (error: (Error|null), response?: google.api.HttpBody) => void; + + /** + * Callback as used by {@link google.cloud.apigeeregistry.v1.Registry|createArtifact}. + * @param error Error, if any + * @param [response] Artifact + */ + type CreateArtifactCallback = (error: (Error|null), response?: google.cloud.apigeeregistry.v1.Artifact) => void; + + /** + * Callback as used by {@link google.cloud.apigeeregistry.v1.Registry|replaceArtifact}. + * @param error Error, if any + * @param [response] Artifact + */ + type ReplaceArtifactCallback = (error: (Error|null), response?: google.cloud.apigeeregistry.v1.Artifact) => void; + + /** + * Callback as used by {@link google.cloud.apigeeregistry.v1.Registry|deleteArtifact}. + * @param error Error, if any + * @param [response] Empty + */ + type DeleteArtifactCallback = (error: (Error|null), response?: google.protobuf.Empty) => void; + } + + /** Properties of a ListApisRequest. */ + interface IListApisRequest { + + /** ListApisRequest parent */ + parent?: (string|null); + + /** ListApisRequest pageSize */ + pageSize?: (number|null); + + /** ListApisRequest pageToken */ + pageToken?: (string|null); + + /** ListApisRequest filter */ + filter?: (string|null); + } + + /** Represents a ListApisRequest. */ + class ListApisRequest implements IListApisRequest { + + /** + * Constructs a new ListApisRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.apigeeregistry.v1.IListApisRequest); + + /** ListApisRequest parent. */ + public parent: string; + + /** ListApisRequest pageSize. */ + public pageSize: number; + + /** ListApisRequest pageToken. */ + public pageToken: string; + + /** ListApisRequest filter. */ + public filter: string; + + /** + * Creates a new ListApisRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ListApisRequest instance + */ + public static create(properties?: google.cloud.apigeeregistry.v1.IListApisRequest): google.cloud.apigeeregistry.v1.ListApisRequest; + + /** + * Encodes the specified ListApisRequest message. Does not implicitly {@link google.cloud.apigeeregistry.v1.ListApisRequest.verify|verify} messages. + * @param message ListApisRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.apigeeregistry.v1.IListApisRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListApisRequest message, length delimited. Does not implicitly {@link google.cloud.apigeeregistry.v1.ListApisRequest.verify|verify} messages. + * @param message ListApisRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.apigeeregistry.v1.IListApisRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListApisRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListApisRequest + * @throws {Error} If the payload is not 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.apigeeregistry.v1.ListApisRequest; + + /** + * Decodes a ListApisRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListApisRequest + * @throws {Error} If the payload 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.apigeeregistry.v1.ListApisRequest; + + /** + * Verifies a ListApisRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListApisRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListApisRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.apigeeregistry.v1.ListApisRequest; + + /** + * Creates a plain object from a ListApisRequest message. Also converts values to other types if specified. + * @param message ListApisRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.apigeeregistry.v1.ListApisRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListApisRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListApisRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListApisResponse. */ + interface IListApisResponse { + + /** ListApisResponse apis */ + apis?: (google.cloud.apigeeregistry.v1.IApi[]|null); + + /** ListApisResponse nextPageToken */ + nextPageToken?: (string|null); + } + + /** Represents a ListApisResponse. */ + class ListApisResponse implements IListApisResponse { + + /** + * Constructs a new ListApisResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.apigeeregistry.v1.IListApisResponse); + + /** ListApisResponse apis. */ + public apis: google.cloud.apigeeregistry.v1.IApi[]; + + /** ListApisResponse nextPageToken. */ + public nextPageToken: string; + + /** + * Creates a new ListApisResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ListApisResponse instance + */ + public static create(properties?: google.cloud.apigeeregistry.v1.IListApisResponse): google.cloud.apigeeregistry.v1.ListApisResponse; + + /** + * Encodes the specified ListApisResponse message. Does not implicitly {@link google.cloud.apigeeregistry.v1.ListApisResponse.verify|verify} messages. + * @param message ListApisResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.apigeeregistry.v1.IListApisResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListApisResponse message, length delimited. Does not implicitly {@link google.cloud.apigeeregistry.v1.ListApisResponse.verify|verify} messages. + * @param message ListApisResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.apigeeregistry.v1.IListApisResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListApisResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListApisResponse + * @throws {Error} If the payload is not 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.apigeeregistry.v1.ListApisResponse; + + /** + * Decodes a ListApisResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListApisResponse + * @throws {Error} If the payload 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.apigeeregistry.v1.ListApisResponse; + + /** + * Verifies a ListApisResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListApisResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListApisResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.apigeeregistry.v1.ListApisResponse; + + /** + * Creates a plain object from a ListApisResponse message. Also converts values to other types if specified. + * @param message ListApisResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.apigeeregistry.v1.ListApisResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListApisResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListApisResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a GetApiRequest. */ + interface IGetApiRequest { + + /** GetApiRequest name */ + name?: (string|null); + } + + /** Represents a GetApiRequest. */ + class GetApiRequest implements IGetApiRequest { + + /** + * Constructs a new GetApiRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.apigeeregistry.v1.IGetApiRequest); + + /** GetApiRequest name. */ + public name: string; + + /** + * Creates a new GetApiRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GetApiRequest instance + */ + public static create(properties?: google.cloud.apigeeregistry.v1.IGetApiRequest): google.cloud.apigeeregistry.v1.GetApiRequest; + + /** + * Encodes the specified GetApiRequest message. Does not implicitly {@link google.cloud.apigeeregistry.v1.GetApiRequest.verify|verify} messages. + * @param message GetApiRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.apigeeregistry.v1.IGetApiRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GetApiRequest message, length delimited. Does not implicitly {@link google.cloud.apigeeregistry.v1.GetApiRequest.verify|verify} messages. + * @param message GetApiRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.apigeeregistry.v1.IGetApiRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GetApiRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GetApiRequest + * @throws {Error} If the payload is not 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.apigeeregistry.v1.GetApiRequest; + + /** + * Decodes a GetApiRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GetApiRequest + * @throws {Error} If the payload 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.apigeeregistry.v1.GetApiRequest; + + /** + * Verifies a GetApiRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GetApiRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GetApiRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.apigeeregistry.v1.GetApiRequest; + + /** + * Creates a plain object from a GetApiRequest message. Also converts values to other types if specified. + * @param message GetApiRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.apigeeregistry.v1.GetApiRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GetApiRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GetApiRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a CreateApiRequest. */ + interface ICreateApiRequest { + + /** CreateApiRequest parent */ + parent?: (string|null); + + /** CreateApiRequest api */ + api?: (google.cloud.apigeeregistry.v1.IApi|null); + + /** CreateApiRequest apiId */ + apiId?: (string|null); + } + + /** Represents a CreateApiRequest. */ + class CreateApiRequest implements ICreateApiRequest { + + /** + * Constructs a new CreateApiRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.apigeeregistry.v1.ICreateApiRequest); + + /** CreateApiRequest parent. */ + public parent: string; + + /** CreateApiRequest api. */ + public api?: (google.cloud.apigeeregistry.v1.IApi|null); + + /** CreateApiRequest apiId. */ + public apiId: string; + + /** + * Creates a new CreateApiRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns CreateApiRequest instance + */ + public static create(properties?: google.cloud.apigeeregistry.v1.ICreateApiRequest): google.cloud.apigeeregistry.v1.CreateApiRequest; + + /** + * Encodes the specified CreateApiRequest message. Does not implicitly {@link google.cloud.apigeeregistry.v1.CreateApiRequest.verify|verify} messages. + * @param message CreateApiRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.apigeeregistry.v1.ICreateApiRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CreateApiRequest message, length delimited. Does not implicitly {@link google.cloud.apigeeregistry.v1.CreateApiRequest.verify|verify} messages. + * @param message CreateApiRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.apigeeregistry.v1.ICreateApiRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CreateApiRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CreateApiRequest + * @throws {Error} If the payload is not 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.apigeeregistry.v1.CreateApiRequest; + + /** + * Decodes a CreateApiRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CreateApiRequest + * @throws {Error} If the payload 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.apigeeregistry.v1.CreateApiRequest; + + /** + * Verifies a CreateApiRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CreateApiRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CreateApiRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.apigeeregistry.v1.CreateApiRequest; + + /** + * Creates a plain object from a CreateApiRequest message. Also converts values to other types if specified. + * @param message CreateApiRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.apigeeregistry.v1.CreateApiRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CreateApiRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CreateApiRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an UpdateApiRequest. */ + interface IUpdateApiRequest { + + /** UpdateApiRequest api */ + api?: (google.cloud.apigeeregistry.v1.IApi|null); + + /** UpdateApiRequest updateMask */ + updateMask?: (google.protobuf.IFieldMask|null); + + /** UpdateApiRequest allowMissing */ + allowMissing?: (boolean|null); + } + + /** Represents an UpdateApiRequest. */ + class UpdateApiRequest implements IUpdateApiRequest { + + /** + * Constructs a new UpdateApiRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.apigeeregistry.v1.IUpdateApiRequest); + + /** UpdateApiRequest api. */ + public api?: (google.cloud.apigeeregistry.v1.IApi|null); + + /** UpdateApiRequest updateMask. */ + public updateMask?: (google.protobuf.IFieldMask|null); + + /** UpdateApiRequest allowMissing. */ + public allowMissing: boolean; + + /** + * Creates a new UpdateApiRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns UpdateApiRequest instance + */ + public static create(properties?: google.cloud.apigeeregistry.v1.IUpdateApiRequest): google.cloud.apigeeregistry.v1.UpdateApiRequest; + + /** + * Encodes the specified UpdateApiRequest message. Does not implicitly {@link google.cloud.apigeeregistry.v1.UpdateApiRequest.verify|verify} messages. + * @param message UpdateApiRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.apigeeregistry.v1.IUpdateApiRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified UpdateApiRequest message, length delimited. Does not implicitly {@link google.cloud.apigeeregistry.v1.UpdateApiRequest.verify|verify} messages. + * @param message UpdateApiRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.apigeeregistry.v1.IUpdateApiRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an UpdateApiRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns UpdateApiRequest + * @throws {Error} If the payload is not 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.apigeeregistry.v1.UpdateApiRequest; + + /** + * Decodes an UpdateApiRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns UpdateApiRequest + * @throws {Error} If the payload 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.apigeeregistry.v1.UpdateApiRequest; + + /** + * Verifies an UpdateApiRequest message. + * @param message Plain 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 UpdateApiRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns UpdateApiRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.apigeeregistry.v1.UpdateApiRequest; + + /** + * Creates a plain object from an UpdateApiRequest message. Also converts values to other types if specified. + * @param message UpdateApiRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.apigeeregistry.v1.UpdateApiRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this UpdateApiRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for UpdateApiRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a DeleteApiRequest. */ + interface IDeleteApiRequest { + + /** DeleteApiRequest name */ + name?: (string|null); + + /** DeleteApiRequest force */ + force?: (boolean|null); + } + + /** Represents a DeleteApiRequest. */ + class DeleteApiRequest implements IDeleteApiRequest { + + /** + * Constructs a new DeleteApiRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.apigeeregistry.v1.IDeleteApiRequest); + + /** DeleteApiRequest name. */ + public name: string; + + /** DeleteApiRequest force. */ + public force: boolean; + + /** + * Creates a new DeleteApiRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns DeleteApiRequest instance + */ + public static create(properties?: google.cloud.apigeeregistry.v1.IDeleteApiRequest): google.cloud.apigeeregistry.v1.DeleteApiRequest; + + /** + * Encodes the specified DeleteApiRequest message. Does not implicitly {@link google.cloud.apigeeregistry.v1.DeleteApiRequest.verify|verify} messages. + * @param message DeleteApiRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.apigeeregistry.v1.IDeleteApiRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DeleteApiRequest message, length delimited. Does not implicitly {@link google.cloud.apigeeregistry.v1.DeleteApiRequest.verify|verify} messages. + * @param message DeleteApiRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.apigeeregistry.v1.IDeleteApiRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DeleteApiRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DeleteApiRequest + * @throws {Error} If the payload is not 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.apigeeregistry.v1.DeleteApiRequest; + + /** + * Decodes a DeleteApiRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DeleteApiRequest + * @throws {Error} If the payload 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.apigeeregistry.v1.DeleteApiRequest; + + /** + * Verifies a DeleteApiRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DeleteApiRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DeleteApiRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.apigeeregistry.v1.DeleteApiRequest; + + /** + * Creates a plain object from a DeleteApiRequest message. Also converts values to other types if specified. + * @param message DeleteApiRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.apigeeregistry.v1.DeleteApiRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DeleteApiRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DeleteApiRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListApiVersionsRequest. */ + interface IListApiVersionsRequest { + + /** ListApiVersionsRequest parent */ + parent?: (string|null); + + /** ListApiVersionsRequest pageSize */ + pageSize?: (number|null); + + /** ListApiVersionsRequest pageToken */ + pageToken?: (string|null); + + /** ListApiVersionsRequest filter */ + filter?: (string|null); + } + + /** Represents a ListApiVersionsRequest. */ + class ListApiVersionsRequest implements IListApiVersionsRequest { + + /** + * Constructs a new ListApiVersionsRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.apigeeregistry.v1.IListApiVersionsRequest); + + /** ListApiVersionsRequest parent. */ + public parent: string; + + /** ListApiVersionsRequest pageSize. */ + public pageSize: number; + + /** ListApiVersionsRequest pageToken. */ + public pageToken: string; + + /** ListApiVersionsRequest filter. */ + public filter: string; + + /** + * Creates a new ListApiVersionsRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ListApiVersionsRequest instance + */ + public static create(properties?: google.cloud.apigeeregistry.v1.IListApiVersionsRequest): google.cloud.apigeeregistry.v1.ListApiVersionsRequest; + + /** + * Encodes the specified ListApiVersionsRequest message. Does not implicitly {@link google.cloud.apigeeregistry.v1.ListApiVersionsRequest.verify|verify} messages. + * @param message ListApiVersionsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.apigeeregistry.v1.IListApiVersionsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListApiVersionsRequest message, length delimited. Does not implicitly {@link google.cloud.apigeeregistry.v1.ListApiVersionsRequest.verify|verify} messages. + * @param message ListApiVersionsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.apigeeregistry.v1.IListApiVersionsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListApiVersionsRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListApiVersionsRequest + * @throws {Error} If the payload is not 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.apigeeregistry.v1.ListApiVersionsRequest; + + /** + * Decodes a ListApiVersionsRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListApiVersionsRequest + * @throws {Error} If the payload 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.apigeeregistry.v1.ListApiVersionsRequest; + + /** + * Verifies a ListApiVersionsRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListApiVersionsRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListApiVersionsRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.apigeeregistry.v1.ListApiVersionsRequest; + + /** + * Creates a plain object from a ListApiVersionsRequest message. Also converts values to other types if specified. + * @param message ListApiVersionsRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.apigeeregistry.v1.ListApiVersionsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListApiVersionsRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListApiVersionsRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListApiVersionsResponse. */ + interface IListApiVersionsResponse { + + /** ListApiVersionsResponse apiVersions */ + apiVersions?: (google.cloud.apigeeregistry.v1.IApiVersion[]|null); + + /** ListApiVersionsResponse nextPageToken */ + nextPageToken?: (string|null); + } + + /** Represents a ListApiVersionsResponse. */ + class ListApiVersionsResponse implements IListApiVersionsResponse { + + /** + * Constructs a new ListApiVersionsResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.apigeeregistry.v1.IListApiVersionsResponse); + + /** ListApiVersionsResponse apiVersions. */ + public apiVersions: google.cloud.apigeeregistry.v1.IApiVersion[]; + + /** ListApiVersionsResponse nextPageToken. */ + public nextPageToken: string; + + /** + * Creates a new ListApiVersionsResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ListApiVersionsResponse instance + */ + public static create(properties?: google.cloud.apigeeregistry.v1.IListApiVersionsResponse): google.cloud.apigeeregistry.v1.ListApiVersionsResponse; + + /** + * Encodes the specified ListApiVersionsResponse message. Does not implicitly {@link google.cloud.apigeeregistry.v1.ListApiVersionsResponse.verify|verify} messages. + * @param message ListApiVersionsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.apigeeregistry.v1.IListApiVersionsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListApiVersionsResponse message, length delimited. Does not implicitly {@link google.cloud.apigeeregistry.v1.ListApiVersionsResponse.verify|verify} messages. + * @param message ListApiVersionsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.apigeeregistry.v1.IListApiVersionsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListApiVersionsResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListApiVersionsResponse + * @throws {Error} If the payload is not 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.apigeeregistry.v1.ListApiVersionsResponse; + + /** + * Decodes a ListApiVersionsResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListApiVersionsResponse + * @throws {Error} If the payload 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.apigeeregistry.v1.ListApiVersionsResponse; + + /** + * Verifies a ListApiVersionsResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListApiVersionsResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListApiVersionsResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.apigeeregistry.v1.ListApiVersionsResponse; + + /** + * Creates a plain object from a ListApiVersionsResponse message. Also converts values to other types if specified. + * @param message ListApiVersionsResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.apigeeregistry.v1.ListApiVersionsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListApiVersionsResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListApiVersionsResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a GetApiVersionRequest. */ + interface IGetApiVersionRequest { + + /** GetApiVersionRequest name */ + name?: (string|null); + } + + /** Represents a GetApiVersionRequest. */ + class GetApiVersionRequest implements IGetApiVersionRequest { + + /** + * Constructs a new GetApiVersionRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.apigeeregistry.v1.IGetApiVersionRequest); + + /** GetApiVersionRequest name. */ + public name: string; + + /** + * Creates a new GetApiVersionRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GetApiVersionRequest instance + */ + public static create(properties?: google.cloud.apigeeregistry.v1.IGetApiVersionRequest): google.cloud.apigeeregistry.v1.GetApiVersionRequest; + + /** + * Encodes the specified GetApiVersionRequest message. Does not implicitly {@link google.cloud.apigeeregistry.v1.GetApiVersionRequest.verify|verify} messages. + * @param message GetApiVersionRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.apigeeregistry.v1.IGetApiVersionRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GetApiVersionRequest message, length delimited. Does not implicitly {@link google.cloud.apigeeregistry.v1.GetApiVersionRequest.verify|verify} messages. + * @param message GetApiVersionRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.apigeeregistry.v1.IGetApiVersionRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GetApiVersionRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GetApiVersionRequest + * @throws {Error} If the payload is not 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.apigeeregistry.v1.GetApiVersionRequest; + + /** + * Decodes a GetApiVersionRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GetApiVersionRequest + * @throws {Error} If the payload 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.apigeeregistry.v1.GetApiVersionRequest; + + /** + * Verifies a GetApiVersionRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GetApiVersionRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GetApiVersionRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.apigeeregistry.v1.GetApiVersionRequest; + + /** + * Creates a plain object from a GetApiVersionRequest message. Also converts values to other types if specified. + * @param message GetApiVersionRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.apigeeregistry.v1.GetApiVersionRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GetApiVersionRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GetApiVersionRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a CreateApiVersionRequest. */ + interface ICreateApiVersionRequest { + + /** CreateApiVersionRequest parent */ + parent?: (string|null); + + /** CreateApiVersionRequest apiVersion */ + apiVersion?: (google.cloud.apigeeregistry.v1.IApiVersion|null); + + /** CreateApiVersionRequest apiVersionId */ + apiVersionId?: (string|null); + } + + /** Represents a CreateApiVersionRequest. */ + class CreateApiVersionRequest implements ICreateApiVersionRequest { + + /** + * Constructs a new CreateApiVersionRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.apigeeregistry.v1.ICreateApiVersionRequest); + + /** CreateApiVersionRequest parent. */ + public parent: string; + + /** CreateApiVersionRequest apiVersion. */ + public apiVersion?: (google.cloud.apigeeregistry.v1.IApiVersion|null); + + /** CreateApiVersionRequest apiVersionId. */ + public apiVersionId: string; + + /** + * Creates a new CreateApiVersionRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns CreateApiVersionRequest instance + */ + public static create(properties?: google.cloud.apigeeregistry.v1.ICreateApiVersionRequest): google.cloud.apigeeregistry.v1.CreateApiVersionRequest; + + /** + * Encodes the specified CreateApiVersionRequest message. Does not implicitly {@link google.cloud.apigeeregistry.v1.CreateApiVersionRequest.verify|verify} messages. + * @param message CreateApiVersionRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.apigeeregistry.v1.ICreateApiVersionRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CreateApiVersionRequest message, length delimited. Does not implicitly {@link google.cloud.apigeeregistry.v1.CreateApiVersionRequest.verify|verify} messages. + * @param message CreateApiVersionRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.apigeeregistry.v1.ICreateApiVersionRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CreateApiVersionRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CreateApiVersionRequest + * @throws {Error} If the payload is not 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.apigeeregistry.v1.CreateApiVersionRequest; + + /** + * Decodes a CreateApiVersionRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CreateApiVersionRequest + * @throws {Error} If the payload 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.apigeeregistry.v1.CreateApiVersionRequest; + + /** + * Verifies a CreateApiVersionRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CreateApiVersionRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CreateApiVersionRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.apigeeregistry.v1.CreateApiVersionRequest; + + /** + * Creates a plain object from a CreateApiVersionRequest message. Also converts values to other types if specified. + * @param message CreateApiVersionRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.apigeeregistry.v1.CreateApiVersionRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CreateApiVersionRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CreateApiVersionRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an UpdateApiVersionRequest. */ + interface IUpdateApiVersionRequest { + + /** UpdateApiVersionRequest apiVersion */ + apiVersion?: (google.cloud.apigeeregistry.v1.IApiVersion|null); + + /** UpdateApiVersionRequest updateMask */ + updateMask?: (google.protobuf.IFieldMask|null); + + /** UpdateApiVersionRequest allowMissing */ + allowMissing?: (boolean|null); + } + + /** Represents an UpdateApiVersionRequest. */ + class UpdateApiVersionRequest implements IUpdateApiVersionRequest { + + /** + * Constructs a new UpdateApiVersionRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.apigeeregistry.v1.IUpdateApiVersionRequest); + + /** UpdateApiVersionRequest apiVersion. */ + public apiVersion?: (google.cloud.apigeeregistry.v1.IApiVersion|null); + + /** UpdateApiVersionRequest updateMask. */ + public updateMask?: (google.protobuf.IFieldMask|null); + + /** UpdateApiVersionRequest allowMissing. */ + public allowMissing: boolean; + + /** + * Creates a new UpdateApiVersionRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns UpdateApiVersionRequest instance + */ + public static create(properties?: google.cloud.apigeeregistry.v1.IUpdateApiVersionRequest): google.cloud.apigeeregistry.v1.UpdateApiVersionRequest; + + /** + * Encodes the specified UpdateApiVersionRequest message. Does not implicitly {@link google.cloud.apigeeregistry.v1.UpdateApiVersionRequest.verify|verify} messages. + * @param message UpdateApiVersionRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.apigeeregistry.v1.IUpdateApiVersionRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified UpdateApiVersionRequest message, length delimited. Does not implicitly {@link google.cloud.apigeeregistry.v1.UpdateApiVersionRequest.verify|verify} messages. + * @param message UpdateApiVersionRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.apigeeregistry.v1.IUpdateApiVersionRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an UpdateApiVersionRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns UpdateApiVersionRequest + * @throws {Error} If the payload is not 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.apigeeregistry.v1.UpdateApiVersionRequest; + + /** + * Decodes an UpdateApiVersionRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns UpdateApiVersionRequest + * @throws {Error} If the payload 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.apigeeregistry.v1.UpdateApiVersionRequest; + + /** + * Verifies an UpdateApiVersionRequest message. + * @param message Plain 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 UpdateApiVersionRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns UpdateApiVersionRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.apigeeregistry.v1.UpdateApiVersionRequest; + + /** + * Creates a plain object from an UpdateApiVersionRequest message. Also converts values to other types if specified. + * @param message UpdateApiVersionRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.apigeeregistry.v1.UpdateApiVersionRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this UpdateApiVersionRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for UpdateApiVersionRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a DeleteApiVersionRequest. */ + interface IDeleteApiVersionRequest { + + /** DeleteApiVersionRequest name */ + name?: (string|null); + + /** DeleteApiVersionRequest force */ + force?: (boolean|null); + } + + /** Represents a DeleteApiVersionRequest. */ + class DeleteApiVersionRequest implements IDeleteApiVersionRequest { + + /** + * Constructs a new DeleteApiVersionRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.apigeeregistry.v1.IDeleteApiVersionRequest); + + /** DeleteApiVersionRequest name. */ + public name: string; + + /** DeleteApiVersionRequest force. */ + public force: boolean; + + /** + * Creates a new DeleteApiVersionRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns DeleteApiVersionRequest instance + */ + public static create(properties?: google.cloud.apigeeregistry.v1.IDeleteApiVersionRequest): google.cloud.apigeeregistry.v1.DeleteApiVersionRequest; + + /** + * Encodes the specified DeleteApiVersionRequest message. Does not implicitly {@link google.cloud.apigeeregistry.v1.DeleteApiVersionRequest.verify|verify} messages. + * @param message DeleteApiVersionRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.apigeeregistry.v1.IDeleteApiVersionRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DeleteApiVersionRequest message, length delimited. Does not implicitly {@link google.cloud.apigeeregistry.v1.DeleteApiVersionRequest.verify|verify} messages. + * @param message DeleteApiVersionRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.apigeeregistry.v1.IDeleteApiVersionRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DeleteApiVersionRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DeleteApiVersionRequest + * @throws {Error} If the payload is not 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.apigeeregistry.v1.DeleteApiVersionRequest; + + /** + * Decodes a DeleteApiVersionRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DeleteApiVersionRequest + * @throws {Error} If the payload 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.apigeeregistry.v1.DeleteApiVersionRequest; + + /** + * Verifies a DeleteApiVersionRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DeleteApiVersionRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DeleteApiVersionRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.apigeeregistry.v1.DeleteApiVersionRequest; + + /** + * Creates a plain object from a DeleteApiVersionRequest message. Also converts values to other types if specified. + * @param message DeleteApiVersionRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.apigeeregistry.v1.DeleteApiVersionRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DeleteApiVersionRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DeleteApiVersionRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListApiSpecsRequest. */ + interface IListApiSpecsRequest { + + /** ListApiSpecsRequest parent */ + parent?: (string|null); + + /** ListApiSpecsRequest pageSize */ + pageSize?: (number|null); + + /** ListApiSpecsRequest pageToken */ + pageToken?: (string|null); + + /** ListApiSpecsRequest filter */ + filter?: (string|null); + } + + /** Represents a ListApiSpecsRequest. */ + class ListApiSpecsRequest implements IListApiSpecsRequest { + + /** + * Constructs a new ListApiSpecsRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.apigeeregistry.v1.IListApiSpecsRequest); + + /** ListApiSpecsRequest parent. */ + public parent: string; + + /** ListApiSpecsRequest pageSize. */ + public pageSize: number; + + /** ListApiSpecsRequest pageToken. */ + public pageToken: string; + + /** ListApiSpecsRequest filter. */ + public filter: string; + + /** + * Creates a new ListApiSpecsRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ListApiSpecsRequest instance + */ + public static create(properties?: google.cloud.apigeeregistry.v1.IListApiSpecsRequest): google.cloud.apigeeregistry.v1.ListApiSpecsRequest; + + /** + * Encodes the specified ListApiSpecsRequest message. Does not implicitly {@link google.cloud.apigeeregistry.v1.ListApiSpecsRequest.verify|verify} messages. + * @param message ListApiSpecsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.apigeeregistry.v1.IListApiSpecsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListApiSpecsRequest message, length delimited. Does not implicitly {@link google.cloud.apigeeregistry.v1.ListApiSpecsRequest.verify|verify} messages. + * @param message ListApiSpecsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.apigeeregistry.v1.IListApiSpecsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListApiSpecsRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListApiSpecsRequest + * @throws {Error} If the payload is not 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.apigeeregistry.v1.ListApiSpecsRequest; + + /** + * Decodes a ListApiSpecsRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListApiSpecsRequest + * @throws {Error} If the payload 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.apigeeregistry.v1.ListApiSpecsRequest; + + /** + * Verifies a ListApiSpecsRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListApiSpecsRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListApiSpecsRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.apigeeregistry.v1.ListApiSpecsRequest; + + /** + * Creates a plain object from a ListApiSpecsRequest message. Also converts values to other types if specified. + * @param message ListApiSpecsRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.apigeeregistry.v1.ListApiSpecsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListApiSpecsRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListApiSpecsRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListApiSpecsResponse. */ + interface IListApiSpecsResponse { + + /** ListApiSpecsResponse apiSpecs */ + apiSpecs?: (google.cloud.apigeeregistry.v1.IApiSpec[]|null); + + /** ListApiSpecsResponse nextPageToken */ + nextPageToken?: (string|null); + } + + /** Represents a ListApiSpecsResponse. */ + class ListApiSpecsResponse implements IListApiSpecsResponse { + + /** + * Constructs a new ListApiSpecsResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.apigeeregistry.v1.IListApiSpecsResponse); + + /** ListApiSpecsResponse apiSpecs. */ + public apiSpecs: google.cloud.apigeeregistry.v1.IApiSpec[]; + + /** ListApiSpecsResponse nextPageToken. */ + public nextPageToken: string; + + /** + * Creates a new ListApiSpecsResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ListApiSpecsResponse instance + */ + public static create(properties?: google.cloud.apigeeregistry.v1.IListApiSpecsResponse): google.cloud.apigeeregistry.v1.ListApiSpecsResponse; + + /** + * Encodes the specified ListApiSpecsResponse message. Does not implicitly {@link google.cloud.apigeeregistry.v1.ListApiSpecsResponse.verify|verify} messages. + * @param message ListApiSpecsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.apigeeregistry.v1.IListApiSpecsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListApiSpecsResponse message, length delimited. Does not implicitly {@link google.cloud.apigeeregistry.v1.ListApiSpecsResponse.verify|verify} messages. + * @param message ListApiSpecsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.apigeeregistry.v1.IListApiSpecsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListApiSpecsResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListApiSpecsResponse + * @throws {Error} If the payload is not 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.apigeeregistry.v1.ListApiSpecsResponse; + + /** + * Decodes a ListApiSpecsResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListApiSpecsResponse + * @throws {Error} If the payload 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.apigeeregistry.v1.ListApiSpecsResponse; + + /** + * Verifies a ListApiSpecsResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListApiSpecsResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListApiSpecsResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.apigeeregistry.v1.ListApiSpecsResponse; + + /** + * Creates a plain object from a ListApiSpecsResponse message. Also converts values to other types if specified. + * @param message ListApiSpecsResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.apigeeregistry.v1.ListApiSpecsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListApiSpecsResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListApiSpecsResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a GetApiSpecRequest. */ + interface IGetApiSpecRequest { + + /** GetApiSpecRequest name */ + name?: (string|null); + } + + /** Represents a GetApiSpecRequest. */ + class GetApiSpecRequest implements IGetApiSpecRequest { + + /** + * Constructs a new GetApiSpecRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.apigeeregistry.v1.IGetApiSpecRequest); + + /** GetApiSpecRequest name. */ + public name: string; + + /** + * Creates a new GetApiSpecRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GetApiSpecRequest instance + */ + public static create(properties?: google.cloud.apigeeregistry.v1.IGetApiSpecRequest): google.cloud.apigeeregistry.v1.GetApiSpecRequest; + + /** + * Encodes the specified GetApiSpecRequest message. Does not implicitly {@link google.cloud.apigeeregistry.v1.GetApiSpecRequest.verify|verify} messages. + * @param message GetApiSpecRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.apigeeregistry.v1.IGetApiSpecRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GetApiSpecRequest message, length delimited. Does not implicitly {@link google.cloud.apigeeregistry.v1.GetApiSpecRequest.verify|verify} messages. + * @param message GetApiSpecRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.apigeeregistry.v1.IGetApiSpecRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GetApiSpecRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GetApiSpecRequest + * @throws {Error} If the payload is not 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.apigeeregistry.v1.GetApiSpecRequest; + + /** + * Decodes a GetApiSpecRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GetApiSpecRequest + * @throws {Error} If the payload 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.apigeeregistry.v1.GetApiSpecRequest; + + /** + * Verifies a GetApiSpecRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GetApiSpecRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GetApiSpecRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.apigeeregistry.v1.GetApiSpecRequest; + + /** + * Creates a plain object from a GetApiSpecRequest message. Also converts values to other types if specified. + * @param message GetApiSpecRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.apigeeregistry.v1.GetApiSpecRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GetApiSpecRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GetApiSpecRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a GetApiSpecContentsRequest. */ + interface IGetApiSpecContentsRequest { + + /** GetApiSpecContentsRequest name */ + name?: (string|null); + } + + /** Represents a GetApiSpecContentsRequest. */ + class GetApiSpecContentsRequest implements IGetApiSpecContentsRequest { + + /** + * Constructs a new GetApiSpecContentsRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.apigeeregistry.v1.IGetApiSpecContentsRequest); + + /** GetApiSpecContentsRequest name. */ + public name: string; + + /** + * Creates a new GetApiSpecContentsRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GetApiSpecContentsRequest instance + */ + public static create(properties?: google.cloud.apigeeregistry.v1.IGetApiSpecContentsRequest): google.cloud.apigeeregistry.v1.GetApiSpecContentsRequest; + + /** + * Encodes the specified GetApiSpecContentsRequest message. Does not implicitly {@link google.cloud.apigeeregistry.v1.GetApiSpecContentsRequest.verify|verify} messages. + * @param message GetApiSpecContentsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.apigeeregistry.v1.IGetApiSpecContentsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GetApiSpecContentsRequest message, length delimited. Does not implicitly {@link google.cloud.apigeeregistry.v1.GetApiSpecContentsRequest.verify|verify} messages. + * @param message GetApiSpecContentsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.apigeeregistry.v1.IGetApiSpecContentsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GetApiSpecContentsRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GetApiSpecContentsRequest + * @throws {Error} If the payload is not 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.apigeeregistry.v1.GetApiSpecContentsRequest; + + /** + * Decodes a GetApiSpecContentsRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GetApiSpecContentsRequest + * @throws {Error} If the payload 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.apigeeregistry.v1.GetApiSpecContentsRequest; + + /** + * Verifies a GetApiSpecContentsRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GetApiSpecContentsRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GetApiSpecContentsRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.apigeeregistry.v1.GetApiSpecContentsRequest; + + /** + * Creates a plain object from a GetApiSpecContentsRequest message. Also converts values to other types if specified. + * @param message GetApiSpecContentsRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.apigeeregistry.v1.GetApiSpecContentsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GetApiSpecContentsRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GetApiSpecContentsRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a CreateApiSpecRequest. */ + interface ICreateApiSpecRequest { + + /** CreateApiSpecRequest parent */ + parent?: (string|null); + + /** CreateApiSpecRequest apiSpec */ + apiSpec?: (google.cloud.apigeeregistry.v1.IApiSpec|null); + + /** CreateApiSpecRequest apiSpecId */ + apiSpecId?: (string|null); + } + + /** Represents a CreateApiSpecRequest. */ + class CreateApiSpecRequest implements ICreateApiSpecRequest { + + /** + * Constructs a new CreateApiSpecRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.apigeeregistry.v1.ICreateApiSpecRequest); + + /** CreateApiSpecRequest parent. */ + public parent: string; + + /** CreateApiSpecRequest apiSpec. */ + public apiSpec?: (google.cloud.apigeeregistry.v1.IApiSpec|null); + + /** CreateApiSpecRequest apiSpecId. */ + public apiSpecId: string; + + /** + * Creates a new CreateApiSpecRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns CreateApiSpecRequest instance + */ + public static create(properties?: google.cloud.apigeeregistry.v1.ICreateApiSpecRequest): google.cloud.apigeeregistry.v1.CreateApiSpecRequest; + + /** + * Encodes the specified CreateApiSpecRequest message. Does not implicitly {@link google.cloud.apigeeregistry.v1.CreateApiSpecRequest.verify|verify} messages. + * @param message CreateApiSpecRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.apigeeregistry.v1.ICreateApiSpecRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CreateApiSpecRequest message, length delimited. Does not implicitly {@link google.cloud.apigeeregistry.v1.CreateApiSpecRequest.verify|verify} messages. + * @param message CreateApiSpecRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.apigeeregistry.v1.ICreateApiSpecRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CreateApiSpecRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CreateApiSpecRequest + * @throws {Error} If the payload is not 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.apigeeregistry.v1.CreateApiSpecRequest; + + /** + * Decodes a CreateApiSpecRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CreateApiSpecRequest + * @throws {Error} If the payload 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.apigeeregistry.v1.CreateApiSpecRequest; + + /** + * Verifies a CreateApiSpecRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CreateApiSpecRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CreateApiSpecRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.apigeeregistry.v1.CreateApiSpecRequest; + + /** + * Creates a plain object from a CreateApiSpecRequest message. Also converts values to other types if specified. + * @param message CreateApiSpecRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.apigeeregistry.v1.CreateApiSpecRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CreateApiSpecRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CreateApiSpecRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an UpdateApiSpecRequest. */ + interface IUpdateApiSpecRequest { + + /** UpdateApiSpecRequest apiSpec */ + apiSpec?: (google.cloud.apigeeregistry.v1.IApiSpec|null); + + /** UpdateApiSpecRequest updateMask */ + updateMask?: (google.protobuf.IFieldMask|null); + + /** UpdateApiSpecRequest allowMissing */ + allowMissing?: (boolean|null); + } + + /** Represents an UpdateApiSpecRequest. */ + class UpdateApiSpecRequest implements IUpdateApiSpecRequest { + + /** + * Constructs a new UpdateApiSpecRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.apigeeregistry.v1.IUpdateApiSpecRequest); + + /** UpdateApiSpecRequest apiSpec. */ + public apiSpec?: (google.cloud.apigeeregistry.v1.IApiSpec|null); + + /** UpdateApiSpecRequest updateMask. */ + public updateMask?: (google.protobuf.IFieldMask|null); + + /** UpdateApiSpecRequest allowMissing. */ + public allowMissing: boolean; + + /** + * Creates a new UpdateApiSpecRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns UpdateApiSpecRequest instance + */ + public static create(properties?: google.cloud.apigeeregistry.v1.IUpdateApiSpecRequest): google.cloud.apigeeregistry.v1.UpdateApiSpecRequest; + + /** + * Encodes the specified UpdateApiSpecRequest message. Does not implicitly {@link google.cloud.apigeeregistry.v1.UpdateApiSpecRequest.verify|verify} messages. + * @param message UpdateApiSpecRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.apigeeregistry.v1.IUpdateApiSpecRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified UpdateApiSpecRequest message, length delimited. Does not implicitly {@link google.cloud.apigeeregistry.v1.UpdateApiSpecRequest.verify|verify} messages. + * @param message UpdateApiSpecRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.apigeeregistry.v1.IUpdateApiSpecRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an UpdateApiSpecRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns UpdateApiSpecRequest + * @throws {Error} If the payload is not 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.apigeeregistry.v1.UpdateApiSpecRequest; + + /** + * Decodes an UpdateApiSpecRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns UpdateApiSpecRequest + * @throws {Error} If the payload 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.apigeeregistry.v1.UpdateApiSpecRequest; + + /** + * Verifies an UpdateApiSpecRequest message. + * @param message Plain 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 UpdateApiSpecRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns UpdateApiSpecRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.apigeeregistry.v1.UpdateApiSpecRequest; + + /** + * Creates a plain object from an UpdateApiSpecRequest message. Also converts values to other types if specified. + * @param message UpdateApiSpecRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.apigeeregistry.v1.UpdateApiSpecRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this UpdateApiSpecRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for UpdateApiSpecRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a DeleteApiSpecRequest. */ + interface IDeleteApiSpecRequest { + + /** DeleteApiSpecRequest name */ + name?: (string|null); + + /** DeleteApiSpecRequest force */ + force?: (boolean|null); + } + + /** Represents a DeleteApiSpecRequest. */ + class DeleteApiSpecRequest implements IDeleteApiSpecRequest { + + /** + * Constructs a new DeleteApiSpecRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.apigeeregistry.v1.IDeleteApiSpecRequest); + + /** DeleteApiSpecRequest name. */ + public name: string; + + /** DeleteApiSpecRequest force. */ + public force: boolean; + + /** + * Creates a new DeleteApiSpecRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns DeleteApiSpecRequest instance + */ + public static create(properties?: google.cloud.apigeeregistry.v1.IDeleteApiSpecRequest): google.cloud.apigeeregistry.v1.DeleteApiSpecRequest; + + /** + * Encodes the specified DeleteApiSpecRequest message. Does not implicitly {@link google.cloud.apigeeregistry.v1.DeleteApiSpecRequest.verify|verify} messages. + * @param message DeleteApiSpecRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.apigeeregistry.v1.IDeleteApiSpecRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DeleteApiSpecRequest message, length delimited. Does not implicitly {@link google.cloud.apigeeregistry.v1.DeleteApiSpecRequest.verify|verify} messages. + * @param message DeleteApiSpecRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.apigeeregistry.v1.IDeleteApiSpecRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DeleteApiSpecRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DeleteApiSpecRequest + * @throws {Error} If the payload is not 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.apigeeregistry.v1.DeleteApiSpecRequest; + + /** + * Decodes a DeleteApiSpecRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DeleteApiSpecRequest + * @throws {Error} If the payload 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.apigeeregistry.v1.DeleteApiSpecRequest; + + /** + * Verifies a DeleteApiSpecRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DeleteApiSpecRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DeleteApiSpecRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.apigeeregistry.v1.DeleteApiSpecRequest; + + /** + * Creates a plain object from a DeleteApiSpecRequest message. Also converts values to other types if specified. + * @param message DeleteApiSpecRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.apigeeregistry.v1.DeleteApiSpecRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DeleteApiSpecRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DeleteApiSpecRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TagApiSpecRevisionRequest. */ + interface ITagApiSpecRevisionRequest { + + /** TagApiSpecRevisionRequest name */ + name?: (string|null); + + /** TagApiSpecRevisionRequest tag */ + tag?: (string|null); + } + + /** Represents a TagApiSpecRevisionRequest. */ + class TagApiSpecRevisionRequest implements ITagApiSpecRevisionRequest { + + /** + * Constructs a new TagApiSpecRevisionRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.apigeeregistry.v1.ITagApiSpecRevisionRequest); + + /** TagApiSpecRevisionRequest name. */ + public name: string; + + /** TagApiSpecRevisionRequest tag. */ + public tag: string; + + /** + * Creates a new TagApiSpecRevisionRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns TagApiSpecRevisionRequest instance + */ + public static create(properties?: google.cloud.apigeeregistry.v1.ITagApiSpecRevisionRequest): google.cloud.apigeeregistry.v1.TagApiSpecRevisionRequest; + + /** + * Encodes the specified TagApiSpecRevisionRequest message. Does not implicitly {@link google.cloud.apigeeregistry.v1.TagApiSpecRevisionRequest.verify|verify} messages. + * @param message TagApiSpecRevisionRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.apigeeregistry.v1.ITagApiSpecRevisionRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified TagApiSpecRevisionRequest message, length delimited. Does not implicitly {@link google.cloud.apigeeregistry.v1.TagApiSpecRevisionRequest.verify|verify} messages. + * @param message TagApiSpecRevisionRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.apigeeregistry.v1.ITagApiSpecRevisionRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TagApiSpecRevisionRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns TagApiSpecRevisionRequest + * @throws {Error} If the payload is not 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.apigeeregistry.v1.TagApiSpecRevisionRequest; + + /** + * Decodes a TagApiSpecRevisionRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns TagApiSpecRevisionRequest + * @throws {Error} If the payload 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.apigeeregistry.v1.TagApiSpecRevisionRequest; + + /** + * Verifies a TagApiSpecRevisionRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a TagApiSpecRevisionRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns TagApiSpecRevisionRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.apigeeregistry.v1.TagApiSpecRevisionRequest; + + /** + * Creates a plain object from a TagApiSpecRevisionRequest message. Also converts values to other types if specified. + * @param message TagApiSpecRevisionRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.apigeeregistry.v1.TagApiSpecRevisionRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this TagApiSpecRevisionRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for TagApiSpecRevisionRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListApiSpecRevisionsRequest. */ + interface IListApiSpecRevisionsRequest { + + /** ListApiSpecRevisionsRequest name */ + name?: (string|null); + + /** ListApiSpecRevisionsRequest pageSize */ + pageSize?: (number|null); + + /** ListApiSpecRevisionsRequest pageToken */ + pageToken?: (string|null); + } + + /** Represents a ListApiSpecRevisionsRequest. */ + class ListApiSpecRevisionsRequest implements IListApiSpecRevisionsRequest { + + /** + * Constructs a new ListApiSpecRevisionsRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.apigeeregistry.v1.IListApiSpecRevisionsRequest); + + /** ListApiSpecRevisionsRequest name. */ + public name: string; + + /** ListApiSpecRevisionsRequest pageSize. */ + public pageSize: number; + + /** ListApiSpecRevisionsRequest pageToken. */ + public pageToken: string; + + /** + * Creates a new ListApiSpecRevisionsRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ListApiSpecRevisionsRequest instance + */ + public static create(properties?: google.cloud.apigeeregistry.v1.IListApiSpecRevisionsRequest): google.cloud.apigeeregistry.v1.ListApiSpecRevisionsRequest; + + /** + * Encodes the specified ListApiSpecRevisionsRequest message. Does not implicitly {@link google.cloud.apigeeregistry.v1.ListApiSpecRevisionsRequest.verify|verify} messages. + * @param message ListApiSpecRevisionsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.apigeeregistry.v1.IListApiSpecRevisionsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListApiSpecRevisionsRequest message, length delimited. Does not implicitly {@link google.cloud.apigeeregistry.v1.ListApiSpecRevisionsRequest.verify|verify} messages. + * @param message ListApiSpecRevisionsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.apigeeregistry.v1.IListApiSpecRevisionsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListApiSpecRevisionsRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListApiSpecRevisionsRequest + * @throws {Error} If the payload is not 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.apigeeregistry.v1.ListApiSpecRevisionsRequest; + + /** + * Decodes a ListApiSpecRevisionsRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListApiSpecRevisionsRequest + * @throws {Error} If the payload 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.apigeeregistry.v1.ListApiSpecRevisionsRequest; + + /** + * Verifies a ListApiSpecRevisionsRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListApiSpecRevisionsRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListApiSpecRevisionsRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.apigeeregistry.v1.ListApiSpecRevisionsRequest; + + /** + * Creates a plain object from a ListApiSpecRevisionsRequest message. Also converts values to other types if specified. + * @param message ListApiSpecRevisionsRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.apigeeregistry.v1.ListApiSpecRevisionsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListApiSpecRevisionsRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListApiSpecRevisionsRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListApiSpecRevisionsResponse. */ + interface IListApiSpecRevisionsResponse { + + /** ListApiSpecRevisionsResponse apiSpecs */ + apiSpecs?: (google.cloud.apigeeregistry.v1.IApiSpec[]|null); + + /** ListApiSpecRevisionsResponse nextPageToken */ + nextPageToken?: (string|null); + } + + /** Represents a ListApiSpecRevisionsResponse. */ + class ListApiSpecRevisionsResponse implements IListApiSpecRevisionsResponse { + + /** + * Constructs a new ListApiSpecRevisionsResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.apigeeregistry.v1.IListApiSpecRevisionsResponse); + + /** ListApiSpecRevisionsResponse apiSpecs. */ + public apiSpecs: google.cloud.apigeeregistry.v1.IApiSpec[]; + + /** ListApiSpecRevisionsResponse nextPageToken. */ + public nextPageToken: string; + + /** + * Creates a new ListApiSpecRevisionsResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ListApiSpecRevisionsResponse instance + */ + public static create(properties?: google.cloud.apigeeregistry.v1.IListApiSpecRevisionsResponse): google.cloud.apigeeregistry.v1.ListApiSpecRevisionsResponse; + + /** + * Encodes the specified ListApiSpecRevisionsResponse message. Does not implicitly {@link google.cloud.apigeeregistry.v1.ListApiSpecRevisionsResponse.verify|verify} messages. + * @param message ListApiSpecRevisionsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.apigeeregistry.v1.IListApiSpecRevisionsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListApiSpecRevisionsResponse message, length delimited. Does not implicitly {@link google.cloud.apigeeregistry.v1.ListApiSpecRevisionsResponse.verify|verify} messages. + * @param message ListApiSpecRevisionsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.apigeeregistry.v1.IListApiSpecRevisionsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListApiSpecRevisionsResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListApiSpecRevisionsResponse + * @throws {Error} If the payload is not 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.apigeeregistry.v1.ListApiSpecRevisionsResponse; + + /** + * Decodes a ListApiSpecRevisionsResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListApiSpecRevisionsResponse + * @throws {Error} If the payload 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.apigeeregistry.v1.ListApiSpecRevisionsResponse; + + /** + * Verifies a ListApiSpecRevisionsResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListApiSpecRevisionsResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListApiSpecRevisionsResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.apigeeregistry.v1.ListApiSpecRevisionsResponse; + + /** + * Creates a plain object from a ListApiSpecRevisionsResponse message. Also converts values to other types if specified. + * @param message ListApiSpecRevisionsResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.apigeeregistry.v1.ListApiSpecRevisionsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListApiSpecRevisionsResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListApiSpecRevisionsResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a RollbackApiSpecRequest. */ + interface IRollbackApiSpecRequest { + + /** RollbackApiSpecRequest name */ + name?: (string|null); + + /** RollbackApiSpecRequest revisionId */ + revisionId?: (string|null); + } + + /** Represents a RollbackApiSpecRequest. */ + class RollbackApiSpecRequest implements IRollbackApiSpecRequest { + + /** + * Constructs a new RollbackApiSpecRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.apigeeregistry.v1.IRollbackApiSpecRequest); + + /** RollbackApiSpecRequest name. */ + public name: string; + + /** RollbackApiSpecRequest revisionId. */ + public revisionId: string; + + /** + * Creates a new RollbackApiSpecRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns RollbackApiSpecRequest instance + */ + public static create(properties?: google.cloud.apigeeregistry.v1.IRollbackApiSpecRequest): google.cloud.apigeeregistry.v1.RollbackApiSpecRequest; + + /** + * Encodes the specified RollbackApiSpecRequest message. Does not implicitly {@link google.cloud.apigeeregistry.v1.RollbackApiSpecRequest.verify|verify} messages. + * @param message RollbackApiSpecRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.apigeeregistry.v1.IRollbackApiSpecRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified RollbackApiSpecRequest message, length delimited. Does not implicitly {@link google.cloud.apigeeregistry.v1.RollbackApiSpecRequest.verify|verify} messages. + * @param message RollbackApiSpecRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.apigeeregistry.v1.IRollbackApiSpecRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a RollbackApiSpecRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns RollbackApiSpecRequest + * @throws {Error} If the payload is not 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.apigeeregistry.v1.RollbackApiSpecRequest; + + /** + * Decodes a RollbackApiSpecRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns RollbackApiSpecRequest + * @throws {Error} If the payload 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.apigeeregistry.v1.RollbackApiSpecRequest; + + /** + * Verifies a RollbackApiSpecRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a RollbackApiSpecRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns RollbackApiSpecRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.apigeeregistry.v1.RollbackApiSpecRequest; + + /** + * Creates a plain object from a RollbackApiSpecRequest message. Also converts values to other types if specified. + * @param message RollbackApiSpecRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.apigeeregistry.v1.RollbackApiSpecRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this RollbackApiSpecRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for RollbackApiSpecRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a DeleteApiSpecRevisionRequest. */ + interface IDeleteApiSpecRevisionRequest { + + /** DeleteApiSpecRevisionRequest name */ + name?: (string|null); + } + + /** Represents a DeleteApiSpecRevisionRequest. */ + class DeleteApiSpecRevisionRequest implements IDeleteApiSpecRevisionRequest { + + /** + * Constructs a new DeleteApiSpecRevisionRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.apigeeregistry.v1.IDeleteApiSpecRevisionRequest); + + /** DeleteApiSpecRevisionRequest name. */ + public name: string; + + /** + * Creates a new DeleteApiSpecRevisionRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns DeleteApiSpecRevisionRequest instance + */ + public static create(properties?: google.cloud.apigeeregistry.v1.IDeleteApiSpecRevisionRequest): google.cloud.apigeeregistry.v1.DeleteApiSpecRevisionRequest; + + /** + * Encodes the specified DeleteApiSpecRevisionRequest message. Does not implicitly {@link google.cloud.apigeeregistry.v1.DeleteApiSpecRevisionRequest.verify|verify} messages. + * @param message DeleteApiSpecRevisionRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.apigeeregistry.v1.IDeleteApiSpecRevisionRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DeleteApiSpecRevisionRequest message, length delimited. Does not implicitly {@link google.cloud.apigeeregistry.v1.DeleteApiSpecRevisionRequest.verify|verify} messages. + * @param message DeleteApiSpecRevisionRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.apigeeregistry.v1.IDeleteApiSpecRevisionRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DeleteApiSpecRevisionRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DeleteApiSpecRevisionRequest + * @throws {Error} If the payload is not 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.apigeeregistry.v1.DeleteApiSpecRevisionRequest; + + /** + * Decodes a DeleteApiSpecRevisionRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DeleteApiSpecRevisionRequest + * @throws {Error} If the payload 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.apigeeregistry.v1.DeleteApiSpecRevisionRequest; + + /** + * Verifies a DeleteApiSpecRevisionRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DeleteApiSpecRevisionRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DeleteApiSpecRevisionRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.apigeeregistry.v1.DeleteApiSpecRevisionRequest; + + /** + * Creates a plain object from a DeleteApiSpecRevisionRequest message. Also converts values to other types if specified. + * @param message DeleteApiSpecRevisionRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.apigeeregistry.v1.DeleteApiSpecRevisionRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DeleteApiSpecRevisionRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DeleteApiSpecRevisionRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListApiDeploymentsRequest. */ + interface IListApiDeploymentsRequest { + + /** ListApiDeploymentsRequest parent */ + parent?: (string|null); + + /** ListApiDeploymentsRequest pageSize */ + pageSize?: (number|null); + + /** ListApiDeploymentsRequest pageToken */ + pageToken?: (string|null); + + /** ListApiDeploymentsRequest filter */ + filter?: (string|null); + } + + /** Represents a ListApiDeploymentsRequest. */ + class ListApiDeploymentsRequest implements IListApiDeploymentsRequest { + + /** + * Constructs a new ListApiDeploymentsRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.apigeeregistry.v1.IListApiDeploymentsRequest); + + /** ListApiDeploymentsRequest parent. */ + public parent: string; + + /** ListApiDeploymentsRequest pageSize. */ + public pageSize: number; + + /** ListApiDeploymentsRequest pageToken. */ + public pageToken: string; + + /** ListApiDeploymentsRequest filter. */ + public filter: string; + + /** + * Creates a new ListApiDeploymentsRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ListApiDeploymentsRequest instance + */ + public static create(properties?: google.cloud.apigeeregistry.v1.IListApiDeploymentsRequest): google.cloud.apigeeregistry.v1.ListApiDeploymentsRequest; + + /** + * Encodes the specified ListApiDeploymentsRequest message. Does not implicitly {@link google.cloud.apigeeregistry.v1.ListApiDeploymentsRequest.verify|verify} messages. + * @param message ListApiDeploymentsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.apigeeregistry.v1.IListApiDeploymentsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListApiDeploymentsRequest message, length delimited. Does not implicitly {@link google.cloud.apigeeregistry.v1.ListApiDeploymentsRequest.verify|verify} messages. + * @param message ListApiDeploymentsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.apigeeregistry.v1.IListApiDeploymentsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListApiDeploymentsRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListApiDeploymentsRequest + * @throws {Error} If the payload is not 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.apigeeregistry.v1.ListApiDeploymentsRequest; + + /** + * Decodes a ListApiDeploymentsRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListApiDeploymentsRequest + * @throws {Error} If the payload 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.apigeeregistry.v1.ListApiDeploymentsRequest; + + /** + * Verifies a ListApiDeploymentsRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListApiDeploymentsRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListApiDeploymentsRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.apigeeregistry.v1.ListApiDeploymentsRequest; + + /** + * Creates a plain object from a ListApiDeploymentsRequest message. Also converts values to other types if specified. + * @param message ListApiDeploymentsRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.apigeeregistry.v1.ListApiDeploymentsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListApiDeploymentsRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListApiDeploymentsRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListApiDeploymentsResponse. */ + interface IListApiDeploymentsResponse { + + /** ListApiDeploymentsResponse apiDeployments */ + apiDeployments?: (google.cloud.apigeeregistry.v1.IApiDeployment[]|null); + + /** ListApiDeploymentsResponse nextPageToken */ + nextPageToken?: (string|null); + } + + /** Represents a ListApiDeploymentsResponse. */ + class ListApiDeploymentsResponse implements IListApiDeploymentsResponse { + + /** + * Constructs a new ListApiDeploymentsResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.apigeeregistry.v1.IListApiDeploymentsResponse); + + /** ListApiDeploymentsResponse apiDeployments. */ + public apiDeployments: google.cloud.apigeeregistry.v1.IApiDeployment[]; + + /** ListApiDeploymentsResponse nextPageToken. */ + public nextPageToken: string; + + /** + * Creates a new ListApiDeploymentsResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ListApiDeploymentsResponse instance + */ + public static create(properties?: google.cloud.apigeeregistry.v1.IListApiDeploymentsResponse): google.cloud.apigeeregistry.v1.ListApiDeploymentsResponse; + + /** + * Encodes the specified ListApiDeploymentsResponse message. Does not implicitly {@link google.cloud.apigeeregistry.v1.ListApiDeploymentsResponse.verify|verify} messages. + * @param message ListApiDeploymentsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.apigeeregistry.v1.IListApiDeploymentsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListApiDeploymentsResponse message, length delimited. Does not implicitly {@link google.cloud.apigeeregistry.v1.ListApiDeploymentsResponse.verify|verify} messages. + * @param message ListApiDeploymentsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.apigeeregistry.v1.IListApiDeploymentsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListApiDeploymentsResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListApiDeploymentsResponse + * @throws {Error} If the payload is not 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.apigeeregistry.v1.ListApiDeploymentsResponse; + + /** + * Decodes a ListApiDeploymentsResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListApiDeploymentsResponse + * @throws {Error} If the payload 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.apigeeregistry.v1.ListApiDeploymentsResponse; + + /** + * Verifies a ListApiDeploymentsResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListApiDeploymentsResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListApiDeploymentsResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.apigeeregistry.v1.ListApiDeploymentsResponse; + + /** + * Creates a plain object from a ListApiDeploymentsResponse message. Also converts values to other types if specified. + * @param message ListApiDeploymentsResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.apigeeregistry.v1.ListApiDeploymentsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListApiDeploymentsResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListApiDeploymentsResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a GetApiDeploymentRequest. */ + interface IGetApiDeploymentRequest { + + /** GetApiDeploymentRequest name */ + name?: (string|null); + } + + /** Represents a GetApiDeploymentRequest. */ + class GetApiDeploymentRequest implements IGetApiDeploymentRequest { + + /** + * Constructs a new GetApiDeploymentRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.apigeeregistry.v1.IGetApiDeploymentRequest); + + /** GetApiDeploymentRequest name. */ + public name: string; + + /** + * Creates a new GetApiDeploymentRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GetApiDeploymentRequest instance + */ + public static create(properties?: google.cloud.apigeeregistry.v1.IGetApiDeploymentRequest): google.cloud.apigeeregistry.v1.GetApiDeploymentRequest; + + /** + * Encodes the specified GetApiDeploymentRequest message. Does not implicitly {@link google.cloud.apigeeregistry.v1.GetApiDeploymentRequest.verify|verify} messages. + * @param message GetApiDeploymentRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.apigeeregistry.v1.IGetApiDeploymentRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GetApiDeploymentRequest message, length delimited. Does not implicitly {@link google.cloud.apigeeregistry.v1.GetApiDeploymentRequest.verify|verify} messages. + * @param message GetApiDeploymentRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.apigeeregistry.v1.IGetApiDeploymentRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GetApiDeploymentRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GetApiDeploymentRequest + * @throws {Error} If the payload is not 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.apigeeregistry.v1.GetApiDeploymentRequest; + + /** + * Decodes a GetApiDeploymentRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GetApiDeploymentRequest + * @throws {Error} If the payload 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.apigeeregistry.v1.GetApiDeploymentRequest; + + /** + * Verifies a GetApiDeploymentRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GetApiDeploymentRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GetApiDeploymentRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.apigeeregistry.v1.GetApiDeploymentRequest; + + /** + * Creates a plain object from a GetApiDeploymentRequest message. Also converts values to other types if specified. + * @param message GetApiDeploymentRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.apigeeregistry.v1.GetApiDeploymentRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GetApiDeploymentRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GetApiDeploymentRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a CreateApiDeploymentRequest. */ + interface ICreateApiDeploymentRequest { + + /** CreateApiDeploymentRequest parent */ + parent?: (string|null); + + /** CreateApiDeploymentRequest apiDeployment */ + apiDeployment?: (google.cloud.apigeeregistry.v1.IApiDeployment|null); + + /** CreateApiDeploymentRequest apiDeploymentId */ + apiDeploymentId?: (string|null); + } + + /** Represents a CreateApiDeploymentRequest. */ + class CreateApiDeploymentRequest implements ICreateApiDeploymentRequest { + + /** + * Constructs a new CreateApiDeploymentRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.apigeeregistry.v1.ICreateApiDeploymentRequest); + + /** CreateApiDeploymentRequest parent. */ + public parent: string; + + /** CreateApiDeploymentRequest apiDeployment. */ + public apiDeployment?: (google.cloud.apigeeregistry.v1.IApiDeployment|null); + + /** CreateApiDeploymentRequest apiDeploymentId. */ + public apiDeploymentId: string; + + /** + * Creates a new CreateApiDeploymentRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns CreateApiDeploymentRequest instance + */ + public static create(properties?: google.cloud.apigeeregistry.v1.ICreateApiDeploymentRequest): google.cloud.apigeeregistry.v1.CreateApiDeploymentRequest; + + /** + * Encodes the specified CreateApiDeploymentRequest message. Does not implicitly {@link google.cloud.apigeeregistry.v1.CreateApiDeploymentRequest.verify|verify} messages. + * @param message CreateApiDeploymentRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.apigeeregistry.v1.ICreateApiDeploymentRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CreateApiDeploymentRequest message, length delimited. Does not implicitly {@link google.cloud.apigeeregistry.v1.CreateApiDeploymentRequest.verify|verify} messages. + * @param message CreateApiDeploymentRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.apigeeregistry.v1.ICreateApiDeploymentRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CreateApiDeploymentRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CreateApiDeploymentRequest + * @throws {Error} If the payload is not 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.apigeeregistry.v1.CreateApiDeploymentRequest; + + /** + * Decodes a CreateApiDeploymentRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CreateApiDeploymentRequest + * @throws {Error} If the payload 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.apigeeregistry.v1.CreateApiDeploymentRequest; + + /** + * Verifies a CreateApiDeploymentRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CreateApiDeploymentRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CreateApiDeploymentRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.apigeeregistry.v1.CreateApiDeploymentRequest; + + /** + * Creates a plain object from a CreateApiDeploymentRequest message. Also converts values to other types if specified. + * @param message CreateApiDeploymentRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.apigeeregistry.v1.CreateApiDeploymentRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CreateApiDeploymentRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CreateApiDeploymentRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an UpdateApiDeploymentRequest. */ + interface IUpdateApiDeploymentRequest { + + /** UpdateApiDeploymentRequest apiDeployment */ + apiDeployment?: (google.cloud.apigeeregistry.v1.IApiDeployment|null); + + /** UpdateApiDeploymentRequest updateMask */ + updateMask?: (google.protobuf.IFieldMask|null); + + /** UpdateApiDeploymentRequest allowMissing */ + allowMissing?: (boolean|null); + } + + /** Represents an UpdateApiDeploymentRequest. */ + class UpdateApiDeploymentRequest implements IUpdateApiDeploymentRequest { + + /** + * Constructs a new UpdateApiDeploymentRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.apigeeregistry.v1.IUpdateApiDeploymentRequest); + + /** UpdateApiDeploymentRequest apiDeployment. */ + public apiDeployment?: (google.cloud.apigeeregistry.v1.IApiDeployment|null); + + /** UpdateApiDeploymentRequest updateMask. */ + public updateMask?: (google.protobuf.IFieldMask|null); + + /** UpdateApiDeploymentRequest allowMissing. */ + public allowMissing: boolean; + + /** + * Creates a new UpdateApiDeploymentRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns UpdateApiDeploymentRequest instance + */ + public static create(properties?: google.cloud.apigeeregistry.v1.IUpdateApiDeploymentRequest): google.cloud.apigeeregistry.v1.UpdateApiDeploymentRequest; + + /** + * Encodes the specified UpdateApiDeploymentRequest message. Does not implicitly {@link google.cloud.apigeeregistry.v1.UpdateApiDeploymentRequest.verify|verify} messages. + * @param message UpdateApiDeploymentRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.apigeeregistry.v1.IUpdateApiDeploymentRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified UpdateApiDeploymentRequest message, length delimited. Does not implicitly {@link google.cloud.apigeeregistry.v1.UpdateApiDeploymentRequest.verify|verify} messages. + * @param message UpdateApiDeploymentRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.apigeeregistry.v1.IUpdateApiDeploymentRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an UpdateApiDeploymentRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns UpdateApiDeploymentRequest + * @throws {Error} If the payload is not 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.apigeeregistry.v1.UpdateApiDeploymentRequest; + + /** + * Decodes an UpdateApiDeploymentRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns UpdateApiDeploymentRequest + * @throws {Error} If the payload 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.apigeeregistry.v1.UpdateApiDeploymentRequest; + + /** + * Verifies an UpdateApiDeploymentRequest message. + * @param message Plain 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 UpdateApiDeploymentRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns UpdateApiDeploymentRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.apigeeregistry.v1.UpdateApiDeploymentRequest; + + /** + * Creates a plain object from an UpdateApiDeploymentRequest message. Also converts values to other types if specified. + * @param message UpdateApiDeploymentRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.apigeeregistry.v1.UpdateApiDeploymentRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this UpdateApiDeploymentRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for UpdateApiDeploymentRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a DeleteApiDeploymentRequest. */ + interface IDeleteApiDeploymentRequest { + + /** DeleteApiDeploymentRequest name */ + name?: (string|null); + + /** DeleteApiDeploymentRequest force */ + force?: (boolean|null); + } + + /** Represents a DeleteApiDeploymentRequest. */ + class DeleteApiDeploymentRequest implements IDeleteApiDeploymentRequest { + + /** + * Constructs a new DeleteApiDeploymentRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.apigeeregistry.v1.IDeleteApiDeploymentRequest); + + /** DeleteApiDeploymentRequest name. */ + public name: string; + + /** DeleteApiDeploymentRequest force. */ + public force: boolean; + + /** + * Creates a new DeleteApiDeploymentRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns DeleteApiDeploymentRequest instance + */ + public static create(properties?: google.cloud.apigeeregistry.v1.IDeleteApiDeploymentRequest): google.cloud.apigeeregistry.v1.DeleteApiDeploymentRequest; + + /** + * Encodes the specified DeleteApiDeploymentRequest message. Does not implicitly {@link google.cloud.apigeeregistry.v1.DeleteApiDeploymentRequest.verify|verify} messages. + * @param message DeleteApiDeploymentRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.apigeeregistry.v1.IDeleteApiDeploymentRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DeleteApiDeploymentRequest message, length delimited. Does not implicitly {@link google.cloud.apigeeregistry.v1.DeleteApiDeploymentRequest.verify|verify} messages. + * @param message DeleteApiDeploymentRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.apigeeregistry.v1.IDeleteApiDeploymentRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DeleteApiDeploymentRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DeleteApiDeploymentRequest + * @throws {Error} If the payload is not 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.apigeeregistry.v1.DeleteApiDeploymentRequest; + + /** + * Decodes a DeleteApiDeploymentRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DeleteApiDeploymentRequest + * @throws {Error} If the payload 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.apigeeregistry.v1.DeleteApiDeploymentRequest; + + /** + * Verifies a DeleteApiDeploymentRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DeleteApiDeploymentRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DeleteApiDeploymentRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.apigeeregistry.v1.DeleteApiDeploymentRequest; + + /** + * Creates a plain object from a DeleteApiDeploymentRequest message. Also converts values to other types if specified. + * @param message DeleteApiDeploymentRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.apigeeregistry.v1.DeleteApiDeploymentRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DeleteApiDeploymentRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DeleteApiDeploymentRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TagApiDeploymentRevisionRequest. */ + interface ITagApiDeploymentRevisionRequest { + + /** TagApiDeploymentRevisionRequest name */ + name?: (string|null); + + /** TagApiDeploymentRevisionRequest tag */ + tag?: (string|null); + } + + /** Represents a TagApiDeploymentRevisionRequest. */ + class TagApiDeploymentRevisionRequest implements ITagApiDeploymentRevisionRequest { + + /** + * Constructs a new TagApiDeploymentRevisionRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.apigeeregistry.v1.ITagApiDeploymentRevisionRequest); + + /** TagApiDeploymentRevisionRequest name. */ + public name: string; + + /** TagApiDeploymentRevisionRequest tag. */ + public tag: string; + + /** + * Creates a new TagApiDeploymentRevisionRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns TagApiDeploymentRevisionRequest instance + */ + public static create(properties?: google.cloud.apigeeregistry.v1.ITagApiDeploymentRevisionRequest): google.cloud.apigeeregistry.v1.TagApiDeploymentRevisionRequest; + + /** + * Encodes the specified TagApiDeploymentRevisionRequest message. Does not implicitly {@link google.cloud.apigeeregistry.v1.TagApiDeploymentRevisionRequest.verify|verify} messages. + * @param message TagApiDeploymentRevisionRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.apigeeregistry.v1.ITagApiDeploymentRevisionRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified TagApiDeploymentRevisionRequest message, length delimited. Does not implicitly {@link google.cloud.apigeeregistry.v1.TagApiDeploymentRevisionRequest.verify|verify} messages. + * @param message TagApiDeploymentRevisionRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.apigeeregistry.v1.ITagApiDeploymentRevisionRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TagApiDeploymentRevisionRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns TagApiDeploymentRevisionRequest + * @throws {Error} If the payload is not 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.apigeeregistry.v1.TagApiDeploymentRevisionRequest; + + /** + * Decodes a TagApiDeploymentRevisionRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns TagApiDeploymentRevisionRequest + * @throws {Error} If the payload 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.apigeeregistry.v1.TagApiDeploymentRevisionRequest; + + /** + * Verifies a TagApiDeploymentRevisionRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a TagApiDeploymentRevisionRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns TagApiDeploymentRevisionRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.apigeeregistry.v1.TagApiDeploymentRevisionRequest; + + /** + * Creates a plain object from a TagApiDeploymentRevisionRequest message. Also converts values to other types if specified. + * @param message TagApiDeploymentRevisionRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.apigeeregistry.v1.TagApiDeploymentRevisionRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this TagApiDeploymentRevisionRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for TagApiDeploymentRevisionRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListApiDeploymentRevisionsRequest. */ + interface IListApiDeploymentRevisionsRequest { + + /** ListApiDeploymentRevisionsRequest name */ + name?: (string|null); + + /** ListApiDeploymentRevisionsRequest pageSize */ + pageSize?: (number|null); + + /** ListApiDeploymentRevisionsRequest pageToken */ + pageToken?: (string|null); + } + + /** Represents a ListApiDeploymentRevisionsRequest. */ + class ListApiDeploymentRevisionsRequest implements IListApiDeploymentRevisionsRequest { + + /** + * Constructs a new ListApiDeploymentRevisionsRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.apigeeregistry.v1.IListApiDeploymentRevisionsRequest); + + /** ListApiDeploymentRevisionsRequest name. */ + public name: string; + + /** ListApiDeploymentRevisionsRequest pageSize. */ + public pageSize: number; + + /** ListApiDeploymentRevisionsRequest pageToken. */ + public pageToken: string; + + /** + * Creates a new ListApiDeploymentRevisionsRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ListApiDeploymentRevisionsRequest instance + */ + public static create(properties?: google.cloud.apigeeregistry.v1.IListApiDeploymentRevisionsRequest): google.cloud.apigeeregistry.v1.ListApiDeploymentRevisionsRequest; + + /** + * Encodes the specified ListApiDeploymentRevisionsRequest message. Does not implicitly {@link google.cloud.apigeeregistry.v1.ListApiDeploymentRevisionsRequest.verify|verify} messages. + * @param message ListApiDeploymentRevisionsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.apigeeregistry.v1.IListApiDeploymentRevisionsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListApiDeploymentRevisionsRequest message, length delimited. Does not implicitly {@link google.cloud.apigeeregistry.v1.ListApiDeploymentRevisionsRequest.verify|verify} messages. + * @param message ListApiDeploymentRevisionsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.apigeeregistry.v1.IListApiDeploymentRevisionsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListApiDeploymentRevisionsRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListApiDeploymentRevisionsRequest + * @throws {Error} If the payload is not 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.apigeeregistry.v1.ListApiDeploymentRevisionsRequest; + + /** + * Decodes a ListApiDeploymentRevisionsRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListApiDeploymentRevisionsRequest + * @throws {Error} If the payload 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.apigeeregistry.v1.ListApiDeploymentRevisionsRequest; + + /** + * Verifies a ListApiDeploymentRevisionsRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListApiDeploymentRevisionsRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListApiDeploymentRevisionsRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.apigeeregistry.v1.ListApiDeploymentRevisionsRequest; + + /** + * Creates a plain object from a ListApiDeploymentRevisionsRequest message. Also converts values to other types if specified. + * @param message ListApiDeploymentRevisionsRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.apigeeregistry.v1.ListApiDeploymentRevisionsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListApiDeploymentRevisionsRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListApiDeploymentRevisionsRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListApiDeploymentRevisionsResponse. */ + interface IListApiDeploymentRevisionsResponse { + + /** ListApiDeploymentRevisionsResponse apiDeployments */ + apiDeployments?: (google.cloud.apigeeregistry.v1.IApiDeployment[]|null); + + /** ListApiDeploymentRevisionsResponse nextPageToken */ + nextPageToken?: (string|null); + } + + /** Represents a ListApiDeploymentRevisionsResponse. */ + class ListApiDeploymentRevisionsResponse implements IListApiDeploymentRevisionsResponse { + + /** + * Constructs a new ListApiDeploymentRevisionsResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.apigeeregistry.v1.IListApiDeploymentRevisionsResponse); + + /** ListApiDeploymentRevisionsResponse apiDeployments. */ + public apiDeployments: google.cloud.apigeeregistry.v1.IApiDeployment[]; + + /** ListApiDeploymentRevisionsResponse nextPageToken. */ + public nextPageToken: string; + + /** + * Creates a new ListApiDeploymentRevisionsResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ListApiDeploymentRevisionsResponse instance + */ + public static create(properties?: google.cloud.apigeeregistry.v1.IListApiDeploymentRevisionsResponse): google.cloud.apigeeregistry.v1.ListApiDeploymentRevisionsResponse; + + /** + * Encodes the specified ListApiDeploymentRevisionsResponse message. Does not implicitly {@link google.cloud.apigeeregistry.v1.ListApiDeploymentRevisionsResponse.verify|verify} messages. + * @param message ListApiDeploymentRevisionsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.apigeeregistry.v1.IListApiDeploymentRevisionsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListApiDeploymentRevisionsResponse message, length delimited. Does not implicitly {@link google.cloud.apigeeregistry.v1.ListApiDeploymentRevisionsResponse.verify|verify} messages. + * @param message ListApiDeploymentRevisionsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.apigeeregistry.v1.IListApiDeploymentRevisionsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListApiDeploymentRevisionsResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListApiDeploymentRevisionsResponse + * @throws {Error} If the payload is not 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.apigeeregistry.v1.ListApiDeploymentRevisionsResponse; + + /** + * Decodes a ListApiDeploymentRevisionsResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListApiDeploymentRevisionsResponse + * @throws {Error} If the payload 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.apigeeregistry.v1.ListApiDeploymentRevisionsResponse; + + /** + * Verifies a ListApiDeploymentRevisionsResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListApiDeploymentRevisionsResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListApiDeploymentRevisionsResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.apigeeregistry.v1.ListApiDeploymentRevisionsResponse; + + /** + * Creates a plain object from a ListApiDeploymentRevisionsResponse message. Also converts values to other types if specified. + * @param message ListApiDeploymentRevisionsResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.apigeeregistry.v1.ListApiDeploymentRevisionsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListApiDeploymentRevisionsResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListApiDeploymentRevisionsResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a RollbackApiDeploymentRequest. */ + interface IRollbackApiDeploymentRequest { + + /** RollbackApiDeploymentRequest name */ + name?: (string|null); + + /** RollbackApiDeploymentRequest revisionId */ + revisionId?: (string|null); + } + + /** Represents a RollbackApiDeploymentRequest. */ + class RollbackApiDeploymentRequest implements IRollbackApiDeploymentRequest { + + /** + * Constructs a new RollbackApiDeploymentRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.apigeeregistry.v1.IRollbackApiDeploymentRequest); + + /** RollbackApiDeploymentRequest name. */ + public name: string; + + /** RollbackApiDeploymentRequest revisionId. */ + public revisionId: string; + + /** + * Creates a new RollbackApiDeploymentRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns RollbackApiDeploymentRequest instance + */ + public static create(properties?: google.cloud.apigeeregistry.v1.IRollbackApiDeploymentRequest): google.cloud.apigeeregistry.v1.RollbackApiDeploymentRequest; + + /** + * Encodes the specified RollbackApiDeploymentRequest message. Does not implicitly {@link google.cloud.apigeeregistry.v1.RollbackApiDeploymentRequest.verify|verify} messages. + * @param message RollbackApiDeploymentRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.apigeeregistry.v1.IRollbackApiDeploymentRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified RollbackApiDeploymentRequest message, length delimited. Does not implicitly {@link google.cloud.apigeeregistry.v1.RollbackApiDeploymentRequest.verify|verify} messages. + * @param message RollbackApiDeploymentRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.apigeeregistry.v1.IRollbackApiDeploymentRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a RollbackApiDeploymentRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns RollbackApiDeploymentRequest + * @throws {Error} If the payload is not 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.apigeeregistry.v1.RollbackApiDeploymentRequest; + + /** + * Decodes a RollbackApiDeploymentRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns RollbackApiDeploymentRequest + * @throws {Error} If the payload 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.apigeeregistry.v1.RollbackApiDeploymentRequest; + + /** + * Verifies a RollbackApiDeploymentRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a RollbackApiDeploymentRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns RollbackApiDeploymentRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.apigeeregistry.v1.RollbackApiDeploymentRequest; + + /** + * Creates a plain object from a RollbackApiDeploymentRequest message. Also converts values to other types if specified. + * @param message RollbackApiDeploymentRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.apigeeregistry.v1.RollbackApiDeploymentRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this RollbackApiDeploymentRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for RollbackApiDeploymentRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a DeleteApiDeploymentRevisionRequest. */ + interface IDeleteApiDeploymentRevisionRequest { + + /** DeleteApiDeploymentRevisionRequest name */ + name?: (string|null); + } + + /** Represents a DeleteApiDeploymentRevisionRequest. */ + class DeleteApiDeploymentRevisionRequest implements IDeleteApiDeploymentRevisionRequest { + + /** + * Constructs a new DeleteApiDeploymentRevisionRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.apigeeregistry.v1.IDeleteApiDeploymentRevisionRequest); + + /** DeleteApiDeploymentRevisionRequest name. */ + public name: string; + + /** + * Creates a new DeleteApiDeploymentRevisionRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns DeleteApiDeploymentRevisionRequest instance + */ + public static create(properties?: google.cloud.apigeeregistry.v1.IDeleteApiDeploymentRevisionRequest): google.cloud.apigeeregistry.v1.DeleteApiDeploymentRevisionRequest; + + /** + * Encodes the specified DeleteApiDeploymentRevisionRequest message. Does not implicitly {@link google.cloud.apigeeregistry.v1.DeleteApiDeploymentRevisionRequest.verify|verify} messages. + * @param message DeleteApiDeploymentRevisionRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.apigeeregistry.v1.IDeleteApiDeploymentRevisionRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DeleteApiDeploymentRevisionRequest message, length delimited. Does not implicitly {@link google.cloud.apigeeregistry.v1.DeleteApiDeploymentRevisionRequest.verify|verify} messages. + * @param message DeleteApiDeploymentRevisionRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.apigeeregistry.v1.IDeleteApiDeploymentRevisionRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DeleteApiDeploymentRevisionRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DeleteApiDeploymentRevisionRequest + * @throws {Error} If the payload is not 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.apigeeregistry.v1.DeleteApiDeploymentRevisionRequest; + + /** + * Decodes a DeleteApiDeploymentRevisionRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DeleteApiDeploymentRevisionRequest + * @throws {Error} If the payload 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.apigeeregistry.v1.DeleteApiDeploymentRevisionRequest; + + /** + * Verifies a DeleteApiDeploymentRevisionRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DeleteApiDeploymentRevisionRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DeleteApiDeploymentRevisionRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.apigeeregistry.v1.DeleteApiDeploymentRevisionRequest; + + /** + * Creates a plain object from a DeleteApiDeploymentRevisionRequest message. Also converts values to other types if specified. + * @param message DeleteApiDeploymentRevisionRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.apigeeregistry.v1.DeleteApiDeploymentRevisionRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DeleteApiDeploymentRevisionRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DeleteApiDeploymentRevisionRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListArtifactsRequest. */ + interface IListArtifactsRequest { + + /** ListArtifactsRequest parent */ + parent?: (string|null); + + /** ListArtifactsRequest pageSize */ + pageSize?: (number|null); + + /** ListArtifactsRequest pageToken */ + pageToken?: (string|null); + + /** ListArtifactsRequest filter */ + filter?: (string|null); + } + + /** Represents a ListArtifactsRequest. */ + class ListArtifactsRequest implements IListArtifactsRequest { + + /** + * Constructs a new ListArtifactsRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.apigeeregistry.v1.IListArtifactsRequest); + + /** ListArtifactsRequest parent. */ + public parent: string; + + /** ListArtifactsRequest pageSize. */ + public pageSize: number; + + /** ListArtifactsRequest pageToken. */ + public pageToken: string; + + /** ListArtifactsRequest filter. */ + public filter: string; + + /** + * Creates a new ListArtifactsRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ListArtifactsRequest instance + */ + public static create(properties?: google.cloud.apigeeregistry.v1.IListArtifactsRequest): google.cloud.apigeeregistry.v1.ListArtifactsRequest; + + /** + * Encodes the specified ListArtifactsRequest message. Does not implicitly {@link google.cloud.apigeeregistry.v1.ListArtifactsRequest.verify|verify} messages. + * @param message ListArtifactsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.apigeeregistry.v1.IListArtifactsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListArtifactsRequest message, length delimited. Does not implicitly {@link google.cloud.apigeeregistry.v1.ListArtifactsRequest.verify|verify} messages. + * @param message ListArtifactsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.apigeeregistry.v1.IListArtifactsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListArtifactsRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListArtifactsRequest + * @throws {Error} If the payload is not 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.apigeeregistry.v1.ListArtifactsRequest; + + /** + * Decodes a ListArtifactsRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListArtifactsRequest + * @throws {Error} If the payload 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.apigeeregistry.v1.ListArtifactsRequest; + + /** + * Verifies a ListArtifactsRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListArtifactsRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListArtifactsRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.apigeeregistry.v1.ListArtifactsRequest; + + /** + * Creates a plain object from a ListArtifactsRequest message. Also converts values to other types if specified. + * @param message ListArtifactsRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.apigeeregistry.v1.ListArtifactsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListArtifactsRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListArtifactsRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListArtifactsResponse. */ + interface IListArtifactsResponse { + + /** ListArtifactsResponse artifacts */ + artifacts?: (google.cloud.apigeeregistry.v1.IArtifact[]|null); + + /** ListArtifactsResponse nextPageToken */ + nextPageToken?: (string|null); + } + + /** Represents a ListArtifactsResponse. */ + class ListArtifactsResponse implements IListArtifactsResponse { + + /** + * Constructs a new ListArtifactsResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.apigeeregistry.v1.IListArtifactsResponse); + + /** ListArtifactsResponse artifacts. */ + public artifacts: google.cloud.apigeeregistry.v1.IArtifact[]; + + /** ListArtifactsResponse nextPageToken. */ + public nextPageToken: string; + + /** + * Creates a new ListArtifactsResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ListArtifactsResponse instance + */ + public static create(properties?: google.cloud.apigeeregistry.v1.IListArtifactsResponse): google.cloud.apigeeregistry.v1.ListArtifactsResponse; + + /** + * Encodes the specified ListArtifactsResponse message. Does not implicitly {@link google.cloud.apigeeregistry.v1.ListArtifactsResponse.verify|verify} messages. + * @param message ListArtifactsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.apigeeregistry.v1.IListArtifactsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListArtifactsResponse message, length delimited. Does not implicitly {@link google.cloud.apigeeregistry.v1.ListArtifactsResponse.verify|verify} messages. + * @param message ListArtifactsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.apigeeregistry.v1.IListArtifactsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListArtifactsResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListArtifactsResponse + * @throws {Error} If the payload is not 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.apigeeregistry.v1.ListArtifactsResponse; + + /** + * Decodes a ListArtifactsResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListArtifactsResponse + * @throws {Error} If the payload 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.apigeeregistry.v1.ListArtifactsResponse; + + /** + * Verifies a ListArtifactsResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListArtifactsResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListArtifactsResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.apigeeregistry.v1.ListArtifactsResponse; + + /** + * Creates a plain object from a ListArtifactsResponse message. Also converts values to other types if specified. + * @param message ListArtifactsResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.apigeeregistry.v1.ListArtifactsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListArtifactsResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListArtifactsResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a GetArtifactRequest. */ + interface IGetArtifactRequest { + + /** GetArtifactRequest name */ + name?: (string|null); + } + + /** Represents a GetArtifactRequest. */ + class GetArtifactRequest implements IGetArtifactRequest { + + /** + * Constructs a new GetArtifactRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.apigeeregistry.v1.IGetArtifactRequest); + + /** GetArtifactRequest name. */ + public name: string; + + /** + * Creates a new GetArtifactRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GetArtifactRequest instance + */ + public static create(properties?: google.cloud.apigeeregistry.v1.IGetArtifactRequest): google.cloud.apigeeregistry.v1.GetArtifactRequest; + + /** + * Encodes the specified GetArtifactRequest message. Does not implicitly {@link google.cloud.apigeeregistry.v1.GetArtifactRequest.verify|verify} messages. + * @param message GetArtifactRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.apigeeregistry.v1.IGetArtifactRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GetArtifactRequest message, length delimited. Does not implicitly {@link google.cloud.apigeeregistry.v1.GetArtifactRequest.verify|verify} messages. + * @param message GetArtifactRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.apigeeregistry.v1.IGetArtifactRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GetArtifactRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GetArtifactRequest + * @throws {Error} If the payload is not 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.apigeeregistry.v1.GetArtifactRequest; + + /** + * Decodes a GetArtifactRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GetArtifactRequest + * @throws {Error} If the payload 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.apigeeregistry.v1.GetArtifactRequest; + + /** + * Verifies a GetArtifactRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GetArtifactRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GetArtifactRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.apigeeregistry.v1.GetArtifactRequest; + + /** + * Creates a plain object from a GetArtifactRequest message. Also converts values to other types if specified. + * @param message GetArtifactRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.apigeeregistry.v1.GetArtifactRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GetArtifactRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GetArtifactRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a GetArtifactContentsRequest. */ + interface IGetArtifactContentsRequest { + + /** GetArtifactContentsRequest name */ + name?: (string|null); + } + + /** Represents a GetArtifactContentsRequest. */ + class GetArtifactContentsRequest implements IGetArtifactContentsRequest { + + /** + * Constructs a new GetArtifactContentsRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.apigeeregistry.v1.IGetArtifactContentsRequest); + + /** GetArtifactContentsRequest name. */ + public name: string; + + /** + * Creates a new GetArtifactContentsRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GetArtifactContentsRequest instance + */ + public static create(properties?: google.cloud.apigeeregistry.v1.IGetArtifactContentsRequest): google.cloud.apigeeregistry.v1.GetArtifactContentsRequest; + + /** + * Encodes the specified GetArtifactContentsRequest message. Does not implicitly {@link google.cloud.apigeeregistry.v1.GetArtifactContentsRequest.verify|verify} messages. + * @param message GetArtifactContentsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.apigeeregistry.v1.IGetArtifactContentsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GetArtifactContentsRequest message, length delimited. Does not implicitly {@link google.cloud.apigeeregistry.v1.GetArtifactContentsRequest.verify|verify} messages. + * @param message GetArtifactContentsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.apigeeregistry.v1.IGetArtifactContentsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GetArtifactContentsRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GetArtifactContentsRequest + * @throws {Error} If the payload is not 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.apigeeregistry.v1.GetArtifactContentsRequest; + + /** + * Decodes a GetArtifactContentsRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GetArtifactContentsRequest + * @throws {Error} If the payload 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.apigeeregistry.v1.GetArtifactContentsRequest; + + /** + * Verifies a GetArtifactContentsRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GetArtifactContentsRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GetArtifactContentsRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.apigeeregistry.v1.GetArtifactContentsRequest; + + /** + * Creates a plain object from a GetArtifactContentsRequest message. Also converts values to other types if specified. + * @param message GetArtifactContentsRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.apigeeregistry.v1.GetArtifactContentsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GetArtifactContentsRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GetArtifactContentsRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a CreateArtifactRequest. */ + interface ICreateArtifactRequest { + + /** CreateArtifactRequest parent */ + parent?: (string|null); + + /** CreateArtifactRequest artifact */ + artifact?: (google.cloud.apigeeregistry.v1.IArtifact|null); + + /** CreateArtifactRequest artifactId */ + artifactId?: (string|null); + } + + /** Represents a CreateArtifactRequest. */ + class CreateArtifactRequest implements ICreateArtifactRequest { + + /** + * Constructs a new CreateArtifactRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.apigeeregistry.v1.ICreateArtifactRequest); + + /** CreateArtifactRequest parent. */ + public parent: string; + + /** CreateArtifactRequest artifact. */ + public artifact?: (google.cloud.apigeeregistry.v1.IArtifact|null); + + /** CreateArtifactRequest artifactId. */ + public artifactId: string; + + /** + * Creates a new CreateArtifactRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns CreateArtifactRequest instance + */ + public static create(properties?: google.cloud.apigeeregistry.v1.ICreateArtifactRequest): google.cloud.apigeeregistry.v1.CreateArtifactRequest; + + /** + * Encodes the specified CreateArtifactRequest message. Does not implicitly {@link google.cloud.apigeeregistry.v1.CreateArtifactRequest.verify|verify} messages. + * @param message CreateArtifactRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.apigeeregistry.v1.ICreateArtifactRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CreateArtifactRequest message, length delimited. Does not implicitly {@link google.cloud.apigeeregistry.v1.CreateArtifactRequest.verify|verify} messages. + * @param message CreateArtifactRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.apigeeregistry.v1.ICreateArtifactRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CreateArtifactRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CreateArtifactRequest + * @throws {Error} If the payload is not 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.apigeeregistry.v1.CreateArtifactRequest; + + /** + * Decodes a CreateArtifactRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CreateArtifactRequest + * @throws {Error} If the payload 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.apigeeregistry.v1.CreateArtifactRequest; + + /** + * Verifies a CreateArtifactRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CreateArtifactRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CreateArtifactRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.apigeeregistry.v1.CreateArtifactRequest; + + /** + * Creates a plain object from a CreateArtifactRequest message. Also converts values to other types if specified. + * @param message CreateArtifactRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.apigeeregistry.v1.CreateArtifactRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CreateArtifactRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CreateArtifactRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ReplaceArtifactRequest. */ + interface IReplaceArtifactRequest { + + /** ReplaceArtifactRequest artifact */ + artifact?: (google.cloud.apigeeregistry.v1.IArtifact|null); + } + + /** Represents a ReplaceArtifactRequest. */ + class ReplaceArtifactRequest implements IReplaceArtifactRequest { + + /** + * Constructs a new ReplaceArtifactRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.apigeeregistry.v1.IReplaceArtifactRequest); + + /** ReplaceArtifactRequest artifact. */ + public artifact?: (google.cloud.apigeeregistry.v1.IArtifact|null); + + /** + * Creates a new ReplaceArtifactRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ReplaceArtifactRequest instance + */ + public static create(properties?: google.cloud.apigeeregistry.v1.IReplaceArtifactRequest): google.cloud.apigeeregistry.v1.ReplaceArtifactRequest; + + /** + * Encodes the specified ReplaceArtifactRequest message. Does not implicitly {@link google.cloud.apigeeregistry.v1.ReplaceArtifactRequest.verify|verify} messages. + * @param message ReplaceArtifactRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.apigeeregistry.v1.IReplaceArtifactRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ReplaceArtifactRequest message, length delimited. Does not implicitly {@link google.cloud.apigeeregistry.v1.ReplaceArtifactRequest.verify|verify} messages. + * @param message ReplaceArtifactRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.apigeeregistry.v1.IReplaceArtifactRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ReplaceArtifactRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ReplaceArtifactRequest + * @throws {Error} If the payload is not 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.apigeeregistry.v1.ReplaceArtifactRequest; + + /** + * Decodes a ReplaceArtifactRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ReplaceArtifactRequest + * @throws {Error} If the payload 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.apigeeregistry.v1.ReplaceArtifactRequest; + + /** + * Verifies a ReplaceArtifactRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ReplaceArtifactRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ReplaceArtifactRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.apigeeregistry.v1.ReplaceArtifactRequest; + + /** + * Creates a plain object from a ReplaceArtifactRequest message. Also converts values to other types if specified. + * @param message ReplaceArtifactRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.apigeeregistry.v1.ReplaceArtifactRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ReplaceArtifactRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ReplaceArtifactRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a DeleteArtifactRequest. */ + interface IDeleteArtifactRequest { + + /** DeleteArtifactRequest name */ + name?: (string|null); + } + + /** Represents a DeleteArtifactRequest. */ + class DeleteArtifactRequest implements IDeleteArtifactRequest { + + /** + * Constructs a new DeleteArtifactRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.apigeeregistry.v1.IDeleteArtifactRequest); + + /** DeleteArtifactRequest name. */ + public name: string; + + /** + * Creates a new DeleteArtifactRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns DeleteArtifactRequest instance + */ + public static create(properties?: google.cloud.apigeeregistry.v1.IDeleteArtifactRequest): google.cloud.apigeeregistry.v1.DeleteArtifactRequest; + + /** + * Encodes the specified DeleteArtifactRequest message. Does not implicitly {@link google.cloud.apigeeregistry.v1.DeleteArtifactRequest.verify|verify} messages. + * @param message DeleteArtifactRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.apigeeregistry.v1.IDeleteArtifactRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DeleteArtifactRequest message, length delimited. Does not implicitly {@link google.cloud.apigeeregistry.v1.DeleteArtifactRequest.verify|verify} messages. + * @param message DeleteArtifactRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.apigeeregistry.v1.IDeleteArtifactRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DeleteArtifactRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DeleteArtifactRequest + * @throws {Error} If the payload is not 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.apigeeregistry.v1.DeleteArtifactRequest; + + /** + * Decodes a DeleteArtifactRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DeleteArtifactRequest + * @throws {Error} If the payload 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.apigeeregistry.v1.DeleteArtifactRequest; + + /** + * Verifies a DeleteArtifactRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DeleteArtifactRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DeleteArtifactRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.apigeeregistry.v1.DeleteArtifactRequest; + + /** + * Creates a plain object from a DeleteArtifactRequest message. Also converts values to other types if specified. + * @param message DeleteArtifactRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.apigeeregistry.v1.DeleteArtifactRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DeleteArtifactRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DeleteArtifactRequest + * @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); + } + + /** 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[]; + + /** + * 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); + } + + /** 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); + + /** + * 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); + } + + /** 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); + + /** + * 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 + } + + /** 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 + } + + /** 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; + } + + /** Properties of a HttpBody. */ + interface IHttpBody { + + /** HttpBody contentType */ + contentType?: (string|null); + + /** HttpBody data */ + data?: (Uint8Array|string|null); + + /** HttpBody extensions */ + extensions?: (google.protobuf.IAny[]|null); + } + + /** Represents a HttpBody. */ + class HttpBody implements IHttpBody { + + /** + * Constructs a new HttpBody. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.IHttpBody); + + /** HttpBody contentType. */ + public contentType: string; + + /** HttpBody data. */ + public data: (Uint8Array|string); + + /** HttpBody extensions. */ + public extensions: google.protobuf.IAny[]; + + /** + * Creates a new HttpBody instance using the specified properties. + * @param [properties] Properties to set + * @returns HttpBody instance + */ + public static create(properties?: google.api.IHttpBody): google.api.HttpBody; + + /** + * Encodes the specified HttpBody message. Does not implicitly {@link google.api.HttpBody.verify|verify} messages. + * @param message HttpBody message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.api.IHttpBody, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified HttpBody message, length delimited. Does not implicitly {@link google.api.HttpBody.verify|verify} messages. + * @param message HttpBody message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.api.IHttpBody, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a HttpBody message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns HttpBody + * @throws {Error} If the payload is not 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.HttpBody; + + /** + * Decodes a HttpBody message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns HttpBody + * @throws {Error} If the payload 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.HttpBody; + + /** + * Verifies a HttpBody message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a HttpBody message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns HttpBody + */ + public static fromObject(object: { [k: string]: any }): google.api.HttpBody; + + /** + * Creates a plain object from a HttpBody message. Also converts values to other types if specified. + * @param message HttpBody + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.api.HttpBody, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this HttpBody to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for HttpBody + * @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; + } + + /** 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?: (string|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: string; + + /** + * 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); + } + + /** 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[]; + + /** + * 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; + } + + /** 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_REQUIRED = 2, + LABEL_REPEATED = 3 + } + } + + /** 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 phpGenericServices */ + phpGenericServices?: (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 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 phpGenericServices. */ + public phpGenericServices: 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 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 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 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 target */ + target?: (google.protobuf.FieldOptions.OptionTargetType|keyof typeof google.protobuf.FieldOptions.OptionTargetType|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 target. */ + public target: (google.protobuf.FieldOptions.OptionTargetType|keyof typeof google.protobuf.FieldOptions.OptionTargetType); + + /** 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 OneofOptions. */ + interface IOneofOptions { + + /** 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 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 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 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 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 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 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); + } + + /** Represents a ServiceOptions. */ + class ServiceOptions implements IServiceOptions { + + /** + * Constructs a new ServiceOptions. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IServiceOptions); + + /** 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 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 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|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|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 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|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|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 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/google-cloud-apigeeregistry/protos/protos.js b/packages/google-cloud-apigeeregistry/protos/protos.js new file mode 100644 index 00000000000..c2c9af179f4 --- /dev/null +++ b/packages/google-cloud-apigeeregistry/protos/protos.js @@ -0,0 +1,34270 @@ +// Copyright 2023 Google LLC +// +// Licensed under the Apache License, Version 2.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_apigee_registry_protos || ($protobuf.roots._google_cloud_apigee_registry_protos = {}); + + $root.google = (function() { + + /** + * Namespace google. + * @exports google + * @namespace + */ + var google = {}; + + google.cloud = (function() { + + /** + * Namespace cloud. + * @memberof google + * @namespace + */ + var cloud = {}; + + cloud.apigeeregistry = (function() { + + /** + * Namespace apigeeregistry. + * @memberof google.cloud + * @namespace + */ + var apigeeregistry = {}; + + apigeeregistry.v1 = (function() { + + /** + * Namespace v1. + * @memberof google.cloud.apigeeregistry + * @namespace + */ + var v1 = {}; + + v1.Provisioning = (function() { + + /** + * Constructs a new Provisioning service. + * @memberof google.cloud.apigeeregistry.v1 + * @classdesc Represents a Provisioning + * @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 Provisioning(rpcImpl, requestDelimited, responseDelimited) { + $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); + } + + (Provisioning.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = Provisioning; + + /** + * Creates new Provisioning service using the specified rpc implementation. + * @function create + * @memberof google.cloud.apigeeregistry.v1.Provisioning + * @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 {Provisioning} RPC service. Useful where requests and/or responses are streamed. + */ + Provisioning.create = function create(rpcImpl, requestDelimited, responseDelimited) { + return new this(rpcImpl, requestDelimited, responseDelimited); + }; + + /** + * Callback as used by {@link google.cloud.apigeeregistry.v1.Provisioning|createInstance}. + * @memberof google.cloud.apigeeregistry.v1.Provisioning + * @typedef CreateInstanceCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls CreateInstance. + * @function createInstance + * @memberof google.cloud.apigeeregistry.v1.Provisioning + * @instance + * @param {google.cloud.apigeeregistry.v1.ICreateInstanceRequest} request CreateInstanceRequest message or plain object + * @param {google.cloud.apigeeregistry.v1.Provisioning.CreateInstanceCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Provisioning.prototype.createInstance = function createInstance(request, callback) { + return this.rpcCall(createInstance, $root.google.cloud.apigeeregistry.v1.CreateInstanceRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "CreateInstance" }); + + /** + * Calls CreateInstance. + * @function createInstance + * @memberof google.cloud.apigeeregistry.v1.Provisioning + * @instance + * @param {google.cloud.apigeeregistry.v1.ICreateInstanceRequest} request CreateInstanceRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.apigeeregistry.v1.Provisioning|deleteInstance}. + * @memberof google.cloud.apigeeregistry.v1.Provisioning + * @typedef DeleteInstanceCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls DeleteInstance. + * @function deleteInstance + * @memberof google.cloud.apigeeregistry.v1.Provisioning + * @instance + * @param {google.cloud.apigeeregistry.v1.IDeleteInstanceRequest} request DeleteInstanceRequest message or plain object + * @param {google.cloud.apigeeregistry.v1.Provisioning.DeleteInstanceCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Provisioning.prototype.deleteInstance = function deleteInstance(request, callback) { + return this.rpcCall(deleteInstance, $root.google.cloud.apigeeregistry.v1.DeleteInstanceRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "DeleteInstance" }); + + /** + * Calls DeleteInstance. + * @function deleteInstance + * @memberof google.cloud.apigeeregistry.v1.Provisioning + * @instance + * @param {google.cloud.apigeeregistry.v1.IDeleteInstanceRequest} request DeleteInstanceRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.apigeeregistry.v1.Provisioning|getInstance}. + * @memberof google.cloud.apigeeregistry.v1.Provisioning + * @typedef GetInstanceCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.apigeeregistry.v1.Instance} [response] Instance + */ + + /** + * Calls GetInstance. + * @function getInstance + * @memberof google.cloud.apigeeregistry.v1.Provisioning + * @instance + * @param {google.cloud.apigeeregistry.v1.IGetInstanceRequest} request GetInstanceRequest message or plain object + * @param {google.cloud.apigeeregistry.v1.Provisioning.GetInstanceCallback} callback Node-style callback called with the error, if any, and Instance + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Provisioning.prototype.getInstance = function getInstance(request, callback) { + return this.rpcCall(getInstance, $root.google.cloud.apigeeregistry.v1.GetInstanceRequest, $root.google.cloud.apigeeregistry.v1.Instance, request, callback); + }, "name", { value: "GetInstance" }); + + /** + * Calls GetInstance. + * @function getInstance + * @memberof google.cloud.apigeeregistry.v1.Provisioning + * @instance + * @param {google.cloud.apigeeregistry.v1.IGetInstanceRequest} request GetInstanceRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + return Provisioning; + })(); + + v1.CreateInstanceRequest = (function() { + + /** + * Properties of a CreateInstanceRequest. + * @memberof google.cloud.apigeeregistry.v1 + * @interface ICreateInstanceRequest + * @property {string|null} [parent] CreateInstanceRequest parent + * @property {string|null} [instanceId] CreateInstanceRequest instanceId + * @property {google.cloud.apigeeregistry.v1.IInstance|null} [instance] CreateInstanceRequest instance + */ + + /** + * Constructs a new CreateInstanceRequest. + * @memberof google.cloud.apigeeregistry.v1 + * @classdesc Represents a CreateInstanceRequest. + * @implements ICreateInstanceRequest + * @constructor + * @param {google.cloud.apigeeregistry.v1.ICreateInstanceRequest=} [properties] Properties to set + */ + function CreateInstanceRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * CreateInstanceRequest parent. + * @member {string} parent + * @memberof google.cloud.apigeeregistry.v1.CreateInstanceRequest + * @instance + */ + CreateInstanceRequest.prototype.parent = ""; + + /** + * CreateInstanceRequest instanceId. + * @member {string} instanceId + * @memberof google.cloud.apigeeregistry.v1.CreateInstanceRequest + * @instance + */ + CreateInstanceRequest.prototype.instanceId = ""; + + /** + * CreateInstanceRequest instance. + * @member {google.cloud.apigeeregistry.v1.IInstance|null|undefined} instance + * @memberof google.cloud.apigeeregistry.v1.CreateInstanceRequest + * @instance + */ + CreateInstanceRequest.prototype.instance = null; + + /** + * Creates a new CreateInstanceRequest instance using the specified properties. + * @function create + * @memberof google.cloud.apigeeregistry.v1.CreateInstanceRequest + * @static + * @param {google.cloud.apigeeregistry.v1.ICreateInstanceRequest=} [properties] Properties to set + * @returns {google.cloud.apigeeregistry.v1.CreateInstanceRequest} CreateInstanceRequest instance + */ + CreateInstanceRequest.create = function create(properties) { + return new CreateInstanceRequest(properties); + }; + + /** + * Encodes the specified CreateInstanceRequest message. Does not implicitly {@link google.cloud.apigeeregistry.v1.CreateInstanceRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.apigeeregistry.v1.CreateInstanceRequest + * @static + * @param {google.cloud.apigeeregistry.v1.ICreateInstanceRequest} message CreateInstanceRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateInstanceRequest.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.instanceId != null && Object.hasOwnProperty.call(message, "instanceId")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.instanceId); + if (message.instance != null && Object.hasOwnProperty.call(message, "instance")) + $root.google.cloud.apigeeregistry.v1.Instance.encode(message.instance, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified CreateInstanceRequest message, length delimited. Does not implicitly {@link google.cloud.apigeeregistry.v1.CreateInstanceRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.apigeeregistry.v1.CreateInstanceRequest + * @static + * @param {google.cloud.apigeeregistry.v1.ICreateInstanceRequest} message CreateInstanceRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateInstanceRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CreateInstanceRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.apigeeregistry.v1.CreateInstanceRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.apigeeregistry.v1.CreateInstanceRequest} CreateInstanceRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateInstanceRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.apigeeregistry.v1.CreateInstanceRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.instanceId = reader.string(); + break; + } + case 3: { + message.instance = $root.google.cloud.apigeeregistry.v1.Instance.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CreateInstanceRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.apigeeregistry.v1.CreateInstanceRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.apigeeregistry.v1.CreateInstanceRequest} CreateInstanceRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateInstanceRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CreateInstanceRequest message. + * @function verify + * @memberof google.cloud.apigeeregistry.v1.CreateInstanceRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CreateInstanceRequest.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.instanceId != null && message.hasOwnProperty("instanceId")) + if (!$util.isString(message.instanceId)) + return "instanceId: string expected"; + if (message.instance != null && message.hasOwnProperty("instance")) { + var error = $root.google.cloud.apigeeregistry.v1.Instance.verify(message.instance); + if (error) + return "instance." + error; + } + return null; + }; + + /** + * Creates a CreateInstanceRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.apigeeregistry.v1.CreateInstanceRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.apigeeregistry.v1.CreateInstanceRequest} CreateInstanceRequest + */ + CreateInstanceRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.apigeeregistry.v1.CreateInstanceRequest) + return object; + var message = new $root.google.cloud.apigeeregistry.v1.CreateInstanceRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.instanceId != null) + message.instanceId = String(object.instanceId); + if (object.instance != null) { + if (typeof object.instance !== "object") + throw TypeError(".google.cloud.apigeeregistry.v1.CreateInstanceRequest.instance: object expected"); + message.instance = $root.google.cloud.apigeeregistry.v1.Instance.fromObject(object.instance); + } + return message; + }; + + /** + * Creates a plain object from a CreateInstanceRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.apigeeregistry.v1.CreateInstanceRequest + * @static + * @param {google.cloud.apigeeregistry.v1.CreateInstanceRequest} message CreateInstanceRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CreateInstanceRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.instanceId = ""; + object.instance = null; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.instanceId != null && message.hasOwnProperty("instanceId")) + object.instanceId = message.instanceId; + if (message.instance != null && message.hasOwnProperty("instance")) + object.instance = $root.google.cloud.apigeeregistry.v1.Instance.toObject(message.instance, options); + return object; + }; + + /** + * Converts this CreateInstanceRequest to JSON. + * @function toJSON + * @memberof google.cloud.apigeeregistry.v1.CreateInstanceRequest + * @instance + * @returns {Object.} JSON object + */ + CreateInstanceRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CreateInstanceRequest + * @function getTypeUrl + * @memberof google.cloud.apigeeregistry.v1.CreateInstanceRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CreateInstanceRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.apigeeregistry.v1.CreateInstanceRequest"; + }; + + return CreateInstanceRequest; + })(); + + v1.DeleteInstanceRequest = (function() { + + /** + * Properties of a DeleteInstanceRequest. + * @memberof google.cloud.apigeeregistry.v1 + * @interface IDeleteInstanceRequest + * @property {string|null} [name] DeleteInstanceRequest name + */ + + /** + * Constructs a new DeleteInstanceRequest. + * @memberof google.cloud.apigeeregistry.v1 + * @classdesc Represents a DeleteInstanceRequest. + * @implements IDeleteInstanceRequest + * @constructor + * @param {google.cloud.apigeeregistry.v1.IDeleteInstanceRequest=} [properties] Properties to set + */ + function DeleteInstanceRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * DeleteInstanceRequest name. + * @member {string} name + * @memberof google.cloud.apigeeregistry.v1.DeleteInstanceRequest + * @instance + */ + DeleteInstanceRequest.prototype.name = ""; + + /** + * Creates a new DeleteInstanceRequest instance using the specified properties. + * @function create + * @memberof google.cloud.apigeeregistry.v1.DeleteInstanceRequest + * @static + * @param {google.cloud.apigeeregistry.v1.IDeleteInstanceRequest=} [properties] Properties to set + * @returns {google.cloud.apigeeregistry.v1.DeleteInstanceRequest} DeleteInstanceRequest instance + */ + DeleteInstanceRequest.create = function create(properties) { + return new DeleteInstanceRequest(properties); + }; + + /** + * Encodes the specified DeleteInstanceRequest message. Does not implicitly {@link google.cloud.apigeeregistry.v1.DeleteInstanceRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.apigeeregistry.v1.DeleteInstanceRequest + * @static + * @param {google.cloud.apigeeregistry.v1.IDeleteInstanceRequest} message DeleteInstanceRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteInstanceRequest.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 DeleteInstanceRequest message, length delimited. Does not implicitly {@link google.cloud.apigeeregistry.v1.DeleteInstanceRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.apigeeregistry.v1.DeleteInstanceRequest + * @static + * @param {google.cloud.apigeeregistry.v1.IDeleteInstanceRequest} message DeleteInstanceRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteInstanceRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DeleteInstanceRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.apigeeregistry.v1.DeleteInstanceRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.apigeeregistry.v1.DeleteInstanceRequest} DeleteInstanceRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteInstanceRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.apigeeregistry.v1.DeleteInstanceRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DeleteInstanceRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.apigeeregistry.v1.DeleteInstanceRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.apigeeregistry.v1.DeleteInstanceRequest} DeleteInstanceRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteInstanceRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DeleteInstanceRequest message. + * @function verify + * @memberof google.cloud.apigeeregistry.v1.DeleteInstanceRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DeleteInstanceRequest.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 DeleteInstanceRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.apigeeregistry.v1.DeleteInstanceRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.apigeeregistry.v1.DeleteInstanceRequest} DeleteInstanceRequest + */ + DeleteInstanceRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.apigeeregistry.v1.DeleteInstanceRequest) + return object; + var message = new $root.google.cloud.apigeeregistry.v1.DeleteInstanceRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a DeleteInstanceRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.apigeeregistry.v1.DeleteInstanceRequest + * @static + * @param {google.cloud.apigeeregistry.v1.DeleteInstanceRequest} message DeleteInstanceRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DeleteInstanceRequest.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 DeleteInstanceRequest to JSON. + * @function toJSON + * @memberof google.cloud.apigeeregistry.v1.DeleteInstanceRequest + * @instance + * @returns {Object.} JSON object + */ + DeleteInstanceRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DeleteInstanceRequest + * @function getTypeUrl + * @memberof google.cloud.apigeeregistry.v1.DeleteInstanceRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DeleteInstanceRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.apigeeregistry.v1.DeleteInstanceRequest"; + }; + + return DeleteInstanceRequest; + })(); + + v1.GetInstanceRequest = (function() { + + /** + * Properties of a GetInstanceRequest. + * @memberof google.cloud.apigeeregistry.v1 + * @interface IGetInstanceRequest + * @property {string|null} [name] GetInstanceRequest name + */ + + /** + * Constructs a new GetInstanceRequest. + * @memberof google.cloud.apigeeregistry.v1 + * @classdesc Represents a GetInstanceRequest. + * @implements IGetInstanceRequest + * @constructor + * @param {google.cloud.apigeeregistry.v1.IGetInstanceRequest=} [properties] Properties to set + */ + function GetInstanceRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetInstanceRequest name. + * @member {string} name + * @memberof google.cloud.apigeeregistry.v1.GetInstanceRequest + * @instance + */ + GetInstanceRequest.prototype.name = ""; + + /** + * Creates a new GetInstanceRequest instance using the specified properties. + * @function create + * @memberof google.cloud.apigeeregistry.v1.GetInstanceRequest + * @static + * @param {google.cloud.apigeeregistry.v1.IGetInstanceRequest=} [properties] Properties to set + * @returns {google.cloud.apigeeregistry.v1.GetInstanceRequest} GetInstanceRequest instance + */ + GetInstanceRequest.create = function create(properties) { + return new GetInstanceRequest(properties); + }; + + /** + * Encodes the specified GetInstanceRequest message. Does not implicitly {@link google.cloud.apigeeregistry.v1.GetInstanceRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.apigeeregistry.v1.GetInstanceRequest + * @static + * @param {google.cloud.apigeeregistry.v1.IGetInstanceRequest} message GetInstanceRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetInstanceRequest.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 GetInstanceRequest message, length delimited. Does not implicitly {@link google.cloud.apigeeregistry.v1.GetInstanceRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.apigeeregistry.v1.GetInstanceRequest + * @static + * @param {google.cloud.apigeeregistry.v1.IGetInstanceRequest} message GetInstanceRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetInstanceRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetInstanceRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.apigeeregistry.v1.GetInstanceRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.apigeeregistry.v1.GetInstanceRequest} GetInstanceRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetInstanceRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.apigeeregistry.v1.GetInstanceRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetInstanceRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.apigeeregistry.v1.GetInstanceRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.apigeeregistry.v1.GetInstanceRequest} GetInstanceRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetInstanceRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetInstanceRequest message. + * @function verify + * @memberof google.cloud.apigeeregistry.v1.GetInstanceRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetInstanceRequest.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 GetInstanceRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.apigeeregistry.v1.GetInstanceRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.apigeeregistry.v1.GetInstanceRequest} GetInstanceRequest + */ + GetInstanceRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.apigeeregistry.v1.GetInstanceRequest) + return object; + var message = new $root.google.cloud.apigeeregistry.v1.GetInstanceRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a GetInstanceRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.apigeeregistry.v1.GetInstanceRequest + * @static + * @param {google.cloud.apigeeregistry.v1.GetInstanceRequest} message GetInstanceRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetInstanceRequest.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 GetInstanceRequest to JSON. + * @function toJSON + * @memberof google.cloud.apigeeregistry.v1.GetInstanceRequest + * @instance + * @returns {Object.} JSON object + */ + GetInstanceRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GetInstanceRequest + * @function getTypeUrl + * @memberof google.cloud.apigeeregistry.v1.GetInstanceRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GetInstanceRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.apigeeregistry.v1.GetInstanceRequest"; + }; + + return GetInstanceRequest; + })(); + + v1.OperationMetadata = (function() { + + /** + * Properties of an OperationMetadata. + * @memberof google.cloud.apigeeregistry.v1 + * @interface IOperationMetadata + * @property {google.protobuf.ITimestamp|null} [createTime] OperationMetadata createTime + * @property {google.protobuf.ITimestamp|null} [endTime] OperationMetadata endTime + * @property {string|null} [target] OperationMetadata target + * @property {string|null} [verb] OperationMetadata verb + * @property {string|null} [statusMessage] OperationMetadata statusMessage + * @property {boolean|null} [cancellationRequested] OperationMetadata cancellationRequested + * @property {string|null} [apiVersion] OperationMetadata apiVersion + */ + + /** + * Constructs a new OperationMetadata. + * @memberof google.cloud.apigeeregistry.v1 + * @classdesc Represents an OperationMetadata. + * @implements IOperationMetadata + * @constructor + * @param {google.cloud.apigeeregistry.v1.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.apigeeregistry.v1.OperationMetadata + * @instance + */ + OperationMetadata.prototype.createTime = null; + + /** + * OperationMetadata endTime. + * @member {google.protobuf.ITimestamp|null|undefined} endTime + * @memberof google.cloud.apigeeregistry.v1.OperationMetadata + * @instance + */ + OperationMetadata.prototype.endTime = null; + + /** + * OperationMetadata target. + * @member {string} target + * @memberof google.cloud.apigeeregistry.v1.OperationMetadata + * @instance + */ + OperationMetadata.prototype.target = ""; + + /** + * OperationMetadata verb. + * @member {string} verb + * @memberof google.cloud.apigeeregistry.v1.OperationMetadata + * @instance + */ + OperationMetadata.prototype.verb = ""; + + /** + * OperationMetadata statusMessage. + * @member {string} statusMessage + * @memberof google.cloud.apigeeregistry.v1.OperationMetadata + * @instance + */ + OperationMetadata.prototype.statusMessage = ""; + + /** + * OperationMetadata cancellationRequested. + * @member {boolean} cancellationRequested + * @memberof google.cloud.apigeeregistry.v1.OperationMetadata + * @instance + */ + OperationMetadata.prototype.cancellationRequested = false; + + /** + * OperationMetadata apiVersion. + * @member {string} apiVersion + * @memberof google.cloud.apigeeregistry.v1.OperationMetadata + * @instance + */ + OperationMetadata.prototype.apiVersion = ""; + + /** + * Creates a new OperationMetadata instance using the specified properties. + * @function create + * @memberof google.cloud.apigeeregistry.v1.OperationMetadata + * @static + * @param {google.cloud.apigeeregistry.v1.IOperationMetadata=} [properties] Properties to set + * @returns {google.cloud.apigeeregistry.v1.OperationMetadata} OperationMetadata instance + */ + OperationMetadata.create = function create(properties) { + return new OperationMetadata(properties); + }; + + /** + * Encodes the specified OperationMetadata message. Does not implicitly {@link google.cloud.apigeeregistry.v1.OperationMetadata.verify|verify} messages. + * @function encode + * @memberof google.cloud.apigeeregistry.v1.OperationMetadata + * @static + * @param {google.cloud.apigeeregistry.v1.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.endTime != null && Object.hasOwnProperty.call(message, "endTime")) + $root.google.protobuf.Timestamp.encode(message.endTime, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.target != null && Object.hasOwnProperty.call(message, "target")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.target); + if (message.verb != null && Object.hasOwnProperty.call(message, "verb")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.verb); + if (message.statusMessage != null && Object.hasOwnProperty.call(message, "statusMessage")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.statusMessage); + if (message.cancellationRequested != null && Object.hasOwnProperty.call(message, "cancellationRequested")) + writer.uint32(/* id 6, wireType 0 =*/48).bool(message.cancellationRequested); + if (message.apiVersion != null && Object.hasOwnProperty.call(message, "apiVersion")) + writer.uint32(/* id 7, wireType 2 =*/58).string(message.apiVersion); + return writer; + }; + + /** + * Encodes the specified OperationMetadata message, length delimited. Does not implicitly {@link google.cloud.apigeeregistry.v1.OperationMetadata.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.apigeeregistry.v1.OperationMetadata + * @static + * @param {google.cloud.apigeeregistry.v1.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.apigeeregistry.v1.OperationMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.apigeeregistry.v1.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) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.apigeeregistry.v1.OperationMetadata(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.createTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 2: { + message.endTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 3: { + message.target = reader.string(); + break; + } + case 4: { + message.verb = reader.string(); + break; + } + case 5: { + message.statusMessage = reader.string(); + break; + } + case 6: { + message.cancellationRequested = reader.bool(); + break; + } + case 7: { + message.apiVersion = reader.string(); + 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.apigeeregistry.v1.OperationMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.apigeeregistry.v1.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.apigeeregistry.v1.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"; + if (message.createTime != null && message.hasOwnProperty("createTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.createTime); + if (error) + return "createTime." + error; + } + if (message.endTime != null && message.hasOwnProperty("endTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.endTime); + if (error) + return "endTime." + error; + } + if (message.target != null && message.hasOwnProperty("target")) + if (!$util.isString(message.target)) + return "target: string expected"; + if (message.verb != null && message.hasOwnProperty("verb")) + if (!$util.isString(message.verb)) + return "verb: string expected"; + if (message.statusMessage != null && message.hasOwnProperty("statusMessage")) + if (!$util.isString(message.statusMessage)) + return "statusMessage: string expected"; + if (message.cancellationRequested != null && message.hasOwnProperty("cancellationRequested")) + if (typeof message.cancellationRequested !== "boolean") + return "cancellationRequested: boolean expected"; + if (message.apiVersion != null && message.hasOwnProperty("apiVersion")) + if (!$util.isString(message.apiVersion)) + return "apiVersion: string expected"; + return null; + }; + + /** + * Creates an OperationMetadata message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.apigeeregistry.v1.OperationMetadata + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.apigeeregistry.v1.OperationMetadata} OperationMetadata + */ + OperationMetadata.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.apigeeregistry.v1.OperationMetadata) + return object; + var message = new $root.google.cloud.apigeeregistry.v1.OperationMetadata(); + if (object.createTime != null) { + if (typeof object.createTime !== "object") + throw TypeError(".google.cloud.apigeeregistry.v1.OperationMetadata.createTime: object expected"); + message.createTime = $root.google.protobuf.Timestamp.fromObject(object.createTime); + } + if (object.endTime != null) { + if (typeof object.endTime !== "object") + throw TypeError(".google.cloud.apigeeregistry.v1.OperationMetadata.endTime: object expected"); + message.endTime = $root.google.protobuf.Timestamp.fromObject(object.endTime); + } + if (object.target != null) + message.target = String(object.target); + if (object.verb != null) + message.verb = String(object.verb); + if (object.statusMessage != null) + message.statusMessage = String(object.statusMessage); + if (object.cancellationRequested != null) + message.cancellationRequested = Boolean(object.cancellationRequested); + if (object.apiVersion != null) + message.apiVersion = String(object.apiVersion); + return message; + }; + + /** + * Creates a plain object from an OperationMetadata message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.apigeeregistry.v1.OperationMetadata + * @static + * @param {google.cloud.apigeeregistry.v1.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.endTime = null; + object.target = ""; + object.verb = ""; + object.statusMessage = ""; + object.cancellationRequested = false; + object.apiVersion = ""; + } + if (message.createTime != null && message.hasOwnProperty("createTime")) + object.createTime = $root.google.protobuf.Timestamp.toObject(message.createTime, options); + if (message.endTime != null && message.hasOwnProperty("endTime")) + object.endTime = $root.google.protobuf.Timestamp.toObject(message.endTime, options); + if (message.target != null && message.hasOwnProperty("target")) + object.target = message.target; + if (message.verb != null && message.hasOwnProperty("verb")) + object.verb = message.verb; + if (message.statusMessage != null && message.hasOwnProperty("statusMessage")) + object.statusMessage = message.statusMessage; + if (message.cancellationRequested != null && message.hasOwnProperty("cancellationRequested")) + object.cancellationRequested = message.cancellationRequested; + if (message.apiVersion != null && message.hasOwnProperty("apiVersion")) + object.apiVersion = message.apiVersion; + return object; + }; + + /** + * Converts this OperationMetadata to JSON. + * @function toJSON + * @memberof google.cloud.apigeeregistry.v1.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.apigeeregistry.v1.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.apigeeregistry.v1.OperationMetadata"; + }; + + return OperationMetadata; + })(); + + v1.Instance = (function() { + + /** + * Properties of an Instance. + * @memberof google.cloud.apigeeregistry.v1 + * @interface IInstance + * @property {string|null} [name] Instance name + * @property {google.protobuf.ITimestamp|null} [createTime] Instance createTime + * @property {google.protobuf.ITimestamp|null} [updateTime] Instance updateTime + * @property {google.cloud.apigeeregistry.v1.Instance.State|null} [state] Instance state + * @property {string|null} [stateMessage] Instance stateMessage + * @property {google.cloud.apigeeregistry.v1.Instance.IConfig|null} [config] Instance config + */ + + /** + * Constructs a new Instance. + * @memberof google.cloud.apigeeregistry.v1 + * @classdesc Represents an Instance. + * @implements IInstance + * @constructor + * @param {google.cloud.apigeeregistry.v1.IInstance=} [properties] Properties to set + */ + function Instance(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Instance name. + * @member {string} name + * @memberof google.cloud.apigeeregistry.v1.Instance + * @instance + */ + Instance.prototype.name = ""; + + /** + * Instance createTime. + * @member {google.protobuf.ITimestamp|null|undefined} createTime + * @memberof google.cloud.apigeeregistry.v1.Instance + * @instance + */ + Instance.prototype.createTime = null; + + /** + * Instance updateTime. + * @member {google.protobuf.ITimestamp|null|undefined} updateTime + * @memberof google.cloud.apigeeregistry.v1.Instance + * @instance + */ + Instance.prototype.updateTime = null; + + /** + * Instance state. + * @member {google.cloud.apigeeregistry.v1.Instance.State} state + * @memberof google.cloud.apigeeregistry.v1.Instance + * @instance + */ + Instance.prototype.state = 0; + + /** + * Instance stateMessage. + * @member {string} stateMessage + * @memberof google.cloud.apigeeregistry.v1.Instance + * @instance + */ + Instance.prototype.stateMessage = ""; + + /** + * Instance config. + * @member {google.cloud.apigeeregistry.v1.Instance.IConfig|null|undefined} config + * @memberof google.cloud.apigeeregistry.v1.Instance + * @instance + */ + Instance.prototype.config = null; + + /** + * Creates a new Instance instance using the specified properties. + * @function create + * @memberof google.cloud.apigeeregistry.v1.Instance + * @static + * @param {google.cloud.apigeeregistry.v1.IInstance=} [properties] Properties to set + * @returns {google.cloud.apigeeregistry.v1.Instance} Instance instance + */ + Instance.create = function create(properties) { + return new Instance(properties); + }; + + /** + * Encodes the specified Instance message. Does not implicitly {@link google.cloud.apigeeregistry.v1.Instance.verify|verify} messages. + * @function encode + * @memberof google.cloud.apigeeregistry.v1.Instance + * @static + * @param {google.cloud.apigeeregistry.v1.IInstance} message Instance message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Instance.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.createTime != null && Object.hasOwnProperty.call(message, "createTime")) + $root.google.protobuf.Timestamp.encode(message.createTime, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + 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(); + if (message.state != null && Object.hasOwnProperty.call(message, "state")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.state); + if (message.stateMessage != null && Object.hasOwnProperty.call(message, "stateMessage")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.stateMessage); + if (message.config != null && Object.hasOwnProperty.call(message, "config")) + $root.google.cloud.apigeeregistry.v1.Instance.Config.encode(message.config, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified Instance message, length delimited. Does not implicitly {@link google.cloud.apigeeregistry.v1.Instance.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.apigeeregistry.v1.Instance + * @static + * @param {google.cloud.apigeeregistry.v1.IInstance} message Instance message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Instance.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an Instance message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.apigeeregistry.v1.Instance + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.apigeeregistry.v1.Instance} Instance + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Instance.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.apigeeregistry.v1.Instance(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.createTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 3: { + message.updateTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 4: { + message.state = reader.int32(); + break; + } + case 5: { + message.stateMessage = reader.string(); + break; + } + case 6: { + message.config = $root.google.cloud.apigeeregistry.v1.Instance.Config.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an Instance message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.apigeeregistry.v1.Instance + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.apigeeregistry.v1.Instance} Instance + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Instance.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an Instance message. + * @function verify + * @memberof google.cloud.apigeeregistry.v1.Instance + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Instance.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.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.state != null && message.hasOwnProperty("state")) + switch (message.state) { + default: + return "state: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + case 5: + case 6: + break; + } + if (message.stateMessage != null && message.hasOwnProperty("stateMessage")) + if (!$util.isString(message.stateMessage)) + return "stateMessage: string expected"; + if (message.config != null && message.hasOwnProperty("config")) { + var error = $root.google.cloud.apigeeregistry.v1.Instance.Config.verify(message.config); + if (error) + return "config." + error; + } + return null; + }; + + /** + * Creates an Instance message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.apigeeregistry.v1.Instance + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.apigeeregistry.v1.Instance} Instance + */ + Instance.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.apigeeregistry.v1.Instance) + return object; + var message = new $root.google.cloud.apigeeregistry.v1.Instance(); + if (object.name != null) + message.name = String(object.name); + if (object.createTime != null) { + if (typeof object.createTime !== "object") + throw TypeError(".google.cloud.apigeeregistry.v1.Instance.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.apigeeregistry.v1.Instance.updateTime: object expected"); + message.updateTime = $root.google.protobuf.Timestamp.fromObject(object.updateTime); + } + 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 "INACTIVE": + case 1: + message.state = 1; + break; + case "CREATING": + case 2: + message.state = 2; + break; + case "ACTIVE": + case 3: + message.state = 3; + break; + case "UPDATING": + case 4: + message.state = 4; + break; + case "DELETING": + case 5: + message.state = 5; + break; + case "FAILED": + case 6: + message.state = 6; + break; + } + if (object.stateMessage != null) + message.stateMessage = String(object.stateMessage); + if (object.config != null) { + if (typeof object.config !== "object") + throw TypeError(".google.cloud.apigeeregistry.v1.Instance.config: object expected"); + message.config = $root.google.cloud.apigeeregistry.v1.Instance.Config.fromObject(object.config); + } + return message; + }; + + /** + * Creates a plain object from an Instance message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.apigeeregistry.v1.Instance + * @static + * @param {google.cloud.apigeeregistry.v1.Instance} message Instance + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Instance.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.createTime = null; + object.updateTime = null; + object.state = options.enums === String ? "STATE_UNSPECIFIED" : 0; + object.stateMessage = ""; + object.config = null; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + 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.state != null && message.hasOwnProperty("state")) + object.state = options.enums === String ? $root.google.cloud.apigeeregistry.v1.Instance.State[message.state] === undefined ? message.state : $root.google.cloud.apigeeregistry.v1.Instance.State[message.state] : message.state; + if (message.stateMessage != null && message.hasOwnProperty("stateMessage")) + object.stateMessage = message.stateMessage; + if (message.config != null && message.hasOwnProperty("config")) + object.config = $root.google.cloud.apigeeregistry.v1.Instance.Config.toObject(message.config, options); + return object; + }; + + /** + * Converts this Instance to JSON. + * @function toJSON + * @memberof google.cloud.apigeeregistry.v1.Instance + * @instance + * @returns {Object.} JSON object + */ + Instance.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Instance + * @function getTypeUrl + * @memberof google.cloud.apigeeregistry.v1.Instance + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Instance.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.apigeeregistry.v1.Instance"; + }; + + /** + * State enum. + * @name google.cloud.apigeeregistry.v1.Instance.State + * @enum {number} + * @property {number} STATE_UNSPECIFIED=0 STATE_UNSPECIFIED value + * @property {number} INACTIVE=1 INACTIVE value + * @property {number} CREATING=2 CREATING value + * @property {number} ACTIVE=3 ACTIVE value + * @property {number} UPDATING=4 UPDATING value + * @property {number} DELETING=5 DELETING value + * @property {number} FAILED=6 FAILED value + */ + Instance.State = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "STATE_UNSPECIFIED"] = 0; + values[valuesById[1] = "INACTIVE"] = 1; + values[valuesById[2] = "CREATING"] = 2; + values[valuesById[3] = "ACTIVE"] = 3; + values[valuesById[4] = "UPDATING"] = 4; + values[valuesById[5] = "DELETING"] = 5; + values[valuesById[6] = "FAILED"] = 6; + return values; + })(); + + Instance.Config = (function() { + + /** + * Properties of a Config. + * @memberof google.cloud.apigeeregistry.v1.Instance + * @interface IConfig + * @property {string|null} [location] Config location + * @property {string|null} [cmekKeyName] Config cmekKeyName + */ + + /** + * Constructs a new Config. + * @memberof google.cloud.apigeeregistry.v1.Instance + * @classdesc Represents a Config. + * @implements IConfig + * @constructor + * @param {google.cloud.apigeeregistry.v1.Instance.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 location. + * @member {string} location + * @memberof google.cloud.apigeeregistry.v1.Instance.Config + * @instance + */ + Config.prototype.location = ""; + + /** + * Config cmekKeyName. + * @member {string} cmekKeyName + * @memberof google.cloud.apigeeregistry.v1.Instance.Config + * @instance + */ + Config.prototype.cmekKeyName = ""; + + /** + * Creates a new Config instance using the specified properties. + * @function create + * @memberof google.cloud.apigeeregistry.v1.Instance.Config + * @static + * @param {google.cloud.apigeeregistry.v1.Instance.IConfig=} [properties] Properties to set + * @returns {google.cloud.apigeeregistry.v1.Instance.Config} Config instance + */ + Config.create = function create(properties) { + return new Config(properties); + }; + + /** + * Encodes the specified Config message. Does not implicitly {@link google.cloud.apigeeregistry.v1.Instance.Config.verify|verify} messages. + * @function encode + * @memberof google.cloud.apigeeregistry.v1.Instance.Config + * @static + * @param {google.cloud.apigeeregistry.v1.Instance.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.location != null && Object.hasOwnProperty.call(message, "location")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.location); + if (message.cmekKeyName != null && Object.hasOwnProperty.call(message, "cmekKeyName")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.cmekKeyName); + return writer; + }; + + /** + * Encodes the specified Config message, length delimited. Does not implicitly {@link google.cloud.apigeeregistry.v1.Instance.Config.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.apigeeregistry.v1.Instance.Config + * @static + * @param {google.cloud.apigeeregistry.v1.Instance.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.apigeeregistry.v1.Instance.Config + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.apigeeregistry.v1.Instance.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) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.apigeeregistry.v1.Instance.Config(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.location = reader.string(); + break; + } + case 2: { + message.cmekKeyName = reader.string(); + 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.apigeeregistry.v1.Instance.Config + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.apigeeregistry.v1.Instance.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.apigeeregistry.v1.Instance.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.location != null && message.hasOwnProperty("location")) + if (!$util.isString(message.location)) + return "location: string expected"; + if (message.cmekKeyName != null && message.hasOwnProperty("cmekKeyName")) + if (!$util.isString(message.cmekKeyName)) + return "cmekKeyName: string expected"; + return null; + }; + + /** + * Creates a Config message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.apigeeregistry.v1.Instance.Config + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.apigeeregistry.v1.Instance.Config} Config + */ + Config.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.apigeeregistry.v1.Instance.Config) + return object; + var message = new $root.google.cloud.apigeeregistry.v1.Instance.Config(); + if (object.location != null) + message.location = String(object.location); + if (object.cmekKeyName != null) + message.cmekKeyName = String(object.cmekKeyName); + return message; + }; + + /** + * Creates a plain object from a Config message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.apigeeregistry.v1.Instance.Config + * @static + * @param {google.cloud.apigeeregistry.v1.Instance.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.location = ""; + object.cmekKeyName = ""; + } + if (message.location != null && message.hasOwnProperty("location")) + object.location = message.location; + if (message.cmekKeyName != null && message.hasOwnProperty("cmekKeyName")) + object.cmekKeyName = message.cmekKeyName; + return object; + }; + + /** + * Converts this Config to JSON. + * @function toJSON + * @memberof google.cloud.apigeeregistry.v1.Instance.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.apigeeregistry.v1.Instance.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.apigeeregistry.v1.Instance.Config"; + }; + + return Config; + })(); + + return Instance; + })(); + + v1.Api = (function() { + + /** + * Properties of an Api. + * @memberof google.cloud.apigeeregistry.v1 + * @interface IApi + * @property {string|null} [name] Api name + * @property {string|null} [displayName] Api displayName + * @property {string|null} [description] Api description + * @property {google.protobuf.ITimestamp|null} [createTime] Api createTime + * @property {google.protobuf.ITimestamp|null} [updateTime] Api updateTime + * @property {string|null} [availability] Api availability + * @property {string|null} [recommendedVersion] Api recommendedVersion + * @property {string|null} [recommendedDeployment] Api recommendedDeployment + * @property {Object.|null} [labels] Api labels + * @property {Object.|null} [annotations] Api annotations + */ + + /** + * Constructs a new Api. + * @memberof google.cloud.apigeeregistry.v1 + * @classdesc Represents an Api. + * @implements IApi + * @constructor + * @param {google.cloud.apigeeregistry.v1.IApi=} [properties] Properties to set + */ + function Api(properties) { + this.labels = {}; + 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]]; + } + + /** + * Api name. + * @member {string} name + * @memberof google.cloud.apigeeregistry.v1.Api + * @instance + */ + Api.prototype.name = ""; + + /** + * Api displayName. + * @member {string} displayName + * @memberof google.cloud.apigeeregistry.v1.Api + * @instance + */ + Api.prototype.displayName = ""; + + /** + * Api description. + * @member {string} description + * @memberof google.cloud.apigeeregistry.v1.Api + * @instance + */ + Api.prototype.description = ""; + + /** + * Api createTime. + * @member {google.protobuf.ITimestamp|null|undefined} createTime + * @memberof google.cloud.apigeeregistry.v1.Api + * @instance + */ + Api.prototype.createTime = null; + + /** + * Api updateTime. + * @member {google.protobuf.ITimestamp|null|undefined} updateTime + * @memberof google.cloud.apigeeregistry.v1.Api + * @instance + */ + Api.prototype.updateTime = null; + + /** + * Api availability. + * @member {string} availability + * @memberof google.cloud.apigeeregistry.v1.Api + * @instance + */ + Api.prototype.availability = ""; + + /** + * Api recommendedVersion. + * @member {string} recommendedVersion + * @memberof google.cloud.apigeeregistry.v1.Api + * @instance + */ + Api.prototype.recommendedVersion = ""; + + /** + * Api recommendedDeployment. + * @member {string} recommendedDeployment + * @memberof google.cloud.apigeeregistry.v1.Api + * @instance + */ + Api.prototype.recommendedDeployment = ""; + + /** + * Api labels. + * @member {Object.} labels + * @memberof google.cloud.apigeeregistry.v1.Api + * @instance + */ + Api.prototype.labels = $util.emptyObject; + + /** + * Api annotations. + * @member {Object.} annotations + * @memberof google.cloud.apigeeregistry.v1.Api + * @instance + */ + Api.prototype.annotations = $util.emptyObject; + + /** + * Creates a new Api instance using the specified properties. + * @function create + * @memberof google.cloud.apigeeregistry.v1.Api + * @static + * @param {google.cloud.apigeeregistry.v1.IApi=} [properties] Properties to set + * @returns {google.cloud.apigeeregistry.v1.Api} Api instance + */ + Api.create = function create(properties) { + return new Api(properties); + }; + + /** + * Encodes the specified Api message. Does not implicitly {@link google.cloud.apigeeregistry.v1.Api.verify|verify} messages. + * @function encode + * @memberof google.cloud.apigeeregistry.v1.Api + * @static + * @param {google.cloud.apigeeregistry.v1.IApi} message Api message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Api.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.displayName != null && Object.hasOwnProperty.call(message, "displayName")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.displayName); + if (message.description != null && Object.hasOwnProperty.call(message, "description")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.description); + if (message.createTime != null && Object.hasOwnProperty.call(message, "createTime")) + $root.google.protobuf.Timestamp.encode(message.createTime, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.updateTime != null && Object.hasOwnProperty.call(message, "updateTime")) + $root.google.protobuf.Timestamp.encode(message.updateTime, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.availability != null && Object.hasOwnProperty.call(message, "availability")) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.availability); + if (message.recommendedVersion != null && Object.hasOwnProperty.call(message, "recommendedVersion")) + writer.uint32(/* id 7, wireType 2 =*/58).string(message.recommendedVersion); + if (message.recommendedDeployment != null && Object.hasOwnProperty.call(message, "recommendedDeployment")) + writer.uint32(/* id 8, wireType 2 =*/66).string(message.recommendedDeployment); + if (message.labels != null && Object.hasOwnProperty.call(message, "labels")) + for (var keys = Object.keys(message.labels), i = 0; i < keys.length; ++i) + writer.uint32(/* id 9, wireType 2 =*/74).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.labels[keys[i]]).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(); + return writer; + }; + + /** + * Encodes the specified Api message, length delimited. Does not implicitly {@link google.cloud.apigeeregistry.v1.Api.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.apigeeregistry.v1.Api + * @static + * @param {google.cloud.apigeeregistry.v1.IApi} message Api message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Api.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an Api message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.apigeeregistry.v1.Api + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.apigeeregistry.v1.Api} Api + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Api.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.apigeeregistry.v1.Api(), key, value; + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.displayName = reader.string(); + break; + } + case 3: { + message.description = reader.string(); + break; + } + case 4: { + message.createTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 5: { + message.updateTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 6: { + message.availability = reader.string(); + break; + } + case 7: { + message.recommendedVersion = reader.string(); + break; + } + case 8: { + message.recommendedDeployment = reader.string(); + break; + } + case 9: { + if (message.labels === $util.emptyObject) + message.labels = {}; + 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.labels[key] = value; + 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; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an Api message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.apigeeregistry.v1.Api + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.apigeeregistry.v1.Api} Api + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Api.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an Api message. + * @function verify + * @memberof google.cloud.apigeeregistry.v1.Api + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Api.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.displayName != null && message.hasOwnProperty("displayName")) + if (!$util.isString(message.displayName)) + return "displayName: string expected"; + if (message.description != null && message.hasOwnProperty("description")) + if (!$util.isString(message.description)) + return "description: string expected"; + 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.availability != null && message.hasOwnProperty("availability")) + if (!$util.isString(message.availability)) + return "availability: string expected"; + if (message.recommendedVersion != null && message.hasOwnProperty("recommendedVersion")) + if (!$util.isString(message.recommendedVersion)) + return "recommendedVersion: string expected"; + if (message.recommendedDeployment != null && message.hasOwnProperty("recommendedDeployment")) + if (!$util.isString(message.recommendedDeployment)) + return "recommendedDeployment: string expected"; + if (message.labels != null && message.hasOwnProperty("labels")) { + if (!$util.isObject(message.labels)) + return "labels: object expected"; + var key = Object.keys(message.labels); + for (var i = 0; i < key.length; ++i) + if (!$util.isString(message.labels[key[i]])) + return "labels: string{k:string} expected"; + } + 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"; + } + return null; + }; + + /** + * Creates an Api message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.apigeeregistry.v1.Api + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.apigeeregistry.v1.Api} Api + */ + Api.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.apigeeregistry.v1.Api) + return object; + var message = new $root.google.cloud.apigeeregistry.v1.Api(); + if (object.name != null) + message.name = String(object.name); + if (object.displayName != null) + message.displayName = String(object.displayName); + if (object.description != null) + message.description = String(object.description); + if (object.createTime != null) { + if (typeof object.createTime !== "object") + throw TypeError(".google.cloud.apigeeregistry.v1.Api.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.apigeeregistry.v1.Api.updateTime: object expected"); + message.updateTime = $root.google.protobuf.Timestamp.fromObject(object.updateTime); + } + if (object.availability != null) + message.availability = String(object.availability); + if (object.recommendedVersion != null) + message.recommendedVersion = String(object.recommendedVersion); + if (object.recommendedDeployment != null) + message.recommendedDeployment = String(object.recommendedDeployment); + if (object.labels) { + if (typeof object.labels !== "object") + throw TypeError(".google.cloud.apigeeregistry.v1.Api.labels: object expected"); + message.labels = {}; + for (var keys = Object.keys(object.labels), i = 0; i < keys.length; ++i) + message.labels[keys[i]] = String(object.labels[keys[i]]); + } + if (object.annotations) { + if (typeof object.annotations !== "object") + throw TypeError(".google.cloud.apigeeregistry.v1.Api.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]]); + } + return message; + }; + + /** + * Creates a plain object from an Api message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.apigeeregistry.v1.Api + * @static + * @param {google.cloud.apigeeregistry.v1.Api} message Api + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Api.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.objects || options.defaults) { + object.labels = {}; + object.annotations = {}; + } + if (options.defaults) { + object.name = ""; + object.displayName = ""; + object.description = ""; + object.createTime = null; + object.updateTime = null; + object.availability = ""; + object.recommendedVersion = ""; + object.recommendedDeployment = ""; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.displayName != null && message.hasOwnProperty("displayName")) + object.displayName = message.displayName; + if (message.description != null && message.hasOwnProperty("description")) + object.description = message.description; + 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.availability != null && message.hasOwnProperty("availability")) + object.availability = message.availability; + if (message.recommendedVersion != null && message.hasOwnProperty("recommendedVersion")) + object.recommendedVersion = message.recommendedVersion; + if (message.recommendedDeployment != null && message.hasOwnProperty("recommendedDeployment")) + object.recommendedDeployment = message.recommendedDeployment; + var keys2; + if (message.labels && (keys2 = Object.keys(message.labels)).length) { + object.labels = {}; + for (var j = 0; j < keys2.length; ++j) + object.labels[keys2[j]] = message.labels[keys2[j]]; + } + 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]]; + } + return object; + }; + + /** + * Converts this Api to JSON. + * @function toJSON + * @memberof google.cloud.apigeeregistry.v1.Api + * @instance + * @returns {Object.} JSON object + */ + Api.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Api + * @function getTypeUrl + * @memberof google.cloud.apigeeregistry.v1.Api + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Api.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.apigeeregistry.v1.Api"; + }; + + return Api; + })(); + + v1.ApiVersion = (function() { + + /** + * Properties of an ApiVersion. + * @memberof google.cloud.apigeeregistry.v1 + * @interface IApiVersion + * @property {string|null} [name] ApiVersion name + * @property {string|null} [displayName] ApiVersion displayName + * @property {string|null} [description] ApiVersion description + * @property {google.protobuf.ITimestamp|null} [createTime] ApiVersion createTime + * @property {google.protobuf.ITimestamp|null} [updateTime] ApiVersion updateTime + * @property {string|null} [state] ApiVersion state + * @property {Object.|null} [labels] ApiVersion labels + * @property {Object.|null} [annotations] ApiVersion annotations + */ + + /** + * Constructs a new ApiVersion. + * @memberof google.cloud.apigeeregistry.v1 + * @classdesc Represents an ApiVersion. + * @implements IApiVersion + * @constructor + * @param {google.cloud.apigeeregistry.v1.IApiVersion=} [properties] Properties to set + */ + function ApiVersion(properties) { + this.labels = {}; + 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]]; + } + + /** + * ApiVersion name. + * @member {string} name + * @memberof google.cloud.apigeeregistry.v1.ApiVersion + * @instance + */ + ApiVersion.prototype.name = ""; + + /** + * ApiVersion displayName. + * @member {string} displayName + * @memberof google.cloud.apigeeregistry.v1.ApiVersion + * @instance + */ + ApiVersion.prototype.displayName = ""; + + /** + * ApiVersion description. + * @member {string} description + * @memberof google.cloud.apigeeregistry.v1.ApiVersion + * @instance + */ + ApiVersion.prototype.description = ""; + + /** + * ApiVersion createTime. + * @member {google.protobuf.ITimestamp|null|undefined} createTime + * @memberof google.cloud.apigeeregistry.v1.ApiVersion + * @instance + */ + ApiVersion.prototype.createTime = null; + + /** + * ApiVersion updateTime. + * @member {google.protobuf.ITimestamp|null|undefined} updateTime + * @memberof google.cloud.apigeeregistry.v1.ApiVersion + * @instance + */ + ApiVersion.prototype.updateTime = null; + + /** + * ApiVersion state. + * @member {string} state + * @memberof google.cloud.apigeeregistry.v1.ApiVersion + * @instance + */ + ApiVersion.prototype.state = ""; + + /** + * ApiVersion labels. + * @member {Object.} labels + * @memberof google.cloud.apigeeregistry.v1.ApiVersion + * @instance + */ + ApiVersion.prototype.labels = $util.emptyObject; + + /** + * ApiVersion annotations. + * @member {Object.} annotations + * @memberof google.cloud.apigeeregistry.v1.ApiVersion + * @instance + */ + ApiVersion.prototype.annotations = $util.emptyObject; + + /** + * Creates a new ApiVersion instance using the specified properties. + * @function create + * @memberof google.cloud.apigeeregistry.v1.ApiVersion + * @static + * @param {google.cloud.apigeeregistry.v1.IApiVersion=} [properties] Properties to set + * @returns {google.cloud.apigeeregistry.v1.ApiVersion} ApiVersion instance + */ + ApiVersion.create = function create(properties) { + return new ApiVersion(properties); + }; + + /** + * Encodes the specified ApiVersion message. Does not implicitly {@link google.cloud.apigeeregistry.v1.ApiVersion.verify|verify} messages. + * @function encode + * @memberof google.cloud.apigeeregistry.v1.ApiVersion + * @static + * @param {google.cloud.apigeeregistry.v1.IApiVersion} message ApiVersion message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ApiVersion.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.displayName != null && Object.hasOwnProperty.call(message, "displayName")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.displayName); + if (message.description != null && Object.hasOwnProperty.call(message, "description")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.description); + if (message.createTime != null && Object.hasOwnProperty.call(message, "createTime")) + $root.google.protobuf.Timestamp.encode(message.createTime, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.updateTime != null && Object.hasOwnProperty.call(message, "updateTime")) + $root.google.protobuf.Timestamp.encode(message.updateTime, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.state != null && Object.hasOwnProperty.call(message, "state")) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.state); + if (message.labels != null && Object.hasOwnProperty.call(message, "labels")) + for (var keys = Object.keys(message.labels), 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.labels[keys[i]]).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 8, wireType 2 =*/66).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.annotations[keys[i]]).ldelim(); + return writer; + }; + + /** + * Encodes the specified ApiVersion message, length delimited. Does not implicitly {@link google.cloud.apigeeregistry.v1.ApiVersion.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.apigeeregistry.v1.ApiVersion + * @static + * @param {google.cloud.apigeeregistry.v1.IApiVersion} message ApiVersion message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ApiVersion.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an ApiVersion message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.apigeeregistry.v1.ApiVersion + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.apigeeregistry.v1.ApiVersion} ApiVersion + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ApiVersion.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.apigeeregistry.v1.ApiVersion(), key, value; + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.displayName = reader.string(); + break; + } + case 3: { + message.description = reader.string(); + break; + } + case 4: { + message.createTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 5: { + message.updateTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 6: { + message.state = reader.string(); + break; + } + case 7: { + if (message.labels === $util.emptyObject) + message.labels = {}; + 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.labels[key] = value; + break; + } + case 8: { + 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; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an ApiVersion message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.apigeeregistry.v1.ApiVersion + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.apigeeregistry.v1.ApiVersion} ApiVersion + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ApiVersion.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an ApiVersion message. + * @function verify + * @memberof google.cloud.apigeeregistry.v1.ApiVersion + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ApiVersion.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.displayName != null && message.hasOwnProperty("displayName")) + if (!$util.isString(message.displayName)) + return "displayName: string expected"; + if (message.description != null && message.hasOwnProperty("description")) + if (!$util.isString(message.description)) + return "description: string expected"; + 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.state != null && message.hasOwnProperty("state")) + if (!$util.isString(message.state)) + return "state: string expected"; + if (message.labels != null && message.hasOwnProperty("labels")) { + if (!$util.isObject(message.labels)) + return "labels: object expected"; + var key = Object.keys(message.labels); + for (var i = 0; i < key.length; ++i) + if (!$util.isString(message.labels[key[i]])) + return "labels: string{k:string} expected"; + } + 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"; + } + return null; + }; + + /** + * Creates an ApiVersion message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.apigeeregistry.v1.ApiVersion + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.apigeeregistry.v1.ApiVersion} ApiVersion + */ + ApiVersion.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.apigeeregistry.v1.ApiVersion) + return object; + var message = new $root.google.cloud.apigeeregistry.v1.ApiVersion(); + if (object.name != null) + message.name = String(object.name); + if (object.displayName != null) + message.displayName = String(object.displayName); + if (object.description != null) + message.description = String(object.description); + if (object.createTime != null) { + if (typeof object.createTime !== "object") + throw TypeError(".google.cloud.apigeeregistry.v1.ApiVersion.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.apigeeregistry.v1.ApiVersion.updateTime: object expected"); + message.updateTime = $root.google.protobuf.Timestamp.fromObject(object.updateTime); + } + if (object.state != null) + message.state = String(object.state); + if (object.labels) { + if (typeof object.labels !== "object") + throw TypeError(".google.cloud.apigeeregistry.v1.ApiVersion.labels: object expected"); + message.labels = {}; + for (var keys = Object.keys(object.labels), i = 0; i < keys.length; ++i) + message.labels[keys[i]] = String(object.labels[keys[i]]); + } + if (object.annotations) { + if (typeof object.annotations !== "object") + throw TypeError(".google.cloud.apigeeregistry.v1.ApiVersion.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]]); + } + return message; + }; + + /** + * Creates a plain object from an ApiVersion message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.apigeeregistry.v1.ApiVersion + * @static + * @param {google.cloud.apigeeregistry.v1.ApiVersion} message ApiVersion + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ApiVersion.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.objects || options.defaults) { + object.labels = {}; + object.annotations = {}; + } + if (options.defaults) { + object.name = ""; + object.displayName = ""; + object.description = ""; + object.createTime = null; + object.updateTime = null; + object.state = ""; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.displayName != null && message.hasOwnProperty("displayName")) + object.displayName = message.displayName; + if (message.description != null && message.hasOwnProperty("description")) + object.description = message.description; + 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.state != null && message.hasOwnProperty("state")) + object.state = message.state; + var keys2; + if (message.labels && (keys2 = Object.keys(message.labels)).length) { + object.labels = {}; + for (var j = 0; j < keys2.length; ++j) + object.labels[keys2[j]] = message.labels[keys2[j]]; + } + 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]]; + } + return object; + }; + + /** + * Converts this ApiVersion to JSON. + * @function toJSON + * @memberof google.cloud.apigeeregistry.v1.ApiVersion + * @instance + * @returns {Object.} JSON object + */ + ApiVersion.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ApiVersion + * @function getTypeUrl + * @memberof google.cloud.apigeeregistry.v1.ApiVersion + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ApiVersion.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.apigeeregistry.v1.ApiVersion"; + }; + + return ApiVersion; + })(); + + v1.ApiSpec = (function() { + + /** + * Properties of an ApiSpec. + * @memberof google.cloud.apigeeregistry.v1 + * @interface IApiSpec + * @property {string|null} [name] ApiSpec name + * @property {string|null} [filename] ApiSpec filename + * @property {string|null} [description] ApiSpec description + * @property {string|null} [revisionId] ApiSpec revisionId + * @property {google.protobuf.ITimestamp|null} [createTime] ApiSpec createTime + * @property {google.protobuf.ITimestamp|null} [revisionCreateTime] ApiSpec revisionCreateTime + * @property {google.protobuf.ITimestamp|null} [revisionUpdateTime] ApiSpec revisionUpdateTime + * @property {string|null} [mimeType] ApiSpec mimeType + * @property {number|null} [sizeBytes] ApiSpec sizeBytes + * @property {string|null} [hash] ApiSpec hash + * @property {string|null} [sourceUri] ApiSpec sourceUri + * @property {Uint8Array|null} [contents] ApiSpec contents + * @property {Object.|null} [labels] ApiSpec labels + * @property {Object.|null} [annotations] ApiSpec annotations + */ + + /** + * Constructs a new ApiSpec. + * @memberof google.cloud.apigeeregistry.v1 + * @classdesc Represents an ApiSpec. + * @implements IApiSpec + * @constructor + * @param {google.cloud.apigeeregistry.v1.IApiSpec=} [properties] Properties to set + */ + function ApiSpec(properties) { + this.labels = {}; + 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]]; + } + + /** + * ApiSpec name. + * @member {string} name + * @memberof google.cloud.apigeeregistry.v1.ApiSpec + * @instance + */ + ApiSpec.prototype.name = ""; + + /** + * ApiSpec filename. + * @member {string} filename + * @memberof google.cloud.apigeeregistry.v1.ApiSpec + * @instance + */ + ApiSpec.prototype.filename = ""; + + /** + * ApiSpec description. + * @member {string} description + * @memberof google.cloud.apigeeregistry.v1.ApiSpec + * @instance + */ + ApiSpec.prototype.description = ""; + + /** + * ApiSpec revisionId. + * @member {string} revisionId + * @memberof google.cloud.apigeeregistry.v1.ApiSpec + * @instance + */ + ApiSpec.prototype.revisionId = ""; + + /** + * ApiSpec createTime. + * @member {google.protobuf.ITimestamp|null|undefined} createTime + * @memberof google.cloud.apigeeregistry.v1.ApiSpec + * @instance + */ + ApiSpec.prototype.createTime = null; + + /** + * ApiSpec revisionCreateTime. + * @member {google.protobuf.ITimestamp|null|undefined} revisionCreateTime + * @memberof google.cloud.apigeeregistry.v1.ApiSpec + * @instance + */ + ApiSpec.prototype.revisionCreateTime = null; + + /** + * ApiSpec revisionUpdateTime. + * @member {google.protobuf.ITimestamp|null|undefined} revisionUpdateTime + * @memberof google.cloud.apigeeregistry.v1.ApiSpec + * @instance + */ + ApiSpec.prototype.revisionUpdateTime = null; + + /** + * ApiSpec mimeType. + * @member {string} mimeType + * @memberof google.cloud.apigeeregistry.v1.ApiSpec + * @instance + */ + ApiSpec.prototype.mimeType = ""; + + /** + * ApiSpec sizeBytes. + * @member {number} sizeBytes + * @memberof google.cloud.apigeeregistry.v1.ApiSpec + * @instance + */ + ApiSpec.prototype.sizeBytes = 0; + + /** + * ApiSpec hash. + * @member {string} hash + * @memberof google.cloud.apigeeregistry.v1.ApiSpec + * @instance + */ + ApiSpec.prototype.hash = ""; + + /** + * ApiSpec sourceUri. + * @member {string} sourceUri + * @memberof google.cloud.apigeeregistry.v1.ApiSpec + * @instance + */ + ApiSpec.prototype.sourceUri = ""; + + /** + * ApiSpec contents. + * @member {Uint8Array} contents + * @memberof google.cloud.apigeeregistry.v1.ApiSpec + * @instance + */ + ApiSpec.prototype.contents = $util.newBuffer([]); + + /** + * ApiSpec labels. + * @member {Object.} labels + * @memberof google.cloud.apigeeregistry.v1.ApiSpec + * @instance + */ + ApiSpec.prototype.labels = $util.emptyObject; + + /** + * ApiSpec annotations. + * @member {Object.} annotations + * @memberof google.cloud.apigeeregistry.v1.ApiSpec + * @instance + */ + ApiSpec.prototype.annotations = $util.emptyObject; + + /** + * Creates a new ApiSpec instance using the specified properties. + * @function create + * @memberof google.cloud.apigeeregistry.v1.ApiSpec + * @static + * @param {google.cloud.apigeeregistry.v1.IApiSpec=} [properties] Properties to set + * @returns {google.cloud.apigeeregistry.v1.ApiSpec} ApiSpec instance + */ + ApiSpec.create = function create(properties) { + return new ApiSpec(properties); + }; + + /** + * Encodes the specified ApiSpec message. Does not implicitly {@link google.cloud.apigeeregistry.v1.ApiSpec.verify|verify} messages. + * @function encode + * @memberof google.cloud.apigeeregistry.v1.ApiSpec + * @static + * @param {google.cloud.apigeeregistry.v1.IApiSpec} message ApiSpec message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ApiSpec.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.filename != null && Object.hasOwnProperty.call(message, "filename")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.filename); + if (message.description != null && Object.hasOwnProperty.call(message, "description")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.description); + if (message.revisionId != null && Object.hasOwnProperty.call(message, "revisionId")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.revisionId); + if (message.createTime != null && Object.hasOwnProperty.call(message, "createTime")) + $root.google.protobuf.Timestamp.encode(message.createTime, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.revisionCreateTime != null && Object.hasOwnProperty.call(message, "revisionCreateTime")) + $root.google.protobuf.Timestamp.encode(message.revisionCreateTime, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + if (message.revisionUpdateTime != null && Object.hasOwnProperty.call(message, "revisionUpdateTime")) + $root.google.protobuf.Timestamp.encode(message.revisionUpdateTime, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + if (message.mimeType != null && Object.hasOwnProperty.call(message, "mimeType")) + writer.uint32(/* id 8, wireType 2 =*/66).string(message.mimeType); + if (message.sizeBytes != null && Object.hasOwnProperty.call(message, "sizeBytes")) + writer.uint32(/* id 9, wireType 0 =*/72).int32(message.sizeBytes); + if (message.hash != null && Object.hasOwnProperty.call(message, "hash")) + writer.uint32(/* id 10, wireType 2 =*/82).string(message.hash); + if (message.sourceUri != null && Object.hasOwnProperty.call(message, "sourceUri")) + writer.uint32(/* id 11, wireType 2 =*/90).string(message.sourceUri); + if (message.contents != null && Object.hasOwnProperty.call(message, "contents")) + writer.uint32(/* id 12, wireType 2 =*/98).bytes(message.contents); + if (message.labels != null && Object.hasOwnProperty.call(message, "labels")) + for (var keys = Object.keys(message.labels), 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.labels[keys[i]]).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 15, wireType 2 =*/122).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.annotations[keys[i]]).ldelim(); + return writer; + }; + + /** + * Encodes the specified ApiSpec message, length delimited. Does not implicitly {@link google.cloud.apigeeregistry.v1.ApiSpec.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.apigeeregistry.v1.ApiSpec + * @static + * @param {google.cloud.apigeeregistry.v1.IApiSpec} message ApiSpec message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ApiSpec.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an ApiSpec message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.apigeeregistry.v1.ApiSpec + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.apigeeregistry.v1.ApiSpec} ApiSpec + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ApiSpec.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.apigeeregistry.v1.ApiSpec(), key, value; + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.filename = reader.string(); + break; + } + case 3: { + message.description = reader.string(); + break; + } + case 4: { + message.revisionId = reader.string(); + break; + } + case 5: { + message.createTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 6: { + message.revisionCreateTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 7: { + message.revisionUpdateTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 8: { + message.mimeType = reader.string(); + break; + } + case 9: { + message.sizeBytes = reader.int32(); + break; + } + case 10: { + message.hash = reader.string(); + break; + } + case 11: { + message.sourceUri = reader.string(); + break; + } + case 12: { + message.contents = reader.bytes(); + break; + } + case 14: { + if (message.labels === $util.emptyObject) + message.labels = {}; + 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.labels[key] = value; + break; + } + case 15: { + 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; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an ApiSpec message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.apigeeregistry.v1.ApiSpec + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.apigeeregistry.v1.ApiSpec} ApiSpec + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ApiSpec.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an ApiSpec message. + * @function verify + * @memberof google.cloud.apigeeregistry.v1.ApiSpec + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ApiSpec.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.filename != null && message.hasOwnProperty("filename")) + if (!$util.isString(message.filename)) + return "filename: string expected"; + if (message.description != null && message.hasOwnProperty("description")) + if (!$util.isString(message.description)) + return "description: string expected"; + if (message.revisionId != null && message.hasOwnProperty("revisionId")) + if (!$util.isString(message.revisionId)) + return "revisionId: string expected"; + if (message.createTime != null && message.hasOwnProperty("createTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.createTime); + if (error) + return "createTime." + error; + } + if (message.revisionCreateTime != null && message.hasOwnProperty("revisionCreateTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.revisionCreateTime); + if (error) + return "revisionCreateTime." + error; + } + if (message.revisionUpdateTime != null && message.hasOwnProperty("revisionUpdateTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.revisionUpdateTime); + if (error) + return "revisionUpdateTime." + error; + } + if (message.mimeType != null && message.hasOwnProperty("mimeType")) + if (!$util.isString(message.mimeType)) + return "mimeType: string expected"; + if (message.sizeBytes != null && message.hasOwnProperty("sizeBytes")) + if (!$util.isInteger(message.sizeBytes)) + return "sizeBytes: integer expected"; + if (message.hash != null && message.hasOwnProperty("hash")) + if (!$util.isString(message.hash)) + return "hash: string expected"; + if (message.sourceUri != null && message.hasOwnProperty("sourceUri")) + if (!$util.isString(message.sourceUri)) + return "sourceUri: string expected"; + if (message.contents != null && message.hasOwnProperty("contents")) + if (!(message.contents && typeof message.contents.length === "number" || $util.isString(message.contents))) + return "contents: buffer expected"; + if (message.labels != null && message.hasOwnProperty("labels")) { + if (!$util.isObject(message.labels)) + return "labels: object expected"; + var key = Object.keys(message.labels); + for (var i = 0; i < key.length; ++i) + if (!$util.isString(message.labels[key[i]])) + return "labels: string{k:string} expected"; + } + 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"; + } + return null; + }; + + /** + * Creates an ApiSpec message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.apigeeregistry.v1.ApiSpec + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.apigeeregistry.v1.ApiSpec} ApiSpec + */ + ApiSpec.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.apigeeregistry.v1.ApiSpec) + return object; + var message = new $root.google.cloud.apigeeregistry.v1.ApiSpec(); + if (object.name != null) + message.name = String(object.name); + if (object.filename != null) + message.filename = String(object.filename); + if (object.description != null) + message.description = String(object.description); + if (object.revisionId != null) + message.revisionId = String(object.revisionId); + if (object.createTime != null) { + if (typeof object.createTime !== "object") + throw TypeError(".google.cloud.apigeeregistry.v1.ApiSpec.createTime: object expected"); + message.createTime = $root.google.protobuf.Timestamp.fromObject(object.createTime); + } + if (object.revisionCreateTime != null) { + if (typeof object.revisionCreateTime !== "object") + throw TypeError(".google.cloud.apigeeregistry.v1.ApiSpec.revisionCreateTime: object expected"); + message.revisionCreateTime = $root.google.protobuf.Timestamp.fromObject(object.revisionCreateTime); + } + if (object.revisionUpdateTime != null) { + if (typeof object.revisionUpdateTime !== "object") + throw TypeError(".google.cloud.apigeeregistry.v1.ApiSpec.revisionUpdateTime: object expected"); + message.revisionUpdateTime = $root.google.protobuf.Timestamp.fromObject(object.revisionUpdateTime); + } + if (object.mimeType != null) + message.mimeType = String(object.mimeType); + if (object.sizeBytes != null) + message.sizeBytes = object.sizeBytes | 0; + if (object.hash != null) + message.hash = String(object.hash); + if (object.sourceUri != null) + message.sourceUri = String(object.sourceUri); + if (object.contents != null) + if (typeof object.contents === "string") + $util.base64.decode(object.contents, message.contents = $util.newBuffer($util.base64.length(object.contents)), 0); + else if (object.contents.length >= 0) + message.contents = object.contents; + if (object.labels) { + if (typeof object.labels !== "object") + throw TypeError(".google.cloud.apigeeregistry.v1.ApiSpec.labels: object expected"); + message.labels = {}; + for (var keys = Object.keys(object.labels), i = 0; i < keys.length; ++i) + message.labels[keys[i]] = String(object.labels[keys[i]]); + } + if (object.annotations) { + if (typeof object.annotations !== "object") + throw TypeError(".google.cloud.apigeeregistry.v1.ApiSpec.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]]); + } + return message; + }; + + /** + * Creates a plain object from an ApiSpec message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.apigeeregistry.v1.ApiSpec + * @static + * @param {google.cloud.apigeeregistry.v1.ApiSpec} message ApiSpec + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ApiSpec.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.objects || options.defaults) { + object.labels = {}; + object.annotations = {}; + } + if (options.defaults) { + object.name = ""; + object.filename = ""; + object.description = ""; + object.revisionId = ""; + object.createTime = null; + object.revisionCreateTime = null; + object.revisionUpdateTime = null; + object.mimeType = ""; + object.sizeBytes = 0; + object.hash = ""; + object.sourceUri = ""; + if (options.bytes === String) + object.contents = ""; + else { + object.contents = []; + if (options.bytes !== Array) + object.contents = $util.newBuffer(object.contents); + } + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.filename != null && message.hasOwnProperty("filename")) + object.filename = message.filename; + if (message.description != null && message.hasOwnProperty("description")) + object.description = message.description; + if (message.revisionId != null && message.hasOwnProperty("revisionId")) + object.revisionId = message.revisionId; + if (message.createTime != null && message.hasOwnProperty("createTime")) + object.createTime = $root.google.protobuf.Timestamp.toObject(message.createTime, options); + if (message.revisionCreateTime != null && message.hasOwnProperty("revisionCreateTime")) + object.revisionCreateTime = $root.google.protobuf.Timestamp.toObject(message.revisionCreateTime, options); + if (message.revisionUpdateTime != null && message.hasOwnProperty("revisionUpdateTime")) + object.revisionUpdateTime = $root.google.protobuf.Timestamp.toObject(message.revisionUpdateTime, options); + if (message.mimeType != null && message.hasOwnProperty("mimeType")) + object.mimeType = message.mimeType; + if (message.sizeBytes != null && message.hasOwnProperty("sizeBytes")) + object.sizeBytes = message.sizeBytes; + if (message.hash != null && message.hasOwnProperty("hash")) + object.hash = message.hash; + if (message.sourceUri != null && message.hasOwnProperty("sourceUri")) + object.sourceUri = message.sourceUri; + if (message.contents != null && message.hasOwnProperty("contents")) + object.contents = options.bytes === String ? $util.base64.encode(message.contents, 0, message.contents.length) : options.bytes === Array ? Array.prototype.slice.call(message.contents) : message.contents; + var keys2; + if (message.labels && (keys2 = Object.keys(message.labels)).length) { + object.labels = {}; + for (var j = 0; j < keys2.length; ++j) + object.labels[keys2[j]] = message.labels[keys2[j]]; + } + 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]]; + } + return object; + }; + + /** + * Converts this ApiSpec to JSON. + * @function toJSON + * @memberof google.cloud.apigeeregistry.v1.ApiSpec + * @instance + * @returns {Object.} JSON object + */ + ApiSpec.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ApiSpec + * @function getTypeUrl + * @memberof google.cloud.apigeeregistry.v1.ApiSpec + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ApiSpec.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.apigeeregistry.v1.ApiSpec"; + }; + + return ApiSpec; + })(); + + v1.ApiDeployment = (function() { + + /** + * Properties of an ApiDeployment. + * @memberof google.cloud.apigeeregistry.v1 + * @interface IApiDeployment + * @property {string|null} [name] ApiDeployment name + * @property {string|null} [displayName] ApiDeployment displayName + * @property {string|null} [description] ApiDeployment description + * @property {string|null} [revisionId] ApiDeployment revisionId + * @property {google.protobuf.ITimestamp|null} [createTime] ApiDeployment createTime + * @property {google.protobuf.ITimestamp|null} [revisionCreateTime] ApiDeployment revisionCreateTime + * @property {google.protobuf.ITimestamp|null} [revisionUpdateTime] ApiDeployment revisionUpdateTime + * @property {string|null} [apiSpecRevision] ApiDeployment apiSpecRevision + * @property {string|null} [endpointUri] ApiDeployment endpointUri + * @property {string|null} [externalChannelUri] ApiDeployment externalChannelUri + * @property {string|null} [intendedAudience] ApiDeployment intendedAudience + * @property {string|null} [accessGuidance] ApiDeployment accessGuidance + * @property {Object.|null} [labels] ApiDeployment labels + * @property {Object.|null} [annotations] ApiDeployment annotations + */ + + /** + * Constructs a new ApiDeployment. + * @memberof google.cloud.apigeeregistry.v1 + * @classdesc Represents an ApiDeployment. + * @implements IApiDeployment + * @constructor + * @param {google.cloud.apigeeregistry.v1.IApiDeployment=} [properties] Properties to set + */ + function ApiDeployment(properties) { + this.labels = {}; + 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]]; + } + + /** + * ApiDeployment name. + * @member {string} name + * @memberof google.cloud.apigeeregistry.v1.ApiDeployment + * @instance + */ + ApiDeployment.prototype.name = ""; + + /** + * ApiDeployment displayName. + * @member {string} displayName + * @memberof google.cloud.apigeeregistry.v1.ApiDeployment + * @instance + */ + ApiDeployment.prototype.displayName = ""; + + /** + * ApiDeployment description. + * @member {string} description + * @memberof google.cloud.apigeeregistry.v1.ApiDeployment + * @instance + */ + ApiDeployment.prototype.description = ""; + + /** + * ApiDeployment revisionId. + * @member {string} revisionId + * @memberof google.cloud.apigeeregistry.v1.ApiDeployment + * @instance + */ + ApiDeployment.prototype.revisionId = ""; + + /** + * ApiDeployment createTime. + * @member {google.protobuf.ITimestamp|null|undefined} createTime + * @memberof google.cloud.apigeeregistry.v1.ApiDeployment + * @instance + */ + ApiDeployment.prototype.createTime = null; + + /** + * ApiDeployment revisionCreateTime. + * @member {google.protobuf.ITimestamp|null|undefined} revisionCreateTime + * @memberof google.cloud.apigeeregistry.v1.ApiDeployment + * @instance + */ + ApiDeployment.prototype.revisionCreateTime = null; + + /** + * ApiDeployment revisionUpdateTime. + * @member {google.protobuf.ITimestamp|null|undefined} revisionUpdateTime + * @memberof google.cloud.apigeeregistry.v1.ApiDeployment + * @instance + */ + ApiDeployment.prototype.revisionUpdateTime = null; + + /** + * ApiDeployment apiSpecRevision. + * @member {string} apiSpecRevision + * @memberof google.cloud.apigeeregistry.v1.ApiDeployment + * @instance + */ + ApiDeployment.prototype.apiSpecRevision = ""; + + /** + * ApiDeployment endpointUri. + * @member {string} endpointUri + * @memberof google.cloud.apigeeregistry.v1.ApiDeployment + * @instance + */ + ApiDeployment.prototype.endpointUri = ""; + + /** + * ApiDeployment externalChannelUri. + * @member {string} externalChannelUri + * @memberof google.cloud.apigeeregistry.v1.ApiDeployment + * @instance + */ + ApiDeployment.prototype.externalChannelUri = ""; + + /** + * ApiDeployment intendedAudience. + * @member {string} intendedAudience + * @memberof google.cloud.apigeeregistry.v1.ApiDeployment + * @instance + */ + ApiDeployment.prototype.intendedAudience = ""; + + /** + * ApiDeployment accessGuidance. + * @member {string} accessGuidance + * @memberof google.cloud.apigeeregistry.v1.ApiDeployment + * @instance + */ + ApiDeployment.prototype.accessGuidance = ""; + + /** + * ApiDeployment labels. + * @member {Object.} labels + * @memberof google.cloud.apigeeregistry.v1.ApiDeployment + * @instance + */ + ApiDeployment.prototype.labels = $util.emptyObject; + + /** + * ApiDeployment annotations. + * @member {Object.} annotations + * @memberof google.cloud.apigeeregistry.v1.ApiDeployment + * @instance + */ + ApiDeployment.prototype.annotations = $util.emptyObject; + + /** + * Creates a new ApiDeployment instance using the specified properties. + * @function create + * @memberof google.cloud.apigeeregistry.v1.ApiDeployment + * @static + * @param {google.cloud.apigeeregistry.v1.IApiDeployment=} [properties] Properties to set + * @returns {google.cloud.apigeeregistry.v1.ApiDeployment} ApiDeployment instance + */ + ApiDeployment.create = function create(properties) { + return new ApiDeployment(properties); + }; + + /** + * Encodes the specified ApiDeployment message. Does not implicitly {@link google.cloud.apigeeregistry.v1.ApiDeployment.verify|verify} messages. + * @function encode + * @memberof google.cloud.apigeeregistry.v1.ApiDeployment + * @static + * @param {google.cloud.apigeeregistry.v1.IApiDeployment} message ApiDeployment message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ApiDeployment.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.displayName != null && Object.hasOwnProperty.call(message, "displayName")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.displayName); + if (message.description != null && Object.hasOwnProperty.call(message, "description")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.description); + if (message.revisionId != null && Object.hasOwnProperty.call(message, "revisionId")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.revisionId); + if (message.createTime != null && Object.hasOwnProperty.call(message, "createTime")) + $root.google.protobuf.Timestamp.encode(message.createTime, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.revisionCreateTime != null && Object.hasOwnProperty.call(message, "revisionCreateTime")) + $root.google.protobuf.Timestamp.encode(message.revisionCreateTime, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + if (message.revisionUpdateTime != null && Object.hasOwnProperty.call(message, "revisionUpdateTime")) + $root.google.protobuf.Timestamp.encode(message.revisionUpdateTime, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + if (message.apiSpecRevision != null && Object.hasOwnProperty.call(message, "apiSpecRevision")) + writer.uint32(/* id 8, wireType 2 =*/66).string(message.apiSpecRevision); + if (message.endpointUri != null && Object.hasOwnProperty.call(message, "endpointUri")) + writer.uint32(/* id 9, wireType 2 =*/74).string(message.endpointUri); + if (message.externalChannelUri != null && Object.hasOwnProperty.call(message, "externalChannelUri")) + writer.uint32(/* id 10, wireType 2 =*/82).string(message.externalChannelUri); + if (message.intendedAudience != null && Object.hasOwnProperty.call(message, "intendedAudience")) + writer.uint32(/* id 11, wireType 2 =*/90).string(message.intendedAudience); + if (message.accessGuidance != null && Object.hasOwnProperty.call(message, "accessGuidance")) + writer.uint32(/* id 12, wireType 2 =*/98).string(message.accessGuidance); + if (message.labels != null && Object.hasOwnProperty.call(message, "labels")) + for (var keys = Object.keys(message.labels), 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.labels[keys[i]]).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 15, wireType 2 =*/122).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.annotations[keys[i]]).ldelim(); + return writer; + }; + + /** + * Encodes the specified ApiDeployment message, length delimited. Does not implicitly {@link google.cloud.apigeeregistry.v1.ApiDeployment.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.apigeeregistry.v1.ApiDeployment + * @static + * @param {google.cloud.apigeeregistry.v1.IApiDeployment} message ApiDeployment message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ApiDeployment.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an ApiDeployment message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.apigeeregistry.v1.ApiDeployment + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.apigeeregistry.v1.ApiDeployment} ApiDeployment + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ApiDeployment.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.apigeeregistry.v1.ApiDeployment(), key, value; + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.displayName = reader.string(); + break; + } + case 3: { + message.description = reader.string(); + break; + } + case 4: { + message.revisionId = reader.string(); + break; + } + case 5: { + message.createTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 6: { + message.revisionCreateTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 7: { + message.revisionUpdateTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 8: { + message.apiSpecRevision = reader.string(); + break; + } + case 9: { + message.endpointUri = reader.string(); + break; + } + case 10: { + message.externalChannelUri = reader.string(); + break; + } + case 11: { + message.intendedAudience = reader.string(); + break; + } + case 12: { + message.accessGuidance = reader.string(); + break; + } + case 14: { + if (message.labels === $util.emptyObject) + message.labels = {}; + 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.labels[key] = value; + break; + } + case 15: { + 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; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an ApiDeployment message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.apigeeregistry.v1.ApiDeployment + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.apigeeregistry.v1.ApiDeployment} ApiDeployment + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ApiDeployment.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an ApiDeployment message. + * @function verify + * @memberof google.cloud.apigeeregistry.v1.ApiDeployment + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ApiDeployment.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.displayName != null && message.hasOwnProperty("displayName")) + if (!$util.isString(message.displayName)) + return "displayName: string expected"; + if (message.description != null && message.hasOwnProperty("description")) + if (!$util.isString(message.description)) + return "description: string expected"; + if (message.revisionId != null && message.hasOwnProperty("revisionId")) + if (!$util.isString(message.revisionId)) + return "revisionId: string expected"; + if (message.createTime != null && message.hasOwnProperty("createTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.createTime); + if (error) + return "createTime." + error; + } + if (message.revisionCreateTime != null && message.hasOwnProperty("revisionCreateTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.revisionCreateTime); + if (error) + return "revisionCreateTime." + error; + } + if (message.revisionUpdateTime != null && message.hasOwnProperty("revisionUpdateTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.revisionUpdateTime); + if (error) + return "revisionUpdateTime." + error; + } + if (message.apiSpecRevision != null && message.hasOwnProperty("apiSpecRevision")) + if (!$util.isString(message.apiSpecRevision)) + return "apiSpecRevision: string expected"; + if (message.endpointUri != null && message.hasOwnProperty("endpointUri")) + if (!$util.isString(message.endpointUri)) + return "endpointUri: string expected"; + if (message.externalChannelUri != null && message.hasOwnProperty("externalChannelUri")) + if (!$util.isString(message.externalChannelUri)) + return "externalChannelUri: string expected"; + if (message.intendedAudience != null && message.hasOwnProperty("intendedAudience")) + if (!$util.isString(message.intendedAudience)) + return "intendedAudience: string expected"; + if (message.accessGuidance != null && message.hasOwnProperty("accessGuidance")) + if (!$util.isString(message.accessGuidance)) + return "accessGuidance: string expected"; + if (message.labels != null && message.hasOwnProperty("labels")) { + if (!$util.isObject(message.labels)) + return "labels: object expected"; + var key = Object.keys(message.labels); + for (var i = 0; i < key.length; ++i) + if (!$util.isString(message.labels[key[i]])) + return "labels: string{k:string} expected"; + } + 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"; + } + return null; + }; + + /** + * Creates an ApiDeployment message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.apigeeregistry.v1.ApiDeployment + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.apigeeregistry.v1.ApiDeployment} ApiDeployment + */ + ApiDeployment.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.apigeeregistry.v1.ApiDeployment) + return object; + var message = new $root.google.cloud.apigeeregistry.v1.ApiDeployment(); + if (object.name != null) + message.name = String(object.name); + if (object.displayName != null) + message.displayName = String(object.displayName); + if (object.description != null) + message.description = String(object.description); + if (object.revisionId != null) + message.revisionId = String(object.revisionId); + if (object.createTime != null) { + if (typeof object.createTime !== "object") + throw TypeError(".google.cloud.apigeeregistry.v1.ApiDeployment.createTime: object expected"); + message.createTime = $root.google.protobuf.Timestamp.fromObject(object.createTime); + } + if (object.revisionCreateTime != null) { + if (typeof object.revisionCreateTime !== "object") + throw TypeError(".google.cloud.apigeeregistry.v1.ApiDeployment.revisionCreateTime: object expected"); + message.revisionCreateTime = $root.google.protobuf.Timestamp.fromObject(object.revisionCreateTime); + } + if (object.revisionUpdateTime != null) { + if (typeof object.revisionUpdateTime !== "object") + throw TypeError(".google.cloud.apigeeregistry.v1.ApiDeployment.revisionUpdateTime: object expected"); + message.revisionUpdateTime = $root.google.protobuf.Timestamp.fromObject(object.revisionUpdateTime); + } + if (object.apiSpecRevision != null) + message.apiSpecRevision = String(object.apiSpecRevision); + if (object.endpointUri != null) + message.endpointUri = String(object.endpointUri); + if (object.externalChannelUri != null) + message.externalChannelUri = String(object.externalChannelUri); + if (object.intendedAudience != null) + message.intendedAudience = String(object.intendedAudience); + if (object.accessGuidance != null) + message.accessGuidance = String(object.accessGuidance); + if (object.labels) { + if (typeof object.labels !== "object") + throw TypeError(".google.cloud.apigeeregistry.v1.ApiDeployment.labels: object expected"); + message.labels = {}; + for (var keys = Object.keys(object.labels), i = 0; i < keys.length; ++i) + message.labels[keys[i]] = String(object.labels[keys[i]]); + } + if (object.annotations) { + if (typeof object.annotations !== "object") + throw TypeError(".google.cloud.apigeeregistry.v1.ApiDeployment.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]]); + } + return message; + }; + + /** + * Creates a plain object from an ApiDeployment message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.apigeeregistry.v1.ApiDeployment + * @static + * @param {google.cloud.apigeeregistry.v1.ApiDeployment} message ApiDeployment + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ApiDeployment.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.objects || options.defaults) { + object.labels = {}; + object.annotations = {}; + } + if (options.defaults) { + object.name = ""; + object.displayName = ""; + object.description = ""; + object.revisionId = ""; + object.createTime = null; + object.revisionCreateTime = null; + object.revisionUpdateTime = null; + object.apiSpecRevision = ""; + object.endpointUri = ""; + object.externalChannelUri = ""; + object.intendedAudience = ""; + object.accessGuidance = ""; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.displayName != null && message.hasOwnProperty("displayName")) + object.displayName = message.displayName; + if (message.description != null && message.hasOwnProperty("description")) + object.description = message.description; + if (message.revisionId != null && message.hasOwnProperty("revisionId")) + object.revisionId = message.revisionId; + if (message.createTime != null && message.hasOwnProperty("createTime")) + object.createTime = $root.google.protobuf.Timestamp.toObject(message.createTime, options); + if (message.revisionCreateTime != null && message.hasOwnProperty("revisionCreateTime")) + object.revisionCreateTime = $root.google.protobuf.Timestamp.toObject(message.revisionCreateTime, options); + if (message.revisionUpdateTime != null && message.hasOwnProperty("revisionUpdateTime")) + object.revisionUpdateTime = $root.google.protobuf.Timestamp.toObject(message.revisionUpdateTime, options); + if (message.apiSpecRevision != null && message.hasOwnProperty("apiSpecRevision")) + object.apiSpecRevision = message.apiSpecRevision; + if (message.endpointUri != null && message.hasOwnProperty("endpointUri")) + object.endpointUri = message.endpointUri; + if (message.externalChannelUri != null && message.hasOwnProperty("externalChannelUri")) + object.externalChannelUri = message.externalChannelUri; + if (message.intendedAudience != null && message.hasOwnProperty("intendedAudience")) + object.intendedAudience = message.intendedAudience; + if (message.accessGuidance != null && message.hasOwnProperty("accessGuidance")) + object.accessGuidance = message.accessGuidance; + var keys2; + if (message.labels && (keys2 = Object.keys(message.labels)).length) { + object.labels = {}; + for (var j = 0; j < keys2.length; ++j) + object.labels[keys2[j]] = message.labels[keys2[j]]; + } + 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]]; + } + return object; + }; + + /** + * Converts this ApiDeployment to JSON. + * @function toJSON + * @memberof google.cloud.apigeeregistry.v1.ApiDeployment + * @instance + * @returns {Object.} JSON object + */ + ApiDeployment.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ApiDeployment + * @function getTypeUrl + * @memberof google.cloud.apigeeregistry.v1.ApiDeployment + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ApiDeployment.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.apigeeregistry.v1.ApiDeployment"; + }; + + return ApiDeployment; + })(); + + v1.Artifact = (function() { + + /** + * Properties of an Artifact. + * @memberof google.cloud.apigeeregistry.v1 + * @interface IArtifact + * @property {string|null} [name] Artifact name + * @property {google.protobuf.ITimestamp|null} [createTime] Artifact createTime + * @property {google.protobuf.ITimestamp|null} [updateTime] Artifact updateTime + * @property {string|null} [mimeType] Artifact mimeType + * @property {number|null} [sizeBytes] Artifact sizeBytes + * @property {string|null} [hash] Artifact hash + * @property {Uint8Array|null} [contents] Artifact contents + */ + + /** + * Constructs a new Artifact. + * @memberof google.cloud.apigeeregistry.v1 + * @classdesc Represents an Artifact. + * @implements IArtifact + * @constructor + * @param {google.cloud.apigeeregistry.v1.IArtifact=} [properties] Properties to set + */ + function Artifact(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Artifact name. + * @member {string} name + * @memberof google.cloud.apigeeregistry.v1.Artifact + * @instance + */ + Artifact.prototype.name = ""; + + /** + * Artifact createTime. + * @member {google.protobuf.ITimestamp|null|undefined} createTime + * @memberof google.cloud.apigeeregistry.v1.Artifact + * @instance + */ + Artifact.prototype.createTime = null; + + /** + * Artifact updateTime. + * @member {google.protobuf.ITimestamp|null|undefined} updateTime + * @memberof google.cloud.apigeeregistry.v1.Artifact + * @instance + */ + Artifact.prototype.updateTime = null; + + /** + * Artifact mimeType. + * @member {string} mimeType + * @memberof google.cloud.apigeeregistry.v1.Artifact + * @instance + */ + Artifact.prototype.mimeType = ""; + + /** + * Artifact sizeBytes. + * @member {number} sizeBytes + * @memberof google.cloud.apigeeregistry.v1.Artifact + * @instance + */ + Artifact.prototype.sizeBytes = 0; + + /** + * Artifact hash. + * @member {string} hash + * @memberof google.cloud.apigeeregistry.v1.Artifact + * @instance + */ + Artifact.prototype.hash = ""; + + /** + * Artifact contents. + * @member {Uint8Array} contents + * @memberof google.cloud.apigeeregistry.v1.Artifact + * @instance + */ + Artifact.prototype.contents = $util.newBuffer([]); + + /** + * Creates a new Artifact instance using the specified properties. + * @function create + * @memberof google.cloud.apigeeregistry.v1.Artifact + * @static + * @param {google.cloud.apigeeregistry.v1.IArtifact=} [properties] Properties to set + * @returns {google.cloud.apigeeregistry.v1.Artifact} Artifact instance + */ + Artifact.create = function create(properties) { + return new Artifact(properties); + }; + + /** + * Encodes the specified Artifact message. Does not implicitly {@link google.cloud.apigeeregistry.v1.Artifact.verify|verify} messages. + * @function encode + * @memberof google.cloud.apigeeregistry.v1.Artifact + * @static + * @param {google.cloud.apigeeregistry.v1.IArtifact} message Artifact message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Artifact.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.createTime != null && Object.hasOwnProperty.call(message, "createTime")) + $root.google.protobuf.Timestamp.encode(message.createTime, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + 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(); + if (message.mimeType != null && Object.hasOwnProperty.call(message, "mimeType")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.mimeType); + if (message.sizeBytes != null && Object.hasOwnProperty.call(message, "sizeBytes")) + writer.uint32(/* id 5, wireType 0 =*/40).int32(message.sizeBytes); + if (message.hash != null && Object.hasOwnProperty.call(message, "hash")) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.hash); + if (message.contents != null && Object.hasOwnProperty.call(message, "contents")) + writer.uint32(/* id 7, wireType 2 =*/58).bytes(message.contents); + return writer; + }; + + /** + * Encodes the specified Artifact message, length delimited. Does not implicitly {@link google.cloud.apigeeregistry.v1.Artifact.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.apigeeregistry.v1.Artifact + * @static + * @param {google.cloud.apigeeregistry.v1.IArtifact} message Artifact message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Artifact.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an Artifact message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.apigeeregistry.v1.Artifact + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.apigeeregistry.v1.Artifact} Artifact + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Artifact.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.apigeeregistry.v1.Artifact(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.createTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 3: { + message.updateTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 4: { + message.mimeType = reader.string(); + break; + } + case 5: { + message.sizeBytes = reader.int32(); + break; + } + case 6: { + message.hash = reader.string(); + break; + } + case 7: { + message.contents = reader.bytes(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an Artifact message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.apigeeregistry.v1.Artifact + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.apigeeregistry.v1.Artifact} Artifact + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Artifact.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an Artifact message. + * @function verify + * @memberof google.cloud.apigeeregistry.v1.Artifact + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Artifact.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.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.mimeType != null && message.hasOwnProperty("mimeType")) + if (!$util.isString(message.mimeType)) + return "mimeType: string expected"; + if (message.sizeBytes != null && message.hasOwnProperty("sizeBytes")) + if (!$util.isInteger(message.sizeBytes)) + return "sizeBytes: integer expected"; + if (message.hash != null && message.hasOwnProperty("hash")) + if (!$util.isString(message.hash)) + return "hash: string expected"; + if (message.contents != null && message.hasOwnProperty("contents")) + if (!(message.contents && typeof message.contents.length === "number" || $util.isString(message.contents))) + return "contents: buffer expected"; + return null; + }; + + /** + * Creates an Artifact message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.apigeeregistry.v1.Artifact + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.apigeeregistry.v1.Artifact} Artifact + */ + Artifact.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.apigeeregistry.v1.Artifact) + return object; + var message = new $root.google.cloud.apigeeregistry.v1.Artifact(); + if (object.name != null) + message.name = String(object.name); + if (object.createTime != null) { + if (typeof object.createTime !== "object") + throw TypeError(".google.cloud.apigeeregistry.v1.Artifact.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.apigeeregistry.v1.Artifact.updateTime: object expected"); + message.updateTime = $root.google.protobuf.Timestamp.fromObject(object.updateTime); + } + if (object.mimeType != null) + message.mimeType = String(object.mimeType); + if (object.sizeBytes != null) + message.sizeBytes = object.sizeBytes | 0; + if (object.hash != null) + message.hash = String(object.hash); + if (object.contents != null) + if (typeof object.contents === "string") + $util.base64.decode(object.contents, message.contents = $util.newBuffer($util.base64.length(object.contents)), 0); + else if (object.contents.length >= 0) + message.contents = object.contents; + return message; + }; + + /** + * Creates a plain object from an Artifact message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.apigeeregistry.v1.Artifact + * @static + * @param {google.cloud.apigeeregistry.v1.Artifact} message Artifact + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Artifact.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.createTime = null; + object.updateTime = null; + object.mimeType = ""; + object.sizeBytes = 0; + object.hash = ""; + if (options.bytes === String) + object.contents = ""; + else { + object.contents = []; + if (options.bytes !== Array) + object.contents = $util.newBuffer(object.contents); + } + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + 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.mimeType != null && message.hasOwnProperty("mimeType")) + object.mimeType = message.mimeType; + if (message.sizeBytes != null && message.hasOwnProperty("sizeBytes")) + object.sizeBytes = message.sizeBytes; + if (message.hash != null && message.hasOwnProperty("hash")) + object.hash = message.hash; + if (message.contents != null && message.hasOwnProperty("contents")) + object.contents = options.bytes === String ? $util.base64.encode(message.contents, 0, message.contents.length) : options.bytes === Array ? Array.prototype.slice.call(message.contents) : message.contents; + return object; + }; + + /** + * Converts this Artifact to JSON. + * @function toJSON + * @memberof google.cloud.apigeeregistry.v1.Artifact + * @instance + * @returns {Object.} JSON object + */ + Artifact.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Artifact + * @function getTypeUrl + * @memberof google.cloud.apigeeregistry.v1.Artifact + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Artifact.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.apigeeregistry.v1.Artifact"; + }; + + return Artifact; + })(); + + v1.Registry = (function() { + + /** + * Constructs a new Registry service. + * @memberof google.cloud.apigeeregistry.v1 + * @classdesc Represents a Registry + * @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 Registry(rpcImpl, requestDelimited, responseDelimited) { + $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); + } + + (Registry.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = Registry; + + /** + * Creates new Registry service using the specified rpc implementation. + * @function create + * @memberof google.cloud.apigeeregistry.v1.Registry + * @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 {Registry} RPC service. Useful where requests and/or responses are streamed. + */ + Registry.create = function create(rpcImpl, requestDelimited, responseDelimited) { + return new this(rpcImpl, requestDelimited, responseDelimited); + }; + + /** + * Callback as used by {@link google.cloud.apigeeregistry.v1.Registry|listApis}. + * @memberof google.cloud.apigeeregistry.v1.Registry + * @typedef ListApisCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.apigeeregistry.v1.ListApisResponse} [response] ListApisResponse + */ + + /** + * Calls ListApis. + * @function listApis + * @memberof google.cloud.apigeeregistry.v1.Registry + * @instance + * @param {google.cloud.apigeeregistry.v1.IListApisRequest} request ListApisRequest message or plain object + * @param {google.cloud.apigeeregistry.v1.Registry.ListApisCallback} callback Node-style callback called with the error, if any, and ListApisResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Registry.prototype.listApis = function listApis(request, callback) { + return this.rpcCall(listApis, $root.google.cloud.apigeeregistry.v1.ListApisRequest, $root.google.cloud.apigeeregistry.v1.ListApisResponse, request, callback); + }, "name", { value: "ListApis" }); + + /** + * Calls ListApis. + * @function listApis + * @memberof google.cloud.apigeeregistry.v1.Registry + * @instance + * @param {google.cloud.apigeeregistry.v1.IListApisRequest} request ListApisRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.apigeeregistry.v1.Registry|getApi}. + * @memberof google.cloud.apigeeregistry.v1.Registry + * @typedef GetApiCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.apigeeregistry.v1.Api} [response] Api + */ + + /** + * Calls GetApi. + * @function getApi + * @memberof google.cloud.apigeeregistry.v1.Registry + * @instance + * @param {google.cloud.apigeeregistry.v1.IGetApiRequest} request GetApiRequest message or plain object + * @param {google.cloud.apigeeregistry.v1.Registry.GetApiCallback} callback Node-style callback called with the error, if any, and Api + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Registry.prototype.getApi = function getApi(request, callback) { + return this.rpcCall(getApi, $root.google.cloud.apigeeregistry.v1.GetApiRequest, $root.google.cloud.apigeeregistry.v1.Api, request, callback); + }, "name", { value: "GetApi" }); + + /** + * Calls GetApi. + * @function getApi + * @memberof google.cloud.apigeeregistry.v1.Registry + * @instance + * @param {google.cloud.apigeeregistry.v1.IGetApiRequest} request GetApiRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.apigeeregistry.v1.Registry|createApi}. + * @memberof google.cloud.apigeeregistry.v1.Registry + * @typedef CreateApiCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.apigeeregistry.v1.Api} [response] Api + */ + + /** + * Calls CreateApi. + * @function createApi + * @memberof google.cloud.apigeeregistry.v1.Registry + * @instance + * @param {google.cloud.apigeeregistry.v1.ICreateApiRequest} request CreateApiRequest message or plain object + * @param {google.cloud.apigeeregistry.v1.Registry.CreateApiCallback} callback Node-style callback called with the error, if any, and Api + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Registry.prototype.createApi = function createApi(request, callback) { + return this.rpcCall(createApi, $root.google.cloud.apigeeregistry.v1.CreateApiRequest, $root.google.cloud.apigeeregistry.v1.Api, request, callback); + }, "name", { value: "CreateApi" }); + + /** + * Calls CreateApi. + * @function createApi + * @memberof google.cloud.apigeeregistry.v1.Registry + * @instance + * @param {google.cloud.apigeeregistry.v1.ICreateApiRequest} request CreateApiRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.apigeeregistry.v1.Registry|updateApi}. + * @memberof google.cloud.apigeeregistry.v1.Registry + * @typedef UpdateApiCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.apigeeregistry.v1.Api} [response] Api + */ + + /** + * Calls UpdateApi. + * @function updateApi + * @memberof google.cloud.apigeeregistry.v1.Registry + * @instance + * @param {google.cloud.apigeeregistry.v1.IUpdateApiRequest} request UpdateApiRequest message or plain object + * @param {google.cloud.apigeeregistry.v1.Registry.UpdateApiCallback} callback Node-style callback called with the error, if any, and Api + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Registry.prototype.updateApi = function updateApi(request, callback) { + return this.rpcCall(updateApi, $root.google.cloud.apigeeregistry.v1.UpdateApiRequest, $root.google.cloud.apigeeregistry.v1.Api, request, callback); + }, "name", { value: "UpdateApi" }); + + /** + * Calls UpdateApi. + * @function updateApi + * @memberof google.cloud.apigeeregistry.v1.Registry + * @instance + * @param {google.cloud.apigeeregistry.v1.IUpdateApiRequest} request UpdateApiRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.apigeeregistry.v1.Registry|deleteApi}. + * @memberof google.cloud.apigeeregistry.v1.Registry + * @typedef DeleteApiCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.protobuf.Empty} [response] Empty + */ + + /** + * Calls DeleteApi. + * @function deleteApi + * @memberof google.cloud.apigeeregistry.v1.Registry + * @instance + * @param {google.cloud.apigeeregistry.v1.IDeleteApiRequest} request DeleteApiRequest message or plain object + * @param {google.cloud.apigeeregistry.v1.Registry.DeleteApiCallback} callback Node-style callback called with the error, if any, and Empty + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Registry.prototype.deleteApi = function deleteApi(request, callback) { + return this.rpcCall(deleteApi, $root.google.cloud.apigeeregistry.v1.DeleteApiRequest, $root.google.protobuf.Empty, request, callback); + }, "name", { value: "DeleteApi" }); + + /** + * Calls DeleteApi. + * @function deleteApi + * @memberof google.cloud.apigeeregistry.v1.Registry + * @instance + * @param {google.cloud.apigeeregistry.v1.IDeleteApiRequest} request DeleteApiRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.apigeeregistry.v1.Registry|listApiVersions}. + * @memberof google.cloud.apigeeregistry.v1.Registry + * @typedef ListApiVersionsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.apigeeregistry.v1.ListApiVersionsResponse} [response] ListApiVersionsResponse + */ + + /** + * Calls ListApiVersions. + * @function listApiVersions + * @memberof google.cloud.apigeeregistry.v1.Registry + * @instance + * @param {google.cloud.apigeeregistry.v1.IListApiVersionsRequest} request ListApiVersionsRequest message or plain object + * @param {google.cloud.apigeeregistry.v1.Registry.ListApiVersionsCallback} callback Node-style callback called with the error, if any, and ListApiVersionsResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Registry.prototype.listApiVersions = function listApiVersions(request, callback) { + return this.rpcCall(listApiVersions, $root.google.cloud.apigeeregistry.v1.ListApiVersionsRequest, $root.google.cloud.apigeeregistry.v1.ListApiVersionsResponse, request, callback); + }, "name", { value: "ListApiVersions" }); + + /** + * Calls ListApiVersions. + * @function listApiVersions + * @memberof google.cloud.apigeeregistry.v1.Registry + * @instance + * @param {google.cloud.apigeeregistry.v1.IListApiVersionsRequest} request ListApiVersionsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.apigeeregistry.v1.Registry|getApiVersion}. + * @memberof google.cloud.apigeeregistry.v1.Registry + * @typedef GetApiVersionCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.apigeeregistry.v1.ApiVersion} [response] ApiVersion + */ + + /** + * Calls GetApiVersion. + * @function getApiVersion + * @memberof google.cloud.apigeeregistry.v1.Registry + * @instance + * @param {google.cloud.apigeeregistry.v1.IGetApiVersionRequest} request GetApiVersionRequest message or plain object + * @param {google.cloud.apigeeregistry.v1.Registry.GetApiVersionCallback} callback Node-style callback called with the error, if any, and ApiVersion + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Registry.prototype.getApiVersion = function getApiVersion(request, callback) { + return this.rpcCall(getApiVersion, $root.google.cloud.apigeeregistry.v1.GetApiVersionRequest, $root.google.cloud.apigeeregistry.v1.ApiVersion, request, callback); + }, "name", { value: "GetApiVersion" }); + + /** + * Calls GetApiVersion. + * @function getApiVersion + * @memberof google.cloud.apigeeregistry.v1.Registry + * @instance + * @param {google.cloud.apigeeregistry.v1.IGetApiVersionRequest} request GetApiVersionRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.apigeeregistry.v1.Registry|createApiVersion}. + * @memberof google.cloud.apigeeregistry.v1.Registry + * @typedef CreateApiVersionCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.apigeeregistry.v1.ApiVersion} [response] ApiVersion + */ + + /** + * Calls CreateApiVersion. + * @function createApiVersion + * @memberof google.cloud.apigeeregistry.v1.Registry + * @instance + * @param {google.cloud.apigeeregistry.v1.ICreateApiVersionRequest} request CreateApiVersionRequest message or plain object + * @param {google.cloud.apigeeregistry.v1.Registry.CreateApiVersionCallback} callback Node-style callback called with the error, if any, and ApiVersion + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Registry.prototype.createApiVersion = function createApiVersion(request, callback) { + return this.rpcCall(createApiVersion, $root.google.cloud.apigeeregistry.v1.CreateApiVersionRequest, $root.google.cloud.apigeeregistry.v1.ApiVersion, request, callback); + }, "name", { value: "CreateApiVersion" }); + + /** + * Calls CreateApiVersion. + * @function createApiVersion + * @memberof google.cloud.apigeeregistry.v1.Registry + * @instance + * @param {google.cloud.apigeeregistry.v1.ICreateApiVersionRequest} request CreateApiVersionRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.apigeeregistry.v1.Registry|updateApiVersion}. + * @memberof google.cloud.apigeeregistry.v1.Registry + * @typedef UpdateApiVersionCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.apigeeregistry.v1.ApiVersion} [response] ApiVersion + */ + + /** + * Calls UpdateApiVersion. + * @function updateApiVersion + * @memberof google.cloud.apigeeregistry.v1.Registry + * @instance + * @param {google.cloud.apigeeregistry.v1.IUpdateApiVersionRequest} request UpdateApiVersionRequest message or plain object + * @param {google.cloud.apigeeregistry.v1.Registry.UpdateApiVersionCallback} callback Node-style callback called with the error, if any, and ApiVersion + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Registry.prototype.updateApiVersion = function updateApiVersion(request, callback) { + return this.rpcCall(updateApiVersion, $root.google.cloud.apigeeregistry.v1.UpdateApiVersionRequest, $root.google.cloud.apigeeregistry.v1.ApiVersion, request, callback); + }, "name", { value: "UpdateApiVersion" }); + + /** + * Calls UpdateApiVersion. + * @function updateApiVersion + * @memberof google.cloud.apigeeregistry.v1.Registry + * @instance + * @param {google.cloud.apigeeregistry.v1.IUpdateApiVersionRequest} request UpdateApiVersionRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.apigeeregistry.v1.Registry|deleteApiVersion}. + * @memberof google.cloud.apigeeregistry.v1.Registry + * @typedef DeleteApiVersionCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.protobuf.Empty} [response] Empty + */ + + /** + * Calls DeleteApiVersion. + * @function deleteApiVersion + * @memberof google.cloud.apigeeregistry.v1.Registry + * @instance + * @param {google.cloud.apigeeregistry.v1.IDeleteApiVersionRequest} request DeleteApiVersionRequest message or plain object + * @param {google.cloud.apigeeregistry.v1.Registry.DeleteApiVersionCallback} callback Node-style callback called with the error, if any, and Empty + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Registry.prototype.deleteApiVersion = function deleteApiVersion(request, callback) { + return this.rpcCall(deleteApiVersion, $root.google.cloud.apigeeregistry.v1.DeleteApiVersionRequest, $root.google.protobuf.Empty, request, callback); + }, "name", { value: "DeleteApiVersion" }); + + /** + * Calls DeleteApiVersion. + * @function deleteApiVersion + * @memberof google.cloud.apigeeregistry.v1.Registry + * @instance + * @param {google.cloud.apigeeregistry.v1.IDeleteApiVersionRequest} request DeleteApiVersionRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.apigeeregistry.v1.Registry|listApiSpecs}. + * @memberof google.cloud.apigeeregistry.v1.Registry + * @typedef ListApiSpecsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.apigeeregistry.v1.ListApiSpecsResponse} [response] ListApiSpecsResponse + */ + + /** + * Calls ListApiSpecs. + * @function listApiSpecs + * @memberof google.cloud.apigeeregistry.v1.Registry + * @instance + * @param {google.cloud.apigeeregistry.v1.IListApiSpecsRequest} request ListApiSpecsRequest message or plain object + * @param {google.cloud.apigeeregistry.v1.Registry.ListApiSpecsCallback} callback Node-style callback called with the error, if any, and ListApiSpecsResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Registry.prototype.listApiSpecs = function listApiSpecs(request, callback) { + return this.rpcCall(listApiSpecs, $root.google.cloud.apigeeregistry.v1.ListApiSpecsRequest, $root.google.cloud.apigeeregistry.v1.ListApiSpecsResponse, request, callback); + }, "name", { value: "ListApiSpecs" }); + + /** + * Calls ListApiSpecs. + * @function listApiSpecs + * @memberof google.cloud.apigeeregistry.v1.Registry + * @instance + * @param {google.cloud.apigeeregistry.v1.IListApiSpecsRequest} request ListApiSpecsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.apigeeregistry.v1.Registry|getApiSpec}. + * @memberof google.cloud.apigeeregistry.v1.Registry + * @typedef GetApiSpecCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.apigeeregistry.v1.ApiSpec} [response] ApiSpec + */ + + /** + * Calls GetApiSpec. + * @function getApiSpec + * @memberof google.cloud.apigeeregistry.v1.Registry + * @instance + * @param {google.cloud.apigeeregistry.v1.IGetApiSpecRequest} request GetApiSpecRequest message or plain object + * @param {google.cloud.apigeeregistry.v1.Registry.GetApiSpecCallback} callback Node-style callback called with the error, if any, and ApiSpec + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Registry.prototype.getApiSpec = function getApiSpec(request, callback) { + return this.rpcCall(getApiSpec, $root.google.cloud.apigeeregistry.v1.GetApiSpecRequest, $root.google.cloud.apigeeregistry.v1.ApiSpec, request, callback); + }, "name", { value: "GetApiSpec" }); + + /** + * Calls GetApiSpec. + * @function getApiSpec + * @memberof google.cloud.apigeeregistry.v1.Registry + * @instance + * @param {google.cloud.apigeeregistry.v1.IGetApiSpecRequest} request GetApiSpecRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.apigeeregistry.v1.Registry|getApiSpecContents}. + * @memberof google.cloud.apigeeregistry.v1.Registry + * @typedef GetApiSpecContentsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.api.HttpBody} [response] HttpBody + */ + + /** + * Calls GetApiSpecContents. + * @function getApiSpecContents + * @memberof google.cloud.apigeeregistry.v1.Registry + * @instance + * @param {google.cloud.apigeeregistry.v1.IGetApiSpecContentsRequest} request GetApiSpecContentsRequest message or plain object + * @param {google.cloud.apigeeregistry.v1.Registry.GetApiSpecContentsCallback} callback Node-style callback called with the error, if any, and HttpBody + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Registry.prototype.getApiSpecContents = function getApiSpecContents(request, callback) { + return this.rpcCall(getApiSpecContents, $root.google.cloud.apigeeregistry.v1.GetApiSpecContentsRequest, $root.google.api.HttpBody, request, callback); + }, "name", { value: "GetApiSpecContents" }); + + /** + * Calls GetApiSpecContents. + * @function getApiSpecContents + * @memberof google.cloud.apigeeregistry.v1.Registry + * @instance + * @param {google.cloud.apigeeregistry.v1.IGetApiSpecContentsRequest} request GetApiSpecContentsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.apigeeregistry.v1.Registry|createApiSpec}. + * @memberof google.cloud.apigeeregistry.v1.Registry + * @typedef CreateApiSpecCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.apigeeregistry.v1.ApiSpec} [response] ApiSpec + */ + + /** + * Calls CreateApiSpec. + * @function createApiSpec + * @memberof google.cloud.apigeeregistry.v1.Registry + * @instance + * @param {google.cloud.apigeeregistry.v1.ICreateApiSpecRequest} request CreateApiSpecRequest message or plain object + * @param {google.cloud.apigeeregistry.v1.Registry.CreateApiSpecCallback} callback Node-style callback called with the error, if any, and ApiSpec + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Registry.prototype.createApiSpec = function createApiSpec(request, callback) { + return this.rpcCall(createApiSpec, $root.google.cloud.apigeeregistry.v1.CreateApiSpecRequest, $root.google.cloud.apigeeregistry.v1.ApiSpec, request, callback); + }, "name", { value: "CreateApiSpec" }); + + /** + * Calls CreateApiSpec. + * @function createApiSpec + * @memberof google.cloud.apigeeregistry.v1.Registry + * @instance + * @param {google.cloud.apigeeregistry.v1.ICreateApiSpecRequest} request CreateApiSpecRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.apigeeregistry.v1.Registry|updateApiSpec}. + * @memberof google.cloud.apigeeregistry.v1.Registry + * @typedef UpdateApiSpecCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.apigeeregistry.v1.ApiSpec} [response] ApiSpec + */ + + /** + * Calls UpdateApiSpec. + * @function updateApiSpec + * @memberof google.cloud.apigeeregistry.v1.Registry + * @instance + * @param {google.cloud.apigeeregistry.v1.IUpdateApiSpecRequest} request UpdateApiSpecRequest message or plain object + * @param {google.cloud.apigeeregistry.v1.Registry.UpdateApiSpecCallback} callback Node-style callback called with the error, if any, and ApiSpec + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Registry.prototype.updateApiSpec = function updateApiSpec(request, callback) { + return this.rpcCall(updateApiSpec, $root.google.cloud.apigeeregistry.v1.UpdateApiSpecRequest, $root.google.cloud.apigeeregistry.v1.ApiSpec, request, callback); + }, "name", { value: "UpdateApiSpec" }); + + /** + * Calls UpdateApiSpec. + * @function updateApiSpec + * @memberof google.cloud.apigeeregistry.v1.Registry + * @instance + * @param {google.cloud.apigeeregistry.v1.IUpdateApiSpecRequest} request UpdateApiSpecRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.apigeeregistry.v1.Registry|deleteApiSpec}. + * @memberof google.cloud.apigeeregistry.v1.Registry + * @typedef DeleteApiSpecCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.protobuf.Empty} [response] Empty + */ + + /** + * Calls DeleteApiSpec. + * @function deleteApiSpec + * @memberof google.cloud.apigeeregistry.v1.Registry + * @instance + * @param {google.cloud.apigeeregistry.v1.IDeleteApiSpecRequest} request DeleteApiSpecRequest message or plain object + * @param {google.cloud.apigeeregistry.v1.Registry.DeleteApiSpecCallback} callback Node-style callback called with the error, if any, and Empty + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Registry.prototype.deleteApiSpec = function deleteApiSpec(request, callback) { + return this.rpcCall(deleteApiSpec, $root.google.cloud.apigeeregistry.v1.DeleteApiSpecRequest, $root.google.protobuf.Empty, request, callback); + }, "name", { value: "DeleteApiSpec" }); + + /** + * Calls DeleteApiSpec. + * @function deleteApiSpec + * @memberof google.cloud.apigeeregistry.v1.Registry + * @instance + * @param {google.cloud.apigeeregistry.v1.IDeleteApiSpecRequest} request DeleteApiSpecRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.apigeeregistry.v1.Registry|tagApiSpecRevision}. + * @memberof google.cloud.apigeeregistry.v1.Registry + * @typedef TagApiSpecRevisionCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.apigeeregistry.v1.ApiSpec} [response] ApiSpec + */ + + /** + * Calls TagApiSpecRevision. + * @function tagApiSpecRevision + * @memberof google.cloud.apigeeregistry.v1.Registry + * @instance + * @param {google.cloud.apigeeregistry.v1.ITagApiSpecRevisionRequest} request TagApiSpecRevisionRequest message or plain object + * @param {google.cloud.apigeeregistry.v1.Registry.TagApiSpecRevisionCallback} callback Node-style callback called with the error, if any, and ApiSpec + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Registry.prototype.tagApiSpecRevision = function tagApiSpecRevision(request, callback) { + return this.rpcCall(tagApiSpecRevision, $root.google.cloud.apigeeregistry.v1.TagApiSpecRevisionRequest, $root.google.cloud.apigeeregistry.v1.ApiSpec, request, callback); + }, "name", { value: "TagApiSpecRevision" }); + + /** + * Calls TagApiSpecRevision. + * @function tagApiSpecRevision + * @memberof google.cloud.apigeeregistry.v1.Registry + * @instance + * @param {google.cloud.apigeeregistry.v1.ITagApiSpecRevisionRequest} request TagApiSpecRevisionRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.apigeeregistry.v1.Registry|listApiSpecRevisions}. + * @memberof google.cloud.apigeeregistry.v1.Registry + * @typedef ListApiSpecRevisionsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.apigeeregistry.v1.ListApiSpecRevisionsResponse} [response] ListApiSpecRevisionsResponse + */ + + /** + * Calls ListApiSpecRevisions. + * @function listApiSpecRevisions + * @memberof google.cloud.apigeeregistry.v1.Registry + * @instance + * @param {google.cloud.apigeeregistry.v1.IListApiSpecRevisionsRequest} request ListApiSpecRevisionsRequest message or plain object + * @param {google.cloud.apigeeregistry.v1.Registry.ListApiSpecRevisionsCallback} callback Node-style callback called with the error, if any, and ListApiSpecRevisionsResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Registry.prototype.listApiSpecRevisions = function listApiSpecRevisions(request, callback) { + return this.rpcCall(listApiSpecRevisions, $root.google.cloud.apigeeregistry.v1.ListApiSpecRevisionsRequest, $root.google.cloud.apigeeregistry.v1.ListApiSpecRevisionsResponse, request, callback); + }, "name", { value: "ListApiSpecRevisions" }); + + /** + * Calls ListApiSpecRevisions. + * @function listApiSpecRevisions + * @memberof google.cloud.apigeeregistry.v1.Registry + * @instance + * @param {google.cloud.apigeeregistry.v1.IListApiSpecRevisionsRequest} request ListApiSpecRevisionsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.apigeeregistry.v1.Registry|rollbackApiSpec}. + * @memberof google.cloud.apigeeregistry.v1.Registry + * @typedef RollbackApiSpecCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.apigeeregistry.v1.ApiSpec} [response] ApiSpec + */ + + /** + * Calls RollbackApiSpec. + * @function rollbackApiSpec + * @memberof google.cloud.apigeeregistry.v1.Registry + * @instance + * @param {google.cloud.apigeeregistry.v1.IRollbackApiSpecRequest} request RollbackApiSpecRequest message or plain object + * @param {google.cloud.apigeeregistry.v1.Registry.RollbackApiSpecCallback} callback Node-style callback called with the error, if any, and ApiSpec + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Registry.prototype.rollbackApiSpec = function rollbackApiSpec(request, callback) { + return this.rpcCall(rollbackApiSpec, $root.google.cloud.apigeeregistry.v1.RollbackApiSpecRequest, $root.google.cloud.apigeeregistry.v1.ApiSpec, request, callback); + }, "name", { value: "RollbackApiSpec" }); + + /** + * Calls RollbackApiSpec. + * @function rollbackApiSpec + * @memberof google.cloud.apigeeregistry.v1.Registry + * @instance + * @param {google.cloud.apigeeregistry.v1.IRollbackApiSpecRequest} request RollbackApiSpecRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.apigeeregistry.v1.Registry|deleteApiSpecRevision}. + * @memberof google.cloud.apigeeregistry.v1.Registry + * @typedef DeleteApiSpecRevisionCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.apigeeregistry.v1.ApiSpec} [response] ApiSpec + */ + + /** + * Calls DeleteApiSpecRevision. + * @function deleteApiSpecRevision + * @memberof google.cloud.apigeeregistry.v1.Registry + * @instance + * @param {google.cloud.apigeeregistry.v1.IDeleteApiSpecRevisionRequest} request DeleteApiSpecRevisionRequest message or plain object + * @param {google.cloud.apigeeregistry.v1.Registry.DeleteApiSpecRevisionCallback} callback Node-style callback called with the error, if any, and ApiSpec + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Registry.prototype.deleteApiSpecRevision = function deleteApiSpecRevision(request, callback) { + return this.rpcCall(deleteApiSpecRevision, $root.google.cloud.apigeeregistry.v1.DeleteApiSpecRevisionRequest, $root.google.cloud.apigeeregistry.v1.ApiSpec, request, callback); + }, "name", { value: "DeleteApiSpecRevision" }); + + /** + * Calls DeleteApiSpecRevision. + * @function deleteApiSpecRevision + * @memberof google.cloud.apigeeregistry.v1.Registry + * @instance + * @param {google.cloud.apigeeregistry.v1.IDeleteApiSpecRevisionRequest} request DeleteApiSpecRevisionRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.apigeeregistry.v1.Registry|listApiDeployments}. + * @memberof google.cloud.apigeeregistry.v1.Registry + * @typedef ListApiDeploymentsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.apigeeregistry.v1.ListApiDeploymentsResponse} [response] ListApiDeploymentsResponse + */ + + /** + * Calls ListApiDeployments. + * @function listApiDeployments + * @memberof google.cloud.apigeeregistry.v1.Registry + * @instance + * @param {google.cloud.apigeeregistry.v1.IListApiDeploymentsRequest} request ListApiDeploymentsRequest message or plain object + * @param {google.cloud.apigeeregistry.v1.Registry.ListApiDeploymentsCallback} callback Node-style callback called with the error, if any, and ListApiDeploymentsResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Registry.prototype.listApiDeployments = function listApiDeployments(request, callback) { + return this.rpcCall(listApiDeployments, $root.google.cloud.apigeeregistry.v1.ListApiDeploymentsRequest, $root.google.cloud.apigeeregistry.v1.ListApiDeploymentsResponse, request, callback); + }, "name", { value: "ListApiDeployments" }); + + /** + * Calls ListApiDeployments. + * @function listApiDeployments + * @memberof google.cloud.apigeeregistry.v1.Registry + * @instance + * @param {google.cloud.apigeeregistry.v1.IListApiDeploymentsRequest} request ListApiDeploymentsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.apigeeregistry.v1.Registry|getApiDeployment}. + * @memberof google.cloud.apigeeregistry.v1.Registry + * @typedef GetApiDeploymentCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.apigeeregistry.v1.ApiDeployment} [response] ApiDeployment + */ + + /** + * Calls GetApiDeployment. + * @function getApiDeployment + * @memberof google.cloud.apigeeregistry.v1.Registry + * @instance + * @param {google.cloud.apigeeregistry.v1.IGetApiDeploymentRequest} request GetApiDeploymentRequest message or plain object + * @param {google.cloud.apigeeregistry.v1.Registry.GetApiDeploymentCallback} callback Node-style callback called with the error, if any, and ApiDeployment + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Registry.prototype.getApiDeployment = function getApiDeployment(request, callback) { + return this.rpcCall(getApiDeployment, $root.google.cloud.apigeeregistry.v1.GetApiDeploymentRequest, $root.google.cloud.apigeeregistry.v1.ApiDeployment, request, callback); + }, "name", { value: "GetApiDeployment" }); + + /** + * Calls GetApiDeployment. + * @function getApiDeployment + * @memberof google.cloud.apigeeregistry.v1.Registry + * @instance + * @param {google.cloud.apigeeregistry.v1.IGetApiDeploymentRequest} request GetApiDeploymentRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.apigeeregistry.v1.Registry|createApiDeployment}. + * @memberof google.cloud.apigeeregistry.v1.Registry + * @typedef CreateApiDeploymentCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.apigeeregistry.v1.ApiDeployment} [response] ApiDeployment + */ + + /** + * Calls CreateApiDeployment. + * @function createApiDeployment + * @memberof google.cloud.apigeeregistry.v1.Registry + * @instance + * @param {google.cloud.apigeeregistry.v1.ICreateApiDeploymentRequest} request CreateApiDeploymentRequest message or plain object + * @param {google.cloud.apigeeregistry.v1.Registry.CreateApiDeploymentCallback} callback Node-style callback called with the error, if any, and ApiDeployment + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Registry.prototype.createApiDeployment = function createApiDeployment(request, callback) { + return this.rpcCall(createApiDeployment, $root.google.cloud.apigeeregistry.v1.CreateApiDeploymentRequest, $root.google.cloud.apigeeregistry.v1.ApiDeployment, request, callback); + }, "name", { value: "CreateApiDeployment" }); + + /** + * Calls CreateApiDeployment. + * @function createApiDeployment + * @memberof google.cloud.apigeeregistry.v1.Registry + * @instance + * @param {google.cloud.apigeeregistry.v1.ICreateApiDeploymentRequest} request CreateApiDeploymentRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.apigeeregistry.v1.Registry|updateApiDeployment}. + * @memberof google.cloud.apigeeregistry.v1.Registry + * @typedef UpdateApiDeploymentCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.apigeeregistry.v1.ApiDeployment} [response] ApiDeployment + */ + + /** + * Calls UpdateApiDeployment. + * @function updateApiDeployment + * @memberof google.cloud.apigeeregistry.v1.Registry + * @instance + * @param {google.cloud.apigeeregistry.v1.IUpdateApiDeploymentRequest} request UpdateApiDeploymentRequest message or plain object + * @param {google.cloud.apigeeregistry.v1.Registry.UpdateApiDeploymentCallback} callback Node-style callback called with the error, if any, and ApiDeployment + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Registry.prototype.updateApiDeployment = function updateApiDeployment(request, callback) { + return this.rpcCall(updateApiDeployment, $root.google.cloud.apigeeregistry.v1.UpdateApiDeploymentRequest, $root.google.cloud.apigeeregistry.v1.ApiDeployment, request, callback); + }, "name", { value: "UpdateApiDeployment" }); + + /** + * Calls UpdateApiDeployment. + * @function updateApiDeployment + * @memberof google.cloud.apigeeregistry.v1.Registry + * @instance + * @param {google.cloud.apigeeregistry.v1.IUpdateApiDeploymentRequest} request UpdateApiDeploymentRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.apigeeregistry.v1.Registry|deleteApiDeployment}. + * @memberof google.cloud.apigeeregistry.v1.Registry + * @typedef DeleteApiDeploymentCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.protobuf.Empty} [response] Empty + */ + + /** + * Calls DeleteApiDeployment. + * @function deleteApiDeployment + * @memberof google.cloud.apigeeregistry.v1.Registry + * @instance + * @param {google.cloud.apigeeregistry.v1.IDeleteApiDeploymentRequest} request DeleteApiDeploymentRequest message or plain object + * @param {google.cloud.apigeeregistry.v1.Registry.DeleteApiDeploymentCallback} callback Node-style callback called with the error, if any, and Empty + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Registry.prototype.deleteApiDeployment = function deleteApiDeployment(request, callback) { + return this.rpcCall(deleteApiDeployment, $root.google.cloud.apigeeregistry.v1.DeleteApiDeploymentRequest, $root.google.protobuf.Empty, request, callback); + }, "name", { value: "DeleteApiDeployment" }); + + /** + * Calls DeleteApiDeployment. + * @function deleteApiDeployment + * @memberof google.cloud.apigeeregistry.v1.Registry + * @instance + * @param {google.cloud.apigeeregistry.v1.IDeleteApiDeploymentRequest} request DeleteApiDeploymentRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.apigeeregistry.v1.Registry|tagApiDeploymentRevision}. + * @memberof google.cloud.apigeeregistry.v1.Registry + * @typedef TagApiDeploymentRevisionCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.apigeeregistry.v1.ApiDeployment} [response] ApiDeployment + */ + + /** + * Calls TagApiDeploymentRevision. + * @function tagApiDeploymentRevision + * @memberof google.cloud.apigeeregistry.v1.Registry + * @instance + * @param {google.cloud.apigeeregistry.v1.ITagApiDeploymentRevisionRequest} request TagApiDeploymentRevisionRequest message or plain object + * @param {google.cloud.apigeeregistry.v1.Registry.TagApiDeploymentRevisionCallback} callback Node-style callback called with the error, if any, and ApiDeployment + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Registry.prototype.tagApiDeploymentRevision = function tagApiDeploymentRevision(request, callback) { + return this.rpcCall(tagApiDeploymentRevision, $root.google.cloud.apigeeregistry.v1.TagApiDeploymentRevisionRequest, $root.google.cloud.apigeeregistry.v1.ApiDeployment, request, callback); + }, "name", { value: "TagApiDeploymentRevision" }); + + /** + * Calls TagApiDeploymentRevision. + * @function tagApiDeploymentRevision + * @memberof google.cloud.apigeeregistry.v1.Registry + * @instance + * @param {google.cloud.apigeeregistry.v1.ITagApiDeploymentRevisionRequest} request TagApiDeploymentRevisionRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.apigeeregistry.v1.Registry|listApiDeploymentRevisions}. + * @memberof google.cloud.apigeeregistry.v1.Registry + * @typedef ListApiDeploymentRevisionsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.apigeeregistry.v1.ListApiDeploymentRevisionsResponse} [response] ListApiDeploymentRevisionsResponse + */ + + /** + * Calls ListApiDeploymentRevisions. + * @function listApiDeploymentRevisions + * @memberof google.cloud.apigeeregistry.v1.Registry + * @instance + * @param {google.cloud.apigeeregistry.v1.IListApiDeploymentRevisionsRequest} request ListApiDeploymentRevisionsRequest message or plain object + * @param {google.cloud.apigeeregistry.v1.Registry.ListApiDeploymentRevisionsCallback} callback Node-style callback called with the error, if any, and ListApiDeploymentRevisionsResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Registry.prototype.listApiDeploymentRevisions = function listApiDeploymentRevisions(request, callback) { + return this.rpcCall(listApiDeploymentRevisions, $root.google.cloud.apigeeregistry.v1.ListApiDeploymentRevisionsRequest, $root.google.cloud.apigeeregistry.v1.ListApiDeploymentRevisionsResponse, request, callback); + }, "name", { value: "ListApiDeploymentRevisions" }); + + /** + * Calls ListApiDeploymentRevisions. + * @function listApiDeploymentRevisions + * @memberof google.cloud.apigeeregistry.v1.Registry + * @instance + * @param {google.cloud.apigeeregistry.v1.IListApiDeploymentRevisionsRequest} request ListApiDeploymentRevisionsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.apigeeregistry.v1.Registry|rollbackApiDeployment}. + * @memberof google.cloud.apigeeregistry.v1.Registry + * @typedef RollbackApiDeploymentCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.apigeeregistry.v1.ApiDeployment} [response] ApiDeployment + */ + + /** + * Calls RollbackApiDeployment. + * @function rollbackApiDeployment + * @memberof google.cloud.apigeeregistry.v1.Registry + * @instance + * @param {google.cloud.apigeeregistry.v1.IRollbackApiDeploymentRequest} request RollbackApiDeploymentRequest message or plain object + * @param {google.cloud.apigeeregistry.v1.Registry.RollbackApiDeploymentCallback} callback Node-style callback called with the error, if any, and ApiDeployment + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Registry.prototype.rollbackApiDeployment = function rollbackApiDeployment(request, callback) { + return this.rpcCall(rollbackApiDeployment, $root.google.cloud.apigeeregistry.v1.RollbackApiDeploymentRequest, $root.google.cloud.apigeeregistry.v1.ApiDeployment, request, callback); + }, "name", { value: "RollbackApiDeployment" }); + + /** + * Calls RollbackApiDeployment. + * @function rollbackApiDeployment + * @memberof google.cloud.apigeeregistry.v1.Registry + * @instance + * @param {google.cloud.apigeeregistry.v1.IRollbackApiDeploymentRequest} request RollbackApiDeploymentRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.apigeeregistry.v1.Registry|deleteApiDeploymentRevision}. + * @memberof google.cloud.apigeeregistry.v1.Registry + * @typedef DeleteApiDeploymentRevisionCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.apigeeregistry.v1.ApiDeployment} [response] ApiDeployment + */ + + /** + * Calls DeleteApiDeploymentRevision. + * @function deleteApiDeploymentRevision + * @memberof google.cloud.apigeeregistry.v1.Registry + * @instance + * @param {google.cloud.apigeeregistry.v1.IDeleteApiDeploymentRevisionRequest} request DeleteApiDeploymentRevisionRequest message or plain object + * @param {google.cloud.apigeeregistry.v1.Registry.DeleteApiDeploymentRevisionCallback} callback Node-style callback called with the error, if any, and ApiDeployment + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Registry.prototype.deleteApiDeploymentRevision = function deleteApiDeploymentRevision(request, callback) { + return this.rpcCall(deleteApiDeploymentRevision, $root.google.cloud.apigeeregistry.v1.DeleteApiDeploymentRevisionRequest, $root.google.cloud.apigeeregistry.v1.ApiDeployment, request, callback); + }, "name", { value: "DeleteApiDeploymentRevision" }); + + /** + * Calls DeleteApiDeploymentRevision. + * @function deleteApiDeploymentRevision + * @memberof google.cloud.apigeeregistry.v1.Registry + * @instance + * @param {google.cloud.apigeeregistry.v1.IDeleteApiDeploymentRevisionRequest} request DeleteApiDeploymentRevisionRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.apigeeregistry.v1.Registry|listArtifacts}. + * @memberof google.cloud.apigeeregistry.v1.Registry + * @typedef ListArtifactsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.apigeeregistry.v1.ListArtifactsResponse} [response] ListArtifactsResponse + */ + + /** + * Calls ListArtifacts. + * @function listArtifacts + * @memberof google.cloud.apigeeregistry.v1.Registry + * @instance + * @param {google.cloud.apigeeregistry.v1.IListArtifactsRequest} request ListArtifactsRequest message or plain object + * @param {google.cloud.apigeeregistry.v1.Registry.ListArtifactsCallback} callback Node-style callback called with the error, if any, and ListArtifactsResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Registry.prototype.listArtifacts = function listArtifacts(request, callback) { + return this.rpcCall(listArtifacts, $root.google.cloud.apigeeregistry.v1.ListArtifactsRequest, $root.google.cloud.apigeeregistry.v1.ListArtifactsResponse, request, callback); + }, "name", { value: "ListArtifacts" }); + + /** + * Calls ListArtifacts. + * @function listArtifacts + * @memberof google.cloud.apigeeregistry.v1.Registry + * @instance + * @param {google.cloud.apigeeregistry.v1.IListArtifactsRequest} request ListArtifactsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.apigeeregistry.v1.Registry|getArtifact}. + * @memberof google.cloud.apigeeregistry.v1.Registry + * @typedef GetArtifactCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.apigeeregistry.v1.Artifact} [response] Artifact + */ + + /** + * Calls GetArtifact. + * @function getArtifact + * @memberof google.cloud.apigeeregistry.v1.Registry + * @instance + * @param {google.cloud.apigeeregistry.v1.IGetArtifactRequest} request GetArtifactRequest message or plain object + * @param {google.cloud.apigeeregistry.v1.Registry.GetArtifactCallback} callback Node-style callback called with the error, if any, and Artifact + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Registry.prototype.getArtifact = function getArtifact(request, callback) { + return this.rpcCall(getArtifact, $root.google.cloud.apigeeregistry.v1.GetArtifactRequest, $root.google.cloud.apigeeregistry.v1.Artifact, request, callback); + }, "name", { value: "GetArtifact" }); + + /** + * Calls GetArtifact. + * @function getArtifact + * @memberof google.cloud.apigeeregistry.v1.Registry + * @instance + * @param {google.cloud.apigeeregistry.v1.IGetArtifactRequest} request GetArtifactRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.apigeeregistry.v1.Registry|getArtifactContents}. + * @memberof google.cloud.apigeeregistry.v1.Registry + * @typedef GetArtifactContentsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.api.HttpBody} [response] HttpBody + */ + + /** + * Calls GetArtifactContents. + * @function getArtifactContents + * @memberof google.cloud.apigeeregistry.v1.Registry + * @instance + * @param {google.cloud.apigeeregistry.v1.IGetArtifactContentsRequest} request GetArtifactContentsRequest message or plain object + * @param {google.cloud.apigeeregistry.v1.Registry.GetArtifactContentsCallback} callback Node-style callback called with the error, if any, and HttpBody + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Registry.prototype.getArtifactContents = function getArtifactContents(request, callback) { + return this.rpcCall(getArtifactContents, $root.google.cloud.apigeeregistry.v1.GetArtifactContentsRequest, $root.google.api.HttpBody, request, callback); + }, "name", { value: "GetArtifactContents" }); + + /** + * Calls GetArtifactContents. + * @function getArtifactContents + * @memberof google.cloud.apigeeregistry.v1.Registry + * @instance + * @param {google.cloud.apigeeregistry.v1.IGetArtifactContentsRequest} request GetArtifactContentsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.apigeeregistry.v1.Registry|createArtifact}. + * @memberof google.cloud.apigeeregistry.v1.Registry + * @typedef CreateArtifactCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.apigeeregistry.v1.Artifact} [response] Artifact + */ + + /** + * Calls CreateArtifact. + * @function createArtifact + * @memberof google.cloud.apigeeregistry.v1.Registry + * @instance + * @param {google.cloud.apigeeregistry.v1.ICreateArtifactRequest} request CreateArtifactRequest message or plain object + * @param {google.cloud.apigeeregistry.v1.Registry.CreateArtifactCallback} callback Node-style callback called with the error, if any, and Artifact + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Registry.prototype.createArtifact = function createArtifact(request, callback) { + return this.rpcCall(createArtifact, $root.google.cloud.apigeeregistry.v1.CreateArtifactRequest, $root.google.cloud.apigeeregistry.v1.Artifact, request, callback); + }, "name", { value: "CreateArtifact" }); + + /** + * Calls CreateArtifact. + * @function createArtifact + * @memberof google.cloud.apigeeregistry.v1.Registry + * @instance + * @param {google.cloud.apigeeregistry.v1.ICreateArtifactRequest} request CreateArtifactRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.apigeeregistry.v1.Registry|replaceArtifact}. + * @memberof google.cloud.apigeeregistry.v1.Registry + * @typedef ReplaceArtifactCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.apigeeregistry.v1.Artifact} [response] Artifact + */ + + /** + * Calls ReplaceArtifact. + * @function replaceArtifact + * @memberof google.cloud.apigeeregistry.v1.Registry + * @instance + * @param {google.cloud.apigeeregistry.v1.IReplaceArtifactRequest} request ReplaceArtifactRequest message or plain object + * @param {google.cloud.apigeeregistry.v1.Registry.ReplaceArtifactCallback} callback Node-style callback called with the error, if any, and Artifact + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Registry.prototype.replaceArtifact = function replaceArtifact(request, callback) { + return this.rpcCall(replaceArtifact, $root.google.cloud.apigeeregistry.v1.ReplaceArtifactRequest, $root.google.cloud.apigeeregistry.v1.Artifact, request, callback); + }, "name", { value: "ReplaceArtifact" }); + + /** + * Calls ReplaceArtifact. + * @function replaceArtifact + * @memberof google.cloud.apigeeregistry.v1.Registry + * @instance + * @param {google.cloud.apigeeregistry.v1.IReplaceArtifactRequest} request ReplaceArtifactRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.apigeeregistry.v1.Registry|deleteArtifact}. + * @memberof google.cloud.apigeeregistry.v1.Registry + * @typedef DeleteArtifactCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.protobuf.Empty} [response] Empty + */ + + /** + * Calls DeleteArtifact. + * @function deleteArtifact + * @memberof google.cloud.apigeeregistry.v1.Registry + * @instance + * @param {google.cloud.apigeeregistry.v1.IDeleteArtifactRequest} request DeleteArtifactRequest message or plain object + * @param {google.cloud.apigeeregistry.v1.Registry.DeleteArtifactCallback} callback Node-style callback called with the error, if any, and Empty + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Registry.prototype.deleteArtifact = function deleteArtifact(request, callback) { + return this.rpcCall(deleteArtifact, $root.google.cloud.apigeeregistry.v1.DeleteArtifactRequest, $root.google.protobuf.Empty, request, callback); + }, "name", { value: "DeleteArtifact" }); + + /** + * Calls DeleteArtifact. + * @function deleteArtifact + * @memberof google.cloud.apigeeregistry.v1.Registry + * @instance + * @param {google.cloud.apigeeregistry.v1.IDeleteArtifactRequest} request DeleteArtifactRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + return Registry; + })(); + + v1.ListApisRequest = (function() { + + /** + * Properties of a ListApisRequest. + * @memberof google.cloud.apigeeregistry.v1 + * @interface IListApisRequest + * @property {string|null} [parent] ListApisRequest parent + * @property {number|null} [pageSize] ListApisRequest pageSize + * @property {string|null} [pageToken] ListApisRequest pageToken + * @property {string|null} [filter] ListApisRequest filter + */ + + /** + * Constructs a new ListApisRequest. + * @memberof google.cloud.apigeeregistry.v1 + * @classdesc Represents a ListApisRequest. + * @implements IListApisRequest + * @constructor + * @param {google.cloud.apigeeregistry.v1.IListApisRequest=} [properties] Properties to set + */ + function ListApisRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListApisRequest parent. + * @member {string} parent + * @memberof google.cloud.apigeeregistry.v1.ListApisRequest + * @instance + */ + ListApisRequest.prototype.parent = ""; + + /** + * ListApisRequest pageSize. + * @member {number} pageSize + * @memberof google.cloud.apigeeregistry.v1.ListApisRequest + * @instance + */ + ListApisRequest.prototype.pageSize = 0; + + /** + * ListApisRequest pageToken. + * @member {string} pageToken + * @memberof google.cloud.apigeeregistry.v1.ListApisRequest + * @instance + */ + ListApisRequest.prototype.pageToken = ""; + + /** + * ListApisRequest filter. + * @member {string} filter + * @memberof google.cloud.apigeeregistry.v1.ListApisRequest + * @instance + */ + ListApisRequest.prototype.filter = ""; + + /** + * Creates a new ListApisRequest instance using the specified properties. + * @function create + * @memberof google.cloud.apigeeregistry.v1.ListApisRequest + * @static + * @param {google.cloud.apigeeregistry.v1.IListApisRequest=} [properties] Properties to set + * @returns {google.cloud.apigeeregistry.v1.ListApisRequest} ListApisRequest instance + */ + ListApisRequest.create = function create(properties) { + return new ListApisRequest(properties); + }; + + /** + * Encodes the specified ListApisRequest message. Does not implicitly {@link google.cloud.apigeeregistry.v1.ListApisRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.apigeeregistry.v1.ListApisRequest + * @static + * @param {google.cloud.apigeeregistry.v1.IListApisRequest} message ListApisRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListApisRequest.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.filter != null && Object.hasOwnProperty.call(message, "filter")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.filter); + return writer; + }; + + /** + * Encodes the specified ListApisRequest message, length delimited. Does not implicitly {@link google.cloud.apigeeregistry.v1.ListApisRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.apigeeregistry.v1.ListApisRequest + * @static + * @param {google.cloud.apigeeregistry.v1.IListApisRequest} message ListApisRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListApisRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListApisRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.apigeeregistry.v1.ListApisRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.apigeeregistry.v1.ListApisRequest} ListApisRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListApisRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.apigeeregistry.v1.ListApisRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + 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.filter = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListApisRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.apigeeregistry.v1.ListApisRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.apigeeregistry.v1.ListApisRequest} ListApisRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListApisRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListApisRequest message. + * @function verify + * @memberof google.cloud.apigeeregistry.v1.ListApisRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListApisRequest.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.filter != null && message.hasOwnProperty("filter")) + if (!$util.isString(message.filter)) + return "filter: string expected"; + return null; + }; + + /** + * Creates a ListApisRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.apigeeregistry.v1.ListApisRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.apigeeregistry.v1.ListApisRequest} ListApisRequest + */ + ListApisRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.apigeeregistry.v1.ListApisRequest) + return object; + var message = new $root.google.cloud.apigeeregistry.v1.ListApisRequest(); + 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.filter != null) + message.filter = String(object.filter); + return message; + }; + + /** + * Creates a plain object from a ListApisRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.apigeeregistry.v1.ListApisRequest + * @static + * @param {google.cloud.apigeeregistry.v1.ListApisRequest} message ListApisRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListApisRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.pageSize = 0; + object.pageToken = ""; + object.filter = ""; + } + 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.filter != null && message.hasOwnProperty("filter")) + object.filter = message.filter; + return object; + }; + + /** + * Converts this ListApisRequest to JSON. + * @function toJSON + * @memberof google.cloud.apigeeregistry.v1.ListApisRequest + * @instance + * @returns {Object.} JSON object + */ + ListApisRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListApisRequest + * @function getTypeUrl + * @memberof google.cloud.apigeeregistry.v1.ListApisRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListApisRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.apigeeregistry.v1.ListApisRequest"; + }; + + return ListApisRequest; + })(); + + v1.ListApisResponse = (function() { + + /** + * Properties of a ListApisResponse. + * @memberof google.cloud.apigeeregistry.v1 + * @interface IListApisResponse + * @property {Array.|null} [apis] ListApisResponse apis + * @property {string|null} [nextPageToken] ListApisResponse nextPageToken + */ + + /** + * Constructs a new ListApisResponse. + * @memberof google.cloud.apigeeregistry.v1 + * @classdesc Represents a ListApisResponse. + * @implements IListApisResponse + * @constructor + * @param {google.cloud.apigeeregistry.v1.IListApisResponse=} [properties] Properties to set + */ + function ListApisResponse(properties) { + this.apis = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListApisResponse apis. + * @member {Array.} apis + * @memberof google.cloud.apigeeregistry.v1.ListApisResponse + * @instance + */ + ListApisResponse.prototype.apis = $util.emptyArray; + + /** + * ListApisResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.cloud.apigeeregistry.v1.ListApisResponse + * @instance + */ + ListApisResponse.prototype.nextPageToken = ""; + + /** + * Creates a new ListApisResponse instance using the specified properties. + * @function create + * @memberof google.cloud.apigeeregistry.v1.ListApisResponse + * @static + * @param {google.cloud.apigeeregistry.v1.IListApisResponse=} [properties] Properties to set + * @returns {google.cloud.apigeeregistry.v1.ListApisResponse} ListApisResponse instance + */ + ListApisResponse.create = function create(properties) { + return new ListApisResponse(properties); + }; + + /** + * Encodes the specified ListApisResponse message. Does not implicitly {@link google.cloud.apigeeregistry.v1.ListApisResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.apigeeregistry.v1.ListApisResponse + * @static + * @param {google.cloud.apigeeregistry.v1.IListApisResponse} message ListApisResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListApisResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.apis != null && message.apis.length) + for (var i = 0; i < message.apis.length; ++i) + $root.google.cloud.apigeeregistry.v1.Api.encode(message.apis[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 ListApisResponse message, length delimited. Does not implicitly {@link google.cloud.apigeeregistry.v1.ListApisResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.apigeeregistry.v1.ListApisResponse + * @static + * @param {google.cloud.apigeeregistry.v1.IListApisResponse} message ListApisResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListApisResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListApisResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.apigeeregistry.v1.ListApisResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.apigeeregistry.v1.ListApisResponse} ListApisResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListApisResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.apigeeregistry.v1.ListApisResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.apis && message.apis.length)) + message.apis = []; + message.apis.push($root.google.cloud.apigeeregistry.v1.Api.decode(reader, reader.uint32())); + break; + } + case 2: { + message.nextPageToken = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListApisResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.apigeeregistry.v1.ListApisResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.apigeeregistry.v1.ListApisResponse} ListApisResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListApisResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListApisResponse message. + * @function verify + * @memberof google.cloud.apigeeregistry.v1.ListApisResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListApisResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.apis != null && message.hasOwnProperty("apis")) { + if (!Array.isArray(message.apis)) + return "apis: array expected"; + for (var i = 0; i < message.apis.length; ++i) { + var error = $root.google.cloud.apigeeregistry.v1.Api.verify(message.apis[i]); + if (error) + return "apis." + error; + } + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + return null; + }; + + /** + * Creates a ListApisResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.apigeeregistry.v1.ListApisResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.apigeeregistry.v1.ListApisResponse} ListApisResponse + */ + ListApisResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.apigeeregistry.v1.ListApisResponse) + return object; + var message = new $root.google.cloud.apigeeregistry.v1.ListApisResponse(); + if (object.apis) { + if (!Array.isArray(object.apis)) + throw TypeError(".google.cloud.apigeeregistry.v1.ListApisResponse.apis: array expected"); + message.apis = []; + for (var i = 0; i < object.apis.length; ++i) { + if (typeof object.apis[i] !== "object") + throw TypeError(".google.cloud.apigeeregistry.v1.ListApisResponse.apis: object expected"); + message.apis[i] = $root.google.cloud.apigeeregistry.v1.Api.fromObject(object.apis[i]); + } + } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + return message; + }; + + /** + * Creates a plain object from a ListApisResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.apigeeregistry.v1.ListApisResponse + * @static + * @param {google.cloud.apigeeregistry.v1.ListApisResponse} message ListApisResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListApisResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.apis = []; + if (options.defaults) + object.nextPageToken = ""; + if (message.apis && message.apis.length) { + object.apis = []; + for (var j = 0; j < message.apis.length; ++j) + object.apis[j] = $root.google.cloud.apigeeregistry.v1.Api.toObject(message.apis[j], options); + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + object.nextPageToken = message.nextPageToken; + return object; + }; + + /** + * Converts this ListApisResponse to JSON. + * @function toJSON + * @memberof google.cloud.apigeeregistry.v1.ListApisResponse + * @instance + * @returns {Object.} JSON object + */ + ListApisResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListApisResponse + * @function getTypeUrl + * @memberof google.cloud.apigeeregistry.v1.ListApisResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListApisResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.apigeeregistry.v1.ListApisResponse"; + }; + + return ListApisResponse; + })(); + + v1.GetApiRequest = (function() { + + /** + * Properties of a GetApiRequest. + * @memberof google.cloud.apigeeregistry.v1 + * @interface IGetApiRequest + * @property {string|null} [name] GetApiRequest name + */ + + /** + * Constructs a new GetApiRequest. + * @memberof google.cloud.apigeeregistry.v1 + * @classdesc Represents a GetApiRequest. + * @implements IGetApiRequest + * @constructor + * @param {google.cloud.apigeeregistry.v1.IGetApiRequest=} [properties] Properties to set + */ + function GetApiRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetApiRequest name. + * @member {string} name + * @memberof google.cloud.apigeeregistry.v1.GetApiRequest + * @instance + */ + GetApiRequest.prototype.name = ""; + + /** + * Creates a new GetApiRequest instance using the specified properties. + * @function create + * @memberof google.cloud.apigeeregistry.v1.GetApiRequest + * @static + * @param {google.cloud.apigeeregistry.v1.IGetApiRequest=} [properties] Properties to set + * @returns {google.cloud.apigeeregistry.v1.GetApiRequest} GetApiRequest instance + */ + GetApiRequest.create = function create(properties) { + return new GetApiRequest(properties); + }; + + /** + * Encodes the specified GetApiRequest message. Does not implicitly {@link google.cloud.apigeeregistry.v1.GetApiRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.apigeeregistry.v1.GetApiRequest + * @static + * @param {google.cloud.apigeeregistry.v1.IGetApiRequest} message GetApiRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetApiRequest.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 GetApiRequest message, length delimited. Does not implicitly {@link google.cloud.apigeeregistry.v1.GetApiRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.apigeeregistry.v1.GetApiRequest + * @static + * @param {google.cloud.apigeeregistry.v1.IGetApiRequest} message GetApiRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetApiRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetApiRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.apigeeregistry.v1.GetApiRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.apigeeregistry.v1.GetApiRequest} GetApiRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetApiRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.apigeeregistry.v1.GetApiRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetApiRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.apigeeregistry.v1.GetApiRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.apigeeregistry.v1.GetApiRequest} GetApiRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetApiRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetApiRequest message. + * @function verify + * @memberof google.cloud.apigeeregistry.v1.GetApiRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetApiRequest.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 GetApiRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.apigeeregistry.v1.GetApiRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.apigeeregistry.v1.GetApiRequest} GetApiRequest + */ + GetApiRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.apigeeregistry.v1.GetApiRequest) + return object; + var message = new $root.google.cloud.apigeeregistry.v1.GetApiRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a GetApiRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.apigeeregistry.v1.GetApiRequest + * @static + * @param {google.cloud.apigeeregistry.v1.GetApiRequest} message GetApiRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetApiRequest.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 GetApiRequest to JSON. + * @function toJSON + * @memberof google.cloud.apigeeregistry.v1.GetApiRequest + * @instance + * @returns {Object.} JSON object + */ + GetApiRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GetApiRequest + * @function getTypeUrl + * @memberof google.cloud.apigeeregistry.v1.GetApiRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GetApiRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.apigeeregistry.v1.GetApiRequest"; + }; + + return GetApiRequest; + })(); + + v1.CreateApiRequest = (function() { + + /** + * Properties of a CreateApiRequest. + * @memberof google.cloud.apigeeregistry.v1 + * @interface ICreateApiRequest + * @property {string|null} [parent] CreateApiRequest parent + * @property {google.cloud.apigeeregistry.v1.IApi|null} [api] CreateApiRequest api + * @property {string|null} [apiId] CreateApiRequest apiId + */ + + /** + * Constructs a new CreateApiRequest. + * @memberof google.cloud.apigeeregistry.v1 + * @classdesc Represents a CreateApiRequest. + * @implements ICreateApiRequest + * @constructor + * @param {google.cloud.apigeeregistry.v1.ICreateApiRequest=} [properties] Properties to set + */ + function CreateApiRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * CreateApiRequest parent. + * @member {string} parent + * @memberof google.cloud.apigeeregistry.v1.CreateApiRequest + * @instance + */ + CreateApiRequest.prototype.parent = ""; + + /** + * CreateApiRequest api. + * @member {google.cloud.apigeeregistry.v1.IApi|null|undefined} api + * @memberof google.cloud.apigeeregistry.v1.CreateApiRequest + * @instance + */ + CreateApiRequest.prototype.api = null; + + /** + * CreateApiRequest apiId. + * @member {string} apiId + * @memberof google.cloud.apigeeregistry.v1.CreateApiRequest + * @instance + */ + CreateApiRequest.prototype.apiId = ""; + + /** + * Creates a new CreateApiRequest instance using the specified properties. + * @function create + * @memberof google.cloud.apigeeregistry.v1.CreateApiRequest + * @static + * @param {google.cloud.apigeeregistry.v1.ICreateApiRequest=} [properties] Properties to set + * @returns {google.cloud.apigeeregistry.v1.CreateApiRequest} CreateApiRequest instance + */ + CreateApiRequest.create = function create(properties) { + return new CreateApiRequest(properties); + }; + + /** + * Encodes the specified CreateApiRequest message. Does not implicitly {@link google.cloud.apigeeregistry.v1.CreateApiRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.apigeeregistry.v1.CreateApiRequest + * @static + * @param {google.cloud.apigeeregistry.v1.ICreateApiRequest} message CreateApiRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateApiRequest.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.api != null && Object.hasOwnProperty.call(message, "api")) + $root.google.cloud.apigeeregistry.v1.Api.encode(message.api, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.apiId != null && Object.hasOwnProperty.call(message, "apiId")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.apiId); + return writer; + }; + + /** + * Encodes the specified CreateApiRequest message, length delimited. Does not implicitly {@link google.cloud.apigeeregistry.v1.CreateApiRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.apigeeregistry.v1.CreateApiRequest + * @static + * @param {google.cloud.apigeeregistry.v1.ICreateApiRequest} message CreateApiRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateApiRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CreateApiRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.apigeeregistry.v1.CreateApiRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.apigeeregistry.v1.CreateApiRequest} CreateApiRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateApiRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.apigeeregistry.v1.CreateApiRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.api = $root.google.cloud.apigeeregistry.v1.Api.decode(reader, reader.uint32()); + break; + } + case 3: { + message.apiId = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CreateApiRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.apigeeregistry.v1.CreateApiRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.apigeeregistry.v1.CreateApiRequest} CreateApiRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateApiRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CreateApiRequest message. + * @function verify + * @memberof google.cloud.apigeeregistry.v1.CreateApiRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CreateApiRequest.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.api != null && message.hasOwnProperty("api")) { + var error = $root.google.cloud.apigeeregistry.v1.Api.verify(message.api); + if (error) + return "api." + error; + } + if (message.apiId != null && message.hasOwnProperty("apiId")) + if (!$util.isString(message.apiId)) + return "apiId: string expected"; + return null; + }; + + /** + * Creates a CreateApiRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.apigeeregistry.v1.CreateApiRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.apigeeregistry.v1.CreateApiRequest} CreateApiRequest + */ + CreateApiRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.apigeeregistry.v1.CreateApiRequest) + return object; + var message = new $root.google.cloud.apigeeregistry.v1.CreateApiRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.api != null) { + if (typeof object.api !== "object") + throw TypeError(".google.cloud.apigeeregistry.v1.CreateApiRequest.api: object expected"); + message.api = $root.google.cloud.apigeeregistry.v1.Api.fromObject(object.api); + } + if (object.apiId != null) + message.apiId = String(object.apiId); + return message; + }; + + /** + * Creates a plain object from a CreateApiRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.apigeeregistry.v1.CreateApiRequest + * @static + * @param {google.cloud.apigeeregistry.v1.CreateApiRequest} message CreateApiRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CreateApiRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.api = null; + object.apiId = ""; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.api != null && message.hasOwnProperty("api")) + object.api = $root.google.cloud.apigeeregistry.v1.Api.toObject(message.api, options); + if (message.apiId != null && message.hasOwnProperty("apiId")) + object.apiId = message.apiId; + return object; + }; + + /** + * Converts this CreateApiRequest to JSON. + * @function toJSON + * @memberof google.cloud.apigeeregistry.v1.CreateApiRequest + * @instance + * @returns {Object.} JSON object + */ + CreateApiRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CreateApiRequest + * @function getTypeUrl + * @memberof google.cloud.apigeeregistry.v1.CreateApiRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CreateApiRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.apigeeregistry.v1.CreateApiRequest"; + }; + + return CreateApiRequest; + })(); + + v1.UpdateApiRequest = (function() { + + /** + * Properties of an UpdateApiRequest. + * @memberof google.cloud.apigeeregistry.v1 + * @interface IUpdateApiRequest + * @property {google.cloud.apigeeregistry.v1.IApi|null} [api] UpdateApiRequest api + * @property {google.protobuf.IFieldMask|null} [updateMask] UpdateApiRequest updateMask + * @property {boolean|null} [allowMissing] UpdateApiRequest allowMissing + */ + + /** + * Constructs a new UpdateApiRequest. + * @memberof google.cloud.apigeeregistry.v1 + * @classdesc Represents an UpdateApiRequest. + * @implements IUpdateApiRequest + * @constructor + * @param {google.cloud.apigeeregistry.v1.IUpdateApiRequest=} [properties] Properties to set + */ + function UpdateApiRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * UpdateApiRequest api. + * @member {google.cloud.apigeeregistry.v1.IApi|null|undefined} api + * @memberof google.cloud.apigeeregistry.v1.UpdateApiRequest + * @instance + */ + UpdateApiRequest.prototype.api = null; + + /** + * UpdateApiRequest updateMask. + * @member {google.protobuf.IFieldMask|null|undefined} updateMask + * @memberof google.cloud.apigeeregistry.v1.UpdateApiRequest + * @instance + */ + UpdateApiRequest.prototype.updateMask = null; + + /** + * UpdateApiRequest allowMissing. + * @member {boolean} allowMissing + * @memberof google.cloud.apigeeregistry.v1.UpdateApiRequest + * @instance + */ + UpdateApiRequest.prototype.allowMissing = false; + + /** + * Creates a new UpdateApiRequest instance using the specified properties. + * @function create + * @memberof google.cloud.apigeeregistry.v1.UpdateApiRequest + * @static + * @param {google.cloud.apigeeregistry.v1.IUpdateApiRequest=} [properties] Properties to set + * @returns {google.cloud.apigeeregistry.v1.UpdateApiRequest} UpdateApiRequest instance + */ + UpdateApiRequest.create = function create(properties) { + return new UpdateApiRequest(properties); + }; + + /** + * Encodes the specified UpdateApiRequest message. Does not implicitly {@link google.cloud.apigeeregistry.v1.UpdateApiRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.apigeeregistry.v1.UpdateApiRequest + * @static + * @param {google.cloud.apigeeregistry.v1.IUpdateApiRequest} message UpdateApiRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateApiRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.api != null && Object.hasOwnProperty.call(message, "api")) + $root.google.cloud.apigeeregistry.v1.Api.encode(message.api, 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.allowMissing != null && Object.hasOwnProperty.call(message, "allowMissing")) + writer.uint32(/* id 3, wireType 0 =*/24).bool(message.allowMissing); + return writer; + }; + + /** + * Encodes the specified UpdateApiRequest message, length delimited. Does not implicitly {@link google.cloud.apigeeregistry.v1.UpdateApiRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.apigeeregistry.v1.UpdateApiRequest + * @static + * @param {google.cloud.apigeeregistry.v1.IUpdateApiRequest} message UpdateApiRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateApiRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an UpdateApiRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.apigeeregistry.v1.UpdateApiRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.apigeeregistry.v1.UpdateApiRequest} UpdateApiRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateApiRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.apigeeregistry.v1.UpdateApiRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.api = $root.google.cloud.apigeeregistry.v1.Api.decode(reader, reader.uint32()); + break; + } + case 2: { + message.updateMask = $root.google.protobuf.FieldMask.decode(reader, reader.uint32()); + break; + } + case 3: { + message.allowMissing = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an UpdateApiRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.apigeeregistry.v1.UpdateApiRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.apigeeregistry.v1.UpdateApiRequest} UpdateApiRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateApiRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an UpdateApiRequest message. + * @function verify + * @memberof google.cloud.apigeeregistry.v1.UpdateApiRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + UpdateApiRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.api != null && message.hasOwnProperty("api")) { + var error = $root.google.cloud.apigeeregistry.v1.Api.verify(message.api); + if (error) + return "api." + error; + } + if (message.updateMask != null && message.hasOwnProperty("updateMask")) { + var error = $root.google.protobuf.FieldMask.verify(message.updateMask); + if (error) + return "updateMask." + error; + } + if (message.allowMissing != null && message.hasOwnProperty("allowMissing")) + if (typeof message.allowMissing !== "boolean") + return "allowMissing: boolean expected"; + return null; + }; + + /** + * Creates an UpdateApiRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.apigeeregistry.v1.UpdateApiRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.apigeeregistry.v1.UpdateApiRequest} UpdateApiRequest + */ + UpdateApiRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.apigeeregistry.v1.UpdateApiRequest) + return object; + var message = new $root.google.cloud.apigeeregistry.v1.UpdateApiRequest(); + if (object.api != null) { + if (typeof object.api !== "object") + throw TypeError(".google.cloud.apigeeregistry.v1.UpdateApiRequest.api: object expected"); + message.api = $root.google.cloud.apigeeregistry.v1.Api.fromObject(object.api); + } + if (object.updateMask != null) { + if (typeof object.updateMask !== "object") + throw TypeError(".google.cloud.apigeeregistry.v1.UpdateApiRequest.updateMask: object expected"); + message.updateMask = $root.google.protobuf.FieldMask.fromObject(object.updateMask); + } + if (object.allowMissing != null) + message.allowMissing = Boolean(object.allowMissing); + return message; + }; + + /** + * Creates a plain object from an UpdateApiRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.apigeeregistry.v1.UpdateApiRequest + * @static + * @param {google.cloud.apigeeregistry.v1.UpdateApiRequest} message UpdateApiRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + UpdateApiRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.api = null; + object.updateMask = null; + object.allowMissing = false; + } + if (message.api != null && message.hasOwnProperty("api")) + object.api = $root.google.cloud.apigeeregistry.v1.Api.toObject(message.api, options); + if (message.updateMask != null && message.hasOwnProperty("updateMask")) + object.updateMask = $root.google.protobuf.FieldMask.toObject(message.updateMask, options); + if (message.allowMissing != null && message.hasOwnProperty("allowMissing")) + object.allowMissing = message.allowMissing; + return object; + }; + + /** + * Converts this UpdateApiRequest to JSON. + * @function toJSON + * @memberof google.cloud.apigeeregistry.v1.UpdateApiRequest + * @instance + * @returns {Object.} JSON object + */ + UpdateApiRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for UpdateApiRequest + * @function getTypeUrl + * @memberof google.cloud.apigeeregistry.v1.UpdateApiRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + UpdateApiRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.apigeeregistry.v1.UpdateApiRequest"; + }; + + return UpdateApiRequest; + })(); + + v1.DeleteApiRequest = (function() { + + /** + * Properties of a DeleteApiRequest. + * @memberof google.cloud.apigeeregistry.v1 + * @interface IDeleteApiRequest + * @property {string|null} [name] DeleteApiRequest name + * @property {boolean|null} [force] DeleteApiRequest force + */ + + /** + * Constructs a new DeleteApiRequest. + * @memberof google.cloud.apigeeregistry.v1 + * @classdesc Represents a DeleteApiRequest. + * @implements IDeleteApiRequest + * @constructor + * @param {google.cloud.apigeeregistry.v1.IDeleteApiRequest=} [properties] Properties to set + */ + function DeleteApiRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * DeleteApiRequest name. + * @member {string} name + * @memberof google.cloud.apigeeregistry.v1.DeleteApiRequest + * @instance + */ + DeleteApiRequest.prototype.name = ""; + + /** + * DeleteApiRequest force. + * @member {boolean} force + * @memberof google.cloud.apigeeregistry.v1.DeleteApiRequest + * @instance + */ + DeleteApiRequest.prototype.force = false; + + /** + * Creates a new DeleteApiRequest instance using the specified properties. + * @function create + * @memberof google.cloud.apigeeregistry.v1.DeleteApiRequest + * @static + * @param {google.cloud.apigeeregistry.v1.IDeleteApiRequest=} [properties] Properties to set + * @returns {google.cloud.apigeeregistry.v1.DeleteApiRequest} DeleteApiRequest instance + */ + DeleteApiRequest.create = function create(properties) { + return new DeleteApiRequest(properties); + }; + + /** + * Encodes the specified DeleteApiRequest message. Does not implicitly {@link google.cloud.apigeeregistry.v1.DeleteApiRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.apigeeregistry.v1.DeleteApiRequest + * @static + * @param {google.cloud.apigeeregistry.v1.IDeleteApiRequest} message DeleteApiRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteApiRequest.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.force != null && Object.hasOwnProperty.call(message, "force")) + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.force); + return writer; + }; + + /** + * Encodes the specified DeleteApiRequest message, length delimited. Does not implicitly {@link google.cloud.apigeeregistry.v1.DeleteApiRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.apigeeregistry.v1.DeleteApiRequest + * @static + * @param {google.cloud.apigeeregistry.v1.IDeleteApiRequest} message DeleteApiRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteApiRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DeleteApiRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.apigeeregistry.v1.DeleteApiRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.apigeeregistry.v1.DeleteApiRequest} DeleteApiRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteApiRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.apigeeregistry.v1.DeleteApiRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.force = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DeleteApiRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.apigeeregistry.v1.DeleteApiRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.apigeeregistry.v1.DeleteApiRequest} DeleteApiRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteApiRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DeleteApiRequest message. + * @function verify + * @memberof google.cloud.apigeeregistry.v1.DeleteApiRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DeleteApiRequest.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.force != null && message.hasOwnProperty("force")) + if (typeof message.force !== "boolean") + return "force: boolean expected"; + return null; + }; + + /** + * Creates a DeleteApiRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.apigeeregistry.v1.DeleteApiRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.apigeeregistry.v1.DeleteApiRequest} DeleteApiRequest + */ + DeleteApiRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.apigeeregistry.v1.DeleteApiRequest) + return object; + var message = new $root.google.cloud.apigeeregistry.v1.DeleteApiRequest(); + if (object.name != null) + message.name = String(object.name); + if (object.force != null) + message.force = Boolean(object.force); + return message; + }; + + /** + * Creates a plain object from a DeleteApiRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.apigeeregistry.v1.DeleteApiRequest + * @static + * @param {google.cloud.apigeeregistry.v1.DeleteApiRequest} message DeleteApiRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DeleteApiRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.force = false; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.force != null && message.hasOwnProperty("force")) + object.force = message.force; + return object; + }; + + /** + * Converts this DeleteApiRequest to JSON. + * @function toJSON + * @memberof google.cloud.apigeeregistry.v1.DeleteApiRequest + * @instance + * @returns {Object.} JSON object + */ + DeleteApiRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DeleteApiRequest + * @function getTypeUrl + * @memberof google.cloud.apigeeregistry.v1.DeleteApiRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DeleteApiRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.apigeeregistry.v1.DeleteApiRequest"; + }; + + return DeleteApiRequest; + })(); + + v1.ListApiVersionsRequest = (function() { + + /** + * Properties of a ListApiVersionsRequest. + * @memberof google.cloud.apigeeregistry.v1 + * @interface IListApiVersionsRequest + * @property {string|null} [parent] ListApiVersionsRequest parent + * @property {number|null} [pageSize] ListApiVersionsRequest pageSize + * @property {string|null} [pageToken] ListApiVersionsRequest pageToken + * @property {string|null} [filter] ListApiVersionsRequest filter + */ + + /** + * Constructs a new ListApiVersionsRequest. + * @memberof google.cloud.apigeeregistry.v1 + * @classdesc Represents a ListApiVersionsRequest. + * @implements IListApiVersionsRequest + * @constructor + * @param {google.cloud.apigeeregistry.v1.IListApiVersionsRequest=} [properties] Properties to set + */ + function ListApiVersionsRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListApiVersionsRequest parent. + * @member {string} parent + * @memberof google.cloud.apigeeregistry.v1.ListApiVersionsRequest + * @instance + */ + ListApiVersionsRequest.prototype.parent = ""; + + /** + * ListApiVersionsRequest pageSize. + * @member {number} pageSize + * @memberof google.cloud.apigeeregistry.v1.ListApiVersionsRequest + * @instance + */ + ListApiVersionsRequest.prototype.pageSize = 0; + + /** + * ListApiVersionsRequest pageToken. + * @member {string} pageToken + * @memberof google.cloud.apigeeregistry.v1.ListApiVersionsRequest + * @instance + */ + ListApiVersionsRequest.prototype.pageToken = ""; + + /** + * ListApiVersionsRequest filter. + * @member {string} filter + * @memberof google.cloud.apigeeregistry.v1.ListApiVersionsRequest + * @instance + */ + ListApiVersionsRequest.prototype.filter = ""; + + /** + * Creates a new ListApiVersionsRequest instance using the specified properties. + * @function create + * @memberof google.cloud.apigeeregistry.v1.ListApiVersionsRequest + * @static + * @param {google.cloud.apigeeregistry.v1.IListApiVersionsRequest=} [properties] Properties to set + * @returns {google.cloud.apigeeregistry.v1.ListApiVersionsRequest} ListApiVersionsRequest instance + */ + ListApiVersionsRequest.create = function create(properties) { + return new ListApiVersionsRequest(properties); + }; + + /** + * Encodes the specified ListApiVersionsRequest message. Does not implicitly {@link google.cloud.apigeeregistry.v1.ListApiVersionsRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.apigeeregistry.v1.ListApiVersionsRequest + * @static + * @param {google.cloud.apigeeregistry.v1.IListApiVersionsRequest} message ListApiVersionsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListApiVersionsRequest.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.filter != null && Object.hasOwnProperty.call(message, "filter")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.filter); + return writer; + }; + + /** + * Encodes the specified ListApiVersionsRequest message, length delimited. Does not implicitly {@link google.cloud.apigeeregistry.v1.ListApiVersionsRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.apigeeregistry.v1.ListApiVersionsRequest + * @static + * @param {google.cloud.apigeeregistry.v1.IListApiVersionsRequest} message ListApiVersionsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListApiVersionsRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListApiVersionsRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.apigeeregistry.v1.ListApiVersionsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.apigeeregistry.v1.ListApiVersionsRequest} ListApiVersionsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListApiVersionsRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.apigeeregistry.v1.ListApiVersionsRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + 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.filter = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListApiVersionsRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.apigeeregistry.v1.ListApiVersionsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.apigeeregistry.v1.ListApiVersionsRequest} ListApiVersionsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListApiVersionsRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListApiVersionsRequest message. + * @function verify + * @memberof google.cloud.apigeeregistry.v1.ListApiVersionsRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListApiVersionsRequest.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.filter != null && message.hasOwnProperty("filter")) + if (!$util.isString(message.filter)) + return "filter: string expected"; + return null; + }; + + /** + * Creates a ListApiVersionsRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.apigeeregistry.v1.ListApiVersionsRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.apigeeregistry.v1.ListApiVersionsRequest} ListApiVersionsRequest + */ + ListApiVersionsRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.apigeeregistry.v1.ListApiVersionsRequest) + return object; + var message = new $root.google.cloud.apigeeregistry.v1.ListApiVersionsRequest(); + 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.filter != null) + message.filter = String(object.filter); + return message; + }; + + /** + * Creates a plain object from a ListApiVersionsRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.apigeeregistry.v1.ListApiVersionsRequest + * @static + * @param {google.cloud.apigeeregistry.v1.ListApiVersionsRequest} message ListApiVersionsRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListApiVersionsRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.pageSize = 0; + object.pageToken = ""; + object.filter = ""; + } + 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.filter != null && message.hasOwnProperty("filter")) + object.filter = message.filter; + return object; + }; + + /** + * Converts this ListApiVersionsRequest to JSON. + * @function toJSON + * @memberof google.cloud.apigeeregistry.v1.ListApiVersionsRequest + * @instance + * @returns {Object.} JSON object + */ + ListApiVersionsRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListApiVersionsRequest + * @function getTypeUrl + * @memberof google.cloud.apigeeregistry.v1.ListApiVersionsRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListApiVersionsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.apigeeregistry.v1.ListApiVersionsRequest"; + }; + + return ListApiVersionsRequest; + })(); + + v1.ListApiVersionsResponse = (function() { + + /** + * Properties of a ListApiVersionsResponse. + * @memberof google.cloud.apigeeregistry.v1 + * @interface IListApiVersionsResponse + * @property {Array.|null} [apiVersions] ListApiVersionsResponse apiVersions + * @property {string|null} [nextPageToken] ListApiVersionsResponse nextPageToken + */ + + /** + * Constructs a new ListApiVersionsResponse. + * @memberof google.cloud.apigeeregistry.v1 + * @classdesc Represents a ListApiVersionsResponse. + * @implements IListApiVersionsResponse + * @constructor + * @param {google.cloud.apigeeregistry.v1.IListApiVersionsResponse=} [properties] Properties to set + */ + function ListApiVersionsResponse(properties) { + this.apiVersions = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListApiVersionsResponse apiVersions. + * @member {Array.} apiVersions + * @memberof google.cloud.apigeeregistry.v1.ListApiVersionsResponse + * @instance + */ + ListApiVersionsResponse.prototype.apiVersions = $util.emptyArray; + + /** + * ListApiVersionsResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.cloud.apigeeregistry.v1.ListApiVersionsResponse + * @instance + */ + ListApiVersionsResponse.prototype.nextPageToken = ""; + + /** + * Creates a new ListApiVersionsResponse instance using the specified properties. + * @function create + * @memberof google.cloud.apigeeregistry.v1.ListApiVersionsResponse + * @static + * @param {google.cloud.apigeeregistry.v1.IListApiVersionsResponse=} [properties] Properties to set + * @returns {google.cloud.apigeeregistry.v1.ListApiVersionsResponse} ListApiVersionsResponse instance + */ + ListApiVersionsResponse.create = function create(properties) { + return new ListApiVersionsResponse(properties); + }; + + /** + * Encodes the specified ListApiVersionsResponse message. Does not implicitly {@link google.cloud.apigeeregistry.v1.ListApiVersionsResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.apigeeregistry.v1.ListApiVersionsResponse + * @static + * @param {google.cloud.apigeeregistry.v1.IListApiVersionsResponse} message ListApiVersionsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListApiVersionsResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.apiVersions != null && message.apiVersions.length) + for (var i = 0; i < message.apiVersions.length; ++i) + $root.google.cloud.apigeeregistry.v1.ApiVersion.encode(message.apiVersions[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 ListApiVersionsResponse message, length delimited. Does not implicitly {@link google.cloud.apigeeregistry.v1.ListApiVersionsResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.apigeeregistry.v1.ListApiVersionsResponse + * @static + * @param {google.cloud.apigeeregistry.v1.IListApiVersionsResponse} message ListApiVersionsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListApiVersionsResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListApiVersionsResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.apigeeregistry.v1.ListApiVersionsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.apigeeregistry.v1.ListApiVersionsResponse} ListApiVersionsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListApiVersionsResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.apigeeregistry.v1.ListApiVersionsResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.apiVersions && message.apiVersions.length)) + message.apiVersions = []; + message.apiVersions.push($root.google.cloud.apigeeregistry.v1.ApiVersion.decode(reader, reader.uint32())); + break; + } + case 2: { + message.nextPageToken = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListApiVersionsResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.apigeeregistry.v1.ListApiVersionsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.apigeeregistry.v1.ListApiVersionsResponse} ListApiVersionsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListApiVersionsResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListApiVersionsResponse message. + * @function verify + * @memberof google.cloud.apigeeregistry.v1.ListApiVersionsResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListApiVersionsResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.apiVersions != null && message.hasOwnProperty("apiVersions")) { + if (!Array.isArray(message.apiVersions)) + return "apiVersions: array expected"; + for (var i = 0; i < message.apiVersions.length; ++i) { + var error = $root.google.cloud.apigeeregistry.v1.ApiVersion.verify(message.apiVersions[i]); + if (error) + return "apiVersions." + error; + } + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + return null; + }; + + /** + * Creates a ListApiVersionsResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.apigeeregistry.v1.ListApiVersionsResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.apigeeregistry.v1.ListApiVersionsResponse} ListApiVersionsResponse + */ + ListApiVersionsResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.apigeeregistry.v1.ListApiVersionsResponse) + return object; + var message = new $root.google.cloud.apigeeregistry.v1.ListApiVersionsResponse(); + if (object.apiVersions) { + if (!Array.isArray(object.apiVersions)) + throw TypeError(".google.cloud.apigeeregistry.v1.ListApiVersionsResponse.apiVersions: array expected"); + message.apiVersions = []; + for (var i = 0; i < object.apiVersions.length; ++i) { + if (typeof object.apiVersions[i] !== "object") + throw TypeError(".google.cloud.apigeeregistry.v1.ListApiVersionsResponse.apiVersions: object expected"); + message.apiVersions[i] = $root.google.cloud.apigeeregistry.v1.ApiVersion.fromObject(object.apiVersions[i]); + } + } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + return message; + }; + + /** + * Creates a plain object from a ListApiVersionsResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.apigeeregistry.v1.ListApiVersionsResponse + * @static + * @param {google.cloud.apigeeregistry.v1.ListApiVersionsResponse} message ListApiVersionsResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListApiVersionsResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.apiVersions = []; + if (options.defaults) + object.nextPageToken = ""; + if (message.apiVersions && message.apiVersions.length) { + object.apiVersions = []; + for (var j = 0; j < message.apiVersions.length; ++j) + object.apiVersions[j] = $root.google.cloud.apigeeregistry.v1.ApiVersion.toObject(message.apiVersions[j], options); + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + object.nextPageToken = message.nextPageToken; + return object; + }; + + /** + * Converts this ListApiVersionsResponse to JSON. + * @function toJSON + * @memberof google.cloud.apigeeregistry.v1.ListApiVersionsResponse + * @instance + * @returns {Object.} JSON object + */ + ListApiVersionsResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListApiVersionsResponse + * @function getTypeUrl + * @memberof google.cloud.apigeeregistry.v1.ListApiVersionsResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListApiVersionsResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.apigeeregistry.v1.ListApiVersionsResponse"; + }; + + return ListApiVersionsResponse; + })(); + + v1.GetApiVersionRequest = (function() { + + /** + * Properties of a GetApiVersionRequest. + * @memberof google.cloud.apigeeregistry.v1 + * @interface IGetApiVersionRequest + * @property {string|null} [name] GetApiVersionRequest name + */ + + /** + * Constructs a new GetApiVersionRequest. + * @memberof google.cloud.apigeeregistry.v1 + * @classdesc Represents a GetApiVersionRequest. + * @implements IGetApiVersionRequest + * @constructor + * @param {google.cloud.apigeeregistry.v1.IGetApiVersionRequest=} [properties] Properties to set + */ + function GetApiVersionRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetApiVersionRequest name. + * @member {string} name + * @memberof google.cloud.apigeeregistry.v1.GetApiVersionRequest + * @instance + */ + GetApiVersionRequest.prototype.name = ""; + + /** + * Creates a new GetApiVersionRequest instance using the specified properties. + * @function create + * @memberof google.cloud.apigeeregistry.v1.GetApiVersionRequest + * @static + * @param {google.cloud.apigeeregistry.v1.IGetApiVersionRequest=} [properties] Properties to set + * @returns {google.cloud.apigeeregistry.v1.GetApiVersionRequest} GetApiVersionRequest instance + */ + GetApiVersionRequest.create = function create(properties) { + return new GetApiVersionRequest(properties); + }; + + /** + * Encodes the specified GetApiVersionRequest message. Does not implicitly {@link google.cloud.apigeeregistry.v1.GetApiVersionRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.apigeeregistry.v1.GetApiVersionRequest + * @static + * @param {google.cloud.apigeeregistry.v1.IGetApiVersionRequest} message GetApiVersionRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetApiVersionRequest.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 GetApiVersionRequest message, length delimited. Does not implicitly {@link google.cloud.apigeeregistry.v1.GetApiVersionRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.apigeeregistry.v1.GetApiVersionRequest + * @static + * @param {google.cloud.apigeeregistry.v1.IGetApiVersionRequest} message GetApiVersionRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetApiVersionRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetApiVersionRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.apigeeregistry.v1.GetApiVersionRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.apigeeregistry.v1.GetApiVersionRequest} GetApiVersionRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetApiVersionRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.apigeeregistry.v1.GetApiVersionRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetApiVersionRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.apigeeregistry.v1.GetApiVersionRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.apigeeregistry.v1.GetApiVersionRequest} GetApiVersionRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetApiVersionRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetApiVersionRequest message. + * @function verify + * @memberof google.cloud.apigeeregistry.v1.GetApiVersionRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetApiVersionRequest.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 GetApiVersionRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.apigeeregistry.v1.GetApiVersionRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.apigeeregistry.v1.GetApiVersionRequest} GetApiVersionRequest + */ + GetApiVersionRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.apigeeregistry.v1.GetApiVersionRequest) + return object; + var message = new $root.google.cloud.apigeeregistry.v1.GetApiVersionRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a GetApiVersionRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.apigeeregistry.v1.GetApiVersionRequest + * @static + * @param {google.cloud.apigeeregistry.v1.GetApiVersionRequest} message GetApiVersionRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetApiVersionRequest.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 GetApiVersionRequest to JSON. + * @function toJSON + * @memberof google.cloud.apigeeregistry.v1.GetApiVersionRequest + * @instance + * @returns {Object.} JSON object + */ + GetApiVersionRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GetApiVersionRequest + * @function getTypeUrl + * @memberof google.cloud.apigeeregistry.v1.GetApiVersionRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GetApiVersionRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.apigeeregistry.v1.GetApiVersionRequest"; + }; + + return GetApiVersionRequest; + })(); + + v1.CreateApiVersionRequest = (function() { + + /** + * Properties of a CreateApiVersionRequest. + * @memberof google.cloud.apigeeregistry.v1 + * @interface ICreateApiVersionRequest + * @property {string|null} [parent] CreateApiVersionRequest parent + * @property {google.cloud.apigeeregistry.v1.IApiVersion|null} [apiVersion] CreateApiVersionRequest apiVersion + * @property {string|null} [apiVersionId] CreateApiVersionRequest apiVersionId + */ + + /** + * Constructs a new CreateApiVersionRequest. + * @memberof google.cloud.apigeeregistry.v1 + * @classdesc Represents a CreateApiVersionRequest. + * @implements ICreateApiVersionRequest + * @constructor + * @param {google.cloud.apigeeregistry.v1.ICreateApiVersionRequest=} [properties] Properties to set + */ + function CreateApiVersionRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * CreateApiVersionRequest parent. + * @member {string} parent + * @memberof google.cloud.apigeeregistry.v1.CreateApiVersionRequest + * @instance + */ + CreateApiVersionRequest.prototype.parent = ""; + + /** + * CreateApiVersionRequest apiVersion. + * @member {google.cloud.apigeeregistry.v1.IApiVersion|null|undefined} apiVersion + * @memberof google.cloud.apigeeregistry.v1.CreateApiVersionRequest + * @instance + */ + CreateApiVersionRequest.prototype.apiVersion = null; + + /** + * CreateApiVersionRequest apiVersionId. + * @member {string} apiVersionId + * @memberof google.cloud.apigeeregistry.v1.CreateApiVersionRequest + * @instance + */ + CreateApiVersionRequest.prototype.apiVersionId = ""; + + /** + * Creates a new CreateApiVersionRequest instance using the specified properties. + * @function create + * @memberof google.cloud.apigeeregistry.v1.CreateApiVersionRequest + * @static + * @param {google.cloud.apigeeregistry.v1.ICreateApiVersionRequest=} [properties] Properties to set + * @returns {google.cloud.apigeeregistry.v1.CreateApiVersionRequest} CreateApiVersionRequest instance + */ + CreateApiVersionRequest.create = function create(properties) { + return new CreateApiVersionRequest(properties); + }; + + /** + * Encodes the specified CreateApiVersionRequest message. Does not implicitly {@link google.cloud.apigeeregistry.v1.CreateApiVersionRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.apigeeregistry.v1.CreateApiVersionRequest + * @static + * @param {google.cloud.apigeeregistry.v1.ICreateApiVersionRequest} message CreateApiVersionRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateApiVersionRequest.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.apiVersion != null && Object.hasOwnProperty.call(message, "apiVersion")) + $root.google.cloud.apigeeregistry.v1.ApiVersion.encode(message.apiVersion, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.apiVersionId != null && Object.hasOwnProperty.call(message, "apiVersionId")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.apiVersionId); + return writer; + }; + + /** + * Encodes the specified CreateApiVersionRequest message, length delimited. Does not implicitly {@link google.cloud.apigeeregistry.v1.CreateApiVersionRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.apigeeregistry.v1.CreateApiVersionRequest + * @static + * @param {google.cloud.apigeeregistry.v1.ICreateApiVersionRequest} message CreateApiVersionRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateApiVersionRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CreateApiVersionRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.apigeeregistry.v1.CreateApiVersionRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.apigeeregistry.v1.CreateApiVersionRequest} CreateApiVersionRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateApiVersionRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.apigeeregistry.v1.CreateApiVersionRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.apiVersion = $root.google.cloud.apigeeregistry.v1.ApiVersion.decode(reader, reader.uint32()); + break; + } + case 3: { + message.apiVersionId = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CreateApiVersionRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.apigeeregistry.v1.CreateApiVersionRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.apigeeregistry.v1.CreateApiVersionRequest} CreateApiVersionRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateApiVersionRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CreateApiVersionRequest message. + * @function verify + * @memberof google.cloud.apigeeregistry.v1.CreateApiVersionRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CreateApiVersionRequest.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.apiVersion != null && message.hasOwnProperty("apiVersion")) { + var error = $root.google.cloud.apigeeregistry.v1.ApiVersion.verify(message.apiVersion); + if (error) + return "apiVersion." + error; + } + if (message.apiVersionId != null && message.hasOwnProperty("apiVersionId")) + if (!$util.isString(message.apiVersionId)) + return "apiVersionId: string expected"; + return null; + }; + + /** + * Creates a CreateApiVersionRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.apigeeregistry.v1.CreateApiVersionRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.apigeeregistry.v1.CreateApiVersionRequest} CreateApiVersionRequest + */ + CreateApiVersionRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.apigeeregistry.v1.CreateApiVersionRequest) + return object; + var message = new $root.google.cloud.apigeeregistry.v1.CreateApiVersionRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.apiVersion != null) { + if (typeof object.apiVersion !== "object") + throw TypeError(".google.cloud.apigeeregistry.v1.CreateApiVersionRequest.apiVersion: object expected"); + message.apiVersion = $root.google.cloud.apigeeregistry.v1.ApiVersion.fromObject(object.apiVersion); + } + if (object.apiVersionId != null) + message.apiVersionId = String(object.apiVersionId); + return message; + }; + + /** + * Creates a plain object from a CreateApiVersionRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.apigeeregistry.v1.CreateApiVersionRequest + * @static + * @param {google.cloud.apigeeregistry.v1.CreateApiVersionRequest} message CreateApiVersionRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CreateApiVersionRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.apiVersion = null; + object.apiVersionId = ""; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.apiVersion != null && message.hasOwnProperty("apiVersion")) + object.apiVersion = $root.google.cloud.apigeeregistry.v1.ApiVersion.toObject(message.apiVersion, options); + if (message.apiVersionId != null && message.hasOwnProperty("apiVersionId")) + object.apiVersionId = message.apiVersionId; + return object; + }; + + /** + * Converts this CreateApiVersionRequest to JSON. + * @function toJSON + * @memberof google.cloud.apigeeregistry.v1.CreateApiVersionRequest + * @instance + * @returns {Object.} JSON object + */ + CreateApiVersionRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CreateApiVersionRequest + * @function getTypeUrl + * @memberof google.cloud.apigeeregistry.v1.CreateApiVersionRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CreateApiVersionRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.apigeeregistry.v1.CreateApiVersionRequest"; + }; + + return CreateApiVersionRequest; + })(); + + v1.UpdateApiVersionRequest = (function() { + + /** + * Properties of an UpdateApiVersionRequest. + * @memberof google.cloud.apigeeregistry.v1 + * @interface IUpdateApiVersionRequest + * @property {google.cloud.apigeeregistry.v1.IApiVersion|null} [apiVersion] UpdateApiVersionRequest apiVersion + * @property {google.protobuf.IFieldMask|null} [updateMask] UpdateApiVersionRequest updateMask + * @property {boolean|null} [allowMissing] UpdateApiVersionRequest allowMissing + */ + + /** + * Constructs a new UpdateApiVersionRequest. + * @memberof google.cloud.apigeeregistry.v1 + * @classdesc Represents an UpdateApiVersionRequest. + * @implements IUpdateApiVersionRequest + * @constructor + * @param {google.cloud.apigeeregistry.v1.IUpdateApiVersionRequest=} [properties] Properties to set + */ + function UpdateApiVersionRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * UpdateApiVersionRequest apiVersion. + * @member {google.cloud.apigeeregistry.v1.IApiVersion|null|undefined} apiVersion + * @memberof google.cloud.apigeeregistry.v1.UpdateApiVersionRequest + * @instance + */ + UpdateApiVersionRequest.prototype.apiVersion = null; + + /** + * UpdateApiVersionRequest updateMask. + * @member {google.protobuf.IFieldMask|null|undefined} updateMask + * @memberof google.cloud.apigeeregistry.v1.UpdateApiVersionRequest + * @instance + */ + UpdateApiVersionRequest.prototype.updateMask = null; + + /** + * UpdateApiVersionRequest allowMissing. + * @member {boolean} allowMissing + * @memberof google.cloud.apigeeregistry.v1.UpdateApiVersionRequest + * @instance + */ + UpdateApiVersionRequest.prototype.allowMissing = false; + + /** + * Creates a new UpdateApiVersionRequest instance using the specified properties. + * @function create + * @memberof google.cloud.apigeeregistry.v1.UpdateApiVersionRequest + * @static + * @param {google.cloud.apigeeregistry.v1.IUpdateApiVersionRequest=} [properties] Properties to set + * @returns {google.cloud.apigeeregistry.v1.UpdateApiVersionRequest} UpdateApiVersionRequest instance + */ + UpdateApiVersionRequest.create = function create(properties) { + return new UpdateApiVersionRequest(properties); + }; + + /** + * Encodes the specified UpdateApiVersionRequest message. Does not implicitly {@link google.cloud.apigeeregistry.v1.UpdateApiVersionRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.apigeeregistry.v1.UpdateApiVersionRequest + * @static + * @param {google.cloud.apigeeregistry.v1.IUpdateApiVersionRequest} message UpdateApiVersionRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateApiVersionRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.apiVersion != null && Object.hasOwnProperty.call(message, "apiVersion")) + $root.google.cloud.apigeeregistry.v1.ApiVersion.encode(message.apiVersion, 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.allowMissing != null && Object.hasOwnProperty.call(message, "allowMissing")) + writer.uint32(/* id 3, wireType 0 =*/24).bool(message.allowMissing); + return writer; + }; + + /** + * Encodes the specified UpdateApiVersionRequest message, length delimited. Does not implicitly {@link google.cloud.apigeeregistry.v1.UpdateApiVersionRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.apigeeregistry.v1.UpdateApiVersionRequest + * @static + * @param {google.cloud.apigeeregistry.v1.IUpdateApiVersionRequest} message UpdateApiVersionRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateApiVersionRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an UpdateApiVersionRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.apigeeregistry.v1.UpdateApiVersionRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.apigeeregistry.v1.UpdateApiVersionRequest} UpdateApiVersionRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateApiVersionRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.apigeeregistry.v1.UpdateApiVersionRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.apiVersion = $root.google.cloud.apigeeregistry.v1.ApiVersion.decode(reader, reader.uint32()); + break; + } + case 2: { + message.updateMask = $root.google.protobuf.FieldMask.decode(reader, reader.uint32()); + break; + } + case 3: { + message.allowMissing = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an UpdateApiVersionRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.apigeeregistry.v1.UpdateApiVersionRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.apigeeregistry.v1.UpdateApiVersionRequest} UpdateApiVersionRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateApiVersionRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an UpdateApiVersionRequest message. + * @function verify + * @memberof google.cloud.apigeeregistry.v1.UpdateApiVersionRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + UpdateApiVersionRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.apiVersion != null && message.hasOwnProperty("apiVersion")) { + var error = $root.google.cloud.apigeeregistry.v1.ApiVersion.verify(message.apiVersion); + if (error) + return "apiVersion." + error; + } + if (message.updateMask != null && message.hasOwnProperty("updateMask")) { + var error = $root.google.protobuf.FieldMask.verify(message.updateMask); + if (error) + return "updateMask." + error; + } + if (message.allowMissing != null && message.hasOwnProperty("allowMissing")) + if (typeof message.allowMissing !== "boolean") + return "allowMissing: boolean expected"; + return null; + }; + + /** + * Creates an UpdateApiVersionRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.apigeeregistry.v1.UpdateApiVersionRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.apigeeregistry.v1.UpdateApiVersionRequest} UpdateApiVersionRequest + */ + UpdateApiVersionRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.apigeeregistry.v1.UpdateApiVersionRequest) + return object; + var message = new $root.google.cloud.apigeeregistry.v1.UpdateApiVersionRequest(); + if (object.apiVersion != null) { + if (typeof object.apiVersion !== "object") + throw TypeError(".google.cloud.apigeeregistry.v1.UpdateApiVersionRequest.apiVersion: object expected"); + message.apiVersion = $root.google.cloud.apigeeregistry.v1.ApiVersion.fromObject(object.apiVersion); + } + if (object.updateMask != null) { + if (typeof object.updateMask !== "object") + throw TypeError(".google.cloud.apigeeregistry.v1.UpdateApiVersionRequest.updateMask: object expected"); + message.updateMask = $root.google.protobuf.FieldMask.fromObject(object.updateMask); + } + if (object.allowMissing != null) + message.allowMissing = Boolean(object.allowMissing); + return message; + }; + + /** + * Creates a plain object from an UpdateApiVersionRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.apigeeregistry.v1.UpdateApiVersionRequest + * @static + * @param {google.cloud.apigeeregistry.v1.UpdateApiVersionRequest} message UpdateApiVersionRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + UpdateApiVersionRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.apiVersion = null; + object.updateMask = null; + object.allowMissing = false; + } + if (message.apiVersion != null && message.hasOwnProperty("apiVersion")) + object.apiVersion = $root.google.cloud.apigeeregistry.v1.ApiVersion.toObject(message.apiVersion, options); + if (message.updateMask != null && message.hasOwnProperty("updateMask")) + object.updateMask = $root.google.protobuf.FieldMask.toObject(message.updateMask, options); + if (message.allowMissing != null && message.hasOwnProperty("allowMissing")) + object.allowMissing = message.allowMissing; + return object; + }; + + /** + * Converts this UpdateApiVersionRequest to JSON. + * @function toJSON + * @memberof google.cloud.apigeeregistry.v1.UpdateApiVersionRequest + * @instance + * @returns {Object.} JSON object + */ + UpdateApiVersionRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for UpdateApiVersionRequest + * @function getTypeUrl + * @memberof google.cloud.apigeeregistry.v1.UpdateApiVersionRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + UpdateApiVersionRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.apigeeregistry.v1.UpdateApiVersionRequest"; + }; + + return UpdateApiVersionRequest; + })(); + + v1.DeleteApiVersionRequest = (function() { + + /** + * Properties of a DeleteApiVersionRequest. + * @memberof google.cloud.apigeeregistry.v1 + * @interface IDeleteApiVersionRequest + * @property {string|null} [name] DeleteApiVersionRequest name + * @property {boolean|null} [force] DeleteApiVersionRequest force + */ + + /** + * Constructs a new DeleteApiVersionRequest. + * @memberof google.cloud.apigeeregistry.v1 + * @classdesc Represents a DeleteApiVersionRequest. + * @implements IDeleteApiVersionRequest + * @constructor + * @param {google.cloud.apigeeregistry.v1.IDeleteApiVersionRequest=} [properties] Properties to set + */ + function DeleteApiVersionRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * DeleteApiVersionRequest name. + * @member {string} name + * @memberof google.cloud.apigeeregistry.v1.DeleteApiVersionRequest + * @instance + */ + DeleteApiVersionRequest.prototype.name = ""; + + /** + * DeleteApiVersionRequest force. + * @member {boolean} force + * @memberof google.cloud.apigeeregistry.v1.DeleteApiVersionRequest + * @instance + */ + DeleteApiVersionRequest.prototype.force = false; + + /** + * Creates a new DeleteApiVersionRequest instance using the specified properties. + * @function create + * @memberof google.cloud.apigeeregistry.v1.DeleteApiVersionRequest + * @static + * @param {google.cloud.apigeeregistry.v1.IDeleteApiVersionRequest=} [properties] Properties to set + * @returns {google.cloud.apigeeregistry.v1.DeleteApiVersionRequest} DeleteApiVersionRequest instance + */ + DeleteApiVersionRequest.create = function create(properties) { + return new DeleteApiVersionRequest(properties); + }; + + /** + * Encodes the specified DeleteApiVersionRequest message. Does not implicitly {@link google.cloud.apigeeregistry.v1.DeleteApiVersionRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.apigeeregistry.v1.DeleteApiVersionRequest + * @static + * @param {google.cloud.apigeeregistry.v1.IDeleteApiVersionRequest} message DeleteApiVersionRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteApiVersionRequest.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.force != null && Object.hasOwnProperty.call(message, "force")) + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.force); + return writer; + }; + + /** + * Encodes the specified DeleteApiVersionRequest message, length delimited. Does not implicitly {@link google.cloud.apigeeregistry.v1.DeleteApiVersionRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.apigeeregistry.v1.DeleteApiVersionRequest + * @static + * @param {google.cloud.apigeeregistry.v1.IDeleteApiVersionRequest} message DeleteApiVersionRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteApiVersionRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DeleteApiVersionRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.apigeeregistry.v1.DeleteApiVersionRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.apigeeregistry.v1.DeleteApiVersionRequest} DeleteApiVersionRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteApiVersionRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.apigeeregistry.v1.DeleteApiVersionRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.force = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DeleteApiVersionRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.apigeeregistry.v1.DeleteApiVersionRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.apigeeregistry.v1.DeleteApiVersionRequest} DeleteApiVersionRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteApiVersionRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DeleteApiVersionRequest message. + * @function verify + * @memberof google.cloud.apigeeregistry.v1.DeleteApiVersionRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DeleteApiVersionRequest.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.force != null && message.hasOwnProperty("force")) + if (typeof message.force !== "boolean") + return "force: boolean expected"; + return null; + }; + + /** + * Creates a DeleteApiVersionRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.apigeeregistry.v1.DeleteApiVersionRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.apigeeregistry.v1.DeleteApiVersionRequest} DeleteApiVersionRequest + */ + DeleteApiVersionRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.apigeeregistry.v1.DeleteApiVersionRequest) + return object; + var message = new $root.google.cloud.apigeeregistry.v1.DeleteApiVersionRequest(); + if (object.name != null) + message.name = String(object.name); + if (object.force != null) + message.force = Boolean(object.force); + return message; + }; + + /** + * Creates a plain object from a DeleteApiVersionRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.apigeeregistry.v1.DeleteApiVersionRequest + * @static + * @param {google.cloud.apigeeregistry.v1.DeleteApiVersionRequest} message DeleteApiVersionRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DeleteApiVersionRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.force = false; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.force != null && message.hasOwnProperty("force")) + object.force = message.force; + return object; + }; + + /** + * Converts this DeleteApiVersionRequest to JSON. + * @function toJSON + * @memberof google.cloud.apigeeregistry.v1.DeleteApiVersionRequest + * @instance + * @returns {Object.} JSON object + */ + DeleteApiVersionRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DeleteApiVersionRequest + * @function getTypeUrl + * @memberof google.cloud.apigeeregistry.v1.DeleteApiVersionRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DeleteApiVersionRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.apigeeregistry.v1.DeleteApiVersionRequest"; + }; + + return DeleteApiVersionRequest; + })(); + + v1.ListApiSpecsRequest = (function() { + + /** + * Properties of a ListApiSpecsRequest. + * @memberof google.cloud.apigeeregistry.v1 + * @interface IListApiSpecsRequest + * @property {string|null} [parent] ListApiSpecsRequest parent + * @property {number|null} [pageSize] ListApiSpecsRequest pageSize + * @property {string|null} [pageToken] ListApiSpecsRequest pageToken + * @property {string|null} [filter] ListApiSpecsRequest filter + */ + + /** + * Constructs a new ListApiSpecsRequest. + * @memberof google.cloud.apigeeregistry.v1 + * @classdesc Represents a ListApiSpecsRequest. + * @implements IListApiSpecsRequest + * @constructor + * @param {google.cloud.apigeeregistry.v1.IListApiSpecsRequest=} [properties] Properties to set + */ + function ListApiSpecsRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListApiSpecsRequest parent. + * @member {string} parent + * @memberof google.cloud.apigeeregistry.v1.ListApiSpecsRequest + * @instance + */ + ListApiSpecsRequest.prototype.parent = ""; + + /** + * ListApiSpecsRequest pageSize. + * @member {number} pageSize + * @memberof google.cloud.apigeeregistry.v1.ListApiSpecsRequest + * @instance + */ + ListApiSpecsRequest.prototype.pageSize = 0; + + /** + * ListApiSpecsRequest pageToken. + * @member {string} pageToken + * @memberof google.cloud.apigeeregistry.v1.ListApiSpecsRequest + * @instance + */ + ListApiSpecsRequest.prototype.pageToken = ""; + + /** + * ListApiSpecsRequest filter. + * @member {string} filter + * @memberof google.cloud.apigeeregistry.v1.ListApiSpecsRequest + * @instance + */ + ListApiSpecsRequest.prototype.filter = ""; + + /** + * Creates a new ListApiSpecsRequest instance using the specified properties. + * @function create + * @memberof google.cloud.apigeeregistry.v1.ListApiSpecsRequest + * @static + * @param {google.cloud.apigeeregistry.v1.IListApiSpecsRequest=} [properties] Properties to set + * @returns {google.cloud.apigeeregistry.v1.ListApiSpecsRequest} ListApiSpecsRequest instance + */ + ListApiSpecsRequest.create = function create(properties) { + return new ListApiSpecsRequest(properties); + }; + + /** + * Encodes the specified ListApiSpecsRequest message. Does not implicitly {@link google.cloud.apigeeregistry.v1.ListApiSpecsRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.apigeeregistry.v1.ListApiSpecsRequest + * @static + * @param {google.cloud.apigeeregistry.v1.IListApiSpecsRequest} message ListApiSpecsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListApiSpecsRequest.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.filter != null && Object.hasOwnProperty.call(message, "filter")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.filter); + return writer; + }; + + /** + * Encodes the specified ListApiSpecsRequest message, length delimited. Does not implicitly {@link google.cloud.apigeeregistry.v1.ListApiSpecsRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.apigeeregistry.v1.ListApiSpecsRequest + * @static + * @param {google.cloud.apigeeregistry.v1.IListApiSpecsRequest} message ListApiSpecsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListApiSpecsRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListApiSpecsRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.apigeeregistry.v1.ListApiSpecsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.apigeeregistry.v1.ListApiSpecsRequest} ListApiSpecsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListApiSpecsRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.apigeeregistry.v1.ListApiSpecsRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + 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.filter = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListApiSpecsRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.apigeeregistry.v1.ListApiSpecsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.apigeeregistry.v1.ListApiSpecsRequest} ListApiSpecsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListApiSpecsRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListApiSpecsRequest message. + * @function verify + * @memberof google.cloud.apigeeregistry.v1.ListApiSpecsRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListApiSpecsRequest.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.filter != null && message.hasOwnProperty("filter")) + if (!$util.isString(message.filter)) + return "filter: string expected"; + return null; + }; + + /** + * Creates a ListApiSpecsRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.apigeeregistry.v1.ListApiSpecsRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.apigeeregistry.v1.ListApiSpecsRequest} ListApiSpecsRequest + */ + ListApiSpecsRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.apigeeregistry.v1.ListApiSpecsRequest) + return object; + var message = new $root.google.cloud.apigeeregistry.v1.ListApiSpecsRequest(); + 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.filter != null) + message.filter = String(object.filter); + return message; + }; + + /** + * Creates a plain object from a ListApiSpecsRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.apigeeregistry.v1.ListApiSpecsRequest + * @static + * @param {google.cloud.apigeeregistry.v1.ListApiSpecsRequest} message ListApiSpecsRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListApiSpecsRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.pageSize = 0; + object.pageToken = ""; + object.filter = ""; + } + 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.filter != null && message.hasOwnProperty("filter")) + object.filter = message.filter; + return object; + }; + + /** + * Converts this ListApiSpecsRequest to JSON. + * @function toJSON + * @memberof google.cloud.apigeeregistry.v1.ListApiSpecsRequest + * @instance + * @returns {Object.} JSON object + */ + ListApiSpecsRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListApiSpecsRequest + * @function getTypeUrl + * @memberof google.cloud.apigeeregistry.v1.ListApiSpecsRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListApiSpecsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.apigeeregistry.v1.ListApiSpecsRequest"; + }; + + return ListApiSpecsRequest; + })(); + + v1.ListApiSpecsResponse = (function() { + + /** + * Properties of a ListApiSpecsResponse. + * @memberof google.cloud.apigeeregistry.v1 + * @interface IListApiSpecsResponse + * @property {Array.|null} [apiSpecs] ListApiSpecsResponse apiSpecs + * @property {string|null} [nextPageToken] ListApiSpecsResponse nextPageToken + */ + + /** + * Constructs a new ListApiSpecsResponse. + * @memberof google.cloud.apigeeregistry.v1 + * @classdesc Represents a ListApiSpecsResponse. + * @implements IListApiSpecsResponse + * @constructor + * @param {google.cloud.apigeeregistry.v1.IListApiSpecsResponse=} [properties] Properties to set + */ + function ListApiSpecsResponse(properties) { + this.apiSpecs = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListApiSpecsResponse apiSpecs. + * @member {Array.} apiSpecs + * @memberof google.cloud.apigeeregistry.v1.ListApiSpecsResponse + * @instance + */ + ListApiSpecsResponse.prototype.apiSpecs = $util.emptyArray; + + /** + * ListApiSpecsResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.cloud.apigeeregistry.v1.ListApiSpecsResponse + * @instance + */ + ListApiSpecsResponse.prototype.nextPageToken = ""; + + /** + * Creates a new ListApiSpecsResponse instance using the specified properties. + * @function create + * @memberof google.cloud.apigeeregistry.v1.ListApiSpecsResponse + * @static + * @param {google.cloud.apigeeregistry.v1.IListApiSpecsResponse=} [properties] Properties to set + * @returns {google.cloud.apigeeregistry.v1.ListApiSpecsResponse} ListApiSpecsResponse instance + */ + ListApiSpecsResponse.create = function create(properties) { + return new ListApiSpecsResponse(properties); + }; + + /** + * Encodes the specified ListApiSpecsResponse message. Does not implicitly {@link google.cloud.apigeeregistry.v1.ListApiSpecsResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.apigeeregistry.v1.ListApiSpecsResponse + * @static + * @param {google.cloud.apigeeregistry.v1.IListApiSpecsResponse} message ListApiSpecsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListApiSpecsResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.apiSpecs != null && message.apiSpecs.length) + for (var i = 0; i < message.apiSpecs.length; ++i) + $root.google.cloud.apigeeregistry.v1.ApiSpec.encode(message.apiSpecs[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 ListApiSpecsResponse message, length delimited. Does not implicitly {@link google.cloud.apigeeregistry.v1.ListApiSpecsResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.apigeeregistry.v1.ListApiSpecsResponse + * @static + * @param {google.cloud.apigeeregistry.v1.IListApiSpecsResponse} message ListApiSpecsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListApiSpecsResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListApiSpecsResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.apigeeregistry.v1.ListApiSpecsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.apigeeregistry.v1.ListApiSpecsResponse} ListApiSpecsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListApiSpecsResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.apigeeregistry.v1.ListApiSpecsResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.apiSpecs && message.apiSpecs.length)) + message.apiSpecs = []; + message.apiSpecs.push($root.google.cloud.apigeeregistry.v1.ApiSpec.decode(reader, reader.uint32())); + break; + } + case 2: { + message.nextPageToken = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListApiSpecsResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.apigeeregistry.v1.ListApiSpecsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.apigeeregistry.v1.ListApiSpecsResponse} ListApiSpecsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListApiSpecsResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListApiSpecsResponse message. + * @function verify + * @memberof google.cloud.apigeeregistry.v1.ListApiSpecsResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListApiSpecsResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.apiSpecs != null && message.hasOwnProperty("apiSpecs")) { + if (!Array.isArray(message.apiSpecs)) + return "apiSpecs: array expected"; + for (var i = 0; i < message.apiSpecs.length; ++i) { + var error = $root.google.cloud.apigeeregistry.v1.ApiSpec.verify(message.apiSpecs[i]); + if (error) + return "apiSpecs." + error; + } + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + return null; + }; + + /** + * Creates a ListApiSpecsResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.apigeeregistry.v1.ListApiSpecsResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.apigeeregistry.v1.ListApiSpecsResponse} ListApiSpecsResponse + */ + ListApiSpecsResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.apigeeregistry.v1.ListApiSpecsResponse) + return object; + var message = new $root.google.cloud.apigeeregistry.v1.ListApiSpecsResponse(); + if (object.apiSpecs) { + if (!Array.isArray(object.apiSpecs)) + throw TypeError(".google.cloud.apigeeregistry.v1.ListApiSpecsResponse.apiSpecs: array expected"); + message.apiSpecs = []; + for (var i = 0; i < object.apiSpecs.length; ++i) { + if (typeof object.apiSpecs[i] !== "object") + throw TypeError(".google.cloud.apigeeregistry.v1.ListApiSpecsResponse.apiSpecs: object expected"); + message.apiSpecs[i] = $root.google.cloud.apigeeregistry.v1.ApiSpec.fromObject(object.apiSpecs[i]); + } + } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + return message; + }; + + /** + * Creates a plain object from a ListApiSpecsResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.apigeeregistry.v1.ListApiSpecsResponse + * @static + * @param {google.cloud.apigeeregistry.v1.ListApiSpecsResponse} message ListApiSpecsResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListApiSpecsResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.apiSpecs = []; + if (options.defaults) + object.nextPageToken = ""; + if (message.apiSpecs && message.apiSpecs.length) { + object.apiSpecs = []; + for (var j = 0; j < message.apiSpecs.length; ++j) + object.apiSpecs[j] = $root.google.cloud.apigeeregistry.v1.ApiSpec.toObject(message.apiSpecs[j], options); + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + object.nextPageToken = message.nextPageToken; + return object; + }; + + /** + * Converts this ListApiSpecsResponse to JSON. + * @function toJSON + * @memberof google.cloud.apigeeregistry.v1.ListApiSpecsResponse + * @instance + * @returns {Object.} JSON object + */ + ListApiSpecsResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListApiSpecsResponse + * @function getTypeUrl + * @memberof google.cloud.apigeeregistry.v1.ListApiSpecsResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListApiSpecsResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.apigeeregistry.v1.ListApiSpecsResponse"; + }; + + return ListApiSpecsResponse; + })(); + + v1.GetApiSpecRequest = (function() { + + /** + * Properties of a GetApiSpecRequest. + * @memberof google.cloud.apigeeregistry.v1 + * @interface IGetApiSpecRequest + * @property {string|null} [name] GetApiSpecRequest name + */ + + /** + * Constructs a new GetApiSpecRequest. + * @memberof google.cloud.apigeeregistry.v1 + * @classdesc Represents a GetApiSpecRequest. + * @implements IGetApiSpecRequest + * @constructor + * @param {google.cloud.apigeeregistry.v1.IGetApiSpecRequest=} [properties] Properties to set + */ + function GetApiSpecRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetApiSpecRequest name. + * @member {string} name + * @memberof google.cloud.apigeeregistry.v1.GetApiSpecRequest + * @instance + */ + GetApiSpecRequest.prototype.name = ""; + + /** + * Creates a new GetApiSpecRequest instance using the specified properties. + * @function create + * @memberof google.cloud.apigeeregistry.v1.GetApiSpecRequest + * @static + * @param {google.cloud.apigeeregistry.v1.IGetApiSpecRequest=} [properties] Properties to set + * @returns {google.cloud.apigeeregistry.v1.GetApiSpecRequest} GetApiSpecRequest instance + */ + GetApiSpecRequest.create = function create(properties) { + return new GetApiSpecRequest(properties); + }; + + /** + * Encodes the specified GetApiSpecRequest message. Does not implicitly {@link google.cloud.apigeeregistry.v1.GetApiSpecRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.apigeeregistry.v1.GetApiSpecRequest + * @static + * @param {google.cloud.apigeeregistry.v1.IGetApiSpecRequest} message GetApiSpecRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetApiSpecRequest.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 GetApiSpecRequest message, length delimited. Does not implicitly {@link google.cloud.apigeeregistry.v1.GetApiSpecRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.apigeeregistry.v1.GetApiSpecRequest + * @static + * @param {google.cloud.apigeeregistry.v1.IGetApiSpecRequest} message GetApiSpecRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetApiSpecRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetApiSpecRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.apigeeregistry.v1.GetApiSpecRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.apigeeregistry.v1.GetApiSpecRequest} GetApiSpecRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetApiSpecRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.apigeeregistry.v1.GetApiSpecRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetApiSpecRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.apigeeregistry.v1.GetApiSpecRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.apigeeregistry.v1.GetApiSpecRequest} GetApiSpecRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetApiSpecRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetApiSpecRequest message. + * @function verify + * @memberof google.cloud.apigeeregistry.v1.GetApiSpecRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetApiSpecRequest.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 GetApiSpecRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.apigeeregistry.v1.GetApiSpecRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.apigeeregistry.v1.GetApiSpecRequest} GetApiSpecRequest + */ + GetApiSpecRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.apigeeregistry.v1.GetApiSpecRequest) + return object; + var message = new $root.google.cloud.apigeeregistry.v1.GetApiSpecRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a GetApiSpecRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.apigeeregistry.v1.GetApiSpecRequest + * @static + * @param {google.cloud.apigeeregistry.v1.GetApiSpecRequest} message GetApiSpecRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetApiSpecRequest.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 GetApiSpecRequest to JSON. + * @function toJSON + * @memberof google.cloud.apigeeregistry.v1.GetApiSpecRequest + * @instance + * @returns {Object.} JSON object + */ + GetApiSpecRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GetApiSpecRequest + * @function getTypeUrl + * @memberof google.cloud.apigeeregistry.v1.GetApiSpecRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GetApiSpecRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.apigeeregistry.v1.GetApiSpecRequest"; + }; + + return GetApiSpecRequest; + })(); + + v1.GetApiSpecContentsRequest = (function() { + + /** + * Properties of a GetApiSpecContentsRequest. + * @memberof google.cloud.apigeeregistry.v1 + * @interface IGetApiSpecContentsRequest + * @property {string|null} [name] GetApiSpecContentsRequest name + */ + + /** + * Constructs a new GetApiSpecContentsRequest. + * @memberof google.cloud.apigeeregistry.v1 + * @classdesc Represents a GetApiSpecContentsRequest. + * @implements IGetApiSpecContentsRequest + * @constructor + * @param {google.cloud.apigeeregistry.v1.IGetApiSpecContentsRequest=} [properties] Properties to set + */ + function GetApiSpecContentsRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetApiSpecContentsRequest name. + * @member {string} name + * @memberof google.cloud.apigeeregistry.v1.GetApiSpecContentsRequest + * @instance + */ + GetApiSpecContentsRequest.prototype.name = ""; + + /** + * Creates a new GetApiSpecContentsRequest instance using the specified properties. + * @function create + * @memberof google.cloud.apigeeregistry.v1.GetApiSpecContentsRequest + * @static + * @param {google.cloud.apigeeregistry.v1.IGetApiSpecContentsRequest=} [properties] Properties to set + * @returns {google.cloud.apigeeregistry.v1.GetApiSpecContentsRequest} GetApiSpecContentsRequest instance + */ + GetApiSpecContentsRequest.create = function create(properties) { + return new GetApiSpecContentsRequest(properties); + }; + + /** + * Encodes the specified GetApiSpecContentsRequest message. Does not implicitly {@link google.cloud.apigeeregistry.v1.GetApiSpecContentsRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.apigeeregistry.v1.GetApiSpecContentsRequest + * @static + * @param {google.cloud.apigeeregistry.v1.IGetApiSpecContentsRequest} message GetApiSpecContentsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetApiSpecContentsRequest.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 GetApiSpecContentsRequest message, length delimited. Does not implicitly {@link google.cloud.apigeeregistry.v1.GetApiSpecContentsRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.apigeeregistry.v1.GetApiSpecContentsRequest + * @static + * @param {google.cloud.apigeeregistry.v1.IGetApiSpecContentsRequest} message GetApiSpecContentsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetApiSpecContentsRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetApiSpecContentsRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.apigeeregistry.v1.GetApiSpecContentsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.apigeeregistry.v1.GetApiSpecContentsRequest} GetApiSpecContentsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetApiSpecContentsRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.apigeeregistry.v1.GetApiSpecContentsRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetApiSpecContentsRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.apigeeregistry.v1.GetApiSpecContentsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.apigeeregistry.v1.GetApiSpecContentsRequest} GetApiSpecContentsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetApiSpecContentsRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetApiSpecContentsRequest message. + * @function verify + * @memberof google.cloud.apigeeregistry.v1.GetApiSpecContentsRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetApiSpecContentsRequest.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 GetApiSpecContentsRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.apigeeregistry.v1.GetApiSpecContentsRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.apigeeregistry.v1.GetApiSpecContentsRequest} GetApiSpecContentsRequest + */ + GetApiSpecContentsRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.apigeeregistry.v1.GetApiSpecContentsRequest) + return object; + var message = new $root.google.cloud.apigeeregistry.v1.GetApiSpecContentsRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a GetApiSpecContentsRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.apigeeregistry.v1.GetApiSpecContentsRequest + * @static + * @param {google.cloud.apigeeregistry.v1.GetApiSpecContentsRequest} message GetApiSpecContentsRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetApiSpecContentsRequest.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 GetApiSpecContentsRequest to JSON. + * @function toJSON + * @memberof google.cloud.apigeeregistry.v1.GetApiSpecContentsRequest + * @instance + * @returns {Object.} JSON object + */ + GetApiSpecContentsRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GetApiSpecContentsRequest + * @function getTypeUrl + * @memberof google.cloud.apigeeregistry.v1.GetApiSpecContentsRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GetApiSpecContentsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.apigeeregistry.v1.GetApiSpecContentsRequest"; + }; + + return GetApiSpecContentsRequest; + })(); + + v1.CreateApiSpecRequest = (function() { + + /** + * Properties of a CreateApiSpecRequest. + * @memberof google.cloud.apigeeregistry.v1 + * @interface ICreateApiSpecRequest + * @property {string|null} [parent] CreateApiSpecRequest parent + * @property {google.cloud.apigeeregistry.v1.IApiSpec|null} [apiSpec] CreateApiSpecRequest apiSpec + * @property {string|null} [apiSpecId] CreateApiSpecRequest apiSpecId + */ + + /** + * Constructs a new CreateApiSpecRequest. + * @memberof google.cloud.apigeeregistry.v1 + * @classdesc Represents a CreateApiSpecRequest. + * @implements ICreateApiSpecRequest + * @constructor + * @param {google.cloud.apigeeregistry.v1.ICreateApiSpecRequest=} [properties] Properties to set + */ + function CreateApiSpecRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * CreateApiSpecRequest parent. + * @member {string} parent + * @memberof google.cloud.apigeeregistry.v1.CreateApiSpecRequest + * @instance + */ + CreateApiSpecRequest.prototype.parent = ""; + + /** + * CreateApiSpecRequest apiSpec. + * @member {google.cloud.apigeeregistry.v1.IApiSpec|null|undefined} apiSpec + * @memberof google.cloud.apigeeregistry.v1.CreateApiSpecRequest + * @instance + */ + CreateApiSpecRequest.prototype.apiSpec = null; + + /** + * CreateApiSpecRequest apiSpecId. + * @member {string} apiSpecId + * @memberof google.cloud.apigeeregistry.v1.CreateApiSpecRequest + * @instance + */ + CreateApiSpecRequest.prototype.apiSpecId = ""; + + /** + * Creates a new CreateApiSpecRequest instance using the specified properties. + * @function create + * @memberof google.cloud.apigeeregistry.v1.CreateApiSpecRequest + * @static + * @param {google.cloud.apigeeregistry.v1.ICreateApiSpecRequest=} [properties] Properties to set + * @returns {google.cloud.apigeeregistry.v1.CreateApiSpecRequest} CreateApiSpecRequest instance + */ + CreateApiSpecRequest.create = function create(properties) { + return new CreateApiSpecRequest(properties); + }; + + /** + * Encodes the specified CreateApiSpecRequest message. Does not implicitly {@link google.cloud.apigeeregistry.v1.CreateApiSpecRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.apigeeregistry.v1.CreateApiSpecRequest + * @static + * @param {google.cloud.apigeeregistry.v1.ICreateApiSpecRequest} message CreateApiSpecRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateApiSpecRequest.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.apiSpec != null && Object.hasOwnProperty.call(message, "apiSpec")) + $root.google.cloud.apigeeregistry.v1.ApiSpec.encode(message.apiSpec, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.apiSpecId != null && Object.hasOwnProperty.call(message, "apiSpecId")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.apiSpecId); + return writer; + }; + + /** + * Encodes the specified CreateApiSpecRequest message, length delimited. Does not implicitly {@link google.cloud.apigeeregistry.v1.CreateApiSpecRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.apigeeregistry.v1.CreateApiSpecRequest + * @static + * @param {google.cloud.apigeeregistry.v1.ICreateApiSpecRequest} message CreateApiSpecRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateApiSpecRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CreateApiSpecRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.apigeeregistry.v1.CreateApiSpecRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.apigeeregistry.v1.CreateApiSpecRequest} CreateApiSpecRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateApiSpecRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.apigeeregistry.v1.CreateApiSpecRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.apiSpec = $root.google.cloud.apigeeregistry.v1.ApiSpec.decode(reader, reader.uint32()); + break; + } + case 3: { + message.apiSpecId = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CreateApiSpecRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.apigeeregistry.v1.CreateApiSpecRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.apigeeregistry.v1.CreateApiSpecRequest} CreateApiSpecRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateApiSpecRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CreateApiSpecRequest message. + * @function verify + * @memberof google.cloud.apigeeregistry.v1.CreateApiSpecRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CreateApiSpecRequest.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.apiSpec != null && message.hasOwnProperty("apiSpec")) { + var error = $root.google.cloud.apigeeregistry.v1.ApiSpec.verify(message.apiSpec); + if (error) + return "apiSpec." + error; + } + if (message.apiSpecId != null && message.hasOwnProperty("apiSpecId")) + if (!$util.isString(message.apiSpecId)) + return "apiSpecId: string expected"; + return null; + }; + + /** + * Creates a CreateApiSpecRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.apigeeregistry.v1.CreateApiSpecRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.apigeeregistry.v1.CreateApiSpecRequest} CreateApiSpecRequest + */ + CreateApiSpecRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.apigeeregistry.v1.CreateApiSpecRequest) + return object; + var message = new $root.google.cloud.apigeeregistry.v1.CreateApiSpecRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.apiSpec != null) { + if (typeof object.apiSpec !== "object") + throw TypeError(".google.cloud.apigeeregistry.v1.CreateApiSpecRequest.apiSpec: object expected"); + message.apiSpec = $root.google.cloud.apigeeregistry.v1.ApiSpec.fromObject(object.apiSpec); + } + if (object.apiSpecId != null) + message.apiSpecId = String(object.apiSpecId); + return message; + }; + + /** + * Creates a plain object from a CreateApiSpecRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.apigeeregistry.v1.CreateApiSpecRequest + * @static + * @param {google.cloud.apigeeregistry.v1.CreateApiSpecRequest} message CreateApiSpecRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CreateApiSpecRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.apiSpec = null; + object.apiSpecId = ""; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.apiSpec != null && message.hasOwnProperty("apiSpec")) + object.apiSpec = $root.google.cloud.apigeeregistry.v1.ApiSpec.toObject(message.apiSpec, options); + if (message.apiSpecId != null && message.hasOwnProperty("apiSpecId")) + object.apiSpecId = message.apiSpecId; + return object; + }; + + /** + * Converts this CreateApiSpecRequest to JSON. + * @function toJSON + * @memberof google.cloud.apigeeregistry.v1.CreateApiSpecRequest + * @instance + * @returns {Object.} JSON object + */ + CreateApiSpecRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CreateApiSpecRequest + * @function getTypeUrl + * @memberof google.cloud.apigeeregistry.v1.CreateApiSpecRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CreateApiSpecRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.apigeeregistry.v1.CreateApiSpecRequest"; + }; + + return CreateApiSpecRequest; + })(); + + v1.UpdateApiSpecRequest = (function() { + + /** + * Properties of an UpdateApiSpecRequest. + * @memberof google.cloud.apigeeregistry.v1 + * @interface IUpdateApiSpecRequest + * @property {google.cloud.apigeeregistry.v1.IApiSpec|null} [apiSpec] UpdateApiSpecRequest apiSpec + * @property {google.protobuf.IFieldMask|null} [updateMask] UpdateApiSpecRequest updateMask + * @property {boolean|null} [allowMissing] UpdateApiSpecRequest allowMissing + */ + + /** + * Constructs a new UpdateApiSpecRequest. + * @memberof google.cloud.apigeeregistry.v1 + * @classdesc Represents an UpdateApiSpecRequest. + * @implements IUpdateApiSpecRequest + * @constructor + * @param {google.cloud.apigeeregistry.v1.IUpdateApiSpecRequest=} [properties] Properties to set + */ + function UpdateApiSpecRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * UpdateApiSpecRequest apiSpec. + * @member {google.cloud.apigeeregistry.v1.IApiSpec|null|undefined} apiSpec + * @memberof google.cloud.apigeeregistry.v1.UpdateApiSpecRequest + * @instance + */ + UpdateApiSpecRequest.prototype.apiSpec = null; + + /** + * UpdateApiSpecRequest updateMask. + * @member {google.protobuf.IFieldMask|null|undefined} updateMask + * @memberof google.cloud.apigeeregistry.v1.UpdateApiSpecRequest + * @instance + */ + UpdateApiSpecRequest.prototype.updateMask = null; + + /** + * UpdateApiSpecRequest allowMissing. + * @member {boolean} allowMissing + * @memberof google.cloud.apigeeregistry.v1.UpdateApiSpecRequest + * @instance + */ + UpdateApiSpecRequest.prototype.allowMissing = false; + + /** + * Creates a new UpdateApiSpecRequest instance using the specified properties. + * @function create + * @memberof google.cloud.apigeeregistry.v1.UpdateApiSpecRequest + * @static + * @param {google.cloud.apigeeregistry.v1.IUpdateApiSpecRequest=} [properties] Properties to set + * @returns {google.cloud.apigeeregistry.v1.UpdateApiSpecRequest} UpdateApiSpecRequest instance + */ + UpdateApiSpecRequest.create = function create(properties) { + return new UpdateApiSpecRequest(properties); + }; + + /** + * Encodes the specified UpdateApiSpecRequest message. Does not implicitly {@link google.cloud.apigeeregistry.v1.UpdateApiSpecRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.apigeeregistry.v1.UpdateApiSpecRequest + * @static + * @param {google.cloud.apigeeregistry.v1.IUpdateApiSpecRequest} message UpdateApiSpecRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateApiSpecRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.apiSpec != null && Object.hasOwnProperty.call(message, "apiSpec")) + $root.google.cloud.apigeeregistry.v1.ApiSpec.encode(message.apiSpec, 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.allowMissing != null && Object.hasOwnProperty.call(message, "allowMissing")) + writer.uint32(/* id 3, wireType 0 =*/24).bool(message.allowMissing); + return writer; + }; + + /** + * Encodes the specified UpdateApiSpecRequest message, length delimited. Does not implicitly {@link google.cloud.apigeeregistry.v1.UpdateApiSpecRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.apigeeregistry.v1.UpdateApiSpecRequest + * @static + * @param {google.cloud.apigeeregistry.v1.IUpdateApiSpecRequest} message UpdateApiSpecRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateApiSpecRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an UpdateApiSpecRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.apigeeregistry.v1.UpdateApiSpecRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.apigeeregistry.v1.UpdateApiSpecRequest} UpdateApiSpecRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateApiSpecRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.apigeeregistry.v1.UpdateApiSpecRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.apiSpec = $root.google.cloud.apigeeregistry.v1.ApiSpec.decode(reader, reader.uint32()); + break; + } + case 2: { + message.updateMask = $root.google.protobuf.FieldMask.decode(reader, reader.uint32()); + break; + } + case 3: { + message.allowMissing = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an UpdateApiSpecRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.apigeeregistry.v1.UpdateApiSpecRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.apigeeregistry.v1.UpdateApiSpecRequest} UpdateApiSpecRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateApiSpecRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an UpdateApiSpecRequest message. + * @function verify + * @memberof google.cloud.apigeeregistry.v1.UpdateApiSpecRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + UpdateApiSpecRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.apiSpec != null && message.hasOwnProperty("apiSpec")) { + var error = $root.google.cloud.apigeeregistry.v1.ApiSpec.verify(message.apiSpec); + if (error) + return "apiSpec." + error; + } + if (message.updateMask != null && message.hasOwnProperty("updateMask")) { + var error = $root.google.protobuf.FieldMask.verify(message.updateMask); + if (error) + return "updateMask." + error; + } + if (message.allowMissing != null && message.hasOwnProperty("allowMissing")) + if (typeof message.allowMissing !== "boolean") + return "allowMissing: boolean expected"; + return null; + }; + + /** + * Creates an UpdateApiSpecRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.apigeeregistry.v1.UpdateApiSpecRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.apigeeregistry.v1.UpdateApiSpecRequest} UpdateApiSpecRequest + */ + UpdateApiSpecRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.apigeeregistry.v1.UpdateApiSpecRequest) + return object; + var message = new $root.google.cloud.apigeeregistry.v1.UpdateApiSpecRequest(); + if (object.apiSpec != null) { + if (typeof object.apiSpec !== "object") + throw TypeError(".google.cloud.apigeeregistry.v1.UpdateApiSpecRequest.apiSpec: object expected"); + message.apiSpec = $root.google.cloud.apigeeregistry.v1.ApiSpec.fromObject(object.apiSpec); + } + if (object.updateMask != null) { + if (typeof object.updateMask !== "object") + throw TypeError(".google.cloud.apigeeregistry.v1.UpdateApiSpecRequest.updateMask: object expected"); + message.updateMask = $root.google.protobuf.FieldMask.fromObject(object.updateMask); + } + if (object.allowMissing != null) + message.allowMissing = Boolean(object.allowMissing); + return message; + }; + + /** + * Creates a plain object from an UpdateApiSpecRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.apigeeregistry.v1.UpdateApiSpecRequest + * @static + * @param {google.cloud.apigeeregistry.v1.UpdateApiSpecRequest} message UpdateApiSpecRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + UpdateApiSpecRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.apiSpec = null; + object.updateMask = null; + object.allowMissing = false; + } + if (message.apiSpec != null && message.hasOwnProperty("apiSpec")) + object.apiSpec = $root.google.cloud.apigeeregistry.v1.ApiSpec.toObject(message.apiSpec, options); + if (message.updateMask != null && message.hasOwnProperty("updateMask")) + object.updateMask = $root.google.protobuf.FieldMask.toObject(message.updateMask, options); + if (message.allowMissing != null && message.hasOwnProperty("allowMissing")) + object.allowMissing = message.allowMissing; + return object; + }; + + /** + * Converts this UpdateApiSpecRequest to JSON. + * @function toJSON + * @memberof google.cloud.apigeeregistry.v1.UpdateApiSpecRequest + * @instance + * @returns {Object.} JSON object + */ + UpdateApiSpecRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for UpdateApiSpecRequest + * @function getTypeUrl + * @memberof google.cloud.apigeeregistry.v1.UpdateApiSpecRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + UpdateApiSpecRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.apigeeregistry.v1.UpdateApiSpecRequest"; + }; + + return UpdateApiSpecRequest; + })(); + + v1.DeleteApiSpecRequest = (function() { + + /** + * Properties of a DeleteApiSpecRequest. + * @memberof google.cloud.apigeeregistry.v1 + * @interface IDeleteApiSpecRequest + * @property {string|null} [name] DeleteApiSpecRequest name + * @property {boolean|null} [force] DeleteApiSpecRequest force + */ + + /** + * Constructs a new DeleteApiSpecRequest. + * @memberof google.cloud.apigeeregistry.v1 + * @classdesc Represents a DeleteApiSpecRequest. + * @implements IDeleteApiSpecRequest + * @constructor + * @param {google.cloud.apigeeregistry.v1.IDeleteApiSpecRequest=} [properties] Properties to set + */ + function DeleteApiSpecRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * DeleteApiSpecRequest name. + * @member {string} name + * @memberof google.cloud.apigeeregistry.v1.DeleteApiSpecRequest + * @instance + */ + DeleteApiSpecRequest.prototype.name = ""; + + /** + * DeleteApiSpecRequest force. + * @member {boolean} force + * @memberof google.cloud.apigeeregistry.v1.DeleteApiSpecRequest + * @instance + */ + DeleteApiSpecRequest.prototype.force = false; + + /** + * Creates a new DeleteApiSpecRequest instance using the specified properties. + * @function create + * @memberof google.cloud.apigeeregistry.v1.DeleteApiSpecRequest + * @static + * @param {google.cloud.apigeeregistry.v1.IDeleteApiSpecRequest=} [properties] Properties to set + * @returns {google.cloud.apigeeregistry.v1.DeleteApiSpecRequest} DeleteApiSpecRequest instance + */ + DeleteApiSpecRequest.create = function create(properties) { + return new DeleteApiSpecRequest(properties); + }; + + /** + * Encodes the specified DeleteApiSpecRequest message. Does not implicitly {@link google.cloud.apigeeregistry.v1.DeleteApiSpecRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.apigeeregistry.v1.DeleteApiSpecRequest + * @static + * @param {google.cloud.apigeeregistry.v1.IDeleteApiSpecRequest} message DeleteApiSpecRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteApiSpecRequest.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.force != null && Object.hasOwnProperty.call(message, "force")) + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.force); + return writer; + }; + + /** + * Encodes the specified DeleteApiSpecRequest message, length delimited. Does not implicitly {@link google.cloud.apigeeregistry.v1.DeleteApiSpecRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.apigeeregistry.v1.DeleteApiSpecRequest + * @static + * @param {google.cloud.apigeeregistry.v1.IDeleteApiSpecRequest} message DeleteApiSpecRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteApiSpecRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DeleteApiSpecRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.apigeeregistry.v1.DeleteApiSpecRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.apigeeregistry.v1.DeleteApiSpecRequest} DeleteApiSpecRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteApiSpecRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.apigeeregistry.v1.DeleteApiSpecRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.force = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DeleteApiSpecRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.apigeeregistry.v1.DeleteApiSpecRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.apigeeregistry.v1.DeleteApiSpecRequest} DeleteApiSpecRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteApiSpecRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DeleteApiSpecRequest message. + * @function verify + * @memberof google.cloud.apigeeregistry.v1.DeleteApiSpecRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DeleteApiSpecRequest.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.force != null && message.hasOwnProperty("force")) + if (typeof message.force !== "boolean") + return "force: boolean expected"; + return null; + }; + + /** + * Creates a DeleteApiSpecRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.apigeeregistry.v1.DeleteApiSpecRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.apigeeregistry.v1.DeleteApiSpecRequest} DeleteApiSpecRequest + */ + DeleteApiSpecRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.apigeeregistry.v1.DeleteApiSpecRequest) + return object; + var message = new $root.google.cloud.apigeeregistry.v1.DeleteApiSpecRequest(); + if (object.name != null) + message.name = String(object.name); + if (object.force != null) + message.force = Boolean(object.force); + return message; + }; + + /** + * Creates a plain object from a DeleteApiSpecRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.apigeeregistry.v1.DeleteApiSpecRequest + * @static + * @param {google.cloud.apigeeregistry.v1.DeleteApiSpecRequest} message DeleteApiSpecRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DeleteApiSpecRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.force = false; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.force != null && message.hasOwnProperty("force")) + object.force = message.force; + return object; + }; + + /** + * Converts this DeleteApiSpecRequest to JSON. + * @function toJSON + * @memberof google.cloud.apigeeregistry.v1.DeleteApiSpecRequest + * @instance + * @returns {Object.} JSON object + */ + DeleteApiSpecRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DeleteApiSpecRequest + * @function getTypeUrl + * @memberof google.cloud.apigeeregistry.v1.DeleteApiSpecRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DeleteApiSpecRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.apigeeregistry.v1.DeleteApiSpecRequest"; + }; + + return DeleteApiSpecRequest; + })(); + + v1.TagApiSpecRevisionRequest = (function() { + + /** + * Properties of a TagApiSpecRevisionRequest. + * @memberof google.cloud.apigeeregistry.v1 + * @interface ITagApiSpecRevisionRequest + * @property {string|null} [name] TagApiSpecRevisionRequest name + * @property {string|null} [tag] TagApiSpecRevisionRequest tag + */ + + /** + * Constructs a new TagApiSpecRevisionRequest. + * @memberof google.cloud.apigeeregistry.v1 + * @classdesc Represents a TagApiSpecRevisionRequest. + * @implements ITagApiSpecRevisionRequest + * @constructor + * @param {google.cloud.apigeeregistry.v1.ITagApiSpecRevisionRequest=} [properties] Properties to set + */ + function TagApiSpecRevisionRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * TagApiSpecRevisionRequest name. + * @member {string} name + * @memberof google.cloud.apigeeregistry.v1.TagApiSpecRevisionRequest + * @instance + */ + TagApiSpecRevisionRequest.prototype.name = ""; + + /** + * TagApiSpecRevisionRequest tag. + * @member {string} tag + * @memberof google.cloud.apigeeregistry.v1.TagApiSpecRevisionRequest + * @instance + */ + TagApiSpecRevisionRequest.prototype.tag = ""; + + /** + * Creates a new TagApiSpecRevisionRequest instance using the specified properties. + * @function create + * @memberof google.cloud.apigeeregistry.v1.TagApiSpecRevisionRequest + * @static + * @param {google.cloud.apigeeregistry.v1.ITagApiSpecRevisionRequest=} [properties] Properties to set + * @returns {google.cloud.apigeeregistry.v1.TagApiSpecRevisionRequest} TagApiSpecRevisionRequest instance + */ + TagApiSpecRevisionRequest.create = function create(properties) { + return new TagApiSpecRevisionRequest(properties); + }; + + /** + * Encodes the specified TagApiSpecRevisionRequest message. Does not implicitly {@link google.cloud.apigeeregistry.v1.TagApiSpecRevisionRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.apigeeregistry.v1.TagApiSpecRevisionRequest + * @static + * @param {google.cloud.apigeeregistry.v1.ITagApiSpecRevisionRequest} message TagApiSpecRevisionRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TagApiSpecRevisionRequest.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.tag != null && Object.hasOwnProperty.call(message, "tag")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.tag); + return writer; + }; + + /** + * Encodes the specified TagApiSpecRevisionRequest message, length delimited. Does not implicitly {@link google.cloud.apigeeregistry.v1.TagApiSpecRevisionRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.apigeeregistry.v1.TagApiSpecRevisionRequest + * @static + * @param {google.cloud.apigeeregistry.v1.ITagApiSpecRevisionRequest} message TagApiSpecRevisionRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TagApiSpecRevisionRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a TagApiSpecRevisionRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.apigeeregistry.v1.TagApiSpecRevisionRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.apigeeregistry.v1.TagApiSpecRevisionRequest} TagApiSpecRevisionRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TagApiSpecRevisionRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.apigeeregistry.v1.TagApiSpecRevisionRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.tag = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a TagApiSpecRevisionRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.apigeeregistry.v1.TagApiSpecRevisionRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.apigeeregistry.v1.TagApiSpecRevisionRequest} TagApiSpecRevisionRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TagApiSpecRevisionRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a TagApiSpecRevisionRequest message. + * @function verify + * @memberof google.cloud.apigeeregistry.v1.TagApiSpecRevisionRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + TagApiSpecRevisionRequest.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.tag != null && message.hasOwnProperty("tag")) + if (!$util.isString(message.tag)) + return "tag: string expected"; + return null; + }; + + /** + * Creates a TagApiSpecRevisionRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.apigeeregistry.v1.TagApiSpecRevisionRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.apigeeregistry.v1.TagApiSpecRevisionRequest} TagApiSpecRevisionRequest + */ + TagApiSpecRevisionRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.apigeeregistry.v1.TagApiSpecRevisionRequest) + return object; + var message = new $root.google.cloud.apigeeregistry.v1.TagApiSpecRevisionRequest(); + if (object.name != null) + message.name = String(object.name); + if (object.tag != null) + message.tag = String(object.tag); + return message; + }; + + /** + * Creates a plain object from a TagApiSpecRevisionRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.apigeeregistry.v1.TagApiSpecRevisionRequest + * @static + * @param {google.cloud.apigeeregistry.v1.TagApiSpecRevisionRequest} message TagApiSpecRevisionRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + TagApiSpecRevisionRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.tag = ""; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.tag != null && message.hasOwnProperty("tag")) + object.tag = message.tag; + return object; + }; + + /** + * Converts this TagApiSpecRevisionRequest to JSON. + * @function toJSON + * @memberof google.cloud.apigeeregistry.v1.TagApiSpecRevisionRequest + * @instance + * @returns {Object.} JSON object + */ + TagApiSpecRevisionRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for TagApiSpecRevisionRequest + * @function getTypeUrl + * @memberof google.cloud.apigeeregistry.v1.TagApiSpecRevisionRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TagApiSpecRevisionRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.apigeeregistry.v1.TagApiSpecRevisionRequest"; + }; + + return TagApiSpecRevisionRequest; + })(); + + v1.ListApiSpecRevisionsRequest = (function() { + + /** + * Properties of a ListApiSpecRevisionsRequest. + * @memberof google.cloud.apigeeregistry.v1 + * @interface IListApiSpecRevisionsRequest + * @property {string|null} [name] ListApiSpecRevisionsRequest name + * @property {number|null} [pageSize] ListApiSpecRevisionsRequest pageSize + * @property {string|null} [pageToken] ListApiSpecRevisionsRequest pageToken + */ + + /** + * Constructs a new ListApiSpecRevisionsRequest. + * @memberof google.cloud.apigeeregistry.v1 + * @classdesc Represents a ListApiSpecRevisionsRequest. + * @implements IListApiSpecRevisionsRequest + * @constructor + * @param {google.cloud.apigeeregistry.v1.IListApiSpecRevisionsRequest=} [properties] Properties to set + */ + function ListApiSpecRevisionsRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListApiSpecRevisionsRequest name. + * @member {string} name + * @memberof google.cloud.apigeeregistry.v1.ListApiSpecRevisionsRequest + * @instance + */ + ListApiSpecRevisionsRequest.prototype.name = ""; + + /** + * ListApiSpecRevisionsRequest pageSize. + * @member {number} pageSize + * @memberof google.cloud.apigeeregistry.v1.ListApiSpecRevisionsRequest + * @instance + */ + ListApiSpecRevisionsRequest.prototype.pageSize = 0; + + /** + * ListApiSpecRevisionsRequest pageToken. + * @member {string} pageToken + * @memberof google.cloud.apigeeregistry.v1.ListApiSpecRevisionsRequest + * @instance + */ + ListApiSpecRevisionsRequest.prototype.pageToken = ""; + + /** + * Creates a new ListApiSpecRevisionsRequest instance using the specified properties. + * @function create + * @memberof google.cloud.apigeeregistry.v1.ListApiSpecRevisionsRequest + * @static + * @param {google.cloud.apigeeregistry.v1.IListApiSpecRevisionsRequest=} [properties] Properties to set + * @returns {google.cloud.apigeeregistry.v1.ListApiSpecRevisionsRequest} ListApiSpecRevisionsRequest instance + */ + ListApiSpecRevisionsRequest.create = function create(properties) { + return new ListApiSpecRevisionsRequest(properties); + }; + + /** + * Encodes the specified ListApiSpecRevisionsRequest message. Does not implicitly {@link google.cloud.apigeeregistry.v1.ListApiSpecRevisionsRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.apigeeregistry.v1.ListApiSpecRevisionsRequest + * @static + * @param {google.cloud.apigeeregistry.v1.IListApiSpecRevisionsRequest} message ListApiSpecRevisionsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListApiSpecRevisionsRequest.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.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 ListApiSpecRevisionsRequest message, length delimited. Does not implicitly {@link google.cloud.apigeeregistry.v1.ListApiSpecRevisionsRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.apigeeregistry.v1.ListApiSpecRevisionsRequest + * @static + * @param {google.cloud.apigeeregistry.v1.IListApiSpecRevisionsRequest} message ListApiSpecRevisionsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListApiSpecRevisionsRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListApiSpecRevisionsRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.apigeeregistry.v1.ListApiSpecRevisionsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.apigeeregistry.v1.ListApiSpecRevisionsRequest} ListApiSpecRevisionsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListApiSpecRevisionsRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.apigeeregistry.v1.ListApiSpecRevisionsRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = 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 ListApiSpecRevisionsRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.apigeeregistry.v1.ListApiSpecRevisionsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.apigeeregistry.v1.ListApiSpecRevisionsRequest} ListApiSpecRevisionsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListApiSpecRevisionsRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListApiSpecRevisionsRequest message. + * @function verify + * @memberof google.cloud.apigeeregistry.v1.ListApiSpecRevisionsRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListApiSpecRevisionsRequest.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.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 ListApiSpecRevisionsRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.apigeeregistry.v1.ListApiSpecRevisionsRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.apigeeregistry.v1.ListApiSpecRevisionsRequest} ListApiSpecRevisionsRequest + */ + ListApiSpecRevisionsRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.apigeeregistry.v1.ListApiSpecRevisionsRequest) + return object; + var message = new $root.google.cloud.apigeeregistry.v1.ListApiSpecRevisionsRequest(); + if (object.name != null) + message.name = String(object.name); + 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 ListApiSpecRevisionsRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.apigeeregistry.v1.ListApiSpecRevisionsRequest + * @static + * @param {google.cloud.apigeeregistry.v1.ListApiSpecRevisionsRequest} message ListApiSpecRevisionsRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListApiSpecRevisionsRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.pageSize = 0; + object.pageToken = ""; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + 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 ListApiSpecRevisionsRequest to JSON. + * @function toJSON + * @memberof google.cloud.apigeeregistry.v1.ListApiSpecRevisionsRequest + * @instance + * @returns {Object.} JSON object + */ + ListApiSpecRevisionsRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListApiSpecRevisionsRequest + * @function getTypeUrl + * @memberof google.cloud.apigeeregistry.v1.ListApiSpecRevisionsRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListApiSpecRevisionsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.apigeeregistry.v1.ListApiSpecRevisionsRequest"; + }; + + return ListApiSpecRevisionsRequest; + })(); + + v1.ListApiSpecRevisionsResponse = (function() { + + /** + * Properties of a ListApiSpecRevisionsResponse. + * @memberof google.cloud.apigeeregistry.v1 + * @interface IListApiSpecRevisionsResponse + * @property {Array.|null} [apiSpecs] ListApiSpecRevisionsResponse apiSpecs + * @property {string|null} [nextPageToken] ListApiSpecRevisionsResponse nextPageToken + */ + + /** + * Constructs a new ListApiSpecRevisionsResponse. + * @memberof google.cloud.apigeeregistry.v1 + * @classdesc Represents a ListApiSpecRevisionsResponse. + * @implements IListApiSpecRevisionsResponse + * @constructor + * @param {google.cloud.apigeeregistry.v1.IListApiSpecRevisionsResponse=} [properties] Properties to set + */ + function ListApiSpecRevisionsResponse(properties) { + this.apiSpecs = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListApiSpecRevisionsResponse apiSpecs. + * @member {Array.} apiSpecs + * @memberof google.cloud.apigeeregistry.v1.ListApiSpecRevisionsResponse + * @instance + */ + ListApiSpecRevisionsResponse.prototype.apiSpecs = $util.emptyArray; + + /** + * ListApiSpecRevisionsResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.cloud.apigeeregistry.v1.ListApiSpecRevisionsResponse + * @instance + */ + ListApiSpecRevisionsResponse.prototype.nextPageToken = ""; + + /** + * Creates a new ListApiSpecRevisionsResponse instance using the specified properties. + * @function create + * @memberof google.cloud.apigeeregistry.v1.ListApiSpecRevisionsResponse + * @static + * @param {google.cloud.apigeeregistry.v1.IListApiSpecRevisionsResponse=} [properties] Properties to set + * @returns {google.cloud.apigeeregistry.v1.ListApiSpecRevisionsResponse} ListApiSpecRevisionsResponse instance + */ + ListApiSpecRevisionsResponse.create = function create(properties) { + return new ListApiSpecRevisionsResponse(properties); + }; + + /** + * Encodes the specified ListApiSpecRevisionsResponse message. Does not implicitly {@link google.cloud.apigeeregistry.v1.ListApiSpecRevisionsResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.apigeeregistry.v1.ListApiSpecRevisionsResponse + * @static + * @param {google.cloud.apigeeregistry.v1.IListApiSpecRevisionsResponse} message ListApiSpecRevisionsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListApiSpecRevisionsResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.apiSpecs != null && message.apiSpecs.length) + for (var i = 0; i < message.apiSpecs.length; ++i) + $root.google.cloud.apigeeregistry.v1.ApiSpec.encode(message.apiSpecs[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 ListApiSpecRevisionsResponse message, length delimited. Does not implicitly {@link google.cloud.apigeeregistry.v1.ListApiSpecRevisionsResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.apigeeregistry.v1.ListApiSpecRevisionsResponse + * @static + * @param {google.cloud.apigeeregistry.v1.IListApiSpecRevisionsResponse} message ListApiSpecRevisionsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListApiSpecRevisionsResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListApiSpecRevisionsResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.apigeeregistry.v1.ListApiSpecRevisionsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.apigeeregistry.v1.ListApiSpecRevisionsResponse} ListApiSpecRevisionsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListApiSpecRevisionsResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.apigeeregistry.v1.ListApiSpecRevisionsResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.apiSpecs && message.apiSpecs.length)) + message.apiSpecs = []; + message.apiSpecs.push($root.google.cloud.apigeeregistry.v1.ApiSpec.decode(reader, reader.uint32())); + break; + } + case 2: { + message.nextPageToken = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListApiSpecRevisionsResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.apigeeregistry.v1.ListApiSpecRevisionsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.apigeeregistry.v1.ListApiSpecRevisionsResponse} ListApiSpecRevisionsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListApiSpecRevisionsResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListApiSpecRevisionsResponse message. + * @function verify + * @memberof google.cloud.apigeeregistry.v1.ListApiSpecRevisionsResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListApiSpecRevisionsResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.apiSpecs != null && message.hasOwnProperty("apiSpecs")) { + if (!Array.isArray(message.apiSpecs)) + return "apiSpecs: array expected"; + for (var i = 0; i < message.apiSpecs.length; ++i) { + var error = $root.google.cloud.apigeeregistry.v1.ApiSpec.verify(message.apiSpecs[i]); + if (error) + return "apiSpecs." + error; + } + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + return null; + }; + + /** + * Creates a ListApiSpecRevisionsResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.apigeeregistry.v1.ListApiSpecRevisionsResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.apigeeregistry.v1.ListApiSpecRevisionsResponse} ListApiSpecRevisionsResponse + */ + ListApiSpecRevisionsResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.apigeeregistry.v1.ListApiSpecRevisionsResponse) + return object; + var message = new $root.google.cloud.apigeeregistry.v1.ListApiSpecRevisionsResponse(); + if (object.apiSpecs) { + if (!Array.isArray(object.apiSpecs)) + throw TypeError(".google.cloud.apigeeregistry.v1.ListApiSpecRevisionsResponse.apiSpecs: array expected"); + message.apiSpecs = []; + for (var i = 0; i < object.apiSpecs.length; ++i) { + if (typeof object.apiSpecs[i] !== "object") + throw TypeError(".google.cloud.apigeeregistry.v1.ListApiSpecRevisionsResponse.apiSpecs: object expected"); + message.apiSpecs[i] = $root.google.cloud.apigeeregistry.v1.ApiSpec.fromObject(object.apiSpecs[i]); + } + } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + return message; + }; + + /** + * Creates a plain object from a ListApiSpecRevisionsResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.apigeeregistry.v1.ListApiSpecRevisionsResponse + * @static + * @param {google.cloud.apigeeregistry.v1.ListApiSpecRevisionsResponse} message ListApiSpecRevisionsResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListApiSpecRevisionsResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.apiSpecs = []; + if (options.defaults) + object.nextPageToken = ""; + if (message.apiSpecs && message.apiSpecs.length) { + object.apiSpecs = []; + for (var j = 0; j < message.apiSpecs.length; ++j) + object.apiSpecs[j] = $root.google.cloud.apigeeregistry.v1.ApiSpec.toObject(message.apiSpecs[j], options); + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + object.nextPageToken = message.nextPageToken; + return object; + }; + + /** + * Converts this ListApiSpecRevisionsResponse to JSON. + * @function toJSON + * @memberof google.cloud.apigeeregistry.v1.ListApiSpecRevisionsResponse + * @instance + * @returns {Object.} JSON object + */ + ListApiSpecRevisionsResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListApiSpecRevisionsResponse + * @function getTypeUrl + * @memberof google.cloud.apigeeregistry.v1.ListApiSpecRevisionsResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListApiSpecRevisionsResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.apigeeregistry.v1.ListApiSpecRevisionsResponse"; + }; + + return ListApiSpecRevisionsResponse; + })(); + + v1.RollbackApiSpecRequest = (function() { + + /** + * Properties of a RollbackApiSpecRequest. + * @memberof google.cloud.apigeeregistry.v1 + * @interface IRollbackApiSpecRequest + * @property {string|null} [name] RollbackApiSpecRequest name + * @property {string|null} [revisionId] RollbackApiSpecRequest revisionId + */ + + /** + * Constructs a new RollbackApiSpecRequest. + * @memberof google.cloud.apigeeregistry.v1 + * @classdesc Represents a RollbackApiSpecRequest. + * @implements IRollbackApiSpecRequest + * @constructor + * @param {google.cloud.apigeeregistry.v1.IRollbackApiSpecRequest=} [properties] Properties to set + */ + function RollbackApiSpecRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * RollbackApiSpecRequest name. + * @member {string} name + * @memberof google.cloud.apigeeregistry.v1.RollbackApiSpecRequest + * @instance + */ + RollbackApiSpecRequest.prototype.name = ""; + + /** + * RollbackApiSpecRequest revisionId. + * @member {string} revisionId + * @memberof google.cloud.apigeeregistry.v1.RollbackApiSpecRequest + * @instance + */ + RollbackApiSpecRequest.prototype.revisionId = ""; + + /** + * Creates a new RollbackApiSpecRequest instance using the specified properties. + * @function create + * @memberof google.cloud.apigeeregistry.v1.RollbackApiSpecRequest + * @static + * @param {google.cloud.apigeeregistry.v1.IRollbackApiSpecRequest=} [properties] Properties to set + * @returns {google.cloud.apigeeregistry.v1.RollbackApiSpecRequest} RollbackApiSpecRequest instance + */ + RollbackApiSpecRequest.create = function create(properties) { + return new RollbackApiSpecRequest(properties); + }; + + /** + * Encodes the specified RollbackApiSpecRequest message. Does not implicitly {@link google.cloud.apigeeregistry.v1.RollbackApiSpecRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.apigeeregistry.v1.RollbackApiSpecRequest + * @static + * @param {google.cloud.apigeeregistry.v1.IRollbackApiSpecRequest} message RollbackApiSpecRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RollbackApiSpecRequest.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.revisionId != null && Object.hasOwnProperty.call(message, "revisionId")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.revisionId); + return writer; + }; + + /** + * Encodes the specified RollbackApiSpecRequest message, length delimited. Does not implicitly {@link google.cloud.apigeeregistry.v1.RollbackApiSpecRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.apigeeregistry.v1.RollbackApiSpecRequest + * @static + * @param {google.cloud.apigeeregistry.v1.IRollbackApiSpecRequest} message RollbackApiSpecRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RollbackApiSpecRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a RollbackApiSpecRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.apigeeregistry.v1.RollbackApiSpecRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.apigeeregistry.v1.RollbackApiSpecRequest} RollbackApiSpecRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RollbackApiSpecRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.apigeeregistry.v1.RollbackApiSpecRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.revisionId = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a RollbackApiSpecRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.apigeeregistry.v1.RollbackApiSpecRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.apigeeregistry.v1.RollbackApiSpecRequest} RollbackApiSpecRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RollbackApiSpecRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a RollbackApiSpecRequest message. + * @function verify + * @memberof google.cloud.apigeeregistry.v1.RollbackApiSpecRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + RollbackApiSpecRequest.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.revisionId != null && message.hasOwnProperty("revisionId")) + if (!$util.isString(message.revisionId)) + return "revisionId: string expected"; + return null; + }; + + /** + * Creates a RollbackApiSpecRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.apigeeregistry.v1.RollbackApiSpecRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.apigeeregistry.v1.RollbackApiSpecRequest} RollbackApiSpecRequest + */ + RollbackApiSpecRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.apigeeregistry.v1.RollbackApiSpecRequest) + return object; + var message = new $root.google.cloud.apigeeregistry.v1.RollbackApiSpecRequest(); + if (object.name != null) + message.name = String(object.name); + if (object.revisionId != null) + message.revisionId = String(object.revisionId); + return message; + }; + + /** + * Creates a plain object from a RollbackApiSpecRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.apigeeregistry.v1.RollbackApiSpecRequest + * @static + * @param {google.cloud.apigeeregistry.v1.RollbackApiSpecRequest} message RollbackApiSpecRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + RollbackApiSpecRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.revisionId = ""; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.revisionId != null && message.hasOwnProperty("revisionId")) + object.revisionId = message.revisionId; + return object; + }; + + /** + * Converts this RollbackApiSpecRequest to JSON. + * @function toJSON + * @memberof google.cloud.apigeeregistry.v1.RollbackApiSpecRequest + * @instance + * @returns {Object.} JSON object + */ + RollbackApiSpecRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for RollbackApiSpecRequest + * @function getTypeUrl + * @memberof google.cloud.apigeeregistry.v1.RollbackApiSpecRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + RollbackApiSpecRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.apigeeregistry.v1.RollbackApiSpecRequest"; + }; + + return RollbackApiSpecRequest; + })(); + + v1.DeleteApiSpecRevisionRequest = (function() { + + /** + * Properties of a DeleteApiSpecRevisionRequest. + * @memberof google.cloud.apigeeregistry.v1 + * @interface IDeleteApiSpecRevisionRequest + * @property {string|null} [name] DeleteApiSpecRevisionRequest name + */ + + /** + * Constructs a new DeleteApiSpecRevisionRequest. + * @memberof google.cloud.apigeeregistry.v1 + * @classdesc Represents a DeleteApiSpecRevisionRequest. + * @implements IDeleteApiSpecRevisionRequest + * @constructor + * @param {google.cloud.apigeeregistry.v1.IDeleteApiSpecRevisionRequest=} [properties] Properties to set + */ + function DeleteApiSpecRevisionRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * DeleteApiSpecRevisionRequest name. + * @member {string} name + * @memberof google.cloud.apigeeregistry.v1.DeleteApiSpecRevisionRequest + * @instance + */ + DeleteApiSpecRevisionRequest.prototype.name = ""; + + /** + * Creates a new DeleteApiSpecRevisionRequest instance using the specified properties. + * @function create + * @memberof google.cloud.apigeeregistry.v1.DeleteApiSpecRevisionRequest + * @static + * @param {google.cloud.apigeeregistry.v1.IDeleteApiSpecRevisionRequest=} [properties] Properties to set + * @returns {google.cloud.apigeeregistry.v1.DeleteApiSpecRevisionRequest} DeleteApiSpecRevisionRequest instance + */ + DeleteApiSpecRevisionRequest.create = function create(properties) { + return new DeleteApiSpecRevisionRequest(properties); + }; + + /** + * Encodes the specified DeleteApiSpecRevisionRequest message. Does not implicitly {@link google.cloud.apigeeregistry.v1.DeleteApiSpecRevisionRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.apigeeregistry.v1.DeleteApiSpecRevisionRequest + * @static + * @param {google.cloud.apigeeregistry.v1.IDeleteApiSpecRevisionRequest} message DeleteApiSpecRevisionRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteApiSpecRevisionRequest.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 DeleteApiSpecRevisionRequest message, length delimited. Does not implicitly {@link google.cloud.apigeeregistry.v1.DeleteApiSpecRevisionRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.apigeeregistry.v1.DeleteApiSpecRevisionRequest + * @static + * @param {google.cloud.apigeeregistry.v1.IDeleteApiSpecRevisionRequest} message DeleteApiSpecRevisionRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteApiSpecRevisionRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DeleteApiSpecRevisionRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.apigeeregistry.v1.DeleteApiSpecRevisionRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.apigeeregistry.v1.DeleteApiSpecRevisionRequest} DeleteApiSpecRevisionRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteApiSpecRevisionRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.apigeeregistry.v1.DeleteApiSpecRevisionRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DeleteApiSpecRevisionRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.apigeeregistry.v1.DeleteApiSpecRevisionRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.apigeeregistry.v1.DeleteApiSpecRevisionRequest} DeleteApiSpecRevisionRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteApiSpecRevisionRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DeleteApiSpecRevisionRequest message. + * @function verify + * @memberof google.cloud.apigeeregistry.v1.DeleteApiSpecRevisionRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DeleteApiSpecRevisionRequest.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 DeleteApiSpecRevisionRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.apigeeregistry.v1.DeleteApiSpecRevisionRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.apigeeregistry.v1.DeleteApiSpecRevisionRequest} DeleteApiSpecRevisionRequest + */ + DeleteApiSpecRevisionRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.apigeeregistry.v1.DeleteApiSpecRevisionRequest) + return object; + var message = new $root.google.cloud.apigeeregistry.v1.DeleteApiSpecRevisionRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a DeleteApiSpecRevisionRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.apigeeregistry.v1.DeleteApiSpecRevisionRequest + * @static + * @param {google.cloud.apigeeregistry.v1.DeleteApiSpecRevisionRequest} message DeleteApiSpecRevisionRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DeleteApiSpecRevisionRequest.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 DeleteApiSpecRevisionRequest to JSON. + * @function toJSON + * @memberof google.cloud.apigeeregistry.v1.DeleteApiSpecRevisionRequest + * @instance + * @returns {Object.} JSON object + */ + DeleteApiSpecRevisionRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DeleteApiSpecRevisionRequest + * @function getTypeUrl + * @memberof google.cloud.apigeeregistry.v1.DeleteApiSpecRevisionRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DeleteApiSpecRevisionRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.apigeeregistry.v1.DeleteApiSpecRevisionRequest"; + }; + + return DeleteApiSpecRevisionRequest; + })(); + + v1.ListApiDeploymentsRequest = (function() { + + /** + * Properties of a ListApiDeploymentsRequest. + * @memberof google.cloud.apigeeregistry.v1 + * @interface IListApiDeploymentsRequest + * @property {string|null} [parent] ListApiDeploymentsRequest parent + * @property {number|null} [pageSize] ListApiDeploymentsRequest pageSize + * @property {string|null} [pageToken] ListApiDeploymentsRequest pageToken + * @property {string|null} [filter] ListApiDeploymentsRequest filter + */ + + /** + * Constructs a new ListApiDeploymentsRequest. + * @memberof google.cloud.apigeeregistry.v1 + * @classdesc Represents a ListApiDeploymentsRequest. + * @implements IListApiDeploymentsRequest + * @constructor + * @param {google.cloud.apigeeregistry.v1.IListApiDeploymentsRequest=} [properties] Properties to set + */ + function ListApiDeploymentsRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListApiDeploymentsRequest parent. + * @member {string} parent + * @memberof google.cloud.apigeeregistry.v1.ListApiDeploymentsRequest + * @instance + */ + ListApiDeploymentsRequest.prototype.parent = ""; + + /** + * ListApiDeploymentsRequest pageSize. + * @member {number} pageSize + * @memberof google.cloud.apigeeregistry.v1.ListApiDeploymentsRequest + * @instance + */ + ListApiDeploymentsRequest.prototype.pageSize = 0; + + /** + * ListApiDeploymentsRequest pageToken. + * @member {string} pageToken + * @memberof google.cloud.apigeeregistry.v1.ListApiDeploymentsRequest + * @instance + */ + ListApiDeploymentsRequest.prototype.pageToken = ""; + + /** + * ListApiDeploymentsRequest filter. + * @member {string} filter + * @memberof google.cloud.apigeeregistry.v1.ListApiDeploymentsRequest + * @instance + */ + ListApiDeploymentsRequest.prototype.filter = ""; + + /** + * Creates a new ListApiDeploymentsRequest instance using the specified properties. + * @function create + * @memberof google.cloud.apigeeregistry.v1.ListApiDeploymentsRequest + * @static + * @param {google.cloud.apigeeregistry.v1.IListApiDeploymentsRequest=} [properties] Properties to set + * @returns {google.cloud.apigeeregistry.v1.ListApiDeploymentsRequest} ListApiDeploymentsRequest instance + */ + ListApiDeploymentsRequest.create = function create(properties) { + return new ListApiDeploymentsRequest(properties); + }; + + /** + * Encodes the specified ListApiDeploymentsRequest message. Does not implicitly {@link google.cloud.apigeeregistry.v1.ListApiDeploymentsRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.apigeeregistry.v1.ListApiDeploymentsRequest + * @static + * @param {google.cloud.apigeeregistry.v1.IListApiDeploymentsRequest} message ListApiDeploymentsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListApiDeploymentsRequest.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.filter != null && Object.hasOwnProperty.call(message, "filter")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.filter); + return writer; + }; + + /** + * Encodes the specified ListApiDeploymentsRequest message, length delimited. Does not implicitly {@link google.cloud.apigeeregistry.v1.ListApiDeploymentsRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.apigeeregistry.v1.ListApiDeploymentsRequest + * @static + * @param {google.cloud.apigeeregistry.v1.IListApiDeploymentsRequest} message ListApiDeploymentsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListApiDeploymentsRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListApiDeploymentsRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.apigeeregistry.v1.ListApiDeploymentsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.apigeeregistry.v1.ListApiDeploymentsRequest} ListApiDeploymentsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListApiDeploymentsRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.apigeeregistry.v1.ListApiDeploymentsRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + 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.filter = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListApiDeploymentsRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.apigeeregistry.v1.ListApiDeploymentsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.apigeeregistry.v1.ListApiDeploymentsRequest} ListApiDeploymentsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListApiDeploymentsRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListApiDeploymentsRequest message. + * @function verify + * @memberof google.cloud.apigeeregistry.v1.ListApiDeploymentsRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListApiDeploymentsRequest.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.filter != null && message.hasOwnProperty("filter")) + if (!$util.isString(message.filter)) + return "filter: string expected"; + return null; + }; + + /** + * Creates a ListApiDeploymentsRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.apigeeregistry.v1.ListApiDeploymentsRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.apigeeregistry.v1.ListApiDeploymentsRequest} ListApiDeploymentsRequest + */ + ListApiDeploymentsRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.apigeeregistry.v1.ListApiDeploymentsRequest) + return object; + var message = new $root.google.cloud.apigeeregistry.v1.ListApiDeploymentsRequest(); + 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.filter != null) + message.filter = String(object.filter); + return message; + }; + + /** + * Creates a plain object from a ListApiDeploymentsRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.apigeeregistry.v1.ListApiDeploymentsRequest + * @static + * @param {google.cloud.apigeeregistry.v1.ListApiDeploymentsRequest} message ListApiDeploymentsRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListApiDeploymentsRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.pageSize = 0; + object.pageToken = ""; + object.filter = ""; + } + 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.filter != null && message.hasOwnProperty("filter")) + object.filter = message.filter; + return object; + }; + + /** + * Converts this ListApiDeploymentsRequest to JSON. + * @function toJSON + * @memberof google.cloud.apigeeregistry.v1.ListApiDeploymentsRequest + * @instance + * @returns {Object.} JSON object + */ + ListApiDeploymentsRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListApiDeploymentsRequest + * @function getTypeUrl + * @memberof google.cloud.apigeeregistry.v1.ListApiDeploymentsRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListApiDeploymentsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.apigeeregistry.v1.ListApiDeploymentsRequest"; + }; + + return ListApiDeploymentsRequest; + })(); + + v1.ListApiDeploymentsResponse = (function() { + + /** + * Properties of a ListApiDeploymentsResponse. + * @memberof google.cloud.apigeeregistry.v1 + * @interface IListApiDeploymentsResponse + * @property {Array.|null} [apiDeployments] ListApiDeploymentsResponse apiDeployments + * @property {string|null} [nextPageToken] ListApiDeploymentsResponse nextPageToken + */ + + /** + * Constructs a new ListApiDeploymentsResponse. + * @memberof google.cloud.apigeeregistry.v1 + * @classdesc Represents a ListApiDeploymentsResponse. + * @implements IListApiDeploymentsResponse + * @constructor + * @param {google.cloud.apigeeregistry.v1.IListApiDeploymentsResponse=} [properties] Properties to set + */ + function ListApiDeploymentsResponse(properties) { + this.apiDeployments = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListApiDeploymentsResponse apiDeployments. + * @member {Array.} apiDeployments + * @memberof google.cloud.apigeeregistry.v1.ListApiDeploymentsResponse + * @instance + */ + ListApiDeploymentsResponse.prototype.apiDeployments = $util.emptyArray; + + /** + * ListApiDeploymentsResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.cloud.apigeeregistry.v1.ListApiDeploymentsResponse + * @instance + */ + ListApiDeploymentsResponse.prototype.nextPageToken = ""; + + /** + * Creates a new ListApiDeploymentsResponse instance using the specified properties. + * @function create + * @memberof google.cloud.apigeeregistry.v1.ListApiDeploymentsResponse + * @static + * @param {google.cloud.apigeeregistry.v1.IListApiDeploymentsResponse=} [properties] Properties to set + * @returns {google.cloud.apigeeregistry.v1.ListApiDeploymentsResponse} ListApiDeploymentsResponse instance + */ + ListApiDeploymentsResponse.create = function create(properties) { + return new ListApiDeploymentsResponse(properties); + }; + + /** + * Encodes the specified ListApiDeploymentsResponse message. Does not implicitly {@link google.cloud.apigeeregistry.v1.ListApiDeploymentsResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.apigeeregistry.v1.ListApiDeploymentsResponse + * @static + * @param {google.cloud.apigeeregistry.v1.IListApiDeploymentsResponse} message ListApiDeploymentsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListApiDeploymentsResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.apiDeployments != null && message.apiDeployments.length) + for (var i = 0; i < message.apiDeployments.length; ++i) + $root.google.cloud.apigeeregistry.v1.ApiDeployment.encode(message.apiDeployments[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 ListApiDeploymentsResponse message, length delimited. Does not implicitly {@link google.cloud.apigeeregistry.v1.ListApiDeploymentsResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.apigeeregistry.v1.ListApiDeploymentsResponse + * @static + * @param {google.cloud.apigeeregistry.v1.IListApiDeploymentsResponse} message ListApiDeploymentsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListApiDeploymentsResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListApiDeploymentsResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.apigeeregistry.v1.ListApiDeploymentsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.apigeeregistry.v1.ListApiDeploymentsResponse} ListApiDeploymentsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListApiDeploymentsResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.apigeeregistry.v1.ListApiDeploymentsResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.apiDeployments && message.apiDeployments.length)) + message.apiDeployments = []; + message.apiDeployments.push($root.google.cloud.apigeeregistry.v1.ApiDeployment.decode(reader, reader.uint32())); + break; + } + case 2: { + message.nextPageToken = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListApiDeploymentsResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.apigeeregistry.v1.ListApiDeploymentsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.apigeeregistry.v1.ListApiDeploymentsResponse} ListApiDeploymentsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListApiDeploymentsResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListApiDeploymentsResponse message. + * @function verify + * @memberof google.cloud.apigeeregistry.v1.ListApiDeploymentsResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListApiDeploymentsResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.apiDeployments != null && message.hasOwnProperty("apiDeployments")) { + if (!Array.isArray(message.apiDeployments)) + return "apiDeployments: array expected"; + for (var i = 0; i < message.apiDeployments.length; ++i) { + var error = $root.google.cloud.apigeeregistry.v1.ApiDeployment.verify(message.apiDeployments[i]); + if (error) + return "apiDeployments." + error; + } + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + return null; + }; + + /** + * Creates a ListApiDeploymentsResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.apigeeregistry.v1.ListApiDeploymentsResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.apigeeregistry.v1.ListApiDeploymentsResponse} ListApiDeploymentsResponse + */ + ListApiDeploymentsResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.apigeeregistry.v1.ListApiDeploymentsResponse) + return object; + var message = new $root.google.cloud.apigeeregistry.v1.ListApiDeploymentsResponse(); + if (object.apiDeployments) { + if (!Array.isArray(object.apiDeployments)) + throw TypeError(".google.cloud.apigeeregistry.v1.ListApiDeploymentsResponse.apiDeployments: array expected"); + message.apiDeployments = []; + for (var i = 0; i < object.apiDeployments.length; ++i) { + if (typeof object.apiDeployments[i] !== "object") + throw TypeError(".google.cloud.apigeeregistry.v1.ListApiDeploymentsResponse.apiDeployments: object expected"); + message.apiDeployments[i] = $root.google.cloud.apigeeregistry.v1.ApiDeployment.fromObject(object.apiDeployments[i]); + } + } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + return message; + }; + + /** + * Creates a plain object from a ListApiDeploymentsResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.apigeeregistry.v1.ListApiDeploymentsResponse + * @static + * @param {google.cloud.apigeeregistry.v1.ListApiDeploymentsResponse} message ListApiDeploymentsResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListApiDeploymentsResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.apiDeployments = []; + if (options.defaults) + object.nextPageToken = ""; + if (message.apiDeployments && message.apiDeployments.length) { + object.apiDeployments = []; + for (var j = 0; j < message.apiDeployments.length; ++j) + object.apiDeployments[j] = $root.google.cloud.apigeeregistry.v1.ApiDeployment.toObject(message.apiDeployments[j], options); + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + object.nextPageToken = message.nextPageToken; + return object; + }; + + /** + * Converts this ListApiDeploymentsResponse to JSON. + * @function toJSON + * @memberof google.cloud.apigeeregistry.v1.ListApiDeploymentsResponse + * @instance + * @returns {Object.} JSON object + */ + ListApiDeploymentsResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListApiDeploymentsResponse + * @function getTypeUrl + * @memberof google.cloud.apigeeregistry.v1.ListApiDeploymentsResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListApiDeploymentsResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.apigeeregistry.v1.ListApiDeploymentsResponse"; + }; + + return ListApiDeploymentsResponse; + })(); + + v1.GetApiDeploymentRequest = (function() { + + /** + * Properties of a GetApiDeploymentRequest. + * @memberof google.cloud.apigeeregistry.v1 + * @interface IGetApiDeploymentRequest + * @property {string|null} [name] GetApiDeploymentRequest name + */ + + /** + * Constructs a new GetApiDeploymentRequest. + * @memberof google.cloud.apigeeregistry.v1 + * @classdesc Represents a GetApiDeploymentRequest. + * @implements IGetApiDeploymentRequest + * @constructor + * @param {google.cloud.apigeeregistry.v1.IGetApiDeploymentRequest=} [properties] Properties to set + */ + function GetApiDeploymentRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetApiDeploymentRequest name. + * @member {string} name + * @memberof google.cloud.apigeeregistry.v1.GetApiDeploymentRequest + * @instance + */ + GetApiDeploymentRequest.prototype.name = ""; + + /** + * Creates a new GetApiDeploymentRequest instance using the specified properties. + * @function create + * @memberof google.cloud.apigeeregistry.v1.GetApiDeploymentRequest + * @static + * @param {google.cloud.apigeeregistry.v1.IGetApiDeploymentRequest=} [properties] Properties to set + * @returns {google.cloud.apigeeregistry.v1.GetApiDeploymentRequest} GetApiDeploymentRequest instance + */ + GetApiDeploymentRequest.create = function create(properties) { + return new GetApiDeploymentRequest(properties); + }; + + /** + * Encodes the specified GetApiDeploymentRequest message. Does not implicitly {@link google.cloud.apigeeregistry.v1.GetApiDeploymentRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.apigeeregistry.v1.GetApiDeploymentRequest + * @static + * @param {google.cloud.apigeeregistry.v1.IGetApiDeploymentRequest} message GetApiDeploymentRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetApiDeploymentRequest.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 GetApiDeploymentRequest message, length delimited. Does not implicitly {@link google.cloud.apigeeregistry.v1.GetApiDeploymentRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.apigeeregistry.v1.GetApiDeploymentRequest + * @static + * @param {google.cloud.apigeeregistry.v1.IGetApiDeploymentRequest} message GetApiDeploymentRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetApiDeploymentRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetApiDeploymentRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.apigeeregistry.v1.GetApiDeploymentRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.apigeeregistry.v1.GetApiDeploymentRequest} GetApiDeploymentRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetApiDeploymentRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.apigeeregistry.v1.GetApiDeploymentRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetApiDeploymentRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.apigeeregistry.v1.GetApiDeploymentRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.apigeeregistry.v1.GetApiDeploymentRequest} GetApiDeploymentRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetApiDeploymentRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetApiDeploymentRequest message. + * @function verify + * @memberof google.cloud.apigeeregistry.v1.GetApiDeploymentRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetApiDeploymentRequest.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 GetApiDeploymentRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.apigeeregistry.v1.GetApiDeploymentRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.apigeeregistry.v1.GetApiDeploymentRequest} GetApiDeploymentRequest + */ + GetApiDeploymentRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.apigeeregistry.v1.GetApiDeploymentRequest) + return object; + var message = new $root.google.cloud.apigeeregistry.v1.GetApiDeploymentRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a GetApiDeploymentRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.apigeeregistry.v1.GetApiDeploymentRequest + * @static + * @param {google.cloud.apigeeregistry.v1.GetApiDeploymentRequest} message GetApiDeploymentRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetApiDeploymentRequest.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 GetApiDeploymentRequest to JSON. + * @function toJSON + * @memberof google.cloud.apigeeregistry.v1.GetApiDeploymentRequest + * @instance + * @returns {Object.} JSON object + */ + GetApiDeploymentRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GetApiDeploymentRequest + * @function getTypeUrl + * @memberof google.cloud.apigeeregistry.v1.GetApiDeploymentRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GetApiDeploymentRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.apigeeregistry.v1.GetApiDeploymentRequest"; + }; + + return GetApiDeploymentRequest; + })(); + + v1.CreateApiDeploymentRequest = (function() { + + /** + * Properties of a CreateApiDeploymentRequest. + * @memberof google.cloud.apigeeregistry.v1 + * @interface ICreateApiDeploymentRequest + * @property {string|null} [parent] CreateApiDeploymentRequest parent + * @property {google.cloud.apigeeregistry.v1.IApiDeployment|null} [apiDeployment] CreateApiDeploymentRequest apiDeployment + * @property {string|null} [apiDeploymentId] CreateApiDeploymentRequest apiDeploymentId + */ + + /** + * Constructs a new CreateApiDeploymentRequest. + * @memberof google.cloud.apigeeregistry.v1 + * @classdesc Represents a CreateApiDeploymentRequest. + * @implements ICreateApiDeploymentRequest + * @constructor + * @param {google.cloud.apigeeregistry.v1.ICreateApiDeploymentRequest=} [properties] Properties to set + */ + function CreateApiDeploymentRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * CreateApiDeploymentRequest parent. + * @member {string} parent + * @memberof google.cloud.apigeeregistry.v1.CreateApiDeploymentRequest + * @instance + */ + CreateApiDeploymentRequest.prototype.parent = ""; + + /** + * CreateApiDeploymentRequest apiDeployment. + * @member {google.cloud.apigeeregistry.v1.IApiDeployment|null|undefined} apiDeployment + * @memberof google.cloud.apigeeregistry.v1.CreateApiDeploymentRequest + * @instance + */ + CreateApiDeploymentRequest.prototype.apiDeployment = null; + + /** + * CreateApiDeploymentRequest apiDeploymentId. + * @member {string} apiDeploymentId + * @memberof google.cloud.apigeeregistry.v1.CreateApiDeploymentRequest + * @instance + */ + CreateApiDeploymentRequest.prototype.apiDeploymentId = ""; + + /** + * Creates a new CreateApiDeploymentRequest instance using the specified properties. + * @function create + * @memberof google.cloud.apigeeregistry.v1.CreateApiDeploymentRequest + * @static + * @param {google.cloud.apigeeregistry.v1.ICreateApiDeploymentRequest=} [properties] Properties to set + * @returns {google.cloud.apigeeregistry.v1.CreateApiDeploymentRequest} CreateApiDeploymentRequest instance + */ + CreateApiDeploymentRequest.create = function create(properties) { + return new CreateApiDeploymentRequest(properties); + }; + + /** + * Encodes the specified CreateApiDeploymentRequest message. Does not implicitly {@link google.cloud.apigeeregistry.v1.CreateApiDeploymentRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.apigeeregistry.v1.CreateApiDeploymentRequest + * @static + * @param {google.cloud.apigeeregistry.v1.ICreateApiDeploymentRequest} message CreateApiDeploymentRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateApiDeploymentRequest.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.apiDeployment != null && Object.hasOwnProperty.call(message, "apiDeployment")) + $root.google.cloud.apigeeregistry.v1.ApiDeployment.encode(message.apiDeployment, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.apiDeploymentId != null && Object.hasOwnProperty.call(message, "apiDeploymentId")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.apiDeploymentId); + return writer; + }; + + /** + * Encodes the specified CreateApiDeploymentRequest message, length delimited. Does not implicitly {@link google.cloud.apigeeregistry.v1.CreateApiDeploymentRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.apigeeregistry.v1.CreateApiDeploymentRequest + * @static + * @param {google.cloud.apigeeregistry.v1.ICreateApiDeploymentRequest} message CreateApiDeploymentRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateApiDeploymentRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CreateApiDeploymentRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.apigeeregistry.v1.CreateApiDeploymentRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.apigeeregistry.v1.CreateApiDeploymentRequest} CreateApiDeploymentRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateApiDeploymentRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.apigeeregistry.v1.CreateApiDeploymentRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.apiDeployment = $root.google.cloud.apigeeregistry.v1.ApiDeployment.decode(reader, reader.uint32()); + break; + } + case 3: { + message.apiDeploymentId = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CreateApiDeploymentRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.apigeeregistry.v1.CreateApiDeploymentRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.apigeeregistry.v1.CreateApiDeploymentRequest} CreateApiDeploymentRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateApiDeploymentRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CreateApiDeploymentRequest message. + * @function verify + * @memberof google.cloud.apigeeregistry.v1.CreateApiDeploymentRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CreateApiDeploymentRequest.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.apiDeployment != null && message.hasOwnProperty("apiDeployment")) { + var error = $root.google.cloud.apigeeregistry.v1.ApiDeployment.verify(message.apiDeployment); + if (error) + return "apiDeployment." + error; + } + if (message.apiDeploymentId != null && message.hasOwnProperty("apiDeploymentId")) + if (!$util.isString(message.apiDeploymentId)) + return "apiDeploymentId: string expected"; + return null; + }; + + /** + * Creates a CreateApiDeploymentRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.apigeeregistry.v1.CreateApiDeploymentRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.apigeeregistry.v1.CreateApiDeploymentRequest} CreateApiDeploymentRequest + */ + CreateApiDeploymentRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.apigeeregistry.v1.CreateApiDeploymentRequest) + return object; + var message = new $root.google.cloud.apigeeregistry.v1.CreateApiDeploymentRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.apiDeployment != null) { + if (typeof object.apiDeployment !== "object") + throw TypeError(".google.cloud.apigeeregistry.v1.CreateApiDeploymentRequest.apiDeployment: object expected"); + message.apiDeployment = $root.google.cloud.apigeeregistry.v1.ApiDeployment.fromObject(object.apiDeployment); + } + if (object.apiDeploymentId != null) + message.apiDeploymentId = String(object.apiDeploymentId); + return message; + }; + + /** + * Creates a plain object from a CreateApiDeploymentRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.apigeeregistry.v1.CreateApiDeploymentRequest + * @static + * @param {google.cloud.apigeeregistry.v1.CreateApiDeploymentRequest} message CreateApiDeploymentRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CreateApiDeploymentRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.apiDeployment = null; + object.apiDeploymentId = ""; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.apiDeployment != null && message.hasOwnProperty("apiDeployment")) + object.apiDeployment = $root.google.cloud.apigeeregistry.v1.ApiDeployment.toObject(message.apiDeployment, options); + if (message.apiDeploymentId != null && message.hasOwnProperty("apiDeploymentId")) + object.apiDeploymentId = message.apiDeploymentId; + return object; + }; + + /** + * Converts this CreateApiDeploymentRequest to JSON. + * @function toJSON + * @memberof google.cloud.apigeeregistry.v1.CreateApiDeploymentRequest + * @instance + * @returns {Object.} JSON object + */ + CreateApiDeploymentRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CreateApiDeploymentRequest + * @function getTypeUrl + * @memberof google.cloud.apigeeregistry.v1.CreateApiDeploymentRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CreateApiDeploymentRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.apigeeregistry.v1.CreateApiDeploymentRequest"; + }; + + return CreateApiDeploymentRequest; + })(); + + v1.UpdateApiDeploymentRequest = (function() { + + /** + * Properties of an UpdateApiDeploymentRequest. + * @memberof google.cloud.apigeeregistry.v1 + * @interface IUpdateApiDeploymentRequest + * @property {google.cloud.apigeeregistry.v1.IApiDeployment|null} [apiDeployment] UpdateApiDeploymentRequest apiDeployment + * @property {google.protobuf.IFieldMask|null} [updateMask] UpdateApiDeploymentRequest updateMask + * @property {boolean|null} [allowMissing] UpdateApiDeploymentRequest allowMissing + */ + + /** + * Constructs a new UpdateApiDeploymentRequest. + * @memberof google.cloud.apigeeregistry.v1 + * @classdesc Represents an UpdateApiDeploymentRequest. + * @implements IUpdateApiDeploymentRequest + * @constructor + * @param {google.cloud.apigeeregistry.v1.IUpdateApiDeploymentRequest=} [properties] Properties to set + */ + function UpdateApiDeploymentRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * UpdateApiDeploymentRequest apiDeployment. + * @member {google.cloud.apigeeregistry.v1.IApiDeployment|null|undefined} apiDeployment + * @memberof google.cloud.apigeeregistry.v1.UpdateApiDeploymentRequest + * @instance + */ + UpdateApiDeploymentRequest.prototype.apiDeployment = null; + + /** + * UpdateApiDeploymentRequest updateMask. + * @member {google.protobuf.IFieldMask|null|undefined} updateMask + * @memberof google.cloud.apigeeregistry.v1.UpdateApiDeploymentRequest + * @instance + */ + UpdateApiDeploymentRequest.prototype.updateMask = null; + + /** + * UpdateApiDeploymentRequest allowMissing. + * @member {boolean} allowMissing + * @memberof google.cloud.apigeeregistry.v1.UpdateApiDeploymentRequest + * @instance + */ + UpdateApiDeploymentRequest.prototype.allowMissing = false; + + /** + * Creates a new UpdateApiDeploymentRequest instance using the specified properties. + * @function create + * @memberof google.cloud.apigeeregistry.v1.UpdateApiDeploymentRequest + * @static + * @param {google.cloud.apigeeregistry.v1.IUpdateApiDeploymentRequest=} [properties] Properties to set + * @returns {google.cloud.apigeeregistry.v1.UpdateApiDeploymentRequest} UpdateApiDeploymentRequest instance + */ + UpdateApiDeploymentRequest.create = function create(properties) { + return new UpdateApiDeploymentRequest(properties); + }; + + /** + * Encodes the specified UpdateApiDeploymentRequest message. Does not implicitly {@link google.cloud.apigeeregistry.v1.UpdateApiDeploymentRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.apigeeregistry.v1.UpdateApiDeploymentRequest + * @static + * @param {google.cloud.apigeeregistry.v1.IUpdateApiDeploymentRequest} message UpdateApiDeploymentRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateApiDeploymentRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.apiDeployment != null && Object.hasOwnProperty.call(message, "apiDeployment")) + $root.google.cloud.apigeeregistry.v1.ApiDeployment.encode(message.apiDeployment, 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.allowMissing != null && Object.hasOwnProperty.call(message, "allowMissing")) + writer.uint32(/* id 3, wireType 0 =*/24).bool(message.allowMissing); + return writer; + }; + + /** + * Encodes the specified UpdateApiDeploymentRequest message, length delimited. Does not implicitly {@link google.cloud.apigeeregistry.v1.UpdateApiDeploymentRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.apigeeregistry.v1.UpdateApiDeploymentRequest + * @static + * @param {google.cloud.apigeeregistry.v1.IUpdateApiDeploymentRequest} message UpdateApiDeploymentRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateApiDeploymentRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an UpdateApiDeploymentRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.apigeeregistry.v1.UpdateApiDeploymentRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.apigeeregistry.v1.UpdateApiDeploymentRequest} UpdateApiDeploymentRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateApiDeploymentRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.apigeeregistry.v1.UpdateApiDeploymentRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.apiDeployment = $root.google.cloud.apigeeregistry.v1.ApiDeployment.decode(reader, reader.uint32()); + break; + } + case 2: { + message.updateMask = $root.google.protobuf.FieldMask.decode(reader, reader.uint32()); + break; + } + case 3: { + message.allowMissing = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an UpdateApiDeploymentRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.apigeeregistry.v1.UpdateApiDeploymentRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.apigeeregistry.v1.UpdateApiDeploymentRequest} UpdateApiDeploymentRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateApiDeploymentRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an UpdateApiDeploymentRequest message. + * @function verify + * @memberof google.cloud.apigeeregistry.v1.UpdateApiDeploymentRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + UpdateApiDeploymentRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.apiDeployment != null && message.hasOwnProperty("apiDeployment")) { + var error = $root.google.cloud.apigeeregistry.v1.ApiDeployment.verify(message.apiDeployment); + if (error) + return "apiDeployment." + error; + } + if (message.updateMask != null && message.hasOwnProperty("updateMask")) { + var error = $root.google.protobuf.FieldMask.verify(message.updateMask); + if (error) + return "updateMask." + error; + } + if (message.allowMissing != null && message.hasOwnProperty("allowMissing")) + if (typeof message.allowMissing !== "boolean") + return "allowMissing: boolean expected"; + return null; + }; + + /** + * Creates an UpdateApiDeploymentRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.apigeeregistry.v1.UpdateApiDeploymentRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.apigeeregistry.v1.UpdateApiDeploymentRequest} UpdateApiDeploymentRequest + */ + UpdateApiDeploymentRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.apigeeregistry.v1.UpdateApiDeploymentRequest) + return object; + var message = new $root.google.cloud.apigeeregistry.v1.UpdateApiDeploymentRequest(); + if (object.apiDeployment != null) { + if (typeof object.apiDeployment !== "object") + throw TypeError(".google.cloud.apigeeregistry.v1.UpdateApiDeploymentRequest.apiDeployment: object expected"); + message.apiDeployment = $root.google.cloud.apigeeregistry.v1.ApiDeployment.fromObject(object.apiDeployment); + } + if (object.updateMask != null) { + if (typeof object.updateMask !== "object") + throw TypeError(".google.cloud.apigeeregistry.v1.UpdateApiDeploymentRequest.updateMask: object expected"); + message.updateMask = $root.google.protobuf.FieldMask.fromObject(object.updateMask); + } + if (object.allowMissing != null) + message.allowMissing = Boolean(object.allowMissing); + return message; + }; + + /** + * Creates a plain object from an UpdateApiDeploymentRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.apigeeregistry.v1.UpdateApiDeploymentRequest + * @static + * @param {google.cloud.apigeeregistry.v1.UpdateApiDeploymentRequest} message UpdateApiDeploymentRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + UpdateApiDeploymentRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.apiDeployment = null; + object.updateMask = null; + object.allowMissing = false; + } + if (message.apiDeployment != null && message.hasOwnProperty("apiDeployment")) + object.apiDeployment = $root.google.cloud.apigeeregistry.v1.ApiDeployment.toObject(message.apiDeployment, options); + if (message.updateMask != null && message.hasOwnProperty("updateMask")) + object.updateMask = $root.google.protobuf.FieldMask.toObject(message.updateMask, options); + if (message.allowMissing != null && message.hasOwnProperty("allowMissing")) + object.allowMissing = message.allowMissing; + return object; + }; + + /** + * Converts this UpdateApiDeploymentRequest to JSON. + * @function toJSON + * @memberof google.cloud.apigeeregistry.v1.UpdateApiDeploymentRequest + * @instance + * @returns {Object.} JSON object + */ + UpdateApiDeploymentRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for UpdateApiDeploymentRequest + * @function getTypeUrl + * @memberof google.cloud.apigeeregistry.v1.UpdateApiDeploymentRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + UpdateApiDeploymentRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.apigeeregistry.v1.UpdateApiDeploymentRequest"; + }; + + return UpdateApiDeploymentRequest; + })(); + + v1.DeleteApiDeploymentRequest = (function() { + + /** + * Properties of a DeleteApiDeploymentRequest. + * @memberof google.cloud.apigeeregistry.v1 + * @interface IDeleteApiDeploymentRequest + * @property {string|null} [name] DeleteApiDeploymentRequest name + * @property {boolean|null} [force] DeleteApiDeploymentRequest force + */ + + /** + * Constructs a new DeleteApiDeploymentRequest. + * @memberof google.cloud.apigeeregistry.v1 + * @classdesc Represents a DeleteApiDeploymentRequest. + * @implements IDeleteApiDeploymentRequest + * @constructor + * @param {google.cloud.apigeeregistry.v1.IDeleteApiDeploymentRequest=} [properties] Properties to set + */ + function DeleteApiDeploymentRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * DeleteApiDeploymentRequest name. + * @member {string} name + * @memberof google.cloud.apigeeregistry.v1.DeleteApiDeploymentRequest + * @instance + */ + DeleteApiDeploymentRequest.prototype.name = ""; + + /** + * DeleteApiDeploymentRequest force. + * @member {boolean} force + * @memberof google.cloud.apigeeregistry.v1.DeleteApiDeploymentRequest + * @instance + */ + DeleteApiDeploymentRequest.prototype.force = false; + + /** + * Creates a new DeleteApiDeploymentRequest instance using the specified properties. + * @function create + * @memberof google.cloud.apigeeregistry.v1.DeleteApiDeploymentRequest + * @static + * @param {google.cloud.apigeeregistry.v1.IDeleteApiDeploymentRequest=} [properties] Properties to set + * @returns {google.cloud.apigeeregistry.v1.DeleteApiDeploymentRequest} DeleteApiDeploymentRequest instance + */ + DeleteApiDeploymentRequest.create = function create(properties) { + return new DeleteApiDeploymentRequest(properties); + }; + + /** + * Encodes the specified DeleteApiDeploymentRequest message. Does not implicitly {@link google.cloud.apigeeregistry.v1.DeleteApiDeploymentRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.apigeeregistry.v1.DeleteApiDeploymentRequest + * @static + * @param {google.cloud.apigeeregistry.v1.IDeleteApiDeploymentRequest} message DeleteApiDeploymentRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteApiDeploymentRequest.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.force != null && Object.hasOwnProperty.call(message, "force")) + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.force); + return writer; + }; + + /** + * Encodes the specified DeleteApiDeploymentRequest message, length delimited. Does not implicitly {@link google.cloud.apigeeregistry.v1.DeleteApiDeploymentRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.apigeeregistry.v1.DeleteApiDeploymentRequest + * @static + * @param {google.cloud.apigeeregistry.v1.IDeleteApiDeploymentRequest} message DeleteApiDeploymentRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteApiDeploymentRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DeleteApiDeploymentRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.apigeeregistry.v1.DeleteApiDeploymentRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.apigeeregistry.v1.DeleteApiDeploymentRequest} DeleteApiDeploymentRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteApiDeploymentRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.apigeeregistry.v1.DeleteApiDeploymentRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.force = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DeleteApiDeploymentRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.apigeeregistry.v1.DeleteApiDeploymentRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.apigeeregistry.v1.DeleteApiDeploymentRequest} DeleteApiDeploymentRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteApiDeploymentRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DeleteApiDeploymentRequest message. + * @function verify + * @memberof google.cloud.apigeeregistry.v1.DeleteApiDeploymentRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DeleteApiDeploymentRequest.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.force != null && message.hasOwnProperty("force")) + if (typeof message.force !== "boolean") + return "force: boolean expected"; + return null; + }; + + /** + * Creates a DeleteApiDeploymentRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.apigeeregistry.v1.DeleteApiDeploymentRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.apigeeregistry.v1.DeleteApiDeploymentRequest} DeleteApiDeploymentRequest + */ + DeleteApiDeploymentRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.apigeeregistry.v1.DeleteApiDeploymentRequest) + return object; + var message = new $root.google.cloud.apigeeregistry.v1.DeleteApiDeploymentRequest(); + if (object.name != null) + message.name = String(object.name); + if (object.force != null) + message.force = Boolean(object.force); + return message; + }; + + /** + * Creates a plain object from a DeleteApiDeploymentRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.apigeeregistry.v1.DeleteApiDeploymentRequest + * @static + * @param {google.cloud.apigeeregistry.v1.DeleteApiDeploymentRequest} message DeleteApiDeploymentRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DeleteApiDeploymentRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.force = false; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.force != null && message.hasOwnProperty("force")) + object.force = message.force; + return object; + }; + + /** + * Converts this DeleteApiDeploymentRequest to JSON. + * @function toJSON + * @memberof google.cloud.apigeeregistry.v1.DeleteApiDeploymentRequest + * @instance + * @returns {Object.} JSON object + */ + DeleteApiDeploymentRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DeleteApiDeploymentRequest + * @function getTypeUrl + * @memberof google.cloud.apigeeregistry.v1.DeleteApiDeploymentRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DeleteApiDeploymentRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.apigeeregistry.v1.DeleteApiDeploymentRequest"; + }; + + return DeleteApiDeploymentRequest; + })(); + + v1.TagApiDeploymentRevisionRequest = (function() { + + /** + * Properties of a TagApiDeploymentRevisionRequest. + * @memberof google.cloud.apigeeregistry.v1 + * @interface ITagApiDeploymentRevisionRequest + * @property {string|null} [name] TagApiDeploymentRevisionRequest name + * @property {string|null} [tag] TagApiDeploymentRevisionRequest tag + */ + + /** + * Constructs a new TagApiDeploymentRevisionRequest. + * @memberof google.cloud.apigeeregistry.v1 + * @classdesc Represents a TagApiDeploymentRevisionRequest. + * @implements ITagApiDeploymentRevisionRequest + * @constructor + * @param {google.cloud.apigeeregistry.v1.ITagApiDeploymentRevisionRequest=} [properties] Properties to set + */ + function TagApiDeploymentRevisionRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * TagApiDeploymentRevisionRequest name. + * @member {string} name + * @memberof google.cloud.apigeeregistry.v1.TagApiDeploymentRevisionRequest + * @instance + */ + TagApiDeploymentRevisionRequest.prototype.name = ""; + + /** + * TagApiDeploymentRevisionRequest tag. + * @member {string} tag + * @memberof google.cloud.apigeeregistry.v1.TagApiDeploymentRevisionRequest + * @instance + */ + TagApiDeploymentRevisionRequest.prototype.tag = ""; + + /** + * Creates a new TagApiDeploymentRevisionRequest instance using the specified properties. + * @function create + * @memberof google.cloud.apigeeregistry.v1.TagApiDeploymentRevisionRequest + * @static + * @param {google.cloud.apigeeregistry.v1.ITagApiDeploymentRevisionRequest=} [properties] Properties to set + * @returns {google.cloud.apigeeregistry.v1.TagApiDeploymentRevisionRequest} TagApiDeploymentRevisionRequest instance + */ + TagApiDeploymentRevisionRequest.create = function create(properties) { + return new TagApiDeploymentRevisionRequest(properties); + }; + + /** + * Encodes the specified TagApiDeploymentRevisionRequest message. Does not implicitly {@link google.cloud.apigeeregistry.v1.TagApiDeploymentRevisionRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.apigeeregistry.v1.TagApiDeploymentRevisionRequest + * @static + * @param {google.cloud.apigeeregistry.v1.ITagApiDeploymentRevisionRequest} message TagApiDeploymentRevisionRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TagApiDeploymentRevisionRequest.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.tag != null && Object.hasOwnProperty.call(message, "tag")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.tag); + return writer; + }; + + /** + * Encodes the specified TagApiDeploymentRevisionRequest message, length delimited. Does not implicitly {@link google.cloud.apigeeregistry.v1.TagApiDeploymentRevisionRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.apigeeregistry.v1.TagApiDeploymentRevisionRequest + * @static + * @param {google.cloud.apigeeregistry.v1.ITagApiDeploymentRevisionRequest} message TagApiDeploymentRevisionRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TagApiDeploymentRevisionRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a TagApiDeploymentRevisionRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.apigeeregistry.v1.TagApiDeploymentRevisionRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.apigeeregistry.v1.TagApiDeploymentRevisionRequest} TagApiDeploymentRevisionRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TagApiDeploymentRevisionRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.apigeeregistry.v1.TagApiDeploymentRevisionRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.tag = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a TagApiDeploymentRevisionRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.apigeeregistry.v1.TagApiDeploymentRevisionRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.apigeeregistry.v1.TagApiDeploymentRevisionRequest} TagApiDeploymentRevisionRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TagApiDeploymentRevisionRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a TagApiDeploymentRevisionRequest message. + * @function verify + * @memberof google.cloud.apigeeregistry.v1.TagApiDeploymentRevisionRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + TagApiDeploymentRevisionRequest.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.tag != null && message.hasOwnProperty("tag")) + if (!$util.isString(message.tag)) + return "tag: string expected"; + return null; + }; + + /** + * Creates a TagApiDeploymentRevisionRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.apigeeregistry.v1.TagApiDeploymentRevisionRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.apigeeregistry.v1.TagApiDeploymentRevisionRequest} TagApiDeploymentRevisionRequest + */ + TagApiDeploymentRevisionRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.apigeeregistry.v1.TagApiDeploymentRevisionRequest) + return object; + var message = new $root.google.cloud.apigeeregistry.v1.TagApiDeploymentRevisionRequest(); + if (object.name != null) + message.name = String(object.name); + if (object.tag != null) + message.tag = String(object.tag); + return message; + }; + + /** + * Creates a plain object from a TagApiDeploymentRevisionRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.apigeeregistry.v1.TagApiDeploymentRevisionRequest + * @static + * @param {google.cloud.apigeeregistry.v1.TagApiDeploymentRevisionRequest} message TagApiDeploymentRevisionRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + TagApiDeploymentRevisionRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.tag = ""; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.tag != null && message.hasOwnProperty("tag")) + object.tag = message.tag; + return object; + }; + + /** + * Converts this TagApiDeploymentRevisionRequest to JSON. + * @function toJSON + * @memberof google.cloud.apigeeregistry.v1.TagApiDeploymentRevisionRequest + * @instance + * @returns {Object.} JSON object + */ + TagApiDeploymentRevisionRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for TagApiDeploymentRevisionRequest + * @function getTypeUrl + * @memberof google.cloud.apigeeregistry.v1.TagApiDeploymentRevisionRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TagApiDeploymentRevisionRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.apigeeregistry.v1.TagApiDeploymentRevisionRequest"; + }; + + return TagApiDeploymentRevisionRequest; + })(); + + v1.ListApiDeploymentRevisionsRequest = (function() { + + /** + * Properties of a ListApiDeploymentRevisionsRequest. + * @memberof google.cloud.apigeeregistry.v1 + * @interface IListApiDeploymentRevisionsRequest + * @property {string|null} [name] ListApiDeploymentRevisionsRequest name + * @property {number|null} [pageSize] ListApiDeploymentRevisionsRequest pageSize + * @property {string|null} [pageToken] ListApiDeploymentRevisionsRequest pageToken + */ + + /** + * Constructs a new ListApiDeploymentRevisionsRequest. + * @memberof google.cloud.apigeeregistry.v1 + * @classdesc Represents a ListApiDeploymentRevisionsRequest. + * @implements IListApiDeploymentRevisionsRequest + * @constructor + * @param {google.cloud.apigeeregistry.v1.IListApiDeploymentRevisionsRequest=} [properties] Properties to set + */ + function ListApiDeploymentRevisionsRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListApiDeploymentRevisionsRequest name. + * @member {string} name + * @memberof google.cloud.apigeeregistry.v1.ListApiDeploymentRevisionsRequest + * @instance + */ + ListApiDeploymentRevisionsRequest.prototype.name = ""; + + /** + * ListApiDeploymentRevisionsRequest pageSize. + * @member {number} pageSize + * @memberof google.cloud.apigeeregistry.v1.ListApiDeploymentRevisionsRequest + * @instance + */ + ListApiDeploymentRevisionsRequest.prototype.pageSize = 0; + + /** + * ListApiDeploymentRevisionsRequest pageToken. + * @member {string} pageToken + * @memberof google.cloud.apigeeregistry.v1.ListApiDeploymentRevisionsRequest + * @instance + */ + ListApiDeploymentRevisionsRequest.prototype.pageToken = ""; + + /** + * Creates a new ListApiDeploymentRevisionsRequest instance using the specified properties. + * @function create + * @memberof google.cloud.apigeeregistry.v1.ListApiDeploymentRevisionsRequest + * @static + * @param {google.cloud.apigeeregistry.v1.IListApiDeploymentRevisionsRequest=} [properties] Properties to set + * @returns {google.cloud.apigeeregistry.v1.ListApiDeploymentRevisionsRequest} ListApiDeploymentRevisionsRequest instance + */ + ListApiDeploymentRevisionsRequest.create = function create(properties) { + return new ListApiDeploymentRevisionsRequest(properties); + }; + + /** + * Encodes the specified ListApiDeploymentRevisionsRequest message. Does not implicitly {@link google.cloud.apigeeregistry.v1.ListApiDeploymentRevisionsRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.apigeeregistry.v1.ListApiDeploymentRevisionsRequest + * @static + * @param {google.cloud.apigeeregistry.v1.IListApiDeploymentRevisionsRequest} message ListApiDeploymentRevisionsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListApiDeploymentRevisionsRequest.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.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 ListApiDeploymentRevisionsRequest message, length delimited. Does not implicitly {@link google.cloud.apigeeregistry.v1.ListApiDeploymentRevisionsRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.apigeeregistry.v1.ListApiDeploymentRevisionsRequest + * @static + * @param {google.cloud.apigeeregistry.v1.IListApiDeploymentRevisionsRequest} message ListApiDeploymentRevisionsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListApiDeploymentRevisionsRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListApiDeploymentRevisionsRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.apigeeregistry.v1.ListApiDeploymentRevisionsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.apigeeregistry.v1.ListApiDeploymentRevisionsRequest} ListApiDeploymentRevisionsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListApiDeploymentRevisionsRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.apigeeregistry.v1.ListApiDeploymentRevisionsRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = 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 ListApiDeploymentRevisionsRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.apigeeregistry.v1.ListApiDeploymentRevisionsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.apigeeregistry.v1.ListApiDeploymentRevisionsRequest} ListApiDeploymentRevisionsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListApiDeploymentRevisionsRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListApiDeploymentRevisionsRequest message. + * @function verify + * @memberof google.cloud.apigeeregistry.v1.ListApiDeploymentRevisionsRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListApiDeploymentRevisionsRequest.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.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 ListApiDeploymentRevisionsRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.apigeeregistry.v1.ListApiDeploymentRevisionsRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.apigeeregistry.v1.ListApiDeploymentRevisionsRequest} ListApiDeploymentRevisionsRequest + */ + ListApiDeploymentRevisionsRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.apigeeregistry.v1.ListApiDeploymentRevisionsRequest) + return object; + var message = new $root.google.cloud.apigeeregistry.v1.ListApiDeploymentRevisionsRequest(); + if (object.name != null) + message.name = String(object.name); + 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 ListApiDeploymentRevisionsRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.apigeeregistry.v1.ListApiDeploymentRevisionsRequest + * @static + * @param {google.cloud.apigeeregistry.v1.ListApiDeploymentRevisionsRequest} message ListApiDeploymentRevisionsRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListApiDeploymentRevisionsRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.pageSize = 0; + object.pageToken = ""; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + 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 ListApiDeploymentRevisionsRequest to JSON. + * @function toJSON + * @memberof google.cloud.apigeeregistry.v1.ListApiDeploymentRevisionsRequest + * @instance + * @returns {Object.} JSON object + */ + ListApiDeploymentRevisionsRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListApiDeploymentRevisionsRequest + * @function getTypeUrl + * @memberof google.cloud.apigeeregistry.v1.ListApiDeploymentRevisionsRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListApiDeploymentRevisionsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.apigeeregistry.v1.ListApiDeploymentRevisionsRequest"; + }; + + return ListApiDeploymentRevisionsRequest; + })(); + + v1.ListApiDeploymentRevisionsResponse = (function() { + + /** + * Properties of a ListApiDeploymentRevisionsResponse. + * @memberof google.cloud.apigeeregistry.v1 + * @interface IListApiDeploymentRevisionsResponse + * @property {Array.|null} [apiDeployments] ListApiDeploymentRevisionsResponse apiDeployments + * @property {string|null} [nextPageToken] ListApiDeploymentRevisionsResponse nextPageToken + */ + + /** + * Constructs a new ListApiDeploymentRevisionsResponse. + * @memberof google.cloud.apigeeregistry.v1 + * @classdesc Represents a ListApiDeploymentRevisionsResponse. + * @implements IListApiDeploymentRevisionsResponse + * @constructor + * @param {google.cloud.apigeeregistry.v1.IListApiDeploymentRevisionsResponse=} [properties] Properties to set + */ + function ListApiDeploymentRevisionsResponse(properties) { + this.apiDeployments = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListApiDeploymentRevisionsResponse apiDeployments. + * @member {Array.} apiDeployments + * @memberof google.cloud.apigeeregistry.v1.ListApiDeploymentRevisionsResponse + * @instance + */ + ListApiDeploymentRevisionsResponse.prototype.apiDeployments = $util.emptyArray; + + /** + * ListApiDeploymentRevisionsResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.cloud.apigeeregistry.v1.ListApiDeploymentRevisionsResponse + * @instance + */ + ListApiDeploymentRevisionsResponse.prototype.nextPageToken = ""; + + /** + * Creates a new ListApiDeploymentRevisionsResponse instance using the specified properties. + * @function create + * @memberof google.cloud.apigeeregistry.v1.ListApiDeploymentRevisionsResponse + * @static + * @param {google.cloud.apigeeregistry.v1.IListApiDeploymentRevisionsResponse=} [properties] Properties to set + * @returns {google.cloud.apigeeregistry.v1.ListApiDeploymentRevisionsResponse} ListApiDeploymentRevisionsResponse instance + */ + ListApiDeploymentRevisionsResponse.create = function create(properties) { + return new ListApiDeploymentRevisionsResponse(properties); + }; + + /** + * Encodes the specified ListApiDeploymentRevisionsResponse message. Does not implicitly {@link google.cloud.apigeeregistry.v1.ListApiDeploymentRevisionsResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.apigeeregistry.v1.ListApiDeploymentRevisionsResponse + * @static + * @param {google.cloud.apigeeregistry.v1.IListApiDeploymentRevisionsResponse} message ListApiDeploymentRevisionsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListApiDeploymentRevisionsResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.apiDeployments != null && message.apiDeployments.length) + for (var i = 0; i < message.apiDeployments.length; ++i) + $root.google.cloud.apigeeregistry.v1.ApiDeployment.encode(message.apiDeployments[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 ListApiDeploymentRevisionsResponse message, length delimited. Does not implicitly {@link google.cloud.apigeeregistry.v1.ListApiDeploymentRevisionsResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.apigeeregistry.v1.ListApiDeploymentRevisionsResponse + * @static + * @param {google.cloud.apigeeregistry.v1.IListApiDeploymentRevisionsResponse} message ListApiDeploymentRevisionsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListApiDeploymentRevisionsResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListApiDeploymentRevisionsResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.apigeeregistry.v1.ListApiDeploymentRevisionsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.apigeeregistry.v1.ListApiDeploymentRevisionsResponse} ListApiDeploymentRevisionsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListApiDeploymentRevisionsResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.apigeeregistry.v1.ListApiDeploymentRevisionsResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.apiDeployments && message.apiDeployments.length)) + message.apiDeployments = []; + message.apiDeployments.push($root.google.cloud.apigeeregistry.v1.ApiDeployment.decode(reader, reader.uint32())); + break; + } + case 2: { + message.nextPageToken = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListApiDeploymentRevisionsResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.apigeeregistry.v1.ListApiDeploymentRevisionsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.apigeeregistry.v1.ListApiDeploymentRevisionsResponse} ListApiDeploymentRevisionsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListApiDeploymentRevisionsResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListApiDeploymentRevisionsResponse message. + * @function verify + * @memberof google.cloud.apigeeregistry.v1.ListApiDeploymentRevisionsResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListApiDeploymentRevisionsResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.apiDeployments != null && message.hasOwnProperty("apiDeployments")) { + if (!Array.isArray(message.apiDeployments)) + return "apiDeployments: array expected"; + for (var i = 0; i < message.apiDeployments.length; ++i) { + var error = $root.google.cloud.apigeeregistry.v1.ApiDeployment.verify(message.apiDeployments[i]); + if (error) + return "apiDeployments." + error; + } + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + return null; + }; + + /** + * Creates a ListApiDeploymentRevisionsResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.apigeeregistry.v1.ListApiDeploymentRevisionsResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.apigeeregistry.v1.ListApiDeploymentRevisionsResponse} ListApiDeploymentRevisionsResponse + */ + ListApiDeploymentRevisionsResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.apigeeregistry.v1.ListApiDeploymentRevisionsResponse) + return object; + var message = new $root.google.cloud.apigeeregistry.v1.ListApiDeploymentRevisionsResponse(); + if (object.apiDeployments) { + if (!Array.isArray(object.apiDeployments)) + throw TypeError(".google.cloud.apigeeregistry.v1.ListApiDeploymentRevisionsResponse.apiDeployments: array expected"); + message.apiDeployments = []; + for (var i = 0; i < object.apiDeployments.length; ++i) { + if (typeof object.apiDeployments[i] !== "object") + throw TypeError(".google.cloud.apigeeregistry.v1.ListApiDeploymentRevisionsResponse.apiDeployments: object expected"); + message.apiDeployments[i] = $root.google.cloud.apigeeregistry.v1.ApiDeployment.fromObject(object.apiDeployments[i]); + } + } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + return message; + }; + + /** + * Creates a plain object from a ListApiDeploymentRevisionsResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.apigeeregistry.v1.ListApiDeploymentRevisionsResponse + * @static + * @param {google.cloud.apigeeregistry.v1.ListApiDeploymentRevisionsResponse} message ListApiDeploymentRevisionsResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListApiDeploymentRevisionsResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.apiDeployments = []; + if (options.defaults) + object.nextPageToken = ""; + if (message.apiDeployments && message.apiDeployments.length) { + object.apiDeployments = []; + for (var j = 0; j < message.apiDeployments.length; ++j) + object.apiDeployments[j] = $root.google.cloud.apigeeregistry.v1.ApiDeployment.toObject(message.apiDeployments[j], options); + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + object.nextPageToken = message.nextPageToken; + return object; + }; + + /** + * Converts this ListApiDeploymentRevisionsResponse to JSON. + * @function toJSON + * @memberof google.cloud.apigeeregistry.v1.ListApiDeploymentRevisionsResponse + * @instance + * @returns {Object.} JSON object + */ + ListApiDeploymentRevisionsResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListApiDeploymentRevisionsResponse + * @function getTypeUrl + * @memberof google.cloud.apigeeregistry.v1.ListApiDeploymentRevisionsResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListApiDeploymentRevisionsResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.apigeeregistry.v1.ListApiDeploymentRevisionsResponse"; + }; + + return ListApiDeploymentRevisionsResponse; + })(); + + v1.RollbackApiDeploymentRequest = (function() { + + /** + * Properties of a RollbackApiDeploymentRequest. + * @memberof google.cloud.apigeeregistry.v1 + * @interface IRollbackApiDeploymentRequest + * @property {string|null} [name] RollbackApiDeploymentRequest name + * @property {string|null} [revisionId] RollbackApiDeploymentRequest revisionId + */ + + /** + * Constructs a new RollbackApiDeploymentRequest. + * @memberof google.cloud.apigeeregistry.v1 + * @classdesc Represents a RollbackApiDeploymentRequest. + * @implements IRollbackApiDeploymentRequest + * @constructor + * @param {google.cloud.apigeeregistry.v1.IRollbackApiDeploymentRequest=} [properties] Properties to set + */ + function RollbackApiDeploymentRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * RollbackApiDeploymentRequest name. + * @member {string} name + * @memberof google.cloud.apigeeregistry.v1.RollbackApiDeploymentRequest + * @instance + */ + RollbackApiDeploymentRequest.prototype.name = ""; + + /** + * RollbackApiDeploymentRequest revisionId. + * @member {string} revisionId + * @memberof google.cloud.apigeeregistry.v1.RollbackApiDeploymentRequest + * @instance + */ + RollbackApiDeploymentRequest.prototype.revisionId = ""; + + /** + * Creates a new RollbackApiDeploymentRequest instance using the specified properties. + * @function create + * @memberof google.cloud.apigeeregistry.v1.RollbackApiDeploymentRequest + * @static + * @param {google.cloud.apigeeregistry.v1.IRollbackApiDeploymentRequest=} [properties] Properties to set + * @returns {google.cloud.apigeeregistry.v1.RollbackApiDeploymentRequest} RollbackApiDeploymentRequest instance + */ + RollbackApiDeploymentRequest.create = function create(properties) { + return new RollbackApiDeploymentRequest(properties); + }; + + /** + * Encodes the specified RollbackApiDeploymentRequest message. Does not implicitly {@link google.cloud.apigeeregistry.v1.RollbackApiDeploymentRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.apigeeregistry.v1.RollbackApiDeploymentRequest + * @static + * @param {google.cloud.apigeeregistry.v1.IRollbackApiDeploymentRequest} message RollbackApiDeploymentRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RollbackApiDeploymentRequest.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.revisionId != null && Object.hasOwnProperty.call(message, "revisionId")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.revisionId); + return writer; + }; + + /** + * Encodes the specified RollbackApiDeploymentRequest message, length delimited. Does not implicitly {@link google.cloud.apigeeregistry.v1.RollbackApiDeploymentRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.apigeeregistry.v1.RollbackApiDeploymentRequest + * @static + * @param {google.cloud.apigeeregistry.v1.IRollbackApiDeploymentRequest} message RollbackApiDeploymentRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RollbackApiDeploymentRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a RollbackApiDeploymentRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.apigeeregistry.v1.RollbackApiDeploymentRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.apigeeregistry.v1.RollbackApiDeploymentRequest} RollbackApiDeploymentRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RollbackApiDeploymentRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.apigeeregistry.v1.RollbackApiDeploymentRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.revisionId = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a RollbackApiDeploymentRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.apigeeregistry.v1.RollbackApiDeploymentRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.apigeeregistry.v1.RollbackApiDeploymentRequest} RollbackApiDeploymentRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RollbackApiDeploymentRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a RollbackApiDeploymentRequest message. + * @function verify + * @memberof google.cloud.apigeeregistry.v1.RollbackApiDeploymentRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + RollbackApiDeploymentRequest.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.revisionId != null && message.hasOwnProperty("revisionId")) + if (!$util.isString(message.revisionId)) + return "revisionId: string expected"; + return null; + }; + + /** + * Creates a RollbackApiDeploymentRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.apigeeregistry.v1.RollbackApiDeploymentRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.apigeeregistry.v1.RollbackApiDeploymentRequest} RollbackApiDeploymentRequest + */ + RollbackApiDeploymentRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.apigeeregistry.v1.RollbackApiDeploymentRequest) + return object; + var message = new $root.google.cloud.apigeeregistry.v1.RollbackApiDeploymentRequest(); + if (object.name != null) + message.name = String(object.name); + if (object.revisionId != null) + message.revisionId = String(object.revisionId); + return message; + }; + + /** + * Creates a plain object from a RollbackApiDeploymentRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.apigeeregistry.v1.RollbackApiDeploymentRequest + * @static + * @param {google.cloud.apigeeregistry.v1.RollbackApiDeploymentRequest} message RollbackApiDeploymentRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + RollbackApiDeploymentRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.revisionId = ""; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.revisionId != null && message.hasOwnProperty("revisionId")) + object.revisionId = message.revisionId; + return object; + }; + + /** + * Converts this RollbackApiDeploymentRequest to JSON. + * @function toJSON + * @memberof google.cloud.apigeeregistry.v1.RollbackApiDeploymentRequest + * @instance + * @returns {Object.} JSON object + */ + RollbackApiDeploymentRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for RollbackApiDeploymentRequest + * @function getTypeUrl + * @memberof google.cloud.apigeeregistry.v1.RollbackApiDeploymentRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + RollbackApiDeploymentRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.apigeeregistry.v1.RollbackApiDeploymentRequest"; + }; + + return RollbackApiDeploymentRequest; + })(); + + v1.DeleteApiDeploymentRevisionRequest = (function() { + + /** + * Properties of a DeleteApiDeploymentRevisionRequest. + * @memberof google.cloud.apigeeregistry.v1 + * @interface IDeleteApiDeploymentRevisionRequest + * @property {string|null} [name] DeleteApiDeploymentRevisionRequest name + */ + + /** + * Constructs a new DeleteApiDeploymentRevisionRequest. + * @memberof google.cloud.apigeeregistry.v1 + * @classdesc Represents a DeleteApiDeploymentRevisionRequest. + * @implements IDeleteApiDeploymentRevisionRequest + * @constructor + * @param {google.cloud.apigeeregistry.v1.IDeleteApiDeploymentRevisionRequest=} [properties] Properties to set + */ + function DeleteApiDeploymentRevisionRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * DeleteApiDeploymentRevisionRequest name. + * @member {string} name + * @memberof google.cloud.apigeeregistry.v1.DeleteApiDeploymentRevisionRequest + * @instance + */ + DeleteApiDeploymentRevisionRequest.prototype.name = ""; + + /** + * Creates a new DeleteApiDeploymentRevisionRequest instance using the specified properties. + * @function create + * @memberof google.cloud.apigeeregistry.v1.DeleteApiDeploymentRevisionRequest + * @static + * @param {google.cloud.apigeeregistry.v1.IDeleteApiDeploymentRevisionRequest=} [properties] Properties to set + * @returns {google.cloud.apigeeregistry.v1.DeleteApiDeploymentRevisionRequest} DeleteApiDeploymentRevisionRequest instance + */ + DeleteApiDeploymentRevisionRequest.create = function create(properties) { + return new DeleteApiDeploymentRevisionRequest(properties); + }; + + /** + * Encodes the specified DeleteApiDeploymentRevisionRequest message. Does not implicitly {@link google.cloud.apigeeregistry.v1.DeleteApiDeploymentRevisionRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.apigeeregistry.v1.DeleteApiDeploymentRevisionRequest + * @static + * @param {google.cloud.apigeeregistry.v1.IDeleteApiDeploymentRevisionRequest} message DeleteApiDeploymentRevisionRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteApiDeploymentRevisionRequest.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 DeleteApiDeploymentRevisionRequest message, length delimited. Does not implicitly {@link google.cloud.apigeeregistry.v1.DeleteApiDeploymentRevisionRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.apigeeregistry.v1.DeleteApiDeploymentRevisionRequest + * @static + * @param {google.cloud.apigeeregistry.v1.IDeleteApiDeploymentRevisionRequest} message DeleteApiDeploymentRevisionRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteApiDeploymentRevisionRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DeleteApiDeploymentRevisionRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.apigeeregistry.v1.DeleteApiDeploymentRevisionRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.apigeeregistry.v1.DeleteApiDeploymentRevisionRequest} DeleteApiDeploymentRevisionRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteApiDeploymentRevisionRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.apigeeregistry.v1.DeleteApiDeploymentRevisionRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DeleteApiDeploymentRevisionRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.apigeeregistry.v1.DeleteApiDeploymentRevisionRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.apigeeregistry.v1.DeleteApiDeploymentRevisionRequest} DeleteApiDeploymentRevisionRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteApiDeploymentRevisionRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DeleteApiDeploymentRevisionRequest message. + * @function verify + * @memberof google.cloud.apigeeregistry.v1.DeleteApiDeploymentRevisionRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DeleteApiDeploymentRevisionRequest.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 DeleteApiDeploymentRevisionRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.apigeeregistry.v1.DeleteApiDeploymentRevisionRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.apigeeregistry.v1.DeleteApiDeploymentRevisionRequest} DeleteApiDeploymentRevisionRequest + */ + DeleteApiDeploymentRevisionRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.apigeeregistry.v1.DeleteApiDeploymentRevisionRequest) + return object; + var message = new $root.google.cloud.apigeeregistry.v1.DeleteApiDeploymentRevisionRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a DeleteApiDeploymentRevisionRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.apigeeregistry.v1.DeleteApiDeploymentRevisionRequest + * @static + * @param {google.cloud.apigeeregistry.v1.DeleteApiDeploymentRevisionRequest} message DeleteApiDeploymentRevisionRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DeleteApiDeploymentRevisionRequest.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 DeleteApiDeploymentRevisionRequest to JSON. + * @function toJSON + * @memberof google.cloud.apigeeregistry.v1.DeleteApiDeploymentRevisionRequest + * @instance + * @returns {Object.} JSON object + */ + DeleteApiDeploymentRevisionRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DeleteApiDeploymentRevisionRequest + * @function getTypeUrl + * @memberof google.cloud.apigeeregistry.v1.DeleteApiDeploymentRevisionRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DeleteApiDeploymentRevisionRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.apigeeregistry.v1.DeleteApiDeploymentRevisionRequest"; + }; + + return DeleteApiDeploymentRevisionRequest; + })(); + + v1.ListArtifactsRequest = (function() { + + /** + * Properties of a ListArtifactsRequest. + * @memberof google.cloud.apigeeregistry.v1 + * @interface IListArtifactsRequest + * @property {string|null} [parent] ListArtifactsRequest parent + * @property {number|null} [pageSize] ListArtifactsRequest pageSize + * @property {string|null} [pageToken] ListArtifactsRequest pageToken + * @property {string|null} [filter] ListArtifactsRequest filter + */ + + /** + * Constructs a new ListArtifactsRequest. + * @memberof google.cloud.apigeeregistry.v1 + * @classdesc Represents a ListArtifactsRequest. + * @implements IListArtifactsRequest + * @constructor + * @param {google.cloud.apigeeregistry.v1.IListArtifactsRequest=} [properties] Properties to set + */ + function ListArtifactsRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListArtifactsRequest parent. + * @member {string} parent + * @memberof google.cloud.apigeeregistry.v1.ListArtifactsRequest + * @instance + */ + ListArtifactsRequest.prototype.parent = ""; + + /** + * ListArtifactsRequest pageSize. + * @member {number} pageSize + * @memberof google.cloud.apigeeregistry.v1.ListArtifactsRequest + * @instance + */ + ListArtifactsRequest.prototype.pageSize = 0; + + /** + * ListArtifactsRequest pageToken. + * @member {string} pageToken + * @memberof google.cloud.apigeeregistry.v1.ListArtifactsRequest + * @instance + */ + ListArtifactsRequest.prototype.pageToken = ""; + + /** + * ListArtifactsRequest filter. + * @member {string} filter + * @memberof google.cloud.apigeeregistry.v1.ListArtifactsRequest + * @instance + */ + ListArtifactsRequest.prototype.filter = ""; + + /** + * Creates a new ListArtifactsRequest instance using the specified properties. + * @function create + * @memberof google.cloud.apigeeregistry.v1.ListArtifactsRequest + * @static + * @param {google.cloud.apigeeregistry.v1.IListArtifactsRequest=} [properties] Properties to set + * @returns {google.cloud.apigeeregistry.v1.ListArtifactsRequest} ListArtifactsRequest instance + */ + ListArtifactsRequest.create = function create(properties) { + return new ListArtifactsRequest(properties); + }; + + /** + * Encodes the specified ListArtifactsRequest message. Does not implicitly {@link google.cloud.apigeeregistry.v1.ListArtifactsRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.apigeeregistry.v1.ListArtifactsRequest + * @static + * @param {google.cloud.apigeeregistry.v1.IListArtifactsRequest} message ListArtifactsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListArtifactsRequest.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.filter != null && Object.hasOwnProperty.call(message, "filter")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.filter); + return writer; + }; + + /** + * Encodes the specified ListArtifactsRequest message, length delimited. Does not implicitly {@link google.cloud.apigeeregistry.v1.ListArtifactsRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.apigeeregistry.v1.ListArtifactsRequest + * @static + * @param {google.cloud.apigeeregistry.v1.IListArtifactsRequest} message ListArtifactsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListArtifactsRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListArtifactsRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.apigeeregistry.v1.ListArtifactsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.apigeeregistry.v1.ListArtifactsRequest} ListArtifactsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListArtifactsRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.apigeeregistry.v1.ListArtifactsRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + 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.filter = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListArtifactsRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.apigeeregistry.v1.ListArtifactsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.apigeeregistry.v1.ListArtifactsRequest} ListArtifactsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListArtifactsRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListArtifactsRequest message. + * @function verify + * @memberof google.cloud.apigeeregistry.v1.ListArtifactsRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListArtifactsRequest.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.filter != null && message.hasOwnProperty("filter")) + if (!$util.isString(message.filter)) + return "filter: string expected"; + return null; + }; + + /** + * Creates a ListArtifactsRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.apigeeregistry.v1.ListArtifactsRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.apigeeregistry.v1.ListArtifactsRequest} ListArtifactsRequest + */ + ListArtifactsRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.apigeeregistry.v1.ListArtifactsRequest) + return object; + var message = new $root.google.cloud.apigeeregistry.v1.ListArtifactsRequest(); + 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.filter != null) + message.filter = String(object.filter); + return message; + }; + + /** + * Creates a plain object from a ListArtifactsRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.apigeeregistry.v1.ListArtifactsRequest + * @static + * @param {google.cloud.apigeeregistry.v1.ListArtifactsRequest} message ListArtifactsRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListArtifactsRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.pageSize = 0; + object.pageToken = ""; + object.filter = ""; + } + 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.filter != null && message.hasOwnProperty("filter")) + object.filter = message.filter; + return object; + }; + + /** + * Converts this ListArtifactsRequest to JSON. + * @function toJSON + * @memberof google.cloud.apigeeregistry.v1.ListArtifactsRequest + * @instance + * @returns {Object.} JSON object + */ + ListArtifactsRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListArtifactsRequest + * @function getTypeUrl + * @memberof google.cloud.apigeeregistry.v1.ListArtifactsRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListArtifactsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.apigeeregistry.v1.ListArtifactsRequest"; + }; + + return ListArtifactsRequest; + })(); + + v1.ListArtifactsResponse = (function() { + + /** + * Properties of a ListArtifactsResponse. + * @memberof google.cloud.apigeeregistry.v1 + * @interface IListArtifactsResponse + * @property {Array.|null} [artifacts] ListArtifactsResponse artifacts + * @property {string|null} [nextPageToken] ListArtifactsResponse nextPageToken + */ + + /** + * Constructs a new ListArtifactsResponse. + * @memberof google.cloud.apigeeregistry.v1 + * @classdesc Represents a ListArtifactsResponse. + * @implements IListArtifactsResponse + * @constructor + * @param {google.cloud.apigeeregistry.v1.IListArtifactsResponse=} [properties] Properties to set + */ + function ListArtifactsResponse(properties) { + this.artifacts = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListArtifactsResponse artifacts. + * @member {Array.} artifacts + * @memberof google.cloud.apigeeregistry.v1.ListArtifactsResponse + * @instance + */ + ListArtifactsResponse.prototype.artifacts = $util.emptyArray; + + /** + * ListArtifactsResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.cloud.apigeeregistry.v1.ListArtifactsResponse + * @instance + */ + ListArtifactsResponse.prototype.nextPageToken = ""; + + /** + * Creates a new ListArtifactsResponse instance using the specified properties. + * @function create + * @memberof google.cloud.apigeeregistry.v1.ListArtifactsResponse + * @static + * @param {google.cloud.apigeeregistry.v1.IListArtifactsResponse=} [properties] Properties to set + * @returns {google.cloud.apigeeregistry.v1.ListArtifactsResponse} ListArtifactsResponse instance + */ + ListArtifactsResponse.create = function create(properties) { + return new ListArtifactsResponse(properties); + }; + + /** + * Encodes the specified ListArtifactsResponse message. Does not implicitly {@link google.cloud.apigeeregistry.v1.ListArtifactsResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.apigeeregistry.v1.ListArtifactsResponse + * @static + * @param {google.cloud.apigeeregistry.v1.IListArtifactsResponse} message ListArtifactsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListArtifactsResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.artifacts != null && message.artifacts.length) + for (var i = 0; i < message.artifacts.length; ++i) + $root.google.cloud.apigeeregistry.v1.Artifact.encode(message.artifacts[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 ListArtifactsResponse message, length delimited. Does not implicitly {@link google.cloud.apigeeregistry.v1.ListArtifactsResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.apigeeregistry.v1.ListArtifactsResponse + * @static + * @param {google.cloud.apigeeregistry.v1.IListArtifactsResponse} message ListArtifactsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListArtifactsResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListArtifactsResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.apigeeregistry.v1.ListArtifactsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.apigeeregistry.v1.ListArtifactsResponse} ListArtifactsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListArtifactsResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.apigeeregistry.v1.ListArtifactsResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.artifacts && message.artifacts.length)) + message.artifacts = []; + message.artifacts.push($root.google.cloud.apigeeregistry.v1.Artifact.decode(reader, reader.uint32())); + break; + } + case 2: { + message.nextPageToken = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListArtifactsResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.apigeeregistry.v1.ListArtifactsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.apigeeregistry.v1.ListArtifactsResponse} ListArtifactsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListArtifactsResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListArtifactsResponse message. + * @function verify + * @memberof google.cloud.apigeeregistry.v1.ListArtifactsResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListArtifactsResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.artifacts != null && message.hasOwnProperty("artifacts")) { + if (!Array.isArray(message.artifacts)) + return "artifacts: array expected"; + for (var i = 0; i < message.artifacts.length; ++i) { + var error = $root.google.cloud.apigeeregistry.v1.Artifact.verify(message.artifacts[i]); + if (error) + return "artifacts." + error; + } + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + return null; + }; + + /** + * Creates a ListArtifactsResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.apigeeregistry.v1.ListArtifactsResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.apigeeregistry.v1.ListArtifactsResponse} ListArtifactsResponse + */ + ListArtifactsResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.apigeeregistry.v1.ListArtifactsResponse) + return object; + var message = new $root.google.cloud.apigeeregistry.v1.ListArtifactsResponse(); + if (object.artifacts) { + if (!Array.isArray(object.artifacts)) + throw TypeError(".google.cloud.apigeeregistry.v1.ListArtifactsResponse.artifacts: array expected"); + message.artifacts = []; + for (var i = 0; i < object.artifacts.length; ++i) { + if (typeof object.artifacts[i] !== "object") + throw TypeError(".google.cloud.apigeeregistry.v1.ListArtifactsResponse.artifacts: object expected"); + message.artifacts[i] = $root.google.cloud.apigeeregistry.v1.Artifact.fromObject(object.artifacts[i]); + } + } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + return message; + }; + + /** + * Creates a plain object from a ListArtifactsResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.apigeeregistry.v1.ListArtifactsResponse + * @static + * @param {google.cloud.apigeeregistry.v1.ListArtifactsResponse} message ListArtifactsResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListArtifactsResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.artifacts = []; + if (options.defaults) + object.nextPageToken = ""; + if (message.artifacts && message.artifacts.length) { + object.artifacts = []; + for (var j = 0; j < message.artifacts.length; ++j) + object.artifacts[j] = $root.google.cloud.apigeeregistry.v1.Artifact.toObject(message.artifacts[j], options); + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + object.nextPageToken = message.nextPageToken; + return object; + }; + + /** + * Converts this ListArtifactsResponse to JSON. + * @function toJSON + * @memberof google.cloud.apigeeregistry.v1.ListArtifactsResponse + * @instance + * @returns {Object.} JSON object + */ + ListArtifactsResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListArtifactsResponse + * @function getTypeUrl + * @memberof google.cloud.apigeeregistry.v1.ListArtifactsResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListArtifactsResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.apigeeregistry.v1.ListArtifactsResponse"; + }; + + return ListArtifactsResponse; + })(); + + v1.GetArtifactRequest = (function() { + + /** + * Properties of a GetArtifactRequest. + * @memberof google.cloud.apigeeregistry.v1 + * @interface IGetArtifactRequest + * @property {string|null} [name] GetArtifactRequest name + */ + + /** + * Constructs a new GetArtifactRequest. + * @memberof google.cloud.apigeeregistry.v1 + * @classdesc Represents a GetArtifactRequest. + * @implements IGetArtifactRequest + * @constructor + * @param {google.cloud.apigeeregistry.v1.IGetArtifactRequest=} [properties] Properties to set + */ + function GetArtifactRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetArtifactRequest name. + * @member {string} name + * @memberof google.cloud.apigeeregistry.v1.GetArtifactRequest + * @instance + */ + GetArtifactRequest.prototype.name = ""; + + /** + * Creates a new GetArtifactRequest instance using the specified properties. + * @function create + * @memberof google.cloud.apigeeregistry.v1.GetArtifactRequest + * @static + * @param {google.cloud.apigeeregistry.v1.IGetArtifactRequest=} [properties] Properties to set + * @returns {google.cloud.apigeeregistry.v1.GetArtifactRequest} GetArtifactRequest instance + */ + GetArtifactRequest.create = function create(properties) { + return new GetArtifactRequest(properties); + }; + + /** + * Encodes the specified GetArtifactRequest message. Does not implicitly {@link google.cloud.apigeeregistry.v1.GetArtifactRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.apigeeregistry.v1.GetArtifactRequest + * @static + * @param {google.cloud.apigeeregistry.v1.IGetArtifactRequest} message GetArtifactRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetArtifactRequest.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 GetArtifactRequest message, length delimited. Does not implicitly {@link google.cloud.apigeeregistry.v1.GetArtifactRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.apigeeregistry.v1.GetArtifactRequest + * @static + * @param {google.cloud.apigeeregistry.v1.IGetArtifactRequest} message GetArtifactRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetArtifactRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetArtifactRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.apigeeregistry.v1.GetArtifactRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.apigeeregistry.v1.GetArtifactRequest} GetArtifactRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetArtifactRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.apigeeregistry.v1.GetArtifactRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetArtifactRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.apigeeregistry.v1.GetArtifactRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.apigeeregistry.v1.GetArtifactRequest} GetArtifactRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetArtifactRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetArtifactRequest message. + * @function verify + * @memberof google.cloud.apigeeregistry.v1.GetArtifactRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetArtifactRequest.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 GetArtifactRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.apigeeregistry.v1.GetArtifactRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.apigeeregistry.v1.GetArtifactRequest} GetArtifactRequest + */ + GetArtifactRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.apigeeregistry.v1.GetArtifactRequest) + return object; + var message = new $root.google.cloud.apigeeregistry.v1.GetArtifactRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a GetArtifactRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.apigeeregistry.v1.GetArtifactRequest + * @static + * @param {google.cloud.apigeeregistry.v1.GetArtifactRequest} message GetArtifactRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetArtifactRequest.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 GetArtifactRequest to JSON. + * @function toJSON + * @memberof google.cloud.apigeeregistry.v1.GetArtifactRequest + * @instance + * @returns {Object.} JSON object + */ + GetArtifactRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GetArtifactRequest + * @function getTypeUrl + * @memberof google.cloud.apigeeregistry.v1.GetArtifactRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GetArtifactRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.apigeeregistry.v1.GetArtifactRequest"; + }; + + return GetArtifactRequest; + })(); + + v1.GetArtifactContentsRequest = (function() { + + /** + * Properties of a GetArtifactContentsRequest. + * @memberof google.cloud.apigeeregistry.v1 + * @interface IGetArtifactContentsRequest + * @property {string|null} [name] GetArtifactContentsRequest name + */ + + /** + * Constructs a new GetArtifactContentsRequest. + * @memberof google.cloud.apigeeregistry.v1 + * @classdesc Represents a GetArtifactContentsRequest. + * @implements IGetArtifactContentsRequest + * @constructor + * @param {google.cloud.apigeeregistry.v1.IGetArtifactContentsRequest=} [properties] Properties to set + */ + function GetArtifactContentsRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetArtifactContentsRequest name. + * @member {string} name + * @memberof google.cloud.apigeeregistry.v1.GetArtifactContentsRequest + * @instance + */ + GetArtifactContentsRequest.prototype.name = ""; + + /** + * Creates a new GetArtifactContentsRequest instance using the specified properties. + * @function create + * @memberof google.cloud.apigeeregistry.v1.GetArtifactContentsRequest + * @static + * @param {google.cloud.apigeeregistry.v1.IGetArtifactContentsRequest=} [properties] Properties to set + * @returns {google.cloud.apigeeregistry.v1.GetArtifactContentsRequest} GetArtifactContentsRequest instance + */ + GetArtifactContentsRequest.create = function create(properties) { + return new GetArtifactContentsRequest(properties); + }; + + /** + * Encodes the specified GetArtifactContentsRequest message. Does not implicitly {@link google.cloud.apigeeregistry.v1.GetArtifactContentsRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.apigeeregistry.v1.GetArtifactContentsRequest + * @static + * @param {google.cloud.apigeeregistry.v1.IGetArtifactContentsRequest} message GetArtifactContentsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetArtifactContentsRequest.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 GetArtifactContentsRequest message, length delimited. Does not implicitly {@link google.cloud.apigeeregistry.v1.GetArtifactContentsRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.apigeeregistry.v1.GetArtifactContentsRequest + * @static + * @param {google.cloud.apigeeregistry.v1.IGetArtifactContentsRequest} message GetArtifactContentsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetArtifactContentsRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetArtifactContentsRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.apigeeregistry.v1.GetArtifactContentsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.apigeeregistry.v1.GetArtifactContentsRequest} GetArtifactContentsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetArtifactContentsRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.apigeeregistry.v1.GetArtifactContentsRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetArtifactContentsRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.apigeeregistry.v1.GetArtifactContentsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.apigeeregistry.v1.GetArtifactContentsRequest} GetArtifactContentsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetArtifactContentsRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetArtifactContentsRequest message. + * @function verify + * @memberof google.cloud.apigeeregistry.v1.GetArtifactContentsRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetArtifactContentsRequest.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 GetArtifactContentsRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.apigeeregistry.v1.GetArtifactContentsRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.apigeeregistry.v1.GetArtifactContentsRequest} GetArtifactContentsRequest + */ + GetArtifactContentsRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.apigeeregistry.v1.GetArtifactContentsRequest) + return object; + var message = new $root.google.cloud.apigeeregistry.v1.GetArtifactContentsRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a GetArtifactContentsRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.apigeeregistry.v1.GetArtifactContentsRequest + * @static + * @param {google.cloud.apigeeregistry.v1.GetArtifactContentsRequest} message GetArtifactContentsRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetArtifactContentsRequest.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 GetArtifactContentsRequest to JSON. + * @function toJSON + * @memberof google.cloud.apigeeregistry.v1.GetArtifactContentsRequest + * @instance + * @returns {Object.} JSON object + */ + GetArtifactContentsRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GetArtifactContentsRequest + * @function getTypeUrl + * @memberof google.cloud.apigeeregistry.v1.GetArtifactContentsRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GetArtifactContentsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.apigeeregistry.v1.GetArtifactContentsRequest"; + }; + + return GetArtifactContentsRequest; + })(); + + v1.CreateArtifactRequest = (function() { + + /** + * Properties of a CreateArtifactRequest. + * @memberof google.cloud.apigeeregistry.v1 + * @interface ICreateArtifactRequest + * @property {string|null} [parent] CreateArtifactRequest parent + * @property {google.cloud.apigeeregistry.v1.IArtifact|null} [artifact] CreateArtifactRequest artifact + * @property {string|null} [artifactId] CreateArtifactRequest artifactId + */ + + /** + * Constructs a new CreateArtifactRequest. + * @memberof google.cloud.apigeeregistry.v1 + * @classdesc Represents a CreateArtifactRequest. + * @implements ICreateArtifactRequest + * @constructor + * @param {google.cloud.apigeeregistry.v1.ICreateArtifactRequest=} [properties] Properties to set + */ + function CreateArtifactRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * CreateArtifactRequest parent. + * @member {string} parent + * @memberof google.cloud.apigeeregistry.v1.CreateArtifactRequest + * @instance + */ + CreateArtifactRequest.prototype.parent = ""; + + /** + * CreateArtifactRequest artifact. + * @member {google.cloud.apigeeregistry.v1.IArtifact|null|undefined} artifact + * @memberof google.cloud.apigeeregistry.v1.CreateArtifactRequest + * @instance + */ + CreateArtifactRequest.prototype.artifact = null; + + /** + * CreateArtifactRequest artifactId. + * @member {string} artifactId + * @memberof google.cloud.apigeeregistry.v1.CreateArtifactRequest + * @instance + */ + CreateArtifactRequest.prototype.artifactId = ""; + + /** + * Creates a new CreateArtifactRequest instance using the specified properties. + * @function create + * @memberof google.cloud.apigeeregistry.v1.CreateArtifactRequest + * @static + * @param {google.cloud.apigeeregistry.v1.ICreateArtifactRequest=} [properties] Properties to set + * @returns {google.cloud.apigeeregistry.v1.CreateArtifactRequest} CreateArtifactRequest instance + */ + CreateArtifactRequest.create = function create(properties) { + return new CreateArtifactRequest(properties); + }; + + /** + * Encodes the specified CreateArtifactRequest message. Does not implicitly {@link google.cloud.apigeeregistry.v1.CreateArtifactRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.apigeeregistry.v1.CreateArtifactRequest + * @static + * @param {google.cloud.apigeeregistry.v1.ICreateArtifactRequest} message CreateArtifactRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateArtifactRequest.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.artifact != null && Object.hasOwnProperty.call(message, "artifact")) + $root.google.cloud.apigeeregistry.v1.Artifact.encode(message.artifact, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.artifactId != null && Object.hasOwnProperty.call(message, "artifactId")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.artifactId); + return writer; + }; + + /** + * Encodes the specified CreateArtifactRequest message, length delimited. Does not implicitly {@link google.cloud.apigeeregistry.v1.CreateArtifactRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.apigeeregistry.v1.CreateArtifactRequest + * @static + * @param {google.cloud.apigeeregistry.v1.ICreateArtifactRequest} message CreateArtifactRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateArtifactRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CreateArtifactRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.apigeeregistry.v1.CreateArtifactRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.apigeeregistry.v1.CreateArtifactRequest} CreateArtifactRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateArtifactRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.apigeeregistry.v1.CreateArtifactRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.artifact = $root.google.cloud.apigeeregistry.v1.Artifact.decode(reader, reader.uint32()); + break; + } + case 3: { + message.artifactId = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CreateArtifactRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.apigeeregistry.v1.CreateArtifactRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.apigeeregistry.v1.CreateArtifactRequest} CreateArtifactRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateArtifactRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CreateArtifactRequest message. + * @function verify + * @memberof google.cloud.apigeeregistry.v1.CreateArtifactRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CreateArtifactRequest.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.artifact != null && message.hasOwnProperty("artifact")) { + var error = $root.google.cloud.apigeeregistry.v1.Artifact.verify(message.artifact); + if (error) + return "artifact." + error; + } + if (message.artifactId != null && message.hasOwnProperty("artifactId")) + if (!$util.isString(message.artifactId)) + return "artifactId: string expected"; + return null; + }; + + /** + * Creates a CreateArtifactRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.apigeeregistry.v1.CreateArtifactRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.apigeeregistry.v1.CreateArtifactRequest} CreateArtifactRequest + */ + CreateArtifactRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.apigeeregistry.v1.CreateArtifactRequest) + return object; + var message = new $root.google.cloud.apigeeregistry.v1.CreateArtifactRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.artifact != null) { + if (typeof object.artifact !== "object") + throw TypeError(".google.cloud.apigeeregistry.v1.CreateArtifactRequest.artifact: object expected"); + message.artifact = $root.google.cloud.apigeeregistry.v1.Artifact.fromObject(object.artifact); + } + if (object.artifactId != null) + message.artifactId = String(object.artifactId); + return message; + }; + + /** + * Creates a plain object from a CreateArtifactRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.apigeeregistry.v1.CreateArtifactRequest + * @static + * @param {google.cloud.apigeeregistry.v1.CreateArtifactRequest} message CreateArtifactRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CreateArtifactRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.artifact = null; + object.artifactId = ""; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.artifact != null && message.hasOwnProperty("artifact")) + object.artifact = $root.google.cloud.apigeeregistry.v1.Artifact.toObject(message.artifact, options); + if (message.artifactId != null && message.hasOwnProperty("artifactId")) + object.artifactId = message.artifactId; + return object; + }; + + /** + * Converts this CreateArtifactRequest to JSON. + * @function toJSON + * @memberof google.cloud.apigeeregistry.v1.CreateArtifactRequest + * @instance + * @returns {Object.} JSON object + */ + CreateArtifactRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CreateArtifactRequest + * @function getTypeUrl + * @memberof google.cloud.apigeeregistry.v1.CreateArtifactRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CreateArtifactRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.apigeeregistry.v1.CreateArtifactRequest"; + }; + + return CreateArtifactRequest; + })(); + + v1.ReplaceArtifactRequest = (function() { + + /** + * Properties of a ReplaceArtifactRequest. + * @memberof google.cloud.apigeeregistry.v1 + * @interface IReplaceArtifactRequest + * @property {google.cloud.apigeeregistry.v1.IArtifact|null} [artifact] ReplaceArtifactRequest artifact + */ + + /** + * Constructs a new ReplaceArtifactRequest. + * @memberof google.cloud.apigeeregistry.v1 + * @classdesc Represents a ReplaceArtifactRequest. + * @implements IReplaceArtifactRequest + * @constructor + * @param {google.cloud.apigeeregistry.v1.IReplaceArtifactRequest=} [properties] Properties to set + */ + function ReplaceArtifactRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ReplaceArtifactRequest artifact. + * @member {google.cloud.apigeeregistry.v1.IArtifact|null|undefined} artifact + * @memberof google.cloud.apigeeregistry.v1.ReplaceArtifactRequest + * @instance + */ + ReplaceArtifactRequest.prototype.artifact = null; + + /** + * Creates a new ReplaceArtifactRequest instance using the specified properties. + * @function create + * @memberof google.cloud.apigeeregistry.v1.ReplaceArtifactRequest + * @static + * @param {google.cloud.apigeeregistry.v1.IReplaceArtifactRequest=} [properties] Properties to set + * @returns {google.cloud.apigeeregistry.v1.ReplaceArtifactRequest} ReplaceArtifactRequest instance + */ + ReplaceArtifactRequest.create = function create(properties) { + return new ReplaceArtifactRequest(properties); + }; + + /** + * Encodes the specified ReplaceArtifactRequest message. Does not implicitly {@link google.cloud.apigeeregistry.v1.ReplaceArtifactRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.apigeeregistry.v1.ReplaceArtifactRequest + * @static + * @param {google.cloud.apigeeregistry.v1.IReplaceArtifactRequest} message ReplaceArtifactRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ReplaceArtifactRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.artifact != null && Object.hasOwnProperty.call(message, "artifact")) + $root.google.cloud.apigeeregistry.v1.Artifact.encode(message.artifact, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified ReplaceArtifactRequest message, length delimited. Does not implicitly {@link google.cloud.apigeeregistry.v1.ReplaceArtifactRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.apigeeregistry.v1.ReplaceArtifactRequest + * @static + * @param {google.cloud.apigeeregistry.v1.IReplaceArtifactRequest} message ReplaceArtifactRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ReplaceArtifactRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ReplaceArtifactRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.apigeeregistry.v1.ReplaceArtifactRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.apigeeregistry.v1.ReplaceArtifactRequest} ReplaceArtifactRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ReplaceArtifactRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.apigeeregistry.v1.ReplaceArtifactRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.artifact = $root.google.cloud.apigeeregistry.v1.Artifact.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ReplaceArtifactRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.apigeeregistry.v1.ReplaceArtifactRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.apigeeregistry.v1.ReplaceArtifactRequest} ReplaceArtifactRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ReplaceArtifactRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ReplaceArtifactRequest message. + * @function verify + * @memberof google.cloud.apigeeregistry.v1.ReplaceArtifactRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ReplaceArtifactRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.artifact != null && message.hasOwnProperty("artifact")) { + var error = $root.google.cloud.apigeeregistry.v1.Artifact.verify(message.artifact); + if (error) + return "artifact." + error; + } + return null; + }; + + /** + * Creates a ReplaceArtifactRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.apigeeregistry.v1.ReplaceArtifactRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.apigeeregistry.v1.ReplaceArtifactRequest} ReplaceArtifactRequest + */ + ReplaceArtifactRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.apigeeregistry.v1.ReplaceArtifactRequest) + return object; + var message = new $root.google.cloud.apigeeregistry.v1.ReplaceArtifactRequest(); + if (object.artifact != null) { + if (typeof object.artifact !== "object") + throw TypeError(".google.cloud.apigeeregistry.v1.ReplaceArtifactRequest.artifact: object expected"); + message.artifact = $root.google.cloud.apigeeregistry.v1.Artifact.fromObject(object.artifact); + } + return message; + }; + + /** + * Creates a plain object from a ReplaceArtifactRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.apigeeregistry.v1.ReplaceArtifactRequest + * @static + * @param {google.cloud.apigeeregistry.v1.ReplaceArtifactRequest} message ReplaceArtifactRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ReplaceArtifactRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.artifact = null; + if (message.artifact != null && message.hasOwnProperty("artifact")) + object.artifact = $root.google.cloud.apigeeregistry.v1.Artifact.toObject(message.artifact, options); + return object; + }; + + /** + * Converts this ReplaceArtifactRequest to JSON. + * @function toJSON + * @memberof google.cloud.apigeeregistry.v1.ReplaceArtifactRequest + * @instance + * @returns {Object.} JSON object + */ + ReplaceArtifactRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ReplaceArtifactRequest + * @function getTypeUrl + * @memberof google.cloud.apigeeregistry.v1.ReplaceArtifactRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ReplaceArtifactRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.apigeeregistry.v1.ReplaceArtifactRequest"; + }; + + return ReplaceArtifactRequest; + })(); + + v1.DeleteArtifactRequest = (function() { + + /** + * Properties of a DeleteArtifactRequest. + * @memberof google.cloud.apigeeregistry.v1 + * @interface IDeleteArtifactRequest + * @property {string|null} [name] DeleteArtifactRequest name + */ + + /** + * Constructs a new DeleteArtifactRequest. + * @memberof google.cloud.apigeeregistry.v1 + * @classdesc Represents a DeleteArtifactRequest. + * @implements IDeleteArtifactRequest + * @constructor + * @param {google.cloud.apigeeregistry.v1.IDeleteArtifactRequest=} [properties] Properties to set + */ + function DeleteArtifactRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * DeleteArtifactRequest name. + * @member {string} name + * @memberof google.cloud.apigeeregistry.v1.DeleteArtifactRequest + * @instance + */ + DeleteArtifactRequest.prototype.name = ""; + + /** + * Creates a new DeleteArtifactRequest instance using the specified properties. + * @function create + * @memberof google.cloud.apigeeregistry.v1.DeleteArtifactRequest + * @static + * @param {google.cloud.apigeeregistry.v1.IDeleteArtifactRequest=} [properties] Properties to set + * @returns {google.cloud.apigeeregistry.v1.DeleteArtifactRequest} DeleteArtifactRequest instance + */ + DeleteArtifactRequest.create = function create(properties) { + return new DeleteArtifactRequest(properties); + }; + + /** + * Encodes the specified DeleteArtifactRequest message. Does not implicitly {@link google.cloud.apigeeregistry.v1.DeleteArtifactRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.apigeeregistry.v1.DeleteArtifactRequest + * @static + * @param {google.cloud.apigeeregistry.v1.IDeleteArtifactRequest} message DeleteArtifactRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteArtifactRequest.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 DeleteArtifactRequest message, length delimited. Does not implicitly {@link google.cloud.apigeeregistry.v1.DeleteArtifactRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.apigeeregistry.v1.DeleteArtifactRequest + * @static + * @param {google.cloud.apigeeregistry.v1.IDeleteArtifactRequest} message DeleteArtifactRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteArtifactRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DeleteArtifactRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.apigeeregistry.v1.DeleteArtifactRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.apigeeregistry.v1.DeleteArtifactRequest} DeleteArtifactRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteArtifactRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.apigeeregistry.v1.DeleteArtifactRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DeleteArtifactRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.apigeeregistry.v1.DeleteArtifactRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.apigeeregistry.v1.DeleteArtifactRequest} DeleteArtifactRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteArtifactRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DeleteArtifactRequest message. + * @function verify + * @memberof google.cloud.apigeeregistry.v1.DeleteArtifactRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DeleteArtifactRequest.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 DeleteArtifactRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.apigeeregistry.v1.DeleteArtifactRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.apigeeregistry.v1.DeleteArtifactRequest} DeleteArtifactRequest + */ + DeleteArtifactRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.apigeeregistry.v1.DeleteArtifactRequest) + return object; + var message = new $root.google.cloud.apigeeregistry.v1.DeleteArtifactRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a DeleteArtifactRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.apigeeregistry.v1.DeleteArtifactRequest + * @static + * @param {google.cloud.apigeeregistry.v1.DeleteArtifactRequest} message DeleteArtifactRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DeleteArtifactRequest.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 DeleteArtifactRequest to JSON. + * @function toJSON + * @memberof google.cloud.apigeeregistry.v1.DeleteArtifactRequest + * @instance + * @returns {Object.} JSON object + */ + DeleteArtifactRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DeleteArtifactRequest + * @function getTypeUrl + * @memberof google.cloud.apigeeregistry.v1.DeleteArtifactRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DeleteArtifactRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.apigeeregistry.v1.DeleteArtifactRequest"; + }; + + return DeleteArtifactRequest; + })(); + + return v1; + })(); + + return apigeeregistry; + })(); + + 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) { + 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(); + 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) { + 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(); + 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) { + 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(); + 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) { + 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(); + 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) { + 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(); + 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 + */ + + /** + * 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; + + /** + * 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(); + 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) { + 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(); + 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; + } + 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: + 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; + } + } + 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; + } + 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]); + } + } + 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; + } + 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); + } + 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) { + 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(); + 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) { + 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(); + 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) { + 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(); + 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) { + 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(); + 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) { + 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(); + 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 + */ + + /** + * 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) { + if (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; + + /** + * 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(); + 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) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.DotnetSettings(); + while (reader.pos < end) { + var tag = reader.uint32(); + 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 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; + } + 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); + } + 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.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 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) { + 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(); + 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) { + 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(); + 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 + */ + + /** + * 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) { + if (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; + + /** + * 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(); + 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) { + 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(); + switch (tag >>> 3) { + case 1: { + message.selector = reader.string(); + break; + } + case 2: { + message.longRunning = $root.google.api.MethodSettings.LongRunning.decode(reader, reader.uint32()); + 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; + } + 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); + } + 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.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); + 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) { + 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(); + 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 + */ + 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; + 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 + */ + 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; + 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) { + 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(); + 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) { + 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(); + 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; + })(); + + api.HttpBody = (function() { + + /** + * Properties of a HttpBody. + * @memberof google.api + * @interface IHttpBody + * @property {string|null} [contentType] HttpBody contentType + * @property {Uint8Array|null} [data] HttpBody data + * @property {Array.|null} [extensions] HttpBody extensions + */ + + /** + * Constructs a new HttpBody. + * @memberof google.api + * @classdesc Represents a HttpBody. + * @implements IHttpBody + * @constructor + * @param {google.api.IHttpBody=} [properties] Properties to set + */ + function HttpBody(properties) { + this.extensions = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * HttpBody contentType. + * @member {string} contentType + * @memberof google.api.HttpBody + * @instance + */ + HttpBody.prototype.contentType = ""; + + /** + * HttpBody data. + * @member {Uint8Array} data + * @memberof google.api.HttpBody + * @instance + */ + HttpBody.prototype.data = $util.newBuffer([]); + + /** + * HttpBody extensions. + * @member {Array.} extensions + * @memberof google.api.HttpBody + * @instance + */ + HttpBody.prototype.extensions = $util.emptyArray; + + /** + * Creates a new HttpBody instance using the specified properties. + * @function create + * @memberof google.api.HttpBody + * @static + * @param {google.api.IHttpBody=} [properties] Properties to set + * @returns {google.api.HttpBody} HttpBody instance + */ + HttpBody.create = function create(properties) { + return new HttpBody(properties); + }; + + /** + * Encodes the specified HttpBody message. Does not implicitly {@link google.api.HttpBody.verify|verify} messages. + * @function encode + * @memberof google.api.HttpBody + * @static + * @param {google.api.IHttpBody} message HttpBody message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + HttpBody.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.contentType != null && Object.hasOwnProperty.call(message, "contentType")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.contentType); + if (message.data != null && Object.hasOwnProperty.call(message, "data")) + writer.uint32(/* id 2, wireType 2 =*/18).bytes(message.data); + if (message.extensions != null && message.extensions.length) + for (var i = 0; i < message.extensions.length; ++i) + $root.google.protobuf.Any.encode(message.extensions[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified HttpBody message, length delimited. Does not implicitly {@link google.api.HttpBody.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.HttpBody + * @static + * @param {google.api.IHttpBody} message HttpBody message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + HttpBody.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a HttpBody message from the specified reader or buffer. + * @function decode + * @memberof google.api.HttpBody + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.HttpBody} HttpBody + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + HttpBody.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.HttpBody(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.contentType = reader.string(); + break; + } + case 2: { + message.data = reader.bytes(); + break; + } + case 3: { + if (!(message.extensions && message.extensions.length)) + message.extensions = []; + message.extensions.push($root.google.protobuf.Any.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a HttpBody message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.HttpBody + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.HttpBody} HttpBody + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + HttpBody.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a HttpBody message. + * @function verify + * @memberof google.api.HttpBody + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + HttpBody.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.contentType != null && message.hasOwnProperty("contentType")) + if (!$util.isString(message.contentType)) + return "contentType: string expected"; + if (message.data != null && message.hasOwnProperty("data")) + if (!(message.data && typeof message.data.length === "number" || $util.isString(message.data))) + return "data: buffer expected"; + if (message.extensions != null && message.hasOwnProperty("extensions")) { + if (!Array.isArray(message.extensions)) + return "extensions: array expected"; + for (var i = 0; i < message.extensions.length; ++i) { + var error = $root.google.protobuf.Any.verify(message.extensions[i]); + if (error) + return "extensions." + error; + } + } + return null; + }; + + /** + * Creates a HttpBody message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.HttpBody + * @static + * @param {Object.} object Plain object + * @returns {google.api.HttpBody} HttpBody + */ + HttpBody.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.HttpBody) + return object; + var message = new $root.google.api.HttpBody(); + if (object.contentType != null) + message.contentType = String(object.contentType); + if (object.data != null) + if (typeof object.data === "string") + $util.base64.decode(object.data, message.data = $util.newBuffer($util.base64.length(object.data)), 0); + else if (object.data.length >= 0) + message.data = object.data; + if (object.extensions) { + if (!Array.isArray(object.extensions)) + throw TypeError(".google.api.HttpBody.extensions: array expected"); + message.extensions = []; + for (var i = 0; i < object.extensions.length; ++i) { + if (typeof object.extensions[i] !== "object") + throw TypeError(".google.api.HttpBody.extensions: object expected"); + message.extensions[i] = $root.google.protobuf.Any.fromObject(object.extensions[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a HttpBody message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.HttpBody + * @static + * @param {google.api.HttpBody} message HttpBody + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + HttpBody.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.extensions = []; + if (options.defaults) { + object.contentType = ""; + if (options.bytes === String) + object.data = ""; + else { + object.data = []; + if (options.bytes !== Array) + object.data = $util.newBuffer(object.data); + } + } + if (message.contentType != null && message.hasOwnProperty("contentType")) + object.contentType = message.contentType; + if (message.data != null && message.hasOwnProperty("data")) + object.data = options.bytes === String ? $util.base64.encode(message.data, 0, message.data.length) : options.bytes === Array ? Array.prototype.slice.call(message.data) : message.data; + if (message.extensions && message.extensions.length) { + object.extensions = []; + for (var j = 0; j < message.extensions.length; ++j) + object.extensions[j] = $root.google.protobuf.Any.toObject(message.extensions[j], options); + } + return object; + }; + + /** + * Converts this HttpBody to JSON. + * @function toJSON + * @memberof google.api.HttpBody + * @instance + * @returns {Object.} JSON object + */ + HttpBody.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for HttpBody + * @function getTypeUrl + * @memberof google.api.HttpBody + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + HttpBody.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.HttpBody"; + }; + + return HttpBody; + })(); + + 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) { + 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(); + 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; + })(); + + 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 {string|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 {string} edition + * @memberof google.protobuf.FileDescriptorProto + * @instance + */ + FileDescriptorProto.prototype.edition = ""; + + /** + * 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 13, wireType 2 =*/106).string(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) { + 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(); + 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 13: { + message.edition = reader.string(); + 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")) + if (!$util.isString(message.edition)) + return "edition: string expected"; + 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); + if (object.edition != null) + message.edition = String(object.edition); + 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 = ""; + } + 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 = 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) { + 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(); + 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) { + 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(); + 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) { + 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(); + 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 + */ + + /** + * 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 = []; + if (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; + + /** + * 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.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) { + 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(); + 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; + } + 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; + } + } + 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]); + } + } + 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.uninterpretedOption = []; + 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"; + }; + + 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) { + 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(); + 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 2: + case 3: + 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_REQUIRED": + case 2: + message.label = 2; + break; + case "LABEL_REPEATED": + case 3: + message.label = 3; + 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_REQUIRED=2 LABEL_REQUIRED value + * @property {number} LABEL_REPEATED=3 LABEL_REPEATED value + */ + FieldDescriptorProto.Label = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[1] = "LABEL_OPTIONAL"] = 1; + values[valuesById[2] = "LABEL_REQUIRED"] = 2; + values[valuesById[3] = "LABEL_REPEATED"] = 3; + 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) { + 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(); + 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) { + 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(); + 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) { + 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(); + 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) { + 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(); + 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) { + 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(); + 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) { + 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(); + 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} [phpGenericServices] FileOptions phpGenericServices + * @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 {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 phpGenericServices. + * @member {boolean} phpGenericServices + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.phpGenericServices = 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 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.phpGenericServices != null && Object.hasOwnProperty.call(message, "phpGenericServices")) + writer.uint32(/* id 42, wireType 0 =*/336).bool(message.phpGenericServices); + 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.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) { + 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(); + 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 42: { + message.phpGenericServices = 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 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.phpGenericServices != null && message.hasOwnProperty("phpGenericServices")) + if (typeof message.phpGenericServices !== "boolean") + return "phpGenericServices: 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.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.phpGenericServices != null) + message.phpGenericServices = Boolean(object.phpGenericServices); + 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.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.phpGenericServices = false; + object.phpMetadataNamespace = ""; + object.rubyPackage = ""; + } + 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.phpGenericServices != null && message.hasOwnProperty("phpGenericServices")) + object.phpGenericServices = message.phpGenericServices; + if (message.phpMetadataNamespace != null && message.hasOwnProperty("phpMetadataNamespace")) + object.phpMetadataNamespace = message.phpMetadataNamespace; + if (message.rubyPackage != null && message.hasOwnProperty("rubyPackage")) + object.rubyPackage = message.rubyPackage; + 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 {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 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.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) { + 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(); + 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 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.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.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[".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.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 {google.protobuf.FieldOptions.OptionTargetType|null} [target] FieldOptions target + * @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.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 target. + * @member {google.protobuf.FieldOptions.OptionTargetType} target + * @memberof google.protobuf.FieldOptions + * @instance + */ + FieldOptions.prototype.target = 0; + + /** + * 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.target != null && Object.hasOwnProperty.call(message, "target")) + writer.uint32(/* id 18, wireType 0 =*/144).int32(message.target); + 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) { + writer.uint32(/* id 1052, wireType 2 =*/8418).fork(); + for (var i = 0; i < message[".google.api.fieldBehavior"].length; ++i) + writer.int32(message[".google.api.fieldBehavior"][i]); + writer.ldelim(); + } + 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) { + 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(); + 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 18: { + message.target = reader.int32(); + 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.target != null && message.hasOwnProperty("target")) + switch (message.target) { + default: + return "target: 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.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: + 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; + } + switch (object.target) { + default: + if (typeof object.target === "number") { + message.target = object.target; + break; + } + break; + case "TARGET_TYPE_UNKNOWN": + case 0: + message.target = 0; + break; + case "TARGET_TYPE_FILE": + case 1: + message.target = 1; + break; + case "TARGET_TYPE_EXTENSION_RANGE": + case 2: + message.target = 2; + break; + case "TARGET_TYPE_MESSAGE": + case 3: + message.target = 3; + break; + case "TARGET_TYPE_FIELD": + case 4: + message.target = 4; + break; + case "TARGET_TYPE_ONEOF": + case 5: + message.target = 5; + break; + case "TARGET_TYPE_ENUM": + case 6: + message.target = 6; + break; + case "TARGET_TYPE_ENUM_ENTRY": + case 7: + message.target = 7; + break; + case "TARGET_TYPE_SERVICE": + case 8: + message.target = 8; + break; + case "TARGET_TYPE_METHOD": + case 9: + message.target = 9; + break; + } + 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; + } + } + 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.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.target = options.enums === String ? "TARGET_TYPE_UNKNOWN" : 0; + 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.target != null && message.hasOwnProperty("target")) + object.target = options.enums === String ? $root.google.protobuf.FieldOptions.OptionTargetType[message.target] === undefined ? message.target : $root.google.protobuf.FieldOptions.OptionTargetType[message.target] : message.target; + 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; + })(); + + return FieldOptions; + })(); + + protobuf.OneofOptions = (function() { + + /** + * Properties of an OneofOptions. + * @memberof google.protobuf + * @interface IOneofOptions + * @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 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.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) { + 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(); + 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; + } + 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.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.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 (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 {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 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.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) { + 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(); + 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 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.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.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; + } + 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.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 {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 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.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) { + 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(); + switch (tag >>> 3) { + case 1: { + 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; + } + 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.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.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; + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + object.deprecated = message.deprecated; + 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 {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 + */ + + /** + * 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 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"] = ""; + + /** + * 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.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"]); + 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) { + 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(); + switch (tag >>> 3) { + 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; + } + 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.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"; + 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.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"]); + 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[".google.api.defaultHost"] = ""; + object[".google.api.oauthScopes"] = ""; + } + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + object.deprecated = message.deprecated; + 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"]; + 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 {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 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.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) { + 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(); + switch (tag >>> 3) { + case 33: { + message.deprecated = reader.bool(); + break; + } + case 34: { + message.idempotencyLevel = reader.int32(); + 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.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.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[".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.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) { + 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(); + 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) { + 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(); + 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.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) { + 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(); + 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) { + 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(); + 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) { + 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(); + 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) { + 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(); + 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) { + 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(); + 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) { + 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(); + 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) { + 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(); + 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) { + 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(); + 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.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) { + 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(); + 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) { + 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(); + 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) { + 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(); + 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) { + 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(); + 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) { + 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(); + 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) { + 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(); + 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) { + 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(); + 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) { + 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(); + 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) { + 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(); + 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) { + 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(); + 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/google-cloud-apigeeregistry/protos/protos.json b/packages/google-cloud-apigeeregistry/protos/protos.json new file mode 100644 index 00000000000..d8be1933690 --- /dev/null +++ b/packages/google-cloud-apigeeregistry/protos/protos.json @@ -0,0 +1,3813 @@ +{ + "nested": { + "google": { + "nested": { + "cloud": { + "nested": { + "apigeeregistry": { + "nested": { + "v1": { + "options": { + "csharp_namespace": "Google.Cloud.ApigeeRegistry.V1", + "go_package": "cloud.google.com/go/apigeeregistry/apiv1/apigeeregistrypb;apigeeregistrypb", + "java_multiple_files": true, + "java_outer_classname": "RegistryServiceProto", + "java_package": "com.google.cloud.apigeeregistry.v1", + "php_namespace": "Google\\Cloud\\ApigeeRegistry\\V1", + "ruby_package": "Google::Cloud::ApigeeRegistry::V1" + }, + "nested": { + "Provisioning": { + "options": { + "(google.api.default_host)": "apigeeregistry.googleapis.com", + "(google.api.oauth_scopes)": "https://www.googleapis.com/auth/cloud-platform" + }, + "methods": { + "CreateInstance": { + "requestType": "CreateInstanceRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).post": "/v1/{parent=projects/*/locations/*}/instances", + "(google.api.http).body": "instance", + "(google.api.method_signature)": "parent,instance,instance_id", + "(google.longrunning.operation_info).response_type": "Instance", + "(google.longrunning.operation_info).metadata_type": "OperationMetadata" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1/{parent=projects/*/locations/*}/instances", + "body": "instance" + } + }, + { + "(google.api.method_signature)": "parent,instance,instance_id" + }, + { + "(google.longrunning.operation_info)": { + "response_type": "Instance", + "metadata_type": "OperationMetadata" + } + } + ] + }, + "DeleteInstance": { + "requestType": "DeleteInstanceRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).delete": "/v1/{name=projects/*/locations/*/instances/*}", + "(google.api.method_signature)": "name", + "(google.longrunning.operation_info).response_type": "google.protobuf.Empty", + "(google.longrunning.operation_info).metadata_type": "OperationMetadata" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "delete": "/v1/{name=projects/*/locations/*/instances/*}" + } + }, + { + "(google.api.method_signature)": "name" + }, + { + "(google.longrunning.operation_info)": { + "response_type": "google.protobuf.Empty", + "metadata_type": "OperationMetadata" + } + } + ] + }, + "GetInstance": { + "requestType": "GetInstanceRequest", + "responseType": "Instance", + "options": { + "(google.api.http).get": "/v1/{name=projects/*/locations/*/instances/*}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1/{name=projects/*/locations/*/instances/*}" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + } + } + }, + "CreateInstanceRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "locations.googleapis.com/Location" + } + }, + "instanceId": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "instance": { + "type": "Instance", + "id": 3, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "DeleteInstanceRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "apigeeregistry.googleapis.com/Instance" + } + } + } + }, + "GetInstanceRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "apigeeregistry.googleapis.com/Instance" + } + } + } + }, + "OperationMetadata": { + "fields": { + "createTime": { + "type": "google.protobuf.Timestamp", + "id": 1 + }, + "endTime": { + "type": "google.protobuf.Timestamp", + "id": 2 + }, + "target": { + "type": "string", + "id": 3 + }, + "verb": { + "type": "string", + "id": 4 + }, + "statusMessage": { + "type": "string", + "id": 5 + }, + "cancellationRequested": { + "type": "bool", + "id": 6 + }, + "apiVersion": { + "type": "string", + "id": 7 + } + } + }, + "Instance": { + "options": { + "(google.api.resource).type": "apigeeregistry.googleapis.com/Instance", + "(google.api.resource).pattern": "projects/{project}/locations/{location}/instances/{instance}" + }, + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "createTime": { + "type": "google.protobuf.Timestamp", + "id": 2, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "updateTime": { + "type": "google.protobuf.Timestamp", + "id": 3, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "state": { + "type": "State", + "id": 4, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "stateMessage": { + "type": "string", + "id": 5, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "config": { + "type": "Config", + "id": 6, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + }, + "nested": { + "State": { + "values": { + "STATE_UNSPECIFIED": 0, + "INACTIVE": 1, + "CREATING": 2, + "ACTIVE": 3, + "UPDATING": 4, + "DELETING": 5, + "FAILED": 6 + } + }, + "Config": { + "fields": { + "location": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "cmekKeyName": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + } + } + }, + "Api": { + "options": { + "(google.api.resource).type": "apigeeregistry.googleapis.com/Api", + "(google.api.resource).pattern": "projects/{project}/locations/{location}/apis/{api}" + }, + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "displayName": { + "type": "string", + "id": 2 + }, + "description": { + "type": "string", + "id": 3 + }, + "createTime": { + "type": "google.protobuf.Timestamp", + "id": 4, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "updateTime": { + "type": "google.protobuf.Timestamp", + "id": 5, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "availability": { + "type": "string", + "id": 6 + }, + "recommendedVersion": { + "type": "string", + "id": 7, + "options": { + "(google.api.resource_reference).type": "apigeeregistry.googleapis.com/ApiVersion" + } + }, + "recommendedDeployment": { + "type": "string", + "id": 8, + "options": { + "(google.api.resource_reference).type": "apigeeregistry.googleapis.com/ApiDeployment" + } + }, + "labels": { + "keyType": "string", + "type": "string", + "id": 9 + }, + "annotations": { + "keyType": "string", + "type": "string", + "id": 10 + } + } + }, + "ApiVersion": { + "options": { + "(google.api.resource).type": "apigeeregistry.googleapis.com/ApiVersion", + "(google.api.resource).pattern": "projects/{project}/locations/{location}/apis/{api}/versions/{version}" + }, + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "displayName": { + "type": "string", + "id": 2 + }, + "description": { + "type": "string", + "id": 3 + }, + "createTime": { + "type": "google.protobuf.Timestamp", + "id": 4, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "updateTime": { + "type": "google.protobuf.Timestamp", + "id": 5, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "state": { + "type": "string", + "id": 6 + }, + "labels": { + "keyType": "string", + "type": "string", + "id": 7 + }, + "annotations": { + "keyType": "string", + "type": "string", + "id": 8 + } + } + }, + "ApiSpec": { + "options": { + "(google.api.resource).type": "apigeeregistry.googleapis.com/ApiSpec", + "(google.api.resource).pattern": "projects/{project}/locations/{location}/apis/{api}/versions/{version}/specs/{spec}" + }, + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "filename": { + "type": "string", + "id": 2 + }, + "description": { + "type": "string", + "id": 3 + }, + "revisionId": { + "type": "string", + "id": 4, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "createTime": { + "type": "google.protobuf.Timestamp", + "id": 5, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "revisionCreateTime": { + "type": "google.protobuf.Timestamp", + "id": 6, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "revisionUpdateTime": { + "type": "google.protobuf.Timestamp", + "id": 7, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "mimeType": { + "type": "string", + "id": 8 + }, + "sizeBytes": { + "type": "int32", + "id": 9, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "hash": { + "type": "string", + "id": 10, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "sourceUri": { + "type": "string", + "id": 11 + }, + "contents": { + "type": "bytes", + "id": 12, + "options": { + "(google.api.field_behavior)": "INPUT_ONLY" + } + }, + "labels": { + "keyType": "string", + "type": "string", + "id": 14 + }, + "annotations": { + "keyType": "string", + "type": "string", + "id": 15 + } + } + }, + "ApiDeployment": { + "options": { + "(google.api.resource).type": "apigeeregistry.googleapis.com/ApiDeployment", + "(google.api.resource).pattern": "projects/{project}/locations/{location}/apis/{api}/deployments/{deployment}" + }, + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "displayName": { + "type": "string", + "id": 2 + }, + "description": { + "type": "string", + "id": 3 + }, + "revisionId": { + "type": "string", + "id": 4, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "createTime": { + "type": "google.protobuf.Timestamp", + "id": 5, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "revisionCreateTime": { + "type": "google.protobuf.Timestamp", + "id": 6, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "revisionUpdateTime": { + "type": "google.protobuf.Timestamp", + "id": 7, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "apiSpecRevision": { + "type": "string", + "id": 8, + "options": { + "(google.api.resource_reference).type": "apigeeregistry.googleapis.com/ApiSpec" + } + }, + "endpointUri": { + "type": "string", + "id": 9 + }, + "externalChannelUri": { + "type": "string", + "id": 10 + }, + "intendedAudience": { + "type": "string", + "id": 11 + }, + "accessGuidance": { + "type": "string", + "id": 12 + }, + "labels": { + "keyType": "string", + "type": "string", + "id": 14 + }, + "annotations": { + "keyType": "string", + "type": "string", + "id": 15 + } + } + }, + "Artifact": { + "options": { + "(google.api.resource).type": "apigeeregistry.googleapis.com/Artifact", + "(google.api.resource).pattern": "projects/{project}/locations/{location}/apis/{api}/deployments/{deployment}/artifacts/{artifact}" + }, + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "createTime": { + "type": "google.protobuf.Timestamp", + "id": 2, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "updateTime": { + "type": "google.protobuf.Timestamp", + "id": 3, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "mimeType": { + "type": "string", + "id": 4 + }, + "sizeBytes": { + "type": "int32", + "id": 5, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "hash": { + "type": "string", + "id": 6, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "contents": { + "type": "bytes", + "id": 7, + "options": { + "(google.api.field_behavior)": "INPUT_ONLY" + } + } + } + }, + "Registry": { + "options": { + "(google.api.default_host)": "apigeeregistry.googleapis.com", + "(google.api.oauth_scopes)": "https://www.googleapis.com/auth/cloud-platform" + }, + "methods": { + "ListApis": { + "requestType": "ListApisRequest", + "responseType": "ListApisResponse", + "options": { + "(google.api.http).get": "/v1/{parent=projects/*/locations/*}/apis", + "(google.api.method_signature)": "parent" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1/{parent=projects/*/locations/*}/apis" + } + }, + { + "(google.api.method_signature)": "parent" + } + ] + }, + "GetApi": { + "requestType": "GetApiRequest", + "responseType": "Api", + "options": { + "(google.api.http).get": "/v1/{name=projects/*/locations/*/apis/*}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1/{name=projects/*/locations/*/apis/*}" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "CreateApi": { + "requestType": "CreateApiRequest", + "responseType": "Api", + "options": { + "(google.api.http).post": "/v1/{parent=projects/*/locations/*}/apis", + "(google.api.http).body": "api", + "(google.api.method_signature)": "parent,api,api_id" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1/{parent=projects/*/locations/*}/apis", + "body": "api" + } + }, + { + "(google.api.method_signature)": "parent,api,api_id" + } + ] + }, + "UpdateApi": { + "requestType": "UpdateApiRequest", + "responseType": "Api", + "options": { + "(google.api.http).patch": "/v1/{api.name=projects/*/locations/*/apis/*}", + "(google.api.http).body": "api", + "(google.api.method_signature)": "api,update_mask" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "patch": "/v1/{api.name=projects/*/locations/*/apis/*}", + "body": "api" + } + }, + { + "(google.api.method_signature)": "api,update_mask" + } + ] + }, + "DeleteApi": { + "requestType": "DeleteApiRequest", + "responseType": "google.protobuf.Empty", + "options": { + "(google.api.http).delete": "/v1/{name=projects/*/locations/*/apis/*}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "delete": "/v1/{name=projects/*/locations/*/apis/*}" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "ListApiVersions": { + "requestType": "ListApiVersionsRequest", + "responseType": "ListApiVersionsResponse", + "options": { + "(google.api.http).get": "/v1/{parent=projects/*/locations/*/apis/*}/versions", + "(google.api.method_signature)": "parent" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1/{parent=projects/*/locations/*/apis/*}/versions" + } + }, + { + "(google.api.method_signature)": "parent" + } + ] + }, + "GetApiVersion": { + "requestType": "GetApiVersionRequest", + "responseType": "ApiVersion", + "options": { + "(google.api.http).get": "/v1/{name=projects/*/locations/*/apis/*/versions/*}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1/{name=projects/*/locations/*/apis/*/versions/*}" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "CreateApiVersion": { + "requestType": "CreateApiVersionRequest", + "responseType": "ApiVersion", + "options": { + "(google.api.http).post": "/v1/{parent=projects/*/locations/*/apis/*}/versions", + "(google.api.http).body": "api_version", + "(google.api.method_signature)": "parent,api_version,api_version_id" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1/{parent=projects/*/locations/*/apis/*}/versions", + "body": "api_version" + } + }, + { + "(google.api.method_signature)": "parent,api_version,api_version_id" + } + ] + }, + "UpdateApiVersion": { + "requestType": "UpdateApiVersionRequest", + "responseType": "ApiVersion", + "options": { + "(google.api.http).patch": "/v1/{api_version.name=projects/*/locations/*/apis/*/versions/*}", + "(google.api.http).body": "api_version", + "(google.api.method_signature)": "api_version,update_mask" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "patch": "/v1/{api_version.name=projects/*/locations/*/apis/*/versions/*}", + "body": "api_version" + } + }, + { + "(google.api.method_signature)": "api_version,update_mask" + } + ] + }, + "DeleteApiVersion": { + "requestType": "DeleteApiVersionRequest", + "responseType": "google.protobuf.Empty", + "options": { + "(google.api.http).delete": "/v1/{name=projects/*/locations/*/apis/*/versions/*}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "delete": "/v1/{name=projects/*/locations/*/apis/*/versions/*}" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "ListApiSpecs": { + "requestType": "ListApiSpecsRequest", + "responseType": "ListApiSpecsResponse", + "options": { + "(google.api.http).get": "/v1/{parent=projects/*/locations/*/apis/*/versions/*}/specs", + "(google.api.method_signature)": "parent" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1/{parent=projects/*/locations/*/apis/*/versions/*}/specs" + } + }, + { + "(google.api.method_signature)": "parent" + } + ] + }, + "GetApiSpec": { + "requestType": "GetApiSpecRequest", + "responseType": "ApiSpec", + "options": { + "(google.api.http).get": "/v1/{name=projects/*/locations/*/apis/*/versions/*/specs/*}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1/{name=projects/*/locations/*/apis/*/versions/*/specs/*}" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "GetApiSpecContents": { + "requestType": "GetApiSpecContentsRequest", + "responseType": "google.api.HttpBody", + "options": { + "(google.api.http).get": "/v1/{name=projects/*/locations/*/apis/*/versions/*/specs/*}:getContents", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1/{name=projects/*/locations/*/apis/*/versions/*/specs/*}:getContents" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "CreateApiSpec": { + "requestType": "CreateApiSpecRequest", + "responseType": "ApiSpec", + "options": { + "(google.api.http).post": "/v1/{parent=projects/*/locations/*/apis/*/versions/*}/specs", + "(google.api.http).body": "api_spec", + "(google.api.method_signature)": "parent,api_spec,api_spec_id" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1/{parent=projects/*/locations/*/apis/*/versions/*}/specs", + "body": "api_spec" + } + }, + { + "(google.api.method_signature)": "parent,api_spec,api_spec_id" + } + ] + }, + "UpdateApiSpec": { + "requestType": "UpdateApiSpecRequest", + "responseType": "ApiSpec", + "options": { + "(google.api.http).patch": "/v1/{api_spec.name=projects/*/locations/*/apis/*/versions/*/specs/*}", + "(google.api.http).body": "api_spec", + "(google.api.method_signature)": "api_spec,update_mask" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "patch": "/v1/{api_spec.name=projects/*/locations/*/apis/*/versions/*/specs/*}", + "body": "api_spec" + } + }, + { + "(google.api.method_signature)": "api_spec,update_mask" + } + ] + }, + "DeleteApiSpec": { + "requestType": "DeleteApiSpecRequest", + "responseType": "google.protobuf.Empty", + "options": { + "(google.api.http).delete": "/v1/{name=projects/*/locations/*/apis/*/versions/*/specs/*}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "delete": "/v1/{name=projects/*/locations/*/apis/*/versions/*/specs/*}" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "TagApiSpecRevision": { + "requestType": "TagApiSpecRevisionRequest", + "responseType": "ApiSpec", + "options": { + "(google.api.http).post": "/v1/{name=projects/*/locations/*/apis/*/versions/*/specs/*}:tagRevision", + "(google.api.http).body": "*" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1/{name=projects/*/locations/*/apis/*/versions/*/specs/*}:tagRevision", + "body": "*" + } + } + ] + }, + "ListApiSpecRevisions": { + "requestType": "ListApiSpecRevisionsRequest", + "responseType": "ListApiSpecRevisionsResponse", + "options": { + "(google.api.http).get": "/v1/{name=projects/*/locations/*/apis/*/versions/*/specs/*}:listRevisions" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1/{name=projects/*/locations/*/apis/*/versions/*/specs/*}:listRevisions" + } + } + ] + }, + "RollbackApiSpec": { + "requestType": "RollbackApiSpecRequest", + "responseType": "ApiSpec", + "options": { + "(google.api.http).post": "/v1/{name=projects/*/locations/*/apis/*/versions/*/specs/*}:rollback", + "(google.api.http).body": "*" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1/{name=projects/*/locations/*/apis/*/versions/*/specs/*}:rollback", + "body": "*" + } + } + ] + }, + "DeleteApiSpecRevision": { + "requestType": "DeleteApiSpecRevisionRequest", + "responseType": "ApiSpec", + "options": { + "(google.api.http).delete": "/v1/{name=projects/*/locations/*/apis/*/versions/*/specs/*}:deleteRevision", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "delete": "/v1/{name=projects/*/locations/*/apis/*/versions/*/specs/*}:deleteRevision" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "ListApiDeployments": { + "requestType": "ListApiDeploymentsRequest", + "responseType": "ListApiDeploymentsResponse", + "options": { + "(google.api.http).get": "/v1/{parent=projects/*/locations/*/apis/*}/deployments", + "(google.api.method_signature)": "parent" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1/{parent=projects/*/locations/*/apis/*}/deployments" + } + }, + { + "(google.api.method_signature)": "parent" + } + ] + }, + "GetApiDeployment": { + "requestType": "GetApiDeploymentRequest", + "responseType": "ApiDeployment", + "options": { + "(google.api.http).get": "/v1/{name=projects/*/locations/*/apis/*/deployments/*}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1/{name=projects/*/locations/*/apis/*/deployments/*}" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "CreateApiDeployment": { + "requestType": "CreateApiDeploymentRequest", + "responseType": "ApiDeployment", + "options": { + "(google.api.http).post": "/v1/{parent=projects/*/locations/*/apis/*}/deployments", + "(google.api.http).body": "api_deployment", + "(google.api.method_signature)": "parent,api_deployment,api_deployment_id" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1/{parent=projects/*/locations/*/apis/*}/deployments", + "body": "api_deployment" + } + }, + { + "(google.api.method_signature)": "parent,api_deployment,api_deployment_id" + } + ] + }, + "UpdateApiDeployment": { + "requestType": "UpdateApiDeploymentRequest", + "responseType": "ApiDeployment", + "options": { + "(google.api.http).patch": "/v1/{api_deployment.name=projects/*/locations/*/apis/*/deployments/*}", + "(google.api.http).body": "api_deployment", + "(google.api.method_signature)": "api_deployment,update_mask" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "patch": "/v1/{api_deployment.name=projects/*/locations/*/apis/*/deployments/*}", + "body": "api_deployment" + } + }, + { + "(google.api.method_signature)": "api_deployment,update_mask" + } + ] + }, + "DeleteApiDeployment": { + "requestType": "DeleteApiDeploymentRequest", + "responseType": "google.protobuf.Empty", + "options": { + "(google.api.http).delete": "/v1/{name=projects/*/locations/*/apis/*/deployments/*}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "delete": "/v1/{name=projects/*/locations/*/apis/*/deployments/*}" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "TagApiDeploymentRevision": { + "requestType": "TagApiDeploymentRevisionRequest", + "responseType": "ApiDeployment", + "options": { + "(google.api.http).post": "/v1/{name=projects/*/locations/*/apis/*/deployments/*}:tagRevision", + "(google.api.http).body": "*" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1/{name=projects/*/locations/*/apis/*/deployments/*}:tagRevision", + "body": "*" + } + } + ] + }, + "ListApiDeploymentRevisions": { + "requestType": "ListApiDeploymentRevisionsRequest", + "responseType": "ListApiDeploymentRevisionsResponse", + "options": { + "(google.api.http).get": "/v1/{name=projects/*/locations/*/apis/*/deployments/*}:listRevisions" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1/{name=projects/*/locations/*/apis/*/deployments/*}:listRevisions" + } + } + ] + }, + "RollbackApiDeployment": { + "requestType": "RollbackApiDeploymentRequest", + "responseType": "ApiDeployment", + "options": { + "(google.api.http).post": "/v1/{name=projects/*/locations/*/apis/*/deployments/*}:rollback", + "(google.api.http).body": "*" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1/{name=projects/*/locations/*/apis/*/deployments/*}:rollback", + "body": "*" + } + } + ] + }, + "DeleteApiDeploymentRevision": { + "requestType": "DeleteApiDeploymentRevisionRequest", + "responseType": "ApiDeployment", + "options": { + "(google.api.http).delete": "/v1/{name=projects/*/locations/*/apis/*/deployments/*}:deleteRevision", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "delete": "/v1/{name=projects/*/locations/*/apis/*/deployments/*}:deleteRevision" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "ListArtifacts": { + "requestType": "ListArtifactsRequest", + "responseType": "ListArtifactsResponse", + "options": { + "(google.api.http).get": "/v1/{parent=projects/*/locations/*}/artifacts", + "(google.api.http).additional_bindings.get": "/v1/{parent=projects/*/locations/*/apis/*/deployments/*}/artifacts", + "(google.api.method_signature)": "parent" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1/{parent=projects/*/locations/*}/artifacts", + "additional_bindings": [ + { + "get": "/v1/{parent=projects/*/locations/*/apis/*}/artifacts" + }, + { + "get": "/v1/{parent=projects/*/locations/*/apis/*/versions/*}/artifacts" + }, + { + "get": "/v1/{parent=projects/*/locations/*/apis/*/versions/*/specs/*}/artifacts" + }, + { + "get": "/v1/{parent=projects/*/locations/*/apis/*/deployments/*}/artifacts" + } + ] + } + }, + { + "(google.api.method_signature)": "parent" + } + ] + }, + "GetArtifact": { + "requestType": "GetArtifactRequest", + "responseType": "Artifact", + "options": { + "(google.api.http).get": "/v1/{name=projects/*/locations/*/artifacts/*}", + "(google.api.http).additional_bindings.get": "/v1/{name=projects/*/locations/*/apis/*/deployments/*/artifacts/*}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1/{name=projects/*/locations/*/artifacts/*}", + "additional_bindings": [ + { + "get": "/v1/{name=projects/*/locations/*/apis/*/artifacts/*}" + }, + { + "get": "/v1/{name=projects/*/locations/*/apis/*/versions/*/artifacts/*}" + }, + { + "get": "/v1/{name=projects/*/locations/*/apis/*/versions/*/specs/*/artifacts/*}" + }, + { + "get": "/v1/{name=projects/*/locations/*/apis/*/deployments/*/artifacts/*}" + } + ] + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "GetArtifactContents": { + "requestType": "GetArtifactContentsRequest", + "responseType": "google.api.HttpBody", + "options": { + "(google.api.http).get": "/v1/{name=projects/*/locations/*/artifacts/*}:getContents", + "(google.api.http).additional_bindings.get": "/v1/{name=projects/*/locations/*/apis/*/deployments/*/artifacts/*}:getContents", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1/{name=projects/*/locations/*/artifacts/*}:getContents", + "additional_bindings": [ + { + "get": "/v1/{name=projects/*/locations/*/apis/*/artifacts/*}:getContents" + }, + { + "get": "/v1/{name=projects/*/locations/*/apis/*/versions/*/artifacts/*}:getContents" + }, + { + "get": "/v1/{name=projects/*/locations/*/apis/*/versions/*/specs/*/artifacts/*}:getContents" + }, + { + "get": "/v1/{name=projects/*/locations/*/apis/*/deployments/*/artifacts/*}:getContents" + } + ] + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "CreateArtifact": { + "requestType": "CreateArtifactRequest", + "responseType": "Artifact", + "options": { + "(google.api.http).post": "/v1/{parent=projects/*/locations/*}/artifacts", + "(google.api.http).body": "artifact", + "(google.api.http).additional_bindings.post": "/v1/{parent=projects/*/locations/*/apis/*/deployments/*}/artifacts", + "(google.api.http).additional_bindings.body": "artifact", + "(google.api.method_signature)": "parent,artifact,artifact_id" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1/{parent=projects/*/locations/*}/artifacts", + "body": "artifact", + "additional_bindings": [ + { + "post": "/v1/{parent=projects/*/locations/*/apis/*}/artifacts", + "body": "artifact" + }, + { + "post": "/v1/{parent=projects/*/locations/*/apis/*/versions/*}/artifacts", + "body": "artifact" + }, + { + "post": "/v1/{parent=projects/*/locations/*/apis/*/versions/*/specs/*}/artifacts", + "body": "artifact" + }, + { + "post": "/v1/{parent=projects/*/locations/*/apis/*/deployments/*}/artifacts", + "body": "artifact" + } + ] + } + }, + { + "(google.api.method_signature)": "parent,artifact,artifact_id" + } + ] + }, + "ReplaceArtifact": { + "requestType": "ReplaceArtifactRequest", + "responseType": "Artifact", + "options": { + "(google.api.http).put": "/v1/{artifact.name=projects/*/locations/*/artifacts/*}", + "(google.api.http).body": "artifact", + "(google.api.http).additional_bindings.put": "/v1/{artifact.name=projects/*/locations/*/apis/*/deployments/*/artifacts/*}", + "(google.api.http).additional_bindings.body": "artifact", + "(google.api.method_signature)": "artifact" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "put": "/v1/{artifact.name=projects/*/locations/*/artifacts/*}", + "body": "artifact", + "additional_bindings": [ + { + "put": "/v1/{artifact.name=projects/*/locations/*/apis/*/artifacts/*}", + "body": "artifact" + }, + { + "put": "/v1/{artifact.name=projects/*/locations/*/apis/*/versions/*/artifacts/*}", + "body": "artifact" + }, + { + "put": "/v1/{artifact.name=projects/*/locations/*/apis/*/versions/*/specs/*/artifacts/*}", + "body": "artifact" + }, + { + "put": "/v1/{artifact.name=projects/*/locations/*/apis/*/deployments/*/artifacts/*}", + "body": "artifact" + } + ] + } + }, + { + "(google.api.method_signature)": "artifact" + } + ] + }, + "DeleteArtifact": { + "requestType": "DeleteArtifactRequest", + "responseType": "google.protobuf.Empty", + "options": { + "(google.api.http).delete": "/v1/{name=projects/*/locations/*/artifacts/*}", + "(google.api.http).additional_bindings.delete": "/v1/{name=projects/*/locations/*/apis/*/deployments/*/artifacts/*}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "delete": "/v1/{name=projects/*/locations/*/artifacts/*}", + "additional_bindings": [ + { + "delete": "/v1/{name=projects/*/locations/*/apis/*/artifacts/*}" + }, + { + "delete": "/v1/{name=projects/*/locations/*/apis/*/versions/*/artifacts/*}" + }, + { + "delete": "/v1/{name=projects/*/locations/*/apis/*/versions/*/specs/*/artifacts/*}" + }, + { + "delete": "/v1/{name=projects/*/locations/*/apis/*/deployments/*/artifacts/*}" + } + ] + } + }, + { + "(google.api.method_signature)": "name" + } + ] + } + } + }, + "ListApisRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).child_type": "apigeeregistry.googleapis.com/Api" + } + }, + "pageSize": { + "type": "int32", + "id": 2 + }, + "pageToken": { + "type": "string", + "id": 3 + }, + "filter": { + "type": "string", + "id": 4 + } + } + }, + "ListApisResponse": { + "fields": { + "apis": { + "rule": "repeated", + "type": "Api", + "id": 1 + }, + "nextPageToken": { + "type": "string", + "id": 2 + } + } + }, + "GetApiRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "apigeeregistry.googleapis.com/Api" + } + } + } + }, + "CreateApiRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).child_type": "apigeeregistry.googleapis.com/Api" + } + }, + "api": { + "type": "Api", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "apiId": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "UpdateApiRequest": { + "fields": { + "api": { + "type": "Api", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "updateMask": { + "type": "google.protobuf.FieldMask", + "id": 2 + }, + "allowMissing": { + "type": "bool", + "id": 3 + } + } + }, + "DeleteApiRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "apigeeregistry.googleapis.com/Api" + } + }, + "force": { + "type": "bool", + "id": 2 + } + } + }, + "ListApiVersionsRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).child_type": "apigeeregistry.googleapis.com/ApiVersion" + } + }, + "pageSize": { + "type": "int32", + "id": 2 + }, + "pageToken": { + "type": "string", + "id": 3 + }, + "filter": { + "type": "string", + "id": 4 + } + } + }, + "ListApiVersionsResponse": { + "fields": { + "apiVersions": { + "rule": "repeated", + "type": "ApiVersion", + "id": 1 + }, + "nextPageToken": { + "type": "string", + "id": 2 + } + } + }, + "GetApiVersionRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "apigeeregistry.googleapis.com/ApiVersion" + } + } + } + }, + "CreateApiVersionRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).child_type": "apigeeregistry.googleapis.com/ApiVersion" + } + }, + "apiVersion": { + "type": "ApiVersion", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "apiVersionId": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "UpdateApiVersionRequest": { + "fields": { + "apiVersion": { + "type": "ApiVersion", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "updateMask": { + "type": "google.protobuf.FieldMask", + "id": 2 + }, + "allowMissing": { + "type": "bool", + "id": 3 + } + } + }, + "DeleteApiVersionRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "apigeeregistry.googleapis.com/ApiVersion" + } + }, + "force": { + "type": "bool", + "id": 2 + } + } + }, + "ListApiSpecsRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).child_type": "apigeeregistry.googleapis.com/ApiSpec" + } + }, + "pageSize": { + "type": "int32", + "id": 2 + }, + "pageToken": { + "type": "string", + "id": 3 + }, + "filter": { + "type": "string", + "id": 4 + } + } + }, + "ListApiSpecsResponse": { + "fields": { + "apiSpecs": { + "rule": "repeated", + "type": "ApiSpec", + "id": 1 + }, + "nextPageToken": { + "type": "string", + "id": 2 + } + } + }, + "GetApiSpecRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "apigeeregistry.googleapis.com/ApiSpec" + } + } + } + }, + "GetApiSpecContentsRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "apigeeregistry.googleapis.com/ApiSpec" + } + } + } + }, + "CreateApiSpecRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).child_type": "apigeeregistry.googleapis.com/ApiSpec" + } + }, + "apiSpec": { + "type": "ApiSpec", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "apiSpecId": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "UpdateApiSpecRequest": { + "fields": { + "apiSpec": { + "type": "ApiSpec", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "updateMask": { + "type": "google.protobuf.FieldMask", + "id": 2 + }, + "allowMissing": { + "type": "bool", + "id": 3 + } + } + }, + "DeleteApiSpecRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "apigeeregistry.googleapis.com/ApiSpec" + } + }, + "force": { + "type": "bool", + "id": 2 + } + } + }, + "TagApiSpecRevisionRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "apigeeregistry.googleapis.com/ApiSpec" + } + }, + "tag": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "ListApiSpecRevisionsRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "apigeeregistry.googleapis.com/ApiSpec" + } + }, + "pageSize": { + "type": "int32", + "id": 2 + }, + "pageToken": { + "type": "string", + "id": 3 + } + } + }, + "ListApiSpecRevisionsResponse": { + "fields": { + "apiSpecs": { + "rule": "repeated", + "type": "ApiSpec", + "id": 1 + }, + "nextPageToken": { + "type": "string", + "id": 2 + } + } + }, + "RollbackApiSpecRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "apigeeregistry.googleapis.com/ApiSpec" + } + }, + "revisionId": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "DeleteApiSpecRevisionRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "apigeeregistry.googleapis.com/ApiSpec" + } + } + } + }, + "ListApiDeploymentsRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).child_type": "apigeeregistry.googleapis.com/ApiDeployment" + } + }, + "pageSize": { + "type": "int32", + "id": 2 + }, + "pageToken": { + "type": "string", + "id": 3 + }, + "filter": { + "type": "string", + "id": 4 + } + } + }, + "ListApiDeploymentsResponse": { + "fields": { + "apiDeployments": { + "rule": "repeated", + "type": "ApiDeployment", + "id": 1 + }, + "nextPageToken": { + "type": "string", + "id": 2 + } + } + }, + "GetApiDeploymentRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "apigeeregistry.googleapis.com/ApiDeployment" + } + } + } + }, + "CreateApiDeploymentRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).child_type": "apigeeregistry.googleapis.com/ApiDeployment" + } + }, + "apiDeployment": { + "type": "ApiDeployment", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "apiDeploymentId": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "UpdateApiDeploymentRequest": { + "fields": { + "apiDeployment": { + "type": "ApiDeployment", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "updateMask": { + "type": "google.protobuf.FieldMask", + "id": 2 + }, + "allowMissing": { + "type": "bool", + "id": 3 + } + } + }, + "DeleteApiDeploymentRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "apigeeregistry.googleapis.com/ApiDeployment" + } + }, + "force": { + "type": "bool", + "id": 2 + } + } + }, + "TagApiDeploymentRevisionRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "apigeeregistry.googleapis.com/ApiDeployment" + } + }, + "tag": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "ListApiDeploymentRevisionsRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "apigeeregistry.googleapis.com/ApiDeployment" + } + }, + "pageSize": { + "type": "int32", + "id": 2 + }, + "pageToken": { + "type": "string", + "id": 3 + } + } + }, + "ListApiDeploymentRevisionsResponse": { + "fields": { + "apiDeployments": { + "rule": "repeated", + "type": "ApiDeployment", + "id": 1 + }, + "nextPageToken": { + "type": "string", + "id": 2 + } + } + }, + "RollbackApiDeploymentRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "apigeeregistry.googleapis.com/ApiDeployment" + } + }, + "revisionId": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "DeleteApiDeploymentRevisionRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "apigeeregistry.googleapis.com/ApiDeployment" + } + } + } + }, + "ListArtifactsRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).child_type": "apigeeregistry.googleapis.com/Artifact" + } + }, + "pageSize": { + "type": "int32", + "id": 2 + }, + "pageToken": { + "type": "string", + "id": 3 + }, + "filter": { + "type": "string", + "id": 4 + } + } + }, + "ListArtifactsResponse": { + "fields": { + "artifacts": { + "rule": "repeated", + "type": "Artifact", + "id": 1 + }, + "nextPageToken": { + "type": "string", + "id": 2 + } + } + }, + "GetArtifactRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "apigeeregistry.googleapis.com/Artifact" + } + } + } + }, + "GetArtifactContentsRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "apigeeregistry.googleapis.com/Artifact" + } + } + } + }, + "CreateArtifactRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).child_type": "apigeeregistry.googleapis.com/Artifact" + } + }, + "artifact": { + "type": "Artifact", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "artifactId": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "ReplaceArtifactRequest": { + "fields": { + "artifact": { + "type": "Artifact", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "DeleteArtifactRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "apigeeregistry.googleapis.com/Artifact" + } + } + } + } + } + } + } + } + } + }, + "api": { + "options": { + "go_package": "google.golang.org/genproto/googleapis/api/httpbody;httpbody", + "java_multiple_files": true, + "java_outer_classname": "HttpBodyProto", + "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" + }, + "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 + } + } + }, + "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 + } + } + }, + "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 + } + }, + "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 + } + }, + "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" + }, + "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 + } + }, + "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 + } + } + }, + "HttpBody": { + "fields": { + "contentType": { + "type": "string", + "id": 1 + }, + "data": { + "type": "bytes", + "id": 2 + }, + "extensions": { + "rule": "repeated", + "type": "google.protobuf.Any", + "id": 3 + } + } + } + } + }, + "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": { + "fields": { + "file": { + "rule": "repeated", + "type": "FileDescriptorProto", + "id": 1 + } + } + }, + "FileDescriptorProto": { + "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, + "options": { + "packed": false + } + }, + "weakDependency": { + "rule": "repeated", + "type": "int32", + "id": 11, + "options": { + "packed": false + } + }, + "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": "string", + "id": 13 + } + } + }, + "DescriptorProto": { + "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": { + "fields": { + "uninterpretedOption": { + "rule": "repeated", + "type": "UninterpretedOption", + "id": 999 + } + }, + "extensions": [ + [ + 1000, + 536870911 + ] + ] + }, + "FieldDescriptorProto": { + "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_REQUIRED": 2, + "LABEL_REPEATED": 3 + } + } + } + }, + "OneofDescriptorProto": { + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "options": { + "type": "OneofOptions", + "id": 2 + } + } + }, + "EnumDescriptorProto": { + "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": { + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "number": { + "type": "int32", + "id": 2 + }, + "options": { + "type": "EnumValueOptions", + "id": 3 + } + } + }, + "ServiceDescriptorProto": { + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "method": { + "rule": "repeated", + "type": "MethodDescriptorProto", + "id": 2 + }, + "options": { + "type": "ServiceOptions", + "id": 3 + } + } + }, + "MethodDescriptorProto": { + "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": { + "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 + } + }, + "phpGenericServices": { + "type": "bool", + "id": 42, + "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 + }, + "uninterpretedOption": { + "rule": "repeated", + "type": "UninterpretedOption", + "id": 999 + } + }, + "extensions": [ + [ + 1000, + 536870911 + ] + ], + "reserved": [ + [ + 38, + 38 + ] + ], + "nested": { + "OptimizeMode": { + "values": { + "SPEED": 1, + "CODE_SIZE": 2, + "LITE_RUNTIME": 3 + } + } + } + }, + "MessageOptions": { + "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 + } + }, + "uninterpretedOption": { + "rule": "repeated", + "type": "UninterpretedOption", + "id": 999 + } + }, + "extensions": [ + [ + 1000, + 536870911 + ] + ], + "reserved": [ + [ + 4, + 4 + ], + [ + 5, + 5 + ], + [ + 6, + 6 + ], + [ + 8, + 8 + ], + [ + 9, + 9 + ] + ] + }, + "FieldOptions": { + "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 + }, + "target": { + "type": "OptionTargetType", + "id": 18 + }, + "uninterpretedOption": { + "rule": "repeated", + "type": "UninterpretedOption", + "id": 999 + } + }, + "extensions": [ + [ + 1000, + 536870911 + ] + ], + "reserved": [ + [ + 4, + 4 + ] + ], + "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 + } + } + } + }, + "OneofOptions": { + "fields": { + "uninterpretedOption": { + "rule": "repeated", + "type": "UninterpretedOption", + "id": 999 + } + }, + "extensions": [ + [ + 1000, + 536870911 + ] + ] + }, + "EnumOptions": { + "fields": { + "allowAlias": { + "type": "bool", + "id": 2 + }, + "deprecated": { + "type": "bool", + "id": 3, + "options": { + "default": false + } + }, + "deprecatedLegacyJsonFieldConflicts": { + "type": "bool", + "id": 6, + "options": { + "deprecated": true + } + }, + "uninterpretedOption": { + "rule": "repeated", + "type": "UninterpretedOption", + "id": 999 + } + }, + "extensions": [ + [ + 1000, + 536870911 + ] + ], + "reserved": [ + [ + 5, + 5 + ] + ] + }, + "EnumValueOptions": { + "fields": { + "deprecated": { + "type": "bool", + "id": 1, + "options": { + "default": false + } + }, + "uninterpretedOption": { + "rule": "repeated", + "type": "UninterpretedOption", + "id": 999 + } + }, + "extensions": [ + [ + 1000, + 536870911 + ] + ] + }, + "ServiceOptions": { + "fields": { + "deprecated": { + "type": "bool", + "id": 33, + "options": { + "default": false + } + }, + "uninterpretedOption": { + "rule": "repeated", + "type": "UninterpretedOption", + "id": 999 + } + }, + "extensions": [ + [ + 1000, + 536870911 + ] + ] + }, + "MethodOptions": { + "fields": { + "deprecated": { + "type": "bool", + "id": 33, + "options": { + "default": false + } + }, + "idempotencyLevel": { + "type": "IdempotencyLevel", + "id": 34, + "options": { + "default": "IDEMPOTENCY_UNKNOWN" + } + }, + "uninterpretedOption": { + "rule": "repeated", + "type": "UninterpretedOption", + "id": 999 + } + }, + "extensions": [ + [ + 1000, + 536870911 + ] + ], + "nested": { + "IdempotencyLevel": { + "values": { + "IDEMPOTENCY_UNKNOWN": 0, + "NO_SIDE_EFFECTS": 1, + "IDEMPOTENT": 2 + } + } + } + }, + "UninterpretedOption": { + "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 + } + } + } + } + }, + "SourceCodeInfo": { + "fields": { + "location": { + "rule": "repeated", + "type": "Location", + "id": 1 + } + }, + "nested": { + "Location": { + "fields": { + "path": { + "rule": "repeated", + "type": "int32", + "id": 1 + }, + "span": { + "rule": "repeated", + "type": "int32", + "id": 2 + }, + "leadingComments": { + "type": "string", + "id": 3 + }, + "trailingComments": { + "type": "string", + "id": 4 + }, + "leadingDetachedComments": { + "rule": "repeated", + "type": "string", + "id": 6 + } + } + } + } + }, + "GeneratedCodeInfo": { + "fields": { + "annotation": { + "rule": "repeated", + "type": "Annotation", + "id": 1 + } + }, + "nested": { + "Annotation": { + "fields": { + "path": { + "rule": "repeated", + "type": "int32", + "id": 1 + }, + "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 + } + } + }, + "FieldMask": { + "fields": { + "paths": { + "rule": "repeated", + "type": "string", + "id": 1 + } + } + } + } + }, + "longrunning": { + "options": { + "cc_enable_arenas": true, + "csharp_namespace": "Google.LongRunning", + "go_package": "google.golang.org/genproto/googleapis/longrunning;longrunning", + "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/google-cloud-apigeeregistry/samples/README.md b/packages/google-cloud-apigeeregistry/samples/README.md new file mode 100644 index 00000000000..4fefc6a6a00 --- /dev/null +++ b/packages/google-cloud-apigeeregistry/samples/README.md @@ -0,0 +1,734 @@ +[//]: # "This README.md file is auto-generated, all changes to this file will be lost." +[//]: # "To regenerate it, use `python -m synthtool`." +Google Cloud Platform logo + +# [Apigee Registry API: Node.js Samples](https://github.com/googleapis/google-cloud-node) + +[![Open in Cloud Shell][shell_img]][shell_link] + + + +## Table of Contents + +* [Before you begin](#before-you-begin) +* [Samples](#samples) + * [Provisioning.create_instance](#provisioning.create_instance) + * [Provisioning.delete_instance](#provisioning.delete_instance) + * [Provisioning.get_instance](#provisioning.get_instance) + * [Registry.create_api](#registry.create_api) + * [Registry.create_api_deployment](#registry.create_api_deployment) + * [Registry.create_api_spec](#registry.create_api_spec) + * [Registry.create_api_version](#registry.create_api_version) + * [Registry.create_artifact](#registry.create_artifact) + * [Registry.delete_api](#registry.delete_api) + * [Registry.delete_api_deployment](#registry.delete_api_deployment) + * [Registry.delete_api_deployment_revision](#registry.delete_api_deployment_revision) + * [Registry.delete_api_spec](#registry.delete_api_spec) + * [Registry.delete_api_spec_revision](#registry.delete_api_spec_revision) + * [Registry.delete_api_version](#registry.delete_api_version) + * [Registry.delete_artifact](#registry.delete_artifact) + * [Registry.get_api](#registry.get_api) + * [Registry.get_api_deployment](#registry.get_api_deployment) + * [Registry.get_api_spec](#registry.get_api_spec) + * [Registry.get_api_spec_contents](#registry.get_api_spec_contents) + * [Registry.get_api_version](#registry.get_api_version) + * [Registry.get_artifact](#registry.get_artifact) + * [Registry.get_artifact_contents](#registry.get_artifact_contents) + * [Registry.list_api_deployment_revisions](#registry.list_api_deployment_revisions) + * [Registry.list_api_deployments](#registry.list_api_deployments) + * [Registry.list_api_spec_revisions](#registry.list_api_spec_revisions) + * [Registry.list_api_specs](#registry.list_api_specs) + * [Registry.list_api_versions](#registry.list_api_versions) + * [Registry.list_apis](#registry.list_apis) + * [Registry.list_artifacts](#registry.list_artifacts) + * [Registry.replace_artifact](#registry.replace_artifact) + * [Registry.rollback_api_deployment](#registry.rollback_api_deployment) + * [Registry.rollback_api_spec](#registry.rollback_api_spec) + * [Registry.tag_api_deployment_revision](#registry.tag_api_deployment_revision) + * [Registry.tag_api_spec_revision](#registry.tag_api_spec_revision) + * [Registry.update_api](#registry.update_api) + * [Registry.update_api_deployment](#registry.update_api_deployment) + * [Registry.update_api_spec](#registry.update_api_spec) + * [Registry.update_api_version](#registry.update_api_version) + * [Quickstart](#quickstart) + +## Before you begin + +Before running the samples, make sure you've followed the steps outlined in +[Using the client library](https://github.com/googleapis/google-cloud-node#using-the-client-library). + +`cd samples` + +`npm install` + +`cd ..` + +## Samples + + + +### Provisioning.create_instance + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-apigeeregistry/samples/generated/v1/provisioning.create_instance.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-cloud-apigeeregistry/samples/generated/v1/provisioning.create_instance.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-apigeeregistry/samples/generated/v1/provisioning.create_instance.js` + + +----- + + + + +### Provisioning.delete_instance + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-apigeeregistry/samples/generated/v1/provisioning.delete_instance.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-cloud-apigeeregistry/samples/generated/v1/provisioning.delete_instance.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-apigeeregistry/samples/generated/v1/provisioning.delete_instance.js` + + +----- + + + + +### Provisioning.get_instance + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-apigeeregistry/samples/generated/v1/provisioning.get_instance.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-cloud-apigeeregistry/samples/generated/v1/provisioning.get_instance.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-apigeeregistry/samples/generated/v1/provisioning.get_instance.js` + + +----- + + + + +### Registry.create_api + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-apigeeregistry/samples/generated/v1/registry.create_api.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-cloud-apigeeregistry/samples/generated/v1/registry.create_api.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-apigeeregistry/samples/generated/v1/registry.create_api.js` + + +----- + + + + +### Registry.create_api_deployment + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-apigeeregistry/samples/generated/v1/registry.create_api_deployment.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-cloud-apigeeregistry/samples/generated/v1/registry.create_api_deployment.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-apigeeregistry/samples/generated/v1/registry.create_api_deployment.js` + + +----- + + + + +### Registry.create_api_spec + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-apigeeregistry/samples/generated/v1/registry.create_api_spec.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-cloud-apigeeregistry/samples/generated/v1/registry.create_api_spec.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-apigeeregistry/samples/generated/v1/registry.create_api_spec.js` + + +----- + + + + +### Registry.create_api_version + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-apigeeregistry/samples/generated/v1/registry.create_api_version.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-cloud-apigeeregistry/samples/generated/v1/registry.create_api_version.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-apigeeregistry/samples/generated/v1/registry.create_api_version.js` + + +----- + + + + +### Registry.create_artifact + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-apigeeregistry/samples/generated/v1/registry.create_artifact.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-cloud-apigeeregistry/samples/generated/v1/registry.create_artifact.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-apigeeregistry/samples/generated/v1/registry.create_artifact.js` + + +----- + + + + +### Registry.delete_api + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-apigeeregistry/samples/generated/v1/registry.delete_api.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-cloud-apigeeregistry/samples/generated/v1/registry.delete_api.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-apigeeregistry/samples/generated/v1/registry.delete_api.js` + + +----- + + + + +### Registry.delete_api_deployment + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-apigeeregistry/samples/generated/v1/registry.delete_api_deployment.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-cloud-apigeeregistry/samples/generated/v1/registry.delete_api_deployment.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-apigeeregistry/samples/generated/v1/registry.delete_api_deployment.js` + + +----- + + + + +### Registry.delete_api_deployment_revision + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-apigeeregistry/samples/generated/v1/registry.delete_api_deployment_revision.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-cloud-apigeeregistry/samples/generated/v1/registry.delete_api_deployment_revision.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-apigeeregistry/samples/generated/v1/registry.delete_api_deployment_revision.js` + + +----- + + + + +### Registry.delete_api_spec + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-apigeeregistry/samples/generated/v1/registry.delete_api_spec.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-cloud-apigeeregistry/samples/generated/v1/registry.delete_api_spec.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-apigeeregistry/samples/generated/v1/registry.delete_api_spec.js` + + +----- + + + + +### Registry.delete_api_spec_revision + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-apigeeregistry/samples/generated/v1/registry.delete_api_spec_revision.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-cloud-apigeeregistry/samples/generated/v1/registry.delete_api_spec_revision.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-apigeeregistry/samples/generated/v1/registry.delete_api_spec_revision.js` + + +----- + + + + +### Registry.delete_api_version + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-apigeeregistry/samples/generated/v1/registry.delete_api_version.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-cloud-apigeeregistry/samples/generated/v1/registry.delete_api_version.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-apigeeregistry/samples/generated/v1/registry.delete_api_version.js` + + +----- + + + + +### Registry.delete_artifact + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-apigeeregistry/samples/generated/v1/registry.delete_artifact.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-cloud-apigeeregistry/samples/generated/v1/registry.delete_artifact.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-apigeeregistry/samples/generated/v1/registry.delete_artifact.js` + + +----- + + + + +### Registry.get_api + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-apigeeregistry/samples/generated/v1/registry.get_api.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-cloud-apigeeregistry/samples/generated/v1/registry.get_api.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-apigeeregistry/samples/generated/v1/registry.get_api.js` + + +----- + + + + +### Registry.get_api_deployment + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-apigeeregistry/samples/generated/v1/registry.get_api_deployment.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-cloud-apigeeregistry/samples/generated/v1/registry.get_api_deployment.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-apigeeregistry/samples/generated/v1/registry.get_api_deployment.js` + + +----- + + + + +### Registry.get_api_spec + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-apigeeregistry/samples/generated/v1/registry.get_api_spec.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-cloud-apigeeregistry/samples/generated/v1/registry.get_api_spec.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-apigeeregistry/samples/generated/v1/registry.get_api_spec.js` + + +----- + + + + +### Registry.get_api_spec_contents + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-apigeeregistry/samples/generated/v1/registry.get_api_spec_contents.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-cloud-apigeeregistry/samples/generated/v1/registry.get_api_spec_contents.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-apigeeregistry/samples/generated/v1/registry.get_api_spec_contents.js` + + +----- + + + + +### Registry.get_api_version + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-apigeeregistry/samples/generated/v1/registry.get_api_version.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-cloud-apigeeregistry/samples/generated/v1/registry.get_api_version.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-apigeeregistry/samples/generated/v1/registry.get_api_version.js` + + +----- + + + + +### Registry.get_artifact + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-apigeeregistry/samples/generated/v1/registry.get_artifact.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-cloud-apigeeregistry/samples/generated/v1/registry.get_artifact.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-apigeeregistry/samples/generated/v1/registry.get_artifact.js` + + +----- + + + + +### Registry.get_artifact_contents + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-apigeeregistry/samples/generated/v1/registry.get_artifact_contents.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-cloud-apigeeregistry/samples/generated/v1/registry.get_artifact_contents.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-apigeeregistry/samples/generated/v1/registry.get_artifact_contents.js` + + +----- + + + + +### Registry.list_api_deployment_revisions + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-apigeeregistry/samples/generated/v1/registry.list_api_deployment_revisions.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-cloud-apigeeregistry/samples/generated/v1/registry.list_api_deployment_revisions.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-apigeeregistry/samples/generated/v1/registry.list_api_deployment_revisions.js` + + +----- + + + + +### Registry.list_api_deployments + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-apigeeregistry/samples/generated/v1/registry.list_api_deployments.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-cloud-apigeeregistry/samples/generated/v1/registry.list_api_deployments.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-apigeeregistry/samples/generated/v1/registry.list_api_deployments.js` + + +----- + + + + +### Registry.list_api_spec_revisions + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-apigeeregistry/samples/generated/v1/registry.list_api_spec_revisions.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-cloud-apigeeregistry/samples/generated/v1/registry.list_api_spec_revisions.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-apigeeregistry/samples/generated/v1/registry.list_api_spec_revisions.js` + + +----- + + + + +### Registry.list_api_specs + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-apigeeregistry/samples/generated/v1/registry.list_api_specs.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-cloud-apigeeregistry/samples/generated/v1/registry.list_api_specs.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-apigeeregistry/samples/generated/v1/registry.list_api_specs.js` + + +----- + + + + +### Registry.list_api_versions + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-apigeeregistry/samples/generated/v1/registry.list_api_versions.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-cloud-apigeeregistry/samples/generated/v1/registry.list_api_versions.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-apigeeregistry/samples/generated/v1/registry.list_api_versions.js` + + +----- + + + + +### Registry.list_apis + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-apigeeregistry/samples/generated/v1/registry.list_apis.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-cloud-apigeeregistry/samples/generated/v1/registry.list_apis.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-apigeeregistry/samples/generated/v1/registry.list_apis.js` + + +----- + + + + +### Registry.list_artifacts + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-apigeeregistry/samples/generated/v1/registry.list_artifacts.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-cloud-apigeeregistry/samples/generated/v1/registry.list_artifacts.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-apigeeregistry/samples/generated/v1/registry.list_artifacts.js` + + +----- + + + + +### Registry.replace_artifact + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-apigeeregistry/samples/generated/v1/registry.replace_artifact.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-cloud-apigeeregistry/samples/generated/v1/registry.replace_artifact.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-apigeeregistry/samples/generated/v1/registry.replace_artifact.js` + + +----- + + + + +### Registry.rollback_api_deployment + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-apigeeregistry/samples/generated/v1/registry.rollback_api_deployment.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-cloud-apigeeregistry/samples/generated/v1/registry.rollback_api_deployment.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-apigeeregistry/samples/generated/v1/registry.rollback_api_deployment.js` + + +----- + + + + +### Registry.rollback_api_spec + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-apigeeregistry/samples/generated/v1/registry.rollback_api_spec.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-cloud-apigeeregistry/samples/generated/v1/registry.rollback_api_spec.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-apigeeregistry/samples/generated/v1/registry.rollback_api_spec.js` + + +----- + + + + +### Registry.tag_api_deployment_revision + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-apigeeregistry/samples/generated/v1/registry.tag_api_deployment_revision.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-cloud-apigeeregistry/samples/generated/v1/registry.tag_api_deployment_revision.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-apigeeregistry/samples/generated/v1/registry.tag_api_deployment_revision.js` + + +----- + + + + +### Registry.tag_api_spec_revision + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-apigeeregistry/samples/generated/v1/registry.tag_api_spec_revision.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-cloud-apigeeregistry/samples/generated/v1/registry.tag_api_spec_revision.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-apigeeregistry/samples/generated/v1/registry.tag_api_spec_revision.js` + + +----- + + + + +### Registry.update_api + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-apigeeregistry/samples/generated/v1/registry.update_api.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-cloud-apigeeregistry/samples/generated/v1/registry.update_api.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-apigeeregistry/samples/generated/v1/registry.update_api.js` + + +----- + + + + +### Registry.update_api_deployment + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-apigeeregistry/samples/generated/v1/registry.update_api_deployment.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-cloud-apigeeregistry/samples/generated/v1/registry.update_api_deployment.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-apigeeregistry/samples/generated/v1/registry.update_api_deployment.js` + + +----- + + + + +### Registry.update_api_spec + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-apigeeregistry/samples/generated/v1/registry.update_api_spec.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-cloud-apigeeregistry/samples/generated/v1/registry.update_api_spec.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-apigeeregistry/samples/generated/v1/registry.update_api_spec.js` + + +----- + + + + +### Registry.update_api_version + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-apigeeregistry/samples/generated/v1/registry.update_api_version.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-cloud-apigeeregistry/samples/generated/v1/registry.update_api_version.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-apigeeregistry/samples/generated/v1/registry.update_api_version.js` + + +----- + + + + +### Quickstart + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-apigeeregistry/samples/quickstart.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-cloud-apigeeregistry/samples/quickstart.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-apigeeregistry/samples/quickstart.js` + + + + + + +[shell_img]: https://gstatic.com/cloudssh/images/open-btn.png +[shell_link]: https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=samples/README.md +[product-docs]: https://cloud.google.com/apigee/docs/api-hub/get-started-registry-api diff --git a/packages/google-cloud-apigeeregistry/samples/generated/v1/provisioning.create_instance.js b/packages/google-cloud-apigeeregistry/samples/generated/v1/provisioning.create_instance.js new file mode 100644 index 00000000000..b4ca96bdb74 --- /dev/null +++ b/packages/google-cloud-apigeeregistry/samples/generated/v1/provisioning.create_instance.js @@ -0,0 +1,73 @@ +// Copyright 2023 Google LLC +// +// Licensed under the Apache License, Version 2.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, instanceId, instance) { + // [START apigeeregistry_v1_generated_Provisioning_CreateInstance_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. Parent resource of the Instance, of the form: `projects/* /locations/*` + */ + // const parent = 'abc123' + /** + * Required. Identifier to assign to the Instance. Must be unique within scope of the + * parent resource. + */ + // const instanceId = 'abc123' + /** + * Required. The Instance. + */ + // const instance = {} + + // Imports the Apigeeregistry library + const {ProvisioningClient} = require('@google-cloud/apigee-registry').v1; + + // Instantiates a client + const apigeeregistryClient = new ProvisioningClient(); + + async function callCreateInstance() { + // Construct request + const request = { + parent, + instanceId, + instance, + }; + + // Run request + const [operation] = await apigeeregistryClient.createInstance(request); + const [response] = await operation.promise(); + console.log(response); + } + + callCreateInstance(); + // [END apigeeregistry_v1_generated_Provisioning_CreateInstance_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-apigeeregistry/samples/generated/v1/provisioning.delete_instance.js b/packages/google-cloud-apigeeregistry/samples/generated/v1/provisioning.delete_instance.js new file mode 100644 index 00000000000..74e702d5023 --- /dev/null +++ b/packages/google-cloud-apigeeregistry/samples/generated/v1/provisioning.delete_instance.js @@ -0,0 +1,63 @@ +// Copyright 2023 Google LLC +// +// Licensed under the Apache License, Version 2.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 apigeeregistry_v1_generated_Provisioning_DeleteInstance_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 Instance to delete. + * Format: `projects/* /locations/* /instances/*`. + */ + // const name = 'abc123' + + // Imports the Apigeeregistry library + const {ProvisioningClient} = require('@google-cloud/apigee-registry').v1; + + // Instantiates a client + const apigeeregistryClient = new ProvisioningClient(); + + async function callDeleteInstance() { + // Construct request + const request = { + name, + }; + + // Run request + const [operation] = await apigeeregistryClient.deleteInstance(request); + const [response] = await operation.promise(); + console.log(response); + } + + callDeleteInstance(); + // [END apigeeregistry_v1_generated_Provisioning_DeleteInstance_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-apigeeregistry/samples/generated/v1/provisioning.get_instance.js b/packages/google-cloud-apigeeregistry/samples/generated/v1/provisioning.get_instance.js new file mode 100644 index 00000000000..9724a92c2d8 --- /dev/null +++ b/packages/google-cloud-apigeeregistry/samples/generated/v1/provisioning.get_instance.js @@ -0,0 +1,62 @@ +// Copyright 2023 Google LLC +// +// Licensed under the Apache License, Version 2.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 apigeeregistry_v1_generated_Provisioning_GetInstance_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 Instance to retrieve. + * Format: `projects/* /locations/* /instances/*`. + */ + // const name = 'abc123' + + // Imports the Apigeeregistry library + const {ProvisioningClient} = require('@google-cloud/apigee-registry').v1; + + // Instantiates a client + const apigeeregistryClient = new ProvisioningClient(); + + async function callGetInstance() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await apigeeregistryClient.getInstance(request); + console.log(response); + } + + callGetInstance(); + // [END apigeeregistry_v1_generated_Provisioning_GetInstance_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-apigeeregistry/samples/generated/v1/registry.create_api.js b/packages/google-cloud-apigeeregistry/samples/generated/v1/registry.create_api.js new file mode 100644 index 00000000000..113640e2ec6 --- /dev/null +++ b/packages/google-cloud-apigeeregistry/samples/generated/v1/registry.create_api.js @@ -0,0 +1,76 @@ +// Copyright 2023 Google LLC +// +// Licensed under the Apache License, Version 2.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, api, apiId) { + // [START apigeeregistry_v1_generated_Registry_CreateApi_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 APIs. + * Format: `projects/* /locations/*` + */ + // const parent = 'abc123' + /** + * Required. The API to create. + */ + // const api = {} + /** + * Required. The ID to use for the API, which will become the final component of + * the API's resource name. + * This value should be 4-63 characters, and valid characters + * are /[a-z][0-9]-/. + * Following AIP-162, IDs must not have the form of a UUID. + */ + // const apiId = 'abc123' + + // Imports the Apigeeregistry library + const {RegistryClient} = require('@google-cloud/apigee-registry').v1; + + // Instantiates a client + const apigeeregistryClient = new RegistryClient(); + + async function callCreateApi() { + // Construct request + const request = { + parent, + api, + apiId, + }; + + // Run request + const response = await apigeeregistryClient.createApi(request); + console.log(response); + } + + callCreateApi(); + // [END apigeeregistry_v1_generated_Registry_CreateApi_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-apigeeregistry/samples/generated/v1/registry.create_api_deployment.js b/packages/google-cloud-apigeeregistry/samples/generated/v1/registry.create_api_deployment.js new file mode 100644 index 00000000000..7a4c1c845c6 --- /dev/null +++ b/packages/google-cloud-apigeeregistry/samples/generated/v1/registry.create_api_deployment.js @@ -0,0 +1,76 @@ +// Copyright 2023 Google LLC +// +// Licensed under the Apache License, Version 2.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, apiDeployment, apiDeploymentId) { + // [START apigeeregistry_v1_generated_Registry_CreateApiDeployment_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 deployments. + * Format: `projects/* /locations/* /apis/*` + */ + // const parent = 'abc123' + /** + * Required. The deployment to create. + */ + // const apiDeployment = {} + /** + * Required. The ID to use for the deployment, which will become the final component of + * the deployment's resource name. + * This value should be 4-63 characters, and valid characters + * are /[a-z][0-9]-/. + * Following AIP-162, IDs must not have the form of a UUID. + */ + // const apiDeploymentId = 'abc123' + + // Imports the Apigeeregistry library + const {RegistryClient} = require('@google-cloud/apigee-registry').v1; + + // Instantiates a client + const apigeeregistryClient = new RegistryClient(); + + async function callCreateApiDeployment() { + // Construct request + const request = { + parent, + apiDeployment, + apiDeploymentId, + }; + + // Run request + const response = await apigeeregistryClient.createApiDeployment(request); + console.log(response); + } + + callCreateApiDeployment(); + // [END apigeeregistry_v1_generated_Registry_CreateApiDeployment_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-apigeeregistry/samples/generated/v1/registry.create_api_spec.js b/packages/google-cloud-apigeeregistry/samples/generated/v1/registry.create_api_spec.js new file mode 100644 index 00000000000..58b8584700b --- /dev/null +++ b/packages/google-cloud-apigeeregistry/samples/generated/v1/registry.create_api_spec.js @@ -0,0 +1,76 @@ +// Copyright 2023 Google LLC +// +// Licensed under the Apache License, Version 2.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, apiSpec, apiSpecId) { + // [START apigeeregistry_v1_generated_Registry_CreateApiSpec_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 specs. + * Format: `projects/* /locations/* /apis/* /versions/*` + */ + // const parent = 'abc123' + /** + * Required. The spec to create. + */ + // const apiSpec = {} + /** + * Required. The ID to use for the spec, which will become the final component of + * the spec's resource name. + * This value should be 4-63 characters, and valid characters + * are /[a-z][0-9]-/. + * Following AIP-162, IDs must not have the form of a UUID. + */ + // const apiSpecId = 'abc123' + + // Imports the Apigeeregistry library + const {RegistryClient} = require('@google-cloud/apigee-registry').v1; + + // Instantiates a client + const apigeeregistryClient = new RegistryClient(); + + async function callCreateApiSpec() { + // Construct request + const request = { + parent, + apiSpec, + apiSpecId, + }; + + // Run request + const response = await apigeeregistryClient.createApiSpec(request); + console.log(response); + } + + callCreateApiSpec(); + // [END apigeeregistry_v1_generated_Registry_CreateApiSpec_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-apigeeregistry/samples/generated/v1/registry.create_api_version.js b/packages/google-cloud-apigeeregistry/samples/generated/v1/registry.create_api_version.js new file mode 100644 index 00000000000..1a5dc3f12dc --- /dev/null +++ b/packages/google-cloud-apigeeregistry/samples/generated/v1/registry.create_api_version.js @@ -0,0 +1,76 @@ +// Copyright 2023 Google LLC +// +// Licensed under the Apache License, Version 2.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, apiVersion, apiVersionId) { + // [START apigeeregistry_v1_generated_Registry_CreateApiVersion_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 versions. + * Format: `projects/* /locations/* /apis/*` + */ + // const parent = 'abc123' + /** + * Required. The version to create. + */ + // const apiVersion = {} + /** + * Required. The ID to use for the version, which will become the final component of + * the version's resource name. + * This value should be 1-63 characters, and valid characters + * are /[a-z][0-9]-/. + * Following AIP-162, IDs must not have the form of a UUID. + */ + // const apiVersionId = 'abc123' + + // Imports the Apigeeregistry library + const {RegistryClient} = require('@google-cloud/apigee-registry').v1; + + // Instantiates a client + const apigeeregistryClient = new RegistryClient(); + + async function callCreateApiVersion() { + // Construct request + const request = { + parent, + apiVersion, + apiVersionId, + }; + + // Run request + const response = await apigeeregistryClient.createApiVersion(request); + console.log(response); + } + + callCreateApiVersion(); + // [END apigeeregistry_v1_generated_Registry_CreateApiVersion_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-apigeeregistry/samples/generated/v1/registry.create_artifact.js b/packages/google-cloud-apigeeregistry/samples/generated/v1/registry.create_artifact.js new file mode 100644 index 00000000000..e9052fe1b2e --- /dev/null +++ b/packages/google-cloud-apigeeregistry/samples/generated/v1/registry.create_artifact.js @@ -0,0 +1,76 @@ +// Copyright 2023 Google LLC +// +// Licensed under the Apache License, Version 2.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, artifact, artifactId) { + // [START apigeeregistry_v1_generated_Registry_CreateArtifact_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 artifacts. + * Format: `{parent}` + */ + // const parent = 'abc123' + /** + * Required. The artifact to create. + */ + // const artifact = {} + /** + * Required. The ID to use for the artifact, which will become the final component of + * the artifact's resource name. + * This value should be 4-63 characters, and valid characters + * are /[a-z][0-9]-/. + * Following AIP-162, IDs must not have the form of a UUID. + */ + // const artifactId = 'abc123' + + // Imports the Apigeeregistry library + const {RegistryClient} = require('@google-cloud/apigee-registry').v1; + + // Instantiates a client + const apigeeregistryClient = new RegistryClient(); + + async function callCreateArtifact() { + // Construct request + const request = { + parent, + artifact, + artifactId, + }; + + // Run request + const response = await apigeeregistryClient.createArtifact(request); + console.log(response); + } + + callCreateArtifact(); + // [END apigeeregistry_v1_generated_Registry_CreateArtifact_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-apigeeregistry/samples/generated/v1/registry.delete_api.js b/packages/google-cloud-apigeeregistry/samples/generated/v1/registry.delete_api.js new file mode 100644 index 00000000000..917b1dd3399 --- /dev/null +++ b/packages/google-cloud-apigeeregistry/samples/generated/v1/registry.delete_api.js @@ -0,0 +1,67 @@ +// Copyright 2023 Google LLC +// +// Licensed under the Apache License, Version 2.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 apigeeregistry_v1_generated_Registry_DeleteApi_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 API to delete. + * Format: `projects/* /locations/* /apis/*` + */ + // const name = 'abc123' + /** + * If set to true, any child resources will also be deleted. + * (Otherwise, the request will only work if there are no child resources.) + */ + // const force = true + + // Imports the Apigeeregistry library + const {RegistryClient} = require('@google-cloud/apigee-registry').v1; + + // Instantiates a client + const apigeeregistryClient = new RegistryClient(); + + async function callDeleteApi() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await apigeeregistryClient.deleteApi(request); + console.log(response); + } + + callDeleteApi(); + // [END apigeeregistry_v1_generated_Registry_DeleteApi_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-apigeeregistry/samples/generated/v1/registry.delete_api_deployment.js b/packages/google-cloud-apigeeregistry/samples/generated/v1/registry.delete_api_deployment.js new file mode 100644 index 00000000000..863cd8ce339 --- /dev/null +++ b/packages/google-cloud-apigeeregistry/samples/generated/v1/registry.delete_api_deployment.js @@ -0,0 +1,67 @@ +// Copyright 2023 Google LLC +// +// Licensed under the Apache License, Version 2.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 apigeeregistry_v1_generated_Registry_DeleteApiDeployment_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 deployment to delete. + * Format: `projects/* /locations/* /apis/* /deployments/*` + */ + // const name = 'abc123' + /** + * If set to true, any child resources will also be deleted. + * (Otherwise, the request will only work if there are no child resources.) + */ + // const force = true + + // Imports the Apigeeregistry library + const {RegistryClient} = require('@google-cloud/apigee-registry').v1; + + // Instantiates a client + const apigeeregistryClient = new RegistryClient(); + + async function callDeleteApiDeployment() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await apigeeregistryClient.deleteApiDeployment(request); + console.log(response); + } + + callDeleteApiDeployment(); + // [END apigeeregistry_v1_generated_Registry_DeleteApiDeployment_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-apigeeregistry/samples/generated/v1/registry.delete_api_deployment_revision.js b/packages/google-cloud-apigeeregistry/samples/generated/v1/registry.delete_api_deployment_revision.js new file mode 100644 index 00000000000..369deb1856c --- /dev/null +++ b/packages/google-cloud-apigeeregistry/samples/generated/v1/registry.delete_api_deployment_revision.js @@ -0,0 +1,64 @@ +// Copyright 2023 Google LLC +// +// Licensed under the Apache License, Version 2.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 apigeeregistry_v1_generated_Registry_DeleteApiDeploymentRevision_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 deployment revision to be deleted, + * with a revision ID explicitly included. + * Example: + * `projects/sample/locations/global/apis/petstore/deployments/prod@c7cfa2a8` + */ + // const name = 'abc123' + + // Imports the Apigeeregistry library + const {RegistryClient} = require('@google-cloud/apigee-registry').v1; + + // Instantiates a client + const apigeeregistryClient = new RegistryClient(); + + async function callDeleteApiDeploymentRevision() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await apigeeregistryClient.deleteApiDeploymentRevision(request); + console.log(response); + } + + callDeleteApiDeploymentRevision(); + // [END apigeeregistry_v1_generated_Registry_DeleteApiDeploymentRevision_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-apigeeregistry/samples/generated/v1/registry.delete_api_spec.js b/packages/google-cloud-apigeeregistry/samples/generated/v1/registry.delete_api_spec.js new file mode 100644 index 00000000000..15fc88e824c --- /dev/null +++ b/packages/google-cloud-apigeeregistry/samples/generated/v1/registry.delete_api_spec.js @@ -0,0 +1,67 @@ +// Copyright 2023 Google LLC +// +// Licensed under the Apache License, Version 2.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 apigeeregistry_v1_generated_Registry_DeleteApiSpec_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 spec to delete. + * Format: `projects/* /locations/* /apis/* /versions/* /specs/*` + */ + // const name = 'abc123' + /** + * If set to true, any child resources will also be deleted. + * (Otherwise, the request will only work if there are no child resources.) + */ + // const force = true + + // Imports the Apigeeregistry library + const {RegistryClient} = require('@google-cloud/apigee-registry').v1; + + // Instantiates a client + const apigeeregistryClient = new RegistryClient(); + + async function callDeleteApiSpec() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await apigeeregistryClient.deleteApiSpec(request); + console.log(response); + } + + callDeleteApiSpec(); + // [END apigeeregistry_v1_generated_Registry_DeleteApiSpec_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-apigeeregistry/samples/generated/v1/registry.delete_api_spec_revision.js b/packages/google-cloud-apigeeregistry/samples/generated/v1/registry.delete_api_spec_revision.js new file mode 100644 index 00000000000..fa2a1e8df18 --- /dev/null +++ b/packages/google-cloud-apigeeregistry/samples/generated/v1/registry.delete_api_spec_revision.js @@ -0,0 +1,64 @@ +// Copyright 2023 Google LLC +// +// Licensed under the Apache License, Version 2.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 apigeeregistry_v1_generated_Registry_DeleteApiSpecRevision_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 spec revision to be deleted, + * with a revision ID explicitly included. + * Example: + * `projects/sample/locations/global/apis/petstore/versions/1.0.0/specs/openapi.yaml@c7cfa2a8` + */ + // const name = 'abc123' + + // Imports the Apigeeregistry library + const {RegistryClient} = require('@google-cloud/apigee-registry').v1; + + // Instantiates a client + const apigeeregistryClient = new RegistryClient(); + + async function callDeleteApiSpecRevision() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await apigeeregistryClient.deleteApiSpecRevision(request); + console.log(response); + } + + callDeleteApiSpecRevision(); + // [END apigeeregistry_v1_generated_Registry_DeleteApiSpecRevision_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-apigeeregistry/samples/generated/v1/registry.delete_api_version.js b/packages/google-cloud-apigeeregistry/samples/generated/v1/registry.delete_api_version.js new file mode 100644 index 00000000000..7c4454a1053 --- /dev/null +++ b/packages/google-cloud-apigeeregistry/samples/generated/v1/registry.delete_api_version.js @@ -0,0 +1,67 @@ +// Copyright 2023 Google LLC +// +// Licensed under the Apache License, Version 2.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 apigeeregistry_v1_generated_Registry_DeleteApiVersion_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 version to delete. + * Format: `projects/* /locations/* /apis/* /versions/*` + */ + // const name = 'abc123' + /** + * If set to true, any child resources will also be deleted. + * (Otherwise, the request will only work if there are no child resources.) + */ + // const force = true + + // Imports the Apigeeregistry library + const {RegistryClient} = require('@google-cloud/apigee-registry').v1; + + // Instantiates a client + const apigeeregistryClient = new RegistryClient(); + + async function callDeleteApiVersion() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await apigeeregistryClient.deleteApiVersion(request); + console.log(response); + } + + callDeleteApiVersion(); + // [END apigeeregistry_v1_generated_Registry_DeleteApiVersion_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-apigeeregistry/samples/generated/v1/registry.delete_artifact.js b/packages/google-cloud-apigeeregistry/samples/generated/v1/registry.delete_artifact.js new file mode 100644 index 00000000000..99da99af3e5 --- /dev/null +++ b/packages/google-cloud-apigeeregistry/samples/generated/v1/registry.delete_artifact.js @@ -0,0 +1,62 @@ +// Copyright 2023 Google LLC +// +// Licensed under the Apache License, Version 2.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 apigeeregistry_v1_generated_Registry_DeleteArtifact_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 artifact to delete. + * Format: `{parent}/artifacts/*` + */ + // const name = 'abc123' + + // Imports the Apigeeregistry library + const {RegistryClient} = require('@google-cloud/apigee-registry').v1; + + // Instantiates a client + const apigeeregistryClient = new RegistryClient(); + + async function callDeleteArtifact() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await apigeeregistryClient.deleteArtifact(request); + console.log(response); + } + + callDeleteArtifact(); + // [END apigeeregistry_v1_generated_Registry_DeleteArtifact_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-apigeeregistry/samples/generated/v1/registry.get_api.js b/packages/google-cloud-apigeeregistry/samples/generated/v1/registry.get_api.js new file mode 100644 index 00000000000..235120454ad --- /dev/null +++ b/packages/google-cloud-apigeeregistry/samples/generated/v1/registry.get_api.js @@ -0,0 +1,62 @@ +// Copyright 2023 Google LLC +// +// Licensed under the Apache License, Version 2.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 apigeeregistry_v1_generated_Registry_GetApi_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 API to retrieve. + * Format: `projects/* /locations/* /apis/*` + */ + // const name = 'abc123' + + // Imports the Apigeeregistry library + const {RegistryClient} = require('@google-cloud/apigee-registry').v1; + + // Instantiates a client + const apigeeregistryClient = new RegistryClient(); + + async function callGetApi() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await apigeeregistryClient.getApi(request); + console.log(response); + } + + callGetApi(); + // [END apigeeregistry_v1_generated_Registry_GetApi_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-apigeeregistry/samples/generated/v1/registry.get_api_deployment.js b/packages/google-cloud-apigeeregistry/samples/generated/v1/registry.get_api_deployment.js new file mode 100644 index 00000000000..1414dc571b9 --- /dev/null +++ b/packages/google-cloud-apigeeregistry/samples/generated/v1/registry.get_api_deployment.js @@ -0,0 +1,62 @@ +// Copyright 2023 Google LLC +// +// Licensed under the Apache License, Version 2.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 apigeeregistry_v1_generated_Registry_GetApiDeployment_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 deployment to retrieve. + * Format: `projects/* /locations/* /apis/* /deployments/*` + */ + // const name = 'abc123' + + // Imports the Apigeeregistry library + const {RegistryClient} = require('@google-cloud/apigee-registry').v1; + + // Instantiates a client + const apigeeregistryClient = new RegistryClient(); + + async function callGetApiDeployment() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await apigeeregistryClient.getApiDeployment(request); + console.log(response); + } + + callGetApiDeployment(); + // [END apigeeregistry_v1_generated_Registry_GetApiDeployment_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-apigeeregistry/samples/generated/v1/registry.get_api_spec.js b/packages/google-cloud-apigeeregistry/samples/generated/v1/registry.get_api_spec.js new file mode 100644 index 00000000000..e6440349af4 --- /dev/null +++ b/packages/google-cloud-apigeeregistry/samples/generated/v1/registry.get_api_spec.js @@ -0,0 +1,62 @@ +// Copyright 2023 Google LLC +// +// Licensed under the Apache License, Version 2.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 apigeeregistry_v1_generated_Registry_GetApiSpec_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 spec to retrieve. + * Format: `projects/* /locations/* /apis/* /versions/* /specs/*` + */ + // const name = 'abc123' + + // Imports the Apigeeregistry library + const {RegistryClient} = require('@google-cloud/apigee-registry').v1; + + // Instantiates a client + const apigeeregistryClient = new RegistryClient(); + + async function callGetApiSpec() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await apigeeregistryClient.getApiSpec(request); + console.log(response); + } + + callGetApiSpec(); + // [END apigeeregistry_v1_generated_Registry_GetApiSpec_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-apigeeregistry/samples/generated/v1/registry.get_api_spec_contents.js b/packages/google-cloud-apigeeregistry/samples/generated/v1/registry.get_api_spec_contents.js new file mode 100644 index 00000000000..d3f17e4d094 --- /dev/null +++ b/packages/google-cloud-apigeeregistry/samples/generated/v1/registry.get_api_spec_contents.js @@ -0,0 +1,62 @@ +// Copyright 2023 Google LLC +// +// Licensed under the Apache License, Version 2.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 apigeeregistry_v1_generated_Registry_GetApiSpecContents_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 spec whose contents should be retrieved. + * Format: `projects/* /locations/* /apis/* /versions/* /specs/*` + */ + // const name = 'abc123' + + // Imports the Apigeeregistry library + const {RegistryClient} = require('@google-cloud/apigee-registry').v1; + + // Instantiates a client + const apigeeregistryClient = new RegistryClient(); + + async function callGetApiSpecContents() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await apigeeregistryClient.getApiSpecContents(request); + console.log(response); + } + + callGetApiSpecContents(); + // [END apigeeregistry_v1_generated_Registry_GetApiSpecContents_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-apigeeregistry/samples/generated/v1/registry.get_api_version.js b/packages/google-cloud-apigeeregistry/samples/generated/v1/registry.get_api_version.js new file mode 100644 index 00000000000..2a288b39beb --- /dev/null +++ b/packages/google-cloud-apigeeregistry/samples/generated/v1/registry.get_api_version.js @@ -0,0 +1,62 @@ +// Copyright 2023 Google LLC +// +// Licensed under the Apache License, Version 2.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 apigeeregistry_v1_generated_Registry_GetApiVersion_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 version to retrieve. + * Format: `projects/* /locations/* /apis/* /versions/*` + */ + // const name = 'abc123' + + // Imports the Apigeeregistry library + const {RegistryClient} = require('@google-cloud/apigee-registry').v1; + + // Instantiates a client + const apigeeregistryClient = new RegistryClient(); + + async function callGetApiVersion() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await apigeeregistryClient.getApiVersion(request); + console.log(response); + } + + callGetApiVersion(); + // [END apigeeregistry_v1_generated_Registry_GetApiVersion_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-apigeeregistry/samples/generated/v1/registry.get_artifact.js b/packages/google-cloud-apigeeregistry/samples/generated/v1/registry.get_artifact.js new file mode 100644 index 00000000000..67eaf70c3fa --- /dev/null +++ b/packages/google-cloud-apigeeregistry/samples/generated/v1/registry.get_artifact.js @@ -0,0 +1,62 @@ +// Copyright 2023 Google LLC +// +// Licensed under the Apache License, Version 2.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 apigeeregistry_v1_generated_Registry_GetArtifact_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 artifact to retrieve. + * Format: `{parent}/artifacts/*` + */ + // const name = 'abc123' + + // Imports the Apigeeregistry library + const {RegistryClient} = require('@google-cloud/apigee-registry').v1; + + // Instantiates a client + const apigeeregistryClient = new RegistryClient(); + + async function callGetArtifact() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await apigeeregistryClient.getArtifact(request); + console.log(response); + } + + callGetArtifact(); + // [END apigeeregistry_v1_generated_Registry_GetArtifact_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-apigeeregistry/samples/generated/v1/registry.get_artifact_contents.js b/packages/google-cloud-apigeeregistry/samples/generated/v1/registry.get_artifact_contents.js new file mode 100644 index 00000000000..ea2d32d2855 --- /dev/null +++ b/packages/google-cloud-apigeeregistry/samples/generated/v1/registry.get_artifact_contents.js @@ -0,0 +1,62 @@ +// Copyright 2023 Google LLC +// +// Licensed under the Apache License, Version 2.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 apigeeregistry_v1_generated_Registry_GetArtifactContents_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 artifact whose contents should be retrieved. + * Format: `{parent}/artifacts/*` + */ + // const name = 'abc123' + + // Imports the Apigeeregistry library + const {RegistryClient} = require('@google-cloud/apigee-registry').v1; + + // Instantiates a client + const apigeeregistryClient = new RegistryClient(); + + async function callGetArtifactContents() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await apigeeregistryClient.getArtifactContents(request); + console.log(response); + } + + callGetArtifactContents(); + // [END apigeeregistry_v1_generated_Registry_GetArtifactContents_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-apigeeregistry/samples/generated/v1/registry.list_api_deployment_revisions.js b/packages/google-cloud-apigeeregistry/samples/generated/v1/registry.list_api_deployment_revisions.js new file mode 100644 index 00000000000..21685cd096a --- /dev/null +++ b/packages/google-cloud-apigeeregistry/samples/generated/v1/registry.list_api_deployment_revisions.js @@ -0,0 +1,72 @@ +// Copyright 2023 Google LLC +// +// Licensed under the Apache License, Version 2.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 apigeeregistry_v1_generated_Registry_ListApiDeploymentRevisions_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 deployment to list revisions for. + */ + // const name = 'abc123' + /** + * The maximum number of revisions to return per page. + */ + // const pageSize = 1234 + /** + * The page token, received from a previous ListApiDeploymentRevisions call. + * Provide this to retrieve the subsequent page. + */ + // const pageToken = 'abc123' + + // Imports the Apigeeregistry library + const {RegistryClient} = require('@google-cloud/apigee-registry').v1; + + // Instantiates a client + const apigeeregistryClient = new RegistryClient(); + + async function callListApiDeploymentRevisions() { + // Construct request + const request = { + name, + }; + + // Run request + const iterable = await apigeeregistryClient.listApiDeploymentRevisionsAsync(request); + for await (const response of iterable) { + console.log(response); + } + } + + callListApiDeploymentRevisions(); + // [END apigeeregistry_v1_generated_Registry_ListApiDeploymentRevisions_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-apigeeregistry/samples/generated/v1/registry.list_api_deployments.js b/packages/google-cloud-apigeeregistry/samples/generated/v1/registry.list_api_deployments.js new file mode 100644 index 00000000000..6412a285fb9 --- /dev/null +++ b/packages/google-cloud-apigeeregistry/samples/generated/v1/registry.list_api_deployments.js @@ -0,0 +1,83 @@ +// Copyright 2023 Google LLC +// +// Licensed under the Apache License, Version 2.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 apigeeregistry_v1_generated_Registry_ListApiDeployments_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 deployments. + * Format: `projects/* /locations/* /apis/*` + */ + // const parent = 'abc123' + /** + * The maximum number of deployments to return. + * The service may return fewer than this value. + * If unspecified, at most 50 values will be returned. + * The maximum is 1000; values above 1000 will be coerced to 1000. + */ + // const pageSize = 1234 + /** + * A page token, received from a previous `ListApiDeployments` call. + * Provide this to retrieve the subsequent page. + * When paginating, all other parameters provided to `ListApiDeployments` must + * match the call that provided the page token. + */ + // const pageToken = 'abc123' + /** + * An expression that can be used to filter the list. Filters use the Common + * Expression Language and can refer to all message fields. + */ + // const filter = 'abc123' + + // Imports the Apigeeregistry library + const {RegistryClient} = require('@google-cloud/apigee-registry').v1; + + // Instantiates a client + const apigeeregistryClient = new RegistryClient(); + + async function callListApiDeployments() { + // Construct request + const request = { + parent, + }; + + // Run request + const iterable = await apigeeregistryClient.listApiDeploymentsAsync(request); + for await (const response of iterable) { + console.log(response); + } + } + + callListApiDeployments(); + // [END apigeeregistry_v1_generated_Registry_ListApiDeployments_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-apigeeregistry/samples/generated/v1/registry.list_api_spec_revisions.js b/packages/google-cloud-apigeeregistry/samples/generated/v1/registry.list_api_spec_revisions.js new file mode 100644 index 00000000000..c6726ae8423 --- /dev/null +++ b/packages/google-cloud-apigeeregistry/samples/generated/v1/registry.list_api_spec_revisions.js @@ -0,0 +1,72 @@ +// Copyright 2023 Google LLC +// +// Licensed under the Apache License, Version 2.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 apigeeregistry_v1_generated_Registry_ListApiSpecRevisions_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 spec to list revisions for. + */ + // const name = 'abc123' + /** + * The maximum number of revisions to return per page. + */ + // const pageSize = 1234 + /** + * The page token, received from a previous ListApiSpecRevisions call. + * Provide this to retrieve the subsequent page. + */ + // const pageToken = 'abc123' + + // Imports the Apigeeregistry library + const {RegistryClient} = require('@google-cloud/apigee-registry').v1; + + // Instantiates a client + const apigeeregistryClient = new RegistryClient(); + + async function callListApiSpecRevisions() { + // Construct request + const request = { + name, + }; + + // Run request + const iterable = await apigeeregistryClient.listApiSpecRevisionsAsync(request); + for await (const response of iterable) { + console.log(response); + } + } + + callListApiSpecRevisions(); + // [END apigeeregistry_v1_generated_Registry_ListApiSpecRevisions_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-apigeeregistry/samples/generated/v1/registry.list_api_specs.js b/packages/google-cloud-apigeeregistry/samples/generated/v1/registry.list_api_specs.js new file mode 100644 index 00000000000..396e72470f5 --- /dev/null +++ b/packages/google-cloud-apigeeregistry/samples/generated/v1/registry.list_api_specs.js @@ -0,0 +1,83 @@ +// Copyright 2023 Google LLC +// +// Licensed under the Apache License, Version 2.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 apigeeregistry_v1_generated_Registry_ListApiSpecs_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 specs. + * Format: `projects/* /locations/* /apis/* /versions/*` + */ + // const parent = 'abc123' + /** + * The maximum number of specs to return. + * The service may return fewer than this value. + * If unspecified, at most 50 values will be returned. + * The maximum is 1000; values above 1000 will be coerced to 1000. + */ + // const pageSize = 1234 + /** + * A page token, received from a previous `ListApiSpecs` call. + * Provide this to retrieve the subsequent page. + * When paginating, all other parameters provided to `ListApiSpecs` must match + * the call that provided the page token. + */ + // const pageToken = 'abc123' + /** + * An expression that can be used to filter the list. Filters use the Common + * Expression Language and can refer to all message fields except contents. + */ + // const filter = 'abc123' + + // Imports the Apigeeregistry library + const {RegistryClient} = require('@google-cloud/apigee-registry').v1; + + // Instantiates a client + const apigeeregistryClient = new RegistryClient(); + + async function callListApiSpecs() { + // Construct request + const request = { + parent, + }; + + // Run request + const iterable = await apigeeregistryClient.listApiSpecsAsync(request); + for await (const response of iterable) { + console.log(response); + } + } + + callListApiSpecs(); + // [END apigeeregistry_v1_generated_Registry_ListApiSpecs_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-apigeeregistry/samples/generated/v1/registry.list_api_versions.js b/packages/google-cloud-apigeeregistry/samples/generated/v1/registry.list_api_versions.js new file mode 100644 index 00000000000..2b077b508ae --- /dev/null +++ b/packages/google-cloud-apigeeregistry/samples/generated/v1/registry.list_api_versions.js @@ -0,0 +1,83 @@ +// Copyright 2023 Google LLC +// +// Licensed under the Apache License, Version 2.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 apigeeregistry_v1_generated_Registry_ListApiVersions_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 versions. + * Format: `projects/* /locations/* /apis/*` + */ + // const parent = 'abc123' + /** + * The maximum number of versions to return. + * The service may return fewer than this value. + * If unspecified, at most 50 values will be returned. + * The maximum is 1000; values above 1000 will be coerced to 1000. + */ + // const pageSize = 1234 + /** + * A page token, received from a previous `ListApiVersions` call. + * Provide this to retrieve the subsequent page. + * When paginating, all other parameters provided to `ListApiVersions` must + * match the call that provided the page token. + */ + // const pageToken = 'abc123' + /** + * An expression that can be used to filter the list. Filters use the Common + * Expression Language and can refer to all message fields. + */ + // const filter = 'abc123' + + // Imports the Apigeeregistry library + const {RegistryClient} = require('@google-cloud/apigee-registry').v1; + + // Instantiates a client + const apigeeregistryClient = new RegistryClient(); + + async function callListApiVersions() { + // Construct request + const request = { + parent, + }; + + // Run request + const iterable = await apigeeregistryClient.listApiVersionsAsync(request); + for await (const response of iterable) { + console.log(response); + } + } + + callListApiVersions(); + // [END apigeeregistry_v1_generated_Registry_ListApiVersions_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-apigeeregistry/samples/generated/v1/registry.list_apis.js b/packages/google-cloud-apigeeregistry/samples/generated/v1/registry.list_apis.js new file mode 100644 index 00000000000..ea225496745 --- /dev/null +++ b/packages/google-cloud-apigeeregistry/samples/generated/v1/registry.list_apis.js @@ -0,0 +1,83 @@ +// Copyright 2023 Google LLC +// +// Licensed under the Apache License, Version 2.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 apigeeregistry_v1_generated_Registry_ListApis_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 APIs. + * Format: `projects/* /locations/*` + */ + // const parent = 'abc123' + /** + * The maximum number of APIs to return. + * The service may return fewer than this value. + * If unspecified, at most 50 values will be returned. + * The maximum is 1000; values above 1000 will be coerced to 1000. + */ + // const pageSize = 1234 + /** + * A page token, received from a previous `ListApis` call. + * Provide this to retrieve the subsequent page. + * When paginating, all other parameters provided to `ListApis` must match + * the call that provided the page token. + */ + // const pageToken = 'abc123' + /** + * An expression that can be used to filter the list. Filters use the Common + * Expression Language and can refer to all message fields. + */ + // const filter = 'abc123' + + // Imports the Apigeeregistry library + const {RegistryClient} = require('@google-cloud/apigee-registry').v1; + + // Instantiates a client + const apigeeregistryClient = new RegistryClient(); + + async function callListApis() { + // Construct request + const request = { + parent, + }; + + // Run request + const iterable = await apigeeregistryClient.listApisAsync(request); + for await (const response of iterable) { + console.log(response); + } + } + + callListApis(); + // [END apigeeregistry_v1_generated_Registry_ListApis_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-apigeeregistry/samples/generated/v1/registry.list_artifacts.js b/packages/google-cloud-apigeeregistry/samples/generated/v1/registry.list_artifacts.js new file mode 100644 index 00000000000..ca9a2c07339 --- /dev/null +++ b/packages/google-cloud-apigeeregistry/samples/generated/v1/registry.list_artifacts.js @@ -0,0 +1,83 @@ +// Copyright 2023 Google LLC +// +// Licensed under the Apache License, Version 2.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 apigeeregistry_v1_generated_Registry_ListArtifacts_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 artifacts. + * Format: `{parent}` + */ + // const parent = 'abc123' + /** + * The maximum number of artifacts to return. + * The service may return fewer than this value. + * If unspecified, at most 50 values will be returned. + * The maximum is 1000; values above 1000 will be coerced to 1000. + */ + // const pageSize = 1234 + /** + * A page token, received from a previous `ListArtifacts` call. + * Provide this to retrieve the subsequent page. + * When paginating, all other parameters provided to `ListArtifacts` must + * match the call that provided the page token. + */ + // const pageToken = 'abc123' + /** + * An expression that can be used to filter the list. Filters use the Common + * Expression Language and can refer to all message fields except contents. + */ + // const filter = 'abc123' + + // Imports the Apigeeregistry library + const {RegistryClient} = require('@google-cloud/apigee-registry').v1; + + // Instantiates a client + const apigeeregistryClient = new RegistryClient(); + + async function callListArtifacts() { + // Construct request + const request = { + parent, + }; + + // Run request + const iterable = await apigeeregistryClient.listArtifactsAsync(request); + for await (const response of iterable) { + console.log(response); + } + } + + callListArtifacts(); + // [END apigeeregistry_v1_generated_Registry_ListArtifacts_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-apigeeregistry/samples/generated/v1/registry.replace_artifact.js b/packages/google-cloud-apigeeregistry/samples/generated/v1/registry.replace_artifact.js new file mode 100644 index 00000000000..91f3904ff6d --- /dev/null +++ b/packages/google-cloud-apigeeregistry/samples/generated/v1/registry.replace_artifact.js @@ -0,0 +1,63 @@ +// Copyright 2023 Google LLC +// +// Licensed under the Apache License, Version 2.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(artifact) { + // [START apigeeregistry_v1_generated_Registry_ReplaceArtifact_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 artifact to replace. + * The `name` field is used to identify the artifact to replace. + * Format: `{parent}/artifacts/*` + */ + // const artifact = {} + + // Imports the Apigeeregistry library + const {RegistryClient} = require('@google-cloud/apigee-registry').v1; + + // Instantiates a client + const apigeeregistryClient = new RegistryClient(); + + async function callReplaceArtifact() { + // Construct request + const request = { + artifact, + }; + + // Run request + const response = await apigeeregistryClient.replaceArtifact(request); + console.log(response); + } + + callReplaceArtifact(); + // [END apigeeregistry_v1_generated_Registry_ReplaceArtifact_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-apigeeregistry/samples/generated/v1/registry.rollback_api_deployment.js b/packages/google-cloud-apigeeregistry/samples/generated/v1/registry.rollback_api_deployment.js new file mode 100644 index 00000000000..41317e3c670 --- /dev/null +++ b/packages/google-cloud-apigeeregistry/samples/generated/v1/registry.rollback_api_deployment.js @@ -0,0 +1,68 @@ +// Copyright 2023 Google LLC +// +// Licensed under the Apache License, Version 2.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, revisionId) { + // [START apigeeregistry_v1_generated_Registry_RollbackApiDeployment_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 deployment being rolled back. + */ + // const name = 'abc123' + /** + * Required. The revision ID to roll back to. + * It must be a revision of the same deployment. + * Example: `c7cfa2a8` + */ + // const revisionId = 'abc123' + + // Imports the Apigeeregistry library + const {RegistryClient} = require('@google-cloud/apigee-registry').v1; + + // Instantiates a client + const apigeeregistryClient = new RegistryClient(); + + async function callRollbackApiDeployment() { + // Construct request + const request = { + name, + revisionId, + }; + + // Run request + const response = await apigeeregistryClient.rollbackApiDeployment(request); + console.log(response); + } + + callRollbackApiDeployment(); + // [END apigeeregistry_v1_generated_Registry_RollbackApiDeployment_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-apigeeregistry/samples/generated/v1/registry.rollback_api_spec.js b/packages/google-cloud-apigeeregistry/samples/generated/v1/registry.rollback_api_spec.js new file mode 100644 index 00000000000..bc7a521df81 --- /dev/null +++ b/packages/google-cloud-apigeeregistry/samples/generated/v1/registry.rollback_api_spec.js @@ -0,0 +1,68 @@ +// Copyright 2023 Google LLC +// +// Licensed under the Apache License, Version 2.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, revisionId) { + // [START apigeeregistry_v1_generated_Registry_RollbackApiSpec_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 spec being rolled back. + */ + // const name = 'abc123' + /** + * Required. The revision ID to roll back to. + * It must be a revision of the same spec. + * Example: `c7cfa2a8` + */ + // const revisionId = 'abc123' + + // Imports the Apigeeregistry library + const {RegistryClient} = require('@google-cloud/apigee-registry').v1; + + // Instantiates a client + const apigeeregistryClient = new RegistryClient(); + + async function callRollbackApiSpec() { + // Construct request + const request = { + name, + revisionId, + }; + + // Run request + const response = await apigeeregistryClient.rollbackApiSpec(request); + console.log(response); + } + + callRollbackApiSpec(); + // [END apigeeregistry_v1_generated_Registry_RollbackApiSpec_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-apigeeregistry/samples/generated/v1/registry.tag_api_deployment_revision.js b/packages/google-cloud-apigeeregistry/samples/generated/v1/registry.tag_api_deployment_revision.js new file mode 100644 index 00000000000..29cb0bd9fb6 --- /dev/null +++ b/packages/google-cloud-apigeeregistry/samples/generated/v1/registry.tag_api_deployment_revision.js @@ -0,0 +1,67 @@ +// Copyright 2023 Google LLC +// +// Licensed under the Apache License, Version 2.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, tag) { + // [START apigeeregistry_v1_generated_Registry_TagApiDeploymentRevision_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 deployment to be tagged, including the revision ID. + */ + // const name = 'abc123' + /** + * Required. The tag to apply. + * The tag should be at most 40 characters, and match `[a-z][a-z0-9-]{3,39}`. + */ + // const tag = 'abc123' + + // Imports the Apigeeregistry library + const {RegistryClient} = require('@google-cloud/apigee-registry').v1; + + // Instantiates a client + const apigeeregistryClient = new RegistryClient(); + + async function callTagApiDeploymentRevision() { + // Construct request + const request = { + name, + tag, + }; + + // Run request + const response = await apigeeregistryClient.tagApiDeploymentRevision(request); + console.log(response); + } + + callTagApiDeploymentRevision(); + // [END apigeeregistry_v1_generated_Registry_TagApiDeploymentRevision_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-apigeeregistry/samples/generated/v1/registry.tag_api_spec_revision.js b/packages/google-cloud-apigeeregistry/samples/generated/v1/registry.tag_api_spec_revision.js new file mode 100644 index 00000000000..e76171edb5f --- /dev/null +++ b/packages/google-cloud-apigeeregistry/samples/generated/v1/registry.tag_api_spec_revision.js @@ -0,0 +1,67 @@ +// Copyright 2023 Google LLC +// +// Licensed under the Apache License, Version 2.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, tag) { + // [START apigeeregistry_v1_generated_Registry_TagApiSpecRevision_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 spec to be tagged, including the revision ID. + */ + // const name = 'abc123' + /** + * Required. The tag to apply. + * The tag should be at most 40 characters, and match `[a-z][a-z0-9-]{3,39}`. + */ + // const tag = 'abc123' + + // Imports the Apigeeregistry library + const {RegistryClient} = require('@google-cloud/apigee-registry').v1; + + // Instantiates a client + const apigeeregistryClient = new RegistryClient(); + + async function callTagApiSpecRevision() { + // Construct request + const request = { + name, + tag, + }; + + // Run request + const response = await apigeeregistryClient.tagApiSpecRevision(request); + console.log(response); + } + + callTagApiSpecRevision(); + // [END apigeeregistry_v1_generated_Registry_TagApiSpecRevision_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-apigeeregistry/samples/generated/v1/registry.update_api.js b/packages/google-cloud-apigeeregistry/samples/generated/v1/registry.update_api.js new file mode 100644 index 00000000000..a4dd8524d30 --- /dev/null +++ b/packages/google-cloud-apigeeregistry/samples/generated/v1/registry.update_api.js @@ -0,0 +1,75 @@ +// Copyright 2023 Google LLC +// +// Licensed under the Apache License, Version 2.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(api) { + // [START apigeeregistry_v1_generated_Registry_UpdateApi_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 API to update. + * The `name` field is used to identify the API to update. + * Format: `projects/* /locations/* /apis/*` + */ + // const api = {} + /** + * The list of fields to be updated. If omitted, all fields are updated that + * are set in the request message (fields set to default values are ignored). + * If an asterisk "*" is specified, all fields are updated, including fields + * that are unspecified/default in the request. + */ + // const updateMask = {} + /** + * If set to true, and the API is not found, a new API will be created. + * In this situation, `update_mask` is ignored. + */ + // const allowMissing = true + + // Imports the Apigeeregistry library + const {RegistryClient} = require('@google-cloud/apigee-registry').v1; + + // Instantiates a client + const apigeeregistryClient = new RegistryClient(); + + async function callUpdateApi() { + // Construct request + const request = { + api, + }; + + // Run request + const response = await apigeeregistryClient.updateApi(request); + console.log(response); + } + + callUpdateApi(); + // [END apigeeregistry_v1_generated_Registry_UpdateApi_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-apigeeregistry/samples/generated/v1/registry.update_api_deployment.js b/packages/google-cloud-apigeeregistry/samples/generated/v1/registry.update_api_deployment.js new file mode 100644 index 00000000000..90166532846 --- /dev/null +++ b/packages/google-cloud-apigeeregistry/samples/generated/v1/registry.update_api_deployment.js @@ -0,0 +1,75 @@ +// Copyright 2023 Google LLC +// +// Licensed under the Apache License, Version 2.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(apiDeployment) { + // [START apigeeregistry_v1_generated_Registry_UpdateApiDeployment_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 deployment to update. + * The `name` field is used to identify the deployment to update. + * Format: `projects/* /locations/* /apis/* /deployments/*` + */ + // const apiDeployment = {} + /** + * The list of fields to be updated. If omitted, all fields are updated that + * are set in the request message (fields set to default values are ignored). + * If an asterisk "*" is specified, all fields are updated, including fields + * that are unspecified/default in the request. + */ + // const updateMask = {} + /** + * If set to true, and the deployment is not found, a new deployment will be + * created. In this situation, `update_mask` is ignored. + */ + // const allowMissing = true + + // Imports the Apigeeregistry library + const {RegistryClient} = require('@google-cloud/apigee-registry').v1; + + // Instantiates a client + const apigeeregistryClient = new RegistryClient(); + + async function callUpdateApiDeployment() { + // Construct request + const request = { + apiDeployment, + }; + + // Run request + const response = await apigeeregistryClient.updateApiDeployment(request); + console.log(response); + } + + callUpdateApiDeployment(); + // [END apigeeregistry_v1_generated_Registry_UpdateApiDeployment_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-apigeeregistry/samples/generated/v1/registry.update_api_spec.js b/packages/google-cloud-apigeeregistry/samples/generated/v1/registry.update_api_spec.js new file mode 100644 index 00000000000..a3f50379171 --- /dev/null +++ b/packages/google-cloud-apigeeregistry/samples/generated/v1/registry.update_api_spec.js @@ -0,0 +1,75 @@ +// Copyright 2023 Google LLC +// +// Licensed under the Apache License, Version 2.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(apiSpec) { + // [START apigeeregistry_v1_generated_Registry_UpdateApiSpec_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 spec to update. + * The `name` field is used to identify the spec to update. + * Format: `projects/* /locations/* /apis/* /versions/* /specs/*` + */ + // const apiSpec = {} + /** + * The list of fields to be updated. If omitted, all fields are updated that + * are set in the request message (fields set to default values are ignored). + * If an asterisk "*" is specified, all fields are updated, including fields + * that are unspecified/default in the request. + */ + // const updateMask = {} + /** + * If set to true, and the spec is not found, a new spec will be created. + * In this situation, `update_mask` is ignored. + */ + // const allowMissing = true + + // Imports the Apigeeregistry library + const {RegistryClient} = require('@google-cloud/apigee-registry').v1; + + // Instantiates a client + const apigeeregistryClient = new RegistryClient(); + + async function callUpdateApiSpec() { + // Construct request + const request = { + apiSpec, + }; + + // Run request + const response = await apigeeregistryClient.updateApiSpec(request); + console.log(response); + } + + callUpdateApiSpec(); + // [END apigeeregistry_v1_generated_Registry_UpdateApiSpec_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-apigeeregistry/samples/generated/v1/registry.update_api_version.js b/packages/google-cloud-apigeeregistry/samples/generated/v1/registry.update_api_version.js new file mode 100644 index 00000000000..38b633ed179 --- /dev/null +++ b/packages/google-cloud-apigeeregistry/samples/generated/v1/registry.update_api_version.js @@ -0,0 +1,75 @@ +// Copyright 2023 Google LLC +// +// Licensed under the Apache License, Version 2.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(apiVersion) { + // [START apigeeregistry_v1_generated_Registry_UpdateApiVersion_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 version to update. + * The `name` field is used to identify the version to update. + * Format: `projects/* /locations/* /apis/* /versions/*` + */ + // const apiVersion = {} + /** + * The list of fields to be updated. If omitted, all fields are updated that + * are set in the request message (fields set to default values are ignored). + * If an asterisk "*" is specified, all fields are updated, including fields + * that are unspecified/default in the request. + */ + // const updateMask = {} + /** + * If set to true, and the version is not found, a new version will be + * created. In this situation, `update_mask` is ignored. + */ + // const allowMissing = true + + // Imports the Apigeeregistry library + const {RegistryClient} = require('@google-cloud/apigee-registry').v1; + + // Instantiates a client + const apigeeregistryClient = new RegistryClient(); + + async function callUpdateApiVersion() { + // Construct request + const request = { + apiVersion, + }; + + // Run request + const response = await apigeeregistryClient.updateApiVersion(request); + console.log(response); + } + + callUpdateApiVersion(); + // [END apigeeregistry_v1_generated_Registry_UpdateApiVersion_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-apigeeregistry/samples/generated/v1/snippet_metadata.google.cloud.apigeeregistry.v1.json b/packages/google-cloud-apigeeregistry/samples/generated/v1/snippet_metadata.google.cloud.apigeeregistry.v1.json new file mode 100644 index 00000000000..3451f7b1dec --- /dev/null +++ b/packages/google-cloud-apigeeregistry/samples/generated/v1/snippet_metadata.google.cloud.apigeeregistry.v1.json @@ -0,0 +1,1723 @@ +{ + "clientLibrary": { + "name": "nodejs-apigeeregistry", + "version": "1.0.1", + "language": "TYPESCRIPT", + "apis": [ + { + "id": "google.cloud.apigeeregistry.v1", + "version": "v1" + } + ] + }, + "snippets": [ + { + "regionTag": "apigeeregistry_v1_generated_Provisioning_CreateInstance_async", + "title": "Provisioning createInstance Sample", + "origin": "API_DEFINITION", + "description": " Provisions instance resources for the Registry.", + "canonical": true, + "file": "provisioning.create_instance.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 65, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "CreateInstance", + "fullName": "google.cloud.apigeeregistry.v1.Provisioning.CreateInstance", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "instance_id", + "type": "TYPE_STRING" + }, + { + "name": "instance", + "type": ".google.cloud.apigeeregistry.v1.Instance" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "ProvisioningClient", + "fullName": "google.cloud.apigeeregistry.v1.ProvisioningClient" + }, + "method": { + "shortName": "CreateInstance", + "fullName": "google.cloud.apigeeregistry.v1.Provisioning.CreateInstance", + "service": { + "shortName": "Provisioning", + "fullName": "google.cloud.apigeeregistry.v1.Provisioning" + } + } + } + }, + { + "regionTag": "apigeeregistry_v1_generated_Provisioning_DeleteInstance_async", + "title": "Provisioning deleteInstance Sample", + "origin": "API_DEFINITION", + "description": " Deletes the Registry instance.", + "canonical": true, + "file": "provisioning.delete_instance.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 55, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "DeleteInstance", + "fullName": "google.cloud.apigeeregistry.v1.Provisioning.DeleteInstance", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "ProvisioningClient", + "fullName": "google.cloud.apigeeregistry.v1.ProvisioningClient" + }, + "method": { + "shortName": "DeleteInstance", + "fullName": "google.cloud.apigeeregistry.v1.Provisioning.DeleteInstance", + "service": { + "shortName": "Provisioning", + "fullName": "google.cloud.apigeeregistry.v1.Provisioning" + } + } + } + }, + { + "regionTag": "apigeeregistry_v1_generated_Provisioning_GetInstance_async", + "title": "Provisioning getInstance Sample", + "origin": "API_DEFINITION", + "description": " Gets details of a single Instance.", + "canonical": true, + "file": "provisioning.get_instance.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 54, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "GetInstance", + "fullName": "google.cloud.apigeeregistry.v1.Provisioning.GetInstance", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.apigeeregistry.v1.Instance", + "client": { + "shortName": "ProvisioningClient", + "fullName": "google.cloud.apigeeregistry.v1.ProvisioningClient" + }, + "method": { + "shortName": "GetInstance", + "fullName": "google.cloud.apigeeregistry.v1.Provisioning.GetInstance", + "service": { + "shortName": "Provisioning", + "fullName": "google.cloud.apigeeregistry.v1.Provisioning" + } + } + } + }, + { + "regionTag": "apigeeregistry_v1_generated_Registry_ListApis_async", + "title": "Provisioning listApis Sample", + "origin": "API_DEFINITION", + "description": " Returns matching APIs.", + "canonical": true, + "file": "registry.list_apis.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 75, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "ListApis", + "fullName": "google.cloud.apigeeregistry.v1.Registry.ListApis", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "page_size", + "type": "TYPE_INT32" + }, + { + "name": "page_token", + "type": "TYPE_STRING" + }, + { + "name": "filter", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.apigeeregistry.v1.ListApisResponse", + "client": { + "shortName": "RegistryClient", + "fullName": "google.cloud.apigeeregistry.v1.RegistryClient" + }, + "method": { + "shortName": "ListApis", + "fullName": "google.cloud.apigeeregistry.v1.Registry.ListApis", + "service": { + "shortName": "Registry", + "fullName": "google.cloud.apigeeregistry.v1.Registry" + } + } + } + }, + { + "regionTag": "apigeeregistry_v1_generated_Registry_GetApi_async", + "title": "Provisioning getApi Sample", + "origin": "API_DEFINITION", + "description": " Returns a specified API.", + "canonical": true, + "file": "registry.get_api.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 54, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "GetApi", + "fullName": "google.cloud.apigeeregistry.v1.Registry.GetApi", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.apigeeregistry.v1.Api", + "client": { + "shortName": "RegistryClient", + "fullName": "google.cloud.apigeeregistry.v1.RegistryClient" + }, + "method": { + "shortName": "GetApi", + "fullName": "google.cloud.apigeeregistry.v1.Registry.GetApi", + "service": { + "shortName": "Registry", + "fullName": "google.cloud.apigeeregistry.v1.Registry" + } + } + } + }, + { + "regionTag": "apigeeregistry_v1_generated_Registry_CreateApi_async", + "title": "Provisioning createApi Sample", + "origin": "API_DEFINITION", + "description": " Creates a specified API.", + "canonical": true, + "file": "registry.create_api.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 68, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "CreateApi", + "fullName": "google.cloud.apigeeregistry.v1.Registry.CreateApi", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "api", + "type": ".google.cloud.apigeeregistry.v1.Api" + }, + { + "name": "api_id", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.apigeeregistry.v1.Api", + "client": { + "shortName": "RegistryClient", + "fullName": "google.cloud.apigeeregistry.v1.RegistryClient" + }, + "method": { + "shortName": "CreateApi", + "fullName": "google.cloud.apigeeregistry.v1.Registry.CreateApi", + "service": { + "shortName": "Registry", + "fullName": "google.cloud.apigeeregistry.v1.Registry" + } + } + } + }, + { + "regionTag": "apigeeregistry_v1_generated_Registry_UpdateApi_async", + "title": "Provisioning updateApi Sample", + "origin": "API_DEFINITION", + "description": " Used to modify a specified API.", + "canonical": true, + "file": "registry.update_api.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 67, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "UpdateApi", + "fullName": "google.cloud.apigeeregistry.v1.Registry.UpdateApi", + "async": true, + "parameters": [ + { + "name": "api", + "type": ".google.cloud.apigeeregistry.v1.Api" + }, + { + "name": "update_mask", + "type": ".google.protobuf.FieldMask" + }, + { + "name": "allow_missing", + "type": "TYPE_BOOL" + } + ], + "resultType": ".google.cloud.apigeeregistry.v1.Api", + "client": { + "shortName": "RegistryClient", + "fullName": "google.cloud.apigeeregistry.v1.RegistryClient" + }, + "method": { + "shortName": "UpdateApi", + "fullName": "google.cloud.apigeeregistry.v1.Registry.UpdateApi", + "service": { + "shortName": "Registry", + "fullName": "google.cloud.apigeeregistry.v1.Registry" + } + } + } + }, + { + "regionTag": "apigeeregistry_v1_generated_Registry_DeleteApi_async", + "title": "Provisioning deleteApi Sample", + "origin": "API_DEFINITION", + "description": " Removes a specified API and all of the resources that it owns.", + "canonical": true, + "file": "registry.delete_api.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 59, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "DeleteApi", + "fullName": "google.cloud.apigeeregistry.v1.Registry.DeleteApi", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + }, + { + "name": "force", + "type": "TYPE_BOOL" + } + ], + "resultType": ".google.protobuf.Empty", + "client": { + "shortName": "RegistryClient", + "fullName": "google.cloud.apigeeregistry.v1.RegistryClient" + }, + "method": { + "shortName": "DeleteApi", + "fullName": "google.cloud.apigeeregistry.v1.Registry.DeleteApi", + "service": { + "shortName": "Registry", + "fullName": "google.cloud.apigeeregistry.v1.Registry" + } + } + } + }, + { + "regionTag": "apigeeregistry_v1_generated_Registry_ListApiVersions_async", + "title": "Provisioning listApiVersions Sample", + "origin": "API_DEFINITION", + "description": " Returns matching versions.", + "canonical": true, + "file": "registry.list_api_versions.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 75, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "ListApiVersions", + "fullName": "google.cloud.apigeeregistry.v1.Registry.ListApiVersions", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "page_size", + "type": "TYPE_INT32" + }, + { + "name": "page_token", + "type": "TYPE_STRING" + }, + { + "name": "filter", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.apigeeregistry.v1.ListApiVersionsResponse", + "client": { + "shortName": "RegistryClient", + "fullName": "google.cloud.apigeeregistry.v1.RegistryClient" + }, + "method": { + "shortName": "ListApiVersions", + "fullName": "google.cloud.apigeeregistry.v1.Registry.ListApiVersions", + "service": { + "shortName": "Registry", + "fullName": "google.cloud.apigeeregistry.v1.Registry" + } + } + } + }, + { + "regionTag": "apigeeregistry_v1_generated_Registry_GetApiVersion_async", + "title": "Provisioning getApiVersion Sample", + "origin": "API_DEFINITION", + "description": " Returns a specified version.", + "canonical": true, + "file": "registry.get_api_version.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 54, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "GetApiVersion", + "fullName": "google.cloud.apigeeregistry.v1.Registry.GetApiVersion", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.apigeeregistry.v1.ApiVersion", + "client": { + "shortName": "RegistryClient", + "fullName": "google.cloud.apigeeregistry.v1.RegistryClient" + }, + "method": { + "shortName": "GetApiVersion", + "fullName": "google.cloud.apigeeregistry.v1.Registry.GetApiVersion", + "service": { + "shortName": "Registry", + "fullName": "google.cloud.apigeeregistry.v1.Registry" + } + } + } + }, + { + "regionTag": "apigeeregistry_v1_generated_Registry_CreateApiVersion_async", + "title": "Provisioning createApiVersion Sample", + "origin": "API_DEFINITION", + "description": " Creates a specified version.", + "canonical": true, + "file": "registry.create_api_version.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 68, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "CreateApiVersion", + "fullName": "google.cloud.apigeeregistry.v1.Registry.CreateApiVersion", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "api_version", + "type": ".google.cloud.apigeeregistry.v1.ApiVersion" + }, + { + "name": "api_version_id", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.apigeeregistry.v1.ApiVersion", + "client": { + "shortName": "RegistryClient", + "fullName": "google.cloud.apigeeregistry.v1.RegistryClient" + }, + "method": { + "shortName": "CreateApiVersion", + "fullName": "google.cloud.apigeeregistry.v1.Registry.CreateApiVersion", + "service": { + "shortName": "Registry", + "fullName": "google.cloud.apigeeregistry.v1.Registry" + } + } + } + }, + { + "regionTag": "apigeeregistry_v1_generated_Registry_UpdateApiVersion_async", + "title": "Provisioning updateApiVersion Sample", + "origin": "API_DEFINITION", + "description": " Used to modify a specified version.", + "canonical": true, + "file": "registry.update_api_version.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 67, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "UpdateApiVersion", + "fullName": "google.cloud.apigeeregistry.v1.Registry.UpdateApiVersion", + "async": true, + "parameters": [ + { + "name": "api_version", + "type": ".google.cloud.apigeeregistry.v1.ApiVersion" + }, + { + "name": "update_mask", + "type": ".google.protobuf.FieldMask" + }, + { + "name": "allow_missing", + "type": "TYPE_BOOL" + } + ], + "resultType": ".google.cloud.apigeeregistry.v1.ApiVersion", + "client": { + "shortName": "RegistryClient", + "fullName": "google.cloud.apigeeregistry.v1.RegistryClient" + }, + "method": { + "shortName": "UpdateApiVersion", + "fullName": "google.cloud.apigeeregistry.v1.Registry.UpdateApiVersion", + "service": { + "shortName": "Registry", + "fullName": "google.cloud.apigeeregistry.v1.Registry" + } + } + } + }, + { + "regionTag": "apigeeregistry_v1_generated_Registry_DeleteApiVersion_async", + "title": "Provisioning deleteApiVersion Sample", + "origin": "API_DEFINITION", + "description": " Removes a specified version and all of the resources that it owns.", + "canonical": true, + "file": "registry.delete_api_version.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 59, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "DeleteApiVersion", + "fullName": "google.cloud.apigeeregistry.v1.Registry.DeleteApiVersion", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + }, + { + "name": "force", + "type": "TYPE_BOOL" + } + ], + "resultType": ".google.protobuf.Empty", + "client": { + "shortName": "RegistryClient", + "fullName": "google.cloud.apigeeregistry.v1.RegistryClient" + }, + "method": { + "shortName": "DeleteApiVersion", + "fullName": "google.cloud.apigeeregistry.v1.Registry.DeleteApiVersion", + "service": { + "shortName": "Registry", + "fullName": "google.cloud.apigeeregistry.v1.Registry" + } + } + } + }, + { + "regionTag": "apigeeregistry_v1_generated_Registry_ListApiSpecs_async", + "title": "Provisioning listApiSpecs Sample", + "origin": "API_DEFINITION", + "description": " Returns matching specs.", + "canonical": true, + "file": "registry.list_api_specs.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 75, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "ListApiSpecs", + "fullName": "google.cloud.apigeeregistry.v1.Registry.ListApiSpecs", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "page_size", + "type": "TYPE_INT32" + }, + { + "name": "page_token", + "type": "TYPE_STRING" + }, + { + "name": "filter", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.apigeeregistry.v1.ListApiSpecsResponse", + "client": { + "shortName": "RegistryClient", + "fullName": "google.cloud.apigeeregistry.v1.RegistryClient" + }, + "method": { + "shortName": "ListApiSpecs", + "fullName": "google.cloud.apigeeregistry.v1.Registry.ListApiSpecs", + "service": { + "shortName": "Registry", + "fullName": "google.cloud.apigeeregistry.v1.Registry" + } + } + } + }, + { + "regionTag": "apigeeregistry_v1_generated_Registry_GetApiSpec_async", + "title": "Provisioning getApiSpec Sample", + "origin": "API_DEFINITION", + "description": " Returns a specified spec.", + "canonical": true, + "file": "registry.get_api_spec.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 54, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "GetApiSpec", + "fullName": "google.cloud.apigeeregistry.v1.Registry.GetApiSpec", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.apigeeregistry.v1.ApiSpec", + "client": { + "shortName": "RegistryClient", + "fullName": "google.cloud.apigeeregistry.v1.RegistryClient" + }, + "method": { + "shortName": "GetApiSpec", + "fullName": "google.cloud.apigeeregistry.v1.Registry.GetApiSpec", + "service": { + "shortName": "Registry", + "fullName": "google.cloud.apigeeregistry.v1.Registry" + } + } + } + }, + { + "regionTag": "apigeeregistry_v1_generated_Registry_GetApiSpecContents_async", + "title": "Provisioning getApiSpecContents Sample", + "origin": "API_DEFINITION", + "description": " Returns the contents of a specified spec. If specs are stored with GZip compression, the default behavior is to return the spec uncompressed (the mime_type response field indicates the exact format returned).", + "canonical": true, + "file": "registry.get_api_spec_contents.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 54, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "GetApiSpecContents", + "fullName": "google.cloud.apigeeregistry.v1.Registry.GetApiSpecContents", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.api.HttpBody", + "client": { + "shortName": "RegistryClient", + "fullName": "google.cloud.apigeeregistry.v1.RegistryClient" + }, + "method": { + "shortName": "GetApiSpecContents", + "fullName": "google.cloud.apigeeregistry.v1.Registry.GetApiSpecContents", + "service": { + "shortName": "Registry", + "fullName": "google.cloud.apigeeregistry.v1.Registry" + } + } + } + }, + { + "regionTag": "apigeeregistry_v1_generated_Registry_CreateApiSpec_async", + "title": "Provisioning createApiSpec Sample", + "origin": "API_DEFINITION", + "description": " Creates a specified spec.", + "canonical": true, + "file": "registry.create_api_spec.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 68, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "CreateApiSpec", + "fullName": "google.cloud.apigeeregistry.v1.Registry.CreateApiSpec", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "api_spec", + "type": ".google.cloud.apigeeregistry.v1.ApiSpec" + }, + { + "name": "api_spec_id", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.apigeeregistry.v1.ApiSpec", + "client": { + "shortName": "RegistryClient", + "fullName": "google.cloud.apigeeregistry.v1.RegistryClient" + }, + "method": { + "shortName": "CreateApiSpec", + "fullName": "google.cloud.apigeeregistry.v1.Registry.CreateApiSpec", + "service": { + "shortName": "Registry", + "fullName": "google.cloud.apigeeregistry.v1.Registry" + } + } + } + }, + { + "regionTag": "apigeeregistry_v1_generated_Registry_UpdateApiSpec_async", + "title": "Provisioning updateApiSpec Sample", + "origin": "API_DEFINITION", + "description": " Used to modify a specified spec.", + "canonical": true, + "file": "registry.update_api_spec.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 67, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "UpdateApiSpec", + "fullName": "google.cloud.apigeeregistry.v1.Registry.UpdateApiSpec", + "async": true, + "parameters": [ + { + "name": "api_spec", + "type": ".google.cloud.apigeeregistry.v1.ApiSpec" + }, + { + "name": "update_mask", + "type": ".google.protobuf.FieldMask" + }, + { + "name": "allow_missing", + "type": "TYPE_BOOL" + } + ], + "resultType": ".google.cloud.apigeeregistry.v1.ApiSpec", + "client": { + "shortName": "RegistryClient", + "fullName": "google.cloud.apigeeregistry.v1.RegistryClient" + }, + "method": { + "shortName": "UpdateApiSpec", + "fullName": "google.cloud.apigeeregistry.v1.Registry.UpdateApiSpec", + "service": { + "shortName": "Registry", + "fullName": "google.cloud.apigeeregistry.v1.Registry" + } + } + } + }, + { + "regionTag": "apigeeregistry_v1_generated_Registry_DeleteApiSpec_async", + "title": "Provisioning deleteApiSpec Sample", + "origin": "API_DEFINITION", + "description": " Removes a specified spec, all revisions, and all child resources (e.g., artifacts).", + "canonical": true, + "file": "registry.delete_api_spec.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 59, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "DeleteApiSpec", + "fullName": "google.cloud.apigeeregistry.v1.Registry.DeleteApiSpec", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + }, + { + "name": "force", + "type": "TYPE_BOOL" + } + ], + "resultType": ".google.protobuf.Empty", + "client": { + "shortName": "RegistryClient", + "fullName": "google.cloud.apigeeregistry.v1.RegistryClient" + }, + "method": { + "shortName": "DeleteApiSpec", + "fullName": "google.cloud.apigeeregistry.v1.Registry.DeleteApiSpec", + "service": { + "shortName": "Registry", + "fullName": "google.cloud.apigeeregistry.v1.Registry" + } + } + } + }, + { + "regionTag": "apigeeregistry_v1_generated_Registry_TagApiSpecRevision_async", + "title": "Provisioning tagApiSpecRevision Sample", + "origin": "API_DEFINITION", + "description": " Adds a tag to a specified revision of a spec.", + "canonical": true, + "file": "registry.tag_api_spec_revision.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 59, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "TagApiSpecRevision", + "fullName": "google.cloud.apigeeregistry.v1.Registry.TagApiSpecRevision", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + }, + { + "name": "tag", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.apigeeregistry.v1.ApiSpec", + "client": { + "shortName": "RegistryClient", + "fullName": "google.cloud.apigeeregistry.v1.RegistryClient" + }, + "method": { + "shortName": "TagApiSpecRevision", + "fullName": "google.cloud.apigeeregistry.v1.Registry.TagApiSpecRevision", + "service": { + "shortName": "Registry", + "fullName": "google.cloud.apigeeregistry.v1.Registry" + } + } + } + }, + { + "regionTag": "apigeeregistry_v1_generated_Registry_ListApiSpecRevisions_async", + "title": "Provisioning listApiSpecRevisions Sample", + "origin": "API_DEFINITION", + "description": " Lists all revisions of a spec. Revisions are returned in descending order of revision creation time.", + "canonical": true, + "file": "registry.list_api_spec_revisions.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 64, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "ListApiSpecRevisions", + "fullName": "google.cloud.apigeeregistry.v1.Registry.ListApiSpecRevisions", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + }, + { + "name": "page_size", + "type": "TYPE_INT32" + }, + { + "name": "page_token", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.apigeeregistry.v1.ListApiSpecRevisionsResponse", + "client": { + "shortName": "RegistryClient", + "fullName": "google.cloud.apigeeregistry.v1.RegistryClient" + }, + "method": { + "shortName": "ListApiSpecRevisions", + "fullName": "google.cloud.apigeeregistry.v1.Registry.ListApiSpecRevisions", + "service": { + "shortName": "Registry", + "fullName": "google.cloud.apigeeregistry.v1.Registry" + } + } + } + }, + { + "regionTag": "apigeeregistry_v1_generated_Registry_RollbackApiSpec_async", + "title": "Provisioning rollbackApiSpec Sample", + "origin": "API_DEFINITION", + "description": " Sets the current revision to a specified prior revision. Note that this creates a new revision with a new revision ID.", + "canonical": true, + "file": "registry.rollback_api_spec.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 60, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "RollbackApiSpec", + "fullName": "google.cloud.apigeeregistry.v1.Registry.RollbackApiSpec", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + }, + { + "name": "revision_id", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.apigeeregistry.v1.ApiSpec", + "client": { + "shortName": "RegistryClient", + "fullName": "google.cloud.apigeeregistry.v1.RegistryClient" + }, + "method": { + "shortName": "RollbackApiSpec", + "fullName": "google.cloud.apigeeregistry.v1.Registry.RollbackApiSpec", + "service": { + "shortName": "Registry", + "fullName": "google.cloud.apigeeregistry.v1.Registry" + } + } + } + }, + { + "regionTag": "apigeeregistry_v1_generated_Registry_DeleteApiSpecRevision_async", + "title": "Provisioning deleteApiSpecRevision Sample", + "origin": "API_DEFINITION", + "description": " Deletes a revision of a spec.", + "canonical": true, + "file": "registry.delete_api_spec_revision.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 56, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "DeleteApiSpecRevision", + "fullName": "google.cloud.apigeeregistry.v1.Registry.DeleteApiSpecRevision", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.apigeeregistry.v1.ApiSpec", + "client": { + "shortName": "RegistryClient", + "fullName": "google.cloud.apigeeregistry.v1.RegistryClient" + }, + "method": { + "shortName": "DeleteApiSpecRevision", + "fullName": "google.cloud.apigeeregistry.v1.Registry.DeleteApiSpecRevision", + "service": { + "shortName": "Registry", + "fullName": "google.cloud.apigeeregistry.v1.Registry" + } + } + } + }, + { + "regionTag": "apigeeregistry_v1_generated_Registry_ListApiDeployments_async", + "title": "Provisioning listApiDeployments Sample", + "origin": "API_DEFINITION", + "description": " Returns matching deployments.", + "canonical": true, + "file": "registry.list_api_deployments.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 75, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "ListApiDeployments", + "fullName": "google.cloud.apigeeregistry.v1.Registry.ListApiDeployments", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "page_size", + "type": "TYPE_INT32" + }, + { + "name": "page_token", + "type": "TYPE_STRING" + }, + { + "name": "filter", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.apigeeregistry.v1.ListApiDeploymentsResponse", + "client": { + "shortName": "RegistryClient", + "fullName": "google.cloud.apigeeregistry.v1.RegistryClient" + }, + "method": { + "shortName": "ListApiDeployments", + "fullName": "google.cloud.apigeeregistry.v1.Registry.ListApiDeployments", + "service": { + "shortName": "Registry", + "fullName": "google.cloud.apigeeregistry.v1.Registry" + } + } + } + }, + { + "regionTag": "apigeeregistry_v1_generated_Registry_GetApiDeployment_async", + "title": "Provisioning getApiDeployment Sample", + "origin": "API_DEFINITION", + "description": " Returns a specified deployment.", + "canonical": true, + "file": "registry.get_api_deployment.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 54, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "GetApiDeployment", + "fullName": "google.cloud.apigeeregistry.v1.Registry.GetApiDeployment", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.apigeeregistry.v1.ApiDeployment", + "client": { + "shortName": "RegistryClient", + "fullName": "google.cloud.apigeeregistry.v1.RegistryClient" + }, + "method": { + "shortName": "GetApiDeployment", + "fullName": "google.cloud.apigeeregistry.v1.Registry.GetApiDeployment", + "service": { + "shortName": "Registry", + "fullName": "google.cloud.apigeeregistry.v1.Registry" + } + } + } + }, + { + "regionTag": "apigeeregistry_v1_generated_Registry_CreateApiDeployment_async", + "title": "Provisioning createApiDeployment Sample", + "origin": "API_DEFINITION", + "description": " Creates a specified deployment.", + "canonical": true, + "file": "registry.create_api_deployment.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 68, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "CreateApiDeployment", + "fullName": "google.cloud.apigeeregistry.v1.Registry.CreateApiDeployment", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "api_deployment", + "type": ".google.cloud.apigeeregistry.v1.ApiDeployment" + }, + { + "name": "api_deployment_id", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.apigeeregistry.v1.ApiDeployment", + "client": { + "shortName": "RegistryClient", + "fullName": "google.cloud.apigeeregistry.v1.RegistryClient" + }, + "method": { + "shortName": "CreateApiDeployment", + "fullName": "google.cloud.apigeeregistry.v1.Registry.CreateApiDeployment", + "service": { + "shortName": "Registry", + "fullName": "google.cloud.apigeeregistry.v1.Registry" + } + } + } + }, + { + "regionTag": "apigeeregistry_v1_generated_Registry_UpdateApiDeployment_async", + "title": "Provisioning updateApiDeployment Sample", + "origin": "API_DEFINITION", + "description": " Used to modify a specified deployment.", + "canonical": true, + "file": "registry.update_api_deployment.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 67, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "UpdateApiDeployment", + "fullName": "google.cloud.apigeeregistry.v1.Registry.UpdateApiDeployment", + "async": true, + "parameters": [ + { + "name": "api_deployment", + "type": ".google.cloud.apigeeregistry.v1.ApiDeployment" + }, + { + "name": "update_mask", + "type": ".google.protobuf.FieldMask" + }, + { + "name": "allow_missing", + "type": "TYPE_BOOL" + } + ], + "resultType": ".google.cloud.apigeeregistry.v1.ApiDeployment", + "client": { + "shortName": "RegistryClient", + "fullName": "google.cloud.apigeeregistry.v1.RegistryClient" + }, + "method": { + "shortName": "UpdateApiDeployment", + "fullName": "google.cloud.apigeeregistry.v1.Registry.UpdateApiDeployment", + "service": { + "shortName": "Registry", + "fullName": "google.cloud.apigeeregistry.v1.Registry" + } + } + } + }, + { + "regionTag": "apigeeregistry_v1_generated_Registry_DeleteApiDeployment_async", + "title": "Provisioning deleteApiDeployment Sample", + "origin": "API_DEFINITION", + "description": " Removes a specified deployment, all revisions, and all child resources (e.g., artifacts).", + "canonical": true, + "file": "registry.delete_api_deployment.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 59, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "DeleteApiDeployment", + "fullName": "google.cloud.apigeeregistry.v1.Registry.DeleteApiDeployment", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + }, + { + "name": "force", + "type": "TYPE_BOOL" + } + ], + "resultType": ".google.protobuf.Empty", + "client": { + "shortName": "RegistryClient", + "fullName": "google.cloud.apigeeregistry.v1.RegistryClient" + }, + "method": { + "shortName": "DeleteApiDeployment", + "fullName": "google.cloud.apigeeregistry.v1.Registry.DeleteApiDeployment", + "service": { + "shortName": "Registry", + "fullName": "google.cloud.apigeeregistry.v1.Registry" + } + } + } + }, + { + "regionTag": "apigeeregistry_v1_generated_Registry_TagApiDeploymentRevision_async", + "title": "Provisioning tagApiDeploymentRevision Sample", + "origin": "API_DEFINITION", + "description": " Adds a tag to a specified revision of a deployment.", + "canonical": true, + "file": "registry.tag_api_deployment_revision.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 59, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "TagApiDeploymentRevision", + "fullName": "google.cloud.apigeeregistry.v1.Registry.TagApiDeploymentRevision", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + }, + { + "name": "tag", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.apigeeregistry.v1.ApiDeployment", + "client": { + "shortName": "RegistryClient", + "fullName": "google.cloud.apigeeregistry.v1.RegistryClient" + }, + "method": { + "shortName": "TagApiDeploymentRevision", + "fullName": "google.cloud.apigeeregistry.v1.Registry.TagApiDeploymentRevision", + "service": { + "shortName": "Registry", + "fullName": "google.cloud.apigeeregistry.v1.Registry" + } + } + } + }, + { + "regionTag": "apigeeregistry_v1_generated_Registry_ListApiDeploymentRevisions_async", + "title": "Provisioning listApiDeploymentRevisions Sample", + "origin": "API_DEFINITION", + "description": " Lists all revisions of a deployment. Revisions are returned in descending order of revision creation time.", + "canonical": true, + "file": "registry.list_api_deployment_revisions.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 64, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "ListApiDeploymentRevisions", + "fullName": "google.cloud.apigeeregistry.v1.Registry.ListApiDeploymentRevisions", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + }, + { + "name": "page_size", + "type": "TYPE_INT32" + }, + { + "name": "page_token", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.apigeeregistry.v1.ListApiDeploymentRevisionsResponse", + "client": { + "shortName": "RegistryClient", + "fullName": "google.cloud.apigeeregistry.v1.RegistryClient" + }, + "method": { + "shortName": "ListApiDeploymentRevisions", + "fullName": "google.cloud.apigeeregistry.v1.Registry.ListApiDeploymentRevisions", + "service": { + "shortName": "Registry", + "fullName": "google.cloud.apigeeregistry.v1.Registry" + } + } + } + }, + { + "regionTag": "apigeeregistry_v1_generated_Registry_RollbackApiDeployment_async", + "title": "Provisioning rollbackApiDeployment Sample", + "origin": "API_DEFINITION", + "description": " Sets the current revision to a specified prior revision. Note that this creates a new revision with a new revision ID.", + "canonical": true, + "file": "registry.rollback_api_deployment.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 60, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "RollbackApiDeployment", + "fullName": "google.cloud.apigeeregistry.v1.Registry.RollbackApiDeployment", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + }, + { + "name": "revision_id", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.apigeeregistry.v1.ApiDeployment", + "client": { + "shortName": "RegistryClient", + "fullName": "google.cloud.apigeeregistry.v1.RegistryClient" + }, + "method": { + "shortName": "RollbackApiDeployment", + "fullName": "google.cloud.apigeeregistry.v1.Registry.RollbackApiDeployment", + "service": { + "shortName": "Registry", + "fullName": "google.cloud.apigeeregistry.v1.Registry" + } + } + } + }, + { + "regionTag": "apigeeregistry_v1_generated_Registry_DeleteApiDeploymentRevision_async", + "title": "Provisioning deleteApiDeploymentRevision Sample", + "origin": "API_DEFINITION", + "description": " Deletes a revision of a deployment.", + "canonical": true, + "file": "registry.delete_api_deployment_revision.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 56, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "DeleteApiDeploymentRevision", + "fullName": "google.cloud.apigeeregistry.v1.Registry.DeleteApiDeploymentRevision", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.apigeeregistry.v1.ApiDeployment", + "client": { + "shortName": "RegistryClient", + "fullName": "google.cloud.apigeeregistry.v1.RegistryClient" + }, + "method": { + "shortName": "DeleteApiDeploymentRevision", + "fullName": "google.cloud.apigeeregistry.v1.Registry.DeleteApiDeploymentRevision", + "service": { + "shortName": "Registry", + "fullName": "google.cloud.apigeeregistry.v1.Registry" + } + } + } + }, + { + "regionTag": "apigeeregistry_v1_generated_Registry_ListArtifacts_async", + "title": "Provisioning listArtifacts Sample", + "origin": "API_DEFINITION", + "description": " Returns matching artifacts.", + "canonical": true, + "file": "registry.list_artifacts.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 75, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "ListArtifacts", + "fullName": "google.cloud.apigeeregistry.v1.Registry.ListArtifacts", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "page_size", + "type": "TYPE_INT32" + }, + { + "name": "page_token", + "type": "TYPE_STRING" + }, + { + "name": "filter", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.apigeeregistry.v1.ListArtifactsResponse", + "client": { + "shortName": "RegistryClient", + "fullName": "google.cloud.apigeeregistry.v1.RegistryClient" + }, + "method": { + "shortName": "ListArtifacts", + "fullName": "google.cloud.apigeeregistry.v1.Registry.ListArtifacts", + "service": { + "shortName": "Registry", + "fullName": "google.cloud.apigeeregistry.v1.Registry" + } + } + } + }, + { + "regionTag": "apigeeregistry_v1_generated_Registry_GetArtifact_async", + "title": "Provisioning getArtifact Sample", + "origin": "API_DEFINITION", + "description": " Returns a specified artifact.", + "canonical": true, + "file": "registry.get_artifact.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 54, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "GetArtifact", + "fullName": "google.cloud.apigeeregistry.v1.Registry.GetArtifact", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.apigeeregistry.v1.Artifact", + "client": { + "shortName": "RegistryClient", + "fullName": "google.cloud.apigeeregistry.v1.RegistryClient" + }, + "method": { + "shortName": "GetArtifact", + "fullName": "google.cloud.apigeeregistry.v1.Registry.GetArtifact", + "service": { + "shortName": "Registry", + "fullName": "google.cloud.apigeeregistry.v1.Registry" + } + } + } + }, + { + "regionTag": "apigeeregistry_v1_generated_Registry_GetArtifactContents_async", + "title": "Provisioning getArtifactContents Sample", + "origin": "API_DEFINITION", + "description": " Returns the contents of a specified artifact. If artifacts are stored with GZip compression, the default behavior is to return the artifact uncompressed (the mime_type response field indicates the exact format returned).", + "canonical": true, + "file": "registry.get_artifact_contents.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 54, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "GetArtifactContents", + "fullName": "google.cloud.apigeeregistry.v1.Registry.GetArtifactContents", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.api.HttpBody", + "client": { + "shortName": "RegistryClient", + "fullName": "google.cloud.apigeeregistry.v1.RegistryClient" + }, + "method": { + "shortName": "GetArtifactContents", + "fullName": "google.cloud.apigeeregistry.v1.Registry.GetArtifactContents", + "service": { + "shortName": "Registry", + "fullName": "google.cloud.apigeeregistry.v1.Registry" + } + } + } + }, + { + "regionTag": "apigeeregistry_v1_generated_Registry_CreateArtifact_async", + "title": "Provisioning createArtifact Sample", + "origin": "API_DEFINITION", + "description": " Creates a specified artifact.", + "canonical": true, + "file": "registry.create_artifact.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 68, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "CreateArtifact", + "fullName": "google.cloud.apigeeregistry.v1.Registry.CreateArtifact", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "artifact", + "type": ".google.cloud.apigeeregistry.v1.Artifact" + }, + { + "name": "artifact_id", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.apigeeregistry.v1.Artifact", + "client": { + "shortName": "RegistryClient", + "fullName": "google.cloud.apigeeregistry.v1.RegistryClient" + }, + "method": { + "shortName": "CreateArtifact", + "fullName": "google.cloud.apigeeregistry.v1.Registry.CreateArtifact", + "service": { + "shortName": "Registry", + "fullName": "google.cloud.apigeeregistry.v1.Registry" + } + } + } + }, + { + "regionTag": "apigeeregistry_v1_generated_Registry_ReplaceArtifact_async", + "title": "Provisioning replaceArtifact Sample", + "origin": "API_DEFINITION", + "description": " Used to replace a specified artifact.", + "canonical": true, + "file": "registry.replace_artifact.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 55, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "ReplaceArtifact", + "fullName": "google.cloud.apigeeregistry.v1.Registry.ReplaceArtifact", + "async": true, + "parameters": [ + { + "name": "artifact", + "type": ".google.cloud.apigeeregistry.v1.Artifact" + } + ], + "resultType": ".google.cloud.apigeeregistry.v1.Artifact", + "client": { + "shortName": "RegistryClient", + "fullName": "google.cloud.apigeeregistry.v1.RegistryClient" + }, + "method": { + "shortName": "ReplaceArtifact", + "fullName": "google.cloud.apigeeregistry.v1.Registry.ReplaceArtifact", + "service": { + "shortName": "Registry", + "fullName": "google.cloud.apigeeregistry.v1.Registry" + } + } + } + }, + { + "regionTag": "apigeeregistry_v1_generated_Registry_DeleteArtifact_async", + "title": "Provisioning deleteArtifact Sample", + "origin": "API_DEFINITION", + "description": " Removes a specified artifact.", + "canonical": true, + "file": "registry.delete_artifact.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 54, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "DeleteArtifact", + "fullName": "google.cloud.apigeeregistry.v1.Registry.DeleteArtifact", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.protobuf.Empty", + "client": { + "shortName": "RegistryClient", + "fullName": "google.cloud.apigeeregistry.v1.RegistryClient" + }, + "method": { + "shortName": "DeleteArtifact", + "fullName": "google.cloud.apigeeregistry.v1.Registry.DeleteArtifact", + "service": { + "shortName": "Registry", + "fullName": "google.cloud.apigeeregistry.v1.Registry" + } + } + } + } + ] +} \ No newline at end of file diff --git a/packages/google-cloud-apigeeregistry/samples/generated/v1/snippet_metadata_google.cloud.apigeeregistry.v1.json b/packages/google-cloud-apigeeregistry/samples/generated/v1/snippet_metadata_google.cloud.apigeeregistry.v1.json new file mode 100644 index 00000000000..3451f7b1dec --- /dev/null +++ b/packages/google-cloud-apigeeregistry/samples/generated/v1/snippet_metadata_google.cloud.apigeeregistry.v1.json @@ -0,0 +1,1723 @@ +{ + "clientLibrary": { + "name": "nodejs-apigeeregistry", + "version": "1.0.1", + "language": "TYPESCRIPT", + "apis": [ + { + "id": "google.cloud.apigeeregistry.v1", + "version": "v1" + } + ] + }, + "snippets": [ + { + "regionTag": "apigeeregistry_v1_generated_Provisioning_CreateInstance_async", + "title": "Provisioning createInstance Sample", + "origin": "API_DEFINITION", + "description": " Provisions instance resources for the Registry.", + "canonical": true, + "file": "provisioning.create_instance.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 65, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "CreateInstance", + "fullName": "google.cloud.apigeeregistry.v1.Provisioning.CreateInstance", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "instance_id", + "type": "TYPE_STRING" + }, + { + "name": "instance", + "type": ".google.cloud.apigeeregistry.v1.Instance" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "ProvisioningClient", + "fullName": "google.cloud.apigeeregistry.v1.ProvisioningClient" + }, + "method": { + "shortName": "CreateInstance", + "fullName": "google.cloud.apigeeregistry.v1.Provisioning.CreateInstance", + "service": { + "shortName": "Provisioning", + "fullName": "google.cloud.apigeeregistry.v1.Provisioning" + } + } + } + }, + { + "regionTag": "apigeeregistry_v1_generated_Provisioning_DeleteInstance_async", + "title": "Provisioning deleteInstance Sample", + "origin": "API_DEFINITION", + "description": " Deletes the Registry instance.", + "canonical": true, + "file": "provisioning.delete_instance.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 55, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "DeleteInstance", + "fullName": "google.cloud.apigeeregistry.v1.Provisioning.DeleteInstance", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "ProvisioningClient", + "fullName": "google.cloud.apigeeregistry.v1.ProvisioningClient" + }, + "method": { + "shortName": "DeleteInstance", + "fullName": "google.cloud.apigeeregistry.v1.Provisioning.DeleteInstance", + "service": { + "shortName": "Provisioning", + "fullName": "google.cloud.apigeeregistry.v1.Provisioning" + } + } + } + }, + { + "regionTag": "apigeeregistry_v1_generated_Provisioning_GetInstance_async", + "title": "Provisioning getInstance Sample", + "origin": "API_DEFINITION", + "description": " Gets details of a single Instance.", + "canonical": true, + "file": "provisioning.get_instance.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 54, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "GetInstance", + "fullName": "google.cloud.apigeeregistry.v1.Provisioning.GetInstance", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.apigeeregistry.v1.Instance", + "client": { + "shortName": "ProvisioningClient", + "fullName": "google.cloud.apigeeregistry.v1.ProvisioningClient" + }, + "method": { + "shortName": "GetInstance", + "fullName": "google.cloud.apigeeregistry.v1.Provisioning.GetInstance", + "service": { + "shortName": "Provisioning", + "fullName": "google.cloud.apigeeregistry.v1.Provisioning" + } + } + } + }, + { + "regionTag": "apigeeregistry_v1_generated_Registry_ListApis_async", + "title": "Provisioning listApis Sample", + "origin": "API_DEFINITION", + "description": " Returns matching APIs.", + "canonical": true, + "file": "registry.list_apis.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 75, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "ListApis", + "fullName": "google.cloud.apigeeregistry.v1.Registry.ListApis", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "page_size", + "type": "TYPE_INT32" + }, + { + "name": "page_token", + "type": "TYPE_STRING" + }, + { + "name": "filter", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.apigeeregistry.v1.ListApisResponse", + "client": { + "shortName": "RegistryClient", + "fullName": "google.cloud.apigeeregistry.v1.RegistryClient" + }, + "method": { + "shortName": "ListApis", + "fullName": "google.cloud.apigeeregistry.v1.Registry.ListApis", + "service": { + "shortName": "Registry", + "fullName": "google.cloud.apigeeregistry.v1.Registry" + } + } + } + }, + { + "regionTag": "apigeeregistry_v1_generated_Registry_GetApi_async", + "title": "Provisioning getApi Sample", + "origin": "API_DEFINITION", + "description": " Returns a specified API.", + "canonical": true, + "file": "registry.get_api.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 54, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "GetApi", + "fullName": "google.cloud.apigeeregistry.v1.Registry.GetApi", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.apigeeregistry.v1.Api", + "client": { + "shortName": "RegistryClient", + "fullName": "google.cloud.apigeeregistry.v1.RegistryClient" + }, + "method": { + "shortName": "GetApi", + "fullName": "google.cloud.apigeeregistry.v1.Registry.GetApi", + "service": { + "shortName": "Registry", + "fullName": "google.cloud.apigeeregistry.v1.Registry" + } + } + } + }, + { + "regionTag": "apigeeregistry_v1_generated_Registry_CreateApi_async", + "title": "Provisioning createApi Sample", + "origin": "API_DEFINITION", + "description": " Creates a specified API.", + "canonical": true, + "file": "registry.create_api.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 68, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "CreateApi", + "fullName": "google.cloud.apigeeregistry.v1.Registry.CreateApi", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "api", + "type": ".google.cloud.apigeeregistry.v1.Api" + }, + { + "name": "api_id", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.apigeeregistry.v1.Api", + "client": { + "shortName": "RegistryClient", + "fullName": "google.cloud.apigeeregistry.v1.RegistryClient" + }, + "method": { + "shortName": "CreateApi", + "fullName": "google.cloud.apigeeregistry.v1.Registry.CreateApi", + "service": { + "shortName": "Registry", + "fullName": "google.cloud.apigeeregistry.v1.Registry" + } + } + } + }, + { + "regionTag": "apigeeregistry_v1_generated_Registry_UpdateApi_async", + "title": "Provisioning updateApi Sample", + "origin": "API_DEFINITION", + "description": " Used to modify a specified API.", + "canonical": true, + "file": "registry.update_api.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 67, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "UpdateApi", + "fullName": "google.cloud.apigeeregistry.v1.Registry.UpdateApi", + "async": true, + "parameters": [ + { + "name": "api", + "type": ".google.cloud.apigeeregistry.v1.Api" + }, + { + "name": "update_mask", + "type": ".google.protobuf.FieldMask" + }, + { + "name": "allow_missing", + "type": "TYPE_BOOL" + } + ], + "resultType": ".google.cloud.apigeeregistry.v1.Api", + "client": { + "shortName": "RegistryClient", + "fullName": "google.cloud.apigeeregistry.v1.RegistryClient" + }, + "method": { + "shortName": "UpdateApi", + "fullName": "google.cloud.apigeeregistry.v1.Registry.UpdateApi", + "service": { + "shortName": "Registry", + "fullName": "google.cloud.apigeeregistry.v1.Registry" + } + } + } + }, + { + "regionTag": "apigeeregistry_v1_generated_Registry_DeleteApi_async", + "title": "Provisioning deleteApi Sample", + "origin": "API_DEFINITION", + "description": " Removes a specified API and all of the resources that it owns.", + "canonical": true, + "file": "registry.delete_api.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 59, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "DeleteApi", + "fullName": "google.cloud.apigeeregistry.v1.Registry.DeleteApi", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + }, + { + "name": "force", + "type": "TYPE_BOOL" + } + ], + "resultType": ".google.protobuf.Empty", + "client": { + "shortName": "RegistryClient", + "fullName": "google.cloud.apigeeregistry.v1.RegistryClient" + }, + "method": { + "shortName": "DeleteApi", + "fullName": "google.cloud.apigeeregistry.v1.Registry.DeleteApi", + "service": { + "shortName": "Registry", + "fullName": "google.cloud.apigeeregistry.v1.Registry" + } + } + } + }, + { + "regionTag": "apigeeregistry_v1_generated_Registry_ListApiVersions_async", + "title": "Provisioning listApiVersions Sample", + "origin": "API_DEFINITION", + "description": " Returns matching versions.", + "canonical": true, + "file": "registry.list_api_versions.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 75, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "ListApiVersions", + "fullName": "google.cloud.apigeeregistry.v1.Registry.ListApiVersions", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "page_size", + "type": "TYPE_INT32" + }, + { + "name": "page_token", + "type": "TYPE_STRING" + }, + { + "name": "filter", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.apigeeregistry.v1.ListApiVersionsResponse", + "client": { + "shortName": "RegistryClient", + "fullName": "google.cloud.apigeeregistry.v1.RegistryClient" + }, + "method": { + "shortName": "ListApiVersions", + "fullName": "google.cloud.apigeeregistry.v1.Registry.ListApiVersions", + "service": { + "shortName": "Registry", + "fullName": "google.cloud.apigeeregistry.v1.Registry" + } + } + } + }, + { + "regionTag": "apigeeregistry_v1_generated_Registry_GetApiVersion_async", + "title": "Provisioning getApiVersion Sample", + "origin": "API_DEFINITION", + "description": " Returns a specified version.", + "canonical": true, + "file": "registry.get_api_version.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 54, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "GetApiVersion", + "fullName": "google.cloud.apigeeregistry.v1.Registry.GetApiVersion", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.apigeeregistry.v1.ApiVersion", + "client": { + "shortName": "RegistryClient", + "fullName": "google.cloud.apigeeregistry.v1.RegistryClient" + }, + "method": { + "shortName": "GetApiVersion", + "fullName": "google.cloud.apigeeregistry.v1.Registry.GetApiVersion", + "service": { + "shortName": "Registry", + "fullName": "google.cloud.apigeeregistry.v1.Registry" + } + } + } + }, + { + "regionTag": "apigeeregistry_v1_generated_Registry_CreateApiVersion_async", + "title": "Provisioning createApiVersion Sample", + "origin": "API_DEFINITION", + "description": " Creates a specified version.", + "canonical": true, + "file": "registry.create_api_version.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 68, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "CreateApiVersion", + "fullName": "google.cloud.apigeeregistry.v1.Registry.CreateApiVersion", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "api_version", + "type": ".google.cloud.apigeeregistry.v1.ApiVersion" + }, + { + "name": "api_version_id", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.apigeeregistry.v1.ApiVersion", + "client": { + "shortName": "RegistryClient", + "fullName": "google.cloud.apigeeregistry.v1.RegistryClient" + }, + "method": { + "shortName": "CreateApiVersion", + "fullName": "google.cloud.apigeeregistry.v1.Registry.CreateApiVersion", + "service": { + "shortName": "Registry", + "fullName": "google.cloud.apigeeregistry.v1.Registry" + } + } + } + }, + { + "regionTag": "apigeeregistry_v1_generated_Registry_UpdateApiVersion_async", + "title": "Provisioning updateApiVersion Sample", + "origin": "API_DEFINITION", + "description": " Used to modify a specified version.", + "canonical": true, + "file": "registry.update_api_version.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 67, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "UpdateApiVersion", + "fullName": "google.cloud.apigeeregistry.v1.Registry.UpdateApiVersion", + "async": true, + "parameters": [ + { + "name": "api_version", + "type": ".google.cloud.apigeeregistry.v1.ApiVersion" + }, + { + "name": "update_mask", + "type": ".google.protobuf.FieldMask" + }, + { + "name": "allow_missing", + "type": "TYPE_BOOL" + } + ], + "resultType": ".google.cloud.apigeeregistry.v1.ApiVersion", + "client": { + "shortName": "RegistryClient", + "fullName": "google.cloud.apigeeregistry.v1.RegistryClient" + }, + "method": { + "shortName": "UpdateApiVersion", + "fullName": "google.cloud.apigeeregistry.v1.Registry.UpdateApiVersion", + "service": { + "shortName": "Registry", + "fullName": "google.cloud.apigeeregistry.v1.Registry" + } + } + } + }, + { + "regionTag": "apigeeregistry_v1_generated_Registry_DeleteApiVersion_async", + "title": "Provisioning deleteApiVersion Sample", + "origin": "API_DEFINITION", + "description": " Removes a specified version and all of the resources that it owns.", + "canonical": true, + "file": "registry.delete_api_version.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 59, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "DeleteApiVersion", + "fullName": "google.cloud.apigeeregistry.v1.Registry.DeleteApiVersion", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + }, + { + "name": "force", + "type": "TYPE_BOOL" + } + ], + "resultType": ".google.protobuf.Empty", + "client": { + "shortName": "RegistryClient", + "fullName": "google.cloud.apigeeregistry.v1.RegistryClient" + }, + "method": { + "shortName": "DeleteApiVersion", + "fullName": "google.cloud.apigeeregistry.v1.Registry.DeleteApiVersion", + "service": { + "shortName": "Registry", + "fullName": "google.cloud.apigeeregistry.v1.Registry" + } + } + } + }, + { + "regionTag": "apigeeregistry_v1_generated_Registry_ListApiSpecs_async", + "title": "Provisioning listApiSpecs Sample", + "origin": "API_DEFINITION", + "description": " Returns matching specs.", + "canonical": true, + "file": "registry.list_api_specs.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 75, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "ListApiSpecs", + "fullName": "google.cloud.apigeeregistry.v1.Registry.ListApiSpecs", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "page_size", + "type": "TYPE_INT32" + }, + { + "name": "page_token", + "type": "TYPE_STRING" + }, + { + "name": "filter", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.apigeeregistry.v1.ListApiSpecsResponse", + "client": { + "shortName": "RegistryClient", + "fullName": "google.cloud.apigeeregistry.v1.RegistryClient" + }, + "method": { + "shortName": "ListApiSpecs", + "fullName": "google.cloud.apigeeregistry.v1.Registry.ListApiSpecs", + "service": { + "shortName": "Registry", + "fullName": "google.cloud.apigeeregistry.v1.Registry" + } + } + } + }, + { + "regionTag": "apigeeregistry_v1_generated_Registry_GetApiSpec_async", + "title": "Provisioning getApiSpec Sample", + "origin": "API_DEFINITION", + "description": " Returns a specified spec.", + "canonical": true, + "file": "registry.get_api_spec.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 54, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "GetApiSpec", + "fullName": "google.cloud.apigeeregistry.v1.Registry.GetApiSpec", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.apigeeregistry.v1.ApiSpec", + "client": { + "shortName": "RegistryClient", + "fullName": "google.cloud.apigeeregistry.v1.RegistryClient" + }, + "method": { + "shortName": "GetApiSpec", + "fullName": "google.cloud.apigeeregistry.v1.Registry.GetApiSpec", + "service": { + "shortName": "Registry", + "fullName": "google.cloud.apigeeregistry.v1.Registry" + } + } + } + }, + { + "regionTag": "apigeeregistry_v1_generated_Registry_GetApiSpecContents_async", + "title": "Provisioning getApiSpecContents Sample", + "origin": "API_DEFINITION", + "description": " Returns the contents of a specified spec. If specs are stored with GZip compression, the default behavior is to return the spec uncompressed (the mime_type response field indicates the exact format returned).", + "canonical": true, + "file": "registry.get_api_spec_contents.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 54, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "GetApiSpecContents", + "fullName": "google.cloud.apigeeregistry.v1.Registry.GetApiSpecContents", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.api.HttpBody", + "client": { + "shortName": "RegistryClient", + "fullName": "google.cloud.apigeeregistry.v1.RegistryClient" + }, + "method": { + "shortName": "GetApiSpecContents", + "fullName": "google.cloud.apigeeregistry.v1.Registry.GetApiSpecContents", + "service": { + "shortName": "Registry", + "fullName": "google.cloud.apigeeregistry.v1.Registry" + } + } + } + }, + { + "regionTag": "apigeeregistry_v1_generated_Registry_CreateApiSpec_async", + "title": "Provisioning createApiSpec Sample", + "origin": "API_DEFINITION", + "description": " Creates a specified spec.", + "canonical": true, + "file": "registry.create_api_spec.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 68, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "CreateApiSpec", + "fullName": "google.cloud.apigeeregistry.v1.Registry.CreateApiSpec", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "api_spec", + "type": ".google.cloud.apigeeregistry.v1.ApiSpec" + }, + { + "name": "api_spec_id", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.apigeeregistry.v1.ApiSpec", + "client": { + "shortName": "RegistryClient", + "fullName": "google.cloud.apigeeregistry.v1.RegistryClient" + }, + "method": { + "shortName": "CreateApiSpec", + "fullName": "google.cloud.apigeeregistry.v1.Registry.CreateApiSpec", + "service": { + "shortName": "Registry", + "fullName": "google.cloud.apigeeregistry.v1.Registry" + } + } + } + }, + { + "regionTag": "apigeeregistry_v1_generated_Registry_UpdateApiSpec_async", + "title": "Provisioning updateApiSpec Sample", + "origin": "API_DEFINITION", + "description": " Used to modify a specified spec.", + "canonical": true, + "file": "registry.update_api_spec.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 67, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "UpdateApiSpec", + "fullName": "google.cloud.apigeeregistry.v1.Registry.UpdateApiSpec", + "async": true, + "parameters": [ + { + "name": "api_spec", + "type": ".google.cloud.apigeeregistry.v1.ApiSpec" + }, + { + "name": "update_mask", + "type": ".google.protobuf.FieldMask" + }, + { + "name": "allow_missing", + "type": "TYPE_BOOL" + } + ], + "resultType": ".google.cloud.apigeeregistry.v1.ApiSpec", + "client": { + "shortName": "RegistryClient", + "fullName": "google.cloud.apigeeregistry.v1.RegistryClient" + }, + "method": { + "shortName": "UpdateApiSpec", + "fullName": "google.cloud.apigeeregistry.v1.Registry.UpdateApiSpec", + "service": { + "shortName": "Registry", + "fullName": "google.cloud.apigeeregistry.v1.Registry" + } + } + } + }, + { + "regionTag": "apigeeregistry_v1_generated_Registry_DeleteApiSpec_async", + "title": "Provisioning deleteApiSpec Sample", + "origin": "API_DEFINITION", + "description": " Removes a specified spec, all revisions, and all child resources (e.g., artifacts).", + "canonical": true, + "file": "registry.delete_api_spec.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 59, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "DeleteApiSpec", + "fullName": "google.cloud.apigeeregistry.v1.Registry.DeleteApiSpec", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + }, + { + "name": "force", + "type": "TYPE_BOOL" + } + ], + "resultType": ".google.protobuf.Empty", + "client": { + "shortName": "RegistryClient", + "fullName": "google.cloud.apigeeregistry.v1.RegistryClient" + }, + "method": { + "shortName": "DeleteApiSpec", + "fullName": "google.cloud.apigeeregistry.v1.Registry.DeleteApiSpec", + "service": { + "shortName": "Registry", + "fullName": "google.cloud.apigeeregistry.v1.Registry" + } + } + } + }, + { + "regionTag": "apigeeregistry_v1_generated_Registry_TagApiSpecRevision_async", + "title": "Provisioning tagApiSpecRevision Sample", + "origin": "API_DEFINITION", + "description": " Adds a tag to a specified revision of a spec.", + "canonical": true, + "file": "registry.tag_api_spec_revision.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 59, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "TagApiSpecRevision", + "fullName": "google.cloud.apigeeregistry.v1.Registry.TagApiSpecRevision", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + }, + { + "name": "tag", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.apigeeregistry.v1.ApiSpec", + "client": { + "shortName": "RegistryClient", + "fullName": "google.cloud.apigeeregistry.v1.RegistryClient" + }, + "method": { + "shortName": "TagApiSpecRevision", + "fullName": "google.cloud.apigeeregistry.v1.Registry.TagApiSpecRevision", + "service": { + "shortName": "Registry", + "fullName": "google.cloud.apigeeregistry.v1.Registry" + } + } + } + }, + { + "regionTag": "apigeeregistry_v1_generated_Registry_ListApiSpecRevisions_async", + "title": "Provisioning listApiSpecRevisions Sample", + "origin": "API_DEFINITION", + "description": " Lists all revisions of a spec. Revisions are returned in descending order of revision creation time.", + "canonical": true, + "file": "registry.list_api_spec_revisions.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 64, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "ListApiSpecRevisions", + "fullName": "google.cloud.apigeeregistry.v1.Registry.ListApiSpecRevisions", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + }, + { + "name": "page_size", + "type": "TYPE_INT32" + }, + { + "name": "page_token", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.apigeeregistry.v1.ListApiSpecRevisionsResponse", + "client": { + "shortName": "RegistryClient", + "fullName": "google.cloud.apigeeregistry.v1.RegistryClient" + }, + "method": { + "shortName": "ListApiSpecRevisions", + "fullName": "google.cloud.apigeeregistry.v1.Registry.ListApiSpecRevisions", + "service": { + "shortName": "Registry", + "fullName": "google.cloud.apigeeregistry.v1.Registry" + } + } + } + }, + { + "regionTag": "apigeeregistry_v1_generated_Registry_RollbackApiSpec_async", + "title": "Provisioning rollbackApiSpec Sample", + "origin": "API_DEFINITION", + "description": " Sets the current revision to a specified prior revision. Note that this creates a new revision with a new revision ID.", + "canonical": true, + "file": "registry.rollback_api_spec.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 60, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "RollbackApiSpec", + "fullName": "google.cloud.apigeeregistry.v1.Registry.RollbackApiSpec", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + }, + { + "name": "revision_id", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.apigeeregistry.v1.ApiSpec", + "client": { + "shortName": "RegistryClient", + "fullName": "google.cloud.apigeeregistry.v1.RegistryClient" + }, + "method": { + "shortName": "RollbackApiSpec", + "fullName": "google.cloud.apigeeregistry.v1.Registry.RollbackApiSpec", + "service": { + "shortName": "Registry", + "fullName": "google.cloud.apigeeregistry.v1.Registry" + } + } + } + }, + { + "regionTag": "apigeeregistry_v1_generated_Registry_DeleteApiSpecRevision_async", + "title": "Provisioning deleteApiSpecRevision Sample", + "origin": "API_DEFINITION", + "description": " Deletes a revision of a spec.", + "canonical": true, + "file": "registry.delete_api_spec_revision.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 56, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "DeleteApiSpecRevision", + "fullName": "google.cloud.apigeeregistry.v1.Registry.DeleteApiSpecRevision", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.apigeeregistry.v1.ApiSpec", + "client": { + "shortName": "RegistryClient", + "fullName": "google.cloud.apigeeregistry.v1.RegistryClient" + }, + "method": { + "shortName": "DeleteApiSpecRevision", + "fullName": "google.cloud.apigeeregistry.v1.Registry.DeleteApiSpecRevision", + "service": { + "shortName": "Registry", + "fullName": "google.cloud.apigeeregistry.v1.Registry" + } + } + } + }, + { + "regionTag": "apigeeregistry_v1_generated_Registry_ListApiDeployments_async", + "title": "Provisioning listApiDeployments Sample", + "origin": "API_DEFINITION", + "description": " Returns matching deployments.", + "canonical": true, + "file": "registry.list_api_deployments.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 75, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "ListApiDeployments", + "fullName": "google.cloud.apigeeregistry.v1.Registry.ListApiDeployments", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "page_size", + "type": "TYPE_INT32" + }, + { + "name": "page_token", + "type": "TYPE_STRING" + }, + { + "name": "filter", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.apigeeregistry.v1.ListApiDeploymentsResponse", + "client": { + "shortName": "RegistryClient", + "fullName": "google.cloud.apigeeregistry.v1.RegistryClient" + }, + "method": { + "shortName": "ListApiDeployments", + "fullName": "google.cloud.apigeeregistry.v1.Registry.ListApiDeployments", + "service": { + "shortName": "Registry", + "fullName": "google.cloud.apigeeregistry.v1.Registry" + } + } + } + }, + { + "regionTag": "apigeeregistry_v1_generated_Registry_GetApiDeployment_async", + "title": "Provisioning getApiDeployment Sample", + "origin": "API_DEFINITION", + "description": " Returns a specified deployment.", + "canonical": true, + "file": "registry.get_api_deployment.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 54, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "GetApiDeployment", + "fullName": "google.cloud.apigeeregistry.v1.Registry.GetApiDeployment", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.apigeeregistry.v1.ApiDeployment", + "client": { + "shortName": "RegistryClient", + "fullName": "google.cloud.apigeeregistry.v1.RegistryClient" + }, + "method": { + "shortName": "GetApiDeployment", + "fullName": "google.cloud.apigeeregistry.v1.Registry.GetApiDeployment", + "service": { + "shortName": "Registry", + "fullName": "google.cloud.apigeeregistry.v1.Registry" + } + } + } + }, + { + "regionTag": "apigeeregistry_v1_generated_Registry_CreateApiDeployment_async", + "title": "Provisioning createApiDeployment Sample", + "origin": "API_DEFINITION", + "description": " Creates a specified deployment.", + "canonical": true, + "file": "registry.create_api_deployment.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 68, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "CreateApiDeployment", + "fullName": "google.cloud.apigeeregistry.v1.Registry.CreateApiDeployment", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "api_deployment", + "type": ".google.cloud.apigeeregistry.v1.ApiDeployment" + }, + { + "name": "api_deployment_id", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.apigeeregistry.v1.ApiDeployment", + "client": { + "shortName": "RegistryClient", + "fullName": "google.cloud.apigeeregistry.v1.RegistryClient" + }, + "method": { + "shortName": "CreateApiDeployment", + "fullName": "google.cloud.apigeeregistry.v1.Registry.CreateApiDeployment", + "service": { + "shortName": "Registry", + "fullName": "google.cloud.apigeeregistry.v1.Registry" + } + } + } + }, + { + "regionTag": "apigeeregistry_v1_generated_Registry_UpdateApiDeployment_async", + "title": "Provisioning updateApiDeployment Sample", + "origin": "API_DEFINITION", + "description": " Used to modify a specified deployment.", + "canonical": true, + "file": "registry.update_api_deployment.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 67, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "UpdateApiDeployment", + "fullName": "google.cloud.apigeeregistry.v1.Registry.UpdateApiDeployment", + "async": true, + "parameters": [ + { + "name": "api_deployment", + "type": ".google.cloud.apigeeregistry.v1.ApiDeployment" + }, + { + "name": "update_mask", + "type": ".google.protobuf.FieldMask" + }, + { + "name": "allow_missing", + "type": "TYPE_BOOL" + } + ], + "resultType": ".google.cloud.apigeeregistry.v1.ApiDeployment", + "client": { + "shortName": "RegistryClient", + "fullName": "google.cloud.apigeeregistry.v1.RegistryClient" + }, + "method": { + "shortName": "UpdateApiDeployment", + "fullName": "google.cloud.apigeeregistry.v1.Registry.UpdateApiDeployment", + "service": { + "shortName": "Registry", + "fullName": "google.cloud.apigeeregistry.v1.Registry" + } + } + } + }, + { + "regionTag": "apigeeregistry_v1_generated_Registry_DeleteApiDeployment_async", + "title": "Provisioning deleteApiDeployment Sample", + "origin": "API_DEFINITION", + "description": " Removes a specified deployment, all revisions, and all child resources (e.g., artifacts).", + "canonical": true, + "file": "registry.delete_api_deployment.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 59, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "DeleteApiDeployment", + "fullName": "google.cloud.apigeeregistry.v1.Registry.DeleteApiDeployment", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + }, + { + "name": "force", + "type": "TYPE_BOOL" + } + ], + "resultType": ".google.protobuf.Empty", + "client": { + "shortName": "RegistryClient", + "fullName": "google.cloud.apigeeregistry.v1.RegistryClient" + }, + "method": { + "shortName": "DeleteApiDeployment", + "fullName": "google.cloud.apigeeregistry.v1.Registry.DeleteApiDeployment", + "service": { + "shortName": "Registry", + "fullName": "google.cloud.apigeeregistry.v1.Registry" + } + } + } + }, + { + "regionTag": "apigeeregistry_v1_generated_Registry_TagApiDeploymentRevision_async", + "title": "Provisioning tagApiDeploymentRevision Sample", + "origin": "API_DEFINITION", + "description": " Adds a tag to a specified revision of a deployment.", + "canonical": true, + "file": "registry.tag_api_deployment_revision.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 59, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "TagApiDeploymentRevision", + "fullName": "google.cloud.apigeeregistry.v1.Registry.TagApiDeploymentRevision", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + }, + { + "name": "tag", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.apigeeregistry.v1.ApiDeployment", + "client": { + "shortName": "RegistryClient", + "fullName": "google.cloud.apigeeregistry.v1.RegistryClient" + }, + "method": { + "shortName": "TagApiDeploymentRevision", + "fullName": "google.cloud.apigeeregistry.v1.Registry.TagApiDeploymentRevision", + "service": { + "shortName": "Registry", + "fullName": "google.cloud.apigeeregistry.v1.Registry" + } + } + } + }, + { + "regionTag": "apigeeregistry_v1_generated_Registry_ListApiDeploymentRevisions_async", + "title": "Provisioning listApiDeploymentRevisions Sample", + "origin": "API_DEFINITION", + "description": " Lists all revisions of a deployment. Revisions are returned in descending order of revision creation time.", + "canonical": true, + "file": "registry.list_api_deployment_revisions.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 64, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "ListApiDeploymentRevisions", + "fullName": "google.cloud.apigeeregistry.v1.Registry.ListApiDeploymentRevisions", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + }, + { + "name": "page_size", + "type": "TYPE_INT32" + }, + { + "name": "page_token", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.apigeeregistry.v1.ListApiDeploymentRevisionsResponse", + "client": { + "shortName": "RegistryClient", + "fullName": "google.cloud.apigeeregistry.v1.RegistryClient" + }, + "method": { + "shortName": "ListApiDeploymentRevisions", + "fullName": "google.cloud.apigeeregistry.v1.Registry.ListApiDeploymentRevisions", + "service": { + "shortName": "Registry", + "fullName": "google.cloud.apigeeregistry.v1.Registry" + } + } + } + }, + { + "regionTag": "apigeeregistry_v1_generated_Registry_RollbackApiDeployment_async", + "title": "Provisioning rollbackApiDeployment Sample", + "origin": "API_DEFINITION", + "description": " Sets the current revision to a specified prior revision. Note that this creates a new revision with a new revision ID.", + "canonical": true, + "file": "registry.rollback_api_deployment.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 60, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "RollbackApiDeployment", + "fullName": "google.cloud.apigeeregistry.v1.Registry.RollbackApiDeployment", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + }, + { + "name": "revision_id", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.apigeeregistry.v1.ApiDeployment", + "client": { + "shortName": "RegistryClient", + "fullName": "google.cloud.apigeeregistry.v1.RegistryClient" + }, + "method": { + "shortName": "RollbackApiDeployment", + "fullName": "google.cloud.apigeeregistry.v1.Registry.RollbackApiDeployment", + "service": { + "shortName": "Registry", + "fullName": "google.cloud.apigeeregistry.v1.Registry" + } + } + } + }, + { + "regionTag": "apigeeregistry_v1_generated_Registry_DeleteApiDeploymentRevision_async", + "title": "Provisioning deleteApiDeploymentRevision Sample", + "origin": "API_DEFINITION", + "description": " Deletes a revision of a deployment.", + "canonical": true, + "file": "registry.delete_api_deployment_revision.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 56, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "DeleteApiDeploymentRevision", + "fullName": "google.cloud.apigeeregistry.v1.Registry.DeleteApiDeploymentRevision", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.apigeeregistry.v1.ApiDeployment", + "client": { + "shortName": "RegistryClient", + "fullName": "google.cloud.apigeeregistry.v1.RegistryClient" + }, + "method": { + "shortName": "DeleteApiDeploymentRevision", + "fullName": "google.cloud.apigeeregistry.v1.Registry.DeleteApiDeploymentRevision", + "service": { + "shortName": "Registry", + "fullName": "google.cloud.apigeeregistry.v1.Registry" + } + } + } + }, + { + "regionTag": "apigeeregistry_v1_generated_Registry_ListArtifacts_async", + "title": "Provisioning listArtifacts Sample", + "origin": "API_DEFINITION", + "description": " Returns matching artifacts.", + "canonical": true, + "file": "registry.list_artifacts.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 75, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "ListArtifacts", + "fullName": "google.cloud.apigeeregistry.v1.Registry.ListArtifacts", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "page_size", + "type": "TYPE_INT32" + }, + { + "name": "page_token", + "type": "TYPE_STRING" + }, + { + "name": "filter", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.apigeeregistry.v1.ListArtifactsResponse", + "client": { + "shortName": "RegistryClient", + "fullName": "google.cloud.apigeeregistry.v1.RegistryClient" + }, + "method": { + "shortName": "ListArtifacts", + "fullName": "google.cloud.apigeeregistry.v1.Registry.ListArtifacts", + "service": { + "shortName": "Registry", + "fullName": "google.cloud.apigeeregistry.v1.Registry" + } + } + } + }, + { + "regionTag": "apigeeregistry_v1_generated_Registry_GetArtifact_async", + "title": "Provisioning getArtifact Sample", + "origin": "API_DEFINITION", + "description": " Returns a specified artifact.", + "canonical": true, + "file": "registry.get_artifact.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 54, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "GetArtifact", + "fullName": "google.cloud.apigeeregistry.v1.Registry.GetArtifact", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.apigeeregistry.v1.Artifact", + "client": { + "shortName": "RegistryClient", + "fullName": "google.cloud.apigeeregistry.v1.RegistryClient" + }, + "method": { + "shortName": "GetArtifact", + "fullName": "google.cloud.apigeeregistry.v1.Registry.GetArtifact", + "service": { + "shortName": "Registry", + "fullName": "google.cloud.apigeeregistry.v1.Registry" + } + } + } + }, + { + "regionTag": "apigeeregistry_v1_generated_Registry_GetArtifactContents_async", + "title": "Provisioning getArtifactContents Sample", + "origin": "API_DEFINITION", + "description": " Returns the contents of a specified artifact. If artifacts are stored with GZip compression, the default behavior is to return the artifact uncompressed (the mime_type response field indicates the exact format returned).", + "canonical": true, + "file": "registry.get_artifact_contents.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 54, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "GetArtifactContents", + "fullName": "google.cloud.apigeeregistry.v1.Registry.GetArtifactContents", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.api.HttpBody", + "client": { + "shortName": "RegistryClient", + "fullName": "google.cloud.apigeeregistry.v1.RegistryClient" + }, + "method": { + "shortName": "GetArtifactContents", + "fullName": "google.cloud.apigeeregistry.v1.Registry.GetArtifactContents", + "service": { + "shortName": "Registry", + "fullName": "google.cloud.apigeeregistry.v1.Registry" + } + } + } + }, + { + "regionTag": "apigeeregistry_v1_generated_Registry_CreateArtifact_async", + "title": "Provisioning createArtifact Sample", + "origin": "API_DEFINITION", + "description": " Creates a specified artifact.", + "canonical": true, + "file": "registry.create_artifact.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 68, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "CreateArtifact", + "fullName": "google.cloud.apigeeregistry.v1.Registry.CreateArtifact", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "artifact", + "type": ".google.cloud.apigeeregistry.v1.Artifact" + }, + { + "name": "artifact_id", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.apigeeregistry.v1.Artifact", + "client": { + "shortName": "RegistryClient", + "fullName": "google.cloud.apigeeregistry.v1.RegistryClient" + }, + "method": { + "shortName": "CreateArtifact", + "fullName": "google.cloud.apigeeregistry.v1.Registry.CreateArtifact", + "service": { + "shortName": "Registry", + "fullName": "google.cloud.apigeeregistry.v1.Registry" + } + } + } + }, + { + "regionTag": "apigeeregistry_v1_generated_Registry_ReplaceArtifact_async", + "title": "Provisioning replaceArtifact Sample", + "origin": "API_DEFINITION", + "description": " Used to replace a specified artifact.", + "canonical": true, + "file": "registry.replace_artifact.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 55, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "ReplaceArtifact", + "fullName": "google.cloud.apigeeregistry.v1.Registry.ReplaceArtifact", + "async": true, + "parameters": [ + { + "name": "artifact", + "type": ".google.cloud.apigeeregistry.v1.Artifact" + } + ], + "resultType": ".google.cloud.apigeeregistry.v1.Artifact", + "client": { + "shortName": "RegistryClient", + "fullName": "google.cloud.apigeeregistry.v1.RegistryClient" + }, + "method": { + "shortName": "ReplaceArtifact", + "fullName": "google.cloud.apigeeregistry.v1.Registry.ReplaceArtifact", + "service": { + "shortName": "Registry", + "fullName": "google.cloud.apigeeregistry.v1.Registry" + } + } + } + }, + { + "regionTag": "apigeeregistry_v1_generated_Registry_DeleteArtifact_async", + "title": "Provisioning deleteArtifact Sample", + "origin": "API_DEFINITION", + "description": " Removes a specified artifact.", + "canonical": true, + "file": "registry.delete_artifact.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 54, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "DeleteArtifact", + "fullName": "google.cloud.apigeeregistry.v1.Registry.DeleteArtifact", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.protobuf.Empty", + "client": { + "shortName": "RegistryClient", + "fullName": "google.cloud.apigeeregistry.v1.RegistryClient" + }, + "method": { + "shortName": "DeleteArtifact", + "fullName": "google.cloud.apigeeregistry.v1.Registry.DeleteArtifact", + "service": { + "shortName": "Registry", + "fullName": "google.cloud.apigeeregistry.v1.Registry" + } + } + } + } + ] +} \ No newline at end of file diff --git a/packages/google-cloud-apigeeregistry/samples/package.json b/packages/google-cloud-apigeeregistry/samples/package.json new file mode 100644 index 00000000000..ef33dd9b337 --- /dev/null +++ b/packages/google-cloud-apigeeregistry/samples/package.json @@ -0,0 +1,23 @@ +{ + "name": "nodejs-apigee-registry", + "private": true, + "license": "Apache-2.0", + "author": "Google LLC", + "engines": { + "node": ">=14.0.0" + }, + "files": [ + "*.js" + ], + "scripts": { + "test": "c8 mocha --timeout 600000 test/*.js" + }, + "dependencies": { + "@google-cloud/apigee-registry": "^1.0.1" + }, + "devDependencies": { + "c8": "^7.1.0", + "chai": "^4.2.0", + "mocha": "^10.0.0" + } +} \ No newline at end of file diff --git a/packages/google-cloud-apigeeregistry/samples/quickstart.js b/packages/google-cloud-apigeeregistry/samples/quickstart.js new file mode 100644 index 00000000000..9a0be9c5434 --- /dev/null +++ b/packages/google-cloud-apigeeregistry/samples/quickstart.js @@ -0,0 +1,78 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** 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 apigeeregistry_v1_generated_Registry_ListApis_async] + /** + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The parent, which owns this collection of APIs. + * Format: projects/* /locations/* + */ + // const parent = 'abc123' + /** + * The maximum number of APIs to return. + * The service may return fewer than this value. + * If unspecified, at most 50 values will be returned. + * The maximum is 1000; values above 1000 will be coerced to 1000. + */ + // const pageSize = 1234 + /** + * A page token, received from a previous `ListApis` call. + * Provide this to retrieve the subsequent page. + * When paginating, all other parameters provided to `ListApis` must match + * the call that provided the page token. + */ + // const pageToken = 'abc123' + /** + * An expression that can be used to filter the list. Filters use the Common + * Expression Language and can refer to all message fields. + */ + // const filter = 'abc123' + + // Imports the Apigeeregistry library + const {RegistryClient} = require('@google-cloud/apigee-registry').v1; + + // Instantiates a client + const apigeeregistryClient = new RegistryClient(); + + async function callListApis() { + // Construct request + const request = { + parent, + }; + + // Run request + const iterable = await apigeeregistryClient.listApisAsync(request); + for await (const response of iterable) { + console.log(response); + } + } + + callListApis(); + // [END apigeeregistry_v1_generated_Registry_ListApis_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-apigeeregistry/samples/test/quickstart.js b/packages/google-cloud-apigeeregistry/samples/test/quickstart.js new file mode 100644 index 00000000000..4603baafd9e --- /dev/null +++ b/packages/google-cloud-apigeeregistry/samples/test/quickstart.js @@ -0,0 +1,51 @@ +// +// Licensed under the Apache License, Version 2.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'; + +const path = require('path'); +const cp = require('child_process'); +const {before, describe, it} = require('mocha'); +// eslint-disable-next-line node/no-missing-require +const {RegistryClient} = require('@google-cloud/apigee-registry'); +// eslint-disable-next-line no-unused-vars, node/no-missing-require +const {assert} = require('chai'); + +const execSync = cmd => cp.execSync(cmd, {encoding: 'utf-8'}); + +const cwd = path.join(__dirname, '..'); + +const client = new RegistryClient(); + +describe('Quickstart', () => { + //TODO: remove this if not using the projectId + // eslint-disable-next-line no-unused-vars + let projectId; + + before(async () => { + // eslint-disable-next-line no-unused-vars + projectId = await client.getProjectId(); + }); + + it('should run quickstart', async () => { + assert.throws(() => { + execSync(`node ./quickstart.js projects/${projectId}/locations/global`, { + cwd, + }); + }, /9 FAILED_PRECONDITION/); + }); +}); diff --git a/packages/google-cloud-apigeeregistry/src/index.ts b/packages/google-cloud-apigeeregistry/src/index.ts new file mode 100644 index 00000000000..2d705994a3a --- /dev/null +++ b/packages/google-cloud-apigeeregistry/src/index.ts @@ -0,0 +1,29 @@ +// Copyright 2023 Google LLC +// +// Licensed under the Apache License, Version 2.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. ** + +import * as v1 from './v1'; + +const ProvisioningClient = v1.ProvisioningClient; +type ProvisioningClient = v1.ProvisioningClient; +const RegistryClient = v1.RegistryClient; +type RegistryClient = v1.RegistryClient; + +export {v1, ProvisioningClient, RegistryClient}; +export default {v1, ProvisioningClient, RegistryClient}; +import * as protos from '../protos/protos'; +export {protos}; diff --git a/packages/google-cloud-apigeeregistry/src/v1/gapic_metadata.json b/packages/google-cloud-apigeeregistry/src/v1/gapic_metadata.json new file mode 100644 index 00000000000..783049f935e --- /dev/null +++ b/packages/google-cloud-apigeeregistry/src/v1/gapic_metadata.json @@ -0,0 +1,445 @@ +{ + "schema": "1.0", + "comment": "This file maps proto services/RPCs to the corresponding library clients/methods", + "language": "typescript", + "protoPackage": "google.cloud.apigeeregistry.v1", + "libraryPackage": "@google-cloud/apigee-registry", + "services": { + "Provisioning": { + "clients": { + "grpc": { + "libraryClient": "ProvisioningClient", + "rpcs": { + "GetInstance": { + "methods": [ + "getInstance" + ] + }, + "CreateInstance": { + "methods": [ + "createInstance" + ] + }, + "DeleteInstance": { + "methods": [ + "deleteInstance" + ] + } + } + }, + "grpc-fallback": { + "libraryClient": "ProvisioningClient", + "rpcs": { + "GetInstance": { + "methods": [ + "getInstance" + ] + }, + "CreateInstance": { + "methods": [ + "createInstance" + ] + }, + "DeleteInstance": { + "methods": [ + "deleteInstance" + ] + } + } + } + } + }, + "Registry": { + "clients": { + "grpc": { + "libraryClient": "RegistryClient", + "rpcs": { + "GetApi": { + "methods": [ + "getApi" + ] + }, + "CreateApi": { + "methods": [ + "createApi" + ] + }, + "UpdateApi": { + "methods": [ + "updateApi" + ] + }, + "DeleteApi": { + "methods": [ + "deleteApi" + ] + }, + "GetApiVersion": { + "methods": [ + "getApiVersion" + ] + }, + "CreateApiVersion": { + "methods": [ + "createApiVersion" + ] + }, + "UpdateApiVersion": { + "methods": [ + "updateApiVersion" + ] + }, + "DeleteApiVersion": { + "methods": [ + "deleteApiVersion" + ] + }, + "GetApiSpec": { + "methods": [ + "getApiSpec" + ] + }, + "GetApiSpecContents": { + "methods": [ + "getApiSpecContents" + ] + }, + "CreateApiSpec": { + "methods": [ + "createApiSpec" + ] + }, + "UpdateApiSpec": { + "methods": [ + "updateApiSpec" + ] + }, + "DeleteApiSpec": { + "methods": [ + "deleteApiSpec" + ] + }, + "TagApiSpecRevision": { + "methods": [ + "tagApiSpecRevision" + ] + }, + "RollbackApiSpec": { + "methods": [ + "rollbackApiSpec" + ] + }, + "DeleteApiSpecRevision": { + "methods": [ + "deleteApiSpecRevision" + ] + }, + "GetApiDeployment": { + "methods": [ + "getApiDeployment" + ] + }, + "CreateApiDeployment": { + "methods": [ + "createApiDeployment" + ] + }, + "UpdateApiDeployment": { + "methods": [ + "updateApiDeployment" + ] + }, + "DeleteApiDeployment": { + "methods": [ + "deleteApiDeployment" + ] + }, + "TagApiDeploymentRevision": { + "methods": [ + "tagApiDeploymentRevision" + ] + }, + "RollbackApiDeployment": { + "methods": [ + "rollbackApiDeployment" + ] + }, + "DeleteApiDeploymentRevision": { + "methods": [ + "deleteApiDeploymentRevision" + ] + }, + "GetArtifact": { + "methods": [ + "getArtifact" + ] + }, + "GetArtifactContents": { + "methods": [ + "getArtifactContents" + ] + }, + "CreateArtifact": { + "methods": [ + "createArtifact" + ] + }, + "ReplaceArtifact": { + "methods": [ + "replaceArtifact" + ] + }, + "DeleteArtifact": { + "methods": [ + "deleteArtifact" + ] + }, + "ListApis": { + "methods": [ + "listApis", + "listApisStream", + "listApisAsync" + ] + }, + "ListApiVersions": { + "methods": [ + "listApiVersions", + "listApiVersionsStream", + "listApiVersionsAsync" + ] + }, + "ListApiSpecs": { + "methods": [ + "listApiSpecs", + "listApiSpecsStream", + "listApiSpecsAsync" + ] + }, + "ListApiSpecRevisions": { + "methods": [ + "listApiSpecRevisions", + "listApiSpecRevisionsStream", + "listApiSpecRevisionsAsync" + ] + }, + "ListApiDeployments": { + "methods": [ + "listApiDeployments", + "listApiDeploymentsStream", + "listApiDeploymentsAsync" + ] + }, + "ListApiDeploymentRevisions": { + "methods": [ + "listApiDeploymentRevisions", + "listApiDeploymentRevisionsStream", + "listApiDeploymentRevisionsAsync" + ] + }, + "ListArtifacts": { + "methods": [ + "listArtifacts", + "listArtifactsStream", + "listArtifactsAsync" + ] + } + } + }, + "grpc-fallback": { + "libraryClient": "RegistryClient", + "rpcs": { + "GetApi": { + "methods": [ + "getApi" + ] + }, + "CreateApi": { + "methods": [ + "createApi" + ] + }, + "UpdateApi": { + "methods": [ + "updateApi" + ] + }, + "DeleteApi": { + "methods": [ + "deleteApi" + ] + }, + "GetApiVersion": { + "methods": [ + "getApiVersion" + ] + }, + "CreateApiVersion": { + "methods": [ + "createApiVersion" + ] + }, + "UpdateApiVersion": { + "methods": [ + "updateApiVersion" + ] + }, + "DeleteApiVersion": { + "methods": [ + "deleteApiVersion" + ] + }, + "GetApiSpec": { + "methods": [ + "getApiSpec" + ] + }, + "GetApiSpecContents": { + "methods": [ + "getApiSpecContents" + ] + }, + "CreateApiSpec": { + "methods": [ + "createApiSpec" + ] + }, + "UpdateApiSpec": { + "methods": [ + "updateApiSpec" + ] + }, + "DeleteApiSpec": { + "methods": [ + "deleteApiSpec" + ] + }, + "TagApiSpecRevision": { + "methods": [ + "tagApiSpecRevision" + ] + }, + "RollbackApiSpec": { + "methods": [ + "rollbackApiSpec" + ] + }, + "DeleteApiSpecRevision": { + "methods": [ + "deleteApiSpecRevision" + ] + }, + "GetApiDeployment": { + "methods": [ + "getApiDeployment" + ] + }, + "CreateApiDeployment": { + "methods": [ + "createApiDeployment" + ] + }, + "UpdateApiDeployment": { + "methods": [ + "updateApiDeployment" + ] + }, + "DeleteApiDeployment": { + "methods": [ + "deleteApiDeployment" + ] + }, + "TagApiDeploymentRevision": { + "methods": [ + "tagApiDeploymentRevision" + ] + }, + "RollbackApiDeployment": { + "methods": [ + "rollbackApiDeployment" + ] + }, + "DeleteApiDeploymentRevision": { + "methods": [ + "deleteApiDeploymentRevision" + ] + }, + "GetArtifact": { + "methods": [ + "getArtifact" + ] + }, + "GetArtifactContents": { + "methods": [ + "getArtifactContents" + ] + }, + "CreateArtifact": { + "methods": [ + "createArtifact" + ] + }, + "ReplaceArtifact": { + "methods": [ + "replaceArtifact" + ] + }, + "DeleteArtifact": { + "methods": [ + "deleteArtifact" + ] + }, + "ListApis": { + "methods": [ + "listApis", + "listApisStream", + "listApisAsync" + ] + }, + "ListApiVersions": { + "methods": [ + "listApiVersions", + "listApiVersionsStream", + "listApiVersionsAsync" + ] + }, + "ListApiSpecs": { + "methods": [ + "listApiSpecs", + "listApiSpecsStream", + "listApiSpecsAsync" + ] + }, + "ListApiSpecRevisions": { + "methods": [ + "listApiSpecRevisions", + "listApiSpecRevisionsStream", + "listApiSpecRevisionsAsync" + ] + }, + "ListApiDeployments": { + "methods": [ + "listApiDeployments", + "listApiDeploymentsStream", + "listApiDeploymentsAsync" + ] + }, + "ListApiDeploymentRevisions": { + "methods": [ + "listApiDeploymentRevisions", + "listApiDeploymentRevisionsStream", + "listApiDeploymentRevisionsAsync" + ] + }, + "ListArtifacts": { + "methods": [ + "listArtifacts", + "listArtifactsStream", + "listArtifactsAsync" + ] + } + } + } + } + } + } +} diff --git a/packages/google-cloud-apigeeregistry/src/v1/index.ts b/packages/google-cloud-apigeeregistry/src/v1/index.ts new file mode 100644 index 00000000000..6032a7e3443 --- /dev/null +++ b/packages/google-cloud-apigeeregistry/src/v1/index.ts @@ -0,0 +1,20 @@ +// Copyright 2023 Google LLC +// +// Licensed under the Apache License, Version 2.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 {ProvisioningClient} from './provisioning_client'; +export {RegistryClient} from './registry_client'; diff --git a/packages/google-cloud-apigeeregistry/src/v1/provisioning_client.ts b/packages/google-cloud-apigeeregistry/src/v1/provisioning_client.ts new file mode 100644 index 00000000000..c04c0a76b41 --- /dev/null +++ b/packages/google-cloud-apigeeregistry/src/v1/provisioning_client.ts @@ -0,0 +1,2166 @@ +// Copyright 2023 Google LLC +// +// Licensed under the Apache License, Version 2.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, + IamClient, + IamProtos, + LocationsClient, + LocationProtos, +} from 'google-gax'; + +import * as protos from '../../protos/protos'; +import jsonProtos = require('../../protos/protos.json'); +/** + * Client JSON configuration object, loaded from + * `src/v1/provisioning_client_config.json`. + * This file defines retry strategy and timeouts for all API methods in this library. + */ +import * as gapicConfig from './provisioning_client_config.json'; +const version = require('../../../package.json').version; + +/** + * The service that is used for managing the data plane provisioning of the + * Registry. + * @class + * @memberof v1 + */ +export class ProvisioningClient { + 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}; + auth: gax.GoogleAuth; + descriptors: Descriptors = { + page: {}, + stream: {}, + longrunning: {}, + batching: {}, + }; + warn: (code: string, message: string, warnType?: string) => void; + innerApiCalls: {[name: string]: Function}; + iamClient: IamClient; + locationsClient: LocationsClient; + pathTemplates: {[name: string]: gax.PathTemplate}; + operationsClient: gax.OperationsClient; + provisioningStub?: Promise<{[name: string]: Function}>; + + /** + * Construct an instance of ProvisioningClient. + * + * @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://developers.google.com/identity/protocols/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 ProvisioningClient({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 ProvisioningClient; + const servicePath = + opts?.servicePath || opts?.apiEndpoint || staticMembers.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 !== staticMembers.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 = staticMembers.servicePath; + + // Set the default scopes in auth client if needed. + if (servicePath === staticMembers.servicePath) { + this.auth.defaultScopes = staticMembers.scopes; + } + this.iamClient = new this._gaxModule.IamClient(this._gaxGrpc, opts); + + 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 !== 'undefined' && '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 = { + apiPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/apis/{api}' + ), + apiDeploymentPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/apis/{api}/deployments/{deployment}' + ), + apiSpecPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/apis/{api}/versions/{version}/specs/{spec}' + ), + apiVersionPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/apis/{api}/versions/{version}' + ), + instancePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/instances/{instance}' + ), + locationPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}' + ), + projectLocationApiArtifactPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/apis/{api}/artifacts/{artifact}' + ), + projectLocationApiDeploymentArtifactPathTemplate: + new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/apis/{api}/deployments/{deployment}/artifacts/{artifact}' + ), + projectLocationApiVersionArtifactPathTemplate: + new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/apis/{api}/versions/{version}/artifacts/{artifact}' + ), + projectLocationApiVersionSpecArtifactPathTemplate: + new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/apis/{api}/versions/{version}/specs/{spec}/artifacts/{artifact}' + ), + projectLocationArtifactPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/artifacts/{artifact}' + ), + }; + + const protoFilesRoot = this._gaxModule.protobuf.Root.fromJSON(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: '/v1/{name=projects/*/locations/*}', + }, + { + selector: 'google.cloud.location.Locations.ListLocations', + get: '/v1/{name=projects/*}/locations', + }, + { + selector: 'google.iam.v1.IAMPolicy.GetIamPolicy', + get: '/v1/{resource=projects/*/locations/*/apis/*}:getIamPolicy', + additional_bindings: [ + { + get: '/v1/{resource=projects/*/locations/*/apis/*/deployments/*}:getIamPolicy', + }, + { + get: '/v1/{resource=projects/*/locations/*/apis/*/versions/*}:getIamPolicy', + }, + { + get: '/v1/{resource=projects/*/locations/*/apis/*/versions/*/specs/*}:getIamPolicy', + }, + { + get: '/v1/{resource=projects/*/locations/*/artifacts/*}:getIamPolicy', + }, + { + get: '/v1/{resource=projects/*/locations/*/apis/*/artifacts/*}:getIamPolicy', + }, + { + get: '/v1/{resource=projects/*/locations/*/apis/*/versions/*/artifacts/*}:getIamPolicy', + }, + { + get: '/v1/{resource=projects/*/locations/*/apis/*/versions/*/specs/*/artifacts/*}:getIamPolicy', + }, + { + get: '/v1/{resource=projects/*/locations/*/instances/*}:getIamPolicy', + }, + {get: '/v1/{resource=projects/*/locations/*/runtime}:getIamPolicy'}, + ], + }, + { + selector: 'google.iam.v1.IAMPolicy.SetIamPolicy', + post: '/v1/{resource=projects/*/locations/*/apis/*}:setIamPolicy', + body: '*', + additional_bindings: [ + { + post: '/v1/{resource=projects/*/locations/*/apis/*/deployments/*}:setIamPolicy', + body: '*', + }, + { + post: '/v1/{resource=projects/*/locations/*/apis/*/versions/*}:setIamPolicy', + body: '*', + }, + { + post: '/v1/{resource=projects/*/locations/*/apis/*/versions/*/specs/*}:setIamPolicy', + body: '*', + }, + { + post: '/v1/{resource=projects/*/locations/*/artifacts/*}:setIamPolicy', + body: '*', + }, + { + post: '/v1/{resource=projects/*/locations/*/apis/*/artifacts/*}:setIamPolicy', + body: '*', + }, + { + post: '/v1/{resource=projects/*/locations/*/apis/*/versions/*/artifacts/*}:setIamPolicy', + body: '*', + }, + { + post: '/v1/{resource=projects/*/locations/*/apis/*/versions/*/specs/*/artifacts/*}:setIamPolicy', + body: '*', + }, + { + post: '/v1/{resource=projects/*/locations/*/instances/*}:setIamPolicy', + body: '*', + }, + { + post: '/v1/{resource=projects/*/locations/*/runtime}:setIamPolicy', + body: '*', + }, + ], + }, + { + selector: 'google.iam.v1.IAMPolicy.TestIamPermissions', + post: '/v1/{resource=projects/*/locations/*/apis/*}:testIamPermissions', + body: '*', + additional_bindings: [ + { + post: '/v1/{resource=projects/*/locations/*/apis/*/deployments/*}:testIamPermissions', + body: '*', + }, + { + post: '/v1/{resource=projects/*/locations/*/apis/*/versions/*}:testIamPermissions', + body: '*', + }, + { + post: '/v1/{resource=projects/*/locations/*/apis/*/versions/*/specs/*}:testIamPermissions', + body: '*', + }, + { + post: '/v1/{resource=projects/*/locations/*/artifacts/*}:testIamPermissions', + body: '*', + }, + { + post: '/v1/{resource=projects/*/locations/*/apis/*/artifacts/*}:testIamPermissions', + body: '*', + }, + { + post: '/v1/{resource=projects/*/locations/*/apis/*/versions/*/artifacts/*}:testIamPermissions', + body: '*', + }, + { + post: '/v1/{resource=projects/*/locations/*/apis/*/versions/*/specs/*/artifacts/*}:testIamPermissions', + body: '*', + }, + { + post: '/v1/{resource=projects/*/locations/*/instances/*}:testIamPermissions', + body: '*', + }, + { + post: '/v1/{resource=projects/*/locations/*/runtime}:testIamPermissions', + body: '*', + }, + ], + }, + { + selector: 'google.longrunning.Operations.CancelOperation', + post: '/v1/{name=projects/*/locations/*/operations/*}:cancel', + body: '*', + }, + { + selector: 'google.longrunning.Operations.DeleteOperation', + delete: '/v1/{name=projects/*/locations/*/operations/*}', + }, + { + selector: 'google.longrunning.Operations.GetOperation', + get: '/v1/{name=projects/*/locations/*/operations/*}', + }, + { + selector: 'google.longrunning.Operations.ListOperations', + get: '/v1/{name=projects/*/locations/*}/operations', + }, + ]; + } + this.operationsClient = this._gaxModule + .lro(lroOptions) + .operationsClient(opts); + const createInstanceResponse = protoFilesRoot.lookup( + '.google.cloud.apigeeregistry.v1.Instance' + ) as gax.protobuf.Type; + const createInstanceMetadata = protoFilesRoot.lookup( + '.google.cloud.apigeeregistry.v1.OperationMetadata' + ) as gax.protobuf.Type; + const deleteInstanceResponse = protoFilesRoot.lookup( + '.google.protobuf.Empty' + ) as gax.protobuf.Type; + const deleteInstanceMetadata = protoFilesRoot.lookup( + '.google.cloud.apigeeregistry.v1.OperationMetadata' + ) as gax.protobuf.Type; + + this.descriptors.longrunning = { + createInstance: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + createInstanceResponse.decode.bind(createInstanceResponse), + createInstanceMetadata.decode.bind(createInstanceMetadata) + ), + deleteInstance: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + deleteInstanceResponse.decode.bind(deleteInstanceResponse), + deleteInstanceMetadata.decode.bind(deleteInstanceMetadata) + ), + }; + + // Put together the default options sent with requests. + this._defaults = this._gaxGrpc.constructSettings( + 'google.cloud.apigeeregistry.v1.Provisioning', + 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.provisioningStub) { + return this.provisioningStub; + } + + // Put together the "service stub" for + // google.cloud.apigeeregistry.v1.Provisioning. + this.provisioningStub = this._gaxGrpc.createStub( + this._opts.fallback + ? (this._protos as protobuf.Root).lookupService( + 'google.cloud.apigeeregistry.v1.Provisioning' + ) + : // eslint-disable-next-line @typescript-eslint/no-explicit-any + (this._protos as any).google.cloud.apigeeregistry.v1.Provisioning, + 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 provisioningStubMethods = [ + 'createInstance', + 'deleteInstance', + 'getInstance', + ]; + for (const methodName of provisioningStubMethods) { + const callPromise = this.provisioningStub.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.longrunning[methodName] || undefined; + const apiCall = this._gaxModule.createApiCall( + callPromise, + this._defaults[methodName], + descriptor, + this._opts.fallback + ); + + this.innerApiCalls[methodName] = apiCall; + } + + return this.provisioningStub; + } + + /** + * The DNS address for this API service. + * @returns {string} The DNS address for this service. + */ + static get servicePath() { + return 'apigeeregistry.googleapis.com'; + } + + /** + * The DNS address for this API service - same as servicePath(), + * exists for compatibility reasons. + * @returns {string} The DNS address for this service. + */ + static get apiEndpoint() { + return 'apigeeregistry.googleapis.com'; + } + + /** + * 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 -- + // ------------------- + /** + * Gets details of a single Instance. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The name of the Instance to retrieve. + * Format: `projects/* /locations/* /instances/*`. + * @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.apigeeregistry.v1.Instance|Instance}. + * 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/provisioning.get_instance.js + * region_tag:apigeeregistry_v1_generated_Provisioning_GetInstance_async + */ + getInstance( + request?: protos.google.cloud.apigeeregistry.v1.IGetInstanceRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.apigeeregistry.v1.IInstance, + protos.google.cloud.apigeeregistry.v1.IGetInstanceRequest | undefined, + {} | undefined, + ] + >; + getInstance( + request: protos.google.cloud.apigeeregistry.v1.IGetInstanceRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.apigeeregistry.v1.IInstance, + | protos.google.cloud.apigeeregistry.v1.IGetInstanceRequest + | null + | undefined, + {} | null | undefined + > + ): void; + getInstance( + request: protos.google.cloud.apigeeregistry.v1.IGetInstanceRequest, + callback: Callback< + protos.google.cloud.apigeeregistry.v1.IInstance, + | protos.google.cloud.apigeeregistry.v1.IGetInstanceRequest + | null + | undefined, + {} | null | undefined + > + ): void; + getInstance( + request?: protos.google.cloud.apigeeregistry.v1.IGetInstanceRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.apigeeregistry.v1.IInstance, + | protos.google.cloud.apigeeregistry.v1.IGetInstanceRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.apigeeregistry.v1.IInstance, + | protos.google.cloud.apigeeregistry.v1.IGetInstanceRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.apigeeregistry.v1.IInstance, + protos.google.cloud.apigeeregistry.v1.IGetInstanceRequest | 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(); + return this.innerApiCalls.getInstance(request, options, callback); + } + + /** + * Provisions instance resources for the Registry. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. Parent resource of the Instance, of the form: `projects/* /locations/*` + * @param {string} request.instanceId + * Required. Identifier to assign to the Instance. Must be unique within scope of the + * parent resource. + * @param {google.cloud.apigeeregistry.v1.Instance} request.instance + * Required. The Instance. + * @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/provisioning.create_instance.js + * region_tag:apigeeregistry_v1_generated_Provisioning_CreateInstance_async + */ + createInstance( + request?: protos.google.cloud.apigeeregistry.v1.ICreateInstanceRequest, + options?: CallOptions + ): Promise< + [ + LROperation< + protos.google.cloud.apigeeregistry.v1.IInstance, + protos.google.cloud.apigeeregistry.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined, + ] + >; + createInstance( + request: protos.google.cloud.apigeeregistry.v1.ICreateInstanceRequest, + options: CallOptions, + callback: Callback< + LROperation< + protos.google.cloud.apigeeregistry.v1.IInstance, + protos.google.cloud.apigeeregistry.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + createInstance( + request: protos.google.cloud.apigeeregistry.v1.ICreateInstanceRequest, + callback: Callback< + LROperation< + protos.google.cloud.apigeeregistry.v1.IInstance, + protos.google.cloud.apigeeregistry.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + createInstance( + request?: protos.google.cloud.apigeeregistry.v1.ICreateInstanceRequest, + optionsOrCallback?: + | CallOptions + | Callback< + LROperation< + protos.google.cloud.apigeeregistry.v1.IInstance, + protos.google.cloud.apigeeregistry.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + callback?: Callback< + LROperation< + protos.google.cloud.apigeeregistry.v1.IInstance, + protos.google.cloud.apigeeregistry.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): Promise< + [ + LROperation< + protos.google.cloud.apigeeregistry.v1.IInstance, + protos.google.cloud.apigeeregistry.v1.IOperationMetadata + >, + 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(); + return this.innerApiCalls.createInstance(request, options, callback); + } + /** + * Check the status of the long running operation returned by `createInstance()`. + * @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/provisioning.create_instance.js + * region_tag:apigeeregistry_v1_generated_Provisioning_CreateInstance_async + */ + async checkCreateInstanceProgress( + name: string + ): Promise< + LROperation< + protos.google.cloud.apigeeregistry.v1.Instance, + protos.google.cloud.apigeeregistry.v1.OperationMetadata + > + > { + 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.createInstance, + this._gaxModule.createDefaultBackoffSettings() + ); + return decodeOperation as LROperation< + protos.google.cloud.apigeeregistry.v1.Instance, + protos.google.cloud.apigeeregistry.v1.OperationMetadata + >; + } + /** + * Deletes the Registry instance. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The name of the Instance to delete. + * Format: `projects/* /locations/* /instances/*`. + * @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/provisioning.delete_instance.js + * region_tag:apigeeregistry_v1_generated_Provisioning_DeleteInstance_async + */ + deleteInstance( + request?: protos.google.cloud.apigeeregistry.v1.IDeleteInstanceRequest, + options?: CallOptions + ): Promise< + [ + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.apigeeregistry.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined, + ] + >; + deleteInstance( + request: protos.google.cloud.apigeeregistry.v1.IDeleteInstanceRequest, + options: CallOptions, + callback: Callback< + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.apigeeregistry.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + deleteInstance( + request: protos.google.cloud.apigeeregistry.v1.IDeleteInstanceRequest, + callback: Callback< + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.apigeeregistry.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + deleteInstance( + request?: protos.google.cloud.apigeeregistry.v1.IDeleteInstanceRequest, + optionsOrCallback?: + | CallOptions + | Callback< + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.apigeeregistry.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + callback?: Callback< + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.apigeeregistry.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): Promise< + [ + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.apigeeregistry.v1.IOperationMetadata + >, + 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(); + return this.innerApiCalls.deleteInstance(request, options, callback); + } + /** + * Check the status of the long running operation returned by `deleteInstance()`. + * @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/provisioning.delete_instance.js + * region_tag:apigeeregistry_v1_generated_Provisioning_DeleteInstance_async + */ + async checkDeleteInstanceProgress( + name: string + ): Promise< + LROperation< + protos.google.protobuf.Empty, + protos.google.cloud.apigeeregistry.v1.OperationMetadata + > + > { + 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.deleteInstance, + this._gaxModule.createDefaultBackoffSettings() + ); + return decodeOperation as LROperation< + protos.google.protobuf.Empty, + protos.google.cloud.apigeeregistry.v1.OperationMetadata + >; + } + /** + * Gets the access control policy for a resource. Returns an empty policy + * if the resource exists and does not have a policy set. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.resource + * REQUIRED: The resource for which the policy is being requested. + * See the operation documentation for the appropriate value for this field. + * @param {Object} [request.options] + * OPTIONAL: A `GetPolicyOptions` object for specifying options to + * `GetIamPolicy`. This field is only used by Cloud IAM. + * + * This object should have the same structure as {@link google.iam.v1.GetPolicyOptions | GetPolicyOptions}. + * @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/interfaces/CallOptions.html | 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.iam.v1.Policy | Policy}. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link google.iam.v1.Policy | Policy}. + * The promise has a method named "cancel" which cancels the ongoing API call. + */ + getIamPolicy( + request: IamProtos.google.iam.v1.GetIamPolicyRequest, + options?: + | gax.CallOptions + | Callback< + IamProtos.google.iam.v1.Policy, + IamProtos.google.iam.v1.GetIamPolicyRequest | null | undefined, + {} | null | undefined + >, + callback?: Callback< + IamProtos.google.iam.v1.Policy, + IamProtos.google.iam.v1.GetIamPolicyRequest | null | undefined, + {} | null | undefined + > + ): Promise<[IamProtos.google.iam.v1.Policy]> { + return this.iamClient.getIamPolicy(request, options, callback); + } + + /** + * Returns permissions that a caller has on the specified resource. If the + * resource does not exist, this will return an empty set of + * permissions, not a NOT_FOUND error. + * + * Note: This operation is designed to be used for building + * permission-aware UIs and command-line tools, not for authorization + * checking. This operation may "fail open" without warning. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.resource + * REQUIRED: The resource for which the policy detail is being requested. + * See the operation documentation for the appropriate value for this field. + * @param {string[]} request.permissions + * The set of permissions to check for the `resource`. Permissions with + * wildcards (such as '*' or 'storage.*') are not allowed. For more + * information see {@link https://cloud.google.com/iam/docs/overview#permissions | IAM Overview }. + * @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/interfaces/CallOptions.html | 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.iam.v1.TestIamPermissionsResponse | TestIamPermissionsResponse}. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link google.iam.v1.TestIamPermissionsResponse | TestIamPermissionsResponse}. + * The promise has a method named "cancel" which cancels the ongoing API call. + */ + setIamPolicy( + request: IamProtos.google.iam.v1.SetIamPolicyRequest, + options?: + | gax.CallOptions + | Callback< + IamProtos.google.iam.v1.Policy, + IamProtos.google.iam.v1.SetIamPolicyRequest | null | undefined, + {} | null | undefined + >, + callback?: Callback< + IamProtos.google.iam.v1.Policy, + IamProtos.google.iam.v1.SetIamPolicyRequest | null | undefined, + {} | null | undefined + > + ): Promise<[IamProtos.google.iam.v1.Policy]> { + return this.iamClient.setIamPolicy(request, options, callback); + } + + /** + * Returns permissions that a caller has on the specified resource. If the + * resource does not exist, this will return an empty set of + * permissions, not a NOT_FOUND error. + * + * Note: This operation is designed to be used for building + * permission-aware UIs and command-line tools, not for authorization + * checking. This operation may "fail open" without warning. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.resource + * REQUIRED: The resource for which the policy detail is being requested. + * See the operation documentation for the appropriate value for this field. + * @param {string[]} request.permissions + * The set of permissions to check for the `resource`. Permissions with + * wildcards (such as '*' or 'storage.*') are not allowed. For more + * information see {@link https://cloud.google.com/iam/docs/overview#permissions | IAM Overview }. + * @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/interfaces/CallOptions.html | 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.iam.v1.TestIamPermissionsResponse | TestIamPermissionsResponse}. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link google.iam.v1.TestIamPermissionsResponse | TestIamPermissionsResponse}. + * The promise has a method named "cancel" which cancels the ongoing API call. + * + */ + testIamPermissions( + request: IamProtos.google.iam.v1.TestIamPermissionsRequest, + options?: + | gax.CallOptions + | Callback< + IamProtos.google.iam.v1.TestIamPermissionsResponse, + IamProtos.google.iam.v1.TestIamPermissionsRequest | null | undefined, + {} | null | undefined + >, + callback?: Callback< + IamProtos.google.iam.v1.TestIamPermissionsResponse, + IamProtos.google.iam.v1.TestIamPermissionsRequest | null | undefined, + {} | null | undefined + > + ): Promise<[IamProtos.google.iam.v1.TestIamPermissionsResponse]> { + return this.iamClient.testIamPermissions(request, options, callback); + } + + /** + * 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, + options?: + | 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]> { + 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 { + 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, + options?: + | gax.CallOptions + | Callback< + protos.google.protobuf.Empty, + protos.google.longrunning.CancelOperationRequest, + {} | undefined | null + >, + callback?: Callback< + protos.google.longrunning.CancelOperationRequest, + protos.google.protobuf.Empty, + {} | undefined | null + > + ): Promise { + 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, + options?: + | 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 { + return this.operationsClient.deleteOperation(request, options, callback); + } + + // -------------------- + // -- Path templates -- + // -------------------- + + /** + * Return a fully-qualified api resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} api + * @returns {string} Resource name string. + */ + apiPath(project: string, location: string, api: string) { + return this.pathTemplates.apiPathTemplate.render({ + project: project, + location: location, + api: api, + }); + } + + /** + * Parse the project from Api resource. + * + * @param {string} apiName + * A fully-qualified path representing Api resource. + * @returns {string} A string representing the project. + */ + matchProjectFromApiName(apiName: string) { + return this.pathTemplates.apiPathTemplate.match(apiName).project; + } + + /** + * Parse the location from Api resource. + * + * @param {string} apiName + * A fully-qualified path representing Api resource. + * @returns {string} A string representing the location. + */ + matchLocationFromApiName(apiName: string) { + return this.pathTemplates.apiPathTemplate.match(apiName).location; + } + + /** + * Parse the api from Api resource. + * + * @param {string} apiName + * A fully-qualified path representing Api resource. + * @returns {string} A string representing the api. + */ + matchApiFromApiName(apiName: string) { + return this.pathTemplates.apiPathTemplate.match(apiName).api; + } + + /** + * Return a fully-qualified apiDeployment resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} api + * @param {string} deployment + * @returns {string} Resource name string. + */ + apiDeploymentPath( + project: string, + location: string, + api: string, + deployment: string + ) { + return this.pathTemplates.apiDeploymentPathTemplate.render({ + project: project, + location: location, + api: api, + deployment: deployment, + }); + } + + /** + * Parse the project from ApiDeployment resource. + * + * @param {string} apiDeploymentName + * A fully-qualified path representing ApiDeployment resource. + * @returns {string} A string representing the project. + */ + matchProjectFromApiDeploymentName(apiDeploymentName: string) { + return this.pathTemplates.apiDeploymentPathTemplate.match(apiDeploymentName) + .project; + } + + /** + * Parse the location from ApiDeployment resource. + * + * @param {string} apiDeploymentName + * A fully-qualified path representing ApiDeployment resource. + * @returns {string} A string representing the location. + */ + matchLocationFromApiDeploymentName(apiDeploymentName: string) { + return this.pathTemplates.apiDeploymentPathTemplate.match(apiDeploymentName) + .location; + } + + /** + * Parse the api from ApiDeployment resource. + * + * @param {string} apiDeploymentName + * A fully-qualified path representing ApiDeployment resource. + * @returns {string} A string representing the api. + */ + matchApiFromApiDeploymentName(apiDeploymentName: string) { + return this.pathTemplates.apiDeploymentPathTemplate.match(apiDeploymentName) + .api; + } + + /** + * Parse the deployment from ApiDeployment resource. + * + * @param {string} apiDeploymentName + * A fully-qualified path representing ApiDeployment resource. + * @returns {string} A string representing the deployment. + */ + matchDeploymentFromApiDeploymentName(apiDeploymentName: string) { + return this.pathTemplates.apiDeploymentPathTemplate.match(apiDeploymentName) + .deployment; + } + + /** + * Return a fully-qualified apiSpec resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} api + * @param {string} version + * @param {string} spec + * @returns {string} Resource name string. + */ + apiSpecPath( + project: string, + location: string, + api: string, + version: string, + spec: string + ) { + return this.pathTemplates.apiSpecPathTemplate.render({ + project: project, + location: location, + api: api, + version: version, + spec: spec, + }); + } + + /** + * Parse the project from ApiSpec resource. + * + * @param {string} apiSpecName + * A fully-qualified path representing ApiSpec resource. + * @returns {string} A string representing the project. + */ + matchProjectFromApiSpecName(apiSpecName: string) { + return this.pathTemplates.apiSpecPathTemplate.match(apiSpecName).project; + } + + /** + * Parse the location from ApiSpec resource. + * + * @param {string} apiSpecName + * A fully-qualified path representing ApiSpec resource. + * @returns {string} A string representing the location. + */ + matchLocationFromApiSpecName(apiSpecName: string) { + return this.pathTemplates.apiSpecPathTemplate.match(apiSpecName).location; + } + + /** + * Parse the api from ApiSpec resource. + * + * @param {string} apiSpecName + * A fully-qualified path representing ApiSpec resource. + * @returns {string} A string representing the api. + */ + matchApiFromApiSpecName(apiSpecName: string) { + return this.pathTemplates.apiSpecPathTemplate.match(apiSpecName).api; + } + + /** + * Parse the version from ApiSpec resource. + * + * @param {string} apiSpecName + * A fully-qualified path representing ApiSpec resource. + * @returns {string} A string representing the version. + */ + matchVersionFromApiSpecName(apiSpecName: string) { + return this.pathTemplates.apiSpecPathTemplate.match(apiSpecName).version; + } + + /** + * Parse the spec from ApiSpec resource. + * + * @param {string} apiSpecName + * A fully-qualified path representing ApiSpec resource. + * @returns {string} A string representing the spec. + */ + matchSpecFromApiSpecName(apiSpecName: string) { + return this.pathTemplates.apiSpecPathTemplate.match(apiSpecName).spec; + } + + /** + * Return a fully-qualified apiVersion resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} api + * @param {string} version + * @returns {string} Resource name string. + */ + apiVersionPath( + project: string, + location: string, + api: string, + version: string + ) { + return this.pathTemplates.apiVersionPathTemplate.render({ + project: project, + location: location, + api: api, + version: version, + }); + } + + /** + * Parse the project from ApiVersion resource. + * + * @param {string} apiVersionName + * A fully-qualified path representing ApiVersion resource. + * @returns {string} A string representing the project. + */ + matchProjectFromApiVersionName(apiVersionName: string) { + return this.pathTemplates.apiVersionPathTemplate.match(apiVersionName) + .project; + } + + /** + * Parse the location from ApiVersion resource. + * + * @param {string} apiVersionName + * A fully-qualified path representing ApiVersion resource. + * @returns {string} A string representing the location. + */ + matchLocationFromApiVersionName(apiVersionName: string) { + return this.pathTemplates.apiVersionPathTemplate.match(apiVersionName) + .location; + } + + /** + * Parse the api from ApiVersion resource. + * + * @param {string} apiVersionName + * A fully-qualified path representing ApiVersion resource. + * @returns {string} A string representing the api. + */ + matchApiFromApiVersionName(apiVersionName: string) { + return this.pathTemplates.apiVersionPathTemplate.match(apiVersionName).api; + } + + /** + * Parse the version from ApiVersion resource. + * + * @param {string} apiVersionName + * A fully-qualified path representing ApiVersion resource. + * @returns {string} A string representing the version. + */ + matchVersionFromApiVersionName(apiVersionName: string) { + return this.pathTemplates.apiVersionPathTemplate.match(apiVersionName) + .version; + } + + /** + * Return a fully-qualified instance resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} instance + * @returns {string} Resource name string. + */ + instancePath(project: string, location: string, instance: string) { + return this.pathTemplates.instancePathTemplate.render({ + project: project, + location: location, + instance: instance, + }); + } + + /** + * Parse the project from Instance resource. + * + * @param {string} instanceName + * A fully-qualified path representing Instance resource. + * @returns {string} A string representing the project. + */ + matchProjectFromInstanceName(instanceName: string) { + return this.pathTemplates.instancePathTemplate.match(instanceName).project; + } + + /** + * Parse the location from Instance resource. + * + * @param {string} instanceName + * A fully-qualified path representing Instance resource. + * @returns {string} A string representing the location. + */ + matchLocationFromInstanceName(instanceName: string) { + return this.pathTemplates.instancePathTemplate.match(instanceName).location; + } + + /** + * Parse the instance from Instance resource. + * + * @param {string} instanceName + * A fully-qualified path representing Instance resource. + * @returns {string} A string representing the instance. + */ + matchInstanceFromInstanceName(instanceName: string) { + return this.pathTemplates.instancePathTemplate.match(instanceName).instance; + } + + /** + * 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 projectLocationApiArtifact resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} api + * @param {string} artifact + * @returns {string} Resource name string. + */ + projectLocationApiArtifactPath( + project: string, + location: string, + api: string, + artifact: string + ) { + return this.pathTemplates.projectLocationApiArtifactPathTemplate.render({ + project: project, + location: location, + api: api, + artifact: artifact, + }); + } + + /** + * Parse the project from ProjectLocationApiArtifact resource. + * + * @param {string} projectLocationApiArtifactName + * A fully-qualified path representing project_location_api_artifact resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectLocationApiArtifactName( + projectLocationApiArtifactName: string + ) { + return this.pathTemplates.projectLocationApiArtifactPathTemplate.match( + projectLocationApiArtifactName + ).project; + } + + /** + * Parse the location from ProjectLocationApiArtifact resource. + * + * @param {string} projectLocationApiArtifactName + * A fully-qualified path representing project_location_api_artifact resource. + * @returns {string} A string representing the location. + */ + matchLocationFromProjectLocationApiArtifactName( + projectLocationApiArtifactName: string + ) { + return this.pathTemplates.projectLocationApiArtifactPathTemplate.match( + projectLocationApiArtifactName + ).location; + } + + /** + * Parse the api from ProjectLocationApiArtifact resource. + * + * @param {string} projectLocationApiArtifactName + * A fully-qualified path representing project_location_api_artifact resource. + * @returns {string} A string representing the api. + */ + matchApiFromProjectLocationApiArtifactName( + projectLocationApiArtifactName: string + ) { + return this.pathTemplates.projectLocationApiArtifactPathTemplate.match( + projectLocationApiArtifactName + ).api; + } + + /** + * Parse the artifact from ProjectLocationApiArtifact resource. + * + * @param {string} projectLocationApiArtifactName + * A fully-qualified path representing project_location_api_artifact resource. + * @returns {string} A string representing the artifact. + */ + matchArtifactFromProjectLocationApiArtifactName( + projectLocationApiArtifactName: string + ) { + return this.pathTemplates.projectLocationApiArtifactPathTemplate.match( + projectLocationApiArtifactName + ).artifact; + } + + /** + * Return a fully-qualified projectLocationApiDeploymentArtifact resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} api + * @param {string} deployment + * @param {string} artifact + * @returns {string} Resource name string. + */ + projectLocationApiDeploymentArtifactPath( + project: string, + location: string, + api: string, + deployment: string, + artifact: string + ) { + return this.pathTemplates.projectLocationApiDeploymentArtifactPathTemplate.render( + { + project: project, + location: location, + api: api, + deployment: deployment, + artifact: artifact, + } + ); + } + + /** + * Parse the project from ProjectLocationApiDeploymentArtifact resource. + * + * @param {string} projectLocationApiDeploymentArtifactName + * A fully-qualified path representing project_location_api_deployment_artifact resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectLocationApiDeploymentArtifactName( + projectLocationApiDeploymentArtifactName: string + ) { + return this.pathTemplates.projectLocationApiDeploymentArtifactPathTemplate.match( + projectLocationApiDeploymentArtifactName + ).project; + } + + /** + * Parse the location from ProjectLocationApiDeploymentArtifact resource. + * + * @param {string} projectLocationApiDeploymentArtifactName + * A fully-qualified path representing project_location_api_deployment_artifact resource. + * @returns {string} A string representing the location. + */ + matchLocationFromProjectLocationApiDeploymentArtifactName( + projectLocationApiDeploymentArtifactName: string + ) { + return this.pathTemplates.projectLocationApiDeploymentArtifactPathTemplate.match( + projectLocationApiDeploymentArtifactName + ).location; + } + + /** + * Parse the api from ProjectLocationApiDeploymentArtifact resource. + * + * @param {string} projectLocationApiDeploymentArtifactName + * A fully-qualified path representing project_location_api_deployment_artifact resource. + * @returns {string} A string representing the api. + */ + matchApiFromProjectLocationApiDeploymentArtifactName( + projectLocationApiDeploymentArtifactName: string + ) { + return this.pathTemplates.projectLocationApiDeploymentArtifactPathTemplate.match( + projectLocationApiDeploymentArtifactName + ).api; + } + + /** + * Parse the deployment from ProjectLocationApiDeploymentArtifact resource. + * + * @param {string} projectLocationApiDeploymentArtifactName + * A fully-qualified path representing project_location_api_deployment_artifact resource. + * @returns {string} A string representing the deployment. + */ + matchDeploymentFromProjectLocationApiDeploymentArtifactName( + projectLocationApiDeploymentArtifactName: string + ) { + return this.pathTemplates.projectLocationApiDeploymentArtifactPathTemplate.match( + projectLocationApiDeploymentArtifactName + ).deployment; + } + + /** + * Parse the artifact from ProjectLocationApiDeploymentArtifact resource. + * + * @param {string} projectLocationApiDeploymentArtifactName + * A fully-qualified path representing project_location_api_deployment_artifact resource. + * @returns {string} A string representing the artifact. + */ + matchArtifactFromProjectLocationApiDeploymentArtifactName( + projectLocationApiDeploymentArtifactName: string + ) { + return this.pathTemplates.projectLocationApiDeploymentArtifactPathTemplate.match( + projectLocationApiDeploymentArtifactName + ).artifact; + } + + /** + * Return a fully-qualified projectLocationApiVersionArtifact resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} api + * @param {string} version + * @param {string} artifact + * @returns {string} Resource name string. + */ + projectLocationApiVersionArtifactPath( + project: string, + location: string, + api: string, + version: string, + artifact: string + ) { + return this.pathTemplates.projectLocationApiVersionArtifactPathTemplate.render( + { + project: project, + location: location, + api: api, + version: version, + artifact: artifact, + } + ); + } + + /** + * Parse the project from ProjectLocationApiVersionArtifact resource. + * + * @param {string} projectLocationApiVersionArtifactName + * A fully-qualified path representing project_location_api_version_artifact resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectLocationApiVersionArtifactName( + projectLocationApiVersionArtifactName: string + ) { + return this.pathTemplates.projectLocationApiVersionArtifactPathTemplate.match( + projectLocationApiVersionArtifactName + ).project; + } + + /** + * Parse the location from ProjectLocationApiVersionArtifact resource. + * + * @param {string} projectLocationApiVersionArtifactName + * A fully-qualified path representing project_location_api_version_artifact resource. + * @returns {string} A string representing the location. + */ + matchLocationFromProjectLocationApiVersionArtifactName( + projectLocationApiVersionArtifactName: string + ) { + return this.pathTemplates.projectLocationApiVersionArtifactPathTemplate.match( + projectLocationApiVersionArtifactName + ).location; + } + + /** + * Parse the api from ProjectLocationApiVersionArtifact resource. + * + * @param {string} projectLocationApiVersionArtifactName + * A fully-qualified path representing project_location_api_version_artifact resource. + * @returns {string} A string representing the api. + */ + matchApiFromProjectLocationApiVersionArtifactName( + projectLocationApiVersionArtifactName: string + ) { + return this.pathTemplates.projectLocationApiVersionArtifactPathTemplate.match( + projectLocationApiVersionArtifactName + ).api; + } + + /** + * Parse the version from ProjectLocationApiVersionArtifact resource. + * + * @param {string} projectLocationApiVersionArtifactName + * A fully-qualified path representing project_location_api_version_artifact resource. + * @returns {string} A string representing the version. + */ + matchVersionFromProjectLocationApiVersionArtifactName( + projectLocationApiVersionArtifactName: string + ) { + return this.pathTemplates.projectLocationApiVersionArtifactPathTemplate.match( + projectLocationApiVersionArtifactName + ).version; + } + + /** + * Parse the artifact from ProjectLocationApiVersionArtifact resource. + * + * @param {string} projectLocationApiVersionArtifactName + * A fully-qualified path representing project_location_api_version_artifact resource. + * @returns {string} A string representing the artifact. + */ + matchArtifactFromProjectLocationApiVersionArtifactName( + projectLocationApiVersionArtifactName: string + ) { + return this.pathTemplates.projectLocationApiVersionArtifactPathTemplate.match( + projectLocationApiVersionArtifactName + ).artifact; + } + + /** + * Return a fully-qualified projectLocationApiVersionSpecArtifact resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} api + * @param {string} version + * @param {string} spec + * @param {string} artifact + * @returns {string} Resource name string. + */ + projectLocationApiVersionSpecArtifactPath( + project: string, + location: string, + api: string, + version: string, + spec: string, + artifact: string + ) { + return this.pathTemplates.projectLocationApiVersionSpecArtifactPathTemplate.render( + { + project: project, + location: location, + api: api, + version: version, + spec: spec, + artifact: artifact, + } + ); + } + + /** + * Parse the project from ProjectLocationApiVersionSpecArtifact resource. + * + * @param {string} projectLocationApiVersionSpecArtifactName + * A fully-qualified path representing project_location_api_version_spec_artifact resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectLocationApiVersionSpecArtifactName( + projectLocationApiVersionSpecArtifactName: string + ) { + return this.pathTemplates.projectLocationApiVersionSpecArtifactPathTemplate.match( + projectLocationApiVersionSpecArtifactName + ).project; + } + + /** + * Parse the location from ProjectLocationApiVersionSpecArtifact resource. + * + * @param {string} projectLocationApiVersionSpecArtifactName + * A fully-qualified path representing project_location_api_version_spec_artifact resource. + * @returns {string} A string representing the location. + */ + matchLocationFromProjectLocationApiVersionSpecArtifactName( + projectLocationApiVersionSpecArtifactName: string + ) { + return this.pathTemplates.projectLocationApiVersionSpecArtifactPathTemplate.match( + projectLocationApiVersionSpecArtifactName + ).location; + } + + /** + * Parse the api from ProjectLocationApiVersionSpecArtifact resource. + * + * @param {string} projectLocationApiVersionSpecArtifactName + * A fully-qualified path representing project_location_api_version_spec_artifact resource. + * @returns {string} A string representing the api. + */ + matchApiFromProjectLocationApiVersionSpecArtifactName( + projectLocationApiVersionSpecArtifactName: string + ) { + return this.pathTemplates.projectLocationApiVersionSpecArtifactPathTemplate.match( + projectLocationApiVersionSpecArtifactName + ).api; + } + + /** + * Parse the version from ProjectLocationApiVersionSpecArtifact resource. + * + * @param {string} projectLocationApiVersionSpecArtifactName + * A fully-qualified path representing project_location_api_version_spec_artifact resource. + * @returns {string} A string representing the version. + */ + matchVersionFromProjectLocationApiVersionSpecArtifactName( + projectLocationApiVersionSpecArtifactName: string + ) { + return this.pathTemplates.projectLocationApiVersionSpecArtifactPathTemplate.match( + projectLocationApiVersionSpecArtifactName + ).version; + } + + /** + * Parse the spec from ProjectLocationApiVersionSpecArtifact resource. + * + * @param {string} projectLocationApiVersionSpecArtifactName + * A fully-qualified path representing project_location_api_version_spec_artifact resource. + * @returns {string} A string representing the spec. + */ + matchSpecFromProjectLocationApiVersionSpecArtifactName( + projectLocationApiVersionSpecArtifactName: string + ) { + return this.pathTemplates.projectLocationApiVersionSpecArtifactPathTemplate.match( + projectLocationApiVersionSpecArtifactName + ).spec; + } + + /** + * Parse the artifact from ProjectLocationApiVersionSpecArtifact resource. + * + * @param {string} projectLocationApiVersionSpecArtifactName + * A fully-qualified path representing project_location_api_version_spec_artifact resource. + * @returns {string} A string representing the artifact. + */ + matchArtifactFromProjectLocationApiVersionSpecArtifactName( + projectLocationApiVersionSpecArtifactName: string + ) { + return this.pathTemplates.projectLocationApiVersionSpecArtifactPathTemplate.match( + projectLocationApiVersionSpecArtifactName + ).artifact; + } + + /** + * Return a fully-qualified projectLocationArtifact resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} artifact + * @returns {string} Resource name string. + */ + projectLocationArtifactPath( + project: string, + location: string, + artifact: string + ) { + return this.pathTemplates.projectLocationArtifactPathTemplate.render({ + project: project, + location: location, + artifact: artifact, + }); + } + + /** + * Parse the project from ProjectLocationArtifact resource. + * + * @param {string} projectLocationArtifactName + * A fully-qualified path representing project_location_artifact resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectLocationArtifactName( + projectLocationArtifactName: string + ) { + return this.pathTemplates.projectLocationArtifactPathTemplate.match( + projectLocationArtifactName + ).project; + } + + /** + * Parse the location from ProjectLocationArtifact resource. + * + * @param {string} projectLocationArtifactName + * A fully-qualified path representing project_location_artifact resource. + * @returns {string} A string representing the location. + */ + matchLocationFromProjectLocationArtifactName( + projectLocationArtifactName: string + ) { + return this.pathTemplates.projectLocationArtifactPathTemplate.match( + projectLocationArtifactName + ).location; + } + + /** + * Parse the artifact from ProjectLocationArtifact resource. + * + * @param {string} projectLocationArtifactName + * A fully-qualified path representing project_location_artifact resource. + * @returns {string} A string representing the artifact. + */ + matchArtifactFromProjectLocationArtifactName( + projectLocationArtifactName: string + ) { + return this.pathTemplates.projectLocationArtifactPathTemplate.match( + projectLocationArtifactName + ).artifact; + } + + /** + * 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.provisioningStub && !this._terminated) { + return this.provisioningStub.then(stub => { + this._terminated = true; + stub.close(); + this.iamClient.close(); + this.locationsClient.close(); + this.operationsClient.close(); + }); + } + return Promise.resolve(); + } +} diff --git a/packages/google-cloud-apigeeregistry/src/v1/provisioning_client_config.json b/packages/google-cloud-apigeeregistry/src/v1/provisioning_client_config.json new file mode 100644 index 00000000000..2e37ea87f55 --- /dev/null +++ b/packages/google-cloud-apigeeregistry/src/v1/provisioning_client_config.json @@ -0,0 +1,38 @@ +{ + "interfaces": { + "google.cloud.apigeeregistry.v1.Provisioning": { + "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": { + "CreateInstance": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "DeleteInstance": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "GetInstance": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + } + } + } + } +} diff --git a/packages/google-cloud-apigeeregistry/src/v1/provisioning_proto_list.json b/packages/google-cloud-apigeeregistry/src/v1/provisioning_proto_list.json new file mode 100644 index 00000000000..4fdc846ee2b --- /dev/null +++ b/packages/google-cloud-apigeeregistry/src/v1/provisioning_proto_list.json @@ -0,0 +1,5 @@ +[ + "../../protos/google/cloud/apigeeregistry/v1/provisioning_service.proto", + "../../protos/google/cloud/apigeeregistry/v1/registry_models.proto", + "../../protos/google/cloud/apigeeregistry/v1/registry_service.proto" +] diff --git a/packages/google-cloud-apigeeregistry/src/v1/registry_client.ts b/packages/google-cloud-apigeeregistry/src/v1/registry_client.ts new file mode 100644 index 00000000000..411181dcd3f --- /dev/null +++ b/packages/google-cloud-apigeeregistry/src/v1/registry_client.ts @@ -0,0 +1,5782 @@ +// Copyright 2023 Google LLC +// +// Licensed under the Apache License, Version 2.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, + IamClient, + IamProtos, + LocationsClient, + LocationProtos, +} from 'google-gax'; +import {Transform} from 'stream'; +import * as protos from '../../protos/protos'; +import jsonProtos = require('../../protos/protos.json'); +/** + * Client JSON configuration object, loaded from + * `src/v1/registry_client_config.json`. + * This file defines retry strategy and timeouts for all API methods in this library. + */ +import * as gapicConfig from './registry_client_config.json'; +const version = require('../../../package.json').version; + +/** + * The Registry service allows teams to manage descriptions of APIs. + * @class + * @memberof v1 + */ +export class RegistryClient { + 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}; + auth: gax.GoogleAuth; + descriptors: Descriptors = { + page: {}, + stream: {}, + longrunning: {}, + batching: {}, + }; + warn: (code: string, message: string, warnType?: string) => void; + innerApiCalls: {[name: string]: Function}; + iamClient: IamClient; + locationsClient: LocationsClient; + pathTemplates: {[name: string]: gax.PathTemplate}; + registryStub?: Promise<{[name: string]: Function}>; + + /** + * Construct an instance of RegistryClient. + * + * @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://developers.google.com/identity/protocols/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 RegistryClient({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 RegistryClient; + const servicePath = + opts?.servicePath || opts?.apiEndpoint || staticMembers.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 !== staticMembers.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 = staticMembers.servicePath; + + // Set the default scopes in auth client if needed. + if (servicePath === staticMembers.servicePath) { + this.auth.defaultScopes = staticMembers.scopes; + } + this.iamClient = new this._gaxModule.IamClient(this._gaxGrpc, opts); + + 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 !== 'undefined' && '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 = { + apiPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/apis/{api}' + ), + apiDeploymentPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/apis/{api}/deployments/{deployment}' + ), + apiSpecPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/apis/{api}/versions/{version}/specs/{spec}' + ), + apiVersionPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/apis/{api}/versions/{version}' + ), + instancePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/instances/{instance}' + ), + locationPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}' + ), + projectPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}' + ), + projectLocationApiArtifactPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/apis/{api}/artifacts/{artifact}' + ), + projectLocationApiDeploymentArtifactPathTemplate: + new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/apis/{api}/deployments/{deployment}/artifacts/{artifact}' + ), + projectLocationApiVersionArtifactPathTemplate: + new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/apis/{api}/versions/{version}/artifacts/{artifact}' + ), + projectLocationApiVersionSpecArtifactPathTemplate: + new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/apis/{api}/versions/{version}/specs/{spec}/artifacts/{artifact}' + ), + projectLocationArtifactPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/artifacts/{artifact}' + ), + }; + + // 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 = { + listApis: new this._gaxModule.PageDescriptor( + 'pageToken', + 'nextPageToken', + 'apis' + ), + listApiVersions: new this._gaxModule.PageDescriptor( + 'pageToken', + 'nextPageToken', + 'apiVersions' + ), + listApiSpecs: new this._gaxModule.PageDescriptor( + 'pageToken', + 'nextPageToken', + 'apiSpecs' + ), + listApiSpecRevisions: new this._gaxModule.PageDescriptor( + 'pageToken', + 'nextPageToken', + 'apiSpecs' + ), + listApiDeployments: new this._gaxModule.PageDescriptor( + 'pageToken', + 'nextPageToken', + 'apiDeployments' + ), + listApiDeploymentRevisions: new this._gaxModule.PageDescriptor( + 'pageToken', + 'nextPageToken', + 'apiDeployments' + ), + listArtifacts: new this._gaxModule.PageDescriptor( + 'pageToken', + 'nextPageToken', + 'artifacts' + ), + }; + + // Put together the default options sent with requests. + this._defaults = this._gaxGrpc.constructSettings( + 'google.cloud.apigeeregistry.v1.Registry', + 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.registryStub) { + return this.registryStub; + } + + // Put together the "service stub" for + // google.cloud.apigeeregistry.v1.Registry. + this.registryStub = this._gaxGrpc.createStub( + this._opts.fallback + ? (this._protos as protobuf.Root).lookupService( + 'google.cloud.apigeeregistry.v1.Registry' + ) + : // eslint-disable-next-line @typescript-eslint/no-explicit-any + (this._protos as any).google.cloud.apigeeregistry.v1.Registry, + 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 registryStubMethods = [ + 'listApis', + 'getApi', + 'createApi', + 'updateApi', + 'deleteApi', + 'listApiVersions', + 'getApiVersion', + 'createApiVersion', + 'updateApiVersion', + 'deleteApiVersion', + 'listApiSpecs', + 'getApiSpec', + 'getApiSpecContents', + 'createApiSpec', + 'updateApiSpec', + 'deleteApiSpec', + 'tagApiSpecRevision', + 'listApiSpecRevisions', + 'rollbackApiSpec', + 'deleteApiSpecRevision', + 'listApiDeployments', + 'getApiDeployment', + 'createApiDeployment', + 'updateApiDeployment', + 'deleteApiDeployment', + 'tagApiDeploymentRevision', + 'listApiDeploymentRevisions', + 'rollbackApiDeployment', + 'deleteApiDeploymentRevision', + 'listArtifacts', + 'getArtifact', + 'getArtifactContents', + 'createArtifact', + 'replaceArtifact', + 'deleteArtifact', + ]; + for (const methodName of registryStubMethods) { + const callPromise = this.registryStub.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.registryStub; + } + + /** + * The DNS address for this API service. + * @returns {string} The DNS address for this service. + */ + static get servicePath() { + return 'apigeeregistry.googleapis.com'; + } + + /** + * The DNS address for this API service - same as servicePath(), + * exists for compatibility reasons. + * @returns {string} The DNS address for this service. + */ + static get apiEndpoint() { + return 'apigeeregistry.googleapis.com'; + } + + /** + * 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 a specified API. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The name of the API to retrieve. + * Format: `projects/* /locations/* /apis/*` + * @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.apigeeregistry.v1.Api|Api}. + * 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/registry.get_api.js + * region_tag:apigeeregistry_v1_generated_Registry_GetApi_async + */ + getApi( + request?: protos.google.cloud.apigeeregistry.v1.IGetApiRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.apigeeregistry.v1.IApi, + protos.google.cloud.apigeeregistry.v1.IGetApiRequest | undefined, + {} | undefined, + ] + >; + getApi( + request: protos.google.cloud.apigeeregistry.v1.IGetApiRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.apigeeregistry.v1.IApi, + protos.google.cloud.apigeeregistry.v1.IGetApiRequest | null | undefined, + {} | null | undefined + > + ): void; + getApi( + request: protos.google.cloud.apigeeregistry.v1.IGetApiRequest, + callback: Callback< + protos.google.cloud.apigeeregistry.v1.IApi, + protos.google.cloud.apigeeregistry.v1.IGetApiRequest | null | undefined, + {} | null | undefined + > + ): void; + getApi( + request?: protos.google.cloud.apigeeregistry.v1.IGetApiRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.apigeeregistry.v1.IApi, + | protos.google.cloud.apigeeregistry.v1.IGetApiRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.apigeeregistry.v1.IApi, + protos.google.cloud.apigeeregistry.v1.IGetApiRequest | null | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.apigeeregistry.v1.IApi, + protos.google.cloud.apigeeregistry.v1.IGetApiRequest | 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(); + return this.innerApiCalls.getApi(request, options, callback); + } + /** + * Creates a specified API. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The parent, which owns this collection of APIs. + * Format: `projects/* /locations/*` + * @param {google.cloud.apigeeregistry.v1.Api} request.api + * Required. The API to create. + * @param {string} request.apiId + * Required. The ID to use for the API, which will become the final component of + * the API's resource name. + * + * This value should be 4-63 characters, and valid characters + * are /{@link protos.0-9|a-z}-/. + * + * Following AIP-162, IDs must not have the form of a UUID. + * @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.apigeeregistry.v1.Api|Api}. + * 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/registry.create_api.js + * region_tag:apigeeregistry_v1_generated_Registry_CreateApi_async + */ + createApi( + request?: protos.google.cloud.apigeeregistry.v1.ICreateApiRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.apigeeregistry.v1.IApi, + protos.google.cloud.apigeeregistry.v1.ICreateApiRequest | undefined, + {} | undefined, + ] + >; + createApi( + request: protos.google.cloud.apigeeregistry.v1.ICreateApiRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.apigeeregistry.v1.IApi, + | protos.google.cloud.apigeeregistry.v1.ICreateApiRequest + | null + | undefined, + {} | null | undefined + > + ): void; + createApi( + request: protos.google.cloud.apigeeregistry.v1.ICreateApiRequest, + callback: Callback< + protos.google.cloud.apigeeregistry.v1.IApi, + | protos.google.cloud.apigeeregistry.v1.ICreateApiRequest + | null + | undefined, + {} | null | undefined + > + ): void; + createApi( + request?: protos.google.cloud.apigeeregistry.v1.ICreateApiRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.apigeeregistry.v1.IApi, + | protos.google.cloud.apigeeregistry.v1.ICreateApiRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.apigeeregistry.v1.IApi, + | protos.google.cloud.apigeeregistry.v1.ICreateApiRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.apigeeregistry.v1.IApi, + protos.google.cloud.apigeeregistry.v1.ICreateApiRequest | 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(); + return this.innerApiCalls.createApi(request, options, callback); + } + /** + * Used to modify a specified API. + * + * @param {Object} request + * The request object that will be sent. + * @param {google.cloud.apigeeregistry.v1.Api} request.api + * Required. The API to update. + * + * The `name` field is used to identify the API to update. + * Format: `projects/* /locations/* /apis/*` + * @param {google.protobuf.FieldMask} request.updateMask + * The list of fields to be updated. If omitted, all fields are updated that + * are set in the request message (fields set to default values are ignored). + * If an asterisk "*" is specified, all fields are updated, including fields + * that are unspecified/default in the request. + * @param {boolean} request.allowMissing + * If set to true, and the API is not found, a new API will be created. + * In this situation, `update_mask` is ignored. + * @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.apigeeregistry.v1.Api|Api}. + * 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/registry.update_api.js + * region_tag:apigeeregistry_v1_generated_Registry_UpdateApi_async + */ + updateApi( + request?: protos.google.cloud.apigeeregistry.v1.IUpdateApiRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.apigeeregistry.v1.IApi, + protos.google.cloud.apigeeregistry.v1.IUpdateApiRequest | undefined, + {} | undefined, + ] + >; + updateApi( + request: protos.google.cloud.apigeeregistry.v1.IUpdateApiRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.apigeeregistry.v1.IApi, + | protos.google.cloud.apigeeregistry.v1.IUpdateApiRequest + | null + | undefined, + {} | null | undefined + > + ): void; + updateApi( + request: protos.google.cloud.apigeeregistry.v1.IUpdateApiRequest, + callback: Callback< + protos.google.cloud.apigeeregistry.v1.IApi, + | protos.google.cloud.apigeeregistry.v1.IUpdateApiRequest + | null + | undefined, + {} | null | undefined + > + ): void; + updateApi( + request?: protos.google.cloud.apigeeregistry.v1.IUpdateApiRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.apigeeregistry.v1.IApi, + | protos.google.cloud.apigeeregistry.v1.IUpdateApiRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.apigeeregistry.v1.IApi, + | protos.google.cloud.apigeeregistry.v1.IUpdateApiRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.apigeeregistry.v1.IApi, + protos.google.cloud.apigeeregistry.v1.IUpdateApiRequest | 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({ + 'api.name': request.api!.name ?? '', + }); + this.initialize(); + return this.innerApiCalls.updateApi(request, options, callback); + } + /** + * Removes a specified API and all of the resources that it + * owns. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The name of the API to delete. + * Format: `projects/* /locations/* /apis/*` + * @param {boolean} request.force + * If set to true, any child resources will also be deleted. + * (Otherwise, the request will only work if there are no child resources.) + * @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/registry.delete_api.js + * region_tag:apigeeregistry_v1_generated_Registry_DeleteApi_async + */ + deleteApi( + request?: protos.google.cloud.apigeeregistry.v1.IDeleteApiRequest, + options?: CallOptions + ): Promise< + [ + protos.google.protobuf.IEmpty, + protos.google.cloud.apigeeregistry.v1.IDeleteApiRequest | undefined, + {} | undefined, + ] + >; + deleteApi( + request: protos.google.cloud.apigeeregistry.v1.IDeleteApiRequest, + options: CallOptions, + callback: Callback< + protos.google.protobuf.IEmpty, + | protos.google.cloud.apigeeregistry.v1.IDeleteApiRequest + | null + | undefined, + {} | null | undefined + > + ): void; + deleteApi( + request: protos.google.cloud.apigeeregistry.v1.IDeleteApiRequest, + callback: Callback< + protos.google.protobuf.IEmpty, + | protos.google.cloud.apigeeregistry.v1.IDeleteApiRequest + | null + | undefined, + {} | null | undefined + > + ): void; + deleteApi( + request?: protos.google.cloud.apigeeregistry.v1.IDeleteApiRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.protobuf.IEmpty, + | protos.google.cloud.apigeeregistry.v1.IDeleteApiRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.protobuf.IEmpty, + | protos.google.cloud.apigeeregistry.v1.IDeleteApiRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.protobuf.IEmpty, + protos.google.cloud.apigeeregistry.v1.IDeleteApiRequest | 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(); + return this.innerApiCalls.deleteApi(request, options, callback); + } + /** + * Returns a specified version. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The name of the version to retrieve. + * Format: `projects/* /locations/* /apis/* /versions/*` + * @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.apigeeregistry.v1.ApiVersion|ApiVersion}. + * 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/registry.get_api_version.js + * region_tag:apigeeregistry_v1_generated_Registry_GetApiVersion_async + */ + getApiVersion( + request?: protos.google.cloud.apigeeregistry.v1.IGetApiVersionRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.apigeeregistry.v1.IApiVersion, + protos.google.cloud.apigeeregistry.v1.IGetApiVersionRequest | undefined, + {} | undefined, + ] + >; + getApiVersion( + request: protos.google.cloud.apigeeregistry.v1.IGetApiVersionRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.apigeeregistry.v1.IApiVersion, + | protos.google.cloud.apigeeregistry.v1.IGetApiVersionRequest + | null + | undefined, + {} | null | undefined + > + ): void; + getApiVersion( + request: protos.google.cloud.apigeeregistry.v1.IGetApiVersionRequest, + callback: Callback< + protos.google.cloud.apigeeregistry.v1.IApiVersion, + | protos.google.cloud.apigeeregistry.v1.IGetApiVersionRequest + | null + | undefined, + {} | null | undefined + > + ): void; + getApiVersion( + request?: protos.google.cloud.apigeeregistry.v1.IGetApiVersionRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.apigeeregistry.v1.IApiVersion, + | protos.google.cloud.apigeeregistry.v1.IGetApiVersionRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.apigeeregistry.v1.IApiVersion, + | protos.google.cloud.apigeeregistry.v1.IGetApiVersionRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.apigeeregistry.v1.IApiVersion, + protos.google.cloud.apigeeregistry.v1.IGetApiVersionRequest | 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(); + return this.innerApiCalls.getApiVersion(request, options, callback); + } + /** + * Creates a specified version. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The parent, which owns this collection of versions. + * Format: `projects/* /locations/* /apis/*` + * @param {google.cloud.apigeeregistry.v1.ApiVersion} request.apiVersion + * Required. The version to create. + * @param {string} request.apiVersionId + * Required. The ID to use for the version, which will become the final component of + * the version's resource name. + * + * This value should be 1-63 characters, and valid characters + * are /{@link protos.0-9|a-z}-/. + * + * Following AIP-162, IDs must not have the form of a UUID. + * @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.apigeeregistry.v1.ApiVersion|ApiVersion}. + * 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/registry.create_api_version.js + * region_tag:apigeeregistry_v1_generated_Registry_CreateApiVersion_async + */ + createApiVersion( + request?: protos.google.cloud.apigeeregistry.v1.ICreateApiVersionRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.apigeeregistry.v1.IApiVersion, + ( + | protos.google.cloud.apigeeregistry.v1.ICreateApiVersionRequest + | undefined + ), + {} | undefined, + ] + >; + createApiVersion( + request: protos.google.cloud.apigeeregistry.v1.ICreateApiVersionRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.apigeeregistry.v1.IApiVersion, + | protos.google.cloud.apigeeregistry.v1.ICreateApiVersionRequest + | null + | undefined, + {} | null | undefined + > + ): void; + createApiVersion( + request: protos.google.cloud.apigeeregistry.v1.ICreateApiVersionRequest, + callback: Callback< + protos.google.cloud.apigeeregistry.v1.IApiVersion, + | protos.google.cloud.apigeeregistry.v1.ICreateApiVersionRequest + | null + | undefined, + {} | null | undefined + > + ): void; + createApiVersion( + request?: protos.google.cloud.apigeeregistry.v1.ICreateApiVersionRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.apigeeregistry.v1.IApiVersion, + | protos.google.cloud.apigeeregistry.v1.ICreateApiVersionRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.apigeeregistry.v1.IApiVersion, + | protos.google.cloud.apigeeregistry.v1.ICreateApiVersionRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.apigeeregistry.v1.IApiVersion, + ( + | protos.google.cloud.apigeeregistry.v1.ICreateApiVersionRequest + | 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(); + return this.innerApiCalls.createApiVersion(request, options, callback); + } + /** + * Used to modify a specified version. + * + * @param {Object} request + * The request object that will be sent. + * @param {google.cloud.apigeeregistry.v1.ApiVersion} request.apiVersion + * Required. The version to update. + * + * The `name` field is used to identify the version to update. + * Format: `projects/* /locations/* /apis/* /versions/*` + * @param {google.protobuf.FieldMask} request.updateMask + * The list of fields to be updated. If omitted, all fields are updated that + * are set in the request message (fields set to default values are ignored). + * If an asterisk "*" is specified, all fields are updated, including fields + * that are unspecified/default in the request. + * @param {boolean} request.allowMissing + * If set to true, and the version is not found, a new version will be + * created. In this situation, `update_mask` is ignored. + * @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.apigeeregistry.v1.ApiVersion|ApiVersion}. + * 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/registry.update_api_version.js + * region_tag:apigeeregistry_v1_generated_Registry_UpdateApiVersion_async + */ + updateApiVersion( + request?: protos.google.cloud.apigeeregistry.v1.IUpdateApiVersionRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.apigeeregistry.v1.IApiVersion, + ( + | protos.google.cloud.apigeeregistry.v1.IUpdateApiVersionRequest + | undefined + ), + {} | undefined, + ] + >; + updateApiVersion( + request: protos.google.cloud.apigeeregistry.v1.IUpdateApiVersionRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.apigeeregistry.v1.IApiVersion, + | protos.google.cloud.apigeeregistry.v1.IUpdateApiVersionRequest + | null + | undefined, + {} | null | undefined + > + ): void; + updateApiVersion( + request: protos.google.cloud.apigeeregistry.v1.IUpdateApiVersionRequest, + callback: Callback< + protos.google.cloud.apigeeregistry.v1.IApiVersion, + | protos.google.cloud.apigeeregistry.v1.IUpdateApiVersionRequest + | null + | undefined, + {} | null | undefined + > + ): void; + updateApiVersion( + request?: protos.google.cloud.apigeeregistry.v1.IUpdateApiVersionRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.apigeeregistry.v1.IApiVersion, + | protos.google.cloud.apigeeregistry.v1.IUpdateApiVersionRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.apigeeregistry.v1.IApiVersion, + | protos.google.cloud.apigeeregistry.v1.IUpdateApiVersionRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.apigeeregistry.v1.IApiVersion, + ( + | protos.google.cloud.apigeeregistry.v1.IUpdateApiVersionRequest + | 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({ + 'api_version.name': request.apiVersion!.name ?? '', + }); + this.initialize(); + return this.innerApiCalls.updateApiVersion(request, options, callback); + } + /** + * Removes a specified version and all of the resources that + * it owns. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The name of the version to delete. + * Format: `projects/* /locations/* /apis/* /versions/*` + * @param {boolean} request.force + * If set to true, any child resources will also be deleted. + * (Otherwise, the request will only work if there are no child resources.) + * @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/registry.delete_api_version.js + * region_tag:apigeeregistry_v1_generated_Registry_DeleteApiVersion_async + */ + deleteApiVersion( + request?: protos.google.cloud.apigeeregistry.v1.IDeleteApiVersionRequest, + options?: CallOptions + ): Promise< + [ + protos.google.protobuf.IEmpty, + ( + | protos.google.cloud.apigeeregistry.v1.IDeleteApiVersionRequest + | undefined + ), + {} | undefined, + ] + >; + deleteApiVersion( + request: protos.google.cloud.apigeeregistry.v1.IDeleteApiVersionRequest, + options: CallOptions, + callback: Callback< + protos.google.protobuf.IEmpty, + | protos.google.cloud.apigeeregistry.v1.IDeleteApiVersionRequest + | null + | undefined, + {} | null | undefined + > + ): void; + deleteApiVersion( + request: protos.google.cloud.apigeeregistry.v1.IDeleteApiVersionRequest, + callback: Callback< + protos.google.protobuf.IEmpty, + | protos.google.cloud.apigeeregistry.v1.IDeleteApiVersionRequest + | null + | undefined, + {} | null | undefined + > + ): void; + deleteApiVersion( + request?: protos.google.cloud.apigeeregistry.v1.IDeleteApiVersionRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.protobuf.IEmpty, + | protos.google.cloud.apigeeregistry.v1.IDeleteApiVersionRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.protobuf.IEmpty, + | protos.google.cloud.apigeeregistry.v1.IDeleteApiVersionRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.protobuf.IEmpty, + ( + | protos.google.cloud.apigeeregistry.v1.IDeleteApiVersionRequest + | 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(); + return this.innerApiCalls.deleteApiVersion(request, options, callback); + } + /** + * Returns a specified spec. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The name of the spec to retrieve. + * Format: `projects/* /locations/* /apis/* /versions/* /specs/*` + * @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.apigeeregistry.v1.ApiSpec|ApiSpec}. + * 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/registry.get_api_spec.js + * region_tag:apigeeregistry_v1_generated_Registry_GetApiSpec_async + */ + getApiSpec( + request?: protos.google.cloud.apigeeregistry.v1.IGetApiSpecRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.apigeeregistry.v1.IApiSpec, + protos.google.cloud.apigeeregistry.v1.IGetApiSpecRequest | undefined, + {} | undefined, + ] + >; + getApiSpec( + request: protos.google.cloud.apigeeregistry.v1.IGetApiSpecRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.apigeeregistry.v1.IApiSpec, + | protos.google.cloud.apigeeregistry.v1.IGetApiSpecRequest + | null + | undefined, + {} | null | undefined + > + ): void; + getApiSpec( + request: protos.google.cloud.apigeeregistry.v1.IGetApiSpecRequest, + callback: Callback< + protos.google.cloud.apigeeregistry.v1.IApiSpec, + | protos.google.cloud.apigeeregistry.v1.IGetApiSpecRequest + | null + | undefined, + {} | null | undefined + > + ): void; + getApiSpec( + request?: protos.google.cloud.apigeeregistry.v1.IGetApiSpecRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.apigeeregistry.v1.IApiSpec, + | protos.google.cloud.apigeeregistry.v1.IGetApiSpecRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.apigeeregistry.v1.IApiSpec, + | protos.google.cloud.apigeeregistry.v1.IGetApiSpecRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.apigeeregistry.v1.IApiSpec, + protos.google.cloud.apigeeregistry.v1.IGetApiSpecRequest | 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(); + return this.innerApiCalls.getApiSpec(request, options, callback); + } + /** + * Returns the contents of a specified spec. + * If specs are stored with GZip compression, the default behavior + * is to return the spec uncompressed (the mime_type response field + * indicates the exact format returned). + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The name of the spec whose contents should be retrieved. + * Format: `projects/* /locations/* /apis/* /versions/* /specs/*` + * @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.api.HttpBody|HttpBody}. + * 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/registry.get_api_spec_contents.js + * region_tag:apigeeregistry_v1_generated_Registry_GetApiSpecContents_async + */ + getApiSpecContents( + request?: protos.google.cloud.apigeeregistry.v1.IGetApiSpecContentsRequest, + options?: CallOptions + ): Promise< + [ + protos.google.api.IHttpBody, + ( + | protos.google.cloud.apigeeregistry.v1.IGetApiSpecContentsRequest + | undefined + ), + {} | undefined, + ] + >; + getApiSpecContents( + request: protos.google.cloud.apigeeregistry.v1.IGetApiSpecContentsRequest, + options: CallOptions, + callback: Callback< + protos.google.api.IHttpBody, + | protos.google.cloud.apigeeregistry.v1.IGetApiSpecContentsRequest + | null + | undefined, + {} | null | undefined + > + ): void; + getApiSpecContents( + request: protos.google.cloud.apigeeregistry.v1.IGetApiSpecContentsRequest, + callback: Callback< + protos.google.api.IHttpBody, + | protos.google.cloud.apigeeregistry.v1.IGetApiSpecContentsRequest + | null + | undefined, + {} | null | undefined + > + ): void; + getApiSpecContents( + request?: protos.google.cloud.apigeeregistry.v1.IGetApiSpecContentsRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.api.IHttpBody, + | protos.google.cloud.apigeeregistry.v1.IGetApiSpecContentsRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.api.IHttpBody, + | protos.google.cloud.apigeeregistry.v1.IGetApiSpecContentsRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.api.IHttpBody, + ( + | protos.google.cloud.apigeeregistry.v1.IGetApiSpecContentsRequest + | 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(); + return this.innerApiCalls.getApiSpecContents(request, options, callback); + } + /** + * Creates a specified spec. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The parent, which owns this collection of specs. + * Format: `projects/* /locations/* /apis/* /versions/*` + * @param {google.cloud.apigeeregistry.v1.ApiSpec} request.apiSpec + * Required. The spec to create. + * @param {string} request.apiSpecId + * Required. The ID to use for the spec, which will become the final component of + * the spec's resource name. + * + * This value should be 4-63 characters, and valid characters + * are /{@link protos.0-9|a-z}-/. + * + * Following AIP-162, IDs must not have the form of a UUID. + * @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.apigeeregistry.v1.ApiSpec|ApiSpec}. + * 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/registry.create_api_spec.js + * region_tag:apigeeregistry_v1_generated_Registry_CreateApiSpec_async + */ + createApiSpec( + request?: protos.google.cloud.apigeeregistry.v1.ICreateApiSpecRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.apigeeregistry.v1.IApiSpec, + protos.google.cloud.apigeeregistry.v1.ICreateApiSpecRequest | undefined, + {} | undefined, + ] + >; + createApiSpec( + request: protos.google.cloud.apigeeregistry.v1.ICreateApiSpecRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.apigeeregistry.v1.IApiSpec, + | protos.google.cloud.apigeeregistry.v1.ICreateApiSpecRequest + | null + | undefined, + {} | null | undefined + > + ): void; + createApiSpec( + request: protos.google.cloud.apigeeregistry.v1.ICreateApiSpecRequest, + callback: Callback< + protos.google.cloud.apigeeregistry.v1.IApiSpec, + | protos.google.cloud.apigeeregistry.v1.ICreateApiSpecRequest + | null + | undefined, + {} | null | undefined + > + ): void; + createApiSpec( + request?: protos.google.cloud.apigeeregistry.v1.ICreateApiSpecRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.apigeeregistry.v1.IApiSpec, + | protos.google.cloud.apigeeregistry.v1.ICreateApiSpecRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.apigeeregistry.v1.IApiSpec, + | protos.google.cloud.apigeeregistry.v1.ICreateApiSpecRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.apigeeregistry.v1.IApiSpec, + protos.google.cloud.apigeeregistry.v1.ICreateApiSpecRequest | 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(); + return this.innerApiCalls.createApiSpec(request, options, callback); + } + /** + * Used to modify a specified spec. + * + * @param {Object} request + * The request object that will be sent. + * @param {google.cloud.apigeeregistry.v1.ApiSpec} request.apiSpec + * Required. The spec to update. + * + * The `name` field is used to identify the spec to update. + * Format: `projects/* /locations/* /apis/* /versions/* /specs/*` + * @param {google.protobuf.FieldMask} request.updateMask + * The list of fields to be updated. If omitted, all fields are updated that + * are set in the request message (fields set to default values are ignored). + * If an asterisk "*" is specified, all fields are updated, including fields + * that are unspecified/default in the request. + * @param {boolean} request.allowMissing + * If set to true, and the spec is not found, a new spec will be created. + * In this situation, `update_mask` is ignored. + * @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.apigeeregistry.v1.ApiSpec|ApiSpec}. + * 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/registry.update_api_spec.js + * region_tag:apigeeregistry_v1_generated_Registry_UpdateApiSpec_async + */ + updateApiSpec( + request?: protos.google.cloud.apigeeregistry.v1.IUpdateApiSpecRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.apigeeregistry.v1.IApiSpec, + protos.google.cloud.apigeeregistry.v1.IUpdateApiSpecRequest | undefined, + {} | undefined, + ] + >; + updateApiSpec( + request: protos.google.cloud.apigeeregistry.v1.IUpdateApiSpecRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.apigeeregistry.v1.IApiSpec, + | protos.google.cloud.apigeeregistry.v1.IUpdateApiSpecRequest + | null + | undefined, + {} | null | undefined + > + ): void; + updateApiSpec( + request: protos.google.cloud.apigeeregistry.v1.IUpdateApiSpecRequest, + callback: Callback< + protos.google.cloud.apigeeregistry.v1.IApiSpec, + | protos.google.cloud.apigeeregistry.v1.IUpdateApiSpecRequest + | null + | undefined, + {} | null | undefined + > + ): void; + updateApiSpec( + request?: protos.google.cloud.apigeeregistry.v1.IUpdateApiSpecRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.apigeeregistry.v1.IApiSpec, + | protos.google.cloud.apigeeregistry.v1.IUpdateApiSpecRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.apigeeregistry.v1.IApiSpec, + | protos.google.cloud.apigeeregistry.v1.IUpdateApiSpecRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.apigeeregistry.v1.IApiSpec, + protos.google.cloud.apigeeregistry.v1.IUpdateApiSpecRequest | 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({ + 'api_spec.name': request.apiSpec!.name ?? '', + }); + this.initialize(); + return this.innerApiCalls.updateApiSpec(request, options, callback); + } + /** + * Removes a specified spec, all revisions, and all child + * resources (e.g., artifacts). + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The name of the spec to delete. + * Format: `projects/* /locations/* /apis/* /versions/* /specs/*` + * @param {boolean} request.force + * If set to true, any child resources will also be deleted. + * (Otherwise, the request will only work if there are no child resources.) + * @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/registry.delete_api_spec.js + * region_tag:apigeeregistry_v1_generated_Registry_DeleteApiSpec_async + */ + deleteApiSpec( + request?: protos.google.cloud.apigeeregistry.v1.IDeleteApiSpecRequest, + options?: CallOptions + ): Promise< + [ + protos.google.protobuf.IEmpty, + protos.google.cloud.apigeeregistry.v1.IDeleteApiSpecRequest | undefined, + {} | undefined, + ] + >; + deleteApiSpec( + request: protos.google.cloud.apigeeregistry.v1.IDeleteApiSpecRequest, + options: CallOptions, + callback: Callback< + protos.google.protobuf.IEmpty, + | protos.google.cloud.apigeeregistry.v1.IDeleteApiSpecRequest + | null + | undefined, + {} | null | undefined + > + ): void; + deleteApiSpec( + request: protos.google.cloud.apigeeregistry.v1.IDeleteApiSpecRequest, + callback: Callback< + protos.google.protobuf.IEmpty, + | protos.google.cloud.apigeeregistry.v1.IDeleteApiSpecRequest + | null + | undefined, + {} | null | undefined + > + ): void; + deleteApiSpec( + request?: protos.google.cloud.apigeeregistry.v1.IDeleteApiSpecRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.protobuf.IEmpty, + | protos.google.cloud.apigeeregistry.v1.IDeleteApiSpecRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.protobuf.IEmpty, + | protos.google.cloud.apigeeregistry.v1.IDeleteApiSpecRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.protobuf.IEmpty, + protos.google.cloud.apigeeregistry.v1.IDeleteApiSpecRequest | 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(); + return this.innerApiCalls.deleteApiSpec(request, options, callback); + } + /** + * Adds a tag to a specified revision of a spec. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The name of the spec to be tagged, including the revision ID. + * @param {string} request.tag + * Required. The tag to apply. + * The tag should be at most 40 characters, and match `{@link protos.a-z0-9-|a-z}{3,39}`. + * @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.apigeeregistry.v1.ApiSpec|ApiSpec}. + * 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/registry.tag_api_spec_revision.js + * region_tag:apigeeregistry_v1_generated_Registry_TagApiSpecRevision_async + */ + tagApiSpecRevision( + request?: protos.google.cloud.apigeeregistry.v1.ITagApiSpecRevisionRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.apigeeregistry.v1.IApiSpec, + ( + | protos.google.cloud.apigeeregistry.v1.ITagApiSpecRevisionRequest + | undefined + ), + {} | undefined, + ] + >; + tagApiSpecRevision( + request: protos.google.cloud.apigeeregistry.v1.ITagApiSpecRevisionRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.apigeeregistry.v1.IApiSpec, + | protos.google.cloud.apigeeregistry.v1.ITagApiSpecRevisionRequest + | null + | undefined, + {} | null | undefined + > + ): void; + tagApiSpecRevision( + request: protos.google.cloud.apigeeregistry.v1.ITagApiSpecRevisionRequest, + callback: Callback< + protos.google.cloud.apigeeregistry.v1.IApiSpec, + | protos.google.cloud.apigeeregistry.v1.ITagApiSpecRevisionRequest + | null + | undefined, + {} | null | undefined + > + ): void; + tagApiSpecRevision( + request?: protos.google.cloud.apigeeregistry.v1.ITagApiSpecRevisionRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.apigeeregistry.v1.IApiSpec, + | protos.google.cloud.apigeeregistry.v1.ITagApiSpecRevisionRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.apigeeregistry.v1.IApiSpec, + | protos.google.cloud.apigeeregistry.v1.ITagApiSpecRevisionRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.apigeeregistry.v1.IApiSpec, + ( + | protos.google.cloud.apigeeregistry.v1.ITagApiSpecRevisionRequest + | 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(); + return this.innerApiCalls.tagApiSpecRevision(request, options, callback); + } + /** + * Sets the current revision to a specified prior revision. + * Note that this creates a new revision with a new revision ID. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The spec being rolled back. + * @param {string} request.revisionId + * Required. The revision ID to roll back to. + * It must be a revision of the same spec. + * + * Example: `c7cfa2a8` + * @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.apigeeregistry.v1.ApiSpec|ApiSpec}. + * 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/registry.rollback_api_spec.js + * region_tag:apigeeregistry_v1_generated_Registry_RollbackApiSpec_async + */ + rollbackApiSpec( + request?: protos.google.cloud.apigeeregistry.v1.IRollbackApiSpecRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.apigeeregistry.v1.IApiSpec, + protos.google.cloud.apigeeregistry.v1.IRollbackApiSpecRequest | undefined, + {} | undefined, + ] + >; + rollbackApiSpec( + request: protos.google.cloud.apigeeregistry.v1.IRollbackApiSpecRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.apigeeregistry.v1.IApiSpec, + | protos.google.cloud.apigeeregistry.v1.IRollbackApiSpecRequest + | null + | undefined, + {} | null | undefined + > + ): void; + rollbackApiSpec( + request: protos.google.cloud.apigeeregistry.v1.IRollbackApiSpecRequest, + callback: Callback< + protos.google.cloud.apigeeregistry.v1.IApiSpec, + | protos.google.cloud.apigeeregistry.v1.IRollbackApiSpecRequest + | null + | undefined, + {} | null | undefined + > + ): void; + rollbackApiSpec( + request?: protos.google.cloud.apigeeregistry.v1.IRollbackApiSpecRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.apigeeregistry.v1.IApiSpec, + | protos.google.cloud.apigeeregistry.v1.IRollbackApiSpecRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.apigeeregistry.v1.IApiSpec, + | protos.google.cloud.apigeeregistry.v1.IRollbackApiSpecRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.apigeeregistry.v1.IApiSpec, + protos.google.cloud.apigeeregistry.v1.IRollbackApiSpecRequest | 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(); + return this.innerApiCalls.rollbackApiSpec(request, options, callback); + } + /** + * Deletes a revision of a spec. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The name of the spec revision to be deleted, + * with a revision ID explicitly included. + * + * Example: + * `projects/sample/locations/global/apis/petstore/versions/1.0.0/specs/openapi.yaml@c7cfa2a8` + * @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.apigeeregistry.v1.ApiSpec|ApiSpec}. + * 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/registry.delete_api_spec_revision.js + * region_tag:apigeeregistry_v1_generated_Registry_DeleteApiSpecRevision_async + */ + deleteApiSpecRevision( + request?: protos.google.cloud.apigeeregistry.v1.IDeleteApiSpecRevisionRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.apigeeregistry.v1.IApiSpec, + ( + | protos.google.cloud.apigeeregistry.v1.IDeleteApiSpecRevisionRequest + | undefined + ), + {} | undefined, + ] + >; + deleteApiSpecRevision( + request: protos.google.cloud.apigeeregistry.v1.IDeleteApiSpecRevisionRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.apigeeregistry.v1.IApiSpec, + | protos.google.cloud.apigeeregistry.v1.IDeleteApiSpecRevisionRequest + | null + | undefined, + {} | null | undefined + > + ): void; + deleteApiSpecRevision( + request: protos.google.cloud.apigeeregistry.v1.IDeleteApiSpecRevisionRequest, + callback: Callback< + protos.google.cloud.apigeeregistry.v1.IApiSpec, + | protos.google.cloud.apigeeregistry.v1.IDeleteApiSpecRevisionRequest + | null + | undefined, + {} | null | undefined + > + ): void; + deleteApiSpecRevision( + request?: protos.google.cloud.apigeeregistry.v1.IDeleteApiSpecRevisionRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.apigeeregistry.v1.IApiSpec, + | protos.google.cloud.apigeeregistry.v1.IDeleteApiSpecRevisionRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.apigeeregistry.v1.IApiSpec, + | protos.google.cloud.apigeeregistry.v1.IDeleteApiSpecRevisionRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.apigeeregistry.v1.IApiSpec, + ( + | protos.google.cloud.apigeeregistry.v1.IDeleteApiSpecRevisionRequest + | 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(); + return this.innerApiCalls.deleteApiSpecRevision(request, options, callback); + } + /** + * Returns a specified deployment. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The name of the deployment to retrieve. + * Format: `projects/* /locations/* /apis/* /deployments/*` + * @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.apigeeregistry.v1.ApiDeployment|ApiDeployment}. + * 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/registry.get_api_deployment.js + * region_tag:apigeeregistry_v1_generated_Registry_GetApiDeployment_async + */ + getApiDeployment( + request?: protos.google.cloud.apigeeregistry.v1.IGetApiDeploymentRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.apigeeregistry.v1.IApiDeployment, + ( + | protos.google.cloud.apigeeregistry.v1.IGetApiDeploymentRequest + | undefined + ), + {} | undefined, + ] + >; + getApiDeployment( + request: protos.google.cloud.apigeeregistry.v1.IGetApiDeploymentRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.apigeeregistry.v1.IApiDeployment, + | protos.google.cloud.apigeeregistry.v1.IGetApiDeploymentRequest + | null + | undefined, + {} | null | undefined + > + ): void; + getApiDeployment( + request: protos.google.cloud.apigeeregistry.v1.IGetApiDeploymentRequest, + callback: Callback< + protos.google.cloud.apigeeregistry.v1.IApiDeployment, + | protos.google.cloud.apigeeregistry.v1.IGetApiDeploymentRequest + | null + | undefined, + {} | null | undefined + > + ): void; + getApiDeployment( + request?: protos.google.cloud.apigeeregistry.v1.IGetApiDeploymentRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.apigeeregistry.v1.IApiDeployment, + | protos.google.cloud.apigeeregistry.v1.IGetApiDeploymentRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.apigeeregistry.v1.IApiDeployment, + | protos.google.cloud.apigeeregistry.v1.IGetApiDeploymentRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.apigeeregistry.v1.IApiDeployment, + ( + | protos.google.cloud.apigeeregistry.v1.IGetApiDeploymentRequest + | 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(); + return this.innerApiCalls.getApiDeployment(request, options, callback); + } + /** + * Creates a specified deployment. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The parent, which owns this collection of deployments. + * Format: `projects/* /locations/* /apis/*` + * @param {google.cloud.apigeeregistry.v1.ApiDeployment} request.apiDeployment + * Required. The deployment to create. + * @param {string} request.apiDeploymentId + * Required. The ID to use for the deployment, which will become the final component of + * the deployment's resource name. + * + * This value should be 4-63 characters, and valid characters + * are /{@link protos.0-9|a-z}-/. + * + * Following AIP-162, IDs must not have the form of a UUID. + * @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.apigeeregistry.v1.ApiDeployment|ApiDeployment}. + * 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/registry.create_api_deployment.js + * region_tag:apigeeregistry_v1_generated_Registry_CreateApiDeployment_async + */ + createApiDeployment( + request?: protos.google.cloud.apigeeregistry.v1.ICreateApiDeploymentRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.apigeeregistry.v1.IApiDeployment, + ( + | protos.google.cloud.apigeeregistry.v1.ICreateApiDeploymentRequest + | undefined + ), + {} | undefined, + ] + >; + createApiDeployment( + request: protos.google.cloud.apigeeregistry.v1.ICreateApiDeploymentRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.apigeeregistry.v1.IApiDeployment, + | protos.google.cloud.apigeeregistry.v1.ICreateApiDeploymentRequest + | null + | undefined, + {} | null | undefined + > + ): void; + createApiDeployment( + request: protos.google.cloud.apigeeregistry.v1.ICreateApiDeploymentRequest, + callback: Callback< + protos.google.cloud.apigeeregistry.v1.IApiDeployment, + | protos.google.cloud.apigeeregistry.v1.ICreateApiDeploymentRequest + | null + | undefined, + {} | null | undefined + > + ): void; + createApiDeployment( + request?: protos.google.cloud.apigeeregistry.v1.ICreateApiDeploymentRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.apigeeregistry.v1.IApiDeployment, + | protos.google.cloud.apigeeregistry.v1.ICreateApiDeploymentRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.apigeeregistry.v1.IApiDeployment, + | protos.google.cloud.apigeeregistry.v1.ICreateApiDeploymentRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.apigeeregistry.v1.IApiDeployment, + ( + | protos.google.cloud.apigeeregistry.v1.ICreateApiDeploymentRequest + | 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(); + return this.innerApiCalls.createApiDeployment(request, options, callback); + } + /** + * Used to modify a specified deployment. + * + * @param {Object} request + * The request object that will be sent. + * @param {google.cloud.apigeeregistry.v1.ApiDeployment} request.apiDeployment + * Required. The deployment to update. + * + * The `name` field is used to identify the deployment to update. + * Format: `projects/* /locations/* /apis/* /deployments/*` + * @param {google.protobuf.FieldMask} request.updateMask + * The list of fields to be updated. If omitted, all fields are updated that + * are set in the request message (fields set to default values are ignored). + * If an asterisk "*" is specified, all fields are updated, including fields + * that are unspecified/default in the request. + * @param {boolean} request.allowMissing + * If set to true, and the deployment is not found, a new deployment will be + * created. In this situation, `update_mask` is ignored. + * @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.apigeeregistry.v1.ApiDeployment|ApiDeployment}. + * 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/registry.update_api_deployment.js + * region_tag:apigeeregistry_v1_generated_Registry_UpdateApiDeployment_async + */ + updateApiDeployment( + request?: protos.google.cloud.apigeeregistry.v1.IUpdateApiDeploymentRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.apigeeregistry.v1.IApiDeployment, + ( + | protos.google.cloud.apigeeregistry.v1.IUpdateApiDeploymentRequest + | undefined + ), + {} | undefined, + ] + >; + updateApiDeployment( + request: protos.google.cloud.apigeeregistry.v1.IUpdateApiDeploymentRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.apigeeregistry.v1.IApiDeployment, + | protos.google.cloud.apigeeregistry.v1.IUpdateApiDeploymentRequest + | null + | undefined, + {} | null | undefined + > + ): void; + updateApiDeployment( + request: protos.google.cloud.apigeeregistry.v1.IUpdateApiDeploymentRequest, + callback: Callback< + protos.google.cloud.apigeeregistry.v1.IApiDeployment, + | protos.google.cloud.apigeeregistry.v1.IUpdateApiDeploymentRequest + | null + | undefined, + {} | null | undefined + > + ): void; + updateApiDeployment( + request?: protos.google.cloud.apigeeregistry.v1.IUpdateApiDeploymentRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.apigeeregistry.v1.IApiDeployment, + | protos.google.cloud.apigeeregistry.v1.IUpdateApiDeploymentRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.apigeeregistry.v1.IApiDeployment, + | protos.google.cloud.apigeeregistry.v1.IUpdateApiDeploymentRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.apigeeregistry.v1.IApiDeployment, + ( + | protos.google.cloud.apigeeregistry.v1.IUpdateApiDeploymentRequest + | 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({ + 'api_deployment.name': request.apiDeployment!.name ?? '', + }); + this.initialize(); + return this.innerApiCalls.updateApiDeployment(request, options, callback); + } + /** + * Removes a specified deployment, all revisions, and all + * child resources (e.g., artifacts). + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The name of the deployment to delete. + * Format: `projects/* /locations/* /apis/* /deployments/*` + * @param {boolean} request.force + * If set to true, any child resources will also be deleted. + * (Otherwise, the request will only work if there are no child resources.) + * @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/registry.delete_api_deployment.js + * region_tag:apigeeregistry_v1_generated_Registry_DeleteApiDeployment_async + */ + deleteApiDeployment( + request?: protos.google.cloud.apigeeregistry.v1.IDeleteApiDeploymentRequest, + options?: CallOptions + ): Promise< + [ + protos.google.protobuf.IEmpty, + ( + | protos.google.cloud.apigeeregistry.v1.IDeleteApiDeploymentRequest + | undefined + ), + {} | undefined, + ] + >; + deleteApiDeployment( + request: protos.google.cloud.apigeeregistry.v1.IDeleteApiDeploymentRequest, + options: CallOptions, + callback: Callback< + protos.google.protobuf.IEmpty, + | protos.google.cloud.apigeeregistry.v1.IDeleteApiDeploymentRequest + | null + | undefined, + {} | null | undefined + > + ): void; + deleteApiDeployment( + request: protos.google.cloud.apigeeregistry.v1.IDeleteApiDeploymentRequest, + callback: Callback< + protos.google.protobuf.IEmpty, + | protos.google.cloud.apigeeregistry.v1.IDeleteApiDeploymentRequest + | null + | undefined, + {} | null | undefined + > + ): void; + deleteApiDeployment( + request?: protos.google.cloud.apigeeregistry.v1.IDeleteApiDeploymentRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.protobuf.IEmpty, + | protos.google.cloud.apigeeregistry.v1.IDeleteApiDeploymentRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.protobuf.IEmpty, + | protos.google.cloud.apigeeregistry.v1.IDeleteApiDeploymentRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.protobuf.IEmpty, + ( + | protos.google.cloud.apigeeregistry.v1.IDeleteApiDeploymentRequest + | 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(); + return this.innerApiCalls.deleteApiDeployment(request, options, callback); + } + /** + * Adds a tag to a specified revision of a + * deployment. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The name of the deployment to be tagged, including the revision ID. + * @param {string} request.tag + * Required. The tag to apply. + * The tag should be at most 40 characters, and match `{@link protos.a-z0-9-|a-z}{3,39}`. + * @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.apigeeregistry.v1.ApiDeployment|ApiDeployment}. + * 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/registry.tag_api_deployment_revision.js + * region_tag:apigeeregistry_v1_generated_Registry_TagApiDeploymentRevision_async + */ + tagApiDeploymentRevision( + request?: protos.google.cloud.apigeeregistry.v1.ITagApiDeploymentRevisionRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.apigeeregistry.v1.IApiDeployment, + ( + | protos.google.cloud.apigeeregistry.v1.ITagApiDeploymentRevisionRequest + | undefined + ), + {} | undefined, + ] + >; + tagApiDeploymentRevision( + request: protos.google.cloud.apigeeregistry.v1.ITagApiDeploymentRevisionRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.apigeeregistry.v1.IApiDeployment, + | protos.google.cloud.apigeeregistry.v1.ITagApiDeploymentRevisionRequest + | null + | undefined, + {} | null | undefined + > + ): void; + tagApiDeploymentRevision( + request: protos.google.cloud.apigeeregistry.v1.ITagApiDeploymentRevisionRequest, + callback: Callback< + protos.google.cloud.apigeeregistry.v1.IApiDeployment, + | protos.google.cloud.apigeeregistry.v1.ITagApiDeploymentRevisionRequest + | null + | undefined, + {} | null | undefined + > + ): void; + tagApiDeploymentRevision( + request?: protos.google.cloud.apigeeregistry.v1.ITagApiDeploymentRevisionRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.apigeeregistry.v1.IApiDeployment, + | protos.google.cloud.apigeeregistry.v1.ITagApiDeploymentRevisionRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.apigeeregistry.v1.IApiDeployment, + | protos.google.cloud.apigeeregistry.v1.ITagApiDeploymentRevisionRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.apigeeregistry.v1.IApiDeployment, + ( + | protos.google.cloud.apigeeregistry.v1.ITagApiDeploymentRevisionRequest + | 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(); + return this.innerApiCalls.tagApiDeploymentRevision( + request, + options, + callback + ); + } + /** + * Sets the current revision to a specified prior + * revision. Note that this creates a new revision with a new revision ID. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The deployment being rolled back. + * @param {string} request.revisionId + * Required. The revision ID to roll back to. + * It must be a revision of the same deployment. + * + * Example: `c7cfa2a8` + * @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.apigeeregistry.v1.ApiDeployment|ApiDeployment}. + * 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/registry.rollback_api_deployment.js + * region_tag:apigeeregistry_v1_generated_Registry_RollbackApiDeployment_async + */ + rollbackApiDeployment( + request?: protos.google.cloud.apigeeregistry.v1.IRollbackApiDeploymentRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.apigeeregistry.v1.IApiDeployment, + ( + | protos.google.cloud.apigeeregistry.v1.IRollbackApiDeploymentRequest + | undefined + ), + {} | undefined, + ] + >; + rollbackApiDeployment( + request: protos.google.cloud.apigeeregistry.v1.IRollbackApiDeploymentRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.apigeeregistry.v1.IApiDeployment, + | protos.google.cloud.apigeeregistry.v1.IRollbackApiDeploymentRequest + | null + | undefined, + {} | null | undefined + > + ): void; + rollbackApiDeployment( + request: protos.google.cloud.apigeeregistry.v1.IRollbackApiDeploymentRequest, + callback: Callback< + protos.google.cloud.apigeeregistry.v1.IApiDeployment, + | protos.google.cloud.apigeeregistry.v1.IRollbackApiDeploymentRequest + | null + | undefined, + {} | null | undefined + > + ): void; + rollbackApiDeployment( + request?: protos.google.cloud.apigeeregistry.v1.IRollbackApiDeploymentRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.apigeeregistry.v1.IApiDeployment, + | protos.google.cloud.apigeeregistry.v1.IRollbackApiDeploymentRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.apigeeregistry.v1.IApiDeployment, + | protos.google.cloud.apigeeregistry.v1.IRollbackApiDeploymentRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.apigeeregistry.v1.IApiDeployment, + ( + | protos.google.cloud.apigeeregistry.v1.IRollbackApiDeploymentRequest + | 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(); + return this.innerApiCalls.rollbackApiDeployment(request, options, callback); + } + /** + * Deletes a revision of a deployment. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The name of the deployment revision to be deleted, + * with a revision ID explicitly included. + * + * Example: + * `projects/sample/locations/global/apis/petstore/deployments/prod@c7cfa2a8` + * @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.apigeeregistry.v1.ApiDeployment|ApiDeployment}. + * 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/registry.delete_api_deployment_revision.js + * region_tag:apigeeregistry_v1_generated_Registry_DeleteApiDeploymentRevision_async + */ + deleteApiDeploymentRevision( + request?: protos.google.cloud.apigeeregistry.v1.IDeleteApiDeploymentRevisionRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.apigeeregistry.v1.IApiDeployment, + ( + | protos.google.cloud.apigeeregistry.v1.IDeleteApiDeploymentRevisionRequest + | undefined + ), + {} | undefined, + ] + >; + deleteApiDeploymentRevision( + request: protos.google.cloud.apigeeregistry.v1.IDeleteApiDeploymentRevisionRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.apigeeregistry.v1.IApiDeployment, + | protos.google.cloud.apigeeregistry.v1.IDeleteApiDeploymentRevisionRequest + | null + | undefined, + {} | null | undefined + > + ): void; + deleteApiDeploymentRevision( + request: protos.google.cloud.apigeeregistry.v1.IDeleteApiDeploymentRevisionRequest, + callback: Callback< + protos.google.cloud.apigeeregistry.v1.IApiDeployment, + | protos.google.cloud.apigeeregistry.v1.IDeleteApiDeploymentRevisionRequest + | null + | undefined, + {} | null | undefined + > + ): void; + deleteApiDeploymentRevision( + request?: protos.google.cloud.apigeeregistry.v1.IDeleteApiDeploymentRevisionRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.apigeeregistry.v1.IApiDeployment, + | protos.google.cloud.apigeeregistry.v1.IDeleteApiDeploymentRevisionRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.apigeeregistry.v1.IApiDeployment, + | protos.google.cloud.apigeeregistry.v1.IDeleteApiDeploymentRevisionRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.apigeeregistry.v1.IApiDeployment, + ( + | protos.google.cloud.apigeeregistry.v1.IDeleteApiDeploymentRevisionRequest + | 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(); + return this.innerApiCalls.deleteApiDeploymentRevision( + request, + options, + callback + ); + } + /** + * Returns a specified artifact. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The name of the artifact to retrieve. + * Format: `{parent}/artifacts/*` + * @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.apigeeregistry.v1.Artifact|Artifact}. + * 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/registry.get_artifact.js + * region_tag:apigeeregistry_v1_generated_Registry_GetArtifact_async + */ + getArtifact( + request?: protos.google.cloud.apigeeregistry.v1.IGetArtifactRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.apigeeregistry.v1.IArtifact, + protos.google.cloud.apigeeregistry.v1.IGetArtifactRequest | undefined, + {} | undefined, + ] + >; + getArtifact( + request: protos.google.cloud.apigeeregistry.v1.IGetArtifactRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.apigeeregistry.v1.IArtifact, + | protos.google.cloud.apigeeregistry.v1.IGetArtifactRequest + | null + | undefined, + {} | null | undefined + > + ): void; + getArtifact( + request: protos.google.cloud.apigeeregistry.v1.IGetArtifactRequest, + callback: Callback< + protos.google.cloud.apigeeregistry.v1.IArtifact, + | protos.google.cloud.apigeeregistry.v1.IGetArtifactRequest + | null + | undefined, + {} | null | undefined + > + ): void; + getArtifact( + request?: protos.google.cloud.apigeeregistry.v1.IGetArtifactRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.apigeeregistry.v1.IArtifact, + | protos.google.cloud.apigeeregistry.v1.IGetArtifactRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.apigeeregistry.v1.IArtifact, + | protos.google.cloud.apigeeregistry.v1.IGetArtifactRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.apigeeregistry.v1.IArtifact, + protos.google.cloud.apigeeregistry.v1.IGetArtifactRequest | 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(); + return this.innerApiCalls.getArtifact(request, options, callback); + } + /** + * Returns the contents of a specified artifact. + * If artifacts are stored with GZip compression, the default behavior + * is to return the artifact uncompressed (the mime_type response field + * indicates the exact format returned). + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The name of the artifact whose contents should be retrieved. + * Format: `{parent}/artifacts/*` + * @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.api.HttpBody|HttpBody}. + * 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/registry.get_artifact_contents.js + * region_tag:apigeeregistry_v1_generated_Registry_GetArtifactContents_async + */ + getArtifactContents( + request?: protos.google.cloud.apigeeregistry.v1.IGetArtifactContentsRequest, + options?: CallOptions + ): Promise< + [ + protos.google.api.IHttpBody, + ( + | protos.google.cloud.apigeeregistry.v1.IGetArtifactContentsRequest + | undefined + ), + {} | undefined, + ] + >; + getArtifactContents( + request: protos.google.cloud.apigeeregistry.v1.IGetArtifactContentsRequest, + options: CallOptions, + callback: Callback< + protos.google.api.IHttpBody, + | protos.google.cloud.apigeeregistry.v1.IGetArtifactContentsRequest + | null + | undefined, + {} | null | undefined + > + ): void; + getArtifactContents( + request: protos.google.cloud.apigeeregistry.v1.IGetArtifactContentsRequest, + callback: Callback< + protos.google.api.IHttpBody, + | protos.google.cloud.apigeeregistry.v1.IGetArtifactContentsRequest + | null + | undefined, + {} | null | undefined + > + ): void; + getArtifactContents( + request?: protos.google.cloud.apigeeregistry.v1.IGetArtifactContentsRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.api.IHttpBody, + | protos.google.cloud.apigeeregistry.v1.IGetArtifactContentsRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.api.IHttpBody, + | protos.google.cloud.apigeeregistry.v1.IGetArtifactContentsRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.api.IHttpBody, + ( + | protos.google.cloud.apigeeregistry.v1.IGetArtifactContentsRequest + | 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(); + return this.innerApiCalls.getArtifactContents(request, options, callback); + } + /** + * Creates a specified artifact. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The parent, which owns this collection of artifacts. + * Format: `{parent}` + * @param {google.cloud.apigeeregistry.v1.Artifact} request.artifact + * Required. The artifact to create. + * @param {string} request.artifactId + * Required. The ID to use for the artifact, which will become the final component of + * the artifact's resource name. + * + * This value should be 4-63 characters, and valid characters + * are /{@link protos.0-9|a-z}-/. + * + * Following AIP-162, IDs must not have the form of a UUID. + * @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.apigeeregistry.v1.Artifact|Artifact}. + * 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/registry.create_artifact.js + * region_tag:apigeeregistry_v1_generated_Registry_CreateArtifact_async + */ + createArtifact( + request?: protos.google.cloud.apigeeregistry.v1.ICreateArtifactRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.apigeeregistry.v1.IArtifact, + protos.google.cloud.apigeeregistry.v1.ICreateArtifactRequest | undefined, + {} | undefined, + ] + >; + createArtifact( + request: protos.google.cloud.apigeeregistry.v1.ICreateArtifactRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.apigeeregistry.v1.IArtifact, + | protos.google.cloud.apigeeregistry.v1.ICreateArtifactRequest + | null + | undefined, + {} | null | undefined + > + ): void; + createArtifact( + request: protos.google.cloud.apigeeregistry.v1.ICreateArtifactRequest, + callback: Callback< + protos.google.cloud.apigeeregistry.v1.IArtifact, + | protos.google.cloud.apigeeregistry.v1.ICreateArtifactRequest + | null + | undefined, + {} | null | undefined + > + ): void; + createArtifact( + request?: protos.google.cloud.apigeeregistry.v1.ICreateArtifactRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.apigeeregistry.v1.IArtifact, + | protos.google.cloud.apigeeregistry.v1.ICreateArtifactRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.apigeeregistry.v1.IArtifact, + | protos.google.cloud.apigeeregistry.v1.ICreateArtifactRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.apigeeregistry.v1.IArtifact, + protos.google.cloud.apigeeregistry.v1.ICreateArtifactRequest | 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(); + return this.innerApiCalls.createArtifact(request, options, callback); + } + /** + * Used to replace a specified artifact. + * + * @param {Object} request + * The request object that will be sent. + * @param {google.cloud.apigeeregistry.v1.Artifact} request.artifact + * Required. The artifact to replace. + * + * The `name` field is used to identify the artifact to replace. + * Format: `{parent}/artifacts/*` + * @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.apigeeregistry.v1.Artifact|Artifact}. + * 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/registry.replace_artifact.js + * region_tag:apigeeregistry_v1_generated_Registry_ReplaceArtifact_async + */ + replaceArtifact( + request?: protos.google.cloud.apigeeregistry.v1.IReplaceArtifactRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.apigeeregistry.v1.IArtifact, + protos.google.cloud.apigeeregistry.v1.IReplaceArtifactRequest | undefined, + {} | undefined, + ] + >; + replaceArtifact( + request: protos.google.cloud.apigeeregistry.v1.IReplaceArtifactRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.apigeeregistry.v1.IArtifact, + | protos.google.cloud.apigeeregistry.v1.IReplaceArtifactRequest + | null + | undefined, + {} | null | undefined + > + ): void; + replaceArtifact( + request: protos.google.cloud.apigeeregistry.v1.IReplaceArtifactRequest, + callback: Callback< + protos.google.cloud.apigeeregistry.v1.IArtifact, + | protos.google.cloud.apigeeregistry.v1.IReplaceArtifactRequest + | null + | undefined, + {} | null | undefined + > + ): void; + replaceArtifact( + request?: protos.google.cloud.apigeeregistry.v1.IReplaceArtifactRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.apigeeregistry.v1.IArtifact, + | protos.google.cloud.apigeeregistry.v1.IReplaceArtifactRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.apigeeregistry.v1.IArtifact, + | protos.google.cloud.apigeeregistry.v1.IReplaceArtifactRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.apigeeregistry.v1.IArtifact, + protos.google.cloud.apigeeregistry.v1.IReplaceArtifactRequest | 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({ + 'artifact.name': request.artifact!.name ?? '', + }); + this.initialize(); + return this.innerApiCalls.replaceArtifact(request, options, callback); + } + /** + * Removes a specified artifact. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The name of the artifact to delete. + * Format: `{parent}/artifacts/*` + * @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/registry.delete_artifact.js + * region_tag:apigeeregistry_v1_generated_Registry_DeleteArtifact_async + */ + deleteArtifact( + request?: protos.google.cloud.apigeeregistry.v1.IDeleteArtifactRequest, + options?: CallOptions + ): Promise< + [ + protos.google.protobuf.IEmpty, + protos.google.cloud.apigeeregistry.v1.IDeleteArtifactRequest | undefined, + {} | undefined, + ] + >; + deleteArtifact( + request: protos.google.cloud.apigeeregistry.v1.IDeleteArtifactRequest, + options: CallOptions, + callback: Callback< + protos.google.protobuf.IEmpty, + | protos.google.cloud.apigeeregistry.v1.IDeleteArtifactRequest + | null + | undefined, + {} | null | undefined + > + ): void; + deleteArtifact( + request: protos.google.cloud.apigeeregistry.v1.IDeleteArtifactRequest, + callback: Callback< + protos.google.protobuf.IEmpty, + | protos.google.cloud.apigeeregistry.v1.IDeleteArtifactRequest + | null + | undefined, + {} | null | undefined + > + ): void; + deleteArtifact( + request?: protos.google.cloud.apigeeregistry.v1.IDeleteArtifactRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.protobuf.IEmpty, + | protos.google.cloud.apigeeregistry.v1.IDeleteArtifactRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.protobuf.IEmpty, + | protos.google.cloud.apigeeregistry.v1.IDeleteArtifactRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.protobuf.IEmpty, + protos.google.cloud.apigeeregistry.v1.IDeleteArtifactRequest | 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(); + return this.innerApiCalls.deleteArtifact(request, options, callback); + } + + /** + * Returns matching APIs. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The parent, which owns this collection of APIs. + * Format: `projects/* /locations/*` + * @param {number} request.pageSize + * The maximum number of APIs to return. + * The service may return fewer than this value. + * If unspecified, at most 50 values will be returned. + * The maximum is 1000; values above 1000 will be coerced to 1000. + * @param {string} request.pageToken + * A page token, received from a previous `ListApis` call. + * Provide this to retrieve the subsequent page. + * + * When paginating, all other parameters provided to `ListApis` must match + * the call that provided the page token. + * @param {string} request.filter + * An expression that can be used to filter the list. Filters use the Common + * Expression Language and can refer to all message fields. + * @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.apigeeregistry.v1.Api|Api}. + * 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 `listApisAsync()` + * 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. + */ + listApis( + request?: protos.google.cloud.apigeeregistry.v1.IListApisRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.apigeeregistry.v1.IApi[], + protos.google.cloud.apigeeregistry.v1.IListApisRequest | null, + protos.google.cloud.apigeeregistry.v1.IListApisResponse, + ] + >; + listApis( + request: protos.google.cloud.apigeeregistry.v1.IListApisRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.cloud.apigeeregistry.v1.IListApisRequest, + | protos.google.cloud.apigeeregistry.v1.IListApisResponse + | null + | undefined, + protos.google.cloud.apigeeregistry.v1.IApi + > + ): void; + listApis( + request: protos.google.cloud.apigeeregistry.v1.IListApisRequest, + callback: PaginationCallback< + protos.google.cloud.apigeeregistry.v1.IListApisRequest, + | protos.google.cloud.apigeeregistry.v1.IListApisResponse + | null + | undefined, + protos.google.cloud.apigeeregistry.v1.IApi + > + ): void; + listApis( + request?: protos.google.cloud.apigeeregistry.v1.IListApisRequest, + optionsOrCallback?: + | CallOptions + | PaginationCallback< + protos.google.cloud.apigeeregistry.v1.IListApisRequest, + | protos.google.cloud.apigeeregistry.v1.IListApisResponse + | null + | undefined, + protos.google.cloud.apigeeregistry.v1.IApi + >, + callback?: PaginationCallback< + protos.google.cloud.apigeeregistry.v1.IListApisRequest, + | protos.google.cloud.apigeeregistry.v1.IListApisResponse + | null + | undefined, + protos.google.cloud.apigeeregistry.v1.IApi + > + ): Promise< + [ + protos.google.cloud.apigeeregistry.v1.IApi[], + protos.google.cloud.apigeeregistry.v1.IListApisRequest | null, + protos.google.cloud.apigeeregistry.v1.IListApisResponse, + ] + > | 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(); + return this.innerApiCalls.listApis(request, options, callback); + } + + /** + * Equivalent to `method.name.toCamelCase()`, 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 APIs. + * Format: `projects/* /locations/*` + * @param {number} request.pageSize + * The maximum number of APIs to return. + * The service may return fewer than this value. + * If unspecified, at most 50 values will be returned. + * The maximum is 1000; values above 1000 will be coerced to 1000. + * @param {string} request.pageToken + * A page token, received from a previous `ListApis` call. + * Provide this to retrieve the subsequent page. + * + * When paginating, all other parameters provided to `ListApis` must match + * the call that provided the page token. + * @param {string} request.filter + * An expression that can be used to filter the list. Filters use the Common + * Expression Language and can refer to all message fields. + * @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.apigeeregistry.v1.Api|Api} 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 `listApisAsync()` + * 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. + */ + listApisStream( + request?: protos.google.cloud.apigeeregistry.v1.IListApisRequest, + 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['listApis']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.listApis.createStream( + this.innerApiCalls.listApis as GaxCall, + request, + callSettings + ); + } + + /** + * Equivalent to `listApis`, 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 APIs. + * Format: `projects/* /locations/*` + * @param {number} request.pageSize + * The maximum number of APIs to return. + * The service may return fewer than this value. + * If unspecified, at most 50 values will be returned. + * The maximum is 1000; values above 1000 will be coerced to 1000. + * @param {string} request.pageToken + * A page token, received from a previous `ListApis` call. + * Provide this to retrieve the subsequent page. + * + * When paginating, all other parameters provided to `ListApis` must match + * the call that provided the page token. + * @param {string} request.filter + * An expression that can be used to filter the list. Filters use the Common + * Expression Language and can refer to all message fields. + * @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.apigeeregistry.v1.Api|Api}. 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/registry.list_apis.js + * region_tag:apigeeregistry_v1_generated_Registry_ListApis_async + */ + listApisAsync( + request?: protos.google.cloud.apigeeregistry.v1.IListApisRequest, + 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['listApis']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.listApis.asyncIterate( + this.innerApiCalls['listApis'] as GaxCall, + request as {}, + callSettings + ) as AsyncIterable; + } + /** + * Returns matching versions. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The parent, which owns this collection of versions. + * Format: `projects/* /locations/* /apis/*` + * @param {number} request.pageSize + * The maximum number of versions to return. + * The service may return fewer than this value. + * If unspecified, at most 50 values will be returned. + * The maximum is 1000; values above 1000 will be coerced to 1000. + * @param {string} request.pageToken + * A page token, received from a previous `ListApiVersions` call. + * Provide this to retrieve the subsequent page. + * + * When paginating, all other parameters provided to `ListApiVersions` must + * match the call that provided the page token. + * @param {string} request.filter + * An expression that can be used to filter the list. Filters use the Common + * Expression Language and can refer to all message fields. + * @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.apigeeregistry.v1.ApiVersion|ApiVersion}. + * 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 `listApiVersionsAsync()` + * 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. + */ + listApiVersions( + request?: protos.google.cloud.apigeeregistry.v1.IListApiVersionsRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.apigeeregistry.v1.IApiVersion[], + protos.google.cloud.apigeeregistry.v1.IListApiVersionsRequest | null, + protos.google.cloud.apigeeregistry.v1.IListApiVersionsResponse, + ] + >; + listApiVersions( + request: protos.google.cloud.apigeeregistry.v1.IListApiVersionsRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.cloud.apigeeregistry.v1.IListApiVersionsRequest, + | protos.google.cloud.apigeeregistry.v1.IListApiVersionsResponse + | null + | undefined, + protos.google.cloud.apigeeregistry.v1.IApiVersion + > + ): void; + listApiVersions( + request: protos.google.cloud.apigeeregistry.v1.IListApiVersionsRequest, + callback: PaginationCallback< + protos.google.cloud.apigeeregistry.v1.IListApiVersionsRequest, + | protos.google.cloud.apigeeregistry.v1.IListApiVersionsResponse + | null + | undefined, + protos.google.cloud.apigeeregistry.v1.IApiVersion + > + ): void; + listApiVersions( + request?: protos.google.cloud.apigeeregistry.v1.IListApiVersionsRequest, + optionsOrCallback?: + | CallOptions + | PaginationCallback< + protos.google.cloud.apigeeregistry.v1.IListApiVersionsRequest, + | protos.google.cloud.apigeeregistry.v1.IListApiVersionsResponse + | null + | undefined, + protos.google.cloud.apigeeregistry.v1.IApiVersion + >, + callback?: PaginationCallback< + protos.google.cloud.apigeeregistry.v1.IListApiVersionsRequest, + | protos.google.cloud.apigeeregistry.v1.IListApiVersionsResponse + | null + | undefined, + protos.google.cloud.apigeeregistry.v1.IApiVersion + > + ): Promise< + [ + protos.google.cloud.apigeeregistry.v1.IApiVersion[], + protos.google.cloud.apigeeregistry.v1.IListApiVersionsRequest | null, + protos.google.cloud.apigeeregistry.v1.IListApiVersionsResponse, + ] + > | 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(); + return this.innerApiCalls.listApiVersions(request, options, callback); + } + + /** + * Equivalent to `method.name.toCamelCase()`, 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 versions. + * Format: `projects/* /locations/* /apis/*` + * @param {number} request.pageSize + * The maximum number of versions to return. + * The service may return fewer than this value. + * If unspecified, at most 50 values will be returned. + * The maximum is 1000; values above 1000 will be coerced to 1000. + * @param {string} request.pageToken + * A page token, received from a previous `ListApiVersions` call. + * Provide this to retrieve the subsequent page. + * + * When paginating, all other parameters provided to `ListApiVersions` must + * match the call that provided the page token. + * @param {string} request.filter + * An expression that can be used to filter the list. Filters use the Common + * Expression Language and can refer to all message fields. + * @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.apigeeregistry.v1.ApiVersion|ApiVersion} 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 `listApiVersionsAsync()` + * 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. + */ + listApiVersionsStream( + request?: protos.google.cloud.apigeeregistry.v1.IListApiVersionsRequest, + 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['listApiVersions']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.listApiVersions.createStream( + this.innerApiCalls.listApiVersions as GaxCall, + request, + callSettings + ); + } + + /** + * Equivalent to `listApiVersions`, 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 versions. + * Format: `projects/* /locations/* /apis/*` + * @param {number} request.pageSize + * The maximum number of versions to return. + * The service may return fewer than this value. + * If unspecified, at most 50 values will be returned. + * The maximum is 1000; values above 1000 will be coerced to 1000. + * @param {string} request.pageToken + * A page token, received from a previous `ListApiVersions` call. + * Provide this to retrieve the subsequent page. + * + * When paginating, all other parameters provided to `ListApiVersions` must + * match the call that provided the page token. + * @param {string} request.filter + * An expression that can be used to filter the list. Filters use the Common + * Expression Language and can refer to all message fields. + * @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.apigeeregistry.v1.ApiVersion|ApiVersion}. 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/registry.list_api_versions.js + * region_tag:apigeeregistry_v1_generated_Registry_ListApiVersions_async + */ + listApiVersionsAsync( + request?: protos.google.cloud.apigeeregistry.v1.IListApiVersionsRequest, + 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['listApiVersions']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.listApiVersions.asyncIterate( + this.innerApiCalls['listApiVersions'] as GaxCall, + request as {}, + callSettings + ) as AsyncIterable; + } + /** + * Returns matching specs. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The parent, which owns this collection of specs. + * Format: `projects/* /locations/* /apis/* /versions/*` + * @param {number} request.pageSize + * The maximum number of specs to return. + * The service may return fewer than this value. + * If unspecified, at most 50 values will be returned. + * The maximum is 1000; values above 1000 will be coerced to 1000. + * @param {string} request.pageToken + * A page token, received from a previous `ListApiSpecs` call. + * Provide this to retrieve the subsequent page. + * + * When paginating, all other parameters provided to `ListApiSpecs` must match + * the call that provided the page token. + * @param {string} request.filter + * An expression that can be used to filter the list. Filters use the Common + * Expression Language and can refer to all message fields except contents. + * @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.apigeeregistry.v1.ApiSpec|ApiSpec}. + * 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 `listApiSpecsAsync()` + * 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. + */ + listApiSpecs( + request?: protos.google.cloud.apigeeregistry.v1.IListApiSpecsRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.apigeeregistry.v1.IApiSpec[], + protos.google.cloud.apigeeregistry.v1.IListApiSpecsRequest | null, + protos.google.cloud.apigeeregistry.v1.IListApiSpecsResponse, + ] + >; + listApiSpecs( + request: protos.google.cloud.apigeeregistry.v1.IListApiSpecsRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.cloud.apigeeregistry.v1.IListApiSpecsRequest, + | protos.google.cloud.apigeeregistry.v1.IListApiSpecsResponse + | null + | undefined, + protos.google.cloud.apigeeregistry.v1.IApiSpec + > + ): void; + listApiSpecs( + request: protos.google.cloud.apigeeregistry.v1.IListApiSpecsRequest, + callback: PaginationCallback< + protos.google.cloud.apigeeregistry.v1.IListApiSpecsRequest, + | protos.google.cloud.apigeeregistry.v1.IListApiSpecsResponse + | null + | undefined, + protos.google.cloud.apigeeregistry.v1.IApiSpec + > + ): void; + listApiSpecs( + request?: protos.google.cloud.apigeeregistry.v1.IListApiSpecsRequest, + optionsOrCallback?: + | CallOptions + | PaginationCallback< + protos.google.cloud.apigeeregistry.v1.IListApiSpecsRequest, + | protos.google.cloud.apigeeregistry.v1.IListApiSpecsResponse + | null + | undefined, + protos.google.cloud.apigeeregistry.v1.IApiSpec + >, + callback?: PaginationCallback< + protos.google.cloud.apigeeregistry.v1.IListApiSpecsRequest, + | protos.google.cloud.apigeeregistry.v1.IListApiSpecsResponse + | null + | undefined, + protos.google.cloud.apigeeregistry.v1.IApiSpec + > + ): Promise< + [ + protos.google.cloud.apigeeregistry.v1.IApiSpec[], + protos.google.cloud.apigeeregistry.v1.IListApiSpecsRequest | null, + protos.google.cloud.apigeeregistry.v1.IListApiSpecsResponse, + ] + > | 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(); + return this.innerApiCalls.listApiSpecs(request, options, callback); + } + + /** + * Equivalent to `method.name.toCamelCase()`, 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 specs. + * Format: `projects/* /locations/* /apis/* /versions/*` + * @param {number} request.pageSize + * The maximum number of specs to return. + * The service may return fewer than this value. + * If unspecified, at most 50 values will be returned. + * The maximum is 1000; values above 1000 will be coerced to 1000. + * @param {string} request.pageToken + * A page token, received from a previous `ListApiSpecs` call. + * Provide this to retrieve the subsequent page. + * + * When paginating, all other parameters provided to `ListApiSpecs` must match + * the call that provided the page token. + * @param {string} request.filter + * An expression that can be used to filter the list. Filters use the Common + * Expression Language and can refer to all message fields except contents. + * @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.apigeeregistry.v1.ApiSpec|ApiSpec} 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 `listApiSpecsAsync()` + * 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. + */ + listApiSpecsStream( + request?: protos.google.cloud.apigeeregistry.v1.IListApiSpecsRequest, + 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['listApiSpecs']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.listApiSpecs.createStream( + this.innerApiCalls.listApiSpecs as GaxCall, + request, + callSettings + ); + } + + /** + * Equivalent to `listApiSpecs`, 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 specs. + * Format: `projects/* /locations/* /apis/* /versions/*` + * @param {number} request.pageSize + * The maximum number of specs to return. + * The service may return fewer than this value. + * If unspecified, at most 50 values will be returned. + * The maximum is 1000; values above 1000 will be coerced to 1000. + * @param {string} request.pageToken + * A page token, received from a previous `ListApiSpecs` call. + * Provide this to retrieve the subsequent page. + * + * When paginating, all other parameters provided to `ListApiSpecs` must match + * the call that provided the page token. + * @param {string} request.filter + * An expression that can be used to filter the list. Filters use the Common + * Expression Language and can refer to all message fields except contents. + * @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.apigeeregistry.v1.ApiSpec|ApiSpec}. 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/registry.list_api_specs.js + * region_tag:apigeeregistry_v1_generated_Registry_ListApiSpecs_async + */ + listApiSpecsAsync( + request?: protos.google.cloud.apigeeregistry.v1.IListApiSpecsRequest, + 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['listApiSpecs']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.listApiSpecs.asyncIterate( + this.innerApiCalls['listApiSpecs'] as GaxCall, + request as {}, + callSettings + ) as AsyncIterable; + } + /** + * Lists all revisions of a spec. + * Revisions are returned in descending order of revision creation time. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The name of the spec to list revisions for. + * @param {number} request.pageSize + * The maximum number of revisions to return per page. + * @param {string} request.pageToken + * The page token, received from a previous ListApiSpecRevisions call. + * Provide this to retrieve the subsequent page. + * @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.apigeeregistry.v1.ApiSpec|ApiSpec}. + * 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 `listApiSpecRevisionsAsync()` + * 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. + */ + listApiSpecRevisions( + request?: protos.google.cloud.apigeeregistry.v1.IListApiSpecRevisionsRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.apigeeregistry.v1.IApiSpec[], + protos.google.cloud.apigeeregistry.v1.IListApiSpecRevisionsRequest | null, + protos.google.cloud.apigeeregistry.v1.IListApiSpecRevisionsResponse, + ] + >; + listApiSpecRevisions( + request: protos.google.cloud.apigeeregistry.v1.IListApiSpecRevisionsRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.cloud.apigeeregistry.v1.IListApiSpecRevisionsRequest, + | protos.google.cloud.apigeeregistry.v1.IListApiSpecRevisionsResponse + | null + | undefined, + protos.google.cloud.apigeeregistry.v1.IApiSpec + > + ): void; + listApiSpecRevisions( + request: protos.google.cloud.apigeeregistry.v1.IListApiSpecRevisionsRequest, + callback: PaginationCallback< + protos.google.cloud.apigeeregistry.v1.IListApiSpecRevisionsRequest, + | protos.google.cloud.apigeeregistry.v1.IListApiSpecRevisionsResponse + | null + | undefined, + protos.google.cloud.apigeeregistry.v1.IApiSpec + > + ): void; + listApiSpecRevisions( + request?: protos.google.cloud.apigeeregistry.v1.IListApiSpecRevisionsRequest, + optionsOrCallback?: + | CallOptions + | PaginationCallback< + protos.google.cloud.apigeeregistry.v1.IListApiSpecRevisionsRequest, + | protos.google.cloud.apigeeregistry.v1.IListApiSpecRevisionsResponse + | null + | undefined, + protos.google.cloud.apigeeregistry.v1.IApiSpec + >, + callback?: PaginationCallback< + protos.google.cloud.apigeeregistry.v1.IListApiSpecRevisionsRequest, + | protos.google.cloud.apigeeregistry.v1.IListApiSpecRevisionsResponse + | null + | undefined, + protos.google.cloud.apigeeregistry.v1.IApiSpec + > + ): Promise< + [ + protos.google.cloud.apigeeregistry.v1.IApiSpec[], + protos.google.cloud.apigeeregistry.v1.IListApiSpecRevisionsRequest | null, + protos.google.cloud.apigeeregistry.v1.IListApiSpecRevisionsResponse, + ] + > | 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(); + return this.innerApiCalls.listApiSpecRevisions(request, options, callback); + } + + /** + * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The name of the spec to list revisions for. + * @param {number} request.pageSize + * The maximum number of revisions to return per page. + * @param {string} request.pageToken + * The page token, received from a previous ListApiSpecRevisions call. + * Provide this to retrieve the subsequent page. + * @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.apigeeregistry.v1.ApiSpec|ApiSpec} 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 `listApiSpecRevisionsAsync()` + * 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. + */ + listApiSpecRevisionsStream( + request?: protos.google.cloud.apigeeregistry.v1.IListApiSpecRevisionsRequest, + 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({ + name: request.name ?? '', + }); + const defaultCallSettings = this._defaults['listApiSpecRevisions']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.listApiSpecRevisions.createStream( + this.innerApiCalls.listApiSpecRevisions as GaxCall, + request, + callSettings + ); + } + + /** + * Equivalent to `listApiSpecRevisions`, 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.name + * Required. The name of the spec to list revisions for. + * @param {number} request.pageSize + * The maximum number of revisions to return per page. + * @param {string} request.pageToken + * The page token, received from a previous ListApiSpecRevisions call. + * Provide this to retrieve the subsequent page. + * @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.apigeeregistry.v1.ApiSpec|ApiSpec}. 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/registry.list_api_spec_revisions.js + * region_tag:apigeeregistry_v1_generated_Registry_ListApiSpecRevisions_async + */ + listApiSpecRevisionsAsync( + request?: protos.google.cloud.apigeeregistry.v1.IListApiSpecRevisionsRequest, + 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({ + name: request.name ?? '', + }); + const defaultCallSettings = this._defaults['listApiSpecRevisions']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.listApiSpecRevisions.asyncIterate( + this.innerApiCalls['listApiSpecRevisions'] as GaxCall, + request as {}, + callSettings + ) as AsyncIterable; + } + /** + * Returns matching deployments. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The parent, which owns this collection of deployments. + * Format: `projects/* /locations/* /apis/*` + * @param {number} request.pageSize + * The maximum number of deployments to return. + * The service may return fewer than this value. + * If unspecified, at most 50 values will be returned. + * The maximum is 1000; values above 1000 will be coerced to 1000. + * @param {string} request.pageToken + * A page token, received from a previous `ListApiDeployments` call. + * Provide this to retrieve the subsequent page. + * + * When paginating, all other parameters provided to `ListApiDeployments` must + * match the call that provided the page token. + * @param {string} request.filter + * An expression that can be used to filter the list. Filters use the Common + * Expression Language and can refer to all message fields. + * @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.apigeeregistry.v1.ApiDeployment|ApiDeployment}. + * 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 `listApiDeploymentsAsync()` + * 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. + */ + listApiDeployments( + request?: protos.google.cloud.apigeeregistry.v1.IListApiDeploymentsRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.apigeeregistry.v1.IApiDeployment[], + protos.google.cloud.apigeeregistry.v1.IListApiDeploymentsRequest | null, + protos.google.cloud.apigeeregistry.v1.IListApiDeploymentsResponse, + ] + >; + listApiDeployments( + request: protos.google.cloud.apigeeregistry.v1.IListApiDeploymentsRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.cloud.apigeeregistry.v1.IListApiDeploymentsRequest, + | protos.google.cloud.apigeeregistry.v1.IListApiDeploymentsResponse + | null + | undefined, + protos.google.cloud.apigeeregistry.v1.IApiDeployment + > + ): void; + listApiDeployments( + request: protos.google.cloud.apigeeregistry.v1.IListApiDeploymentsRequest, + callback: PaginationCallback< + protos.google.cloud.apigeeregistry.v1.IListApiDeploymentsRequest, + | protos.google.cloud.apigeeregistry.v1.IListApiDeploymentsResponse + | null + | undefined, + protos.google.cloud.apigeeregistry.v1.IApiDeployment + > + ): void; + listApiDeployments( + request?: protos.google.cloud.apigeeregistry.v1.IListApiDeploymentsRequest, + optionsOrCallback?: + | CallOptions + | PaginationCallback< + protos.google.cloud.apigeeregistry.v1.IListApiDeploymentsRequest, + | protos.google.cloud.apigeeregistry.v1.IListApiDeploymentsResponse + | null + | undefined, + protos.google.cloud.apigeeregistry.v1.IApiDeployment + >, + callback?: PaginationCallback< + protos.google.cloud.apigeeregistry.v1.IListApiDeploymentsRequest, + | protos.google.cloud.apigeeregistry.v1.IListApiDeploymentsResponse + | null + | undefined, + protos.google.cloud.apigeeregistry.v1.IApiDeployment + > + ): Promise< + [ + protos.google.cloud.apigeeregistry.v1.IApiDeployment[], + protos.google.cloud.apigeeregistry.v1.IListApiDeploymentsRequest | null, + protos.google.cloud.apigeeregistry.v1.IListApiDeploymentsResponse, + ] + > | 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(); + return this.innerApiCalls.listApiDeployments(request, options, callback); + } + + /** + * Equivalent to `method.name.toCamelCase()`, 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 deployments. + * Format: `projects/* /locations/* /apis/*` + * @param {number} request.pageSize + * The maximum number of deployments to return. + * The service may return fewer than this value. + * If unspecified, at most 50 values will be returned. + * The maximum is 1000; values above 1000 will be coerced to 1000. + * @param {string} request.pageToken + * A page token, received from a previous `ListApiDeployments` call. + * Provide this to retrieve the subsequent page. + * + * When paginating, all other parameters provided to `ListApiDeployments` must + * match the call that provided the page token. + * @param {string} request.filter + * An expression that can be used to filter the list. Filters use the Common + * Expression Language and can refer to all message fields. + * @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.apigeeregistry.v1.ApiDeployment|ApiDeployment} 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 `listApiDeploymentsAsync()` + * 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. + */ + listApiDeploymentsStream( + request?: protos.google.cloud.apigeeregistry.v1.IListApiDeploymentsRequest, + 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['listApiDeployments']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.listApiDeployments.createStream( + this.innerApiCalls.listApiDeployments as GaxCall, + request, + callSettings + ); + } + + /** + * Equivalent to `listApiDeployments`, 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 deployments. + * Format: `projects/* /locations/* /apis/*` + * @param {number} request.pageSize + * The maximum number of deployments to return. + * The service may return fewer than this value. + * If unspecified, at most 50 values will be returned. + * The maximum is 1000; values above 1000 will be coerced to 1000. + * @param {string} request.pageToken + * A page token, received from a previous `ListApiDeployments` call. + * Provide this to retrieve the subsequent page. + * + * When paginating, all other parameters provided to `ListApiDeployments` must + * match the call that provided the page token. + * @param {string} request.filter + * An expression that can be used to filter the list. Filters use the Common + * Expression Language and can refer to all message fields. + * @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.apigeeregistry.v1.ApiDeployment|ApiDeployment}. 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/registry.list_api_deployments.js + * region_tag:apigeeregistry_v1_generated_Registry_ListApiDeployments_async + */ + listApiDeploymentsAsync( + request?: protos.google.cloud.apigeeregistry.v1.IListApiDeploymentsRequest, + 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['listApiDeployments']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.listApiDeployments.asyncIterate( + this.innerApiCalls['listApiDeployments'] as GaxCall, + request as {}, + callSettings + ) as AsyncIterable; + } + /** + * Lists all revisions of a deployment. + * Revisions are returned in descending order of revision creation time. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The name of the deployment to list revisions for. + * @param {number} request.pageSize + * The maximum number of revisions to return per page. + * @param {string} request.pageToken + * The page token, received from a previous ListApiDeploymentRevisions call. + * Provide this to retrieve the subsequent page. + * @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.apigeeregistry.v1.ApiDeployment|ApiDeployment}. + * 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 `listApiDeploymentRevisionsAsync()` + * 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. + */ + listApiDeploymentRevisions( + request?: protos.google.cloud.apigeeregistry.v1.IListApiDeploymentRevisionsRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.apigeeregistry.v1.IApiDeployment[], + protos.google.cloud.apigeeregistry.v1.IListApiDeploymentRevisionsRequest | null, + protos.google.cloud.apigeeregistry.v1.IListApiDeploymentRevisionsResponse, + ] + >; + listApiDeploymentRevisions( + request: protos.google.cloud.apigeeregistry.v1.IListApiDeploymentRevisionsRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.cloud.apigeeregistry.v1.IListApiDeploymentRevisionsRequest, + | protos.google.cloud.apigeeregistry.v1.IListApiDeploymentRevisionsResponse + | null + | undefined, + protos.google.cloud.apigeeregistry.v1.IApiDeployment + > + ): void; + listApiDeploymentRevisions( + request: protos.google.cloud.apigeeregistry.v1.IListApiDeploymentRevisionsRequest, + callback: PaginationCallback< + protos.google.cloud.apigeeregistry.v1.IListApiDeploymentRevisionsRequest, + | protos.google.cloud.apigeeregistry.v1.IListApiDeploymentRevisionsResponse + | null + | undefined, + protos.google.cloud.apigeeregistry.v1.IApiDeployment + > + ): void; + listApiDeploymentRevisions( + request?: protos.google.cloud.apigeeregistry.v1.IListApiDeploymentRevisionsRequest, + optionsOrCallback?: + | CallOptions + | PaginationCallback< + protos.google.cloud.apigeeregistry.v1.IListApiDeploymentRevisionsRequest, + | protos.google.cloud.apigeeregistry.v1.IListApiDeploymentRevisionsResponse + | null + | undefined, + protos.google.cloud.apigeeregistry.v1.IApiDeployment + >, + callback?: PaginationCallback< + protos.google.cloud.apigeeregistry.v1.IListApiDeploymentRevisionsRequest, + | protos.google.cloud.apigeeregistry.v1.IListApiDeploymentRevisionsResponse + | null + | undefined, + protos.google.cloud.apigeeregistry.v1.IApiDeployment + > + ): Promise< + [ + protos.google.cloud.apigeeregistry.v1.IApiDeployment[], + protos.google.cloud.apigeeregistry.v1.IListApiDeploymentRevisionsRequest | null, + protos.google.cloud.apigeeregistry.v1.IListApiDeploymentRevisionsResponse, + ] + > | 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(); + return this.innerApiCalls.listApiDeploymentRevisions( + request, + options, + callback + ); + } + + /** + * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The name of the deployment to list revisions for. + * @param {number} request.pageSize + * The maximum number of revisions to return per page. + * @param {string} request.pageToken + * The page token, received from a previous ListApiDeploymentRevisions call. + * Provide this to retrieve the subsequent page. + * @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.apigeeregistry.v1.ApiDeployment|ApiDeployment} 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 `listApiDeploymentRevisionsAsync()` + * 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. + */ + listApiDeploymentRevisionsStream( + request?: protos.google.cloud.apigeeregistry.v1.IListApiDeploymentRevisionsRequest, + 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({ + name: request.name ?? '', + }); + const defaultCallSettings = this._defaults['listApiDeploymentRevisions']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.listApiDeploymentRevisions.createStream( + this.innerApiCalls.listApiDeploymentRevisions as GaxCall, + request, + callSettings + ); + } + + /** + * Equivalent to `listApiDeploymentRevisions`, 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.name + * Required. The name of the deployment to list revisions for. + * @param {number} request.pageSize + * The maximum number of revisions to return per page. + * @param {string} request.pageToken + * The page token, received from a previous ListApiDeploymentRevisions call. + * Provide this to retrieve the subsequent page. + * @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.apigeeregistry.v1.ApiDeployment|ApiDeployment}. 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/registry.list_api_deployment_revisions.js + * region_tag:apigeeregistry_v1_generated_Registry_ListApiDeploymentRevisions_async + */ + listApiDeploymentRevisionsAsync( + request?: protos.google.cloud.apigeeregistry.v1.IListApiDeploymentRevisionsRequest, + 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({ + name: request.name ?? '', + }); + const defaultCallSettings = this._defaults['listApiDeploymentRevisions']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.listApiDeploymentRevisions.asyncIterate( + this.innerApiCalls['listApiDeploymentRevisions'] as GaxCall, + request as {}, + callSettings + ) as AsyncIterable; + } + /** + * Returns matching artifacts. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The parent, which owns this collection of artifacts. + * Format: `{parent}` + * @param {number} request.pageSize + * The maximum number of artifacts to return. + * The service may return fewer than this value. + * If unspecified, at most 50 values will be returned. + * The maximum is 1000; values above 1000 will be coerced to 1000. + * @param {string} request.pageToken + * A page token, received from a previous `ListArtifacts` call. + * Provide this to retrieve the subsequent page. + * + * When paginating, all other parameters provided to `ListArtifacts` must + * match the call that provided the page token. + * @param {string} request.filter + * An expression that can be used to filter the list. Filters use the Common + * Expression Language and can refer to all message fields except contents. + * @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.apigeeregistry.v1.Artifact|Artifact}. + * 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 `listArtifactsAsync()` + * 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. + */ + listArtifacts( + request?: protos.google.cloud.apigeeregistry.v1.IListArtifactsRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.apigeeregistry.v1.IArtifact[], + protos.google.cloud.apigeeregistry.v1.IListArtifactsRequest | null, + protos.google.cloud.apigeeregistry.v1.IListArtifactsResponse, + ] + >; + listArtifacts( + request: protos.google.cloud.apigeeregistry.v1.IListArtifactsRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.cloud.apigeeregistry.v1.IListArtifactsRequest, + | protos.google.cloud.apigeeregistry.v1.IListArtifactsResponse + | null + | undefined, + protos.google.cloud.apigeeregistry.v1.IArtifact + > + ): void; + listArtifacts( + request: protos.google.cloud.apigeeregistry.v1.IListArtifactsRequest, + callback: PaginationCallback< + protos.google.cloud.apigeeregistry.v1.IListArtifactsRequest, + | protos.google.cloud.apigeeregistry.v1.IListArtifactsResponse + | null + | undefined, + protos.google.cloud.apigeeregistry.v1.IArtifact + > + ): void; + listArtifacts( + request?: protos.google.cloud.apigeeregistry.v1.IListArtifactsRequest, + optionsOrCallback?: + | CallOptions + | PaginationCallback< + protos.google.cloud.apigeeregistry.v1.IListArtifactsRequest, + | protos.google.cloud.apigeeregistry.v1.IListArtifactsResponse + | null + | undefined, + protos.google.cloud.apigeeregistry.v1.IArtifact + >, + callback?: PaginationCallback< + protos.google.cloud.apigeeregistry.v1.IListArtifactsRequest, + | protos.google.cloud.apigeeregistry.v1.IListArtifactsResponse + | null + | undefined, + protos.google.cloud.apigeeregistry.v1.IArtifact + > + ): Promise< + [ + protos.google.cloud.apigeeregistry.v1.IArtifact[], + protos.google.cloud.apigeeregistry.v1.IListArtifactsRequest | null, + protos.google.cloud.apigeeregistry.v1.IListArtifactsResponse, + ] + > | 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(); + return this.innerApiCalls.listArtifacts(request, options, callback); + } + + /** + * Equivalent to `method.name.toCamelCase()`, 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 artifacts. + * Format: `{parent}` + * @param {number} request.pageSize + * The maximum number of artifacts to return. + * The service may return fewer than this value. + * If unspecified, at most 50 values will be returned. + * The maximum is 1000; values above 1000 will be coerced to 1000. + * @param {string} request.pageToken + * A page token, received from a previous `ListArtifacts` call. + * Provide this to retrieve the subsequent page. + * + * When paginating, all other parameters provided to `ListArtifacts` must + * match the call that provided the page token. + * @param {string} request.filter + * An expression that can be used to filter the list. Filters use the Common + * Expression Language and can refer to all message fields except contents. + * @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.apigeeregistry.v1.Artifact|Artifact} 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 `listArtifactsAsync()` + * 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. + */ + listArtifactsStream( + request?: protos.google.cloud.apigeeregistry.v1.IListArtifactsRequest, + 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['listArtifacts']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.listArtifacts.createStream( + this.innerApiCalls.listArtifacts as GaxCall, + request, + callSettings + ); + } + + /** + * Equivalent to `listArtifacts`, 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 artifacts. + * Format: `{parent}` + * @param {number} request.pageSize + * The maximum number of artifacts to return. + * The service may return fewer than this value. + * If unspecified, at most 50 values will be returned. + * The maximum is 1000; values above 1000 will be coerced to 1000. + * @param {string} request.pageToken + * A page token, received from a previous `ListArtifacts` call. + * Provide this to retrieve the subsequent page. + * + * When paginating, all other parameters provided to `ListArtifacts` must + * match the call that provided the page token. + * @param {string} request.filter + * An expression that can be used to filter the list. Filters use the Common + * Expression Language and can refer to all message fields except contents. + * @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.apigeeregistry.v1.Artifact|Artifact}. 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/registry.list_artifacts.js + * region_tag:apigeeregistry_v1_generated_Registry_ListArtifacts_async + */ + listArtifactsAsync( + request?: protos.google.cloud.apigeeregistry.v1.IListArtifactsRequest, + 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['listArtifacts']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.listArtifacts.asyncIterate( + this.innerApiCalls['listArtifacts'] as GaxCall, + request as {}, + callSettings + ) as AsyncIterable; + } + /** + * Gets the access control policy for a resource. Returns an empty policy + * if the resource exists and does not have a policy set. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.resource + * REQUIRED: The resource for which the policy is being requested. + * See the operation documentation for the appropriate value for this field. + * @param {Object} [request.options] + * OPTIONAL: A `GetPolicyOptions` object for specifying options to + * `GetIamPolicy`. This field is only used by Cloud IAM. + * + * This object should have the same structure as {@link google.iam.v1.GetPolicyOptions | GetPolicyOptions}. + * @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/interfaces/CallOptions.html | 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.iam.v1.Policy | Policy}. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link google.iam.v1.Policy | Policy}. + * The promise has a method named "cancel" which cancels the ongoing API call. + */ + getIamPolicy( + request: IamProtos.google.iam.v1.GetIamPolicyRequest, + options?: + | gax.CallOptions + | Callback< + IamProtos.google.iam.v1.Policy, + IamProtos.google.iam.v1.GetIamPolicyRequest | null | undefined, + {} | null | undefined + >, + callback?: Callback< + IamProtos.google.iam.v1.Policy, + IamProtos.google.iam.v1.GetIamPolicyRequest | null | undefined, + {} | null | undefined + > + ): Promise<[IamProtos.google.iam.v1.Policy]> { + return this.iamClient.getIamPolicy(request, options, callback); + } + + /** + * Returns permissions that a caller has on the specified resource. If the + * resource does not exist, this will return an empty set of + * permissions, not a NOT_FOUND error. + * + * Note: This operation is designed to be used for building + * permission-aware UIs and command-line tools, not for authorization + * checking. This operation may "fail open" without warning. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.resource + * REQUIRED: The resource for which the policy detail is being requested. + * See the operation documentation for the appropriate value for this field. + * @param {string[]} request.permissions + * The set of permissions to check for the `resource`. Permissions with + * wildcards (such as '*' or 'storage.*') are not allowed. For more + * information see {@link https://cloud.google.com/iam/docs/overview#permissions | IAM Overview }. + * @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/interfaces/CallOptions.html | 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.iam.v1.TestIamPermissionsResponse | TestIamPermissionsResponse}. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link google.iam.v1.TestIamPermissionsResponse | TestIamPermissionsResponse}. + * The promise has a method named "cancel" which cancels the ongoing API call. + */ + setIamPolicy( + request: IamProtos.google.iam.v1.SetIamPolicyRequest, + options?: + | gax.CallOptions + | Callback< + IamProtos.google.iam.v1.Policy, + IamProtos.google.iam.v1.SetIamPolicyRequest | null | undefined, + {} | null | undefined + >, + callback?: Callback< + IamProtos.google.iam.v1.Policy, + IamProtos.google.iam.v1.SetIamPolicyRequest | null | undefined, + {} | null | undefined + > + ): Promise<[IamProtos.google.iam.v1.Policy]> { + return this.iamClient.setIamPolicy(request, options, callback); + } + + /** + * Returns permissions that a caller has on the specified resource. If the + * resource does not exist, this will return an empty set of + * permissions, not a NOT_FOUND error. + * + * Note: This operation is designed to be used for building + * permission-aware UIs and command-line tools, not for authorization + * checking. This operation may "fail open" without warning. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.resource + * REQUIRED: The resource for which the policy detail is being requested. + * See the operation documentation for the appropriate value for this field. + * @param {string[]} request.permissions + * The set of permissions to check for the `resource`. Permissions with + * wildcards (such as '*' or 'storage.*') are not allowed. For more + * information see {@link https://cloud.google.com/iam/docs/overview#permissions | IAM Overview }. + * @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/interfaces/CallOptions.html | 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.iam.v1.TestIamPermissionsResponse | TestIamPermissionsResponse}. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link google.iam.v1.TestIamPermissionsResponse | TestIamPermissionsResponse}. + * The promise has a method named "cancel" which cancels the ongoing API call. + * + */ + testIamPermissions( + request: IamProtos.google.iam.v1.TestIamPermissionsRequest, + options?: + | gax.CallOptions + | Callback< + IamProtos.google.iam.v1.TestIamPermissionsResponse, + IamProtos.google.iam.v1.TestIamPermissionsRequest | null | undefined, + {} | null | undefined + >, + callback?: Callback< + IamProtos.google.iam.v1.TestIamPermissionsResponse, + IamProtos.google.iam.v1.TestIamPermissionsRequest | null | undefined, + {} | null | undefined + > + ): Promise<[IamProtos.google.iam.v1.TestIamPermissionsResponse]> { + return this.iamClient.testIamPermissions(request, options, callback); + } + + /** + * 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); + } + + // -------------------- + // -- Path templates -- + // -------------------- + + /** + * Return a fully-qualified api resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} api + * @returns {string} Resource name string. + */ + apiPath(project: string, location: string, api: string) { + return this.pathTemplates.apiPathTemplate.render({ + project: project, + location: location, + api: api, + }); + } + + /** + * Parse the project from Api resource. + * + * @param {string} apiName + * A fully-qualified path representing Api resource. + * @returns {string} A string representing the project. + */ + matchProjectFromApiName(apiName: string) { + return this.pathTemplates.apiPathTemplate.match(apiName).project; + } + + /** + * Parse the location from Api resource. + * + * @param {string} apiName + * A fully-qualified path representing Api resource. + * @returns {string} A string representing the location. + */ + matchLocationFromApiName(apiName: string) { + return this.pathTemplates.apiPathTemplate.match(apiName).location; + } + + /** + * Parse the api from Api resource. + * + * @param {string} apiName + * A fully-qualified path representing Api resource. + * @returns {string} A string representing the api. + */ + matchApiFromApiName(apiName: string) { + return this.pathTemplates.apiPathTemplate.match(apiName).api; + } + + /** + * Return a fully-qualified apiDeployment resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} api + * @param {string} deployment + * @returns {string} Resource name string. + */ + apiDeploymentPath( + project: string, + location: string, + api: string, + deployment: string + ) { + return this.pathTemplates.apiDeploymentPathTemplate.render({ + project: project, + location: location, + api: api, + deployment: deployment, + }); + } + + /** + * Parse the project from ApiDeployment resource. + * + * @param {string} apiDeploymentName + * A fully-qualified path representing ApiDeployment resource. + * @returns {string} A string representing the project. + */ + matchProjectFromApiDeploymentName(apiDeploymentName: string) { + return this.pathTemplates.apiDeploymentPathTemplate.match(apiDeploymentName) + .project; + } + + /** + * Parse the location from ApiDeployment resource. + * + * @param {string} apiDeploymentName + * A fully-qualified path representing ApiDeployment resource. + * @returns {string} A string representing the location. + */ + matchLocationFromApiDeploymentName(apiDeploymentName: string) { + return this.pathTemplates.apiDeploymentPathTemplate.match(apiDeploymentName) + .location; + } + + /** + * Parse the api from ApiDeployment resource. + * + * @param {string} apiDeploymentName + * A fully-qualified path representing ApiDeployment resource. + * @returns {string} A string representing the api. + */ + matchApiFromApiDeploymentName(apiDeploymentName: string) { + return this.pathTemplates.apiDeploymentPathTemplate.match(apiDeploymentName) + .api; + } + + /** + * Parse the deployment from ApiDeployment resource. + * + * @param {string} apiDeploymentName + * A fully-qualified path representing ApiDeployment resource. + * @returns {string} A string representing the deployment. + */ + matchDeploymentFromApiDeploymentName(apiDeploymentName: string) { + return this.pathTemplates.apiDeploymentPathTemplate.match(apiDeploymentName) + .deployment; + } + + /** + * Return a fully-qualified apiSpec resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} api + * @param {string} version + * @param {string} spec + * @returns {string} Resource name string. + */ + apiSpecPath( + project: string, + location: string, + api: string, + version: string, + spec: string + ) { + return this.pathTemplates.apiSpecPathTemplate.render({ + project: project, + location: location, + api: api, + version: version, + spec: spec, + }); + } + + /** + * Parse the project from ApiSpec resource. + * + * @param {string} apiSpecName + * A fully-qualified path representing ApiSpec resource. + * @returns {string} A string representing the project. + */ + matchProjectFromApiSpecName(apiSpecName: string) { + return this.pathTemplates.apiSpecPathTemplate.match(apiSpecName).project; + } + + /** + * Parse the location from ApiSpec resource. + * + * @param {string} apiSpecName + * A fully-qualified path representing ApiSpec resource. + * @returns {string} A string representing the location. + */ + matchLocationFromApiSpecName(apiSpecName: string) { + return this.pathTemplates.apiSpecPathTemplate.match(apiSpecName).location; + } + + /** + * Parse the api from ApiSpec resource. + * + * @param {string} apiSpecName + * A fully-qualified path representing ApiSpec resource. + * @returns {string} A string representing the api. + */ + matchApiFromApiSpecName(apiSpecName: string) { + return this.pathTemplates.apiSpecPathTemplate.match(apiSpecName).api; + } + + /** + * Parse the version from ApiSpec resource. + * + * @param {string} apiSpecName + * A fully-qualified path representing ApiSpec resource. + * @returns {string} A string representing the version. + */ + matchVersionFromApiSpecName(apiSpecName: string) { + return this.pathTemplates.apiSpecPathTemplate.match(apiSpecName).version; + } + + /** + * Parse the spec from ApiSpec resource. + * + * @param {string} apiSpecName + * A fully-qualified path representing ApiSpec resource. + * @returns {string} A string representing the spec. + */ + matchSpecFromApiSpecName(apiSpecName: string) { + return this.pathTemplates.apiSpecPathTemplate.match(apiSpecName).spec; + } + + /** + * Return a fully-qualified apiVersion resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} api + * @param {string} version + * @returns {string} Resource name string. + */ + apiVersionPath( + project: string, + location: string, + api: string, + version: string + ) { + return this.pathTemplates.apiVersionPathTemplate.render({ + project: project, + location: location, + api: api, + version: version, + }); + } + + /** + * Parse the project from ApiVersion resource. + * + * @param {string} apiVersionName + * A fully-qualified path representing ApiVersion resource. + * @returns {string} A string representing the project. + */ + matchProjectFromApiVersionName(apiVersionName: string) { + return this.pathTemplates.apiVersionPathTemplate.match(apiVersionName) + .project; + } + + /** + * Parse the location from ApiVersion resource. + * + * @param {string} apiVersionName + * A fully-qualified path representing ApiVersion resource. + * @returns {string} A string representing the location. + */ + matchLocationFromApiVersionName(apiVersionName: string) { + return this.pathTemplates.apiVersionPathTemplate.match(apiVersionName) + .location; + } + + /** + * Parse the api from ApiVersion resource. + * + * @param {string} apiVersionName + * A fully-qualified path representing ApiVersion resource. + * @returns {string} A string representing the api. + */ + matchApiFromApiVersionName(apiVersionName: string) { + return this.pathTemplates.apiVersionPathTemplate.match(apiVersionName).api; + } + + /** + * Parse the version from ApiVersion resource. + * + * @param {string} apiVersionName + * A fully-qualified path representing ApiVersion resource. + * @returns {string} A string representing the version. + */ + matchVersionFromApiVersionName(apiVersionName: string) { + return this.pathTemplates.apiVersionPathTemplate.match(apiVersionName) + .version; + } + + /** + * Return a fully-qualified instance resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} instance + * @returns {string} Resource name string. + */ + instancePath(project: string, location: string, instance: string) { + return this.pathTemplates.instancePathTemplate.render({ + project: project, + location: location, + instance: instance, + }); + } + + /** + * Parse the project from Instance resource. + * + * @param {string} instanceName + * A fully-qualified path representing Instance resource. + * @returns {string} A string representing the project. + */ + matchProjectFromInstanceName(instanceName: string) { + return this.pathTemplates.instancePathTemplate.match(instanceName).project; + } + + /** + * Parse the location from Instance resource. + * + * @param {string} instanceName + * A fully-qualified path representing Instance resource. + * @returns {string} A string representing the location. + */ + matchLocationFromInstanceName(instanceName: string) { + return this.pathTemplates.instancePathTemplate.match(instanceName).location; + } + + /** + * Parse the instance from Instance resource. + * + * @param {string} instanceName + * A fully-qualified path representing Instance resource. + * @returns {string} A string representing the instance. + */ + matchInstanceFromInstanceName(instanceName: string) { + return this.pathTemplates.instancePathTemplate.match(instanceName).instance; + } + + /** + * 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 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 projectLocationApiArtifact resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} api + * @param {string} artifact + * @returns {string} Resource name string. + */ + projectLocationApiArtifactPath( + project: string, + location: string, + api: string, + artifact: string + ) { + return this.pathTemplates.projectLocationApiArtifactPathTemplate.render({ + project: project, + location: location, + api: api, + artifact: artifact, + }); + } + + /** + * Parse the project from ProjectLocationApiArtifact resource. + * + * @param {string} projectLocationApiArtifactName + * A fully-qualified path representing project_location_api_artifact resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectLocationApiArtifactName( + projectLocationApiArtifactName: string + ) { + return this.pathTemplates.projectLocationApiArtifactPathTemplate.match( + projectLocationApiArtifactName + ).project; + } + + /** + * Parse the location from ProjectLocationApiArtifact resource. + * + * @param {string} projectLocationApiArtifactName + * A fully-qualified path representing project_location_api_artifact resource. + * @returns {string} A string representing the location. + */ + matchLocationFromProjectLocationApiArtifactName( + projectLocationApiArtifactName: string + ) { + return this.pathTemplates.projectLocationApiArtifactPathTemplate.match( + projectLocationApiArtifactName + ).location; + } + + /** + * Parse the api from ProjectLocationApiArtifact resource. + * + * @param {string} projectLocationApiArtifactName + * A fully-qualified path representing project_location_api_artifact resource. + * @returns {string} A string representing the api. + */ + matchApiFromProjectLocationApiArtifactName( + projectLocationApiArtifactName: string + ) { + return this.pathTemplates.projectLocationApiArtifactPathTemplate.match( + projectLocationApiArtifactName + ).api; + } + + /** + * Parse the artifact from ProjectLocationApiArtifact resource. + * + * @param {string} projectLocationApiArtifactName + * A fully-qualified path representing project_location_api_artifact resource. + * @returns {string} A string representing the artifact. + */ + matchArtifactFromProjectLocationApiArtifactName( + projectLocationApiArtifactName: string + ) { + return this.pathTemplates.projectLocationApiArtifactPathTemplate.match( + projectLocationApiArtifactName + ).artifact; + } + + /** + * Return a fully-qualified projectLocationApiDeploymentArtifact resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} api + * @param {string} deployment + * @param {string} artifact + * @returns {string} Resource name string. + */ + projectLocationApiDeploymentArtifactPath( + project: string, + location: string, + api: string, + deployment: string, + artifact: string + ) { + return this.pathTemplates.projectLocationApiDeploymentArtifactPathTemplate.render( + { + project: project, + location: location, + api: api, + deployment: deployment, + artifact: artifact, + } + ); + } + + /** + * Parse the project from ProjectLocationApiDeploymentArtifact resource. + * + * @param {string} projectLocationApiDeploymentArtifactName + * A fully-qualified path representing project_location_api_deployment_artifact resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectLocationApiDeploymentArtifactName( + projectLocationApiDeploymentArtifactName: string + ) { + return this.pathTemplates.projectLocationApiDeploymentArtifactPathTemplate.match( + projectLocationApiDeploymentArtifactName + ).project; + } + + /** + * Parse the location from ProjectLocationApiDeploymentArtifact resource. + * + * @param {string} projectLocationApiDeploymentArtifactName + * A fully-qualified path representing project_location_api_deployment_artifact resource. + * @returns {string} A string representing the location. + */ + matchLocationFromProjectLocationApiDeploymentArtifactName( + projectLocationApiDeploymentArtifactName: string + ) { + return this.pathTemplates.projectLocationApiDeploymentArtifactPathTemplate.match( + projectLocationApiDeploymentArtifactName + ).location; + } + + /** + * Parse the api from ProjectLocationApiDeploymentArtifact resource. + * + * @param {string} projectLocationApiDeploymentArtifactName + * A fully-qualified path representing project_location_api_deployment_artifact resource. + * @returns {string} A string representing the api. + */ + matchApiFromProjectLocationApiDeploymentArtifactName( + projectLocationApiDeploymentArtifactName: string + ) { + return this.pathTemplates.projectLocationApiDeploymentArtifactPathTemplate.match( + projectLocationApiDeploymentArtifactName + ).api; + } + + /** + * Parse the deployment from ProjectLocationApiDeploymentArtifact resource. + * + * @param {string} projectLocationApiDeploymentArtifactName + * A fully-qualified path representing project_location_api_deployment_artifact resource. + * @returns {string} A string representing the deployment. + */ + matchDeploymentFromProjectLocationApiDeploymentArtifactName( + projectLocationApiDeploymentArtifactName: string + ) { + return this.pathTemplates.projectLocationApiDeploymentArtifactPathTemplate.match( + projectLocationApiDeploymentArtifactName + ).deployment; + } + + /** + * Parse the artifact from ProjectLocationApiDeploymentArtifact resource. + * + * @param {string} projectLocationApiDeploymentArtifactName + * A fully-qualified path representing project_location_api_deployment_artifact resource. + * @returns {string} A string representing the artifact. + */ + matchArtifactFromProjectLocationApiDeploymentArtifactName( + projectLocationApiDeploymentArtifactName: string + ) { + return this.pathTemplates.projectLocationApiDeploymentArtifactPathTemplate.match( + projectLocationApiDeploymentArtifactName + ).artifact; + } + + /** + * Return a fully-qualified projectLocationApiVersionArtifact resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} api + * @param {string} version + * @param {string} artifact + * @returns {string} Resource name string. + */ + projectLocationApiVersionArtifactPath( + project: string, + location: string, + api: string, + version: string, + artifact: string + ) { + return this.pathTemplates.projectLocationApiVersionArtifactPathTemplate.render( + { + project: project, + location: location, + api: api, + version: version, + artifact: artifact, + } + ); + } + + /** + * Parse the project from ProjectLocationApiVersionArtifact resource. + * + * @param {string} projectLocationApiVersionArtifactName + * A fully-qualified path representing project_location_api_version_artifact resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectLocationApiVersionArtifactName( + projectLocationApiVersionArtifactName: string + ) { + return this.pathTemplates.projectLocationApiVersionArtifactPathTemplate.match( + projectLocationApiVersionArtifactName + ).project; + } + + /** + * Parse the location from ProjectLocationApiVersionArtifact resource. + * + * @param {string} projectLocationApiVersionArtifactName + * A fully-qualified path representing project_location_api_version_artifact resource. + * @returns {string} A string representing the location. + */ + matchLocationFromProjectLocationApiVersionArtifactName( + projectLocationApiVersionArtifactName: string + ) { + return this.pathTemplates.projectLocationApiVersionArtifactPathTemplate.match( + projectLocationApiVersionArtifactName + ).location; + } + + /** + * Parse the api from ProjectLocationApiVersionArtifact resource. + * + * @param {string} projectLocationApiVersionArtifactName + * A fully-qualified path representing project_location_api_version_artifact resource. + * @returns {string} A string representing the api. + */ + matchApiFromProjectLocationApiVersionArtifactName( + projectLocationApiVersionArtifactName: string + ) { + return this.pathTemplates.projectLocationApiVersionArtifactPathTemplate.match( + projectLocationApiVersionArtifactName + ).api; + } + + /** + * Parse the version from ProjectLocationApiVersionArtifact resource. + * + * @param {string} projectLocationApiVersionArtifactName + * A fully-qualified path representing project_location_api_version_artifact resource. + * @returns {string} A string representing the version. + */ + matchVersionFromProjectLocationApiVersionArtifactName( + projectLocationApiVersionArtifactName: string + ) { + return this.pathTemplates.projectLocationApiVersionArtifactPathTemplate.match( + projectLocationApiVersionArtifactName + ).version; + } + + /** + * Parse the artifact from ProjectLocationApiVersionArtifact resource. + * + * @param {string} projectLocationApiVersionArtifactName + * A fully-qualified path representing project_location_api_version_artifact resource. + * @returns {string} A string representing the artifact. + */ + matchArtifactFromProjectLocationApiVersionArtifactName( + projectLocationApiVersionArtifactName: string + ) { + return this.pathTemplates.projectLocationApiVersionArtifactPathTemplate.match( + projectLocationApiVersionArtifactName + ).artifact; + } + + /** + * Return a fully-qualified projectLocationApiVersionSpecArtifact resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} api + * @param {string} version + * @param {string} spec + * @param {string} artifact + * @returns {string} Resource name string. + */ + projectLocationApiVersionSpecArtifactPath( + project: string, + location: string, + api: string, + version: string, + spec: string, + artifact: string + ) { + return this.pathTemplates.projectLocationApiVersionSpecArtifactPathTemplate.render( + { + project: project, + location: location, + api: api, + version: version, + spec: spec, + artifact: artifact, + } + ); + } + + /** + * Parse the project from ProjectLocationApiVersionSpecArtifact resource. + * + * @param {string} projectLocationApiVersionSpecArtifactName + * A fully-qualified path representing project_location_api_version_spec_artifact resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectLocationApiVersionSpecArtifactName( + projectLocationApiVersionSpecArtifactName: string + ) { + return this.pathTemplates.projectLocationApiVersionSpecArtifactPathTemplate.match( + projectLocationApiVersionSpecArtifactName + ).project; + } + + /** + * Parse the location from ProjectLocationApiVersionSpecArtifact resource. + * + * @param {string} projectLocationApiVersionSpecArtifactName + * A fully-qualified path representing project_location_api_version_spec_artifact resource. + * @returns {string} A string representing the location. + */ + matchLocationFromProjectLocationApiVersionSpecArtifactName( + projectLocationApiVersionSpecArtifactName: string + ) { + return this.pathTemplates.projectLocationApiVersionSpecArtifactPathTemplate.match( + projectLocationApiVersionSpecArtifactName + ).location; + } + + /** + * Parse the api from ProjectLocationApiVersionSpecArtifact resource. + * + * @param {string} projectLocationApiVersionSpecArtifactName + * A fully-qualified path representing project_location_api_version_spec_artifact resource. + * @returns {string} A string representing the api. + */ + matchApiFromProjectLocationApiVersionSpecArtifactName( + projectLocationApiVersionSpecArtifactName: string + ) { + return this.pathTemplates.projectLocationApiVersionSpecArtifactPathTemplate.match( + projectLocationApiVersionSpecArtifactName + ).api; + } + + /** + * Parse the version from ProjectLocationApiVersionSpecArtifact resource. + * + * @param {string} projectLocationApiVersionSpecArtifactName + * A fully-qualified path representing project_location_api_version_spec_artifact resource. + * @returns {string} A string representing the version. + */ + matchVersionFromProjectLocationApiVersionSpecArtifactName( + projectLocationApiVersionSpecArtifactName: string + ) { + return this.pathTemplates.projectLocationApiVersionSpecArtifactPathTemplate.match( + projectLocationApiVersionSpecArtifactName + ).version; + } + + /** + * Parse the spec from ProjectLocationApiVersionSpecArtifact resource. + * + * @param {string} projectLocationApiVersionSpecArtifactName + * A fully-qualified path representing project_location_api_version_spec_artifact resource. + * @returns {string} A string representing the spec. + */ + matchSpecFromProjectLocationApiVersionSpecArtifactName( + projectLocationApiVersionSpecArtifactName: string + ) { + return this.pathTemplates.projectLocationApiVersionSpecArtifactPathTemplate.match( + projectLocationApiVersionSpecArtifactName + ).spec; + } + + /** + * Parse the artifact from ProjectLocationApiVersionSpecArtifact resource. + * + * @param {string} projectLocationApiVersionSpecArtifactName + * A fully-qualified path representing project_location_api_version_spec_artifact resource. + * @returns {string} A string representing the artifact. + */ + matchArtifactFromProjectLocationApiVersionSpecArtifactName( + projectLocationApiVersionSpecArtifactName: string + ) { + return this.pathTemplates.projectLocationApiVersionSpecArtifactPathTemplate.match( + projectLocationApiVersionSpecArtifactName + ).artifact; + } + + /** + * Return a fully-qualified projectLocationArtifact resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} artifact + * @returns {string} Resource name string. + */ + projectLocationArtifactPath( + project: string, + location: string, + artifact: string + ) { + return this.pathTemplates.projectLocationArtifactPathTemplate.render({ + project: project, + location: location, + artifact: artifact, + }); + } + + /** + * Parse the project from ProjectLocationArtifact resource. + * + * @param {string} projectLocationArtifactName + * A fully-qualified path representing project_location_artifact resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectLocationArtifactName( + projectLocationArtifactName: string + ) { + return this.pathTemplates.projectLocationArtifactPathTemplate.match( + projectLocationArtifactName + ).project; + } + + /** + * Parse the location from ProjectLocationArtifact resource. + * + * @param {string} projectLocationArtifactName + * A fully-qualified path representing project_location_artifact resource. + * @returns {string} A string representing the location. + */ + matchLocationFromProjectLocationArtifactName( + projectLocationArtifactName: string + ) { + return this.pathTemplates.projectLocationArtifactPathTemplate.match( + projectLocationArtifactName + ).location; + } + + /** + * Parse the artifact from ProjectLocationArtifact resource. + * + * @param {string} projectLocationArtifactName + * A fully-qualified path representing project_location_artifact resource. + * @returns {string} A string representing the artifact. + */ + matchArtifactFromProjectLocationArtifactName( + projectLocationArtifactName: string + ) { + return this.pathTemplates.projectLocationArtifactPathTemplate.match( + projectLocationArtifactName + ).artifact; + } + + /** + * 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.registryStub && !this._terminated) { + return this.registryStub.then(stub => { + this._terminated = true; + stub.close(); + this.iamClient.close(); + this.locationsClient.close(); + }); + } + return Promise.resolve(); + } +} diff --git a/packages/google-cloud-apigeeregistry/src/v1/registry_client_config.json b/packages/google-cloud-apigeeregistry/src/v1/registry_client_config.json new file mode 100644 index 00000000000..c26bf956bc9 --- /dev/null +++ b/packages/google-cloud-apigeeregistry/src/v1/registry_client_config.json @@ -0,0 +1,216 @@ +{ + "interfaces": { + "google.cloud.apigeeregistry.v1.Registry": { + "retry_codes": { + "non_idempotent": [], + "idempotent": [ + "DEADLINE_EXCEEDED", + "UNAVAILABLE" + ], + "cancelled_deadline_exceeded_aborted_unavailable": [ + "CANCELLED", + "DEADLINE_EXCEEDED", + "ABORTED", + "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 + }, + "5763d5cb4f40f09b4de469b8a0f10443a7a49d00": { + "initial_retry_delay_millis": 200, + "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": { + "ListApis": { + "timeout_millis": 60000, + "retry_codes_name": "cancelled_deadline_exceeded_aborted_unavailable", + "retry_params_name": "5763d5cb4f40f09b4de469b8a0f10443a7a49d00" + }, + "GetApi": { + "timeout_millis": 60000, + "retry_codes_name": "cancelled_deadline_exceeded_aborted_unavailable", + "retry_params_name": "5763d5cb4f40f09b4de469b8a0f10443a7a49d00" + }, + "CreateApi": { + "timeout_millis": 60000, + "retry_codes_name": "cancelled_deadline_exceeded_aborted_unavailable", + "retry_params_name": "5763d5cb4f40f09b4de469b8a0f10443a7a49d00" + }, + "UpdateApi": { + "timeout_millis": 60000, + "retry_codes_name": "cancelled_deadline_exceeded_aborted_unavailable", + "retry_params_name": "5763d5cb4f40f09b4de469b8a0f10443a7a49d00" + }, + "DeleteApi": { + "timeout_millis": 60000, + "retry_codes_name": "cancelled_deadline_exceeded_aborted_unavailable", + "retry_params_name": "5763d5cb4f40f09b4de469b8a0f10443a7a49d00" + }, + "ListApiVersions": { + "timeout_millis": 60000, + "retry_codes_name": "cancelled_deadline_exceeded_aborted_unavailable", + "retry_params_name": "5763d5cb4f40f09b4de469b8a0f10443a7a49d00" + }, + "GetApiVersion": { + "timeout_millis": 60000, + "retry_codes_name": "cancelled_deadline_exceeded_aborted_unavailable", + "retry_params_name": "5763d5cb4f40f09b4de469b8a0f10443a7a49d00" + }, + "CreateApiVersion": { + "timeout_millis": 60000, + "retry_codes_name": "cancelled_deadline_exceeded_aborted_unavailable", + "retry_params_name": "5763d5cb4f40f09b4de469b8a0f10443a7a49d00" + }, + "UpdateApiVersion": { + "timeout_millis": 60000, + "retry_codes_name": "cancelled_deadline_exceeded_aborted_unavailable", + "retry_params_name": "5763d5cb4f40f09b4de469b8a0f10443a7a49d00" + }, + "DeleteApiVersion": { + "timeout_millis": 60000, + "retry_codes_name": "cancelled_deadline_exceeded_aborted_unavailable", + "retry_params_name": "5763d5cb4f40f09b4de469b8a0f10443a7a49d00" + }, + "ListApiSpecs": { + "timeout_millis": 60000, + "retry_codes_name": "cancelled_deadline_exceeded_aborted_unavailable", + "retry_params_name": "5763d5cb4f40f09b4de469b8a0f10443a7a49d00" + }, + "GetApiSpec": { + "timeout_millis": 60000, + "retry_codes_name": "cancelled_deadline_exceeded_aborted_unavailable", + "retry_params_name": "5763d5cb4f40f09b4de469b8a0f10443a7a49d00" + }, + "GetApiSpecContents": { + "timeout_millis": 60000, + "retry_codes_name": "cancelled_deadline_exceeded_aborted_unavailable", + "retry_params_name": "5763d5cb4f40f09b4de469b8a0f10443a7a49d00" + }, + "CreateApiSpec": { + "timeout_millis": 60000, + "retry_codes_name": "cancelled_deadline_exceeded_aborted_unavailable", + "retry_params_name": "5763d5cb4f40f09b4de469b8a0f10443a7a49d00" + }, + "UpdateApiSpec": { + "timeout_millis": 60000, + "retry_codes_name": "cancelled_deadline_exceeded_aborted_unavailable", + "retry_params_name": "5763d5cb4f40f09b4de469b8a0f10443a7a49d00" + }, + "DeleteApiSpec": { + "timeout_millis": 60000, + "retry_codes_name": "cancelled_deadline_exceeded_aborted_unavailable", + "retry_params_name": "5763d5cb4f40f09b4de469b8a0f10443a7a49d00" + }, + "TagApiSpecRevision": { + "timeout_millis": 60000, + "retry_codes_name": "cancelled_deadline_exceeded_aborted_unavailable", + "retry_params_name": "5763d5cb4f40f09b4de469b8a0f10443a7a49d00" + }, + "ListApiSpecRevisions": { + "timeout_millis": 60000, + "retry_codes_name": "cancelled_deadline_exceeded_aborted_unavailable", + "retry_params_name": "5763d5cb4f40f09b4de469b8a0f10443a7a49d00" + }, + "RollbackApiSpec": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "DeleteApiSpecRevision": { + "timeout_millis": 60000, + "retry_codes_name": "cancelled_deadline_exceeded_aborted_unavailable", + "retry_params_name": "5763d5cb4f40f09b4de469b8a0f10443a7a49d00" + }, + "ListApiDeployments": { + "timeout_millis": 60000, + "retry_codes_name": "cancelled_deadline_exceeded_aborted_unavailable", + "retry_params_name": "5763d5cb4f40f09b4de469b8a0f10443a7a49d00" + }, + "GetApiDeployment": { + "timeout_millis": 60000, + "retry_codes_name": "cancelled_deadline_exceeded_aborted_unavailable", + "retry_params_name": "5763d5cb4f40f09b4de469b8a0f10443a7a49d00" + }, + "CreateApiDeployment": { + "timeout_millis": 60000, + "retry_codes_name": "cancelled_deadline_exceeded_aborted_unavailable", + "retry_params_name": "5763d5cb4f40f09b4de469b8a0f10443a7a49d00" + }, + "UpdateApiDeployment": { + "timeout_millis": 60000, + "retry_codes_name": "cancelled_deadline_exceeded_aborted_unavailable", + "retry_params_name": "5763d5cb4f40f09b4de469b8a0f10443a7a49d00" + }, + "DeleteApiDeployment": { + "timeout_millis": 60000, + "retry_codes_name": "cancelled_deadline_exceeded_aborted_unavailable", + "retry_params_name": "5763d5cb4f40f09b4de469b8a0f10443a7a49d00" + }, + "TagApiDeploymentRevision": { + "timeout_millis": 60000, + "retry_codes_name": "cancelled_deadline_exceeded_aborted_unavailable", + "retry_params_name": "5763d5cb4f40f09b4de469b8a0f10443a7a49d00" + }, + "ListApiDeploymentRevisions": { + "timeout_millis": 60000, + "retry_codes_name": "cancelled_deadline_exceeded_aborted_unavailable", + "retry_params_name": "5763d5cb4f40f09b4de469b8a0f10443a7a49d00" + }, + "RollbackApiDeployment": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "DeleteApiDeploymentRevision": { + "timeout_millis": 60000, + "retry_codes_name": "cancelled_deadline_exceeded_aborted_unavailable", + "retry_params_name": "5763d5cb4f40f09b4de469b8a0f10443a7a49d00" + }, + "ListArtifacts": { + "timeout_millis": 60000, + "retry_codes_name": "cancelled_deadline_exceeded_aborted_unavailable", + "retry_params_name": "5763d5cb4f40f09b4de469b8a0f10443a7a49d00" + }, + "GetArtifact": { + "timeout_millis": 60000, + "retry_codes_name": "cancelled_deadline_exceeded_aborted_unavailable", + "retry_params_name": "5763d5cb4f40f09b4de469b8a0f10443a7a49d00" + }, + "GetArtifactContents": { + "timeout_millis": 60000, + "retry_codes_name": "cancelled_deadline_exceeded_aborted_unavailable", + "retry_params_name": "5763d5cb4f40f09b4de469b8a0f10443a7a49d00" + }, + "CreateArtifact": { + "timeout_millis": 60000, + "retry_codes_name": "cancelled_deadline_exceeded_aborted_unavailable", + "retry_params_name": "5763d5cb4f40f09b4de469b8a0f10443a7a49d00" + }, + "ReplaceArtifact": { + "timeout_millis": 60000, + "retry_codes_name": "cancelled_deadline_exceeded_aborted_unavailable", + "retry_params_name": "5763d5cb4f40f09b4de469b8a0f10443a7a49d00" + }, + "DeleteArtifact": { + "timeout_millis": 60000, + "retry_codes_name": "cancelled_deadline_exceeded_aborted_unavailable", + "retry_params_name": "5763d5cb4f40f09b4de469b8a0f10443a7a49d00" + } + } + } + } +} diff --git a/packages/google-cloud-apigeeregistry/src/v1/registry_proto_list.json b/packages/google-cloud-apigeeregistry/src/v1/registry_proto_list.json new file mode 100644 index 00000000000..4fdc846ee2b --- /dev/null +++ b/packages/google-cloud-apigeeregistry/src/v1/registry_proto_list.json @@ -0,0 +1,5 @@ +[ + "../../protos/google/cloud/apigeeregistry/v1/provisioning_service.proto", + "../../protos/google/cloud/apigeeregistry/v1/registry_models.proto", + "../../protos/google/cloud/apigeeregistry/v1/registry_service.proto" +] diff --git a/packages/google-cloud-apigeeregistry/system-test/fixtures/sample/src/index.js b/packages/google-cloud-apigeeregistry/system-test/fixtures/sample/src/index.js new file mode 100644 index 00000000000..113a4716508 --- /dev/null +++ b/packages/google-cloud-apigeeregistry/system-test/fixtures/sample/src/index.js @@ -0,0 +1,27 @@ +// Copyright 2023 Google LLC +// +// Licensed under the Apache License, Version 2.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 apigeeregistry = require('@google-cloud/apigee-registry'); + +function main() { + const provisioningClient = new apigeeregistry.ProvisioningClient(); + const registryClient = new apigeeregistry.RegistryClient(); +} + +main(); diff --git a/packages/google-cloud-apigeeregistry/system-test/fixtures/sample/src/index.ts b/packages/google-cloud-apigeeregistry/system-test/fixtures/sample/src/index.ts new file mode 100644 index 00000000000..9a94f4bec58 --- /dev/null +++ b/packages/google-cloud-apigeeregistry/system-test/fixtures/sample/src/index.ts @@ -0,0 +1,41 @@ +// Copyright 2023 Google LLC +// +// Licensed under the Apache License, Version 2.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 { + ProvisioningClient, + RegistryClient, +} from '@google-cloud/apigee-registry'; + +// check that the client class type name can be used +function doStuffWithProvisioningClient(client: ProvisioningClient) { + client.close(); +} +function doStuffWithRegistryClient(client: RegistryClient) { + client.close(); +} + +function main() { + // check that the client instance can be created + const provisioningClient = new ProvisioningClient(); + doStuffWithProvisioningClient(provisioningClient); + // check that the client instance can be created + const registryClient = new RegistryClient(); + doStuffWithRegistryClient(registryClient); +} + +main(); diff --git a/packages/google-cloud-apigeeregistry/system-test/install.ts b/packages/google-cloud-apigeeregistry/system-test/install.ts new file mode 100644 index 00000000000..f61fe236476 --- /dev/null +++ b/packages/google-cloud-apigeeregistry/system-test/install.ts @@ -0,0 +1,51 @@ +// Copyright 2023 Google LLC +// +// Licensed under the Apache License, Version 2.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/google-cloud-apigeeregistry/test/gapic_provisioning_v1.ts b/packages/google-cloud-apigeeregistry/test/gapic_provisioning_v1.ts new file mode 100644 index 00000000000..50e41b6b3e9 --- /dev/null +++ b/packages/google-cloud-apigeeregistry/test/gapic_provisioning_v1.ts @@ -0,0 +1,2547 @@ +// Copyright 2023 Google LLC +// +// Licensed under the Apache License, Version 2.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 provisioningModule from '../src'; + +import { + protobuf, + LROperation, + operationsProtos, + IamProtos, + 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 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.ProvisioningClient', () => { + describe('Common methods', () => { + it('has servicePath', () => { + const servicePath = provisioningModule.v1.ProvisioningClient.servicePath; + assert(servicePath); + }); + + it('has apiEndpoint', () => { + const apiEndpoint = provisioningModule.v1.ProvisioningClient.apiEndpoint; + assert(apiEndpoint); + }); + + it('has port', () => { + const port = provisioningModule.v1.ProvisioningClient.port; + assert(port); + assert(typeof port === 'number'); + }); + + it('should create a client with no option', () => { + const client = new provisioningModule.v1.ProvisioningClient(); + assert(client); + }); + + it('should create a client with gRPC fallback', () => { + const client = new provisioningModule.v1.ProvisioningClient({ + fallback: true, + }); + assert(client); + }); + + it('has initialize method and supports deferred initialization', async () => { + const client = new provisioningModule.v1.ProvisioningClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + assert.strictEqual(client.provisioningStub, undefined); + await client.initialize(); + assert(client.provisioningStub); + }); + + it('has close method for the initialized client', done => { + const client = new provisioningModule.v1.ProvisioningClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + assert(client.provisioningStub); + client.close().then(() => { + done(); + }); + }); + + it('has close method for the non-initialized client', done => { + const client = new provisioningModule.v1.ProvisioningClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + assert.strictEqual(client.provisioningStub, undefined); + client.close().then(() => { + done(); + }); + }); + + it('has getProjectId method', async () => { + const fakeProjectId = 'fake-project-id'; + const client = new provisioningModule.v1.ProvisioningClient({ + 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 provisioningModule.v1.ProvisioningClient({ + 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('getInstance', () => { + it('invokes getInstance without error', async () => { + const client = new provisioningModule.v1.ProvisioningClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apigeeregistry.v1.GetInstanceRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.apigeeregistry.v1.GetInstanceRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.apigeeregistry.v1.Instance() + ); + client.innerApiCalls.getInstance = stubSimpleCall(expectedResponse); + const [response] = await client.getInstance(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.getInstance as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getInstance as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getInstance without error using callback', async () => { + const client = new provisioningModule.v1.ProvisioningClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apigeeregistry.v1.GetInstanceRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.apigeeregistry.v1.GetInstanceRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.apigeeregistry.v1.Instance() + ); + client.innerApiCalls.getInstance = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getInstance( + request, + ( + err?: Error | null, + result?: protos.google.cloud.apigeeregistry.v1.IInstance | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.getInstance as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getInstance as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getInstance with error', async () => { + const client = new provisioningModule.v1.ProvisioningClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apigeeregistry.v1.GetInstanceRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.apigeeregistry.v1.GetInstanceRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.getInstance = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.getInstance(request), expectedError); + const actualRequest = ( + client.innerApiCalls.getInstance as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getInstance as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getInstance with closed client', async () => { + const client = new provisioningModule.v1.ProvisioningClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apigeeregistry.v1.GetInstanceRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.apigeeregistry.v1.GetInstanceRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.getInstance(request), expectedError); + }); + }); + + describe('createInstance', () => { + it('invokes createInstance without error', async () => { + const client = new provisioningModule.v1.ProvisioningClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apigeeregistry.v1.CreateInstanceRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.apigeeregistry.v1.CreateInstanceRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.createInstance = + stubLongRunningCall(expectedResponse); + const [operation] = await client.createInstance(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.createInstance as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createInstance as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createInstance without error using callback', async () => { + const client = new provisioningModule.v1.ProvisioningClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apigeeregistry.v1.CreateInstanceRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.apigeeregistry.v1.CreateInstanceRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.createInstance = + stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.createInstance( + request, + ( + err?: Error | null, + result?: LROperation< + protos.google.cloud.apigeeregistry.v1.IInstance, + protos.google.cloud.apigeeregistry.v1.IOperationMetadata + > | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const operation = (await promise) as LROperation< + protos.google.cloud.apigeeregistry.v1.IInstance, + protos.google.cloud.apigeeregistry.v1.IOperationMetadata + >; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.createInstance as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createInstance as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createInstance with call error', async () => { + const client = new provisioningModule.v1.ProvisioningClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apigeeregistry.v1.CreateInstanceRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.apigeeregistry.v1.CreateInstanceRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.createInstance = stubLongRunningCall( + undefined, + expectedError + ); + await assert.rejects(client.createInstance(request), expectedError); + const actualRequest = ( + client.innerApiCalls.createInstance as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createInstance as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createInstance with LRO error', async () => { + const client = new provisioningModule.v1.ProvisioningClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apigeeregistry.v1.CreateInstanceRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.apigeeregistry.v1.CreateInstanceRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.createInstance = stubLongRunningCall( + undefined, + undefined, + expectedError + ); + const [operation] = await client.createInstance(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = ( + client.innerApiCalls.createInstance as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createInstance as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkCreateInstanceProgress without error', async () => { + const client = new provisioningModule.v1.ProvisioningClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + 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.checkCreateInstanceProgress( + expectedResponse.name + ); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkCreateInstanceProgress with error', async () => { + const client = new provisioningModule.v1.ProvisioningClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const expectedError = new Error('expected'); + + client.operationsClient.getOperation = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects( + client.checkCreateInstanceProgress(''), + expectedError + ); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + }); + + describe('deleteInstance', () => { + it('invokes deleteInstance without error', async () => { + const client = new provisioningModule.v1.ProvisioningClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apigeeregistry.v1.DeleteInstanceRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.apigeeregistry.v1.DeleteInstanceRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.deleteInstance = + stubLongRunningCall(expectedResponse); + const [operation] = await client.deleteInstance(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.deleteInstance as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteInstance as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteInstance without error using callback', async () => { + const client = new provisioningModule.v1.ProvisioningClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apigeeregistry.v1.DeleteInstanceRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.apigeeregistry.v1.DeleteInstanceRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.deleteInstance = + stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.deleteInstance( + request, + ( + err?: Error | null, + result?: LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.apigeeregistry.v1.IOperationMetadata + > | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const operation = (await promise) as LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.apigeeregistry.v1.IOperationMetadata + >; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.deleteInstance as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteInstance as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteInstance with call error', async () => { + const client = new provisioningModule.v1.ProvisioningClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apigeeregistry.v1.DeleteInstanceRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.apigeeregistry.v1.DeleteInstanceRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteInstance = stubLongRunningCall( + undefined, + expectedError + ); + await assert.rejects(client.deleteInstance(request), expectedError); + const actualRequest = ( + client.innerApiCalls.deleteInstance as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteInstance as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteInstance with LRO error', async () => { + const client = new provisioningModule.v1.ProvisioningClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apigeeregistry.v1.DeleteInstanceRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.apigeeregistry.v1.DeleteInstanceRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteInstance = stubLongRunningCall( + undefined, + undefined, + expectedError + ); + const [operation] = await client.deleteInstance(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = ( + client.innerApiCalls.deleteInstance as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteInstance as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkDeleteInstanceProgress without error', async () => { + const client = new provisioningModule.v1.ProvisioningClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + 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.checkDeleteInstanceProgress( + expectedResponse.name + ); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkDeleteInstanceProgress with error', async () => { + const client = new provisioningModule.v1.ProvisioningClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const expectedError = new Error('expected'); + + client.operationsClient.getOperation = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects( + client.checkDeleteInstanceProgress(''), + expectedError + ); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + }); + describe('getIamPolicy', () => { + it('invokes getIamPolicy without error', async () => { + const client = new provisioningModule.v1.ProvisioningClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new IamProtos.google.iam.v1.GetIamPolicyRequest() + ); + request.resource = ''; + const expectedHeaderRequestParams = 'resource='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new IamProtos.google.iam.v1.Policy() + ); + client.iamClient.getIamPolicy = stubSimpleCall(expectedResponse); + const response = await client.getIamPolicy(request, expectedOptions); + assert.deepStrictEqual(response, [expectedResponse]); + assert( + (client.iamClient.getIamPolicy as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + it('invokes getIamPolicy without error using callback', async () => { + const client = new provisioningModule.v1.ProvisioningClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new IamProtos.google.iam.v1.GetIamPolicyRequest() + ); + request.resource = ''; + const expectedHeaderRequestParams = 'resource='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new IamProtos.google.iam.v1.Policy() + ); + client.iamClient.getIamPolicy = sinon + .stub() + .callsArgWith(2, null, expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getIamPolicy( + request, + expectedOptions, + ( + err?: Error | null, + result?: IamProtos.google.iam.v1.Policy | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.iamClient.getIamPolicy as SinonStub).getCall(0)); + }); + it('invokes getIamPolicy with error', async () => { + const client = new provisioningModule.v1.ProvisioningClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new IamProtos.google.iam.v1.GetIamPolicyRequest() + ); + request.resource = ''; + const expectedHeaderRequestParams = 'resource='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.iamClient.getIamPolicy = stubSimpleCall(undefined, expectedError); + await assert.rejects( + client.getIamPolicy(request, expectedOptions), + expectedError + ); + assert( + (client.iamClient.getIamPolicy as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + }); + describe('setIamPolicy', () => { + it('invokes setIamPolicy without error', async () => { + const client = new provisioningModule.v1.ProvisioningClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new IamProtos.google.iam.v1.SetIamPolicyRequest() + ); + request.resource = ''; + const expectedHeaderRequestParams = 'resource='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new IamProtos.google.iam.v1.Policy() + ); + client.iamClient.setIamPolicy = stubSimpleCall(expectedResponse); + const response = await client.setIamPolicy(request, expectedOptions); + assert.deepStrictEqual(response, [expectedResponse]); + assert( + (client.iamClient.setIamPolicy as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + it('invokes setIamPolicy without error using callback', async () => { + const client = new provisioningModule.v1.ProvisioningClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new IamProtos.google.iam.v1.SetIamPolicyRequest() + ); + request.resource = ''; + const expectedHeaderRequestParams = 'resource='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new IamProtos.google.iam.v1.Policy() + ); + client.iamClient.setIamPolicy = sinon + .stub() + .callsArgWith(2, null, expectedResponse); + const promise = new Promise((resolve, reject) => { + client.setIamPolicy( + request, + expectedOptions, + ( + err?: Error | null, + result?: IamProtos.google.iam.v1.Policy | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.iamClient.setIamPolicy as SinonStub).getCall(0)); + }); + it('invokes setIamPolicy with error', async () => { + const client = new provisioningModule.v1.ProvisioningClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new IamProtos.google.iam.v1.SetIamPolicyRequest() + ); + request.resource = ''; + const expectedHeaderRequestParams = 'resource='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.iamClient.setIamPolicy = stubSimpleCall(undefined, expectedError); + await assert.rejects( + client.setIamPolicy(request, expectedOptions), + expectedError + ); + assert( + (client.iamClient.setIamPolicy as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + }); + describe('testIamPermissions', () => { + it('invokes testIamPermissions without error', async () => { + const client = new provisioningModule.v1.ProvisioningClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new IamProtos.google.iam.v1.TestIamPermissionsRequest() + ); + request.resource = ''; + const expectedHeaderRequestParams = 'resource='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new IamProtos.google.iam.v1.TestIamPermissionsResponse() + ); + client.iamClient.testIamPermissions = stubSimpleCall(expectedResponse); + const response = await client.testIamPermissions( + request, + expectedOptions + ); + assert.deepStrictEqual(response, [expectedResponse]); + assert( + (client.iamClient.testIamPermissions as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + it('invokes testIamPermissions without error using callback', async () => { + const client = new provisioningModule.v1.ProvisioningClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new IamProtos.google.iam.v1.TestIamPermissionsRequest() + ); + request.resource = ''; + const expectedHeaderRequestParams = 'resource='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new IamProtos.google.iam.v1.TestIamPermissionsResponse() + ); + client.iamClient.testIamPermissions = sinon + .stub() + .callsArgWith(2, null, expectedResponse); + const promise = new Promise((resolve, reject) => { + client.testIamPermissions( + request, + expectedOptions, + ( + err?: Error | null, + result?: IamProtos.google.iam.v1.TestIamPermissionsResponse | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.iamClient.testIamPermissions as SinonStub).getCall(0)); + }); + it('invokes testIamPermissions with error', async () => { + const client = new provisioningModule.v1.ProvisioningClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new IamProtos.google.iam.v1.TestIamPermissionsRequest() + ); + request.resource = ''; + const expectedHeaderRequestParams = 'resource='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.iamClient.testIamPermissions = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects( + client.testIamPermissions(request, expectedOptions), + expectedError + ); + assert( + (client.iamClient.testIamPermissions as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + }); + describe('getLocation', () => { + it('invokes getLocation without error', async () => { + const client = new provisioningModule.v1.ProvisioningClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + 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 provisioningModule.v1.ProvisioningClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + 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 provisioningModule.v1.ProvisioningClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + 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 provisioningModule.v1.ProvisioningClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + 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 provisioningModule.v1.ProvisioningClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + 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 provisioningModule.v1.ProvisioningClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + 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 provisioningModule.v1.ProvisioningClient({ + 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); + } + } + ); + }); + 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 provisioningModule.v1.ProvisioningClient({ + 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 provisioningModule.v1.ProvisioningClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + 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 provisioningModule.v1.ProvisioningClient({ + 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); + } + } + ); + }); + 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 provisioningModule.v1.ProvisioningClient({ + 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 provisioningModule.v1.ProvisioningClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + 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 provisioningModule.v1.ProvisioningClient({ + 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); + } + } + ); + }); + 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 provisioningModule.v1.ProvisioningClient({ + 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 provisioningModule.v1.ProvisioningClient({ + 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.ListOperationsResponse[] = + []; + 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 provisioningModule.v1.ProvisioningClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + 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.ListOperationsResponse[] = + []; + 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('api', () => { + const fakePath = '/rendered/path/api'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + api: 'apiValue', + }; + const client = new provisioningModule.v1.ProvisioningClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.apiPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.apiPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('apiPath', () => { + const result = client.apiPath( + 'projectValue', + 'locationValue', + 'apiValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.apiPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromApiName', () => { + const result = client.matchProjectFromApiName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.apiPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromApiName', () => { + const result = client.matchLocationFromApiName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.apiPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchApiFromApiName', () => { + const result = client.matchApiFromApiName(fakePath); + assert.strictEqual(result, 'apiValue'); + assert( + (client.pathTemplates.apiPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('apiDeployment', () => { + const fakePath = '/rendered/path/apiDeployment'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + api: 'apiValue', + deployment: 'deploymentValue', + }; + const client = new provisioningModule.v1.ProvisioningClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.apiDeploymentPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.apiDeploymentPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('apiDeploymentPath', () => { + const result = client.apiDeploymentPath( + 'projectValue', + 'locationValue', + 'apiValue', + 'deploymentValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.apiDeploymentPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromApiDeploymentName', () => { + const result = client.matchProjectFromApiDeploymentName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.apiDeploymentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromApiDeploymentName', () => { + const result = client.matchLocationFromApiDeploymentName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.apiDeploymentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchApiFromApiDeploymentName', () => { + const result = client.matchApiFromApiDeploymentName(fakePath); + assert.strictEqual(result, 'apiValue'); + assert( + (client.pathTemplates.apiDeploymentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchDeploymentFromApiDeploymentName', () => { + const result = client.matchDeploymentFromApiDeploymentName(fakePath); + assert.strictEqual(result, 'deploymentValue'); + assert( + (client.pathTemplates.apiDeploymentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('apiSpec', () => { + const fakePath = '/rendered/path/apiSpec'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + api: 'apiValue', + version: 'versionValue', + spec: 'specValue', + }; + const client = new provisioningModule.v1.ProvisioningClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.apiSpecPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.apiSpecPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('apiSpecPath', () => { + const result = client.apiSpecPath( + 'projectValue', + 'locationValue', + 'apiValue', + 'versionValue', + 'specValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.apiSpecPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromApiSpecName', () => { + const result = client.matchProjectFromApiSpecName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.apiSpecPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromApiSpecName', () => { + const result = client.matchLocationFromApiSpecName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.apiSpecPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchApiFromApiSpecName', () => { + const result = client.matchApiFromApiSpecName(fakePath); + assert.strictEqual(result, 'apiValue'); + assert( + (client.pathTemplates.apiSpecPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchVersionFromApiSpecName', () => { + const result = client.matchVersionFromApiSpecName(fakePath); + assert.strictEqual(result, 'versionValue'); + assert( + (client.pathTemplates.apiSpecPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchSpecFromApiSpecName', () => { + const result = client.matchSpecFromApiSpecName(fakePath); + assert.strictEqual(result, 'specValue'); + assert( + (client.pathTemplates.apiSpecPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('apiVersion', () => { + const fakePath = '/rendered/path/apiVersion'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + api: 'apiValue', + version: 'versionValue', + }; + const client = new provisioningModule.v1.ProvisioningClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.apiVersionPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.apiVersionPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('apiVersionPath', () => { + const result = client.apiVersionPath( + 'projectValue', + 'locationValue', + 'apiValue', + 'versionValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.apiVersionPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromApiVersionName', () => { + const result = client.matchProjectFromApiVersionName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.apiVersionPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromApiVersionName', () => { + const result = client.matchLocationFromApiVersionName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.apiVersionPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchApiFromApiVersionName', () => { + const result = client.matchApiFromApiVersionName(fakePath); + assert.strictEqual(result, 'apiValue'); + assert( + (client.pathTemplates.apiVersionPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchVersionFromApiVersionName', () => { + const result = client.matchVersionFromApiVersionName(fakePath); + assert.strictEqual(result, 'versionValue'); + assert( + (client.pathTemplates.apiVersionPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('instance', () => { + const fakePath = '/rendered/path/instance'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + instance: 'instanceValue', + }; + const client = new provisioningModule.v1.ProvisioningClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.instancePathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.instancePathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('instancePath', () => { + const result = client.instancePath( + 'projectValue', + 'locationValue', + 'instanceValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.instancePathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromInstanceName', () => { + const result = client.matchProjectFromInstanceName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.instancePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromInstanceName', () => { + const result = client.matchLocationFromInstanceName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.instancePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchInstanceFromInstanceName', () => { + const result = client.matchInstanceFromInstanceName(fakePath); + assert.strictEqual(result, 'instanceValue'); + assert( + (client.pathTemplates.instancePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('location', () => { + const fakePath = '/rendered/path/location'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + }; + const client = new provisioningModule.v1.ProvisioningClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + 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('projectLocationApiArtifact', () => { + const fakePath = '/rendered/path/projectLocationApiArtifact'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + api: 'apiValue', + artifact: 'artifactValue', + }; + const client = new provisioningModule.v1.ProvisioningClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.projectLocationApiArtifactPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.projectLocationApiArtifactPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('projectLocationApiArtifactPath', () => { + const result = client.projectLocationApiArtifactPath( + 'projectValue', + 'locationValue', + 'apiValue', + 'artifactValue' + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates.projectLocationApiArtifactPathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromProjectLocationApiArtifactName', () => { + const result = + client.matchProjectFromProjectLocationApiArtifactName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + ( + client.pathTemplates.projectLocationApiArtifactPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromProjectLocationApiArtifactName', () => { + const result = + client.matchLocationFromProjectLocationApiArtifactName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + ( + client.pathTemplates.projectLocationApiArtifactPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchApiFromProjectLocationApiArtifactName', () => { + const result = + client.matchApiFromProjectLocationApiArtifactName(fakePath); + assert.strictEqual(result, 'apiValue'); + assert( + ( + client.pathTemplates.projectLocationApiArtifactPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchArtifactFromProjectLocationApiArtifactName', () => { + const result = + client.matchArtifactFromProjectLocationApiArtifactName(fakePath); + assert.strictEqual(result, 'artifactValue'); + assert( + ( + client.pathTemplates.projectLocationApiArtifactPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('projectLocationApiDeploymentArtifact', () => { + const fakePath = '/rendered/path/projectLocationApiDeploymentArtifact'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + api: 'apiValue', + deployment: 'deploymentValue', + artifact: 'artifactValue', + }; + const client = new provisioningModule.v1.ProvisioningClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.projectLocationApiDeploymentArtifactPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.projectLocationApiDeploymentArtifactPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('projectLocationApiDeploymentArtifactPath', () => { + const result = client.projectLocationApiDeploymentArtifactPath( + 'projectValue', + 'locationValue', + 'apiValue', + 'deploymentValue', + 'artifactValue' + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates + .projectLocationApiDeploymentArtifactPathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromProjectLocationApiDeploymentArtifactName', () => { + const result = + client.matchProjectFromProjectLocationApiDeploymentArtifactName( + fakePath + ); + assert.strictEqual(result, 'projectValue'); + assert( + ( + client.pathTemplates + .projectLocationApiDeploymentArtifactPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromProjectLocationApiDeploymentArtifactName', () => { + const result = + client.matchLocationFromProjectLocationApiDeploymentArtifactName( + fakePath + ); + assert.strictEqual(result, 'locationValue'); + assert( + ( + client.pathTemplates + .projectLocationApiDeploymentArtifactPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchApiFromProjectLocationApiDeploymentArtifactName', () => { + const result = + client.matchApiFromProjectLocationApiDeploymentArtifactName(fakePath); + assert.strictEqual(result, 'apiValue'); + assert( + ( + client.pathTemplates + .projectLocationApiDeploymentArtifactPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchDeploymentFromProjectLocationApiDeploymentArtifactName', () => { + const result = + client.matchDeploymentFromProjectLocationApiDeploymentArtifactName( + fakePath + ); + assert.strictEqual(result, 'deploymentValue'); + assert( + ( + client.pathTemplates + .projectLocationApiDeploymentArtifactPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchArtifactFromProjectLocationApiDeploymentArtifactName', () => { + const result = + client.matchArtifactFromProjectLocationApiDeploymentArtifactName( + fakePath + ); + assert.strictEqual(result, 'artifactValue'); + assert( + ( + client.pathTemplates + .projectLocationApiDeploymentArtifactPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('projectLocationApiVersionArtifact', () => { + const fakePath = '/rendered/path/projectLocationApiVersionArtifact'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + api: 'apiValue', + version: 'versionValue', + artifact: 'artifactValue', + }; + const client = new provisioningModule.v1.ProvisioningClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.projectLocationApiVersionArtifactPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.projectLocationApiVersionArtifactPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('projectLocationApiVersionArtifactPath', () => { + const result = client.projectLocationApiVersionArtifactPath( + 'projectValue', + 'locationValue', + 'apiValue', + 'versionValue', + 'artifactValue' + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates.projectLocationApiVersionArtifactPathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromProjectLocationApiVersionArtifactName', () => { + const result = + client.matchProjectFromProjectLocationApiVersionArtifactName( + fakePath + ); + assert.strictEqual(result, 'projectValue'); + assert( + ( + client.pathTemplates.projectLocationApiVersionArtifactPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromProjectLocationApiVersionArtifactName', () => { + const result = + client.matchLocationFromProjectLocationApiVersionArtifactName( + fakePath + ); + assert.strictEqual(result, 'locationValue'); + assert( + ( + client.pathTemplates.projectLocationApiVersionArtifactPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchApiFromProjectLocationApiVersionArtifactName', () => { + const result = + client.matchApiFromProjectLocationApiVersionArtifactName(fakePath); + assert.strictEqual(result, 'apiValue'); + assert( + ( + client.pathTemplates.projectLocationApiVersionArtifactPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchVersionFromProjectLocationApiVersionArtifactName', () => { + const result = + client.matchVersionFromProjectLocationApiVersionArtifactName( + fakePath + ); + assert.strictEqual(result, 'versionValue'); + assert( + ( + client.pathTemplates.projectLocationApiVersionArtifactPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchArtifactFromProjectLocationApiVersionArtifactName', () => { + const result = + client.matchArtifactFromProjectLocationApiVersionArtifactName( + fakePath + ); + assert.strictEqual(result, 'artifactValue'); + assert( + ( + client.pathTemplates.projectLocationApiVersionArtifactPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('projectLocationApiVersionSpecArtifact', () => { + const fakePath = '/rendered/path/projectLocationApiVersionSpecArtifact'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + api: 'apiValue', + version: 'versionValue', + spec: 'specValue', + artifact: 'artifactValue', + }; + const client = new provisioningModule.v1.ProvisioningClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.projectLocationApiVersionSpecArtifactPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.projectLocationApiVersionSpecArtifactPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('projectLocationApiVersionSpecArtifactPath', () => { + const result = client.projectLocationApiVersionSpecArtifactPath( + 'projectValue', + 'locationValue', + 'apiValue', + 'versionValue', + 'specValue', + 'artifactValue' + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates + .projectLocationApiVersionSpecArtifactPathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromProjectLocationApiVersionSpecArtifactName', () => { + const result = + client.matchProjectFromProjectLocationApiVersionSpecArtifactName( + fakePath + ); + assert.strictEqual(result, 'projectValue'); + assert( + ( + client.pathTemplates + .projectLocationApiVersionSpecArtifactPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromProjectLocationApiVersionSpecArtifactName', () => { + const result = + client.matchLocationFromProjectLocationApiVersionSpecArtifactName( + fakePath + ); + assert.strictEqual(result, 'locationValue'); + assert( + ( + client.pathTemplates + .projectLocationApiVersionSpecArtifactPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchApiFromProjectLocationApiVersionSpecArtifactName', () => { + const result = + client.matchApiFromProjectLocationApiVersionSpecArtifactName( + fakePath + ); + assert.strictEqual(result, 'apiValue'); + assert( + ( + client.pathTemplates + .projectLocationApiVersionSpecArtifactPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchVersionFromProjectLocationApiVersionSpecArtifactName', () => { + const result = + client.matchVersionFromProjectLocationApiVersionSpecArtifactName( + fakePath + ); + assert.strictEqual(result, 'versionValue'); + assert( + ( + client.pathTemplates + .projectLocationApiVersionSpecArtifactPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchSpecFromProjectLocationApiVersionSpecArtifactName', () => { + const result = + client.matchSpecFromProjectLocationApiVersionSpecArtifactName( + fakePath + ); + assert.strictEqual(result, 'specValue'); + assert( + ( + client.pathTemplates + .projectLocationApiVersionSpecArtifactPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchArtifactFromProjectLocationApiVersionSpecArtifactName', () => { + const result = + client.matchArtifactFromProjectLocationApiVersionSpecArtifactName( + fakePath + ); + assert.strictEqual(result, 'artifactValue'); + assert( + ( + client.pathTemplates + .projectLocationApiVersionSpecArtifactPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('projectLocationArtifact', () => { + const fakePath = '/rendered/path/projectLocationArtifact'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + artifact: 'artifactValue', + }; + const client = new provisioningModule.v1.ProvisioningClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.projectLocationArtifactPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.projectLocationArtifactPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('projectLocationArtifactPath', () => { + const result = client.projectLocationArtifactPath( + 'projectValue', + 'locationValue', + 'artifactValue' + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates.projectLocationArtifactPathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromProjectLocationArtifactName', () => { + const result = + client.matchProjectFromProjectLocationArtifactName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + ( + client.pathTemplates.projectLocationArtifactPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromProjectLocationArtifactName', () => { + const result = + client.matchLocationFromProjectLocationArtifactName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + ( + client.pathTemplates.projectLocationArtifactPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchArtifactFromProjectLocationArtifactName', () => { + const result = + client.matchArtifactFromProjectLocationArtifactName(fakePath); + assert.strictEqual(result, 'artifactValue'); + assert( + ( + client.pathTemplates.projectLocationArtifactPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + }); +}); diff --git a/packages/google-cloud-apigeeregistry/test/gapic_registry_v1.ts b/packages/google-cloud-apigeeregistry/test/gapic_registry_v1.ts new file mode 100644 index 00000000000..ab87ec86793 --- /dev/null +++ b/packages/google-cloud-apigeeregistry/test/gapic_registry_v1.ts @@ -0,0 +1,7733 @@ +// Copyright 2023 Google LLC +// +// Licensed under the Apache License, Version 2.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 registryModule from '../src'; + +import {PassThrough} from 'stream'; + +import {protobuf, IamProtos, 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 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.RegistryClient', () => { + describe('Common methods', () => { + it('has servicePath', () => { + const servicePath = registryModule.v1.RegistryClient.servicePath; + assert(servicePath); + }); + + it('has apiEndpoint', () => { + const apiEndpoint = registryModule.v1.RegistryClient.apiEndpoint; + assert(apiEndpoint); + }); + + it('has port', () => { + const port = registryModule.v1.RegistryClient.port; + assert(port); + assert(typeof port === 'number'); + }); + + it('should create a client with no option', () => { + const client = new registryModule.v1.RegistryClient(); + assert(client); + }); + + it('should create a client with gRPC fallback', () => { + const client = new registryModule.v1.RegistryClient({ + fallback: true, + }); + assert(client); + }); + + it('has initialize method and supports deferred initialization', async () => { + const client = new registryModule.v1.RegistryClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + assert.strictEqual(client.registryStub, undefined); + await client.initialize(); + assert(client.registryStub); + }); + + it('has close method for the initialized client', done => { + const client = new registryModule.v1.RegistryClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + assert(client.registryStub); + client.close().then(() => { + done(); + }); + }); + + it('has close method for the non-initialized client', done => { + const client = new registryModule.v1.RegistryClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + assert.strictEqual(client.registryStub, undefined); + client.close().then(() => { + done(); + }); + }); + + it('has getProjectId method', async () => { + const fakeProjectId = 'fake-project-id'; + const client = new registryModule.v1.RegistryClient({ + 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 registryModule.v1.RegistryClient({ + 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('getApi', () => { + it('invokes getApi without error', async () => { + const client = new registryModule.v1.RegistryClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apigeeregistry.v1.GetApiRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.apigeeregistry.v1.GetApiRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.apigeeregistry.v1.Api() + ); + client.innerApiCalls.getApi = stubSimpleCall(expectedResponse); + const [response] = await client.getApi(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.getApi as SinonStub).getCall( + 0 + ).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getApi as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getApi without error using callback', async () => { + const client = new registryModule.v1.RegistryClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apigeeregistry.v1.GetApiRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.apigeeregistry.v1.GetApiRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.apigeeregistry.v1.Api() + ); + client.innerApiCalls.getApi = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getApi( + request, + ( + err?: Error | null, + result?: protos.google.cloud.apigeeregistry.v1.IApi | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.getApi as SinonStub).getCall( + 0 + ).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getApi as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getApi with error', async () => { + const client = new registryModule.v1.RegistryClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apigeeregistry.v1.GetApiRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.apigeeregistry.v1.GetApiRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.getApi = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.getApi(request), expectedError); + const actualRequest = (client.innerApiCalls.getApi as SinonStub).getCall( + 0 + ).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getApi as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getApi with closed client', async () => { + const client = new registryModule.v1.RegistryClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apigeeregistry.v1.GetApiRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.apigeeregistry.v1.GetApiRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.getApi(request), expectedError); + }); + }); + + describe('createApi', () => { + it('invokes createApi without error', async () => { + const client = new registryModule.v1.RegistryClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apigeeregistry.v1.CreateApiRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.apigeeregistry.v1.CreateApiRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.apigeeregistry.v1.Api() + ); + client.innerApiCalls.createApi = stubSimpleCall(expectedResponse); + const [response] = await client.createApi(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.createApi as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createApi as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createApi without error using callback', async () => { + const client = new registryModule.v1.RegistryClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apigeeregistry.v1.CreateApiRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.apigeeregistry.v1.CreateApiRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.apigeeregistry.v1.Api() + ); + client.innerApiCalls.createApi = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.createApi( + request, + ( + err?: Error | null, + result?: protos.google.cloud.apigeeregistry.v1.IApi | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.createApi as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createApi as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createApi with error', async () => { + const client = new registryModule.v1.RegistryClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apigeeregistry.v1.CreateApiRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.apigeeregistry.v1.CreateApiRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.createApi = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.createApi(request), expectedError); + const actualRequest = ( + client.innerApiCalls.createApi as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createApi as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createApi with closed client', async () => { + const client = new registryModule.v1.RegistryClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apigeeregistry.v1.CreateApiRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.apigeeregistry.v1.CreateApiRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.createApi(request), expectedError); + }); + }); + + describe('updateApi', () => { + it('invokes updateApi without error', async () => { + const client = new registryModule.v1.RegistryClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apigeeregistry.v1.UpdateApiRequest() + ); + request.api ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.apigeeregistry.v1.UpdateApiRequest', + ['api', 'name'] + ); + request.api.name = defaultValue1; + const expectedHeaderRequestParams = `api.name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.apigeeregistry.v1.Api() + ); + client.innerApiCalls.updateApi = stubSimpleCall(expectedResponse); + const [response] = await client.updateApi(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.updateApi as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateApi as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateApi without error using callback', async () => { + const client = new registryModule.v1.RegistryClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apigeeregistry.v1.UpdateApiRequest() + ); + request.api ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.apigeeregistry.v1.UpdateApiRequest', + ['api', 'name'] + ); + request.api.name = defaultValue1; + const expectedHeaderRequestParams = `api.name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.apigeeregistry.v1.Api() + ); + client.innerApiCalls.updateApi = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.updateApi( + request, + ( + err?: Error | null, + result?: protos.google.cloud.apigeeregistry.v1.IApi | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.updateApi as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateApi as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateApi with error', async () => { + const client = new registryModule.v1.RegistryClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apigeeregistry.v1.UpdateApiRequest() + ); + request.api ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.apigeeregistry.v1.UpdateApiRequest', + ['api', 'name'] + ); + request.api.name = defaultValue1; + const expectedHeaderRequestParams = `api.name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.updateApi = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.updateApi(request), expectedError); + const actualRequest = ( + client.innerApiCalls.updateApi as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateApi as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateApi with closed client', async () => { + const client = new registryModule.v1.RegistryClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apigeeregistry.v1.UpdateApiRequest() + ); + request.api ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.apigeeregistry.v1.UpdateApiRequest', + ['api', 'name'] + ); + request.api.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.updateApi(request), expectedError); + }); + }); + + describe('deleteApi', () => { + it('invokes deleteApi without error', async () => { + const client = new registryModule.v1.RegistryClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apigeeregistry.v1.DeleteApiRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.apigeeregistry.v1.DeleteApiRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.innerApiCalls.deleteApi = stubSimpleCall(expectedResponse); + const [response] = await client.deleteApi(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.deleteApi as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteApi as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteApi without error using callback', async () => { + const client = new registryModule.v1.RegistryClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apigeeregistry.v1.DeleteApiRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.apigeeregistry.v1.DeleteApiRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.innerApiCalls.deleteApi = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.deleteApi( + 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.deleteApi as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteApi as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteApi with error', async () => { + const client = new registryModule.v1.RegistryClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apigeeregistry.v1.DeleteApiRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.apigeeregistry.v1.DeleteApiRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteApi = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.deleteApi(request), expectedError); + const actualRequest = ( + client.innerApiCalls.deleteApi as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteApi as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteApi with closed client', async () => { + const client = new registryModule.v1.RegistryClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apigeeregistry.v1.DeleteApiRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.apigeeregistry.v1.DeleteApiRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.deleteApi(request), expectedError); + }); + }); + + describe('getApiVersion', () => { + it('invokes getApiVersion without error', async () => { + const client = new registryModule.v1.RegistryClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apigeeregistry.v1.GetApiVersionRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.apigeeregistry.v1.GetApiVersionRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.apigeeregistry.v1.ApiVersion() + ); + client.innerApiCalls.getApiVersion = stubSimpleCall(expectedResponse); + const [response] = await client.getApiVersion(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.getApiVersion as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getApiVersion as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getApiVersion without error using callback', async () => { + const client = new registryModule.v1.RegistryClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apigeeregistry.v1.GetApiVersionRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.apigeeregistry.v1.GetApiVersionRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.apigeeregistry.v1.ApiVersion() + ); + client.innerApiCalls.getApiVersion = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getApiVersion( + request, + ( + err?: Error | null, + result?: protos.google.cloud.apigeeregistry.v1.IApiVersion | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.getApiVersion as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getApiVersion as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getApiVersion with error', async () => { + const client = new registryModule.v1.RegistryClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apigeeregistry.v1.GetApiVersionRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.apigeeregistry.v1.GetApiVersionRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.getApiVersion = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.getApiVersion(request), expectedError); + const actualRequest = ( + client.innerApiCalls.getApiVersion as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getApiVersion as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getApiVersion with closed client', async () => { + const client = new registryModule.v1.RegistryClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apigeeregistry.v1.GetApiVersionRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.apigeeregistry.v1.GetApiVersionRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.getApiVersion(request), expectedError); + }); + }); + + describe('createApiVersion', () => { + it('invokes createApiVersion without error', async () => { + const client = new registryModule.v1.RegistryClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apigeeregistry.v1.CreateApiVersionRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.apigeeregistry.v1.CreateApiVersionRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.apigeeregistry.v1.ApiVersion() + ); + client.innerApiCalls.createApiVersion = stubSimpleCall(expectedResponse); + const [response] = await client.createApiVersion(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.createApiVersion as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createApiVersion as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createApiVersion without error using callback', async () => { + const client = new registryModule.v1.RegistryClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apigeeregistry.v1.CreateApiVersionRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.apigeeregistry.v1.CreateApiVersionRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.apigeeregistry.v1.ApiVersion() + ); + client.innerApiCalls.createApiVersion = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.createApiVersion( + request, + ( + err?: Error | null, + result?: protos.google.cloud.apigeeregistry.v1.IApiVersion | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.createApiVersion as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createApiVersion as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createApiVersion with error', async () => { + const client = new registryModule.v1.RegistryClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apigeeregistry.v1.CreateApiVersionRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.apigeeregistry.v1.CreateApiVersionRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.createApiVersion = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.createApiVersion(request), expectedError); + const actualRequest = ( + client.innerApiCalls.createApiVersion as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createApiVersion as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createApiVersion with closed client', async () => { + const client = new registryModule.v1.RegistryClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apigeeregistry.v1.CreateApiVersionRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.apigeeregistry.v1.CreateApiVersionRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.createApiVersion(request), expectedError); + }); + }); + + describe('updateApiVersion', () => { + it('invokes updateApiVersion without error', async () => { + const client = new registryModule.v1.RegistryClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apigeeregistry.v1.UpdateApiVersionRequest() + ); + request.apiVersion ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.apigeeregistry.v1.UpdateApiVersionRequest', + ['apiVersion', 'name'] + ); + request.apiVersion.name = defaultValue1; + const expectedHeaderRequestParams = `api_version.name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.apigeeregistry.v1.ApiVersion() + ); + client.innerApiCalls.updateApiVersion = stubSimpleCall(expectedResponse); + const [response] = await client.updateApiVersion(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.updateApiVersion as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateApiVersion as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateApiVersion without error using callback', async () => { + const client = new registryModule.v1.RegistryClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apigeeregistry.v1.UpdateApiVersionRequest() + ); + request.apiVersion ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.apigeeregistry.v1.UpdateApiVersionRequest', + ['apiVersion', 'name'] + ); + request.apiVersion.name = defaultValue1; + const expectedHeaderRequestParams = `api_version.name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.apigeeregistry.v1.ApiVersion() + ); + client.innerApiCalls.updateApiVersion = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.updateApiVersion( + request, + ( + err?: Error | null, + result?: protos.google.cloud.apigeeregistry.v1.IApiVersion | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.updateApiVersion as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateApiVersion as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateApiVersion with error', async () => { + const client = new registryModule.v1.RegistryClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apigeeregistry.v1.UpdateApiVersionRequest() + ); + request.apiVersion ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.apigeeregistry.v1.UpdateApiVersionRequest', + ['apiVersion', 'name'] + ); + request.apiVersion.name = defaultValue1; + const expectedHeaderRequestParams = `api_version.name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.updateApiVersion = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.updateApiVersion(request), expectedError); + const actualRequest = ( + client.innerApiCalls.updateApiVersion as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateApiVersion as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateApiVersion with closed client', async () => { + const client = new registryModule.v1.RegistryClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apigeeregistry.v1.UpdateApiVersionRequest() + ); + request.apiVersion ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.apigeeregistry.v1.UpdateApiVersionRequest', + ['apiVersion', 'name'] + ); + request.apiVersion.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.updateApiVersion(request), expectedError); + }); + }); + + describe('deleteApiVersion', () => { + it('invokes deleteApiVersion without error', async () => { + const client = new registryModule.v1.RegistryClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apigeeregistry.v1.DeleteApiVersionRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.apigeeregistry.v1.DeleteApiVersionRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.innerApiCalls.deleteApiVersion = stubSimpleCall(expectedResponse); + const [response] = await client.deleteApiVersion(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.deleteApiVersion as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteApiVersion as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteApiVersion without error using callback', async () => { + const client = new registryModule.v1.RegistryClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apigeeregistry.v1.DeleteApiVersionRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.apigeeregistry.v1.DeleteApiVersionRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.innerApiCalls.deleteApiVersion = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.deleteApiVersion( + 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.deleteApiVersion as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteApiVersion as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteApiVersion with error', async () => { + const client = new registryModule.v1.RegistryClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apigeeregistry.v1.DeleteApiVersionRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.apigeeregistry.v1.DeleteApiVersionRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteApiVersion = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.deleteApiVersion(request), expectedError); + const actualRequest = ( + client.innerApiCalls.deleteApiVersion as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteApiVersion as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteApiVersion with closed client', async () => { + const client = new registryModule.v1.RegistryClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apigeeregistry.v1.DeleteApiVersionRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.apigeeregistry.v1.DeleteApiVersionRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.deleteApiVersion(request), expectedError); + }); + }); + + describe('getApiSpec', () => { + it('invokes getApiSpec without error', async () => { + const client = new registryModule.v1.RegistryClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apigeeregistry.v1.GetApiSpecRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.apigeeregistry.v1.GetApiSpecRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.apigeeregistry.v1.ApiSpec() + ); + client.innerApiCalls.getApiSpec = stubSimpleCall(expectedResponse); + const [response] = await client.getApiSpec(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.getApiSpec as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getApiSpec as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getApiSpec without error using callback', async () => { + const client = new registryModule.v1.RegistryClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apigeeregistry.v1.GetApiSpecRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.apigeeregistry.v1.GetApiSpecRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.apigeeregistry.v1.ApiSpec() + ); + client.innerApiCalls.getApiSpec = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getApiSpec( + request, + ( + err?: Error | null, + result?: protos.google.cloud.apigeeregistry.v1.IApiSpec | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.getApiSpec as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getApiSpec as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getApiSpec with error', async () => { + const client = new registryModule.v1.RegistryClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apigeeregistry.v1.GetApiSpecRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.apigeeregistry.v1.GetApiSpecRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.getApiSpec = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.getApiSpec(request), expectedError); + const actualRequest = ( + client.innerApiCalls.getApiSpec as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getApiSpec as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getApiSpec with closed client', async () => { + const client = new registryModule.v1.RegistryClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apigeeregistry.v1.GetApiSpecRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.apigeeregistry.v1.GetApiSpecRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.getApiSpec(request), expectedError); + }); + }); + + describe('getApiSpecContents', () => { + it('invokes getApiSpecContents without error', async () => { + const client = new registryModule.v1.RegistryClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apigeeregistry.v1.GetApiSpecContentsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.apigeeregistry.v1.GetApiSpecContentsRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.api.HttpBody() + ); + client.innerApiCalls.getApiSpecContents = + stubSimpleCall(expectedResponse); + const [response] = await client.getApiSpecContents(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.getApiSpecContents as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getApiSpecContents as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getApiSpecContents without error using callback', async () => { + const client = new registryModule.v1.RegistryClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apigeeregistry.v1.GetApiSpecContentsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.apigeeregistry.v1.GetApiSpecContentsRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.api.HttpBody() + ); + client.innerApiCalls.getApiSpecContents = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getApiSpecContents( + request, + (err?: Error | null, result?: protos.google.api.IHttpBody | null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.getApiSpecContents as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getApiSpecContents as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getApiSpecContents with error', async () => { + const client = new registryModule.v1.RegistryClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apigeeregistry.v1.GetApiSpecContentsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.apigeeregistry.v1.GetApiSpecContentsRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.getApiSpecContents = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.getApiSpecContents(request), expectedError); + const actualRequest = ( + client.innerApiCalls.getApiSpecContents as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getApiSpecContents as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getApiSpecContents with closed client', async () => { + const client = new registryModule.v1.RegistryClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apigeeregistry.v1.GetApiSpecContentsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.apigeeregistry.v1.GetApiSpecContentsRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.getApiSpecContents(request), expectedError); + }); + }); + + describe('createApiSpec', () => { + it('invokes createApiSpec without error', async () => { + const client = new registryModule.v1.RegistryClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apigeeregistry.v1.CreateApiSpecRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.apigeeregistry.v1.CreateApiSpecRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.apigeeregistry.v1.ApiSpec() + ); + client.innerApiCalls.createApiSpec = stubSimpleCall(expectedResponse); + const [response] = await client.createApiSpec(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.createApiSpec as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createApiSpec as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createApiSpec without error using callback', async () => { + const client = new registryModule.v1.RegistryClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apigeeregistry.v1.CreateApiSpecRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.apigeeregistry.v1.CreateApiSpecRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.apigeeregistry.v1.ApiSpec() + ); + client.innerApiCalls.createApiSpec = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.createApiSpec( + request, + ( + err?: Error | null, + result?: protos.google.cloud.apigeeregistry.v1.IApiSpec | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.createApiSpec as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createApiSpec as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createApiSpec with error', async () => { + const client = new registryModule.v1.RegistryClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apigeeregistry.v1.CreateApiSpecRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.apigeeregistry.v1.CreateApiSpecRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.createApiSpec = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.createApiSpec(request), expectedError); + const actualRequest = ( + client.innerApiCalls.createApiSpec as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createApiSpec as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createApiSpec with closed client', async () => { + const client = new registryModule.v1.RegistryClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apigeeregistry.v1.CreateApiSpecRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.apigeeregistry.v1.CreateApiSpecRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.createApiSpec(request), expectedError); + }); + }); + + describe('updateApiSpec', () => { + it('invokes updateApiSpec without error', async () => { + const client = new registryModule.v1.RegistryClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apigeeregistry.v1.UpdateApiSpecRequest() + ); + request.apiSpec ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.apigeeregistry.v1.UpdateApiSpecRequest', + ['apiSpec', 'name'] + ); + request.apiSpec.name = defaultValue1; + const expectedHeaderRequestParams = `api_spec.name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.apigeeregistry.v1.ApiSpec() + ); + client.innerApiCalls.updateApiSpec = stubSimpleCall(expectedResponse); + const [response] = await client.updateApiSpec(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.updateApiSpec as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateApiSpec as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateApiSpec without error using callback', async () => { + const client = new registryModule.v1.RegistryClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apigeeregistry.v1.UpdateApiSpecRequest() + ); + request.apiSpec ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.apigeeregistry.v1.UpdateApiSpecRequest', + ['apiSpec', 'name'] + ); + request.apiSpec.name = defaultValue1; + const expectedHeaderRequestParams = `api_spec.name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.apigeeregistry.v1.ApiSpec() + ); + client.innerApiCalls.updateApiSpec = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.updateApiSpec( + request, + ( + err?: Error | null, + result?: protos.google.cloud.apigeeregistry.v1.IApiSpec | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.updateApiSpec as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateApiSpec as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateApiSpec with error', async () => { + const client = new registryModule.v1.RegistryClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apigeeregistry.v1.UpdateApiSpecRequest() + ); + request.apiSpec ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.apigeeregistry.v1.UpdateApiSpecRequest', + ['apiSpec', 'name'] + ); + request.apiSpec.name = defaultValue1; + const expectedHeaderRequestParams = `api_spec.name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.updateApiSpec = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.updateApiSpec(request), expectedError); + const actualRequest = ( + client.innerApiCalls.updateApiSpec as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateApiSpec as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateApiSpec with closed client', async () => { + const client = new registryModule.v1.RegistryClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apigeeregistry.v1.UpdateApiSpecRequest() + ); + request.apiSpec ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.apigeeregistry.v1.UpdateApiSpecRequest', + ['apiSpec', 'name'] + ); + request.apiSpec.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.updateApiSpec(request), expectedError); + }); + }); + + describe('deleteApiSpec', () => { + it('invokes deleteApiSpec without error', async () => { + const client = new registryModule.v1.RegistryClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apigeeregistry.v1.DeleteApiSpecRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.apigeeregistry.v1.DeleteApiSpecRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.innerApiCalls.deleteApiSpec = stubSimpleCall(expectedResponse); + const [response] = await client.deleteApiSpec(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.deleteApiSpec as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteApiSpec as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteApiSpec without error using callback', async () => { + const client = new registryModule.v1.RegistryClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apigeeregistry.v1.DeleteApiSpecRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.apigeeregistry.v1.DeleteApiSpecRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.innerApiCalls.deleteApiSpec = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.deleteApiSpec( + 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.deleteApiSpec as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteApiSpec as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteApiSpec with error', async () => { + const client = new registryModule.v1.RegistryClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apigeeregistry.v1.DeleteApiSpecRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.apigeeregistry.v1.DeleteApiSpecRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteApiSpec = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.deleteApiSpec(request), expectedError); + const actualRequest = ( + client.innerApiCalls.deleteApiSpec as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteApiSpec as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteApiSpec with closed client', async () => { + const client = new registryModule.v1.RegistryClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apigeeregistry.v1.DeleteApiSpecRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.apigeeregistry.v1.DeleteApiSpecRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.deleteApiSpec(request), expectedError); + }); + }); + + describe('tagApiSpecRevision', () => { + it('invokes tagApiSpecRevision without error', async () => { + const client = new registryModule.v1.RegistryClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apigeeregistry.v1.TagApiSpecRevisionRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.apigeeregistry.v1.TagApiSpecRevisionRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.apigeeregistry.v1.ApiSpec() + ); + client.innerApiCalls.tagApiSpecRevision = + stubSimpleCall(expectedResponse); + const [response] = await client.tagApiSpecRevision(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.tagApiSpecRevision as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.tagApiSpecRevision as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes tagApiSpecRevision without error using callback', async () => { + const client = new registryModule.v1.RegistryClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apigeeregistry.v1.TagApiSpecRevisionRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.apigeeregistry.v1.TagApiSpecRevisionRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.apigeeregistry.v1.ApiSpec() + ); + client.innerApiCalls.tagApiSpecRevision = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.tagApiSpecRevision( + request, + ( + err?: Error | null, + result?: protos.google.cloud.apigeeregistry.v1.IApiSpec | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.tagApiSpecRevision as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.tagApiSpecRevision as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes tagApiSpecRevision with error', async () => { + const client = new registryModule.v1.RegistryClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apigeeregistry.v1.TagApiSpecRevisionRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.apigeeregistry.v1.TagApiSpecRevisionRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.tagApiSpecRevision = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.tagApiSpecRevision(request), expectedError); + const actualRequest = ( + client.innerApiCalls.tagApiSpecRevision as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.tagApiSpecRevision as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes tagApiSpecRevision with closed client', async () => { + const client = new registryModule.v1.RegistryClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apigeeregistry.v1.TagApiSpecRevisionRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.apigeeregistry.v1.TagApiSpecRevisionRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.tagApiSpecRevision(request), expectedError); + }); + }); + + describe('rollbackApiSpec', () => { + it('invokes rollbackApiSpec without error', async () => { + const client = new registryModule.v1.RegistryClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apigeeregistry.v1.RollbackApiSpecRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.apigeeregistry.v1.RollbackApiSpecRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.apigeeregistry.v1.ApiSpec() + ); + client.innerApiCalls.rollbackApiSpec = stubSimpleCall(expectedResponse); + const [response] = await client.rollbackApiSpec(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.rollbackApiSpec as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.rollbackApiSpec as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes rollbackApiSpec without error using callback', async () => { + const client = new registryModule.v1.RegistryClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apigeeregistry.v1.RollbackApiSpecRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.apigeeregistry.v1.RollbackApiSpecRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.apigeeregistry.v1.ApiSpec() + ); + client.innerApiCalls.rollbackApiSpec = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.rollbackApiSpec( + request, + ( + err?: Error | null, + result?: protos.google.cloud.apigeeregistry.v1.IApiSpec | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.rollbackApiSpec as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.rollbackApiSpec as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes rollbackApiSpec with error', async () => { + const client = new registryModule.v1.RegistryClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apigeeregistry.v1.RollbackApiSpecRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.apigeeregistry.v1.RollbackApiSpecRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.rollbackApiSpec = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.rollbackApiSpec(request), expectedError); + const actualRequest = ( + client.innerApiCalls.rollbackApiSpec as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.rollbackApiSpec as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes rollbackApiSpec with closed client', async () => { + const client = new registryModule.v1.RegistryClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apigeeregistry.v1.RollbackApiSpecRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.apigeeregistry.v1.RollbackApiSpecRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.rollbackApiSpec(request), expectedError); + }); + }); + + describe('deleteApiSpecRevision', () => { + it('invokes deleteApiSpecRevision without error', async () => { + const client = new registryModule.v1.RegistryClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apigeeregistry.v1.DeleteApiSpecRevisionRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.apigeeregistry.v1.DeleteApiSpecRevisionRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.apigeeregistry.v1.ApiSpec() + ); + client.innerApiCalls.deleteApiSpecRevision = + stubSimpleCall(expectedResponse); + const [response] = await client.deleteApiSpecRevision(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.deleteApiSpecRevision as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteApiSpecRevision as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteApiSpecRevision without error using callback', async () => { + const client = new registryModule.v1.RegistryClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apigeeregistry.v1.DeleteApiSpecRevisionRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.apigeeregistry.v1.DeleteApiSpecRevisionRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.apigeeregistry.v1.ApiSpec() + ); + client.innerApiCalls.deleteApiSpecRevision = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.deleteApiSpecRevision( + request, + ( + err?: Error | null, + result?: protos.google.cloud.apigeeregistry.v1.IApiSpec | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.deleteApiSpecRevision as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteApiSpecRevision as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteApiSpecRevision with error', async () => { + const client = new registryModule.v1.RegistryClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apigeeregistry.v1.DeleteApiSpecRevisionRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.apigeeregistry.v1.DeleteApiSpecRevisionRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteApiSpecRevision = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects( + client.deleteApiSpecRevision(request), + expectedError + ); + const actualRequest = ( + client.innerApiCalls.deleteApiSpecRevision as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteApiSpecRevision as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteApiSpecRevision with closed client', async () => { + const client = new registryModule.v1.RegistryClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apigeeregistry.v1.DeleteApiSpecRevisionRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.apigeeregistry.v1.DeleteApiSpecRevisionRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects( + client.deleteApiSpecRevision(request), + expectedError + ); + }); + }); + + describe('getApiDeployment', () => { + it('invokes getApiDeployment without error', async () => { + const client = new registryModule.v1.RegistryClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apigeeregistry.v1.GetApiDeploymentRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.apigeeregistry.v1.GetApiDeploymentRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.apigeeregistry.v1.ApiDeployment() + ); + client.innerApiCalls.getApiDeployment = stubSimpleCall(expectedResponse); + const [response] = await client.getApiDeployment(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.getApiDeployment as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getApiDeployment as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getApiDeployment without error using callback', async () => { + const client = new registryModule.v1.RegistryClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apigeeregistry.v1.GetApiDeploymentRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.apigeeregistry.v1.GetApiDeploymentRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.apigeeregistry.v1.ApiDeployment() + ); + client.innerApiCalls.getApiDeployment = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getApiDeployment( + request, + ( + err?: Error | null, + result?: protos.google.cloud.apigeeregistry.v1.IApiDeployment | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.getApiDeployment as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getApiDeployment as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getApiDeployment with error', async () => { + const client = new registryModule.v1.RegistryClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apigeeregistry.v1.GetApiDeploymentRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.apigeeregistry.v1.GetApiDeploymentRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.getApiDeployment = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.getApiDeployment(request), expectedError); + const actualRequest = ( + client.innerApiCalls.getApiDeployment as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getApiDeployment as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getApiDeployment with closed client', async () => { + const client = new registryModule.v1.RegistryClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apigeeregistry.v1.GetApiDeploymentRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.apigeeregistry.v1.GetApiDeploymentRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.getApiDeployment(request), expectedError); + }); + }); + + describe('createApiDeployment', () => { + it('invokes createApiDeployment without error', async () => { + const client = new registryModule.v1.RegistryClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apigeeregistry.v1.CreateApiDeploymentRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.apigeeregistry.v1.CreateApiDeploymentRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.apigeeregistry.v1.ApiDeployment() + ); + client.innerApiCalls.createApiDeployment = + stubSimpleCall(expectedResponse); + const [response] = await client.createApiDeployment(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.createApiDeployment as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createApiDeployment as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createApiDeployment without error using callback', async () => { + const client = new registryModule.v1.RegistryClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apigeeregistry.v1.CreateApiDeploymentRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.apigeeregistry.v1.CreateApiDeploymentRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.apigeeregistry.v1.ApiDeployment() + ); + client.innerApiCalls.createApiDeployment = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.createApiDeployment( + request, + ( + err?: Error | null, + result?: protos.google.cloud.apigeeregistry.v1.IApiDeployment | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.createApiDeployment as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createApiDeployment as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createApiDeployment with error', async () => { + const client = new registryModule.v1.RegistryClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apigeeregistry.v1.CreateApiDeploymentRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.apigeeregistry.v1.CreateApiDeploymentRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.createApiDeployment = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.createApiDeployment(request), expectedError); + const actualRequest = ( + client.innerApiCalls.createApiDeployment as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createApiDeployment as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createApiDeployment with closed client', async () => { + const client = new registryModule.v1.RegistryClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apigeeregistry.v1.CreateApiDeploymentRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.apigeeregistry.v1.CreateApiDeploymentRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.createApiDeployment(request), expectedError); + }); + }); + + describe('updateApiDeployment', () => { + it('invokes updateApiDeployment without error', async () => { + const client = new registryModule.v1.RegistryClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apigeeregistry.v1.UpdateApiDeploymentRequest() + ); + request.apiDeployment ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.apigeeregistry.v1.UpdateApiDeploymentRequest', + ['apiDeployment', 'name'] + ); + request.apiDeployment.name = defaultValue1; + const expectedHeaderRequestParams = `api_deployment.name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.apigeeregistry.v1.ApiDeployment() + ); + client.innerApiCalls.updateApiDeployment = + stubSimpleCall(expectedResponse); + const [response] = await client.updateApiDeployment(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.updateApiDeployment as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateApiDeployment as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateApiDeployment without error using callback', async () => { + const client = new registryModule.v1.RegistryClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apigeeregistry.v1.UpdateApiDeploymentRequest() + ); + request.apiDeployment ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.apigeeregistry.v1.UpdateApiDeploymentRequest', + ['apiDeployment', 'name'] + ); + request.apiDeployment.name = defaultValue1; + const expectedHeaderRequestParams = `api_deployment.name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.apigeeregistry.v1.ApiDeployment() + ); + client.innerApiCalls.updateApiDeployment = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.updateApiDeployment( + request, + ( + err?: Error | null, + result?: protos.google.cloud.apigeeregistry.v1.IApiDeployment | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.updateApiDeployment as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateApiDeployment as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateApiDeployment with error', async () => { + const client = new registryModule.v1.RegistryClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apigeeregistry.v1.UpdateApiDeploymentRequest() + ); + request.apiDeployment ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.apigeeregistry.v1.UpdateApiDeploymentRequest', + ['apiDeployment', 'name'] + ); + request.apiDeployment.name = defaultValue1; + const expectedHeaderRequestParams = `api_deployment.name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.updateApiDeployment = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.updateApiDeployment(request), expectedError); + const actualRequest = ( + client.innerApiCalls.updateApiDeployment as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateApiDeployment as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateApiDeployment with closed client', async () => { + const client = new registryModule.v1.RegistryClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apigeeregistry.v1.UpdateApiDeploymentRequest() + ); + request.apiDeployment ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.apigeeregistry.v1.UpdateApiDeploymentRequest', + ['apiDeployment', 'name'] + ); + request.apiDeployment.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.updateApiDeployment(request), expectedError); + }); + }); + + describe('deleteApiDeployment', () => { + it('invokes deleteApiDeployment without error', async () => { + const client = new registryModule.v1.RegistryClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apigeeregistry.v1.DeleteApiDeploymentRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.apigeeregistry.v1.DeleteApiDeploymentRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.innerApiCalls.deleteApiDeployment = + stubSimpleCall(expectedResponse); + const [response] = await client.deleteApiDeployment(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.deleteApiDeployment as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteApiDeployment as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteApiDeployment without error using callback', async () => { + const client = new registryModule.v1.RegistryClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apigeeregistry.v1.DeleteApiDeploymentRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.apigeeregistry.v1.DeleteApiDeploymentRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.innerApiCalls.deleteApiDeployment = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.deleteApiDeployment( + 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.deleteApiDeployment as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteApiDeployment as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteApiDeployment with error', async () => { + const client = new registryModule.v1.RegistryClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apigeeregistry.v1.DeleteApiDeploymentRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.apigeeregistry.v1.DeleteApiDeploymentRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteApiDeployment = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.deleteApiDeployment(request), expectedError); + const actualRequest = ( + client.innerApiCalls.deleteApiDeployment as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteApiDeployment as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteApiDeployment with closed client', async () => { + const client = new registryModule.v1.RegistryClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apigeeregistry.v1.DeleteApiDeploymentRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.apigeeregistry.v1.DeleteApiDeploymentRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.deleteApiDeployment(request), expectedError); + }); + }); + + describe('tagApiDeploymentRevision', () => { + it('invokes tagApiDeploymentRevision without error', async () => { + const client = new registryModule.v1.RegistryClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apigeeregistry.v1.TagApiDeploymentRevisionRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.apigeeregistry.v1.TagApiDeploymentRevisionRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.apigeeregistry.v1.ApiDeployment() + ); + client.innerApiCalls.tagApiDeploymentRevision = + stubSimpleCall(expectedResponse); + const [response] = await client.tagApiDeploymentRevision(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.tagApiDeploymentRevision as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.tagApiDeploymentRevision as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes tagApiDeploymentRevision without error using callback', async () => { + const client = new registryModule.v1.RegistryClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apigeeregistry.v1.TagApiDeploymentRevisionRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.apigeeregistry.v1.TagApiDeploymentRevisionRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.apigeeregistry.v1.ApiDeployment() + ); + client.innerApiCalls.tagApiDeploymentRevision = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.tagApiDeploymentRevision( + request, + ( + err?: Error | null, + result?: protos.google.cloud.apigeeregistry.v1.IApiDeployment | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.tagApiDeploymentRevision as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.tagApiDeploymentRevision as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes tagApiDeploymentRevision with error', async () => { + const client = new registryModule.v1.RegistryClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apigeeregistry.v1.TagApiDeploymentRevisionRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.apigeeregistry.v1.TagApiDeploymentRevisionRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.tagApiDeploymentRevision = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects( + client.tagApiDeploymentRevision(request), + expectedError + ); + const actualRequest = ( + client.innerApiCalls.tagApiDeploymentRevision as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.tagApiDeploymentRevision as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes tagApiDeploymentRevision with closed client', async () => { + const client = new registryModule.v1.RegistryClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apigeeregistry.v1.TagApiDeploymentRevisionRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.apigeeregistry.v1.TagApiDeploymentRevisionRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects( + client.tagApiDeploymentRevision(request), + expectedError + ); + }); + }); + + describe('rollbackApiDeployment', () => { + it('invokes rollbackApiDeployment without error', async () => { + const client = new registryModule.v1.RegistryClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apigeeregistry.v1.RollbackApiDeploymentRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.apigeeregistry.v1.RollbackApiDeploymentRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.apigeeregistry.v1.ApiDeployment() + ); + client.innerApiCalls.rollbackApiDeployment = + stubSimpleCall(expectedResponse); + const [response] = await client.rollbackApiDeployment(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.rollbackApiDeployment as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.rollbackApiDeployment as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes rollbackApiDeployment without error using callback', async () => { + const client = new registryModule.v1.RegistryClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apigeeregistry.v1.RollbackApiDeploymentRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.apigeeregistry.v1.RollbackApiDeploymentRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.apigeeregistry.v1.ApiDeployment() + ); + client.innerApiCalls.rollbackApiDeployment = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.rollbackApiDeployment( + request, + ( + err?: Error | null, + result?: protos.google.cloud.apigeeregistry.v1.IApiDeployment | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.rollbackApiDeployment as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.rollbackApiDeployment as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes rollbackApiDeployment with error', async () => { + const client = new registryModule.v1.RegistryClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apigeeregistry.v1.RollbackApiDeploymentRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.apigeeregistry.v1.RollbackApiDeploymentRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.rollbackApiDeployment = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects( + client.rollbackApiDeployment(request), + expectedError + ); + const actualRequest = ( + client.innerApiCalls.rollbackApiDeployment as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.rollbackApiDeployment as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes rollbackApiDeployment with closed client', async () => { + const client = new registryModule.v1.RegistryClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apigeeregistry.v1.RollbackApiDeploymentRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.apigeeregistry.v1.RollbackApiDeploymentRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects( + client.rollbackApiDeployment(request), + expectedError + ); + }); + }); + + describe('deleteApiDeploymentRevision', () => { + it('invokes deleteApiDeploymentRevision without error', async () => { + const client = new registryModule.v1.RegistryClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apigeeregistry.v1.DeleteApiDeploymentRevisionRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.apigeeregistry.v1.DeleteApiDeploymentRevisionRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.apigeeregistry.v1.ApiDeployment() + ); + client.innerApiCalls.deleteApiDeploymentRevision = + stubSimpleCall(expectedResponse); + const [response] = await client.deleteApiDeploymentRevision(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.deleteApiDeploymentRevision as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteApiDeploymentRevision as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteApiDeploymentRevision without error using callback', async () => { + const client = new registryModule.v1.RegistryClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apigeeregistry.v1.DeleteApiDeploymentRevisionRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.apigeeregistry.v1.DeleteApiDeploymentRevisionRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.apigeeregistry.v1.ApiDeployment() + ); + client.innerApiCalls.deleteApiDeploymentRevision = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.deleteApiDeploymentRevision( + request, + ( + err?: Error | null, + result?: protos.google.cloud.apigeeregistry.v1.IApiDeployment | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.deleteApiDeploymentRevision as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteApiDeploymentRevision as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteApiDeploymentRevision with error', async () => { + const client = new registryModule.v1.RegistryClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apigeeregistry.v1.DeleteApiDeploymentRevisionRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.apigeeregistry.v1.DeleteApiDeploymentRevisionRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteApiDeploymentRevision = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects( + client.deleteApiDeploymentRevision(request), + expectedError + ); + const actualRequest = ( + client.innerApiCalls.deleteApiDeploymentRevision as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteApiDeploymentRevision as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteApiDeploymentRevision with closed client', async () => { + const client = new registryModule.v1.RegistryClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apigeeregistry.v1.DeleteApiDeploymentRevisionRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.apigeeregistry.v1.DeleteApiDeploymentRevisionRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects( + client.deleteApiDeploymentRevision(request), + expectedError + ); + }); + }); + + describe('getArtifact', () => { + it('invokes getArtifact without error', async () => { + const client = new registryModule.v1.RegistryClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apigeeregistry.v1.GetArtifactRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.apigeeregistry.v1.GetArtifactRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.apigeeregistry.v1.Artifact() + ); + client.innerApiCalls.getArtifact = stubSimpleCall(expectedResponse); + const [response] = await client.getArtifact(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.getArtifact as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getArtifact as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getArtifact without error using callback', async () => { + const client = new registryModule.v1.RegistryClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apigeeregistry.v1.GetArtifactRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.apigeeregistry.v1.GetArtifactRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.apigeeregistry.v1.Artifact() + ); + client.innerApiCalls.getArtifact = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getArtifact( + request, + ( + err?: Error | null, + result?: protos.google.cloud.apigeeregistry.v1.IArtifact | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.getArtifact as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getArtifact as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getArtifact with error', async () => { + const client = new registryModule.v1.RegistryClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apigeeregistry.v1.GetArtifactRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.apigeeregistry.v1.GetArtifactRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.getArtifact = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.getArtifact(request), expectedError); + const actualRequest = ( + client.innerApiCalls.getArtifact as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getArtifact as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getArtifact with closed client', async () => { + const client = new registryModule.v1.RegistryClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apigeeregistry.v1.GetArtifactRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.apigeeregistry.v1.GetArtifactRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.getArtifact(request), expectedError); + }); + }); + + describe('getArtifactContents', () => { + it('invokes getArtifactContents without error', async () => { + const client = new registryModule.v1.RegistryClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apigeeregistry.v1.GetArtifactContentsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.apigeeregistry.v1.GetArtifactContentsRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.api.HttpBody() + ); + client.innerApiCalls.getArtifactContents = + stubSimpleCall(expectedResponse); + const [response] = await client.getArtifactContents(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.getArtifactContents as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getArtifactContents as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getArtifactContents without error using callback', async () => { + const client = new registryModule.v1.RegistryClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apigeeregistry.v1.GetArtifactContentsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.apigeeregistry.v1.GetArtifactContentsRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.api.HttpBody() + ); + client.innerApiCalls.getArtifactContents = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getArtifactContents( + request, + (err?: Error | null, result?: protos.google.api.IHttpBody | null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.getArtifactContents as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getArtifactContents as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getArtifactContents with error', async () => { + const client = new registryModule.v1.RegistryClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apigeeregistry.v1.GetArtifactContentsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.apigeeregistry.v1.GetArtifactContentsRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.getArtifactContents = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.getArtifactContents(request), expectedError); + const actualRequest = ( + client.innerApiCalls.getArtifactContents as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getArtifactContents as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getArtifactContents with closed client', async () => { + const client = new registryModule.v1.RegistryClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apigeeregistry.v1.GetArtifactContentsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.apigeeregistry.v1.GetArtifactContentsRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.getArtifactContents(request), expectedError); + }); + }); + + describe('createArtifact', () => { + it('invokes createArtifact without error', async () => { + const client = new registryModule.v1.RegistryClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apigeeregistry.v1.CreateArtifactRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.apigeeregistry.v1.CreateArtifactRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.apigeeregistry.v1.Artifact() + ); + client.innerApiCalls.createArtifact = stubSimpleCall(expectedResponse); + const [response] = await client.createArtifact(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.createArtifact as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createArtifact as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createArtifact without error using callback', async () => { + const client = new registryModule.v1.RegistryClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apigeeregistry.v1.CreateArtifactRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.apigeeregistry.v1.CreateArtifactRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.apigeeregistry.v1.Artifact() + ); + client.innerApiCalls.createArtifact = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.createArtifact( + request, + ( + err?: Error | null, + result?: protos.google.cloud.apigeeregistry.v1.IArtifact | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.createArtifact as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createArtifact as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createArtifact with error', async () => { + const client = new registryModule.v1.RegistryClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apigeeregistry.v1.CreateArtifactRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.apigeeregistry.v1.CreateArtifactRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.createArtifact = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.createArtifact(request), expectedError); + const actualRequest = ( + client.innerApiCalls.createArtifact as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createArtifact as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createArtifact with closed client', async () => { + const client = new registryModule.v1.RegistryClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apigeeregistry.v1.CreateArtifactRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.apigeeregistry.v1.CreateArtifactRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.createArtifact(request), expectedError); + }); + }); + + describe('replaceArtifact', () => { + it('invokes replaceArtifact without error', async () => { + const client = new registryModule.v1.RegistryClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apigeeregistry.v1.ReplaceArtifactRequest() + ); + request.artifact ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.apigeeregistry.v1.ReplaceArtifactRequest', + ['artifact', 'name'] + ); + request.artifact.name = defaultValue1; + const expectedHeaderRequestParams = `artifact.name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.apigeeregistry.v1.Artifact() + ); + client.innerApiCalls.replaceArtifact = stubSimpleCall(expectedResponse); + const [response] = await client.replaceArtifact(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.replaceArtifact as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.replaceArtifact as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes replaceArtifact without error using callback', async () => { + const client = new registryModule.v1.RegistryClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apigeeregistry.v1.ReplaceArtifactRequest() + ); + request.artifact ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.apigeeregistry.v1.ReplaceArtifactRequest', + ['artifact', 'name'] + ); + request.artifact.name = defaultValue1; + const expectedHeaderRequestParams = `artifact.name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.apigeeregistry.v1.Artifact() + ); + client.innerApiCalls.replaceArtifact = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.replaceArtifact( + request, + ( + err?: Error | null, + result?: protos.google.cloud.apigeeregistry.v1.IArtifact | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.replaceArtifact as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.replaceArtifact as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes replaceArtifact with error', async () => { + const client = new registryModule.v1.RegistryClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apigeeregistry.v1.ReplaceArtifactRequest() + ); + request.artifact ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.apigeeregistry.v1.ReplaceArtifactRequest', + ['artifact', 'name'] + ); + request.artifact.name = defaultValue1; + const expectedHeaderRequestParams = `artifact.name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.replaceArtifact = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.replaceArtifact(request), expectedError); + const actualRequest = ( + client.innerApiCalls.replaceArtifact as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.replaceArtifact as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes replaceArtifact with closed client', async () => { + const client = new registryModule.v1.RegistryClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apigeeregistry.v1.ReplaceArtifactRequest() + ); + request.artifact ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.apigeeregistry.v1.ReplaceArtifactRequest', + ['artifact', 'name'] + ); + request.artifact.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.replaceArtifact(request), expectedError); + }); + }); + + describe('deleteArtifact', () => { + it('invokes deleteArtifact without error', async () => { + const client = new registryModule.v1.RegistryClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apigeeregistry.v1.DeleteArtifactRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.apigeeregistry.v1.DeleteArtifactRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.innerApiCalls.deleteArtifact = stubSimpleCall(expectedResponse); + const [response] = await client.deleteArtifact(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.deleteArtifact as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteArtifact as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteArtifact without error using callback', async () => { + const client = new registryModule.v1.RegistryClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apigeeregistry.v1.DeleteArtifactRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.apigeeregistry.v1.DeleteArtifactRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.innerApiCalls.deleteArtifact = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.deleteArtifact( + 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.deleteArtifact as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteArtifact as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteArtifact with error', async () => { + const client = new registryModule.v1.RegistryClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apigeeregistry.v1.DeleteArtifactRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.apigeeregistry.v1.DeleteArtifactRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteArtifact = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.deleteArtifact(request), expectedError); + const actualRequest = ( + client.innerApiCalls.deleteArtifact as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteArtifact as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteArtifact with closed client', async () => { + const client = new registryModule.v1.RegistryClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apigeeregistry.v1.DeleteArtifactRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.apigeeregistry.v1.DeleteArtifactRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.deleteArtifact(request), expectedError); + }); + }); + + describe('listApis', () => { + it('invokes listApis without error', async () => { + const client = new registryModule.v1.RegistryClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apigeeregistry.v1.ListApisRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.apigeeregistry.v1.ListApisRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.apigeeregistry.v1.Api()), + generateSampleMessage(new protos.google.cloud.apigeeregistry.v1.Api()), + generateSampleMessage(new protos.google.cloud.apigeeregistry.v1.Api()), + ]; + client.innerApiCalls.listApis = stubSimpleCall(expectedResponse); + const [response] = await client.listApis(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.listApis as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listApis as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listApis without error using callback', async () => { + const client = new registryModule.v1.RegistryClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apigeeregistry.v1.ListApisRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.apigeeregistry.v1.ListApisRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.apigeeregistry.v1.Api()), + generateSampleMessage(new protos.google.cloud.apigeeregistry.v1.Api()), + generateSampleMessage(new protos.google.cloud.apigeeregistry.v1.Api()), + ]; + client.innerApiCalls.listApis = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.listApis( + request, + ( + err?: Error | null, + result?: protos.google.cloud.apigeeregistry.v1.IApi[] | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.listApis as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listApis as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listApis with error', async () => { + const client = new registryModule.v1.RegistryClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apigeeregistry.v1.ListApisRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.apigeeregistry.v1.ListApisRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.listApis = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.listApis(request), expectedError); + const actualRequest = ( + client.innerApiCalls.listApis as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listApis as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listApisStream without error', async () => { + const client = new registryModule.v1.RegistryClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apigeeregistry.v1.ListApisRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.apigeeregistry.v1.ListApisRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.apigeeregistry.v1.Api()), + generateSampleMessage(new protos.google.cloud.apigeeregistry.v1.Api()), + generateSampleMessage(new protos.google.cloud.apigeeregistry.v1.Api()), + ]; + client.descriptors.page.listApis.createStream = + stubPageStreamingCall(expectedResponse); + const stream = client.listApisStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.apigeeregistry.v1.Api[] = []; + stream.on( + 'data', + (response: protos.google.cloud.apigeeregistry.v1.Api) => { + 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.listApis.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.listApis, request) + ); + assert( + (client.descriptors.page.listApis.createStream as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('invokes listApisStream with error', async () => { + const client = new registryModule.v1.RegistryClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apigeeregistry.v1.ListApisRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.apigeeregistry.v1.ListApisRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.descriptors.page.listApis.createStream = stubPageStreamingCall( + undefined, + expectedError + ); + const stream = client.listApisStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.apigeeregistry.v1.Api[] = []; + stream.on( + 'data', + (response: protos.google.cloud.apigeeregistry.v1.Api) => { + responses.push(response); + } + ); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert( + (client.descriptors.page.listApis.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.listApis, request) + ); + assert( + (client.descriptors.page.listApis.createStream as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listApis without error', async () => { + const client = new registryModule.v1.RegistryClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apigeeregistry.v1.ListApisRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.apigeeregistry.v1.ListApisRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.apigeeregistry.v1.Api()), + generateSampleMessage(new protos.google.cloud.apigeeregistry.v1.Api()), + generateSampleMessage(new protos.google.cloud.apigeeregistry.v1.Api()), + ]; + client.descriptors.page.listApis.asyncIterate = + stubAsyncIterationCall(expectedResponse); + const responses: protos.google.cloud.apigeeregistry.v1.IApi[] = []; + const iterable = client.listApisAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + (client.descriptors.page.listApis.asyncIterate as SinonStub).getCall(0) + .args[1], + request + ); + assert( + (client.descriptors.page.listApis.asyncIterate as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listApis with error', async () => { + const client = new registryModule.v1.RegistryClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apigeeregistry.v1.ListApisRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.apigeeregistry.v1.ListApisRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.descriptors.page.listApis.asyncIterate = stubAsyncIterationCall( + undefined, + expectedError + ); + const iterable = client.listApisAsync(request); + await assert.rejects(async () => { + const responses: protos.google.cloud.apigeeregistry.v1.IApi[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + (client.descriptors.page.listApis.asyncIterate as SinonStub).getCall(0) + .args[1], + request + ); + assert( + (client.descriptors.page.listApis.asyncIterate as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + }); + + describe('listApiVersions', () => { + it('invokes listApiVersions without error', async () => { + const client = new registryModule.v1.RegistryClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apigeeregistry.v1.ListApiVersionsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.apigeeregistry.v1.ListApiVersionsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.apigeeregistry.v1.ApiVersion() + ), + generateSampleMessage( + new protos.google.cloud.apigeeregistry.v1.ApiVersion() + ), + generateSampleMessage( + new protos.google.cloud.apigeeregistry.v1.ApiVersion() + ), + ]; + client.innerApiCalls.listApiVersions = stubSimpleCall(expectedResponse); + const [response] = await client.listApiVersions(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.listApiVersions as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listApiVersions as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listApiVersions without error using callback', async () => { + const client = new registryModule.v1.RegistryClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apigeeregistry.v1.ListApiVersionsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.apigeeregistry.v1.ListApiVersionsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.apigeeregistry.v1.ApiVersion() + ), + generateSampleMessage( + new protos.google.cloud.apigeeregistry.v1.ApiVersion() + ), + generateSampleMessage( + new protos.google.cloud.apigeeregistry.v1.ApiVersion() + ), + ]; + client.innerApiCalls.listApiVersions = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.listApiVersions( + request, + ( + err?: Error | null, + result?: protos.google.cloud.apigeeregistry.v1.IApiVersion[] | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.listApiVersions as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listApiVersions as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listApiVersions with error', async () => { + const client = new registryModule.v1.RegistryClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apigeeregistry.v1.ListApiVersionsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.apigeeregistry.v1.ListApiVersionsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.listApiVersions = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.listApiVersions(request), expectedError); + const actualRequest = ( + client.innerApiCalls.listApiVersions as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listApiVersions as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listApiVersionsStream without error', async () => { + const client = new registryModule.v1.RegistryClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apigeeregistry.v1.ListApiVersionsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.apigeeregistry.v1.ListApiVersionsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.apigeeregistry.v1.ApiVersion() + ), + generateSampleMessage( + new protos.google.cloud.apigeeregistry.v1.ApiVersion() + ), + generateSampleMessage( + new protos.google.cloud.apigeeregistry.v1.ApiVersion() + ), + ]; + client.descriptors.page.listApiVersions.createStream = + stubPageStreamingCall(expectedResponse); + const stream = client.listApiVersionsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.apigeeregistry.v1.ApiVersion[] = + []; + stream.on( + 'data', + (response: protos.google.cloud.apigeeregistry.v1.ApiVersion) => { + 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.listApiVersions.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.listApiVersions, request) + ); + assert( + (client.descriptors.page.listApiVersions.createStream as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('invokes listApiVersionsStream with error', async () => { + const client = new registryModule.v1.RegistryClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apigeeregistry.v1.ListApiVersionsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.apigeeregistry.v1.ListApiVersionsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.descriptors.page.listApiVersions.createStream = + stubPageStreamingCall(undefined, expectedError); + const stream = client.listApiVersionsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.apigeeregistry.v1.ApiVersion[] = + []; + stream.on( + 'data', + (response: protos.google.cloud.apigeeregistry.v1.ApiVersion) => { + responses.push(response); + } + ); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert( + (client.descriptors.page.listApiVersions.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.listApiVersions, request) + ); + assert( + (client.descriptors.page.listApiVersions.createStream as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listApiVersions without error', async () => { + const client = new registryModule.v1.RegistryClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apigeeregistry.v1.ListApiVersionsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.apigeeregistry.v1.ListApiVersionsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.apigeeregistry.v1.ApiVersion() + ), + generateSampleMessage( + new protos.google.cloud.apigeeregistry.v1.ApiVersion() + ), + generateSampleMessage( + new protos.google.cloud.apigeeregistry.v1.ApiVersion() + ), + ]; + client.descriptors.page.listApiVersions.asyncIterate = + stubAsyncIterationCall(expectedResponse); + const responses: protos.google.cloud.apigeeregistry.v1.IApiVersion[] = []; + const iterable = client.listApiVersionsAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + ( + client.descriptors.page.listApiVersions.asyncIterate as SinonStub + ).getCall(0).args[1], + request + ); + assert( + (client.descriptors.page.listApiVersions.asyncIterate as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listApiVersions with error', async () => { + const client = new registryModule.v1.RegistryClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apigeeregistry.v1.ListApiVersionsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.apigeeregistry.v1.ListApiVersionsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.descriptors.page.listApiVersions.asyncIterate = + stubAsyncIterationCall(undefined, expectedError); + const iterable = client.listApiVersionsAsync(request); + await assert.rejects(async () => { + const responses: protos.google.cloud.apigeeregistry.v1.IApiVersion[] = + []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + ( + client.descriptors.page.listApiVersions.asyncIterate as SinonStub + ).getCall(0).args[1], + request + ); + assert( + (client.descriptors.page.listApiVersions.asyncIterate as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + }); + + describe('listApiSpecs', () => { + it('invokes listApiSpecs without error', async () => { + const client = new registryModule.v1.RegistryClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apigeeregistry.v1.ListApiSpecsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.apigeeregistry.v1.ListApiSpecsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.apigeeregistry.v1.ApiSpec() + ), + generateSampleMessage( + new protos.google.cloud.apigeeregistry.v1.ApiSpec() + ), + generateSampleMessage( + new protos.google.cloud.apigeeregistry.v1.ApiSpec() + ), + ]; + client.innerApiCalls.listApiSpecs = stubSimpleCall(expectedResponse); + const [response] = await client.listApiSpecs(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.listApiSpecs as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listApiSpecs as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listApiSpecs without error using callback', async () => { + const client = new registryModule.v1.RegistryClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apigeeregistry.v1.ListApiSpecsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.apigeeregistry.v1.ListApiSpecsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.apigeeregistry.v1.ApiSpec() + ), + generateSampleMessage( + new protos.google.cloud.apigeeregistry.v1.ApiSpec() + ), + generateSampleMessage( + new protos.google.cloud.apigeeregistry.v1.ApiSpec() + ), + ]; + client.innerApiCalls.listApiSpecs = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.listApiSpecs( + request, + ( + err?: Error | null, + result?: protos.google.cloud.apigeeregistry.v1.IApiSpec[] | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.listApiSpecs as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listApiSpecs as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listApiSpecs with error', async () => { + const client = new registryModule.v1.RegistryClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apigeeregistry.v1.ListApiSpecsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.apigeeregistry.v1.ListApiSpecsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.listApiSpecs = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.listApiSpecs(request), expectedError); + const actualRequest = ( + client.innerApiCalls.listApiSpecs as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listApiSpecs as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listApiSpecsStream without error', async () => { + const client = new registryModule.v1.RegistryClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apigeeregistry.v1.ListApiSpecsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.apigeeregistry.v1.ListApiSpecsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.apigeeregistry.v1.ApiSpec() + ), + generateSampleMessage( + new protos.google.cloud.apigeeregistry.v1.ApiSpec() + ), + generateSampleMessage( + new protos.google.cloud.apigeeregistry.v1.ApiSpec() + ), + ]; + client.descriptors.page.listApiSpecs.createStream = + stubPageStreamingCall(expectedResponse); + const stream = client.listApiSpecsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.apigeeregistry.v1.ApiSpec[] = []; + stream.on( + 'data', + (response: protos.google.cloud.apigeeregistry.v1.ApiSpec) => { + 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.listApiSpecs.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.listApiSpecs, request) + ); + assert( + (client.descriptors.page.listApiSpecs.createStream as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('invokes listApiSpecsStream with error', async () => { + const client = new registryModule.v1.RegistryClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apigeeregistry.v1.ListApiSpecsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.apigeeregistry.v1.ListApiSpecsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.descriptors.page.listApiSpecs.createStream = stubPageStreamingCall( + undefined, + expectedError + ); + const stream = client.listApiSpecsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.apigeeregistry.v1.ApiSpec[] = []; + stream.on( + 'data', + (response: protos.google.cloud.apigeeregistry.v1.ApiSpec) => { + responses.push(response); + } + ); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert( + (client.descriptors.page.listApiSpecs.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.listApiSpecs, request) + ); + assert( + (client.descriptors.page.listApiSpecs.createStream as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listApiSpecs without error', async () => { + const client = new registryModule.v1.RegistryClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apigeeregistry.v1.ListApiSpecsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.apigeeregistry.v1.ListApiSpecsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.apigeeregistry.v1.ApiSpec() + ), + generateSampleMessage( + new protos.google.cloud.apigeeregistry.v1.ApiSpec() + ), + generateSampleMessage( + new protos.google.cloud.apigeeregistry.v1.ApiSpec() + ), + ]; + client.descriptors.page.listApiSpecs.asyncIterate = + stubAsyncIterationCall(expectedResponse); + const responses: protos.google.cloud.apigeeregistry.v1.IApiSpec[] = []; + const iterable = client.listApiSpecsAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + ( + client.descriptors.page.listApiSpecs.asyncIterate as SinonStub + ).getCall(0).args[1], + request + ); + assert( + (client.descriptors.page.listApiSpecs.asyncIterate as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listApiSpecs with error', async () => { + const client = new registryModule.v1.RegistryClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apigeeregistry.v1.ListApiSpecsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.apigeeregistry.v1.ListApiSpecsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.descriptors.page.listApiSpecs.asyncIterate = + stubAsyncIterationCall(undefined, expectedError); + const iterable = client.listApiSpecsAsync(request); + await assert.rejects(async () => { + const responses: protos.google.cloud.apigeeregistry.v1.IApiSpec[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + ( + client.descriptors.page.listApiSpecs.asyncIterate as SinonStub + ).getCall(0).args[1], + request + ); + assert( + (client.descriptors.page.listApiSpecs.asyncIterate as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + }); + + describe('listApiSpecRevisions', () => { + it('invokes listApiSpecRevisions without error', async () => { + const client = new registryModule.v1.RegistryClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apigeeregistry.v1.ListApiSpecRevisionsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.apigeeregistry.v1.ListApiSpecRevisionsRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.apigeeregistry.v1.ApiSpec() + ), + generateSampleMessage( + new protos.google.cloud.apigeeregistry.v1.ApiSpec() + ), + generateSampleMessage( + new protos.google.cloud.apigeeregistry.v1.ApiSpec() + ), + ]; + client.innerApiCalls.listApiSpecRevisions = + stubSimpleCall(expectedResponse); + const [response] = await client.listApiSpecRevisions(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.listApiSpecRevisions as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listApiSpecRevisions as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listApiSpecRevisions without error using callback', async () => { + const client = new registryModule.v1.RegistryClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apigeeregistry.v1.ListApiSpecRevisionsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.apigeeregistry.v1.ListApiSpecRevisionsRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.apigeeregistry.v1.ApiSpec() + ), + generateSampleMessage( + new protos.google.cloud.apigeeregistry.v1.ApiSpec() + ), + generateSampleMessage( + new protos.google.cloud.apigeeregistry.v1.ApiSpec() + ), + ]; + client.innerApiCalls.listApiSpecRevisions = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.listApiSpecRevisions( + request, + ( + err?: Error | null, + result?: protos.google.cloud.apigeeregistry.v1.IApiSpec[] | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.listApiSpecRevisions as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listApiSpecRevisions as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listApiSpecRevisions with error', async () => { + const client = new registryModule.v1.RegistryClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apigeeregistry.v1.ListApiSpecRevisionsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.apigeeregistry.v1.ListApiSpecRevisionsRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.listApiSpecRevisions = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.listApiSpecRevisions(request), expectedError); + const actualRequest = ( + client.innerApiCalls.listApiSpecRevisions as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listApiSpecRevisions as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listApiSpecRevisionsStream without error', async () => { + const client = new registryModule.v1.RegistryClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apigeeregistry.v1.ListApiSpecRevisionsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.apigeeregistry.v1.ListApiSpecRevisionsRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.apigeeregistry.v1.ApiSpec() + ), + generateSampleMessage( + new protos.google.cloud.apigeeregistry.v1.ApiSpec() + ), + generateSampleMessage( + new protos.google.cloud.apigeeregistry.v1.ApiSpec() + ), + ]; + client.descriptors.page.listApiSpecRevisions.createStream = + stubPageStreamingCall(expectedResponse); + const stream = client.listApiSpecRevisionsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.apigeeregistry.v1.ApiSpec[] = []; + stream.on( + 'data', + (response: protos.google.cloud.apigeeregistry.v1.ApiSpec) => { + 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.listApiSpecRevisions.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.listApiSpecRevisions, request) + ); + assert( + (client.descriptors.page.listApiSpecRevisions.createStream as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('invokes listApiSpecRevisionsStream with error', async () => { + const client = new registryModule.v1.RegistryClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apigeeregistry.v1.ListApiSpecRevisionsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.apigeeregistry.v1.ListApiSpecRevisionsRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.descriptors.page.listApiSpecRevisions.createStream = + stubPageStreamingCall(undefined, expectedError); + const stream = client.listApiSpecRevisionsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.apigeeregistry.v1.ApiSpec[] = []; + stream.on( + 'data', + (response: protos.google.cloud.apigeeregistry.v1.ApiSpec) => { + responses.push(response); + } + ); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert( + (client.descriptors.page.listApiSpecRevisions.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.listApiSpecRevisions, request) + ); + assert( + (client.descriptors.page.listApiSpecRevisions.createStream as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listApiSpecRevisions without error', async () => { + const client = new registryModule.v1.RegistryClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apigeeregistry.v1.ListApiSpecRevisionsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.apigeeregistry.v1.ListApiSpecRevisionsRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.apigeeregistry.v1.ApiSpec() + ), + generateSampleMessage( + new protos.google.cloud.apigeeregistry.v1.ApiSpec() + ), + generateSampleMessage( + new protos.google.cloud.apigeeregistry.v1.ApiSpec() + ), + ]; + client.descriptors.page.listApiSpecRevisions.asyncIterate = + stubAsyncIterationCall(expectedResponse); + const responses: protos.google.cloud.apigeeregistry.v1.IApiSpec[] = []; + const iterable = client.listApiSpecRevisionsAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + ( + client.descriptors.page.listApiSpecRevisions.asyncIterate as SinonStub + ).getCall(0).args[1], + request + ); + assert( + (client.descriptors.page.listApiSpecRevisions.asyncIterate as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listApiSpecRevisions with error', async () => { + const client = new registryModule.v1.RegistryClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apigeeregistry.v1.ListApiSpecRevisionsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.apigeeregistry.v1.ListApiSpecRevisionsRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.descriptors.page.listApiSpecRevisions.asyncIterate = + stubAsyncIterationCall(undefined, expectedError); + const iterable = client.listApiSpecRevisionsAsync(request); + await assert.rejects(async () => { + const responses: protos.google.cloud.apigeeregistry.v1.IApiSpec[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + ( + client.descriptors.page.listApiSpecRevisions.asyncIterate as SinonStub + ).getCall(0).args[1], + request + ); + assert( + (client.descriptors.page.listApiSpecRevisions.asyncIterate as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + }); + + describe('listApiDeployments', () => { + it('invokes listApiDeployments without error', async () => { + const client = new registryModule.v1.RegistryClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apigeeregistry.v1.ListApiDeploymentsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.apigeeregistry.v1.ListApiDeploymentsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.apigeeregistry.v1.ApiDeployment() + ), + generateSampleMessage( + new protos.google.cloud.apigeeregistry.v1.ApiDeployment() + ), + generateSampleMessage( + new protos.google.cloud.apigeeregistry.v1.ApiDeployment() + ), + ]; + client.innerApiCalls.listApiDeployments = + stubSimpleCall(expectedResponse); + const [response] = await client.listApiDeployments(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.listApiDeployments as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listApiDeployments as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listApiDeployments without error using callback', async () => { + const client = new registryModule.v1.RegistryClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apigeeregistry.v1.ListApiDeploymentsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.apigeeregistry.v1.ListApiDeploymentsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.apigeeregistry.v1.ApiDeployment() + ), + generateSampleMessage( + new protos.google.cloud.apigeeregistry.v1.ApiDeployment() + ), + generateSampleMessage( + new protos.google.cloud.apigeeregistry.v1.ApiDeployment() + ), + ]; + client.innerApiCalls.listApiDeployments = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.listApiDeployments( + request, + ( + err?: Error | null, + result?: + | protos.google.cloud.apigeeregistry.v1.IApiDeployment[] + | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.listApiDeployments as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listApiDeployments as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listApiDeployments with error', async () => { + const client = new registryModule.v1.RegistryClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apigeeregistry.v1.ListApiDeploymentsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.apigeeregistry.v1.ListApiDeploymentsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.listApiDeployments = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.listApiDeployments(request), expectedError); + const actualRequest = ( + client.innerApiCalls.listApiDeployments as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listApiDeployments as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listApiDeploymentsStream without error', async () => { + const client = new registryModule.v1.RegistryClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apigeeregistry.v1.ListApiDeploymentsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.apigeeregistry.v1.ListApiDeploymentsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.apigeeregistry.v1.ApiDeployment() + ), + generateSampleMessage( + new protos.google.cloud.apigeeregistry.v1.ApiDeployment() + ), + generateSampleMessage( + new protos.google.cloud.apigeeregistry.v1.ApiDeployment() + ), + ]; + client.descriptors.page.listApiDeployments.createStream = + stubPageStreamingCall(expectedResponse); + const stream = client.listApiDeploymentsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.apigeeregistry.v1.ApiDeployment[] = + []; + stream.on( + 'data', + (response: protos.google.cloud.apigeeregistry.v1.ApiDeployment) => { + 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.listApiDeployments.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.listApiDeployments, request) + ); + assert( + (client.descriptors.page.listApiDeployments.createStream as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('invokes listApiDeploymentsStream with error', async () => { + const client = new registryModule.v1.RegistryClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apigeeregistry.v1.ListApiDeploymentsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.apigeeregistry.v1.ListApiDeploymentsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.descriptors.page.listApiDeployments.createStream = + stubPageStreamingCall(undefined, expectedError); + const stream = client.listApiDeploymentsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.apigeeregistry.v1.ApiDeployment[] = + []; + stream.on( + 'data', + (response: protos.google.cloud.apigeeregistry.v1.ApiDeployment) => { + responses.push(response); + } + ); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert( + (client.descriptors.page.listApiDeployments.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.listApiDeployments, request) + ); + assert( + (client.descriptors.page.listApiDeployments.createStream as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listApiDeployments without error', async () => { + const client = new registryModule.v1.RegistryClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apigeeregistry.v1.ListApiDeploymentsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.apigeeregistry.v1.ListApiDeploymentsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.apigeeregistry.v1.ApiDeployment() + ), + generateSampleMessage( + new protos.google.cloud.apigeeregistry.v1.ApiDeployment() + ), + generateSampleMessage( + new protos.google.cloud.apigeeregistry.v1.ApiDeployment() + ), + ]; + client.descriptors.page.listApiDeployments.asyncIterate = + stubAsyncIterationCall(expectedResponse); + const responses: protos.google.cloud.apigeeregistry.v1.IApiDeployment[] = + []; + const iterable = client.listApiDeploymentsAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + ( + client.descriptors.page.listApiDeployments.asyncIterate as SinonStub + ).getCall(0).args[1], + request + ); + assert( + (client.descriptors.page.listApiDeployments.asyncIterate as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listApiDeployments with error', async () => { + const client = new registryModule.v1.RegistryClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apigeeregistry.v1.ListApiDeploymentsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.apigeeregistry.v1.ListApiDeploymentsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.descriptors.page.listApiDeployments.asyncIterate = + stubAsyncIterationCall(undefined, expectedError); + const iterable = client.listApiDeploymentsAsync(request); + await assert.rejects(async () => { + const responses: protos.google.cloud.apigeeregistry.v1.IApiDeployment[] = + []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + ( + client.descriptors.page.listApiDeployments.asyncIterate as SinonStub + ).getCall(0).args[1], + request + ); + assert( + (client.descriptors.page.listApiDeployments.asyncIterate as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + }); + + describe('listApiDeploymentRevisions', () => { + it('invokes listApiDeploymentRevisions without error', async () => { + const client = new registryModule.v1.RegistryClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apigeeregistry.v1.ListApiDeploymentRevisionsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.apigeeregistry.v1.ListApiDeploymentRevisionsRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.apigeeregistry.v1.ApiDeployment() + ), + generateSampleMessage( + new protos.google.cloud.apigeeregistry.v1.ApiDeployment() + ), + generateSampleMessage( + new protos.google.cloud.apigeeregistry.v1.ApiDeployment() + ), + ]; + client.innerApiCalls.listApiDeploymentRevisions = + stubSimpleCall(expectedResponse); + const [response] = await client.listApiDeploymentRevisions(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.listApiDeploymentRevisions as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listApiDeploymentRevisions as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listApiDeploymentRevisions without error using callback', async () => { + const client = new registryModule.v1.RegistryClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apigeeregistry.v1.ListApiDeploymentRevisionsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.apigeeregistry.v1.ListApiDeploymentRevisionsRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.apigeeregistry.v1.ApiDeployment() + ), + generateSampleMessage( + new protos.google.cloud.apigeeregistry.v1.ApiDeployment() + ), + generateSampleMessage( + new protos.google.cloud.apigeeregistry.v1.ApiDeployment() + ), + ]; + client.innerApiCalls.listApiDeploymentRevisions = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.listApiDeploymentRevisions( + request, + ( + err?: Error | null, + result?: + | protos.google.cloud.apigeeregistry.v1.IApiDeployment[] + | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.listApiDeploymentRevisions as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listApiDeploymentRevisions as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listApiDeploymentRevisions with error', async () => { + const client = new registryModule.v1.RegistryClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apigeeregistry.v1.ListApiDeploymentRevisionsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.apigeeregistry.v1.ListApiDeploymentRevisionsRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.listApiDeploymentRevisions = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects( + client.listApiDeploymentRevisions(request), + expectedError + ); + const actualRequest = ( + client.innerApiCalls.listApiDeploymentRevisions as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listApiDeploymentRevisions as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listApiDeploymentRevisionsStream without error', async () => { + const client = new registryModule.v1.RegistryClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apigeeregistry.v1.ListApiDeploymentRevisionsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.apigeeregistry.v1.ListApiDeploymentRevisionsRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.apigeeregistry.v1.ApiDeployment() + ), + generateSampleMessage( + new protos.google.cloud.apigeeregistry.v1.ApiDeployment() + ), + generateSampleMessage( + new protos.google.cloud.apigeeregistry.v1.ApiDeployment() + ), + ]; + client.descriptors.page.listApiDeploymentRevisions.createStream = + stubPageStreamingCall(expectedResponse); + const stream = client.listApiDeploymentRevisionsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.apigeeregistry.v1.ApiDeployment[] = + []; + stream.on( + 'data', + (response: protos.google.cloud.apigeeregistry.v1.ApiDeployment) => { + 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.listApiDeploymentRevisions + .createStream as SinonStub + ) + .getCall(0) + .calledWith(client.innerApiCalls.listApiDeploymentRevisions, request) + ); + assert( + ( + client.descriptors.page.listApiDeploymentRevisions + .createStream as SinonStub + ) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('invokes listApiDeploymentRevisionsStream with error', async () => { + const client = new registryModule.v1.RegistryClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apigeeregistry.v1.ListApiDeploymentRevisionsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.apigeeregistry.v1.ListApiDeploymentRevisionsRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.descriptors.page.listApiDeploymentRevisions.createStream = + stubPageStreamingCall(undefined, expectedError); + const stream = client.listApiDeploymentRevisionsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.apigeeregistry.v1.ApiDeployment[] = + []; + stream.on( + 'data', + (response: protos.google.cloud.apigeeregistry.v1.ApiDeployment) => { + responses.push(response); + } + ); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert( + ( + client.descriptors.page.listApiDeploymentRevisions + .createStream as SinonStub + ) + .getCall(0) + .calledWith(client.innerApiCalls.listApiDeploymentRevisions, request) + ); + assert( + ( + client.descriptors.page.listApiDeploymentRevisions + .createStream as SinonStub + ) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listApiDeploymentRevisions without error', async () => { + const client = new registryModule.v1.RegistryClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apigeeregistry.v1.ListApiDeploymentRevisionsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.apigeeregistry.v1.ListApiDeploymentRevisionsRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.apigeeregistry.v1.ApiDeployment() + ), + generateSampleMessage( + new protos.google.cloud.apigeeregistry.v1.ApiDeployment() + ), + generateSampleMessage( + new protos.google.cloud.apigeeregistry.v1.ApiDeployment() + ), + ]; + client.descriptors.page.listApiDeploymentRevisions.asyncIterate = + stubAsyncIterationCall(expectedResponse); + const responses: protos.google.cloud.apigeeregistry.v1.IApiDeployment[] = + []; + const iterable = client.listApiDeploymentRevisionsAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + ( + client.descriptors.page.listApiDeploymentRevisions + .asyncIterate as SinonStub + ).getCall(0).args[1], + request + ); + assert( + ( + client.descriptors.page.listApiDeploymentRevisions + .asyncIterate as SinonStub + ) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listApiDeploymentRevisions with error', async () => { + const client = new registryModule.v1.RegistryClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apigeeregistry.v1.ListApiDeploymentRevisionsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.apigeeregistry.v1.ListApiDeploymentRevisionsRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.descriptors.page.listApiDeploymentRevisions.asyncIterate = + stubAsyncIterationCall(undefined, expectedError); + const iterable = client.listApiDeploymentRevisionsAsync(request); + await assert.rejects(async () => { + const responses: protos.google.cloud.apigeeregistry.v1.IApiDeployment[] = + []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + ( + client.descriptors.page.listApiDeploymentRevisions + .asyncIterate as SinonStub + ).getCall(0).args[1], + request + ); + assert( + ( + client.descriptors.page.listApiDeploymentRevisions + .asyncIterate as SinonStub + ) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + }); + + describe('listArtifacts', () => { + it('invokes listArtifacts without error', async () => { + const client = new registryModule.v1.RegistryClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apigeeregistry.v1.ListArtifactsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.apigeeregistry.v1.ListArtifactsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.apigeeregistry.v1.Artifact() + ), + generateSampleMessage( + new protos.google.cloud.apigeeregistry.v1.Artifact() + ), + generateSampleMessage( + new protos.google.cloud.apigeeregistry.v1.Artifact() + ), + ]; + client.innerApiCalls.listArtifacts = stubSimpleCall(expectedResponse); + const [response] = await client.listArtifacts(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.listArtifacts as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listArtifacts as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listArtifacts without error using callback', async () => { + const client = new registryModule.v1.RegistryClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apigeeregistry.v1.ListArtifactsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.apigeeregistry.v1.ListArtifactsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.apigeeregistry.v1.Artifact() + ), + generateSampleMessage( + new protos.google.cloud.apigeeregistry.v1.Artifact() + ), + generateSampleMessage( + new protos.google.cloud.apigeeregistry.v1.Artifact() + ), + ]; + client.innerApiCalls.listArtifacts = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.listArtifacts( + request, + ( + err?: Error | null, + result?: protos.google.cloud.apigeeregistry.v1.IArtifact[] | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.listArtifacts as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listArtifacts as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listArtifacts with error', async () => { + const client = new registryModule.v1.RegistryClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apigeeregistry.v1.ListArtifactsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.apigeeregistry.v1.ListArtifactsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.listArtifacts = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.listArtifacts(request), expectedError); + const actualRequest = ( + client.innerApiCalls.listArtifacts as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listArtifacts as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listArtifactsStream without error', async () => { + const client = new registryModule.v1.RegistryClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apigeeregistry.v1.ListArtifactsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.apigeeregistry.v1.ListArtifactsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.apigeeregistry.v1.Artifact() + ), + generateSampleMessage( + new protos.google.cloud.apigeeregistry.v1.Artifact() + ), + generateSampleMessage( + new protos.google.cloud.apigeeregistry.v1.Artifact() + ), + ]; + client.descriptors.page.listArtifacts.createStream = + stubPageStreamingCall(expectedResponse); + const stream = client.listArtifactsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.apigeeregistry.v1.Artifact[] = []; + stream.on( + 'data', + (response: protos.google.cloud.apigeeregistry.v1.Artifact) => { + 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.listArtifacts.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.listArtifacts, request) + ); + assert( + (client.descriptors.page.listArtifacts.createStream as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('invokes listArtifactsStream with error', async () => { + const client = new registryModule.v1.RegistryClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apigeeregistry.v1.ListArtifactsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.apigeeregistry.v1.ListArtifactsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.descriptors.page.listArtifacts.createStream = + stubPageStreamingCall(undefined, expectedError); + const stream = client.listArtifactsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.apigeeregistry.v1.Artifact[] = []; + stream.on( + 'data', + (response: protos.google.cloud.apigeeregistry.v1.Artifact) => { + responses.push(response); + } + ); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert( + (client.descriptors.page.listArtifacts.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.listArtifacts, request) + ); + assert( + (client.descriptors.page.listArtifacts.createStream as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listArtifacts without error', async () => { + const client = new registryModule.v1.RegistryClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apigeeregistry.v1.ListArtifactsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.apigeeregistry.v1.ListArtifactsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.apigeeregistry.v1.Artifact() + ), + generateSampleMessage( + new protos.google.cloud.apigeeregistry.v1.Artifact() + ), + generateSampleMessage( + new protos.google.cloud.apigeeregistry.v1.Artifact() + ), + ]; + client.descriptors.page.listArtifacts.asyncIterate = + stubAsyncIterationCall(expectedResponse); + const responses: protos.google.cloud.apigeeregistry.v1.IArtifact[] = []; + const iterable = client.listArtifactsAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + ( + client.descriptors.page.listArtifacts.asyncIterate as SinonStub + ).getCall(0).args[1], + request + ); + assert( + (client.descriptors.page.listArtifacts.asyncIterate as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listArtifacts with error', async () => { + const client = new registryModule.v1.RegistryClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apigeeregistry.v1.ListArtifactsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.apigeeregistry.v1.ListArtifactsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.descriptors.page.listArtifacts.asyncIterate = + stubAsyncIterationCall(undefined, expectedError); + const iterable = client.listArtifactsAsync(request); + await assert.rejects(async () => { + const responses: protos.google.cloud.apigeeregistry.v1.IArtifact[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + ( + client.descriptors.page.listArtifacts.asyncIterate as SinonStub + ).getCall(0).args[1], + request + ); + assert( + (client.descriptors.page.listArtifacts.asyncIterate as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + }); + describe('getIamPolicy', () => { + it('invokes getIamPolicy without error', async () => { + const client = new registryModule.v1.RegistryClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new IamProtos.google.iam.v1.GetIamPolicyRequest() + ); + request.resource = ''; + const expectedHeaderRequestParams = 'resource='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new IamProtos.google.iam.v1.Policy() + ); + client.iamClient.getIamPolicy = stubSimpleCall(expectedResponse); + const response = await client.getIamPolicy(request, expectedOptions); + assert.deepStrictEqual(response, [expectedResponse]); + assert( + (client.iamClient.getIamPolicy as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + it('invokes getIamPolicy without error using callback', async () => { + const client = new registryModule.v1.RegistryClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new IamProtos.google.iam.v1.GetIamPolicyRequest() + ); + request.resource = ''; + const expectedHeaderRequestParams = 'resource='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new IamProtos.google.iam.v1.Policy() + ); + client.iamClient.getIamPolicy = sinon + .stub() + .callsArgWith(2, null, expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getIamPolicy( + request, + expectedOptions, + ( + err?: Error | null, + result?: IamProtos.google.iam.v1.Policy | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.iamClient.getIamPolicy as SinonStub).getCall(0)); + }); + it('invokes getIamPolicy with error', async () => { + const client = new registryModule.v1.RegistryClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new IamProtos.google.iam.v1.GetIamPolicyRequest() + ); + request.resource = ''; + const expectedHeaderRequestParams = 'resource='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.iamClient.getIamPolicy = stubSimpleCall(undefined, expectedError); + await assert.rejects( + client.getIamPolicy(request, expectedOptions), + expectedError + ); + assert( + (client.iamClient.getIamPolicy as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + }); + describe('setIamPolicy', () => { + it('invokes setIamPolicy without error', async () => { + const client = new registryModule.v1.RegistryClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new IamProtos.google.iam.v1.SetIamPolicyRequest() + ); + request.resource = ''; + const expectedHeaderRequestParams = 'resource='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new IamProtos.google.iam.v1.Policy() + ); + client.iamClient.setIamPolicy = stubSimpleCall(expectedResponse); + const response = await client.setIamPolicy(request, expectedOptions); + assert.deepStrictEqual(response, [expectedResponse]); + assert( + (client.iamClient.setIamPolicy as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + it('invokes setIamPolicy without error using callback', async () => { + const client = new registryModule.v1.RegistryClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new IamProtos.google.iam.v1.SetIamPolicyRequest() + ); + request.resource = ''; + const expectedHeaderRequestParams = 'resource='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new IamProtos.google.iam.v1.Policy() + ); + client.iamClient.setIamPolicy = sinon + .stub() + .callsArgWith(2, null, expectedResponse); + const promise = new Promise((resolve, reject) => { + client.setIamPolicy( + request, + expectedOptions, + ( + err?: Error | null, + result?: IamProtos.google.iam.v1.Policy | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.iamClient.setIamPolicy as SinonStub).getCall(0)); + }); + it('invokes setIamPolicy with error', async () => { + const client = new registryModule.v1.RegistryClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new IamProtos.google.iam.v1.SetIamPolicyRequest() + ); + request.resource = ''; + const expectedHeaderRequestParams = 'resource='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.iamClient.setIamPolicy = stubSimpleCall(undefined, expectedError); + await assert.rejects( + client.setIamPolicy(request, expectedOptions), + expectedError + ); + assert( + (client.iamClient.setIamPolicy as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + }); + describe('testIamPermissions', () => { + it('invokes testIamPermissions without error', async () => { + const client = new registryModule.v1.RegistryClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new IamProtos.google.iam.v1.TestIamPermissionsRequest() + ); + request.resource = ''; + const expectedHeaderRequestParams = 'resource='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new IamProtos.google.iam.v1.TestIamPermissionsResponse() + ); + client.iamClient.testIamPermissions = stubSimpleCall(expectedResponse); + const response = await client.testIamPermissions( + request, + expectedOptions + ); + assert.deepStrictEqual(response, [expectedResponse]); + assert( + (client.iamClient.testIamPermissions as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + it('invokes testIamPermissions without error using callback', async () => { + const client = new registryModule.v1.RegistryClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new IamProtos.google.iam.v1.TestIamPermissionsRequest() + ); + request.resource = ''; + const expectedHeaderRequestParams = 'resource='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new IamProtos.google.iam.v1.TestIamPermissionsResponse() + ); + client.iamClient.testIamPermissions = sinon + .stub() + .callsArgWith(2, null, expectedResponse); + const promise = new Promise((resolve, reject) => { + client.testIamPermissions( + request, + expectedOptions, + ( + err?: Error | null, + result?: IamProtos.google.iam.v1.TestIamPermissionsResponse | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.iamClient.testIamPermissions as SinonStub).getCall(0)); + }); + it('invokes testIamPermissions with error', async () => { + const client = new registryModule.v1.RegistryClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new IamProtos.google.iam.v1.TestIamPermissionsRequest() + ); + request.resource = ''; + const expectedHeaderRequestParams = 'resource='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.iamClient.testIamPermissions = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects( + client.testIamPermissions(request, expectedOptions), + expectedError + ); + assert( + (client.iamClient.testIamPermissions as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + }); + describe('getLocation', () => { + it('invokes getLocation without error', async () => { + const client = new registryModule.v1.RegistryClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + 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 registryModule.v1.RegistryClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + 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 registryModule.v1.RegistryClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + 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 registryModule.v1.RegistryClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + 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 registryModule.v1.RegistryClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + 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('Path templates', () => { + describe('api', () => { + const fakePath = '/rendered/path/api'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + api: 'apiValue', + }; + const client = new registryModule.v1.RegistryClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.apiPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.apiPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('apiPath', () => { + const result = client.apiPath( + 'projectValue', + 'locationValue', + 'apiValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.apiPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromApiName', () => { + const result = client.matchProjectFromApiName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.apiPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromApiName', () => { + const result = client.matchLocationFromApiName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.apiPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchApiFromApiName', () => { + const result = client.matchApiFromApiName(fakePath); + assert.strictEqual(result, 'apiValue'); + assert( + (client.pathTemplates.apiPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('apiDeployment', () => { + const fakePath = '/rendered/path/apiDeployment'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + api: 'apiValue', + deployment: 'deploymentValue', + }; + const client = new registryModule.v1.RegistryClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.apiDeploymentPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.apiDeploymentPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('apiDeploymentPath', () => { + const result = client.apiDeploymentPath( + 'projectValue', + 'locationValue', + 'apiValue', + 'deploymentValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.apiDeploymentPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromApiDeploymentName', () => { + const result = client.matchProjectFromApiDeploymentName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.apiDeploymentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromApiDeploymentName', () => { + const result = client.matchLocationFromApiDeploymentName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.apiDeploymentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchApiFromApiDeploymentName', () => { + const result = client.matchApiFromApiDeploymentName(fakePath); + assert.strictEqual(result, 'apiValue'); + assert( + (client.pathTemplates.apiDeploymentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchDeploymentFromApiDeploymentName', () => { + const result = client.matchDeploymentFromApiDeploymentName(fakePath); + assert.strictEqual(result, 'deploymentValue'); + assert( + (client.pathTemplates.apiDeploymentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('apiSpec', () => { + const fakePath = '/rendered/path/apiSpec'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + api: 'apiValue', + version: 'versionValue', + spec: 'specValue', + }; + const client = new registryModule.v1.RegistryClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.apiSpecPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.apiSpecPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('apiSpecPath', () => { + const result = client.apiSpecPath( + 'projectValue', + 'locationValue', + 'apiValue', + 'versionValue', + 'specValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.apiSpecPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromApiSpecName', () => { + const result = client.matchProjectFromApiSpecName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.apiSpecPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromApiSpecName', () => { + const result = client.matchLocationFromApiSpecName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.apiSpecPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchApiFromApiSpecName', () => { + const result = client.matchApiFromApiSpecName(fakePath); + assert.strictEqual(result, 'apiValue'); + assert( + (client.pathTemplates.apiSpecPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchVersionFromApiSpecName', () => { + const result = client.matchVersionFromApiSpecName(fakePath); + assert.strictEqual(result, 'versionValue'); + assert( + (client.pathTemplates.apiSpecPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchSpecFromApiSpecName', () => { + const result = client.matchSpecFromApiSpecName(fakePath); + assert.strictEqual(result, 'specValue'); + assert( + (client.pathTemplates.apiSpecPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('apiVersion', () => { + const fakePath = '/rendered/path/apiVersion'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + api: 'apiValue', + version: 'versionValue', + }; + const client = new registryModule.v1.RegistryClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.apiVersionPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.apiVersionPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('apiVersionPath', () => { + const result = client.apiVersionPath( + 'projectValue', + 'locationValue', + 'apiValue', + 'versionValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.apiVersionPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromApiVersionName', () => { + const result = client.matchProjectFromApiVersionName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.apiVersionPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromApiVersionName', () => { + const result = client.matchLocationFromApiVersionName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.apiVersionPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchApiFromApiVersionName', () => { + const result = client.matchApiFromApiVersionName(fakePath); + assert.strictEqual(result, 'apiValue'); + assert( + (client.pathTemplates.apiVersionPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchVersionFromApiVersionName', () => { + const result = client.matchVersionFromApiVersionName(fakePath); + assert.strictEqual(result, 'versionValue'); + assert( + (client.pathTemplates.apiVersionPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('instance', () => { + const fakePath = '/rendered/path/instance'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + instance: 'instanceValue', + }; + const client = new registryModule.v1.RegistryClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.instancePathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.instancePathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('instancePath', () => { + const result = client.instancePath( + 'projectValue', + 'locationValue', + 'instanceValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.instancePathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromInstanceName', () => { + const result = client.matchProjectFromInstanceName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.instancePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromInstanceName', () => { + const result = client.matchLocationFromInstanceName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.instancePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchInstanceFromInstanceName', () => { + const result = client.matchInstanceFromInstanceName(fakePath); + assert.strictEqual(result, 'instanceValue'); + assert( + (client.pathTemplates.instancePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('location', () => { + const fakePath = '/rendered/path/location'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + }; + const client = new registryModule.v1.RegistryClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + 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('project', () => { + const fakePath = '/rendered/path/project'; + const expectedParameters = { + project: 'projectValue', + }; + const client = new registryModule.v1.RegistryClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + 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('projectLocationApiArtifact', () => { + const fakePath = '/rendered/path/projectLocationApiArtifact'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + api: 'apiValue', + artifact: 'artifactValue', + }; + const client = new registryModule.v1.RegistryClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.projectLocationApiArtifactPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.projectLocationApiArtifactPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('projectLocationApiArtifactPath', () => { + const result = client.projectLocationApiArtifactPath( + 'projectValue', + 'locationValue', + 'apiValue', + 'artifactValue' + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates.projectLocationApiArtifactPathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromProjectLocationApiArtifactName', () => { + const result = + client.matchProjectFromProjectLocationApiArtifactName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + ( + client.pathTemplates.projectLocationApiArtifactPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromProjectLocationApiArtifactName', () => { + const result = + client.matchLocationFromProjectLocationApiArtifactName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + ( + client.pathTemplates.projectLocationApiArtifactPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchApiFromProjectLocationApiArtifactName', () => { + const result = + client.matchApiFromProjectLocationApiArtifactName(fakePath); + assert.strictEqual(result, 'apiValue'); + assert( + ( + client.pathTemplates.projectLocationApiArtifactPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchArtifactFromProjectLocationApiArtifactName', () => { + const result = + client.matchArtifactFromProjectLocationApiArtifactName(fakePath); + assert.strictEqual(result, 'artifactValue'); + assert( + ( + client.pathTemplates.projectLocationApiArtifactPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('projectLocationApiDeploymentArtifact', () => { + const fakePath = '/rendered/path/projectLocationApiDeploymentArtifact'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + api: 'apiValue', + deployment: 'deploymentValue', + artifact: 'artifactValue', + }; + const client = new registryModule.v1.RegistryClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.projectLocationApiDeploymentArtifactPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.projectLocationApiDeploymentArtifactPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('projectLocationApiDeploymentArtifactPath', () => { + const result = client.projectLocationApiDeploymentArtifactPath( + 'projectValue', + 'locationValue', + 'apiValue', + 'deploymentValue', + 'artifactValue' + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates + .projectLocationApiDeploymentArtifactPathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromProjectLocationApiDeploymentArtifactName', () => { + const result = + client.matchProjectFromProjectLocationApiDeploymentArtifactName( + fakePath + ); + assert.strictEqual(result, 'projectValue'); + assert( + ( + client.pathTemplates + .projectLocationApiDeploymentArtifactPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromProjectLocationApiDeploymentArtifactName', () => { + const result = + client.matchLocationFromProjectLocationApiDeploymentArtifactName( + fakePath + ); + assert.strictEqual(result, 'locationValue'); + assert( + ( + client.pathTemplates + .projectLocationApiDeploymentArtifactPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchApiFromProjectLocationApiDeploymentArtifactName', () => { + const result = + client.matchApiFromProjectLocationApiDeploymentArtifactName(fakePath); + assert.strictEqual(result, 'apiValue'); + assert( + ( + client.pathTemplates + .projectLocationApiDeploymentArtifactPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchDeploymentFromProjectLocationApiDeploymentArtifactName', () => { + const result = + client.matchDeploymentFromProjectLocationApiDeploymentArtifactName( + fakePath + ); + assert.strictEqual(result, 'deploymentValue'); + assert( + ( + client.pathTemplates + .projectLocationApiDeploymentArtifactPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchArtifactFromProjectLocationApiDeploymentArtifactName', () => { + const result = + client.matchArtifactFromProjectLocationApiDeploymentArtifactName( + fakePath + ); + assert.strictEqual(result, 'artifactValue'); + assert( + ( + client.pathTemplates + .projectLocationApiDeploymentArtifactPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('projectLocationApiVersionArtifact', () => { + const fakePath = '/rendered/path/projectLocationApiVersionArtifact'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + api: 'apiValue', + version: 'versionValue', + artifact: 'artifactValue', + }; + const client = new registryModule.v1.RegistryClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.projectLocationApiVersionArtifactPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.projectLocationApiVersionArtifactPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('projectLocationApiVersionArtifactPath', () => { + const result = client.projectLocationApiVersionArtifactPath( + 'projectValue', + 'locationValue', + 'apiValue', + 'versionValue', + 'artifactValue' + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates.projectLocationApiVersionArtifactPathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromProjectLocationApiVersionArtifactName', () => { + const result = + client.matchProjectFromProjectLocationApiVersionArtifactName( + fakePath + ); + assert.strictEqual(result, 'projectValue'); + assert( + ( + client.pathTemplates.projectLocationApiVersionArtifactPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromProjectLocationApiVersionArtifactName', () => { + const result = + client.matchLocationFromProjectLocationApiVersionArtifactName( + fakePath + ); + assert.strictEqual(result, 'locationValue'); + assert( + ( + client.pathTemplates.projectLocationApiVersionArtifactPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchApiFromProjectLocationApiVersionArtifactName', () => { + const result = + client.matchApiFromProjectLocationApiVersionArtifactName(fakePath); + assert.strictEqual(result, 'apiValue'); + assert( + ( + client.pathTemplates.projectLocationApiVersionArtifactPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchVersionFromProjectLocationApiVersionArtifactName', () => { + const result = + client.matchVersionFromProjectLocationApiVersionArtifactName( + fakePath + ); + assert.strictEqual(result, 'versionValue'); + assert( + ( + client.pathTemplates.projectLocationApiVersionArtifactPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchArtifactFromProjectLocationApiVersionArtifactName', () => { + const result = + client.matchArtifactFromProjectLocationApiVersionArtifactName( + fakePath + ); + assert.strictEqual(result, 'artifactValue'); + assert( + ( + client.pathTemplates.projectLocationApiVersionArtifactPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('projectLocationApiVersionSpecArtifact', () => { + const fakePath = '/rendered/path/projectLocationApiVersionSpecArtifact'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + api: 'apiValue', + version: 'versionValue', + spec: 'specValue', + artifact: 'artifactValue', + }; + const client = new registryModule.v1.RegistryClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.projectLocationApiVersionSpecArtifactPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.projectLocationApiVersionSpecArtifactPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('projectLocationApiVersionSpecArtifactPath', () => { + const result = client.projectLocationApiVersionSpecArtifactPath( + 'projectValue', + 'locationValue', + 'apiValue', + 'versionValue', + 'specValue', + 'artifactValue' + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates + .projectLocationApiVersionSpecArtifactPathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromProjectLocationApiVersionSpecArtifactName', () => { + const result = + client.matchProjectFromProjectLocationApiVersionSpecArtifactName( + fakePath + ); + assert.strictEqual(result, 'projectValue'); + assert( + ( + client.pathTemplates + .projectLocationApiVersionSpecArtifactPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromProjectLocationApiVersionSpecArtifactName', () => { + const result = + client.matchLocationFromProjectLocationApiVersionSpecArtifactName( + fakePath + ); + assert.strictEqual(result, 'locationValue'); + assert( + ( + client.pathTemplates + .projectLocationApiVersionSpecArtifactPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchApiFromProjectLocationApiVersionSpecArtifactName', () => { + const result = + client.matchApiFromProjectLocationApiVersionSpecArtifactName( + fakePath + ); + assert.strictEqual(result, 'apiValue'); + assert( + ( + client.pathTemplates + .projectLocationApiVersionSpecArtifactPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchVersionFromProjectLocationApiVersionSpecArtifactName', () => { + const result = + client.matchVersionFromProjectLocationApiVersionSpecArtifactName( + fakePath + ); + assert.strictEqual(result, 'versionValue'); + assert( + ( + client.pathTemplates + .projectLocationApiVersionSpecArtifactPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchSpecFromProjectLocationApiVersionSpecArtifactName', () => { + const result = + client.matchSpecFromProjectLocationApiVersionSpecArtifactName( + fakePath + ); + assert.strictEqual(result, 'specValue'); + assert( + ( + client.pathTemplates + .projectLocationApiVersionSpecArtifactPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchArtifactFromProjectLocationApiVersionSpecArtifactName', () => { + const result = + client.matchArtifactFromProjectLocationApiVersionSpecArtifactName( + fakePath + ); + assert.strictEqual(result, 'artifactValue'); + assert( + ( + client.pathTemplates + .projectLocationApiVersionSpecArtifactPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('projectLocationArtifact', () => { + const fakePath = '/rendered/path/projectLocationArtifact'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + artifact: 'artifactValue', + }; + const client = new registryModule.v1.RegistryClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.projectLocationArtifactPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.projectLocationArtifactPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('projectLocationArtifactPath', () => { + const result = client.projectLocationArtifactPath( + 'projectValue', + 'locationValue', + 'artifactValue' + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates.projectLocationArtifactPathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromProjectLocationArtifactName', () => { + const result = + client.matchProjectFromProjectLocationArtifactName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + ( + client.pathTemplates.projectLocationArtifactPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromProjectLocationArtifactName', () => { + const result = + client.matchLocationFromProjectLocationArtifactName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + ( + client.pathTemplates.projectLocationArtifactPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchArtifactFromProjectLocationArtifactName', () => { + const result = + client.matchArtifactFromProjectLocationArtifactName(fakePath); + assert.strictEqual(result, 'artifactValue'); + assert( + ( + client.pathTemplates.projectLocationArtifactPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + }); +}); diff --git a/packages/google-cloud-apigeeregistry/tsconfig.json b/packages/google-cloud-apigeeregistry/tsconfig.json new file mode 100644 index 00000000000..c78f1c884ef --- /dev/null +++ b/packages/google-cloud-apigeeregistry/tsconfig.json @@ -0,0 +1,19 @@ +{ + "extends": "./node_modules/gts/tsconfig-google.json", + "compilerOptions": { + "rootDir": ".", + "outDir": "build", + "resolveJsonModule": true, + "lib": [ + "es2018", + "dom" + ] + }, + "include": [ + "src/*.ts", + "src/**/*.ts", + "test/*.ts", + "test/**/*.ts", + "system-test/*.ts" + ] +} diff --git a/packages/google-cloud-apigeeregistry/webpack.config.js b/packages/google-cloud-apigeeregistry/webpack.config.js new file mode 100644 index 00000000000..af9ec89d4a7 --- /dev/null +++ b/packages/google-cloud-apigeeregistry/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: 'Provisioning', + filename: './provisioning.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/google-cloud-automl/.OwlBot.yaml b/packages/google-cloud-automl/.OwlBot.yaml new file mode 100644 index 00000000000..201863f2b57 --- /dev/null +++ b/packages/google-cloud-automl/.OwlBot.yaml @@ -0,0 +1,24 @@ +# 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 +# +# 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. + + +deep-remove-regex: + - /owl-bot-staging + +deep-copy-regex: + - source: /google/cloud/automl/(v.*)/.*-nodejs + dest: /owl-bot-staging/google-cloud-automl/$1 + +begin-after-commit-hash: fb91803ccef5d7c695139b22788b309e2197856b + diff --git a/packages/google-cloud-automl/.eslintignore b/packages/google-cloud-automl/.eslintignore new file mode 100644 index 00000000000..ea5b04aebe6 --- /dev/null +++ b/packages/google-cloud-automl/.eslintignore @@ -0,0 +1,7 @@ +**/node_modules +**/coverage +test/fixtures +build/ +docs/ +protos/ +samples/generated/ diff --git a/packages/google-cloud-automl/.eslintrc.json b/packages/google-cloud-automl/.eslintrc.json new file mode 100644 index 00000000000..78215349546 --- /dev/null +++ b/packages/google-cloud-automl/.eslintrc.json @@ -0,0 +1,3 @@ +{ + "extends": "./node_modules/gts" +} diff --git a/packages/google-cloud-automl/.gitattributes b/packages/google-cloud-automl/.gitattributes new file mode 100644 index 00000000000..33739cb74e4 --- /dev/null +++ b/packages/google-cloud-automl/.gitattributes @@ -0,0 +1,4 @@ +*.ts text eol=lf +*.js text eol=lf +protos/* linguist-generated +**/api-extractor.json linguist-language=JSON-with-Comments diff --git a/packages/google-cloud-automl/.gitignore b/packages/google-cloud-automl/.gitignore new file mode 100644 index 00000000000..d4f03a0df2e --- /dev/null +++ b/packages/google-cloud-automl/.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/google-cloud-automl/.jsdoc.js b/packages/google-cloud-automl/.jsdoc.js new file mode 100644 index 00000000000..cd7589af389 --- /dev/null +++ b/packages/google-cloud-automl/.jsdoc.js @@ -0,0 +1,55 @@ +// Copyright 2023 Google LLC +// +// Licensed under the Apache License, Version 2.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 2023 Google LLC', + includeDate: false, + sourceFiles: false, + systemName: '@google-cloud/automl', + theme: 'lumen', + default: { + outputSourceFiles: false + } + }, + markdown: { + idInHeadings: true + } +}; diff --git a/packages/google-cloud-automl/.mocharc.js b/packages/google-cloud-automl/.mocharc.js new file mode 100644 index 00000000000..49e7e228701 --- /dev/null +++ b/packages/google-cloud-automl/.mocharc.js @@ -0,0 +1,29 @@ +// Copyright 2023 Google LLC +// +// Licensed under the Apache License, Version 2.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. +const config = { + "enable-source-maps": true, + "throw-deprecation": true, + "timeout": 10000, + "recursive": true +} +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/google-cloud-automl/.mocharc.json b/packages/google-cloud-automl/.mocharc.json new file mode 100644 index 00000000000..670c5e2c24b --- /dev/null +++ b/packages/google-cloud-automl/.mocharc.json @@ -0,0 +1,5 @@ +{ + "enable-source-maps": true, + "throw-deprecation": true, + "timeout": 10000 +} diff --git a/packages/google-cloud-automl/.nycrc b/packages/google-cloud-automl/.nycrc new file mode 100644 index 00000000000..b18d5472b62 --- /dev/null +++ b/packages/google-cloud-automl/.nycrc @@ -0,0 +1,24 @@ +{ + "report-dir": "./.coverage", + "reporter": ["text", "lcov"], + "exclude": [ + "**/*-test", + "**/.coverage", + "**/apis", + "**/benchmark", + "**/conformance", + "**/docs", + "**/samples", + "**/scripts", + "**/protos", + "**/test", + "**/*.d.ts", + ".jsdoc.js", + "**/.jsdoc.js", + "karma.conf.js", + "webpack-tests.config.js", + "webpack.config.js" + ], + "exclude-after-remap": false, + "all": true +} diff --git a/packages/google-cloud-automl/.prettierignore b/packages/google-cloud-automl/.prettierignore new file mode 100644 index 00000000000..9340ad9b86d --- /dev/null +++ b/packages/google-cloud-automl/.prettierignore @@ -0,0 +1,6 @@ +**/node_modules +**/coverage +test/fixtures +build/ +docs/ +protos/ diff --git a/packages/google-cloud-automl/.prettierrc.js b/packages/google-cloud-automl/.prettierrc.js new file mode 100644 index 00000000000..1e6cec783e4 --- /dev/null +++ b/packages/google-cloud-automl/.prettierrc.js @@ -0,0 +1,17 @@ +// Copyright 2023 Google LLC +// +// Licensed under the Apache License, Version 2.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. + +module.exports = { + ...require('gts/.prettierrc.json') +} diff --git a/packages/google-cloud-automl/.readme-partials.yaml b/packages/google-cloud-automl/.readme-partials.yaml new file mode 100644 index 00000000000..42e30224ee4 --- /dev/null +++ b/packages/google-cloud-automl/.readme-partials.yaml @@ -0,0 +1,8 @@ +introduction: | + 🔔 **AutoML API NodeJS Client is now available in Vertex AI. Please visit** + [node-js-aiplatform](https://github.com/googleapis/nodejs-ai-platform) **for the new NodeJS Vertex AI client.** + Vertex AI is our next generation AI Platform, with many new features that are unavailable in the current platform. + [Migrate your resources to Vertex AI](https://cloud.google.com/vertex-ai/docs/start/migrating-to-vertex-ai) to get + the latest machine learning features, simplify end-to-end journeys, and productionize models with MLOps. + + Cloud AutoML API client for Node.js diff --git a/packages/google-cloud-automl/.repo-metadata.json b/packages/google-cloud-automl/.repo-metadata.json new file mode 100644 index 00000000000..83a62a28ad9 --- /dev/null +++ b/packages/google-cloud-automl/.repo-metadata.json @@ -0,0 +1,17 @@ +{ + "distribution_name": "@google-cloud/automl", + "release_level": "stable", + "product_documentation": "https://cloud.google.com/automl/docs/", + "repo": "googleapis/google-cloud-node", + "default_version": "v1", + "language": "nodejs", + "requires_billing": true, + "issue_tracker": "https://issuetracker.google.com/savedsearches/559744", + "client_documentation": "https://cloud.google.com/nodejs/docs/reference/automl/latest", + "name": "automl", + "name_pretty": "Cloud AutoML", + "api_id": "automl.googleapis.com", + "codeowner_team": "@googleapis/ml-apis", + "api_shortname": "automl", + "library_type": "GAPIC_COMBO" +} diff --git a/packages/google-cloud-automl/CHANGELOG.md b/packages/google-cloud-automl/CHANGELOG.md new file mode 100644 index 00000000000..a531bca7946 --- /dev/null +++ b/packages/google-cloud-automl/CHANGELOG.md @@ -0,0 +1,563 @@ +# Changelog + +[npm history][1] + +[1]: https://www.npmjs.com/package/@google-cloud/automl?activeTab=versions + +## [4.0.2](https://github.com/googleapis/google-cloud-node/compare/automl-v4.0.1...automl-v4.0.2) (2023-09-19) + + +### Bug Fixes + +* **deps:** Update dependency yargs to v17 ([#4659](https://github.com/googleapis/google-cloud-node/issues/4659)) ([e2ee917](https://github.com/googleapis/google-cloud-node/commit/e2ee9178272268f38adeaf428d8f50779ad86290)) + +## [4.0.1](https://github.com/googleapis/nodejs-automl/compare/v4.0.0...v4.0.1) (2023-09-07) + + +### Bug Fixes + +* Simplify logic for HTTP/1.1 REST fallback option ([#795](https://github.com/googleapis/nodejs-automl/issues/795)) ([a07f5cb](https://github.com/googleapis/nodejs-automl/commit/a07f5cb7b158fcccdca3e087f673e98e05bcded0)) + +## [4.0.0](https://github.com/googleapis/nodejs-automl/compare/v3.1.3...v4.0.0) (2023-08-10) + + +### ⚠ BREAKING CHANGES + +* upgrade to Node 14 + +### Miscellaneous Chores + +* Upgrade to Node 14 ([a6ab913](https://github.com/googleapis/nodejs-automl/commit/a6ab913ae49222b75dccdaaf4f0cea64c0eef5d2)) + +## [3.1.3](https://github.com/googleapis/nodejs-automl/compare/v3.1.2...v3.1.3) (2023-04-02) + + +### Bug Fixes + +* **deps:** Use google-gax v3.5.2 ([#701](https://github.com/googleapis/nodejs-automl/issues/701)) ([ed4b83e](https://github.com/googleapis/nodejs-automl/commit/ed4b83ecec7a6fce1c82a2aba42aaf07f95da153)) +* Regenerated protos JS and TS definitions ([#705](https://github.com/googleapis/nodejs-automl/issues/705)) ([8eb6181](https://github.com/googleapis/nodejs-automl/commit/8eb6181996fdc36b21d48e9589e0a4ab35cf6874)) + +## [3.1.2](https://github.com/googleapis/nodejs-automl/compare/v3.1.1...v3.1.2) (2022-09-22) + + +### Bug Fixes + +* Preserve default values in x-goog-request-params header ([#634](https://github.com/googleapis/nodejs-automl/issues/634)) ([1949bf9](https://github.com/googleapis/nodejs-automl/commit/1949bf9a26b63b4eefd13f5c6164691db46a0df2)) + +## [3.1.1](https://github.com/googleapis/nodejs-automl/compare/v3.1.0...v3.1.1) (2022-09-01) + + +### Bug Fixes + +* Allow passing gax instance to client constructor ([#629](https://github.com/googleapis/nodejs-automl/issues/629)) ([b58d43f](https://github.com/googleapis/nodejs-automl/commit/b58d43ff09ce5e80dd0e51dac4e01af71d7aeddc)) +* Do not import the whole google-gax from proto JS ([#1553](https://github.com/googleapis/nodejs-automl/issues/1553)) ([#628](https://github.com/googleapis/nodejs-automl/issues/628)) ([c29c1d0](https://github.com/googleapis/nodejs-automl/commit/c29c1d08817e23cae1d1183ef6a2a695cb146312)) + +## [3.1.0](https://github.com/googleapis/nodejs-automl/compare/v3.0.0...v3.1.0) (2022-08-23) + + +### Features + +* support regapic LRO ([#618](https://github.com/googleapis/nodejs-automl/issues/618)) ([24669e9](https://github.com/googleapis/nodejs-automl/commit/24669e921612949f777a1b5b9dc57a0d011d0a90)) + + +### Bug Fixes + +* better support for fallback mode ([#625](https://github.com/googleapis/nodejs-automl/issues/625)) ([301d706](https://github.com/googleapis/nodejs-automl/commit/301d706c3e4564da4ce7a0c6f082890e2e111b27)) +* change import long to require ([#626](https://github.com/googleapis/nodejs-automl/issues/626)) ([958e1c4](https://github.com/googleapis/nodejs-automl/commit/958e1c46e87f258356f8523548ff5b0401a12470)) +* **deps:** update dependency mathjs to v11 ([#622](https://github.com/googleapis/nodejs-automl/issues/622)) ([c0b8fa5](https://github.com/googleapis/nodejs-automl/commit/c0b8fa50f6cea30f7cc442c5f8e9599ab9cb8901)) +* remove pip install statements ([#1546](https://github.com/googleapis/nodejs-automl/issues/1546)) ([#627](https://github.com/googleapis/nodejs-automl/issues/627)) ([b333d59](https://github.com/googleapis/nodejs-automl/commit/b333d598b16ca9f97fd1a6539fbef0fee65ac3ae)) + +## [3.0.0](https://github.com/googleapis/nodejs-automl/compare/v2.5.2...v3.0.0) (2022-06-20) + + +### ⚠ BREAKING CHANGES + +* update library to use Node 12 (#613) + +### Bug Fixes + +* Add back java_multiple_files option to the text_sentiment.proto to match with the previous published version of text_sentiment proto ([20995db](https://github.com/googleapis/nodejs-automl/commit/20995db72854243213a6ffabcb188a52c9cef8f6)) +* proto field markdown comment for the display_name field in annotation_payload.proto to point the correct public v1/ version ([20995db](https://github.com/googleapis/nodejs-automl/commit/20995db72854243213a6ffabcb188a52c9cef8f6)) + + +### Build System + +* update library to use Node 12 ([#613](https://github.com/googleapis/nodejs-automl/issues/613)) ([9ddf084](https://github.com/googleapis/nodejs-automl/commit/9ddf0845c8f5f1a2434a1f48d3740447fa2d747d)) + +### [2.5.2](https://www.github.com/googleapis/nodejs-automl/compare/v2.5.1...v2.5.2) (2021-12-30) + + +### Bug Fixes + +* **deps:** update dependency csv to v6 ([#565](https://www.github.com/googleapis/nodejs-automl/issues/565)) ([7f1d947](https://www.github.com/googleapis/nodejs-automl/commit/7f1d9477cfa2d9697206dffabdfb92dfb80bc1d1)) + +### [2.5.1](https://www.github.com/googleapis/nodejs-automl/compare/v2.5.0...v2.5.1) (2021-11-08) + + +### Bug Fixes + +* **deps:** update dependency mathjs to v10 ([#559](https://www.github.com/googleapis/nodejs-automl/issues/559)) ([120a457](https://www.github.com/googleapis/nodejs-automl/commit/120a457211590c48c0e8d81e35e364f6c098dbce)) + +## [2.5.0](https://www.github.com/googleapis/nodejs-automl/compare/v2.4.5...v2.5.0) (2021-10-14) + + +### Features + +* turns on self-signed JWT feature flag ([#540](https://www.github.com/googleapis/nodejs-automl/issues/540)) ([bb611a4](https://www.github.com/googleapis/nodejs-automl/commit/bb611a4f2f1c372bafc4088f1a7660f7fddb9e08)) + +### [2.4.5](https://www.github.com/googleapis/nodejs-automl/compare/v2.4.4...v2.4.5) (2021-08-17) + + +### Bug Fixes + +* **deps:** google-gax v2.24.1 ([#538](https://www.github.com/googleapis/nodejs-automl/issues/538)) ([aac7447](https://www.github.com/googleapis/nodejs-automl/commit/aac7447912331ea0edc807985f530bca2e8f663c)) + +### [2.4.4](https://www.github.com/googleapis/nodejs-automl/compare/v2.4.3...v2.4.4) (2021-08-11) + + +### Bug Fixes + +* **build:** migrate to using main branch ([#536](https://www.github.com/googleapis/nodejs-automl/issues/536)) ([1185736](https://www.github.com/googleapis/nodejs-automl/commit/1185736efefca56e2f86ac52ad340d231d92c25f)) + +### [2.4.3](https://www.github.com/googleapis/nodejs-automl/compare/v2.4.2...v2.4.3) (2021-07-21) + + +### Bug Fixes + +* **deps:** google-gax v2.17.1 ([#526](https://www.github.com/googleapis/nodejs-automl/issues/526)) ([8911d45](https://www.github.com/googleapis/nodejs-automl/commit/8911d457513f2c0c9cca6d2b7473b314ac3a4efd)) +* **deps:** require google-gax v2.17.0 ([#524](https://www.github.com/googleapis/nodejs-automl/issues/524)) ([5863c54](https://www.github.com/googleapis/nodejs-automl/commit/5863c5440bf94fa2fd986b5c8f5265b86fd4497e)) +* make request optional in all cases ([#521](https://www.github.com/googleapis/nodejs-automl/issues/521)) ([a45622a](https://www.github.com/googleapis/nodejs-automl/commit/a45622a9f53683a73fd2057ef5a2ccf22e7da946)) +* REST fallback client header ([#513](https://www.github.com/googleapis/nodejs-automl/issues/513)) ([833d2d7](https://www.github.com/googleapis/nodejs-automl/commit/833d2d70ff1828a69e7f9482f58189f5d484751f)) +* Updating WORKSPACE files to use the newest version of the Typescript generator. ([#527](https://www.github.com/googleapis/nodejs-automl/issues/527)) ([dfb504e](https://www.github.com/googleapis/nodejs-automl/commit/dfb504e12075136707e5915b1db6f65ed72d5aa9)) + +### [2.4.2](https://www.github.com/googleapis/nodejs-automl/compare/v2.4.1...v2.4.2) (2021-05-12) + + +### Bug Fixes + +* **deps:** require google-gax v2.12.0 ([#501](https://www.github.com/googleapis/nodejs-automl/issues/501)) ([f88cc91](https://www.github.com/googleapis/nodejs-automl/commit/f88cc915df6ac67f7dc46fa345d9fc481b12d7da)) +* use require() to load JSON protos ([#504](https://www.github.com/googleapis/nodejs-automl/issues/504)) ([4cd9585](https://www.github.com/googleapis/nodejs-automl/commit/4cd9585da11b3a9189ed8f3f0e5ddc76c578a462)) + +### [2.4.1](https://www.github.com/googleapis/nodejs-automl/compare/v2.4.0...v2.4.1) (2021-03-07) + + +### Bug Fixes + +* **deps:** update dependency mathjs to v9 ([#482](https://www.github.com/googleapis/nodejs-automl/issues/482)) ([8917ce3](https://www.github.com/googleapis/nodejs-automl/commit/8917ce3d6ed53e94113ed5aa5a42f918a4531a40)) +* Wrote inputs as string to facilitate parsing ([#480](https://www.github.com/googleapis/nodejs-automl/issues/480)) ([3d9aa88](https://www.github.com/googleapis/nodejs-automl/commit/3d9aa8899dd39041cf45a5c298d7cc010ca8d020)) + +## [2.4.0](https://www.github.com/googleapis/nodejs-automl/compare/v2.3.1...v2.4.0) (2021-01-09) + + +### Features + +* adds style enumeration ([#478](https://www.github.com/googleapis/nodejs-automl/issues/478)) ([1eddaf2](https://www.github.com/googleapis/nodejs-automl/commit/1eddaf2618a1e65d3f54faba4e1ef37abcdab916)) + +### [2.3.1](https://www.github.com/googleapis/nodejs-automl/compare/v2.3.0...v2.3.1) (2020-11-25) + + +### Bug Fixes + +* **browser:** check for fetch on window ([50a3083](https://www.github.com/googleapis/nodejs-automl/commit/50a308349f819b06867b13d0300175b3ee5f43b7)) +* do not modify options object, use defaultScopes ([#466](https://www.github.com/googleapis/nodejs-automl/issues/466)) ([8aaf0c3](https://www.github.com/googleapis/nodejs-automl/commit/8aaf0c3aed7f4c2c705d14d4277223e11ba7349f)) + +## [2.3.0](https://www.github.com/googleapis/nodejs-automl/compare/v2.2.0...v2.3.0) (2020-10-27) + + +### Features + +* Added text extraction health care option in create model. ([#458](https://www.github.com/googleapis/nodejs-automl/issues/458)) ([8c488cb](https://www.github.com/googleapis/nodejs-automl/commit/8c488cb7013f2fea98396c4a734ff49a1b691745)) + + +### Bug Fixes + +* **deps:** update dependency yargs to v16 ([#438](https://www.github.com/googleapis/nodejs-automl/issues/438)) ([713d005](https://www.github.com/googleapis/nodejs-automl/commit/713d00568534884bc8cce9d8ca1bbf1c5b1e0bf5)) + +## [2.2.0](https://www.github.com/googleapis/nodejs-automl/compare/v2.1.0...v2.2.0) (2020-06-28) + + +### Features + +* move ts target to es2018 from es2016 ([#406](https://www.github.com/googleapis/nodejs-automl/issues/406)) ([c24dcc2](https://www.github.com/googleapis/nodejs-automl/commit/c24dcc2cf62ea62b1f187fb116652404d5f7cf05)) + + +### Bug Fixes + +* proper fallback option handling ([25d1f25](https://www.github.com/googleapis/nodejs-automl/commit/25d1f250ba9c5d80f66ced3be3dd2aa404248bd1)) + +## [2.1.0](https://www.github.com/googleapis/nodejs-automl/compare/v2.0.0...v2.1.0) (2020-06-04) + + +### Features + +* check status of long running operation by its name ([#397](https://www.github.com/googleapis/nodejs-automl/issues/397)) ([3edf825](https://www.github.com/googleapis/nodejs-automl/commit/3edf82526f57ff4ba60df39ea56956886cd6a123)) + + +### Bug Fixes + +* clean up synth.py for multiple version ([#396](https://www.github.com/googleapis/nodejs-automl/issues/396)) ([a356064](https://www.github.com/googleapis/nodejs-automl/commit/a35606438799b2ad25d6bd0ed84691a28e0a00d6)) +* remove eslint, update gax, fix generated protos, run the generator ([#377](https://www.github.com/googleapis/nodejs-automl/issues/377)) ([7889f29](https://www.github.com/googleapis/nodejs-automl/commit/7889f29cb2ebaf0ac96d68cd9ca1f74122449fcd)) +* **deps:** update dependency mathjs to v7 ([#400](https://www.github.com/googleapis/nodejs-automl/issues/400)) ([8cdcd80](https://www.github.com/googleapis/nodejs-automl/commit/8cdcd80f2a4d6cd9cb64b39e7f1b153dc36e8a2f)) + +## [2.0.0](https://www.github.com/googleapis/nodejs-automl/compare/v1.11.0...v2.0.0) (2020-04-07) + + +### ⚠ BREAKING CHANGES + +* The library now supports Node.js v10+. The last version to support Node.js v8 is tagged legacy-8 on npm. + +### Features + +* drop node8 support, support for async iterators ([#364](https://www.github.com/googleapis/nodejs-automl/issues/364)) ([156ff6f](https://www.github.com/googleapis/nodejs-automl/commit/156ff6f70880244a698d7a7ef7cac831281dd1f8)) + +## [1.11.0](https://www.github.com/googleapis/nodejs-automl/compare/v1.10.1...v1.11.0) (2020-03-12) + + +### Features + +* deferred client initialization ([83ea415](https://www.github.com/googleapis/nodejs-automl/commit/83ea4156e8d57b65989d0ca8abc7ec39a45f3a82)) +* move to typescript code generation ([#332](https://www.github.com/googleapis/nodejs-automl/issues/332)) ([17f0d7a](https://www.github.com/googleapis/nodejs-automl/commit/17f0d7ab8393616a0aff557206cc233941782080)) +* publish proto updates for v1beta1 surface ([8b4a2b5](https://www.github.com/googleapis/nodejs-automl/commit/8b4a2b578629a624a1e9a318d6f3c503171fcc49)) + +### [1.10.1](https://www.github.com/googleapis/nodejs-automl/compare/v1.10.0...v1.10.1) (2020-01-28) + + +### Bug Fixes + +* enum, bytes, and Long types now accept strings ([6737cad](https://www.github.com/googleapis/nodejs-automl/commit/6737cad17f359cb0c2b3edd28093638d47c0d59e)) + +## [1.10.0](https://www.github.com/googleapis/nodejs-automl/compare/v1.9.2...v1.10.0) (2019-12-05) + + +### Features + +* support resource definitions ([#282](https://www.github.com/googleapis/nodejs-automl/issues/282)) ([439b440](https://www.github.com/googleapis/nodejs-automl/commit/439b440a709d4fba35f3c8fcf297bb20af7dd9d5)) + + +### Bug Fixes + +* **deps:** pin TypeScript below 3.7.0 ([927b5ee](https://www.github.com/googleapis/nodejs-automl/commit/927b5ee5b88cb62e6aa86e44443c6d072fe80669)) +* correct AutoML Natural Language region tags to match with all other languages ([bab8fcb](https://www.github.com/googleapis/nodejs-automl/commit/bab8fcbc7ff3cdc34892fa165085d6bd7964413e)) + +### [1.9.2](https://www.github.com/googleapis/nodejs-automl/compare/v1.9.1...v1.9.2) (2019-11-18) + + +### Bug Fixes + +* **docs:** bump release level to GA ([#280](https://www.github.com/googleapis/nodejs-automl/issues/280)) ([04c897e](https://www.github.com/googleapis/nodejs-automl/commit/04c897ee00642843eb30304186c1628ba0625d56)) + +### [1.9.1](https://www.github.com/googleapis/nodejs-automl/compare/v1.9.0...v1.9.1) (2019-11-18) + + +### Bug Fixes + +* add extra proto list ([#274](https://www.github.com/googleapis/nodejs-automl/issues/274)) ([d4c456b](https://www.github.com/googleapis/nodejs-automl/commit/d4c456b02629fdbcc090297c67dfe2defb946bb2)) +* **deps:** update dependency yargs to v15 ([#279](https://www.github.com/googleapis/nodejs-automl/issues/279)) ([1341a27](https://www.github.com/googleapis/nodejs-automl/commit/1341a275e7b3f935c8945f887339514a91e149da)) +* update PHP protos, Import automl operation protos ([#273](https://www.github.com/googleapis/nodejs-automl/issues/273)) ([c7b285f](https://www.github.com/googleapis/nodejs-automl/commit/c7b285fc3dfad0410f58ac71c0d70c6f7c51eb68)) + +## [1.9.0](https://www.github.com/googleapis/nodejs-automl/compare/v1.8.0...v1.9.0) (2019-11-12) + + +### Features + +* adds GetAnnotationSpec, DeployModel, UndeployModel, ExportModel ([#258](https://www.github.com/googleapis/nodejs-automl/issues/258)) ([0ffcec2](https://www.github.com/googleapis/nodejs-automl/commit/0ffcec2227ab36adb8e50f276837305f347dc9d7)) + + +### Bug Fixes + +* **docs:** snippets are now replaced in jsdoc comments ([#267](https://www.github.com/googleapis/nodejs-automl/issues/267)) ([5179b3c](https://www.github.com/googleapis/nodejs-automl/commit/5179b3c3991189d537794f43a0696838611be525)) + +## [1.8.0](https://www.github.com/googleapis/nodejs-automl/compare/v1.7.3...v1.8.0) (2019-10-31) + + +### Features + +* added samples for api-endpoints ([#259](https://www.github.com/googleapis/nodejs-automl/issues/259)) ([550ffb6](https://www.github.com/googleapis/nodejs-automl/commit/550ffb631a4d2516337dc85972ce4062b78e3ee2)) + + +### Bug Fixes + +* **samples:** remove extra print statement and "setEndpoint.js" from linkinator ([#261](https://www.github.com/googleapis/nodejs-automl/issues/261)) ([5fcb647](https://www.github.com/googleapis/nodejs-automl/commit/5fcb647ed8746ed34f93b01b95dbb67a518f29bb)) + +### [1.7.3](https://www.github.com/googleapis/nodejs-automl/compare/v1.7.2...v1.7.3) (2019-10-22) + + +### Bug Fixes + +* **deps:** bump google-gax to 1.7.5 ([#256](https://www.github.com/googleapis/nodejs-automl/issues/256)) ([950cefc](https://www.github.com/googleapis/nodejs-automl/commit/950cefc29281a74721fb8a5ca2cf2fff5e03dd65)) + +### [1.7.2](https://www.github.com/googleapis/nodejs-automl/compare/v1.7.1...v1.7.2) (2019-10-14) + + +### Bug Fixes + +* **deps:** update dependency execa to v3 ([#251](https://www.github.com/googleapis/nodejs-automl/issues/251)) ([13de52a](https://www.github.com/googleapis/nodejs-automl/commit/13de52a60d0bbced5b8fb6955d05c5526486c5bb)) + +### [1.7.1](https://www.github.com/googleapis/nodejs-automl/compare/v1.7.0...v1.7.1) (2019-10-08) + + +### Bug Fixes + +* createDataset now correctly returns operation ([770b572](https://www.github.com/googleapis/nodejs-automl/commit/770b572)) + +## [1.7.0](https://www.github.com/googleapis/nodejs-automl/compare/v1.6.0...v1.7.0) (2019-10-04) + + +### Bug Fixes + +* use compatible version of google-gax ([754467c](https://www.github.com/googleapis/nodejs-automl/commit/754467c)) + + +### Features + +* v1 API surface added ([#245](https://www.github.com/googleapis/nodejs-automl/issues/245)) ([dea9d08](https://www.github.com/googleapis/nodejs-automl/commit/dea9d08)) + +## [1.6.0](https://www.github.com/googleapis/nodejs-automl/compare/v1.5.0...v1.6.0) (2019-10-01) + + +### Features + +* adds ImageClassificationModelDeploymentMetadata ([42d766d](https://www.github.com/googleapis/nodejs-automl/commit/42d766d)) + +## [1.5.0](https://www.github.com/googleapis/nodejs-automl/compare/v1.4.0...v1.5.0) (2019-09-05) + + +### Features + +* load protos from JSON, grpc-fallback support ([ff43ecf](https://www.github.com/googleapis/nodejs-automl/commit/ff43ecf)) + +## [1.4.0](https://www.github.com/googleapis/nodejs-automl/compare/v1.3.0...v1.4.0) (2019-08-28) + + +### Bug Fixes + +* **deps:** update dependency yargs to v14 ([01aa9d6](https://www.github.com/googleapis/nodejs-automl/commit/01aa9d6)) +* **docs:** remove reference-docs anchor ([ee86e1d](https://www.github.com/googleapis/nodejs-automl/commit/ee86e1d)) + + +### Features + +* introduces configuration, e.g., dimensions, for doc prediction ([9c8ce64](https://www.github.com/googleapis/nodejs-automl/commit/9c8ce64)) + +## [1.3.0](https://www.github.com/googleapis/nodejs-automl/compare/v1.2.4...v1.3.0) (2019-08-19) + + +### Features + +* introduces validRowCount ([a776956](https://www.github.com/googleapis/nodejs-automl/commit/a776956)) + +### [1.2.4](https://www.github.com/googleapis/nodejs-automl/compare/v1.2.3...v1.2.4) (2019-08-05) + + +### Bug Fixes + +* allow calls with no request, add JSON proto ([c7bec4d](https://www.github.com/googleapis/nodejs-automl/commit/c7bec4d)) + +### [1.2.3](https://www.github.com/googleapis/nodejs-automl/compare/v1.2.2...v1.2.3) (2019-07-29) + + +### Bug Fixes + +* **deps:** update dependency execa to v2 ([#211](https://www.github.com/googleapis/nodejs-automl/issues/211)) ([751265a](https://www.github.com/googleapis/nodejs-automl/commit/751265a)) + +### [1.2.2](https://www.github.com/googleapis/nodejs-automl/compare/v1.2.1...v1.2.2) (2019-06-26) + + +### Bug Fixes + +* **docs:** link to reference docs section on googleapis.dev ([#205](https://www.github.com/googleapis/nodejs-automl/issues/205)) ([4e6d9a1](https://www.github.com/googleapis/nodejs-automl/commit/4e6d9a1)) + +### [1.2.1](https://www.github.com/googleapis/nodejs-automl/compare/v1.2.0...v1.2.1) (2019-06-14) + + +### Bug Fixes + +* parse CSV correctly ([#198](https://www.github.com/googleapis/nodejs-automl/issues/198)) ([8c0eb1c](https://www.github.com/googleapis/nodejs-automl/commit/8c0eb1c)) +* **docs:** move to new client docs URL ([#201](https://www.github.com/googleapis/nodejs-automl/issues/201)) ([3c01587](https://www.github.com/googleapis/nodejs-automl/commit/3c01587)) + +## [1.2.0](https://www.github.com/googleapis/nodejs-automl/compare/v1.1.1...v1.2.0) (2019-06-11) + + +### Bug Fixes + +* **deps:** update dependency mathjs to v6 ([#195](https://www.github.com/googleapis/nodejs-automl/issues/195)) ([47364ab](https://www.github.com/googleapis/nodejs-automl/commit/47364ab)) + + +### Features + +* add video object tracking support ([#194](https://www.github.com/googleapis/nodejs-automl/issues/194)) ([f9c737f](https://www.github.com/googleapis/nodejs-automl/commit/f9c737f)) + +### [1.1.1](https://www.github.com/googleapis/nodejs-automl/compare/v1.1.0...v1.1.1) (2019-06-06) + + +### Bug Fixes + +* default opts to empty object ([#191](https://www.github.com/googleapis/nodejs-automl/issues/191)) ([7846b04](https://www.github.com/googleapis/nodejs-automl/commit/7846b04)) + +## [1.1.0](https://www.github.com/googleapis/nodejs-automl/compare/v1.0.0...v1.1.0) (2019-05-23) + + +### Features + +* add .repo-metadata.json; allows us to generate new docs site ([#183](https://www.github.com/googleapis/nodejs-automl/issues/183)) ([8b42e76](https://www.github.com/googleapis/nodejs-automl/commit/8b42e76)) + +## [1.0.0](https://www.github.com/googleapis/nodejs-automl/compare/v0.2.0...v1.0.0) (2019-05-13) + + +### Bug Fixes + +* **deps:** update dependency google-gax to v1 ([#176](https://www.github.com/googleapis/nodejs-automl/issues/176)) ([423ae98](https://www.github.com/googleapis/nodejs-automl/commit/423ae98)) +* DEADLINE_EXCEEDED is no longer retried ([20eb86c](https://www.github.com/googleapis/nodejs-automl/commit/20eb86c)) +* DEADLINE_EXCEEDED retry code is idempotent ([#177](https://www.github.com/googleapis/nodejs-automl/issues/177)) ([e8313ab](https://www.github.com/googleapis/nodejs-automl/commit/e8313ab)) +* **deps:** update dependency google-gax to ^0.26.0 ([#166](https://www.github.com/googleapis/nodejs-automl/issues/166)) ([b449fc7](https://www.github.com/googleapis/nodejs-automl/commit/b449fc7)) + + +### Build System + +* upgrade engines field to >=8.10.0 ([#168](https://www.github.com/googleapis/nodejs-automl/issues/168)) ([249c7a8](https://www.github.com/googleapis/nodejs-automl/commit/249c7a8)) + + +### BREAKING CHANGES + +* upgrade engines field to >=8.10.0 (#168) + +## v0.2.0 + +04-03-2019 12:39 PDT + +### New Features +- feat: support new AutoML problems; add batchPredict, exportModel methods + +### Implementation Changes +- fix: include 'x-goog-request-params' header in requests ([#149](https://github.com/googleapis/nodejs-automl/pull/149)) + +### Documentation +- docs: use backticks for JS values ([#142](https://github.com/googleapis/nodejs-automl/pull/142)) + +### Internal / Testing Changes +- chore: publish to npm using wombat ([#145](https://github.com/googleapis/nodejs-automl/pull/145)) +- build: use per-repo publish token ([#144](https://github.com/googleapis/nodejs-automl/pull/144)) + +## v0.1.4 + +03-12-2019 13:50 PDT + +This patch release has a few bug fixes and dependency updates. Enjoy! + +### Bug fixes +- fix: throw on invalid credentials ([#130](https://github.com/googleapis/nodejs-automl/pull/130)) +- fix: use credential file to get project id ([#111](https://github.com/googleapis/nodejs-automl/pull/111)) + +### Dependencies +- fix(deps): update dependency google-gax to ^0.25.0 ([#120](https://github.com/googleapis/nodejs-automl/pull/120)) + +### Documentation +- docs(samples): move AutoML vision samples from nodejs-vision ([#134](https://github.com/googleapis/nodejs-automl/pull/134)) +- docs: update proto docs and code style +- docs: update links in contrib guide ([#132](https://github.com/googleapis/nodejs-automl/pull/132)) +- docs: update contributing path in README ([#127](https://github.com/googleapis/nodejs-automl/pull/127)) +- docs: move CONTRIBUTING.md to root ([#126](https://github.com/googleapis/nodejs-automl/pull/126)) +- docs: add lint/fix example to contributing guide ([#124](https://github.com/googleapis/nodejs-automl/pull/124)) +- docs: update examples in comments ([#123](https://github.com/googleapis/nodejs-automl/pull/123)) +- docs: proper require stmt ([#113](https://github.com/googleapis/nodejs-automl/pull/113)) + +### Internal / Testing Changes +- refactor: update json import paths ([#140](https://github.com/googleapis/nodejs-automl/pull/140)) +- build: Add docuploader credentials to node publish jobs ([#138](https://github.com/googleapis/nodejs-automl/pull/138)) +- build: use node10 to run samples-test, system-test etc ([#137](https://github.com/googleapis/nodejs-automl/pull/137)) +- build: update release configuration +- chore(deps): update dependency mocha to v6 +- build: use linkinator for docs test ([#131](https://github.com/googleapis/nodejs-automl/pull/131)) +- build: create docs test npm scripts ([#129](https://github.com/googleapis/nodejs-automl/pull/129)) +- build: test using @grpc/grpc-js in CI ([#128](https://github.com/googleapis/nodejs-automl/pull/128)) +- refactor: improve generated code style. ([#122](https://github.com/googleapis/nodejs-automl/pull/122)) +- chore: re-arrange exports. ([#121](https://github.com/googleapis/nodejs-automl/pull/121)) +- chore(deps): update dependency eslint-config-prettier to v4 ([#119](https://github.com/googleapis/nodejs-automl/pull/119)) +- build: ignore googleapis.com in doc link check ([#117](https://github.com/googleapis/nodejs-automl/pull/117)) +- chore: sync gapic files +- build: check broken links in generated docs ([#112](https://github.com/googleapis/nodejs-automl/pull/112)) +- test: add a basic system test ([#106](https://github.com/googleapis/nodejs-automl/pull/106)) + +## v0.1.3 + +12-15-2018 12:46 PST + +### Dependencies +- fix(deps): update dependency google-gax to ^0.22.0 ([#82](https://github.com/googleapis/nodejs-automl/pull/82)) +- fix(deps): update dependency google-gax to ^0.20.0 ([#47](https://github.com/googleapis/nodejs-automl/pull/47)) + +### Documentation +- docs: Add a comment to hint at format of payload for prediction. ([#93](https://github.com/googleapis/nodejs-automl/pull/93)) +- docs: update readme badges ([#90](https://github.com/googleapis/nodejs-automl/pull/90)) + +### Internal / Testing Changes +- chore: basic proto updates ([#105](https://github.com/googleapis/nodejs-automl/pull/105)) +- chore(build): inject yoshi automation key ([#104](https://github.com/googleapis/nodejs-automl/pull/104)) +- chore: update nyc and eslint configs ([#103](https://github.com/googleapis/nodejs-automl/pull/103)) +- chore: fix publish.sh permission +x ([#102](https://github.com/googleapis/nodejs-automl/pull/102)) +- fix(build): fix Kokoro release script ([#101](https://github.com/googleapis/nodejs-automl/pull/101)) +- build: add Kokoro configs for autorelease ([#100](https://github.com/googleapis/nodejs-automl/pull/100)) +- chore: always nyc report before calling codecov ([#98](https://github.com/googleapis/nodejs-automl/pull/98)) +- chore: nyc ignore build/test by default ([#97](https://github.com/googleapis/nodejs-automl/pull/97)) +- chore: clean up usage of prettier and eslint ([#96](https://github.com/googleapis/nodejs-automl/pull/96)) +- chore: update license file ([#92](https://github.com/googleapis/nodejs-automl/pull/92)) +- fix(build): fix system key decryption ([#88](https://github.com/googleapis/nodejs-automl/pull/88)) +- chore: add synth.metadata +- chore: update eslintignore config ([#81](https://github.com/googleapis/nodejs-automl/pull/81)) +- chore: drop contributors from multiple places ([#80](https://github.com/googleapis/nodejs-automl/pull/80)) +- chore: use latest npm on Windows ([#79](https://github.com/googleapis/nodejs-automl/pull/79)) +- chore: update CircleCI config ([#78](https://github.com/googleapis/nodejs-automl/pull/78)) +- chore: include build in eslintignore ([#75](https://github.com/googleapis/nodejs-automl/pull/75)) +- chore(deps): update dependency eslint-plugin-node to v8 ([#71](https://github.com/googleapis/nodejs-automl/pull/71)) +- chore: update issue templates ([#70](https://github.com/googleapis/nodejs-automl/pull/70)) +- chore: remove old issue template ([#68](https://github.com/googleapis/nodejs-automl/pull/68)) +- build: run tests on node11 ([#67](https://github.com/googleapis/nodejs-automl/pull/67)) +- chores(build): do not collect sponge.xml from windows builds ([#66](https://github.com/googleapis/nodejs-automl/pull/66)) +- chores(build): run codecov on continuous builds ([#65](https://github.com/googleapis/nodejs-automl/pull/65)) +- chore: update new issue template ([#64](https://github.com/googleapis/nodejs-automl/pull/64)) +- build: fix codecov uploading on Kokoro ([#61](https://github.com/googleapis/nodejs-automl/pull/61)) +- Update kokoro config ([#59](https://github.com/googleapis/nodejs-automl/pull/59)) +- chore(deps): update dependency eslint-plugin-prettier to v3 ([#58](https://github.com/googleapis/nodejs-automl/pull/58)) +- build: prevent system/sample-test from leaking credentials +- Update kokoro config ([#55](https://github.com/googleapis/nodejs-automl/pull/55)) +- test: remove appveyor config ([#54](https://github.com/googleapis/nodejs-automl/pull/54)) +- Update the CI config ([#53](https://github.com/googleapis/nodejs-automl/pull/53)) +- Enable prefer-const in the eslint config ([#51](https://github.com/googleapis/nodejs-automl/pull/51)) +- Enable no-var in eslint ([#50](https://github.com/googleapis/nodejs-automl/pull/50)) +- Switch to let/const ([#49](https://github.com/googleapis/nodejs-automl/pull/49)) +- test: throw on deprecation ([#23](https://github.com/googleapis/nodejs-automl/pull/23)) +- Update CI config ([#46](https://github.com/googleapis/nodejs-automl/pull/46)) +- Remove unused dependencies ([#44](https://github.com/googleapis/nodejs-automl/pull/44)) +- Retry npm install in CI ([#43](https://github.com/googleapis/nodejs-automl/pull/43)) +- Update CI config ([#40](https://github.com/googleapis/nodejs-automl/pull/40)) +- Re-generate library using /synth.py ([#39](https://github.com/googleapis/nodejs-automl/pull/39)) +- chore(deps): update dependency nyc to v13 ([#37](https://github.com/googleapis/nodejs-automl/pull/37)) +- Update the CI config ([#36](https://github.com/googleapis/nodejs-automl/pull/36)) + +## v0.1.2 + +### Dependency updates +- fix(deps): update dependency google-gax to ^0.19.0 (#31) +- fix(deps): update dependency google-gax to ^0.18.0 (#22) +- chore(deps): update dependency eslint-config-prettier to v3 (#30) + +### Keepin' the lights on +- chore: make the CircleCI config consistent (#32) +- chore: do not use npm ci (#29) +- chore: ignore package-lock.json (#27) +- chore(deps): lock file maintenance (#26) +- chore(deps): lock file maintenance (#25) +- chore: update renovate config (#24) +- chore(deps): lock file maintenance (#21) +- chore: move mocha options to mocha.opts (#19) +- chore: require node 8 for samples (#20) +- Re-generate library using /synth.py (#18) +- chore(deps): lock file maintenance (#17) +- nit: Google LLC (#16) + +## v0.1.1 + +This patch release addresses a namespacing issue that affected our docs. + +### Documentation +- Add missing JSDoc namespaces. (#14) diff --git a/packages/google-cloud-automl/CODE_OF_CONDUCT.md b/packages/google-cloud-automl/CODE_OF_CONDUCT.md new file mode 100644 index 00000000000..2add2547a81 --- /dev/null +++ b/packages/google-cloud-automl/CODE_OF_CONDUCT.md @@ -0,0 +1,94 @@ + +# Code of Conduct + +## Our Pledge + +In the interest of fostering an open and welcoming environment, we as +contributors and maintainers pledge to making participation in our project and +our community a harassment-free experience for everyone, regardless of age, body +size, disability, ethnicity, gender identity and expression, level of +experience, education, socio-economic status, nationality, personal appearance, +race, religion, or sexual identity and orientation. + +## Our Standards + +Examples of behavior that contributes to creating a positive environment +include: + +* Using welcoming and inclusive language +* Being respectful of differing viewpoints and experiences +* Gracefully accepting constructive criticism +* Focusing on what is best for the community +* Showing empathy towards other community members + +Examples of unacceptable behavior by participants include: + +* The use of sexualized language or imagery and unwelcome sexual attention or + advances +* Trolling, insulting/derogatory comments, and personal or political attacks +* Public or private harassment +* Publishing others' private information, such as a physical or electronic + address, without explicit permission +* Other conduct which could reasonably be considered inappropriate in a + professional setting + +## Our Responsibilities + +Project maintainers are responsible for clarifying the standards of acceptable +behavior and are expected to take appropriate and fair corrective action in +response to any instances of unacceptable behavior. + +Project maintainers have the right and responsibility to remove, edit, or reject +comments, commits, code, wiki edits, issues, and other contributions that are +not aligned to this Code of Conduct, or to ban temporarily or permanently any +contributor for other behaviors that they deem inappropriate, threatening, +offensive, or harmful. + +## Scope + +This Code of Conduct applies both within project spaces and in public spaces +when an individual is representing the project or its community. Examples of +representing a project or community include using an official project e-mail +address, posting via an official social media account, or acting as an appointed +representative at an online or offline event. Representation of a project may be +further defined and clarified by project maintainers. + +This Code of Conduct also applies outside the project spaces when the Project +Steward has a reasonable belief that an individual's behavior may have a +negative impact on the project or its community. + +## Conflict Resolution + +We do not believe that all conflict is bad; healthy debate and disagreement +often yield positive results. However, it is never okay to be disrespectful or +to engage in behavior that violates the project’s code of conduct. + +If you see someone violating the code of conduct, you are encouraged to address +the behavior directly with those involved. Many issues can be resolved quickly +and easily, and this gives people more control over the outcome of their +dispute. If you are unable to resolve the matter for any reason, or if the +behavior is threatening or harassing, report it. We are dedicated to providing +an environment where participants feel welcome and safe. + +Reports should be directed to *googleapis-stewards@google.com*, the +Project Steward(s) for *Google Cloud Client Libraries*. It is the Project Steward’s duty to +receive and address reported violations of the code of conduct. They will then +work with a committee consisting of representatives from the Open Source +Programs Office and the Google Open Source Strategy team. If for any reason you +are uncomfortable reaching out to the Project Steward, please email +opensource@google.com. + +We will investigate every complaint, but you may not receive a direct response. +We will use our discretion in determining when and how to follow up on reported +incidents, which may range from not taking action to permanent expulsion from +the project and project-sponsored spaces. We will notify the accused of the +report and provide them an opportunity to discuss it before any action is taken. +The identity of the reporter will be omitted from the details of the report +supplied to the accused. In potentially harmful situations, such as ongoing +harassment or threats to anyone's safety, we may take action without notice. + +## Attribution + +This Code of Conduct is adapted from the Contributor Covenant, version 1.4, +available at +https://www.contributor-covenant.org/version/1/4/code-of-conduct.html \ No newline at end of file diff --git a/packages/google-cloud-automl/CONTRIBUTING.md b/packages/google-cloud-automl/CONTRIBUTING.md new file mode 100644 index 00000000000..7fff5f7449f --- /dev/null +++ b/packages/google-cloud-automl/CONTRIBUTING.md @@ -0,0 +1,76 @@ +# How to become a contributor and submit your own code + +**Table of contents** + +* [Contributor License Agreements](#contributor-license-agreements) +* [Contributing a patch](#contributing-a-patch) +* [Running the tests](#running-the-tests) +* [Releasing the library](#releasing-the-library) + +## Contributor License Agreements + +We'd love to accept your sample apps and patches! Before we can take them, we +have to jump a couple of legal hurdles. + +Please fill out either the individual or corporate Contributor License Agreement +(CLA). + + * If you are an individual writing original source code and you're sure you + own the intellectual property, then you'll need to sign an [individual CLA](https://developers.google.com/open-source/cla/individual). + * If you work for a company that wants to allow you to contribute your work, + then you'll need to sign a [corporate CLA](https://developers.google.com/open-source/cla/corporate). + +Follow either of the two links above to access the appropriate CLA and +instructions for how to sign and return it. Once we receive it, we'll be able to +accept your pull requests. + +## Contributing A Patch + +1. Submit an issue describing your proposed change to the repo in question. +1. The repo owner will respond to your issue promptly. +1. If your proposed change is accepted, and you haven't already done so, sign a + Contributor License Agreement (see details above). +1. Fork the desired repo, develop and test your code changes. +1. Ensure that your code adheres to the existing style in the code to which + you are contributing. +1. Ensure that your code has an appropriate set of tests which all pass. +1. Title your pull request following [Conventional Commits](https://www.conventionalcommits.org/) styling. +1. Submit a pull request. + +### Before you begin + +1. [Select or create a Cloud Platform project][projects]. +1. [Enable billing for your project][billing]. +1. [Enable the Cloud AutoML API][enable_api]. +1. [Set up authentication with a service account][auth] so you can access the + API from your local workstation. + + +## Running the tests + +1. [Prepare your environment for Node.js setup][setup]. + +1. Install dependencies: + + npm install + +1. Run the tests: + + # Run unit tests. + npm test + + # Run sample integration tests. + npm run samples-test + + # Run all system tests. + npm run system-test + +1. Lint (and maybe fix) any changes: + + npm run fix + +[setup]: https://cloud.google.com/nodejs/docs/setup +[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=automl.googleapis.com +[auth]: https://cloud.google.com/docs/authentication/getting-started \ No newline at end of file diff --git a/packages/google-cloud-automl/LICENSE b/packages/google-cloud-automl/LICENSE new file mode 100644 index 00000000000..d6456956733 --- /dev/null +++ b/packages/google-cloud-automl/LICENSE @@ -0,0 +1,202 @@ + + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright [yyyy] [name of copyright owner] + + Licensed under the Apache License, Version 2.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. diff --git a/packages/google-cloud-automl/README.md b/packages/google-cloud-automl/README.md new file mode 100644 index 00000000000..37022ee4dd8 --- /dev/null +++ b/packages/google-cloud-automl/README.md @@ -0,0 +1,253 @@ +[//]: # "This README.md file is auto-generated, all changes to this file will be lost." +[//]: # "To regenerate it, use `python -m synthtool`." +Google Cloud Platform logo + +# [Cloud AutoML: Node.js Client](https://github.com/googleapis/google-cloud-node/tree/main/packages/google-cloud-automl) + +[![release level](https://img.shields.io/badge/release%20level-stable-brightgreen.svg?style=flat)](https://cloud.google.com/terms/launch-stages) +[![npm version](https://img.shields.io/npm/v/@google-cloud/automl.svg)](https://www.npmjs.org/package/@google-cloud/automl) + + + + +Cloud AutoML API client for Node.js + + +A comprehensive list of changes in each version may be found in +[the CHANGELOG](https://github.com/googleapis/google-cloud-node/tree/main/packages/google-cloud-automl/CHANGELOG.md). + +* [Cloud AutoML Node.js Client API Reference][client-docs] +* [Cloud AutoML Documentation][product-docs] +* [github.com/googleapis/google-cloud-node/packages/google-cloud-automl](https://github.com/googleapis/google-cloud-node/tree/main/packages/google-cloud-automl) + +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) + * [Using the client library](#using-the-client-library) +* [Samples](#samples) +* [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 Cloud AutoML API][enable_api]. +1. [Set up authentication with a service account][auth] so you can access the + API from your local workstation. + +### Installing the client library + +```bash +npm install @google-cloud/automl +``` + + +### Using the client library + +```javascript +/** + * TODO(developer): Uncomment these variables before running the sample. + */ +// const projectId = 'YOUR_PROJECT_ID'; +// const location = 'us-central1'; + +// Imports the Google Cloud AutoML library +const {AutoMlClient} = require('@google-cloud/automl').v1; + +// Instantiates a client +const client = new AutoMlClient(); + +async function listDatasets() { + // Construct request + const request = { + parent: client.locationPath(projectId, location), + filter: 'translation_dataset_metadata:*', + }; + + const [response] = await client.listDatasets(request); + + console.log('List of datasets:'); + for (const dataset of response) { + console.log(`Dataset name: ${dataset.name}`); + console.log( + `Dataset id: ${ + dataset.name.split('/')[dataset.name.split('/').length - 1] + }` + ); + console.log(`Dataset display name: ${dataset.displayName}`); + console.log('Dataset create time'); + console.log(`\tseconds ${dataset.createTime.seconds}`); + console.log(`\tnanos ${dataset.createTime.nanos / 1e9}`); + console.log( + `Text extraction dataset metadata: ${dataset.textExtractionDatasetMetadata}` + ); + + console.log( + `Text sentiment dataset metadata: ${dataset.textSentimentDatasetMetadata}` + ); + + console.log( + `Text classification dataset metadata: ${dataset.textClassificationDatasetMetadata}` + ); + + if (dataset.translationDatasetMetadata !== undefined) { + console.log('Translation dataset metadata:'); + console.log( + `\tSource language code: ${dataset.translationDatasetMetadata.sourceLanguageCode}` + ); + console.log( + `\tTarget language code: ${dataset.translationDatasetMetadata.targetLanguageCode}` + ); + } + + console.log( + `Image classification dataset metadata: ${dataset.imageClassificationDatasetMetadata}` + ); + + console.log( + `Image object detection dataset metatdata: ${dataset.imageObjectDetectionDatasetMetatdata}` + ); + } +} + +listDatasets(); + +``` + + + +## Samples + +Samples are in the [`samples/`](https://github.com/googleapis/google-cloud-node/tree/main/packages/google-cloud-automl/samples) directory. Each sample's `README.md` has instructions for running its sample. + +| Sample | Source Code | Try it | +| --------------------------- | --------------------------------- | ------ | +| Auto_ml.create_dataset | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-automl/samples/generated/v1/auto_ml.create_dataset.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-cloud-automl/samples/generated/v1/auto_ml.create_dataset.js,packages/google-cloud-automl/samples/README.md) | +| Auto_ml.create_model | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-automl/samples/generated/v1/auto_ml.create_model.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-cloud-automl/samples/generated/v1/auto_ml.create_model.js,packages/google-cloud-automl/samples/README.md) | +| Auto_ml.delete_dataset | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-automl/samples/generated/v1/auto_ml.delete_dataset.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-cloud-automl/samples/generated/v1/auto_ml.delete_dataset.js,packages/google-cloud-automl/samples/README.md) | +| Auto_ml.delete_model | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-automl/samples/generated/v1/auto_ml.delete_model.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-cloud-automl/samples/generated/v1/auto_ml.delete_model.js,packages/google-cloud-automl/samples/README.md) | +| Auto_ml.deploy_model | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-automl/samples/generated/v1/auto_ml.deploy_model.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-cloud-automl/samples/generated/v1/auto_ml.deploy_model.js,packages/google-cloud-automl/samples/README.md) | +| Auto_ml.export_data | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-automl/samples/generated/v1/auto_ml.export_data.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-cloud-automl/samples/generated/v1/auto_ml.export_data.js,packages/google-cloud-automl/samples/README.md) | +| Auto_ml.export_model | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-automl/samples/generated/v1/auto_ml.export_model.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-cloud-automl/samples/generated/v1/auto_ml.export_model.js,packages/google-cloud-automl/samples/README.md) | +| Auto_ml.get_annotation_spec | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-automl/samples/generated/v1/auto_ml.get_annotation_spec.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-cloud-automl/samples/generated/v1/auto_ml.get_annotation_spec.js,packages/google-cloud-automl/samples/README.md) | +| Auto_ml.get_dataset | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-automl/samples/generated/v1/auto_ml.get_dataset.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-cloud-automl/samples/generated/v1/auto_ml.get_dataset.js,packages/google-cloud-automl/samples/README.md) | +| Auto_ml.get_model | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-automl/samples/generated/v1/auto_ml.get_model.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-cloud-automl/samples/generated/v1/auto_ml.get_model.js,packages/google-cloud-automl/samples/README.md) | +| Auto_ml.get_model_evaluation | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-automl/samples/generated/v1/auto_ml.get_model_evaluation.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-cloud-automl/samples/generated/v1/auto_ml.get_model_evaluation.js,packages/google-cloud-automl/samples/README.md) | +| Auto_ml.import_data | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-automl/samples/generated/v1/auto_ml.import_data.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-cloud-automl/samples/generated/v1/auto_ml.import_data.js,packages/google-cloud-automl/samples/README.md) | +| Auto_ml.list_datasets | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-automl/samples/generated/v1/auto_ml.list_datasets.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-cloud-automl/samples/generated/v1/auto_ml.list_datasets.js,packages/google-cloud-automl/samples/README.md) | +| Auto_ml.list_model_evaluations | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-automl/samples/generated/v1/auto_ml.list_model_evaluations.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-cloud-automl/samples/generated/v1/auto_ml.list_model_evaluations.js,packages/google-cloud-automl/samples/README.md) | +| Auto_ml.list_models | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-automl/samples/generated/v1/auto_ml.list_models.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-cloud-automl/samples/generated/v1/auto_ml.list_models.js,packages/google-cloud-automl/samples/README.md) | +| Auto_ml.undeploy_model | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-automl/samples/generated/v1/auto_ml.undeploy_model.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-cloud-automl/samples/generated/v1/auto_ml.undeploy_model.js,packages/google-cloud-automl/samples/README.md) | +| Auto_ml.update_dataset | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-automl/samples/generated/v1/auto_ml.update_dataset.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-cloud-automl/samples/generated/v1/auto_ml.update_dataset.js,packages/google-cloud-automl/samples/README.md) | +| Auto_ml.update_model | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-automl/samples/generated/v1/auto_ml.update_model.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-cloud-automl/samples/generated/v1/auto_ml.update_model.js,packages/google-cloud-automl/samples/README.md) | +| Prediction_service.batch_predict | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-automl/samples/generated/v1/prediction_service.batch_predict.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-cloud-automl/samples/generated/v1/prediction_service.batch_predict.js,packages/google-cloud-automl/samples/README.md) | +| Prediction_service.predict | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-automl/samples/generated/v1/prediction_service.predict.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-cloud-automl/samples/generated/v1/prediction_service.predict.js,packages/google-cloud-automl/samples/README.md) | +| Auto_ml.create_dataset | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-automl/samples/generated/v1beta1/auto_ml.create_dataset.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-cloud-automl/samples/generated/v1beta1/auto_ml.create_dataset.js,packages/google-cloud-automl/samples/README.md) | +| Auto_ml.create_model | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-automl/samples/generated/v1beta1/auto_ml.create_model.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-cloud-automl/samples/generated/v1beta1/auto_ml.create_model.js,packages/google-cloud-automl/samples/README.md) | +| Auto_ml.delete_dataset | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-automl/samples/generated/v1beta1/auto_ml.delete_dataset.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-cloud-automl/samples/generated/v1beta1/auto_ml.delete_dataset.js,packages/google-cloud-automl/samples/README.md) | +| Auto_ml.delete_model | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-automl/samples/generated/v1beta1/auto_ml.delete_model.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-cloud-automl/samples/generated/v1beta1/auto_ml.delete_model.js,packages/google-cloud-automl/samples/README.md) | +| Auto_ml.deploy_model | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-automl/samples/generated/v1beta1/auto_ml.deploy_model.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-cloud-automl/samples/generated/v1beta1/auto_ml.deploy_model.js,packages/google-cloud-automl/samples/README.md) | +| Auto_ml.export_data | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-automl/samples/generated/v1beta1/auto_ml.export_data.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-cloud-automl/samples/generated/v1beta1/auto_ml.export_data.js,packages/google-cloud-automl/samples/README.md) | +| Auto_ml.export_evaluated_examples | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-automl/samples/generated/v1beta1/auto_ml.export_evaluated_examples.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-cloud-automl/samples/generated/v1beta1/auto_ml.export_evaluated_examples.js,packages/google-cloud-automl/samples/README.md) | +| Auto_ml.export_model | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-automl/samples/generated/v1beta1/auto_ml.export_model.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-cloud-automl/samples/generated/v1beta1/auto_ml.export_model.js,packages/google-cloud-automl/samples/README.md) | +| Auto_ml.get_annotation_spec | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-automl/samples/generated/v1beta1/auto_ml.get_annotation_spec.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-cloud-automl/samples/generated/v1beta1/auto_ml.get_annotation_spec.js,packages/google-cloud-automl/samples/README.md) | +| Auto_ml.get_column_spec | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-automl/samples/generated/v1beta1/auto_ml.get_column_spec.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-cloud-automl/samples/generated/v1beta1/auto_ml.get_column_spec.js,packages/google-cloud-automl/samples/README.md) | +| Auto_ml.get_dataset | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-automl/samples/generated/v1beta1/auto_ml.get_dataset.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-cloud-automl/samples/generated/v1beta1/auto_ml.get_dataset.js,packages/google-cloud-automl/samples/README.md) | +| Auto_ml.get_model | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-automl/samples/generated/v1beta1/auto_ml.get_model.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-cloud-automl/samples/generated/v1beta1/auto_ml.get_model.js,packages/google-cloud-automl/samples/README.md) | +| Auto_ml.get_model_evaluation | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-automl/samples/generated/v1beta1/auto_ml.get_model_evaluation.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-cloud-automl/samples/generated/v1beta1/auto_ml.get_model_evaluation.js,packages/google-cloud-automl/samples/README.md) | +| Auto_ml.get_table_spec | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-automl/samples/generated/v1beta1/auto_ml.get_table_spec.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-cloud-automl/samples/generated/v1beta1/auto_ml.get_table_spec.js,packages/google-cloud-automl/samples/README.md) | +| Auto_ml.import_data | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-automl/samples/generated/v1beta1/auto_ml.import_data.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-cloud-automl/samples/generated/v1beta1/auto_ml.import_data.js,packages/google-cloud-automl/samples/README.md) | +| Auto_ml.list_column_specs | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-automl/samples/generated/v1beta1/auto_ml.list_column_specs.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-cloud-automl/samples/generated/v1beta1/auto_ml.list_column_specs.js,packages/google-cloud-automl/samples/README.md) | +| Auto_ml.list_datasets | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-automl/samples/generated/v1beta1/auto_ml.list_datasets.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-cloud-automl/samples/generated/v1beta1/auto_ml.list_datasets.js,packages/google-cloud-automl/samples/README.md) | +| Auto_ml.list_model_evaluations | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-automl/samples/generated/v1beta1/auto_ml.list_model_evaluations.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-cloud-automl/samples/generated/v1beta1/auto_ml.list_model_evaluations.js,packages/google-cloud-automl/samples/README.md) | +| Auto_ml.list_models | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-automl/samples/generated/v1beta1/auto_ml.list_models.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-cloud-automl/samples/generated/v1beta1/auto_ml.list_models.js,packages/google-cloud-automl/samples/README.md) | +| Auto_ml.list_table_specs | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-automl/samples/generated/v1beta1/auto_ml.list_table_specs.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-cloud-automl/samples/generated/v1beta1/auto_ml.list_table_specs.js,packages/google-cloud-automl/samples/README.md) | +| Auto_ml.undeploy_model | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-automl/samples/generated/v1beta1/auto_ml.undeploy_model.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-cloud-automl/samples/generated/v1beta1/auto_ml.undeploy_model.js,packages/google-cloud-automl/samples/README.md) | +| Auto_ml.update_column_spec | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-automl/samples/generated/v1beta1/auto_ml.update_column_spec.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-cloud-automl/samples/generated/v1beta1/auto_ml.update_column_spec.js,packages/google-cloud-automl/samples/README.md) | +| Auto_ml.update_dataset | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-automl/samples/generated/v1beta1/auto_ml.update_dataset.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-cloud-automl/samples/generated/v1beta1/auto_ml.update_dataset.js,packages/google-cloud-automl/samples/README.md) | +| Auto_ml.update_table_spec | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-automl/samples/generated/v1beta1/auto_ml.update_table_spec.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-cloud-automl/samples/generated/v1beta1/auto_ml.update_table_spec.js,packages/google-cloud-automl/samples/README.md) | +| Prediction_service.batch_predict | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-automl/samples/generated/v1beta1/prediction_service.batch_predict.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-cloud-automl/samples/generated/v1beta1/prediction_service.batch_predict.js,packages/google-cloud-automl/samples/README.md) | +| Prediction_service.predict | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-automl/samples/generated/v1beta1/prediction_service.predict.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-cloud-automl/samples/generated/v1beta1/prediction_service.predict.js,packages/google-cloud-automl/samples/README.md) | +| Quickstart | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-automl/samples/quickstart.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-cloud-automl/samples/quickstart.js,packages/google-cloud-automl/samples/README.md) | + + + +The [Cloud AutoML Node.js Client API Reference][client-docs] documentation +also contains 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/automl@legacy-8` installs client libraries +for versions compatible with Node.js 8. + +## Versioning + +This library follows [Semantic Versioning](http://semver.org/). + + + +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. + + + + + + +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](https://github.com/googleapis/google-cloud-node/blob/main/CONTRIBUTING.md). + +Please note that this `README.md`, the `samples/README.md`, +and a variety of configuration files in this repository (including `.nycrc` and `tsconfig.json`) +are generated from a central template. To edit one of these files, make an edit +to its templates in +[directory](https://github.com/googleapis/synthtool). + +## License + +Apache Version 2.0 + +See [LICENSE](https://github.com/googleapis/google-cloud-node/blob/main/LICENSE) + +[client-docs]: https://cloud.google.com/nodejs/docs/reference/automl/latest +[product-docs]: https://cloud.google.com/automl/docs/ +[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=automl.googleapis.com +[auth]: https://cloud.google.com/docs/authentication/getting-started diff --git a/packages/google-cloud-automl/linkinator.config.json b/packages/google-cloud-automl/linkinator.config.json new file mode 100644 index 00000000000..befd23c8633 --- /dev/null +++ b/packages/google-cloud-automl/linkinator.config.json @@ -0,0 +1,16 @@ +{ + "recurse": true, + "skip": [ + "https://codecov.io/gh/googleapis/", + "www.googleapis.com", + "img.shields.io", + "https://console.cloud.google.com/cloudshell", + "https://support.google.com" + ], + "silent": true, + "concurrency": 5, + "retry": true, + "retryErrors": true, + "retryErrorsCount": 5, + "retryErrorsJitter": 3000 +} diff --git a/packages/google-cloud-automl/owlbot.py b/packages/google-cloud-automl/owlbot.py new file mode 100644 index 00000000000..e4b3256d52a --- /dev/null +++ b/packages/google-cloud-automl/owlbot.py @@ -0,0 +1,20 @@ +# Copyright 2018 Google LLC +# +# Licensed under the Apache License, Version 2.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. + +import synthtool.languages.node_mono_repo as node + +node.owlbot_main(relative_dir="packages/google-cloud-automl", + staging_excludes=['README.md', 'package.json'], + templates_excludes=['.kokoro/trampoline.sh', '.kokoro/continuous/node12/samples-test.cfg', '.kokoro/presubmit/node12/samples-test.cfg'] +) \ No newline at end of file diff --git a/packages/google-cloud-automl/package.json b/packages/google-cloud-automl/package.json new file mode 100644 index 00000000000..d7d83fcfeb4 --- /dev/null +++ b/packages/google-cloud-automl/package.json @@ -0,0 +1,75 @@ +{ + "name": "@google-cloud/automl", + "description": "Cloud AutoML API client for Node.js", + "version": "4.0.2", + "license": "Apache-2.0", + "author": "Google LLC", + "engines": { + "node": ">=14.0.0" + }, + "repository": { + "type": "git", + "directory": "packages/google-cloud-automl", + "url": "https://github.com/googleapis/google-cloud-node.git" + }, + "main": "build/src/index.js", + "files": [ + "build/protos", + "build/src" + ], + "keywords": [ + "google apis client", + "google api client", + "google apis", + "google api", + "google", + "google cloud platform", + "google cloud", + "cloud", + "google automl", + "automl", + "Cloud AutoML API" + ], + "scripts": { + "test": "c8 mocha build/test", + "samples-test": "npm run compile && cd samples/ && npm link ../ && npm i && npm test", + "lint": "gts check", + "fix": "gts fix", + "prelint": "cd samples; npm link ../; npm install", + "system-test": "npm run compile && c8 mocha build/system-test", + "docs": "jsdoc -c .jsdoc.js", + "docs-test": "linkinator docs", + "predocs-test": "npm run docs", + "clean": "gts clean", + "compile": "tsc -p . && cp -r protos build/", + "compile-protos": "compileProtos src", + "prepare": "npm run compile", + "precompile": "gts clean" + }, + "dependencies": { + "google-gax": "^4.0.3" + }, + "devDependencies": { + "@types/mocha": "^9.0.0", + "@types/node": "^20.4.9", + "@types/sinon": "^10.0.0", + "c8": "^8.0.1", + "codecov": "^3.6.5", + "gapic-tools": "^0.1.8", + "gts": "^5.0.0", + "jsdoc": "^4.0.0", + "jsdoc-fresh": "^3.0.0", + "jsdoc-region-tag": "^3.0.0", + "long": "^5.2.3", + "linkinator": "4.1.2", + "mocha": "^9.2.2", + "null-loader": "^4.0.0", + "pack-n-play": "^1.0.0-2", + "sinon": "^15.0.0", + "ts-loader": "^9.0.0", + "typescript": "^5.1.6", + "webpack": "^5.0.0", + "webpack-cli": "^5.0.0" + }, + "homepage": "https://github.com/googleapis/google-cloud-node/tree/main/packages/google-cloud-automl" +} diff --git a/packages/google-cloud-automl/protos/google/cloud/automl/v1/annotation_payload.proto b/packages/google-cloud-automl/protos/google/cloud/automl/v1/annotation_payload.proto new file mode 100644 index 00000000000..e8fd89c2585 --- /dev/null +++ b/packages/google-cloud-automl/protos/google/cloud/automl/v1/annotation_payload.proto @@ -0,0 +1,65 @@ +// 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 +// +// 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.automl.v1; + +import "google/cloud/automl/v1/classification.proto"; +import "google/cloud/automl/v1/detection.proto"; +import "google/cloud/automl/v1/text_extraction.proto"; +import "google/cloud/automl/v1/text_sentiment.proto"; +import "google/cloud/automl/v1/translation.proto"; + +option csharp_namespace = "Google.Cloud.AutoML.V1"; +option go_package = "cloud.google.com/go/automl/apiv1/automlpb;automlpb"; +option java_multiple_files = true; +option java_package = "com.google.cloud.automl.v1"; +option php_namespace = "Google\\Cloud\\AutoMl\\V1"; +option ruby_package = "Google::Cloud::AutoML::V1"; + +// Contains annotation information that is relevant to AutoML. +message AnnotationPayload { + // Output only . Additional information about the annotation + // specific to the AutoML domain. + oneof detail { + // Annotation details for translation. + TranslationAnnotation translation = 2; + + // Annotation details for content or image classification. + ClassificationAnnotation classification = 3; + + // Annotation details for image object detection. + ImageObjectDetectionAnnotation image_object_detection = 4; + + // Annotation details for text extraction. + TextExtractionAnnotation text_extraction = 6; + + // Annotation details for text sentiment. + TextSentimentAnnotation text_sentiment = 7; + } + + // Output only . The resource ID of the annotation spec that + // this annotation pertains to. The annotation spec comes from either an + // ancestor dataset, or the dataset that was used to train the model in use. + string annotation_spec_id = 1; + + // Output only. The value of + // [display_name][google.cloud.automl.v1.AnnotationSpec.display_name] + // when the model was trained. Because this field returns a value at model + // training time, for different models trained using the same dataset, the + // returned value could be different as model owner could update the + // `display_name` between any two model training. + string display_name = 5; +} diff --git a/packages/google-cloud-automl/protos/google/cloud/automl/v1/annotation_spec.proto b/packages/google-cloud-automl/protos/google/cloud/automl/v1/annotation_spec.proto new file mode 100644 index 00000000000..75cd334f0b5 --- /dev/null +++ b/packages/google-cloud-automl/protos/google/cloud/automl/v1/annotation_spec.proto @@ -0,0 +1,47 @@ +// 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 +// +// 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.automl.v1; + +import "google/api/resource.proto"; + +option csharp_namespace = "Google.Cloud.AutoML.V1"; +option go_package = "cloud.google.com/go/automl/apiv1/automlpb;automlpb"; +option java_multiple_files = true; +option java_package = "com.google.cloud.automl.v1"; +option php_namespace = "Google\\Cloud\\AutoMl\\V1"; +option ruby_package = "Google::Cloud::AutoML::V1"; + +// A definition of an annotation spec. +message AnnotationSpec { + option (google.api.resource) = { + type: "automl.googleapis.com/AnnotationSpec" + pattern: "projects/{project}/locations/{location}/datasets/{dataset}/annotationSpecs/{annotation_spec}" + }; + + // Output only. Resource name of the annotation spec. + // Form: + // 'projects/{project_id}/locations/{location_id}/datasets/{dataset_id}/annotationSpecs/{annotation_spec_id}' + string name = 1; + + // Required. The name of the annotation spec to show in the interface. The name can be + // up to 32 characters long and must match the regexp `[a-zA-Z0-9_]+`. + string display_name = 2; + + // Output only. The number of examples in the parent dataset + // labeled by the annotation spec. + int32 example_count = 9; +} diff --git a/packages/google-cloud-automl/protos/google/cloud/automl/v1/classification.proto b/packages/google-cloud-automl/protos/google/cloud/automl/v1/classification.proto new file mode 100644 index 00000000000..3982ee4bd94 --- /dev/null +++ b/packages/google-cloud-automl/protos/google/cloud/automl/v1/classification.proto @@ -0,0 +1,173 @@ +// 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 +// +// 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.automl.v1; + +option csharp_namespace = "Google.Cloud.AutoML.V1"; +option go_package = "cloud.google.com/go/automl/apiv1/automlpb;automlpb"; +option java_multiple_files = true; +option java_outer_classname = "ClassificationProto"; +option java_package = "com.google.cloud.automl.v1"; +option php_namespace = "Google\\Cloud\\AutoMl\\V1"; +option ruby_package = "Google::Cloud::AutoML::V1"; + +// Type of the classification problem. +enum ClassificationType { + // An un-set value of this enum. + CLASSIFICATION_TYPE_UNSPECIFIED = 0; + + // At most one label is allowed per example. + MULTICLASS = 1; + + // Multiple labels are allowed for one example. + MULTILABEL = 2; +} + +// Contains annotation details specific to classification. +message ClassificationAnnotation { + // Output only. A confidence estimate between 0.0 and 1.0. A higher value + // means greater confidence that the annotation is positive. If a user + // approves an annotation as negative or positive, the score value remains + // unchanged. If a user creates an annotation, the score is 0 for negative or + // 1 for positive. + float score = 1; +} + +// Model evaluation metrics for classification problems. +// Note: For Video Classification this metrics only describe quality of the +// Video Classification predictions of "segment_classification" type. +message ClassificationEvaluationMetrics { + // Metrics for a single confidence threshold. + message ConfidenceMetricsEntry { + // Output only. Metrics are computed with an assumption that the model + // never returns predictions with score lower than this value. + float confidence_threshold = 1; + + // Output only. Metrics are computed with an assumption that the model + // always returns at most this many predictions (ordered by their score, + // descendingly), but they all still need to meet the confidence_threshold. + int32 position_threshold = 14; + + // Output only. Recall (True Positive Rate) for the given confidence + // threshold. + float recall = 2; + + // Output only. Precision for the given confidence threshold. + float precision = 3; + + // Output only. False Positive Rate for the given confidence threshold. + float false_positive_rate = 8; + + // Output only. The harmonic mean of recall and precision. + float f1_score = 4; + + // Output only. The Recall (True Positive Rate) when only considering the + // label that has the highest prediction score and not below the confidence + // threshold for each example. + float recall_at1 = 5; + + // Output only. The precision when only considering the label that has the + // highest prediction score and not below the confidence threshold for each + // example. + float precision_at1 = 6; + + // Output only. The False Positive Rate when only considering the label that + // has the highest prediction score and not below the confidence threshold + // for each example. + float false_positive_rate_at1 = 9; + + // Output only. The harmonic mean of [recall_at1][google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfidenceMetricsEntry.recall_at1] and [precision_at1][google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfidenceMetricsEntry.precision_at1]. + float f1_score_at1 = 7; + + // Output only. The number of model created labels that match a ground truth + // label. + int64 true_positive_count = 10; + + // Output only. The number of model created labels that do not match a + // ground truth label. + int64 false_positive_count = 11; + + // Output only. The number of ground truth labels that are not matched + // by a model created label. + int64 false_negative_count = 12; + + // Output only. The number of labels that were not created by the model, + // but if they would, they would not match a ground truth label. + int64 true_negative_count = 13; + } + + // Confusion matrix of the model running the classification. + message ConfusionMatrix { + // Output only. A row in the confusion matrix. + message Row { + // Output only. Value of the specific cell in the confusion matrix. + // The number of values each row has (i.e. the length of the row) is equal + // to the length of the `annotation_spec_id` field or, if that one is not + // populated, length of the [display_name][google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfusionMatrix.display_name] field. + repeated int32 example_count = 1; + } + + // Output only. IDs of the annotation specs used in the confusion matrix. + // For Tables CLASSIFICATION + // [prediction_type][google.cloud.automl.v1p1beta.TablesModelMetadata.prediction_type] + // only list of [annotation_spec_display_name-s][] is populated. + repeated string annotation_spec_id = 1; + + // Output only. Display name of the annotation specs used in the confusion + // matrix, as they were at the moment of the evaluation. For Tables + // CLASSIFICATION + // [prediction_type-s][google.cloud.automl.v1p1beta.TablesModelMetadata.prediction_type], + // distinct values of the target column at the moment of the model + // evaluation are populated here. + repeated string display_name = 3; + + // Output only. Rows in the confusion matrix. The number of rows is equal to + // the size of `annotation_spec_id`. + // `row[i].example_count[j]` is the number of examples that have ground + // truth of the `annotation_spec_id[i]` and are predicted as + // `annotation_spec_id[j]` by the model being evaluated. + repeated Row row = 2; + } + + // Output only. The Area Under Precision-Recall Curve metric. Micro-averaged + // for the overall evaluation. + float au_prc = 1; + + // Output only. The Area Under Receiver Operating Characteristic curve metric. + // Micro-averaged for the overall evaluation. + float au_roc = 6; + + // Output only. The Log Loss metric. + float log_loss = 7; + + // Output only. Metrics for each confidence_threshold in + // 0.00,0.05,0.10,...,0.95,0.96,0.97,0.98,0.99 and + // position_threshold = INT32_MAX_VALUE. + // ROC and precision-recall curves, and other aggregated metrics are derived + // from them. The confidence metrics entries may also be supplied for + // additional values of position_threshold, but from these no aggregated + // metrics are computed. + repeated ConfidenceMetricsEntry confidence_metrics_entry = 3; + + // Output only. Confusion matrix of the evaluation. + // Only set for MULTICLASS classification problems where number + // of labels is no more than 10. + // Only set for model level evaluation, not for evaluation per label. + ConfusionMatrix confusion_matrix = 4; + + // Output only. The annotation spec ids used for this evaluation. + repeated string annotation_spec_id = 5; +} diff --git a/packages/google-cloud-automl/protos/google/cloud/automl/v1/data_items.proto b/packages/google-cloud-automl/protos/google/cloud/automl/v1/data_items.proto new file mode 100644 index 00000000000..9990e57d9dc --- /dev/null +++ b/packages/google-cloud-automl/protos/google/cloud/automl/v1/data_items.proto @@ -0,0 +1,187 @@ +// 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 +// +// 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.automl.v1; + +import "google/cloud/automl/v1/geometry.proto"; +import "google/cloud/automl/v1/io.proto"; +import "google/cloud/automl/v1/text_segment.proto"; + +option csharp_namespace = "Google.Cloud.AutoML.V1"; +option go_package = "cloud.google.com/go/automl/apiv1/automlpb;automlpb"; +option java_multiple_files = true; +option java_package = "com.google.cloud.automl.v1"; +option php_namespace = "Google\\Cloud\\AutoMl\\V1"; +option ruby_package = "Google::Cloud::AutoML::V1"; + +// A representation of an image. +// Only images up to 30MB in size are supported. +message Image { + // Input only. The data representing the image. + // For Predict calls [image_bytes][google.cloud.automl.v1.Image.image_bytes] must be set . + oneof data { + // Image content represented as a stream of bytes. + // Note: As with all `bytes` fields, protobuffers use a pure binary + // representation, whereas JSON representations use base64. + bytes image_bytes = 1; + } + + // Output only. HTTP URI to the thumbnail image. + string thumbnail_uri = 4; +} + +// A representation of a text snippet. +message TextSnippet { + // Required. The content of the text snippet as a string. Up to 250000 + // characters long. + string content = 1; + + // Optional. The format of [content][google.cloud.automl.v1.TextSnippet.content]. Currently the only two allowed + // values are "text/html" and "text/plain". If left blank, the format is + // automatically determined from the type of the uploaded [content][google.cloud.automl.v1.TextSnippet.content]. + string mime_type = 2; + + // Output only. HTTP URI where you can download the content. + string content_uri = 4; +} + +// Message that describes dimension of a document. +message DocumentDimensions { + // Unit of the document dimension. + enum DocumentDimensionUnit { + // Should not be used. + DOCUMENT_DIMENSION_UNIT_UNSPECIFIED = 0; + + // Document dimension is measured in inches. + INCH = 1; + + // Document dimension is measured in centimeters. + CENTIMETER = 2; + + // Document dimension is measured in points. 72 points = 1 inch. + POINT = 3; + } + + // Unit of the dimension. + DocumentDimensionUnit unit = 1; + + // Width value of the document, works together with the unit. + float width = 2; + + // Height value of the document, works together with the unit. + float height = 3; +} + +// A structured text document e.g. a PDF. +message Document { + // Describes the layout information of a [text_segment][google.cloud.automl.v1.Document.Layout.text_segment] in the document. + message Layout { + // The type of TextSegment in the context of the original document. + enum TextSegmentType { + // Should not be used. + TEXT_SEGMENT_TYPE_UNSPECIFIED = 0; + + // The text segment is a token. e.g. word. + TOKEN = 1; + + // The text segment is a paragraph. + PARAGRAPH = 2; + + // The text segment is a form field. + FORM_FIELD = 3; + + // The text segment is the name part of a form field. It will be treated + // as child of another FORM_FIELD TextSegment if its span is subspan of + // another TextSegment with type FORM_FIELD. + FORM_FIELD_NAME = 4; + + // The text segment is the text content part of a form field. It will be + // treated as child of another FORM_FIELD TextSegment if its span is + // subspan of another TextSegment with type FORM_FIELD. + FORM_FIELD_CONTENTS = 5; + + // The text segment is a whole table, including headers, and all rows. + TABLE = 6; + + // The text segment is a table's headers. It will be treated as child of + // another TABLE TextSegment if its span is subspan of another TextSegment + // with type TABLE. + TABLE_HEADER = 7; + + // The text segment is a row in table. It will be treated as child of + // another TABLE TextSegment if its span is subspan of another TextSegment + // with type TABLE. + TABLE_ROW = 8; + + // The text segment is a cell in table. It will be treated as child of + // another TABLE_ROW TextSegment if its span is subspan of another + // TextSegment with type TABLE_ROW. + TABLE_CELL = 9; + } + + // Text Segment that represents a segment in + // [document_text][google.cloud.automl.v1p1beta.Document.document_text]. + TextSegment text_segment = 1; + + // Page number of the [text_segment][google.cloud.automl.v1.Document.Layout.text_segment] in the original document, starts + // from 1. + int32 page_number = 2; + + // The position of the [text_segment][google.cloud.automl.v1.Document.Layout.text_segment] in the page. + // Contains exactly 4 + // [normalized_vertices][google.cloud.automl.v1p1beta.BoundingPoly.normalized_vertices] + // and they are connected by edges in the order provided, which will + // represent a rectangle parallel to the frame. The + // [NormalizedVertex-s][google.cloud.automl.v1p1beta.NormalizedVertex] are + // relative to the page. + // Coordinates are based on top-left as point (0,0). + BoundingPoly bounding_poly = 3; + + // The type of the [text_segment][google.cloud.automl.v1.Document.Layout.text_segment] in document. + TextSegmentType text_segment_type = 4; + } + + // An input config specifying the content of the document. + DocumentInputConfig input_config = 1; + + // The plain text version of this document. + TextSnippet document_text = 2; + + // Describes the layout of the document. + // Sorted by [page_number][]. + repeated Layout layout = 3; + + // The dimensions of the page in the document. + DocumentDimensions document_dimensions = 4; + + // Number of pages in the document. + int32 page_count = 5; +} + +// Example data used for training or prediction. +message ExamplePayload { + // Required. The example data. + oneof payload { + // Example image. + Image image = 1; + + // Example text. + TextSnippet text_snippet = 2; + + // Example document. + Document document = 4; + } +} diff --git a/packages/google-cloud-automl/protos/google/cloud/automl/v1/dataset.proto b/packages/google-cloud-automl/protos/google/cloud/automl/v1/dataset.proto new file mode 100644 index 00000000000..f6f8fc7c4be --- /dev/null +++ b/packages/google-cloud-automl/protos/google/cloud/automl/v1/dataset.proto @@ -0,0 +1,95 @@ +// 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 +// +// 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.automl.v1; + +import "google/api/resource.proto"; +import "google/cloud/automl/v1/image.proto"; +import "google/cloud/automl/v1/text.proto"; +import "google/cloud/automl/v1/translation.proto"; +import "google/protobuf/timestamp.proto"; + +option csharp_namespace = "Google.Cloud.AutoML.V1"; +option go_package = "cloud.google.com/go/automl/apiv1/automlpb;automlpb"; +option java_multiple_files = true; +option java_package = "com.google.cloud.automl.v1"; +option php_namespace = "Google\\Cloud\\AutoMl\\V1"; +option ruby_package = "Google::Cloud::AutoML::V1"; + +// A workspace for solving a single, particular machine learning (ML) problem. +// A workspace contains examples that may be annotated. +message Dataset { + option (google.api.resource) = { + type: "automl.googleapis.com/Dataset" + pattern: "projects/{project}/locations/{location}/datasets/{dataset}" + }; + + // Required. + // The dataset metadata that is specific to the problem type. + oneof dataset_metadata { + // Metadata for a dataset used for translation. + TranslationDatasetMetadata translation_dataset_metadata = 23; + + // Metadata for a dataset used for image classification. + ImageClassificationDatasetMetadata image_classification_dataset_metadata = 24; + + // Metadata for a dataset used for text classification. + TextClassificationDatasetMetadata text_classification_dataset_metadata = 25; + + // Metadata for a dataset used for image object detection. + ImageObjectDetectionDatasetMetadata image_object_detection_dataset_metadata = 26; + + // Metadata for a dataset used for text extraction. + TextExtractionDatasetMetadata text_extraction_dataset_metadata = 28; + + // Metadata for a dataset used for text sentiment. + TextSentimentDatasetMetadata text_sentiment_dataset_metadata = 30; + } + + // Output only. The resource name of the dataset. + // Form: `projects/{project_id}/locations/{location_id}/datasets/{dataset_id}` + string name = 1; + + // Required. The name of the dataset to show in the interface. The name can be + // up to 32 characters long and can consist only of ASCII Latin letters A-Z + // and a-z, underscores + // (_), and ASCII digits 0-9. + string display_name = 2; + + // User-provided description of the dataset. The description can be up to + // 25000 characters long. + string description = 3; + + // Output only. The number of examples in the dataset. + int32 example_count = 21; + + // Output only. Timestamp when this dataset was created. + google.protobuf.Timestamp create_time = 14; + + // Used to perform consistent read-modify-write updates. If not set, a blind + // "overwrite" update happens. + string etag = 17; + + // Optional. The labels with user-defined metadata to organize your dataset. + // + // Label keys and values can be no longer than 64 characters + // (Unicode codepoints), can only contain lowercase letters, numeric + // characters, underscores and dashes. International characters are allowed. + // Label values are optional. Label keys must start with a letter. + // + // See https://goo.gl/xmQnxf for more information on and examples of labels. + map labels = 39; +} diff --git a/packages/google-cloud-automl/protos/google/cloud/automl/v1/detection.proto b/packages/google-cloud-automl/protos/google/cloud/automl/v1/detection.proto new file mode 100644 index 00000000000..a76c3538d81 --- /dev/null +++ b/packages/google-cloud-automl/protos/google/cloud/automl/v1/detection.proto @@ -0,0 +1,85 @@ +// 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 +// +// 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.automl.v1; + +import "google/cloud/automl/v1/geometry.proto"; + +option csharp_namespace = "Google.Cloud.AutoML.V1"; +option go_package = "cloud.google.com/go/automl/apiv1/automlpb;automlpb"; +option java_multiple_files = true; +option java_package = "com.google.cloud.automl.v1"; +option php_namespace = "Google\\Cloud\\AutoMl\\V1"; +option ruby_package = "Google::Cloud::AutoML::V1"; + +// Annotation details for image object detection. +message ImageObjectDetectionAnnotation { + // Output only. The rectangle representing the object location. + BoundingPoly bounding_box = 1; + + // Output only. The confidence that this annotation is positive for the parent example, + // value in [0, 1], higher means higher positivity confidence. + float score = 2; +} + +// Bounding box matching model metrics for a single intersection-over-union +// threshold and multiple label match confidence thresholds. +message BoundingBoxMetricsEntry { + // Metrics for a single confidence threshold. + message ConfidenceMetricsEntry { + // Output only. The confidence threshold value used to compute the metrics. + float confidence_threshold = 1; + + // Output only. Recall under the given confidence threshold. + float recall = 2; + + // Output only. Precision under the given confidence threshold. + float precision = 3; + + // Output only. The harmonic mean of recall and precision. + float f1_score = 4; + } + + // Output only. The intersection-over-union threshold value used to compute + // this metrics entry. + float iou_threshold = 1; + + // Output only. The mean average precision, most often close to au_prc. + float mean_average_precision = 2; + + // Output only. Metrics for each label-match confidence_threshold from + // 0.05,0.10,...,0.95,0.96,0.97,0.98,0.99. Precision-recall curve is + // derived from them. + repeated ConfidenceMetricsEntry confidence_metrics_entries = 3; +} + +// Model evaluation metrics for image object detection problems. +// Evaluates prediction quality of labeled bounding boxes. +message ImageObjectDetectionEvaluationMetrics { + // Output only. The total number of bounding boxes (i.e. summed over all + // images) the ground truth used to create this evaluation had. + int32 evaluated_bounding_box_count = 1; + + // Output only. The bounding boxes match metrics for each + // Intersection-over-union threshold 0.05,0.10,...,0.95,0.96,0.97,0.98,0.99 + // and each label confidence threshold 0.05,0.10,...,0.95,0.96,0.97,0.98,0.99 + // pair. + repeated BoundingBoxMetricsEntry bounding_box_metrics_entries = 2; + + // Output only. The single metric for bounding boxes evaluation: + // the mean_average_precision averaged over all bounding_box_metrics_entries. + float bounding_box_mean_average_precision = 3; +} diff --git a/packages/google-cloud-automl/protos/google/cloud/automl/v1/geometry.proto b/packages/google-cloud-automl/protos/google/cloud/automl/v1/geometry.proto new file mode 100644 index 00000000000..a4261d5eb09 --- /dev/null +++ b/packages/google-cloud-automl/protos/google/cloud/automl/v1/geometry.proto @@ -0,0 +1,45 @@ +// 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 +// +// 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.automl.v1; + +option csharp_namespace = "Google.Cloud.AutoML.V1"; +option go_package = "cloud.google.com/go/automl/apiv1/automlpb;automlpb"; +option java_multiple_files = true; +option java_package = "com.google.cloud.automl.v1"; +option php_namespace = "Google\\Cloud\\AutoMl\\V1"; +option ruby_package = "Google::Cloud::AutoML::V1"; + +// A vertex represents a 2D point in the image. +// The normalized vertex coordinates are between 0 to 1 fractions relative to +// the original plane (image, video). E.g. if the plane (e.g. whole image) would +// have size 10 x 20 then a point with normalized coordinates (0.1, 0.3) would +// be at the position (1, 6) on that plane. +message NormalizedVertex { + // Required. Horizontal coordinate. + float x = 1; + + // Required. Vertical coordinate. + float y = 2; +} + +// A bounding polygon of a detected object on a plane. +// On output both vertices and normalized_vertices are provided. +// The polygon is formed by connecting vertices in the order they are listed. +message BoundingPoly { + // Output only . The bounding polygon normalized vertices. + repeated NormalizedVertex normalized_vertices = 2; +} diff --git a/packages/google-cloud-automl/protos/google/cloud/automl/v1/image.proto b/packages/google-cloud-automl/protos/google/cloud/automl/v1/image.proto new file mode 100644 index 00000000000..5fdc101bc7f --- /dev/null +++ b/packages/google-cloud-automl/protos/google/cloud/automl/v1/image.proto @@ -0,0 +1,201 @@ +// 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 +// +// 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.automl.v1; + +import "google/api/field_behavior.proto"; +import "google/cloud/automl/v1/classification.proto"; + +option csharp_namespace = "Google.Cloud.AutoML.V1"; +option go_package = "cloud.google.com/go/automl/apiv1/automlpb;automlpb"; +option java_multiple_files = true; +option java_outer_classname = "ImageProto"; +option java_package = "com.google.cloud.automl.v1"; +option php_namespace = "Google\\Cloud\\AutoMl\\V1"; +option ruby_package = "Google::Cloud::AutoML::V1"; + +// Dataset metadata that is specific to image classification. +message ImageClassificationDatasetMetadata { + // Required. Type of the classification problem. + ClassificationType classification_type = 1 [(google.api.field_behavior) = REQUIRED]; +} + +// Dataset metadata specific to image object detection. +message ImageObjectDetectionDatasetMetadata { + +} + +// Model metadata for image classification. +message ImageClassificationModelMetadata { + // Optional. The ID of the `base` model. If it is specified, the new model + // will be created based on the `base` model. Otherwise, the new model will be + // created from scratch. The `base` model must be in the same + // `project` and `location` as the new model to create, and have the same + // `model_type`. + string base_model_id = 1 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The train budget of creating this model, expressed in milli node + // hours i.e. 1,000 value in this field means 1 node hour. The actual + // `train_cost` will be equal or less than this value. If further model + // training ceases to provide any improvements, it will stop without using + // full budget and the stop_reason will be `MODEL_CONVERGED`. + // Note, node_hour = actual_hour * number_of_nodes_invovled. + // For model type `cloud`(default), the train budget must be between 8,000 + // and 800,000 milli node hours, inclusive. The default value is 192, 000 + // which represents one day in wall time. For model type + // `mobile-low-latency-1`, `mobile-versatile-1`, `mobile-high-accuracy-1`, + // `mobile-core-ml-low-latency-1`, `mobile-core-ml-versatile-1`, + // `mobile-core-ml-high-accuracy-1`, the train budget must be between 1,000 + // and 100,000 milli node hours, inclusive. The default value is 24, 000 which + // represents one day in wall time. + int64 train_budget_milli_node_hours = 16 [(google.api.field_behavior) = OPTIONAL]; + + // Output only. The actual train cost of creating this model, expressed in + // milli node hours, i.e. 1,000 value in this field means 1 node hour. + // Guaranteed to not exceed the train budget. + int64 train_cost_milli_node_hours = 17 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The reason that this create model operation stopped, + // e.g. `BUDGET_REACHED`, `MODEL_CONVERGED`. + string stop_reason = 5 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Optional. Type of the model. The available values are: + // * `cloud` - Model to be used via prediction calls to AutoML API. + // This is the default value. + // * `mobile-low-latency-1` - A model that, in addition to providing + // prediction via AutoML API, can also be exported (see + // [AutoMl.ExportModel][google.cloud.automl.v1.AutoMl.ExportModel]) and used on a mobile or edge device + // with TensorFlow afterwards. Expected to have low latency, but + // may have lower prediction quality than other models. + // * `mobile-versatile-1` - A model that, in addition to providing + // prediction via AutoML API, can also be exported (see + // [AutoMl.ExportModel][google.cloud.automl.v1.AutoMl.ExportModel]) and used on a mobile or edge device + // with TensorFlow afterwards. + // * `mobile-high-accuracy-1` - A model that, in addition to providing + // prediction via AutoML API, can also be exported (see + // [AutoMl.ExportModel][google.cloud.automl.v1.AutoMl.ExportModel]) and used on a mobile or edge device + // with TensorFlow afterwards. Expected to have a higher + // latency, but should also have a higher prediction quality + // than other models. + // * `mobile-core-ml-low-latency-1` - A model that, in addition to providing + // prediction via AutoML API, can also be exported (see + // [AutoMl.ExportModel][google.cloud.automl.v1.AutoMl.ExportModel]) and used on a mobile device with Core + // ML afterwards. Expected to have low latency, but may have + // lower prediction quality than other models. + // * `mobile-core-ml-versatile-1` - A model that, in addition to providing + // prediction via AutoML API, can also be exported (see + // [AutoMl.ExportModel][google.cloud.automl.v1.AutoMl.ExportModel]) and used on a mobile device with Core + // ML afterwards. + // * `mobile-core-ml-high-accuracy-1` - A model that, in addition to + // providing prediction via AutoML API, can also be exported + // (see [AutoMl.ExportModel][google.cloud.automl.v1.AutoMl.ExportModel]) and used on a mobile device with + // Core ML afterwards. Expected to have a higher latency, but + // should also have a higher prediction quality than other + // models. + string model_type = 7 [(google.api.field_behavior) = OPTIONAL]; + + // Output only. An approximate number of online prediction QPS that can + // be supported by this model per each node on which it is deployed. + double node_qps = 13 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The number of nodes this model is deployed on. A node is an + // abstraction of a machine resource, which can handle online prediction QPS + // as given in the node_qps field. + int64 node_count = 14 [(google.api.field_behavior) = OUTPUT_ONLY]; +} + +// Model metadata specific to image object detection. +message ImageObjectDetectionModelMetadata { + // Optional. Type of the model. The available values are: + // * `cloud-high-accuracy-1` - (default) A model to be used via prediction + // calls to AutoML API. Expected to have a higher latency, but + // should also have a higher prediction quality than other + // models. + // * `cloud-low-latency-1` - A model to be used via prediction + // calls to AutoML API. Expected to have low latency, but may + // have lower prediction quality than other models. + // * `mobile-low-latency-1` - A model that, in addition to providing + // prediction via AutoML API, can also be exported (see + // [AutoMl.ExportModel][google.cloud.automl.v1.AutoMl.ExportModel]) and used on a mobile or edge device + // with TensorFlow afterwards. Expected to have low latency, but + // may have lower prediction quality than other models. + // * `mobile-versatile-1` - A model that, in addition to providing + // prediction via AutoML API, can also be exported (see + // [AutoMl.ExportModel][google.cloud.automl.v1.AutoMl.ExportModel]) and used on a mobile or edge device + // with TensorFlow afterwards. + // * `mobile-high-accuracy-1` - A model that, in addition to providing + // prediction via AutoML API, can also be exported (see + // [AutoMl.ExportModel][google.cloud.automl.v1.AutoMl.ExportModel]) and used on a mobile or edge device + // with TensorFlow afterwards. Expected to have a higher + // latency, but should also have a higher prediction quality + // than other models. + string model_type = 1 [(google.api.field_behavior) = OPTIONAL]; + + // Output only. The number of nodes this model is deployed on. A node is an + // abstraction of a machine resource, which can handle online prediction QPS + // as given in the qps_per_node field. + int64 node_count = 3 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. An approximate number of online prediction QPS that can + // be supported by this model per each node on which it is deployed. + double node_qps = 4 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The reason that this create model operation stopped, + // e.g. `BUDGET_REACHED`, `MODEL_CONVERGED`. + string stop_reason = 5 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Optional. The train budget of creating this model, expressed in milli node + // hours i.e. 1,000 value in this field means 1 node hour. The actual + // `train_cost` will be equal or less than this value. If further model + // training ceases to provide any improvements, it will stop without using + // full budget and the stop_reason will be `MODEL_CONVERGED`. + // Note, node_hour = actual_hour * number_of_nodes_invovled. + // For model type `cloud-high-accuracy-1`(default) and `cloud-low-latency-1`, + // the train budget must be between 20,000 and 900,000 milli node hours, + // inclusive. The default value is 216, 000 which represents one day in + // wall time. + // For model type `mobile-low-latency-1`, `mobile-versatile-1`, + // `mobile-high-accuracy-1`, `mobile-core-ml-low-latency-1`, + // `mobile-core-ml-versatile-1`, `mobile-core-ml-high-accuracy-1`, the train + // budget must be between 1,000 and 100,000 milli node hours, inclusive. + // The default value is 24, 000 which represents one day in wall time. + int64 train_budget_milli_node_hours = 6 [(google.api.field_behavior) = OPTIONAL]; + + // Output only. The actual train cost of creating this model, expressed in + // milli node hours, i.e. 1,000 value in this field means 1 node hour. + // Guaranteed to not exceed the train budget. + int64 train_cost_milli_node_hours = 7 [(google.api.field_behavior) = OUTPUT_ONLY]; +} + +// Model deployment metadata specific to Image Classification. +message ImageClassificationModelDeploymentMetadata { + // Input only. The number of nodes to deploy the model on. A node is an + // abstraction of a machine resource, which can handle online prediction QPS + // as given in the model's + // [node_qps][google.cloud.automl.v1.ImageClassificationModelMetadata.node_qps]. + // Must be between 1 and 100, inclusive on both ends. + int64 node_count = 1 [(google.api.field_behavior) = INPUT_ONLY]; +} + +// Model deployment metadata specific to Image Object Detection. +message ImageObjectDetectionModelDeploymentMetadata { + // Input only. The number of nodes to deploy the model on. A node is an + // abstraction of a machine resource, which can handle online prediction QPS + // as given in the model's + // [qps_per_node][google.cloud.automl.v1.ImageObjectDetectionModelMetadata.qps_per_node]. + // Must be between 1 and 100, inclusive on both ends. + int64 node_count = 1 [(google.api.field_behavior) = INPUT_ONLY]; +} diff --git a/packages/google-cloud-automl/protos/google/cloud/automl/v1/io.proto b/packages/google-cloud-automl/protos/google/cloud/automl/v1/io.proto new file mode 100644 index 00000000000..9c32cf8651e --- /dev/null +++ b/packages/google-cloud-automl/protos/google/cloud/automl/v1/io.proto @@ -0,0 +1,1331 @@ +// 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 +// +// 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.automl.v1; + +import "google/api/field_behavior.proto"; + +option csharp_namespace = "Google.Cloud.AutoML.V1"; +option go_package = "cloud.google.com/go/automl/apiv1/automlpb;automlpb"; +option java_multiple_files = true; +option java_package = "com.google.cloud.automl.v1"; +option php_namespace = "Google\\Cloud\\AutoMl\\V1"; +option ruby_package = "Google::Cloud::AutoML::V1"; + +// Input configuration for [AutoMl.ImportData][google.cloud.automl.v1.AutoMl.ImportData] action. +// +// The format of input depends on dataset_metadata the Dataset into which +// the import is happening has. As input source the +// [gcs_source][google.cloud.automl.v1.InputConfig.gcs_source] +// is expected, unless specified otherwise. Additionally any input .CSV file +// by itself must be 100MB or smaller, unless specified otherwise. +// If an "example" file (that is, image, video etc.) with identical content +// (even if it had different `GCS_FILE_PATH`) is mentioned multiple times, then +// its label, bounding boxes etc. are appended. The same file should be always +// provided with the same `ML_USE` and `GCS_FILE_PATH`, if it is not, then +// these values are nondeterministically selected from the given ones. +// +// The formats are represented in EBNF with commas being literal and with +// non-terminal symbols defined near the end of this comment. The formats are: +// +//

AutoML Vision

+// +// +//
Classification
+// +// See [Preparing your training +// data](https://cloud.google.com/vision/automl/docs/prepare) for more +// information. +// +// CSV file(s) with each line in format: +// +// ML_USE,GCS_FILE_PATH,LABEL,LABEL,... +// +// * `ML_USE` - Identifies the data set that the current row (file) applies +// to. +// This value can be one of the following: +// * `TRAIN` - Rows in this file are used to train the model. +// * `TEST` - Rows in this file are used to test the model during training. +// * `UNASSIGNED` - Rows in this file are not categorized. They are +// Automatically divided into train and test data. 80% for training and +// 20% for testing. +// +// * `GCS_FILE_PATH` - The Google Cloud Storage location of an image of up to +// 30MB in size. Supported extensions: .JPEG, .GIF, .PNG, .WEBP, .BMP, +// .TIFF, .ICO. +// +// * `LABEL` - A label that identifies the object in the image. +// +// For the `MULTICLASS` classification type, at most one `LABEL` is allowed +// per image. If an image has not yet been labeled, then it should be +// mentioned just once with no `LABEL`. +// +// Some sample rows: +// +// TRAIN,gs://folder/image1.jpg,daisy +// TEST,gs://folder/image2.jpg,dandelion,tulip,rose +// UNASSIGNED,gs://folder/image3.jpg,daisy +// UNASSIGNED,gs://folder/image4.jpg +// +// +//
Object Detection
+// See [Preparing your training +// data](https://cloud.google.com/vision/automl/object-detection/docs/prepare) +// for more information. +// +// A CSV file(s) with each line in format: +// +// ML_USE,GCS_FILE_PATH,[LABEL],(BOUNDING_BOX | ,,,,,,,) +// +// * `ML_USE` - Identifies the data set that the current row (file) applies +// to. +// This value can be one of the following: +// * `TRAIN` - Rows in this file are used to train the model. +// * `TEST` - Rows in this file are used to test the model during training. +// * `UNASSIGNED` - Rows in this file are not categorized. They are +// Automatically divided into train and test data. 80% for training and +// 20% for testing. +// +// * `GCS_FILE_PATH` - The Google Cloud Storage location of an image of up to +// 30MB in size. Supported extensions: .JPEG, .GIF, .PNG. Each image +// is assumed to be exhaustively labeled. +// +// * `LABEL` - A label that identifies the object in the image specified by the +// `BOUNDING_BOX`. +// +// * `BOUNDING BOX` - The vertices of an object in the example image. +// The minimum allowed `BOUNDING_BOX` edge length is 0.01, and no more than +// 500 `BOUNDING_BOX` instances per image are allowed (one `BOUNDING_BOX` +// per line). If an image has no looked for objects then it should be +// mentioned just once with no LABEL and the ",,,,,,," in place of the +// `BOUNDING_BOX`. +// +// **Four sample rows:** +// +// TRAIN,gs://folder/image1.png,car,0.1,0.1,,,0.3,0.3,, +// TRAIN,gs://folder/image1.png,bike,.7,.6,,,.8,.9,, +// UNASSIGNED,gs://folder/im2.png,car,0.1,0.1,0.2,0.1,0.2,0.3,0.1,0.3 +// TEST,gs://folder/im3.png,,,,,,,,, +//
+//
+// +// +//

AutoML Video Intelligence

+// +// +//
Classification
+// +// See [Preparing your training +// data](https://cloud.google.com/video-intelligence/automl/docs/prepare) for +// more information. +// +// CSV file(s) with each line in format: +// +// ML_USE,GCS_FILE_PATH +// +// For `ML_USE`, do not use `VALIDATE`. +// +// `GCS_FILE_PATH` is the path to another .csv file that describes training +// example for a given `ML_USE`, using the following row format: +// +// GCS_FILE_PATH,(LABEL,TIME_SEGMENT_START,TIME_SEGMENT_END | ,,) +// +// Here `GCS_FILE_PATH` leads to a video of up to 50GB in size and up +// to 3h duration. Supported extensions: .MOV, .MPEG4, .MP4, .AVI. +// +// `TIME_SEGMENT_START` and `TIME_SEGMENT_END` must be within the +// length of the video, and the end time must be after the start time. Any +// segment of a video which has one or more labels on it, is considered a +// hard negative for all other labels. Any segment with no labels on +// it is considered to be unknown. If a whole video is unknown, then +// it should be mentioned just once with ",," in place of `LABEL, +// TIME_SEGMENT_START,TIME_SEGMENT_END`. +// +// Sample top level CSV file: +// +// TRAIN,gs://folder/train_videos.csv +// TEST,gs://folder/test_videos.csv +// UNASSIGNED,gs://folder/other_videos.csv +// +// Sample rows of a CSV file for a particular ML_USE: +// +// gs://folder/video1.avi,car,120,180.000021 +// gs://folder/video1.avi,bike,150,180.000021 +// gs://folder/vid2.avi,car,0,60.5 +// gs://folder/vid3.avi,,, +// +// +// +//
Object Tracking
+// +// See [Preparing your training +// data](/video-intelligence/automl/object-tracking/docs/prepare) for more +// information. +// +// CSV file(s) with each line in format: +// +// ML_USE,GCS_FILE_PATH +// +// For `ML_USE`, do not use `VALIDATE`. +// +// `GCS_FILE_PATH` is the path to another .csv file that describes training +// example for a given `ML_USE`, using the following row format: +// +// GCS_FILE_PATH,LABEL,[INSTANCE_ID],TIMESTAMP,BOUNDING_BOX +// +// or +// +// GCS_FILE_PATH,,,,,,,,,, +// +// Here `GCS_FILE_PATH` leads to a video of up to 50GB in size and up +// to 3h duration. Supported extensions: .MOV, .MPEG4, .MP4, .AVI. +// Providing `INSTANCE_ID`s can help to obtain a better model. When +// a specific labeled entity leaves the video frame, and shows up +// afterwards it is not required, albeit preferable, that the same +// `INSTANCE_ID` is given to it. +// +// `TIMESTAMP` must be within the length of the video, the +// `BOUNDING_BOX` is assumed to be drawn on the closest video's frame +// to the `TIMESTAMP`. Any mentioned by the `TIMESTAMP` frame is expected +// to be exhaustively labeled and no more than 500 `BOUNDING_BOX`-es per +// frame are allowed. If a whole video is unknown, then it should be +// mentioned just once with ",,,,,,,,,," in place of `LABEL, +// [INSTANCE_ID],TIMESTAMP,BOUNDING_BOX`. +// +// Sample top level CSV file: +// +// TRAIN,gs://folder/train_videos.csv +// TEST,gs://folder/test_videos.csv +// UNASSIGNED,gs://folder/other_videos.csv +// +// Seven sample rows of a CSV file for a particular ML_USE: +// +// gs://folder/video1.avi,car,1,12.10,0.8,0.8,0.9,0.8,0.9,0.9,0.8,0.9 +// gs://folder/video1.avi,car,1,12.90,0.4,0.8,0.5,0.8,0.5,0.9,0.4,0.9 +// gs://folder/video1.avi,car,2,12.10,.4,.2,.5,.2,.5,.3,.4,.3 +// gs://folder/video1.avi,car,2,12.90,.8,.2,,,.9,.3,, +// gs://folder/video1.avi,bike,,12.50,.45,.45,,,.55,.55,, +// gs://folder/video2.avi,car,1,0,.1,.9,,,.9,.1,, +// gs://folder/video2.avi,,,,,,,,,,, +//
+//
+// +// +//

AutoML Natural Language

+// +// +//
Entity Extraction
+// +// See [Preparing your training +// data](/natural-language/automl/entity-analysis/docs/prepare) for more +// information. +// +// One or more CSV file(s) with each line in the following format: +// +// ML_USE,GCS_FILE_PATH +// +// * `ML_USE` - Identifies the data set that the current row (file) applies +// to. +// This value can be one of the following: +// * `TRAIN` - Rows in this file are used to train the model. +// * `TEST` - Rows in this file are used to test the model during training. +// * `UNASSIGNED` - Rows in this file are not categorized. They are +// Automatically divided into train and test data. 80% for training and +// 20% for testing.. +// +// * `GCS_FILE_PATH` - a Identifies JSON Lines (.JSONL) file stored in +// Google Cloud Storage that contains in-line text in-line as documents +// for model training. +// +// After the training data set has been determined from the `TRAIN` and +// `UNASSIGNED` CSV files, the training data is divided into train and +// validation data sets. 70% for training and 30% for validation. +// +// For example: +// +// TRAIN,gs://folder/file1.jsonl +// VALIDATE,gs://folder/file2.jsonl +// TEST,gs://folder/file3.jsonl +// +// **In-line JSONL files** +// +// In-line .JSONL files contain, per line, a JSON document that wraps a +// [`text_snippet`][google.cloud.automl.v1.TextSnippet] field followed by +// one or more [`annotations`][google.cloud.automl.v1.AnnotationPayload] +// fields, which have `display_name` and `text_extraction` fields to describe +// the entity from the text snippet. Multiple JSON documents can be separated +// using line breaks (\n). +// +// The supplied text must be annotated exhaustively. For example, if you +// include the text "horse", but do not label it as "animal", +// then "horse" is assumed to not be an "animal". +// +// Any given text snippet content must have 30,000 characters or +// less, and also be UTF-8 NFC encoded. ASCII is accepted as it is +// UTF-8 NFC encoded. +// +// For example: +// +// { +// "text_snippet": { +// "content": "dog car cat" +// }, +// "annotations": [ +// { +// "display_name": "animal", +// "text_extraction": { +// "text_segment": {"start_offset": 0, "end_offset": 2} +// } +// }, +// { +// "display_name": "vehicle", +// "text_extraction": { +// "text_segment": {"start_offset": 4, "end_offset": 6} +// } +// }, +// { +// "display_name": "animal", +// "text_extraction": { +// "text_segment": {"start_offset": 8, "end_offset": 10} +// } +// } +// ] +// }\n +// { +// "text_snippet": { +// "content": "This dog is good." +// }, +// "annotations": [ +// { +// "display_name": "animal", +// "text_extraction": { +// "text_segment": {"start_offset": 5, "end_offset": 7} +// } +// } +// ] +// } +// +// **JSONL files that reference documents** +// +// .JSONL files contain, per line, a JSON document that wraps a +// `input_config` that contains the path to a source document. +// Multiple JSON documents can be separated using line breaks (\n). +// +// Supported document extensions: .PDF, .TIF, .TIFF +// +// For example: +// +// { +// "document": { +// "input_config": { +// "gcs_source": { "input_uris": [ "gs://folder/document1.pdf" ] +// } +// } +// } +// }\n +// { +// "document": { +// "input_config": { +// "gcs_source": { "input_uris": [ "gs://folder/document2.tif" ] +// } +// } +// } +// } +// +// **In-line JSONL files with document layout information** +// +// **Note:** You can only annotate documents using the UI. The format described +// below applies to annotated documents exported using the UI or `exportData`. +// +// In-line .JSONL files for documents contain, per line, a JSON document +// that wraps a `document` field that provides the textual content of the +// document and the layout information. +// +// For example: +// +// { +// "document": { +// "document_text": { +// "content": "dog car cat" +// } +// "layout": [ +// { +// "text_segment": { +// "start_offset": 0, +// "end_offset": 11, +// }, +// "page_number": 1, +// "bounding_poly": { +// "normalized_vertices": [ +// {"x": 0.1, "y": 0.1}, +// {"x": 0.1, "y": 0.3}, +// {"x": 0.3, "y": 0.3}, +// {"x": 0.3, "y": 0.1}, +// ], +// }, +// "text_segment_type": TOKEN, +// } +// ], +// "document_dimensions": { +// "width": 8.27, +// "height": 11.69, +// "unit": INCH, +// } +// "page_count": 3, +// }, +// "annotations": [ +// { +// "display_name": "animal", +// "text_extraction": { +// "text_segment": {"start_offset": 0, "end_offset": 3} +// } +// }, +// { +// "display_name": "vehicle", +// "text_extraction": { +// "text_segment": {"start_offset": 4, "end_offset": 7} +// } +// }, +// { +// "display_name": "animal", +// "text_extraction": { +// "text_segment": {"start_offset": 8, "end_offset": 11} +// } +// }, +// ], +// +// +// +// +//
Classification
+// +// See [Preparing your training +// data](https://cloud.google.com/natural-language/automl/docs/prepare) for more +// information. +// +// One or more CSV file(s) with each line in the following format: +// +// ML_USE,(TEXT_SNIPPET | GCS_FILE_PATH),LABEL,LABEL,... +// +// * `ML_USE` - Identifies the data set that the current row (file) applies +// to. +// This value can be one of the following: +// * `TRAIN` - Rows in this file are used to train the model. +// * `TEST` - Rows in this file are used to test the model during training. +// * `UNASSIGNED` - Rows in this file are not categorized. They are +// Automatically divided into train and test data. 80% for training and +// 20% for testing. +// +// * `TEXT_SNIPPET` and `GCS_FILE_PATH` are distinguished by a pattern. If +// the column content is a valid Google Cloud Storage file path, that is, +// prefixed by "gs://", it is treated as a `GCS_FILE_PATH`. Otherwise, if +// the content is enclosed in double quotes (""), it is treated as a +// `TEXT_SNIPPET`. For `GCS_FILE_PATH`, the path must lead to a +// file with supported extension and UTF-8 encoding, for example, +// "gs://folder/content.txt" AutoML imports the file content +// as a text snippet. For `TEXT_SNIPPET`, AutoML imports the column content +// excluding quotes. In both cases, size of the content must be 10MB or +// less in size. For zip files, the size of each file inside the zip must be +// 10MB or less in size. +// +// For the `MULTICLASS` classification type, at most one `LABEL` is allowed. +// +// The `ML_USE` and `LABEL` columns are optional. +// Supported file extensions: .TXT, .PDF, .TIF, .TIFF, .ZIP +// +// A maximum of 100 unique labels are allowed per CSV row. +// +// Sample rows: +// +// TRAIN,"They have bad food and very rude",RudeService,BadFood +// gs://folder/content.txt,SlowService +// TEST,gs://folder/document.pdf +// VALIDATE,gs://folder/text_files.zip,BadFood +// +// +// +//
Sentiment Analysis
+// +// See [Preparing your training +// data](https://cloud.google.com/natural-language/automl/docs/prepare) for more +// information. +// +// CSV file(s) with each line in format: +// +// ML_USE,(TEXT_SNIPPET | GCS_FILE_PATH),SENTIMENT +// +// * `ML_USE` - Identifies the data set that the current row (file) applies +// to. +// This value can be one of the following: +// * `TRAIN` - Rows in this file are used to train the model. +// * `TEST` - Rows in this file are used to test the model during training. +// * `UNASSIGNED` - Rows in this file are not categorized. They are +// Automatically divided into train and test data. 80% for training and +// 20% for testing. +// +// * `TEXT_SNIPPET` and `GCS_FILE_PATH` are distinguished by a pattern. If +// the column content is a valid Google Cloud Storage file path, that is, +// prefixed by "gs://", it is treated as a `GCS_FILE_PATH`. Otherwise, if +// the content is enclosed in double quotes (""), it is treated as a +// `TEXT_SNIPPET`. For `GCS_FILE_PATH`, the path must lead to a +// file with supported extension and UTF-8 encoding, for example, +// "gs://folder/content.txt" AutoML imports the file content +// as a text snippet. For `TEXT_SNIPPET`, AutoML imports the column content +// excluding quotes. In both cases, size of the content must be 128kB or +// less in size. For zip files, the size of each file inside the zip must be +// 128kB or less in size. +// +// The `ML_USE` and `SENTIMENT` columns are optional. +// Supported file extensions: .TXT, .PDF, .TIF, .TIFF, .ZIP +// +// * `SENTIMENT` - An integer between 0 and +// Dataset.text_sentiment_dataset_metadata.sentiment_max +// (inclusive). Describes the ordinal of the sentiment - higher +// value means a more positive sentiment. All the values are +// completely relative, i.e. neither 0 needs to mean a negative or +// neutral sentiment nor sentiment_max needs to mean a positive one - +// it is just required that 0 is the least positive sentiment +// in the data, and sentiment_max is the most positive one. +// The SENTIMENT shouldn't be confused with "score" or "magnitude" +// from the previous Natural Language Sentiment Analysis API. +// All SENTIMENT values between 0 and sentiment_max must be +// represented in the imported data. On prediction the same 0 to +// sentiment_max range will be used. The difference between +// neighboring sentiment values needs not to be uniform, e.g. 1 and +// 2 may be similar whereas the difference between 2 and 3 may be +// large. +// +// Sample rows: +// +// TRAIN,"@freewrytin this is way too good for your product",2 +// gs://folder/content.txt,3 +// TEST,gs://folder/document.pdf +// VALIDATE,gs://folder/text_files.zip,2 +//
+//
+// +// +// +//

AutoML Tables

+// +// See [Preparing your training +// data](https://cloud.google.com/automl-tables/docs/prepare) for more +// information. +// +// You can use either +// [gcs_source][google.cloud.automl.v1.InputConfig.gcs_source] or +// [bigquery_source][google.cloud.automl.v1.InputConfig.bigquery_source]. +// All input is concatenated into a +// single +// [primary_table_spec_id][google.cloud.automl.v1.TablesDatasetMetadata.primary_table_spec_id] +// +// **For gcs_source:** +// +// CSV file(s), where the first row of the first file is the header, +// containing unique column names. If the first row of a subsequent +// file is the same as the header, then it is also treated as a +// header. All other rows contain values for the corresponding +// columns. +// +// Each .CSV file by itself must be 10GB or smaller, and their total +// size must be 100GB or smaller. +// +// First three sample rows of a CSV file: +//
+// "Id","First Name","Last Name","Dob","Addresses"
+// "1","John","Doe","1968-01-22","[{"status":"current","address":"123_First_Avenue","city":"Seattle","state":"WA","zip":"11111","numberOfYears":"1"},{"status":"previous","address":"456_Main_Street","city":"Portland","state":"OR","zip":"22222","numberOfYears":"5"}]"
+// "2","Jane","Doe","1980-10-16","[{"status":"current","address":"789_Any_Avenue","city":"Albany","state":"NY","zip":"33333","numberOfYears":"2"},{"status":"previous","address":"321_Main_Street","city":"Hoboken","state":"NJ","zip":"44444","numberOfYears":"3"}]}
+// 
+// **For bigquery_source:** +// +// An URI of a BigQuery table. The user data size of the BigQuery +// table must be 100GB or smaller. +// +// An imported table must have between 2 and 1,000 columns, inclusive, +// and between 1000 and 100,000,000 rows, inclusive. There are at most 5 +// import data running in parallel. +// +//
+//
+// +// +// **Input field definitions:** +// +// `ML_USE` +// : ("TRAIN" | "VALIDATE" | "TEST" | "UNASSIGNED") +// Describes how the given example (file) should be used for model +// training. "UNASSIGNED" can be used when user has no preference. +// +// `GCS_FILE_PATH` +// : The path to a file on Google Cloud Storage. For example, +// "gs://folder/image1.png". +// +// `LABEL` +// : A display name of an object on an image, video etc., e.g. "dog". +// Must be up to 32 characters long and can consist only of ASCII +// Latin letters A-Z and a-z, underscores(_), and ASCII digits 0-9. +// For each label an AnnotationSpec is created which display_name +// becomes the label; AnnotationSpecs are given back in predictions. +// +// `INSTANCE_ID` +// : A positive integer that identifies a specific instance of a +// labeled entity on an example. Used e.g. to track two cars on +// a video while being able to tell apart which one is which. +// +// `BOUNDING_BOX` +// : (`VERTEX,VERTEX,VERTEX,VERTEX` | `VERTEX,,,VERTEX,,`) +// A rectangle parallel to the frame of the example (image, +// video). If 4 vertices are given they are connected by edges +// in the order provided, if 2 are given they are recognized +// as diagonally opposite vertices of the rectangle. +// +// `VERTEX` +// : (`COORDINATE,COORDINATE`) +// First coordinate is horizontal (x), the second is vertical (y). +// +// `COORDINATE` +// : A float in 0 to 1 range, relative to total length of +// image or video in given dimension. For fractions the +// leading non-decimal 0 can be omitted (i.e. 0.3 = .3). +// Point 0,0 is in top left. +// +// `TIME_SEGMENT_START` +// : (`TIME_OFFSET`) +// Expresses a beginning, inclusive, of a time segment +// within an example that has a time dimension +// (e.g. video). +// +// `TIME_SEGMENT_END` +// : (`TIME_OFFSET`) +// Expresses an end, exclusive, of a time segment within +// n example that has a time dimension (e.g. video). +// +// `TIME_OFFSET` +// : A number of seconds as measured from the start of an +// example (e.g. video). Fractions are allowed, up to a +// microsecond precision. "inf" is allowed, and it means the end +// of the example. +// +// `TEXT_SNIPPET` +// : The content of a text snippet, UTF-8 encoded, enclosed within +// double quotes (""). +// +// `DOCUMENT` +// : A field that provides the textual content with document and the layout +// information. +// +// +// **Errors:** +// +// If any of the provided CSV files can't be parsed or if more than certain +// percent of CSV rows cannot be processed then the operation fails and +// nothing is imported. Regardless of overall success or failure the per-row +// failures, up to a certain count cap, is listed in +// Operation.metadata.partial_failures. +// +message InputConfig { + // The source of the input. + oneof source { + // The Google Cloud Storage location for the input content. + // For [AutoMl.ImportData][google.cloud.automl.v1.AutoMl.ImportData], `gcs_source` points to a CSV file with + // a structure described in [InputConfig][google.cloud.automl.v1.InputConfig]. + GcsSource gcs_source = 1; + } + + // Additional domain-specific parameters describing the semantic of the + // imported data, any string must be up to 25000 + // characters long. + // + //

AutoML Tables

+ // + // `schema_inference_version` + // : (integer) This value must be supplied. + // The version of the + // algorithm to use for the initial inference of the + // column data types of the imported table. Allowed values: "1". + map params = 2; +} + +// Input configuration for BatchPredict Action. +// +// The format of input depends on the ML problem of the model used for +// prediction. As input source the +// [gcs_source][google.cloud.automl.v1.InputConfig.gcs_source] +// is expected, unless specified otherwise. +// +// The formats are represented in EBNF with commas being literal and with +// non-terminal symbols defined near the end of this comment. The formats +// are: +// +//

AutoML Vision

+//
Classification
+// +// One or more CSV files where each line is a single column: +// +// GCS_FILE_PATH +// +// The Google Cloud Storage location of an image of up to +// 30MB in size. Supported extensions: .JPEG, .GIF, .PNG. +// This path is treated as the ID in the batch predict output. +// +// Sample rows: +// +// gs://folder/image1.jpeg +// gs://folder/image2.gif +// gs://folder/image3.png +// +//
Object Detection
+// +// One or more CSV files where each line is a single column: +// +// GCS_FILE_PATH +// +// The Google Cloud Storage location of an image of up to +// 30MB in size. Supported extensions: .JPEG, .GIF, .PNG. +// This path is treated as the ID in the batch predict output. +// +// Sample rows: +// +// gs://folder/image1.jpeg +// gs://folder/image2.gif +// gs://folder/image3.png +//
+//
+// +//

AutoML Video Intelligence

+//
Classification
+// +// One or more CSV files where each line is a single column: +// +// GCS_FILE_PATH,TIME_SEGMENT_START,TIME_SEGMENT_END +// +// `GCS_FILE_PATH` is the Google Cloud Storage location of video up to 50GB in +// size and up to 3h in duration duration. +// Supported extensions: .MOV, .MPEG4, .MP4, .AVI. +// +// `TIME_SEGMENT_START` and `TIME_SEGMENT_END` must be within the +// length of the video, and the end time must be after the start time. +// +// Sample rows: +// +// gs://folder/video1.mp4,10,40 +// gs://folder/video1.mp4,20,60 +// gs://folder/vid2.mov,0,inf +// +//
Object Tracking
+// +// One or more CSV files where each line is a single column: +// +// GCS_FILE_PATH,TIME_SEGMENT_START,TIME_SEGMENT_END +// +// `GCS_FILE_PATH` is the Google Cloud Storage location of video up to 50GB in +// size and up to 3h in duration duration. +// Supported extensions: .MOV, .MPEG4, .MP4, .AVI. +// +// `TIME_SEGMENT_START` and `TIME_SEGMENT_END` must be within the +// length of the video, and the end time must be after the start time. +// +// Sample rows: +// +// gs://folder/video1.mp4,10,40 +// gs://folder/video1.mp4,20,60 +// gs://folder/vid2.mov,0,inf +//
+//
+// +//

AutoML Natural Language

+//
Classification
+// +// One or more CSV files where each line is a single column: +// +// GCS_FILE_PATH +// +// `GCS_FILE_PATH` is the Google Cloud Storage location of a text file. +// Supported file extensions: .TXT, .PDF, .TIF, .TIFF +// +// Text files can be no larger than 10MB in size. +// +// Sample rows: +// +// gs://folder/text1.txt +// gs://folder/text2.pdf +// gs://folder/text3.tif +// +//
Sentiment Analysis
+// One or more CSV files where each line is a single column: +// +// GCS_FILE_PATH +// +// `GCS_FILE_PATH` is the Google Cloud Storage location of a text file. +// Supported file extensions: .TXT, .PDF, .TIF, .TIFF +// +// Text files can be no larger than 128kB in size. +// +// Sample rows: +// +// gs://folder/text1.txt +// gs://folder/text2.pdf +// gs://folder/text3.tif +// +//
Entity Extraction
+// +// One or more JSONL (JSON Lines) files that either provide inline text or +// documents. You can only use one format, either inline text or documents, +// for a single call to [AutoMl.BatchPredict]. +// +// Each JSONL file contains a per line a proto that +// wraps a temporary user-assigned TextSnippet ID (string up to 2000 +// characters long) called "id", a TextSnippet proto (in +// JSON representation) and zero or more TextFeature protos. Any given +// text snippet content must have 30,000 characters or less, and also +// be UTF-8 NFC encoded (ASCII already is). The IDs provided should be +// unique. +// +// Each document JSONL file contains, per line, a proto that wraps a Document +// proto with `input_config` set. Each document cannot exceed 2MB in size. +// +// Supported document extensions: .PDF, .TIF, .TIFF +// +// Each JSONL file must not exceed 100MB in size, and no more than 20 +// JSONL files may be passed. +// +// Sample inline JSONL file (Shown with artificial line +// breaks. Actual line breaks are denoted by "\n".): +// +// { +// "id": "my_first_id", +// "text_snippet": { "content": "dog car cat"}, +// "text_features": [ +// { +// "text_segment": {"start_offset": 4, "end_offset": 6}, +// "structural_type": PARAGRAPH, +// "bounding_poly": { +// "normalized_vertices": [ +// {"x": 0.1, "y": 0.1}, +// {"x": 0.1, "y": 0.3}, +// {"x": 0.3, "y": 0.3}, +// {"x": 0.3, "y": 0.1}, +// ] +// }, +// } +// ], +// }\n +// { +// "id": "2", +// "text_snippet": { +// "content": "Extended sample content", +// "mime_type": "text/plain" +// } +// } +// +// Sample document JSONL file (Shown with artificial line +// breaks. Actual line breaks are denoted by "\n".): +// +// { +// "document": { +// "input_config": { +// "gcs_source": { "input_uris": [ "gs://folder/document1.pdf" ] +// } +// } +// } +// }\n +// { +// "document": { +// "input_config": { +// "gcs_source": { "input_uris": [ "gs://folder/document2.tif" ] +// } +// } +// } +// } +//
+//
+// +//

AutoML Tables

+// +// See [Preparing your training +// data](https://cloud.google.com/automl-tables/docs/predict-batch) for more +// information. +// +// You can use either +// [gcs_source][google.cloud.automl.v1.BatchPredictInputConfig.gcs_source] +// or +// [bigquery_source][BatchPredictInputConfig.bigquery_source]. +// +// **For gcs_source:** +// +// CSV file(s), each by itself 10GB or smaller and total size must be +// 100GB or smaller, where first file must have a header containing +// column names. If the first row of a subsequent file is the same as +// the header, then it is also treated as a header. All other rows +// contain values for the corresponding columns. +// +// The column names must contain the model's +// [input_feature_column_specs'][google.cloud.automl.v1.TablesModelMetadata.input_feature_column_specs] +// [display_name-s][google.cloud.automl.v1.ColumnSpec.display_name] +// (order doesn't matter). The columns corresponding to the model's +// input feature column specs must contain values compatible with the +// column spec's data types. Prediction on all the rows, i.e. the CSV +// lines, will be attempted. +// +// +// Sample rows from a CSV file: +//
+// "First Name","Last Name","Dob","Addresses"
+// "John","Doe","1968-01-22","[{"status":"current","address":"123_First_Avenue","city":"Seattle","state":"WA","zip":"11111","numberOfYears":"1"},{"status":"previous","address":"456_Main_Street","city":"Portland","state":"OR","zip":"22222","numberOfYears":"5"}]"
+// "Jane","Doe","1980-10-16","[{"status":"current","address":"789_Any_Avenue","city":"Albany","state":"NY","zip":"33333","numberOfYears":"2"},{"status":"previous","address":"321_Main_Street","city":"Hoboken","state":"NJ","zip":"44444","numberOfYears":"3"}]}
+// 
+// **For bigquery_source:** +// +// The URI of a BigQuery table. The user data size of the BigQuery +// table must be 100GB or smaller. +// +// The column names must contain the model's +// [input_feature_column_specs'][google.cloud.automl.v1.TablesModelMetadata.input_feature_column_specs] +// [display_name-s][google.cloud.automl.v1.ColumnSpec.display_name] +// (order doesn't matter). The columns corresponding to the model's +// input feature column specs must contain values compatible with the +// column spec's data types. Prediction on all the rows of the table +// will be attempted. +//
+//
+// +// **Input field definitions:** +// +// `GCS_FILE_PATH` +// : The path to a file on Google Cloud Storage. For example, +// "gs://folder/video.avi". +// +// `TIME_SEGMENT_START` +// : (`TIME_OFFSET`) +// Expresses a beginning, inclusive, of a time segment +// within an example that has a time dimension +// (e.g. video). +// +// `TIME_SEGMENT_END` +// : (`TIME_OFFSET`) +// Expresses an end, exclusive, of a time segment within +// n example that has a time dimension (e.g. video). +// +// `TIME_OFFSET` +// : A number of seconds as measured from the start of an +// example (e.g. video). Fractions are allowed, up to a +// microsecond precision. "inf" is allowed, and it means the end +// of the example. +// +// **Errors:** +// +// If any of the provided CSV files can't be parsed or if more than certain +// percent of CSV rows cannot be processed then the operation fails and +// prediction does not happen. Regardless of overall success or failure the +// per-row failures, up to a certain count cap, will be listed in +// Operation.metadata.partial_failures. +message BatchPredictInputConfig { + // The source of the input. + oneof source { + // Required. The Google Cloud Storage location for the input content. + GcsSource gcs_source = 1 [(google.api.field_behavior) = REQUIRED]; + } +} + +// Input configuration of a [Document][google.cloud.automl.v1.Document]. +message DocumentInputConfig { + // The Google Cloud Storage location of the document file. Only a single path + // should be given. + // + // Max supported size: 512MB. + // + // Supported extensions: .PDF. + GcsSource gcs_source = 1; +} + +// * For Translation: +// CSV file `translation.csv`, with each line in format: +// ML_USE,GCS_FILE_PATH +// GCS_FILE_PATH leads to a .TSV file which describes examples that have +// given ML_USE, using the following row format per line: +// TEXT_SNIPPET (in source language) \t TEXT_SNIPPET (in target +// language) +// +// * For Tables: +// Output depends on whether the dataset was imported from Google Cloud +// Storage or BigQuery. +// Google Cloud Storage case: +// [gcs_destination][google.cloud.automl.v1p1beta.OutputConfig.gcs_destination] +// must be set. Exported are CSV file(s) `tables_1.csv`, +// `tables_2.csv`,...,`tables_N.csv` with each having as header line +// the table's column names, and all other lines contain values for +// the header columns. +// BigQuery case: +// [bigquery_destination][google.cloud.automl.v1p1beta.OutputConfig.bigquery_destination] +// pointing to a BigQuery project must be set. In the given project a +// new dataset will be created with name +// `export_data__` +// where will be made +// BigQuery-dataset-name compatible (e.g. most special characters will +// become underscores), and timestamp will be in +// YYYY_MM_DDThh_mm_ss_sssZ "based on ISO-8601" format. In that +// dataset a new table called `primary_table` will be created, and +// filled with precisely the same data as this obtained on import. +message OutputConfig { + // The destination of the output. + oneof destination { + // Required. The Google Cloud Storage location where the output is to be written to. + // For Image Object Detection, Text Extraction, Video Classification and + // Tables, in the given directory a new directory will be created with name: + // export_data-- where + // timestamp is in YYYY-MM-DDThh:mm:ss.sssZ ISO-8601 format. All export + // output will be written into that directory. + GcsDestination gcs_destination = 1 [(google.api.field_behavior) = REQUIRED]; + } +} + +// Output configuration for BatchPredict Action. +// +// As destination the +// [gcs_destination][google.cloud.automl.v1.BatchPredictOutputConfig.gcs_destination] +// must be set unless specified otherwise for a domain. If gcs_destination is +// set then in the given directory a new directory is created. Its name +// will be +// "prediction--", +// where timestamp is in YYYY-MM-DDThh:mm:ss.sssZ ISO-8601 format. The contents +// of it depends on the ML problem the predictions are made for. +// +// * For Image Classification: +// In the created directory files `image_classification_1.jsonl`, +// `image_classification_2.jsonl`,...,`image_classification_N.jsonl` +// will be created, where N may be 1, and depends on the +// total number of the successfully predicted images and annotations. +// A single image will be listed only once with all its annotations, +// and its annotations will never be split across files. +// Each .JSONL file will contain, per line, a JSON representation of a +// proto that wraps image's "ID" : "" followed by a list of +// zero or more AnnotationPayload protos (called annotations), which +// have classification detail populated. +// If prediction for any image failed (partially or completely), then an +// additional `errors_1.jsonl`, `errors_2.jsonl`,..., `errors_N.jsonl` +// files will be created (N depends on total number of failed +// predictions). These files will have a JSON representation of a proto +// that wraps the same "ID" : "" but here followed by +// exactly one +// [`google.rpc.Status`](https://github.com/googleapis/googleapis/blob/master/google/rpc/status.proto) +// containing only `code` and `message`fields. +// +// * For Image Object Detection: +// In the created directory files `image_object_detection_1.jsonl`, +// `image_object_detection_2.jsonl`,...,`image_object_detection_N.jsonl` +// will be created, where N may be 1, and depends on the +// total number of the successfully predicted images and annotations. +// Each .JSONL file will contain, per line, a JSON representation of a +// proto that wraps image's "ID" : "" followed by a list of +// zero or more AnnotationPayload protos (called annotations), which +// have image_object_detection detail populated. A single image will +// be listed only once with all its annotations, and its annotations +// will never be split across files. +// If prediction for any image failed (partially or completely), then +// additional `errors_1.jsonl`, `errors_2.jsonl`,..., `errors_N.jsonl` +// files will be created (N depends on total number of failed +// predictions). These files will have a JSON representation of a proto +// that wraps the same "ID" : "" but here followed by +// exactly one +// [`google.rpc.Status`](https://github.com/googleapis/googleapis/blob/master/google/rpc/status.proto) +// containing only `code` and `message`fields. +// * For Video Classification: +// In the created directory a video_classification.csv file, and a .JSON +// file per each video classification requested in the input (i.e. each +// line in given CSV(s)), will be created. +// +// The format of video_classification.csv is: +// GCS_FILE_PATH,TIME_SEGMENT_START,TIME_SEGMENT_END,JSON_FILE_NAME,STATUS +// where: +// GCS_FILE_PATH,TIME_SEGMENT_START,TIME_SEGMENT_END = matches 1 to 1 +// the prediction input lines (i.e. video_classification.csv has +// precisely the same number of lines as the prediction input had.) +// JSON_FILE_NAME = Name of .JSON file in the output directory, which +// contains prediction responses for the video time segment. +// STATUS = "OK" if prediction completed successfully, or an error code +// with message otherwise. If STATUS is not "OK" then the .JSON file +// for that line may not exist or be empty. +// +// Each .JSON file, assuming STATUS is "OK", will contain a list of +// AnnotationPayload protos in JSON format, which are the predictions +// for the video time segment the file is assigned to in the +// video_classification.csv. All AnnotationPayload protos will have +// video_classification field set, and will be sorted by +// video_classification.type field (note that the returned types are +// governed by `classifaction_types` parameter in +// [PredictService.BatchPredictRequest.params][]). +// +// * For Video Object Tracking: +// In the created directory a video_object_tracking.csv file will be +// created, and multiple files video_object_trackinng_1.json, +// video_object_trackinng_2.json,..., video_object_trackinng_N.json, +// where N is the number of requests in the input (i.e. the number of +// lines in given CSV(s)). +// +// The format of video_object_tracking.csv is: +// GCS_FILE_PATH,TIME_SEGMENT_START,TIME_SEGMENT_END,JSON_FILE_NAME,STATUS +// where: +// GCS_FILE_PATH,TIME_SEGMENT_START,TIME_SEGMENT_END = matches 1 to 1 +// the prediction input lines (i.e. video_object_tracking.csv has +// precisely the same number of lines as the prediction input had.) +// JSON_FILE_NAME = Name of .JSON file in the output directory, which +// contains prediction responses for the video time segment. +// STATUS = "OK" if prediction completed successfully, or an error +// code with message otherwise. If STATUS is not "OK" then the .JSON +// file for that line may not exist or be empty. +// +// Each .JSON file, assuming STATUS is "OK", will contain a list of +// AnnotationPayload protos in JSON format, which are the predictions +// for each frame of the video time segment the file is assigned to in +// video_object_tracking.csv. All AnnotationPayload protos will have +// video_object_tracking field set. +// * For Text Classification: +// In the created directory files `text_classification_1.jsonl`, +// `text_classification_2.jsonl`,...,`text_classification_N.jsonl` +// will be created, where N may be 1, and depends on the +// total number of inputs and annotations found. +// +// Each .JSONL file will contain, per line, a JSON representation of a +// proto that wraps input text file (or document) in +// the text snippet (or document) proto and a list of +// zero or more AnnotationPayload protos (called annotations), which +// have classification detail populated. A single text file (or +// document) will be listed only once with all its annotations, and its +// annotations will never be split across files. +// +// If prediction for any input file (or document) failed (partially or +// completely), then additional `errors_1.jsonl`, `errors_2.jsonl`,..., +// `errors_N.jsonl` files will be created (N depends on total number of +// failed predictions). These files will have a JSON representation of a +// proto that wraps input file followed by exactly one +// [`google.rpc.Status`](https://github.com/googleapis/googleapis/blob/master/google/rpc/status.proto) +// containing only `code` and `message`. +// +// * For Text Sentiment: +// In the created directory files `text_sentiment_1.jsonl`, +// `text_sentiment_2.jsonl`,...,`text_sentiment_N.jsonl` +// will be created, where N may be 1, and depends on the +// total number of inputs and annotations found. +// +// Each .JSONL file will contain, per line, a JSON representation of a +// proto that wraps input text file (or document) in +// the text snippet (or document) proto and a list of +// zero or more AnnotationPayload protos (called annotations), which +// have text_sentiment detail populated. A single text file (or +// document) will be listed only once with all its annotations, and its +// annotations will never be split across files. +// +// If prediction for any input file (or document) failed (partially or +// completely), then additional `errors_1.jsonl`, `errors_2.jsonl`,..., +// `errors_N.jsonl` files will be created (N depends on total number of +// failed predictions). These files will have a JSON representation of a +// proto that wraps input file followed by exactly one +// [`google.rpc.Status`](https://github.com/googleapis/googleapis/blob/master/google/rpc/status.proto) +// containing only `code` and `message`. +// +// * For Text Extraction: +// In the created directory files `text_extraction_1.jsonl`, +// `text_extraction_2.jsonl`,...,`text_extraction_N.jsonl` +// will be created, where N may be 1, and depends on the +// total number of inputs and annotations found. +// The contents of these .JSONL file(s) depend on whether the input +// used inline text, or documents. +// If input was inline, then each .JSONL file will contain, per line, +// a JSON representation of a proto that wraps given in request text +// snippet's "id" (if specified), followed by input text snippet, +// and a list of zero or more +// AnnotationPayload protos (called annotations), which have +// text_extraction detail populated. A single text snippet will be +// listed only once with all its annotations, and its annotations will +// never be split across files. +// If input used documents, then each .JSONL file will contain, per +// line, a JSON representation of a proto that wraps given in request +// document proto, followed by its OCR-ed representation in the form +// of a text snippet, finally followed by a list of zero or more +// AnnotationPayload protos (called annotations), which have +// text_extraction detail populated and refer, via their indices, to +// the OCR-ed text snippet. A single document (and its text snippet) +// will be listed only once with all its annotations, and its +// annotations will never be split across files. +// If prediction for any text snippet failed (partially or completely), +// then additional `errors_1.jsonl`, `errors_2.jsonl`,..., +// `errors_N.jsonl` files will be created (N depends on total number of +// failed predictions). These files will have a JSON representation of a +// proto that wraps either the "id" : "" (in case of inline) +// or the document proto (in case of document) but here followed by +// exactly one +// [`google.rpc.Status`](https://github.com/googleapis/googleapis/blob/master/google/rpc/status.proto) +// containing only `code` and `message`. +// +// * For Tables: +// Output depends on whether +// [gcs_destination][google.cloud.automl.v1p1beta.BatchPredictOutputConfig.gcs_destination] +// or +// [bigquery_destination][google.cloud.automl.v1p1beta.BatchPredictOutputConfig.bigquery_destination] +// is set (either is allowed). +// Google Cloud Storage case: +// In the created directory files `tables_1.csv`, `tables_2.csv`,..., +// `tables_N.csv` will be created, where N may be 1, and depends on +// the total number of the successfully predicted rows. +// For all CLASSIFICATION +// [prediction_type-s][google.cloud.automl.v1p1beta.TablesModelMetadata.prediction_type]: +// Each .csv file will contain a header, listing all columns' +// [display_name-s][google.cloud.automl.v1p1beta.ColumnSpec.display_name] +// given on input followed by M target column names in the format of +// "<[target_column_specs][google.cloud.automl.v1p1beta.TablesModelMetadata.target_column_spec] +// [display_name][google.cloud.automl.v1p1beta.ColumnSpec.display_name]>__score" where M is the number of distinct target values, +// i.e. number of distinct values in the target column of the table +// used to train the model. Subsequent lines will contain the +// respective values of successfully predicted rows, with the last, +// i.e. the target, columns having the corresponding prediction +// [scores][google.cloud.automl.v1p1beta.TablesAnnotation.score]. +// For REGRESSION and FORECASTING +// [prediction_type-s][google.cloud.automl.v1p1beta.TablesModelMetadata.prediction_type]: +// Each .csv file will contain a header, listing all columns' +// [display_name-s][google.cloud.automl.v1p1beta.display_name] +// given on input followed by the predicted target column with name +// in the format of +// "predicted_<[target_column_specs][google.cloud.automl.v1p1beta.TablesModelMetadata.target_column_spec] +// [display_name][google.cloud.automl.v1p1beta.ColumnSpec.display_name]>" +// Subsequent lines will contain the respective values of +// successfully predicted rows, with the last, i.e. the target, +// column having the predicted target value. +// If prediction for any rows failed, then an additional +// `errors_1.csv`, `errors_2.csv`,..., `errors_N.csv` will be +// created (N depends on total number of failed rows). These files +// will have analogous format as `tables_*.csv`, but always with a +// single target column having +// [`google.rpc.Status`](https://github.com/googleapis/googleapis/blob/master/google/rpc/status.proto) +// represented as a JSON string, and containing only `code` and +// `message`. +// BigQuery case: +// [bigquery_destination][google.cloud.automl.v1p1beta.OutputConfig.bigquery_destination] +// pointing to a BigQuery project must be set. In the given project a +// new dataset will be created with name +// `prediction__` +// where will be made +// BigQuery-dataset-name compatible (e.g. most special characters will +// become underscores), and timestamp will be in +// YYYY_MM_DDThh_mm_ss_sssZ "based on ISO-8601" format. In the dataset +// two tables will be created, `predictions`, and `errors`. +// The `predictions` table's column names will be the input columns' +// [display_name-s][google.cloud.automl.v1p1beta.ColumnSpec.display_name] +// followed by the target column with name in the format of +// "predicted_<[target_column_specs][google.cloud.automl.v1p1beta.TablesModelMetadata.target_column_spec] +// [display_name][google.cloud.automl.v1p1beta.ColumnSpec.display_name]>" +// The input feature columns will contain the respective values of +// successfully predicted rows, with the target column having an +// ARRAY of +// [AnnotationPayloads][google.cloud.automl.v1p1beta.AnnotationPayload], +// represented as STRUCT-s, containing +// [TablesAnnotation][google.cloud.automl.v1p1beta.TablesAnnotation]. +// The `errors` table contains rows for which the prediction has +// failed, it has analogous input columns while the target column name +// is in the format of +// "errors_<[target_column_specs][google.cloud.automl.v1p1beta.TablesModelMetadata.target_column_spec] +// [display_name][google.cloud.automl.v1p1beta.ColumnSpec.display_name]>", +// and as a value has +// [`google.rpc.Status`](https://github.com/googleapis/googleapis/blob/master/google/rpc/status.proto) +// represented as a STRUCT, and containing only `code` and `message`. +message BatchPredictOutputConfig { + // The destination of the output. + oneof destination { + // Required. The Google Cloud Storage location of the directory where the output is to + // be written to. + GcsDestination gcs_destination = 1 [(google.api.field_behavior) = REQUIRED]; + } +} + +// Output configuration for ModelExport Action. +message ModelExportOutputConfig { + // The destination of the output. + oneof destination { + // Required. The Google Cloud Storage location where the model is to be written to. + // This location may only be set for the following model formats: + // "tflite", "edgetpu_tflite", "tf_saved_model", "tf_js", "core_ml". + // + // Under the directory given as the destination a new one with name + // "model-export--", + // where timestamp is in YYYY-MM-DDThh:mm:ss.sssZ ISO-8601 format, + // will be created. Inside the model and any of its supporting files + // will be written. + GcsDestination gcs_destination = 1 [(google.api.field_behavior) = REQUIRED]; + } + + // The format in which the model must be exported. The available, and default, + // formats depend on the problem and model type (if given problem and type + // combination doesn't have a format listed, it means its models are not + // exportable): + // + // * For Image Classification mobile-low-latency-1, mobile-versatile-1, + // mobile-high-accuracy-1: + // "tflite" (default), "edgetpu_tflite", "tf_saved_model", "tf_js", + // "docker". + // + // * For Image Classification mobile-core-ml-low-latency-1, + // mobile-core-ml-versatile-1, mobile-core-ml-high-accuracy-1: + // "core_ml" (default). + // + // * For Image Object Detection mobile-low-latency-1, mobile-versatile-1, + // mobile-high-accuracy-1: + // "tflite", "tf_saved_model", "tf_js". + // Formats description: + // + // * tflite - Used for Android mobile devices. + // * edgetpu_tflite - Used for [Edge TPU](https://cloud.google.com/edge-tpu/) + // devices. + // * tf_saved_model - A tensorflow model in SavedModel format. + // * tf_js - A [TensorFlow.js](https://www.tensorflow.org/js) model that can + // be used in the browser and in Node.js using JavaScript. + // * docker - Used for Docker containers. Use the params field to customize + // the container. The container is verified to work correctly on + // ubuntu 16.04 operating system. See more at + // [containers + // quickstart](https://cloud.google.com/vision/automl/docs/containers-gcs-quickstart) + // * core_ml - Used for iOS mobile devices. + string model_format = 4; + + // Additional model-type and format specific parameters describing the + // requirements for the to be exported model files, any string must be up to + // 25000 characters long. + // + // * For `docker` format: + // `cpu_architecture` - (string) "x86_64" (default). + // `gpu_architecture` - (string) "none" (default), "nvidia". + map params = 2; +} + +// The Google Cloud Storage location for the input content. +message GcsSource { + // Required. Google Cloud Storage URIs to input files, up to 2000 + // characters long. Accepted forms: + // * Full object path, e.g. gs://bucket/directory/object.csv + repeated string input_uris = 1 [(google.api.field_behavior) = REQUIRED]; +} + +// The Google Cloud Storage location where the output is to be written to. +message GcsDestination { + // Required. Google Cloud Storage URI to output directory, up to 2000 + // characters long. + // Accepted forms: + // * Prefix path: gs://bucket/directory + // The requesting user must have write permission to the bucket. + // The directory is created if it doesn't exist. + string output_uri_prefix = 1 [(google.api.field_behavior) = REQUIRED]; +} diff --git a/packages/google-cloud-automl/protos/google/cloud/automl/v1/model.proto b/packages/google-cloud-automl/protos/google/cloud/automl/v1/model.proto new file mode 100644 index 00000000000..3543f3d6a4e --- /dev/null +++ b/packages/google-cloud-automl/protos/google/cloud/automl/v1/model.proto @@ -0,0 +1,111 @@ +// 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 +// +// 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.automl.v1; + +import "google/api/resource.proto"; +import "google/cloud/automl/v1/image.proto"; +import "google/cloud/automl/v1/text.proto"; +import "google/cloud/automl/v1/translation.proto"; +import "google/protobuf/timestamp.proto"; + +option csharp_namespace = "Google.Cloud.AutoML.V1"; +option go_package = "cloud.google.com/go/automl/apiv1/automlpb;automlpb"; +option java_multiple_files = true; +option java_package = "com.google.cloud.automl.v1"; +option php_namespace = "Google\\Cloud\\AutoMl\\V1"; +option ruby_package = "Google::Cloud::AutoML::V1"; + +// API proto representing a trained machine learning model. +message Model { + option (google.api.resource) = { + type: "automl.googleapis.com/Model" + pattern: "projects/{project}/locations/{location}/models/{model}" + }; + + // Deployment state of the model. + enum DeploymentState { + // Should not be used, an un-set enum has this value by default. + DEPLOYMENT_STATE_UNSPECIFIED = 0; + + // Model is deployed. + DEPLOYED = 1; + + // Model is not deployed. + UNDEPLOYED = 2; + } + + // Required. + // The model metadata that is specific to the problem type. + // Must match the metadata type of the dataset used to train the model. + oneof model_metadata { + // Metadata for translation models. + TranslationModelMetadata translation_model_metadata = 15; + + // Metadata for image classification models. + ImageClassificationModelMetadata image_classification_model_metadata = 13; + + // Metadata for text classification models. + TextClassificationModelMetadata text_classification_model_metadata = 14; + + // Metadata for image object detection models. + ImageObjectDetectionModelMetadata image_object_detection_model_metadata = 20; + + // Metadata for text extraction models. + TextExtractionModelMetadata text_extraction_model_metadata = 19; + + // Metadata for text sentiment models. + TextSentimentModelMetadata text_sentiment_model_metadata = 22; + } + + // Output only. Resource name of the model. + // Format: `projects/{project_id}/locations/{location_id}/models/{model_id}` + string name = 1; + + // Required. The name of the model to show in the interface. The name can be + // up to 32 characters long and can consist only of ASCII Latin letters A-Z + // and a-z, underscores + // (_), and ASCII digits 0-9. It must start with a letter. + string display_name = 2; + + // Required. The resource ID of the dataset used to create the model. The dataset must + // come from the same ancestor project and location. + string dataset_id = 3; + + // Output only. Timestamp when the model training finished and can be used for prediction. + google.protobuf.Timestamp create_time = 7; + + // Output only. Timestamp when this model was last updated. + google.protobuf.Timestamp update_time = 11; + + // Output only. Deployment state of the model. A model can only serve + // prediction requests after it gets deployed. + DeploymentState deployment_state = 8; + + // Used to perform a consistent read-modify-write updates. If not set, a blind + // "overwrite" update happens. + string etag = 10; + + // Optional. The labels with user-defined metadata to organize your model. + // + // Label keys and values can be no longer than 64 characters + // (Unicode codepoints), can only contain lowercase letters, numeric + // characters, underscores and dashes. International characters are allowed. + // Label values are optional. Label keys must start with a letter. + // + // See https://goo.gl/xmQnxf for more information on and examples of labels. + map labels = 34; +} diff --git a/packages/google-cloud-automl/protos/google/cloud/automl/v1/model_evaluation.proto b/packages/google-cloud-automl/protos/google/cloud/automl/v1/model_evaluation.proto new file mode 100644 index 00000000000..5bedf4050c6 --- /dev/null +++ b/packages/google-cloud-automl/protos/google/cloud/automl/v1/model_evaluation.proto @@ -0,0 +1,101 @@ +// 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 +// +// 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.automl.v1; + +import "google/api/resource.proto"; +import "google/cloud/automl/v1/classification.proto"; +import "google/cloud/automl/v1/detection.proto"; +import "google/cloud/automl/v1/text_extraction.proto"; +import "google/cloud/automl/v1/text_sentiment.proto"; +import "google/cloud/automl/v1/translation.proto"; +import "google/protobuf/timestamp.proto"; + +option csharp_namespace = "Google.Cloud.AutoML.V1"; +option go_package = "cloud.google.com/go/automl/apiv1/automlpb;automlpb"; +option java_multiple_files = true; +option java_package = "com.google.cloud.automl.v1"; +option php_namespace = "Google\\Cloud\\AutoMl\\V1"; +option ruby_package = "Google::Cloud::AutoML::V1"; + +// Evaluation results of a model. +message ModelEvaluation { + option (google.api.resource) = { + type: "automl.googleapis.com/ModelEvaluation" + pattern: "projects/{project}/locations/{location}/models/{model}/modelEvaluations/{model_evaluation}" + }; + + // Output only. Problem type specific evaluation metrics. + oneof metrics { + // Model evaluation metrics for image, text, video and tables + // classification. + // Tables problem is considered a classification when the target column + // is CATEGORY DataType. + ClassificationEvaluationMetrics classification_evaluation_metrics = 8; + + // Model evaluation metrics for translation. + TranslationEvaluationMetrics translation_evaluation_metrics = 9; + + // Model evaluation metrics for image object detection. + ImageObjectDetectionEvaluationMetrics image_object_detection_evaluation_metrics = 12; + + // Evaluation metrics for text sentiment models. + TextSentimentEvaluationMetrics text_sentiment_evaluation_metrics = 11; + + // Evaluation metrics for text extraction models. + TextExtractionEvaluationMetrics text_extraction_evaluation_metrics = 13; + } + + // Output only. Resource name of the model evaluation. + // Format: + // `projects/{project_id}/locations/{location_id}/models/{model_id}/modelEvaluations/{model_evaluation_id}` + string name = 1; + + // Output only. The ID of the annotation spec that the model evaluation applies to. The + // The ID is empty for the overall model evaluation. + // For Tables annotation specs in the dataset do not exist and this ID is + // always not set, but for CLASSIFICATION + // [prediction_type-s][google.cloud.automl.v1.TablesModelMetadata.prediction_type] + // the + // [display_name][google.cloud.automl.v1.ModelEvaluation.display_name] + // field is used. + string annotation_spec_id = 2; + + // Output only. The value of + // [display_name][google.cloud.automl.v1.AnnotationSpec.display_name] + // at the moment when the model was trained. Because this field returns a + // value at model training time, for different models trained from the same + // dataset, the values may differ, since display names could had been changed + // between the two model's trainings. For Tables CLASSIFICATION + // [prediction_type-s][google.cloud.automl.v1.TablesModelMetadata.prediction_type] + // distinct values of the target column at the moment of the model evaluation + // are populated here. + // The display_name is empty for the overall model evaluation. + string display_name = 15; + + // Output only. Timestamp when this model evaluation was created. + google.protobuf.Timestamp create_time = 5; + + // Output only. The number of examples used for model evaluation, i.e. for + // which ground truth from time of model creation is compared against the + // predicted annotations created by the model. + // For overall ModelEvaluation (i.e. with annotation_spec_id not set) this is + // the total number of all examples used for evaluation. + // Otherwise, this is the count of examples that according to the ground + // truth were annotated by the + // [annotation_spec_id][google.cloud.automl.v1.ModelEvaluation.annotation_spec_id]. + int32 evaluated_example_count = 6; +} diff --git a/packages/google-cloud-automl/protos/google/cloud/automl/v1/operations.proto b/packages/google-cloud-automl/protos/google/cloud/automl/v1/operations.proto new file mode 100644 index 00000000000..21801093f37 --- /dev/null +++ b/packages/google-cloud-automl/protos/google/cloud/automl/v1/operations.proto @@ -0,0 +1,164 @@ +// 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 +// +// 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.automl.v1; + +import "google/cloud/automl/v1/io.proto"; +import "google/protobuf/timestamp.proto"; +import "google/rpc/status.proto"; + +option csharp_namespace = "Google.Cloud.AutoML.V1"; +option go_package = "cloud.google.com/go/automl/apiv1/automlpb;automlpb"; +option java_multiple_files = true; +option java_package = "com.google.cloud.automl.v1"; +option php_namespace = "Google\\Cloud\\AutoMl\\V1"; +option ruby_package = "Google::Cloud::AutoML::V1"; + +// Metadata used across all long running operations returned by AutoML API. +message OperationMetadata { + // Ouptut only. Details of specific operation. Even if this field is empty, + // the presence allows to distinguish different types of operations. + oneof details { + // Details of a Delete operation. + DeleteOperationMetadata delete_details = 8; + + // Details of a DeployModel operation. + DeployModelOperationMetadata deploy_model_details = 24; + + // Details of an UndeployModel operation. + UndeployModelOperationMetadata undeploy_model_details = 25; + + // Details of CreateModel operation. + CreateModelOperationMetadata create_model_details = 10; + + // Details of CreateDataset operation. + CreateDatasetOperationMetadata create_dataset_details = 30; + + // Details of ImportData operation. + ImportDataOperationMetadata import_data_details = 15; + + // Details of BatchPredict operation. + BatchPredictOperationMetadata batch_predict_details = 16; + + // Details of ExportData operation. + ExportDataOperationMetadata export_data_details = 21; + + // Details of ExportModel operation. + ExportModelOperationMetadata export_model_details = 22; + } + + // Output only. Progress of operation. Range: [0, 100]. + // Not used currently. + int32 progress_percent = 13; + + // Output only. Partial failures encountered. + // E.g. single files that couldn't be read. + // This field should never exceed 20 entries. + // Status details field will contain standard GCP error details. + repeated google.rpc.Status partial_failures = 2; + + // Output only. Time when the operation was created. + google.protobuf.Timestamp create_time = 3; + + // Output only. Time when the operation was updated for the last time. + google.protobuf.Timestamp update_time = 4; +} + +// Details of operations that perform deletes of any entities. +message DeleteOperationMetadata { + +} + +// Details of DeployModel operation. +message DeployModelOperationMetadata { + +} + +// Details of UndeployModel operation. +message UndeployModelOperationMetadata { + +} + +// Details of CreateDataset operation. +message CreateDatasetOperationMetadata { + +} + +// Details of CreateModel operation. +message CreateModelOperationMetadata { + +} + +// Details of ImportData operation. +message ImportDataOperationMetadata { + +} + +// Details of ExportData operation. +message ExportDataOperationMetadata { + // Further describes this export data's output. + // Supplements + // [OutputConfig][google.cloud.automl.v1.OutputConfig]. + message ExportDataOutputInfo { + // The output location to which the exported data is written. + oneof output_location { + // The full path of the Google Cloud Storage directory created, into which + // the exported data is written. + string gcs_output_directory = 1; + } + } + + // Output only. Information further describing this export data's output. + ExportDataOutputInfo output_info = 1; +} + +// Details of BatchPredict operation. +message BatchPredictOperationMetadata { + // Further describes this batch predict's output. + // Supplements + // [BatchPredictOutputConfig][google.cloud.automl.v1.BatchPredictOutputConfig]. + message BatchPredictOutputInfo { + // The output location into which prediction output is written. + oneof output_location { + // The full path of the Google Cloud Storage directory created, into which + // the prediction output is written. + string gcs_output_directory = 1; + } + } + + // Output only. The input config that was given upon starting this + // batch predict operation. + BatchPredictInputConfig input_config = 1; + + // Output only. Information further describing this batch predict's output. + BatchPredictOutputInfo output_info = 2; +} + +// Details of ExportModel operation. +message ExportModelOperationMetadata { + // Further describes the output of model export. + // Supplements + // [ModelExportOutputConfig][google.cloud.automl.v1.ModelExportOutputConfig]. + message ExportModelOutputInfo { + // The full path of the Google Cloud Storage directory created, into which + // the model will be exported. + string gcs_output_directory = 1; + } + + // Output only. Information further describing the output of this model + // export. + ExportModelOutputInfo output_info = 2; +} diff --git a/packages/google-cloud-automl/protos/google/cloud/automl/v1/prediction_service.proto b/packages/google-cloud-automl/protos/google/cloud/automl/v1/prediction_service.proto new file mode 100644 index 00000000000..5d1d80c48cf --- /dev/null +++ b/packages/google-cloud-automl/protos/google/cloud/automl/v1/prediction_service.proto @@ -0,0 +1,321 @@ +// 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 +// +// 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.automl.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/automl/v1/annotation_payload.proto"; +import "google/cloud/automl/v1/data_items.proto"; +import "google/cloud/automl/v1/io.proto"; +import "google/longrunning/operations.proto"; + +option csharp_namespace = "Google.Cloud.AutoML.V1"; +option go_package = "cloud.google.com/go/automl/apiv1/automlpb;automlpb"; +option java_multiple_files = true; +option java_outer_classname = "PredictionServiceProto"; +option java_package = "com.google.cloud.automl.v1"; +option php_namespace = "Google\\Cloud\\AutoMl\\V1"; +option ruby_package = "Google::Cloud::AutoML::V1"; + +// AutoML Prediction API. +// +// On any input that is documented to expect a string parameter in +// snake_case or dash-case, either of those cases is accepted. +service PredictionService { + option (google.api.default_host) = "automl.googleapis.com"; + option (google.api.oauth_scopes) = "https://www.googleapis.com/auth/cloud-platform"; + + // Perform an online prediction. The prediction result is directly + // returned in the response. + // Available for following ML scenarios, and their expected request payloads: + // + // AutoML Vision Classification + // + // * An image in .JPEG, .GIF or .PNG format, image_bytes up to 30MB. + // + // AutoML Vision Object Detection + // + // * An image in .JPEG, .GIF or .PNG format, image_bytes up to 30MB. + // + // AutoML Natural Language Classification + // + // * A TextSnippet up to 60,000 characters, UTF-8 encoded or a document in + // .PDF, .TIF or .TIFF format with size upto 2MB. + // + // AutoML Natural Language Entity Extraction + // + // * A TextSnippet up to 10,000 characters, UTF-8 NFC encoded or a document + // in .PDF, .TIF or .TIFF format with size upto 20MB. + // + // AutoML Natural Language Sentiment Analysis + // + // * A TextSnippet up to 60,000 characters, UTF-8 encoded or a document in + // .PDF, .TIF or .TIFF format with size upto 2MB. + // + // AutoML Translation + // + // * A TextSnippet up to 25,000 characters, UTF-8 encoded. + // + // AutoML Tables + // + // * A row with column values matching + // the columns of the model, up to 5MB. Not available for FORECASTING + // `prediction_type`. + rpc Predict(PredictRequest) returns (PredictResponse) { + option (google.api.http) = { + post: "/v1/{name=projects/*/locations/*/models/*}:predict" + body: "*" + }; + option (google.api.method_signature) = "name,payload,params"; + } + + // Perform a batch prediction. Unlike the online [Predict][google.cloud.automl.v1.PredictionService.Predict], batch + // prediction result won't be immediately available in the response. Instead, + // a long running operation object is returned. User can poll the operation + // result via [GetOperation][google.longrunning.Operations.GetOperation] + // method. Once the operation is done, [BatchPredictResult][google.cloud.automl.v1.BatchPredictResult] is returned in + // the [response][google.longrunning.Operation.response] field. + // Available for following ML scenarios: + // + // * AutoML Vision Classification + // * AutoML Vision Object Detection + // * AutoML Video Intelligence Classification + // * AutoML Video Intelligence Object Tracking * AutoML Natural Language Classification + // * AutoML Natural Language Entity Extraction + // * AutoML Natural Language Sentiment Analysis + // * AutoML Tables + rpc BatchPredict(BatchPredictRequest) returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v1/{name=projects/*/locations/*/models/*}:batchPredict" + body: "*" + }; + option (google.api.method_signature) = "name,input_config,output_config,params"; + option (google.longrunning.operation_info) = { + response_type: "BatchPredictResult" + metadata_type: "OperationMetadata" + }; + } +} + +// Request message for [PredictionService.Predict][google.cloud.automl.v1.PredictionService.Predict]. +message PredictRequest { + // Required. Name of the model requested to serve the prediction. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "automl.googleapis.com/Model" + } + ]; + + // Required. Payload to perform a prediction on. The payload must match the + // problem type that the model was trained to solve. + ExamplePayload payload = 2 [(google.api.field_behavior) = REQUIRED]; + + // Additional domain-specific parameters, any string must be up to 25000 + // characters long. + // + // AutoML Vision Classification + // + // `score_threshold` + // : (float) A value from 0.0 to 1.0. When the model + // makes predictions for an image, it will only produce results that have + // at least this confidence score. The default is 0.5. + // + // AutoML Vision Object Detection + // + // `score_threshold` + // : (float) When Model detects objects on the image, + // it will only produce bounding boxes which have at least this + // confidence score. Value in 0 to 1 range, default is 0.5. + // + // `max_bounding_box_count` + // : (int64) The maximum number of bounding + // boxes returned. The default is 100. The + // number of returned bounding boxes might be limited by the server. + // + // AutoML Tables + // + // `feature_importance` + // : (boolean) Whether + // [feature_importance][google.cloud.automl.v1.TablesModelColumnInfo.feature_importance] + // is populated in the returned list of + // [TablesAnnotation][google.cloud.automl.v1.TablesAnnotation] + // objects. The default is false. + map params = 3; +} + +// Response message for [PredictionService.Predict][google.cloud.automl.v1.PredictionService.Predict]. +message PredictResponse { + // Prediction result. + // AutoML Translation and AutoML Natural Language Sentiment Analysis + // return precisely one payload. + repeated AnnotationPayload payload = 1; + + // The preprocessed example that AutoML actually makes prediction on. + // Empty if AutoML does not preprocess the input example. + // + // For AutoML Natural Language (Classification, Entity Extraction, and + // Sentiment Analysis), if the input is a document, the recognized text is + // returned in the + // [document_text][google.cloud.automl.v1.Document.document_text] + // property. + ExamplePayload preprocessed_input = 3; + + // Additional domain-specific prediction response metadata. + // + // AutoML Vision Object Detection + // + // `max_bounding_box_count` + // : (int64) The maximum number of bounding boxes to return per image. + // + // AutoML Natural Language Sentiment Analysis + // + // `sentiment_score` + // : (float, deprecated) A value between -1 and 1, + // -1 maps to least positive sentiment, while 1 maps to the most positive + // one and the higher the score, the more positive the sentiment in the + // document is. Yet these values are relative to the training data, so + // e.g. if all data was positive then -1 is also positive (though + // the least). + // `sentiment_score` is not the same as "score" and "magnitude" + // from Sentiment Analysis in the Natural Language API. + map metadata = 2; +} + +// Request message for [PredictionService.BatchPredict][google.cloud.automl.v1.PredictionService.BatchPredict]. +message BatchPredictRequest { + // Required. Name of the model requested to serve the batch prediction. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "automl.googleapis.com/Model" + } + ]; + + // Required. The input configuration for batch prediction. + BatchPredictInputConfig input_config = 3 [(google.api.field_behavior) = REQUIRED]; + + // Required. The Configuration specifying where output predictions should + // be written. + BatchPredictOutputConfig output_config = 4 [(google.api.field_behavior) = REQUIRED]; + + // Additional domain-specific parameters for the predictions, any string must + // be up to 25000 characters long. + // + // AutoML Natural Language Classification + // + // `score_threshold` + // : (float) A value from 0.0 to 1.0. When the model + // makes predictions for a text snippet, it will only produce results + // that have at least this confidence score. The default is 0.5. + // + // + // AutoML Vision Classification + // + // `score_threshold` + // : (float) A value from 0.0 to 1.0. When the model + // makes predictions for an image, it will only produce results that + // have at least this confidence score. The default is 0.5. + // + // AutoML Vision Object Detection + // + // `score_threshold` + // : (float) When Model detects objects on the image, + // it will only produce bounding boxes which have at least this + // confidence score. Value in 0 to 1 range, default is 0.5. + // + // `max_bounding_box_count` + // : (int64) The maximum number of bounding + // boxes returned per image. The default is 100, the + // number of bounding boxes returned might be limited by the server. + // AutoML Video Intelligence Classification + // + // `score_threshold` + // : (float) A value from 0.0 to 1.0. When the model + // makes predictions for a video, it will only produce results that + // have at least this confidence score. The default is 0.5. + // + // `segment_classification` + // : (boolean) Set to true to request + // segment-level classification. AutoML Video Intelligence returns + // labels and their confidence scores for the entire segment of the + // video that user specified in the request configuration. + // The default is true. + // + // `shot_classification` + // : (boolean) Set to true to request shot-level + // classification. AutoML Video Intelligence determines the boundaries + // for each camera shot in the entire segment of the video that user + // specified in the request configuration. AutoML Video Intelligence + // then returns labels and their confidence scores for each detected + // shot, along with the start and end time of the shot. + // The default is false. + // + // WARNING: Model evaluation is not done for this classification type, + // the quality of it depends on training data, but there are no metrics + // provided to describe that quality. + // + // `1s_interval_classification` + // : (boolean) Set to true to request + // classification for a video at one-second intervals. AutoML Video + // Intelligence returns labels and their confidence scores for each + // second of the entire segment of the video that user specified in the + // request configuration. The default is false. + // + // WARNING: Model evaluation is not done for this classification + // type, the quality of it depends on training data, but there are no + // metrics provided to describe that quality. + // + // AutoML Video Intelligence Object Tracking + // + // `score_threshold` + // : (float) When Model detects objects on video frames, + // it will only produce bounding boxes which have at least this + // confidence score. Value in 0 to 1 range, default is 0.5. + // + // `max_bounding_box_count` + // : (int64) The maximum number of bounding + // boxes returned per image. The default is 100, the + // number of bounding boxes returned might be limited by the server. + // + // `min_bounding_box_size` + // : (float) Only bounding boxes with shortest edge + // at least that long as a relative value of video frame size are + // returned. Value in 0 to 1 range. Default is 0. + // + map params = 5; +} + +// Result of the Batch Predict. This message is returned in +// [response][google.longrunning.Operation.response] of the operation returned +// by the [PredictionService.BatchPredict][google.cloud.automl.v1.PredictionService.BatchPredict]. +message BatchPredictResult { + // Additional domain-specific prediction response metadata. + // + // AutoML Vision Object Detection + // + // `max_bounding_box_count` + // : (int64) The maximum number of bounding boxes returned per image. + // + // AutoML Video Intelligence Object Tracking + // + // `max_bounding_box_count` + // : (int64) The maximum number of bounding boxes returned per frame. + map metadata = 1; +} diff --git a/packages/google-cloud-automl/protos/google/cloud/automl/v1/service.proto b/packages/google-cloud-automl/protos/google/cloud/automl/v1/service.proto new file mode 100644 index 00000000000..ea5dc36fbbc --- /dev/null +++ b/packages/google-cloud-automl/protos/google/cloud/automl/v1/service.proto @@ -0,0 +1,607 @@ +// 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 +// +// 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.automl.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/automl/v1/annotation_payload.proto"; +import "google/cloud/automl/v1/annotation_spec.proto"; +import "google/cloud/automl/v1/dataset.proto"; +import "google/cloud/automl/v1/image.proto"; +import "google/cloud/automl/v1/io.proto"; +import "google/cloud/automl/v1/model.proto"; +import "google/cloud/automl/v1/model_evaluation.proto"; +import "google/longrunning/operations.proto"; +import "google/protobuf/field_mask.proto"; + +option csharp_namespace = "Google.Cloud.AutoML.V1"; +option go_package = "cloud.google.com/go/automl/apiv1/automlpb;automlpb"; +option java_multiple_files = true; +option java_outer_classname = "AutoMlProto"; +option java_package = "com.google.cloud.automl.v1"; +option php_namespace = "Google\\Cloud\\AutoMl\\V1"; +option ruby_package = "Google::Cloud::AutoML::V1"; + +// AutoML Server API. +// +// The resource names are assigned by the server. +// The server never reuses names that it has created after the resources with +// those names are deleted. +// +// An ID of a resource is the last element of the item's resource name. For +// `projects/{project_id}/locations/{location_id}/datasets/{dataset_id}`, then +// the id for the item is `{dataset_id}`. +// +// Currently the only supported `location_id` is "us-central1". +// +// On any input that is documented to expect a string parameter in +// snake_case or dash-case, either of those cases is accepted. +service AutoMl { + option (google.api.default_host) = "automl.googleapis.com"; + option (google.api.oauth_scopes) = "https://www.googleapis.com/auth/cloud-platform"; + + // Creates a dataset. + rpc CreateDataset(CreateDatasetRequest) returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v1/{parent=projects/*/locations/*}/datasets" + body: "dataset" + }; + option (google.api.method_signature) = "parent,dataset"; + option (google.longrunning.operation_info) = { + response_type: "Dataset" + metadata_type: "OperationMetadata" + }; + } + + // Gets a dataset. + rpc GetDataset(GetDatasetRequest) returns (Dataset) { + option (google.api.http) = { + get: "/v1/{name=projects/*/locations/*/datasets/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Lists datasets in a project. + rpc ListDatasets(ListDatasetsRequest) returns (ListDatasetsResponse) { + option (google.api.http) = { + get: "/v1/{parent=projects/*/locations/*}/datasets" + }; + option (google.api.method_signature) = "parent"; + } + + // Updates a dataset. + rpc UpdateDataset(UpdateDatasetRequest) returns (Dataset) { + option (google.api.http) = { + patch: "/v1/{dataset.name=projects/*/locations/*/datasets/*}" + body: "dataset" + }; + option (google.api.method_signature) = "dataset,update_mask"; + } + + // Deletes a dataset and all of its contents. + // Returns empty response in the + // [response][google.longrunning.Operation.response] field when it completes, + // and `delete_details` in the + // [metadata][google.longrunning.Operation.metadata] field. + rpc DeleteDataset(DeleteDatasetRequest) returns (google.longrunning.Operation) { + option (google.api.http) = { + delete: "/v1/{name=projects/*/locations/*/datasets/*}" + }; + option (google.api.method_signature) = "name"; + option (google.longrunning.operation_info) = { + response_type: "google.protobuf.Empty" + metadata_type: "OperationMetadata" + }; + } + + // Imports data into a dataset. + // For Tables this method can only be called on an empty Dataset. + // + // For Tables: + // * A + // [schema_inference_version][google.cloud.automl.v1.InputConfig.params] + // parameter must be explicitly set. + // Returns an empty response in the + // [response][google.longrunning.Operation.response] field when it completes. + rpc ImportData(ImportDataRequest) returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v1/{name=projects/*/locations/*/datasets/*}:importData" + body: "*" + }; + option (google.api.method_signature) = "name,input_config"; + option (google.longrunning.operation_info) = { + response_type: "google.protobuf.Empty" + metadata_type: "OperationMetadata" + }; + } + + // Exports dataset's data to the provided output location. + // Returns an empty response in the + // [response][google.longrunning.Operation.response] field when it completes. + rpc ExportData(ExportDataRequest) returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v1/{name=projects/*/locations/*/datasets/*}:exportData" + body: "*" + }; + option (google.api.method_signature) = "name,output_config"; + option (google.longrunning.operation_info) = { + response_type: "google.protobuf.Empty" + metadata_type: "OperationMetadata" + }; + } + + // Gets an annotation spec. + rpc GetAnnotationSpec(GetAnnotationSpecRequest) returns (AnnotationSpec) { + option (google.api.http) = { + get: "/v1/{name=projects/*/locations/*/datasets/*/annotationSpecs/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Creates a model. + // Returns a Model in the [response][google.longrunning.Operation.response] + // field when it completes. + // When you create a model, several model evaluations are created for it: + // a global evaluation, and one evaluation for each annotation spec. + rpc CreateModel(CreateModelRequest) returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v1/{parent=projects/*/locations/*}/models" + body: "model" + }; + option (google.api.method_signature) = "parent,model"; + option (google.longrunning.operation_info) = { + response_type: "Model" + metadata_type: "OperationMetadata" + }; + } + + // Gets a model. + rpc GetModel(GetModelRequest) returns (Model) { + option (google.api.http) = { + get: "/v1/{name=projects/*/locations/*/models/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Lists models. + rpc ListModels(ListModelsRequest) returns (ListModelsResponse) { + option (google.api.http) = { + get: "/v1/{parent=projects/*/locations/*}/models" + }; + option (google.api.method_signature) = "parent"; + } + + // Deletes a model. + // Returns `google.protobuf.Empty` in the + // [response][google.longrunning.Operation.response] field when it completes, + // and `delete_details` in the + // [metadata][google.longrunning.Operation.metadata] field. + rpc DeleteModel(DeleteModelRequest) returns (google.longrunning.Operation) { + option (google.api.http) = { + delete: "/v1/{name=projects/*/locations/*/models/*}" + }; + option (google.api.method_signature) = "name"; + option (google.longrunning.operation_info) = { + response_type: "google.protobuf.Empty" + metadata_type: "OperationMetadata" + }; + } + + // Updates a model. + rpc UpdateModel(UpdateModelRequest) returns (Model) { + option (google.api.http) = { + patch: "/v1/{model.name=projects/*/locations/*/models/*}" + body: "model" + }; + option (google.api.method_signature) = "model,update_mask"; + } + + // Deploys a model. If a model is already deployed, deploying it with the + // same parameters has no effect. Deploying with different parametrs + // (as e.g. changing + // [node_number][google.cloud.automl.v1p1beta.ImageObjectDetectionModelDeploymentMetadata.node_number]) + // will reset the deployment state without pausing the model's availability. + // + // Only applicable for Text Classification, Image Object Detection , Tables, and Image Segmentation; all other domains manage + // deployment automatically. + // + // Returns an empty response in the + // [response][google.longrunning.Operation.response] field when it completes. + rpc DeployModel(DeployModelRequest) returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v1/{name=projects/*/locations/*/models/*}:deploy" + body: "*" + }; + option (google.api.method_signature) = "name"; + option (google.longrunning.operation_info) = { + response_type: "google.protobuf.Empty" + metadata_type: "OperationMetadata" + }; + } + + // Undeploys a model. If the model is not deployed this method has no effect. + // + // Only applicable for Text Classification, Image Object Detection and Tables; + // all other domains manage deployment automatically. + // + // Returns an empty response in the + // [response][google.longrunning.Operation.response] field when it completes. + rpc UndeployModel(UndeployModelRequest) returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v1/{name=projects/*/locations/*/models/*}:undeploy" + body: "*" + }; + option (google.api.method_signature) = "name"; + option (google.longrunning.operation_info) = { + response_type: "google.protobuf.Empty" + metadata_type: "OperationMetadata" + }; + } + + // Exports a trained, "export-able", model to a user specified Google Cloud + // Storage location. A model is considered export-able if and only if it has + // an export format defined for it in + // [ModelExportOutputConfig][google.cloud.automl.v1.ModelExportOutputConfig]. + // + // Returns an empty response in the + // [response][google.longrunning.Operation.response] field when it completes. + rpc ExportModel(ExportModelRequest) returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v1/{name=projects/*/locations/*/models/*}:export" + body: "*" + }; + option (google.api.method_signature) = "name,output_config"; + option (google.longrunning.operation_info) = { + response_type: "google.protobuf.Empty" + metadata_type: "OperationMetadata" + }; + } + + // Gets a model evaluation. + rpc GetModelEvaluation(GetModelEvaluationRequest) returns (ModelEvaluation) { + option (google.api.http) = { + get: "/v1/{name=projects/*/locations/*/models/*/modelEvaluations/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Lists model evaluations. + rpc ListModelEvaluations(ListModelEvaluationsRequest) returns (ListModelEvaluationsResponse) { + option (google.api.http) = { + get: "/v1/{parent=projects/*/locations/*/models/*}/modelEvaluations" + }; + option (google.api.method_signature) = "parent,filter"; + } +} + +// Request message for [AutoMl.CreateDataset][google.cloud.automl.v1.AutoMl.CreateDataset]. +message CreateDatasetRequest { + // Required. The resource name of the project to create the dataset for. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "locations.googleapis.com/Location" + } + ]; + + // Required. The dataset to create. + Dataset dataset = 2 [(google.api.field_behavior) = REQUIRED]; +} + +// Request message for [AutoMl.GetDataset][google.cloud.automl.v1.AutoMl.GetDataset]. +message GetDatasetRequest { + // Required. The resource name of the dataset to retrieve. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "automl.googleapis.com/Dataset" + } + ]; +} + +// Request message for [AutoMl.ListDatasets][google.cloud.automl.v1.AutoMl.ListDatasets]. +message ListDatasetsRequest { + // Required. The resource name of the project from which to list datasets. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "locations.googleapis.com/Location" + } + ]; + + // An expression for filtering the results of the request. + // + // * `dataset_metadata` - for existence of the case (e.g. + // `image_classification_dataset_metadata:*`). Some examples of using the filter are: + // + // * `translation_dataset_metadata:*` --> The dataset has + // `translation_dataset_metadata`. + string filter = 3; + + // Requested page size. Server may return fewer results than requested. + // If unspecified, server will pick a default size. + int32 page_size = 4; + + // A token identifying a page of results for the server to return + // Typically obtained via + // [ListDatasetsResponse.next_page_token][google.cloud.automl.v1.ListDatasetsResponse.next_page_token] of the previous + // [AutoMl.ListDatasets][google.cloud.automl.v1.AutoMl.ListDatasets] call. + string page_token = 6; +} + +// Response message for [AutoMl.ListDatasets][google.cloud.automl.v1.AutoMl.ListDatasets]. +message ListDatasetsResponse { + // The datasets read. + repeated Dataset datasets = 1; + + // A token to retrieve next page of results. + // Pass to [ListDatasetsRequest.page_token][google.cloud.automl.v1.ListDatasetsRequest.page_token] to obtain that page. + string next_page_token = 2; +} + +// Request message for [AutoMl.UpdateDataset][google.cloud.automl.v1.AutoMl.UpdateDataset] +message UpdateDatasetRequest { + // Required. The dataset which replaces the resource on the server. + Dataset dataset = 1 [(google.api.field_behavior) = REQUIRED]; + + // Required. The update mask applies to the resource. + google.protobuf.FieldMask update_mask = 2 [(google.api.field_behavior) = REQUIRED]; +} + +// Request message for [AutoMl.DeleteDataset][google.cloud.automl.v1.AutoMl.DeleteDataset]. +message DeleteDatasetRequest { + // Required. The resource name of the dataset to delete. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "automl.googleapis.com/Dataset" + } + ]; +} + +// Request message for [AutoMl.ImportData][google.cloud.automl.v1.AutoMl.ImportData]. +message ImportDataRequest { + // Required. Dataset name. Dataset must already exist. All imported + // annotations and examples will be added. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "automl.googleapis.com/Dataset" + } + ]; + + // Required. The desired input location and its domain specific semantics, + // if any. + InputConfig input_config = 3 [(google.api.field_behavior) = REQUIRED]; +} + +// Request message for [AutoMl.ExportData][google.cloud.automl.v1.AutoMl.ExportData]. +message ExportDataRequest { + // Required. The resource name of the dataset. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "automl.googleapis.com/Dataset" + } + ]; + + // Required. The desired output location. + OutputConfig output_config = 3 [(google.api.field_behavior) = REQUIRED]; +} + +// Request message for [AutoMl.GetAnnotationSpec][google.cloud.automl.v1.AutoMl.GetAnnotationSpec]. +message GetAnnotationSpecRequest { + // Required. The resource name of the annotation spec to retrieve. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "automl.googleapis.com/AnnotationSpec" + } + ]; +} + +// Request message for [AutoMl.CreateModel][google.cloud.automl.v1.AutoMl.CreateModel]. +message CreateModelRequest { + // Required. Resource name of the parent project where the model is being created. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "locations.googleapis.com/Location" + } + ]; + + // Required. The model to create. + Model model = 4 [(google.api.field_behavior) = REQUIRED]; +} + +// Request message for [AutoMl.GetModel][google.cloud.automl.v1.AutoMl.GetModel]. +message GetModelRequest { + // Required. Resource name of the model. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "automl.googleapis.com/Model" + } + ]; +} + +// Request message for [AutoMl.ListModels][google.cloud.automl.v1.AutoMl.ListModels]. +message ListModelsRequest { + // Required. Resource name of the project, from which to list the models. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "locations.googleapis.com/Location" + } + ]; + + // An expression for filtering the results of the request. + // + // * `model_metadata` - for existence of the case (e.g. + // `video_classification_model_metadata:*`). + // * `dataset_id` - for = or !=. Some examples of using the filter are: + // + // * `image_classification_model_metadata:*` --> The model has + // `image_classification_model_metadata`. + // * `dataset_id=5` --> The model was created from a dataset with ID 5. + string filter = 3; + + // Requested page size. + int32 page_size = 4; + + // A token identifying a page of results for the server to return + // Typically obtained via + // [ListModelsResponse.next_page_token][google.cloud.automl.v1.ListModelsResponse.next_page_token] of the previous + // [AutoMl.ListModels][google.cloud.automl.v1.AutoMl.ListModels] call. + string page_token = 6; +} + +// Response message for [AutoMl.ListModels][google.cloud.automl.v1.AutoMl.ListModels]. +message ListModelsResponse { + // List of models in the requested page. + repeated Model model = 1; + + // A token to retrieve next page of results. + // Pass to [ListModelsRequest.page_token][google.cloud.automl.v1.ListModelsRequest.page_token] to obtain that page. + string next_page_token = 2; +} + +// Request message for [AutoMl.DeleteModel][google.cloud.automl.v1.AutoMl.DeleteModel]. +message DeleteModelRequest { + // Required. Resource name of the model being deleted. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "automl.googleapis.com/Model" + } + ]; +} + +// Request message for [AutoMl.UpdateModel][google.cloud.automl.v1.AutoMl.UpdateModel] +message UpdateModelRequest { + // Required. The model which replaces the resource on the server. + Model model = 1 [(google.api.field_behavior) = REQUIRED]; + + // Required. The update mask applies to the resource. + google.protobuf.FieldMask update_mask = 2 [(google.api.field_behavior) = REQUIRED]; +} + +// Request message for [AutoMl.DeployModel][google.cloud.automl.v1.AutoMl.DeployModel]. +message DeployModelRequest { + // The per-domain specific deployment parameters. + oneof model_deployment_metadata { + // Model deployment metadata specific to Image Object Detection. + ImageObjectDetectionModelDeploymentMetadata image_object_detection_model_deployment_metadata = 2; + + // Model deployment metadata specific to Image Classification. + ImageClassificationModelDeploymentMetadata image_classification_model_deployment_metadata = 4; + } + + // Required. Resource name of the model to deploy. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "automl.googleapis.com/Model" + } + ]; +} + +// Request message for [AutoMl.UndeployModel][google.cloud.automl.v1.AutoMl.UndeployModel]. +message UndeployModelRequest { + // Required. Resource name of the model to undeploy. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "automl.googleapis.com/Model" + } + ]; +} + +// Request message for [AutoMl.ExportModel][google.cloud.automl.v1.AutoMl.ExportModel]. +// Models need to be enabled for exporting, otherwise an error code will be +// returned. +message ExportModelRequest { + // Required. The resource name of the model to export. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "automl.googleapis.com/Model" + } + ]; + + // Required. The desired output location and configuration. + ModelExportOutputConfig output_config = 3 [(google.api.field_behavior) = REQUIRED]; +} + +// Request message for [AutoMl.GetModelEvaluation][google.cloud.automl.v1.AutoMl.GetModelEvaluation]. +message GetModelEvaluationRequest { + // Required. Resource name for the model evaluation. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "automl.googleapis.com/ModelEvaluation" + } + ]; +} + +// Request message for [AutoMl.ListModelEvaluations][google.cloud.automl.v1.AutoMl.ListModelEvaluations]. +message ListModelEvaluationsRequest { + // Required. Resource name of the model to list the model evaluations for. + // If modelId is set as "-", this will list model evaluations from across all + // models of the parent location. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "automl.googleapis.com/Model" + } + ]; + + // Required. An expression for filtering the results of the request. + // + // * `annotation_spec_id` - for =, != or existence. See example below for + // the last. + // + // Some examples of using the filter are: + // + // * `annotation_spec_id!=4` --> The model evaluation was done for + // annotation spec with ID different than 4. + // * `NOT annotation_spec_id:*` --> The model evaluation was done for + // aggregate of all annotation specs. + string filter = 3 [(google.api.field_behavior) = REQUIRED]; + + // Requested page size. + int32 page_size = 4; + + // A token identifying a page of results for the server to return. + // Typically obtained via + // [ListModelEvaluationsResponse.next_page_token][google.cloud.automl.v1.ListModelEvaluationsResponse.next_page_token] of the previous + // [AutoMl.ListModelEvaluations][google.cloud.automl.v1.AutoMl.ListModelEvaluations] call. + string page_token = 6; +} + +// Response message for [AutoMl.ListModelEvaluations][google.cloud.automl.v1.AutoMl.ListModelEvaluations]. +message ListModelEvaluationsResponse { + // List of model evaluations in the requested page. + repeated ModelEvaluation model_evaluation = 1; + + // A token to retrieve next page of results. + // Pass to the [ListModelEvaluationsRequest.page_token][google.cloud.automl.v1.ListModelEvaluationsRequest.page_token] field of a new + // [AutoMl.ListModelEvaluations][google.cloud.automl.v1.AutoMl.ListModelEvaluations] request to obtain that page. + string next_page_token = 2; +} diff --git a/packages/google-cloud-automl/protos/google/cloud/automl/v1/text.proto b/packages/google-cloud-automl/protos/google/cloud/automl/v1/text.proto new file mode 100644 index 00000000000..e227347f931 --- /dev/null +++ b/packages/google-cloud-automl/protos/google/cloud/automl/v1/text.proto @@ -0,0 +1,65 @@ +// 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 +// +// 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.automl.v1; + +import "google/cloud/automl/v1/classification.proto"; + +option csharp_namespace = "Google.Cloud.AutoML.V1"; +option go_package = "cloud.google.com/go/automl/apiv1/automlpb;automlpb"; +option java_multiple_files = true; +option java_outer_classname = "TextProto"; +option java_package = "com.google.cloud.automl.v1"; +option php_namespace = "Google\\Cloud\\AutoMl\\V1"; +option ruby_package = "Google::Cloud::AutoML::V1"; + +// Dataset metadata for classification. +message TextClassificationDatasetMetadata { + // Required. Type of the classification problem. + ClassificationType classification_type = 1; +} + +// Model metadata that is specific to text classification. +message TextClassificationModelMetadata { + // Output only. Classification type of the dataset used to train this model. + ClassificationType classification_type = 3; +} + +// Dataset metadata that is specific to text extraction +message TextExtractionDatasetMetadata { + +} + +// Model metadata that is specific to text extraction. +message TextExtractionModelMetadata { + +} + +// Dataset metadata for text sentiment. +message TextSentimentDatasetMetadata { + // Required. A sentiment is expressed as an integer ordinal, where higher value + // means a more positive sentiment. The range of sentiments that will be used + // is between 0 and sentiment_max (inclusive on both ends), and all the values + // in the range must be represented in the dataset before a model can be + // created. + // sentiment_max value must be between 1 and 10 (inclusive). + int32 sentiment_max = 1; +} + +// Model metadata that is specific to text sentiment. +message TextSentimentModelMetadata { + +} diff --git a/packages/google-cloud-automl/protos/google/cloud/automl/v1/text_extraction.proto b/packages/google-cloud-automl/protos/google/cloud/automl/v1/text_extraction.proto new file mode 100644 index 00000000000..239299e8859 --- /dev/null +++ b/packages/google-cloud-automl/protos/google/cloud/automl/v1/text_extraction.proto @@ -0,0 +1,68 @@ +// 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 +// +// 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.automl.v1; + +import "google/cloud/automl/v1/text_segment.proto"; + +option csharp_namespace = "Google.Cloud.AutoML.V1"; +option go_package = "cloud.google.com/go/automl/apiv1/automlpb;automlpb"; +option java_multiple_files = true; +option java_package = "com.google.cloud.automl.v1"; +option php_namespace = "Google\\Cloud\\AutoMl\\V1"; +option ruby_package = "Google::Cloud::AutoML::V1"; + +// Annotation for identifying spans of text. +message TextExtractionAnnotation { + // Required. Text extraction annotations can either be a text segment or a + // text relation. + oneof annotation { + // An entity annotation will set this, which is the part of the original + // text to which the annotation pertains. + TextSegment text_segment = 3; + } + + // Output only. A confidence estimate between 0.0 and 1.0. A higher value + // means greater confidence in correctness of the annotation. + float score = 1; +} + +// Model evaluation metrics for text extraction problems. +message TextExtractionEvaluationMetrics { + // Metrics for a single confidence threshold. + message ConfidenceMetricsEntry { + // Output only. The confidence threshold value used to compute the metrics. + // Only annotations with score of at least this threshold are considered to + // be ones the model would return. + float confidence_threshold = 1; + + // Output only. Recall under the given confidence threshold. + float recall = 3; + + // Output only. Precision under the given confidence threshold. + float precision = 4; + + // Output only. The harmonic mean of recall and precision. + float f1_score = 5; + } + + // Output only. The Area under precision recall curve metric. + float au_prc = 1; + + // Output only. Metrics that have confidence thresholds. + // Precision-recall curve can be derived from it. + repeated ConfidenceMetricsEntry confidence_metrics_entries = 2; +} diff --git a/packages/google-cloud-automl/protos/google/cloud/automl/v1/text_segment.proto b/packages/google-cloud-automl/protos/google/cloud/automl/v1/text_segment.proto new file mode 100644 index 00000000000..36bf4f34341 --- /dev/null +++ b/packages/google-cloud-automl/protos/google/cloud/automl/v1/text_segment.proto @@ -0,0 +1,40 @@ +// 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 +// +// 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.automl.v1; + +option csharp_namespace = "Google.Cloud.AutoML.V1"; +option go_package = "cloud.google.com/go/automl/apiv1/automlpb;automlpb"; +option java_multiple_files = true; +option java_outer_classname = "TextSegmentProto"; +option java_package = "com.google.cloud.automl.v1"; +option php_namespace = "Google\\Cloud\\AutoMl\\V1"; +option ruby_package = "Google::Cloud::AutoML::V1"; + +// A contiguous part of a text (string), assuming it has an UTF-8 NFC encoding. +message TextSegment { + // Output only. The content of the TextSegment. + string content = 3; + + // Required. Zero-based character index of the first character of the text + // segment (counting characters from the beginning of the text). + int64 start_offset = 1; + + // Required. Zero-based character index of the first character past the end of + // the text segment (counting character from the beginning of the text). + // The character at the end_offset is NOT included in the text segment. + int64 end_offset = 2; +} diff --git a/packages/google-cloud-automl/protos/google/cloud/automl/v1/text_sentiment.proto b/packages/google-cloud-automl/protos/google/cloud/automl/v1/text_sentiment.proto new file mode 100644 index 00000000000..865459ea67c --- /dev/null +++ b/packages/google-cloud-automl/protos/google/cloud/automl/v1/text_sentiment.proto @@ -0,0 +1,77 @@ +// 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 +// +// 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.automl.v1; + +import "google/cloud/automl/v1/classification.proto"; + +option csharp_namespace = "Google.Cloud.AutoML.V1"; +option go_package = "cloud.google.com/go/automl/apiv1/automlpb;automlpb"; +option java_multiple_files = true; +option java_outer_classname = "TextSentimentProto"; +option java_package = "com.google.cloud.automl.v1"; +option php_namespace = "Google\\Cloud\\AutoMl\\V1"; +option ruby_package = "Google::Cloud::AutoML::V1"; + +// Contains annotation details specific to text sentiment. +message TextSentimentAnnotation { + // Output only. The sentiment with the semantic, as given to the + // [AutoMl.ImportData][google.cloud.automl.v1.AutoMl.ImportData] when populating the dataset from which the model used + // for the prediction had been trained. + // The sentiment values are between 0 and + // Dataset.text_sentiment_dataset_metadata.sentiment_max (inclusive), + // with higher value meaning more positive sentiment. They are completely + // relative, i.e. 0 means least positive sentiment and sentiment_max means + // the most positive from the sentiments present in the train data. Therefore + // e.g. if train data had only negative sentiment, then sentiment_max, would + // be still negative (although least negative). + // The sentiment shouldn't be confused with "score" or "magnitude" + // from the previous Natural Language Sentiment Analysis API. + int32 sentiment = 1; +} + +// Model evaluation metrics for text sentiment problems. +message TextSentimentEvaluationMetrics { + // Output only. Precision. + float precision = 1; + + // Output only. Recall. + float recall = 2; + + // Output only. The harmonic mean of recall and precision. + float f1_score = 3; + + // Output only. Mean absolute error. Only set for the overall model + // evaluation, not for evaluation of a single annotation spec. + float mean_absolute_error = 4; + + // Output only. Mean squared error. Only set for the overall model + // evaluation, not for evaluation of a single annotation spec. + float mean_squared_error = 5; + + // Output only. Linear weighted kappa. Only set for the overall model + // evaluation, not for evaluation of a single annotation spec. + float linear_kappa = 6; + + // Output only. Quadratic weighted kappa. Only set for the overall model + // evaluation, not for evaluation of a single annotation spec. + float quadratic_kappa = 7; + + // Output only. Confusion matrix of the evaluation. + // Only set for the overall model evaluation, not for evaluation of a single + // annotation spec. + ClassificationEvaluationMetrics.ConfusionMatrix confusion_matrix = 8; +} diff --git a/packages/google-cloud-automl/protos/google/cloud/automl/v1/translation.proto b/packages/google-cloud-automl/protos/google/cloud/automl/v1/translation.proto new file mode 100644 index 00000000000..05b37d62707 --- /dev/null +++ b/packages/google-cloud-automl/protos/google/cloud/automl/v1/translation.proto @@ -0,0 +1,69 @@ +// 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 +// +// 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.automl.v1; + +import "google/api/field_behavior.proto"; +import "google/cloud/automl/v1/data_items.proto"; + +option csharp_namespace = "Google.Cloud.AutoML.V1"; +option go_package = "cloud.google.com/go/automl/apiv1/automlpb;automlpb"; +option java_multiple_files = true; +option java_outer_classname = "TranslationProto"; +option java_package = "com.google.cloud.automl.v1"; +option php_namespace = "Google\\Cloud\\AutoMl\\V1"; +option ruby_package = "Google::Cloud::AutoML::V1"; + +// Dataset metadata that is specific to translation. +message TranslationDatasetMetadata { + // Required. The BCP-47 language code of the source language. + string source_language_code = 1 [(google.api.field_behavior) = REQUIRED]; + + // Required. The BCP-47 language code of the target language. + string target_language_code = 2 [(google.api.field_behavior) = REQUIRED]; +} + +// Evaluation metrics for the dataset. +message TranslationEvaluationMetrics { + // Output only. BLEU score. + double bleu_score = 1; + + // Output only. BLEU score for base model. + double base_bleu_score = 2; +} + +// Model metadata that is specific to translation. +message TranslationModelMetadata { + // The resource name of the model to use as a baseline to train the custom + // model. If unset, we use the default base model provided by Google + // Translate. Format: + // `projects/{project_id}/locations/{location_id}/models/{model_id}` + string base_model = 1; + + // Output only. Inferred from the dataset. + // The source language (The BCP-47 language code) that is used for training. + string source_language_code = 2; + + // Output only. The target language (The BCP-47 language code) that is used + // for training. + string target_language_code = 3; +} + +// Annotation details specific to translation. +message TranslationAnnotation { + // Output only . The translated content. + TextSnippet translated_content = 1; +} diff --git a/packages/google-cloud-automl/protos/google/cloud/automl/v1beta1/annotation_payload.proto b/packages/google-cloud-automl/protos/google/cloud/automl/v1beta1/annotation_payload.proto new file mode 100644 index 00000000000..5794c2391de --- /dev/null +++ b/packages/google-cloud-automl/protos/google/cloud/automl/v1beta1/annotation_payload.proto @@ -0,0 +1,75 @@ +// Copyright 2020 Google LLC +// +// Licensed under the Apache License, Version 2.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.automl.v1beta1; + +import "google/cloud/automl/v1beta1/classification.proto"; +import "google/cloud/automl/v1beta1/detection.proto"; +import "google/cloud/automl/v1beta1/tables.proto"; +import "google/cloud/automl/v1beta1/text_extraction.proto"; +import "google/cloud/automl/v1beta1/text_sentiment.proto"; +import "google/cloud/automl/v1beta1/translation.proto"; + +option go_package = "cloud.google.com/go/automl/apiv1beta1/automlpb;automlpb"; +option java_multiple_files = true; +option java_package = "com.google.cloud.automl.v1beta1"; +option php_namespace = "Google\\Cloud\\AutoMl\\V1beta1"; +option ruby_package = "Google::Cloud::AutoML::V1beta1"; + +// Contains annotation information that is relevant to AutoML. +message AnnotationPayload { + // Output only . Additional information about the annotation + // specific to the AutoML domain. + oneof detail { + // Annotation details for translation. + TranslationAnnotation translation = 2; + + // Annotation details for content or image classification. + ClassificationAnnotation classification = 3; + + // Annotation details for image object detection. + ImageObjectDetectionAnnotation image_object_detection = 4; + + // Annotation details for video classification. + // Returned for Video Classification predictions. + VideoClassificationAnnotation video_classification = 9; + + // Annotation details for video object tracking. + VideoObjectTrackingAnnotation video_object_tracking = 8; + + // Annotation details for text extraction. + TextExtractionAnnotation text_extraction = 6; + + // Annotation details for text sentiment. + TextSentimentAnnotation text_sentiment = 7; + + // Annotation details for Tables. + TablesAnnotation tables = 10; + } + + // Output only . The resource ID of the annotation spec that + // this annotation pertains to. The annotation spec comes from either an + // ancestor dataset, or the dataset that was used to train the model in use. + string annotation_spec_id = 1; + + // Output only. The value of + // [display_name][google.cloud.automl.v1beta1.AnnotationSpec.display_name] + // when the model was trained. Because this field returns a value at model + // training time, for different models trained using the same dataset, the + // returned value could be different as model owner could update the + // `display_name` between any two model training. + string display_name = 5; +} diff --git a/packages/google-cloud-automl/protos/google/cloud/automl/v1beta1/annotation_spec.proto b/packages/google-cloud-automl/protos/google/cloud/automl/v1beta1/annotation_spec.proto new file mode 100644 index 00000000000..4072ddde458 --- /dev/null +++ b/packages/google-cloud-automl/protos/google/cloud/automl/v1beta1/annotation_spec.proto @@ -0,0 +1,47 @@ +// Copyright 2020 Google LLC +// +// Licensed under the Apache License, Version 2.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.automl.v1beta1; + +import "google/api/resource.proto"; + +option go_package = "cloud.google.com/go/automl/apiv1beta1/automlpb;automlpb"; +option java_multiple_files = true; +option java_package = "com.google.cloud.automl.v1beta1"; +option php_namespace = "Google\\Cloud\\AutoMl\\V1beta1"; +option ruby_package = "Google::Cloud::AutoML::V1beta1"; + +// A definition of an annotation spec. +message AnnotationSpec { + option (google.api.resource) = { + type: "automl.googleapis.com/AnnotationSpec" + pattern: "projects/{project}/locations/{location}/datasets/{dataset}/annotationSpecs/{annotation_spec}" + }; + + // Output only. Resource name of the annotation spec. + // Form: + // + // 'projects/{project_id}/locations/{location_id}/datasets/{dataset_id}/annotationSpecs/{annotation_spec_id}' + string name = 1; + + // Required. The name of the annotation spec to show in the interface. The name can be + // up to 32 characters long and must match the regexp `[a-zA-Z0-9_]+`. + string display_name = 2; + + // Output only. The number of examples in the parent dataset + // labeled by the annotation spec. + int32 example_count = 9; +} diff --git a/packages/google-cloud-automl/protos/google/cloud/automl/v1beta1/classification.proto b/packages/google-cloud-automl/protos/google/cloud/automl/v1beta1/classification.proto new file mode 100644 index 00000000000..7a1b83a286c --- /dev/null +++ b/packages/google-cloud-automl/protos/google/cloud/automl/v1beta1/classification.proto @@ -0,0 +1,215 @@ +// Copyright 2020 Google LLC +// +// Licensed under the Apache License, Version 2.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.automl.v1beta1; + +import "google/cloud/automl/v1beta1/temporal.proto"; + +option go_package = "cloud.google.com/go/automl/apiv1beta1/automlpb;automlpb"; +option java_outer_classname = "ClassificationProto"; +option java_package = "com.google.cloud.automl.v1beta1"; +option php_namespace = "Google\\Cloud\\AutoMl\\V1beta1"; +option ruby_package = "Google::Cloud::AutoML::V1beta1"; + +// Type of the classification problem. +enum ClassificationType { + // An un-set value of this enum. + CLASSIFICATION_TYPE_UNSPECIFIED = 0; + + // At most one label is allowed per example. + MULTICLASS = 1; + + // Multiple labels are allowed for one example. + MULTILABEL = 2; +} + +// Contains annotation details specific to classification. +message ClassificationAnnotation { + // Output only. A confidence estimate between 0.0 and 1.0. A higher value + // means greater confidence that the annotation is positive. If a user + // approves an annotation as negative or positive, the score value remains + // unchanged. If a user creates an annotation, the score is 0 for negative or + // 1 for positive. + float score = 1; +} + +// Contains annotation details specific to video classification. +message VideoClassificationAnnotation { + // Output only. Expresses the type of video classification. Possible values: + // + // * `segment` - Classification done on a specified by user + // time segment of a video. AnnotationSpec is answered to be present + // in that time segment, if it is present in any part of it. The video + // ML model evaluations are done only for this type of classification. + // + // * `shot`- Shot-level classification. + // AutoML Video Intelligence determines the boundaries + // for each camera shot in the entire segment of the video that user + // specified in the request configuration. AutoML Video Intelligence + // then returns labels and their confidence scores for each detected + // shot, along with the start and end time of the shot. + // WARNING: Model evaluation is not done for this classification type, + // the quality of it depends on training data, but there are no + // metrics provided to describe that quality. + // + // * `1s_interval` - AutoML Video Intelligence returns labels and their + // confidence scores for each second of the entire segment of the video + // that user specified in the request configuration. + // WARNING: Model evaluation is not done for this classification type, + // the quality of it depends on training data, but there are no + // metrics provided to describe that quality. + string type = 1; + + // Output only . The classification details of this annotation. + ClassificationAnnotation classification_annotation = 2; + + // Output only . The time segment of the video to which the + // annotation applies. + TimeSegment time_segment = 3; +} + +// Model evaluation metrics for classification problems. +// Note: For Video Classification this metrics only describe quality of the +// Video Classification predictions of "segment_classification" type. +message ClassificationEvaluationMetrics { + // Metrics for a single confidence threshold. + message ConfidenceMetricsEntry { + // Output only. Metrics are computed with an assumption that the model + // never returns predictions with score lower than this value. + float confidence_threshold = 1; + + // Output only. Metrics are computed with an assumption that the model + // always returns at most this many predictions (ordered by their score, + // descendingly), but they all still need to meet the confidence_threshold. + int32 position_threshold = 14; + + // Output only. Recall (True Positive Rate) for the given confidence + // threshold. + float recall = 2; + + // Output only. Precision for the given confidence threshold. + float precision = 3; + + // Output only. False Positive Rate for the given confidence threshold. + float false_positive_rate = 8; + + // Output only. The harmonic mean of recall and precision. + float f1_score = 4; + + // Output only. The Recall (True Positive Rate) when only considering the + // label that has the highest prediction score and not below the confidence + // threshold for each example. + float recall_at1 = 5; + + // Output only. The precision when only considering the label that has the + // highest prediction score and not below the confidence threshold for each + // example. + float precision_at1 = 6; + + // Output only. The False Positive Rate when only considering the label that + // has the highest prediction score and not below the confidence threshold + // for each example. + float false_positive_rate_at1 = 9; + + // Output only. The harmonic mean of [recall_at1][google.cloud.automl.v1beta1.ClassificationEvaluationMetrics.ConfidenceMetricsEntry.recall_at1] and [precision_at1][google.cloud.automl.v1beta1.ClassificationEvaluationMetrics.ConfidenceMetricsEntry.precision_at1]. + float f1_score_at1 = 7; + + // Output only. The number of model created labels that match a ground truth + // label. + int64 true_positive_count = 10; + + // Output only. The number of model created labels that do not match a + // ground truth label. + int64 false_positive_count = 11; + + // Output only. The number of ground truth labels that are not matched + // by a model created label. + int64 false_negative_count = 12; + + // Output only. The number of labels that were not created by the model, + // but if they would, they would not match a ground truth label. + int64 true_negative_count = 13; + } + + // Confusion matrix of the model running the classification. + message ConfusionMatrix { + // Output only. A row in the confusion matrix. + message Row { + // Output only. Value of the specific cell in the confusion matrix. + // The number of values each row has (i.e. the length of the row) is equal + // to the length of the `annotation_spec_id` field or, if that one is not + // populated, length of the [display_name][google.cloud.automl.v1beta1.ClassificationEvaluationMetrics.ConfusionMatrix.display_name] field. + repeated int32 example_count = 1; + } + + // Output only. IDs of the annotation specs used in the confusion matrix. + // For Tables CLASSIFICATION + // + // [prediction_type][google.cloud.automl.v1beta1.TablesModelMetadata.prediction_type] + // only list of [annotation_spec_display_name-s][] is populated. + repeated string annotation_spec_id = 1; + + // Output only. Display name of the annotation specs used in the confusion + // matrix, as they were at the moment of the evaluation. For Tables + // CLASSIFICATION + // + // [prediction_type-s][google.cloud.automl.v1beta1.TablesModelMetadata.prediction_type], + // distinct values of the target column at the moment of the model + // evaluation are populated here. + repeated string display_name = 3; + + // Output only. Rows in the confusion matrix. The number of rows is equal to + // the size of `annotation_spec_id`. + // `row[i].example_count[j]` is the number of examples that have ground + // truth of the `annotation_spec_id[i]` and are predicted as + // `annotation_spec_id[j]` by the model being evaluated. + repeated Row row = 2; + } + + // Output only. The Area Under Precision-Recall Curve metric. Micro-averaged + // for the overall evaluation. + float au_prc = 1; + + // Output only. The Area Under Precision-Recall Curve metric based on priors. + // Micro-averaged for the overall evaluation. + // Deprecated. + float base_au_prc = 2 [deprecated = true]; + + // Output only. The Area Under Receiver Operating Characteristic curve metric. + // Micro-averaged for the overall evaluation. + float au_roc = 6; + + // Output only. The Log Loss metric. + float log_loss = 7; + + // Output only. Metrics for each confidence_threshold in + // 0.00,0.05,0.10,...,0.95,0.96,0.97,0.98,0.99 and + // position_threshold = INT32_MAX_VALUE. + // ROC and precision-recall curves, and other aggregated metrics are derived + // from them. The confidence metrics entries may also be supplied for + // additional values of position_threshold, but from these no aggregated + // metrics are computed. + repeated ConfidenceMetricsEntry confidence_metrics_entry = 3; + + // Output only. Confusion matrix of the evaluation. + // Only set for MULTICLASS classification problems where number + // of labels is no more than 10. + // Only set for model level evaluation, not for evaluation per label. + ConfusionMatrix confusion_matrix = 4; + + // Output only. The annotation spec ids used for this evaluation. + repeated string annotation_spec_id = 5; +} diff --git a/packages/google-cloud-automl/protos/google/cloud/automl/v1beta1/column_spec.proto b/packages/google-cloud-automl/protos/google/cloud/automl/v1beta1/column_spec.proto new file mode 100644 index 00000000000..3d15fb51f84 --- /dev/null +++ b/packages/google-cloud-automl/protos/google/cloud/automl/v1beta1/column_spec.proto @@ -0,0 +1,77 @@ +// Copyright 2020 Google LLC +// +// Licensed under the Apache License, Version 2.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.automl.v1beta1; + +import "google/api/resource.proto"; +import "google/cloud/automl/v1beta1/data_stats.proto"; +import "google/cloud/automl/v1beta1/data_types.proto"; + +option go_package = "cloud.google.com/go/automl/apiv1beta1/automlpb;automlpb"; +option java_multiple_files = true; +option java_package = "com.google.cloud.automl.v1beta1"; +option php_namespace = "Google\\Cloud\\AutoMl\\V1beta1"; +option ruby_package = "Google::Cloud::AutoML::V1beta1"; + +// A representation of a column in a relational table. When listing them, column specs are returned in the same order in which they were +// given on import . +// Used by: +// * Tables +message ColumnSpec { + option (google.api.resource) = { + type: "automl.googleapis.com/ColumnSpec" + pattern: "projects/{project}/locations/{location}/datasets/{dataset}/tableSpecs/{table_spec}/columnSpecs/{column_spec}" + }; + + // Identifies the table's column, and its correlation with the column this + // ColumnSpec describes. + message CorrelatedColumn { + // The column_spec_id of the correlated column, which belongs to the same + // table as the in-context column. + string column_spec_id = 1; + + // Correlation between this and the in-context column. + CorrelationStats correlation_stats = 2; + } + + // Output only. The resource name of the column specs. + // Form: + // + // `projects/{project_id}/locations/{location_id}/datasets/{dataset_id}/tableSpecs/{table_spec_id}/columnSpecs/{column_spec_id}` + string name = 1; + + // The data type of elements stored in the column. + DataType data_type = 2; + + // Output only. The name of the column to show in the interface. The name can + // be up to 100 characters long and can consist only of ASCII Latin letters + // A-Z and a-z, ASCII digits 0-9, underscores(_), and forward slashes(/), and + // must start with a letter or a digit. + string display_name = 3; + + // Output only. Stats of the series of values in the column. + // This field may be stale, see the ancestor's + // Dataset.tables_dataset_metadata.stats_update_time field + // for the timestamp at which these stats were last updated. + DataStats data_stats = 4; + + // Deprecated. + repeated CorrelatedColumn top_correlated_columns = 5; + + // Used to perform consistent read-modify-write updates. If not set, a blind + // "overwrite" update happens. + string etag = 6; +} diff --git a/packages/google-cloud-automl/protos/google/cloud/automl/v1beta1/data_items.proto b/packages/google-cloud-automl/protos/google/cloud/automl/v1beta1/data_items.proto new file mode 100644 index 00000000000..2eb45f2d5ff --- /dev/null +++ b/packages/google-cloud-automl/protos/google/cloud/automl/v1beta1/data_items.proto @@ -0,0 +1,218 @@ +// Copyright 2020 Google LLC +// +// Licensed under the Apache License, Version 2.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.automl.v1beta1; + +import "google/cloud/automl/v1beta1/geometry.proto"; +import "google/cloud/automl/v1beta1/io.proto"; +import "google/cloud/automl/v1beta1/temporal.proto"; +import "google/cloud/automl/v1beta1/text_segment.proto"; +import "google/protobuf/struct.proto"; + +option go_package = "cloud.google.com/go/automl/apiv1beta1/automlpb;automlpb"; +option java_multiple_files = true; +option java_package = "com.google.cloud.automl.v1beta1"; +option php_namespace = "Google\\Cloud\\AutoMl\\V1beta1"; +option ruby_package = "Google::Cloud::AutoML::V1beta1"; + +// A representation of an image. +// Only images up to 30MB in size are supported. +message Image { + // Input only. The data representing the image. + // For Predict calls [image_bytes][google.cloud.automl.v1beta1.Image.image_bytes] must be set, as other options are not + // currently supported by prediction API. You can read the contents of an + // uploaded image by using the [content_uri][google.cloud.automl.v1beta1.Image.content_uri] field. + oneof data { + // Image content represented as a stream of bytes. + // Note: As with all `bytes` fields, protobuffers use a pure binary + // representation, whereas JSON representations use base64. + bytes image_bytes = 1; + + // An input config specifying the content of the image. + InputConfig input_config = 6; + } + + // Output only. HTTP URI to the thumbnail image. + string thumbnail_uri = 4; +} + +// A representation of a text snippet. +message TextSnippet { + // Required. The content of the text snippet as a string. Up to 250000 + // characters long. + string content = 1; + + // Optional. The format of [content][google.cloud.automl.v1beta1.TextSnippet.content]. Currently the only two allowed + // values are "text/html" and "text/plain". If left blank, the format is + // automatically determined from the type of the uploaded [content][google.cloud.automl.v1beta1.TextSnippet.content]. + string mime_type = 2; + + // Output only. HTTP URI where you can download the content. + string content_uri = 4; +} + +// Message that describes dimension of a document. +message DocumentDimensions { + // Unit of the document dimension. + enum DocumentDimensionUnit { + // Should not be used. + DOCUMENT_DIMENSION_UNIT_UNSPECIFIED = 0; + + // Document dimension is measured in inches. + INCH = 1; + + // Document dimension is measured in centimeters. + CENTIMETER = 2; + + // Document dimension is measured in points. 72 points = 1 inch. + POINT = 3; + } + + // Unit of the dimension. + DocumentDimensionUnit unit = 1; + + // Width value of the document, works together with the unit. + float width = 2; + + // Height value of the document, works together with the unit. + float height = 3; +} + +// A structured text document e.g. a PDF. +message Document { + // Describes the layout information of a [text_segment][google.cloud.automl.v1beta1.Document.Layout.text_segment] in the document. + message Layout { + // The type of TextSegment in the context of the original document. + enum TextSegmentType { + // Should not be used. + TEXT_SEGMENT_TYPE_UNSPECIFIED = 0; + + // The text segment is a token. e.g. word. + TOKEN = 1; + + // The text segment is a paragraph. + PARAGRAPH = 2; + + // The text segment is a form field. + FORM_FIELD = 3; + + // The text segment is the name part of a form field. It will be treated + // as child of another FORM_FIELD TextSegment if its span is subspan of + // another TextSegment with type FORM_FIELD. + FORM_FIELD_NAME = 4; + + // The text segment is the text content part of a form field. It will be + // treated as child of another FORM_FIELD TextSegment if its span is + // subspan of another TextSegment with type FORM_FIELD. + FORM_FIELD_CONTENTS = 5; + + // The text segment is a whole table, including headers, and all rows. + TABLE = 6; + + // The text segment is a table's headers. It will be treated as child of + // another TABLE TextSegment if its span is subspan of another TextSegment + // with type TABLE. + TABLE_HEADER = 7; + + // The text segment is a row in table. It will be treated as child of + // another TABLE TextSegment if its span is subspan of another TextSegment + // with type TABLE. + TABLE_ROW = 8; + + // The text segment is a cell in table. It will be treated as child of + // another TABLE_ROW TextSegment if its span is subspan of another + // TextSegment with type TABLE_ROW. + TABLE_CELL = 9; + } + + // Text Segment that represents a segment in + // [document_text][google.cloud.automl.v1beta1.Document.document_text]. + TextSegment text_segment = 1; + + // Page number of the [text_segment][google.cloud.automl.v1beta1.Document.Layout.text_segment] in the original document, starts + // from 1. + int32 page_number = 2; + + // The position of the [text_segment][google.cloud.automl.v1beta1.Document.Layout.text_segment] in the page. + // Contains exactly 4 + // + // [normalized_vertices][google.cloud.automl.v1beta1.BoundingPoly.normalized_vertices] + // and they are connected by edges in the order provided, which will + // represent a rectangle parallel to the frame. The + // [NormalizedVertex-s][google.cloud.automl.v1beta1.NormalizedVertex] are + // relative to the page. + // Coordinates are based on top-left as point (0,0). + BoundingPoly bounding_poly = 3; + + // The type of the [text_segment][google.cloud.automl.v1beta1.Document.Layout.text_segment] in document. + TextSegmentType text_segment_type = 4; + } + + // An input config specifying the content of the document. + DocumentInputConfig input_config = 1; + + // The plain text version of this document. + TextSnippet document_text = 2; + + // Describes the layout of the document. + // Sorted by [page_number][]. + repeated Layout layout = 3; + + // The dimensions of the page in the document. + DocumentDimensions document_dimensions = 4; + + // Number of pages in the document. + int32 page_count = 5; +} + +// A representation of a row in a relational table. +message Row { + // The resource IDs of the column specs describing the columns of the row. + // If set must contain, but possibly in a different order, all input + // feature + // + // [column_spec_ids][google.cloud.automl.v1beta1.TablesModelMetadata.input_feature_column_specs] + // of the Model this row is being passed to. + // Note: The below `values` field must match order of this field, if this + // field is set. + repeated string column_spec_ids = 2; + + // Required. The values of the row cells, given in the same order as the + // column_spec_ids, or, if not set, then in the same order as input + // feature + // + // [column_specs][google.cloud.automl.v1beta1.TablesModelMetadata.input_feature_column_specs] + // of the Model this row is being passed to. + repeated google.protobuf.Value values = 3; +} + +// Example data used for training or prediction. +message ExamplePayload { + // Required. Input only. The example data. + oneof payload { + // Example image. + Image image = 1; + + // Example text. + TextSnippet text_snippet = 2; + + // Example document. + Document document = 4; + + // Example relational table row. + Row row = 3; + } +} diff --git a/packages/google-cloud-automl/protos/google/cloud/automl/v1beta1/data_stats.proto b/packages/google-cloud-automl/protos/google/cloud/automl/v1beta1/data_stats.proto new file mode 100644 index 00000000000..8c2c2fe2a22 --- /dev/null +++ b/packages/google-cloud-automl/protos/google/cloud/automl/v1beta1/data_stats.proto @@ -0,0 +1,165 @@ +// Copyright 2020 Google LLC +// +// Licensed under the Apache License, Version 2.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.automl.v1beta1; + + +option go_package = "cloud.google.com/go/automl/apiv1beta1/automlpb;automlpb"; +option java_multiple_files = true; +option java_package = "com.google.cloud.automl.v1beta1"; +option php_namespace = "Google\\Cloud\\AutoMl\\V1beta1"; +option ruby_package = "Google::Cloud::AutoML::V1beta1"; + +// The data statistics of a series of values that share the same DataType. +message DataStats { + // The data statistics specific to a DataType. + oneof stats { + // The statistics for FLOAT64 DataType. + Float64Stats float64_stats = 3; + + // The statistics for STRING DataType. + StringStats string_stats = 4; + + // The statistics for TIMESTAMP DataType. + TimestampStats timestamp_stats = 5; + + // The statistics for ARRAY DataType. + ArrayStats array_stats = 6; + + // The statistics for STRUCT DataType. + StructStats struct_stats = 7; + + // The statistics for CATEGORY DataType. + CategoryStats category_stats = 8; + } + + // The number of distinct values. + int64 distinct_value_count = 1; + + // The number of values that are null. + int64 null_value_count = 2; + + // The number of values that are valid. + int64 valid_value_count = 9; +} + +// The data statistics of a series of FLOAT64 values. +message Float64Stats { + // A bucket of a histogram. + message HistogramBucket { + // The minimum value of the bucket, inclusive. + double min = 1; + + // The maximum value of the bucket, exclusive unless max = `"Infinity"`, in + // which case it's inclusive. + double max = 2; + + // The number of data values that are in the bucket, i.e. are between + // min and max values. + int64 count = 3; + } + + // The mean of the series. + double mean = 1; + + // The standard deviation of the series. + double standard_deviation = 2; + + // Ordered from 0 to k k-quantile values of the data series of n values. + // The value at index i is, approximately, the i*n/k-th smallest value in the + // series; for i = 0 and i = k these are, respectively, the min and max + // values. + repeated double quantiles = 3; + + // Histogram buckets of the data series. Sorted by the min value of the + // bucket, ascendingly, and the number of the buckets is dynamically + // generated. The buckets are non-overlapping and completely cover whole + // FLOAT64 range with min of first bucket being `"-Infinity"`, and max of + // the last one being `"Infinity"`. + repeated HistogramBucket histogram_buckets = 4; +} + +// The data statistics of a series of STRING values. +message StringStats { + // The statistics of a unigram. + message UnigramStats { + // The unigram. + string value = 1; + + // The number of occurrences of this unigram in the series. + int64 count = 2; + } + + // The statistics of the top 20 unigrams, ordered by + // [count][google.cloud.automl.v1beta1.StringStats.UnigramStats.count]. + repeated UnigramStats top_unigram_stats = 1; +} + +// The data statistics of a series of TIMESTAMP values. +message TimestampStats { + // Stats split by a defined in context granularity. + message GranularStats { + // A map from granularity key to example count for that key. + // E.g. for hour_of_day `13` means 1pm, or for month_of_year `5` means May). + map buckets = 1; + } + + // The string key is the pre-defined granularity. Currently supported: + // hour_of_day, day_of_week, month_of_year. + // Granularities finer that the granularity of timestamp data are not + // populated (e.g. if timestamps are at day granularity, then hour_of_day + // is not populated). + map granular_stats = 1; +} + +// The data statistics of a series of ARRAY values. +message ArrayStats { + // Stats of all the values of all arrays, as if they were a single long + // series of data. The type depends on the element type of the array. + DataStats member_stats = 2; +} + +// The data statistics of a series of STRUCT values. +message StructStats { + // Map from a field name of the struct to data stats aggregated over series + // of all data in that field across all the structs. + map field_stats = 1; +} + +// The data statistics of a series of CATEGORY values. +message CategoryStats { + // The statistics of a single CATEGORY value. + message SingleCategoryStats { + // The CATEGORY value. + string value = 1; + + // The number of occurrences of this value in the series. + int64 count = 2; + } + + // The statistics of the top 20 CATEGORY values, ordered by + // + // [count][google.cloud.automl.v1beta1.CategoryStats.SingleCategoryStats.count]. + repeated SingleCategoryStats top_category_stats = 1; +} + +// A correlation statistics between two series of DataType values. The series +// may have differing DataType-s, but within a single series the DataType must +// be the same. +message CorrelationStats { + // The correlation value using the Cramer's V measure. + double cramers_v = 1; +} diff --git a/packages/google-cloud-automl/protos/google/cloud/automl/v1beta1/data_types.proto b/packages/google-cloud-automl/protos/google/cloud/automl/v1beta1/data_types.proto new file mode 100644 index 00000000000..72ac65dd340 --- /dev/null +++ b/packages/google-cloud-automl/protos/google/cloud/automl/v1beta1/data_types.proto @@ -0,0 +1,104 @@ +// Copyright 2020 Google LLC +// +// Licensed under the Apache License, Version 2.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.automl.v1beta1; + + +option go_package = "cloud.google.com/go/automl/apiv1beta1/automlpb;automlpb"; +option java_multiple_files = true; +option java_package = "com.google.cloud.automl.v1beta1"; +option php_namespace = "Google\\Cloud\\AutoMl\\V1beta1"; +option ruby_package = "Google::Cloud::AutoML::V1beta1"; + +// `TypeCode` is used as a part of +// [DataType][google.cloud.automl.v1beta1.DataType]. +enum TypeCode { + // Not specified. Should not be used. + TYPE_CODE_UNSPECIFIED = 0; + + // Encoded as `number`, or the strings `"NaN"`, `"Infinity"`, or + // `"-Infinity"`. + FLOAT64 = 3; + + // Must be between 0AD and 9999AD. Encoded as `string` according to + // [time_format][google.cloud.automl.v1beta1.DataType.time_format], or, if + // that format is not set, then in RFC 3339 `date-time` format, where + // `time-offset` = `"Z"` (e.g. 1985-04-12T23:20:50.52Z). + TIMESTAMP = 4; + + // Encoded as `string`. + STRING = 6; + + // Encoded as `list`, where the list elements are represented according to + // + // [list_element_type][google.cloud.automl.v1beta1.DataType.list_element_type]. + ARRAY = 8; + + // Encoded as `struct`, where field values are represented according to + // [struct_type][google.cloud.automl.v1beta1.DataType.struct_type]. + STRUCT = 9; + + // Values of this type are not further understood by AutoML, + // e.g. AutoML is unable to tell the order of values (as it could with + // FLOAT64), or is unable to say if one value contains another (as it + // could with STRING). + // Encoded as `string` (bytes should be base64-encoded, as described in RFC + // 4648, section 4). + CATEGORY = 10; +} + +// Indicated the type of data that can be stored in a structured data entity +// (e.g. a table). +message DataType { + // Details of DataType-s that need additional specification. + oneof details { + // If [type_code][google.cloud.automl.v1beta1.DataType.type_code] == [ARRAY][google.cloud.automl.v1beta1.TypeCode.ARRAY], + // then `list_element_type` is the type of the elements. + DataType list_element_type = 2; + + // If [type_code][google.cloud.automl.v1beta1.DataType.type_code] == [STRUCT][google.cloud.automl.v1beta1.TypeCode.STRUCT], then `struct_type` + // provides type information for the struct's fields. + StructType struct_type = 3; + + // If [type_code][google.cloud.automl.v1beta1.DataType.type_code] == [TIMESTAMP][google.cloud.automl.v1beta1.TypeCode.TIMESTAMP] + // then `time_format` provides the format in which that time field is + // expressed. The time_format must either be one of: + // * `UNIX_SECONDS` + // * `UNIX_MILLISECONDS` + // * `UNIX_MICROSECONDS` + // * `UNIX_NANOSECONDS` + // (for respectively number of seconds, milliseconds, microseconds and + // nanoseconds since start of the Unix epoch); + // or be written in `strftime` syntax. If time_format is not set, then the + // default format as described on the type_code is used. + string time_format = 5; + } + + // Required. The [TypeCode][google.cloud.automl.v1beta1.TypeCode] for this type. + TypeCode type_code = 1; + + // If true, this DataType can also be `NULL`. In .CSV files `NULL` value is + // expressed as an empty string. + bool nullable = 4; +} + +// `StructType` defines the DataType-s of a [STRUCT][google.cloud.automl.v1beta1.TypeCode.STRUCT] type. +message StructType { + // Unordered map of struct field names to their data types. + // Fields cannot be added or removed via Update. Their names and + // data types are still mutable. + map fields = 1; +} diff --git a/packages/google-cloud-automl/protos/google/cloud/automl/v1beta1/dataset.proto b/packages/google-cloud-automl/protos/google/cloud/automl/v1beta1/dataset.proto new file mode 100644 index 00000000000..22d7f9a6adc --- /dev/null +++ b/packages/google-cloud-automl/protos/google/cloud/automl/v1beta1/dataset.proto @@ -0,0 +1,95 @@ +// Copyright 2020 Google LLC +// +// Licensed under the Apache License, Version 2.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.automl.v1beta1; + +import "google/api/resource.proto"; +import "google/cloud/automl/v1beta1/image.proto"; +import "google/cloud/automl/v1beta1/tables.proto"; +import "google/cloud/automl/v1beta1/text.proto"; +import "google/cloud/automl/v1beta1/translation.proto"; +import "google/cloud/automl/v1beta1/video.proto"; +import "google/protobuf/timestamp.proto"; + +option go_package = "cloud.google.com/go/automl/apiv1beta1/automlpb;automlpb"; +option java_multiple_files = true; +option java_package = "com.google.cloud.automl.v1beta1"; +option php_namespace = "Google\\Cloud\\AutoMl\\V1beta1"; +option ruby_package = "Google::Cloud::AutoML::V1beta1"; + +// A workspace for solving a single, particular machine learning (ML) problem. +// A workspace contains examples that may be annotated. +message Dataset { + option (google.api.resource) = { + type: "automl.googleapis.com/Dataset" + pattern: "projects/{project}/locations/{location}/datasets/{dataset}" + }; + + // Required. + // The dataset metadata that is specific to the problem type. + oneof dataset_metadata { + // Metadata for a dataset used for translation. + TranslationDatasetMetadata translation_dataset_metadata = 23; + + // Metadata for a dataset used for image classification. + ImageClassificationDatasetMetadata image_classification_dataset_metadata = 24; + + // Metadata for a dataset used for text classification. + TextClassificationDatasetMetadata text_classification_dataset_metadata = 25; + + // Metadata for a dataset used for image object detection. + ImageObjectDetectionDatasetMetadata image_object_detection_dataset_metadata = 26; + + // Metadata for a dataset used for video classification. + VideoClassificationDatasetMetadata video_classification_dataset_metadata = 31; + + // Metadata for a dataset used for video object tracking. + VideoObjectTrackingDatasetMetadata video_object_tracking_dataset_metadata = 29; + + // Metadata for a dataset used for text extraction. + TextExtractionDatasetMetadata text_extraction_dataset_metadata = 28; + + // Metadata for a dataset used for text sentiment. + TextSentimentDatasetMetadata text_sentiment_dataset_metadata = 30; + + // Metadata for a dataset used for Tables. + TablesDatasetMetadata tables_dataset_metadata = 33; + } + + // Output only. The resource name of the dataset. + // Form: `projects/{project_id}/locations/{location_id}/datasets/{dataset_id}` + string name = 1; + + // Required. The name of the dataset to show in the interface. The name can be + // up to 32 characters long and can consist only of ASCII Latin letters A-Z + // and a-z, underscores + // (_), and ASCII digits 0-9. + string display_name = 2; + + // User-provided description of the dataset. The description can be up to + // 25000 characters long. + string description = 3; + + // Output only. The number of examples in the dataset. + int32 example_count = 21; + + // Output only. Timestamp when this dataset was created. + google.protobuf.Timestamp create_time = 14; + + // Used to perform consistent read-modify-write updates. If not set, a blind + // "overwrite" update happens. + string etag = 17; +} diff --git a/packages/google-cloud-automl/protos/google/cloud/automl/v1beta1/detection.proto b/packages/google-cloud-automl/protos/google/cloud/automl/v1beta1/detection.proto new file mode 100644 index 00000000000..38240dd6e92 --- /dev/null +++ b/packages/google-cloud-automl/protos/google/cloud/automl/v1beta1/detection.proto @@ -0,0 +1,134 @@ +// Copyright 2020 Google LLC +// +// Licensed under the Apache License, Version 2.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.automl.v1beta1; + +import "google/cloud/automl/v1beta1/geometry.proto"; +import "google/protobuf/duration.proto"; + +option go_package = "cloud.google.com/go/automl/apiv1beta1/automlpb;automlpb"; +option java_multiple_files = true; +option java_package = "com.google.cloud.automl.v1beta1"; +option php_namespace = "Google\\Cloud\\AutoMl\\V1beta1"; +option ruby_package = "Google::Cloud::AutoML::V1beta1"; + +// Annotation details for image object detection. +message ImageObjectDetectionAnnotation { + // Output only. The rectangle representing the object location. + BoundingPoly bounding_box = 1; + + // Output only. The confidence that this annotation is positive for the parent example, + // value in [0, 1], higher means higher positivity confidence. + float score = 2; +} + +// Annotation details for video object tracking. +message VideoObjectTrackingAnnotation { + // Optional. The instance of the object, expressed as a positive integer. Used to tell + // apart objects of the same type (i.e. AnnotationSpec) when multiple are + // present on a single example. + // NOTE: Instance ID prediction quality is not a part of model evaluation and + // is done as best effort. Especially in cases when an entity goes + // off-screen for a longer time (minutes), when it comes back it may be given + // a new instance ID. + string instance_id = 1; + + // Required. A time (frame) of a video to which this annotation pertains. + // Represented as the duration since the video's start. + google.protobuf.Duration time_offset = 2; + + // Required. The rectangle representing the object location on the frame (i.e. + // at the time_offset of the video). + BoundingPoly bounding_box = 3; + + // Output only. The confidence that this annotation is positive for the video at + // the time_offset, value in [0, 1], higher means higher positivity + // confidence. For annotations created by the user the score is 1. When + // user approves an annotation, the original float score is kept (and not + // changed to 1). + float score = 4; +} + +// Bounding box matching model metrics for a single intersection-over-union +// threshold and multiple label match confidence thresholds. +message BoundingBoxMetricsEntry { + // Metrics for a single confidence threshold. + message ConfidenceMetricsEntry { + // Output only. The confidence threshold value used to compute the metrics. + float confidence_threshold = 1; + + // Output only. Recall under the given confidence threshold. + float recall = 2; + + // Output only. Precision under the given confidence threshold. + float precision = 3; + + // Output only. The harmonic mean of recall and precision. + float f1_score = 4; + } + + // Output only. The intersection-over-union threshold value used to compute + // this metrics entry. + float iou_threshold = 1; + + // Output only. The mean average precision, most often close to au_prc. + float mean_average_precision = 2; + + // Output only. Metrics for each label-match confidence_threshold from + // 0.05,0.10,...,0.95,0.96,0.97,0.98,0.99. Precision-recall curve is + // derived from them. + repeated ConfidenceMetricsEntry confidence_metrics_entries = 3; +} + +// Model evaluation metrics for image object detection problems. +// Evaluates prediction quality of labeled bounding boxes. +message ImageObjectDetectionEvaluationMetrics { + // Output only. The total number of bounding boxes (i.e. summed over all + // images) the ground truth used to create this evaluation had. + int32 evaluated_bounding_box_count = 1; + + // Output only. The bounding boxes match metrics for each + // Intersection-over-union threshold 0.05,0.10,...,0.95,0.96,0.97,0.98,0.99 + // and each label confidence threshold 0.05,0.10,...,0.95,0.96,0.97,0.98,0.99 + // pair. + repeated BoundingBoxMetricsEntry bounding_box_metrics_entries = 2; + + // Output only. The single metric for bounding boxes evaluation: + // the mean_average_precision averaged over all bounding_box_metrics_entries. + float bounding_box_mean_average_precision = 3; +} + +// Model evaluation metrics for video object tracking problems. +// Evaluates prediction quality of both labeled bounding boxes and labeled +// tracks (i.e. series of bounding boxes sharing same label and instance ID). +message VideoObjectTrackingEvaluationMetrics { + // Output only. The number of video frames used to create this evaluation. + int32 evaluated_frame_count = 1; + + // Output only. The total number of bounding boxes (i.e. summed over all + // frames) the ground truth used to create this evaluation had. + int32 evaluated_bounding_box_count = 2; + + // Output only. The bounding boxes match metrics for each + // Intersection-over-union threshold 0.05,0.10,...,0.95,0.96,0.97,0.98,0.99 + // and each label confidence threshold 0.05,0.10,...,0.95,0.96,0.97,0.98,0.99 + // pair. + repeated BoundingBoxMetricsEntry bounding_box_metrics_entries = 4; + + // Output only. The single metric for bounding boxes evaluation: + // the mean_average_precision averaged over all bounding_box_metrics_entries. + float bounding_box_mean_average_precision = 6; +} diff --git a/packages/google-cloud-automl/protos/google/cloud/automl/v1beta1/geometry.proto b/packages/google-cloud-automl/protos/google/cloud/automl/v1beta1/geometry.proto new file mode 100644 index 00000000000..067ac00aaad --- /dev/null +++ b/packages/google-cloud-automl/protos/google/cloud/automl/v1beta1/geometry.proto @@ -0,0 +1,45 @@ +// Copyright 2020 Google LLC +// +// Licensed under the Apache License, Version 2.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.automl.v1beta1; + + +option go_package = "cloud.google.com/go/automl/apiv1beta1/automlpb;automlpb"; +option java_multiple_files = true; +option java_package = "com.google.cloud.automl.v1beta1"; +option php_namespace = "Google\\Cloud\\AutoMl\\V1beta1"; +option ruby_package = "Google::Cloud::AutoML::V1beta1"; + +// A vertex represents a 2D point in the image. +// The normalized vertex coordinates are between 0 to 1 fractions relative to +// the original plane (image, video). E.g. if the plane (e.g. whole image) would +// have size 10 x 20 then a point with normalized coordinates (0.1, 0.3) would +// be at the position (1, 6) on that plane. +message NormalizedVertex { + // Required. Horizontal coordinate. + float x = 1; + + // Required. Vertical coordinate. + float y = 2; +} + +// A bounding polygon of a detected object on a plane. +// On output both vertices and normalized_vertices are provided. +// The polygon is formed by connecting vertices in the order they are listed. +message BoundingPoly { + // Output only . The bounding polygon normalized vertices. + repeated NormalizedVertex normalized_vertices = 2; +} diff --git a/packages/google-cloud-automl/protos/google/cloud/automl/v1beta1/image.proto b/packages/google-cloud-automl/protos/google/cloud/automl/v1beta1/image.proto new file mode 100644 index 00000000000..56401228e85 --- /dev/null +++ b/packages/google-cloud-automl/protos/google/cloud/automl/v1beta1/image.proto @@ -0,0 +1,190 @@ +// Copyright 2020 Google LLC +// +// Licensed under the Apache License, Version 2.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.automl.v1beta1; + +import "google/cloud/automl/v1beta1/annotation_spec.proto"; +import "google/cloud/automl/v1beta1/classification.proto"; + +option go_package = "cloud.google.com/go/automl/apiv1beta1/automlpb;automlpb"; +option java_multiple_files = true; +option java_outer_classname = "ImageProto"; +option java_package = "com.google.cloud.automl.v1beta1"; +option php_namespace = "Google\\Cloud\\AutoMl\\V1beta1"; +option ruby_package = "Google::Cloud::AutoML::V1beta1"; + +// Dataset metadata that is specific to image classification. +message ImageClassificationDatasetMetadata { + // Required. Type of the classification problem. + ClassificationType classification_type = 1; +} + +// Dataset metadata specific to image object detection. +message ImageObjectDetectionDatasetMetadata { + +} + +// Model metadata for image classification. +message ImageClassificationModelMetadata { + // Optional. The ID of the `base` model. If it is specified, the new model + // will be created based on the `base` model. Otherwise, the new model will be + // created from scratch. The `base` model must be in the same + // `project` and `location` as the new model to create, and have the same + // `model_type`. + string base_model_id = 1; + + // Required. The train budget of creating this model, expressed in hours. The + // actual `train_cost` will be equal or less than this value. + int64 train_budget = 2; + + // Output only. The actual train cost of creating this model, expressed in + // hours. If this model is created from a `base` model, the train cost used + // to create the `base` model are not included. + int64 train_cost = 3; + + // Output only. The reason that this create model operation stopped, + // e.g. `BUDGET_REACHED`, `MODEL_CONVERGED`. + string stop_reason = 5; + + // Optional. Type of the model. The available values are: + // * `cloud` - Model to be used via prediction calls to AutoML API. + // This is the default value. + // * `mobile-low-latency-1` - A model that, in addition to providing + // prediction via AutoML API, can also be exported (see + // [AutoMl.ExportModel][google.cloud.automl.v1beta1.AutoMl.ExportModel]) and used on a mobile or edge device + // with TensorFlow afterwards. Expected to have low latency, but + // may have lower prediction quality than other models. + // * `mobile-versatile-1` - A model that, in addition to providing + // prediction via AutoML API, can also be exported (see + // [AutoMl.ExportModel][google.cloud.automl.v1beta1.AutoMl.ExportModel]) and used on a mobile or edge device + // with TensorFlow afterwards. + // * `mobile-high-accuracy-1` - A model that, in addition to providing + // prediction via AutoML API, can also be exported (see + // [AutoMl.ExportModel][google.cloud.automl.v1beta1.AutoMl.ExportModel]) and used on a mobile or edge device + // with TensorFlow afterwards. Expected to have a higher + // latency, but should also have a higher prediction quality + // than other models. + // * `mobile-core-ml-low-latency-1` - A model that, in addition to providing + // prediction via AutoML API, can also be exported (see + // [AutoMl.ExportModel][google.cloud.automl.v1beta1.AutoMl.ExportModel]) and used on a mobile device with Core + // ML afterwards. Expected to have low latency, but may have + // lower prediction quality than other models. + // * `mobile-core-ml-versatile-1` - A model that, in addition to providing + // prediction via AutoML API, can also be exported (see + // [AutoMl.ExportModel][google.cloud.automl.v1beta1.AutoMl.ExportModel]) and used on a mobile device with Core + // ML afterwards. + // * `mobile-core-ml-high-accuracy-1` - A model that, in addition to + // providing prediction via AutoML API, can also be exported + // (see [AutoMl.ExportModel][google.cloud.automl.v1beta1.AutoMl.ExportModel]) and used on a mobile device with + // Core ML afterwards. Expected to have a higher latency, but + // should also have a higher prediction quality than other + // models. + string model_type = 7; + + // Output only. An approximate number of online prediction QPS that can + // be supported by this model per each node on which it is deployed. + double node_qps = 13; + + // Output only. The number of nodes this model is deployed on. A node is an + // abstraction of a machine resource, which can handle online prediction QPS + // as given in the node_qps field. + int64 node_count = 14; +} + +// Model metadata specific to image object detection. +message ImageObjectDetectionModelMetadata { + // Optional. Type of the model. The available values are: + // * `cloud-high-accuracy-1` - (default) A model to be used via prediction + // calls to AutoML API. Expected to have a higher latency, but + // should also have a higher prediction quality than other + // models. + // * `cloud-low-latency-1` - A model to be used via prediction + // calls to AutoML API. Expected to have low latency, but may + // have lower prediction quality than other models. + // * `mobile-low-latency-1` - A model that, in addition to providing + // prediction via AutoML API, can also be exported (see + // [AutoMl.ExportModel][google.cloud.automl.v1beta1.AutoMl.ExportModel]) and used on a mobile or edge device + // with TensorFlow afterwards. Expected to have low latency, but + // may have lower prediction quality than other models. + // * `mobile-versatile-1` - A model that, in addition to providing + // prediction via AutoML API, can also be exported (see + // [AutoMl.ExportModel][google.cloud.automl.v1beta1.AutoMl.ExportModel]) and used on a mobile or edge device + // with TensorFlow afterwards. + // * `mobile-high-accuracy-1` - A model that, in addition to providing + // prediction via AutoML API, can also be exported (see + // [AutoMl.ExportModel][google.cloud.automl.v1beta1.AutoMl.ExportModel]) and used on a mobile or edge device + // with TensorFlow afterwards. Expected to have a higher + // latency, but should also have a higher prediction quality + // than other models. + string model_type = 1; + + // Output only. The number of nodes this model is deployed on. A node is an + // abstraction of a machine resource, which can handle online prediction QPS + // as given in the qps_per_node field. + int64 node_count = 3; + + // Output only. An approximate number of online prediction QPS that can + // be supported by this model per each node on which it is deployed. + double node_qps = 4; + + // Output only. The reason that this create model operation stopped, + // e.g. `BUDGET_REACHED`, `MODEL_CONVERGED`. + string stop_reason = 5; + + // The train budget of creating this model, expressed in milli node + // hours i.e. 1,000 value in this field means 1 node hour. The actual + // `train_cost` will be equal or less than this value. If further model + // training ceases to provide any improvements, it will stop without using + // full budget and the stop_reason will be `MODEL_CONVERGED`. + // Note, node_hour = actual_hour * number_of_nodes_invovled. + // For model type `cloud-high-accuracy-1`(default) and `cloud-low-latency-1`, + // the train budget must be between 20,000 and 900,000 milli node hours, + // inclusive. The default value is 216, 000 which represents one day in + // wall time. + // For model type `mobile-low-latency-1`, `mobile-versatile-1`, + // `mobile-high-accuracy-1`, `mobile-core-ml-low-latency-1`, + // `mobile-core-ml-versatile-1`, `mobile-core-ml-high-accuracy-1`, the train + // budget must be between 1,000 and 100,000 milli node hours, inclusive. + // The default value is 24, 000 which represents one day in wall time. + int64 train_budget_milli_node_hours = 6; + + // Output only. The actual train cost of creating this model, expressed in + // milli node hours, i.e. 1,000 value in this field means 1 node hour. + // Guaranteed to not exceed the train budget. + int64 train_cost_milli_node_hours = 7; +} + +// Model deployment metadata specific to Image Classification. +message ImageClassificationModelDeploymentMetadata { + // Input only. The number of nodes to deploy the model on. A node is an + // abstraction of a machine resource, which can handle online prediction QPS + // as given in the model's + // + // [node_qps][google.cloud.automl.v1beta1.ImageClassificationModelMetadata.node_qps]. + // Must be between 1 and 100, inclusive on both ends. + int64 node_count = 1; +} + +// Model deployment metadata specific to Image Object Detection. +message ImageObjectDetectionModelDeploymentMetadata { + // Input only. The number of nodes to deploy the model on. A node is an + // abstraction of a machine resource, which can handle online prediction QPS + // as given in the model's + // + // [qps_per_node][google.cloud.automl.v1beta1.ImageObjectDetectionModelMetadata.qps_per_node]. + // Must be between 1 and 100, inclusive on both ends. + int64 node_count = 1; +} diff --git a/packages/google-cloud-automl/protos/google/cloud/automl/v1beta1/io.proto b/packages/google-cloud-automl/protos/google/cloud/automl/v1beta1/io.proto new file mode 100644 index 00000000000..04808d74acb --- /dev/null +++ b/packages/google-cloud-automl/protos/google/cloud/automl/v1beta1/io.proto @@ -0,0 +1,1157 @@ +// Copyright 2020 Google LLC +// +// Licensed under the Apache License, Version 2.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.automl.v1beta1; + + +option go_package = "cloud.google.com/go/automl/apiv1beta1/automlpb;automlpb"; +option java_multiple_files = true; +option java_package = "com.google.cloud.automl.v1beta1"; +option php_namespace = "Google\\Cloud\\AutoMl\\V1beta1"; +option ruby_package = "Google::Cloud::AutoML::V1beta1"; + +// Input configuration for ImportData Action. +// +// The format of input depends on dataset_metadata the Dataset into which +// the import is happening has. As input source the +// [gcs_source][google.cloud.automl.v1beta1.InputConfig.gcs_source] +// is expected, unless specified otherwise. Additionally any input .CSV file +// by itself must be 100MB or smaller, unless specified otherwise. +// If an "example" file (that is, image, video etc.) with identical content +// (even if it had different GCS_FILE_PATH) is mentioned multiple times, then +// its label, bounding boxes etc. are appended. The same file should be always +// provided with the same ML_USE and GCS_FILE_PATH, if it is not, then +// these values are nondeterministically selected from the given ones. +// +// The formats are represented in EBNF with commas being literal and with +// non-terminal symbols defined near the end of this comment. The formats are: +// +// * For Image Classification: +// CSV file(s) with each line in format: +// ML_USE,GCS_FILE_PATH,LABEL,LABEL,... +// GCS_FILE_PATH leads to image of up to 30MB in size. Supported +// extensions: .JPEG, .GIF, .PNG, .WEBP, .BMP, .TIFF, .ICO +// For MULTICLASS classification type, at most one LABEL is allowed +// per image. If an image has not yet been labeled, then it should be +// mentioned just once with no LABEL. +// Some sample rows: +// TRAIN,gs://folder/image1.jpg,daisy +// TEST,gs://folder/image2.jpg,dandelion,tulip,rose +// UNASSIGNED,gs://folder/image3.jpg,daisy +// UNASSIGNED,gs://folder/image4.jpg +// +// * For Image Object Detection: +// CSV file(s) with each line in format: +// ML_USE,GCS_FILE_PATH,(LABEL,BOUNDING_BOX | ,,,,,,,) +// GCS_FILE_PATH leads to image of up to 30MB in size. Supported +// extensions: .JPEG, .GIF, .PNG. +// Each image is assumed to be exhaustively labeled. The minimum +// allowed BOUNDING_BOX edge length is 0.01, and no more than 500 +// BOUNDING_BOX-es per image are allowed (one BOUNDING_BOX is defined +// per line). If an image has not yet been labeled, then it should be +// mentioned just once with no LABEL and the ",,,,,,," in place of the +// BOUNDING_BOX. For images which are known to not contain any +// bounding boxes, they should be labelled explictly as +// "NEGATIVE_IMAGE", followed by ",,,,,,," in place of the +// BOUNDING_BOX. +// Sample rows: +// TRAIN,gs://folder/image1.png,car,0.1,0.1,,,0.3,0.3,, +// TRAIN,gs://folder/image1.png,bike,.7,.6,,,.8,.9,, +// UNASSIGNED,gs://folder/im2.png,car,0.1,0.1,0.2,0.1,0.2,0.3,0.1,0.3 +// TEST,gs://folder/im3.png,,,,,,,,, +// TRAIN,gs://folder/im4.png,NEGATIVE_IMAGE,,,,,,,,, +// +// * For Video Classification: +// CSV file(s) with each line in format: +// ML_USE,GCS_FILE_PATH +// where ML_USE VALIDATE value should not be used. The GCS_FILE_PATH +// should lead to another .csv file which describes examples that have +// given ML_USE, using the following row format: +// GCS_FILE_PATH,(LABEL,TIME_SEGMENT_START,TIME_SEGMENT_END | ,,) +// Here GCS_FILE_PATH leads to a video of up to 50GB in size and up +// to 3h duration. Supported extensions: .MOV, .MPEG4, .MP4, .AVI. +// TIME_SEGMENT_START and TIME_SEGMENT_END must be within the +// length of the video, and end has to be after the start. Any segment +// of a video which has one or more labels on it, is considered a +// hard negative for all other labels. Any segment with no labels on +// it is considered to be unknown. If a whole video is unknown, then +// it shuold be mentioned just once with ",," in place of LABEL, +// TIME_SEGMENT_START,TIME_SEGMENT_END. +// Sample top level CSV file: +// TRAIN,gs://folder/train_videos.csv +// TEST,gs://folder/test_videos.csv +// UNASSIGNED,gs://folder/other_videos.csv +// Sample rows of a CSV file for a particular ML_USE: +// gs://folder/video1.avi,car,120,180.000021 +// gs://folder/video1.avi,bike,150,180.000021 +// gs://folder/vid2.avi,car,0,60.5 +// gs://folder/vid3.avi,,, +// +// * For Video Object Tracking: +// CSV file(s) with each line in format: +// ML_USE,GCS_FILE_PATH +// where ML_USE VALIDATE value should not be used. The GCS_FILE_PATH +// should lead to another .csv file which describes examples that have +// given ML_USE, using one of the following row format: +// GCS_FILE_PATH,LABEL,[INSTANCE_ID],TIMESTAMP,BOUNDING_BOX +// or +// GCS_FILE_PATH,,,,,,,,,, +// Here GCS_FILE_PATH leads to a video of up to 50GB in size and up +// to 3h duration. Supported extensions: .MOV, .MPEG4, .MP4, .AVI. +// Providing INSTANCE_IDs can help to obtain a better model. When +// a specific labeled entity leaves the video frame, and shows up +// afterwards it is not required, albeit preferable, that the same +// INSTANCE_ID is given to it. +// TIMESTAMP must be within the length of the video, the +// BOUNDING_BOX is assumed to be drawn on the closest video's frame +// to the TIMESTAMP. Any mentioned by the TIMESTAMP frame is expected +// to be exhaustively labeled and no more than 500 BOUNDING_BOX-es per +// frame are allowed. If a whole video is unknown, then it should be +// mentioned just once with ",,,,,,,,,," in place of LABEL, +// [INSTANCE_ID],TIMESTAMP,BOUNDING_BOX. +// Sample top level CSV file: +// TRAIN,gs://folder/train_videos.csv +// TEST,gs://folder/test_videos.csv +// UNASSIGNED,gs://folder/other_videos.csv +// Seven sample rows of a CSV file for a particular ML_USE: +// gs://folder/video1.avi,car,1,12.10,0.8,0.8,0.9,0.8,0.9,0.9,0.8,0.9 +// gs://folder/video1.avi,car,1,12.90,0.4,0.8,0.5,0.8,0.5,0.9,0.4,0.9 +// gs://folder/video1.avi,car,2,12.10,.4,.2,.5,.2,.5,.3,.4,.3 +// gs://folder/video1.avi,car,2,12.90,.8,.2,,,.9,.3,, +// gs://folder/video1.avi,bike,,12.50,.45,.45,,,.55,.55,, +// gs://folder/video2.avi,car,1,0,.1,.9,,,.9,.1,, +// gs://folder/video2.avi,,,,,,,,,,, +// * For Text Extraction: +// CSV file(s) with each line in format: +// ML_USE,GCS_FILE_PATH +// GCS_FILE_PATH leads to a .JSONL (that is, JSON Lines) file which +// either imports text in-line or as documents. Any given +// .JSONL file must be 100MB or smaller. +// The in-line .JSONL file contains, per line, a proto that wraps a +// TextSnippet proto (in json representation) followed by one or more +// AnnotationPayload protos (called annotations), which have +// display_name and text_extraction detail populated. The given text +// is expected to be annotated exhaustively, for example, if you look +// for animals and text contains "dolphin" that is not labeled, then +// "dolphin" is assumed to not be an animal. Any given text snippet +// content must be 10KB or smaller, and also be UTF-8 NFC encoded +// (ASCII already is). +// The document .JSONL file contains, per line, a proto that wraps a +// Document proto. The Document proto must have either document_text +// or input_config set. In document_text case, the Document proto may +// also contain the spatial information of the document, including +// layout, document dimension and page number. In input_config case, +// only PDF documents are supported now, and each document may be up +// to 2MB large. Currently, annotations on documents cannot be +// specified at import. +// Three sample CSV rows: +// TRAIN,gs://folder/file1.jsonl +// VALIDATE,gs://folder/file2.jsonl +// TEST,gs://folder/file3.jsonl +// Sample in-line JSON Lines file for entity extraction (presented here +// with artificial line breaks, but the only actual line break is +// denoted by \n).: +// { +// "document": { +// "document_text": {"content": "dog cat"} +// "layout": [ +// { +// "text_segment": { +// "start_offset": 0, +// "end_offset": 3, +// }, +// "page_number": 1, +// "bounding_poly": { +// "normalized_vertices": [ +// {"x": 0.1, "y": 0.1}, +// {"x": 0.1, "y": 0.3}, +// {"x": 0.3, "y": 0.3}, +// {"x": 0.3, "y": 0.1}, +// ], +// }, +// "text_segment_type": TOKEN, +// }, +// { +// "text_segment": { +// "start_offset": 4, +// "end_offset": 7, +// }, +// "page_number": 1, +// "bounding_poly": { +// "normalized_vertices": [ +// {"x": 0.4, "y": 0.1}, +// {"x": 0.4, "y": 0.3}, +// {"x": 0.8, "y": 0.3}, +// {"x": 0.8, "y": 0.1}, +// ], +// }, +// "text_segment_type": TOKEN, +// } +// +// ], +// "document_dimensions": { +// "width": 8.27, +// "height": 11.69, +// "unit": INCH, +// } +// "page_count": 1, +// }, +// "annotations": [ +// { +// "display_name": "animal", +// "text_extraction": {"text_segment": {"start_offset": 0, +// "end_offset": 3}} +// }, +// { +// "display_name": "animal", +// "text_extraction": {"text_segment": {"start_offset": 4, +// "end_offset": 7}} +// } +// ], +// }\n +// { +// "text_snippet": { +// "content": "This dog is good." +// }, +// "annotations": [ +// { +// "display_name": "animal", +// "text_extraction": { +// "text_segment": {"start_offset": 5, "end_offset": 8} +// } +// } +// ] +// } +// Sample document JSON Lines file (presented here with artificial line +// breaks, but the only actual line break is denoted by \n).: +// { +// "document": { +// "input_config": { +// "gcs_source": { "input_uris": [ "gs://folder/document1.pdf" ] +// } +// } +// } +// }\n +// { +// "document": { +// "input_config": { +// "gcs_source": { "input_uris": [ "gs://folder/document2.pdf" ] +// } +// } +// } +// } +// +// * For Text Classification: +// CSV file(s) with each line in format: +// ML_USE,(TEXT_SNIPPET | GCS_FILE_PATH),LABEL,LABEL,... +// TEXT_SNIPPET and GCS_FILE_PATH are distinguished by a pattern. If +// the column content is a valid gcs file path, i.e. prefixed by +// "gs://", it will be treated as a GCS_FILE_PATH, else if the content +// is enclosed within double quotes (""), it is +// treated as a TEXT_SNIPPET. In the GCS_FILE_PATH case, the path +// must lead to a .txt file with UTF-8 encoding, for example, +// "gs://folder/content.txt", and the content in it is extracted +// as a text snippet. In TEXT_SNIPPET case, the column content +// excluding quotes is treated as to be imported text snippet. In +// both cases, the text snippet/file size must be within 128kB. +// Maximum 100 unique labels are allowed per CSV row. +// Sample rows: +// TRAIN,"They have bad food and very rude",RudeService,BadFood +// TRAIN,gs://folder/content.txt,SlowService +// TEST,"Typically always bad service there.",RudeService +// VALIDATE,"Stomach ache to go.",BadFood +// +// * For Text Sentiment: +// CSV file(s) with each line in format: +// ML_USE,(TEXT_SNIPPET | GCS_FILE_PATH),SENTIMENT +// TEXT_SNIPPET and GCS_FILE_PATH are distinguished by a pattern. If +// the column content is a valid gcs file path, that is, prefixed by +// "gs://", it is treated as a GCS_FILE_PATH, otherwise it is treated +// as a TEXT_SNIPPET. In the GCS_FILE_PATH case, the path +// must lead to a .txt file with UTF-8 encoding, for example, +// "gs://folder/content.txt", and the content in it is extracted +// as a text snippet. In TEXT_SNIPPET case, the column content itself +// is treated as to be imported text snippet. In both cases, the +// text snippet must be up to 500 characters long. +// Sample rows: +// TRAIN,"@freewrytin this is way too good for your product",2 +// TRAIN,"I need this product so bad",3 +// TEST,"Thank you for this product.",4 +// VALIDATE,gs://folder/content.txt,2 +// +// * For Tables: +// Either +// [gcs_source][google.cloud.automl.v1beta1.InputConfig.gcs_source] or +// +// [bigquery_source][google.cloud.automl.v1beta1.InputConfig.bigquery_source] +// can be used. All inputs is concatenated into a single +// +// [primary_table][google.cloud.automl.v1beta1.TablesDatasetMetadata.primary_table_name] +// For gcs_source: +// CSV file(s), where the first row of the first file is the header, +// containing unique column names. If the first row of a subsequent +// file is the same as the header, then it is also treated as a +// header. All other rows contain values for the corresponding +// columns. +// Each .CSV file by itself must be 10GB or smaller, and their total +// size must be 100GB or smaller. +// First three sample rows of a CSV file: +// "Id","First Name","Last Name","Dob","Addresses" +// +// "1","John","Doe","1968-01-22","[{"status":"current","address":"123_First_Avenue","city":"Seattle","state":"WA","zip":"11111","numberOfYears":"1"},{"status":"previous","address":"456_Main_Street","city":"Portland","state":"OR","zip":"22222","numberOfYears":"5"}]" +// +// "2","Jane","Doe","1980-10-16","[{"status":"current","address":"789_Any_Avenue","city":"Albany","state":"NY","zip":"33333","numberOfYears":"2"},{"status":"previous","address":"321_Main_Street","city":"Hoboken","state":"NJ","zip":"44444","numberOfYears":"3"}]} +// For bigquery_source: +// An URI of a BigQuery table. The user data size of the BigQuery +// table must be 100GB or smaller. +// An imported table must have between 2 and 1,000 columns, inclusive, +// and between 1000 and 100,000,000 rows, inclusive. There are at most 5 +// import data running in parallel. +// Definitions: +// ML_USE = "TRAIN" | "VALIDATE" | "TEST" | "UNASSIGNED" +// Describes how the given example (file) should be used for model +// training. "UNASSIGNED" can be used when user has no preference. +// GCS_FILE_PATH = A path to file on GCS, e.g. "gs://folder/image1.png". +// LABEL = A display name of an object on an image, video etc., e.g. "dog". +// Must be up to 32 characters long and can consist only of ASCII +// Latin letters A-Z and a-z, underscores(_), and ASCII digits 0-9. +// For each label an AnnotationSpec is created which display_name +// becomes the label; AnnotationSpecs are given back in predictions. +// INSTANCE_ID = A positive integer that identifies a specific instance of a +// labeled entity on an example. Used e.g. to track two cars on +// a video while being able to tell apart which one is which. +// BOUNDING_BOX = VERTEX,VERTEX,VERTEX,VERTEX | VERTEX,,,VERTEX,, +// A rectangle parallel to the frame of the example (image, +// video). If 4 vertices are given they are connected by edges +// in the order provided, if 2 are given they are recognized +// as diagonally opposite vertices of the rectangle. +// VERTEX = COORDINATE,COORDINATE +// First coordinate is horizontal (x), the second is vertical (y). +// COORDINATE = A float in 0 to 1 range, relative to total length of +// image or video in given dimension. For fractions the +// leading non-decimal 0 can be omitted (i.e. 0.3 = .3). +// Point 0,0 is in top left. +// TIME_SEGMENT_START = TIME_OFFSET +// Expresses a beginning, inclusive, of a time segment +// within an example that has a time dimension +// (e.g. video). +// TIME_SEGMENT_END = TIME_OFFSET +// Expresses an end, exclusive, of a time segment within +// an example that has a time dimension (e.g. video). +// TIME_OFFSET = A number of seconds as measured from the start of an +// example (e.g. video). Fractions are allowed, up to a +// microsecond precision. "inf" is allowed, and it means the end +// of the example. +// TEXT_SNIPPET = A content of a text snippet, UTF-8 encoded, enclosed within +// double quotes (""). +// SENTIMENT = An integer between 0 and +// Dataset.text_sentiment_dataset_metadata.sentiment_max +// (inclusive). Describes the ordinal of the sentiment - higher +// value means a more positive sentiment. All the values are +// completely relative, i.e. neither 0 needs to mean a negative or +// neutral sentiment nor sentiment_max needs to mean a positive one +// - it is just required that 0 is the least positive sentiment +// in the data, and sentiment_max is the most positive one. +// The SENTIMENT shouldn't be confused with "score" or "magnitude" +// from the previous Natural Language Sentiment Analysis API. +// All SENTIMENT values between 0 and sentiment_max must be +// represented in the imported data. On prediction the same 0 to +// sentiment_max range will be used. The difference between +// neighboring sentiment values needs not to be uniform, e.g. 1 and +// 2 may be similar whereas the difference between 2 and 3 may be +// huge. +// +// Errors: +// If any of the provided CSV files can't be parsed or if more than certain +// percent of CSV rows cannot be processed then the operation fails and +// nothing is imported. Regardless of overall success or failure the per-row +// failures, up to a certain count cap, is listed in +// Operation.metadata.partial_failures. +// +message InputConfig { + // The source of the input. + oneof source { + // The Google Cloud Storage location for the input content. + // In ImportData, the gcs_source points to a csv with structure described in + // the comment. + GcsSource gcs_source = 1; + + // The BigQuery location for the input content. + BigQuerySource bigquery_source = 3; + } + + // Additional domain-specific parameters describing the semantic of the + // imported data, any string must be up to 25000 + // characters long. + // + // * For Tables: + // `schema_inference_version` - (integer) Required. The version of the + // algorithm that should be used for the initial inference of the + // schema (columns' DataTypes) of the table the data is being imported + // into. Allowed values: "1". + map params = 2; +} + +// Input configuration for BatchPredict Action. +// +// The format of input depends on the ML problem of the model used for +// prediction. As input source the +// [gcs_source][google.cloud.automl.v1beta1.InputConfig.gcs_source] +// is expected, unless specified otherwise. +// +// The formats are represented in EBNF with commas being literal and with +// non-terminal symbols defined near the end of this comment. The formats +// are: +// +// * For Image Classification: +// CSV file(s) with each line having just a single column: +// GCS_FILE_PATH +// which leads to image of up to 30MB in size. Supported +// extensions: .JPEG, .GIF, .PNG. This path is treated as the ID in +// the Batch predict output. +// Three sample rows: +// gs://folder/image1.jpeg +// gs://folder/image2.gif +// gs://folder/image3.png +// +// * For Image Object Detection: +// CSV file(s) with each line having just a single column: +// GCS_FILE_PATH +// which leads to image of up to 30MB in size. Supported +// extensions: .JPEG, .GIF, .PNG. This path is treated as the ID in +// the Batch predict output. +// Three sample rows: +// gs://folder/image1.jpeg +// gs://folder/image2.gif +// gs://folder/image3.png +// * For Video Classification: +// CSV file(s) with each line in format: +// GCS_FILE_PATH,TIME_SEGMENT_START,TIME_SEGMENT_END +// GCS_FILE_PATH leads to video of up to 50GB in size and up to 3h +// duration. Supported extensions: .MOV, .MPEG4, .MP4, .AVI. +// TIME_SEGMENT_START and TIME_SEGMENT_END must be within the +// length of the video, and end has to be after the start. +// Three sample rows: +// gs://folder/video1.mp4,10,40 +// gs://folder/video1.mp4,20,60 +// gs://folder/vid2.mov,0,inf +// +// * For Video Object Tracking: +// CSV file(s) with each line in format: +// GCS_FILE_PATH,TIME_SEGMENT_START,TIME_SEGMENT_END +// GCS_FILE_PATH leads to video of up to 50GB in size and up to 3h +// duration. Supported extensions: .MOV, .MPEG4, .MP4, .AVI. +// TIME_SEGMENT_START and TIME_SEGMENT_END must be within the +// length of the video, and end has to be after the start. +// Three sample rows: +// gs://folder/video1.mp4,10,240 +// gs://folder/video1.mp4,300,360 +// gs://folder/vid2.mov,0,inf +// * For Text Classification: +// CSV file(s) with each line having just a single column: +// GCS_FILE_PATH | TEXT_SNIPPET +// Any given text file can have size upto 128kB. +// Any given text snippet content must have 60,000 characters or less. +// Three sample rows: +// gs://folder/text1.txt +// "Some text content to predict" +// gs://folder/text3.pdf +// Supported file extensions: .txt, .pdf +// +// * For Text Sentiment: +// CSV file(s) with each line having just a single column: +// GCS_FILE_PATH | TEXT_SNIPPET +// Any given text file can have size upto 128kB. +// Any given text snippet content must have 500 characters or less. +// Three sample rows: +// gs://folder/text1.txt +// "Some text content to predict" +// gs://folder/text3.pdf +// Supported file extensions: .txt, .pdf +// +// * For Text Extraction +// .JSONL (i.e. JSON Lines) file(s) which either provide text in-line or +// as documents (for a single BatchPredict call only one of the these +// formats may be used). +// The in-line .JSONL file(s) contain per line a proto that +// wraps a temporary user-assigned TextSnippet ID (string up to 2000 +// characters long) called "id", a TextSnippet proto (in +// json representation) and zero or more TextFeature protos. Any given +// text snippet content must have 30,000 characters or less, and also +// be UTF-8 NFC encoded (ASCII already is). The IDs provided should be +// unique. +// The document .JSONL file(s) contain, per line, a proto that wraps a +// Document proto with input_config set. Only PDF documents are +// supported now, and each document must be up to 2MB large. +// Any given .JSONL file must be 100MB or smaller, and no more than 20 +// files may be given. +// Sample in-line JSON Lines file (presented here with artificial line +// breaks, but the only actual line break is denoted by \n): +// { +// "id": "my_first_id", +// "text_snippet": { "content": "dog car cat"}, +// "text_features": [ +// { +// "text_segment": {"start_offset": 4, "end_offset": 6}, +// "structural_type": PARAGRAPH, +// "bounding_poly": { +// "normalized_vertices": [ +// {"x": 0.1, "y": 0.1}, +// {"x": 0.1, "y": 0.3}, +// {"x": 0.3, "y": 0.3}, +// {"x": 0.3, "y": 0.1}, +// ] +// }, +// } +// ], +// }\n +// { +// "id": "2", +// "text_snippet": { +// "content": "An elaborate content", +// "mime_type": "text/plain" +// } +// } +// Sample document JSON Lines file (presented here with artificial line +// breaks, but the only actual line break is denoted by \n).: +// { +// "document": { +// "input_config": { +// "gcs_source": { "input_uris": [ "gs://folder/document1.pdf" ] +// } +// } +// } +// }\n +// { +// "document": { +// "input_config": { +// "gcs_source": { "input_uris": [ "gs://folder/document2.pdf" ] +// } +// } +// } +// } +// +// * For Tables: +// Either +// [gcs_source][google.cloud.automl.v1beta1.InputConfig.gcs_source] or +// +// [bigquery_source][google.cloud.automl.v1beta1.InputConfig.bigquery_source]. +// GCS case: +// CSV file(s), each by itself 10GB or smaller and total size must be +// 100GB or smaller, where first file must have a header containing +// column names. If the first row of a subsequent file is the same as +// the header, then it is also treated as a header. All other rows +// contain values for the corresponding columns. +// The column names must contain the model's +// +// [input_feature_column_specs'][google.cloud.automl.v1beta1.TablesModelMetadata.input_feature_column_specs] +// +// [display_name-s][google.cloud.automl.v1beta1.ColumnSpec.display_name] +// (order doesn't matter). The columns corresponding to the model's +// input feature column specs must contain values compatible with the +// column spec's data types. Prediction on all the rows, i.e. the CSV +// lines, will be attempted. For FORECASTING +// +// [prediction_type][google.cloud.automl.v1beta1.TablesModelMetadata.prediction_type]: +// all columns having +// +// [TIME_SERIES_AVAILABLE_PAST_ONLY][google.cloud.automl.v1beta1.ColumnSpec.ForecastingMetadata.ColumnType] +// type will be ignored. +// First three sample rows of a CSV file: +// "First Name","Last Name","Dob","Addresses" +// +// "John","Doe","1968-01-22","[{"status":"current","address":"123_First_Avenue","city":"Seattle","state":"WA","zip":"11111","numberOfYears":"1"},{"status":"previous","address":"456_Main_Street","city":"Portland","state":"OR","zip":"22222","numberOfYears":"5"}]" +// +// "Jane","Doe","1980-10-16","[{"status":"current","address":"789_Any_Avenue","city":"Albany","state":"NY","zip":"33333","numberOfYears":"2"},{"status":"previous","address":"321_Main_Street","city":"Hoboken","state":"NJ","zip":"44444","numberOfYears":"3"}]} +// BigQuery case: +// An URI of a BigQuery table. The user data size of the BigQuery +// table must be 100GB or smaller. +// The column names must contain the model's +// +// [input_feature_column_specs'][google.cloud.automl.v1beta1.TablesModelMetadata.input_feature_column_specs] +// +// [display_name-s][google.cloud.automl.v1beta1.ColumnSpec.display_name] +// (order doesn't matter). The columns corresponding to the model's +// input feature column specs must contain values compatible with the +// column spec's data types. Prediction on all the rows of the table +// will be attempted. For FORECASTING +// +// [prediction_type][google.cloud.automl.v1beta1.TablesModelMetadata.prediction_type]: +// all columns having +// +// [TIME_SERIES_AVAILABLE_PAST_ONLY][google.cloud.automl.v1beta1.ColumnSpec.ForecastingMetadata.ColumnType] +// type will be ignored. +// +// Definitions: +// GCS_FILE_PATH = A path to file on GCS, e.g. "gs://folder/video.avi". +// TEXT_SNIPPET = A content of a text snippet, UTF-8 encoded, enclosed within +// double quotes ("") +// TIME_SEGMENT_START = TIME_OFFSET +// Expresses a beginning, inclusive, of a time segment +// within an +// example that has a time dimension (e.g. video). +// TIME_SEGMENT_END = TIME_OFFSET +// Expresses an end, exclusive, of a time segment within +// an example that has a time dimension (e.g. video). +// TIME_OFFSET = A number of seconds as measured from the start of an +// example (e.g. video). Fractions are allowed, up to a +// microsecond precision. "inf" is allowed and it means the end +// of the example. +// +// Errors: +// If any of the provided CSV files can't be parsed or if more than certain +// percent of CSV rows cannot be processed then the operation fails and +// prediction does not happen. Regardless of overall success or failure the +// per-row failures, up to a certain count cap, will be listed in +// Operation.metadata.partial_failures. +message BatchPredictInputConfig { + // Required. The source of the input. + oneof source { + // The Google Cloud Storage location for the input content. + GcsSource gcs_source = 1; + + // The BigQuery location for the input content. + BigQuerySource bigquery_source = 2; + } +} + +// Input configuration of a [Document][google.cloud.automl.v1beta1.Document]. +message DocumentInputConfig { + // The Google Cloud Storage location of the document file. Only a single path + // should be given. + // Max supported size: 512MB. + // Supported extensions: .PDF. + GcsSource gcs_source = 1; +} + +// * For Translation: +// CSV file `translation.csv`, with each line in format: +// ML_USE,GCS_FILE_PATH +// GCS_FILE_PATH leads to a .TSV file which describes examples that have +// given ML_USE, using the following row format per line: +// TEXT_SNIPPET (in source language) \t TEXT_SNIPPET (in target +// language) +// +// * For Tables: +// Output depends on whether the dataset was imported from GCS or +// BigQuery. +// GCS case: +// +// [gcs_destination][google.cloud.automl.v1beta1.OutputConfig.gcs_destination] +// must be set. Exported are CSV file(s) `tables_1.csv`, +// `tables_2.csv`,...,`tables_N.csv` with each having as header line +// the table's column names, and all other lines contain values for +// the header columns. +// BigQuery case: +// +// [bigquery_destination][google.cloud.automl.v1beta1.OutputConfig.bigquery_destination] +// pointing to a BigQuery project must be set. In the given project a +// new dataset will be created with name +// +// `export_data__` +// where will be made +// BigQuery-dataset-name compatible (e.g. most special characters will +// become underscores), and timestamp will be in +// YYYY_MM_DDThh_mm_ss_sssZ "based on ISO-8601" format. In that +// dataset a new table called `primary_table` will be created, and +// filled with precisely the same data as this obtained on import. +message OutputConfig { + // Required. The destination of the output. + oneof destination { + // The Google Cloud Storage location where the output is to be written to. + // For Image Object Detection, Text Extraction, Video Classification and + // Tables, in the given directory a new directory will be created with name: + // export_data-- where + // timestamp is in YYYY-MM-DDThh:mm:ss.sssZ ISO-8601 format. All export + // output will be written into that directory. + GcsDestination gcs_destination = 1; + + // The BigQuery location where the output is to be written to. + BigQueryDestination bigquery_destination = 2; + } +} + +// Output configuration for BatchPredict Action. +// +// As destination the +// +// [gcs_destination][google.cloud.automl.v1beta1.BatchPredictOutputConfig.gcs_destination] +// must be set unless specified otherwise for a domain. If gcs_destination is +// set then in the given directory a new directory is created. Its name +// will be +// "prediction--", +// where timestamp is in YYYY-MM-DDThh:mm:ss.sssZ ISO-8601 format. The contents +// of it depends on the ML problem the predictions are made for. +// +// * For Image Classification: +// In the created directory files `image_classification_1.jsonl`, +// `image_classification_2.jsonl`,...,`image_classification_N.jsonl` +// will be created, where N may be 1, and depends on the +// total number of the successfully predicted images and annotations. +// A single image will be listed only once with all its annotations, +// and its annotations will never be split across files. +// Each .JSONL file will contain, per line, a JSON representation of a +// proto that wraps image's "ID" : "" followed by a list of +// zero or more AnnotationPayload protos (called annotations), which +// have classification detail populated. +// If prediction for any image failed (partially or completely), then an +// additional `errors_1.jsonl`, `errors_2.jsonl`,..., `errors_N.jsonl` +// files will be created (N depends on total number of failed +// predictions). These files will have a JSON representation of a proto +// that wraps the same "ID" : "" but here followed by +// exactly one +// +// [`google.rpc.Status`](https: +// //github.com/googleapis/googleapis/blob/master/google/rpc/status.proto) +// containing only `code` and `message`fields. +// +// * For Image Object Detection: +// In the created directory files `image_object_detection_1.jsonl`, +// `image_object_detection_2.jsonl`,...,`image_object_detection_N.jsonl` +// will be created, where N may be 1, and depends on the +// total number of the successfully predicted images and annotations. +// Each .JSONL file will contain, per line, a JSON representation of a +// proto that wraps image's "ID" : "" followed by a list of +// zero or more AnnotationPayload protos (called annotations), which +// have image_object_detection detail populated. A single image will +// be listed only once with all its annotations, and its annotations +// will never be split across files. +// If prediction for any image failed (partially or completely), then +// additional `errors_1.jsonl`, `errors_2.jsonl`,..., `errors_N.jsonl` +// files will be created (N depends on total number of failed +// predictions). These files will have a JSON representation of a proto +// that wraps the same "ID" : "" but here followed by +// exactly one +// +// [`google.rpc.Status`](https: +// //github.com/googleapis/googleapis/blob/master/google/rpc/status.proto) +// containing only `code` and `message`fields. +// * For Video Classification: +// In the created directory a video_classification.csv file, and a .JSON +// file per each video classification requested in the input (i.e. each +// line in given CSV(s)), will be created. +// +// The format of video_classification.csv is: +// +// GCS_FILE_PATH,TIME_SEGMENT_START,TIME_SEGMENT_END,JSON_FILE_NAME,STATUS +// where: +// GCS_FILE_PATH,TIME_SEGMENT_START,TIME_SEGMENT_END = matches 1 to 1 +// the prediction input lines (i.e. video_classification.csv has +// precisely the same number of lines as the prediction input had.) +// JSON_FILE_NAME = Name of .JSON file in the output directory, which +// contains prediction responses for the video time segment. +// STATUS = "OK" if prediction completed successfully, or an error code +// with message otherwise. If STATUS is not "OK" then the .JSON file +// for that line may not exist or be empty. +// +// Each .JSON file, assuming STATUS is "OK", will contain a list of +// AnnotationPayload protos in JSON format, which are the predictions +// for the video time segment the file is assigned to in the +// video_classification.csv. All AnnotationPayload protos will have +// video_classification field set, and will be sorted by +// video_classification.type field (note that the returned types are +// governed by `classifaction_types` parameter in +// [PredictService.BatchPredictRequest.params][]). +// +// * For Video Object Tracking: +// In the created directory a video_object_tracking.csv file will be +// created, and multiple files video_object_trackinng_1.json, +// video_object_trackinng_2.json,..., video_object_trackinng_N.json, +// where N is the number of requests in the input (i.e. the number of +// lines in given CSV(s)). +// +// The format of video_object_tracking.csv is: +// +// GCS_FILE_PATH,TIME_SEGMENT_START,TIME_SEGMENT_END,JSON_FILE_NAME,STATUS +// where: +// GCS_FILE_PATH,TIME_SEGMENT_START,TIME_SEGMENT_END = matches 1 to 1 +// the prediction input lines (i.e. video_object_tracking.csv has +// precisely the same number of lines as the prediction input had.) +// JSON_FILE_NAME = Name of .JSON file in the output directory, which +// contains prediction responses for the video time segment. +// STATUS = "OK" if prediction completed successfully, or an error +// code with message otherwise. If STATUS is not "OK" then the .JSON +// file for that line may not exist or be empty. +// +// Each .JSON file, assuming STATUS is "OK", will contain a list of +// AnnotationPayload protos in JSON format, which are the predictions +// for each frame of the video time segment the file is assigned to in +// video_object_tracking.csv. All AnnotationPayload protos will have +// video_object_tracking field set. +// * For Text Classification: +// In the created directory files `text_classification_1.jsonl`, +// `text_classification_2.jsonl`,...,`text_classification_N.jsonl` +// will be created, where N may be 1, and depends on the +// total number of inputs and annotations found. +// +// Each .JSONL file will contain, per line, a JSON representation of a +// proto that wraps input text snippet or input text file and a list of +// zero or more AnnotationPayload protos (called annotations), which +// have classification detail populated. A single text snippet or file +// will be listed only once with all its annotations, and its +// annotations will never be split across files. +// +// If prediction for any text snippet or file failed (partially or +// completely), then additional `errors_1.jsonl`, `errors_2.jsonl`,..., +// `errors_N.jsonl` files will be created (N depends on total number of +// failed predictions). These files will have a JSON representation of a +// proto that wraps input text snippet or input text file followed by +// exactly one +// +// [`google.rpc.Status`](https: +// //github.com/googleapis/googleapis/blob/master/google/rpc/status.proto) +// containing only `code` and `message`. +// +// * For Text Sentiment: +// In the created directory files `text_sentiment_1.jsonl`, +// `text_sentiment_2.jsonl`,...,`text_sentiment_N.jsonl` +// will be created, where N may be 1, and depends on the +// total number of inputs and annotations found. +// +// Each .JSONL file will contain, per line, a JSON representation of a +// proto that wraps input text snippet or input text file and a list of +// zero or more AnnotationPayload protos (called annotations), which +// have text_sentiment detail populated. A single text snippet or file +// will be listed only once with all its annotations, and its +// annotations will never be split across files. +// +// If prediction for any text snippet or file failed (partially or +// completely), then additional `errors_1.jsonl`, `errors_2.jsonl`,..., +// `errors_N.jsonl` files will be created (N depends on total number of +// failed predictions). These files will have a JSON representation of a +// proto that wraps input text snippet or input text file followed by +// exactly one +// +// [`google.rpc.Status`](https: +// //github.com/googleapis/googleapis/blob/master/google/rpc/status.proto) +// containing only `code` and `message`. +// +// * For Text Extraction: +// In the created directory files `text_extraction_1.jsonl`, +// `text_extraction_2.jsonl`,...,`text_extraction_N.jsonl` +// will be created, where N may be 1, and depends on the +// total number of inputs and annotations found. +// The contents of these .JSONL file(s) depend on whether the input +// used inline text, or documents. +// If input was inline, then each .JSONL file will contain, per line, +// a JSON representation of a proto that wraps given in request text +// snippet's "id" (if specified), followed by input text snippet, +// and a list of zero or more +// AnnotationPayload protos (called annotations), which have +// text_extraction detail populated. A single text snippet will be +// listed only once with all its annotations, and its annotations will +// never be split across files. +// If input used documents, then each .JSONL file will contain, per +// line, a JSON representation of a proto that wraps given in request +// document proto, followed by its OCR-ed representation in the form +// of a text snippet, finally followed by a list of zero or more +// AnnotationPayload protos (called annotations), which have +// text_extraction detail populated and refer, via their indices, to +// the OCR-ed text snippet. A single document (and its text snippet) +// will be listed only once with all its annotations, and its +// annotations will never be split across files. +// If prediction for any text snippet failed (partially or completely), +// then additional `errors_1.jsonl`, `errors_2.jsonl`,..., +// `errors_N.jsonl` files will be created (N depends on total number of +// failed predictions). These files will have a JSON representation of a +// proto that wraps either the "id" : "" (in case of inline) +// or the document proto (in case of document) but here followed by +// exactly one +// +// [`google.rpc.Status`](https: +// //github.com/googleapis/googleapis/blob/master/google/rpc/status.proto) +// containing only `code` and `message`. +// +// * For Tables: +// Output depends on whether +// +// [gcs_destination][google.cloud.automl.v1beta1.BatchPredictOutputConfig.gcs_destination] +// or +// +// [bigquery_destination][google.cloud.automl.v1beta1.BatchPredictOutputConfig.bigquery_destination] +// is set (either is allowed). +// GCS case: +// In the created directory files `tables_1.csv`, `tables_2.csv`,..., +// `tables_N.csv` will be created, where N may be 1, and depends on +// the total number of the successfully predicted rows. +// For all CLASSIFICATION +// +// [prediction_type-s][google.cloud.automl.v1beta1.TablesModelMetadata.prediction_type]: +// Each .csv file will contain a header, listing all columns' +// +// [display_name-s][google.cloud.automl.v1beta1.ColumnSpec.display_name] +// given on input followed by M target column names in the format of +// +// "<[target_column_specs][google.cloud.automl.v1beta1.TablesModelMetadata.target_column_spec] +// +// [display_name][google.cloud.automl.v1beta1.ColumnSpec.display_name]>__score" where M is the number of distinct target values, +// i.e. number of distinct values in the target column of the table +// used to train the model. Subsequent lines will contain the +// respective values of successfully predicted rows, with the last, +// i.e. the target, columns having the corresponding prediction +// [scores][google.cloud.automl.v1beta1.TablesAnnotation.score]. +// For REGRESSION and FORECASTING +// +// [prediction_type-s][google.cloud.automl.v1beta1.TablesModelMetadata.prediction_type]: +// Each .csv file will contain a header, listing all columns' +// [display_name-s][google.cloud.automl.v1beta1.display_name] given +// on input followed by the predicted target column with name in the +// format of +// +// "predicted_<[target_column_specs][google.cloud.automl.v1beta1.TablesModelMetadata.target_column_spec] +// +// [display_name][google.cloud.automl.v1beta1.ColumnSpec.display_name]>" +// Subsequent lines will contain the respective values of +// successfully predicted rows, with the last, i.e. the target, +// column having the predicted target value. +// If prediction for any rows failed, then an additional +// `errors_1.csv`, `errors_2.csv`,..., `errors_N.csv` will be +// created (N depends on total number of failed rows). These files +// will have analogous format as `tables_*.csv`, but always with a +// single target column having +// +// [`google.rpc.Status`](https: +// //github.com/googleapis/googleapis/blob/master/google/rpc/status.proto) +// represented as a JSON string, and containing only `code` and +// `message`. +// BigQuery case: +// +// [bigquery_destination][google.cloud.automl.v1beta1.OutputConfig.bigquery_destination] +// pointing to a BigQuery project must be set. In the given project a +// new dataset will be created with name +// `prediction__` +// where will be made +// BigQuery-dataset-name compatible (e.g. most special characters will +// become underscores), and timestamp will be in +// YYYY_MM_DDThh_mm_ss_sssZ "based on ISO-8601" format. In the dataset +// two tables will be created, `predictions`, and `errors`. +// The `predictions` table's column names will be the input columns' +// +// [display_name-s][google.cloud.automl.v1beta1.ColumnSpec.display_name] +// followed by the target column with name in the format of +// +// "predicted_<[target_column_specs][google.cloud.automl.v1beta1.TablesModelMetadata.target_column_spec] +// +// [display_name][google.cloud.automl.v1beta1.ColumnSpec.display_name]>" +// The input feature columns will contain the respective values of +// successfully predicted rows, with the target column having an +// ARRAY of +// +// [AnnotationPayloads][google.cloud.automl.v1beta1.AnnotationPayload], +// represented as STRUCT-s, containing +// [TablesAnnotation][google.cloud.automl.v1beta1.TablesAnnotation]. +// The `errors` table contains rows for which the prediction has +// failed, it has analogous input columns while the target column name +// is in the format of +// +// "errors_<[target_column_specs][google.cloud.automl.v1beta1.TablesModelMetadata.target_column_spec] +// +// [display_name][google.cloud.automl.v1beta1.ColumnSpec.display_name]>", +// and as a value has +// +// [`google.rpc.Status`](https: +// //github.com/googleapis/googleapis/blob/master/google/rpc/status.proto) +// represented as a STRUCT, and containing only `code` and `message`. +message BatchPredictOutputConfig { + // Required. The destination of the output. + oneof destination { + // The Google Cloud Storage location of the directory where the output is to + // be written to. + GcsDestination gcs_destination = 1; + + // The BigQuery location where the output is to be written to. + BigQueryDestination bigquery_destination = 2; + } +} + +// Output configuration for ModelExport Action. +message ModelExportOutputConfig { + // Required. The destination of the output. + oneof destination { + // The Google Cloud Storage location where the model is to be written to. + // This location may only be set for the following model formats: + // "tflite", "edgetpu_tflite", "tf_saved_model", "tf_js", "core_ml". + // + // Under the directory given as the destination a new one with name + // "model-export--", + // where timestamp is in YYYY-MM-DDThh:mm:ss.sssZ ISO-8601 format, + // will be created. Inside the model and any of its supporting files + // will be written. + GcsDestination gcs_destination = 1; + + // The GCR location where model image is to be pushed to. This location + // may only be set for the following model formats: + // "docker". + // + // The model image will be created under the given URI. + GcrDestination gcr_destination = 3; + } + + // The format in which the model must be exported. The available, and default, + // formats depend on the problem and model type (if given problem and type + // combination doesn't have a format listed, it means its models are not + // exportable): + // + // * For Image Classification mobile-low-latency-1, mobile-versatile-1, + // mobile-high-accuracy-1: + // "tflite" (default), "edgetpu_tflite", "tf_saved_model", "tf_js", + // "docker". + // + // * For Image Classification mobile-core-ml-low-latency-1, + // mobile-core-ml-versatile-1, mobile-core-ml-high-accuracy-1: + // "core_ml" (default). + // + // * For Image Object Detection mobile-low-latency-1, mobile-versatile-1, + // mobile-high-accuracy-1: + // "tflite", "tf_saved_model", "tf_js". + // + // * For Video Classification cloud, + // "tf_saved_model". + // + // * For Video Object Tracking cloud, + // "tf_saved_model". + // + // * For Video Object Tracking mobile-versatile-1: + // "tflite", "edgetpu_tflite", "tf_saved_model", "docker". + // + // * For Video Object Tracking mobile-coral-versatile-1: + // "tflite", "edgetpu_tflite", "docker". + // + // * For Video Object Tracking mobile-coral-low-latency-1: + // "tflite", "edgetpu_tflite", "docker". + // + // * For Video Object Tracking mobile-jetson-versatile-1: + // "tf_saved_model", "docker". + // + // * For Tables: + // "docker". + // + // Formats description: + // + // * tflite - Used for Android mobile devices. + // * edgetpu_tflite - Used for [Edge TPU](https://cloud.google.com/edge-tpu/) + // devices. + // * tf_saved_model - A tensorflow model in SavedModel format. + // * tf_js - A [TensorFlow.js](https://www.tensorflow.org/js) model that can + // be used in the browser and in Node.js using JavaScript. + // * docker - Used for Docker containers. Use the params field to customize + // the container. The container is verified to work correctly on + // ubuntu 16.04 operating system. See more at + // [containers + // + // quickstart](https: + // //cloud.google.com/vision/automl/docs/containers-gcs-quickstart) + // * core_ml - Used for iOS mobile devices. + string model_format = 4; + + // Additional model-type and format specific parameters describing the + // requirements for the to be exported model files, any string must be up to + // 25000 characters long. + // + // * For `docker` format: + // `cpu_architecture` - (string) "x86_64" (default). + // `gpu_architecture` - (string) "none" (default), "nvidia". + map params = 2; +} + +// Output configuration for ExportEvaluatedExamples Action. Note that this call +// is available only for 30 days since the moment the model was evaluated. +// The output depends on the domain, as follows (note that only examples from +// the TEST set are exported): +// +// * For Tables: +// +// [bigquery_destination][google.cloud.automl.v1beta1.OutputConfig.bigquery_destination] +// pointing to a BigQuery project must be set. In the given project a +// new dataset will be created with name +// +// `export_evaluated_examples__` +// where will be made BigQuery-dataset-name +// compatible (e.g. most special characters will become underscores), +// and timestamp will be in YYYY_MM_DDThh_mm_ss_sssZ "based on ISO-8601" +// format. In the dataset an `evaluated_examples` table will be +// created. It will have all the same columns as the +// +// [primary_table][google.cloud.automl.v1beta1.TablesDatasetMetadata.primary_table_spec_id] +// of the +// [dataset][google.cloud.automl.v1beta1.Model.dataset_id] from which +// the model was created, as they were at the moment of model's +// evaluation (this includes the target column with its ground +// truth), followed by a column called "predicted_". That +// last column will contain the model's prediction result for each +// respective row, given as ARRAY of +// [AnnotationPayloads][google.cloud.automl.v1beta1.AnnotationPayload], +// represented as STRUCT-s, containing +// [TablesAnnotation][google.cloud.automl.v1beta1.TablesAnnotation]. +message ExportEvaluatedExamplesOutputConfig { + // Required. The destination of the output. + oneof destination { + // The BigQuery location where the output is to be written to. + BigQueryDestination bigquery_destination = 2; + } +} + +// The Google Cloud Storage location for the input content. +message GcsSource { + // Required. Google Cloud Storage URIs to input files, up to 2000 characters + // long. Accepted forms: + // * Full object path, e.g. gs://bucket/directory/object.csv + repeated string input_uris = 1; +} + +// The BigQuery location for the input content. +message BigQuerySource { + // Required. BigQuery URI to a table, up to 2000 characters long. + // Accepted forms: + // * BigQuery path e.g. bq://projectId.bqDatasetId.bqTableId + string input_uri = 1; +} + +// The Google Cloud Storage location where the output is to be written to. +message GcsDestination { + // Required. Google Cloud Storage URI to output directory, up to 2000 + // characters long. + // Accepted forms: + // * Prefix path: gs://bucket/directory + // The requesting user must have write permission to the bucket. + // The directory is created if it doesn't exist. + string output_uri_prefix = 1; +} + +// The BigQuery location for the output content. +message BigQueryDestination { + // Required. BigQuery URI to a project, up to 2000 characters long. + // Accepted forms: + // * BigQuery path e.g. bq://projectId + string output_uri = 1; +} + +// The GCR location where the image must be pushed to. +message GcrDestination { + // Required. Google Contained Registry URI of the new image, up to 2000 + // characters long. See + // + // https: + // //cloud.google.com/container-registry/do + // // cs/pushing-and-pulling#pushing_an_image_to_a_registry + // Accepted forms: + // * [HOSTNAME]/[PROJECT-ID]/[IMAGE] + // * [HOSTNAME]/[PROJECT-ID]/[IMAGE]:[TAG] + // + // The requesting user must have permission to push images the project. + string output_uri = 1; +} diff --git a/packages/google-cloud-automl/protos/google/cloud/automl/v1beta1/model.proto b/packages/google-cloud-automl/protos/google/cloud/automl/v1beta1/model.proto new file mode 100644 index 00000000000..9db5e4866e7 --- /dev/null +++ b/packages/google-cloud-automl/protos/google/cloud/automl/v1beta1/model.proto @@ -0,0 +1,107 @@ +// Copyright 2020 Google LLC +// +// Licensed under the Apache License, Version 2.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.automl.v1beta1; + +import "google/api/resource.proto"; +import "google/cloud/automl/v1beta1/image.proto"; +import "google/cloud/automl/v1beta1/tables.proto"; +import "google/cloud/automl/v1beta1/text.proto"; +import "google/cloud/automl/v1beta1/translation.proto"; +import "google/cloud/automl/v1beta1/video.proto"; +import "google/protobuf/timestamp.proto"; + +option go_package = "cloud.google.com/go/automl/apiv1beta1/automlpb;automlpb"; +option java_multiple_files = true; +option java_package = "com.google.cloud.automl.v1beta1"; +option php_namespace = "Google\\Cloud\\AutoMl\\V1beta1"; +option ruby_package = "Google::Cloud::AutoML::V1beta1"; + +// API proto representing a trained machine learning model. +message Model { + option (google.api.resource) = { + type: "automl.googleapis.com/Model" + pattern: "projects/{project}/locations/{location}/models/{model}" + }; + + // Deployment state of the model. + enum DeploymentState { + // Should not be used, an un-set enum has this value by default. + DEPLOYMENT_STATE_UNSPECIFIED = 0; + + // Model is deployed. + DEPLOYED = 1; + + // Model is not deployed. + UNDEPLOYED = 2; + } + + // Required. + // The model metadata that is specific to the problem type. + // Must match the metadata type of the dataset used to train the model. + oneof model_metadata { + // Metadata for translation models. + TranslationModelMetadata translation_model_metadata = 15; + + // Metadata for image classification models. + ImageClassificationModelMetadata image_classification_model_metadata = 13; + + // Metadata for text classification models. + TextClassificationModelMetadata text_classification_model_metadata = 14; + + // Metadata for image object detection models. + ImageObjectDetectionModelMetadata image_object_detection_model_metadata = 20; + + // Metadata for video classification models. + VideoClassificationModelMetadata video_classification_model_metadata = 23; + + // Metadata for video object tracking models. + VideoObjectTrackingModelMetadata video_object_tracking_model_metadata = 21; + + // Metadata for text extraction models. + TextExtractionModelMetadata text_extraction_model_metadata = 19; + + // Metadata for Tables models. + TablesModelMetadata tables_model_metadata = 24; + + // Metadata for text sentiment models. + TextSentimentModelMetadata text_sentiment_model_metadata = 22; + } + + // Output only. Resource name of the model. + // Format: `projects/{project_id}/locations/{location_id}/models/{model_id}` + string name = 1; + + // Required. The name of the model to show in the interface. The name can be + // up to 32 characters long and can consist only of ASCII Latin letters A-Z + // and a-z, underscores + // (_), and ASCII digits 0-9. It must start with a letter. + string display_name = 2; + + // Required. The resource ID of the dataset used to create the model. The dataset must + // come from the same ancestor project and location. + string dataset_id = 3; + + // Output only. Timestamp when the model training finished and can be used for prediction. + google.protobuf.Timestamp create_time = 7; + + // Output only. Timestamp when this model was last updated. + google.protobuf.Timestamp update_time = 11; + + // Output only. Deployment state of the model. A model can only serve + // prediction requests after it gets deployed. + DeploymentState deployment_state = 8; +} diff --git a/packages/google-cloud-automl/protos/google/cloud/automl/v1beta1/model_evaluation.proto b/packages/google-cloud-automl/protos/google/cloud/automl/v1beta1/model_evaluation.proto new file mode 100644 index 00000000000..91801bd36fb --- /dev/null +++ b/packages/google-cloud-automl/protos/google/cloud/automl/v1beta1/model_evaluation.proto @@ -0,0 +1,115 @@ +// Copyright 2020 Google LLC +// +// Licensed under the Apache License, Version 2.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.automl.v1beta1; + +import "google/api/resource.proto"; +import "google/cloud/automl/v1beta1/classification.proto"; +import "google/cloud/automl/v1beta1/detection.proto"; +import "google/cloud/automl/v1beta1/regression.proto"; +import "google/cloud/automl/v1beta1/tables.proto"; +import "google/cloud/automl/v1beta1/text_extraction.proto"; +import "google/cloud/automl/v1beta1/text_sentiment.proto"; +import "google/cloud/automl/v1beta1/translation.proto"; +import "google/protobuf/timestamp.proto"; + +option go_package = "cloud.google.com/go/automl/apiv1beta1/automlpb;automlpb"; +option java_multiple_files = true; +option java_package = "com.google.cloud.automl.v1beta1"; +option php_namespace = "Google\\Cloud\\AutoMl\\V1beta1"; +option ruby_package = "Google::Cloud::AutoML::V1beta1"; + +// Evaluation results of a model. +message ModelEvaluation { + option (google.api.resource) = { + type: "automl.googleapis.com/ModelEvaluation" + pattern: "projects/{project}/locations/{location}/models/{model}/modelEvaluations/{model_evaluation}" + }; + + // Output only. Problem type specific evaluation metrics. + oneof metrics { + // Model evaluation metrics for image, text, video and tables + // classification. + // Tables problem is considered a classification when the target column + // is CATEGORY DataType. + ClassificationEvaluationMetrics classification_evaluation_metrics = 8; + + // Model evaluation metrics for Tables regression. + // Tables problem is considered a regression when the target column + // has FLOAT64 DataType. + RegressionEvaluationMetrics regression_evaluation_metrics = 24; + + // Model evaluation metrics for translation. + TranslationEvaluationMetrics translation_evaluation_metrics = 9; + + // Model evaluation metrics for image object detection. + ImageObjectDetectionEvaluationMetrics image_object_detection_evaluation_metrics = 12; + + // Model evaluation metrics for video object tracking. + VideoObjectTrackingEvaluationMetrics video_object_tracking_evaluation_metrics = 14; + + // Evaluation metrics for text sentiment models. + TextSentimentEvaluationMetrics text_sentiment_evaluation_metrics = 11; + + // Evaluation metrics for text extraction models. + TextExtractionEvaluationMetrics text_extraction_evaluation_metrics = 13; + } + + // Output only. Resource name of the model evaluation. + // Format: + // + // `projects/{project_id}/locations/{location_id}/models/{model_id}/modelEvaluations/{model_evaluation_id}` + string name = 1; + + // Output only. The ID of the annotation spec that the model evaluation applies to. The + // The ID is empty for the overall model evaluation. + // For Tables annotation specs in the dataset do not exist and this ID is + // always not set, but for CLASSIFICATION + // + // [prediction_type-s][google.cloud.automl.v1beta1.TablesModelMetadata.prediction_type] + // the + // [display_name][google.cloud.automl.v1beta1.ModelEvaluation.display_name] + // field is used. + string annotation_spec_id = 2; + + // Output only. The value of + // [display_name][google.cloud.automl.v1beta1.AnnotationSpec.display_name] at + // the moment when the model was trained. Because this field returns a value + // at model training time, for different models trained from the same dataset, + // the values may differ, since display names could had been changed between + // the two model's trainings. + // For Tables CLASSIFICATION + // + // [prediction_type-s][google.cloud.automl.v1beta1.TablesModelMetadata.prediction_type] + // distinct values of the target column at the moment of the model evaluation + // are populated here. + // The display_name is empty for the overall model evaluation. + string display_name = 15; + + // Output only. Timestamp when this model evaluation was created. + google.protobuf.Timestamp create_time = 5; + + // Output only. The number of examples used for model evaluation, i.e. for + // which ground truth from time of model creation is compared against the + // predicted annotations created by the model. + // For overall ModelEvaluation (i.e. with annotation_spec_id not set) this is + // the total number of all examples used for evaluation. + // Otherwise, this is the count of examples that according to the ground + // truth were annotated by the + // + // [annotation_spec_id][google.cloud.automl.v1beta1.ModelEvaluation.annotation_spec_id]. + int32 evaluated_example_count = 6; +} diff --git a/packages/google-cloud-automl/protos/google/cloud/automl/v1beta1/operations.proto b/packages/google-cloud-automl/protos/google/cloud/automl/v1beta1/operations.proto new file mode 100644 index 00000000000..f75e48d14c7 --- /dev/null +++ b/packages/google-cloud-automl/protos/google/cloud/automl/v1beta1/operations.proto @@ -0,0 +1,187 @@ +// Copyright 2020 Google LLC +// +// Licensed under the Apache License, Version 2.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.automl.v1beta1; + +import "google/cloud/automl/v1beta1/io.proto"; +import "google/cloud/automl/v1beta1/model.proto"; +import "google/cloud/automl/v1beta1/model_evaluation.proto"; +import "google/protobuf/timestamp.proto"; +import "google/rpc/status.proto"; + +option go_package = "cloud.google.com/go/automl/apiv1beta1/automlpb;automlpb"; +option java_multiple_files = true; +option java_package = "com.google.cloud.automl.v1beta1"; +option php_namespace = "Google\\Cloud\\AutoMl\\V1beta1"; +option ruby_package = "Google::Cloud::AutoML::V1beta1"; + +// Metadata used across all long running operations returned by AutoML API. +message OperationMetadata { + // Ouptut only. Details of specific operation. Even if this field is empty, + // the presence allows to distinguish different types of operations. + oneof details { + // Details of a Delete operation. + DeleteOperationMetadata delete_details = 8; + + // Details of a DeployModel operation. + DeployModelOperationMetadata deploy_model_details = 24; + + // Details of an UndeployModel operation. + UndeployModelOperationMetadata undeploy_model_details = 25; + + // Details of CreateModel operation. + CreateModelOperationMetadata create_model_details = 10; + + // Details of ImportData operation. + ImportDataOperationMetadata import_data_details = 15; + + // Details of BatchPredict operation. + BatchPredictOperationMetadata batch_predict_details = 16; + + // Details of ExportData operation. + ExportDataOperationMetadata export_data_details = 21; + + // Details of ExportModel operation. + ExportModelOperationMetadata export_model_details = 22; + + // Details of ExportEvaluatedExamples operation. + ExportEvaluatedExamplesOperationMetadata export_evaluated_examples_details = 26; + } + + // Output only. Progress of operation. Range: [0, 100]. + // Not used currently. + int32 progress_percent = 13; + + // Output only. Partial failures encountered. + // E.g. single files that couldn't be read. + // This field should never exceed 20 entries. + // Status details field will contain standard GCP error details. + repeated google.rpc.Status partial_failures = 2; + + // Output only. Time when the operation was created. + google.protobuf.Timestamp create_time = 3; + + // Output only. Time when the operation was updated for the last time. + google.protobuf.Timestamp update_time = 4; +} + +// Details of operations that perform deletes of any entities. +message DeleteOperationMetadata { + +} + +// Details of DeployModel operation. +message DeployModelOperationMetadata { + +} + +// Details of UndeployModel operation. +message UndeployModelOperationMetadata { + +} + +// Details of CreateModel operation. +message CreateModelOperationMetadata { + +} + +// Details of ImportData operation. +message ImportDataOperationMetadata { + +} + +// Details of ExportData operation. +message ExportDataOperationMetadata { + // Further describes this export data's output. + // Supplements + // [OutputConfig][google.cloud.automl.v1beta1.OutputConfig]. + message ExportDataOutputInfo { + // The output location to which the exported data is written. + oneof output_location { + // The full path of the Google Cloud Storage directory created, into which + // the exported data is written. + string gcs_output_directory = 1; + + // The path of the BigQuery dataset created, in bq://projectId.bqDatasetId + // format, into which the exported data is written. + string bigquery_output_dataset = 2; + } + } + + // Output only. Information further describing this export data's output. + ExportDataOutputInfo output_info = 1; +} + +// Details of BatchPredict operation. +message BatchPredictOperationMetadata { + // Further describes this batch predict's output. + // Supplements + // + // [BatchPredictOutputConfig][google.cloud.automl.v1beta1.BatchPredictOutputConfig]. + message BatchPredictOutputInfo { + // The output location into which prediction output is written. + oneof output_location { + // The full path of the Google Cloud Storage directory created, into which + // the prediction output is written. + string gcs_output_directory = 1; + + // The path of the BigQuery dataset created, in bq://projectId.bqDatasetId + // format, into which the prediction output is written. + string bigquery_output_dataset = 2; + } + } + + // Output only. The input config that was given upon starting this + // batch predict operation. + BatchPredictInputConfig input_config = 1; + + // Output only. Information further describing this batch predict's output. + BatchPredictOutputInfo output_info = 2; +} + +// Details of ExportModel operation. +message ExportModelOperationMetadata { + // Further describes the output of model export. + // Supplements + // + // [ModelExportOutputConfig][google.cloud.automl.v1beta1.ModelExportOutputConfig]. + message ExportModelOutputInfo { + // The full path of the Google Cloud Storage directory created, into which + // the model will be exported. + string gcs_output_directory = 1; + } + + // Output only. Information further describing the output of this model + // export. + ExportModelOutputInfo output_info = 2; +} + +// Details of EvaluatedExamples operation. +message ExportEvaluatedExamplesOperationMetadata { + // Further describes the output of the evaluated examples export. + // Supplements + // + // [ExportEvaluatedExamplesOutputConfig][google.cloud.automl.v1beta1.ExportEvaluatedExamplesOutputConfig]. + message ExportEvaluatedExamplesOutputInfo { + // The path of the BigQuery dataset created, in bq://projectId.bqDatasetId + // format, into which the output of export evaluated examples is written. + string bigquery_output_dataset = 2; + } + + // Output only. Information further describing the output of this evaluated + // examples export. + ExportEvaluatedExamplesOutputInfo output_info = 2; +} diff --git a/packages/google-cloud-automl/protos/google/cloud/automl/v1beta1/prediction_service.proto b/packages/google-cloud-automl/protos/google/cloud/automl/v1beta1/prediction_service.proto new file mode 100644 index 00000000000..28148a576e3 --- /dev/null +++ b/packages/google-cloud-automl/protos/google/cloud/automl/v1beta1/prediction_service.proto @@ -0,0 +1,268 @@ +// Copyright 2020 Google LLC +// +// Licensed under the Apache License, Version 2.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.automl.v1beta1; + +import "google/api/annotations.proto"; +import "google/api/client.proto"; +import "google/api/field_behavior.proto"; +import "google/api/resource.proto"; +import "google/cloud/automl/v1beta1/annotation_payload.proto"; +import "google/cloud/automl/v1beta1/data_items.proto"; +import "google/cloud/automl/v1beta1/io.proto"; +import "google/cloud/automl/v1beta1/operations.proto"; +import "google/longrunning/operations.proto"; + +option go_package = "cloud.google.com/go/automl/apiv1beta1/automlpb;automlpb"; +option java_multiple_files = true; +option java_outer_classname = "PredictionServiceProto"; +option java_package = "com.google.cloud.automl.v1beta1"; +option php_namespace = "Google\\Cloud\\AutoMl\\V1beta1"; +option ruby_package = "Google::Cloud::AutoML::V1beta1"; + +// AutoML Prediction API. +// +// On any input that is documented to expect a string parameter in +// snake_case or kebab-case, either of those cases is accepted. +service PredictionService { + option (google.api.default_host) = "automl.googleapis.com"; + option (google.api.oauth_scopes) = "https://www.googleapis.com/auth/cloud-platform"; + + // Perform an online prediction. The prediction result will be directly + // returned in the response. + // Available for following ML problems, and their expected request payloads: + // * Image Classification - Image in .JPEG, .GIF or .PNG format, image_bytes + // up to 30MB. + // * Image Object Detection - Image in .JPEG, .GIF or .PNG format, image_bytes + // up to 30MB. + // * Text Classification - TextSnippet, content up to 60,000 characters, + // UTF-8 encoded. + // * Text Extraction - TextSnippet, content up to 30,000 characters, + // UTF-8 NFC encoded. + // * Translation - TextSnippet, content up to 25,000 characters, UTF-8 + // encoded. + // * Tables - Row, with column values matching the columns of the model, + // up to 5MB. Not available for FORECASTING + // + // [prediction_type][google.cloud.automl.v1beta1.TablesModelMetadata.prediction_type]. + // * Text Sentiment - TextSnippet, content up 500 characters, UTF-8 + // encoded. + rpc Predict(PredictRequest) returns (PredictResponse) { + option (google.api.http) = { + post: "/v1beta1/{name=projects/*/locations/*/models/*}:predict" + body: "*" + }; + option (google.api.method_signature) = "name,payload,params"; + } + + // Perform a batch prediction. Unlike the online [Predict][google.cloud.automl.v1beta1.PredictionService.Predict], batch + // prediction result won't be immediately available in the response. Instead, + // a long running operation object is returned. User can poll the operation + // result via [GetOperation][google.longrunning.Operations.GetOperation] + // method. Once the operation is done, [BatchPredictResult][google.cloud.automl.v1beta1.BatchPredictResult] is returned in + // the [response][google.longrunning.Operation.response] field. + // Available for following ML problems: + // * Image Classification + // * Image Object Detection + // * Video Classification + // * Video Object Tracking * Text Extraction + // * Tables + rpc BatchPredict(BatchPredictRequest) returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v1beta1/{name=projects/*/locations/*/models/*}:batchPredict" + body: "*" + }; + option (google.api.method_signature) = "name,input_config,output_config,params"; + option (google.longrunning.operation_info) = { + response_type: "BatchPredictResult" + metadata_type: "OperationMetadata" + }; + } +} + +// Request message for [PredictionService.Predict][google.cloud.automl.v1beta1.PredictionService.Predict]. +message PredictRequest { + // Required. Name of the model requested to serve the prediction. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "automl.googleapis.com/Model" + } + ]; + + // Required. Payload to perform a prediction on. The payload must match the + // problem type that the model was trained to solve. + ExamplePayload payload = 2 [(google.api.field_behavior) = REQUIRED]; + + // Additional domain-specific parameters, any string must be up to 25000 + // characters long. + // + // * For Image Classification: + // + // `score_threshold` - (float) A value from 0.0 to 1.0. When the model + // makes predictions for an image, it will only produce results that have + // at least this confidence score. The default is 0.5. + // + // * For Image Object Detection: + // `score_threshold` - (float) When Model detects objects on the image, + // it will only produce bounding boxes which have at least this + // confidence score. Value in 0 to 1 range, default is 0.5. + // `max_bounding_box_count` - (int64) No more than this number of bounding + // boxes will be returned in the response. Default is 100, the + // requested value may be limited by server. + // * For Tables: + // feature_importance - (boolean) Whether feature importance + // should be populated in the returned TablesAnnotation. + // The default is false. + map params = 3; +} + +// Response message for [PredictionService.Predict][google.cloud.automl.v1beta1.PredictionService.Predict]. +message PredictResponse { + // Prediction result. + // Translation and Text Sentiment will return precisely one payload. + repeated AnnotationPayload payload = 1; + + // The preprocessed example that AutoML actually makes prediction on. + // Empty if AutoML does not preprocess the input example. + // * For Text Extraction: + // If the input is a .pdf file, the OCR'ed text will be provided in + // [document_text][google.cloud.automl.v1beta1.Document.document_text]. + ExamplePayload preprocessed_input = 3; + + // Additional domain-specific prediction response metadata. + // + // * For Image Object Detection: + // `max_bounding_box_count` - (int64) At most that many bounding boxes per + // image could have been returned. + // + // * For Text Sentiment: + // `sentiment_score` - (float, deprecated) A value between -1 and 1, + // -1 maps to least positive sentiment, while 1 maps to the most positive + // one and the higher the score, the more positive the sentiment in the + // document is. Yet these values are relative to the training data, so + // e.g. if all data was positive then -1 will be also positive (though + // the least). + // The sentiment_score shouldn't be confused with "score" or "magnitude" + // from the previous Natural Language Sentiment Analysis API. + map metadata = 2; +} + +// Request message for [PredictionService.BatchPredict][google.cloud.automl.v1beta1.PredictionService.BatchPredict]. +message BatchPredictRequest { + // Required. Name of the model requested to serve the batch prediction. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "automl.googleapis.com/Model" + } + ]; + + // Required. The input configuration for batch prediction. + BatchPredictInputConfig input_config = 3 [(google.api.field_behavior) = REQUIRED]; + + // Required. The Configuration specifying where output predictions should + // be written. + BatchPredictOutputConfig output_config = 4 [(google.api.field_behavior) = REQUIRED]; + + // Required. Additional domain-specific parameters for the predictions, any string must + // be up to 25000 characters long. + // + // * For Text Classification: + // + // `score_threshold` - (float) A value from 0.0 to 1.0. When the model + // makes predictions for a text snippet, it will only produce results + // that have at least this confidence score. The default is 0.5. + // + // * For Image Classification: + // + // `score_threshold` - (float) A value from 0.0 to 1.0. When the model + // makes predictions for an image, it will only produce results that + // have at least this confidence score. The default is 0.5. + // + // * For Image Object Detection: + // + // `score_threshold` - (float) When Model detects objects on the image, + // it will only produce bounding boxes which have at least this + // confidence score. Value in 0 to 1 range, default is 0.5. + // `max_bounding_box_count` - (int64) No more than this number of bounding + // boxes will be produced per image. Default is 100, the + // requested value may be limited by server. + // + // * For Video Classification : + // + // `score_threshold` - (float) A value from 0.0 to 1.0. When the model + // makes predictions for a video, it will only produce results that + // have at least this confidence score. The default is 0.5. + // `segment_classification` - (boolean) Set to true to request + // segment-level classification. AutoML Video Intelligence returns + // labels and their confidence scores for the entire segment of the + // video that user specified in the request configuration. + // The default is "true". + // `shot_classification` - (boolean) Set to true to request shot-level + // classification. AutoML Video Intelligence determines the boundaries + // for each camera shot in the entire segment of the video that user + // specified in the request configuration. AutoML Video Intelligence + // then returns labels and their confidence scores for each detected + // shot, along with the start and end time of the shot. + // WARNING: Model evaluation is not done for this classification type, + // the quality of it depends on training data, but there are no metrics + // provided to describe that quality. The default is "false". + // `1s_interval_classification` - (boolean) Set to true to request + // classification for a video at one-second intervals. AutoML Video + // Intelligence returns labels and their confidence scores for each + // second of the entire segment of the video that user specified in the + // request configuration. + // WARNING: Model evaluation is not done for this classification + // type, the quality of it depends on training data, but there are no + // metrics provided to describe that quality. The default is + // "false". + // + // * For Tables: + // + // feature_importance - (boolean) Whether feature importance + // should be populated in the returned TablesAnnotations. The + // default is false. + // + // * For Video Object Tracking: + // + // `score_threshold` - (float) When Model detects objects on video frames, + // it will only produce bounding boxes which have at least this + // confidence score. Value in 0 to 1 range, default is 0.5. + // `max_bounding_box_count` - (int64) No more than this number of bounding + // boxes will be returned per frame. Default is 100, the requested + // value may be limited by server. + // `min_bounding_box_size` - (float) Only bounding boxes with shortest edge + // at least that long as a relative value of video frame size will be + // returned. Value in 0 to 1 range. Default is 0. + map params = 5 [(google.api.field_behavior) = REQUIRED]; +} + +// Result of the Batch Predict. This message is returned in +// [response][google.longrunning.Operation.response] of the operation returned +// by the [PredictionService.BatchPredict][google.cloud.automl.v1beta1.PredictionService.BatchPredict]. +message BatchPredictResult { + // Additional domain-specific prediction response metadata. + // + // * For Image Object Detection: + // `max_bounding_box_count` - (int64) At most that many bounding boxes per + // image could have been returned. + // + // * For Video Object Tracking: + // `max_bounding_box_count` - (int64) At most that many bounding boxes per + // frame could have been returned. + map metadata = 1; +} diff --git a/packages/google-cloud-automl/protos/google/cloud/automl/v1beta1/ranges.proto b/packages/google-cloud-automl/protos/google/cloud/automl/v1beta1/ranges.proto new file mode 100644 index 00000000000..35ebb569a11 --- /dev/null +++ b/packages/google-cloud-automl/protos/google/cloud/automl/v1beta1/ranges.proto @@ -0,0 +1,34 @@ +// Copyright 2020 Google LLC +// +// Licensed under the Apache License, Version 2.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.automl.v1beta1; + + +option go_package = "cloud.google.com/go/automl/apiv1beta1/automlpb;automlpb"; +option java_multiple_files = true; +option java_outer_classname = "RangesProto"; +option java_package = "com.google.cloud.automl.v1beta1"; +option php_namespace = "Google\\Cloud\\AutoMl\\V1beta1"; +option ruby_package = "Google::Cloud::AutoML::V1beta1"; + +// A range between two double numbers. +message DoubleRange { + // Start of the range, inclusive. + double start = 1; + + // End of the range, exclusive. + double end = 2; +} diff --git a/packages/google-cloud-automl/protos/google/cloud/automl/v1beta1/regression.proto b/packages/google-cloud-automl/protos/google/cloud/automl/v1beta1/regression.proto new file mode 100644 index 00000000000..3c6b269a6be --- /dev/null +++ b/packages/google-cloud-automl/protos/google/cloud/automl/v1beta1/regression.proto @@ -0,0 +1,43 @@ +// Copyright 2020 Google LLC +// +// Licensed under the Apache License, Version 2.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.automl.v1beta1; + + +option go_package = "cloud.google.com/go/automl/apiv1beta1/automlpb;automlpb"; +option java_outer_classname = "RegressionProto"; +option java_package = "com.google.cloud.automl.v1beta1"; +option php_namespace = "Google\\Cloud\\AutoMl\\V1beta1"; +option ruby_package = "Google::Cloud::AutoML::V1beta1"; + +// Metrics for regression problems. +message RegressionEvaluationMetrics { + // Output only. Root Mean Squared Error (RMSE). + float root_mean_squared_error = 1; + + // Output only. Mean Absolute Error (MAE). + float mean_absolute_error = 2; + + // Output only. Mean absolute percentage error. Only set if all ground truth + // values are are positive. + float mean_absolute_percentage_error = 3; + + // Output only. R squared. + float r_squared = 4; + + // Output only. Root mean squared log error. + float root_mean_squared_log_error = 5; +} diff --git a/packages/google-cloud-automl/protos/google/cloud/automl/v1beta1/service.proto b/packages/google-cloud-automl/protos/google/cloud/automl/v1beta1/service.proto new file mode 100644 index 00000000000..f4ac32315f9 --- /dev/null +++ b/packages/google-cloud-automl/protos/google/cloud/automl/v1beta1/service.proto @@ -0,0 +1,801 @@ +// Copyright 2020 Google LLC +// +// Licensed under the Apache License, Version 2.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.automl.v1beta1; + +import "google/api/annotations.proto"; +import "google/api/client.proto"; +import "google/api/field_behavior.proto"; +import "google/api/resource.proto"; +import "google/cloud/automl/v1beta1/annotation_payload.proto"; +import "google/cloud/automl/v1beta1/annotation_spec.proto"; +import "google/cloud/automl/v1beta1/column_spec.proto"; +import "google/cloud/automl/v1beta1/dataset.proto"; +import "google/cloud/automl/v1beta1/image.proto"; +import "google/cloud/automl/v1beta1/io.proto"; +import "google/cloud/automl/v1beta1/model.proto"; +import "google/cloud/automl/v1beta1/model_evaluation.proto"; +import "google/cloud/automl/v1beta1/operations.proto"; +import "google/cloud/automl/v1beta1/table_spec.proto"; +import "google/longrunning/operations.proto"; +import "google/protobuf/field_mask.proto"; + +option go_package = "cloud.google.com/go/automl/apiv1beta1/automlpb;automlpb"; +option java_multiple_files = true; +option java_outer_classname = "AutoMlProto"; +option java_package = "com.google.cloud.automl.v1beta1"; +option php_namespace = "Google\\Cloud\\AutoMl\\V1beta1"; +option ruby_package = "Google::Cloud::AutoML::V1beta1"; + +// AutoML Server API. +// +// The resource names are assigned by the server. +// The server never reuses names that it has created after the resources with +// those names are deleted. +// +// An ID of a resource is the last element of the item's resource name. For +// `projects/{project_id}/locations/{location_id}/datasets/{dataset_id}`, then +// the id for the item is `{dataset_id}`. +// +// Currently the only supported `location_id` is "us-central1". +// +// On any input that is documented to expect a string parameter in +// snake_case or kebab-case, either of those cases is accepted. +service AutoMl { + option (google.api.default_host) = "automl.googleapis.com"; + option (google.api.oauth_scopes) = "https://www.googleapis.com/auth/cloud-platform"; + + // Creates a dataset. + rpc CreateDataset(CreateDatasetRequest) returns (Dataset) { + option (google.api.http) = { + post: "/v1beta1/{parent=projects/*/locations/*}/datasets" + body: "dataset" + }; + option (google.api.method_signature) = "parent,dataset"; + } + + // Gets a dataset. + rpc GetDataset(GetDatasetRequest) returns (Dataset) { + option (google.api.http) = { + get: "/v1beta1/{name=projects/*/locations/*/datasets/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Lists datasets in a project. + rpc ListDatasets(ListDatasetsRequest) returns (ListDatasetsResponse) { + option (google.api.http) = { + get: "/v1beta1/{parent=projects/*/locations/*}/datasets" + }; + option (google.api.method_signature) = "parent"; + } + + // Updates a dataset. + rpc UpdateDataset(UpdateDatasetRequest) returns (Dataset) { + option (google.api.http) = { + patch: "/v1beta1/{dataset.name=projects/*/locations/*/datasets/*}" + body: "dataset" + }; + option (google.api.method_signature) = "dataset"; + } + + // Deletes a dataset and all of its contents. + // Returns empty response in the + // [response][google.longrunning.Operation.response] field when it completes, + // and `delete_details` in the + // [metadata][google.longrunning.Operation.metadata] field. + rpc DeleteDataset(DeleteDatasetRequest) returns (google.longrunning.Operation) { + option (google.api.http) = { + delete: "/v1beta1/{name=projects/*/locations/*/datasets/*}" + }; + option (google.api.method_signature) = "name"; + option (google.longrunning.operation_info) = { + response_type: "google.protobuf.Empty" + metadata_type: "OperationMetadata" + }; + } + + // Imports data into a dataset. + // For Tables this method can only be called on an empty Dataset. + // + // For Tables: + // * A + // [schema_inference_version][google.cloud.automl.v1beta1.InputConfig.params] + // parameter must be explicitly set. + // Returns an empty response in the + // [response][google.longrunning.Operation.response] field when it completes. + rpc ImportData(ImportDataRequest) returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v1beta1/{name=projects/*/locations/*/datasets/*}:importData" + body: "*" + }; + option (google.api.method_signature) = "name,input_config"; + option (google.longrunning.operation_info) = { + response_type: "google.protobuf.Empty" + metadata_type: "OperationMetadata" + }; + } + + // Exports dataset's data to the provided output location. + // Returns an empty response in the + // [response][google.longrunning.Operation.response] field when it completes. + rpc ExportData(ExportDataRequest) returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v1beta1/{name=projects/*/locations/*/datasets/*}:exportData" + body: "*" + }; + option (google.api.method_signature) = "name,output_config"; + option (google.longrunning.operation_info) = { + response_type: "google.protobuf.Empty" + metadata_type: "OperationMetadata" + }; + } + + // Gets an annotation spec. + rpc GetAnnotationSpec(GetAnnotationSpecRequest) returns (AnnotationSpec) { + option (google.api.http) = { + get: "/v1beta1/{name=projects/*/locations/*/datasets/*/annotationSpecs/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Gets a table spec. + rpc GetTableSpec(GetTableSpecRequest) returns (TableSpec) { + option (google.api.http) = { + get: "/v1beta1/{name=projects/*/locations/*/datasets/*/tableSpecs/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Lists table specs in a dataset. + rpc ListTableSpecs(ListTableSpecsRequest) returns (ListTableSpecsResponse) { + option (google.api.http) = { + get: "/v1beta1/{parent=projects/*/locations/*/datasets/*}/tableSpecs" + }; + option (google.api.method_signature) = "parent"; + } + + // Updates a table spec. + rpc UpdateTableSpec(UpdateTableSpecRequest) returns (TableSpec) { + option (google.api.http) = { + patch: "/v1beta1/{table_spec.name=projects/*/locations/*/datasets/*/tableSpecs/*}" + body: "table_spec" + }; + option (google.api.method_signature) = "table_spec"; + } + + // Gets a column spec. + rpc GetColumnSpec(GetColumnSpecRequest) returns (ColumnSpec) { + option (google.api.http) = { + get: "/v1beta1/{name=projects/*/locations/*/datasets/*/tableSpecs/*/columnSpecs/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Lists column specs in a table spec. + rpc ListColumnSpecs(ListColumnSpecsRequest) returns (ListColumnSpecsResponse) { + option (google.api.http) = { + get: "/v1beta1/{parent=projects/*/locations/*/datasets/*/tableSpecs/*}/columnSpecs" + }; + option (google.api.method_signature) = "parent"; + } + + // Updates a column spec. + rpc UpdateColumnSpec(UpdateColumnSpecRequest) returns (ColumnSpec) { + option (google.api.http) = { + patch: "/v1beta1/{column_spec.name=projects/*/locations/*/datasets/*/tableSpecs/*/columnSpecs/*}" + body: "column_spec" + }; + option (google.api.method_signature) = "column_spec"; + } + + // Creates a model. + // Returns a Model in the [response][google.longrunning.Operation.response] + // field when it completes. + // When you create a model, several model evaluations are created for it: + // a global evaluation, and one evaluation for each annotation spec. + rpc CreateModel(CreateModelRequest) returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v1beta1/{parent=projects/*/locations/*}/models" + body: "model" + }; + option (google.api.method_signature) = "parent,model"; + option (google.longrunning.operation_info) = { + response_type: "Model" + metadata_type: "OperationMetadata" + }; + } + + // Gets a model. + rpc GetModel(GetModelRequest) returns (Model) { + option (google.api.http) = { + get: "/v1beta1/{name=projects/*/locations/*/models/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Lists models. + rpc ListModels(ListModelsRequest) returns (ListModelsResponse) { + option (google.api.http) = { + get: "/v1beta1/{parent=projects/*/locations/*}/models" + }; + option (google.api.method_signature) = "parent"; + } + + // Deletes a model. + // Returns `google.protobuf.Empty` in the + // [response][google.longrunning.Operation.response] field when it completes, + // and `delete_details` in the + // [metadata][google.longrunning.Operation.metadata] field. + rpc DeleteModel(DeleteModelRequest) returns (google.longrunning.Operation) { + option (google.api.http) = { + delete: "/v1beta1/{name=projects/*/locations/*/models/*}" + }; + option (google.api.method_signature) = "name"; + option (google.longrunning.operation_info) = { + response_type: "google.protobuf.Empty" + metadata_type: "OperationMetadata" + }; + } + + // Deploys a model. If a model is already deployed, deploying it with the + // same parameters has no effect. Deploying with different parametrs + // (as e.g. changing + // + // [node_number][google.cloud.automl.v1beta1.ImageObjectDetectionModelDeploymentMetadata.node_number]) + // will reset the deployment state without pausing the model's availability. + // + // Only applicable for Text Classification, Image Object Detection , Tables, and Image Segmentation; all other domains manage + // deployment automatically. + // + // Returns an empty response in the + // [response][google.longrunning.Operation.response] field when it completes. + rpc DeployModel(DeployModelRequest) returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v1beta1/{name=projects/*/locations/*/models/*}:deploy" + body: "*" + }; + option (google.api.method_signature) = "name"; + option (google.longrunning.operation_info) = { + response_type: "google.protobuf.Empty" + metadata_type: "OperationMetadata" + }; + } + + // Undeploys a model. If the model is not deployed this method has no effect. + // + // Only applicable for Text Classification, Image Object Detection and Tables; + // all other domains manage deployment automatically. + // + // Returns an empty response in the + // [response][google.longrunning.Operation.response] field when it completes. + rpc UndeployModel(UndeployModelRequest) returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v1beta1/{name=projects/*/locations/*/models/*}:undeploy" + body: "*" + }; + option (google.api.method_signature) = "name"; + option (google.longrunning.operation_info) = { + response_type: "google.protobuf.Empty" + metadata_type: "OperationMetadata" + }; + } + + // Exports a trained, "export-able", model to a user specified Google Cloud + // Storage location. A model is considered export-able if and only if it has + // an export format defined for it in + // + // [ModelExportOutputConfig][google.cloud.automl.v1beta1.ModelExportOutputConfig]. + // + // Returns an empty response in the + // [response][google.longrunning.Operation.response] field when it completes. + rpc ExportModel(ExportModelRequest) returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v1beta1/{name=projects/*/locations/*/models/*}:export" + body: "*" + }; + option (google.api.method_signature) = "name,output_config"; + option (google.longrunning.operation_info) = { + response_type: "google.protobuf.Empty" + metadata_type: "OperationMetadata" + }; + } + + // Exports examples on which the model was evaluated (i.e. which were in the + // TEST set of the dataset the model was created from), together with their + // ground truth annotations and the annotations created (predicted) by the + // model. + // The examples, ground truth and predictions are exported in the state + // they were at the moment the model was evaluated. + // + // This export is available only for 30 days since the model evaluation is + // created. + // + // Currently only available for Tables. + // + // Returns an empty response in the + // [response][google.longrunning.Operation.response] field when it completes. + rpc ExportEvaluatedExamples(ExportEvaluatedExamplesRequest) returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v1beta1/{name=projects/*/locations/*/models/*}:exportEvaluatedExamples" + body: "*" + }; + option (google.api.method_signature) = "name,output_config"; + option (google.longrunning.operation_info) = { + response_type: "google.protobuf.Empty" + metadata_type: "OperationMetadata" + }; + } + + // Gets a model evaluation. + rpc GetModelEvaluation(GetModelEvaluationRequest) returns (ModelEvaluation) { + option (google.api.http) = { + get: "/v1beta1/{name=projects/*/locations/*/models/*/modelEvaluations/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Lists model evaluations. + rpc ListModelEvaluations(ListModelEvaluationsRequest) returns (ListModelEvaluationsResponse) { + option (google.api.http) = { + get: "/v1beta1/{parent=projects/*/locations/*/models/*}/modelEvaluations" + }; + option (google.api.method_signature) = "parent"; + } +} + +// Request message for [AutoMl.CreateDataset][google.cloud.automl.v1beta1.AutoMl.CreateDataset]. +message CreateDatasetRequest { + // Required. The resource name of the project to create the dataset for. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "locations.googleapis.com/Location" + } + ]; + + // Required. The dataset to create. + Dataset dataset = 2 [(google.api.field_behavior) = REQUIRED]; +} + +// Request message for [AutoMl.GetDataset][google.cloud.automl.v1beta1.AutoMl.GetDataset]. +message GetDatasetRequest { + // Required. The resource name of the dataset to retrieve. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "automl.googleapis.com/Dataset" + } + ]; +} + +// Request message for [AutoMl.ListDatasets][google.cloud.automl.v1beta1.AutoMl.ListDatasets]. +message ListDatasetsRequest { + // Required. The resource name of the project from which to list datasets. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "locations.googleapis.com/Location" + } + ]; + + // An expression for filtering the results of the request. + // + // * `dataset_metadata` - for existence of the case (e.g. + // `image_classification_dataset_metadata:*`). Some examples of + // using the filter are: + // + // * `translation_dataset_metadata:*` --> The dataset has + // `translation_dataset_metadata`. + string filter = 3; + + // Requested page size. Server may return fewer results than requested. + // If unspecified, server will pick a default size. + int32 page_size = 4; + + // A token identifying a page of results for the server to return + // Typically obtained via + // [ListDatasetsResponse.next_page_token][google.cloud.automl.v1beta1.ListDatasetsResponse.next_page_token] of the previous + // [AutoMl.ListDatasets][google.cloud.automl.v1beta1.AutoMl.ListDatasets] call. + string page_token = 6; +} + +// Response message for [AutoMl.ListDatasets][google.cloud.automl.v1beta1.AutoMl.ListDatasets]. +message ListDatasetsResponse { + // The datasets read. + repeated Dataset datasets = 1; + + // A token to retrieve next page of results. + // Pass to [ListDatasetsRequest.page_token][google.cloud.automl.v1beta1.ListDatasetsRequest.page_token] to obtain that page. + string next_page_token = 2; +} + +// Request message for [AutoMl.UpdateDataset][google.cloud.automl.v1beta1.AutoMl.UpdateDataset] +message UpdateDatasetRequest { + // Required. The dataset which replaces the resource on the server. + Dataset dataset = 1 [(google.api.field_behavior) = REQUIRED]; + + // The update mask applies to the resource. + google.protobuf.FieldMask update_mask = 2; +} + +// Request message for [AutoMl.DeleteDataset][google.cloud.automl.v1beta1.AutoMl.DeleteDataset]. +message DeleteDatasetRequest { + // Required. The resource name of the dataset to delete. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "automl.googleapis.com/Dataset" + } + ]; +} + +// Request message for [AutoMl.ImportData][google.cloud.automl.v1beta1.AutoMl.ImportData]. +message ImportDataRequest { + // Required. Dataset name. Dataset must already exist. All imported + // annotations and examples will be added. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "automl.googleapis.com/Dataset" + } + ]; + + // Required. The desired input location and its domain specific semantics, + // if any. + InputConfig input_config = 3 [(google.api.field_behavior) = REQUIRED]; +} + +// Request message for [AutoMl.ExportData][google.cloud.automl.v1beta1.AutoMl.ExportData]. +message ExportDataRequest { + // Required. The resource name of the dataset. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "automl.googleapis.com/Dataset" + } + ]; + + // Required. The desired output location. + OutputConfig output_config = 3 [(google.api.field_behavior) = REQUIRED]; +} + +// Request message for [AutoMl.GetAnnotationSpec][google.cloud.automl.v1beta1.AutoMl.GetAnnotationSpec]. +message GetAnnotationSpecRequest { + // Required. The resource name of the annotation spec to retrieve. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "automl.googleapis.com/AnnotationSpec" + } + ]; +} + +// Request message for [AutoMl.GetTableSpec][google.cloud.automl.v1beta1.AutoMl.GetTableSpec]. +message GetTableSpecRequest { + // Required. The resource name of the table spec to retrieve. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "automl.googleapis.com/TableSpec" + } + ]; + + // Mask specifying which fields to read. + google.protobuf.FieldMask field_mask = 2; +} + +// Request message for [AutoMl.ListTableSpecs][google.cloud.automl.v1beta1.AutoMl.ListTableSpecs]. +message ListTableSpecsRequest { + // Required. The resource name of the dataset to list table specs from. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "automl.googleapis.com/Dataset" + } + ]; + + // Mask specifying which fields to read. + google.protobuf.FieldMask field_mask = 2; + + // Filter expression, see go/filtering. + string filter = 3; + + // Requested page size. The server can return fewer results than requested. + // If unspecified, the server will pick a default size. + int32 page_size = 4; + + // A token identifying a page of results for the server to return. + // Typically obtained from the + // [ListTableSpecsResponse.next_page_token][google.cloud.automl.v1beta1.ListTableSpecsResponse.next_page_token] field of the previous + // [AutoMl.ListTableSpecs][google.cloud.automl.v1beta1.AutoMl.ListTableSpecs] call. + string page_token = 6; +} + +// Response message for [AutoMl.ListTableSpecs][google.cloud.automl.v1beta1.AutoMl.ListTableSpecs]. +message ListTableSpecsResponse { + // The table specs read. + repeated TableSpec table_specs = 1; + + // A token to retrieve next page of results. + // Pass to [ListTableSpecsRequest.page_token][google.cloud.automl.v1beta1.ListTableSpecsRequest.page_token] to obtain that page. + string next_page_token = 2; +} + +// Request message for [AutoMl.UpdateTableSpec][google.cloud.automl.v1beta1.AutoMl.UpdateTableSpec] +message UpdateTableSpecRequest { + // Required. The table spec which replaces the resource on the server. + TableSpec table_spec = 1 [(google.api.field_behavior) = REQUIRED]; + + // The update mask applies to the resource. + google.protobuf.FieldMask update_mask = 2; +} + +// Request message for [AutoMl.GetColumnSpec][google.cloud.automl.v1beta1.AutoMl.GetColumnSpec]. +message GetColumnSpecRequest { + // Required. The resource name of the column spec to retrieve. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "automl.googleapis.com/ColumnSpec" + } + ]; + + // Mask specifying which fields to read. + google.protobuf.FieldMask field_mask = 2; +} + +// Request message for [AutoMl.ListColumnSpecs][google.cloud.automl.v1beta1.AutoMl.ListColumnSpecs]. +message ListColumnSpecsRequest { + // Required. The resource name of the table spec to list column specs from. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "automl.googleapis.com/TableSpec" + } + ]; + + // Mask specifying which fields to read. + google.protobuf.FieldMask field_mask = 2; + + // Filter expression, see go/filtering. + string filter = 3; + + // Requested page size. The server can return fewer results than requested. + // If unspecified, the server will pick a default size. + int32 page_size = 4; + + // A token identifying a page of results for the server to return. + // Typically obtained from the + // [ListColumnSpecsResponse.next_page_token][google.cloud.automl.v1beta1.ListColumnSpecsResponse.next_page_token] field of the previous + // [AutoMl.ListColumnSpecs][google.cloud.automl.v1beta1.AutoMl.ListColumnSpecs] call. + string page_token = 6; +} + +// Response message for [AutoMl.ListColumnSpecs][google.cloud.automl.v1beta1.AutoMl.ListColumnSpecs]. +message ListColumnSpecsResponse { + // The column specs read. + repeated ColumnSpec column_specs = 1; + + // A token to retrieve next page of results. + // Pass to [ListColumnSpecsRequest.page_token][google.cloud.automl.v1beta1.ListColumnSpecsRequest.page_token] to obtain that page. + string next_page_token = 2; +} + +// Request message for [AutoMl.UpdateColumnSpec][google.cloud.automl.v1beta1.AutoMl.UpdateColumnSpec] +message UpdateColumnSpecRequest { + // Required. The column spec which replaces the resource on the server. + ColumnSpec column_spec = 1 [(google.api.field_behavior) = REQUIRED]; + + // The update mask applies to the resource. + google.protobuf.FieldMask update_mask = 2; +} + +// Request message for [AutoMl.CreateModel][google.cloud.automl.v1beta1.AutoMl.CreateModel]. +message CreateModelRequest { + // Required. Resource name of the parent project where the model is being created. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "locations.googleapis.com/Location" + } + ]; + + // Required. The model to create. + Model model = 4 [(google.api.field_behavior) = REQUIRED]; +} + +// Request message for [AutoMl.GetModel][google.cloud.automl.v1beta1.AutoMl.GetModel]. +message GetModelRequest { + // Required. Resource name of the model. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "automl.googleapis.com/Model" + } + ]; +} + +// Request message for [AutoMl.ListModels][google.cloud.automl.v1beta1.AutoMl.ListModels]. +message ListModelsRequest { + // Required. Resource name of the project, from which to list the models. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "locations.googleapis.com/Location" + } + ]; + + // An expression for filtering the results of the request. + // + // * `model_metadata` - for existence of the case (e.g. + // `video_classification_model_metadata:*`). + // * `dataset_id` - for = or !=. Some examples of using the filter are: + // + // * `image_classification_model_metadata:*` --> The model has + // `image_classification_model_metadata`. + // * `dataset_id=5` --> The model was created from a dataset with ID 5. + string filter = 3; + + // Requested page size. + int32 page_size = 4; + + // A token identifying a page of results for the server to return + // Typically obtained via + // [ListModelsResponse.next_page_token][google.cloud.automl.v1beta1.ListModelsResponse.next_page_token] of the previous + // [AutoMl.ListModels][google.cloud.automl.v1beta1.AutoMl.ListModels] call. + string page_token = 6; +} + +// Response message for [AutoMl.ListModels][google.cloud.automl.v1beta1.AutoMl.ListModels]. +message ListModelsResponse { + // List of models in the requested page. + repeated Model model = 1; + + // A token to retrieve next page of results. + // Pass to [ListModelsRequest.page_token][google.cloud.automl.v1beta1.ListModelsRequest.page_token] to obtain that page. + string next_page_token = 2; +} + +// Request message for [AutoMl.DeleteModel][google.cloud.automl.v1beta1.AutoMl.DeleteModel]. +message DeleteModelRequest { + // Required. Resource name of the model being deleted. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "automl.googleapis.com/Model" + } + ]; +} + +// Request message for [AutoMl.DeployModel][google.cloud.automl.v1beta1.AutoMl.DeployModel]. +message DeployModelRequest { + // The per-domain specific deployment parameters. + oneof model_deployment_metadata { + // Model deployment metadata specific to Image Object Detection. + ImageObjectDetectionModelDeploymentMetadata image_object_detection_model_deployment_metadata = 2; + + // Model deployment metadata specific to Image Classification. + ImageClassificationModelDeploymentMetadata image_classification_model_deployment_metadata = 4; + } + + // Required. Resource name of the model to deploy. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "automl.googleapis.com/Model" + } + ]; +} + +// Request message for [AutoMl.UndeployModel][google.cloud.automl.v1beta1.AutoMl.UndeployModel]. +message UndeployModelRequest { + // Required. Resource name of the model to undeploy. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "automl.googleapis.com/Model" + } + ]; +} + +// Request message for [AutoMl.ExportModel][google.cloud.automl.v1beta1.AutoMl.ExportModel]. +// Models need to be enabled for exporting, otherwise an error code will be +// returned. +message ExportModelRequest { + // Required. The resource name of the model to export. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "automl.googleapis.com/Model" + } + ]; + + // Required. The desired output location and configuration. + ModelExportOutputConfig output_config = 3 [(google.api.field_behavior) = REQUIRED]; +} + +// Request message for [AutoMl.ExportEvaluatedExamples][google.cloud.automl.v1beta1.AutoMl.ExportEvaluatedExamples]. +message ExportEvaluatedExamplesRequest { + // Required. The resource name of the model whose evaluated examples are to + // be exported. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "automl.googleapis.com/Model" + } + ]; + + // Required. The desired output location and configuration. + ExportEvaluatedExamplesOutputConfig output_config = 3 [(google.api.field_behavior) = REQUIRED]; +} + +// Request message for [AutoMl.GetModelEvaluation][google.cloud.automl.v1beta1.AutoMl.GetModelEvaluation]. +message GetModelEvaluationRequest { + // Required. Resource name for the model evaluation. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "automl.googleapis.com/ModelEvaluation" + } + ]; +} + +// Request message for [AutoMl.ListModelEvaluations][google.cloud.automl.v1beta1.AutoMl.ListModelEvaluations]. +message ListModelEvaluationsRequest { + // Required. Resource name of the model to list the model evaluations for. + // If modelId is set as "-", this will list model evaluations from across all + // models of the parent location. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "automl.googleapis.com/Model" + } + ]; + + // An expression for filtering the results of the request. + // + // * `annotation_spec_id` - for =, != or existence. See example below for + // the last. + // + // Some examples of using the filter are: + // + // * `annotation_spec_id!=4` --> The model evaluation was done for + // annotation spec with ID different than 4. + // * `NOT annotation_spec_id:*` --> The model evaluation was done for + // aggregate of all annotation specs. + string filter = 3; + + // Requested page size. + int32 page_size = 4; + + // A token identifying a page of results for the server to return. + // Typically obtained via + // [ListModelEvaluationsResponse.next_page_token][google.cloud.automl.v1beta1.ListModelEvaluationsResponse.next_page_token] of the previous + // [AutoMl.ListModelEvaluations][google.cloud.automl.v1beta1.AutoMl.ListModelEvaluations] call. + string page_token = 6; +} + +// Response message for [AutoMl.ListModelEvaluations][google.cloud.automl.v1beta1.AutoMl.ListModelEvaluations]. +message ListModelEvaluationsResponse { + // List of model evaluations in the requested page. + repeated ModelEvaluation model_evaluation = 1; + + // A token to retrieve next page of results. + // Pass to the [ListModelEvaluationsRequest.page_token][google.cloud.automl.v1beta1.ListModelEvaluationsRequest.page_token] field of a new + // [AutoMl.ListModelEvaluations][google.cloud.automl.v1beta1.AutoMl.ListModelEvaluations] request to obtain that page. + string next_page_token = 2; +} diff --git a/packages/google-cloud-automl/protos/google/cloud/automl/v1beta1/table_spec.proto b/packages/google-cloud-automl/protos/google/cloud/automl/v1beta1/table_spec.proto new file mode 100644 index 00000000000..de1f7a09c13 --- /dev/null +++ b/packages/google-cloud-automl/protos/google/cloud/automl/v1beta1/table_spec.proto @@ -0,0 +1,77 @@ +// Copyright 2020 Google LLC +// +// Licensed under the Apache License, Version 2.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.automl.v1beta1; + +import "google/api/resource.proto"; +import "google/cloud/automl/v1beta1/io.proto"; + +option go_package = "cloud.google.com/go/automl/apiv1beta1/automlpb;automlpb"; +option java_multiple_files = true; +option java_package = "com.google.cloud.automl.v1beta1"; +option php_namespace = "Google\\Cloud\\AutoMl\\V1beta1"; +option ruby_package = "Google::Cloud::AutoML::V1beta1"; + +// A specification of a relational table. +// The table's schema is represented via its child column specs. It is +// pre-populated as part of ImportData by schema inference algorithm, the +// version of which is a required parameter of ImportData InputConfig. +// Note: While working with a table, at times the schema may be +// inconsistent with the data in the table (e.g. string in a FLOAT64 column). +// The consistency validation is done upon creation of a model. +// Used by: +// * Tables +message TableSpec { + option (google.api.resource) = { + type: "automl.googleapis.com/TableSpec" + pattern: "projects/{project}/locations/{location}/datasets/{dataset}/tableSpecs/{table_spec}" + }; + + // Output only. The resource name of the table spec. + // Form: + // + // `projects/{project_id}/locations/{location_id}/datasets/{dataset_id}/tableSpecs/{table_spec_id}` + string name = 1; + + // column_spec_id of the time column. Only used if the parent dataset's + // ml_use_column_spec_id is not set. Used to split rows into TRAIN, VALIDATE + // and TEST sets such that oldest rows go to TRAIN set, newest to TEST, and + // those in between to VALIDATE. + // Required type: TIMESTAMP. + // If both this column and ml_use_column are not set, then ML use of all rows + // will be assigned by AutoML. NOTE: Updates of this field will instantly + // affect any other users concurrently working with the dataset. + string time_column_spec_id = 2; + + // Output only. The number of rows (i.e. examples) in the table. + int64 row_count = 3; + + // Output only. The number of valid rows (i.e. without values that don't match + // DataType-s of their columns). + int64 valid_row_count = 4; + + // Output only. The number of columns of the table. That is, the number of + // child ColumnSpec-s. + int64 column_count = 7; + + // Output only. Input configs via which data currently residing in the table + // had been imported. + repeated InputConfig input_configs = 5; + + // Used to perform consistent read-modify-write updates. If not set, a blind + // "overwrite" update happens. + string etag = 6; +} diff --git a/packages/google-cloud-automl/protos/google/cloud/automl/v1beta1/tables.proto b/packages/google-cloud-automl/protos/google/cloud/automl/v1beta1/tables.proto new file mode 100644 index 00000000000..34ea99b306a --- /dev/null +++ b/packages/google-cloud-automl/protos/google/cloud/automl/v1beta1/tables.proto @@ -0,0 +1,291 @@ +// Copyright 2020 Google LLC +// +// Licensed under the Apache License, Version 2.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.automl.v1beta1; + +import "google/cloud/automl/v1beta1/classification.proto"; +import "google/cloud/automl/v1beta1/column_spec.proto"; +import "google/cloud/automl/v1beta1/data_items.proto"; +import "google/cloud/automl/v1beta1/data_stats.proto"; +import "google/cloud/automl/v1beta1/ranges.proto"; +import "google/cloud/automl/v1beta1/regression.proto"; +import "google/cloud/automl/v1beta1/temporal.proto"; +import "google/protobuf/struct.proto"; +import "google/protobuf/timestamp.proto"; + +option go_package = "cloud.google.com/go/automl/apiv1beta1/automlpb;automlpb"; +option java_multiple_files = true; +option java_package = "com.google.cloud.automl.v1beta1"; +option php_namespace = "Google\\Cloud\\AutoMl\\V1beta1"; +option ruby_package = "Google::Cloud::AutoML::V1beta1"; + +// Metadata for a dataset used for AutoML Tables. +message TablesDatasetMetadata { + // Output only. The table_spec_id of the primary table of this dataset. + string primary_table_spec_id = 1; + + // column_spec_id of the primary table's column that should be used as the + // training & prediction target. + // This column must be non-nullable and have one of following data types + // (otherwise model creation will error): + // + // * CATEGORY + // + // * FLOAT64 + // + // If the type is CATEGORY , only up to + // 100 unique values may exist in that column across all rows. + // + // NOTE: Updates of this field will instantly affect any other users + // concurrently working with the dataset. + string target_column_spec_id = 2; + + // column_spec_id of the primary table's column that should be used as the + // weight column, i.e. the higher the value the more important the row will be + // during model training. + // Required type: FLOAT64. + // Allowed values: 0 to 10000, inclusive on both ends; 0 means the row is + // ignored for training. + // If not set all rows are assumed to have equal weight of 1. + // NOTE: Updates of this field will instantly affect any other users + // concurrently working with the dataset. + string weight_column_spec_id = 3; + + // column_spec_id of the primary table column which specifies a possible ML + // use of the row, i.e. the column will be used to split the rows into TRAIN, + // VALIDATE and TEST sets. + // Required type: STRING. + // This column, if set, must either have all of `TRAIN`, `VALIDATE`, `TEST` + // among its values, or only have `TEST`, `UNASSIGNED` values. In the latter + // case the rows with `UNASSIGNED` value will be assigned by AutoML. Note + // that if a given ml use distribution makes it impossible to create a "good" + // model, that call will error describing the issue. + // If both this column_spec_id and primary table's time_column_spec_id are not + // set, then all rows are treated as `UNASSIGNED`. + // NOTE: Updates of this field will instantly affect any other users + // concurrently working with the dataset. + string ml_use_column_spec_id = 4; + + // Output only. Correlations between + // + // [TablesDatasetMetadata.target_column_spec_id][google.cloud.automl.v1beta1.TablesDatasetMetadata.target_column_spec_id], + // and other columns of the + // + // [TablesDatasetMetadataprimary_table][google.cloud.automl.v1beta1.TablesDatasetMetadata.primary_table_spec_id]. + // Only set if the target column is set. Mapping from other column spec id to + // its CorrelationStats with the target column. + // This field may be stale, see the stats_update_time field for + // for the timestamp at which these stats were last updated. + map target_column_correlations = 6; + + // Output only. The most recent timestamp when target_column_correlations + // field and all descendant ColumnSpec.data_stats and + // ColumnSpec.top_correlated_columns fields were last (re-)generated. Any + // changes that happened to the dataset afterwards are not reflected in these + // fields values. The regeneration happens in the background on a best effort + // basis. + google.protobuf.Timestamp stats_update_time = 7; +} + +// Model metadata specific to AutoML Tables. +message TablesModelMetadata { + // Additional optimization objective configuration. Required for + // `MAXIMIZE_PRECISION_AT_RECALL` and `MAXIMIZE_RECALL_AT_PRECISION`, + // otherwise unused. + oneof additional_optimization_objective_config { + // Required when optimization_objective is "MAXIMIZE_PRECISION_AT_RECALL". + // Must be between 0 and 1, inclusive. + float optimization_objective_recall_value = 17; + + // Required when optimization_objective is "MAXIMIZE_RECALL_AT_PRECISION". + // Must be between 0 and 1, inclusive. + float optimization_objective_precision_value = 18; + } + + // Column spec of the dataset's primary table's column the model is + // predicting. Snapshotted when model creation started. + // Only 3 fields are used: + // name - May be set on CreateModel, if it's not then the ColumnSpec + // corresponding to the current target_column_spec_id of the dataset + // the model is trained from is used. + // If neither is set, CreateModel will error. + // display_name - Output only. + // data_type - Output only. + ColumnSpec target_column_spec = 2; + + // Column specs of the dataset's primary table's columns, on which + // the model is trained and which are used as the input for predictions. + // The + // + // [target_column][google.cloud.automl.v1beta1.TablesModelMetadata.target_column_spec] + // as well as, according to dataset's state upon model creation, + // + // [weight_column][google.cloud.automl.v1beta1.TablesDatasetMetadata.weight_column_spec_id], + // and + // + // [ml_use_column][google.cloud.automl.v1beta1.TablesDatasetMetadata.ml_use_column_spec_id] + // must never be included here. + // + // Only 3 fields are used: + // + // * name - May be set on CreateModel, if set only the columns specified are + // used, otherwise all primary table's columns (except the ones listed + // above) are used for the training and prediction input. + // + // * display_name - Output only. + // + // * data_type - Output only. + repeated ColumnSpec input_feature_column_specs = 3; + + // Objective function the model is optimizing towards. The training process + // creates a model that maximizes/minimizes the value of the objective + // function over the validation set. + // + // The supported optimization objectives depend on the prediction type. + // If the field is not set, a default objective function is used. + // + // CLASSIFICATION_BINARY: + // "MAXIMIZE_AU_ROC" (default) - Maximize the area under the receiver + // operating characteristic (ROC) curve. + // "MINIMIZE_LOG_LOSS" - Minimize log loss. + // "MAXIMIZE_AU_PRC" - Maximize the area under the precision-recall curve. + // "MAXIMIZE_PRECISION_AT_RECALL" - Maximize precision for a specified + // recall value. + // "MAXIMIZE_RECALL_AT_PRECISION" - Maximize recall for a specified + // precision value. + // + // CLASSIFICATION_MULTI_CLASS : + // "MINIMIZE_LOG_LOSS" (default) - Minimize log loss. + // + // + // REGRESSION: + // "MINIMIZE_RMSE" (default) - Minimize root-mean-squared error (RMSE). + // "MINIMIZE_MAE" - Minimize mean-absolute error (MAE). + // "MINIMIZE_RMSLE" - Minimize root-mean-squared log error (RMSLE). + string optimization_objective = 4; + + // Output only. Auxiliary information for each of the + // input_feature_column_specs with respect to this particular model. + repeated TablesModelColumnInfo tables_model_column_info = 5; + + // Required. The train budget of creating this model, expressed in milli node + // hours i.e. 1,000 value in this field means 1 node hour. + // + // The training cost of the model will not exceed this budget. The final cost + // will be attempted to be close to the budget, though may end up being (even) + // noticeably smaller - at the backend's discretion. This especially may + // happen when further model training ceases to provide any improvements. + // + // If the budget is set to a value known to be insufficient to train a + // model for the given dataset, the training won't be attempted and + // will error. + // + // The train budget must be between 1,000 and 72,000 milli node hours, + // inclusive. + int64 train_budget_milli_node_hours = 6; + + // Output only. The actual training cost of the model, expressed in milli + // node hours, i.e. 1,000 value in this field means 1 node hour. Guaranteed + // to not exceed the train budget. + int64 train_cost_milli_node_hours = 7; + + // Use the entire training budget. This disables the early stopping feature. + // By default, the early stopping feature is enabled, which means that AutoML + // Tables might stop training before the entire training budget has been used. + bool disable_early_stopping = 12; +} + +// Contains annotation details specific to Tables. +message TablesAnnotation { + // Output only. A confidence estimate between 0.0 and 1.0, inclusive. A higher + // value means greater confidence in the returned value. + // For + // + // [target_column_spec][google.cloud.automl.v1beta1.TablesModelMetadata.target_column_spec] + // of FLOAT64 data type the score is not populated. + float score = 1; + + // Output only. Only populated when + // + // [target_column_spec][google.cloud.automl.v1beta1.TablesModelMetadata.target_column_spec] + // has FLOAT64 data type. An interval in which the exactly correct target + // value has 95% chance to be in. + DoubleRange prediction_interval = 4; + + // The predicted value of the row's + // + // [target_column][google.cloud.automl.v1beta1.TablesModelMetadata.target_column_spec]. + // The value depends on the column's DataType: + // + // * CATEGORY - the predicted (with the above confidence `score`) CATEGORY + // value. + // + // * FLOAT64 - the predicted (with above `prediction_interval`) FLOAT64 value. + google.protobuf.Value value = 2; + + // Output only. Auxiliary information for each of the model's + // + // [input_feature_column_specs][google.cloud.automl.v1beta1.TablesModelMetadata.input_feature_column_specs] + // with respect to this particular prediction. + // If no other fields than + // + // [column_spec_name][google.cloud.automl.v1beta1.TablesModelColumnInfo.column_spec_name] + // and + // + // [column_display_name][google.cloud.automl.v1beta1.TablesModelColumnInfo.column_display_name] + // would be populated, then this whole field is not. + repeated TablesModelColumnInfo tables_model_column_info = 3; + + // Output only. Stores the prediction score for the baseline example, which + // is defined as the example with all values set to their baseline values. + // This is used as part of the Sampled Shapley explanation of the model's + // prediction. This field is populated only when feature importance is + // requested. For regression models, this holds the baseline prediction for + // the baseline example. For classification models, this holds the baseline + // prediction for the baseline example for the argmax class. + float baseline_score = 5; +} + +// An information specific to given column and Tables Model, in context +// of the Model and the predictions created by it. +message TablesModelColumnInfo { + // Output only. The name of the ColumnSpec describing the column. Not + // populated when this proto is outputted to BigQuery. + string column_spec_name = 1; + + // Output only. The display name of the column (same as the display_name of + // its ColumnSpec). + string column_display_name = 2; + + // Output only. When given as part of a Model (always populated): + // Measurement of how much model predictions correctness on the TEST data + // depend on values in this column. A value between 0 and 1, higher means + // higher influence. These values are normalized - for all input feature + // columns of a given model they add to 1. + // + // When given back by Predict (populated iff + // [feature_importance + // param][google.cloud.automl.v1beta1.PredictRequest.params] is set) or Batch + // Predict (populated iff + // [feature_importance][google.cloud.automl.v1beta1.PredictRequest.params] + // param is set): + // Measurement of how impactful for the prediction returned for the given row + // the value in this column was. Specifically, the feature importance + // specifies the marginal contribution that the feature made to the prediction + // score compared to the baseline score. These values are computed using the + // Sampled Shapley method. + float feature_importance = 3; +} diff --git a/packages/google-cloud-automl/protos/google/cloud/automl/v1beta1/temporal.proto b/packages/google-cloud-automl/protos/google/cloud/automl/v1beta1/temporal.proto new file mode 100644 index 00000000000..55bb231d0fc --- /dev/null +++ b/packages/google-cloud-automl/protos/google/cloud/automl/v1beta1/temporal.proto @@ -0,0 +1,36 @@ +// Copyright 2020 Google LLC +// +// Licensed under the Apache License, Version 2.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.automl.v1beta1; + +import "google/protobuf/duration.proto"; + +option go_package = "cloud.google.com/go/automl/apiv1beta1/automlpb;automlpb"; +option java_multiple_files = true; +option java_package = "com.google.cloud.automl.v1beta1"; +option php_namespace = "Google\\Cloud\\AutoMl\\V1beta1"; +option ruby_package = "Google::Cloud::AutoML::V1beta1"; + +// A time period inside of an example that has a time dimension (e.g. video). +message TimeSegment { + // Start of the time segment (inclusive), represented as the duration since + // the example start. + google.protobuf.Duration start_time_offset = 1; + + // End of the time segment (exclusive), represented as the duration since the + // example start. + google.protobuf.Duration end_time_offset = 2; +} diff --git a/packages/google-cloud-automl/protos/google/cloud/automl/v1beta1/text.proto b/packages/google-cloud-automl/protos/google/cloud/automl/v1beta1/text.proto new file mode 100644 index 00000000000..b93376ec338 --- /dev/null +++ b/packages/google-cloud-automl/protos/google/cloud/automl/v1beta1/text.proto @@ -0,0 +1,70 @@ +// Copyright 2020 Google LLC +// +// Licensed under the Apache License, Version 2.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.automl.v1beta1; + +import "google/cloud/automl/v1beta1/classification.proto"; + +option go_package = "cloud.google.com/go/automl/apiv1beta1/automlpb;automlpb"; +option java_multiple_files = true; +option java_outer_classname = "TextProto"; +option java_package = "com.google.cloud.automl.v1beta1"; +option php_namespace = "Google\\Cloud\\AutoMl\\V1beta1"; +option ruby_package = "Google::Cloud::AutoML::V1beta1"; + +// Dataset metadata for classification. +message TextClassificationDatasetMetadata { + // Required. Type of the classification problem. + ClassificationType classification_type = 1; +} + +// Model metadata that is specific to text classification. +message TextClassificationModelMetadata { + // Output only. Classification type of the dataset used to train this model. + ClassificationType classification_type = 3; +} + +// Dataset metadata that is specific to text extraction +message TextExtractionDatasetMetadata { + +} + +// Model metadata that is specific to text extraction. +message TextExtractionModelMetadata { + // Indicates the scope of model use case. + // + // * `default`: Use to train a general text extraction model. Default value. + // + // * `health_care`: Use to train a text extraction model that is tuned for + // healthcare applications. + string model_hint = 3; +} + +// Dataset metadata for text sentiment. +message TextSentimentDatasetMetadata { + // Required. A sentiment is expressed as an integer ordinal, where higher value + // means a more positive sentiment. The range of sentiments that will be used + // is between 0 and sentiment_max (inclusive on both ends), and all the values + // in the range must be represented in the dataset before a model can be + // created. + // sentiment_max value must be between 1 and 10 (inclusive). + int32 sentiment_max = 1; +} + +// Model metadata that is specific to text sentiment. +message TextSentimentModelMetadata { + +} diff --git a/packages/google-cloud-automl/protos/google/cloud/automl/v1beta1/text_extraction.proto b/packages/google-cloud-automl/protos/google/cloud/automl/v1beta1/text_extraction.proto new file mode 100644 index 00000000000..61afd54388d --- /dev/null +++ b/packages/google-cloud-automl/protos/google/cloud/automl/v1beta1/text_extraction.proto @@ -0,0 +1,67 @@ +// Copyright 2020 Google LLC +// +// Licensed under the Apache License, Version 2.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.automl.v1beta1; + +import "google/cloud/automl/v1beta1/text_segment.proto"; + +option go_package = "cloud.google.com/go/automl/apiv1beta1/automlpb;automlpb"; +option java_multiple_files = true; +option java_package = "com.google.cloud.automl.v1beta1"; +option php_namespace = "Google\\Cloud\\AutoMl\\V1beta1"; +option ruby_package = "Google::Cloud::AutoML::V1beta1"; + +// Annotation for identifying spans of text. +message TextExtractionAnnotation { + // Required. Text extraction annotations can either be a text segment or a + // text relation. + oneof annotation { + // An entity annotation will set this, which is the part of the original + // text to which the annotation pertains. + TextSegment text_segment = 3; + } + + // Output only. A confidence estimate between 0.0 and 1.0. A higher value + // means greater confidence in correctness of the annotation. + float score = 1; +} + +// Model evaluation metrics for text extraction problems. +message TextExtractionEvaluationMetrics { + // Metrics for a single confidence threshold. + message ConfidenceMetricsEntry { + // Output only. The confidence threshold value used to compute the metrics. + // Only annotations with score of at least this threshold are considered to + // be ones the model would return. + float confidence_threshold = 1; + + // Output only. Recall under the given confidence threshold. + float recall = 3; + + // Output only. Precision under the given confidence threshold. + float precision = 4; + + // Output only. The harmonic mean of recall and precision. + float f1_score = 5; + } + + // Output only. The Area under precision recall curve metric. + float au_prc = 1; + + // Output only. Metrics that have confidence thresholds. + // Precision-recall curve can be derived from it. + repeated ConfidenceMetricsEntry confidence_metrics_entries = 2; +} diff --git a/packages/google-cloud-automl/protos/google/cloud/automl/v1beta1/text_segment.proto b/packages/google-cloud-automl/protos/google/cloud/automl/v1beta1/text_segment.proto new file mode 100644 index 00000000000..451279c4461 --- /dev/null +++ b/packages/google-cloud-automl/protos/google/cloud/automl/v1beta1/text_segment.proto @@ -0,0 +1,40 @@ +// Copyright 2020 Google LLC +// +// Licensed under the Apache License, Version 2.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.automl.v1beta1; + + +option go_package = "cloud.google.com/go/automl/apiv1beta1/automlpb;automlpb"; +option java_multiple_files = true; +option java_outer_classname = "TextSegmentProto"; +option java_package = "com.google.cloud.automl.v1beta1"; +option php_namespace = "Google\\Cloud\\AutoMl\\V1beta1"; +option ruby_package = "Google::Cloud::AutoML::V1beta1"; + +// A contiguous part of a text (string), assuming it has an UTF-8 NFC encoding. +message TextSegment { + // Output only. The content of the TextSegment. + string content = 3; + + // Required. Zero-based character index of the first character of the text + // segment (counting characters from the beginning of the text). + int64 start_offset = 1; + + // Required. Zero-based character index of the first character past the end of + // the text segment (counting character from the beginning of the text). + // The character at the end_offset is NOT included in the text segment. + int64 end_offset = 2; +} diff --git a/packages/google-cloud-automl/protos/google/cloud/automl/v1beta1/text_sentiment.proto b/packages/google-cloud-automl/protos/google/cloud/automl/v1beta1/text_sentiment.proto new file mode 100644 index 00000000000..a5b2c005e95 --- /dev/null +++ b/packages/google-cloud-automl/protos/google/cloud/automl/v1beta1/text_sentiment.proto @@ -0,0 +1,79 @@ +// Copyright 2020 Google LLC +// +// Licensed under the Apache License, Version 2.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.automl.v1beta1; + +import "google/cloud/automl/v1beta1/classification.proto"; + +option go_package = "cloud.google.com/go/automl/apiv1beta1/automlpb;automlpb"; +option java_outer_classname = "TextSentimentProto"; +option java_package = "com.google.cloud.automl.v1beta1"; +option php_namespace = "Google\\Cloud\\AutoMl\\V1beta1"; +option ruby_package = "Google::Cloud::AutoML::V1beta1"; + +// Contains annotation details specific to text sentiment. +message TextSentimentAnnotation { + // Output only. The sentiment with the semantic, as given to the + // [AutoMl.ImportData][google.cloud.automl.v1beta1.AutoMl.ImportData] when populating the dataset from which the model used + // for the prediction had been trained. + // The sentiment values are between 0 and + // Dataset.text_sentiment_dataset_metadata.sentiment_max (inclusive), + // with higher value meaning more positive sentiment. They are completely + // relative, i.e. 0 means least positive sentiment and sentiment_max means + // the most positive from the sentiments present in the train data. Therefore + // e.g. if train data had only negative sentiment, then sentiment_max, would + // be still negative (although least negative). + // The sentiment shouldn't be confused with "score" or "magnitude" + // from the previous Natural Language Sentiment Analysis API. + int32 sentiment = 1; +} + +// Model evaluation metrics for text sentiment problems. +message TextSentimentEvaluationMetrics { + // Output only. Precision. + float precision = 1; + + // Output only. Recall. + float recall = 2; + + // Output only. The harmonic mean of recall and precision. + float f1_score = 3; + + // Output only. Mean absolute error. Only set for the overall model + // evaluation, not for evaluation of a single annotation spec. + float mean_absolute_error = 4; + + // Output only. Mean squared error. Only set for the overall model + // evaluation, not for evaluation of a single annotation spec. + float mean_squared_error = 5; + + // Output only. Linear weighted kappa. Only set for the overall model + // evaluation, not for evaluation of a single annotation spec. + float linear_kappa = 6; + + // Output only. Quadratic weighted kappa. Only set for the overall model + // evaluation, not for evaluation of a single annotation spec. + float quadratic_kappa = 7; + + // Output only. Confusion matrix of the evaluation. + // Only set for the overall model evaluation, not for evaluation of a single + // annotation spec. + ClassificationEvaluationMetrics.ConfusionMatrix confusion_matrix = 8; + + // Output only. The annotation spec ids used for this evaluation. + // Deprecated . + repeated string annotation_spec_id = 9 [deprecated = true]; +} diff --git a/packages/google-cloud-automl/protos/google/cloud/automl/v1beta1/translation.proto b/packages/google-cloud-automl/protos/google/cloud/automl/v1beta1/translation.proto new file mode 100644 index 00000000000..7aefb42bb82 --- /dev/null +++ b/packages/google-cloud-automl/protos/google/cloud/automl/v1beta1/translation.proto @@ -0,0 +1,68 @@ +// Copyright 2020 Google LLC +// +// Licensed under the Apache License, Version 2.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.automl.v1beta1; + +import "google/api/field_behavior.proto"; +import "google/cloud/automl/v1beta1/data_items.proto"; + +option go_package = "cloud.google.com/go/automl/apiv1beta1/automlpb;automlpb"; +option java_multiple_files = true; +option java_outer_classname = "TranslationProto"; +option java_package = "com.google.cloud.automl.v1beta1"; +option php_namespace = "Google\\Cloud\\AutoMl\\V1beta1"; +option ruby_package = "Google::Cloud::AutoML::V1beta1"; + +// Dataset metadata that is specific to translation. +message TranslationDatasetMetadata { + // Required. The BCP-47 language code of the source language. + string source_language_code = 1 [(google.api.field_behavior) = REQUIRED]; + + // Required. The BCP-47 language code of the target language. + string target_language_code = 2 [(google.api.field_behavior) = REQUIRED]; +} + +// Evaluation metrics for the dataset. +message TranslationEvaluationMetrics { + // Output only. BLEU score. + double bleu_score = 1; + + // Output only. BLEU score for base model. + double base_bleu_score = 2; +} + +// Model metadata that is specific to translation. +message TranslationModelMetadata { + // The resource name of the model to use as a baseline to train the custom + // model. If unset, we use the default base model provided by Google + // Translate. Format: + // `projects/{project_id}/locations/{location_id}/models/{model_id}` + string base_model = 1; + + // Output only. Inferred from the dataset. + // The source languge (The BCP-47 language code) that is used for training. + string source_language_code = 2; + + // Output only. The target languge (The BCP-47 language code) that is used for + // training. + string target_language_code = 3; +} + +// Annotation details specific to translation. +message TranslationAnnotation { + // Output only . The translated content. + TextSnippet translated_content = 1; +} diff --git a/packages/google-cloud-automl/protos/google/cloud/automl/v1beta1/video.proto b/packages/google-cloud-automl/protos/google/cloud/automl/v1beta1/video.proto new file mode 100644 index 00000000000..872adb8045a --- /dev/null +++ b/packages/google-cloud-automl/protos/google/cloud/automl/v1beta1/video.proto @@ -0,0 +1,47 @@ +// Copyright 2020 Google LLC +// +// Licensed under the Apache License, Version 2.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.automl.v1beta1; + +import "google/cloud/automl/v1beta1/classification.proto"; + +option go_package = "cloud.google.com/go/automl/apiv1beta1/automlpb;automlpb"; +option java_multiple_files = true; +option java_outer_classname = "VideoProto"; +option java_package = "com.google.cloud.automl.v1beta1"; +option php_namespace = "Google\\Cloud\\AutoMl\\V1beta1"; +option ruby_package = "Google::Cloud::AutoML::V1beta1"; + +// Dataset metadata specific to video classification. +// All Video Classification datasets are treated as multi label. +message VideoClassificationDatasetMetadata { + +} + +// Dataset metadata specific to video object tracking. +message VideoObjectTrackingDatasetMetadata { + +} + +// Model metadata specific to video classification. +message VideoClassificationModelMetadata { + +} + +// Model metadata specific to video object tracking. +message VideoObjectTrackingModelMetadata { + +} diff --git a/packages/google-cloud-automl/protos/google/cloud/common_resources.proto b/packages/google-cloud-automl/protos/google/cloud/common_resources.proto new file mode 100644 index 00000000000..56c9f800d5e --- /dev/null +++ b/packages/google-cloud-automl/protos/google/cloud/common_resources.proto @@ -0,0 +1,52 @@ +// Copyright 2019 Google LLC. +// +// Licensed under the Apache License, Version 2.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. + +// This file contains stub messages for common resources in GCP. +// It is not intended to be directly generated, and is instead used by +// other tooling to be able to match common resource patterns. +syntax = "proto3"; + +package google.cloud; + +import "google/api/resource.proto"; + + +option (google.api.resource_definition) = { + type: "cloudresourcemanager.googleapis.com/Project" + pattern: "projects/{project}" +}; + + +option (google.api.resource_definition) = { + type: "cloudresourcemanager.googleapis.com/Organization" + pattern: "organizations/{organization}" +}; + + +option (google.api.resource_definition) = { + type: "cloudresourcemanager.googleapis.com/Folder" + pattern: "folders/{folder}" +}; + + +option (google.api.resource_definition) = { + type: "cloudbilling.googleapis.com/BillingAccount" + pattern: "billingAccounts/{billing_account}" +}; + +option (google.api.resource_definition) = { + type: "locations.googleapis.com/Location" + pattern: "projects/{project}/locations/{location}" +}; + diff --git a/packages/google-cloud-automl/protos/protos.d.ts b/packages/google-cloud-automl/protos/protos.d.ts new file mode 100644 index 00000000000..cbf037d1921 --- /dev/null +++ b/packages/google-cloud-automl/protos/protos.d.ts @@ -0,0 +1,32931 @@ +// Copyright 2023 Google LLC +// +// Licensed under the Apache License, Version 2.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 automl. */ + namespace automl { + + /** Namespace v1. */ + namespace v1 { + + /** Properties of an AnnotationPayload. */ + interface IAnnotationPayload { + + /** AnnotationPayload translation */ + translation?: (google.cloud.automl.v1.ITranslationAnnotation|null); + + /** AnnotationPayload classification */ + classification?: (google.cloud.automl.v1.IClassificationAnnotation|null); + + /** AnnotationPayload imageObjectDetection */ + imageObjectDetection?: (google.cloud.automl.v1.IImageObjectDetectionAnnotation|null); + + /** AnnotationPayload textExtraction */ + textExtraction?: (google.cloud.automl.v1.ITextExtractionAnnotation|null); + + /** AnnotationPayload textSentiment */ + textSentiment?: (google.cloud.automl.v1.ITextSentimentAnnotation|null); + + /** AnnotationPayload annotationSpecId */ + annotationSpecId?: (string|null); + + /** AnnotationPayload displayName */ + displayName?: (string|null); + } + + /** Represents an AnnotationPayload. */ + class AnnotationPayload implements IAnnotationPayload { + + /** + * Constructs a new AnnotationPayload. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.automl.v1.IAnnotationPayload); + + /** AnnotationPayload translation. */ + public translation?: (google.cloud.automl.v1.ITranslationAnnotation|null); + + /** AnnotationPayload classification. */ + public classification?: (google.cloud.automl.v1.IClassificationAnnotation|null); + + /** AnnotationPayload imageObjectDetection. */ + public imageObjectDetection?: (google.cloud.automl.v1.IImageObjectDetectionAnnotation|null); + + /** AnnotationPayload textExtraction. */ + public textExtraction?: (google.cloud.automl.v1.ITextExtractionAnnotation|null); + + /** AnnotationPayload textSentiment. */ + public textSentiment?: (google.cloud.automl.v1.ITextSentimentAnnotation|null); + + /** AnnotationPayload annotationSpecId. */ + public annotationSpecId: string; + + /** AnnotationPayload displayName. */ + public displayName: string; + + /** AnnotationPayload detail. */ + public detail?: ("translation"|"classification"|"imageObjectDetection"|"textExtraction"|"textSentiment"); + + /** + * Creates a new AnnotationPayload instance using the specified properties. + * @param [properties] Properties to set + * @returns AnnotationPayload instance + */ + public static create(properties?: google.cloud.automl.v1.IAnnotationPayload): google.cloud.automl.v1.AnnotationPayload; + + /** + * Encodes the specified AnnotationPayload message. Does not implicitly {@link google.cloud.automl.v1.AnnotationPayload.verify|verify} messages. + * @param message AnnotationPayload message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.automl.v1.IAnnotationPayload, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified AnnotationPayload message, length delimited. Does not implicitly {@link google.cloud.automl.v1.AnnotationPayload.verify|verify} messages. + * @param message AnnotationPayload message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.automl.v1.IAnnotationPayload, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an AnnotationPayload message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns AnnotationPayload + * @throws {Error} If the payload is not 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.automl.v1.AnnotationPayload; + + /** + * Decodes an AnnotationPayload message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns AnnotationPayload + * @throws {Error} If the payload 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.automl.v1.AnnotationPayload; + + /** + * Verifies an AnnotationPayload message. + * @param message Plain 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 AnnotationPayload message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns AnnotationPayload + */ + public static fromObject(object: { [k: string]: any }): google.cloud.automl.v1.AnnotationPayload; + + /** + * Creates a plain object from an AnnotationPayload message. Also converts values to other types if specified. + * @param message AnnotationPayload + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.automl.v1.AnnotationPayload, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this AnnotationPayload to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for AnnotationPayload + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** ClassificationType enum. */ + enum ClassificationType { + CLASSIFICATION_TYPE_UNSPECIFIED = 0, + MULTICLASS = 1, + MULTILABEL = 2 + } + + /** Properties of a ClassificationAnnotation. */ + interface IClassificationAnnotation { + + /** ClassificationAnnotation score */ + score?: (number|null); + } + + /** Represents a ClassificationAnnotation. */ + class ClassificationAnnotation implements IClassificationAnnotation { + + /** + * Constructs a new ClassificationAnnotation. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.automl.v1.IClassificationAnnotation); + + /** ClassificationAnnotation score. */ + public score: number; + + /** + * Creates a new ClassificationAnnotation instance using the specified properties. + * @param [properties] Properties to set + * @returns ClassificationAnnotation instance + */ + public static create(properties?: google.cloud.automl.v1.IClassificationAnnotation): google.cloud.automl.v1.ClassificationAnnotation; + + /** + * Encodes the specified ClassificationAnnotation message. Does not implicitly {@link google.cloud.automl.v1.ClassificationAnnotation.verify|verify} messages. + * @param message ClassificationAnnotation message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.automl.v1.IClassificationAnnotation, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ClassificationAnnotation message, length delimited. Does not implicitly {@link google.cloud.automl.v1.ClassificationAnnotation.verify|verify} messages. + * @param message ClassificationAnnotation message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.automl.v1.IClassificationAnnotation, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ClassificationAnnotation message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ClassificationAnnotation + * @throws {Error} If the payload is not 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.automl.v1.ClassificationAnnotation; + + /** + * Decodes a ClassificationAnnotation message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ClassificationAnnotation + * @throws {Error} If the payload 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.automl.v1.ClassificationAnnotation; + + /** + * Verifies a ClassificationAnnotation message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ClassificationAnnotation message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ClassificationAnnotation + */ + public static fromObject(object: { [k: string]: any }): google.cloud.automl.v1.ClassificationAnnotation; + + /** + * Creates a plain object from a ClassificationAnnotation message. Also converts values to other types if specified. + * @param message ClassificationAnnotation + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.automl.v1.ClassificationAnnotation, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ClassificationAnnotation to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ClassificationAnnotation + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ClassificationEvaluationMetrics. */ + interface IClassificationEvaluationMetrics { + + /** ClassificationEvaluationMetrics auPrc */ + auPrc?: (number|null); + + /** ClassificationEvaluationMetrics auRoc */ + auRoc?: (number|null); + + /** ClassificationEvaluationMetrics logLoss */ + logLoss?: (number|null); + + /** ClassificationEvaluationMetrics confidenceMetricsEntry */ + confidenceMetricsEntry?: (google.cloud.automl.v1.ClassificationEvaluationMetrics.IConfidenceMetricsEntry[]|null); + + /** ClassificationEvaluationMetrics confusionMatrix */ + confusionMatrix?: (google.cloud.automl.v1.ClassificationEvaluationMetrics.IConfusionMatrix|null); + + /** ClassificationEvaluationMetrics annotationSpecId */ + annotationSpecId?: (string[]|null); + } + + /** Represents a ClassificationEvaluationMetrics. */ + class ClassificationEvaluationMetrics implements IClassificationEvaluationMetrics { + + /** + * Constructs a new ClassificationEvaluationMetrics. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.automl.v1.IClassificationEvaluationMetrics); + + /** ClassificationEvaluationMetrics auPrc. */ + public auPrc: number; + + /** ClassificationEvaluationMetrics auRoc. */ + public auRoc: number; + + /** ClassificationEvaluationMetrics logLoss. */ + public logLoss: number; + + /** ClassificationEvaluationMetrics confidenceMetricsEntry. */ + public confidenceMetricsEntry: google.cloud.automl.v1.ClassificationEvaluationMetrics.IConfidenceMetricsEntry[]; + + /** ClassificationEvaluationMetrics confusionMatrix. */ + public confusionMatrix?: (google.cloud.automl.v1.ClassificationEvaluationMetrics.IConfusionMatrix|null); + + /** ClassificationEvaluationMetrics annotationSpecId. */ + public annotationSpecId: string[]; + + /** + * Creates a new ClassificationEvaluationMetrics instance using the specified properties. + * @param [properties] Properties to set + * @returns ClassificationEvaluationMetrics instance + */ + public static create(properties?: google.cloud.automl.v1.IClassificationEvaluationMetrics): google.cloud.automl.v1.ClassificationEvaluationMetrics; + + /** + * Encodes the specified ClassificationEvaluationMetrics message. Does not implicitly {@link google.cloud.automl.v1.ClassificationEvaluationMetrics.verify|verify} messages. + * @param message ClassificationEvaluationMetrics message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.automl.v1.IClassificationEvaluationMetrics, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ClassificationEvaluationMetrics message, length delimited. Does not implicitly {@link google.cloud.automl.v1.ClassificationEvaluationMetrics.verify|verify} messages. + * @param message ClassificationEvaluationMetrics message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.automl.v1.IClassificationEvaluationMetrics, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ClassificationEvaluationMetrics message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ClassificationEvaluationMetrics + * @throws {Error} If the payload is not 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.automl.v1.ClassificationEvaluationMetrics; + + /** + * Decodes a ClassificationEvaluationMetrics message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ClassificationEvaluationMetrics + * @throws {Error} If the payload 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.automl.v1.ClassificationEvaluationMetrics; + + /** + * Verifies a ClassificationEvaluationMetrics message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ClassificationEvaluationMetrics message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ClassificationEvaluationMetrics + */ + public static fromObject(object: { [k: string]: any }): google.cloud.automl.v1.ClassificationEvaluationMetrics; + + /** + * Creates a plain object from a ClassificationEvaluationMetrics message. Also converts values to other types if specified. + * @param message ClassificationEvaluationMetrics + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.automl.v1.ClassificationEvaluationMetrics, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ClassificationEvaluationMetrics to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ClassificationEvaluationMetrics + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace ClassificationEvaluationMetrics { + + /** Properties of a ConfidenceMetricsEntry. */ + interface IConfidenceMetricsEntry { + + /** ConfidenceMetricsEntry confidenceThreshold */ + confidenceThreshold?: (number|null); + + /** ConfidenceMetricsEntry positionThreshold */ + positionThreshold?: (number|null); + + /** ConfidenceMetricsEntry recall */ + recall?: (number|null); + + /** ConfidenceMetricsEntry precision */ + precision?: (number|null); + + /** ConfidenceMetricsEntry falsePositiveRate */ + falsePositiveRate?: (number|null); + + /** ConfidenceMetricsEntry f1Score */ + f1Score?: (number|null); + + /** ConfidenceMetricsEntry recallAt1 */ + recallAt1?: (number|null); + + /** ConfidenceMetricsEntry precisionAt1 */ + precisionAt1?: (number|null); + + /** ConfidenceMetricsEntry falsePositiveRateAt1 */ + falsePositiveRateAt1?: (number|null); + + /** ConfidenceMetricsEntry f1ScoreAt1 */ + f1ScoreAt1?: (number|null); + + /** ConfidenceMetricsEntry truePositiveCount */ + truePositiveCount?: (number|Long|string|null); + + /** ConfidenceMetricsEntry falsePositiveCount */ + falsePositiveCount?: (number|Long|string|null); + + /** ConfidenceMetricsEntry falseNegativeCount */ + falseNegativeCount?: (number|Long|string|null); + + /** ConfidenceMetricsEntry trueNegativeCount */ + trueNegativeCount?: (number|Long|string|null); + } + + /** Represents a ConfidenceMetricsEntry. */ + class ConfidenceMetricsEntry implements IConfidenceMetricsEntry { + + /** + * Constructs a new ConfidenceMetricsEntry. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.automl.v1.ClassificationEvaluationMetrics.IConfidenceMetricsEntry); + + /** ConfidenceMetricsEntry confidenceThreshold. */ + public confidenceThreshold: number; + + /** ConfidenceMetricsEntry positionThreshold. */ + public positionThreshold: number; + + /** ConfidenceMetricsEntry recall. */ + public recall: number; + + /** ConfidenceMetricsEntry precision. */ + public precision: number; + + /** ConfidenceMetricsEntry falsePositiveRate. */ + public falsePositiveRate: number; + + /** ConfidenceMetricsEntry f1Score. */ + public f1Score: number; + + /** ConfidenceMetricsEntry recallAt1. */ + public recallAt1: number; + + /** ConfidenceMetricsEntry precisionAt1. */ + public precisionAt1: number; + + /** ConfidenceMetricsEntry falsePositiveRateAt1. */ + public falsePositiveRateAt1: number; + + /** ConfidenceMetricsEntry f1ScoreAt1. */ + public f1ScoreAt1: number; + + /** ConfidenceMetricsEntry truePositiveCount. */ + public truePositiveCount: (number|Long|string); + + /** ConfidenceMetricsEntry falsePositiveCount. */ + public falsePositiveCount: (number|Long|string); + + /** ConfidenceMetricsEntry falseNegativeCount. */ + public falseNegativeCount: (number|Long|string); + + /** ConfidenceMetricsEntry trueNegativeCount. */ + public trueNegativeCount: (number|Long|string); + + /** + * Creates a new ConfidenceMetricsEntry instance using the specified properties. + * @param [properties] Properties to set + * @returns ConfidenceMetricsEntry instance + */ + public static create(properties?: google.cloud.automl.v1.ClassificationEvaluationMetrics.IConfidenceMetricsEntry): google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfidenceMetricsEntry; + + /** + * Encodes the specified ConfidenceMetricsEntry message. Does not implicitly {@link google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfidenceMetricsEntry.verify|verify} messages. + * @param message ConfidenceMetricsEntry message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.automl.v1.ClassificationEvaluationMetrics.IConfidenceMetricsEntry, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ConfidenceMetricsEntry message, length delimited. Does not implicitly {@link google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfidenceMetricsEntry.verify|verify} messages. + * @param message ConfidenceMetricsEntry message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.automl.v1.ClassificationEvaluationMetrics.IConfidenceMetricsEntry, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ConfidenceMetricsEntry message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ConfidenceMetricsEntry + * @throws {Error} If the payload is not 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.automl.v1.ClassificationEvaluationMetrics.ConfidenceMetricsEntry; + + /** + * Decodes a ConfidenceMetricsEntry message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ConfidenceMetricsEntry + * @throws {Error} If the payload 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.automl.v1.ClassificationEvaluationMetrics.ConfidenceMetricsEntry; + + /** + * Verifies a ConfidenceMetricsEntry message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ConfidenceMetricsEntry message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ConfidenceMetricsEntry + */ + public static fromObject(object: { [k: string]: any }): google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfidenceMetricsEntry; + + /** + * Creates a plain object from a ConfidenceMetricsEntry message. Also converts values to other types if specified. + * @param message ConfidenceMetricsEntry + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfidenceMetricsEntry, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ConfidenceMetricsEntry to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ConfidenceMetricsEntry + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ConfusionMatrix. */ + interface IConfusionMatrix { + + /** ConfusionMatrix annotationSpecId */ + annotationSpecId?: (string[]|null); + + /** ConfusionMatrix displayName */ + displayName?: (string[]|null); + + /** ConfusionMatrix row */ + row?: (google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfusionMatrix.IRow[]|null); + } + + /** Represents a ConfusionMatrix. */ + class ConfusionMatrix implements IConfusionMatrix { + + /** + * Constructs a new ConfusionMatrix. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.automl.v1.ClassificationEvaluationMetrics.IConfusionMatrix); + + /** ConfusionMatrix annotationSpecId. */ + public annotationSpecId: string[]; + + /** ConfusionMatrix displayName. */ + public displayName: string[]; + + /** ConfusionMatrix row. */ + public row: google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfusionMatrix.IRow[]; + + /** + * Creates a new ConfusionMatrix instance using the specified properties. + * @param [properties] Properties to set + * @returns ConfusionMatrix instance + */ + public static create(properties?: google.cloud.automl.v1.ClassificationEvaluationMetrics.IConfusionMatrix): google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfusionMatrix; + + /** + * Encodes the specified ConfusionMatrix message. Does not implicitly {@link google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfusionMatrix.verify|verify} messages. + * @param message ConfusionMatrix message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.automl.v1.ClassificationEvaluationMetrics.IConfusionMatrix, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ConfusionMatrix message, length delimited. Does not implicitly {@link google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfusionMatrix.verify|verify} messages. + * @param message ConfusionMatrix message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.automl.v1.ClassificationEvaluationMetrics.IConfusionMatrix, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ConfusionMatrix message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ConfusionMatrix + * @throws {Error} If the payload is not 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.automl.v1.ClassificationEvaluationMetrics.ConfusionMatrix; + + /** + * Decodes a ConfusionMatrix message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ConfusionMatrix + * @throws {Error} If the payload 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.automl.v1.ClassificationEvaluationMetrics.ConfusionMatrix; + + /** + * Verifies a ConfusionMatrix message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ConfusionMatrix message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ConfusionMatrix + */ + public static fromObject(object: { [k: string]: any }): google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfusionMatrix; + + /** + * Creates a plain object from a ConfusionMatrix message. Also converts values to other types if specified. + * @param message ConfusionMatrix + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfusionMatrix, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ConfusionMatrix to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ConfusionMatrix + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace ConfusionMatrix { + + /** Properties of a Row. */ + interface IRow { + + /** Row exampleCount */ + exampleCount?: (number[]|null); + } + + /** Represents a Row. */ + class Row implements IRow { + + /** + * Constructs a new Row. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfusionMatrix.IRow); + + /** Row exampleCount. */ + public exampleCount: number[]; + + /** + * Creates a new Row instance using the specified properties. + * @param [properties] Properties to set + * @returns Row instance + */ + public static create(properties?: google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfusionMatrix.IRow): google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfusionMatrix.Row; + + /** + * Encodes the specified Row message. Does not implicitly {@link google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfusionMatrix.Row.verify|verify} messages. + * @param message Row message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfusionMatrix.IRow, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Row message, length delimited. Does not implicitly {@link google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfusionMatrix.Row.verify|verify} messages. + * @param message Row message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfusionMatrix.IRow, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Row message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Row + * @throws {Error} If the payload is not 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.automl.v1.ClassificationEvaluationMetrics.ConfusionMatrix.Row; + + /** + * Decodes a Row message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Row + * @throws {Error} If the payload 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.automl.v1.ClassificationEvaluationMetrics.ConfusionMatrix.Row; + + /** + * Verifies a Row message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Row message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Row + */ + public static fromObject(object: { [k: string]: any }): google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfusionMatrix.Row; + + /** + * Creates a plain object from a Row message. Also converts values to other types if specified. + * @param message Row + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfusionMatrix.Row, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Row to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Row + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + } + + /** Properties of an ImageObjectDetectionAnnotation. */ + interface IImageObjectDetectionAnnotation { + + /** ImageObjectDetectionAnnotation boundingBox */ + boundingBox?: (google.cloud.automl.v1.IBoundingPoly|null); + + /** ImageObjectDetectionAnnotation score */ + score?: (number|null); + } + + /** Represents an ImageObjectDetectionAnnotation. */ + class ImageObjectDetectionAnnotation implements IImageObjectDetectionAnnotation { + + /** + * Constructs a new ImageObjectDetectionAnnotation. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.automl.v1.IImageObjectDetectionAnnotation); + + /** ImageObjectDetectionAnnotation boundingBox. */ + public boundingBox?: (google.cloud.automl.v1.IBoundingPoly|null); + + /** ImageObjectDetectionAnnotation score. */ + public score: number; + + /** + * Creates a new ImageObjectDetectionAnnotation instance using the specified properties. + * @param [properties] Properties to set + * @returns ImageObjectDetectionAnnotation instance + */ + public static create(properties?: google.cloud.automl.v1.IImageObjectDetectionAnnotation): google.cloud.automl.v1.ImageObjectDetectionAnnotation; + + /** + * Encodes the specified ImageObjectDetectionAnnotation message. Does not implicitly {@link google.cloud.automl.v1.ImageObjectDetectionAnnotation.verify|verify} messages. + * @param message ImageObjectDetectionAnnotation message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.automl.v1.IImageObjectDetectionAnnotation, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ImageObjectDetectionAnnotation message, length delimited. Does not implicitly {@link google.cloud.automl.v1.ImageObjectDetectionAnnotation.verify|verify} messages. + * @param message ImageObjectDetectionAnnotation message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.automl.v1.IImageObjectDetectionAnnotation, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an ImageObjectDetectionAnnotation message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ImageObjectDetectionAnnotation + * @throws {Error} If the payload is not 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.automl.v1.ImageObjectDetectionAnnotation; + + /** + * Decodes an ImageObjectDetectionAnnotation message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ImageObjectDetectionAnnotation + * @throws {Error} If the payload 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.automl.v1.ImageObjectDetectionAnnotation; + + /** + * Verifies an ImageObjectDetectionAnnotation message. + * @param message Plain 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 ImageObjectDetectionAnnotation message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ImageObjectDetectionAnnotation + */ + public static fromObject(object: { [k: string]: any }): google.cloud.automl.v1.ImageObjectDetectionAnnotation; + + /** + * Creates a plain object from an ImageObjectDetectionAnnotation message. Also converts values to other types if specified. + * @param message ImageObjectDetectionAnnotation + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.automl.v1.ImageObjectDetectionAnnotation, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ImageObjectDetectionAnnotation to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ImageObjectDetectionAnnotation + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a BoundingBoxMetricsEntry. */ + interface IBoundingBoxMetricsEntry { + + /** BoundingBoxMetricsEntry iouThreshold */ + iouThreshold?: (number|null); + + /** BoundingBoxMetricsEntry meanAveragePrecision */ + meanAveragePrecision?: (number|null); + + /** BoundingBoxMetricsEntry confidenceMetricsEntries */ + confidenceMetricsEntries?: (google.cloud.automl.v1.BoundingBoxMetricsEntry.IConfidenceMetricsEntry[]|null); + } + + /** Represents a BoundingBoxMetricsEntry. */ + class BoundingBoxMetricsEntry implements IBoundingBoxMetricsEntry { + + /** + * Constructs a new BoundingBoxMetricsEntry. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.automl.v1.IBoundingBoxMetricsEntry); + + /** BoundingBoxMetricsEntry iouThreshold. */ + public iouThreshold: number; + + /** BoundingBoxMetricsEntry meanAveragePrecision. */ + public meanAveragePrecision: number; + + /** BoundingBoxMetricsEntry confidenceMetricsEntries. */ + public confidenceMetricsEntries: google.cloud.automl.v1.BoundingBoxMetricsEntry.IConfidenceMetricsEntry[]; + + /** + * Creates a new BoundingBoxMetricsEntry instance using the specified properties. + * @param [properties] Properties to set + * @returns BoundingBoxMetricsEntry instance + */ + public static create(properties?: google.cloud.automl.v1.IBoundingBoxMetricsEntry): google.cloud.automl.v1.BoundingBoxMetricsEntry; + + /** + * Encodes the specified BoundingBoxMetricsEntry message. Does not implicitly {@link google.cloud.automl.v1.BoundingBoxMetricsEntry.verify|verify} messages. + * @param message BoundingBoxMetricsEntry message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.automl.v1.IBoundingBoxMetricsEntry, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified BoundingBoxMetricsEntry message, length delimited. Does not implicitly {@link google.cloud.automl.v1.BoundingBoxMetricsEntry.verify|verify} messages. + * @param message BoundingBoxMetricsEntry message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.automl.v1.IBoundingBoxMetricsEntry, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a BoundingBoxMetricsEntry message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns BoundingBoxMetricsEntry + * @throws {Error} If the payload is not 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.automl.v1.BoundingBoxMetricsEntry; + + /** + * Decodes a BoundingBoxMetricsEntry message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns BoundingBoxMetricsEntry + * @throws {Error} If the payload 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.automl.v1.BoundingBoxMetricsEntry; + + /** + * Verifies a BoundingBoxMetricsEntry message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a BoundingBoxMetricsEntry message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns BoundingBoxMetricsEntry + */ + public static fromObject(object: { [k: string]: any }): google.cloud.automl.v1.BoundingBoxMetricsEntry; + + /** + * Creates a plain object from a BoundingBoxMetricsEntry message. Also converts values to other types if specified. + * @param message BoundingBoxMetricsEntry + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.automl.v1.BoundingBoxMetricsEntry, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this BoundingBoxMetricsEntry to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for BoundingBoxMetricsEntry + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace BoundingBoxMetricsEntry { + + /** Properties of a ConfidenceMetricsEntry. */ + interface IConfidenceMetricsEntry { + + /** ConfidenceMetricsEntry confidenceThreshold */ + confidenceThreshold?: (number|null); + + /** ConfidenceMetricsEntry recall */ + recall?: (number|null); + + /** ConfidenceMetricsEntry precision */ + precision?: (number|null); + + /** ConfidenceMetricsEntry f1Score */ + f1Score?: (number|null); + } + + /** Represents a ConfidenceMetricsEntry. */ + class ConfidenceMetricsEntry implements IConfidenceMetricsEntry { + + /** + * Constructs a new ConfidenceMetricsEntry. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.automl.v1.BoundingBoxMetricsEntry.IConfidenceMetricsEntry); + + /** ConfidenceMetricsEntry confidenceThreshold. */ + public confidenceThreshold: number; + + /** ConfidenceMetricsEntry recall. */ + public recall: number; + + /** ConfidenceMetricsEntry precision. */ + public precision: number; + + /** ConfidenceMetricsEntry f1Score. */ + public f1Score: number; + + /** + * Creates a new ConfidenceMetricsEntry instance using the specified properties. + * @param [properties] Properties to set + * @returns ConfidenceMetricsEntry instance + */ + public static create(properties?: google.cloud.automl.v1.BoundingBoxMetricsEntry.IConfidenceMetricsEntry): google.cloud.automl.v1.BoundingBoxMetricsEntry.ConfidenceMetricsEntry; + + /** + * Encodes the specified ConfidenceMetricsEntry message. Does not implicitly {@link google.cloud.automl.v1.BoundingBoxMetricsEntry.ConfidenceMetricsEntry.verify|verify} messages. + * @param message ConfidenceMetricsEntry message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.automl.v1.BoundingBoxMetricsEntry.IConfidenceMetricsEntry, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ConfidenceMetricsEntry message, length delimited. Does not implicitly {@link google.cloud.automl.v1.BoundingBoxMetricsEntry.ConfidenceMetricsEntry.verify|verify} messages. + * @param message ConfidenceMetricsEntry message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.automl.v1.BoundingBoxMetricsEntry.IConfidenceMetricsEntry, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ConfidenceMetricsEntry message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ConfidenceMetricsEntry + * @throws {Error} If the payload is not 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.automl.v1.BoundingBoxMetricsEntry.ConfidenceMetricsEntry; + + /** + * Decodes a ConfidenceMetricsEntry message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ConfidenceMetricsEntry + * @throws {Error} If the payload 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.automl.v1.BoundingBoxMetricsEntry.ConfidenceMetricsEntry; + + /** + * Verifies a ConfidenceMetricsEntry message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ConfidenceMetricsEntry message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ConfidenceMetricsEntry + */ + public static fromObject(object: { [k: string]: any }): google.cloud.automl.v1.BoundingBoxMetricsEntry.ConfidenceMetricsEntry; + + /** + * Creates a plain object from a ConfidenceMetricsEntry message. Also converts values to other types if specified. + * @param message ConfidenceMetricsEntry + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.automl.v1.BoundingBoxMetricsEntry.ConfidenceMetricsEntry, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ConfidenceMetricsEntry to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ConfidenceMetricsEntry + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Properties of an ImageObjectDetectionEvaluationMetrics. */ + interface IImageObjectDetectionEvaluationMetrics { + + /** ImageObjectDetectionEvaluationMetrics evaluatedBoundingBoxCount */ + evaluatedBoundingBoxCount?: (number|null); + + /** ImageObjectDetectionEvaluationMetrics boundingBoxMetricsEntries */ + boundingBoxMetricsEntries?: (google.cloud.automl.v1.IBoundingBoxMetricsEntry[]|null); + + /** ImageObjectDetectionEvaluationMetrics boundingBoxMeanAveragePrecision */ + boundingBoxMeanAveragePrecision?: (number|null); + } + + /** Represents an ImageObjectDetectionEvaluationMetrics. */ + class ImageObjectDetectionEvaluationMetrics implements IImageObjectDetectionEvaluationMetrics { + + /** + * Constructs a new ImageObjectDetectionEvaluationMetrics. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.automl.v1.IImageObjectDetectionEvaluationMetrics); + + /** ImageObjectDetectionEvaluationMetrics evaluatedBoundingBoxCount. */ + public evaluatedBoundingBoxCount: number; + + /** ImageObjectDetectionEvaluationMetrics boundingBoxMetricsEntries. */ + public boundingBoxMetricsEntries: google.cloud.automl.v1.IBoundingBoxMetricsEntry[]; + + /** ImageObjectDetectionEvaluationMetrics boundingBoxMeanAveragePrecision. */ + public boundingBoxMeanAveragePrecision: number; + + /** + * Creates a new ImageObjectDetectionEvaluationMetrics instance using the specified properties. + * @param [properties] Properties to set + * @returns ImageObjectDetectionEvaluationMetrics instance + */ + public static create(properties?: google.cloud.automl.v1.IImageObjectDetectionEvaluationMetrics): google.cloud.automl.v1.ImageObjectDetectionEvaluationMetrics; + + /** + * Encodes the specified ImageObjectDetectionEvaluationMetrics message. Does not implicitly {@link google.cloud.automl.v1.ImageObjectDetectionEvaluationMetrics.verify|verify} messages. + * @param message ImageObjectDetectionEvaluationMetrics message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.automl.v1.IImageObjectDetectionEvaluationMetrics, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ImageObjectDetectionEvaluationMetrics message, length delimited. Does not implicitly {@link google.cloud.automl.v1.ImageObjectDetectionEvaluationMetrics.verify|verify} messages. + * @param message ImageObjectDetectionEvaluationMetrics message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.automl.v1.IImageObjectDetectionEvaluationMetrics, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an ImageObjectDetectionEvaluationMetrics message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ImageObjectDetectionEvaluationMetrics + * @throws {Error} If the payload is not 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.automl.v1.ImageObjectDetectionEvaluationMetrics; + + /** + * Decodes an ImageObjectDetectionEvaluationMetrics message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ImageObjectDetectionEvaluationMetrics + * @throws {Error} If the payload 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.automl.v1.ImageObjectDetectionEvaluationMetrics; + + /** + * Verifies an ImageObjectDetectionEvaluationMetrics message. + * @param message Plain 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 ImageObjectDetectionEvaluationMetrics message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ImageObjectDetectionEvaluationMetrics + */ + public static fromObject(object: { [k: string]: any }): google.cloud.automl.v1.ImageObjectDetectionEvaluationMetrics; + + /** + * Creates a plain object from an ImageObjectDetectionEvaluationMetrics message. Also converts values to other types if specified. + * @param message ImageObjectDetectionEvaluationMetrics + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.automl.v1.ImageObjectDetectionEvaluationMetrics, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ImageObjectDetectionEvaluationMetrics to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ImageObjectDetectionEvaluationMetrics + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a NormalizedVertex. */ + interface INormalizedVertex { + + /** NormalizedVertex x */ + x?: (number|null); + + /** NormalizedVertex y */ + y?: (number|null); + } + + /** Represents a NormalizedVertex. */ + class NormalizedVertex implements INormalizedVertex { + + /** + * Constructs a new NormalizedVertex. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.automl.v1.INormalizedVertex); + + /** NormalizedVertex x. */ + public x: number; + + /** NormalizedVertex y. */ + public y: number; + + /** + * Creates a new NormalizedVertex instance using the specified properties. + * @param [properties] Properties to set + * @returns NormalizedVertex instance + */ + public static create(properties?: google.cloud.automl.v1.INormalizedVertex): google.cloud.automl.v1.NormalizedVertex; + + /** + * Encodes the specified NormalizedVertex message. Does not implicitly {@link google.cloud.automl.v1.NormalizedVertex.verify|verify} messages. + * @param message NormalizedVertex message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.automl.v1.INormalizedVertex, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified NormalizedVertex message, length delimited. Does not implicitly {@link google.cloud.automl.v1.NormalizedVertex.verify|verify} messages. + * @param message NormalizedVertex message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.automl.v1.INormalizedVertex, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a NormalizedVertex message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns NormalizedVertex + * @throws {Error} If the payload is not 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.automl.v1.NormalizedVertex; + + /** + * Decodes a NormalizedVertex message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns NormalizedVertex + * @throws {Error} If the payload 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.automl.v1.NormalizedVertex; + + /** + * Verifies a NormalizedVertex message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a NormalizedVertex message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns NormalizedVertex + */ + public static fromObject(object: { [k: string]: any }): google.cloud.automl.v1.NormalizedVertex; + + /** + * Creates a plain object from a NormalizedVertex message. Also converts values to other types if specified. + * @param message NormalizedVertex + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.automl.v1.NormalizedVertex, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this NormalizedVertex to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for NormalizedVertex + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a BoundingPoly. */ + interface IBoundingPoly { + + /** BoundingPoly normalizedVertices */ + normalizedVertices?: (google.cloud.automl.v1.INormalizedVertex[]|null); + } + + /** Represents a BoundingPoly. */ + class BoundingPoly implements IBoundingPoly { + + /** + * Constructs a new BoundingPoly. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.automl.v1.IBoundingPoly); + + /** BoundingPoly normalizedVertices. */ + public normalizedVertices: google.cloud.automl.v1.INormalizedVertex[]; + + /** + * Creates a new BoundingPoly instance using the specified properties. + * @param [properties] Properties to set + * @returns BoundingPoly instance + */ + public static create(properties?: google.cloud.automl.v1.IBoundingPoly): google.cloud.automl.v1.BoundingPoly; + + /** + * Encodes the specified BoundingPoly message. Does not implicitly {@link google.cloud.automl.v1.BoundingPoly.verify|verify} messages. + * @param message BoundingPoly message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.automl.v1.IBoundingPoly, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified BoundingPoly message, length delimited. Does not implicitly {@link google.cloud.automl.v1.BoundingPoly.verify|verify} messages. + * @param message BoundingPoly message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.automl.v1.IBoundingPoly, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a BoundingPoly message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns BoundingPoly + * @throws {Error} If the payload is not 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.automl.v1.BoundingPoly; + + /** + * Decodes a BoundingPoly message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns BoundingPoly + * @throws {Error} If the payload 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.automl.v1.BoundingPoly; + + /** + * Verifies a BoundingPoly message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a BoundingPoly message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns BoundingPoly + */ + public static fromObject(object: { [k: string]: any }): google.cloud.automl.v1.BoundingPoly; + + /** + * Creates a plain object from a BoundingPoly message. Also converts values to other types if specified. + * @param message BoundingPoly + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.automl.v1.BoundingPoly, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this BoundingPoly to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for BoundingPoly + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TextExtractionAnnotation. */ + interface ITextExtractionAnnotation { + + /** TextExtractionAnnotation textSegment */ + textSegment?: (google.cloud.automl.v1.ITextSegment|null); + + /** TextExtractionAnnotation score */ + score?: (number|null); + } + + /** Represents a TextExtractionAnnotation. */ + class TextExtractionAnnotation implements ITextExtractionAnnotation { + + /** + * Constructs a new TextExtractionAnnotation. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.automl.v1.ITextExtractionAnnotation); + + /** TextExtractionAnnotation textSegment. */ + public textSegment?: (google.cloud.automl.v1.ITextSegment|null); + + /** TextExtractionAnnotation score. */ + public score: number; + + /** TextExtractionAnnotation annotation. */ + public annotation?: "textSegment"; + + /** + * Creates a new TextExtractionAnnotation instance using the specified properties. + * @param [properties] Properties to set + * @returns TextExtractionAnnotation instance + */ + public static create(properties?: google.cloud.automl.v1.ITextExtractionAnnotation): google.cloud.automl.v1.TextExtractionAnnotation; + + /** + * Encodes the specified TextExtractionAnnotation message. Does not implicitly {@link google.cloud.automl.v1.TextExtractionAnnotation.verify|verify} messages. + * @param message TextExtractionAnnotation message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.automl.v1.ITextExtractionAnnotation, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified TextExtractionAnnotation message, length delimited. Does not implicitly {@link google.cloud.automl.v1.TextExtractionAnnotation.verify|verify} messages. + * @param message TextExtractionAnnotation message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.automl.v1.ITextExtractionAnnotation, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TextExtractionAnnotation message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns TextExtractionAnnotation + * @throws {Error} If the payload is not 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.automl.v1.TextExtractionAnnotation; + + /** + * Decodes a TextExtractionAnnotation message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns TextExtractionAnnotation + * @throws {Error} If the payload 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.automl.v1.TextExtractionAnnotation; + + /** + * Verifies a TextExtractionAnnotation message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a TextExtractionAnnotation message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns TextExtractionAnnotation + */ + public static fromObject(object: { [k: string]: any }): google.cloud.automl.v1.TextExtractionAnnotation; + + /** + * Creates a plain object from a TextExtractionAnnotation message. Also converts values to other types if specified. + * @param message TextExtractionAnnotation + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.automl.v1.TextExtractionAnnotation, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this TextExtractionAnnotation to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for TextExtractionAnnotation + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TextExtractionEvaluationMetrics. */ + interface ITextExtractionEvaluationMetrics { + + /** TextExtractionEvaluationMetrics auPrc */ + auPrc?: (number|null); + + /** TextExtractionEvaluationMetrics confidenceMetricsEntries */ + confidenceMetricsEntries?: (google.cloud.automl.v1.TextExtractionEvaluationMetrics.IConfidenceMetricsEntry[]|null); + } + + /** Represents a TextExtractionEvaluationMetrics. */ + class TextExtractionEvaluationMetrics implements ITextExtractionEvaluationMetrics { + + /** + * Constructs a new TextExtractionEvaluationMetrics. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.automl.v1.ITextExtractionEvaluationMetrics); + + /** TextExtractionEvaluationMetrics auPrc. */ + public auPrc: number; + + /** TextExtractionEvaluationMetrics confidenceMetricsEntries. */ + public confidenceMetricsEntries: google.cloud.automl.v1.TextExtractionEvaluationMetrics.IConfidenceMetricsEntry[]; + + /** + * Creates a new TextExtractionEvaluationMetrics instance using the specified properties. + * @param [properties] Properties to set + * @returns TextExtractionEvaluationMetrics instance + */ + public static create(properties?: google.cloud.automl.v1.ITextExtractionEvaluationMetrics): google.cloud.automl.v1.TextExtractionEvaluationMetrics; + + /** + * Encodes the specified TextExtractionEvaluationMetrics message. Does not implicitly {@link google.cloud.automl.v1.TextExtractionEvaluationMetrics.verify|verify} messages. + * @param message TextExtractionEvaluationMetrics message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.automl.v1.ITextExtractionEvaluationMetrics, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified TextExtractionEvaluationMetrics message, length delimited. Does not implicitly {@link google.cloud.automl.v1.TextExtractionEvaluationMetrics.verify|verify} messages. + * @param message TextExtractionEvaluationMetrics message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.automl.v1.ITextExtractionEvaluationMetrics, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TextExtractionEvaluationMetrics message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns TextExtractionEvaluationMetrics + * @throws {Error} If the payload is not 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.automl.v1.TextExtractionEvaluationMetrics; + + /** + * Decodes a TextExtractionEvaluationMetrics message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns TextExtractionEvaluationMetrics + * @throws {Error} If the payload 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.automl.v1.TextExtractionEvaluationMetrics; + + /** + * Verifies a TextExtractionEvaluationMetrics message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a TextExtractionEvaluationMetrics message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns TextExtractionEvaluationMetrics + */ + public static fromObject(object: { [k: string]: any }): google.cloud.automl.v1.TextExtractionEvaluationMetrics; + + /** + * Creates a plain object from a TextExtractionEvaluationMetrics message. Also converts values to other types if specified. + * @param message TextExtractionEvaluationMetrics + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.automl.v1.TextExtractionEvaluationMetrics, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this TextExtractionEvaluationMetrics to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for TextExtractionEvaluationMetrics + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace TextExtractionEvaluationMetrics { + + /** Properties of a ConfidenceMetricsEntry. */ + interface IConfidenceMetricsEntry { + + /** ConfidenceMetricsEntry confidenceThreshold */ + confidenceThreshold?: (number|null); + + /** ConfidenceMetricsEntry recall */ + recall?: (number|null); + + /** ConfidenceMetricsEntry precision */ + precision?: (number|null); + + /** ConfidenceMetricsEntry f1Score */ + f1Score?: (number|null); + } + + /** Represents a ConfidenceMetricsEntry. */ + class ConfidenceMetricsEntry implements IConfidenceMetricsEntry { + + /** + * Constructs a new ConfidenceMetricsEntry. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.automl.v1.TextExtractionEvaluationMetrics.IConfidenceMetricsEntry); + + /** ConfidenceMetricsEntry confidenceThreshold. */ + public confidenceThreshold: number; + + /** ConfidenceMetricsEntry recall. */ + public recall: number; + + /** ConfidenceMetricsEntry precision. */ + public precision: number; + + /** ConfidenceMetricsEntry f1Score. */ + public f1Score: number; + + /** + * Creates a new ConfidenceMetricsEntry instance using the specified properties. + * @param [properties] Properties to set + * @returns ConfidenceMetricsEntry instance + */ + public static create(properties?: google.cloud.automl.v1.TextExtractionEvaluationMetrics.IConfidenceMetricsEntry): google.cloud.automl.v1.TextExtractionEvaluationMetrics.ConfidenceMetricsEntry; + + /** + * Encodes the specified ConfidenceMetricsEntry message. Does not implicitly {@link google.cloud.automl.v1.TextExtractionEvaluationMetrics.ConfidenceMetricsEntry.verify|verify} messages. + * @param message ConfidenceMetricsEntry message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.automl.v1.TextExtractionEvaluationMetrics.IConfidenceMetricsEntry, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ConfidenceMetricsEntry message, length delimited. Does not implicitly {@link google.cloud.automl.v1.TextExtractionEvaluationMetrics.ConfidenceMetricsEntry.verify|verify} messages. + * @param message ConfidenceMetricsEntry message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.automl.v1.TextExtractionEvaluationMetrics.IConfidenceMetricsEntry, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ConfidenceMetricsEntry message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ConfidenceMetricsEntry + * @throws {Error} If the payload is not 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.automl.v1.TextExtractionEvaluationMetrics.ConfidenceMetricsEntry; + + /** + * Decodes a ConfidenceMetricsEntry message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ConfidenceMetricsEntry + * @throws {Error} If the payload 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.automl.v1.TextExtractionEvaluationMetrics.ConfidenceMetricsEntry; + + /** + * Verifies a ConfidenceMetricsEntry message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ConfidenceMetricsEntry message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ConfidenceMetricsEntry + */ + public static fromObject(object: { [k: string]: any }): google.cloud.automl.v1.TextExtractionEvaluationMetrics.ConfidenceMetricsEntry; + + /** + * Creates a plain object from a ConfidenceMetricsEntry message. Also converts values to other types if specified. + * @param message ConfidenceMetricsEntry + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.automl.v1.TextExtractionEvaluationMetrics.ConfidenceMetricsEntry, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ConfidenceMetricsEntry to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ConfidenceMetricsEntry + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Properties of a TextSegment. */ + interface ITextSegment { + + /** TextSegment content */ + content?: (string|null); + + /** TextSegment startOffset */ + startOffset?: (number|Long|string|null); + + /** TextSegment endOffset */ + endOffset?: (number|Long|string|null); + } + + /** Represents a TextSegment. */ + class TextSegment implements ITextSegment { + + /** + * Constructs a new TextSegment. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.automl.v1.ITextSegment); + + /** TextSegment content. */ + public content: string; + + /** TextSegment startOffset. */ + public startOffset: (number|Long|string); + + /** TextSegment endOffset. */ + public endOffset: (number|Long|string); + + /** + * Creates a new TextSegment instance using the specified properties. + * @param [properties] Properties to set + * @returns TextSegment instance + */ + public static create(properties?: google.cloud.automl.v1.ITextSegment): google.cloud.automl.v1.TextSegment; + + /** + * Encodes the specified TextSegment message. Does not implicitly {@link google.cloud.automl.v1.TextSegment.verify|verify} messages. + * @param message TextSegment message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.automl.v1.ITextSegment, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified TextSegment message, length delimited. Does not implicitly {@link google.cloud.automl.v1.TextSegment.verify|verify} messages. + * @param message TextSegment message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.automl.v1.ITextSegment, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TextSegment message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns TextSegment + * @throws {Error} If the payload is not 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.automl.v1.TextSegment; + + /** + * Decodes a TextSegment message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns TextSegment + * @throws {Error} If the payload 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.automl.v1.TextSegment; + + /** + * Verifies a TextSegment message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a TextSegment message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns TextSegment + */ + public static fromObject(object: { [k: string]: any }): google.cloud.automl.v1.TextSegment; + + /** + * Creates a plain object from a TextSegment message. Also converts values to other types if specified. + * @param message TextSegment + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.automl.v1.TextSegment, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this TextSegment to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for TextSegment + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TextSentimentAnnotation. */ + interface ITextSentimentAnnotation { + + /** TextSentimentAnnotation sentiment */ + sentiment?: (number|null); + } + + /** Represents a TextSentimentAnnotation. */ + class TextSentimentAnnotation implements ITextSentimentAnnotation { + + /** + * Constructs a new TextSentimentAnnotation. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.automl.v1.ITextSentimentAnnotation); + + /** TextSentimentAnnotation sentiment. */ + public sentiment: number; + + /** + * Creates a new TextSentimentAnnotation instance using the specified properties. + * @param [properties] Properties to set + * @returns TextSentimentAnnotation instance + */ + public static create(properties?: google.cloud.automl.v1.ITextSentimentAnnotation): google.cloud.automl.v1.TextSentimentAnnotation; + + /** + * Encodes the specified TextSentimentAnnotation message. Does not implicitly {@link google.cloud.automl.v1.TextSentimentAnnotation.verify|verify} messages. + * @param message TextSentimentAnnotation message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.automl.v1.ITextSentimentAnnotation, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified TextSentimentAnnotation message, length delimited. Does not implicitly {@link google.cloud.automl.v1.TextSentimentAnnotation.verify|verify} messages. + * @param message TextSentimentAnnotation message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.automl.v1.ITextSentimentAnnotation, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TextSentimentAnnotation message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns TextSentimentAnnotation + * @throws {Error} If the payload is not 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.automl.v1.TextSentimentAnnotation; + + /** + * Decodes a TextSentimentAnnotation message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns TextSentimentAnnotation + * @throws {Error} If the payload 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.automl.v1.TextSentimentAnnotation; + + /** + * Verifies a TextSentimentAnnotation message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a TextSentimentAnnotation message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns TextSentimentAnnotation + */ + public static fromObject(object: { [k: string]: any }): google.cloud.automl.v1.TextSentimentAnnotation; + + /** + * Creates a plain object from a TextSentimentAnnotation message. Also converts values to other types if specified. + * @param message TextSentimentAnnotation + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.automl.v1.TextSentimentAnnotation, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this TextSentimentAnnotation to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for TextSentimentAnnotation + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TextSentimentEvaluationMetrics. */ + interface ITextSentimentEvaluationMetrics { + + /** TextSentimentEvaluationMetrics precision */ + precision?: (number|null); + + /** TextSentimentEvaluationMetrics recall */ + recall?: (number|null); + + /** TextSentimentEvaluationMetrics f1Score */ + f1Score?: (number|null); + + /** TextSentimentEvaluationMetrics meanAbsoluteError */ + meanAbsoluteError?: (number|null); + + /** TextSentimentEvaluationMetrics meanSquaredError */ + meanSquaredError?: (number|null); + + /** TextSentimentEvaluationMetrics linearKappa */ + linearKappa?: (number|null); + + /** TextSentimentEvaluationMetrics quadraticKappa */ + quadraticKappa?: (number|null); + + /** TextSentimentEvaluationMetrics confusionMatrix */ + confusionMatrix?: (google.cloud.automl.v1.ClassificationEvaluationMetrics.IConfusionMatrix|null); + } + + /** Represents a TextSentimentEvaluationMetrics. */ + class TextSentimentEvaluationMetrics implements ITextSentimentEvaluationMetrics { + + /** + * Constructs a new TextSentimentEvaluationMetrics. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.automl.v1.ITextSentimentEvaluationMetrics); + + /** TextSentimentEvaluationMetrics precision. */ + public precision: number; + + /** TextSentimentEvaluationMetrics recall. */ + public recall: number; + + /** TextSentimentEvaluationMetrics f1Score. */ + public f1Score: number; + + /** TextSentimentEvaluationMetrics meanAbsoluteError. */ + public meanAbsoluteError: number; + + /** TextSentimentEvaluationMetrics meanSquaredError. */ + public meanSquaredError: number; + + /** TextSentimentEvaluationMetrics linearKappa. */ + public linearKappa: number; + + /** TextSentimentEvaluationMetrics quadraticKappa. */ + public quadraticKappa: number; + + /** TextSentimentEvaluationMetrics confusionMatrix. */ + public confusionMatrix?: (google.cloud.automl.v1.ClassificationEvaluationMetrics.IConfusionMatrix|null); + + /** + * Creates a new TextSentimentEvaluationMetrics instance using the specified properties. + * @param [properties] Properties to set + * @returns TextSentimentEvaluationMetrics instance + */ + public static create(properties?: google.cloud.automl.v1.ITextSentimentEvaluationMetrics): google.cloud.automl.v1.TextSentimentEvaluationMetrics; + + /** + * Encodes the specified TextSentimentEvaluationMetrics message. Does not implicitly {@link google.cloud.automl.v1.TextSentimentEvaluationMetrics.verify|verify} messages. + * @param message TextSentimentEvaluationMetrics message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.automl.v1.ITextSentimentEvaluationMetrics, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified TextSentimentEvaluationMetrics message, length delimited. Does not implicitly {@link google.cloud.automl.v1.TextSentimentEvaluationMetrics.verify|verify} messages. + * @param message TextSentimentEvaluationMetrics message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.automl.v1.ITextSentimentEvaluationMetrics, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TextSentimentEvaluationMetrics message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns TextSentimentEvaluationMetrics + * @throws {Error} If the payload is not 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.automl.v1.TextSentimentEvaluationMetrics; + + /** + * Decodes a TextSentimentEvaluationMetrics message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns TextSentimentEvaluationMetrics + * @throws {Error} If the payload 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.automl.v1.TextSentimentEvaluationMetrics; + + /** + * Verifies a TextSentimentEvaluationMetrics message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a TextSentimentEvaluationMetrics message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns TextSentimentEvaluationMetrics + */ + public static fromObject(object: { [k: string]: any }): google.cloud.automl.v1.TextSentimentEvaluationMetrics; + + /** + * Creates a plain object from a TextSentimentEvaluationMetrics message. Also converts values to other types if specified. + * @param message TextSentimentEvaluationMetrics + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.automl.v1.TextSentimentEvaluationMetrics, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this TextSentimentEvaluationMetrics to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for TextSentimentEvaluationMetrics + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TranslationDatasetMetadata. */ + interface ITranslationDatasetMetadata { + + /** TranslationDatasetMetadata sourceLanguageCode */ + sourceLanguageCode?: (string|null); + + /** TranslationDatasetMetadata targetLanguageCode */ + targetLanguageCode?: (string|null); + } + + /** Represents a TranslationDatasetMetadata. */ + class TranslationDatasetMetadata implements ITranslationDatasetMetadata { + + /** + * Constructs a new TranslationDatasetMetadata. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.automl.v1.ITranslationDatasetMetadata); + + /** TranslationDatasetMetadata sourceLanguageCode. */ + public sourceLanguageCode: string; + + /** TranslationDatasetMetadata targetLanguageCode. */ + public targetLanguageCode: string; + + /** + * Creates a new TranslationDatasetMetadata instance using the specified properties. + * @param [properties] Properties to set + * @returns TranslationDatasetMetadata instance + */ + public static create(properties?: google.cloud.automl.v1.ITranslationDatasetMetadata): google.cloud.automl.v1.TranslationDatasetMetadata; + + /** + * Encodes the specified TranslationDatasetMetadata message. Does not implicitly {@link google.cloud.automl.v1.TranslationDatasetMetadata.verify|verify} messages. + * @param message TranslationDatasetMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.automl.v1.ITranslationDatasetMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified TranslationDatasetMetadata message, length delimited. Does not implicitly {@link google.cloud.automl.v1.TranslationDatasetMetadata.verify|verify} messages. + * @param message TranslationDatasetMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.automl.v1.ITranslationDatasetMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TranslationDatasetMetadata message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns TranslationDatasetMetadata + * @throws {Error} If the payload is not 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.automl.v1.TranslationDatasetMetadata; + + /** + * Decodes a TranslationDatasetMetadata message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns TranslationDatasetMetadata + * @throws {Error} If the payload 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.automl.v1.TranslationDatasetMetadata; + + /** + * Verifies a TranslationDatasetMetadata message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a TranslationDatasetMetadata message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns TranslationDatasetMetadata + */ + public static fromObject(object: { [k: string]: any }): google.cloud.automl.v1.TranslationDatasetMetadata; + + /** + * Creates a plain object from a TranslationDatasetMetadata message. Also converts values to other types if specified. + * @param message TranslationDatasetMetadata + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.automl.v1.TranslationDatasetMetadata, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this TranslationDatasetMetadata to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for TranslationDatasetMetadata + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TranslationEvaluationMetrics. */ + interface ITranslationEvaluationMetrics { + + /** TranslationEvaluationMetrics bleuScore */ + bleuScore?: (number|null); + + /** TranslationEvaluationMetrics baseBleuScore */ + baseBleuScore?: (number|null); + } + + /** Represents a TranslationEvaluationMetrics. */ + class TranslationEvaluationMetrics implements ITranslationEvaluationMetrics { + + /** + * Constructs a new TranslationEvaluationMetrics. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.automl.v1.ITranslationEvaluationMetrics); + + /** TranslationEvaluationMetrics bleuScore. */ + public bleuScore: number; + + /** TranslationEvaluationMetrics baseBleuScore. */ + public baseBleuScore: number; + + /** + * Creates a new TranslationEvaluationMetrics instance using the specified properties. + * @param [properties] Properties to set + * @returns TranslationEvaluationMetrics instance + */ + public static create(properties?: google.cloud.automl.v1.ITranslationEvaluationMetrics): google.cloud.automl.v1.TranslationEvaluationMetrics; + + /** + * Encodes the specified TranslationEvaluationMetrics message. Does not implicitly {@link google.cloud.automl.v1.TranslationEvaluationMetrics.verify|verify} messages. + * @param message TranslationEvaluationMetrics message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.automl.v1.ITranslationEvaluationMetrics, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified TranslationEvaluationMetrics message, length delimited. Does not implicitly {@link google.cloud.automl.v1.TranslationEvaluationMetrics.verify|verify} messages. + * @param message TranslationEvaluationMetrics message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.automl.v1.ITranslationEvaluationMetrics, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TranslationEvaluationMetrics message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns TranslationEvaluationMetrics + * @throws {Error} If the payload is not 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.automl.v1.TranslationEvaluationMetrics; + + /** + * Decodes a TranslationEvaluationMetrics message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns TranslationEvaluationMetrics + * @throws {Error} If the payload 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.automl.v1.TranslationEvaluationMetrics; + + /** + * Verifies a TranslationEvaluationMetrics message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a TranslationEvaluationMetrics message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns TranslationEvaluationMetrics + */ + public static fromObject(object: { [k: string]: any }): google.cloud.automl.v1.TranslationEvaluationMetrics; + + /** + * Creates a plain object from a TranslationEvaluationMetrics message. Also converts values to other types if specified. + * @param message TranslationEvaluationMetrics + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.automl.v1.TranslationEvaluationMetrics, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this TranslationEvaluationMetrics to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for TranslationEvaluationMetrics + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TranslationModelMetadata. */ + interface ITranslationModelMetadata { + + /** TranslationModelMetadata baseModel */ + baseModel?: (string|null); + + /** TranslationModelMetadata sourceLanguageCode */ + sourceLanguageCode?: (string|null); + + /** TranslationModelMetadata targetLanguageCode */ + targetLanguageCode?: (string|null); + } + + /** Represents a TranslationModelMetadata. */ + class TranslationModelMetadata implements ITranslationModelMetadata { + + /** + * Constructs a new TranslationModelMetadata. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.automl.v1.ITranslationModelMetadata); + + /** TranslationModelMetadata baseModel. */ + public baseModel: string; + + /** TranslationModelMetadata sourceLanguageCode. */ + public sourceLanguageCode: string; + + /** TranslationModelMetadata targetLanguageCode. */ + public targetLanguageCode: string; + + /** + * Creates a new TranslationModelMetadata instance using the specified properties. + * @param [properties] Properties to set + * @returns TranslationModelMetadata instance + */ + public static create(properties?: google.cloud.automl.v1.ITranslationModelMetadata): google.cloud.automl.v1.TranslationModelMetadata; + + /** + * Encodes the specified TranslationModelMetadata message. Does not implicitly {@link google.cloud.automl.v1.TranslationModelMetadata.verify|verify} messages. + * @param message TranslationModelMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.automl.v1.ITranslationModelMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified TranslationModelMetadata message, length delimited. Does not implicitly {@link google.cloud.automl.v1.TranslationModelMetadata.verify|verify} messages. + * @param message TranslationModelMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.automl.v1.ITranslationModelMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TranslationModelMetadata message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns TranslationModelMetadata + * @throws {Error} If the payload is not 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.automl.v1.TranslationModelMetadata; + + /** + * Decodes a TranslationModelMetadata message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns TranslationModelMetadata + * @throws {Error} If the payload 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.automl.v1.TranslationModelMetadata; + + /** + * Verifies a TranslationModelMetadata message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a TranslationModelMetadata message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns TranslationModelMetadata + */ + public static fromObject(object: { [k: string]: any }): google.cloud.automl.v1.TranslationModelMetadata; + + /** + * Creates a plain object from a TranslationModelMetadata message. Also converts values to other types if specified. + * @param message TranslationModelMetadata + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.automl.v1.TranslationModelMetadata, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this TranslationModelMetadata to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for TranslationModelMetadata + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TranslationAnnotation. */ + interface ITranslationAnnotation { + + /** TranslationAnnotation translatedContent */ + translatedContent?: (google.cloud.automl.v1.ITextSnippet|null); + } + + /** Represents a TranslationAnnotation. */ + class TranslationAnnotation implements ITranslationAnnotation { + + /** + * Constructs a new TranslationAnnotation. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.automl.v1.ITranslationAnnotation); + + /** TranslationAnnotation translatedContent. */ + public translatedContent?: (google.cloud.automl.v1.ITextSnippet|null); + + /** + * Creates a new TranslationAnnotation instance using the specified properties. + * @param [properties] Properties to set + * @returns TranslationAnnotation instance + */ + public static create(properties?: google.cloud.automl.v1.ITranslationAnnotation): google.cloud.automl.v1.TranslationAnnotation; + + /** + * Encodes the specified TranslationAnnotation message. Does not implicitly {@link google.cloud.automl.v1.TranslationAnnotation.verify|verify} messages. + * @param message TranslationAnnotation message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.automl.v1.ITranslationAnnotation, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified TranslationAnnotation message, length delimited. Does not implicitly {@link google.cloud.automl.v1.TranslationAnnotation.verify|verify} messages. + * @param message TranslationAnnotation message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.automl.v1.ITranslationAnnotation, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TranslationAnnotation message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns TranslationAnnotation + * @throws {Error} If the payload is not 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.automl.v1.TranslationAnnotation; + + /** + * Decodes a TranslationAnnotation message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns TranslationAnnotation + * @throws {Error} If the payload 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.automl.v1.TranslationAnnotation; + + /** + * Verifies a TranslationAnnotation message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a TranslationAnnotation message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns TranslationAnnotation + */ + public static fromObject(object: { [k: string]: any }): google.cloud.automl.v1.TranslationAnnotation; + + /** + * Creates a plain object from a TranslationAnnotation message. Also converts values to other types if specified. + * @param message TranslationAnnotation + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.automl.v1.TranslationAnnotation, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this TranslationAnnotation to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for TranslationAnnotation + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an Image. */ + interface IImage { + + /** Image imageBytes */ + imageBytes?: (Uint8Array|string|null); + + /** Image thumbnailUri */ + thumbnailUri?: (string|null); + } + + /** Represents an Image. */ + class Image implements IImage { + + /** + * Constructs a new Image. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.automl.v1.IImage); + + /** Image imageBytes. */ + public imageBytes?: (Uint8Array|string|null); + + /** Image thumbnailUri. */ + public thumbnailUri: string; + + /** Image data. */ + public data?: "imageBytes"; + + /** + * Creates a new Image instance using the specified properties. + * @param [properties] Properties to set + * @returns Image instance + */ + public static create(properties?: google.cloud.automl.v1.IImage): google.cloud.automl.v1.Image; + + /** + * Encodes the specified Image message. Does not implicitly {@link google.cloud.automl.v1.Image.verify|verify} messages. + * @param message Image message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.automl.v1.IImage, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Image message, length delimited. Does not implicitly {@link google.cloud.automl.v1.Image.verify|verify} messages. + * @param message Image message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.automl.v1.IImage, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an Image message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Image + * @throws {Error} If the payload is not 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.automl.v1.Image; + + /** + * Decodes an Image message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Image + * @throws {Error} If the payload 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.automl.v1.Image; + + /** + * Verifies an Image message. + * @param message Plain 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 Image message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Image + */ + public static fromObject(object: { [k: string]: any }): google.cloud.automl.v1.Image; + + /** + * Creates a plain object from an Image message. Also converts values to other types if specified. + * @param message Image + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.automl.v1.Image, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Image to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Image + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TextSnippet. */ + interface ITextSnippet { + + /** TextSnippet content */ + content?: (string|null); + + /** TextSnippet mimeType */ + mimeType?: (string|null); + + /** TextSnippet contentUri */ + contentUri?: (string|null); + } + + /** Represents a TextSnippet. */ + class TextSnippet implements ITextSnippet { + + /** + * Constructs a new TextSnippet. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.automl.v1.ITextSnippet); + + /** TextSnippet content. */ + public content: string; + + /** TextSnippet mimeType. */ + public mimeType: string; + + /** TextSnippet contentUri. */ + public contentUri: string; + + /** + * Creates a new TextSnippet instance using the specified properties. + * @param [properties] Properties to set + * @returns TextSnippet instance + */ + public static create(properties?: google.cloud.automl.v1.ITextSnippet): google.cloud.automl.v1.TextSnippet; + + /** + * Encodes the specified TextSnippet message. Does not implicitly {@link google.cloud.automl.v1.TextSnippet.verify|verify} messages. + * @param message TextSnippet message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.automl.v1.ITextSnippet, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified TextSnippet message, length delimited. Does not implicitly {@link google.cloud.automl.v1.TextSnippet.verify|verify} messages. + * @param message TextSnippet message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.automl.v1.ITextSnippet, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TextSnippet message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns TextSnippet + * @throws {Error} If the payload is not 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.automl.v1.TextSnippet; + + /** + * Decodes a TextSnippet message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns TextSnippet + * @throws {Error} If the payload 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.automl.v1.TextSnippet; + + /** + * Verifies a TextSnippet message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a TextSnippet message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns TextSnippet + */ + public static fromObject(object: { [k: string]: any }): google.cloud.automl.v1.TextSnippet; + + /** + * Creates a plain object from a TextSnippet message. Also converts values to other types if specified. + * @param message TextSnippet + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.automl.v1.TextSnippet, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this TextSnippet to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for TextSnippet + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a DocumentDimensions. */ + interface IDocumentDimensions { + + /** DocumentDimensions unit */ + unit?: (google.cloud.automl.v1.DocumentDimensions.DocumentDimensionUnit|keyof typeof google.cloud.automl.v1.DocumentDimensions.DocumentDimensionUnit|null); + + /** DocumentDimensions width */ + width?: (number|null); + + /** DocumentDimensions height */ + height?: (number|null); + } + + /** Represents a DocumentDimensions. */ + class DocumentDimensions implements IDocumentDimensions { + + /** + * Constructs a new DocumentDimensions. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.automl.v1.IDocumentDimensions); + + /** DocumentDimensions unit. */ + public unit: (google.cloud.automl.v1.DocumentDimensions.DocumentDimensionUnit|keyof typeof google.cloud.automl.v1.DocumentDimensions.DocumentDimensionUnit); + + /** DocumentDimensions width. */ + public width: number; + + /** DocumentDimensions height. */ + public height: number; + + /** + * Creates a new DocumentDimensions instance using the specified properties. + * @param [properties] Properties to set + * @returns DocumentDimensions instance + */ + public static create(properties?: google.cloud.automl.v1.IDocumentDimensions): google.cloud.automl.v1.DocumentDimensions; + + /** + * Encodes the specified DocumentDimensions message. Does not implicitly {@link google.cloud.automl.v1.DocumentDimensions.verify|verify} messages. + * @param message DocumentDimensions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.automl.v1.IDocumentDimensions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DocumentDimensions message, length delimited. Does not implicitly {@link google.cloud.automl.v1.DocumentDimensions.verify|verify} messages. + * @param message DocumentDimensions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.automl.v1.IDocumentDimensions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DocumentDimensions message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DocumentDimensions + * @throws {Error} If the payload is not 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.automl.v1.DocumentDimensions; + + /** + * Decodes a DocumentDimensions message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DocumentDimensions + * @throws {Error} If the payload 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.automl.v1.DocumentDimensions; + + /** + * Verifies a DocumentDimensions message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DocumentDimensions message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DocumentDimensions + */ + public static fromObject(object: { [k: string]: any }): google.cloud.automl.v1.DocumentDimensions; + + /** + * Creates a plain object from a DocumentDimensions message. Also converts values to other types if specified. + * @param message DocumentDimensions + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.automl.v1.DocumentDimensions, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DocumentDimensions to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DocumentDimensions + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace DocumentDimensions { + + /** DocumentDimensionUnit enum. */ + enum DocumentDimensionUnit { + DOCUMENT_DIMENSION_UNIT_UNSPECIFIED = 0, + INCH = 1, + CENTIMETER = 2, + POINT = 3 + } + } + + /** Properties of a Document. */ + interface IDocument { + + /** Document inputConfig */ + inputConfig?: (google.cloud.automl.v1.IDocumentInputConfig|null); + + /** Document documentText */ + documentText?: (google.cloud.automl.v1.ITextSnippet|null); + + /** Document layout */ + layout?: (google.cloud.automl.v1.Document.ILayout[]|null); + + /** Document documentDimensions */ + documentDimensions?: (google.cloud.automl.v1.IDocumentDimensions|null); + + /** Document pageCount */ + pageCount?: (number|null); + } + + /** Represents a Document. */ + class Document implements IDocument { + + /** + * Constructs a new Document. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.automl.v1.IDocument); + + /** Document inputConfig. */ + public inputConfig?: (google.cloud.automl.v1.IDocumentInputConfig|null); + + /** Document documentText. */ + public documentText?: (google.cloud.automl.v1.ITextSnippet|null); + + /** Document layout. */ + public layout: google.cloud.automl.v1.Document.ILayout[]; + + /** Document documentDimensions. */ + public documentDimensions?: (google.cloud.automl.v1.IDocumentDimensions|null); + + /** Document pageCount. */ + public pageCount: number; + + /** + * Creates a new Document instance using the specified properties. + * @param [properties] Properties to set + * @returns Document instance + */ + public static create(properties?: google.cloud.automl.v1.IDocument): google.cloud.automl.v1.Document; + + /** + * Encodes the specified Document message. Does not implicitly {@link google.cloud.automl.v1.Document.verify|verify} messages. + * @param message Document message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.automl.v1.IDocument, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Document message, length delimited. Does not implicitly {@link google.cloud.automl.v1.Document.verify|verify} messages. + * @param message Document message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.automl.v1.IDocument, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Document message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Document + * @throws {Error} If the payload is not 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.automl.v1.Document; + + /** + * Decodes a Document message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Document + * @throws {Error} If the payload 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.automl.v1.Document; + + /** + * Verifies a Document message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Document message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Document + */ + public static fromObject(object: { [k: string]: any }): google.cloud.automl.v1.Document; + + /** + * Creates a plain object from a Document message. Also converts values to other types if specified. + * @param message Document + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.automl.v1.Document, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Document to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Document + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace Document { + + /** Properties of a Layout. */ + interface ILayout { + + /** Layout textSegment */ + textSegment?: (google.cloud.automl.v1.ITextSegment|null); + + /** Layout pageNumber */ + pageNumber?: (number|null); + + /** Layout boundingPoly */ + boundingPoly?: (google.cloud.automl.v1.IBoundingPoly|null); + + /** Layout textSegmentType */ + textSegmentType?: (google.cloud.automl.v1.Document.Layout.TextSegmentType|keyof typeof google.cloud.automl.v1.Document.Layout.TextSegmentType|null); + } + + /** Represents a Layout. */ + class Layout implements ILayout { + + /** + * Constructs a new Layout. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.automl.v1.Document.ILayout); + + /** Layout textSegment. */ + public textSegment?: (google.cloud.automl.v1.ITextSegment|null); + + /** Layout pageNumber. */ + public pageNumber: number; + + /** Layout boundingPoly. */ + public boundingPoly?: (google.cloud.automl.v1.IBoundingPoly|null); + + /** Layout textSegmentType. */ + public textSegmentType: (google.cloud.automl.v1.Document.Layout.TextSegmentType|keyof typeof google.cloud.automl.v1.Document.Layout.TextSegmentType); + + /** + * Creates a new Layout instance using the specified properties. + * @param [properties] Properties to set + * @returns Layout instance + */ + public static create(properties?: google.cloud.automl.v1.Document.ILayout): google.cloud.automl.v1.Document.Layout; + + /** + * Encodes the specified Layout message. Does not implicitly {@link google.cloud.automl.v1.Document.Layout.verify|verify} messages. + * @param message Layout message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.automl.v1.Document.ILayout, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Layout message, length delimited. Does not implicitly {@link google.cloud.automl.v1.Document.Layout.verify|verify} messages. + * @param message Layout message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.automl.v1.Document.ILayout, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Layout message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Layout + * @throws {Error} If the payload is not 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.automl.v1.Document.Layout; + + /** + * Decodes a Layout message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Layout + * @throws {Error} If the payload 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.automl.v1.Document.Layout; + + /** + * Verifies a Layout message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Layout message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Layout + */ + public static fromObject(object: { [k: string]: any }): google.cloud.automl.v1.Document.Layout; + + /** + * Creates a plain object from a Layout message. Also converts values to other types if specified. + * @param message Layout + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.automl.v1.Document.Layout, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Layout to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Layout + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace Layout { + + /** TextSegmentType enum. */ + enum TextSegmentType { + TEXT_SEGMENT_TYPE_UNSPECIFIED = 0, + TOKEN = 1, + PARAGRAPH = 2, + FORM_FIELD = 3, + FORM_FIELD_NAME = 4, + FORM_FIELD_CONTENTS = 5, + TABLE = 6, + TABLE_HEADER = 7, + TABLE_ROW = 8, + TABLE_CELL = 9 + } + } + } + + /** Properties of an ExamplePayload. */ + interface IExamplePayload { + + /** ExamplePayload image */ + image?: (google.cloud.automl.v1.IImage|null); + + /** ExamplePayload textSnippet */ + textSnippet?: (google.cloud.automl.v1.ITextSnippet|null); + + /** ExamplePayload document */ + document?: (google.cloud.automl.v1.IDocument|null); + } + + /** Represents an ExamplePayload. */ + class ExamplePayload implements IExamplePayload { + + /** + * Constructs a new ExamplePayload. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.automl.v1.IExamplePayload); + + /** ExamplePayload image. */ + public image?: (google.cloud.automl.v1.IImage|null); + + /** ExamplePayload textSnippet. */ + public textSnippet?: (google.cloud.automl.v1.ITextSnippet|null); + + /** ExamplePayload document. */ + public document?: (google.cloud.automl.v1.IDocument|null); + + /** ExamplePayload payload. */ + public payload?: ("image"|"textSnippet"|"document"); + + /** + * Creates a new ExamplePayload instance using the specified properties. + * @param [properties] Properties to set + * @returns ExamplePayload instance + */ + public static create(properties?: google.cloud.automl.v1.IExamplePayload): google.cloud.automl.v1.ExamplePayload; + + /** + * Encodes the specified ExamplePayload message. Does not implicitly {@link google.cloud.automl.v1.ExamplePayload.verify|verify} messages. + * @param message ExamplePayload message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.automl.v1.IExamplePayload, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ExamplePayload message, length delimited. Does not implicitly {@link google.cloud.automl.v1.ExamplePayload.verify|verify} messages. + * @param message ExamplePayload message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.automl.v1.IExamplePayload, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an ExamplePayload message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ExamplePayload + * @throws {Error} If the payload is not 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.automl.v1.ExamplePayload; + + /** + * Decodes an ExamplePayload message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ExamplePayload + * @throws {Error} If the payload 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.automl.v1.ExamplePayload; + + /** + * Verifies an ExamplePayload message. + * @param message Plain 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 ExamplePayload message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ExamplePayload + */ + public static fromObject(object: { [k: string]: any }): google.cloud.automl.v1.ExamplePayload; + + /** + * Creates a plain object from an ExamplePayload message. Also converts values to other types if specified. + * @param message ExamplePayload + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.automl.v1.ExamplePayload, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ExamplePayload to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ExamplePayload + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an InputConfig. */ + interface IInputConfig { + + /** InputConfig gcsSource */ + gcsSource?: (google.cloud.automl.v1.IGcsSource|null); + + /** InputConfig params */ + params?: ({ [k: string]: string }|null); + } + + /** Represents an InputConfig. */ + class InputConfig implements IInputConfig { + + /** + * Constructs a new InputConfig. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.automl.v1.IInputConfig); + + /** InputConfig gcsSource. */ + public gcsSource?: (google.cloud.automl.v1.IGcsSource|null); + + /** InputConfig params. */ + public params: { [k: string]: string }; + + /** InputConfig source. */ + public source?: "gcsSource"; + + /** + * Creates a new InputConfig instance using the specified properties. + * @param [properties] Properties to set + * @returns InputConfig instance + */ + public static create(properties?: google.cloud.automl.v1.IInputConfig): google.cloud.automl.v1.InputConfig; + + /** + * Encodes the specified InputConfig message. Does not implicitly {@link google.cloud.automl.v1.InputConfig.verify|verify} messages. + * @param message InputConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.automl.v1.IInputConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified InputConfig message, length delimited. Does not implicitly {@link google.cloud.automl.v1.InputConfig.verify|verify} messages. + * @param message InputConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.automl.v1.IInputConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an InputConfig message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns InputConfig + * @throws {Error} If the payload is not 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.automl.v1.InputConfig; + + /** + * Decodes an InputConfig message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns InputConfig + * @throws {Error} If the payload 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.automl.v1.InputConfig; + + /** + * Verifies an InputConfig message. + * @param message Plain 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 InputConfig message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns InputConfig + */ + public static fromObject(object: { [k: string]: any }): google.cloud.automl.v1.InputConfig; + + /** + * Creates a plain object from an InputConfig message. Also converts values to other types if specified. + * @param message InputConfig + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.automl.v1.InputConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this InputConfig to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for InputConfig + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a BatchPredictInputConfig. */ + interface IBatchPredictInputConfig { + + /** BatchPredictInputConfig gcsSource */ + gcsSource?: (google.cloud.automl.v1.IGcsSource|null); + } + + /** Represents a BatchPredictInputConfig. */ + class BatchPredictInputConfig implements IBatchPredictInputConfig { + + /** + * Constructs a new BatchPredictInputConfig. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.automl.v1.IBatchPredictInputConfig); + + /** BatchPredictInputConfig gcsSource. */ + public gcsSource?: (google.cloud.automl.v1.IGcsSource|null); + + /** BatchPredictInputConfig source. */ + public source?: "gcsSource"; + + /** + * Creates a new BatchPredictInputConfig instance using the specified properties. + * @param [properties] Properties to set + * @returns BatchPredictInputConfig instance + */ + public static create(properties?: google.cloud.automl.v1.IBatchPredictInputConfig): google.cloud.automl.v1.BatchPredictInputConfig; + + /** + * Encodes the specified BatchPredictInputConfig message. Does not implicitly {@link google.cloud.automl.v1.BatchPredictInputConfig.verify|verify} messages. + * @param message BatchPredictInputConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.automl.v1.IBatchPredictInputConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified BatchPredictInputConfig message, length delimited. Does not implicitly {@link google.cloud.automl.v1.BatchPredictInputConfig.verify|verify} messages. + * @param message BatchPredictInputConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.automl.v1.IBatchPredictInputConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a BatchPredictInputConfig message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns BatchPredictInputConfig + * @throws {Error} If the payload is not 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.automl.v1.BatchPredictInputConfig; + + /** + * Decodes a BatchPredictInputConfig message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns BatchPredictInputConfig + * @throws {Error} If the payload 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.automl.v1.BatchPredictInputConfig; + + /** + * Verifies a BatchPredictInputConfig message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a BatchPredictInputConfig message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns BatchPredictInputConfig + */ + public static fromObject(object: { [k: string]: any }): google.cloud.automl.v1.BatchPredictInputConfig; + + /** + * Creates a plain object from a BatchPredictInputConfig message. Also converts values to other types if specified. + * @param message BatchPredictInputConfig + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.automl.v1.BatchPredictInputConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this BatchPredictInputConfig to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for BatchPredictInputConfig + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a DocumentInputConfig. */ + interface IDocumentInputConfig { + + /** DocumentInputConfig gcsSource */ + gcsSource?: (google.cloud.automl.v1.IGcsSource|null); + } + + /** Represents a DocumentInputConfig. */ + class DocumentInputConfig implements IDocumentInputConfig { + + /** + * Constructs a new DocumentInputConfig. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.automl.v1.IDocumentInputConfig); + + /** DocumentInputConfig gcsSource. */ + public gcsSource?: (google.cloud.automl.v1.IGcsSource|null); + + /** + * Creates a new DocumentInputConfig instance using the specified properties. + * @param [properties] Properties to set + * @returns DocumentInputConfig instance + */ + public static create(properties?: google.cloud.automl.v1.IDocumentInputConfig): google.cloud.automl.v1.DocumentInputConfig; + + /** + * Encodes the specified DocumentInputConfig message. Does not implicitly {@link google.cloud.automl.v1.DocumentInputConfig.verify|verify} messages. + * @param message DocumentInputConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.automl.v1.IDocumentInputConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DocumentInputConfig message, length delimited. Does not implicitly {@link google.cloud.automl.v1.DocumentInputConfig.verify|verify} messages. + * @param message DocumentInputConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.automl.v1.IDocumentInputConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DocumentInputConfig message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DocumentInputConfig + * @throws {Error} If the payload is not 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.automl.v1.DocumentInputConfig; + + /** + * Decodes a DocumentInputConfig message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DocumentInputConfig + * @throws {Error} If the payload 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.automl.v1.DocumentInputConfig; + + /** + * Verifies a DocumentInputConfig message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DocumentInputConfig message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DocumentInputConfig + */ + public static fromObject(object: { [k: string]: any }): google.cloud.automl.v1.DocumentInputConfig; + + /** + * Creates a plain object from a DocumentInputConfig message. Also converts values to other types if specified. + * @param message DocumentInputConfig + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.automl.v1.DocumentInputConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DocumentInputConfig to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DocumentInputConfig + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an OutputConfig. */ + interface IOutputConfig { + + /** OutputConfig gcsDestination */ + gcsDestination?: (google.cloud.automl.v1.IGcsDestination|null); + } + + /** Represents an OutputConfig. */ + class OutputConfig implements IOutputConfig { + + /** + * Constructs a new OutputConfig. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.automl.v1.IOutputConfig); + + /** OutputConfig gcsDestination. */ + public gcsDestination?: (google.cloud.automl.v1.IGcsDestination|null); + + /** OutputConfig destination. */ + public destination?: "gcsDestination"; + + /** + * Creates a new OutputConfig instance using the specified properties. + * @param [properties] Properties to set + * @returns OutputConfig instance + */ + public static create(properties?: google.cloud.automl.v1.IOutputConfig): google.cloud.automl.v1.OutputConfig; + + /** + * Encodes the specified OutputConfig message. Does not implicitly {@link google.cloud.automl.v1.OutputConfig.verify|verify} messages. + * @param message OutputConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.automl.v1.IOutputConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified OutputConfig message, length delimited. Does not implicitly {@link google.cloud.automl.v1.OutputConfig.verify|verify} messages. + * @param message OutputConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.automl.v1.IOutputConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an OutputConfig message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns OutputConfig + * @throws {Error} If the payload is not 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.automl.v1.OutputConfig; + + /** + * Decodes an OutputConfig message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns OutputConfig + * @throws {Error} If the payload 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.automl.v1.OutputConfig; + + /** + * Verifies an OutputConfig message. + * @param message Plain 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 OutputConfig message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns OutputConfig + */ + public static fromObject(object: { [k: string]: any }): google.cloud.automl.v1.OutputConfig; + + /** + * Creates a plain object from an OutputConfig message. Also converts values to other types if specified. + * @param message OutputConfig + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.automl.v1.OutputConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this OutputConfig to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for OutputConfig + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a BatchPredictOutputConfig. */ + interface IBatchPredictOutputConfig { + + /** BatchPredictOutputConfig gcsDestination */ + gcsDestination?: (google.cloud.automl.v1.IGcsDestination|null); + } + + /** Represents a BatchPredictOutputConfig. */ + class BatchPredictOutputConfig implements IBatchPredictOutputConfig { + + /** + * Constructs a new BatchPredictOutputConfig. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.automl.v1.IBatchPredictOutputConfig); + + /** BatchPredictOutputConfig gcsDestination. */ + public gcsDestination?: (google.cloud.automl.v1.IGcsDestination|null); + + /** BatchPredictOutputConfig destination. */ + public destination?: "gcsDestination"; + + /** + * Creates a new BatchPredictOutputConfig instance using the specified properties. + * @param [properties] Properties to set + * @returns BatchPredictOutputConfig instance + */ + public static create(properties?: google.cloud.automl.v1.IBatchPredictOutputConfig): google.cloud.automl.v1.BatchPredictOutputConfig; + + /** + * Encodes the specified BatchPredictOutputConfig message. Does not implicitly {@link google.cloud.automl.v1.BatchPredictOutputConfig.verify|verify} messages. + * @param message BatchPredictOutputConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.automl.v1.IBatchPredictOutputConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified BatchPredictOutputConfig message, length delimited. Does not implicitly {@link google.cloud.automl.v1.BatchPredictOutputConfig.verify|verify} messages. + * @param message BatchPredictOutputConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.automl.v1.IBatchPredictOutputConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a BatchPredictOutputConfig message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns BatchPredictOutputConfig + * @throws {Error} If the payload is not 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.automl.v1.BatchPredictOutputConfig; + + /** + * Decodes a BatchPredictOutputConfig message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns BatchPredictOutputConfig + * @throws {Error} If the payload 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.automl.v1.BatchPredictOutputConfig; + + /** + * Verifies a BatchPredictOutputConfig message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a BatchPredictOutputConfig message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns BatchPredictOutputConfig + */ + public static fromObject(object: { [k: string]: any }): google.cloud.automl.v1.BatchPredictOutputConfig; + + /** + * Creates a plain object from a BatchPredictOutputConfig message. Also converts values to other types if specified. + * @param message BatchPredictOutputConfig + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.automl.v1.BatchPredictOutputConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this BatchPredictOutputConfig to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for BatchPredictOutputConfig + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ModelExportOutputConfig. */ + interface IModelExportOutputConfig { + + /** ModelExportOutputConfig gcsDestination */ + gcsDestination?: (google.cloud.automl.v1.IGcsDestination|null); + + /** ModelExportOutputConfig modelFormat */ + modelFormat?: (string|null); + + /** ModelExportOutputConfig params */ + params?: ({ [k: string]: string }|null); + } + + /** Represents a ModelExportOutputConfig. */ + class ModelExportOutputConfig implements IModelExportOutputConfig { + + /** + * Constructs a new ModelExportOutputConfig. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.automl.v1.IModelExportOutputConfig); + + /** ModelExportOutputConfig gcsDestination. */ + public gcsDestination?: (google.cloud.automl.v1.IGcsDestination|null); + + /** ModelExportOutputConfig modelFormat. */ + public modelFormat: string; + + /** ModelExportOutputConfig params. */ + public params: { [k: string]: string }; + + /** ModelExportOutputConfig destination. */ + public destination?: "gcsDestination"; + + /** + * Creates a new ModelExportOutputConfig instance using the specified properties. + * @param [properties] Properties to set + * @returns ModelExportOutputConfig instance + */ + public static create(properties?: google.cloud.automl.v1.IModelExportOutputConfig): google.cloud.automl.v1.ModelExportOutputConfig; + + /** + * Encodes the specified ModelExportOutputConfig message. Does not implicitly {@link google.cloud.automl.v1.ModelExportOutputConfig.verify|verify} messages. + * @param message ModelExportOutputConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.automl.v1.IModelExportOutputConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ModelExportOutputConfig message, length delimited. Does not implicitly {@link google.cloud.automl.v1.ModelExportOutputConfig.verify|verify} messages. + * @param message ModelExportOutputConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.automl.v1.IModelExportOutputConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ModelExportOutputConfig message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ModelExportOutputConfig + * @throws {Error} If the payload is not 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.automl.v1.ModelExportOutputConfig; + + /** + * Decodes a ModelExportOutputConfig message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ModelExportOutputConfig + * @throws {Error} If the payload 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.automl.v1.ModelExportOutputConfig; + + /** + * Verifies a ModelExportOutputConfig message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ModelExportOutputConfig message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ModelExportOutputConfig + */ + public static fromObject(object: { [k: string]: any }): google.cloud.automl.v1.ModelExportOutputConfig; + + /** + * Creates a plain object from a ModelExportOutputConfig message. Also converts values to other types if specified. + * @param message ModelExportOutputConfig + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.automl.v1.ModelExportOutputConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ModelExportOutputConfig to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ModelExportOutputConfig + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a GcsSource. */ + interface IGcsSource { + + /** GcsSource inputUris */ + inputUris?: (string[]|null); + } + + /** Represents a GcsSource. */ + class GcsSource implements IGcsSource { + + /** + * Constructs a new GcsSource. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.automl.v1.IGcsSource); + + /** GcsSource inputUris. */ + public inputUris: string[]; + + /** + * Creates a new GcsSource instance using the specified properties. + * @param [properties] Properties to set + * @returns GcsSource instance + */ + public static create(properties?: google.cloud.automl.v1.IGcsSource): google.cloud.automl.v1.GcsSource; + + /** + * Encodes the specified GcsSource message. Does not implicitly {@link google.cloud.automl.v1.GcsSource.verify|verify} messages. + * @param message GcsSource message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.automl.v1.IGcsSource, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GcsSource message, length delimited. Does not implicitly {@link google.cloud.automl.v1.GcsSource.verify|verify} messages. + * @param message GcsSource message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.automl.v1.IGcsSource, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GcsSource message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GcsSource + * @throws {Error} If the payload is not 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.automl.v1.GcsSource; + + /** + * Decodes a GcsSource message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GcsSource + * @throws {Error} If the payload 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.automl.v1.GcsSource; + + /** + * Verifies a GcsSource message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GcsSource message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GcsSource + */ + public static fromObject(object: { [k: string]: any }): google.cloud.automl.v1.GcsSource; + + /** + * Creates a plain object from a GcsSource message. Also converts values to other types if specified. + * @param message GcsSource + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.automl.v1.GcsSource, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GcsSource to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GcsSource + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a GcsDestination. */ + interface IGcsDestination { + + /** GcsDestination outputUriPrefix */ + outputUriPrefix?: (string|null); + } + + /** Represents a GcsDestination. */ + class GcsDestination implements IGcsDestination { + + /** + * Constructs a new GcsDestination. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.automl.v1.IGcsDestination); + + /** GcsDestination outputUriPrefix. */ + public outputUriPrefix: string; + + /** + * Creates a new GcsDestination instance using the specified properties. + * @param [properties] Properties to set + * @returns GcsDestination instance + */ + public static create(properties?: google.cloud.automl.v1.IGcsDestination): google.cloud.automl.v1.GcsDestination; + + /** + * Encodes the specified GcsDestination message. Does not implicitly {@link google.cloud.automl.v1.GcsDestination.verify|verify} messages. + * @param message GcsDestination message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.automl.v1.IGcsDestination, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GcsDestination message, length delimited. Does not implicitly {@link google.cloud.automl.v1.GcsDestination.verify|verify} messages. + * @param message GcsDestination message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.automl.v1.IGcsDestination, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GcsDestination message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GcsDestination + * @throws {Error} If the payload is not 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.automl.v1.GcsDestination; + + /** + * Decodes a GcsDestination message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GcsDestination + * @throws {Error} If the payload 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.automl.v1.GcsDestination; + + /** + * Verifies a GcsDestination message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GcsDestination message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GcsDestination + */ + public static fromObject(object: { [k: string]: any }): google.cloud.automl.v1.GcsDestination; + + /** + * Creates a plain object from a GcsDestination message. Also converts values to other types if specified. + * @param message GcsDestination + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.automl.v1.GcsDestination, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GcsDestination to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GcsDestination + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an AnnotationSpec. */ + interface IAnnotationSpec { + + /** AnnotationSpec name */ + name?: (string|null); + + /** AnnotationSpec displayName */ + displayName?: (string|null); + + /** AnnotationSpec exampleCount */ + exampleCount?: (number|null); + } + + /** Represents an AnnotationSpec. */ + class AnnotationSpec implements IAnnotationSpec { + + /** + * Constructs a new AnnotationSpec. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.automl.v1.IAnnotationSpec); + + /** AnnotationSpec name. */ + public name: string; + + /** AnnotationSpec displayName. */ + public displayName: string; + + /** AnnotationSpec exampleCount. */ + public exampleCount: number; + + /** + * Creates a new AnnotationSpec instance using the specified properties. + * @param [properties] Properties to set + * @returns AnnotationSpec instance + */ + public static create(properties?: google.cloud.automl.v1.IAnnotationSpec): google.cloud.automl.v1.AnnotationSpec; + + /** + * Encodes the specified AnnotationSpec message. Does not implicitly {@link google.cloud.automl.v1.AnnotationSpec.verify|verify} messages. + * @param message AnnotationSpec message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.automl.v1.IAnnotationSpec, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified AnnotationSpec message, length delimited. Does not implicitly {@link google.cloud.automl.v1.AnnotationSpec.verify|verify} messages. + * @param message AnnotationSpec message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.automl.v1.IAnnotationSpec, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an AnnotationSpec message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns AnnotationSpec + * @throws {Error} If the payload is not 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.automl.v1.AnnotationSpec; + + /** + * Decodes an AnnotationSpec message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns AnnotationSpec + * @throws {Error} If the payload 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.automl.v1.AnnotationSpec; + + /** + * Verifies an AnnotationSpec message. + * @param message Plain 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 AnnotationSpec message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns AnnotationSpec + */ + public static fromObject(object: { [k: string]: any }): google.cloud.automl.v1.AnnotationSpec; + + /** + * Creates a plain object from an AnnotationSpec message. Also converts values to other types if specified. + * @param message AnnotationSpec + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.automl.v1.AnnotationSpec, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this AnnotationSpec to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for AnnotationSpec + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Dataset. */ + interface IDataset { + + /** Dataset translationDatasetMetadata */ + translationDatasetMetadata?: (google.cloud.automl.v1.ITranslationDatasetMetadata|null); + + /** Dataset imageClassificationDatasetMetadata */ + imageClassificationDatasetMetadata?: (google.cloud.automl.v1.IImageClassificationDatasetMetadata|null); + + /** Dataset textClassificationDatasetMetadata */ + textClassificationDatasetMetadata?: (google.cloud.automl.v1.ITextClassificationDatasetMetadata|null); + + /** Dataset imageObjectDetectionDatasetMetadata */ + imageObjectDetectionDatasetMetadata?: (google.cloud.automl.v1.IImageObjectDetectionDatasetMetadata|null); + + /** Dataset textExtractionDatasetMetadata */ + textExtractionDatasetMetadata?: (google.cloud.automl.v1.ITextExtractionDatasetMetadata|null); + + /** Dataset textSentimentDatasetMetadata */ + textSentimentDatasetMetadata?: (google.cloud.automl.v1.ITextSentimentDatasetMetadata|null); + + /** Dataset name */ + name?: (string|null); + + /** Dataset displayName */ + displayName?: (string|null); + + /** Dataset description */ + description?: (string|null); + + /** Dataset exampleCount */ + exampleCount?: (number|null); + + /** Dataset createTime */ + createTime?: (google.protobuf.ITimestamp|null); + + /** Dataset etag */ + etag?: (string|null); + + /** Dataset labels */ + labels?: ({ [k: string]: string }|null); + } + + /** Represents a Dataset. */ + class Dataset implements IDataset { + + /** + * Constructs a new Dataset. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.automl.v1.IDataset); + + /** Dataset translationDatasetMetadata. */ + public translationDatasetMetadata?: (google.cloud.automl.v1.ITranslationDatasetMetadata|null); + + /** Dataset imageClassificationDatasetMetadata. */ + public imageClassificationDatasetMetadata?: (google.cloud.automl.v1.IImageClassificationDatasetMetadata|null); + + /** Dataset textClassificationDatasetMetadata. */ + public textClassificationDatasetMetadata?: (google.cloud.automl.v1.ITextClassificationDatasetMetadata|null); + + /** Dataset imageObjectDetectionDatasetMetadata. */ + public imageObjectDetectionDatasetMetadata?: (google.cloud.automl.v1.IImageObjectDetectionDatasetMetadata|null); + + /** Dataset textExtractionDatasetMetadata. */ + public textExtractionDatasetMetadata?: (google.cloud.automl.v1.ITextExtractionDatasetMetadata|null); + + /** Dataset textSentimentDatasetMetadata. */ + public textSentimentDatasetMetadata?: (google.cloud.automl.v1.ITextSentimentDatasetMetadata|null); + + /** Dataset name. */ + public name: string; + + /** Dataset displayName. */ + public displayName: string; + + /** Dataset description. */ + public description: string; + + /** Dataset exampleCount. */ + public exampleCount: number; + + /** Dataset createTime. */ + public createTime?: (google.protobuf.ITimestamp|null); + + /** Dataset etag. */ + public etag: string; + + /** Dataset labels. */ + public labels: { [k: string]: string }; + + /** Dataset datasetMetadata. */ + public datasetMetadata?: ("translationDatasetMetadata"|"imageClassificationDatasetMetadata"|"textClassificationDatasetMetadata"|"imageObjectDetectionDatasetMetadata"|"textExtractionDatasetMetadata"|"textSentimentDatasetMetadata"); + + /** + * Creates a new Dataset instance using the specified properties. + * @param [properties] Properties to set + * @returns Dataset instance + */ + public static create(properties?: google.cloud.automl.v1.IDataset): google.cloud.automl.v1.Dataset; + + /** + * Encodes the specified Dataset message. Does not implicitly {@link google.cloud.automl.v1.Dataset.verify|verify} messages. + * @param message Dataset message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.automl.v1.IDataset, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Dataset message, length delimited. Does not implicitly {@link google.cloud.automl.v1.Dataset.verify|verify} messages. + * @param message Dataset message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.automl.v1.IDataset, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Dataset message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Dataset + * @throws {Error} If the payload is not 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.automl.v1.Dataset; + + /** + * Decodes a Dataset message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Dataset + * @throws {Error} If the payload 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.automl.v1.Dataset; + + /** + * Verifies a Dataset message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Dataset message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Dataset + */ + public static fromObject(object: { [k: string]: any }): google.cloud.automl.v1.Dataset; + + /** + * Creates a plain object from a Dataset message. Also converts values to other types if specified. + * @param message Dataset + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.automl.v1.Dataset, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Dataset to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Dataset + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an ImageClassificationDatasetMetadata. */ + interface IImageClassificationDatasetMetadata { + + /** ImageClassificationDatasetMetadata classificationType */ + classificationType?: (google.cloud.automl.v1.ClassificationType|keyof typeof google.cloud.automl.v1.ClassificationType|null); + } + + /** Represents an ImageClassificationDatasetMetadata. */ + class ImageClassificationDatasetMetadata implements IImageClassificationDatasetMetadata { + + /** + * Constructs a new ImageClassificationDatasetMetadata. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.automl.v1.IImageClassificationDatasetMetadata); + + /** ImageClassificationDatasetMetadata classificationType. */ + public classificationType: (google.cloud.automl.v1.ClassificationType|keyof typeof google.cloud.automl.v1.ClassificationType); + + /** + * Creates a new ImageClassificationDatasetMetadata instance using the specified properties. + * @param [properties] Properties to set + * @returns ImageClassificationDatasetMetadata instance + */ + public static create(properties?: google.cloud.automl.v1.IImageClassificationDatasetMetadata): google.cloud.automl.v1.ImageClassificationDatasetMetadata; + + /** + * Encodes the specified ImageClassificationDatasetMetadata message. Does not implicitly {@link google.cloud.automl.v1.ImageClassificationDatasetMetadata.verify|verify} messages. + * @param message ImageClassificationDatasetMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.automl.v1.IImageClassificationDatasetMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ImageClassificationDatasetMetadata message, length delimited. Does not implicitly {@link google.cloud.automl.v1.ImageClassificationDatasetMetadata.verify|verify} messages. + * @param message ImageClassificationDatasetMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.automl.v1.IImageClassificationDatasetMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an ImageClassificationDatasetMetadata message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ImageClassificationDatasetMetadata + * @throws {Error} If the payload is not 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.automl.v1.ImageClassificationDatasetMetadata; + + /** + * Decodes an ImageClassificationDatasetMetadata message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ImageClassificationDatasetMetadata + * @throws {Error} If the payload 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.automl.v1.ImageClassificationDatasetMetadata; + + /** + * Verifies an ImageClassificationDatasetMetadata message. + * @param message Plain 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 ImageClassificationDatasetMetadata message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ImageClassificationDatasetMetadata + */ + public static fromObject(object: { [k: string]: any }): google.cloud.automl.v1.ImageClassificationDatasetMetadata; + + /** + * Creates a plain object from an ImageClassificationDatasetMetadata message. Also converts values to other types if specified. + * @param message ImageClassificationDatasetMetadata + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.automl.v1.ImageClassificationDatasetMetadata, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ImageClassificationDatasetMetadata to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ImageClassificationDatasetMetadata + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an ImageObjectDetectionDatasetMetadata. */ + interface IImageObjectDetectionDatasetMetadata { + } + + /** Represents an ImageObjectDetectionDatasetMetadata. */ + class ImageObjectDetectionDatasetMetadata implements IImageObjectDetectionDatasetMetadata { + + /** + * Constructs a new ImageObjectDetectionDatasetMetadata. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.automl.v1.IImageObjectDetectionDatasetMetadata); + + /** + * Creates a new ImageObjectDetectionDatasetMetadata instance using the specified properties. + * @param [properties] Properties to set + * @returns ImageObjectDetectionDatasetMetadata instance + */ + public static create(properties?: google.cloud.automl.v1.IImageObjectDetectionDatasetMetadata): google.cloud.automl.v1.ImageObjectDetectionDatasetMetadata; + + /** + * Encodes the specified ImageObjectDetectionDatasetMetadata message. Does not implicitly {@link google.cloud.automl.v1.ImageObjectDetectionDatasetMetadata.verify|verify} messages. + * @param message ImageObjectDetectionDatasetMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.automl.v1.IImageObjectDetectionDatasetMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ImageObjectDetectionDatasetMetadata message, length delimited. Does not implicitly {@link google.cloud.automl.v1.ImageObjectDetectionDatasetMetadata.verify|verify} messages. + * @param message ImageObjectDetectionDatasetMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.automl.v1.IImageObjectDetectionDatasetMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an ImageObjectDetectionDatasetMetadata message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ImageObjectDetectionDatasetMetadata + * @throws {Error} If the payload is not 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.automl.v1.ImageObjectDetectionDatasetMetadata; + + /** + * Decodes an ImageObjectDetectionDatasetMetadata message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ImageObjectDetectionDatasetMetadata + * @throws {Error} If the payload 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.automl.v1.ImageObjectDetectionDatasetMetadata; + + /** + * Verifies an ImageObjectDetectionDatasetMetadata message. + * @param message Plain 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 ImageObjectDetectionDatasetMetadata message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ImageObjectDetectionDatasetMetadata + */ + public static fromObject(object: { [k: string]: any }): google.cloud.automl.v1.ImageObjectDetectionDatasetMetadata; + + /** + * Creates a plain object from an ImageObjectDetectionDatasetMetadata message. Also converts values to other types if specified. + * @param message ImageObjectDetectionDatasetMetadata + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.automl.v1.ImageObjectDetectionDatasetMetadata, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ImageObjectDetectionDatasetMetadata to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ImageObjectDetectionDatasetMetadata + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an ImageClassificationModelMetadata. */ + interface IImageClassificationModelMetadata { + + /** ImageClassificationModelMetadata baseModelId */ + baseModelId?: (string|null); + + /** ImageClassificationModelMetadata trainBudgetMilliNodeHours */ + trainBudgetMilliNodeHours?: (number|Long|string|null); + + /** ImageClassificationModelMetadata trainCostMilliNodeHours */ + trainCostMilliNodeHours?: (number|Long|string|null); + + /** ImageClassificationModelMetadata stopReason */ + stopReason?: (string|null); + + /** ImageClassificationModelMetadata modelType */ + modelType?: (string|null); + + /** ImageClassificationModelMetadata nodeQps */ + nodeQps?: (number|null); + + /** ImageClassificationModelMetadata nodeCount */ + nodeCount?: (number|Long|string|null); + } + + /** Represents an ImageClassificationModelMetadata. */ + class ImageClassificationModelMetadata implements IImageClassificationModelMetadata { + + /** + * Constructs a new ImageClassificationModelMetadata. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.automl.v1.IImageClassificationModelMetadata); + + /** ImageClassificationModelMetadata baseModelId. */ + public baseModelId: string; + + /** ImageClassificationModelMetadata trainBudgetMilliNodeHours. */ + public trainBudgetMilliNodeHours: (number|Long|string); + + /** ImageClassificationModelMetadata trainCostMilliNodeHours. */ + public trainCostMilliNodeHours: (number|Long|string); + + /** ImageClassificationModelMetadata stopReason. */ + public stopReason: string; + + /** ImageClassificationModelMetadata modelType. */ + public modelType: string; + + /** ImageClassificationModelMetadata nodeQps. */ + public nodeQps: number; + + /** ImageClassificationModelMetadata nodeCount. */ + public nodeCount: (number|Long|string); + + /** + * Creates a new ImageClassificationModelMetadata instance using the specified properties. + * @param [properties] Properties to set + * @returns ImageClassificationModelMetadata instance + */ + public static create(properties?: google.cloud.automl.v1.IImageClassificationModelMetadata): google.cloud.automl.v1.ImageClassificationModelMetadata; + + /** + * Encodes the specified ImageClassificationModelMetadata message. Does not implicitly {@link google.cloud.automl.v1.ImageClassificationModelMetadata.verify|verify} messages. + * @param message ImageClassificationModelMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.automl.v1.IImageClassificationModelMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ImageClassificationModelMetadata message, length delimited. Does not implicitly {@link google.cloud.automl.v1.ImageClassificationModelMetadata.verify|verify} messages. + * @param message ImageClassificationModelMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.automl.v1.IImageClassificationModelMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an ImageClassificationModelMetadata message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ImageClassificationModelMetadata + * @throws {Error} If the payload is not 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.automl.v1.ImageClassificationModelMetadata; + + /** + * Decodes an ImageClassificationModelMetadata message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ImageClassificationModelMetadata + * @throws {Error} If the payload 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.automl.v1.ImageClassificationModelMetadata; + + /** + * Verifies an ImageClassificationModelMetadata message. + * @param message Plain 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 ImageClassificationModelMetadata message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ImageClassificationModelMetadata + */ + public static fromObject(object: { [k: string]: any }): google.cloud.automl.v1.ImageClassificationModelMetadata; + + /** + * Creates a plain object from an ImageClassificationModelMetadata message. Also converts values to other types if specified. + * @param message ImageClassificationModelMetadata + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.automl.v1.ImageClassificationModelMetadata, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ImageClassificationModelMetadata to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ImageClassificationModelMetadata + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an ImageObjectDetectionModelMetadata. */ + interface IImageObjectDetectionModelMetadata { + + /** ImageObjectDetectionModelMetadata modelType */ + modelType?: (string|null); + + /** ImageObjectDetectionModelMetadata nodeCount */ + nodeCount?: (number|Long|string|null); + + /** ImageObjectDetectionModelMetadata nodeQps */ + nodeQps?: (number|null); + + /** ImageObjectDetectionModelMetadata stopReason */ + stopReason?: (string|null); + + /** ImageObjectDetectionModelMetadata trainBudgetMilliNodeHours */ + trainBudgetMilliNodeHours?: (number|Long|string|null); + + /** ImageObjectDetectionModelMetadata trainCostMilliNodeHours */ + trainCostMilliNodeHours?: (number|Long|string|null); + } + + /** Represents an ImageObjectDetectionModelMetadata. */ + class ImageObjectDetectionModelMetadata implements IImageObjectDetectionModelMetadata { + + /** + * Constructs a new ImageObjectDetectionModelMetadata. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.automl.v1.IImageObjectDetectionModelMetadata); + + /** ImageObjectDetectionModelMetadata modelType. */ + public modelType: string; + + /** ImageObjectDetectionModelMetadata nodeCount. */ + public nodeCount: (number|Long|string); + + /** ImageObjectDetectionModelMetadata nodeQps. */ + public nodeQps: number; + + /** ImageObjectDetectionModelMetadata stopReason. */ + public stopReason: string; + + /** ImageObjectDetectionModelMetadata trainBudgetMilliNodeHours. */ + public trainBudgetMilliNodeHours: (number|Long|string); + + /** ImageObjectDetectionModelMetadata trainCostMilliNodeHours. */ + public trainCostMilliNodeHours: (number|Long|string); + + /** + * Creates a new ImageObjectDetectionModelMetadata instance using the specified properties. + * @param [properties] Properties to set + * @returns ImageObjectDetectionModelMetadata instance + */ + public static create(properties?: google.cloud.automl.v1.IImageObjectDetectionModelMetadata): google.cloud.automl.v1.ImageObjectDetectionModelMetadata; + + /** + * Encodes the specified ImageObjectDetectionModelMetadata message. Does not implicitly {@link google.cloud.automl.v1.ImageObjectDetectionModelMetadata.verify|verify} messages. + * @param message ImageObjectDetectionModelMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.automl.v1.IImageObjectDetectionModelMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ImageObjectDetectionModelMetadata message, length delimited. Does not implicitly {@link google.cloud.automl.v1.ImageObjectDetectionModelMetadata.verify|verify} messages. + * @param message ImageObjectDetectionModelMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.automl.v1.IImageObjectDetectionModelMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an ImageObjectDetectionModelMetadata message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ImageObjectDetectionModelMetadata + * @throws {Error} If the payload is not 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.automl.v1.ImageObjectDetectionModelMetadata; + + /** + * Decodes an ImageObjectDetectionModelMetadata message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ImageObjectDetectionModelMetadata + * @throws {Error} If the payload 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.automl.v1.ImageObjectDetectionModelMetadata; + + /** + * Verifies an ImageObjectDetectionModelMetadata message. + * @param message Plain 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 ImageObjectDetectionModelMetadata message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ImageObjectDetectionModelMetadata + */ + public static fromObject(object: { [k: string]: any }): google.cloud.automl.v1.ImageObjectDetectionModelMetadata; + + /** + * Creates a plain object from an ImageObjectDetectionModelMetadata message. Also converts values to other types if specified. + * @param message ImageObjectDetectionModelMetadata + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.automl.v1.ImageObjectDetectionModelMetadata, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ImageObjectDetectionModelMetadata to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ImageObjectDetectionModelMetadata + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an ImageClassificationModelDeploymentMetadata. */ + interface IImageClassificationModelDeploymentMetadata { + + /** ImageClassificationModelDeploymentMetadata nodeCount */ + nodeCount?: (number|Long|string|null); + } + + /** Represents an ImageClassificationModelDeploymentMetadata. */ + class ImageClassificationModelDeploymentMetadata implements IImageClassificationModelDeploymentMetadata { + + /** + * Constructs a new ImageClassificationModelDeploymentMetadata. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.automl.v1.IImageClassificationModelDeploymentMetadata); + + /** ImageClassificationModelDeploymentMetadata nodeCount. */ + public nodeCount: (number|Long|string); + + /** + * Creates a new ImageClassificationModelDeploymentMetadata instance using the specified properties. + * @param [properties] Properties to set + * @returns ImageClassificationModelDeploymentMetadata instance + */ + public static create(properties?: google.cloud.automl.v1.IImageClassificationModelDeploymentMetadata): google.cloud.automl.v1.ImageClassificationModelDeploymentMetadata; + + /** + * Encodes the specified ImageClassificationModelDeploymentMetadata message. Does not implicitly {@link google.cloud.automl.v1.ImageClassificationModelDeploymentMetadata.verify|verify} messages. + * @param message ImageClassificationModelDeploymentMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.automl.v1.IImageClassificationModelDeploymentMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ImageClassificationModelDeploymentMetadata message, length delimited. Does not implicitly {@link google.cloud.automl.v1.ImageClassificationModelDeploymentMetadata.verify|verify} messages. + * @param message ImageClassificationModelDeploymentMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.automl.v1.IImageClassificationModelDeploymentMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an ImageClassificationModelDeploymentMetadata message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ImageClassificationModelDeploymentMetadata + * @throws {Error} If the payload is not 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.automl.v1.ImageClassificationModelDeploymentMetadata; + + /** + * Decodes an ImageClassificationModelDeploymentMetadata message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ImageClassificationModelDeploymentMetadata + * @throws {Error} If the payload 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.automl.v1.ImageClassificationModelDeploymentMetadata; + + /** + * Verifies an ImageClassificationModelDeploymentMetadata message. + * @param message Plain 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 ImageClassificationModelDeploymentMetadata message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ImageClassificationModelDeploymentMetadata + */ + public static fromObject(object: { [k: string]: any }): google.cloud.automl.v1.ImageClassificationModelDeploymentMetadata; + + /** + * Creates a plain object from an ImageClassificationModelDeploymentMetadata message. Also converts values to other types if specified. + * @param message ImageClassificationModelDeploymentMetadata + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.automl.v1.ImageClassificationModelDeploymentMetadata, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ImageClassificationModelDeploymentMetadata to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ImageClassificationModelDeploymentMetadata + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an ImageObjectDetectionModelDeploymentMetadata. */ + interface IImageObjectDetectionModelDeploymentMetadata { + + /** ImageObjectDetectionModelDeploymentMetadata nodeCount */ + nodeCount?: (number|Long|string|null); + } + + /** Represents an ImageObjectDetectionModelDeploymentMetadata. */ + class ImageObjectDetectionModelDeploymentMetadata implements IImageObjectDetectionModelDeploymentMetadata { + + /** + * Constructs a new ImageObjectDetectionModelDeploymentMetadata. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.automl.v1.IImageObjectDetectionModelDeploymentMetadata); + + /** ImageObjectDetectionModelDeploymentMetadata nodeCount. */ + public nodeCount: (number|Long|string); + + /** + * Creates a new ImageObjectDetectionModelDeploymentMetadata instance using the specified properties. + * @param [properties] Properties to set + * @returns ImageObjectDetectionModelDeploymentMetadata instance + */ + public static create(properties?: google.cloud.automl.v1.IImageObjectDetectionModelDeploymentMetadata): google.cloud.automl.v1.ImageObjectDetectionModelDeploymentMetadata; + + /** + * Encodes the specified ImageObjectDetectionModelDeploymentMetadata message. Does not implicitly {@link google.cloud.automl.v1.ImageObjectDetectionModelDeploymentMetadata.verify|verify} messages. + * @param message ImageObjectDetectionModelDeploymentMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.automl.v1.IImageObjectDetectionModelDeploymentMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ImageObjectDetectionModelDeploymentMetadata message, length delimited. Does not implicitly {@link google.cloud.automl.v1.ImageObjectDetectionModelDeploymentMetadata.verify|verify} messages. + * @param message ImageObjectDetectionModelDeploymentMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.automl.v1.IImageObjectDetectionModelDeploymentMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an ImageObjectDetectionModelDeploymentMetadata message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ImageObjectDetectionModelDeploymentMetadata + * @throws {Error} If the payload is not 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.automl.v1.ImageObjectDetectionModelDeploymentMetadata; + + /** + * Decodes an ImageObjectDetectionModelDeploymentMetadata message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ImageObjectDetectionModelDeploymentMetadata + * @throws {Error} If the payload 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.automl.v1.ImageObjectDetectionModelDeploymentMetadata; + + /** + * Verifies an ImageObjectDetectionModelDeploymentMetadata message. + * @param message Plain 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 ImageObjectDetectionModelDeploymentMetadata message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ImageObjectDetectionModelDeploymentMetadata + */ + public static fromObject(object: { [k: string]: any }): google.cloud.automl.v1.ImageObjectDetectionModelDeploymentMetadata; + + /** + * Creates a plain object from an ImageObjectDetectionModelDeploymentMetadata message. Also converts values to other types if specified. + * @param message ImageObjectDetectionModelDeploymentMetadata + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.automl.v1.ImageObjectDetectionModelDeploymentMetadata, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ImageObjectDetectionModelDeploymentMetadata to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ImageObjectDetectionModelDeploymentMetadata + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TextClassificationDatasetMetadata. */ + interface ITextClassificationDatasetMetadata { + + /** TextClassificationDatasetMetadata classificationType */ + classificationType?: (google.cloud.automl.v1.ClassificationType|keyof typeof google.cloud.automl.v1.ClassificationType|null); + } + + /** Represents a TextClassificationDatasetMetadata. */ + class TextClassificationDatasetMetadata implements ITextClassificationDatasetMetadata { + + /** + * Constructs a new TextClassificationDatasetMetadata. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.automl.v1.ITextClassificationDatasetMetadata); + + /** TextClassificationDatasetMetadata classificationType. */ + public classificationType: (google.cloud.automl.v1.ClassificationType|keyof typeof google.cloud.automl.v1.ClassificationType); + + /** + * Creates a new TextClassificationDatasetMetadata instance using the specified properties. + * @param [properties] Properties to set + * @returns TextClassificationDatasetMetadata instance + */ + public static create(properties?: google.cloud.automl.v1.ITextClassificationDatasetMetadata): google.cloud.automl.v1.TextClassificationDatasetMetadata; + + /** + * Encodes the specified TextClassificationDatasetMetadata message. Does not implicitly {@link google.cloud.automl.v1.TextClassificationDatasetMetadata.verify|verify} messages. + * @param message TextClassificationDatasetMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.automl.v1.ITextClassificationDatasetMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified TextClassificationDatasetMetadata message, length delimited. Does not implicitly {@link google.cloud.automl.v1.TextClassificationDatasetMetadata.verify|verify} messages. + * @param message TextClassificationDatasetMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.automl.v1.ITextClassificationDatasetMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TextClassificationDatasetMetadata message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns TextClassificationDatasetMetadata + * @throws {Error} If the payload is not 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.automl.v1.TextClassificationDatasetMetadata; + + /** + * Decodes a TextClassificationDatasetMetadata message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns TextClassificationDatasetMetadata + * @throws {Error} If the payload 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.automl.v1.TextClassificationDatasetMetadata; + + /** + * Verifies a TextClassificationDatasetMetadata message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a TextClassificationDatasetMetadata message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns TextClassificationDatasetMetadata + */ + public static fromObject(object: { [k: string]: any }): google.cloud.automl.v1.TextClassificationDatasetMetadata; + + /** + * Creates a plain object from a TextClassificationDatasetMetadata message. Also converts values to other types if specified. + * @param message TextClassificationDatasetMetadata + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.automl.v1.TextClassificationDatasetMetadata, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this TextClassificationDatasetMetadata to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for TextClassificationDatasetMetadata + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TextClassificationModelMetadata. */ + interface ITextClassificationModelMetadata { + + /** TextClassificationModelMetadata classificationType */ + classificationType?: (google.cloud.automl.v1.ClassificationType|keyof typeof google.cloud.automl.v1.ClassificationType|null); + } + + /** Represents a TextClassificationModelMetadata. */ + class TextClassificationModelMetadata implements ITextClassificationModelMetadata { + + /** + * Constructs a new TextClassificationModelMetadata. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.automl.v1.ITextClassificationModelMetadata); + + /** TextClassificationModelMetadata classificationType. */ + public classificationType: (google.cloud.automl.v1.ClassificationType|keyof typeof google.cloud.automl.v1.ClassificationType); + + /** + * Creates a new TextClassificationModelMetadata instance using the specified properties. + * @param [properties] Properties to set + * @returns TextClassificationModelMetadata instance + */ + public static create(properties?: google.cloud.automl.v1.ITextClassificationModelMetadata): google.cloud.automl.v1.TextClassificationModelMetadata; + + /** + * Encodes the specified TextClassificationModelMetadata message. Does not implicitly {@link google.cloud.automl.v1.TextClassificationModelMetadata.verify|verify} messages. + * @param message TextClassificationModelMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.automl.v1.ITextClassificationModelMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified TextClassificationModelMetadata message, length delimited. Does not implicitly {@link google.cloud.automl.v1.TextClassificationModelMetadata.verify|verify} messages. + * @param message TextClassificationModelMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.automl.v1.ITextClassificationModelMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TextClassificationModelMetadata message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns TextClassificationModelMetadata + * @throws {Error} If the payload is not 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.automl.v1.TextClassificationModelMetadata; + + /** + * Decodes a TextClassificationModelMetadata message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns TextClassificationModelMetadata + * @throws {Error} If the payload 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.automl.v1.TextClassificationModelMetadata; + + /** + * Verifies a TextClassificationModelMetadata message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a TextClassificationModelMetadata message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns TextClassificationModelMetadata + */ + public static fromObject(object: { [k: string]: any }): google.cloud.automl.v1.TextClassificationModelMetadata; + + /** + * Creates a plain object from a TextClassificationModelMetadata message. Also converts values to other types if specified. + * @param message TextClassificationModelMetadata + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.automl.v1.TextClassificationModelMetadata, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this TextClassificationModelMetadata to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for TextClassificationModelMetadata + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TextExtractionDatasetMetadata. */ + interface ITextExtractionDatasetMetadata { + } + + /** Represents a TextExtractionDatasetMetadata. */ + class TextExtractionDatasetMetadata implements ITextExtractionDatasetMetadata { + + /** + * Constructs a new TextExtractionDatasetMetadata. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.automl.v1.ITextExtractionDatasetMetadata); + + /** + * Creates a new TextExtractionDatasetMetadata instance using the specified properties. + * @param [properties] Properties to set + * @returns TextExtractionDatasetMetadata instance + */ + public static create(properties?: google.cloud.automl.v1.ITextExtractionDatasetMetadata): google.cloud.automl.v1.TextExtractionDatasetMetadata; + + /** + * Encodes the specified TextExtractionDatasetMetadata message. Does not implicitly {@link google.cloud.automl.v1.TextExtractionDatasetMetadata.verify|verify} messages. + * @param message TextExtractionDatasetMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.automl.v1.ITextExtractionDatasetMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified TextExtractionDatasetMetadata message, length delimited. Does not implicitly {@link google.cloud.automl.v1.TextExtractionDatasetMetadata.verify|verify} messages. + * @param message TextExtractionDatasetMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.automl.v1.ITextExtractionDatasetMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TextExtractionDatasetMetadata message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns TextExtractionDatasetMetadata + * @throws {Error} If the payload is not 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.automl.v1.TextExtractionDatasetMetadata; + + /** + * Decodes a TextExtractionDatasetMetadata message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns TextExtractionDatasetMetadata + * @throws {Error} If the payload 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.automl.v1.TextExtractionDatasetMetadata; + + /** + * Verifies a TextExtractionDatasetMetadata message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a TextExtractionDatasetMetadata message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns TextExtractionDatasetMetadata + */ + public static fromObject(object: { [k: string]: any }): google.cloud.automl.v1.TextExtractionDatasetMetadata; + + /** + * Creates a plain object from a TextExtractionDatasetMetadata message. Also converts values to other types if specified. + * @param message TextExtractionDatasetMetadata + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.automl.v1.TextExtractionDatasetMetadata, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this TextExtractionDatasetMetadata to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for TextExtractionDatasetMetadata + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TextExtractionModelMetadata. */ + interface ITextExtractionModelMetadata { + } + + /** Represents a TextExtractionModelMetadata. */ + class TextExtractionModelMetadata implements ITextExtractionModelMetadata { + + /** + * Constructs a new TextExtractionModelMetadata. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.automl.v1.ITextExtractionModelMetadata); + + /** + * Creates a new TextExtractionModelMetadata instance using the specified properties. + * @param [properties] Properties to set + * @returns TextExtractionModelMetadata instance + */ + public static create(properties?: google.cloud.automl.v1.ITextExtractionModelMetadata): google.cloud.automl.v1.TextExtractionModelMetadata; + + /** + * Encodes the specified TextExtractionModelMetadata message. Does not implicitly {@link google.cloud.automl.v1.TextExtractionModelMetadata.verify|verify} messages. + * @param message TextExtractionModelMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.automl.v1.ITextExtractionModelMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified TextExtractionModelMetadata message, length delimited. Does not implicitly {@link google.cloud.automl.v1.TextExtractionModelMetadata.verify|verify} messages. + * @param message TextExtractionModelMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.automl.v1.ITextExtractionModelMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TextExtractionModelMetadata message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns TextExtractionModelMetadata + * @throws {Error} If the payload is not 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.automl.v1.TextExtractionModelMetadata; + + /** + * Decodes a TextExtractionModelMetadata message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns TextExtractionModelMetadata + * @throws {Error} If the payload 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.automl.v1.TextExtractionModelMetadata; + + /** + * Verifies a TextExtractionModelMetadata message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a TextExtractionModelMetadata message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns TextExtractionModelMetadata + */ + public static fromObject(object: { [k: string]: any }): google.cloud.automl.v1.TextExtractionModelMetadata; + + /** + * Creates a plain object from a TextExtractionModelMetadata message. Also converts values to other types if specified. + * @param message TextExtractionModelMetadata + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.automl.v1.TextExtractionModelMetadata, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this TextExtractionModelMetadata to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for TextExtractionModelMetadata + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TextSentimentDatasetMetadata. */ + interface ITextSentimentDatasetMetadata { + + /** TextSentimentDatasetMetadata sentimentMax */ + sentimentMax?: (number|null); + } + + /** Represents a TextSentimentDatasetMetadata. */ + class TextSentimentDatasetMetadata implements ITextSentimentDatasetMetadata { + + /** + * Constructs a new TextSentimentDatasetMetadata. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.automl.v1.ITextSentimentDatasetMetadata); + + /** TextSentimentDatasetMetadata sentimentMax. */ + public sentimentMax: number; + + /** + * Creates a new TextSentimentDatasetMetadata instance using the specified properties. + * @param [properties] Properties to set + * @returns TextSentimentDatasetMetadata instance + */ + public static create(properties?: google.cloud.automl.v1.ITextSentimentDatasetMetadata): google.cloud.automl.v1.TextSentimentDatasetMetadata; + + /** + * Encodes the specified TextSentimentDatasetMetadata message. Does not implicitly {@link google.cloud.automl.v1.TextSentimentDatasetMetadata.verify|verify} messages. + * @param message TextSentimentDatasetMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.automl.v1.ITextSentimentDatasetMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified TextSentimentDatasetMetadata message, length delimited. Does not implicitly {@link google.cloud.automl.v1.TextSentimentDatasetMetadata.verify|verify} messages. + * @param message TextSentimentDatasetMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.automl.v1.ITextSentimentDatasetMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TextSentimentDatasetMetadata message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns TextSentimentDatasetMetadata + * @throws {Error} If the payload is not 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.automl.v1.TextSentimentDatasetMetadata; + + /** + * Decodes a TextSentimentDatasetMetadata message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns TextSentimentDatasetMetadata + * @throws {Error} If the payload 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.automl.v1.TextSentimentDatasetMetadata; + + /** + * Verifies a TextSentimentDatasetMetadata message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a TextSentimentDatasetMetadata message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns TextSentimentDatasetMetadata + */ + public static fromObject(object: { [k: string]: any }): google.cloud.automl.v1.TextSentimentDatasetMetadata; + + /** + * Creates a plain object from a TextSentimentDatasetMetadata message. Also converts values to other types if specified. + * @param message TextSentimentDatasetMetadata + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.automl.v1.TextSentimentDatasetMetadata, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this TextSentimentDatasetMetadata to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for TextSentimentDatasetMetadata + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TextSentimentModelMetadata. */ + interface ITextSentimentModelMetadata { + } + + /** Represents a TextSentimentModelMetadata. */ + class TextSentimentModelMetadata implements ITextSentimentModelMetadata { + + /** + * Constructs a new TextSentimentModelMetadata. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.automl.v1.ITextSentimentModelMetadata); + + /** + * Creates a new TextSentimentModelMetadata instance using the specified properties. + * @param [properties] Properties to set + * @returns TextSentimentModelMetadata instance + */ + public static create(properties?: google.cloud.automl.v1.ITextSentimentModelMetadata): google.cloud.automl.v1.TextSentimentModelMetadata; + + /** + * Encodes the specified TextSentimentModelMetadata message. Does not implicitly {@link google.cloud.automl.v1.TextSentimentModelMetadata.verify|verify} messages. + * @param message TextSentimentModelMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.automl.v1.ITextSentimentModelMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified TextSentimentModelMetadata message, length delimited. Does not implicitly {@link google.cloud.automl.v1.TextSentimentModelMetadata.verify|verify} messages. + * @param message TextSentimentModelMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.automl.v1.ITextSentimentModelMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TextSentimentModelMetadata message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns TextSentimentModelMetadata + * @throws {Error} If the payload is not 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.automl.v1.TextSentimentModelMetadata; + + /** + * Decodes a TextSentimentModelMetadata message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns TextSentimentModelMetadata + * @throws {Error} If the payload 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.automl.v1.TextSentimentModelMetadata; + + /** + * Verifies a TextSentimentModelMetadata message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a TextSentimentModelMetadata message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns TextSentimentModelMetadata + */ + public static fromObject(object: { [k: string]: any }): google.cloud.automl.v1.TextSentimentModelMetadata; + + /** + * Creates a plain object from a TextSentimentModelMetadata message. Also converts values to other types if specified. + * @param message TextSentimentModelMetadata + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.automl.v1.TextSentimentModelMetadata, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this TextSentimentModelMetadata to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for TextSentimentModelMetadata + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Model. */ + interface IModel { + + /** Model translationModelMetadata */ + translationModelMetadata?: (google.cloud.automl.v1.ITranslationModelMetadata|null); + + /** Model imageClassificationModelMetadata */ + imageClassificationModelMetadata?: (google.cloud.automl.v1.IImageClassificationModelMetadata|null); + + /** Model textClassificationModelMetadata */ + textClassificationModelMetadata?: (google.cloud.automl.v1.ITextClassificationModelMetadata|null); + + /** Model imageObjectDetectionModelMetadata */ + imageObjectDetectionModelMetadata?: (google.cloud.automl.v1.IImageObjectDetectionModelMetadata|null); + + /** Model textExtractionModelMetadata */ + textExtractionModelMetadata?: (google.cloud.automl.v1.ITextExtractionModelMetadata|null); + + /** Model textSentimentModelMetadata */ + textSentimentModelMetadata?: (google.cloud.automl.v1.ITextSentimentModelMetadata|null); + + /** Model name */ + name?: (string|null); + + /** Model displayName */ + displayName?: (string|null); + + /** Model datasetId */ + datasetId?: (string|null); + + /** Model createTime */ + createTime?: (google.protobuf.ITimestamp|null); + + /** Model updateTime */ + updateTime?: (google.protobuf.ITimestamp|null); + + /** Model deploymentState */ + deploymentState?: (google.cloud.automl.v1.Model.DeploymentState|keyof typeof google.cloud.automl.v1.Model.DeploymentState|null); + + /** Model etag */ + etag?: (string|null); + + /** Model labels */ + labels?: ({ [k: string]: string }|null); + } + + /** Represents a Model. */ + class Model implements IModel { + + /** + * Constructs a new Model. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.automl.v1.IModel); + + /** Model translationModelMetadata. */ + public translationModelMetadata?: (google.cloud.automl.v1.ITranslationModelMetadata|null); + + /** Model imageClassificationModelMetadata. */ + public imageClassificationModelMetadata?: (google.cloud.automl.v1.IImageClassificationModelMetadata|null); + + /** Model textClassificationModelMetadata. */ + public textClassificationModelMetadata?: (google.cloud.automl.v1.ITextClassificationModelMetadata|null); + + /** Model imageObjectDetectionModelMetadata. */ + public imageObjectDetectionModelMetadata?: (google.cloud.automl.v1.IImageObjectDetectionModelMetadata|null); + + /** Model textExtractionModelMetadata. */ + public textExtractionModelMetadata?: (google.cloud.automl.v1.ITextExtractionModelMetadata|null); + + /** Model textSentimentModelMetadata. */ + public textSentimentModelMetadata?: (google.cloud.automl.v1.ITextSentimentModelMetadata|null); + + /** Model name. */ + public name: string; + + /** Model displayName. */ + public displayName: string; + + /** Model datasetId. */ + public datasetId: string; + + /** Model createTime. */ + public createTime?: (google.protobuf.ITimestamp|null); + + /** Model updateTime. */ + public updateTime?: (google.protobuf.ITimestamp|null); + + /** Model deploymentState. */ + public deploymentState: (google.cloud.automl.v1.Model.DeploymentState|keyof typeof google.cloud.automl.v1.Model.DeploymentState); + + /** Model etag. */ + public etag: string; + + /** Model labels. */ + public labels: { [k: string]: string }; + + /** Model modelMetadata. */ + public modelMetadata?: ("translationModelMetadata"|"imageClassificationModelMetadata"|"textClassificationModelMetadata"|"imageObjectDetectionModelMetadata"|"textExtractionModelMetadata"|"textSentimentModelMetadata"); + + /** + * Creates a new Model instance using the specified properties. + * @param [properties] Properties to set + * @returns Model instance + */ + public static create(properties?: google.cloud.automl.v1.IModel): google.cloud.automl.v1.Model; + + /** + * Encodes the specified Model message. Does not implicitly {@link google.cloud.automl.v1.Model.verify|verify} messages. + * @param message Model message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.automl.v1.IModel, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Model message, length delimited. Does not implicitly {@link google.cloud.automl.v1.Model.verify|verify} messages. + * @param message Model message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.automl.v1.IModel, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Model message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Model + * @throws {Error} If the payload is not 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.automl.v1.Model; + + /** + * Decodes a Model message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Model + * @throws {Error} If the payload 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.automl.v1.Model; + + /** + * Verifies a Model message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Model message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Model + */ + public static fromObject(object: { [k: string]: any }): google.cloud.automl.v1.Model; + + /** + * Creates a plain object from a Model message. Also converts values to other types if specified. + * @param message Model + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.automl.v1.Model, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Model to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Model + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace Model { + + /** DeploymentState enum. */ + enum DeploymentState { + DEPLOYMENT_STATE_UNSPECIFIED = 0, + DEPLOYED = 1, + UNDEPLOYED = 2 + } + } + + /** Properties of a ModelEvaluation. */ + interface IModelEvaluation { + + /** ModelEvaluation classificationEvaluationMetrics */ + classificationEvaluationMetrics?: (google.cloud.automl.v1.IClassificationEvaluationMetrics|null); + + /** ModelEvaluation translationEvaluationMetrics */ + translationEvaluationMetrics?: (google.cloud.automl.v1.ITranslationEvaluationMetrics|null); + + /** ModelEvaluation imageObjectDetectionEvaluationMetrics */ + imageObjectDetectionEvaluationMetrics?: (google.cloud.automl.v1.IImageObjectDetectionEvaluationMetrics|null); + + /** ModelEvaluation textSentimentEvaluationMetrics */ + textSentimentEvaluationMetrics?: (google.cloud.automl.v1.ITextSentimentEvaluationMetrics|null); + + /** ModelEvaluation textExtractionEvaluationMetrics */ + textExtractionEvaluationMetrics?: (google.cloud.automl.v1.ITextExtractionEvaluationMetrics|null); + + /** ModelEvaluation name */ + name?: (string|null); + + /** ModelEvaluation annotationSpecId */ + annotationSpecId?: (string|null); + + /** ModelEvaluation displayName */ + displayName?: (string|null); + + /** ModelEvaluation createTime */ + createTime?: (google.protobuf.ITimestamp|null); + + /** ModelEvaluation evaluatedExampleCount */ + evaluatedExampleCount?: (number|null); + } + + /** Represents a ModelEvaluation. */ + class ModelEvaluation implements IModelEvaluation { + + /** + * Constructs a new ModelEvaluation. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.automl.v1.IModelEvaluation); + + /** ModelEvaluation classificationEvaluationMetrics. */ + public classificationEvaluationMetrics?: (google.cloud.automl.v1.IClassificationEvaluationMetrics|null); + + /** ModelEvaluation translationEvaluationMetrics. */ + public translationEvaluationMetrics?: (google.cloud.automl.v1.ITranslationEvaluationMetrics|null); + + /** ModelEvaluation imageObjectDetectionEvaluationMetrics. */ + public imageObjectDetectionEvaluationMetrics?: (google.cloud.automl.v1.IImageObjectDetectionEvaluationMetrics|null); + + /** ModelEvaluation textSentimentEvaluationMetrics. */ + public textSentimentEvaluationMetrics?: (google.cloud.automl.v1.ITextSentimentEvaluationMetrics|null); + + /** ModelEvaluation textExtractionEvaluationMetrics. */ + public textExtractionEvaluationMetrics?: (google.cloud.automl.v1.ITextExtractionEvaluationMetrics|null); + + /** ModelEvaluation name. */ + public name: string; + + /** ModelEvaluation annotationSpecId. */ + public annotationSpecId: string; + + /** ModelEvaluation displayName. */ + public displayName: string; + + /** ModelEvaluation createTime. */ + public createTime?: (google.protobuf.ITimestamp|null); + + /** ModelEvaluation evaluatedExampleCount. */ + public evaluatedExampleCount: number; + + /** ModelEvaluation metrics. */ + public metrics?: ("classificationEvaluationMetrics"|"translationEvaluationMetrics"|"imageObjectDetectionEvaluationMetrics"|"textSentimentEvaluationMetrics"|"textExtractionEvaluationMetrics"); + + /** + * Creates a new ModelEvaluation instance using the specified properties. + * @param [properties] Properties to set + * @returns ModelEvaluation instance + */ + public static create(properties?: google.cloud.automl.v1.IModelEvaluation): google.cloud.automl.v1.ModelEvaluation; + + /** + * Encodes the specified ModelEvaluation message. Does not implicitly {@link google.cloud.automl.v1.ModelEvaluation.verify|verify} messages. + * @param message ModelEvaluation message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.automl.v1.IModelEvaluation, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ModelEvaluation message, length delimited. Does not implicitly {@link google.cloud.automl.v1.ModelEvaluation.verify|verify} messages. + * @param message ModelEvaluation message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.automl.v1.IModelEvaluation, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ModelEvaluation message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ModelEvaluation + * @throws {Error} If the payload is not 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.automl.v1.ModelEvaluation; + + /** + * Decodes a ModelEvaluation message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ModelEvaluation + * @throws {Error} If the payload 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.automl.v1.ModelEvaluation; + + /** + * Verifies a ModelEvaluation message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ModelEvaluation message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ModelEvaluation + */ + public static fromObject(object: { [k: string]: any }): google.cloud.automl.v1.ModelEvaluation; + + /** + * Creates a plain object from a ModelEvaluation message. Also converts values to other types if specified. + * @param message ModelEvaluation + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.automl.v1.ModelEvaluation, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ModelEvaluation to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ModelEvaluation + * @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 deleteDetails */ + deleteDetails?: (google.cloud.automl.v1.IDeleteOperationMetadata|null); + + /** OperationMetadata deployModelDetails */ + deployModelDetails?: (google.cloud.automl.v1.IDeployModelOperationMetadata|null); + + /** OperationMetadata undeployModelDetails */ + undeployModelDetails?: (google.cloud.automl.v1.IUndeployModelOperationMetadata|null); + + /** OperationMetadata createModelDetails */ + createModelDetails?: (google.cloud.automl.v1.ICreateModelOperationMetadata|null); + + /** OperationMetadata createDatasetDetails */ + createDatasetDetails?: (google.cloud.automl.v1.ICreateDatasetOperationMetadata|null); + + /** OperationMetadata importDataDetails */ + importDataDetails?: (google.cloud.automl.v1.IImportDataOperationMetadata|null); + + /** OperationMetadata batchPredictDetails */ + batchPredictDetails?: (google.cloud.automl.v1.IBatchPredictOperationMetadata|null); + + /** OperationMetadata exportDataDetails */ + exportDataDetails?: (google.cloud.automl.v1.IExportDataOperationMetadata|null); + + /** OperationMetadata exportModelDetails */ + exportModelDetails?: (google.cloud.automl.v1.IExportModelOperationMetadata|null); + + /** OperationMetadata progressPercent */ + progressPercent?: (number|null); + + /** OperationMetadata partialFailures */ + partialFailures?: (google.rpc.IStatus[]|null); + + /** OperationMetadata createTime */ + createTime?: (google.protobuf.ITimestamp|null); + + /** OperationMetadata updateTime */ + updateTime?: (google.protobuf.ITimestamp|null); + } + + /** Represents an OperationMetadata. */ + class OperationMetadata implements IOperationMetadata { + + /** + * Constructs a new OperationMetadata. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.automl.v1.IOperationMetadata); + + /** OperationMetadata deleteDetails. */ + public deleteDetails?: (google.cloud.automl.v1.IDeleteOperationMetadata|null); + + /** OperationMetadata deployModelDetails. */ + public deployModelDetails?: (google.cloud.automl.v1.IDeployModelOperationMetadata|null); + + /** OperationMetadata undeployModelDetails. */ + public undeployModelDetails?: (google.cloud.automl.v1.IUndeployModelOperationMetadata|null); + + /** OperationMetadata createModelDetails. */ + public createModelDetails?: (google.cloud.automl.v1.ICreateModelOperationMetadata|null); + + /** OperationMetadata createDatasetDetails. */ + public createDatasetDetails?: (google.cloud.automl.v1.ICreateDatasetOperationMetadata|null); + + /** OperationMetadata importDataDetails. */ + public importDataDetails?: (google.cloud.automl.v1.IImportDataOperationMetadata|null); + + /** OperationMetadata batchPredictDetails. */ + public batchPredictDetails?: (google.cloud.automl.v1.IBatchPredictOperationMetadata|null); + + /** OperationMetadata exportDataDetails. */ + public exportDataDetails?: (google.cloud.automl.v1.IExportDataOperationMetadata|null); + + /** OperationMetadata exportModelDetails. */ + public exportModelDetails?: (google.cloud.automl.v1.IExportModelOperationMetadata|null); + + /** OperationMetadata progressPercent. */ + public progressPercent: number; + + /** OperationMetadata partialFailures. */ + public partialFailures: google.rpc.IStatus[]; + + /** OperationMetadata createTime. */ + public createTime?: (google.protobuf.ITimestamp|null); + + /** OperationMetadata updateTime. */ + public updateTime?: (google.protobuf.ITimestamp|null); + + /** OperationMetadata details. */ + public details?: ("deleteDetails"|"deployModelDetails"|"undeployModelDetails"|"createModelDetails"|"createDatasetDetails"|"importDataDetails"|"batchPredictDetails"|"exportDataDetails"|"exportModelDetails"); + + /** + * Creates a new OperationMetadata instance using the specified properties. + * @param [properties] Properties to set + * @returns OperationMetadata instance + */ + public static create(properties?: google.cloud.automl.v1.IOperationMetadata): google.cloud.automl.v1.OperationMetadata; + + /** + * Encodes the specified OperationMetadata message. Does not implicitly {@link google.cloud.automl.v1.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.automl.v1.IOperationMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified OperationMetadata message, length delimited. Does not implicitly {@link google.cloud.automl.v1.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.automl.v1.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.automl.v1.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.automl.v1.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.automl.v1.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.automl.v1.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 DeleteOperationMetadata. */ + interface IDeleteOperationMetadata { + } + + /** Represents a DeleteOperationMetadata. */ + class DeleteOperationMetadata implements IDeleteOperationMetadata { + + /** + * Constructs a new DeleteOperationMetadata. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.automl.v1.IDeleteOperationMetadata); + + /** + * Creates a new DeleteOperationMetadata instance using the specified properties. + * @param [properties] Properties to set + * @returns DeleteOperationMetadata instance + */ + public static create(properties?: google.cloud.automl.v1.IDeleteOperationMetadata): google.cloud.automl.v1.DeleteOperationMetadata; + + /** + * Encodes the specified DeleteOperationMetadata message. Does not implicitly {@link google.cloud.automl.v1.DeleteOperationMetadata.verify|verify} messages. + * @param message DeleteOperationMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.automl.v1.IDeleteOperationMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DeleteOperationMetadata message, length delimited. Does not implicitly {@link google.cloud.automl.v1.DeleteOperationMetadata.verify|verify} messages. + * @param message DeleteOperationMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.automl.v1.IDeleteOperationMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DeleteOperationMetadata message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DeleteOperationMetadata + * @throws {Error} If the payload is not 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.automl.v1.DeleteOperationMetadata; + + /** + * Decodes a DeleteOperationMetadata message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DeleteOperationMetadata + * @throws {Error} If the payload 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.automl.v1.DeleteOperationMetadata; + + /** + * Verifies a DeleteOperationMetadata message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DeleteOperationMetadata message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DeleteOperationMetadata + */ + public static fromObject(object: { [k: string]: any }): google.cloud.automl.v1.DeleteOperationMetadata; + + /** + * Creates a plain object from a DeleteOperationMetadata message. Also converts values to other types if specified. + * @param message DeleteOperationMetadata + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.automl.v1.DeleteOperationMetadata, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DeleteOperationMetadata to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DeleteOperationMetadata + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a DeployModelOperationMetadata. */ + interface IDeployModelOperationMetadata { + } + + /** Represents a DeployModelOperationMetadata. */ + class DeployModelOperationMetadata implements IDeployModelOperationMetadata { + + /** + * Constructs a new DeployModelOperationMetadata. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.automl.v1.IDeployModelOperationMetadata); + + /** + * Creates a new DeployModelOperationMetadata instance using the specified properties. + * @param [properties] Properties to set + * @returns DeployModelOperationMetadata instance + */ + public static create(properties?: google.cloud.automl.v1.IDeployModelOperationMetadata): google.cloud.automl.v1.DeployModelOperationMetadata; + + /** + * Encodes the specified DeployModelOperationMetadata message. Does not implicitly {@link google.cloud.automl.v1.DeployModelOperationMetadata.verify|verify} messages. + * @param message DeployModelOperationMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.automl.v1.IDeployModelOperationMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DeployModelOperationMetadata message, length delimited. Does not implicitly {@link google.cloud.automl.v1.DeployModelOperationMetadata.verify|verify} messages. + * @param message DeployModelOperationMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.automl.v1.IDeployModelOperationMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DeployModelOperationMetadata message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DeployModelOperationMetadata + * @throws {Error} If the payload is not 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.automl.v1.DeployModelOperationMetadata; + + /** + * Decodes a DeployModelOperationMetadata message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DeployModelOperationMetadata + * @throws {Error} If the payload 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.automl.v1.DeployModelOperationMetadata; + + /** + * Verifies a DeployModelOperationMetadata message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DeployModelOperationMetadata message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DeployModelOperationMetadata + */ + public static fromObject(object: { [k: string]: any }): google.cloud.automl.v1.DeployModelOperationMetadata; + + /** + * Creates a plain object from a DeployModelOperationMetadata message. Also converts values to other types if specified. + * @param message DeployModelOperationMetadata + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.automl.v1.DeployModelOperationMetadata, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DeployModelOperationMetadata to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DeployModelOperationMetadata + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an UndeployModelOperationMetadata. */ + interface IUndeployModelOperationMetadata { + } + + /** Represents an UndeployModelOperationMetadata. */ + class UndeployModelOperationMetadata implements IUndeployModelOperationMetadata { + + /** + * Constructs a new UndeployModelOperationMetadata. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.automl.v1.IUndeployModelOperationMetadata); + + /** + * Creates a new UndeployModelOperationMetadata instance using the specified properties. + * @param [properties] Properties to set + * @returns UndeployModelOperationMetadata instance + */ + public static create(properties?: google.cloud.automl.v1.IUndeployModelOperationMetadata): google.cloud.automl.v1.UndeployModelOperationMetadata; + + /** + * Encodes the specified UndeployModelOperationMetadata message. Does not implicitly {@link google.cloud.automl.v1.UndeployModelOperationMetadata.verify|verify} messages. + * @param message UndeployModelOperationMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.automl.v1.IUndeployModelOperationMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified UndeployModelOperationMetadata message, length delimited. Does not implicitly {@link google.cloud.automl.v1.UndeployModelOperationMetadata.verify|verify} messages. + * @param message UndeployModelOperationMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.automl.v1.IUndeployModelOperationMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an UndeployModelOperationMetadata message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns UndeployModelOperationMetadata + * @throws {Error} If the payload is not 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.automl.v1.UndeployModelOperationMetadata; + + /** + * Decodes an UndeployModelOperationMetadata message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns UndeployModelOperationMetadata + * @throws {Error} If the payload 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.automl.v1.UndeployModelOperationMetadata; + + /** + * Verifies an UndeployModelOperationMetadata message. + * @param message Plain 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 UndeployModelOperationMetadata message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns UndeployModelOperationMetadata + */ + public static fromObject(object: { [k: string]: any }): google.cloud.automl.v1.UndeployModelOperationMetadata; + + /** + * Creates a plain object from an UndeployModelOperationMetadata message. Also converts values to other types if specified. + * @param message UndeployModelOperationMetadata + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.automl.v1.UndeployModelOperationMetadata, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this UndeployModelOperationMetadata to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for UndeployModelOperationMetadata + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a CreateDatasetOperationMetadata. */ + interface ICreateDatasetOperationMetadata { + } + + /** Represents a CreateDatasetOperationMetadata. */ + class CreateDatasetOperationMetadata implements ICreateDatasetOperationMetadata { + + /** + * Constructs a new CreateDatasetOperationMetadata. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.automl.v1.ICreateDatasetOperationMetadata); + + /** + * Creates a new CreateDatasetOperationMetadata instance using the specified properties. + * @param [properties] Properties to set + * @returns CreateDatasetOperationMetadata instance + */ + public static create(properties?: google.cloud.automl.v1.ICreateDatasetOperationMetadata): google.cloud.automl.v1.CreateDatasetOperationMetadata; + + /** + * Encodes the specified CreateDatasetOperationMetadata message. Does not implicitly {@link google.cloud.automl.v1.CreateDatasetOperationMetadata.verify|verify} messages. + * @param message CreateDatasetOperationMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.automl.v1.ICreateDatasetOperationMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CreateDatasetOperationMetadata message, length delimited. Does not implicitly {@link google.cloud.automl.v1.CreateDatasetOperationMetadata.verify|verify} messages. + * @param message CreateDatasetOperationMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.automl.v1.ICreateDatasetOperationMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CreateDatasetOperationMetadata message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CreateDatasetOperationMetadata + * @throws {Error} If the payload is not 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.automl.v1.CreateDatasetOperationMetadata; + + /** + * Decodes a CreateDatasetOperationMetadata message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CreateDatasetOperationMetadata + * @throws {Error} If the payload 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.automl.v1.CreateDatasetOperationMetadata; + + /** + * Verifies a CreateDatasetOperationMetadata message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CreateDatasetOperationMetadata message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CreateDatasetOperationMetadata + */ + public static fromObject(object: { [k: string]: any }): google.cloud.automl.v1.CreateDatasetOperationMetadata; + + /** + * Creates a plain object from a CreateDatasetOperationMetadata message. Also converts values to other types if specified. + * @param message CreateDatasetOperationMetadata + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.automl.v1.CreateDatasetOperationMetadata, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CreateDatasetOperationMetadata to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CreateDatasetOperationMetadata + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a CreateModelOperationMetadata. */ + interface ICreateModelOperationMetadata { + } + + /** Represents a CreateModelOperationMetadata. */ + class CreateModelOperationMetadata implements ICreateModelOperationMetadata { + + /** + * Constructs a new CreateModelOperationMetadata. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.automl.v1.ICreateModelOperationMetadata); + + /** + * Creates a new CreateModelOperationMetadata instance using the specified properties. + * @param [properties] Properties to set + * @returns CreateModelOperationMetadata instance + */ + public static create(properties?: google.cloud.automl.v1.ICreateModelOperationMetadata): google.cloud.automl.v1.CreateModelOperationMetadata; + + /** + * Encodes the specified CreateModelOperationMetadata message. Does not implicitly {@link google.cloud.automl.v1.CreateModelOperationMetadata.verify|verify} messages. + * @param message CreateModelOperationMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.automl.v1.ICreateModelOperationMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CreateModelOperationMetadata message, length delimited. Does not implicitly {@link google.cloud.automl.v1.CreateModelOperationMetadata.verify|verify} messages. + * @param message CreateModelOperationMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.automl.v1.ICreateModelOperationMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CreateModelOperationMetadata message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CreateModelOperationMetadata + * @throws {Error} If the payload is not 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.automl.v1.CreateModelOperationMetadata; + + /** + * Decodes a CreateModelOperationMetadata message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CreateModelOperationMetadata + * @throws {Error} If the payload 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.automl.v1.CreateModelOperationMetadata; + + /** + * Verifies a CreateModelOperationMetadata message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CreateModelOperationMetadata message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CreateModelOperationMetadata + */ + public static fromObject(object: { [k: string]: any }): google.cloud.automl.v1.CreateModelOperationMetadata; + + /** + * Creates a plain object from a CreateModelOperationMetadata message. Also converts values to other types if specified. + * @param message CreateModelOperationMetadata + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.automl.v1.CreateModelOperationMetadata, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CreateModelOperationMetadata to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CreateModelOperationMetadata + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an ImportDataOperationMetadata. */ + interface IImportDataOperationMetadata { + } + + /** Represents an ImportDataOperationMetadata. */ + class ImportDataOperationMetadata implements IImportDataOperationMetadata { + + /** + * Constructs a new ImportDataOperationMetadata. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.automl.v1.IImportDataOperationMetadata); + + /** + * Creates a new ImportDataOperationMetadata instance using the specified properties. + * @param [properties] Properties to set + * @returns ImportDataOperationMetadata instance + */ + public static create(properties?: google.cloud.automl.v1.IImportDataOperationMetadata): google.cloud.automl.v1.ImportDataOperationMetadata; + + /** + * Encodes the specified ImportDataOperationMetadata message. Does not implicitly {@link google.cloud.automl.v1.ImportDataOperationMetadata.verify|verify} messages. + * @param message ImportDataOperationMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.automl.v1.IImportDataOperationMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ImportDataOperationMetadata message, length delimited. Does not implicitly {@link google.cloud.automl.v1.ImportDataOperationMetadata.verify|verify} messages. + * @param message ImportDataOperationMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.automl.v1.IImportDataOperationMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an ImportDataOperationMetadata message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ImportDataOperationMetadata + * @throws {Error} If the payload is not 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.automl.v1.ImportDataOperationMetadata; + + /** + * Decodes an ImportDataOperationMetadata message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ImportDataOperationMetadata + * @throws {Error} If the payload 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.automl.v1.ImportDataOperationMetadata; + + /** + * Verifies an ImportDataOperationMetadata message. + * @param message Plain 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 ImportDataOperationMetadata message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ImportDataOperationMetadata + */ + public static fromObject(object: { [k: string]: any }): google.cloud.automl.v1.ImportDataOperationMetadata; + + /** + * Creates a plain object from an ImportDataOperationMetadata message. Also converts values to other types if specified. + * @param message ImportDataOperationMetadata + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.automl.v1.ImportDataOperationMetadata, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ImportDataOperationMetadata to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ImportDataOperationMetadata + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an ExportDataOperationMetadata. */ + interface IExportDataOperationMetadata { + + /** ExportDataOperationMetadata outputInfo */ + outputInfo?: (google.cloud.automl.v1.ExportDataOperationMetadata.IExportDataOutputInfo|null); + } + + /** Represents an ExportDataOperationMetadata. */ + class ExportDataOperationMetadata implements IExportDataOperationMetadata { + + /** + * Constructs a new ExportDataOperationMetadata. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.automl.v1.IExportDataOperationMetadata); + + /** ExportDataOperationMetadata outputInfo. */ + public outputInfo?: (google.cloud.automl.v1.ExportDataOperationMetadata.IExportDataOutputInfo|null); + + /** + * Creates a new ExportDataOperationMetadata instance using the specified properties. + * @param [properties] Properties to set + * @returns ExportDataOperationMetadata instance + */ + public static create(properties?: google.cloud.automl.v1.IExportDataOperationMetadata): google.cloud.automl.v1.ExportDataOperationMetadata; + + /** + * Encodes the specified ExportDataOperationMetadata message. Does not implicitly {@link google.cloud.automl.v1.ExportDataOperationMetadata.verify|verify} messages. + * @param message ExportDataOperationMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.automl.v1.IExportDataOperationMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ExportDataOperationMetadata message, length delimited. Does not implicitly {@link google.cloud.automl.v1.ExportDataOperationMetadata.verify|verify} messages. + * @param message ExportDataOperationMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.automl.v1.IExportDataOperationMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an ExportDataOperationMetadata message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ExportDataOperationMetadata + * @throws {Error} If the payload is not 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.automl.v1.ExportDataOperationMetadata; + + /** + * Decodes an ExportDataOperationMetadata message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ExportDataOperationMetadata + * @throws {Error} If the payload 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.automl.v1.ExportDataOperationMetadata; + + /** + * Verifies an ExportDataOperationMetadata message. + * @param message Plain 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 ExportDataOperationMetadata message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ExportDataOperationMetadata + */ + public static fromObject(object: { [k: string]: any }): google.cloud.automl.v1.ExportDataOperationMetadata; + + /** + * Creates a plain object from an ExportDataOperationMetadata message. Also converts values to other types if specified. + * @param message ExportDataOperationMetadata + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.automl.v1.ExportDataOperationMetadata, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ExportDataOperationMetadata to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ExportDataOperationMetadata + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace ExportDataOperationMetadata { + + /** Properties of an ExportDataOutputInfo. */ + interface IExportDataOutputInfo { + + /** ExportDataOutputInfo gcsOutputDirectory */ + gcsOutputDirectory?: (string|null); + } + + /** Represents an ExportDataOutputInfo. */ + class ExportDataOutputInfo implements IExportDataOutputInfo { + + /** + * Constructs a new ExportDataOutputInfo. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.automl.v1.ExportDataOperationMetadata.IExportDataOutputInfo); + + /** ExportDataOutputInfo gcsOutputDirectory. */ + public gcsOutputDirectory?: (string|null); + + /** ExportDataOutputInfo outputLocation. */ + public outputLocation?: "gcsOutputDirectory"; + + /** + * Creates a new ExportDataOutputInfo instance using the specified properties. + * @param [properties] Properties to set + * @returns ExportDataOutputInfo instance + */ + public static create(properties?: google.cloud.automl.v1.ExportDataOperationMetadata.IExportDataOutputInfo): google.cloud.automl.v1.ExportDataOperationMetadata.ExportDataOutputInfo; + + /** + * Encodes the specified ExportDataOutputInfo message. Does not implicitly {@link google.cloud.automl.v1.ExportDataOperationMetadata.ExportDataOutputInfo.verify|verify} messages. + * @param message ExportDataOutputInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.automl.v1.ExportDataOperationMetadata.IExportDataOutputInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ExportDataOutputInfo message, length delimited. Does not implicitly {@link google.cloud.automl.v1.ExportDataOperationMetadata.ExportDataOutputInfo.verify|verify} messages. + * @param message ExportDataOutputInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.automl.v1.ExportDataOperationMetadata.IExportDataOutputInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an ExportDataOutputInfo message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ExportDataOutputInfo + * @throws {Error} If the payload is not 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.automl.v1.ExportDataOperationMetadata.ExportDataOutputInfo; + + /** + * Decodes an ExportDataOutputInfo message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ExportDataOutputInfo + * @throws {Error} If the payload 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.automl.v1.ExportDataOperationMetadata.ExportDataOutputInfo; + + /** + * Verifies an ExportDataOutputInfo message. + * @param message Plain 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 ExportDataOutputInfo message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ExportDataOutputInfo + */ + public static fromObject(object: { [k: string]: any }): google.cloud.automl.v1.ExportDataOperationMetadata.ExportDataOutputInfo; + + /** + * Creates a plain object from an ExportDataOutputInfo message. Also converts values to other types if specified. + * @param message ExportDataOutputInfo + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.automl.v1.ExportDataOperationMetadata.ExportDataOutputInfo, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ExportDataOutputInfo to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ExportDataOutputInfo + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Properties of a BatchPredictOperationMetadata. */ + interface IBatchPredictOperationMetadata { + + /** BatchPredictOperationMetadata inputConfig */ + inputConfig?: (google.cloud.automl.v1.IBatchPredictInputConfig|null); + + /** BatchPredictOperationMetadata outputInfo */ + outputInfo?: (google.cloud.automl.v1.BatchPredictOperationMetadata.IBatchPredictOutputInfo|null); + } + + /** Represents a BatchPredictOperationMetadata. */ + class BatchPredictOperationMetadata implements IBatchPredictOperationMetadata { + + /** + * Constructs a new BatchPredictOperationMetadata. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.automl.v1.IBatchPredictOperationMetadata); + + /** BatchPredictOperationMetadata inputConfig. */ + public inputConfig?: (google.cloud.automl.v1.IBatchPredictInputConfig|null); + + /** BatchPredictOperationMetadata outputInfo. */ + public outputInfo?: (google.cloud.automl.v1.BatchPredictOperationMetadata.IBatchPredictOutputInfo|null); + + /** + * Creates a new BatchPredictOperationMetadata instance using the specified properties. + * @param [properties] Properties to set + * @returns BatchPredictOperationMetadata instance + */ + public static create(properties?: google.cloud.automl.v1.IBatchPredictOperationMetadata): google.cloud.automl.v1.BatchPredictOperationMetadata; + + /** + * Encodes the specified BatchPredictOperationMetadata message. Does not implicitly {@link google.cloud.automl.v1.BatchPredictOperationMetadata.verify|verify} messages. + * @param message BatchPredictOperationMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.automl.v1.IBatchPredictOperationMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified BatchPredictOperationMetadata message, length delimited. Does not implicitly {@link google.cloud.automl.v1.BatchPredictOperationMetadata.verify|verify} messages. + * @param message BatchPredictOperationMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.automl.v1.IBatchPredictOperationMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a BatchPredictOperationMetadata message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns BatchPredictOperationMetadata + * @throws {Error} If the payload is not 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.automl.v1.BatchPredictOperationMetadata; + + /** + * Decodes a BatchPredictOperationMetadata message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns BatchPredictOperationMetadata + * @throws {Error} If the payload 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.automl.v1.BatchPredictOperationMetadata; + + /** + * Verifies a BatchPredictOperationMetadata message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a BatchPredictOperationMetadata message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns BatchPredictOperationMetadata + */ + public static fromObject(object: { [k: string]: any }): google.cloud.automl.v1.BatchPredictOperationMetadata; + + /** + * Creates a plain object from a BatchPredictOperationMetadata message. Also converts values to other types if specified. + * @param message BatchPredictOperationMetadata + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.automl.v1.BatchPredictOperationMetadata, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this BatchPredictOperationMetadata to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for BatchPredictOperationMetadata + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace BatchPredictOperationMetadata { + + /** Properties of a BatchPredictOutputInfo. */ + interface IBatchPredictOutputInfo { + + /** BatchPredictOutputInfo gcsOutputDirectory */ + gcsOutputDirectory?: (string|null); + } + + /** Represents a BatchPredictOutputInfo. */ + class BatchPredictOutputInfo implements IBatchPredictOutputInfo { + + /** + * Constructs a new BatchPredictOutputInfo. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.automl.v1.BatchPredictOperationMetadata.IBatchPredictOutputInfo); + + /** BatchPredictOutputInfo gcsOutputDirectory. */ + public gcsOutputDirectory?: (string|null); + + /** BatchPredictOutputInfo outputLocation. */ + public outputLocation?: "gcsOutputDirectory"; + + /** + * Creates a new BatchPredictOutputInfo instance using the specified properties. + * @param [properties] Properties to set + * @returns BatchPredictOutputInfo instance + */ + public static create(properties?: google.cloud.automl.v1.BatchPredictOperationMetadata.IBatchPredictOutputInfo): google.cloud.automl.v1.BatchPredictOperationMetadata.BatchPredictOutputInfo; + + /** + * Encodes the specified BatchPredictOutputInfo message. Does not implicitly {@link google.cloud.automl.v1.BatchPredictOperationMetadata.BatchPredictOutputInfo.verify|verify} messages. + * @param message BatchPredictOutputInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.automl.v1.BatchPredictOperationMetadata.IBatchPredictOutputInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified BatchPredictOutputInfo message, length delimited. Does not implicitly {@link google.cloud.automl.v1.BatchPredictOperationMetadata.BatchPredictOutputInfo.verify|verify} messages. + * @param message BatchPredictOutputInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.automl.v1.BatchPredictOperationMetadata.IBatchPredictOutputInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a BatchPredictOutputInfo message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns BatchPredictOutputInfo + * @throws {Error} If the payload is not 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.automl.v1.BatchPredictOperationMetadata.BatchPredictOutputInfo; + + /** + * Decodes a BatchPredictOutputInfo message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns BatchPredictOutputInfo + * @throws {Error} If the payload 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.automl.v1.BatchPredictOperationMetadata.BatchPredictOutputInfo; + + /** + * Verifies a BatchPredictOutputInfo message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a BatchPredictOutputInfo message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns BatchPredictOutputInfo + */ + public static fromObject(object: { [k: string]: any }): google.cloud.automl.v1.BatchPredictOperationMetadata.BatchPredictOutputInfo; + + /** + * Creates a plain object from a BatchPredictOutputInfo message. Also converts values to other types if specified. + * @param message BatchPredictOutputInfo + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.automl.v1.BatchPredictOperationMetadata.BatchPredictOutputInfo, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this BatchPredictOutputInfo to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for BatchPredictOutputInfo + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Properties of an ExportModelOperationMetadata. */ + interface IExportModelOperationMetadata { + + /** ExportModelOperationMetadata outputInfo */ + outputInfo?: (google.cloud.automl.v1.ExportModelOperationMetadata.IExportModelOutputInfo|null); + } + + /** Represents an ExportModelOperationMetadata. */ + class ExportModelOperationMetadata implements IExportModelOperationMetadata { + + /** + * Constructs a new ExportModelOperationMetadata. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.automl.v1.IExportModelOperationMetadata); + + /** ExportModelOperationMetadata outputInfo. */ + public outputInfo?: (google.cloud.automl.v1.ExportModelOperationMetadata.IExportModelOutputInfo|null); + + /** + * Creates a new ExportModelOperationMetadata instance using the specified properties. + * @param [properties] Properties to set + * @returns ExportModelOperationMetadata instance + */ + public static create(properties?: google.cloud.automl.v1.IExportModelOperationMetadata): google.cloud.automl.v1.ExportModelOperationMetadata; + + /** + * Encodes the specified ExportModelOperationMetadata message. Does not implicitly {@link google.cloud.automl.v1.ExportModelOperationMetadata.verify|verify} messages. + * @param message ExportModelOperationMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.automl.v1.IExportModelOperationMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ExportModelOperationMetadata message, length delimited. Does not implicitly {@link google.cloud.automl.v1.ExportModelOperationMetadata.verify|verify} messages. + * @param message ExportModelOperationMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.automl.v1.IExportModelOperationMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an ExportModelOperationMetadata message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ExportModelOperationMetadata + * @throws {Error} If the payload is not 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.automl.v1.ExportModelOperationMetadata; + + /** + * Decodes an ExportModelOperationMetadata message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ExportModelOperationMetadata + * @throws {Error} If the payload 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.automl.v1.ExportModelOperationMetadata; + + /** + * Verifies an ExportModelOperationMetadata message. + * @param message Plain 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 ExportModelOperationMetadata message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ExportModelOperationMetadata + */ + public static fromObject(object: { [k: string]: any }): google.cloud.automl.v1.ExportModelOperationMetadata; + + /** + * Creates a plain object from an ExportModelOperationMetadata message. Also converts values to other types if specified. + * @param message ExportModelOperationMetadata + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.automl.v1.ExportModelOperationMetadata, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ExportModelOperationMetadata to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ExportModelOperationMetadata + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace ExportModelOperationMetadata { + + /** Properties of an ExportModelOutputInfo. */ + interface IExportModelOutputInfo { + + /** ExportModelOutputInfo gcsOutputDirectory */ + gcsOutputDirectory?: (string|null); + } + + /** Represents an ExportModelOutputInfo. */ + class ExportModelOutputInfo implements IExportModelOutputInfo { + + /** + * Constructs a new ExportModelOutputInfo. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.automl.v1.ExportModelOperationMetadata.IExportModelOutputInfo); + + /** ExportModelOutputInfo gcsOutputDirectory. */ + public gcsOutputDirectory: string; + + /** + * Creates a new ExportModelOutputInfo instance using the specified properties. + * @param [properties] Properties to set + * @returns ExportModelOutputInfo instance + */ + public static create(properties?: google.cloud.automl.v1.ExportModelOperationMetadata.IExportModelOutputInfo): google.cloud.automl.v1.ExportModelOperationMetadata.ExportModelOutputInfo; + + /** + * Encodes the specified ExportModelOutputInfo message. Does not implicitly {@link google.cloud.automl.v1.ExportModelOperationMetadata.ExportModelOutputInfo.verify|verify} messages. + * @param message ExportModelOutputInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.automl.v1.ExportModelOperationMetadata.IExportModelOutputInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ExportModelOutputInfo message, length delimited. Does not implicitly {@link google.cloud.automl.v1.ExportModelOperationMetadata.ExportModelOutputInfo.verify|verify} messages. + * @param message ExportModelOutputInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.automl.v1.ExportModelOperationMetadata.IExportModelOutputInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an ExportModelOutputInfo message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ExportModelOutputInfo + * @throws {Error} If the payload is not 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.automl.v1.ExportModelOperationMetadata.ExportModelOutputInfo; + + /** + * Decodes an ExportModelOutputInfo message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ExportModelOutputInfo + * @throws {Error} If the payload 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.automl.v1.ExportModelOperationMetadata.ExportModelOutputInfo; + + /** + * Verifies an ExportModelOutputInfo message. + * @param message Plain 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 ExportModelOutputInfo message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ExportModelOutputInfo + */ + public static fromObject(object: { [k: string]: any }): google.cloud.automl.v1.ExportModelOperationMetadata.ExportModelOutputInfo; + + /** + * Creates a plain object from an ExportModelOutputInfo message. Also converts values to other types if specified. + * @param message ExportModelOutputInfo + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.automl.v1.ExportModelOperationMetadata.ExportModelOutputInfo, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ExportModelOutputInfo to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ExportModelOutputInfo + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Represents a PredictionService */ + class PredictionService extends $protobuf.rpc.Service { + + /** + * Constructs a new PredictionService 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 PredictionService 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): PredictionService; + + /** + * Calls Predict. + * @param request PredictRequest message or plain object + * @param callback Node-style callback called with the error, if any, and PredictResponse + */ + public predict(request: google.cloud.automl.v1.IPredictRequest, callback: google.cloud.automl.v1.PredictionService.PredictCallback): void; + + /** + * Calls Predict. + * @param request PredictRequest message or plain object + * @returns Promise + */ + public predict(request: google.cloud.automl.v1.IPredictRequest): Promise; + + /** + * Calls BatchPredict. + * @param request BatchPredictRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public batchPredict(request: google.cloud.automl.v1.IBatchPredictRequest, callback: google.cloud.automl.v1.PredictionService.BatchPredictCallback): void; + + /** + * Calls BatchPredict. + * @param request BatchPredictRequest message or plain object + * @returns Promise + */ + public batchPredict(request: google.cloud.automl.v1.IBatchPredictRequest): Promise; + } + + namespace PredictionService { + + /** + * Callback as used by {@link google.cloud.automl.v1.PredictionService|predict}. + * @param error Error, if any + * @param [response] PredictResponse + */ + type PredictCallback = (error: (Error|null), response?: google.cloud.automl.v1.PredictResponse) => void; + + /** + * Callback as used by {@link google.cloud.automl.v1.PredictionService|batchPredict}. + * @param error Error, if any + * @param [response] Operation + */ + type BatchPredictCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + } + + /** Properties of a PredictRequest. */ + interface IPredictRequest { + + /** PredictRequest name */ + name?: (string|null); + + /** PredictRequest payload */ + payload?: (google.cloud.automl.v1.IExamplePayload|null); + + /** PredictRequest params */ + params?: ({ [k: string]: string }|null); + } + + /** Represents a PredictRequest. */ + class PredictRequest implements IPredictRequest { + + /** + * Constructs a new PredictRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.automl.v1.IPredictRequest); + + /** PredictRequest name. */ + public name: string; + + /** PredictRequest payload. */ + public payload?: (google.cloud.automl.v1.IExamplePayload|null); + + /** PredictRequest params. */ + public params: { [k: string]: string }; + + /** + * Creates a new PredictRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns PredictRequest instance + */ + public static create(properties?: google.cloud.automl.v1.IPredictRequest): google.cloud.automl.v1.PredictRequest; + + /** + * Encodes the specified PredictRequest message. Does not implicitly {@link google.cloud.automl.v1.PredictRequest.verify|verify} messages. + * @param message PredictRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.automl.v1.IPredictRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified PredictRequest message, length delimited. Does not implicitly {@link google.cloud.automl.v1.PredictRequest.verify|verify} messages. + * @param message PredictRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.automl.v1.IPredictRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a PredictRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns PredictRequest + * @throws {Error} If the payload is not 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.automl.v1.PredictRequest; + + /** + * Decodes a PredictRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns PredictRequest + * @throws {Error} If the payload 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.automl.v1.PredictRequest; + + /** + * Verifies a PredictRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a PredictRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns PredictRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.automl.v1.PredictRequest; + + /** + * Creates a plain object from a PredictRequest message. Also converts values to other types if specified. + * @param message PredictRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.automl.v1.PredictRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this PredictRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for PredictRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a PredictResponse. */ + interface IPredictResponse { + + /** PredictResponse payload */ + payload?: (google.cloud.automl.v1.IAnnotationPayload[]|null); + + /** PredictResponse preprocessedInput */ + preprocessedInput?: (google.cloud.automl.v1.IExamplePayload|null); + + /** PredictResponse metadata */ + metadata?: ({ [k: string]: string }|null); + } + + /** Represents a PredictResponse. */ + class PredictResponse implements IPredictResponse { + + /** + * Constructs a new PredictResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.automl.v1.IPredictResponse); + + /** PredictResponse payload. */ + public payload: google.cloud.automl.v1.IAnnotationPayload[]; + + /** PredictResponse preprocessedInput. */ + public preprocessedInput?: (google.cloud.automl.v1.IExamplePayload|null); + + /** PredictResponse metadata. */ + public metadata: { [k: string]: string }; + + /** + * Creates a new PredictResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns PredictResponse instance + */ + public static create(properties?: google.cloud.automl.v1.IPredictResponse): google.cloud.automl.v1.PredictResponse; + + /** + * Encodes the specified PredictResponse message. Does not implicitly {@link google.cloud.automl.v1.PredictResponse.verify|verify} messages. + * @param message PredictResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.automl.v1.IPredictResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified PredictResponse message, length delimited. Does not implicitly {@link google.cloud.automl.v1.PredictResponse.verify|verify} messages. + * @param message PredictResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.automl.v1.IPredictResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a PredictResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns PredictResponse + * @throws {Error} If the payload is not 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.automl.v1.PredictResponse; + + /** + * Decodes a PredictResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns PredictResponse + * @throws {Error} If the payload 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.automl.v1.PredictResponse; + + /** + * Verifies a PredictResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a PredictResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns PredictResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.automl.v1.PredictResponse; + + /** + * Creates a plain object from a PredictResponse message. Also converts values to other types if specified. + * @param message PredictResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.automl.v1.PredictResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this PredictResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for PredictResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a BatchPredictRequest. */ + interface IBatchPredictRequest { + + /** BatchPredictRequest name */ + name?: (string|null); + + /** BatchPredictRequest inputConfig */ + inputConfig?: (google.cloud.automl.v1.IBatchPredictInputConfig|null); + + /** BatchPredictRequest outputConfig */ + outputConfig?: (google.cloud.automl.v1.IBatchPredictOutputConfig|null); + + /** BatchPredictRequest params */ + params?: ({ [k: string]: string }|null); + } + + /** Represents a BatchPredictRequest. */ + class BatchPredictRequest implements IBatchPredictRequest { + + /** + * Constructs a new BatchPredictRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.automl.v1.IBatchPredictRequest); + + /** BatchPredictRequest name. */ + public name: string; + + /** BatchPredictRequest inputConfig. */ + public inputConfig?: (google.cloud.automl.v1.IBatchPredictInputConfig|null); + + /** BatchPredictRequest outputConfig. */ + public outputConfig?: (google.cloud.automl.v1.IBatchPredictOutputConfig|null); + + /** BatchPredictRequest params. */ + public params: { [k: string]: string }; + + /** + * Creates a new BatchPredictRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns BatchPredictRequest instance + */ + public static create(properties?: google.cloud.automl.v1.IBatchPredictRequest): google.cloud.automl.v1.BatchPredictRequest; + + /** + * Encodes the specified BatchPredictRequest message. Does not implicitly {@link google.cloud.automl.v1.BatchPredictRequest.verify|verify} messages. + * @param message BatchPredictRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.automl.v1.IBatchPredictRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified BatchPredictRequest message, length delimited. Does not implicitly {@link google.cloud.automl.v1.BatchPredictRequest.verify|verify} messages. + * @param message BatchPredictRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.automl.v1.IBatchPredictRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a BatchPredictRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns BatchPredictRequest + * @throws {Error} If the payload is not 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.automl.v1.BatchPredictRequest; + + /** + * Decodes a BatchPredictRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns BatchPredictRequest + * @throws {Error} If the payload 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.automl.v1.BatchPredictRequest; + + /** + * Verifies a BatchPredictRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a BatchPredictRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns BatchPredictRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.automl.v1.BatchPredictRequest; + + /** + * Creates a plain object from a BatchPredictRequest message. Also converts values to other types if specified. + * @param message BatchPredictRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.automl.v1.BatchPredictRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this BatchPredictRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for BatchPredictRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a BatchPredictResult. */ + interface IBatchPredictResult { + + /** BatchPredictResult metadata */ + metadata?: ({ [k: string]: string }|null); + } + + /** Represents a BatchPredictResult. */ + class BatchPredictResult implements IBatchPredictResult { + + /** + * Constructs a new BatchPredictResult. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.automl.v1.IBatchPredictResult); + + /** BatchPredictResult metadata. */ + public metadata: { [k: string]: string }; + + /** + * Creates a new BatchPredictResult instance using the specified properties. + * @param [properties] Properties to set + * @returns BatchPredictResult instance + */ + public static create(properties?: google.cloud.automl.v1.IBatchPredictResult): google.cloud.automl.v1.BatchPredictResult; + + /** + * Encodes the specified BatchPredictResult message. Does not implicitly {@link google.cloud.automl.v1.BatchPredictResult.verify|verify} messages. + * @param message BatchPredictResult message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.automl.v1.IBatchPredictResult, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified BatchPredictResult message, length delimited. Does not implicitly {@link google.cloud.automl.v1.BatchPredictResult.verify|verify} messages. + * @param message BatchPredictResult message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.automl.v1.IBatchPredictResult, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a BatchPredictResult message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns BatchPredictResult + * @throws {Error} If the payload is not 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.automl.v1.BatchPredictResult; + + /** + * Decodes a BatchPredictResult message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns BatchPredictResult + * @throws {Error} If the payload 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.automl.v1.BatchPredictResult; + + /** + * Verifies a BatchPredictResult message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a BatchPredictResult message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns BatchPredictResult + */ + public static fromObject(object: { [k: string]: any }): google.cloud.automl.v1.BatchPredictResult; + + /** + * Creates a plain object from a BatchPredictResult message. Also converts values to other types if specified. + * @param message BatchPredictResult + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.automl.v1.BatchPredictResult, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this BatchPredictResult to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for BatchPredictResult + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Represents an AutoMl */ + class AutoMl extends $protobuf.rpc.Service { + + /** + * Constructs a new AutoMl 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 AutoMl 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): AutoMl; + + /** + * Calls CreateDataset. + * @param request CreateDatasetRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public createDataset(request: google.cloud.automl.v1.ICreateDatasetRequest, callback: google.cloud.automl.v1.AutoMl.CreateDatasetCallback): void; + + /** + * Calls CreateDataset. + * @param request CreateDatasetRequest message or plain object + * @returns Promise + */ + public createDataset(request: google.cloud.automl.v1.ICreateDatasetRequest): Promise; + + /** + * Calls GetDataset. + * @param request GetDatasetRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Dataset + */ + public getDataset(request: google.cloud.automl.v1.IGetDatasetRequest, callback: google.cloud.automl.v1.AutoMl.GetDatasetCallback): void; + + /** + * Calls GetDataset. + * @param request GetDatasetRequest message or plain object + * @returns Promise + */ + public getDataset(request: google.cloud.automl.v1.IGetDatasetRequest): Promise; + + /** + * Calls ListDatasets. + * @param request ListDatasetsRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ListDatasetsResponse + */ + public listDatasets(request: google.cloud.automl.v1.IListDatasetsRequest, callback: google.cloud.automl.v1.AutoMl.ListDatasetsCallback): void; + + /** + * Calls ListDatasets. + * @param request ListDatasetsRequest message or plain object + * @returns Promise + */ + public listDatasets(request: google.cloud.automl.v1.IListDatasetsRequest): Promise; + + /** + * Calls UpdateDataset. + * @param request UpdateDatasetRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Dataset + */ + public updateDataset(request: google.cloud.automl.v1.IUpdateDatasetRequest, callback: google.cloud.automl.v1.AutoMl.UpdateDatasetCallback): void; + + /** + * Calls UpdateDataset. + * @param request UpdateDatasetRequest message or plain object + * @returns Promise + */ + public updateDataset(request: google.cloud.automl.v1.IUpdateDatasetRequest): Promise; + + /** + * Calls DeleteDataset. + * @param request DeleteDatasetRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public deleteDataset(request: google.cloud.automl.v1.IDeleteDatasetRequest, callback: google.cloud.automl.v1.AutoMl.DeleteDatasetCallback): void; + + /** + * Calls DeleteDataset. + * @param request DeleteDatasetRequest message or plain object + * @returns Promise + */ + public deleteDataset(request: google.cloud.automl.v1.IDeleteDatasetRequest): Promise; + + /** + * Calls ImportData. + * @param request ImportDataRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public importData(request: google.cloud.automl.v1.IImportDataRequest, callback: google.cloud.automl.v1.AutoMl.ImportDataCallback): void; + + /** + * Calls ImportData. + * @param request ImportDataRequest message or plain object + * @returns Promise + */ + public importData(request: google.cloud.automl.v1.IImportDataRequest): Promise; + + /** + * Calls ExportData. + * @param request ExportDataRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public exportData(request: google.cloud.automl.v1.IExportDataRequest, callback: google.cloud.automl.v1.AutoMl.ExportDataCallback): void; + + /** + * Calls ExportData. + * @param request ExportDataRequest message or plain object + * @returns Promise + */ + public exportData(request: google.cloud.automl.v1.IExportDataRequest): Promise; + + /** + * Calls GetAnnotationSpec. + * @param request GetAnnotationSpecRequest message or plain object + * @param callback Node-style callback called with the error, if any, and AnnotationSpec + */ + public getAnnotationSpec(request: google.cloud.automl.v1.IGetAnnotationSpecRequest, callback: google.cloud.automl.v1.AutoMl.GetAnnotationSpecCallback): void; + + /** + * Calls GetAnnotationSpec. + * @param request GetAnnotationSpecRequest message or plain object + * @returns Promise + */ + public getAnnotationSpec(request: google.cloud.automl.v1.IGetAnnotationSpecRequest): Promise; + + /** + * Calls CreateModel. + * @param request CreateModelRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public createModel(request: google.cloud.automl.v1.ICreateModelRequest, callback: google.cloud.automl.v1.AutoMl.CreateModelCallback): void; + + /** + * Calls CreateModel. + * @param request CreateModelRequest message or plain object + * @returns Promise + */ + public createModel(request: google.cloud.automl.v1.ICreateModelRequest): Promise; + + /** + * Calls GetModel. + * @param request GetModelRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Model + */ + public getModel(request: google.cloud.automl.v1.IGetModelRequest, callback: google.cloud.automl.v1.AutoMl.GetModelCallback): void; + + /** + * Calls GetModel. + * @param request GetModelRequest message or plain object + * @returns Promise + */ + public getModel(request: google.cloud.automl.v1.IGetModelRequest): Promise; + + /** + * Calls ListModels. + * @param request ListModelsRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ListModelsResponse + */ + public listModels(request: google.cloud.automl.v1.IListModelsRequest, callback: google.cloud.automl.v1.AutoMl.ListModelsCallback): void; + + /** + * Calls ListModels. + * @param request ListModelsRequest message or plain object + * @returns Promise + */ + public listModels(request: google.cloud.automl.v1.IListModelsRequest): Promise; + + /** + * Calls DeleteModel. + * @param request DeleteModelRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public deleteModel(request: google.cloud.automl.v1.IDeleteModelRequest, callback: google.cloud.automl.v1.AutoMl.DeleteModelCallback): void; + + /** + * Calls DeleteModel. + * @param request DeleteModelRequest message or plain object + * @returns Promise + */ + public deleteModel(request: google.cloud.automl.v1.IDeleteModelRequest): Promise; + + /** + * Calls UpdateModel. + * @param request UpdateModelRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Model + */ + public updateModel(request: google.cloud.automl.v1.IUpdateModelRequest, callback: google.cloud.automl.v1.AutoMl.UpdateModelCallback): void; + + /** + * Calls UpdateModel. + * @param request UpdateModelRequest message or plain object + * @returns Promise + */ + public updateModel(request: google.cloud.automl.v1.IUpdateModelRequest): Promise; + + /** + * Calls DeployModel. + * @param request DeployModelRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public deployModel(request: google.cloud.automl.v1.IDeployModelRequest, callback: google.cloud.automl.v1.AutoMl.DeployModelCallback): void; + + /** + * Calls DeployModel. + * @param request DeployModelRequest message or plain object + * @returns Promise + */ + public deployModel(request: google.cloud.automl.v1.IDeployModelRequest): Promise; + + /** + * Calls UndeployModel. + * @param request UndeployModelRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public undeployModel(request: google.cloud.automl.v1.IUndeployModelRequest, callback: google.cloud.automl.v1.AutoMl.UndeployModelCallback): void; + + /** + * Calls UndeployModel. + * @param request UndeployModelRequest message or plain object + * @returns Promise + */ + public undeployModel(request: google.cloud.automl.v1.IUndeployModelRequest): Promise; + + /** + * Calls ExportModel. + * @param request ExportModelRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public exportModel(request: google.cloud.automl.v1.IExportModelRequest, callback: google.cloud.automl.v1.AutoMl.ExportModelCallback): void; + + /** + * Calls ExportModel. + * @param request ExportModelRequest message or plain object + * @returns Promise + */ + public exportModel(request: google.cloud.automl.v1.IExportModelRequest): Promise; + + /** + * Calls GetModelEvaluation. + * @param request GetModelEvaluationRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ModelEvaluation + */ + public getModelEvaluation(request: google.cloud.automl.v1.IGetModelEvaluationRequest, callback: google.cloud.automl.v1.AutoMl.GetModelEvaluationCallback): void; + + /** + * Calls GetModelEvaluation. + * @param request GetModelEvaluationRequest message or plain object + * @returns Promise + */ + public getModelEvaluation(request: google.cloud.automl.v1.IGetModelEvaluationRequest): Promise; + + /** + * Calls ListModelEvaluations. + * @param request ListModelEvaluationsRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ListModelEvaluationsResponse + */ + public listModelEvaluations(request: google.cloud.automl.v1.IListModelEvaluationsRequest, callback: google.cloud.automl.v1.AutoMl.ListModelEvaluationsCallback): void; + + /** + * Calls ListModelEvaluations. + * @param request ListModelEvaluationsRequest message or plain object + * @returns Promise + */ + public listModelEvaluations(request: google.cloud.automl.v1.IListModelEvaluationsRequest): Promise; + } + + namespace AutoMl { + + /** + * Callback as used by {@link google.cloud.automl.v1.AutoMl|createDataset}. + * @param error Error, if any + * @param [response] Operation + */ + type CreateDatasetCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.cloud.automl.v1.AutoMl|getDataset}. + * @param error Error, if any + * @param [response] Dataset + */ + type GetDatasetCallback = (error: (Error|null), response?: google.cloud.automl.v1.Dataset) => void; + + /** + * Callback as used by {@link google.cloud.automl.v1.AutoMl|listDatasets}. + * @param error Error, if any + * @param [response] ListDatasetsResponse + */ + type ListDatasetsCallback = (error: (Error|null), response?: google.cloud.automl.v1.ListDatasetsResponse) => void; + + /** + * Callback as used by {@link google.cloud.automl.v1.AutoMl|updateDataset}. + * @param error Error, if any + * @param [response] Dataset + */ + type UpdateDatasetCallback = (error: (Error|null), response?: google.cloud.automl.v1.Dataset) => void; + + /** + * Callback as used by {@link google.cloud.automl.v1.AutoMl|deleteDataset}. + * @param error Error, if any + * @param [response] Operation + */ + type DeleteDatasetCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.cloud.automl.v1.AutoMl|importData}. + * @param error Error, if any + * @param [response] Operation + */ + type ImportDataCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.cloud.automl.v1.AutoMl|exportData}. + * @param error Error, if any + * @param [response] Operation + */ + type ExportDataCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.cloud.automl.v1.AutoMl|getAnnotationSpec}. + * @param error Error, if any + * @param [response] AnnotationSpec + */ + type GetAnnotationSpecCallback = (error: (Error|null), response?: google.cloud.automl.v1.AnnotationSpec) => void; + + /** + * Callback as used by {@link google.cloud.automl.v1.AutoMl|createModel}. + * @param error Error, if any + * @param [response] Operation + */ + type CreateModelCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.cloud.automl.v1.AutoMl|getModel}. + * @param error Error, if any + * @param [response] Model + */ + type GetModelCallback = (error: (Error|null), response?: google.cloud.automl.v1.Model) => void; + + /** + * Callback as used by {@link google.cloud.automl.v1.AutoMl|listModels}. + * @param error Error, if any + * @param [response] ListModelsResponse + */ + type ListModelsCallback = (error: (Error|null), response?: google.cloud.automl.v1.ListModelsResponse) => void; + + /** + * Callback as used by {@link google.cloud.automl.v1.AutoMl|deleteModel}. + * @param error Error, if any + * @param [response] Operation + */ + type DeleteModelCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.cloud.automl.v1.AutoMl|updateModel}. + * @param error Error, if any + * @param [response] Model + */ + type UpdateModelCallback = (error: (Error|null), response?: google.cloud.automl.v1.Model) => void; + + /** + * Callback as used by {@link google.cloud.automl.v1.AutoMl|deployModel}. + * @param error Error, if any + * @param [response] Operation + */ + type DeployModelCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.cloud.automl.v1.AutoMl|undeployModel}. + * @param error Error, if any + * @param [response] Operation + */ + type UndeployModelCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.cloud.automl.v1.AutoMl|exportModel}. + * @param error Error, if any + * @param [response] Operation + */ + type ExportModelCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.cloud.automl.v1.AutoMl|getModelEvaluation}. + * @param error Error, if any + * @param [response] ModelEvaluation + */ + type GetModelEvaluationCallback = (error: (Error|null), response?: google.cloud.automl.v1.ModelEvaluation) => void; + + /** + * Callback as used by {@link google.cloud.automl.v1.AutoMl|listModelEvaluations}. + * @param error Error, if any + * @param [response] ListModelEvaluationsResponse + */ + type ListModelEvaluationsCallback = (error: (Error|null), response?: google.cloud.automl.v1.ListModelEvaluationsResponse) => void; + } + + /** Properties of a CreateDatasetRequest. */ + interface ICreateDatasetRequest { + + /** CreateDatasetRequest parent */ + parent?: (string|null); + + /** CreateDatasetRequest dataset */ + dataset?: (google.cloud.automl.v1.IDataset|null); + } + + /** Represents a CreateDatasetRequest. */ + class CreateDatasetRequest implements ICreateDatasetRequest { + + /** + * Constructs a new CreateDatasetRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.automl.v1.ICreateDatasetRequest); + + /** CreateDatasetRequest parent. */ + public parent: string; + + /** CreateDatasetRequest dataset. */ + public dataset?: (google.cloud.automl.v1.IDataset|null); + + /** + * Creates a new CreateDatasetRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns CreateDatasetRequest instance + */ + public static create(properties?: google.cloud.automl.v1.ICreateDatasetRequest): google.cloud.automl.v1.CreateDatasetRequest; + + /** + * Encodes the specified CreateDatasetRequest message. Does not implicitly {@link google.cloud.automl.v1.CreateDatasetRequest.verify|verify} messages. + * @param message CreateDatasetRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.automl.v1.ICreateDatasetRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CreateDatasetRequest message, length delimited. Does not implicitly {@link google.cloud.automl.v1.CreateDatasetRequest.verify|verify} messages. + * @param message CreateDatasetRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.automl.v1.ICreateDatasetRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CreateDatasetRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CreateDatasetRequest + * @throws {Error} If the payload is not 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.automl.v1.CreateDatasetRequest; + + /** + * Decodes a CreateDatasetRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CreateDatasetRequest + * @throws {Error} If the payload 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.automl.v1.CreateDatasetRequest; + + /** + * Verifies a CreateDatasetRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CreateDatasetRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CreateDatasetRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.automl.v1.CreateDatasetRequest; + + /** + * Creates a plain object from a CreateDatasetRequest message. Also converts values to other types if specified. + * @param message CreateDatasetRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.automl.v1.CreateDatasetRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CreateDatasetRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CreateDatasetRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a GetDatasetRequest. */ + interface IGetDatasetRequest { + + /** GetDatasetRequest name */ + name?: (string|null); + } + + /** Represents a GetDatasetRequest. */ + class GetDatasetRequest implements IGetDatasetRequest { + + /** + * Constructs a new GetDatasetRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.automl.v1.IGetDatasetRequest); + + /** GetDatasetRequest name. */ + public name: string; + + /** + * Creates a new GetDatasetRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GetDatasetRequest instance + */ + public static create(properties?: google.cloud.automl.v1.IGetDatasetRequest): google.cloud.automl.v1.GetDatasetRequest; + + /** + * Encodes the specified GetDatasetRequest message. Does not implicitly {@link google.cloud.automl.v1.GetDatasetRequest.verify|verify} messages. + * @param message GetDatasetRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.automl.v1.IGetDatasetRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GetDatasetRequest message, length delimited. Does not implicitly {@link google.cloud.automl.v1.GetDatasetRequest.verify|verify} messages. + * @param message GetDatasetRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.automl.v1.IGetDatasetRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GetDatasetRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GetDatasetRequest + * @throws {Error} If the payload is not 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.automl.v1.GetDatasetRequest; + + /** + * Decodes a GetDatasetRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GetDatasetRequest + * @throws {Error} If the payload 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.automl.v1.GetDatasetRequest; + + /** + * Verifies a GetDatasetRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GetDatasetRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GetDatasetRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.automl.v1.GetDatasetRequest; + + /** + * Creates a plain object from a GetDatasetRequest message. Also converts values to other types if specified. + * @param message GetDatasetRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.automl.v1.GetDatasetRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GetDatasetRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GetDatasetRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListDatasetsRequest. */ + interface IListDatasetsRequest { + + /** ListDatasetsRequest parent */ + parent?: (string|null); + + /** ListDatasetsRequest filter */ + filter?: (string|null); + + /** ListDatasetsRequest pageSize */ + pageSize?: (number|null); + + /** ListDatasetsRequest pageToken */ + pageToken?: (string|null); + } + + /** Represents a ListDatasetsRequest. */ + class ListDatasetsRequest implements IListDatasetsRequest { + + /** + * Constructs a new ListDatasetsRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.automl.v1.IListDatasetsRequest); + + /** ListDatasetsRequest parent. */ + public parent: string; + + /** ListDatasetsRequest filter. */ + public filter: string; + + /** ListDatasetsRequest pageSize. */ + public pageSize: number; + + /** ListDatasetsRequest pageToken. */ + public pageToken: string; + + /** + * Creates a new ListDatasetsRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ListDatasetsRequest instance + */ + public static create(properties?: google.cloud.automl.v1.IListDatasetsRequest): google.cloud.automl.v1.ListDatasetsRequest; + + /** + * Encodes the specified ListDatasetsRequest message. Does not implicitly {@link google.cloud.automl.v1.ListDatasetsRequest.verify|verify} messages. + * @param message ListDatasetsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.automl.v1.IListDatasetsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListDatasetsRequest message, length delimited. Does not implicitly {@link google.cloud.automl.v1.ListDatasetsRequest.verify|verify} messages. + * @param message ListDatasetsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.automl.v1.IListDatasetsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListDatasetsRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListDatasetsRequest + * @throws {Error} If the payload is not 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.automl.v1.ListDatasetsRequest; + + /** + * Decodes a ListDatasetsRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListDatasetsRequest + * @throws {Error} If the payload 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.automl.v1.ListDatasetsRequest; + + /** + * Verifies a ListDatasetsRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListDatasetsRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListDatasetsRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.automl.v1.ListDatasetsRequest; + + /** + * Creates a plain object from a ListDatasetsRequest message. Also converts values to other types if specified. + * @param message ListDatasetsRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.automl.v1.ListDatasetsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListDatasetsRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListDatasetsRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListDatasetsResponse. */ + interface IListDatasetsResponse { + + /** ListDatasetsResponse datasets */ + datasets?: (google.cloud.automl.v1.IDataset[]|null); + + /** ListDatasetsResponse nextPageToken */ + nextPageToken?: (string|null); + } + + /** Represents a ListDatasetsResponse. */ + class ListDatasetsResponse implements IListDatasetsResponse { + + /** + * Constructs a new ListDatasetsResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.automl.v1.IListDatasetsResponse); + + /** ListDatasetsResponse datasets. */ + public datasets: google.cloud.automl.v1.IDataset[]; + + /** ListDatasetsResponse nextPageToken. */ + public nextPageToken: string; + + /** + * Creates a new ListDatasetsResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ListDatasetsResponse instance + */ + public static create(properties?: google.cloud.automl.v1.IListDatasetsResponse): google.cloud.automl.v1.ListDatasetsResponse; + + /** + * Encodes the specified ListDatasetsResponse message. Does not implicitly {@link google.cloud.automl.v1.ListDatasetsResponse.verify|verify} messages. + * @param message ListDatasetsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.automl.v1.IListDatasetsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListDatasetsResponse message, length delimited. Does not implicitly {@link google.cloud.automl.v1.ListDatasetsResponse.verify|verify} messages. + * @param message ListDatasetsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.automl.v1.IListDatasetsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListDatasetsResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListDatasetsResponse + * @throws {Error} If the payload is not 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.automl.v1.ListDatasetsResponse; + + /** + * Decodes a ListDatasetsResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListDatasetsResponse + * @throws {Error} If the payload 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.automl.v1.ListDatasetsResponse; + + /** + * Verifies a ListDatasetsResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListDatasetsResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListDatasetsResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.automl.v1.ListDatasetsResponse; + + /** + * Creates a plain object from a ListDatasetsResponse message. Also converts values to other types if specified. + * @param message ListDatasetsResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.automl.v1.ListDatasetsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListDatasetsResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListDatasetsResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an UpdateDatasetRequest. */ + interface IUpdateDatasetRequest { + + /** UpdateDatasetRequest dataset */ + dataset?: (google.cloud.automl.v1.IDataset|null); + + /** UpdateDatasetRequest updateMask */ + updateMask?: (google.protobuf.IFieldMask|null); + } + + /** Represents an UpdateDatasetRequest. */ + class UpdateDatasetRequest implements IUpdateDatasetRequest { + + /** + * Constructs a new UpdateDatasetRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.automl.v1.IUpdateDatasetRequest); + + /** UpdateDatasetRequest dataset. */ + public dataset?: (google.cloud.automl.v1.IDataset|null); + + /** UpdateDatasetRequest updateMask. */ + public updateMask?: (google.protobuf.IFieldMask|null); + + /** + * Creates a new UpdateDatasetRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns UpdateDatasetRequest instance + */ + public static create(properties?: google.cloud.automl.v1.IUpdateDatasetRequest): google.cloud.automl.v1.UpdateDatasetRequest; + + /** + * Encodes the specified UpdateDatasetRequest message. Does not implicitly {@link google.cloud.automl.v1.UpdateDatasetRequest.verify|verify} messages. + * @param message UpdateDatasetRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.automl.v1.IUpdateDatasetRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified UpdateDatasetRequest message, length delimited. Does not implicitly {@link google.cloud.automl.v1.UpdateDatasetRequest.verify|verify} messages. + * @param message UpdateDatasetRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.automl.v1.IUpdateDatasetRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an UpdateDatasetRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns UpdateDatasetRequest + * @throws {Error} If the payload is not 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.automl.v1.UpdateDatasetRequest; + + /** + * Decodes an UpdateDatasetRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns UpdateDatasetRequest + * @throws {Error} If the payload 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.automl.v1.UpdateDatasetRequest; + + /** + * Verifies an UpdateDatasetRequest message. + * @param message Plain 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 UpdateDatasetRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns UpdateDatasetRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.automl.v1.UpdateDatasetRequest; + + /** + * Creates a plain object from an UpdateDatasetRequest message. Also converts values to other types if specified. + * @param message UpdateDatasetRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.automl.v1.UpdateDatasetRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this UpdateDatasetRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for UpdateDatasetRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a DeleteDatasetRequest. */ + interface IDeleteDatasetRequest { + + /** DeleteDatasetRequest name */ + name?: (string|null); + } + + /** Represents a DeleteDatasetRequest. */ + class DeleteDatasetRequest implements IDeleteDatasetRequest { + + /** + * Constructs a new DeleteDatasetRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.automl.v1.IDeleteDatasetRequest); + + /** DeleteDatasetRequest name. */ + public name: string; + + /** + * Creates a new DeleteDatasetRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns DeleteDatasetRequest instance + */ + public static create(properties?: google.cloud.automl.v1.IDeleteDatasetRequest): google.cloud.automl.v1.DeleteDatasetRequest; + + /** + * Encodes the specified DeleteDatasetRequest message. Does not implicitly {@link google.cloud.automl.v1.DeleteDatasetRequest.verify|verify} messages. + * @param message DeleteDatasetRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.automl.v1.IDeleteDatasetRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DeleteDatasetRequest message, length delimited. Does not implicitly {@link google.cloud.automl.v1.DeleteDatasetRequest.verify|verify} messages. + * @param message DeleteDatasetRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.automl.v1.IDeleteDatasetRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DeleteDatasetRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DeleteDatasetRequest + * @throws {Error} If the payload is not 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.automl.v1.DeleteDatasetRequest; + + /** + * Decodes a DeleteDatasetRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DeleteDatasetRequest + * @throws {Error} If the payload 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.automl.v1.DeleteDatasetRequest; + + /** + * Verifies a DeleteDatasetRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DeleteDatasetRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DeleteDatasetRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.automl.v1.DeleteDatasetRequest; + + /** + * Creates a plain object from a DeleteDatasetRequest message. Also converts values to other types if specified. + * @param message DeleteDatasetRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.automl.v1.DeleteDatasetRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DeleteDatasetRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DeleteDatasetRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an ImportDataRequest. */ + interface IImportDataRequest { + + /** ImportDataRequest name */ + name?: (string|null); + + /** ImportDataRequest inputConfig */ + inputConfig?: (google.cloud.automl.v1.IInputConfig|null); + } + + /** Represents an ImportDataRequest. */ + class ImportDataRequest implements IImportDataRequest { + + /** + * Constructs a new ImportDataRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.automl.v1.IImportDataRequest); + + /** ImportDataRequest name. */ + public name: string; + + /** ImportDataRequest inputConfig. */ + public inputConfig?: (google.cloud.automl.v1.IInputConfig|null); + + /** + * Creates a new ImportDataRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ImportDataRequest instance + */ + public static create(properties?: google.cloud.automl.v1.IImportDataRequest): google.cloud.automl.v1.ImportDataRequest; + + /** + * Encodes the specified ImportDataRequest message. Does not implicitly {@link google.cloud.automl.v1.ImportDataRequest.verify|verify} messages. + * @param message ImportDataRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.automl.v1.IImportDataRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ImportDataRequest message, length delimited. Does not implicitly {@link google.cloud.automl.v1.ImportDataRequest.verify|verify} messages. + * @param message ImportDataRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.automl.v1.IImportDataRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an ImportDataRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ImportDataRequest + * @throws {Error} If the payload is not 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.automl.v1.ImportDataRequest; + + /** + * Decodes an ImportDataRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ImportDataRequest + * @throws {Error} If the payload 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.automl.v1.ImportDataRequest; + + /** + * Verifies an ImportDataRequest message. + * @param message Plain 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 ImportDataRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ImportDataRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.automl.v1.ImportDataRequest; + + /** + * Creates a plain object from an ImportDataRequest message. Also converts values to other types if specified. + * @param message ImportDataRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.automl.v1.ImportDataRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ImportDataRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ImportDataRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an ExportDataRequest. */ + interface IExportDataRequest { + + /** ExportDataRequest name */ + name?: (string|null); + + /** ExportDataRequest outputConfig */ + outputConfig?: (google.cloud.automl.v1.IOutputConfig|null); + } + + /** Represents an ExportDataRequest. */ + class ExportDataRequest implements IExportDataRequest { + + /** + * Constructs a new ExportDataRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.automl.v1.IExportDataRequest); + + /** ExportDataRequest name. */ + public name: string; + + /** ExportDataRequest outputConfig. */ + public outputConfig?: (google.cloud.automl.v1.IOutputConfig|null); + + /** + * Creates a new ExportDataRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ExportDataRequest instance + */ + public static create(properties?: google.cloud.automl.v1.IExportDataRequest): google.cloud.automl.v1.ExportDataRequest; + + /** + * Encodes the specified ExportDataRequest message. Does not implicitly {@link google.cloud.automl.v1.ExportDataRequest.verify|verify} messages. + * @param message ExportDataRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.automl.v1.IExportDataRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ExportDataRequest message, length delimited. Does not implicitly {@link google.cloud.automl.v1.ExportDataRequest.verify|verify} messages. + * @param message ExportDataRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.automl.v1.IExportDataRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an ExportDataRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ExportDataRequest + * @throws {Error} If the payload is not 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.automl.v1.ExportDataRequest; + + /** + * Decodes an ExportDataRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ExportDataRequest + * @throws {Error} If the payload 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.automl.v1.ExportDataRequest; + + /** + * Verifies an ExportDataRequest message. + * @param message Plain 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 ExportDataRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ExportDataRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.automl.v1.ExportDataRequest; + + /** + * Creates a plain object from an ExportDataRequest message. Also converts values to other types if specified. + * @param message ExportDataRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.automl.v1.ExportDataRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ExportDataRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ExportDataRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a GetAnnotationSpecRequest. */ + interface IGetAnnotationSpecRequest { + + /** GetAnnotationSpecRequest name */ + name?: (string|null); + } + + /** Represents a GetAnnotationSpecRequest. */ + class GetAnnotationSpecRequest implements IGetAnnotationSpecRequest { + + /** + * Constructs a new GetAnnotationSpecRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.automl.v1.IGetAnnotationSpecRequest); + + /** GetAnnotationSpecRequest name. */ + public name: string; + + /** + * Creates a new GetAnnotationSpecRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GetAnnotationSpecRequest instance + */ + public static create(properties?: google.cloud.automl.v1.IGetAnnotationSpecRequest): google.cloud.automl.v1.GetAnnotationSpecRequest; + + /** + * Encodes the specified GetAnnotationSpecRequest message. Does not implicitly {@link google.cloud.automl.v1.GetAnnotationSpecRequest.verify|verify} messages. + * @param message GetAnnotationSpecRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.automl.v1.IGetAnnotationSpecRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GetAnnotationSpecRequest message, length delimited. Does not implicitly {@link google.cloud.automl.v1.GetAnnotationSpecRequest.verify|verify} messages. + * @param message GetAnnotationSpecRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.automl.v1.IGetAnnotationSpecRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GetAnnotationSpecRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GetAnnotationSpecRequest + * @throws {Error} If the payload is not 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.automl.v1.GetAnnotationSpecRequest; + + /** + * Decodes a GetAnnotationSpecRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GetAnnotationSpecRequest + * @throws {Error} If the payload 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.automl.v1.GetAnnotationSpecRequest; + + /** + * Verifies a GetAnnotationSpecRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GetAnnotationSpecRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GetAnnotationSpecRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.automl.v1.GetAnnotationSpecRequest; + + /** + * Creates a plain object from a GetAnnotationSpecRequest message. Also converts values to other types if specified. + * @param message GetAnnotationSpecRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.automl.v1.GetAnnotationSpecRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GetAnnotationSpecRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GetAnnotationSpecRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a CreateModelRequest. */ + interface ICreateModelRequest { + + /** CreateModelRequest parent */ + parent?: (string|null); + + /** CreateModelRequest model */ + model?: (google.cloud.automl.v1.IModel|null); + } + + /** Represents a CreateModelRequest. */ + class CreateModelRequest implements ICreateModelRequest { + + /** + * Constructs a new CreateModelRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.automl.v1.ICreateModelRequest); + + /** CreateModelRequest parent. */ + public parent: string; + + /** CreateModelRequest model. */ + public model?: (google.cloud.automl.v1.IModel|null); + + /** + * Creates a new CreateModelRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns CreateModelRequest instance + */ + public static create(properties?: google.cloud.automl.v1.ICreateModelRequest): google.cloud.automl.v1.CreateModelRequest; + + /** + * Encodes the specified CreateModelRequest message. Does not implicitly {@link google.cloud.automl.v1.CreateModelRequest.verify|verify} messages. + * @param message CreateModelRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.automl.v1.ICreateModelRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CreateModelRequest message, length delimited. Does not implicitly {@link google.cloud.automl.v1.CreateModelRequest.verify|verify} messages. + * @param message CreateModelRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.automl.v1.ICreateModelRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CreateModelRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CreateModelRequest + * @throws {Error} If the payload is not 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.automl.v1.CreateModelRequest; + + /** + * Decodes a CreateModelRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CreateModelRequest + * @throws {Error} If the payload 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.automl.v1.CreateModelRequest; + + /** + * Verifies a CreateModelRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CreateModelRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CreateModelRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.automl.v1.CreateModelRequest; + + /** + * Creates a plain object from a CreateModelRequest message. Also converts values to other types if specified. + * @param message CreateModelRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.automl.v1.CreateModelRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CreateModelRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CreateModelRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a GetModelRequest. */ + interface IGetModelRequest { + + /** GetModelRequest name */ + name?: (string|null); + } + + /** Represents a GetModelRequest. */ + class GetModelRequest implements IGetModelRequest { + + /** + * Constructs a new GetModelRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.automl.v1.IGetModelRequest); + + /** GetModelRequest name. */ + public name: string; + + /** + * Creates a new GetModelRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GetModelRequest instance + */ + public static create(properties?: google.cloud.automl.v1.IGetModelRequest): google.cloud.automl.v1.GetModelRequest; + + /** + * Encodes the specified GetModelRequest message. Does not implicitly {@link google.cloud.automl.v1.GetModelRequest.verify|verify} messages. + * @param message GetModelRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.automl.v1.IGetModelRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GetModelRequest message, length delimited. Does not implicitly {@link google.cloud.automl.v1.GetModelRequest.verify|verify} messages. + * @param message GetModelRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.automl.v1.IGetModelRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GetModelRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GetModelRequest + * @throws {Error} If the payload is not 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.automl.v1.GetModelRequest; + + /** + * Decodes a GetModelRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GetModelRequest + * @throws {Error} If the payload 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.automl.v1.GetModelRequest; + + /** + * Verifies a GetModelRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GetModelRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GetModelRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.automl.v1.GetModelRequest; + + /** + * Creates a plain object from a GetModelRequest message. Also converts values to other types if specified. + * @param message GetModelRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.automl.v1.GetModelRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GetModelRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GetModelRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListModelsRequest. */ + interface IListModelsRequest { + + /** ListModelsRequest parent */ + parent?: (string|null); + + /** ListModelsRequest filter */ + filter?: (string|null); + + /** ListModelsRequest pageSize */ + pageSize?: (number|null); + + /** ListModelsRequest pageToken */ + pageToken?: (string|null); + } + + /** Represents a ListModelsRequest. */ + class ListModelsRequest implements IListModelsRequest { + + /** + * Constructs a new ListModelsRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.automl.v1.IListModelsRequest); + + /** ListModelsRequest parent. */ + public parent: string; + + /** ListModelsRequest filter. */ + public filter: string; + + /** ListModelsRequest pageSize. */ + public pageSize: number; + + /** ListModelsRequest pageToken. */ + public pageToken: string; + + /** + * Creates a new ListModelsRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ListModelsRequest instance + */ + public static create(properties?: google.cloud.automl.v1.IListModelsRequest): google.cloud.automl.v1.ListModelsRequest; + + /** + * Encodes the specified ListModelsRequest message. Does not implicitly {@link google.cloud.automl.v1.ListModelsRequest.verify|verify} messages. + * @param message ListModelsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.automl.v1.IListModelsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListModelsRequest message, length delimited. Does not implicitly {@link google.cloud.automl.v1.ListModelsRequest.verify|verify} messages. + * @param message ListModelsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.automl.v1.IListModelsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListModelsRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListModelsRequest + * @throws {Error} If the payload is not 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.automl.v1.ListModelsRequest; + + /** + * Decodes a ListModelsRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListModelsRequest + * @throws {Error} If the payload 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.automl.v1.ListModelsRequest; + + /** + * Verifies a ListModelsRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListModelsRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListModelsRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.automl.v1.ListModelsRequest; + + /** + * Creates a plain object from a ListModelsRequest message. Also converts values to other types if specified. + * @param message ListModelsRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.automl.v1.ListModelsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListModelsRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListModelsRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListModelsResponse. */ + interface IListModelsResponse { + + /** ListModelsResponse model */ + model?: (google.cloud.automl.v1.IModel[]|null); + + /** ListModelsResponse nextPageToken */ + nextPageToken?: (string|null); + } + + /** Represents a ListModelsResponse. */ + class ListModelsResponse implements IListModelsResponse { + + /** + * Constructs a new ListModelsResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.automl.v1.IListModelsResponse); + + /** ListModelsResponse model. */ + public model: google.cloud.automl.v1.IModel[]; + + /** ListModelsResponse nextPageToken. */ + public nextPageToken: string; + + /** + * Creates a new ListModelsResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ListModelsResponse instance + */ + public static create(properties?: google.cloud.automl.v1.IListModelsResponse): google.cloud.automl.v1.ListModelsResponse; + + /** + * Encodes the specified ListModelsResponse message. Does not implicitly {@link google.cloud.automl.v1.ListModelsResponse.verify|verify} messages. + * @param message ListModelsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.automl.v1.IListModelsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListModelsResponse message, length delimited. Does not implicitly {@link google.cloud.automl.v1.ListModelsResponse.verify|verify} messages. + * @param message ListModelsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.automl.v1.IListModelsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListModelsResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListModelsResponse + * @throws {Error} If the payload is not 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.automl.v1.ListModelsResponse; + + /** + * Decodes a ListModelsResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListModelsResponse + * @throws {Error} If the payload 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.automl.v1.ListModelsResponse; + + /** + * Verifies a ListModelsResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListModelsResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListModelsResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.automl.v1.ListModelsResponse; + + /** + * Creates a plain object from a ListModelsResponse message. Also converts values to other types if specified. + * @param message ListModelsResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.automl.v1.ListModelsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListModelsResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListModelsResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a DeleteModelRequest. */ + interface IDeleteModelRequest { + + /** DeleteModelRequest name */ + name?: (string|null); + } + + /** Represents a DeleteModelRequest. */ + class DeleteModelRequest implements IDeleteModelRequest { + + /** + * Constructs a new DeleteModelRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.automl.v1.IDeleteModelRequest); + + /** DeleteModelRequest name. */ + public name: string; + + /** + * Creates a new DeleteModelRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns DeleteModelRequest instance + */ + public static create(properties?: google.cloud.automl.v1.IDeleteModelRequest): google.cloud.automl.v1.DeleteModelRequest; + + /** + * Encodes the specified DeleteModelRequest message. Does not implicitly {@link google.cloud.automl.v1.DeleteModelRequest.verify|verify} messages. + * @param message DeleteModelRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.automl.v1.IDeleteModelRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DeleteModelRequest message, length delimited. Does not implicitly {@link google.cloud.automl.v1.DeleteModelRequest.verify|verify} messages. + * @param message DeleteModelRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.automl.v1.IDeleteModelRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DeleteModelRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DeleteModelRequest + * @throws {Error} If the payload is not 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.automl.v1.DeleteModelRequest; + + /** + * Decodes a DeleteModelRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DeleteModelRequest + * @throws {Error} If the payload 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.automl.v1.DeleteModelRequest; + + /** + * Verifies a DeleteModelRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DeleteModelRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DeleteModelRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.automl.v1.DeleteModelRequest; + + /** + * Creates a plain object from a DeleteModelRequest message. Also converts values to other types if specified. + * @param message DeleteModelRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.automl.v1.DeleteModelRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DeleteModelRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DeleteModelRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an UpdateModelRequest. */ + interface IUpdateModelRequest { + + /** UpdateModelRequest model */ + model?: (google.cloud.automl.v1.IModel|null); + + /** UpdateModelRequest updateMask */ + updateMask?: (google.protobuf.IFieldMask|null); + } + + /** Represents an UpdateModelRequest. */ + class UpdateModelRequest implements IUpdateModelRequest { + + /** + * Constructs a new UpdateModelRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.automl.v1.IUpdateModelRequest); + + /** UpdateModelRequest model. */ + public model?: (google.cloud.automl.v1.IModel|null); + + /** UpdateModelRequest updateMask. */ + public updateMask?: (google.protobuf.IFieldMask|null); + + /** + * Creates a new UpdateModelRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns UpdateModelRequest instance + */ + public static create(properties?: google.cloud.automl.v1.IUpdateModelRequest): google.cloud.automl.v1.UpdateModelRequest; + + /** + * Encodes the specified UpdateModelRequest message. Does not implicitly {@link google.cloud.automl.v1.UpdateModelRequest.verify|verify} messages. + * @param message UpdateModelRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.automl.v1.IUpdateModelRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified UpdateModelRequest message, length delimited. Does not implicitly {@link google.cloud.automl.v1.UpdateModelRequest.verify|verify} messages. + * @param message UpdateModelRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.automl.v1.IUpdateModelRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an UpdateModelRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns UpdateModelRequest + * @throws {Error} If the payload is not 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.automl.v1.UpdateModelRequest; + + /** + * Decodes an UpdateModelRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns UpdateModelRequest + * @throws {Error} If the payload 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.automl.v1.UpdateModelRequest; + + /** + * Verifies an UpdateModelRequest message. + * @param message Plain 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 UpdateModelRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns UpdateModelRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.automl.v1.UpdateModelRequest; + + /** + * Creates a plain object from an UpdateModelRequest message. Also converts values to other types if specified. + * @param message UpdateModelRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.automl.v1.UpdateModelRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this UpdateModelRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for UpdateModelRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a DeployModelRequest. */ + interface IDeployModelRequest { + + /** DeployModelRequest imageObjectDetectionModelDeploymentMetadata */ + imageObjectDetectionModelDeploymentMetadata?: (google.cloud.automl.v1.IImageObjectDetectionModelDeploymentMetadata|null); + + /** DeployModelRequest imageClassificationModelDeploymentMetadata */ + imageClassificationModelDeploymentMetadata?: (google.cloud.automl.v1.IImageClassificationModelDeploymentMetadata|null); + + /** DeployModelRequest name */ + name?: (string|null); + } + + /** Represents a DeployModelRequest. */ + class DeployModelRequest implements IDeployModelRequest { + + /** + * Constructs a new DeployModelRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.automl.v1.IDeployModelRequest); + + /** DeployModelRequest imageObjectDetectionModelDeploymentMetadata. */ + public imageObjectDetectionModelDeploymentMetadata?: (google.cloud.automl.v1.IImageObjectDetectionModelDeploymentMetadata|null); + + /** DeployModelRequest imageClassificationModelDeploymentMetadata. */ + public imageClassificationModelDeploymentMetadata?: (google.cloud.automl.v1.IImageClassificationModelDeploymentMetadata|null); + + /** DeployModelRequest name. */ + public name: string; + + /** DeployModelRequest modelDeploymentMetadata. */ + public modelDeploymentMetadata?: ("imageObjectDetectionModelDeploymentMetadata"|"imageClassificationModelDeploymentMetadata"); + + /** + * Creates a new DeployModelRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns DeployModelRequest instance + */ + public static create(properties?: google.cloud.automl.v1.IDeployModelRequest): google.cloud.automl.v1.DeployModelRequest; + + /** + * Encodes the specified DeployModelRequest message. Does not implicitly {@link google.cloud.automl.v1.DeployModelRequest.verify|verify} messages. + * @param message DeployModelRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.automl.v1.IDeployModelRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DeployModelRequest message, length delimited. Does not implicitly {@link google.cloud.automl.v1.DeployModelRequest.verify|verify} messages. + * @param message DeployModelRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.automl.v1.IDeployModelRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DeployModelRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DeployModelRequest + * @throws {Error} If the payload is not 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.automl.v1.DeployModelRequest; + + /** + * Decodes a DeployModelRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DeployModelRequest + * @throws {Error} If the payload 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.automl.v1.DeployModelRequest; + + /** + * Verifies a DeployModelRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DeployModelRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DeployModelRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.automl.v1.DeployModelRequest; + + /** + * Creates a plain object from a DeployModelRequest message. Also converts values to other types if specified. + * @param message DeployModelRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.automl.v1.DeployModelRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DeployModelRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DeployModelRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an UndeployModelRequest. */ + interface IUndeployModelRequest { + + /** UndeployModelRequest name */ + name?: (string|null); + } + + /** Represents an UndeployModelRequest. */ + class UndeployModelRequest implements IUndeployModelRequest { + + /** + * Constructs a new UndeployModelRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.automl.v1.IUndeployModelRequest); + + /** UndeployModelRequest name. */ + public name: string; + + /** + * Creates a new UndeployModelRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns UndeployModelRequest instance + */ + public static create(properties?: google.cloud.automl.v1.IUndeployModelRequest): google.cloud.automl.v1.UndeployModelRequest; + + /** + * Encodes the specified UndeployModelRequest message. Does not implicitly {@link google.cloud.automl.v1.UndeployModelRequest.verify|verify} messages. + * @param message UndeployModelRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.automl.v1.IUndeployModelRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified UndeployModelRequest message, length delimited. Does not implicitly {@link google.cloud.automl.v1.UndeployModelRequest.verify|verify} messages. + * @param message UndeployModelRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.automl.v1.IUndeployModelRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an UndeployModelRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns UndeployModelRequest + * @throws {Error} If the payload is not 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.automl.v1.UndeployModelRequest; + + /** + * Decodes an UndeployModelRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns UndeployModelRequest + * @throws {Error} If the payload 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.automl.v1.UndeployModelRequest; + + /** + * Verifies an UndeployModelRequest message. + * @param message Plain 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 UndeployModelRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns UndeployModelRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.automl.v1.UndeployModelRequest; + + /** + * Creates a plain object from an UndeployModelRequest message. Also converts values to other types if specified. + * @param message UndeployModelRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.automl.v1.UndeployModelRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this UndeployModelRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for UndeployModelRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an ExportModelRequest. */ + interface IExportModelRequest { + + /** ExportModelRequest name */ + name?: (string|null); + + /** ExportModelRequest outputConfig */ + outputConfig?: (google.cloud.automl.v1.IModelExportOutputConfig|null); + } + + /** Represents an ExportModelRequest. */ + class ExportModelRequest implements IExportModelRequest { + + /** + * Constructs a new ExportModelRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.automl.v1.IExportModelRequest); + + /** ExportModelRequest name. */ + public name: string; + + /** ExportModelRequest outputConfig. */ + public outputConfig?: (google.cloud.automl.v1.IModelExportOutputConfig|null); + + /** + * Creates a new ExportModelRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ExportModelRequest instance + */ + public static create(properties?: google.cloud.automl.v1.IExportModelRequest): google.cloud.automl.v1.ExportModelRequest; + + /** + * Encodes the specified ExportModelRequest message. Does not implicitly {@link google.cloud.automl.v1.ExportModelRequest.verify|verify} messages. + * @param message ExportModelRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.automl.v1.IExportModelRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ExportModelRequest message, length delimited. Does not implicitly {@link google.cloud.automl.v1.ExportModelRequest.verify|verify} messages. + * @param message ExportModelRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.automl.v1.IExportModelRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an ExportModelRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ExportModelRequest + * @throws {Error} If the payload is not 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.automl.v1.ExportModelRequest; + + /** + * Decodes an ExportModelRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ExportModelRequest + * @throws {Error} If the payload 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.automl.v1.ExportModelRequest; + + /** + * Verifies an ExportModelRequest message. + * @param message Plain 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 ExportModelRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ExportModelRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.automl.v1.ExportModelRequest; + + /** + * Creates a plain object from an ExportModelRequest message. Also converts values to other types if specified. + * @param message ExportModelRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.automl.v1.ExportModelRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ExportModelRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ExportModelRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a GetModelEvaluationRequest. */ + interface IGetModelEvaluationRequest { + + /** GetModelEvaluationRequest name */ + name?: (string|null); + } + + /** Represents a GetModelEvaluationRequest. */ + class GetModelEvaluationRequest implements IGetModelEvaluationRequest { + + /** + * Constructs a new GetModelEvaluationRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.automl.v1.IGetModelEvaluationRequest); + + /** GetModelEvaluationRequest name. */ + public name: string; + + /** + * Creates a new GetModelEvaluationRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GetModelEvaluationRequest instance + */ + public static create(properties?: google.cloud.automl.v1.IGetModelEvaluationRequest): google.cloud.automl.v1.GetModelEvaluationRequest; + + /** + * Encodes the specified GetModelEvaluationRequest message. Does not implicitly {@link google.cloud.automl.v1.GetModelEvaluationRequest.verify|verify} messages. + * @param message GetModelEvaluationRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.automl.v1.IGetModelEvaluationRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GetModelEvaluationRequest message, length delimited. Does not implicitly {@link google.cloud.automl.v1.GetModelEvaluationRequest.verify|verify} messages. + * @param message GetModelEvaluationRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.automl.v1.IGetModelEvaluationRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GetModelEvaluationRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GetModelEvaluationRequest + * @throws {Error} If the payload is not 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.automl.v1.GetModelEvaluationRequest; + + /** + * Decodes a GetModelEvaluationRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GetModelEvaluationRequest + * @throws {Error} If the payload 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.automl.v1.GetModelEvaluationRequest; + + /** + * Verifies a GetModelEvaluationRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GetModelEvaluationRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GetModelEvaluationRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.automl.v1.GetModelEvaluationRequest; + + /** + * Creates a plain object from a GetModelEvaluationRequest message. Also converts values to other types if specified. + * @param message GetModelEvaluationRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.automl.v1.GetModelEvaluationRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GetModelEvaluationRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GetModelEvaluationRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListModelEvaluationsRequest. */ + interface IListModelEvaluationsRequest { + + /** ListModelEvaluationsRequest parent */ + parent?: (string|null); + + /** ListModelEvaluationsRequest filter */ + filter?: (string|null); + + /** ListModelEvaluationsRequest pageSize */ + pageSize?: (number|null); + + /** ListModelEvaluationsRequest pageToken */ + pageToken?: (string|null); + } + + /** Represents a ListModelEvaluationsRequest. */ + class ListModelEvaluationsRequest implements IListModelEvaluationsRequest { + + /** + * Constructs a new ListModelEvaluationsRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.automl.v1.IListModelEvaluationsRequest); + + /** ListModelEvaluationsRequest parent. */ + public parent: string; + + /** ListModelEvaluationsRequest filter. */ + public filter: string; + + /** ListModelEvaluationsRequest pageSize. */ + public pageSize: number; + + /** ListModelEvaluationsRequest pageToken. */ + public pageToken: string; + + /** + * Creates a new ListModelEvaluationsRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ListModelEvaluationsRequest instance + */ + public static create(properties?: google.cloud.automl.v1.IListModelEvaluationsRequest): google.cloud.automl.v1.ListModelEvaluationsRequest; + + /** + * Encodes the specified ListModelEvaluationsRequest message. Does not implicitly {@link google.cloud.automl.v1.ListModelEvaluationsRequest.verify|verify} messages. + * @param message ListModelEvaluationsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.automl.v1.IListModelEvaluationsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListModelEvaluationsRequest message, length delimited. Does not implicitly {@link google.cloud.automl.v1.ListModelEvaluationsRequest.verify|verify} messages. + * @param message ListModelEvaluationsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.automl.v1.IListModelEvaluationsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListModelEvaluationsRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListModelEvaluationsRequest + * @throws {Error} If the payload is not 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.automl.v1.ListModelEvaluationsRequest; + + /** + * Decodes a ListModelEvaluationsRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListModelEvaluationsRequest + * @throws {Error} If the payload 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.automl.v1.ListModelEvaluationsRequest; + + /** + * Verifies a ListModelEvaluationsRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListModelEvaluationsRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListModelEvaluationsRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.automl.v1.ListModelEvaluationsRequest; + + /** + * Creates a plain object from a ListModelEvaluationsRequest message. Also converts values to other types if specified. + * @param message ListModelEvaluationsRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.automl.v1.ListModelEvaluationsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListModelEvaluationsRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListModelEvaluationsRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListModelEvaluationsResponse. */ + interface IListModelEvaluationsResponse { + + /** ListModelEvaluationsResponse modelEvaluation */ + modelEvaluation?: (google.cloud.automl.v1.IModelEvaluation[]|null); + + /** ListModelEvaluationsResponse nextPageToken */ + nextPageToken?: (string|null); + } + + /** Represents a ListModelEvaluationsResponse. */ + class ListModelEvaluationsResponse implements IListModelEvaluationsResponse { + + /** + * Constructs a new ListModelEvaluationsResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.automl.v1.IListModelEvaluationsResponse); + + /** ListModelEvaluationsResponse modelEvaluation. */ + public modelEvaluation: google.cloud.automl.v1.IModelEvaluation[]; + + /** ListModelEvaluationsResponse nextPageToken. */ + public nextPageToken: string; + + /** + * Creates a new ListModelEvaluationsResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ListModelEvaluationsResponse instance + */ + public static create(properties?: google.cloud.automl.v1.IListModelEvaluationsResponse): google.cloud.automl.v1.ListModelEvaluationsResponse; + + /** + * Encodes the specified ListModelEvaluationsResponse message. Does not implicitly {@link google.cloud.automl.v1.ListModelEvaluationsResponse.verify|verify} messages. + * @param message ListModelEvaluationsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.automl.v1.IListModelEvaluationsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListModelEvaluationsResponse message, length delimited. Does not implicitly {@link google.cloud.automl.v1.ListModelEvaluationsResponse.verify|verify} messages. + * @param message ListModelEvaluationsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.automl.v1.IListModelEvaluationsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListModelEvaluationsResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListModelEvaluationsResponse + * @throws {Error} If the payload is not 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.automl.v1.ListModelEvaluationsResponse; + + /** + * Decodes a ListModelEvaluationsResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListModelEvaluationsResponse + * @throws {Error} If the payload 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.automl.v1.ListModelEvaluationsResponse; + + /** + * Verifies a ListModelEvaluationsResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListModelEvaluationsResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListModelEvaluationsResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.automl.v1.ListModelEvaluationsResponse; + + /** + * Creates a plain object from a ListModelEvaluationsResponse message. Also converts values to other types if specified. + * @param message ListModelEvaluationsResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.automl.v1.ListModelEvaluationsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListModelEvaluationsResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListModelEvaluationsResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Namespace v1beta1. */ + namespace v1beta1 { + + /** Properties of an AnnotationPayload. */ + interface IAnnotationPayload { + + /** AnnotationPayload translation */ + translation?: (google.cloud.automl.v1beta1.ITranslationAnnotation|null); + + /** AnnotationPayload classification */ + classification?: (google.cloud.automl.v1beta1.IClassificationAnnotation|null); + + /** AnnotationPayload imageObjectDetection */ + imageObjectDetection?: (google.cloud.automl.v1beta1.IImageObjectDetectionAnnotation|null); + + /** AnnotationPayload videoClassification */ + videoClassification?: (google.cloud.automl.v1beta1.IVideoClassificationAnnotation|null); + + /** AnnotationPayload videoObjectTracking */ + videoObjectTracking?: (google.cloud.automl.v1beta1.IVideoObjectTrackingAnnotation|null); + + /** AnnotationPayload textExtraction */ + textExtraction?: (google.cloud.automl.v1beta1.ITextExtractionAnnotation|null); + + /** AnnotationPayload textSentiment */ + textSentiment?: (google.cloud.automl.v1beta1.ITextSentimentAnnotation|null); + + /** AnnotationPayload tables */ + tables?: (google.cloud.automl.v1beta1.ITablesAnnotation|null); + + /** AnnotationPayload annotationSpecId */ + annotationSpecId?: (string|null); + + /** AnnotationPayload displayName */ + displayName?: (string|null); + } + + /** Represents an AnnotationPayload. */ + class AnnotationPayload implements IAnnotationPayload { + + /** + * Constructs a new AnnotationPayload. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.automl.v1beta1.IAnnotationPayload); + + /** AnnotationPayload translation. */ + public translation?: (google.cloud.automl.v1beta1.ITranslationAnnotation|null); + + /** AnnotationPayload classification. */ + public classification?: (google.cloud.automl.v1beta1.IClassificationAnnotation|null); + + /** AnnotationPayload imageObjectDetection. */ + public imageObjectDetection?: (google.cloud.automl.v1beta1.IImageObjectDetectionAnnotation|null); + + /** AnnotationPayload videoClassification. */ + public videoClassification?: (google.cloud.automl.v1beta1.IVideoClassificationAnnotation|null); + + /** AnnotationPayload videoObjectTracking. */ + public videoObjectTracking?: (google.cloud.automl.v1beta1.IVideoObjectTrackingAnnotation|null); + + /** AnnotationPayload textExtraction. */ + public textExtraction?: (google.cloud.automl.v1beta1.ITextExtractionAnnotation|null); + + /** AnnotationPayload textSentiment. */ + public textSentiment?: (google.cloud.automl.v1beta1.ITextSentimentAnnotation|null); + + /** AnnotationPayload tables. */ + public tables?: (google.cloud.automl.v1beta1.ITablesAnnotation|null); + + /** AnnotationPayload annotationSpecId. */ + public annotationSpecId: string; + + /** AnnotationPayload displayName. */ + public displayName: string; + + /** AnnotationPayload detail. */ + public detail?: ("translation"|"classification"|"imageObjectDetection"|"videoClassification"|"videoObjectTracking"|"textExtraction"|"textSentiment"|"tables"); + + /** + * Creates a new AnnotationPayload instance using the specified properties. + * @param [properties] Properties to set + * @returns AnnotationPayload instance + */ + public static create(properties?: google.cloud.automl.v1beta1.IAnnotationPayload): google.cloud.automl.v1beta1.AnnotationPayload; + + /** + * Encodes the specified AnnotationPayload message. Does not implicitly {@link google.cloud.automl.v1beta1.AnnotationPayload.verify|verify} messages. + * @param message AnnotationPayload message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.automl.v1beta1.IAnnotationPayload, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified AnnotationPayload message, length delimited. Does not implicitly {@link google.cloud.automl.v1beta1.AnnotationPayload.verify|verify} messages. + * @param message AnnotationPayload message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.automl.v1beta1.IAnnotationPayload, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an AnnotationPayload message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns AnnotationPayload + * @throws {Error} If the payload is not 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.automl.v1beta1.AnnotationPayload; + + /** + * Decodes an AnnotationPayload message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns AnnotationPayload + * @throws {Error} If the payload 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.automl.v1beta1.AnnotationPayload; + + /** + * Verifies an AnnotationPayload message. + * @param message Plain 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 AnnotationPayload message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns AnnotationPayload + */ + public static fromObject(object: { [k: string]: any }): google.cloud.automl.v1beta1.AnnotationPayload; + + /** + * Creates a plain object from an AnnotationPayload message. Also converts values to other types if specified. + * @param message AnnotationPayload + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.automl.v1beta1.AnnotationPayload, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this AnnotationPayload to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for AnnotationPayload + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** ClassificationType enum. */ + enum ClassificationType { + CLASSIFICATION_TYPE_UNSPECIFIED = 0, + MULTICLASS = 1, + MULTILABEL = 2 + } + + /** Properties of a ClassificationAnnotation. */ + interface IClassificationAnnotation { + + /** ClassificationAnnotation score */ + score?: (number|null); + } + + /** Represents a ClassificationAnnotation. */ + class ClassificationAnnotation implements IClassificationAnnotation { + + /** + * Constructs a new ClassificationAnnotation. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.automl.v1beta1.IClassificationAnnotation); + + /** ClassificationAnnotation score. */ + public score: number; + + /** + * Creates a new ClassificationAnnotation instance using the specified properties. + * @param [properties] Properties to set + * @returns ClassificationAnnotation instance + */ + public static create(properties?: google.cloud.automl.v1beta1.IClassificationAnnotation): google.cloud.automl.v1beta1.ClassificationAnnotation; + + /** + * Encodes the specified ClassificationAnnotation message. Does not implicitly {@link google.cloud.automl.v1beta1.ClassificationAnnotation.verify|verify} messages. + * @param message ClassificationAnnotation message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.automl.v1beta1.IClassificationAnnotation, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ClassificationAnnotation message, length delimited. Does not implicitly {@link google.cloud.automl.v1beta1.ClassificationAnnotation.verify|verify} messages. + * @param message ClassificationAnnotation message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.automl.v1beta1.IClassificationAnnotation, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ClassificationAnnotation message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ClassificationAnnotation + * @throws {Error} If the payload is not 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.automl.v1beta1.ClassificationAnnotation; + + /** + * Decodes a ClassificationAnnotation message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ClassificationAnnotation + * @throws {Error} If the payload 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.automl.v1beta1.ClassificationAnnotation; + + /** + * Verifies a ClassificationAnnotation message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ClassificationAnnotation message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ClassificationAnnotation + */ + public static fromObject(object: { [k: string]: any }): google.cloud.automl.v1beta1.ClassificationAnnotation; + + /** + * Creates a plain object from a ClassificationAnnotation message. Also converts values to other types if specified. + * @param message ClassificationAnnotation + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.automl.v1beta1.ClassificationAnnotation, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ClassificationAnnotation to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ClassificationAnnotation + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a VideoClassificationAnnotation. */ + interface IVideoClassificationAnnotation { + + /** VideoClassificationAnnotation type */ + type?: (string|null); + + /** VideoClassificationAnnotation classificationAnnotation */ + classificationAnnotation?: (google.cloud.automl.v1beta1.IClassificationAnnotation|null); + + /** VideoClassificationAnnotation timeSegment */ + timeSegment?: (google.cloud.automl.v1beta1.ITimeSegment|null); + } + + /** Represents a VideoClassificationAnnotation. */ + class VideoClassificationAnnotation implements IVideoClassificationAnnotation { + + /** + * Constructs a new VideoClassificationAnnotation. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.automl.v1beta1.IVideoClassificationAnnotation); + + /** VideoClassificationAnnotation type. */ + public type: string; + + /** VideoClassificationAnnotation classificationAnnotation. */ + public classificationAnnotation?: (google.cloud.automl.v1beta1.IClassificationAnnotation|null); + + /** VideoClassificationAnnotation timeSegment. */ + public timeSegment?: (google.cloud.automl.v1beta1.ITimeSegment|null); + + /** + * Creates a new VideoClassificationAnnotation instance using the specified properties. + * @param [properties] Properties to set + * @returns VideoClassificationAnnotation instance + */ + public static create(properties?: google.cloud.automl.v1beta1.IVideoClassificationAnnotation): google.cloud.automl.v1beta1.VideoClassificationAnnotation; + + /** + * Encodes the specified VideoClassificationAnnotation message. Does not implicitly {@link google.cloud.automl.v1beta1.VideoClassificationAnnotation.verify|verify} messages. + * @param message VideoClassificationAnnotation message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.automl.v1beta1.IVideoClassificationAnnotation, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified VideoClassificationAnnotation message, length delimited. Does not implicitly {@link google.cloud.automl.v1beta1.VideoClassificationAnnotation.verify|verify} messages. + * @param message VideoClassificationAnnotation message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.automl.v1beta1.IVideoClassificationAnnotation, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a VideoClassificationAnnotation message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns VideoClassificationAnnotation + * @throws {Error} If the payload is not 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.automl.v1beta1.VideoClassificationAnnotation; + + /** + * Decodes a VideoClassificationAnnotation message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns VideoClassificationAnnotation + * @throws {Error} If the payload 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.automl.v1beta1.VideoClassificationAnnotation; + + /** + * Verifies a VideoClassificationAnnotation message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a VideoClassificationAnnotation message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns VideoClassificationAnnotation + */ + public static fromObject(object: { [k: string]: any }): google.cloud.automl.v1beta1.VideoClassificationAnnotation; + + /** + * Creates a plain object from a VideoClassificationAnnotation message. Also converts values to other types if specified. + * @param message VideoClassificationAnnotation + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.automl.v1beta1.VideoClassificationAnnotation, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this VideoClassificationAnnotation to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for VideoClassificationAnnotation + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ClassificationEvaluationMetrics. */ + interface IClassificationEvaluationMetrics { + + /** ClassificationEvaluationMetrics auPrc */ + auPrc?: (number|null); + + /** ClassificationEvaluationMetrics baseAuPrc */ + baseAuPrc?: (number|null); + + /** ClassificationEvaluationMetrics auRoc */ + auRoc?: (number|null); + + /** ClassificationEvaluationMetrics logLoss */ + logLoss?: (number|null); + + /** ClassificationEvaluationMetrics confidenceMetricsEntry */ + confidenceMetricsEntry?: (google.cloud.automl.v1beta1.ClassificationEvaluationMetrics.IConfidenceMetricsEntry[]|null); + + /** ClassificationEvaluationMetrics confusionMatrix */ + confusionMatrix?: (google.cloud.automl.v1beta1.ClassificationEvaluationMetrics.IConfusionMatrix|null); + + /** ClassificationEvaluationMetrics annotationSpecId */ + annotationSpecId?: (string[]|null); + } + + /** Represents a ClassificationEvaluationMetrics. */ + class ClassificationEvaluationMetrics implements IClassificationEvaluationMetrics { + + /** + * Constructs a new ClassificationEvaluationMetrics. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.automl.v1beta1.IClassificationEvaluationMetrics); + + /** ClassificationEvaluationMetrics auPrc. */ + public auPrc: number; + + /** ClassificationEvaluationMetrics baseAuPrc. */ + public baseAuPrc: number; + + /** ClassificationEvaluationMetrics auRoc. */ + public auRoc: number; + + /** ClassificationEvaluationMetrics logLoss. */ + public logLoss: number; + + /** ClassificationEvaluationMetrics confidenceMetricsEntry. */ + public confidenceMetricsEntry: google.cloud.automl.v1beta1.ClassificationEvaluationMetrics.IConfidenceMetricsEntry[]; + + /** ClassificationEvaluationMetrics confusionMatrix. */ + public confusionMatrix?: (google.cloud.automl.v1beta1.ClassificationEvaluationMetrics.IConfusionMatrix|null); + + /** ClassificationEvaluationMetrics annotationSpecId. */ + public annotationSpecId: string[]; + + /** + * Creates a new ClassificationEvaluationMetrics instance using the specified properties. + * @param [properties] Properties to set + * @returns ClassificationEvaluationMetrics instance + */ + public static create(properties?: google.cloud.automl.v1beta1.IClassificationEvaluationMetrics): google.cloud.automl.v1beta1.ClassificationEvaluationMetrics; + + /** + * Encodes the specified ClassificationEvaluationMetrics message. Does not implicitly {@link google.cloud.automl.v1beta1.ClassificationEvaluationMetrics.verify|verify} messages. + * @param message ClassificationEvaluationMetrics message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.automl.v1beta1.IClassificationEvaluationMetrics, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ClassificationEvaluationMetrics message, length delimited. Does not implicitly {@link google.cloud.automl.v1beta1.ClassificationEvaluationMetrics.verify|verify} messages. + * @param message ClassificationEvaluationMetrics message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.automl.v1beta1.IClassificationEvaluationMetrics, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ClassificationEvaluationMetrics message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ClassificationEvaluationMetrics + * @throws {Error} If the payload is not 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.automl.v1beta1.ClassificationEvaluationMetrics; + + /** + * Decodes a ClassificationEvaluationMetrics message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ClassificationEvaluationMetrics + * @throws {Error} If the payload 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.automl.v1beta1.ClassificationEvaluationMetrics; + + /** + * Verifies a ClassificationEvaluationMetrics message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ClassificationEvaluationMetrics message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ClassificationEvaluationMetrics + */ + public static fromObject(object: { [k: string]: any }): google.cloud.automl.v1beta1.ClassificationEvaluationMetrics; + + /** + * Creates a plain object from a ClassificationEvaluationMetrics message. Also converts values to other types if specified. + * @param message ClassificationEvaluationMetrics + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.automl.v1beta1.ClassificationEvaluationMetrics, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ClassificationEvaluationMetrics to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ClassificationEvaluationMetrics + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace ClassificationEvaluationMetrics { + + /** Properties of a ConfidenceMetricsEntry. */ + interface IConfidenceMetricsEntry { + + /** ConfidenceMetricsEntry confidenceThreshold */ + confidenceThreshold?: (number|null); + + /** ConfidenceMetricsEntry positionThreshold */ + positionThreshold?: (number|null); + + /** ConfidenceMetricsEntry recall */ + recall?: (number|null); + + /** ConfidenceMetricsEntry precision */ + precision?: (number|null); + + /** ConfidenceMetricsEntry falsePositiveRate */ + falsePositiveRate?: (number|null); + + /** ConfidenceMetricsEntry f1Score */ + f1Score?: (number|null); + + /** ConfidenceMetricsEntry recallAt1 */ + recallAt1?: (number|null); + + /** ConfidenceMetricsEntry precisionAt1 */ + precisionAt1?: (number|null); + + /** ConfidenceMetricsEntry falsePositiveRateAt1 */ + falsePositiveRateAt1?: (number|null); + + /** ConfidenceMetricsEntry f1ScoreAt1 */ + f1ScoreAt1?: (number|null); + + /** ConfidenceMetricsEntry truePositiveCount */ + truePositiveCount?: (number|Long|string|null); + + /** ConfidenceMetricsEntry falsePositiveCount */ + falsePositiveCount?: (number|Long|string|null); + + /** ConfidenceMetricsEntry falseNegativeCount */ + falseNegativeCount?: (number|Long|string|null); + + /** ConfidenceMetricsEntry trueNegativeCount */ + trueNegativeCount?: (number|Long|string|null); + } + + /** Represents a ConfidenceMetricsEntry. */ + class ConfidenceMetricsEntry implements IConfidenceMetricsEntry { + + /** + * Constructs a new ConfidenceMetricsEntry. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.automl.v1beta1.ClassificationEvaluationMetrics.IConfidenceMetricsEntry); + + /** ConfidenceMetricsEntry confidenceThreshold. */ + public confidenceThreshold: number; + + /** ConfidenceMetricsEntry positionThreshold. */ + public positionThreshold: number; + + /** ConfidenceMetricsEntry recall. */ + public recall: number; + + /** ConfidenceMetricsEntry precision. */ + public precision: number; + + /** ConfidenceMetricsEntry falsePositiveRate. */ + public falsePositiveRate: number; + + /** ConfidenceMetricsEntry f1Score. */ + public f1Score: number; + + /** ConfidenceMetricsEntry recallAt1. */ + public recallAt1: number; + + /** ConfidenceMetricsEntry precisionAt1. */ + public precisionAt1: number; + + /** ConfidenceMetricsEntry falsePositiveRateAt1. */ + public falsePositiveRateAt1: number; + + /** ConfidenceMetricsEntry f1ScoreAt1. */ + public f1ScoreAt1: number; + + /** ConfidenceMetricsEntry truePositiveCount. */ + public truePositiveCount: (number|Long|string); + + /** ConfidenceMetricsEntry falsePositiveCount. */ + public falsePositiveCount: (number|Long|string); + + /** ConfidenceMetricsEntry falseNegativeCount. */ + public falseNegativeCount: (number|Long|string); + + /** ConfidenceMetricsEntry trueNegativeCount. */ + public trueNegativeCount: (number|Long|string); + + /** + * Creates a new ConfidenceMetricsEntry instance using the specified properties. + * @param [properties] Properties to set + * @returns ConfidenceMetricsEntry instance + */ + public static create(properties?: google.cloud.automl.v1beta1.ClassificationEvaluationMetrics.IConfidenceMetricsEntry): google.cloud.automl.v1beta1.ClassificationEvaluationMetrics.ConfidenceMetricsEntry; + + /** + * Encodes the specified ConfidenceMetricsEntry message. Does not implicitly {@link google.cloud.automl.v1beta1.ClassificationEvaluationMetrics.ConfidenceMetricsEntry.verify|verify} messages. + * @param message ConfidenceMetricsEntry message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.automl.v1beta1.ClassificationEvaluationMetrics.IConfidenceMetricsEntry, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ConfidenceMetricsEntry message, length delimited. Does not implicitly {@link google.cloud.automl.v1beta1.ClassificationEvaluationMetrics.ConfidenceMetricsEntry.verify|verify} messages. + * @param message ConfidenceMetricsEntry message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.automl.v1beta1.ClassificationEvaluationMetrics.IConfidenceMetricsEntry, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ConfidenceMetricsEntry message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ConfidenceMetricsEntry + * @throws {Error} If the payload is not 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.automl.v1beta1.ClassificationEvaluationMetrics.ConfidenceMetricsEntry; + + /** + * Decodes a ConfidenceMetricsEntry message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ConfidenceMetricsEntry + * @throws {Error} If the payload 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.automl.v1beta1.ClassificationEvaluationMetrics.ConfidenceMetricsEntry; + + /** + * Verifies a ConfidenceMetricsEntry message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ConfidenceMetricsEntry message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ConfidenceMetricsEntry + */ + public static fromObject(object: { [k: string]: any }): google.cloud.automl.v1beta1.ClassificationEvaluationMetrics.ConfidenceMetricsEntry; + + /** + * Creates a plain object from a ConfidenceMetricsEntry message. Also converts values to other types if specified. + * @param message ConfidenceMetricsEntry + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.automl.v1beta1.ClassificationEvaluationMetrics.ConfidenceMetricsEntry, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ConfidenceMetricsEntry to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ConfidenceMetricsEntry + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ConfusionMatrix. */ + interface IConfusionMatrix { + + /** ConfusionMatrix annotationSpecId */ + annotationSpecId?: (string[]|null); + + /** ConfusionMatrix displayName */ + displayName?: (string[]|null); + + /** ConfusionMatrix row */ + row?: (google.cloud.automl.v1beta1.ClassificationEvaluationMetrics.ConfusionMatrix.IRow[]|null); + } + + /** Represents a ConfusionMatrix. */ + class ConfusionMatrix implements IConfusionMatrix { + + /** + * Constructs a new ConfusionMatrix. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.automl.v1beta1.ClassificationEvaluationMetrics.IConfusionMatrix); + + /** ConfusionMatrix annotationSpecId. */ + public annotationSpecId: string[]; + + /** ConfusionMatrix displayName. */ + public displayName: string[]; + + /** ConfusionMatrix row. */ + public row: google.cloud.automl.v1beta1.ClassificationEvaluationMetrics.ConfusionMatrix.IRow[]; + + /** + * Creates a new ConfusionMatrix instance using the specified properties. + * @param [properties] Properties to set + * @returns ConfusionMatrix instance + */ + public static create(properties?: google.cloud.automl.v1beta1.ClassificationEvaluationMetrics.IConfusionMatrix): google.cloud.automl.v1beta1.ClassificationEvaluationMetrics.ConfusionMatrix; + + /** + * Encodes the specified ConfusionMatrix message. Does not implicitly {@link google.cloud.automl.v1beta1.ClassificationEvaluationMetrics.ConfusionMatrix.verify|verify} messages. + * @param message ConfusionMatrix message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.automl.v1beta1.ClassificationEvaluationMetrics.IConfusionMatrix, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ConfusionMatrix message, length delimited. Does not implicitly {@link google.cloud.automl.v1beta1.ClassificationEvaluationMetrics.ConfusionMatrix.verify|verify} messages. + * @param message ConfusionMatrix message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.automl.v1beta1.ClassificationEvaluationMetrics.IConfusionMatrix, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ConfusionMatrix message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ConfusionMatrix + * @throws {Error} If the payload is not 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.automl.v1beta1.ClassificationEvaluationMetrics.ConfusionMatrix; + + /** + * Decodes a ConfusionMatrix message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ConfusionMatrix + * @throws {Error} If the payload 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.automl.v1beta1.ClassificationEvaluationMetrics.ConfusionMatrix; + + /** + * Verifies a ConfusionMatrix message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ConfusionMatrix message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ConfusionMatrix + */ + public static fromObject(object: { [k: string]: any }): google.cloud.automl.v1beta1.ClassificationEvaluationMetrics.ConfusionMatrix; + + /** + * Creates a plain object from a ConfusionMatrix message. Also converts values to other types if specified. + * @param message ConfusionMatrix + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.automl.v1beta1.ClassificationEvaluationMetrics.ConfusionMatrix, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ConfusionMatrix to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ConfusionMatrix + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace ConfusionMatrix { + + /** Properties of a Row. */ + interface IRow { + + /** Row exampleCount */ + exampleCount?: (number[]|null); + } + + /** Represents a Row. */ + class Row implements IRow { + + /** + * Constructs a new Row. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.automl.v1beta1.ClassificationEvaluationMetrics.ConfusionMatrix.IRow); + + /** Row exampleCount. */ + public exampleCount: number[]; + + /** + * Creates a new Row instance using the specified properties. + * @param [properties] Properties to set + * @returns Row instance + */ + public static create(properties?: google.cloud.automl.v1beta1.ClassificationEvaluationMetrics.ConfusionMatrix.IRow): google.cloud.automl.v1beta1.ClassificationEvaluationMetrics.ConfusionMatrix.Row; + + /** + * Encodes the specified Row message. Does not implicitly {@link google.cloud.automl.v1beta1.ClassificationEvaluationMetrics.ConfusionMatrix.Row.verify|verify} messages. + * @param message Row message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.automl.v1beta1.ClassificationEvaluationMetrics.ConfusionMatrix.IRow, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Row message, length delimited. Does not implicitly {@link google.cloud.automl.v1beta1.ClassificationEvaluationMetrics.ConfusionMatrix.Row.verify|verify} messages. + * @param message Row message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.automl.v1beta1.ClassificationEvaluationMetrics.ConfusionMatrix.IRow, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Row message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Row + * @throws {Error} If the payload is not 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.automl.v1beta1.ClassificationEvaluationMetrics.ConfusionMatrix.Row; + + /** + * Decodes a Row message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Row + * @throws {Error} If the payload 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.automl.v1beta1.ClassificationEvaluationMetrics.ConfusionMatrix.Row; + + /** + * Verifies a Row message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Row message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Row + */ + public static fromObject(object: { [k: string]: any }): google.cloud.automl.v1beta1.ClassificationEvaluationMetrics.ConfusionMatrix.Row; + + /** + * Creates a plain object from a Row message. Also converts values to other types if specified. + * @param message Row + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.automl.v1beta1.ClassificationEvaluationMetrics.ConfusionMatrix.Row, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Row to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Row + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + } + + /** Properties of a TimeSegment. */ + interface ITimeSegment { + + /** TimeSegment startTimeOffset */ + startTimeOffset?: (google.protobuf.IDuration|null); + + /** TimeSegment endTimeOffset */ + endTimeOffset?: (google.protobuf.IDuration|null); + } + + /** Represents a TimeSegment. */ + class TimeSegment implements ITimeSegment { + + /** + * Constructs a new TimeSegment. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.automl.v1beta1.ITimeSegment); + + /** TimeSegment startTimeOffset. */ + public startTimeOffset?: (google.protobuf.IDuration|null); + + /** TimeSegment endTimeOffset. */ + public endTimeOffset?: (google.protobuf.IDuration|null); + + /** + * Creates a new TimeSegment instance using the specified properties. + * @param [properties] Properties to set + * @returns TimeSegment instance + */ + public static create(properties?: google.cloud.automl.v1beta1.ITimeSegment): google.cloud.automl.v1beta1.TimeSegment; + + /** + * Encodes the specified TimeSegment message. Does not implicitly {@link google.cloud.automl.v1beta1.TimeSegment.verify|verify} messages. + * @param message TimeSegment message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.automl.v1beta1.ITimeSegment, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified TimeSegment message, length delimited. Does not implicitly {@link google.cloud.automl.v1beta1.TimeSegment.verify|verify} messages. + * @param message TimeSegment message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.automl.v1beta1.ITimeSegment, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TimeSegment message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns TimeSegment + * @throws {Error} If the payload is not 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.automl.v1beta1.TimeSegment; + + /** + * Decodes a TimeSegment message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns TimeSegment + * @throws {Error} If the payload 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.automl.v1beta1.TimeSegment; + + /** + * Verifies a TimeSegment message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a TimeSegment message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns TimeSegment + */ + public static fromObject(object: { [k: string]: any }): google.cloud.automl.v1beta1.TimeSegment; + + /** + * Creates a plain object from a TimeSegment message. Also converts values to other types if specified. + * @param message TimeSegment + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.automl.v1beta1.TimeSegment, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this TimeSegment to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for TimeSegment + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an ImageObjectDetectionAnnotation. */ + interface IImageObjectDetectionAnnotation { + + /** ImageObjectDetectionAnnotation boundingBox */ + boundingBox?: (google.cloud.automl.v1beta1.IBoundingPoly|null); + + /** ImageObjectDetectionAnnotation score */ + score?: (number|null); + } + + /** Represents an ImageObjectDetectionAnnotation. */ + class ImageObjectDetectionAnnotation implements IImageObjectDetectionAnnotation { + + /** + * Constructs a new ImageObjectDetectionAnnotation. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.automl.v1beta1.IImageObjectDetectionAnnotation); + + /** ImageObjectDetectionAnnotation boundingBox. */ + public boundingBox?: (google.cloud.automl.v1beta1.IBoundingPoly|null); + + /** ImageObjectDetectionAnnotation score. */ + public score: number; + + /** + * Creates a new ImageObjectDetectionAnnotation instance using the specified properties. + * @param [properties] Properties to set + * @returns ImageObjectDetectionAnnotation instance + */ + public static create(properties?: google.cloud.automl.v1beta1.IImageObjectDetectionAnnotation): google.cloud.automl.v1beta1.ImageObjectDetectionAnnotation; + + /** + * Encodes the specified ImageObjectDetectionAnnotation message. Does not implicitly {@link google.cloud.automl.v1beta1.ImageObjectDetectionAnnotation.verify|verify} messages. + * @param message ImageObjectDetectionAnnotation message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.automl.v1beta1.IImageObjectDetectionAnnotation, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ImageObjectDetectionAnnotation message, length delimited. Does not implicitly {@link google.cloud.automl.v1beta1.ImageObjectDetectionAnnotation.verify|verify} messages. + * @param message ImageObjectDetectionAnnotation message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.automl.v1beta1.IImageObjectDetectionAnnotation, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an ImageObjectDetectionAnnotation message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ImageObjectDetectionAnnotation + * @throws {Error} If the payload is not 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.automl.v1beta1.ImageObjectDetectionAnnotation; + + /** + * Decodes an ImageObjectDetectionAnnotation message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ImageObjectDetectionAnnotation + * @throws {Error} If the payload 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.automl.v1beta1.ImageObjectDetectionAnnotation; + + /** + * Verifies an ImageObjectDetectionAnnotation message. + * @param message Plain 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 ImageObjectDetectionAnnotation message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ImageObjectDetectionAnnotation + */ + public static fromObject(object: { [k: string]: any }): google.cloud.automl.v1beta1.ImageObjectDetectionAnnotation; + + /** + * Creates a plain object from an ImageObjectDetectionAnnotation message. Also converts values to other types if specified. + * @param message ImageObjectDetectionAnnotation + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.automl.v1beta1.ImageObjectDetectionAnnotation, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ImageObjectDetectionAnnotation to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ImageObjectDetectionAnnotation + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a VideoObjectTrackingAnnotation. */ + interface IVideoObjectTrackingAnnotation { + + /** VideoObjectTrackingAnnotation instanceId */ + instanceId?: (string|null); + + /** VideoObjectTrackingAnnotation timeOffset */ + timeOffset?: (google.protobuf.IDuration|null); + + /** VideoObjectTrackingAnnotation boundingBox */ + boundingBox?: (google.cloud.automl.v1beta1.IBoundingPoly|null); + + /** VideoObjectTrackingAnnotation score */ + score?: (number|null); + } + + /** Represents a VideoObjectTrackingAnnotation. */ + class VideoObjectTrackingAnnotation implements IVideoObjectTrackingAnnotation { + + /** + * Constructs a new VideoObjectTrackingAnnotation. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.automl.v1beta1.IVideoObjectTrackingAnnotation); + + /** VideoObjectTrackingAnnotation instanceId. */ + public instanceId: string; + + /** VideoObjectTrackingAnnotation timeOffset. */ + public timeOffset?: (google.protobuf.IDuration|null); + + /** VideoObjectTrackingAnnotation boundingBox. */ + public boundingBox?: (google.cloud.automl.v1beta1.IBoundingPoly|null); + + /** VideoObjectTrackingAnnotation score. */ + public score: number; + + /** + * Creates a new VideoObjectTrackingAnnotation instance using the specified properties. + * @param [properties] Properties to set + * @returns VideoObjectTrackingAnnotation instance + */ + public static create(properties?: google.cloud.automl.v1beta1.IVideoObjectTrackingAnnotation): google.cloud.automl.v1beta1.VideoObjectTrackingAnnotation; + + /** + * Encodes the specified VideoObjectTrackingAnnotation message. Does not implicitly {@link google.cloud.automl.v1beta1.VideoObjectTrackingAnnotation.verify|verify} messages. + * @param message VideoObjectTrackingAnnotation message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.automl.v1beta1.IVideoObjectTrackingAnnotation, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified VideoObjectTrackingAnnotation message, length delimited. Does not implicitly {@link google.cloud.automl.v1beta1.VideoObjectTrackingAnnotation.verify|verify} messages. + * @param message VideoObjectTrackingAnnotation message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.automl.v1beta1.IVideoObjectTrackingAnnotation, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a VideoObjectTrackingAnnotation message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns VideoObjectTrackingAnnotation + * @throws {Error} If the payload is not 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.automl.v1beta1.VideoObjectTrackingAnnotation; + + /** + * Decodes a VideoObjectTrackingAnnotation message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns VideoObjectTrackingAnnotation + * @throws {Error} If the payload 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.automl.v1beta1.VideoObjectTrackingAnnotation; + + /** + * Verifies a VideoObjectTrackingAnnotation message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a VideoObjectTrackingAnnotation message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns VideoObjectTrackingAnnotation + */ + public static fromObject(object: { [k: string]: any }): google.cloud.automl.v1beta1.VideoObjectTrackingAnnotation; + + /** + * Creates a plain object from a VideoObjectTrackingAnnotation message. Also converts values to other types if specified. + * @param message VideoObjectTrackingAnnotation + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.automl.v1beta1.VideoObjectTrackingAnnotation, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this VideoObjectTrackingAnnotation to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for VideoObjectTrackingAnnotation + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a BoundingBoxMetricsEntry. */ + interface IBoundingBoxMetricsEntry { + + /** BoundingBoxMetricsEntry iouThreshold */ + iouThreshold?: (number|null); + + /** BoundingBoxMetricsEntry meanAveragePrecision */ + meanAveragePrecision?: (number|null); + + /** BoundingBoxMetricsEntry confidenceMetricsEntries */ + confidenceMetricsEntries?: (google.cloud.automl.v1beta1.BoundingBoxMetricsEntry.IConfidenceMetricsEntry[]|null); + } + + /** Represents a BoundingBoxMetricsEntry. */ + class BoundingBoxMetricsEntry implements IBoundingBoxMetricsEntry { + + /** + * Constructs a new BoundingBoxMetricsEntry. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.automl.v1beta1.IBoundingBoxMetricsEntry); + + /** BoundingBoxMetricsEntry iouThreshold. */ + public iouThreshold: number; + + /** BoundingBoxMetricsEntry meanAveragePrecision. */ + public meanAveragePrecision: number; + + /** BoundingBoxMetricsEntry confidenceMetricsEntries. */ + public confidenceMetricsEntries: google.cloud.automl.v1beta1.BoundingBoxMetricsEntry.IConfidenceMetricsEntry[]; + + /** + * Creates a new BoundingBoxMetricsEntry instance using the specified properties. + * @param [properties] Properties to set + * @returns BoundingBoxMetricsEntry instance + */ + public static create(properties?: google.cloud.automl.v1beta1.IBoundingBoxMetricsEntry): google.cloud.automl.v1beta1.BoundingBoxMetricsEntry; + + /** + * Encodes the specified BoundingBoxMetricsEntry message. Does not implicitly {@link google.cloud.automl.v1beta1.BoundingBoxMetricsEntry.verify|verify} messages. + * @param message BoundingBoxMetricsEntry message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.automl.v1beta1.IBoundingBoxMetricsEntry, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified BoundingBoxMetricsEntry message, length delimited. Does not implicitly {@link google.cloud.automl.v1beta1.BoundingBoxMetricsEntry.verify|verify} messages. + * @param message BoundingBoxMetricsEntry message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.automl.v1beta1.IBoundingBoxMetricsEntry, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a BoundingBoxMetricsEntry message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns BoundingBoxMetricsEntry + * @throws {Error} If the payload is not 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.automl.v1beta1.BoundingBoxMetricsEntry; + + /** + * Decodes a BoundingBoxMetricsEntry message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns BoundingBoxMetricsEntry + * @throws {Error} If the payload 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.automl.v1beta1.BoundingBoxMetricsEntry; + + /** + * Verifies a BoundingBoxMetricsEntry message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a BoundingBoxMetricsEntry message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns BoundingBoxMetricsEntry + */ + public static fromObject(object: { [k: string]: any }): google.cloud.automl.v1beta1.BoundingBoxMetricsEntry; + + /** + * Creates a plain object from a BoundingBoxMetricsEntry message. Also converts values to other types if specified. + * @param message BoundingBoxMetricsEntry + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.automl.v1beta1.BoundingBoxMetricsEntry, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this BoundingBoxMetricsEntry to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for BoundingBoxMetricsEntry + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace BoundingBoxMetricsEntry { + + /** Properties of a ConfidenceMetricsEntry. */ + interface IConfidenceMetricsEntry { + + /** ConfidenceMetricsEntry confidenceThreshold */ + confidenceThreshold?: (number|null); + + /** ConfidenceMetricsEntry recall */ + recall?: (number|null); + + /** ConfidenceMetricsEntry precision */ + precision?: (number|null); + + /** ConfidenceMetricsEntry f1Score */ + f1Score?: (number|null); + } + + /** Represents a ConfidenceMetricsEntry. */ + class ConfidenceMetricsEntry implements IConfidenceMetricsEntry { + + /** + * Constructs a new ConfidenceMetricsEntry. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.automl.v1beta1.BoundingBoxMetricsEntry.IConfidenceMetricsEntry); + + /** ConfidenceMetricsEntry confidenceThreshold. */ + public confidenceThreshold: number; + + /** ConfidenceMetricsEntry recall. */ + public recall: number; + + /** ConfidenceMetricsEntry precision. */ + public precision: number; + + /** ConfidenceMetricsEntry f1Score. */ + public f1Score: number; + + /** + * Creates a new ConfidenceMetricsEntry instance using the specified properties. + * @param [properties] Properties to set + * @returns ConfidenceMetricsEntry instance + */ + public static create(properties?: google.cloud.automl.v1beta1.BoundingBoxMetricsEntry.IConfidenceMetricsEntry): google.cloud.automl.v1beta1.BoundingBoxMetricsEntry.ConfidenceMetricsEntry; + + /** + * Encodes the specified ConfidenceMetricsEntry message. Does not implicitly {@link google.cloud.automl.v1beta1.BoundingBoxMetricsEntry.ConfidenceMetricsEntry.verify|verify} messages. + * @param message ConfidenceMetricsEntry message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.automl.v1beta1.BoundingBoxMetricsEntry.IConfidenceMetricsEntry, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ConfidenceMetricsEntry message, length delimited. Does not implicitly {@link google.cloud.automl.v1beta1.BoundingBoxMetricsEntry.ConfidenceMetricsEntry.verify|verify} messages. + * @param message ConfidenceMetricsEntry message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.automl.v1beta1.BoundingBoxMetricsEntry.IConfidenceMetricsEntry, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ConfidenceMetricsEntry message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ConfidenceMetricsEntry + * @throws {Error} If the payload is not 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.automl.v1beta1.BoundingBoxMetricsEntry.ConfidenceMetricsEntry; + + /** + * Decodes a ConfidenceMetricsEntry message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ConfidenceMetricsEntry + * @throws {Error} If the payload 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.automl.v1beta1.BoundingBoxMetricsEntry.ConfidenceMetricsEntry; + + /** + * Verifies a ConfidenceMetricsEntry message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ConfidenceMetricsEntry message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ConfidenceMetricsEntry + */ + public static fromObject(object: { [k: string]: any }): google.cloud.automl.v1beta1.BoundingBoxMetricsEntry.ConfidenceMetricsEntry; + + /** + * Creates a plain object from a ConfidenceMetricsEntry message. Also converts values to other types if specified. + * @param message ConfidenceMetricsEntry + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.automl.v1beta1.BoundingBoxMetricsEntry.ConfidenceMetricsEntry, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ConfidenceMetricsEntry to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ConfidenceMetricsEntry + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Properties of an ImageObjectDetectionEvaluationMetrics. */ + interface IImageObjectDetectionEvaluationMetrics { + + /** ImageObjectDetectionEvaluationMetrics evaluatedBoundingBoxCount */ + evaluatedBoundingBoxCount?: (number|null); + + /** ImageObjectDetectionEvaluationMetrics boundingBoxMetricsEntries */ + boundingBoxMetricsEntries?: (google.cloud.automl.v1beta1.IBoundingBoxMetricsEntry[]|null); + + /** ImageObjectDetectionEvaluationMetrics boundingBoxMeanAveragePrecision */ + boundingBoxMeanAveragePrecision?: (number|null); + } + + /** Represents an ImageObjectDetectionEvaluationMetrics. */ + class ImageObjectDetectionEvaluationMetrics implements IImageObjectDetectionEvaluationMetrics { + + /** + * Constructs a new ImageObjectDetectionEvaluationMetrics. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.automl.v1beta1.IImageObjectDetectionEvaluationMetrics); + + /** ImageObjectDetectionEvaluationMetrics evaluatedBoundingBoxCount. */ + public evaluatedBoundingBoxCount: number; + + /** ImageObjectDetectionEvaluationMetrics boundingBoxMetricsEntries. */ + public boundingBoxMetricsEntries: google.cloud.automl.v1beta1.IBoundingBoxMetricsEntry[]; + + /** ImageObjectDetectionEvaluationMetrics boundingBoxMeanAveragePrecision. */ + public boundingBoxMeanAveragePrecision: number; + + /** + * Creates a new ImageObjectDetectionEvaluationMetrics instance using the specified properties. + * @param [properties] Properties to set + * @returns ImageObjectDetectionEvaluationMetrics instance + */ + public static create(properties?: google.cloud.automl.v1beta1.IImageObjectDetectionEvaluationMetrics): google.cloud.automl.v1beta1.ImageObjectDetectionEvaluationMetrics; + + /** + * Encodes the specified ImageObjectDetectionEvaluationMetrics message. Does not implicitly {@link google.cloud.automl.v1beta1.ImageObjectDetectionEvaluationMetrics.verify|verify} messages. + * @param message ImageObjectDetectionEvaluationMetrics message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.automl.v1beta1.IImageObjectDetectionEvaluationMetrics, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ImageObjectDetectionEvaluationMetrics message, length delimited. Does not implicitly {@link google.cloud.automl.v1beta1.ImageObjectDetectionEvaluationMetrics.verify|verify} messages. + * @param message ImageObjectDetectionEvaluationMetrics message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.automl.v1beta1.IImageObjectDetectionEvaluationMetrics, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an ImageObjectDetectionEvaluationMetrics message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ImageObjectDetectionEvaluationMetrics + * @throws {Error} If the payload is not 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.automl.v1beta1.ImageObjectDetectionEvaluationMetrics; + + /** + * Decodes an ImageObjectDetectionEvaluationMetrics message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ImageObjectDetectionEvaluationMetrics + * @throws {Error} If the payload 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.automl.v1beta1.ImageObjectDetectionEvaluationMetrics; + + /** + * Verifies an ImageObjectDetectionEvaluationMetrics message. + * @param message Plain 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 ImageObjectDetectionEvaluationMetrics message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ImageObjectDetectionEvaluationMetrics + */ + public static fromObject(object: { [k: string]: any }): google.cloud.automl.v1beta1.ImageObjectDetectionEvaluationMetrics; + + /** + * Creates a plain object from an ImageObjectDetectionEvaluationMetrics message. Also converts values to other types if specified. + * @param message ImageObjectDetectionEvaluationMetrics + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.automl.v1beta1.ImageObjectDetectionEvaluationMetrics, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ImageObjectDetectionEvaluationMetrics to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ImageObjectDetectionEvaluationMetrics + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a VideoObjectTrackingEvaluationMetrics. */ + interface IVideoObjectTrackingEvaluationMetrics { + + /** VideoObjectTrackingEvaluationMetrics evaluatedFrameCount */ + evaluatedFrameCount?: (number|null); + + /** VideoObjectTrackingEvaluationMetrics evaluatedBoundingBoxCount */ + evaluatedBoundingBoxCount?: (number|null); + + /** VideoObjectTrackingEvaluationMetrics boundingBoxMetricsEntries */ + boundingBoxMetricsEntries?: (google.cloud.automl.v1beta1.IBoundingBoxMetricsEntry[]|null); + + /** VideoObjectTrackingEvaluationMetrics boundingBoxMeanAveragePrecision */ + boundingBoxMeanAveragePrecision?: (number|null); + } + + /** Represents a VideoObjectTrackingEvaluationMetrics. */ + class VideoObjectTrackingEvaluationMetrics implements IVideoObjectTrackingEvaluationMetrics { + + /** + * Constructs a new VideoObjectTrackingEvaluationMetrics. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.automl.v1beta1.IVideoObjectTrackingEvaluationMetrics); + + /** VideoObjectTrackingEvaluationMetrics evaluatedFrameCount. */ + public evaluatedFrameCount: number; + + /** VideoObjectTrackingEvaluationMetrics evaluatedBoundingBoxCount. */ + public evaluatedBoundingBoxCount: number; + + /** VideoObjectTrackingEvaluationMetrics boundingBoxMetricsEntries. */ + public boundingBoxMetricsEntries: google.cloud.automl.v1beta1.IBoundingBoxMetricsEntry[]; + + /** VideoObjectTrackingEvaluationMetrics boundingBoxMeanAveragePrecision. */ + public boundingBoxMeanAveragePrecision: number; + + /** + * Creates a new VideoObjectTrackingEvaluationMetrics instance using the specified properties. + * @param [properties] Properties to set + * @returns VideoObjectTrackingEvaluationMetrics instance + */ + public static create(properties?: google.cloud.automl.v1beta1.IVideoObjectTrackingEvaluationMetrics): google.cloud.automl.v1beta1.VideoObjectTrackingEvaluationMetrics; + + /** + * Encodes the specified VideoObjectTrackingEvaluationMetrics message. Does not implicitly {@link google.cloud.automl.v1beta1.VideoObjectTrackingEvaluationMetrics.verify|verify} messages. + * @param message VideoObjectTrackingEvaluationMetrics message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.automl.v1beta1.IVideoObjectTrackingEvaluationMetrics, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified VideoObjectTrackingEvaluationMetrics message, length delimited. Does not implicitly {@link google.cloud.automl.v1beta1.VideoObjectTrackingEvaluationMetrics.verify|verify} messages. + * @param message VideoObjectTrackingEvaluationMetrics message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.automl.v1beta1.IVideoObjectTrackingEvaluationMetrics, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a VideoObjectTrackingEvaluationMetrics message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns VideoObjectTrackingEvaluationMetrics + * @throws {Error} If the payload is not 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.automl.v1beta1.VideoObjectTrackingEvaluationMetrics; + + /** + * Decodes a VideoObjectTrackingEvaluationMetrics message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns VideoObjectTrackingEvaluationMetrics + * @throws {Error} If the payload 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.automl.v1beta1.VideoObjectTrackingEvaluationMetrics; + + /** + * Verifies a VideoObjectTrackingEvaluationMetrics message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a VideoObjectTrackingEvaluationMetrics message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns VideoObjectTrackingEvaluationMetrics + */ + public static fromObject(object: { [k: string]: any }): google.cloud.automl.v1beta1.VideoObjectTrackingEvaluationMetrics; + + /** + * Creates a plain object from a VideoObjectTrackingEvaluationMetrics message. Also converts values to other types if specified. + * @param message VideoObjectTrackingEvaluationMetrics + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.automl.v1beta1.VideoObjectTrackingEvaluationMetrics, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this VideoObjectTrackingEvaluationMetrics to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for VideoObjectTrackingEvaluationMetrics + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a NormalizedVertex. */ + interface INormalizedVertex { + + /** NormalizedVertex x */ + x?: (number|null); + + /** NormalizedVertex y */ + y?: (number|null); + } + + /** Represents a NormalizedVertex. */ + class NormalizedVertex implements INormalizedVertex { + + /** + * Constructs a new NormalizedVertex. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.automl.v1beta1.INormalizedVertex); + + /** NormalizedVertex x. */ + public x: number; + + /** NormalizedVertex y. */ + public y: number; + + /** + * Creates a new NormalizedVertex instance using the specified properties. + * @param [properties] Properties to set + * @returns NormalizedVertex instance + */ + public static create(properties?: google.cloud.automl.v1beta1.INormalizedVertex): google.cloud.automl.v1beta1.NormalizedVertex; + + /** + * Encodes the specified NormalizedVertex message. Does not implicitly {@link google.cloud.automl.v1beta1.NormalizedVertex.verify|verify} messages. + * @param message NormalizedVertex message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.automl.v1beta1.INormalizedVertex, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified NormalizedVertex message, length delimited. Does not implicitly {@link google.cloud.automl.v1beta1.NormalizedVertex.verify|verify} messages. + * @param message NormalizedVertex message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.automl.v1beta1.INormalizedVertex, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a NormalizedVertex message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns NormalizedVertex + * @throws {Error} If the payload is not 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.automl.v1beta1.NormalizedVertex; + + /** + * Decodes a NormalizedVertex message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns NormalizedVertex + * @throws {Error} If the payload 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.automl.v1beta1.NormalizedVertex; + + /** + * Verifies a NormalizedVertex message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a NormalizedVertex message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns NormalizedVertex + */ + public static fromObject(object: { [k: string]: any }): google.cloud.automl.v1beta1.NormalizedVertex; + + /** + * Creates a plain object from a NormalizedVertex message. Also converts values to other types if specified. + * @param message NormalizedVertex + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.automl.v1beta1.NormalizedVertex, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this NormalizedVertex to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for NormalizedVertex + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a BoundingPoly. */ + interface IBoundingPoly { + + /** BoundingPoly normalizedVertices */ + normalizedVertices?: (google.cloud.automl.v1beta1.INormalizedVertex[]|null); + } + + /** Represents a BoundingPoly. */ + class BoundingPoly implements IBoundingPoly { + + /** + * Constructs a new BoundingPoly. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.automl.v1beta1.IBoundingPoly); + + /** BoundingPoly normalizedVertices. */ + public normalizedVertices: google.cloud.automl.v1beta1.INormalizedVertex[]; + + /** + * Creates a new BoundingPoly instance using the specified properties. + * @param [properties] Properties to set + * @returns BoundingPoly instance + */ + public static create(properties?: google.cloud.automl.v1beta1.IBoundingPoly): google.cloud.automl.v1beta1.BoundingPoly; + + /** + * Encodes the specified BoundingPoly message. Does not implicitly {@link google.cloud.automl.v1beta1.BoundingPoly.verify|verify} messages. + * @param message BoundingPoly message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.automl.v1beta1.IBoundingPoly, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified BoundingPoly message, length delimited. Does not implicitly {@link google.cloud.automl.v1beta1.BoundingPoly.verify|verify} messages. + * @param message BoundingPoly message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.automl.v1beta1.IBoundingPoly, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a BoundingPoly message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns BoundingPoly + * @throws {Error} If the payload is not 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.automl.v1beta1.BoundingPoly; + + /** + * Decodes a BoundingPoly message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns BoundingPoly + * @throws {Error} If the payload 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.automl.v1beta1.BoundingPoly; + + /** + * Verifies a BoundingPoly message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a BoundingPoly message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns BoundingPoly + */ + public static fromObject(object: { [k: string]: any }): google.cloud.automl.v1beta1.BoundingPoly; + + /** + * Creates a plain object from a BoundingPoly message. Also converts values to other types if specified. + * @param message BoundingPoly + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.automl.v1beta1.BoundingPoly, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this BoundingPoly to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for BoundingPoly + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TablesDatasetMetadata. */ + interface ITablesDatasetMetadata { + + /** TablesDatasetMetadata primaryTableSpecId */ + primaryTableSpecId?: (string|null); + + /** TablesDatasetMetadata targetColumnSpecId */ + targetColumnSpecId?: (string|null); + + /** TablesDatasetMetadata weightColumnSpecId */ + weightColumnSpecId?: (string|null); + + /** TablesDatasetMetadata mlUseColumnSpecId */ + mlUseColumnSpecId?: (string|null); + + /** TablesDatasetMetadata targetColumnCorrelations */ + targetColumnCorrelations?: ({ [k: string]: google.cloud.automl.v1beta1.ICorrelationStats }|null); + + /** TablesDatasetMetadata statsUpdateTime */ + statsUpdateTime?: (google.protobuf.ITimestamp|null); + } + + /** Represents a TablesDatasetMetadata. */ + class TablesDatasetMetadata implements ITablesDatasetMetadata { + + /** + * Constructs a new TablesDatasetMetadata. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.automl.v1beta1.ITablesDatasetMetadata); + + /** TablesDatasetMetadata primaryTableSpecId. */ + public primaryTableSpecId: string; + + /** TablesDatasetMetadata targetColumnSpecId. */ + public targetColumnSpecId: string; + + /** TablesDatasetMetadata weightColumnSpecId. */ + public weightColumnSpecId: string; + + /** TablesDatasetMetadata mlUseColumnSpecId. */ + public mlUseColumnSpecId: string; + + /** TablesDatasetMetadata targetColumnCorrelations. */ + public targetColumnCorrelations: { [k: string]: google.cloud.automl.v1beta1.ICorrelationStats }; + + /** TablesDatasetMetadata statsUpdateTime. */ + public statsUpdateTime?: (google.protobuf.ITimestamp|null); + + /** + * Creates a new TablesDatasetMetadata instance using the specified properties. + * @param [properties] Properties to set + * @returns TablesDatasetMetadata instance + */ + public static create(properties?: google.cloud.automl.v1beta1.ITablesDatasetMetadata): google.cloud.automl.v1beta1.TablesDatasetMetadata; + + /** + * Encodes the specified TablesDatasetMetadata message. Does not implicitly {@link google.cloud.automl.v1beta1.TablesDatasetMetadata.verify|verify} messages. + * @param message TablesDatasetMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.automl.v1beta1.ITablesDatasetMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified TablesDatasetMetadata message, length delimited. Does not implicitly {@link google.cloud.automl.v1beta1.TablesDatasetMetadata.verify|verify} messages. + * @param message TablesDatasetMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.automl.v1beta1.ITablesDatasetMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TablesDatasetMetadata message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns TablesDatasetMetadata + * @throws {Error} If the payload is not 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.automl.v1beta1.TablesDatasetMetadata; + + /** + * Decodes a TablesDatasetMetadata message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns TablesDatasetMetadata + * @throws {Error} If the payload 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.automl.v1beta1.TablesDatasetMetadata; + + /** + * Verifies a TablesDatasetMetadata message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a TablesDatasetMetadata message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns TablesDatasetMetadata + */ + public static fromObject(object: { [k: string]: any }): google.cloud.automl.v1beta1.TablesDatasetMetadata; + + /** + * Creates a plain object from a TablesDatasetMetadata message. Also converts values to other types if specified. + * @param message TablesDatasetMetadata + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.automl.v1beta1.TablesDatasetMetadata, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this TablesDatasetMetadata to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for TablesDatasetMetadata + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TablesModelMetadata. */ + interface ITablesModelMetadata { + + /** TablesModelMetadata optimizationObjectiveRecallValue */ + optimizationObjectiveRecallValue?: (number|null); + + /** TablesModelMetadata optimizationObjectivePrecisionValue */ + optimizationObjectivePrecisionValue?: (number|null); + + /** TablesModelMetadata targetColumnSpec */ + targetColumnSpec?: (google.cloud.automl.v1beta1.IColumnSpec|null); + + /** TablesModelMetadata inputFeatureColumnSpecs */ + inputFeatureColumnSpecs?: (google.cloud.automl.v1beta1.IColumnSpec[]|null); + + /** TablesModelMetadata optimizationObjective */ + optimizationObjective?: (string|null); + + /** TablesModelMetadata tablesModelColumnInfo */ + tablesModelColumnInfo?: (google.cloud.automl.v1beta1.ITablesModelColumnInfo[]|null); + + /** TablesModelMetadata trainBudgetMilliNodeHours */ + trainBudgetMilliNodeHours?: (number|Long|string|null); + + /** TablesModelMetadata trainCostMilliNodeHours */ + trainCostMilliNodeHours?: (number|Long|string|null); + + /** TablesModelMetadata disableEarlyStopping */ + disableEarlyStopping?: (boolean|null); + } + + /** Represents a TablesModelMetadata. */ + class TablesModelMetadata implements ITablesModelMetadata { + + /** + * Constructs a new TablesModelMetadata. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.automl.v1beta1.ITablesModelMetadata); + + /** TablesModelMetadata optimizationObjectiveRecallValue. */ + public optimizationObjectiveRecallValue?: (number|null); + + /** TablesModelMetadata optimizationObjectivePrecisionValue. */ + public optimizationObjectivePrecisionValue?: (number|null); + + /** TablesModelMetadata targetColumnSpec. */ + public targetColumnSpec?: (google.cloud.automl.v1beta1.IColumnSpec|null); + + /** TablesModelMetadata inputFeatureColumnSpecs. */ + public inputFeatureColumnSpecs: google.cloud.automl.v1beta1.IColumnSpec[]; + + /** TablesModelMetadata optimizationObjective. */ + public optimizationObjective: string; + + /** TablesModelMetadata tablesModelColumnInfo. */ + public tablesModelColumnInfo: google.cloud.automl.v1beta1.ITablesModelColumnInfo[]; + + /** TablesModelMetadata trainBudgetMilliNodeHours. */ + public trainBudgetMilliNodeHours: (number|Long|string); + + /** TablesModelMetadata trainCostMilliNodeHours. */ + public trainCostMilliNodeHours: (number|Long|string); + + /** TablesModelMetadata disableEarlyStopping. */ + public disableEarlyStopping: boolean; + + /** TablesModelMetadata additionalOptimizationObjectiveConfig. */ + public additionalOptimizationObjectiveConfig?: ("optimizationObjectiveRecallValue"|"optimizationObjectivePrecisionValue"); + + /** + * Creates a new TablesModelMetadata instance using the specified properties. + * @param [properties] Properties to set + * @returns TablesModelMetadata instance + */ + public static create(properties?: google.cloud.automl.v1beta1.ITablesModelMetadata): google.cloud.automl.v1beta1.TablesModelMetadata; + + /** + * Encodes the specified TablesModelMetadata message. Does not implicitly {@link google.cloud.automl.v1beta1.TablesModelMetadata.verify|verify} messages. + * @param message TablesModelMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.automl.v1beta1.ITablesModelMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified TablesModelMetadata message, length delimited. Does not implicitly {@link google.cloud.automl.v1beta1.TablesModelMetadata.verify|verify} messages. + * @param message TablesModelMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.automl.v1beta1.ITablesModelMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TablesModelMetadata message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns TablesModelMetadata + * @throws {Error} If the payload is not 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.automl.v1beta1.TablesModelMetadata; + + /** + * Decodes a TablesModelMetadata message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns TablesModelMetadata + * @throws {Error} If the payload 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.automl.v1beta1.TablesModelMetadata; + + /** + * Verifies a TablesModelMetadata message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a TablesModelMetadata message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns TablesModelMetadata + */ + public static fromObject(object: { [k: string]: any }): google.cloud.automl.v1beta1.TablesModelMetadata; + + /** + * Creates a plain object from a TablesModelMetadata message. Also converts values to other types if specified. + * @param message TablesModelMetadata + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.automl.v1beta1.TablesModelMetadata, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this TablesModelMetadata to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for TablesModelMetadata + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TablesAnnotation. */ + interface ITablesAnnotation { + + /** TablesAnnotation score */ + score?: (number|null); + + /** TablesAnnotation predictionInterval */ + predictionInterval?: (google.cloud.automl.v1beta1.IDoubleRange|null); + + /** TablesAnnotation value */ + value?: (google.protobuf.IValue|null); + + /** TablesAnnotation tablesModelColumnInfo */ + tablesModelColumnInfo?: (google.cloud.automl.v1beta1.ITablesModelColumnInfo[]|null); + + /** TablesAnnotation baselineScore */ + baselineScore?: (number|null); + } + + /** Represents a TablesAnnotation. */ + class TablesAnnotation implements ITablesAnnotation { + + /** + * Constructs a new TablesAnnotation. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.automl.v1beta1.ITablesAnnotation); + + /** TablesAnnotation score. */ + public score: number; + + /** TablesAnnotation predictionInterval. */ + public predictionInterval?: (google.cloud.automl.v1beta1.IDoubleRange|null); + + /** TablesAnnotation value. */ + public value?: (google.protobuf.IValue|null); + + /** TablesAnnotation tablesModelColumnInfo. */ + public tablesModelColumnInfo: google.cloud.automl.v1beta1.ITablesModelColumnInfo[]; + + /** TablesAnnotation baselineScore. */ + public baselineScore: number; + + /** + * Creates a new TablesAnnotation instance using the specified properties. + * @param [properties] Properties to set + * @returns TablesAnnotation instance + */ + public static create(properties?: google.cloud.automl.v1beta1.ITablesAnnotation): google.cloud.automl.v1beta1.TablesAnnotation; + + /** + * Encodes the specified TablesAnnotation message. Does not implicitly {@link google.cloud.automl.v1beta1.TablesAnnotation.verify|verify} messages. + * @param message TablesAnnotation message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.automl.v1beta1.ITablesAnnotation, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified TablesAnnotation message, length delimited. Does not implicitly {@link google.cloud.automl.v1beta1.TablesAnnotation.verify|verify} messages. + * @param message TablesAnnotation message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.automl.v1beta1.ITablesAnnotation, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TablesAnnotation message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns TablesAnnotation + * @throws {Error} If the payload is not 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.automl.v1beta1.TablesAnnotation; + + /** + * Decodes a TablesAnnotation message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns TablesAnnotation + * @throws {Error} If the payload 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.automl.v1beta1.TablesAnnotation; + + /** + * Verifies a TablesAnnotation message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a TablesAnnotation message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns TablesAnnotation + */ + public static fromObject(object: { [k: string]: any }): google.cloud.automl.v1beta1.TablesAnnotation; + + /** + * Creates a plain object from a TablesAnnotation message. Also converts values to other types if specified. + * @param message TablesAnnotation + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.automl.v1beta1.TablesAnnotation, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this TablesAnnotation to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for TablesAnnotation + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TablesModelColumnInfo. */ + interface ITablesModelColumnInfo { + + /** TablesModelColumnInfo columnSpecName */ + columnSpecName?: (string|null); + + /** TablesModelColumnInfo columnDisplayName */ + columnDisplayName?: (string|null); + + /** TablesModelColumnInfo featureImportance */ + featureImportance?: (number|null); + } + + /** Represents a TablesModelColumnInfo. */ + class TablesModelColumnInfo implements ITablesModelColumnInfo { + + /** + * Constructs a new TablesModelColumnInfo. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.automl.v1beta1.ITablesModelColumnInfo); + + /** TablesModelColumnInfo columnSpecName. */ + public columnSpecName: string; + + /** TablesModelColumnInfo columnDisplayName. */ + public columnDisplayName: string; + + /** TablesModelColumnInfo featureImportance. */ + public featureImportance: number; + + /** + * Creates a new TablesModelColumnInfo instance using the specified properties. + * @param [properties] Properties to set + * @returns TablesModelColumnInfo instance + */ + public static create(properties?: google.cloud.automl.v1beta1.ITablesModelColumnInfo): google.cloud.automl.v1beta1.TablesModelColumnInfo; + + /** + * Encodes the specified TablesModelColumnInfo message. Does not implicitly {@link google.cloud.automl.v1beta1.TablesModelColumnInfo.verify|verify} messages. + * @param message TablesModelColumnInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.automl.v1beta1.ITablesModelColumnInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified TablesModelColumnInfo message, length delimited. Does not implicitly {@link google.cloud.automl.v1beta1.TablesModelColumnInfo.verify|verify} messages. + * @param message TablesModelColumnInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.automl.v1beta1.ITablesModelColumnInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TablesModelColumnInfo message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns TablesModelColumnInfo + * @throws {Error} If the payload is not 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.automl.v1beta1.TablesModelColumnInfo; + + /** + * Decodes a TablesModelColumnInfo message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns TablesModelColumnInfo + * @throws {Error} If the payload 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.automl.v1beta1.TablesModelColumnInfo; + + /** + * Verifies a TablesModelColumnInfo message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a TablesModelColumnInfo message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns TablesModelColumnInfo + */ + public static fromObject(object: { [k: string]: any }): google.cloud.automl.v1beta1.TablesModelColumnInfo; + + /** + * Creates a plain object from a TablesModelColumnInfo message. Also converts values to other types if specified. + * @param message TablesModelColumnInfo + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.automl.v1beta1.TablesModelColumnInfo, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this TablesModelColumnInfo to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for TablesModelColumnInfo + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ColumnSpec. */ + interface IColumnSpec { + + /** ColumnSpec name */ + name?: (string|null); + + /** ColumnSpec dataType */ + dataType?: (google.cloud.automl.v1beta1.IDataType|null); + + /** ColumnSpec displayName */ + displayName?: (string|null); + + /** ColumnSpec dataStats */ + dataStats?: (google.cloud.automl.v1beta1.IDataStats|null); + + /** ColumnSpec topCorrelatedColumns */ + topCorrelatedColumns?: (google.cloud.automl.v1beta1.ColumnSpec.ICorrelatedColumn[]|null); + + /** ColumnSpec etag */ + etag?: (string|null); + } + + /** Represents a ColumnSpec. */ + class ColumnSpec implements IColumnSpec { + + /** + * Constructs a new ColumnSpec. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.automl.v1beta1.IColumnSpec); + + /** ColumnSpec name. */ + public name: string; + + /** ColumnSpec dataType. */ + public dataType?: (google.cloud.automl.v1beta1.IDataType|null); + + /** ColumnSpec displayName. */ + public displayName: string; + + /** ColumnSpec dataStats. */ + public dataStats?: (google.cloud.automl.v1beta1.IDataStats|null); + + /** ColumnSpec topCorrelatedColumns. */ + public topCorrelatedColumns: google.cloud.automl.v1beta1.ColumnSpec.ICorrelatedColumn[]; + + /** ColumnSpec etag. */ + public etag: string; + + /** + * Creates a new ColumnSpec instance using the specified properties. + * @param [properties] Properties to set + * @returns ColumnSpec instance + */ + public static create(properties?: google.cloud.automl.v1beta1.IColumnSpec): google.cloud.automl.v1beta1.ColumnSpec; + + /** + * Encodes the specified ColumnSpec message. Does not implicitly {@link google.cloud.automl.v1beta1.ColumnSpec.verify|verify} messages. + * @param message ColumnSpec message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.automl.v1beta1.IColumnSpec, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ColumnSpec message, length delimited. Does not implicitly {@link google.cloud.automl.v1beta1.ColumnSpec.verify|verify} messages. + * @param message ColumnSpec message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.automl.v1beta1.IColumnSpec, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ColumnSpec message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ColumnSpec + * @throws {Error} If the payload is not 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.automl.v1beta1.ColumnSpec; + + /** + * Decodes a ColumnSpec message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ColumnSpec + * @throws {Error} If the payload 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.automl.v1beta1.ColumnSpec; + + /** + * Verifies a ColumnSpec message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ColumnSpec message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ColumnSpec + */ + public static fromObject(object: { [k: string]: any }): google.cloud.automl.v1beta1.ColumnSpec; + + /** + * Creates a plain object from a ColumnSpec message. Also converts values to other types if specified. + * @param message ColumnSpec + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.automl.v1beta1.ColumnSpec, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ColumnSpec to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ColumnSpec + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace ColumnSpec { + + /** Properties of a CorrelatedColumn. */ + interface ICorrelatedColumn { + + /** CorrelatedColumn columnSpecId */ + columnSpecId?: (string|null); + + /** CorrelatedColumn correlationStats */ + correlationStats?: (google.cloud.automl.v1beta1.ICorrelationStats|null); + } + + /** Represents a CorrelatedColumn. */ + class CorrelatedColumn implements ICorrelatedColumn { + + /** + * Constructs a new CorrelatedColumn. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.automl.v1beta1.ColumnSpec.ICorrelatedColumn); + + /** CorrelatedColumn columnSpecId. */ + public columnSpecId: string; + + /** CorrelatedColumn correlationStats. */ + public correlationStats?: (google.cloud.automl.v1beta1.ICorrelationStats|null); + + /** + * Creates a new CorrelatedColumn instance using the specified properties. + * @param [properties] Properties to set + * @returns CorrelatedColumn instance + */ + public static create(properties?: google.cloud.automl.v1beta1.ColumnSpec.ICorrelatedColumn): google.cloud.automl.v1beta1.ColumnSpec.CorrelatedColumn; + + /** + * Encodes the specified CorrelatedColumn message. Does not implicitly {@link google.cloud.automl.v1beta1.ColumnSpec.CorrelatedColumn.verify|verify} messages. + * @param message CorrelatedColumn message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.automl.v1beta1.ColumnSpec.ICorrelatedColumn, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CorrelatedColumn message, length delimited. Does not implicitly {@link google.cloud.automl.v1beta1.ColumnSpec.CorrelatedColumn.verify|verify} messages. + * @param message CorrelatedColumn message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.automl.v1beta1.ColumnSpec.ICorrelatedColumn, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CorrelatedColumn message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CorrelatedColumn + * @throws {Error} If the payload is not 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.automl.v1beta1.ColumnSpec.CorrelatedColumn; + + /** + * Decodes a CorrelatedColumn message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CorrelatedColumn + * @throws {Error} If the payload 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.automl.v1beta1.ColumnSpec.CorrelatedColumn; + + /** + * Verifies a CorrelatedColumn message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CorrelatedColumn message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CorrelatedColumn + */ + public static fromObject(object: { [k: string]: any }): google.cloud.automl.v1beta1.ColumnSpec.CorrelatedColumn; + + /** + * Creates a plain object from a CorrelatedColumn message. Also converts values to other types if specified. + * @param message CorrelatedColumn + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.automl.v1beta1.ColumnSpec.CorrelatedColumn, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CorrelatedColumn to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CorrelatedColumn + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Properties of a DataStats. */ + interface IDataStats { + + /** DataStats float64Stats */ + float64Stats?: (google.cloud.automl.v1beta1.IFloat64Stats|null); + + /** DataStats stringStats */ + stringStats?: (google.cloud.automl.v1beta1.IStringStats|null); + + /** DataStats timestampStats */ + timestampStats?: (google.cloud.automl.v1beta1.ITimestampStats|null); + + /** DataStats arrayStats */ + arrayStats?: (google.cloud.automl.v1beta1.IArrayStats|null); + + /** DataStats structStats */ + structStats?: (google.cloud.automl.v1beta1.IStructStats|null); + + /** DataStats categoryStats */ + categoryStats?: (google.cloud.automl.v1beta1.ICategoryStats|null); + + /** DataStats distinctValueCount */ + distinctValueCount?: (number|Long|string|null); + + /** DataStats nullValueCount */ + nullValueCount?: (number|Long|string|null); + + /** DataStats validValueCount */ + validValueCount?: (number|Long|string|null); + } + + /** Represents a DataStats. */ + class DataStats implements IDataStats { + + /** + * Constructs a new DataStats. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.automl.v1beta1.IDataStats); + + /** DataStats float64Stats. */ + public float64Stats?: (google.cloud.automl.v1beta1.IFloat64Stats|null); + + /** DataStats stringStats. */ + public stringStats?: (google.cloud.automl.v1beta1.IStringStats|null); + + /** DataStats timestampStats. */ + public timestampStats?: (google.cloud.automl.v1beta1.ITimestampStats|null); + + /** DataStats arrayStats. */ + public arrayStats?: (google.cloud.automl.v1beta1.IArrayStats|null); + + /** DataStats structStats. */ + public structStats?: (google.cloud.automl.v1beta1.IStructStats|null); + + /** DataStats categoryStats. */ + public categoryStats?: (google.cloud.automl.v1beta1.ICategoryStats|null); + + /** DataStats distinctValueCount. */ + public distinctValueCount: (number|Long|string); + + /** DataStats nullValueCount. */ + public nullValueCount: (number|Long|string); + + /** DataStats validValueCount. */ + public validValueCount: (number|Long|string); + + /** DataStats stats. */ + public stats?: ("float64Stats"|"stringStats"|"timestampStats"|"arrayStats"|"structStats"|"categoryStats"); + + /** + * Creates a new DataStats instance using the specified properties. + * @param [properties] Properties to set + * @returns DataStats instance + */ + public static create(properties?: google.cloud.automl.v1beta1.IDataStats): google.cloud.automl.v1beta1.DataStats; + + /** + * Encodes the specified DataStats message. Does not implicitly {@link google.cloud.automl.v1beta1.DataStats.verify|verify} messages. + * @param message DataStats message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.automl.v1beta1.IDataStats, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DataStats message, length delimited. Does not implicitly {@link google.cloud.automl.v1beta1.DataStats.verify|verify} messages. + * @param message DataStats message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.automl.v1beta1.IDataStats, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DataStats message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DataStats + * @throws {Error} If the payload is not 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.automl.v1beta1.DataStats; + + /** + * Decodes a DataStats message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DataStats + * @throws {Error} If the payload 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.automl.v1beta1.DataStats; + + /** + * Verifies a DataStats message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DataStats message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DataStats + */ + public static fromObject(object: { [k: string]: any }): google.cloud.automl.v1beta1.DataStats; + + /** + * Creates a plain object from a DataStats message. Also converts values to other types if specified. + * @param message DataStats + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.automl.v1beta1.DataStats, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DataStats to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DataStats + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Float64Stats. */ + interface IFloat64Stats { + + /** Float64Stats mean */ + mean?: (number|null); + + /** Float64Stats standardDeviation */ + standardDeviation?: (number|null); + + /** Float64Stats quantiles */ + quantiles?: (number[]|null); + + /** Float64Stats histogramBuckets */ + histogramBuckets?: (google.cloud.automl.v1beta1.Float64Stats.IHistogramBucket[]|null); + } + + /** Represents a Float64Stats. */ + class Float64Stats implements IFloat64Stats { + + /** + * Constructs a new Float64Stats. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.automl.v1beta1.IFloat64Stats); + + /** Float64Stats mean. */ + public mean: number; + + /** Float64Stats standardDeviation. */ + public standardDeviation: number; + + /** Float64Stats quantiles. */ + public quantiles: number[]; + + /** Float64Stats histogramBuckets. */ + public histogramBuckets: google.cloud.automl.v1beta1.Float64Stats.IHistogramBucket[]; + + /** + * Creates a new Float64Stats instance using the specified properties. + * @param [properties] Properties to set + * @returns Float64Stats instance + */ + public static create(properties?: google.cloud.automl.v1beta1.IFloat64Stats): google.cloud.automl.v1beta1.Float64Stats; + + /** + * Encodes the specified Float64Stats message. Does not implicitly {@link google.cloud.automl.v1beta1.Float64Stats.verify|verify} messages. + * @param message Float64Stats message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.automl.v1beta1.IFloat64Stats, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Float64Stats message, length delimited. Does not implicitly {@link google.cloud.automl.v1beta1.Float64Stats.verify|verify} messages. + * @param message Float64Stats message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.automl.v1beta1.IFloat64Stats, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Float64Stats message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Float64Stats + * @throws {Error} If the payload is not 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.automl.v1beta1.Float64Stats; + + /** + * Decodes a Float64Stats message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Float64Stats + * @throws {Error} If the payload 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.automl.v1beta1.Float64Stats; + + /** + * Verifies a Float64Stats message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Float64Stats message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Float64Stats + */ + public static fromObject(object: { [k: string]: any }): google.cloud.automl.v1beta1.Float64Stats; + + /** + * Creates a plain object from a Float64Stats message. Also converts values to other types if specified. + * @param message Float64Stats + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.automl.v1beta1.Float64Stats, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Float64Stats to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Float64Stats + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace Float64Stats { + + /** Properties of a HistogramBucket. */ + interface IHistogramBucket { + + /** HistogramBucket min */ + min?: (number|null); + + /** HistogramBucket max */ + max?: (number|null); + + /** HistogramBucket count */ + count?: (number|Long|string|null); + } + + /** Represents a HistogramBucket. */ + class HistogramBucket implements IHistogramBucket { + + /** + * Constructs a new HistogramBucket. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.automl.v1beta1.Float64Stats.IHistogramBucket); + + /** HistogramBucket min. */ + public min: number; + + /** HistogramBucket max. */ + public max: number; + + /** HistogramBucket count. */ + public count: (number|Long|string); + + /** + * Creates a new HistogramBucket instance using the specified properties. + * @param [properties] Properties to set + * @returns HistogramBucket instance + */ + public static create(properties?: google.cloud.automl.v1beta1.Float64Stats.IHistogramBucket): google.cloud.automl.v1beta1.Float64Stats.HistogramBucket; + + /** + * Encodes the specified HistogramBucket message. Does not implicitly {@link google.cloud.automl.v1beta1.Float64Stats.HistogramBucket.verify|verify} messages. + * @param message HistogramBucket message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.automl.v1beta1.Float64Stats.IHistogramBucket, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified HistogramBucket message, length delimited. Does not implicitly {@link google.cloud.automl.v1beta1.Float64Stats.HistogramBucket.verify|verify} messages. + * @param message HistogramBucket message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.automl.v1beta1.Float64Stats.IHistogramBucket, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a HistogramBucket message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns HistogramBucket + * @throws {Error} If the payload is not 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.automl.v1beta1.Float64Stats.HistogramBucket; + + /** + * Decodes a HistogramBucket message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns HistogramBucket + * @throws {Error} If the payload 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.automl.v1beta1.Float64Stats.HistogramBucket; + + /** + * Verifies a HistogramBucket message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a HistogramBucket message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns HistogramBucket + */ + public static fromObject(object: { [k: string]: any }): google.cloud.automl.v1beta1.Float64Stats.HistogramBucket; + + /** + * Creates a plain object from a HistogramBucket message. Also converts values to other types if specified. + * @param message HistogramBucket + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.automl.v1beta1.Float64Stats.HistogramBucket, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this HistogramBucket to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for HistogramBucket + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Properties of a StringStats. */ + interface IStringStats { + + /** StringStats topUnigramStats */ + topUnigramStats?: (google.cloud.automl.v1beta1.StringStats.IUnigramStats[]|null); + } + + /** Represents a StringStats. */ + class StringStats implements IStringStats { + + /** + * Constructs a new StringStats. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.automl.v1beta1.IStringStats); + + /** StringStats topUnigramStats. */ + public topUnigramStats: google.cloud.automl.v1beta1.StringStats.IUnigramStats[]; + + /** + * Creates a new StringStats instance using the specified properties. + * @param [properties] Properties to set + * @returns StringStats instance + */ + public static create(properties?: google.cloud.automl.v1beta1.IStringStats): google.cloud.automl.v1beta1.StringStats; + + /** + * Encodes the specified StringStats message. Does not implicitly {@link google.cloud.automl.v1beta1.StringStats.verify|verify} messages. + * @param message StringStats message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.automl.v1beta1.IStringStats, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified StringStats message, length delimited. Does not implicitly {@link google.cloud.automl.v1beta1.StringStats.verify|verify} messages. + * @param message StringStats message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.automl.v1beta1.IStringStats, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a StringStats message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns StringStats + * @throws {Error} If the payload is not 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.automl.v1beta1.StringStats; + + /** + * Decodes a StringStats message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns StringStats + * @throws {Error} If the payload 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.automl.v1beta1.StringStats; + + /** + * Verifies a StringStats message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a StringStats message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns StringStats + */ + public static fromObject(object: { [k: string]: any }): google.cloud.automl.v1beta1.StringStats; + + /** + * Creates a plain object from a StringStats message. Also converts values to other types if specified. + * @param message StringStats + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.automl.v1beta1.StringStats, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this StringStats to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for StringStats + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace StringStats { + + /** Properties of an UnigramStats. */ + interface IUnigramStats { + + /** UnigramStats value */ + value?: (string|null); + + /** UnigramStats count */ + count?: (number|Long|string|null); + } + + /** Represents an UnigramStats. */ + class UnigramStats implements IUnigramStats { + + /** + * Constructs a new UnigramStats. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.automl.v1beta1.StringStats.IUnigramStats); + + /** UnigramStats value. */ + public value: string; + + /** UnigramStats count. */ + public count: (number|Long|string); + + /** + * Creates a new UnigramStats instance using the specified properties. + * @param [properties] Properties to set + * @returns UnigramStats instance + */ + public static create(properties?: google.cloud.automl.v1beta1.StringStats.IUnigramStats): google.cloud.automl.v1beta1.StringStats.UnigramStats; + + /** + * Encodes the specified UnigramStats message. Does not implicitly {@link google.cloud.automl.v1beta1.StringStats.UnigramStats.verify|verify} messages. + * @param message UnigramStats message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.automl.v1beta1.StringStats.IUnigramStats, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified UnigramStats message, length delimited. Does not implicitly {@link google.cloud.automl.v1beta1.StringStats.UnigramStats.verify|verify} messages. + * @param message UnigramStats message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.automl.v1beta1.StringStats.IUnigramStats, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an UnigramStats message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns UnigramStats + * @throws {Error} If the payload is not 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.automl.v1beta1.StringStats.UnigramStats; + + /** + * Decodes an UnigramStats message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns UnigramStats + * @throws {Error} If the payload 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.automl.v1beta1.StringStats.UnigramStats; + + /** + * Verifies an UnigramStats message. + * @param message Plain 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 UnigramStats message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns UnigramStats + */ + public static fromObject(object: { [k: string]: any }): google.cloud.automl.v1beta1.StringStats.UnigramStats; + + /** + * Creates a plain object from an UnigramStats message. Also converts values to other types if specified. + * @param message UnigramStats + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.automl.v1beta1.StringStats.UnigramStats, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this UnigramStats to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for UnigramStats + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Properties of a TimestampStats. */ + interface ITimestampStats { + + /** TimestampStats granularStats */ + granularStats?: ({ [k: string]: google.cloud.automl.v1beta1.TimestampStats.IGranularStats }|null); + } + + /** Represents a TimestampStats. */ + class TimestampStats implements ITimestampStats { + + /** + * Constructs a new TimestampStats. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.automl.v1beta1.ITimestampStats); + + /** TimestampStats granularStats. */ + public granularStats: { [k: string]: google.cloud.automl.v1beta1.TimestampStats.IGranularStats }; + + /** + * Creates a new TimestampStats instance using the specified properties. + * @param [properties] Properties to set + * @returns TimestampStats instance + */ + public static create(properties?: google.cloud.automl.v1beta1.ITimestampStats): google.cloud.automl.v1beta1.TimestampStats; + + /** + * Encodes the specified TimestampStats message. Does not implicitly {@link google.cloud.automl.v1beta1.TimestampStats.verify|verify} messages. + * @param message TimestampStats message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.automl.v1beta1.ITimestampStats, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified TimestampStats message, length delimited. Does not implicitly {@link google.cloud.automl.v1beta1.TimestampStats.verify|verify} messages. + * @param message TimestampStats message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.automl.v1beta1.ITimestampStats, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TimestampStats message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns TimestampStats + * @throws {Error} If the payload is not 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.automl.v1beta1.TimestampStats; + + /** + * Decodes a TimestampStats message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns TimestampStats + * @throws {Error} If the payload 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.automl.v1beta1.TimestampStats; + + /** + * Verifies a TimestampStats message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a TimestampStats message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns TimestampStats + */ + public static fromObject(object: { [k: string]: any }): google.cloud.automl.v1beta1.TimestampStats; + + /** + * Creates a plain object from a TimestampStats message. Also converts values to other types if specified. + * @param message TimestampStats + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.automl.v1beta1.TimestampStats, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this TimestampStats to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for TimestampStats + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace TimestampStats { + + /** Properties of a GranularStats. */ + interface IGranularStats { + + /** GranularStats buckets */ + buckets?: ({ [k: string]: (number|Long|string) }|null); + } + + /** Represents a GranularStats. */ + class GranularStats implements IGranularStats { + + /** + * Constructs a new GranularStats. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.automl.v1beta1.TimestampStats.IGranularStats); + + /** GranularStats buckets. */ + public buckets: { [k: string]: (number|Long|string) }; + + /** + * Creates a new GranularStats instance using the specified properties. + * @param [properties] Properties to set + * @returns GranularStats instance + */ + public static create(properties?: google.cloud.automl.v1beta1.TimestampStats.IGranularStats): google.cloud.automl.v1beta1.TimestampStats.GranularStats; + + /** + * Encodes the specified GranularStats message. Does not implicitly {@link google.cloud.automl.v1beta1.TimestampStats.GranularStats.verify|verify} messages. + * @param message GranularStats message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.automl.v1beta1.TimestampStats.IGranularStats, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GranularStats message, length delimited. Does not implicitly {@link google.cloud.automl.v1beta1.TimestampStats.GranularStats.verify|verify} messages. + * @param message GranularStats message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.automl.v1beta1.TimestampStats.IGranularStats, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GranularStats message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GranularStats + * @throws {Error} If the payload is not 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.automl.v1beta1.TimestampStats.GranularStats; + + /** + * Decodes a GranularStats message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GranularStats + * @throws {Error} If the payload 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.automl.v1beta1.TimestampStats.GranularStats; + + /** + * Verifies a GranularStats message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GranularStats message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GranularStats + */ + public static fromObject(object: { [k: string]: any }): google.cloud.automl.v1beta1.TimestampStats.GranularStats; + + /** + * Creates a plain object from a GranularStats message. Also converts values to other types if specified. + * @param message GranularStats + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.automl.v1beta1.TimestampStats.GranularStats, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GranularStats to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GranularStats + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Properties of an ArrayStats. */ + interface IArrayStats { + + /** ArrayStats memberStats */ + memberStats?: (google.cloud.automl.v1beta1.IDataStats|null); + } + + /** Represents an ArrayStats. */ + class ArrayStats implements IArrayStats { + + /** + * Constructs a new ArrayStats. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.automl.v1beta1.IArrayStats); + + /** ArrayStats memberStats. */ + public memberStats?: (google.cloud.automl.v1beta1.IDataStats|null); + + /** + * Creates a new ArrayStats instance using the specified properties. + * @param [properties] Properties to set + * @returns ArrayStats instance + */ + public static create(properties?: google.cloud.automl.v1beta1.IArrayStats): google.cloud.automl.v1beta1.ArrayStats; + + /** + * Encodes the specified ArrayStats message. Does not implicitly {@link google.cloud.automl.v1beta1.ArrayStats.verify|verify} messages. + * @param message ArrayStats message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.automl.v1beta1.IArrayStats, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ArrayStats message, length delimited. Does not implicitly {@link google.cloud.automl.v1beta1.ArrayStats.verify|verify} messages. + * @param message ArrayStats message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.automl.v1beta1.IArrayStats, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an ArrayStats message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ArrayStats + * @throws {Error} If the payload is not 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.automl.v1beta1.ArrayStats; + + /** + * Decodes an ArrayStats message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ArrayStats + * @throws {Error} If the payload 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.automl.v1beta1.ArrayStats; + + /** + * Verifies an ArrayStats message. + * @param message Plain 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 ArrayStats message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ArrayStats + */ + public static fromObject(object: { [k: string]: any }): google.cloud.automl.v1beta1.ArrayStats; + + /** + * Creates a plain object from an ArrayStats message. Also converts values to other types if specified. + * @param message ArrayStats + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.automl.v1beta1.ArrayStats, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ArrayStats to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ArrayStats + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a StructStats. */ + interface IStructStats { + + /** StructStats fieldStats */ + fieldStats?: ({ [k: string]: google.cloud.automl.v1beta1.IDataStats }|null); + } + + /** Represents a StructStats. */ + class StructStats implements IStructStats { + + /** + * Constructs a new StructStats. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.automl.v1beta1.IStructStats); + + /** StructStats fieldStats. */ + public fieldStats: { [k: string]: google.cloud.automl.v1beta1.IDataStats }; + + /** + * Creates a new StructStats instance using the specified properties. + * @param [properties] Properties to set + * @returns StructStats instance + */ + public static create(properties?: google.cloud.automl.v1beta1.IStructStats): google.cloud.automl.v1beta1.StructStats; + + /** + * Encodes the specified StructStats message. Does not implicitly {@link google.cloud.automl.v1beta1.StructStats.verify|verify} messages. + * @param message StructStats message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.automl.v1beta1.IStructStats, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified StructStats message, length delimited. Does not implicitly {@link google.cloud.automl.v1beta1.StructStats.verify|verify} messages. + * @param message StructStats message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.automl.v1beta1.IStructStats, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a StructStats message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns StructStats + * @throws {Error} If the payload is not 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.automl.v1beta1.StructStats; + + /** + * Decodes a StructStats message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns StructStats + * @throws {Error} If the payload 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.automl.v1beta1.StructStats; + + /** + * Verifies a StructStats message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a StructStats message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns StructStats + */ + public static fromObject(object: { [k: string]: any }): google.cloud.automl.v1beta1.StructStats; + + /** + * Creates a plain object from a StructStats message. Also converts values to other types if specified. + * @param message StructStats + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.automl.v1beta1.StructStats, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this StructStats to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for StructStats + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a CategoryStats. */ + interface ICategoryStats { + + /** CategoryStats topCategoryStats */ + topCategoryStats?: (google.cloud.automl.v1beta1.CategoryStats.ISingleCategoryStats[]|null); + } + + /** Represents a CategoryStats. */ + class CategoryStats implements ICategoryStats { + + /** + * Constructs a new CategoryStats. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.automl.v1beta1.ICategoryStats); + + /** CategoryStats topCategoryStats. */ + public topCategoryStats: google.cloud.automl.v1beta1.CategoryStats.ISingleCategoryStats[]; + + /** + * Creates a new CategoryStats instance using the specified properties. + * @param [properties] Properties to set + * @returns CategoryStats instance + */ + public static create(properties?: google.cloud.automl.v1beta1.ICategoryStats): google.cloud.automl.v1beta1.CategoryStats; + + /** + * Encodes the specified CategoryStats message. Does not implicitly {@link google.cloud.automl.v1beta1.CategoryStats.verify|verify} messages. + * @param message CategoryStats message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.automl.v1beta1.ICategoryStats, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CategoryStats message, length delimited. Does not implicitly {@link google.cloud.automl.v1beta1.CategoryStats.verify|verify} messages. + * @param message CategoryStats message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.automl.v1beta1.ICategoryStats, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CategoryStats message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CategoryStats + * @throws {Error} If the payload is not 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.automl.v1beta1.CategoryStats; + + /** + * Decodes a CategoryStats message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CategoryStats + * @throws {Error} If the payload 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.automl.v1beta1.CategoryStats; + + /** + * Verifies a CategoryStats message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CategoryStats message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CategoryStats + */ + public static fromObject(object: { [k: string]: any }): google.cloud.automl.v1beta1.CategoryStats; + + /** + * Creates a plain object from a CategoryStats message. Also converts values to other types if specified. + * @param message CategoryStats + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.automl.v1beta1.CategoryStats, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CategoryStats to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CategoryStats + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace CategoryStats { + + /** Properties of a SingleCategoryStats. */ + interface ISingleCategoryStats { + + /** SingleCategoryStats value */ + value?: (string|null); + + /** SingleCategoryStats count */ + count?: (number|Long|string|null); + } + + /** Represents a SingleCategoryStats. */ + class SingleCategoryStats implements ISingleCategoryStats { + + /** + * Constructs a new SingleCategoryStats. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.automl.v1beta1.CategoryStats.ISingleCategoryStats); + + /** SingleCategoryStats value. */ + public value: string; + + /** SingleCategoryStats count. */ + public count: (number|Long|string); + + /** + * Creates a new SingleCategoryStats instance using the specified properties. + * @param [properties] Properties to set + * @returns SingleCategoryStats instance + */ + public static create(properties?: google.cloud.automl.v1beta1.CategoryStats.ISingleCategoryStats): google.cloud.automl.v1beta1.CategoryStats.SingleCategoryStats; + + /** + * Encodes the specified SingleCategoryStats message. Does not implicitly {@link google.cloud.automl.v1beta1.CategoryStats.SingleCategoryStats.verify|verify} messages. + * @param message SingleCategoryStats message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.automl.v1beta1.CategoryStats.ISingleCategoryStats, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified SingleCategoryStats message, length delimited. Does not implicitly {@link google.cloud.automl.v1beta1.CategoryStats.SingleCategoryStats.verify|verify} messages. + * @param message SingleCategoryStats message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.automl.v1beta1.CategoryStats.ISingleCategoryStats, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SingleCategoryStats message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns SingleCategoryStats + * @throws {Error} If the payload is not 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.automl.v1beta1.CategoryStats.SingleCategoryStats; + + /** + * Decodes a SingleCategoryStats message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns SingleCategoryStats + * @throws {Error} If the payload 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.automl.v1beta1.CategoryStats.SingleCategoryStats; + + /** + * Verifies a SingleCategoryStats message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a SingleCategoryStats message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns SingleCategoryStats + */ + public static fromObject(object: { [k: string]: any }): google.cloud.automl.v1beta1.CategoryStats.SingleCategoryStats; + + /** + * Creates a plain object from a SingleCategoryStats message. Also converts values to other types if specified. + * @param message SingleCategoryStats + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.automl.v1beta1.CategoryStats.SingleCategoryStats, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this SingleCategoryStats to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for SingleCategoryStats + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Properties of a CorrelationStats. */ + interface ICorrelationStats { + + /** CorrelationStats cramersV */ + cramersV?: (number|null); + } + + /** Represents a CorrelationStats. */ + class CorrelationStats implements ICorrelationStats { + + /** + * Constructs a new CorrelationStats. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.automl.v1beta1.ICorrelationStats); + + /** CorrelationStats cramersV. */ + public cramersV: number; + + /** + * Creates a new CorrelationStats instance using the specified properties. + * @param [properties] Properties to set + * @returns CorrelationStats instance + */ + public static create(properties?: google.cloud.automl.v1beta1.ICorrelationStats): google.cloud.automl.v1beta1.CorrelationStats; + + /** + * Encodes the specified CorrelationStats message. Does not implicitly {@link google.cloud.automl.v1beta1.CorrelationStats.verify|verify} messages. + * @param message CorrelationStats message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.automl.v1beta1.ICorrelationStats, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CorrelationStats message, length delimited. Does not implicitly {@link google.cloud.automl.v1beta1.CorrelationStats.verify|verify} messages. + * @param message CorrelationStats message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.automl.v1beta1.ICorrelationStats, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CorrelationStats message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CorrelationStats + * @throws {Error} If the payload is not 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.automl.v1beta1.CorrelationStats; + + /** + * Decodes a CorrelationStats message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CorrelationStats + * @throws {Error} If the payload 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.automl.v1beta1.CorrelationStats; + + /** + * Verifies a CorrelationStats message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CorrelationStats message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CorrelationStats + */ + public static fromObject(object: { [k: string]: any }): google.cloud.automl.v1beta1.CorrelationStats; + + /** + * Creates a plain object from a CorrelationStats message. Also converts values to other types if specified. + * @param message CorrelationStats + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.automl.v1beta1.CorrelationStats, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CorrelationStats to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CorrelationStats + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** TypeCode enum. */ + enum TypeCode { + TYPE_CODE_UNSPECIFIED = 0, + FLOAT64 = 3, + TIMESTAMP = 4, + STRING = 6, + ARRAY = 8, + STRUCT = 9, + CATEGORY = 10 + } + + /** Properties of a DataType. */ + interface IDataType { + + /** DataType listElementType */ + listElementType?: (google.cloud.automl.v1beta1.IDataType|null); + + /** DataType structType */ + structType?: (google.cloud.automl.v1beta1.IStructType|null); + + /** DataType timeFormat */ + timeFormat?: (string|null); + + /** DataType typeCode */ + typeCode?: (google.cloud.automl.v1beta1.TypeCode|keyof typeof google.cloud.automl.v1beta1.TypeCode|null); + + /** DataType nullable */ + nullable?: (boolean|null); + } + + /** Represents a DataType. */ + class DataType implements IDataType { + + /** + * Constructs a new DataType. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.automl.v1beta1.IDataType); + + /** DataType listElementType. */ + public listElementType?: (google.cloud.automl.v1beta1.IDataType|null); + + /** DataType structType. */ + public structType?: (google.cloud.automl.v1beta1.IStructType|null); + + /** DataType timeFormat. */ + public timeFormat?: (string|null); + + /** DataType typeCode. */ + public typeCode: (google.cloud.automl.v1beta1.TypeCode|keyof typeof google.cloud.automl.v1beta1.TypeCode); + + /** DataType nullable. */ + public nullable: boolean; + + /** DataType details. */ + public details?: ("listElementType"|"structType"|"timeFormat"); + + /** + * Creates a new DataType instance using the specified properties. + * @param [properties] Properties to set + * @returns DataType instance + */ + public static create(properties?: google.cloud.automl.v1beta1.IDataType): google.cloud.automl.v1beta1.DataType; + + /** + * Encodes the specified DataType message. Does not implicitly {@link google.cloud.automl.v1beta1.DataType.verify|verify} messages. + * @param message DataType message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.automl.v1beta1.IDataType, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DataType message, length delimited. Does not implicitly {@link google.cloud.automl.v1beta1.DataType.verify|verify} messages. + * @param message DataType message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.automl.v1beta1.IDataType, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DataType message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DataType + * @throws {Error} If the payload is not 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.automl.v1beta1.DataType; + + /** + * Decodes a DataType message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DataType + * @throws {Error} If the payload 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.automl.v1beta1.DataType; + + /** + * Verifies a DataType message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DataType message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DataType + */ + public static fromObject(object: { [k: string]: any }): google.cloud.automl.v1beta1.DataType; + + /** + * Creates a plain object from a DataType message. Also converts values to other types if specified. + * @param message DataType + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.automl.v1beta1.DataType, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DataType to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DataType + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a StructType. */ + interface IStructType { + + /** StructType fields */ + fields?: ({ [k: string]: google.cloud.automl.v1beta1.IDataType }|null); + } + + /** Represents a StructType. */ + class StructType implements IStructType { + + /** + * Constructs a new StructType. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.automl.v1beta1.IStructType); + + /** StructType fields. */ + public fields: { [k: string]: google.cloud.automl.v1beta1.IDataType }; + + /** + * Creates a new StructType instance using the specified properties. + * @param [properties] Properties to set + * @returns StructType instance + */ + public static create(properties?: google.cloud.automl.v1beta1.IStructType): google.cloud.automl.v1beta1.StructType; + + /** + * Encodes the specified StructType message. Does not implicitly {@link google.cloud.automl.v1beta1.StructType.verify|verify} messages. + * @param message StructType message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.automl.v1beta1.IStructType, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified StructType message, length delimited. Does not implicitly {@link google.cloud.automl.v1beta1.StructType.verify|verify} messages. + * @param message StructType message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.automl.v1beta1.IStructType, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a StructType message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns StructType + * @throws {Error} If the payload is not 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.automl.v1beta1.StructType; + + /** + * Decodes a StructType message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns StructType + * @throws {Error} If the payload 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.automl.v1beta1.StructType; + + /** + * Verifies a StructType message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a StructType message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns StructType + */ + public static fromObject(object: { [k: string]: any }): google.cloud.automl.v1beta1.StructType; + + /** + * Creates a plain object from a StructType message. Also converts values to other types if specified. + * @param message StructType + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.automl.v1beta1.StructType, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this StructType to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for StructType + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an Image. */ + interface IImage { + + /** Image imageBytes */ + imageBytes?: (Uint8Array|string|null); + + /** Image inputConfig */ + inputConfig?: (google.cloud.automl.v1beta1.IInputConfig|null); + + /** Image thumbnailUri */ + thumbnailUri?: (string|null); + } + + /** Represents an Image. */ + class Image implements IImage { + + /** + * Constructs a new Image. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.automl.v1beta1.IImage); + + /** Image imageBytes. */ + public imageBytes?: (Uint8Array|string|null); + + /** Image inputConfig. */ + public inputConfig?: (google.cloud.automl.v1beta1.IInputConfig|null); + + /** Image thumbnailUri. */ + public thumbnailUri: string; + + /** Image data. */ + public data?: ("imageBytes"|"inputConfig"); + + /** + * Creates a new Image instance using the specified properties. + * @param [properties] Properties to set + * @returns Image instance + */ + public static create(properties?: google.cloud.automl.v1beta1.IImage): google.cloud.automl.v1beta1.Image; + + /** + * Encodes the specified Image message. Does not implicitly {@link google.cloud.automl.v1beta1.Image.verify|verify} messages. + * @param message Image message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.automl.v1beta1.IImage, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Image message, length delimited. Does not implicitly {@link google.cloud.automl.v1beta1.Image.verify|verify} messages. + * @param message Image message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.automl.v1beta1.IImage, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an Image message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Image + * @throws {Error} If the payload is not 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.automl.v1beta1.Image; + + /** + * Decodes an Image message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Image + * @throws {Error} If the payload 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.automl.v1beta1.Image; + + /** + * Verifies an Image message. + * @param message Plain 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 Image message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Image + */ + public static fromObject(object: { [k: string]: any }): google.cloud.automl.v1beta1.Image; + + /** + * Creates a plain object from an Image message. Also converts values to other types if specified. + * @param message Image + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.automl.v1beta1.Image, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Image to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Image + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TextSnippet. */ + interface ITextSnippet { + + /** TextSnippet content */ + content?: (string|null); + + /** TextSnippet mimeType */ + mimeType?: (string|null); + + /** TextSnippet contentUri */ + contentUri?: (string|null); + } + + /** Represents a TextSnippet. */ + class TextSnippet implements ITextSnippet { + + /** + * Constructs a new TextSnippet. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.automl.v1beta1.ITextSnippet); + + /** TextSnippet content. */ + public content: string; + + /** TextSnippet mimeType. */ + public mimeType: string; + + /** TextSnippet contentUri. */ + public contentUri: string; + + /** + * Creates a new TextSnippet instance using the specified properties. + * @param [properties] Properties to set + * @returns TextSnippet instance + */ + public static create(properties?: google.cloud.automl.v1beta1.ITextSnippet): google.cloud.automl.v1beta1.TextSnippet; + + /** + * Encodes the specified TextSnippet message. Does not implicitly {@link google.cloud.automl.v1beta1.TextSnippet.verify|verify} messages. + * @param message TextSnippet message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.automl.v1beta1.ITextSnippet, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified TextSnippet message, length delimited. Does not implicitly {@link google.cloud.automl.v1beta1.TextSnippet.verify|verify} messages. + * @param message TextSnippet message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.automl.v1beta1.ITextSnippet, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TextSnippet message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns TextSnippet + * @throws {Error} If the payload is not 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.automl.v1beta1.TextSnippet; + + /** + * Decodes a TextSnippet message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns TextSnippet + * @throws {Error} If the payload 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.automl.v1beta1.TextSnippet; + + /** + * Verifies a TextSnippet message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a TextSnippet message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns TextSnippet + */ + public static fromObject(object: { [k: string]: any }): google.cloud.automl.v1beta1.TextSnippet; + + /** + * Creates a plain object from a TextSnippet message. Also converts values to other types if specified. + * @param message TextSnippet + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.automl.v1beta1.TextSnippet, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this TextSnippet to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for TextSnippet + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a DocumentDimensions. */ + interface IDocumentDimensions { + + /** DocumentDimensions unit */ + unit?: (google.cloud.automl.v1beta1.DocumentDimensions.DocumentDimensionUnit|keyof typeof google.cloud.automl.v1beta1.DocumentDimensions.DocumentDimensionUnit|null); + + /** DocumentDimensions width */ + width?: (number|null); + + /** DocumentDimensions height */ + height?: (number|null); + } + + /** Represents a DocumentDimensions. */ + class DocumentDimensions implements IDocumentDimensions { + + /** + * Constructs a new DocumentDimensions. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.automl.v1beta1.IDocumentDimensions); + + /** DocumentDimensions unit. */ + public unit: (google.cloud.automl.v1beta1.DocumentDimensions.DocumentDimensionUnit|keyof typeof google.cloud.automl.v1beta1.DocumentDimensions.DocumentDimensionUnit); + + /** DocumentDimensions width. */ + public width: number; + + /** DocumentDimensions height. */ + public height: number; + + /** + * Creates a new DocumentDimensions instance using the specified properties. + * @param [properties] Properties to set + * @returns DocumentDimensions instance + */ + public static create(properties?: google.cloud.automl.v1beta1.IDocumentDimensions): google.cloud.automl.v1beta1.DocumentDimensions; + + /** + * Encodes the specified DocumentDimensions message. Does not implicitly {@link google.cloud.automl.v1beta1.DocumentDimensions.verify|verify} messages. + * @param message DocumentDimensions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.automl.v1beta1.IDocumentDimensions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DocumentDimensions message, length delimited. Does not implicitly {@link google.cloud.automl.v1beta1.DocumentDimensions.verify|verify} messages. + * @param message DocumentDimensions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.automl.v1beta1.IDocumentDimensions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DocumentDimensions message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DocumentDimensions + * @throws {Error} If the payload is not 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.automl.v1beta1.DocumentDimensions; + + /** + * Decodes a DocumentDimensions message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DocumentDimensions + * @throws {Error} If the payload 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.automl.v1beta1.DocumentDimensions; + + /** + * Verifies a DocumentDimensions message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DocumentDimensions message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DocumentDimensions + */ + public static fromObject(object: { [k: string]: any }): google.cloud.automl.v1beta1.DocumentDimensions; + + /** + * Creates a plain object from a DocumentDimensions message. Also converts values to other types if specified. + * @param message DocumentDimensions + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.automl.v1beta1.DocumentDimensions, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DocumentDimensions to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DocumentDimensions + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace DocumentDimensions { + + /** DocumentDimensionUnit enum. */ + enum DocumentDimensionUnit { + DOCUMENT_DIMENSION_UNIT_UNSPECIFIED = 0, + INCH = 1, + CENTIMETER = 2, + POINT = 3 + } + } + + /** Properties of a Document. */ + interface IDocument { + + /** Document inputConfig */ + inputConfig?: (google.cloud.automl.v1beta1.IDocumentInputConfig|null); + + /** Document documentText */ + documentText?: (google.cloud.automl.v1beta1.ITextSnippet|null); + + /** Document layout */ + layout?: (google.cloud.automl.v1beta1.Document.ILayout[]|null); + + /** Document documentDimensions */ + documentDimensions?: (google.cloud.automl.v1beta1.IDocumentDimensions|null); + + /** Document pageCount */ + pageCount?: (number|null); + } + + /** Represents a Document. */ + class Document implements IDocument { + + /** + * Constructs a new Document. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.automl.v1beta1.IDocument); + + /** Document inputConfig. */ + public inputConfig?: (google.cloud.automl.v1beta1.IDocumentInputConfig|null); + + /** Document documentText. */ + public documentText?: (google.cloud.automl.v1beta1.ITextSnippet|null); + + /** Document layout. */ + public layout: google.cloud.automl.v1beta1.Document.ILayout[]; + + /** Document documentDimensions. */ + public documentDimensions?: (google.cloud.automl.v1beta1.IDocumentDimensions|null); + + /** Document pageCount. */ + public pageCount: number; + + /** + * Creates a new Document instance using the specified properties. + * @param [properties] Properties to set + * @returns Document instance + */ + public static create(properties?: google.cloud.automl.v1beta1.IDocument): google.cloud.automl.v1beta1.Document; + + /** + * Encodes the specified Document message. Does not implicitly {@link google.cloud.automl.v1beta1.Document.verify|verify} messages. + * @param message Document message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.automl.v1beta1.IDocument, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Document message, length delimited. Does not implicitly {@link google.cloud.automl.v1beta1.Document.verify|verify} messages. + * @param message Document message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.automl.v1beta1.IDocument, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Document message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Document + * @throws {Error} If the payload is not 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.automl.v1beta1.Document; + + /** + * Decodes a Document message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Document + * @throws {Error} If the payload 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.automl.v1beta1.Document; + + /** + * Verifies a Document message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Document message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Document + */ + public static fromObject(object: { [k: string]: any }): google.cloud.automl.v1beta1.Document; + + /** + * Creates a plain object from a Document message. Also converts values to other types if specified. + * @param message Document + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.automl.v1beta1.Document, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Document to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Document + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace Document { + + /** Properties of a Layout. */ + interface ILayout { + + /** Layout textSegment */ + textSegment?: (google.cloud.automl.v1beta1.ITextSegment|null); + + /** Layout pageNumber */ + pageNumber?: (number|null); + + /** Layout boundingPoly */ + boundingPoly?: (google.cloud.automl.v1beta1.IBoundingPoly|null); + + /** Layout textSegmentType */ + textSegmentType?: (google.cloud.automl.v1beta1.Document.Layout.TextSegmentType|keyof typeof google.cloud.automl.v1beta1.Document.Layout.TextSegmentType|null); + } + + /** Represents a Layout. */ + class Layout implements ILayout { + + /** + * Constructs a new Layout. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.automl.v1beta1.Document.ILayout); + + /** Layout textSegment. */ + public textSegment?: (google.cloud.automl.v1beta1.ITextSegment|null); + + /** Layout pageNumber. */ + public pageNumber: number; + + /** Layout boundingPoly. */ + public boundingPoly?: (google.cloud.automl.v1beta1.IBoundingPoly|null); + + /** Layout textSegmentType. */ + public textSegmentType: (google.cloud.automl.v1beta1.Document.Layout.TextSegmentType|keyof typeof google.cloud.automl.v1beta1.Document.Layout.TextSegmentType); + + /** + * Creates a new Layout instance using the specified properties. + * @param [properties] Properties to set + * @returns Layout instance + */ + public static create(properties?: google.cloud.automl.v1beta1.Document.ILayout): google.cloud.automl.v1beta1.Document.Layout; + + /** + * Encodes the specified Layout message. Does not implicitly {@link google.cloud.automl.v1beta1.Document.Layout.verify|verify} messages. + * @param message Layout message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.automl.v1beta1.Document.ILayout, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Layout message, length delimited. Does not implicitly {@link google.cloud.automl.v1beta1.Document.Layout.verify|verify} messages. + * @param message Layout message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.automl.v1beta1.Document.ILayout, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Layout message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Layout + * @throws {Error} If the payload is not 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.automl.v1beta1.Document.Layout; + + /** + * Decodes a Layout message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Layout + * @throws {Error} If the payload 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.automl.v1beta1.Document.Layout; + + /** + * Verifies a Layout message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Layout message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Layout + */ + public static fromObject(object: { [k: string]: any }): google.cloud.automl.v1beta1.Document.Layout; + + /** + * Creates a plain object from a Layout message. Also converts values to other types if specified. + * @param message Layout + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.automl.v1beta1.Document.Layout, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Layout to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Layout + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace Layout { + + /** TextSegmentType enum. */ + enum TextSegmentType { + TEXT_SEGMENT_TYPE_UNSPECIFIED = 0, + TOKEN = 1, + PARAGRAPH = 2, + FORM_FIELD = 3, + FORM_FIELD_NAME = 4, + FORM_FIELD_CONTENTS = 5, + TABLE = 6, + TABLE_HEADER = 7, + TABLE_ROW = 8, + TABLE_CELL = 9 + } + } + } + + /** Properties of a Row. */ + interface IRow { + + /** Row columnSpecIds */ + columnSpecIds?: (string[]|null); + + /** Row values */ + values?: (google.protobuf.IValue[]|null); + } + + /** Represents a Row. */ + class Row implements IRow { + + /** + * Constructs a new Row. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.automl.v1beta1.IRow); + + /** Row columnSpecIds. */ + public columnSpecIds: string[]; + + /** Row values. */ + public values: google.protobuf.IValue[]; + + /** + * Creates a new Row instance using the specified properties. + * @param [properties] Properties to set + * @returns Row instance + */ + public static create(properties?: google.cloud.automl.v1beta1.IRow): google.cloud.automl.v1beta1.Row; + + /** + * Encodes the specified Row message. Does not implicitly {@link google.cloud.automl.v1beta1.Row.verify|verify} messages. + * @param message Row message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.automl.v1beta1.IRow, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Row message, length delimited. Does not implicitly {@link google.cloud.automl.v1beta1.Row.verify|verify} messages. + * @param message Row message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.automl.v1beta1.IRow, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Row message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Row + * @throws {Error} If the payload is not 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.automl.v1beta1.Row; + + /** + * Decodes a Row message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Row + * @throws {Error} If the payload 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.automl.v1beta1.Row; + + /** + * Verifies a Row message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Row message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Row + */ + public static fromObject(object: { [k: string]: any }): google.cloud.automl.v1beta1.Row; + + /** + * Creates a plain object from a Row message. Also converts values to other types if specified. + * @param message Row + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.automl.v1beta1.Row, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Row to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Row + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an ExamplePayload. */ + interface IExamplePayload { + + /** ExamplePayload image */ + image?: (google.cloud.automl.v1beta1.IImage|null); + + /** ExamplePayload textSnippet */ + textSnippet?: (google.cloud.automl.v1beta1.ITextSnippet|null); + + /** ExamplePayload document */ + document?: (google.cloud.automl.v1beta1.IDocument|null); + + /** ExamplePayload row */ + row?: (google.cloud.automl.v1beta1.IRow|null); + } + + /** Represents an ExamplePayload. */ + class ExamplePayload implements IExamplePayload { + + /** + * Constructs a new ExamplePayload. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.automl.v1beta1.IExamplePayload); + + /** ExamplePayload image. */ + public image?: (google.cloud.automl.v1beta1.IImage|null); + + /** ExamplePayload textSnippet. */ + public textSnippet?: (google.cloud.automl.v1beta1.ITextSnippet|null); + + /** ExamplePayload document. */ + public document?: (google.cloud.automl.v1beta1.IDocument|null); + + /** ExamplePayload row. */ + public row?: (google.cloud.automl.v1beta1.IRow|null); + + /** ExamplePayload payload. */ + public payload?: ("image"|"textSnippet"|"document"|"row"); + + /** + * Creates a new ExamplePayload instance using the specified properties. + * @param [properties] Properties to set + * @returns ExamplePayload instance + */ + public static create(properties?: google.cloud.automl.v1beta1.IExamplePayload): google.cloud.automl.v1beta1.ExamplePayload; + + /** + * Encodes the specified ExamplePayload message. Does not implicitly {@link google.cloud.automl.v1beta1.ExamplePayload.verify|verify} messages. + * @param message ExamplePayload message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.automl.v1beta1.IExamplePayload, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ExamplePayload message, length delimited. Does not implicitly {@link google.cloud.automl.v1beta1.ExamplePayload.verify|verify} messages. + * @param message ExamplePayload message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.automl.v1beta1.IExamplePayload, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an ExamplePayload message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ExamplePayload + * @throws {Error} If the payload is not 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.automl.v1beta1.ExamplePayload; + + /** + * Decodes an ExamplePayload message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ExamplePayload + * @throws {Error} If the payload 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.automl.v1beta1.ExamplePayload; + + /** + * Verifies an ExamplePayload message. + * @param message Plain 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 ExamplePayload message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ExamplePayload + */ + public static fromObject(object: { [k: string]: any }): google.cloud.automl.v1beta1.ExamplePayload; + + /** + * Creates a plain object from an ExamplePayload message. Also converts values to other types if specified. + * @param message ExamplePayload + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.automl.v1beta1.ExamplePayload, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ExamplePayload to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ExamplePayload + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an InputConfig. */ + interface IInputConfig { + + /** InputConfig gcsSource */ + gcsSource?: (google.cloud.automl.v1beta1.IGcsSource|null); + + /** InputConfig bigquerySource */ + bigquerySource?: (google.cloud.automl.v1beta1.IBigQuerySource|null); + + /** InputConfig params */ + params?: ({ [k: string]: string }|null); + } + + /** Represents an InputConfig. */ + class InputConfig implements IInputConfig { + + /** + * Constructs a new InputConfig. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.automl.v1beta1.IInputConfig); + + /** InputConfig gcsSource. */ + public gcsSource?: (google.cloud.automl.v1beta1.IGcsSource|null); + + /** InputConfig bigquerySource. */ + public bigquerySource?: (google.cloud.automl.v1beta1.IBigQuerySource|null); + + /** InputConfig params. */ + public params: { [k: string]: string }; + + /** InputConfig source. */ + public source?: ("gcsSource"|"bigquerySource"); + + /** + * Creates a new InputConfig instance using the specified properties. + * @param [properties] Properties to set + * @returns InputConfig instance + */ + public static create(properties?: google.cloud.automl.v1beta1.IInputConfig): google.cloud.automl.v1beta1.InputConfig; + + /** + * Encodes the specified InputConfig message. Does not implicitly {@link google.cloud.automl.v1beta1.InputConfig.verify|verify} messages. + * @param message InputConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.automl.v1beta1.IInputConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified InputConfig message, length delimited. Does not implicitly {@link google.cloud.automl.v1beta1.InputConfig.verify|verify} messages. + * @param message InputConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.automl.v1beta1.IInputConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an InputConfig message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns InputConfig + * @throws {Error} If the payload is not 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.automl.v1beta1.InputConfig; + + /** + * Decodes an InputConfig message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns InputConfig + * @throws {Error} If the payload 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.automl.v1beta1.InputConfig; + + /** + * Verifies an InputConfig message. + * @param message Plain 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 InputConfig message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns InputConfig + */ + public static fromObject(object: { [k: string]: any }): google.cloud.automl.v1beta1.InputConfig; + + /** + * Creates a plain object from an InputConfig message. Also converts values to other types if specified. + * @param message InputConfig + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.automl.v1beta1.InputConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this InputConfig to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for InputConfig + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a BatchPredictInputConfig. */ + interface IBatchPredictInputConfig { + + /** BatchPredictInputConfig gcsSource */ + gcsSource?: (google.cloud.automl.v1beta1.IGcsSource|null); + + /** BatchPredictInputConfig bigquerySource */ + bigquerySource?: (google.cloud.automl.v1beta1.IBigQuerySource|null); + } + + /** Represents a BatchPredictInputConfig. */ + class BatchPredictInputConfig implements IBatchPredictInputConfig { + + /** + * Constructs a new BatchPredictInputConfig. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.automl.v1beta1.IBatchPredictInputConfig); + + /** BatchPredictInputConfig gcsSource. */ + public gcsSource?: (google.cloud.automl.v1beta1.IGcsSource|null); + + /** BatchPredictInputConfig bigquerySource. */ + public bigquerySource?: (google.cloud.automl.v1beta1.IBigQuerySource|null); + + /** BatchPredictInputConfig source. */ + public source?: ("gcsSource"|"bigquerySource"); + + /** + * Creates a new BatchPredictInputConfig instance using the specified properties. + * @param [properties] Properties to set + * @returns BatchPredictInputConfig instance + */ + public static create(properties?: google.cloud.automl.v1beta1.IBatchPredictInputConfig): google.cloud.automl.v1beta1.BatchPredictInputConfig; + + /** + * Encodes the specified BatchPredictInputConfig message. Does not implicitly {@link google.cloud.automl.v1beta1.BatchPredictInputConfig.verify|verify} messages. + * @param message BatchPredictInputConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.automl.v1beta1.IBatchPredictInputConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified BatchPredictInputConfig message, length delimited. Does not implicitly {@link google.cloud.automl.v1beta1.BatchPredictInputConfig.verify|verify} messages. + * @param message BatchPredictInputConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.automl.v1beta1.IBatchPredictInputConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a BatchPredictInputConfig message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns BatchPredictInputConfig + * @throws {Error} If the payload is not 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.automl.v1beta1.BatchPredictInputConfig; + + /** + * Decodes a BatchPredictInputConfig message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns BatchPredictInputConfig + * @throws {Error} If the payload 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.automl.v1beta1.BatchPredictInputConfig; + + /** + * Verifies a BatchPredictInputConfig message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a BatchPredictInputConfig message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns BatchPredictInputConfig + */ + public static fromObject(object: { [k: string]: any }): google.cloud.automl.v1beta1.BatchPredictInputConfig; + + /** + * Creates a plain object from a BatchPredictInputConfig message. Also converts values to other types if specified. + * @param message BatchPredictInputConfig + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.automl.v1beta1.BatchPredictInputConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this BatchPredictInputConfig to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for BatchPredictInputConfig + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a DocumentInputConfig. */ + interface IDocumentInputConfig { + + /** DocumentInputConfig gcsSource */ + gcsSource?: (google.cloud.automl.v1beta1.IGcsSource|null); + } + + /** Represents a DocumentInputConfig. */ + class DocumentInputConfig implements IDocumentInputConfig { + + /** + * Constructs a new DocumentInputConfig. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.automl.v1beta1.IDocumentInputConfig); + + /** DocumentInputConfig gcsSource. */ + public gcsSource?: (google.cloud.automl.v1beta1.IGcsSource|null); + + /** + * Creates a new DocumentInputConfig instance using the specified properties. + * @param [properties] Properties to set + * @returns DocumentInputConfig instance + */ + public static create(properties?: google.cloud.automl.v1beta1.IDocumentInputConfig): google.cloud.automl.v1beta1.DocumentInputConfig; + + /** + * Encodes the specified DocumentInputConfig message. Does not implicitly {@link google.cloud.automl.v1beta1.DocumentInputConfig.verify|verify} messages. + * @param message DocumentInputConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.automl.v1beta1.IDocumentInputConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DocumentInputConfig message, length delimited. Does not implicitly {@link google.cloud.automl.v1beta1.DocumentInputConfig.verify|verify} messages. + * @param message DocumentInputConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.automl.v1beta1.IDocumentInputConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DocumentInputConfig message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DocumentInputConfig + * @throws {Error} If the payload is not 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.automl.v1beta1.DocumentInputConfig; + + /** + * Decodes a DocumentInputConfig message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DocumentInputConfig + * @throws {Error} If the payload 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.automl.v1beta1.DocumentInputConfig; + + /** + * Verifies a DocumentInputConfig message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DocumentInputConfig message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DocumentInputConfig + */ + public static fromObject(object: { [k: string]: any }): google.cloud.automl.v1beta1.DocumentInputConfig; + + /** + * Creates a plain object from a DocumentInputConfig message. Also converts values to other types if specified. + * @param message DocumentInputConfig + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.automl.v1beta1.DocumentInputConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DocumentInputConfig to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DocumentInputConfig + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an OutputConfig. */ + interface IOutputConfig { + + /** OutputConfig gcsDestination */ + gcsDestination?: (google.cloud.automl.v1beta1.IGcsDestination|null); + + /** OutputConfig bigqueryDestination */ + bigqueryDestination?: (google.cloud.automl.v1beta1.IBigQueryDestination|null); + } + + /** Represents an OutputConfig. */ + class OutputConfig implements IOutputConfig { + + /** + * Constructs a new OutputConfig. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.automl.v1beta1.IOutputConfig); + + /** OutputConfig gcsDestination. */ + public gcsDestination?: (google.cloud.automl.v1beta1.IGcsDestination|null); + + /** OutputConfig bigqueryDestination. */ + public bigqueryDestination?: (google.cloud.automl.v1beta1.IBigQueryDestination|null); + + /** OutputConfig destination. */ + public destination?: ("gcsDestination"|"bigqueryDestination"); + + /** + * Creates a new OutputConfig instance using the specified properties. + * @param [properties] Properties to set + * @returns OutputConfig instance + */ + public static create(properties?: google.cloud.automl.v1beta1.IOutputConfig): google.cloud.automl.v1beta1.OutputConfig; + + /** + * Encodes the specified OutputConfig message. Does not implicitly {@link google.cloud.automl.v1beta1.OutputConfig.verify|verify} messages. + * @param message OutputConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.automl.v1beta1.IOutputConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified OutputConfig message, length delimited. Does not implicitly {@link google.cloud.automl.v1beta1.OutputConfig.verify|verify} messages. + * @param message OutputConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.automl.v1beta1.IOutputConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an OutputConfig message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns OutputConfig + * @throws {Error} If the payload is not 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.automl.v1beta1.OutputConfig; + + /** + * Decodes an OutputConfig message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns OutputConfig + * @throws {Error} If the payload 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.automl.v1beta1.OutputConfig; + + /** + * Verifies an OutputConfig message. + * @param message Plain 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 OutputConfig message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns OutputConfig + */ + public static fromObject(object: { [k: string]: any }): google.cloud.automl.v1beta1.OutputConfig; + + /** + * Creates a plain object from an OutputConfig message. Also converts values to other types if specified. + * @param message OutputConfig + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.automl.v1beta1.OutputConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this OutputConfig to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for OutputConfig + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a BatchPredictOutputConfig. */ + interface IBatchPredictOutputConfig { + + /** BatchPredictOutputConfig gcsDestination */ + gcsDestination?: (google.cloud.automl.v1beta1.IGcsDestination|null); + + /** BatchPredictOutputConfig bigqueryDestination */ + bigqueryDestination?: (google.cloud.automl.v1beta1.IBigQueryDestination|null); + } + + /** Represents a BatchPredictOutputConfig. */ + class BatchPredictOutputConfig implements IBatchPredictOutputConfig { + + /** + * Constructs a new BatchPredictOutputConfig. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.automl.v1beta1.IBatchPredictOutputConfig); + + /** BatchPredictOutputConfig gcsDestination. */ + public gcsDestination?: (google.cloud.automl.v1beta1.IGcsDestination|null); + + /** BatchPredictOutputConfig bigqueryDestination. */ + public bigqueryDestination?: (google.cloud.automl.v1beta1.IBigQueryDestination|null); + + /** BatchPredictOutputConfig destination. */ + public destination?: ("gcsDestination"|"bigqueryDestination"); + + /** + * Creates a new BatchPredictOutputConfig instance using the specified properties. + * @param [properties] Properties to set + * @returns BatchPredictOutputConfig instance + */ + public static create(properties?: google.cloud.automl.v1beta1.IBatchPredictOutputConfig): google.cloud.automl.v1beta1.BatchPredictOutputConfig; + + /** + * Encodes the specified BatchPredictOutputConfig message. Does not implicitly {@link google.cloud.automl.v1beta1.BatchPredictOutputConfig.verify|verify} messages. + * @param message BatchPredictOutputConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.automl.v1beta1.IBatchPredictOutputConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified BatchPredictOutputConfig message, length delimited. Does not implicitly {@link google.cloud.automl.v1beta1.BatchPredictOutputConfig.verify|verify} messages. + * @param message BatchPredictOutputConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.automl.v1beta1.IBatchPredictOutputConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a BatchPredictOutputConfig message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns BatchPredictOutputConfig + * @throws {Error} If the payload is not 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.automl.v1beta1.BatchPredictOutputConfig; + + /** + * Decodes a BatchPredictOutputConfig message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns BatchPredictOutputConfig + * @throws {Error} If the payload 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.automl.v1beta1.BatchPredictOutputConfig; + + /** + * Verifies a BatchPredictOutputConfig message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a BatchPredictOutputConfig message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns BatchPredictOutputConfig + */ + public static fromObject(object: { [k: string]: any }): google.cloud.automl.v1beta1.BatchPredictOutputConfig; + + /** + * Creates a plain object from a BatchPredictOutputConfig message. Also converts values to other types if specified. + * @param message BatchPredictOutputConfig + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.automl.v1beta1.BatchPredictOutputConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this BatchPredictOutputConfig to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for BatchPredictOutputConfig + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ModelExportOutputConfig. */ + interface IModelExportOutputConfig { + + /** ModelExportOutputConfig gcsDestination */ + gcsDestination?: (google.cloud.automl.v1beta1.IGcsDestination|null); + + /** ModelExportOutputConfig gcrDestination */ + gcrDestination?: (google.cloud.automl.v1beta1.IGcrDestination|null); + + /** ModelExportOutputConfig modelFormat */ + modelFormat?: (string|null); + + /** ModelExportOutputConfig params */ + params?: ({ [k: string]: string }|null); + } + + /** Represents a ModelExportOutputConfig. */ + class ModelExportOutputConfig implements IModelExportOutputConfig { + + /** + * Constructs a new ModelExportOutputConfig. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.automl.v1beta1.IModelExportOutputConfig); + + /** ModelExportOutputConfig gcsDestination. */ + public gcsDestination?: (google.cloud.automl.v1beta1.IGcsDestination|null); + + /** ModelExportOutputConfig gcrDestination. */ + public gcrDestination?: (google.cloud.automl.v1beta1.IGcrDestination|null); + + /** ModelExportOutputConfig modelFormat. */ + public modelFormat: string; + + /** ModelExportOutputConfig params. */ + public params: { [k: string]: string }; + + /** ModelExportOutputConfig destination. */ + public destination?: ("gcsDestination"|"gcrDestination"); + + /** + * Creates a new ModelExportOutputConfig instance using the specified properties. + * @param [properties] Properties to set + * @returns ModelExportOutputConfig instance + */ + public static create(properties?: google.cloud.automl.v1beta1.IModelExportOutputConfig): google.cloud.automl.v1beta1.ModelExportOutputConfig; + + /** + * Encodes the specified ModelExportOutputConfig message. Does not implicitly {@link google.cloud.automl.v1beta1.ModelExportOutputConfig.verify|verify} messages. + * @param message ModelExportOutputConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.automl.v1beta1.IModelExportOutputConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ModelExportOutputConfig message, length delimited. Does not implicitly {@link google.cloud.automl.v1beta1.ModelExportOutputConfig.verify|verify} messages. + * @param message ModelExportOutputConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.automl.v1beta1.IModelExportOutputConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ModelExportOutputConfig message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ModelExportOutputConfig + * @throws {Error} If the payload is not 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.automl.v1beta1.ModelExportOutputConfig; + + /** + * Decodes a ModelExportOutputConfig message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ModelExportOutputConfig + * @throws {Error} If the payload 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.automl.v1beta1.ModelExportOutputConfig; + + /** + * Verifies a ModelExportOutputConfig message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ModelExportOutputConfig message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ModelExportOutputConfig + */ + public static fromObject(object: { [k: string]: any }): google.cloud.automl.v1beta1.ModelExportOutputConfig; + + /** + * Creates a plain object from a ModelExportOutputConfig message. Also converts values to other types if specified. + * @param message ModelExportOutputConfig + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.automl.v1beta1.ModelExportOutputConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ModelExportOutputConfig to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ModelExportOutputConfig + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an ExportEvaluatedExamplesOutputConfig. */ + interface IExportEvaluatedExamplesOutputConfig { + + /** ExportEvaluatedExamplesOutputConfig bigqueryDestination */ + bigqueryDestination?: (google.cloud.automl.v1beta1.IBigQueryDestination|null); + } + + /** Represents an ExportEvaluatedExamplesOutputConfig. */ + class ExportEvaluatedExamplesOutputConfig implements IExportEvaluatedExamplesOutputConfig { + + /** + * Constructs a new ExportEvaluatedExamplesOutputConfig. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.automl.v1beta1.IExportEvaluatedExamplesOutputConfig); + + /** ExportEvaluatedExamplesOutputConfig bigqueryDestination. */ + public bigqueryDestination?: (google.cloud.automl.v1beta1.IBigQueryDestination|null); + + /** ExportEvaluatedExamplesOutputConfig destination. */ + public destination?: "bigqueryDestination"; + + /** + * Creates a new ExportEvaluatedExamplesOutputConfig instance using the specified properties. + * @param [properties] Properties to set + * @returns ExportEvaluatedExamplesOutputConfig instance + */ + public static create(properties?: google.cloud.automl.v1beta1.IExportEvaluatedExamplesOutputConfig): google.cloud.automl.v1beta1.ExportEvaluatedExamplesOutputConfig; + + /** + * Encodes the specified ExportEvaluatedExamplesOutputConfig message. Does not implicitly {@link google.cloud.automl.v1beta1.ExportEvaluatedExamplesOutputConfig.verify|verify} messages. + * @param message ExportEvaluatedExamplesOutputConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.automl.v1beta1.IExportEvaluatedExamplesOutputConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ExportEvaluatedExamplesOutputConfig message, length delimited. Does not implicitly {@link google.cloud.automl.v1beta1.ExportEvaluatedExamplesOutputConfig.verify|verify} messages. + * @param message ExportEvaluatedExamplesOutputConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.automl.v1beta1.IExportEvaluatedExamplesOutputConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an ExportEvaluatedExamplesOutputConfig message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ExportEvaluatedExamplesOutputConfig + * @throws {Error} If the payload is not 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.automl.v1beta1.ExportEvaluatedExamplesOutputConfig; + + /** + * Decodes an ExportEvaluatedExamplesOutputConfig message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ExportEvaluatedExamplesOutputConfig + * @throws {Error} If the payload 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.automl.v1beta1.ExportEvaluatedExamplesOutputConfig; + + /** + * Verifies an ExportEvaluatedExamplesOutputConfig message. + * @param message Plain 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 ExportEvaluatedExamplesOutputConfig message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ExportEvaluatedExamplesOutputConfig + */ + public static fromObject(object: { [k: string]: any }): google.cloud.automl.v1beta1.ExportEvaluatedExamplesOutputConfig; + + /** + * Creates a plain object from an ExportEvaluatedExamplesOutputConfig message. Also converts values to other types if specified. + * @param message ExportEvaluatedExamplesOutputConfig + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.automl.v1beta1.ExportEvaluatedExamplesOutputConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ExportEvaluatedExamplesOutputConfig to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ExportEvaluatedExamplesOutputConfig + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a GcsSource. */ + interface IGcsSource { + + /** GcsSource inputUris */ + inputUris?: (string[]|null); + } + + /** Represents a GcsSource. */ + class GcsSource implements IGcsSource { + + /** + * Constructs a new GcsSource. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.automl.v1beta1.IGcsSource); + + /** GcsSource inputUris. */ + public inputUris: string[]; + + /** + * Creates a new GcsSource instance using the specified properties. + * @param [properties] Properties to set + * @returns GcsSource instance + */ + public static create(properties?: google.cloud.automl.v1beta1.IGcsSource): google.cloud.automl.v1beta1.GcsSource; + + /** + * Encodes the specified GcsSource message. Does not implicitly {@link google.cloud.automl.v1beta1.GcsSource.verify|verify} messages. + * @param message GcsSource message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.automl.v1beta1.IGcsSource, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GcsSource message, length delimited. Does not implicitly {@link google.cloud.automl.v1beta1.GcsSource.verify|verify} messages. + * @param message GcsSource message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.automl.v1beta1.IGcsSource, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GcsSource message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GcsSource + * @throws {Error} If the payload is not 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.automl.v1beta1.GcsSource; + + /** + * Decodes a GcsSource message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GcsSource + * @throws {Error} If the payload 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.automl.v1beta1.GcsSource; + + /** + * Verifies a GcsSource message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GcsSource message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GcsSource + */ + public static fromObject(object: { [k: string]: any }): google.cloud.automl.v1beta1.GcsSource; + + /** + * Creates a plain object from a GcsSource message. Also converts values to other types if specified. + * @param message GcsSource + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.automl.v1beta1.GcsSource, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GcsSource to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GcsSource + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a BigQuerySource. */ + interface IBigQuerySource { + + /** BigQuerySource inputUri */ + inputUri?: (string|null); + } + + /** Represents a BigQuerySource. */ + class BigQuerySource implements IBigQuerySource { + + /** + * Constructs a new BigQuerySource. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.automl.v1beta1.IBigQuerySource); + + /** BigQuerySource inputUri. */ + public inputUri: string; + + /** + * Creates a new BigQuerySource instance using the specified properties. + * @param [properties] Properties to set + * @returns BigQuerySource instance + */ + public static create(properties?: google.cloud.automl.v1beta1.IBigQuerySource): google.cloud.automl.v1beta1.BigQuerySource; + + /** + * Encodes the specified BigQuerySource message. Does not implicitly {@link google.cloud.automl.v1beta1.BigQuerySource.verify|verify} messages. + * @param message BigQuerySource message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.automl.v1beta1.IBigQuerySource, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified BigQuerySource message, length delimited. Does not implicitly {@link google.cloud.automl.v1beta1.BigQuerySource.verify|verify} messages. + * @param message BigQuerySource message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.automl.v1beta1.IBigQuerySource, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a BigQuerySource message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns BigQuerySource + * @throws {Error} If the payload is not 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.automl.v1beta1.BigQuerySource; + + /** + * Decodes a BigQuerySource message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns BigQuerySource + * @throws {Error} If the payload 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.automl.v1beta1.BigQuerySource; + + /** + * Verifies a BigQuerySource message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a BigQuerySource message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns BigQuerySource + */ + public static fromObject(object: { [k: string]: any }): google.cloud.automl.v1beta1.BigQuerySource; + + /** + * Creates a plain object from a BigQuerySource message. Also converts values to other types if specified. + * @param message BigQuerySource + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.automl.v1beta1.BigQuerySource, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this BigQuerySource to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for BigQuerySource + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a GcsDestination. */ + interface IGcsDestination { + + /** GcsDestination outputUriPrefix */ + outputUriPrefix?: (string|null); + } + + /** Represents a GcsDestination. */ + class GcsDestination implements IGcsDestination { + + /** + * Constructs a new GcsDestination. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.automl.v1beta1.IGcsDestination); + + /** GcsDestination outputUriPrefix. */ + public outputUriPrefix: string; + + /** + * Creates a new GcsDestination instance using the specified properties. + * @param [properties] Properties to set + * @returns GcsDestination instance + */ + public static create(properties?: google.cloud.automl.v1beta1.IGcsDestination): google.cloud.automl.v1beta1.GcsDestination; + + /** + * Encodes the specified GcsDestination message. Does not implicitly {@link google.cloud.automl.v1beta1.GcsDestination.verify|verify} messages. + * @param message GcsDestination message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.automl.v1beta1.IGcsDestination, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GcsDestination message, length delimited. Does not implicitly {@link google.cloud.automl.v1beta1.GcsDestination.verify|verify} messages. + * @param message GcsDestination message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.automl.v1beta1.IGcsDestination, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GcsDestination message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GcsDestination + * @throws {Error} If the payload is not 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.automl.v1beta1.GcsDestination; + + /** + * Decodes a GcsDestination message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GcsDestination + * @throws {Error} If the payload 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.automl.v1beta1.GcsDestination; + + /** + * Verifies a GcsDestination message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GcsDestination message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GcsDestination + */ + public static fromObject(object: { [k: string]: any }): google.cloud.automl.v1beta1.GcsDestination; + + /** + * Creates a plain object from a GcsDestination message. Also converts values to other types if specified. + * @param message GcsDestination + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.automl.v1beta1.GcsDestination, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GcsDestination to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GcsDestination + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a BigQueryDestination. */ + interface IBigQueryDestination { + + /** BigQueryDestination outputUri */ + outputUri?: (string|null); + } + + /** Represents a BigQueryDestination. */ + class BigQueryDestination implements IBigQueryDestination { + + /** + * Constructs a new BigQueryDestination. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.automl.v1beta1.IBigQueryDestination); + + /** BigQueryDestination outputUri. */ + public outputUri: string; + + /** + * Creates a new BigQueryDestination instance using the specified properties. + * @param [properties] Properties to set + * @returns BigQueryDestination instance + */ + public static create(properties?: google.cloud.automl.v1beta1.IBigQueryDestination): google.cloud.automl.v1beta1.BigQueryDestination; + + /** + * Encodes the specified BigQueryDestination message. Does not implicitly {@link google.cloud.automl.v1beta1.BigQueryDestination.verify|verify} messages. + * @param message BigQueryDestination message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.automl.v1beta1.IBigQueryDestination, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified BigQueryDestination message, length delimited. Does not implicitly {@link google.cloud.automl.v1beta1.BigQueryDestination.verify|verify} messages. + * @param message BigQueryDestination message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.automl.v1beta1.IBigQueryDestination, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a BigQueryDestination message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns BigQueryDestination + * @throws {Error} If the payload is not 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.automl.v1beta1.BigQueryDestination; + + /** + * Decodes a BigQueryDestination message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns BigQueryDestination + * @throws {Error} If the payload 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.automl.v1beta1.BigQueryDestination; + + /** + * Verifies a BigQueryDestination message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a BigQueryDestination message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns BigQueryDestination + */ + public static fromObject(object: { [k: string]: any }): google.cloud.automl.v1beta1.BigQueryDestination; + + /** + * Creates a plain object from a BigQueryDestination message. Also converts values to other types if specified. + * @param message BigQueryDestination + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.automl.v1beta1.BigQueryDestination, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this BigQueryDestination to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for BigQueryDestination + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a GcrDestination. */ + interface IGcrDestination { + + /** GcrDestination outputUri */ + outputUri?: (string|null); + } + + /** Represents a GcrDestination. */ + class GcrDestination implements IGcrDestination { + + /** + * Constructs a new GcrDestination. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.automl.v1beta1.IGcrDestination); + + /** GcrDestination outputUri. */ + public outputUri: string; + + /** + * Creates a new GcrDestination instance using the specified properties. + * @param [properties] Properties to set + * @returns GcrDestination instance + */ + public static create(properties?: google.cloud.automl.v1beta1.IGcrDestination): google.cloud.automl.v1beta1.GcrDestination; + + /** + * Encodes the specified GcrDestination message. Does not implicitly {@link google.cloud.automl.v1beta1.GcrDestination.verify|verify} messages. + * @param message GcrDestination message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.automl.v1beta1.IGcrDestination, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GcrDestination message, length delimited. Does not implicitly {@link google.cloud.automl.v1beta1.GcrDestination.verify|verify} messages. + * @param message GcrDestination message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.automl.v1beta1.IGcrDestination, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GcrDestination message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GcrDestination + * @throws {Error} If the payload is not 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.automl.v1beta1.GcrDestination; + + /** + * Decodes a GcrDestination message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GcrDestination + * @throws {Error} If the payload 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.automl.v1beta1.GcrDestination; + + /** + * Verifies a GcrDestination message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GcrDestination message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GcrDestination + */ + public static fromObject(object: { [k: string]: any }): google.cloud.automl.v1beta1.GcrDestination; + + /** + * Creates a plain object from a GcrDestination message. Also converts values to other types if specified. + * @param message GcrDestination + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.automl.v1beta1.GcrDestination, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GcrDestination to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GcrDestination + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TextSegment. */ + interface ITextSegment { + + /** TextSegment content */ + content?: (string|null); + + /** TextSegment startOffset */ + startOffset?: (number|Long|string|null); + + /** TextSegment endOffset */ + endOffset?: (number|Long|string|null); + } + + /** Represents a TextSegment. */ + class TextSegment implements ITextSegment { + + /** + * Constructs a new TextSegment. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.automl.v1beta1.ITextSegment); + + /** TextSegment content. */ + public content: string; + + /** TextSegment startOffset. */ + public startOffset: (number|Long|string); + + /** TextSegment endOffset. */ + public endOffset: (number|Long|string); + + /** + * Creates a new TextSegment instance using the specified properties. + * @param [properties] Properties to set + * @returns TextSegment instance + */ + public static create(properties?: google.cloud.automl.v1beta1.ITextSegment): google.cloud.automl.v1beta1.TextSegment; + + /** + * Encodes the specified TextSegment message. Does not implicitly {@link google.cloud.automl.v1beta1.TextSegment.verify|verify} messages. + * @param message TextSegment message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.automl.v1beta1.ITextSegment, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified TextSegment message, length delimited. Does not implicitly {@link google.cloud.automl.v1beta1.TextSegment.verify|verify} messages. + * @param message TextSegment message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.automl.v1beta1.ITextSegment, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TextSegment message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns TextSegment + * @throws {Error} If the payload is not 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.automl.v1beta1.TextSegment; + + /** + * Decodes a TextSegment message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns TextSegment + * @throws {Error} If the payload 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.automl.v1beta1.TextSegment; + + /** + * Verifies a TextSegment message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a TextSegment message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns TextSegment + */ + public static fromObject(object: { [k: string]: any }): google.cloud.automl.v1beta1.TextSegment; + + /** + * Creates a plain object from a TextSegment message. Also converts values to other types if specified. + * @param message TextSegment + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.automl.v1beta1.TextSegment, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this TextSegment to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for TextSegment + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a DoubleRange. */ + interface IDoubleRange { + + /** DoubleRange start */ + start?: (number|null); + + /** DoubleRange end */ + end?: (number|null); + } + + /** Represents a DoubleRange. */ + class DoubleRange implements IDoubleRange { + + /** + * Constructs a new DoubleRange. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.automl.v1beta1.IDoubleRange); + + /** DoubleRange start. */ + public start: number; + + /** DoubleRange end. */ + public end: number; + + /** + * Creates a new DoubleRange instance using the specified properties. + * @param [properties] Properties to set + * @returns DoubleRange instance + */ + public static create(properties?: google.cloud.automl.v1beta1.IDoubleRange): google.cloud.automl.v1beta1.DoubleRange; + + /** + * Encodes the specified DoubleRange message. Does not implicitly {@link google.cloud.automl.v1beta1.DoubleRange.verify|verify} messages. + * @param message DoubleRange message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.automl.v1beta1.IDoubleRange, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DoubleRange message, length delimited. Does not implicitly {@link google.cloud.automl.v1beta1.DoubleRange.verify|verify} messages. + * @param message DoubleRange message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.automl.v1beta1.IDoubleRange, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DoubleRange message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DoubleRange + * @throws {Error} If the payload is not 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.automl.v1beta1.DoubleRange; + + /** + * Decodes a DoubleRange message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DoubleRange + * @throws {Error} If the payload 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.automl.v1beta1.DoubleRange; + + /** + * Verifies a DoubleRange message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DoubleRange message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DoubleRange + */ + public static fromObject(object: { [k: string]: any }): google.cloud.automl.v1beta1.DoubleRange; + + /** + * Creates a plain object from a DoubleRange message. Also converts values to other types if specified. + * @param message DoubleRange + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.automl.v1beta1.DoubleRange, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DoubleRange to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DoubleRange + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a RegressionEvaluationMetrics. */ + interface IRegressionEvaluationMetrics { + + /** RegressionEvaluationMetrics rootMeanSquaredError */ + rootMeanSquaredError?: (number|null); + + /** RegressionEvaluationMetrics meanAbsoluteError */ + meanAbsoluteError?: (number|null); + + /** RegressionEvaluationMetrics meanAbsolutePercentageError */ + meanAbsolutePercentageError?: (number|null); + + /** RegressionEvaluationMetrics rSquared */ + rSquared?: (number|null); + + /** RegressionEvaluationMetrics rootMeanSquaredLogError */ + rootMeanSquaredLogError?: (number|null); + } + + /** Represents a RegressionEvaluationMetrics. */ + class RegressionEvaluationMetrics implements IRegressionEvaluationMetrics { + + /** + * Constructs a new RegressionEvaluationMetrics. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.automl.v1beta1.IRegressionEvaluationMetrics); + + /** RegressionEvaluationMetrics rootMeanSquaredError. */ + public rootMeanSquaredError: number; + + /** RegressionEvaluationMetrics meanAbsoluteError. */ + public meanAbsoluteError: number; + + /** RegressionEvaluationMetrics meanAbsolutePercentageError. */ + public meanAbsolutePercentageError: number; + + /** RegressionEvaluationMetrics rSquared. */ + public rSquared: number; + + /** RegressionEvaluationMetrics rootMeanSquaredLogError. */ + public rootMeanSquaredLogError: number; + + /** + * Creates a new RegressionEvaluationMetrics instance using the specified properties. + * @param [properties] Properties to set + * @returns RegressionEvaluationMetrics instance + */ + public static create(properties?: google.cloud.automl.v1beta1.IRegressionEvaluationMetrics): google.cloud.automl.v1beta1.RegressionEvaluationMetrics; + + /** + * Encodes the specified RegressionEvaluationMetrics message. Does not implicitly {@link google.cloud.automl.v1beta1.RegressionEvaluationMetrics.verify|verify} messages. + * @param message RegressionEvaluationMetrics message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.automl.v1beta1.IRegressionEvaluationMetrics, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified RegressionEvaluationMetrics message, length delimited. Does not implicitly {@link google.cloud.automl.v1beta1.RegressionEvaluationMetrics.verify|verify} messages. + * @param message RegressionEvaluationMetrics message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.automl.v1beta1.IRegressionEvaluationMetrics, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a RegressionEvaluationMetrics message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns RegressionEvaluationMetrics + * @throws {Error} If the payload is not 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.automl.v1beta1.RegressionEvaluationMetrics; + + /** + * Decodes a RegressionEvaluationMetrics message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns RegressionEvaluationMetrics + * @throws {Error} If the payload 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.automl.v1beta1.RegressionEvaluationMetrics; + + /** + * Verifies a RegressionEvaluationMetrics message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a RegressionEvaluationMetrics message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns RegressionEvaluationMetrics + */ + public static fromObject(object: { [k: string]: any }): google.cloud.automl.v1beta1.RegressionEvaluationMetrics; + + /** + * Creates a plain object from a RegressionEvaluationMetrics message. Also converts values to other types if specified. + * @param message RegressionEvaluationMetrics + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.automl.v1beta1.RegressionEvaluationMetrics, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this RegressionEvaluationMetrics to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for RegressionEvaluationMetrics + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TextExtractionAnnotation. */ + interface ITextExtractionAnnotation { + + /** TextExtractionAnnotation textSegment */ + textSegment?: (google.cloud.automl.v1beta1.ITextSegment|null); + + /** TextExtractionAnnotation score */ + score?: (number|null); + } + + /** Represents a TextExtractionAnnotation. */ + class TextExtractionAnnotation implements ITextExtractionAnnotation { + + /** + * Constructs a new TextExtractionAnnotation. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.automl.v1beta1.ITextExtractionAnnotation); + + /** TextExtractionAnnotation textSegment. */ + public textSegment?: (google.cloud.automl.v1beta1.ITextSegment|null); + + /** TextExtractionAnnotation score. */ + public score: number; + + /** TextExtractionAnnotation annotation. */ + public annotation?: "textSegment"; + + /** + * Creates a new TextExtractionAnnotation instance using the specified properties. + * @param [properties] Properties to set + * @returns TextExtractionAnnotation instance + */ + public static create(properties?: google.cloud.automl.v1beta1.ITextExtractionAnnotation): google.cloud.automl.v1beta1.TextExtractionAnnotation; + + /** + * Encodes the specified TextExtractionAnnotation message. Does not implicitly {@link google.cloud.automl.v1beta1.TextExtractionAnnotation.verify|verify} messages. + * @param message TextExtractionAnnotation message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.automl.v1beta1.ITextExtractionAnnotation, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified TextExtractionAnnotation message, length delimited. Does not implicitly {@link google.cloud.automl.v1beta1.TextExtractionAnnotation.verify|verify} messages. + * @param message TextExtractionAnnotation message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.automl.v1beta1.ITextExtractionAnnotation, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TextExtractionAnnotation message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns TextExtractionAnnotation + * @throws {Error} If the payload is not 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.automl.v1beta1.TextExtractionAnnotation; + + /** + * Decodes a TextExtractionAnnotation message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns TextExtractionAnnotation + * @throws {Error} If the payload 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.automl.v1beta1.TextExtractionAnnotation; + + /** + * Verifies a TextExtractionAnnotation message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a TextExtractionAnnotation message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns TextExtractionAnnotation + */ + public static fromObject(object: { [k: string]: any }): google.cloud.automl.v1beta1.TextExtractionAnnotation; + + /** + * Creates a plain object from a TextExtractionAnnotation message. Also converts values to other types if specified. + * @param message TextExtractionAnnotation + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.automl.v1beta1.TextExtractionAnnotation, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this TextExtractionAnnotation to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for TextExtractionAnnotation + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TextExtractionEvaluationMetrics. */ + interface ITextExtractionEvaluationMetrics { + + /** TextExtractionEvaluationMetrics auPrc */ + auPrc?: (number|null); + + /** TextExtractionEvaluationMetrics confidenceMetricsEntries */ + confidenceMetricsEntries?: (google.cloud.automl.v1beta1.TextExtractionEvaluationMetrics.IConfidenceMetricsEntry[]|null); + } + + /** Represents a TextExtractionEvaluationMetrics. */ + class TextExtractionEvaluationMetrics implements ITextExtractionEvaluationMetrics { + + /** + * Constructs a new TextExtractionEvaluationMetrics. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.automl.v1beta1.ITextExtractionEvaluationMetrics); + + /** TextExtractionEvaluationMetrics auPrc. */ + public auPrc: number; + + /** TextExtractionEvaluationMetrics confidenceMetricsEntries. */ + public confidenceMetricsEntries: google.cloud.automl.v1beta1.TextExtractionEvaluationMetrics.IConfidenceMetricsEntry[]; + + /** + * Creates a new TextExtractionEvaluationMetrics instance using the specified properties. + * @param [properties] Properties to set + * @returns TextExtractionEvaluationMetrics instance + */ + public static create(properties?: google.cloud.automl.v1beta1.ITextExtractionEvaluationMetrics): google.cloud.automl.v1beta1.TextExtractionEvaluationMetrics; + + /** + * Encodes the specified TextExtractionEvaluationMetrics message. Does not implicitly {@link google.cloud.automl.v1beta1.TextExtractionEvaluationMetrics.verify|verify} messages. + * @param message TextExtractionEvaluationMetrics message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.automl.v1beta1.ITextExtractionEvaluationMetrics, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified TextExtractionEvaluationMetrics message, length delimited. Does not implicitly {@link google.cloud.automl.v1beta1.TextExtractionEvaluationMetrics.verify|verify} messages. + * @param message TextExtractionEvaluationMetrics message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.automl.v1beta1.ITextExtractionEvaluationMetrics, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TextExtractionEvaluationMetrics message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns TextExtractionEvaluationMetrics + * @throws {Error} If the payload is not 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.automl.v1beta1.TextExtractionEvaluationMetrics; + + /** + * Decodes a TextExtractionEvaluationMetrics message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns TextExtractionEvaluationMetrics + * @throws {Error} If the payload 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.automl.v1beta1.TextExtractionEvaluationMetrics; + + /** + * Verifies a TextExtractionEvaluationMetrics message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a TextExtractionEvaluationMetrics message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns TextExtractionEvaluationMetrics + */ + public static fromObject(object: { [k: string]: any }): google.cloud.automl.v1beta1.TextExtractionEvaluationMetrics; + + /** + * Creates a plain object from a TextExtractionEvaluationMetrics message. Also converts values to other types if specified. + * @param message TextExtractionEvaluationMetrics + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.automl.v1beta1.TextExtractionEvaluationMetrics, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this TextExtractionEvaluationMetrics to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for TextExtractionEvaluationMetrics + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace TextExtractionEvaluationMetrics { + + /** Properties of a ConfidenceMetricsEntry. */ + interface IConfidenceMetricsEntry { + + /** ConfidenceMetricsEntry confidenceThreshold */ + confidenceThreshold?: (number|null); + + /** ConfidenceMetricsEntry recall */ + recall?: (number|null); + + /** ConfidenceMetricsEntry precision */ + precision?: (number|null); + + /** ConfidenceMetricsEntry f1Score */ + f1Score?: (number|null); + } + + /** Represents a ConfidenceMetricsEntry. */ + class ConfidenceMetricsEntry implements IConfidenceMetricsEntry { + + /** + * Constructs a new ConfidenceMetricsEntry. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.automl.v1beta1.TextExtractionEvaluationMetrics.IConfidenceMetricsEntry); + + /** ConfidenceMetricsEntry confidenceThreshold. */ + public confidenceThreshold: number; + + /** ConfidenceMetricsEntry recall. */ + public recall: number; + + /** ConfidenceMetricsEntry precision. */ + public precision: number; + + /** ConfidenceMetricsEntry f1Score. */ + public f1Score: number; + + /** + * Creates a new ConfidenceMetricsEntry instance using the specified properties. + * @param [properties] Properties to set + * @returns ConfidenceMetricsEntry instance + */ + public static create(properties?: google.cloud.automl.v1beta1.TextExtractionEvaluationMetrics.IConfidenceMetricsEntry): google.cloud.automl.v1beta1.TextExtractionEvaluationMetrics.ConfidenceMetricsEntry; + + /** + * Encodes the specified ConfidenceMetricsEntry message. Does not implicitly {@link google.cloud.automl.v1beta1.TextExtractionEvaluationMetrics.ConfidenceMetricsEntry.verify|verify} messages. + * @param message ConfidenceMetricsEntry message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.automl.v1beta1.TextExtractionEvaluationMetrics.IConfidenceMetricsEntry, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ConfidenceMetricsEntry message, length delimited. Does not implicitly {@link google.cloud.automl.v1beta1.TextExtractionEvaluationMetrics.ConfidenceMetricsEntry.verify|verify} messages. + * @param message ConfidenceMetricsEntry message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.automl.v1beta1.TextExtractionEvaluationMetrics.IConfidenceMetricsEntry, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ConfidenceMetricsEntry message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ConfidenceMetricsEntry + * @throws {Error} If the payload is not 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.automl.v1beta1.TextExtractionEvaluationMetrics.ConfidenceMetricsEntry; + + /** + * Decodes a ConfidenceMetricsEntry message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ConfidenceMetricsEntry + * @throws {Error} If the payload 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.automl.v1beta1.TextExtractionEvaluationMetrics.ConfidenceMetricsEntry; + + /** + * Verifies a ConfidenceMetricsEntry message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ConfidenceMetricsEntry message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ConfidenceMetricsEntry + */ + public static fromObject(object: { [k: string]: any }): google.cloud.automl.v1beta1.TextExtractionEvaluationMetrics.ConfidenceMetricsEntry; + + /** + * Creates a plain object from a ConfidenceMetricsEntry message. Also converts values to other types if specified. + * @param message ConfidenceMetricsEntry + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.automl.v1beta1.TextExtractionEvaluationMetrics.ConfidenceMetricsEntry, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ConfidenceMetricsEntry to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ConfidenceMetricsEntry + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Properties of a TextSentimentAnnotation. */ + interface ITextSentimentAnnotation { + + /** TextSentimentAnnotation sentiment */ + sentiment?: (number|null); + } + + /** Represents a TextSentimentAnnotation. */ + class TextSentimentAnnotation implements ITextSentimentAnnotation { + + /** + * Constructs a new TextSentimentAnnotation. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.automl.v1beta1.ITextSentimentAnnotation); + + /** TextSentimentAnnotation sentiment. */ + public sentiment: number; + + /** + * Creates a new TextSentimentAnnotation instance using the specified properties. + * @param [properties] Properties to set + * @returns TextSentimentAnnotation instance + */ + public static create(properties?: google.cloud.automl.v1beta1.ITextSentimentAnnotation): google.cloud.automl.v1beta1.TextSentimentAnnotation; + + /** + * Encodes the specified TextSentimentAnnotation message. Does not implicitly {@link google.cloud.automl.v1beta1.TextSentimentAnnotation.verify|verify} messages. + * @param message TextSentimentAnnotation message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.automl.v1beta1.ITextSentimentAnnotation, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified TextSentimentAnnotation message, length delimited. Does not implicitly {@link google.cloud.automl.v1beta1.TextSentimentAnnotation.verify|verify} messages. + * @param message TextSentimentAnnotation message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.automl.v1beta1.ITextSentimentAnnotation, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TextSentimentAnnotation message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns TextSentimentAnnotation + * @throws {Error} If the payload is not 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.automl.v1beta1.TextSentimentAnnotation; + + /** + * Decodes a TextSentimentAnnotation message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns TextSentimentAnnotation + * @throws {Error} If the payload 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.automl.v1beta1.TextSentimentAnnotation; + + /** + * Verifies a TextSentimentAnnotation message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a TextSentimentAnnotation message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns TextSentimentAnnotation + */ + public static fromObject(object: { [k: string]: any }): google.cloud.automl.v1beta1.TextSentimentAnnotation; + + /** + * Creates a plain object from a TextSentimentAnnotation message. Also converts values to other types if specified. + * @param message TextSentimentAnnotation + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.automl.v1beta1.TextSentimentAnnotation, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this TextSentimentAnnotation to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for TextSentimentAnnotation + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TextSentimentEvaluationMetrics. */ + interface ITextSentimentEvaluationMetrics { + + /** TextSentimentEvaluationMetrics precision */ + precision?: (number|null); + + /** TextSentimentEvaluationMetrics recall */ + recall?: (number|null); + + /** TextSentimentEvaluationMetrics f1Score */ + f1Score?: (number|null); + + /** TextSentimentEvaluationMetrics meanAbsoluteError */ + meanAbsoluteError?: (number|null); + + /** TextSentimentEvaluationMetrics meanSquaredError */ + meanSquaredError?: (number|null); + + /** TextSentimentEvaluationMetrics linearKappa */ + linearKappa?: (number|null); + + /** TextSentimentEvaluationMetrics quadraticKappa */ + quadraticKappa?: (number|null); + + /** TextSentimentEvaluationMetrics confusionMatrix */ + confusionMatrix?: (google.cloud.automl.v1beta1.ClassificationEvaluationMetrics.IConfusionMatrix|null); + + /** TextSentimentEvaluationMetrics annotationSpecId */ + annotationSpecId?: (string[]|null); + } + + /** Represents a TextSentimentEvaluationMetrics. */ + class TextSentimentEvaluationMetrics implements ITextSentimentEvaluationMetrics { + + /** + * Constructs a new TextSentimentEvaluationMetrics. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.automl.v1beta1.ITextSentimentEvaluationMetrics); + + /** TextSentimentEvaluationMetrics precision. */ + public precision: number; + + /** TextSentimentEvaluationMetrics recall. */ + public recall: number; + + /** TextSentimentEvaluationMetrics f1Score. */ + public f1Score: number; + + /** TextSentimentEvaluationMetrics meanAbsoluteError. */ + public meanAbsoluteError: number; + + /** TextSentimentEvaluationMetrics meanSquaredError. */ + public meanSquaredError: number; + + /** TextSentimentEvaluationMetrics linearKappa. */ + public linearKappa: number; + + /** TextSentimentEvaluationMetrics quadraticKappa. */ + public quadraticKappa: number; + + /** TextSentimentEvaluationMetrics confusionMatrix. */ + public confusionMatrix?: (google.cloud.automl.v1beta1.ClassificationEvaluationMetrics.IConfusionMatrix|null); + + /** TextSentimentEvaluationMetrics annotationSpecId. */ + public annotationSpecId: string[]; + + /** + * Creates a new TextSentimentEvaluationMetrics instance using the specified properties. + * @param [properties] Properties to set + * @returns TextSentimentEvaluationMetrics instance + */ + public static create(properties?: google.cloud.automl.v1beta1.ITextSentimentEvaluationMetrics): google.cloud.automl.v1beta1.TextSentimentEvaluationMetrics; + + /** + * Encodes the specified TextSentimentEvaluationMetrics message. Does not implicitly {@link google.cloud.automl.v1beta1.TextSentimentEvaluationMetrics.verify|verify} messages. + * @param message TextSentimentEvaluationMetrics message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.automl.v1beta1.ITextSentimentEvaluationMetrics, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified TextSentimentEvaluationMetrics message, length delimited. Does not implicitly {@link google.cloud.automl.v1beta1.TextSentimentEvaluationMetrics.verify|verify} messages. + * @param message TextSentimentEvaluationMetrics message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.automl.v1beta1.ITextSentimentEvaluationMetrics, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TextSentimentEvaluationMetrics message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns TextSentimentEvaluationMetrics + * @throws {Error} If the payload is not 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.automl.v1beta1.TextSentimentEvaluationMetrics; + + /** + * Decodes a TextSentimentEvaluationMetrics message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns TextSentimentEvaluationMetrics + * @throws {Error} If the payload 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.automl.v1beta1.TextSentimentEvaluationMetrics; + + /** + * Verifies a TextSentimentEvaluationMetrics message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a TextSentimentEvaluationMetrics message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns TextSentimentEvaluationMetrics + */ + public static fromObject(object: { [k: string]: any }): google.cloud.automl.v1beta1.TextSentimentEvaluationMetrics; + + /** + * Creates a plain object from a TextSentimentEvaluationMetrics message. Also converts values to other types if specified. + * @param message TextSentimentEvaluationMetrics + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.automl.v1beta1.TextSentimentEvaluationMetrics, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this TextSentimentEvaluationMetrics to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for TextSentimentEvaluationMetrics + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TranslationDatasetMetadata. */ + interface ITranslationDatasetMetadata { + + /** TranslationDatasetMetadata sourceLanguageCode */ + sourceLanguageCode?: (string|null); + + /** TranslationDatasetMetadata targetLanguageCode */ + targetLanguageCode?: (string|null); + } + + /** Represents a TranslationDatasetMetadata. */ + class TranslationDatasetMetadata implements ITranslationDatasetMetadata { + + /** + * Constructs a new TranslationDatasetMetadata. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.automl.v1beta1.ITranslationDatasetMetadata); + + /** TranslationDatasetMetadata sourceLanguageCode. */ + public sourceLanguageCode: string; + + /** TranslationDatasetMetadata targetLanguageCode. */ + public targetLanguageCode: string; + + /** + * Creates a new TranslationDatasetMetadata instance using the specified properties. + * @param [properties] Properties to set + * @returns TranslationDatasetMetadata instance + */ + public static create(properties?: google.cloud.automl.v1beta1.ITranslationDatasetMetadata): google.cloud.automl.v1beta1.TranslationDatasetMetadata; + + /** + * Encodes the specified TranslationDatasetMetadata message. Does not implicitly {@link google.cloud.automl.v1beta1.TranslationDatasetMetadata.verify|verify} messages. + * @param message TranslationDatasetMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.automl.v1beta1.ITranslationDatasetMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified TranslationDatasetMetadata message, length delimited. Does not implicitly {@link google.cloud.automl.v1beta1.TranslationDatasetMetadata.verify|verify} messages. + * @param message TranslationDatasetMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.automl.v1beta1.ITranslationDatasetMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TranslationDatasetMetadata message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns TranslationDatasetMetadata + * @throws {Error} If the payload is not 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.automl.v1beta1.TranslationDatasetMetadata; + + /** + * Decodes a TranslationDatasetMetadata message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns TranslationDatasetMetadata + * @throws {Error} If the payload 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.automl.v1beta1.TranslationDatasetMetadata; + + /** + * Verifies a TranslationDatasetMetadata message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a TranslationDatasetMetadata message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns TranslationDatasetMetadata + */ + public static fromObject(object: { [k: string]: any }): google.cloud.automl.v1beta1.TranslationDatasetMetadata; + + /** + * Creates a plain object from a TranslationDatasetMetadata message. Also converts values to other types if specified. + * @param message TranslationDatasetMetadata + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.automl.v1beta1.TranslationDatasetMetadata, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this TranslationDatasetMetadata to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for TranslationDatasetMetadata + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TranslationEvaluationMetrics. */ + interface ITranslationEvaluationMetrics { + + /** TranslationEvaluationMetrics bleuScore */ + bleuScore?: (number|null); + + /** TranslationEvaluationMetrics baseBleuScore */ + baseBleuScore?: (number|null); + } + + /** Represents a TranslationEvaluationMetrics. */ + class TranslationEvaluationMetrics implements ITranslationEvaluationMetrics { + + /** + * Constructs a new TranslationEvaluationMetrics. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.automl.v1beta1.ITranslationEvaluationMetrics); + + /** TranslationEvaluationMetrics bleuScore. */ + public bleuScore: number; + + /** TranslationEvaluationMetrics baseBleuScore. */ + public baseBleuScore: number; + + /** + * Creates a new TranslationEvaluationMetrics instance using the specified properties. + * @param [properties] Properties to set + * @returns TranslationEvaluationMetrics instance + */ + public static create(properties?: google.cloud.automl.v1beta1.ITranslationEvaluationMetrics): google.cloud.automl.v1beta1.TranslationEvaluationMetrics; + + /** + * Encodes the specified TranslationEvaluationMetrics message. Does not implicitly {@link google.cloud.automl.v1beta1.TranslationEvaluationMetrics.verify|verify} messages. + * @param message TranslationEvaluationMetrics message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.automl.v1beta1.ITranslationEvaluationMetrics, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified TranslationEvaluationMetrics message, length delimited. Does not implicitly {@link google.cloud.automl.v1beta1.TranslationEvaluationMetrics.verify|verify} messages. + * @param message TranslationEvaluationMetrics message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.automl.v1beta1.ITranslationEvaluationMetrics, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TranslationEvaluationMetrics message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns TranslationEvaluationMetrics + * @throws {Error} If the payload is not 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.automl.v1beta1.TranslationEvaluationMetrics; + + /** + * Decodes a TranslationEvaluationMetrics message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns TranslationEvaluationMetrics + * @throws {Error} If the payload 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.automl.v1beta1.TranslationEvaluationMetrics; + + /** + * Verifies a TranslationEvaluationMetrics message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a TranslationEvaluationMetrics message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns TranslationEvaluationMetrics + */ + public static fromObject(object: { [k: string]: any }): google.cloud.automl.v1beta1.TranslationEvaluationMetrics; + + /** + * Creates a plain object from a TranslationEvaluationMetrics message. Also converts values to other types if specified. + * @param message TranslationEvaluationMetrics + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.automl.v1beta1.TranslationEvaluationMetrics, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this TranslationEvaluationMetrics to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for TranslationEvaluationMetrics + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TranslationModelMetadata. */ + interface ITranslationModelMetadata { + + /** TranslationModelMetadata baseModel */ + baseModel?: (string|null); + + /** TranslationModelMetadata sourceLanguageCode */ + sourceLanguageCode?: (string|null); + + /** TranslationModelMetadata targetLanguageCode */ + targetLanguageCode?: (string|null); + } + + /** Represents a TranslationModelMetadata. */ + class TranslationModelMetadata implements ITranslationModelMetadata { + + /** + * Constructs a new TranslationModelMetadata. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.automl.v1beta1.ITranslationModelMetadata); + + /** TranslationModelMetadata baseModel. */ + public baseModel: string; + + /** TranslationModelMetadata sourceLanguageCode. */ + public sourceLanguageCode: string; + + /** TranslationModelMetadata targetLanguageCode. */ + public targetLanguageCode: string; + + /** + * Creates a new TranslationModelMetadata instance using the specified properties. + * @param [properties] Properties to set + * @returns TranslationModelMetadata instance + */ + public static create(properties?: google.cloud.automl.v1beta1.ITranslationModelMetadata): google.cloud.automl.v1beta1.TranslationModelMetadata; + + /** + * Encodes the specified TranslationModelMetadata message. Does not implicitly {@link google.cloud.automl.v1beta1.TranslationModelMetadata.verify|verify} messages. + * @param message TranslationModelMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.automl.v1beta1.ITranslationModelMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified TranslationModelMetadata message, length delimited. Does not implicitly {@link google.cloud.automl.v1beta1.TranslationModelMetadata.verify|verify} messages. + * @param message TranslationModelMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.automl.v1beta1.ITranslationModelMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TranslationModelMetadata message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns TranslationModelMetadata + * @throws {Error} If the payload is not 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.automl.v1beta1.TranslationModelMetadata; + + /** + * Decodes a TranslationModelMetadata message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns TranslationModelMetadata + * @throws {Error} If the payload 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.automl.v1beta1.TranslationModelMetadata; + + /** + * Verifies a TranslationModelMetadata message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a TranslationModelMetadata message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns TranslationModelMetadata + */ + public static fromObject(object: { [k: string]: any }): google.cloud.automl.v1beta1.TranslationModelMetadata; + + /** + * Creates a plain object from a TranslationModelMetadata message. Also converts values to other types if specified. + * @param message TranslationModelMetadata + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.automl.v1beta1.TranslationModelMetadata, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this TranslationModelMetadata to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for TranslationModelMetadata + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TranslationAnnotation. */ + interface ITranslationAnnotation { + + /** TranslationAnnotation translatedContent */ + translatedContent?: (google.cloud.automl.v1beta1.ITextSnippet|null); + } + + /** Represents a TranslationAnnotation. */ + class TranslationAnnotation implements ITranslationAnnotation { + + /** + * Constructs a new TranslationAnnotation. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.automl.v1beta1.ITranslationAnnotation); + + /** TranslationAnnotation translatedContent. */ + public translatedContent?: (google.cloud.automl.v1beta1.ITextSnippet|null); + + /** + * Creates a new TranslationAnnotation instance using the specified properties. + * @param [properties] Properties to set + * @returns TranslationAnnotation instance + */ + public static create(properties?: google.cloud.automl.v1beta1.ITranslationAnnotation): google.cloud.automl.v1beta1.TranslationAnnotation; + + /** + * Encodes the specified TranslationAnnotation message. Does not implicitly {@link google.cloud.automl.v1beta1.TranslationAnnotation.verify|verify} messages. + * @param message TranslationAnnotation message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.automl.v1beta1.ITranslationAnnotation, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified TranslationAnnotation message, length delimited. Does not implicitly {@link google.cloud.automl.v1beta1.TranslationAnnotation.verify|verify} messages. + * @param message TranslationAnnotation message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.automl.v1beta1.ITranslationAnnotation, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TranslationAnnotation message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns TranslationAnnotation + * @throws {Error} If the payload is not 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.automl.v1beta1.TranslationAnnotation; + + /** + * Decodes a TranslationAnnotation message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns TranslationAnnotation + * @throws {Error} If the payload 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.automl.v1beta1.TranslationAnnotation; + + /** + * Verifies a TranslationAnnotation message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a TranslationAnnotation message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns TranslationAnnotation + */ + public static fromObject(object: { [k: string]: any }): google.cloud.automl.v1beta1.TranslationAnnotation; + + /** + * Creates a plain object from a TranslationAnnotation message. Also converts values to other types if specified. + * @param message TranslationAnnotation + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.automl.v1beta1.TranslationAnnotation, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this TranslationAnnotation to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for TranslationAnnotation + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an AnnotationSpec. */ + interface IAnnotationSpec { + + /** AnnotationSpec name */ + name?: (string|null); + + /** AnnotationSpec displayName */ + displayName?: (string|null); + + /** AnnotationSpec exampleCount */ + exampleCount?: (number|null); + } + + /** Represents an AnnotationSpec. */ + class AnnotationSpec implements IAnnotationSpec { + + /** + * Constructs a new AnnotationSpec. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.automl.v1beta1.IAnnotationSpec); + + /** AnnotationSpec name. */ + public name: string; + + /** AnnotationSpec displayName. */ + public displayName: string; + + /** AnnotationSpec exampleCount. */ + public exampleCount: number; + + /** + * Creates a new AnnotationSpec instance using the specified properties. + * @param [properties] Properties to set + * @returns AnnotationSpec instance + */ + public static create(properties?: google.cloud.automl.v1beta1.IAnnotationSpec): google.cloud.automl.v1beta1.AnnotationSpec; + + /** + * Encodes the specified AnnotationSpec message. Does not implicitly {@link google.cloud.automl.v1beta1.AnnotationSpec.verify|verify} messages. + * @param message AnnotationSpec message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.automl.v1beta1.IAnnotationSpec, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified AnnotationSpec message, length delimited. Does not implicitly {@link google.cloud.automl.v1beta1.AnnotationSpec.verify|verify} messages. + * @param message AnnotationSpec message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.automl.v1beta1.IAnnotationSpec, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an AnnotationSpec message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns AnnotationSpec + * @throws {Error} If the payload is not 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.automl.v1beta1.AnnotationSpec; + + /** + * Decodes an AnnotationSpec message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns AnnotationSpec + * @throws {Error} If the payload 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.automl.v1beta1.AnnotationSpec; + + /** + * Verifies an AnnotationSpec message. + * @param message Plain 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 AnnotationSpec message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns AnnotationSpec + */ + public static fromObject(object: { [k: string]: any }): google.cloud.automl.v1beta1.AnnotationSpec; + + /** + * Creates a plain object from an AnnotationSpec message. Also converts values to other types if specified. + * @param message AnnotationSpec + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.automl.v1beta1.AnnotationSpec, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this AnnotationSpec to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for AnnotationSpec + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Dataset. */ + interface IDataset { + + /** Dataset translationDatasetMetadata */ + translationDatasetMetadata?: (google.cloud.automl.v1beta1.ITranslationDatasetMetadata|null); + + /** Dataset imageClassificationDatasetMetadata */ + imageClassificationDatasetMetadata?: (google.cloud.automl.v1beta1.IImageClassificationDatasetMetadata|null); + + /** Dataset textClassificationDatasetMetadata */ + textClassificationDatasetMetadata?: (google.cloud.automl.v1beta1.ITextClassificationDatasetMetadata|null); + + /** Dataset imageObjectDetectionDatasetMetadata */ + imageObjectDetectionDatasetMetadata?: (google.cloud.automl.v1beta1.IImageObjectDetectionDatasetMetadata|null); + + /** Dataset videoClassificationDatasetMetadata */ + videoClassificationDatasetMetadata?: (google.cloud.automl.v1beta1.IVideoClassificationDatasetMetadata|null); + + /** Dataset videoObjectTrackingDatasetMetadata */ + videoObjectTrackingDatasetMetadata?: (google.cloud.automl.v1beta1.IVideoObjectTrackingDatasetMetadata|null); + + /** Dataset textExtractionDatasetMetadata */ + textExtractionDatasetMetadata?: (google.cloud.automl.v1beta1.ITextExtractionDatasetMetadata|null); + + /** Dataset textSentimentDatasetMetadata */ + textSentimentDatasetMetadata?: (google.cloud.automl.v1beta1.ITextSentimentDatasetMetadata|null); + + /** Dataset tablesDatasetMetadata */ + tablesDatasetMetadata?: (google.cloud.automl.v1beta1.ITablesDatasetMetadata|null); + + /** Dataset name */ + name?: (string|null); + + /** Dataset displayName */ + displayName?: (string|null); + + /** Dataset description */ + description?: (string|null); + + /** Dataset exampleCount */ + exampleCount?: (number|null); + + /** Dataset createTime */ + createTime?: (google.protobuf.ITimestamp|null); + + /** Dataset etag */ + etag?: (string|null); + } + + /** Represents a Dataset. */ + class Dataset implements IDataset { + + /** + * Constructs a new Dataset. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.automl.v1beta1.IDataset); + + /** Dataset translationDatasetMetadata. */ + public translationDatasetMetadata?: (google.cloud.automl.v1beta1.ITranslationDatasetMetadata|null); + + /** Dataset imageClassificationDatasetMetadata. */ + public imageClassificationDatasetMetadata?: (google.cloud.automl.v1beta1.IImageClassificationDatasetMetadata|null); + + /** Dataset textClassificationDatasetMetadata. */ + public textClassificationDatasetMetadata?: (google.cloud.automl.v1beta1.ITextClassificationDatasetMetadata|null); + + /** Dataset imageObjectDetectionDatasetMetadata. */ + public imageObjectDetectionDatasetMetadata?: (google.cloud.automl.v1beta1.IImageObjectDetectionDatasetMetadata|null); + + /** Dataset videoClassificationDatasetMetadata. */ + public videoClassificationDatasetMetadata?: (google.cloud.automl.v1beta1.IVideoClassificationDatasetMetadata|null); + + /** Dataset videoObjectTrackingDatasetMetadata. */ + public videoObjectTrackingDatasetMetadata?: (google.cloud.automl.v1beta1.IVideoObjectTrackingDatasetMetadata|null); + + /** Dataset textExtractionDatasetMetadata. */ + public textExtractionDatasetMetadata?: (google.cloud.automl.v1beta1.ITextExtractionDatasetMetadata|null); + + /** Dataset textSentimentDatasetMetadata. */ + public textSentimentDatasetMetadata?: (google.cloud.automl.v1beta1.ITextSentimentDatasetMetadata|null); + + /** Dataset tablesDatasetMetadata. */ + public tablesDatasetMetadata?: (google.cloud.automl.v1beta1.ITablesDatasetMetadata|null); + + /** Dataset name. */ + public name: string; + + /** Dataset displayName. */ + public displayName: string; + + /** Dataset description. */ + public description: string; + + /** Dataset exampleCount. */ + public exampleCount: number; + + /** Dataset createTime. */ + public createTime?: (google.protobuf.ITimestamp|null); + + /** Dataset etag. */ + public etag: string; + + /** Dataset datasetMetadata. */ + public datasetMetadata?: ("translationDatasetMetadata"|"imageClassificationDatasetMetadata"|"textClassificationDatasetMetadata"|"imageObjectDetectionDatasetMetadata"|"videoClassificationDatasetMetadata"|"videoObjectTrackingDatasetMetadata"|"textExtractionDatasetMetadata"|"textSentimentDatasetMetadata"|"tablesDatasetMetadata"); + + /** + * Creates a new Dataset instance using the specified properties. + * @param [properties] Properties to set + * @returns Dataset instance + */ + public static create(properties?: google.cloud.automl.v1beta1.IDataset): google.cloud.automl.v1beta1.Dataset; + + /** + * Encodes the specified Dataset message. Does not implicitly {@link google.cloud.automl.v1beta1.Dataset.verify|verify} messages. + * @param message Dataset message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.automl.v1beta1.IDataset, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Dataset message, length delimited. Does not implicitly {@link google.cloud.automl.v1beta1.Dataset.verify|verify} messages. + * @param message Dataset message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.automl.v1beta1.IDataset, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Dataset message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Dataset + * @throws {Error} If the payload is not 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.automl.v1beta1.Dataset; + + /** + * Decodes a Dataset message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Dataset + * @throws {Error} If the payload 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.automl.v1beta1.Dataset; + + /** + * Verifies a Dataset message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Dataset message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Dataset + */ + public static fromObject(object: { [k: string]: any }): google.cloud.automl.v1beta1.Dataset; + + /** + * Creates a plain object from a Dataset message. Also converts values to other types if specified. + * @param message Dataset + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.automl.v1beta1.Dataset, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Dataset to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Dataset + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an ImageClassificationDatasetMetadata. */ + interface IImageClassificationDatasetMetadata { + + /** ImageClassificationDatasetMetadata classificationType */ + classificationType?: (google.cloud.automl.v1beta1.ClassificationType|keyof typeof google.cloud.automl.v1beta1.ClassificationType|null); + } + + /** Represents an ImageClassificationDatasetMetadata. */ + class ImageClassificationDatasetMetadata implements IImageClassificationDatasetMetadata { + + /** + * Constructs a new ImageClassificationDatasetMetadata. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.automl.v1beta1.IImageClassificationDatasetMetadata); + + /** ImageClassificationDatasetMetadata classificationType. */ + public classificationType: (google.cloud.automl.v1beta1.ClassificationType|keyof typeof google.cloud.automl.v1beta1.ClassificationType); + + /** + * Creates a new ImageClassificationDatasetMetadata instance using the specified properties. + * @param [properties] Properties to set + * @returns ImageClassificationDatasetMetadata instance + */ + public static create(properties?: google.cloud.automl.v1beta1.IImageClassificationDatasetMetadata): google.cloud.automl.v1beta1.ImageClassificationDatasetMetadata; + + /** + * Encodes the specified ImageClassificationDatasetMetadata message. Does not implicitly {@link google.cloud.automl.v1beta1.ImageClassificationDatasetMetadata.verify|verify} messages. + * @param message ImageClassificationDatasetMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.automl.v1beta1.IImageClassificationDatasetMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ImageClassificationDatasetMetadata message, length delimited. Does not implicitly {@link google.cloud.automl.v1beta1.ImageClassificationDatasetMetadata.verify|verify} messages. + * @param message ImageClassificationDatasetMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.automl.v1beta1.IImageClassificationDatasetMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an ImageClassificationDatasetMetadata message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ImageClassificationDatasetMetadata + * @throws {Error} If the payload is not 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.automl.v1beta1.ImageClassificationDatasetMetadata; + + /** + * Decodes an ImageClassificationDatasetMetadata message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ImageClassificationDatasetMetadata + * @throws {Error} If the payload 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.automl.v1beta1.ImageClassificationDatasetMetadata; + + /** + * Verifies an ImageClassificationDatasetMetadata message. + * @param message Plain 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 ImageClassificationDatasetMetadata message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ImageClassificationDatasetMetadata + */ + public static fromObject(object: { [k: string]: any }): google.cloud.automl.v1beta1.ImageClassificationDatasetMetadata; + + /** + * Creates a plain object from an ImageClassificationDatasetMetadata message. Also converts values to other types if specified. + * @param message ImageClassificationDatasetMetadata + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.automl.v1beta1.ImageClassificationDatasetMetadata, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ImageClassificationDatasetMetadata to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ImageClassificationDatasetMetadata + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an ImageObjectDetectionDatasetMetadata. */ + interface IImageObjectDetectionDatasetMetadata { + } + + /** Represents an ImageObjectDetectionDatasetMetadata. */ + class ImageObjectDetectionDatasetMetadata implements IImageObjectDetectionDatasetMetadata { + + /** + * Constructs a new ImageObjectDetectionDatasetMetadata. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.automl.v1beta1.IImageObjectDetectionDatasetMetadata); + + /** + * Creates a new ImageObjectDetectionDatasetMetadata instance using the specified properties. + * @param [properties] Properties to set + * @returns ImageObjectDetectionDatasetMetadata instance + */ + public static create(properties?: google.cloud.automl.v1beta1.IImageObjectDetectionDatasetMetadata): google.cloud.automl.v1beta1.ImageObjectDetectionDatasetMetadata; + + /** + * Encodes the specified ImageObjectDetectionDatasetMetadata message. Does not implicitly {@link google.cloud.automl.v1beta1.ImageObjectDetectionDatasetMetadata.verify|verify} messages. + * @param message ImageObjectDetectionDatasetMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.automl.v1beta1.IImageObjectDetectionDatasetMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ImageObjectDetectionDatasetMetadata message, length delimited. Does not implicitly {@link google.cloud.automl.v1beta1.ImageObjectDetectionDatasetMetadata.verify|verify} messages. + * @param message ImageObjectDetectionDatasetMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.automl.v1beta1.IImageObjectDetectionDatasetMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an ImageObjectDetectionDatasetMetadata message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ImageObjectDetectionDatasetMetadata + * @throws {Error} If the payload is not 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.automl.v1beta1.ImageObjectDetectionDatasetMetadata; + + /** + * Decodes an ImageObjectDetectionDatasetMetadata message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ImageObjectDetectionDatasetMetadata + * @throws {Error} If the payload 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.automl.v1beta1.ImageObjectDetectionDatasetMetadata; + + /** + * Verifies an ImageObjectDetectionDatasetMetadata message. + * @param message Plain 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 ImageObjectDetectionDatasetMetadata message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ImageObjectDetectionDatasetMetadata + */ + public static fromObject(object: { [k: string]: any }): google.cloud.automl.v1beta1.ImageObjectDetectionDatasetMetadata; + + /** + * Creates a plain object from an ImageObjectDetectionDatasetMetadata message. Also converts values to other types if specified. + * @param message ImageObjectDetectionDatasetMetadata + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.automl.v1beta1.ImageObjectDetectionDatasetMetadata, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ImageObjectDetectionDatasetMetadata to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ImageObjectDetectionDatasetMetadata + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an ImageClassificationModelMetadata. */ + interface IImageClassificationModelMetadata { + + /** ImageClassificationModelMetadata baseModelId */ + baseModelId?: (string|null); + + /** ImageClassificationModelMetadata trainBudget */ + trainBudget?: (number|Long|string|null); + + /** ImageClassificationModelMetadata trainCost */ + trainCost?: (number|Long|string|null); + + /** ImageClassificationModelMetadata stopReason */ + stopReason?: (string|null); + + /** ImageClassificationModelMetadata modelType */ + modelType?: (string|null); + + /** ImageClassificationModelMetadata nodeQps */ + nodeQps?: (number|null); + + /** ImageClassificationModelMetadata nodeCount */ + nodeCount?: (number|Long|string|null); + } + + /** Represents an ImageClassificationModelMetadata. */ + class ImageClassificationModelMetadata implements IImageClassificationModelMetadata { + + /** + * Constructs a new ImageClassificationModelMetadata. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.automl.v1beta1.IImageClassificationModelMetadata); + + /** ImageClassificationModelMetadata baseModelId. */ + public baseModelId: string; + + /** ImageClassificationModelMetadata trainBudget. */ + public trainBudget: (number|Long|string); + + /** ImageClassificationModelMetadata trainCost. */ + public trainCost: (number|Long|string); + + /** ImageClassificationModelMetadata stopReason. */ + public stopReason: string; + + /** ImageClassificationModelMetadata modelType. */ + public modelType: string; + + /** ImageClassificationModelMetadata nodeQps. */ + public nodeQps: number; + + /** ImageClassificationModelMetadata nodeCount. */ + public nodeCount: (number|Long|string); + + /** + * Creates a new ImageClassificationModelMetadata instance using the specified properties. + * @param [properties] Properties to set + * @returns ImageClassificationModelMetadata instance + */ + public static create(properties?: google.cloud.automl.v1beta1.IImageClassificationModelMetadata): google.cloud.automl.v1beta1.ImageClassificationModelMetadata; + + /** + * Encodes the specified ImageClassificationModelMetadata message. Does not implicitly {@link google.cloud.automl.v1beta1.ImageClassificationModelMetadata.verify|verify} messages. + * @param message ImageClassificationModelMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.automl.v1beta1.IImageClassificationModelMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ImageClassificationModelMetadata message, length delimited. Does not implicitly {@link google.cloud.automl.v1beta1.ImageClassificationModelMetadata.verify|verify} messages. + * @param message ImageClassificationModelMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.automl.v1beta1.IImageClassificationModelMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an ImageClassificationModelMetadata message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ImageClassificationModelMetadata + * @throws {Error} If the payload is not 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.automl.v1beta1.ImageClassificationModelMetadata; + + /** + * Decodes an ImageClassificationModelMetadata message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ImageClassificationModelMetadata + * @throws {Error} If the payload 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.automl.v1beta1.ImageClassificationModelMetadata; + + /** + * Verifies an ImageClassificationModelMetadata message. + * @param message Plain 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 ImageClassificationModelMetadata message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ImageClassificationModelMetadata + */ + public static fromObject(object: { [k: string]: any }): google.cloud.automl.v1beta1.ImageClassificationModelMetadata; + + /** + * Creates a plain object from an ImageClassificationModelMetadata message. Also converts values to other types if specified. + * @param message ImageClassificationModelMetadata + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.automl.v1beta1.ImageClassificationModelMetadata, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ImageClassificationModelMetadata to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ImageClassificationModelMetadata + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an ImageObjectDetectionModelMetadata. */ + interface IImageObjectDetectionModelMetadata { + + /** ImageObjectDetectionModelMetadata modelType */ + modelType?: (string|null); + + /** ImageObjectDetectionModelMetadata nodeCount */ + nodeCount?: (number|Long|string|null); + + /** ImageObjectDetectionModelMetadata nodeQps */ + nodeQps?: (number|null); + + /** ImageObjectDetectionModelMetadata stopReason */ + stopReason?: (string|null); + + /** ImageObjectDetectionModelMetadata trainBudgetMilliNodeHours */ + trainBudgetMilliNodeHours?: (number|Long|string|null); + + /** ImageObjectDetectionModelMetadata trainCostMilliNodeHours */ + trainCostMilliNodeHours?: (number|Long|string|null); + } + + /** Represents an ImageObjectDetectionModelMetadata. */ + class ImageObjectDetectionModelMetadata implements IImageObjectDetectionModelMetadata { + + /** + * Constructs a new ImageObjectDetectionModelMetadata. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.automl.v1beta1.IImageObjectDetectionModelMetadata); + + /** ImageObjectDetectionModelMetadata modelType. */ + public modelType: string; + + /** ImageObjectDetectionModelMetadata nodeCount. */ + public nodeCount: (number|Long|string); + + /** ImageObjectDetectionModelMetadata nodeQps. */ + public nodeQps: number; + + /** ImageObjectDetectionModelMetadata stopReason. */ + public stopReason: string; + + /** ImageObjectDetectionModelMetadata trainBudgetMilliNodeHours. */ + public trainBudgetMilliNodeHours: (number|Long|string); + + /** ImageObjectDetectionModelMetadata trainCostMilliNodeHours. */ + public trainCostMilliNodeHours: (number|Long|string); + + /** + * Creates a new ImageObjectDetectionModelMetadata instance using the specified properties. + * @param [properties] Properties to set + * @returns ImageObjectDetectionModelMetadata instance + */ + public static create(properties?: google.cloud.automl.v1beta1.IImageObjectDetectionModelMetadata): google.cloud.automl.v1beta1.ImageObjectDetectionModelMetadata; + + /** + * Encodes the specified ImageObjectDetectionModelMetadata message. Does not implicitly {@link google.cloud.automl.v1beta1.ImageObjectDetectionModelMetadata.verify|verify} messages. + * @param message ImageObjectDetectionModelMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.automl.v1beta1.IImageObjectDetectionModelMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ImageObjectDetectionModelMetadata message, length delimited. Does not implicitly {@link google.cloud.automl.v1beta1.ImageObjectDetectionModelMetadata.verify|verify} messages. + * @param message ImageObjectDetectionModelMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.automl.v1beta1.IImageObjectDetectionModelMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an ImageObjectDetectionModelMetadata message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ImageObjectDetectionModelMetadata + * @throws {Error} If the payload is not 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.automl.v1beta1.ImageObjectDetectionModelMetadata; + + /** + * Decodes an ImageObjectDetectionModelMetadata message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ImageObjectDetectionModelMetadata + * @throws {Error} If the payload 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.automl.v1beta1.ImageObjectDetectionModelMetadata; + + /** + * Verifies an ImageObjectDetectionModelMetadata message. + * @param message Plain 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 ImageObjectDetectionModelMetadata message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ImageObjectDetectionModelMetadata + */ + public static fromObject(object: { [k: string]: any }): google.cloud.automl.v1beta1.ImageObjectDetectionModelMetadata; + + /** + * Creates a plain object from an ImageObjectDetectionModelMetadata message. Also converts values to other types if specified. + * @param message ImageObjectDetectionModelMetadata + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.automl.v1beta1.ImageObjectDetectionModelMetadata, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ImageObjectDetectionModelMetadata to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ImageObjectDetectionModelMetadata + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an ImageClassificationModelDeploymentMetadata. */ + interface IImageClassificationModelDeploymentMetadata { + + /** ImageClassificationModelDeploymentMetadata nodeCount */ + nodeCount?: (number|Long|string|null); + } + + /** Represents an ImageClassificationModelDeploymentMetadata. */ + class ImageClassificationModelDeploymentMetadata implements IImageClassificationModelDeploymentMetadata { + + /** + * Constructs a new ImageClassificationModelDeploymentMetadata. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.automl.v1beta1.IImageClassificationModelDeploymentMetadata); + + /** ImageClassificationModelDeploymentMetadata nodeCount. */ + public nodeCount: (number|Long|string); + + /** + * Creates a new ImageClassificationModelDeploymentMetadata instance using the specified properties. + * @param [properties] Properties to set + * @returns ImageClassificationModelDeploymentMetadata instance + */ + public static create(properties?: google.cloud.automl.v1beta1.IImageClassificationModelDeploymentMetadata): google.cloud.automl.v1beta1.ImageClassificationModelDeploymentMetadata; + + /** + * Encodes the specified ImageClassificationModelDeploymentMetadata message. Does not implicitly {@link google.cloud.automl.v1beta1.ImageClassificationModelDeploymentMetadata.verify|verify} messages. + * @param message ImageClassificationModelDeploymentMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.automl.v1beta1.IImageClassificationModelDeploymentMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ImageClassificationModelDeploymentMetadata message, length delimited. Does not implicitly {@link google.cloud.automl.v1beta1.ImageClassificationModelDeploymentMetadata.verify|verify} messages. + * @param message ImageClassificationModelDeploymentMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.automl.v1beta1.IImageClassificationModelDeploymentMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an ImageClassificationModelDeploymentMetadata message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ImageClassificationModelDeploymentMetadata + * @throws {Error} If the payload is not 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.automl.v1beta1.ImageClassificationModelDeploymentMetadata; + + /** + * Decodes an ImageClassificationModelDeploymentMetadata message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ImageClassificationModelDeploymentMetadata + * @throws {Error} If the payload 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.automl.v1beta1.ImageClassificationModelDeploymentMetadata; + + /** + * Verifies an ImageClassificationModelDeploymentMetadata message. + * @param message Plain 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 ImageClassificationModelDeploymentMetadata message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ImageClassificationModelDeploymentMetadata + */ + public static fromObject(object: { [k: string]: any }): google.cloud.automl.v1beta1.ImageClassificationModelDeploymentMetadata; + + /** + * Creates a plain object from an ImageClassificationModelDeploymentMetadata message. Also converts values to other types if specified. + * @param message ImageClassificationModelDeploymentMetadata + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.automl.v1beta1.ImageClassificationModelDeploymentMetadata, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ImageClassificationModelDeploymentMetadata to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ImageClassificationModelDeploymentMetadata + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an ImageObjectDetectionModelDeploymentMetadata. */ + interface IImageObjectDetectionModelDeploymentMetadata { + + /** ImageObjectDetectionModelDeploymentMetadata nodeCount */ + nodeCount?: (number|Long|string|null); + } + + /** Represents an ImageObjectDetectionModelDeploymentMetadata. */ + class ImageObjectDetectionModelDeploymentMetadata implements IImageObjectDetectionModelDeploymentMetadata { + + /** + * Constructs a new ImageObjectDetectionModelDeploymentMetadata. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.automl.v1beta1.IImageObjectDetectionModelDeploymentMetadata); + + /** ImageObjectDetectionModelDeploymentMetadata nodeCount. */ + public nodeCount: (number|Long|string); + + /** + * Creates a new ImageObjectDetectionModelDeploymentMetadata instance using the specified properties. + * @param [properties] Properties to set + * @returns ImageObjectDetectionModelDeploymentMetadata instance + */ + public static create(properties?: google.cloud.automl.v1beta1.IImageObjectDetectionModelDeploymentMetadata): google.cloud.automl.v1beta1.ImageObjectDetectionModelDeploymentMetadata; + + /** + * Encodes the specified ImageObjectDetectionModelDeploymentMetadata message. Does not implicitly {@link google.cloud.automl.v1beta1.ImageObjectDetectionModelDeploymentMetadata.verify|verify} messages. + * @param message ImageObjectDetectionModelDeploymentMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.automl.v1beta1.IImageObjectDetectionModelDeploymentMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ImageObjectDetectionModelDeploymentMetadata message, length delimited. Does not implicitly {@link google.cloud.automl.v1beta1.ImageObjectDetectionModelDeploymentMetadata.verify|verify} messages. + * @param message ImageObjectDetectionModelDeploymentMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.automl.v1beta1.IImageObjectDetectionModelDeploymentMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an ImageObjectDetectionModelDeploymentMetadata message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ImageObjectDetectionModelDeploymentMetadata + * @throws {Error} If the payload is not 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.automl.v1beta1.ImageObjectDetectionModelDeploymentMetadata; + + /** + * Decodes an ImageObjectDetectionModelDeploymentMetadata message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ImageObjectDetectionModelDeploymentMetadata + * @throws {Error} If the payload 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.automl.v1beta1.ImageObjectDetectionModelDeploymentMetadata; + + /** + * Verifies an ImageObjectDetectionModelDeploymentMetadata message. + * @param message Plain 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 ImageObjectDetectionModelDeploymentMetadata message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ImageObjectDetectionModelDeploymentMetadata + */ + public static fromObject(object: { [k: string]: any }): google.cloud.automl.v1beta1.ImageObjectDetectionModelDeploymentMetadata; + + /** + * Creates a plain object from an ImageObjectDetectionModelDeploymentMetadata message. Also converts values to other types if specified. + * @param message ImageObjectDetectionModelDeploymentMetadata + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.automl.v1beta1.ImageObjectDetectionModelDeploymentMetadata, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ImageObjectDetectionModelDeploymentMetadata to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ImageObjectDetectionModelDeploymentMetadata + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TextClassificationDatasetMetadata. */ + interface ITextClassificationDatasetMetadata { + + /** TextClassificationDatasetMetadata classificationType */ + classificationType?: (google.cloud.automl.v1beta1.ClassificationType|keyof typeof google.cloud.automl.v1beta1.ClassificationType|null); + } + + /** Represents a TextClassificationDatasetMetadata. */ + class TextClassificationDatasetMetadata implements ITextClassificationDatasetMetadata { + + /** + * Constructs a new TextClassificationDatasetMetadata. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.automl.v1beta1.ITextClassificationDatasetMetadata); + + /** TextClassificationDatasetMetadata classificationType. */ + public classificationType: (google.cloud.automl.v1beta1.ClassificationType|keyof typeof google.cloud.automl.v1beta1.ClassificationType); + + /** + * Creates a new TextClassificationDatasetMetadata instance using the specified properties. + * @param [properties] Properties to set + * @returns TextClassificationDatasetMetadata instance + */ + public static create(properties?: google.cloud.automl.v1beta1.ITextClassificationDatasetMetadata): google.cloud.automl.v1beta1.TextClassificationDatasetMetadata; + + /** + * Encodes the specified TextClassificationDatasetMetadata message. Does not implicitly {@link google.cloud.automl.v1beta1.TextClassificationDatasetMetadata.verify|verify} messages. + * @param message TextClassificationDatasetMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.automl.v1beta1.ITextClassificationDatasetMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified TextClassificationDatasetMetadata message, length delimited. Does not implicitly {@link google.cloud.automl.v1beta1.TextClassificationDatasetMetadata.verify|verify} messages. + * @param message TextClassificationDatasetMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.automl.v1beta1.ITextClassificationDatasetMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TextClassificationDatasetMetadata message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns TextClassificationDatasetMetadata + * @throws {Error} If the payload is not 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.automl.v1beta1.TextClassificationDatasetMetadata; + + /** + * Decodes a TextClassificationDatasetMetadata message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns TextClassificationDatasetMetadata + * @throws {Error} If the payload 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.automl.v1beta1.TextClassificationDatasetMetadata; + + /** + * Verifies a TextClassificationDatasetMetadata message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a TextClassificationDatasetMetadata message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns TextClassificationDatasetMetadata + */ + public static fromObject(object: { [k: string]: any }): google.cloud.automl.v1beta1.TextClassificationDatasetMetadata; + + /** + * Creates a plain object from a TextClassificationDatasetMetadata message. Also converts values to other types if specified. + * @param message TextClassificationDatasetMetadata + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.automl.v1beta1.TextClassificationDatasetMetadata, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this TextClassificationDatasetMetadata to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for TextClassificationDatasetMetadata + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TextClassificationModelMetadata. */ + interface ITextClassificationModelMetadata { + + /** TextClassificationModelMetadata classificationType */ + classificationType?: (google.cloud.automl.v1beta1.ClassificationType|keyof typeof google.cloud.automl.v1beta1.ClassificationType|null); + } + + /** Represents a TextClassificationModelMetadata. */ + class TextClassificationModelMetadata implements ITextClassificationModelMetadata { + + /** + * Constructs a new TextClassificationModelMetadata. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.automl.v1beta1.ITextClassificationModelMetadata); + + /** TextClassificationModelMetadata classificationType. */ + public classificationType: (google.cloud.automl.v1beta1.ClassificationType|keyof typeof google.cloud.automl.v1beta1.ClassificationType); + + /** + * Creates a new TextClassificationModelMetadata instance using the specified properties. + * @param [properties] Properties to set + * @returns TextClassificationModelMetadata instance + */ + public static create(properties?: google.cloud.automl.v1beta1.ITextClassificationModelMetadata): google.cloud.automl.v1beta1.TextClassificationModelMetadata; + + /** + * Encodes the specified TextClassificationModelMetadata message. Does not implicitly {@link google.cloud.automl.v1beta1.TextClassificationModelMetadata.verify|verify} messages. + * @param message TextClassificationModelMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.automl.v1beta1.ITextClassificationModelMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified TextClassificationModelMetadata message, length delimited. Does not implicitly {@link google.cloud.automl.v1beta1.TextClassificationModelMetadata.verify|verify} messages. + * @param message TextClassificationModelMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.automl.v1beta1.ITextClassificationModelMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TextClassificationModelMetadata message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns TextClassificationModelMetadata + * @throws {Error} If the payload is not 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.automl.v1beta1.TextClassificationModelMetadata; + + /** + * Decodes a TextClassificationModelMetadata message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns TextClassificationModelMetadata + * @throws {Error} If the payload 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.automl.v1beta1.TextClassificationModelMetadata; + + /** + * Verifies a TextClassificationModelMetadata message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a TextClassificationModelMetadata message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns TextClassificationModelMetadata + */ + public static fromObject(object: { [k: string]: any }): google.cloud.automl.v1beta1.TextClassificationModelMetadata; + + /** + * Creates a plain object from a TextClassificationModelMetadata message. Also converts values to other types if specified. + * @param message TextClassificationModelMetadata + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.automl.v1beta1.TextClassificationModelMetadata, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this TextClassificationModelMetadata to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for TextClassificationModelMetadata + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TextExtractionDatasetMetadata. */ + interface ITextExtractionDatasetMetadata { + } + + /** Represents a TextExtractionDatasetMetadata. */ + class TextExtractionDatasetMetadata implements ITextExtractionDatasetMetadata { + + /** + * Constructs a new TextExtractionDatasetMetadata. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.automl.v1beta1.ITextExtractionDatasetMetadata); + + /** + * Creates a new TextExtractionDatasetMetadata instance using the specified properties. + * @param [properties] Properties to set + * @returns TextExtractionDatasetMetadata instance + */ + public static create(properties?: google.cloud.automl.v1beta1.ITextExtractionDatasetMetadata): google.cloud.automl.v1beta1.TextExtractionDatasetMetadata; + + /** + * Encodes the specified TextExtractionDatasetMetadata message. Does not implicitly {@link google.cloud.automl.v1beta1.TextExtractionDatasetMetadata.verify|verify} messages. + * @param message TextExtractionDatasetMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.automl.v1beta1.ITextExtractionDatasetMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified TextExtractionDatasetMetadata message, length delimited. Does not implicitly {@link google.cloud.automl.v1beta1.TextExtractionDatasetMetadata.verify|verify} messages. + * @param message TextExtractionDatasetMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.automl.v1beta1.ITextExtractionDatasetMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TextExtractionDatasetMetadata message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns TextExtractionDatasetMetadata + * @throws {Error} If the payload is not 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.automl.v1beta1.TextExtractionDatasetMetadata; + + /** + * Decodes a TextExtractionDatasetMetadata message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns TextExtractionDatasetMetadata + * @throws {Error} If the payload 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.automl.v1beta1.TextExtractionDatasetMetadata; + + /** + * Verifies a TextExtractionDatasetMetadata message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a TextExtractionDatasetMetadata message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns TextExtractionDatasetMetadata + */ + public static fromObject(object: { [k: string]: any }): google.cloud.automl.v1beta1.TextExtractionDatasetMetadata; + + /** + * Creates a plain object from a TextExtractionDatasetMetadata message. Also converts values to other types if specified. + * @param message TextExtractionDatasetMetadata + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.automl.v1beta1.TextExtractionDatasetMetadata, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this TextExtractionDatasetMetadata to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for TextExtractionDatasetMetadata + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TextExtractionModelMetadata. */ + interface ITextExtractionModelMetadata { + + /** TextExtractionModelMetadata modelHint */ + modelHint?: (string|null); + } + + /** Represents a TextExtractionModelMetadata. */ + class TextExtractionModelMetadata implements ITextExtractionModelMetadata { + + /** + * Constructs a new TextExtractionModelMetadata. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.automl.v1beta1.ITextExtractionModelMetadata); + + /** TextExtractionModelMetadata modelHint. */ + public modelHint: string; + + /** + * Creates a new TextExtractionModelMetadata instance using the specified properties. + * @param [properties] Properties to set + * @returns TextExtractionModelMetadata instance + */ + public static create(properties?: google.cloud.automl.v1beta1.ITextExtractionModelMetadata): google.cloud.automl.v1beta1.TextExtractionModelMetadata; + + /** + * Encodes the specified TextExtractionModelMetadata message. Does not implicitly {@link google.cloud.automl.v1beta1.TextExtractionModelMetadata.verify|verify} messages. + * @param message TextExtractionModelMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.automl.v1beta1.ITextExtractionModelMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified TextExtractionModelMetadata message, length delimited. Does not implicitly {@link google.cloud.automl.v1beta1.TextExtractionModelMetadata.verify|verify} messages. + * @param message TextExtractionModelMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.automl.v1beta1.ITextExtractionModelMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TextExtractionModelMetadata message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns TextExtractionModelMetadata + * @throws {Error} If the payload is not 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.automl.v1beta1.TextExtractionModelMetadata; + + /** + * Decodes a TextExtractionModelMetadata message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns TextExtractionModelMetadata + * @throws {Error} If the payload 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.automl.v1beta1.TextExtractionModelMetadata; + + /** + * Verifies a TextExtractionModelMetadata message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a TextExtractionModelMetadata message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns TextExtractionModelMetadata + */ + public static fromObject(object: { [k: string]: any }): google.cloud.automl.v1beta1.TextExtractionModelMetadata; + + /** + * Creates a plain object from a TextExtractionModelMetadata message. Also converts values to other types if specified. + * @param message TextExtractionModelMetadata + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.automl.v1beta1.TextExtractionModelMetadata, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this TextExtractionModelMetadata to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for TextExtractionModelMetadata + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TextSentimentDatasetMetadata. */ + interface ITextSentimentDatasetMetadata { + + /** TextSentimentDatasetMetadata sentimentMax */ + sentimentMax?: (number|null); + } + + /** Represents a TextSentimentDatasetMetadata. */ + class TextSentimentDatasetMetadata implements ITextSentimentDatasetMetadata { + + /** + * Constructs a new TextSentimentDatasetMetadata. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.automl.v1beta1.ITextSentimentDatasetMetadata); + + /** TextSentimentDatasetMetadata sentimentMax. */ + public sentimentMax: number; + + /** + * Creates a new TextSentimentDatasetMetadata instance using the specified properties. + * @param [properties] Properties to set + * @returns TextSentimentDatasetMetadata instance + */ + public static create(properties?: google.cloud.automl.v1beta1.ITextSentimentDatasetMetadata): google.cloud.automl.v1beta1.TextSentimentDatasetMetadata; + + /** + * Encodes the specified TextSentimentDatasetMetadata message. Does not implicitly {@link google.cloud.automl.v1beta1.TextSentimentDatasetMetadata.verify|verify} messages. + * @param message TextSentimentDatasetMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.automl.v1beta1.ITextSentimentDatasetMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified TextSentimentDatasetMetadata message, length delimited. Does not implicitly {@link google.cloud.automl.v1beta1.TextSentimentDatasetMetadata.verify|verify} messages. + * @param message TextSentimentDatasetMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.automl.v1beta1.ITextSentimentDatasetMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TextSentimentDatasetMetadata message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns TextSentimentDatasetMetadata + * @throws {Error} If the payload is not 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.automl.v1beta1.TextSentimentDatasetMetadata; + + /** + * Decodes a TextSentimentDatasetMetadata message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns TextSentimentDatasetMetadata + * @throws {Error} If the payload 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.automl.v1beta1.TextSentimentDatasetMetadata; + + /** + * Verifies a TextSentimentDatasetMetadata message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a TextSentimentDatasetMetadata message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns TextSentimentDatasetMetadata + */ + public static fromObject(object: { [k: string]: any }): google.cloud.automl.v1beta1.TextSentimentDatasetMetadata; + + /** + * Creates a plain object from a TextSentimentDatasetMetadata message. Also converts values to other types if specified. + * @param message TextSentimentDatasetMetadata + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.automl.v1beta1.TextSentimentDatasetMetadata, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this TextSentimentDatasetMetadata to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for TextSentimentDatasetMetadata + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TextSentimentModelMetadata. */ + interface ITextSentimentModelMetadata { + } + + /** Represents a TextSentimentModelMetadata. */ + class TextSentimentModelMetadata implements ITextSentimentModelMetadata { + + /** + * Constructs a new TextSentimentModelMetadata. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.automl.v1beta1.ITextSentimentModelMetadata); + + /** + * Creates a new TextSentimentModelMetadata instance using the specified properties. + * @param [properties] Properties to set + * @returns TextSentimentModelMetadata instance + */ + public static create(properties?: google.cloud.automl.v1beta1.ITextSentimentModelMetadata): google.cloud.automl.v1beta1.TextSentimentModelMetadata; + + /** + * Encodes the specified TextSentimentModelMetadata message. Does not implicitly {@link google.cloud.automl.v1beta1.TextSentimentModelMetadata.verify|verify} messages. + * @param message TextSentimentModelMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.automl.v1beta1.ITextSentimentModelMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified TextSentimentModelMetadata message, length delimited. Does not implicitly {@link google.cloud.automl.v1beta1.TextSentimentModelMetadata.verify|verify} messages. + * @param message TextSentimentModelMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.automl.v1beta1.ITextSentimentModelMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TextSentimentModelMetadata message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns TextSentimentModelMetadata + * @throws {Error} If the payload is not 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.automl.v1beta1.TextSentimentModelMetadata; + + /** + * Decodes a TextSentimentModelMetadata message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns TextSentimentModelMetadata + * @throws {Error} If the payload 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.automl.v1beta1.TextSentimentModelMetadata; + + /** + * Verifies a TextSentimentModelMetadata message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a TextSentimentModelMetadata message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns TextSentimentModelMetadata + */ + public static fromObject(object: { [k: string]: any }): google.cloud.automl.v1beta1.TextSentimentModelMetadata; + + /** + * Creates a plain object from a TextSentimentModelMetadata message. Also converts values to other types if specified. + * @param message TextSentimentModelMetadata + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.automl.v1beta1.TextSentimentModelMetadata, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this TextSentimentModelMetadata to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for TextSentimentModelMetadata + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a VideoClassificationDatasetMetadata. */ + interface IVideoClassificationDatasetMetadata { + } + + /** Represents a VideoClassificationDatasetMetadata. */ + class VideoClassificationDatasetMetadata implements IVideoClassificationDatasetMetadata { + + /** + * Constructs a new VideoClassificationDatasetMetadata. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.automl.v1beta1.IVideoClassificationDatasetMetadata); + + /** + * Creates a new VideoClassificationDatasetMetadata instance using the specified properties. + * @param [properties] Properties to set + * @returns VideoClassificationDatasetMetadata instance + */ + public static create(properties?: google.cloud.automl.v1beta1.IVideoClassificationDatasetMetadata): google.cloud.automl.v1beta1.VideoClassificationDatasetMetadata; + + /** + * Encodes the specified VideoClassificationDatasetMetadata message. Does not implicitly {@link google.cloud.automl.v1beta1.VideoClassificationDatasetMetadata.verify|verify} messages. + * @param message VideoClassificationDatasetMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.automl.v1beta1.IVideoClassificationDatasetMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified VideoClassificationDatasetMetadata message, length delimited. Does not implicitly {@link google.cloud.automl.v1beta1.VideoClassificationDatasetMetadata.verify|verify} messages. + * @param message VideoClassificationDatasetMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.automl.v1beta1.IVideoClassificationDatasetMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a VideoClassificationDatasetMetadata message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns VideoClassificationDatasetMetadata + * @throws {Error} If the payload is not 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.automl.v1beta1.VideoClassificationDatasetMetadata; + + /** + * Decodes a VideoClassificationDatasetMetadata message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns VideoClassificationDatasetMetadata + * @throws {Error} If the payload 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.automl.v1beta1.VideoClassificationDatasetMetadata; + + /** + * Verifies a VideoClassificationDatasetMetadata message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a VideoClassificationDatasetMetadata message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns VideoClassificationDatasetMetadata + */ + public static fromObject(object: { [k: string]: any }): google.cloud.automl.v1beta1.VideoClassificationDatasetMetadata; + + /** + * Creates a plain object from a VideoClassificationDatasetMetadata message. Also converts values to other types if specified. + * @param message VideoClassificationDatasetMetadata + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.automl.v1beta1.VideoClassificationDatasetMetadata, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this VideoClassificationDatasetMetadata to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for VideoClassificationDatasetMetadata + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a VideoObjectTrackingDatasetMetadata. */ + interface IVideoObjectTrackingDatasetMetadata { + } + + /** Represents a VideoObjectTrackingDatasetMetadata. */ + class VideoObjectTrackingDatasetMetadata implements IVideoObjectTrackingDatasetMetadata { + + /** + * Constructs a new VideoObjectTrackingDatasetMetadata. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.automl.v1beta1.IVideoObjectTrackingDatasetMetadata); + + /** + * Creates a new VideoObjectTrackingDatasetMetadata instance using the specified properties. + * @param [properties] Properties to set + * @returns VideoObjectTrackingDatasetMetadata instance + */ + public static create(properties?: google.cloud.automl.v1beta1.IVideoObjectTrackingDatasetMetadata): google.cloud.automl.v1beta1.VideoObjectTrackingDatasetMetadata; + + /** + * Encodes the specified VideoObjectTrackingDatasetMetadata message. Does not implicitly {@link google.cloud.automl.v1beta1.VideoObjectTrackingDatasetMetadata.verify|verify} messages. + * @param message VideoObjectTrackingDatasetMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.automl.v1beta1.IVideoObjectTrackingDatasetMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified VideoObjectTrackingDatasetMetadata message, length delimited. Does not implicitly {@link google.cloud.automl.v1beta1.VideoObjectTrackingDatasetMetadata.verify|verify} messages. + * @param message VideoObjectTrackingDatasetMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.automl.v1beta1.IVideoObjectTrackingDatasetMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a VideoObjectTrackingDatasetMetadata message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns VideoObjectTrackingDatasetMetadata + * @throws {Error} If the payload is not 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.automl.v1beta1.VideoObjectTrackingDatasetMetadata; + + /** + * Decodes a VideoObjectTrackingDatasetMetadata message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns VideoObjectTrackingDatasetMetadata + * @throws {Error} If the payload 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.automl.v1beta1.VideoObjectTrackingDatasetMetadata; + + /** + * Verifies a VideoObjectTrackingDatasetMetadata message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a VideoObjectTrackingDatasetMetadata message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns VideoObjectTrackingDatasetMetadata + */ + public static fromObject(object: { [k: string]: any }): google.cloud.automl.v1beta1.VideoObjectTrackingDatasetMetadata; + + /** + * Creates a plain object from a VideoObjectTrackingDatasetMetadata message. Also converts values to other types if specified. + * @param message VideoObjectTrackingDatasetMetadata + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.automl.v1beta1.VideoObjectTrackingDatasetMetadata, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this VideoObjectTrackingDatasetMetadata to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for VideoObjectTrackingDatasetMetadata + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a VideoClassificationModelMetadata. */ + interface IVideoClassificationModelMetadata { + } + + /** Represents a VideoClassificationModelMetadata. */ + class VideoClassificationModelMetadata implements IVideoClassificationModelMetadata { + + /** + * Constructs a new VideoClassificationModelMetadata. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.automl.v1beta1.IVideoClassificationModelMetadata); + + /** + * Creates a new VideoClassificationModelMetadata instance using the specified properties. + * @param [properties] Properties to set + * @returns VideoClassificationModelMetadata instance + */ + public static create(properties?: google.cloud.automl.v1beta1.IVideoClassificationModelMetadata): google.cloud.automl.v1beta1.VideoClassificationModelMetadata; + + /** + * Encodes the specified VideoClassificationModelMetadata message. Does not implicitly {@link google.cloud.automl.v1beta1.VideoClassificationModelMetadata.verify|verify} messages. + * @param message VideoClassificationModelMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.automl.v1beta1.IVideoClassificationModelMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified VideoClassificationModelMetadata message, length delimited. Does not implicitly {@link google.cloud.automl.v1beta1.VideoClassificationModelMetadata.verify|verify} messages. + * @param message VideoClassificationModelMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.automl.v1beta1.IVideoClassificationModelMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a VideoClassificationModelMetadata message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns VideoClassificationModelMetadata + * @throws {Error} If the payload is not 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.automl.v1beta1.VideoClassificationModelMetadata; + + /** + * Decodes a VideoClassificationModelMetadata message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns VideoClassificationModelMetadata + * @throws {Error} If the payload 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.automl.v1beta1.VideoClassificationModelMetadata; + + /** + * Verifies a VideoClassificationModelMetadata message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a VideoClassificationModelMetadata message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns VideoClassificationModelMetadata + */ + public static fromObject(object: { [k: string]: any }): google.cloud.automl.v1beta1.VideoClassificationModelMetadata; + + /** + * Creates a plain object from a VideoClassificationModelMetadata message. Also converts values to other types if specified. + * @param message VideoClassificationModelMetadata + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.automl.v1beta1.VideoClassificationModelMetadata, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this VideoClassificationModelMetadata to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for VideoClassificationModelMetadata + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a VideoObjectTrackingModelMetadata. */ + interface IVideoObjectTrackingModelMetadata { + } + + /** Represents a VideoObjectTrackingModelMetadata. */ + class VideoObjectTrackingModelMetadata implements IVideoObjectTrackingModelMetadata { + + /** + * Constructs a new VideoObjectTrackingModelMetadata. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.automl.v1beta1.IVideoObjectTrackingModelMetadata); + + /** + * Creates a new VideoObjectTrackingModelMetadata instance using the specified properties. + * @param [properties] Properties to set + * @returns VideoObjectTrackingModelMetadata instance + */ + public static create(properties?: google.cloud.automl.v1beta1.IVideoObjectTrackingModelMetadata): google.cloud.automl.v1beta1.VideoObjectTrackingModelMetadata; + + /** + * Encodes the specified VideoObjectTrackingModelMetadata message. Does not implicitly {@link google.cloud.automl.v1beta1.VideoObjectTrackingModelMetadata.verify|verify} messages. + * @param message VideoObjectTrackingModelMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.automl.v1beta1.IVideoObjectTrackingModelMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified VideoObjectTrackingModelMetadata message, length delimited. Does not implicitly {@link google.cloud.automl.v1beta1.VideoObjectTrackingModelMetadata.verify|verify} messages. + * @param message VideoObjectTrackingModelMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.automl.v1beta1.IVideoObjectTrackingModelMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a VideoObjectTrackingModelMetadata message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns VideoObjectTrackingModelMetadata + * @throws {Error} If the payload is not 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.automl.v1beta1.VideoObjectTrackingModelMetadata; + + /** + * Decodes a VideoObjectTrackingModelMetadata message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns VideoObjectTrackingModelMetadata + * @throws {Error} If the payload 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.automl.v1beta1.VideoObjectTrackingModelMetadata; + + /** + * Verifies a VideoObjectTrackingModelMetadata message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a VideoObjectTrackingModelMetadata message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns VideoObjectTrackingModelMetadata + */ + public static fromObject(object: { [k: string]: any }): google.cloud.automl.v1beta1.VideoObjectTrackingModelMetadata; + + /** + * Creates a plain object from a VideoObjectTrackingModelMetadata message. Also converts values to other types if specified. + * @param message VideoObjectTrackingModelMetadata + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.automl.v1beta1.VideoObjectTrackingModelMetadata, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this VideoObjectTrackingModelMetadata to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for VideoObjectTrackingModelMetadata + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Model. */ + interface IModel { + + /** Model translationModelMetadata */ + translationModelMetadata?: (google.cloud.automl.v1beta1.ITranslationModelMetadata|null); + + /** Model imageClassificationModelMetadata */ + imageClassificationModelMetadata?: (google.cloud.automl.v1beta1.IImageClassificationModelMetadata|null); + + /** Model textClassificationModelMetadata */ + textClassificationModelMetadata?: (google.cloud.automl.v1beta1.ITextClassificationModelMetadata|null); + + /** Model imageObjectDetectionModelMetadata */ + imageObjectDetectionModelMetadata?: (google.cloud.automl.v1beta1.IImageObjectDetectionModelMetadata|null); + + /** Model videoClassificationModelMetadata */ + videoClassificationModelMetadata?: (google.cloud.automl.v1beta1.IVideoClassificationModelMetadata|null); + + /** Model videoObjectTrackingModelMetadata */ + videoObjectTrackingModelMetadata?: (google.cloud.automl.v1beta1.IVideoObjectTrackingModelMetadata|null); + + /** Model textExtractionModelMetadata */ + textExtractionModelMetadata?: (google.cloud.automl.v1beta1.ITextExtractionModelMetadata|null); + + /** Model tablesModelMetadata */ + tablesModelMetadata?: (google.cloud.automl.v1beta1.ITablesModelMetadata|null); + + /** Model textSentimentModelMetadata */ + textSentimentModelMetadata?: (google.cloud.automl.v1beta1.ITextSentimentModelMetadata|null); + + /** Model name */ + name?: (string|null); + + /** Model displayName */ + displayName?: (string|null); + + /** Model datasetId */ + datasetId?: (string|null); + + /** Model createTime */ + createTime?: (google.protobuf.ITimestamp|null); + + /** Model updateTime */ + updateTime?: (google.protobuf.ITimestamp|null); + + /** Model deploymentState */ + deploymentState?: (google.cloud.automl.v1beta1.Model.DeploymentState|keyof typeof google.cloud.automl.v1beta1.Model.DeploymentState|null); + } + + /** Represents a Model. */ + class Model implements IModel { + + /** + * Constructs a new Model. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.automl.v1beta1.IModel); + + /** Model translationModelMetadata. */ + public translationModelMetadata?: (google.cloud.automl.v1beta1.ITranslationModelMetadata|null); + + /** Model imageClassificationModelMetadata. */ + public imageClassificationModelMetadata?: (google.cloud.automl.v1beta1.IImageClassificationModelMetadata|null); + + /** Model textClassificationModelMetadata. */ + public textClassificationModelMetadata?: (google.cloud.automl.v1beta1.ITextClassificationModelMetadata|null); + + /** Model imageObjectDetectionModelMetadata. */ + public imageObjectDetectionModelMetadata?: (google.cloud.automl.v1beta1.IImageObjectDetectionModelMetadata|null); + + /** Model videoClassificationModelMetadata. */ + public videoClassificationModelMetadata?: (google.cloud.automl.v1beta1.IVideoClassificationModelMetadata|null); + + /** Model videoObjectTrackingModelMetadata. */ + public videoObjectTrackingModelMetadata?: (google.cloud.automl.v1beta1.IVideoObjectTrackingModelMetadata|null); + + /** Model textExtractionModelMetadata. */ + public textExtractionModelMetadata?: (google.cloud.automl.v1beta1.ITextExtractionModelMetadata|null); + + /** Model tablesModelMetadata. */ + public tablesModelMetadata?: (google.cloud.automl.v1beta1.ITablesModelMetadata|null); + + /** Model textSentimentModelMetadata. */ + public textSentimentModelMetadata?: (google.cloud.automl.v1beta1.ITextSentimentModelMetadata|null); + + /** Model name. */ + public name: string; + + /** Model displayName. */ + public displayName: string; + + /** Model datasetId. */ + public datasetId: string; + + /** Model createTime. */ + public createTime?: (google.protobuf.ITimestamp|null); + + /** Model updateTime. */ + public updateTime?: (google.protobuf.ITimestamp|null); + + /** Model deploymentState. */ + public deploymentState: (google.cloud.automl.v1beta1.Model.DeploymentState|keyof typeof google.cloud.automl.v1beta1.Model.DeploymentState); + + /** Model modelMetadata. */ + public modelMetadata?: ("translationModelMetadata"|"imageClassificationModelMetadata"|"textClassificationModelMetadata"|"imageObjectDetectionModelMetadata"|"videoClassificationModelMetadata"|"videoObjectTrackingModelMetadata"|"textExtractionModelMetadata"|"tablesModelMetadata"|"textSentimentModelMetadata"); + + /** + * Creates a new Model instance using the specified properties. + * @param [properties] Properties to set + * @returns Model instance + */ + public static create(properties?: google.cloud.automl.v1beta1.IModel): google.cloud.automl.v1beta1.Model; + + /** + * Encodes the specified Model message. Does not implicitly {@link google.cloud.automl.v1beta1.Model.verify|verify} messages. + * @param message Model message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.automl.v1beta1.IModel, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Model message, length delimited. Does not implicitly {@link google.cloud.automl.v1beta1.Model.verify|verify} messages. + * @param message Model message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.automl.v1beta1.IModel, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Model message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Model + * @throws {Error} If the payload is not 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.automl.v1beta1.Model; + + /** + * Decodes a Model message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Model + * @throws {Error} If the payload 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.automl.v1beta1.Model; + + /** + * Verifies a Model message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Model message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Model + */ + public static fromObject(object: { [k: string]: any }): google.cloud.automl.v1beta1.Model; + + /** + * Creates a plain object from a Model message. Also converts values to other types if specified. + * @param message Model + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.automl.v1beta1.Model, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Model to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Model + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace Model { + + /** DeploymentState enum. */ + enum DeploymentState { + DEPLOYMENT_STATE_UNSPECIFIED = 0, + DEPLOYED = 1, + UNDEPLOYED = 2 + } + } + + /** Properties of a ModelEvaluation. */ + interface IModelEvaluation { + + /** ModelEvaluation classificationEvaluationMetrics */ + classificationEvaluationMetrics?: (google.cloud.automl.v1beta1.IClassificationEvaluationMetrics|null); + + /** ModelEvaluation regressionEvaluationMetrics */ + regressionEvaluationMetrics?: (google.cloud.automl.v1beta1.IRegressionEvaluationMetrics|null); + + /** ModelEvaluation translationEvaluationMetrics */ + translationEvaluationMetrics?: (google.cloud.automl.v1beta1.ITranslationEvaluationMetrics|null); + + /** ModelEvaluation imageObjectDetectionEvaluationMetrics */ + imageObjectDetectionEvaluationMetrics?: (google.cloud.automl.v1beta1.IImageObjectDetectionEvaluationMetrics|null); + + /** ModelEvaluation videoObjectTrackingEvaluationMetrics */ + videoObjectTrackingEvaluationMetrics?: (google.cloud.automl.v1beta1.IVideoObjectTrackingEvaluationMetrics|null); + + /** ModelEvaluation textSentimentEvaluationMetrics */ + textSentimentEvaluationMetrics?: (google.cloud.automl.v1beta1.ITextSentimentEvaluationMetrics|null); + + /** ModelEvaluation textExtractionEvaluationMetrics */ + textExtractionEvaluationMetrics?: (google.cloud.automl.v1beta1.ITextExtractionEvaluationMetrics|null); + + /** ModelEvaluation name */ + name?: (string|null); + + /** ModelEvaluation annotationSpecId */ + annotationSpecId?: (string|null); + + /** ModelEvaluation displayName */ + displayName?: (string|null); + + /** ModelEvaluation createTime */ + createTime?: (google.protobuf.ITimestamp|null); + + /** ModelEvaluation evaluatedExampleCount */ + evaluatedExampleCount?: (number|null); + } + + /** Represents a ModelEvaluation. */ + class ModelEvaluation implements IModelEvaluation { + + /** + * Constructs a new ModelEvaluation. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.automl.v1beta1.IModelEvaluation); + + /** ModelEvaluation classificationEvaluationMetrics. */ + public classificationEvaluationMetrics?: (google.cloud.automl.v1beta1.IClassificationEvaluationMetrics|null); + + /** ModelEvaluation regressionEvaluationMetrics. */ + public regressionEvaluationMetrics?: (google.cloud.automl.v1beta1.IRegressionEvaluationMetrics|null); + + /** ModelEvaluation translationEvaluationMetrics. */ + public translationEvaluationMetrics?: (google.cloud.automl.v1beta1.ITranslationEvaluationMetrics|null); + + /** ModelEvaluation imageObjectDetectionEvaluationMetrics. */ + public imageObjectDetectionEvaluationMetrics?: (google.cloud.automl.v1beta1.IImageObjectDetectionEvaluationMetrics|null); + + /** ModelEvaluation videoObjectTrackingEvaluationMetrics. */ + public videoObjectTrackingEvaluationMetrics?: (google.cloud.automl.v1beta1.IVideoObjectTrackingEvaluationMetrics|null); + + /** ModelEvaluation textSentimentEvaluationMetrics. */ + public textSentimentEvaluationMetrics?: (google.cloud.automl.v1beta1.ITextSentimentEvaluationMetrics|null); + + /** ModelEvaluation textExtractionEvaluationMetrics. */ + public textExtractionEvaluationMetrics?: (google.cloud.automl.v1beta1.ITextExtractionEvaluationMetrics|null); + + /** ModelEvaluation name. */ + public name: string; + + /** ModelEvaluation annotationSpecId. */ + public annotationSpecId: string; + + /** ModelEvaluation displayName. */ + public displayName: string; + + /** ModelEvaluation createTime. */ + public createTime?: (google.protobuf.ITimestamp|null); + + /** ModelEvaluation evaluatedExampleCount. */ + public evaluatedExampleCount: number; + + /** ModelEvaluation metrics. */ + public metrics?: ("classificationEvaluationMetrics"|"regressionEvaluationMetrics"|"translationEvaluationMetrics"|"imageObjectDetectionEvaluationMetrics"|"videoObjectTrackingEvaluationMetrics"|"textSentimentEvaluationMetrics"|"textExtractionEvaluationMetrics"); + + /** + * Creates a new ModelEvaluation instance using the specified properties. + * @param [properties] Properties to set + * @returns ModelEvaluation instance + */ + public static create(properties?: google.cloud.automl.v1beta1.IModelEvaluation): google.cloud.automl.v1beta1.ModelEvaluation; + + /** + * Encodes the specified ModelEvaluation message. Does not implicitly {@link google.cloud.automl.v1beta1.ModelEvaluation.verify|verify} messages. + * @param message ModelEvaluation message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.automl.v1beta1.IModelEvaluation, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ModelEvaluation message, length delimited. Does not implicitly {@link google.cloud.automl.v1beta1.ModelEvaluation.verify|verify} messages. + * @param message ModelEvaluation message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.automl.v1beta1.IModelEvaluation, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ModelEvaluation message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ModelEvaluation + * @throws {Error} If the payload is not 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.automl.v1beta1.ModelEvaluation; + + /** + * Decodes a ModelEvaluation message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ModelEvaluation + * @throws {Error} If the payload 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.automl.v1beta1.ModelEvaluation; + + /** + * Verifies a ModelEvaluation message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ModelEvaluation message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ModelEvaluation + */ + public static fromObject(object: { [k: string]: any }): google.cloud.automl.v1beta1.ModelEvaluation; + + /** + * Creates a plain object from a ModelEvaluation message. Also converts values to other types if specified. + * @param message ModelEvaluation + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.automl.v1beta1.ModelEvaluation, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ModelEvaluation to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ModelEvaluation + * @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 deleteDetails */ + deleteDetails?: (google.cloud.automl.v1beta1.IDeleteOperationMetadata|null); + + /** OperationMetadata deployModelDetails */ + deployModelDetails?: (google.cloud.automl.v1beta1.IDeployModelOperationMetadata|null); + + /** OperationMetadata undeployModelDetails */ + undeployModelDetails?: (google.cloud.automl.v1beta1.IUndeployModelOperationMetadata|null); + + /** OperationMetadata createModelDetails */ + createModelDetails?: (google.cloud.automl.v1beta1.ICreateModelOperationMetadata|null); + + /** OperationMetadata importDataDetails */ + importDataDetails?: (google.cloud.automl.v1beta1.IImportDataOperationMetadata|null); + + /** OperationMetadata batchPredictDetails */ + batchPredictDetails?: (google.cloud.automl.v1beta1.IBatchPredictOperationMetadata|null); + + /** OperationMetadata exportDataDetails */ + exportDataDetails?: (google.cloud.automl.v1beta1.IExportDataOperationMetadata|null); + + /** OperationMetadata exportModelDetails */ + exportModelDetails?: (google.cloud.automl.v1beta1.IExportModelOperationMetadata|null); + + /** OperationMetadata exportEvaluatedExamplesDetails */ + exportEvaluatedExamplesDetails?: (google.cloud.automl.v1beta1.IExportEvaluatedExamplesOperationMetadata|null); + + /** OperationMetadata progressPercent */ + progressPercent?: (number|null); + + /** OperationMetadata partialFailures */ + partialFailures?: (google.rpc.IStatus[]|null); + + /** OperationMetadata createTime */ + createTime?: (google.protobuf.ITimestamp|null); + + /** OperationMetadata updateTime */ + updateTime?: (google.protobuf.ITimestamp|null); + } + + /** Represents an OperationMetadata. */ + class OperationMetadata implements IOperationMetadata { + + /** + * Constructs a new OperationMetadata. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.automl.v1beta1.IOperationMetadata); + + /** OperationMetadata deleteDetails. */ + public deleteDetails?: (google.cloud.automl.v1beta1.IDeleteOperationMetadata|null); + + /** OperationMetadata deployModelDetails. */ + public deployModelDetails?: (google.cloud.automl.v1beta1.IDeployModelOperationMetadata|null); + + /** OperationMetadata undeployModelDetails. */ + public undeployModelDetails?: (google.cloud.automl.v1beta1.IUndeployModelOperationMetadata|null); + + /** OperationMetadata createModelDetails. */ + public createModelDetails?: (google.cloud.automl.v1beta1.ICreateModelOperationMetadata|null); + + /** OperationMetadata importDataDetails. */ + public importDataDetails?: (google.cloud.automl.v1beta1.IImportDataOperationMetadata|null); + + /** OperationMetadata batchPredictDetails. */ + public batchPredictDetails?: (google.cloud.automl.v1beta1.IBatchPredictOperationMetadata|null); + + /** OperationMetadata exportDataDetails. */ + public exportDataDetails?: (google.cloud.automl.v1beta1.IExportDataOperationMetadata|null); + + /** OperationMetadata exportModelDetails. */ + public exportModelDetails?: (google.cloud.automl.v1beta1.IExportModelOperationMetadata|null); + + /** OperationMetadata exportEvaluatedExamplesDetails. */ + public exportEvaluatedExamplesDetails?: (google.cloud.automl.v1beta1.IExportEvaluatedExamplesOperationMetadata|null); + + /** OperationMetadata progressPercent. */ + public progressPercent: number; + + /** OperationMetadata partialFailures. */ + public partialFailures: google.rpc.IStatus[]; + + /** OperationMetadata createTime. */ + public createTime?: (google.protobuf.ITimestamp|null); + + /** OperationMetadata updateTime. */ + public updateTime?: (google.protobuf.ITimestamp|null); + + /** OperationMetadata details. */ + public details?: ("deleteDetails"|"deployModelDetails"|"undeployModelDetails"|"createModelDetails"|"importDataDetails"|"batchPredictDetails"|"exportDataDetails"|"exportModelDetails"|"exportEvaluatedExamplesDetails"); + + /** + * Creates a new OperationMetadata instance using the specified properties. + * @param [properties] Properties to set + * @returns OperationMetadata instance + */ + public static create(properties?: google.cloud.automl.v1beta1.IOperationMetadata): google.cloud.automl.v1beta1.OperationMetadata; + + /** + * Encodes the specified OperationMetadata message. Does not implicitly {@link google.cloud.automl.v1beta1.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.automl.v1beta1.IOperationMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified OperationMetadata message, length delimited. Does not implicitly {@link google.cloud.automl.v1beta1.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.automl.v1beta1.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.automl.v1beta1.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.automl.v1beta1.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.automl.v1beta1.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.automl.v1beta1.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 DeleteOperationMetadata. */ + interface IDeleteOperationMetadata { + } + + /** Represents a DeleteOperationMetadata. */ + class DeleteOperationMetadata implements IDeleteOperationMetadata { + + /** + * Constructs a new DeleteOperationMetadata. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.automl.v1beta1.IDeleteOperationMetadata); + + /** + * Creates a new DeleteOperationMetadata instance using the specified properties. + * @param [properties] Properties to set + * @returns DeleteOperationMetadata instance + */ + public static create(properties?: google.cloud.automl.v1beta1.IDeleteOperationMetadata): google.cloud.automl.v1beta1.DeleteOperationMetadata; + + /** + * Encodes the specified DeleteOperationMetadata message. Does not implicitly {@link google.cloud.automl.v1beta1.DeleteOperationMetadata.verify|verify} messages. + * @param message DeleteOperationMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.automl.v1beta1.IDeleteOperationMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DeleteOperationMetadata message, length delimited. Does not implicitly {@link google.cloud.automl.v1beta1.DeleteOperationMetadata.verify|verify} messages. + * @param message DeleteOperationMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.automl.v1beta1.IDeleteOperationMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DeleteOperationMetadata message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DeleteOperationMetadata + * @throws {Error} If the payload is not 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.automl.v1beta1.DeleteOperationMetadata; + + /** + * Decodes a DeleteOperationMetadata message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DeleteOperationMetadata + * @throws {Error} If the payload 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.automl.v1beta1.DeleteOperationMetadata; + + /** + * Verifies a DeleteOperationMetadata message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DeleteOperationMetadata message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DeleteOperationMetadata + */ + public static fromObject(object: { [k: string]: any }): google.cloud.automl.v1beta1.DeleteOperationMetadata; + + /** + * Creates a plain object from a DeleteOperationMetadata message. Also converts values to other types if specified. + * @param message DeleteOperationMetadata + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.automl.v1beta1.DeleteOperationMetadata, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DeleteOperationMetadata to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DeleteOperationMetadata + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a DeployModelOperationMetadata. */ + interface IDeployModelOperationMetadata { + } + + /** Represents a DeployModelOperationMetadata. */ + class DeployModelOperationMetadata implements IDeployModelOperationMetadata { + + /** + * Constructs a new DeployModelOperationMetadata. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.automl.v1beta1.IDeployModelOperationMetadata); + + /** + * Creates a new DeployModelOperationMetadata instance using the specified properties. + * @param [properties] Properties to set + * @returns DeployModelOperationMetadata instance + */ + public static create(properties?: google.cloud.automl.v1beta1.IDeployModelOperationMetadata): google.cloud.automl.v1beta1.DeployModelOperationMetadata; + + /** + * Encodes the specified DeployModelOperationMetadata message. Does not implicitly {@link google.cloud.automl.v1beta1.DeployModelOperationMetadata.verify|verify} messages. + * @param message DeployModelOperationMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.automl.v1beta1.IDeployModelOperationMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DeployModelOperationMetadata message, length delimited. Does not implicitly {@link google.cloud.automl.v1beta1.DeployModelOperationMetadata.verify|verify} messages. + * @param message DeployModelOperationMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.automl.v1beta1.IDeployModelOperationMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DeployModelOperationMetadata message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DeployModelOperationMetadata + * @throws {Error} If the payload is not 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.automl.v1beta1.DeployModelOperationMetadata; + + /** + * Decodes a DeployModelOperationMetadata message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DeployModelOperationMetadata + * @throws {Error} If the payload 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.automl.v1beta1.DeployModelOperationMetadata; + + /** + * Verifies a DeployModelOperationMetadata message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DeployModelOperationMetadata message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DeployModelOperationMetadata + */ + public static fromObject(object: { [k: string]: any }): google.cloud.automl.v1beta1.DeployModelOperationMetadata; + + /** + * Creates a plain object from a DeployModelOperationMetadata message. Also converts values to other types if specified. + * @param message DeployModelOperationMetadata + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.automl.v1beta1.DeployModelOperationMetadata, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DeployModelOperationMetadata to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DeployModelOperationMetadata + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an UndeployModelOperationMetadata. */ + interface IUndeployModelOperationMetadata { + } + + /** Represents an UndeployModelOperationMetadata. */ + class UndeployModelOperationMetadata implements IUndeployModelOperationMetadata { + + /** + * Constructs a new UndeployModelOperationMetadata. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.automl.v1beta1.IUndeployModelOperationMetadata); + + /** + * Creates a new UndeployModelOperationMetadata instance using the specified properties. + * @param [properties] Properties to set + * @returns UndeployModelOperationMetadata instance + */ + public static create(properties?: google.cloud.automl.v1beta1.IUndeployModelOperationMetadata): google.cloud.automl.v1beta1.UndeployModelOperationMetadata; + + /** + * Encodes the specified UndeployModelOperationMetadata message. Does not implicitly {@link google.cloud.automl.v1beta1.UndeployModelOperationMetadata.verify|verify} messages. + * @param message UndeployModelOperationMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.automl.v1beta1.IUndeployModelOperationMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified UndeployModelOperationMetadata message, length delimited. Does not implicitly {@link google.cloud.automl.v1beta1.UndeployModelOperationMetadata.verify|verify} messages. + * @param message UndeployModelOperationMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.automl.v1beta1.IUndeployModelOperationMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an UndeployModelOperationMetadata message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns UndeployModelOperationMetadata + * @throws {Error} If the payload is not 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.automl.v1beta1.UndeployModelOperationMetadata; + + /** + * Decodes an UndeployModelOperationMetadata message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns UndeployModelOperationMetadata + * @throws {Error} If the payload 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.automl.v1beta1.UndeployModelOperationMetadata; + + /** + * Verifies an UndeployModelOperationMetadata message. + * @param message Plain 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 UndeployModelOperationMetadata message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns UndeployModelOperationMetadata + */ + public static fromObject(object: { [k: string]: any }): google.cloud.automl.v1beta1.UndeployModelOperationMetadata; + + /** + * Creates a plain object from an UndeployModelOperationMetadata message. Also converts values to other types if specified. + * @param message UndeployModelOperationMetadata + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.automl.v1beta1.UndeployModelOperationMetadata, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this UndeployModelOperationMetadata to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for UndeployModelOperationMetadata + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a CreateModelOperationMetadata. */ + interface ICreateModelOperationMetadata { + } + + /** Represents a CreateModelOperationMetadata. */ + class CreateModelOperationMetadata implements ICreateModelOperationMetadata { + + /** + * Constructs a new CreateModelOperationMetadata. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.automl.v1beta1.ICreateModelOperationMetadata); + + /** + * Creates a new CreateModelOperationMetadata instance using the specified properties. + * @param [properties] Properties to set + * @returns CreateModelOperationMetadata instance + */ + public static create(properties?: google.cloud.automl.v1beta1.ICreateModelOperationMetadata): google.cloud.automl.v1beta1.CreateModelOperationMetadata; + + /** + * Encodes the specified CreateModelOperationMetadata message. Does not implicitly {@link google.cloud.automl.v1beta1.CreateModelOperationMetadata.verify|verify} messages. + * @param message CreateModelOperationMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.automl.v1beta1.ICreateModelOperationMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CreateModelOperationMetadata message, length delimited. Does not implicitly {@link google.cloud.automl.v1beta1.CreateModelOperationMetadata.verify|verify} messages. + * @param message CreateModelOperationMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.automl.v1beta1.ICreateModelOperationMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CreateModelOperationMetadata message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CreateModelOperationMetadata + * @throws {Error} If the payload is not 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.automl.v1beta1.CreateModelOperationMetadata; + + /** + * Decodes a CreateModelOperationMetadata message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CreateModelOperationMetadata + * @throws {Error} If the payload 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.automl.v1beta1.CreateModelOperationMetadata; + + /** + * Verifies a CreateModelOperationMetadata message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CreateModelOperationMetadata message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CreateModelOperationMetadata + */ + public static fromObject(object: { [k: string]: any }): google.cloud.automl.v1beta1.CreateModelOperationMetadata; + + /** + * Creates a plain object from a CreateModelOperationMetadata message. Also converts values to other types if specified. + * @param message CreateModelOperationMetadata + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.automl.v1beta1.CreateModelOperationMetadata, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CreateModelOperationMetadata to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CreateModelOperationMetadata + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an ImportDataOperationMetadata. */ + interface IImportDataOperationMetadata { + } + + /** Represents an ImportDataOperationMetadata. */ + class ImportDataOperationMetadata implements IImportDataOperationMetadata { + + /** + * Constructs a new ImportDataOperationMetadata. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.automl.v1beta1.IImportDataOperationMetadata); + + /** + * Creates a new ImportDataOperationMetadata instance using the specified properties. + * @param [properties] Properties to set + * @returns ImportDataOperationMetadata instance + */ + public static create(properties?: google.cloud.automl.v1beta1.IImportDataOperationMetadata): google.cloud.automl.v1beta1.ImportDataOperationMetadata; + + /** + * Encodes the specified ImportDataOperationMetadata message. Does not implicitly {@link google.cloud.automl.v1beta1.ImportDataOperationMetadata.verify|verify} messages. + * @param message ImportDataOperationMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.automl.v1beta1.IImportDataOperationMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ImportDataOperationMetadata message, length delimited. Does not implicitly {@link google.cloud.automl.v1beta1.ImportDataOperationMetadata.verify|verify} messages. + * @param message ImportDataOperationMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.automl.v1beta1.IImportDataOperationMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an ImportDataOperationMetadata message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ImportDataOperationMetadata + * @throws {Error} If the payload is not 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.automl.v1beta1.ImportDataOperationMetadata; + + /** + * Decodes an ImportDataOperationMetadata message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ImportDataOperationMetadata + * @throws {Error} If the payload 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.automl.v1beta1.ImportDataOperationMetadata; + + /** + * Verifies an ImportDataOperationMetadata message. + * @param message Plain 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 ImportDataOperationMetadata message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ImportDataOperationMetadata + */ + public static fromObject(object: { [k: string]: any }): google.cloud.automl.v1beta1.ImportDataOperationMetadata; + + /** + * Creates a plain object from an ImportDataOperationMetadata message. Also converts values to other types if specified. + * @param message ImportDataOperationMetadata + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.automl.v1beta1.ImportDataOperationMetadata, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ImportDataOperationMetadata to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ImportDataOperationMetadata + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an ExportDataOperationMetadata. */ + interface IExportDataOperationMetadata { + + /** ExportDataOperationMetadata outputInfo */ + outputInfo?: (google.cloud.automl.v1beta1.ExportDataOperationMetadata.IExportDataOutputInfo|null); + } + + /** Represents an ExportDataOperationMetadata. */ + class ExportDataOperationMetadata implements IExportDataOperationMetadata { + + /** + * Constructs a new ExportDataOperationMetadata. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.automl.v1beta1.IExportDataOperationMetadata); + + /** ExportDataOperationMetadata outputInfo. */ + public outputInfo?: (google.cloud.automl.v1beta1.ExportDataOperationMetadata.IExportDataOutputInfo|null); + + /** + * Creates a new ExportDataOperationMetadata instance using the specified properties. + * @param [properties] Properties to set + * @returns ExportDataOperationMetadata instance + */ + public static create(properties?: google.cloud.automl.v1beta1.IExportDataOperationMetadata): google.cloud.automl.v1beta1.ExportDataOperationMetadata; + + /** + * Encodes the specified ExportDataOperationMetadata message. Does not implicitly {@link google.cloud.automl.v1beta1.ExportDataOperationMetadata.verify|verify} messages. + * @param message ExportDataOperationMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.automl.v1beta1.IExportDataOperationMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ExportDataOperationMetadata message, length delimited. Does not implicitly {@link google.cloud.automl.v1beta1.ExportDataOperationMetadata.verify|verify} messages. + * @param message ExportDataOperationMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.automl.v1beta1.IExportDataOperationMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an ExportDataOperationMetadata message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ExportDataOperationMetadata + * @throws {Error} If the payload is not 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.automl.v1beta1.ExportDataOperationMetadata; + + /** + * Decodes an ExportDataOperationMetadata message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ExportDataOperationMetadata + * @throws {Error} If the payload 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.automl.v1beta1.ExportDataOperationMetadata; + + /** + * Verifies an ExportDataOperationMetadata message. + * @param message Plain 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 ExportDataOperationMetadata message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ExportDataOperationMetadata + */ + public static fromObject(object: { [k: string]: any }): google.cloud.automl.v1beta1.ExportDataOperationMetadata; + + /** + * Creates a plain object from an ExportDataOperationMetadata message. Also converts values to other types if specified. + * @param message ExportDataOperationMetadata + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.automl.v1beta1.ExportDataOperationMetadata, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ExportDataOperationMetadata to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ExportDataOperationMetadata + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace ExportDataOperationMetadata { + + /** Properties of an ExportDataOutputInfo. */ + interface IExportDataOutputInfo { + + /** ExportDataOutputInfo gcsOutputDirectory */ + gcsOutputDirectory?: (string|null); + + /** ExportDataOutputInfo bigqueryOutputDataset */ + bigqueryOutputDataset?: (string|null); + } + + /** Represents an ExportDataOutputInfo. */ + class ExportDataOutputInfo implements IExportDataOutputInfo { + + /** + * Constructs a new ExportDataOutputInfo. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.automl.v1beta1.ExportDataOperationMetadata.IExportDataOutputInfo); + + /** ExportDataOutputInfo gcsOutputDirectory. */ + public gcsOutputDirectory?: (string|null); + + /** ExportDataOutputInfo bigqueryOutputDataset. */ + public bigqueryOutputDataset?: (string|null); + + /** ExportDataOutputInfo outputLocation. */ + public outputLocation?: ("gcsOutputDirectory"|"bigqueryOutputDataset"); + + /** + * Creates a new ExportDataOutputInfo instance using the specified properties. + * @param [properties] Properties to set + * @returns ExportDataOutputInfo instance + */ + public static create(properties?: google.cloud.automl.v1beta1.ExportDataOperationMetadata.IExportDataOutputInfo): google.cloud.automl.v1beta1.ExportDataOperationMetadata.ExportDataOutputInfo; + + /** + * Encodes the specified ExportDataOutputInfo message. Does not implicitly {@link google.cloud.automl.v1beta1.ExportDataOperationMetadata.ExportDataOutputInfo.verify|verify} messages. + * @param message ExportDataOutputInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.automl.v1beta1.ExportDataOperationMetadata.IExportDataOutputInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ExportDataOutputInfo message, length delimited. Does not implicitly {@link google.cloud.automl.v1beta1.ExportDataOperationMetadata.ExportDataOutputInfo.verify|verify} messages. + * @param message ExportDataOutputInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.automl.v1beta1.ExportDataOperationMetadata.IExportDataOutputInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an ExportDataOutputInfo message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ExportDataOutputInfo + * @throws {Error} If the payload is not 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.automl.v1beta1.ExportDataOperationMetadata.ExportDataOutputInfo; + + /** + * Decodes an ExportDataOutputInfo message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ExportDataOutputInfo + * @throws {Error} If the payload 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.automl.v1beta1.ExportDataOperationMetadata.ExportDataOutputInfo; + + /** + * Verifies an ExportDataOutputInfo message. + * @param message Plain 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 ExportDataOutputInfo message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ExportDataOutputInfo + */ + public static fromObject(object: { [k: string]: any }): google.cloud.automl.v1beta1.ExportDataOperationMetadata.ExportDataOutputInfo; + + /** + * Creates a plain object from an ExportDataOutputInfo message. Also converts values to other types if specified. + * @param message ExportDataOutputInfo + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.automl.v1beta1.ExportDataOperationMetadata.ExportDataOutputInfo, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ExportDataOutputInfo to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ExportDataOutputInfo + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Properties of a BatchPredictOperationMetadata. */ + interface IBatchPredictOperationMetadata { + + /** BatchPredictOperationMetadata inputConfig */ + inputConfig?: (google.cloud.automl.v1beta1.IBatchPredictInputConfig|null); + + /** BatchPredictOperationMetadata outputInfo */ + outputInfo?: (google.cloud.automl.v1beta1.BatchPredictOperationMetadata.IBatchPredictOutputInfo|null); + } + + /** Represents a BatchPredictOperationMetadata. */ + class BatchPredictOperationMetadata implements IBatchPredictOperationMetadata { + + /** + * Constructs a new BatchPredictOperationMetadata. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.automl.v1beta1.IBatchPredictOperationMetadata); + + /** BatchPredictOperationMetadata inputConfig. */ + public inputConfig?: (google.cloud.automl.v1beta1.IBatchPredictInputConfig|null); + + /** BatchPredictOperationMetadata outputInfo. */ + public outputInfo?: (google.cloud.automl.v1beta1.BatchPredictOperationMetadata.IBatchPredictOutputInfo|null); + + /** + * Creates a new BatchPredictOperationMetadata instance using the specified properties. + * @param [properties] Properties to set + * @returns BatchPredictOperationMetadata instance + */ + public static create(properties?: google.cloud.automl.v1beta1.IBatchPredictOperationMetadata): google.cloud.automl.v1beta1.BatchPredictOperationMetadata; + + /** + * Encodes the specified BatchPredictOperationMetadata message. Does not implicitly {@link google.cloud.automl.v1beta1.BatchPredictOperationMetadata.verify|verify} messages. + * @param message BatchPredictOperationMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.automl.v1beta1.IBatchPredictOperationMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified BatchPredictOperationMetadata message, length delimited. Does not implicitly {@link google.cloud.automl.v1beta1.BatchPredictOperationMetadata.verify|verify} messages. + * @param message BatchPredictOperationMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.automl.v1beta1.IBatchPredictOperationMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a BatchPredictOperationMetadata message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns BatchPredictOperationMetadata + * @throws {Error} If the payload is not 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.automl.v1beta1.BatchPredictOperationMetadata; + + /** + * Decodes a BatchPredictOperationMetadata message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns BatchPredictOperationMetadata + * @throws {Error} If the payload 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.automl.v1beta1.BatchPredictOperationMetadata; + + /** + * Verifies a BatchPredictOperationMetadata message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a BatchPredictOperationMetadata message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns BatchPredictOperationMetadata + */ + public static fromObject(object: { [k: string]: any }): google.cloud.automl.v1beta1.BatchPredictOperationMetadata; + + /** + * Creates a plain object from a BatchPredictOperationMetadata message. Also converts values to other types if specified. + * @param message BatchPredictOperationMetadata + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.automl.v1beta1.BatchPredictOperationMetadata, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this BatchPredictOperationMetadata to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for BatchPredictOperationMetadata + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace BatchPredictOperationMetadata { + + /** Properties of a BatchPredictOutputInfo. */ + interface IBatchPredictOutputInfo { + + /** BatchPredictOutputInfo gcsOutputDirectory */ + gcsOutputDirectory?: (string|null); + + /** BatchPredictOutputInfo bigqueryOutputDataset */ + bigqueryOutputDataset?: (string|null); + } + + /** Represents a BatchPredictOutputInfo. */ + class BatchPredictOutputInfo implements IBatchPredictOutputInfo { + + /** + * Constructs a new BatchPredictOutputInfo. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.automl.v1beta1.BatchPredictOperationMetadata.IBatchPredictOutputInfo); + + /** BatchPredictOutputInfo gcsOutputDirectory. */ + public gcsOutputDirectory?: (string|null); + + /** BatchPredictOutputInfo bigqueryOutputDataset. */ + public bigqueryOutputDataset?: (string|null); + + /** BatchPredictOutputInfo outputLocation. */ + public outputLocation?: ("gcsOutputDirectory"|"bigqueryOutputDataset"); + + /** + * Creates a new BatchPredictOutputInfo instance using the specified properties. + * @param [properties] Properties to set + * @returns BatchPredictOutputInfo instance + */ + public static create(properties?: google.cloud.automl.v1beta1.BatchPredictOperationMetadata.IBatchPredictOutputInfo): google.cloud.automl.v1beta1.BatchPredictOperationMetadata.BatchPredictOutputInfo; + + /** + * Encodes the specified BatchPredictOutputInfo message. Does not implicitly {@link google.cloud.automl.v1beta1.BatchPredictOperationMetadata.BatchPredictOutputInfo.verify|verify} messages. + * @param message BatchPredictOutputInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.automl.v1beta1.BatchPredictOperationMetadata.IBatchPredictOutputInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified BatchPredictOutputInfo message, length delimited. Does not implicitly {@link google.cloud.automl.v1beta1.BatchPredictOperationMetadata.BatchPredictOutputInfo.verify|verify} messages. + * @param message BatchPredictOutputInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.automl.v1beta1.BatchPredictOperationMetadata.IBatchPredictOutputInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a BatchPredictOutputInfo message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns BatchPredictOutputInfo + * @throws {Error} If the payload is not 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.automl.v1beta1.BatchPredictOperationMetadata.BatchPredictOutputInfo; + + /** + * Decodes a BatchPredictOutputInfo message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns BatchPredictOutputInfo + * @throws {Error} If the payload 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.automl.v1beta1.BatchPredictOperationMetadata.BatchPredictOutputInfo; + + /** + * Verifies a BatchPredictOutputInfo message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a BatchPredictOutputInfo message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns BatchPredictOutputInfo + */ + public static fromObject(object: { [k: string]: any }): google.cloud.automl.v1beta1.BatchPredictOperationMetadata.BatchPredictOutputInfo; + + /** + * Creates a plain object from a BatchPredictOutputInfo message. Also converts values to other types if specified. + * @param message BatchPredictOutputInfo + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.automl.v1beta1.BatchPredictOperationMetadata.BatchPredictOutputInfo, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this BatchPredictOutputInfo to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for BatchPredictOutputInfo + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Properties of an ExportModelOperationMetadata. */ + interface IExportModelOperationMetadata { + + /** ExportModelOperationMetadata outputInfo */ + outputInfo?: (google.cloud.automl.v1beta1.ExportModelOperationMetadata.IExportModelOutputInfo|null); + } + + /** Represents an ExportModelOperationMetadata. */ + class ExportModelOperationMetadata implements IExportModelOperationMetadata { + + /** + * Constructs a new ExportModelOperationMetadata. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.automl.v1beta1.IExportModelOperationMetadata); + + /** ExportModelOperationMetadata outputInfo. */ + public outputInfo?: (google.cloud.automl.v1beta1.ExportModelOperationMetadata.IExportModelOutputInfo|null); + + /** + * Creates a new ExportModelOperationMetadata instance using the specified properties. + * @param [properties] Properties to set + * @returns ExportModelOperationMetadata instance + */ + public static create(properties?: google.cloud.automl.v1beta1.IExportModelOperationMetadata): google.cloud.automl.v1beta1.ExportModelOperationMetadata; + + /** + * Encodes the specified ExportModelOperationMetadata message. Does not implicitly {@link google.cloud.automl.v1beta1.ExportModelOperationMetadata.verify|verify} messages. + * @param message ExportModelOperationMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.automl.v1beta1.IExportModelOperationMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ExportModelOperationMetadata message, length delimited. Does not implicitly {@link google.cloud.automl.v1beta1.ExportModelOperationMetadata.verify|verify} messages. + * @param message ExportModelOperationMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.automl.v1beta1.IExportModelOperationMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an ExportModelOperationMetadata message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ExportModelOperationMetadata + * @throws {Error} If the payload is not 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.automl.v1beta1.ExportModelOperationMetadata; + + /** + * Decodes an ExportModelOperationMetadata message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ExportModelOperationMetadata + * @throws {Error} If the payload 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.automl.v1beta1.ExportModelOperationMetadata; + + /** + * Verifies an ExportModelOperationMetadata message. + * @param message Plain 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 ExportModelOperationMetadata message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ExportModelOperationMetadata + */ + public static fromObject(object: { [k: string]: any }): google.cloud.automl.v1beta1.ExportModelOperationMetadata; + + /** + * Creates a plain object from an ExportModelOperationMetadata message. Also converts values to other types if specified. + * @param message ExportModelOperationMetadata + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.automl.v1beta1.ExportModelOperationMetadata, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ExportModelOperationMetadata to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ExportModelOperationMetadata + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace ExportModelOperationMetadata { + + /** Properties of an ExportModelOutputInfo. */ + interface IExportModelOutputInfo { + + /** ExportModelOutputInfo gcsOutputDirectory */ + gcsOutputDirectory?: (string|null); + } + + /** Represents an ExportModelOutputInfo. */ + class ExportModelOutputInfo implements IExportModelOutputInfo { + + /** + * Constructs a new ExportModelOutputInfo. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.automl.v1beta1.ExportModelOperationMetadata.IExportModelOutputInfo); + + /** ExportModelOutputInfo gcsOutputDirectory. */ + public gcsOutputDirectory: string; + + /** + * Creates a new ExportModelOutputInfo instance using the specified properties. + * @param [properties] Properties to set + * @returns ExportModelOutputInfo instance + */ + public static create(properties?: google.cloud.automl.v1beta1.ExportModelOperationMetadata.IExportModelOutputInfo): google.cloud.automl.v1beta1.ExportModelOperationMetadata.ExportModelOutputInfo; + + /** + * Encodes the specified ExportModelOutputInfo message. Does not implicitly {@link google.cloud.automl.v1beta1.ExportModelOperationMetadata.ExportModelOutputInfo.verify|verify} messages. + * @param message ExportModelOutputInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.automl.v1beta1.ExportModelOperationMetadata.IExportModelOutputInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ExportModelOutputInfo message, length delimited. Does not implicitly {@link google.cloud.automl.v1beta1.ExportModelOperationMetadata.ExportModelOutputInfo.verify|verify} messages. + * @param message ExportModelOutputInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.automl.v1beta1.ExportModelOperationMetadata.IExportModelOutputInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an ExportModelOutputInfo message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ExportModelOutputInfo + * @throws {Error} If the payload is not 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.automl.v1beta1.ExportModelOperationMetadata.ExportModelOutputInfo; + + /** + * Decodes an ExportModelOutputInfo message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ExportModelOutputInfo + * @throws {Error} If the payload 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.automl.v1beta1.ExportModelOperationMetadata.ExportModelOutputInfo; + + /** + * Verifies an ExportModelOutputInfo message. + * @param message Plain 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 ExportModelOutputInfo message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ExportModelOutputInfo + */ + public static fromObject(object: { [k: string]: any }): google.cloud.automl.v1beta1.ExportModelOperationMetadata.ExportModelOutputInfo; + + /** + * Creates a plain object from an ExportModelOutputInfo message. Also converts values to other types if specified. + * @param message ExportModelOutputInfo + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.automl.v1beta1.ExportModelOperationMetadata.ExportModelOutputInfo, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ExportModelOutputInfo to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ExportModelOutputInfo + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Properties of an ExportEvaluatedExamplesOperationMetadata. */ + interface IExportEvaluatedExamplesOperationMetadata { + + /** ExportEvaluatedExamplesOperationMetadata outputInfo */ + outputInfo?: (google.cloud.automl.v1beta1.ExportEvaluatedExamplesOperationMetadata.IExportEvaluatedExamplesOutputInfo|null); + } + + /** Represents an ExportEvaluatedExamplesOperationMetadata. */ + class ExportEvaluatedExamplesOperationMetadata implements IExportEvaluatedExamplesOperationMetadata { + + /** + * Constructs a new ExportEvaluatedExamplesOperationMetadata. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.automl.v1beta1.IExportEvaluatedExamplesOperationMetadata); + + /** ExportEvaluatedExamplesOperationMetadata outputInfo. */ + public outputInfo?: (google.cloud.automl.v1beta1.ExportEvaluatedExamplesOperationMetadata.IExportEvaluatedExamplesOutputInfo|null); + + /** + * Creates a new ExportEvaluatedExamplesOperationMetadata instance using the specified properties. + * @param [properties] Properties to set + * @returns ExportEvaluatedExamplesOperationMetadata instance + */ + public static create(properties?: google.cloud.automl.v1beta1.IExportEvaluatedExamplesOperationMetadata): google.cloud.automl.v1beta1.ExportEvaluatedExamplesOperationMetadata; + + /** + * Encodes the specified ExportEvaluatedExamplesOperationMetadata message. Does not implicitly {@link google.cloud.automl.v1beta1.ExportEvaluatedExamplesOperationMetadata.verify|verify} messages. + * @param message ExportEvaluatedExamplesOperationMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.automl.v1beta1.IExportEvaluatedExamplesOperationMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ExportEvaluatedExamplesOperationMetadata message, length delimited. Does not implicitly {@link google.cloud.automl.v1beta1.ExportEvaluatedExamplesOperationMetadata.verify|verify} messages. + * @param message ExportEvaluatedExamplesOperationMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.automl.v1beta1.IExportEvaluatedExamplesOperationMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an ExportEvaluatedExamplesOperationMetadata message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ExportEvaluatedExamplesOperationMetadata + * @throws {Error} If the payload is not 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.automl.v1beta1.ExportEvaluatedExamplesOperationMetadata; + + /** + * Decodes an ExportEvaluatedExamplesOperationMetadata message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ExportEvaluatedExamplesOperationMetadata + * @throws {Error} If the payload 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.automl.v1beta1.ExportEvaluatedExamplesOperationMetadata; + + /** + * Verifies an ExportEvaluatedExamplesOperationMetadata message. + * @param message Plain 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 ExportEvaluatedExamplesOperationMetadata message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ExportEvaluatedExamplesOperationMetadata + */ + public static fromObject(object: { [k: string]: any }): google.cloud.automl.v1beta1.ExportEvaluatedExamplesOperationMetadata; + + /** + * Creates a plain object from an ExportEvaluatedExamplesOperationMetadata message. Also converts values to other types if specified. + * @param message ExportEvaluatedExamplesOperationMetadata + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.automl.v1beta1.ExportEvaluatedExamplesOperationMetadata, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ExportEvaluatedExamplesOperationMetadata to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ExportEvaluatedExamplesOperationMetadata + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace ExportEvaluatedExamplesOperationMetadata { + + /** Properties of an ExportEvaluatedExamplesOutputInfo. */ + interface IExportEvaluatedExamplesOutputInfo { + + /** ExportEvaluatedExamplesOutputInfo bigqueryOutputDataset */ + bigqueryOutputDataset?: (string|null); + } + + /** Represents an ExportEvaluatedExamplesOutputInfo. */ + class ExportEvaluatedExamplesOutputInfo implements IExportEvaluatedExamplesOutputInfo { + + /** + * Constructs a new ExportEvaluatedExamplesOutputInfo. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.automl.v1beta1.ExportEvaluatedExamplesOperationMetadata.IExportEvaluatedExamplesOutputInfo); + + /** ExportEvaluatedExamplesOutputInfo bigqueryOutputDataset. */ + public bigqueryOutputDataset: string; + + /** + * Creates a new ExportEvaluatedExamplesOutputInfo instance using the specified properties. + * @param [properties] Properties to set + * @returns ExportEvaluatedExamplesOutputInfo instance + */ + public static create(properties?: google.cloud.automl.v1beta1.ExportEvaluatedExamplesOperationMetadata.IExportEvaluatedExamplesOutputInfo): google.cloud.automl.v1beta1.ExportEvaluatedExamplesOperationMetadata.ExportEvaluatedExamplesOutputInfo; + + /** + * Encodes the specified ExportEvaluatedExamplesOutputInfo message. Does not implicitly {@link google.cloud.automl.v1beta1.ExportEvaluatedExamplesOperationMetadata.ExportEvaluatedExamplesOutputInfo.verify|verify} messages. + * @param message ExportEvaluatedExamplesOutputInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.automl.v1beta1.ExportEvaluatedExamplesOperationMetadata.IExportEvaluatedExamplesOutputInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ExportEvaluatedExamplesOutputInfo message, length delimited. Does not implicitly {@link google.cloud.automl.v1beta1.ExportEvaluatedExamplesOperationMetadata.ExportEvaluatedExamplesOutputInfo.verify|verify} messages. + * @param message ExportEvaluatedExamplesOutputInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.automl.v1beta1.ExportEvaluatedExamplesOperationMetadata.IExportEvaluatedExamplesOutputInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an ExportEvaluatedExamplesOutputInfo message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ExportEvaluatedExamplesOutputInfo + * @throws {Error} If the payload is not 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.automl.v1beta1.ExportEvaluatedExamplesOperationMetadata.ExportEvaluatedExamplesOutputInfo; + + /** + * Decodes an ExportEvaluatedExamplesOutputInfo message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ExportEvaluatedExamplesOutputInfo + * @throws {Error} If the payload 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.automl.v1beta1.ExportEvaluatedExamplesOperationMetadata.ExportEvaluatedExamplesOutputInfo; + + /** + * Verifies an ExportEvaluatedExamplesOutputInfo message. + * @param message Plain 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 ExportEvaluatedExamplesOutputInfo message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ExportEvaluatedExamplesOutputInfo + */ + public static fromObject(object: { [k: string]: any }): google.cloud.automl.v1beta1.ExportEvaluatedExamplesOperationMetadata.ExportEvaluatedExamplesOutputInfo; + + /** + * Creates a plain object from an ExportEvaluatedExamplesOutputInfo message. Also converts values to other types if specified. + * @param message ExportEvaluatedExamplesOutputInfo + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.automl.v1beta1.ExportEvaluatedExamplesOperationMetadata.ExportEvaluatedExamplesOutputInfo, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ExportEvaluatedExamplesOutputInfo to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ExportEvaluatedExamplesOutputInfo + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Represents a PredictionService */ + class PredictionService extends $protobuf.rpc.Service { + + /** + * Constructs a new PredictionService 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 PredictionService 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): PredictionService; + + /** + * Calls Predict. + * @param request PredictRequest message or plain object + * @param callback Node-style callback called with the error, if any, and PredictResponse + */ + public predict(request: google.cloud.automl.v1beta1.IPredictRequest, callback: google.cloud.automl.v1beta1.PredictionService.PredictCallback): void; + + /** + * Calls Predict. + * @param request PredictRequest message or plain object + * @returns Promise + */ + public predict(request: google.cloud.automl.v1beta1.IPredictRequest): Promise; + + /** + * Calls BatchPredict. + * @param request BatchPredictRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public batchPredict(request: google.cloud.automl.v1beta1.IBatchPredictRequest, callback: google.cloud.automl.v1beta1.PredictionService.BatchPredictCallback): void; + + /** + * Calls BatchPredict. + * @param request BatchPredictRequest message or plain object + * @returns Promise + */ + public batchPredict(request: google.cloud.automl.v1beta1.IBatchPredictRequest): Promise; + } + + namespace PredictionService { + + /** + * Callback as used by {@link google.cloud.automl.v1beta1.PredictionService|predict}. + * @param error Error, if any + * @param [response] PredictResponse + */ + type PredictCallback = (error: (Error|null), response?: google.cloud.automl.v1beta1.PredictResponse) => void; + + /** + * Callback as used by {@link google.cloud.automl.v1beta1.PredictionService|batchPredict}. + * @param error Error, if any + * @param [response] Operation + */ + type BatchPredictCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + } + + /** Properties of a PredictRequest. */ + interface IPredictRequest { + + /** PredictRequest name */ + name?: (string|null); + + /** PredictRequest payload */ + payload?: (google.cloud.automl.v1beta1.IExamplePayload|null); + + /** PredictRequest params */ + params?: ({ [k: string]: string }|null); + } + + /** Represents a PredictRequest. */ + class PredictRequest implements IPredictRequest { + + /** + * Constructs a new PredictRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.automl.v1beta1.IPredictRequest); + + /** PredictRequest name. */ + public name: string; + + /** PredictRequest payload. */ + public payload?: (google.cloud.automl.v1beta1.IExamplePayload|null); + + /** PredictRequest params. */ + public params: { [k: string]: string }; + + /** + * Creates a new PredictRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns PredictRequest instance + */ + public static create(properties?: google.cloud.automl.v1beta1.IPredictRequest): google.cloud.automl.v1beta1.PredictRequest; + + /** + * Encodes the specified PredictRequest message. Does not implicitly {@link google.cloud.automl.v1beta1.PredictRequest.verify|verify} messages. + * @param message PredictRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.automl.v1beta1.IPredictRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified PredictRequest message, length delimited. Does not implicitly {@link google.cloud.automl.v1beta1.PredictRequest.verify|verify} messages. + * @param message PredictRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.automl.v1beta1.IPredictRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a PredictRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns PredictRequest + * @throws {Error} If the payload is not 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.automl.v1beta1.PredictRequest; + + /** + * Decodes a PredictRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns PredictRequest + * @throws {Error} If the payload 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.automl.v1beta1.PredictRequest; + + /** + * Verifies a PredictRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a PredictRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns PredictRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.automl.v1beta1.PredictRequest; + + /** + * Creates a plain object from a PredictRequest message. Also converts values to other types if specified. + * @param message PredictRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.automl.v1beta1.PredictRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this PredictRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for PredictRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a PredictResponse. */ + interface IPredictResponse { + + /** PredictResponse payload */ + payload?: (google.cloud.automl.v1beta1.IAnnotationPayload[]|null); + + /** PredictResponse preprocessedInput */ + preprocessedInput?: (google.cloud.automl.v1beta1.IExamplePayload|null); + + /** PredictResponse metadata */ + metadata?: ({ [k: string]: string }|null); + } + + /** Represents a PredictResponse. */ + class PredictResponse implements IPredictResponse { + + /** + * Constructs a new PredictResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.automl.v1beta1.IPredictResponse); + + /** PredictResponse payload. */ + public payload: google.cloud.automl.v1beta1.IAnnotationPayload[]; + + /** PredictResponse preprocessedInput. */ + public preprocessedInput?: (google.cloud.automl.v1beta1.IExamplePayload|null); + + /** PredictResponse metadata. */ + public metadata: { [k: string]: string }; + + /** + * Creates a new PredictResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns PredictResponse instance + */ + public static create(properties?: google.cloud.automl.v1beta1.IPredictResponse): google.cloud.automl.v1beta1.PredictResponse; + + /** + * Encodes the specified PredictResponse message. Does not implicitly {@link google.cloud.automl.v1beta1.PredictResponse.verify|verify} messages. + * @param message PredictResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.automl.v1beta1.IPredictResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified PredictResponse message, length delimited. Does not implicitly {@link google.cloud.automl.v1beta1.PredictResponse.verify|verify} messages. + * @param message PredictResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.automl.v1beta1.IPredictResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a PredictResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns PredictResponse + * @throws {Error} If the payload is not 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.automl.v1beta1.PredictResponse; + + /** + * Decodes a PredictResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns PredictResponse + * @throws {Error} If the payload 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.automl.v1beta1.PredictResponse; + + /** + * Verifies a PredictResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a PredictResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns PredictResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.automl.v1beta1.PredictResponse; + + /** + * Creates a plain object from a PredictResponse message. Also converts values to other types if specified. + * @param message PredictResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.automl.v1beta1.PredictResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this PredictResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for PredictResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a BatchPredictRequest. */ + interface IBatchPredictRequest { + + /** BatchPredictRequest name */ + name?: (string|null); + + /** BatchPredictRequest inputConfig */ + inputConfig?: (google.cloud.automl.v1beta1.IBatchPredictInputConfig|null); + + /** BatchPredictRequest outputConfig */ + outputConfig?: (google.cloud.automl.v1beta1.IBatchPredictOutputConfig|null); + + /** BatchPredictRequest params */ + params?: ({ [k: string]: string }|null); + } + + /** Represents a BatchPredictRequest. */ + class BatchPredictRequest implements IBatchPredictRequest { + + /** + * Constructs a new BatchPredictRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.automl.v1beta1.IBatchPredictRequest); + + /** BatchPredictRequest name. */ + public name: string; + + /** BatchPredictRequest inputConfig. */ + public inputConfig?: (google.cloud.automl.v1beta1.IBatchPredictInputConfig|null); + + /** BatchPredictRequest outputConfig. */ + public outputConfig?: (google.cloud.automl.v1beta1.IBatchPredictOutputConfig|null); + + /** BatchPredictRequest params. */ + public params: { [k: string]: string }; + + /** + * Creates a new BatchPredictRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns BatchPredictRequest instance + */ + public static create(properties?: google.cloud.automl.v1beta1.IBatchPredictRequest): google.cloud.automl.v1beta1.BatchPredictRequest; + + /** + * Encodes the specified BatchPredictRequest message. Does not implicitly {@link google.cloud.automl.v1beta1.BatchPredictRequest.verify|verify} messages. + * @param message BatchPredictRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.automl.v1beta1.IBatchPredictRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified BatchPredictRequest message, length delimited. Does not implicitly {@link google.cloud.automl.v1beta1.BatchPredictRequest.verify|verify} messages. + * @param message BatchPredictRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.automl.v1beta1.IBatchPredictRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a BatchPredictRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns BatchPredictRequest + * @throws {Error} If the payload is not 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.automl.v1beta1.BatchPredictRequest; + + /** + * Decodes a BatchPredictRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns BatchPredictRequest + * @throws {Error} If the payload 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.automl.v1beta1.BatchPredictRequest; + + /** + * Verifies a BatchPredictRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a BatchPredictRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns BatchPredictRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.automl.v1beta1.BatchPredictRequest; + + /** + * Creates a plain object from a BatchPredictRequest message. Also converts values to other types if specified. + * @param message BatchPredictRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.automl.v1beta1.BatchPredictRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this BatchPredictRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for BatchPredictRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a BatchPredictResult. */ + interface IBatchPredictResult { + + /** BatchPredictResult metadata */ + metadata?: ({ [k: string]: string }|null); + } + + /** Represents a BatchPredictResult. */ + class BatchPredictResult implements IBatchPredictResult { + + /** + * Constructs a new BatchPredictResult. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.automl.v1beta1.IBatchPredictResult); + + /** BatchPredictResult metadata. */ + public metadata: { [k: string]: string }; + + /** + * Creates a new BatchPredictResult instance using the specified properties. + * @param [properties] Properties to set + * @returns BatchPredictResult instance + */ + public static create(properties?: google.cloud.automl.v1beta1.IBatchPredictResult): google.cloud.automl.v1beta1.BatchPredictResult; + + /** + * Encodes the specified BatchPredictResult message. Does not implicitly {@link google.cloud.automl.v1beta1.BatchPredictResult.verify|verify} messages. + * @param message BatchPredictResult message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.automl.v1beta1.IBatchPredictResult, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified BatchPredictResult message, length delimited. Does not implicitly {@link google.cloud.automl.v1beta1.BatchPredictResult.verify|verify} messages. + * @param message BatchPredictResult message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.automl.v1beta1.IBatchPredictResult, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a BatchPredictResult message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns BatchPredictResult + * @throws {Error} If the payload is not 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.automl.v1beta1.BatchPredictResult; + + /** + * Decodes a BatchPredictResult message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns BatchPredictResult + * @throws {Error} If the payload 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.automl.v1beta1.BatchPredictResult; + + /** + * Verifies a BatchPredictResult message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a BatchPredictResult message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns BatchPredictResult + */ + public static fromObject(object: { [k: string]: any }): google.cloud.automl.v1beta1.BatchPredictResult; + + /** + * Creates a plain object from a BatchPredictResult message. Also converts values to other types if specified. + * @param message BatchPredictResult + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.automl.v1beta1.BatchPredictResult, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this BatchPredictResult to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for BatchPredictResult + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Represents an AutoMl */ + class AutoMl extends $protobuf.rpc.Service { + + /** + * Constructs a new AutoMl 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 AutoMl 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): AutoMl; + + /** + * Calls CreateDataset. + * @param request CreateDatasetRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Dataset + */ + public createDataset(request: google.cloud.automl.v1beta1.ICreateDatasetRequest, callback: google.cloud.automl.v1beta1.AutoMl.CreateDatasetCallback): void; + + /** + * Calls CreateDataset. + * @param request CreateDatasetRequest message or plain object + * @returns Promise + */ + public createDataset(request: google.cloud.automl.v1beta1.ICreateDatasetRequest): Promise; + + /** + * Calls GetDataset. + * @param request GetDatasetRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Dataset + */ + public getDataset(request: google.cloud.automl.v1beta1.IGetDatasetRequest, callback: google.cloud.automl.v1beta1.AutoMl.GetDatasetCallback): void; + + /** + * Calls GetDataset. + * @param request GetDatasetRequest message or plain object + * @returns Promise + */ + public getDataset(request: google.cloud.automl.v1beta1.IGetDatasetRequest): Promise; + + /** + * Calls ListDatasets. + * @param request ListDatasetsRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ListDatasetsResponse + */ + public listDatasets(request: google.cloud.automl.v1beta1.IListDatasetsRequest, callback: google.cloud.automl.v1beta1.AutoMl.ListDatasetsCallback): void; + + /** + * Calls ListDatasets. + * @param request ListDatasetsRequest message or plain object + * @returns Promise + */ + public listDatasets(request: google.cloud.automl.v1beta1.IListDatasetsRequest): Promise; + + /** + * Calls UpdateDataset. + * @param request UpdateDatasetRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Dataset + */ + public updateDataset(request: google.cloud.automl.v1beta1.IUpdateDatasetRequest, callback: google.cloud.automl.v1beta1.AutoMl.UpdateDatasetCallback): void; + + /** + * Calls UpdateDataset. + * @param request UpdateDatasetRequest message or plain object + * @returns Promise + */ + public updateDataset(request: google.cloud.automl.v1beta1.IUpdateDatasetRequest): Promise; + + /** + * Calls DeleteDataset. + * @param request DeleteDatasetRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public deleteDataset(request: google.cloud.automl.v1beta1.IDeleteDatasetRequest, callback: google.cloud.automl.v1beta1.AutoMl.DeleteDatasetCallback): void; + + /** + * Calls DeleteDataset. + * @param request DeleteDatasetRequest message or plain object + * @returns Promise + */ + public deleteDataset(request: google.cloud.automl.v1beta1.IDeleteDatasetRequest): Promise; + + /** + * Calls ImportData. + * @param request ImportDataRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public importData(request: google.cloud.automl.v1beta1.IImportDataRequest, callback: google.cloud.automl.v1beta1.AutoMl.ImportDataCallback): void; + + /** + * Calls ImportData. + * @param request ImportDataRequest message or plain object + * @returns Promise + */ + public importData(request: google.cloud.automl.v1beta1.IImportDataRequest): Promise; + + /** + * Calls ExportData. + * @param request ExportDataRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public exportData(request: google.cloud.automl.v1beta1.IExportDataRequest, callback: google.cloud.automl.v1beta1.AutoMl.ExportDataCallback): void; + + /** + * Calls ExportData. + * @param request ExportDataRequest message or plain object + * @returns Promise + */ + public exportData(request: google.cloud.automl.v1beta1.IExportDataRequest): Promise; + + /** + * Calls GetAnnotationSpec. + * @param request GetAnnotationSpecRequest message or plain object + * @param callback Node-style callback called with the error, if any, and AnnotationSpec + */ + public getAnnotationSpec(request: google.cloud.automl.v1beta1.IGetAnnotationSpecRequest, callback: google.cloud.automl.v1beta1.AutoMl.GetAnnotationSpecCallback): void; + + /** + * Calls GetAnnotationSpec. + * @param request GetAnnotationSpecRequest message or plain object + * @returns Promise + */ + public getAnnotationSpec(request: google.cloud.automl.v1beta1.IGetAnnotationSpecRequest): Promise; + + /** + * Calls GetTableSpec. + * @param request GetTableSpecRequest message or plain object + * @param callback Node-style callback called with the error, if any, and TableSpec + */ + public getTableSpec(request: google.cloud.automl.v1beta1.IGetTableSpecRequest, callback: google.cloud.automl.v1beta1.AutoMl.GetTableSpecCallback): void; + + /** + * Calls GetTableSpec. + * @param request GetTableSpecRequest message or plain object + * @returns Promise + */ + public getTableSpec(request: google.cloud.automl.v1beta1.IGetTableSpecRequest): Promise; + + /** + * Calls ListTableSpecs. + * @param request ListTableSpecsRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ListTableSpecsResponse + */ + public listTableSpecs(request: google.cloud.automl.v1beta1.IListTableSpecsRequest, callback: google.cloud.automl.v1beta1.AutoMl.ListTableSpecsCallback): void; + + /** + * Calls ListTableSpecs. + * @param request ListTableSpecsRequest message or plain object + * @returns Promise + */ + public listTableSpecs(request: google.cloud.automl.v1beta1.IListTableSpecsRequest): Promise; + + /** + * Calls UpdateTableSpec. + * @param request UpdateTableSpecRequest message or plain object + * @param callback Node-style callback called with the error, if any, and TableSpec + */ + public updateTableSpec(request: google.cloud.automl.v1beta1.IUpdateTableSpecRequest, callback: google.cloud.automl.v1beta1.AutoMl.UpdateTableSpecCallback): void; + + /** + * Calls UpdateTableSpec. + * @param request UpdateTableSpecRequest message or plain object + * @returns Promise + */ + public updateTableSpec(request: google.cloud.automl.v1beta1.IUpdateTableSpecRequest): Promise; + + /** + * Calls GetColumnSpec. + * @param request GetColumnSpecRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ColumnSpec + */ + public getColumnSpec(request: google.cloud.automl.v1beta1.IGetColumnSpecRequest, callback: google.cloud.automl.v1beta1.AutoMl.GetColumnSpecCallback): void; + + /** + * Calls GetColumnSpec. + * @param request GetColumnSpecRequest message or plain object + * @returns Promise + */ + public getColumnSpec(request: google.cloud.automl.v1beta1.IGetColumnSpecRequest): Promise; + + /** + * Calls ListColumnSpecs. + * @param request ListColumnSpecsRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ListColumnSpecsResponse + */ + public listColumnSpecs(request: google.cloud.automl.v1beta1.IListColumnSpecsRequest, callback: google.cloud.automl.v1beta1.AutoMl.ListColumnSpecsCallback): void; + + /** + * Calls ListColumnSpecs. + * @param request ListColumnSpecsRequest message or plain object + * @returns Promise + */ + public listColumnSpecs(request: google.cloud.automl.v1beta1.IListColumnSpecsRequest): Promise; + + /** + * Calls UpdateColumnSpec. + * @param request UpdateColumnSpecRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ColumnSpec + */ + public updateColumnSpec(request: google.cloud.automl.v1beta1.IUpdateColumnSpecRequest, callback: google.cloud.automl.v1beta1.AutoMl.UpdateColumnSpecCallback): void; + + /** + * Calls UpdateColumnSpec. + * @param request UpdateColumnSpecRequest message or plain object + * @returns Promise + */ + public updateColumnSpec(request: google.cloud.automl.v1beta1.IUpdateColumnSpecRequest): Promise; + + /** + * Calls CreateModel. + * @param request CreateModelRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public createModel(request: google.cloud.automl.v1beta1.ICreateModelRequest, callback: google.cloud.automl.v1beta1.AutoMl.CreateModelCallback): void; + + /** + * Calls CreateModel. + * @param request CreateModelRequest message or plain object + * @returns Promise + */ + public createModel(request: google.cloud.automl.v1beta1.ICreateModelRequest): Promise; + + /** + * Calls GetModel. + * @param request GetModelRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Model + */ + public getModel(request: google.cloud.automl.v1beta1.IGetModelRequest, callback: google.cloud.automl.v1beta1.AutoMl.GetModelCallback): void; + + /** + * Calls GetModel. + * @param request GetModelRequest message or plain object + * @returns Promise + */ + public getModel(request: google.cloud.automl.v1beta1.IGetModelRequest): Promise; + + /** + * Calls ListModels. + * @param request ListModelsRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ListModelsResponse + */ + public listModels(request: google.cloud.automl.v1beta1.IListModelsRequest, callback: google.cloud.automl.v1beta1.AutoMl.ListModelsCallback): void; + + /** + * Calls ListModels. + * @param request ListModelsRequest message or plain object + * @returns Promise + */ + public listModels(request: google.cloud.automl.v1beta1.IListModelsRequest): Promise; + + /** + * Calls DeleteModel. + * @param request DeleteModelRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public deleteModel(request: google.cloud.automl.v1beta1.IDeleteModelRequest, callback: google.cloud.automl.v1beta1.AutoMl.DeleteModelCallback): void; + + /** + * Calls DeleteModel. + * @param request DeleteModelRequest message or plain object + * @returns Promise + */ + public deleteModel(request: google.cloud.automl.v1beta1.IDeleteModelRequest): Promise; + + /** + * Calls DeployModel. + * @param request DeployModelRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public deployModel(request: google.cloud.automl.v1beta1.IDeployModelRequest, callback: google.cloud.automl.v1beta1.AutoMl.DeployModelCallback): void; + + /** + * Calls DeployModel. + * @param request DeployModelRequest message or plain object + * @returns Promise + */ + public deployModel(request: google.cloud.automl.v1beta1.IDeployModelRequest): Promise; + + /** + * Calls UndeployModel. + * @param request UndeployModelRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public undeployModel(request: google.cloud.automl.v1beta1.IUndeployModelRequest, callback: google.cloud.automl.v1beta1.AutoMl.UndeployModelCallback): void; + + /** + * Calls UndeployModel. + * @param request UndeployModelRequest message or plain object + * @returns Promise + */ + public undeployModel(request: google.cloud.automl.v1beta1.IUndeployModelRequest): Promise; + + /** + * Calls ExportModel. + * @param request ExportModelRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public exportModel(request: google.cloud.automl.v1beta1.IExportModelRequest, callback: google.cloud.automl.v1beta1.AutoMl.ExportModelCallback): void; + + /** + * Calls ExportModel. + * @param request ExportModelRequest message or plain object + * @returns Promise + */ + public exportModel(request: google.cloud.automl.v1beta1.IExportModelRequest): Promise; + + /** + * Calls ExportEvaluatedExamples. + * @param request ExportEvaluatedExamplesRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public exportEvaluatedExamples(request: google.cloud.automl.v1beta1.IExportEvaluatedExamplesRequest, callback: google.cloud.automl.v1beta1.AutoMl.ExportEvaluatedExamplesCallback): void; + + /** + * Calls ExportEvaluatedExamples. + * @param request ExportEvaluatedExamplesRequest message or plain object + * @returns Promise + */ + public exportEvaluatedExamples(request: google.cloud.automl.v1beta1.IExportEvaluatedExamplesRequest): Promise; + + /** + * Calls GetModelEvaluation. + * @param request GetModelEvaluationRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ModelEvaluation + */ + public getModelEvaluation(request: google.cloud.automl.v1beta1.IGetModelEvaluationRequest, callback: google.cloud.automl.v1beta1.AutoMl.GetModelEvaluationCallback): void; + + /** + * Calls GetModelEvaluation. + * @param request GetModelEvaluationRequest message or plain object + * @returns Promise + */ + public getModelEvaluation(request: google.cloud.automl.v1beta1.IGetModelEvaluationRequest): Promise; + + /** + * Calls ListModelEvaluations. + * @param request ListModelEvaluationsRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ListModelEvaluationsResponse + */ + public listModelEvaluations(request: google.cloud.automl.v1beta1.IListModelEvaluationsRequest, callback: google.cloud.automl.v1beta1.AutoMl.ListModelEvaluationsCallback): void; + + /** + * Calls ListModelEvaluations. + * @param request ListModelEvaluationsRequest message or plain object + * @returns Promise + */ + public listModelEvaluations(request: google.cloud.automl.v1beta1.IListModelEvaluationsRequest): Promise; + } + + namespace AutoMl { + + /** + * Callback as used by {@link google.cloud.automl.v1beta1.AutoMl|createDataset}. + * @param error Error, if any + * @param [response] Dataset + */ + type CreateDatasetCallback = (error: (Error|null), response?: google.cloud.automl.v1beta1.Dataset) => void; + + /** + * Callback as used by {@link google.cloud.automl.v1beta1.AutoMl|getDataset}. + * @param error Error, if any + * @param [response] Dataset + */ + type GetDatasetCallback = (error: (Error|null), response?: google.cloud.automl.v1beta1.Dataset) => void; + + /** + * Callback as used by {@link google.cloud.automl.v1beta1.AutoMl|listDatasets}. + * @param error Error, if any + * @param [response] ListDatasetsResponse + */ + type ListDatasetsCallback = (error: (Error|null), response?: google.cloud.automl.v1beta1.ListDatasetsResponse) => void; + + /** + * Callback as used by {@link google.cloud.automl.v1beta1.AutoMl|updateDataset}. + * @param error Error, if any + * @param [response] Dataset + */ + type UpdateDatasetCallback = (error: (Error|null), response?: google.cloud.automl.v1beta1.Dataset) => void; + + /** + * Callback as used by {@link google.cloud.automl.v1beta1.AutoMl|deleteDataset}. + * @param error Error, if any + * @param [response] Operation + */ + type DeleteDatasetCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.cloud.automl.v1beta1.AutoMl|importData}. + * @param error Error, if any + * @param [response] Operation + */ + type ImportDataCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.cloud.automl.v1beta1.AutoMl|exportData}. + * @param error Error, if any + * @param [response] Operation + */ + type ExportDataCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.cloud.automl.v1beta1.AutoMl|getAnnotationSpec}. + * @param error Error, if any + * @param [response] AnnotationSpec + */ + type GetAnnotationSpecCallback = (error: (Error|null), response?: google.cloud.automl.v1beta1.AnnotationSpec) => void; + + /** + * Callback as used by {@link google.cloud.automl.v1beta1.AutoMl|getTableSpec}. + * @param error Error, if any + * @param [response] TableSpec + */ + type GetTableSpecCallback = (error: (Error|null), response?: google.cloud.automl.v1beta1.TableSpec) => void; + + /** + * Callback as used by {@link google.cloud.automl.v1beta1.AutoMl|listTableSpecs}. + * @param error Error, if any + * @param [response] ListTableSpecsResponse + */ + type ListTableSpecsCallback = (error: (Error|null), response?: google.cloud.automl.v1beta1.ListTableSpecsResponse) => void; + + /** + * Callback as used by {@link google.cloud.automl.v1beta1.AutoMl|updateTableSpec}. + * @param error Error, if any + * @param [response] TableSpec + */ + type UpdateTableSpecCallback = (error: (Error|null), response?: google.cloud.automl.v1beta1.TableSpec) => void; + + /** + * Callback as used by {@link google.cloud.automl.v1beta1.AutoMl|getColumnSpec}. + * @param error Error, if any + * @param [response] ColumnSpec + */ + type GetColumnSpecCallback = (error: (Error|null), response?: google.cloud.automl.v1beta1.ColumnSpec) => void; + + /** + * Callback as used by {@link google.cloud.automl.v1beta1.AutoMl|listColumnSpecs}. + * @param error Error, if any + * @param [response] ListColumnSpecsResponse + */ + type ListColumnSpecsCallback = (error: (Error|null), response?: google.cloud.automl.v1beta1.ListColumnSpecsResponse) => void; + + /** + * Callback as used by {@link google.cloud.automl.v1beta1.AutoMl|updateColumnSpec}. + * @param error Error, if any + * @param [response] ColumnSpec + */ + type UpdateColumnSpecCallback = (error: (Error|null), response?: google.cloud.automl.v1beta1.ColumnSpec) => void; + + /** + * Callback as used by {@link google.cloud.automl.v1beta1.AutoMl|createModel}. + * @param error Error, if any + * @param [response] Operation + */ + type CreateModelCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.cloud.automl.v1beta1.AutoMl|getModel}. + * @param error Error, if any + * @param [response] Model + */ + type GetModelCallback = (error: (Error|null), response?: google.cloud.automl.v1beta1.Model) => void; + + /** + * Callback as used by {@link google.cloud.automl.v1beta1.AutoMl|listModels}. + * @param error Error, if any + * @param [response] ListModelsResponse + */ + type ListModelsCallback = (error: (Error|null), response?: google.cloud.automl.v1beta1.ListModelsResponse) => void; + + /** + * Callback as used by {@link google.cloud.automl.v1beta1.AutoMl|deleteModel}. + * @param error Error, if any + * @param [response] Operation + */ + type DeleteModelCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.cloud.automl.v1beta1.AutoMl|deployModel}. + * @param error Error, if any + * @param [response] Operation + */ + type DeployModelCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.cloud.automl.v1beta1.AutoMl|undeployModel}. + * @param error Error, if any + * @param [response] Operation + */ + type UndeployModelCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.cloud.automl.v1beta1.AutoMl|exportModel}. + * @param error Error, if any + * @param [response] Operation + */ + type ExportModelCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.cloud.automl.v1beta1.AutoMl|exportEvaluatedExamples}. + * @param error Error, if any + * @param [response] Operation + */ + type ExportEvaluatedExamplesCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.cloud.automl.v1beta1.AutoMl|getModelEvaluation}. + * @param error Error, if any + * @param [response] ModelEvaluation + */ + type GetModelEvaluationCallback = (error: (Error|null), response?: google.cloud.automl.v1beta1.ModelEvaluation) => void; + + /** + * Callback as used by {@link google.cloud.automl.v1beta1.AutoMl|listModelEvaluations}. + * @param error Error, if any + * @param [response] ListModelEvaluationsResponse + */ + type ListModelEvaluationsCallback = (error: (Error|null), response?: google.cloud.automl.v1beta1.ListModelEvaluationsResponse) => void; + } + + /** Properties of a CreateDatasetRequest. */ + interface ICreateDatasetRequest { + + /** CreateDatasetRequest parent */ + parent?: (string|null); + + /** CreateDatasetRequest dataset */ + dataset?: (google.cloud.automl.v1beta1.IDataset|null); + } + + /** Represents a CreateDatasetRequest. */ + class CreateDatasetRequest implements ICreateDatasetRequest { + + /** + * Constructs a new CreateDatasetRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.automl.v1beta1.ICreateDatasetRequest); + + /** CreateDatasetRequest parent. */ + public parent: string; + + /** CreateDatasetRequest dataset. */ + public dataset?: (google.cloud.automl.v1beta1.IDataset|null); + + /** + * Creates a new CreateDatasetRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns CreateDatasetRequest instance + */ + public static create(properties?: google.cloud.automl.v1beta1.ICreateDatasetRequest): google.cloud.automl.v1beta1.CreateDatasetRequest; + + /** + * Encodes the specified CreateDatasetRequest message. Does not implicitly {@link google.cloud.automl.v1beta1.CreateDatasetRequest.verify|verify} messages. + * @param message CreateDatasetRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.automl.v1beta1.ICreateDatasetRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CreateDatasetRequest message, length delimited. Does not implicitly {@link google.cloud.automl.v1beta1.CreateDatasetRequest.verify|verify} messages. + * @param message CreateDatasetRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.automl.v1beta1.ICreateDatasetRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CreateDatasetRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CreateDatasetRequest + * @throws {Error} If the payload is not 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.automl.v1beta1.CreateDatasetRequest; + + /** + * Decodes a CreateDatasetRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CreateDatasetRequest + * @throws {Error} If the payload 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.automl.v1beta1.CreateDatasetRequest; + + /** + * Verifies a CreateDatasetRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CreateDatasetRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CreateDatasetRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.automl.v1beta1.CreateDatasetRequest; + + /** + * Creates a plain object from a CreateDatasetRequest message. Also converts values to other types if specified. + * @param message CreateDatasetRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.automl.v1beta1.CreateDatasetRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CreateDatasetRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CreateDatasetRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a GetDatasetRequest. */ + interface IGetDatasetRequest { + + /** GetDatasetRequest name */ + name?: (string|null); + } + + /** Represents a GetDatasetRequest. */ + class GetDatasetRequest implements IGetDatasetRequest { + + /** + * Constructs a new GetDatasetRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.automl.v1beta1.IGetDatasetRequest); + + /** GetDatasetRequest name. */ + public name: string; + + /** + * Creates a new GetDatasetRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GetDatasetRequest instance + */ + public static create(properties?: google.cloud.automl.v1beta1.IGetDatasetRequest): google.cloud.automl.v1beta1.GetDatasetRequest; + + /** + * Encodes the specified GetDatasetRequest message. Does not implicitly {@link google.cloud.automl.v1beta1.GetDatasetRequest.verify|verify} messages. + * @param message GetDatasetRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.automl.v1beta1.IGetDatasetRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GetDatasetRequest message, length delimited. Does not implicitly {@link google.cloud.automl.v1beta1.GetDatasetRequest.verify|verify} messages. + * @param message GetDatasetRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.automl.v1beta1.IGetDatasetRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GetDatasetRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GetDatasetRequest + * @throws {Error} If the payload is not 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.automl.v1beta1.GetDatasetRequest; + + /** + * Decodes a GetDatasetRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GetDatasetRequest + * @throws {Error} If the payload 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.automl.v1beta1.GetDatasetRequest; + + /** + * Verifies a GetDatasetRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GetDatasetRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GetDatasetRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.automl.v1beta1.GetDatasetRequest; + + /** + * Creates a plain object from a GetDatasetRequest message. Also converts values to other types if specified. + * @param message GetDatasetRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.automl.v1beta1.GetDatasetRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GetDatasetRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GetDatasetRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListDatasetsRequest. */ + interface IListDatasetsRequest { + + /** ListDatasetsRequest parent */ + parent?: (string|null); + + /** ListDatasetsRequest filter */ + filter?: (string|null); + + /** ListDatasetsRequest pageSize */ + pageSize?: (number|null); + + /** ListDatasetsRequest pageToken */ + pageToken?: (string|null); + } + + /** Represents a ListDatasetsRequest. */ + class ListDatasetsRequest implements IListDatasetsRequest { + + /** + * Constructs a new ListDatasetsRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.automl.v1beta1.IListDatasetsRequest); + + /** ListDatasetsRequest parent. */ + public parent: string; + + /** ListDatasetsRequest filter. */ + public filter: string; + + /** ListDatasetsRequest pageSize. */ + public pageSize: number; + + /** ListDatasetsRequest pageToken. */ + public pageToken: string; + + /** + * Creates a new ListDatasetsRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ListDatasetsRequest instance + */ + public static create(properties?: google.cloud.automl.v1beta1.IListDatasetsRequest): google.cloud.automl.v1beta1.ListDatasetsRequest; + + /** + * Encodes the specified ListDatasetsRequest message. Does not implicitly {@link google.cloud.automl.v1beta1.ListDatasetsRequest.verify|verify} messages. + * @param message ListDatasetsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.automl.v1beta1.IListDatasetsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListDatasetsRequest message, length delimited. Does not implicitly {@link google.cloud.automl.v1beta1.ListDatasetsRequest.verify|verify} messages. + * @param message ListDatasetsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.automl.v1beta1.IListDatasetsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListDatasetsRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListDatasetsRequest + * @throws {Error} If the payload is not 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.automl.v1beta1.ListDatasetsRequest; + + /** + * Decodes a ListDatasetsRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListDatasetsRequest + * @throws {Error} If the payload 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.automl.v1beta1.ListDatasetsRequest; + + /** + * Verifies a ListDatasetsRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListDatasetsRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListDatasetsRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.automl.v1beta1.ListDatasetsRequest; + + /** + * Creates a plain object from a ListDatasetsRequest message. Also converts values to other types if specified. + * @param message ListDatasetsRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.automl.v1beta1.ListDatasetsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListDatasetsRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListDatasetsRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListDatasetsResponse. */ + interface IListDatasetsResponse { + + /** ListDatasetsResponse datasets */ + datasets?: (google.cloud.automl.v1beta1.IDataset[]|null); + + /** ListDatasetsResponse nextPageToken */ + nextPageToken?: (string|null); + } + + /** Represents a ListDatasetsResponse. */ + class ListDatasetsResponse implements IListDatasetsResponse { + + /** + * Constructs a new ListDatasetsResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.automl.v1beta1.IListDatasetsResponse); + + /** ListDatasetsResponse datasets. */ + public datasets: google.cloud.automl.v1beta1.IDataset[]; + + /** ListDatasetsResponse nextPageToken. */ + public nextPageToken: string; + + /** + * Creates a new ListDatasetsResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ListDatasetsResponse instance + */ + public static create(properties?: google.cloud.automl.v1beta1.IListDatasetsResponse): google.cloud.automl.v1beta1.ListDatasetsResponse; + + /** + * Encodes the specified ListDatasetsResponse message. Does not implicitly {@link google.cloud.automl.v1beta1.ListDatasetsResponse.verify|verify} messages. + * @param message ListDatasetsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.automl.v1beta1.IListDatasetsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListDatasetsResponse message, length delimited. Does not implicitly {@link google.cloud.automl.v1beta1.ListDatasetsResponse.verify|verify} messages. + * @param message ListDatasetsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.automl.v1beta1.IListDatasetsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListDatasetsResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListDatasetsResponse + * @throws {Error} If the payload is not 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.automl.v1beta1.ListDatasetsResponse; + + /** + * Decodes a ListDatasetsResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListDatasetsResponse + * @throws {Error} If the payload 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.automl.v1beta1.ListDatasetsResponse; + + /** + * Verifies a ListDatasetsResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListDatasetsResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListDatasetsResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.automl.v1beta1.ListDatasetsResponse; + + /** + * Creates a plain object from a ListDatasetsResponse message. Also converts values to other types if specified. + * @param message ListDatasetsResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.automl.v1beta1.ListDatasetsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListDatasetsResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListDatasetsResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an UpdateDatasetRequest. */ + interface IUpdateDatasetRequest { + + /** UpdateDatasetRequest dataset */ + dataset?: (google.cloud.automl.v1beta1.IDataset|null); + + /** UpdateDatasetRequest updateMask */ + updateMask?: (google.protobuf.IFieldMask|null); + } + + /** Represents an UpdateDatasetRequest. */ + class UpdateDatasetRequest implements IUpdateDatasetRequest { + + /** + * Constructs a new UpdateDatasetRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.automl.v1beta1.IUpdateDatasetRequest); + + /** UpdateDatasetRequest dataset. */ + public dataset?: (google.cloud.automl.v1beta1.IDataset|null); + + /** UpdateDatasetRequest updateMask. */ + public updateMask?: (google.protobuf.IFieldMask|null); + + /** + * Creates a new UpdateDatasetRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns UpdateDatasetRequest instance + */ + public static create(properties?: google.cloud.automl.v1beta1.IUpdateDatasetRequest): google.cloud.automl.v1beta1.UpdateDatasetRequest; + + /** + * Encodes the specified UpdateDatasetRequest message. Does not implicitly {@link google.cloud.automl.v1beta1.UpdateDatasetRequest.verify|verify} messages. + * @param message UpdateDatasetRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.automl.v1beta1.IUpdateDatasetRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified UpdateDatasetRequest message, length delimited. Does not implicitly {@link google.cloud.automl.v1beta1.UpdateDatasetRequest.verify|verify} messages. + * @param message UpdateDatasetRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.automl.v1beta1.IUpdateDatasetRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an UpdateDatasetRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns UpdateDatasetRequest + * @throws {Error} If the payload is not 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.automl.v1beta1.UpdateDatasetRequest; + + /** + * Decodes an UpdateDatasetRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns UpdateDatasetRequest + * @throws {Error} If the payload 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.automl.v1beta1.UpdateDatasetRequest; + + /** + * Verifies an UpdateDatasetRequest message. + * @param message Plain 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 UpdateDatasetRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns UpdateDatasetRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.automl.v1beta1.UpdateDatasetRequest; + + /** + * Creates a plain object from an UpdateDatasetRequest message. Also converts values to other types if specified. + * @param message UpdateDatasetRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.automl.v1beta1.UpdateDatasetRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this UpdateDatasetRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for UpdateDatasetRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a DeleteDatasetRequest. */ + interface IDeleteDatasetRequest { + + /** DeleteDatasetRequest name */ + name?: (string|null); + } + + /** Represents a DeleteDatasetRequest. */ + class DeleteDatasetRequest implements IDeleteDatasetRequest { + + /** + * Constructs a new DeleteDatasetRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.automl.v1beta1.IDeleteDatasetRequest); + + /** DeleteDatasetRequest name. */ + public name: string; + + /** + * Creates a new DeleteDatasetRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns DeleteDatasetRequest instance + */ + public static create(properties?: google.cloud.automl.v1beta1.IDeleteDatasetRequest): google.cloud.automl.v1beta1.DeleteDatasetRequest; + + /** + * Encodes the specified DeleteDatasetRequest message. Does not implicitly {@link google.cloud.automl.v1beta1.DeleteDatasetRequest.verify|verify} messages. + * @param message DeleteDatasetRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.automl.v1beta1.IDeleteDatasetRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DeleteDatasetRequest message, length delimited. Does not implicitly {@link google.cloud.automl.v1beta1.DeleteDatasetRequest.verify|verify} messages. + * @param message DeleteDatasetRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.automl.v1beta1.IDeleteDatasetRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DeleteDatasetRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DeleteDatasetRequest + * @throws {Error} If the payload is not 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.automl.v1beta1.DeleteDatasetRequest; + + /** + * Decodes a DeleteDatasetRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DeleteDatasetRequest + * @throws {Error} If the payload 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.automl.v1beta1.DeleteDatasetRequest; + + /** + * Verifies a DeleteDatasetRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DeleteDatasetRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DeleteDatasetRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.automl.v1beta1.DeleteDatasetRequest; + + /** + * Creates a plain object from a DeleteDatasetRequest message. Also converts values to other types if specified. + * @param message DeleteDatasetRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.automl.v1beta1.DeleteDatasetRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DeleteDatasetRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DeleteDatasetRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an ImportDataRequest. */ + interface IImportDataRequest { + + /** ImportDataRequest name */ + name?: (string|null); + + /** ImportDataRequest inputConfig */ + inputConfig?: (google.cloud.automl.v1beta1.IInputConfig|null); + } + + /** Represents an ImportDataRequest. */ + class ImportDataRequest implements IImportDataRequest { + + /** + * Constructs a new ImportDataRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.automl.v1beta1.IImportDataRequest); + + /** ImportDataRequest name. */ + public name: string; + + /** ImportDataRequest inputConfig. */ + public inputConfig?: (google.cloud.automl.v1beta1.IInputConfig|null); + + /** + * Creates a new ImportDataRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ImportDataRequest instance + */ + public static create(properties?: google.cloud.automl.v1beta1.IImportDataRequest): google.cloud.automl.v1beta1.ImportDataRequest; + + /** + * Encodes the specified ImportDataRequest message. Does not implicitly {@link google.cloud.automl.v1beta1.ImportDataRequest.verify|verify} messages. + * @param message ImportDataRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.automl.v1beta1.IImportDataRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ImportDataRequest message, length delimited. Does not implicitly {@link google.cloud.automl.v1beta1.ImportDataRequest.verify|verify} messages. + * @param message ImportDataRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.automl.v1beta1.IImportDataRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an ImportDataRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ImportDataRequest + * @throws {Error} If the payload is not 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.automl.v1beta1.ImportDataRequest; + + /** + * Decodes an ImportDataRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ImportDataRequest + * @throws {Error} If the payload 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.automl.v1beta1.ImportDataRequest; + + /** + * Verifies an ImportDataRequest message. + * @param message Plain 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 ImportDataRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ImportDataRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.automl.v1beta1.ImportDataRequest; + + /** + * Creates a plain object from an ImportDataRequest message. Also converts values to other types if specified. + * @param message ImportDataRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.automl.v1beta1.ImportDataRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ImportDataRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ImportDataRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an ExportDataRequest. */ + interface IExportDataRequest { + + /** ExportDataRequest name */ + name?: (string|null); + + /** ExportDataRequest outputConfig */ + outputConfig?: (google.cloud.automl.v1beta1.IOutputConfig|null); + } + + /** Represents an ExportDataRequest. */ + class ExportDataRequest implements IExportDataRequest { + + /** + * Constructs a new ExportDataRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.automl.v1beta1.IExportDataRequest); + + /** ExportDataRequest name. */ + public name: string; + + /** ExportDataRequest outputConfig. */ + public outputConfig?: (google.cloud.automl.v1beta1.IOutputConfig|null); + + /** + * Creates a new ExportDataRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ExportDataRequest instance + */ + public static create(properties?: google.cloud.automl.v1beta1.IExportDataRequest): google.cloud.automl.v1beta1.ExportDataRequest; + + /** + * Encodes the specified ExportDataRequest message. Does not implicitly {@link google.cloud.automl.v1beta1.ExportDataRequest.verify|verify} messages. + * @param message ExportDataRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.automl.v1beta1.IExportDataRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ExportDataRequest message, length delimited. Does not implicitly {@link google.cloud.automl.v1beta1.ExportDataRequest.verify|verify} messages. + * @param message ExportDataRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.automl.v1beta1.IExportDataRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an ExportDataRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ExportDataRequest + * @throws {Error} If the payload is not 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.automl.v1beta1.ExportDataRequest; + + /** + * Decodes an ExportDataRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ExportDataRequest + * @throws {Error} If the payload 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.automl.v1beta1.ExportDataRequest; + + /** + * Verifies an ExportDataRequest message. + * @param message Plain 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 ExportDataRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ExportDataRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.automl.v1beta1.ExportDataRequest; + + /** + * Creates a plain object from an ExportDataRequest message. Also converts values to other types if specified. + * @param message ExportDataRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.automl.v1beta1.ExportDataRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ExportDataRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ExportDataRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a GetAnnotationSpecRequest. */ + interface IGetAnnotationSpecRequest { + + /** GetAnnotationSpecRequest name */ + name?: (string|null); + } + + /** Represents a GetAnnotationSpecRequest. */ + class GetAnnotationSpecRequest implements IGetAnnotationSpecRequest { + + /** + * Constructs a new GetAnnotationSpecRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.automl.v1beta1.IGetAnnotationSpecRequest); + + /** GetAnnotationSpecRequest name. */ + public name: string; + + /** + * Creates a new GetAnnotationSpecRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GetAnnotationSpecRequest instance + */ + public static create(properties?: google.cloud.automl.v1beta1.IGetAnnotationSpecRequest): google.cloud.automl.v1beta1.GetAnnotationSpecRequest; + + /** + * Encodes the specified GetAnnotationSpecRequest message. Does not implicitly {@link google.cloud.automl.v1beta1.GetAnnotationSpecRequest.verify|verify} messages. + * @param message GetAnnotationSpecRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.automl.v1beta1.IGetAnnotationSpecRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GetAnnotationSpecRequest message, length delimited. Does not implicitly {@link google.cloud.automl.v1beta1.GetAnnotationSpecRequest.verify|verify} messages. + * @param message GetAnnotationSpecRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.automl.v1beta1.IGetAnnotationSpecRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GetAnnotationSpecRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GetAnnotationSpecRequest + * @throws {Error} If the payload is not 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.automl.v1beta1.GetAnnotationSpecRequest; + + /** + * Decodes a GetAnnotationSpecRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GetAnnotationSpecRequest + * @throws {Error} If the payload 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.automl.v1beta1.GetAnnotationSpecRequest; + + /** + * Verifies a GetAnnotationSpecRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GetAnnotationSpecRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GetAnnotationSpecRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.automl.v1beta1.GetAnnotationSpecRequest; + + /** + * Creates a plain object from a GetAnnotationSpecRequest message. Also converts values to other types if specified. + * @param message GetAnnotationSpecRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.automl.v1beta1.GetAnnotationSpecRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GetAnnotationSpecRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GetAnnotationSpecRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a GetTableSpecRequest. */ + interface IGetTableSpecRequest { + + /** GetTableSpecRequest name */ + name?: (string|null); + + /** GetTableSpecRequest fieldMask */ + fieldMask?: (google.protobuf.IFieldMask|null); + } + + /** Represents a GetTableSpecRequest. */ + class GetTableSpecRequest implements IGetTableSpecRequest { + + /** + * Constructs a new GetTableSpecRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.automl.v1beta1.IGetTableSpecRequest); + + /** GetTableSpecRequest name. */ + public name: string; + + /** GetTableSpecRequest fieldMask. */ + public fieldMask?: (google.protobuf.IFieldMask|null); + + /** + * Creates a new GetTableSpecRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GetTableSpecRequest instance + */ + public static create(properties?: google.cloud.automl.v1beta1.IGetTableSpecRequest): google.cloud.automl.v1beta1.GetTableSpecRequest; + + /** + * Encodes the specified GetTableSpecRequest message. Does not implicitly {@link google.cloud.automl.v1beta1.GetTableSpecRequest.verify|verify} messages. + * @param message GetTableSpecRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.automl.v1beta1.IGetTableSpecRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GetTableSpecRequest message, length delimited. Does not implicitly {@link google.cloud.automl.v1beta1.GetTableSpecRequest.verify|verify} messages. + * @param message GetTableSpecRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.automl.v1beta1.IGetTableSpecRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GetTableSpecRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GetTableSpecRequest + * @throws {Error} If the payload is not 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.automl.v1beta1.GetTableSpecRequest; + + /** + * Decodes a GetTableSpecRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GetTableSpecRequest + * @throws {Error} If the payload 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.automl.v1beta1.GetTableSpecRequest; + + /** + * Verifies a GetTableSpecRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GetTableSpecRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GetTableSpecRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.automl.v1beta1.GetTableSpecRequest; + + /** + * Creates a plain object from a GetTableSpecRequest message. Also converts values to other types if specified. + * @param message GetTableSpecRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.automl.v1beta1.GetTableSpecRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GetTableSpecRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GetTableSpecRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListTableSpecsRequest. */ + interface IListTableSpecsRequest { + + /** ListTableSpecsRequest parent */ + parent?: (string|null); + + /** ListTableSpecsRequest fieldMask */ + fieldMask?: (google.protobuf.IFieldMask|null); + + /** ListTableSpecsRequest filter */ + filter?: (string|null); + + /** ListTableSpecsRequest pageSize */ + pageSize?: (number|null); + + /** ListTableSpecsRequest pageToken */ + pageToken?: (string|null); + } + + /** Represents a ListTableSpecsRequest. */ + class ListTableSpecsRequest implements IListTableSpecsRequest { + + /** + * Constructs a new ListTableSpecsRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.automl.v1beta1.IListTableSpecsRequest); + + /** ListTableSpecsRequest parent. */ + public parent: string; + + /** ListTableSpecsRequest fieldMask. */ + public fieldMask?: (google.protobuf.IFieldMask|null); + + /** ListTableSpecsRequest filter. */ + public filter: string; + + /** ListTableSpecsRequest pageSize. */ + public pageSize: number; + + /** ListTableSpecsRequest pageToken. */ + public pageToken: string; + + /** + * Creates a new ListTableSpecsRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ListTableSpecsRequest instance + */ + public static create(properties?: google.cloud.automl.v1beta1.IListTableSpecsRequest): google.cloud.automl.v1beta1.ListTableSpecsRequest; + + /** + * Encodes the specified ListTableSpecsRequest message. Does not implicitly {@link google.cloud.automl.v1beta1.ListTableSpecsRequest.verify|verify} messages. + * @param message ListTableSpecsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.automl.v1beta1.IListTableSpecsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListTableSpecsRequest message, length delimited. Does not implicitly {@link google.cloud.automl.v1beta1.ListTableSpecsRequest.verify|verify} messages. + * @param message ListTableSpecsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.automl.v1beta1.IListTableSpecsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListTableSpecsRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListTableSpecsRequest + * @throws {Error} If the payload is not 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.automl.v1beta1.ListTableSpecsRequest; + + /** + * Decodes a ListTableSpecsRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListTableSpecsRequest + * @throws {Error} If the payload 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.automl.v1beta1.ListTableSpecsRequest; + + /** + * Verifies a ListTableSpecsRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListTableSpecsRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListTableSpecsRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.automl.v1beta1.ListTableSpecsRequest; + + /** + * Creates a plain object from a ListTableSpecsRequest message. Also converts values to other types if specified. + * @param message ListTableSpecsRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.automl.v1beta1.ListTableSpecsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListTableSpecsRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListTableSpecsRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListTableSpecsResponse. */ + interface IListTableSpecsResponse { + + /** ListTableSpecsResponse tableSpecs */ + tableSpecs?: (google.cloud.automl.v1beta1.ITableSpec[]|null); + + /** ListTableSpecsResponse nextPageToken */ + nextPageToken?: (string|null); + } + + /** Represents a ListTableSpecsResponse. */ + class ListTableSpecsResponse implements IListTableSpecsResponse { + + /** + * Constructs a new ListTableSpecsResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.automl.v1beta1.IListTableSpecsResponse); + + /** ListTableSpecsResponse tableSpecs. */ + public tableSpecs: google.cloud.automl.v1beta1.ITableSpec[]; + + /** ListTableSpecsResponse nextPageToken. */ + public nextPageToken: string; + + /** + * Creates a new ListTableSpecsResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ListTableSpecsResponse instance + */ + public static create(properties?: google.cloud.automl.v1beta1.IListTableSpecsResponse): google.cloud.automl.v1beta1.ListTableSpecsResponse; + + /** + * Encodes the specified ListTableSpecsResponse message. Does not implicitly {@link google.cloud.automl.v1beta1.ListTableSpecsResponse.verify|verify} messages. + * @param message ListTableSpecsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.automl.v1beta1.IListTableSpecsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListTableSpecsResponse message, length delimited. Does not implicitly {@link google.cloud.automl.v1beta1.ListTableSpecsResponse.verify|verify} messages. + * @param message ListTableSpecsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.automl.v1beta1.IListTableSpecsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListTableSpecsResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListTableSpecsResponse + * @throws {Error} If the payload is not 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.automl.v1beta1.ListTableSpecsResponse; + + /** + * Decodes a ListTableSpecsResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListTableSpecsResponse + * @throws {Error} If the payload 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.automl.v1beta1.ListTableSpecsResponse; + + /** + * Verifies a ListTableSpecsResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListTableSpecsResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListTableSpecsResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.automl.v1beta1.ListTableSpecsResponse; + + /** + * Creates a plain object from a ListTableSpecsResponse message. Also converts values to other types if specified. + * @param message ListTableSpecsResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.automl.v1beta1.ListTableSpecsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListTableSpecsResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListTableSpecsResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an UpdateTableSpecRequest. */ + interface IUpdateTableSpecRequest { + + /** UpdateTableSpecRequest tableSpec */ + tableSpec?: (google.cloud.automl.v1beta1.ITableSpec|null); + + /** UpdateTableSpecRequest updateMask */ + updateMask?: (google.protobuf.IFieldMask|null); + } + + /** Represents an UpdateTableSpecRequest. */ + class UpdateTableSpecRequest implements IUpdateTableSpecRequest { + + /** + * Constructs a new UpdateTableSpecRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.automl.v1beta1.IUpdateTableSpecRequest); + + /** UpdateTableSpecRequest tableSpec. */ + public tableSpec?: (google.cloud.automl.v1beta1.ITableSpec|null); + + /** UpdateTableSpecRequest updateMask. */ + public updateMask?: (google.protobuf.IFieldMask|null); + + /** + * Creates a new UpdateTableSpecRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns UpdateTableSpecRequest instance + */ + public static create(properties?: google.cloud.automl.v1beta1.IUpdateTableSpecRequest): google.cloud.automl.v1beta1.UpdateTableSpecRequest; + + /** + * Encodes the specified UpdateTableSpecRequest message. Does not implicitly {@link google.cloud.automl.v1beta1.UpdateTableSpecRequest.verify|verify} messages. + * @param message UpdateTableSpecRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.automl.v1beta1.IUpdateTableSpecRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified UpdateTableSpecRequest message, length delimited. Does not implicitly {@link google.cloud.automl.v1beta1.UpdateTableSpecRequest.verify|verify} messages. + * @param message UpdateTableSpecRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.automl.v1beta1.IUpdateTableSpecRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an UpdateTableSpecRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns UpdateTableSpecRequest + * @throws {Error} If the payload is not 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.automl.v1beta1.UpdateTableSpecRequest; + + /** + * Decodes an UpdateTableSpecRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns UpdateTableSpecRequest + * @throws {Error} If the payload 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.automl.v1beta1.UpdateTableSpecRequest; + + /** + * Verifies an UpdateTableSpecRequest message. + * @param message Plain 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 UpdateTableSpecRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns UpdateTableSpecRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.automl.v1beta1.UpdateTableSpecRequest; + + /** + * Creates a plain object from an UpdateTableSpecRequest message. Also converts values to other types if specified. + * @param message UpdateTableSpecRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.automl.v1beta1.UpdateTableSpecRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this UpdateTableSpecRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for UpdateTableSpecRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a GetColumnSpecRequest. */ + interface IGetColumnSpecRequest { + + /** GetColumnSpecRequest name */ + name?: (string|null); + + /** GetColumnSpecRequest fieldMask */ + fieldMask?: (google.protobuf.IFieldMask|null); + } + + /** Represents a GetColumnSpecRequest. */ + class GetColumnSpecRequest implements IGetColumnSpecRequest { + + /** + * Constructs a new GetColumnSpecRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.automl.v1beta1.IGetColumnSpecRequest); + + /** GetColumnSpecRequest name. */ + public name: string; + + /** GetColumnSpecRequest fieldMask. */ + public fieldMask?: (google.protobuf.IFieldMask|null); + + /** + * Creates a new GetColumnSpecRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GetColumnSpecRequest instance + */ + public static create(properties?: google.cloud.automl.v1beta1.IGetColumnSpecRequest): google.cloud.automl.v1beta1.GetColumnSpecRequest; + + /** + * Encodes the specified GetColumnSpecRequest message. Does not implicitly {@link google.cloud.automl.v1beta1.GetColumnSpecRequest.verify|verify} messages. + * @param message GetColumnSpecRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.automl.v1beta1.IGetColumnSpecRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GetColumnSpecRequest message, length delimited. Does not implicitly {@link google.cloud.automl.v1beta1.GetColumnSpecRequest.verify|verify} messages. + * @param message GetColumnSpecRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.automl.v1beta1.IGetColumnSpecRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GetColumnSpecRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GetColumnSpecRequest + * @throws {Error} If the payload is not 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.automl.v1beta1.GetColumnSpecRequest; + + /** + * Decodes a GetColumnSpecRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GetColumnSpecRequest + * @throws {Error} If the payload 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.automl.v1beta1.GetColumnSpecRequest; + + /** + * Verifies a GetColumnSpecRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GetColumnSpecRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GetColumnSpecRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.automl.v1beta1.GetColumnSpecRequest; + + /** + * Creates a plain object from a GetColumnSpecRequest message. Also converts values to other types if specified. + * @param message GetColumnSpecRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.automl.v1beta1.GetColumnSpecRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GetColumnSpecRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GetColumnSpecRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListColumnSpecsRequest. */ + interface IListColumnSpecsRequest { + + /** ListColumnSpecsRequest parent */ + parent?: (string|null); + + /** ListColumnSpecsRequest fieldMask */ + fieldMask?: (google.protobuf.IFieldMask|null); + + /** ListColumnSpecsRequest filter */ + filter?: (string|null); + + /** ListColumnSpecsRequest pageSize */ + pageSize?: (number|null); + + /** ListColumnSpecsRequest pageToken */ + pageToken?: (string|null); + } + + /** Represents a ListColumnSpecsRequest. */ + class ListColumnSpecsRequest implements IListColumnSpecsRequest { + + /** + * Constructs a new ListColumnSpecsRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.automl.v1beta1.IListColumnSpecsRequest); + + /** ListColumnSpecsRequest parent. */ + public parent: string; + + /** ListColumnSpecsRequest fieldMask. */ + public fieldMask?: (google.protobuf.IFieldMask|null); + + /** ListColumnSpecsRequest filter. */ + public filter: string; + + /** ListColumnSpecsRequest pageSize. */ + public pageSize: number; + + /** ListColumnSpecsRequest pageToken. */ + public pageToken: string; + + /** + * Creates a new ListColumnSpecsRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ListColumnSpecsRequest instance + */ + public static create(properties?: google.cloud.automl.v1beta1.IListColumnSpecsRequest): google.cloud.automl.v1beta1.ListColumnSpecsRequest; + + /** + * Encodes the specified ListColumnSpecsRequest message. Does not implicitly {@link google.cloud.automl.v1beta1.ListColumnSpecsRequest.verify|verify} messages. + * @param message ListColumnSpecsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.automl.v1beta1.IListColumnSpecsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListColumnSpecsRequest message, length delimited. Does not implicitly {@link google.cloud.automl.v1beta1.ListColumnSpecsRequest.verify|verify} messages. + * @param message ListColumnSpecsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.automl.v1beta1.IListColumnSpecsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListColumnSpecsRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListColumnSpecsRequest + * @throws {Error} If the payload is not 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.automl.v1beta1.ListColumnSpecsRequest; + + /** + * Decodes a ListColumnSpecsRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListColumnSpecsRequest + * @throws {Error} If the payload 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.automl.v1beta1.ListColumnSpecsRequest; + + /** + * Verifies a ListColumnSpecsRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListColumnSpecsRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListColumnSpecsRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.automl.v1beta1.ListColumnSpecsRequest; + + /** + * Creates a plain object from a ListColumnSpecsRequest message. Also converts values to other types if specified. + * @param message ListColumnSpecsRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.automl.v1beta1.ListColumnSpecsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListColumnSpecsRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListColumnSpecsRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListColumnSpecsResponse. */ + interface IListColumnSpecsResponse { + + /** ListColumnSpecsResponse columnSpecs */ + columnSpecs?: (google.cloud.automl.v1beta1.IColumnSpec[]|null); + + /** ListColumnSpecsResponse nextPageToken */ + nextPageToken?: (string|null); + } + + /** Represents a ListColumnSpecsResponse. */ + class ListColumnSpecsResponse implements IListColumnSpecsResponse { + + /** + * Constructs a new ListColumnSpecsResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.automl.v1beta1.IListColumnSpecsResponse); + + /** ListColumnSpecsResponse columnSpecs. */ + public columnSpecs: google.cloud.automl.v1beta1.IColumnSpec[]; + + /** ListColumnSpecsResponse nextPageToken. */ + public nextPageToken: string; + + /** + * Creates a new ListColumnSpecsResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ListColumnSpecsResponse instance + */ + public static create(properties?: google.cloud.automl.v1beta1.IListColumnSpecsResponse): google.cloud.automl.v1beta1.ListColumnSpecsResponse; + + /** + * Encodes the specified ListColumnSpecsResponse message. Does not implicitly {@link google.cloud.automl.v1beta1.ListColumnSpecsResponse.verify|verify} messages. + * @param message ListColumnSpecsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.automl.v1beta1.IListColumnSpecsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListColumnSpecsResponse message, length delimited. Does not implicitly {@link google.cloud.automl.v1beta1.ListColumnSpecsResponse.verify|verify} messages. + * @param message ListColumnSpecsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.automl.v1beta1.IListColumnSpecsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListColumnSpecsResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListColumnSpecsResponse + * @throws {Error} If the payload is not 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.automl.v1beta1.ListColumnSpecsResponse; + + /** + * Decodes a ListColumnSpecsResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListColumnSpecsResponse + * @throws {Error} If the payload 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.automl.v1beta1.ListColumnSpecsResponse; + + /** + * Verifies a ListColumnSpecsResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListColumnSpecsResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListColumnSpecsResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.automl.v1beta1.ListColumnSpecsResponse; + + /** + * Creates a plain object from a ListColumnSpecsResponse message. Also converts values to other types if specified. + * @param message ListColumnSpecsResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.automl.v1beta1.ListColumnSpecsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListColumnSpecsResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListColumnSpecsResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an UpdateColumnSpecRequest. */ + interface IUpdateColumnSpecRequest { + + /** UpdateColumnSpecRequest columnSpec */ + columnSpec?: (google.cloud.automl.v1beta1.IColumnSpec|null); + + /** UpdateColumnSpecRequest updateMask */ + updateMask?: (google.protobuf.IFieldMask|null); + } + + /** Represents an UpdateColumnSpecRequest. */ + class UpdateColumnSpecRequest implements IUpdateColumnSpecRequest { + + /** + * Constructs a new UpdateColumnSpecRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.automl.v1beta1.IUpdateColumnSpecRequest); + + /** UpdateColumnSpecRequest columnSpec. */ + public columnSpec?: (google.cloud.automl.v1beta1.IColumnSpec|null); + + /** UpdateColumnSpecRequest updateMask. */ + public updateMask?: (google.protobuf.IFieldMask|null); + + /** + * Creates a new UpdateColumnSpecRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns UpdateColumnSpecRequest instance + */ + public static create(properties?: google.cloud.automl.v1beta1.IUpdateColumnSpecRequest): google.cloud.automl.v1beta1.UpdateColumnSpecRequest; + + /** + * Encodes the specified UpdateColumnSpecRequest message. Does not implicitly {@link google.cloud.automl.v1beta1.UpdateColumnSpecRequest.verify|verify} messages. + * @param message UpdateColumnSpecRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.automl.v1beta1.IUpdateColumnSpecRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified UpdateColumnSpecRequest message, length delimited. Does not implicitly {@link google.cloud.automl.v1beta1.UpdateColumnSpecRequest.verify|verify} messages. + * @param message UpdateColumnSpecRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.automl.v1beta1.IUpdateColumnSpecRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an UpdateColumnSpecRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns UpdateColumnSpecRequest + * @throws {Error} If the payload is not 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.automl.v1beta1.UpdateColumnSpecRequest; + + /** + * Decodes an UpdateColumnSpecRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns UpdateColumnSpecRequest + * @throws {Error} If the payload 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.automl.v1beta1.UpdateColumnSpecRequest; + + /** + * Verifies an UpdateColumnSpecRequest message. + * @param message Plain 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 UpdateColumnSpecRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns UpdateColumnSpecRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.automl.v1beta1.UpdateColumnSpecRequest; + + /** + * Creates a plain object from an UpdateColumnSpecRequest message. Also converts values to other types if specified. + * @param message UpdateColumnSpecRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.automl.v1beta1.UpdateColumnSpecRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this UpdateColumnSpecRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for UpdateColumnSpecRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a CreateModelRequest. */ + interface ICreateModelRequest { + + /** CreateModelRequest parent */ + parent?: (string|null); + + /** CreateModelRequest model */ + model?: (google.cloud.automl.v1beta1.IModel|null); + } + + /** Represents a CreateModelRequest. */ + class CreateModelRequest implements ICreateModelRequest { + + /** + * Constructs a new CreateModelRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.automl.v1beta1.ICreateModelRequest); + + /** CreateModelRequest parent. */ + public parent: string; + + /** CreateModelRequest model. */ + public model?: (google.cloud.automl.v1beta1.IModel|null); + + /** + * Creates a new CreateModelRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns CreateModelRequest instance + */ + public static create(properties?: google.cloud.automl.v1beta1.ICreateModelRequest): google.cloud.automl.v1beta1.CreateModelRequest; + + /** + * Encodes the specified CreateModelRequest message. Does not implicitly {@link google.cloud.automl.v1beta1.CreateModelRequest.verify|verify} messages. + * @param message CreateModelRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.automl.v1beta1.ICreateModelRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CreateModelRequest message, length delimited. Does not implicitly {@link google.cloud.automl.v1beta1.CreateModelRequest.verify|verify} messages. + * @param message CreateModelRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.automl.v1beta1.ICreateModelRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CreateModelRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CreateModelRequest + * @throws {Error} If the payload is not 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.automl.v1beta1.CreateModelRequest; + + /** + * Decodes a CreateModelRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CreateModelRequest + * @throws {Error} If the payload 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.automl.v1beta1.CreateModelRequest; + + /** + * Verifies a CreateModelRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CreateModelRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CreateModelRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.automl.v1beta1.CreateModelRequest; + + /** + * Creates a plain object from a CreateModelRequest message. Also converts values to other types if specified. + * @param message CreateModelRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.automl.v1beta1.CreateModelRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CreateModelRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CreateModelRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a GetModelRequest. */ + interface IGetModelRequest { + + /** GetModelRequest name */ + name?: (string|null); + } + + /** Represents a GetModelRequest. */ + class GetModelRequest implements IGetModelRequest { + + /** + * Constructs a new GetModelRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.automl.v1beta1.IGetModelRequest); + + /** GetModelRequest name. */ + public name: string; + + /** + * Creates a new GetModelRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GetModelRequest instance + */ + public static create(properties?: google.cloud.automl.v1beta1.IGetModelRequest): google.cloud.automl.v1beta1.GetModelRequest; + + /** + * Encodes the specified GetModelRequest message. Does not implicitly {@link google.cloud.automl.v1beta1.GetModelRequest.verify|verify} messages. + * @param message GetModelRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.automl.v1beta1.IGetModelRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GetModelRequest message, length delimited. Does not implicitly {@link google.cloud.automl.v1beta1.GetModelRequest.verify|verify} messages. + * @param message GetModelRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.automl.v1beta1.IGetModelRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GetModelRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GetModelRequest + * @throws {Error} If the payload is not 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.automl.v1beta1.GetModelRequest; + + /** + * Decodes a GetModelRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GetModelRequest + * @throws {Error} If the payload 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.automl.v1beta1.GetModelRequest; + + /** + * Verifies a GetModelRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GetModelRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GetModelRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.automl.v1beta1.GetModelRequest; + + /** + * Creates a plain object from a GetModelRequest message. Also converts values to other types if specified. + * @param message GetModelRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.automl.v1beta1.GetModelRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GetModelRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GetModelRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListModelsRequest. */ + interface IListModelsRequest { + + /** ListModelsRequest parent */ + parent?: (string|null); + + /** ListModelsRequest filter */ + filter?: (string|null); + + /** ListModelsRequest pageSize */ + pageSize?: (number|null); + + /** ListModelsRequest pageToken */ + pageToken?: (string|null); + } + + /** Represents a ListModelsRequest. */ + class ListModelsRequest implements IListModelsRequest { + + /** + * Constructs a new ListModelsRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.automl.v1beta1.IListModelsRequest); + + /** ListModelsRequest parent. */ + public parent: string; + + /** ListModelsRequest filter. */ + public filter: string; + + /** ListModelsRequest pageSize. */ + public pageSize: number; + + /** ListModelsRequest pageToken. */ + public pageToken: string; + + /** + * Creates a new ListModelsRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ListModelsRequest instance + */ + public static create(properties?: google.cloud.automl.v1beta1.IListModelsRequest): google.cloud.automl.v1beta1.ListModelsRequest; + + /** + * Encodes the specified ListModelsRequest message. Does not implicitly {@link google.cloud.automl.v1beta1.ListModelsRequest.verify|verify} messages. + * @param message ListModelsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.automl.v1beta1.IListModelsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListModelsRequest message, length delimited. Does not implicitly {@link google.cloud.automl.v1beta1.ListModelsRequest.verify|verify} messages. + * @param message ListModelsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.automl.v1beta1.IListModelsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListModelsRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListModelsRequest + * @throws {Error} If the payload is not 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.automl.v1beta1.ListModelsRequest; + + /** + * Decodes a ListModelsRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListModelsRequest + * @throws {Error} If the payload 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.automl.v1beta1.ListModelsRequest; + + /** + * Verifies a ListModelsRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListModelsRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListModelsRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.automl.v1beta1.ListModelsRequest; + + /** + * Creates a plain object from a ListModelsRequest message. Also converts values to other types if specified. + * @param message ListModelsRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.automl.v1beta1.ListModelsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListModelsRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListModelsRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListModelsResponse. */ + interface IListModelsResponse { + + /** ListModelsResponse model */ + model?: (google.cloud.automl.v1beta1.IModel[]|null); + + /** ListModelsResponse nextPageToken */ + nextPageToken?: (string|null); + } + + /** Represents a ListModelsResponse. */ + class ListModelsResponse implements IListModelsResponse { + + /** + * Constructs a new ListModelsResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.automl.v1beta1.IListModelsResponse); + + /** ListModelsResponse model. */ + public model: google.cloud.automl.v1beta1.IModel[]; + + /** ListModelsResponse nextPageToken. */ + public nextPageToken: string; + + /** + * Creates a new ListModelsResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ListModelsResponse instance + */ + public static create(properties?: google.cloud.automl.v1beta1.IListModelsResponse): google.cloud.automl.v1beta1.ListModelsResponse; + + /** + * Encodes the specified ListModelsResponse message. Does not implicitly {@link google.cloud.automl.v1beta1.ListModelsResponse.verify|verify} messages. + * @param message ListModelsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.automl.v1beta1.IListModelsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListModelsResponse message, length delimited. Does not implicitly {@link google.cloud.automl.v1beta1.ListModelsResponse.verify|verify} messages. + * @param message ListModelsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.automl.v1beta1.IListModelsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListModelsResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListModelsResponse + * @throws {Error} If the payload is not 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.automl.v1beta1.ListModelsResponse; + + /** + * Decodes a ListModelsResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListModelsResponse + * @throws {Error} If the payload 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.automl.v1beta1.ListModelsResponse; + + /** + * Verifies a ListModelsResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListModelsResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListModelsResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.automl.v1beta1.ListModelsResponse; + + /** + * Creates a plain object from a ListModelsResponse message. Also converts values to other types if specified. + * @param message ListModelsResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.automl.v1beta1.ListModelsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListModelsResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListModelsResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a DeleteModelRequest. */ + interface IDeleteModelRequest { + + /** DeleteModelRequest name */ + name?: (string|null); + } + + /** Represents a DeleteModelRequest. */ + class DeleteModelRequest implements IDeleteModelRequest { + + /** + * Constructs a new DeleteModelRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.automl.v1beta1.IDeleteModelRequest); + + /** DeleteModelRequest name. */ + public name: string; + + /** + * Creates a new DeleteModelRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns DeleteModelRequest instance + */ + public static create(properties?: google.cloud.automl.v1beta1.IDeleteModelRequest): google.cloud.automl.v1beta1.DeleteModelRequest; + + /** + * Encodes the specified DeleteModelRequest message. Does not implicitly {@link google.cloud.automl.v1beta1.DeleteModelRequest.verify|verify} messages. + * @param message DeleteModelRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.automl.v1beta1.IDeleteModelRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DeleteModelRequest message, length delimited. Does not implicitly {@link google.cloud.automl.v1beta1.DeleteModelRequest.verify|verify} messages. + * @param message DeleteModelRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.automl.v1beta1.IDeleteModelRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DeleteModelRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DeleteModelRequest + * @throws {Error} If the payload is not 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.automl.v1beta1.DeleteModelRequest; + + /** + * Decodes a DeleteModelRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DeleteModelRequest + * @throws {Error} If the payload 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.automl.v1beta1.DeleteModelRequest; + + /** + * Verifies a DeleteModelRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DeleteModelRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DeleteModelRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.automl.v1beta1.DeleteModelRequest; + + /** + * Creates a plain object from a DeleteModelRequest message. Also converts values to other types if specified. + * @param message DeleteModelRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.automl.v1beta1.DeleteModelRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DeleteModelRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DeleteModelRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a DeployModelRequest. */ + interface IDeployModelRequest { + + /** DeployModelRequest imageObjectDetectionModelDeploymentMetadata */ + imageObjectDetectionModelDeploymentMetadata?: (google.cloud.automl.v1beta1.IImageObjectDetectionModelDeploymentMetadata|null); + + /** DeployModelRequest imageClassificationModelDeploymentMetadata */ + imageClassificationModelDeploymentMetadata?: (google.cloud.automl.v1beta1.IImageClassificationModelDeploymentMetadata|null); + + /** DeployModelRequest name */ + name?: (string|null); + } + + /** Represents a DeployModelRequest. */ + class DeployModelRequest implements IDeployModelRequest { + + /** + * Constructs a new DeployModelRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.automl.v1beta1.IDeployModelRequest); + + /** DeployModelRequest imageObjectDetectionModelDeploymentMetadata. */ + public imageObjectDetectionModelDeploymentMetadata?: (google.cloud.automl.v1beta1.IImageObjectDetectionModelDeploymentMetadata|null); + + /** DeployModelRequest imageClassificationModelDeploymentMetadata. */ + public imageClassificationModelDeploymentMetadata?: (google.cloud.automl.v1beta1.IImageClassificationModelDeploymentMetadata|null); + + /** DeployModelRequest name. */ + public name: string; + + /** DeployModelRequest modelDeploymentMetadata. */ + public modelDeploymentMetadata?: ("imageObjectDetectionModelDeploymentMetadata"|"imageClassificationModelDeploymentMetadata"); + + /** + * Creates a new DeployModelRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns DeployModelRequest instance + */ + public static create(properties?: google.cloud.automl.v1beta1.IDeployModelRequest): google.cloud.automl.v1beta1.DeployModelRequest; + + /** + * Encodes the specified DeployModelRequest message. Does not implicitly {@link google.cloud.automl.v1beta1.DeployModelRequest.verify|verify} messages. + * @param message DeployModelRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.automl.v1beta1.IDeployModelRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DeployModelRequest message, length delimited. Does not implicitly {@link google.cloud.automl.v1beta1.DeployModelRequest.verify|verify} messages. + * @param message DeployModelRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.automl.v1beta1.IDeployModelRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DeployModelRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DeployModelRequest + * @throws {Error} If the payload is not 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.automl.v1beta1.DeployModelRequest; + + /** + * Decodes a DeployModelRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DeployModelRequest + * @throws {Error} If the payload 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.automl.v1beta1.DeployModelRequest; + + /** + * Verifies a DeployModelRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DeployModelRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DeployModelRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.automl.v1beta1.DeployModelRequest; + + /** + * Creates a plain object from a DeployModelRequest message. Also converts values to other types if specified. + * @param message DeployModelRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.automl.v1beta1.DeployModelRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DeployModelRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DeployModelRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an UndeployModelRequest. */ + interface IUndeployModelRequest { + + /** UndeployModelRequest name */ + name?: (string|null); + } + + /** Represents an UndeployModelRequest. */ + class UndeployModelRequest implements IUndeployModelRequest { + + /** + * Constructs a new UndeployModelRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.automl.v1beta1.IUndeployModelRequest); + + /** UndeployModelRequest name. */ + public name: string; + + /** + * Creates a new UndeployModelRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns UndeployModelRequest instance + */ + public static create(properties?: google.cloud.automl.v1beta1.IUndeployModelRequest): google.cloud.automl.v1beta1.UndeployModelRequest; + + /** + * Encodes the specified UndeployModelRequest message. Does not implicitly {@link google.cloud.automl.v1beta1.UndeployModelRequest.verify|verify} messages. + * @param message UndeployModelRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.automl.v1beta1.IUndeployModelRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified UndeployModelRequest message, length delimited. Does not implicitly {@link google.cloud.automl.v1beta1.UndeployModelRequest.verify|verify} messages. + * @param message UndeployModelRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.automl.v1beta1.IUndeployModelRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an UndeployModelRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns UndeployModelRequest + * @throws {Error} If the payload is not 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.automl.v1beta1.UndeployModelRequest; + + /** + * Decodes an UndeployModelRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns UndeployModelRequest + * @throws {Error} If the payload 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.automl.v1beta1.UndeployModelRequest; + + /** + * Verifies an UndeployModelRequest message. + * @param message Plain 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 UndeployModelRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns UndeployModelRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.automl.v1beta1.UndeployModelRequest; + + /** + * Creates a plain object from an UndeployModelRequest message. Also converts values to other types if specified. + * @param message UndeployModelRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.automl.v1beta1.UndeployModelRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this UndeployModelRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for UndeployModelRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an ExportModelRequest. */ + interface IExportModelRequest { + + /** ExportModelRequest name */ + name?: (string|null); + + /** ExportModelRequest outputConfig */ + outputConfig?: (google.cloud.automl.v1beta1.IModelExportOutputConfig|null); + } + + /** Represents an ExportModelRequest. */ + class ExportModelRequest implements IExportModelRequest { + + /** + * Constructs a new ExportModelRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.automl.v1beta1.IExportModelRequest); + + /** ExportModelRequest name. */ + public name: string; + + /** ExportModelRequest outputConfig. */ + public outputConfig?: (google.cloud.automl.v1beta1.IModelExportOutputConfig|null); + + /** + * Creates a new ExportModelRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ExportModelRequest instance + */ + public static create(properties?: google.cloud.automl.v1beta1.IExportModelRequest): google.cloud.automl.v1beta1.ExportModelRequest; + + /** + * Encodes the specified ExportModelRequest message. Does not implicitly {@link google.cloud.automl.v1beta1.ExportModelRequest.verify|verify} messages. + * @param message ExportModelRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.automl.v1beta1.IExportModelRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ExportModelRequest message, length delimited. Does not implicitly {@link google.cloud.automl.v1beta1.ExportModelRequest.verify|verify} messages. + * @param message ExportModelRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.automl.v1beta1.IExportModelRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an ExportModelRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ExportModelRequest + * @throws {Error} If the payload is not 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.automl.v1beta1.ExportModelRequest; + + /** + * Decodes an ExportModelRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ExportModelRequest + * @throws {Error} If the payload 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.automl.v1beta1.ExportModelRequest; + + /** + * Verifies an ExportModelRequest message. + * @param message Plain 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 ExportModelRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ExportModelRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.automl.v1beta1.ExportModelRequest; + + /** + * Creates a plain object from an ExportModelRequest message. Also converts values to other types if specified. + * @param message ExportModelRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.automl.v1beta1.ExportModelRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ExportModelRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ExportModelRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an ExportEvaluatedExamplesRequest. */ + interface IExportEvaluatedExamplesRequest { + + /** ExportEvaluatedExamplesRequest name */ + name?: (string|null); + + /** ExportEvaluatedExamplesRequest outputConfig */ + outputConfig?: (google.cloud.automl.v1beta1.IExportEvaluatedExamplesOutputConfig|null); + } + + /** Represents an ExportEvaluatedExamplesRequest. */ + class ExportEvaluatedExamplesRequest implements IExportEvaluatedExamplesRequest { + + /** + * Constructs a new ExportEvaluatedExamplesRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.automl.v1beta1.IExportEvaluatedExamplesRequest); + + /** ExportEvaluatedExamplesRequest name. */ + public name: string; + + /** ExportEvaluatedExamplesRequest outputConfig. */ + public outputConfig?: (google.cloud.automl.v1beta1.IExportEvaluatedExamplesOutputConfig|null); + + /** + * Creates a new ExportEvaluatedExamplesRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ExportEvaluatedExamplesRequest instance + */ + public static create(properties?: google.cloud.automl.v1beta1.IExportEvaluatedExamplesRequest): google.cloud.automl.v1beta1.ExportEvaluatedExamplesRequest; + + /** + * Encodes the specified ExportEvaluatedExamplesRequest message. Does not implicitly {@link google.cloud.automl.v1beta1.ExportEvaluatedExamplesRequest.verify|verify} messages. + * @param message ExportEvaluatedExamplesRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.automl.v1beta1.IExportEvaluatedExamplesRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ExportEvaluatedExamplesRequest message, length delimited. Does not implicitly {@link google.cloud.automl.v1beta1.ExportEvaluatedExamplesRequest.verify|verify} messages. + * @param message ExportEvaluatedExamplesRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.automl.v1beta1.IExportEvaluatedExamplesRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an ExportEvaluatedExamplesRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ExportEvaluatedExamplesRequest + * @throws {Error} If the payload is not 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.automl.v1beta1.ExportEvaluatedExamplesRequest; + + /** + * Decodes an ExportEvaluatedExamplesRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ExportEvaluatedExamplesRequest + * @throws {Error} If the payload 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.automl.v1beta1.ExportEvaluatedExamplesRequest; + + /** + * Verifies an ExportEvaluatedExamplesRequest message. + * @param message Plain 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 ExportEvaluatedExamplesRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ExportEvaluatedExamplesRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.automl.v1beta1.ExportEvaluatedExamplesRequest; + + /** + * Creates a plain object from an ExportEvaluatedExamplesRequest message. Also converts values to other types if specified. + * @param message ExportEvaluatedExamplesRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.automl.v1beta1.ExportEvaluatedExamplesRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ExportEvaluatedExamplesRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ExportEvaluatedExamplesRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a GetModelEvaluationRequest. */ + interface IGetModelEvaluationRequest { + + /** GetModelEvaluationRequest name */ + name?: (string|null); + } + + /** Represents a GetModelEvaluationRequest. */ + class GetModelEvaluationRequest implements IGetModelEvaluationRequest { + + /** + * Constructs a new GetModelEvaluationRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.automl.v1beta1.IGetModelEvaluationRequest); + + /** GetModelEvaluationRequest name. */ + public name: string; + + /** + * Creates a new GetModelEvaluationRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GetModelEvaluationRequest instance + */ + public static create(properties?: google.cloud.automl.v1beta1.IGetModelEvaluationRequest): google.cloud.automl.v1beta1.GetModelEvaluationRequest; + + /** + * Encodes the specified GetModelEvaluationRequest message. Does not implicitly {@link google.cloud.automl.v1beta1.GetModelEvaluationRequest.verify|verify} messages. + * @param message GetModelEvaluationRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.automl.v1beta1.IGetModelEvaluationRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GetModelEvaluationRequest message, length delimited. Does not implicitly {@link google.cloud.automl.v1beta1.GetModelEvaluationRequest.verify|verify} messages. + * @param message GetModelEvaluationRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.automl.v1beta1.IGetModelEvaluationRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GetModelEvaluationRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GetModelEvaluationRequest + * @throws {Error} If the payload is not 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.automl.v1beta1.GetModelEvaluationRequest; + + /** + * Decodes a GetModelEvaluationRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GetModelEvaluationRequest + * @throws {Error} If the payload 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.automl.v1beta1.GetModelEvaluationRequest; + + /** + * Verifies a GetModelEvaluationRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GetModelEvaluationRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GetModelEvaluationRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.automl.v1beta1.GetModelEvaluationRequest; + + /** + * Creates a plain object from a GetModelEvaluationRequest message. Also converts values to other types if specified. + * @param message GetModelEvaluationRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.automl.v1beta1.GetModelEvaluationRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GetModelEvaluationRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GetModelEvaluationRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListModelEvaluationsRequest. */ + interface IListModelEvaluationsRequest { + + /** ListModelEvaluationsRequest parent */ + parent?: (string|null); + + /** ListModelEvaluationsRequest filter */ + filter?: (string|null); + + /** ListModelEvaluationsRequest pageSize */ + pageSize?: (number|null); + + /** ListModelEvaluationsRequest pageToken */ + pageToken?: (string|null); + } + + /** Represents a ListModelEvaluationsRequest. */ + class ListModelEvaluationsRequest implements IListModelEvaluationsRequest { + + /** + * Constructs a new ListModelEvaluationsRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.automl.v1beta1.IListModelEvaluationsRequest); + + /** ListModelEvaluationsRequest parent. */ + public parent: string; + + /** ListModelEvaluationsRequest filter. */ + public filter: string; + + /** ListModelEvaluationsRequest pageSize. */ + public pageSize: number; + + /** ListModelEvaluationsRequest pageToken. */ + public pageToken: string; + + /** + * Creates a new ListModelEvaluationsRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ListModelEvaluationsRequest instance + */ + public static create(properties?: google.cloud.automl.v1beta1.IListModelEvaluationsRequest): google.cloud.automl.v1beta1.ListModelEvaluationsRequest; + + /** + * Encodes the specified ListModelEvaluationsRequest message. Does not implicitly {@link google.cloud.automl.v1beta1.ListModelEvaluationsRequest.verify|verify} messages. + * @param message ListModelEvaluationsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.automl.v1beta1.IListModelEvaluationsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListModelEvaluationsRequest message, length delimited. Does not implicitly {@link google.cloud.automl.v1beta1.ListModelEvaluationsRequest.verify|verify} messages. + * @param message ListModelEvaluationsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.automl.v1beta1.IListModelEvaluationsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListModelEvaluationsRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListModelEvaluationsRequest + * @throws {Error} If the payload is not 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.automl.v1beta1.ListModelEvaluationsRequest; + + /** + * Decodes a ListModelEvaluationsRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListModelEvaluationsRequest + * @throws {Error} If the payload 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.automl.v1beta1.ListModelEvaluationsRequest; + + /** + * Verifies a ListModelEvaluationsRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListModelEvaluationsRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListModelEvaluationsRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.automl.v1beta1.ListModelEvaluationsRequest; + + /** + * Creates a plain object from a ListModelEvaluationsRequest message. Also converts values to other types if specified. + * @param message ListModelEvaluationsRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.automl.v1beta1.ListModelEvaluationsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListModelEvaluationsRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListModelEvaluationsRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListModelEvaluationsResponse. */ + interface IListModelEvaluationsResponse { + + /** ListModelEvaluationsResponse modelEvaluation */ + modelEvaluation?: (google.cloud.automl.v1beta1.IModelEvaluation[]|null); + + /** ListModelEvaluationsResponse nextPageToken */ + nextPageToken?: (string|null); + } + + /** Represents a ListModelEvaluationsResponse. */ + class ListModelEvaluationsResponse implements IListModelEvaluationsResponse { + + /** + * Constructs a new ListModelEvaluationsResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.automl.v1beta1.IListModelEvaluationsResponse); + + /** ListModelEvaluationsResponse modelEvaluation. */ + public modelEvaluation: google.cloud.automl.v1beta1.IModelEvaluation[]; + + /** ListModelEvaluationsResponse nextPageToken. */ + public nextPageToken: string; + + /** + * Creates a new ListModelEvaluationsResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ListModelEvaluationsResponse instance + */ + public static create(properties?: google.cloud.automl.v1beta1.IListModelEvaluationsResponse): google.cloud.automl.v1beta1.ListModelEvaluationsResponse; + + /** + * Encodes the specified ListModelEvaluationsResponse message. Does not implicitly {@link google.cloud.automl.v1beta1.ListModelEvaluationsResponse.verify|verify} messages. + * @param message ListModelEvaluationsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.automl.v1beta1.IListModelEvaluationsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListModelEvaluationsResponse message, length delimited. Does not implicitly {@link google.cloud.automl.v1beta1.ListModelEvaluationsResponse.verify|verify} messages. + * @param message ListModelEvaluationsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.automl.v1beta1.IListModelEvaluationsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListModelEvaluationsResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListModelEvaluationsResponse + * @throws {Error} If the payload is not 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.automl.v1beta1.ListModelEvaluationsResponse; + + /** + * Decodes a ListModelEvaluationsResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListModelEvaluationsResponse + * @throws {Error} If the payload 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.automl.v1beta1.ListModelEvaluationsResponse; + + /** + * Verifies a ListModelEvaluationsResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListModelEvaluationsResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListModelEvaluationsResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.automl.v1beta1.ListModelEvaluationsResponse; + + /** + * Creates a plain object from a ListModelEvaluationsResponse message. Also converts values to other types if specified. + * @param message ListModelEvaluationsResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.automl.v1beta1.ListModelEvaluationsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListModelEvaluationsResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListModelEvaluationsResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TableSpec. */ + interface ITableSpec { + + /** TableSpec name */ + name?: (string|null); + + /** TableSpec timeColumnSpecId */ + timeColumnSpecId?: (string|null); + + /** TableSpec rowCount */ + rowCount?: (number|Long|string|null); + + /** TableSpec validRowCount */ + validRowCount?: (number|Long|string|null); + + /** TableSpec columnCount */ + columnCount?: (number|Long|string|null); + + /** TableSpec inputConfigs */ + inputConfigs?: (google.cloud.automl.v1beta1.IInputConfig[]|null); + + /** TableSpec etag */ + etag?: (string|null); + } + + /** Represents a TableSpec. */ + class TableSpec implements ITableSpec { + + /** + * Constructs a new TableSpec. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.automl.v1beta1.ITableSpec); + + /** TableSpec name. */ + public name: string; + + /** TableSpec timeColumnSpecId. */ + public timeColumnSpecId: string; + + /** TableSpec rowCount. */ + public rowCount: (number|Long|string); + + /** TableSpec validRowCount. */ + public validRowCount: (number|Long|string); + + /** TableSpec columnCount. */ + public columnCount: (number|Long|string); + + /** TableSpec inputConfigs. */ + public inputConfigs: google.cloud.automl.v1beta1.IInputConfig[]; + + /** TableSpec etag. */ + public etag: string; + + /** + * Creates a new TableSpec instance using the specified properties. + * @param [properties] Properties to set + * @returns TableSpec instance + */ + public static create(properties?: google.cloud.automl.v1beta1.ITableSpec): google.cloud.automl.v1beta1.TableSpec; + + /** + * Encodes the specified TableSpec message. Does not implicitly {@link google.cloud.automl.v1beta1.TableSpec.verify|verify} messages. + * @param message TableSpec message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.automl.v1beta1.ITableSpec, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified TableSpec message, length delimited. Does not implicitly {@link google.cloud.automl.v1beta1.TableSpec.verify|verify} messages. + * @param message TableSpec message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.automl.v1beta1.ITableSpec, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TableSpec message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns TableSpec + * @throws {Error} If the payload is not 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.automl.v1beta1.TableSpec; + + /** + * Decodes a TableSpec message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns TableSpec + * @throws {Error} If the payload 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.automl.v1beta1.TableSpec; + + /** + * Verifies a TableSpec message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a TableSpec message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns TableSpec + */ + public static fromObject(object: { [k: string]: any }): google.cloud.automl.v1beta1.TableSpec; + + /** + * Creates a plain object from a TableSpec message. Also converts values to other types if specified. + * @param message TableSpec + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.automl.v1beta1.TableSpec, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this TableSpec to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for TableSpec + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + } + } + + /** 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 + } + + /** 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; + } + + /** 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); + } + + /** 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[]; + + /** + * 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); + } + + /** 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); + + /** + * 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); + } + + /** 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); + + /** + * 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 + } + + /** 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 + } + } + + /** 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; + } + + /** 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?: (string|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: string; + + /** + * 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); + } + + /** 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[]; + + /** + * 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; + } + + /** 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_REQUIRED = 2, + LABEL_REPEATED = 3 + } + } + + /** 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 phpGenericServices */ + phpGenericServices?: (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 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 phpGenericServices. */ + public phpGenericServices: 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 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 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 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 target */ + target?: (google.protobuf.FieldOptions.OptionTargetType|keyof typeof google.protobuf.FieldOptions.OptionTargetType|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 target. */ + public target: (google.protobuf.FieldOptions.OptionTargetType|keyof typeof google.protobuf.FieldOptions.OptionTargetType); + + /** 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 OneofOptions. */ + interface IOneofOptions { + + /** 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 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 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 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 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 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 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); + } + + /** Represents a ServiceOptions. */ + class ServiceOptions implements IServiceOptions { + + /** + * Constructs a new ServiceOptions. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IServiceOptions); + + /** 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 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 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|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|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 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 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|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|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 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 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 Struct. */ + interface IStruct { + + /** Struct fields */ + fields?: ({ [k: string]: google.protobuf.IValue }|null); + } + + /** Represents a Struct. */ + class Struct implements IStruct { + + /** + * Constructs a new Struct. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IStruct); + + /** Struct fields. */ + public fields: { [k: string]: google.protobuf.IValue }; + + /** + * Creates a new Struct instance using the specified properties. + * @param [properties] Properties to set + * @returns Struct instance + */ + public static create(properties?: google.protobuf.IStruct): google.protobuf.Struct; + + /** + * Encodes the specified Struct message. Does not implicitly {@link google.protobuf.Struct.verify|verify} messages. + * @param message Struct message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IStruct, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Struct message, length delimited. Does not implicitly {@link google.protobuf.Struct.verify|verify} messages. + * @param message Struct message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IStruct, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Struct message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Struct + * @throws {Error} If the payload is not 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.Struct; + + /** + * Decodes a Struct message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Struct + * @throws {Error} If the payload 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.Struct; + + /** + * Verifies a Struct message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Struct message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Struct + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.Struct; + + /** + * Creates a plain object from a Struct message. Also converts values to other types if specified. + * @param message Struct + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.Struct, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Struct to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Struct + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Value. */ + interface IValue { + + /** Value nullValue */ + nullValue?: (google.protobuf.NullValue|keyof typeof google.protobuf.NullValue|null); + + /** Value numberValue */ + numberValue?: (number|null); + + /** Value stringValue */ + stringValue?: (string|null); + + /** Value boolValue */ + boolValue?: (boolean|null); + + /** Value structValue */ + structValue?: (google.protobuf.IStruct|null); + + /** Value listValue */ + listValue?: (google.protobuf.IListValue|null); + } + + /** Represents a Value. */ + class Value implements IValue { + + /** + * Constructs a new Value. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IValue); + + /** Value nullValue. */ + public nullValue?: (google.protobuf.NullValue|keyof typeof google.protobuf.NullValue|null); + + /** Value numberValue. */ + public numberValue?: (number|null); + + /** Value stringValue. */ + public stringValue?: (string|null); + + /** Value boolValue. */ + public boolValue?: (boolean|null); + + /** Value structValue. */ + public structValue?: (google.protobuf.IStruct|null); + + /** Value listValue. */ + public listValue?: (google.protobuf.IListValue|null); + + /** Value kind. */ + public kind?: ("nullValue"|"numberValue"|"stringValue"|"boolValue"|"structValue"|"listValue"); + + /** + * Creates a new Value instance using the specified properties. + * @param [properties] Properties to set + * @returns Value instance + */ + public static create(properties?: google.protobuf.IValue): google.protobuf.Value; + + /** + * Encodes the specified Value message. Does not implicitly {@link google.protobuf.Value.verify|verify} messages. + * @param message Value message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IValue, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Value message, length delimited. Does not implicitly {@link google.protobuf.Value.verify|verify} messages. + * @param message Value message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IValue, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Value message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Value + * @throws {Error} If the payload is not 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.Value; + + /** + * Decodes a Value message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Value + * @throws {Error} If the payload 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.Value; + + /** + * Verifies a Value message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Value message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Value + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.Value; + + /** + * Creates a plain object from a Value message. Also converts values to other types if specified. + * @param message Value + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.Value, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Value to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Value + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** NullValue enum. */ + enum NullValue { + NULL_VALUE = 0 + } + + /** Properties of a ListValue. */ + interface IListValue { + + /** ListValue values */ + values?: (google.protobuf.IValue[]|null); + } + + /** Represents a ListValue. */ + class ListValue implements IListValue { + + /** + * Constructs a new ListValue. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IListValue); + + /** ListValue values. */ + public values: google.protobuf.IValue[]; + + /** + * Creates a new ListValue instance using the specified properties. + * @param [properties] Properties to set + * @returns ListValue instance + */ + public static create(properties?: google.protobuf.IListValue): google.protobuf.ListValue; + + /** + * Encodes the specified ListValue message. Does not implicitly {@link google.protobuf.ListValue.verify|verify} messages. + * @param message ListValue message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IListValue, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListValue message, length delimited. Does not implicitly {@link google.protobuf.ListValue.verify|verify} messages. + * @param message ListValue message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IListValue, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListValue message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListValue + * @throws {Error} If the payload is not 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.ListValue; + + /** + * Decodes a ListValue message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListValue + * @throws {Error} If the payload 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.ListValue; + + /** + * Verifies a ListValue message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListValue message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListValue + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.ListValue; + + /** + * Creates a plain object from a ListValue message. Also converts values to other types if specified. + * @param message ListValue + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.ListValue, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListValue to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListValue + * @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; + } + } + + /** 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; + } + } +} diff --git a/packages/google-cloud-automl/protos/protos.js b/packages/google-cloud-automl/protos/protos.js new file mode 100644 index 00000000000..406b847bda6 --- /dev/null +++ b/packages/google-cloud-automl/protos/protos.js @@ -0,0 +1,80974 @@ +// Copyright 2023 Google LLC +// +// Licensed under the Apache License, Version 2.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_automl_protos || ($protobuf.roots._google_cloud_automl_protos = {}); + + $root.google = (function() { + + /** + * Namespace google. + * @exports google + * @namespace + */ + var google = {}; + + google.cloud = (function() { + + /** + * Namespace cloud. + * @memberof google + * @namespace + */ + var cloud = {}; + + cloud.automl = (function() { + + /** + * Namespace automl. + * @memberof google.cloud + * @namespace + */ + var automl = {}; + + automl.v1 = (function() { + + /** + * Namespace v1. + * @memberof google.cloud.automl + * @namespace + */ + var v1 = {}; + + v1.AnnotationPayload = (function() { + + /** + * Properties of an AnnotationPayload. + * @memberof google.cloud.automl.v1 + * @interface IAnnotationPayload + * @property {google.cloud.automl.v1.ITranslationAnnotation|null} [translation] AnnotationPayload translation + * @property {google.cloud.automl.v1.IClassificationAnnotation|null} [classification] AnnotationPayload classification + * @property {google.cloud.automl.v1.IImageObjectDetectionAnnotation|null} [imageObjectDetection] AnnotationPayload imageObjectDetection + * @property {google.cloud.automl.v1.ITextExtractionAnnotation|null} [textExtraction] AnnotationPayload textExtraction + * @property {google.cloud.automl.v1.ITextSentimentAnnotation|null} [textSentiment] AnnotationPayload textSentiment + * @property {string|null} [annotationSpecId] AnnotationPayload annotationSpecId + * @property {string|null} [displayName] AnnotationPayload displayName + */ + + /** + * Constructs a new AnnotationPayload. + * @memberof google.cloud.automl.v1 + * @classdesc Represents an AnnotationPayload. + * @implements IAnnotationPayload + * @constructor + * @param {google.cloud.automl.v1.IAnnotationPayload=} [properties] Properties to set + */ + function AnnotationPayload(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * AnnotationPayload translation. + * @member {google.cloud.automl.v1.ITranslationAnnotation|null|undefined} translation + * @memberof google.cloud.automl.v1.AnnotationPayload + * @instance + */ + AnnotationPayload.prototype.translation = null; + + /** + * AnnotationPayload classification. + * @member {google.cloud.automl.v1.IClassificationAnnotation|null|undefined} classification + * @memberof google.cloud.automl.v1.AnnotationPayload + * @instance + */ + AnnotationPayload.prototype.classification = null; + + /** + * AnnotationPayload imageObjectDetection. + * @member {google.cloud.automl.v1.IImageObjectDetectionAnnotation|null|undefined} imageObjectDetection + * @memberof google.cloud.automl.v1.AnnotationPayload + * @instance + */ + AnnotationPayload.prototype.imageObjectDetection = null; + + /** + * AnnotationPayload textExtraction. + * @member {google.cloud.automl.v1.ITextExtractionAnnotation|null|undefined} textExtraction + * @memberof google.cloud.automl.v1.AnnotationPayload + * @instance + */ + AnnotationPayload.prototype.textExtraction = null; + + /** + * AnnotationPayload textSentiment. + * @member {google.cloud.automl.v1.ITextSentimentAnnotation|null|undefined} textSentiment + * @memberof google.cloud.automl.v1.AnnotationPayload + * @instance + */ + AnnotationPayload.prototype.textSentiment = null; + + /** + * AnnotationPayload annotationSpecId. + * @member {string} annotationSpecId + * @memberof google.cloud.automl.v1.AnnotationPayload + * @instance + */ + AnnotationPayload.prototype.annotationSpecId = ""; + + /** + * AnnotationPayload displayName. + * @member {string} displayName + * @memberof google.cloud.automl.v1.AnnotationPayload + * @instance + */ + AnnotationPayload.prototype.displayName = ""; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * AnnotationPayload detail. + * @member {"translation"|"classification"|"imageObjectDetection"|"textExtraction"|"textSentiment"|undefined} detail + * @memberof google.cloud.automl.v1.AnnotationPayload + * @instance + */ + Object.defineProperty(AnnotationPayload.prototype, "detail", { + get: $util.oneOfGetter($oneOfFields = ["translation", "classification", "imageObjectDetection", "textExtraction", "textSentiment"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new AnnotationPayload instance using the specified properties. + * @function create + * @memberof google.cloud.automl.v1.AnnotationPayload + * @static + * @param {google.cloud.automl.v1.IAnnotationPayload=} [properties] Properties to set + * @returns {google.cloud.automl.v1.AnnotationPayload} AnnotationPayload instance + */ + AnnotationPayload.create = function create(properties) { + return new AnnotationPayload(properties); + }; + + /** + * Encodes the specified AnnotationPayload message. Does not implicitly {@link google.cloud.automl.v1.AnnotationPayload.verify|verify} messages. + * @function encode + * @memberof google.cloud.automl.v1.AnnotationPayload + * @static + * @param {google.cloud.automl.v1.IAnnotationPayload} message AnnotationPayload message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AnnotationPayload.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.annotationSpecId != null && Object.hasOwnProperty.call(message, "annotationSpecId")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.annotationSpecId); + if (message.translation != null && Object.hasOwnProperty.call(message, "translation")) + $root.google.cloud.automl.v1.TranslationAnnotation.encode(message.translation, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.classification != null && Object.hasOwnProperty.call(message, "classification")) + $root.google.cloud.automl.v1.ClassificationAnnotation.encode(message.classification, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.imageObjectDetection != null && Object.hasOwnProperty.call(message, "imageObjectDetection")) + $root.google.cloud.automl.v1.ImageObjectDetectionAnnotation.encode(message.imageObjectDetection, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.displayName != null && Object.hasOwnProperty.call(message, "displayName")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.displayName); + if (message.textExtraction != null && Object.hasOwnProperty.call(message, "textExtraction")) + $root.google.cloud.automl.v1.TextExtractionAnnotation.encode(message.textExtraction, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + if (message.textSentiment != null && Object.hasOwnProperty.call(message, "textSentiment")) + $root.google.cloud.automl.v1.TextSentimentAnnotation.encode(message.textSentiment, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified AnnotationPayload message, length delimited. Does not implicitly {@link google.cloud.automl.v1.AnnotationPayload.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.automl.v1.AnnotationPayload + * @static + * @param {google.cloud.automl.v1.IAnnotationPayload} message AnnotationPayload message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AnnotationPayload.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an AnnotationPayload message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.automl.v1.AnnotationPayload + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.automl.v1.AnnotationPayload} AnnotationPayload + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AnnotationPayload.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.automl.v1.AnnotationPayload(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 2: { + message.translation = $root.google.cloud.automl.v1.TranslationAnnotation.decode(reader, reader.uint32()); + break; + } + case 3: { + message.classification = $root.google.cloud.automl.v1.ClassificationAnnotation.decode(reader, reader.uint32()); + break; + } + case 4: { + message.imageObjectDetection = $root.google.cloud.automl.v1.ImageObjectDetectionAnnotation.decode(reader, reader.uint32()); + break; + } + case 6: { + message.textExtraction = $root.google.cloud.automl.v1.TextExtractionAnnotation.decode(reader, reader.uint32()); + break; + } + case 7: { + message.textSentiment = $root.google.cloud.automl.v1.TextSentimentAnnotation.decode(reader, reader.uint32()); + break; + } + case 1: { + message.annotationSpecId = reader.string(); + break; + } + case 5: { + message.displayName = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an AnnotationPayload message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.automl.v1.AnnotationPayload + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.automl.v1.AnnotationPayload} AnnotationPayload + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AnnotationPayload.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an AnnotationPayload message. + * @function verify + * @memberof google.cloud.automl.v1.AnnotationPayload + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + AnnotationPayload.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.translation != null && message.hasOwnProperty("translation")) { + properties.detail = 1; + { + var error = $root.google.cloud.automl.v1.TranslationAnnotation.verify(message.translation); + if (error) + return "translation." + error; + } + } + if (message.classification != null && message.hasOwnProperty("classification")) { + if (properties.detail === 1) + return "detail: multiple values"; + properties.detail = 1; + { + var error = $root.google.cloud.automl.v1.ClassificationAnnotation.verify(message.classification); + if (error) + return "classification." + error; + } + } + if (message.imageObjectDetection != null && message.hasOwnProperty("imageObjectDetection")) { + if (properties.detail === 1) + return "detail: multiple values"; + properties.detail = 1; + { + var error = $root.google.cloud.automl.v1.ImageObjectDetectionAnnotation.verify(message.imageObjectDetection); + if (error) + return "imageObjectDetection." + error; + } + } + if (message.textExtraction != null && message.hasOwnProperty("textExtraction")) { + if (properties.detail === 1) + return "detail: multiple values"; + properties.detail = 1; + { + var error = $root.google.cloud.automl.v1.TextExtractionAnnotation.verify(message.textExtraction); + if (error) + return "textExtraction." + error; + } + } + if (message.textSentiment != null && message.hasOwnProperty("textSentiment")) { + if (properties.detail === 1) + return "detail: multiple values"; + properties.detail = 1; + { + var error = $root.google.cloud.automl.v1.TextSentimentAnnotation.verify(message.textSentiment); + if (error) + return "textSentiment." + error; + } + } + if (message.annotationSpecId != null && message.hasOwnProperty("annotationSpecId")) + if (!$util.isString(message.annotationSpecId)) + return "annotationSpecId: string expected"; + if (message.displayName != null && message.hasOwnProperty("displayName")) + if (!$util.isString(message.displayName)) + return "displayName: string expected"; + return null; + }; + + /** + * Creates an AnnotationPayload message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.automl.v1.AnnotationPayload + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.automl.v1.AnnotationPayload} AnnotationPayload + */ + AnnotationPayload.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.automl.v1.AnnotationPayload) + return object; + var message = new $root.google.cloud.automl.v1.AnnotationPayload(); + if (object.translation != null) { + if (typeof object.translation !== "object") + throw TypeError(".google.cloud.automl.v1.AnnotationPayload.translation: object expected"); + message.translation = $root.google.cloud.automl.v1.TranslationAnnotation.fromObject(object.translation); + } + if (object.classification != null) { + if (typeof object.classification !== "object") + throw TypeError(".google.cloud.automl.v1.AnnotationPayload.classification: object expected"); + message.classification = $root.google.cloud.automl.v1.ClassificationAnnotation.fromObject(object.classification); + } + if (object.imageObjectDetection != null) { + if (typeof object.imageObjectDetection !== "object") + throw TypeError(".google.cloud.automl.v1.AnnotationPayload.imageObjectDetection: object expected"); + message.imageObjectDetection = $root.google.cloud.automl.v1.ImageObjectDetectionAnnotation.fromObject(object.imageObjectDetection); + } + if (object.textExtraction != null) { + if (typeof object.textExtraction !== "object") + throw TypeError(".google.cloud.automl.v1.AnnotationPayload.textExtraction: object expected"); + message.textExtraction = $root.google.cloud.automl.v1.TextExtractionAnnotation.fromObject(object.textExtraction); + } + if (object.textSentiment != null) { + if (typeof object.textSentiment !== "object") + throw TypeError(".google.cloud.automl.v1.AnnotationPayload.textSentiment: object expected"); + message.textSentiment = $root.google.cloud.automl.v1.TextSentimentAnnotation.fromObject(object.textSentiment); + } + if (object.annotationSpecId != null) + message.annotationSpecId = String(object.annotationSpecId); + if (object.displayName != null) + message.displayName = String(object.displayName); + return message; + }; + + /** + * Creates a plain object from an AnnotationPayload message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.automl.v1.AnnotationPayload + * @static + * @param {google.cloud.automl.v1.AnnotationPayload} message AnnotationPayload + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + AnnotationPayload.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.annotationSpecId = ""; + object.displayName = ""; + } + if (message.annotationSpecId != null && message.hasOwnProperty("annotationSpecId")) + object.annotationSpecId = message.annotationSpecId; + if (message.translation != null && message.hasOwnProperty("translation")) { + object.translation = $root.google.cloud.automl.v1.TranslationAnnotation.toObject(message.translation, options); + if (options.oneofs) + object.detail = "translation"; + } + if (message.classification != null && message.hasOwnProperty("classification")) { + object.classification = $root.google.cloud.automl.v1.ClassificationAnnotation.toObject(message.classification, options); + if (options.oneofs) + object.detail = "classification"; + } + if (message.imageObjectDetection != null && message.hasOwnProperty("imageObjectDetection")) { + object.imageObjectDetection = $root.google.cloud.automl.v1.ImageObjectDetectionAnnotation.toObject(message.imageObjectDetection, options); + if (options.oneofs) + object.detail = "imageObjectDetection"; + } + if (message.displayName != null && message.hasOwnProperty("displayName")) + object.displayName = message.displayName; + if (message.textExtraction != null && message.hasOwnProperty("textExtraction")) { + object.textExtraction = $root.google.cloud.automl.v1.TextExtractionAnnotation.toObject(message.textExtraction, options); + if (options.oneofs) + object.detail = "textExtraction"; + } + if (message.textSentiment != null && message.hasOwnProperty("textSentiment")) { + object.textSentiment = $root.google.cloud.automl.v1.TextSentimentAnnotation.toObject(message.textSentiment, options); + if (options.oneofs) + object.detail = "textSentiment"; + } + return object; + }; + + /** + * Converts this AnnotationPayload to JSON. + * @function toJSON + * @memberof google.cloud.automl.v1.AnnotationPayload + * @instance + * @returns {Object.} JSON object + */ + AnnotationPayload.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for AnnotationPayload + * @function getTypeUrl + * @memberof google.cloud.automl.v1.AnnotationPayload + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + AnnotationPayload.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.automl.v1.AnnotationPayload"; + }; + + return AnnotationPayload; + })(); + + /** + * ClassificationType enum. + * @name google.cloud.automl.v1.ClassificationType + * @enum {number} + * @property {number} CLASSIFICATION_TYPE_UNSPECIFIED=0 CLASSIFICATION_TYPE_UNSPECIFIED value + * @property {number} MULTICLASS=1 MULTICLASS value + * @property {number} MULTILABEL=2 MULTILABEL value + */ + v1.ClassificationType = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "CLASSIFICATION_TYPE_UNSPECIFIED"] = 0; + values[valuesById[1] = "MULTICLASS"] = 1; + values[valuesById[2] = "MULTILABEL"] = 2; + return values; + })(); + + v1.ClassificationAnnotation = (function() { + + /** + * Properties of a ClassificationAnnotation. + * @memberof google.cloud.automl.v1 + * @interface IClassificationAnnotation + * @property {number|null} [score] ClassificationAnnotation score + */ + + /** + * Constructs a new ClassificationAnnotation. + * @memberof google.cloud.automl.v1 + * @classdesc Represents a ClassificationAnnotation. + * @implements IClassificationAnnotation + * @constructor + * @param {google.cloud.automl.v1.IClassificationAnnotation=} [properties] Properties to set + */ + function ClassificationAnnotation(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ClassificationAnnotation score. + * @member {number} score + * @memberof google.cloud.automl.v1.ClassificationAnnotation + * @instance + */ + ClassificationAnnotation.prototype.score = 0; + + /** + * Creates a new ClassificationAnnotation instance using the specified properties. + * @function create + * @memberof google.cloud.automl.v1.ClassificationAnnotation + * @static + * @param {google.cloud.automl.v1.IClassificationAnnotation=} [properties] Properties to set + * @returns {google.cloud.automl.v1.ClassificationAnnotation} ClassificationAnnotation instance + */ + ClassificationAnnotation.create = function create(properties) { + return new ClassificationAnnotation(properties); + }; + + /** + * Encodes the specified ClassificationAnnotation message. Does not implicitly {@link google.cloud.automl.v1.ClassificationAnnotation.verify|verify} messages. + * @function encode + * @memberof google.cloud.automl.v1.ClassificationAnnotation + * @static + * @param {google.cloud.automl.v1.IClassificationAnnotation} message ClassificationAnnotation message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ClassificationAnnotation.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.score != null && Object.hasOwnProperty.call(message, "score")) + writer.uint32(/* id 1, wireType 5 =*/13).float(message.score); + return writer; + }; + + /** + * Encodes the specified ClassificationAnnotation message, length delimited. Does not implicitly {@link google.cloud.automl.v1.ClassificationAnnotation.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.automl.v1.ClassificationAnnotation + * @static + * @param {google.cloud.automl.v1.IClassificationAnnotation} message ClassificationAnnotation message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ClassificationAnnotation.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ClassificationAnnotation message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.automl.v1.ClassificationAnnotation + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.automl.v1.ClassificationAnnotation} ClassificationAnnotation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ClassificationAnnotation.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.automl.v1.ClassificationAnnotation(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.score = reader.float(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ClassificationAnnotation message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.automl.v1.ClassificationAnnotation + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.automl.v1.ClassificationAnnotation} ClassificationAnnotation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ClassificationAnnotation.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ClassificationAnnotation message. + * @function verify + * @memberof google.cloud.automl.v1.ClassificationAnnotation + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ClassificationAnnotation.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.score != null && message.hasOwnProperty("score")) + if (typeof message.score !== "number") + return "score: number expected"; + return null; + }; + + /** + * Creates a ClassificationAnnotation message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.automl.v1.ClassificationAnnotation + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.automl.v1.ClassificationAnnotation} ClassificationAnnotation + */ + ClassificationAnnotation.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.automl.v1.ClassificationAnnotation) + return object; + var message = new $root.google.cloud.automl.v1.ClassificationAnnotation(); + if (object.score != null) + message.score = Number(object.score); + return message; + }; + + /** + * Creates a plain object from a ClassificationAnnotation message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.automl.v1.ClassificationAnnotation + * @static + * @param {google.cloud.automl.v1.ClassificationAnnotation} message ClassificationAnnotation + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ClassificationAnnotation.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.score = 0; + if (message.score != null && message.hasOwnProperty("score")) + object.score = options.json && !isFinite(message.score) ? String(message.score) : message.score; + return object; + }; + + /** + * Converts this ClassificationAnnotation to JSON. + * @function toJSON + * @memberof google.cloud.automl.v1.ClassificationAnnotation + * @instance + * @returns {Object.} JSON object + */ + ClassificationAnnotation.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ClassificationAnnotation + * @function getTypeUrl + * @memberof google.cloud.automl.v1.ClassificationAnnotation + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ClassificationAnnotation.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.automl.v1.ClassificationAnnotation"; + }; + + return ClassificationAnnotation; + })(); + + v1.ClassificationEvaluationMetrics = (function() { + + /** + * Properties of a ClassificationEvaluationMetrics. + * @memberof google.cloud.automl.v1 + * @interface IClassificationEvaluationMetrics + * @property {number|null} [auPrc] ClassificationEvaluationMetrics auPrc + * @property {number|null} [auRoc] ClassificationEvaluationMetrics auRoc + * @property {number|null} [logLoss] ClassificationEvaluationMetrics logLoss + * @property {Array.|null} [confidenceMetricsEntry] ClassificationEvaluationMetrics confidenceMetricsEntry + * @property {google.cloud.automl.v1.ClassificationEvaluationMetrics.IConfusionMatrix|null} [confusionMatrix] ClassificationEvaluationMetrics confusionMatrix + * @property {Array.|null} [annotationSpecId] ClassificationEvaluationMetrics annotationSpecId + */ + + /** + * Constructs a new ClassificationEvaluationMetrics. + * @memberof google.cloud.automl.v1 + * @classdesc Represents a ClassificationEvaluationMetrics. + * @implements IClassificationEvaluationMetrics + * @constructor + * @param {google.cloud.automl.v1.IClassificationEvaluationMetrics=} [properties] Properties to set + */ + function ClassificationEvaluationMetrics(properties) { + this.confidenceMetricsEntry = []; + this.annotationSpecId = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ClassificationEvaluationMetrics auPrc. + * @member {number} auPrc + * @memberof google.cloud.automl.v1.ClassificationEvaluationMetrics + * @instance + */ + ClassificationEvaluationMetrics.prototype.auPrc = 0; + + /** + * ClassificationEvaluationMetrics auRoc. + * @member {number} auRoc + * @memberof google.cloud.automl.v1.ClassificationEvaluationMetrics + * @instance + */ + ClassificationEvaluationMetrics.prototype.auRoc = 0; + + /** + * ClassificationEvaluationMetrics logLoss. + * @member {number} logLoss + * @memberof google.cloud.automl.v1.ClassificationEvaluationMetrics + * @instance + */ + ClassificationEvaluationMetrics.prototype.logLoss = 0; + + /** + * ClassificationEvaluationMetrics confidenceMetricsEntry. + * @member {Array.} confidenceMetricsEntry + * @memberof google.cloud.automl.v1.ClassificationEvaluationMetrics + * @instance + */ + ClassificationEvaluationMetrics.prototype.confidenceMetricsEntry = $util.emptyArray; + + /** + * ClassificationEvaluationMetrics confusionMatrix. + * @member {google.cloud.automl.v1.ClassificationEvaluationMetrics.IConfusionMatrix|null|undefined} confusionMatrix + * @memberof google.cloud.automl.v1.ClassificationEvaluationMetrics + * @instance + */ + ClassificationEvaluationMetrics.prototype.confusionMatrix = null; + + /** + * ClassificationEvaluationMetrics annotationSpecId. + * @member {Array.} annotationSpecId + * @memberof google.cloud.automl.v1.ClassificationEvaluationMetrics + * @instance + */ + ClassificationEvaluationMetrics.prototype.annotationSpecId = $util.emptyArray; + + /** + * Creates a new ClassificationEvaluationMetrics instance using the specified properties. + * @function create + * @memberof google.cloud.automl.v1.ClassificationEvaluationMetrics + * @static + * @param {google.cloud.automl.v1.IClassificationEvaluationMetrics=} [properties] Properties to set + * @returns {google.cloud.automl.v1.ClassificationEvaluationMetrics} ClassificationEvaluationMetrics instance + */ + ClassificationEvaluationMetrics.create = function create(properties) { + return new ClassificationEvaluationMetrics(properties); + }; + + /** + * Encodes the specified ClassificationEvaluationMetrics message. Does not implicitly {@link google.cloud.automl.v1.ClassificationEvaluationMetrics.verify|verify} messages. + * @function encode + * @memberof google.cloud.automl.v1.ClassificationEvaluationMetrics + * @static + * @param {google.cloud.automl.v1.IClassificationEvaluationMetrics} message ClassificationEvaluationMetrics message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ClassificationEvaluationMetrics.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.auPrc != null && Object.hasOwnProperty.call(message, "auPrc")) + writer.uint32(/* id 1, wireType 5 =*/13).float(message.auPrc); + if (message.confidenceMetricsEntry != null && message.confidenceMetricsEntry.length) + for (var i = 0; i < message.confidenceMetricsEntry.length; ++i) + $root.google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfidenceMetricsEntry.encode(message.confidenceMetricsEntry[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.confusionMatrix != null && Object.hasOwnProperty.call(message, "confusionMatrix")) + $root.google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfusionMatrix.encode(message.confusionMatrix, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.annotationSpecId != null && message.annotationSpecId.length) + for (var i = 0; i < message.annotationSpecId.length; ++i) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.annotationSpecId[i]); + if (message.auRoc != null && Object.hasOwnProperty.call(message, "auRoc")) + writer.uint32(/* id 6, wireType 5 =*/53).float(message.auRoc); + if (message.logLoss != null && Object.hasOwnProperty.call(message, "logLoss")) + writer.uint32(/* id 7, wireType 5 =*/61).float(message.logLoss); + return writer; + }; + + /** + * Encodes the specified ClassificationEvaluationMetrics message, length delimited. Does not implicitly {@link google.cloud.automl.v1.ClassificationEvaluationMetrics.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.automl.v1.ClassificationEvaluationMetrics + * @static + * @param {google.cloud.automl.v1.IClassificationEvaluationMetrics} message ClassificationEvaluationMetrics message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ClassificationEvaluationMetrics.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ClassificationEvaluationMetrics message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.automl.v1.ClassificationEvaluationMetrics + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.automl.v1.ClassificationEvaluationMetrics} ClassificationEvaluationMetrics + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ClassificationEvaluationMetrics.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.automl.v1.ClassificationEvaluationMetrics(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.auPrc = reader.float(); + break; + } + case 6: { + message.auRoc = reader.float(); + break; + } + case 7: { + message.logLoss = reader.float(); + break; + } + case 3: { + if (!(message.confidenceMetricsEntry && message.confidenceMetricsEntry.length)) + message.confidenceMetricsEntry = []; + message.confidenceMetricsEntry.push($root.google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfidenceMetricsEntry.decode(reader, reader.uint32())); + break; + } + case 4: { + message.confusionMatrix = $root.google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfusionMatrix.decode(reader, reader.uint32()); + break; + } + case 5: { + if (!(message.annotationSpecId && message.annotationSpecId.length)) + message.annotationSpecId = []; + message.annotationSpecId.push(reader.string()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ClassificationEvaluationMetrics message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.automl.v1.ClassificationEvaluationMetrics + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.automl.v1.ClassificationEvaluationMetrics} ClassificationEvaluationMetrics + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ClassificationEvaluationMetrics.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ClassificationEvaluationMetrics message. + * @function verify + * @memberof google.cloud.automl.v1.ClassificationEvaluationMetrics + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ClassificationEvaluationMetrics.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.auPrc != null && message.hasOwnProperty("auPrc")) + if (typeof message.auPrc !== "number") + return "auPrc: number expected"; + if (message.auRoc != null && message.hasOwnProperty("auRoc")) + if (typeof message.auRoc !== "number") + return "auRoc: number expected"; + if (message.logLoss != null && message.hasOwnProperty("logLoss")) + if (typeof message.logLoss !== "number") + return "logLoss: number expected"; + if (message.confidenceMetricsEntry != null && message.hasOwnProperty("confidenceMetricsEntry")) { + if (!Array.isArray(message.confidenceMetricsEntry)) + return "confidenceMetricsEntry: array expected"; + for (var i = 0; i < message.confidenceMetricsEntry.length; ++i) { + var error = $root.google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfidenceMetricsEntry.verify(message.confidenceMetricsEntry[i]); + if (error) + return "confidenceMetricsEntry." + error; + } + } + if (message.confusionMatrix != null && message.hasOwnProperty("confusionMatrix")) { + var error = $root.google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfusionMatrix.verify(message.confusionMatrix); + if (error) + return "confusionMatrix." + error; + } + if (message.annotationSpecId != null && message.hasOwnProperty("annotationSpecId")) { + if (!Array.isArray(message.annotationSpecId)) + return "annotationSpecId: array expected"; + for (var i = 0; i < message.annotationSpecId.length; ++i) + if (!$util.isString(message.annotationSpecId[i])) + return "annotationSpecId: string[] expected"; + } + return null; + }; + + /** + * Creates a ClassificationEvaluationMetrics message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.automl.v1.ClassificationEvaluationMetrics + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.automl.v1.ClassificationEvaluationMetrics} ClassificationEvaluationMetrics + */ + ClassificationEvaluationMetrics.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.automl.v1.ClassificationEvaluationMetrics) + return object; + var message = new $root.google.cloud.automl.v1.ClassificationEvaluationMetrics(); + if (object.auPrc != null) + message.auPrc = Number(object.auPrc); + if (object.auRoc != null) + message.auRoc = Number(object.auRoc); + if (object.logLoss != null) + message.logLoss = Number(object.logLoss); + if (object.confidenceMetricsEntry) { + if (!Array.isArray(object.confidenceMetricsEntry)) + throw TypeError(".google.cloud.automl.v1.ClassificationEvaluationMetrics.confidenceMetricsEntry: array expected"); + message.confidenceMetricsEntry = []; + for (var i = 0; i < object.confidenceMetricsEntry.length; ++i) { + if (typeof object.confidenceMetricsEntry[i] !== "object") + throw TypeError(".google.cloud.automl.v1.ClassificationEvaluationMetrics.confidenceMetricsEntry: object expected"); + message.confidenceMetricsEntry[i] = $root.google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfidenceMetricsEntry.fromObject(object.confidenceMetricsEntry[i]); + } + } + if (object.confusionMatrix != null) { + if (typeof object.confusionMatrix !== "object") + throw TypeError(".google.cloud.automl.v1.ClassificationEvaluationMetrics.confusionMatrix: object expected"); + message.confusionMatrix = $root.google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfusionMatrix.fromObject(object.confusionMatrix); + } + if (object.annotationSpecId) { + if (!Array.isArray(object.annotationSpecId)) + throw TypeError(".google.cloud.automl.v1.ClassificationEvaluationMetrics.annotationSpecId: array expected"); + message.annotationSpecId = []; + for (var i = 0; i < object.annotationSpecId.length; ++i) + message.annotationSpecId[i] = String(object.annotationSpecId[i]); + } + return message; + }; + + /** + * Creates a plain object from a ClassificationEvaluationMetrics message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.automl.v1.ClassificationEvaluationMetrics + * @static + * @param {google.cloud.automl.v1.ClassificationEvaluationMetrics} message ClassificationEvaluationMetrics + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ClassificationEvaluationMetrics.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.confidenceMetricsEntry = []; + object.annotationSpecId = []; + } + if (options.defaults) { + object.auPrc = 0; + object.confusionMatrix = null; + object.auRoc = 0; + object.logLoss = 0; + } + if (message.auPrc != null && message.hasOwnProperty("auPrc")) + object.auPrc = options.json && !isFinite(message.auPrc) ? String(message.auPrc) : message.auPrc; + if (message.confidenceMetricsEntry && message.confidenceMetricsEntry.length) { + object.confidenceMetricsEntry = []; + for (var j = 0; j < message.confidenceMetricsEntry.length; ++j) + object.confidenceMetricsEntry[j] = $root.google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfidenceMetricsEntry.toObject(message.confidenceMetricsEntry[j], options); + } + if (message.confusionMatrix != null && message.hasOwnProperty("confusionMatrix")) + object.confusionMatrix = $root.google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfusionMatrix.toObject(message.confusionMatrix, options); + if (message.annotationSpecId && message.annotationSpecId.length) { + object.annotationSpecId = []; + for (var j = 0; j < message.annotationSpecId.length; ++j) + object.annotationSpecId[j] = message.annotationSpecId[j]; + } + if (message.auRoc != null && message.hasOwnProperty("auRoc")) + object.auRoc = options.json && !isFinite(message.auRoc) ? String(message.auRoc) : message.auRoc; + if (message.logLoss != null && message.hasOwnProperty("logLoss")) + object.logLoss = options.json && !isFinite(message.logLoss) ? String(message.logLoss) : message.logLoss; + return object; + }; + + /** + * Converts this ClassificationEvaluationMetrics to JSON. + * @function toJSON + * @memberof google.cloud.automl.v1.ClassificationEvaluationMetrics + * @instance + * @returns {Object.} JSON object + */ + ClassificationEvaluationMetrics.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ClassificationEvaluationMetrics + * @function getTypeUrl + * @memberof google.cloud.automl.v1.ClassificationEvaluationMetrics + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ClassificationEvaluationMetrics.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.automl.v1.ClassificationEvaluationMetrics"; + }; + + ClassificationEvaluationMetrics.ConfidenceMetricsEntry = (function() { + + /** + * Properties of a ConfidenceMetricsEntry. + * @memberof google.cloud.automl.v1.ClassificationEvaluationMetrics + * @interface IConfidenceMetricsEntry + * @property {number|null} [confidenceThreshold] ConfidenceMetricsEntry confidenceThreshold + * @property {number|null} [positionThreshold] ConfidenceMetricsEntry positionThreshold + * @property {number|null} [recall] ConfidenceMetricsEntry recall + * @property {number|null} [precision] ConfidenceMetricsEntry precision + * @property {number|null} [falsePositiveRate] ConfidenceMetricsEntry falsePositiveRate + * @property {number|null} [f1Score] ConfidenceMetricsEntry f1Score + * @property {number|null} [recallAt1] ConfidenceMetricsEntry recallAt1 + * @property {number|null} [precisionAt1] ConfidenceMetricsEntry precisionAt1 + * @property {number|null} [falsePositiveRateAt1] ConfidenceMetricsEntry falsePositiveRateAt1 + * @property {number|null} [f1ScoreAt1] ConfidenceMetricsEntry f1ScoreAt1 + * @property {number|Long|null} [truePositiveCount] ConfidenceMetricsEntry truePositiveCount + * @property {number|Long|null} [falsePositiveCount] ConfidenceMetricsEntry falsePositiveCount + * @property {number|Long|null} [falseNegativeCount] ConfidenceMetricsEntry falseNegativeCount + * @property {number|Long|null} [trueNegativeCount] ConfidenceMetricsEntry trueNegativeCount + */ + + /** + * Constructs a new ConfidenceMetricsEntry. + * @memberof google.cloud.automl.v1.ClassificationEvaluationMetrics + * @classdesc Represents a ConfidenceMetricsEntry. + * @implements IConfidenceMetricsEntry + * @constructor + * @param {google.cloud.automl.v1.ClassificationEvaluationMetrics.IConfidenceMetricsEntry=} [properties] Properties to set + */ + function ConfidenceMetricsEntry(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ConfidenceMetricsEntry confidenceThreshold. + * @member {number} confidenceThreshold + * @memberof google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfidenceMetricsEntry + * @instance + */ + ConfidenceMetricsEntry.prototype.confidenceThreshold = 0; + + /** + * ConfidenceMetricsEntry positionThreshold. + * @member {number} positionThreshold + * @memberof google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfidenceMetricsEntry + * @instance + */ + ConfidenceMetricsEntry.prototype.positionThreshold = 0; + + /** + * ConfidenceMetricsEntry recall. + * @member {number} recall + * @memberof google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfidenceMetricsEntry + * @instance + */ + ConfidenceMetricsEntry.prototype.recall = 0; + + /** + * ConfidenceMetricsEntry precision. + * @member {number} precision + * @memberof google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfidenceMetricsEntry + * @instance + */ + ConfidenceMetricsEntry.prototype.precision = 0; + + /** + * ConfidenceMetricsEntry falsePositiveRate. + * @member {number} falsePositiveRate + * @memberof google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfidenceMetricsEntry + * @instance + */ + ConfidenceMetricsEntry.prototype.falsePositiveRate = 0; + + /** + * ConfidenceMetricsEntry f1Score. + * @member {number} f1Score + * @memberof google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfidenceMetricsEntry + * @instance + */ + ConfidenceMetricsEntry.prototype.f1Score = 0; + + /** + * ConfidenceMetricsEntry recallAt1. + * @member {number} recallAt1 + * @memberof google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfidenceMetricsEntry + * @instance + */ + ConfidenceMetricsEntry.prototype.recallAt1 = 0; + + /** + * ConfidenceMetricsEntry precisionAt1. + * @member {number} precisionAt1 + * @memberof google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfidenceMetricsEntry + * @instance + */ + ConfidenceMetricsEntry.prototype.precisionAt1 = 0; + + /** + * ConfidenceMetricsEntry falsePositiveRateAt1. + * @member {number} falsePositiveRateAt1 + * @memberof google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfidenceMetricsEntry + * @instance + */ + ConfidenceMetricsEntry.prototype.falsePositiveRateAt1 = 0; + + /** + * ConfidenceMetricsEntry f1ScoreAt1. + * @member {number} f1ScoreAt1 + * @memberof google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfidenceMetricsEntry + * @instance + */ + ConfidenceMetricsEntry.prototype.f1ScoreAt1 = 0; + + /** + * ConfidenceMetricsEntry truePositiveCount. + * @member {number|Long} truePositiveCount + * @memberof google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfidenceMetricsEntry + * @instance + */ + ConfidenceMetricsEntry.prototype.truePositiveCount = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * ConfidenceMetricsEntry falsePositiveCount. + * @member {number|Long} falsePositiveCount + * @memberof google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfidenceMetricsEntry + * @instance + */ + ConfidenceMetricsEntry.prototype.falsePositiveCount = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * ConfidenceMetricsEntry falseNegativeCount. + * @member {number|Long} falseNegativeCount + * @memberof google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfidenceMetricsEntry + * @instance + */ + ConfidenceMetricsEntry.prototype.falseNegativeCount = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * ConfidenceMetricsEntry trueNegativeCount. + * @member {number|Long} trueNegativeCount + * @memberof google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfidenceMetricsEntry + * @instance + */ + ConfidenceMetricsEntry.prototype.trueNegativeCount = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new ConfidenceMetricsEntry instance using the specified properties. + * @function create + * @memberof google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfidenceMetricsEntry + * @static + * @param {google.cloud.automl.v1.ClassificationEvaluationMetrics.IConfidenceMetricsEntry=} [properties] Properties to set + * @returns {google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfidenceMetricsEntry} ConfidenceMetricsEntry instance + */ + ConfidenceMetricsEntry.create = function create(properties) { + return new ConfidenceMetricsEntry(properties); + }; + + /** + * Encodes the specified ConfidenceMetricsEntry message. Does not implicitly {@link google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfidenceMetricsEntry.verify|verify} messages. + * @function encode + * @memberof google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfidenceMetricsEntry + * @static + * @param {google.cloud.automl.v1.ClassificationEvaluationMetrics.IConfidenceMetricsEntry} message ConfidenceMetricsEntry message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ConfidenceMetricsEntry.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.confidenceThreshold != null && Object.hasOwnProperty.call(message, "confidenceThreshold")) + writer.uint32(/* id 1, wireType 5 =*/13).float(message.confidenceThreshold); + if (message.recall != null && Object.hasOwnProperty.call(message, "recall")) + writer.uint32(/* id 2, wireType 5 =*/21).float(message.recall); + if (message.precision != null && Object.hasOwnProperty.call(message, "precision")) + writer.uint32(/* id 3, wireType 5 =*/29).float(message.precision); + if (message.f1Score != null && Object.hasOwnProperty.call(message, "f1Score")) + writer.uint32(/* id 4, wireType 5 =*/37).float(message.f1Score); + if (message.recallAt1 != null && Object.hasOwnProperty.call(message, "recallAt1")) + writer.uint32(/* id 5, wireType 5 =*/45).float(message.recallAt1); + if (message.precisionAt1 != null && Object.hasOwnProperty.call(message, "precisionAt1")) + writer.uint32(/* id 6, wireType 5 =*/53).float(message.precisionAt1); + if (message.f1ScoreAt1 != null && Object.hasOwnProperty.call(message, "f1ScoreAt1")) + writer.uint32(/* id 7, wireType 5 =*/61).float(message.f1ScoreAt1); + if (message.falsePositiveRate != null && Object.hasOwnProperty.call(message, "falsePositiveRate")) + writer.uint32(/* id 8, wireType 5 =*/69).float(message.falsePositiveRate); + if (message.falsePositiveRateAt1 != null && Object.hasOwnProperty.call(message, "falsePositiveRateAt1")) + writer.uint32(/* id 9, wireType 5 =*/77).float(message.falsePositiveRateAt1); + if (message.truePositiveCount != null && Object.hasOwnProperty.call(message, "truePositiveCount")) + writer.uint32(/* id 10, wireType 0 =*/80).int64(message.truePositiveCount); + if (message.falsePositiveCount != null && Object.hasOwnProperty.call(message, "falsePositiveCount")) + writer.uint32(/* id 11, wireType 0 =*/88).int64(message.falsePositiveCount); + if (message.falseNegativeCount != null && Object.hasOwnProperty.call(message, "falseNegativeCount")) + writer.uint32(/* id 12, wireType 0 =*/96).int64(message.falseNegativeCount); + if (message.trueNegativeCount != null && Object.hasOwnProperty.call(message, "trueNegativeCount")) + writer.uint32(/* id 13, wireType 0 =*/104).int64(message.trueNegativeCount); + if (message.positionThreshold != null && Object.hasOwnProperty.call(message, "positionThreshold")) + writer.uint32(/* id 14, wireType 0 =*/112).int32(message.positionThreshold); + return writer; + }; + + /** + * Encodes the specified ConfidenceMetricsEntry message, length delimited. Does not implicitly {@link google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfidenceMetricsEntry.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfidenceMetricsEntry + * @static + * @param {google.cloud.automl.v1.ClassificationEvaluationMetrics.IConfidenceMetricsEntry} message ConfidenceMetricsEntry message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ConfidenceMetricsEntry.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ConfidenceMetricsEntry message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfidenceMetricsEntry + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfidenceMetricsEntry} ConfidenceMetricsEntry + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ConfidenceMetricsEntry.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfidenceMetricsEntry(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.confidenceThreshold = reader.float(); + break; + } + case 14: { + message.positionThreshold = reader.int32(); + break; + } + case 2: { + message.recall = reader.float(); + break; + } + case 3: { + message.precision = reader.float(); + break; + } + case 8: { + message.falsePositiveRate = reader.float(); + break; + } + case 4: { + message.f1Score = reader.float(); + break; + } + case 5: { + message.recallAt1 = reader.float(); + break; + } + case 6: { + message.precisionAt1 = reader.float(); + break; + } + case 9: { + message.falsePositiveRateAt1 = reader.float(); + break; + } + case 7: { + message.f1ScoreAt1 = reader.float(); + break; + } + case 10: { + message.truePositiveCount = reader.int64(); + break; + } + case 11: { + message.falsePositiveCount = reader.int64(); + break; + } + case 12: { + message.falseNegativeCount = reader.int64(); + break; + } + case 13: { + message.trueNegativeCount = reader.int64(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ConfidenceMetricsEntry message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfidenceMetricsEntry + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfidenceMetricsEntry} ConfidenceMetricsEntry + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ConfidenceMetricsEntry.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ConfidenceMetricsEntry message. + * @function verify + * @memberof google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfidenceMetricsEntry + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ConfidenceMetricsEntry.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.confidenceThreshold != null && message.hasOwnProperty("confidenceThreshold")) + if (typeof message.confidenceThreshold !== "number") + return "confidenceThreshold: number expected"; + if (message.positionThreshold != null && message.hasOwnProperty("positionThreshold")) + if (!$util.isInteger(message.positionThreshold)) + return "positionThreshold: integer expected"; + if (message.recall != null && message.hasOwnProperty("recall")) + if (typeof message.recall !== "number") + return "recall: number expected"; + if (message.precision != null && message.hasOwnProperty("precision")) + if (typeof message.precision !== "number") + return "precision: number expected"; + if (message.falsePositiveRate != null && message.hasOwnProperty("falsePositiveRate")) + if (typeof message.falsePositiveRate !== "number") + return "falsePositiveRate: number expected"; + if (message.f1Score != null && message.hasOwnProperty("f1Score")) + if (typeof message.f1Score !== "number") + return "f1Score: number expected"; + if (message.recallAt1 != null && message.hasOwnProperty("recallAt1")) + if (typeof message.recallAt1 !== "number") + return "recallAt1: number expected"; + if (message.precisionAt1 != null && message.hasOwnProperty("precisionAt1")) + if (typeof message.precisionAt1 !== "number") + return "precisionAt1: number expected"; + if (message.falsePositiveRateAt1 != null && message.hasOwnProperty("falsePositiveRateAt1")) + if (typeof message.falsePositiveRateAt1 !== "number") + return "falsePositiveRateAt1: number expected"; + if (message.f1ScoreAt1 != null && message.hasOwnProperty("f1ScoreAt1")) + if (typeof message.f1ScoreAt1 !== "number") + return "f1ScoreAt1: number expected"; + if (message.truePositiveCount != null && message.hasOwnProperty("truePositiveCount")) + if (!$util.isInteger(message.truePositiveCount) && !(message.truePositiveCount && $util.isInteger(message.truePositiveCount.low) && $util.isInteger(message.truePositiveCount.high))) + return "truePositiveCount: integer|Long expected"; + if (message.falsePositiveCount != null && message.hasOwnProperty("falsePositiveCount")) + if (!$util.isInteger(message.falsePositiveCount) && !(message.falsePositiveCount && $util.isInteger(message.falsePositiveCount.low) && $util.isInteger(message.falsePositiveCount.high))) + return "falsePositiveCount: integer|Long expected"; + if (message.falseNegativeCount != null && message.hasOwnProperty("falseNegativeCount")) + if (!$util.isInteger(message.falseNegativeCount) && !(message.falseNegativeCount && $util.isInteger(message.falseNegativeCount.low) && $util.isInteger(message.falseNegativeCount.high))) + return "falseNegativeCount: integer|Long expected"; + if (message.trueNegativeCount != null && message.hasOwnProperty("trueNegativeCount")) + if (!$util.isInteger(message.trueNegativeCount) && !(message.trueNegativeCount && $util.isInteger(message.trueNegativeCount.low) && $util.isInteger(message.trueNegativeCount.high))) + return "trueNegativeCount: integer|Long expected"; + return null; + }; + + /** + * Creates a ConfidenceMetricsEntry message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfidenceMetricsEntry + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfidenceMetricsEntry} ConfidenceMetricsEntry + */ + ConfidenceMetricsEntry.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfidenceMetricsEntry) + return object; + var message = new $root.google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfidenceMetricsEntry(); + if (object.confidenceThreshold != null) + message.confidenceThreshold = Number(object.confidenceThreshold); + if (object.positionThreshold != null) + message.positionThreshold = object.positionThreshold | 0; + if (object.recall != null) + message.recall = Number(object.recall); + if (object.precision != null) + message.precision = Number(object.precision); + if (object.falsePositiveRate != null) + message.falsePositiveRate = Number(object.falsePositiveRate); + if (object.f1Score != null) + message.f1Score = Number(object.f1Score); + if (object.recallAt1 != null) + message.recallAt1 = Number(object.recallAt1); + if (object.precisionAt1 != null) + message.precisionAt1 = Number(object.precisionAt1); + if (object.falsePositiveRateAt1 != null) + message.falsePositiveRateAt1 = Number(object.falsePositiveRateAt1); + if (object.f1ScoreAt1 != null) + message.f1ScoreAt1 = Number(object.f1ScoreAt1); + if (object.truePositiveCount != null) + if ($util.Long) + (message.truePositiveCount = $util.Long.fromValue(object.truePositiveCount)).unsigned = false; + else if (typeof object.truePositiveCount === "string") + message.truePositiveCount = parseInt(object.truePositiveCount, 10); + else if (typeof object.truePositiveCount === "number") + message.truePositiveCount = object.truePositiveCount; + else if (typeof object.truePositiveCount === "object") + message.truePositiveCount = new $util.LongBits(object.truePositiveCount.low >>> 0, object.truePositiveCount.high >>> 0).toNumber(); + if (object.falsePositiveCount != null) + if ($util.Long) + (message.falsePositiveCount = $util.Long.fromValue(object.falsePositiveCount)).unsigned = false; + else if (typeof object.falsePositiveCount === "string") + message.falsePositiveCount = parseInt(object.falsePositiveCount, 10); + else if (typeof object.falsePositiveCount === "number") + message.falsePositiveCount = object.falsePositiveCount; + else if (typeof object.falsePositiveCount === "object") + message.falsePositiveCount = new $util.LongBits(object.falsePositiveCount.low >>> 0, object.falsePositiveCount.high >>> 0).toNumber(); + if (object.falseNegativeCount != null) + if ($util.Long) + (message.falseNegativeCount = $util.Long.fromValue(object.falseNegativeCount)).unsigned = false; + else if (typeof object.falseNegativeCount === "string") + message.falseNegativeCount = parseInt(object.falseNegativeCount, 10); + else if (typeof object.falseNegativeCount === "number") + message.falseNegativeCount = object.falseNegativeCount; + else if (typeof object.falseNegativeCount === "object") + message.falseNegativeCount = new $util.LongBits(object.falseNegativeCount.low >>> 0, object.falseNegativeCount.high >>> 0).toNumber(); + if (object.trueNegativeCount != null) + if ($util.Long) + (message.trueNegativeCount = $util.Long.fromValue(object.trueNegativeCount)).unsigned = false; + else if (typeof object.trueNegativeCount === "string") + message.trueNegativeCount = parseInt(object.trueNegativeCount, 10); + else if (typeof object.trueNegativeCount === "number") + message.trueNegativeCount = object.trueNegativeCount; + else if (typeof object.trueNegativeCount === "object") + message.trueNegativeCount = new $util.LongBits(object.trueNegativeCount.low >>> 0, object.trueNegativeCount.high >>> 0).toNumber(); + return message; + }; + + /** + * Creates a plain object from a ConfidenceMetricsEntry message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfidenceMetricsEntry + * @static + * @param {google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfidenceMetricsEntry} message ConfidenceMetricsEntry + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ConfidenceMetricsEntry.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.confidenceThreshold = 0; + object.recall = 0; + object.precision = 0; + object.f1Score = 0; + object.recallAt1 = 0; + object.precisionAt1 = 0; + object.f1ScoreAt1 = 0; + object.falsePositiveRate = 0; + object.falsePositiveRateAt1 = 0; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.truePositiveCount = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.truePositiveCount = options.longs === String ? "0" : 0; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.falsePositiveCount = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.falsePositiveCount = options.longs === String ? "0" : 0; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.falseNegativeCount = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.falseNegativeCount = options.longs === String ? "0" : 0; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.trueNegativeCount = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.trueNegativeCount = options.longs === String ? "0" : 0; + object.positionThreshold = 0; + } + if (message.confidenceThreshold != null && message.hasOwnProperty("confidenceThreshold")) + object.confidenceThreshold = options.json && !isFinite(message.confidenceThreshold) ? String(message.confidenceThreshold) : message.confidenceThreshold; + if (message.recall != null && message.hasOwnProperty("recall")) + object.recall = options.json && !isFinite(message.recall) ? String(message.recall) : message.recall; + if (message.precision != null && message.hasOwnProperty("precision")) + object.precision = options.json && !isFinite(message.precision) ? String(message.precision) : message.precision; + if (message.f1Score != null && message.hasOwnProperty("f1Score")) + object.f1Score = options.json && !isFinite(message.f1Score) ? String(message.f1Score) : message.f1Score; + if (message.recallAt1 != null && message.hasOwnProperty("recallAt1")) + object.recallAt1 = options.json && !isFinite(message.recallAt1) ? String(message.recallAt1) : message.recallAt1; + if (message.precisionAt1 != null && message.hasOwnProperty("precisionAt1")) + object.precisionAt1 = options.json && !isFinite(message.precisionAt1) ? String(message.precisionAt1) : message.precisionAt1; + if (message.f1ScoreAt1 != null && message.hasOwnProperty("f1ScoreAt1")) + object.f1ScoreAt1 = options.json && !isFinite(message.f1ScoreAt1) ? String(message.f1ScoreAt1) : message.f1ScoreAt1; + if (message.falsePositiveRate != null && message.hasOwnProperty("falsePositiveRate")) + object.falsePositiveRate = options.json && !isFinite(message.falsePositiveRate) ? String(message.falsePositiveRate) : message.falsePositiveRate; + if (message.falsePositiveRateAt1 != null && message.hasOwnProperty("falsePositiveRateAt1")) + object.falsePositiveRateAt1 = options.json && !isFinite(message.falsePositiveRateAt1) ? String(message.falsePositiveRateAt1) : message.falsePositiveRateAt1; + if (message.truePositiveCount != null && message.hasOwnProperty("truePositiveCount")) + if (typeof message.truePositiveCount === "number") + object.truePositiveCount = options.longs === String ? String(message.truePositiveCount) : message.truePositiveCount; + else + object.truePositiveCount = options.longs === String ? $util.Long.prototype.toString.call(message.truePositiveCount) : options.longs === Number ? new $util.LongBits(message.truePositiveCount.low >>> 0, message.truePositiveCount.high >>> 0).toNumber() : message.truePositiveCount; + if (message.falsePositiveCount != null && message.hasOwnProperty("falsePositiveCount")) + if (typeof message.falsePositiveCount === "number") + object.falsePositiveCount = options.longs === String ? String(message.falsePositiveCount) : message.falsePositiveCount; + else + object.falsePositiveCount = options.longs === String ? $util.Long.prototype.toString.call(message.falsePositiveCount) : options.longs === Number ? new $util.LongBits(message.falsePositiveCount.low >>> 0, message.falsePositiveCount.high >>> 0).toNumber() : message.falsePositiveCount; + if (message.falseNegativeCount != null && message.hasOwnProperty("falseNegativeCount")) + if (typeof message.falseNegativeCount === "number") + object.falseNegativeCount = options.longs === String ? String(message.falseNegativeCount) : message.falseNegativeCount; + else + object.falseNegativeCount = options.longs === String ? $util.Long.prototype.toString.call(message.falseNegativeCount) : options.longs === Number ? new $util.LongBits(message.falseNegativeCount.low >>> 0, message.falseNegativeCount.high >>> 0).toNumber() : message.falseNegativeCount; + if (message.trueNegativeCount != null && message.hasOwnProperty("trueNegativeCount")) + if (typeof message.trueNegativeCount === "number") + object.trueNegativeCount = options.longs === String ? String(message.trueNegativeCount) : message.trueNegativeCount; + else + object.trueNegativeCount = options.longs === String ? $util.Long.prototype.toString.call(message.trueNegativeCount) : options.longs === Number ? new $util.LongBits(message.trueNegativeCount.low >>> 0, message.trueNegativeCount.high >>> 0).toNumber() : message.trueNegativeCount; + if (message.positionThreshold != null && message.hasOwnProperty("positionThreshold")) + object.positionThreshold = message.positionThreshold; + return object; + }; + + /** + * Converts this ConfidenceMetricsEntry to JSON. + * @function toJSON + * @memberof google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfidenceMetricsEntry + * @instance + * @returns {Object.} JSON object + */ + ConfidenceMetricsEntry.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ConfidenceMetricsEntry + * @function getTypeUrl + * @memberof google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfidenceMetricsEntry + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ConfidenceMetricsEntry.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfidenceMetricsEntry"; + }; + + return ConfidenceMetricsEntry; + })(); + + ClassificationEvaluationMetrics.ConfusionMatrix = (function() { + + /** + * Properties of a ConfusionMatrix. + * @memberof google.cloud.automl.v1.ClassificationEvaluationMetrics + * @interface IConfusionMatrix + * @property {Array.|null} [annotationSpecId] ConfusionMatrix annotationSpecId + * @property {Array.|null} [displayName] ConfusionMatrix displayName + * @property {Array.|null} [row] ConfusionMatrix row + */ + + /** + * Constructs a new ConfusionMatrix. + * @memberof google.cloud.automl.v1.ClassificationEvaluationMetrics + * @classdesc Represents a ConfusionMatrix. + * @implements IConfusionMatrix + * @constructor + * @param {google.cloud.automl.v1.ClassificationEvaluationMetrics.IConfusionMatrix=} [properties] Properties to set + */ + function ConfusionMatrix(properties) { + this.annotationSpecId = []; + this.displayName = []; + this.row = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ConfusionMatrix annotationSpecId. + * @member {Array.} annotationSpecId + * @memberof google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfusionMatrix + * @instance + */ + ConfusionMatrix.prototype.annotationSpecId = $util.emptyArray; + + /** + * ConfusionMatrix displayName. + * @member {Array.} displayName + * @memberof google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfusionMatrix + * @instance + */ + ConfusionMatrix.prototype.displayName = $util.emptyArray; + + /** + * ConfusionMatrix row. + * @member {Array.} row + * @memberof google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfusionMatrix + * @instance + */ + ConfusionMatrix.prototype.row = $util.emptyArray; + + /** + * Creates a new ConfusionMatrix instance using the specified properties. + * @function create + * @memberof google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfusionMatrix + * @static + * @param {google.cloud.automl.v1.ClassificationEvaluationMetrics.IConfusionMatrix=} [properties] Properties to set + * @returns {google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfusionMatrix} ConfusionMatrix instance + */ + ConfusionMatrix.create = function create(properties) { + return new ConfusionMatrix(properties); + }; + + /** + * Encodes the specified ConfusionMatrix message. Does not implicitly {@link google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfusionMatrix.verify|verify} messages. + * @function encode + * @memberof google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfusionMatrix + * @static + * @param {google.cloud.automl.v1.ClassificationEvaluationMetrics.IConfusionMatrix} message ConfusionMatrix message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ConfusionMatrix.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.annotationSpecId != null && message.annotationSpecId.length) + for (var i = 0; i < message.annotationSpecId.length; ++i) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.annotationSpecId[i]); + if (message.row != null && message.row.length) + for (var i = 0; i < message.row.length; ++i) + $root.google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfusionMatrix.Row.encode(message.row[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.displayName != null && message.displayName.length) + for (var i = 0; i < message.displayName.length; ++i) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.displayName[i]); + return writer; + }; + + /** + * Encodes the specified ConfusionMatrix message, length delimited. Does not implicitly {@link google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfusionMatrix.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfusionMatrix + * @static + * @param {google.cloud.automl.v1.ClassificationEvaluationMetrics.IConfusionMatrix} message ConfusionMatrix message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ConfusionMatrix.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ConfusionMatrix message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfusionMatrix + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfusionMatrix} ConfusionMatrix + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ConfusionMatrix.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfusionMatrix(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.annotationSpecId && message.annotationSpecId.length)) + message.annotationSpecId = []; + message.annotationSpecId.push(reader.string()); + break; + } + case 3: { + if (!(message.displayName && message.displayName.length)) + message.displayName = []; + message.displayName.push(reader.string()); + break; + } + case 2: { + if (!(message.row && message.row.length)) + message.row = []; + message.row.push($root.google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfusionMatrix.Row.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ConfusionMatrix message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfusionMatrix + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfusionMatrix} ConfusionMatrix + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ConfusionMatrix.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ConfusionMatrix message. + * @function verify + * @memberof google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfusionMatrix + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ConfusionMatrix.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.annotationSpecId != null && message.hasOwnProperty("annotationSpecId")) { + if (!Array.isArray(message.annotationSpecId)) + return "annotationSpecId: array expected"; + for (var i = 0; i < message.annotationSpecId.length; ++i) + if (!$util.isString(message.annotationSpecId[i])) + return "annotationSpecId: string[] expected"; + } + if (message.displayName != null && message.hasOwnProperty("displayName")) { + if (!Array.isArray(message.displayName)) + return "displayName: array expected"; + for (var i = 0; i < message.displayName.length; ++i) + if (!$util.isString(message.displayName[i])) + return "displayName: string[] expected"; + } + if (message.row != null && message.hasOwnProperty("row")) { + if (!Array.isArray(message.row)) + return "row: array expected"; + for (var i = 0; i < message.row.length; ++i) { + var error = $root.google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfusionMatrix.Row.verify(message.row[i]); + if (error) + return "row." + error; + } + } + return null; + }; + + /** + * Creates a ConfusionMatrix message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfusionMatrix + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfusionMatrix} ConfusionMatrix + */ + ConfusionMatrix.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfusionMatrix) + return object; + var message = new $root.google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfusionMatrix(); + if (object.annotationSpecId) { + if (!Array.isArray(object.annotationSpecId)) + throw TypeError(".google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfusionMatrix.annotationSpecId: array expected"); + message.annotationSpecId = []; + for (var i = 0; i < object.annotationSpecId.length; ++i) + message.annotationSpecId[i] = String(object.annotationSpecId[i]); + } + if (object.displayName) { + if (!Array.isArray(object.displayName)) + throw TypeError(".google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfusionMatrix.displayName: array expected"); + message.displayName = []; + for (var i = 0; i < object.displayName.length; ++i) + message.displayName[i] = String(object.displayName[i]); + } + if (object.row) { + if (!Array.isArray(object.row)) + throw TypeError(".google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfusionMatrix.row: array expected"); + message.row = []; + for (var i = 0; i < object.row.length; ++i) { + if (typeof object.row[i] !== "object") + throw TypeError(".google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfusionMatrix.row: object expected"); + message.row[i] = $root.google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfusionMatrix.Row.fromObject(object.row[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a ConfusionMatrix message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfusionMatrix + * @static + * @param {google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfusionMatrix} message ConfusionMatrix + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ConfusionMatrix.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.annotationSpecId = []; + object.row = []; + object.displayName = []; + } + if (message.annotationSpecId && message.annotationSpecId.length) { + object.annotationSpecId = []; + for (var j = 0; j < message.annotationSpecId.length; ++j) + object.annotationSpecId[j] = message.annotationSpecId[j]; + } + if (message.row && message.row.length) { + object.row = []; + for (var j = 0; j < message.row.length; ++j) + object.row[j] = $root.google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfusionMatrix.Row.toObject(message.row[j], options); + } + if (message.displayName && message.displayName.length) { + object.displayName = []; + for (var j = 0; j < message.displayName.length; ++j) + object.displayName[j] = message.displayName[j]; + } + return object; + }; + + /** + * Converts this ConfusionMatrix to JSON. + * @function toJSON + * @memberof google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfusionMatrix + * @instance + * @returns {Object.} JSON object + */ + ConfusionMatrix.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ConfusionMatrix + * @function getTypeUrl + * @memberof google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfusionMatrix + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ConfusionMatrix.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfusionMatrix"; + }; + + ConfusionMatrix.Row = (function() { + + /** + * Properties of a Row. + * @memberof google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfusionMatrix + * @interface IRow + * @property {Array.|null} [exampleCount] Row exampleCount + */ + + /** + * Constructs a new Row. + * @memberof google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfusionMatrix + * @classdesc Represents a Row. + * @implements IRow + * @constructor + * @param {google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfusionMatrix.IRow=} [properties] Properties to set + */ + function Row(properties) { + this.exampleCount = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Row exampleCount. + * @member {Array.} exampleCount + * @memberof google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfusionMatrix.Row + * @instance + */ + Row.prototype.exampleCount = $util.emptyArray; + + /** + * Creates a new Row instance using the specified properties. + * @function create + * @memberof google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfusionMatrix.Row + * @static + * @param {google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfusionMatrix.IRow=} [properties] Properties to set + * @returns {google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfusionMatrix.Row} Row instance + */ + Row.create = function create(properties) { + return new Row(properties); + }; + + /** + * Encodes the specified Row message. Does not implicitly {@link google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfusionMatrix.Row.verify|verify} messages. + * @function encode + * @memberof google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfusionMatrix.Row + * @static + * @param {google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfusionMatrix.IRow} message Row message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Row.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.exampleCount != null && message.exampleCount.length) { + writer.uint32(/* id 1, wireType 2 =*/10).fork(); + for (var i = 0; i < message.exampleCount.length; ++i) + writer.int32(message.exampleCount[i]); + writer.ldelim(); + } + return writer; + }; + + /** + * Encodes the specified Row message, length delimited. Does not implicitly {@link google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfusionMatrix.Row.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfusionMatrix.Row + * @static + * @param {google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfusionMatrix.IRow} message Row message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Row.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Row message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfusionMatrix.Row + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfusionMatrix.Row} Row + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Row.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfusionMatrix.Row(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.exampleCount && message.exampleCount.length)) + message.exampleCount = []; + if ((tag & 7) === 2) { + var end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) + message.exampleCount.push(reader.int32()); + } else + message.exampleCount.push(reader.int32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Row message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfusionMatrix.Row + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfusionMatrix.Row} Row + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Row.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Row message. + * @function verify + * @memberof google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfusionMatrix.Row + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Row.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.exampleCount != null && message.hasOwnProperty("exampleCount")) { + if (!Array.isArray(message.exampleCount)) + return "exampleCount: array expected"; + for (var i = 0; i < message.exampleCount.length; ++i) + if (!$util.isInteger(message.exampleCount[i])) + return "exampleCount: integer[] expected"; + } + return null; + }; + + /** + * Creates a Row message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfusionMatrix.Row + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfusionMatrix.Row} Row + */ + Row.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfusionMatrix.Row) + return object; + var message = new $root.google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfusionMatrix.Row(); + if (object.exampleCount) { + if (!Array.isArray(object.exampleCount)) + throw TypeError(".google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfusionMatrix.Row.exampleCount: array expected"); + message.exampleCount = []; + for (var i = 0; i < object.exampleCount.length; ++i) + message.exampleCount[i] = object.exampleCount[i] | 0; + } + return message; + }; + + /** + * Creates a plain object from a Row message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfusionMatrix.Row + * @static + * @param {google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfusionMatrix.Row} message Row + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Row.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.exampleCount = []; + if (message.exampleCount && message.exampleCount.length) { + object.exampleCount = []; + for (var j = 0; j < message.exampleCount.length; ++j) + object.exampleCount[j] = message.exampleCount[j]; + } + return object; + }; + + /** + * Converts this Row to JSON. + * @function toJSON + * @memberof google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfusionMatrix.Row + * @instance + * @returns {Object.} JSON object + */ + Row.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Row + * @function getTypeUrl + * @memberof google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfusionMatrix.Row + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Row.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfusionMatrix.Row"; + }; + + return Row; + })(); + + return ConfusionMatrix; + })(); + + return ClassificationEvaluationMetrics; + })(); + + v1.ImageObjectDetectionAnnotation = (function() { + + /** + * Properties of an ImageObjectDetectionAnnotation. + * @memberof google.cloud.automl.v1 + * @interface IImageObjectDetectionAnnotation + * @property {google.cloud.automl.v1.IBoundingPoly|null} [boundingBox] ImageObjectDetectionAnnotation boundingBox + * @property {number|null} [score] ImageObjectDetectionAnnotation score + */ + + /** + * Constructs a new ImageObjectDetectionAnnotation. + * @memberof google.cloud.automl.v1 + * @classdesc Represents an ImageObjectDetectionAnnotation. + * @implements IImageObjectDetectionAnnotation + * @constructor + * @param {google.cloud.automl.v1.IImageObjectDetectionAnnotation=} [properties] Properties to set + */ + function ImageObjectDetectionAnnotation(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ImageObjectDetectionAnnotation boundingBox. + * @member {google.cloud.automl.v1.IBoundingPoly|null|undefined} boundingBox + * @memberof google.cloud.automl.v1.ImageObjectDetectionAnnotation + * @instance + */ + ImageObjectDetectionAnnotation.prototype.boundingBox = null; + + /** + * ImageObjectDetectionAnnotation score. + * @member {number} score + * @memberof google.cloud.automl.v1.ImageObjectDetectionAnnotation + * @instance + */ + ImageObjectDetectionAnnotation.prototype.score = 0; + + /** + * Creates a new ImageObjectDetectionAnnotation instance using the specified properties. + * @function create + * @memberof google.cloud.automl.v1.ImageObjectDetectionAnnotation + * @static + * @param {google.cloud.automl.v1.IImageObjectDetectionAnnotation=} [properties] Properties to set + * @returns {google.cloud.automl.v1.ImageObjectDetectionAnnotation} ImageObjectDetectionAnnotation instance + */ + ImageObjectDetectionAnnotation.create = function create(properties) { + return new ImageObjectDetectionAnnotation(properties); + }; + + /** + * Encodes the specified ImageObjectDetectionAnnotation message. Does not implicitly {@link google.cloud.automl.v1.ImageObjectDetectionAnnotation.verify|verify} messages. + * @function encode + * @memberof google.cloud.automl.v1.ImageObjectDetectionAnnotation + * @static + * @param {google.cloud.automl.v1.IImageObjectDetectionAnnotation} message ImageObjectDetectionAnnotation message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ImageObjectDetectionAnnotation.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.boundingBox != null && Object.hasOwnProperty.call(message, "boundingBox")) + $root.google.cloud.automl.v1.BoundingPoly.encode(message.boundingBox, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.score != null && Object.hasOwnProperty.call(message, "score")) + writer.uint32(/* id 2, wireType 5 =*/21).float(message.score); + return writer; + }; + + /** + * Encodes the specified ImageObjectDetectionAnnotation message, length delimited. Does not implicitly {@link google.cloud.automl.v1.ImageObjectDetectionAnnotation.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.automl.v1.ImageObjectDetectionAnnotation + * @static + * @param {google.cloud.automl.v1.IImageObjectDetectionAnnotation} message ImageObjectDetectionAnnotation message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ImageObjectDetectionAnnotation.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an ImageObjectDetectionAnnotation message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.automl.v1.ImageObjectDetectionAnnotation + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.automl.v1.ImageObjectDetectionAnnotation} ImageObjectDetectionAnnotation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ImageObjectDetectionAnnotation.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.automl.v1.ImageObjectDetectionAnnotation(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.boundingBox = $root.google.cloud.automl.v1.BoundingPoly.decode(reader, reader.uint32()); + break; + } + case 2: { + message.score = reader.float(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an ImageObjectDetectionAnnotation message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.automl.v1.ImageObjectDetectionAnnotation + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.automl.v1.ImageObjectDetectionAnnotation} ImageObjectDetectionAnnotation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ImageObjectDetectionAnnotation.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an ImageObjectDetectionAnnotation message. + * @function verify + * @memberof google.cloud.automl.v1.ImageObjectDetectionAnnotation + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ImageObjectDetectionAnnotation.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.boundingBox != null && message.hasOwnProperty("boundingBox")) { + var error = $root.google.cloud.automl.v1.BoundingPoly.verify(message.boundingBox); + if (error) + return "boundingBox." + error; + } + if (message.score != null && message.hasOwnProperty("score")) + if (typeof message.score !== "number") + return "score: number expected"; + return null; + }; + + /** + * Creates an ImageObjectDetectionAnnotation message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.automl.v1.ImageObjectDetectionAnnotation + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.automl.v1.ImageObjectDetectionAnnotation} ImageObjectDetectionAnnotation + */ + ImageObjectDetectionAnnotation.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.automl.v1.ImageObjectDetectionAnnotation) + return object; + var message = new $root.google.cloud.automl.v1.ImageObjectDetectionAnnotation(); + if (object.boundingBox != null) { + if (typeof object.boundingBox !== "object") + throw TypeError(".google.cloud.automl.v1.ImageObjectDetectionAnnotation.boundingBox: object expected"); + message.boundingBox = $root.google.cloud.automl.v1.BoundingPoly.fromObject(object.boundingBox); + } + if (object.score != null) + message.score = Number(object.score); + return message; + }; + + /** + * Creates a plain object from an ImageObjectDetectionAnnotation message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.automl.v1.ImageObjectDetectionAnnotation + * @static + * @param {google.cloud.automl.v1.ImageObjectDetectionAnnotation} message ImageObjectDetectionAnnotation + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ImageObjectDetectionAnnotation.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.boundingBox = null; + object.score = 0; + } + if (message.boundingBox != null && message.hasOwnProperty("boundingBox")) + object.boundingBox = $root.google.cloud.automl.v1.BoundingPoly.toObject(message.boundingBox, options); + if (message.score != null && message.hasOwnProperty("score")) + object.score = options.json && !isFinite(message.score) ? String(message.score) : message.score; + return object; + }; + + /** + * Converts this ImageObjectDetectionAnnotation to JSON. + * @function toJSON + * @memberof google.cloud.automl.v1.ImageObjectDetectionAnnotation + * @instance + * @returns {Object.} JSON object + */ + ImageObjectDetectionAnnotation.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ImageObjectDetectionAnnotation + * @function getTypeUrl + * @memberof google.cloud.automl.v1.ImageObjectDetectionAnnotation + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ImageObjectDetectionAnnotation.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.automl.v1.ImageObjectDetectionAnnotation"; + }; + + return ImageObjectDetectionAnnotation; + })(); + + v1.BoundingBoxMetricsEntry = (function() { + + /** + * Properties of a BoundingBoxMetricsEntry. + * @memberof google.cloud.automl.v1 + * @interface IBoundingBoxMetricsEntry + * @property {number|null} [iouThreshold] BoundingBoxMetricsEntry iouThreshold + * @property {number|null} [meanAveragePrecision] BoundingBoxMetricsEntry meanAveragePrecision + * @property {Array.|null} [confidenceMetricsEntries] BoundingBoxMetricsEntry confidenceMetricsEntries + */ + + /** + * Constructs a new BoundingBoxMetricsEntry. + * @memberof google.cloud.automl.v1 + * @classdesc Represents a BoundingBoxMetricsEntry. + * @implements IBoundingBoxMetricsEntry + * @constructor + * @param {google.cloud.automl.v1.IBoundingBoxMetricsEntry=} [properties] Properties to set + */ + function BoundingBoxMetricsEntry(properties) { + this.confidenceMetricsEntries = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * BoundingBoxMetricsEntry iouThreshold. + * @member {number} iouThreshold + * @memberof google.cloud.automl.v1.BoundingBoxMetricsEntry + * @instance + */ + BoundingBoxMetricsEntry.prototype.iouThreshold = 0; + + /** + * BoundingBoxMetricsEntry meanAveragePrecision. + * @member {number} meanAveragePrecision + * @memberof google.cloud.automl.v1.BoundingBoxMetricsEntry + * @instance + */ + BoundingBoxMetricsEntry.prototype.meanAveragePrecision = 0; + + /** + * BoundingBoxMetricsEntry confidenceMetricsEntries. + * @member {Array.} confidenceMetricsEntries + * @memberof google.cloud.automl.v1.BoundingBoxMetricsEntry + * @instance + */ + BoundingBoxMetricsEntry.prototype.confidenceMetricsEntries = $util.emptyArray; + + /** + * Creates a new BoundingBoxMetricsEntry instance using the specified properties. + * @function create + * @memberof google.cloud.automl.v1.BoundingBoxMetricsEntry + * @static + * @param {google.cloud.automl.v1.IBoundingBoxMetricsEntry=} [properties] Properties to set + * @returns {google.cloud.automl.v1.BoundingBoxMetricsEntry} BoundingBoxMetricsEntry instance + */ + BoundingBoxMetricsEntry.create = function create(properties) { + return new BoundingBoxMetricsEntry(properties); + }; + + /** + * Encodes the specified BoundingBoxMetricsEntry message. Does not implicitly {@link google.cloud.automl.v1.BoundingBoxMetricsEntry.verify|verify} messages. + * @function encode + * @memberof google.cloud.automl.v1.BoundingBoxMetricsEntry + * @static + * @param {google.cloud.automl.v1.IBoundingBoxMetricsEntry} message BoundingBoxMetricsEntry message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BoundingBoxMetricsEntry.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.iouThreshold != null && Object.hasOwnProperty.call(message, "iouThreshold")) + writer.uint32(/* id 1, wireType 5 =*/13).float(message.iouThreshold); + if (message.meanAveragePrecision != null && Object.hasOwnProperty.call(message, "meanAveragePrecision")) + writer.uint32(/* id 2, wireType 5 =*/21).float(message.meanAveragePrecision); + if (message.confidenceMetricsEntries != null && message.confidenceMetricsEntries.length) + for (var i = 0; i < message.confidenceMetricsEntries.length; ++i) + $root.google.cloud.automl.v1.BoundingBoxMetricsEntry.ConfidenceMetricsEntry.encode(message.confidenceMetricsEntries[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified BoundingBoxMetricsEntry message, length delimited. Does not implicitly {@link google.cloud.automl.v1.BoundingBoxMetricsEntry.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.automl.v1.BoundingBoxMetricsEntry + * @static + * @param {google.cloud.automl.v1.IBoundingBoxMetricsEntry} message BoundingBoxMetricsEntry message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BoundingBoxMetricsEntry.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a BoundingBoxMetricsEntry message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.automl.v1.BoundingBoxMetricsEntry + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.automl.v1.BoundingBoxMetricsEntry} BoundingBoxMetricsEntry + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BoundingBoxMetricsEntry.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.automl.v1.BoundingBoxMetricsEntry(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.iouThreshold = reader.float(); + break; + } + case 2: { + message.meanAveragePrecision = reader.float(); + break; + } + case 3: { + if (!(message.confidenceMetricsEntries && message.confidenceMetricsEntries.length)) + message.confidenceMetricsEntries = []; + message.confidenceMetricsEntries.push($root.google.cloud.automl.v1.BoundingBoxMetricsEntry.ConfidenceMetricsEntry.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a BoundingBoxMetricsEntry message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.automl.v1.BoundingBoxMetricsEntry + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.automl.v1.BoundingBoxMetricsEntry} BoundingBoxMetricsEntry + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BoundingBoxMetricsEntry.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a BoundingBoxMetricsEntry message. + * @function verify + * @memberof google.cloud.automl.v1.BoundingBoxMetricsEntry + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + BoundingBoxMetricsEntry.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.iouThreshold != null && message.hasOwnProperty("iouThreshold")) + if (typeof message.iouThreshold !== "number") + return "iouThreshold: number expected"; + if (message.meanAveragePrecision != null && message.hasOwnProperty("meanAveragePrecision")) + if (typeof message.meanAveragePrecision !== "number") + return "meanAveragePrecision: number expected"; + if (message.confidenceMetricsEntries != null && message.hasOwnProperty("confidenceMetricsEntries")) { + if (!Array.isArray(message.confidenceMetricsEntries)) + return "confidenceMetricsEntries: array expected"; + for (var i = 0; i < message.confidenceMetricsEntries.length; ++i) { + var error = $root.google.cloud.automl.v1.BoundingBoxMetricsEntry.ConfidenceMetricsEntry.verify(message.confidenceMetricsEntries[i]); + if (error) + return "confidenceMetricsEntries." + error; + } + } + return null; + }; + + /** + * Creates a BoundingBoxMetricsEntry message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.automl.v1.BoundingBoxMetricsEntry + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.automl.v1.BoundingBoxMetricsEntry} BoundingBoxMetricsEntry + */ + BoundingBoxMetricsEntry.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.automl.v1.BoundingBoxMetricsEntry) + return object; + var message = new $root.google.cloud.automl.v1.BoundingBoxMetricsEntry(); + if (object.iouThreshold != null) + message.iouThreshold = Number(object.iouThreshold); + if (object.meanAveragePrecision != null) + message.meanAveragePrecision = Number(object.meanAveragePrecision); + if (object.confidenceMetricsEntries) { + if (!Array.isArray(object.confidenceMetricsEntries)) + throw TypeError(".google.cloud.automl.v1.BoundingBoxMetricsEntry.confidenceMetricsEntries: array expected"); + message.confidenceMetricsEntries = []; + for (var i = 0; i < object.confidenceMetricsEntries.length; ++i) { + if (typeof object.confidenceMetricsEntries[i] !== "object") + throw TypeError(".google.cloud.automl.v1.BoundingBoxMetricsEntry.confidenceMetricsEntries: object expected"); + message.confidenceMetricsEntries[i] = $root.google.cloud.automl.v1.BoundingBoxMetricsEntry.ConfidenceMetricsEntry.fromObject(object.confidenceMetricsEntries[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a BoundingBoxMetricsEntry message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.automl.v1.BoundingBoxMetricsEntry + * @static + * @param {google.cloud.automl.v1.BoundingBoxMetricsEntry} message BoundingBoxMetricsEntry + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + BoundingBoxMetricsEntry.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.confidenceMetricsEntries = []; + if (options.defaults) { + object.iouThreshold = 0; + object.meanAveragePrecision = 0; + } + if (message.iouThreshold != null && message.hasOwnProperty("iouThreshold")) + object.iouThreshold = options.json && !isFinite(message.iouThreshold) ? String(message.iouThreshold) : message.iouThreshold; + if (message.meanAveragePrecision != null && message.hasOwnProperty("meanAveragePrecision")) + object.meanAveragePrecision = options.json && !isFinite(message.meanAveragePrecision) ? String(message.meanAveragePrecision) : message.meanAveragePrecision; + if (message.confidenceMetricsEntries && message.confidenceMetricsEntries.length) { + object.confidenceMetricsEntries = []; + for (var j = 0; j < message.confidenceMetricsEntries.length; ++j) + object.confidenceMetricsEntries[j] = $root.google.cloud.automl.v1.BoundingBoxMetricsEntry.ConfidenceMetricsEntry.toObject(message.confidenceMetricsEntries[j], options); + } + return object; + }; + + /** + * Converts this BoundingBoxMetricsEntry to JSON. + * @function toJSON + * @memberof google.cloud.automl.v1.BoundingBoxMetricsEntry + * @instance + * @returns {Object.} JSON object + */ + BoundingBoxMetricsEntry.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for BoundingBoxMetricsEntry + * @function getTypeUrl + * @memberof google.cloud.automl.v1.BoundingBoxMetricsEntry + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + BoundingBoxMetricsEntry.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.automl.v1.BoundingBoxMetricsEntry"; + }; + + BoundingBoxMetricsEntry.ConfidenceMetricsEntry = (function() { + + /** + * Properties of a ConfidenceMetricsEntry. + * @memberof google.cloud.automl.v1.BoundingBoxMetricsEntry + * @interface IConfidenceMetricsEntry + * @property {number|null} [confidenceThreshold] ConfidenceMetricsEntry confidenceThreshold + * @property {number|null} [recall] ConfidenceMetricsEntry recall + * @property {number|null} [precision] ConfidenceMetricsEntry precision + * @property {number|null} [f1Score] ConfidenceMetricsEntry f1Score + */ + + /** + * Constructs a new ConfidenceMetricsEntry. + * @memberof google.cloud.automl.v1.BoundingBoxMetricsEntry + * @classdesc Represents a ConfidenceMetricsEntry. + * @implements IConfidenceMetricsEntry + * @constructor + * @param {google.cloud.automl.v1.BoundingBoxMetricsEntry.IConfidenceMetricsEntry=} [properties] Properties to set + */ + function ConfidenceMetricsEntry(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ConfidenceMetricsEntry confidenceThreshold. + * @member {number} confidenceThreshold + * @memberof google.cloud.automl.v1.BoundingBoxMetricsEntry.ConfidenceMetricsEntry + * @instance + */ + ConfidenceMetricsEntry.prototype.confidenceThreshold = 0; + + /** + * ConfidenceMetricsEntry recall. + * @member {number} recall + * @memberof google.cloud.automl.v1.BoundingBoxMetricsEntry.ConfidenceMetricsEntry + * @instance + */ + ConfidenceMetricsEntry.prototype.recall = 0; + + /** + * ConfidenceMetricsEntry precision. + * @member {number} precision + * @memberof google.cloud.automl.v1.BoundingBoxMetricsEntry.ConfidenceMetricsEntry + * @instance + */ + ConfidenceMetricsEntry.prototype.precision = 0; + + /** + * ConfidenceMetricsEntry f1Score. + * @member {number} f1Score + * @memberof google.cloud.automl.v1.BoundingBoxMetricsEntry.ConfidenceMetricsEntry + * @instance + */ + ConfidenceMetricsEntry.prototype.f1Score = 0; + + /** + * Creates a new ConfidenceMetricsEntry instance using the specified properties. + * @function create + * @memberof google.cloud.automl.v1.BoundingBoxMetricsEntry.ConfidenceMetricsEntry + * @static + * @param {google.cloud.automl.v1.BoundingBoxMetricsEntry.IConfidenceMetricsEntry=} [properties] Properties to set + * @returns {google.cloud.automl.v1.BoundingBoxMetricsEntry.ConfidenceMetricsEntry} ConfidenceMetricsEntry instance + */ + ConfidenceMetricsEntry.create = function create(properties) { + return new ConfidenceMetricsEntry(properties); + }; + + /** + * Encodes the specified ConfidenceMetricsEntry message. Does not implicitly {@link google.cloud.automl.v1.BoundingBoxMetricsEntry.ConfidenceMetricsEntry.verify|verify} messages. + * @function encode + * @memberof google.cloud.automl.v1.BoundingBoxMetricsEntry.ConfidenceMetricsEntry + * @static + * @param {google.cloud.automl.v1.BoundingBoxMetricsEntry.IConfidenceMetricsEntry} message ConfidenceMetricsEntry message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ConfidenceMetricsEntry.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.confidenceThreshold != null && Object.hasOwnProperty.call(message, "confidenceThreshold")) + writer.uint32(/* id 1, wireType 5 =*/13).float(message.confidenceThreshold); + if (message.recall != null && Object.hasOwnProperty.call(message, "recall")) + writer.uint32(/* id 2, wireType 5 =*/21).float(message.recall); + if (message.precision != null && Object.hasOwnProperty.call(message, "precision")) + writer.uint32(/* id 3, wireType 5 =*/29).float(message.precision); + if (message.f1Score != null && Object.hasOwnProperty.call(message, "f1Score")) + writer.uint32(/* id 4, wireType 5 =*/37).float(message.f1Score); + return writer; + }; + + /** + * Encodes the specified ConfidenceMetricsEntry message, length delimited. Does not implicitly {@link google.cloud.automl.v1.BoundingBoxMetricsEntry.ConfidenceMetricsEntry.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.automl.v1.BoundingBoxMetricsEntry.ConfidenceMetricsEntry + * @static + * @param {google.cloud.automl.v1.BoundingBoxMetricsEntry.IConfidenceMetricsEntry} message ConfidenceMetricsEntry message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ConfidenceMetricsEntry.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ConfidenceMetricsEntry message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.automl.v1.BoundingBoxMetricsEntry.ConfidenceMetricsEntry + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.automl.v1.BoundingBoxMetricsEntry.ConfidenceMetricsEntry} ConfidenceMetricsEntry + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ConfidenceMetricsEntry.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.automl.v1.BoundingBoxMetricsEntry.ConfidenceMetricsEntry(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.confidenceThreshold = reader.float(); + break; + } + case 2: { + message.recall = reader.float(); + break; + } + case 3: { + message.precision = reader.float(); + break; + } + case 4: { + message.f1Score = reader.float(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ConfidenceMetricsEntry message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.automl.v1.BoundingBoxMetricsEntry.ConfidenceMetricsEntry + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.automl.v1.BoundingBoxMetricsEntry.ConfidenceMetricsEntry} ConfidenceMetricsEntry + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ConfidenceMetricsEntry.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ConfidenceMetricsEntry message. + * @function verify + * @memberof google.cloud.automl.v1.BoundingBoxMetricsEntry.ConfidenceMetricsEntry + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ConfidenceMetricsEntry.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.confidenceThreshold != null && message.hasOwnProperty("confidenceThreshold")) + if (typeof message.confidenceThreshold !== "number") + return "confidenceThreshold: number expected"; + if (message.recall != null && message.hasOwnProperty("recall")) + if (typeof message.recall !== "number") + return "recall: number expected"; + if (message.precision != null && message.hasOwnProperty("precision")) + if (typeof message.precision !== "number") + return "precision: number expected"; + if (message.f1Score != null && message.hasOwnProperty("f1Score")) + if (typeof message.f1Score !== "number") + return "f1Score: number expected"; + return null; + }; + + /** + * Creates a ConfidenceMetricsEntry message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.automl.v1.BoundingBoxMetricsEntry.ConfidenceMetricsEntry + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.automl.v1.BoundingBoxMetricsEntry.ConfidenceMetricsEntry} ConfidenceMetricsEntry + */ + ConfidenceMetricsEntry.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.automl.v1.BoundingBoxMetricsEntry.ConfidenceMetricsEntry) + return object; + var message = new $root.google.cloud.automl.v1.BoundingBoxMetricsEntry.ConfidenceMetricsEntry(); + if (object.confidenceThreshold != null) + message.confidenceThreshold = Number(object.confidenceThreshold); + if (object.recall != null) + message.recall = Number(object.recall); + if (object.precision != null) + message.precision = Number(object.precision); + if (object.f1Score != null) + message.f1Score = Number(object.f1Score); + return message; + }; + + /** + * Creates a plain object from a ConfidenceMetricsEntry message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.automl.v1.BoundingBoxMetricsEntry.ConfidenceMetricsEntry + * @static + * @param {google.cloud.automl.v1.BoundingBoxMetricsEntry.ConfidenceMetricsEntry} message ConfidenceMetricsEntry + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ConfidenceMetricsEntry.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.confidenceThreshold = 0; + object.recall = 0; + object.precision = 0; + object.f1Score = 0; + } + if (message.confidenceThreshold != null && message.hasOwnProperty("confidenceThreshold")) + object.confidenceThreshold = options.json && !isFinite(message.confidenceThreshold) ? String(message.confidenceThreshold) : message.confidenceThreshold; + if (message.recall != null && message.hasOwnProperty("recall")) + object.recall = options.json && !isFinite(message.recall) ? String(message.recall) : message.recall; + if (message.precision != null && message.hasOwnProperty("precision")) + object.precision = options.json && !isFinite(message.precision) ? String(message.precision) : message.precision; + if (message.f1Score != null && message.hasOwnProperty("f1Score")) + object.f1Score = options.json && !isFinite(message.f1Score) ? String(message.f1Score) : message.f1Score; + return object; + }; + + /** + * Converts this ConfidenceMetricsEntry to JSON. + * @function toJSON + * @memberof google.cloud.automl.v1.BoundingBoxMetricsEntry.ConfidenceMetricsEntry + * @instance + * @returns {Object.} JSON object + */ + ConfidenceMetricsEntry.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ConfidenceMetricsEntry + * @function getTypeUrl + * @memberof google.cloud.automl.v1.BoundingBoxMetricsEntry.ConfidenceMetricsEntry + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ConfidenceMetricsEntry.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.automl.v1.BoundingBoxMetricsEntry.ConfidenceMetricsEntry"; + }; + + return ConfidenceMetricsEntry; + })(); + + return BoundingBoxMetricsEntry; + })(); + + v1.ImageObjectDetectionEvaluationMetrics = (function() { + + /** + * Properties of an ImageObjectDetectionEvaluationMetrics. + * @memberof google.cloud.automl.v1 + * @interface IImageObjectDetectionEvaluationMetrics + * @property {number|null} [evaluatedBoundingBoxCount] ImageObjectDetectionEvaluationMetrics evaluatedBoundingBoxCount + * @property {Array.|null} [boundingBoxMetricsEntries] ImageObjectDetectionEvaluationMetrics boundingBoxMetricsEntries + * @property {number|null} [boundingBoxMeanAveragePrecision] ImageObjectDetectionEvaluationMetrics boundingBoxMeanAveragePrecision + */ + + /** + * Constructs a new ImageObjectDetectionEvaluationMetrics. + * @memberof google.cloud.automl.v1 + * @classdesc Represents an ImageObjectDetectionEvaluationMetrics. + * @implements IImageObjectDetectionEvaluationMetrics + * @constructor + * @param {google.cloud.automl.v1.IImageObjectDetectionEvaluationMetrics=} [properties] Properties to set + */ + function ImageObjectDetectionEvaluationMetrics(properties) { + this.boundingBoxMetricsEntries = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ImageObjectDetectionEvaluationMetrics evaluatedBoundingBoxCount. + * @member {number} evaluatedBoundingBoxCount + * @memberof google.cloud.automl.v1.ImageObjectDetectionEvaluationMetrics + * @instance + */ + ImageObjectDetectionEvaluationMetrics.prototype.evaluatedBoundingBoxCount = 0; + + /** + * ImageObjectDetectionEvaluationMetrics boundingBoxMetricsEntries. + * @member {Array.} boundingBoxMetricsEntries + * @memberof google.cloud.automl.v1.ImageObjectDetectionEvaluationMetrics + * @instance + */ + ImageObjectDetectionEvaluationMetrics.prototype.boundingBoxMetricsEntries = $util.emptyArray; + + /** + * ImageObjectDetectionEvaluationMetrics boundingBoxMeanAveragePrecision. + * @member {number} boundingBoxMeanAveragePrecision + * @memberof google.cloud.automl.v1.ImageObjectDetectionEvaluationMetrics + * @instance + */ + ImageObjectDetectionEvaluationMetrics.prototype.boundingBoxMeanAveragePrecision = 0; + + /** + * Creates a new ImageObjectDetectionEvaluationMetrics instance using the specified properties. + * @function create + * @memberof google.cloud.automl.v1.ImageObjectDetectionEvaluationMetrics + * @static + * @param {google.cloud.automl.v1.IImageObjectDetectionEvaluationMetrics=} [properties] Properties to set + * @returns {google.cloud.automl.v1.ImageObjectDetectionEvaluationMetrics} ImageObjectDetectionEvaluationMetrics instance + */ + ImageObjectDetectionEvaluationMetrics.create = function create(properties) { + return new ImageObjectDetectionEvaluationMetrics(properties); + }; + + /** + * Encodes the specified ImageObjectDetectionEvaluationMetrics message. Does not implicitly {@link google.cloud.automl.v1.ImageObjectDetectionEvaluationMetrics.verify|verify} messages. + * @function encode + * @memberof google.cloud.automl.v1.ImageObjectDetectionEvaluationMetrics + * @static + * @param {google.cloud.automl.v1.IImageObjectDetectionEvaluationMetrics} message ImageObjectDetectionEvaluationMetrics message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ImageObjectDetectionEvaluationMetrics.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.evaluatedBoundingBoxCount != null && Object.hasOwnProperty.call(message, "evaluatedBoundingBoxCount")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.evaluatedBoundingBoxCount); + if (message.boundingBoxMetricsEntries != null && message.boundingBoxMetricsEntries.length) + for (var i = 0; i < message.boundingBoxMetricsEntries.length; ++i) + $root.google.cloud.automl.v1.BoundingBoxMetricsEntry.encode(message.boundingBoxMetricsEntries[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.boundingBoxMeanAveragePrecision != null && Object.hasOwnProperty.call(message, "boundingBoxMeanAveragePrecision")) + writer.uint32(/* id 3, wireType 5 =*/29).float(message.boundingBoxMeanAveragePrecision); + return writer; + }; + + /** + * Encodes the specified ImageObjectDetectionEvaluationMetrics message, length delimited. Does not implicitly {@link google.cloud.automl.v1.ImageObjectDetectionEvaluationMetrics.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.automl.v1.ImageObjectDetectionEvaluationMetrics + * @static + * @param {google.cloud.automl.v1.IImageObjectDetectionEvaluationMetrics} message ImageObjectDetectionEvaluationMetrics message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ImageObjectDetectionEvaluationMetrics.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an ImageObjectDetectionEvaluationMetrics message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.automl.v1.ImageObjectDetectionEvaluationMetrics + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.automl.v1.ImageObjectDetectionEvaluationMetrics} ImageObjectDetectionEvaluationMetrics + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ImageObjectDetectionEvaluationMetrics.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.automl.v1.ImageObjectDetectionEvaluationMetrics(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.evaluatedBoundingBoxCount = reader.int32(); + break; + } + case 2: { + if (!(message.boundingBoxMetricsEntries && message.boundingBoxMetricsEntries.length)) + message.boundingBoxMetricsEntries = []; + message.boundingBoxMetricsEntries.push($root.google.cloud.automl.v1.BoundingBoxMetricsEntry.decode(reader, reader.uint32())); + break; + } + case 3: { + message.boundingBoxMeanAveragePrecision = reader.float(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an ImageObjectDetectionEvaluationMetrics message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.automl.v1.ImageObjectDetectionEvaluationMetrics + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.automl.v1.ImageObjectDetectionEvaluationMetrics} ImageObjectDetectionEvaluationMetrics + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ImageObjectDetectionEvaluationMetrics.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an ImageObjectDetectionEvaluationMetrics message. + * @function verify + * @memberof google.cloud.automl.v1.ImageObjectDetectionEvaluationMetrics + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ImageObjectDetectionEvaluationMetrics.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.evaluatedBoundingBoxCount != null && message.hasOwnProperty("evaluatedBoundingBoxCount")) + if (!$util.isInteger(message.evaluatedBoundingBoxCount)) + return "evaluatedBoundingBoxCount: integer expected"; + if (message.boundingBoxMetricsEntries != null && message.hasOwnProperty("boundingBoxMetricsEntries")) { + if (!Array.isArray(message.boundingBoxMetricsEntries)) + return "boundingBoxMetricsEntries: array expected"; + for (var i = 0; i < message.boundingBoxMetricsEntries.length; ++i) { + var error = $root.google.cloud.automl.v1.BoundingBoxMetricsEntry.verify(message.boundingBoxMetricsEntries[i]); + if (error) + return "boundingBoxMetricsEntries." + error; + } + } + if (message.boundingBoxMeanAveragePrecision != null && message.hasOwnProperty("boundingBoxMeanAveragePrecision")) + if (typeof message.boundingBoxMeanAveragePrecision !== "number") + return "boundingBoxMeanAveragePrecision: number expected"; + return null; + }; + + /** + * Creates an ImageObjectDetectionEvaluationMetrics message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.automl.v1.ImageObjectDetectionEvaluationMetrics + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.automl.v1.ImageObjectDetectionEvaluationMetrics} ImageObjectDetectionEvaluationMetrics + */ + ImageObjectDetectionEvaluationMetrics.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.automl.v1.ImageObjectDetectionEvaluationMetrics) + return object; + var message = new $root.google.cloud.automl.v1.ImageObjectDetectionEvaluationMetrics(); + if (object.evaluatedBoundingBoxCount != null) + message.evaluatedBoundingBoxCount = object.evaluatedBoundingBoxCount | 0; + if (object.boundingBoxMetricsEntries) { + if (!Array.isArray(object.boundingBoxMetricsEntries)) + throw TypeError(".google.cloud.automl.v1.ImageObjectDetectionEvaluationMetrics.boundingBoxMetricsEntries: array expected"); + message.boundingBoxMetricsEntries = []; + for (var i = 0; i < object.boundingBoxMetricsEntries.length; ++i) { + if (typeof object.boundingBoxMetricsEntries[i] !== "object") + throw TypeError(".google.cloud.automl.v1.ImageObjectDetectionEvaluationMetrics.boundingBoxMetricsEntries: object expected"); + message.boundingBoxMetricsEntries[i] = $root.google.cloud.automl.v1.BoundingBoxMetricsEntry.fromObject(object.boundingBoxMetricsEntries[i]); + } + } + if (object.boundingBoxMeanAveragePrecision != null) + message.boundingBoxMeanAveragePrecision = Number(object.boundingBoxMeanAveragePrecision); + return message; + }; + + /** + * Creates a plain object from an ImageObjectDetectionEvaluationMetrics message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.automl.v1.ImageObjectDetectionEvaluationMetrics + * @static + * @param {google.cloud.automl.v1.ImageObjectDetectionEvaluationMetrics} message ImageObjectDetectionEvaluationMetrics + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ImageObjectDetectionEvaluationMetrics.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.boundingBoxMetricsEntries = []; + if (options.defaults) { + object.evaluatedBoundingBoxCount = 0; + object.boundingBoxMeanAveragePrecision = 0; + } + if (message.evaluatedBoundingBoxCount != null && message.hasOwnProperty("evaluatedBoundingBoxCount")) + object.evaluatedBoundingBoxCount = message.evaluatedBoundingBoxCount; + if (message.boundingBoxMetricsEntries && message.boundingBoxMetricsEntries.length) { + object.boundingBoxMetricsEntries = []; + for (var j = 0; j < message.boundingBoxMetricsEntries.length; ++j) + object.boundingBoxMetricsEntries[j] = $root.google.cloud.automl.v1.BoundingBoxMetricsEntry.toObject(message.boundingBoxMetricsEntries[j], options); + } + if (message.boundingBoxMeanAveragePrecision != null && message.hasOwnProperty("boundingBoxMeanAveragePrecision")) + object.boundingBoxMeanAveragePrecision = options.json && !isFinite(message.boundingBoxMeanAveragePrecision) ? String(message.boundingBoxMeanAveragePrecision) : message.boundingBoxMeanAveragePrecision; + return object; + }; + + /** + * Converts this ImageObjectDetectionEvaluationMetrics to JSON. + * @function toJSON + * @memberof google.cloud.automl.v1.ImageObjectDetectionEvaluationMetrics + * @instance + * @returns {Object.} JSON object + */ + ImageObjectDetectionEvaluationMetrics.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ImageObjectDetectionEvaluationMetrics + * @function getTypeUrl + * @memberof google.cloud.automl.v1.ImageObjectDetectionEvaluationMetrics + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ImageObjectDetectionEvaluationMetrics.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.automl.v1.ImageObjectDetectionEvaluationMetrics"; + }; + + return ImageObjectDetectionEvaluationMetrics; + })(); + + v1.NormalizedVertex = (function() { + + /** + * Properties of a NormalizedVertex. + * @memberof google.cloud.automl.v1 + * @interface INormalizedVertex + * @property {number|null} [x] NormalizedVertex x + * @property {number|null} [y] NormalizedVertex y + */ + + /** + * Constructs a new NormalizedVertex. + * @memberof google.cloud.automl.v1 + * @classdesc Represents a NormalizedVertex. + * @implements INormalizedVertex + * @constructor + * @param {google.cloud.automl.v1.INormalizedVertex=} [properties] Properties to set + */ + function NormalizedVertex(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * NormalizedVertex x. + * @member {number} x + * @memberof google.cloud.automl.v1.NormalizedVertex + * @instance + */ + NormalizedVertex.prototype.x = 0; + + /** + * NormalizedVertex y. + * @member {number} y + * @memberof google.cloud.automl.v1.NormalizedVertex + * @instance + */ + NormalizedVertex.prototype.y = 0; + + /** + * Creates a new NormalizedVertex instance using the specified properties. + * @function create + * @memberof google.cloud.automl.v1.NormalizedVertex + * @static + * @param {google.cloud.automl.v1.INormalizedVertex=} [properties] Properties to set + * @returns {google.cloud.automl.v1.NormalizedVertex} NormalizedVertex instance + */ + NormalizedVertex.create = function create(properties) { + return new NormalizedVertex(properties); + }; + + /** + * Encodes the specified NormalizedVertex message. Does not implicitly {@link google.cloud.automl.v1.NormalizedVertex.verify|verify} messages. + * @function encode + * @memberof google.cloud.automl.v1.NormalizedVertex + * @static + * @param {google.cloud.automl.v1.INormalizedVertex} message NormalizedVertex message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + NormalizedVertex.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.x != null && Object.hasOwnProperty.call(message, "x")) + writer.uint32(/* id 1, wireType 5 =*/13).float(message.x); + if (message.y != null && Object.hasOwnProperty.call(message, "y")) + writer.uint32(/* id 2, wireType 5 =*/21).float(message.y); + return writer; + }; + + /** + * Encodes the specified NormalizedVertex message, length delimited. Does not implicitly {@link google.cloud.automl.v1.NormalizedVertex.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.automl.v1.NormalizedVertex + * @static + * @param {google.cloud.automl.v1.INormalizedVertex} message NormalizedVertex message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + NormalizedVertex.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a NormalizedVertex message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.automl.v1.NormalizedVertex + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.automl.v1.NormalizedVertex} NormalizedVertex + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + NormalizedVertex.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.automl.v1.NormalizedVertex(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.x = reader.float(); + break; + } + case 2: { + message.y = reader.float(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a NormalizedVertex message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.automl.v1.NormalizedVertex + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.automl.v1.NormalizedVertex} NormalizedVertex + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + NormalizedVertex.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a NormalizedVertex message. + * @function verify + * @memberof google.cloud.automl.v1.NormalizedVertex + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + NormalizedVertex.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.x != null && message.hasOwnProperty("x")) + if (typeof message.x !== "number") + return "x: number expected"; + if (message.y != null && message.hasOwnProperty("y")) + if (typeof message.y !== "number") + return "y: number expected"; + return null; + }; + + /** + * Creates a NormalizedVertex message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.automl.v1.NormalizedVertex + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.automl.v1.NormalizedVertex} NormalizedVertex + */ + NormalizedVertex.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.automl.v1.NormalizedVertex) + return object; + var message = new $root.google.cloud.automl.v1.NormalizedVertex(); + if (object.x != null) + message.x = Number(object.x); + if (object.y != null) + message.y = Number(object.y); + return message; + }; + + /** + * Creates a plain object from a NormalizedVertex message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.automl.v1.NormalizedVertex + * @static + * @param {google.cloud.automl.v1.NormalizedVertex} message NormalizedVertex + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + NormalizedVertex.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.x = 0; + object.y = 0; + } + if (message.x != null && message.hasOwnProperty("x")) + object.x = options.json && !isFinite(message.x) ? String(message.x) : message.x; + if (message.y != null && message.hasOwnProperty("y")) + object.y = options.json && !isFinite(message.y) ? String(message.y) : message.y; + return object; + }; + + /** + * Converts this NormalizedVertex to JSON. + * @function toJSON + * @memberof google.cloud.automl.v1.NormalizedVertex + * @instance + * @returns {Object.} JSON object + */ + NormalizedVertex.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for NormalizedVertex + * @function getTypeUrl + * @memberof google.cloud.automl.v1.NormalizedVertex + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + NormalizedVertex.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.automl.v1.NormalizedVertex"; + }; + + return NormalizedVertex; + })(); + + v1.BoundingPoly = (function() { + + /** + * Properties of a BoundingPoly. + * @memberof google.cloud.automl.v1 + * @interface IBoundingPoly + * @property {Array.|null} [normalizedVertices] BoundingPoly normalizedVertices + */ + + /** + * Constructs a new BoundingPoly. + * @memberof google.cloud.automl.v1 + * @classdesc Represents a BoundingPoly. + * @implements IBoundingPoly + * @constructor + * @param {google.cloud.automl.v1.IBoundingPoly=} [properties] Properties to set + */ + function BoundingPoly(properties) { + this.normalizedVertices = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * BoundingPoly normalizedVertices. + * @member {Array.} normalizedVertices + * @memberof google.cloud.automl.v1.BoundingPoly + * @instance + */ + BoundingPoly.prototype.normalizedVertices = $util.emptyArray; + + /** + * Creates a new BoundingPoly instance using the specified properties. + * @function create + * @memberof google.cloud.automl.v1.BoundingPoly + * @static + * @param {google.cloud.automl.v1.IBoundingPoly=} [properties] Properties to set + * @returns {google.cloud.automl.v1.BoundingPoly} BoundingPoly instance + */ + BoundingPoly.create = function create(properties) { + return new BoundingPoly(properties); + }; + + /** + * Encodes the specified BoundingPoly message. Does not implicitly {@link google.cloud.automl.v1.BoundingPoly.verify|verify} messages. + * @function encode + * @memberof google.cloud.automl.v1.BoundingPoly + * @static + * @param {google.cloud.automl.v1.IBoundingPoly} message BoundingPoly message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BoundingPoly.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.normalizedVertices != null && message.normalizedVertices.length) + for (var i = 0; i < message.normalizedVertices.length; ++i) + $root.google.cloud.automl.v1.NormalizedVertex.encode(message.normalizedVertices[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified BoundingPoly message, length delimited. Does not implicitly {@link google.cloud.automl.v1.BoundingPoly.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.automl.v1.BoundingPoly + * @static + * @param {google.cloud.automl.v1.IBoundingPoly} message BoundingPoly message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BoundingPoly.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a BoundingPoly message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.automl.v1.BoundingPoly + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.automl.v1.BoundingPoly} BoundingPoly + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BoundingPoly.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.automl.v1.BoundingPoly(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 2: { + if (!(message.normalizedVertices && message.normalizedVertices.length)) + message.normalizedVertices = []; + message.normalizedVertices.push($root.google.cloud.automl.v1.NormalizedVertex.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a BoundingPoly message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.automl.v1.BoundingPoly + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.automl.v1.BoundingPoly} BoundingPoly + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BoundingPoly.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a BoundingPoly message. + * @function verify + * @memberof google.cloud.automl.v1.BoundingPoly + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + BoundingPoly.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.normalizedVertices != null && message.hasOwnProperty("normalizedVertices")) { + if (!Array.isArray(message.normalizedVertices)) + return "normalizedVertices: array expected"; + for (var i = 0; i < message.normalizedVertices.length; ++i) { + var error = $root.google.cloud.automl.v1.NormalizedVertex.verify(message.normalizedVertices[i]); + if (error) + return "normalizedVertices." + error; + } + } + return null; + }; + + /** + * Creates a BoundingPoly message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.automl.v1.BoundingPoly + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.automl.v1.BoundingPoly} BoundingPoly + */ + BoundingPoly.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.automl.v1.BoundingPoly) + return object; + var message = new $root.google.cloud.automl.v1.BoundingPoly(); + if (object.normalizedVertices) { + if (!Array.isArray(object.normalizedVertices)) + throw TypeError(".google.cloud.automl.v1.BoundingPoly.normalizedVertices: array expected"); + message.normalizedVertices = []; + for (var i = 0; i < object.normalizedVertices.length; ++i) { + if (typeof object.normalizedVertices[i] !== "object") + throw TypeError(".google.cloud.automl.v1.BoundingPoly.normalizedVertices: object expected"); + message.normalizedVertices[i] = $root.google.cloud.automl.v1.NormalizedVertex.fromObject(object.normalizedVertices[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a BoundingPoly message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.automl.v1.BoundingPoly + * @static + * @param {google.cloud.automl.v1.BoundingPoly} message BoundingPoly + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + BoundingPoly.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.normalizedVertices = []; + if (message.normalizedVertices && message.normalizedVertices.length) { + object.normalizedVertices = []; + for (var j = 0; j < message.normalizedVertices.length; ++j) + object.normalizedVertices[j] = $root.google.cloud.automl.v1.NormalizedVertex.toObject(message.normalizedVertices[j], options); + } + return object; + }; + + /** + * Converts this BoundingPoly to JSON. + * @function toJSON + * @memberof google.cloud.automl.v1.BoundingPoly + * @instance + * @returns {Object.} JSON object + */ + BoundingPoly.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for BoundingPoly + * @function getTypeUrl + * @memberof google.cloud.automl.v1.BoundingPoly + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + BoundingPoly.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.automl.v1.BoundingPoly"; + }; + + return BoundingPoly; + })(); + + v1.TextExtractionAnnotation = (function() { + + /** + * Properties of a TextExtractionAnnotation. + * @memberof google.cloud.automl.v1 + * @interface ITextExtractionAnnotation + * @property {google.cloud.automl.v1.ITextSegment|null} [textSegment] TextExtractionAnnotation textSegment + * @property {number|null} [score] TextExtractionAnnotation score + */ + + /** + * Constructs a new TextExtractionAnnotation. + * @memberof google.cloud.automl.v1 + * @classdesc Represents a TextExtractionAnnotation. + * @implements ITextExtractionAnnotation + * @constructor + * @param {google.cloud.automl.v1.ITextExtractionAnnotation=} [properties] Properties to set + */ + function TextExtractionAnnotation(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * TextExtractionAnnotation textSegment. + * @member {google.cloud.automl.v1.ITextSegment|null|undefined} textSegment + * @memberof google.cloud.automl.v1.TextExtractionAnnotation + * @instance + */ + TextExtractionAnnotation.prototype.textSegment = null; + + /** + * TextExtractionAnnotation score. + * @member {number} score + * @memberof google.cloud.automl.v1.TextExtractionAnnotation + * @instance + */ + TextExtractionAnnotation.prototype.score = 0; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * TextExtractionAnnotation annotation. + * @member {"textSegment"|undefined} annotation + * @memberof google.cloud.automl.v1.TextExtractionAnnotation + * @instance + */ + Object.defineProperty(TextExtractionAnnotation.prototype, "annotation", { + get: $util.oneOfGetter($oneOfFields = ["textSegment"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new TextExtractionAnnotation instance using the specified properties. + * @function create + * @memberof google.cloud.automl.v1.TextExtractionAnnotation + * @static + * @param {google.cloud.automl.v1.ITextExtractionAnnotation=} [properties] Properties to set + * @returns {google.cloud.automl.v1.TextExtractionAnnotation} TextExtractionAnnotation instance + */ + TextExtractionAnnotation.create = function create(properties) { + return new TextExtractionAnnotation(properties); + }; + + /** + * Encodes the specified TextExtractionAnnotation message. Does not implicitly {@link google.cloud.automl.v1.TextExtractionAnnotation.verify|verify} messages. + * @function encode + * @memberof google.cloud.automl.v1.TextExtractionAnnotation + * @static + * @param {google.cloud.automl.v1.ITextExtractionAnnotation} message TextExtractionAnnotation message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TextExtractionAnnotation.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.score != null && Object.hasOwnProperty.call(message, "score")) + writer.uint32(/* id 1, wireType 5 =*/13).float(message.score); + if (message.textSegment != null && Object.hasOwnProperty.call(message, "textSegment")) + $root.google.cloud.automl.v1.TextSegment.encode(message.textSegment, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified TextExtractionAnnotation message, length delimited. Does not implicitly {@link google.cloud.automl.v1.TextExtractionAnnotation.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.automl.v1.TextExtractionAnnotation + * @static + * @param {google.cloud.automl.v1.ITextExtractionAnnotation} message TextExtractionAnnotation message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TextExtractionAnnotation.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a TextExtractionAnnotation message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.automl.v1.TextExtractionAnnotation + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.automl.v1.TextExtractionAnnotation} TextExtractionAnnotation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TextExtractionAnnotation.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.automl.v1.TextExtractionAnnotation(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 3: { + message.textSegment = $root.google.cloud.automl.v1.TextSegment.decode(reader, reader.uint32()); + break; + } + case 1: { + message.score = reader.float(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a TextExtractionAnnotation message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.automl.v1.TextExtractionAnnotation + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.automl.v1.TextExtractionAnnotation} TextExtractionAnnotation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TextExtractionAnnotation.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a TextExtractionAnnotation message. + * @function verify + * @memberof google.cloud.automl.v1.TextExtractionAnnotation + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + TextExtractionAnnotation.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.textSegment != null && message.hasOwnProperty("textSegment")) { + properties.annotation = 1; + { + var error = $root.google.cloud.automl.v1.TextSegment.verify(message.textSegment); + if (error) + return "textSegment." + error; + } + } + if (message.score != null && message.hasOwnProperty("score")) + if (typeof message.score !== "number") + return "score: number expected"; + return null; + }; + + /** + * Creates a TextExtractionAnnotation message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.automl.v1.TextExtractionAnnotation + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.automl.v1.TextExtractionAnnotation} TextExtractionAnnotation + */ + TextExtractionAnnotation.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.automl.v1.TextExtractionAnnotation) + return object; + var message = new $root.google.cloud.automl.v1.TextExtractionAnnotation(); + if (object.textSegment != null) { + if (typeof object.textSegment !== "object") + throw TypeError(".google.cloud.automl.v1.TextExtractionAnnotation.textSegment: object expected"); + message.textSegment = $root.google.cloud.automl.v1.TextSegment.fromObject(object.textSegment); + } + if (object.score != null) + message.score = Number(object.score); + return message; + }; + + /** + * Creates a plain object from a TextExtractionAnnotation message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.automl.v1.TextExtractionAnnotation + * @static + * @param {google.cloud.automl.v1.TextExtractionAnnotation} message TextExtractionAnnotation + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + TextExtractionAnnotation.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.score = 0; + if (message.score != null && message.hasOwnProperty("score")) + object.score = options.json && !isFinite(message.score) ? String(message.score) : message.score; + if (message.textSegment != null && message.hasOwnProperty("textSegment")) { + object.textSegment = $root.google.cloud.automl.v1.TextSegment.toObject(message.textSegment, options); + if (options.oneofs) + object.annotation = "textSegment"; + } + return object; + }; + + /** + * Converts this TextExtractionAnnotation to JSON. + * @function toJSON + * @memberof google.cloud.automl.v1.TextExtractionAnnotation + * @instance + * @returns {Object.} JSON object + */ + TextExtractionAnnotation.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for TextExtractionAnnotation + * @function getTypeUrl + * @memberof google.cloud.automl.v1.TextExtractionAnnotation + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TextExtractionAnnotation.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.automl.v1.TextExtractionAnnotation"; + }; + + return TextExtractionAnnotation; + })(); + + v1.TextExtractionEvaluationMetrics = (function() { + + /** + * Properties of a TextExtractionEvaluationMetrics. + * @memberof google.cloud.automl.v1 + * @interface ITextExtractionEvaluationMetrics + * @property {number|null} [auPrc] TextExtractionEvaluationMetrics auPrc + * @property {Array.|null} [confidenceMetricsEntries] TextExtractionEvaluationMetrics confidenceMetricsEntries + */ + + /** + * Constructs a new TextExtractionEvaluationMetrics. + * @memberof google.cloud.automl.v1 + * @classdesc Represents a TextExtractionEvaluationMetrics. + * @implements ITextExtractionEvaluationMetrics + * @constructor + * @param {google.cloud.automl.v1.ITextExtractionEvaluationMetrics=} [properties] Properties to set + */ + function TextExtractionEvaluationMetrics(properties) { + this.confidenceMetricsEntries = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * TextExtractionEvaluationMetrics auPrc. + * @member {number} auPrc + * @memberof google.cloud.automl.v1.TextExtractionEvaluationMetrics + * @instance + */ + TextExtractionEvaluationMetrics.prototype.auPrc = 0; + + /** + * TextExtractionEvaluationMetrics confidenceMetricsEntries. + * @member {Array.} confidenceMetricsEntries + * @memberof google.cloud.automl.v1.TextExtractionEvaluationMetrics + * @instance + */ + TextExtractionEvaluationMetrics.prototype.confidenceMetricsEntries = $util.emptyArray; + + /** + * Creates a new TextExtractionEvaluationMetrics instance using the specified properties. + * @function create + * @memberof google.cloud.automl.v1.TextExtractionEvaluationMetrics + * @static + * @param {google.cloud.automl.v1.ITextExtractionEvaluationMetrics=} [properties] Properties to set + * @returns {google.cloud.automl.v1.TextExtractionEvaluationMetrics} TextExtractionEvaluationMetrics instance + */ + TextExtractionEvaluationMetrics.create = function create(properties) { + return new TextExtractionEvaluationMetrics(properties); + }; + + /** + * Encodes the specified TextExtractionEvaluationMetrics message. Does not implicitly {@link google.cloud.automl.v1.TextExtractionEvaluationMetrics.verify|verify} messages. + * @function encode + * @memberof google.cloud.automl.v1.TextExtractionEvaluationMetrics + * @static + * @param {google.cloud.automl.v1.ITextExtractionEvaluationMetrics} message TextExtractionEvaluationMetrics message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TextExtractionEvaluationMetrics.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.auPrc != null && Object.hasOwnProperty.call(message, "auPrc")) + writer.uint32(/* id 1, wireType 5 =*/13).float(message.auPrc); + if (message.confidenceMetricsEntries != null && message.confidenceMetricsEntries.length) + for (var i = 0; i < message.confidenceMetricsEntries.length; ++i) + $root.google.cloud.automl.v1.TextExtractionEvaluationMetrics.ConfidenceMetricsEntry.encode(message.confidenceMetricsEntries[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified TextExtractionEvaluationMetrics message, length delimited. Does not implicitly {@link google.cloud.automl.v1.TextExtractionEvaluationMetrics.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.automl.v1.TextExtractionEvaluationMetrics + * @static + * @param {google.cloud.automl.v1.ITextExtractionEvaluationMetrics} message TextExtractionEvaluationMetrics message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TextExtractionEvaluationMetrics.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a TextExtractionEvaluationMetrics message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.automl.v1.TextExtractionEvaluationMetrics + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.automl.v1.TextExtractionEvaluationMetrics} TextExtractionEvaluationMetrics + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TextExtractionEvaluationMetrics.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.automl.v1.TextExtractionEvaluationMetrics(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.auPrc = reader.float(); + break; + } + case 2: { + if (!(message.confidenceMetricsEntries && message.confidenceMetricsEntries.length)) + message.confidenceMetricsEntries = []; + message.confidenceMetricsEntries.push($root.google.cloud.automl.v1.TextExtractionEvaluationMetrics.ConfidenceMetricsEntry.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a TextExtractionEvaluationMetrics message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.automl.v1.TextExtractionEvaluationMetrics + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.automl.v1.TextExtractionEvaluationMetrics} TextExtractionEvaluationMetrics + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TextExtractionEvaluationMetrics.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a TextExtractionEvaluationMetrics message. + * @function verify + * @memberof google.cloud.automl.v1.TextExtractionEvaluationMetrics + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + TextExtractionEvaluationMetrics.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.auPrc != null && message.hasOwnProperty("auPrc")) + if (typeof message.auPrc !== "number") + return "auPrc: number expected"; + if (message.confidenceMetricsEntries != null && message.hasOwnProperty("confidenceMetricsEntries")) { + if (!Array.isArray(message.confidenceMetricsEntries)) + return "confidenceMetricsEntries: array expected"; + for (var i = 0; i < message.confidenceMetricsEntries.length; ++i) { + var error = $root.google.cloud.automl.v1.TextExtractionEvaluationMetrics.ConfidenceMetricsEntry.verify(message.confidenceMetricsEntries[i]); + if (error) + return "confidenceMetricsEntries." + error; + } + } + return null; + }; + + /** + * Creates a TextExtractionEvaluationMetrics message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.automl.v1.TextExtractionEvaluationMetrics + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.automl.v1.TextExtractionEvaluationMetrics} TextExtractionEvaluationMetrics + */ + TextExtractionEvaluationMetrics.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.automl.v1.TextExtractionEvaluationMetrics) + return object; + var message = new $root.google.cloud.automl.v1.TextExtractionEvaluationMetrics(); + if (object.auPrc != null) + message.auPrc = Number(object.auPrc); + if (object.confidenceMetricsEntries) { + if (!Array.isArray(object.confidenceMetricsEntries)) + throw TypeError(".google.cloud.automl.v1.TextExtractionEvaluationMetrics.confidenceMetricsEntries: array expected"); + message.confidenceMetricsEntries = []; + for (var i = 0; i < object.confidenceMetricsEntries.length; ++i) { + if (typeof object.confidenceMetricsEntries[i] !== "object") + throw TypeError(".google.cloud.automl.v1.TextExtractionEvaluationMetrics.confidenceMetricsEntries: object expected"); + message.confidenceMetricsEntries[i] = $root.google.cloud.automl.v1.TextExtractionEvaluationMetrics.ConfidenceMetricsEntry.fromObject(object.confidenceMetricsEntries[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a TextExtractionEvaluationMetrics message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.automl.v1.TextExtractionEvaluationMetrics + * @static + * @param {google.cloud.automl.v1.TextExtractionEvaluationMetrics} message TextExtractionEvaluationMetrics + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + TextExtractionEvaluationMetrics.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.confidenceMetricsEntries = []; + if (options.defaults) + object.auPrc = 0; + if (message.auPrc != null && message.hasOwnProperty("auPrc")) + object.auPrc = options.json && !isFinite(message.auPrc) ? String(message.auPrc) : message.auPrc; + if (message.confidenceMetricsEntries && message.confidenceMetricsEntries.length) { + object.confidenceMetricsEntries = []; + for (var j = 0; j < message.confidenceMetricsEntries.length; ++j) + object.confidenceMetricsEntries[j] = $root.google.cloud.automl.v1.TextExtractionEvaluationMetrics.ConfidenceMetricsEntry.toObject(message.confidenceMetricsEntries[j], options); + } + return object; + }; + + /** + * Converts this TextExtractionEvaluationMetrics to JSON. + * @function toJSON + * @memberof google.cloud.automl.v1.TextExtractionEvaluationMetrics + * @instance + * @returns {Object.} JSON object + */ + TextExtractionEvaluationMetrics.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for TextExtractionEvaluationMetrics + * @function getTypeUrl + * @memberof google.cloud.automl.v1.TextExtractionEvaluationMetrics + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TextExtractionEvaluationMetrics.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.automl.v1.TextExtractionEvaluationMetrics"; + }; + + TextExtractionEvaluationMetrics.ConfidenceMetricsEntry = (function() { + + /** + * Properties of a ConfidenceMetricsEntry. + * @memberof google.cloud.automl.v1.TextExtractionEvaluationMetrics + * @interface IConfidenceMetricsEntry + * @property {number|null} [confidenceThreshold] ConfidenceMetricsEntry confidenceThreshold + * @property {number|null} [recall] ConfidenceMetricsEntry recall + * @property {number|null} [precision] ConfidenceMetricsEntry precision + * @property {number|null} [f1Score] ConfidenceMetricsEntry f1Score + */ + + /** + * Constructs a new ConfidenceMetricsEntry. + * @memberof google.cloud.automl.v1.TextExtractionEvaluationMetrics + * @classdesc Represents a ConfidenceMetricsEntry. + * @implements IConfidenceMetricsEntry + * @constructor + * @param {google.cloud.automl.v1.TextExtractionEvaluationMetrics.IConfidenceMetricsEntry=} [properties] Properties to set + */ + function ConfidenceMetricsEntry(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ConfidenceMetricsEntry confidenceThreshold. + * @member {number} confidenceThreshold + * @memberof google.cloud.automl.v1.TextExtractionEvaluationMetrics.ConfidenceMetricsEntry + * @instance + */ + ConfidenceMetricsEntry.prototype.confidenceThreshold = 0; + + /** + * ConfidenceMetricsEntry recall. + * @member {number} recall + * @memberof google.cloud.automl.v1.TextExtractionEvaluationMetrics.ConfidenceMetricsEntry + * @instance + */ + ConfidenceMetricsEntry.prototype.recall = 0; + + /** + * ConfidenceMetricsEntry precision. + * @member {number} precision + * @memberof google.cloud.automl.v1.TextExtractionEvaluationMetrics.ConfidenceMetricsEntry + * @instance + */ + ConfidenceMetricsEntry.prototype.precision = 0; + + /** + * ConfidenceMetricsEntry f1Score. + * @member {number} f1Score + * @memberof google.cloud.automl.v1.TextExtractionEvaluationMetrics.ConfidenceMetricsEntry + * @instance + */ + ConfidenceMetricsEntry.prototype.f1Score = 0; + + /** + * Creates a new ConfidenceMetricsEntry instance using the specified properties. + * @function create + * @memberof google.cloud.automl.v1.TextExtractionEvaluationMetrics.ConfidenceMetricsEntry + * @static + * @param {google.cloud.automl.v1.TextExtractionEvaluationMetrics.IConfidenceMetricsEntry=} [properties] Properties to set + * @returns {google.cloud.automl.v1.TextExtractionEvaluationMetrics.ConfidenceMetricsEntry} ConfidenceMetricsEntry instance + */ + ConfidenceMetricsEntry.create = function create(properties) { + return new ConfidenceMetricsEntry(properties); + }; + + /** + * Encodes the specified ConfidenceMetricsEntry message. Does not implicitly {@link google.cloud.automl.v1.TextExtractionEvaluationMetrics.ConfidenceMetricsEntry.verify|verify} messages. + * @function encode + * @memberof google.cloud.automl.v1.TextExtractionEvaluationMetrics.ConfidenceMetricsEntry + * @static + * @param {google.cloud.automl.v1.TextExtractionEvaluationMetrics.IConfidenceMetricsEntry} message ConfidenceMetricsEntry message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ConfidenceMetricsEntry.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.confidenceThreshold != null && Object.hasOwnProperty.call(message, "confidenceThreshold")) + writer.uint32(/* id 1, wireType 5 =*/13).float(message.confidenceThreshold); + if (message.recall != null && Object.hasOwnProperty.call(message, "recall")) + writer.uint32(/* id 3, wireType 5 =*/29).float(message.recall); + if (message.precision != null && Object.hasOwnProperty.call(message, "precision")) + writer.uint32(/* id 4, wireType 5 =*/37).float(message.precision); + if (message.f1Score != null && Object.hasOwnProperty.call(message, "f1Score")) + writer.uint32(/* id 5, wireType 5 =*/45).float(message.f1Score); + return writer; + }; + + /** + * Encodes the specified ConfidenceMetricsEntry message, length delimited. Does not implicitly {@link google.cloud.automl.v1.TextExtractionEvaluationMetrics.ConfidenceMetricsEntry.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.automl.v1.TextExtractionEvaluationMetrics.ConfidenceMetricsEntry + * @static + * @param {google.cloud.automl.v1.TextExtractionEvaluationMetrics.IConfidenceMetricsEntry} message ConfidenceMetricsEntry message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ConfidenceMetricsEntry.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ConfidenceMetricsEntry message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.automl.v1.TextExtractionEvaluationMetrics.ConfidenceMetricsEntry + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.automl.v1.TextExtractionEvaluationMetrics.ConfidenceMetricsEntry} ConfidenceMetricsEntry + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ConfidenceMetricsEntry.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.automl.v1.TextExtractionEvaluationMetrics.ConfidenceMetricsEntry(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.confidenceThreshold = reader.float(); + break; + } + case 3: { + message.recall = reader.float(); + break; + } + case 4: { + message.precision = reader.float(); + break; + } + case 5: { + message.f1Score = reader.float(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ConfidenceMetricsEntry message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.automl.v1.TextExtractionEvaluationMetrics.ConfidenceMetricsEntry + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.automl.v1.TextExtractionEvaluationMetrics.ConfidenceMetricsEntry} ConfidenceMetricsEntry + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ConfidenceMetricsEntry.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ConfidenceMetricsEntry message. + * @function verify + * @memberof google.cloud.automl.v1.TextExtractionEvaluationMetrics.ConfidenceMetricsEntry + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ConfidenceMetricsEntry.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.confidenceThreshold != null && message.hasOwnProperty("confidenceThreshold")) + if (typeof message.confidenceThreshold !== "number") + return "confidenceThreshold: number expected"; + if (message.recall != null && message.hasOwnProperty("recall")) + if (typeof message.recall !== "number") + return "recall: number expected"; + if (message.precision != null && message.hasOwnProperty("precision")) + if (typeof message.precision !== "number") + return "precision: number expected"; + if (message.f1Score != null && message.hasOwnProperty("f1Score")) + if (typeof message.f1Score !== "number") + return "f1Score: number expected"; + return null; + }; + + /** + * Creates a ConfidenceMetricsEntry message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.automl.v1.TextExtractionEvaluationMetrics.ConfidenceMetricsEntry + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.automl.v1.TextExtractionEvaluationMetrics.ConfidenceMetricsEntry} ConfidenceMetricsEntry + */ + ConfidenceMetricsEntry.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.automl.v1.TextExtractionEvaluationMetrics.ConfidenceMetricsEntry) + return object; + var message = new $root.google.cloud.automl.v1.TextExtractionEvaluationMetrics.ConfidenceMetricsEntry(); + if (object.confidenceThreshold != null) + message.confidenceThreshold = Number(object.confidenceThreshold); + if (object.recall != null) + message.recall = Number(object.recall); + if (object.precision != null) + message.precision = Number(object.precision); + if (object.f1Score != null) + message.f1Score = Number(object.f1Score); + return message; + }; + + /** + * Creates a plain object from a ConfidenceMetricsEntry message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.automl.v1.TextExtractionEvaluationMetrics.ConfidenceMetricsEntry + * @static + * @param {google.cloud.automl.v1.TextExtractionEvaluationMetrics.ConfidenceMetricsEntry} message ConfidenceMetricsEntry + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ConfidenceMetricsEntry.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.confidenceThreshold = 0; + object.recall = 0; + object.precision = 0; + object.f1Score = 0; + } + if (message.confidenceThreshold != null && message.hasOwnProperty("confidenceThreshold")) + object.confidenceThreshold = options.json && !isFinite(message.confidenceThreshold) ? String(message.confidenceThreshold) : message.confidenceThreshold; + if (message.recall != null && message.hasOwnProperty("recall")) + object.recall = options.json && !isFinite(message.recall) ? String(message.recall) : message.recall; + if (message.precision != null && message.hasOwnProperty("precision")) + object.precision = options.json && !isFinite(message.precision) ? String(message.precision) : message.precision; + if (message.f1Score != null && message.hasOwnProperty("f1Score")) + object.f1Score = options.json && !isFinite(message.f1Score) ? String(message.f1Score) : message.f1Score; + return object; + }; + + /** + * Converts this ConfidenceMetricsEntry to JSON. + * @function toJSON + * @memberof google.cloud.automl.v1.TextExtractionEvaluationMetrics.ConfidenceMetricsEntry + * @instance + * @returns {Object.} JSON object + */ + ConfidenceMetricsEntry.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ConfidenceMetricsEntry + * @function getTypeUrl + * @memberof google.cloud.automl.v1.TextExtractionEvaluationMetrics.ConfidenceMetricsEntry + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ConfidenceMetricsEntry.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.automl.v1.TextExtractionEvaluationMetrics.ConfidenceMetricsEntry"; + }; + + return ConfidenceMetricsEntry; + })(); + + return TextExtractionEvaluationMetrics; + })(); + + v1.TextSegment = (function() { + + /** + * Properties of a TextSegment. + * @memberof google.cloud.automl.v1 + * @interface ITextSegment + * @property {string|null} [content] TextSegment content + * @property {number|Long|null} [startOffset] TextSegment startOffset + * @property {number|Long|null} [endOffset] TextSegment endOffset + */ + + /** + * Constructs a new TextSegment. + * @memberof google.cloud.automl.v1 + * @classdesc Represents a TextSegment. + * @implements ITextSegment + * @constructor + * @param {google.cloud.automl.v1.ITextSegment=} [properties] Properties to set + */ + function TextSegment(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * TextSegment content. + * @member {string} content + * @memberof google.cloud.automl.v1.TextSegment + * @instance + */ + TextSegment.prototype.content = ""; + + /** + * TextSegment startOffset. + * @member {number|Long} startOffset + * @memberof google.cloud.automl.v1.TextSegment + * @instance + */ + TextSegment.prototype.startOffset = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * TextSegment endOffset. + * @member {number|Long} endOffset + * @memberof google.cloud.automl.v1.TextSegment + * @instance + */ + TextSegment.prototype.endOffset = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new TextSegment instance using the specified properties. + * @function create + * @memberof google.cloud.automl.v1.TextSegment + * @static + * @param {google.cloud.automl.v1.ITextSegment=} [properties] Properties to set + * @returns {google.cloud.automl.v1.TextSegment} TextSegment instance + */ + TextSegment.create = function create(properties) { + return new TextSegment(properties); + }; + + /** + * Encodes the specified TextSegment message. Does not implicitly {@link google.cloud.automl.v1.TextSegment.verify|verify} messages. + * @function encode + * @memberof google.cloud.automl.v1.TextSegment + * @static + * @param {google.cloud.automl.v1.ITextSegment} message TextSegment message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TextSegment.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.startOffset != null && Object.hasOwnProperty.call(message, "startOffset")) + writer.uint32(/* id 1, wireType 0 =*/8).int64(message.startOffset); + if (message.endOffset != null && Object.hasOwnProperty.call(message, "endOffset")) + writer.uint32(/* id 2, wireType 0 =*/16).int64(message.endOffset); + if (message.content != null && Object.hasOwnProperty.call(message, "content")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.content); + return writer; + }; + + /** + * Encodes the specified TextSegment message, length delimited. Does not implicitly {@link google.cloud.automl.v1.TextSegment.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.automl.v1.TextSegment + * @static + * @param {google.cloud.automl.v1.ITextSegment} message TextSegment message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TextSegment.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a TextSegment message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.automl.v1.TextSegment + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.automl.v1.TextSegment} TextSegment + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TextSegment.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.automl.v1.TextSegment(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 3: { + message.content = reader.string(); + break; + } + case 1: { + message.startOffset = reader.int64(); + break; + } + case 2: { + message.endOffset = reader.int64(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a TextSegment message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.automl.v1.TextSegment + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.automl.v1.TextSegment} TextSegment + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TextSegment.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a TextSegment message. + * @function verify + * @memberof google.cloud.automl.v1.TextSegment + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + TextSegment.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.content != null && message.hasOwnProperty("content")) + if (!$util.isString(message.content)) + return "content: string expected"; + if (message.startOffset != null && message.hasOwnProperty("startOffset")) + if (!$util.isInteger(message.startOffset) && !(message.startOffset && $util.isInteger(message.startOffset.low) && $util.isInteger(message.startOffset.high))) + return "startOffset: integer|Long expected"; + if (message.endOffset != null && message.hasOwnProperty("endOffset")) + if (!$util.isInteger(message.endOffset) && !(message.endOffset && $util.isInteger(message.endOffset.low) && $util.isInteger(message.endOffset.high))) + return "endOffset: integer|Long expected"; + return null; + }; + + /** + * Creates a TextSegment message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.automl.v1.TextSegment + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.automl.v1.TextSegment} TextSegment + */ + TextSegment.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.automl.v1.TextSegment) + return object; + var message = new $root.google.cloud.automl.v1.TextSegment(); + if (object.content != null) + message.content = String(object.content); + if (object.startOffset != null) + if ($util.Long) + (message.startOffset = $util.Long.fromValue(object.startOffset)).unsigned = false; + else if (typeof object.startOffset === "string") + message.startOffset = parseInt(object.startOffset, 10); + else if (typeof object.startOffset === "number") + message.startOffset = object.startOffset; + else if (typeof object.startOffset === "object") + message.startOffset = new $util.LongBits(object.startOffset.low >>> 0, object.startOffset.high >>> 0).toNumber(); + if (object.endOffset != null) + if ($util.Long) + (message.endOffset = $util.Long.fromValue(object.endOffset)).unsigned = false; + else if (typeof object.endOffset === "string") + message.endOffset = parseInt(object.endOffset, 10); + else if (typeof object.endOffset === "number") + message.endOffset = object.endOffset; + else if (typeof object.endOffset === "object") + message.endOffset = new $util.LongBits(object.endOffset.low >>> 0, object.endOffset.high >>> 0).toNumber(); + return message; + }; + + /** + * Creates a plain object from a TextSegment message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.automl.v1.TextSegment + * @static + * @param {google.cloud.automl.v1.TextSegment} message TextSegment + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + TextSegment.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.startOffset = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.startOffset = options.longs === String ? "0" : 0; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.endOffset = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.endOffset = options.longs === String ? "0" : 0; + object.content = ""; + } + if (message.startOffset != null && message.hasOwnProperty("startOffset")) + if (typeof message.startOffset === "number") + object.startOffset = options.longs === String ? String(message.startOffset) : message.startOffset; + else + object.startOffset = options.longs === String ? $util.Long.prototype.toString.call(message.startOffset) : options.longs === Number ? new $util.LongBits(message.startOffset.low >>> 0, message.startOffset.high >>> 0).toNumber() : message.startOffset; + if (message.endOffset != null && message.hasOwnProperty("endOffset")) + if (typeof message.endOffset === "number") + object.endOffset = options.longs === String ? String(message.endOffset) : message.endOffset; + else + object.endOffset = options.longs === String ? $util.Long.prototype.toString.call(message.endOffset) : options.longs === Number ? new $util.LongBits(message.endOffset.low >>> 0, message.endOffset.high >>> 0).toNumber() : message.endOffset; + if (message.content != null && message.hasOwnProperty("content")) + object.content = message.content; + return object; + }; + + /** + * Converts this TextSegment to JSON. + * @function toJSON + * @memberof google.cloud.automl.v1.TextSegment + * @instance + * @returns {Object.} JSON object + */ + TextSegment.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for TextSegment + * @function getTypeUrl + * @memberof google.cloud.automl.v1.TextSegment + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TextSegment.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.automl.v1.TextSegment"; + }; + + return TextSegment; + })(); + + v1.TextSentimentAnnotation = (function() { + + /** + * Properties of a TextSentimentAnnotation. + * @memberof google.cloud.automl.v1 + * @interface ITextSentimentAnnotation + * @property {number|null} [sentiment] TextSentimentAnnotation sentiment + */ + + /** + * Constructs a new TextSentimentAnnotation. + * @memberof google.cloud.automl.v1 + * @classdesc Represents a TextSentimentAnnotation. + * @implements ITextSentimentAnnotation + * @constructor + * @param {google.cloud.automl.v1.ITextSentimentAnnotation=} [properties] Properties to set + */ + function TextSentimentAnnotation(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * TextSentimentAnnotation sentiment. + * @member {number} sentiment + * @memberof google.cloud.automl.v1.TextSentimentAnnotation + * @instance + */ + TextSentimentAnnotation.prototype.sentiment = 0; + + /** + * Creates a new TextSentimentAnnotation instance using the specified properties. + * @function create + * @memberof google.cloud.automl.v1.TextSentimentAnnotation + * @static + * @param {google.cloud.automl.v1.ITextSentimentAnnotation=} [properties] Properties to set + * @returns {google.cloud.automl.v1.TextSentimentAnnotation} TextSentimentAnnotation instance + */ + TextSentimentAnnotation.create = function create(properties) { + return new TextSentimentAnnotation(properties); + }; + + /** + * Encodes the specified TextSentimentAnnotation message. Does not implicitly {@link google.cloud.automl.v1.TextSentimentAnnotation.verify|verify} messages. + * @function encode + * @memberof google.cloud.automl.v1.TextSentimentAnnotation + * @static + * @param {google.cloud.automl.v1.ITextSentimentAnnotation} message TextSentimentAnnotation message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TextSentimentAnnotation.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.sentiment != null && Object.hasOwnProperty.call(message, "sentiment")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.sentiment); + return writer; + }; + + /** + * Encodes the specified TextSentimentAnnotation message, length delimited. Does not implicitly {@link google.cloud.automl.v1.TextSentimentAnnotation.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.automl.v1.TextSentimentAnnotation + * @static + * @param {google.cloud.automl.v1.ITextSentimentAnnotation} message TextSentimentAnnotation message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TextSentimentAnnotation.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a TextSentimentAnnotation message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.automl.v1.TextSentimentAnnotation + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.automl.v1.TextSentimentAnnotation} TextSentimentAnnotation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TextSentimentAnnotation.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.automl.v1.TextSentimentAnnotation(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.sentiment = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a TextSentimentAnnotation message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.automl.v1.TextSentimentAnnotation + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.automl.v1.TextSentimentAnnotation} TextSentimentAnnotation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TextSentimentAnnotation.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a TextSentimentAnnotation message. + * @function verify + * @memberof google.cloud.automl.v1.TextSentimentAnnotation + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + TextSentimentAnnotation.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.sentiment != null && message.hasOwnProperty("sentiment")) + if (!$util.isInteger(message.sentiment)) + return "sentiment: integer expected"; + return null; + }; + + /** + * Creates a TextSentimentAnnotation message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.automl.v1.TextSentimentAnnotation + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.automl.v1.TextSentimentAnnotation} TextSentimentAnnotation + */ + TextSentimentAnnotation.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.automl.v1.TextSentimentAnnotation) + return object; + var message = new $root.google.cloud.automl.v1.TextSentimentAnnotation(); + if (object.sentiment != null) + message.sentiment = object.sentiment | 0; + return message; + }; + + /** + * Creates a plain object from a TextSentimentAnnotation message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.automl.v1.TextSentimentAnnotation + * @static + * @param {google.cloud.automl.v1.TextSentimentAnnotation} message TextSentimentAnnotation + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + TextSentimentAnnotation.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.sentiment = 0; + if (message.sentiment != null && message.hasOwnProperty("sentiment")) + object.sentiment = message.sentiment; + return object; + }; + + /** + * Converts this TextSentimentAnnotation to JSON. + * @function toJSON + * @memberof google.cloud.automl.v1.TextSentimentAnnotation + * @instance + * @returns {Object.} JSON object + */ + TextSentimentAnnotation.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for TextSentimentAnnotation + * @function getTypeUrl + * @memberof google.cloud.automl.v1.TextSentimentAnnotation + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TextSentimentAnnotation.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.automl.v1.TextSentimentAnnotation"; + }; + + return TextSentimentAnnotation; + })(); + + v1.TextSentimentEvaluationMetrics = (function() { + + /** + * Properties of a TextSentimentEvaluationMetrics. + * @memberof google.cloud.automl.v1 + * @interface ITextSentimentEvaluationMetrics + * @property {number|null} [precision] TextSentimentEvaluationMetrics precision + * @property {number|null} [recall] TextSentimentEvaluationMetrics recall + * @property {number|null} [f1Score] TextSentimentEvaluationMetrics f1Score + * @property {number|null} [meanAbsoluteError] TextSentimentEvaluationMetrics meanAbsoluteError + * @property {number|null} [meanSquaredError] TextSentimentEvaluationMetrics meanSquaredError + * @property {number|null} [linearKappa] TextSentimentEvaluationMetrics linearKappa + * @property {number|null} [quadraticKappa] TextSentimentEvaluationMetrics quadraticKappa + * @property {google.cloud.automl.v1.ClassificationEvaluationMetrics.IConfusionMatrix|null} [confusionMatrix] TextSentimentEvaluationMetrics confusionMatrix + */ + + /** + * Constructs a new TextSentimentEvaluationMetrics. + * @memberof google.cloud.automl.v1 + * @classdesc Represents a TextSentimentEvaluationMetrics. + * @implements ITextSentimentEvaluationMetrics + * @constructor + * @param {google.cloud.automl.v1.ITextSentimentEvaluationMetrics=} [properties] Properties to set + */ + function TextSentimentEvaluationMetrics(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * TextSentimentEvaluationMetrics precision. + * @member {number} precision + * @memberof google.cloud.automl.v1.TextSentimentEvaluationMetrics + * @instance + */ + TextSentimentEvaluationMetrics.prototype.precision = 0; + + /** + * TextSentimentEvaluationMetrics recall. + * @member {number} recall + * @memberof google.cloud.automl.v1.TextSentimentEvaluationMetrics + * @instance + */ + TextSentimentEvaluationMetrics.prototype.recall = 0; + + /** + * TextSentimentEvaluationMetrics f1Score. + * @member {number} f1Score + * @memberof google.cloud.automl.v1.TextSentimentEvaluationMetrics + * @instance + */ + TextSentimentEvaluationMetrics.prototype.f1Score = 0; + + /** + * TextSentimentEvaluationMetrics meanAbsoluteError. + * @member {number} meanAbsoluteError + * @memberof google.cloud.automl.v1.TextSentimentEvaluationMetrics + * @instance + */ + TextSentimentEvaluationMetrics.prototype.meanAbsoluteError = 0; + + /** + * TextSentimentEvaluationMetrics meanSquaredError. + * @member {number} meanSquaredError + * @memberof google.cloud.automl.v1.TextSentimentEvaluationMetrics + * @instance + */ + TextSentimentEvaluationMetrics.prototype.meanSquaredError = 0; + + /** + * TextSentimentEvaluationMetrics linearKappa. + * @member {number} linearKappa + * @memberof google.cloud.automl.v1.TextSentimentEvaluationMetrics + * @instance + */ + TextSentimentEvaluationMetrics.prototype.linearKappa = 0; + + /** + * TextSentimentEvaluationMetrics quadraticKappa. + * @member {number} quadraticKappa + * @memberof google.cloud.automl.v1.TextSentimentEvaluationMetrics + * @instance + */ + TextSentimentEvaluationMetrics.prototype.quadraticKappa = 0; + + /** + * TextSentimentEvaluationMetrics confusionMatrix. + * @member {google.cloud.automl.v1.ClassificationEvaluationMetrics.IConfusionMatrix|null|undefined} confusionMatrix + * @memberof google.cloud.automl.v1.TextSentimentEvaluationMetrics + * @instance + */ + TextSentimentEvaluationMetrics.prototype.confusionMatrix = null; + + /** + * Creates a new TextSentimentEvaluationMetrics instance using the specified properties. + * @function create + * @memberof google.cloud.automl.v1.TextSentimentEvaluationMetrics + * @static + * @param {google.cloud.automl.v1.ITextSentimentEvaluationMetrics=} [properties] Properties to set + * @returns {google.cloud.automl.v1.TextSentimentEvaluationMetrics} TextSentimentEvaluationMetrics instance + */ + TextSentimentEvaluationMetrics.create = function create(properties) { + return new TextSentimentEvaluationMetrics(properties); + }; + + /** + * Encodes the specified TextSentimentEvaluationMetrics message. Does not implicitly {@link google.cloud.automl.v1.TextSentimentEvaluationMetrics.verify|verify} messages. + * @function encode + * @memberof google.cloud.automl.v1.TextSentimentEvaluationMetrics + * @static + * @param {google.cloud.automl.v1.ITextSentimentEvaluationMetrics} message TextSentimentEvaluationMetrics message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TextSentimentEvaluationMetrics.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.precision != null && Object.hasOwnProperty.call(message, "precision")) + writer.uint32(/* id 1, wireType 5 =*/13).float(message.precision); + if (message.recall != null && Object.hasOwnProperty.call(message, "recall")) + writer.uint32(/* id 2, wireType 5 =*/21).float(message.recall); + if (message.f1Score != null && Object.hasOwnProperty.call(message, "f1Score")) + writer.uint32(/* id 3, wireType 5 =*/29).float(message.f1Score); + if (message.meanAbsoluteError != null && Object.hasOwnProperty.call(message, "meanAbsoluteError")) + writer.uint32(/* id 4, wireType 5 =*/37).float(message.meanAbsoluteError); + if (message.meanSquaredError != null && Object.hasOwnProperty.call(message, "meanSquaredError")) + writer.uint32(/* id 5, wireType 5 =*/45).float(message.meanSquaredError); + if (message.linearKappa != null && Object.hasOwnProperty.call(message, "linearKappa")) + writer.uint32(/* id 6, wireType 5 =*/53).float(message.linearKappa); + if (message.quadraticKappa != null && Object.hasOwnProperty.call(message, "quadraticKappa")) + writer.uint32(/* id 7, wireType 5 =*/61).float(message.quadraticKappa); + if (message.confusionMatrix != null && Object.hasOwnProperty.call(message, "confusionMatrix")) + $root.google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfusionMatrix.encode(message.confusionMatrix, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified TextSentimentEvaluationMetrics message, length delimited. Does not implicitly {@link google.cloud.automl.v1.TextSentimentEvaluationMetrics.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.automl.v1.TextSentimentEvaluationMetrics + * @static + * @param {google.cloud.automl.v1.ITextSentimentEvaluationMetrics} message TextSentimentEvaluationMetrics message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TextSentimentEvaluationMetrics.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a TextSentimentEvaluationMetrics message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.automl.v1.TextSentimentEvaluationMetrics + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.automl.v1.TextSentimentEvaluationMetrics} TextSentimentEvaluationMetrics + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TextSentimentEvaluationMetrics.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.automl.v1.TextSentimentEvaluationMetrics(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.precision = reader.float(); + break; + } + case 2: { + message.recall = reader.float(); + break; + } + case 3: { + message.f1Score = reader.float(); + break; + } + case 4: { + message.meanAbsoluteError = reader.float(); + break; + } + case 5: { + message.meanSquaredError = reader.float(); + break; + } + case 6: { + message.linearKappa = reader.float(); + break; + } + case 7: { + message.quadraticKappa = reader.float(); + break; + } + case 8: { + message.confusionMatrix = $root.google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfusionMatrix.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a TextSentimentEvaluationMetrics message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.automl.v1.TextSentimentEvaluationMetrics + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.automl.v1.TextSentimentEvaluationMetrics} TextSentimentEvaluationMetrics + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TextSentimentEvaluationMetrics.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a TextSentimentEvaluationMetrics message. + * @function verify + * @memberof google.cloud.automl.v1.TextSentimentEvaluationMetrics + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + TextSentimentEvaluationMetrics.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.precision != null && message.hasOwnProperty("precision")) + if (typeof message.precision !== "number") + return "precision: number expected"; + if (message.recall != null && message.hasOwnProperty("recall")) + if (typeof message.recall !== "number") + return "recall: number expected"; + if (message.f1Score != null && message.hasOwnProperty("f1Score")) + if (typeof message.f1Score !== "number") + return "f1Score: number expected"; + if (message.meanAbsoluteError != null && message.hasOwnProperty("meanAbsoluteError")) + if (typeof message.meanAbsoluteError !== "number") + return "meanAbsoluteError: number expected"; + if (message.meanSquaredError != null && message.hasOwnProperty("meanSquaredError")) + if (typeof message.meanSquaredError !== "number") + return "meanSquaredError: number expected"; + if (message.linearKappa != null && message.hasOwnProperty("linearKappa")) + if (typeof message.linearKappa !== "number") + return "linearKappa: number expected"; + if (message.quadraticKappa != null && message.hasOwnProperty("quadraticKappa")) + if (typeof message.quadraticKappa !== "number") + return "quadraticKappa: number expected"; + if (message.confusionMatrix != null && message.hasOwnProperty("confusionMatrix")) { + var error = $root.google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfusionMatrix.verify(message.confusionMatrix); + if (error) + return "confusionMatrix." + error; + } + return null; + }; + + /** + * Creates a TextSentimentEvaluationMetrics message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.automl.v1.TextSentimentEvaluationMetrics + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.automl.v1.TextSentimentEvaluationMetrics} TextSentimentEvaluationMetrics + */ + TextSentimentEvaluationMetrics.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.automl.v1.TextSentimentEvaluationMetrics) + return object; + var message = new $root.google.cloud.automl.v1.TextSentimentEvaluationMetrics(); + if (object.precision != null) + message.precision = Number(object.precision); + if (object.recall != null) + message.recall = Number(object.recall); + if (object.f1Score != null) + message.f1Score = Number(object.f1Score); + if (object.meanAbsoluteError != null) + message.meanAbsoluteError = Number(object.meanAbsoluteError); + if (object.meanSquaredError != null) + message.meanSquaredError = Number(object.meanSquaredError); + if (object.linearKappa != null) + message.linearKappa = Number(object.linearKappa); + if (object.quadraticKappa != null) + message.quadraticKappa = Number(object.quadraticKappa); + if (object.confusionMatrix != null) { + if (typeof object.confusionMatrix !== "object") + throw TypeError(".google.cloud.automl.v1.TextSentimentEvaluationMetrics.confusionMatrix: object expected"); + message.confusionMatrix = $root.google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfusionMatrix.fromObject(object.confusionMatrix); + } + return message; + }; + + /** + * Creates a plain object from a TextSentimentEvaluationMetrics message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.automl.v1.TextSentimentEvaluationMetrics + * @static + * @param {google.cloud.automl.v1.TextSentimentEvaluationMetrics} message TextSentimentEvaluationMetrics + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + TextSentimentEvaluationMetrics.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.precision = 0; + object.recall = 0; + object.f1Score = 0; + object.meanAbsoluteError = 0; + object.meanSquaredError = 0; + object.linearKappa = 0; + object.quadraticKappa = 0; + object.confusionMatrix = null; + } + if (message.precision != null && message.hasOwnProperty("precision")) + object.precision = options.json && !isFinite(message.precision) ? String(message.precision) : message.precision; + if (message.recall != null && message.hasOwnProperty("recall")) + object.recall = options.json && !isFinite(message.recall) ? String(message.recall) : message.recall; + if (message.f1Score != null && message.hasOwnProperty("f1Score")) + object.f1Score = options.json && !isFinite(message.f1Score) ? String(message.f1Score) : message.f1Score; + if (message.meanAbsoluteError != null && message.hasOwnProperty("meanAbsoluteError")) + object.meanAbsoluteError = options.json && !isFinite(message.meanAbsoluteError) ? String(message.meanAbsoluteError) : message.meanAbsoluteError; + if (message.meanSquaredError != null && message.hasOwnProperty("meanSquaredError")) + object.meanSquaredError = options.json && !isFinite(message.meanSquaredError) ? String(message.meanSquaredError) : message.meanSquaredError; + if (message.linearKappa != null && message.hasOwnProperty("linearKappa")) + object.linearKappa = options.json && !isFinite(message.linearKappa) ? String(message.linearKappa) : message.linearKappa; + if (message.quadraticKappa != null && message.hasOwnProperty("quadraticKappa")) + object.quadraticKappa = options.json && !isFinite(message.quadraticKappa) ? String(message.quadraticKappa) : message.quadraticKappa; + if (message.confusionMatrix != null && message.hasOwnProperty("confusionMatrix")) + object.confusionMatrix = $root.google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfusionMatrix.toObject(message.confusionMatrix, options); + return object; + }; + + /** + * Converts this TextSentimentEvaluationMetrics to JSON. + * @function toJSON + * @memberof google.cloud.automl.v1.TextSentimentEvaluationMetrics + * @instance + * @returns {Object.} JSON object + */ + TextSentimentEvaluationMetrics.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for TextSentimentEvaluationMetrics + * @function getTypeUrl + * @memberof google.cloud.automl.v1.TextSentimentEvaluationMetrics + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TextSentimentEvaluationMetrics.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.automl.v1.TextSentimentEvaluationMetrics"; + }; + + return TextSentimentEvaluationMetrics; + })(); + + v1.TranslationDatasetMetadata = (function() { + + /** + * Properties of a TranslationDatasetMetadata. + * @memberof google.cloud.automl.v1 + * @interface ITranslationDatasetMetadata + * @property {string|null} [sourceLanguageCode] TranslationDatasetMetadata sourceLanguageCode + * @property {string|null} [targetLanguageCode] TranslationDatasetMetadata targetLanguageCode + */ + + /** + * Constructs a new TranslationDatasetMetadata. + * @memberof google.cloud.automl.v1 + * @classdesc Represents a TranslationDatasetMetadata. + * @implements ITranslationDatasetMetadata + * @constructor + * @param {google.cloud.automl.v1.ITranslationDatasetMetadata=} [properties] Properties to set + */ + function TranslationDatasetMetadata(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * TranslationDatasetMetadata sourceLanguageCode. + * @member {string} sourceLanguageCode + * @memberof google.cloud.automl.v1.TranslationDatasetMetadata + * @instance + */ + TranslationDatasetMetadata.prototype.sourceLanguageCode = ""; + + /** + * TranslationDatasetMetadata targetLanguageCode. + * @member {string} targetLanguageCode + * @memberof google.cloud.automl.v1.TranslationDatasetMetadata + * @instance + */ + TranslationDatasetMetadata.prototype.targetLanguageCode = ""; + + /** + * Creates a new TranslationDatasetMetadata instance using the specified properties. + * @function create + * @memberof google.cloud.automl.v1.TranslationDatasetMetadata + * @static + * @param {google.cloud.automl.v1.ITranslationDatasetMetadata=} [properties] Properties to set + * @returns {google.cloud.automl.v1.TranslationDatasetMetadata} TranslationDatasetMetadata instance + */ + TranslationDatasetMetadata.create = function create(properties) { + return new TranslationDatasetMetadata(properties); + }; + + /** + * Encodes the specified TranslationDatasetMetadata message. Does not implicitly {@link google.cloud.automl.v1.TranslationDatasetMetadata.verify|verify} messages. + * @function encode + * @memberof google.cloud.automl.v1.TranslationDatasetMetadata + * @static + * @param {google.cloud.automl.v1.ITranslationDatasetMetadata} message TranslationDatasetMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TranslationDatasetMetadata.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.sourceLanguageCode != null && Object.hasOwnProperty.call(message, "sourceLanguageCode")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.sourceLanguageCode); + if (message.targetLanguageCode != null && Object.hasOwnProperty.call(message, "targetLanguageCode")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.targetLanguageCode); + return writer; + }; + + /** + * Encodes the specified TranslationDatasetMetadata message, length delimited. Does not implicitly {@link google.cloud.automl.v1.TranslationDatasetMetadata.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.automl.v1.TranslationDatasetMetadata + * @static + * @param {google.cloud.automl.v1.ITranslationDatasetMetadata} message TranslationDatasetMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TranslationDatasetMetadata.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a TranslationDatasetMetadata message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.automl.v1.TranslationDatasetMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.automl.v1.TranslationDatasetMetadata} TranslationDatasetMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TranslationDatasetMetadata.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.automl.v1.TranslationDatasetMetadata(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.sourceLanguageCode = reader.string(); + break; + } + case 2: { + message.targetLanguageCode = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a TranslationDatasetMetadata message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.automl.v1.TranslationDatasetMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.automl.v1.TranslationDatasetMetadata} TranslationDatasetMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TranslationDatasetMetadata.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a TranslationDatasetMetadata message. + * @function verify + * @memberof google.cloud.automl.v1.TranslationDatasetMetadata + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + TranslationDatasetMetadata.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.sourceLanguageCode != null && message.hasOwnProperty("sourceLanguageCode")) + if (!$util.isString(message.sourceLanguageCode)) + return "sourceLanguageCode: string expected"; + if (message.targetLanguageCode != null && message.hasOwnProperty("targetLanguageCode")) + if (!$util.isString(message.targetLanguageCode)) + return "targetLanguageCode: string expected"; + return null; + }; + + /** + * Creates a TranslationDatasetMetadata message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.automl.v1.TranslationDatasetMetadata + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.automl.v1.TranslationDatasetMetadata} TranslationDatasetMetadata + */ + TranslationDatasetMetadata.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.automl.v1.TranslationDatasetMetadata) + return object; + var message = new $root.google.cloud.automl.v1.TranslationDatasetMetadata(); + if (object.sourceLanguageCode != null) + message.sourceLanguageCode = String(object.sourceLanguageCode); + if (object.targetLanguageCode != null) + message.targetLanguageCode = String(object.targetLanguageCode); + return message; + }; + + /** + * Creates a plain object from a TranslationDatasetMetadata message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.automl.v1.TranslationDatasetMetadata + * @static + * @param {google.cloud.automl.v1.TranslationDatasetMetadata} message TranslationDatasetMetadata + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + TranslationDatasetMetadata.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.sourceLanguageCode = ""; + object.targetLanguageCode = ""; + } + if (message.sourceLanguageCode != null && message.hasOwnProperty("sourceLanguageCode")) + object.sourceLanguageCode = message.sourceLanguageCode; + if (message.targetLanguageCode != null && message.hasOwnProperty("targetLanguageCode")) + object.targetLanguageCode = message.targetLanguageCode; + return object; + }; + + /** + * Converts this TranslationDatasetMetadata to JSON. + * @function toJSON + * @memberof google.cloud.automl.v1.TranslationDatasetMetadata + * @instance + * @returns {Object.} JSON object + */ + TranslationDatasetMetadata.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for TranslationDatasetMetadata + * @function getTypeUrl + * @memberof google.cloud.automl.v1.TranslationDatasetMetadata + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TranslationDatasetMetadata.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.automl.v1.TranslationDatasetMetadata"; + }; + + return TranslationDatasetMetadata; + })(); + + v1.TranslationEvaluationMetrics = (function() { + + /** + * Properties of a TranslationEvaluationMetrics. + * @memberof google.cloud.automl.v1 + * @interface ITranslationEvaluationMetrics + * @property {number|null} [bleuScore] TranslationEvaluationMetrics bleuScore + * @property {number|null} [baseBleuScore] TranslationEvaluationMetrics baseBleuScore + */ + + /** + * Constructs a new TranslationEvaluationMetrics. + * @memberof google.cloud.automl.v1 + * @classdesc Represents a TranslationEvaluationMetrics. + * @implements ITranslationEvaluationMetrics + * @constructor + * @param {google.cloud.automl.v1.ITranslationEvaluationMetrics=} [properties] Properties to set + */ + function TranslationEvaluationMetrics(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * TranslationEvaluationMetrics bleuScore. + * @member {number} bleuScore + * @memberof google.cloud.automl.v1.TranslationEvaluationMetrics + * @instance + */ + TranslationEvaluationMetrics.prototype.bleuScore = 0; + + /** + * TranslationEvaluationMetrics baseBleuScore. + * @member {number} baseBleuScore + * @memberof google.cloud.automl.v1.TranslationEvaluationMetrics + * @instance + */ + TranslationEvaluationMetrics.prototype.baseBleuScore = 0; + + /** + * Creates a new TranslationEvaluationMetrics instance using the specified properties. + * @function create + * @memberof google.cloud.automl.v1.TranslationEvaluationMetrics + * @static + * @param {google.cloud.automl.v1.ITranslationEvaluationMetrics=} [properties] Properties to set + * @returns {google.cloud.automl.v1.TranslationEvaluationMetrics} TranslationEvaluationMetrics instance + */ + TranslationEvaluationMetrics.create = function create(properties) { + return new TranslationEvaluationMetrics(properties); + }; + + /** + * Encodes the specified TranslationEvaluationMetrics message. Does not implicitly {@link google.cloud.automl.v1.TranslationEvaluationMetrics.verify|verify} messages. + * @function encode + * @memberof google.cloud.automl.v1.TranslationEvaluationMetrics + * @static + * @param {google.cloud.automl.v1.ITranslationEvaluationMetrics} message TranslationEvaluationMetrics message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TranslationEvaluationMetrics.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.bleuScore != null && Object.hasOwnProperty.call(message, "bleuScore")) + writer.uint32(/* id 1, wireType 1 =*/9).double(message.bleuScore); + if (message.baseBleuScore != null && Object.hasOwnProperty.call(message, "baseBleuScore")) + writer.uint32(/* id 2, wireType 1 =*/17).double(message.baseBleuScore); + return writer; + }; + + /** + * Encodes the specified TranslationEvaluationMetrics message, length delimited. Does not implicitly {@link google.cloud.automl.v1.TranslationEvaluationMetrics.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.automl.v1.TranslationEvaluationMetrics + * @static + * @param {google.cloud.automl.v1.ITranslationEvaluationMetrics} message TranslationEvaluationMetrics message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TranslationEvaluationMetrics.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a TranslationEvaluationMetrics message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.automl.v1.TranslationEvaluationMetrics + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.automl.v1.TranslationEvaluationMetrics} TranslationEvaluationMetrics + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TranslationEvaluationMetrics.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.automl.v1.TranslationEvaluationMetrics(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.bleuScore = reader.double(); + break; + } + case 2: { + message.baseBleuScore = reader.double(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a TranslationEvaluationMetrics message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.automl.v1.TranslationEvaluationMetrics + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.automl.v1.TranslationEvaluationMetrics} TranslationEvaluationMetrics + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TranslationEvaluationMetrics.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a TranslationEvaluationMetrics message. + * @function verify + * @memberof google.cloud.automl.v1.TranslationEvaluationMetrics + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + TranslationEvaluationMetrics.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.bleuScore != null && message.hasOwnProperty("bleuScore")) + if (typeof message.bleuScore !== "number") + return "bleuScore: number expected"; + if (message.baseBleuScore != null && message.hasOwnProperty("baseBleuScore")) + if (typeof message.baseBleuScore !== "number") + return "baseBleuScore: number expected"; + return null; + }; + + /** + * Creates a TranslationEvaluationMetrics message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.automl.v1.TranslationEvaluationMetrics + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.automl.v1.TranslationEvaluationMetrics} TranslationEvaluationMetrics + */ + TranslationEvaluationMetrics.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.automl.v1.TranslationEvaluationMetrics) + return object; + var message = new $root.google.cloud.automl.v1.TranslationEvaluationMetrics(); + if (object.bleuScore != null) + message.bleuScore = Number(object.bleuScore); + if (object.baseBleuScore != null) + message.baseBleuScore = Number(object.baseBleuScore); + return message; + }; + + /** + * Creates a plain object from a TranslationEvaluationMetrics message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.automl.v1.TranslationEvaluationMetrics + * @static + * @param {google.cloud.automl.v1.TranslationEvaluationMetrics} message TranslationEvaluationMetrics + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + TranslationEvaluationMetrics.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.bleuScore = 0; + object.baseBleuScore = 0; + } + if (message.bleuScore != null && message.hasOwnProperty("bleuScore")) + object.bleuScore = options.json && !isFinite(message.bleuScore) ? String(message.bleuScore) : message.bleuScore; + if (message.baseBleuScore != null && message.hasOwnProperty("baseBleuScore")) + object.baseBleuScore = options.json && !isFinite(message.baseBleuScore) ? String(message.baseBleuScore) : message.baseBleuScore; + return object; + }; + + /** + * Converts this TranslationEvaluationMetrics to JSON. + * @function toJSON + * @memberof google.cloud.automl.v1.TranslationEvaluationMetrics + * @instance + * @returns {Object.} JSON object + */ + TranslationEvaluationMetrics.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for TranslationEvaluationMetrics + * @function getTypeUrl + * @memberof google.cloud.automl.v1.TranslationEvaluationMetrics + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TranslationEvaluationMetrics.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.automl.v1.TranslationEvaluationMetrics"; + }; + + return TranslationEvaluationMetrics; + })(); + + v1.TranslationModelMetadata = (function() { + + /** + * Properties of a TranslationModelMetadata. + * @memberof google.cloud.automl.v1 + * @interface ITranslationModelMetadata + * @property {string|null} [baseModel] TranslationModelMetadata baseModel + * @property {string|null} [sourceLanguageCode] TranslationModelMetadata sourceLanguageCode + * @property {string|null} [targetLanguageCode] TranslationModelMetadata targetLanguageCode + */ + + /** + * Constructs a new TranslationModelMetadata. + * @memberof google.cloud.automl.v1 + * @classdesc Represents a TranslationModelMetadata. + * @implements ITranslationModelMetadata + * @constructor + * @param {google.cloud.automl.v1.ITranslationModelMetadata=} [properties] Properties to set + */ + function TranslationModelMetadata(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * TranslationModelMetadata baseModel. + * @member {string} baseModel + * @memberof google.cloud.automl.v1.TranslationModelMetadata + * @instance + */ + TranslationModelMetadata.prototype.baseModel = ""; + + /** + * TranslationModelMetadata sourceLanguageCode. + * @member {string} sourceLanguageCode + * @memberof google.cloud.automl.v1.TranslationModelMetadata + * @instance + */ + TranslationModelMetadata.prototype.sourceLanguageCode = ""; + + /** + * TranslationModelMetadata targetLanguageCode. + * @member {string} targetLanguageCode + * @memberof google.cloud.automl.v1.TranslationModelMetadata + * @instance + */ + TranslationModelMetadata.prototype.targetLanguageCode = ""; + + /** + * Creates a new TranslationModelMetadata instance using the specified properties. + * @function create + * @memberof google.cloud.automl.v1.TranslationModelMetadata + * @static + * @param {google.cloud.automl.v1.ITranslationModelMetadata=} [properties] Properties to set + * @returns {google.cloud.automl.v1.TranslationModelMetadata} TranslationModelMetadata instance + */ + TranslationModelMetadata.create = function create(properties) { + return new TranslationModelMetadata(properties); + }; + + /** + * Encodes the specified TranslationModelMetadata message. Does not implicitly {@link google.cloud.automl.v1.TranslationModelMetadata.verify|verify} messages. + * @function encode + * @memberof google.cloud.automl.v1.TranslationModelMetadata + * @static + * @param {google.cloud.automl.v1.ITranslationModelMetadata} message TranslationModelMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TranslationModelMetadata.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.baseModel != null && Object.hasOwnProperty.call(message, "baseModel")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.baseModel); + if (message.sourceLanguageCode != null && Object.hasOwnProperty.call(message, "sourceLanguageCode")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.sourceLanguageCode); + if (message.targetLanguageCode != null && Object.hasOwnProperty.call(message, "targetLanguageCode")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.targetLanguageCode); + return writer; + }; + + /** + * Encodes the specified TranslationModelMetadata message, length delimited. Does not implicitly {@link google.cloud.automl.v1.TranslationModelMetadata.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.automl.v1.TranslationModelMetadata + * @static + * @param {google.cloud.automl.v1.ITranslationModelMetadata} message TranslationModelMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TranslationModelMetadata.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a TranslationModelMetadata message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.automl.v1.TranslationModelMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.automl.v1.TranslationModelMetadata} TranslationModelMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TranslationModelMetadata.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.automl.v1.TranslationModelMetadata(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.baseModel = reader.string(); + break; + } + case 2: { + message.sourceLanguageCode = reader.string(); + break; + } + case 3: { + message.targetLanguageCode = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a TranslationModelMetadata message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.automl.v1.TranslationModelMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.automl.v1.TranslationModelMetadata} TranslationModelMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TranslationModelMetadata.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a TranslationModelMetadata message. + * @function verify + * @memberof google.cloud.automl.v1.TranslationModelMetadata + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + TranslationModelMetadata.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.baseModel != null && message.hasOwnProperty("baseModel")) + if (!$util.isString(message.baseModel)) + return "baseModel: string expected"; + if (message.sourceLanguageCode != null && message.hasOwnProperty("sourceLanguageCode")) + if (!$util.isString(message.sourceLanguageCode)) + return "sourceLanguageCode: string expected"; + if (message.targetLanguageCode != null && message.hasOwnProperty("targetLanguageCode")) + if (!$util.isString(message.targetLanguageCode)) + return "targetLanguageCode: string expected"; + return null; + }; + + /** + * Creates a TranslationModelMetadata message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.automl.v1.TranslationModelMetadata + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.automl.v1.TranslationModelMetadata} TranslationModelMetadata + */ + TranslationModelMetadata.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.automl.v1.TranslationModelMetadata) + return object; + var message = new $root.google.cloud.automl.v1.TranslationModelMetadata(); + if (object.baseModel != null) + message.baseModel = String(object.baseModel); + if (object.sourceLanguageCode != null) + message.sourceLanguageCode = String(object.sourceLanguageCode); + if (object.targetLanguageCode != null) + message.targetLanguageCode = String(object.targetLanguageCode); + return message; + }; + + /** + * Creates a plain object from a TranslationModelMetadata message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.automl.v1.TranslationModelMetadata + * @static + * @param {google.cloud.automl.v1.TranslationModelMetadata} message TranslationModelMetadata + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + TranslationModelMetadata.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.baseModel = ""; + object.sourceLanguageCode = ""; + object.targetLanguageCode = ""; + } + if (message.baseModel != null && message.hasOwnProperty("baseModel")) + object.baseModel = message.baseModel; + if (message.sourceLanguageCode != null && message.hasOwnProperty("sourceLanguageCode")) + object.sourceLanguageCode = message.sourceLanguageCode; + if (message.targetLanguageCode != null && message.hasOwnProperty("targetLanguageCode")) + object.targetLanguageCode = message.targetLanguageCode; + return object; + }; + + /** + * Converts this TranslationModelMetadata to JSON. + * @function toJSON + * @memberof google.cloud.automl.v1.TranslationModelMetadata + * @instance + * @returns {Object.} JSON object + */ + TranslationModelMetadata.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for TranslationModelMetadata + * @function getTypeUrl + * @memberof google.cloud.automl.v1.TranslationModelMetadata + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TranslationModelMetadata.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.automl.v1.TranslationModelMetadata"; + }; + + return TranslationModelMetadata; + })(); + + v1.TranslationAnnotation = (function() { + + /** + * Properties of a TranslationAnnotation. + * @memberof google.cloud.automl.v1 + * @interface ITranslationAnnotation + * @property {google.cloud.automl.v1.ITextSnippet|null} [translatedContent] TranslationAnnotation translatedContent + */ + + /** + * Constructs a new TranslationAnnotation. + * @memberof google.cloud.automl.v1 + * @classdesc Represents a TranslationAnnotation. + * @implements ITranslationAnnotation + * @constructor + * @param {google.cloud.automl.v1.ITranslationAnnotation=} [properties] Properties to set + */ + function TranslationAnnotation(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * TranslationAnnotation translatedContent. + * @member {google.cloud.automl.v1.ITextSnippet|null|undefined} translatedContent + * @memberof google.cloud.automl.v1.TranslationAnnotation + * @instance + */ + TranslationAnnotation.prototype.translatedContent = null; + + /** + * Creates a new TranslationAnnotation instance using the specified properties. + * @function create + * @memberof google.cloud.automl.v1.TranslationAnnotation + * @static + * @param {google.cloud.automl.v1.ITranslationAnnotation=} [properties] Properties to set + * @returns {google.cloud.automl.v1.TranslationAnnotation} TranslationAnnotation instance + */ + TranslationAnnotation.create = function create(properties) { + return new TranslationAnnotation(properties); + }; + + /** + * Encodes the specified TranslationAnnotation message. Does not implicitly {@link google.cloud.automl.v1.TranslationAnnotation.verify|verify} messages. + * @function encode + * @memberof google.cloud.automl.v1.TranslationAnnotation + * @static + * @param {google.cloud.automl.v1.ITranslationAnnotation} message TranslationAnnotation message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TranslationAnnotation.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.translatedContent != null && Object.hasOwnProperty.call(message, "translatedContent")) + $root.google.cloud.automl.v1.TextSnippet.encode(message.translatedContent, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified TranslationAnnotation message, length delimited. Does not implicitly {@link google.cloud.automl.v1.TranslationAnnotation.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.automl.v1.TranslationAnnotation + * @static + * @param {google.cloud.automl.v1.ITranslationAnnotation} message TranslationAnnotation message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TranslationAnnotation.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a TranslationAnnotation message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.automl.v1.TranslationAnnotation + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.automl.v1.TranslationAnnotation} TranslationAnnotation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TranslationAnnotation.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.automl.v1.TranslationAnnotation(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.translatedContent = $root.google.cloud.automl.v1.TextSnippet.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a TranslationAnnotation message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.automl.v1.TranslationAnnotation + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.automl.v1.TranslationAnnotation} TranslationAnnotation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TranslationAnnotation.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a TranslationAnnotation message. + * @function verify + * @memberof google.cloud.automl.v1.TranslationAnnotation + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + TranslationAnnotation.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.translatedContent != null && message.hasOwnProperty("translatedContent")) { + var error = $root.google.cloud.automl.v1.TextSnippet.verify(message.translatedContent); + if (error) + return "translatedContent." + error; + } + return null; + }; + + /** + * Creates a TranslationAnnotation message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.automl.v1.TranslationAnnotation + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.automl.v1.TranslationAnnotation} TranslationAnnotation + */ + TranslationAnnotation.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.automl.v1.TranslationAnnotation) + return object; + var message = new $root.google.cloud.automl.v1.TranslationAnnotation(); + if (object.translatedContent != null) { + if (typeof object.translatedContent !== "object") + throw TypeError(".google.cloud.automl.v1.TranslationAnnotation.translatedContent: object expected"); + message.translatedContent = $root.google.cloud.automl.v1.TextSnippet.fromObject(object.translatedContent); + } + return message; + }; + + /** + * Creates a plain object from a TranslationAnnotation message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.automl.v1.TranslationAnnotation + * @static + * @param {google.cloud.automl.v1.TranslationAnnotation} message TranslationAnnotation + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + TranslationAnnotation.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.translatedContent = null; + if (message.translatedContent != null && message.hasOwnProperty("translatedContent")) + object.translatedContent = $root.google.cloud.automl.v1.TextSnippet.toObject(message.translatedContent, options); + return object; + }; + + /** + * Converts this TranslationAnnotation to JSON. + * @function toJSON + * @memberof google.cloud.automl.v1.TranslationAnnotation + * @instance + * @returns {Object.} JSON object + */ + TranslationAnnotation.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for TranslationAnnotation + * @function getTypeUrl + * @memberof google.cloud.automl.v1.TranslationAnnotation + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TranslationAnnotation.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.automl.v1.TranslationAnnotation"; + }; + + return TranslationAnnotation; + })(); + + v1.Image = (function() { + + /** + * Properties of an Image. + * @memberof google.cloud.automl.v1 + * @interface IImage + * @property {Uint8Array|null} [imageBytes] Image imageBytes + * @property {string|null} [thumbnailUri] Image thumbnailUri + */ + + /** + * Constructs a new Image. + * @memberof google.cloud.automl.v1 + * @classdesc Represents an Image. + * @implements IImage + * @constructor + * @param {google.cloud.automl.v1.IImage=} [properties] Properties to set + */ + function Image(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Image imageBytes. + * @member {Uint8Array|null|undefined} imageBytes + * @memberof google.cloud.automl.v1.Image + * @instance + */ + Image.prototype.imageBytes = null; + + /** + * Image thumbnailUri. + * @member {string} thumbnailUri + * @memberof google.cloud.automl.v1.Image + * @instance + */ + Image.prototype.thumbnailUri = ""; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * Image data. + * @member {"imageBytes"|undefined} data + * @memberof google.cloud.automl.v1.Image + * @instance + */ + Object.defineProperty(Image.prototype, "data", { + get: $util.oneOfGetter($oneOfFields = ["imageBytes"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new Image instance using the specified properties. + * @function create + * @memberof google.cloud.automl.v1.Image + * @static + * @param {google.cloud.automl.v1.IImage=} [properties] Properties to set + * @returns {google.cloud.automl.v1.Image} Image instance + */ + Image.create = function create(properties) { + return new Image(properties); + }; + + /** + * Encodes the specified Image message. Does not implicitly {@link google.cloud.automl.v1.Image.verify|verify} messages. + * @function encode + * @memberof google.cloud.automl.v1.Image + * @static + * @param {google.cloud.automl.v1.IImage} message Image message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Image.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.imageBytes != null && Object.hasOwnProperty.call(message, "imageBytes")) + writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.imageBytes); + if (message.thumbnailUri != null && Object.hasOwnProperty.call(message, "thumbnailUri")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.thumbnailUri); + return writer; + }; + + /** + * Encodes the specified Image message, length delimited. Does not implicitly {@link google.cloud.automl.v1.Image.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.automl.v1.Image + * @static + * @param {google.cloud.automl.v1.IImage} message Image message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Image.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an Image message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.automl.v1.Image + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.automl.v1.Image} Image + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Image.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.automl.v1.Image(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.imageBytes = reader.bytes(); + break; + } + case 4: { + message.thumbnailUri = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an Image message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.automl.v1.Image + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.automl.v1.Image} Image + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Image.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an Image message. + * @function verify + * @memberof google.cloud.automl.v1.Image + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Image.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.imageBytes != null && message.hasOwnProperty("imageBytes")) { + properties.data = 1; + if (!(message.imageBytes && typeof message.imageBytes.length === "number" || $util.isString(message.imageBytes))) + return "imageBytes: buffer expected"; + } + if (message.thumbnailUri != null && message.hasOwnProperty("thumbnailUri")) + if (!$util.isString(message.thumbnailUri)) + return "thumbnailUri: string expected"; + return null; + }; + + /** + * Creates an Image message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.automl.v1.Image + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.automl.v1.Image} Image + */ + Image.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.automl.v1.Image) + return object; + var message = new $root.google.cloud.automl.v1.Image(); + if (object.imageBytes != null) + if (typeof object.imageBytes === "string") + $util.base64.decode(object.imageBytes, message.imageBytes = $util.newBuffer($util.base64.length(object.imageBytes)), 0); + else if (object.imageBytes.length >= 0) + message.imageBytes = object.imageBytes; + if (object.thumbnailUri != null) + message.thumbnailUri = String(object.thumbnailUri); + return message; + }; + + /** + * Creates a plain object from an Image message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.automl.v1.Image + * @static + * @param {google.cloud.automl.v1.Image} message Image + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Image.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.thumbnailUri = ""; + if (message.imageBytes != null && message.hasOwnProperty("imageBytes")) { + object.imageBytes = options.bytes === String ? $util.base64.encode(message.imageBytes, 0, message.imageBytes.length) : options.bytes === Array ? Array.prototype.slice.call(message.imageBytes) : message.imageBytes; + if (options.oneofs) + object.data = "imageBytes"; + } + if (message.thumbnailUri != null && message.hasOwnProperty("thumbnailUri")) + object.thumbnailUri = message.thumbnailUri; + return object; + }; + + /** + * Converts this Image to JSON. + * @function toJSON + * @memberof google.cloud.automl.v1.Image + * @instance + * @returns {Object.} JSON object + */ + Image.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Image + * @function getTypeUrl + * @memberof google.cloud.automl.v1.Image + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Image.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.automl.v1.Image"; + }; + + return Image; + })(); + + v1.TextSnippet = (function() { + + /** + * Properties of a TextSnippet. + * @memberof google.cloud.automl.v1 + * @interface ITextSnippet + * @property {string|null} [content] TextSnippet content + * @property {string|null} [mimeType] TextSnippet mimeType + * @property {string|null} [contentUri] TextSnippet contentUri + */ + + /** + * Constructs a new TextSnippet. + * @memberof google.cloud.automl.v1 + * @classdesc Represents a TextSnippet. + * @implements ITextSnippet + * @constructor + * @param {google.cloud.automl.v1.ITextSnippet=} [properties] Properties to set + */ + function TextSnippet(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * TextSnippet content. + * @member {string} content + * @memberof google.cloud.automl.v1.TextSnippet + * @instance + */ + TextSnippet.prototype.content = ""; + + /** + * TextSnippet mimeType. + * @member {string} mimeType + * @memberof google.cloud.automl.v1.TextSnippet + * @instance + */ + TextSnippet.prototype.mimeType = ""; + + /** + * TextSnippet contentUri. + * @member {string} contentUri + * @memberof google.cloud.automl.v1.TextSnippet + * @instance + */ + TextSnippet.prototype.contentUri = ""; + + /** + * Creates a new TextSnippet instance using the specified properties. + * @function create + * @memberof google.cloud.automl.v1.TextSnippet + * @static + * @param {google.cloud.automl.v1.ITextSnippet=} [properties] Properties to set + * @returns {google.cloud.automl.v1.TextSnippet} TextSnippet instance + */ + TextSnippet.create = function create(properties) { + return new TextSnippet(properties); + }; + + /** + * Encodes the specified TextSnippet message. Does not implicitly {@link google.cloud.automl.v1.TextSnippet.verify|verify} messages. + * @function encode + * @memberof google.cloud.automl.v1.TextSnippet + * @static + * @param {google.cloud.automl.v1.ITextSnippet} message TextSnippet message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TextSnippet.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).string(message.content); + if (message.mimeType != null && Object.hasOwnProperty.call(message, "mimeType")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.mimeType); + if (message.contentUri != null && Object.hasOwnProperty.call(message, "contentUri")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.contentUri); + return writer; + }; + + /** + * Encodes the specified TextSnippet message, length delimited. Does not implicitly {@link google.cloud.automl.v1.TextSnippet.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.automl.v1.TextSnippet + * @static + * @param {google.cloud.automl.v1.ITextSnippet} message TextSnippet message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TextSnippet.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a TextSnippet message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.automl.v1.TextSnippet + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.automl.v1.TextSnippet} TextSnippet + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TextSnippet.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.automl.v1.TextSnippet(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.content = reader.string(); + break; + } + case 2: { + message.mimeType = reader.string(); + break; + } + case 4: { + message.contentUri = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a TextSnippet message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.automl.v1.TextSnippet + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.automl.v1.TextSnippet} TextSnippet + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TextSnippet.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a TextSnippet message. + * @function verify + * @memberof google.cloud.automl.v1.TextSnippet + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + TextSnippet.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.content != null && message.hasOwnProperty("content")) + if (!$util.isString(message.content)) + return "content: string expected"; + if (message.mimeType != null && message.hasOwnProperty("mimeType")) + if (!$util.isString(message.mimeType)) + return "mimeType: string expected"; + if (message.contentUri != null && message.hasOwnProperty("contentUri")) + if (!$util.isString(message.contentUri)) + return "contentUri: string expected"; + return null; + }; + + /** + * Creates a TextSnippet message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.automl.v1.TextSnippet + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.automl.v1.TextSnippet} TextSnippet + */ + TextSnippet.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.automl.v1.TextSnippet) + return object; + var message = new $root.google.cloud.automl.v1.TextSnippet(); + if (object.content != null) + message.content = String(object.content); + if (object.mimeType != null) + message.mimeType = String(object.mimeType); + if (object.contentUri != null) + message.contentUri = String(object.contentUri); + return message; + }; + + /** + * Creates a plain object from a TextSnippet message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.automl.v1.TextSnippet + * @static + * @param {google.cloud.automl.v1.TextSnippet} message TextSnippet + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + TextSnippet.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.content = ""; + object.mimeType = ""; + object.contentUri = ""; + } + if (message.content != null && message.hasOwnProperty("content")) + object.content = message.content; + if (message.mimeType != null && message.hasOwnProperty("mimeType")) + object.mimeType = message.mimeType; + if (message.contentUri != null && message.hasOwnProperty("contentUri")) + object.contentUri = message.contentUri; + return object; + }; + + /** + * Converts this TextSnippet to JSON. + * @function toJSON + * @memberof google.cloud.automl.v1.TextSnippet + * @instance + * @returns {Object.} JSON object + */ + TextSnippet.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for TextSnippet + * @function getTypeUrl + * @memberof google.cloud.automl.v1.TextSnippet + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TextSnippet.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.automl.v1.TextSnippet"; + }; + + return TextSnippet; + })(); + + v1.DocumentDimensions = (function() { + + /** + * Properties of a DocumentDimensions. + * @memberof google.cloud.automl.v1 + * @interface IDocumentDimensions + * @property {google.cloud.automl.v1.DocumentDimensions.DocumentDimensionUnit|null} [unit] DocumentDimensions unit + * @property {number|null} [width] DocumentDimensions width + * @property {number|null} [height] DocumentDimensions height + */ + + /** + * Constructs a new DocumentDimensions. + * @memberof google.cloud.automl.v1 + * @classdesc Represents a DocumentDimensions. + * @implements IDocumentDimensions + * @constructor + * @param {google.cloud.automl.v1.IDocumentDimensions=} [properties] Properties to set + */ + function DocumentDimensions(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * DocumentDimensions unit. + * @member {google.cloud.automl.v1.DocumentDimensions.DocumentDimensionUnit} unit + * @memberof google.cloud.automl.v1.DocumentDimensions + * @instance + */ + DocumentDimensions.prototype.unit = 0; + + /** + * DocumentDimensions width. + * @member {number} width + * @memberof google.cloud.automl.v1.DocumentDimensions + * @instance + */ + DocumentDimensions.prototype.width = 0; + + /** + * DocumentDimensions height. + * @member {number} height + * @memberof google.cloud.automl.v1.DocumentDimensions + * @instance + */ + DocumentDimensions.prototype.height = 0; + + /** + * Creates a new DocumentDimensions instance using the specified properties. + * @function create + * @memberof google.cloud.automl.v1.DocumentDimensions + * @static + * @param {google.cloud.automl.v1.IDocumentDimensions=} [properties] Properties to set + * @returns {google.cloud.automl.v1.DocumentDimensions} DocumentDimensions instance + */ + DocumentDimensions.create = function create(properties) { + return new DocumentDimensions(properties); + }; + + /** + * Encodes the specified DocumentDimensions message. Does not implicitly {@link google.cloud.automl.v1.DocumentDimensions.verify|verify} messages. + * @function encode + * @memberof google.cloud.automl.v1.DocumentDimensions + * @static + * @param {google.cloud.automl.v1.IDocumentDimensions} message DocumentDimensions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DocumentDimensions.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.unit != null && Object.hasOwnProperty.call(message, "unit")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.unit); + if (message.width != null && Object.hasOwnProperty.call(message, "width")) + writer.uint32(/* id 2, wireType 5 =*/21).float(message.width); + if (message.height != null && Object.hasOwnProperty.call(message, "height")) + writer.uint32(/* id 3, wireType 5 =*/29).float(message.height); + return writer; + }; + + /** + * Encodes the specified DocumentDimensions message, length delimited. Does not implicitly {@link google.cloud.automl.v1.DocumentDimensions.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.automl.v1.DocumentDimensions + * @static + * @param {google.cloud.automl.v1.IDocumentDimensions} message DocumentDimensions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DocumentDimensions.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DocumentDimensions message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.automl.v1.DocumentDimensions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.automl.v1.DocumentDimensions} DocumentDimensions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DocumentDimensions.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.automl.v1.DocumentDimensions(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.unit = reader.int32(); + break; + } + case 2: { + message.width = reader.float(); + break; + } + case 3: { + message.height = reader.float(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DocumentDimensions message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.automl.v1.DocumentDimensions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.automl.v1.DocumentDimensions} DocumentDimensions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DocumentDimensions.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DocumentDimensions message. + * @function verify + * @memberof google.cloud.automl.v1.DocumentDimensions + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DocumentDimensions.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.unit != null && message.hasOwnProperty("unit")) + switch (message.unit) { + default: + return "unit: enum value expected"; + case 0: + case 1: + case 2: + case 3: + break; + } + if (message.width != null && message.hasOwnProperty("width")) + if (typeof message.width !== "number") + return "width: number expected"; + if (message.height != null && message.hasOwnProperty("height")) + if (typeof message.height !== "number") + return "height: number expected"; + return null; + }; + + /** + * Creates a DocumentDimensions message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.automl.v1.DocumentDimensions + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.automl.v1.DocumentDimensions} DocumentDimensions + */ + DocumentDimensions.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.automl.v1.DocumentDimensions) + return object; + var message = new $root.google.cloud.automl.v1.DocumentDimensions(); + switch (object.unit) { + default: + if (typeof object.unit === "number") { + message.unit = object.unit; + break; + } + break; + case "DOCUMENT_DIMENSION_UNIT_UNSPECIFIED": + case 0: + message.unit = 0; + break; + case "INCH": + case 1: + message.unit = 1; + break; + case "CENTIMETER": + case 2: + message.unit = 2; + break; + case "POINT": + case 3: + message.unit = 3; + break; + } + if (object.width != null) + message.width = Number(object.width); + if (object.height != null) + message.height = Number(object.height); + return message; + }; + + /** + * Creates a plain object from a DocumentDimensions message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.automl.v1.DocumentDimensions + * @static + * @param {google.cloud.automl.v1.DocumentDimensions} message DocumentDimensions + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DocumentDimensions.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.unit = options.enums === String ? "DOCUMENT_DIMENSION_UNIT_UNSPECIFIED" : 0; + object.width = 0; + object.height = 0; + } + if (message.unit != null && message.hasOwnProperty("unit")) + object.unit = options.enums === String ? $root.google.cloud.automl.v1.DocumentDimensions.DocumentDimensionUnit[message.unit] === undefined ? message.unit : $root.google.cloud.automl.v1.DocumentDimensions.DocumentDimensionUnit[message.unit] : message.unit; + if (message.width != null && message.hasOwnProperty("width")) + object.width = options.json && !isFinite(message.width) ? String(message.width) : message.width; + if (message.height != null && message.hasOwnProperty("height")) + object.height = options.json && !isFinite(message.height) ? String(message.height) : message.height; + return object; + }; + + /** + * Converts this DocumentDimensions to JSON. + * @function toJSON + * @memberof google.cloud.automl.v1.DocumentDimensions + * @instance + * @returns {Object.} JSON object + */ + DocumentDimensions.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DocumentDimensions + * @function getTypeUrl + * @memberof google.cloud.automl.v1.DocumentDimensions + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DocumentDimensions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.automl.v1.DocumentDimensions"; + }; + + /** + * DocumentDimensionUnit enum. + * @name google.cloud.automl.v1.DocumentDimensions.DocumentDimensionUnit + * @enum {number} + * @property {number} DOCUMENT_DIMENSION_UNIT_UNSPECIFIED=0 DOCUMENT_DIMENSION_UNIT_UNSPECIFIED value + * @property {number} INCH=1 INCH value + * @property {number} CENTIMETER=2 CENTIMETER value + * @property {number} POINT=3 POINT value + */ + DocumentDimensions.DocumentDimensionUnit = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "DOCUMENT_DIMENSION_UNIT_UNSPECIFIED"] = 0; + values[valuesById[1] = "INCH"] = 1; + values[valuesById[2] = "CENTIMETER"] = 2; + values[valuesById[3] = "POINT"] = 3; + return values; + })(); + + return DocumentDimensions; + })(); + + v1.Document = (function() { + + /** + * Properties of a Document. + * @memberof google.cloud.automl.v1 + * @interface IDocument + * @property {google.cloud.automl.v1.IDocumentInputConfig|null} [inputConfig] Document inputConfig + * @property {google.cloud.automl.v1.ITextSnippet|null} [documentText] Document documentText + * @property {Array.|null} [layout] Document layout + * @property {google.cloud.automl.v1.IDocumentDimensions|null} [documentDimensions] Document documentDimensions + * @property {number|null} [pageCount] Document pageCount + */ + + /** + * Constructs a new Document. + * @memberof google.cloud.automl.v1 + * @classdesc Represents a Document. + * @implements IDocument + * @constructor + * @param {google.cloud.automl.v1.IDocument=} [properties] Properties to set + */ + function Document(properties) { + this.layout = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Document inputConfig. + * @member {google.cloud.automl.v1.IDocumentInputConfig|null|undefined} inputConfig + * @memberof google.cloud.automl.v1.Document + * @instance + */ + Document.prototype.inputConfig = null; + + /** + * Document documentText. + * @member {google.cloud.automl.v1.ITextSnippet|null|undefined} documentText + * @memberof google.cloud.automl.v1.Document + * @instance + */ + Document.prototype.documentText = null; + + /** + * Document layout. + * @member {Array.} layout + * @memberof google.cloud.automl.v1.Document + * @instance + */ + Document.prototype.layout = $util.emptyArray; + + /** + * Document documentDimensions. + * @member {google.cloud.automl.v1.IDocumentDimensions|null|undefined} documentDimensions + * @memberof google.cloud.automl.v1.Document + * @instance + */ + Document.prototype.documentDimensions = null; + + /** + * Document pageCount. + * @member {number} pageCount + * @memberof google.cloud.automl.v1.Document + * @instance + */ + Document.prototype.pageCount = 0; + + /** + * Creates a new Document instance using the specified properties. + * @function create + * @memberof google.cloud.automl.v1.Document + * @static + * @param {google.cloud.automl.v1.IDocument=} [properties] Properties to set + * @returns {google.cloud.automl.v1.Document} Document instance + */ + Document.create = function create(properties) { + return new Document(properties); + }; + + /** + * Encodes the specified Document message. Does not implicitly {@link google.cloud.automl.v1.Document.verify|verify} messages. + * @function encode + * @memberof google.cloud.automl.v1.Document + * @static + * @param {google.cloud.automl.v1.IDocument} message Document message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Document.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.inputConfig != null && Object.hasOwnProperty.call(message, "inputConfig")) + $root.google.cloud.automl.v1.DocumentInputConfig.encode(message.inputConfig, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.documentText != null && Object.hasOwnProperty.call(message, "documentText")) + $root.google.cloud.automl.v1.TextSnippet.encode(message.documentText, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.layout != null && message.layout.length) + for (var i = 0; i < message.layout.length; ++i) + $root.google.cloud.automl.v1.Document.Layout.encode(message.layout[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.documentDimensions != null && Object.hasOwnProperty.call(message, "documentDimensions")) + $root.google.cloud.automl.v1.DocumentDimensions.encode(message.documentDimensions, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.pageCount != null && Object.hasOwnProperty.call(message, "pageCount")) + writer.uint32(/* id 5, wireType 0 =*/40).int32(message.pageCount); + return writer; + }; + + /** + * Encodes the specified Document message, length delimited. Does not implicitly {@link google.cloud.automl.v1.Document.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.automl.v1.Document + * @static + * @param {google.cloud.automl.v1.IDocument} message Document message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Document.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Document message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.automl.v1.Document + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.automl.v1.Document} Document + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Document.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.automl.v1.Document(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.inputConfig = $root.google.cloud.automl.v1.DocumentInputConfig.decode(reader, reader.uint32()); + break; + } + case 2: { + message.documentText = $root.google.cloud.automl.v1.TextSnippet.decode(reader, reader.uint32()); + break; + } + case 3: { + if (!(message.layout && message.layout.length)) + message.layout = []; + message.layout.push($root.google.cloud.automl.v1.Document.Layout.decode(reader, reader.uint32())); + break; + } + case 4: { + message.documentDimensions = $root.google.cloud.automl.v1.DocumentDimensions.decode(reader, reader.uint32()); + break; + } + case 5: { + message.pageCount = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Document message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.automl.v1.Document + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.automl.v1.Document} Document + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Document.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Document message. + * @function verify + * @memberof google.cloud.automl.v1.Document + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Document.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.inputConfig != null && message.hasOwnProperty("inputConfig")) { + var error = $root.google.cloud.automl.v1.DocumentInputConfig.verify(message.inputConfig); + if (error) + return "inputConfig." + error; + } + if (message.documentText != null && message.hasOwnProperty("documentText")) { + var error = $root.google.cloud.automl.v1.TextSnippet.verify(message.documentText); + if (error) + return "documentText." + error; + } + if (message.layout != null && message.hasOwnProperty("layout")) { + if (!Array.isArray(message.layout)) + return "layout: array expected"; + for (var i = 0; i < message.layout.length; ++i) { + var error = $root.google.cloud.automl.v1.Document.Layout.verify(message.layout[i]); + if (error) + return "layout." + error; + } + } + if (message.documentDimensions != null && message.hasOwnProperty("documentDimensions")) { + var error = $root.google.cloud.automl.v1.DocumentDimensions.verify(message.documentDimensions); + if (error) + return "documentDimensions." + error; + } + if (message.pageCount != null && message.hasOwnProperty("pageCount")) + if (!$util.isInteger(message.pageCount)) + return "pageCount: integer expected"; + return null; + }; + + /** + * Creates a Document message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.automl.v1.Document + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.automl.v1.Document} Document + */ + Document.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.automl.v1.Document) + return object; + var message = new $root.google.cloud.automl.v1.Document(); + if (object.inputConfig != null) { + if (typeof object.inputConfig !== "object") + throw TypeError(".google.cloud.automl.v1.Document.inputConfig: object expected"); + message.inputConfig = $root.google.cloud.automl.v1.DocumentInputConfig.fromObject(object.inputConfig); + } + if (object.documentText != null) { + if (typeof object.documentText !== "object") + throw TypeError(".google.cloud.automl.v1.Document.documentText: object expected"); + message.documentText = $root.google.cloud.automl.v1.TextSnippet.fromObject(object.documentText); + } + if (object.layout) { + if (!Array.isArray(object.layout)) + throw TypeError(".google.cloud.automl.v1.Document.layout: array expected"); + message.layout = []; + for (var i = 0; i < object.layout.length; ++i) { + if (typeof object.layout[i] !== "object") + throw TypeError(".google.cloud.automl.v1.Document.layout: object expected"); + message.layout[i] = $root.google.cloud.automl.v1.Document.Layout.fromObject(object.layout[i]); + } + } + if (object.documentDimensions != null) { + if (typeof object.documentDimensions !== "object") + throw TypeError(".google.cloud.automl.v1.Document.documentDimensions: object expected"); + message.documentDimensions = $root.google.cloud.automl.v1.DocumentDimensions.fromObject(object.documentDimensions); + } + if (object.pageCount != null) + message.pageCount = object.pageCount | 0; + return message; + }; + + /** + * Creates a plain object from a Document message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.automl.v1.Document + * @static + * @param {google.cloud.automl.v1.Document} message Document + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Document.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.layout = []; + if (options.defaults) { + object.inputConfig = null; + object.documentText = null; + object.documentDimensions = null; + object.pageCount = 0; + } + if (message.inputConfig != null && message.hasOwnProperty("inputConfig")) + object.inputConfig = $root.google.cloud.automl.v1.DocumentInputConfig.toObject(message.inputConfig, options); + if (message.documentText != null && message.hasOwnProperty("documentText")) + object.documentText = $root.google.cloud.automl.v1.TextSnippet.toObject(message.documentText, options); + if (message.layout && message.layout.length) { + object.layout = []; + for (var j = 0; j < message.layout.length; ++j) + object.layout[j] = $root.google.cloud.automl.v1.Document.Layout.toObject(message.layout[j], options); + } + if (message.documentDimensions != null && message.hasOwnProperty("documentDimensions")) + object.documentDimensions = $root.google.cloud.automl.v1.DocumentDimensions.toObject(message.documentDimensions, options); + if (message.pageCount != null && message.hasOwnProperty("pageCount")) + object.pageCount = message.pageCount; + return object; + }; + + /** + * Converts this Document to JSON. + * @function toJSON + * @memberof google.cloud.automl.v1.Document + * @instance + * @returns {Object.} JSON object + */ + Document.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Document + * @function getTypeUrl + * @memberof google.cloud.automl.v1.Document + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Document.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.automl.v1.Document"; + }; + + Document.Layout = (function() { + + /** + * Properties of a Layout. + * @memberof google.cloud.automl.v1.Document + * @interface ILayout + * @property {google.cloud.automl.v1.ITextSegment|null} [textSegment] Layout textSegment + * @property {number|null} [pageNumber] Layout pageNumber + * @property {google.cloud.automl.v1.IBoundingPoly|null} [boundingPoly] Layout boundingPoly + * @property {google.cloud.automl.v1.Document.Layout.TextSegmentType|null} [textSegmentType] Layout textSegmentType + */ + + /** + * Constructs a new Layout. + * @memberof google.cloud.automl.v1.Document + * @classdesc Represents a Layout. + * @implements ILayout + * @constructor + * @param {google.cloud.automl.v1.Document.ILayout=} [properties] Properties to set + */ + function Layout(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Layout textSegment. + * @member {google.cloud.automl.v1.ITextSegment|null|undefined} textSegment + * @memberof google.cloud.automl.v1.Document.Layout + * @instance + */ + Layout.prototype.textSegment = null; + + /** + * Layout pageNumber. + * @member {number} pageNumber + * @memberof google.cloud.automl.v1.Document.Layout + * @instance + */ + Layout.prototype.pageNumber = 0; + + /** + * Layout boundingPoly. + * @member {google.cloud.automl.v1.IBoundingPoly|null|undefined} boundingPoly + * @memberof google.cloud.automl.v1.Document.Layout + * @instance + */ + Layout.prototype.boundingPoly = null; + + /** + * Layout textSegmentType. + * @member {google.cloud.automl.v1.Document.Layout.TextSegmentType} textSegmentType + * @memberof google.cloud.automl.v1.Document.Layout + * @instance + */ + Layout.prototype.textSegmentType = 0; + + /** + * Creates a new Layout instance using the specified properties. + * @function create + * @memberof google.cloud.automl.v1.Document.Layout + * @static + * @param {google.cloud.automl.v1.Document.ILayout=} [properties] Properties to set + * @returns {google.cloud.automl.v1.Document.Layout} Layout instance + */ + Layout.create = function create(properties) { + return new Layout(properties); + }; + + /** + * Encodes the specified Layout message. Does not implicitly {@link google.cloud.automl.v1.Document.Layout.verify|verify} messages. + * @function encode + * @memberof google.cloud.automl.v1.Document.Layout + * @static + * @param {google.cloud.automl.v1.Document.ILayout} message Layout message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Layout.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.textSegment != null && Object.hasOwnProperty.call(message, "textSegment")) + $root.google.cloud.automl.v1.TextSegment.encode(message.textSegment, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.pageNumber != null && Object.hasOwnProperty.call(message, "pageNumber")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.pageNumber); + if (message.boundingPoly != null && Object.hasOwnProperty.call(message, "boundingPoly")) + $root.google.cloud.automl.v1.BoundingPoly.encode(message.boundingPoly, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.textSegmentType != null && Object.hasOwnProperty.call(message, "textSegmentType")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.textSegmentType); + return writer; + }; + + /** + * Encodes the specified Layout message, length delimited. Does not implicitly {@link google.cloud.automl.v1.Document.Layout.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.automl.v1.Document.Layout + * @static + * @param {google.cloud.automl.v1.Document.ILayout} message Layout message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Layout.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Layout message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.automl.v1.Document.Layout + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.automl.v1.Document.Layout} Layout + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Layout.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.automl.v1.Document.Layout(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.textSegment = $root.google.cloud.automl.v1.TextSegment.decode(reader, reader.uint32()); + break; + } + case 2: { + message.pageNumber = reader.int32(); + break; + } + case 3: { + message.boundingPoly = $root.google.cloud.automl.v1.BoundingPoly.decode(reader, reader.uint32()); + break; + } + case 4: { + message.textSegmentType = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Layout message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.automl.v1.Document.Layout + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.automl.v1.Document.Layout} Layout + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Layout.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Layout message. + * @function verify + * @memberof google.cloud.automl.v1.Document.Layout + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Layout.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.textSegment != null && message.hasOwnProperty("textSegment")) { + var error = $root.google.cloud.automl.v1.TextSegment.verify(message.textSegment); + if (error) + return "textSegment." + error; + } + if (message.pageNumber != null && message.hasOwnProperty("pageNumber")) + if (!$util.isInteger(message.pageNumber)) + return "pageNumber: integer expected"; + if (message.boundingPoly != null && message.hasOwnProperty("boundingPoly")) { + var error = $root.google.cloud.automl.v1.BoundingPoly.verify(message.boundingPoly); + if (error) + return "boundingPoly." + error; + } + if (message.textSegmentType != null && message.hasOwnProperty("textSegmentType")) + switch (message.textSegmentType) { + default: + return "textSegmentType: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + case 5: + case 6: + case 7: + case 8: + case 9: + break; + } + return null; + }; + + /** + * Creates a Layout message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.automl.v1.Document.Layout + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.automl.v1.Document.Layout} Layout + */ + Layout.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.automl.v1.Document.Layout) + return object; + var message = new $root.google.cloud.automl.v1.Document.Layout(); + if (object.textSegment != null) { + if (typeof object.textSegment !== "object") + throw TypeError(".google.cloud.automl.v1.Document.Layout.textSegment: object expected"); + message.textSegment = $root.google.cloud.automl.v1.TextSegment.fromObject(object.textSegment); + } + if (object.pageNumber != null) + message.pageNumber = object.pageNumber | 0; + if (object.boundingPoly != null) { + if (typeof object.boundingPoly !== "object") + throw TypeError(".google.cloud.automl.v1.Document.Layout.boundingPoly: object expected"); + message.boundingPoly = $root.google.cloud.automl.v1.BoundingPoly.fromObject(object.boundingPoly); + } + switch (object.textSegmentType) { + default: + if (typeof object.textSegmentType === "number") { + message.textSegmentType = object.textSegmentType; + break; + } + break; + case "TEXT_SEGMENT_TYPE_UNSPECIFIED": + case 0: + message.textSegmentType = 0; + break; + case "TOKEN": + case 1: + message.textSegmentType = 1; + break; + case "PARAGRAPH": + case 2: + message.textSegmentType = 2; + break; + case "FORM_FIELD": + case 3: + message.textSegmentType = 3; + break; + case "FORM_FIELD_NAME": + case 4: + message.textSegmentType = 4; + break; + case "FORM_FIELD_CONTENTS": + case 5: + message.textSegmentType = 5; + break; + case "TABLE": + case 6: + message.textSegmentType = 6; + break; + case "TABLE_HEADER": + case 7: + message.textSegmentType = 7; + break; + case "TABLE_ROW": + case 8: + message.textSegmentType = 8; + break; + case "TABLE_CELL": + case 9: + message.textSegmentType = 9; + break; + } + return message; + }; + + /** + * Creates a plain object from a Layout message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.automl.v1.Document.Layout + * @static + * @param {google.cloud.automl.v1.Document.Layout} message Layout + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Layout.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.textSegment = null; + object.pageNumber = 0; + object.boundingPoly = null; + object.textSegmentType = options.enums === String ? "TEXT_SEGMENT_TYPE_UNSPECIFIED" : 0; + } + if (message.textSegment != null && message.hasOwnProperty("textSegment")) + object.textSegment = $root.google.cloud.automl.v1.TextSegment.toObject(message.textSegment, options); + if (message.pageNumber != null && message.hasOwnProperty("pageNumber")) + object.pageNumber = message.pageNumber; + if (message.boundingPoly != null && message.hasOwnProperty("boundingPoly")) + object.boundingPoly = $root.google.cloud.automl.v1.BoundingPoly.toObject(message.boundingPoly, options); + if (message.textSegmentType != null && message.hasOwnProperty("textSegmentType")) + object.textSegmentType = options.enums === String ? $root.google.cloud.automl.v1.Document.Layout.TextSegmentType[message.textSegmentType] === undefined ? message.textSegmentType : $root.google.cloud.automl.v1.Document.Layout.TextSegmentType[message.textSegmentType] : message.textSegmentType; + return object; + }; + + /** + * Converts this Layout to JSON. + * @function toJSON + * @memberof google.cloud.automl.v1.Document.Layout + * @instance + * @returns {Object.} JSON object + */ + Layout.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Layout + * @function getTypeUrl + * @memberof google.cloud.automl.v1.Document.Layout + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Layout.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.automl.v1.Document.Layout"; + }; + + /** + * TextSegmentType enum. + * @name google.cloud.automl.v1.Document.Layout.TextSegmentType + * @enum {number} + * @property {number} TEXT_SEGMENT_TYPE_UNSPECIFIED=0 TEXT_SEGMENT_TYPE_UNSPECIFIED value + * @property {number} TOKEN=1 TOKEN value + * @property {number} PARAGRAPH=2 PARAGRAPH value + * @property {number} FORM_FIELD=3 FORM_FIELD value + * @property {number} FORM_FIELD_NAME=4 FORM_FIELD_NAME value + * @property {number} FORM_FIELD_CONTENTS=5 FORM_FIELD_CONTENTS value + * @property {number} TABLE=6 TABLE value + * @property {number} TABLE_HEADER=7 TABLE_HEADER value + * @property {number} TABLE_ROW=8 TABLE_ROW value + * @property {number} TABLE_CELL=9 TABLE_CELL value + */ + Layout.TextSegmentType = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "TEXT_SEGMENT_TYPE_UNSPECIFIED"] = 0; + values[valuesById[1] = "TOKEN"] = 1; + values[valuesById[2] = "PARAGRAPH"] = 2; + values[valuesById[3] = "FORM_FIELD"] = 3; + values[valuesById[4] = "FORM_FIELD_NAME"] = 4; + values[valuesById[5] = "FORM_FIELD_CONTENTS"] = 5; + values[valuesById[6] = "TABLE"] = 6; + values[valuesById[7] = "TABLE_HEADER"] = 7; + values[valuesById[8] = "TABLE_ROW"] = 8; + values[valuesById[9] = "TABLE_CELL"] = 9; + return values; + })(); + + return Layout; + })(); + + return Document; + })(); + + v1.ExamplePayload = (function() { + + /** + * Properties of an ExamplePayload. + * @memberof google.cloud.automl.v1 + * @interface IExamplePayload + * @property {google.cloud.automl.v1.IImage|null} [image] ExamplePayload image + * @property {google.cloud.automl.v1.ITextSnippet|null} [textSnippet] ExamplePayload textSnippet + * @property {google.cloud.automl.v1.IDocument|null} [document] ExamplePayload document + */ + + /** + * Constructs a new ExamplePayload. + * @memberof google.cloud.automl.v1 + * @classdesc Represents an ExamplePayload. + * @implements IExamplePayload + * @constructor + * @param {google.cloud.automl.v1.IExamplePayload=} [properties] Properties to set + */ + function ExamplePayload(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ExamplePayload image. + * @member {google.cloud.automl.v1.IImage|null|undefined} image + * @memberof google.cloud.automl.v1.ExamplePayload + * @instance + */ + ExamplePayload.prototype.image = null; + + /** + * ExamplePayload textSnippet. + * @member {google.cloud.automl.v1.ITextSnippet|null|undefined} textSnippet + * @memberof google.cloud.automl.v1.ExamplePayload + * @instance + */ + ExamplePayload.prototype.textSnippet = null; + + /** + * ExamplePayload document. + * @member {google.cloud.automl.v1.IDocument|null|undefined} document + * @memberof google.cloud.automl.v1.ExamplePayload + * @instance + */ + ExamplePayload.prototype.document = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * ExamplePayload payload. + * @member {"image"|"textSnippet"|"document"|undefined} payload + * @memberof google.cloud.automl.v1.ExamplePayload + * @instance + */ + Object.defineProperty(ExamplePayload.prototype, "payload", { + get: $util.oneOfGetter($oneOfFields = ["image", "textSnippet", "document"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new ExamplePayload instance using the specified properties. + * @function create + * @memberof google.cloud.automl.v1.ExamplePayload + * @static + * @param {google.cloud.automl.v1.IExamplePayload=} [properties] Properties to set + * @returns {google.cloud.automl.v1.ExamplePayload} ExamplePayload instance + */ + ExamplePayload.create = function create(properties) { + return new ExamplePayload(properties); + }; + + /** + * Encodes the specified ExamplePayload message. Does not implicitly {@link google.cloud.automl.v1.ExamplePayload.verify|verify} messages. + * @function encode + * @memberof google.cloud.automl.v1.ExamplePayload + * @static + * @param {google.cloud.automl.v1.IExamplePayload} message ExamplePayload message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ExamplePayload.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.image != null && Object.hasOwnProperty.call(message, "image")) + $root.google.cloud.automl.v1.Image.encode(message.image, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.textSnippet != null && Object.hasOwnProperty.call(message, "textSnippet")) + $root.google.cloud.automl.v1.TextSnippet.encode(message.textSnippet, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.document != null && Object.hasOwnProperty.call(message, "document")) + $root.google.cloud.automl.v1.Document.encode(message.document, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified ExamplePayload message, length delimited. Does not implicitly {@link google.cloud.automl.v1.ExamplePayload.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.automl.v1.ExamplePayload + * @static + * @param {google.cloud.automl.v1.IExamplePayload} message ExamplePayload message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ExamplePayload.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an ExamplePayload message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.automl.v1.ExamplePayload + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.automl.v1.ExamplePayload} ExamplePayload + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ExamplePayload.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.automl.v1.ExamplePayload(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.image = $root.google.cloud.automl.v1.Image.decode(reader, reader.uint32()); + break; + } + case 2: { + message.textSnippet = $root.google.cloud.automl.v1.TextSnippet.decode(reader, reader.uint32()); + break; + } + case 4: { + message.document = $root.google.cloud.automl.v1.Document.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an ExamplePayload message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.automl.v1.ExamplePayload + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.automl.v1.ExamplePayload} ExamplePayload + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ExamplePayload.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an ExamplePayload message. + * @function verify + * @memberof google.cloud.automl.v1.ExamplePayload + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ExamplePayload.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.image != null && message.hasOwnProperty("image")) { + properties.payload = 1; + { + var error = $root.google.cloud.automl.v1.Image.verify(message.image); + if (error) + return "image." + error; + } + } + if (message.textSnippet != null && message.hasOwnProperty("textSnippet")) { + if (properties.payload === 1) + return "payload: multiple values"; + properties.payload = 1; + { + var error = $root.google.cloud.automl.v1.TextSnippet.verify(message.textSnippet); + if (error) + return "textSnippet." + error; + } + } + if (message.document != null && message.hasOwnProperty("document")) { + if (properties.payload === 1) + return "payload: multiple values"; + properties.payload = 1; + { + var error = $root.google.cloud.automl.v1.Document.verify(message.document); + if (error) + return "document." + error; + } + } + return null; + }; + + /** + * Creates an ExamplePayload message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.automl.v1.ExamplePayload + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.automl.v1.ExamplePayload} ExamplePayload + */ + ExamplePayload.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.automl.v1.ExamplePayload) + return object; + var message = new $root.google.cloud.automl.v1.ExamplePayload(); + if (object.image != null) { + if (typeof object.image !== "object") + throw TypeError(".google.cloud.automl.v1.ExamplePayload.image: object expected"); + message.image = $root.google.cloud.automl.v1.Image.fromObject(object.image); + } + if (object.textSnippet != null) { + if (typeof object.textSnippet !== "object") + throw TypeError(".google.cloud.automl.v1.ExamplePayload.textSnippet: object expected"); + message.textSnippet = $root.google.cloud.automl.v1.TextSnippet.fromObject(object.textSnippet); + } + if (object.document != null) { + if (typeof object.document !== "object") + throw TypeError(".google.cloud.automl.v1.ExamplePayload.document: object expected"); + message.document = $root.google.cloud.automl.v1.Document.fromObject(object.document); + } + return message; + }; + + /** + * Creates a plain object from an ExamplePayload message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.automl.v1.ExamplePayload + * @static + * @param {google.cloud.automl.v1.ExamplePayload} message ExamplePayload + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ExamplePayload.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.image != null && message.hasOwnProperty("image")) { + object.image = $root.google.cloud.automl.v1.Image.toObject(message.image, options); + if (options.oneofs) + object.payload = "image"; + } + if (message.textSnippet != null && message.hasOwnProperty("textSnippet")) { + object.textSnippet = $root.google.cloud.automl.v1.TextSnippet.toObject(message.textSnippet, options); + if (options.oneofs) + object.payload = "textSnippet"; + } + if (message.document != null && message.hasOwnProperty("document")) { + object.document = $root.google.cloud.automl.v1.Document.toObject(message.document, options); + if (options.oneofs) + object.payload = "document"; + } + return object; + }; + + /** + * Converts this ExamplePayload to JSON. + * @function toJSON + * @memberof google.cloud.automl.v1.ExamplePayload + * @instance + * @returns {Object.} JSON object + */ + ExamplePayload.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ExamplePayload + * @function getTypeUrl + * @memberof google.cloud.automl.v1.ExamplePayload + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ExamplePayload.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.automl.v1.ExamplePayload"; + }; + + return ExamplePayload; + })(); + + v1.InputConfig = (function() { + + /** + * Properties of an InputConfig. + * @memberof google.cloud.automl.v1 + * @interface IInputConfig + * @property {google.cloud.automl.v1.IGcsSource|null} [gcsSource] InputConfig gcsSource + * @property {Object.|null} [params] InputConfig params + */ + + /** + * Constructs a new InputConfig. + * @memberof google.cloud.automl.v1 + * @classdesc Represents an InputConfig. + * @implements IInputConfig + * @constructor + * @param {google.cloud.automl.v1.IInputConfig=} [properties] Properties to set + */ + function InputConfig(properties) { + this.params = {}; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * InputConfig gcsSource. + * @member {google.cloud.automl.v1.IGcsSource|null|undefined} gcsSource + * @memberof google.cloud.automl.v1.InputConfig + * @instance + */ + InputConfig.prototype.gcsSource = null; + + /** + * InputConfig params. + * @member {Object.} params + * @memberof google.cloud.automl.v1.InputConfig + * @instance + */ + InputConfig.prototype.params = $util.emptyObject; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * InputConfig source. + * @member {"gcsSource"|undefined} source + * @memberof google.cloud.automl.v1.InputConfig + * @instance + */ + Object.defineProperty(InputConfig.prototype, "source", { + get: $util.oneOfGetter($oneOfFields = ["gcsSource"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new InputConfig instance using the specified properties. + * @function create + * @memberof google.cloud.automl.v1.InputConfig + * @static + * @param {google.cloud.automl.v1.IInputConfig=} [properties] Properties to set + * @returns {google.cloud.automl.v1.InputConfig} InputConfig instance + */ + InputConfig.create = function create(properties) { + return new InputConfig(properties); + }; + + /** + * Encodes the specified InputConfig message. Does not implicitly {@link google.cloud.automl.v1.InputConfig.verify|verify} messages. + * @function encode + * @memberof google.cloud.automl.v1.InputConfig + * @static + * @param {google.cloud.automl.v1.IInputConfig} message InputConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + InputConfig.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.gcsSource != null && Object.hasOwnProperty.call(message, "gcsSource")) + $root.google.cloud.automl.v1.GcsSource.encode(message.gcsSource, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.params != null && Object.hasOwnProperty.call(message, "params")) + for (var keys = Object.keys(message.params), 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.params[keys[i]]).ldelim(); + return writer; + }; + + /** + * Encodes the specified InputConfig message, length delimited. Does not implicitly {@link google.cloud.automl.v1.InputConfig.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.automl.v1.InputConfig + * @static + * @param {google.cloud.automl.v1.IInputConfig} message InputConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + InputConfig.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an InputConfig message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.automl.v1.InputConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.automl.v1.InputConfig} InputConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + InputConfig.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.automl.v1.InputConfig(), key, value; + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.gcsSource = $root.google.cloud.automl.v1.GcsSource.decode(reader, reader.uint32()); + break; + } + case 2: { + if (message.params === $util.emptyObject) + message.params = {}; + 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.params[key] = value; + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an InputConfig message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.automl.v1.InputConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.automl.v1.InputConfig} InputConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + InputConfig.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an InputConfig message. + * @function verify + * @memberof google.cloud.automl.v1.InputConfig + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + InputConfig.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.gcsSource != null && message.hasOwnProperty("gcsSource")) { + properties.source = 1; + { + var error = $root.google.cloud.automl.v1.GcsSource.verify(message.gcsSource); + if (error) + return "gcsSource." + error; + } + } + if (message.params != null && message.hasOwnProperty("params")) { + if (!$util.isObject(message.params)) + return "params: object expected"; + var key = Object.keys(message.params); + for (var i = 0; i < key.length; ++i) + if (!$util.isString(message.params[key[i]])) + return "params: string{k:string} expected"; + } + return null; + }; + + /** + * Creates an InputConfig message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.automl.v1.InputConfig + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.automl.v1.InputConfig} InputConfig + */ + InputConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.automl.v1.InputConfig) + return object; + var message = new $root.google.cloud.automl.v1.InputConfig(); + if (object.gcsSource != null) { + if (typeof object.gcsSource !== "object") + throw TypeError(".google.cloud.automl.v1.InputConfig.gcsSource: object expected"); + message.gcsSource = $root.google.cloud.automl.v1.GcsSource.fromObject(object.gcsSource); + } + if (object.params) { + if (typeof object.params !== "object") + throw TypeError(".google.cloud.automl.v1.InputConfig.params: object expected"); + message.params = {}; + for (var keys = Object.keys(object.params), i = 0; i < keys.length; ++i) + message.params[keys[i]] = String(object.params[keys[i]]); + } + return message; + }; + + /** + * Creates a plain object from an InputConfig message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.automl.v1.InputConfig + * @static + * @param {google.cloud.automl.v1.InputConfig} message InputConfig + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + InputConfig.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.objects || options.defaults) + object.params = {}; + if (message.gcsSource != null && message.hasOwnProperty("gcsSource")) { + object.gcsSource = $root.google.cloud.automl.v1.GcsSource.toObject(message.gcsSource, options); + if (options.oneofs) + object.source = "gcsSource"; + } + var keys2; + if (message.params && (keys2 = Object.keys(message.params)).length) { + object.params = {}; + for (var j = 0; j < keys2.length; ++j) + object.params[keys2[j]] = message.params[keys2[j]]; + } + return object; + }; + + /** + * Converts this InputConfig to JSON. + * @function toJSON + * @memberof google.cloud.automl.v1.InputConfig + * @instance + * @returns {Object.} JSON object + */ + InputConfig.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for InputConfig + * @function getTypeUrl + * @memberof google.cloud.automl.v1.InputConfig + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + InputConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.automl.v1.InputConfig"; + }; + + return InputConfig; + })(); + + v1.BatchPredictInputConfig = (function() { + + /** + * Properties of a BatchPredictInputConfig. + * @memberof google.cloud.automl.v1 + * @interface IBatchPredictInputConfig + * @property {google.cloud.automl.v1.IGcsSource|null} [gcsSource] BatchPredictInputConfig gcsSource + */ + + /** + * Constructs a new BatchPredictInputConfig. + * @memberof google.cloud.automl.v1 + * @classdesc Represents a BatchPredictInputConfig. + * @implements IBatchPredictInputConfig + * @constructor + * @param {google.cloud.automl.v1.IBatchPredictInputConfig=} [properties] Properties to set + */ + function BatchPredictInputConfig(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * BatchPredictInputConfig gcsSource. + * @member {google.cloud.automl.v1.IGcsSource|null|undefined} gcsSource + * @memberof google.cloud.automl.v1.BatchPredictInputConfig + * @instance + */ + BatchPredictInputConfig.prototype.gcsSource = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * BatchPredictInputConfig source. + * @member {"gcsSource"|undefined} source + * @memberof google.cloud.automl.v1.BatchPredictInputConfig + * @instance + */ + Object.defineProperty(BatchPredictInputConfig.prototype, "source", { + get: $util.oneOfGetter($oneOfFields = ["gcsSource"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new BatchPredictInputConfig instance using the specified properties. + * @function create + * @memberof google.cloud.automl.v1.BatchPredictInputConfig + * @static + * @param {google.cloud.automl.v1.IBatchPredictInputConfig=} [properties] Properties to set + * @returns {google.cloud.automl.v1.BatchPredictInputConfig} BatchPredictInputConfig instance + */ + BatchPredictInputConfig.create = function create(properties) { + return new BatchPredictInputConfig(properties); + }; + + /** + * Encodes the specified BatchPredictInputConfig message. Does not implicitly {@link google.cloud.automl.v1.BatchPredictInputConfig.verify|verify} messages. + * @function encode + * @memberof google.cloud.automl.v1.BatchPredictInputConfig + * @static + * @param {google.cloud.automl.v1.IBatchPredictInputConfig} message BatchPredictInputConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BatchPredictInputConfig.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.gcsSource != null && Object.hasOwnProperty.call(message, "gcsSource")) + $root.google.cloud.automl.v1.GcsSource.encode(message.gcsSource, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified BatchPredictInputConfig message, length delimited. Does not implicitly {@link google.cloud.automl.v1.BatchPredictInputConfig.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.automl.v1.BatchPredictInputConfig + * @static + * @param {google.cloud.automl.v1.IBatchPredictInputConfig} message BatchPredictInputConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BatchPredictInputConfig.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a BatchPredictInputConfig message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.automl.v1.BatchPredictInputConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.automl.v1.BatchPredictInputConfig} BatchPredictInputConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BatchPredictInputConfig.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.automl.v1.BatchPredictInputConfig(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.gcsSource = $root.google.cloud.automl.v1.GcsSource.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a BatchPredictInputConfig message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.automl.v1.BatchPredictInputConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.automl.v1.BatchPredictInputConfig} BatchPredictInputConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BatchPredictInputConfig.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a BatchPredictInputConfig message. + * @function verify + * @memberof google.cloud.automl.v1.BatchPredictInputConfig + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + BatchPredictInputConfig.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.gcsSource != null && message.hasOwnProperty("gcsSource")) { + properties.source = 1; + { + var error = $root.google.cloud.automl.v1.GcsSource.verify(message.gcsSource); + if (error) + return "gcsSource." + error; + } + } + return null; + }; + + /** + * Creates a BatchPredictInputConfig message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.automl.v1.BatchPredictInputConfig + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.automl.v1.BatchPredictInputConfig} BatchPredictInputConfig + */ + BatchPredictInputConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.automl.v1.BatchPredictInputConfig) + return object; + var message = new $root.google.cloud.automl.v1.BatchPredictInputConfig(); + if (object.gcsSource != null) { + if (typeof object.gcsSource !== "object") + throw TypeError(".google.cloud.automl.v1.BatchPredictInputConfig.gcsSource: object expected"); + message.gcsSource = $root.google.cloud.automl.v1.GcsSource.fromObject(object.gcsSource); + } + return message; + }; + + /** + * Creates a plain object from a BatchPredictInputConfig message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.automl.v1.BatchPredictInputConfig + * @static + * @param {google.cloud.automl.v1.BatchPredictInputConfig} message BatchPredictInputConfig + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + BatchPredictInputConfig.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.gcsSource != null && message.hasOwnProperty("gcsSource")) { + object.gcsSource = $root.google.cloud.automl.v1.GcsSource.toObject(message.gcsSource, options); + if (options.oneofs) + object.source = "gcsSource"; + } + return object; + }; + + /** + * Converts this BatchPredictInputConfig to JSON. + * @function toJSON + * @memberof google.cloud.automl.v1.BatchPredictInputConfig + * @instance + * @returns {Object.} JSON object + */ + BatchPredictInputConfig.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for BatchPredictInputConfig + * @function getTypeUrl + * @memberof google.cloud.automl.v1.BatchPredictInputConfig + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + BatchPredictInputConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.automl.v1.BatchPredictInputConfig"; + }; + + return BatchPredictInputConfig; + })(); + + v1.DocumentInputConfig = (function() { + + /** + * Properties of a DocumentInputConfig. + * @memberof google.cloud.automl.v1 + * @interface IDocumentInputConfig + * @property {google.cloud.automl.v1.IGcsSource|null} [gcsSource] DocumentInputConfig gcsSource + */ + + /** + * Constructs a new DocumentInputConfig. + * @memberof google.cloud.automl.v1 + * @classdesc Represents a DocumentInputConfig. + * @implements IDocumentInputConfig + * @constructor + * @param {google.cloud.automl.v1.IDocumentInputConfig=} [properties] Properties to set + */ + function DocumentInputConfig(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * DocumentInputConfig gcsSource. + * @member {google.cloud.automl.v1.IGcsSource|null|undefined} gcsSource + * @memberof google.cloud.automl.v1.DocumentInputConfig + * @instance + */ + DocumentInputConfig.prototype.gcsSource = null; + + /** + * Creates a new DocumentInputConfig instance using the specified properties. + * @function create + * @memberof google.cloud.automl.v1.DocumentInputConfig + * @static + * @param {google.cloud.automl.v1.IDocumentInputConfig=} [properties] Properties to set + * @returns {google.cloud.automl.v1.DocumentInputConfig} DocumentInputConfig instance + */ + DocumentInputConfig.create = function create(properties) { + return new DocumentInputConfig(properties); + }; + + /** + * Encodes the specified DocumentInputConfig message. Does not implicitly {@link google.cloud.automl.v1.DocumentInputConfig.verify|verify} messages. + * @function encode + * @memberof google.cloud.automl.v1.DocumentInputConfig + * @static + * @param {google.cloud.automl.v1.IDocumentInputConfig} message DocumentInputConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DocumentInputConfig.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.gcsSource != null && Object.hasOwnProperty.call(message, "gcsSource")) + $root.google.cloud.automl.v1.GcsSource.encode(message.gcsSource, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified DocumentInputConfig message, length delimited. Does not implicitly {@link google.cloud.automl.v1.DocumentInputConfig.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.automl.v1.DocumentInputConfig + * @static + * @param {google.cloud.automl.v1.IDocumentInputConfig} message DocumentInputConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DocumentInputConfig.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DocumentInputConfig message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.automl.v1.DocumentInputConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.automl.v1.DocumentInputConfig} DocumentInputConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DocumentInputConfig.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.automl.v1.DocumentInputConfig(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.gcsSource = $root.google.cloud.automl.v1.GcsSource.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DocumentInputConfig message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.automl.v1.DocumentInputConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.automl.v1.DocumentInputConfig} DocumentInputConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DocumentInputConfig.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DocumentInputConfig message. + * @function verify + * @memberof google.cloud.automl.v1.DocumentInputConfig + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DocumentInputConfig.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.gcsSource != null && message.hasOwnProperty("gcsSource")) { + var error = $root.google.cloud.automl.v1.GcsSource.verify(message.gcsSource); + if (error) + return "gcsSource." + error; + } + return null; + }; + + /** + * Creates a DocumentInputConfig message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.automl.v1.DocumentInputConfig + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.automl.v1.DocumentInputConfig} DocumentInputConfig + */ + DocumentInputConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.automl.v1.DocumentInputConfig) + return object; + var message = new $root.google.cloud.automl.v1.DocumentInputConfig(); + if (object.gcsSource != null) { + if (typeof object.gcsSource !== "object") + throw TypeError(".google.cloud.automl.v1.DocumentInputConfig.gcsSource: object expected"); + message.gcsSource = $root.google.cloud.automl.v1.GcsSource.fromObject(object.gcsSource); + } + return message; + }; + + /** + * Creates a plain object from a DocumentInputConfig message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.automl.v1.DocumentInputConfig + * @static + * @param {google.cloud.automl.v1.DocumentInputConfig} message DocumentInputConfig + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DocumentInputConfig.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.gcsSource = null; + if (message.gcsSource != null && message.hasOwnProperty("gcsSource")) + object.gcsSource = $root.google.cloud.automl.v1.GcsSource.toObject(message.gcsSource, options); + return object; + }; + + /** + * Converts this DocumentInputConfig to JSON. + * @function toJSON + * @memberof google.cloud.automl.v1.DocumentInputConfig + * @instance + * @returns {Object.} JSON object + */ + DocumentInputConfig.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DocumentInputConfig + * @function getTypeUrl + * @memberof google.cloud.automl.v1.DocumentInputConfig + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DocumentInputConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.automl.v1.DocumentInputConfig"; + }; + + return DocumentInputConfig; + })(); + + v1.OutputConfig = (function() { + + /** + * Properties of an OutputConfig. + * @memberof google.cloud.automl.v1 + * @interface IOutputConfig + * @property {google.cloud.automl.v1.IGcsDestination|null} [gcsDestination] OutputConfig gcsDestination + */ + + /** + * Constructs a new OutputConfig. + * @memberof google.cloud.automl.v1 + * @classdesc Represents an OutputConfig. + * @implements IOutputConfig + * @constructor + * @param {google.cloud.automl.v1.IOutputConfig=} [properties] Properties to set + */ + function OutputConfig(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * OutputConfig gcsDestination. + * @member {google.cloud.automl.v1.IGcsDestination|null|undefined} gcsDestination + * @memberof google.cloud.automl.v1.OutputConfig + * @instance + */ + OutputConfig.prototype.gcsDestination = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * OutputConfig destination. + * @member {"gcsDestination"|undefined} destination + * @memberof google.cloud.automl.v1.OutputConfig + * @instance + */ + Object.defineProperty(OutputConfig.prototype, "destination", { + get: $util.oneOfGetter($oneOfFields = ["gcsDestination"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new OutputConfig instance using the specified properties. + * @function create + * @memberof google.cloud.automl.v1.OutputConfig + * @static + * @param {google.cloud.automl.v1.IOutputConfig=} [properties] Properties to set + * @returns {google.cloud.automl.v1.OutputConfig} OutputConfig instance + */ + OutputConfig.create = function create(properties) { + return new OutputConfig(properties); + }; + + /** + * Encodes the specified OutputConfig message. Does not implicitly {@link google.cloud.automl.v1.OutputConfig.verify|verify} messages. + * @function encode + * @memberof google.cloud.automl.v1.OutputConfig + * @static + * @param {google.cloud.automl.v1.IOutputConfig} message OutputConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + OutputConfig.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.gcsDestination != null && Object.hasOwnProperty.call(message, "gcsDestination")) + $root.google.cloud.automl.v1.GcsDestination.encode(message.gcsDestination, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified OutputConfig message, length delimited. Does not implicitly {@link google.cloud.automl.v1.OutputConfig.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.automl.v1.OutputConfig + * @static + * @param {google.cloud.automl.v1.IOutputConfig} message OutputConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + OutputConfig.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an OutputConfig message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.automl.v1.OutputConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.automl.v1.OutputConfig} OutputConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + OutputConfig.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.automl.v1.OutputConfig(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.gcsDestination = $root.google.cloud.automl.v1.GcsDestination.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an OutputConfig message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.automl.v1.OutputConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.automl.v1.OutputConfig} OutputConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + OutputConfig.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an OutputConfig message. + * @function verify + * @memberof google.cloud.automl.v1.OutputConfig + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + OutputConfig.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.gcsDestination != null && message.hasOwnProperty("gcsDestination")) { + properties.destination = 1; + { + var error = $root.google.cloud.automl.v1.GcsDestination.verify(message.gcsDestination); + if (error) + return "gcsDestination." + error; + } + } + return null; + }; + + /** + * Creates an OutputConfig message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.automl.v1.OutputConfig + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.automl.v1.OutputConfig} OutputConfig + */ + OutputConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.automl.v1.OutputConfig) + return object; + var message = new $root.google.cloud.automl.v1.OutputConfig(); + if (object.gcsDestination != null) { + if (typeof object.gcsDestination !== "object") + throw TypeError(".google.cloud.automl.v1.OutputConfig.gcsDestination: object expected"); + message.gcsDestination = $root.google.cloud.automl.v1.GcsDestination.fromObject(object.gcsDestination); + } + return message; + }; + + /** + * Creates a plain object from an OutputConfig message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.automl.v1.OutputConfig + * @static + * @param {google.cloud.automl.v1.OutputConfig} message OutputConfig + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + OutputConfig.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.gcsDestination != null && message.hasOwnProperty("gcsDestination")) { + object.gcsDestination = $root.google.cloud.automl.v1.GcsDestination.toObject(message.gcsDestination, options); + if (options.oneofs) + object.destination = "gcsDestination"; + } + return object; + }; + + /** + * Converts this OutputConfig to JSON. + * @function toJSON + * @memberof google.cloud.automl.v1.OutputConfig + * @instance + * @returns {Object.} JSON object + */ + OutputConfig.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for OutputConfig + * @function getTypeUrl + * @memberof google.cloud.automl.v1.OutputConfig + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + OutputConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.automl.v1.OutputConfig"; + }; + + return OutputConfig; + })(); + + v1.BatchPredictOutputConfig = (function() { + + /** + * Properties of a BatchPredictOutputConfig. + * @memberof google.cloud.automl.v1 + * @interface IBatchPredictOutputConfig + * @property {google.cloud.automl.v1.IGcsDestination|null} [gcsDestination] BatchPredictOutputConfig gcsDestination + */ + + /** + * Constructs a new BatchPredictOutputConfig. + * @memberof google.cloud.automl.v1 + * @classdesc Represents a BatchPredictOutputConfig. + * @implements IBatchPredictOutputConfig + * @constructor + * @param {google.cloud.automl.v1.IBatchPredictOutputConfig=} [properties] Properties to set + */ + function BatchPredictOutputConfig(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * BatchPredictOutputConfig gcsDestination. + * @member {google.cloud.automl.v1.IGcsDestination|null|undefined} gcsDestination + * @memberof google.cloud.automl.v1.BatchPredictOutputConfig + * @instance + */ + BatchPredictOutputConfig.prototype.gcsDestination = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * BatchPredictOutputConfig destination. + * @member {"gcsDestination"|undefined} destination + * @memberof google.cloud.automl.v1.BatchPredictOutputConfig + * @instance + */ + Object.defineProperty(BatchPredictOutputConfig.prototype, "destination", { + get: $util.oneOfGetter($oneOfFields = ["gcsDestination"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new BatchPredictOutputConfig instance using the specified properties. + * @function create + * @memberof google.cloud.automl.v1.BatchPredictOutputConfig + * @static + * @param {google.cloud.automl.v1.IBatchPredictOutputConfig=} [properties] Properties to set + * @returns {google.cloud.automl.v1.BatchPredictOutputConfig} BatchPredictOutputConfig instance + */ + BatchPredictOutputConfig.create = function create(properties) { + return new BatchPredictOutputConfig(properties); + }; + + /** + * Encodes the specified BatchPredictOutputConfig message. Does not implicitly {@link google.cloud.automl.v1.BatchPredictOutputConfig.verify|verify} messages. + * @function encode + * @memberof google.cloud.automl.v1.BatchPredictOutputConfig + * @static + * @param {google.cloud.automl.v1.IBatchPredictOutputConfig} message BatchPredictOutputConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BatchPredictOutputConfig.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.gcsDestination != null && Object.hasOwnProperty.call(message, "gcsDestination")) + $root.google.cloud.automl.v1.GcsDestination.encode(message.gcsDestination, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified BatchPredictOutputConfig message, length delimited. Does not implicitly {@link google.cloud.automl.v1.BatchPredictOutputConfig.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.automl.v1.BatchPredictOutputConfig + * @static + * @param {google.cloud.automl.v1.IBatchPredictOutputConfig} message BatchPredictOutputConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BatchPredictOutputConfig.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a BatchPredictOutputConfig message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.automl.v1.BatchPredictOutputConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.automl.v1.BatchPredictOutputConfig} BatchPredictOutputConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BatchPredictOutputConfig.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.automl.v1.BatchPredictOutputConfig(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.gcsDestination = $root.google.cloud.automl.v1.GcsDestination.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a BatchPredictOutputConfig message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.automl.v1.BatchPredictOutputConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.automl.v1.BatchPredictOutputConfig} BatchPredictOutputConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BatchPredictOutputConfig.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a BatchPredictOutputConfig message. + * @function verify + * @memberof google.cloud.automl.v1.BatchPredictOutputConfig + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + BatchPredictOutputConfig.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.gcsDestination != null && message.hasOwnProperty("gcsDestination")) { + properties.destination = 1; + { + var error = $root.google.cloud.automl.v1.GcsDestination.verify(message.gcsDestination); + if (error) + return "gcsDestination." + error; + } + } + return null; + }; + + /** + * Creates a BatchPredictOutputConfig message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.automl.v1.BatchPredictOutputConfig + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.automl.v1.BatchPredictOutputConfig} BatchPredictOutputConfig + */ + BatchPredictOutputConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.automl.v1.BatchPredictOutputConfig) + return object; + var message = new $root.google.cloud.automl.v1.BatchPredictOutputConfig(); + if (object.gcsDestination != null) { + if (typeof object.gcsDestination !== "object") + throw TypeError(".google.cloud.automl.v1.BatchPredictOutputConfig.gcsDestination: object expected"); + message.gcsDestination = $root.google.cloud.automl.v1.GcsDestination.fromObject(object.gcsDestination); + } + return message; + }; + + /** + * Creates a plain object from a BatchPredictOutputConfig message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.automl.v1.BatchPredictOutputConfig + * @static + * @param {google.cloud.automl.v1.BatchPredictOutputConfig} message BatchPredictOutputConfig + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + BatchPredictOutputConfig.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.gcsDestination != null && message.hasOwnProperty("gcsDestination")) { + object.gcsDestination = $root.google.cloud.automl.v1.GcsDestination.toObject(message.gcsDestination, options); + if (options.oneofs) + object.destination = "gcsDestination"; + } + return object; + }; + + /** + * Converts this BatchPredictOutputConfig to JSON. + * @function toJSON + * @memberof google.cloud.automl.v1.BatchPredictOutputConfig + * @instance + * @returns {Object.} JSON object + */ + BatchPredictOutputConfig.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for BatchPredictOutputConfig + * @function getTypeUrl + * @memberof google.cloud.automl.v1.BatchPredictOutputConfig + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + BatchPredictOutputConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.automl.v1.BatchPredictOutputConfig"; + }; + + return BatchPredictOutputConfig; + })(); + + v1.ModelExportOutputConfig = (function() { + + /** + * Properties of a ModelExportOutputConfig. + * @memberof google.cloud.automl.v1 + * @interface IModelExportOutputConfig + * @property {google.cloud.automl.v1.IGcsDestination|null} [gcsDestination] ModelExportOutputConfig gcsDestination + * @property {string|null} [modelFormat] ModelExportOutputConfig modelFormat + * @property {Object.|null} [params] ModelExportOutputConfig params + */ + + /** + * Constructs a new ModelExportOutputConfig. + * @memberof google.cloud.automl.v1 + * @classdesc Represents a ModelExportOutputConfig. + * @implements IModelExportOutputConfig + * @constructor + * @param {google.cloud.automl.v1.IModelExportOutputConfig=} [properties] Properties to set + */ + function ModelExportOutputConfig(properties) { + this.params = {}; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ModelExportOutputConfig gcsDestination. + * @member {google.cloud.automl.v1.IGcsDestination|null|undefined} gcsDestination + * @memberof google.cloud.automl.v1.ModelExportOutputConfig + * @instance + */ + ModelExportOutputConfig.prototype.gcsDestination = null; + + /** + * ModelExportOutputConfig modelFormat. + * @member {string} modelFormat + * @memberof google.cloud.automl.v1.ModelExportOutputConfig + * @instance + */ + ModelExportOutputConfig.prototype.modelFormat = ""; + + /** + * ModelExportOutputConfig params. + * @member {Object.} params + * @memberof google.cloud.automl.v1.ModelExportOutputConfig + * @instance + */ + ModelExportOutputConfig.prototype.params = $util.emptyObject; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * ModelExportOutputConfig destination. + * @member {"gcsDestination"|undefined} destination + * @memberof google.cloud.automl.v1.ModelExportOutputConfig + * @instance + */ + Object.defineProperty(ModelExportOutputConfig.prototype, "destination", { + get: $util.oneOfGetter($oneOfFields = ["gcsDestination"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new ModelExportOutputConfig instance using the specified properties. + * @function create + * @memberof google.cloud.automl.v1.ModelExportOutputConfig + * @static + * @param {google.cloud.automl.v1.IModelExportOutputConfig=} [properties] Properties to set + * @returns {google.cloud.automl.v1.ModelExportOutputConfig} ModelExportOutputConfig instance + */ + ModelExportOutputConfig.create = function create(properties) { + return new ModelExportOutputConfig(properties); + }; + + /** + * Encodes the specified ModelExportOutputConfig message. Does not implicitly {@link google.cloud.automl.v1.ModelExportOutputConfig.verify|verify} messages. + * @function encode + * @memberof google.cloud.automl.v1.ModelExportOutputConfig + * @static + * @param {google.cloud.automl.v1.IModelExportOutputConfig} message ModelExportOutputConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ModelExportOutputConfig.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.gcsDestination != null && Object.hasOwnProperty.call(message, "gcsDestination")) + $root.google.cloud.automl.v1.GcsDestination.encode(message.gcsDestination, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.params != null && Object.hasOwnProperty.call(message, "params")) + for (var keys = Object.keys(message.params), 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.params[keys[i]]).ldelim(); + if (message.modelFormat != null && Object.hasOwnProperty.call(message, "modelFormat")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.modelFormat); + return writer; + }; + + /** + * Encodes the specified ModelExportOutputConfig message, length delimited. Does not implicitly {@link google.cloud.automl.v1.ModelExportOutputConfig.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.automl.v1.ModelExportOutputConfig + * @static + * @param {google.cloud.automl.v1.IModelExportOutputConfig} message ModelExportOutputConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ModelExportOutputConfig.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ModelExportOutputConfig message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.automl.v1.ModelExportOutputConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.automl.v1.ModelExportOutputConfig} ModelExportOutputConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ModelExportOutputConfig.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.automl.v1.ModelExportOutputConfig(), key, value; + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.gcsDestination = $root.google.cloud.automl.v1.GcsDestination.decode(reader, reader.uint32()); + break; + } + case 4: { + message.modelFormat = reader.string(); + break; + } + case 2: { + if (message.params === $util.emptyObject) + message.params = {}; + 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.params[key] = value; + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ModelExportOutputConfig message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.automl.v1.ModelExportOutputConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.automl.v1.ModelExportOutputConfig} ModelExportOutputConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ModelExportOutputConfig.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ModelExportOutputConfig message. + * @function verify + * @memberof google.cloud.automl.v1.ModelExportOutputConfig + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ModelExportOutputConfig.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.gcsDestination != null && message.hasOwnProperty("gcsDestination")) { + properties.destination = 1; + { + var error = $root.google.cloud.automl.v1.GcsDestination.verify(message.gcsDestination); + if (error) + return "gcsDestination." + error; + } + } + if (message.modelFormat != null && message.hasOwnProperty("modelFormat")) + if (!$util.isString(message.modelFormat)) + return "modelFormat: string expected"; + if (message.params != null && message.hasOwnProperty("params")) { + if (!$util.isObject(message.params)) + return "params: object expected"; + var key = Object.keys(message.params); + for (var i = 0; i < key.length; ++i) + if (!$util.isString(message.params[key[i]])) + return "params: string{k:string} expected"; + } + return null; + }; + + /** + * Creates a ModelExportOutputConfig message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.automl.v1.ModelExportOutputConfig + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.automl.v1.ModelExportOutputConfig} ModelExportOutputConfig + */ + ModelExportOutputConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.automl.v1.ModelExportOutputConfig) + return object; + var message = new $root.google.cloud.automl.v1.ModelExportOutputConfig(); + if (object.gcsDestination != null) { + if (typeof object.gcsDestination !== "object") + throw TypeError(".google.cloud.automl.v1.ModelExportOutputConfig.gcsDestination: object expected"); + message.gcsDestination = $root.google.cloud.automl.v1.GcsDestination.fromObject(object.gcsDestination); + } + if (object.modelFormat != null) + message.modelFormat = String(object.modelFormat); + if (object.params) { + if (typeof object.params !== "object") + throw TypeError(".google.cloud.automl.v1.ModelExportOutputConfig.params: object expected"); + message.params = {}; + for (var keys = Object.keys(object.params), i = 0; i < keys.length; ++i) + message.params[keys[i]] = String(object.params[keys[i]]); + } + return message; + }; + + /** + * Creates a plain object from a ModelExportOutputConfig message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.automl.v1.ModelExportOutputConfig + * @static + * @param {google.cloud.automl.v1.ModelExportOutputConfig} message ModelExportOutputConfig + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ModelExportOutputConfig.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.objects || options.defaults) + object.params = {}; + if (options.defaults) + object.modelFormat = ""; + if (message.gcsDestination != null && message.hasOwnProperty("gcsDestination")) { + object.gcsDestination = $root.google.cloud.automl.v1.GcsDestination.toObject(message.gcsDestination, options); + if (options.oneofs) + object.destination = "gcsDestination"; + } + var keys2; + if (message.params && (keys2 = Object.keys(message.params)).length) { + object.params = {}; + for (var j = 0; j < keys2.length; ++j) + object.params[keys2[j]] = message.params[keys2[j]]; + } + if (message.modelFormat != null && message.hasOwnProperty("modelFormat")) + object.modelFormat = message.modelFormat; + return object; + }; + + /** + * Converts this ModelExportOutputConfig to JSON. + * @function toJSON + * @memberof google.cloud.automl.v1.ModelExportOutputConfig + * @instance + * @returns {Object.} JSON object + */ + ModelExportOutputConfig.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ModelExportOutputConfig + * @function getTypeUrl + * @memberof google.cloud.automl.v1.ModelExportOutputConfig + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ModelExportOutputConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.automl.v1.ModelExportOutputConfig"; + }; + + return ModelExportOutputConfig; + })(); + + v1.GcsSource = (function() { + + /** + * Properties of a GcsSource. + * @memberof google.cloud.automl.v1 + * @interface IGcsSource + * @property {Array.|null} [inputUris] GcsSource inputUris + */ + + /** + * Constructs a new GcsSource. + * @memberof google.cloud.automl.v1 + * @classdesc Represents a GcsSource. + * @implements IGcsSource + * @constructor + * @param {google.cloud.automl.v1.IGcsSource=} [properties] Properties to set + */ + function GcsSource(properties) { + this.inputUris = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GcsSource inputUris. + * @member {Array.} inputUris + * @memberof google.cloud.automl.v1.GcsSource + * @instance + */ + GcsSource.prototype.inputUris = $util.emptyArray; + + /** + * Creates a new GcsSource instance using the specified properties. + * @function create + * @memberof google.cloud.automl.v1.GcsSource + * @static + * @param {google.cloud.automl.v1.IGcsSource=} [properties] Properties to set + * @returns {google.cloud.automl.v1.GcsSource} GcsSource instance + */ + GcsSource.create = function create(properties) { + return new GcsSource(properties); + }; + + /** + * Encodes the specified GcsSource message. Does not implicitly {@link google.cloud.automl.v1.GcsSource.verify|verify} messages. + * @function encode + * @memberof google.cloud.automl.v1.GcsSource + * @static + * @param {google.cloud.automl.v1.IGcsSource} message GcsSource message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GcsSource.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.inputUris != null && message.inputUris.length) + for (var i = 0; i < message.inputUris.length; ++i) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.inputUris[i]); + return writer; + }; + + /** + * Encodes the specified GcsSource message, length delimited. Does not implicitly {@link google.cloud.automl.v1.GcsSource.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.automl.v1.GcsSource + * @static + * @param {google.cloud.automl.v1.IGcsSource} message GcsSource message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GcsSource.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GcsSource message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.automl.v1.GcsSource + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.automl.v1.GcsSource} GcsSource + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GcsSource.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.automl.v1.GcsSource(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.inputUris && message.inputUris.length)) + message.inputUris = []; + message.inputUris.push(reader.string()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GcsSource message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.automl.v1.GcsSource + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.automl.v1.GcsSource} GcsSource + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GcsSource.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GcsSource message. + * @function verify + * @memberof google.cloud.automl.v1.GcsSource + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GcsSource.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.inputUris != null && message.hasOwnProperty("inputUris")) { + if (!Array.isArray(message.inputUris)) + return "inputUris: array expected"; + for (var i = 0; i < message.inputUris.length; ++i) + if (!$util.isString(message.inputUris[i])) + return "inputUris: string[] expected"; + } + return null; + }; + + /** + * Creates a GcsSource message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.automl.v1.GcsSource + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.automl.v1.GcsSource} GcsSource + */ + GcsSource.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.automl.v1.GcsSource) + return object; + var message = new $root.google.cloud.automl.v1.GcsSource(); + if (object.inputUris) { + if (!Array.isArray(object.inputUris)) + throw TypeError(".google.cloud.automl.v1.GcsSource.inputUris: array expected"); + message.inputUris = []; + for (var i = 0; i < object.inputUris.length; ++i) + message.inputUris[i] = String(object.inputUris[i]); + } + return message; + }; + + /** + * Creates a plain object from a GcsSource message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.automl.v1.GcsSource + * @static + * @param {google.cloud.automl.v1.GcsSource} message GcsSource + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GcsSource.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.inputUris = []; + if (message.inputUris && message.inputUris.length) { + object.inputUris = []; + for (var j = 0; j < message.inputUris.length; ++j) + object.inputUris[j] = message.inputUris[j]; + } + return object; + }; + + /** + * Converts this GcsSource to JSON. + * @function toJSON + * @memberof google.cloud.automl.v1.GcsSource + * @instance + * @returns {Object.} JSON object + */ + GcsSource.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GcsSource + * @function getTypeUrl + * @memberof google.cloud.automl.v1.GcsSource + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GcsSource.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.automl.v1.GcsSource"; + }; + + return GcsSource; + })(); + + v1.GcsDestination = (function() { + + /** + * Properties of a GcsDestination. + * @memberof google.cloud.automl.v1 + * @interface IGcsDestination + * @property {string|null} [outputUriPrefix] GcsDestination outputUriPrefix + */ + + /** + * Constructs a new GcsDestination. + * @memberof google.cloud.automl.v1 + * @classdesc Represents a GcsDestination. + * @implements IGcsDestination + * @constructor + * @param {google.cloud.automl.v1.IGcsDestination=} [properties] Properties to set + */ + function GcsDestination(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GcsDestination outputUriPrefix. + * @member {string} outputUriPrefix + * @memberof google.cloud.automl.v1.GcsDestination + * @instance + */ + GcsDestination.prototype.outputUriPrefix = ""; + + /** + * Creates a new GcsDestination instance using the specified properties. + * @function create + * @memberof google.cloud.automl.v1.GcsDestination + * @static + * @param {google.cloud.automl.v1.IGcsDestination=} [properties] Properties to set + * @returns {google.cloud.automl.v1.GcsDestination} GcsDestination instance + */ + GcsDestination.create = function create(properties) { + return new GcsDestination(properties); + }; + + /** + * Encodes the specified GcsDestination message. Does not implicitly {@link google.cloud.automl.v1.GcsDestination.verify|verify} messages. + * @function encode + * @memberof google.cloud.automl.v1.GcsDestination + * @static + * @param {google.cloud.automl.v1.IGcsDestination} message GcsDestination message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GcsDestination.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.outputUriPrefix != null && Object.hasOwnProperty.call(message, "outputUriPrefix")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.outputUriPrefix); + return writer; + }; + + /** + * Encodes the specified GcsDestination message, length delimited. Does not implicitly {@link google.cloud.automl.v1.GcsDestination.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.automl.v1.GcsDestination + * @static + * @param {google.cloud.automl.v1.IGcsDestination} message GcsDestination message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GcsDestination.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GcsDestination message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.automl.v1.GcsDestination + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.automl.v1.GcsDestination} GcsDestination + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GcsDestination.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.automl.v1.GcsDestination(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.outputUriPrefix = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GcsDestination message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.automl.v1.GcsDestination + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.automl.v1.GcsDestination} GcsDestination + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GcsDestination.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GcsDestination message. + * @function verify + * @memberof google.cloud.automl.v1.GcsDestination + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GcsDestination.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.outputUriPrefix != null && message.hasOwnProperty("outputUriPrefix")) + if (!$util.isString(message.outputUriPrefix)) + return "outputUriPrefix: string expected"; + return null; + }; + + /** + * Creates a GcsDestination message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.automl.v1.GcsDestination + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.automl.v1.GcsDestination} GcsDestination + */ + GcsDestination.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.automl.v1.GcsDestination) + return object; + var message = new $root.google.cloud.automl.v1.GcsDestination(); + if (object.outputUriPrefix != null) + message.outputUriPrefix = String(object.outputUriPrefix); + return message; + }; + + /** + * Creates a plain object from a GcsDestination message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.automl.v1.GcsDestination + * @static + * @param {google.cloud.automl.v1.GcsDestination} message GcsDestination + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GcsDestination.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.outputUriPrefix = ""; + if (message.outputUriPrefix != null && message.hasOwnProperty("outputUriPrefix")) + object.outputUriPrefix = message.outputUriPrefix; + return object; + }; + + /** + * Converts this GcsDestination to JSON. + * @function toJSON + * @memberof google.cloud.automl.v1.GcsDestination + * @instance + * @returns {Object.} JSON object + */ + GcsDestination.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GcsDestination + * @function getTypeUrl + * @memberof google.cloud.automl.v1.GcsDestination + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GcsDestination.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.automl.v1.GcsDestination"; + }; + + return GcsDestination; + })(); + + v1.AnnotationSpec = (function() { + + /** + * Properties of an AnnotationSpec. + * @memberof google.cloud.automl.v1 + * @interface IAnnotationSpec + * @property {string|null} [name] AnnotationSpec name + * @property {string|null} [displayName] AnnotationSpec displayName + * @property {number|null} [exampleCount] AnnotationSpec exampleCount + */ + + /** + * Constructs a new AnnotationSpec. + * @memberof google.cloud.automl.v1 + * @classdesc Represents an AnnotationSpec. + * @implements IAnnotationSpec + * @constructor + * @param {google.cloud.automl.v1.IAnnotationSpec=} [properties] Properties to set + */ + function AnnotationSpec(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * AnnotationSpec name. + * @member {string} name + * @memberof google.cloud.automl.v1.AnnotationSpec + * @instance + */ + AnnotationSpec.prototype.name = ""; + + /** + * AnnotationSpec displayName. + * @member {string} displayName + * @memberof google.cloud.automl.v1.AnnotationSpec + * @instance + */ + AnnotationSpec.prototype.displayName = ""; + + /** + * AnnotationSpec exampleCount. + * @member {number} exampleCount + * @memberof google.cloud.automl.v1.AnnotationSpec + * @instance + */ + AnnotationSpec.prototype.exampleCount = 0; + + /** + * Creates a new AnnotationSpec instance using the specified properties. + * @function create + * @memberof google.cloud.automl.v1.AnnotationSpec + * @static + * @param {google.cloud.automl.v1.IAnnotationSpec=} [properties] Properties to set + * @returns {google.cloud.automl.v1.AnnotationSpec} AnnotationSpec instance + */ + AnnotationSpec.create = function create(properties) { + return new AnnotationSpec(properties); + }; + + /** + * Encodes the specified AnnotationSpec message. Does not implicitly {@link google.cloud.automl.v1.AnnotationSpec.verify|verify} messages. + * @function encode + * @memberof google.cloud.automl.v1.AnnotationSpec + * @static + * @param {google.cloud.automl.v1.IAnnotationSpec} message AnnotationSpec message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AnnotationSpec.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.displayName != null && Object.hasOwnProperty.call(message, "displayName")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.displayName); + if (message.exampleCount != null && Object.hasOwnProperty.call(message, "exampleCount")) + writer.uint32(/* id 9, wireType 0 =*/72).int32(message.exampleCount); + return writer; + }; + + /** + * Encodes the specified AnnotationSpec message, length delimited. Does not implicitly {@link google.cloud.automl.v1.AnnotationSpec.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.automl.v1.AnnotationSpec + * @static + * @param {google.cloud.automl.v1.IAnnotationSpec} message AnnotationSpec message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AnnotationSpec.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an AnnotationSpec message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.automl.v1.AnnotationSpec + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.automl.v1.AnnotationSpec} AnnotationSpec + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AnnotationSpec.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.automl.v1.AnnotationSpec(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.displayName = reader.string(); + break; + } + case 9: { + message.exampleCount = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an AnnotationSpec message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.automl.v1.AnnotationSpec + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.automl.v1.AnnotationSpec} AnnotationSpec + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AnnotationSpec.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an AnnotationSpec message. + * @function verify + * @memberof google.cloud.automl.v1.AnnotationSpec + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + AnnotationSpec.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.displayName != null && message.hasOwnProperty("displayName")) + if (!$util.isString(message.displayName)) + return "displayName: string expected"; + if (message.exampleCount != null && message.hasOwnProperty("exampleCount")) + if (!$util.isInteger(message.exampleCount)) + return "exampleCount: integer expected"; + return null; + }; + + /** + * Creates an AnnotationSpec message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.automl.v1.AnnotationSpec + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.automl.v1.AnnotationSpec} AnnotationSpec + */ + AnnotationSpec.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.automl.v1.AnnotationSpec) + return object; + var message = new $root.google.cloud.automl.v1.AnnotationSpec(); + if (object.name != null) + message.name = String(object.name); + if (object.displayName != null) + message.displayName = String(object.displayName); + if (object.exampleCount != null) + message.exampleCount = object.exampleCount | 0; + return message; + }; + + /** + * Creates a plain object from an AnnotationSpec message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.automl.v1.AnnotationSpec + * @static + * @param {google.cloud.automl.v1.AnnotationSpec} message AnnotationSpec + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + AnnotationSpec.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.displayName = ""; + object.exampleCount = 0; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.displayName != null && message.hasOwnProperty("displayName")) + object.displayName = message.displayName; + if (message.exampleCount != null && message.hasOwnProperty("exampleCount")) + object.exampleCount = message.exampleCount; + return object; + }; + + /** + * Converts this AnnotationSpec to JSON. + * @function toJSON + * @memberof google.cloud.automl.v1.AnnotationSpec + * @instance + * @returns {Object.} JSON object + */ + AnnotationSpec.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for AnnotationSpec + * @function getTypeUrl + * @memberof google.cloud.automl.v1.AnnotationSpec + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + AnnotationSpec.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.automl.v1.AnnotationSpec"; + }; + + return AnnotationSpec; + })(); + + v1.Dataset = (function() { + + /** + * Properties of a Dataset. + * @memberof google.cloud.automl.v1 + * @interface IDataset + * @property {google.cloud.automl.v1.ITranslationDatasetMetadata|null} [translationDatasetMetadata] Dataset translationDatasetMetadata + * @property {google.cloud.automl.v1.IImageClassificationDatasetMetadata|null} [imageClassificationDatasetMetadata] Dataset imageClassificationDatasetMetadata + * @property {google.cloud.automl.v1.ITextClassificationDatasetMetadata|null} [textClassificationDatasetMetadata] Dataset textClassificationDatasetMetadata + * @property {google.cloud.automl.v1.IImageObjectDetectionDatasetMetadata|null} [imageObjectDetectionDatasetMetadata] Dataset imageObjectDetectionDatasetMetadata + * @property {google.cloud.automl.v1.ITextExtractionDatasetMetadata|null} [textExtractionDatasetMetadata] Dataset textExtractionDatasetMetadata + * @property {google.cloud.automl.v1.ITextSentimentDatasetMetadata|null} [textSentimentDatasetMetadata] Dataset textSentimentDatasetMetadata + * @property {string|null} [name] Dataset name + * @property {string|null} [displayName] Dataset displayName + * @property {string|null} [description] Dataset description + * @property {number|null} [exampleCount] Dataset exampleCount + * @property {google.protobuf.ITimestamp|null} [createTime] Dataset createTime + * @property {string|null} [etag] Dataset etag + * @property {Object.|null} [labels] Dataset labels + */ + + /** + * Constructs a new Dataset. + * @memberof google.cloud.automl.v1 + * @classdesc Represents a Dataset. + * @implements IDataset + * @constructor + * @param {google.cloud.automl.v1.IDataset=} [properties] Properties to set + */ + function Dataset(properties) { + this.labels = {}; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Dataset translationDatasetMetadata. + * @member {google.cloud.automl.v1.ITranslationDatasetMetadata|null|undefined} translationDatasetMetadata + * @memberof google.cloud.automl.v1.Dataset + * @instance + */ + Dataset.prototype.translationDatasetMetadata = null; + + /** + * Dataset imageClassificationDatasetMetadata. + * @member {google.cloud.automl.v1.IImageClassificationDatasetMetadata|null|undefined} imageClassificationDatasetMetadata + * @memberof google.cloud.automl.v1.Dataset + * @instance + */ + Dataset.prototype.imageClassificationDatasetMetadata = null; + + /** + * Dataset textClassificationDatasetMetadata. + * @member {google.cloud.automl.v1.ITextClassificationDatasetMetadata|null|undefined} textClassificationDatasetMetadata + * @memberof google.cloud.automl.v1.Dataset + * @instance + */ + Dataset.prototype.textClassificationDatasetMetadata = null; + + /** + * Dataset imageObjectDetectionDatasetMetadata. + * @member {google.cloud.automl.v1.IImageObjectDetectionDatasetMetadata|null|undefined} imageObjectDetectionDatasetMetadata + * @memberof google.cloud.automl.v1.Dataset + * @instance + */ + Dataset.prototype.imageObjectDetectionDatasetMetadata = null; + + /** + * Dataset textExtractionDatasetMetadata. + * @member {google.cloud.automl.v1.ITextExtractionDatasetMetadata|null|undefined} textExtractionDatasetMetadata + * @memberof google.cloud.automl.v1.Dataset + * @instance + */ + Dataset.prototype.textExtractionDatasetMetadata = null; + + /** + * Dataset textSentimentDatasetMetadata. + * @member {google.cloud.automl.v1.ITextSentimentDatasetMetadata|null|undefined} textSentimentDatasetMetadata + * @memberof google.cloud.automl.v1.Dataset + * @instance + */ + Dataset.prototype.textSentimentDatasetMetadata = null; + + /** + * Dataset name. + * @member {string} name + * @memberof google.cloud.automl.v1.Dataset + * @instance + */ + Dataset.prototype.name = ""; + + /** + * Dataset displayName. + * @member {string} displayName + * @memberof google.cloud.automl.v1.Dataset + * @instance + */ + Dataset.prototype.displayName = ""; + + /** + * Dataset description. + * @member {string} description + * @memberof google.cloud.automl.v1.Dataset + * @instance + */ + Dataset.prototype.description = ""; + + /** + * Dataset exampleCount. + * @member {number} exampleCount + * @memberof google.cloud.automl.v1.Dataset + * @instance + */ + Dataset.prototype.exampleCount = 0; + + /** + * Dataset createTime. + * @member {google.protobuf.ITimestamp|null|undefined} createTime + * @memberof google.cloud.automl.v1.Dataset + * @instance + */ + Dataset.prototype.createTime = null; + + /** + * Dataset etag. + * @member {string} etag + * @memberof google.cloud.automl.v1.Dataset + * @instance + */ + Dataset.prototype.etag = ""; + + /** + * Dataset labels. + * @member {Object.} labels + * @memberof google.cloud.automl.v1.Dataset + * @instance + */ + Dataset.prototype.labels = $util.emptyObject; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * Dataset datasetMetadata. + * @member {"translationDatasetMetadata"|"imageClassificationDatasetMetadata"|"textClassificationDatasetMetadata"|"imageObjectDetectionDatasetMetadata"|"textExtractionDatasetMetadata"|"textSentimentDatasetMetadata"|undefined} datasetMetadata + * @memberof google.cloud.automl.v1.Dataset + * @instance + */ + Object.defineProperty(Dataset.prototype, "datasetMetadata", { + get: $util.oneOfGetter($oneOfFields = ["translationDatasetMetadata", "imageClassificationDatasetMetadata", "textClassificationDatasetMetadata", "imageObjectDetectionDatasetMetadata", "textExtractionDatasetMetadata", "textSentimentDatasetMetadata"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new Dataset instance using the specified properties. + * @function create + * @memberof google.cloud.automl.v1.Dataset + * @static + * @param {google.cloud.automl.v1.IDataset=} [properties] Properties to set + * @returns {google.cloud.automl.v1.Dataset} Dataset instance + */ + Dataset.create = function create(properties) { + return new Dataset(properties); + }; + + /** + * Encodes the specified Dataset message. Does not implicitly {@link google.cloud.automl.v1.Dataset.verify|verify} messages. + * @function encode + * @memberof google.cloud.automl.v1.Dataset + * @static + * @param {google.cloud.automl.v1.IDataset} message Dataset message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Dataset.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.displayName != null && Object.hasOwnProperty.call(message, "displayName")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.displayName); + if (message.description != null && Object.hasOwnProperty.call(message, "description")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.description); + if (message.createTime != null && Object.hasOwnProperty.call(message, "createTime")) + $root.google.protobuf.Timestamp.encode(message.createTime, writer.uint32(/* id 14, wireType 2 =*/114).fork()).ldelim(); + if (message.etag != null && Object.hasOwnProperty.call(message, "etag")) + writer.uint32(/* id 17, wireType 2 =*/138).string(message.etag); + if (message.exampleCount != null && Object.hasOwnProperty.call(message, "exampleCount")) + writer.uint32(/* id 21, wireType 0 =*/168).int32(message.exampleCount); + if (message.translationDatasetMetadata != null && Object.hasOwnProperty.call(message, "translationDatasetMetadata")) + $root.google.cloud.automl.v1.TranslationDatasetMetadata.encode(message.translationDatasetMetadata, writer.uint32(/* id 23, wireType 2 =*/186).fork()).ldelim(); + if (message.imageClassificationDatasetMetadata != null && Object.hasOwnProperty.call(message, "imageClassificationDatasetMetadata")) + $root.google.cloud.automl.v1.ImageClassificationDatasetMetadata.encode(message.imageClassificationDatasetMetadata, writer.uint32(/* id 24, wireType 2 =*/194).fork()).ldelim(); + if (message.textClassificationDatasetMetadata != null && Object.hasOwnProperty.call(message, "textClassificationDatasetMetadata")) + $root.google.cloud.automl.v1.TextClassificationDatasetMetadata.encode(message.textClassificationDatasetMetadata, writer.uint32(/* id 25, wireType 2 =*/202).fork()).ldelim(); + if (message.imageObjectDetectionDatasetMetadata != null && Object.hasOwnProperty.call(message, "imageObjectDetectionDatasetMetadata")) + $root.google.cloud.automl.v1.ImageObjectDetectionDatasetMetadata.encode(message.imageObjectDetectionDatasetMetadata, writer.uint32(/* id 26, wireType 2 =*/210).fork()).ldelim(); + if (message.textExtractionDatasetMetadata != null && Object.hasOwnProperty.call(message, "textExtractionDatasetMetadata")) + $root.google.cloud.automl.v1.TextExtractionDatasetMetadata.encode(message.textExtractionDatasetMetadata, writer.uint32(/* id 28, wireType 2 =*/226).fork()).ldelim(); + if (message.textSentimentDatasetMetadata != null && Object.hasOwnProperty.call(message, "textSentimentDatasetMetadata")) + $root.google.cloud.automl.v1.TextSentimentDatasetMetadata.encode(message.textSentimentDatasetMetadata, writer.uint32(/* id 30, wireType 2 =*/242).fork()).ldelim(); + if (message.labels != null && Object.hasOwnProperty.call(message, "labels")) + for (var keys = Object.keys(message.labels), i = 0; i < keys.length; ++i) + writer.uint32(/* id 39, wireType 2 =*/314).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.labels[keys[i]]).ldelim(); + return writer; + }; + + /** + * Encodes the specified Dataset message, length delimited. Does not implicitly {@link google.cloud.automl.v1.Dataset.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.automl.v1.Dataset + * @static + * @param {google.cloud.automl.v1.IDataset} message Dataset message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Dataset.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Dataset message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.automl.v1.Dataset + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.automl.v1.Dataset} Dataset + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Dataset.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.automl.v1.Dataset(), key, value; + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 23: { + message.translationDatasetMetadata = $root.google.cloud.automl.v1.TranslationDatasetMetadata.decode(reader, reader.uint32()); + break; + } + case 24: { + message.imageClassificationDatasetMetadata = $root.google.cloud.automl.v1.ImageClassificationDatasetMetadata.decode(reader, reader.uint32()); + break; + } + case 25: { + message.textClassificationDatasetMetadata = $root.google.cloud.automl.v1.TextClassificationDatasetMetadata.decode(reader, reader.uint32()); + break; + } + case 26: { + message.imageObjectDetectionDatasetMetadata = $root.google.cloud.automl.v1.ImageObjectDetectionDatasetMetadata.decode(reader, reader.uint32()); + break; + } + case 28: { + message.textExtractionDatasetMetadata = $root.google.cloud.automl.v1.TextExtractionDatasetMetadata.decode(reader, reader.uint32()); + break; + } + case 30: { + message.textSentimentDatasetMetadata = $root.google.cloud.automl.v1.TextSentimentDatasetMetadata.decode(reader, reader.uint32()); + break; + } + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.displayName = reader.string(); + break; + } + case 3: { + message.description = reader.string(); + break; + } + case 21: { + message.exampleCount = reader.int32(); + break; + } + case 14: { + message.createTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 17: { + message.etag = reader.string(); + break; + } + case 39: { + if (message.labels === $util.emptyObject) + message.labels = {}; + 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.labels[key] = value; + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Dataset message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.automl.v1.Dataset + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.automl.v1.Dataset} Dataset + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Dataset.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Dataset message. + * @function verify + * @memberof google.cloud.automl.v1.Dataset + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Dataset.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.translationDatasetMetadata != null && message.hasOwnProperty("translationDatasetMetadata")) { + properties.datasetMetadata = 1; + { + var error = $root.google.cloud.automl.v1.TranslationDatasetMetadata.verify(message.translationDatasetMetadata); + if (error) + return "translationDatasetMetadata." + error; + } + } + if (message.imageClassificationDatasetMetadata != null && message.hasOwnProperty("imageClassificationDatasetMetadata")) { + if (properties.datasetMetadata === 1) + return "datasetMetadata: multiple values"; + properties.datasetMetadata = 1; + { + var error = $root.google.cloud.automl.v1.ImageClassificationDatasetMetadata.verify(message.imageClassificationDatasetMetadata); + if (error) + return "imageClassificationDatasetMetadata." + error; + } + } + if (message.textClassificationDatasetMetadata != null && message.hasOwnProperty("textClassificationDatasetMetadata")) { + if (properties.datasetMetadata === 1) + return "datasetMetadata: multiple values"; + properties.datasetMetadata = 1; + { + var error = $root.google.cloud.automl.v1.TextClassificationDatasetMetadata.verify(message.textClassificationDatasetMetadata); + if (error) + return "textClassificationDatasetMetadata." + error; + } + } + if (message.imageObjectDetectionDatasetMetadata != null && message.hasOwnProperty("imageObjectDetectionDatasetMetadata")) { + if (properties.datasetMetadata === 1) + return "datasetMetadata: multiple values"; + properties.datasetMetadata = 1; + { + var error = $root.google.cloud.automl.v1.ImageObjectDetectionDatasetMetadata.verify(message.imageObjectDetectionDatasetMetadata); + if (error) + return "imageObjectDetectionDatasetMetadata." + error; + } + } + if (message.textExtractionDatasetMetadata != null && message.hasOwnProperty("textExtractionDatasetMetadata")) { + if (properties.datasetMetadata === 1) + return "datasetMetadata: multiple values"; + properties.datasetMetadata = 1; + { + var error = $root.google.cloud.automl.v1.TextExtractionDatasetMetadata.verify(message.textExtractionDatasetMetadata); + if (error) + return "textExtractionDatasetMetadata." + error; + } + } + if (message.textSentimentDatasetMetadata != null && message.hasOwnProperty("textSentimentDatasetMetadata")) { + if (properties.datasetMetadata === 1) + return "datasetMetadata: multiple values"; + properties.datasetMetadata = 1; + { + var error = $root.google.cloud.automl.v1.TextSentimentDatasetMetadata.verify(message.textSentimentDatasetMetadata); + if (error) + return "textSentimentDatasetMetadata." + error; + } + } + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.displayName != null && message.hasOwnProperty("displayName")) + if (!$util.isString(message.displayName)) + return "displayName: string expected"; + if (message.description != null && message.hasOwnProperty("description")) + if (!$util.isString(message.description)) + return "description: string expected"; + if (message.exampleCount != null && message.hasOwnProperty("exampleCount")) + if (!$util.isInteger(message.exampleCount)) + return "exampleCount: integer expected"; + if (message.createTime != null && message.hasOwnProperty("createTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.createTime); + if (error) + return "createTime." + error; + } + if (message.etag != null && message.hasOwnProperty("etag")) + if (!$util.isString(message.etag)) + return "etag: string expected"; + if (message.labels != null && message.hasOwnProperty("labels")) { + if (!$util.isObject(message.labels)) + return "labels: object expected"; + var key = Object.keys(message.labels); + for (var i = 0; i < key.length; ++i) + if (!$util.isString(message.labels[key[i]])) + return "labels: string{k:string} expected"; + } + return null; + }; + + /** + * Creates a Dataset message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.automl.v1.Dataset + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.automl.v1.Dataset} Dataset + */ + Dataset.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.automl.v1.Dataset) + return object; + var message = new $root.google.cloud.automl.v1.Dataset(); + if (object.translationDatasetMetadata != null) { + if (typeof object.translationDatasetMetadata !== "object") + throw TypeError(".google.cloud.automl.v1.Dataset.translationDatasetMetadata: object expected"); + message.translationDatasetMetadata = $root.google.cloud.automl.v1.TranslationDatasetMetadata.fromObject(object.translationDatasetMetadata); + } + if (object.imageClassificationDatasetMetadata != null) { + if (typeof object.imageClassificationDatasetMetadata !== "object") + throw TypeError(".google.cloud.automl.v1.Dataset.imageClassificationDatasetMetadata: object expected"); + message.imageClassificationDatasetMetadata = $root.google.cloud.automl.v1.ImageClassificationDatasetMetadata.fromObject(object.imageClassificationDatasetMetadata); + } + if (object.textClassificationDatasetMetadata != null) { + if (typeof object.textClassificationDatasetMetadata !== "object") + throw TypeError(".google.cloud.automl.v1.Dataset.textClassificationDatasetMetadata: object expected"); + message.textClassificationDatasetMetadata = $root.google.cloud.automl.v1.TextClassificationDatasetMetadata.fromObject(object.textClassificationDatasetMetadata); + } + if (object.imageObjectDetectionDatasetMetadata != null) { + if (typeof object.imageObjectDetectionDatasetMetadata !== "object") + throw TypeError(".google.cloud.automl.v1.Dataset.imageObjectDetectionDatasetMetadata: object expected"); + message.imageObjectDetectionDatasetMetadata = $root.google.cloud.automl.v1.ImageObjectDetectionDatasetMetadata.fromObject(object.imageObjectDetectionDatasetMetadata); + } + if (object.textExtractionDatasetMetadata != null) { + if (typeof object.textExtractionDatasetMetadata !== "object") + throw TypeError(".google.cloud.automl.v1.Dataset.textExtractionDatasetMetadata: object expected"); + message.textExtractionDatasetMetadata = $root.google.cloud.automl.v1.TextExtractionDatasetMetadata.fromObject(object.textExtractionDatasetMetadata); + } + if (object.textSentimentDatasetMetadata != null) { + if (typeof object.textSentimentDatasetMetadata !== "object") + throw TypeError(".google.cloud.automl.v1.Dataset.textSentimentDatasetMetadata: object expected"); + message.textSentimentDatasetMetadata = $root.google.cloud.automl.v1.TextSentimentDatasetMetadata.fromObject(object.textSentimentDatasetMetadata); + } + if (object.name != null) + message.name = String(object.name); + if (object.displayName != null) + message.displayName = String(object.displayName); + if (object.description != null) + message.description = String(object.description); + if (object.exampleCount != null) + message.exampleCount = object.exampleCount | 0; + if (object.createTime != null) { + if (typeof object.createTime !== "object") + throw TypeError(".google.cloud.automl.v1.Dataset.createTime: object expected"); + message.createTime = $root.google.protobuf.Timestamp.fromObject(object.createTime); + } + if (object.etag != null) + message.etag = String(object.etag); + if (object.labels) { + if (typeof object.labels !== "object") + throw TypeError(".google.cloud.automl.v1.Dataset.labels: object expected"); + message.labels = {}; + for (var keys = Object.keys(object.labels), i = 0; i < keys.length; ++i) + message.labels[keys[i]] = String(object.labels[keys[i]]); + } + return message; + }; + + /** + * Creates a plain object from a Dataset message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.automl.v1.Dataset + * @static + * @param {google.cloud.automl.v1.Dataset} message Dataset + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Dataset.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.objects || options.defaults) + object.labels = {}; + if (options.defaults) { + object.name = ""; + object.displayName = ""; + object.description = ""; + object.createTime = null; + object.etag = ""; + object.exampleCount = 0; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.displayName != null && message.hasOwnProperty("displayName")) + object.displayName = message.displayName; + if (message.description != null && message.hasOwnProperty("description")) + object.description = message.description; + if (message.createTime != null && message.hasOwnProperty("createTime")) + object.createTime = $root.google.protobuf.Timestamp.toObject(message.createTime, options); + if (message.etag != null && message.hasOwnProperty("etag")) + object.etag = message.etag; + if (message.exampleCount != null && message.hasOwnProperty("exampleCount")) + object.exampleCount = message.exampleCount; + if (message.translationDatasetMetadata != null && message.hasOwnProperty("translationDatasetMetadata")) { + object.translationDatasetMetadata = $root.google.cloud.automl.v1.TranslationDatasetMetadata.toObject(message.translationDatasetMetadata, options); + if (options.oneofs) + object.datasetMetadata = "translationDatasetMetadata"; + } + if (message.imageClassificationDatasetMetadata != null && message.hasOwnProperty("imageClassificationDatasetMetadata")) { + object.imageClassificationDatasetMetadata = $root.google.cloud.automl.v1.ImageClassificationDatasetMetadata.toObject(message.imageClassificationDatasetMetadata, options); + if (options.oneofs) + object.datasetMetadata = "imageClassificationDatasetMetadata"; + } + if (message.textClassificationDatasetMetadata != null && message.hasOwnProperty("textClassificationDatasetMetadata")) { + object.textClassificationDatasetMetadata = $root.google.cloud.automl.v1.TextClassificationDatasetMetadata.toObject(message.textClassificationDatasetMetadata, options); + if (options.oneofs) + object.datasetMetadata = "textClassificationDatasetMetadata"; + } + if (message.imageObjectDetectionDatasetMetadata != null && message.hasOwnProperty("imageObjectDetectionDatasetMetadata")) { + object.imageObjectDetectionDatasetMetadata = $root.google.cloud.automl.v1.ImageObjectDetectionDatasetMetadata.toObject(message.imageObjectDetectionDatasetMetadata, options); + if (options.oneofs) + object.datasetMetadata = "imageObjectDetectionDatasetMetadata"; + } + if (message.textExtractionDatasetMetadata != null && message.hasOwnProperty("textExtractionDatasetMetadata")) { + object.textExtractionDatasetMetadata = $root.google.cloud.automl.v1.TextExtractionDatasetMetadata.toObject(message.textExtractionDatasetMetadata, options); + if (options.oneofs) + object.datasetMetadata = "textExtractionDatasetMetadata"; + } + if (message.textSentimentDatasetMetadata != null && message.hasOwnProperty("textSentimentDatasetMetadata")) { + object.textSentimentDatasetMetadata = $root.google.cloud.automl.v1.TextSentimentDatasetMetadata.toObject(message.textSentimentDatasetMetadata, options); + if (options.oneofs) + object.datasetMetadata = "textSentimentDatasetMetadata"; + } + var keys2; + if (message.labels && (keys2 = Object.keys(message.labels)).length) { + object.labels = {}; + for (var j = 0; j < keys2.length; ++j) + object.labels[keys2[j]] = message.labels[keys2[j]]; + } + return object; + }; + + /** + * Converts this Dataset to JSON. + * @function toJSON + * @memberof google.cloud.automl.v1.Dataset + * @instance + * @returns {Object.} JSON object + */ + Dataset.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Dataset + * @function getTypeUrl + * @memberof google.cloud.automl.v1.Dataset + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Dataset.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.automl.v1.Dataset"; + }; + + return Dataset; + })(); + + v1.ImageClassificationDatasetMetadata = (function() { + + /** + * Properties of an ImageClassificationDatasetMetadata. + * @memberof google.cloud.automl.v1 + * @interface IImageClassificationDatasetMetadata + * @property {google.cloud.automl.v1.ClassificationType|null} [classificationType] ImageClassificationDatasetMetadata classificationType + */ + + /** + * Constructs a new ImageClassificationDatasetMetadata. + * @memberof google.cloud.automl.v1 + * @classdesc Represents an ImageClassificationDatasetMetadata. + * @implements IImageClassificationDatasetMetadata + * @constructor + * @param {google.cloud.automl.v1.IImageClassificationDatasetMetadata=} [properties] Properties to set + */ + function ImageClassificationDatasetMetadata(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ImageClassificationDatasetMetadata classificationType. + * @member {google.cloud.automl.v1.ClassificationType} classificationType + * @memberof google.cloud.automl.v1.ImageClassificationDatasetMetadata + * @instance + */ + ImageClassificationDatasetMetadata.prototype.classificationType = 0; + + /** + * Creates a new ImageClassificationDatasetMetadata instance using the specified properties. + * @function create + * @memberof google.cloud.automl.v1.ImageClassificationDatasetMetadata + * @static + * @param {google.cloud.automl.v1.IImageClassificationDatasetMetadata=} [properties] Properties to set + * @returns {google.cloud.automl.v1.ImageClassificationDatasetMetadata} ImageClassificationDatasetMetadata instance + */ + ImageClassificationDatasetMetadata.create = function create(properties) { + return new ImageClassificationDatasetMetadata(properties); + }; + + /** + * Encodes the specified ImageClassificationDatasetMetadata message. Does not implicitly {@link google.cloud.automl.v1.ImageClassificationDatasetMetadata.verify|verify} messages. + * @function encode + * @memberof google.cloud.automl.v1.ImageClassificationDatasetMetadata + * @static + * @param {google.cloud.automl.v1.IImageClassificationDatasetMetadata} message ImageClassificationDatasetMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ImageClassificationDatasetMetadata.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.classificationType != null && Object.hasOwnProperty.call(message, "classificationType")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.classificationType); + return writer; + }; + + /** + * Encodes the specified ImageClassificationDatasetMetadata message, length delimited. Does not implicitly {@link google.cloud.automl.v1.ImageClassificationDatasetMetadata.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.automl.v1.ImageClassificationDatasetMetadata + * @static + * @param {google.cloud.automl.v1.IImageClassificationDatasetMetadata} message ImageClassificationDatasetMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ImageClassificationDatasetMetadata.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an ImageClassificationDatasetMetadata message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.automl.v1.ImageClassificationDatasetMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.automl.v1.ImageClassificationDatasetMetadata} ImageClassificationDatasetMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ImageClassificationDatasetMetadata.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.automl.v1.ImageClassificationDatasetMetadata(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.classificationType = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an ImageClassificationDatasetMetadata message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.automl.v1.ImageClassificationDatasetMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.automl.v1.ImageClassificationDatasetMetadata} ImageClassificationDatasetMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ImageClassificationDatasetMetadata.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an ImageClassificationDatasetMetadata message. + * @function verify + * @memberof google.cloud.automl.v1.ImageClassificationDatasetMetadata + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ImageClassificationDatasetMetadata.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.classificationType != null && message.hasOwnProperty("classificationType")) + switch (message.classificationType) { + default: + return "classificationType: enum value expected"; + case 0: + case 1: + case 2: + break; + } + return null; + }; + + /** + * Creates an ImageClassificationDatasetMetadata message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.automl.v1.ImageClassificationDatasetMetadata + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.automl.v1.ImageClassificationDatasetMetadata} ImageClassificationDatasetMetadata + */ + ImageClassificationDatasetMetadata.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.automl.v1.ImageClassificationDatasetMetadata) + return object; + var message = new $root.google.cloud.automl.v1.ImageClassificationDatasetMetadata(); + switch (object.classificationType) { + default: + if (typeof object.classificationType === "number") { + message.classificationType = object.classificationType; + break; + } + break; + case "CLASSIFICATION_TYPE_UNSPECIFIED": + case 0: + message.classificationType = 0; + break; + case "MULTICLASS": + case 1: + message.classificationType = 1; + break; + case "MULTILABEL": + case 2: + message.classificationType = 2; + break; + } + return message; + }; + + /** + * Creates a plain object from an ImageClassificationDatasetMetadata message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.automl.v1.ImageClassificationDatasetMetadata + * @static + * @param {google.cloud.automl.v1.ImageClassificationDatasetMetadata} message ImageClassificationDatasetMetadata + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ImageClassificationDatasetMetadata.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.classificationType = options.enums === String ? "CLASSIFICATION_TYPE_UNSPECIFIED" : 0; + if (message.classificationType != null && message.hasOwnProperty("classificationType")) + object.classificationType = options.enums === String ? $root.google.cloud.automl.v1.ClassificationType[message.classificationType] === undefined ? message.classificationType : $root.google.cloud.automl.v1.ClassificationType[message.classificationType] : message.classificationType; + return object; + }; + + /** + * Converts this ImageClassificationDatasetMetadata to JSON. + * @function toJSON + * @memberof google.cloud.automl.v1.ImageClassificationDatasetMetadata + * @instance + * @returns {Object.} JSON object + */ + ImageClassificationDatasetMetadata.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ImageClassificationDatasetMetadata + * @function getTypeUrl + * @memberof google.cloud.automl.v1.ImageClassificationDatasetMetadata + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ImageClassificationDatasetMetadata.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.automl.v1.ImageClassificationDatasetMetadata"; + }; + + return ImageClassificationDatasetMetadata; + })(); + + v1.ImageObjectDetectionDatasetMetadata = (function() { + + /** + * Properties of an ImageObjectDetectionDatasetMetadata. + * @memberof google.cloud.automl.v1 + * @interface IImageObjectDetectionDatasetMetadata + */ + + /** + * Constructs a new ImageObjectDetectionDatasetMetadata. + * @memberof google.cloud.automl.v1 + * @classdesc Represents an ImageObjectDetectionDatasetMetadata. + * @implements IImageObjectDetectionDatasetMetadata + * @constructor + * @param {google.cloud.automl.v1.IImageObjectDetectionDatasetMetadata=} [properties] Properties to set + */ + function ImageObjectDetectionDatasetMetadata(properties) { + if (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 ImageObjectDetectionDatasetMetadata instance using the specified properties. + * @function create + * @memberof google.cloud.automl.v1.ImageObjectDetectionDatasetMetadata + * @static + * @param {google.cloud.automl.v1.IImageObjectDetectionDatasetMetadata=} [properties] Properties to set + * @returns {google.cloud.automl.v1.ImageObjectDetectionDatasetMetadata} ImageObjectDetectionDatasetMetadata instance + */ + ImageObjectDetectionDatasetMetadata.create = function create(properties) { + return new ImageObjectDetectionDatasetMetadata(properties); + }; + + /** + * Encodes the specified ImageObjectDetectionDatasetMetadata message. Does not implicitly {@link google.cloud.automl.v1.ImageObjectDetectionDatasetMetadata.verify|verify} messages. + * @function encode + * @memberof google.cloud.automl.v1.ImageObjectDetectionDatasetMetadata + * @static + * @param {google.cloud.automl.v1.IImageObjectDetectionDatasetMetadata} message ImageObjectDetectionDatasetMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ImageObjectDetectionDatasetMetadata.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + return writer; + }; + + /** + * Encodes the specified ImageObjectDetectionDatasetMetadata message, length delimited. Does not implicitly {@link google.cloud.automl.v1.ImageObjectDetectionDatasetMetadata.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.automl.v1.ImageObjectDetectionDatasetMetadata + * @static + * @param {google.cloud.automl.v1.IImageObjectDetectionDatasetMetadata} message ImageObjectDetectionDatasetMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ImageObjectDetectionDatasetMetadata.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an ImageObjectDetectionDatasetMetadata message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.automl.v1.ImageObjectDetectionDatasetMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.automl.v1.ImageObjectDetectionDatasetMetadata} ImageObjectDetectionDatasetMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ImageObjectDetectionDatasetMetadata.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.automl.v1.ImageObjectDetectionDatasetMetadata(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an ImageObjectDetectionDatasetMetadata message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.automl.v1.ImageObjectDetectionDatasetMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.automl.v1.ImageObjectDetectionDatasetMetadata} ImageObjectDetectionDatasetMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ImageObjectDetectionDatasetMetadata.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an ImageObjectDetectionDatasetMetadata message. + * @function verify + * @memberof google.cloud.automl.v1.ImageObjectDetectionDatasetMetadata + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ImageObjectDetectionDatasetMetadata.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + return null; + }; + + /** + * Creates an ImageObjectDetectionDatasetMetadata message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.automl.v1.ImageObjectDetectionDatasetMetadata + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.automl.v1.ImageObjectDetectionDatasetMetadata} ImageObjectDetectionDatasetMetadata + */ + ImageObjectDetectionDatasetMetadata.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.automl.v1.ImageObjectDetectionDatasetMetadata) + return object; + return new $root.google.cloud.automl.v1.ImageObjectDetectionDatasetMetadata(); + }; + + /** + * Creates a plain object from an ImageObjectDetectionDatasetMetadata message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.automl.v1.ImageObjectDetectionDatasetMetadata + * @static + * @param {google.cloud.automl.v1.ImageObjectDetectionDatasetMetadata} message ImageObjectDetectionDatasetMetadata + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ImageObjectDetectionDatasetMetadata.toObject = function toObject() { + return {}; + }; + + /** + * Converts this ImageObjectDetectionDatasetMetadata to JSON. + * @function toJSON + * @memberof google.cloud.automl.v1.ImageObjectDetectionDatasetMetadata + * @instance + * @returns {Object.} JSON object + */ + ImageObjectDetectionDatasetMetadata.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ImageObjectDetectionDatasetMetadata + * @function getTypeUrl + * @memberof google.cloud.automl.v1.ImageObjectDetectionDatasetMetadata + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ImageObjectDetectionDatasetMetadata.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.automl.v1.ImageObjectDetectionDatasetMetadata"; + }; + + return ImageObjectDetectionDatasetMetadata; + })(); + + v1.ImageClassificationModelMetadata = (function() { + + /** + * Properties of an ImageClassificationModelMetadata. + * @memberof google.cloud.automl.v1 + * @interface IImageClassificationModelMetadata + * @property {string|null} [baseModelId] ImageClassificationModelMetadata baseModelId + * @property {number|Long|null} [trainBudgetMilliNodeHours] ImageClassificationModelMetadata trainBudgetMilliNodeHours + * @property {number|Long|null} [trainCostMilliNodeHours] ImageClassificationModelMetadata trainCostMilliNodeHours + * @property {string|null} [stopReason] ImageClassificationModelMetadata stopReason + * @property {string|null} [modelType] ImageClassificationModelMetadata modelType + * @property {number|null} [nodeQps] ImageClassificationModelMetadata nodeQps + * @property {number|Long|null} [nodeCount] ImageClassificationModelMetadata nodeCount + */ + + /** + * Constructs a new ImageClassificationModelMetadata. + * @memberof google.cloud.automl.v1 + * @classdesc Represents an ImageClassificationModelMetadata. + * @implements IImageClassificationModelMetadata + * @constructor + * @param {google.cloud.automl.v1.IImageClassificationModelMetadata=} [properties] Properties to set + */ + function ImageClassificationModelMetadata(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ImageClassificationModelMetadata baseModelId. + * @member {string} baseModelId + * @memberof google.cloud.automl.v1.ImageClassificationModelMetadata + * @instance + */ + ImageClassificationModelMetadata.prototype.baseModelId = ""; + + /** + * ImageClassificationModelMetadata trainBudgetMilliNodeHours. + * @member {number|Long} trainBudgetMilliNodeHours + * @memberof google.cloud.automl.v1.ImageClassificationModelMetadata + * @instance + */ + ImageClassificationModelMetadata.prototype.trainBudgetMilliNodeHours = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * ImageClassificationModelMetadata trainCostMilliNodeHours. + * @member {number|Long} trainCostMilliNodeHours + * @memberof google.cloud.automl.v1.ImageClassificationModelMetadata + * @instance + */ + ImageClassificationModelMetadata.prototype.trainCostMilliNodeHours = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * ImageClassificationModelMetadata stopReason. + * @member {string} stopReason + * @memberof google.cloud.automl.v1.ImageClassificationModelMetadata + * @instance + */ + ImageClassificationModelMetadata.prototype.stopReason = ""; + + /** + * ImageClassificationModelMetadata modelType. + * @member {string} modelType + * @memberof google.cloud.automl.v1.ImageClassificationModelMetadata + * @instance + */ + ImageClassificationModelMetadata.prototype.modelType = ""; + + /** + * ImageClassificationModelMetadata nodeQps. + * @member {number} nodeQps + * @memberof google.cloud.automl.v1.ImageClassificationModelMetadata + * @instance + */ + ImageClassificationModelMetadata.prototype.nodeQps = 0; + + /** + * ImageClassificationModelMetadata nodeCount. + * @member {number|Long} nodeCount + * @memberof google.cloud.automl.v1.ImageClassificationModelMetadata + * @instance + */ + ImageClassificationModelMetadata.prototype.nodeCount = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new ImageClassificationModelMetadata instance using the specified properties. + * @function create + * @memberof google.cloud.automl.v1.ImageClassificationModelMetadata + * @static + * @param {google.cloud.automl.v1.IImageClassificationModelMetadata=} [properties] Properties to set + * @returns {google.cloud.automl.v1.ImageClassificationModelMetadata} ImageClassificationModelMetadata instance + */ + ImageClassificationModelMetadata.create = function create(properties) { + return new ImageClassificationModelMetadata(properties); + }; + + /** + * Encodes the specified ImageClassificationModelMetadata message. Does not implicitly {@link google.cloud.automl.v1.ImageClassificationModelMetadata.verify|verify} messages. + * @function encode + * @memberof google.cloud.automl.v1.ImageClassificationModelMetadata + * @static + * @param {google.cloud.automl.v1.IImageClassificationModelMetadata} message ImageClassificationModelMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ImageClassificationModelMetadata.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.baseModelId != null && Object.hasOwnProperty.call(message, "baseModelId")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.baseModelId); + if (message.stopReason != null && Object.hasOwnProperty.call(message, "stopReason")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.stopReason); + if (message.modelType != null && Object.hasOwnProperty.call(message, "modelType")) + writer.uint32(/* id 7, wireType 2 =*/58).string(message.modelType); + if (message.nodeQps != null && Object.hasOwnProperty.call(message, "nodeQps")) + writer.uint32(/* id 13, wireType 1 =*/105).double(message.nodeQps); + if (message.nodeCount != null && Object.hasOwnProperty.call(message, "nodeCount")) + writer.uint32(/* id 14, wireType 0 =*/112).int64(message.nodeCount); + if (message.trainBudgetMilliNodeHours != null && Object.hasOwnProperty.call(message, "trainBudgetMilliNodeHours")) + writer.uint32(/* id 16, wireType 0 =*/128).int64(message.trainBudgetMilliNodeHours); + if (message.trainCostMilliNodeHours != null && Object.hasOwnProperty.call(message, "trainCostMilliNodeHours")) + writer.uint32(/* id 17, wireType 0 =*/136).int64(message.trainCostMilliNodeHours); + return writer; + }; + + /** + * Encodes the specified ImageClassificationModelMetadata message, length delimited. Does not implicitly {@link google.cloud.automl.v1.ImageClassificationModelMetadata.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.automl.v1.ImageClassificationModelMetadata + * @static + * @param {google.cloud.automl.v1.IImageClassificationModelMetadata} message ImageClassificationModelMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ImageClassificationModelMetadata.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an ImageClassificationModelMetadata message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.automl.v1.ImageClassificationModelMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.automl.v1.ImageClassificationModelMetadata} ImageClassificationModelMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ImageClassificationModelMetadata.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.automl.v1.ImageClassificationModelMetadata(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.baseModelId = reader.string(); + break; + } + case 16: { + message.trainBudgetMilliNodeHours = reader.int64(); + break; + } + case 17: { + message.trainCostMilliNodeHours = reader.int64(); + break; + } + case 5: { + message.stopReason = reader.string(); + break; + } + case 7: { + message.modelType = reader.string(); + break; + } + case 13: { + message.nodeQps = reader.double(); + break; + } + case 14: { + message.nodeCount = reader.int64(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an ImageClassificationModelMetadata message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.automl.v1.ImageClassificationModelMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.automl.v1.ImageClassificationModelMetadata} ImageClassificationModelMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ImageClassificationModelMetadata.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an ImageClassificationModelMetadata message. + * @function verify + * @memberof google.cloud.automl.v1.ImageClassificationModelMetadata + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ImageClassificationModelMetadata.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.baseModelId != null && message.hasOwnProperty("baseModelId")) + if (!$util.isString(message.baseModelId)) + return "baseModelId: string expected"; + if (message.trainBudgetMilliNodeHours != null && message.hasOwnProperty("trainBudgetMilliNodeHours")) + if (!$util.isInteger(message.trainBudgetMilliNodeHours) && !(message.trainBudgetMilliNodeHours && $util.isInteger(message.trainBudgetMilliNodeHours.low) && $util.isInteger(message.trainBudgetMilliNodeHours.high))) + return "trainBudgetMilliNodeHours: integer|Long expected"; + if (message.trainCostMilliNodeHours != null && message.hasOwnProperty("trainCostMilliNodeHours")) + if (!$util.isInteger(message.trainCostMilliNodeHours) && !(message.trainCostMilliNodeHours && $util.isInteger(message.trainCostMilliNodeHours.low) && $util.isInteger(message.trainCostMilliNodeHours.high))) + return "trainCostMilliNodeHours: integer|Long expected"; + if (message.stopReason != null && message.hasOwnProperty("stopReason")) + if (!$util.isString(message.stopReason)) + return "stopReason: string expected"; + if (message.modelType != null && message.hasOwnProperty("modelType")) + if (!$util.isString(message.modelType)) + return "modelType: string expected"; + if (message.nodeQps != null && message.hasOwnProperty("nodeQps")) + if (typeof message.nodeQps !== "number") + return "nodeQps: number expected"; + if (message.nodeCount != null && message.hasOwnProperty("nodeCount")) + if (!$util.isInteger(message.nodeCount) && !(message.nodeCount && $util.isInteger(message.nodeCount.low) && $util.isInteger(message.nodeCount.high))) + return "nodeCount: integer|Long expected"; + return null; + }; + + /** + * Creates an ImageClassificationModelMetadata message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.automl.v1.ImageClassificationModelMetadata + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.automl.v1.ImageClassificationModelMetadata} ImageClassificationModelMetadata + */ + ImageClassificationModelMetadata.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.automl.v1.ImageClassificationModelMetadata) + return object; + var message = new $root.google.cloud.automl.v1.ImageClassificationModelMetadata(); + if (object.baseModelId != null) + message.baseModelId = String(object.baseModelId); + if (object.trainBudgetMilliNodeHours != null) + if ($util.Long) + (message.trainBudgetMilliNodeHours = $util.Long.fromValue(object.trainBudgetMilliNodeHours)).unsigned = false; + else if (typeof object.trainBudgetMilliNodeHours === "string") + message.trainBudgetMilliNodeHours = parseInt(object.trainBudgetMilliNodeHours, 10); + else if (typeof object.trainBudgetMilliNodeHours === "number") + message.trainBudgetMilliNodeHours = object.trainBudgetMilliNodeHours; + else if (typeof object.trainBudgetMilliNodeHours === "object") + message.trainBudgetMilliNodeHours = new $util.LongBits(object.trainBudgetMilliNodeHours.low >>> 0, object.trainBudgetMilliNodeHours.high >>> 0).toNumber(); + if (object.trainCostMilliNodeHours != null) + if ($util.Long) + (message.trainCostMilliNodeHours = $util.Long.fromValue(object.trainCostMilliNodeHours)).unsigned = false; + else if (typeof object.trainCostMilliNodeHours === "string") + message.trainCostMilliNodeHours = parseInt(object.trainCostMilliNodeHours, 10); + else if (typeof object.trainCostMilliNodeHours === "number") + message.trainCostMilliNodeHours = object.trainCostMilliNodeHours; + else if (typeof object.trainCostMilliNodeHours === "object") + message.trainCostMilliNodeHours = new $util.LongBits(object.trainCostMilliNodeHours.low >>> 0, object.trainCostMilliNodeHours.high >>> 0).toNumber(); + if (object.stopReason != null) + message.stopReason = String(object.stopReason); + if (object.modelType != null) + message.modelType = String(object.modelType); + if (object.nodeQps != null) + message.nodeQps = Number(object.nodeQps); + if (object.nodeCount != null) + if ($util.Long) + (message.nodeCount = $util.Long.fromValue(object.nodeCount)).unsigned = false; + else if (typeof object.nodeCount === "string") + message.nodeCount = parseInt(object.nodeCount, 10); + else if (typeof object.nodeCount === "number") + message.nodeCount = object.nodeCount; + else if (typeof object.nodeCount === "object") + message.nodeCount = new $util.LongBits(object.nodeCount.low >>> 0, object.nodeCount.high >>> 0).toNumber(); + return message; + }; + + /** + * Creates a plain object from an ImageClassificationModelMetadata message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.automl.v1.ImageClassificationModelMetadata + * @static + * @param {google.cloud.automl.v1.ImageClassificationModelMetadata} message ImageClassificationModelMetadata + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ImageClassificationModelMetadata.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.baseModelId = ""; + object.stopReason = ""; + object.modelType = ""; + object.nodeQps = 0; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.nodeCount = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.nodeCount = options.longs === String ? "0" : 0; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.trainBudgetMilliNodeHours = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.trainBudgetMilliNodeHours = options.longs === String ? "0" : 0; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.trainCostMilliNodeHours = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.trainCostMilliNodeHours = options.longs === String ? "0" : 0; + } + if (message.baseModelId != null && message.hasOwnProperty("baseModelId")) + object.baseModelId = message.baseModelId; + if (message.stopReason != null && message.hasOwnProperty("stopReason")) + object.stopReason = message.stopReason; + if (message.modelType != null && message.hasOwnProperty("modelType")) + object.modelType = message.modelType; + if (message.nodeQps != null && message.hasOwnProperty("nodeQps")) + object.nodeQps = options.json && !isFinite(message.nodeQps) ? String(message.nodeQps) : message.nodeQps; + if (message.nodeCount != null && message.hasOwnProperty("nodeCount")) + if (typeof message.nodeCount === "number") + object.nodeCount = options.longs === String ? String(message.nodeCount) : message.nodeCount; + else + object.nodeCount = options.longs === String ? $util.Long.prototype.toString.call(message.nodeCount) : options.longs === Number ? new $util.LongBits(message.nodeCount.low >>> 0, message.nodeCount.high >>> 0).toNumber() : message.nodeCount; + if (message.trainBudgetMilliNodeHours != null && message.hasOwnProperty("trainBudgetMilliNodeHours")) + if (typeof message.trainBudgetMilliNodeHours === "number") + object.trainBudgetMilliNodeHours = options.longs === String ? String(message.trainBudgetMilliNodeHours) : message.trainBudgetMilliNodeHours; + else + object.trainBudgetMilliNodeHours = options.longs === String ? $util.Long.prototype.toString.call(message.trainBudgetMilliNodeHours) : options.longs === Number ? new $util.LongBits(message.trainBudgetMilliNodeHours.low >>> 0, message.trainBudgetMilliNodeHours.high >>> 0).toNumber() : message.trainBudgetMilliNodeHours; + if (message.trainCostMilliNodeHours != null && message.hasOwnProperty("trainCostMilliNodeHours")) + if (typeof message.trainCostMilliNodeHours === "number") + object.trainCostMilliNodeHours = options.longs === String ? String(message.trainCostMilliNodeHours) : message.trainCostMilliNodeHours; + else + object.trainCostMilliNodeHours = options.longs === String ? $util.Long.prototype.toString.call(message.trainCostMilliNodeHours) : options.longs === Number ? new $util.LongBits(message.trainCostMilliNodeHours.low >>> 0, message.trainCostMilliNodeHours.high >>> 0).toNumber() : message.trainCostMilliNodeHours; + return object; + }; + + /** + * Converts this ImageClassificationModelMetadata to JSON. + * @function toJSON + * @memberof google.cloud.automl.v1.ImageClassificationModelMetadata + * @instance + * @returns {Object.} JSON object + */ + ImageClassificationModelMetadata.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ImageClassificationModelMetadata + * @function getTypeUrl + * @memberof google.cloud.automl.v1.ImageClassificationModelMetadata + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ImageClassificationModelMetadata.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.automl.v1.ImageClassificationModelMetadata"; + }; + + return ImageClassificationModelMetadata; + })(); + + v1.ImageObjectDetectionModelMetadata = (function() { + + /** + * Properties of an ImageObjectDetectionModelMetadata. + * @memberof google.cloud.automl.v1 + * @interface IImageObjectDetectionModelMetadata + * @property {string|null} [modelType] ImageObjectDetectionModelMetadata modelType + * @property {number|Long|null} [nodeCount] ImageObjectDetectionModelMetadata nodeCount + * @property {number|null} [nodeQps] ImageObjectDetectionModelMetadata nodeQps + * @property {string|null} [stopReason] ImageObjectDetectionModelMetadata stopReason + * @property {number|Long|null} [trainBudgetMilliNodeHours] ImageObjectDetectionModelMetadata trainBudgetMilliNodeHours + * @property {number|Long|null} [trainCostMilliNodeHours] ImageObjectDetectionModelMetadata trainCostMilliNodeHours + */ + + /** + * Constructs a new ImageObjectDetectionModelMetadata. + * @memberof google.cloud.automl.v1 + * @classdesc Represents an ImageObjectDetectionModelMetadata. + * @implements IImageObjectDetectionModelMetadata + * @constructor + * @param {google.cloud.automl.v1.IImageObjectDetectionModelMetadata=} [properties] Properties to set + */ + function ImageObjectDetectionModelMetadata(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ImageObjectDetectionModelMetadata modelType. + * @member {string} modelType + * @memberof google.cloud.automl.v1.ImageObjectDetectionModelMetadata + * @instance + */ + ImageObjectDetectionModelMetadata.prototype.modelType = ""; + + /** + * ImageObjectDetectionModelMetadata nodeCount. + * @member {number|Long} nodeCount + * @memberof google.cloud.automl.v1.ImageObjectDetectionModelMetadata + * @instance + */ + ImageObjectDetectionModelMetadata.prototype.nodeCount = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * ImageObjectDetectionModelMetadata nodeQps. + * @member {number} nodeQps + * @memberof google.cloud.automl.v1.ImageObjectDetectionModelMetadata + * @instance + */ + ImageObjectDetectionModelMetadata.prototype.nodeQps = 0; + + /** + * ImageObjectDetectionModelMetadata stopReason. + * @member {string} stopReason + * @memberof google.cloud.automl.v1.ImageObjectDetectionModelMetadata + * @instance + */ + ImageObjectDetectionModelMetadata.prototype.stopReason = ""; + + /** + * ImageObjectDetectionModelMetadata trainBudgetMilliNodeHours. + * @member {number|Long} trainBudgetMilliNodeHours + * @memberof google.cloud.automl.v1.ImageObjectDetectionModelMetadata + * @instance + */ + ImageObjectDetectionModelMetadata.prototype.trainBudgetMilliNodeHours = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * ImageObjectDetectionModelMetadata trainCostMilliNodeHours. + * @member {number|Long} trainCostMilliNodeHours + * @memberof google.cloud.automl.v1.ImageObjectDetectionModelMetadata + * @instance + */ + ImageObjectDetectionModelMetadata.prototype.trainCostMilliNodeHours = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new ImageObjectDetectionModelMetadata instance using the specified properties. + * @function create + * @memberof google.cloud.automl.v1.ImageObjectDetectionModelMetadata + * @static + * @param {google.cloud.automl.v1.IImageObjectDetectionModelMetadata=} [properties] Properties to set + * @returns {google.cloud.automl.v1.ImageObjectDetectionModelMetadata} ImageObjectDetectionModelMetadata instance + */ + ImageObjectDetectionModelMetadata.create = function create(properties) { + return new ImageObjectDetectionModelMetadata(properties); + }; + + /** + * Encodes the specified ImageObjectDetectionModelMetadata message. Does not implicitly {@link google.cloud.automl.v1.ImageObjectDetectionModelMetadata.verify|verify} messages. + * @function encode + * @memberof google.cloud.automl.v1.ImageObjectDetectionModelMetadata + * @static + * @param {google.cloud.automl.v1.IImageObjectDetectionModelMetadata} message ImageObjectDetectionModelMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ImageObjectDetectionModelMetadata.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.modelType != null && Object.hasOwnProperty.call(message, "modelType")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.modelType); + if (message.nodeCount != null && Object.hasOwnProperty.call(message, "nodeCount")) + writer.uint32(/* id 3, wireType 0 =*/24).int64(message.nodeCount); + if (message.nodeQps != null && Object.hasOwnProperty.call(message, "nodeQps")) + writer.uint32(/* id 4, wireType 1 =*/33).double(message.nodeQps); + if (message.stopReason != null && Object.hasOwnProperty.call(message, "stopReason")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.stopReason); + if (message.trainBudgetMilliNodeHours != null && Object.hasOwnProperty.call(message, "trainBudgetMilliNodeHours")) + writer.uint32(/* id 6, wireType 0 =*/48).int64(message.trainBudgetMilliNodeHours); + if (message.trainCostMilliNodeHours != null && Object.hasOwnProperty.call(message, "trainCostMilliNodeHours")) + writer.uint32(/* id 7, wireType 0 =*/56).int64(message.trainCostMilliNodeHours); + return writer; + }; + + /** + * Encodes the specified ImageObjectDetectionModelMetadata message, length delimited. Does not implicitly {@link google.cloud.automl.v1.ImageObjectDetectionModelMetadata.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.automl.v1.ImageObjectDetectionModelMetadata + * @static + * @param {google.cloud.automl.v1.IImageObjectDetectionModelMetadata} message ImageObjectDetectionModelMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ImageObjectDetectionModelMetadata.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an ImageObjectDetectionModelMetadata message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.automl.v1.ImageObjectDetectionModelMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.automl.v1.ImageObjectDetectionModelMetadata} ImageObjectDetectionModelMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ImageObjectDetectionModelMetadata.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.automl.v1.ImageObjectDetectionModelMetadata(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.modelType = reader.string(); + break; + } + case 3: { + message.nodeCount = reader.int64(); + break; + } + case 4: { + message.nodeQps = reader.double(); + break; + } + case 5: { + message.stopReason = reader.string(); + break; + } + case 6: { + message.trainBudgetMilliNodeHours = reader.int64(); + break; + } + case 7: { + message.trainCostMilliNodeHours = reader.int64(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an ImageObjectDetectionModelMetadata message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.automl.v1.ImageObjectDetectionModelMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.automl.v1.ImageObjectDetectionModelMetadata} ImageObjectDetectionModelMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ImageObjectDetectionModelMetadata.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an ImageObjectDetectionModelMetadata message. + * @function verify + * @memberof google.cloud.automl.v1.ImageObjectDetectionModelMetadata + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ImageObjectDetectionModelMetadata.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.modelType != null && message.hasOwnProperty("modelType")) + if (!$util.isString(message.modelType)) + return "modelType: string expected"; + if (message.nodeCount != null && message.hasOwnProperty("nodeCount")) + if (!$util.isInteger(message.nodeCount) && !(message.nodeCount && $util.isInteger(message.nodeCount.low) && $util.isInteger(message.nodeCount.high))) + return "nodeCount: integer|Long expected"; + if (message.nodeQps != null && message.hasOwnProperty("nodeQps")) + if (typeof message.nodeQps !== "number") + return "nodeQps: number expected"; + if (message.stopReason != null && message.hasOwnProperty("stopReason")) + if (!$util.isString(message.stopReason)) + return "stopReason: string expected"; + if (message.trainBudgetMilliNodeHours != null && message.hasOwnProperty("trainBudgetMilliNodeHours")) + if (!$util.isInteger(message.trainBudgetMilliNodeHours) && !(message.trainBudgetMilliNodeHours && $util.isInteger(message.trainBudgetMilliNodeHours.low) && $util.isInteger(message.trainBudgetMilliNodeHours.high))) + return "trainBudgetMilliNodeHours: integer|Long expected"; + if (message.trainCostMilliNodeHours != null && message.hasOwnProperty("trainCostMilliNodeHours")) + if (!$util.isInteger(message.trainCostMilliNodeHours) && !(message.trainCostMilliNodeHours && $util.isInteger(message.trainCostMilliNodeHours.low) && $util.isInteger(message.trainCostMilliNodeHours.high))) + return "trainCostMilliNodeHours: integer|Long expected"; + return null; + }; + + /** + * Creates an ImageObjectDetectionModelMetadata message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.automl.v1.ImageObjectDetectionModelMetadata + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.automl.v1.ImageObjectDetectionModelMetadata} ImageObjectDetectionModelMetadata + */ + ImageObjectDetectionModelMetadata.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.automl.v1.ImageObjectDetectionModelMetadata) + return object; + var message = new $root.google.cloud.automl.v1.ImageObjectDetectionModelMetadata(); + if (object.modelType != null) + message.modelType = String(object.modelType); + if (object.nodeCount != null) + if ($util.Long) + (message.nodeCount = $util.Long.fromValue(object.nodeCount)).unsigned = false; + else if (typeof object.nodeCount === "string") + message.nodeCount = parseInt(object.nodeCount, 10); + else if (typeof object.nodeCount === "number") + message.nodeCount = object.nodeCount; + else if (typeof object.nodeCount === "object") + message.nodeCount = new $util.LongBits(object.nodeCount.low >>> 0, object.nodeCount.high >>> 0).toNumber(); + if (object.nodeQps != null) + message.nodeQps = Number(object.nodeQps); + if (object.stopReason != null) + message.stopReason = String(object.stopReason); + if (object.trainBudgetMilliNodeHours != null) + if ($util.Long) + (message.trainBudgetMilliNodeHours = $util.Long.fromValue(object.trainBudgetMilliNodeHours)).unsigned = false; + else if (typeof object.trainBudgetMilliNodeHours === "string") + message.trainBudgetMilliNodeHours = parseInt(object.trainBudgetMilliNodeHours, 10); + else if (typeof object.trainBudgetMilliNodeHours === "number") + message.trainBudgetMilliNodeHours = object.trainBudgetMilliNodeHours; + else if (typeof object.trainBudgetMilliNodeHours === "object") + message.trainBudgetMilliNodeHours = new $util.LongBits(object.trainBudgetMilliNodeHours.low >>> 0, object.trainBudgetMilliNodeHours.high >>> 0).toNumber(); + if (object.trainCostMilliNodeHours != null) + if ($util.Long) + (message.trainCostMilliNodeHours = $util.Long.fromValue(object.trainCostMilliNodeHours)).unsigned = false; + else if (typeof object.trainCostMilliNodeHours === "string") + message.trainCostMilliNodeHours = parseInt(object.trainCostMilliNodeHours, 10); + else if (typeof object.trainCostMilliNodeHours === "number") + message.trainCostMilliNodeHours = object.trainCostMilliNodeHours; + else if (typeof object.trainCostMilliNodeHours === "object") + message.trainCostMilliNodeHours = new $util.LongBits(object.trainCostMilliNodeHours.low >>> 0, object.trainCostMilliNodeHours.high >>> 0).toNumber(); + return message; + }; + + /** + * Creates a plain object from an ImageObjectDetectionModelMetadata message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.automl.v1.ImageObjectDetectionModelMetadata + * @static + * @param {google.cloud.automl.v1.ImageObjectDetectionModelMetadata} message ImageObjectDetectionModelMetadata + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ImageObjectDetectionModelMetadata.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.modelType = ""; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.nodeCount = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.nodeCount = options.longs === String ? "0" : 0; + object.nodeQps = 0; + object.stopReason = ""; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.trainBudgetMilliNodeHours = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.trainBudgetMilliNodeHours = options.longs === String ? "0" : 0; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.trainCostMilliNodeHours = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.trainCostMilliNodeHours = options.longs === String ? "0" : 0; + } + if (message.modelType != null && message.hasOwnProperty("modelType")) + object.modelType = message.modelType; + if (message.nodeCount != null && message.hasOwnProperty("nodeCount")) + if (typeof message.nodeCount === "number") + object.nodeCount = options.longs === String ? String(message.nodeCount) : message.nodeCount; + else + object.nodeCount = options.longs === String ? $util.Long.prototype.toString.call(message.nodeCount) : options.longs === Number ? new $util.LongBits(message.nodeCount.low >>> 0, message.nodeCount.high >>> 0).toNumber() : message.nodeCount; + if (message.nodeQps != null && message.hasOwnProperty("nodeQps")) + object.nodeQps = options.json && !isFinite(message.nodeQps) ? String(message.nodeQps) : message.nodeQps; + if (message.stopReason != null && message.hasOwnProperty("stopReason")) + object.stopReason = message.stopReason; + if (message.trainBudgetMilliNodeHours != null && message.hasOwnProperty("trainBudgetMilliNodeHours")) + if (typeof message.trainBudgetMilliNodeHours === "number") + object.trainBudgetMilliNodeHours = options.longs === String ? String(message.trainBudgetMilliNodeHours) : message.trainBudgetMilliNodeHours; + else + object.trainBudgetMilliNodeHours = options.longs === String ? $util.Long.prototype.toString.call(message.trainBudgetMilliNodeHours) : options.longs === Number ? new $util.LongBits(message.trainBudgetMilliNodeHours.low >>> 0, message.trainBudgetMilliNodeHours.high >>> 0).toNumber() : message.trainBudgetMilliNodeHours; + if (message.trainCostMilliNodeHours != null && message.hasOwnProperty("trainCostMilliNodeHours")) + if (typeof message.trainCostMilliNodeHours === "number") + object.trainCostMilliNodeHours = options.longs === String ? String(message.trainCostMilliNodeHours) : message.trainCostMilliNodeHours; + else + object.trainCostMilliNodeHours = options.longs === String ? $util.Long.prototype.toString.call(message.trainCostMilliNodeHours) : options.longs === Number ? new $util.LongBits(message.trainCostMilliNodeHours.low >>> 0, message.trainCostMilliNodeHours.high >>> 0).toNumber() : message.trainCostMilliNodeHours; + return object; + }; + + /** + * Converts this ImageObjectDetectionModelMetadata to JSON. + * @function toJSON + * @memberof google.cloud.automl.v1.ImageObjectDetectionModelMetadata + * @instance + * @returns {Object.} JSON object + */ + ImageObjectDetectionModelMetadata.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ImageObjectDetectionModelMetadata + * @function getTypeUrl + * @memberof google.cloud.automl.v1.ImageObjectDetectionModelMetadata + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ImageObjectDetectionModelMetadata.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.automl.v1.ImageObjectDetectionModelMetadata"; + }; + + return ImageObjectDetectionModelMetadata; + })(); + + v1.ImageClassificationModelDeploymentMetadata = (function() { + + /** + * Properties of an ImageClassificationModelDeploymentMetadata. + * @memberof google.cloud.automl.v1 + * @interface IImageClassificationModelDeploymentMetadata + * @property {number|Long|null} [nodeCount] ImageClassificationModelDeploymentMetadata nodeCount + */ + + /** + * Constructs a new ImageClassificationModelDeploymentMetadata. + * @memberof google.cloud.automl.v1 + * @classdesc Represents an ImageClassificationModelDeploymentMetadata. + * @implements IImageClassificationModelDeploymentMetadata + * @constructor + * @param {google.cloud.automl.v1.IImageClassificationModelDeploymentMetadata=} [properties] Properties to set + */ + function ImageClassificationModelDeploymentMetadata(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ImageClassificationModelDeploymentMetadata nodeCount. + * @member {number|Long} nodeCount + * @memberof google.cloud.automl.v1.ImageClassificationModelDeploymentMetadata + * @instance + */ + ImageClassificationModelDeploymentMetadata.prototype.nodeCount = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new ImageClassificationModelDeploymentMetadata instance using the specified properties. + * @function create + * @memberof google.cloud.automl.v1.ImageClassificationModelDeploymentMetadata + * @static + * @param {google.cloud.automl.v1.IImageClassificationModelDeploymentMetadata=} [properties] Properties to set + * @returns {google.cloud.automl.v1.ImageClassificationModelDeploymentMetadata} ImageClassificationModelDeploymentMetadata instance + */ + ImageClassificationModelDeploymentMetadata.create = function create(properties) { + return new ImageClassificationModelDeploymentMetadata(properties); + }; + + /** + * Encodes the specified ImageClassificationModelDeploymentMetadata message. Does not implicitly {@link google.cloud.automl.v1.ImageClassificationModelDeploymentMetadata.verify|verify} messages. + * @function encode + * @memberof google.cloud.automl.v1.ImageClassificationModelDeploymentMetadata + * @static + * @param {google.cloud.automl.v1.IImageClassificationModelDeploymentMetadata} message ImageClassificationModelDeploymentMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ImageClassificationModelDeploymentMetadata.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.nodeCount != null && Object.hasOwnProperty.call(message, "nodeCount")) + writer.uint32(/* id 1, wireType 0 =*/8).int64(message.nodeCount); + return writer; + }; + + /** + * Encodes the specified ImageClassificationModelDeploymentMetadata message, length delimited. Does not implicitly {@link google.cloud.automl.v1.ImageClassificationModelDeploymentMetadata.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.automl.v1.ImageClassificationModelDeploymentMetadata + * @static + * @param {google.cloud.automl.v1.IImageClassificationModelDeploymentMetadata} message ImageClassificationModelDeploymentMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ImageClassificationModelDeploymentMetadata.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an ImageClassificationModelDeploymentMetadata message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.automl.v1.ImageClassificationModelDeploymentMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.automl.v1.ImageClassificationModelDeploymentMetadata} ImageClassificationModelDeploymentMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ImageClassificationModelDeploymentMetadata.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.automl.v1.ImageClassificationModelDeploymentMetadata(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.nodeCount = reader.int64(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an ImageClassificationModelDeploymentMetadata message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.automl.v1.ImageClassificationModelDeploymentMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.automl.v1.ImageClassificationModelDeploymentMetadata} ImageClassificationModelDeploymentMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ImageClassificationModelDeploymentMetadata.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an ImageClassificationModelDeploymentMetadata message. + * @function verify + * @memberof google.cloud.automl.v1.ImageClassificationModelDeploymentMetadata + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ImageClassificationModelDeploymentMetadata.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.nodeCount != null && message.hasOwnProperty("nodeCount")) + if (!$util.isInteger(message.nodeCount) && !(message.nodeCount && $util.isInteger(message.nodeCount.low) && $util.isInteger(message.nodeCount.high))) + return "nodeCount: integer|Long expected"; + return null; + }; + + /** + * Creates an ImageClassificationModelDeploymentMetadata message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.automl.v1.ImageClassificationModelDeploymentMetadata + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.automl.v1.ImageClassificationModelDeploymentMetadata} ImageClassificationModelDeploymentMetadata + */ + ImageClassificationModelDeploymentMetadata.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.automl.v1.ImageClassificationModelDeploymentMetadata) + return object; + var message = new $root.google.cloud.automl.v1.ImageClassificationModelDeploymentMetadata(); + if (object.nodeCount != null) + if ($util.Long) + (message.nodeCount = $util.Long.fromValue(object.nodeCount)).unsigned = false; + else if (typeof object.nodeCount === "string") + message.nodeCount = parseInt(object.nodeCount, 10); + else if (typeof object.nodeCount === "number") + message.nodeCount = object.nodeCount; + else if (typeof object.nodeCount === "object") + message.nodeCount = new $util.LongBits(object.nodeCount.low >>> 0, object.nodeCount.high >>> 0).toNumber(); + return message; + }; + + /** + * Creates a plain object from an ImageClassificationModelDeploymentMetadata message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.automl.v1.ImageClassificationModelDeploymentMetadata + * @static + * @param {google.cloud.automl.v1.ImageClassificationModelDeploymentMetadata} message ImageClassificationModelDeploymentMetadata + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ImageClassificationModelDeploymentMetadata.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.nodeCount = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.nodeCount = options.longs === String ? "0" : 0; + if (message.nodeCount != null && message.hasOwnProperty("nodeCount")) + if (typeof message.nodeCount === "number") + object.nodeCount = options.longs === String ? String(message.nodeCount) : message.nodeCount; + else + object.nodeCount = options.longs === String ? $util.Long.prototype.toString.call(message.nodeCount) : options.longs === Number ? new $util.LongBits(message.nodeCount.low >>> 0, message.nodeCount.high >>> 0).toNumber() : message.nodeCount; + return object; + }; + + /** + * Converts this ImageClassificationModelDeploymentMetadata to JSON. + * @function toJSON + * @memberof google.cloud.automl.v1.ImageClassificationModelDeploymentMetadata + * @instance + * @returns {Object.} JSON object + */ + ImageClassificationModelDeploymentMetadata.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ImageClassificationModelDeploymentMetadata + * @function getTypeUrl + * @memberof google.cloud.automl.v1.ImageClassificationModelDeploymentMetadata + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ImageClassificationModelDeploymentMetadata.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.automl.v1.ImageClassificationModelDeploymentMetadata"; + }; + + return ImageClassificationModelDeploymentMetadata; + })(); + + v1.ImageObjectDetectionModelDeploymentMetadata = (function() { + + /** + * Properties of an ImageObjectDetectionModelDeploymentMetadata. + * @memberof google.cloud.automl.v1 + * @interface IImageObjectDetectionModelDeploymentMetadata + * @property {number|Long|null} [nodeCount] ImageObjectDetectionModelDeploymentMetadata nodeCount + */ + + /** + * Constructs a new ImageObjectDetectionModelDeploymentMetadata. + * @memberof google.cloud.automl.v1 + * @classdesc Represents an ImageObjectDetectionModelDeploymentMetadata. + * @implements IImageObjectDetectionModelDeploymentMetadata + * @constructor + * @param {google.cloud.automl.v1.IImageObjectDetectionModelDeploymentMetadata=} [properties] Properties to set + */ + function ImageObjectDetectionModelDeploymentMetadata(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ImageObjectDetectionModelDeploymentMetadata nodeCount. + * @member {number|Long} nodeCount + * @memberof google.cloud.automl.v1.ImageObjectDetectionModelDeploymentMetadata + * @instance + */ + ImageObjectDetectionModelDeploymentMetadata.prototype.nodeCount = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new ImageObjectDetectionModelDeploymentMetadata instance using the specified properties. + * @function create + * @memberof google.cloud.automl.v1.ImageObjectDetectionModelDeploymentMetadata + * @static + * @param {google.cloud.automl.v1.IImageObjectDetectionModelDeploymentMetadata=} [properties] Properties to set + * @returns {google.cloud.automl.v1.ImageObjectDetectionModelDeploymentMetadata} ImageObjectDetectionModelDeploymentMetadata instance + */ + ImageObjectDetectionModelDeploymentMetadata.create = function create(properties) { + return new ImageObjectDetectionModelDeploymentMetadata(properties); + }; + + /** + * Encodes the specified ImageObjectDetectionModelDeploymentMetadata message. Does not implicitly {@link google.cloud.automl.v1.ImageObjectDetectionModelDeploymentMetadata.verify|verify} messages. + * @function encode + * @memberof google.cloud.automl.v1.ImageObjectDetectionModelDeploymentMetadata + * @static + * @param {google.cloud.automl.v1.IImageObjectDetectionModelDeploymentMetadata} message ImageObjectDetectionModelDeploymentMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ImageObjectDetectionModelDeploymentMetadata.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.nodeCount != null && Object.hasOwnProperty.call(message, "nodeCount")) + writer.uint32(/* id 1, wireType 0 =*/8).int64(message.nodeCount); + return writer; + }; + + /** + * Encodes the specified ImageObjectDetectionModelDeploymentMetadata message, length delimited. Does not implicitly {@link google.cloud.automl.v1.ImageObjectDetectionModelDeploymentMetadata.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.automl.v1.ImageObjectDetectionModelDeploymentMetadata + * @static + * @param {google.cloud.automl.v1.IImageObjectDetectionModelDeploymentMetadata} message ImageObjectDetectionModelDeploymentMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ImageObjectDetectionModelDeploymentMetadata.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an ImageObjectDetectionModelDeploymentMetadata message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.automl.v1.ImageObjectDetectionModelDeploymentMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.automl.v1.ImageObjectDetectionModelDeploymentMetadata} ImageObjectDetectionModelDeploymentMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ImageObjectDetectionModelDeploymentMetadata.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.automl.v1.ImageObjectDetectionModelDeploymentMetadata(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.nodeCount = reader.int64(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an ImageObjectDetectionModelDeploymentMetadata message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.automl.v1.ImageObjectDetectionModelDeploymentMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.automl.v1.ImageObjectDetectionModelDeploymentMetadata} ImageObjectDetectionModelDeploymentMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ImageObjectDetectionModelDeploymentMetadata.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an ImageObjectDetectionModelDeploymentMetadata message. + * @function verify + * @memberof google.cloud.automl.v1.ImageObjectDetectionModelDeploymentMetadata + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ImageObjectDetectionModelDeploymentMetadata.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.nodeCount != null && message.hasOwnProperty("nodeCount")) + if (!$util.isInteger(message.nodeCount) && !(message.nodeCount && $util.isInteger(message.nodeCount.low) && $util.isInteger(message.nodeCount.high))) + return "nodeCount: integer|Long expected"; + return null; + }; + + /** + * Creates an ImageObjectDetectionModelDeploymentMetadata message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.automl.v1.ImageObjectDetectionModelDeploymentMetadata + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.automl.v1.ImageObjectDetectionModelDeploymentMetadata} ImageObjectDetectionModelDeploymentMetadata + */ + ImageObjectDetectionModelDeploymentMetadata.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.automl.v1.ImageObjectDetectionModelDeploymentMetadata) + return object; + var message = new $root.google.cloud.automl.v1.ImageObjectDetectionModelDeploymentMetadata(); + if (object.nodeCount != null) + if ($util.Long) + (message.nodeCount = $util.Long.fromValue(object.nodeCount)).unsigned = false; + else if (typeof object.nodeCount === "string") + message.nodeCount = parseInt(object.nodeCount, 10); + else if (typeof object.nodeCount === "number") + message.nodeCount = object.nodeCount; + else if (typeof object.nodeCount === "object") + message.nodeCount = new $util.LongBits(object.nodeCount.low >>> 0, object.nodeCount.high >>> 0).toNumber(); + return message; + }; + + /** + * Creates a plain object from an ImageObjectDetectionModelDeploymentMetadata message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.automl.v1.ImageObjectDetectionModelDeploymentMetadata + * @static + * @param {google.cloud.automl.v1.ImageObjectDetectionModelDeploymentMetadata} message ImageObjectDetectionModelDeploymentMetadata + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ImageObjectDetectionModelDeploymentMetadata.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.nodeCount = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.nodeCount = options.longs === String ? "0" : 0; + if (message.nodeCount != null && message.hasOwnProperty("nodeCount")) + if (typeof message.nodeCount === "number") + object.nodeCount = options.longs === String ? String(message.nodeCount) : message.nodeCount; + else + object.nodeCount = options.longs === String ? $util.Long.prototype.toString.call(message.nodeCount) : options.longs === Number ? new $util.LongBits(message.nodeCount.low >>> 0, message.nodeCount.high >>> 0).toNumber() : message.nodeCount; + return object; + }; + + /** + * Converts this ImageObjectDetectionModelDeploymentMetadata to JSON. + * @function toJSON + * @memberof google.cloud.automl.v1.ImageObjectDetectionModelDeploymentMetadata + * @instance + * @returns {Object.} JSON object + */ + ImageObjectDetectionModelDeploymentMetadata.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ImageObjectDetectionModelDeploymentMetadata + * @function getTypeUrl + * @memberof google.cloud.automl.v1.ImageObjectDetectionModelDeploymentMetadata + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ImageObjectDetectionModelDeploymentMetadata.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.automl.v1.ImageObjectDetectionModelDeploymentMetadata"; + }; + + return ImageObjectDetectionModelDeploymentMetadata; + })(); + + v1.TextClassificationDatasetMetadata = (function() { + + /** + * Properties of a TextClassificationDatasetMetadata. + * @memberof google.cloud.automl.v1 + * @interface ITextClassificationDatasetMetadata + * @property {google.cloud.automl.v1.ClassificationType|null} [classificationType] TextClassificationDatasetMetadata classificationType + */ + + /** + * Constructs a new TextClassificationDatasetMetadata. + * @memberof google.cloud.automl.v1 + * @classdesc Represents a TextClassificationDatasetMetadata. + * @implements ITextClassificationDatasetMetadata + * @constructor + * @param {google.cloud.automl.v1.ITextClassificationDatasetMetadata=} [properties] Properties to set + */ + function TextClassificationDatasetMetadata(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * TextClassificationDatasetMetadata classificationType. + * @member {google.cloud.automl.v1.ClassificationType} classificationType + * @memberof google.cloud.automl.v1.TextClassificationDatasetMetadata + * @instance + */ + TextClassificationDatasetMetadata.prototype.classificationType = 0; + + /** + * Creates a new TextClassificationDatasetMetadata instance using the specified properties. + * @function create + * @memberof google.cloud.automl.v1.TextClassificationDatasetMetadata + * @static + * @param {google.cloud.automl.v1.ITextClassificationDatasetMetadata=} [properties] Properties to set + * @returns {google.cloud.automl.v1.TextClassificationDatasetMetadata} TextClassificationDatasetMetadata instance + */ + TextClassificationDatasetMetadata.create = function create(properties) { + return new TextClassificationDatasetMetadata(properties); + }; + + /** + * Encodes the specified TextClassificationDatasetMetadata message. Does not implicitly {@link google.cloud.automl.v1.TextClassificationDatasetMetadata.verify|verify} messages. + * @function encode + * @memberof google.cloud.automl.v1.TextClassificationDatasetMetadata + * @static + * @param {google.cloud.automl.v1.ITextClassificationDatasetMetadata} message TextClassificationDatasetMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TextClassificationDatasetMetadata.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.classificationType != null && Object.hasOwnProperty.call(message, "classificationType")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.classificationType); + return writer; + }; + + /** + * Encodes the specified TextClassificationDatasetMetadata message, length delimited. Does not implicitly {@link google.cloud.automl.v1.TextClassificationDatasetMetadata.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.automl.v1.TextClassificationDatasetMetadata + * @static + * @param {google.cloud.automl.v1.ITextClassificationDatasetMetadata} message TextClassificationDatasetMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TextClassificationDatasetMetadata.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a TextClassificationDatasetMetadata message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.automl.v1.TextClassificationDatasetMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.automl.v1.TextClassificationDatasetMetadata} TextClassificationDatasetMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TextClassificationDatasetMetadata.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.automl.v1.TextClassificationDatasetMetadata(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.classificationType = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a TextClassificationDatasetMetadata message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.automl.v1.TextClassificationDatasetMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.automl.v1.TextClassificationDatasetMetadata} TextClassificationDatasetMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TextClassificationDatasetMetadata.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a TextClassificationDatasetMetadata message. + * @function verify + * @memberof google.cloud.automl.v1.TextClassificationDatasetMetadata + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + TextClassificationDatasetMetadata.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.classificationType != null && message.hasOwnProperty("classificationType")) + switch (message.classificationType) { + default: + return "classificationType: enum value expected"; + case 0: + case 1: + case 2: + break; + } + return null; + }; + + /** + * Creates a TextClassificationDatasetMetadata message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.automl.v1.TextClassificationDatasetMetadata + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.automl.v1.TextClassificationDatasetMetadata} TextClassificationDatasetMetadata + */ + TextClassificationDatasetMetadata.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.automl.v1.TextClassificationDatasetMetadata) + return object; + var message = new $root.google.cloud.automl.v1.TextClassificationDatasetMetadata(); + switch (object.classificationType) { + default: + if (typeof object.classificationType === "number") { + message.classificationType = object.classificationType; + break; + } + break; + case "CLASSIFICATION_TYPE_UNSPECIFIED": + case 0: + message.classificationType = 0; + break; + case "MULTICLASS": + case 1: + message.classificationType = 1; + break; + case "MULTILABEL": + case 2: + message.classificationType = 2; + break; + } + return message; + }; + + /** + * Creates a plain object from a TextClassificationDatasetMetadata message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.automl.v1.TextClassificationDatasetMetadata + * @static + * @param {google.cloud.automl.v1.TextClassificationDatasetMetadata} message TextClassificationDatasetMetadata + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + TextClassificationDatasetMetadata.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.classificationType = options.enums === String ? "CLASSIFICATION_TYPE_UNSPECIFIED" : 0; + if (message.classificationType != null && message.hasOwnProperty("classificationType")) + object.classificationType = options.enums === String ? $root.google.cloud.automl.v1.ClassificationType[message.classificationType] === undefined ? message.classificationType : $root.google.cloud.automl.v1.ClassificationType[message.classificationType] : message.classificationType; + return object; + }; + + /** + * Converts this TextClassificationDatasetMetadata to JSON. + * @function toJSON + * @memberof google.cloud.automl.v1.TextClassificationDatasetMetadata + * @instance + * @returns {Object.} JSON object + */ + TextClassificationDatasetMetadata.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for TextClassificationDatasetMetadata + * @function getTypeUrl + * @memberof google.cloud.automl.v1.TextClassificationDatasetMetadata + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TextClassificationDatasetMetadata.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.automl.v1.TextClassificationDatasetMetadata"; + }; + + return TextClassificationDatasetMetadata; + })(); + + v1.TextClassificationModelMetadata = (function() { + + /** + * Properties of a TextClassificationModelMetadata. + * @memberof google.cloud.automl.v1 + * @interface ITextClassificationModelMetadata + * @property {google.cloud.automl.v1.ClassificationType|null} [classificationType] TextClassificationModelMetadata classificationType + */ + + /** + * Constructs a new TextClassificationModelMetadata. + * @memberof google.cloud.automl.v1 + * @classdesc Represents a TextClassificationModelMetadata. + * @implements ITextClassificationModelMetadata + * @constructor + * @param {google.cloud.automl.v1.ITextClassificationModelMetadata=} [properties] Properties to set + */ + function TextClassificationModelMetadata(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * TextClassificationModelMetadata classificationType. + * @member {google.cloud.automl.v1.ClassificationType} classificationType + * @memberof google.cloud.automl.v1.TextClassificationModelMetadata + * @instance + */ + TextClassificationModelMetadata.prototype.classificationType = 0; + + /** + * Creates a new TextClassificationModelMetadata instance using the specified properties. + * @function create + * @memberof google.cloud.automl.v1.TextClassificationModelMetadata + * @static + * @param {google.cloud.automl.v1.ITextClassificationModelMetadata=} [properties] Properties to set + * @returns {google.cloud.automl.v1.TextClassificationModelMetadata} TextClassificationModelMetadata instance + */ + TextClassificationModelMetadata.create = function create(properties) { + return new TextClassificationModelMetadata(properties); + }; + + /** + * Encodes the specified TextClassificationModelMetadata message. Does not implicitly {@link google.cloud.automl.v1.TextClassificationModelMetadata.verify|verify} messages. + * @function encode + * @memberof google.cloud.automl.v1.TextClassificationModelMetadata + * @static + * @param {google.cloud.automl.v1.ITextClassificationModelMetadata} message TextClassificationModelMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TextClassificationModelMetadata.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.classificationType != null && Object.hasOwnProperty.call(message, "classificationType")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.classificationType); + return writer; + }; + + /** + * Encodes the specified TextClassificationModelMetadata message, length delimited. Does not implicitly {@link google.cloud.automl.v1.TextClassificationModelMetadata.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.automl.v1.TextClassificationModelMetadata + * @static + * @param {google.cloud.automl.v1.ITextClassificationModelMetadata} message TextClassificationModelMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TextClassificationModelMetadata.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a TextClassificationModelMetadata message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.automl.v1.TextClassificationModelMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.automl.v1.TextClassificationModelMetadata} TextClassificationModelMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TextClassificationModelMetadata.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.automl.v1.TextClassificationModelMetadata(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 3: { + message.classificationType = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a TextClassificationModelMetadata message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.automl.v1.TextClassificationModelMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.automl.v1.TextClassificationModelMetadata} TextClassificationModelMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TextClassificationModelMetadata.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a TextClassificationModelMetadata message. + * @function verify + * @memberof google.cloud.automl.v1.TextClassificationModelMetadata + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + TextClassificationModelMetadata.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.classificationType != null && message.hasOwnProperty("classificationType")) + switch (message.classificationType) { + default: + return "classificationType: enum value expected"; + case 0: + case 1: + case 2: + break; + } + return null; + }; + + /** + * Creates a TextClassificationModelMetadata message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.automl.v1.TextClassificationModelMetadata + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.automl.v1.TextClassificationModelMetadata} TextClassificationModelMetadata + */ + TextClassificationModelMetadata.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.automl.v1.TextClassificationModelMetadata) + return object; + var message = new $root.google.cloud.automl.v1.TextClassificationModelMetadata(); + switch (object.classificationType) { + default: + if (typeof object.classificationType === "number") { + message.classificationType = object.classificationType; + break; + } + break; + case "CLASSIFICATION_TYPE_UNSPECIFIED": + case 0: + message.classificationType = 0; + break; + case "MULTICLASS": + case 1: + message.classificationType = 1; + break; + case "MULTILABEL": + case 2: + message.classificationType = 2; + break; + } + return message; + }; + + /** + * Creates a plain object from a TextClassificationModelMetadata message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.automl.v1.TextClassificationModelMetadata + * @static + * @param {google.cloud.automl.v1.TextClassificationModelMetadata} message TextClassificationModelMetadata + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + TextClassificationModelMetadata.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.classificationType = options.enums === String ? "CLASSIFICATION_TYPE_UNSPECIFIED" : 0; + if (message.classificationType != null && message.hasOwnProperty("classificationType")) + object.classificationType = options.enums === String ? $root.google.cloud.automl.v1.ClassificationType[message.classificationType] === undefined ? message.classificationType : $root.google.cloud.automl.v1.ClassificationType[message.classificationType] : message.classificationType; + return object; + }; + + /** + * Converts this TextClassificationModelMetadata to JSON. + * @function toJSON + * @memberof google.cloud.automl.v1.TextClassificationModelMetadata + * @instance + * @returns {Object.} JSON object + */ + TextClassificationModelMetadata.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for TextClassificationModelMetadata + * @function getTypeUrl + * @memberof google.cloud.automl.v1.TextClassificationModelMetadata + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TextClassificationModelMetadata.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.automl.v1.TextClassificationModelMetadata"; + }; + + return TextClassificationModelMetadata; + })(); + + v1.TextExtractionDatasetMetadata = (function() { + + /** + * Properties of a TextExtractionDatasetMetadata. + * @memberof google.cloud.automl.v1 + * @interface ITextExtractionDatasetMetadata + */ + + /** + * Constructs a new TextExtractionDatasetMetadata. + * @memberof google.cloud.automl.v1 + * @classdesc Represents a TextExtractionDatasetMetadata. + * @implements ITextExtractionDatasetMetadata + * @constructor + * @param {google.cloud.automl.v1.ITextExtractionDatasetMetadata=} [properties] Properties to set + */ + function TextExtractionDatasetMetadata(properties) { + if (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 TextExtractionDatasetMetadata instance using the specified properties. + * @function create + * @memberof google.cloud.automl.v1.TextExtractionDatasetMetadata + * @static + * @param {google.cloud.automl.v1.ITextExtractionDatasetMetadata=} [properties] Properties to set + * @returns {google.cloud.automl.v1.TextExtractionDatasetMetadata} TextExtractionDatasetMetadata instance + */ + TextExtractionDatasetMetadata.create = function create(properties) { + return new TextExtractionDatasetMetadata(properties); + }; + + /** + * Encodes the specified TextExtractionDatasetMetadata message. Does not implicitly {@link google.cloud.automl.v1.TextExtractionDatasetMetadata.verify|verify} messages. + * @function encode + * @memberof google.cloud.automl.v1.TextExtractionDatasetMetadata + * @static + * @param {google.cloud.automl.v1.ITextExtractionDatasetMetadata} message TextExtractionDatasetMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TextExtractionDatasetMetadata.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + return writer; + }; + + /** + * Encodes the specified TextExtractionDatasetMetadata message, length delimited. Does not implicitly {@link google.cloud.automl.v1.TextExtractionDatasetMetadata.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.automl.v1.TextExtractionDatasetMetadata + * @static + * @param {google.cloud.automl.v1.ITextExtractionDatasetMetadata} message TextExtractionDatasetMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TextExtractionDatasetMetadata.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a TextExtractionDatasetMetadata message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.automl.v1.TextExtractionDatasetMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.automl.v1.TextExtractionDatasetMetadata} TextExtractionDatasetMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TextExtractionDatasetMetadata.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.automl.v1.TextExtractionDatasetMetadata(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a TextExtractionDatasetMetadata message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.automl.v1.TextExtractionDatasetMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.automl.v1.TextExtractionDatasetMetadata} TextExtractionDatasetMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TextExtractionDatasetMetadata.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a TextExtractionDatasetMetadata message. + * @function verify + * @memberof google.cloud.automl.v1.TextExtractionDatasetMetadata + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + TextExtractionDatasetMetadata.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + return null; + }; + + /** + * Creates a TextExtractionDatasetMetadata message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.automl.v1.TextExtractionDatasetMetadata + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.automl.v1.TextExtractionDatasetMetadata} TextExtractionDatasetMetadata + */ + TextExtractionDatasetMetadata.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.automl.v1.TextExtractionDatasetMetadata) + return object; + return new $root.google.cloud.automl.v1.TextExtractionDatasetMetadata(); + }; + + /** + * Creates a plain object from a TextExtractionDatasetMetadata message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.automl.v1.TextExtractionDatasetMetadata + * @static + * @param {google.cloud.automl.v1.TextExtractionDatasetMetadata} message TextExtractionDatasetMetadata + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + TextExtractionDatasetMetadata.toObject = function toObject() { + return {}; + }; + + /** + * Converts this TextExtractionDatasetMetadata to JSON. + * @function toJSON + * @memberof google.cloud.automl.v1.TextExtractionDatasetMetadata + * @instance + * @returns {Object.} JSON object + */ + TextExtractionDatasetMetadata.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for TextExtractionDatasetMetadata + * @function getTypeUrl + * @memberof google.cloud.automl.v1.TextExtractionDatasetMetadata + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TextExtractionDatasetMetadata.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.automl.v1.TextExtractionDatasetMetadata"; + }; + + return TextExtractionDatasetMetadata; + })(); + + v1.TextExtractionModelMetadata = (function() { + + /** + * Properties of a TextExtractionModelMetadata. + * @memberof google.cloud.automl.v1 + * @interface ITextExtractionModelMetadata + */ + + /** + * Constructs a new TextExtractionModelMetadata. + * @memberof google.cloud.automl.v1 + * @classdesc Represents a TextExtractionModelMetadata. + * @implements ITextExtractionModelMetadata + * @constructor + * @param {google.cloud.automl.v1.ITextExtractionModelMetadata=} [properties] Properties to set + */ + function TextExtractionModelMetadata(properties) { + if (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 TextExtractionModelMetadata instance using the specified properties. + * @function create + * @memberof google.cloud.automl.v1.TextExtractionModelMetadata + * @static + * @param {google.cloud.automl.v1.ITextExtractionModelMetadata=} [properties] Properties to set + * @returns {google.cloud.automl.v1.TextExtractionModelMetadata} TextExtractionModelMetadata instance + */ + TextExtractionModelMetadata.create = function create(properties) { + return new TextExtractionModelMetadata(properties); + }; + + /** + * Encodes the specified TextExtractionModelMetadata message. Does not implicitly {@link google.cloud.automl.v1.TextExtractionModelMetadata.verify|verify} messages. + * @function encode + * @memberof google.cloud.automl.v1.TextExtractionModelMetadata + * @static + * @param {google.cloud.automl.v1.ITextExtractionModelMetadata} message TextExtractionModelMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TextExtractionModelMetadata.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + return writer; + }; + + /** + * Encodes the specified TextExtractionModelMetadata message, length delimited. Does not implicitly {@link google.cloud.automl.v1.TextExtractionModelMetadata.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.automl.v1.TextExtractionModelMetadata + * @static + * @param {google.cloud.automl.v1.ITextExtractionModelMetadata} message TextExtractionModelMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TextExtractionModelMetadata.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a TextExtractionModelMetadata message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.automl.v1.TextExtractionModelMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.automl.v1.TextExtractionModelMetadata} TextExtractionModelMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TextExtractionModelMetadata.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.automl.v1.TextExtractionModelMetadata(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a TextExtractionModelMetadata message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.automl.v1.TextExtractionModelMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.automl.v1.TextExtractionModelMetadata} TextExtractionModelMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TextExtractionModelMetadata.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a TextExtractionModelMetadata message. + * @function verify + * @memberof google.cloud.automl.v1.TextExtractionModelMetadata + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + TextExtractionModelMetadata.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + return null; + }; + + /** + * Creates a TextExtractionModelMetadata message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.automl.v1.TextExtractionModelMetadata + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.automl.v1.TextExtractionModelMetadata} TextExtractionModelMetadata + */ + TextExtractionModelMetadata.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.automl.v1.TextExtractionModelMetadata) + return object; + return new $root.google.cloud.automl.v1.TextExtractionModelMetadata(); + }; + + /** + * Creates a plain object from a TextExtractionModelMetadata message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.automl.v1.TextExtractionModelMetadata + * @static + * @param {google.cloud.automl.v1.TextExtractionModelMetadata} message TextExtractionModelMetadata + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + TextExtractionModelMetadata.toObject = function toObject() { + return {}; + }; + + /** + * Converts this TextExtractionModelMetadata to JSON. + * @function toJSON + * @memberof google.cloud.automl.v1.TextExtractionModelMetadata + * @instance + * @returns {Object.} JSON object + */ + TextExtractionModelMetadata.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for TextExtractionModelMetadata + * @function getTypeUrl + * @memberof google.cloud.automl.v1.TextExtractionModelMetadata + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TextExtractionModelMetadata.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.automl.v1.TextExtractionModelMetadata"; + }; + + return TextExtractionModelMetadata; + })(); + + v1.TextSentimentDatasetMetadata = (function() { + + /** + * Properties of a TextSentimentDatasetMetadata. + * @memberof google.cloud.automl.v1 + * @interface ITextSentimentDatasetMetadata + * @property {number|null} [sentimentMax] TextSentimentDatasetMetadata sentimentMax + */ + + /** + * Constructs a new TextSentimentDatasetMetadata. + * @memberof google.cloud.automl.v1 + * @classdesc Represents a TextSentimentDatasetMetadata. + * @implements ITextSentimentDatasetMetadata + * @constructor + * @param {google.cloud.automl.v1.ITextSentimentDatasetMetadata=} [properties] Properties to set + */ + function TextSentimentDatasetMetadata(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * TextSentimentDatasetMetadata sentimentMax. + * @member {number} sentimentMax + * @memberof google.cloud.automl.v1.TextSentimentDatasetMetadata + * @instance + */ + TextSentimentDatasetMetadata.prototype.sentimentMax = 0; + + /** + * Creates a new TextSentimentDatasetMetadata instance using the specified properties. + * @function create + * @memberof google.cloud.automl.v1.TextSentimentDatasetMetadata + * @static + * @param {google.cloud.automl.v1.ITextSentimentDatasetMetadata=} [properties] Properties to set + * @returns {google.cloud.automl.v1.TextSentimentDatasetMetadata} TextSentimentDatasetMetadata instance + */ + TextSentimentDatasetMetadata.create = function create(properties) { + return new TextSentimentDatasetMetadata(properties); + }; + + /** + * Encodes the specified TextSentimentDatasetMetadata message. Does not implicitly {@link google.cloud.automl.v1.TextSentimentDatasetMetadata.verify|verify} messages. + * @function encode + * @memberof google.cloud.automl.v1.TextSentimentDatasetMetadata + * @static + * @param {google.cloud.automl.v1.ITextSentimentDatasetMetadata} message TextSentimentDatasetMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TextSentimentDatasetMetadata.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.sentimentMax != null && Object.hasOwnProperty.call(message, "sentimentMax")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.sentimentMax); + return writer; + }; + + /** + * Encodes the specified TextSentimentDatasetMetadata message, length delimited. Does not implicitly {@link google.cloud.automl.v1.TextSentimentDatasetMetadata.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.automl.v1.TextSentimentDatasetMetadata + * @static + * @param {google.cloud.automl.v1.ITextSentimentDatasetMetadata} message TextSentimentDatasetMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TextSentimentDatasetMetadata.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a TextSentimentDatasetMetadata message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.automl.v1.TextSentimentDatasetMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.automl.v1.TextSentimentDatasetMetadata} TextSentimentDatasetMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TextSentimentDatasetMetadata.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.automl.v1.TextSentimentDatasetMetadata(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.sentimentMax = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a TextSentimentDatasetMetadata message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.automl.v1.TextSentimentDatasetMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.automl.v1.TextSentimentDatasetMetadata} TextSentimentDatasetMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TextSentimentDatasetMetadata.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a TextSentimentDatasetMetadata message. + * @function verify + * @memberof google.cloud.automl.v1.TextSentimentDatasetMetadata + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + TextSentimentDatasetMetadata.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.sentimentMax != null && message.hasOwnProperty("sentimentMax")) + if (!$util.isInteger(message.sentimentMax)) + return "sentimentMax: integer expected"; + return null; + }; + + /** + * Creates a TextSentimentDatasetMetadata message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.automl.v1.TextSentimentDatasetMetadata + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.automl.v1.TextSentimentDatasetMetadata} TextSentimentDatasetMetadata + */ + TextSentimentDatasetMetadata.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.automl.v1.TextSentimentDatasetMetadata) + return object; + var message = new $root.google.cloud.automl.v1.TextSentimentDatasetMetadata(); + if (object.sentimentMax != null) + message.sentimentMax = object.sentimentMax | 0; + return message; + }; + + /** + * Creates a plain object from a TextSentimentDatasetMetadata message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.automl.v1.TextSentimentDatasetMetadata + * @static + * @param {google.cloud.automl.v1.TextSentimentDatasetMetadata} message TextSentimentDatasetMetadata + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + TextSentimentDatasetMetadata.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.sentimentMax = 0; + if (message.sentimentMax != null && message.hasOwnProperty("sentimentMax")) + object.sentimentMax = message.sentimentMax; + return object; + }; + + /** + * Converts this TextSentimentDatasetMetadata to JSON. + * @function toJSON + * @memberof google.cloud.automl.v1.TextSentimentDatasetMetadata + * @instance + * @returns {Object.} JSON object + */ + TextSentimentDatasetMetadata.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for TextSentimentDatasetMetadata + * @function getTypeUrl + * @memberof google.cloud.automl.v1.TextSentimentDatasetMetadata + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TextSentimentDatasetMetadata.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.automl.v1.TextSentimentDatasetMetadata"; + }; + + return TextSentimentDatasetMetadata; + })(); + + v1.TextSentimentModelMetadata = (function() { + + /** + * Properties of a TextSentimentModelMetadata. + * @memberof google.cloud.automl.v1 + * @interface ITextSentimentModelMetadata + */ + + /** + * Constructs a new TextSentimentModelMetadata. + * @memberof google.cloud.automl.v1 + * @classdesc Represents a TextSentimentModelMetadata. + * @implements ITextSentimentModelMetadata + * @constructor + * @param {google.cloud.automl.v1.ITextSentimentModelMetadata=} [properties] Properties to set + */ + function TextSentimentModelMetadata(properties) { + if (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 TextSentimentModelMetadata instance using the specified properties. + * @function create + * @memberof google.cloud.automl.v1.TextSentimentModelMetadata + * @static + * @param {google.cloud.automl.v1.ITextSentimentModelMetadata=} [properties] Properties to set + * @returns {google.cloud.automl.v1.TextSentimentModelMetadata} TextSentimentModelMetadata instance + */ + TextSentimentModelMetadata.create = function create(properties) { + return new TextSentimentModelMetadata(properties); + }; + + /** + * Encodes the specified TextSentimentModelMetadata message. Does not implicitly {@link google.cloud.automl.v1.TextSentimentModelMetadata.verify|verify} messages. + * @function encode + * @memberof google.cloud.automl.v1.TextSentimentModelMetadata + * @static + * @param {google.cloud.automl.v1.ITextSentimentModelMetadata} message TextSentimentModelMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TextSentimentModelMetadata.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + return writer; + }; + + /** + * Encodes the specified TextSentimentModelMetadata message, length delimited. Does not implicitly {@link google.cloud.automl.v1.TextSentimentModelMetadata.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.automl.v1.TextSentimentModelMetadata + * @static + * @param {google.cloud.automl.v1.ITextSentimentModelMetadata} message TextSentimentModelMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TextSentimentModelMetadata.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a TextSentimentModelMetadata message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.automl.v1.TextSentimentModelMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.automl.v1.TextSentimentModelMetadata} TextSentimentModelMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TextSentimentModelMetadata.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.automl.v1.TextSentimentModelMetadata(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a TextSentimentModelMetadata message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.automl.v1.TextSentimentModelMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.automl.v1.TextSentimentModelMetadata} TextSentimentModelMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TextSentimentModelMetadata.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a TextSentimentModelMetadata message. + * @function verify + * @memberof google.cloud.automl.v1.TextSentimentModelMetadata + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + TextSentimentModelMetadata.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + return null; + }; + + /** + * Creates a TextSentimentModelMetadata message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.automl.v1.TextSentimentModelMetadata + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.automl.v1.TextSentimentModelMetadata} TextSentimentModelMetadata + */ + TextSentimentModelMetadata.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.automl.v1.TextSentimentModelMetadata) + return object; + return new $root.google.cloud.automl.v1.TextSentimentModelMetadata(); + }; + + /** + * Creates a plain object from a TextSentimentModelMetadata message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.automl.v1.TextSentimentModelMetadata + * @static + * @param {google.cloud.automl.v1.TextSentimentModelMetadata} message TextSentimentModelMetadata + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + TextSentimentModelMetadata.toObject = function toObject() { + return {}; + }; + + /** + * Converts this TextSentimentModelMetadata to JSON. + * @function toJSON + * @memberof google.cloud.automl.v1.TextSentimentModelMetadata + * @instance + * @returns {Object.} JSON object + */ + TextSentimentModelMetadata.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for TextSentimentModelMetadata + * @function getTypeUrl + * @memberof google.cloud.automl.v1.TextSentimentModelMetadata + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TextSentimentModelMetadata.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.automl.v1.TextSentimentModelMetadata"; + }; + + return TextSentimentModelMetadata; + })(); + + v1.Model = (function() { + + /** + * Properties of a Model. + * @memberof google.cloud.automl.v1 + * @interface IModel + * @property {google.cloud.automl.v1.ITranslationModelMetadata|null} [translationModelMetadata] Model translationModelMetadata + * @property {google.cloud.automl.v1.IImageClassificationModelMetadata|null} [imageClassificationModelMetadata] Model imageClassificationModelMetadata + * @property {google.cloud.automl.v1.ITextClassificationModelMetadata|null} [textClassificationModelMetadata] Model textClassificationModelMetadata + * @property {google.cloud.automl.v1.IImageObjectDetectionModelMetadata|null} [imageObjectDetectionModelMetadata] Model imageObjectDetectionModelMetadata + * @property {google.cloud.automl.v1.ITextExtractionModelMetadata|null} [textExtractionModelMetadata] Model textExtractionModelMetadata + * @property {google.cloud.automl.v1.ITextSentimentModelMetadata|null} [textSentimentModelMetadata] Model textSentimentModelMetadata + * @property {string|null} [name] Model name + * @property {string|null} [displayName] Model displayName + * @property {string|null} [datasetId] Model datasetId + * @property {google.protobuf.ITimestamp|null} [createTime] Model createTime + * @property {google.protobuf.ITimestamp|null} [updateTime] Model updateTime + * @property {google.cloud.automl.v1.Model.DeploymentState|null} [deploymentState] Model deploymentState + * @property {string|null} [etag] Model etag + * @property {Object.|null} [labels] Model labels + */ + + /** + * Constructs a new Model. + * @memberof google.cloud.automl.v1 + * @classdesc Represents a Model. + * @implements IModel + * @constructor + * @param {google.cloud.automl.v1.IModel=} [properties] Properties to set + */ + function Model(properties) { + this.labels = {}; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Model translationModelMetadata. + * @member {google.cloud.automl.v1.ITranslationModelMetadata|null|undefined} translationModelMetadata + * @memberof google.cloud.automl.v1.Model + * @instance + */ + Model.prototype.translationModelMetadata = null; + + /** + * Model imageClassificationModelMetadata. + * @member {google.cloud.automl.v1.IImageClassificationModelMetadata|null|undefined} imageClassificationModelMetadata + * @memberof google.cloud.automl.v1.Model + * @instance + */ + Model.prototype.imageClassificationModelMetadata = null; + + /** + * Model textClassificationModelMetadata. + * @member {google.cloud.automl.v1.ITextClassificationModelMetadata|null|undefined} textClassificationModelMetadata + * @memberof google.cloud.automl.v1.Model + * @instance + */ + Model.prototype.textClassificationModelMetadata = null; + + /** + * Model imageObjectDetectionModelMetadata. + * @member {google.cloud.automl.v1.IImageObjectDetectionModelMetadata|null|undefined} imageObjectDetectionModelMetadata + * @memberof google.cloud.automl.v1.Model + * @instance + */ + Model.prototype.imageObjectDetectionModelMetadata = null; + + /** + * Model textExtractionModelMetadata. + * @member {google.cloud.automl.v1.ITextExtractionModelMetadata|null|undefined} textExtractionModelMetadata + * @memberof google.cloud.automl.v1.Model + * @instance + */ + Model.prototype.textExtractionModelMetadata = null; + + /** + * Model textSentimentModelMetadata. + * @member {google.cloud.automl.v1.ITextSentimentModelMetadata|null|undefined} textSentimentModelMetadata + * @memberof google.cloud.automl.v1.Model + * @instance + */ + Model.prototype.textSentimentModelMetadata = null; + + /** + * Model name. + * @member {string} name + * @memberof google.cloud.automl.v1.Model + * @instance + */ + Model.prototype.name = ""; + + /** + * Model displayName. + * @member {string} displayName + * @memberof google.cloud.automl.v1.Model + * @instance + */ + Model.prototype.displayName = ""; + + /** + * Model datasetId. + * @member {string} datasetId + * @memberof google.cloud.automl.v1.Model + * @instance + */ + Model.prototype.datasetId = ""; + + /** + * Model createTime. + * @member {google.protobuf.ITimestamp|null|undefined} createTime + * @memberof google.cloud.automl.v1.Model + * @instance + */ + Model.prototype.createTime = null; + + /** + * Model updateTime. + * @member {google.protobuf.ITimestamp|null|undefined} updateTime + * @memberof google.cloud.automl.v1.Model + * @instance + */ + Model.prototype.updateTime = null; + + /** + * Model deploymentState. + * @member {google.cloud.automl.v1.Model.DeploymentState} deploymentState + * @memberof google.cloud.automl.v1.Model + * @instance + */ + Model.prototype.deploymentState = 0; + + /** + * Model etag. + * @member {string} etag + * @memberof google.cloud.automl.v1.Model + * @instance + */ + Model.prototype.etag = ""; + + /** + * Model labels. + * @member {Object.} labels + * @memberof google.cloud.automl.v1.Model + * @instance + */ + Model.prototype.labels = $util.emptyObject; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * Model modelMetadata. + * @member {"translationModelMetadata"|"imageClassificationModelMetadata"|"textClassificationModelMetadata"|"imageObjectDetectionModelMetadata"|"textExtractionModelMetadata"|"textSentimentModelMetadata"|undefined} modelMetadata + * @memberof google.cloud.automl.v1.Model + * @instance + */ + Object.defineProperty(Model.prototype, "modelMetadata", { + get: $util.oneOfGetter($oneOfFields = ["translationModelMetadata", "imageClassificationModelMetadata", "textClassificationModelMetadata", "imageObjectDetectionModelMetadata", "textExtractionModelMetadata", "textSentimentModelMetadata"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new Model instance using the specified properties. + * @function create + * @memberof google.cloud.automl.v1.Model + * @static + * @param {google.cloud.automl.v1.IModel=} [properties] Properties to set + * @returns {google.cloud.automl.v1.Model} Model instance + */ + Model.create = function create(properties) { + return new Model(properties); + }; + + /** + * Encodes the specified Model message. Does not implicitly {@link google.cloud.automl.v1.Model.verify|verify} messages. + * @function encode + * @memberof google.cloud.automl.v1.Model + * @static + * @param {google.cloud.automl.v1.IModel} message Model message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Model.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.displayName != null && Object.hasOwnProperty.call(message, "displayName")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.displayName); + if (message.datasetId != null && Object.hasOwnProperty.call(message, "datasetId")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.datasetId); + if (message.createTime != null && Object.hasOwnProperty.call(message, "createTime")) + $root.google.protobuf.Timestamp.encode(message.createTime, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + if (message.deploymentState != null && Object.hasOwnProperty.call(message, "deploymentState")) + writer.uint32(/* id 8, wireType 0 =*/64).int32(message.deploymentState); + if (message.etag != null && Object.hasOwnProperty.call(message, "etag")) + writer.uint32(/* id 10, wireType 2 =*/82).string(message.etag); + if (message.updateTime != null && Object.hasOwnProperty.call(message, "updateTime")) + $root.google.protobuf.Timestamp.encode(message.updateTime, writer.uint32(/* id 11, wireType 2 =*/90).fork()).ldelim(); + if (message.imageClassificationModelMetadata != null && Object.hasOwnProperty.call(message, "imageClassificationModelMetadata")) + $root.google.cloud.automl.v1.ImageClassificationModelMetadata.encode(message.imageClassificationModelMetadata, writer.uint32(/* id 13, wireType 2 =*/106).fork()).ldelim(); + if (message.textClassificationModelMetadata != null && Object.hasOwnProperty.call(message, "textClassificationModelMetadata")) + $root.google.cloud.automl.v1.TextClassificationModelMetadata.encode(message.textClassificationModelMetadata, writer.uint32(/* id 14, wireType 2 =*/114).fork()).ldelim(); + if (message.translationModelMetadata != null && Object.hasOwnProperty.call(message, "translationModelMetadata")) + $root.google.cloud.automl.v1.TranslationModelMetadata.encode(message.translationModelMetadata, writer.uint32(/* id 15, wireType 2 =*/122).fork()).ldelim(); + if (message.textExtractionModelMetadata != null && Object.hasOwnProperty.call(message, "textExtractionModelMetadata")) + $root.google.cloud.automl.v1.TextExtractionModelMetadata.encode(message.textExtractionModelMetadata, writer.uint32(/* id 19, wireType 2 =*/154).fork()).ldelim(); + if (message.imageObjectDetectionModelMetadata != null && Object.hasOwnProperty.call(message, "imageObjectDetectionModelMetadata")) + $root.google.cloud.automl.v1.ImageObjectDetectionModelMetadata.encode(message.imageObjectDetectionModelMetadata, writer.uint32(/* id 20, wireType 2 =*/162).fork()).ldelim(); + if (message.textSentimentModelMetadata != null && Object.hasOwnProperty.call(message, "textSentimentModelMetadata")) + $root.google.cloud.automl.v1.TextSentimentModelMetadata.encode(message.textSentimentModelMetadata, writer.uint32(/* id 22, wireType 2 =*/178).fork()).ldelim(); + if (message.labels != null && Object.hasOwnProperty.call(message, "labels")) + for (var keys = Object.keys(message.labels), i = 0; i < keys.length; ++i) + writer.uint32(/* id 34, wireType 2 =*/274).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.labels[keys[i]]).ldelim(); + return writer; + }; + + /** + * Encodes the specified Model message, length delimited. Does not implicitly {@link google.cloud.automl.v1.Model.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.automl.v1.Model + * @static + * @param {google.cloud.automl.v1.IModel} message Model message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Model.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Model message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.automl.v1.Model + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.automl.v1.Model} Model + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Model.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.automl.v1.Model(), key, value; + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 15: { + message.translationModelMetadata = $root.google.cloud.automl.v1.TranslationModelMetadata.decode(reader, reader.uint32()); + break; + } + case 13: { + message.imageClassificationModelMetadata = $root.google.cloud.automl.v1.ImageClassificationModelMetadata.decode(reader, reader.uint32()); + break; + } + case 14: { + message.textClassificationModelMetadata = $root.google.cloud.automl.v1.TextClassificationModelMetadata.decode(reader, reader.uint32()); + break; + } + case 20: { + message.imageObjectDetectionModelMetadata = $root.google.cloud.automl.v1.ImageObjectDetectionModelMetadata.decode(reader, reader.uint32()); + break; + } + case 19: { + message.textExtractionModelMetadata = $root.google.cloud.automl.v1.TextExtractionModelMetadata.decode(reader, reader.uint32()); + break; + } + case 22: { + message.textSentimentModelMetadata = $root.google.cloud.automl.v1.TextSentimentModelMetadata.decode(reader, reader.uint32()); + break; + } + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.displayName = reader.string(); + break; + } + case 3: { + message.datasetId = reader.string(); + break; + } + case 7: { + message.createTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 11: { + message.updateTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 8: { + message.deploymentState = reader.int32(); + break; + } + case 10: { + message.etag = reader.string(); + break; + } + case 34: { + if (message.labels === $util.emptyObject) + message.labels = {}; + 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.labels[key] = value; + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Model message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.automl.v1.Model + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.automl.v1.Model} Model + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Model.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Model message. + * @function verify + * @memberof google.cloud.automl.v1.Model + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Model.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.translationModelMetadata != null && message.hasOwnProperty("translationModelMetadata")) { + properties.modelMetadata = 1; + { + var error = $root.google.cloud.automl.v1.TranslationModelMetadata.verify(message.translationModelMetadata); + if (error) + return "translationModelMetadata." + error; + } + } + if (message.imageClassificationModelMetadata != null && message.hasOwnProperty("imageClassificationModelMetadata")) { + if (properties.modelMetadata === 1) + return "modelMetadata: multiple values"; + properties.modelMetadata = 1; + { + var error = $root.google.cloud.automl.v1.ImageClassificationModelMetadata.verify(message.imageClassificationModelMetadata); + if (error) + return "imageClassificationModelMetadata." + error; + } + } + if (message.textClassificationModelMetadata != null && message.hasOwnProperty("textClassificationModelMetadata")) { + if (properties.modelMetadata === 1) + return "modelMetadata: multiple values"; + properties.modelMetadata = 1; + { + var error = $root.google.cloud.automl.v1.TextClassificationModelMetadata.verify(message.textClassificationModelMetadata); + if (error) + return "textClassificationModelMetadata." + error; + } + } + if (message.imageObjectDetectionModelMetadata != null && message.hasOwnProperty("imageObjectDetectionModelMetadata")) { + if (properties.modelMetadata === 1) + return "modelMetadata: multiple values"; + properties.modelMetadata = 1; + { + var error = $root.google.cloud.automl.v1.ImageObjectDetectionModelMetadata.verify(message.imageObjectDetectionModelMetadata); + if (error) + return "imageObjectDetectionModelMetadata." + error; + } + } + if (message.textExtractionModelMetadata != null && message.hasOwnProperty("textExtractionModelMetadata")) { + if (properties.modelMetadata === 1) + return "modelMetadata: multiple values"; + properties.modelMetadata = 1; + { + var error = $root.google.cloud.automl.v1.TextExtractionModelMetadata.verify(message.textExtractionModelMetadata); + if (error) + return "textExtractionModelMetadata." + error; + } + } + if (message.textSentimentModelMetadata != null && message.hasOwnProperty("textSentimentModelMetadata")) { + if (properties.modelMetadata === 1) + return "modelMetadata: multiple values"; + properties.modelMetadata = 1; + { + var error = $root.google.cloud.automl.v1.TextSentimentModelMetadata.verify(message.textSentimentModelMetadata); + if (error) + return "textSentimentModelMetadata." + error; + } + } + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.displayName != null && message.hasOwnProperty("displayName")) + if (!$util.isString(message.displayName)) + return "displayName: string expected"; + if (message.datasetId != null && message.hasOwnProperty("datasetId")) + if (!$util.isString(message.datasetId)) + return "datasetId: string expected"; + 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.deploymentState != null && message.hasOwnProperty("deploymentState")) + switch (message.deploymentState) { + default: + return "deploymentState: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.etag != null && message.hasOwnProperty("etag")) + if (!$util.isString(message.etag)) + return "etag: string expected"; + if (message.labels != null && message.hasOwnProperty("labels")) { + if (!$util.isObject(message.labels)) + return "labels: object expected"; + var key = Object.keys(message.labels); + for (var i = 0; i < key.length; ++i) + if (!$util.isString(message.labels[key[i]])) + return "labels: string{k:string} expected"; + } + return null; + }; + + /** + * Creates a Model message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.automl.v1.Model + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.automl.v1.Model} Model + */ + Model.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.automl.v1.Model) + return object; + var message = new $root.google.cloud.automl.v1.Model(); + if (object.translationModelMetadata != null) { + if (typeof object.translationModelMetadata !== "object") + throw TypeError(".google.cloud.automl.v1.Model.translationModelMetadata: object expected"); + message.translationModelMetadata = $root.google.cloud.automl.v1.TranslationModelMetadata.fromObject(object.translationModelMetadata); + } + if (object.imageClassificationModelMetadata != null) { + if (typeof object.imageClassificationModelMetadata !== "object") + throw TypeError(".google.cloud.automl.v1.Model.imageClassificationModelMetadata: object expected"); + message.imageClassificationModelMetadata = $root.google.cloud.automl.v1.ImageClassificationModelMetadata.fromObject(object.imageClassificationModelMetadata); + } + if (object.textClassificationModelMetadata != null) { + if (typeof object.textClassificationModelMetadata !== "object") + throw TypeError(".google.cloud.automl.v1.Model.textClassificationModelMetadata: object expected"); + message.textClassificationModelMetadata = $root.google.cloud.automl.v1.TextClassificationModelMetadata.fromObject(object.textClassificationModelMetadata); + } + if (object.imageObjectDetectionModelMetadata != null) { + if (typeof object.imageObjectDetectionModelMetadata !== "object") + throw TypeError(".google.cloud.automl.v1.Model.imageObjectDetectionModelMetadata: object expected"); + message.imageObjectDetectionModelMetadata = $root.google.cloud.automl.v1.ImageObjectDetectionModelMetadata.fromObject(object.imageObjectDetectionModelMetadata); + } + if (object.textExtractionModelMetadata != null) { + if (typeof object.textExtractionModelMetadata !== "object") + throw TypeError(".google.cloud.automl.v1.Model.textExtractionModelMetadata: object expected"); + message.textExtractionModelMetadata = $root.google.cloud.automl.v1.TextExtractionModelMetadata.fromObject(object.textExtractionModelMetadata); + } + if (object.textSentimentModelMetadata != null) { + if (typeof object.textSentimentModelMetadata !== "object") + throw TypeError(".google.cloud.automl.v1.Model.textSentimentModelMetadata: object expected"); + message.textSentimentModelMetadata = $root.google.cloud.automl.v1.TextSentimentModelMetadata.fromObject(object.textSentimentModelMetadata); + } + if (object.name != null) + message.name = String(object.name); + if (object.displayName != null) + message.displayName = String(object.displayName); + if (object.datasetId != null) + message.datasetId = String(object.datasetId); + if (object.createTime != null) { + if (typeof object.createTime !== "object") + throw TypeError(".google.cloud.automl.v1.Model.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.automl.v1.Model.updateTime: object expected"); + message.updateTime = $root.google.protobuf.Timestamp.fromObject(object.updateTime); + } + switch (object.deploymentState) { + default: + if (typeof object.deploymentState === "number") { + message.deploymentState = object.deploymentState; + break; + } + break; + case "DEPLOYMENT_STATE_UNSPECIFIED": + case 0: + message.deploymentState = 0; + break; + case "DEPLOYED": + case 1: + message.deploymentState = 1; + break; + case "UNDEPLOYED": + case 2: + message.deploymentState = 2; + break; + } + if (object.etag != null) + message.etag = String(object.etag); + if (object.labels) { + if (typeof object.labels !== "object") + throw TypeError(".google.cloud.automl.v1.Model.labels: object expected"); + message.labels = {}; + for (var keys = Object.keys(object.labels), i = 0; i < keys.length; ++i) + message.labels[keys[i]] = String(object.labels[keys[i]]); + } + return message; + }; + + /** + * Creates a plain object from a Model message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.automl.v1.Model + * @static + * @param {google.cloud.automl.v1.Model} message Model + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Model.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.objects || options.defaults) + object.labels = {}; + if (options.defaults) { + object.name = ""; + object.displayName = ""; + object.datasetId = ""; + object.createTime = null; + object.deploymentState = options.enums === String ? "DEPLOYMENT_STATE_UNSPECIFIED" : 0; + object.etag = ""; + object.updateTime = null; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.displayName != null && message.hasOwnProperty("displayName")) + object.displayName = message.displayName; + if (message.datasetId != null && message.hasOwnProperty("datasetId")) + object.datasetId = message.datasetId; + if (message.createTime != null && message.hasOwnProperty("createTime")) + object.createTime = $root.google.protobuf.Timestamp.toObject(message.createTime, options); + if (message.deploymentState != null && message.hasOwnProperty("deploymentState")) + object.deploymentState = options.enums === String ? $root.google.cloud.automl.v1.Model.DeploymentState[message.deploymentState] === undefined ? message.deploymentState : $root.google.cloud.automl.v1.Model.DeploymentState[message.deploymentState] : message.deploymentState; + if (message.etag != null && message.hasOwnProperty("etag")) + object.etag = message.etag; + if (message.updateTime != null && message.hasOwnProperty("updateTime")) + object.updateTime = $root.google.protobuf.Timestamp.toObject(message.updateTime, options); + if (message.imageClassificationModelMetadata != null && message.hasOwnProperty("imageClassificationModelMetadata")) { + object.imageClassificationModelMetadata = $root.google.cloud.automl.v1.ImageClassificationModelMetadata.toObject(message.imageClassificationModelMetadata, options); + if (options.oneofs) + object.modelMetadata = "imageClassificationModelMetadata"; + } + if (message.textClassificationModelMetadata != null && message.hasOwnProperty("textClassificationModelMetadata")) { + object.textClassificationModelMetadata = $root.google.cloud.automl.v1.TextClassificationModelMetadata.toObject(message.textClassificationModelMetadata, options); + if (options.oneofs) + object.modelMetadata = "textClassificationModelMetadata"; + } + if (message.translationModelMetadata != null && message.hasOwnProperty("translationModelMetadata")) { + object.translationModelMetadata = $root.google.cloud.automl.v1.TranslationModelMetadata.toObject(message.translationModelMetadata, options); + if (options.oneofs) + object.modelMetadata = "translationModelMetadata"; + } + if (message.textExtractionModelMetadata != null && message.hasOwnProperty("textExtractionModelMetadata")) { + object.textExtractionModelMetadata = $root.google.cloud.automl.v1.TextExtractionModelMetadata.toObject(message.textExtractionModelMetadata, options); + if (options.oneofs) + object.modelMetadata = "textExtractionModelMetadata"; + } + if (message.imageObjectDetectionModelMetadata != null && message.hasOwnProperty("imageObjectDetectionModelMetadata")) { + object.imageObjectDetectionModelMetadata = $root.google.cloud.automl.v1.ImageObjectDetectionModelMetadata.toObject(message.imageObjectDetectionModelMetadata, options); + if (options.oneofs) + object.modelMetadata = "imageObjectDetectionModelMetadata"; + } + if (message.textSentimentModelMetadata != null && message.hasOwnProperty("textSentimentModelMetadata")) { + object.textSentimentModelMetadata = $root.google.cloud.automl.v1.TextSentimentModelMetadata.toObject(message.textSentimentModelMetadata, options); + if (options.oneofs) + object.modelMetadata = "textSentimentModelMetadata"; + } + var keys2; + if (message.labels && (keys2 = Object.keys(message.labels)).length) { + object.labels = {}; + for (var j = 0; j < keys2.length; ++j) + object.labels[keys2[j]] = message.labels[keys2[j]]; + } + return object; + }; + + /** + * Converts this Model to JSON. + * @function toJSON + * @memberof google.cloud.automl.v1.Model + * @instance + * @returns {Object.} JSON object + */ + Model.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Model + * @function getTypeUrl + * @memberof google.cloud.automl.v1.Model + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Model.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.automl.v1.Model"; + }; + + /** + * DeploymentState enum. + * @name google.cloud.automl.v1.Model.DeploymentState + * @enum {number} + * @property {number} DEPLOYMENT_STATE_UNSPECIFIED=0 DEPLOYMENT_STATE_UNSPECIFIED value + * @property {number} DEPLOYED=1 DEPLOYED value + * @property {number} UNDEPLOYED=2 UNDEPLOYED value + */ + Model.DeploymentState = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "DEPLOYMENT_STATE_UNSPECIFIED"] = 0; + values[valuesById[1] = "DEPLOYED"] = 1; + values[valuesById[2] = "UNDEPLOYED"] = 2; + return values; + })(); + + return Model; + })(); + + v1.ModelEvaluation = (function() { + + /** + * Properties of a ModelEvaluation. + * @memberof google.cloud.automl.v1 + * @interface IModelEvaluation + * @property {google.cloud.automl.v1.IClassificationEvaluationMetrics|null} [classificationEvaluationMetrics] ModelEvaluation classificationEvaluationMetrics + * @property {google.cloud.automl.v1.ITranslationEvaluationMetrics|null} [translationEvaluationMetrics] ModelEvaluation translationEvaluationMetrics + * @property {google.cloud.automl.v1.IImageObjectDetectionEvaluationMetrics|null} [imageObjectDetectionEvaluationMetrics] ModelEvaluation imageObjectDetectionEvaluationMetrics + * @property {google.cloud.automl.v1.ITextSentimentEvaluationMetrics|null} [textSentimentEvaluationMetrics] ModelEvaluation textSentimentEvaluationMetrics + * @property {google.cloud.automl.v1.ITextExtractionEvaluationMetrics|null} [textExtractionEvaluationMetrics] ModelEvaluation textExtractionEvaluationMetrics + * @property {string|null} [name] ModelEvaluation name + * @property {string|null} [annotationSpecId] ModelEvaluation annotationSpecId + * @property {string|null} [displayName] ModelEvaluation displayName + * @property {google.protobuf.ITimestamp|null} [createTime] ModelEvaluation createTime + * @property {number|null} [evaluatedExampleCount] ModelEvaluation evaluatedExampleCount + */ + + /** + * Constructs a new ModelEvaluation. + * @memberof google.cloud.automl.v1 + * @classdesc Represents a ModelEvaluation. + * @implements IModelEvaluation + * @constructor + * @param {google.cloud.automl.v1.IModelEvaluation=} [properties] Properties to set + */ + function ModelEvaluation(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ModelEvaluation classificationEvaluationMetrics. + * @member {google.cloud.automl.v1.IClassificationEvaluationMetrics|null|undefined} classificationEvaluationMetrics + * @memberof google.cloud.automl.v1.ModelEvaluation + * @instance + */ + ModelEvaluation.prototype.classificationEvaluationMetrics = null; + + /** + * ModelEvaluation translationEvaluationMetrics. + * @member {google.cloud.automl.v1.ITranslationEvaluationMetrics|null|undefined} translationEvaluationMetrics + * @memberof google.cloud.automl.v1.ModelEvaluation + * @instance + */ + ModelEvaluation.prototype.translationEvaluationMetrics = null; + + /** + * ModelEvaluation imageObjectDetectionEvaluationMetrics. + * @member {google.cloud.automl.v1.IImageObjectDetectionEvaluationMetrics|null|undefined} imageObjectDetectionEvaluationMetrics + * @memberof google.cloud.automl.v1.ModelEvaluation + * @instance + */ + ModelEvaluation.prototype.imageObjectDetectionEvaluationMetrics = null; + + /** + * ModelEvaluation textSentimentEvaluationMetrics. + * @member {google.cloud.automl.v1.ITextSentimentEvaluationMetrics|null|undefined} textSentimentEvaluationMetrics + * @memberof google.cloud.automl.v1.ModelEvaluation + * @instance + */ + ModelEvaluation.prototype.textSentimentEvaluationMetrics = null; + + /** + * ModelEvaluation textExtractionEvaluationMetrics. + * @member {google.cloud.automl.v1.ITextExtractionEvaluationMetrics|null|undefined} textExtractionEvaluationMetrics + * @memberof google.cloud.automl.v1.ModelEvaluation + * @instance + */ + ModelEvaluation.prototype.textExtractionEvaluationMetrics = null; + + /** + * ModelEvaluation name. + * @member {string} name + * @memberof google.cloud.automl.v1.ModelEvaluation + * @instance + */ + ModelEvaluation.prototype.name = ""; + + /** + * ModelEvaluation annotationSpecId. + * @member {string} annotationSpecId + * @memberof google.cloud.automl.v1.ModelEvaluation + * @instance + */ + ModelEvaluation.prototype.annotationSpecId = ""; + + /** + * ModelEvaluation displayName. + * @member {string} displayName + * @memberof google.cloud.automl.v1.ModelEvaluation + * @instance + */ + ModelEvaluation.prototype.displayName = ""; + + /** + * ModelEvaluation createTime. + * @member {google.protobuf.ITimestamp|null|undefined} createTime + * @memberof google.cloud.automl.v1.ModelEvaluation + * @instance + */ + ModelEvaluation.prototype.createTime = null; + + /** + * ModelEvaluation evaluatedExampleCount. + * @member {number} evaluatedExampleCount + * @memberof google.cloud.automl.v1.ModelEvaluation + * @instance + */ + ModelEvaluation.prototype.evaluatedExampleCount = 0; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * ModelEvaluation metrics. + * @member {"classificationEvaluationMetrics"|"translationEvaluationMetrics"|"imageObjectDetectionEvaluationMetrics"|"textSentimentEvaluationMetrics"|"textExtractionEvaluationMetrics"|undefined} metrics + * @memberof google.cloud.automl.v1.ModelEvaluation + * @instance + */ + Object.defineProperty(ModelEvaluation.prototype, "metrics", { + get: $util.oneOfGetter($oneOfFields = ["classificationEvaluationMetrics", "translationEvaluationMetrics", "imageObjectDetectionEvaluationMetrics", "textSentimentEvaluationMetrics", "textExtractionEvaluationMetrics"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new ModelEvaluation instance using the specified properties. + * @function create + * @memberof google.cloud.automl.v1.ModelEvaluation + * @static + * @param {google.cloud.automl.v1.IModelEvaluation=} [properties] Properties to set + * @returns {google.cloud.automl.v1.ModelEvaluation} ModelEvaluation instance + */ + ModelEvaluation.create = function create(properties) { + return new ModelEvaluation(properties); + }; + + /** + * Encodes the specified ModelEvaluation message. Does not implicitly {@link google.cloud.automl.v1.ModelEvaluation.verify|verify} messages. + * @function encode + * @memberof google.cloud.automl.v1.ModelEvaluation + * @static + * @param {google.cloud.automl.v1.IModelEvaluation} message ModelEvaluation message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ModelEvaluation.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.annotationSpecId != null && Object.hasOwnProperty.call(message, "annotationSpecId")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.annotationSpecId); + if (message.createTime != null && Object.hasOwnProperty.call(message, "createTime")) + $root.google.protobuf.Timestamp.encode(message.createTime, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.evaluatedExampleCount != null && Object.hasOwnProperty.call(message, "evaluatedExampleCount")) + writer.uint32(/* id 6, wireType 0 =*/48).int32(message.evaluatedExampleCount); + if (message.classificationEvaluationMetrics != null && Object.hasOwnProperty.call(message, "classificationEvaluationMetrics")) + $root.google.cloud.automl.v1.ClassificationEvaluationMetrics.encode(message.classificationEvaluationMetrics, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); + if (message.translationEvaluationMetrics != null && Object.hasOwnProperty.call(message, "translationEvaluationMetrics")) + $root.google.cloud.automl.v1.TranslationEvaluationMetrics.encode(message.translationEvaluationMetrics, writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim(); + if (message.textSentimentEvaluationMetrics != null && Object.hasOwnProperty.call(message, "textSentimentEvaluationMetrics")) + $root.google.cloud.automl.v1.TextSentimentEvaluationMetrics.encode(message.textSentimentEvaluationMetrics, writer.uint32(/* id 11, wireType 2 =*/90).fork()).ldelim(); + if (message.imageObjectDetectionEvaluationMetrics != null && Object.hasOwnProperty.call(message, "imageObjectDetectionEvaluationMetrics")) + $root.google.cloud.automl.v1.ImageObjectDetectionEvaluationMetrics.encode(message.imageObjectDetectionEvaluationMetrics, writer.uint32(/* id 12, wireType 2 =*/98).fork()).ldelim(); + if (message.textExtractionEvaluationMetrics != null && Object.hasOwnProperty.call(message, "textExtractionEvaluationMetrics")) + $root.google.cloud.automl.v1.TextExtractionEvaluationMetrics.encode(message.textExtractionEvaluationMetrics, writer.uint32(/* id 13, wireType 2 =*/106).fork()).ldelim(); + if (message.displayName != null && Object.hasOwnProperty.call(message, "displayName")) + writer.uint32(/* id 15, wireType 2 =*/122).string(message.displayName); + return writer; + }; + + /** + * Encodes the specified ModelEvaluation message, length delimited. Does not implicitly {@link google.cloud.automl.v1.ModelEvaluation.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.automl.v1.ModelEvaluation + * @static + * @param {google.cloud.automl.v1.IModelEvaluation} message ModelEvaluation message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ModelEvaluation.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ModelEvaluation message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.automl.v1.ModelEvaluation + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.automl.v1.ModelEvaluation} ModelEvaluation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ModelEvaluation.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.automl.v1.ModelEvaluation(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 8: { + message.classificationEvaluationMetrics = $root.google.cloud.automl.v1.ClassificationEvaluationMetrics.decode(reader, reader.uint32()); + break; + } + case 9: { + message.translationEvaluationMetrics = $root.google.cloud.automl.v1.TranslationEvaluationMetrics.decode(reader, reader.uint32()); + break; + } + case 12: { + message.imageObjectDetectionEvaluationMetrics = $root.google.cloud.automl.v1.ImageObjectDetectionEvaluationMetrics.decode(reader, reader.uint32()); + break; + } + case 11: { + message.textSentimentEvaluationMetrics = $root.google.cloud.automl.v1.TextSentimentEvaluationMetrics.decode(reader, reader.uint32()); + break; + } + case 13: { + message.textExtractionEvaluationMetrics = $root.google.cloud.automl.v1.TextExtractionEvaluationMetrics.decode(reader, reader.uint32()); + break; + } + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.annotationSpecId = reader.string(); + break; + } + case 15: { + message.displayName = reader.string(); + break; + } + case 5: { + message.createTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 6: { + message.evaluatedExampleCount = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ModelEvaluation message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.automl.v1.ModelEvaluation + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.automl.v1.ModelEvaluation} ModelEvaluation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ModelEvaluation.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ModelEvaluation message. + * @function verify + * @memberof google.cloud.automl.v1.ModelEvaluation + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ModelEvaluation.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.classificationEvaluationMetrics != null && message.hasOwnProperty("classificationEvaluationMetrics")) { + properties.metrics = 1; + { + var error = $root.google.cloud.automl.v1.ClassificationEvaluationMetrics.verify(message.classificationEvaluationMetrics); + if (error) + return "classificationEvaluationMetrics." + error; + } + } + if (message.translationEvaluationMetrics != null && message.hasOwnProperty("translationEvaluationMetrics")) { + if (properties.metrics === 1) + return "metrics: multiple values"; + properties.metrics = 1; + { + var error = $root.google.cloud.automl.v1.TranslationEvaluationMetrics.verify(message.translationEvaluationMetrics); + if (error) + return "translationEvaluationMetrics." + error; + } + } + if (message.imageObjectDetectionEvaluationMetrics != null && message.hasOwnProperty("imageObjectDetectionEvaluationMetrics")) { + if (properties.metrics === 1) + return "metrics: multiple values"; + properties.metrics = 1; + { + var error = $root.google.cloud.automl.v1.ImageObjectDetectionEvaluationMetrics.verify(message.imageObjectDetectionEvaluationMetrics); + if (error) + return "imageObjectDetectionEvaluationMetrics." + error; + } + } + if (message.textSentimentEvaluationMetrics != null && message.hasOwnProperty("textSentimentEvaluationMetrics")) { + if (properties.metrics === 1) + return "metrics: multiple values"; + properties.metrics = 1; + { + var error = $root.google.cloud.automl.v1.TextSentimentEvaluationMetrics.verify(message.textSentimentEvaluationMetrics); + if (error) + return "textSentimentEvaluationMetrics." + error; + } + } + if (message.textExtractionEvaluationMetrics != null && message.hasOwnProperty("textExtractionEvaluationMetrics")) { + if (properties.metrics === 1) + return "metrics: multiple values"; + properties.metrics = 1; + { + var error = $root.google.cloud.automl.v1.TextExtractionEvaluationMetrics.verify(message.textExtractionEvaluationMetrics); + if (error) + return "textExtractionEvaluationMetrics." + error; + } + } + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.annotationSpecId != null && message.hasOwnProperty("annotationSpecId")) + if (!$util.isString(message.annotationSpecId)) + return "annotationSpecId: string expected"; + if (message.displayName != null && message.hasOwnProperty("displayName")) + if (!$util.isString(message.displayName)) + return "displayName: string expected"; + if (message.createTime != null && message.hasOwnProperty("createTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.createTime); + if (error) + return "createTime." + error; + } + if (message.evaluatedExampleCount != null && message.hasOwnProperty("evaluatedExampleCount")) + if (!$util.isInteger(message.evaluatedExampleCount)) + return "evaluatedExampleCount: integer expected"; + return null; + }; + + /** + * Creates a ModelEvaluation message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.automl.v1.ModelEvaluation + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.automl.v1.ModelEvaluation} ModelEvaluation + */ + ModelEvaluation.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.automl.v1.ModelEvaluation) + return object; + var message = new $root.google.cloud.automl.v1.ModelEvaluation(); + if (object.classificationEvaluationMetrics != null) { + if (typeof object.classificationEvaluationMetrics !== "object") + throw TypeError(".google.cloud.automl.v1.ModelEvaluation.classificationEvaluationMetrics: object expected"); + message.classificationEvaluationMetrics = $root.google.cloud.automl.v1.ClassificationEvaluationMetrics.fromObject(object.classificationEvaluationMetrics); + } + if (object.translationEvaluationMetrics != null) { + if (typeof object.translationEvaluationMetrics !== "object") + throw TypeError(".google.cloud.automl.v1.ModelEvaluation.translationEvaluationMetrics: object expected"); + message.translationEvaluationMetrics = $root.google.cloud.automl.v1.TranslationEvaluationMetrics.fromObject(object.translationEvaluationMetrics); + } + if (object.imageObjectDetectionEvaluationMetrics != null) { + if (typeof object.imageObjectDetectionEvaluationMetrics !== "object") + throw TypeError(".google.cloud.automl.v1.ModelEvaluation.imageObjectDetectionEvaluationMetrics: object expected"); + message.imageObjectDetectionEvaluationMetrics = $root.google.cloud.automl.v1.ImageObjectDetectionEvaluationMetrics.fromObject(object.imageObjectDetectionEvaluationMetrics); + } + if (object.textSentimentEvaluationMetrics != null) { + if (typeof object.textSentimentEvaluationMetrics !== "object") + throw TypeError(".google.cloud.automl.v1.ModelEvaluation.textSentimentEvaluationMetrics: object expected"); + message.textSentimentEvaluationMetrics = $root.google.cloud.automl.v1.TextSentimentEvaluationMetrics.fromObject(object.textSentimentEvaluationMetrics); + } + if (object.textExtractionEvaluationMetrics != null) { + if (typeof object.textExtractionEvaluationMetrics !== "object") + throw TypeError(".google.cloud.automl.v1.ModelEvaluation.textExtractionEvaluationMetrics: object expected"); + message.textExtractionEvaluationMetrics = $root.google.cloud.automl.v1.TextExtractionEvaluationMetrics.fromObject(object.textExtractionEvaluationMetrics); + } + if (object.name != null) + message.name = String(object.name); + if (object.annotationSpecId != null) + message.annotationSpecId = String(object.annotationSpecId); + if (object.displayName != null) + message.displayName = String(object.displayName); + if (object.createTime != null) { + if (typeof object.createTime !== "object") + throw TypeError(".google.cloud.automl.v1.ModelEvaluation.createTime: object expected"); + message.createTime = $root.google.protobuf.Timestamp.fromObject(object.createTime); + } + if (object.evaluatedExampleCount != null) + message.evaluatedExampleCount = object.evaluatedExampleCount | 0; + return message; + }; + + /** + * Creates a plain object from a ModelEvaluation message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.automl.v1.ModelEvaluation + * @static + * @param {google.cloud.automl.v1.ModelEvaluation} message ModelEvaluation + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ModelEvaluation.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.annotationSpecId = ""; + object.createTime = null; + object.evaluatedExampleCount = 0; + object.displayName = ""; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.annotationSpecId != null && message.hasOwnProperty("annotationSpecId")) + object.annotationSpecId = message.annotationSpecId; + if (message.createTime != null && message.hasOwnProperty("createTime")) + object.createTime = $root.google.protobuf.Timestamp.toObject(message.createTime, options); + if (message.evaluatedExampleCount != null && message.hasOwnProperty("evaluatedExampleCount")) + object.evaluatedExampleCount = message.evaluatedExampleCount; + if (message.classificationEvaluationMetrics != null && message.hasOwnProperty("classificationEvaluationMetrics")) { + object.classificationEvaluationMetrics = $root.google.cloud.automl.v1.ClassificationEvaluationMetrics.toObject(message.classificationEvaluationMetrics, options); + if (options.oneofs) + object.metrics = "classificationEvaluationMetrics"; + } + if (message.translationEvaluationMetrics != null && message.hasOwnProperty("translationEvaluationMetrics")) { + object.translationEvaluationMetrics = $root.google.cloud.automl.v1.TranslationEvaluationMetrics.toObject(message.translationEvaluationMetrics, options); + if (options.oneofs) + object.metrics = "translationEvaluationMetrics"; + } + if (message.textSentimentEvaluationMetrics != null && message.hasOwnProperty("textSentimentEvaluationMetrics")) { + object.textSentimentEvaluationMetrics = $root.google.cloud.automl.v1.TextSentimentEvaluationMetrics.toObject(message.textSentimentEvaluationMetrics, options); + if (options.oneofs) + object.metrics = "textSentimentEvaluationMetrics"; + } + if (message.imageObjectDetectionEvaluationMetrics != null && message.hasOwnProperty("imageObjectDetectionEvaluationMetrics")) { + object.imageObjectDetectionEvaluationMetrics = $root.google.cloud.automl.v1.ImageObjectDetectionEvaluationMetrics.toObject(message.imageObjectDetectionEvaluationMetrics, options); + if (options.oneofs) + object.metrics = "imageObjectDetectionEvaluationMetrics"; + } + if (message.textExtractionEvaluationMetrics != null && message.hasOwnProperty("textExtractionEvaluationMetrics")) { + object.textExtractionEvaluationMetrics = $root.google.cloud.automl.v1.TextExtractionEvaluationMetrics.toObject(message.textExtractionEvaluationMetrics, options); + if (options.oneofs) + object.metrics = "textExtractionEvaluationMetrics"; + } + if (message.displayName != null && message.hasOwnProperty("displayName")) + object.displayName = message.displayName; + return object; + }; + + /** + * Converts this ModelEvaluation to JSON. + * @function toJSON + * @memberof google.cloud.automl.v1.ModelEvaluation + * @instance + * @returns {Object.} JSON object + */ + ModelEvaluation.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ModelEvaluation + * @function getTypeUrl + * @memberof google.cloud.automl.v1.ModelEvaluation + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ModelEvaluation.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.automl.v1.ModelEvaluation"; + }; + + return ModelEvaluation; + })(); + + v1.OperationMetadata = (function() { + + /** + * Properties of an OperationMetadata. + * @memberof google.cloud.automl.v1 + * @interface IOperationMetadata + * @property {google.cloud.automl.v1.IDeleteOperationMetadata|null} [deleteDetails] OperationMetadata deleteDetails + * @property {google.cloud.automl.v1.IDeployModelOperationMetadata|null} [deployModelDetails] OperationMetadata deployModelDetails + * @property {google.cloud.automl.v1.IUndeployModelOperationMetadata|null} [undeployModelDetails] OperationMetadata undeployModelDetails + * @property {google.cloud.automl.v1.ICreateModelOperationMetadata|null} [createModelDetails] OperationMetadata createModelDetails + * @property {google.cloud.automl.v1.ICreateDatasetOperationMetadata|null} [createDatasetDetails] OperationMetadata createDatasetDetails + * @property {google.cloud.automl.v1.IImportDataOperationMetadata|null} [importDataDetails] OperationMetadata importDataDetails + * @property {google.cloud.automl.v1.IBatchPredictOperationMetadata|null} [batchPredictDetails] OperationMetadata batchPredictDetails + * @property {google.cloud.automl.v1.IExportDataOperationMetadata|null} [exportDataDetails] OperationMetadata exportDataDetails + * @property {google.cloud.automl.v1.IExportModelOperationMetadata|null} [exportModelDetails] OperationMetadata exportModelDetails + * @property {number|null} [progressPercent] OperationMetadata progressPercent + * @property {Array.|null} [partialFailures] OperationMetadata partialFailures + * @property {google.protobuf.ITimestamp|null} [createTime] OperationMetadata createTime + * @property {google.protobuf.ITimestamp|null} [updateTime] OperationMetadata updateTime + */ + + /** + * Constructs a new OperationMetadata. + * @memberof google.cloud.automl.v1 + * @classdesc Represents an OperationMetadata. + * @implements IOperationMetadata + * @constructor + * @param {google.cloud.automl.v1.IOperationMetadata=} [properties] Properties to set + */ + function OperationMetadata(properties) { + this.partialFailures = []; + if (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 deleteDetails. + * @member {google.cloud.automl.v1.IDeleteOperationMetadata|null|undefined} deleteDetails + * @memberof google.cloud.automl.v1.OperationMetadata + * @instance + */ + OperationMetadata.prototype.deleteDetails = null; + + /** + * OperationMetadata deployModelDetails. + * @member {google.cloud.automl.v1.IDeployModelOperationMetadata|null|undefined} deployModelDetails + * @memberof google.cloud.automl.v1.OperationMetadata + * @instance + */ + OperationMetadata.prototype.deployModelDetails = null; + + /** + * OperationMetadata undeployModelDetails. + * @member {google.cloud.automl.v1.IUndeployModelOperationMetadata|null|undefined} undeployModelDetails + * @memberof google.cloud.automl.v1.OperationMetadata + * @instance + */ + OperationMetadata.prototype.undeployModelDetails = null; + + /** + * OperationMetadata createModelDetails. + * @member {google.cloud.automl.v1.ICreateModelOperationMetadata|null|undefined} createModelDetails + * @memberof google.cloud.automl.v1.OperationMetadata + * @instance + */ + OperationMetadata.prototype.createModelDetails = null; + + /** + * OperationMetadata createDatasetDetails. + * @member {google.cloud.automl.v1.ICreateDatasetOperationMetadata|null|undefined} createDatasetDetails + * @memberof google.cloud.automl.v1.OperationMetadata + * @instance + */ + OperationMetadata.prototype.createDatasetDetails = null; + + /** + * OperationMetadata importDataDetails. + * @member {google.cloud.automl.v1.IImportDataOperationMetadata|null|undefined} importDataDetails + * @memberof google.cloud.automl.v1.OperationMetadata + * @instance + */ + OperationMetadata.prototype.importDataDetails = null; + + /** + * OperationMetadata batchPredictDetails. + * @member {google.cloud.automl.v1.IBatchPredictOperationMetadata|null|undefined} batchPredictDetails + * @memberof google.cloud.automl.v1.OperationMetadata + * @instance + */ + OperationMetadata.prototype.batchPredictDetails = null; + + /** + * OperationMetadata exportDataDetails. + * @member {google.cloud.automl.v1.IExportDataOperationMetadata|null|undefined} exportDataDetails + * @memberof google.cloud.automl.v1.OperationMetadata + * @instance + */ + OperationMetadata.prototype.exportDataDetails = null; + + /** + * OperationMetadata exportModelDetails. + * @member {google.cloud.automl.v1.IExportModelOperationMetadata|null|undefined} exportModelDetails + * @memberof google.cloud.automl.v1.OperationMetadata + * @instance + */ + OperationMetadata.prototype.exportModelDetails = null; + + /** + * OperationMetadata progressPercent. + * @member {number} progressPercent + * @memberof google.cloud.automl.v1.OperationMetadata + * @instance + */ + OperationMetadata.prototype.progressPercent = 0; + + /** + * OperationMetadata partialFailures. + * @member {Array.} partialFailures + * @memberof google.cloud.automl.v1.OperationMetadata + * @instance + */ + OperationMetadata.prototype.partialFailures = $util.emptyArray; + + /** + * OperationMetadata createTime. + * @member {google.protobuf.ITimestamp|null|undefined} createTime + * @memberof google.cloud.automl.v1.OperationMetadata + * @instance + */ + OperationMetadata.prototype.createTime = null; + + /** + * OperationMetadata updateTime. + * @member {google.protobuf.ITimestamp|null|undefined} updateTime + * @memberof google.cloud.automl.v1.OperationMetadata + * @instance + */ + OperationMetadata.prototype.updateTime = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * OperationMetadata details. + * @member {"deleteDetails"|"deployModelDetails"|"undeployModelDetails"|"createModelDetails"|"createDatasetDetails"|"importDataDetails"|"batchPredictDetails"|"exportDataDetails"|"exportModelDetails"|undefined} details + * @memberof google.cloud.automl.v1.OperationMetadata + * @instance + */ + Object.defineProperty(OperationMetadata.prototype, "details", { + get: $util.oneOfGetter($oneOfFields = ["deleteDetails", "deployModelDetails", "undeployModelDetails", "createModelDetails", "createDatasetDetails", "importDataDetails", "batchPredictDetails", "exportDataDetails", "exportModelDetails"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new OperationMetadata instance using the specified properties. + * @function create + * @memberof google.cloud.automl.v1.OperationMetadata + * @static + * @param {google.cloud.automl.v1.IOperationMetadata=} [properties] Properties to set + * @returns {google.cloud.automl.v1.OperationMetadata} OperationMetadata instance + */ + OperationMetadata.create = function create(properties) { + return new OperationMetadata(properties); + }; + + /** + * Encodes the specified OperationMetadata message. Does not implicitly {@link google.cloud.automl.v1.OperationMetadata.verify|verify} messages. + * @function encode + * @memberof google.cloud.automl.v1.OperationMetadata + * @static + * @param {google.cloud.automl.v1.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.partialFailures != null && message.partialFailures.length) + for (var i = 0; i < message.partialFailures.length; ++i) + $root.google.rpc.Status.encode(message.partialFailures[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.createTime != null && Object.hasOwnProperty.call(message, "createTime")) + $root.google.protobuf.Timestamp.encode(message.createTime, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.updateTime != null && Object.hasOwnProperty.call(message, "updateTime")) + $root.google.protobuf.Timestamp.encode(message.updateTime, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.deleteDetails != null && Object.hasOwnProperty.call(message, "deleteDetails")) + $root.google.cloud.automl.v1.DeleteOperationMetadata.encode(message.deleteDetails, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); + if (message.createModelDetails != null && Object.hasOwnProperty.call(message, "createModelDetails")) + $root.google.cloud.automl.v1.CreateModelOperationMetadata.encode(message.createModelDetails, writer.uint32(/* id 10, wireType 2 =*/82).fork()).ldelim(); + if (message.progressPercent != null && Object.hasOwnProperty.call(message, "progressPercent")) + writer.uint32(/* id 13, wireType 0 =*/104).int32(message.progressPercent); + if (message.importDataDetails != null && Object.hasOwnProperty.call(message, "importDataDetails")) + $root.google.cloud.automl.v1.ImportDataOperationMetadata.encode(message.importDataDetails, writer.uint32(/* id 15, wireType 2 =*/122).fork()).ldelim(); + if (message.batchPredictDetails != null && Object.hasOwnProperty.call(message, "batchPredictDetails")) + $root.google.cloud.automl.v1.BatchPredictOperationMetadata.encode(message.batchPredictDetails, writer.uint32(/* id 16, wireType 2 =*/130).fork()).ldelim(); + if (message.exportDataDetails != null && Object.hasOwnProperty.call(message, "exportDataDetails")) + $root.google.cloud.automl.v1.ExportDataOperationMetadata.encode(message.exportDataDetails, writer.uint32(/* id 21, wireType 2 =*/170).fork()).ldelim(); + if (message.exportModelDetails != null && Object.hasOwnProperty.call(message, "exportModelDetails")) + $root.google.cloud.automl.v1.ExportModelOperationMetadata.encode(message.exportModelDetails, writer.uint32(/* id 22, wireType 2 =*/178).fork()).ldelim(); + if (message.deployModelDetails != null && Object.hasOwnProperty.call(message, "deployModelDetails")) + $root.google.cloud.automl.v1.DeployModelOperationMetadata.encode(message.deployModelDetails, writer.uint32(/* id 24, wireType 2 =*/194).fork()).ldelim(); + if (message.undeployModelDetails != null && Object.hasOwnProperty.call(message, "undeployModelDetails")) + $root.google.cloud.automl.v1.UndeployModelOperationMetadata.encode(message.undeployModelDetails, writer.uint32(/* id 25, wireType 2 =*/202).fork()).ldelim(); + if (message.createDatasetDetails != null && Object.hasOwnProperty.call(message, "createDatasetDetails")) + $root.google.cloud.automl.v1.CreateDatasetOperationMetadata.encode(message.createDatasetDetails, writer.uint32(/* id 30, wireType 2 =*/242).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified OperationMetadata message, length delimited. Does not implicitly {@link google.cloud.automl.v1.OperationMetadata.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.automl.v1.OperationMetadata + * @static + * @param {google.cloud.automl.v1.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.automl.v1.OperationMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.automl.v1.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) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.automl.v1.OperationMetadata(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 8: { + message.deleteDetails = $root.google.cloud.automl.v1.DeleteOperationMetadata.decode(reader, reader.uint32()); + break; + } + case 24: { + message.deployModelDetails = $root.google.cloud.automl.v1.DeployModelOperationMetadata.decode(reader, reader.uint32()); + break; + } + case 25: { + message.undeployModelDetails = $root.google.cloud.automl.v1.UndeployModelOperationMetadata.decode(reader, reader.uint32()); + break; + } + case 10: { + message.createModelDetails = $root.google.cloud.automl.v1.CreateModelOperationMetadata.decode(reader, reader.uint32()); + break; + } + case 30: { + message.createDatasetDetails = $root.google.cloud.automl.v1.CreateDatasetOperationMetadata.decode(reader, reader.uint32()); + break; + } + case 15: { + message.importDataDetails = $root.google.cloud.automl.v1.ImportDataOperationMetadata.decode(reader, reader.uint32()); + break; + } + case 16: { + message.batchPredictDetails = $root.google.cloud.automl.v1.BatchPredictOperationMetadata.decode(reader, reader.uint32()); + break; + } + case 21: { + message.exportDataDetails = $root.google.cloud.automl.v1.ExportDataOperationMetadata.decode(reader, reader.uint32()); + break; + } + case 22: { + message.exportModelDetails = $root.google.cloud.automl.v1.ExportModelOperationMetadata.decode(reader, reader.uint32()); + break; + } + case 13: { + message.progressPercent = reader.int32(); + break; + } + case 2: { + if (!(message.partialFailures && message.partialFailures.length)) + message.partialFailures = []; + message.partialFailures.push($root.google.rpc.Status.decode(reader, reader.uint32())); + break; + } + case 3: { + message.createTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 4: { + message.updateTime = $root.google.protobuf.Timestamp.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.automl.v1.OperationMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.automl.v1.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.automl.v1.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.deleteDetails != null && message.hasOwnProperty("deleteDetails")) { + properties.details = 1; + { + var error = $root.google.cloud.automl.v1.DeleteOperationMetadata.verify(message.deleteDetails); + if (error) + return "deleteDetails." + error; + } + } + if (message.deployModelDetails != null && message.hasOwnProperty("deployModelDetails")) { + if (properties.details === 1) + return "details: multiple values"; + properties.details = 1; + { + var error = $root.google.cloud.automl.v1.DeployModelOperationMetadata.verify(message.deployModelDetails); + if (error) + return "deployModelDetails." + error; + } + } + if (message.undeployModelDetails != null && message.hasOwnProperty("undeployModelDetails")) { + if (properties.details === 1) + return "details: multiple values"; + properties.details = 1; + { + var error = $root.google.cloud.automl.v1.UndeployModelOperationMetadata.verify(message.undeployModelDetails); + if (error) + return "undeployModelDetails." + error; + } + } + if (message.createModelDetails != null && message.hasOwnProperty("createModelDetails")) { + if (properties.details === 1) + return "details: multiple values"; + properties.details = 1; + { + var error = $root.google.cloud.automl.v1.CreateModelOperationMetadata.verify(message.createModelDetails); + if (error) + return "createModelDetails." + error; + } + } + if (message.createDatasetDetails != null && message.hasOwnProperty("createDatasetDetails")) { + if (properties.details === 1) + return "details: multiple values"; + properties.details = 1; + { + var error = $root.google.cloud.automl.v1.CreateDatasetOperationMetadata.verify(message.createDatasetDetails); + if (error) + return "createDatasetDetails." + error; + } + } + if (message.importDataDetails != null && message.hasOwnProperty("importDataDetails")) { + if (properties.details === 1) + return "details: multiple values"; + properties.details = 1; + { + var error = $root.google.cloud.automl.v1.ImportDataOperationMetadata.verify(message.importDataDetails); + if (error) + return "importDataDetails." + error; + } + } + if (message.batchPredictDetails != null && message.hasOwnProperty("batchPredictDetails")) { + if (properties.details === 1) + return "details: multiple values"; + properties.details = 1; + { + var error = $root.google.cloud.automl.v1.BatchPredictOperationMetadata.verify(message.batchPredictDetails); + if (error) + return "batchPredictDetails." + error; + } + } + if (message.exportDataDetails != null && message.hasOwnProperty("exportDataDetails")) { + if (properties.details === 1) + return "details: multiple values"; + properties.details = 1; + { + var error = $root.google.cloud.automl.v1.ExportDataOperationMetadata.verify(message.exportDataDetails); + if (error) + return "exportDataDetails." + error; + } + } + if (message.exportModelDetails != null && message.hasOwnProperty("exportModelDetails")) { + if (properties.details === 1) + return "details: multiple values"; + properties.details = 1; + { + var error = $root.google.cloud.automl.v1.ExportModelOperationMetadata.verify(message.exportModelDetails); + if (error) + return "exportModelDetails." + error; + } + } + if (message.progressPercent != null && message.hasOwnProperty("progressPercent")) + if (!$util.isInteger(message.progressPercent)) + return "progressPercent: integer expected"; + if (message.partialFailures != null && message.hasOwnProperty("partialFailures")) { + if (!Array.isArray(message.partialFailures)) + return "partialFailures: array expected"; + for (var i = 0; i < message.partialFailures.length; ++i) { + var error = $root.google.rpc.Status.verify(message.partialFailures[i]); + if (error) + return "partialFailures." + error; + } + } + 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; + } + return null; + }; + + /** + * Creates an OperationMetadata message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.automl.v1.OperationMetadata + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.automl.v1.OperationMetadata} OperationMetadata + */ + OperationMetadata.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.automl.v1.OperationMetadata) + return object; + var message = new $root.google.cloud.automl.v1.OperationMetadata(); + if (object.deleteDetails != null) { + if (typeof object.deleteDetails !== "object") + throw TypeError(".google.cloud.automl.v1.OperationMetadata.deleteDetails: object expected"); + message.deleteDetails = $root.google.cloud.automl.v1.DeleteOperationMetadata.fromObject(object.deleteDetails); + } + if (object.deployModelDetails != null) { + if (typeof object.deployModelDetails !== "object") + throw TypeError(".google.cloud.automl.v1.OperationMetadata.deployModelDetails: object expected"); + message.deployModelDetails = $root.google.cloud.automl.v1.DeployModelOperationMetadata.fromObject(object.deployModelDetails); + } + if (object.undeployModelDetails != null) { + if (typeof object.undeployModelDetails !== "object") + throw TypeError(".google.cloud.automl.v1.OperationMetadata.undeployModelDetails: object expected"); + message.undeployModelDetails = $root.google.cloud.automl.v1.UndeployModelOperationMetadata.fromObject(object.undeployModelDetails); + } + if (object.createModelDetails != null) { + if (typeof object.createModelDetails !== "object") + throw TypeError(".google.cloud.automl.v1.OperationMetadata.createModelDetails: object expected"); + message.createModelDetails = $root.google.cloud.automl.v1.CreateModelOperationMetadata.fromObject(object.createModelDetails); + } + if (object.createDatasetDetails != null) { + if (typeof object.createDatasetDetails !== "object") + throw TypeError(".google.cloud.automl.v1.OperationMetadata.createDatasetDetails: object expected"); + message.createDatasetDetails = $root.google.cloud.automl.v1.CreateDatasetOperationMetadata.fromObject(object.createDatasetDetails); + } + if (object.importDataDetails != null) { + if (typeof object.importDataDetails !== "object") + throw TypeError(".google.cloud.automl.v1.OperationMetadata.importDataDetails: object expected"); + message.importDataDetails = $root.google.cloud.automl.v1.ImportDataOperationMetadata.fromObject(object.importDataDetails); + } + if (object.batchPredictDetails != null) { + if (typeof object.batchPredictDetails !== "object") + throw TypeError(".google.cloud.automl.v1.OperationMetadata.batchPredictDetails: object expected"); + message.batchPredictDetails = $root.google.cloud.automl.v1.BatchPredictOperationMetadata.fromObject(object.batchPredictDetails); + } + if (object.exportDataDetails != null) { + if (typeof object.exportDataDetails !== "object") + throw TypeError(".google.cloud.automl.v1.OperationMetadata.exportDataDetails: object expected"); + message.exportDataDetails = $root.google.cloud.automl.v1.ExportDataOperationMetadata.fromObject(object.exportDataDetails); + } + if (object.exportModelDetails != null) { + if (typeof object.exportModelDetails !== "object") + throw TypeError(".google.cloud.automl.v1.OperationMetadata.exportModelDetails: object expected"); + message.exportModelDetails = $root.google.cloud.automl.v1.ExportModelOperationMetadata.fromObject(object.exportModelDetails); + } + if (object.progressPercent != null) + message.progressPercent = object.progressPercent | 0; + if (object.partialFailures) { + if (!Array.isArray(object.partialFailures)) + throw TypeError(".google.cloud.automl.v1.OperationMetadata.partialFailures: array expected"); + message.partialFailures = []; + for (var i = 0; i < object.partialFailures.length; ++i) { + if (typeof object.partialFailures[i] !== "object") + throw TypeError(".google.cloud.automl.v1.OperationMetadata.partialFailures: object expected"); + message.partialFailures[i] = $root.google.rpc.Status.fromObject(object.partialFailures[i]); + } + } + if (object.createTime != null) { + if (typeof object.createTime !== "object") + throw TypeError(".google.cloud.automl.v1.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.automl.v1.OperationMetadata.updateTime: object expected"); + message.updateTime = $root.google.protobuf.Timestamp.fromObject(object.updateTime); + } + return message; + }; + + /** + * Creates a plain object from an OperationMetadata message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.automl.v1.OperationMetadata + * @static + * @param {google.cloud.automl.v1.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.arrays || options.defaults) + object.partialFailures = []; + if (options.defaults) { + object.createTime = null; + object.updateTime = null; + object.progressPercent = 0; + } + if (message.partialFailures && message.partialFailures.length) { + object.partialFailures = []; + for (var j = 0; j < message.partialFailures.length; ++j) + object.partialFailures[j] = $root.google.rpc.Status.toObject(message.partialFailures[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.deleteDetails != null && message.hasOwnProperty("deleteDetails")) { + object.deleteDetails = $root.google.cloud.automl.v1.DeleteOperationMetadata.toObject(message.deleteDetails, options); + if (options.oneofs) + object.details = "deleteDetails"; + } + if (message.createModelDetails != null && message.hasOwnProperty("createModelDetails")) { + object.createModelDetails = $root.google.cloud.automl.v1.CreateModelOperationMetadata.toObject(message.createModelDetails, options); + if (options.oneofs) + object.details = "createModelDetails"; + } + if (message.progressPercent != null && message.hasOwnProperty("progressPercent")) + object.progressPercent = message.progressPercent; + if (message.importDataDetails != null && message.hasOwnProperty("importDataDetails")) { + object.importDataDetails = $root.google.cloud.automl.v1.ImportDataOperationMetadata.toObject(message.importDataDetails, options); + if (options.oneofs) + object.details = "importDataDetails"; + } + if (message.batchPredictDetails != null && message.hasOwnProperty("batchPredictDetails")) { + object.batchPredictDetails = $root.google.cloud.automl.v1.BatchPredictOperationMetadata.toObject(message.batchPredictDetails, options); + if (options.oneofs) + object.details = "batchPredictDetails"; + } + if (message.exportDataDetails != null && message.hasOwnProperty("exportDataDetails")) { + object.exportDataDetails = $root.google.cloud.automl.v1.ExportDataOperationMetadata.toObject(message.exportDataDetails, options); + if (options.oneofs) + object.details = "exportDataDetails"; + } + if (message.exportModelDetails != null && message.hasOwnProperty("exportModelDetails")) { + object.exportModelDetails = $root.google.cloud.automl.v1.ExportModelOperationMetadata.toObject(message.exportModelDetails, options); + if (options.oneofs) + object.details = "exportModelDetails"; + } + if (message.deployModelDetails != null && message.hasOwnProperty("deployModelDetails")) { + object.deployModelDetails = $root.google.cloud.automl.v1.DeployModelOperationMetadata.toObject(message.deployModelDetails, options); + if (options.oneofs) + object.details = "deployModelDetails"; + } + if (message.undeployModelDetails != null && message.hasOwnProperty("undeployModelDetails")) { + object.undeployModelDetails = $root.google.cloud.automl.v1.UndeployModelOperationMetadata.toObject(message.undeployModelDetails, options); + if (options.oneofs) + object.details = "undeployModelDetails"; + } + if (message.createDatasetDetails != null && message.hasOwnProperty("createDatasetDetails")) { + object.createDatasetDetails = $root.google.cloud.automl.v1.CreateDatasetOperationMetadata.toObject(message.createDatasetDetails, options); + if (options.oneofs) + object.details = "createDatasetDetails"; + } + return object; + }; + + /** + * Converts this OperationMetadata to JSON. + * @function toJSON + * @memberof google.cloud.automl.v1.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.automl.v1.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.automl.v1.OperationMetadata"; + }; + + return OperationMetadata; + })(); + + v1.DeleteOperationMetadata = (function() { + + /** + * Properties of a DeleteOperationMetadata. + * @memberof google.cloud.automl.v1 + * @interface IDeleteOperationMetadata + */ + + /** + * Constructs a new DeleteOperationMetadata. + * @memberof google.cloud.automl.v1 + * @classdesc Represents a DeleteOperationMetadata. + * @implements IDeleteOperationMetadata + * @constructor + * @param {google.cloud.automl.v1.IDeleteOperationMetadata=} [properties] Properties to set + */ + function DeleteOperationMetadata(properties) { + if (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 DeleteOperationMetadata instance using the specified properties. + * @function create + * @memberof google.cloud.automl.v1.DeleteOperationMetadata + * @static + * @param {google.cloud.automl.v1.IDeleteOperationMetadata=} [properties] Properties to set + * @returns {google.cloud.automl.v1.DeleteOperationMetadata} DeleteOperationMetadata instance + */ + DeleteOperationMetadata.create = function create(properties) { + return new DeleteOperationMetadata(properties); + }; + + /** + * Encodes the specified DeleteOperationMetadata message. Does not implicitly {@link google.cloud.automl.v1.DeleteOperationMetadata.verify|verify} messages. + * @function encode + * @memberof google.cloud.automl.v1.DeleteOperationMetadata + * @static + * @param {google.cloud.automl.v1.IDeleteOperationMetadata} message DeleteOperationMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteOperationMetadata.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + return writer; + }; + + /** + * Encodes the specified DeleteOperationMetadata message, length delimited. Does not implicitly {@link google.cloud.automl.v1.DeleteOperationMetadata.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.automl.v1.DeleteOperationMetadata + * @static + * @param {google.cloud.automl.v1.IDeleteOperationMetadata} message DeleteOperationMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteOperationMetadata.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DeleteOperationMetadata message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.automl.v1.DeleteOperationMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.automl.v1.DeleteOperationMetadata} DeleteOperationMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteOperationMetadata.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.automl.v1.DeleteOperationMetadata(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DeleteOperationMetadata message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.automl.v1.DeleteOperationMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.automl.v1.DeleteOperationMetadata} DeleteOperationMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteOperationMetadata.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DeleteOperationMetadata message. + * @function verify + * @memberof google.cloud.automl.v1.DeleteOperationMetadata + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DeleteOperationMetadata.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + return null; + }; + + /** + * Creates a DeleteOperationMetadata message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.automl.v1.DeleteOperationMetadata + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.automl.v1.DeleteOperationMetadata} DeleteOperationMetadata + */ + DeleteOperationMetadata.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.automl.v1.DeleteOperationMetadata) + return object; + return new $root.google.cloud.automl.v1.DeleteOperationMetadata(); + }; + + /** + * Creates a plain object from a DeleteOperationMetadata message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.automl.v1.DeleteOperationMetadata + * @static + * @param {google.cloud.automl.v1.DeleteOperationMetadata} message DeleteOperationMetadata + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DeleteOperationMetadata.toObject = function toObject() { + return {}; + }; + + /** + * Converts this DeleteOperationMetadata to JSON. + * @function toJSON + * @memberof google.cloud.automl.v1.DeleteOperationMetadata + * @instance + * @returns {Object.} JSON object + */ + DeleteOperationMetadata.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DeleteOperationMetadata + * @function getTypeUrl + * @memberof google.cloud.automl.v1.DeleteOperationMetadata + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DeleteOperationMetadata.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.automl.v1.DeleteOperationMetadata"; + }; + + return DeleteOperationMetadata; + })(); + + v1.DeployModelOperationMetadata = (function() { + + /** + * Properties of a DeployModelOperationMetadata. + * @memberof google.cloud.automl.v1 + * @interface IDeployModelOperationMetadata + */ + + /** + * Constructs a new DeployModelOperationMetadata. + * @memberof google.cloud.automl.v1 + * @classdesc Represents a DeployModelOperationMetadata. + * @implements IDeployModelOperationMetadata + * @constructor + * @param {google.cloud.automl.v1.IDeployModelOperationMetadata=} [properties] Properties to set + */ + function DeployModelOperationMetadata(properties) { + if (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 DeployModelOperationMetadata instance using the specified properties. + * @function create + * @memberof google.cloud.automl.v1.DeployModelOperationMetadata + * @static + * @param {google.cloud.automl.v1.IDeployModelOperationMetadata=} [properties] Properties to set + * @returns {google.cloud.automl.v1.DeployModelOperationMetadata} DeployModelOperationMetadata instance + */ + DeployModelOperationMetadata.create = function create(properties) { + return new DeployModelOperationMetadata(properties); + }; + + /** + * Encodes the specified DeployModelOperationMetadata message. Does not implicitly {@link google.cloud.automl.v1.DeployModelOperationMetadata.verify|verify} messages. + * @function encode + * @memberof google.cloud.automl.v1.DeployModelOperationMetadata + * @static + * @param {google.cloud.automl.v1.IDeployModelOperationMetadata} message DeployModelOperationMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeployModelOperationMetadata.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + return writer; + }; + + /** + * Encodes the specified DeployModelOperationMetadata message, length delimited. Does not implicitly {@link google.cloud.automl.v1.DeployModelOperationMetadata.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.automl.v1.DeployModelOperationMetadata + * @static + * @param {google.cloud.automl.v1.IDeployModelOperationMetadata} message DeployModelOperationMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeployModelOperationMetadata.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DeployModelOperationMetadata message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.automl.v1.DeployModelOperationMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.automl.v1.DeployModelOperationMetadata} DeployModelOperationMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeployModelOperationMetadata.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.automl.v1.DeployModelOperationMetadata(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DeployModelOperationMetadata message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.automl.v1.DeployModelOperationMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.automl.v1.DeployModelOperationMetadata} DeployModelOperationMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeployModelOperationMetadata.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DeployModelOperationMetadata message. + * @function verify + * @memberof google.cloud.automl.v1.DeployModelOperationMetadata + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DeployModelOperationMetadata.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + return null; + }; + + /** + * Creates a DeployModelOperationMetadata message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.automl.v1.DeployModelOperationMetadata + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.automl.v1.DeployModelOperationMetadata} DeployModelOperationMetadata + */ + DeployModelOperationMetadata.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.automl.v1.DeployModelOperationMetadata) + return object; + return new $root.google.cloud.automl.v1.DeployModelOperationMetadata(); + }; + + /** + * Creates a plain object from a DeployModelOperationMetadata message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.automl.v1.DeployModelOperationMetadata + * @static + * @param {google.cloud.automl.v1.DeployModelOperationMetadata} message DeployModelOperationMetadata + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DeployModelOperationMetadata.toObject = function toObject() { + return {}; + }; + + /** + * Converts this DeployModelOperationMetadata to JSON. + * @function toJSON + * @memberof google.cloud.automl.v1.DeployModelOperationMetadata + * @instance + * @returns {Object.} JSON object + */ + DeployModelOperationMetadata.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DeployModelOperationMetadata + * @function getTypeUrl + * @memberof google.cloud.automl.v1.DeployModelOperationMetadata + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DeployModelOperationMetadata.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.automl.v1.DeployModelOperationMetadata"; + }; + + return DeployModelOperationMetadata; + })(); + + v1.UndeployModelOperationMetadata = (function() { + + /** + * Properties of an UndeployModelOperationMetadata. + * @memberof google.cloud.automl.v1 + * @interface IUndeployModelOperationMetadata + */ + + /** + * Constructs a new UndeployModelOperationMetadata. + * @memberof google.cloud.automl.v1 + * @classdesc Represents an UndeployModelOperationMetadata. + * @implements IUndeployModelOperationMetadata + * @constructor + * @param {google.cloud.automl.v1.IUndeployModelOperationMetadata=} [properties] Properties to set + */ + function UndeployModelOperationMetadata(properties) { + if (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 UndeployModelOperationMetadata instance using the specified properties. + * @function create + * @memberof google.cloud.automl.v1.UndeployModelOperationMetadata + * @static + * @param {google.cloud.automl.v1.IUndeployModelOperationMetadata=} [properties] Properties to set + * @returns {google.cloud.automl.v1.UndeployModelOperationMetadata} UndeployModelOperationMetadata instance + */ + UndeployModelOperationMetadata.create = function create(properties) { + return new UndeployModelOperationMetadata(properties); + }; + + /** + * Encodes the specified UndeployModelOperationMetadata message. Does not implicitly {@link google.cloud.automl.v1.UndeployModelOperationMetadata.verify|verify} messages. + * @function encode + * @memberof google.cloud.automl.v1.UndeployModelOperationMetadata + * @static + * @param {google.cloud.automl.v1.IUndeployModelOperationMetadata} message UndeployModelOperationMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UndeployModelOperationMetadata.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + return writer; + }; + + /** + * Encodes the specified UndeployModelOperationMetadata message, length delimited. Does not implicitly {@link google.cloud.automl.v1.UndeployModelOperationMetadata.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.automl.v1.UndeployModelOperationMetadata + * @static + * @param {google.cloud.automl.v1.IUndeployModelOperationMetadata} message UndeployModelOperationMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UndeployModelOperationMetadata.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an UndeployModelOperationMetadata message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.automl.v1.UndeployModelOperationMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.automl.v1.UndeployModelOperationMetadata} UndeployModelOperationMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UndeployModelOperationMetadata.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.automl.v1.UndeployModelOperationMetadata(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an UndeployModelOperationMetadata message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.automl.v1.UndeployModelOperationMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.automl.v1.UndeployModelOperationMetadata} UndeployModelOperationMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UndeployModelOperationMetadata.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an UndeployModelOperationMetadata message. + * @function verify + * @memberof google.cloud.automl.v1.UndeployModelOperationMetadata + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + UndeployModelOperationMetadata.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + return null; + }; + + /** + * Creates an UndeployModelOperationMetadata message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.automl.v1.UndeployModelOperationMetadata + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.automl.v1.UndeployModelOperationMetadata} UndeployModelOperationMetadata + */ + UndeployModelOperationMetadata.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.automl.v1.UndeployModelOperationMetadata) + return object; + return new $root.google.cloud.automl.v1.UndeployModelOperationMetadata(); + }; + + /** + * Creates a plain object from an UndeployModelOperationMetadata message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.automl.v1.UndeployModelOperationMetadata + * @static + * @param {google.cloud.automl.v1.UndeployModelOperationMetadata} message UndeployModelOperationMetadata + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + UndeployModelOperationMetadata.toObject = function toObject() { + return {}; + }; + + /** + * Converts this UndeployModelOperationMetadata to JSON. + * @function toJSON + * @memberof google.cloud.automl.v1.UndeployModelOperationMetadata + * @instance + * @returns {Object.} JSON object + */ + UndeployModelOperationMetadata.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for UndeployModelOperationMetadata + * @function getTypeUrl + * @memberof google.cloud.automl.v1.UndeployModelOperationMetadata + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + UndeployModelOperationMetadata.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.automl.v1.UndeployModelOperationMetadata"; + }; + + return UndeployModelOperationMetadata; + })(); + + v1.CreateDatasetOperationMetadata = (function() { + + /** + * Properties of a CreateDatasetOperationMetadata. + * @memberof google.cloud.automl.v1 + * @interface ICreateDatasetOperationMetadata + */ + + /** + * Constructs a new CreateDatasetOperationMetadata. + * @memberof google.cloud.automl.v1 + * @classdesc Represents a CreateDatasetOperationMetadata. + * @implements ICreateDatasetOperationMetadata + * @constructor + * @param {google.cloud.automl.v1.ICreateDatasetOperationMetadata=} [properties] Properties to set + */ + function CreateDatasetOperationMetadata(properties) { + if (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 CreateDatasetOperationMetadata instance using the specified properties. + * @function create + * @memberof google.cloud.automl.v1.CreateDatasetOperationMetadata + * @static + * @param {google.cloud.automl.v1.ICreateDatasetOperationMetadata=} [properties] Properties to set + * @returns {google.cloud.automl.v1.CreateDatasetOperationMetadata} CreateDatasetOperationMetadata instance + */ + CreateDatasetOperationMetadata.create = function create(properties) { + return new CreateDatasetOperationMetadata(properties); + }; + + /** + * Encodes the specified CreateDatasetOperationMetadata message. Does not implicitly {@link google.cloud.automl.v1.CreateDatasetOperationMetadata.verify|verify} messages. + * @function encode + * @memberof google.cloud.automl.v1.CreateDatasetOperationMetadata + * @static + * @param {google.cloud.automl.v1.ICreateDatasetOperationMetadata} message CreateDatasetOperationMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateDatasetOperationMetadata.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + return writer; + }; + + /** + * Encodes the specified CreateDatasetOperationMetadata message, length delimited. Does not implicitly {@link google.cloud.automl.v1.CreateDatasetOperationMetadata.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.automl.v1.CreateDatasetOperationMetadata + * @static + * @param {google.cloud.automl.v1.ICreateDatasetOperationMetadata} message CreateDatasetOperationMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateDatasetOperationMetadata.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CreateDatasetOperationMetadata message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.automl.v1.CreateDatasetOperationMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.automl.v1.CreateDatasetOperationMetadata} CreateDatasetOperationMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateDatasetOperationMetadata.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.automl.v1.CreateDatasetOperationMetadata(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CreateDatasetOperationMetadata message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.automl.v1.CreateDatasetOperationMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.automl.v1.CreateDatasetOperationMetadata} CreateDatasetOperationMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateDatasetOperationMetadata.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CreateDatasetOperationMetadata message. + * @function verify + * @memberof google.cloud.automl.v1.CreateDatasetOperationMetadata + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CreateDatasetOperationMetadata.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + return null; + }; + + /** + * Creates a CreateDatasetOperationMetadata message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.automl.v1.CreateDatasetOperationMetadata + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.automl.v1.CreateDatasetOperationMetadata} CreateDatasetOperationMetadata + */ + CreateDatasetOperationMetadata.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.automl.v1.CreateDatasetOperationMetadata) + return object; + return new $root.google.cloud.automl.v1.CreateDatasetOperationMetadata(); + }; + + /** + * Creates a plain object from a CreateDatasetOperationMetadata message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.automl.v1.CreateDatasetOperationMetadata + * @static + * @param {google.cloud.automl.v1.CreateDatasetOperationMetadata} message CreateDatasetOperationMetadata + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CreateDatasetOperationMetadata.toObject = function toObject() { + return {}; + }; + + /** + * Converts this CreateDatasetOperationMetadata to JSON. + * @function toJSON + * @memberof google.cloud.automl.v1.CreateDatasetOperationMetadata + * @instance + * @returns {Object.} JSON object + */ + CreateDatasetOperationMetadata.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CreateDatasetOperationMetadata + * @function getTypeUrl + * @memberof google.cloud.automl.v1.CreateDatasetOperationMetadata + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CreateDatasetOperationMetadata.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.automl.v1.CreateDatasetOperationMetadata"; + }; + + return CreateDatasetOperationMetadata; + })(); + + v1.CreateModelOperationMetadata = (function() { + + /** + * Properties of a CreateModelOperationMetadata. + * @memberof google.cloud.automl.v1 + * @interface ICreateModelOperationMetadata + */ + + /** + * Constructs a new CreateModelOperationMetadata. + * @memberof google.cloud.automl.v1 + * @classdesc Represents a CreateModelOperationMetadata. + * @implements ICreateModelOperationMetadata + * @constructor + * @param {google.cloud.automl.v1.ICreateModelOperationMetadata=} [properties] Properties to set + */ + function CreateModelOperationMetadata(properties) { + if (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 CreateModelOperationMetadata instance using the specified properties. + * @function create + * @memberof google.cloud.automl.v1.CreateModelOperationMetadata + * @static + * @param {google.cloud.automl.v1.ICreateModelOperationMetadata=} [properties] Properties to set + * @returns {google.cloud.automl.v1.CreateModelOperationMetadata} CreateModelOperationMetadata instance + */ + CreateModelOperationMetadata.create = function create(properties) { + return new CreateModelOperationMetadata(properties); + }; + + /** + * Encodes the specified CreateModelOperationMetadata message. Does not implicitly {@link google.cloud.automl.v1.CreateModelOperationMetadata.verify|verify} messages. + * @function encode + * @memberof google.cloud.automl.v1.CreateModelOperationMetadata + * @static + * @param {google.cloud.automl.v1.ICreateModelOperationMetadata} message CreateModelOperationMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateModelOperationMetadata.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + return writer; + }; + + /** + * Encodes the specified CreateModelOperationMetadata message, length delimited. Does not implicitly {@link google.cloud.automl.v1.CreateModelOperationMetadata.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.automl.v1.CreateModelOperationMetadata + * @static + * @param {google.cloud.automl.v1.ICreateModelOperationMetadata} message CreateModelOperationMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateModelOperationMetadata.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CreateModelOperationMetadata message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.automl.v1.CreateModelOperationMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.automl.v1.CreateModelOperationMetadata} CreateModelOperationMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateModelOperationMetadata.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.automl.v1.CreateModelOperationMetadata(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CreateModelOperationMetadata message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.automl.v1.CreateModelOperationMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.automl.v1.CreateModelOperationMetadata} CreateModelOperationMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateModelOperationMetadata.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CreateModelOperationMetadata message. + * @function verify + * @memberof google.cloud.automl.v1.CreateModelOperationMetadata + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CreateModelOperationMetadata.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + return null; + }; + + /** + * Creates a CreateModelOperationMetadata message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.automl.v1.CreateModelOperationMetadata + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.automl.v1.CreateModelOperationMetadata} CreateModelOperationMetadata + */ + CreateModelOperationMetadata.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.automl.v1.CreateModelOperationMetadata) + return object; + return new $root.google.cloud.automl.v1.CreateModelOperationMetadata(); + }; + + /** + * Creates a plain object from a CreateModelOperationMetadata message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.automl.v1.CreateModelOperationMetadata + * @static + * @param {google.cloud.automl.v1.CreateModelOperationMetadata} message CreateModelOperationMetadata + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CreateModelOperationMetadata.toObject = function toObject() { + return {}; + }; + + /** + * Converts this CreateModelOperationMetadata to JSON. + * @function toJSON + * @memberof google.cloud.automl.v1.CreateModelOperationMetadata + * @instance + * @returns {Object.} JSON object + */ + CreateModelOperationMetadata.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CreateModelOperationMetadata + * @function getTypeUrl + * @memberof google.cloud.automl.v1.CreateModelOperationMetadata + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CreateModelOperationMetadata.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.automl.v1.CreateModelOperationMetadata"; + }; + + return CreateModelOperationMetadata; + })(); + + v1.ImportDataOperationMetadata = (function() { + + /** + * Properties of an ImportDataOperationMetadata. + * @memberof google.cloud.automl.v1 + * @interface IImportDataOperationMetadata + */ + + /** + * Constructs a new ImportDataOperationMetadata. + * @memberof google.cloud.automl.v1 + * @classdesc Represents an ImportDataOperationMetadata. + * @implements IImportDataOperationMetadata + * @constructor + * @param {google.cloud.automl.v1.IImportDataOperationMetadata=} [properties] Properties to set + */ + function ImportDataOperationMetadata(properties) { + if (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 ImportDataOperationMetadata instance using the specified properties. + * @function create + * @memberof google.cloud.automl.v1.ImportDataOperationMetadata + * @static + * @param {google.cloud.automl.v1.IImportDataOperationMetadata=} [properties] Properties to set + * @returns {google.cloud.automl.v1.ImportDataOperationMetadata} ImportDataOperationMetadata instance + */ + ImportDataOperationMetadata.create = function create(properties) { + return new ImportDataOperationMetadata(properties); + }; + + /** + * Encodes the specified ImportDataOperationMetadata message. Does not implicitly {@link google.cloud.automl.v1.ImportDataOperationMetadata.verify|verify} messages. + * @function encode + * @memberof google.cloud.automl.v1.ImportDataOperationMetadata + * @static + * @param {google.cloud.automl.v1.IImportDataOperationMetadata} message ImportDataOperationMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ImportDataOperationMetadata.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + return writer; + }; + + /** + * Encodes the specified ImportDataOperationMetadata message, length delimited. Does not implicitly {@link google.cloud.automl.v1.ImportDataOperationMetadata.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.automl.v1.ImportDataOperationMetadata + * @static + * @param {google.cloud.automl.v1.IImportDataOperationMetadata} message ImportDataOperationMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ImportDataOperationMetadata.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an ImportDataOperationMetadata message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.automl.v1.ImportDataOperationMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.automl.v1.ImportDataOperationMetadata} ImportDataOperationMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ImportDataOperationMetadata.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.automl.v1.ImportDataOperationMetadata(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an ImportDataOperationMetadata message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.automl.v1.ImportDataOperationMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.automl.v1.ImportDataOperationMetadata} ImportDataOperationMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ImportDataOperationMetadata.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an ImportDataOperationMetadata message. + * @function verify + * @memberof google.cloud.automl.v1.ImportDataOperationMetadata + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ImportDataOperationMetadata.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + return null; + }; + + /** + * Creates an ImportDataOperationMetadata message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.automl.v1.ImportDataOperationMetadata + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.automl.v1.ImportDataOperationMetadata} ImportDataOperationMetadata + */ + ImportDataOperationMetadata.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.automl.v1.ImportDataOperationMetadata) + return object; + return new $root.google.cloud.automl.v1.ImportDataOperationMetadata(); + }; + + /** + * Creates a plain object from an ImportDataOperationMetadata message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.automl.v1.ImportDataOperationMetadata + * @static + * @param {google.cloud.automl.v1.ImportDataOperationMetadata} message ImportDataOperationMetadata + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ImportDataOperationMetadata.toObject = function toObject() { + return {}; + }; + + /** + * Converts this ImportDataOperationMetadata to JSON. + * @function toJSON + * @memberof google.cloud.automl.v1.ImportDataOperationMetadata + * @instance + * @returns {Object.} JSON object + */ + ImportDataOperationMetadata.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ImportDataOperationMetadata + * @function getTypeUrl + * @memberof google.cloud.automl.v1.ImportDataOperationMetadata + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ImportDataOperationMetadata.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.automl.v1.ImportDataOperationMetadata"; + }; + + return ImportDataOperationMetadata; + })(); + + v1.ExportDataOperationMetadata = (function() { + + /** + * Properties of an ExportDataOperationMetadata. + * @memberof google.cloud.automl.v1 + * @interface IExportDataOperationMetadata + * @property {google.cloud.automl.v1.ExportDataOperationMetadata.IExportDataOutputInfo|null} [outputInfo] ExportDataOperationMetadata outputInfo + */ + + /** + * Constructs a new ExportDataOperationMetadata. + * @memberof google.cloud.automl.v1 + * @classdesc Represents an ExportDataOperationMetadata. + * @implements IExportDataOperationMetadata + * @constructor + * @param {google.cloud.automl.v1.IExportDataOperationMetadata=} [properties] Properties to set + */ + function ExportDataOperationMetadata(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ExportDataOperationMetadata outputInfo. + * @member {google.cloud.automl.v1.ExportDataOperationMetadata.IExportDataOutputInfo|null|undefined} outputInfo + * @memberof google.cloud.automl.v1.ExportDataOperationMetadata + * @instance + */ + ExportDataOperationMetadata.prototype.outputInfo = null; + + /** + * Creates a new ExportDataOperationMetadata instance using the specified properties. + * @function create + * @memberof google.cloud.automl.v1.ExportDataOperationMetadata + * @static + * @param {google.cloud.automl.v1.IExportDataOperationMetadata=} [properties] Properties to set + * @returns {google.cloud.automl.v1.ExportDataOperationMetadata} ExportDataOperationMetadata instance + */ + ExportDataOperationMetadata.create = function create(properties) { + return new ExportDataOperationMetadata(properties); + }; + + /** + * Encodes the specified ExportDataOperationMetadata message. Does not implicitly {@link google.cloud.automl.v1.ExportDataOperationMetadata.verify|verify} messages. + * @function encode + * @memberof google.cloud.automl.v1.ExportDataOperationMetadata + * @static + * @param {google.cloud.automl.v1.IExportDataOperationMetadata} message ExportDataOperationMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ExportDataOperationMetadata.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.outputInfo != null && Object.hasOwnProperty.call(message, "outputInfo")) + $root.google.cloud.automl.v1.ExportDataOperationMetadata.ExportDataOutputInfo.encode(message.outputInfo, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified ExportDataOperationMetadata message, length delimited. Does not implicitly {@link google.cloud.automl.v1.ExportDataOperationMetadata.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.automl.v1.ExportDataOperationMetadata + * @static + * @param {google.cloud.automl.v1.IExportDataOperationMetadata} message ExportDataOperationMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ExportDataOperationMetadata.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an ExportDataOperationMetadata message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.automl.v1.ExportDataOperationMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.automl.v1.ExportDataOperationMetadata} ExportDataOperationMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ExportDataOperationMetadata.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.automl.v1.ExportDataOperationMetadata(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.outputInfo = $root.google.cloud.automl.v1.ExportDataOperationMetadata.ExportDataOutputInfo.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an ExportDataOperationMetadata message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.automl.v1.ExportDataOperationMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.automl.v1.ExportDataOperationMetadata} ExportDataOperationMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ExportDataOperationMetadata.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an ExportDataOperationMetadata message. + * @function verify + * @memberof google.cloud.automl.v1.ExportDataOperationMetadata + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ExportDataOperationMetadata.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.outputInfo != null && message.hasOwnProperty("outputInfo")) { + var error = $root.google.cloud.automl.v1.ExportDataOperationMetadata.ExportDataOutputInfo.verify(message.outputInfo); + if (error) + return "outputInfo." + error; + } + return null; + }; + + /** + * Creates an ExportDataOperationMetadata message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.automl.v1.ExportDataOperationMetadata + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.automl.v1.ExportDataOperationMetadata} ExportDataOperationMetadata + */ + ExportDataOperationMetadata.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.automl.v1.ExportDataOperationMetadata) + return object; + var message = new $root.google.cloud.automl.v1.ExportDataOperationMetadata(); + if (object.outputInfo != null) { + if (typeof object.outputInfo !== "object") + throw TypeError(".google.cloud.automl.v1.ExportDataOperationMetadata.outputInfo: object expected"); + message.outputInfo = $root.google.cloud.automl.v1.ExportDataOperationMetadata.ExportDataOutputInfo.fromObject(object.outputInfo); + } + return message; + }; + + /** + * Creates a plain object from an ExportDataOperationMetadata message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.automl.v1.ExportDataOperationMetadata + * @static + * @param {google.cloud.automl.v1.ExportDataOperationMetadata} message ExportDataOperationMetadata + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ExportDataOperationMetadata.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.outputInfo = null; + if (message.outputInfo != null && message.hasOwnProperty("outputInfo")) + object.outputInfo = $root.google.cloud.automl.v1.ExportDataOperationMetadata.ExportDataOutputInfo.toObject(message.outputInfo, options); + return object; + }; + + /** + * Converts this ExportDataOperationMetadata to JSON. + * @function toJSON + * @memberof google.cloud.automl.v1.ExportDataOperationMetadata + * @instance + * @returns {Object.} JSON object + */ + ExportDataOperationMetadata.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ExportDataOperationMetadata + * @function getTypeUrl + * @memberof google.cloud.automl.v1.ExportDataOperationMetadata + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ExportDataOperationMetadata.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.automl.v1.ExportDataOperationMetadata"; + }; + + ExportDataOperationMetadata.ExportDataOutputInfo = (function() { + + /** + * Properties of an ExportDataOutputInfo. + * @memberof google.cloud.automl.v1.ExportDataOperationMetadata + * @interface IExportDataOutputInfo + * @property {string|null} [gcsOutputDirectory] ExportDataOutputInfo gcsOutputDirectory + */ + + /** + * Constructs a new ExportDataOutputInfo. + * @memberof google.cloud.automl.v1.ExportDataOperationMetadata + * @classdesc Represents an ExportDataOutputInfo. + * @implements IExportDataOutputInfo + * @constructor + * @param {google.cloud.automl.v1.ExportDataOperationMetadata.IExportDataOutputInfo=} [properties] Properties to set + */ + function ExportDataOutputInfo(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ExportDataOutputInfo gcsOutputDirectory. + * @member {string|null|undefined} gcsOutputDirectory + * @memberof google.cloud.automl.v1.ExportDataOperationMetadata.ExportDataOutputInfo + * @instance + */ + ExportDataOutputInfo.prototype.gcsOutputDirectory = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * ExportDataOutputInfo outputLocation. + * @member {"gcsOutputDirectory"|undefined} outputLocation + * @memberof google.cloud.automl.v1.ExportDataOperationMetadata.ExportDataOutputInfo + * @instance + */ + Object.defineProperty(ExportDataOutputInfo.prototype, "outputLocation", { + get: $util.oneOfGetter($oneOfFields = ["gcsOutputDirectory"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new ExportDataOutputInfo instance using the specified properties. + * @function create + * @memberof google.cloud.automl.v1.ExportDataOperationMetadata.ExportDataOutputInfo + * @static + * @param {google.cloud.automl.v1.ExportDataOperationMetadata.IExportDataOutputInfo=} [properties] Properties to set + * @returns {google.cloud.automl.v1.ExportDataOperationMetadata.ExportDataOutputInfo} ExportDataOutputInfo instance + */ + ExportDataOutputInfo.create = function create(properties) { + return new ExportDataOutputInfo(properties); + }; + + /** + * Encodes the specified ExportDataOutputInfo message. Does not implicitly {@link google.cloud.automl.v1.ExportDataOperationMetadata.ExportDataOutputInfo.verify|verify} messages. + * @function encode + * @memberof google.cloud.automl.v1.ExportDataOperationMetadata.ExportDataOutputInfo + * @static + * @param {google.cloud.automl.v1.ExportDataOperationMetadata.IExportDataOutputInfo} message ExportDataOutputInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ExportDataOutputInfo.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.gcsOutputDirectory != null && Object.hasOwnProperty.call(message, "gcsOutputDirectory")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.gcsOutputDirectory); + return writer; + }; + + /** + * Encodes the specified ExportDataOutputInfo message, length delimited. Does not implicitly {@link google.cloud.automl.v1.ExportDataOperationMetadata.ExportDataOutputInfo.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.automl.v1.ExportDataOperationMetadata.ExportDataOutputInfo + * @static + * @param {google.cloud.automl.v1.ExportDataOperationMetadata.IExportDataOutputInfo} message ExportDataOutputInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ExportDataOutputInfo.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an ExportDataOutputInfo message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.automl.v1.ExportDataOperationMetadata.ExportDataOutputInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.automl.v1.ExportDataOperationMetadata.ExportDataOutputInfo} ExportDataOutputInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ExportDataOutputInfo.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.automl.v1.ExportDataOperationMetadata.ExportDataOutputInfo(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.gcsOutputDirectory = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an ExportDataOutputInfo message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.automl.v1.ExportDataOperationMetadata.ExportDataOutputInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.automl.v1.ExportDataOperationMetadata.ExportDataOutputInfo} ExportDataOutputInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ExportDataOutputInfo.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an ExportDataOutputInfo message. + * @function verify + * @memberof google.cloud.automl.v1.ExportDataOperationMetadata.ExportDataOutputInfo + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ExportDataOutputInfo.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.gcsOutputDirectory != null && message.hasOwnProperty("gcsOutputDirectory")) { + properties.outputLocation = 1; + if (!$util.isString(message.gcsOutputDirectory)) + return "gcsOutputDirectory: string expected"; + } + return null; + }; + + /** + * Creates an ExportDataOutputInfo message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.automl.v1.ExportDataOperationMetadata.ExportDataOutputInfo + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.automl.v1.ExportDataOperationMetadata.ExportDataOutputInfo} ExportDataOutputInfo + */ + ExportDataOutputInfo.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.automl.v1.ExportDataOperationMetadata.ExportDataOutputInfo) + return object; + var message = new $root.google.cloud.automl.v1.ExportDataOperationMetadata.ExportDataOutputInfo(); + if (object.gcsOutputDirectory != null) + message.gcsOutputDirectory = String(object.gcsOutputDirectory); + return message; + }; + + /** + * Creates a plain object from an ExportDataOutputInfo message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.automl.v1.ExportDataOperationMetadata.ExportDataOutputInfo + * @static + * @param {google.cloud.automl.v1.ExportDataOperationMetadata.ExportDataOutputInfo} message ExportDataOutputInfo + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ExportDataOutputInfo.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.gcsOutputDirectory != null && message.hasOwnProperty("gcsOutputDirectory")) { + object.gcsOutputDirectory = message.gcsOutputDirectory; + if (options.oneofs) + object.outputLocation = "gcsOutputDirectory"; + } + return object; + }; + + /** + * Converts this ExportDataOutputInfo to JSON. + * @function toJSON + * @memberof google.cloud.automl.v1.ExportDataOperationMetadata.ExportDataOutputInfo + * @instance + * @returns {Object.} JSON object + */ + ExportDataOutputInfo.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ExportDataOutputInfo + * @function getTypeUrl + * @memberof google.cloud.automl.v1.ExportDataOperationMetadata.ExportDataOutputInfo + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ExportDataOutputInfo.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.automl.v1.ExportDataOperationMetadata.ExportDataOutputInfo"; + }; + + return ExportDataOutputInfo; + })(); + + return ExportDataOperationMetadata; + })(); + + v1.BatchPredictOperationMetadata = (function() { + + /** + * Properties of a BatchPredictOperationMetadata. + * @memberof google.cloud.automl.v1 + * @interface IBatchPredictOperationMetadata + * @property {google.cloud.automl.v1.IBatchPredictInputConfig|null} [inputConfig] BatchPredictOperationMetadata inputConfig + * @property {google.cloud.automl.v1.BatchPredictOperationMetadata.IBatchPredictOutputInfo|null} [outputInfo] BatchPredictOperationMetadata outputInfo + */ + + /** + * Constructs a new BatchPredictOperationMetadata. + * @memberof google.cloud.automl.v1 + * @classdesc Represents a BatchPredictOperationMetadata. + * @implements IBatchPredictOperationMetadata + * @constructor + * @param {google.cloud.automl.v1.IBatchPredictOperationMetadata=} [properties] Properties to set + */ + function BatchPredictOperationMetadata(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * BatchPredictOperationMetadata inputConfig. + * @member {google.cloud.automl.v1.IBatchPredictInputConfig|null|undefined} inputConfig + * @memberof google.cloud.automl.v1.BatchPredictOperationMetadata + * @instance + */ + BatchPredictOperationMetadata.prototype.inputConfig = null; + + /** + * BatchPredictOperationMetadata outputInfo. + * @member {google.cloud.automl.v1.BatchPredictOperationMetadata.IBatchPredictOutputInfo|null|undefined} outputInfo + * @memberof google.cloud.automl.v1.BatchPredictOperationMetadata + * @instance + */ + BatchPredictOperationMetadata.prototype.outputInfo = null; + + /** + * Creates a new BatchPredictOperationMetadata instance using the specified properties. + * @function create + * @memberof google.cloud.automl.v1.BatchPredictOperationMetadata + * @static + * @param {google.cloud.automl.v1.IBatchPredictOperationMetadata=} [properties] Properties to set + * @returns {google.cloud.automl.v1.BatchPredictOperationMetadata} BatchPredictOperationMetadata instance + */ + BatchPredictOperationMetadata.create = function create(properties) { + return new BatchPredictOperationMetadata(properties); + }; + + /** + * Encodes the specified BatchPredictOperationMetadata message. Does not implicitly {@link google.cloud.automl.v1.BatchPredictOperationMetadata.verify|verify} messages. + * @function encode + * @memberof google.cloud.automl.v1.BatchPredictOperationMetadata + * @static + * @param {google.cloud.automl.v1.IBatchPredictOperationMetadata} message BatchPredictOperationMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BatchPredictOperationMetadata.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.inputConfig != null && Object.hasOwnProperty.call(message, "inputConfig")) + $root.google.cloud.automl.v1.BatchPredictInputConfig.encode(message.inputConfig, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.outputInfo != null && Object.hasOwnProperty.call(message, "outputInfo")) + $root.google.cloud.automl.v1.BatchPredictOperationMetadata.BatchPredictOutputInfo.encode(message.outputInfo, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified BatchPredictOperationMetadata message, length delimited. Does not implicitly {@link google.cloud.automl.v1.BatchPredictOperationMetadata.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.automl.v1.BatchPredictOperationMetadata + * @static + * @param {google.cloud.automl.v1.IBatchPredictOperationMetadata} message BatchPredictOperationMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BatchPredictOperationMetadata.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a BatchPredictOperationMetadata message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.automl.v1.BatchPredictOperationMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.automl.v1.BatchPredictOperationMetadata} BatchPredictOperationMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BatchPredictOperationMetadata.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.automl.v1.BatchPredictOperationMetadata(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.inputConfig = $root.google.cloud.automl.v1.BatchPredictInputConfig.decode(reader, reader.uint32()); + break; + } + case 2: { + message.outputInfo = $root.google.cloud.automl.v1.BatchPredictOperationMetadata.BatchPredictOutputInfo.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a BatchPredictOperationMetadata message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.automl.v1.BatchPredictOperationMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.automl.v1.BatchPredictOperationMetadata} BatchPredictOperationMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BatchPredictOperationMetadata.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a BatchPredictOperationMetadata message. + * @function verify + * @memberof google.cloud.automl.v1.BatchPredictOperationMetadata + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + BatchPredictOperationMetadata.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.inputConfig != null && message.hasOwnProperty("inputConfig")) { + var error = $root.google.cloud.automl.v1.BatchPredictInputConfig.verify(message.inputConfig); + if (error) + return "inputConfig." + error; + } + if (message.outputInfo != null && message.hasOwnProperty("outputInfo")) { + var error = $root.google.cloud.automl.v1.BatchPredictOperationMetadata.BatchPredictOutputInfo.verify(message.outputInfo); + if (error) + return "outputInfo." + error; + } + return null; + }; + + /** + * Creates a BatchPredictOperationMetadata message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.automl.v1.BatchPredictOperationMetadata + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.automl.v1.BatchPredictOperationMetadata} BatchPredictOperationMetadata + */ + BatchPredictOperationMetadata.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.automl.v1.BatchPredictOperationMetadata) + return object; + var message = new $root.google.cloud.automl.v1.BatchPredictOperationMetadata(); + if (object.inputConfig != null) { + if (typeof object.inputConfig !== "object") + throw TypeError(".google.cloud.automl.v1.BatchPredictOperationMetadata.inputConfig: object expected"); + message.inputConfig = $root.google.cloud.automl.v1.BatchPredictInputConfig.fromObject(object.inputConfig); + } + if (object.outputInfo != null) { + if (typeof object.outputInfo !== "object") + throw TypeError(".google.cloud.automl.v1.BatchPredictOperationMetadata.outputInfo: object expected"); + message.outputInfo = $root.google.cloud.automl.v1.BatchPredictOperationMetadata.BatchPredictOutputInfo.fromObject(object.outputInfo); + } + return message; + }; + + /** + * Creates a plain object from a BatchPredictOperationMetadata message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.automl.v1.BatchPredictOperationMetadata + * @static + * @param {google.cloud.automl.v1.BatchPredictOperationMetadata} message BatchPredictOperationMetadata + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + BatchPredictOperationMetadata.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.inputConfig = null; + object.outputInfo = null; + } + if (message.inputConfig != null && message.hasOwnProperty("inputConfig")) + object.inputConfig = $root.google.cloud.automl.v1.BatchPredictInputConfig.toObject(message.inputConfig, options); + if (message.outputInfo != null && message.hasOwnProperty("outputInfo")) + object.outputInfo = $root.google.cloud.automl.v1.BatchPredictOperationMetadata.BatchPredictOutputInfo.toObject(message.outputInfo, options); + return object; + }; + + /** + * Converts this BatchPredictOperationMetadata to JSON. + * @function toJSON + * @memberof google.cloud.automl.v1.BatchPredictOperationMetadata + * @instance + * @returns {Object.} JSON object + */ + BatchPredictOperationMetadata.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for BatchPredictOperationMetadata + * @function getTypeUrl + * @memberof google.cloud.automl.v1.BatchPredictOperationMetadata + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + BatchPredictOperationMetadata.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.automl.v1.BatchPredictOperationMetadata"; + }; + + BatchPredictOperationMetadata.BatchPredictOutputInfo = (function() { + + /** + * Properties of a BatchPredictOutputInfo. + * @memberof google.cloud.automl.v1.BatchPredictOperationMetadata + * @interface IBatchPredictOutputInfo + * @property {string|null} [gcsOutputDirectory] BatchPredictOutputInfo gcsOutputDirectory + */ + + /** + * Constructs a new BatchPredictOutputInfo. + * @memberof google.cloud.automl.v1.BatchPredictOperationMetadata + * @classdesc Represents a BatchPredictOutputInfo. + * @implements IBatchPredictOutputInfo + * @constructor + * @param {google.cloud.automl.v1.BatchPredictOperationMetadata.IBatchPredictOutputInfo=} [properties] Properties to set + */ + function BatchPredictOutputInfo(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * BatchPredictOutputInfo gcsOutputDirectory. + * @member {string|null|undefined} gcsOutputDirectory + * @memberof google.cloud.automl.v1.BatchPredictOperationMetadata.BatchPredictOutputInfo + * @instance + */ + BatchPredictOutputInfo.prototype.gcsOutputDirectory = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * BatchPredictOutputInfo outputLocation. + * @member {"gcsOutputDirectory"|undefined} outputLocation + * @memberof google.cloud.automl.v1.BatchPredictOperationMetadata.BatchPredictOutputInfo + * @instance + */ + Object.defineProperty(BatchPredictOutputInfo.prototype, "outputLocation", { + get: $util.oneOfGetter($oneOfFields = ["gcsOutputDirectory"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new BatchPredictOutputInfo instance using the specified properties. + * @function create + * @memberof google.cloud.automl.v1.BatchPredictOperationMetadata.BatchPredictOutputInfo + * @static + * @param {google.cloud.automl.v1.BatchPredictOperationMetadata.IBatchPredictOutputInfo=} [properties] Properties to set + * @returns {google.cloud.automl.v1.BatchPredictOperationMetadata.BatchPredictOutputInfo} BatchPredictOutputInfo instance + */ + BatchPredictOutputInfo.create = function create(properties) { + return new BatchPredictOutputInfo(properties); + }; + + /** + * Encodes the specified BatchPredictOutputInfo message. Does not implicitly {@link google.cloud.automl.v1.BatchPredictOperationMetadata.BatchPredictOutputInfo.verify|verify} messages. + * @function encode + * @memberof google.cloud.automl.v1.BatchPredictOperationMetadata.BatchPredictOutputInfo + * @static + * @param {google.cloud.automl.v1.BatchPredictOperationMetadata.IBatchPredictOutputInfo} message BatchPredictOutputInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BatchPredictOutputInfo.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.gcsOutputDirectory != null && Object.hasOwnProperty.call(message, "gcsOutputDirectory")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.gcsOutputDirectory); + return writer; + }; + + /** + * Encodes the specified BatchPredictOutputInfo message, length delimited. Does not implicitly {@link google.cloud.automl.v1.BatchPredictOperationMetadata.BatchPredictOutputInfo.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.automl.v1.BatchPredictOperationMetadata.BatchPredictOutputInfo + * @static + * @param {google.cloud.automl.v1.BatchPredictOperationMetadata.IBatchPredictOutputInfo} message BatchPredictOutputInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BatchPredictOutputInfo.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a BatchPredictOutputInfo message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.automl.v1.BatchPredictOperationMetadata.BatchPredictOutputInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.automl.v1.BatchPredictOperationMetadata.BatchPredictOutputInfo} BatchPredictOutputInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BatchPredictOutputInfo.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.automl.v1.BatchPredictOperationMetadata.BatchPredictOutputInfo(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.gcsOutputDirectory = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a BatchPredictOutputInfo message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.automl.v1.BatchPredictOperationMetadata.BatchPredictOutputInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.automl.v1.BatchPredictOperationMetadata.BatchPredictOutputInfo} BatchPredictOutputInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BatchPredictOutputInfo.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a BatchPredictOutputInfo message. + * @function verify + * @memberof google.cloud.automl.v1.BatchPredictOperationMetadata.BatchPredictOutputInfo + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + BatchPredictOutputInfo.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.gcsOutputDirectory != null && message.hasOwnProperty("gcsOutputDirectory")) { + properties.outputLocation = 1; + if (!$util.isString(message.gcsOutputDirectory)) + return "gcsOutputDirectory: string expected"; + } + return null; + }; + + /** + * Creates a BatchPredictOutputInfo message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.automl.v1.BatchPredictOperationMetadata.BatchPredictOutputInfo + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.automl.v1.BatchPredictOperationMetadata.BatchPredictOutputInfo} BatchPredictOutputInfo + */ + BatchPredictOutputInfo.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.automl.v1.BatchPredictOperationMetadata.BatchPredictOutputInfo) + return object; + var message = new $root.google.cloud.automl.v1.BatchPredictOperationMetadata.BatchPredictOutputInfo(); + if (object.gcsOutputDirectory != null) + message.gcsOutputDirectory = String(object.gcsOutputDirectory); + return message; + }; + + /** + * Creates a plain object from a BatchPredictOutputInfo message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.automl.v1.BatchPredictOperationMetadata.BatchPredictOutputInfo + * @static + * @param {google.cloud.automl.v1.BatchPredictOperationMetadata.BatchPredictOutputInfo} message BatchPredictOutputInfo + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + BatchPredictOutputInfo.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.gcsOutputDirectory != null && message.hasOwnProperty("gcsOutputDirectory")) { + object.gcsOutputDirectory = message.gcsOutputDirectory; + if (options.oneofs) + object.outputLocation = "gcsOutputDirectory"; + } + return object; + }; + + /** + * Converts this BatchPredictOutputInfo to JSON. + * @function toJSON + * @memberof google.cloud.automl.v1.BatchPredictOperationMetadata.BatchPredictOutputInfo + * @instance + * @returns {Object.} JSON object + */ + BatchPredictOutputInfo.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for BatchPredictOutputInfo + * @function getTypeUrl + * @memberof google.cloud.automl.v1.BatchPredictOperationMetadata.BatchPredictOutputInfo + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + BatchPredictOutputInfo.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.automl.v1.BatchPredictOperationMetadata.BatchPredictOutputInfo"; + }; + + return BatchPredictOutputInfo; + })(); + + return BatchPredictOperationMetadata; + })(); + + v1.ExportModelOperationMetadata = (function() { + + /** + * Properties of an ExportModelOperationMetadata. + * @memberof google.cloud.automl.v1 + * @interface IExportModelOperationMetadata + * @property {google.cloud.automl.v1.ExportModelOperationMetadata.IExportModelOutputInfo|null} [outputInfo] ExportModelOperationMetadata outputInfo + */ + + /** + * Constructs a new ExportModelOperationMetadata. + * @memberof google.cloud.automl.v1 + * @classdesc Represents an ExportModelOperationMetadata. + * @implements IExportModelOperationMetadata + * @constructor + * @param {google.cloud.automl.v1.IExportModelOperationMetadata=} [properties] Properties to set + */ + function ExportModelOperationMetadata(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ExportModelOperationMetadata outputInfo. + * @member {google.cloud.automl.v1.ExportModelOperationMetadata.IExportModelOutputInfo|null|undefined} outputInfo + * @memberof google.cloud.automl.v1.ExportModelOperationMetadata + * @instance + */ + ExportModelOperationMetadata.prototype.outputInfo = null; + + /** + * Creates a new ExportModelOperationMetadata instance using the specified properties. + * @function create + * @memberof google.cloud.automl.v1.ExportModelOperationMetadata + * @static + * @param {google.cloud.automl.v1.IExportModelOperationMetadata=} [properties] Properties to set + * @returns {google.cloud.automl.v1.ExportModelOperationMetadata} ExportModelOperationMetadata instance + */ + ExportModelOperationMetadata.create = function create(properties) { + return new ExportModelOperationMetadata(properties); + }; + + /** + * Encodes the specified ExportModelOperationMetadata message. Does not implicitly {@link google.cloud.automl.v1.ExportModelOperationMetadata.verify|verify} messages. + * @function encode + * @memberof google.cloud.automl.v1.ExportModelOperationMetadata + * @static + * @param {google.cloud.automl.v1.IExportModelOperationMetadata} message ExportModelOperationMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ExportModelOperationMetadata.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.outputInfo != null && Object.hasOwnProperty.call(message, "outputInfo")) + $root.google.cloud.automl.v1.ExportModelOperationMetadata.ExportModelOutputInfo.encode(message.outputInfo, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified ExportModelOperationMetadata message, length delimited. Does not implicitly {@link google.cloud.automl.v1.ExportModelOperationMetadata.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.automl.v1.ExportModelOperationMetadata + * @static + * @param {google.cloud.automl.v1.IExportModelOperationMetadata} message ExportModelOperationMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ExportModelOperationMetadata.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an ExportModelOperationMetadata message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.automl.v1.ExportModelOperationMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.automl.v1.ExportModelOperationMetadata} ExportModelOperationMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ExportModelOperationMetadata.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.automl.v1.ExportModelOperationMetadata(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 2: { + message.outputInfo = $root.google.cloud.automl.v1.ExportModelOperationMetadata.ExportModelOutputInfo.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an ExportModelOperationMetadata message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.automl.v1.ExportModelOperationMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.automl.v1.ExportModelOperationMetadata} ExportModelOperationMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ExportModelOperationMetadata.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an ExportModelOperationMetadata message. + * @function verify + * @memberof google.cloud.automl.v1.ExportModelOperationMetadata + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ExportModelOperationMetadata.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.outputInfo != null && message.hasOwnProperty("outputInfo")) { + var error = $root.google.cloud.automl.v1.ExportModelOperationMetadata.ExportModelOutputInfo.verify(message.outputInfo); + if (error) + return "outputInfo." + error; + } + return null; + }; + + /** + * Creates an ExportModelOperationMetadata message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.automl.v1.ExportModelOperationMetadata + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.automl.v1.ExportModelOperationMetadata} ExportModelOperationMetadata + */ + ExportModelOperationMetadata.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.automl.v1.ExportModelOperationMetadata) + return object; + var message = new $root.google.cloud.automl.v1.ExportModelOperationMetadata(); + if (object.outputInfo != null) { + if (typeof object.outputInfo !== "object") + throw TypeError(".google.cloud.automl.v1.ExportModelOperationMetadata.outputInfo: object expected"); + message.outputInfo = $root.google.cloud.automl.v1.ExportModelOperationMetadata.ExportModelOutputInfo.fromObject(object.outputInfo); + } + return message; + }; + + /** + * Creates a plain object from an ExportModelOperationMetadata message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.automl.v1.ExportModelOperationMetadata + * @static + * @param {google.cloud.automl.v1.ExportModelOperationMetadata} message ExportModelOperationMetadata + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ExportModelOperationMetadata.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.outputInfo = null; + if (message.outputInfo != null && message.hasOwnProperty("outputInfo")) + object.outputInfo = $root.google.cloud.automl.v1.ExportModelOperationMetadata.ExportModelOutputInfo.toObject(message.outputInfo, options); + return object; + }; + + /** + * Converts this ExportModelOperationMetadata to JSON. + * @function toJSON + * @memberof google.cloud.automl.v1.ExportModelOperationMetadata + * @instance + * @returns {Object.} JSON object + */ + ExportModelOperationMetadata.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ExportModelOperationMetadata + * @function getTypeUrl + * @memberof google.cloud.automl.v1.ExportModelOperationMetadata + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ExportModelOperationMetadata.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.automl.v1.ExportModelOperationMetadata"; + }; + + ExportModelOperationMetadata.ExportModelOutputInfo = (function() { + + /** + * Properties of an ExportModelOutputInfo. + * @memberof google.cloud.automl.v1.ExportModelOperationMetadata + * @interface IExportModelOutputInfo + * @property {string|null} [gcsOutputDirectory] ExportModelOutputInfo gcsOutputDirectory + */ + + /** + * Constructs a new ExportModelOutputInfo. + * @memberof google.cloud.automl.v1.ExportModelOperationMetadata + * @classdesc Represents an ExportModelOutputInfo. + * @implements IExportModelOutputInfo + * @constructor + * @param {google.cloud.automl.v1.ExportModelOperationMetadata.IExportModelOutputInfo=} [properties] Properties to set + */ + function ExportModelOutputInfo(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ExportModelOutputInfo gcsOutputDirectory. + * @member {string} gcsOutputDirectory + * @memberof google.cloud.automl.v1.ExportModelOperationMetadata.ExportModelOutputInfo + * @instance + */ + ExportModelOutputInfo.prototype.gcsOutputDirectory = ""; + + /** + * Creates a new ExportModelOutputInfo instance using the specified properties. + * @function create + * @memberof google.cloud.automl.v1.ExportModelOperationMetadata.ExportModelOutputInfo + * @static + * @param {google.cloud.automl.v1.ExportModelOperationMetadata.IExportModelOutputInfo=} [properties] Properties to set + * @returns {google.cloud.automl.v1.ExportModelOperationMetadata.ExportModelOutputInfo} ExportModelOutputInfo instance + */ + ExportModelOutputInfo.create = function create(properties) { + return new ExportModelOutputInfo(properties); + }; + + /** + * Encodes the specified ExportModelOutputInfo message. Does not implicitly {@link google.cloud.automl.v1.ExportModelOperationMetadata.ExportModelOutputInfo.verify|verify} messages. + * @function encode + * @memberof google.cloud.automl.v1.ExportModelOperationMetadata.ExportModelOutputInfo + * @static + * @param {google.cloud.automl.v1.ExportModelOperationMetadata.IExportModelOutputInfo} message ExportModelOutputInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ExportModelOutputInfo.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.gcsOutputDirectory != null && Object.hasOwnProperty.call(message, "gcsOutputDirectory")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.gcsOutputDirectory); + return writer; + }; + + /** + * Encodes the specified ExportModelOutputInfo message, length delimited. Does not implicitly {@link google.cloud.automl.v1.ExportModelOperationMetadata.ExportModelOutputInfo.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.automl.v1.ExportModelOperationMetadata.ExportModelOutputInfo + * @static + * @param {google.cloud.automl.v1.ExportModelOperationMetadata.IExportModelOutputInfo} message ExportModelOutputInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ExportModelOutputInfo.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an ExportModelOutputInfo message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.automl.v1.ExportModelOperationMetadata.ExportModelOutputInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.automl.v1.ExportModelOperationMetadata.ExportModelOutputInfo} ExportModelOutputInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ExportModelOutputInfo.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.automl.v1.ExportModelOperationMetadata.ExportModelOutputInfo(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.gcsOutputDirectory = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an ExportModelOutputInfo message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.automl.v1.ExportModelOperationMetadata.ExportModelOutputInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.automl.v1.ExportModelOperationMetadata.ExportModelOutputInfo} ExportModelOutputInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ExportModelOutputInfo.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an ExportModelOutputInfo message. + * @function verify + * @memberof google.cloud.automl.v1.ExportModelOperationMetadata.ExportModelOutputInfo + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ExportModelOutputInfo.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.gcsOutputDirectory != null && message.hasOwnProperty("gcsOutputDirectory")) + if (!$util.isString(message.gcsOutputDirectory)) + return "gcsOutputDirectory: string expected"; + return null; + }; + + /** + * Creates an ExportModelOutputInfo message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.automl.v1.ExportModelOperationMetadata.ExportModelOutputInfo + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.automl.v1.ExportModelOperationMetadata.ExportModelOutputInfo} ExportModelOutputInfo + */ + ExportModelOutputInfo.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.automl.v1.ExportModelOperationMetadata.ExportModelOutputInfo) + return object; + var message = new $root.google.cloud.automl.v1.ExportModelOperationMetadata.ExportModelOutputInfo(); + if (object.gcsOutputDirectory != null) + message.gcsOutputDirectory = String(object.gcsOutputDirectory); + return message; + }; + + /** + * Creates a plain object from an ExportModelOutputInfo message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.automl.v1.ExportModelOperationMetadata.ExportModelOutputInfo + * @static + * @param {google.cloud.automl.v1.ExportModelOperationMetadata.ExportModelOutputInfo} message ExportModelOutputInfo + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ExportModelOutputInfo.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.gcsOutputDirectory = ""; + if (message.gcsOutputDirectory != null && message.hasOwnProperty("gcsOutputDirectory")) + object.gcsOutputDirectory = message.gcsOutputDirectory; + return object; + }; + + /** + * Converts this ExportModelOutputInfo to JSON. + * @function toJSON + * @memberof google.cloud.automl.v1.ExportModelOperationMetadata.ExportModelOutputInfo + * @instance + * @returns {Object.} JSON object + */ + ExportModelOutputInfo.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ExportModelOutputInfo + * @function getTypeUrl + * @memberof google.cloud.automl.v1.ExportModelOperationMetadata.ExportModelOutputInfo + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ExportModelOutputInfo.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.automl.v1.ExportModelOperationMetadata.ExportModelOutputInfo"; + }; + + return ExportModelOutputInfo; + })(); + + return ExportModelOperationMetadata; + })(); + + v1.PredictionService = (function() { + + /** + * Constructs a new PredictionService service. + * @memberof google.cloud.automl.v1 + * @classdesc Represents a PredictionService + * @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 PredictionService(rpcImpl, requestDelimited, responseDelimited) { + $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); + } + + (PredictionService.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = PredictionService; + + /** + * Creates new PredictionService service using the specified rpc implementation. + * @function create + * @memberof google.cloud.automl.v1.PredictionService + * @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 {PredictionService} RPC service. Useful where requests and/or responses are streamed. + */ + PredictionService.create = function create(rpcImpl, requestDelimited, responseDelimited) { + return new this(rpcImpl, requestDelimited, responseDelimited); + }; + + /** + * Callback as used by {@link google.cloud.automl.v1.PredictionService|predict}. + * @memberof google.cloud.automl.v1.PredictionService + * @typedef PredictCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.automl.v1.PredictResponse} [response] PredictResponse + */ + + /** + * Calls Predict. + * @function predict + * @memberof google.cloud.automl.v1.PredictionService + * @instance + * @param {google.cloud.automl.v1.IPredictRequest} request PredictRequest message or plain object + * @param {google.cloud.automl.v1.PredictionService.PredictCallback} callback Node-style callback called with the error, if any, and PredictResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(PredictionService.prototype.predict = function predict(request, callback) { + return this.rpcCall(predict, $root.google.cloud.automl.v1.PredictRequest, $root.google.cloud.automl.v1.PredictResponse, request, callback); + }, "name", { value: "Predict" }); + + /** + * Calls Predict. + * @function predict + * @memberof google.cloud.automl.v1.PredictionService + * @instance + * @param {google.cloud.automl.v1.IPredictRequest} request PredictRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.automl.v1.PredictionService|batchPredict}. + * @memberof google.cloud.automl.v1.PredictionService + * @typedef BatchPredictCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls BatchPredict. + * @function batchPredict + * @memberof google.cloud.automl.v1.PredictionService + * @instance + * @param {google.cloud.automl.v1.IBatchPredictRequest} request BatchPredictRequest message or plain object + * @param {google.cloud.automl.v1.PredictionService.BatchPredictCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(PredictionService.prototype.batchPredict = function batchPredict(request, callback) { + return this.rpcCall(batchPredict, $root.google.cloud.automl.v1.BatchPredictRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "BatchPredict" }); + + /** + * Calls BatchPredict. + * @function batchPredict + * @memberof google.cloud.automl.v1.PredictionService + * @instance + * @param {google.cloud.automl.v1.IBatchPredictRequest} request BatchPredictRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + return PredictionService; + })(); + + v1.PredictRequest = (function() { + + /** + * Properties of a PredictRequest. + * @memberof google.cloud.automl.v1 + * @interface IPredictRequest + * @property {string|null} [name] PredictRequest name + * @property {google.cloud.automl.v1.IExamplePayload|null} [payload] PredictRequest payload + * @property {Object.|null} [params] PredictRequest params + */ + + /** + * Constructs a new PredictRequest. + * @memberof google.cloud.automl.v1 + * @classdesc Represents a PredictRequest. + * @implements IPredictRequest + * @constructor + * @param {google.cloud.automl.v1.IPredictRequest=} [properties] Properties to set + */ + function PredictRequest(properties) { + this.params = {}; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * PredictRequest name. + * @member {string} name + * @memberof google.cloud.automl.v1.PredictRequest + * @instance + */ + PredictRequest.prototype.name = ""; + + /** + * PredictRequest payload. + * @member {google.cloud.automl.v1.IExamplePayload|null|undefined} payload + * @memberof google.cloud.automl.v1.PredictRequest + * @instance + */ + PredictRequest.prototype.payload = null; + + /** + * PredictRequest params. + * @member {Object.} params + * @memberof google.cloud.automl.v1.PredictRequest + * @instance + */ + PredictRequest.prototype.params = $util.emptyObject; + + /** + * Creates a new PredictRequest instance using the specified properties. + * @function create + * @memberof google.cloud.automl.v1.PredictRequest + * @static + * @param {google.cloud.automl.v1.IPredictRequest=} [properties] Properties to set + * @returns {google.cloud.automl.v1.PredictRequest} PredictRequest instance + */ + PredictRequest.create = function create(properties) { + return new PredictRequest(properties); + }; + + /** + * Encodes the specified PredictRequest message. Does not implicitly {@link google.cloud.automl.v1.PredictRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.automl.v1.PredictRequest + * @static + * @param {google.cloud.automl.v1.IPredictRequest} message PredictRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PredictRequest.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.payload != null && Object.hasOwnProperty.call(message, "payload")) + $root.google.cloud.automl.v1.ExamplePayload.encode(message.payload, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.params != null && Object.hasOwnProperty.call(message, "params")) + for (var keys = Object.keys(message.params), 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.params[keys[i]]).ldelim(); + return writer; + }; + + /** + * Encodes the specified PredictRequest message, length delimited. Does not implicitly {@link google.cloud.automl.v1.PredictRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.automl.v1.PredictRequest + * @static + * @param {google.cloud.automl.v1.IPredictRequest} message PredictRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PredictRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a PredictRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.automl.v1.PredictRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.automl.v1.PredictRequest} PredictRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PredictRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.automl.v1.PredictRequest(), key, value; + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.payload = $root.google.cloud.automl.v1.ExamplePayload.decode(reader, reader.uint32()); + break; + } + case 3: { + if (message.params === $util.emptyObject) + message.params = {}; + 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.params[key] = value; + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a PredictRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.automl.v1.PredictRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.automl.v1.PredictRequest} PredictRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PredictRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a PredictRequest message. + * @function verify + * @memberof google.cloud.automl.v1.PredictRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + PredictRequest.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.payload != null && message.hasOwnProperty("payload")) { + var error = $root.google.cloud.automl.v1.ExamplePayload.verify(message.payload); + if (error) + return "payload." + error; + } + if (message.params != null && message.hasOwnProperty("params")) { + if (!$util.isObject(message.params)) + return "params: object expected"; + var key = Object.keys(message.params); + for (var i = 0; i < key.length; ++i) + if (!$util.isString(message.params[key[i]])) + return "params: string{k:string} expected"; + } + return null; + }; + + /** + * Creates a PredictRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.automl.v1.PredictRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.automl.v1.PredictRequest} PredictRequest + */ + PredictRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.automl.v1.PredictRequest) + return object; + var message = new $root.google.cloud.automl.v1.PredictRequest(); + if (object.name != null) + message.name = String(object.name); + if (object.payload != null) { + if (typeof object.payload !== "object") + throw TypeError(".google.cloud.automl.v1.PredictRequest.payload: object expected"); + message.payload = $root.google.cloud.automl.v1.ExamplePayload.fromObject(object.payload); + } + if (object.params) { + if (typeof object.params !== "object") + throw TypeError(".google.cloud.automl.v1.PredictRequest.params: object expected"); + message.params = {}; + for (var keys = Object.keys(object.params), i = 0; i < keys.length; ++i) + message.params[keys[i]] = String(object.params[keys[i]]); + } + return message; + }; + + /** + * Creates a plain object from a PredictRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.automl.v1.PredictRequest + * @static + * @param {google.cloud.automl.v1.PredictRequest} message PredictRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + PredictRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.objects || options.defaults) + object.params = {}; + if (options.defaults) { + object.name = ""; + object.payload = null; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.payload != null && message.hasOwnProperty("payload")) + object.payload = $root.google.cloud.automl.v1.ExamplePayload.toObject(message.payload, options); + var keys2; + if (message.params && (keys2 = Object.keys(message.params)).length) { + object.params = {}; + for (var j = 0; j < keys2.length; ++j) + object.params[keys2[j]] = message.params[keys2[j]]; + } + return object; + }; + + /** + * Converts this PredictRequest to JSON. + * @function toJSON + * @memberof google.cloud.automl.v1.PredictRequest + * @instance + * @returns {Object.} JSON object + */ + PredictRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for PredictRequest + * @function getTypeUrl + * @memberof google.cloud.automl.v1.PredictRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + PredictRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.automl.v1.PredictRequest"; + }; + + return PredictRequest; + })(); + + v1.PredictResponse = (function() { + + /** + * Properties of a PredictResponse. + * @memberof google.cloud.automl.v1 + * @interface IPredictResponse + * @property {Array.|null} [payload] PredictResponse payload + * @property {google.cloud.automl.v1.IExamplePayload|null} [preprocessedInput] PredictResponse preprocessedInput + * @property {Object.|null} [metadata] PredictResponse metadata + */ + + /** + * Constructs a new PredictResponse. + * @memberof google.cloud.automl.v1 + * @classdesc Represents a PredictResponse. + * @implements IPredictResponse + * @constructor + * @param {google.cloud.automl.v1.IPredictResponse=} [properties] Properties to set + */ + function PredictResponse(properties) { + this.payload = []; + this.metadata = {}; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * PredictResponse payload. + * @member {Array.} payload + * @memberof google.cloud.automl.v1.PredictResponse + * @instance + */ + PredictResponse.prototype.payload = $util.emptyArray; + + /** + * PredictResponse preprocessedInput. + * @member {google.cloud.automl.v1.IExamplePayload|null|undefined} preprocessedInput + * @memberof google.cloud.automl.v1.PredictResponse + * @instance + */ + PredictResponse.prototype.preprocessedInput = null; + + /** + * PredictResponse metadata. + * @member {Object.} metadata + * @memberof google.cloud.automl.v1.PredictResponse + * @instance + */ + PredictResponse.prototype.metadata = $util.emptyObject; + + /** + * Creates a new PredictResponse instance using the specified properties. + * @function create + * @memberof google.cloud.automl.v1.PredictResponse + * @static + * @param {google.cloud.automl.v1.IPredictResponse=} [properties] Properties to set + * @returns {google.cloud.automl.v1.PredictResponse} PredictResponse instance + */ + PredictResponse.create = function create(properties) { + return new PredictResponse(properties); + }; + + /** + * Encodes the specified PredictResponse message. Does not implicitly {@link google.cloud.automl.v1.PredictResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.automl.v1.PredictResponse + * @static + * @param {google.cloud.automl.v1.IPredictResponse} message PredictResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PredictResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.payload != null && message.payload.length) + for (var i = 0; i < message.payload.length; ++i) + $root.google.cloud.automl.v1.AnnotationPayload.encode(message.payload[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.metadata != null && Object.hasOwnProperty.call(message, "metadata")) + for (var keys = Object.keys(message.metadata), 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.metadata[keys[i]]).ldelim(); + if (message.preprocessedInput != null && Object.hasOwnProperty.call(message, "preprocessedInput")) + $root.google.cloud.automl.v1.ExamplePayload.encode(message.preprocessedInput, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified PredictResponse message, length delimited. Does not implicitly {@link google.cloud.automl.v1.PredictResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.automl.v1.PredictResponse + * @static + * @param {google.cloud.automl.v1.IPredictResponse} message PredictResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PredictResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a PredictResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.automl.v1.PredictResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.automl.v1.PredictResponse} PredictResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PredictResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.automl.v1.PredictResponse(), key, value; + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.payload && message.payload.length)) + message.payload = []; + message.payload.push($root.google.cloud.automl.v1.AnnotationPayload.decode(reader, reader.uint32())); + break; + } + case 3: { + message.preprocessedInput = $root.google.cloud.automl.v1.ExamplePayload.decode(reader, reader.uint32()); + break; + } + case 2: { + if (message.metadata === $util.emptyObject) + message.metadata = {}; + 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.metadata[key] = value; + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a PredictResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.automl.v1.PredictResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.automl.v1.PredictResponse} PredictResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PredictResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a PredictResponse message. + * @function verify + * @memberof google.cloud.automl.v1.PredictResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + PredictResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.payload != null && message.hasOwnProperty("payload")) { + if (!Array.isArray(message.payload)) + return "payload: array expected"; + for (var i = 0; i < message.payload.length; ++i) { + var error = $root.google.cloud.automl.v1.AnnotationPayload.verify(message.payload[i]); + if (error) + return "payload." + error; + } + } + if (message.preprocessedInput != null && message.hasOwnProperty("preprocessedInput")) { + var error = $root.google.cloud.automl.v1.ExamplePayload.verify(message.preprocessedInput); + if (error) + return "preprocessedInput." + error; + } + if (message.metadata != null && message.hasOwnProperty("metadata")) { + if (!$util.isObject(message.metadata)) + return "metadata: object expected"; + var key = Object.keys(message.metadata); + for (var i = 0; i < key.length; ++i) + if (!$util.isString(message.metadata[key[i]])) + return "metadata: string{k:string} expected"; + } + return null; + }; + + /** + * Creates a PredictResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.automl.v1.PredictResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.automl.v1.PredictResponse} PredictResponse + */ + PredictResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.automl.v1.PredictResponse) + return object; + var message = new $root.google.cloud.automl.v1.PredictResponse(); + if (object.payload) { + if (!Array.isArray(object.payload)) + throw TypeError(".google.cloud.automl.v1.PredictResponse.payload: array expected"); + message.payload = []; + for (var i = 0; i < object.payload.length; ++i) { + if (typeof object.payload[i] !== "object") + throw TypeError(".google.cloud.automl.v1.PredictResponse.payload: object expected"); + message.payload[i] = $root.google.cloud.automl.v1.AnnotationPayload.fromObject(object.payload[i]); + } + } + if (object.preprocessedInput != null) { + if (typeof object.preprocessedInput !== "object") + throw TypeError(".google.cloud.automl.v1.PredictResponse.preprocessedInput: object expected"); + message.preprocessedInput = $root.google.cloud.automl.v1.ExamplePayload.fromObject(object.preprocessedInput); + } + if (object.metadata) { + if (typeof object.metadata !== "object") + throw TypeError(".google.cloud.automl.v1.PredictResponse.metadata: object expected"); + message.metadata = {}; + for (var keys = Object.keys(object.metadata), i = 0; i < keys.length; ++i) + message.metadata[keys[i]] = String(object.metadata[keys[i]]); + } + return message; + }; + + /** + * Creates a plain object from a PredictResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.automl.v1.PredictResponse + * @static + * @param {google.cloud.automl.v1.PredictResponse} message PredictResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + PredictResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.payload = []; + if (options.objects || options.defaults) + object.metadata = {}; + if (options.defaults) + object.preprocessedInput = null; + if (message.payload && message.payload.length) { + object.payload = []; + for (var j = 0; j < message.payload.length; ++j) + object.payload[j] = $root.google.cloud.automl.v1.AnnotationPayload.toObject(message.payload[j], options); + } + var keys2; + if (message.metadata && (keys2 = Object.keys(message.metadata)).length) { + object.metadata = {}; + for (var j = 0; j < keys2.length; ++j) + object.metadata[keys2[j]] = message.metadata[keys2[j]]; + } + if (message.preprocessedInput != null && message.hasOwnProperty("preprocessedInput")) + object.preprocessedInput = $root.google.cloud.automl.v1.ExamplePayload.toObject(message.preprocessedInput, options); + return object; + }; + + /** + * Converts this PredictResponse to JSON. + * @function toJSON + * @memberof google.cloud.automl.v1.PredictResponse + * @instance + * @returns {Object.} JSON object + */ + PredictResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for PredictResponse + * @function getTypeUrl + * @memberof google.cloud.automl.v1.PredictResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + PredictResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.automl.v1.PredictResponse"; + }; + + return PredictResponse; + })(); + + v1.BatchPredictRequest = (function() { + + /** + * Properties of a BatchPredictRequest. + * @memberof google.cloud.automl.v1 + * @interface IBatchPredictRequest + * @property {string|null} [name] BatchPredictRequest name + * @property {google.cloud.automl.v1.IBatchPredictInputConfig|null} [inputConfig] BatchPredictRequest inputConfig + * @property {google.cloud.automl.v1.IBatchPredictOutputConfig|null} [outputConfig] BatchPredictRequest outputConfig + * @property {Object.|null} [params] BatchPredictRequest params + */ + + /** + * Constructs a new BatchPredictRequest. + * @memberof google.cloud.automl.v1 + * @classdesc Represents a BatchPredictRequest. + * @implements IBatchPredictRequest + * @constructor + * @param {google.cloud.automl.v1.IBatchPredictRequest=} [properties] Properties to set + */ + function BatchPredictRequest(properties) { + this.params = {}; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * BatchPredictRequest name. + * @member {string} name + * @memberof google.cloud.automl.v1.BatchPredictRequest + * @instance + */ + BatchPredictRequest.prototype.name = ""; + + /** + * BatchPredictRequest inputConfig. + * @member {google.cloud.automl.v1.IBatchPredictInputConfig|null|undefined} inputConfig + * @memberof google.cloud.automl.v1.BatchPredictRequest + * @instance + */ + BatchPredictRequest.prototype.inputConfig = null; + + /** + * BatchPredictRequest outputConfig. + * @member {google.cloud.automl.v1.IBatchPredictOutputConfig|null|undefined} outputConfig + * @memberof google.cloud.automl.v1.BatchPredictRequest + * @instance + */ + BatchPredictRequest.prototype.outputConfig = null; + + /** + * BatchPredictRequest params. + * @member {Object.} params + * @memberof google.cloud.automl.v1.BatchPredictRequest + * @instance + */ + BatchPredictRequest.prototype.params = $util.emptyObject; + + /** + * Creates a new BatchPredictRequest instance using the specified properties. + * @function create + * @memberof google.cloud.automl.v1.BatchPredictRequest + * @static + * @param {google.cloud.automl.v1.IBatchPredictRequest=} [properties] Properties to set + * @returns {google.cloud.automl.v1.BatchPredictRequest} BatchPredictRequest instance + */ + BatchPredictRequest.create = function create(properties) { + return new BatchPredictRequest(properties); + }; + + /** + * Encodes the specified BatchPredictRequest message. Does not implicitly {@link google.cloud.automl.v1.BatchPredictRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.automl.v1.BatchPredictRequest + * @static + * @param {google.cloud.automl.v1.IBatchPredictRequest} message BatchPredictRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BatchPredictRequest.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.inputConfig != null && Object.hasOwnProperty.call(message, "inputConfig")) + $root.google.cloud.automl.v1.BatchPredictInputConfig.encode(message.inputConfig, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.outputConfig != null && Object.hasOwnProperty.call(message, "outputConfig")) + $root.google.cloud.automl.v1.BatchPredictOutputConfig.encode(message.outputConfig, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.params != null && Object.hasOwnProperty.call(message, "params")) + for (var keys = Object.keys(message.params), i = 0; i < keys.length; ++i) + writer.uint32(/* id 5, wireType 2 =*/42).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.params[keys[i]]).ldelim(); + return writer; + }; + + /** + * Encodes the specified BatchPredictRequest message, length delimited. Does not implicitly {@link google.cloud.automl.v1.BatchPredictRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.automl.v1.BatchPredictRequest + * @static + * @param {google.cloud.automl.v1.IBatchPredictRequest} message BatchPredictRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BatchPredictRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a BatchPredictRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.automl.v1.BatchPredictRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.automl.v1.BatchPredictRequest} BatchPredictRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BatchPredictRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.automl.v1.BatchPredictRequest(), key, value; + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 3: { + message.inputConfig = $root.google.cloud.automl.v1.BatchPredictInputConfig.decode(reader, reader.uint32()); + break; + } + case 4: { + message.outputConfig = $root.google.cloud.automl.v1.BatchPredictOutputConfig.decode(reader, reader.uint32()); + break; + } + case 5: { + if (message.params === $util.emptyObject) + message.params = {}; + 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.params[key] = value; + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a BatchPredictRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.automl.v1.BatchPredictRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.automl.v1.BatchPredictRequest} BatchPredictRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BatchPredictRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a BatchPredictRequest message. + * @function verify + * @memberof google.cloud.automl.v1.BatchPredictRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + BatchPredictRequest.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.inputConfig != null && message.hasOwnProperty("inputConfig")) { + var error = $root.google.cloud.automl.v1.BatchPredictInputConfig.verify(message.inputConfig); + if (error) + return "inputConfig." + error; + } + if (message.outputConfig != null && message.hasOwnProperty("outputConfig")) { + var error = $root.google.cloud.automl.v1.BatchPredictOutputConfig.verify(message.outputConfig); + if (error) + return "outputConfig." + error; + } + if (message.params != null && message.hasOwnProperty("params")) { + if (!$util.isObject(message.params)) + return "params: object expected"; + var key = Object.keys(message.params); + for (var i = 0; i < key.length; ++i) + if (!$util.isString(message.params[key[i]])) + return "params: string{k:string} expected"; + } + return null; + }; + + /** + * Creates a BatchPredictRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.automl.v1.BatchPredictRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.automl.v1.BatchPredictRequest} BatchPredictRequest + */ + BatchPredictRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.automl.v1.BatchPredictRequest) + return object; + var message = new $root.google.cloud.automl.v1.BatchPredictRequest(); + if (object.name != null) + message.name = String(object.name); + if (object.inputConfig != null) { + if (typeof object.inputConfig !== "object") + throw TypeError(".google.cloud.automl.v1.BatchPredictRequest.inputConfig: object expected"); + message.inputConfig = $root.google.cloud.automl.v1.BatchPredictInputConfig.fromObject(object.inputConfig); + } + if (object.outputConfig != null) { + if (typeof object.outputConfig !== "object") + throw TypeError(".google.cloud.automl.v1.BatchPredictRequest.outputConfig: object expected"); + message.outputConfig = $root.google.cloud.automl.v1.BatchPredictOutputConfig.fromObject(object.outputConfig); + } + if (object.params) { + if (typeof object.params !== "object") + throw TypeError(".google.cloud.automl.v1.BatchPredictRequest.params: object expected"); + message.params = {}; + for (var keys = Object.keys(object.params), i = 0; i < keys.length; ++i) + message.params[keys[i]] = String(object.params[keys[i]]); + } + return message; + }; + + /** + * Creates a plain object from a BatchPredictRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.automl.v1.BatchPredictRequest + * @static + * @param {google.cloud.automl.v1.BatchPredictRequest} message BatchPredictRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + BatchPredictRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.objects || options.defaults) + object.params = {}; + if (options.defaults) { + object.name = ""; + object.inputConfig = null; + object.outputConfig = null; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.inputConfig != null && message.hasOwnProperty("inputConfig")) + object.inputConfig = $root.google.cloud.automl.v1.BatchPredictInputConfig.toObject(message.inputConfig, options); + if (message.outputConfig != null && message.hasOwnProperty("outputConfig")) + object.outputConfig = $root.google.cloud.automl.v1.BatchPredictOutputConfig.toObject(message.outputConfig, options); + var keys2; + if (message.params && (keys2 = Object.keys(message.params)).length) { + object.params = {}; + for (var j = 0; j < keys2.length; ++j) + object.params[keys2[j]] = message.params[keys2[j]]; + } + return object; + }; + + /** + * Converts this BatchPredictRequest to JSON. + * @function toJSON + * @memberof google.cloud.automl.v1.BatchPredictRequest + * @instance + * @returns {Object.} JSON object + */ + BatchPredictRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for BatchPredictRequest + * @function getTypeUrl + * @memberof google.cloud.automl.v1.BatchPredictRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + BatchPredictRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.automl.v1.BatchPredictRequest"; + }; + + return BatchPredictRequest; + })(); + + v1.BatchPredictResult = (function() { + + /** + * Properties of a BatchPredictResult. + * @memberof google.cloud.automl.v1 + * @interface IBatchPredictResult + * @property {Object.|null} [metadata] BatchPredictResult metadata + */ + + /** + * Constructs a new BatchPredictResult. + * @memberof google.cloud.automl.v1 + * @classdesc Represents a BatchPredictResult. + * @implements IBatchPredictResult + * @constructor + * @param {google.cloud.automl.v1.IBatchPredictResult=} [properties] Properties to set + */ + function BatchPredictResult(properties) { + this.metadata = {}; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * BatchPredictResult metadata. + * @member {Object.} metadata + * @memberof google.cloud.automl.v1.BatchPredictResult + * @instance + */ + BatchPredictResult.prototype.metadata = $util.emptyObject; + + /** + * Creates a new BatchPredictResult instance using the specified properties. + * @function create + * @memberof google.cloud.automl.v1.BatchPredictResult + * @static + * @param {google.cloud.automl.v1.IBatchPredictResult=} [properties] Properties to set + * @returns {google.cloud.automl.v1.BatchPredictResult} BatchPredictResult instance + */ + BatchPredictResult.create = function create(properties) { + return new BatchPredictResult(properties); + }; + + /** + * Encodes the specified BatchPredictResult message. Does not implicitly {@link google.cloud.automl.v1.BatchPredictResult.verify|verify} messages. + * @function encode + * @memberof google.cloud.automl.v1.BatchPredictResult + * @static + * @param {google.cloud.automl.v1.IBatchPredictResult} message BatchPredictResult message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BatchPredictResult.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.metadata != null && Object.hasOwnProperty.call(message, "metadata")) + for (var keys = Object.keys(message.metadata), i = 0; i < keys.length; ++i) + writer.uint32(/* id 1, wireType 2 =*/10).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.metadata[keys[i]]).ldelim(); + return writer; + }; + + /** + * Encodes the specified BatchPredictResult message, length delimited. Does not implicitly {@link google.cloud.automl.v1.BatchPredictResult.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.automl.v1.BatchPredictResult + * @static + * @param {google.cloud.automl.v1.IBatchPredictResult} message BatchPredictResult message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BatchPredictResult.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a BatchPredictResult message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.automl.v1.BatchPredictResult + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.automl.v1.BatchPredictResult} BatchPredictResult + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BatchPredictResult.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.automl.v1.BatchPredictResult(), key, value; + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (message.metadata === $util.emptyObject) + message.metadata = {}; + 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.metadata[key] = value; + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a BatchPredictResult message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.automl.v1.BatchPredictResult + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.automl.v1.BatchPredictResult} BatchPredictResult + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BatchPredictResult.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a BatchPredictResult message. + * @function verify + * @memberof google.cloud.automl.v1.BatchPredictResult + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + BatchPredictResult.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.metadata != null && message.hasOwnProperty("metadata")) { + if (!$util.isObject(message.metadata)) + return "metadata: object expected"; + var key = Object.keys(message.metadata); + for (var i = 0; i < key.length; ++i) + if (!$util.isString(message.metadata[key[i]])) + return "metadata: string{k:string} expected"; + } + return null; + }; + + /** + * Creates a BatchPredictResult message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.automl.v1.BatchPredictResult + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.automl.v1.BatchPredictResult} BatchPredictResult + */ + BatchPredictResult.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.automl.v1.BatchPredictResult) + return object; + var message = new $root.google.cloud.automl.v1.BatchPredictResult(); + if (object.metadata) { + if (typeof object.metadata !== "object") + throw TypeError(".google.cloud.automl.v1.BatchPredictResult.metadata: object expected"); + message.metadata = {}; + for (var keys = Object.keys(object.metadata), i = 0; i < keys.length; ++i) + message.metadata[keys[i]] = String(object.metadata[keys[i]]); + } + return message; + }; + + /** + * Creates a plain object from a BatchPredictResult message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.automl.v1.BatchPredictResult + * @static + * @param {google.cloud.automl.v1.BatchPredictResult} message BatchPredictResult + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + BatchPredictResult.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.objects || options.defaults) + object.metadata = {}; + var keys2; + if (message.metadata && (keys2 = Object.keys(message.metadata)).length) { + object.metadata = {}; + for (var j = 0; j < keys2.length; ++j) + object.metadata[keys2[j]] = message.metadata[keys2[j]]; + } + return object; + }; + + /** + * Converts this BatchPredictResult to JSON. + * @function toJSON + * @memberof google.cloud.automl.v1.BatchPredictResult + * @instance + * @returns {Object.} JSON object + */ + BatchPredictResult.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for BatchPredictResult + * @function getTypeUrl + * @memberof google.cloud.automl.v1.BatchPredictResult + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + BatchPredictResult.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.automl.v1.BatchPredictResult"; + }; + + return BatchPredictResult; + })(); + + v1.AutoMl = (function() { + + /** + * Constructs a new AutoMl service. + * @memberof google.cloud.automl.v1 + * @classdesc Represents an AutoMl + * @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 AutoMl(rpcImpl, requestDelimited, responseDelimited) { + $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); + } + + (AutoMl.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = AutoMl; + + /** + * Creates new AutoMl service using the specified rpc implementation. + * @function create + * @memberof google.cloud.automl.v1.AutoMl + * @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 {AutoMl} RPC service. Useful where requests and/or responses are streamed. + */ + AutoMl.create = function create(rpcImpl, requestDelimited, responseDelimited) { + return new this(rpcImpl, requestDelimited, responseDelimited); + }; + + /** + * Callback as used by {@link google.cloud.automl.v1.AutoMl|createDataset}. + * @memberof google.cloud.automl.v1.AutoMl + * @typedef CreateDatasetCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls CreateDataset. + * @function createDataset + * @memberof google.cloud.automl.v1.AutoMl + * @instance + * @param {google.cloud.automl.v1.ICreateDatasetRequest} request CreateDatasetRequest message or plain object + * @param {google.cloud.automl.v1.AutoMl.CreateDatasetCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(AutoMl.prototype.createDataset = function createDataset(request, callback) { + return this.rpcCall(createDataset, $root.google.cloud.automl.v1.CreateDatasetRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "CreateDataset" }); + + /** + * Calls CreateDataset. + * @function createDataset + * @memberof google.cloud.automl.v1.AutoMl + * @instance + * @param {google.cloud.automl.v1.ICreateDatasetRequest} request CreateDatasetRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.automl.v1.AutoMl|getDataset}. + * @memberof google.cloud.automl.v1.AutoMl + * @typedef GetDatasetCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.automl.v1.Dataset} [response] Dataset + */ + + /** + * Calls GetDataset. + * @function getDataset + * @memberof google.cloud.automl.v1.AutoMl + * @instance + * @param {google.cloud.automl.v1.IGetDatasetRequest} request GetDatasetRequest message or plain object + * @param {google.cloud.automl.v1.AutoMl.GetDatasetCallback} callback Node-style callback called with the error, if any, and Dataset + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(AutoMl.prototype.getDataset = function getDataset(request, callback) { + return this.rpcCall(getDataset, $root.google.cloud.automl.v1.GetDatasetRequest, $root.google.cloud.automl.v1.Dataset, request, callback); + }, "name", { value: "GetDataset" }); + + /** + * Calls GetDataset. + * @function getDataset + * @memberof google.cloud.automl.v1.AutoMl + * @instance + * @param {google.cloud.automl.v1.IGetDatasetRequest} request GetDatasetRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.automl.v1.AutoMl|listDatasets}. + * @memberof google.cloud.automl.v1.AutoMl + * @typedef ListDatasetsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.automl.v1.ListDatasetsResponse} [response] ListDatasetsResponse + */ + + /** + * Calls ListDatasets. + * @function listDatasets + * @memberof google.cloud.automl.v1.AutoMl + * @instance + * @param {google.cloud.automl.v1.IListDatasetsRequest} request ListDatasetsRequest message or plain object + * @param {google.cloud.automl.v1.AutoMl.ListDatasetsCallback} callback Node-style callback called with the error, if any, and ListDatasetsResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(AutoMl.prototype.listDatasets = function listDatasets(request, callback) { + return this.rpcCall(listDatasets, $root.google.cloud.automl.v1.ListDatasetsRequest, $root.google.cloud.automl.v1.ListDatasetsResponse, request, callback); + }, "name", { value: "ListDatasets" }); + + /** + * Calls ListDatasets. + * @function listDatasets + * @memberof google.cloud.automl.v1.AutoMl + * @instance + * @param {google.cloud.automl.v1.IListDatasetsRequest} request ListDatasetsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.automl.v1.AutoMl|updateDataset}. + * @memberof google.cloud.automl.v1.AutoMl + * @typedef UpdateDatasetCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.automl.v1.Dataset} [response] Dataset + */ + + /** + * Calls UpdateDataset. + * @function updateDataset + * @memberof google.cloud.automl.v1.AutoMl + * @instance + * @param {google.cloud.automl.v1.IUpdateDatasetRequest} request UpdateDatasetRequest message or plain object + * @param {google.cloud.automl.v1.AutoMl.UpdateDatasetCallback} callback Node-style callback called with the error, if any, and Dataset + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(AutoMl.prototype.updateDataset = function updateDataset(request, callback) { + return this.rpcCall(updateDataset, $root.google.cloud.automl.v1.UpdateDatasetRequest, $root.google.cloud.automl.v1.Dataset, request, callback); + }, "name", { value: "UpdateDataset" }); + + /** + * Calls UpdateDataset. + * @function updateDataset + * @memberof google.cloud.automl.v1.AutoMl + * @instance + * @param {google.cloud.automl.v1.IUpdateDatasetRequest} request UpdateDatasetRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.automl.v1.AutoMl|deleteDataset}. + * @memberof google.cloud.automl.v1.AutoMl + * @typedef DeleteDatasetCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls DeleteDataset. + * @function deleteDataset + * @memberof google.cloud.automl.v1.AutoMl + * @instance + * @param {google.cloud.automl.v1.IDeleteDatasetRequest} request DeleteDatasetRequest message or plain object + * @param {google.cloud.automl.v1.AutoMl.DeleteDatasetCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(AutoMl.prototype.deleteDataset = function deleteDataset(request, callback) { + return this.rpcCall(deleteDataset, $root.google.cloud.automl.v1.DeleteDatasetRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "DeleteDataset" }); + + /** + * Calls DeleteDataset. + * @function deleteDataset + * @memberof google.cloud.automl.v1.AutoMl + * @instance + * @param {google.cloud.automl.v1.IDeleteDatasetRequest} request DeleteDatasetRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.automl.v1.AutoMl|importData}. + * @memberof google.cloud.automl.v1.AutoMl + * @typedef ImportDataCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls ImportData. + * @function importData + * @memberof google.cloud.automl.v1.AutoMl + * @instance + * @param {google.cloud.automl.v1.IImportDataRequest} request ImportDataRequest message or plain object + * @param {google.cloud.automl.v1.AutoMl.ImportDataCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(AutoMl.prototype.importData = function importData(request, callback) { + return this.rpcCall(importData, $root.google.cloud.automl.v1.ImportDataRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "ImportData" }); + + /** + * Calls ImportData. + * @function importData + * @memberof google.cloud.automl.v1.AutoMl + * @instance + * @param {google.cloud.automl.v1.IImportDataRequest} request ImportDataRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.automl.v1.AutoMl|exportData}. + * @memberof google.cloud.automl.v1.AutoMl + * @typedef ExportDataCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls ExportData. + * @function exportData + * @memberof google.cloud.automl.v1.AutoMl + * @instance + * @param {google.cloud.automl.v1.IExportDataRequest} request ExportDataRequest message or plain object + * @param {google.cloud.automl.v1.AutoMl.ExportDataCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(AutoMl.prototype.exportData = function exportData(request, callback) { + return this.rpcCall(exportData, $root.google.cloud.automl.v1.ExportDataRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "ExportData" }); + + /** + * Calls ExportData. + * @function exportData + * @memberof google.cloud.automl.v1.AutoMl + * @instance + * @param {google.cloud.automl.v1.IExportDataRequest} request ExportDataRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.automl.v1.AutoMl|getAnnotationSpec}. + * @memberof google.cloud.automl.v1.AutoMl + * @typedef GetAnnotationSpecCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.automl.v1.AnnotationSpec} [response] AnnotationSpec + */ + + /** + * Calls GetAnnotationSpec. + * @function getAnnotationSpec + * @memberof google.cloud.automl.v1.AutoMl + * @instance + * @param {google.cloud.automl.v1.IGetAnnotationSpecRequest} request GetAnnotationSpecRequest message or plain object + * @param {google.cloud.automl.v1.AutoMl.GetAnnotationSpecCallback} callback Node-style callback called with the error, if any, and AnnotationSpec + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(AutoMl.prototype.getAnnotationSpec = function getAnnotationSpec(request, callback) { + return this.rpcCall(getAnnotationSpec, $root.google.cloud.automl.v1.GetAnnotationSpecRequest, $root.google.cloud.automl.v1.AnnotationSpec, request, callback); + }, "name", { value: "GetAnnotationSpec" }); + + /** + * Calls GetAnnotationSpec. + * @function getAnnotationSpec + * @memberof google.cloud.automl.v1.AutoMl + * @instance + * @param {google.cloud.automl.v1.IGetAnnotationSpecRequest} request GetAnnotationSpecRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.automl.v1.AutoMl|createModel}. + * @memberof google.cloud.automl.v1.AutoMl + * @typedef CreateModelCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls CreateModel. + * @function createModel + * @memberof google.cloud.automl.v1.AutoMl + * @instance + * @param {google.cloud.automl.v1.ICreateModelRequest} request CreateModelRequest message or plain object + * @param {google.cloud.automl.v1.AutoMl.CreateModelCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(AutoMl.prototype.createModel = function createModel(request, callback) { + return this.rpcCall(createModel, $root.google.cloud.automl.v1.CreateModelRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "CreateModel" }); + + /** + * Calls CreateModel. + * @function createModel + * @memberof google.cloud.automl.v1.AutoMl + * @instance + * @param {google.cloud.automl.v1.ICreateModelRequest} request CreateModelRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.automl.v1.AutoMl|getModel}. + * @memberof google.cloud.automl.v1.AutoMl + * @typedef GetModelCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.automl.v1.Model} [response] Model + */ + + /** + * Calls GetModel. + * @function getModel + * @memberof google.cloud.automl.v1.AutoMl + * @instance + * @param {google.cloud.automl.v1.IGetModelRequest} request GetModelRequest message or plain object + * @param {google.cloud.automl.v1.AutoMl.GetModelCallback} callback Node-style callback called with the error, if any, and Model + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(AutoMl.prototype.getModel = function getModel(request, callback) { + return this.rpcCall(getModel, $root.google.cloud.automl.v1.GetModelRequest, $root.google.cloud.automl.v1.Model, request, callback); + }, "name", { value: "GetModel" }); + + /** + * Calls GetModel. + * @function getModel + * @memberof google.cloud.automl.v1.AutoMl + * @instance + * @param {google.cloud.automl.v1.IGetModelRequest} request GetModelRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.automl.v1.AutoMl|listModels}. + * @memberof google.cloud.automl.v1.AutoMl + * @typedef ListModelsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.automl.v1.ListModelsResponse} [response] ListModelsResponse + */ + + /** + * Calls ListModels. + * @function listModels + * @memberof google.cloud.automl.v1.AutoMl + * @instance + * @param {google.cloud.automl.v1.IListModelsRequest} request ListModelsRequest message or plain object + * @param {google.cloud.automl.v1.AutoMl.ListModelsCallback} callback Node-style callback called with the error, if any, and ListModelsResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(AutoMl.prototype.listModels = function listModels(request, callback) { + return this.rpcCall(listModels, $root.google.cloud.automl.v1.ListModelsRequest, $root.google.cloud.automl.v1.ListModelsResponse, request, callback); + }, "name", { value: "ListModels" }); + + /** + * Calls ListModels. + * @function listModels + * @memberof google.cloud.automl.v1.AutoMl + * @instance + * @param {google.cloud.automl.v1.IListModelsRequest} request ListModelsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.automl.v1.AutoMl|deleteModel}. + * @memberof google.cloud.automl.v1.AutoMl + * @typedef DeleteModelCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls DeleteModel. + * @function deleteModel + * @memberof google.cloud.automl.v1.AutoMl + * @instance + * @param {google.cloud.automl.v1.IDeleteModelRequest} request DeleteModelRequest message or plain object + * @param {google.cloud.automl.v1.AutoMl.DeleteModelCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(AutoMl.prototype.deleteModel = function deleteModel(request, callback) { + return this.rpcCall(deleteModel, $root.google.cloud.automl.v1.DeleteModelRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "DeleteModel" }); + + /** + * Calls DeleteModel. + * @function deleteModel + * @memberof google.cloud.automl.v1.AutoMl + * @instance + * @param {google.cloud.automl.v1.IDeleteModelRequest} request DeleteModelRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.automl.v1.AutoMl|updateModel}. + * @memberof google.cloud.automl.v1.AutoMl + * @typedef UpdateModelCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.automl.v1.Model} [response] Model + */ + + /** + * Calls UpdateModel. + * @function updateModel + * @memberof google.cloud.automl.v1.AutoMl + * @instance + * @param {google.cloud.automl.v1.IUpdateModelRequest} request UpdateModelRequest message or plain object + * @param {google.cloud.automl.v1.AutoMl.UpdateModelCallback} callback Node-style callback called with the error, if any, and Model + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(AutoMl.prototype.updateModel = function updateModel(request, callback) { + return this.rpcCall(updateModel, $root.google.cloud.automl.v1.UpdateModelRequest, $root.google.cloud.automl.v1.Model, request, callback); + }, "name", { value: "UpdateModel" }); + + /** + * Calls UpdateModel. + * @function updateModel + * @memberof google.cloud.automl.v1.AutoMl + * @instance + * @param {google.cloud.automl.v1.IUpdateModelRequest} request UpdateModelRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.automl.v1.AutoMl|deployModel}. + * @memberof google.cloud.automl.v1.AutoMl + * @typedef DeployModelCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls DeployModel. + * @function deployModel + * @memberof google.cloud.automl.v1.AutoMl + * @instance + * @param {google.cloud.automl.v1.IDeployModelRequest} request DeployModelRequest message or plain object + * @param {google.cloud.automl.v1.AutoMl.DeployModelCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(AutoMl.prototype.deployModel = function deployModel(request, callback) { + return this.rpcCall(deployModel, $root.google.cloud.automl.v1.DeployModelRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "DeployModel" }); + + /** + * Calls DeployModel. + * @function deployModel + * @memberof google.cloud.automl.v1.AutoMl + * @instance + * @param {google.cloud.automl.v1.IDeployModelRequest} request DeployModelRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.automl.v1.AutoMl|undeployModel}. + * @memberof google.cloud.automl.v1.AutoMl + * @typedef UndeployModelCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls UndeployModel. + * @function undeployModel + * @memberof google.cloud.automl.v1.AutoMl + * @instance + * @param {google.cloud.automl.v1.IUndeployModelRequest} request UndeployModelRequest message or plain object + * @param {google.cloud.automl.v1.AutoMl.UndeployModelCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(AutoMl.prototype.undeployModel = function undeployModel(request, callback) { + return this.rpcCall(undeployModel, $root.google.cloud.automl.v1.UndeployModelRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "UndeployModel" }); + + /** + * Calls UndeployModel. + * @function undeployModel + * @memberof google.cloud.automl.v1.AutoMl + * @instance + * @param {google.cloud.automl.v1.IUndeployModelRequest} request UndeployModelRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.automl.v1.AutoMl|exportModel}. + * @memberof google.cloud.automl.v1.AutoMl + * @typedef ExportModelCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls ExportModel. + * @function exportModel + * @memberof google.cloud.automl.v1.AutoMl + * @instance + * @param {google.cloud.automl.v1.IExportModelRequest} request ExportModelRequest message or plain object + * @param {google.cloud.automl.v1.AutoMl.ExportModelCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(AutoMl.prototype.exportModel = function exportModel(request, callback) { + return this.rpcCall(exportModel, $root.google.cloud.automl.v1.ExportModelRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "ExportModel" }); + + /** + * Calls ExportModel. + * @function exportModel + * @memberof google.cloud.automl.v1.AutoMl + * @instance + * @param {google.cloud.automl.v1.IExportModelRequest} request ExportModelRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.automl.v1.AutoMl|getModelEvaluation}. + * @memberof google.cloud.automl.v1.AutoMl + * @typedef GetModelEvaluationCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.automl.v1.ModelEvaluation} [response] ModelEvaluation + */ + + /** + * Calls GetModelEvaluation. + * @function getModelEvaluation + * @memberof google.cloud.automl.v1.AutoMl + * @instance + * @param {google.cloud.automl.v1.IGetModelEvaluationRequest} request GetModelEvaluationRequest message or plain object + * @param {google.cloud.automl.v1.AutoMl.GetModelEvaluationCallback} callback Node-style callback called with the error, if any, and ModelEvaluation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(AutoMl.prototype.getModelEvaluation = function getModelEvaluation(request, callback) { + return this.rpcCall(getModelEvaluation, $root.google.cloud.automl.v1.GetModelEvaluationRequest, $root.google.cloud.automl.v1.ModelEvaluation, request, callback); + }, "name", { value: "GetModelEvaluation" }); + + /** + * Calls GetModelEvaluation. + * @function getModelEvaluation + * @memberof google.cloud.automl.v1.AutoMl + * @instance + * @param {google.cloud.automl.v1.IGetModelEvaluationRequest} request GetModelEvaluationRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.automl.v1.AutoMl|listModelEvaluations}. + * @memberof google.cloud.automl.v1.AutoMl + * @typedef ListModelEvaluationsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.automl.v1.ListModelEvaluationsResponse} [response] ListModelEvaluationsResponse + */ + + /** + * Calls ListModelEvaluations. + * @function listModelEvaluations + * @memberof google.cloud.automl.v1.AutoMl + * @instance + * @param {google.cloud.automl.v1.IListModelEvaluationsRequest} request ListModelEvaluationsRequest message or plain object + * @param {google.cloud.automl.v1.AutoMl.ListModelEvaluationsCallback} callback Node-style callback called with the error, if any, and ListModelEvaluationsResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(AutoMl.prototype.listModelEvaluations = function listModelEvaluations(request, callback) { + return this.rpcCall(listModelEvaluations, $root.google.cloud.automl.v1.ListModelEvaluationsRequest, $root.google.cloud.automl.v1.ListModelEvaluationsResponse, request, callback); + }, "name", { value: "ListModelEvaluations" }); + + /** + * Calls ListModelEvaluations. + * @function listModelEvaluations + * @memberof google.cloud.automl.v1.AutoMl + * @instance + * @param {google.cloud.automl.v1.IListModelEvaluationsRequest} request ListModelEvaluationsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + return AutoMl; + })(); + + v1.CreateDatasetRequest = (function() { + + /** + * Properties of a CreateDatasetRequest. + * @memberof google.cloud.automl.v1 + * @interface ICreateDatasetRequest + * @property {string|null} [parent] CreateDatasetRequest parent + * @property {google.cloud.automl.v1.IDataset|null} [dataset] CreateDatasetRequest dataset + */ + + /** + * Constructs a new CreateDatasetRequest. + * @memberof google.cloud.automl.v1 + * @classdesc Represents a CreateDatasetRequest. + * @implements ICreateDatasetRequest + * @constructor + * @param {google.cloud.automl.v1.ICreateDatasetRequest=} [properties] Properties to set + */ + function CreateDatasetRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * CreateDatasetRequest parent. + * @member {string} parent + * @memberof google.cloud.automl.v1.CreateDatasetRequest + * @instance + */ + CreateDatasetRequest.prototype.parent = ""; + + /** + * CreateDatasetRequest dataset. + * @member {google.cloud.automl.v1.IDataset|null|undefined} dataset + * @memberof google.cloud.automl.v1.CreateDatasetRequest + * @instance + */ + CreateDatasetRequest.prototype.dataset = null; + + /** + * Creates a new CreateDatasetRequest instance using the specified properties. + * @function create + * @memberof google.cloud.automl.v1.CreateDatasetRequest + * @static + * @param {google.cloud.automl.v1.ICreateDatasetRequest=} [properties] Properties to set + * @returns {google.cloud.automl.v1.CreateDatasetRequest} CreateDatasetRequest instance + */ + CreateDatasetRequest.create = function create(properties) { + return new CreateDatasetRequest(properties); + }; + + /** + * Encodes the specified CreateDatasetRequest message. Does not implicitly {@link google.cloud.automl.v1.CreateDatasetRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.automl.v1.CreateDatasetRequest + * @static + * @param {google.cloud.automl.v1.ICreateDatasetRequest} message CreateDatasetRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateDatasetRequest.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.dataset != null && Object.hasOwnProperty.call(message, "dataset")) + $root.google.cloud.automl.v1.Dataset.encode(message.dataset, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified CreateDatasetRequest message, length delimited. Does not implicitly {@link google.cloud.automl.v1.CreateDatasetRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.automl.v1.CreateDatasetRequest + * @static + * @param {google.cloud.automl.v1.ICreateDatasetRequest} message CreateDatasetRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateDatasetRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CreateDatasetRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.automl.v1.CreateDatasetRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.automl.v1.CreateDatasetRequest} CreateDatasetRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateDatasetRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.automl.v1.CreateDatasetRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.dataset = $root.google.cloud.automl.v1.Dataset.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CreateDatasetRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.automl.v1.CreateDatasetRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.automl.v1.CreateDatasetRequest} CreateDatasetRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateDatasetRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CreateDatasetRequest message. + * @function verify + * @memberof google.cloud.automl.v1.CreateDatasetRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CreateDatasetRequest.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.dataset != null && message.hasOwnProperty("dataset")) { + var error = $root.google.cloud.automl.v1.Dataset.verify(message.dataset); + if (error) + return "dataset." + error; + } + return null; + }; + + /** + * Creates a CreateDatasetRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.automl.v1.CreateDatasetRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.automl.v1.CreateDatasetRequest} CreateDatasetRequest + */ + CreateDatasetRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.automl.v1.CreateDatasetRequest) + return object; + var message = new $root.google.cloud.automl.v1.CreateDatasetRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.dataset != null) { + if (typeof object.dataset !== "object") + throw TypeError(".google.cloud.automl.v1.CreateDatasetRequest.dataset: object expected"); + message.dataset = $root.google.cloud.automl.v1.Dataset.fromObject(object.dataset); + } + return message; + }; + + /** + * Creates a plain object from a CreateDatasetRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.automl.v1.CreateDatasetRequest + * @static + * @param {google.cloud.automl.v1.CreateDatasetRequest} message CreateDatasetRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CreateDatasetRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.dataset = null; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.dataset != null && message.hasOwnProperty("dataset")) + object.dataset = $root.google.cloud.automl.v1.Dataset.toObject(message.dataset, options); + return object; + }; + + /** + * Converts this CreateDatasetRequest to JSON. + * @function toJSON + * @memberof google.cloud.automl.v1.CreateDatasetRequest + * @instance + * @returns {Object.} JSON object + */ + CreateDatasetRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CreateDatasetRequest + * @function getTypeUrl + * @memberof google.cloud.automl.v1.CreateDatasetRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CreateDatasetRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.automl.v1.CreateDatasetRequest"; + }; + + return CreateDatasetRequest; + })(); + + v1.GetDatasetRequest = (function() { + + /** + * Properties of a GetDatasetRequest. + * @memberof google.cloud.automl.v1 + * @interface IGetDatasetRequest + * @property {string|null} [name] GetDatasetRequest name + */ + + /** + * Constructs a new GetDatasetRequest. + * @memberof google.cloud.automl.v1 + * @classdesc Represents a GetDatasetRequest. + * @implements IGetDatasetRequest + * @constructor + * @param {google.cloud.automl.v1.IGetDatasetRequest=} [properties] Properties to set + */ + function GetDatasetRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetDatasetRequest name. + * @member {string} name + * @memberof google.cloud.automl.v1.GetDatasetRequest + * @instance + */ + GetDatasetRequest.prototype.name = ""; + + /** + * Creates a new GetDatasetRequest instance using the specified properties. + * @function create + * @memberof google.cloud.automl.v1.GetDatasetRequest + * @static + * @param {google.cloud.automl.v1.IGetDatasetRequest=} [properties] Properties to set + * @returns {google.cloud.automl.v1.GetDatasetRequest} GetDatasetRequest instance + */ + GetDatasetRequest.create = function create(properties) { + return new GetDatasetRequest(properties); + }; + + /** + * Encodes the specified GetDatasetRequest message. Does not implicitly {@link google.cloud.automl.v1.GetDatasetRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.automl.v1.GetDatasetRequest + * @static + * @param {google.cloud.automl.v1.IGetDatasetRequest} message GetDatasetRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetDatasetRequest.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 GetDatasetRequest message, length delimited. Does not implicitly {@link google.cloud.automl.v1.GetDatasetRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.automl.v1.GetDatasetRequest + * @static + * @param {google.cloud.automl.v1.IGetDatasetRequest} message GetDatasetRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetDatasetRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetDatasetRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.automl.v1.GetDatasetRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.automl.v1.GetDatasetRequest} GetDatasetRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetDatasetRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.automl.v1.GetDatasetRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetDatasetRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.automl.v1.GetDatasetRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.automl.v1.GetDatasetRequest} GetDatasetRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetDatasetRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetDatasetRequest message. + * @function verify + * @memberof google.cloud.automl.v1.GetDatasetRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetDatasetRequest.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 GetDatasetRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.automl.v1.GetDatasetRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.automl.v1.GetDatasetRequest} GetDatasetRequest + */ + GetDatasetRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.automl.v1.GetDatasetRequest) + return object; + var message = new $root.google.cloud.automl.v1.GetDatasetRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a GetDatasetRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.automl.v1.GetDatasetRequest + * @static + * @param {google.cloud.automl.v1.GetDatasetRequest} message GetDatasetRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetDatasetRequest.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 GetDatasetRequest to JSON. + * @function toJSON + * @memberof google.cloud.automl.v1.GetDatasetRequest + * @instance + * @returns {Object.} JSON object + */ + GetDatasetRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GetDatasetRequest + * @function getTypeUrl + * @memberof google.cloud.automl.v1.GetDatasetRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GetDatasetRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.automl.v1.GetDatasetRequest"; + }; + + return GetDatasetRequest; + })(); + + v1.ListDatasetsRequest = (function() { + + /** + * Properties of a ListDatasetsRequest. + * @memberof google.cloud.automl.v1 + * @interface IListDatasetsRequest + * @property {string|null} [parent] ListDatasetsRequest parent + * @property {string|null} [filter] ListDatasetsRequest filter + * @property {number|null} [pageSize] ListDatasetsRequest pageSize + * @property {string|null} [pageToken] ListDatasetsRequest pageToken + */ + + /** + * Constructs a new ListDatasetsRequest. + * @memberof google.cloud.automl.v1 + * @classdesc Represents a ListDatasetsRequest. + * @implements IListDatasetsRequest + * @constructor + * @param {google.cloud.automl.v1.IListDatasetsRequest=} [properties] Properties to set + */ + function ListDatasetsRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListDatasetsRequest parent. + * @member {string} parent + * @memberof google.cloud.automl.v1.ListDatasetsRequest + * @instance + */ + ListDatasetsRequest.prototype.parent = ""; + + /** + * ListDatasetsRequest filter. + * @member {string} filter + * @memberof google.cloud.automl.v1.ListDatasetsRequest + * @instance + */ + ListDatasetsRequest.prototype.filter = ""; + + /** + * ListDatasetsRequest pageSize. + * @member {number} pageSize + * @memberof google.cloud.automl.v1.ListDatasetsRequest + * @instance + */ + ListDatasetsRequest.prototype.pageSize = 0; + + /** + * ListDatasetsRequest pageToken. + * @member {string} pageToken + * @memberof google.cloud.automl.v1.ListDatasetsRequest + * @instance + */ + ListDatasetsRequest.prototype.pageToken = ""; + + /** + * Creates a new ListDatasetsRequest instance using the specified properties. + * @function create + * @memberof google.cloud.automl.v1.ListDatasetsRequest + * @static + * @param {google.cloud.automl.v1.IListDatasetsRequest=} [properties] Properties to set + * @returns {google.cloud.automl.v1.ListDatasetsRequest} ListDatasetsRequest instance + */ + ListDatasetsRequest.create = function create(properties) { + return new ListDatasetsRequest(properties); + }; + + /** + * Encodes the specified ListDatasetsRequest message. Does not implicitly {@link google.cloud.automl.v1.ListDatasetsRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.automl.v1.ListDatasetsRequest + * @static + * @param {google.cloud.automl.v1.IListDatasetsRequest} message ListDatasetsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListDatasetsRequest.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.filter != null && Object.hasOwnProperty.call(message, "filter")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.filter); + if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.pageSize); + if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.pageToken); + return writer; + }; + + /** + * Encodes the specified ListDatasetsRequest message, length delimited. Does not implicitly {@link google.cloud.automl.v1.ListDatasetsRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.automl.v1.ListDatasetsRequest + * @static + * @param {google.cloud.automl.v1.IListDatasetsRequest} message ListDatasetsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListDatasetsRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListDatasetsRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.automl.v1.ListDatasetsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.automl.v1.ListDatasetsRequest} ListDatasetsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListDatasetsRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.automl.v1.ListDatasetsRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 3: { + message.filter = reader.string(); + break; + } + case 4: { + message.pageSize = reader.int32(); + break; + } + case 6: { + message.pageToken = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListDatasetsRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.automl.v1.ListDatasetsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.automl.v1.ListDatasetsRequest} ListDatasetsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListDatasetsRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListDatasetsRequest message. + * @function verify + * @memberof google.cloud.automl.v1.ListDatasetsRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListDatasetsRequest.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.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 ListDatasetsRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.automl.v1.ListDatasetsRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.automl.v1.ListDatasetsRequest} ListDatasetsRequest + */ + ListDatasetsRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.automl.v1.ListDatasetsRequest) + return object; + var message = new $root.google.cloud.automl.v1.ListDatasetsRequest(); + if (object.parent != null) + message.parent = String(object.parent); + 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 ListDatasetsRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.automl.v1.ListDatasetsRequest + * @static + * @param {google.cloud.automl.v1.ListDatasetsRequest} message ListDatasetsRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListDatasetsRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.filter = ""; + object.pageSize = 0; + object.pageToken = ""; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + 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; + return object; + }; + + /** + * Converts this ListDatasetsRequest to JSON. + * @function toJSON + * @memberof google.cloud.automl.v1.ListDatasetsRequest + * @instance + * @returns {Object.} JSON object + */ + ListDatasetsRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListDatasetsRequest + * @function getTypeUrl + * @memberof google.cloud.automl.v1.ListDatasetsRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListDatasetsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.automl.v1.ListDatasetsRequest"; + }; + + return ListDatasetsRequest; + })(); + + v1.ListDatasetsResponse = (function() { + + /** + * Properties of a ListDatasetsResponse. + * @memberof google.cloud.automl.v1 + * @interface IListDatasetsResponse + * @property {Array.|null} [datasets] ListDatasetsResponse datasets + * @property {string|null} [nextPageToken] ListDatasetsResponse nextPageToken + */ + + /** + * Constructs a new ListDatasetsResponse. + * @memberof google.cloud.automl.v1 + * @classdesc Represents a ListDatasetsResponse. + * @implements IListDatasetsResponse + * @constructor + * @param {google.cloud.automl.v1.IListDatasetsResponse=} [properties] Properties to set + */ + function ListDatasetsResponse(properties) { + this.datasets = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListDatasetsResponse datasets. + * @member {Array.} datasets + * @memberof google.cloud.automl.v1.ListDatasetsResponse + * @instance + */ + ListDatasetsResponse.prototype.datasets = $util.emptyArray; + + /** + * ListDatasetsResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.cloud.automl.v1.ListDatasetsResponse + * @instance + */ + ListDatasetsResponse.prototype.nextPageToken = ""; + + /** + * Creates a new ListDatasetsResponse instance using the specified properties. + * @function create + * @memberof google.cloud.automl.v1.ListDatasetsResponse + * @static + * @param {google.cloud.automl.v1.IListDatasetsResponse=} [properties] Properties to set + * @returns {google.cloud.automl.v1.ListDatasetsResponse} ListDatasetsResponse instance + */ + ListDatasetsResponse.create = function create(properties) { + return new ListDatasetsResponse(properties); + }; + + /** + * Encodes the specified ListDatasetsResponse message. Does not implicitly {@link google.cloud.automl.v1.ListDatasetsResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.automl.v1.ListDatasetsResponse + * @static + * @param {google.cloud.automl.v1.IListDatasetsResponse} message ListDatasetsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListDatasetsResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.datasets != null && message.datasets.length) + for (var i = 0; i < message.datasets.length; ++i) + $root.google.cloud.automl.v1.Dataset.encode(message.datasets[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 ListDatasetsResponse message, length delimited. Does not implicitly {@link google.cloud.automl.v1.ListDatasetsResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.automl.v1.ListDatasetsResponse + * @static + * @param {google.cloud.automl.v1.IListDatasetsResponse} message ListDatasetsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListDatasetsResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListDatasetsResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.automl.v1.ListDatasetsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.automl.v1.ListDatasetsResponse} ListDatasetsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListDatasetsResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.automl.v1.ListDatasetsResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.datasets && message.datasets.length)) + message.datasets = []; + message.datasets.push($root.google.cloud.automl.v1.Dataset.decode(reader, reader.uint32())); + break; + } + case 2: { + message.nextPageToken = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListDatasetsResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.automl.v1.ListDatasetsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.automl.v1.ListDatasetsResponse} ListDatasetsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListDatasetsResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListDatasetsResponse message. + * @function verify + * @memberof google.cloud.automl.v1.ListDatasetsResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListDatasetsResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.datasets != null && message.hasOwnProperty("datasets")) { + if (!Array.isArray(message.datasets)) + return "datasets: array expected"; + for (var i = 0; i < message.datasets.length; ++i) { + var error = $root.google.cloud.automl.v1.Dataset.verify(message.datasets[i]); + if (error) + return "datasets." + error; + } + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + return null; + }; + + /** + * Creates a ListDatasetsResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.automl.v1.ListDatasetsResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.automl.v1.ListDatasetsResponse} ListDatasetsResponse + */ + ListDatasetsResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.automl.v1.ListDatasetsResponse) + return object; + var message = new $root.google.cloud.automl.v1.ListDatasetsResponse(); + if (object.datasets) { + if (!Array.isArray(object.datasets)) + throw TypeError(".google.cloud.automl.v1.ListDatasetsResponse.datasets: array expected"); + message.datasets = []; + for (var i = 0; i < object.datasets.length; ++i) { + if (typeof object.datasets[i] !== "object") + throw TypeError(".google.cloud.automl.v1.ListDatasetsResponse.datasets: object expected"); + message.datasets[i] = $root.google.cloud.automl.v1.Dataset.fromObject(object.datasets[i]); + } + } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + return message; + }; + + /** + * Creates a plain object from a ListDatasetsResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.automl.v1.ListDatasetsResponse + * @static + * @param {google.cloud.automl.v1.ListDatasetsResponse} message ListDatasetsResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListDatasetsResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.datasets = []; + if (options.defaults) + object.nextPageToken = ""; + if (message.datasets && message.datasets.length) { + object.datasets = []; + for (var j = 0; j < message.datasets.length; ++j) + object.datasets[j] = $root.google.cloud.automl.v1.Dataset.toObject(message.datasets[j], options); + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + object.nextPageToken = message.nextPageToken; + return object; + }; + + /** + * Converts this ListDatasetsResponse to JSON. + * @function toJSON + * @memberof google.cloud.automl.v1.ListDatasetsResponse + * @instance + * @returns {Object.} JSON object + */ + ListDatasetsResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListDatasetsResponse + * @function getTypeUrl + * @memberof google.cloud.automl.v1.ListDatasetsResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListDatasetsResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.automl.v1.ListDatasetsResponse"; + }; + + return ListDatasetsResponse; + })(); + + v1.UpdateDatasetRequest = (function() { + + /** + * Properties of an UpdateDatasetRequest. + * @memberof google.cloud.automl.v1 + * @interface IUpdateDatasetRequest + * @property {google.cloud.automl.v1.IDataset|null} [dataset] UpdateDatasetRequest dataset + * @property {google.protobuf.IFieldMask|null} [updateMask] UpdateDatasetRequest updateMask + */ + + /** + * Constructs a new UpdateDatasetRequest. + * @memberof google.cloud.automl.v1 + * @classdesc Represents an UpdateDatasetRequest. + * @implements IUpdateDatasetRequest + * @constructor + * @param {google.cloud.automl.v1.IUpdateDatasetRequest=} [properties] Properties to set + */ + function UpdateDatasetRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * UpdateDatasetRequest dataset. + * @member {google.cloud.automl.v1.IDataset|null|undefined} dataset + * @memberof google.cloud.automl.v1.UpdateDatasetRequest + * @instance + */ + UpdateDatasetRequest.prototype.dataset = null; + + /** + * UpdateDatasetRequest updateMask. + * @member {google.protobuf.IFieldMask|null|undefined} updateMask + * @memberof google.cloud.automl.v1.UpdateDatasetRequest + * @instance + */ + UpdateDatasetRequest.prototype.updateMask = null; + + /** + * Creates a new UpdateDatasetRequest instance using the specified properties. + * @function create + * @memberof google.cloud.automl.v1.UpdateDatasetRequest + * @static + * @param {google.cloud.automl.v1.IUpdateDatasetRequest=} [properties] Properties to set + * @returns {google.cloud.automl.v1.UpdateDatasetRequest} UpdateDatasetRequest instance + */ + UpdateDatasetRequest.create = function create(properties) { + return new UpdateDatasetRequest(properties); + }; + + /** + * Encodes the specified UpdateDatasetRequest message. Does not implicitly {@link google.cloud.automl.v1.UpdateDatasetRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.automl.v1.UpdateDatasetRequest + * @static + * @param {google.cloud.automl.v1.IUpdateDatasetRequest} message UpdateDatasetRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateDatasetRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.dataset != null && Object.hasOwnProperty.call(message, "dataset")) + $root.google.cloud.automl.v1.Dataset.encode(message.dataset, 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 UpdateDatasetRequest message, length delimited. Does not implicitly {@link google.cloud.automl.v1.UpdateDatasetRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.automl.v1.UpdateDatasetRequest + * @static + * @param {google.cloud.automl.v1.IUpdateDatasetRequest} message UpdateDatasetRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateDatasetRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an UpdateDatasetRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.automl.v1.UpdateDatasetRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.automl.v1.UpdateDatasetRequest} UpdateDatasetRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateDatasetRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.automl.v1.UpdateDatasetRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.dataset = $root.google.cloud.automl.v1.Dataset.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 UpdateDatasetRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.automl.v1.UpdateDatasetRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.automl.v1.UpdateDatasetRequest} UpdateDatasetRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateDatasetRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an UpdateDatasetRequest message. + * @function verify + * @memberof google.cloud.automl.v1.UpdateDatasetRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + UpdateDatasetRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.dataset != null && message.hasOwnProperty("dataset")) { + var error = $root.google.cloud.automl.v1.Dataset.verify(message.dataset); + if (error) + return "dataset." + 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 UpdateDatasetRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.automl.v1.UpdateDatasetRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.automl.v1.UpdateDatasetRequest} UpdateDatasetRequest + */ + UpdateDatasetRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.automl.v1.UpdateDatasetRequest) + return object; + var message = new $root.google.cloud.automl.v1.UpdateDatasetRequest(); + if (object.dataset != null) { + if (typeof object.dataset !== "object") + throw TypeError(".google.cloud.automl.v1.UpdateDatasetRequest.dataset: object expected"); + message.dataset = $root.google.cloud.automl.v1.Dataset.fromObject(object.dataset); + } + if (object.updateMask != null) { + if (typeof object.updateMask !== "object") + throw TypeError(".google.cloud.automl.v1.UpdateDatasetRequest.updateMask: object expected"); + message.updateMask = $root.google.protobuf.FieldMask.fromObject(object.updateMask); + } + return message; + }; + + /** + * Creates a plain object from an UpdateDatasetRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.automl.v1.UpdateDatasetRequest + * @static + * @param {google.cloud.automl.v1.UpdateDatasetRequest} message UpdateDatasetRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + UpdateDatasetRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.dataset = null; + object.updateMask = null; + } + if (message.dataset != null && message.hasOwnProperty("dataset")) + object.dataset = $root.google.cloud.automl.v1.Dataset.toObject(message.dataset, options); + if (message.updateMask != null && message.hasOwnProperty("updateMask")) + object.updateMask = $root.google.protobuf.FieldMask.toObject(message.updateMask, options); + return object; + }; + + /** + * Converts this UpdateDatasetRequest to JSON. + * @function toJSON + * @memberof google.cloud.automl.v1.UpdateDatasetRequest + * @instance + * @returns {Object.} JSON object + */ + UpdateDatasetRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for UpdateDatasetRequest + * @function getTypeUrl + * @memberof google.cloud.automl.v1.UpdateDatasetRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + UpdateDatasetRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.automl.v1.UpdateDatasetRequest"; + }; + + return UpdateDatasetRequest; + })(); + + v1.DeleteDatasetRequest = (function() { + + /** + * Properties of a DeleteDatasetRequest. + * @memberof google.cloud.automl.v1 + * @interface IDeleteDatasetRequest + * @property {string|null} [name] DeleteDatasetRequest name + */ + + /** + * Constructs a new DeleteDatasetRequest. + * @memberof google.cloud.automl.v1 + * @classdesc Represents a DeleteDatasetRequest. + * @implements IDeleteDatasetRequest + * @constructor + * @param {google.cloud.automl.v1.IDeleteDatasetRequest=} [properties] Properties to set + */ + function DeleteDatasetRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * DeleteDatasetRequest name. + * @member {string} name + * @memberof google.cloud.automl.v1.DeleteDatasetRequest + * @instance + */ + DeleteDatasetRequest.prototype.name = ""; + + /** + * Creates a new DeleteDatasetRequest instance using the specified properties. + * @function create + * @memberof google.cloud.automl.v1.DeleteDatasetRequest + * @static + * @param {google.cloud.automl.v1.IDeleteDatasetRequest=} [properties] Properties to set + * @returns {google.cloud.automl.v1.DeleteDatasetRequest} DeleteDatasetRequest instance + */ + DeleteDatasetRequest.create = function create(properties) { + return new DeleteDatasetRequest(properties); + }; + + /** + * Encodes the specified DeleteDatasetRequest message. Does not implicitly {@link google.cloud.automl.v1.DeleteDatasetRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.automl.v1.DeleteDatasetRequest + * @static + * @param {google.cloud.automl.v1.IDeleteDatasetRequest} message DeleteDatasetRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteDatasetRequest.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 DeleteDatasetRequest message, length delimited. Does not implicitly {@link google.cloud.automl.v1.DeleteDatasetRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.automl.v1.DeleteDatasetRequest + * @static + * @param {google.cloud.automl.v1.IDeleteDatasetRequest} message DeleteDatasetRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteDatasetRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DeleteDatasetRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.automl.v1.DeleteDatasetRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.automl.v1.DeleteDatasetRequest} DeleteDatasetRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteDatasetRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.automl.v1.DeleteDatasetRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DeleteDatasetRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.automl.v1.DeleteDatasetRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.automl.v1.DeleteDatasetRequest} DeleteDatasetRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteDatasetRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DeleteDatasetRequest message. + * @function verify + * @memberof google.cloud.automl.v1.DeleteDatasetRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DeleteDatasetRequest.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 DeleteDatasetRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.automl.v1.DeleteDatasetRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.automl.v1.DeleteDatasetRequest} DeleteDatasetRequest + */ + DeleteDatasetRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.automl.v1.DeleteDatasetRequest) + return object; + var message = new $root.google.cloud.automl.v1.DeleteDatasetRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a DeleteDatasetRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.automl.v1.DeleteDatasetRequest + * @static + * @param {google.cloud.automl.v1.DeleteDatasetRequest} message DeleteDatasetRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DeleteDatasetRequest.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 DeleteDatasetRequest to JSON. + * @function toJSON + * @memberof google.cloud.automl.v1.DeleteDatasetRequest + * @instance + * @returns {Object.} JSON object + */ + DeleteDatasetRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DeleteDatasetRequest + * @function getTypeUrl + * @memberof google.cloud.automl.v1.DeleteDatasetRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DeleteDatasetRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.automl.v1.DeleteDatasetRequest"; + }; + + return DeleteDatasetRequest; + })(); + + v1.ImportDataRequest = (function() { + + /** + * Properties of an ImportDataRequest. + * @memberof google.cloud.automl.v1 + * @interface IImportDataRequest + * @property {string|null} [name] ImportDataRequest name + * @property {google.cloud.automl.v1.IInputConfig|null} [inputConfig] ImportDataRequest inputConfig + */ + + /** + * Constructs a new ImportDataRequest. + * @memberof google.cloud.automl.v1 + * @classdesc Represents an ImportDataRequest. + * @implements IImportDataRequest + * @constructor + * @param {google.cloud.automl.v1.IImportDataRequest=} [properties] Properties to set + */ + function ImportDataRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ImportDataRequest name. + * @member {string} name + * @memberof google.cloud.automl.v1.ImportDataRequest + * @instance + */ + ImportDataRequest.prototype.name = ""; + + /** + * ImportDataRequest inputConfig. + * @member {google.cloud.automl.v1.IInputConfig|null|undefined} inputConfig + * @memberof google.cloud.automl.v1.ImportDataRequest + * @instance + */ + ImportDataRequest.prototype.inputConfig = null; + + /** + * Creates a new ImportDataRequest instance using the specified properties. + * @function create + * @memberof google.cloud.automl.v1.ImportDataRequest + * @static + * @param {google.cloud.automl.v1.IImportDataRequest=} [properties] Properties to set + * @returns {google.cloud.automl.v1.ImportDataRequest} ImportDataRequest instance + */ + ImportDataRequest.create = function create(properties) { + return new ImportDataRequest(properties); + }; + + /** + * Encodes the specified ImportDataRequest message. Does not implicitly {@link google.cloud.automl.v1.ImportDataRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.automl.v1.ImportDataRequest + * @static + * @param {google.cloud.automl.v1.IImportDataRequest} message ImportDataRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ImportDataRequest.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.inputConfig != null && Object.hasOwnProperty.call(message, "inputConfig")) + $root.google.cloud.automl.v1.InputConfig.encode(message.inputConfig, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified ImportDataRequest message, length delimited. Does not implicitly {@link google.cloud.automl.v1.ImportDataRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.automl.v1.ImportDataRequest + * @static + * @param {google.cloud.automl.v1.IImportDataRequest} message ImportDataRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ImportDataRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an ImportDataRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.automl.v1.ImportDataRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.automl.v1.ImportDataRequest} ImportDataRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ImportDataRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.automl.v1.ImportDataRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 3: { + message.inputConfig = $root.google.cloud.automl.v1.InputConfig.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an ImportDataRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.automl.v1.ImportDataRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.automl.v1.ImportDataRequest} ImportDataRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ImportDataRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an ImportDataRequest message. + * @function verify + * @memberof google.cloud.automl.v1.ImportDataRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ImportDataRequest.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.inputConfig != null && message.hasOwnProperty("inputConfig")) { + var error = $root.google.cloud.automl.v1.InputConfig.verify(message.inputConfig); + if (error) + return "inputConfig." + error; + } + return null; + }; + + /** + * Creates an ImportDataRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.automl.v1.ImportDataRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.automl.v1.ImportDataRequest} ImportDataRequest + */ + ImportDataRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.automl.v1.ImportDataRequest) + return object; + var message = new $root.google.cloud.automl.v1.ImportDataRequest(); + if (object.name != null) + message.name = String(object.name); + if (object.inputConfig != null) { + if (typeof object.inputConfig !== "object") + throw TypeError(".google.cloud.automl.v1.ImportDataRequest.inputConfig: object expected"); + message.inputConfig = $root.google.cloud.automl.v1.InputConfig.fromObject(object.inputConfig); + } + return message; + }; + + /** + * Creates a plain object from an ImportDataRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.automl.v1.ImportDataRequest + * @static + * @param {google.cloud.automl.v1.ImportDataRequest} message ImportDataRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ImportDataRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.inputConfig = null; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.inputConfig != null && message.hasOwnProperty("inputConfig")) + object.inputConfig = $root.google.cloud.automl.v1.InputConfig.toObject(message.inputConfig, options); + return object; + }; + + /** + * Converts this ImportDataRequest to JSON. + * @function toJSON + * @memberof google.cloud.automl.v1.ImportDataRequest + * @instance + * @returns {Object.} JSON object + */ + ImportDataRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ImportDataRequest + * @function getTypeUrl + * @memberof google.cloud.automl.v1.ImportDataRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ImportDataRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.automl.v1.ImportDataRequest"; + }; + + return ImportDataRequest; + })(); + + v1.ExportDataRequest = (function() { + + /** + * Properties of an ExportDataRequest. + * @memberof google.cloud.automl.v1 + * @interface IExportDataRequest + * @property {string|null} [name] ExportDataRequest name + * @property {google.cloud.automl.v1.IOutputConfig|null} [outputConfig] ExportDataRequest outputConfig + */ + + /** + * Constructs a new ExportDataRequest. + * @memberof google.cloud.automl.v1 + * @classdesc Represents an ExportDataRequest. + * @implements IExportDataRequest + * @constructor + * @param {google.cloud.automl.v1.IExportDataRequest=} [properties] Properties to set + */ + function ExportDataRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ExportDataRequest name. + * @member {string} name + * @memberof google.cloud.automl.v1.ExportDataRequest + * @instance + */ + ExportDataRequest.prototype.name = ""; + + /** + * ExportDataRequest outputConfig. + * @member {google.cloud.automl.v1.IOutputConfig|null|undefined} outputConfig + * @memberof google.cloud.automl.v1.ExportDataRequest + * @instance + */ + ExportDataRequest.prototype.outputConfig = null; + + /** + * Creates a new ExportDataRequest instance using the specified properties. + * @function create + * @memberof google.cloud.automl.v1.ExportDataRequest + * @static + * @param {google.cloud.automl.v1.IExportDataRequest=} [properties] Properties to set + * @returns {google.cloud.automl.v1.ExportDataRequest} ExportDataRequest instance + */ + ExportDataRequest.create = function create(properties) { + return new ExportDataRequest(properties); + }; + + /** + * Encodes the specified ExportDataRequest message. Does not implicitly {@link google.cloud.automl.v1.ExportDataRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.automl.v1.ExportDataRequest + * @static + * @param {google.cloud.automl.v1.IExportDataRequest} message ExportDataRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ExportDataRequest.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.outputConfig != null && Object.hasOwnProperty.call(message, "outputConfig")) + $root.google.cloud.automl.v1.OutputConfig.encode(message.outputConfig, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified ExportDataRequest message, length delimited. Does not implicitly {@link google.cloud.automl.v1.ExportDataRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.automl.v1.ExportDataRequest + * @static + * @param {google.cloud.automl.v1.IExportDataRequest} message ExportDataRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ExportDataRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an ExportDataRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.automl.v1.ExportDataRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.automl.v1.ExportDataRequest} ExportDataRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ExportDataRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.automl.v1.ExportDataRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 3: { + message.outputConfig = $root.google.cloud.automl.v1.OutputConfig.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an ExportDataRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.automl.v1.ExportDataRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.automl.v1.ExportDataRequest} ExportDataRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ExportDataRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an ExportDataRequest message. + * @function verify + * @memberof google.cloud.automl.v1.ExportDataRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ExportDataRequest.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.outputConfig != null && message.hasOwnProperty("outputConfig")) { + var error = $root.google.cloud.automl.v1.OutputConfig.verify(message.outputConfig); + if (error) + return "outputConfig." + error; + } + return null; + }; + + /** + * Creates an ExportDataRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.automl.v1.ExportDataRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.automl.v1.ExportDataRequest} ExportDataRequest + */ + ExportDataRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.automl.v1.ExportDataRequest) + return object; + var message = new $root.google.cloud.automl.v1.ExportDataRequest(); + if (object.name != null) + message.name = String(object.name); + if (object.outputConfig != null) { + if (typeof object.outputConfig !== "object") + throw TypeError(".google.cloud.automl.v1.ExportDataRequest.outputConfig: object expected"); + message.outputConfig = $root.google.cloud.automl.v1.OutputConfig.fromObject(object.outputConfig); + } + return message; + }; + + /** + * Creates a plain object from an ExportDataRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.automl.v1.ExportDataRequest + * @static + * @param {google.cloud.automl.v1.ExportDataRequest} message ExportDataRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ExportDataRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.outputConfig = null; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.outputConfig != null && message.hasOwnProperty("outputConfig")) + object.outputConfig = $root.google.cloud.automl.v1.OutputConfig.toObject(message.outputConfig, options); + return object; + }; + + /** + * Converts this ExportDataRequest to JSON. + * @function toJSON + * @memberof google.cloud.automl.v1.ExportDataRequest + * @instance + * @returns {Object.} JSON object + */ + ExportDataRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ExportDataRequest + * @function getTypeUrl + * @memberof google.cloud.automl.v1.ExportDataRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ExportDataRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.automl.v1.ExportDataRequest"; + }; + + return ExportDataRequest; + })(); + + v1.GetAnnotationSpecRequest = (function() { + + /** + * Properties of a GetAnnotationSpecRequest. + * @memberof google.cloud.automl.v1 + * @interface IGetAnnotationSpecRequest + * @property {string|null} [name] GetAnnotationSpecRequest name + */ + + /** + * Constructs a new GetAnnotationSpecRequest. + * @memberof google.cloud.automl.v1 + * @classdesc Represents a GetAnnotationSpecRequest. + * @implements IGetAnnotationSpecRequest + * @constructor + * @param {google.cloud.automl.v1.IGetAnnotationSpecRequest=} [properties] Properties to set + */ + function GetAnnotationSpecRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetAnnotationSpecRequest name. + * @member {string} name + * @memberof google.cloud.automl.v1.GetAnnotationSpecRequest + * @instance + */ + GetAnnotationSpecRequest.prototype.name = ""; + + /** + * Creates a new GetAnnotationSpecRequest instance using the specified properties. + * @function create + * @memberof google.cloud.automl.v1.GetAnnotationSpecRequest + * @static + * @param {google.cloud.automl.v1.IGetAnnotationSpecRequest=} [properties] Properties to set + * @returns {google.cloud.automl.v1.GetAnnotationSpecRequest} GetAnnotationSpecRequest instance + */ + GetAnnotationSpecRequest.create = function create(properties) { + return new GetAnnotationSpecRequest(properties); + }; + + /** + * Encodes the specified GetAnnotationSpecRequest message. Does not implicitly {@link google.cloud.automl.v1.GetAnnotationSpecRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.automl.v1.GetAnnotationSpecRequest + * @static + * @param {google.cloud.automl.v1.IGetAnnotationSpecRequest} message GetAnnotationSpecRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetAnnotationSpecRequest.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 GetAnnotationSpecRequest message, length delimited. Does not implicitly {@link google.cloud.automl.v1.GetAnnotationSpecRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.automl.v1.GetAnnotationSpecRequest + * @static + * @param {google.cloud.automl.v1.IGetAnnotationSpecRequest} message GetAnnotationSpecRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetAnnotationSpecRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetAnnotationSpecRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.automl.v1.GetAnnotationSpecRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.automl.v1.GetAnnotationSpecRequest} GetAnnotationSpecRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetAnnotationSpecRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.automl.v1.GetAnnotationSpecRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetAnnotationSpecRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.automl.v1.GetAnnotationSpecRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.automl.v1.GetAnnotationSpecRequest} GetAnnotationSpecRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetAnnotationSpecRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetAnnotationSpecRequest message. + * @function verify + * @memberof google.cloud.automl.v1.GetAnnotationSpecRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetAnnotationSpecRequest.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 GetAnnotationSpecRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.automl.v1.GetAnnotationSpecRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.automl.v1.GetAnnotationSpecRequest} GetAnnotationSpecRequest + */ + GetAnnotationSpecRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.automl.v1.GetAnnotationSpecRequest) + return object; + var message = new $root.google.cloud.automl.v1.GetAnnotationSpecRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a GetAnnotationSpecRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.automl.v1.GetAnnotationSpecRequest + * @static + * @param {google.cloud.automl.v1.GetAnnotationSpecRequest} message GetAnnotationSpecRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetAnnotationSpecRequest.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 GetAnnotationSpecRequest to JSON. + * @function toJSON + * @memberof google.cloud.automl.v1.GetAnnotationSpecRequest + * @instance + * @returns {Object.} JSON object + */ + GetAnnotationSpecRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GetAnnotationSpecRequest + * @function getTypeUrl + * @memberof google.cloud.automl.v1.GetAnnotationSpecRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GetAnnotationSpecRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.automl.v1.GetAnnotationSpecRequest"; + }; + + return GetAnnotationSpecRequest; + })(); + + v1.CreateModelRequest = (function() { + + /** + * Properties of a CreateModelRequest. + * @memberof google.cloud.automl.v1 + * @interface ICreateModelRequest + * @property {string|null} [parent] CreateModelRequest parent + * @property {google.cloud.automl.v1.IModel|null} [model] CreateModelRequest model + */ + + /** + * Constructs a new CreateModelRequest. + * @memberof google.cloud.automl.v1 + * @classdesc Represents a CreateModelRequest. + * @implements ICreateModelRequest + * @constructor + * @param {google.cloud.automl.v1.ICreateModelRequest=} [properties] Properties to set + */ + function CreateModelRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * CreateModelRequest parent. + * @member {string} parent + * @memberof google.cloud.automl.v1.CreateModelRequest + * @instance + */ + CreateModelRequest.prototype.parent = ""; + + /** + * CreateModelRequest model. + * @member {google.cloud.automl.v1.IModel|null|undefined} model + * @memberof google.cloud.automl.v1.CreateModelRequest + * @instance + */ + CreateModelRequest.prototype.model = null; + + /** + * Creates a new CreateModelRequest instance using the specified properties. + * @function create + * @memberof google.cloud.automl.v1.CreateModelRequest + * @static + * @param {google.cloud.automl.v1.ICreateModelRequest=} [properties] Properties to set + * @returns {google.cloud.automl.v1.CreateModelRequest} CreateModelRequest instance + */ + CreateModelRequest.create = function create(properties) { + return new CreateModelRequest(properties); + }; + + /** + * Encodes the specified CreateModelRequest message. Does not implicitly {@link google.cloud.automl.v1.CreateModelRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.automl.v1.CreateModelRequest + * @static + * @param {google.cloud.automl.v1.ICreateModelRequest} message CreateModelRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateModelRequest.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.model != null && Object.hasOwnProperty.call(message, "model")) + $root.google.cloud.automl.v1.Model.encode(message.model, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified CreateModelRequest message, length delimited. Does not implicitly {@link google.cloud.automl.v1.CreateModelRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.automl.v1.CreateModelRequest + * @static + * @param {google.cloud.automl.v1.ICreateModelRequest} message CreateModelRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateModelRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CreateModelRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.automl.v1.CreateModelRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.automl.v1.CreateModelRequest} CreateModelRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateModelRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.automl.v1.CreateModelRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 4: { + message.model = $root.google.cloud.automl.v1.Model.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CreateModelRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.automl.v1.CreateModelRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.automl.v1.CreateModelRequest} CreateModelRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateModelRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CreateModelRequest message. + * @function verify + * @memberof google.cloud.automl.v1.CreateModelRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CreateModelRequest.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.model != null && message.hasOwnProperty("model")) { + var error = $root.google.cloud.automl.v1.Model.verify(message.model); + if (error) + return "model." + error; + } + return null; + }; + + /** + * Creates a CreateModelRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.automl.v1.CreateModelRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.automl.v1.CreateModelRequest} CreateModelRequest + */ + CreateModelRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.automl.v1.CreateModelRequest) + return object; + var message = new $root.google.cloud.automl.v1.CreateModelRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.model != null) { + if (typeof object.model !== "object") + throw TypeError(".google.cloud.automl.v1.CreateModelRequest.model: object expected"); + message.model = $root.google.cloud.automl.v1.Model.fromObject(object.model); + } + return message; + }; + + /** + * Creates a plain object from a CreateModelRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.automl.v1.CreateModelRequest + * @static + * @param {google.cloud.automl.v1.CreateModelRequest} message CreateModelRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CreateModelRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.model = null; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.model != null && message.hasOwnProperty("model")) + object.model = $root.google.cloud.automl.v1.Model.toObject(message.model, options); + return object; + }; + + /** + * Converts this CreateModelRequest to JSON. + * @function toJSON + * @memberof google.cloud.automl.v1.CreateModelRequest + * @instance + * @returns {Object.} JSON object + */ + CreateModelRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CreateModelRequest + * @function getTypeUrl + * @memberof google.cloud.automl.v1.CreateModelRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CreateModelRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.automl.v1.CreateModelRequest"; + }; + + return CreateModelRequest; + })(); + + v1.GetModelRequest = (function() { + + /** + * Properties of a GetModelRequest. + * @memberof google.cloud.automl.v1 + * @interface IGetModelRequest + * @property {string|null} [name] GetModelRequest name + */ + + /** + * Constructs a new GetModelRequest. + * @memberof google.cloud.automl.v1 + * @classdesc Represents a GetModelRequest. + * @implements IGetModelRequest + * @constructor + * @param {google.cloud.automl.v1.IGetModelRequest=} [properties] Properties to set + */ + function GetModelRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetModelRequest name. + * @member {string} name + * @memberof google.cloud.automl.v1.GetModelRequest + * @instance + */ + GetModelRequest.prototype.name = ""; + + /** + * Creates a new GetModelRequest instance using the specified properties. + * @function create + * @memberof google.cloud.automl.v1.GetModelRequest + * @static + * @param {google.cloud.automl.v1.IGetModelRequest=} [properties] Properties to set + * @returns {google.cloud.automl.v1.GetModelRequest} GetModelRequest instance + */ + GetModelRequest.create = function create(properties) { + return new GetModelRequest(properties); + }; + + /** + * Encodes the specified GetModelRequest message. Does not implicitly {@link google.cloud.automl.v1.GetModelRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.automl.v1.GetModelRequest + * @static + * @param {google.cloud.automl.v1.IGetModelRequest} message GetModelRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetModelRequest.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 GetModelRequest message, length delimited. Does not implicitly {@link google.cloud.automl.v1.GetModelRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.automl.v1.GetModelRequest + * @static + * @param {google.cloud.automl.v1.IGetModelRequest} message GetModelRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetModelRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetModelRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.automl.v1.GetModelRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.automl.v1.GetModelRequest} GetModelRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetModelRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.automl.v1.GetModelRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetModelRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.automl.v1.GetModelRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.automl.v1.GetModelRequest} GetModelRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetModelRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetModelRequest message. + * @function verify + * @memberof google.cloud.automl.v1.GetModelRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetModelRequest.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 GetModelRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.automl.v1.GetModelRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.automl.v1.GetModelRequest} GetModelRequest + */ + GetModelRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.automl.v1.GetModelRequest) + return object; + var message = new $root.google.cloud.automl.v1.GetModelRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a GetModelRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.automl.v1.GetModelRequest + * @static + * @param {google.cloud.automl.v1.GetModelRequest} message GetModelRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetModelRequest.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 GetModelRequest to JSON. + * @function toJSON + * @memberof google.cloud.automl.v1.GetModelRequest + * @instance + * @returns {Object.} JSON object + */ + GetModelRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GetModelRequest + * @function getTypeUrl + * @memberof google.cloud.automl.v1.GetModelRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GetModelRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.automl.v1.GetModelRequest"; + }; + + return GetModelRequest; + })(); + + v1.ListModelsRequest = (function() { + + /** + * Properties of a ListModelsRequest. + * @memberof google.cloud.automl.v1 + * @interface IListModelsRequest + * @property {string|null} [parent] ListModelsRequest parent + * @property {string|null} [filter] ListModelsRequest filter + * @property {number|null} [pageSize] ListModelsRequest pageSize + * @property {string|null} [pageToken] ListModelsRequest pageToken + */ + + /** + * Constructs a new ListModelsRequest. + * @memberof google.cloud.automl.v1 + * @classdesc Represents a ListModelsRequest. + * @implements IListModelsRequest + * @constructor + * @param {google.cloud.automl.v1.IListModelsRequest=} [properties] Properties to set + */ + function ListModelsRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListModelsRequest parent. + * @member {string} parent + * @memberof google.cloud.automl.v1.ListModelsRequest + * @instance + */ + ListModelsRequest.prototype.parent = ""; + + /** + * ListModelsRequest filter. + * @member {string} filter + * @memberof google.cloud.automl.v1.ListModelsRequest + * @instance + */ + ListModelsRequest.prototype.filter = ""; + + /** + * ListModelsRequest pageSize. + * @member {number} pageSize + * @memberof google.cloud.automl.v1.ListModelsRequest + * @instance + */ + ListModelsRequest.prototype.pageSize = 0; + + /** + * ListModelsRequest pageToken. + * @member {string} pageToken + * @memberof google.cloud.automl.v1.ListModelsRequest + * @instance + */ + ListModelsRequest.prototype.pageToken = ""; + + /** + * Creates a new ListModelsRequest instance using the specified properties. + * @function create + * @memberof google.cloud.automl.v1.ListModelsRequest + * @static + * @param {google.cloud.automl.v1.IListModelsRequest=} [properties] Properties to set + * @returns {google.cloud.automl.v1.ListModelsRequest} ListModelsRequest instance + */ + ListModelsRequest.create = function create(properties) { + return new ListModelsRequest(properties); + }; + + /** + * Encodes the specified ListModelsRequest message. Does not implicitly {@link google.cloud.automl.v1.ListModelsRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.automl.v1.ListModelsRequest + * @static + * @param {google.cloud.automl.v1.IListModelsRequest} message ListModelsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListModelsRequest.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.filter != null && Object.hasOwnProperty.call(message, "filter")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.filter); + if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.pageSize); + if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.pageToken); + return writer; + }; + + /** + * Encodes the specified ListModelsRequest message, length delimited. Does not implicitly {@link google.cloud.automl.v1.ListModelsRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.automl.v1.ListModelsRequest + * @static + * @param {google.cloud.automl.v1.IListModelsRequest} message ListModelsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListModelsRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListModelsRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.automl.v1.ListModelsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.automl.v1.ListModelsRequest} ListModelsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListModelsRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.automl.v1.ListModelsRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 3: { + message.filter = reader.string(); + break; + } + case 4: { + message.pageSize = reader.int32(); + break; + } + case 6: { + message.pageToken = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListModelsRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.automl.v1.ListModelsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.automl.v1.ListModelsRequest} ListModelsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListModelsRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListModelsRequest message. + * @function verify + * @memberof google.cloud.automl.v1.ListModelsRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListModelsRequest.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.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 ListModelsRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.automl.v1.ListModelsRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.automl.v1.ListModelsRequest} ListModelsRequest + */ + ListModelsRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.automl.v1.ListModelsRequest) + return object; + var message = new $root.google.cloud.automl.v1.ListModelsRequest(); + if (object.parent != null) + message.parent = String(object.parent); + 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 ListModelsRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.automl.v1.ListModelsRequest + * @static + * @param {google.cloud.automl.v1.ListModelsRequest} message ListModelsRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListModelsRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.filter = ""; + object.pageSize = 0; + object.pageToken = ""; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + 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; + return object; + }; + + /** + * Converts this ListModelsRequest to JSON. + * @function toJSON + * @memberof google.cloud.automl.v1.ListModelsRequest + * @instance + * @returns {Object.} JSON object + */ + ListModelsRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListModelsRequest + * @function getTypeUrl + * @memberof google.cloud.automl.v1.ListModelsRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListModelsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.automl.v1.ListModelsRequest"; + }; + + return ListModelsRequest; + })(); + + v1.ListModelsResponse = (function() { + + /** + * Properties of a ListModelsResponse. + * @memberof google.cloud.automl.v1 + * @interface IListModelsResponse + * @property {Array.|null} [model] ListModelsResponse model + * @property {string|null} [nextPageToken] ListModelsResponse nextPageToken + */ + + /** + * Constructs a new ListModelsResponse. + * @memberof google.cloud.automl.v1 + * @classdesc Represents a ListModelsResponse. + * @implements IListModelsResponse + * @constructor + * @param {google.cloud.automl.v1.IListModelsResponse=} [properties] Properties to set + */ + function ListModelsResponse(properties) { + this.model = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListModelsResponse model. + * @member {Array.} model + * @memberof google.cloud.automl.v1.ListModelsResponse + * @instance + */ + ListModelsResponse.prototype.model = $util.emptyArray; + + /** + * ListModelsResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.cloud.automl.v1.ListModelsResponse + * @instance + */ + ListModelsResponse.prototype.nextPageToken = ""; + + /** + * Creates a new ListModelsResponse instance using the specified properties. + * @function create + * @memberof google.cloud.automl.v1.ListModelsResponse + * @static + * @param {google.cloud.automl.v1.IListModelsResponse=} [properties] Properties to set + * @returns {google.cloud.automl.v1.ListModelsResponse} ListModelsResponse instance + */ + ListModelsResponse.create = function create(properties) { + return new ListModelsResponse(properties); + }; + + /** + * Encodes the specified ListModelsResponse message. Does not implicitly {@link google.cloud.automl.v1.ListModelsResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.automl.v1.ListModelsResponse + * @static + * @param {google.cloud.automl.v1.IListModelsResponse} message ListModelsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListModelsResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.model != null && message.model.length) + for (var i = 0; i < message.model.length; ++i) + $root.google.cloud.automl.v1.Model.encode(message.model[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 ListModelsResponse message, length delimited. Does not implicitly {@link google.cloud.automl.v1.ListModelsResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.automl.v1.ListModelsResponse + * @static + * @param {google.cloud.automl.v1.IListModelsResponse} message ListModelsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListModelsResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListModelsResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.automl.v1.ListModelsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.automl.v1.ListModelsResponse} ListModelsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListModelsResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.automl.v1.ListModelsResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.model && message.model.length)) + message.model = []; + message.model.push($root.google.cloud.automl.v1.Model.decode(reader, reader.uint32())); + break; + } + case 2: { + message.nextPageToken = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListModelsResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.automl.v1.ListModelsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.automl.v1.ListModelsResponse} ListModelsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListModelsResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListModelsResponse message. + * @function verify + * @memberof google.cloud.automl.v1.ListModelsResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListModelsResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.model != null && message.hasOwnProperty("model")) { + if (!Array.isArray(message.model)) + return "model: array expected"; + for (var i = 0; i < message.model.length; ++i) { + var error = $root.google.cloud.automl.v1.Model.verify(message.model[i]); + if (error) + return "model." + error; + } + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + return null; + }; + + /** + * Creates a ListModelsResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.automl.v1.ListModelsResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.automl.v1.ListModelsResponse} ListModelsResponse + */ + ListModelsResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.automl.v1.ListModelsResponse) + return object; + var message = new $root.google.cloud.automl.v1.ListModelsResponse(); + if (object.model) { + if (!Array.isArray(object.model)) + throw TypeError(".google.cloud.automl.v1.ListModelsResponse.model: array expected"); + message.model = []; + for (var i = 0; i < object.model.length; ++i) { + if (typeof object.model[i] !== "object") + throw TypeError(".google.cloud.automl.v1.ListModelsResponse.model: object expected"); + message.model[i] = $root.google.cloud.automl.v1.Model.fromObject(object.model[i]); + } + } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + return message; + }; + + /** + * Creates a plain object from a ListModelsResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.automl.v1.ListModelsResponse + * @static + * @param {google.cloud.automl.v1.ListModelsResponse} message ListModelsResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListModelsResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.model = []; + if (options.defaults) + object.nextPageToken = ""; + if (message.model && message.model.length) { + object.model = []; + for (var j = 0; j < message.model.length; ++j) + object.model[j] = $root.google.cloud.automl.v1.Model.toObject(message.model[j], options); + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + object.nextPageToken = message.nextPageToken; + return object; + }; + + /** + * Converts this ListModelsResponse to JSON. + * @function toJSON + * @memberof google.cloud.automl.v1.ListModelsResponse + * @instance + * @returns {Object.} JSON object + */ + ListModelsResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListModelsResponse + * @function getTypeUrl + * @memberof google.cloud.automl.v1.ListModelsResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListModelsResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.automl.v1.ListModelsResponse"; + }; + + return ListModelsResponse; + })(); + + v1.DeleteModelRequest = (function() { + + /** + * Properties of a DeleteModelRequest. + * @memberof google.cloud.automl.v1 + * @interface IDeleteModelRequest + * @property {string|null} [name] DeleteModelRequest name + */ + + /** + * Constructs a new DeleteModelRequest. + * @memberof google.cloud.automl.v1 + * @classdesc Represents a DeleteModelRequest. + * @implements IDeleteModelRequest + * @constructor + * @param {google.cloud.automl.v1.IDeleteModelRequest=} [properties] Properties to set + */ + function DeleteModelRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * DeleteModelRequest name. + * @member {string} name + * @memberof google.cloud.automl.v1.DeleteModelRequest + * @instance + */ + DeleteModelRequest.prototype.name = ""; + + /** + * Creates a new DeleteModelRequest instance using the specified properties. + * @function create + * @memberof google.cloud.automl.v1.DeleteModelRequest + * @static + * @param {google.cloud.automl.v1.IDeleteModelRequest=} [properties] Properties to set + * @returns {google.cloud.automl.v1.DeleteModelRequest} DeleteModelRequest instance + */ + DeleteModelRequest.create = function create(properties) { + return new DeleteModelRequest(properties); + }; + + /** + * Encodes the specified DeleteModelRequest message. Does not implicitly {@link google.cloud.automl.v1.DeleteModelRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.automl.v1.DeleteModelRequest + * @static + * @param {google.cloud.automl.v1.IDeleteModelRequest} message DeleteModelRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteModelRequest.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 DeleteModelRequest message, length delimited. Does not implicitly {@link google.cloud.automl.v1.DeleteModelRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.automl.v1.DeleteModelRequest + * @static + * @param {google.cloud.automl.v1.IDeleteModelRequest} message DeleteModelRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteModelRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DeleteModelRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.automl.v1.DeleteModelRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.automl.v1.DeleteModelRequest} DeleteModelRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteModelRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.automl.v1.DeleteModelRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DeleteModelRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.automl.v1.DeleteModelRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.automl.v1.DeleteModelRequest} DeleteModelRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteModelRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DeleteModelRequest message. + * @function verify + * @memberof google.cloud.automl.v1.DeleteModelRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DeleteModelRequest.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 DeleteModelRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.automl.v1.DeleteModelRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.automl.v1.DeleteModelRequest} DeleteModelRequest + */ + DeleteModelRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.automl.v1.DeleteModelRequest) + return object; + var message = new $root.google.cloud.automl.v1.DeleteModelRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a DeleteModelRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.automl.v1.DeleteModelRequest + * @static + * @param {google.cloud.automl.v1.DeleteModelRequest} message DeleteModelRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DeleteModelRequest.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 DeleteModelRequest to JSON. + * @function toJSON + * @memberof google.cloud.automl.v1.DeleteModelRequest + * @instance + * @returns {Object.} JSON object + */ + DeleteModelRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DeleteModelRequest + * @function getTypeUrl + * @memberof google.cloud.automl.v1.DeleteModelRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DeleteModelRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.automl.v1.DeleteModelRequest"; + }; + + return DeleteModelRequest; + })(); + + v1.UpdateModelRequest = (function() { + + /** + * Properties of an UpdateModelRequest. + * @memberof google.cloud.automl.v1 + * @interface IUpdateModelRequest + * @property {google.cloud.automl.v1.IModel|null} [model] UpdateModelRequest model + * @property {google.protobuf.IFieldMask|null} [updateMask] UpdateModelRequest updateMask + */ + + /** + * Constructs a new UpdateModelRequest. + * @memberof google.cloud.automl.v1 + * @classdesc Represents an UpdateModelRequest. + * @implements IUpdateModelRequest + * @constructor + * @param {google.cloud.automl.v1.IUpdateModelRequest=} [properties] Properties to set + */ + function UpdateModelRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * UpdateModelRequest model. + * @member {google.cloud.automl.v1.IModel|null|undefined} model + * @memberof google.cloud.automl.v1.UpdateModelRequest + * @instance + */ + UpdateModelRequest.prototype.model = null; + + /** + * UpdateModelRequest updateMask. + * @member {google.protobuf.IFieldMask|null|undefined} updateMask + * @memberof google.cloud.automl.v1.UpdateModelRequest + * @instance + */ + UpdateModelRequest.prototype.updateMask = null; + + /** + * Creates a new UpdateModelRequest instance using the specified properties. + * @function create + * @memberof google.cloud.automl.v1.UpdateModelRequest + * @static + * @param {google.cloud.automl.v1.IUpdateModelRequest=} [properties] Properties to set + * @returns {google.cloud.automl.v1.UpdateModelRequest} UpdateModelRequest instance + */ + UpdateModelRequest.create = function create(properties) { + return new UpdateModelRequest(properties); + }; + + /** + * Encodes the specified UpdateModelRequest message. Does not implicitly {@link google.cloud.automl.v1.UpdateModelRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.automl.v1.UpdateModelRequest + * @static + * @param {google.cloud.automl.v1.IUpdateModelRequest} message UpdateModelRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateModelRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.model != null && Object.hasOwnProperty.call(message, "model")) + $root.google.cloud.automl.v1.Model.encode(message.model, 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 UpdateModelRequest message, length delimited. Does not implicitly {@link google.cloud.automl.v1.UpdateModelRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.automl.v1.UpdateModelRequest + * @static + * @param {google.cloud.automl.v1.IUpdateModelRequest} message UpdateModelRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateModelRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an UpdateModelRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.automl.v1.UpdateModelRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.automl.v1.UpdateModelRequest} UpdateModelRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateModelRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.automl.v1.UpdateModelRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.model = $root.google.cloud.automl.v1.Model.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 UpdateModelRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.automl.v1.UpdateModelRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.automl.v1.UpdateModelRequest} UpdateModelRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateModelRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an UpdateModelRequest message. + * @function verify + * @memberof google.cloud.automl.v1.UpdateModelRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + UpdateModelRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.model != null && message.hasOwnProperty("model")) { + var error = $root.google.cloud.automl.v1.Model.verify(message.model); + if (error) + return "model." + 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 UpdateModelRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.automl.v1.UpdateModelRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.automl.v1.UpdateModelRequest} UpdateModelRequest + */ + UpdateModelRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.automl.v1.UpdateModelRequest) + return object; + var message = new $root.google.cloud.automl.v1.UpdateModelRequest(); + if (object.model != null) { + if (typeof object.model !== "object") + throw TypeError(".google.cloud.automl.v1.UpdateModelRequest.model: object expected"); + message.model = $root.google.cloud.automl.v1.Model.fromObject(object.model); + } + if (object.updateMask != null) { + if (typeof object.updateMask !== "object") + throw TypeError(".google.cloud.automl.v1.UpdateModelRequest.updateMask: object expected"); + message.updateMask = $root.google.protobuf.FieldMask.fromObject(object.updateMask); + } + return message; + }; + + /** + * Creates a plain object from an UpdateModelRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.automl.v1.UpdateModelRequest + * @static + * @param {google.cloud.automl.v1.UpdateModelRequest} message UpdateModelRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + UpdateModelRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.model = null; + object.updateMask = null; + } + if (message.model != null && message.hasOwnProperty("model")) + object.model = $root.google.cloud.automl.v1.Model.toObject(message.model, options); + if (message.updateMask != null && message.hasOwnProperty("updateMask")) + object.updateMask = $root.google.protobuf.FieldMask.toObject(message.updateMask, options); + return object; + }; + + /** + * Converts this UpdateModelRequest to JSON. + * @function toJSON + * @memberof google.cloud.automl.v1.UpdateModelRequest + * @instance + * @returns {Object.} JSON object + */ + UpdateModelRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for UpdateModelRequest + * @function getTypeUrl + * @memberof google.cloud.automl.v1.UpdateModelRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + UpdateModelRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.automl.v1.UpdateModelRequest"; + }; + + return UpdateModelRequest; + })(); + + v1.DeployModelRequest = (function() { + + /** + * Properties of a DeployModelRequest. + * @memberof google.cloud.automl.v1 + * @interface IDeployModelRequest + * @property {google.cloud.automl.v1.IImageObjectDetectionModelDeploymentMetadata|null} [imageObjectDetectionModelDeploymentMetadata] DeployModelRequest imageObjectDetectionModelDeploymentMetadata + * @property {google.cloud.automl.v1.IImageClassificationModelDeploymentMetadata|null} [imageClassificationModelDeploymentMetadata] DeployModelRequest imageClassificationModelDeploymentMetadata + * @property {string|null} [name] DeployModelRequest name + */ + + /** + * Constructs a new DeployModelRequest. + * @memberof google.cloud.automl.v1 + * @classdesc Represents a DeployModelRequest. + * @implements IDeployModelRequest + * @constructor + * @param {google.cloud.automl.v1.IDeployModelRequest=} [properties] Properties to set + */ + function DeployModelRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * DeployModelRequest imageObjectDetectionModelDeploymentMetadata. + * @member {google.cloud.automl.v1.IImageObjectDetectionModelDeploymentMetadata|null|undefined} imageObjectDetectionModelDeploymentMetadata + * @memberof google.cloud.automl.v1.DeployModelRequest + * @instance + */ + DeployModelRequest.prototype.imageObjectDetectionModelDeploymentMetadata = null; + + /** + * DeployModelRequest imageClassificationModelDeploymentMetadata. + * @member {google.cloud.automl.v1.IImageClassificationModelDeploymentMetadata|null|undefined} imageClassificationModelDeploymentMetadata + * @memberof google.cloud.automl.v1.DeployModelRequest + * @instance + */ + DeployModelRequest.prototype.imageClassificationModelDeploymentMetadata = null; + + /** + * DeployModelRequest name. + * @member {string} name + * @memberof google.cloud.automl.v1.DeployModelRequest + * @instance + */ + DeployModelRequest.prototype.name = ""; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * DeployModelRequest modelDeploymentMetadata. + * @member {"imageObjectDetectionModelDeploymentMetadata"|"imageClassificationModelDeploymentMetadata"|undefined} modelDeploymentMetadata + * @memberof google.cloud.automl.v1.DeployModelRequest + * @instance + */ + Object.defineProperty(DeployModelRequest.prototype, "modelDeploymentMetadata", { + get: $util.oneOfGetter($oneOfFields = ["imageObjectDetectionModelDeploymentMetadata", "imageClassificationModelDeploymentMetadata"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new DeployModelRequest instance using the specified properties. + * @function create + * @memberof google.cloud.automl.v1.DeployModelRequest + * @static + * @param {google.cloud.automl.v1.IDeployModelRequest=} [properties] Properties to set + * @returns {google.cloud.automl.v1.DeployModelRequest} DeployModelRequest instance + */ + DeployModelRequest.create = function create(properties) { + return new DeployModelRequest(properties); + }; + + /** + * Encodes the specified DeployModelRequest message. Does not implicitly {@link google.cloud.automl.v1.DeployModelRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.automl.v1.DeployModelRequest + * @static + * @param {google.cloud.automl.v1.IDeployModelRequest} message DeployModelRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeployModelRequest.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.imageObjectDetectionModelDeploymentMetadata != null && Object.hasOwnProperty.call(message, "imageObjectDetectionModelDeploymentMetadata")) + $root.google.cloud.automl.v1.ImageObjectDetectionModelDeploymentMetadata.encode(message.imageObjectDetectionModelDeploymentMetadata, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.imageClassificationModelDeploymentMetadata != null && Object.hasOwnProperty.call(message, "imageClassificationModelDeploymentMetadata")) + $root.google.cloud.automl.v1.ImageClassificationModelDeploymentMetadata.encode(message.imageClassificationModelDeploymentMetadata, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified DeployModelRequest message, length delimited. Does not implicitly {@link google.cloud.automl.v1.DeployModelRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.automl.v1.DeployModelRequest + * @static + * @param {google.cloud.automl.v1.IDeployModelRequest} message DeployModelRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeployModelRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DeployModelRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.automl.v1.DeployModelRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.automl.v1.DeployModelRequest} DeployModelRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeployModelRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.automl.v1.DeployModelRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 2: { + message.imageObjectDetectionModelDeploymentMetadata = $root.google.cloud.automl.v1.ImageObjectDetectionModelDeploymentMetadata.decode(reader, reader.uint32()); + break; + } + case 4: { + message.imageClassificationModelDeploymentMetadata = $root.google.cloud.automl.v1.ImageClassificationModelDeploymentMetadata.decode(reader, reader.uint32()); + break; + } + case 1: { + message.name = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DeployModelRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.automl.v1.DeployModelRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.automl.v1.DeployModelRequest} DeployModelRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeployModelRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DeployModelRequest message. + * @function verify + * @memberof google.cloud.automl.v1.DeployModelRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DeployModelRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.imageObjectDetectionModelDeploymentMetadata != null && message.hasOwnProperty("imageObjectDetectionModelDeploymentMetadata")) { + properties.modelDeploymentMetadata = 1; + { + var error = $root.google.cloud.automl.v1.ImageObjectDetectionModelDeploymentMetadata.verify(message.imageObjectDetectionModelDeploymentMetadata); + if (error) + return "imageObjectDetectionModelDeploymentMetadata." + error; + } + } + if (message.imageClassificationModelDeploymentMetadata != null && message.hasOwnProperty("imageClassificationModelDeploymentMetadata")) { + if (properties.modelDeploymentMetadata === 1) + return "modelDeploymentMetadata: multiple values"; + properties.modelDeploymentMetadata = 1; + { + var error = $root.google.cloud.automl.v1.ImageClassificationModelDeploymentMetadata.verify(message.imageClassificationModelDeploymentMetadata); + if (error) + return "imageClassificationModelDeploymentMetadata." + error; + } + } + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + return null; + }; + + /** + * Creates a DeployModelRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.automl.v1.DeployModelRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.automl.v1.DeployModelRequest} DeployModelRequest + */ + DeployModelRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.automl.v1.DeployModelRequest) + return object; + var message = new $root.google.cloud.automl.v1.DeployModelRequest(); + if (object.imageObjectDetectionModelDeploymentMetadata != null) { + if (typeof object.imageObjectDetectionModelDeploymentMetadata !== "object") + throw TypeError(".google.cloud.automl.v1.DeployModelRequest.imageObjectDetectionModelDeploymentMetadata: object expected"); + message.imageObjectDetectionModelDeploymentMetadata = $root.google.cloud.automl.v1.ImageObjectDetectionModelDeploymentMetadata.fromObject(object.imageObjectDetectionModelDeploymentMetadata); + } + if (object.imageClassificationModelDeploymentMetadata != null) { + if (typeof object.imageClassificationModelDeploymentMetadata !== "object") + throw TypeError(".google.cloud.automl.v1.DeployModelRequest.imageClassificationModelDeploymentMetadata: object expected"); + message.imageClassificationModelDeploymentMetadata = $root.google.cloud.automl.v1.ImageClassificationModelDeploymentMetadata.fromObject(object.imageClassificationModelDeploymentMetadata); + } + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a DeployModelRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.automl.v1.DeployModelRequest + * @static + * @param {google.cloud.automl.v1.DeployModelRequest} message DeployModelRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DeployModelRequest.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; + if (message.imageObjectDetectionModelDeploymentMetadata != null && message.hasOwnProperty("imageObjectDetectionModelDeploymentMetadata")) { + object.imageObjectDetectionModelDeploymentMetadata = $root.google.cloud.automl.v1.ImageObjectDetectionModelDeploymentMetadata.toObject(message.imageObjectDetectionModelDeploymentMetadata, options); + if (options.oneofs) + object.modelDeploymentMetadata = "imageObjectDetectionModelDeploymentMetadata"; + } + if (message.imageClassificationModelDeploymentMetadata != null && message.hasOwnProperty("imageClassificationModelDeploymentMetadata")) { + object.imageClassificationModelDeploymentMetadata = $root.google.cloud.automl.v1.ImageClassificationModelDeploymentMetadata.toObject(message.imageClassificationModelDeploymentMetadata, options); + if (options.oneofs) + object.modelDeploymentMetadata = "imageClassificationModelDeploymentMetadata"; + } + return object; + }; + + /** + * Converts this DeployModelRequest to JSON. + * @function toJSON + * @memberof google.cloud.automl.v1.DeployModelRequest + * @instance + * @returns {Object.} JSON object + */ + DeployModelRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DeployModelRequest + * @function getTypeUrl + * @memberof google.cloud.automl.v1.DeployModelRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DeployModelRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.automl.v1.DeployModelRequest"; + }; + + return DeployModelRequest; + })(); + + v1.UndeployModelRequest = (function() { + + /** + * Properties of an UndeployModelRequest. + * @memberof google.cloud.automl.v1 + * @interface IUndeployModelRequest + * @property {string|null} [name] UndeployModelRequest name + */ + + /** + * Constructs a new UndeployModelRequest. + * @memberof google.cloud.automl.v1 + * @classdesc Represents an UndeployModelRequest. + * @implements IUndeployModelRequest + * @constructor + * @param {google.cloud.automl.v1.IUndeployModelRequest=} [properties] Properties to set + */ + function UndeployModelRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * UndeployModelRequest name. + * @member {string} name + * @memberof google.cloud.automl.v1.UndeployModelRequest + * @instance + */ + UndeployModelRequest.prototype.name = ""; + + /** + * Creates a new UndeployModelRequest instance using the specified properties. + * @function create + * @memberof google.cloud.automl.v1.UndeployModelRequest + * @static + * @param {google.cloud.automl.v1.IUndeployModelRequest=} [properties] Properties to set + * @returns {google.cloud.automl.v1.UndeployModelRequest} UndeployModelRequest instance + */ + UndeployModelRequest.create = function create(properties) { + return new UndeployModelRequest(properties); + }; + + /** + * Encodes the specified UndeployModelRequest message. Does not implicitly {@link google.cloud.automl.v1.UndeployModelRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.automl.v1.UndeployModelRequest + * @static + * @param {google.cloud.automl.v1.IUndeployModelRequest} message UndeployModelRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UndeployModelRequest.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 UndeployModelRequest message, length delimited. Does not implicitly {@link google.cloud.automl.v1.UndeployModelRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.automl.v1.UndeployModelRequest + * @static + * @param {google.cloud.automl.v1.IUndeployModelRequest} message UndeployModelRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UndeployModelRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an UndeployModelRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.automl.v1.UndeployModelRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.automl.v1.UndeployModelRequest} UndeployModelRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UndeployModelRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.automl.v1.UndeployModelRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an UndeployModelRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.automl.v1.UndeployModelRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.automl.v1.UndeployModelRequest} UndeployModelRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UndeployModelRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an UndeployModelRequest message. + * @function verify + * @memberof google.cloud.automl.v1.UndeployModelRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + UndeployModelRequest.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 an UndeployModelRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.automl.v1.UndeployModelRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.automl.v1.UndeployModelRequest} UndeployModelRequest + */ + UndeployModelRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.automl.v1.UndeployModelRequest) + return object; + var message = new $root.google.cloud.automl.v1.UndeployModelRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from an UndeployModelRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.automl.v1.UndeployModelRequest + * @static + * @param {google.cloud.automl.v1.UndeployModelRequest} message UndeployModelRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + UndeployModelRequest.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 UndeployModelRequest to JSON. + * @function toJSON + * @memberof google.cloud.automl.v1.UndeployModelRequest + * @instance + * @returns {Object.} JSON object + */ + UndeployModelRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for UndeployModelRequest + * @function getTypeUrl + * @memberof google.cloud.automl.v1.UndeployModelRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + UndeployModelRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.automl.v1.UndeployModelRequest"; + }; + + return UndeployModelRequest; + })(); + + v1.ExportModelRequest = (function() { + + /** + * Properties of an ExportModelRequest. + * @memberof google.cloud.automl.v1 + * @interface IExportModelRequest + * @property {string|null} [name] ExportModelRequest name + * @property {google.cloud.automl.v1.IModelExportOutputConfig|null} [outputConfig] ExportModelRequest outputConfig + */ + + /** + * Constructs a new ExportModelRequest. + * @memberof google.cloud.automl.v1 + * @classdesc Represents an ExportModelRequest. + * @implements IExportModelRequest + * @constructor + * @param {google.cloud.automl.v1.IExportModelRequest=} [properties] Properties to set + */ + function ExportModelRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ExportModelRequest name. + * @member {string} name + * @memberof google.cloud.automl.v1.ExportModelRequest + * @instance + */ + ExportModelRequest.prototype.name = ""; + + /** + * ExportModelRequest outputConfig. + * @member {google.cloud.automl.v1.IModelExportOutputConfig|null|undefined} outputConfig + * @memberof google.cloud.automl.v1.ExportModelRequest + * @instance + */ + ExportModelRequest.prototype.outputConfig = null; + + /** + * Creates a new ExportModelRequest instance using the specified properties. + * @function create + * @memberof google.cloud.automl.v1.ExportModelRequest + * @static + * @param {google.cloud.automl.v1.IExportModelRequest=} [properties] Properties to set + * @returns {google.cloud.automl.v1.ExportModelRequest} ExportModelRequest instance + */ + ExportModelRequest.create = function create(properties) { + return new ExportModelRequest(properties); + }; + + /** + * Encodes the specified ExportModelRequest message. Does not implicitly {@link google.cloud.automl.v1.ExportModelRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.automl.v1.ExportModelRequest + * @static + * @param {google.cloud.automl.v1.IExportModelRequest} message ExportModelRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ExportModelRequest.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.outputConfig != null && Object.hasOwnProperty.call(message, "outputConfig")) + $root.google.cloud.automl.v1.ModelExportOutputConfig.encode(message.outputConfig, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified ExportModelRequest message, length delimited. Does not implicitly {@link google.cloud.automl.v1.ExportModelRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.automl.v1.ExportModelRequest + * @static + * @param {google.cloud.automl.v1.IExportModelRequest} message ExportModelRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ExportModelRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an ExportModelRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.automl.v1.ExportModelRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.automl.v1.ExportModelRequest} ExportModelRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ExportModelRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.automl.v1.ExportModelRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 3: { + message.outputConfig = $root.google.cloud.automl.v1.ModelExportOutputConfig.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an ExportModelRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.automl.v1.ExportModelRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.automl.v1.ExportModelRequest} ExportModelRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ExportModelRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an ExportModelRequest message. + * @function verify + * @memberof google.cloud.automl.v1.ExportModelRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ExportModelRequest.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.outputConfig != null && message.hasOwnProperty("outputConfig")) { + var error = $root.google.cloud.automl.v1.ModelExportOutputConfig.verify(message.outputConfig); + if (error) + return "outputConfig." + error; + } + return null; + }; + + /** + * Creates an ExportModelRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.automl.v1.ExportModelRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.automl.v1.ExportModelRequest} ExportModelRequest + */ + ExportModelRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.automl.v1.ExportModelRequest) + return object; + var message = new $root.google.cloud.automl.v1.ExportModelRequest(); + if (object.name != null) + message.name = String(object.name); + if (object.outputConfig != null) { + if (typeof object.outputConfig !== "object") + throw TypeError(".google.cloud.automl.v1.ExportModelRequest.outputConfig: object expected"); + message.outputConfig = $root.google.cloud.automl.v1.ModelExportOutputConfig.fromObject(object.outputConfig); + } + return message; + }; + + /** + * Creates a plain object from an ExportModelRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.automl.v1.ExportModelRequest + * @static + * @param {google.cloud.automl.v1.ExportModelRequest} message ExportModelRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ExportModelRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.outputConfig = null; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.outputConfig != null && message.hasOwnProperty("outputConfig")) + object.outputConfig = $root.google.cloud.automl.v1.ModelExportOutputConfig.toObject(message.outputConfig, options); + return object; + }; + + /** + * Converts this ExportModelRequest to JSON. + * @function toJSON + * @memberof google.cloud.automl.v1.ExportModelRequest + * @instance + * @returns {Object.} JSON object + */ + ExportModelRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ExportModelRequest + * @function getTypeUrl + * @memberof google.cloud.automl.v1.ExportModelRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ExportModelRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.automl.v1.ExportModelRequest"; + }; + + return ExportModelRequest; + })(); + + v1.GetModelEvaluationRequest = (function() { + + /** + * Properties of a GetModelEvaluationRequest. + * @memberof google.cloud.automl.v1 + * @interface IGetModelEvaluationRequest + * @property {string|null} [name] GetModelEvaluationRequest name + */ + + /** + * Constructs a new GetModelEvaluationRequest. + * @memberof google.cloud.automl.v1 + * @classdesc Represents a GetModelEvaluationRequest. + * @implements IGetModelEvaluationRequest + * @constructor + * @param {google.cloud.automl.v1.IGetModelEvaluationRequest=} [properties] Properties to set + */ + function GetModelEvaluationRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetModelEvaluationRequest name. + * @member {string} name + * @memberof google.cloud.automl.v1.GetModelEvaluationRequest + * @instance + */ + GetModelEvaluationRequest.prototype.name = ""; + + /** + * Creates a new GetModelEvaluationRequest instance using the specified properties. + * @function create + * @memberof google.cloud.automl.v1.GetModelEvaluationRequest + * @static + * @param {google.cloud.automl.v1.IGetModelEvaluationRequest=} [properties] Properties to set + * @returns {google.cloud.automl.v1.GetModelEvaluationRequest} GetModelEvaluationRequest instance + */ + GetModelEvaluationRequest.create = function create(properties) { + return new GetModelEvaluationRequest(properties); + }; + + /** + * Encodes the specified GetModelEvaluationRequest message. Does not implicitly {@link google.cloud.automl.v1.GetModelEvaluationRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.automl.v1.GetModelEvaluationRequest + * @static + * @param {google.cloud.automl.v1.IGetModelEvaluationRequest} message GetModelEvaluationRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetModelEvaluationRequest.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 GetModelEvaluationRequest message, length delimited. Does not implicitly {@link google.cloud.automl.v1.GetModelEvaluationRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.automl.v1.GetModelEvaluationRequest + * @static + * @param {google.cloud.automl.v1.IGetModelEvaluationRequest} message GetModelEvaluationRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetModelEvaluationRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetModelEvaluationRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.automl.v1.GetModelEvaluationRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.automl.v1.GetModelEvaluationRequest} GetModelEvaluationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetModelEvaluationRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.automl.v1.GetModelEvaluationRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetModelEvaluationRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.automl.v1.GetModelEvaluationRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.automl.v1.GetModelEvaluationRequest} GetModelEvaluationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetModelEvaluationRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetModelEvaluationRequest message. + * @function verify + * @memberof google.cloud.automl.v1.GetModelEvaluationRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetModelEvaluationRequest.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 GetModelEvaluationRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.automl.v1.GetModelEvaluationRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.automl.v1.GetModelEvaluationRequest} GetModelEvaluationRequest + */ + GetModelEvaluationRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.automl.v1.GetModelEvaluationRequest) + return object; + var message = new $root.google.cloud.automl.v1.GetModelEvaluationRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a GetModelEvaluationRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.automl.v1.GetModelEvaluationRequest + * @static + * @param {google.cloud.automl.v1.GetModelEvaluationRequest} message GetModelEvaluationRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetModelEvaluationRequest.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 GetModelEvaluationRequest to JSON. + * @function toJSON + * @memberof google.cloud.automl.v1.GetModelEvaluationRequest + * @instance + * @returns {Object.} JSON object + */ + GetModelEvaluationRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GetModelEvaluationRequest + * @function getTypeUrl + * @memberof google.cloud.automl.v1.GetModelEvaluationRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GetModelEvaluationRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.automl.v1.GetModelEvaluationRequest"; + }; + + return GetModelEvaluationRequest; + })(); + + v1.ListModelEvaluationsRequest = (function() { + + /** + * Properties of a ListModelEvaluationsRequest. + * @memberof google.cloud.automl.v1 + * @interface IListModelEvaluationsRequest + * @property {string|null} [parent] ListModelEvaluationsRequest parent + * @property {string|null} [filter] ListModelEvaluationsRequest filter + * @property {number|null} [pageSize] ListModelEvaluationsRequest pageSize + * @property {string|null} [pageToken] ListModelEvaluationsRequest pageToken + */ + + /** + * Constructs a new ListModelEvaluationsRequest. + * @memberof google.cloud.automl.v1 + * @classdesc Represents a ListModelEvaluationsRequest. + * @implements IListModelEvaluationsRequest + * @constructor + * @param {google.cloud.automl.v1.IListModelEvaluationsRequest=} [properties] Properties to set + */ + function ListModelEvaluationsRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListModelEvaluationsRequest parent. + * @member {string} parent + * @memberof google.cloud.automl.v1.ListModelEvaluationsRequest + * @instance + */ + ListModelEvaluationsRequest.prototype.parent = ""; + + /** + * ListModelEvaluationsRequest filter. + * @member {string} filter + * @memberof google.cloud.automl.v1.ListModelEvaluationsRequest + * @instance + */ + ListModelEvaluationsRequest.prototype.filter = ""; + + /** + * ListModelEvaluationsRequest pageSize. + * @member {number} pageSize + * @memberof google.cloud.automl.v1.ListModelEvaluationsRequest + * @instance + */ + ListModelEvaluationsRequest.prototype.pageSize = 0; + + /** + * ListModelEvaluationsRequest pageToken. + * @member {string} pageToken + * @memberof google.cloud.automl.v1.ListModelEvaluationsRequest + * @instance + */ + ListModelEvaluationsRequest.prototype.pageToken = ""; + + /** + * Creates a new ListModelEvaluationsRequest instance using the specified properties. + * @function create + * @memberof google.cloud.automl.v1.ListModelEvaluationsRequest + * @static + * @param {google.cloud.automl.v1.IListModelEvaluationsRequest=} [properties] Properties to set + * @returns {google.cloud.automl.v1.ListModelEvaluationsRequest} ListModelEvaluationsRequest instance + */ + ListModelEvaluationsRequest.create = function create(properties) { + return new ListModelEvaluationsRequest(properties); + }; + + /** + * Encodes the specified ListModelEvaluationsRequest message. Does not implicitly {@link google.cloud.automl.v1.ListModelEvaluationsRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.automl.v1.ListModelEvaluationsRequest + * @static + * @param {google.cloud.automl.v1.IListModelEvaluationsRequest} message ListModelEvaluationsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListModelEvaluationsRequest.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.filter != null && Object.hasOwnProperty.call(message, "filter")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.filter); + if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.pageSize); + if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.pageToken); + return writer; + }; + + /** + * Encodes the specified ListModelEvaluationsRequest message, length delimited. Does not implicitly {@link google.cloud.automl.v1.ListModelEvaluationsRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.automl.v1.ListModelEvaluationsRequest + * @static + * @param {google.cloud.automl.v1.IListModelEvaluationsRequest} message ListModelEvaluationsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListModelEvaluationsRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListModelEvaluationsRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.automl.v1.ListModelEvaluationsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.automl.v1.ListModelEvaluationsRequest} ListModelEvaluationsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListModelEvaluationsRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.automl.v1.ListModelEvaluationsRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 3: { + message.filter = reader.string(); + break; + } + case 4: { + message.pageSize = reader.int32(); + break; + } + case 6: { + message.pageToken = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListModelEvaluationsRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.automl.v1.ListModelEvaluationsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.automl.v1.ListModelEvaluationsRequest} ListModelEvaluationsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListModelEvaluationsRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListModelEvaluationsRequest message. + * @function verify + * @memberof google.cloud.automl.v1.ListModelEvaluationsRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListModelEvaluationsRequest.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.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 ListModelEvaluationsRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.automl.v1.ListModelEvaluationsRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.automl.v1.ListModelEvaluationsRequest} ListModelEvaluationsRequest + */ + ListModelEvaluationsRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.automl.v1.ListModelEvaluationsRequest) + return object; + var message = new $root.google.cloud.automl.v1.ListModelEvaluationsRequest(); + if (object.parent != null) + message.parent = String(object.parent); + 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 ListModelEvaluationsRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.automl.v1.ListModelEvaluationsRequest + * @static + * @param {google.cloud.automl.v1.ListModelEvaluationsRequest} message ListModelEvaluationsRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListModelEvaluationsRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.filter = ""; + object.pageSize = 0; + object.pageToken = ""; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + 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; + return object; + }; + + /** + * Converts this ListModelEvaluationsRequest to JSON. + * @function toJSON + * @memberof google.cloud.automl.v1.ListModelEvaluationsRequest + * @instance + * @returns {Object.} JSON object + */ + ListModelEvaluationsRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListModelEvaluationsRequest + * @function getTypeUrl + * @memberof google.cloud.automl.v1.ListModelEvaluationsRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListModelEvaluationsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.automl.v1.ListModelEvaluationsRequest"; + }; + + return ListModelEvaluationsRequest; + })(); + + v1.ListModelEvaluationsResponse = (function() { + + /** + * Properties of a ListModelEvaluationsResponse. + * @memberof google.cloud.automl.v1 + * @interface IListModelEvaluationsResponse + * @property {Array.|null} [modelEvaluation] ListModelEvaluationsResponse modelEvaluation + * @property {string|null} [nextPageToken] ListModelEvaluationsResponse nextPageToken + */ + + /** + * Constructs a new ListModelEvaluationsResponse. + * @memberof google.cloud.automl.v1 + * @classdesc Represents a ListModelEvaluationsResponse. + * @implements IListModelEvaluationsResponse + * @constructor + * @param {google.cloud.automl.v1.IListModelEvaluationsResponse=} [properties] Properties to set + */ + function ListModelEvaluationsResponse(properties) { + this.modelEvaluation = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListModelEvaluationsResponse modelEvaluation. + * @member {Array.} modelEvaluation + * @memberof google.cloud.automl.v1.ListModelEvaluationsResponse + * @instance + */ + ListModelEvaluationsResponse.prototype.modelEvaluation = $util.emptyArray; + + /** + * ListModelEvaluationsResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.cloud.automl.v1.ListModelEvaluationsResponse + * @instance + */ + ListModelEvaluationsResponse.prototype.nextPageToken = ""; + + /** + * Creates a new ListModelEvaluationsResponse instance using the specified properties. + * @function create + * @memberof google.cloud.automl.v1.ListModelEvaluationsResponse + * @static + * @param {google.cloud.automl.v1.IListModelEvaluationsResponse=} [properties] Properties to set + * @returns {google.cloud.automl.v1.ListModelEvaluationsResponse} ListModelEvaluationsResponse instance + */ + ListModelEvaluationsResponse.create = function create(properties) { + return new ListModelEvaluationsResponse(properties); + }; + + /** + * Encodes the specified ListModelEvaluationsResponse message. Does not implicitly {@link google.cloud.automl.v1.ListModelEvaluationsResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.automl.v1.ListModelEvaluationsResponse + * @static + * @param {google.cloud.automl.v1.IListModelEvaluationsResponse} message ListModelEvaluationsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListModelEvaluationsResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.modelEvaluation != null && message.modelEvaluation.length) + for (var i = 0; i < message.modelEvaluation.length; ++i) + $root.google.cloud.automl.v1.ModelEvaluation.encode(message.modelEvaluation[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 ListModelEvaluationsResponse message, length delimited. Does not implicitly {@link google.cloud.automl.v1.ListModelEvaluationsResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.automl.v1.ListModelEvaluationsResponse + * @static + * @param {google.cloud.automl.v1.IListModelEvaluationsResponse} message ListModelEvaluationsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListModelEvaluationsResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListModelEvaluationsResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.automl.v1.ListModelEvaluationsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.automl.v1.ListModelEvaluationsResponse} ListModelEvaluationsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListModelEvaluationsResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.automl.v1.ListModelEvaluationsResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.modelEvaluation && message.modelEvaluation.length)) + message.modelEvaluation = []; + message.modelEvaluation.push($root.google.cloud.automl.v1.ModelEvaluation.decode(reader, reader.uint32())); + break; + } + case 2: { + message.nextPageToken = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListModelEvaluationsResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.automl.v1.ListModelEvaluationsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.automl.v1.ListModelEvaluationsResponse} ListModelEvaluationsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListModelEvaluationsResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListModelEvaluationsResponse message. + * @function verify + * @memberof google.cloud.automl.v1.ListModelEvaluationsResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListModelEvaluationsResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.modelEvaluation != null && message.hasOwnProperty("modelEvaluation")) { + if (!Array.isArray(message.modelEvaluation)) + return "modelEvaluation: array expected"; + for (var i = 0; i < message.modelEvaluation.length; ++i) { + var error = $root.google.cloud.automl.v1.ModelEvaluation.verify(message.modelEvaluation[i]); + if (error) + return "modelEvaluation." + error; + } + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + return null; + }; + + /** + * Creates a ListModelEvaluationsResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.automl.v1.ListModelEvaluationsResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.automl.v1.ListModelEvaluationsResponse} ListModelEvaluationsResponse + */ + ListModelEvaluationsResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.automl.v1.ListModelEvaluationsResponse) + return object; + var message = new $root.google.cloud.automl.v1.ListModelEvaluationsResponse(); + if (object.modelEvaluation) { + if (!Array.isArray(object.modelEvaluation)) + throw TypeError(".google.cloud.automl.v1.ListModelEvaluationsResponse.modelEvaluation: array expected"); + message.modelEvaluation = []; + for (var i = 0; i < object.modelEvaluation.length; ++i) { + if (typeof object.modelEvaluation[i] !== "object") + throw TypeError(".google.cloud.automl.v1.ListModelEvaluationsResponse.modelEvaluation: object expected"); + message.modelEvaluation[i] = $root.google.cloud.automl.v1.ModelEvaluation.fromObject(object.modelEvaluation[i]); + } + } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + return message; + }; + + /** + * Creates a plain object from a ListModelEvaluationsResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.automl.v1.ListModelEvaluationsResponse + * @static + * @param {google.cloud.automl.v1.ListModelEvaluationsResponse} message ListModelEvaluationsResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListModelEvaluationsResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.modelEvaluation = []; + if (options.defaults) + object.nextPageToken = ""; + if (message.modelEvaluation && message.modelEvaluation.length) { + object.modelEvaluation = []; + for (var j = 0; j < message.modelEvaluation.length; ++j) + object.modelEvaluation[j] = $root.google.cloud.automl.v1.ModelEvaluation.toObject(message.modelEvaluation[j], options); + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + object.nextPageToken = message.nextPageToken; + return object; + }; + + /** + * Converts this ListModelEvaluationsResponse to JSON. + * @function toJSON + * @memberof google.cloud.automl.v1.ListModelEvaluationsResponse + * @instance + * @returns {Object.} JSON object + */ + ListModelEvaluationsResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListModelEvaluationsResponse + * @function getTypeUrl + * @memberof google.cloud.automl.v1.ListModelEvaluationsResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListModelEvaluationsResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.automl.v1.ListModelEvaluationsResponse"; + }; + + return ListModelEvaluationsResponse; + })(); + + return v1; + })(); + + automl.v1beta1 = (function() { + + /** + * Namespace v1beta1. + * @memberof google.cloud.automl + * @namespace + */ + var v1beta1 = {}; + + v1beta1.AnnotationPayload = (function() { + + /** + * Properties of an AnnotationPayload. + * @memberof google.cloud.automl.v1beta1 + * @interface IAnnotationPayload + * @property {google.cloud.automl.v1beta1.ITranslationAnnotation|null} [translation] AnnotationPayload translation + * @property {google.cloud.automl.v1beta1.IClassificationAnnotation|null} [classification] AnnotationPayload classification + * @property {google.cloud.automl.v1beta1.IImageObjectDetectionAnnotation|null} [imageObjectDetection] AnnotationPayload imageObjectDetection + * @property {google.cloud.automl.v1beta1.IVideoClassificationAnnotation|null} [videoClassification] AnnotationPayload videoClassification + * @property {google.cloud.automl.v1beta1.IVideoObjectTrackingAnnotation|null} [videoObjectTracking] AnnotationPayload videoObjectTracking + * @property {google.cloud.automl.v1beta1.ITextExtractionAnnotation|null} [textExtraction] AnnotationPayload textExtraction + * @property {google.cloud.automl.v1beta1.ITextSentimentAnnotation|null} [textSentiment] AnnotationPayload textSentiment + * @property {google.cloud.automl.v1beta1.ITablesAnnotation|null} [tables] AnnotationPayload tables + * @property {string|null} [annotationSpecId] AnnotationPayload annotationSpecId + * @property {string|null} [displayName] AnnotationPayload displayName + */ + + /** + * Constructs a new AnnotationPayload. + * @memberof google.cloud.automl.v1beta1 + * @classdesc Represents an AnnotationPayload. + * @implements IAnnotationPayload + * @constructor + * @param {google.cloud.automl.v1beta1.IAnnotationPayload=} [properties] Properties to set + */ + function AnnotationPayload(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * AnnotationPayload translation. + * @member {google.cloud.automl.v1beta1.ITranslationAnnotation|null|undefined} translation + * @memberof google.cloud.automl.v1beta1.AnnotationPayload + * @instance + */ + AnnotationPayload.prototype.translation = null; + + /** + * AnnotationPayload classification. + * @member {google.cloud.automl.v1beta1.IClassificationAnnotation|null|undefined} classification + * @memberof google.cloud.automl.v1beta1.AnnotationPayload + * @instance + */ + AnnotationPayload.prototype.classification = null; + + /** + * AnnotationPayload imageObjectDetection. + * @member {google.cloud.automl.v1beta1.IImageObjectDetectionAnnotation|null|undefined} imageObjectDetection + * @memberof google.cloud.automl.v1beta1.AnnotationPayload + * @instance + */ + AnnotationPayload.prototype.imageObjectDetection = null; + + /** + * AnnotationPayload videoClassification. + * @member {google.cloud.automl.v1beta1.IVideoClassificationAnnotation|null|undefined} videoClassification + * @memberof google.cloud.automl.v1beta1.AnnotationPayload + * @instance + */ + AnnotationPayload.prototype.videoClassification = null; + + /** + * AnnotationPayload videoObjectTracking. + * @member {google.cloud.automl.v1beta1.IVideoObjectTrackingAnnotation|null|undefined} videoObjectTracking + * @memberof google.cloud.automl.v1beta1.AnnotationPayload + * @instance + */ + AnnotationPayload.prototype.videoObjectTracking = null; + + /** + * AnnotationPayload textExtraction. + * @member {google.cloud.automl.v1beta1.ITextExtractionAnnotation|null|undefined} textExtraction + * @memberof google.cloud.automl.v1beta1.AnnotationPayload + * @instance + */ + AnnotationPayload.prototype.textExtraction = null; + + /** + * AnnotationPayload textSentiment. + * @member {google.cloud.automl.v1beta1.ITextSentimentAnnotation|null|undefined} textSentiment + * @memberof google.cloud.automl.v1beta1.AnnotationPayload + * @instance + */ + AnnotationPayload.prototype.textSentiment = null; + + /** + * AnnotationPayload tables. + * @member {google.cloud.automl.v1beta1.ITablesAnnotation|null|undefined} tables + * @memberof google.cloud.automl.v1beta1.AnnotationPayload + * @instance + */ + AnnotationPayload.prototype.tables = null; + + /** + * AnnotationPayload annotationSpecId. + * @member {string} annotationSpecId + * @memberof google.cloud.automl.v1beta1.AnnotationPayload + * @instance + */ + AnnotationPayload.prototype.annotationSpecId = ""; + + /** + * AnnotationPayload displayName. + * @member {string} displayName + * @memberof google.cloud.automl.v1beta1.AnnotationPayload + * @instance + */ + AnnotationPayload.prototype.displayName = ""; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * AnnotationPayload detail. + * @member {"translation"|"classification"|"imageObjectDetection"|"videoClassification"|"videoObjectTracking"|"textExtraction"|"textSentiment"|"tables"|undefined} detail + * @memberof google.cloud.automl.v1beta1.AnnotationPayload + * @instance + */ + Object.defineProperty(AnnotationPayload.prototype, "detail", { + get: $util.oneOfGetter($oneOfFields = ["translation", "classification", "imageObjectDetection", "videoClassification", "videoObjectTracking", "textExtraction", "textSentiment", "tables"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new AnnotationPayload instance using the specified properties. + * @function create + * @memberof google.cloud.automl.v1beta1.AnnotationPayload + * @static + * @param {google.cloud.automl.v1beta1.IAnnotationPayload=} [properties] Properties to set + * @returns {google.cloud.automl.v1beta1.AnnotationPayload} AnnotationPayload instance + */ + AnnotationPayload.create = function create(properties) { + return new AnnotationPayload(properties); + }; + + /** + * Encodes the specified AnnotationPayload message. Does not implicitly {@link google.cloud.automl.v1beta1.AnnotationPayload.verify|verify} messages. + * @function encode + * @memberof google.cloud.automl.v1beta1.AnnotationPayload + * @static + * @param {google.cloud.automl.v1beta1.IAnnotationPayload} message AnnotationPayload message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AnnotationPayload.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.annotationSpecId != null && Object.hasOwnProperty.call(message, "annotationSpecId")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.annotationSpecId); + if (message.translation != null && Object.hasOwnProperty.call(message, "translation")) + $root.google.cloud.automl.v1beta1.TranslationAnnotation.encode(message.translation, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.classification != null && Object.hasOwnProperty.call(message, "classification")) + $root.google.cloud.automl.v1beta1.ClassificationAnnotation.encode(message.classification, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.imageObjectDetection != null && Object.hasOwnProperty.call(message, "imageObjectDetection")) + $root.google.cloud.automl.v1beta1.ImageObjectDetectionAnnotation.encode(message.imageObjectDetection, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.displayName != null && Object.hasOwnProperty.call(message, "displayName")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.displayName); + if (message.textExtraction != null && Object.hasOwnProperty.call(message, "textExtraction")) + $root.google.cloud.automl.v1beta1.TextExtractionAnnotation.encode(message.textExtraction, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + if (message.textSentiment != null && Object.hasOwnProperty.call(message, "textSentiment")) + $root.google.cloud.automl.v1beta1.TextSentimentAnnotation.encode(message.textSentiment, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + if (message.videoObjectTracking != null && Object.hasOwnProperty.call(message, "videoObjectTracking")) + $root.google.cloud.automl.v1beta1.VideoObjectTrackingAnnotation.encode(message.videoObjectTracking, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); + if (message.videoClassification != null && Object.hasOwnProperty.call(message, "videoClassification")) + $root.google.cloud.automl.v1beta1.VideoClassificationAnnotation.encode(message.videoClassification, writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim(); + if (message.tables != null && Object.hasOwnProperty.call(message, "tables")) + $root.google.cloud.automl.v1beta1.TablesAnnotation.encode(message.tables, writer.uint32(/* id 10, wireType 2 =*/82).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified AnnotationPayload message, length delimited. Does not implicitly {@link google.cloud.automl.v1beta1.AnnotationPayload.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.automl.v1beta1.AnnotationPayload + * @static + * @param {google.cloud.automl.v1beta1.IAnnotationPayload} message AnnotationPayload message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AnnotationPayload.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an AnnotationPayload message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.automl.v1beta1.AnnotationPayload + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.automl.v1beta1.AnnotationPayload} AnnotationPayload + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AnnotationPayload.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.automl.v1beta1.AnnotationPayload(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 2: { + message.translation = $root.google.cloud.automl.v1beta1.TranslationAnnotation.decode(reader, reader.uint32()); + break; + } + case 3: { + message.classification = $root.google.cloud.automl.v1beta1.ClassificationAnnotation.decode(reader, reader.uint32()); + break; + } + case 4: { + message.imageObjectDetection = $root.google.cloud.automl.v1beta1.ImageObjectDetectionAnnotation.decode(reader, reader.uint32()); + break; + } + case 9: { + message.videoClassification = $root.google.cloud.automl.v1beta1.VideoClassificationAnnotation.decode(reader, reader.uint32()); + break; + } + case 8: { + message.videoObjectTracking = $root.google.cloud.automl.v1beta1.VideoObjectTrackingAnnotation.decode(reader, reader.uint32()); + break; + } + case 6: { + message.textExtraction = $root.google.cloud.automl.v1beta1.TextExtractionAnnotation.decode(reader, reader.uint32()); + break; + } + case 7: { + message.textSentiment = $root.google.cloud.automl.v1beta1.TextSentimentAnnotation.decode(reader, reader.uint32()); + break; + } + case 10: { + message.tables = $root.google.cloud.automl.v1beta1.TablesAnnotation.decode(reader, reader.uint32()); + break; + } + case 1: { + message.annotationSpecId = reader.string(); + break; + } + case 5: { + message.displayName = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an AnnotationPayload message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.automl.v1beta1.AnnotationPayload + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.automl.v1beta1.AnnotationPayload} AnnotationPayload + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AnnotationPayload.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an AnnotationPayload message. + * @function verify + * @memberof google.cloud.automl.v1beta1.AnnotationPayload + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + AnnotationPayload.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.translation != null && message.hasOwnProperty("translation")) { + properties.detail = 1; + { + var error = $root.google.cloud.automl.v1beta1.TranslationAnnotation.verify(message.translation); + if (error) + return "translation." + error; + } + } + if (message.classification != null && message.hasOwnProperty("classification")) { + if (properties.detail === 1) + return "detail: multiple values"; + properties.detail = 1; + { + var error = $root.google.cloud.automl.v1beta1.ClassificationAnnotation.verify(message.classification); + if (error) + return "classification." + error; + } + } + if (message.imageObjectDetection != null && message.hasOwnProperty("imageObjectDetection")) { + if (properties.detail === 1) + return "detail: multiple values"; + properties.detail = 1; + { + var error = $root.google.cloud.automl.v1beta1.ImageObjectDetectionAnnotation.verify(message.imageObjectDetection); + if (error) + return "imageObjectDetection." + error; + } + } + if (message.videoClassification != null && message.hasOwnProperty("videoClassification")) { + if (properties.detail === 1) + return "detail: multiple values"; + properties.detail = 1; + { + var error = $root.google.cloud.automl.v1beta1.VideoClassificationAnnotation.verify(message.videoClassification); + if (error) + return "videoClassification." + error; + } + } + if (message.videoObjectTracking != null && message.hasOwnProperty("videoObjectTracking")) { + if (properties.detail === 1) + return "detail: multiple values"; + properties.detail = 1; + { + var error = $root.google.cloud.automl.v1beta1.VideoObjectTrackingAnnotation.verify(message.videoObjectTracking); + if (error) + return "videoObjectTracking." + error; + } + } + if (message.textExtraction != null && message.hasOwnProperty("textExtraction")) { + if (properties.detail === 1) + return "detail: multiple values"; + properties.detail = 1; + { + var error = $root.google.cloud.automl.v1beta1.TextExtractionAnnotation.verify(message.textExtraction); + if (error) + return "textExtraction." + error; + } + } + if (message.textSentiment != null && message.hasOwnProperty("textSentiment")) { + if (properties.detail === 1) + return "detail: multiple values"; + properties.detail = 1; + { + var error = $root.google.cloud.automl.v1beta1.TextSentimentAnnotation.verify(message.textSentiment); + if (error) + return "textSentiment." + error; + } + } + if (message.tables != null && message.hasOwnProperty("tables")) { + if (properties.detail === 1) + return "detail: multiple values"; + properties.detail = 1; + { + var error = $root.google.cloud.automl.v1beta1.TablesAnnotation.verify(message.tables); + if (error) + return "tables." + error; + } + } + if (message.annotationSpecId != null && message.hasOwnProperty("annotationSpecId")) + if (!$util.isString(message.annotationSpecId)) + return "annotationSpecId: string expected"; + if (message.displayName != null && message.hasOwnProperty("displayName")) + if (!$util.isString(message.displayName)) + return "displayName: string expected"; + return null; + }; + + /** + * Creates an AnnotationPayload message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.automl.v1beta1.AnnotationPayload + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.automl.v1beta1.AnnotationPayload} AnnotationPayload + */ + AnnotationPayload.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.automl.v1beta1.AnnotationPayload) + return object; + var message = new $root.google.cloud.automl.v1beta1.AnnotationPayload(); + if (object.translation != null) { + if (typeof object.translation !== "object") + throw TypeError(".google.cloud.automl.v1beta1.AnnotationPayload.translation: object expected"); + message.translation = $root.google.cloud.automl.v1beta1.TranslationAnnotation.fromObject(object.translation); + } + if (object.classification != null) { + if (typeof object.classification !== "object") + throw TypeError(".google.cloud.automl.v1beta1.AnnotationPayload.classification: object expected"); + message.classification = $root.google.cloud.automl.v1beta1.ClassificationAnnotation.fromObject(object.classification); + } + if (object.imageObjectDetection != null) { + if (typeof object.imageObjectDetection !== "object") + throw TypeError(".google.cloud.automl.v1beta1.AnnotationPayload.imageObjectDetection: object expected"); + message.imageObjectDetection = $root.google.cloud.automl.v1beta1.ImageObjectDetectionAnnotation.fromObject(object.imageObjectDetection); + } + if (object.videoClassification != null) { + if (typeof object.videoClassification !== "object") + throw TypeError(".google.cloud.automl.v1beta1.AnnotationPayload.videoClassification: object expected"); + message.videoClassification = $root.google.cloud.automl.v1beta1.VideoClassificationAnnotation.fromObject(object.videoClassification); + } + if (object.videoObjectTracking != null) { + if (typeof object.videoObjectTracking !== "object") + throw TypeError(".google.cloud.automl.v1beta1.AnnotationPayload.videoObjectTracking: object expected"); + message.videoObjectTracking = $root.google.cloud.automl.v1beta1.VideoObjectTrackingAnnotation.fromObject(object.videoObjectTracking); + } + if (object.textExtraction != null) { + if (typeof object.textExtraction !== "object") + throw TypeError(".google.cloud.automl.v1beta1.AnnotationPayload.textExtraction: object expected"); + message.textExtraction = $root.google.cloud.automl.v1beta1.TextExtractionAnnotation.fromObject(object.textExtraction); + } + if (object.textSentiment != null) { + if (typeof object.textSentiment !== "object") + throw TypeError(".google.cloud.automl.v1beta1.AnnotationPayload.textSentiment: object expected"); + message.textSentiment = $root.google.cloud.automl.v1beta1.TextSentimentAnnotation.fromObject(object.textSentiment); + } + if (object.tables != null) { + if (typeof object.tables !== "object") + throw TypeError(".google.cloud.automl.v1beta1.AnnotationPayload.tables: object expected"); + message.tables = $root.google.cloud.automl.v1beta1.TablesAnnotation.fromObject(object.tables); + } + if (object.annotationSpecId != null) + message.annotationSpecId = String(object.annotationSpecId); + if (object.displayName != null) + message.displayName = String(object.displayName); + return message; + }; + + /** + * Creates a plain object from an AnnotationPayload message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.automl.v1beta1.AnnotationPayload + * @static + * @param {google.cloud.automl.v1beta1.AnnotationPayload} message AnnotationPayload + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + AnnotationPayload.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.annotationSpecId = ""; + object.displayName = ""; + } + if (message.annotationSpecId != null && message.hasOwnProperty("annotationSpecId")) + object.annotationSpecId = message.annotationSpecId; + if (message.translation != null && message.hasOwnProperty("translation")) { + object.translation = $root.google.cloud.automl.v1beta1.TranslationAnnotation.toObject(message.translation, options); + if (options.oneofs) + object.detail = "translation"; + } + if (message.classification != null && message.hasOwnProperty("classification")) { + object.classification = $root.google.cloud.automl.v1beta1.ClassificationAnnotation.toObject(message.classification, options); + if (options.oneofs) + object.detail = "classification"; + } + if (message.imageObjectDetection != null && message.hasOwnProperty("imageObjectDetection")) { + object.imageObjectDetection = $root.google.cloud.automl.v1beta1.ImageObjectDetectionAnnotation.toObject(message.imageObjectDetection, options); + if (options.oneofs) + object.detail = "imageObjectDetection"; + } + if (message.displayName != null && message.hasOwnProperty("displayName")) + object.displayName = message.displayName; + if (message.textExtraction != null && message.hasOwnProperty("textExtraction")) { + object.textExtraction = $root.google.cloud.automl.v1beta1.TextExtractionAnnotation.toObject(message.textExtraction, options); + if (options.oneofs) + object.detail = "textExtraction"; + } + if (message.textSentiment != null && message.hasOwnProperty("textSentiment")) { + object.textSentiment = $root.google.cloud.automl.v1beta1.TextSentimentAnnotation.toObject(message.textSentiment, options); + if (options.oneofs) + object.detail = "textSentiment"; + } + if (message.videoObjectTracking != null && message.hasOwnProperty("videoObjectTracking")) { + object.videoObjectTracking = $root.google.cloud.automl.v1beta1.VideoObjectTrackingAnnotation.toObject(message.videoObjectTracking, options); + if (options.oneofs) + object.detail = "videoObjectTracking"; + } + if (message.videoClassification != null && message.hasOwnProperty("videoClassification")) { + object.videoClassification = $root.google.cloud.automl.v1beta1.VideoClassificationAnnotation.toObject(message.videoClassification, options); + if (options.oneofs) + object.detail = "videoClassification"; + } + if (message.tables != null && message.hasOwnProperty("tables")) { + object.tables = $root.google.cloud.automl.v1beta1.TablesAnnotation.toObject(message.tables, options); + if (options.oneofs) + object.detail = "tables"; + } + return object; + }; + + /** + * Converts this AnnotationPayload to JSON. + * @function toJSON + * @memberof google.cloud.automl.v1beta1.AnnotationPayload + * @instance + * @returns {Object.} JSON object + */ + AnnotationPayload.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for AnnotationPayload + * @function getTypeUrl + * @memberof google.cloud.automl.v1beta1.AnnotationPayload + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + AnnotationPayload.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.automl.v1beta1.AnnotationPayload"; + }; + + return AnnotationPayload; + })(); + + /** + * ClassificationType enum. + * @name google.cloud.automl.v1beta1.ClassificationType + * @enum {number} + * @property {number} CLASSIFICATION_TYPE_UNSPECIFIED=0 CLASSIFICATION_TYPE_UNSPECIFIED value + * @property {number} MULTICLASS=1 MULTICLASS value + * @property {number} MULTILABEL=2 MULTILABEL value + */ + v1beta1.ClassificationType = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "CLASSIFICATION_TYPE_UNSPECIFIED"] = 0; + values[valuesById[1] = "MULTICLASS"] = 1; + values[valuesById[2] = "MULTILABEL"] = 2; + return values; + })(); + + v1beta1.ClassificationAnnotation = (function() { + + /** + * Properties of a ClassificationAnnotation. + * @memberof google.cloud.automl.v1beta1 + * @interface IClassificationAnnotation + * @property {number|null} [score] ClassificationAnnotation score + */ + + /** + * Constructs a new ClassificationAnnotation. + * @memberof google.cloud.automl.v1beta1 + * @classdesc Represents a ClassificationAnnotation. + * @implements IClassificationAnnotation + * @constructor + * @param {google.cloud.automl.v1beta1.IClassificationAnnotation=} [properties] Properties to set + */ + function ClassificationAnnotation(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ClassificationAnnotation score. + * @member {number} score + * @memberof google.cloud.automl.v1beta1.ClassificationAnnotation + * @instance + */ + ClassificationAnnotation.prototype.score = 0; + + /** + * Creates a new ClassificationAnnotation instance using the specified properties. + * @function create + * @memberof google.cloud.automl.v1beta1.ClassificationAnnotation + * @static + * @param {google.cloud.automl.v1beta1.IClassificationAnnotation=} [properties] Properties to set + * @returns {google.cloud.automl.v1beta1.ClassificationAnnotation} ClassificationAnnotation instance + */ + ClassificationAnnotation.create = function create(properties) { + return new ClassificationAnnotation(properties); + }; + + /** + * Encodes the specified ClassificationAnnotation message. Does not implicitly {@link google.cloud.automl.v1beta1.ClassificationAnnotation.verify|verify} messages. + * @function encode + * @memberof google.cloud.automl.v1beta1.ClassificationAnnotation + * @static + * @param {google.cloud.automl.v1beta1.IClassificationAnnotation} message ClassificationAnnotation message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ClassificationAnnotation.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.score != null && Object.hasOwnProperty.call(message, "score")) + writer.uint32(/* id 1, wireType 5 =*/13).float(message.score); + return writer; + }; + + /** + * Encodes the specified ClassificationAnnotation message, length delimited. Does not implicitly {@link google.cloud.automl.v1beta1.ClassificationAnnotation.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.automl.v1beta1.ClassificationAnnotation + * @static + * @param {google.cloud.automl.v1beta1.IClassificationAnnotation} message ClassificationAnnotation message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ClassificationAnnotation.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ClassificationAnnotation message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.automl.v1beta1.ClassificationAnnotation + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.automl.v1beta1.ClassificationAnnotation} ClassificationAnnotation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ClassificationAnnotation.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.automl.v1beta1.ClassificationAnnotation(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.score = reader.float(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ClassificationAnnotation message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.automl.v1beta1.ClassificationAnnotation + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.automl.v1beta1.ClassificationAnnotation} ClassificationAnnotation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ClassificationAnnotation.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ClassificationAnnotation message. + * @function verify + * @memberof google.cloud.automl.v1beta1.ClassificationAnnotation + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ClassificationAnnotation.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.score != null && message.hasOwnProperty("score")) + if (typeof message.score !== "number") + return "score: number expected"; + return null; + }; + + /** + * Creates a ClassificationAnnotation message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.automl.v1beta1.ClassificationAnnotation + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.automl.v1beta1.ClassificationAnnotation} ClassificationAnnotation + */ + ClassificationAnnotation.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.automl.v1beta1.ClassificationAnnotation) + return object; + var message = new $root.google.cloud.automl.v1beta1.ClassificationAnnotation(); + if (object.score != null) + message.score = Number(object.score); + return message; + }; + + /** + * Creates a plain object from a ClassificationAnnotation message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.automl.v1beta1.ClassificationAnnotation + * @static + * @param {google.cloud.automl.v1beta1.ClassificationAnnotation} message ClassificationAnnotation + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ClassificationAnnotation.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.score = 0; + if (message.score != null && message.hasOwnProperty("score")) + object.score = options.json && !isFinite(message.score) ? String(message.score) : message.score; + return object; + }; + + /** + * Converts this ClassificationAnnotation to JSON. + * @function toJSON + * @memberof google.cloud.automl.v1beta1.ClassificationAnnotation + * @instance + * @returns {Object.} JSON object + */ + ClassificationAnnotation.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ClassificationAnnotation + * @function getTypeUrl + * @memberof google.cloud.automl.v1beta1.ClassificationAnnotation + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ClassificationAnnotation.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.automl.v1beta1.ClassificationAnnotation"; + }; + + return ClassificationAnnotation; + })(); + + v1beta1.VideoClassificationAnnotation = (function() { + + /** + * Properties of a VideoClassificationAnnotation. + * @memberof google.cloud.automl.v1beta1 + * @interface IVideoClassificationAnnotation + * @property {string|null} [type] VideoClassificationAnnotation type + * @property {google.cloud.automl.v1beta1.IClassificationAnnotation|null} [classificationAnnotation] VideoClassificationAnnotation classificationAnnotation + * @property {google.cloud.automl.v1beta1.ITimeSegment|null} [timeSegment] VideoClassificationAnnotation timeSegment + */ + + /** + * Constructs a new VideoClassificationAnnotation. + * @memberof google.cloud.automl.v1beta1 + * @classdesc Represents a VideoClassificationAnnotation. + * @implements IVideoClassificationAnnotation + * @constructor + * @param {google.cloud.automl.v1beta1.IVideoClassificationAnnotation=} [properties] Properties to set + */ + function VideoClassificationAnnotation(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * VideoClassificationAnnotation type. + * @member {string} type + * @memberof google.cloud.automl.v1beta1.VideoClassificationAnnotation + * @instance + */ + VideoClassificationAnnotation.prototype.type = ""; + + /** + * VideoClassificationAnnotation classificationAnnotation. + * @member {google.cloud.automl.v1beta1.IClassificationAnnotation|null|undefined} classificationAnnotation + * @memberof google.cloud.automl.v1beta1.VideoClassificationAnnotation + * @instance + */ + VideoClassificationAnnotation.prototype.classificationAnnotation = null; + + /** + * VideoClassificationAnnotation timeSegment. + * @member {google.cloud.automl.v1beta1.ITimeSegment|null|undefined} timeSegment + * @memberof google.cloud.automl.v1beta1.VideoClassificationAnnotation + * @instance + */ + VideoClassificationAnnotation.prototype.timeSegment = null; + + /** + * Creates a new VideoClassificationAnnotation instance using the specified properties. + * @function create + * @memberof google.cloud.automl.v1beta1.VideoClassificationAnnotation + * @static + * @param {google.cloud.automl.v1beta1.IVideoClassificationAnnotation=} [properties] Properties to set + * @returns {google.cloud.automl.v1beta1.VideoClassificationAnnotation} VideoClassificationAnnotation instance + */ + VideoClassificationAnnotation.create = function create(properties) { + return new VideoClassificationAnnotation(properties); + }; + + /** + * Encodes the specified VideoClassificationAnnotation message. Does not implicitly {@link google.cloud.automl.v1beta1.VideoClassificationAnnotation.verify|verify} messages. + * @function encode + * @memberof google.cloud.automl.v1beta1.VideoClassificationAnnotation + * @static + * @param {google.cloud.automl.v1beta1.IVideoClassificationAnnotation} message VideoClassificationAnnotation message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + VideoClassificationAnnotation.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.classificationAnnotation != null && Object.hasOwnProperty.call(message, "classificationAnnotation")) + $root.google.cloud.automl.v1beta1.ClassificationAnnotation.encode(message.classificationAnnotation, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.timeSegment != null && Object.hasOwnProperty.call(message, "timeSegment")) + $root.google.cloud.automl.v1beta1.TimeSegment.encode(message.timeSegment, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified VideoClassificationAnnotation message, length delimited. Does not implicitly {@link google.cloud.automl.v1beta1.VideoClassificationAnnotation.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.automl.v1beta1.VideoClassificationAnnotation + * @static + * @param {google.cloud.automl.v1beta1.IVideoClassificationAnnotation} message VideoClassificationAnnotation message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + VideoClassificationAnnotation.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a VideoClassificationAnnotation message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.automl.v1beta1.VideoClassificationAnnotation + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.automl.v1beta1.VideoClassificationAnnotation} VideoClassificationAnnotation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + VideoClassificationAnnotation.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.automl.v1beta1.VideoClassificationAnnotation(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.type = reader.string(); + break; + } + case 2: { + message.classificationAnnotation = $root.google.cloud.automl.v1beta1.ClassificationAnnotation.decode(reader, reader.uint32()); + break; + } + case 3: { + message.timeSegment = $root.google.cloud.automl.v1beta1.TimeSegment.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a VideoClassificationAnnotation message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.automl.v1beta1.VideoClassificationAnnotation + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.automl.v1beta1.VideoClassificationAnnotation} VideoClassificationAnnotation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + VideoClassificationAnnotation.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a VideoClassificationAnnotation message. + * @function verify + * @memberof google.cloud.automl.v1beta1.VideoClassificationAnnotation + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + VideoClassificationAnnotation.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.classificationAnnotation != null && message.hasOwnProperty("classificationAnnotation")) { + var error = $root.google.cloud.automl.v1beta1.ClassificationAnnotation.verify(message.classificationAnnotation); + if (error) + return "classificationAnnotation." + error; + } + if (message.timeSegment != null && message.hasOwnProperty("timeSegment")) { + var error = $root.google.cloud.automl.v1beta1.TimeSegment.verify(message.timeSegment); + if (error) + return "timeSegment." + error; + } + return null; + }; + + /** + * Creates a VideoClassificationAnnotation message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.automl.v1beta1.VideoClassificationAnnotation + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.automl.v1beta1.VideoClassificationAnnotation} VideoClassificationAnnotation + */ + VideoClassificationAnnotation.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.automl.v1beta1.VideoClassificationAnnotation) + return object; + var message = new $root.google.cloud.automl.v1beta1.VideoClassificationAnnotation(); + if (object.type != null) + message.type = String(object.type); + if (object.classificationAnnotation != null) { + if (typeof object.classificationAnnotation !== "object") + throw TypeError(".google.cloud.automl.v1beta1.VideoClassificationAnnotation.classificationAnnotation: object expected"); + message.classificationAnnotation = $root.google.cloud.automl.v1beta1.ClassificationAnnotation.fromObject(object.classificationAnnotation); + } + if (object.timeSegment != null) { + if (typeof object.timeSegment !== "object") + throw TypeError(".google.cloud.automl.v1beta1.VideoClassificationAnnotation.timeSegment: object expected"); + message.timeSegment = $root.google.cloud.automl.v1beta1.TimeSegment.fromObject(object.timeSegment); + } + return message; + }; + + /** + * Creates a plain object from a VideoClassificationAnnotation message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.automl.v1beta1.VideoClassificationAnnotation + * @static + * @param {google.cloud.automl.v1beta1.VideoClassificationAnnotation} message VideoClassificationAnnotation + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + VideoClassificationAnnotation.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.type = ""; + object.classificationAnnotation = null; + object.timeSegment = null; + } + if (message.type != null && message.hasOwnProperty("type")) + object.type = message.type; + if (message.classificationAnnotation != null && message.hasOwnProperty("classificationAnnotation")) + object.classificationAnnotation = $root.google.cloud.automl.v1beta1.ClassificationAnnotation.toObject(message.classificationAnnotation, options); + if (message.timeSegment != null && message.hasOwnProperty("timeSegment")) + object.timeSegment = $root.google.cloud.automl.v1beta1.TimeSegment.toObject(message.timeSegment, options); + return object; + }; + + /** + * Converts this VideoClassificationAnnotation to JSON. + * @function toJSON + * @memberof google.cloud.automl.v1beta1.VideoClassificationAnnotation + * @instance + * @returns {Object.} JSON object + */ + VideoClassificationAnnotation.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for VideoClassificationAnnotation + * @function getTypeUrl + * @memberof google.cloud.automl.v1beta1.VideoClassificationAnnotation + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + VideoClassificationAnnotation.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.automl.v1beta1.VideoClassificationAnnotation"; + }; + + return VideoClassificationAnnotation; + })(); + + v1beta1.ClassificationEvaluationMetrics = (function() { + + /** + * Properties of a ClassificationEvaluationMetrics. + * @memberof google.cloud.automl.v1beta1 + * @interface IClassificationEvaluationMetrics + * @property {number|null} [auPrc] ClassificationEvaluationMetrics auPrc + * @property {number|null} [baseAuPrc] ClassificationEvaluationMetrics baseAuPrc + * @property {number|null} [auRoc] ClassificationEvaluationMetrics auRoc + * @property {number|null} [logLoss] ClassificationEvaluationMetrics logLoss + * @property {Array.|null} [confidenceMetricsEntry] ClassificationEvaluationMetrics confidenceMetricsEntry + * @property {google.cloud.automl.v1beta1.ClassificationEvaluationMetrics.IConfusionMatrix|null} [confusionMatrix] ClassificationEvaluationMetrics confusionMatrix + * @property {Array.|null} [annotationSpecId] ClassificationEvaluationMetrics annotationSpecId + */ + + /** + * Constructs a new ClassificationEvaluationMetrics. + * @memberof google.cloud.automl.v1beta1 + * @classdesc Represents a ClassificationEvaluationMetrics. + * @implements IClassificationEvaluationMetrics + * @constructor + * @param {google.cloud.automl.v1beta1.IClassificationEvaluationMetrics=} [properties] Properties to set + */ + function ClassificationEvaluationMetrics(properties) { + this.confidenceMetricsEntry = []; + this.annotationSpecId = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ClassificationEvaluationMetrics auPrc. + * @member {number} auPrc + * @memberof google.cloud.automl.v1beta1.ClassificationEvaluationMetrics + * @instance + */ + ClassificationEvaluationMetrics.prototype.auPrc = 0; + + /** + * ClassificationEvaluationMetrics baseAuPrc. + * @member {number} baseAuPrc + * @memberof google.cloud.automl.v1beta1.ClassificationEvaluationMetrics + * @instance + */ + ClassificationEvaluationMetrics.prototype.baseAuPrc = 0; + + /** + * ClassificationEvaluationMetrics auRoc. + * @member {number} auRoc + * @memberof google.cloud.automl.v1beta1.ClassificationEvaluationMetrics + * @instance + */ + ClassificationEvaluationMetrics.prototype.auRoc = 0; + + /** + * ClassificationEvaluationMetrics logLoss. + * @member {number} logLoss + * @memberof google.cloud.automl.v1beta1.ClassificationEvaluationMetrics + * @instance + */ + ClassificationEvaluationMetrics.prototype.logLoss = 0; + + /** + * ClassificationEvaluationMetrics confidenceMetricsEntry. + * @member {Array.} confidenceMetricsEntry + * @memberof google.cloud.automl.v1beta1.ClassificationEvaluationMetrics + * @instance + */ + ClassificationEvaluationMetrics.prototype.confidenceMetricsEntry = $util.emptyArray; + + /** + * ClassificationEvaluationMetrics confusionMatrix. + * @member {google.cloud.automl.v1beta1.ClassificationEvaluationMetrics.IConfusionMatrix|null|undefined} confusionMatrix + * @memberof google.cloud.automl.v1beta1.ClassificationEvaluationMetrics + * @instance + */ + ClassificationEvaluationMetrics.prototype.confusionMatrix = null; + + /** + * ClassificationEvaluationMetrics annotationSpecId. + * @member {Array.} annotationSpecId + * @memberof google.cloud.automl.v1beta1.ClassificationEvaluationMetrics + * @instance + */ + ClassificationEvaluationMetrics.prototype.annotationSpecId = $util.emptyArray; + + /** + * Creates a new ClassificationEvaluationMetrics instance using the specified properties. + * @function create + * @memberof google.cloud.automl.v1beta1.ClassificationEvaluationMetrics + * @static + * @param {google.cloud.automl.v1beta1.IClassificationEvaluationMetrics=} [properties] Properties to set + * @returns {google.cloud.automl.v1beta1.ClassificationEvaluationMetrics} ClassificationEvaluationMetrics instance + */ + ClassificationEvaluationMetrics.create = function create(properties) { + return new ClassificationEvaluationMetrics(properties); + }; + + /** + * Encodes the specified ClassificationEvaluationMetrics message. Does not implicitly {@link google.cloud.automl.v1beta1.ClassificationEvaluationMetrics.verify|verify} messages. + * @function encode + * @memberof google.cloud.automl.v1beta1.ClassificationEvaluationMetrics + * @static + * @param {google.cloud.automl.v1beta1.IClassificationEvaluationMetrics} message ClassificationEvaluationMetrics message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ClassificationEvaluationMetrics.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.auPrc != null && Object.hasOwnProperty.call(message, "auPrc")) + writer.uint32(/* id 1, wireType 5 =*/13).float(message.auPrc); + if (message.baseAuPrc != null && Object.hasOwnProperty.call(message, "baseAuPrc")) + writer.uint32(/* id 2, wireType 5 =*/21).float(message.baseAuPrc); + if (message.confidenceMetricsEntry != null && message.confidenceMetricsEntry.length) + for (var i = 0; i < message.confidenceMetricsEntry.length; ++i) + $root.google.cloud.automl.v1beta1.ClassificationEvaluationMetrics.ConfidenceMetricsEntry.encode(message.confidenceMetricsEntry[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.confusionMatrix != null && Object.hasOwnProperty.call(message, "confusionMatrix")) + $root.google.cloud.automl.v1beta1.ClassificationEvaluationMetrics.ConfusionMatrix.encode(message.confusionMatrix, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.annotationSpecId != null && message.annotationSpecId.length) + for (var i = 0; i < message.annotationSpecId.length; ++i) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.annotationSpecId[i]); + if (message.auRoc != null && Object.hasOwnProperty.call(message, "auRoc")) + writer.uint32(/* id 6, wireType 5 =*/53).float(message.auRoc); + if (message.logLoss != null && Object.hasOwnProperty.call(message, "logLoss")) + writer.uint32(/* id 7, wireType 5 =*/61).float(message.logLoss); + return writer; + }; + + /** + * Encodes the specified ClassificationEvaluationMetrics message, length delimited. Does not implicitly {@link google.cloud.automl.v1beta1.ClassificationEvaluationMetrics.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.automl.v1beta1.ClassificationEvaluationMetrics + * @static + * @param {google.cloud.automl.v1beta1.IClassificationEvaluationMetrics} message ClassificationEvaluationMetrics message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ClassificationEvaluationMetrics.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ClassificationEvaluationMetrics message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.automl.v1beta1.ClassificationEvaluationMetrics + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.automl.v1beta1.ClassificationEvaluationMetrics} ClassificationEvaluationMetrics + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ClassificationEvaluationMetrics.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.automl.v1beta1.ClassificationEvaluationMetrics(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.auPrc = reader.float(); + break; + } + case 2: { + message.baseAuPrc = reader.float(); + break; + } + case 6: { + message.auRoc = reader.float(); + break; + } + case 7: { + message.logLoss = reader.float(); + break; + } + case 3: { + if (!(message.confidenceMetricsEntry && message.confidenceMetricsEntry.length)) + message.confidenceMetricsEntry = []; + message.confidenceMetricsEntry.push($root.google.cloud.automl.v1beta1.ClassificationEvaluationMetrics.ConfidenceMetricsEntry.decode(reader, reader.uint32())); + break; + } + case 4: { + message.confusionMatrix = $root.google.cloud.automl.v1beta1.ClassificationEvaluationMetrics.ConfusionMatrix.decode(reader, reader.uint32()); + break; + } + case 5: { + if (!(message.annotationSpecId && message.annotationSpecId.length)) + message.annotationSpecId = []; + message.annotationSpecId.push(reader.string()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ClassificationEvaluationMetrics message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.automl.v1beta1.ClassificationEvaluationMetrics + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.automl.v1beta1.ClassificationEvaluationMetrics} ClassificationEvaluationMetrics + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ClassificationEvaluationMetrics.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ClassificationEvaluationMetrics message. + * @function verify + * @memberof google.cloud.automl.v1beta1.ClassificationEvaluationMetrics + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ClassificationEvaluationMetrics.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.auPrc != null && message.hasOwnProperty("auPrc")) + if (typeof message.auPrc !== "number") + return "auPrc: number expected"; + if (message.baseAuPrc != null && message.hasOwnProperty("baseAuPrc")) + if (typeof message.baseAuPrc !== "number") + return "baseAuPrc: number expected"; + if (message.auRoc != null && message.hasOwnProperty("auRoc")) + if (typeof message.auRoc !== "number") + return "auRoc: number expected"; + if (message.logLoss != null && message.hasOwnProperty("logLoss")) + if (typeof message.logLoss !== "number") + return "logLoss: number expected"; + if (message.confidenceMetricsEntry != null && message.hasOwnProperty("confidenceMetricsEntry")) { + if (!Array.isArray(message.confidenceMetricsEntry)) + return "confidenceMetricsEntry: array expected"; + for (var i = 0; i < message.confidenceMetricsEntry.length; ++i) { + var error = $root.google.cloud.automl.v1beta1.ClassificationEvaluationMetrics.ConfidenceMetricsEntry.verify(message.confidenceMetricsEntry[i]); + if (error) + return "confidenceMetricsEntry." + error; + } + } + if (message.confusionMatrix != null && message.hasOwnProperty("confusionMatrix")) { + var error = $root.google.cloud.automl.v1beta1.ClassificationEvaluationMetrics.ConfusionMatrix.verify(message.confusionMatrix); + if (error) + return "confusionMatrix." + error; + } + if (message.annotationSpecId != null && message.hasOwnProperty("annotationSpecId")) { + if (!Array.isArray(message.annotationSpecId)) + return "annotationSpecId: array expected"; + for (var i = 0; i < message.annotationSpecId.length; ++i) + if (!$util.isString(message.annotationSpecId[i])) + return "annotationSpecId: string[] expected"; + } + return null; + }; + + /** + * Creates a ClassificationEvaluationMetrics message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.automl.v1beta1.ClassificationEvaluationMetrics + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.automl.v1beta1.ClassificationEvaluationMetrics} ClassificationEvaluationMetrics + */ + ClassificationEvaluationMetrics.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.automl.v1beta1.ClassificationEvaluationMetrics) + return object; + var message = new $root.google.cloud.automl.v1beta1.ClassificationEvaluationMetrics(); + if (object.auPrc != null) + message.auPrc = Number(object.auPrc); + if (object.baseAuPrc != null) + message.baseAuPrc = Number(object.baseAuPrc); + if (object.auRoc != null) + message.auRoc = Number(object.auRoc); + if (object.logLoss != null) + message.logLoss = Number(object.logLoss); + if (object.confidenceMetricsEntry) { + if (!Array.isArray(object.confidenceMetricsEntry)) + throw TypeError(".google.cloud.automl.v1beta1.ClassificationEvaluationMetrics.confidenceMetricsEntry: array expected"); + message.confidenceMetricsEntry = []; + for (var i = 0; i < object.confidenceMetricsEntry.length; ++i) { + if (typeof object.confidenceMetricsEntry[i] !== "object") + throw TypeError(".google.cloud.automl.v1beta1.ClassificationEvaluationMetrics.confidenceMetricsEntry: object expected"); + message.confidenceMetricsEntry[i] = $root.google.cloud.automl.v1beta1.ClassificationEvaluationMetrics.ConfidenceMetricsEntry.fromObject(object.confidenceMetricsEntry[i]); + } + } + if (object.confusionMatrix != null) { + if (typeof object.confusionMatrix !== "object") + throw TypeError(".google.cloud.automl.v1beta1.ClassificationEvaluationMetrics.confusionMatrix: object expected"); + message.confusionMatrix = $root.google.cloud.automl.v1beta1.ClassificationEvaluationMetrics.ConfusionMatrix.fromObject(object.confusionMatrix); + } + if (object.annotationSpecId) { + if (!Array.isArray(object.annotationSpecId)) + throw TypeError(".google.cloud.automl.v1beta1.ClassificationEvaluationMetrics.annotationSpecId: array expected"); + message.annotationSpecId = []; + for (var i = 0; i < object.annotationSpecId.length; ++i) + message.annotationSpecId[i] = String(object.annotationSpecId[i]); + } + return message; + }; + + /** + * Creates a plain object from a ClassificationEvaluationMetrics message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.automl.v1beta1.ClassificationEvaluationMetrics + * @static + * @param {google.cloud.automl.v1beta1.ClassificationEvaluationMetrics} message ClassificationEvaluationMetrics + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ClassificationEvaluationMetrics.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.confidenceMetricsEntry = []; + object.annotationSpecId = []; + } + if (options.defaults) { + object.auPrc = 0; + object.baseAuPrc = 0; + object.confusionMatrix = null; + object.auRoc = 0; + object.logLoss = 0; + } + if (message.auPrc != null && message.hasOwnProperty("auPrc")) + object.auPrc = options.json && !isFinite(message.auPrc) ? String(message.auPrc) : message.auPrc; + if (message.baseAuPrc != null && message.hasOwnProperty("baseAuPrc")) + object.baseAuPrc = options.json && !isFinite(message.baseAuPrc) ? String(message.baseAuPrc) : message.baseAuPrc; + if (message.confidenceMetricsEntry && message.confidenceMetricsEntry.length) { + object.confidenceMetricsEntry = []; + for (var j = 0; j < message.confidenceMetricsEntry.length; ++j) + object.confidenceMetricsEntry[j] = $root.google.cloud.automl.v1beta1.ClassificationEvaluationMetrics.ConfidenceMetricsEntry.toObject(message.confidenceMetricsEntry[j], options); + } + if (message.confusionMatrix != null && message.hasOwnProperty("confusionMatrix")) + object.confusionMatrix = $root.google.cloud.automl.v1beta1.ClassificationEvaluationMetrics.ConfusionMatrix.toObject(message.confusionMatrix, options); + if (message.annotationSpecId && message.annotationSpecId.length) { + object.annotationSpecId = []; + for (var j = 0; j < message.annotationSpecId.length; ++j) + object.annotationSpecId[j] = message.annotationSpecId[j]; + } + if (message.auRoc != null && message.hasOwnProperty("auRoc")) + object.auRoc = options.json && !isFinite(message.auRoc) ? String(message.auRoc) : message.auRoc; + if (message.logLoss != null && message.hasOwnProperty("logLoss")) + object.logLoss = options.json && !isFinite(message.logLoss) ? String(message.logLoss) : message.logLoss; + return object; + }; + + /** + * Converts this ClassificationEvaluationMetrics to JSON. + * @function toJSON + * @memberof google.cloud.automl.v1beta1.ClassificationEvaluationMetrics + * @instance + * @returns {Object.} JSON object + */ + ClassificationEvaluationMetrics.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ClassificationEvaluationMetrics + * @function getTypeUrl + * @memberof google.cloud.automl.v1beta1.ClassificationEvaluationMetrics + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ClassificationEvaluationMetrics.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.automl.v1beta1.ClassificationEvaluationMetrics"; + }; + + ClassificationEvaluationMetrics.ConfidenceMetricsEntry = (function() { + + /** + * Properties of a ConfidenceMetricsEntry. + * @memberof google.cloud.automl.v1beta1.ClassificationEvaluationMetrics + * @interface IConfidenceMetricsEntry + * @property {number|null} [confidenceThreshold] ConfidenceMetricsEntry confidenceThreshold + * @property {number|null} [positionThreshold] ConfidenceMetricsEntry positionThreshold + * @property {number|null} [recall] ConfidenceMetricsEntry recall + * @property {number|null} [precision] ConfidenceMetricsEntry precision + * @property {number|null} [falsePositiveRate] ConfidenceMetricsEntry falsePositiveRate + * @property {number|null} [f1Score] ConfidenceMetricsEntry f1Score + * @property {number|null} [recallAt1] ConfidenceMetricsEntry recallAt1 + * @property {number|null} [precisionAt1] ConfidenceMetricsEntry precisionAt1 + * @property {number|null} [falsePositiveRateAt1] ConfidenceMetricsEntry falsePositiveRateAt1 + * @property {number|null} [f1ScoreAt1] ConfidenceMetricsEntry f1ScoreAt1 + * @property {number|Long|null} [truePositiveCount] ConfidenceMetricsEntry truePositiveCount + * @property {number|Long|null} [falsePositiveCount] ConfidenceMetricsEntry falsePositiveCount + * @property {number|Long|null} [falseNegativeCount] ConfidenceMetricsEntry falseNegativeCount + * @property {number|Long|null} [trueNegativeCount] ConfidenceMetricsEntry trueNegativeCount + */ + + /** + * Constructs a new ConfidenceMetricsEntry. + * @memberof google.cloud.automl.v1beta1.ClassificationEvaluationMetrics + * @classdesc Represents a ConfidenceMetricsEntry. + * @implements IConfidenceMetricsEntry + * @constructor + * @param {google.cloud.automl.v1beta1.ClassificationEvaluationMetrics.IConfidenceMetricsEntry=} [properties] Properties to set + */ + function ConfidenceMetricsEntry(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ConfidenceMetricsEntry confidenceThreshold. + * @member {number} confidenceThreshold + * @memberof google.cloud.automl.v1beta1.ClassificationEvaluationMetrics.ConfidenceMetricsEntry + * @instance + */ + ConfidenceMetricsEntry.prototype.confidenceThreshold = 0; + + /** + * ConfidenceMetricsEntry positionThreshold. + * @member {number} positionThreshold + * @memberof google.cloud.automl.v1beta1.ClassificationEvaluationMetrics.ConfidenceMetricsEntry + * @instance + */ + ConfidenceMetricsEntry.prototype.positionThreshold = 0; + + /** + * ConfidenceMetricsEntry recall. + * @member {number} recall + * @memberof google.cloud.automl.v1beta1.ClassificationEvaluationMetrics.ConfidenceMetricsEntry + * @instance + */ + ConfidenceMetricsEntry.prototype.recall = 0; + + /** + * ConfidenceMetricsEntry precision. + * @member {number} precision + * @memberof google.cloud.automl.v1beta1.ClassificationEvaluationMetrics.ConfidenceMetricsEntry + * @instance + */ + ConfidenceMetricsEntry.prototype.precision = 0; + + /** + * ConfidenceMetricsEntry falsePositiveRate. + * @member {number} falsePositiveRate + * @memberof google.cloud.automl.v1beta1.ClassificationEvaluationMetrics.ConfidenceMetricsEntry + * @instance + */ + ConfidenceMetricsEntry.prototype.falsePositiveRate = 0; + + /** + * ConfidenceMetricsEntry f1Score. + * @member {number} f1Score + * @memberof google.cloud.automl.v1beta1.ClassificationEvaluationMetrics.ConfidenceMetricsEntry + * @instance + */ + ConfidenceMetricsEntry.prototype.f1Score = 0; + + /** + * ConfidenceMetricsEntry recallAt1. + * @member {number} recallAt1 + * @memberof google.cloud.automl.v1beta1.ClassificationEvaluationMetrics.ConfidenceMetricsEntry + * @instance + */ + ConfidenceMetricsEntry.prototype.recallAt1 = 0; + + /** + * ConfidenceMetricsEntry precisionAt1. + * @member {number} precisionAt1 + * @memberof google.cloud.automl.v1beta1.ClassificationEvaluationMetrics.ConfidenceMetricsEntry + * @instance + */ + ConfidenceMetricsEntry.prototype.precisionAt1 = 0; + + /** + * ConfidenceMetricsEntry falsePositiveRateAt1. + * @member {number} falsePositiveRateAt1 + * @memberof google.cloud.automl.v1beta1.ClassificationEvaluationMetrics.ConfidenceMetricsEntry + * @instance + */ + ConfidenceMetricsEntry.prototype.falsePositiveRateAt1 = 0; + + /** + * ConfidenceMetricsEntry f1ScoreAt1. + * @member {number} f1ScoreAt1 + * @memberof google.cloud.automl.v1beta1.ClassificationEvaluationMetrics.ConfidenceMetricsEntry + * @instance + */ + ConfidenceMetricsEntry.prototype.f1ScoreAt1 = 0; + + /** + * ConfidenceMetricsEntry truePositiveCount. + * @member {number|Long} truePositiveCount + * @memberof google.cloud.automl.v1beta1.ClassificationEvaluationMetrics.ConfidenceMetricsEntry + * @instance + */ + ConfidenceMetricsEntry.prototype.truePositiveCount = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * ConfidenceMetricsEntry falsePositiveCount. + * @member {number|Long} falsePositiveCount + * @memberof google.cloud.automl.v1beta1.ClassificationEvaluationMetrics.ConfidenceMetricsEntry + * @instance + */ + ConfidenceMetricsEntry.prototype.falsePositiveCount = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * ConfidenceMetricsEntry falseNegativeCount. + * @member {number|Long} falseNegativeCount + * @memberof google.cloud.automl.v1beta1.ClassificationEvaluationMetrics.ConfidenceMetricsEntry + * @instance + */ + ConfidenceMetricsEntry.prototype.falseNegativeCount = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * ConfidenceMetricsEntry trueNegativeCount. + * @member {number|Long} trueNegativeCount + * @memberof google.cloud.automl.v1beta1.ClassificationEvaluationMetrics.ConfidenceMetricsEntry + * @instance + */ + ConfidenceMetricsEntry.prototype.trueNegativeCount = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new ConfidenceMetricsEntry instance using the specified properties. + * @function create + * @memberof google.cloud.automl.v1beta1.ClassificationEvaluationMetrics.ConfidenceMetricsEntry + * @static + * @param {google.cloud.automl.v1beta1.ClassificationEvaluationMetrics.IConfidenceMetricsEntry=} [properties] Properties to set + * @returns {google.cloud.automl.v1beta1.ClassificationEvaluationMetrics.ConfidenceMetricsEntry} ConfidenceMetricsEntry instance + */ + ConfidenceMetricsEntry.create = function create(properties) { + return new ConfidenceMetricsEntry(properties); + }; + + /** + * Encodes the specified ConfidenceMetricsEntry message. Does not implicitly {@link google.cloud.automl.v1beta1.ClassificationEvaluationMetrics.ConfidenceMetricsEntry.verify|verify} messages. + * @function encode + * @memberof google.cloud.automl.v1beta1.ClassificationEvaluationMetrics.ConfidenceMetricsEntry + * @static + * @param {google.cloud.automl.v1beta1.ClassificationEvaluationMetrics.IConfidenceMetricsEntry} message ConfidenceMetricsEntry message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ConfidenceMetricsEntry.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.confidenceThreshold != null && Object.hasOwnProperty.call(message, "confidenceThreshold")) + writer.uint32(/* id 1, wireType 5 =*/13).float(message.confidenceThreshold); + if (message.recall != null && Object.hasOwnProperty.call(message, "recall")) + writer.uint32(/* id 2, wireType 5 =*/21).float(message.recall); + if (message.precision != null && Object.hasOwnProperty.call(message, "precision")) + writer.uint32(/* id 3, wireType 5 =*/29).float(message.precision); + if (message.f1Score != null && Object.hasOwnProperty.call(message, "f1Score")) + writer.uint32(/* id 4, wireType 5 =*/37).float(message.f1Score); + if (message.recallAt1 != null && Object.hasOwnProperty.call(message, "recallAt1")) + writer.uint32(/* id 5, wireType 5 =*/45).float(message.recallAt1); + if (message.precisionAt1 != null && Object.hasOwnProperty.call(message, "precisionAt1")) + writer.uint32(/* id 6, wireType 5 =*/53).float(message.precisionAt1); + if (message.f1ScoreAt1 != null && Object.hasOwnProperty.call(message, "f1ScoreAt1")) + writer.uint32(/* id 7, wireType 5 =*/61).float(message.f1ScoreAt1); + if (message.falsePositiveRate != null && Object.hasOwnProperty.call(message, "falsePositiveRate")) + writer.uint32(/* id 8, wireType 5 =*/69).float(message.falsePositiveRate); + if (message.falsePositiveRateAt1 != null && Object.hasOwnProperty.call(message, "falsePositiveRateAt1")) + writer.uint32(/* id 9, wireType 5 =*/77).float(message.falsePositiveRateAt1); + if (message.truePositiveCount != null && Object.hasOwnProperty.call(message, "truePositiveCount")) + writer.uint32(/* id 10, wireType 0 =*/80).int64(message.truePositiveCount); + if (message.falsePositiveCount != null && Object.hasOwnProperty.call(message, "falsePositiveCount")) + writer.uint32(/* id 11, wireType 0 =*/88).int64(message.falsePositiveCount); + if (message.falseNegativeCount != null && Object.hasOwnProperty.call(message, "falseNegativeCount")) + writer.uint32(/* id 12, wireType 0 =*/96).int64(message.falseNegativeCount); + if (message.trueNegativeCount != null && Object.hasOwnProperty.call(message, "trueNegativeCount")) + writer.uint32(/* id 13, wireType 0 =*/104).int64(message.trueNegativeCount); + if (message.positionThreshold != null && Object.hasOwnProperty.call(message, "positionThreshold")) + writer.uint32(/* id 14, wireType 0 =*/112).int32(message.positionThreshold); + return writer; + }; + + /** + * Encodes the specified ConfidenceMetricsEntry message, length delimited. Does not implicitly {@link google.cloud.automl.v1beta1.ClassificationEvaluationMetrics.ConfidenceMetricsEntry.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.automl.v1beta1.ClassificationEvaluationMetrics.ConfidenceMetricsEntry + * @static + * @param {google.cloud.automl.v1beta1.ClassificationEvaluationMetrics.IConfidenceMetricsEntry} message ConfidenceMetricsEntry message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ConfidenceMetricsEntry.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ConfidenceMetricsEntry message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.automl.v1beta1.ClassificationEvaluationMetrics.ConfidenceMetricsEntry + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.automl.v1beta1.ClassificationEvaluationMetrics.ConfidenceMetricsEntry} ConfidenceMetricsEntry + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ConfidenceMetricsEntry.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.automl.v1beta1.ClassificationEvaluationMetrics.ConfidenceMetricsEntry(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.confidenceThreshold = reader.float(); + break; + } + case 14: { + message.positionThreshold = reader.int32(); + break; + } + case 2: { + message.recall = reader.float(); + break; + } + case 3: { + message.precision = reader.float(); + break; + } + case 8: { + message.falsePositiveRate = reader.float(); + break; + } + case 4: { + message.f1Score = reader.float(); + break; + } + case 5: { + message.recallAt1 = reader.float(); + break; + } + case 6: { + message.precisionAt1 = reader.float(); + break; + } + case 9: { + message.falsePositiveRateAt1 = reader.float(); + break; + } + case 7: { + message.f1ScoreAt1 = reader.float(); + break; + } + case 10: { + message.truePositiveCount = reader.int64(); + break; + } + case 11: { + message.falsePositiveCount = reader.int64(); + break; + } + case 12: { + message.falseNegativeCount = reader.int64(); + break; + } + case 13: { + message.trueNegativeCount = reader.int64(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ConfidenceMetricsEntry message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.automl.v1beta1.ClassificationEvaluationMetrics.ConfidenceMetricsEntry + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.automl.v1beta1.ClassificationEvaluationMetrics.ConfidenceMetricsEntry} ConfidenceMetricsEntry + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ConfidenceMetricsEntry.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ConfidenceMetricsEntry message. + * @function verify + * @memberof google.cloud.automl.v1beta1.ClassificationEvaluationMetrics.ConfidenceMetricsEntry + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ConfidenceMetricsEntry.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.confidenceThreshold != null && message.hasOwnProperty("confidenceThreshold")) + if (typeof message.confidenceThreshold !== "number") + return "confidenceThreshold: number expected"; + if (message.positionThreshold != null && message.hasOwnProperty("positionThreshold")) + if (!$util.isInteger(message.positionThreshold)) + return "positionThreshold: integer expected"; + if (message.recall != null && message.hasOwnProperty("recall")) + if (typeof message.recall !== "number") + return "recall: number expected"; + if (message.precision != null && message.hasOwnProperty("precision")) + if (typeof message.precision !== "number") + return "precision: number expected"; + if (message.falsePositiveRate != null && message.hasOwnProperty("falsePositiveRate")) + if (typeof message.falsePositiveRate !== "number") + return "falsePositiveRate: number expected"; + if (message.f1Score != null && message.hasOwnProperty("f1Score")) + if (typeof message.f1Score !== "number") + return "f1Score: number expected"; + if (message.recallAt1 != null && message.hasOwnProperty("recallAt1")) + if (typeof message.recallAt1 !== "number") + return "recallAt1: number expected"; + if (message.precisionAt1 != null && message.hasOwnProperty("precisionAt1")) + if (typeof message.precisionAt1 !== "number") + return "precisionAt1: number expected"; + if (message.falsePositiveRateAt1 != null && message.hasOwnProperty("falsePositiveRateAt1")) + if (typeof message.falsePositiveRateAt1 !== "number") + return "falsePositiveRateAt1: number expected"; + if (message.f1ScoreAt1 != null && message.hasOwnProperty("f1ScoreAt1")) + if (typeof message.f1ScoreAt1 !== "number") + return "f1ScoreAt1: number expected"; + if (message.truePositiveCount != null && message.hasOwnProperty("truePositiveCount")) + if (!$util.isInteger(message.truePositiveCount) && !(message.truePositiveCount && $util.isInteger(message.truePositiveCount.low) && $util.isInteger(message.truePositiveCount.high))) + return "truePositiveCount: integer|Long expected"; + if (message.falsePositiveCount != null && message.hasOwnProperty("falsePositiveCount")) + if (!$util.isInteger(message.falsePositiveCount) && !(message.falsePositiveCount && $util.isInteger(message.falsePositiveCount.low) && $util.isInteger(message.falsePositiveCount.high))) + return "falsePositiveCount: integer|Long expected"; + if (message.falseNegativeCount != null && message.hasOwnProperty("falseNegativeCount")) + if (!$util.isInteger(message.falseNegativeCount) && !(message.falseNegativeCount && $util.isInteger(message.falseNegativeCount.low) && $util.isInteger(message.falseNegativeCount.high))) + return "falseNegativeCount: integer|Long expected"; + if (message.trueNegativeCount != null && message.hasOwnProperty("trueNegativeCount")) + if (!$util.isInteger(message.trueNegativeCount) && !(message.trueNegativeCount && $util.isInteger(message.trueNegativeCount.low) && $util.isInteger(message.trueNegativeCount.high))) + return "trueNegativeCount: integer|Long expected"; + return null; + }; + + /** + * Creates a ConfidenceMetricsEntry message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.automl.v1beta1.ClassificationEvaluationMetrics.ConfidenceMetricsEntry + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.automl.v1beta1.ClassificationEvaluationMetrics.ConfidenceMetricsEntry} ConfidenceMetricsEntry + */ + ConfidenceMetricsEntry.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.automl.v1beta1.ClassificationEvaluationMetrics.ConfidenceMetricsEntry) + return object; + var message = new $root.google.cloud.automl.v1beta1.ClassificationEvaluationMetrics.ConfidenceMetricsEntry(); + if (object.confidenceThreshold != null) + message.confidenceThreshold = Number(object.confidenceThreshold); + if (object.positionThreshold != null) + message.positionThreshold = object.positionThreshold | 0; + if (object.recall != null) + message.recall = Number(object.recall); + if (object.precision != null) + message.precision = Number(object.precision); + if (object.falsePositiveRate != null) + message.falsePositiveRate = Number(object.falsePositiveRate); + if (object.f1Score != null) + message.f1Score = Number(object.f1Score); + if (object.recallAt1 != null) + message.recallAt1 = Number(object.recallAt1); + if (object.precisionAt1 != null) + message.precisionAt1 = Number(object.precisionAt1); + if (object.falsePositiveRateAt1 != null) + message.falsePositiveRateAt1 = Number(object.falsePositiveRateAt1); + if (object.f1ScoreAt1 != null) + message.f1ScoreAt1 = Number(object.f1ScoreAt1); + if (object.truePositiveCount != null) + if ($util.Long) + (message.truePositiveCount = $util.Long.fromValue(object.truePositiveCount)).unsigned = false; + else if (typeof object.truePositiveCount === "string") + message.truePositiveCount = parseInt(object.truePositiveCount, 10); + else if (typeof object.truePositiveCount === "number") + message.truePositiveCount = object.truePositiveCount; + else if (typeof object.truePositiveCount === "object") + message.truePositiveCount = new $util.LongBits(object.truePositiveCount.low >>> 0, object.truePositiveCount.high >>> 0).toNumber(); + if (object.falsePositiveCount != null) + if ($util.Long) + (message.falsePositiveCount = $util.Long.fromValue(object.falsePositiveCount)).unsigned = false; + else if (typeof object.falsePositiveCount === "string") + message.falsePositiveCount = parseInt(object.falsePositiveCount, 10); + else if (typeof object.falsePositiveCount === "number") + message.falsePositiveCount = object.falsePositiveCount; + else if (typeof object.falsePositiveCount === "object") + message.falsePositiveCount = new $util.LongBits(object.falsePositiveCount.low >>> 0, object.falsePositiveCount.high >>> 0).toNumber(); + if (object.falseNegativeCount != null) + if ($util.Long) + (message.falseNegativeCount = $util.Long.fromValue(object.falseNegativeCount)).unsigned = false; + else if (typeof object.falseNegativeCount === "string") + message.falseNegativeCount = parseInt(object.falseNegativeCount, 10); + else if (typeof object.falseNegativeCount === "number") + message.falseNegativeCount = object.falseNegativeCount; + else if (typeof object.falseNegativeCount === "object") + message.falseNegativeCount = new $util.LongBits(object.falseNegativeCount.low >>> 0, object.falseNegativeCount.high >>> 0).toNumber(); + if (object.trueNegativeCount != null) + if ($util.Long) + (message.trueNegativeCount = $util.Long.fromValue(object.trueNegativeCount)).unsigned = false; + else if (typeof object.trueNegativeCount === "string") + message.trueNegativeCount = parseInt(object.trueNegativeCount, 10); + else if (typeof object.trueNegativeCount === "number") + message.trueNegativeCount = object.trueNegativeCount; + else if (typeof object.trueNegativeCount === "object") + message.trueNegativeCount = new $util.LongBits(object.trueNegativeCount.low >>> 0, object.trueNegativeCount.high >>> 0).toNumber(); + return message; + }; + + /** + * Creates a plain object from a ConfidenceMetricsEntry message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.automl.v1beta1.ClassificationEvaluationMetrics.ConfidenceMetricsEntry + * @static + * @param {google.cloud.automl.v1beta1.ClassificationEvaluationMetrics.ConfidenceMetricsEntry} message ConfidenceMetricsEntry + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ConfidenceMetricsEntry.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.confidenceThreshold = 0; + object.recall = 0; + object.precision = 0; + object.f1Score = 0; + object.recallAt1 = 0; + object.precisionAt1 = 0; + object.f1ScoreAt1 = 0; + object.falsePositiveRate = 0; + object.falsePositiveRateAt1 = 0; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.truePositiveCount = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.truePositiveCount = options.longs === String ? "0" : 0; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.falsePositiveCount = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.falsePositiveCount = options.longs === String ? "0" : 0; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.falseNegativeCount = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.falseNegativeCount = options.longs === String ? "0" : 0; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.trueNegativeCount = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.trueNegativeCount = options.longs === String ? "0" : 0; + object.positionThreshold = 0; + } + if (message.confidenceThreshold != null && message.hasOwnProperty("confidenceThreshold")) + object.confidenceThreshold = options.json && !isFinite(message.confidenceThreshold) ? String(message.confidenceThreshold) : message.confidenceThreshold; + if (message.recall != null && message.hasOwnProperty("recall")) + object.recall = options.json && !isFinite(message.recall) ? String(message.recall) : message.recall; + if (message.precision != null && message.hasOwnProperty("precision")) + object.precision = options.json && !isFinite(message.precision) ? String(message.precision) : message.precision; + if (message.f1Score != null && message.hasOwnProperty("f1Score")) + object.f1Score = options.json && !isFinite(message.f1Score) ? String(message.f1Score) : message.f1Score; + if (message.recallAt1 != null && message.hasOwnProperty("recallAt1")) + object.recallAt1 = options.json && !isFinite(message.recallAt1) ? String(message.recallAt1) : message.recallAt1; + if (message.precisionAt1 != null && message.hasOwnProperty("precisionAt1")) + object.precisionAt1 = options.json && !isFinite(message.precisionAt1) ? String(message.precisionAt1) : message.precisionAt1; + if (message.f1ScoreAt1 != null && message.hasOwnProperty("f1ScoreAt1")) + object.f1ScoreAt1 = options.json && !isFinite(message.f1ScoreAt1) ? String(message.f1ScoreAt1) : message.f1ScoreAt1; + if (message.falsePositiveRate != null && message.hasOwnProperty("falsePositiveRate")) + object.falsePositiveRate = options.json && !isFinite(message.falsePositiveRate) ? String(message.falsePositiveRate) : message.falsePositiveRate; + if (message.falsePositiveRateAt1 != null && message.hasOwnProperty("falsePositiveRateAt1")) + object.falsePositiveRateAt1 = options.json && !isFinite(message.falsePositiveRateAt1) ? String(message.falsePositiveRateAt1) : message.falsePositiveRateAt1; + if (message.truePositiveCount != null && message.hasOwnProperty("truePositiveCount")) + if (typeof message.truePositiveCount === "number") + object.truePositiveCount = options.longs === String ? String(message.truePositiveCount) : message.truePositiveCount; + else + object.truePositiveCount = options.longs === String ? $util.Long.prototype.toString.call(message.truePositiveCount) : options.longs === Number ? new $util.LongBits(message.truePositiveCount.low >>> 0, message.truePositiveCount.high >>> 0).toNumber() : message.truePositiveCount; + if (message.falsePositiveCount != null && message.hasOwnProperty("falsePositiveCount")) + if (typeof message.falsePositiveCount === "number") + object.falsePositiveCount = options.longs === String ? String(message.falsePositiveCount) : message.falsePositiveCount; + else + object.falsePositiveCount = options.longs === String ? $util.Long.prototype.toString.call(message.falsePositiveCount) : options.longs === Number ? new $util.LongBits(message.falsePositiveCount.low >>> 0, message.falsePositiveCount.high >>> 0).toNumber() : message.falsePositiveCount; + if (message.falseNegativeCount != null && message.hasOwnProperty("falseNegativeCount")) + if (typeof message.falseNegativeCount === "number") + object.falseNegativeCount = options.longs === String ? String(message.falseNegativeCount) : message.falseNegativeCount; + else + object.falseNegativeCount = options.longs === String ? $util.Long.prototype.toString.call(message.falseNegativeCount) : options.longs === Number ? new $util.LongBits(message.falseNegativeCount.low >>> 0, message.falseNegativeCount.high >>> 0).toNumber() : message.falseNegativeCount; + if (message.trueNegativeCount != null && message.hasOwnProperty("trueNegativeCount")) + if (typeof message.trueNegativeCount === "number") + object.trueNegativeCount = options.longs === String ? String(message.trueNegativeCount) : message.trueNegativeCount; + else + object.trueNegativeCount = options.longs === String ? $util.Long.prototype.toString.call(message.trueNegativeCount) : options.longs === Number ? new $util.LongBits(message.trueNegativeCount.low >>> 0, message.trueNegativeCount.high >>> 0).toNumber() : message.trueNegativeCount; + if (message.positionThreshold != null && message.hasOwnProperty("positionThreshold")) + object.positionThreshold = message.positionThreshold; + return object; + }; + + /** + * Converts this ConfidenceMetricsEntry to JSON. + * @function toJSON + * @memberof google.cloud.automl.v1beta1.ClassificationEvaluationMetrics.ConfidenceMetricsEntry + * @instance + * @returns {Object.} JSON object + */ + ConfidenceMetricsEntry.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ConfidenceMetricsEntry + * @function getTypeUrl + * @memberof google.cloud.automl.v1beta1.ClassificationEvaluationMetrics.ConfidenceMetricsEntry + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ConfidenceMetricsEntry.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.automl.v1beta1.ClassificationEvaluationMetrics.ConfidenceMetricsEntry"; + }; + + return ConfidenceMetricsEntry; + })(); + + ClassificationEvaluationMetrics.ConfusionMatrix = (function() { + + /** + * Properties of a ConfusionMatrix. + * @memberof google.cloud.automl.v1beta1.ClassificationEvaluationMetrics + * @interface IConfusionMatrix + * @property {Array.|null} [annotationSpecId] ConfusionMatrix annotationSpecId + * @property {Array.|null} [displayName] ConfusionMatrix displayName + * @property {Array.|null} [row] ConfusionMatrix row + */ + + /** + * Constructs a new ConfusionMatrix. + * @memberof google.cloud.automl.v1beta1.ClassificationEvaluationMetrics + * @classdesc Represents a ConfusionMatrix. + * @implements IConfusionMatrix + * @constructor + * @param {google.cloud.automl.v1beta1.ClassificationEvaluationMetrics.IConfusionMatrix=} [properties] Properties to set + */ + function ConfusionMatrix(properties) { + this.annotationSpecId = []; + this.displayName = []; + this.row = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ConfusionMatrix annotationSpecId. + * @member {Array.} annotationSpecId + * @memberof google.cloud.automl.v1beta1.ClassificationEvaluationMetrics.ConfusionMatrix + * @instance + */ + ConfusionMatrix.prototype.annotationSpecId = $util.emptyArray; + + /** + * ConfusionMatrix displayName. + * @member {Array.} displayName + * @memberof google.cloud.automl.v1beta1.ClassificationEvaluationMetrics.ConfusionMatrix + * @instance + */ + ConfusionMatrix.prototype.displayName = $util.emptyArray; + + /** + * ConfusionMatrix row. + * @member {Array.} row + * @memberof google.cloud.automl.v1beta1.ClassificationEvaluationMetrics.ConfusionMatrix + * @instance + */ + ConfusionMatrix.prototype.row = $util.emptyArray; + + /** + * Creates a new ConfusionMatrix instance using the specified properties. + * @function create + * @memberof google.cloud.automl.v1beta1.ClassificationEvaluationMetrics.ConfusionMatrix + * @static + * @param {google.cloud.automl.v1beta1.ClassificationEvaluationMetrics.IConfusionMatrix=} [properties] Properties to set + * @returns {google.cloud.automl.v1beta1.ClassificationEvaluationMetrics.ConfusionMatrix} ConfusionMatrix instance + */ + ConfusionMatrix.create = function create(properties) { + return new ConfusionMatrix(properties); + }; + + /** + * Encodes the specified ConfusionMatrix message. Does not implicitly {@link google.cloud.automl.v1beta1.ClassificationEvaluationMetrics.ConfusionMatrix.verify|verify} messages. + * @function encode + * @memberof google.cloud.automl.v1beta1.ClassificationEvaluationMetrics.ConfusionMatrix + * @static + * @param {google.cloud.automl.v1beta1.ClassificationEvaluationMetrics.IConfusionMatrix} message ConfusionMatrix message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ConfusionMatrix.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.annotationSpecId != null && message.annotationSpecId.length) + for (var i = 0; i < message.annotationSpecId.length; ++i) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.annotationSpecId[i]); + if (message.row != null && message.row.length) + for (var i = 0; i < message.row.length; ++i) + $root.google.cloud.automl.v1beta1.ClassificationEvaluationMetrics.ConfusionMatrix.Row.encode(message.row[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.displayName != null && message.displayName.length) + for (var i = 0; i < message.displayName.length; ++i) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.displayName[i]); + return writer; + }; + + /** + * Encodes the specified ConfusionMatrix message, length delimited. Does not implicitly {@link google.cloud.automl.v1beta1.ClassificationEvaluationMetrics.ConfusionMatrix.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.automl.v1beta1.ClassificationEvaluationMetrics.ConfusionMatrix + * @static + * @param {google.cloud.automl.v1beta1.ClassificationEvaluationMetrics.IConfusionMatrix} message ConfusionMatrix message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ConfusionMatrix.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ConfusionMatrix message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.automl.v1beta1.ClassificationEvaluationMetrics.ConfusionMatrix + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.automl.v1beta1.ClassificationEvaluationMetrics.ConfusionMatrix} ConfusionMatrix + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ConfusionMatrix.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.automl.v1beta1.ClassificationEvaluationMetrics.ConfusionMatrix(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.annotationSpecId && message.annotationSpecId.length)) + message.annotationSpecId = []; + message.annotationSpecId.push(reader.string()); + break; + } + case 3: { + if (!(message.displayName && message.displayName.length)) + message.displayName = []; + message.displayName.push(reader.string()); + break; + } + case 2: { + if (!(message.row && message.row.length)) + message.row = []; + message.row.push($root.google.cloud.automl.v1beta1.ClassificationEvaluationMetrics.ConfusionMatrix.Row.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ConfusionMatrix message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.automl.v1beta1.ClassificationEvaluationMetrics.ConfusionMatrix + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.automl.v1beta1.ClassificationEvaluationMetrics.ConfusionMatrix} ConfusionMatrix + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ConfusionMatrix.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ConfusionMatrix message. + * @function verify + * @memberof google.cloud.automl.v1beta1.ClassificationEvaluationMetrics.ConfusionMatrix + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ConfusionMatrix.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.annotationSpecId != null && message.hasOwnProperty("annotationSpecId")) { + if (!Array.isArray(message.annotationSpecId)) + return "annotationSpecId: array expected"; + for (var i = 0; i < message.annotationSpecId.length; ++i) + if (!$util.isString(message.annotationSpecId[i])) + return "annotationSpecId: string[] expected"; + } + if (message.displayName != null && message.hasOwnProperty("displayName")) { + if (!Array.isArray(message.displayName)) + return "displayName: array expected"; + for (var i = 0; i < message.displayName.length; ++i) + if (!$util.isString(message.displayName[i])) + return "displayName: string[] expected"; + } + if (message.row != null && message.hasOwnProperty("row")) { + if (!Array.isArray(message.row)) + return "row: array expected"; + for (var i = 0; i < message.row.length; ++i) { + var error = $root.google.cloud.automl.v1beta1.ClassificationEvaluationMetrics.ConfusionMatrix.Row.verify(message.row[i]); + if (error) + return "row." + error; + } + } + return null; + }; + + /** + * Creates a ConfusionMatrix message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.automl.v1beta1.ClassificationEvaluationMetrics.ConfusionMatrix + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.automl.v1beta1.ClassificationEvaluationMetrics.ConfusionMatrix} ConfusionMatrix + */ + ConfusionMatrix.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.automl.v1beta1.ClassificationEvaluationMetrics.ConfusionMatrix) + return object; + var message = new $root.google.cloud.automl.v1beta1.ClassificationEvaluationMetrics.ConfusionMatrix(); + if (object.annotationSpecId) { + if (!Array.isArray(object.annotationSpecId)) + throw TypeError(".google.cloud.automl.v1beta1.ClassificationEvaluationMetrics.ConfusionMatrix.annotationSpecId: array expected"); + message.annotationSpecId = []; + for (var i = 0; i < object.annotationSpecId.length; ++i) + message.annotationSpecId[i] = String(object.annotationSpecId[i]); + } + if (object.displayName) { + if (!Array.isArray(object.displayName)) + throw TypeError(".google.cloud.automl.v1beta1.ClassificationEvaluationMetrics.ConfusionMatrix.displayName: array expected"); + message.displayName = []; + for (var i = 0; i < object.displayName.length; ++i) + message.displayName[i] = String(object.displayName[i]); + } + if (object.row) { + if (!Array.isArray(object.row)) + throw TypeError(".google.cloud.automl.v1beta1.ClassificationEvaluationMetrics.ConfusionMatrix.row: array expected"); + message.row = []; + for (var i = 0; i < object.row.length; ++i) { + if (typeof object.row[i] !== "object") + throw TypeError(".google.cloud.automl.v1beta1.ClassificationEvaluationMetrics.ConfusionMatrix.row: object expected"); + message.row[i] = $root.google.cloud.automl.v1beta1.ClassificationEvaluationMetrics.ConfusionMatrix.Row.fromObject(object.row[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a ConfusionMatrix message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.automl.v1beta1.ClassificationEvaluationMetrics.ConfusionMatrix + * @static + * @param {google.cloud.automl.v1beta1.ClassificationEvaluationMetrics.ConfusionMatrix} message ConfusionMatrix + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ConfusionMatrix.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.annotationSpecId = []; + object.row = []; + object.displayName = []; + } + if (message.annotationSpecId && message.annotationSpecId.length) { + object.annotationSpecId = []; + for (var j = 0; j < message.annotationSpecId.length; ++j) + object.annotationSpecId[j] = message.annotationSpecId[j]; + } + if (message.row && message.row.length) { + object.row = []; + for (var j = 0; j < message.row.length; ++j) + object.row[j] = $root.google.cloud.automl.v1beta1.ClassificationEvaluationMetrics.ConfusionMatrix.Row.toObject(message.row[j], options); + } + if (message.displayName && message.displayName.length) { + object.displayName = []; + for (var j = 0; j < message.displayName.length; ++j) + object.displayName[j] = message.displayName[j]; + } + return object; + }; + + /** + * Converts this ConfusionMatrix to JSON. + * @function toJSON + * @memberof google.cloud.automl.v1beta1.ClassificationEvaluationMetrics.ConfusionMatrix + * @instance + * @returns {Object.} JSON object + */ + ConfusionMatrix.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ConfusionMatrix + * @function getTypeUrl + * @memberof google.cloud.automl.v1beta1.ClassificationEvaluationMetrics.ConfusionMatrix + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ConfusionMatrix.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.automl.v1beta1.ClassificationEvaluationMetrics.ConfusionMatrix"; + }; + + ConfusionMatrix.Row = (function() { + + /** + * Properties of a Row. + * @memberof google.cloud.automl.v1beta1.ClassificationEvaluationMetrics.ConfusionMatrix + * @interface IRow + * @property {Array.|null} [exampleCount] Row exampleCount + */ + + /** + * Constructs a new Row. + * @memberof google.cloud.automl.v1beta1.ClassificationEvaluationMetrics.ConfusionMatrix + * @classdesc Represents a Row. + * @implements IRow + * @constructor + * @param {google.cloud.automl.v1beta1.ClassificationEvaluationMetrics.ConfusionMatrix.IRow=} [properties] Properties to set + */ + function Row(properties) { + this.exampleCount = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Row exampleCount. + * @member {Array.} exampleCount + * @memberof google.cloud.automl.v1beta1.ClassificationEvaluationMetrics.ConfusionMatrix.Row + * @instance + */ + Row.prototype.exampleCount = $util.emptyArray; + + /** + * Creates a new Row instance using the specified properties. + * @function create + * @memberof google.cloud.automl.v1beta1.ClassificationEvaluationMetrics.ConfusionMatrix.Row + * @static + * @param {google.cloud.automl.v1beta1.ClassificationEvaluationMetrics.ConfusionMatrix.IRow=} [properties] Properties to set + * @returns {google.cloud.automl.v1beta1.ClassificationEvaluationMetrics.ConfusionMatrix.Row} Row instance + */ + Row.create = function create(properties) { + return new Row(properties); + }; + + /** + * Encodes the specified Row message. Does not implicitly {@link google.cloud.automl.v1beta1.ClassificationEvaluationMetrics.ConfusionMatrix.Row.verify|verify} messages. + * @function encode + * @memberof google.cloud.automl.v1beta1.ClassificationEvaluationMetrics.ConfusionMatrix.Row + * @static + * @param {google.cloud.automl.v1beta1.ClassificationEvaluationMetrics.ConfusionMatrix.IRow} message Row message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Row.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.exampleCount != null && message.exampleCount.length) { + writer.uint32(/* id 1, wireType 2 =*/10).fork(); + for (var i = 0; i < message.exampleCount.length; ++i) + writer.int32(message.exampleCount[i]); + writer.ldelim(); + } + return writer; + }; + + /** + * Encodes the specified Row message, length delimited. Does not implicitly {@link google.cloud.automl.v1beta1.ClassificationEvaluationMetrics.ConfusionMatrix.Row.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.automl.v1beta1.ClassificationEvaluationMetrics.ConfusionMatrix.Row + * @static + * @param {google.cloud.automl.v1beta1.ClassificationEvaluationMetrics.ConfusionMatrix.IRow} message Row message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Row.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Row message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.automl.v1beta1.ClassificationEvaluationMetrics.ConfusionMatrix.Row + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.automl.v1beta1.ClassificationEvaluationMetrics.ConfusionMatrix.Row} Row + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Row.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.automl.v1beta1.ClassificationEvaluationMetrics.ConfusionMatrix.Row(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.exampleCount && message.exampleCount.length)) + message.exampleCount = []; + if ((tag & 7) === 2) { + var end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) + message.exampleCount.push(reader.int32()); + } else + message.exampleCount.push(reader.int32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Row message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.automl.v1beta1.ClassificationEvaluationMetrics.ConfusionMatrix.Row + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.automl.v1beta1.ClassificationEvaluationMetrics.ConfusionMatrix.Row} Row + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Row.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Row message. + * @function verify + * @memberof google.cloud.automl.v1beta1.ClassificationEvaluationMetrics.ConfusionMatrix.Row + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Row.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.exampleCount != null && message.hasOwnProperty("exampleCount")) { + if (!Array.isArray(message.exampleCount)) + return "exampleCount: array expected"; + for (var i = 0; i < message.exampleCount.length; ++i) + if (!$util.isInteger(message.exampleCount[i])) + return "exampleCount: integer[] expected"; + } + return null; + }; + + /** + * Creates a Row message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.automl.v1beta1.ClassificationEvaluationMetrics.ConfusionMatrix.Row + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.automl.v1beta1.ClassificationEvaluationMetrics.ConfusionMatrix.Row} Row + */ + Row.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.automl.v1beta1.ClassificationEvaluationMetrics.ConfusionMatrix.Row) + return object; + var message = new $root.google.cloud.automl.v1beta1.ClassificationEvaluationMetrics.ConfusionMatrix.Row(); + if (object.exampleCount) { + if (!Array.isArray(object.exampleCount)) + throw TypeError(".google.cloud.automl.v1beta1.ClassificationEvaluationMetrics.ConfusionMatrix.Row.exampleCount: array expected"); + message.exampleCount = []; + for (var i = 0; i < object.exampleCount.length; ++i) + message.exampleCount[i] = object.exampleCount[i] | 0; + } + return message; + }; + + /** + * Creates a plain object from a Row message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.automl.v1beta1.ClassificationEvaluationMetrics.ConfusionMatrix.Row + * @static + * @param {google.cloud.automl.v1beta1.ClassificationEvaluationMetrics.ConfusionMatrix.Row} message Row + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Row.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.exampleCount = []; + if (message.exampleCount && message.exampleCount.length) { + object.exampleCount = []; + for (var j = 0; j < message.exampleCount.length; ++j) + object.exampleCount[j] = message.exampleCount[j]; + } + return object; + }; + + /** + * Converts this Row to JSON. + * @function toJSON + * @memberof google.cloud.automl.v1beta1.ClassificationEvaluationMetrics.ConfusionMatrix.Row + * @instance + * @returns {Object.} JSON object + */ + Row.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Row + * @function getTypeUrl + * @memberof google.cloud.automl.v1beta1.ClassificationEvaluationMetrics.ConfusionMatrix.Row + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Row.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.automl.v1beta1.ClassificationEvaluationMetrics.ConfusionMatrix.Row"; + }; + + return Row; + })(); + + return ConfusionMatrix; + })(); + + return ClassificationEvaluationMetrics; + })(); + + v1beta1.TimeSegment = (function() { + + /** + * Properties of a TimeSegment. + * @memberof google.cloud.automl.v1beta1 + * @interface ITimeSegment + * @property {google.protobuf.IDuration|null} [startTimeOffset] TimeSegment startTimeOffset + * @property {google.protobuf.IDuration|null} [endTimeOffset] TimeSegment endTimeOffset + */ + + /** + * Constructs a new TimeSegment. + * @memberof google.cloud.automl.v1beta1 + * @classdesc Represents a TimeSegment. + * @implements ITimeSegment + * @constructor + * @param {google.cloud.automl.v1beta1.ITimeSegment=} [properties] Properties to set + */ + function TimeSegment(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * TimeSegment startTimeOffset. + * @member {google.protobuf.IDuration|null|undefined} startTimeOffset + * @memberof google.cloud.automl.v1beta1.TimeSegment + * @instance + */ + TimeSegment.prototype.startTimeOffset = null; + + /** + * TimeSegment endTimeOffset. + * @member {google.protobuf.IDuration|null|undefined} endTimeOffset + * @memberof google.cloud.automl.v1beta1.TimeSegment + * @instance + */ + TimeSegment.prototype.endTimeOffset = null; + + /** + * Creates a new TimeSegment instance using the specified properties. + * @function create + * @memberof google.cloud.automl.v1beta1.TimeSegment + * @static + * @param {google.cloud.automl.v1beta1.ITimeSegment=} [properties] Properties to set + * @returns {google.cloud.automl.v1beta1.TimeSegment} TimeSegment instance + */ + TimeSegment.create = function create(properties) { + return new TimeSegment(properties); + }; + + /** + * Encodes the specified TimeSegment message. Does not implicitly {@link google.cloud.automl.v1beta1.TimeSegment.verify|verify} messages. + * @function encode + * @memberof google.cloud.automl.v1beta1.TimeSegment + * @static + * @param {google.cloud.automl.v1beta1.ITimeSegment} message TimeSegment message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TimeSegment.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.startTimeOffset != null && Object.hasOwnProperty.call(message, "startTimeOffset")) + $root.google.protobuf.Duration.encode(message.startTimeOffset, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.endTimeOffset != null && Object.hasOwnProperty.call(message, "endTimeOffset")) + $root.google.protobuf.Duration.encode(message.endTimeOffset, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified TimeSegment message, length delimited. Does not implicitly {@link google.cloud.automl.v1beta1.TimeSegment.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.automl.v1beta1.TimeSegment + * @static + * @param {google.cloud.automl.v1beta1.ITimeSegment} message TimeSegment message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TimeSegment.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a TimeSegment message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.automl.v1beta1.TimeSegment + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.automl.v1beta1.TimeSegment} TimeSegment + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TimeSegment.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.automl.v1beta1.TimeSegment(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.startTimeOffset = $root.google.protobuf.Duration.decode(reader, reader.uint32()); + break; + } + case 2: { + message.endTimeOffset = $root.google.protobuf.Duration.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a TimeSegment message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.automl.v1beta1.TimeSegment + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.automl.v1beta1.TimeSegment} TimeSegment + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TimeSegment.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a TimeSegment message. + * @function verify + * @memberof google.cloud.automl.v1beta1.TimeSegment + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + TimeSegment.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.startTimeOffset != null && message.hasOwnProperty("startTimeOffset")) { + var error = $root.google.protobuf.Duration.verify(message.startTimeOffset); + if (error) + return "startTimeOffset." + error; + } + if (message.endTimeOffset != null && message.hasOwnProperty("endTimeOffset")) { + var error = $root.google.protobuf.Duration.verify(message.endTimeOffset); + if (error) + return "endTimeOffset." + error; + } + return null; + }; + + /** + * Creates a TimeSegment message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.automl.v1beta1.TimeSegment + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.automl.v1beta1.TimeSegment} TimeSegment + */ + TimeSegment.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.automl.v1beta1.TimeSegment) + return object; + var message = new $root.google.cloud.automl.v1beta1.TimeSegment(); + if (object.startTimeOffset != null) { + if (typeof object.startTimeOffset !== "object") + throw TypeError(".google.cloud.automl.v1beta1.TimeSegment.startTimeOffset: object expected"); + message.startTimeOffset = $root.google.protobuf.Duration.fromObject(object.startTimeOffset); + } + if (object.endTimeOffset != null) { + if (typeof object.endTimeOffset !== "object") + throw TypeError(".google.cloud.automl.v1beta1.TimeSegment.endTimeOffset: object expected"); + message.endTimeOffset = $root.google.protobuf.Duration.fromObject(object.endTimeOffset); + } + return message; + }; + + /** + * Creates a plain object from a TimeSegment message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.automl.v1beta1.TimeSegment + * @static + * @param {google.cloud.automl.v1beta1.TimeSegment} message TimeSegment + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + TimeSegment.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.startTimeOffset = null; + object.endTimeOffset = null; + } + if (message.startTimeOffset != null && message.hasOwnProperty("startTimeOffset")) + object.startTimeOffset = $root.google.protobuf.Duration.toObject(message.startTimeOffset, options); + if (message.endTimeOffset != null && message.hasOwnProperty("endTimeOffset")) + object.endTimeOffset = $root.google.protobuf.Duration.toObject(message.endTimeOffset, options); + return object; + }; + + /** + * Converts this TimeSegment to JSON. + * @function toJSON + * @memberof google.cloud.automl.v1beta1.TimeSegment + * @instance + * @returns {Object.} JSON object + */ + TimeSegment.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for TimeSegment + * @function getTypeUrl + * @memberof google.cloud.automl.v1beta1.TimeSegment + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TimeSegment.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.automl.v1beta1.TimeSegment"; + }; + + return TimeSegment; + })(); + + v1beta1.ImageObjectDetectionAnnotation = (function() { + + /** + * Properties of an ImageObjectDetectionAnnotation. + * @memberof google.cloud.automl.v1beta1 + * @interface IImageObjectDetectionAnnotation + * @property {google.cloud.automl.v1beta1.IBoundingPoly|null} [boundingBox] ImageObjectDetectionAnnotation boundingBox + * @property {number|null} [score] ImageObjectDetectionAnnotation score + */ + + /** + * Constructs a new ImageObjectDetectionAnnotation. + * @memberof google.cloud.automl.v1beta1 + * @classdesc Represents an ImageObjectDetectionAnnotation. + * @implements IImageObjectDetectionAnnotation + * @constructor + * @param {google.cloud.automl.v1beta1.IImageObjectDetectionAnnotation=} [properties] Properties to set + */ + function ImageObjectDetectionAnnotation(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ImageObjectDetectionAnnotation boundingBox. + * @member {google.cloud.automl.v1beta1.IBoundingPoly|null|undefined} boundingBox + * @memberof google.cloud.automl.v1beta1.ImageObjectDetectionAnnotation + * @instance + */ + ImageObjectDetectionAnnotation.prototype.boundingBox = null; + + /** + * ImageObjectDetectionAnnotation score. + * @member {number} score + * @memberof google.cloud.automl.v1beta1.ImageObjectDetectionAnnotation + * @instance + */ + ImageObjectDetectionAnnotation.prototype.score = 0; + + /** + * Creates a new ImageObjectDetectionAnnotation instance using the specified properties. + * @function create + * @memberof google.cloud.automl.v1beta1.ImageObjectDetectionAnnotation + * @static + * @param {google.cloud.automl.v1beta1.IImageObjectDetectionAnnotation=} [properties] Properties to set + * @returns {google.cloud.automl.v1beta1.ImageObjectDetectionAnnotation} ImageObjectDetectionAnnotation instance + */ + ImageObjectDetectionAnnotation.create = function create(properties) { + return new ImageObjectDetectionAnnotation(properties); + }; + + /** + * Encodes the specified ImageObjectDetectionAnnotation message. Does not implicitly {@link google.cloud.automl.v1beta1.ImageObjectDetectionAnnotation.verify|verify} messages. + * @function encode + * @memberof google.cloud.automl.v1beta1.ImageObjectDetectionAnnotation + * @static + * @param {google.cloud.automl.v1beta1.IImageObjectDetectionAnnotation} message ImageObjectDetectionAnnotation message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ImageObjectDetectionAnnotation.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.boundingBox != null && Object.hasOwnProperty.call(message, "boundingBox")) + $root.google.cloud.automl.v1beta1.BoundingPoly.encode(message.boundingBox, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.score != null && Object.hasOwnProperty.call(message, "score")) + writer.uint32(/* id 2, wireType 5 =*/21).float(message.score); + return writer; + }; + + /** + * Encodes the specified ImageObjectDetectionAnnotation message, length delimited. Does not implicitly {@link google.cloud.automl.v1beta1.ImageObjectDetectionAnnotation.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.automl.v1beta1.ImageObjectDetectionAnnotation + * @static + * @param {google.cloud.automl.v1beta1.IImageObjectDetectionAnnotation} message ImageObjectDetectionAnnotation message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ImageObjectDetectionAnnotation.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an ImageObjectDetectionAnnotation message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.automl.v1beta1.ImageObjectDetectionAnnotation + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.automl.v1beta1.ImageObjectDetectionAnnotation} ImageObjectDetectionAnnotation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ImageObjectDetectionAnnotation.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.automl.v1beta1.ImageObjectDetectionAnnotation(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.boundingBox = $root.google.cloud.automl.v1beta1.BoundingPoly.decode(reader, reader.uint32()); + break; + } + case 2: { + message.score = reader.float(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an ImageObjectDetectionAnnotation message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.automl.v1beta1.ImageObjectDetectionAnnotation + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.automl.v1beta1.ImageObjectDetectionAnnotation} ImageObjectDetectionAnnotation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ImageObjectDetectionAnnotation.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an ImageObjectDetectionAnnotation message. + * @function verify + * @memberof google.cloud.automl.v1beta1.ImageObjectDetectionAnnotation + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ImageObjectDetectionAnnotation.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.boundingBox != null && message.hasOwnProperty("boundingBox")) { + var error = $root.google.cloud.automl.v1beta1.BoundingPoly.verify(message.boundingBox); + if (error) + return "boundingBox." + error; + } + if (message.score != null && message.hasOwnProperty("score")) + if (typeof message.score !== "number") + return "score: number expected"; + return null; + }; + + /** + * Creates an ImageObjectDetectionAnnotation message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.automl.v1beta1.ImageObjectDetectionAnnotation + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.automl.v1beta1.ImageObjectDetectionAnnotation} ImageObjectDetectionAnnotation + */ + ImageObjectDetectionAnnotation.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.automl.v1beta1.ImageObjectDetectionAnnotation) + return object; + var message = new $root.google.cloud.automl.v1beta1.ImageObjectDetectionAnnotation(); + if (object.boundingBox != null) { + if (typeof object.boundingBox !== "object") + throw TypeError(".google.cloud.automl.v1beta1.ImageObjectDetectionAnnotation.boundingBox: object expected"); + message.boundingBox = $root.google.cloud.automl.v1beta1.BoundingPoly.fromObject(object.boundingBox); + } + if (object.score != null) + message.score = Number(object.score); + return message; + }; + + /** + * Creates a plain object from an ImageObjectDetectionAnnotation message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.automl.v1beta1.ImageObjectDetectionAnnotation + * @static + * @param {google.cloud.automl.v1beta1.ImageObjectDetectionAnnotation} message ImageObjectDetectionAnnotation + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ImageObjectDetectionAnnotation.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.boundingBox = null; + object.score = 0; + } + if (message.boundingBox != null && message.hasOwnProperty("boundingBox")) + object.boundingBox = $root.google.cloud.automl.v1beta1.BoundingPoly.toObject(message.boundingBox, options); + if (message.score != null && message.hasOwnProperty("score")) + object.score = options.json && !isFinite(message.score) ? String(message.score) : message.score; + return object; + }; + + /** + * Converts this ImageObjectDetectionAnnotation to JSON. + * @function toJSON + * @memberof google.cloud.automl.v1beta1.ImageObjectDetectionAnnotation + * @instance + * @returns {Object.} JSON object + */ + ImageObjectDetectionAnnotation.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ImageObjectDetectionAnnotation + * @function getTypeUrl + * @memberof google.cloud.automl.v1beta1.ImageObjectDetectionAnnotation + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ImageObjectDetectionAnnotation.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.automl.v1beta1.ImageObjectDetectionAnnotation"; + }; + + return ImageObjectDetectionAnnotation; + })(); + + v1beta1.VideoObjectTrackingAnnotation = (function() { + + /** + * Properties of a VideoObjectTrackingAnnotation. + * @memberof google.cloud.automl.v1beta1 + * @interface IVideoObjectTrackingAnnotation + * @property {string|null} [instanceId] VideoObjectTrackingAnnotation instanceId + * @property {google.protobuf.IDuration|null} [timeOffset] VideoObjectTrackingAnnotation timeOffset + * @property {google.cloud.automl.v1beta1.IBoundingPoly|null} [boundingBox] VideoObjectTrackingAnnotation boundingBox + * @property {number|null} [score] VideoObjectTrackingAnnotation score + */ + + /** + * Constructs a new VideoObjectTrackingAnnotation. + * @memberof google.cloud.automl.v1beta1 + * @classdesc Represents a VideoObjectTrackingAnnotation. + * @implements IVideoObjectTrackingAnnotation + * @constructor + * @param {google.cloud.automl.v1beta1.IVideoObjectTrackingAnnotation=} [properties] Properties to set + */ + function VideoObjectTrackingAnnotation(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * VideoObjectTrackingAnnotation instanceId. + * @member {string} instanceId + * @memberof google.cloud.automl.v1beta1.VideoObjectTrackingAnnotation + * @instance + */ + VideoObjectTrackingAnnotation.prototype.instanceId = ""; + + /** + * VideoObjectTrackingAnnotation timeOffset. + * @member {google.protobuf.IDuration|null|undefined} timeOffset + * @memberof google.cloud.automl.v1beta1.VideoObjectTrackingAnnotation + * @instance + */ + VideoObjectTrackingAnnotation.prototype.timeOffset = null; + + /** + * VideoObjectTrackingAnnotation boundingBox. + * @member {google.cloud.automl.v1beta1.IBoundingPoly|null|undefined} boundingBox + * @memberof google.cloud.automl.v1beta1.VideoObjectTrackingAnnotation + * @instance + */ + VideoObjectTrackingAnnotation.prototype.boundingBox = null; + + /** + * VideoObjectTrackingAnnotation score. + * @member {number} score + * @memberof google.cloud.automl.v1beta1.VideoObjectTrackingAnnotation + * @instance + */ + VideoObjectTrackingAnnotation.prototype.score = 0; + + /** + * Creates a new VideoObjectTrackingAnnotation instance using the specified properties. + * @function create + * @memberof google.cloud.automl.v1beta1.VideoObjectTrackingAnnotation + * @static + * @param {google.cloud.automl.v1beta1.IVideoObjectTrackingAnnotation=} [properties] Properties to set + * @returns {google.cloud.automl.v1beta1.VideoObjectTrackingAnnotation} VideoObjectTrackingAnnotation instance + */ + VideoObjectTrackingAnnotation.create = function create(properties) { + return new VideoObjectTrackingAnnotation(properties); + }; + + /** + * Encodes the specified VideoObjectTrackingAnnotation message. Does not implicitly {@link google.cloud.automl.v1beta1.VideoObjectTrackingAnnotation.verify|verify} messages. + * @function encode + * @memberof google.cloud.automl.v1beta1.VideoObjectTrackingAnnotation + * @static + * @param {google.cloud.automl.v1beta1.IVideoObjectTrackingAnnotation} message VideoObjectTrackingAnnotation message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + VideoObjectTrackingAnnotation.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.instanceId != null && Object.hasOwnProperty.call(message, "instanceId")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.instanceId); + if (message.timeOffset != null && Object.hasOwnProperty.call(message, "timeOffset")) + $root.google.protobuf.Duration.encode(message.timeOffset, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.boundingBox != null && Object.hasOwnProperty.call(message, "boundingBox")) + $root.google.cloud.automl.v1beta1.BoundingPoly.encode(message.boundingBox, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.score != null && Object.hasOwnProperty.call(message, "score")) + writer.uint32(/* id 4, wireType 5 =*/37).float(message.score); + return writer; + }; + + /** + * Encodes the specified VideoObjectTrackingAnnotation message, length delimited. Does not implicitly {@link google.cloud.automl.v1beta1.VideoObjectTrackingAnnotation.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.automl.v1beta1.VideoObjectTrackingAnnotation + * @static + * @param {google.cloud.automl.v1beta1.IVideoObjectTrackingAnnotation} message VideoObjectTrackingAnnotation message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + VideoObjectTrackingAnnotation.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a VideoObjectTrackingAnnotation message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.automl.v1beta1.VideoObjectTrackingAnnotation + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.automl.v1beta1.VideoObjectTrackingAnnotation} VideoObjectTrackingAnnotation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + VideoObjectTrackingAnnotation.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.automl.v1beta1.VideoObjectTrackingAnnotation(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.instanceId = reader.string(); + break; + } + case 2: { + message.timeOffset = $root.google.protobuf.Duration.decode(reader, reader.uint32()); + break; + } + case 3: { + message.boundingBox = $root.google.cloud.automl.v1beta1.BoundingPoly.decode(reader, reader.uint32()); + break; + } + case 4: { + message.score = reader.float(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a VideoObjectTrackingAnnotation message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.automl.v1beta1.VideoObjectTrackingAnnotation + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.automl.v1beta1.VideoObjectTrackingAnnotation} VideoObjectTrackingAnnotation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + VideoObjectTrackingAnnotation.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a VideoObjectTrackingAnnotation message. + * @function verify + * @memberof google.cloud.automl.v1beta1.VideoObjectTrackingAnnotation + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + VideoObjectTrackingAnnotation.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.instanceId != null && message.hasOwnProperty("instanceId")) + if (!$util.isString(message.instanceId)) + return "instanceId: string expected"; + if (message.timeOffset != null && message.hasOwnProperty("timeOffset")) { + var error = $root.google.protobuf.Duration.verify(message.timeOffset); + if (error) + return "timeOffset." + error; + } + if (message.boundingBox != null && message.hasOwnProperty("boundingBox")) { + var error = $root.google.cloud.automl.v1beta1.BoundingPoly.verify(message.boundingBox); + if (error) + return "boundingBox." + error; + } + if (message.score != null && message.hasOwnProperty("score")) + if (typeof message.score !== "number") + return "score: number expected"; + return null; + }; + + /** + * Creates a VideoObjectTrackingAnnotation message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.automl.v1beta1.VideoObjectTrackingAnnotation + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.automl.v1beta1.VideoObjectTrackingAnnotation} VideoObjectTrackingAnnotation + */ + VideoObjectTrackingAnnotation.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.automl.v1beta1.VideoObjectTrackingAnnotation) + return object; + var message = new $root.google.cloud.automl.v1beta1.VideoObjectTrackingAnnotation(); + if (object.instanceId != null) + message.instanceId = String(object.instanceId); + if (object.timeOffset != null) { + if (typeof object.timeOffset !== "object") + throw TypeError(".google.cloud.automl.v1beta1.VideoObjectTrackingAnnotation.timeOffset: object expected"); + message.timeOffset = $root.google.protobuf.Duration.fromObject(object.timeOffset); + } + if (object.boundingBox != null) { + if (typeof object.boundingBox !== "object") + throw TypeError(".google.cloud.automl.v1beta1.VideoObjectTrackingAnnotation.boundingBox: object expected"); + message.boundingBox = $root.google.cloud.automl.v1beta1.BoundingPoly.fromObject(object.boundingBox); + } + if (object.score != null) + message.score = Number(object.score); + return message; + }; + + /** + * Creates a plain object from a VideoObjectTrackingAnnotation message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.automl.v1beta1.VideoObjectTrackingAnnotation + * @static + * @param {google.cloud.automl.v1beta1.VideoObjectTrackingAnnotation} message VideoObjectTrackingAnnotation + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + VideoObjectTrackingAnnotation.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.instanceId = ""; + object.timeOffset = null; + object.boundingBox = null; + object.score = 0; + } + if (message.instanceId != null && message.hasOwnProperty("instanceId")) + object.instanceId = message.instanceId; + if (message.timeOffset != null && message.hasOwnProperty("timeOffset")) + object.timeOffset = $root.google.protobuf.Duration.toObject(message.timeOffset, options); + if (message.boundingBox != null && message.hasOwnProperty("boundingBox")) + object.boundingBox = $root.google.cloud.automl.v1beta1.BoundingPoly.toObject(message.boundingBox, options); + if (message.score != null && message.hasOwnProperty("score")) + object.score = options.json && !isFinite(message.score) ? String(message.score) : message.score; + return object; + }; + + /** + * Converts this VideoObjectTrackingAnnotation to JSON. + * @function toJSON + * @memberof google.cloud.automl.v1beta1.VideoObjectTrackingAnnotation + * @instance + * @returns {Object.} JSON object + */ + VideoObjectTrackingAnnotation.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for VideoObjectTrackingAnnotation + * @function getTypeUrl + * @memberof google.cloud.automl.v1beta1.VideoObjectTrackingAnnotation + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + VideoObjectTrackingAnnotation.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.automl.v1beta1.VideoObjectTrackingAnnotation"; + }; + + return VideoObjectTrackingAnnotation; + })(); + + v1beta1.BoundingBoxMetricsEntry = (function() { + + /** + * Properties of a BoundingBoxMetricsEntry. + * @memberof google.cloud.automl.v1beta1 + * @interface IBoundingBoxMetricsEntry + * @property {number|null} [iouThreshold] BoundingBoxMetricsEntry iouThreshold + * @property {number|null} [meanAveragePrecision] BoundingBoxMetricsEntry meanAveragePrecision + * @property {Array.|null} [confidenceMetricsEntries] BoundingBoxMetricsEntry confidenceMetricsEntries + */ + + /** + * Constructs a new BoundingBoxMetricsEntry. + * @memberof google.cloud.automl.v1beta1 + * @classdesc Represents a BoundingBoxMetricsEntry. + * @implements IBoundingBoxMetricsEntry + * @constructor + * @param {google.cloud.automl.v1beta1.IBoundingBoxMetricsEntry=} [properties] Properties to set + */ + function BoundingBoxMetricsEntry(properties) { + this.confidenceMetricsEntries = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * BoundingBoxMetricsEntry iouThreshold. + * @member {number} iouThreshold + * @memberof google.cloud.automl.v1beta1.BoundingBoxMetricsEntry + * @instance + */ + BoundingBoxMetricsEntry.prototype.iouThreshold = 0; + + /** + * BoundingBoxMetricsEntry meanAveragePrecision. + * @member {number} meanAveragePrecision + * @memberof google.cloud.automl.v1beta1.BoundingBoxMetricsEntry + * @instance + */ + BoundingBoxMetricsEntry.prototype.meanAveragePrecision = 0; + + /** + * BoundingBoxMetricsEntry confidenceMetricsEntries. + * @member {Array.} confidenceMetricsEntries + * @memberof google.cloud.automl.v1beta1.BoundingBoxMetricsEntry + * @instance + */ + BoundingBoxMetricsEntry.prototype.confidenceMetricsEntries = $util.emptyArray; + + /** + * Creates a new BoundingBoxMetricsEntry instance using the specified properties. + * @function create + * @memberof google.cloud.automl.v1beta1.BoundingBoxMetricsEntry + * @static + * @param {google.cloud.automl.v1beta1.IBoundingBoxMetricsEntry=} [properties] Properties to set + * @returns {google.cloud.automl.v1beta1.BoundingBoxMetricsEntry} BoundingBoxMetricsEntry instance + */ + BoundingBoxMetricsEntry.create = function create(properties) { + return new BoundingBoxMetricsEntry(properties); + }; + + /** + * Encodes the specified BoundingBoxMetricsEntry message. Does not implicitly {@link google.cloud.automl.v1beta1.BoundingBoxMetricsEntry.verify|verify} messages. + * @function encode + * @memberof google.cloud.automl.v1beta1.BoundingBoxMetricsEntry + * @static + * @param {google.cloud.automl.v1beta1.IBoundingBoxMetricsEntry} message BoundingBoxMetricsEntry message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BoundingBoxMetricsEntry.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.iouThreshold != null && Object.hasOwnProperty.call(message, "iouThreshold")) + writer.uint32(/* id 1, wireType 5 =*/13).float(message.iouThreshold); + if (message.meanAveragePrecision != null && Object.hasOwnProperty.call(message, "meanAveragePrecision")) + writer.uint32(/* id 2, wireType 5 =*/21).float(message.meanAveragePrecision); + if (message.confidenceMetricsEntries != null && message.confidenceMetricsEntries.length) + for (var i = 0; i < message.confidenceMetricsEntries.length; ++i) + $root.google.cloud.automl.v1beta1.BoundingBoxMetricsEntry.ConfidenceMetricsEntry.encode(message.confidenceMetricsEntries[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified BoundingBoxMetricsEntry message, length delimited. Does not implicitly {@link google.cloud.automl.v1beta1.BoundingBoxMetricsEntry.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.automl.v1beta1.BoundingBoxMetricsEntry + * @static + * @param {google.cloud.automl.v1beta1.IBoundingBoxMetricsEntry} message BoundingBoxMetricsEntry message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BoundingBoxMetricsEntry.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a BoundingBoxMetricsEntry message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.automl.v1beta1.BoundingBoxMetricsEntry + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.automl.v1beta1.BoundingBoxMetricsEntry} BoundingBoxMetricsEntry + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BoundingBoxMetricsEntry.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.automl.v1beta1.BoundingBoxMetricsEntry(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.iouThreshold = reader.float(); + break; + } + case 2: { + message.meanAveragePrecision = reader.float(); + break; + } + case 3: { + if (!(message.confidenceMetricsEntries && message.confidenceMetricsEntries.length)) + message.confidenceMetricsEntries = []; + message.confidenceMetricsEntries.push($root.google.cloud.automl.v1beta1.BoundingBoxMetricsEntry.ConfidenceMetricsEntry.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a BoundingBoxMetricsEntry message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.automl.v1beta1.BoundingBoxMetricsEntry + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.automl.v1beta1.BoundingBoxMetricsEntry} BoundingBoxMetricsEntry + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BoundingBoxMetricsEntry.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a BoundingBoxMetricsEntry message. + * @function verify + * @memberof google.cloud.automl.v1beta1.BoundingBoxMetricsEntry + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + BoundingBoxMetricsEntry.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.iouThreshold != null && message.hasOwnProperty("iouThreshold")) + if (typeof message.iouThreshold !== "number") + return "iouThreshold: number expected"; + if (message.meanAveragePrecision != null && message.hasOwnProperty("meanAveragePrecision")) + if (typeof message.meanAveragePrecision !== "number") + return "meanAveragePrecision: number expected"; + if (message.confidenceMetricsEntries != null && message.hasOwnProperty("confidenceMetricsEntries")) { + if (!Array.isArray(message.confidenceMetricsEntries)) + return "confidenceMetricsEntries: array expected"; + for (var i = 0; i < message.confidenceMetricsEntries.length; ++i) { + var error = $root.google.cloud.automl.v1beta1.BoundingBoxMetricsEntry.ConfidenceMetricsEntry.verify(message.confidenceMetricsEntries[i]); + if (error) + return "confidenceMetricsEntries." + error; + } + } + return null; + }; + + /** + * Creates a BoundingBoxMetricsEntry message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.automl.v1beta1.BoundingBoxMetricsEntry + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.automl.v1beta1.BoundingBoxMetricsEntry} BoundingBoxMetricsEntry + */ + BoundingBoxMetricsEntry.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.automl.v1beta1.BoundingBoxMetricsEntry) + return object; + var message = new $root.google.cloud.automl.v1beta1.BoundingBoxMetricsEntry(); + if (object.iouThreshold != null) + message.iouThreshold = Number(object.iouThreshold); + if (object.meanAveragePrecision != null) + message.meanAveragePrecision = Number(object.meanAveragePrecision); + if (object.confidenceMetricsEntries) { + if (!Array.isArray(object.confidenceMetricsEntries)) + throw TypeError(".google.cloud.automl.v1beta1.BoundingBoxMetricsEntry.confidenceMetricsEntries: array expected"); + message.confidenceMetricsEntries = []; + for (var i = 0; i < object.confidenceMetricsEntries.length; ++i) { + if (typeof object.confidenceMetricsEntries[i] !== "object") + throw TypeError(".google.cloud.automl.v1beta1.BoundingBoxMetricsEntry.confidenceMetricsEntries: object expected"); + message.confidenceMetricsEntries[i] = $root.google.cloud.automl.v1beta1.BoundingBoxMetricsEntry.ConfidenceMetricsEntry.fromObject(object.confidenceMetricsEntries[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a BoundingBoxMetricsEntry message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.automl.v1beta1.BoundingBoxMetricsEntry + * @static + * @param {google.cloud.automl.v1beta1.BoundingBoxMetricsEntry} message BoundingBoxMetricsEntry + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + BoundingBoxMetricsEntry.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.confidenceMetricsEntries = []; + if (options.defaults) { + object.iouThreshold = 0; + object.meanAveragePrecision = 0; + } + if (message.iouThreshold != null && message.hasOwnProperty("iouThreshold")) + object.iouThreshold = options.json && !isFinite(message.iouThreshold) ? String(message.iouThreshold) : message.iouThreshold; + if (message.meanAveragePrecision != null && message.hasOwnProperty("meanAveragePrecision")) + object.meanAveragePrecision = options.json && !isFinite(message.meanAveragePrecision) ? String(message.meanAveragePrecision) : message.meanAveragePrecision; + if (message.confidenceMetricsEntries && message.confidenceMetricsEntries.length) { + object.confidenceMetricsEntries = []; + for (var j = 0; j < message.confidenceMetricsEntries.length; ++j) + object.confidenceMetricsEntries[j] = $root.google.cloud.automl.v1beta1.BoundingBoxMetricsEntry.ConfidenceMetricsEntry.toObject(message.confidenceMetricsEntries[j], options); + } + return object; + }; + + /** + * Converts this BoundingBoxMetricsEntry to JSON. + * @function toJSON + * @memberof google.cloud.automl.v1beta1.BoundingBoxMetricsEntry + * @instance + * @returns {Object.} JSON object + */ + BoundingBoxMetricsEntry.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for BoundingBoxMetricsEntry + * @function getTypeUrl + * @memberof google.cloud.automl.v1beta1.BoundingBoxMetricsEntry + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + BoundingBoxMetricsEntry.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.automl.v1beta1.BoundingBoxMetricsEntry"; + }; + + BoundingBoxMetricsEntry.ConfidenceMetricsEntry = (function() { + + /** + * Properties of a ConfidenceMetricsEntry. + * @memberof google.cloud.automl.v1beta1.BoundingBoxMetricsEntry + * @interface IConfidenceMetricsEntry + * @property {number|null} [confidenceThreshold] ConfidenceMetricsEntry confidenceThreshold + * @property {number|null} [recall] ConfidenceMetricsEntry recall + * @property {number|null} [precision] ConfidenceMetricsEntry precision + * @property {number|null} [f1Score] ConfidenceMetricsEntry f1Score + */ + + /** + * Constructs a new ConfidenceMetricsEntry. + * @memberof google.cloud.automl.v1beta1.BoundingBoxMetricsEntry + * @classdesc Represents a ConfidenceMetricsEntry. + * @implements IConfidenceMetricsEntry + * @constructor + * @param {google.cloud.automl.v1beta1.BoundingBoxMetricsEntry.IConfidenceMetricsEntry=} [properties] Properties to set + */ + function ConfidenceMetricsEntry(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ConfidenceMetricsEntry confidenceThreshold. + * @member {number} confidenceThreshold + * @memberof google.cloud.automl.v1beta1.BoundingBoxMetricsEntry.ConfidenceMetricsEntry + * @instance + */ + ConfidenceMetricsEntry.prototype.confidenceThreshold = 0; + + /** + * ConfidenceMetricsEntry recall. + * @member {number} recall + * @memberof google.cloud.automl.v1beta1.BoundingBoxMetricsEntry.ConfidenceMetricsEntry + * @instance + */ + ConfidenceMetricsEntry.prototype.recall = 0; + + /** + * ConfidenceMetricsEntry precision. + * @member {number} precision + * @memberof google.cloud.automl.v1beta1.BoundingBoxMetricsEntry.ConfidenceMetricsEntry + * @instance + */ + ConfidenceMetricsEntry.prototype.precision = 0; + + /** + * ConfidenceMetricsEntry f1Score. + * @member {number} f1Score + * @memberof google.cloud.automl.v1beta1.BoundingBoxMetricsEntry.ConfidenceMetricsEntry + * @instance + */ + ConfidenceMetricsEntry.prototype.f1Score = 0; + + /** + * Creates a new ConfidenceMetricsEntry instance using the specified properties. + * @function create + * @memberof google.cloud.automl.v1beta1.BoundingBoxMetricsEntry.ConfidenceMetricsEntry + * @static + * @param {google.cloud.automl.v1beta1.BoundingBoxMetricsEntry.IConfidenceMetricsEntry=} [properties] Properties to set + * @returns {google.cloud.automl.v1beta1.BoundingBoxMetricsEntry.ConfidenceMetricsEntry} ConfidenceMetricsEntry instance + */ + ConfidenceMetricsEntry.create = function create(properties) { + return new ConfidenceMetricsEntry(properties); + }; + + /** + * Encodes the specified ConfidenceMetricsEntry message. Does not implicitly {@link google.cloud.automl.v1beta1.BoundingBoxMetricsEntry.ConfidenceMetricsEntry.verify|verify} messages. + * @function encode + * @memberof google.cloud.automl.v1beta1.BoundingBoxMetricsEntry.ConfidenceMetricsEntry + * @static + * @param {google.cloud.automl.v1beta1.BoundingBoxMetricsEntry.IConfidenceMetricsEntry} message ConfidenceMetricsEntry message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ConfidenceMetricsEntry.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.confidenceThreshold != null && Object.hasOwnProperty.call(message, "confidenceThreshold")) + writer.uint32(/* id 1, wireType 5 =*/13).float(message.confidenceThreshold); + if (message.recall != null && Object.hasOwnProperty.call(message, "recall")) + writer.uint32(/* id 2, wireType 5 =*/21).float(message.recall); + if (message.precision != null && Object.hasOwnProperty.call(message, "precision")) + writer.uint32(/* id 3, wireType 5 =*/29).float(message.precision); + if (message.f1Score != null && Object.hasOwnProperty.call(message, "f1Score")) + writer.uint32(/* id 4, wireType 5 =*/37).float(message.f1Score); + return writer; + }; + + /** + * Encodes the specified ConfidenceMetricsEntry message, length delimited. Does not implicitly {@link google.cloud.automl.v1beta1.BoundingBoxMetricsEntry.ConfidenceMetricsEntry.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.automl.v1beta1.BoundingBoxMetricsEntry.ConfidenceMetricsEntry + * @static + * @param {google.cloud.automl.v1beta1.BoundingBoxMetricsEntry.IConfidenceMetricsEntry} message ConfidenceMetricsEntry message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ConfidenceMetricsEntry.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ConfidenceMetricsEntry message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.automl.v1beta1.BoundingBoxMetricsEntry.ConfidenceMetricsEntry + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.automl.v1beta1.BoundingBoxMetricsEntry.ConfidenceMetricsEntry} ConfidenceMetricsEntry + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ConfidenceMetricsEntry.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.automl.v1beta1.BoundingBoxMetricsEntry.ConfidenceMetricsEntry(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.confidenceThreshold = reader.float(); + break; + } + case 2: { + message.recall = reader.float(); + break; + } + case 3: { + message.precision = reader.float(); + break; + } + case 4: { + message.f1Score = reader.float(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ConfidenceMetricsEntry message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.automl.v1beta1.BoundingBoxMetricsEntry.ConfidenceMetricsEntry + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.automl.v1beta1.BoundingBoxMetricsEntry.ConfidenceMetricsEntry} ConfidenceMetricsEntry + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ConfidenceMetricsEntry.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ConfidenceMetricsEntry message. + * @function verify + * @memberof google.cloud.automl.v1beta1.BoundingBoxMetricsEntry.ConfidenceMetricsEntry + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ConfidenceMetricsEntry.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.confidenceThreshold != null && message.hasOwnProperty("confidenceThreshold")) + if (typeof message.confidenceThreshold !== "number") + return "confidenceThreshold: number expected"; + if (message.recall != null && message.hasOwnProperty("recall")) + if (typeof message.recall !== "number") + return "recall: number expected"; + if (message.precision != null && message.hasOwnProperty("precision")) + if (typeof message.precision !== "number") + return "precision: number expected"; + if (message.f1Score != null && message.hasOwnProperty("f1Score")) + if (typeof message.f1Score !== "number") + return "f1Score: number expected"; + return null; + }; + + /** + * Creates a ConfidenceMetricsEntry message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.automl.v1beta1.BoundingBoxMetricsEntry.ConfidenceMetricsEntry + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.automl.v1beta1.BoundingBoxMetricsEntry.ConfidenceMetricsEntry} ConfidenceMetricsEntry + */ + ConfidenceMetricsEntry.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.automl.v1beta1.BoundingBoxMetricsEntry.ConfidenceMetricsEntry) + return object; + var message = new $root.google.cloud.automl.v1beta1.BoundingBoxMetricsEntry.ConfidenceMetricsEntry(); + if (object.confidenceThreshold != null) + message.confidenceThreshold = Number(object.confidenceThreshold); + if (object.recall != null) + message.recall = Number(object.recall); + if (object.precision != null) + message.precision = Number(object.precision); + if (object.f1Score != null) + message.f1Score = Number(object.f1Score); + return message; + }; + + /** + * Creates a plain object from a ConfidenceMetricsEntry message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.automl.v1beta1.BoundingBoxMetricsEntry.ConfidenceMetricsEntry + * @static + * @param {google.cloud.automl.v1beta1.BoundingBoxMetricsEntry.ConfidenceMetricsEntry} message ConfidenceMetricsEntry + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ConfidenceMetricsEntry.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.confidenceThreshold = 0; + object.recall = 0; + object.precision = 0; + object.f1Score = 0; + } + if (message.confidenceThreshold != null && message.hasOwnProperty("confidenceThreshold")) + object.confidenceThreshold = options.json && !isFinite(message.confidenceThreshold) ? String(message.confidenceThreshold) : message.confidenceThreshold; + if (message.recall != null && message.hasOwnProperty("recall")) + object.recall = options.json && !isFinite(message.recall) ? String(message.recall) : message.recall; + if (message.precision != null && message.hasOwnProperty("precision")) + object.precision = options.json && !isFinite(message.precision) ? String(message.precision) : message.precision; + if (message.f1Score != null && message.hasOwnProperty("f1Score")) + object.f1Score = options.json && !isFinite(message.f1Score) ? String(message.f1Score) : message.f1Score; + return object; + }; + + /** + * Converts this ConfidenceMetricsEntry to JSON. + * @function toJSON + * @memberof google.cloud.automl.v1beta1.BoundingBoxMetricsEntry.ConfidenceMetricsEntry + * @instance + * @returns {Object.} JSON object + */ + ConfidenceMetricsEntry.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ConfidenceMetricsEntry + * @function getTypeUrl + * @memberof google.cloud.automl.v1beta1.BoundingBoxMetricsEntry.ConfidenceMetricsEntry + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ConfidenceMetricsEntry.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.automl.v1beta1.BoundingBoxMetricsEntry.ConfidenceMetricsEntry"; + }; + + return ConfidenceMetricsEntry; + })(); + + return BoundingBoxMetricsEntry; + })(); + + v1beta1.ImageObjectDetectionEvaluationMetrics = (function() { + + /** + * Properties of an ImageObjectDetectionEvaluationMetrics. + * @memberof google.cloud.automl.v1beta1 + * @interface IImageObjectDetectionEvaluationMetrics + * @property {number|null} [evaluatedBoundingBoxCount] ImageObjectDetectionEvaluationMetrics evaluatedBoundingBoxCount + * @property {Array.|null} [boundingBoxMetricsEntries] ImageObjectDetectionEvaluationMetrics boundingBoxMetricsEntries + * @property {number|null} [boundingBoxMeanAveragePrecision] ImageObjectDetectionEvaluationMetrics boundingBoxMeanAveragePrecision + */ + + /** + * Constructs a new ImageObjectDetectionEvaluationMetrics. + * @memberof google.cloud.automl.v1beta1 + * @classdesc Represents an ImageObjectDetectionEvaluationMetrics. + * @implements IImageObjectDetectionEvaluationMetrics + * @constructor + * @param {google.cloud.automl.v1beta1.IImageObjectDetectionEvaluationMetrics=} [properties] Properties to set + */ + function ImageObjectDetectionEvaluationMetrics(properties) { + this.boundingBoxMetricsEntries = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ImageObjectDetectionEvaluationMetrics evaluatedBoundingBoxCount. + * @member {number} evaluatedBoundingBoxCount + * @memberof google.cloud.automl.v1beta1.ImageObjectDetectionEvaluationMetrics + * @instance + */ + ImageObjectDetectionEvaluationMetrics.prototype.evaluatedBoundingBoxCount = 0; + + /** + * ImageObjectDetectionEvaluationMetrics boundingBoxMetricsEntries. + * @member {Array.} boundingBoxMetricsEntries + * @memberof google.cloud.automl.v1beta1.ImageObjectDetectionEvaluationMetrics + * @instance + */ + ImageObjectDetectionEvaluationMetrics.prototype.boundingBoxMetricsEntries = $util.emptyArray; + + /** + * ImageObjectDetectionEvaluationMetrics boundingBoxMeanAveragePrecision. + * @member {number} boundingBoxMeanAveragePrecision + * @memberof google.cloud.automl.v1beta1.ImageObjectDetectionEvaluationMetrics + * @instance + */ + ImageObjectDetectionEvaluationMetrics.prototype.boundingBoxMeanAveragePrecision = 0; + + /** + * Creates a new ImageObjectDetectionEvaluationMetrics instance using the specified properties. + * @function create + * @memberof google.cloud.automl.v1beta1.ImageObjectDetectionEvaluationMetrics + * @static + * @param {google.cloud.automl.v1beta1.IImageObjectDetectionEvaluationMetrics=} [properties] Properties to set + * @returns {google.cloud.automl.v1beta1.ImageObjectDetectionEvaluationMetrics} ImageObjectDetectionEvaluationMetrics instance + */ + ImageObjectDetectionEvaluationMetrics.create = function create(properties) { + return new ImageObjectDetectionEvaluationMetrics(properties); + }; + + /** + * Encodes the specified ImageObjectDetectionEvaluationMetrics message. Does not implicitly {@link google.cloud.automl.v1beta1.ImageObjectDetectionEvaluationMetrics.verify|verify} messages. + * @function encode + * @memberof google.cloud.automl.v1beta1.ImageObjectDetectionEvaluationMetrics + * @static + * @param {google.cloud.automl.v1beta1.IImageObjectDetectionEvaluationMetrics} message ImageObjectDetectionEvaluationMetrics message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ImageObjectDetectionEvaluationMetrics.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.evaluatedBoundingBoxCount != null && Object.hasOwnProperty.call(message, "evaluatedBoundingBoxCount")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.evaluatedBoundingBoxCount); + if (message.boundingBoxMetricsEntries != null && message.boundingBoxMetricsEntries.length) + for (var i = 0; i < message.boundingBoxMetricsEntries.length; ++i) + $root.google.cloud.automl.v1beta1.BoundingBoxMetricsEntry.encode(message.boundingBoxMetricsEntries[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.boundingBoxMeanAveragePrecision != null && Object.hasOwnProperty.call(message, "boundingBoxMeanAveragePrecision")) + writer.uint32(/* id 3, wireType 5 =*/29).float(message.boundingBoxMeanAveragePrecision); + return writer; + }; + + /** + * Encodes the specified ImageObjectDetectionEvaluationMetrics message, length delimited. Does not implicitly {@link google.cloud.automl.v1beta1.ImageObjectDetectionEvaluationMetrics.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.automl.v1beta1.ImageObjectDetectionEvaluationMetrics + * @static + * @param {google.cloud.automl.v1beta1.IImageObjectDetectionEvaluationMetrics} message ImageObjectDetectionEvaluationMetrics message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ImageObjectDetectionEvaluationMetrics.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an ImageObjectDetectionEvaluationMetrics message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.automl.v1beta1.ImageObjectDetectionEvaluationMetrics + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.automl.v1beta1.ImageObjectDetectionEvaluationMetrics} ImageObjectDetectionEvaluationMetrics + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ImageObjectDetectionEvaluationMetrics.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.automl.v1beta1.ImageObjectDetectionEvaluationMetrics(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.evaluatedBoundingBoxCount = reader.int32(); + break; + } + case 2: { + if (!(message.boundingBoxMetricsEntries && message.boundingBoxMetricsEntries.length)) + message.boundingBoxMetricsEntries = []; + message.boundingBoxMetricsEntries.push($root.google.cloud.automl.v1beta1.BoundingBoxMetricsEntry.decode(reader, reader.uint32())); + break; + } + case 3: { + message.boundingBoxMeanAveragePrecision = reader.float(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an ImageObjectDetectionEvaluationMetrics message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.automl.v1beta1.ImageObjectDetectionEvaluationMetrics + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.automl.v1beta1.ImageObjectDetectionEvaluationMetrics} ImageObjectDetectionEvaluationMetrics + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ImageObjectDetectionEvaluationMetrics.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an ImageObjectDetectionEvaluationMetrics message. + * @function verify + * @memberof google.cloud.automl.v1beta1.ImageObjectDetectionEvaluationMetrics + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ImageObjectDetectionEvaluationMetrics.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.evaluatedBoundingBoxCount != null && message.hasOwnProperty("evaluatedBoundingBoxCount")) + if (!$util.isInteger(message.evaluatedBoundingBoxCount)) + return "evaluatedBoundingBoxCount: integer expected"; + if (message.boundingBoxMetricsEntries != null && message.hasOwnProperty("boundingBoxMetricsEntries")) { + if (!Array.isArray(message.boundingBoxMetricsEntries)) + return "boundingBoxMetricsEntries: array expected"; + for (var i = 0; i < message.boundingBoxMetricsEntries.length; ++i) { + var error = $root.google.cloud.automl.v1beta1.BoundingBoxMetricsEntry.verify(message.boundingBoxMetricsEntries[i]); + if (error) + return "boundingBoxMetricsEntries." + error; + } + } + if (message.boundingBoxMeanAveragePrecision != null && message.hasOwnProperty("boundingBoxMeanAveragePrecision")) + if (typeof message.boundingBoxMeanAveragePrecision !== "number") + return "boundingBoxMeanAveragePrecision: number expected"; + return null; + }; + + /** + * Creates an ImageObjectDetectionEvaluationMetrics message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.automl.v1beta1.ImageObjectDetectionEvaluationMetrics + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.automl.v1beta1.ImageObjectDetectionEvaluationMetrics} ImageObjectDetectionEvaluationMetrics + */ + ImageObjectDetectionEvaluationMetrics.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.automl.v1beta1.ImageObjectDetectionEvaluationMetrics) + return object; + var message = new $root.google.cloud.automl.v1beta1.ImageObjectDetectionEvaluationMetrics(); + if (object.evaluatedBoundingBoxCount != null) + message.evaluatedBoundingBoxCount = object.evaluatedBoundingBoxCount | 0; + if (object.boundingBoxMetricsEntries) { + if (!Array.isArray(object.boundingBoxMetricsEntries)) + throw TypeError(".google.cloud.automl.v1beta1.ImageObjectDetectionEvaluationMetrics.boundingBoxMetricsEntries: array expected"); + message.boundingBoxMetricsEntries = []; + for (var i = 0; i < object.boundingBoxMetricsEntries.length; ++i) { + if (typeof object.boundingBoxMetricsEntries[i] !== "object") + throw TypeError(".google.cloud.automl.v1beta1.ImageObjectDetectionEvaluationMetrics.boundingBoxMetricsEntries: object expected"); + message.boundingBoxMetricsEntries[i] = $root.google.cloud.automl.v1beta1.BoundingBoxMetricsEntry.fromObject(object.boundingBoxMetricsEntries[i]); + } + } + if (object.boundingBoxMeanAveragePrecision != null) + message.boundingBoxMeanAveragePrecision = Number(object.boundingBoxMeanAveragePrecision); + return message; + }; + + /** + * Creates a plain object from an ImageObjectDetectionEvaluationMetrics message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.automl.v1beta1.ImageObjectDetectionEvaluationMetrics + * @static + * @param {google.cloud.automl.v1beta1.ImageObjectDetectionEvaluationMetrics} message ImageObjectDetectionEvaluationMetrics + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ImageObjectDetectionEvaluationMetrics.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.boundingBoxMetricsEntries = []; + if (options.defaults) { + object.evaluatedBoundingBoxCount = 0; + object.boundingBoxMeanAveragePrecision = 0; + } + if (message.evaluatedBoundingBoxCount != null && message.hasOwnProperty("evaluatedBoundingBoxCount")) + object.evaluatedBoundingBoxCount = message.evaluatedBoundingBoxCount; + if (message.boundingBoxMetricsEntries && message.boundingBoxMetricsEntries.length) { + object.boundingBoxMetricsEntries = []; + for (var j = 0; j < message.boundingBoxMetricsEntries.length; ++j) + object.boundingBoxMetricsEntries[j] = $root.google.cloud.automl.v1beta1.BoundingBoxMetricsEntry.toObject(message.boundingBoxMetricsEntries[j], options); + } + if (message.boundingBoxMeanAveragePrecision != null && message.hasOwnProperty("boundingBoxMeanAveragePrecision")) + object.boundingBoxMeanAveragePrecision = options.json && !isFinite(message.boundingBoxMeanAveragePrecision) ? String(message.boundingBoxMeanAveragePrecision) : message.boundingBoxMeanAveragePrecision; + return object; + }; + + /** + * Converts this ImageObjectDetectionEvaluationMetrics to JSON. + * @function toJSON + * @memberof google.cloud.automl.v1beta1.ImageObjectDetectionEvaluationMetrics + * @instance + * @returns {Object.} JSON object + */ + ImageObjectDetectionEvaluationMetrics.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ImageObjectDetectionEvaluationMetrics + * @function getTypeUrl + * @memberof google.cloud.automl.v1beta1.ImageObjectDetectionEvaluationMetrics + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ImageObjectDetectionEvaluationMetrics.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.automl.v1beta1.ImageObjectDetectionEvaluationMetrics"; + }; + + return ImageObjectDetectionEvaluationMetrics; + })(); + + v1beta1.VideoObjectTrackingEvaluationMetrics = (function() { + + /** + * Properties of a VideoObjectTrackingEvaluationMetrics. + * @memberof google.cloud.automl.v1beta1 + * @interface IVideoObjectTrackingEvaluationMetrics + * @property {number|null} [evaluatedFrameCount] VideoObjectTrackingEvaluationMetrics evaluatedFrameCount + * @property {number|null} [evaluatedBoundingBoxCount] VideoObjectTrackingEvaluationMetrics evaluatedBoundingBoxCount + * @property {Array.|null} [boundingBoxMetricsEntries] VideoObjectTrackingEvaluationMetrics boundingBoxMetricsEntries + * @property {number|null} [boundingBoxMeanAveragePrecision] VideoObjectTrackingEvaluationMetrics boundingBoxMeanAveragePrecision + */ + + /** + * Constructs a new VideoObjectTrackingEvaluationMetrics. + * @memberof google.cloud.automl.v1beta1 + * @classdesc Represents a VideoObjectTrackingEvaluationMetrics. + * @implements IVideoObjectTrackingEvaluationMetrics + * @constructor + * @param {google.cloud.automl.v1beta1.IVideoObjectTrackingEvaluationMetrics=} [properties] Properties to set + */ + function VideoObjectTrackingEvaluationMetrics(properties) { + this.boundingBoxMetricsEntries = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * VideoObjectTrackingEvaluationMetrics evaluatedFrameCount. + * @member {number} evaluatedFrameCount + * @memberof google.cloud.automl.v1beta1.VideoObjectTrackingEvaluationMetrics + * @instance + */ + VideoObjectTrackingEvaluationMetrics.prototype.evaluatedFrameCount = 0; + + /** + * VideoObjectTrackingEvaluationMetrics evaluatedBoundingBoxCount. + * @member {number} evaluatedBoundingBoxCount + * @memberof google.cloud.automl.v1beta1.VideoObjectTrackingEvaluationMetrics + * @instance + */ + VideoObjectTrackingEvaluationMetrics.prototype.evaluatedBoundingBoxCount = 0; + + /** + * VideoObjectTrackingEvaluationMetrics boundingBoxMetricsEntries. + * @member {Array.} boundingBoxMetricsEntries + * @memberof google.cloud.automl.v1beta1.VideoObjectTrackingEvaluationMetrics + * @instance + */ + VideoObjectTrackingEvaluationMetrics.prototype.boundingBoxMetricsEntries = $util.emptyArray; + + /** + * VideoObjectTrackingEvaluationMetrics boundingBoxMeanAveragePrecision. + * @member {number} boundingBoxMeanAveragePrecision + * @memberof google.cloud.automl.v1beta1.VideoObjectTrackingEvaluationMetrics + * @instance + */ + VideoObjectTrackingEvaluationMetrics.prototype.boundingBoxMeanAveragePrecision = 0; + + /** + * Creates a new VideoObjectTrackingEvaluationMetrics instance using the specified properties. + * @function create + * @memberof google.cloud.automl.v1beta1.VideoObjectTrackingEvaluationMetrics + * @static + * @param {google.cloud.automl.v1beta1.IVideoObjectTrackingEvaluationMetrics=} [properties] Properties to set + * @returns {google.cloud.automl.v1beta1.VideoObjectTrackingEvaluationMetrics} VideoObjectTrackingEvaluationMetrics instance + */ + VideoObjectTrackingEvaluationMetrics.create = function create(properties) { + return new VideoObjectTrackingEvaluationMetrics(properties); + }; + + /** + * Encodes the specified VideoObjectTrackingEvaluationMetrics message. Does not implicitly {@link google.cloud.automl.v1beta1.VideoObjectTrackingEvaluationMetrics.verify|verify} messages. + * @function encode + * @memberof google.cloud.automl.v1beta1.VideoObjectTrackingEvaluationMetrics + * @static + * @param {google.cloud.automl.v1beta1.IVideoObjectTrackingEvaluationMetrics} message VideoObjectTrackingEvaluationMetrics message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + VideoObjectTrackingEvaluationMetrics.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.evaluatedFrameCount != null && Object.hasOwnProperty.call(message, "evaluatedFrameCount")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.evaluatedFrameCount); + if (message.evaluatedBoundingBoxCount != null && Object.hasOwnProperty.call(message, "evaluatedBoundingBoxCount")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.evaluatedBoundingBoxCount); + if (message.boundingBoxMetricsEntries != null && message.boundingBoxMetricsEntries.length) + for (var i = 0; i < message.boundingBoxMetricsEntries.length; ++i) + $root.google.cloud.automl.v1beta1.BoundingBoxMetricsEntry.encode(message.boundingBoxMetricsEntries[i], writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.boundingBoxMeanAveragePrecision != null && Object.hasOwnProperty.call(message, "boundingBoxMeanAveragePrecision")) + writer.uint32(/* id 6, wireType 5 =*/53).float(message.boundingBoxMeanAveragePrecision); + return writer; + }; + + /** + * Encodes the specified VideoObjectTrackingEvaluationMetrics message, length delimited. Does not implicitly {@link google.cloud.automl.v1beta1.VideoObjectTrackingEvaluationMetrics.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.automl.v1beta1.VideoObjectTrackingEvaluationMetrics + * @static + * @param {google.cloud.automl.v1beta1.IVideoObjectTrackingEvaluationMetrics} message VideoObjectTrackingEvaluationMetrics message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + VideoObjectTrackingEvaluationMetrics.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a VideoObjectTrackingEvaluationMetrics message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.automl.v1beta1.VideoObjectTrackingEvaluationMetrics + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.automl.v1beta1.VideoObjectTrackingEvaluationMetrics} VideoObjectTrackingEvaluationMetrics + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + VideoObjectTrackingEvaluationMetrics.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.automl.v1beta1.VideoObjectTrackingEvaluationMetrics(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.evaluatedFrameCount = reader.int32(); + break; + } + case 2: { + message.evaluatedBoundingBoxCount = reader.int32(); + break; + } + case 4: { + if (!(message.boundingBoxMetricsEntries && message.boundingBoxMetricsEntries.length)) + message.boundingBoxMetricsEntries = []; + message.boundingBoxMetricsEntries.push($root.google.cloud.automl.v1beta1.BoundingBoxMetricsEntry.decode(reader, reader.uint32())); + break; + } + case 6: { + message.boundingBoxMeanAveragePrecision = reader.float(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a VideoObjectTrackingEvaluationMetrics message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.automl.v1beta1.VideoObjectTrackingEvaluationMetrics + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.automl.v1beta1.VideoObjectTrackingEvaluationMetrics} VideoObjectTrackingEvaluationMetrics + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + VideoObjectTrackingEvaluationMetrics.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a VideoObjectTrackingEvaluationMetrics message. + * @function verify + * @memberof google.cloud.automl.v1beta1.VideoObjectTrackingEvaluationMetrics + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + VideoObjectTrackingEvaluationMetrics.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.evaluatedFrameCount != null && message.hasOwnProperty("evaluatedFrameCount")) + if (!$util.isInteger(message.evaluatedFrameCount)) + return "evaluatedFrameCount: integer expected"; + if (message.evaluatedBoundingBoxCount != null && message.hasOwnProperty("evaluatedBoundingBoxCount")) + if (!$util.isInteger(message.evaluatedBoundingBoxCount)) + return "evaluatedBoundingBoxCount: integer expected"; + if (message.boundingBoxMetricsEntries != null && message.hasOwnProperty("boundingBoxMetricsEntries")) { + if (!Array.isArray(message.boundingBoxMetricsEntries)) + return "boundingBoxMetricsEntries: array expected"; + for (var i = 0; i < message.boundingBoxMetricsEntries.length; ++i) { + var error = $root.google.cloud.automl.v1beta1.BoundingBoxMetricsEntry.verify(message.boundingBoxMetricsEntries[i]); + if (error) + return "boundingBoxMetricsEntries." + error; + } + } + if (message.boundingBoxMeanAveragePrecision != null && message.hasOwnProperty("boundingBoxMeanAveragePrecision")) + if (typeof message.boundingBoxMeanAveragePrecision !== "number") + return "boundingBoxMeanAveragePrecision: number expected"; + return null; + }; + + /** + * Creates a VideoObjectTrackingEvaluationMetrics message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.automl.v1beta1.VideoObjectTrackingEvaluationMetrics + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.automl.v1beta1.VideoObjectTrackingEvaluationMetrics} VideoObjectTrackingEvaluationMetrics + */ + VideoObjectTrackingEvaluationMetrics.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.automl.v1beta1.VideoObjectTrackingEvaluationMetrics) + return object; + var message = new $root.google.cloud.automl.v1beta1.VideoObjectTrackingEvaluationMetrics(); + if (object.evaluatedFrameCount != null) + message.evaluatedFrameCount = object.evaluatedFrameCount | 0; + if (object.evaluatedBoundingBoxCount != null) + message.evaluatedBoundingBoxCount = object.evaluatedBoundingBoxCount | 0; + if (object.boundingBoxMetricsEntries) { + if (!Array.isArray(object.boundingBoxMetricsEntries)) + throw TypeError(".google.cloud.automl.v1beta1.VideoObjectTrackingEvaluationMetrics.boundingBoxMetricsEntries: array expected"); + message.boundingBoxMetricsEntries = []; + for (var i = 0; i < object.boundingBoxMetricsEntries.length; ++i) { + if (typeof object.boundingBoxMetricsEntries[i] !== "object") + throw TypeError(".google.cloud.automl.v1beta1.VideoObjectTrackingEvaluationMetrics.boundingBoxMetricsEntries: object expected"); + message.boundingBoxMetricsEntries[i] = $root.google.cloud.automl.v1beta1.BoundingBoxMetricsEntry.fromObject(object.boundingBoxMetricsEntries[i]); + } + } + if (object.boundingBoxMeanAveragePrecision != null) + message.boundingBoxMeanAveragePrecision = Number(object.boundingBoxMeanAveragePrecision); + return message; + }; + + /** + * Creates a plain object from a VideoObjectTrackingEvaluationMetrics message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.automl.v1beta1.VideoObjectTrackingEvaluationMetrics + * @static + * @param {google.cloud.automl.v1beta1.VideoObjectTrackingEvaluationMetrics} message VideoObjectTrackingEvaluationMetrics + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + VideoObjectTrackingEvaluationMetrics.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.boundingBoxMetricsEntries = []; + if (options.defaults) { + object.evaluatedFrameCount = 0; + object.evaluatedBoundingBoxCount = 0; + object.boundingBoxMeanAveragePrecision = 0; + } + if (message.evaluatedFrameCount != null && message.hasOwnProperty("evaluatedFrameCount")) + object.evaluatedFrameCount = message.evaluatedFrameCount; + if (message.evaluatedBoundingBoxCount != null && message.hasOwnProperty("evaluatedBoundingBoxCount")) + object.evaluatedBoundingBoxCount = message.evaluatedBoundingBoxCount; + if (message.boundingBoxMetricsEntries && message.boundingBoxMetricsEntries.length) { + object.boundingBoxMetricsEntries = []; + for (var j = 0; j < message.boundingBoxMetricsEntries.length; ++j) + object.boundingBoxMetricsEntries[j] = $root.google.cloud.automl.v1beta1.BoundingBoxMetricsEntry.toObject(message.boundingBoxMetricsEntries[j], options); + } + if (message.boundingBoxMeanAveragePrecision != null && message.hasOwnProperty("boundingBoxMeanAveragePrecision")) + object.boundingBoxMeanAveragePrecision = options.json && !isFinite(message.boundingBoxMeanAveragePrecision) ? String(message.boundingBoxMeanAveragePrecision) : message.boundingBoxMeanAveragePrecision; + return object; + }; + + /** + * Converts this VideoObjectTrackingEvaluationMetrics to JSON. + * @function toJSON + * @memberof google.cloud.automl.v1beta1.VideoObjectTrackingEvaluationMetrics + * @instance + * @returns {Object.} JSON object + */ + VideoObjectTrackingEvaluationMetrics.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for VideoObjectTrackingEvaluationMetrics + * @function getTypeUrl + * @memberof google.cloud.automl.v1beta1.VideoObjectTrackingEvaluationMetrics + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + VideoObjectTrackingEvaluationMetrics.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.automl.v1beta1.VideoObjectTrackingEvaluationMetrics"; + }; + + return VideoObjectTrackingEvaluationMetrics; + })(); + + v1beta1.NormalizedVertex = (function() { + + /** + * Properties of a NormalizedVertex. + * @memberof google.cloud.automl.v1beta1 + * @interface INormalizedVertex + * @property {number|null} [x] NormalizedVertex x + * @property {number|null} [y] NormalizedVertex y + */ + + /** + * Constructs a new NormalizedVertex. + * @memberof google.cloud.automl.v1beta1 + * @classdesc Represents a NormalizedVertex. + * @implements INormalizedVertex + * @constructor + * @param {google.cloud.automl.v1beta1.INormalizedVertex=} [properties] Properties to set + */ + function NormalizedVertex(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * NormalizedVertex x. + * @member {number} x + * @memberof google.cloud.automl.v1beta1.NormalizedVertex + * @instance + */ + NormalizedVertex.prototype.x = 0; + + /** + * NormalizedVertex y. + * @member {number} y + * @memberof google.cloud.automl.v1beta1.NormalizedVertex + * @instance + */ + NormalizedVertex.prototype.y = 0; + + /** + * Creates a new NormalizedVertex instance using the specified properties. + * @function create + * @memberof google.cloud.automl.v1beta1.NormalizedVertex + * @static + * @param {google.cloud.automl.v1beta1.INormalizedVertex=} [properties] Properties to set + * @returns {google.cloud.automl.v1beta1.NormalizedVertex} NormalizedVertex instance + */ + NormalizedVertex.create = function create(properties) { + return new NormalizedVertex(properties); + }; + + /** + * Encodes the specified NormalizedVertex message. Does not implicitly {@link google.cloud.automl.v1beta1.NormalizedVertex.verify|verify} messages. + * @function encode + * @memberof google.cloud.automl.v1beta1.NormalizedVertex + * @static + * @param {google.cloud.automl.v1beta1.INormalizedVertex} message NormalizedVertex message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + NormalizedVertex.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.x != null && Object.hasOwnProperty.call(message, "x")) + writer.uint32(/* id 1, wireType 5 =*/13).float(message.x); + if (message.y != null && Object.hasOwnProperty.call(message, "y")) + writer.uint32(/* id 2, wireType 5 =*/21).float(message.y); + return writer; + }; + + /** + * Encodes the specified NormalizedVertex message, length delimited. Does not implicitly {@link google.cloud.automl.v1beta1.NormalizedVertex.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.automl.v1beta1.NormalizedVertex + * @static + * @param {google.cloud.automl.v1beta1.INormalizedVertex} message NormalizedVertex message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + NormalizedVertex.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a NormalizedVertex message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.automl.v1beta1.NormalizedVertex + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.automl.v1beta1.NormalizedVertex} NormalizedVertex + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + NormalizedVertex.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.automl.v1beta1.NormalizedVertex(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.x = reader.float(); + break; + } + case 2: { + message.y = reader.float(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a NormalizedVertex message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.automl.v1beta1.NormalizedVertex + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.automl.v1beta1.NormalizedVertex} NormalizedVertex + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + NormalizedVertex.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a NormalizedVertex message. + * @function verify + * @memberof google.cloud.automl.v1beta1.NormalizedVertex + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + NormalizedVertex.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.x != null && message.hasOwnProperty("x")) + if (typeof message.x !== "number") + return "x: number expected"; + if (message.y != null && message.hasOwnProperty("y")) + if (typeof message.y !== "number") + return "y: number expected"; + return null; + }; + + /** + * Creates a NormalizedVertex message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.automl.v1beta1.NormalizedVertex + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.automl.v1beta1.NormalizedVertex} NormalizedVertex + */ + NormalizedVertex.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.automl.v1beta1.NormalizedVertex) + return object; + var message = new $root.google.cloud.automl.v1beta1.NormalizedVertex(); + if (object.x != null) + message.x = Number(object.x); + if (object.y != null) + message.y = Number(object.y); + return message; + }; + + /** + * Creates a plain object from a NormalizedVertex message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.automl.v1beta1.NormalizedVertex + * @static + * @param {google.cloud.automl.v1beta1.NormalizedVertex} message NormalizedVertex + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + NormalizedVertex.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.x = 0; + object.y = 0; + } + if (message.x != null && message.hasOwnProperty("x")) + object.x = options.json && !isFinite(message.x) ? String(message.x) : message.x; + if (message.y != null && message.hasOwnProperty("y")) + object.y = options.json && !isFinite(message.y) ? String(message.y) : message.y; + return object; + }; + + /** + * Converts this NormalizedVertex to JSON. + * @function toJSON + * @memberof google.cloud.automl.v1beta1.NormalizedVertex + * @instance + * @returns {Object.} JSON object + */ + NormalizedVertex.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for NormalizedVertex + * @function getTypeUrl + * @memberof google.cloud.automl.v1beta1.NormalizedVertex + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + NormalizedVertex.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.automl.v1beta1.NormalizedVertex"; + }; + + return NormalizedVertex; + })(); + + v1beta1.BoundingPoly = (function() { + + /** + * Properties of a BoundingPoly. + * @memberof google.cloud.automl.v1beta1 + * @interface IBoundingPoly + * @property {Array.|null} [normalizedVertices] BoundingPoly normalizedVertices + */ + + /** + * Constructs a new BoundingPoly. + * @memberof google.cloud.automl.v1beta1 + * @classdesc Represents a BoundingPoly. + * @implements IBoundingPoly + * @constructor + * @param {google.cloud.automl.v1beta1.IBoundingPoly=} [properties] Properties to set + */ + function BoundingPoly(properties) { + this.normalizedVertices = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * BoundingPoly normalizedVertices. + * @member {Array.} normalizedVertices + * @memberof google.cloud.automl.v1beta1.BoundingPoly + * @instance + */ + BoundingPoly.prototype.normalizedVertices = $util.emptyArray; + + /** + * Creates a new BoundingPoly instance using the specified properties. + * @function create + * @memberof google.cloud.automl.v1beta1.BoundingPoly + * @static + * @param {google.cloud.automl.v1beta1.IBoundingPoly=} [properties] Properties to set + * @returns {google.cloud.automl.v1beta1.BoundingPoly} BoundingPoly instance + */ + BoundingPoly.create = function create(properties) { + return new BoundingPoly(properties); + }; + + /** + * Encodes the specified BoundingPoly message. Does not implicitly {@link google.cloud.automl.v1beta1.BoundingPoly.verify|verify} messages. + * @function encode + * @memberof google.cloud.automl.v1beta1.BoundingPoly + * @static + * @param {google.cloud.automl.v1beta1.IBoundingPoly} message BoundingPoly message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BoundingPoly.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.normalizedVertices != null && message.normalizedVertices.length) + for (var i = 0; i < message.normalizedVertices.length; ++i) + $root.google.cloud.automl.v1beta1.NormalizedVertex.encode(message.normalizedVertices[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified BoundingPoly message, length delimited. Does not implicitly {@link google.cloud.automl.v1beta1.BoundingPoly.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.automl.v1beta1.BoundingPoly + * @static + * @param {google.cloud.automl.v1beta1.IBoundingPoly} message BoundingPoly message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BoundingPoly.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a BoundingPoly message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.automl.v1beta1.BoundingPoly + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.automl.v1beta1.BoundingPoly} BoundingPoly + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BoundingPoly.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.automl.v1beta1.BoundingPoly(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 2: { + if (!(message.normalizedVertices && message.normalizedVertices.length)) + message.normalizedVertices = []; + message.normalizedVertices.push($root.google.cloud.automl.v1beta1.NormalizedVertex.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a BoundingPoly message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.automl.v1beta1.BoundingPoly + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.automl.v1beta1.BoundingPoly} BoundingPoly + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BoundingPoly.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a BoundingPoly message. + * @function verify + * @memberof google.cloud.automl.v1beta1.BoundingPoly + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + BoundingPoly.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.normalizedVertices != null && message.hasOwnProperty("normalizedVertices")) { + if (!Array.isArray(message.normalizedVertices)) + return "normalizedVertices: array expected"; + for (var i = 0; i < message.normalizedVertices.length; ++i) { + var error = $root.google.cloud.automl.v1beta1.NormalizedVertex.verify(message.normalizedVertices[i]); + if (error) + return "normalizedVertices." + error; + } + } + return null; + }; + + /** + * Creates a BoundingPoly message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.automl.v1beta1.BoundingPoly + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.automl.v1beta1.BoundingPoly} BoundingPoly + */ + BoundingPoly.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.automl.v1beta1.BoundingPoly) + return object; + var message = new $root.google.cloud.automl.v1beta1.BoundingPoly(); + if (object.normalizedVertices) { + if (!Array.isArray(object.normalizedVertices)) + throw TypeError(".google.cloud.automl.v1beta1.BoundingPoly.normalizedVertices: array expected"); + message.normalizedVertices = []; + for (var i = 0; i < object.normalizedVertices.length; ++i) { + if (typeof object.normalizedVertices[i] !== "object") + throw TypeError(".google.cloud.automl.v1beta1.BoundingPoly.normalizedVertices: object expected"); + message.normalizedVertices[i] = $root.google.cloud.automl.v1beta1.NormalizedVertex.fromObject(object.normalizedVertices[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a BoundingPoly message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.automl.v1beta1.BoundingPoly + * @static + * @param {google.cloud.automl.v1beta1.BoundingPoly} message BoundingPoly + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + BoundingPoly.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.normalizedVertices = []; + if (message.normalizedVertices && message.normalizedVertices.length) { + object.normalizedVertices = []; + for (var j = 0; j < message.normalizedVertices.length; ++j) + object.normalizedVertices[j] = $root.google.cloud.automl.v1beta1.NormalizedVertex.toObject(message.normalizedVertices[j], options); + } + return object; + }; + + /** + * Converts this BoundingPoly to JSON. + * @function toJSON + * @memberof google.cloud.automl.v1beta1.BoundingPoly + * @instance + * @returns {Object.} JSON object + */ + BoundingPoly.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for BoundingPoly + * @function getTypeUrl + * @memberof google.cloud.automl.v1beta1.BoundingPoly + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + BoundingPoly.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.automl.v1beta1.BoundingPoly"; + }; + + return BoundingPoly; + })(); + + v1beta1.TablesDatasetMetadata = (function() { + + /** + * Properties of a TablesDatasetMetadata. + * @memberof google.cloud.automl.v1beta1 + * @interface ITablesDatasetMetadata + * @property {string|null} [primaryTableSpecId] TablesDatasetMetadata primaryTableSpecId + * @property {string|null} [targetColumnSpecId] TablesDatasetMetadata targetColumnSpecId + * @property {string|null} [weightColumnSpecId] TablesDatasetMetadata weightColumnSpecId + * @property {string|null} [mlUseColumnSpecId] TablesDatasetMetadata mlUseColumnSpecId + * @property {Object.|null} [targetColumnCorrelations] TablesDatasetMetadata targetColumnCorrelations + * @property {google.protobuf.ITimestamp|null} [statsUpdateTime] TablesDatasetMetadata statsUpdateTime + */ + + /** + * Constructs a new TablesDatasetMetadata. + * @memberof google.cloud.automl.v1beta1 + * @classdesc Represents a TablesDatasetMetadata. + * @implements ITablesDatasetMetadata + * @constructor + * @param {google.cloud.automl.v1beta1.ITablesDatasetMetadata=} [properties] Properties to set + */ + function TablesDatasetMetadata(properties) { + this.targetColumnCorrelations = {}; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * TablesDatasetMetadata primaryTableSpecId. + * @member {string} primaryTableSpecId + * @memberof google.cloud.automl.v1beta1.TablesDatasetMetadata + * @instance + */ + TablesDatasetMetadata.prototype.primaryTableSpecId = ""; + + /** + * TablesDatasetMetadata targetColumnSpecId. + * @member {string} targetColumnSpecId + * @memberof google.cloud.automl.v1beta1.TablesDatasetMetadata + * @instance + */ + TablesDatasetMetadata.prototype.targetColumnSpecId = ""; + + /** + * TablesDatasetMetadata weightColumnSpecId. + * @member {string} weightColumnSpecId + * @memberof google.cloud.automl.v1beta1.TablesDatasetMetadata + * @instance + */ + TablesDatasetMetadata.prototype.weightColumnSpecId = ""; + + /** + * TablesDatasetMetadata mlUseColumnSpecId. + * @member {string} mlUseColumnSpecId + * @memberof google.cloud.automl.v1beta1.TablesDatasetMetadata + * @instance + */ + TablesDatasetMetadata.prototype.mlUseColumnSpecId = ""; + + /** + * TablesDatasetMetadata targetColumnCorrelations. + * @member {Object.} targetColumnCorrelations + * @memberof google.cloud.automl.v1beta1.TablesDatasetMetadata + * @instance + */ + TablesDatasetMetadata.prototype.targetColumnCorrelations = $util.emptyObject; + + /** + * TablesDatasetMetadata statsUpdateTime. + * @member {google.protobuf.ITimestamp|null|undefined} statsUpdateTime + * @memberof google.cloud.automl.v1beta1.TablesDatasetMetadata + * @instance + */ + TablesDatasetMetadata.prototype.statsUpdateTime = null; + + /** + * Creates a new TablesDatasetMetadata instance using the specified properties. + * @function create + * @memberof google.cloud.automl.v1beta1.TablesDatasetMetadata + * @static + * @param {google.cloud.automl.v1beta1.ITablesDatasetMetadata=} [properties] Properties to set + * @returns {google.cloud.automl.v1beta1.TablesDatasetMetadata} TablesDatasetMetadata instance + */ + TablesDatasetMetadata.create = function create(properties) { + return new TablesDatasetMetadata(properties); + }; + + /** + * Encodes the specified TablesDatasetMetadata message. Does not implicitly {@link google.cloud.automl.v1beta1.TablesDatasetMetadata.verify|verify} messages. + * @function encode + * @memberof google.cloud.automl.v1beta1.TablesDatasetMetadata + * @static + * @param {google.cloud.automl.v1beta1.ITablesDatasetMetadata} message TablesDatasetMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TablesDatasetMetadata.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.primaryTableSpecId != null && Object.hasOwnProperty.call(message, "primaryTableSpecId")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.primaryTableSpecId); + if (message.targetColumnSpecId != null && Object.hasOwnProperty.call(message, "targetColumnSpecId")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.targetColumnSpecId); + if (message.weightColumnSpecId != null && Object.hasOwnProperty.call(message, "weightColumnSpecId")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.weightColumnSpecId); + if (message.mlUseColumnSpecId != null && Object.hasOwnProperty.call(message, "mlUseColumnSpecId")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.mlUseColumnSpecId); + if (message.targetColumnCorrelations != null && Object.hasOwnProperty.call(message, "targetColumnCorrelations")) + for (var keys = Object.keys(message.targetColumnCorrelations), i = 0; i < keys.length; ++i) { + writer.uint32(/* id 6, wireType 2 =*/50).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]); + $root.google.cloud.automl.v1beta1.CorrelationStats.encode(message.targetColumnCorrelations[keys[i]], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim().ldelim(); + } + if (message.statsUpdateTime != null && Object.hasOwnProperty.call(message, "statsUpdateTime")) + $root.google.protobuf.Timestamp.encode(message.statsUpdateTime, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified TablesDatasetMetadata message, length delimited. Does not implicitly {@link google.cloud.automl.v1beta1.TablesDatasetMetadata.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.automl.v1beta1.TablesDatasetMetadata + * @static + * @param {google.cloud.automl.v1beta1.ITablesDatasetMetadata} message TablesDatasetMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TablesDatasetMetadata.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a TablesDatasetMetadata message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.automl.v1beta1.TablesDatasetMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.automl.v1beta1.TablesDatasetMetadata} TablesDatasetMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TablesDatasetMetadata.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.automl.v1beta1.TablesDatasetMetadata(), key, value; + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.primaryTableSpecId = reader.string(); + break; + } + case 2: { + message.targetColumnSpecId = reader.string(); + break; + } + case 3: { + message.weightColumnSpecId = reader.string(); + break; + } + case 4: { + message.mlUseColumnSpecId = reader.string(); + break; + } + case 6: { + if (message.targetColumnCorrelations === $util.emptyObject) + message.targetColumnCorrelations = {}; + 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.automl.v1beta1.CorrelationStats.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag2 & 7); + break; + } + } + message.targetColumnCorrelations[key] = value; + break; + } + case 7: { + message.statsUpdateTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a TablesDatasetMetadata message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.automl.v1beta1.TablesDatasetMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.automl.v1beta1.TablesDatasetMetadata} TablesDatasetMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TablesDatasetMetadata.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a TablesDatasetMetadata message. + * @function verify + * @memberof google.cloud.automl.v1beta1.TablesDatasetMetadata + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + TablesDatasetMetadata.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.primaryTableSpecId != null && message.hasOwnProperty("primaryTableSpecId")) + if (!$util.isString(message.primaryTableSpecId)) + return "primaryTableSpecId: string expected"; + if (message.targetColumnSpecId != null && message.hasOwnProperty("targetColumnSpecId")) + if (!$util.isString(message.targetColumnSpecId)) + return "targetColumnSpecId: string expected"; + if (message.weightColumnSpecId != null && message.hasOwnProperty("weightColumnSpecId")) + if (!$util.isString(message.weightColumnSpecId)) + return "weightColumnSpecId: string expected"; + if (message.mlUseColumnSpecId != null && message.hasOwnProperty("mlUseColumnSpecId")) + if (!$util.isString(message.mlUseColumnSpecId)) + return "mlUseColumnSpecId: string expected"; + if (message.targetColumnCorrelations != null && message.hasOwnProperty("targetColumnCorrelations")) { + if (!$util.isObject(message.targetColumnCorrelations)) + return "targetColumnCorrelations: object expected"; + var key = Object.keys(message.targetColumnCorrelations); + for (var i = 0; i < key.length; ++i) { + var error = $root.google.cloud.automl.v1beta1.CorrelationStats.verify(message.targetColumnCorrelations[key[i]]); + if (error) + return "targetColumnCorrelations." + error; + } + } + if (message.statsUpdateTime != null && message.hasOwnProperty("statsUpdateTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.statsUpdateTime); + if (error) + return "statsUpdateTime." + error; + } + return null; + }; + + /** + * Creates a TablesDatasetMetadata message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.automl.v1beta1.TablesDatasetMetadata + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.automl.v1beta1.TablesDatasetMetadata} TablesDatasetMetadata + */ + TablesDatasetMetadata.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.automl.v1beta1.TablesDatasetMetadata) + return object; + var message = new $root.google.cloud.automl.v1beta1.TablesDatasetMetadata(); + if (object.primaryTableSpecId != null) + message.primaryTableSpecId = String(object.primaryTableSpecId); + if (object.targetColumnSpecId != null) + message.targetColumnSpecId = String(object.targetColumnSpecId); + if (object.weightColumnSpecId != null) + message.weightColumnSpecId = String(object.weightColumnSpecId); + if (object.mlUseColumnSpecId != null) + message.mlUseColumnSpecId = String(object.mlUseColumnSpecId); + if (object.targetColumnCorrelations) { + if (typeof object.targetColumnCorrelations !== "object") + throw TypeError(".google.cloud.automl.v1beta1.TablesDatasetMetadata.targetColumnCorrelations: object expected"); + message.targetColumnCorrelations = {}; + for (var keys = Object.keys(object.targetColumnCorrelations), i = 0; i < keys.length; ++i) { + if (typeof object.targetColumnCorrelations[keys[i]] !== "object") + throw TypeError(".google.cloud.automl.v1beta1.TablesDatasetMetadata.targetColumnCorrelations: object expected"); + message.targetColumnCorrelations[keys[i]] = $root.google.cloud.automl.v1beta1.CorrelationStats.fromObject(object.targetColumnCorrelations[keys[i]]); + } + } + if (object.statsUpdateTime != null) { + if (typeof object.statsUpdateTime !== "object") + throw TypeError(".google.cloud.automl.v1beta1.TablesDatasetMetadata.statsUpdateTime: object expected"); + message.statsUpdateTime = $root.google.protobuf.Timestamp.fromObject(object.statsUpdateTime); + } + return message; + }; + + /** + * Creates a plain object from a TablesDatasetMetadata message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.automl.v1beta1.TablesDatasetMetadata + * @static + * @param {google.cloud.automl.v1beta1.TablesDatasetMetadata} message TablesDatasetMetadata + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + TablesDatasetMetadata.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.objects || options.defaults) + object.targetColumnCorrelations = {}; + if (options.defaults) { + object.primaryTableSpecId = ""; + object.targetColumnSpecId = ""; + object.weightColumnSpecId = ""; + object.mlUseColumnSpecId = ""; + object.statsUpdateTime = null; + } + if (message.primaryTableSpecId != null && message.hasOwnProperty("primaryTableSpecId")) + object.primaryTableSpecId = message.primaryTableSpecId; + if (message.targetColumnSpecId != null && message.hasOwnProperty("targetColumnSpecId")) + object.targetColumnSpecId = message.targetColumnSpecId; + if (message.weightColumnSpecId != null && message.hasOwnProperty("weightColumnSpecId")) + object.weightColumnSpecId = message.weightColumnSpecId; + if (message.mlUseColumnSpecId != null && message.hasOwnProperty("mlUseColumnSpecId")) + object.mlUseColumnSpecId = message.mlUseColumnSpecId; + var keys2; + if (message.targetColumnCorrelations && (keys2 = Object.keys(message.targetColumnCorrelations)).length) { + object.targetColumnCorrelations = {}; + for (var j = 0; j < keys2.length; ++j) + object.targetColumnCorrelations[keys2[j]] = $root.google.cloud.automl.v1beta1.CorrelationStats.toObject(message.targetColumnCorrelations[keys2[j]], options); + } + if (message.statsUpdateTime != null && message.hasOwnProperty("statsUpdateTime")) + object.statsUpdateTime = $root.google.protobuf.Timestamp.toObject(message.statsUpdateTime, options); + return object; + }; + + /** + * Converts this TablesDatasetMetadata to JSON. + * @function toJSON + * @memberof google.cloud.automl.v1beta1.TablesDatasetMetadata + * @instance + * @returns {Object.} JSON object + */ + TablesDatasetMetadata.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for TablesDatasetMetadata + * @function getTypeUrl + * @memberof google.cloud.automl.v1beta1.TablesDatasetMetadata + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TablesDatasetMetadata.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.automl.v1beta1.TablesDatasetMetadata"; + }; + + return TablesDatasetMetadata; + })(); + + v1beta1.TablesModelMetadata = (function() { + + /** + * Properties of a TablesModelMetadata. + * @memberof google.cloud.automl.v1beta1 + * @interface ITablesModelMetadata + * @property {number|null} [optimizationObjectiveRecallValue] TablesModelMetadata optimizationObjectiveRecallValue + * @property {number|null} [optimizationObjectivePrecisionValue] TablesModelMetadata optimizationObjectivePrecisionValue + * @property {google.cloud.automl.v1beta1.IColumnSpec|null} [targetColumnSpec] TablesModelMetadata targetColumnSpec + * @property {Array.|null} [inputFeatureColumnSpecs] TablesModelMetadata inputFeatureColumnSpecs + * @property {string|null} [optimizationObjective] TablesModelMetadata optimizationObjective + * @property {Array.|null} [tablesModelColumnInfo] TablesModelMetadata tablesModelColumnInfo + * @property {number|Long|null} [trainBudgetMilliNodeHours] TablesModelMetadata trainBudgetMilliNodeHours + * @property {number|Long|null} [trainCostMilliNodeHours] TablesModelMetadata trainCostMilliNodeHours + * @property {boolean|null} [disableEarlyStopping] TablesModelMetadata disableEarlyStopping + */ + + /** + * Constructs a new TablesModelMetadata. + * @memberof google.cloud.automl.v1beta1 + * @classdesc Represents a TablesModelMetadata. + * @implements ITablesModelMetadata + * @constructor + * @param {google.cloud.automl.v1beta1.ITablesModelMetadata=} [properties] Properties to set + */ + function TablesModelMetadata(properties) { + this.inputFeatureColumnSpecs = []; + this.tablesModelColumnInfo = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * TablesModelMetadata optimizationObjectiveRecallValue. + * @member {number|null|undefined} optimizationObjectiveRecallValue + * @memberof google.cloud.automl.v1beta1.TablesModelMetadata + * @instance + */ + TablesModelMetadata.prototype.optimizationObjectiveRecallValue = null; + + /** + * TablesModelMetadata optimizationObjectivePrecisionValue. + * @member {number|null|undefined} optimizationObjectivePrecisionValue + * @memberof google.cloud.automl.v1beta1.TablesModelMetadata + * @instance + */ + TablesModelMetadata.prototype.optimizationObjectivePrecisionValue = null; + + /** + * TablesModelMetadata targetColumnSpec. + * @member {google.cloud.automl.v1beta1.IColumnSpec|null|undefined} targetColumnSpec + * @memberof google.cloud.automl.v1beta1.TablesModelMetadata + * @instance + */ + TablesModelMetadata.prototype.targetColumnSpec = null; + + /** + * TablesModelMetadata inputFeatureColumnSpecs. + * @member {Array.} inputFeatureColumnSpecs + * @memberof google.cloud.automl.v1beta1.TablesModelMetadata + * @instance + */ + TablesModelMetadata.prototype.inputFeatureColumnSpecs = $util.emptyArray; + + /** + * TablesModelMetadata optimizationObjective. + * @member {string} optimizationObjective + * @memberof google.cloud.automl.v1beta1.TablesModelMetadata + * @instance + */ + TablesModelMetadata.prototype.optimizationObjective = ""; + + /** + * TablesModelMetadata tablesModelColumnInfo. + * @member {Array.} tablesModelColumnInfo + * @memberof google.cloud.automl.v1beta1.TablesModelMetadata + * @instance + */ + TablesModelMetadata.prototype.tablesModelColumnInfo = $util.emptyArray; + + /** + * TablesModelMetadata trainBudgetMilliNodeHours. + * @member {number|Long} trainBudgetMilliNodeHours + * @memberof google.cloud.automl.v1beta1.TablesModelMetadata + * @instance + */ + TablesModelMetadata.prototype.trainBudgetMilliNodeHours = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * TablesModelMetadata trainCostMilliNodeHours. + * @member {number|Long} trainCostMilliNodeHours + * @memberof google.cloud.automl.v1beta1.TablesModelMetadata + * @instance + */ + TablesModelMetadata.prototype.trainCostMilliNodeHours = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * TablesModelMetadata disableEarlyStopping. + * @member {boolean} disableEarlyStopping + * @memberof google.cloud.automl.v1beta1.TablesModelMetadata + * @instance + */ + TablesModelMetadata.prototype.disableEarlyStopping = false; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * TablesModelMetadata additionalOptimizationObjectiveConfig. + * @member {"optimizationObjectiveRecallValue"|"optimizationObjectivePrecisionValue"|undefined} additionalOptimizationObjectiveConfig + * @memberof google.cloud.automl.v1beta1.TablesModelMetadata + * @instance + */ + Object.defineProperty(TablesModelMetadata.prototype, "additionalOptimizationObjectiveConfig", { + get: $util.oneOfGetter($oneOfFields = ["optimizationObjectiveRecallValue", "optimizationObjectivePrecisionValue"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new TablesModelMetadata instance using the specified properties. + * @function create + * @memberof google.cloud.automl.v1beta1.TablesModelMetadata + * @static + * @param {google.cloud.automl.v1beta1.ITablesModelMetadata=} [properties] Properties to set + * @returns {google.cloud.automl.v1beta1.TablesModelMetadata} TablesModelMetadata instance + */ + TablesModelMetadata.create = function create(properties) { + return new TablesModelMetadata(properties); + }; + + /** + * Encodes the specified TablesModelMetadata message. Does not implicitly {@link google.cloud.automl.v1beta1.TablesModelMetadata.verify|verify} messages. + * @function encode + * @memberof google.cloud.automl.v1beta1.TablesModelMetadata + * @static + * @param {google.cloud.automl.v1beta1.ITablesModelMetadata} message TablesModelMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TablesModelMetadata.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.targetColumnSpec != null && Object.hasOwnProperty.call(message, "targetColumnSpec")) + $root.google.cloud.automl.v1beta1.ColumnSpec.encode(message.targetColumnSpec, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.inputFeatureColumnSpecs != null && message.inputFeatureColumnSpecs.length) + for (var i = 0; i < message.inputFeatureColumnSpecs.length; ++i) + $root.google.cloud.automl.v1beta1.ColumnSpec.encode(message.inputFeatureColumnSpecs[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.optimizationObjective != null && Object.hasOwnProperty.call(message, "optimizationObjective")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.optimizationObjective); + if (message.tablesModelColumnInfo != null && message.tablesModelColumnInfo.length) + for (var i = 0; i < message.tablesModelColumnInfo.length; ++i) + $root.google.cloud.automl.v1beta1.TablesModelColumnInfo.encode(message.tablesModelColumnInfo[i], writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.trainBudgetMilliNodeHours != null && Object.hasOwnProperty.call(message, "trainBudgetMilliNodeHours")) + writer.uint32(/* id 6, wireType 0 =*/48).int64(message.trainBudgetMilliNodeHours); + if (message.trainCostMilliNodeHours != null && Object.hasOwnProperty.call(message, "trainCostMilliNodeHours")) + writer.uint32(/* id 7, wireType 0 =*/56).int64(message.trainCostMilliNodeHours); + if (message.disableEarlyStopping != null && Object.hasOwnProperty.call(message, "disableEarlyStopping")) + writer.uint32(/* id 12, wireType 0 =*/96).bool(message.disableEarlyStopping); + if (message.optimizationObjectiveRecallValue != null && Object.hasOwnProperty.call(message, "optimizationObjectiveRecallValue")) + writer.uint32(/* id 17, wireType 5 =*/141).float(message.optimizationObjectiveRecallValue); + if (message.optimizationObjectivePrecisionValue != null && Object.hasOwnProperty.call(message, "optimizationObjectivePrecisionValue")) + writer.uint32(/* id 18, wireType 5 =*/149).float(message.optimizationObjectivePrecisionValue); + return writer; + }; + + /** + * Encodes the specified TablesModelMetadata message, length delimited. Does not implicitly {@link google.cloud.automl.v1beta1.TablesModelMetadata.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.automl.v1beta1.TablesModelMetadata + * @static + * @param {google.cloud.automl.v1beta1.ITablesModelMetadata} message TablesModelMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TablesModelMetadata.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a TablesModelMetadata message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.automl.v1beta1.TablesModelMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.automl.v1beta1.TablesModelMetadata} TablesModelMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TablesModelMetadata.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.automl.v1beta1.TablesModelMetadata(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 17: { + message.optimizationObjectiveRecallValue = reader.float(); + break; + } + case 18: { + message.optimizationObjectivePrecisionValue = reader.float(); + break; + } + case 2: { + message.targetColumnSpec = $root.google.cloud.automl.v1beta1.ColumnSpec.decode(reader, reader.uint32()); + break; + } + case 3: { + if (!(message.inputFeatureColumnSpecs && message.inputFeatureColumnSpecs.length)) + message.inputFeatureColumnSpecs = []; + message.inputFeatureColumnSpecs.push($root.google.cloud.automl.v1beta1.ColumnSpec.decode(reader, reader.uint32())); + break; + } + case 4: { + message.optimizationObjective = reader.string(); + break; + } + case 5: { + if (!(message.tablesModelColumnInfo && message.tablesModelColumnInfo.length)) + message.tablesModelColumnInfo = []; + message.tablesModelColumnInfo.push($root.google.cloud.automl.v1beta1.TablesModelColumnInfo.decode(reader, reader.uint32())); + break; + } + case 6: { + message.trainBudgetMilliNodeHours = reader.int64(); + break; + } + case 7: { + message.trainCostMilliNodeHours = reader.int64(); + break; + } + case 12: { + message.disableEarlyStopping = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a TablesModelMetadata message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.automl.v1beta1.TablesModelMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.automl.v1beta1.TablesModelMetadata} TablesModelMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TablesModelMetadata.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a TablesModelMetadata message. + * @function verify + * @memberof google.cloud.automl.v1beta1.TablesModelMetadata + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + TablesModelMetadata.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.optimizationObjectiveRecallValue != null && message.hasOwnProperty("optimizationObjectiveRecallValue")) { + properties.additionalOptimizationObjectiveConfig = 1; + if (typeof message.optimizationObjectiveRecallValue !== "number") + return "optimizationObjectiveRecallValue: number expected"; + } + if (message.optimizationObjectivePrecisionValue != null && message.hasOwnProperty("optimizationObjectivePrecisionValue")) { + if (properties.additionalOptimizationObjectiveConfig === 1) + return "additionalOptimizationObjectiveConfig: multiple values"; + properties.additionalOptimizationObjectiveConfig = 1; + if (typeof message.optimizationObjectivePrecisionValue !== "number") + return "optimizationObjectivePrecisionValue: number expected"; + } + if (message.targetColumnSpec != null && message.hasOwnProperty("targetColumnSpec")) { + var error = $root.google.cloud.automl.v1beta1.ColumnSpec.verify(message.targetColumnSpec); + if (error) + return "targetColumnSpec." + error; + } + if (message.inputFeatureColumnSpecs != null && message.hasOwnProperty("inputFeatureColumnSpecs")) { + if (!Array.isArray(message.inputFeatureColumnSpecs)) + return "inputFeatureColumnSpecs: array expected"; + for (var i = 0; i < message.inputFeatureColumnSpecs.length; ++i) { + var error = $root.google.cloud.automl.v1beta1.ColumnSpec.verify(message.inputFeatureColumnSpecs[i]); + if (error) + return "inputFeatureColumnSpecs." + error; + } + } + if (message.optimizationObjective != null && message.hasOwnProperty("optimizationObjective")) + if (!$util.isString(message.optimizationObjective)) + return "optimizationObjective: string expected"; + if (message.tablesModelColumnInfo != null && message.hasOwnProperty("tablesModelColumnInfo")) { + if (!Array.isArray(message.tablesModelColumnInfo)) + return "tablesModelColumnInfo: array expected"; + for (var i = 0; i < message.tablesModelColumnInfo.length; ++i) { + var error = $root.google.cloud.automl.v1beta1.TablesModelColumnInfo.verify(message.tablesModelColumnInfo[i]); + if (error) + return "tablesModelColumnInfo." + error; + } + } + if (message.trainBudgetMilliNodeHours != null && message.hasOwnProperty("trainBudgetMilliNodeHours")) + if (!$util.isInteger(message.trainBudgetMilliNodeHours) && !(message.trainBudgetMilliNodeHours && $util.isInteger(message.trainBudgetMilliNodeHours.low) && $util.isInteger(message.trainBudgetMilliNodeHours.high))) + return "trainBudgetMilliNodeHours: integer|Long expected"; + if (message.trainCostMilliNodeHours != null && message.hasOwnProperty("trainCostMilliNodeHours")) + if (!$util.isInteger(message.trainCostMilliNodeHours) && !(message.trainCostMilliNodeHours && $util.isInteger(message.trainCostMilliNodeHours.low) && $util.isInteger(message.trainCostMilliNodeHours.high))) + return "trainCostMilliNodeHours: integer|Long expected"; + if (message.disableEarlyStopping != null && message.hasOwnProperty("disableEarlyStopping")) + if (typeof message.disableEarlyStopping !== "boolean") + return "disableEarlyStopping: boolean expected"; + return null; + }; + + /** + * Creates a TablesModelMetadata message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.automl.v1beta1.TablesModelMetadata + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.automl.v1beta1.TablesModelMetadata} TablesModelMetadata + */ + TablesModelMetadata.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.automl.v1beta1.TablesModelMetadata) + return object; + var message = new $root.google.cloud.automl.v1beta1.TablesModelMetadata(); + if (object.optimizationObjectiveRecallValue != null) + message.optimizationObjectiveRecallValue = Number(object.optimizationObjectiveRecallValue); + if (object.optimizationObjectivePrecisionValue != null) + message.optimizationObjectivePrecisionValue = Number(object.optimizationObjectivePrecisionValue); + if (object.targetColumnSpec != null) { + if (typeof object.targetColumnSpec !== "object") + throw TypeError(".google.cloud.automl.v1beta1.TablesModelMetadata.targetColumnSpec: object expected"); + message.targetColumnSpec = $root.google.cloud.automl.v1beta1.ColumnSpec.fromObject(object.targetColumnSpec); + } + if (object.inputFeatureColumnSpecs) { + if (!Array.isArray(object.inputFeatureColumnSpecs)) + throw TypeError(".google.cloud.automl.v1beta1.TablesModelMetadata.inputFeatureColumnSpecs: array expected"); + message.inputFeatureColumnSpecs = []; + for (var i = 0; i < object.inputFeatureColumnSpecs.length; ++i) { + if (typeof object.inputFeatureColumnSpecs[i] !== "object") + throw TypeError(".google.cloud.automl.v1beta1.TablesModelMetadata.inputFeatureColumnSpecs: object expected"); + message.inputFeatureColumnSpecs[i] = $root.google.cloud.automl.v1beta1.ColumnSpec.fromObject(object.inputFeatureColumnSpecs[i]); + } + } + if (object.optimizationObjective != null) + message.optimizationObjective = String(object.optimizationObjective); + if (object.tablesModelColumnInfo) { + if (!Array.isArray(object.tablesModelColumnInfo)) + throw TypeError(".google.cloud.automl.v1beta1.TablesModelMetadata.tablesModelColumnInfo: array expected"); + message.tablesModelColumnInfo = []; + for (var i = 0; i < object.tablesModelColumnInfo.length; ++i) { + if (typeof object.tablesModelColumnInfo[i] !== "object") + throw TypeError(".google.cloud.automl.v1beta1.TablesModelMetadata.tablesModelColumnInfo: object expected"); + message.tablesModelColumnInfo[i] = $root.google.cloud.automl.v1beta1.TablesModelColumnInfo.fromObject(object.tablesModelColumnInfo[i]); + } + } + if (object.trainBudgetMilliNodeHours != null) + if ($util.Long) + (message.trainBudgetMilliNodeHours = $util.Long.fromValue(object.trainBudgetMilliNodeHours)).unsigned = false; + else if (typeof object.trainBudgetMilliNodeHours === "string") + message.trainBudgetMilliNodeHours = parseInt(object.trainBudgetMilliNodeHours, 10); + else if (typeof object.trainBudgetMilliNodeHours === "number") + message.trainBudgetMilliNodeHours = object.trainBudgetMilliNodeHours; + else if (typeof object.trainBudgetMilliNodeHours === "object") + message.trainBudgetMilliNodeHours = new $util.LongBits(object.trainBudgetMilliNodeHours.low >>> 0, object.trainBudgetMilliNodeHours.high >>> 0).toNumber(); + if (object.trainCostMilliNodeHours != null) + if ($util.Long) + (message.trainCostMilliNodeHours = $util.Long.fromValue(object.trainCostMilliNodeHours)).unsigned = false; + else if (typeof object.trainCostMilliNodeHours === "string") + message.trainCostMilliNodeHours = parseInt(object.trainCostMilliNodeHours, 10); + else if (typeof object.trainCostMilliNodeHours === "number") + message.trainCostMilliNodeHours = object.trainCostMilliNodeHours; + else if (typeof object.trainCostMilliNodeHours === "object") + message.trainCostMilliNodeHours = new $util.LongBits(object.trainCostMilliNodeHours.low >>> 0, object.trainCostMilliNodeHours.high >>> 0).toNumber(); + if (object.disableEarlyStopping != null) + message.disableEarlyStopping = Boolean(object.disableEarlyStopping); + return message; + }; + + /** + * Creates a plain object from a TablesModelMetadata message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.automl.v1beta1.TablesModelMetadata + * @static + * @param {google.cloud.automl.v1beta1.TablesModelMetadata} message TablesModelMetadata + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + TablesModelMetadata.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.inputFeatureColumnSpecs = []; + object.tablesModelColumnInfo = []; + } + if (options.defaults) { + object.targetColumnSpec = null; + object.optimizationObjective = ""; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.trainBudgetMilliNodeHours = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.trainBudgetMilliNodeHours = options.longs === String ? "0" : 0; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.trainCostMilliNodeHours = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.trainCostMilliNodeHours = options.longs === String ? "0" : 0; + object.disableEarlyStopping = false; + } + if (message.targetColumnSpec != null && message.hasOwnProperty("targetColumnSpec")) + object.targetColumnSpec = $root.google.cloud.automl.v1beta1.ColumnSpec.toObject(message.targetColumnSpec, options); + if (message.inputFeatureColumnSpecs && message.inputFeatureColumnSpecs.length) { + object.inputFeatureColumnSpecs = []; + for (var j = 0; j < message.inputFeatureColumnSpecs.length; ++j) + object.inputFeatureColumnSpecs[j] = $root.google.cloud.automl.v1beta1.ColumnSpec.toObject(message.inputFeatureColumnSpecs[j], options); + } + if (message.optimizationObjective != null && message.hasOwnProperty("optimizationObjective")) + object.optimizationObjective = message.optimizationObjective; + if (message.tablesModelColumnInfo && message.tablesModelColumnInfo.length) { + object.tablesModelColumnInfo = []; + for (var j = 0; j < message.tablesModelColumnInfo.length; ++j) + object.tablesModelColumnInfo[j] = $root.google.cloud.automl.v1beta1.TablesModelColumnInfo.toObject(message.tablesModelColumnInfo[j], options); + } + if (message.trainBudgetMilliNodeHours != null && message.hasOwnProperty("trainBudgetMilliNodeHours")) + if (typeof message.trainBudgetMilliNodeHours === "number") + object.trainBudgetMilliNodeHours = options.longs === String ? String(message.trainBudgetMilliNodeHours) : message.trainBudgetMilliNodeHours; + else + object.trainBudgetMilliNodeHours = options.longs === String ? $util.Long.prototype.toString.call(message.trainBudgetMilliNodeHours) : options.longs === Number ? new $util.LongBits(message.trainBudgetMilliNodeHours.low >>> 0, message.trainBudgetMilliNodeHours.high >>> 0).toNumber() : message.trainBudgetMilliNodeHours; + if (message.trainCostMilliNodeHours != null && message.hasOwnProperty("trainCostMilliNodeHours")) + if (typeof message.trainCostMilliNodeHours === "number") + object.trainCostMilliNodeHours = options.longs === String ? String(message.trainCostMilliNodeHours) : message.trainCostMilliNodeHours; + else + object.trainCostMilliNodeHours = options.longs === String ? $util.Long.prototype.toString.call(message.trainCostMilliNodeHours) : options.longs === Number ? new $util.LongBits(message.trainCostMilliNodeHours.low >>> 0, message.trainCostMilliNodeHours.high >>> 0).toNumber() : message.trainCostMilliNodeHours; + if (message.disableEarlyStopping != null && message.hasOwnProperty("disableEarlyStopping")) + object.disableEarlyStopping = message.disableEarlyStopping; + if (message.optimizationObjectiveRecallValue != null && message.hasOwnProperty("optimizationObjectiveRecallValue")) { + object.optimizationObjectiveRecallValue = options.json && !isFinite(message.optimizationObjectiveRecallValue) ? String(message.optimizationObjectiveRecallValue) : message.optimizationObjectiveRecallValue; + if (options.oneofs) + object.additionalOptimizationObjectiveConfig = "optimizationObjectiveRecallValue"; + } + if (message.optimizationObjectivePrecisionValue != null && message.hasOwnProperty("optimizationObjectivePrecisionValue")) { + object.optimizationObjectivePrecisionValue = options.json && !isFinite(message.optimizationObjectivePrecisionValue) ? String(message.optimizationObjectivePrecisionValue) : message.optimizationObjectivePrecisionValue; + if (options.oneofs) + object.additionalOptimizationObjectiveConfig = "optimizationObjectivePrecisionValue"; + } + return object; + }; + + /** + * Converts this TablesModelMetadata to JSON. + * @function toJSON + * @memberof google.cloud.automl.v1beta1.TablesModelMetadata + * @instance + * @returns {Object.} JSON object + */ + TablesModelMetadata.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for TablesModelMetadata + * @function getTypeUrl + * @memberof google.cloud.automl.v1beta1.TablesModelMetadata + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TablesModelMetadata.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.automl.v1beta1.TablesModelMetadata"; + }; + + return TablesModelMetadata; + })(); + + v1beta1.TablesAnnotation = (function() { + + /** + * Properties of a TablesAnnotation. + * @memberof google.cloud.automl.v1beta1 + * @interface ITablesAnnotation + * @property {number|null} [score] TablesAnnotation score + * @property {google.cloud.automl.v1beta1.IDoubleRange|null} [predictionInterval] TablesAnnotation predictionInterval + * @property {google.protobuf.IValue|null} [value] TablesAnnotation value + * @property {Array.|null} [tablesModelColumnInfo] TablesAnnotation tablesModelColumnInfo + * @property {number|null} [baselineScore] TablesAnnotation baselineScore + */ + + /** + * Constructs a new TablesAnnotation. + * @memberof google.cloud.automl.v1beta1 + * @classdesc Represents a TablesAnnotation. + * @implements ITablesAnnotation + * @constructor + * @param {google.cloud.automl.v1beta1.ITablesAnnotation=} [properties] Properties to set + */ + function TablesAnnotation(properties) { + this.tablesModelColumnInfo = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * TablesAnnotation score. + * @member {number} score + * @memberof google.cloud.automl.v1beta1.TablesAnnotation + * @instance + */ + TablesAnnotation.prototype.score = 0; + + /** + * TablesAnnotation predictionInterval. + * @member {google.cloud.automl.v1beta1.IDoubleRange|null|undefined} predictionInterval + * @memberof google.cloud.automl.v1beta1.TablesAnnotation + * @instance + */ + TablesAnnotation.prototype.predictionInterval = null; + + /** + * TablesAnnotation value. + * @member {google.protobuf.IValue|null|undefined} value + * @memberof google.cloud.automl.v1beta1.TablesAnnotation + * @instance + */ + TablesAnnotation.prototype.value = null; + + /** + * TablesAnnotation tablesModelColumnInfo. + * @member {Array.} tablesModelColumnInfo + * @memberof google.cloud.automl.v1beta1.TablesAnnotation + * @instance + */ + TablesAnnotation.prototype.tablesModelColumnInfo = $util.emptyArray; + + /** + * TablesAnnotation baselineScore. + * @member {number} baselineScore + * @memberof google.cloud.automl.v1beta1.TablesAnnotation + * @instance + */ + TablesAnnotation.prototype.baselineScore = 0; + + /** + * Creates a new TablesAnnotation instance using the specified properties. + * @function create + * @memberof google.cloud.automl.v1beta1.TablesAnnotation + * @static + * @param {google.cloud.automl.v1beta1.ITablesAnnotation=} [properties] Properties to set + * @returns {google.cloud.automl.v1beta1.TablesAnnotation} TablesAnnotation instance + */ + TablesAnnotation.create = function create(properties) { + return new TablesAnnotation(properties); + }; + + /** + * Encodes the specified TablesAnnotation message. Does not implicitly {@link google.cloud.automl.v1beta1.TablesAnnotation.verify|verify} messages. + * @function encode + * @memberof google.cloud.automl.v1beta1.TablesAnnotation + * @static + * @param {google.cloud.automl.v1beta1.ITablesAnnotation} message TablesAnnotation message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TablesAnnotation.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.score != null && Object.hasOwnProperty.call(message, "score")) + writer.uint32(/* id 1, wireType 5 =*/13).float(message.score); + if (message.value != null && Object.hasOwnProperty.call(message, "value")) + $root.google.protobuf.Value.encode(message.value, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.tablesModelColumnInfo != null && message.tablesModelColumnInfo.length) + for (var i = 0; i < message.tablesModelColumnInfo.length; ++i) + $root.google.cloud.automl.v1beta1.TablesModelColumnInfo.encode(message.tablesModelColumnInfo[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.predictionInterval != null && Object.hasOwnProperty.call(message, "predictionInterval")) + $root.google.cloud.automl.v1beta1.DoubleRange.encode(message.predictionInterval, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.baselineScore != null && Object.hasOwnProperty.call(message, "baselineScore")) + writer.uint32(/* id 5, wireType 5 =*/45).float(message.baselineScore); + return writer; + }; + + /** + * Encodes the specified TablesAnnotation message, length delimited. Does not implicitly {@link google.cloud.automl.v1beta1.TablesAnnotation.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.automl.v1beta1.TablesAnnotation + * @static + * @param {google.cloud.automl.v1beta1.ITablesAnnotation} message TablesAnnotation message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TablesAnnotation.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a TablesAnnotation message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.automl.v1beta1.TablesAnnotation + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.automl.v1beta1.TablesAnnotation} TablesAnnotation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TablesAnnotation.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.automl.v1beta1.TablesAnnotation(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.score = reader.float(); + break; + } + case 4: { + message.predictionInterval = $root.google.cloud.automl.v1beta1.DoubleRange.decode(reader, reader.uint32()); + break; + } + case 2: { + message.value = $root.google.protobuf.Value.decode(reader, reader.uint32()); + break; + } + case 3: { + if (!(message.tablesModelColumnInfo && message.tablesModelColumnInfo.length)) + message.tablesModelColumnInfo = []; + message.tablesModelColumnInfo.push($root.google.cloud.automl.v1beta1.TablesModelColumnInfo.decode(reader, reader.uint32())); + break; + } + case 5: { + message.baselineScore = reader.float(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a TablesAnnotation message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.automl.v1beta1.TablesAnnotation + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.automl.v1beta1.TablesAnnotation} TablesAnnotation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TablesAnnotation.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a TablesAnnotation message. + * @function verify + * @memberof google.cloud.automl.v1beta1.TablesAnnotation + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + TablesAnnotation.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.score != null && message.hasOwnProperty("score")) + if (typeof message.score !== "number") + return "score: number expected"; + if (message.predictionInterval != null && message.hasOwnProperty("predictionInterval")) { + var error = $root.google.cloud.automl.v1beta1.DoubleRange.verify(message.predictionInterval); + if (error) + return "predictionInterval." + error; + } + if (message.value != null && message.hasOwnProperty("value")) { + var error = $root.google.protobuf.Value.verify(message.value); + if (error) + return "value." + error; + } + if (message.tablesModelColumnInfo != null && message.hasOwnProperty("tablesModelColumnInfo")) { + if (!Array.isArray(message.tablesModelColumnInfo)) + return "tablesModelColumnInfo: array expected"; + for (var i = 0; i < message.tablesModelColumnInfo.length; ++i) { + var error = $root.google.cloud.automl.v1beta1.TablesModelColumnInfo.verify(message.tablesModelColumnInfo[i]); + if (error) + return "tablesModelColumnInfo." + error; + } + } + if (message.baselineScore != null && message.hasOwnProperty("baselineScore")) + if (typeof message.baselineScore !== "number") + return "baselineScore: number expected"; + return null; + }; + + /** + * Creates a TablesAnnotation message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.automl.v1beta1.TablesAnnotation + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.automl.v1beta1.TablesAnnotation} TablesAnnotation + */ + TablesAnnotation.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.automl.v1beta1.TablesAnnotation) + return object; + var message = new $root.google.cloud.automl.v1beta1.TablesAnnotation(); + if (object.score != null) + message.score = Number(object.score); + if (object.predictionInterval != null) { + if (typeof object.predictionInterval !== "object") + throw TypeError(".google.cloud.automl.v1beta1.TablesAnnotation.predictionInterval: object expected"); + message.predictionInterval = $root.google.cloud.automl.v1beta1.DoubleRange.fromObject(object.predictionInterval); + } + if (object.value != null) { + if (typeof object.value !== "object") + throw TypeError(".google.cloud.automl.v1beta1.TablesAnnotation.value: object expected"); + message.value = $root.google.protobuf.Value.fromObject(object.value); + } + if (object.tablesModelColumnInfo) { + if (!Array.isArray(object.tablesModelColumnInfo)) + throw TypeError(".google.cloud.automl.v1beta1.TablesAnnotation.tablesModelColumnInfo: array expected"); + message.tablesModelColumnInfo = []; + for (var i = 0; i < object.tablesModelColumnInfo.length; ++i) { + if (typeof object.tablesModelColumnInfo[i] !== "object") + throw TypeError(".google.cloud.automl.v1beta1.TablesAnnotation.tablesModelColumnInfo: object expected"); + message.tablesModelColumnInfo[i] = $root.google.cloud.automl.v1beta1.TablesModelColumnInfo.fromObject(object.tablesModelColumnInfo[i]); + } + } + if (object.baselineScore != null) + message.baselineScore = Number(object.baselineScore); + return message; + }; + + /** + * Creates a plain object from a TablesAnnotation message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.automl.v1beta1.TablesAnnotation + * @static + * @param {google.cloud.automl.v1beta1.TablesAnnotation} message TablesAnnotation + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + TablesAnnotation.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.tablesModelColumnInfo = []; + if (options.defaults) { + object.score = 0; + object.value = null; + object.predictionInterval = null; + object.baselineScore = 0; + } + if (message.score != null && message.hasOwnProperty("score")) + object.score = options.json && !isFinite(message.score) ? String(message.score) : message.score; + if (message.value != null && message.hasOwnProperty("value")) + object.value = $root.google.protobuf.Value.toObject(message.value, options); + if (message.tablesModelColumnInfo && message.tablesModelColumnInfo.length) { + object.tablesModelColumnInfo = []; + for (var j = 0; j < message.tablesModelColumnInfo.length; ++j) + object.tablesModelColumnInfo[j] = $root.google.cloud.automl.v1beta1.TablesModelColumnInfo.toObject(message.tablesModelColumnInfo[j], options); + } + if (message.predictionInterval != null && message.hasOwnProperty("predictionInterval")) + object.predictionInterval = $root.google.cloud.automl.v1beta1.DoubleRange.toObject(message.predictionInterval, options); + if (message.baselineScore != null && message.hasOwnProperty("baselineScore")) + object.baselineScore = options.json && !isFinite(message.baselineScore) ? String(message.baselineScore) : message.baselineScore; + return object; + }; + + /** + * Converts this TablesAnnotation to JSON. + * @function toJSON + * @memberof google.cloud.automl.v1beta1.TablesAnnotation + * @instance + * @returns {Object.} JSON object + */ + TablesAnnotation.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for TablesAnnotation + * @function getTypeUrl + * @memberof google.cloud.automl.v1beta1.TablesAnnotation + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TablesAnnotation.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.automl.v1beta1.TablesAnnotation"; + }; + + return TablesAnnotation; + })(); + + v1beta1.TablesModelColumnInfo = (function() { + + /** + * Properties of a TablesModelColumnInfo. + * @memberof google.cloud.automl.v1beta1 + * @interface ITablesModelColumnInfo + * @property {string|null} [columnSpecName] TablesModelColumnInfo columnSpecName + * @property {string|null} [columnDisplayName] TablesModelColumnInfo columnDisplayName + * @property {number|null} [featureImportance] TablesModelColumnInfo featureImportance + */ + + /** + * Constructs a new TablesModelColumnInfo. + * @memberof google.cloud.automl.v1beta1 + * @classdesc Represents a TablesModelColumnInfo. + * @implements ITablesModelColumnInfo + * @constructor + * @param {google.cloud.automl.v1beta1.ITablesModelColumnInfo=} [properties] Properties to set + */ + function TablesModelColumnInfo(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * TablesModelColumnInfo columnSpecName. + * @member {string} columnSpecName + * @memberof google.cloud.automl.v1beta1.TablesModelColumnInfo + * @instance + */ + TablesModelColumnInfo.prototype.columnSpecName = ""; + + /** + * TablesModelColumnInfo columnDisplayName. + * @member {string} columnDisplayName + * @memberof google.cloud.automl.v1beta1.TablesModelColumnInfo + * @instance + */ + TablesModelColumnInfo.prototype.columnDisplayName = ""; + + /** + * TablesModelColumnInfo featureImportance. + * @member {number} featureImportance + * @memberof google.cloud.automl.v1beta1.TablesModelColumnInfo + * @instance + */ + TablesModelColumnInfo.prototype.featureImportance = 0; + + /** + * Creates a new TablesModelColumnInfo instance using the specified properties. + * @function create + * @memberof google.cloud.automl.v1beta1.TablesModelColumnInfo + * @static + * @param {google.cloud.automl.v1beta1.ITablesModelColumnInfo=} [properties] Properties to set + * @returns {google.cloud.automl.v1beta1.TablesModelColumnInfo} TablesModelColumnInfo instance + */ + TablesModelColumnInfo.create = function create(properties) { + return new TablesModelColumnInfo(properties); + }; + + /** + * Encodes the specified TablesModelColumnInfo message. Does not implicitly {@link google.cloud.automl.v1beta1.TablesModelColumnInfo.verify|verify} messages. + * @function encode + * @memberof google.cloud.automl.v1beta1.TablesModelColumnInfo + * @static + * @param {google.cloud.automl.v1beta1.ITablesModelColumnInfo} message TablesModelColumnInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TablesModelColumnInfo.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.columnSpecName != null && Object.hasOwnProperty.call(message, "columnSpecName")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.columnSpecName); + if (message.columnDisplayName != null && Object.hasOwnProperty.call(message, "columnDisplayName")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.columnDisplayName); + if (message.featureImportance != null && Object.hasOwnProperty.call(message, "featureImportance")) + writer.uint32(/* id 3, wireType 5 =*/29).float(message.featureImportance); + return writer; + }; + + /** + * Encodes the specified TablesModelColumnInfo message, length delimited. Does not implicitly {@link google.cloud.automl.v1beta1.TablesModelColumnInfo.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.automl.v1beta1.TablesModelColumnInfo + * @static + * @param {google.cloud.automl.v1beta1.ITablesModelColumnInfo} message TablesModelColumnInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TablesModelColumnInfo.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a TablesModelColumnInfo message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.automl.v1beta1.TablesModelColumnInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.automl.v1beta1.TablesModelColumnInfo} TablesModelColumnInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TablesModelColumnInfo.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.automl.v1beta1.TablesModelColumnInfo(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.columnSpecName = reader.string(); + break; + } + case 2: { + message.columnDisplayName = reader.string(); + break; + } + case 3: { + message.featureImportance = reader.float(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a TablesModelColumnInfo message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.automl.v1beta1.TablesModelColumnInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.automl.v1beta1.TablesModelColumnInfo} TablesModelColumnInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TablesModelColumnInfo.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a TablesModelColumnInfo message. + * @function verify + * @memberof google.cloud.automl.v1beta1.TablesModelColumnInfo + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + TablesModelColumnInfo.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.columnSpecName != null && message.hasOwnProperty("columnSpecName")) + if (!$util.isString(message.columnSpecName)) + return "columnSpecName: string expected"; + if (message.columnDisplayName != null && message.hasOwnProperty("columnDisplayName")) + if (!$util.isString(message.columnDisplayName)) + return "columnDisplayName: string expected"; + if (message.featureImportance != null && message.hasOwnProperty("featureImportance")) + if (typeof message.featureImportance !== "number") + return "featureImportance: number expected"; + return null; + }; + + /** + * Creates a TablesModelColumnInfo message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.automl.v1beta1.TablesModelColumnInfo + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.automl.v1beta1.TablesModelColumnInfo} TablesModelColumnInfo + */ + TablesModelColumnInfo.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.automl.v1beta1.TablesModelColumnInfo) + return object; + var message = new $root.google.cloud.automl.v1beta1.TablesModelColumnInfo(); + if (object.columnSpecName != null) + message.columnSpecName = String(object.columnSpecName); + if (object.columnDisplayName != null) + message.columnDisplayName = String(object.columnDisplayName); + if (object.featureImportance != null) + message.featureImportance = Number(object.featureImportance); + return message; + }; + + /** + * Creates a plain object from a TablesModelColumnInfo message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.automl.v1beta1.TablesModelColumnInfo + * @static + * @param {google.cloud.automl.v1beta1.TablesModelColumnInfo} message TablesModelColumnInfo + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + TablesModelColumnInfo.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.columnSpecName = ""; + object.columnDisplayName = ""; + object.featureImportance = 0; + } + if (message.columnSpecName != null && message.hasOwnProperty("columnSpecName")) + object.columnSpecName = message.columnSpecName; + if (message.columnDisplayName != null && message.hasOwnProperty("columnDisplayName")) + object.columnDisplayName = message.columnDisplayName; + if (message.featureImportance != null && message.hasOwnProperty("featureImportance")) + object.featureImportance = options.json && !isFinite(message.featureImportance) ? String(message.featureImportance) : message.featureImportance; + return object; + }; + + /** + * Converts this TablesModelColumnInfo to JSON. + * @function toJSON + * @memberof google.cloud.automl.v1beta1.TablesModelColumnInfo + * @instance + * @returns {Object.} JSON object + */ + TablesModelColumnInfo.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for TablesModelColumnInfo + * @function getTypeUrl + * @memberof google.cloud.automl.v1beta1.TablesModelColumnInfo + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TablesModelColumnInfo.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.automl.v1beta1.TablesModelColumnInfo"; + }; + + return TablesModelColumnInfo; + })(); + + v1beta1.ColumnSpec = (function() { + + /** + * Properties of a ColumnSpec. + * @memberof google.cloud.automl.v1beta1 + * @interface IColumnSpec + * @property {string|null} [name] ColumnSpec name + * @property {google.cloud.automl.v1beta1.IDataType|null} [dataType] ColumnSpec dataType + * @property {string|null} [displayName] ColumnSpec displayName + * @property {google.cloud.automl.v1beta1.IDataStats|null} [dataStats] ColumnSpec dataStats + * @property {Array.|null} [topCorrelatedColumns] ColumnSpec topCorrelatedColumns + * @property {string|null} [etag] ColumnSpec etag + */ + + /** + * Constructs a new ColumnSpec. + * @memberof google.cloud.automl.v1beta1 + * @classdesc Represents a ColumnSpec. + * @implements IColumnSpec + * @constructor + * @param {google.cloud.automl.v1beta1.IColumnSpec=} [properties] Properties to set + */ + function ColumnSpec(properties) { + this.topCorrelatedColumns = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ColumnSpec name. + * @member {string} name + * @memberof google.cloud.automl.v1beta1.ColumnSpec + * @instance + */ + ColumnSpec.prototype.name = ""; + + /** + * ColumnSpec dataType. + * @member {google.cloud.automl.v1beta1.IDataType|null|undefined} dataType + * @memberof google.cloud.automl.v1beta1.ColumnSpec + * @instance + */ + ColumnSpec.prototype.dataType = null; + + /** + * ColumnSpec displayName. + * @member {string} displayName + * @memberof google.cloud.automl.v1beta1.ColumnSpec + * @instance + */ + ColumnSpec.prototype.displayName = ""; + + /** + * ColumnSpec dataStats. + * @member {google.cloud.automl.v1beta1.IDataStats|null|undefined} dataStats + * @memberof google.cloud.automl.v1beta1.ColumnSpec + * @instance + */ + ColumnSpec.prototype.dataStats = null; + + /** + * ColumnSpec topCorrelatedColumns. + * @member {Array.} topCorrelatedColumns + * @memberof google.cloud.automl.v1beta1.ColumnSpec + * @instance + */ + ColumnSpec.prototype.topCorrelatedColumns = $util.emptyArray; + + /** + * ColumnSpec etag. + * @member {string} etag + * @memberof google.cloud.automl.v1beta1.ColumnSpec + * @instance + */ + ColumnSpec.prototype.etag = ""; + + /** + * Creates a new ColumnSpec instance using the specified properties. + * @function create + * @memberof google.cloud.automl.v1beta1.ColumnSpec + * @static + * @param {google.cloud.automl.v1beta1.IColumnSpec=} [properties] Properties to set + * @returns {google.cloud.automl.v1beta1.ColumnSpec} ColumnSpec instance + */ + ColumnSpec.create = function create(properties) { + return new ColumnSpec(properties); + }; + + /** + * Encodes the specified ColumnSpec message. Does not implicitly {@link google.cloud.automl.v1beta1.ColumnSpec.verify|verify} messages. + * @function encode + * @memberof google.cloud.automl.v1beta1.ColumnSpec + * @static + * @param {google.cloud.automl.v1beta1.IColumnSpec} message ColumnSpec message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ColumnSpec.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.dataType != null && Object.hasOwnProperty.call(message, "dataType")) + $root.google.cloud.automl.v1beta1.DataType.encode(message.dataType, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.displayName != null && Object.hasOwnProperty.call(message, "displayName")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.displayName); + if (message.dataStats != null && Object.hasOwnProperty.call(message, "dataStats")) + $root.google.cloud.automl.v1beta1.DataStats.encode(message.dataStats, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.topCorrelatedColumns != null && message.topCorrelatedColumns.length) + for (var i = 0; i < message.topCorrelatedColumns.length; ++i) + $root.google.cloud.automl.v1beta1.ColumnSpec.CorrelatedColumn.encode(message.topCorrelatedColumns[i], writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.etag != null && Object.hasOwnProperty.call(message, "etag")) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.etag); + return writer; + }; + + /** + * Encodes the specified ColumnSpec message, length delimited. Does not implicitly {@link google.cloud.automl.v1beta1.ColumnSpec.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.automl.v1beta1.ColumnSpec + * @static + * @param {google.cloud.automl.v1beta1.IColumnSpec} message ColumnSpec message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ColumnSpec.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ColumnSpec message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.automl.v1beta1.ColumnSpec + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.automl.v1beta1.ColumnSpec} ColumnSpec + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ColumnSpec.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.automl.v1beta1.ColumnSpec(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.dataType = $root.google.cloud.automl.v1beta1.DataType.decode(reader, reader.uint32()); + break; + } + case 3: { + message.displayName = reader.string(); + break; + } + case 4: { + message.dataStats = $root.google.cloud.automl.v1beta1.DataStats.decode(reader, reader.uint32()); + break; + } + case 5: { + if (!(message.topCorrelatedColumns && message.topCorrelatedColumns.length)) + message.topCorrelatedColumns = []; + message.topCorrelatedColumns.push($root.google.cloud.automl.v1beta1.ColumnSpec.CorrelatedColumn.decode(reader, reader.uint32())); + break; + } + case 6: { + message.etag = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ColumnSpec message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.automl.v1beta1.ColumnSpec + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.automl.v1beta1.ColumnSpec} ColumnSpec + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ColumnSpec.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ColumnSpec message. + * @function verify + * @memberof google.cloud.automl.v1beta1.ColumnSpec + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ColumnSpec.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.dataType != null && message.hasOwnProperty("dataType")) { + var error = $root.google.cloud.automl.v1beta1.DataType.verify(message.dataType); + if (error) + return "dataType." + error; + } + if (message.displayName != null && message.hasOwnProperty("displayName")) + if (!$util.isString(message.displayName)) + return "displayName: string expected"; + if (message.dataStats != null && message.hasOwnProperty("dataStats")) { + var error = $root.google.cloud.automl.v1beta1.DataStats.verify(message.dataStats); + if (error) + return "dataStats." + error; + } + if (message.topCorrelatedColumns != null && message.hasOwnProperty("topCorrelatedColumns")) { + if (!Array.isArray(message.topCorrelatedColumns)) + return "topCorrelatedColumns: array expected"; + for (var i = 0; i < message.topCorrelatedColumns.length; ++i) { + var error = $root.google.cloud.automl.v1beta1.ColumnSpec.CorrelatedColumn.verify(message.topCorrelatedColumns[i]); + if (error) + return "topCorrelatedColumns." + error; + } + } + if (message.etag != null && message.hasOwnProperty("etag")) + if (!$util.isString(message.etag)) + return "etag: string expected"; + return null; + }; + + /** + * Creates a ColumnSpec message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.automl.v1beta1.ColumnSpec + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.automl.v1beta1.ColumnSpec} ColumnSpec + */ + ColumnSpec.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.automl.v1beta1.ColumnSpec) + return object; + var message = new $root.google.cloud.automl.v1beta1.ColumnSpec(); + if (object.name != null) + message.name = String(object.name); + if (object.dataType != null) { + if (typeof object.dataType !== "object") + throw TypeError(".google.cloud.automl.v1beta1.ColumnSpec.dataType: object expected"); + message.dataType = $root.google.cloud.automl.v1beta1.DataType.fromObject(object.dataType); + } + if (object.displayName != null) + message.displayName = String(object.displayName); + if (object.dataStats != null) { + if (typeof object.dataStats !== "object") + throw TypeError(".google.cloud.automl.v1beta1.ColumnSpec.dataStats: object expected"); + message.dataStats = $root.google.cloud.automl.v1beta1.DataStats.fromObject(object.dataStats); + } + if (object.topCorrelatedColumns) { + if (!Array.isArray(object.topCorrelatedColumns)) + throw TypeError(".google.cloud.automl.v1beta1.ColumnSpec.topCorrelatedColumns: array expected"); + message.topCorrelatedColumns = []; + for (var i = 0; i < object.topCorrelatedColumns.length; ++i) { + if (typeof object.topCorrelatedColumns[i] !== "object") + throw TypeError(".google.cloud.automl.v1beta1.ColumnSpec.topCorrelatedColumns: object expected"); + message.topCorrelatedColumns[i] = $root.google.cloud.automl.v1beta1.ColumnSpec.CorrelatedColumn.fromObject(object.topCorrelatedColumns[i]); + } + } + if (object.etag != null) + message.etag = String(object.etag); + return message; + }; + + /** + * Creates a plain object from a ColumnSpec message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.automl.v1beta1.ColumnSpec + * @static + * @param {google.cloud.automl.v1beta1.ColumnSpec} message ColumnSpec + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ColumnSpec.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.topCorrelatedColumns = []; + if (options.defaults) { + object.name = ""; + object.dataType = null; + object.displayName = ""; + object.dataStats = null; + object.etag = ""; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.dataType != null && message.hasOwnProperty("dataType")) + object.dataType = $root.google.cloud.automl.v1beta1.DataType.toObject(message.dataType, options); + if (message.displayName != null && message.hasOwnProperty("displayName")) + object.displayName = message.displayName; + if (message.dataStats != null && message.hasOwnProperty("dataStats")) + object.dataStats = $root.google.cloud.automl.v1beta1.DataStats.toObject(message.dataStats, options); + if (message.topCorrelatedColumns && message.topCorrelatedColumns.length) { + object.topCorrelatedColumns = []; + for (var j = 0; j < message.topCorrelatedColumns.length; ++j) + object.topCorrelatedColumns[j] = $root.google.cloud.automl.v1beta1.ColumnSpec.CorrelatedColumn.toObject(message.topCorrelatedColumns[j], options); + } + if (message.etag != null && message.hasOwnProperty("etag")) + object.etag = message.etag; + return object; + }; + + /** + * Converts this ColumnSpec to JSON. + * @function toJSON + * @memberof google.cloud.automl.v1beta1.ColumnSpec + * @instance + * @returns {Object.} JSON object + */ + ColumnSpec.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ColumnSpec + * @function getTypeUrl + * @memberof google.cloud.automl.v1beta1.ColumnSpec + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ColumnSpec.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.automl.v1beta1.ColumnSpec"; + }; + + ColumnSpec.CorrelatedColumn = (function() { + + /** + * Properties of a CorrelatedColumn. + * @memberof google.cloud.automl.v1beta1.ColumnSpec + * @interface ICorrelatedColumn + * @property {string|null} [columnSpecId] CorrelatedColumn columnSpecId + * @property {google.cloud.automl.v1beta1.ICorrelationStats|null} [correlationStats] CorrelatedColumn correlationStats + */ + + /** + * Constructs a new CorrelatedColumn. + * @memberof google.cloud.automl.v1beta1.ColumnSpec + * @classdesc Represents a CorrelatedColumn. + * @implements ICorrelatedColumn + * @constructor + * @param {google.cloud.automl.v1beta1.ColumnSpec.ICorrelatedColumn=} [properties] Properties to set + */ + function CorrelatedColumn(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * CorrelatedColumn columnSpecId. + * @member {string} columnSpecId + * @memberof google.cloud.automl.v1beta1.ColumnSpec.CorrelatedColumn + * @instance + */ + CorrelatedColumn.prototype.columnSpecId = ""; + + /** + * CorrelatedColumn correlationStats. + * @member {google.cloud.automl.v1beta1.ICorrelationStats|null|undefined} correlationStats + * @memberof google.cloud.automl.v1beta1.ColumnSpec.CorrelatedColumn + * @instance + */ + CorrelatedColumn.prototype.correlationStats = null; + + /** + * Creates a new CorrelatedColumn instance using the specified properties. + * @function create + * @memberof google.cloud.automl.v1beta1.ColumnSpec.CorrelatedColumn + * @static + * @param {google.cloud.automl.v1beta1.ColumnSpec.ICorrelatedColumn=} [properties] Properties to set + * @returns {google.cloud.automl.v1beta1.ColumnSpec.CorrelatedColumn} CorrelatedColumn instance + */ + CorrelatedColumn.create = function create(properties) { + return new CorrelatedColumn(properties); + }; + + /** + * Encodes the specified CorrelatedColumn message. Does not implicitly {@link google.cloud.automl.v1beta1.ColumnSpec.CorrelatedColumn.verify|verify} messages. + * @function encode + * @memberof google.cloud.automl.v1beta1.ColumnSpec.CorrelatedColumn + * @static + * @param {google.cloud.automl.v1beta1.ColumnSpec.ICorrelatedColumn} message CorrelatedColumn message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CorrelatedColumn.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.columnSpecId != null && Object.hasOwnProperty.call(message, "columnSpecId")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.columnSpecId); + if (message.correlationStats != null && Object.hasOwnProperty.call(message, "correlationStats")) + $root.google.cloud.automl.v1beta1.CorrelationStats.encode(message.correlationStats, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified CorrelatedColumn message, length delimited. Does not implicitly {@link google.cloud.automl.v1beta1.ColumnSpec.CorrelatedColumn.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.automl.v1beta1.ColumnSpec.CorrelatedColumn + * @static + * @param {google.cloud.automl.v1beta1.ColumnSpec.ICorrelatedColumn} message CorrelatedColumn message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CorrelatedColumn.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CorrelatedColumn message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.automl.v1beta1.ColumnSpec.CorrelatedColumn + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.automl.v1beta1.ColumnSpec.CorrelatedColumn} CorrelatedColumn + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CorrelatedColumn.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.automl.v1beta1.ColumnSpec.CorrelatedColumn(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.columnSpecId = reader.string(); + break; + } + case 2: { + message.correlationStats = $root.google.cloud.automl.v1beta1.CorrelationStats.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CorrelatedColumn message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.automl.v1beta1.ColumnSpec.CorrelatedColumn + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.automl.v1beta1.ColumnSpec.CorrelatedColumn} CorrelatedColumn + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CorrelatedColumn.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CorrelatedColumn message. + * @function verify + * @memberof google.cloud.automl.v1beta1.ColumnSpec.CorrelatedColumn + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CorrelatedColumn.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.columnSpecId != null && message.hasOwnProperty("columnSpecId")) + if (!$util.isString(message.columnSpecId)) + return "columnSpecId: string expected"; + if (message.correlationStats != null && message.hasOwnProperty("correlationStats")) { + var error = $root.google.cloud.automl.v1beta1.CorrelationStats.verify(message.correlationStats); + if (error) + return "correlationStats." + error; + } + return null; + }; + + /** + * Creates a CorrelatedColumn message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.automl.v1beta1.ColumnSpec.CorrelatedColumn + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.automl.v1beta1.ColumnSpec.CorrelatedColumn} CorrelatedColumn + */ + CorrelatedColumn.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.automl.v1beta1.ColumnSpec.CorrelatedColumn) + return object; + var message = new $root.google.cloud.automl.v1beta1.ColumnSpec.CorrelatedColumn(); + if (object.columnSpecId != null) + message.columnSpecId = String(object.columnSpecId); + if (object.correlationStats != null) { + if (typeof object.correlationStats !== "object") + throw TypeError(".google.cloud.automl.v1beta1.ColumnSpec.CorrelatedColumn.correlationStats: object expected"); + message.correlationStats = $root.google.cloud.automl.v1beta1.CorrelationStats.fromObject(object.correlationStats); + } + return message; + }; + + /** + * Creates a plain object from a CorrelatedColumn message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.automl.v1beta1.ColumnSpec.CorrelatedColumn + * @static + * @param {google.cloud.automl.v1beta1.ColumnSpec.CorrelatedColumn} message CorrelatedColumn + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CorrelatedColumn.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.columnSpecId = ""; + object.correlationStats = null; + } + if (message.columnSpecId != null && message.hasOwnProperty("columnSpecId")) + object.columnSpecId = message.columnSpecId; + if (message.correlationStats != null && message.hasOwnProperty("correlationStats")) + object.correlationStats = $root.google.cloud.automl.v1beta1.CorrelationStats.toObject(message.correlationStats, options); + return object; + }; + + /** + * Converts this CorrelatedColumn to JSON. + * @function toJSON + * @memberof google.cloud.automl.v1beta1.ColumnSpec.CorrelatedColumn + * @instance + * @returns {Object.} JSON object + */ + CorrelatedColumn.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CorrelatedColumn + * @function getTypeUrl + * @memberof google.cloud.automl.v1beta1.ColumnSpec.CorrelatedColumn + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CorrelatedColumn.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.automl.v1beta1.ColumnSpec.CorrelatedColumn"; + }; + + return CorrelatedColumn; + })(); + + return ColumnSpec; + })(); + + v1beta1.DataStats = (function() { + + /** + * Properties of a DataStats. + * @memberof google.cloud.automl.v1beta1 + * @interface IDataStats + * @property {google.cloud.automl.v1beta1.IFloat64Stats|null} [float64Stats] DataStats float64Stats + * @property {google.cloud.automl.v1beta1.IStringStats|null} [stringStats] DataStats stringStats + * @property {google.cloud.automl.v1beta1.ITimestampStats|null} [timestampStats] DataStats timestampStats + * @property {google.cloud.automl.v1beta1.IArrayStats|null} [arrayStats] DataStats arrayStats + * @property {google.cloud.automl.v1beta1.IStructStats|null} [structStats] DataStats structStats + * @property {google.cloud.automl.v1beta1.ICategoryStats|null} [categoryStats] DataStats categoryStats + * @property {number|Long|null} [distinctValueCount] DataStats distinctValueCount + * @property {number|Long|null} [nullValueCount] DataStats nullValueCount + * @property {number|Long|null} [validValueCount] DataStats validValueCount + */ + + /** + * Constructs a new DataStats. + * @memberof google.cloud.automl.v1beta1 + * @classdesc Represents a DataStats. + * @implements IDataStats + * @constructor + * @param {google.cloud.automl.v1beta1.IDataStats=} [properties] Properties to set + */ + function DataStats(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * DataStats float64Stats. + * @member {google.cloud.automl.v1beta1.IFloat64Stats|null|undefined} float64Stats + * @memberof google.cloud.automl.v1beta1.DataStats + * @instance + */ + DataStats.prototype.float64Stats = null; + + /** + * DataStats stringStats. + * @member {google.cloud.automl.v1beta1.IStringStats|null|undefined} stringStats + * @memberof google.cloud.automl.v1beta1.DataStats + * @instance + */ + DataStats.prototype.stringStats = null; + + /** + * DataStats timestampStats. + * @member {google.cloud.automl.v1beta1.ITimestampStats|null|undefined} timestampStats + * @memberof google.cloud.automl.v1beta1.DataStats + * @instance + */ + DataStats.prototype.timestampStats = null; + + /** + * DataStats arrayStats. + * @member {google.cloud.automl.v1beta1.IArrayStats|null|undefined} arrayStats + * @memberof google.cloud.automl.v1beta1.DataStats + * @instance + */ + DataStats.prototype.arrayStats = null; + + /** + * DataStats structStats. + * @member {google.cloud.automl.v1beta1.IStructStats|null|undefined} structStats + * @memberof google.cloud.automl.v1beta1.DataStats + * @instance + */ + DataStats.prototype.structStats = null; + + /** + * DataStats categoryStats. + * @member {google.cloud.automl.v1beta1.ICategoryStats|null|undefined} categoryStats + * @memberof google.cloud.automl.v1beta1.DataStats + * @instance + */ + DataStats.prototype.categoryStats = null; + + /** + * DataStats distinctValueCount. + * @member {number|Long} distinctValueCount + * @memberof google.cloud.automl.v1beta1.DataStats + * @instance + */ + DataStats.prototype.distinctValueCount = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * DataStats nullValueCount. + * @member {number|Long} nullValueCount + * @memberof google.cloud.automl.v1beta1.DataStats + * @instance + */ + DataStats.prototype.nullValueCount = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * DataStats validValueCount. + * @member {number|Long} validValueCount + * @memberof google.cloud.automl.v1beta1.DataStats + * @instance + */ + DataStats.prototype.validValueCount = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * DataStats stats. + * @member {"float64Stats"|"stringStats"|"timestampStats"|"arrayStats"|"structStats"|"categoryStats"|undefined} stats + * @memberof google.cloud.automl.v1beta1.DataStats + * @instance + */ + Object.defineProperty(DataStats.prototype, "stats", { + get: $util.oneOfGetter($oneOfFields = ["float64Stats", "stringStats", "timestampStats", "arrayStats", "structStats", "categoryStats"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new DataStats instance using the specified properties. + * @function create + * @memberof google.cloud.automl.v1beta1.DataStats + * @static + * @param {google.cloud.automl.v1beta1.IDataStats=} [properties] Properties to set + * @returns {google.cloud.automl.v1beta1.DataStats} DataStats instance + */ + DataStats.create = function create(properties) { + return new DataStats(properties); + }; + + /** + * Encodes the specified DataStats message. Does not implicitly {@link google.cloud.automl.v1beta1.DataStats.verify|verify} messages. + * @function encode + * @memberof google.cloud.automl.v1beta1.DataStats + * @static + * @param {google.cloud.automl.v1beta1.IDataStats} message DataStats message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DataStats.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.distinctValueCount != null && Object.hasOwnProperty.call(message, "distinctValueCount")) + writer.uint32(/* id 1, wireType 0 =*/8).int64(message.distinctValueCount); + if (message.nullValueCount != null && Object.hasOwnProperty.call(message, "nullValueCount")) + writer.uint32(/* id 2, wireType 0 =*/16).int64(message.nullValueCount); + if (message.float64Stats != null && Object.hasOwnProperty.call(message, "float64Stats")) + $root.google.cloud.automl.v1beta1.Float64Stats.encode(message.float64Stats, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.stringStats != null && Object.hasOwnProperty.call(message, "stringStats")) + $root.google.cloud.automl.v1beta1.StringStats.encode(message.stringStats, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.timestampStats != null && Object.hasOwnProperty.call(message, "timestampStats")) + $root.google.cloud.automl.v1beta1.TimestampStats.encode(message.timestampStats, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.arrayStats != null && Object.hasOwnProperty.call(message, "arrayStats")) + $root.google.cloud.automl.v1beta1.ArrayStats.encode(message.arrayStats, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + if (message.structStats != null && Object.hasOwnProperty.call(message, "structStats")) + $root.google.cloud.automl.v1beta1.StructStats.encode(message.structStats, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + if (message.categoryStats != null && Object.hasOwnProperty.call(message, "categoryStats")) + $root.google.cloud.automl.v1beta1.CategoryStats.encode(message.categoryStats, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); + if (message.validValueCount != null && Object.hasOwnProperty.call(message, "validValueCount")) + writer.uint32(/* id 9, wireType 0 =*/72).int64(message.validValueCount); + return writer; + }; + + /** + * Encodes the specified DataStats message, length delimited. Does not implicitly {@link google.cloud.automl.v1beta1.DataStats.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.automl.v1beta1.DataStats + * @static + * @param {google.cloud.automl.v1beta1.IDataStats} message DataStats message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DataStats.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DataStats message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.automl.v1beta1.DataStats + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.automl.v1beta1.DataStats} DataStats + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DataStats.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.automl.v1beta1.DataStats(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 3: { + message.float64Stats = $root.google.cloud.automl.v1beta1.Float64Stats.decode(reader, reader.uint32()); + break; + } + case 4: { + message.stringStats = $root.google.cloud.automl.v1beta1.StringStats.decode(reader, reader.uint32()); + break; + } + case 5: { + message.timestampStats = $root.google.cloud.automl.v1beta1.TimestampStats.decode(reader, reader.uint32()); + break; + } + case 6: { + message.arrayStats = $root.google.cloud.automl.v1beta1.ArrayStats.decode(reader, reader.uint32()); + break; + } + case 7: { + message.structStats = $root.google.cloud.automl.v1beta1.StructStats.decode(reader, reader.uint32()); + break; + } + case 8: { + message.categoryStats = $root.google.cloud.automl.v1beta1.CategoryStats.decode(reader, reader.uint32()); + break; + } + case 1: { + message.distinctValueCount = reader.int64(); + break; + } + case 2: { + message.nullValueCount = reader.int64(); + break; + } + case 9: { + message.validValueCount = reader.int64(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DataStats message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.automl.v1beta1.DataStats + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.automl.v1beta1.DataStats} DataStats + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DataStats.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DataStats message. + * @function verify + * @memberof google.cloud.automl.v1beta1.DataStats + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DataStats.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.float64Stats != null && message.hasOwnProperty("float64Stats")) { + properties.stats = 1; + { + var error = $root.google.cloud.automl.v1beta1.Float64Stats.verify(message.float64Stats); + if (error) + return "float64Stats." + error; + } + } + if (message.stringStats != null && message.hasOwnProperty("stringStats")) { + if (properties.stats === 1) + return "stats: multiple values"; + properties.stats = 1; + { + var error = $root.google.cloud.automl.v1beta1.StringStats.verify(message.stringStats); + if (error) + return "stringStats." + error; + } + } + if (message.timestampStats != null && message.hasOwnProperty("timestampStats")) { + if (properties.stats === 1) + return "stats: multiple values"; + properties.stats = 1; + { + var error = $root.google.cloud.automl.v1beta1.TimestampStats.verify(message.timestampStats); + if (error) + return "timestampStats." + error; + } + } + if (message.arrayStats != null && message.hasOwnProperty("arrayStats")) { + if (properties.stats === 1) + return "stats: multiple values"; + properties.stats = 1; + { + var error = $root.google.cloud.automl.v1beta1.ArrayStats.verify(message.arrayStats); + if (error) + return "arrayStats." + error; + } + } + if (message.structStats != null && message.hasOwnProperty("structStats")) { + if (properties.stats === 1) + return "stats: multiple values"; + properties.stats = 1; + { + var error = $root.google.cloud.automl.v1beta1.StructStats.verify(message.structStats); + if (error) + return "structStats." + error; + } + } + if (message.categoryStats != null && message.hasOwnProperty("categoryStats")) { + if (properties.stats === 1) + return "stats: multiple values"; + properties.stats = 1; + { + var error = $root.google.cloud.automl.v1beta1.CategoryStats.verify(message.categoryStats); + if (error) + return "categoryStats." + error; + } + } + if (message.distinctValueCount != null && message.hasOwnProperty("distinctValueCount")) + if (!$util.isInteger(message.distinctValueCount) && !(message.distinctValueCount && $util.isInteger(message.distinctValueCount.low) && $util.isInteger(message.distinctValueCount.high))) + return "distinctValueCount: integer|Long expected"; + if (message.nullValueCount != null && message.hasOwnProperty("nullValueCount")) + if (!$util.isInteger(message.nullValueCount) && !(message.nullValueCount && $util.isInteger(message.nullValueCount.low) && $util.isInteger(message.nullValueCount.high))) + return "nullValueCount: integer|Long expected"; + if (message.validValueCount != null && message.hasOwnProperty("validValueCount")) + if (!$util.isInteger(message.validValueCount) && !(message.validValueCount && $util.isInteger(message.validValueCount.low) && $util.isInteger(message.validValueCount.high))) + return "validValueCount: integer|Long expected"; + return null; + }; + + /** + * Creates a DataStats message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.automl.v1beta1.DataStats + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.automl.v1beta1.DataStats} DataStats + */ + DataStats.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.automl.v1beta1.DataStats) + return object; + var message = new $root.google.cloud.automl.v1beta1.DataStats(); + if (object.float64Stats != null) { + if (typeof object.float64Stats !== "object") + throw TypeError(".google.cloud.automl.v1beta1.DataStats.float64Stats: object expected"); + message.float64Stats = $root.google.cloud.automl.v1beta1.Float64Stats.fromObject(object.float64Stats); + } + if (object.stringStats != null) { + if (typeof object.stringStats !== "object") + throw TypeError(".google.cloud.automl.v1beta1.DataStats.stringStats: object expected"); + message.stringStats = $root.google.cloud.automl.v1beta1.StringStats.fromObject(object.stringStats); + } + if (object.timestampStats != null) { + if (typeof object.timestampStats !== "object") + throw TypeError(".google.cloud.automl.v1beta1.DataStats.timestampStats: object expected"); + message.timestampStats = $root.google.cloud.automl.v1beta1.TimestampStats.fromObject(object.timestampStats); + } + if (object.arrayStats != null) { + if (typeof object.arrayStats !== "object") + throw TypeError(".google.cloud.automl.v1beta1.DataStats.arrayStats: object expected"); + message.arrayStats = $root.google.cloud.automl.v1beta1.ArrayStats.fromObject(object.arrayStats); + } + if (object.structStats != null) { + if (typeof object.structStats !== "object") + throw TypeError(".google.cloud.automl.v1beta1.DataStats.structStats: object expected"); + message.structStats = $root.google.cloud.automl.v1beta1.StructStats.fromObject(object.structStats); + } + if (object.categoryStats != null) { + if (typeof object.categoryStats !== "object") + throw TypeError(".google.cloud.automl.v1beta1.DataStats.categoryStats: object expected"); + message.categoryStats = $root.google.cloud.automl.v1beta1.CategoryStats.fromObject(object.categoryStats); + } + if (object.distinctValueCount != null) + if ($util.Long) + (message.distinctValueCount = $util.Long.fromValue(object.distinctValueCount)).unsigned = false; + else if (typeof object.distinctValueCount === "string") + message.distinctValueCount = parseInt(object.distinctValueCount, 10); + else if (typeof object.distinctValueCount === "number") + message.distinctValueCount = object.distinctValueCount; + else if (typeof object.distinctValueCount === "object") + message.distinctValueCount = new $util.LongBits(object.distinctValueCount.low >>> 0, object.distinctValueCount.high >>> 0).toNumber(); + if (object.nullValueCount != null) + if ($util.Long) + (message.nullValueCount = $util.Long.fromValue(object.nullValueCount)).unsigned = false; + else if (typeof object.nullValueCount === "string") + message.nullValueCount = parseInt(object.nullValueCount, 10); + else if (typeof object.nullValueCount === "number") + message.nullValueCount = object.nullValueCount; + else if (typeof object.nullValueCount === "object") + message.nullValueCount = new $util.LongBits(object.nullValueCount.low >>> 0, object.nullValueCount.high >>> 0).toNumber(); + if (object.validValueCount != null) + if ($util.Long) + (message.validValueCount = $util.Long.fromValue(object.validValueCount)).unsigned = false; + else if (typeof object.validValueCount === "string") + message.validValueCount = parseInt(object.validValueCount, 10); + else if (typeof object.validValueCount === "number") + message.validValueCount = object.validValueCount; + else if (typeof object.validValueCount === "object") + message.validValueCount = new $util.LongBits(object.validValueCount.low >>> 0, object.validValueCount.high >>> 0).toNumber(); + return message; + }; + + /** + * Creates a plain object from a DataStats message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.automl.v1beta1.DataStats + * @static + * @param {google.cloud.automl.v1beta1.DataStats} message DataStats + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DataStats.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.distinctValueCount = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.distinctValueCount = options.longs === String ? "0" : 0; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.nullValueCount = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.nullValueCount = options.longs === String ? "0" : 0; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.validValueCount = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.validValueCount = options.longs === String ? "0" : 0; + } + if (message.distinctValueCount != null && message.hasOwnProperty("distinctValueCount")) + if (typeof message.distinctValueCount === "number") + object.distinctValueCount = options.longs === String ? String(message.distinctValueCount) : message.distinctValueCount; + else + object.distinctValueCount = options.longs === String ? $util.Long.prototype.toString.call(message.distinctValueCount) : options.longs === Number ? new $util.LongBits(message.distinctValueCount.low >>> 0, message.distinctValueCount.high >>> 0).toNumber() : message.distinctValueCount; + if (message.nullValueCount != null && message.hasOwnProperty("nullValueCount")) + if (typeof message.nullValueCount === "number") + object.nullValueCount = options.longs === String ? String(message.nullValueCount) : message.nullValueCount; + else + object.nullValueCount = options.longs === String ? $util.Long.prototype.toString.call(message.nullValueCount) : options.longs === Number ? new $util.LongBits(message.nullValueCount.low >>> 0, message.nullValueCount.high >>> 0).toNumber() : message.nullValueCount; + if (message.float64Stats != null && message.hasOwnProperty("float64Stats")) { + object.float64Stats = $root.google.cloud.automl.v1beta1.Float64Stats.toObject(message.float64Stats, options); + if (options.oneofs) + object.stats = "float64Stats"; + } + if (message.stringStats != null && message.hasOwnProperty("stringStats")) { + object.stringStats = $root.google.cloud.automl.v1beta1.StringStats.toObject(message.stringStats, options); + if (options.oneofs) + object.stats = "stringStats"; + } + if (message.timestampStats != null && message.hasOwnProperty("timestampStats")) { + object.timestampStats = $root.google.cloud.automl.v1beta1.TimestampStats.toObject(message.timestampStats, options); + if (options.oneofs) + object.stats = "timestampStats"; + } + if (message.arrayStats != null && message.hasOwnProperty("arrayStats")) { + object.arrayStats = $root.google.cloud.automl.v1beta1.ArrayStats.toObject(message.arrayStats, options); + if (options.oneofs) + object.stats = "arrayStats"; + } + if (message.structStats != null && message.hasOwnProperty("structStats")) { + object.structStats = $root.google.cloud.automl.v1beta1.StructStats.toObject(message.structStats, options); + if (options.oneofs) + object.stats = "structStats"; + } + if (message.categoryStats != null && message.hasOwnProperty("categoryStats")) { + object.categoryStats = $root.google.cloud.automl.v1beta1.CategoryStats.toObject(message.categoryStats, options); + if (options.oneofs) + object.stats = "categoryStats"; + } + if (message.validValueCount != null && message.hasOwnProperty("validValueCount")) + if (typeof message.validValueCount === "number") + object.validValueCount = options.longs === String ? String(message.validValueCount) : message.validValueCount; + else + object.validValueCount = options.longs === String ? $util.Long.prototype.toString.call(message.validValueCount) : options.longs === Number ? new $util.LongBits(message.validValueCount.low >>> 0, message.validValueCount.high >>> 0).toNumber() : message.validValueCount; + return object; + }; + + /** + * Converts this DataStats to JSON. + * @function toJSON + * @memberof google.cloud.automl.v1beta1.DataStats + * @instance + * @returns {Object.} JSON object + */ + DataStats.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DataStats + * @function getTypeUrl + * @memberof google.cloud.automl.v1beta1.DataStats + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DataStats.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.automl.v1beta1.DataStats"; + }; + + return DataStats; + })(); + + v1beta1.Float64Stats = (function() { + + /** + * Properties of a Float64Stats. + * @memberof google.cloud.automl.v1beta1 + * @interface IFloat64Stats + * @property {number|null} [mean] Float64Stats mean + * @property {number|null} [standardDeviation] Float64Stats standardDeviation + * @property {Array.|null} [quantiles] Float64Stats quantiles + * @property {Array.|null} [histogramBuckets] Float64Stats histogramBuckets + */ + + /** + * Constructs a new Float64Stats. + * @memberof google.cloud.automl.v1beta1 + * @classdesc Represents a Float64Stats. + * @implements IFloat64Stats + * @constructor + * @param {google.cloud.automl.v1beta1.IFloat64Stats=} [properties] Properties to set + */ + function Float64Stats(properties) { + this.quantiles = []; + this.histogramBuckets = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Float64Stats mean. + * @member {number} mean + * @memberof google.cloud.automl.v1beta1.Float64Stats + * @instance + */ + Float64Stats.prototype.mean = 0; + + /** + * Float64Stats standardDeviation. + * @member {number} standardDeviation + * @memberof google.cloud.automl.v1beta1.Float64Stats + * @instance + */ + Float64Stats.prototype.standardDeviation = 0; + + /** + * Float64Stats quantiles. + * @member {Array.} quantiles + * @memberof google.cloud.automl.v1beta1.Float64Stats + * @instance + */ + Float64Stats.prototype.quantiles = $util.emptyArray; + + /** + * Float64Stats histogramBuckets. + * @member {Array.} histogramBuckets + * @memberof google.cloud.automl.v1beta1.Float64Stats + * @instance + */ + Float64Stats.prototype.histogramBuckets = $util.emptyArray; + + /** + * Creates a new Float64Stats instance using the specified properties. + * @function create + * @memberof google.cloud.automl.v1beta1.Float64Stats + * @static + * @param {google.cloud.automl.v1beta1.IFloat64Stats=} [properties] Properties to set + * @returns {google.cloud.automl.v1beta1.Float64Stats} Float64Stats instance + */ + Float64Stats.create = function create(properties) { + return new Float64Stats(properties); + }; + + /** + * Encodes the specified Float64Stats message. Does not implicitly {@link google.cloud.automl.v1beta1.Float64Stats.verify|verify} messages. + * @function encode + * @memberof google.cloud.automl.v1beta1.Float64Stats + * @static + * @param {google.cloud.automl.v1beta1.IFloat64Stats} message Float64Stats message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Float64Stats.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.mean != null && Object.hasOwnProperty.call(message, "mean")) + writer.uint32(/* id 1, wireType 1 =*/9).double(message.mean); + if (message.standardDeviation != null && Object.hasOwnProperty.call(message, "standardDeviation")) + writer.uint32(/* id 2, wireType 1 =*/17).double(message.standardDeviation); + if (message.quantiles != null && message.quantiles.length) { + writer.uint32(/* id 3, wireType 2 =*/26).fork(); + for (var i = 0; i < message.quantiles.length; ++i) + writer.double(message.quantiles[i]); + writer.ldelim(); + } + if (message.histogramBuckets != null && message.histogramBuckets.length) + for (var i = 0; i < message.histogramBuckets.length; ++i) + $root.google.cloud.automl.v1beta1.Float64Stats.HistogramBucket.encode(message.histogramBuckets[i], writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified Float64Stats message, length delimited. Does not implicitly {@link google.cloud.automl.v1beta1.Float64Stats.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.automl.v1beta1.Float64Stats + * @static + * @param {google.cloud.automl.v1beta1.IFloat64Stats} message Float64Stats message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Float64Stats.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Float64Stats message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.automl.v1beta1.Float64Stats + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.automl.v1beta1.Float64Stats} Float64Stats + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Float64Stats.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.automl.v1beta1.Float64Stats(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.mean = reader.double(); + break; + } + case 2: { + message.standardDeviation = reader.double(); + break; + } + case 3: { + if (!(message.quantiles && message.quantiles.length)) + message.quantiles = []; + if ((tag & 7) === 2) { + var end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) + message.quantiles.push(reader.double()); + } else + message.quantiles.push(reader.double()); + break; + } + case 4: { + if (!(message.histogramBuckets && message.histogramBuckets.length)) + message.histogramBuckets = []; + message.histogramBuckets.push($root.google.cloud.automl.v1beta1.Float64Stats.HistogramBucket.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Float64Stats message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.automl.v1beta1.Float64Stats + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.automl.v1beta1.Float64Stats} Float64Stats + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Float64Stats.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Float64Stats message. + * @function verify + * @memberof google.cloud.automl.v1beta1.Float64Stats + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Float64Stats.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.mean != null && message.hasOwnProperty("mean")) + if (typeof message.mean !== "number") + return "mean: number expected"; + if (message.standardDeviation != null && message.hasOwnProperty("standardDeviation")) + if (typeof message.standardDeviation !== "number") + return "standardDeviation: number expected"; + if (message.quantiles != null && message.hasOwnProperty("quantiles")) { + if (!Array.isArray(message.quantiles)) + return "quantiles: array expected"; + for (var i = 0; i < message.quantiles.length; ++i) + if (typeof message.quantiles[i] !== "number") + return "quantiles: number[] expected"; + } + if (message.histogramBuckets != null && message.hasOwnProperty("histogramBuckets")) { + if (!Array.isArray(message.histogramBuckets)) + return "histogramBuckets: array expected"; + for (var i = 0; i < message.histogramBuckets.length; ++i) { + var error = $root.google.cloud.automl.v1beta1.Float64Stats.HistogramBucket.verify(message.histogramBuckets[i]); + if (error) + return "histogramBuckets." + error; + } + } + return null; + }; + + /** + * Creates a Float64Stats message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.automl.v1beta1.Float64Stats + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.automl.v1beta1.Float64Stats} Float64Stats + */ + Float64Stats.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.automl.v1beta1.Float64Stats) + return object; + var message = new $root.google.cloud.automl.v1beta1.Float64Stats(); + if (object.mean != null) + message.mean = Number(object.mean); + if (object.standardDeviation != null) + message.standardDeviation = Number(object.standardDeviation); + if (object.quantiles) { + if (!Array.isArray(object.quantiles)) + throw TypeError(".google.cloud.automl.v1beta1.Float64Stats.quantiles: array expected"); + message.quantiles = []; + for (var i = 0; i < object.quantiles.length; ++i) + message.quantiles[i] = Number(object.quantiles[i]); + } + if (object.histogramBuckets) { + if (!Array.isArray(object.histogramBuckets)) + throw TypeError(".google.cloud.automl.v1beta1.Float64Stats.histogramBuckets: array expected"); + message.histogramBuckets = []; + for (var i = 0; i < object.histogramBuckets.length; ++i) { + if (typeof object.histogramBuckets[i] !== "object") + throw TypeError(".google.cloud.automl.v1beta1.Float64Stats.histogramBuckets: object expected"); + message.histogramBuckets[i] = $root.google.cloud.automl.v1beta1.Float64Stats.HistogramBucket.fromObject(object.histogramBuckets[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a Float64Stats message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.automl.v1beta1.Float64Stats + * @static + * @param {google.cloud.automl.v1beta1.Float64Stats} message Float64Stats + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Float64Stats.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.quantiles = []; + object.histogramBuckets = []; + } + if (options.defaults) { + object.mean = 0; + object.standardDeviation = 0; + } + if (message.mean != null && message.hasOwnProperty("mean")) + object.mean = options.json && !isFinite(message.mean) ? String(message.mean) : message.mean; + if (message.standardDeviation != null && message.hasOwnProperty("standardDeviation")) + object.standardDeviation = options.json && !isFinite(message.standardDeviation) ? String(message.standardDeviation) : message.standardDeviation; + if (message.quantiles && message.quantiles.length) { + object.quantiles = []; + for (var j = 0; j < message.quantiles.length; ++j) + object.quantiles[j] = options.json && !isFinite(message.quantiles[j]) ? String(message.quantiles[j]) : message.quantiles[j]; + } + if (message.histogramBuckets && message.histogramBuckets.length) { + object.histogramBuckets = []; + for (var j = 0; j < message.histogramBuckets.length; ++j) + object.histogramBuckets[j] = $root.google.cloud.automl.v1beta1.Float64Stats.HistogramBucket.toObject(message.histogramBuckets[j], options); + } + return object; + }; + + /** + * Converts this Float64Stats to JSON. + * @function toJSON + * @memberof google.cloud.automl.v1beta1.Float64Stats + * @instance + * @returns {Object.} JSON object + */ + Float64Stats.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Float64Stats + * @function getTypeUrl + * @memberof google.cloud.automl.v1beta1.Float64Stats + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Float64Stats.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.automl.v1beta1.Float64Stats"; + }; + + Float64Stats.HistogramBucket = (function() { + + /** + * Properties of a HistogramBucket. + * @memberof google.cloud.automl.v1beta1.Float64Stats + * @interface IHistogramBucket + * @property {number|null} [min] HistogramBucket min + * @property {number|null} [max] HistogramBucket max + * @property {number|Long|null} [count] HistogramBucket count + */ + + /** + * Constructs a new HistogramBucket. + * @memberof google.cloud.automl.v1beta1.Float64Stats + * @classdesc Represents a HistogramBucket. + * @implements IHistogramBucket + * @constructor + * @param {google.cloud.automl.v1beta1.Float64Stats.IHistogramBucket=} [properties] Properties to set + */ + function HistogramBucket(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * HistogramBucket min. + * @member {number} min + * @memberof google.cloud.automl.v1beta1.Float64Stats.HistogramBucket + * @instance + */ + HistogramBucket.prototype.min = 0; + + /** + * HistogramBucket max. + * @member {number} max + * @memberof google.cloud.automl.v1beta1.Float64Stats.HistogramBucket + * @instance + */ + HistogramBucket.prototype.max = 0; + + /** + * HistogramBucket count. + * @member {number|Long} count + * @memberof google.cloud.automl.v1beta1.Float64Stats.HistogramBucket + * @instance + */ + HistogramBucket.prototype.count = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new HistogramBucket instance using the specified properties. + * @function create + * @memberof google.cloud.automl.v1beta1.Float64Stats.HistogramBucket + * @static + * @param {google.cloud.automl.v1beta1.Float64Stats.IHistogramBucket=} [properties] Properties to set + * @returns {google.cloud.automl.v1beta1.Float64Stats.HistogramBucket} HistogramBucket instance + */ + HistogramBucket.create = function create(properties) { + return new HistogramBucket(properties); + }; + + /** + * Encodes the specified HistogramBucket message. Does not implicitly {@link google.cloud.automl.v1beta1.Float64Stats.HistogramBucket.verify|verify} messages. + * @function encode + * @memberof google.cloud.automl.v1beta1.Float64Stats.HistogramBucket + * @static + * @param {google.cloud.automl.v1beta1.Float64Stats.IHistogramBucket} message HistogramBucket message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + HistogramBucket.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.min != null && Object.hasOwnProperty.call(message, "min")) + writer.uint32(/* id 1, wireType 1 =*/9).double(message.min); + if (message.max != null && Object.hasOwnProperty.call(message, "max")) + writer.uint32(/* id 2, wireType 1 =*/17).double(message.max); + if (message.count != null && Object.hasOwnProperty.call(message, "count")) + writer.uint32(/* id 3, wireType 0 =*/24).int64(message.count); + return writer; + }; + + /** + * Encodes the specified HistogramBucket message, length delimited. Does not implicitly {@link google.cloud.automl.v1beta1.Float64Stats.HistogramBucket.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.automl.v1beta1.Float64Stats.HistogramBucket + * @static + * @param {google.cloud.automl.v1beta1.Float64Stats.IHistogramBucket} message HistogramBucket message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + HistogramBucket.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a HistogramBucket message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.automl.v1beta1.Float64Stats.HistogramBucket + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.automl.v1beta1.Float64Stats.HistogramBucket} HistogramBucket + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + HistogramBucket.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.automl.v1beta1.Float64Stats.HistogramBucket(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.min = reader.double(); + break; + } + case 2: { + message.max = reader.double(); + break; + } + case 3: { + message.count = reader.int64(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a HistogramBucket message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.automl.v1beta1.Float64Stats.HistogramBucket + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.automl.v1beta1.Float64Stats.HistogramBucket} HistogramBucket + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + HistogramBucket.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a HistogramBucket message. + * @function verify + * @memberof google.cloud.automl.v1beta1.Float64Stats.HistogramBucket + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + HistogramBucket.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.min != null && message.hasOwnProperty("min")) + if (typeof message.min !== "number") + return "min: number expected"; + if (message.max != null && message.hasOwnProperty("max")) + if (typeof message.max !== "number") + return "max: number expected"; + if (message.count != null && message.hasOwnProperty("count")) + if (!$util.isInteger(message.count) && !(message.count && $util.isInteger(message.count.low) && $util.isInteger(message.count.high))) + return "count: integer|Long expected"; + return null; + }; + + /** + * Creates a HistogramBucket message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.automl.v1beta1.Float64Stats.HistogramBucket + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.automl.v1beta1.Float64Stats.HistogramBucket} HistogramBucket + */ + HistogramBucket.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.automl.v1beta1.Float64Stats.HistogramBucket) + return object; + var message = new $root.google.cloud.automl.v1beta1.Float64Stats.HistogramBucket(); + if (object.min != null) + message.min = Number(object.min); + if (object.max != null) + message.max = Number(object.max); + if (object.count != null) + if ($util.Long) + (message.count = $util.Long.fromValue(object.count)).unsigned = false; + else if (typeof object.count === "string") + message.count = parseInt(object.count, 10); + else if (typeof object.count === "number") + message.count = object.count; + else if (typeof object.count === "object") + message.count = new $util.LongBits(object.count.low >>> 0, object.count.high >>> 0).toNumber(); + return message; + }; + + /** + * Creates a plain object from a HistogramBucket message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.automl.v1beta1.Float64Stats.HistogramBucket + * @static + * @param {google.cloud.automl.v1beta1.Float64Stats.HistogramBucket} message HistogramBucket + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + HistogramBucket.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.min = 0; + object.max = 0; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.count = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.count = options.longs === String ? "0" : 0; + } + if (message.min != null && message.hasOwnProperty("min")) + object.min = options.json && !isFinite(message.min) ? String(message.min) : message.min; + if (message.max != null && message.hasOwnProperty("max")) + object.max = options.json && !isFinite(message.max) ? String(message.max) : message.max; + if (message.count != null && message.hasOwnProperty("count")) + if (typeof message.count === "number") + object.count = options.longs === String ? String(message.count) : message.count; + else + object.count = options.longs === String ? $util.Long.prototype.toString.call(message.count) : options.longs === Number ? new $util.LongBits(message.count.low >>> 0, message.count.high >>> 0).toNumber() : message.count; + return object; + }; + + /** + * Converts this HistogramBucket to JSON. + * @function toJSON + * @memberof google.cloud.automl.v1beta1.Float64Stats.HistogramBucket + * @instance + * @returns {Object.} JSON object + */ + HistogramBucket.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for HistogramBucket + * @function getTypeUrl + * @memberof google.cloud.automl.v1beta1.Float64Stats.HistogramBucket + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + HistogramBucket.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.automl.v1beta1.Float64Stats.HistogramBucket"; + }; + + return HistogramBucket; + })(); + + return Float64Stats; + })(); + + v1beta1.StringStats = (function() { + + /** + * Properties of a StringStats. + * @memberof google.cloud.automl.v1beta1 + * @interface IStringStats + * @property {Array.|null} [topUnigramStats] StringStats topUnigramStats + */ + + /** + * Constructs a new StringStats. + * @memberof google.cloud.automl.v1beta1 + * @classdesc Represents a StringStats. + * @implements IStringStats + * @constructor + * @param {google.cloud.automl.v1beta1.IStringStats=} [properties] Properties to set + */ + function StringStats(properties) { + this.topUnigramStats = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * StringStats topUnigramStats. + * @member {Array.} topUnigramStats + * @memberof google.cloud.automl.v1beta1.StringStats + * @instance + */ + StringStats.prototype.topUnigramStats = $util.emptyArray; + + /** + * Creates a new StringStats instance using the specified properties. + * @function create + * @memberof google.cloud.automl.v1beta1.StringStats + * @static + * @param {google.cloud.automl.v1beta1.IStringStats=} [properties] Properties to set + * @returns {google.cloud.automl.v1beta1.StringStats} StringStats instance + */ + StringStats.create = function create(properties) { + return new StringStats(properties); + }; + + /** + * Encodes the specified StringStats message. Does not implicitly {@link google.cloud.automl.v1beta1.StringStats.verify|verify} messages. + * @function encode + * @memberof google.cloud.automl.v1beta1.StringStats + * @static + * @param {google.cloud.automl.v1beta1.IStringStats} message StringStats message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + StringStats.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.topUnigramStats != null && message.topUnigramStats.length) + for (var i = 0; i < message.topUnigramStats.length; ++i) + $root.google.cloud.automl.v1beta1.StringStats.UnigramStats.encode(message.topUnigramStats[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified StringStats message, length delimited. Does not implicitly {@link google.cloud.automl.v1beta1.StringStats.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.automl.v1beta1.StringStats + * @static + * @param {google.cloud.automl.v1beta1.IStringStats} message StringStats message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + StringStats.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a StringStats message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.automl.v1beta1.StringStats + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.automl.v1beta1.StringStats} StringStats + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + StringStats.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.automl.v1beta1.StringStats(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.topUnigramStats && message.topUnigramStats.length)) + message.topUnigramStats = []; + message.topUnigramStats.push($root.google.cloud.automl.v1beta1.StringStats.UnigramStats.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a StringStats message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.automl.v1beta1.StringStats + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.automl.v1beta1.StringStats} StringStats + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + StringStats.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a StringStats message. + * @function verify + * @memberof google.cloud.automl.v1beta1.StringStats + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + StringStats.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.topUnigramStats != null && message.hasOwnProperty("topUnigramStats")) { + if (!Array.isArray(message.topUnigramStats)) + return "topUnigramStats: array expected"; + for (var i = 0; i < message.topUnigramStats.length; ++i) { + var error = $root.google.cloud.automl.v1beta1.StringStats.UnigramStats.verify(message.topUnigramStats[i]); + if (error) + return "topUnigramStats." + error; + } + } + return null; + }; + + /** + * Creates a StringStats message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.automl.v1beta1.StringStats + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.automl.v1beta1.StringStats} StringStats + */ + StringStats.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.automl.v1beta1.StringStats) + return object; + var message = new $root.google.cloud.automl.v1beta1.StringStats(); + if (object.topUnigramStats) { + if (!Array.isArray(object.topUnigramStats)) + throw TypeError(".google.cloud.automl.v1beta1.StringStats.topUnigramStats: array expected"); + message.topUnigramStats = []; + for (var i = 0; i < object.topUnigramStats.length; ++i) { + if (typeof object.topUnigramStats[i] !== "object") + throw TypeError(".google.cloud.automl.v1beta1.StringStats.topUnigramStats: object expected"); + message.topUnigramStats[i] = $root.google.cloud.automl.v1beta1.StringStats.UnigramStats.fromObject(object.topUnigramStats[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a StringStats message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.automl.v1beta1.StringStats + * @static + * @param {google.cloud.automl.v1beta1.StringStats} message StringStats + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + StringStats.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.topUnigramStats = []; + if (message.topUnigramStats && message.topUnigramStats.length) { + object.topUnigramStats = []; + for (var j = 0; j < message.topUnigramStats.length; ++j) + object.topUnigramStats[j] = $root.google.cloud.automl.v1beta1.StringStats.UnigramStats.toObject(message.topUnigramStats[j], options); + } + return object; + }; + + /** + * Converts this StringStats to JSON. + * @function toJSON + * @memberof google.cloud.automl.v1beta1.StringStats + * @instance + * @returns {Object.} JSON object + */ + StringStats.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for StringStats + * @function getTypeUrl + * @memberof google.cloud.automl.v1beta1.StringStats + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + StringStats.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.automl.v1beta1.StringStats"; + }; + + StringStats.UnigramStats = (function() { + + /** + * Properties of an UnigramStats. + * @memberof google.cloud.automl.v1beta1.StringStats + * @interface IUnigramStats + * @property {string|null} [value] UnigramStats value + * @property {number|Long|null} [count] UnigramStats count + */ + + /** + * Constructs a new UnigramStats. + * @memberof google.cloud.automl.v1beta1.StringStats + * @classdesc Represents an UnigramStats. + * @implements IUnigramStats + * @constructor + * @param {google.cloud.automl.v1beta1.StringStats.IUnigramStats=} [properties] Properties to set + */ + function UnigramStats(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * UnigramStats value. + * @member {string} value + * @memberof google.cloud.automl.v1beta1.StringStats.UnigramStats + * @instance + */ + UnigramStats.prototype.value = ""; + + /** + * UnigramStats count. + * @member {number|Long} count + * @memberof google.cloud.automl.v1beta1.StringStats.UnigramStats + * @instance + */ + UnigramStats.prototype.count = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new UnigramStats instance using the specified properties. + * @function create + * @memberof google.cloud.automl.v1beta1.StringStats.UnigramStats + * @static + * @param {google.cloud.automl.v1beta1.StringStats.IUnigramStats=} [properties] Properties to set + * @returns {google.cloud.automl.v1beta1.StringStats.UnigramStats} UnigramStats instance + */ + UnigramStats.create = function create(properties) { + return new UnigramStats(properties); + }; + + /** + * Encodes the specified UnigramStats message. Does not implicitly {@link google.cloud.automl.v1beta1.StringStats.UnigramStats.verify|verify} messages. + * @function encode + * @memberof google.cloud.automl.v1beta1.StringStats.UnigramStats + * @static + * @param {google.cloud.automl.v1beta1.StringStats.IUnigramStats} message UnigramStats message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UnigramStats.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.count != null && Object.hasOwnProperty.call(message, "count")) + writer.uint32(/* id 2, wireType 0 =*/16).int64(message.count); + return writer; + }; + + /** + * Encodes the specified UnigramStats message, length delimited. Does not implicitly {@link google.cloud.automl.v1beta1.StringStats.UnigramStats.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.automl.v1beta1.StringStats.UnigramStats + * @static + * @param {google.cloud.automl.v1beta1.StringStats.IUnigramStats} message UnigramStats message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UnigramStats.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an UnigramStats message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.automl.v1beta1.StringStats.UnigramStats + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.automl.v1beta1.StringStats.UnigramStats} UnigramStats + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UnigramStats.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.automl.v1beta1.StringStats.UnigramStats(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.value = reader.string(); + break; + } + case 2: { + message.count = reader.int64(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an UnigramStats message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.automl.v1beta1.StringStats.UnigramStats + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.automl.v1beta1.StringStats.UnigramStats} UnigramStats + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UnigramStats.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an UnigramStats message. + * @function verify + * @memberof google.cloud.automl.v1beta1.StringStats.UnigramStats + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + UnigramStats.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.count != null && message.hasOwnProperty("count")) + if (!$util.isInteger(message.count) && !(message.count && $util.isInteger(message.count.low) && $util.isInteger(message.count.high))) + return "count: integer|Long expected"; + return null; + }; + + /** + * Creates an UnigramStats message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.automl.v1beta1.StringStats.UnigramStats + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.automl.v1beta1.StringStats.UnigramStats} UnigramStats + */ + UnigramStats.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.automl.v1beta1.StringStats.UnigramStats) + return object; + var message = new $root.google.cloud.automl.v1beta1.StringStats.UnigramStats(); + if (object.value != null) + message.value = String(object.value); + if (object.count != null) + if ($util.Long) + (message.count = $util.Long.fromValue(object.count)).unsigned = false; + else if (typeof object.count === "string") + message.count = parseInt(object.count, 10); + else if (typeof object.count === "number") + message.count = object.count; + else if (typeof object.count === "object") + message.count = new $util.LongBits(object.count.low >>> 0, object.count.high >>> 0).toNumber(); + return message; + }; + + /** + * Creates a plain object from an UnigramStats message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.automl.v1beta1.StringStats.UnigramStats + * @static + * @param {google.cloud.automl.v1beta1.StringStats.UnigramStats} message UnigramStats + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + UnigramStats.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.value = ""; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.count = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.count = options.longs === String ? "0" : 0; + } + if (message.value != null && message.hasOwnProperty("value")) + object.value = message.value; + if (message.count != null && message.hasOwnProperty("count")) + if (typeof message.count === "number") + object.count = options.longs === String ? String(message.count) : message.count; + else + object.count = options.longs === String ? $util.Long.prototype.toString.call(message.count) : options.longs === Number ? new $util.LongBits(message.count.low >>> 0, message.count.high >>> 0).toNumber() : message.count; + return object; + }; + + /** + * Converts this UnigramStats to JSON. + * @function toJSON + * @memberof google.cloud.automl.v1beta1.StringStats.UnigramStats + * @instance + * @returns {Object.} JSON object + */ + UnigramStats.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for UnigramStats + * @function getTypeUrl + * @memberof google.cloud.automl.v1beta1.StringStats.UnigramStats + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + UnigramStats.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.automl.v1beta1.StringStats.UnigramStats"; + }; + + return UnigramStats; + })(); + + return StringStats; + })(); + + v1beta1.TimestampStats = (function() { + + /** + * Properties of a TimestampStats. + * @memberof google.cloud.automl.v1beta1 + * @interface ITimestampStats + * @property {Object.|null} [granularStats] TimestampStats granularStats + */ + + /** + * Constructs a new TimestampStats. + * @memberof google.cloud.automl.v1beta1 + * @classdesc Represents a TimestampStats. + * @implements ITimestampStats + * @constructor + * @param {google.cloud.automl.v1beta1.ITimestampStats=} [properties] Properties to set + */ + function TimestampStats(properties) { + this.granularStats = {}; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * TimestampStats granularStats. + * @member {Object.} granularStats + * @memberof google.cloud.automl.v1beta1.TimestampStats + * @instance + */ + TimestampStats.prototype.granularStats = $util.emptyObject; + + /** + * Creates a new TimestampStats instance using the specified properties. + * @function create + * @memberof google.cloud.automl.v1beta1.TimestampStats + * @static + * @param {google.cloud.automl.v1beta1.ITimestampStats=} [properties] Properties to set + * @returns {google.cloud.automl.v1beta1.TimestampStats} TimestampStats instance + */ + TimestampStats.create = function create(properties) { + return new TimestampStats(properties); + }; + + /** + * Encodes the specified TimestampStats message. Does not implicitly {@link google.cloud.automl.v1beta1.TimestampStats.verify|verify} messages. + * @function encode + * @memberof google.cloud.automl.v1beta1.TimestampStats + * @static + * @param {google.cloud.automl.v1beta1.ITimestampStats} message TimestampStats message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TimestampStats.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.granularStats != null && Object.hasOwnProperty.call(message, "granularStats")) + for (var keys = Object.keys(message.granularStats), 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.automl.v1beta1.TimestampStats.GranularStats.encode(message.granularStats[keys[i]], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim().ldelim(); + } + return writer; + }; + + /** + * Encodes the specified TimestampStats message, length delimited. Does not implicitly {@link google.cloud.automl.v1beta1.TimestampStats.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.automl.v1beta1.TimestampStats + * @static + * @param {google.cloud.automl.v1beta1.ITimestampStats} message TimestampStats message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TimestampStats.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a TimestampStats message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.automl.v1beta1.TimestampStats + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.automl.v1beta1.TimestampStats} TimestampStats + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TimestampStats.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.automl.v1beta1.TimestampStats(), key, value; + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (message.granularStats === $util.emptyObject) + message.granularStats = {}; + 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.automl.v1beta1.TimestampStats.GranularStats.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag2 & 7); + break; + } + } + message.granularStats[key] = value; + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a TimestampStats message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.automl.v1beta1.TimestampStats + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.automl.v1beta1.TimestampStats} TimestampStats + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TimestampStats.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a TimestampStats message. + * @function verify + * @memberof google.cloud.automl.v1beta1.TimestampStats + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + TimestampStats.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.granularStats != null && message.hasOwnProperty("granularStats")) { + if (!$util.isObject(message.granularStats)) + return "granularStats: object expected"; + var key = Object.keys(message.granularStats); + for (var i = 0; i < key.length; ++i) { + var error = $root.google.cloud.automl.v1beta1.TimestampStats.GranularStats.verify(message.granularStats[key[i]]); + if (error) + return "granularStats." + error; + } + } + return null; + }; + + /** + * Creates a TimestampStats message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.automl.v1beta1.TimestampStats + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.automl.v1beta1.TimestampStats} TimestampStats + */ + TimestampStats.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.automl.v1beta1.TimestampStats) + return object; + var message = new $root.google.cloud.automl.v1beta1.TimestampStats(); + if (object.granularStats) { + if (typeof object.granularStats !== "object") + throw TypeError(".google.cloud.automl.v1beta1.TimestampStats.granularStats: object expected"); + message.granularStats = {}; + for (var keys = Object.keys(object.granularStats), i = 0; i < keys.length; ++i) { + if (typeof object.granularStats[keys[i]] !== "object") + throw TypeError(".google.cloud.automl.v1beta1.TimestampStats.granularStats: object expected"); + message.granularStats[keys[i]] = $root.google.cloud.automl.v1beta1.TimestampStats.GranularStats.fromObject(object.granularStats[keys[i]]); + } + } + return message; + }; + + /** + * Creates a plain object from a TimestampStats message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.automl.v1beta1.TimestampStats + * @static + * @param {google.cloud.automl.v1beta1.TimestampStats} message TimestampStats + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + TimestampStats.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.objects || options.defaults) + object.granularStats = {}; + var keys2; + if (message.granularStats && (keys2 = Object.keys(message.granularStats)).length) { + object.granularStats = {}; + for (var j = 0; j < keys2.length; ++j) + object.granularStats[keys2[j]] = $root.google.cloud.automl.v1beta1.TimestampStats.GranularStats.toObject(message.granularStats[keys2[j]], options); + } + return object; + }; + + /** + * Converts this TimestampStats to JSON. + * @function toJSON + * @memberof google.cloud.automl.v1beta1.TimestampStats + * @instance + * @returns {Object.} JSON object + */ + TimestampStats.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for TimestampStats + * @function getTypeUrl + * @memberof google.cloud.automl.v1beta1.TimestampStats + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TimestampStats.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.automl.v1beta1.TimestampStats"; + }; + + TimestampStats.GranularStats = (function() { + + /** + * Properties of a GranularStats. + * @memberof google.cloud.automl.v1beta1.TimestampStats + * @interface IGranularStats + * @property {Object.|null} [buckets] GranularStats buckets + */ + + /** + * Constructs a new GranularStats. + * @memberof google.cloud.automl.v1beta1.TimestampStats + * @classdesc Represents a GranularStats. + * @implements IGranularStats + * @constructor + * @param {google.cloud.automl.v1beta1.TimestampStats.IGranularStats=} [properties] Properties to set + */ + function GranularStats(properties) { + this.buckets = {}; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GranularStats buckets. + * @member {Object.} buckets + * @memberof google.cloud.automl.v1beta1.TimestampStats.GranularStats + * @instance + */ + GranularStats.prototype.buckets = $util.emptyObject; + + /** + * Creates a new GranularStats instance using the specified properties. + * @function create + * @memberof google.cloud.automl.v1beta1.TimestampStats.GranularStats + * @static + * @param {google.cloud.automl.v1beta1.TimestampStats.IGranularStats=} [properties] Properties to set + * @returns {google.cloud.automl.v1beta1.TimestampStats.GranularStats} GranularStats instance + */ + GranularStats.create = function create(properties) { + return new GranularStats(properties); + }; + + /** + * Encodes the specified GranularStats message. Does not implicitly {@link google.cloud.automl.v1beta1.TimestampStats.GranularStats.verify|verify} messages. + * @function encode + * @memberof google.cloud.automl.v1beta1.TimestampStats.GranularStats + * @static + * @param {google.cloud.automl.v1beta1.TimestampStats.IGranularStats} message GranularStats message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GranularStats.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.buckets != null && Object.hasOwnProperty.call(message, "buckets")) + for (var keys = Object.keys(message.buckets), i = 0; i < keys.length; ++i) + writer.uint32(/* id 1, wireType 2 =*/10).fork().uint32(/* id 1, wireType 0 =*/8).int32(keys[i]).uint32(/* id 2, wireType 0 =*/16).int64(message.buckets[keys[i]]).ldelim(); + return writer; + }; + + /** + * Encodes the specified GranularStats message, length delimited. Does not implicitly {@link google.cloud.automl.v1beta1.TimestampStats.GranularStats.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.automl.v1beta1.TimestampStats.GranularStats + * @static + * @param {google.cloud.automl.v1beta1.TimestampStats.IGranularStats} message GranularStats message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GranularStats.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GranularStats message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.automl.v1beta1.TimestampStats.GranularStats + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.automl.v1beta1.TimestampStats.GranularStats} GranularStats + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GranularStats.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.automl.v1beta1.TimestampStats.GranularStats(), key, value; + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (message.buckets === $util.emptyObject) + message.buckets = {}; + var end2 = reader.uint32() + reader.pos; + key = 0; + value = 0; + while (reader.pos < end2) { + var tag2 = reader.uint32(); + switch (tag2 >>> 3) { + case 1: + key = reader.int32(); + break; + case 2: + value = reader.int64(); + break; + default: + reader.skipType(tag2 & 7); + break; + } + } + message.buckets[key] = value; + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GranularStats message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.automl.v1beta1.TimestampStats.GranularStats + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.automl.v1beta1.TimestampStats.GranularStats} GranularStats + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GranularStats.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GranularStats message. + * @function verify + * @memberof google.cloud.automl.v1beta1.TimestampStats.GranularStats + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GranularStats.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.buckets != null && message.hasOwnProperty("buckets")) { + if (!$util.isObject(message.buckets)) + return "buckets: object expected"; + var key = Object.keys(message.buckets); + for (var i = 0; i < key.length; ++i) { + if (!$util.key32Re.test(key[i])) + return "buckets: integer key{k:int32} expected"; + if (!$util.isInteger(message.buckets[key[i]]) && !(message.buckets[key[i]] && $util.isInteger(message.buckets[key[i]].low) && $util.isInteger(message.buckets[key[i]].high))) + return "buckets: integer|Long{k:int32} expected"; + } + } + return null; + }; + + /** + * Creates a GranularStats message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.automl.v1beta1.TimestampStats.GranularStats + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.automl.v1beta1.TimestampStats.GranularStats} GranularStats + */ + GranularStats.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.automl.v1beta1.TimestampStats.GranularStats) + return object; + var message = new $root.google.cloud.automl.v1beta1.TimestampStats.GranularStats(); + if (object.buckets) { + if (typeof object.buckets !== "object") + throw TypeError(".google.cloud.automl.v1beta1.TimestampStats.GranularStats.buckets: object expected"); + message.buckets = {}; + for (var keys = Object.keys(object.buckets), i = 0; i < keys.length; ++i) + if ($util.Long) + (message.buckets[keys[i]] = $util.Long.fromValue(object.buckets[keys[i]])).unsigned = false; + else if (typeof object.buckets[keys[i]] === "string") + message.buckets[keys[i]] = parseInt(object.buckets[keys[i]], 10); + else if (typeof object.buckets[keys[i]] === "number") + message.buckets[keys[i]] = object.buckets[keys[i]]; + else if (typeof object.buckets[keys[i]] === "object") + message.buckets[keys[i]] = new $util.LongBits(object.buckets[keys[i]].low >>> 0, object.buckets[keys[i]].high >>> 0).toNumber(); + } + return message; + }; + + /** + * Creates a plain object from a GranularStats message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.automl.v1beta1.TimestampStats.GranularStats + * @static + * @param {google.cloud.automl.v1beta1.TimestampStats.GranularStats} message GranularStats + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GranularStats.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.objects || options.defaults) + object.buckets = {}; + var keys2; + if (message.buckets && (keys2 = Object.keys(message.buckets)).length) { + object.buckets = {}; + for (var j = 0; j < keys2.length; ++j) + if (typeof message.buckets[keys2[j]] === "number") + object.buckets[keys2[j]] = options.longs === String ? String(message.buckets[keys2[j]]) : message.buckets[keys2[j]]; + else + object.buckets[keys2[j]] = options.longs === String ? $util.Long.prototype.toString.call(message.buckets[keys2[j]]) : options.longs === Number ? new $util.LongBits(message.buckets[keys2[j]].low >>> 0, message.buckets[keys2[j]].high >>> 0).toNumber() : message.buckets[keys2[j]]; + } + return object; + }; + + /** + * Converts this GranularStats to JSON. + * @function toJSON + * @memberof google.cloud.automl.v1beta1.TimestampStats.GranularStats + * @instance + * @returns {Object.} JSON object + */ + GranularStats.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GranularStats + * @function getTypeUrl + * @memberof google.cloud.automl.v1beta1.TimestampStats.GranularStats + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GranularStats.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.automl.v1beta1.TimestampStats.GranularStats"; + }; + + return GranularStats; + })(); + + return TimestampStats; + })(); + + v1beta1.ArrayStats = (function() { + + /** + * Properties of an ArrayStats. + * @memberof google.cloud.automl.v1beta1 + * @interface IArrayStats + * @property {google.cloud.automl.v1beta1.IDataStats|null} [memberStats] ArrayStats memberStats + */ + + /** + * Constructs a new ArrayStats. + * @memberof google.cloud.automl.v1beta1 + * @classdesc Represents an ArrayStats. + * @implements IArrayStats + * @constructor + * @param {google.cloud.automl.v1beta1.IArrayStats=} [properties] Properties to set + */ + function ArrayStats(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ArrayStats memberStats. + * @member {google.cloud.automl.v1beta1.IDataStats|null|undefined} memberStats + * @memberof google.cloud.automl.v1beta1.ArrayStats + * @instance + */ + ArrayStats.prototype.memberStats = null; + + /** + * Creates a new ArrayStats instance using the specified properties. + * @function create + * @memberof google.cloud.automl.v1beta1.ArrayStats + * @static + * @param {google.cloud.automl.v1beta1.IArrayStats=} [properties] Properties to set + * @returns {google.cloud.automl.v1beta1.ArrayStats} ArrayStats instance + */ + ArrayStats.create = function create(properties) { + return new ArrayStats(properties); + }; + + /** + * Encodes the specified ArrayStats message. Does not implicitly {@link google.cloud.automl.v1beta1.ArrayStats.verify|verify} messages. + * @function encode + * @memberof google.cloud.automl.v1beta1.ArrayStats + * @static + * @param {google.cloud.automl.v1beta1.IArrayStats} message ArrayStats message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ArrayStats.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.memberStats != null && Object.hasOwnProperty.call(message, "memberStats")) + $root.google.cloud.automl.v1beta1.DataStats.encode(message.memberStats, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified ArrayStats message, length delimited. Does not implicitly {@link google.cloud.automl.v1beta1.ArrayStats.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.automl.v1beta1.ArrayStats + * @static + * @param {google.cloud.automl.v1beta1.IArrayStats} message ArrayStats message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ArrayStats.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an ArrayStats message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.automl.v1beta1.ArrayStats + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.automl.v1beta1.ArrayStats} ArrayStats + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ArrayStats.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.automl.v1beta1.ArrayStats(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 2: { + message.memberStats = $root.google.cloud.automl.v1beta1.DataStats.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an ArrayStats message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.automl.v1beta1.ArrayStats + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.automl.v1beta1.ArrayStats} ArrayStats + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ArrayStats.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an ArrayStats message. + * @function verify + * @memberof google.cloud.automl.v1beta1.ArrayStats + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ArrayStats.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.memberStats != null && message.hasOwnProperty("memberStats")) { + var error = $root.google.cloud.automl.v1beta1.DataStats.verify(message.memberStats); + if (error) + return "memberStats." + error; + } + return null; + }; + + /** + * Creates an ArrayStats message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.automl.v1beta1.ArrayStats + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.automl.v1beta1.ArrayStats} ArrayStats + */ + ArrayStats.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.automl.v1beta1.ArrayStats) + return object; + var message = new $root.google.cloud.automl.v1beta1.ArrayStats(); + if (object.memberStats != null) { + if (typeof object.memberStats !== "object") + throw TypeError(".google.cloud.automl.v1beta1.ArrayStats.memberStats: object expected"); + message.memberStats = $root.google.cloud.automl.v1beta1.DataStats.fromObject(object.memberStats); + } + return message; + }; + + /** + * Creates a plain object from an ArrayStats message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.automl.v1beta1.ArrayStats + * @static + * @param {google.cloud.automl.v1beta1.ArrayStats} message ArrayStats + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ArrayStats.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.memberStats = null; + if (message.memberStats != null && message.hasOwnProperty("memberStats")) + object.memberStats = $root.google.cloud.automl.v1beta1.DataStats.toObject(message.memberStats, options); + return object; + }; + + /** + * Converts this ArrayStats to JSON. + * @function toJSON + * @memberof google.cloud.automl.v1beta1.ArrayStats + * @instance + * @returns {Object.} JSON object + */ + ArrayStats.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ArrayStats + * @function getTypeUrl + * @memberof google.cloud.automl.v1beta1.ArrayStats + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ArrayStats.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.automl.v1beta1.ArrayStats"; + }; + + return ArrayStats; + })(); + + v1beta1.StructStats = (function() { + + /** + * Properties of a StructStats. + * @memberof google.cloud.automl.v1beta1 + * @interface IStructStats + * @property {Object.|null} [fieldStats] StructStats fieldStats + */ + + /** + * Constructs a new StructStats. + * @memberof google.cloud.automl.v1beta1 + * @classdesc Represents a StructStats. + * @implements IStructStats + * @constructor + * @param {google.cloud.automl.v1beta1.IStructStats=} [properties] Properties to set + */ + function StructStats(properties) { + this.fieldStats = {}; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * StructStats fieldStats. + * @member {Object.} fieldStats + * @memberof google.cloud.automl.v1beta1.StructStats + * @instance + */ + StructStats.prototype.fieldStats = $util.emptyObject; + + /** + * Creates a new StructStats instance using the specified properties. + * @function create + * @memberof google.cloud.automl.v1beta1.StructStats + * @static + * @param {google.cloud.automl.v1beta1.IStructStats=} [properties] Properties to set + * @returns {google.cloud.automl.v1beta1.StructStats} StructStats instance + */ + StructStats.create = function create(properties) { + return new StructStats(properties); + }; + + /** + * Encodes the specified StructStats message. Does not implicitly {@link google.cloud.automl.v1beta1.StructStats.verify|verify} messages. + * @function encode + * @memberof google.cloud.automl.v1beta1.StructStats + * @static + * @param {google.cloud.automl.v1beta1.IStructStats} message StructStats message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + StructStats.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.fieldStats != null && Object.hasOwnProperty.call(message, "fieldStats")) + for (var keys = Object.keys(message.fieldStats), 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.automl.v1beta1.DataStats.encode(message.fieldStats[keys[i]], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim().ldelim(); + } + return writer; + }; + + /** + * Encodes the specified StructStats message, length delimited. Does not implicitly {@link google.cloud.automl.v1beta1.StructStats.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.automl.v1beta1.StructStats + * @static + * @param {google.cloud.automl.v1beta1.IStructStats} message StructStats message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + StructStats.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a StructStats message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.automl.v1beta1.StructStats + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.automl.v1beta1.StructStats} StructStats + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + StructStats.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.automl.v1beta1.StructStats(), key, value; + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (message.fieldStats === $util.emptyObject) + message.fieldStats = {}; + 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.automl.v1beta1.DataStats.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag2 & 7); + break; + } + } + message.fieldStats[key] = value; + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a StructStats message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.automl.v1beta1.StructStats + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.automl.v1beta1.StructStats} StructStats + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + StructStats.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a StructStats message. + * @function verify + * @memberof google.cloud.automl.v1beta1.StructStats + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + StructStats.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.fieldStats != null && message.hasOwnProperty("fieldStats")) { + if (!$util.isObject(message.fieldStats)) + return "fieldStats: object expected"; + var key = Object.keys(message.fieldStats); + for (var i = 0; i < key.length; ++i) { + var error = $root.google.cloud.automl.v1beta1.DataStats.verify(message.fieldStats[key[i]]); + if (error) + return "fieldStats." + error; + } + } + return null; + }; + + /** + * Creates a StructStats message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.automl.v1beta1.StructStats + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.automl.v1beta1.StructStats} StructStats + */ + StructStats.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.automl.v1beta1.StructStats) + return object; + var message = new $root.google.cloud.automl.v1beta1.StructStats(); + if (object.fieldStats) { + if (typeof object.fieldStats !== "object") + throw TypeError(".google.cloud.automl.v1beta1.StructStats.fieldStats: object expected"); + message.fieldStats = {}; + for (var keys = Object.keys(object.fieldStats), i = 0; i < keys.length; ++i) { + if (typeof object.fieldStats[keys[i]] !== "object") + throw TypeError(".google.cloud.automl.v1beta1.StructStats.fieldStats: object expected"); + message.fieldStats[keys[i]] = $root.google.cloud.automl.v1beta1.DataStats.fromObject(object.fieldStats[keys[i]]); + } + } + return message; + }; + + /** + * Creates a plain object from a StructStats message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.automl.v1beta1.StructStats + * @static + * @param {google.cloud.automl.v1beta1.StructStats} message StructStats + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + StructStats.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.objects || options.defaults) + object.fieldStats = {}; + var keys2; + if (message.fieldStats && (keys2 = Object.keys(message.fieldStats)).length) { + object.fieldStats = {}; + for (var j = 0; j < keys2.length; ++j) + object.fieldStats[keys2[j]] = $root.google.cloud.automl.v1beta1.DataStats.toObject(message.fieldStats[keys2[j]], options); + } + return object; + }; + + /** + * Converts this StructStats to JSON. + * @function toJSON + * @memberof google.cloud.automl.v1beta1.StructStats + * @instance + * @returns {Object.} JSON object + */ + StructStats.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for StructStats + * @function getTypeUrl + * @memberof google.cloud.automl.v1beta1.StructStats + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + StructStats.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.automl.v1beta1.StructStats"; + }; + + return StructStats; + })(); + + v1beta1.CategoryStats = (function() { + + /** + * Properties of a CategoryStats. + * @memberof google.cloud.automl.v1beta1 + * @interface ICategoryStats + * @property {Array.|null} [topCategoryStats] CategoryStats topCategoryStats + */ + + /** + * Constructs a new CategoryStats. + * @memberof google.cloud.automl.v1beta1 + * @classdesc Represents a CategoryStats. + * @implements ICategoryStats + * @constructor + * @param {google.cloud.automl.v1beta1.ICategoryStats=} [properties] Properties to set + */ + function CategoryStats(properties) { + this.topCategoryStats = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * CategoryStats topCategoryStats. + * @member {Array.} topCategoryStats + * @memberof google.cloud.automl.v1beta1.CategoryStats + * @instance + */ + CategoryStats.prototype.topCategoryStats = $util.emptyArray; + + /** + * Creates a new CategoryStats instance using the specified properties. + * @function create + * @memberof google.cloud.automl.v1beta1.CategoryStats + * @static + * @param {google.cloud.automl.v1beta1.ICategoryStats=} [properties] Properties to set + * @returns {google.cloud.automl.v1beta1.CategoryStats} CategoryStats instance + */ + CategoryStats.create = function create(properties) { + return new CategoryStats(properties); + }; + + /** + * Encodes the specified CategoryStats message. Does not implicitly {@link google.cloud.automl.v1beta1.CategoryStats.verify|verify} messages. + * @function encode + * @memberof google.cloud.automl.v1beta1.CategoryStats + * @static + * @param {google.cloud.automl.v1beta1.ICategoryStats} message CategoryStats message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CategoryStats.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.topCategoryStats != null && message.topCategoryStats.length) + for (var i = 0; i < message.topCategoryStats.length; ++i) + $root.google.cloud.automl.v1beta1.CategoryStats.SingleCategoryStats.encode(message.topCategoryStats[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified CategoryStats message, length delimited. Does not implicitly {@link google.cloud.automl.v1beta1.CategoryStats.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.automl.v1beta1.CategoryStats + * @static + * @param {google.cloud.automl.v1beta1.ICategoryStats} message CategoryStats message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CategoryStats.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CategoryStats message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.automl.v1beta1.CategoryStats + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.automl.v1beta1.CategoryStats} CategoryStats + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CategoryStats.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.automl.v1beta1.CategoryStats(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.topCategoryStats && message.topCategoryStats.length)) + message.topCategoryStats = []; + message.topCategoryStats.push($root.google.cloud.automl.v1beta1.CategoryStats.SingleCategoryStats.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CategoryStats message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.automl.v1beta1.CategoryStats + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.automl.v1beta1.CategoryStats} CategoryStats + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CategoryStats.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CategoryStats message. + * @function verify + * @memberof google.cloud.automl.v1beta1.CategoryStats + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CategoryStats.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.topCategoryStats != null && message.hasOwnProperty("topCategoryStats")) { + if (!Array.isArray(message.topCategoryStats)) + return "topCategoryStats: array expected"; + for (var i = 0; i < message.topCategoryStats.length; ++i) { + var error = $root.google.cloud.automl.v1beta1.CategoryStats.SingleCategoryStats.verify(message.topCategoryStats[i]); + if (error) + return "topCategoryStats." + error; + } + } + return null; + }; + + /** + * Creates a CategoryStats message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.automl.v1beta1.CategoryStats + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.automl.v1beta1.CategoryStats} CategoryStats + */ + CategoryStats.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.automl.v1beta1.CategoryStats) + return object; + var message = new $root.google.cloud.automl.v1beta1.CategoryStats(); + if (object.topCategoryStats) { + if (!Array.isArray(object.topCategoryStats)) + throw TypeError(".google.cloud.automl.v1beta1.CategoryStats.topCategoryStats: array expected"); + message.topCategoryStats = []; + for (var i = 0; i < object.topCategoryStats.length; ++i) { + if (typeof object.topCategoryStats[i] !== "object") + throw TypeError(".google.cloud.automl.v1beta1.CategoryStats.topCategoryStats: object expected"); + message.topCategoryStats[i] = $root.google.cloud.automl.v1beta1.CategoryStats.SingleCategoryStats.fromObject(object.topCategoryStats[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a CategoryStats message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.automl.v1beta1.CategoryStats + * @static + * @param {google.cloud.automl.v1beta1.CategoryStats} message CategoryStats + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CategoryStats.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.topCategoryStats = []; + if (message.topCategoryStats && message.topCategoryStats.length) { + object.topCategoryStats = []; + for (var j = 0; j < message.topCategoryStats.length; ++j) + object.topCategoryStats[j] = $root.google.cloud.automl.v1beta1.CategoryStats.SingleCategoryStats.toObject(message.topCategoryStats[j], options); + } + return object; + }; + + /** + * Converts this CategoryStats to JSON. + * @function toJSON + * @memberof google.cloud.automl.v1beta1.CategoryStats + * @instance + * @returns {Object.} JSON object + */ + CategoryStats.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CategoryStats + * @function getTypeUrl + * @memberof google.cloud.automl.v1beta1.CategoryStats + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CategoryStats.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.automl.v1beta1.CategoryStats"; + }; + + CategoryStats.SingleCategoryStats = (function() { + + /** + * Properties of a SingleCategoryStats. + * @memberof google.cloud.automl.v1beta1.CategoryStats + * @interface ISingleCategoryStats + * @property {string|null} [value] SingleCategoryStats value + * @property {number|Long|null} [count] SingleCategoryStats count + */ + + /** + * Constructs a new SingleCategoryStats. + * @memberof google.cloud.automl.v1beta1.CategoryStats + * @classdesc Represents a SingleCategoryStats. + * @implements ISingleCategoryStats + * @constructor + * @param {google.cloud.automl.v1beta1.CategoryStats.ISingleCategoryStats=} [properties] Properties to set + */ + function SingleCategoryStats(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * SingleCategoryStats value. + * @member {string} value + * @memberof google.cloud.automl.v1beta1.CategoryStats.SingleCategoryStats + * @instance + */ + SingleCategoryStats.prototype.value = ""; + + /** + * SingleCategoryStats count. + * @member {number|Long} count + * @memberof google.cloud.automl.v1beta1.CategoryStats.SingleCategoryStats + * @instance + */ + SingleCategoryStats.prototype.count = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new SingleCategoryStats instance using the specified properties. + * @function create + * @memberof google.cloud.automl.v1beta1.CategoryStats.SingleCategoryStats + * @static + * @param {google.cloud.automl.v1beta1.CategoryStats.ISingleCategoryStats=} [properties] Properties to set + * @returns {google.cloud.automl.v1beta1.CategoryStats.SingleCategoryStats} SingleCategoryStats instance + */ + SingleCategoryStats.create = function create(properties) { + return new SingleCategoryStats(properties); + }; + + /** + * Encodes the specified SingleCategoryStats message. Does not implicitly {@link google.cloud.automl.v1beta1.CategoryStats.SingleCategoryStats.verify|verify} messages. + * @function encode + * @memberof google.cloud.automl.v1beta1.CategoryStats.SingleCategoryStats + * @static + * @param {google.cloud.automl.v1beta1.CategoryStats.ISingleCategoryStats} message SingleCategoryStats message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SingleCategoryStats.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.count != null && Object.hasOwnProperty.call(message, "count")) + writer.uint32(/* id 2, wireType 0 =*/16).int64(message.count); + return writer; + }; + + /** + * Encodes the specified SingleCategoryStats message, length delimited. Does not implicitly {@link google.cloud.automl.v1beta1.CategoryStats.SingleCategoryStats.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.automl.v1beta1.CategoryStats.SingleCategoryStats + * @static + * @param {google.cloud.automl.v1beta1.CategoryStats.ISingleCategoryStats} message SingleCategoryStats message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SingleCategoryStats.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a SingleCategoryStats message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.automl.v1beta1.CategoryStats.SingleCategoryStats + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.automl.v1beta1.CategoryStats.SingleCategoryStats} SingleCategoryStats + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SingleCategoryStats.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.automl.v1beta1.CategoryStats.SingleCategoryStats(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.value = reader.string(); + break; + } + case 2: { + message.count = reader.int64(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a SingleCategoryStats message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.automl.v1beta1.CategoryStats.SingleCategoryStats + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.automl.v1beta1.CategoryStats.SingleCategoryStats} SingleCategoryStats + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SingleCategoryStats.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a SingleCategoryStats message. + * @function verify + * @memberof google.cloud.automl.v1beta1.CategoryStats.SingleCategoryStats + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + SingleCategoryStats.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.count != null && message.hasOwnProperty("count")) + if (!$util.isInteger(message.count) && !(message.count && $util.isInteger(message.count.low) && $util.isInteger(message.count.high))) + return "count: integer|Long expected"; + return null; + }; + + /** + * Creates a SingleCategoryStats message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.automl.v1beta1.CategoryStats.SingleCategoryStats + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.automl.v1beta1.CategoryStats.SingleCategoryStats} SingleCategoryStats + */ + SingleCategoryStats.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.automl.v1beta1.CategoryStats.SingleCategoryStats) + return object; + var message = new $root.google.cloud.automl.v1beta1.CategoryStats.SingleCategoryStats(); + if (object.value != null) + message.value = String(object.value); + if (object.count != null) + if ($util.Long) + (message.count = $util.Long.fromValue(object.count)).unsigned = false; + else if (typeof object.count === "string") + message.count = parseInt(object.count, 10); + else if (typeof object.count === "number") + message.count = object.count; + else if (typeof object.count === "object") + message.count = new $util.LongBits(object.count.low >>> 0, object.count.high >>> 0).toNumber(); + return message; + }; + + /** + * Creates a plain object from a SingleCategoryStats message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.automl.v1beta1.CategoryStats.SingleCategoryStats + * @static + * @param {google.cloud.automl.v1beta1.CategoryStats.SingleCategoryStats} message SingleCategoryStats + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + SingleCategoryStats.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.value = ""; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.count = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.count = options.longs === String ? "0" : 0; + } + if (message.value != null && message.hasOwnProperty("value")) + object.value = message.value; + if (message.count != null && message.hasOwnProperty("count")) + if (typeof message.count === "number") + object.count = options.longs === String ? String(message.count) : message.count; + else + object.count = options.longs === String ? $util.Long.prototype.toString.call(message.count) : options.longs === Number ? new $util.LongBits(message.count.low >>> 0, message.count.high >>> 0).toNumber() : message.count; + return object; + }; + + /** + * Converts this SingleCategoryStats to JSON. + * @function toJSON + * @memberof google.cloud.automl.v1beta1.CategoryStats.SingleCategoryStats + * @instance + * @returns {Object.} JSON object + */ + SingleCategoryStats.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for SingleCategoryStats + * @function getTypeUrl + * @memberof google.cloud.automl.v1beta1.CategoryStats.SingleCategoryStats + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + SingleCategoryStats.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.automl.v1beta1.CategoryStats.SingleCategoryStats"; + }; + + return SingleCategoryStats; + })(); + + return CategoryStats; + })(); + + v1beta1.CorrelationStats = (function() { + + /** + * Properties of a CorrelationStats. + * @memberof google.cloud.automl.v1beta1 + * @interface ICorrelationStats + * @property {number|null} [cramersV] CorrelationStats cramersV + */ + + /** + * Constructs a new CorrelationStats. + * @memberof google.cloud.automl.v1beta1 + * @classdesc Represents a CorrelationStats. + * @implements ICorrelationStats + * @constructor + * @param {google.cloud.automl.v1beta1.ICorrelationStats=} [properties] Properties to set + */ + function CorrelationStats(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * CorrelationStats cramersV. + * @member {number} cramersV + * @memberof google.cloud.automl.v1beta1.CorrelationStats + * @instance + */ + CorrelationStats.prototype.cramersV = 0; + + /** + * Creates a new CorrelationStats instance using the specified properties. + * @function create + * @memberof google.cloud.automl.v1beta1.CorrelationStats + * @static + * @param {google.cloud.automl.v1beta1.ICorrelationStats=} [properties] Properties to set + * @returns {google.cloud.automl.v1beta1.CorrelationStats} CorrelationStats instance + */ + CorrelationStats.create = function create(properties) { + return new CorrelationStats(properties); + }; + + /** + * Encodes the specified CorrelationStats message. Does not implicitly {@link google.cloud.automl.v1beta1.CorrelationStats.verify|verify} messages. + * @function encode + * @memberof google.cloud.automl.v1beta1.CorrelationStats + * @static + * @param {google.cloud.automl.v1beta1.ICorrelationStats} message CorrelationStats message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CorrelationStats.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.cramersV != null && Object.hasOwnProperty.call(message, "cramersV")) + writer.uint32(/* id 1, wireType 1 =*/9).double(message.cramersV); + return writer; + }; + + /** + * Encodes the specified CorrelationStats message, length delimited. Does not implicitly {@link google.cloud.automl.v1beta1.CorrelationStats.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.automl.v1beta1.CorrelationStats + * @static + * @param {google.cloud.automl.v1beta1.ICorrelationStats} message CorrelationStats message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CorrelationStats.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CorrelationStats message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.automl.v1beta1.CorrelationStats + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.automl.v1beta1.CorrelationStats} CorrelationStats + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CorrelationStats.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.automl.v1beta1.CorrelationStats(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.cramersV = reader.double(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CorrelationStats message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.automl.v1beta1.CorrelationStats + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.automl.v1beta1.CorrelationStats} CorrelationStats + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CorrelationStats.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CorrelationStats message. + * @function verify + * @memberof google.cloud.automl.v1beta1.CorrelationStats + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CorrelationStats.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.cramersV != null && message.hasOwnProperty("cramersV")) + if (typeof message.cramersV !== "number") + return "cramersV: number expected"; + return null; + }; + + /** + * Creates a CorrelationStats message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.automl.v1beta1.CorrelationStats + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.automl.v1beta1.CorrelationStats} CorrelationStats + */ + CorrelationStats.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.automl.v1beta1.CorrelationStats) + return object; + var message = new $root.google.cloud.automl.v1beta1.CorrelationStats(); + if (object.cramersV != null) + message.cramersV = Number(object.cramersV); + return message; + }; + + /** + * Creates a plain object from a CorrelationStats message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.automl.v1beta1.CorrelationStats + * @static + * @param {google.cloud.automl.v1beta1.CorrelationStats} message CorrelationStats + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CorrelationStats.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.cramersV = 0; + if (message.cramersV != null && message.hasOwnProperty("cramersV")) + object.cramersV = options.json && !isFinite(message.cramersV) ? String(message.cramersV) : message.cramersV; + return object; + }; + + /** + * Converts this CorrelationStats to JSON. + * @function toJSON + * @memberof google.cloud.automl.v1beta1.CorrelationStats + * @instance + * @returns {Object.} JSON object + */ + CorrelationStats.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CorrelationStats + * @function getTypeUrl + * @memberof google.cloud.automl.v1beta1.CorrelationStats + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CorrelationStats.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.automl.v1beta1.CorrelationStats"; + }; + + return CorrelationStats; + })(); + + /** + * TypeCode enum. + * @name google.cloud.automl.v1beta1.TypeCode + * @enum {number} + * @property {number} TYPE_CODE_UNSPECIFIED=0 TYPE_CODE_UNSPECIFIED value + * @property {number} FLOAT64=3 FLOAT64 value + * @property {number} TIMESTAMP=4 TIMESTAMP value + * @property {number} STRING=6 STRING value + * @property {number} ARRAY=8 ARRAY value + * @property {number} STRUCT=9 STRUCT value + * @property {number} CATEGORY=10 CATEGORY value + */ + v1beta1.TypeCode = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "TYPE_CODE_UNSPECIFIED"] = 0; + values[valuesById[3] = "FLOAT64"] = 3; + values[valuesById[4] = "TIMESTAMP"] = 4; + values[valuesById[6] = "STRING"] = 6; + values[valuesById[8] = "ARRAY"] = 8; + values[valuesById[9] = "STRUCT"] = 9; + values[valuesById[10] = "CATEGORY"] = 10; + return values; + })(); + + v1beta1.DataType = (function() { + + /** + * Properties of a DataType. + * @memberof google.cloud.automl.v1beta1 + * @interface IDataType + * @property {google.cloud.automl.v1beta1.IDataType|null} [listElementType] DataType listElementType + * @property {google.cloud.automl.v1beta1.IStructType|null} [structType] DataType structType + * @property {string|null} [timeFormat] DataType timeFormat + * @property {google.cloud.automl.v1beta1.TypeCode|null} [typeCode] DataType typeCode + * @property {boolean|null} [nullable] DataType nullable + */ + + /** + * Constructs a new DataType. + * @memberof google.cloud.automl.v1beta1 + * @classdesc Represents a DataType. + * @implements IDataType + * @constructor + * @param {google.cloud.automl.v1beta1.IDataType=} [properties] Properties to set + */ + function DataType(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * DataType listElementType. + * @member {google.cloud.automl.v1beta1.IDataType|null|undefined} listElementType + * @memberof google.cloud.automl.v1beta1.DataType + * @instance + */ + DataType.prototype.listElementType = null; + + /** + * DataType structType. + * @member {google.cloud.automl.v1beta1.IStructType|null|undefined} structType + * @memberof google.cloud.automl.v1beta1.DataType + * @instance + */ + DataType.prototype.structType = null; + + /** + * DataType timeFormat. + * @member {string|null|undefined} timeFormat + * @memberof google.cloud.automl.v1beta1.DataType + * @instance + */ + DataType.prototype.timeFormat = null; + + /** + * DataType typeCode. + * @member {google.cloud.automl.v1beta1.TypeCode} typeCode + * @memberof google.cloud.automl.v1beta1.DataType + * @instance + */ + DataType.prototype.typeCode = 0; + + /** + * DataType nullable. + * @member {boolean} nullable + * @memberof google.cloud.automl.v1beta1.DataType + * @instance + */ + DataType.prototype.nullable = false; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * DataType details. + * @member {"listElementType"|"structType"|"timeFormat"|undefined} details + * @memberof google.cloud.automl.v1beta1.DataType + * @instance + */ + Object.defineProperty(DataType.prototype, "details", { + get: $util.oneOfGetter($oneOfFields = ["listElementType", "structType", "timeFormat"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new DataType instance using the specified properties. + * @function create + * @memberof google.cloud.automl.v1beta1.DataType + * @static + * @param {google.cloud.automl.v1beta1.IDataType=} [properties] Properties to set + * @returns {google.cloud.automl.v1beta1.DataType} DataType instance + */ + DataType.create = function create(properties) { + return new DataType(properties); + }; + + /** + * Encodes the specified DataType message. Does not implicitly {@link google.cloud.automl.v1beta1.DataType.verify|verify} messages. + * @function encode + * @memberof google.cloud.automl.v1beta1.DataType + * @static + * @param {google.cloud.automl.v1beta1.IDataType} message DataType message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DataType.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.typeCode != null && Object.hasOwnProperty.call(message, "typeCode")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.typeCode); + if (message.listElementType != null && Object.hasOwnProperty.call(message, "listElementType")) + $root.google.cloud.automl.v1beta1.DataType.encode(message.listElementType, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.structType != null && Object.hasOwnProperty.call(message, "structType")) + $root.google.cloud.automl.v1beta1.StructType.encode(message.structType, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.nullable != null && Object.hasOwnProperty.call(message, "nullable")) + writer.uint32(/* id 4, wireType 0 =*/32).bool(message.nullable); + if (message.timeFormat != null && Object.hasOwnProperty.call(message, "timeFormat")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.timeFormat); + return writer; + }; + + /** + * Encodes the specified DataType message, length delimited. Does not implicitly {@link google.cloud.automl.v1beta1.DataType.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.automl.v1beta1.DataType + * @static + * @param {google.cloud.automl.v1beta1.IDataType} message DataType message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DataType.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DataType message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.automl.v1beta1.DataType + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.automl.v1beta1.DataType} DataType + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DataType.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.automl.v1beta1.DataType(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 2: { + message.listElementType = $root.google.cloud.automl.v1beta1.DataType.decode(reader, reader.uint32()); + break; + } + case 3: { + message.structType = $root.google.cloud.automl.v1beta1.StructType.decode(reader, reader.uint32()); + break; + } + case 5: { + message.timeFormat = reader.string(); + break; + } + case 1: { + message.typeCode = reader.int32(); + break; + } + case 4: { + message.nullable = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DataType message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.automl.v1beta1.DataType + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.automl.v1beta1.DataType} DataType + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DataType.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DataType message. + * @function verify + * @memberof google.cloud.automl.v1beta1.DataType + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DataType.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.listElementType != null && message.hasOwnProperty("listElementType")) { + properties.details = 1; + { + var error = $root.google.cloud.automl.v1beta1.DataType.verify(message.listElementType); + if (error) + return "listElementType." + error; + } + } + if (message.structType != null && message.hasOwnProperty("structType")) { + if (properties.details === 1) + return "details: multiple values"; + properties.details = 1; + { + var error = $root.google.cloud.automl.v1beta1.StructType.verify(message.structType); + if (error) + return "structType." + error; + } + } + if (message.timeFormat != null && message.hasOwnProperty("timeFormat")) { + if (properties.details === 1) + return "details: multiple values"; + properties.details = 1; + if (!$util.isString(message.timeFormat)) + return "timeFormat: string expected"; + } + if (message.typeCode != null && message.hasOwnProperty("typeCode")) + switch (message.typeCode) { + default: + return "typeCode: enum value expected"; + case 0: + case 3: + case 4: + case 6: + case 8: + case 9: + case 10: + break; + } + if (message.nullable != null && message.hasOwnProperty("nullable")) + if (typeof message.nullable !== "boolean") + return "nullable: boolean expected"; + return null; + }; + + /** + * Creates a DataType message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.automl.v1beta1.DataType + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.automl.v1beta1.DataType} DataType + */ + DataType.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.automl.v1beta1.DataType) + return object; + var message = new $root.google.cloud.automl.v1beta1.DataType(); + if (object.listElementType != null) { + if (typeof object.listElementType !== "object") + throw TypeError(".google.cloud.automl.v1beta1.DataType.listElementType: object expected"); + message.listElementType = $root.google.cloud.automl.v1beta1.DataType.fromObject(object.listElementType); + } + if (object.structType != null) { + if (typeof object.structType !== "object") + throw TypeError(".google.cloud.automl.v1beta1.DataType.structType: object expected"); + message.structType = $root.google.cloud.automl.v1beta1.StructType.fromObject(object.structType); + } + if (object.timeFormat != null) + message.timeFormat = String(object.timeFormat); + switch (object.typeCode) { + default: + if (typeof object.typeCode === "number") { + message.typeCode = object.typeCode; + break; + } + break; + case "TYPE_CODE_UNSPECIFIED": + case 0: + message.typeCode = 0; + break; + case "FLOAT64": + case 3: + message.typeCode = 3; + break; + case "TIMESTAMP": + case 4: + message.typeCode = 4; + break; + case "STRING": + case 6: + message.typeCode = 6; + break; + case "ARRAY": + case 8: + message.typeCode = 8; + break; + case "STRUCT": + case 9: + message.typeCode = 9; + break; + case "CATEGORY": + case 10: + message.typeCode = 10; + break; + } + if (object.nullable != null) + message.nullable = Boolean(object.nullable); + return message; + }; + + /** + * Creates a plain object from a DataType message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.automl.v1beta1.DataType + * @static + * @param {google.cloud.automl.v1beta1.DataType} message DataType + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DataType.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.typeCode = options.enums === String ? "TYPE_CODE_UNSPECIFIED" : 0; + object.nullable = false; + } + if (message.typeCode != null && message.hasOwnProperty("typeCode")) + object.typeCode = options.enums === String ? $root.google.cloud.automl.v1beta1.TypeCode[message.typeCode] === undefined ? message.typeCode : $root.google.cloud.automl.v1beta1.TypeCode[message.typeCode] : message.typeCode; + if (message.listElementType != null && message.hasOwnProperty("listElementType")) { + object.listElementType = $root.google.cloud.automl.v1beta1.DataType.toObject(message.listElementType, options); + if (options.oneofs) + object.details = "listElementType"; + } + if (message.structType != null && message.hasOwnProperty("structType")) { + object.structType = $root.google.cloud.automl.v1beta1.StructType.toObject(message.structType, options); + if (options.oneofs) + object.details = "structType"; + } + if (message.nullable != null && message.hasOwnProperty("nullable")) + object.nullable = message.nullable; + if (message.timeFormat != null && message.hasOwnProperty("timeFormat")) { + object.timeFormat = message.timeFormat; + if (options.oneofs) + object.details = "timeFormat"; + } + return object; + }; + + /** + * Converts this DataType to JSON. + * @function toJSON + * @memberof google.cloud.automl.v1beta1.DataType + * @instance + * @returns {Object.} JSON object + */ + DataType.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DataType + * @function getTypeUrl + * @memberof google.cloud.automl.v1beta1.DataType + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DataType.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.automl.v1beta1.DataType"; + }; + + return DataType; + })(); + + v1beta1.StructType = (function() { + + /** + * Properties of a StructType. + * @memberof google.cloud.automl.v1beta1 + * @interface IStructType + * @property {Object.|null} [fields] StructType fields + */ + + /** + * Constructs a new StructType. + * @memberof google.cloud.automl.v1beta1 + * @classdesc Represents a StructType. + * @implements IStructType + * @constructor + * @param {google.cloud.automl.v1beta1.IStructType=} [properties] Properties to set + */ + function StructType(properties) { + this.fields = {}; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * StructType fields. + * @member {Object.} fields + * @memberof google.cloud.automl.v1beta1.StructType + * @instance + */ + StructType.prototype.fields = $util.emptyObject; + + /** + * Creates a new StructType instance using the specified properties. + * @function create + * @memberof google.cloud.automl.v1beta1.StructType + * @static + * @param {google.cloud.automl.v1beta1.IStructType=} [properties] Properties to set + * @returns {google.cloud.automl.v1beta1.StructType} StructType instance + */ + StructType.create = function create(properties) { + return new StructType(properties); + }; + + /** + * Encodes the specified StructType message. Does not implicitly {@link google.cloud.automl.v1beta1.StructType.verify|verify} messages. + * @function encode + * @memberof google.cloud.automl.v1beta1.StructType + * @static + * @param {google.cloud.automl.v1beta1.IStructType} message StructType message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + StructType.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.fields != null && Object.hasOwnProperty.call(message, "fields")) + for (var keys = Object.keys(message.fields), 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.automl.v1beta1.DataType.encode(message.fields[keys[i]], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim().ldelim(); + } + return writer; + }; + + /** + * Encodes the specified StructType message, length delimited. Does not implicitly {@link google.cloud.automl.v1beta1.StructType.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.automl.v1beta1.StructType + * @static + * @param {google.cloud.automl.v1beta1.IStructType} message StructType message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + StructType.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a StructType message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.automl.v1beta1.StructType + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.automl.v1beta1.StructType} StructType + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + StructType.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.automl.v1beta1.StructType(), key, value; + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (message.fields === $util.emptyObject) + message.fields = {}; + 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.automl.v1beta1.DataType.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag2 & 7); + break; + } + } + message.fields[key] = value; + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a StructType message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.automl.v1beta1.StructType + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.automl.v1beta1.StructType} StructType + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + StructType.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a StructType message. + * @function verify + * @memberof google.cloud.automl.v1beta1.StructType + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + StructType.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.fields != null && message.hasOwnProperty("fields")) { + if (!$util.isObject(message.fields)) + return "fields: object expected"; + var key = Object.keys(message.fields); + for (var i = 0; i < key.length; ++i) { + var error = $root.google.cloud.automl.v1beta1.DataType.verify(message.fields[key[i]]); + if (error) + return "fields." + error; + } + } + return null; + }; + + /** + * Creates a StructType message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.automl.v1beta1.StructType + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.automl.v1beta1.StructType} StructType + */ + StructType.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.automl.v1beta1.StructType) + return object; + var message = new $root.google.cloud.automl.v1beta1.StructType(); + if (object.fields) { + if (typeof object.fields !== "object") + throw TypeError(".google.cloud.automl.v1beta1.StructType.fields: object expected"); + message.fields = {}; + for (var keys = Object.keys(object.fields), i = 0; i < keys.length; ++i) { + if (typeof object.fields[keys[i]] !== "object") + throw TypeError(".google.cloud.automl.v1beta1.StructType.fields: object expected"); + message.fields[keys[i]] = $root.google.cloud.automl.v1beta1.DataType.fromObject(object.fields[keys[i]]); + } + } + return message; + }; + + /** + * Creates a plain object from a StructType message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.automl.v1beta1.StructType + * @static + * @param {google.cloud.automl.v1beta1.StructType} message StructType + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + StructType.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.objects || options.defaults) + object.fields = {}; + var keys2; + if (message.fields && (keys2 = Object.keys(message.fields)).length) { + object.fields = {}; + for (var j = 0; j < keys2.length; ++j) + object.fields[keys2[j]] = $root.google.cloud.automl.v1beta1.DataType.toObject(message.fields[keys2[j]], options); + } + return object; + }; + + /** + * Converts this StructType to JSON. + * @function toJSON + * @memberof google.cloud.automl.v1beta1.StructType + * @instance + * @returns {Object.} JSON object + */ + StructType.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for StructType + * @function getTypeUrl + * @memberof google.cloud.automl.v1beta1.StructType + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + StructType.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.automl.v1beta1.StructType"; + }; + + return StructType; + })(); + + v1beta1.Image = (function() { + + /** + * Properties of an Image. + * @memberof google.cloud.automl.v1beta1 + * @interface IImage + * @property {Uint8Array|null} [imageBytes] Image imageBytes + * @property {google.cloud.automl.v1beta1.IInputConfig|null} [inputConfig] Image inputConfig + * @property {string|null} [thumbnailUri] Image thumbnailUri + */ + + /** + * Constructs a new Image. + * @memberof google.cloud.automl.v1beta1 + * @classdesc Represents an Image. + * @implements IImage + * @constructor + * @param {google.cloud.automl.v1beta1.IImage=} [properties] Properties to set + */ + function Image(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Image imageBytes. + * @member {Uint8Array|null|undefined} imageBytes + * @memberof google.cloud.automl.v1beta1.Image + * @instance + */ + Image.prototype.imageBytes = null; + + /** + * Image inputConfig. + * @member {google.cloud.automl.v1beta1.IInputConfig|null|undefined} inputConfig + * @memberof google.cloud.automl.v1beta1.Image + * @instance + */ + Image.prototype.inputConfig = null; + + /** + * Image thumbnailUri. + * @member {string} thumbnailUri + * @memberof google.cloud.automl.v1beta1.Image + * @instance + */ + Image.prototype.thumbnailUri = ""; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * Image data. + * @member {"imageBytes"|"inputConfig"|undefined} data + * @memberof google.cloud.automl.v1beta1.Image + * @instance + */ + Object.defineProperty(Image.prototype, "data", { + get: $util.oneOfGetter($oneOfFields = ["imageBytes", "inputConfig"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new Image instance using the specified properties. + * @function create + * @memberof google.cloud.automl.v1beta1.Image + * @static + * @param {google.cloud.automl.v1beta1.IImage=} [properties] Properties to set + * @returns {google.cloud.automl.v1beta1.Image} Image instance + */ + Image.create = function create(properties) { + return new Image(properties); + }; + + /** + * Encodes the specified Image message. Does not implicitly {@link google.cloud.automl.v1beta1.Image.verify|verify} messages. + * @function encode + * @memberof google.cloud.automl.v1beta1.Image + * @static + * @param {google.cloud.automl.v1beta1.IImage} message Image message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Image.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.imageBytes != null && Object.hasOwnProperty.call(message, "imageBytes")) + writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.imageBytes); + if (message.thumbnailUri != null && Object.hasOwnProperty.call(message, "thumbnailUri")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.thumbnailUri); + if (message.inputConfig != null && Object.hasOwnProperty.call(message, "inputConfig")) + $root.google.cloud.automl.v1beta1.InputConfig.encode(message.inputConfig, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified Image message, length delimited. Does not implicitly {@link google.cloud.automl.v1beta1.Image.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.automl.v1beta1.Image + * @static + * @param {google.cloud.automl.v1beta1.IImage} message Image message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Image.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an Image message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.automl.v1beta1.Image + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.automl.v1beta1.Image} Image + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Image.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.automl.v1beta1.Image(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.imageBytes = reader.bytes(); + break; + } + case 6: { + message.inputConfig = $root.google.cloud.automl.v1beta1.InputConfig.decode(reader, reader.uint32()); + break; + } + case 4: { + message.thumbnailUri = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an Image message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.automl.v1beta1.Image + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.automl.v1beta1.Image} Image + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Image.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an Image message. + * @function verify + * @memberof google.cloud.automl.v1beta1.Image + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Image.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.imageBytes != null && message.hasOwnProperty("imageBytes")) { + properties.data = 1; + if (!(message.imageBytes && typeof message.imageBytes.length === "number" || $util.isString(message.imageBytes))) + return "imageBytes: buffer expected"; + } + if (message.inputConfig != null && message.hasOwnProperty("inputConfig")) { + if (properties.data === 1) + return "data: multiple values"; + properties.data = 1; + { + var error = $root.google.cloud.automl.v1beta1.InputConfig.verify(message.inputConfig); + if (error) + return "inputConfig." + error; + } + } + if (message.thumbnailUri != null && message.hasOwnProperty("thumbnailUri")) + if (!$util.isString(message.thumbnailUri)) + return "thumbnailUri: string expected"; + return null; + }; + + /** + * Creates an Image message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.automl.v1beta1.Image + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.automl.v1beta1.Image} Image + */ + Image.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.automl.v1beta1.Image) + return object; + var message = new $root.google.cloud.automl.v1beta1.Image(); + if (object.imageBytes != null) + if (typeof object.imageBytes === "string") + $util.base64.decode(object.imageBytes, message.imageBytes = $util.newBuffer($util.base64.length(object.imageBytes)), 0); + else if (object.imageBytes.length >= 0) + message.imageBytes = object.imageBytes; + if (object.inputConfig != null) { + if (typeof object.inputConfig !== "object") + throw TypeError(".google.cloud.automl.v1beta1.Image.inputConfig: object expected"); + message.inputConfig = $root.google.cloud.automl.v1beta1.InputConfig.fromObject(object.inputConfig); + } + if (object.thumbnailUri != null) + message.thumbnailUri = String(object.thumbnailUri); + return message; + }; + + /** + * Creates a plain object from an Image message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.automl.v1beta1.Image + * @static + * @param {google.cloud.automl.v1beta1.Image} message Image + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Image.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.thumbnailUri = ""; + if (message.imageBytes != null && message.hasOwnProperty("imageBytes")) { + object.imageBytes = options.bytes === String ? $util.base64.encode(message.imageBytes, 0, message.imageBytes.length) : options.bytes === Array ? Array.prototype.slice.call(message.imageBytes) : message.imageBytes; + if (options.oneofs) + object.data = "imageBytes"; + } + if (message.thumbnailUri != null && message.hasOwnProperty("thumbnailUri")) + object.thumbnailUri = message.thumbnailUri; + if (message.inputConfig != null && message.hasOwnProperty("inputConfig")) { + object.inputConfig = $root.google.cloud.automl.v1beta1.InputConfig.toObject(message.inputConfig, options); + if (options.oneofs) + object.data = "inputConfig"; + } + return object; + }; + + /** + * Converts this Image to JSON. + * @function toJSON + * @memberof google.cloud.automl.v1beta1.Image + * @instance + * @returns {Object.} JSON object + */ + Image.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Image + * @function getTypeUrl + * @memberof google.cloud.automl.v1beta1.Image + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Image.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.automl.v1beta1.Image"; + }; + + return Image; + })(); + + v1beta1.TextSnippet = (function() { + + /** + * Properties of a TextSnippet. + * @memberof google.cloud.automl.v1beta1 + * @interface ITextSnippet + * @property {string|null} [content] TextSnippet content + * @property {string|null} [mimeType] TextSnippet mimeType + * @property {string|null} [contentUri] TextSnippet contentUri + */ + + /** + * Constructs a new TextSnippet. + * @memberof google.cloud.automl.v1beta1 + * @classdesc Represents a TextSnippet. + * @implements ITextSnippet + * @constructor + * @param {google.cloud.automl.v1beta1.ITextSnippet=} [properties] Properties to set + */ + function TextSnippet(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * TextSnippet content. + * @member {string} content + * @memberof google.cloud.automl.v1beta1.TextSnippet + * @instance + */ + TextSnippet.prototype.content = ""; + + /** + * TextSnippet mimeType. + * @member {string} mimeType + * @memberof google.cloud.automl.v1beta1.TextSnippet + * @instance + */ + TextSnippet.prototype.mimeType = ""; + + /** + * TextSnippet contentUri. + * @member {string} contentUri + * @memberof google.cloud.automl.v1beta1.TextSnippet + * @instance + */ + TextSnippet.prototype.contentUri = ""; + + /** + * Creates a new TextSnippet instance using the specified properties. + * @function create + * @memberof google.cloud.automl.v1beta1.TextSnippet + * @static + * @param {google.cloud.automl.v1beta1.ITextSnippet=} [properties] Properties to set + * @returns {google.cloud.automl.v1beta1.TextSnippet} TextSnippet instance + */ + TextSnippet.create = function create(properties) { + return new TextSnippet(properties); + }; + + /** + * Encodes the specified TextSnippet message. Does not implicitly {@link google.cloud.automl.v1beta1.TextSnippet.verify|verify} messages. + * @function encode + * @memberof google.cloud.automl.v1beta1.TextSnippet + * @static + * @param {google.cloud.automl.v1beta1.ITextSnippet} message TextSnippet message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TextSnippet.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).string(message.content); + if (message.mimeType != null && Object.hasOwnProperty.call(message, "mimeType")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.mimeType); + if (message.contentUri != null && Object.hasOwnProperty.call(message, "contentUri")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.contentUri); + return writer; + }; + + /** + * Encodes the specified TextSnippet message, length delimited. Does not implicitly {@link google.cloud.automl.v1beta1.TextSnippet.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.automl.v1beta1.TextSnippet + * @static + * @param {google.cloud.automl.v1beta1.ITextSnippet} message TextSnippet message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TextSnippet.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a TextSnippet message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.automl.v1beta1.TextSnippet + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.automl.v1beta1.TextSnippet} TextSnippet + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TextSnippet.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.automl.v1beta1.TextSnippet(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.content = reader.string(); + break; + } + case 2: { + message.mimeType = reader.string(); + break; + } + case 4: { + message.contentUri = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a TextSnippet message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.automl.v1beta1.TextSnippet + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.automl.v1beta1.TextSnippet} TextSnippet + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TextSnippet.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a TextSnippet message. + * @function verify + * @memberof google.cloud.automl.v1beta1.TextSnippet + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + TextSnippet.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.content != null && message.hasOwnProperty("content")) + if (!$util.isString(message.content)) + return "content: string expected"; + if (message.mimeType != null && message.hasOwnProperty("mimeType")) + if (!$util.isString(message.mimeType)) + return "mimeType: string expected"; + if (message.contentUri != null && message.hasOwnProperty("contentUri")) + if (!$util.isString(message.contentUri)) + return "contentUri: string expected"; + return null; + }; + + /** + * Creates a TextSnippet message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.automl.v1beta1.TextSnippet + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.automl.v1beta1.TextSnippet} TextSnippet + */ + TextSnippet.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.automl.v1beta1.TextSnippet) + return object; + var message = new $root.google.cloud.automl.v1beta1.TextSnippet(); + if (object.content != null) + message.content = String(object.content); + if (object.mimeType != null) + message.mimeType = String(object.mimeType); + if (object.contentUri != null) + message.contentUri = String(object.contentUri); + return message; + }; + + /** + * Creates a plain object from a TextSnippet message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.automl.v1beta1.TextSnippet + * @static + * @param {google.cloud.automl.v1beta1.TextSnippet} message TextSnippet + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + TextSnippet.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.content = ""; + object.mimeType = ""; + object.contentUri = ""; + } + if (message.content != null && message.hasOwnProperty("content")) + object.content = message.content; + if (message.mimeType != null && message.hasOwnProperty("mimeType")) + object.mimeType = message.mimeType; + if (message.contentUri != null && message.hasOwnProperty("contentUri")) + object.contentUri = message.contentUri; + return object; + }; + + /** + * Converts this TextSnippet to JSON. + * @function toJSON + * @memberof google.cloud.automl.v1beta1.TextSnippet + * @instance + * @returns {Object.} JSON object + */ + TextSnippet.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for TextSnippet + * @function getTypeUrl + * @memberof google.cloud.automl.v1beta1.TextSnippet + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TextSnippet.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.automl.v1beta1.TextSnippet"; + }; + + return TextSnippet; + })(); + + v1beta1.DocumentDimensions = (function() { + + /** + * Properties of a DocumentDimensions. + * @memberof google.cloud.automl.v1beta1 + * @interface IDocumentDimensions + * @property {google.cloud.automl.v1beta1.DocumentDimensions.DocumentDimensionUnit|null} [unit] DocumentDimensions unit + * @property {number|null} [width] DocumentDimensions width + * @property {number|null} [height] DocumentDimensions height + */ + + /** + * Constructs a new DocumentDimensions. + * @memberof google.cloud.automl.v1beta1 + * @classdesc Represents a DocumentDimensions. + * @implements IDocumentDimensions + * @constructor + * @param {google.cloud.automl.v1beta1.IDocumentDimensions=} [properties] Properties to set + */ + function DocumentDimensions(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * DocumentDimensions unit. + * @member {google.cloud.automl.v1beta1.DocumentDimensions.DocumentDimensionUnit} unit + * @memberof google.cloud.automl.v1beta1.DocumentDimensions + * @instance + */ + DocumentDimensions.prototype.unit = 0; + + /** + * DocumentDimensions width. + * @member {number} width + * @memberof google.cloud.automl.v1beta1.DocumentDimensions + * @instance + */ + DocumentDimensions.prototype.width = 0; + + /** + * DocumentDimensions height. + * @member {number} height + * @memberof google.cloud.automl.v1beta1.DocumentDimensions + * @instance + */ + DocumentDimensions.prototype.height = 0; + + /** + * Creates a new DocumentDimensions instance using the specified properties. + * @function create + * @memberof google.cloud.automl.v1beta1.DocumentDimensions + * @static + * @param {google.cloud.automl.v1beta1.IDocumentDimensions=} [properties] Properties to set + * @returns {google.cloud.automl.v1beta1.DocumentDimensions} DocumentDimensions instance + */ + DocumentDimensions.create = function create(properties) { + return new DocumentDimensions(properties); + }; + + /** + * Encodes the specified DocumentDimensions message. Does not implicitly {@link google.cloud.automl.v1beta1.DocumentDimensions.verify|verify} messages. + * @function encode + * @memberof google.cloud.automl.v1beta1.DocumentDimensions + * @static + * @param {google.cloud.automl.v1beta1.IDocumentDimensions} message DocumentDimensions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DocumentDimensions.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.unit != null && Object.hasOwnProperty.call(message, "unit")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.unit); + if (message.width != null && Object.hasOwnProperty.call(message, "width")) + writer.uint32(/* id 2, wireType 5 =*/21).float(message.width); + if (message.height != null && Object.hasOwnProperty.call(message, "height")) + writer.uint32(/* id 3, wireType 5 =*/29).float(message.height); + return writer; + }; + + /** + * Encodes the specified DocumentDimensions message, length delimited. Does not implicitly {@link google.cloud.automl.v1beta1.DocumentDimensions.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.automl.v1beta1.DocumentDimensions + * @static + * @param {google.cloud.automl.v1beta1.IDocumentDimensions} message DocumentDimensions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DocumentDimensions.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DocumentDimensions message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.automl.v1beta1.DocumentDimensions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.automl.v1beta1.DocumentDimensions} DocumentDimensions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DocumentDimensions.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.automl.v1beta1.DocumentDimensions(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.unit = reader.int32(); + break; + } + case 2: { + message.width = reader.float(); + break; + } + case 3: { + message.height = reader.float(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DocumentDimensions message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.automl.v1beta1.DocumentDimensions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.automl.v1beta1.DocumentDimensions} DocumentDimensions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DocumentDimensions.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DocumentDimensions message. + * @function verify + * @memberof google.cloud.automl.v1beta1.DocumentDimensions + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DocumentDimensions.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.unit != null && message.hasOwnProperty("unit")) + switch (message.unit) { + default: + return "unit: enum value expected"; + case 0: + case 1: + case 2: + case 3: + break; + } + if (message.width != null && message.hasOwnProperty("width")) + if (typeof message.width !== "number") + return "width: number expected"; + if (message.height != null && message.hasOwnProperty("height")) + if (typeof message.height !== "number") + return "height: number expected"; + return null; + }; + + /** + * Creates a DocumentDimensions message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.automl.v1beta1.DocumentDimensions + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.automl.v1beta1.DocumentDimensions} DocumentDimensions + */ + DocumentDimensions.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.automl.v1beta1.DocumentDimensions) + return object; + var message = new $root.google.cloud.automl.v1beta1.DocumentDimensions(); + switch (object.unit) { + default: + if (typeof object.unit === "number") { + message.unit = object.unit; + break; + } + break; + case "DOCUMENT_DIMENSION_UNIT_UNSPECIFIED": + case 0: + message.unit = 0; + break; + case "INCH": + case 1: + message.unit = 1; + break; + case "CENTIMETER": + case 2: + message.unit = 2; + break; + case "POINT": + case 3: + message.unit = 3; + break; + } + if (object.width != null) + message.width = Number(object.width); + if (object.height != null) + message.height = Number(object.height); + return message; + }; + + /** + * Creates a plain object from a DocumentDimensions message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.automl.v1beta1.DocumentDimensions + * @static + * @param {google.cloud.automl.v1beta1.DocumentDimensions} message DocumentDimensions + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DocumentDimensions.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.unit = options.enums === String ? "DOCUMENT_DIMENSION_UNIT_UNSPECIFIED" : 0; + object.width = 0; + object.height = 0; + } + if (message.unit != null && message.hasOwnProperty("unit")) + object.unit = options.enums === String ? $root.google.cloud.automl.v1beta1.DocumentDimensions.DocumentDimensionUnit[message.unit] === undefined ? message.unit : $root.google.cloud.automl.v1beta1.DocumentDimensions.DocumentDimensionUnit[message.unit] : message.unit; + if (message.width != null && message.hasOwnProperty("width")) + object.width = options.json && !isFinite(message.width) ? String(message.width) : message.width; + if (message.height != null && message.hasOwnProperty("height")) + object.height = options.json && !isFinite(message.height) ? String(message.height) : message.height; + return object; + }; + + /** + * Converts this DocumentDimensions to JSON. + * @function toJSON + * @memberof google.cloud.automl.v1beta1.DocumentDimensions + * @instance + * @returns {Object.} JSON object + */ + DocumentDimensions.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DocumentDimensions + * @function getTypeUrl + * @memberof google.cloud.automl.v1beta1.DocumentDimensions + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DocumentDimensions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.automl.v1beta1.DocumentDimensions"; + }; + + /** + * DocumentDimensionUnit enum. + * @name google.cloud.automl.v1beta1.DocumentDimensions.DocumentDimensionUnit + * @enum {number} + * @property {number} DOCUMENT_DIMENSION_UNIT_UNSPECIFIED=0 DOCUMENT_DIMENSION_UNIT_UNSPECIFIED value + * @property {number} INCH=1 INCH value + * @property {number} CENTIMETER=2 CENTIMETER value + * @property {number} POINT=3 POINT value + */ + DocumentDimensions.DocumentDimensionUnit = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "DOCUMENT_DIMENSION_UNIT_UNSPECIFIED"] = 0; + values[valuesById[1] = "INCH"] = 1; + values[valuesById[2] = "CENTIMETER"] = 2; + values[valuesById[3] = "POINT"] = 3; + return values; + })(); + + return DocumentDimensions; + })(); + + v1beta1.Document = (function() { + + /** + * Properties of a Document. + * @memberof google.cloud.automl.v1beta1 + * @interface IDocument + * @property {google.cloud.automl.v1beta1.IDocumentInputConfig|null} [inputConfig] Document inputConfig + * @property {google.cloud.automl.v1beta1.ITextSnippet|null} [documentText] Document documentText + * @property {Array.|null} [layout] Document layout + * @property {google.cloud.automl.v1beta1.IDocumentDimensions|null} [documentDimensions] Document documentDimensions + * @property {number|null} [pageCount] Document pageCount + */ + + /** + * Constructs a new Document. + * @memberof google.cloud.automl.v1beta1 + * @classdesc Represents a Document. + * @implements IDocument + * @constructor + * @param {google.cloud.automl.v1beta1.IDocument=} [properties] Properties to set + */ + function Document(properties) { + this.layout = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Document inputConfig. + * @member {google.cloud.automl.v1beta1.IDocumentInputConfig|null|undefined} inputConfig + * @memberof google.cloud.automl.v1beta1.Document + * @instance + */ + Document.prototype.inputConfig = null; + + /** + * Document documentText. + * @member {google.cloud.automl.v1beta1.ITextSnippet|null|undefined} documentText + * @memberof google.cloud.automl.v1beta1.Document + * @instance + */ + Document.prototype.documentText = null; + + /** + * Document layout. + * @member {Array.} layout + * @memberof google.cloud.automl.v1beta1.Document + * @instance + */ + Document.prototype.layout = $util.emptyArray; + + /** + * Document documentDimensions. + * @member {google.cloud.automl.v1beta1.IDocumentDimensions|null|undefined} documentDimensions + * @memberof google.cloud.automl.v1beta1.Document + * @instance + */ + Document.prototype.documentDimensions = null; + + /** + * Document pageCount. + * @member {number} pageCount + * @memberof google.cloud.automl.v1beta1.Document + * @instance + */ + Document.prototype.pageCount = 0; + + /** + * Creates a new Document instance using the specified properties. + * @function create + * @memberof google.cloud.automl.v1beta1.Document + * @static + * @param {google.cloud.automl.v1beta1.IDocument=} [properties] Properties to set + * @returns {google.cloud.automl.v1beta1.Document} Document instance + */ + Document.create = function create(properties) { + return new Document(properties); + }; + + /** + * Encodes the specified Document message. Does not implicitly {@link google.cloud.automl.v1beta1.Document.verify|verify} messages. + * @function encode + * @memberof google.cloud.automl.v1beta1.Document + * @static + * @param {google.cloud.automl.v1beta1.IDocument} message Document message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Document.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.inputConfig != null && Object.hasOwnProperty.call(message, "inputConfig")) + $root.google.cloud.automl.v1beta1.DocumentInputConfig.encode(message.inputConfig, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.documentText != null && Object.hasOwnProperty.call(message, "documentText")) + $root.google.cloud.automl.v1beta1.TextSnippet.encode(message.documentText, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.layout != null && message.layout.length) + for (var i = 0; i < message.layout.length; ++i) + $root.google.cloud.automl.v1beta1.Document.Layout.encode(message.layout[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.documentDimensions != null && Object.hasOwnProperty.call(message, "documentDimensions")) + $root.google.cloud.automl.v1beta1.DocumentDimensions.encode(message.documentDimensions, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.pageCount != null && Object.hasOwnProperty.call(message, "pageCount")) + writer.uint32(/* id 5, wireType 0 =*/40).int32(message.pageCount); + return writer; + }; + + /** + * Encodes the specified Document message, length delimited. Does not implicitly {@link google.cloud.automl.v1beta1.Document.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.automl.v1beta1.Document + * @static + * @param {google.cloud.automl.v1beta1.IDocument} message Document message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Document.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Document message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.automl.v1beta1.Document + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.automl.v1beta1.Document} Document + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Document.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.automl.v1beta1.Document(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.inputConfig = $root.google.cloud.automl.v1beta1.DocumentInputConfig.decode(reader, reader.uint32()); + break; + } + case 2: { + message.documentText = $root.google.cloud.automl.v1beta1.TextSnippet.decode(reader, reader.uint32()); + break; + } + case 3: { + if (!(message.layout && message.layout.length)) + message.layout = []; + message.layout.push($root.google.cloud.automl.v1beta1.Document.Layout.decode(reader, reader.uint32())); + break; + } + case 4: { + message.documentDimensions = $root.google.cloud.automl.v1beta1.DocumentDimensions.decode(reader, reader.uint32()); + break; + } + case 5: { + message.pageCount = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Document message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.automl.v1beta1.Document + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.automl.v1beta1.Document} Document + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Document.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Document message. + * @function verify + * @memberof google.cloud.automl.v1beta1.Document + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Document.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.inputConfig != null && message.hasOwnProperty("inputConfig")) { + var error = $root.google.cloud.automl.v1beta1.DocumentInputConfig.verify(message.inputConfig); + if (error) + return "inputConfig." + error; + } + if (message.documentText != null && message.hasOwnProperty("documentText")) { + var error = $root.google.cloud.automl.v1beta1.TextSnippet.verify(message.documentText); + if (error) + return "documentText." + error; + } + if (message.layout != null && message.hasOwnProperty("layout")) { + if (!Array.isArray(message.layout)) + return "layout: array expected"; + for (var i = 0; i < message.layout.length; ++i) { + var error = $root.google.cloud.automl.v1beta1.Document.Layout.verify(message.layout[i]); + if (error) + return "layout." + error; + } + } + if (message.documentDimensions != null && message.hasOwnProperty("documentDimensions")) { + var error = $root.google.cloud.automl.v1beta1.DocumentDimensions.verify(message.documentDimensions); + if (error) + return "documentDimensions." + error; + } + if (message.pageCount != null && message.hasOwnProperty("pageCount")) + if (!$util.isInteger(message.pageCount)) + return "pageCount: integer expected"; + return null; + }; + + /** + * Creates a Document message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.automl.v1beta1.Document + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.automl.v1beta1.Document} Document + */ + Document.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.automl.v1beta1.Document) + return object; + var message = new $root.google.cloud.automl.v1beta1.Document(); + if (object.inputConfig != null) { + if (typeof object.inputConfig !== "object") + throw TypeError(".google.cloud.automl.v1beta1.Document.inputConfig: object expected"); + message.inputConfig = $root.google.cloud.automl.v1beta1.DocumentInputConfig.fromObject(object.inputConfig); + } + if (object.documentText != null) { + if (typeof object.documentText !== "object") + throw TypeError(".google.cloud.automl.v1beta1.Document.documentText: object expected"); + message.documentText = $root.google.cloud.automl.v1beta1.TextSnippet.fromObject(object.documentText); + } + if (object.layout) { + if (!Array.isArray(object.layout)) + throw TypeError(".google.cloud.automl.v1beta1.Document.layout: array expected"); + message.layout = []; + for (var i = 0; i < object.layout.length; ++i) { + if (typeof object.layout[i] !== "object") + throw TypeError(".google.cloud.automl.v1beta1.Document.layout: object expected"); + message.layout[i] = $root.google.cloud.automl.v1beta1.Document.Layout.fromObject(object.layout[i]); + } + } + if (object.documentDimensions != null) { + if (typeof object.documentDimensions !== "object") + throw TypeError(".google.cloud.automl.v1beta1.Document.documentDimensions: object expected"); + message.documentDimensions = $root.google.cloud.automl.v1beta1.DocumentDimensions.fromObject(object.documentDimensions); + } + if (object.pageCount != null) + message.pageCount = object.pageCount | 0; + return message; + }; + + /** + * Creates a plain object from a Document message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.automl.v1beta1.Document + * @static + * @param {google.cloud.automl.v1beta1.Document} message Document + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Document.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.layout = []; + if (options.defaults) { + object.inputConfig = null; + object.documentText = null; + object.documentDimensions = null; + object.pageCount = 0; + } + if (message.inputConfig != null && message.hasOwnProperty("inputConfig")) + object.inputConfig = $root.google.cloud.automl.v1beta1.DocumentInputConfig.toObject(message.inputConfig, options); + if (message.documentText != null && message.hasOwnProperty("documentText")) + object.documentText = $root.google.cloud.automl.v1beta1.TextSnippet.toObject(message.documentText, options); + if (message.layout && message.layout.length) { + object.layout = []; + for (var j = 0; j < message.layout.length; ++j) + object.layout[j] = $root.google.cloud.automl.v1beta1.Document.Layout.toObject(message.layout[j], options); + } + if (message.documentDimensions != null && message.hasOwnProperty("documentDimensions")) + object.documentDimensions = $root.google.cloud.automl.v1beta1.DocumentDimensions.toObject(message.documentDimensions, options); + if (message.pageCount != null && message.hasOwnProperty("pageCount")) + object.pageCount = message.pageCount; + return object; + }; + + /** + * Converts this Document to JSON. + * @function toJSON + * @memberof google.cloud.automl.v1beta1.Document + * @instance + * @returns {Object.} JSON object + */ + Document.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Document + * @function getTypeUrl + * @memberof google.cloud.automl.v1beta1.Document + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Document.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.automl.v1beta1.Document"; + }; + + Document.Layout = (function() { + + /** + * Properties of a Layout. + * @memberof google.cloud.automl.v1beta1.Document + * @interface ILayout + * @property {google.cloud.automl.v1beta1.ITextSegment|null} [textSegment] Layout textSegment + * @property {number|null} [pageNumber] Layout pageNumber + * @property {google.cloud.automl.v1beta1.IBoundingPoly|null} [boundingPoly] Layout boundingPoly + * @property {google.cloud.automl.v1beta1.Document.Layout.TextSegmentType|null} [textSegmentType] Layout textSegmentType + */ + + /** + * Constructs a new Layout. + * @memberof google.cloud.automl.v1beta1.Document + * @classdesc Represents a Layout. + * @implements ILayout + * @constructor + * @param {google.cloud.automl.v1beta1.Document.ILayout=} [properties] Properties to set + */ + function Layout(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Layout textSegment. + * @member {google.cloud.automl.v1beta1.ITextSegment|null|undefined} textSegment + * @memberof google.cloud.automl.v1beta1.Document.Layout + * @instance + */ + Layout.prototype.textSegment = null; + + /** + * Layout pageNumber. + * @member {number} pageNumber + * @memberof google.cloud.automl.v1beta1.Document.Layout + * @instance + */ + Layout.prototype.pageNumber = 0; + + /** + * Layout boundingPoly. + * @member {google.cloud.automl.v1beta1.IBoundingPoly|null|undefined} boundingPoly + * @memberof google.cloud.automl.v1beta1.Document.Layout + * @instance + */ + Layout.prototype.boundingPoly = null; + + /** + * Layout textSegmentType. + * @member {google.cloud.automl.v1beta1.Document.Layout.TextSegmentType} textSegmentType + * @memberof google.cloud.automl.v1beta1.Document.Layout + * @instance + */ + Layout.prototype.textSegmentType = 0; + + /** + * Creates a new Layout instance using the specified properties. + * @function create + * @memberof google.cloud.automl.v1beta1.Document.Layout + * @static + * @param {google.cloud.automl.v1beta1.Document.ILayout=} [properties] Properties to set + * @returns {google.cloud.automl.v1beta1.Document.Layout} Layout instance + */ + Layout.create = function create(properties) { + return new Layout(properties); + }; + + /** + * Encodes the specified Layout message. Does not implicitly {@link google.cloud.automl.v1beta1.Document.Layout.verify|verify} messages. + * @function encode + * @memberof google.cloud.automl.v1beta1.Document.Layout + * @static + * @param {google.cloud.automl.v1beta1.Document.ILayout} message Layout message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Layout.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.textSegment != null && Object.hasOwnProperty.call(message, "textSegment")) + $root.google.cloud.automl.v1beta1.TextSegment.encode(message.textSegment, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.pageNumber != null && Object.hasOwnProperty.call(message, "pageNumber")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.pageNumber); + if (message.boundingPoly != null && Object.hasOwnProperty.call(message, "boundingPoly")) + $root.google.cloud.automl.v1beta1.BoundingPoly.encode(message.boundingPoly, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.textSegmentType != null && Object.hasOwnProperty.call(message, "textSegmentType")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.textSegmentType); + return writer; + }; + + /** + * Encodes the specified Layout message, length delimited. Does not implicitly {@link google.cloud.automl.v1beta1.Document.Layout.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.automl.v1beta1.Document.Layout + * @static + * @param {google.cloud.automl.v1beta1.Document.ILayout} message Layout message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Layout.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Layout message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.automl.v1beta1.Document.Layout + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.automl.v1beta1.Document.Layout} Layout + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Layout.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.automl.v1beta1.Document.Layout(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.textSegment = $root.google.cloud.automl.v1beta1.TextSegment.decode(reader, reader.uint32()); + break; + } + case 2: { + message.pageNumber = reader.int32(); + break; + } + case 3: { + message.boundingPoly = $root.google.cloud.automl.v1beta1.BoundingPoly.decode(reader, reader.uint32()); + break; + } + case 4: { + message.textSegmentType = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Layout message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.automl.v1beta1.Document.Layout + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.automl.v1beta1.Document.Layout} Layout + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Layout.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Layout message. + * @function verify + * @memberof google.cloud.automl.v1beta1.Document.Layout + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Layout.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.textSegment != null && message.hasOwnProperty("textSegment")) { + var error = $root.google.cloud.automl.v1beta1.TextSegment.verify(message.textSegment); + if (error) + return "textSegment." + error; + } + if (message.pageNumber != null && message.hasOwnProperty("pageNumber")) + if (!$util.isInteger(message.pageNumber)) + return "pageNumber: integer expected"; + if (message.boundingPoly != null && message.hasOwnProperty("boundingPoly")) { + var error = $root.google.cloud.automl.v1beta1.BoundingPoly.verify(message.boundingPoly); + if (error) + return "boundingPoly." + error; + } + if (message.textSegmentType != null && message.hasOwnProperty("textSegmentType")) + switch (message.textSegmentType) { + default: + return "textSegmentType: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + case 5: + case 6: + case 7: + case 8: + case 9: + break; + } + return null; + }; + + /** + * Creates a Layout message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.automl.v1beta1.Document.Layout + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.automl.v1beta1.Document.Layout} Layout + */ + Layout.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.automl.v1beta1.Document.Layout) + return object; + var message = new $root.google.cloud.automl.v1beta1.Document.Layout(); + if (object.textSegment != null) { + if (typeof object.textSegment !== "object") + throw TypeError(".google.cloud.automl.v1beta1.Document.Layout.textSegment: object expected"); + message.textSegment = $root.google.cloud.automl.v1beta1.TextSegment.fromObject(object.textSegment); + } + if (object.pageNumber != null) + message.pageNumber = object.pageNumber | 0; + if (object.boundingPoly != null) { + if (typeof object.boundingPoly !== "object") + throw TypeError(".google.cloud.automl.v1beta1.Document.Layout.boundingPoly: object expected"); + message.boundingPoly = $root.google.cloud.automl.v1beta1.BoundingPoly.fromObject(object.boundingPoly); + } + switch (object.textSegmentType) { + default: + if (typeof object.textSegmentType === "number") { + message.textSegmentType = object.textSegmentType; + break; + } + break; + case "TEXT_SEGMENT_TYPE_UNSPECIFIED": + case 0: + message.textSegmentType = 0; + break; + case "TOKEN": + case 1: + message.textSegmentType = 1; + break; + case "PARAGRAPH": + case 2: + message.textSegmentType = 2; + break; + case "FORM_FIELD": + case 3: + message.textSegmentType = 3; + break; + case "FORM_FIELD_NAME": + case 4: + message.textSegmentType = 4; + break; + case "FORM_FIELD_CONTENTS": + case 5: + message.textSegmentType = 5; + break; + case "TABLE": + case 6: + message.textSegmentType = 6; + break; + case "TABLE_HEADER": + case 7: + message.textSegmentType = 7; + break; + case "TABLE_ROW": + case 8: + message.textSegmentType = 8; + break; + case "TABLE_CELL": + case 9: + message.textSegmentType = 9; + break; + } + return message; + }; + + /** + * Creates a plain object from a Layout message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.automl.v1beta1.Document.Layout + * @static + * @param {google.cloud.automl.v1beta1.Document.Layout} message Layout + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Layout.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.textSegment = null; + object.pageNumber = 0; + object.boundingPoly = null; + object.textSegmentType = options.enums === String ? "TEXT_SEGMENT_TYPE_UNSPECIFIED" : 0; + } + if (message.textSegment != null && message.hasOwnProperty("textSegment")) + object.textSegment = $root.google.cloud.automl.v1beta1.TextSegment.toObject(message.textSegment, options); + if (message.pageNumber != null && message.hasOwnProperty("pageNumber")) + object.pageNumber = message.pageNumber; + if (message.boundingPoly != null && message.hasOwnProperty("boundingPoly")) + object.boundingPoly = $root.google.cloud.automl.v1beta1.BoundingPoly.toObject(message.boundingPoly, options); + if (message.textSegmentType != null && message.hasOwnProperty("textSegmentType")) + object.textSegmentType = options.enums === String ? $root.google.cloud.automl.v1beta1.Document.Layout.TextSegmentType[message.textSegmentType] === undefined ? message.textSegmentType : $root.google.cloud.automl.v1beta1.Document.Layout.TextSegmentType[message.textSegmentType] : message.textSegmentType; + return object; + }; + + /** + * Converts this Layout to JSON. + * @function toJSON + * @memberof google.cloud.automl.v1beta1.Document.Layout + * @instance + * @returns {Object.} JSON object + */ + Layout.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Layout + * @function getTypeUrl + * @memberof google.cloud.automl.v1beta1.Document.Layout + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Layout.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.automl.v1beta1.Document.Layout"; + }; + + /** + * TextSegmentType enum. + * @name google.cloud.automl.v1beta1.Document.Layout.TextSegmentType + * @enum {number} + * @property {number} TEXT_SEGMENT_TYPE_UNSPECIFIED=0 TEXT_SEGMENT_TYPE_UNSPECIFIED value + * @property {number} TOKEN=1 TOKEN value + * @property {number} PARAGRAPH=2 PARAGRAPH value + * @property {number} FORM_FIELD=3 FORM_FIELD value + * @property {number} FORM_FIELD_NAME=4 FORM_FIELD_NAME value + * @property {number} FORM_FIELD_CONTENTS=5 FORM_FIELD_CONTENTS value + * @property {number} TABLE=6 TABLE value + * @property {number} TABLE_HEADER=7 TABLE_HEADER value + * @property {number} TABLE_ROW=8 TABLE_ROW value + * @property {number} TABLE_CELL=9 TABLE_CELL value + */ + Layout.TextSegmentType = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "TEXT_SEGMENT_TYPE_UNSPECIFIED"] = 0; + values[valuesById[1] = "TOKEN"] = 1; + values[valuesById[2] = "PARAGRAPH"] = 2; + values[valuesById[3] = "FORM_FIELD"] = 3; + values[valuesById[4] = "FORM_FIELD_NAME"] = 4; + values[valuesById[5] = "FORM_FIELD_CONTENTS"] = 5; + values[valuesById[6] = "TABLE"] = 6; + values[valuesById[7] = "TABLE_HEADER"] = 7; + values[valuesById[8] = "TABLE_ROW"] = 8; + values[valuesById[9] = "TABLE_CELL"] = 9; + return values; + })(); + + return Layout; + })(); + + return Document; + })(); + + v1beta1.Row = (function() { + + /** + * Properties of a Row. + * @memberof google.cloud.automl.v1beta1 + * @interface IRow + * @property {Array.|null} [columnSpecIds] Row columnSpecIds + * @property {Array.|null} [values] Row values + */ + + /** + * Constructs a new Row. + * @memberof google.cloud.automl.v1beta1 + * @classdesc Represents a Row. + * @implements IRow + * @constructor + * @param {google.cloud.automl.v1beta1.IRow=} [properties] Properties to set + */ + function Row(properties) { + this.columnSpecIds = []; + this.values = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Row columnSpecIds. + * @member {Array.} columnSpecIds + * @memberof google.cloud.automl.v1beta1.Row + * @instance + */ + Row.prototype.columnSpecIds = $util.emptyArray; + + /** + * Row values. + * @member {Array.} values + * @memberof google.cloud.automl.v1beta1.Row + * @instance + */ + Row.prototype.values = $util.emptyArray; + + /** + * Creates a new Row instance using the specified properties. + * @function create + * @memberof google.cloud.automl.v1beta1.Row + * @static + * @param {google.cloud.automl.v1beta1.IRow=} [properties] Properties to set + * @returns {google.cloud.automl.v1beta1.Row} Row instance + */ + Row.create = function create(properties) { + return new Row(properties); + }; + + /** + * Encodes the specified Row message. Does not implicitly {@link google.cloud.automl.v1beta1.Row.verify|verify} messages. + * @function encode + * @memberof google.cloud.automl.v1beta1.Row + * @static + * @param {google.cloud.automl.v1beta1.IRow} message Row message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Row.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.columnSpecIds != null && message.columnSpecIds.length) + for (var i = 0; i < message.columnSpecIds.length; ++i) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.columnSpecIds[i]); + if (message.values != null && message.values.length) + for (var i = 0; i < message.values.length; ++i) + $root.google.protobuf.Value.encode(message.values[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified Row message, length delimited. Does not implicitly {@link google.cloud.automl.v1beta1.Row.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.automl.v1beta1.Row + * @static + * @param {google.cloud.automl.v1beta1.IRow} message Row message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Row.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Row message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.automl.v1beta1.Row + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.automl.v1beta1.Row} Row + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Row.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.automl.v1beta1.Row(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 2: { + if (!(message.columnSpecIds && message.columnSpecIds.length)) + message.columnSpecIds = []; + message.columnSpecIds.push(reader.string()); + break; + } + case 3: { + if (!(message.values && message.values.length)) + message.values = []; + message.values.push($root.google.protobuf.Value.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Row message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.automl.v1beta1.Row + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.automl.v1beta1.Row} Row + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Row.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Row message. + * @function verify + * @memberof google.cloud.automl.v1beta1.Row + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Row.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.columnSpecIds != null && message.hasOwnProperty("columnSpecIds")) { + if (!Array.isArray(message.columnSpecIds)) + return "columnSpecIds: array expected"; + for (var i = 0; i < message.columnSpecIds.length; ++i) + if (!$util.isString(message.columnSpecIds[i])) + return "columnSpecIds: string[] expected"; + } + if (message.values != null && message.hasOwnProperty("values")) { + if (!Array.isArray(message.values)) + return "values: array expected"; + for (var i = 0; i < message.values.length; ++i) { + var error = $root.google.protobuf.Value.verify(message.values[i]); + if (error) + return "values." + error; + } + } + return null; + }; + + /** + * Creates a Row message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.automl.v1beta1.Row + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.automl.v1beta1.Row} Row + */ + Row.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.automl.v1beta1.Row) + return object; + var message = new $root.google.cloud.automl.v1beta1.Row(); + if (object.columnSpecIds) { + if (!Array.isArray(object.columnSpecIds)) + throw TypeError(".google.cloud.automl.v1beta1.Row.columnSpecIds: array expected"); + message.columnSpecIds = []; + for (var i = 0; i < object.columnSpecIds.length; ++i) + message.columnSpecIds[i] = String(object.columnSpecIds[i]); + } + if (object.values) { + if (!Array.isArray(object.values)) + throw TypeError(".google.cloud.automl.v1beta1.Row.values: array expected"); + message.values = []; + for (var i = 0; i < object.values.length; ++i) { + if (typeof object.values[i] !== "object") + throw TypeError(".google.cloud.automl.v1beta1.Row.values: object expected"); + message.values[i] = $root.google.protobuf.Value.fromObject(object.values[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a Row message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.automl.v1beta1.Row + * @static + * @param {google.cloud.automl.v1beta1.Row} message Row + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Row.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.columnSpecIds = []; + object.values = []; + } + if (message.columnSpecIds && message.columnSpecIds.length) { + object.columnSpecIds = []; + for (var j = 0; j < message.columnSpecIds.length; ++j) + object.columnSpecIds[j] = message.columnSpecIds[j]; + } + if (message.values && message.values.length) { + object.values = []; + for (var j = 0; j < message.values.length; ++j) + object.values[j] = $root.google.protobuf.Value.toObject(message.values[j], options); + } + return object; + }; + + /** + * Converts this Row to JSON. + * @function toJSON + * @memberof google.cloud.automl.v1beta1.Row + * @instance + * @returns {Object.} JSON object + */ + Row.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Row + * @function getTypeUrl + * @memberof google.cloud.automl.v1beta1.Row + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Row.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.automl.v1beta1.Row"; + }; + + return Row; + })(); + + v1beta1.ExamplePayload = (function() { + + /** + * Properties of an ExamplePayload. + * @memberof google.cloud.automl.v1beta1 + * @interface IExamplePayload + * @property {google.cloud.automl.v1beta1.IImage|null} [image] ExamplePayload image + * @property {google.cloud.automl.v1beta1.ITextSnippet|null} [textSnippet] ExamplePayload textSnippet + * @property {google.cloud.automl.v1beta1.IDocument|null} [document] ExamplePayload document + * @property {google.cloud.automl.v1beta1.IRow|null} [row] ExamplePayload row + */ + + /** + * Constructs a new ExamplePayload. + * @memberof google.cloud.automl.v1beta1 + * @classdesc Represents an ExamplePayload. + * @implements IExamplePayload + * @constructor + * @param {google.cloud.automl.v1beta1.IExamplePayload=} [properties] Properties to set + */ + function ExamplePayload(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ExamplePayload image. + * @member {google.cloud.automl.v1beta1.IImage|null|undefined} image + * @memberof google.cloud.automl.v1beta1.ExamplePayload + * @instance + */ + ExamplePayload.prototype.image = null; + + /** + * ExamplePayload textSnippet. + * @member {google.cloud.automl.v1beta1.ITextSnippet|null|undefined} textSnippet + * @memberof google.cloud.automl.v1beta1.ExamplePayload + * @instance + */ + ExamplePayload.prototype.textSnippet = null; + + /** + * ExamplePayload document. + * @member {google.cloud.automl.v1beta1.IDocument|null|undefined} document + * @memberof google.cloud.automl.v1beta1.ExamplePayload + * @instance + */ + ExamplePayload.prototype.document = null; + + /** + * ExamplePayload row. + * @member {google.cloud.automl.v1beta1.IRow|null|undefined} row + * @memberof google.cloud.automl.v1beta1.ExamplePayload + * @instance + */ + ExamplePayload.prototype.row = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * ExamplePayload payload. + * @member {"image"|"textSnippet"|"document"|"row"|undefined} payload + * @memberof google.cloud.automl.v1beta1.ExamplePayload + * @instance + */ + Object.defineProperty(ExamplePayload.prototype, "payload", { + get: $util.oneOfGetter($oneOfFields = ["image", "textSnippet", "document", "row"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new ExamplePayload instance using the specified properties. + * @function create + * @memberof google.cloud.automl.v1beta1.ExamplePayload + * @static + * @param {google.cloud.automl.v1beta1.IExamplePayload=} [properties] Properties to set + * @returns {google.cloud.automl.v1beta1.ExamplePayload} ExamplePayload instance + */ + ExamplePayload.create = function create(properties) { + return new ExamplePayload(properties); + }; + + /** + * Encodes the specified ExamplePayload message. Does not implicitly {@link google.cloud.automl.v1beta1.ExamplePayload.verify|verify} messages. + * @function encode + * @memberof google.cloud.automl.v1beta1.ExamplePayload + * @static + * @param {google.cloud.automl.v1beta1.IExamplePayload} message ExamplePayload message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ExamplePayload.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.image != null && Object.hasOwnProperty.call(message, "image")) + $root.google.cloud.automl.v1beta1.Image.encode(message.image, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.textSnippet != null && Object.hasOwnProperty.call(message, "textSnippet")) + $root.google.cloud.automl.v1beta1.TextSnippet.encode(message.textSnippet, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.row != null && Object.hasOwnProperty.call(message, "row")) + $root.google.cloud.automl.v1beta1.Row.encode(message.row, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.document != null && Object.hasOwnProperty.call(message, "document")) + $root.google.cloud.automl.v1beta1.Document.encode(message.document, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified ExamplePayload message, length delimited. Does not implicitly {@link google.cloud.automl.v1beta1.ExamplePayload.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.automl.v1beta1.ExamplePayload + * @static + * @param {google.cloud.automl.v1beta1.IExamplePayload} message ExamplePayload message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ExamplePayload.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an ExamplePayload message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.automl.v1beta1.ExamplePayload + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.automl.v1beta1.ExamplePayload} ExamplePayload + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ExamplePayload.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.automl.v1beta1.ExamplePayload(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.image = $root.google.cloud.automl.v1beta1.Image.decode(reader, reader.uint32()); + break; + } + case 2: { + message.textSnippet = $root.google.cloud.automl.v1beta1.TextSnippet.decode(reader, reader.uint32()); + break; + } + case 4: { + message.document = $root.google.cloud.automl.v1beta1.Document.decode(reader, reader.uint32()); + break; + } + case 3: { + message.row = $root.google.cloud.automl.v1beta1.Row.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an ExamplePayload message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.automl.v1beta1.ExamplePayload + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.automl.v1beta1.ExamplePayload} ExamplePayload + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ExamplePayload.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an ExamplePayload message. + * @function verify + * @memberof google.cloud.automl.v1beta1.ExamplePayload + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ExamplePayload.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.image != null && message.hasOwnProperty("image")) { + properties.payload = 1; + { + var error = $root.google.cloud.automl.v1beta1.Image.verify(message.image); + if (error) + return "image." + error; + } + } + if (message.textSnippet != null && message.hasOwnProperty("textSnippet")) { + if (properties.payload === 1) + return "payload: multiple values"; + properties.payload = 1; + { + var error = $root.google.cloud.automl.v1beta1.TextSnippet.verify(message.textSnippet); + if (error) + return "textSnippet." + error; + } + } + if (message.document != null && message.hasOwnProperty("document")) { + if (properties.payload === 1) + return "payload: multiple values"; + properties.payload = 1; + { + var error = $root.google.cloud.automl.v1beta1.Document.verify(message.document); + if (error) + return "document." + error; + } + } + if (message.row != null && message.hasOwnProperty("row")) { + if (properties.payload === 1) + return "payload: multiple values"; + properties.payload = 1; + { + var error = $root.google.cloud.automl.v1beta1.Row.verify(message.row); + if (error) + return "row." + error; + } + } + return null; + }; + + /** + * Creates an ExamplePayload message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.automl.v1beta1.ExamplePayload + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.automl.v1beta1.ExamplePayload} ExamplePayload + */ + ExamplePayload.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.automl.v1beta1.ExamplePayload) + return object; + var message = new $root.google.cloud.automl.v1beta1.ExamplePayload(); + if (object.image != null) { + if (typeof object.image !== "object") + throw TypeError(".google.cloud.automl.v1beta1.ExamplePayload.image: object expected"); + message.image = $root.google.cloud.automl.v1beta1.Image.fromObject(object.image); + } + if (object.textSnippet != null) { + if (typeof object.textSnippet !== "object") + throw TypeError(".google.cloud.automl.v1beta1.ExamplePayload.textSnippet: object expected"); + message.textSnippet = $root.google.cloud.automl.v1beta1.TextSnippet.fromObject(object.textSnippet); + } + if (object.document != null) { + if (typeof object.document !== "object") + throw TypeError(".google.cloud.automl.v1beta1.ExamplePayload.document: object expected"); + message.document = $root.google.cloud.automl.v1beta1.Document.fromObject(object.document); + } + if (object.row != null) { + if (typeof object.row !== "object") + throw TypeError(".google.cloud.automl.v1beta1.ExamplePayload.row: object expected"); + message.row = $root.google.cloud.automl.v1beta1.Row.fromObject(object.row); + } + return message; + }; + + /** + * Creates a plain object from an ExamplePayload message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.automl.v1beta1.ExamplePayload + * @static + * @param {google.cloud.automl.v1beta1.ExamplePayload} message ExamplePayload + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ExamplePayload.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.image != null && message.hasOwnProperty("image")) { + object.image = $root.google.cloud.automl.v1beta1.Image.toObject(message.image, options); + if (options.oneofs) + object.payload = "image"; + } + if (message.textSnippet != null && message.hasOwnProperty("textSnippet")) { + object.textSnippet = $root.google.cloud.automl.v1beta1.TextSnippet.toObject(message.textSnippet, options); + if (options.oneofs) + object.payload = "textSnippet"; + } + if (message.row != null && message.hasOwnProperty("row")) { + object.row = $root.google.cloud.automl.v1beta1.Row.toObject(message.row, options); + if (options.oneofs) + object.payload = "row"; + } + if (message.document != null && message.hasOwnProperty("document")) { + object.document = $root.google.cloud.automl.v1beta1.Document.toObject(message.document, options); + if (options.oneofs) + object.payload = "document"; + } + return object; + }; + + /** + * Converts this ExamplePayload to JSON. + * @function toJSON + * @memberof google.cloud.automl.v1beta1.ExamplePayload + * @instance + * @returns {Object.} JSON object + */ + ExamplePayload.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ExamplePayload + * @function getTypeUrl + * @memberof google.cloud.automl.v1beta1.ExamplePayload + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ExamplePayload.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.automl.v1beta1.ExamplePayload"; + }; + + return ExamplePayload; + })(); + + v1beta1.InputConfig = (function() { + + /** + * Properties of an InputConfig. + * @memberof google.cloud.automl.v1beta1 + * @interface IInputConfig + * @property {google.cloud.automl.v1beta1.IGcsSource|null} [gcsSource] InputConfig gcsSource + * @property {google.cloud.automl.v1beta1.IBigQuerySource|null} [bigquerySource] InputConfig bigquerySource + * @property {Object.|null} [params] InputConfig params + */ + + /** + * Constructs a new InputConfig. + * @memberof google.cloud.automl.v1beta1 + * @classdesc Represents an InputConfig. + * @implements IInputConfig + * @constructor + * @param {google.cloud.automl.v1beta1.IInputConfig=} [properties] Properties to set + */ + function InputConfig(properties) { + this.params = {}; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * InputConfig gcsSource. + * @member {google.cloud.automl.v1beta1.IGcsSource|null|undefined} gcsSource + * @memberof google.cloud.automl.v1beta1.InputConfig + * @instance + */ + InputConfig.prototype.gcsSource = null; + + /** + * InputConfig bigquerySource. + * @member {google.cloud.automl.v1beta1.IBigQuerySource|null|undefined} bigquerySource + * @memberof google.cloud.automl.v1beta1.InputConfig + * @instance + */ + InputConfig.prototype.bigquerySource = null; + + /** + * InputConfig params. + * @member {Object.} params + * @memberof google.cloud.automl.v1beta1.InputConfig + * @instance + */ + InputConfig.prototype.params = $util.emptyObject; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * InputConfig source. + * @member {"gcsSource"|"bigquerySource"|undefined} source + * @memberof google.cloud.automl.v1beta1.InputConfig + * @instance + */ + Object.defineProperty(InputConfig.prototype, "source", { + get: $util.oneOfGetter($oneOfFields = ["gcsSource", "bigquerySource"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new InputConfig instance using the specified properties. + * @function create + * @memberof google.cloud.automl.v1beta1.InputConfig + * @static + * @param {google.cloud.automl.v1beta1.IInputConfig=} [properties] Properties to set + * @returns {google.cloud.automl.v1beta1.InputConfig} InputConfig instance + */ + InputConfig.create = function create(properties) { + return new InputConfig(properties); + }; + + /** + * Encodes the specified InputConfig message. Does not implicitly {@link google.cloud.automl.v1beta1.InputConfig.verify|verify} messages. + * @function encode + * @memberof google.cloud.automl.v1beta1.InputConfig + * @static + * @param {google.cloud.automl.v1beta1.IInputConfig} message InputConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + InputConfig.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.gcsSource != null && Object.hasOwnProperty.call(message, "gcsSource")) + $root.google.cloud.automl.v1beta1.GcsSource.encode(message.gcsSource, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.params != null && Object.hasOwnProperty.call(message, "params")) + for (var keys = Object.keys(message.params), 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.params[keys[i]]).ldelim(); + if (message.bigquerySource != null && Object.hasOwnProperty.call(message, "bigquerySource")) + $root.google.cloud.automl.v1beta1.BigQuerySource.encode(message.bigquerySource, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified InputConfig message, length delimited. Does not implicitly {@link google.cloud.automl.v1beta1.InputConfig.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.automl.v1beta1.InputConfig + * @static + * @param {google.cloud.automl.v1beta1.IInputConfig} message InputConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + InputConfig.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an InputConfig message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.automl.v1beta1.InputConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.automl.v1beta1.InputConfig} InputConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + InputConfig.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.automl.v1beta1.InputConfig(), key, value; + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.gcsSource = $root.google.cloud.automl.v1beta1.GcsSource.decode(reader, reader.uint32()); + break; + } + case 3: { + message.bigquerySource = $root.google.cloud.automl.v1beta1.BigQuerySource.decode(reader, reader.uint32()); + break; + } + case 2: { + if (message.params === $util.emptyObject) + message.params = {}; + 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.params[key] = value; + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an InputConfig message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.automl.v1beta1.InputConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.automl.v1beta1.InputConfig} InputConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + InputConfig.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an InputConfig message. + * @function verify + * @memberof google.cloud.automl.v1beta1.InputConfig + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + InputConfig.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.gcsSource != null && message.hasOwnProperty("gcsSource")) { + properties.source = 1; + { + var error = $root.google.cloud.automl.v1beta1.GcsSource.verify(message.gcsSource); + if (error) + return "gcsSource." + error; + } + } + if (message.bigquerySource != null && message.hasOwnProperty("bigquerySource")) { + if (properties.source === 1) + return "source: multiple values"; + properties.source = 1; + { + var error = $root.google.cloud.automl.v1beta1.BigQuerySource.verify(message.bigquerySource); + if (error) + return "bigquerySource." + error; + } + } + if (message.params != null && message.hasOwnProperty("params")) { + if (!$util.isObject(message.params)) + return "params: object expected"; + var key = Object.keys(message.params); + for (var i = 0; i < key.length; ++i) + if (!$util.isString(message.params[key[i]])) + return "params: string{k:string} expected"; + } + return null; + }; + + /** + * Creates an InputConfig message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.automl.v1beta1.InputConfig + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.automl.v1beta1.InputConfig} InputConfig + */ + InputConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.automl.v1beta1.InputConfig) + return object; + var message = new $root.google.cloud.automl.v1beta1.InputConfig(); + if (object.gcsSource != null) { + if (typeof object.gcsSource !== "object") + throw TypeError(".google.cloud.automl.v1beta1.InputConfig.gcsSource: object expected"); + message.gcsSource = $root.google.cloud.automl.v1beta1.GcsSource.fromObject(object.gcsSource); + } + if (object.bigquerySource != null) { + if (typeof object.bigquerySource !== "object") + throw TypeError(".google.cloud.automl.v1beta1.InputConfig.bigquerySource: object expected"); + message.bigquerySource = $root.google.cloud.automl.v1beta1.BigQuerySource.fromObject(object.bigquerySource); + } + if (object.params) { + if (typeof object.params !== "object") + throw TypeError(".google.cloud.automl.v1beta1.InputConfig.params: object expected"); + message.params = {}; + for (var keys = Object.keys(object.params), i = 0; i < keys.length; ++i) + message.params[keys[i]] = String(object.params[keys[i]]); + } + return message; + }; + + /** + * Creates a plain object from an InputConfig message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.automl.v1beta1.InputConfig + * @static + * @param {google.cloud.automl.v1beta1.InputConfig} message InputConfig + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + InputConfig.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.objects || options.defaults) + object.params = {}; + if (message.gcsSource != null && message.hasOwnProperty("gcsSource")) { + object.gcsSource = $root.google.cloud.automl.v1beta1.GcsSource.toObject(message.gcsSource, options); + if (options.oneofs) + object.source = "gcsSource"; + } + var keys2; + if (message.params && (keys2 = Object.keys(message.params)).length) { + object.params = {}; + for (var j = 0; j < keys2.length; ++j) + object.params[keys2[j]] = message.params[keys2[j]]; + } + if (message.bigquerySource != null && message.hasOwnProperty("bigquerySource")) { + object.bigquerySource = $root.google.cloud.automl.v1beta1.BigQuerySource.toObject(message.bigquerySource, options); + if (options.oneofs) + object.source = "bigquerySource"; + } + return object; + }; + + /** + * Converts this InputConfig to JSON. + * @function toJSON + * @memberof google.cloud.automl.v1beta1.InputConfig + * @instance + * @returns {Object.} JSON object + */ + InputConfig.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for InputConfig + * @function getTypeUrl + * @memberof google.cloud.automl.v1beta1.InputConfig + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + InputConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.automl.v1beta1.InputConfig"; + }; + + return InputConfig; + })(); + + v1beta1.BatchPredictInputConfig = (function() { + + /** + * Properties of a BatchPredictInputConfig. + * @memberof google.cloud.automl.v1beta1 + * @interface IBatchPredictInputConfig + * @property {google.cloud.automl.v1beta1.IGcsSource|null} [gcsSource] BatchPredictInputConfig gcsSource + * @property {google.cloud.automl.v1beta1.IBigQuerySource|null} [bigquerySource] BatchPredictInputConfig bigquerySource + */ + + /** + * Constructs a new BatchPredictInputConfig. + * @memberof google.cloud.automl.v1beta1 + * @classdesc Represents a BatchPredictInputConfig. + * @implements IBatchPredictInputConfig + * @constructor + * @param {google.cloud.automl.v1beta1.IBatchPredictInputConfig=} [properties] Properties to set + */ + function BatchPredictInputConfig(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * BatchPredictInputConfig gcsSource. + * @member {google.cloud.automl.v1beta1.IGcsSource|null|undefined} gcsSource + * @memberof google.cloud.automl.v1beta1.BatchPredictInputConfig + * @instance + */ + BatchPredictInputConfig.prototype.gcsSource = null; + + /** + * BatchPredictInputConfig bigquerySource. + * @member {google.cloud.automl.v1beta1.IBigQuerySource|null|undefined} bigquerySource + * @memberof google.cloud.automl.v1beta1.BatchPredictInputConfig + * @instance + */ + BatchPredictInputConfig.prototype.bigquerySource = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * BatchPredictInputConfig source. + * @member {"gcsSource"|"bigquerySource"|undefined} source + * @memberof google.cloud.automl.v1beta1.BatchPredictInputConfig + * @instance + */ + Object.defineProperty(BatchPredictInputConfig.prototype, "source", { + get: $util.oneOfGetter($oneOfFields = ["gcsSource", "bigquerySource"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new BatchPredictInputConfig instance using the specified properties. + * @function create + * @memberof google.cloud.automl.v1beta1.BatchPredictInputConfig + * @static + * @param {google.cloud.automl.v1beta1.IBatchPredictInputConfig=} [properties] Properties to set + * @returns {google.cloud.automl.v1beta1.BatchPredictInputConfig} BatchPredictInputConfig instance + */ + BatchPredictInputConfig.create = function create(properties) { + return new BatchPredictInputConfig(properties); + }; + + /** + * Encodes the specified BatchPredictInputConfig message. Does not implicitly {@link google.cloud.automl.v1beta1.BatchPredictInputConfig.verify|verify} messages. + * @function encode + * @memberof google.cloud.automl.v1beta1.BatchPredictInputConfig + * @static + * @param {google.cloud.automl.v1beta1.IBatchPredictInputConfig} message BatchPredictInputConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BatchPredictInputConfig.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.gcsSource != null && Object.hasOwnProperty.call(message, "gcsSource")) + $root.google.cloud.automl.v1beta1.GcsSource.encode(message.gcsSource, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.bigquerySource != null && Object.hasOwnProperty.call(message, "bigquerySource")) + $root.google.cloud.automl.v1beta1.BigQuerySource.encode(message.bigquerySource, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified BatchPredictInputConfig message, length delimited. Does not implicitly {@link google.cloud.automl.v1beta1.BatchPredictInputConfig.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.automl.v1beta1.BatchPredictInputConfig + * @static + * @param {google.cloud.automl.v1beta1.IBatchPredictInputConfig} message BatchPredictInputConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BatchPredictInputConfig.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a BatchPredictInputConfig message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.automl.v1beta1.BatchPredictInputConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.automl.v1beta1.BatchPredictInputConfig} BatchPredictInputConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BatchPredictInputConfig.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.automl.v1beta1.BatchPredictInputConfig(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.gcsSource = $root.google.cloud.automl.v1beta1.GcsSource.decode(reader, reader.uint32()); + break; + } + case 2: { + message.bigquerySource = $root.google.cloud.automl.v1beta1.BigQuerySource.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a BatchPredictInputConfig message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.automl.v1beta1.BatchPredictInputConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.automl.v1beta1.BatchPredictInputConfig} BatchPredictInputConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BatchPredictInputConfig.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a BatchPredictInputConfig message. + * @function verify + * @memberof google.cloud.automl.v1beta1.BatchPredictInputConfig + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + BatchPredictInputConfig.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.gcsSource != null && message.hasOwnProperty("gcsSource")) { + properties.source = 1; + { + var error = $root.google.cloud.automl.v1beta1.GcsSource.verify(message.gcsSource); + if (error) + return "gcsSource." + error; + } + } + if (message.bigquerySource != null && message.hasOwnProperty("bigquerySource")) { + if (properties.source === 1) + return "source: multiple values"; + properties.source = 1; + { + var error = $root.google.cloud.automl.v1beta1.BigQuerySource.verify(message.bigquerySource); + if (error) + return "bigquerySource." + error; + } + } + return null; + }; + + /** + * Creates a BatchPredictInputConfig message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.automl.v1beta1.BatchPredictInputConfig + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.automl.v1beta1.BatchPredictInputConfig} BatchPredictInputConfig + */ + BatchPredictInputConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.automl.v1beta1.BatchPredictInputConfig) + return object; + var message = new $root.google.cloud.automl.v1beta1.BatchPredictInputConfig(); + if (object.gcsSource != null) { + if (typeof object.gcsSource !== "object") + throw TypeError(".google.cloud.automl.v1beta1.BatchPredictInputConfig.gcsSource: object expected"); + message.gcsSource = $root.google.cloud.automl.v1beta1.GcsSource.fromObject(object.gcsSource); + } + if (object.bigquerySource != null) { + if (typeof object.bigquerySource !== "object") + throw TypeError(".google.cloud.automl.v1beta1.BatchPredictInputConfig.bigquerySource: object expected"); + message.bigquerySource = $root.google.cloud.automl.v1beta1.BigQuerySource.fromObject(object.bigquerySource); + } + return message; + }; + + /** + * Creates a plain object from a BatchPredictInputConfig message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.automl.v1beta1.BatchPredictInputConfig + * @static + * @param {google.cloud.automl.v1beta1.BatchPredictInputConfig} message BatchPredictInputConfig + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + BatchPredictInputConfig.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.gcsSource != null && message.hasOwnProperty("gcsSource")) { + object.gcsSource = $root.google.cloud.automl.v1beta1.GcsSource.toObject(message.gcsSource, options); + if (options.oneofs) + object.source = "gcsSource"; + } + if (message.bigquerySource != null && message.hasOwnProperty("bigquerySource")) { + object.bigquerySource = $root.google.cloud.automl.v1beta1.BigQuerySource.toObject(message.bigquerySource, options); + if (options.oneofs) + object.source = "bigquerySource"; + } + return object; + }; + + /** + * Converts this BatchPredictInputConfig to JSON. + * @function toJSON + * @memberof google.cloud.automl.v1beta1.BatchPredictInputConfig + * @instance + * @returns {Object.} JSON object + */ + BatchPredictInputConfig.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for BatchPredictInputConfig + * @function getTypeUrl + * @memberof google.cloud.automl.v1beta1.BatchPredictInputConfig + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + BatchPredictInputConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.automl.v1beta1.BatchPredictInputConfig"; + }; + + return BatchPredictInputConfig; + })(); + + v1beta1.DocumentInputConfig = (function() { + + /** + * Properties of a DocumentInputConfig. + * @memberof google.cloud.automl.v1beta1 + * @interface IDocumentInputConfig + * @property {google.cloud.automl.v1beta1.IGcsSource|null} [gcsSource] DocumentInputConfig gcsSource + */ + + /** + * Constructs a new DocumentInputConfig. + * @memberof google.cloud.automl.v1beta1 + * @classdesc Represents a DocumentInputConfig. + * @implements IDocumentInputConfig + * @constructor + * @param {google.cloud.automl.v1beta1.IDocumentInputConfig=} [properties] Properties to set + */ + function DocumentInputConfig(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * DocumentInputConfig gcsSource. + * @member {google.cloud.automl.v1beta1.IGcsSource|null|undefined} gcsSource + * @memberof google.cloud.automl.v1beta1.DocumentInputConfig + * @instance + */ + DocumentInputConfig.prototype.gcsSource = null; + + /** + * Creates a new DocumentInputConfig instance using the specified properties. + * @function create + * @memberof google.cloud.automl.v1beta1.DocumentInputConfig + * @static + * @param {google.cloud.automl.v1beta1.IDocumentInputConfig=} [properties] Properties to set + * @returns {google.cloud.automl.v1beta1.DocumentInputConfig} DocumentInputConfig instance + */ + DocumentInputConfig.create = function create(properties) { + return new DocumentInputConfig(properties); + }; + + /** + * Encodes the specified DocumentInputConfig message. Does not implicitly {@link google.cloud.automl.v1beta1.DocumentInputConfig.verify|verify} messages. + * @function encode + * @memberof google.cloud.automl.v1beta1.DocumentInputConfig + * @static + * @param {google.cloud.automl.v1beta1.IDocumentInputConfig} message DocumentInputConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DocumentInputConfig.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.gcsSource != null && Object.hasOwnProperty.call(message, "gcsSource")) + $root.google.cloud.automl.v1beta1.GcsSource.encode(message.gcsSource, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified DocumentInputConfig message, length delimited. Does not implicitly {@link google.cloud.automl.v1beta1.DocumentInputConfig.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.automl.v1beta1.DocumentInputConfig + * @static + * @param {google.cloud.automl.v1beta1.IDocumentInputConfig} message DocumentInputConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DocumentInputConfig.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DocumentInputConfig message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.automl.v1beta1.DocumentInputConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.automl.v1beta1.DocumentInputConfig} DocumentInputConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DocumentInputConfig.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.automl.v1beta1.DocumentInputConfig(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.gcsSource = $root.google.cloud.automl.v1beta1.GcsSource.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DocumentInputConfig message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.automl.v1beta1.DocumentInputConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.automl.v1beta1.DocumentInputConfig} DocumentInputConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DocumentInputConfig.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DocumentInputConfig message. + * @function verify + * @memberof google.cloud.automl.v1beta1.DocumentInputConfig + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DocumentInputConfig.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.gcsSource != null && message.hasOwnProperty("gcsSource")) { + var error = $root.google.cloud.automl.v1beta1.GcsSource.verify(message.gcsSource); + if (error) + return "gcsSource." + error; + } + return null; + }; + + /** + * Creates a DocumentInputConfig message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.automl.v1beta1.DocumentInputConfig + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.automl.v1beta1.DocumentInputConfig} DocumentInputConfig + */ + DocumentInputConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.automl.v1beta1.DocumentInputConfig) + return object; + var message = new $root.google.cloud.automl.v1beta1.DocumentInputConfig(); + if (object.gcsSource != null) { + if (typeof object.gcsSource !== "object") + throw TypeError(".google.cloud.automl.v1beta1.DocumentInputConfig.gcsSource: object expected"); + message.gcsSource = $root.google.cloud.automl.v1beta1.GcsSource.fromObject(object.gcsSource); + } + return message; + }; + + /** + * Creates a plain object from a DocumentInputConfig message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.automl.v1beta1.DocumentInputConfig + * @static + * @param {google.cloud.automl.v1beta1.DocumentInputConfig} message DocumentInputConfig + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DocumentInputConfig.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.gcsSource = null; + if (message.gcsSource != null && message.hasOwnProperty("gcsSource")) + object.gcsSource = $root.google.cloud.automl.v1beta1.GcsSource.toObject(message.gcsSource, options); + return object; + }; + + /** + * Converts this DocumentInputConfig to JSON. + * @function toJSON + * @memberof google.cloud.automl.v1beta1.DocumentInputConfig + * @instance + * @returns {Object.} JSON object + */ + DocumentInputConfig.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DocumentInputConfig + * @function getTypeUrl + * @memberof google.cloud.automl.v1beta1.DocumentInputConfig + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DocumentInputConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.automl.v1beta1.DocumentInputConfig"; + }; + + return DocumentInputConfig; + })(); + + v1beta1.OutputConfig = (function() { + + /** + * Properties of an OutputConfig. + * @memberof google.cloud.automl.v1beta1 + * @interface IOutputConfig + * @property {google.cloud.automl.v1beta1.IGcsDestination|null} [gcsDestination] OutputConfig gcsDestination + * @property {google.cloud.automl.v1beta1.IBigQueryDestination|null} [bigqueryDestination] OutputConfig bigqueryDestination + */ + + /** + * Constructs a new OutputConfig. + * @memberof google.cloud.automl.v1beta1 + * @classdesc Represents an OutputConfig. + * @implements IOutputConfig + * @constructor + * @param {google.cloud.automl.v1beta1.IOutputConfig=} [properties] Properties to set + */ + function OutputConfig(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * OutputConfig gcsDestination. + * @member {google.cloud.automl.v1beta1.IGcsDestination|null|undefined} gcsDestination + * @memberof google.cloud.automl.v1beta1.OutputConfig + * @instance + */ + OutputConfig.prototype.gcsDestination = null; + + /** + * OutputConfig bigqueryDestination. + * @member {google.cloud.automl.v1beta1.IBigQueryDestination|null|undefined} bigqueryDestination + * @memberof google.cloud.automl.v1beta1.OutputConfig + * @instance + */ + OutputConfig.prototype.bigqueryDestination = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * OutputConfig destination. + * @member {"gcsDestination"|"bigqueryDestination"|undefined} destination + * @memberof google.cloud.automl.v1beta1.OutputConfig + * @instance + */ + Object.defineProperty(OutputConfig.prototype, "destination", { + get: $util.oneOfGetter($oneOfFields = ["gcsDestination", "bigqueryDestination"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new OutputConfig instance using the specified properties. + * @function create + * @memberof google.cloud.automl.v1beta1.OutputConfig + * @static + * @param {google.cloud.automl.v1beta1.IOutputConfig=} [properties] Properties to set + * @returns {google.cloud.automl.v1beta1.OutputConfig} OutputConfig instance + */ + OutputConfig.create = function create(properties) { + return new OutputConfig(properties); + }; + + /** + * Encodes the specified OutputConfig message. Does not implicitly {@link google.cloud.automl.v1beta1.OutputConfig.verify|verify} messages. + * @function encode + * @memberof google.cloud.automl.v1beta1.OutputConfig + * @static + * @param {google.cloud.automl.v1beta1.IOutputConfig} message OutputConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + OutputConfig.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.gcsDestination != null && Object.hasOwnProperty.call(message, "gcsDestination")) + $root.google.cloud.automl.v1beta1.GcsDestination.encode(message.gcsDestination, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.bigqueryDestination != null && Object.hasOwnProperty.call(message, "bigqueryDestination")) + $root.google.cloud.automl.v1beta1.BigQueryDestination.encode(message.bigqueryDestination, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified OutputConfig message, length delimited. Does not implicitly {@link google.cloud.automl.v1beta1.OutputConfig.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.automl.v1beta1.OutputConfig + * @static + * @param {google.cloud.automl.v1beta1.IOutputConfig} message OutputConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + OutputConfig.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an OutputConfig message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.automl.v1beta1.OutputConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.automl.v1beta1.OutputConfig} OutputConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + OutputConfig.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.automl.v1beta1.OutputConfig(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.gcsDestination = $root.google.cloud.automl.v1beta1.GcsDestination.decode(reader, reader.uint32()); + break; + } + case 2: { + message.bigqueryDestination = $root.google.cloud.automl.v1beta1.BigQueryDestination.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an OutputConfig message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.automl.v1beta1.OutputConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.automl.v1beta1.OutputConfig} OutputConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + OutputConfig.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an OutputConfig message. + * @function verify + * @memberof google.cloud.automl.v1beta1.OutputConfig + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + OutputConfig.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.gcsDestination != null && message.hasOwnProperty("gcsDestination")) { + properties.destination = 1; + { + var error = $root.google.cloud.automl.v1beta1.GcsDestination.verify(message.gcsDestination); + if (error) + return "gcsDestination." + error; + } + } + if (message.bigqueryDestination != null && message.hasOwnProperty("bigqueryDestination")) { + if (properties.destination === 1) + return "destination: multiple values"; + properties.destination = 1; + { + var error = $root.google.cloud.automl.v1beta1.BigQueryDestination.verify(message.bigqueryDestination); + if (error) + return "bigqueryDestination." + error; + } + } + return null; + }; + + /** + * Creates an OutputConfig message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.automl.v1beta1.OutputConfig + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.automl.v1beta1.OutputConfig} OutputConfig + */ + OutputConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.automl.v1beta1.OutputConfig) + return object; + var message = new $root.google.cloud.automl.v1beta1.OutputConfig(); + if (object.gcsDestination != null) { + if (typeof object.gcsDestination !== "object") + throw TypeError(".google.cloud.automl.v1beta1.OutputConfig.gcsDestination: object expected"); + message.gcsDestination = $root.google.cloud.automl.v1beta1.GcsDestination.fromObject(object.gcsDestination); + } + if (object.bigqueryDestination != null) { + if (typeof object.bigqueryDestination !== "object") + throw TypeError(".google.cloud.automl.v1beta1.OutputConfig.bigqueryDestination: object expected"); + message.bigqueryDestination = $root.google.cloud.automl.v1beta1.BigQueryDestination.fromObject(object.bigqueryDestination); + } + return message; + }; + + /** + * Creates a plain object from an OutputConfig message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.automl.v1beta1.OutputConfig + * @static + * @param {google.cloud.automl.v1beta1.OutputConfig} message OutputConfig + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + OutputConfig.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.gcsDestination != null && message.hasOwnProperty("gcsDestination")) { + object.gcsDestination = $root.google.cloud.automl.v1beta1.GcsDestination.toObject(message.gcsDestination, options); + if (options.oneofs) + object.destination = "gcsDestination"; + } + if (message.bigqueryDestination != null && message.hasOwnProperty("bigqueryDestination")) { + object.bigqueryDestination = $root.google.cloud.automl.v1beta1.BigQueryDestination.toObject(message.bigqueryDestination, options); + if (options.oneofs) + object.destination = "bigqueryDestination"; + } + return object; + }; + + /** + * Converts this OutputConfig to JSON. + * @function toJSON + * @memberof google.cloud.automl.v1beta1.OutputConfig + * @instance + * @returns {Object.} JSON object + */ + OutputConfig.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for OutputConfig + * @function getTypeUrl + * @memberof google.cloud.automl.v1beta1.OutputConfig + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + OutputConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.automl.v1beta1.OutputConfig"; + }; + + return OutputConfig; + })(); + + v1beta1.BatchPredictOutputConfig = (function() { + + /** + * Properties of a BatchPredictOutputConfig. + * @memberof google.cloud.automl.v1beta1 + * @interface IBatchPredictOutputConfig + * @property {google.cloud.automl.v1beta1.IGcsDestination|null} [gcsDestination] BatchPredictOutputConfig gcsDestination + * @property {google.cloud.automl.v1beta1.IBigQueryDestination|null} [bigqueryDestination] BatchPredictOutputConfig bigqueryDestination + */ + + /** + * Constructs a new BatchPredictOutputConfig. + * @memberof google.cloud.automl.v1beta1 + * @classdesc Represents a BatchPredictOutputConfig. + * @implements IBatchPredictOutputConfig + * @constructor + * @param {google.cloud.automl.v1beta1.IBatchPredictOutputConfig=} [properties] Properties to set + */ + function BatchPredictOutputConfig(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * BatchPredictOutputConfig gcsDestination. + * @member {google.cloud.automl.v1beta1.IGcsDestination|null|undefined} gcsDestination + * @memberof google.cloud.automl.v1beta1.BatchPredictOutputConfig + * @instance + */ + BatchPredictOutputConfig.prototype.gcsDestination = null; + + /** + * BatchPredictOutputConfig bigqueryDestination. + * @member {google.cloud.automl.v1beta1.IBigQueryDestination|null|undefined} bigqueryDestination + * @memberof google.cloud.automl.v1beta1.BatchPredictOutputConfig + * @instance + */ + BatchPredictOutputConfig.prototype.bigqueryDestination = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * BatchPredictOutputConfig destination. + * @member {"gcsDestination"|"bigqueryDestination"|undefined} destination + * @memberof google.cloud.automl.v1beta1.BatchPredictOutputConfig + * @instance + */ + Object.defineProperty(BatchPredictOutputConfig.prototype, "destination", { + get: $util.oneOfGetter($oneOfFields = ["gcsDestination", "bigqueryDestination"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new BatchPredictOutputConfig instance using the specified properties. + * @function create + * @memberof google.cloud.automl.v1beta1.BatchPredictOutputConfig + * @static + * @param {google.cloud.automl.v1beta1.IBatchPredictOutputConfig=} [properties] Properties to set + * @returns {google.cloud.automl.v1beta1.BatchPredictOutputConfig} BatchPredictOutputConfig instance + */ + BatchPredictOutputConfig.create = function create(properties) { + return new BatchPredictOutputConfig(properties); + }; + + /** + * Encodes the specified BatchPredictOutputConfig message. Does not implicitly {@link google.cloud.automl.v1beta1.BatchPredictOutputConfig.verify|verify} messages. + * @function encode + * @memberof google.cloud.automl.v1beta1.BatchPredictOutputConfig + * @static + * @param {google.cloud.automl.v1beta1.IBatchPredictOutputConfig} message BatchPredictOutputConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BatchPredictOutputConfig.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.gcsDestination != null && Object.hasOwnProperty.call(message, "gcsDestination")) + $root.google.cloud.automl.v1beta1.GcsDestination.encode(message.gcsDestination, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.bigqueryDestination != null && Object.hasOwnProperty.call(message, "bigqueryDestination")) + $root.google.cloud.automl.v1beta1.BigQueryDestination.encode(message.bigqueryDestination, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified BatchPredictOutputConfig message, length delimited. Does not implicitly {@link google.cloud.automl.v1beta1.BatchPredictOutputConfig.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.automl.v1beta1.BatchPredictOutputConfig + * @static + * @param {google.cloud.automl.v1beta1.IBatchPredictOutputConfig} message BatchPredictOutputConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BatchPredictOutputConfig.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a BatchPredictOutputConfig message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.automl.v1beta1.BatchPredictOutputConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.automl.v1beta1.BatchPredictOutputConfig} BatchPredictOutputConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BatchPredictOutputConfig.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.automl.v1beta1.BatchPredictOutputConfig(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.gcsDestination = $root.google.cloud.automl.v1beta1.GcsDestination.decode(reader, reader.uint32()); + break; + } + case 2: { + message.bigqueryDestination = $root.google.cloud.automl.v1beta1.BigQueryDestination.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a BatchPredictOutputConfig message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.automl.v1beta1.BatchPredictOutputConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.automl.v1beta1.BatchPredictOutputConfig} BatchPredictOutputConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BatchPredictOutputConfig.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a BatchPredictOutputConfig message. + * @function verify + * @memberof google.cloud.automl.v1beta1.BatchPredictOutputConfig + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + BatchPredictOutputConfig.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.gcsDestination != null && message.hasOwnProperty("gcsDestination")) { + properties.destination = 1; + { + var error = $root.google.cloud.automl.v1beta1.GcsDestination.verify(message.gcsDestination); + if (error) + return "gcsDestination." + error; + } + } + if (message.bigqueryDestination != null && message.hasOwnProperty("bigqueryDestination")) { + if (properties.destination === 1) + return "destination: multiple values"; + properties.destination = 1; + { + var error = $root.google.cloud.automl.v1beta1.BigQueryDestination.verify(message.bigqueryDestination); + if (error) + return "bigqueryDestination." + error; + } + } + return null; + }; + + /** + * Creates a BatchPredictOutputConfig message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.automl.v1beta1.BatchPredictOutputConfig + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.automl.v1beta1.BatchPredictOutputConfig} BatchPredictOutputConfig + */ + BatchPredictOutputConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.automl.v1beta1.BatchPredictOutputConfig) + return object; + var message = new $root.google.cloud.automl.v1beta1.BatchPredictOutputConfig(); + if (object.gcsDestination != null) { + if (typeof object.gcsDestination !== "object") + throw TypeError(".google.cloud.automl.v1beta1.BatchPredictOutputConfig.gcsDestination: object expected"); + message.gcsDestination = $root.google.cloud.automl.v1beta1.GcsDestination.fromObject(object.gcsDestination); + } + if (object.bigqueryDestination != null) { + if (typeof object.bigqueryDestination !== "object") + throw TypeError(".google.cloud.automl.v1beta1.BatchPredictOutputConfig.bigqueryDestination: object expected"); + message.bigqueryDestination = $root.google.cloud.automl.v1beta1.BigQueryDestination.fromObject(object.bigqueryDestination); + } + return message; + }; + + /** + * Creates a plain object from a BatchPredictOutputConfig message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.automl.v1beta1.BatchPredictOutputConfig + * @static + * @param {google.cloud.automl.v1beta1.BatchPredictOutputConfig} message BatchPredictOutputConfig + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + BatchPredictOutputConfig.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.gcsDestination != null && message.hasOwnProperty("gcsDestination")) { + object.gcsDestination = $root.google.cloud.automl.v1beta1.GcsDestination.toObject(message.gcsDestination, options); + if (options.oneofs) + object.destination = "gcsDestination"; + } + if (message.bigqueryDestination != null && message.hasOwnProperty("bigqueryDestination")) { + object.bigqueryDestination = $root.google.cloud.automl.v1beta1.BigQueryDestination.toObject(message.bigqueryDestination, options); + if (options.oneofs) + object.destination = "bigqueryDestination"; + } + return object; + }; + + /** + * Converts this BatchPredictOutputConfig to JSON. + * @function toJSON + * @memberof google.cloud.automl.v1beta1.BatchPredictOutputConfig + * @instance + * @returns {Object.} JSON object + */ + BatchPredictOutputConfig.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for BatchPredictOutputConfig + * @function getTypeUrl + * @memberof google.cloud.automl.v1beta1.BatchPredictOutputConfig + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + BatchPredictOutputConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.automl.v1beta1.BatchPredictOutputConfig"; + }; + + return BatchPredictOutputConfig; + })(); + + v1beta1.ModelExportOutputConfig = (function() { + + /** + * Properties of a ModelExportOutputConfig. + * @memberof google.cloud.automl.v1beta1 + * @interface IModelExportOutputConfig + * @property {google.cloud.automl.v1beta1.IGcsDestination|null} [gcsDestination] ModelExportOutputConfig gcsDestination + * @property {google.cloud.automl.v1beta1.IGcrDestination|null} [gcrDestination] ModelExportOutputConfig gcrDestination + * @property {string|null} [modelFormat] ModelExportOutputConfig modelFormat + * @property {Object.|null} [params] ModelExportOutputConfig params + */ + + /** + * Constructs a new ModelExportOutputConfig. + * @memberof google.cloud.automl.v1beta1 + * @classdesc Represents a ModelExportOutputConfig. + * @implements IModelExportOutputConfig + * @constructor + * @param {google.cloud.automl.v1beta1.IModelExportOutputConfig=} [properties] Properties to set + */ + function ModelExportOutputConfig(properties) { + this.params = {}; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ModelExportOutputConfig gcsDestination. + * @member {google.cloud.automl.v1beta1.IGcsDestination|null|undefined} gcsDestination + * @memberof google.cloud.automl.v1beta1.ModelExportOutputConfig + * @instance + */ + ModelExportOutputConfig.prototype.gcsDestination = null; + + /** + * ModelExportOutputConfig gcrDestination. + * @member {google.cloud.automl.v1beta1.IGcrDestination|null|undefined} gcrDestination + * @memberof google.cloud.automl.v1beta1.ModelExportOutputConfig + * @instance + */ + ModelExportOutputConfig.prototype.gcrDestination = null; + + /** + * ModelExportOutputConfig modelFormat. + * @member {string} modelFormat + * @memberof google.cloud.automl.v1beta1.ModelExportOutputConfig + * @instance + */ + ModelExportOutputConfig.prototype.modelFormat = ""; + + /** + * ModelExportOutputConfig params. + * @member {Object.} params + * @memberof google.cloud.automl.v1beta1.ModelExportOutputConfig + * @instance + */ + ModelExportOutputConfig.prototype.params = $util.emptyObject; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * ModelExportOutputConfig destination. + * @member {"gcsDestination"|"gcrDestination"|undefined} destination + * @memberof google.cloud.automl.v1beta1.ModelExportOutputConfig + * @instance + */ + Object.defineProperty(ModelExportOutputConfig.prototype, "destination", { + get: $util.oneOfGetter($oneOfFields = ["gcsDestination", "gcrDestination"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new ModelExportOutputConfig instance using the specified properties. + * @function create + * @memberof google.cloud.automl.v1beta1.ModelExportOutputConfig + * @static + * @param {google.cloud.automl.v1beta1.IModelExportOutputConfig=} [properties] Properties to set + * @returns {google.cloud.automl.v1beta1.ModelExportOutputConfig} ModelExportOutputConfig instance + */ + ModelExportOutputConfig.create = function create(properties) { + return new ModelExportOutputConfig(properties); + }; + + /** + * Encodes the specified ModelExportOutputConfig message. Does not implicitly {@link google.cloud.automl.v1beta1.ModelExportOutputConfig.verify|verify} messages. + * @function encode + * @memberof google.cloud.automl.v1beta1.ModelExportOutputConfig + * @static + * @param {google.cloud.automl.v1beta1.IModelExportOutputConfig} message ModelExportOutputConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ModelExportOutputConfig.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.gcsDestination != null && Object.hasOwnProperty.call(message, "gcsDestination")) + $root.google.cloud.automl.v1beta1.GcsDestination.encode(message.gcsDestination, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.params != null && Object.hasOwnProperty.call(message, "params")) + for (var keys = Object.keys(message.params), 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.params[keys[i]]).ldelim(); + if (message.gcrDestination != null && Object.hasOwnProperty.call(message, "gcrDestination")) + $root.google.cloud.automl.v1beta1.GcrDestination.encode(message.gcrDestination, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.modelFormat != null && Object.hasOwnProperty.call(message, "modelFormat")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.modelFormat); + return writer; + }; + + /** + * Encodes the specified ModelExportOutputConfig message, length delimited. Does not implicitly {@link google.cloud.automl.v1beta1.ModelExportOutputConfig.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.automl.v1beta1.ModelExportOutputConfig + * @static + * @param {google.cloud.automl.v1beta1.IModelExportOutputConfig} message ModelExportOutputConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ModelExportOutputConfig.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ModelExportOutputConfig message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.automl.v1beta1.ModelExportOutputConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.automl.v1beta1.ModelExportOutputConfig} ModelExportOutputConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ModelExportOutputConfig.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.automl.v1beta1.ModelExportOutputConfig(), key, value; + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.gcsDestination = $root.google.cloud.automl.v1beta1.GcsDestination.decode(reader, reader.uint32()); + break; + } + case 3: { + message.gcrDestination = $root.google.cloud.automl.v1beta1.GcrDestination.decode(reader, reader.uint32()); + break; + } + case 4: { + message.modelFormat = reader.string(); + break; + } + case 2: { + if (message.params === $util.emptyObject) + message.params = {}; + 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.params[key] = value; + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ModelExportOutputConfig message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.automl.v1beta1.ModelExportOutputConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.automl.v1beta1.ModelExportOutputConfig} ModelExportOutputConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ModelExportOutputConfig.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ModelExportOutputConfig message. + * @function verify + * @memberof google.cloud.automl.v1beta1.ModelExportOutputConfig + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ModelExportOutputConfig.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.gcsDestination != null && message.hasOwnProperty("gcsDestination")) { + properties.destination = 1; + { + var error = $root.google.cloud.automl.v1beta1.GcsDestination.verify(message.gcsDestination); + if (error) + return "gcsDestination." + error; + } + } + if (message.gcrDestination != null && message.hasOwnProperty("gcrDestination")) { + if (properties.destination === 1) + return "destination: multiple values"; + properties.destination = 1; + { + var error = $root.google.cloud.automl.v1beta1.GcrDestination.verify(message.gcrDestination); + if (error) + return "gcrDestination." + error; + } + } + if (message.modelFormat != null && message.hasOwnProperty("modelFormat")) + if (!$util.isString(message.modelFormat)) + return "modelFormat: string expected"; + if (message.params != null && message.hasOwnProperty("params")) { + if (!$util.isObject(message.params)) + return "params: object expected"; + var key = Object.keys(message.params); + for (var i = 0; i < key.length; ++i) + if (!$util.isString(message.params[key[i]])) + return "params: string{k:string} expected"; + } + return null; + }; + + /** + * Creates a ModelExportOutputConfig message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.automl.v1beta1.ModelExportOutputConfig + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.automl.v1beta1.ModelExportOutputConfig} ModelExportOutputConfig + */ + ModelExportOutputConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.automl.v1beta1.ModelExportOutputConfig) + return object; + var message = new $root.google.cloud.automl.v1beta1.ModelExportOutputConfig(); + if (object.gcsDestination != null) { + if (typeof object.gcsDestination !== "object") + throw TypeError(".google.cloud.automl.v1beta1.ModelExportOutputConfig.gcsDestination: object expected"); + message.gcsDestination = $root.google.cloud.automl.v1beta1.GcsDestination.fromObject(object.gcsDestination); + } + if (object.gcrDestination != null) { + if (typeof object.gcrDestination !== "object") + throw TypeError(".google.cloud.automl.v1beta1.ModelExportOutputConfig.gcrDestination: object expected"); + message.gcrDestination = $root.google.cloud.automl.v1beta1.GcrDestination.fromObject(object.gcrDestination); + } + if (object.modelFormat != null) + message.modelFormat = String(object.modelFormat); + if (object.params) { + if (typeof object.params !== "object") + throw TypeError(".google.cloud.automl.v1beta1.ModelExportOutputConfig.params: object expected"); + message.params = {}; + for (var keys = Object.keys(object.params), i = 0; i < keys.length; ++i) + message.params[keys[i]] = String(object.params[keys[i]]); + } + return message; + }; + + /** + * Creates a plain object from a ModelExportOutputConfig message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.automl.v1beta1.ModelExportOutputConfig + * @static + * @param {google.cloud.automl.v1beta1.ModelExportOutputConfig} message ModelExportOutputConfig + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ModelExportOutputConfig.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.objects || options.defaults) + object.params = {}; + if (options.defaults) + object.modelFormat = ""; + if (message.gcsDestination != null && message.hasOwnProperty("gcsDestination")) { + object.gcsDestination = $root.google.cloud.automl.v1beta1.GcsDestination.toObject(message.gcsDestination, options); + if (options.oneofs) + object.destination = "gcsDestination"; + } + var keys2; + if (message.params && (keys2 = Object.keys(message.params)).length) { + object.params = {}; + for (var j = 0; j < keys2.length; ++j) + object.params[keys2[j]] = message.params[keys2[j]]; + } + if (message.gcrDestination != null && message.hasOwnProperty("gcrDestination")) { + object.gcrDestination = $root.google.cloud.automl.v1beta1.GcrDestination.toObject(message.gcrDestination, options); + if (options.oneofs) + object.destination = "gcrDestination"; + } + if (message.modelFormat != null && message.hasOwnProperty("modelFormat")) + object.modelFormat = message.modelFormat; + return object; + }; + + /** + * Converts this ModelExportOutputConfig to JSON. + * @function toJSON + * @memberof google.cloud.automl.v1beta1.ModelExportOutputConfig + * @instance + * @returns {Object.} JSON object + */ + ModelExportOutputConfig.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ModelExportOutputConfig + * @function getTypeUrl + * @memberof google.cloud.automl.v1beta1.ModelExportOutputConfig + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ModelExportOutputConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.automl.v1beta1.ModelExportOutputConfig"; + }; + + return ModelExportOutputConfig; + })(); + + v1beta1.ExportEvaluatedExamplesOutputConfig = (function() { + + /** + * Properties of an ExportEvaluatedExamplesOutputConfig. + * @memberof google.cloud.automl.v1beta1 + * @interface IExportEvaluatedExamplesOutputConfig + * @property {google.cloud.automl.v1beta1.IBigQueryDestination|null} [bigqueryDestination] ExportEvaluatedExamplesOutputConfig bigqueryDestination + */ + + /** + * Constructs a new ExportEvaluatedExamplesOutputConfig. + * @memberof google.cloud.automl.v1beta1 + * @classdesc Represents an ExportEvaluatedExamplesOutputConfig. + * @implements IExportEvaluatedExamplesOutputConfig + * @constructor + * @param {google.cloud.automl.v1beta1.IExportEvaluatedExamplesOutputConfig=} [properties] Properties to set + */ + function ExportEvaluatedExamplesOutputConfig(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ExportEvaluatedExamplesOutputConfig bigqueryDestination. + * @member {google.cloud.automl.v1beta1.IBigQueryDestination|null|undefined} bigqueryDestination + * @memberof google.cloud.automl.v1beta1.ExportEvaluatedExamplesOutputConfig + * @instance + */ + ExportEvaluatedExamplesOutputConfig.prototype.bigqueryDestination = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * ExportEvaluatedExamplesOutputConfig destination. + * @member {"bigqueryDestination"|undefined} destination + * @memberof google.cloud.automl.v1beta1.ExportEvaluatedExamplesOutputConfig + * @instance + */ + Object.defineProperty(ExportEvaluatedExamplesOutputConfig.prototype, "destination", { + get: $util.oneOfGetter($oneOfFields = ["bigqueryDestination"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new ExportEvaluatedExamplesOutputConfig instance using the specified properties. + * @function create + * @memberof google.cloud.automl.v1beta1.ExportEvaluatedExamplesOutputConfig + * @static + * @param {google.cloud.automl.v1beta1.IExportEvaluatedExamplesOutputConfig=} [properties] Properties to set + * @returns {google.cloud.automl.v1beta1.ExportEvaluatedExamplesOutputConfig} ExportEvaluatedExamplesOutputConfig instance + */ + ExportEvaluatedExamplesOutputConfig.create = function create(properties) { + return new ExportEvaluatedExamplesOutputConfig(properties); + }; + + /** + * Encodes the specified ExportEvaluatedExamplesOutputConfig message. Does not implicitly {@link google.cloud.automl.v1beta1.ExportEvaluatedExamplesOutputConfig.verify|verify} messages. + * @function encode + * @memberof google.cloud.automl.v1beta1.ExportEvaluatedExamplesOutputConfig + * @static + * @param {google.cloud.automl.v1beta1.IExportEvaluatedExamplesOutputConfig} message ExportEvaluatedExamplesOutputConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ExportEvaluatedExamplesOutputConfig.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.bigqueryDestination != null && Object.hasOwnProperty.call(message, "bigqueryDestination")) + $root.google.cloud.automl.v1beta1.BigQueryDestination.encode(message.bigqueryDestination, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified ExportEvaluatedExamplesOutputConfig message, length delimited. Does not implicitly {@link google.cloud.automl.v1beta1.ExportEvaluatedExamplesOutputConfig.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.automl.v1beta1.ExportEvaluatedExamplesOutputConfig + * @static + * @param {google.cloud.automl.v1beta1.IExportEvaluatedExamplesOutputConfig} message ExportEvaluatedExamplesOutputConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ExportEvaluatedExamplesOutputConfig.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an ExportEvaluatedExamplesOutputConfig message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.automl.v1beta1.ExportEvaluatedExamplesOutputConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.automl.v1beta1.ExportEvaluatedExamplesOutputConfig} ExportEvaluatedExamplesOutputConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ExportEvaluatedExamplesOutputConfig.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.automl.v1beta1.ExportEvaluatedExamplesOutputConfig(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 2: { + message.bigqueryDestination = $root.google.cloud.automl.v1beta1.BigQueryDestination.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an ExportEvaluatedExamplesOutputConfig message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.automl.v1beta1.ExportEvaluatedExamplesOutputConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.automl.v1beta1.ExportEvaluatedExamplesOutputConfig} ExportEvaluatedExamplesOutputConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ExportEvaluatedExamplesOutputConfig.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an ExportEvaluatedExamplesOutputConfig message. + * @function verify + * @memberof google.cloud.automl.v1beta1.ExportEvaluatedExamplesOutputConfig + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ExportEvaluatedExamplesOutputConfig.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.bigqueryDestination != null && message.hasOwnProperty("bigqueryDestination")) { + properties.destination = 1; + { + var error = $root.google.cloud.automl.v1beta1.BigQueryDestination.verify(message.bigqueryDestination); + if (error) + return "bigqueryDestination." + error; + } + } + return null; + }; + + /** + * Creates an ExportEvaluatedExamplesOutputConfig message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.automl.v1beta1.ExportEvaluatedExamplesOutputConfig + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.automl.v1beta1.ExportEvaluatedExamplesOutputConfig} ExportEvaluatedExamplesOutputConfig + */ + ExportEvaluatedExamplesOutputConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.automl.v1beta1.ExportEvaluatedExamplesOutputConfig) + return object; + var message = new $root.google.cloud.automl.v1beta1.ExportEvaluatedExamplesOutputConfig(); + if (object.bigqueryDestination != null) { + if (typeof object.bigqueryDestination !== "object") + throw TypeError(".google.cloud.automl.v1beta1.ExportEvaluatedExamplesOutputConfig.bigqueryDestination: object expected"); + message.bigqueryDestination = $root.google.cloud.automl.v1beta1.BigQueryDestination.fromObject(object.bigqueryDestination); + } + return message; + }; + + /** + * Creates a plain object from an ExportEvaluatedExamplesOutputConfig message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.automl.v1beta1.ExportEvaluatedExamplesOutputConfig + * @static + * @param {google.cloud.automl.v1beta1.ExportEvaluatedExamplesOutputConfig} message ExportEvaluatedExamplesOutputConfig + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ExportEvaluatedExamplesOutputConfig.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.bigqueryDestination != null && message.hasOwnProperty("bigqueryDestination")) { + object.bigqueryDestination = $root.google.cloud.automl.v1beta1.BigQueryDestination.toObject(message.bigqueryDestination, options); + if (options.oneofs) + object.destination = "bigqueryDestination"; + } + return object; + }; + + /** + * Converts this ExportEvaluatedExamplesOutputConfig to JSON. + * @function toJSON + * @memberof google.cloud.automl.v1beta1.ExportEvaluatedExamplesOutputConfig + * @instance + * @returns {Object.} JSON object + */ + ExportEvaluatedExamplesOutputConfig.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ExportEvaluatedExamplesOutputConfig + * @function getTypeUrl + * @memberof google.cloud.automl.v1beta1.ExportEvaluatedExamplesOutputConfig + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ExportEvaluatedExamplesOutputConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.automl.v1beta1.ExportEvaluatedExamplesOutputConfig"; + }; + + return ExportEvaluatedExamplesOutputConfig; + })(); + + v1beta1.GcsSource = (function() { + + /** + * Properties of a GcsSource. + * @memberof google.cloud.automl.v1beta1 + * @interface IGcsSource + * @property {Array.|null} [inputUris] GcsSource inputUris + */ + + /** + * Constructs a new GcsSource. + * @memberof google.cloud.automl.v1beta1 + * @classdesc Represents a GcsSource. + * @implements IGcsSource + * @constructor + * @param {google.cloud.automl.v1beta1.IGcsSource=} [properties] Properties to set + */ + function GcsSource(properties) { + this.inputUris = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GcsSource inputUris. + * @member {Array.} inputUris + * @memberof google.cloud.automl.v1beta1.GcsSource + * @instance + */ + GcsSource.prototype.inputUris = $util.emptyArray; + + /** + * Creates a new GcsSource instance using the specified properties. + * @function create + * @memberof google.cloud.automl.v1beta1.GcsSource + * @static + * @param {google.cloud.automl.v1beta1.IGcsSource=} [properties] Properties to set + * @returns {google.cloud.automl.v1beta1.GcsSource} GcsSource instance + */ + GcsSource.create = function create(properties) { + return new GcsSource(properties); + }; + + /** + * Encodes the specified GcsSource message. Does not implicitly {@link google.cloud.automl.v1beta1.GcsSource.verify|verify} messages. + * @function encode + * @memberof google.cloud.automl.v1beta1.GcsSource + * @static + * @param {google.cloud.automl.v1beta1.IGcsSource} message GcsSource message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GcsSource.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.inputUris != null && message.inputUris.length) + for (var i = 0; i < message.inputUris.length; ++i) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.inputUris[i]); + return writer; + }; + + /** + * Encodes the specified GcsSource message, length delimited. Does not implicitly {@link google.cloud.automl.v1beta1.GcsSource.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.automl.v1beta1.GcsSource + * @static + * @param {google.cloud.automl.v1beta1.IGcsSource} message GcsSource message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GcsSource.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GcsSource message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.automl.v1beta1.GcsSource + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.automl.v1beta1.GcsSource} GcsSource + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GcsSource.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.automl.v1beta1.GcsSource(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.inputUris && message.inputUris.length)) + message.inputUris = []; + message.inputUris.push(reader.string()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GcsSource message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.automl.v1beta1.GcsSource + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.automl.v1beta1.GcsSource} GcsSource + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GcsSource.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GcsSource message. + * @function verify + * @memberof google.cloud.automl.v1beta1.GcsSource + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GcsSource.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.inputUris != null && message.hasOwnProperty("inputUris")) { + if (!Array.isArray(message.inputUris)) + return "inputUris: array expected"; + for (var i = 0; i < message.inputUris.length; ++i) + if (!$util.isString(message.inputUris[i])) + return "inputUris: string[] expected"; + } + return null; + }; + + /** + * Creates a GcsSource message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.automl.v1beta1.GcsSource + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.automl.v1beta1.GcsSource} GcsSource + */ + GcsSource.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.automl.v1beta1.GcsSource) + return object; + var message = new $root.google.cloud.automl.v1beta1.GcsSource(); + if (object.inputUris) { + if (!Array.isArray(object.inputUris)) + throw TypeError(".google.cloud.automl.v1beta1.GcsSource.inputUris: array expected"); + message.inputUris = []; + for (var i = 0; i < object.inputUris.length; ++i) + message.inputUris[i] = String(object.inputUris[i]); + } + return message; + }; + + /** + * Creates a plain object from a GcsSource message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.automl.v1beta1.GcsSource + * @static + * @param {google.cloud.automl.v1beta1.GcsSource} message GcsSource + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GcsSource.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.inputUris = []; + if (message.inputUris && message.inputUris.length) { + object.inputUris = []; + for (var j = 0; j < message.inputUris.length; ++j) + object.inputUris[j] = message.inputUris[j]; + } + return object; + }; + + /** + * Converts this GcsSource to JSON. + * @function toJSON + * @memberof google.cloud.automl.v1beta1.GcsSource + * @instance + * @returns {Object.} JSON object + */ + GcsSource.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GcsSource + * @function getTypeUrl + * @memberof google.cloud.automl.v1beta1.GcsSource + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GcsSource.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.automl.v1beta1.GcsSource"; + }; + + return GcsSource; + })(); + + v1beta1.BigQuerySource = (function() { + + /** + * Properties of a BigQuerySource. + * @memberof google.cloud.automl.v1beta1 + * @interface IBigQuerySource + * @property {string|null} [inputUri] BigQuerySource inputUri + */ + + /** + * Constructs a new BigQuerySource. + * @memberof google.cloud.automl.v1beta1 + * @classdesc Represents a BigQuerySource. + * @implements IBigQuerySource + * @constructor + * @param {google.cloud.automl.v1beta1.IBigQuerySource=} [properties] Properties to set + */ + function BigQuerySource(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * BigQuerySource inputUri. + * @member {string} inputUri + * @memberof google.cloud.automl.v1beta1.BigQuerySource + * @instance + */ + BigQuerySource.prototype.inputUri = ""; + + /** + * Creates a new BigQuerySource instance using the specified properties. + * @function create + * @memberof google.cloud.automl.v1beta1.BigQuerySource + * @static + * @param {google.cloud.automl.v1beta1.IBigQuerySource=} [properties] Properties to set + * @returns {google.cloud.automl.v1beta1.BigQuerySource} BigQuerySource instance + */ + BigQuerySource.create = function create(properties) { + return new BigQuerySource(properties); + }; + + /** + * Encodes the specified BigQuerySource message. Does not implicitly {@link google.cloud.automl.v1beta1.BigQuerySource.verify|verify} messages. + * @function encode + * @memberof google.cloud.automl.v1beta1.BigQuerySource + * @static + * @param {google.cloud.automl.v1beta1.IBigQuerySource} message BigQuerySource message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BigQuerySource.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.inputUri != null && Object.hasOwnProperty.call(message, "inputUri")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.inputUri); + return writer; + }; + + /** + * Encodes the specified BigQuerySource message, length delimited. Does not implicitly {@link google.cloud.automl.v1beta1.BigQuerySource.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.automl.v1beta1.BigQuerySource + * @static + * @param {google.cloud.automl.v1beta1.IBigQuerySource} message BigQuerySource message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BigQuerySource.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a BigQuerySource message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.automl.v1beta1.BigQuerySource + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.automl.v1beta1.BigQuerySource} BigQuerySource + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BigQuerySource.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.automl.v1beta1.BigQuerySource(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.inputUri = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a BigQuerySource message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.automl.v1beta1.BigQuerySource + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.automl.v1beta1.BigQuerySource} BigQuerySource + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BigQuerySource.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a BigQuerySource message. + * @function verify + * @memberof google.cloud.automl.v1beta1.BigQuerySource + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + BigQuerySource.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.inputUri != null && message.hasOwnProperty("inputUri")) + if (!$util.isString(message.inputUri)) + return "inputUri: string expected"; + return null; + }; + + /** + * Creates a BigQuerySource message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.automl.v1beta1.BigQuerySource + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.automl.v1beta1.BigQuerySource} BigQuerySource + */ + BigQuerySource.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.automl.v1beta1.BigQuerySource) + return object; + var message = new $root.google.cloud.automl.v1beta1.BigQuerySource(); + if (object.inputUri != null) + message.inputUri = String(object.inputUri); + return message; + }; + + /** + * Creates a plain object from a BigQuerySource message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.automl.v1beta1.BigQuerySource + * @static + * @param {google.cloud.automl.v1beta1.BigQuerySource} message BigQuerySource + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + BigQuerySource.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.inputUri = ""; + if (message.inputUri != null && message.hasOwnProperty("inputUri")) + object.inputUri = message.inputUri; + return object; + }; + + /** + * Converts this BigQuerySource to JSON. + * @function toJSON + * @memberof google.cloud.automl.v1beta1.BigQuerySource + * @instance + * @returns {Object.} JSON object + */ + BigQuerySource.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for BigQuerySource + * @function getTypeUrl + * @memberof google.cloud.automl.v1beta1.BigQuerySource + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + BigQuerySource.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.automl.v1beta1.BigQuerySource"; + }; + + return BigQuerySource; + })(); + + v1beta1.GcsDestination = (function() { + + /** + * Properties of a GcsDestination. + * @memberof google.cloud.automl.v1beta1 + * @interface IGcsDestination + * @property {string|null} [outputUriPrefix] GcsDestination outputUriPrefix + */ + + /** + * Constructs a new GcsDestination. + * @memberof google.cloud.automl.v1beta1 + * @classdesc Represents a GcsDestination. + * @implements IGcsDestination + * @constructor + * @param {google.cloud.automl.v1beta1.IGcsDestination=} [properties] Properties to set + */ + function GcsDestination(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GcsDestination outputUriPrefix. + * @member {string} outputUriPrefix + * @memberof google.cloud.automl.v1beta1.GcsDestination + * @instance + */ + GcsDestination.prototype.outputUriPrefix = ""; + + /** + * Creates a new GcsDestination instance using the specified properties. + * @function create + * @memberof google.cloud.automl.v1beta1.GcsDestination + * @static + * @param {google.cloud.automl.v1beta1.IGcsDestination=} [properties] Properties to set + * @returns {google.cloud.automl.v1beta1.GcsDestination} GcsDestination instance + */ + GcsDestination.create = function create(properties) { + return new GcsDestination(properties); + }; + + /** + * Encodes the specified GcsDestination message. Does not implicitly {@link google.cloud.automl.v1beta1.GcsDestination.verify|verify} messages. + * @function encode + * @memberof google.cloud.automl.v1beta1.GcsDestination + * @static + * @param {google.cloud.automl.v1beta1.IGcsDestination} message GcsDestination message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GcsDestination.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.outputUriPrefix != null && Object.hasOwnProperty.call(message, "outputUriPrefix")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.outputUriPrefix); + return writer; + }; + + /** + * Encodes the specified GcsDestination message, length delimited. Does not implicitly {@link google.cloud.automl.v1beta1.GcsDestination.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.automl.v1beta1.GcsDestination + * @static + * @param {google.cloud.automl.v1beta1.IGcsDestination} message GcsDestination message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GcsDestination.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GcsDestination message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.automl.v1beta1.GcsDestination + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.automl.v1beta1.GcsDestination} GcsDestination + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GcsDestination.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.automl.v1beta1.GcsDestination(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.outputUriPrefix = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GcsDestination message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.automl.v1beta1.GcsDestination + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.automl.v1beta1.GcsDestination} GcsDestination + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GcsDestination.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GcsDestination message. + * @function verify + * @memberof google.cloud.automl.v1beta1.GcsDestination + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GcsDestination.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.outputUriPrefix != null && message.hasOwnProperty("outputUriPrefix")) + if (!$util.isString(message.outputUriPrefix)) + return "outputUriPrefix: string expected"; + return null; + }; + + /** + * Creates a GcsDestination message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.automl.v1beta1.GcsDestination + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.automl.v1beta1.GcsDestination} GcsDestination + */ + GcsDestination.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.automl.v1beta1.GcsDestination) + return object; + var message = new $root.google.cloud.automl.v1beta1.GcsDestination(); + if (object.outputUriPrefix != null) + message.outputUriPrefix = String(object.outputUriPrefix); + return message; + }; + + /** + * Creates a plain object from a GcsDestination message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.automl.v1beta1.GcsDestination + * @static + * @param {google.cloud.automl.v1beta1.GcsDestination} message GcsDestination + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GcsDestination.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.outputUriPrefix = ""; + if (message.outputUriPrefix != null && message.hasOwnProperty("outputUriPrefix")) + object.outputUriPrefix = message.outputUriPrefix; + return object; + }; + + /** + * Converts this GcsDestination to JSON. + * @function toJSON + * @memberof google.cloud.automl.v1beta1.GcsDestination + * @instance + * @returns {Object.} JSON object + */ + GcsDestination.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GcsDestination + * @function getTypeUrl + * @memberof google.cloud.automl.v1beta1.GcsDestination + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GcsDestination.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.automl.v1beta1.GcsDestination"; + }; + + return GcsDestination; + })(); + + v1beta1.BigQueryDestination = (function() { + + /** + * Properties of a BigQueryDestination. + * @memberof google.cloud.automl.v1beta1 + * @interface IBigQueryDestination + * @property {string|null} [outputUri] BigQueryDestination outputUri + */ + + /** + * Constructs a new BigQueryDestination. + * @memberof google.cloud.automl.v1beta1 + * @classdesc Represents a BigQueryDestination. + * @implements IBigQueryDestination + * @constructor + * @param {google.cloud.automl.v1beta1.IBigQueryDestination=} [properties] Properties to set + */ + function BigQueryDestination(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * BigQueryDestination outputUri. + * @member {string} outputUri + * @memberof google.cloud.automl.v1beta1.BigQueryDestination + * @instance + */ + BigQueryDestination.prototype.outputUri = ""; + + /** + * Creates a new BigQueryDestination instance using the specified properties. + * @function create + * @memberof google.cloud.automl.v1beta1.BigQueryDestination + * @static + * @param {google.cloud.automl.v1beta1.IBigQueryDestination=} [properties] Properties to set + * @returns {google.cloud.automl.v1beta1.BigQueryDestination} BigQueryDestination instance + */ + BigQueryDestination.create = function create(properties) { + return new BigQueryDestination(properties); + }; + + /** + * Encodes the specified BigQueryDestination message. Does not implicitly {@link google.cloud.automl.v1beta1.BigQueryDestination.verify|verify} messages. + * @function encode + * @memberof google.cloud.automl.v1beta1.BigQueryDestination + * @static + * @param {google.cloud.automl.v1beta1.IBigQueryDestination} message BigQueryDestination message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BigQueryDestination.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.outputUri != null && Object.hasOwnProperty.call(message, "outputUri")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.outputUri); + return writer; + }; + + /** + * Encodes the specified BigQueryDestination message, length delimited. Does not implicitly {@link google.cloud.automl.v1beta1.BigQueryDestination.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.automl.v1beta1.BigQueryDestination + * @static + * @param {google.cloud.automl.v1beta1.IBigQueryDestination} message BigQueryDestination message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BigQueryDestination.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a BigQueryDestination message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.automl.v1beta1.BigQueryDestination + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.automl.v1beta1.BigQueryDestination} BigQueryDestination + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BigQueryDestination.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.automl.v1beta1.BigQueryDestination(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.outputUri = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a BigQueryDestination message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.automl.v1beta1.BigQueryDestination + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.automl.v1beta1.BigQueryDestination} BigQueryDestination + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BigQueryDestination.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a BigQueryDestination message. + * @function verify + * @memberof google.cloud.automl.v1beta1.BigQueryDestination + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + BigQueryDestination.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.outputUri != null && message.hasOwnProperty("outputUri")) + if (!$util.isString(message.outputUri)) + return "outputUri: string expected"; + return null; + }; + + /** + * Creates a BigQueryDestination message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.automl.v1beta1.BigQueryDestination + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.automl.v1beta1.BigQueryDestination} BigQueryDestination + */ + BigQueryDestination.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.automl.v1beta1.BigQueryDestination) + return object; + var message = new $root.google.cloud.automl.v1beta1.BigQueryDestination(); + if (object.outputUri != null) + message.outputUri = String(object.outputUri); + return message; + }; + + /** + * Creates a plain object from a BigQueryDestination message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.automl.v1beta1.BigQueryDestination + * @static + * @param {google.cloud.automl.v1beta1.BigQueryDestination} message BigQueryDestination + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + BigQueryDestination.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.outputUri = ""; + if (message.outputUri != null && message.hasOwnProperty("outputUri")) + object.outputUri = message.outputUri; + return object; + }; + + /** + * Converts this BigQueryDestination to JSON. + * @function toJSON + * @memberof google.cloud.automl.v1beta1.BigQueryDestination + * @instance + * @returns {Object.} JSON object + */ + BigQueryDestination.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for BigQueryDestination + * @function getTypeUrl + * @memberof google.cloud.automl.v1beta1.BigQueryDestination + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + BigQueryDestination.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.automl.v1beta1.BigQueryDestination"; + }; + + return BigQueryDestination; + })(); + + v1beta1.GcrDestination = (function() { + + /** + * Properties of a GcrDestination. + * @memberof google.cloud.automl.v1beta1 + * @interface IGcrDestination + * @property {string|null} [outputUri] GcrDestination outputUri + */ + + /** + * Constructs a new GcrDestination. + * @memberof google.cloud.automl.v1beta1 + * @classdesc Represents a GcrDestination. + * @implements IGcrDestination + * @constructor + * @param {google.cloud.automl.v1beta1.IGcrDestination=} [properties] Properties to set + */ + function GcrDestination(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GcrDestination outputUri. + * @member {string} outputUri + * @memberof google.cloud.automl.v1beta1.GcrDestination + * @instance + */ + GcrDestination.prototype.outputUri = ""; + + /** + * Creates a new GcrDestination instance using the specified properties. + * @function create + * @memberof google.cloud.automl.v1beta1.GcrDestination + * @static + * @param {google.cloud.automl.v1beta1.IGcrDestination=} [properties] Properties to set + * @returns {google.cloud.automl.v1beta1.GcrDestination} GcrDestination instance + */ + GcrDestination.create = function create(properties) { + return new GcrDestination(properties); + }; + + /** + * Encodes the specified GcrDestination message. Does not implicitly {@link google.cloud.automl.v1beta1.GcrDestination.verify|verify} messages. + * @function encode + * @memberof google.cloud.automl.v1beta1.GcrDestination + * @static + * @param {google.cloud.automl.v1beta1.IGcrDestination} message GcrDestination message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GcrDestination.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.outputUri != null && Object.hasOwnProperty.call(message, "outputUri")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.outputUri); + return writer; + }; + + /** + * Encodes the specified GcrDestination message, length delimited. Does not implicitly {@link google.cloud.automl.v1beta1.GcrDestination.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.automl.v1beta1.GcrDestination + * @static + * @param {google.cloud.automl.v1beta1.IGcrDestination} message GcrDestination message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GcrDestination.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GcrDestination message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.automl.v1beta1.GcrDestination + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.automl.v1beta1.GcrDestination} GcrDestination + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GcrDestination.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.automl.v1beta1.GcrDestination(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.outputUri = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GcrDestination message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.automl.v1beta1.GcrDestination + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.automl.v1beta1.GcrDestination} GcrDestination + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GcrDestination.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GcrDestination message. + * @function verify + * @memberof google.cloud.automl.v1beta1.GcrDestination + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GcrDestination.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.outputUri != null && message.hasOwnProperty("outputUri")) + if (!$util.isString(message.outputUri)) + return "outputUri: string expected"; + return null; + }; + + /** + * Creates a GcrDestination message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.automl.v1beta1.GcrDestination + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.automl.v1beta1.GcrDestination} GcrDestination + */ + GcrDestination.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.automl.v1beta1.GcrDestination) + return object; + var message = new $root.google.cloud.automl.v1beta1.GcrDestination(); + if (object.outputUri != null) + message.outputUri = String(object.outputUri); + return message; + }; + + /** + * Creates a plain object from a GcrDestination message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.automl.v1beta1.GcrDestination + * @static + * @param {google.cloud.automl.v1beta1.GcrDestination} message GcrDestination + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GcrDestination.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.outputUri = ""; + if (message.outputUri != null && message.hasOwnProperty("outputUri")) + object.outputUri = message.outputUri; + return object; + }; + + /** + * Converts this GcrDestination to JSON. + * @function toJSON + * @memberof google.cloud.automl.v1beta1.GcrDestination + * @instance + * @returns {Object.} JSON object + */ + GcrDestination.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GcrDestination + * @function getTypeUrl + * @memberof google.cloud.automl.v1beta1.GcrDestination + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GcrDestination.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.automl.v1beta1.GcrDestination"; + }; + + return GcrDestination; + })(); + + v1beta1.TextSegment = (function() { + + /** + * Properties of a TextSegment. + * @memberof google.cloud.automl.v1beta1 + * @interface ITextSegment + * @property {string|null} [content] TextSegment content + * @property {number|Long|null} [startOffset] TextSegment startOffset + * @property {number|Long|null} [endOffset] TextSegment endOffset + */ + + /** + * Constructs a new TextSegment. + * @memberof google.cloud.automl.v1beta1 + * @classdesc Represents a TextSegment. + * @implements ITextSegment + * @constructor + * @param {google.cloud.automl.v1beta1.ITextSegment=} [properties] Properties to set + */ + function TextSegment(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * TextSegment content. + * @member {string} content + * @memberof google.cloud.automl.v1beta1.TextSegment + * @instance + */ + TextSegment.prototype.content = ""; + + /** + * TextSegment startOffset. + * @member {number|Long} startOffset + * @memberof google.cloud.automl.v1beta1.TextSegment + * @instance + */ + TextSegment.prototype.startOffset = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * TextSegment endOffset. + * @member {number|Long} endOffset + * @memberof google.cloud.automl.v1beta1.TextSegment + * @instance + */ + TextSegment.prototype.endOffset = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new TextSegment instance using the specified properties. + * @function create + * @memberof google.cloud.automl.v1beta1.TextSegment + * @static + * @param {google.cloud.automl.v1beta1.ITextSegment=} [properties] Properties to set + * @returns {google.cloud.automl.v1beta1.TextSegment} TextSegment instance + */ + TextSegment.create = function create(properties) { + return new TextSegment(properties); + }; + + /** + * Encodes the specified TextSegment message. Does not implicitly {@link google.cloud.automl.v1beta1.TextSegment.verify|verify} messages. + * @function encode + * @memberof google.cloud.automl.v1beta1.TextSegment + * @static + * @param {google.cloud.automl.v1beta1.ITextSegment} message TextSegment message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TextSegment.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.startOffset != null && Object.hasOwnProperty.call(message, "startOffset")) + writer.uint32(/* id 1, wireType 0 =*/8).int64(message.startOffset); + if (message.endOffset != null && Object.hasOwnProperty.call(message, "endOffset")) + writer.uint32(/* id 2, wireType 0 =*/16).int64(message.endOffset); + if (message.content != null && Object.hasOwnProperty.call(message, "content")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.content); + return writer; + }; + + /** + * Encodes the specified TextSegment message, length delimited. Does not implicitly {@link google.cloud.automl.v1beta1.TextSegment.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.automl.v1beta1.TextSegment + * @static + * @param {google.cloud.automl.v1beta1.ITextSegment} message TextSegment message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TextSegment.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a TextSegment message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.automl.v1beta1.TextSegment + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.automl.v1beta1.TextSegment} TextSegment + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TextSegment.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.automl.v1beta1.TextSegment(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 3: { + message.content = reader.string(); + break; + } + case 1: { + message.startOffset = reader.int64(); + break; + } + case 2: { + message.endOffset = reader.int64(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a TextSegment message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.automl.v1beta1.TextSegment + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.automl.v1beta1.TextSegment} TextSegment + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TextSegment.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a TextSegment message. + * @function verify + * @memberof google.cloud.automl.v1beta1.TextSegment + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + TextSegment.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.content != null && message.hasOwnProperty("content")) + if (!$util.isString(message.content)) + return "content: string expected"; + if (message.startOffset != null && message.hasOwnProperty("startOffset")) + if (!$util.isInteger(message.startOffset) && !(message.startOffset && $util.isInteger(message.startOffset.low) && $util.isInteger(message.startOffset.high))) + return "startOffset: integer|Long expected"; + if (message.endOffset != null && message.hasOwnProperty("endOffset")) + if (!$util.isInteger(message.endOffset) && !(message.endOffset && $util.isInteger(message.endOffset.low) && $util.isInteger(message.endOffset.high))) + return "endOffset: integer|Long expected"; + return null; + }; + + /** + * Creates a TextSegment message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.automl.v1beta1.TextSegment + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.automl.v1beta1.TextSegment} TextSegment + */ + TextSegment.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.automl.v1beta1.TextSegment) + return object; + var message = new $root.google.cloud.automl.v1beta1.TextSegment(); + if (object.content != null) + message.content = String(object.content); + if (object.startOffset != null) + if ($util.Long) + (message.startOffset = $util.Long.fromValue(object.startOffset)).unsigned = false; + else if (typeof object.startOffset === "string") + message.startOffset = parseInt(object.startOffset, 10); + else if (typeof object.startOffset === "number") + message.startOffset = object.startOffset; + else if (typeof object.startOffset === "object") + message.startOffset = new $util.LongBits(object.startOffset.low >>> 0, object.startOffset.high >>> 0).toNumber(); + if (object.endOffset != null) + if ($util.Long) + (message.endOffset = $util.Long.fromValue(object.endOffset)).unsigned = false; + else if (typeof object.endOffset === "string") + message.endOffset = parseInt(object.endOffset, 10); + else if (typeof object.endOffset === "number") + message.endOffset = object.endOffset; + else if (typeof object.endOffset === "object") + message.endOffset = new $util.LongBits(object.endOffset.low >>> 0, object.endOffset.high >>> 0).toNumber(); + return message; + }; + + /** + * Creates a plain object from a TextSegment message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.automl.v1beta1.TextSegment + * @static + * @param {google.cloud.automl.v1beta1.TextSegment} message TextSegment + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + TextSegment.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.startOffset = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.startOffset = options.longs === String ? "0" : 0; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.endOffset = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.endOffset = options.longs === String ? "0" : 0; + object.content = ""; + } + if (message.startOffset != null && message.hasOwnProperty("startOffset")) + if (typeof message.startOffset === "number") + object.startOffset = options.longs === String ? String(message.startOffset) : message.startOffset; + else + object.startOffset = options.longs === String ? $util.Long.prototype.toString.call(message.startOffset) : options.longs === Number ? new $util.LongBits(message.startOffset.low >>> 0, message.startOffset.high >>> 0).toNumber() : message.startOffset; + if (message.endOffset != null && message.hasOwnProperty("endOffset")) + if (typeof message.endOffset === "number") + object.endOffset = options.longs === String ? String(message.endOffset) : message.endOffset; + else + object.endOffset = options.longs === String ? $util.Long.prototype.toString.call(message.endOffset) : options.longs === Number ? new $util.LongBits(message.endOffset.low >>> 0, message.endOffset.high >>> 0).toNumber() : message.endOffset; + if (message.content != null && message.hasOwnProperty("content")) + object.content = message.content; + return object; + }; + + /** + * Converts this TextSegment to JSON. + * @function toJSON + * @memberof google.cloud.automl.v1beta1.TextSegment + * @instance + * @returns {Object.} JSON object + */ + TextSegment.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for TextSegment + * @function getTypeUrl + * @memberof google.cloud.automl.v1beta1.TextSegment + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TextSegment.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.automl.v1beta1.TextSegment"; + }; + + return TextSegment; + })(); + + v1beta1.DoubleRange = (function() { + + /** + * Properties of a DoubleRange. + * @memberof google.cloud.automl.v1beta1 + * @interface IDoubleRange + * @property {number|null} [start] DoubleRange start + * @property {number|null} [end] DoubleRange end + */ + + /** + * Constructs a new DoubleRange. + * @memberof google.cloud.automl.v1beta1 + * @classdesc Represents a DoubleRange. + * @implements IDoubleRange + * @constructor + * @param {google.cloud.automl.v1beta1.IDoubleRange=} [properties] Properties to set + */ + function DoubleRange(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * DoubleRange start. + * @member {number} start + * @memberof google.cloud.automl.v1beta1.DoubleRange + * @instance + */ + DoubleRange.prototype.start = 0; + + /** + * DoubleRange end. + * @member {number} end + * @memberof google.cloud.automl.v1beta1.DoubleRange + * @instance + */ + DoubleRange.prototype.end = 0; + + /** + * Creates a new DoubleRange instance using the specified properties. + * @function create + * @memberof google.cloud.automl.v1beta1.DoubleRange + * @static + * @param {google.cloud.automl.v1beta1.IDoubleRange=} [properties] Properties to set + * @returns {google.cloud.automl.v1beta1.DoubleRange} DoubleRange instance + */ + DoubleRange.create = function create(properties) { + return new DoubleRange(properties); + }; + + /** + * Encodes the specified DoubleRange message. Does not implicitly {@link google.cloud.automl.v1beta1.DoubleRange.verify|verify} messages. + * @function encode + * @memberof google.cloud.automl.v1beta1.DoubleRange + * @static + * @param {google.cloud.automl.v1beta1.IDoubleRange} message DoubleRange message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DoubleRange.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.start != null && Object.hasOwnProperty.call(message, "start")) + writer.uint32(/* id 1, wireType 1 =*/9).double(message.start); + if (message.end != null && Object.hasOwnProperty.call(message, "end")) + writer.uint32(/* id 2, wireType 1 =*/17).double(message.end); + return writer; + }; + + /** + * Encodes the specified DoubleRange message, length delimited. Does not implicitly {@link google.cloud.automl.v1beta1.DoubleRange.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.automl.v1beta1.DoubleRange + * @static + * @param {google.cloud.automl.v1beta1.IDoubleRange} message DoubleRange message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DoubleRange.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DoubleRange message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.automl.v1beta1.DoubleRange + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.automl.v1beta1.DoubleRange} DoubleRange + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DoubleRange.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.automl.v1beta1.DoubleRange(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.start = reader.double(); + break; + } + case 2: { + message.end = reader.double(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DoubleRange message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.automl.v1beta1.DoubleRange + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.automl.v1beta1.DoubleRange} DoubleRange + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DoubleRange.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DoubleRange message. + * @function verify + * @memberof google.cloud.automl.v1beta1.DoubleRange + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DoubleRange.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.start != null && message.hasOwnProperty("start")) + if (typeof message.start !== "number") + return "start: number expected"; + if (message.end != null && message.hasOwnProperty("end")) + if (typeof message.end !== "number") + return "end: number expected"; + return null; + }; + + /** + * Creates a DoubleRange message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.automl.v1beta1.DoubleRange + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.automl.v1beta1.DoubleRange} DoubleRange + */ + DoubleRange.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.automl.v1beta1.DoubleRange) + return object; + var message = new $root.google.cloud.automl.v1beta1.DoubleRange(); + if (object.start != null) + message.start = Number(object.start); + if (object.end != null) + message.end = Number(object.end); + return message; + }; + + /** + * Creates a plain object from a DoubleRange message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.automl.v1beta1.DoubleRange + * @static + * @param {google.cloud.automl.v1beta1.DoubleRange} message DoubleRange + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DoubleRange.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 = options.json && !isFinite(message.start) ? String(message.start) : message.start; + if (message.end != null && message.hasOwnProperty("end")) + object.end = options.json && !isFinite(message.end) ? String(message.end) : message.end; + return object; + }; + + /** + * Converts this DoubleRange to JSON. + * @function toJSON + * @memberof google.cloud.automl.v1beta1.DoubleRange + * @instance + * @returns {Object.} JSON object + */ + DoubleRange.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DoubleRange + * @function getTypeUrl + * @memberof google.cloud.automl.v1beta1.DoubleRange + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DoubleRange.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.automl.v1beta1.DoubleRange"; + }; + + return DoubleRange; + })(); + + v1beta1.RegressionEvaluationMetrics = (function() { + + /** + * Properties of a RegressionEvaluationMetrics. + * @memberof google.cloud.automl.v1beta1 + * @interface IRegressionEvaluationMetrics + * @property {number|null} [rootMeanSquaredError] RegressionEvaluationMetrics rootMeanSquaredError + * @property {number|null} [meanAbsoluteError] RegressionEvaluationMetrics meanAbsoluteError + * @property {number|null} [meanAbsolutePercentageError] RegressionEvaluationMetrics meanAbsolutePercentageError + * @property {number|null} [rSquared] RegressionEvaluationMetrics rSquared + * @property {number|null} [rootMeanSquaredLogError] RegressionEvaluationMetrics rootMeanSquaredLogError + */ + + /** + * Constructs a new RegressionEvaluationMetrics. + * @memberof google.cloud.automl.v1beta1 + * @classdesc Represents a RegressionEvaluationMetrics. + * @implements IRegressionEvaluationMetrics + * @constructor + * @param {google.cloud.automl.v1beta1.IRegressionEvaluationMetrics=} [properties] Properties to set + */ + function RegressionEvaluationMetrics(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * RegressionEvaluationMetrics rootMeanSquaredError. + * @member {number} rootMeanSquaredError + * @memberof google.cloud.automl.v1beta1.RegressionEvaluationMetrics + * @instance + */ + RegressionEvaluationMetrics.prototype.rootMeanSquaredError = 0; + + /** + * RegressionEvaluationMetrics meanAbsoluteError. + * @member {number} meanAbsoluteError + * @memberof google.cloud.automl.v1beta1.RegressionEvaluationMetrics + * @instance + */ + RegressionEvaluationMetrics.prototype.meanAbsoluteError = 0; + + /** + * RegressionEvaluationMetrics meanAbsolutePercentageError. + * @member {number} meanAbsolutePercentageError + * @memberof google.cloud.automl.v1beta1.RegressionEvaluationMetrics + * @instance + */ + RegressionEvaluationMetrics.prototype.meanAbsolutePercentageError = 0; + + /** + * RegressionEvaluationMetrics rSquared. + * @member {number} rSquared + * @memberof google.cloud.automl.v1beta1.RegressionEvaluationMetrics + * @instance + */ + RegressionEvaluationMetrics.prototype.rSquared = 0; + + /** + * RegressionEvaluationMetrics rootMeanSquaredLogError. + * @member {number} rootMeanSquaredLogError + * @memberof google.cloud.automl.v1beta1.RegressionEvaluationMetrics + * @instance + */ + RegressionEvaluationMetrics.prototype.rootMeanSquaredLogError = 0; + + /** + * Creates a new RegressionEvaluationMetrics instance using the specified properties. + * @function create + * @memberof google.cloud.automl.v1beta1.RegressionEvaluationMetrics + * @static + * @param {google.cloud.automl.v1beta1.IRegressionEvaluationMetrics=} [properties] Properties to set + * @returns {google.cloud.automl.v1beta1.RegressionEvaluationMetrics} RegressionEvaluationMetrics instance + */ + RegressionEvaluationMetrics.create = function create(properties) { + return new RegressionEvaluationMetrics(properties); + }; + + /** + * Encodes the specified RegressionEvaluationMetrics message. Does not implicitly {@link google.cloud.automl.v1beta1.RegressionEvaluationMetrics.verify|verify} messages. + * @function encode + * @memberof google.cloud.automl.v1beta1.RegressionEvaluationMetrics + * @static + * @param {google.cloud.automl.v1beta1.IRegressionEvaluationMetrics} message RegressionEvaluationMetrics message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RegressionEvaluationMetrics.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.rootMeanSquaredError != null && Object.hasOwnProperty.call(message, "rootMeanSquaredError")) + writer.uint32(/* id 1, wireType 5 =*/13).float(message.rootMeanSquaredError); + if (message.meanAbsoluteError != null && Object.hasOwnProperty.call(message, "meanAbsoluteError")) + writer.uint32(/* id 2, wireType 5 =*/21).float(message.meanAbsoluteError); + if (message.meanAbsolutePercentageError != null && Object.hasOwnProperty.call(message, "meanAbsolutePercentageError")) + writer.uint32(/* id 3, wireType 5 =*/29).float(message.meanAbsolutePercentageError); + if (message.rSquared != null && Object.hasOwnProperty.call(message, "rSquared")) + writer.uint32(/* id 4, wireType 5 =*/37).float(message.rSquared); + if (message.rootMeanSquaredLogError != null && Object.hasOwnProperty.call(message, "rootMeanSquaredLogError")) + writer.uint32(/* id 5, wireType 5 =*/45).float(message.rootMeanSquaredLogError); + return writer; + }; + + /** + * Encodes the specified RegressionEvaluationMetrics message, length delimited. Does not implicitly {@link google.cloud.automl.v1beta1.RegressionEvaluationMetrics.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.automl.v1beta1.RegressionEvaluationMetrics + * @static + * @param {google.cloud.automl.v1beta1.IRegressionEvaluationMetrics} message RegressionEvaluationMetrics message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RegressionEvaluationMetrics.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a RegressionEvaluationMetrics message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.automl.v1beta1.RegressionEvaluationMetrics + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.automl.v1beta1.RegressionEvaluationMetrics} RegressionEvaluationMetrics + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RegressionEvaluationMetrics.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.automl.v1beta1.RegressionEvaluationMetrics(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.rootMeanSquaredError = reader.float(); + break; + } + case 2: { + message.meanAbsoluteError = reader.float(); + break; + } + case 3: { + message.meanAbsolutePercentageError = reader.float(); + break; + } + case 4: { + message.rSquared = reader.float(); + break; + } + case 5: { + message.rootMeanSquaredLogError = reader.float(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a RegressionEvaluationMetrics message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.automl.v1beta1.RegressionEvaluationMetrics + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.automl.v1beta1.RegressionEvaluationMetrics} RegressionEvaluationMetrics + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RegressionEvaluationMetrics.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a RegressionEvaluationMetrics message. + * @function verify + * @memberof google.cloud.automl.v1beta1.RegressionEvaluationMetrics + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + RegressionEvaluationMetrics.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.rootMeanSquaredError != null && message.hasOwnProperty("rootMeanSquaredError")) + if (typeof message.rootMeanSquaredError !== "number") + return "rootMeanSquaredError: number expected"; + if (message.meanAbsoluteError != null && message.hasOwnProperty("meanAbsoluteError")) + if (typeof message.meanAbsoluteError !== "number") + return "meanAbsoluteError: number expected"; + if (message.meanAbsolutePercentageError != null && message.hasOwnProperty("meanAbsolutePercentageError")) + if (typeof message.meanAbsolutePercentageError !== "number") + return "meanAbsolutePercentageError: number expected"; + if (message.rSquared != null && message.hasOwnProperty("rSquared")) + if (typeof message.rSquared !== "number") + return "rSquared: number expected"; + if (message.rootMeanSquaredLogError != null && message.hasOwnProperty("rootMeanSquaredLogError")) + if (typeof message.rootMeanSquaredLogError !== "number") + return "rootMeanSquaredLogError: number expected"; + return null; + }; + + /** + * Creates a RegressionEvaluationMetrics message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.automl.v1beta1.RegressionEvaluationMetrics + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.automl.v1beta1.RegressionEvaluationMetrics} RegressionEvaluationMetrics + */ + RegressionEvaluationMetrics.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.automl.v1beta1.RegressionEvaluationMetrics) + return object; + var message = new $root.google.cloud.automl.v1beta1.RegressionEvaluationMetrics(); + if (object.rootMeanSquaredError != null) + message.rootMeanSquaredError = Number(object.rootMeanSquaredError); + if (object.meanAbsoluteError != null) + message.meanAbsoluteError = Number(object.meanAbsoluteError); + if (object.meanAbsolutePercentageError != null) + message.meanAbsolutePercentageError = Number(object.meanAbsolutePercentageError); + if (object.rSquared != null) + message.rSquared = Number(object.rSquared); + if (object.rootMeanSquaredLogError != null) + message.rootMeanSquaredLogError = Number(object.rootMeanSquaredLogError); + return message; + }; + + /** + * Creates a plain object from a RegressionEvaluationMetrics message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.automl.v1beta1.RegressionEvaluationMetrics + * @static + * @param {google.cloud.automl.v1beta1.RegressionEvaluationMetrics} message RegressionEvaluationMetrics + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + RegressionEvaluationMetrics.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.rootMeanSquaredError = 0; + object.meanAbsoluteError = 0; + object.meanAbsolutePercentageError = 0; + object.rSquared = 0; + object.rootMeanSquaredLogError = 0; + } + if (message.rootMeanSquaredError != null && message.hasOwnProperty("rootMeanSquaredError")) + object.rootMeanSquaredError = options.json && !isFinite(message.rootMeanSquaredError) ? String(message.rootMeanSquaredError) : message.rootMeanSquaredError; + if (message.meanAbsoluteError != null && message.hasOwnProperty("meanAbsoluteError")) + object.meanAbsoluteError = options.json && !isFinite(message.meanAbsoluteError) ? String(message.meanAbsoluteError) : message.meanAbsoluteError; + if (message.meanAbsolutePercentageError != null && message.hasOwnProperty("meanAbsolutePercentageError")) + object.meanAbsolutePercentageError = options.json && !isFinite(message.meanAbsolutePercentageError) ? String(message.meanAbsolutePercentageError) : message.meanAbsolutePercentageError; + if (message.rSquared != null && message.hasOwnProperty("rSquared")) + object.rSquared = options.json && !isFinite(message.rSquared) ? String(message.rSquared) : message.rSquared; + if (message.rootMeanSquaredLogError != null && message.hasOwnProperty("rootMeanSquaredLogError")) + object.rootMeanSquaredLogError = options.json && !isFinite(message.rootMeanSquaredLogError) ? String(message.rootMeanSquaredLogError) : message.rootMeanSquaredLogError; + return object; + }; + + /** + * Converts this RegressionEvaluationMetrics to JSON. + * @function toJSON + * @memberof google.cloud.automl.v1beta1.RegressionEvaluationMetrics + * @instance + * @returns {Object.} JSON object + */ + RegressionEvaluationMetrics.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for RegressionEvaluationMetrics + * @function getTypeUrl + * @memberof google.cloud.automl.v1beta1.RegressionEvaluationMetrics + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + RegressionEvaluationMetrics.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.automl.v1beta1.RegressionEvaluationMetrics"; + }; + + return RegressionEvaluationMetrics; + })(); + + v1beta1.TextExtractionAnnotation = (function() { + + /** + * Properties of a TextExtractionAnnotation. + * @memberof google.cloud.automl.v1beta1 + * @interface ITextExtractionAnnotation + * @property {google.cloud.automl.v1beta1.ITextSegment|null} [textSegment] TextExtractionAnnotation textSegment + * @property {number|null} [score] TextExtractionAnnotation score + */ + + /** + * Constructs a new TextExtractionAnnotation. + * @memberof google.cloud.automl.v1beta1 + * @classdesc Represents a TextExtractionAnnotation. + * @implements ITextExtractionAnnotation + * @constructor + * @param {google.cloud.automl.v1beta1.ITextExtractionAnnotation=} [properties] Properties to set + */ + function TextExtractionAnnotation(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * TextExtractionAnnotation textSegment. + * @member {google.cloud.automl.v1beta1.ITextSegment|null|undefined} textSegment + * @memberof google.cloud.automl.v1beta1.TextExtractionAnnotation + * @instance + */ + TextExtractionAnnotation.prototype.textSegment = null; + + /** + * TextExtractionAnnotation score. + * @member {number} score + * @memberof google.cloud.automl.v1beta1.TextExtractionAnnotation + * @instance + */ + TextExtractionAnnotation.prototype.score = 0; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * TextExtractionAnnotation annotation. + * @member {"textSegment"|undefined} annotation + * @memberof google.cloud.automl.v1beta1.TextExtractionAnnotation + * @instance + */ + Object.defineProperty(TextExtractionAnnotation.prototype, "annotation", { + get: $util.oneOfGetter($oneOfFields = ["textSegment"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new TextExtractionAnnotation instance using the specified properties. + * @function create + * @memberof google.cloud.automl.v1beta1.TextExtractionAnnotation + * @static + * @param {google.cloud.automl.v1beta1.ITextExtractionAnnotation=} [properties] Properties to set + * @returns {google.cloud.automl.v1beta1.TextExtractionAnnotation} TextExtractionAnnotation instance + */ + TextExtractionAnnotation.create = function create(properties) { + return new TextExtractionAnnotation(properties); + }; + + /** + * Encodes the specified TextExtractionAnnotation message. Does not implicitly {@link google.cloud.automl.v1beta1.TextExtractionAnnotation.verify|verify} messages. + * @function encode + * @memberof google.cloud.automl.v1beta1.TextExtractionAnnotation + * @static + * @param {google.cloud.automl.v1beta1.ITextExtractionAnnotation} message TextExtractionAnnotation message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TextExtractionAnnotation.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.score != null && Object.hasOwnProperty.call(message, "score")) + writer.uint32(/* id 1, wireType 5 =*/13).float(message.score); + if (message.textSegment != null && Object.hasOwnProperty.call(message, "textSegment")) + $root.google.cloud.automl.v1beta1.TextSegment.encode(message.textSegment, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified TextExtractionAnnotation message, length delimited. Does not implicitly {@link google.cloud.automl.v1beta1.TextExtractionAnnotation.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.automl.v1beta1.TextExtractionAnnotation + * @static + * @param {google.cloud.automl.v1beta1.ITextExtractionAnnotation} message TextExtractionAnnotation message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TextExtractionAnnotation.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a TextExtractionAnnotation message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.automl.v1beta1.TextExtractionAnnotation + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.automl.v1beta1.TextExtractionAnnotation} TextExtractionAnnotation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TextExtractionAnnotation.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.automl.v1beta1.TextExtractionAnnotation(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 3: { + message.textSegment = $root.google.cloud.automl.v1beta1.TextSegment.decode(reader, reader.uint32()); + break; + } + case 1: { + message.score = reader.float(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a TextExtractionAnnotation message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.automl.v1beta1.TextExtractionAnnotation + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.automl.v1beta1.TextExtractionAnnotation} TextExtractionAnnotation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TextExtractionAnnotation.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a TextExtractionAnnotation message. + * @function verify + * @memberof google.cloud.automl.v1beta1.TextExtractionAnnotation + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + TextExtractionAnnotation.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.textSegment != null && message.hasOwnProperty("textSegment")) { + properties.annotation = 1; + { + var error = $root.google.cloud.automl.v1beta1.TextSegment.verify(message.textSegment); + if (error) + return "textSegment." + error; + } + } + if (message.score != null && message.hasOwnProperty("score")) + if (typeof message.score !== "number") + return "score: number expected"; + return null; + }; + + /** + * Creates a TextExtractionAnnotation message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.automl.v1beta1.TextExtractionAnnotation + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.automl.v1beta1.TextExtractionAnnotation} TextExtractionAnnotation + */ + TextExtractionAnnotation.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.automl.v1beta1.TextExtractionAnnotation) + return object; + var message = new $root.google.cloud.automl.v1beta1.TextExtractionAnnotation(); + if (object.textSegment != null) { + if (typeof object.textSegment !== "object") + throw TypeError(".google.cloud.automl.v1beta1.TextExtractionAnnotation.textSegment: object expected"); + message.textSegment = $root.google.cloud.automl.v1beta1.TextSegment.fromObject(object.textSegment); + } + if (object.score != null) + message.score = Number(object.score); + return message; + }; + + /** + * Creates a plain object from a TextExtractionAnnotation message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.automl.v1beta1.TextExtractionAnnotation + * @static + * @param {google.cloud.automl.v1beta1.TextExtractionAnnotation} message TextExtractionAnnotation + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + TextExtractionAnnotation.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.score = 0; + if (message.score != null && message.hasOwnProperty("score")) + object.score = options.json && !isFinite(message.score) ? String(message.score) : message.score; + if (message.textSegment != null && message.hasOwnProperty("textSegment")) { + object.textSegment = $root.google.cloud.automl.v1beta1.TextSegment.toObject(message.textSegment, options); + if (options.oneofs) + object.annotation = "textSegment"; + } + return object; + }; + + /** + * Converts this TextExtractionAnnotation to JSON. + * @function toJSON + * @memberof google.cloud.automl.v1beta1.TextExtractionAnnotation + * @instance + * @returns {Object.} JSON object + */ + TextExtractionAnnotation.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for TextExtractionAnnotation + * @function getTypeUrl + * @memberof google.cloud.automl.v1beta1.TextExtractionAnnotation + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TextExtractionAnnotation.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.automl.v1beta1.TextExtractionAnnotation"; + }; + + return TextExtractionAnnotation; + })(); + + v1beta1.TextExtractionEvaluationMetrics = (function() { + + /** + * Properties of a TextExtractionEvaluationMetrics. + * @memberof google.cloud.automl.v1beta1 + * @interface ITextExtractionEvaluationMetrics + * @property {number|null} [auPrc] TextExtractionEvaluationMetrics auPrc + * @property {Array.|null} [confidenceMetricsEntries] TextExtractionEvaluationMetrics confidenceMetricsEntries + */ + + /** + * Constructs a new TextExtractionEvaluationMetrics. + * @memberof google.cloud.automl.v1beta1 + * @classdesc Represents a TextExtractionEvaluationMetrics. + * @implements ITextExtractionEvaluationMetrics + * @constructor + * @param {google.cloud.automl.v1beta1.ITextExtractionEvaluationMetrics=} [properties] Properties to set + */ + function TextExtractionEvaluationMetrics(properties) { + this.confidenceMetricsEntries = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * TextExtractionEvaluationMetrics auPrc. + * @member {number} auPrc + * @memberof google.cloud.automl.v1beta1.TextExtractionEvaluationMetrics + * @instance + */ + TextExtractionEvaluationMetrics.prototype.auPrc = 0; + + /** + * TextExtractionEvaluationMetrics confidenceMetricsEntries. + * @member {Array.} confidenceMetricsEntries + * @memberof google.cloud.automl.v1beta1.TextExtractionEvaluationMetrics + * @instance + */ + TextExtractionEvaluationMetrics.prototype.confidenceMetricsEntries = $util.emptyArray; + + /** + * Creates a new TextExtractionEvaluationMetrics instance using the specified properties. + * @function create + * @memberof google.cloud.automl.v1beta1.TextExtractionEvaluationMetrics + * @static + * @param {google.cloud.automl.v1beta1.ITextExtractionEvaluationMetrics=} [properties] Properties to set + * @returns {google.cloud.automl.v1beta1.TextExtractionEvaluationMetrics} TextExtractionEvaluationMetrics instance + */ + TextExtractionEvaluationMetrics.create = function create(properties) { + return new TextExtractionEvaluationMetrics(properties); + }; + + /** + * Encodes the specified TextExtractionEvaluationMetrics message. Does not implicitly {@link google.cloud.automl.v1beta1.TextExtractionEvaluationMetrics.verify|verify} messages. + * @function encode + * @memberof google.cloud.automl.v1beta1.TextExtractionEvaluationMetrics + * @static + * @param {google.cloud.automl.v1beta1.ITextExtractionEvaluationMetrics} message TextExtractionEvaluationMetrics message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TextExtractionEvaluationMetrics.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.auPrc != null && Object.hasOwnProperty.call(message, "auPrc")) + writer.uint32(/* id 1, wireType 5 =*/13).float(message.auPrc); + if (message.confidenceMetricsEntries != null && message.confidenceMetricsEntries.length) + for (var i = 0; i < message.confidenceMetricsEntries.length; ++i) + $root.google.cloud.automl.v1beta1.TextExtractionEvaluationMetrics.ConfidenceMetricsEntry.encode(message.confidenceMetricsEntries[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified TextExtractionEvaluationMetrics message, length delimited. Does not implicitly {@link google.cloud.automl.v1beta1.TextExtractionEvaluationMetrics.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.automl.v1beta1.TextExtractionEvaluationMetrics + * @static + * @param {google.cloud.automl.v1beta1.ITextExtractionEvaluationMetrics} message TextExtractionEvaluationMetrics message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TextExtractionEvaluationMetrics.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a TextExtractionEvaluationMetrics message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.automl.v1beta1.TextExtractionEvaluationMetrics + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.automl.v1beta1.TextExtractionEvaluationMetrics} TextExtractionEvaluationMetrics + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TextExtractionEvaluationMetrics.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.automl.v1beta1.TextExtractionEvaluationMetrics(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.auPrc = reader.float(); + break; + } + case 2: { + if (!(message.confidenceMetricsEntries && message.confidenceMetricsEntries.length)) + message.confidenceMetricsEntries = []; + message.confidenceMetricsEntries.push($root.google.cloud.automl.v1beta1.TextExtractionEvaluationMetrics.ConfidenceMetricsEntry.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a TextExtractionEvaluationMetrics message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.automl.v1beta1.TextExtractionEvaluationMetrics + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.automl.v1beta1.TextExtractionEvaluationMetrics} TextExtractionEvaluationMetrics + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TextExtractionEvaluationMetrics.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a TextExtractionEvaluationMetrics message. + * @function verify + * @memberof google.cloud.automl.v1beta1.TextExtractionEvaluationMetrics + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + TextExtractionEvaluationMetrics.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.auPrc != null && message.hasOwnProperty("auPrc")) + if (typeof message.auPrc !== "number") + return "auPrc: number expected"; + if (message.confidenceMetricsEntries != null && message.hasOwnProperty("confidenceMetricsEntries")) { + if (!Array.isArray(message.confidenceMetricsEntries)) + return "confidenceMetricsEntries: array expected"; + for (var i = 0; i < message.confidenceMetricsEntries.length; ++i) { + var error = $root.google.cloud.automl.v1beta1.TextExtractionEvaluationMetrics.ConfidenceMetricsEntry.verify(message.confidenceMetricsEntries[i]); + if (error) + return "confidenceMetricsEntries." + error; + } + } + return null; + }; + + /** + * Creates a TextExtractionEvaluationMetrics message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.automl.v1beta1.TextExtractionEvaluationMetrics + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.automl.v1beta1.TextExtractionEvaluationMetrics} TextExtractionEvaluationMetrics + */ + TextExtractionEvaluationMetrics.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.automl.v1beta1.TextExtractionEvaluationMetrics) + return object; + var message = new $root.google.cloud.automl.v1beta1.TextExtractionEvaluationMetrics(); + if (object.auPrc != null) + message.auPrc = Number(object.auPrc); + if (object.confidenceMetricsEntries) { + if (!Array.isArray(object.confidenceMetricsEntries)) + throw TypeError(".google.cloud.automl.v1beta1.TextExtractionEvaluationMetrics.confidenceMetricsEntries: array expected"); + message.confidenceMetricsEntries = []; + for (var i = 0; i < object.confidenceMetricsEntries.length; ++i) { + if (typeof object.confidenceMetricsEntries[i] !== "object") + throw TypeError(".google.cloud.automl.v1beta1.TextExtractionEvaluationMetrics.confidenceMetricsEntries: object expected"); + message.confidenceMetricsEntries[i] = $root.google.cloud.automl.v1beta1.TextExtractionEvaluationMetrics.ConfidenceMetricsEntry.fromObject(object.confidenceMetricsEntries[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a TextExtractionEvaluationMetrics message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.automl.v1beta1.TextExtractionEvaluationMetrics + * @static + * @param {google.cloud.automl.v1beta1.TextExtractionEvaluationMetrics} message TextExtractionEvaluationMetrics + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + TextExtractionEvaluationMetrics.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.confidenceMetricsEntries = []; + if (options.defaults) + object.auPrc = 0; + if (message.auPrc != null && message.hasOwnProperty("auPrc")) + object.auPrc = options.json && !isFinite(message.auPrc) ? String(message.auPrc) : message.auPrc; + if (message.confidenceMetricsEntries && message.confidenceMetricsEntries.length) { + object.confidenceMetricsEntries = []; + for (var j = 0; j < message.confidenceMetricsEntries.length; ++j) + object.confidenceMetricsEntries[j] = $root.google.cloud.automl.v1beta1.TextExtractionEvaluationMetrics.ConfidenceMetricsEntry.toObject(message.confidenceMetricsEntries[j], options); + } + return object; + }; + + /** + * Converts this TextExtractionEvaluationMetrics to JSON. + * @function toJSON + * @memberof google.cloud.automl.v1beta1.TextExtractionEvaluationMetrics + * @instance + * @returns {Object.} JSON object + */ + TextExtractionEvaluationMetrics.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for TextExtractionEvaluationMetrics + * @function getTypeUrl + * @memberof google.cloud.automl.v1beta1.TextExtractionEvaluationMetrics + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TextExtractionEvaluationMetrics.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.automl.v1beta1.TextExtractionEvaluationMetrics"; + }; + + TextExtractionEvaluationMetrics.ConfidenceMetricsEntry = (function() { + + /** + * Properties of a ConfidenceMetricsEntry. + * @memberof google.cloud.automl.v1beta1.TextExtractionEvaluationMetrics + * @interface IConfidenceMetricsEntry + * @property {number|null} [confidenceThreshold] ConfidenceMetricsEntry confidenceThreshold + * @property {number|null} [recall] ConfidenceMetricsEntry recall + * @property {number|null} [precision] ConfidenceMetricsEntry precision + * @property {number|null} [f1Score] ConfidenceMetricsEntry f1Score + */ + + /** + * Constructs a new ConfidenceMetricsEntry. + * @memberof google.cloud.automl.v1beta1.TextExtractionEvaluationMetrics + * @classdesc Represents a ConfidenceMetricsEntry. + * @implements IConfidenceMetricsEntry + * @constructor + * @param {google.cloud.automl.v1beta1.TextExtractionEvaluationMetrics.IConfidenceMetricsEntry=} [properties] Properties to set + */ + function ConfidenceMetricsEntry(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ConfidenceMetricsEntry confidenceThreshold. + * @member {number} confidenceThreshold + * @memberof google.cloud.automl.v1beta1.TextExtractionEvaluationMetrics.ConfidenceMetricsEntry + * @instance + */ + ConfidenceMetricsEntry.prototype.confidenceThreshold = 0; + + /** + * ConfidenceMetricsEntry recall. + * @member {number} recall + * @memberof google.cloud.automl.v1beta1.TextExtractionEvaluationMetrics.ConfidenceMetricsEntry + * @instance + */ + ConfidenceMetricsEntry.prototype.recall = 0; + + /** + * ConfidenceMetricsEntry precision. + * @member {number} precision + * @memberof google.cloud.automl.v1beta1.TextExtractionEvaluationMetrics.ConfidenceMetricsEntry + * @instance + */ + ConfidenceMetricsEntry.prototype.precision = 0; + + /** + * ConfidenceMetricsEntry f1Score. + * @member {number} f1Score + * @memberof google.cloud.automl.v1beta1.TextExtractionEvaluationMetrics.ConfidenceMetricsEntry + * @instance + */ + ConfidenceMetricsEntry.prototype.f1Score = 0; + + /** + * Creates a new ConfidenceMetricsEntry instance using the specified properties. + * @function create + * @memberof google.cloud.automl.v1beta1.TextExtractionEvaluationMetrics.ConfidenceMetricsEntry + * @static + * @param {google.cloud.automl.v1beta1.TextExtractionEvaluationMetrics.IConfidenceMetricsEntry=} [properties] Properties to set + * @returns {google.cloud.automl.v1beta1.TextExtractionEvaluationMetrics.ConfidenceMetricsEntry} ConfidenceMetricsEntry instance + */ + ConfidenceMetricsEntry.create = function create(properties) { + return new ConfidenceMetricsEntry(properties); + }; + + /** + * Encodes the specified ConfidenceMetricsEntry message. Does not implicitly {@link google.cloud.automl.v1beta1.TextExtractionEvaluationMetrics.ConfidenceMetricsEntry.verify|verify} messages. + * @function encode + * @memberof google.cloud.automl.v1beta1.TextExtractionEvaluationMetrics.ConfidenceMetricsEntry + * @static + * @param {google.cloud.automl.v1beta1.TextExtractionEvaluationMetrics.IConfidenceMetricsEntry} message ConfidenceMetricsEntry message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ConfidenceMetricsEntry.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.confidenceThreshold != null && Object.hasOwnProperty.call(message, "confidenceThreshold")) + writer.uint32(/* id 1, wireType 5 =*/13).float(message.confidenceThreshold); + if (message.recall != null && Object.hasOwnProperty.call(message, "recall")) + writer.uint32(/* id 3, wireType 5 =*/29).float(message.recall); + if (message.precision != null && Object.hasOwnProperty.call(message, "precision")) + writer.uint32(/* id 4, wireType 5 =*/37).float(message.precision); + if (message.f1Score != null && Object.hasOwnProperty.call(message, "f1Score")) + writer.uint32(/* id 5, wireType 5 =*/45).float(message.f1Score); + return writer; + }; + + /** + * Encodes the specified ConfidenceMetricsEntry message, length delimited. Does not implicitly {@link google.cloud.automl.v1beta1.TextExtractionEvaluationMetrics.ConfidenceMetricsEntry.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.automl.v1beta1.TextExtractionEvaluationMetrics.ConfidenceMetricsEntry + * @static + * @param {google.cloud.automl.v1beta1.TextExtractionEvaluationMetrics.IConfidenceMetricsEntry} message ConfidenceMetricsEntry message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ConfidenceMetricsEntry.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ConfidenceMetricsEntry message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.automl.v1beta1.TextExtractionEvaluationMetrics.ConfidenceMetricsEntry + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.automl.v1beta1.TextExtractionEvaluationMetrics.ConfidenceMetricsEntry} ConfidenceMetricsEntry + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ConfidenceMetricsEntry.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.automl.v1beta1.TextExtractionEvaluationMetrics.ConfidenceMetricsEntry(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.confidenceThreshold = reader.float(); + break; + } + case 3: { + message.recall = reader.float(); + break; + } + case 4: { + message.precision = reader.float(); + break; + } + case 5: { + message.f1Score = reader.float(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ConfidenceMetricsEntry message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.automl.v1beta1.TextExtractionEvaluationMetrics.ConfidenceMetricsEntry + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.automl.v1beta1.TextExtractionEvaluationMetrics.ConfidenceMetricsEntry} ConfidenceMetricsEntry + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ConfidenceMetricsEntry.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ConfidenceMetricsEntry message. + * @function verify + * @memberof google.cloud.automl.v1beta1.TextExtractionEvaluationMetrics.ConfidenceMetricsEntry + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ConfidenceMetricsEntry.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.confidenceThreshold != null && message.hasOwnProperty("confidenceThreshold")) + if (typeof message.confidenceThreshold !== "number") + return "confidenceThreshold: number expected"; + if (message.recall != null && message.hasOwnProperty("recall")) + if (typeof message.recall !== "number") + return "recall: number expected"; + if (message.precision != null && message.hasOwnProperty("precision")) + if (typeof message.precision !== "number") + return "precision: number expected"; + if (message.f1Score != null && message.hasOwnProperty("f1Score")) + if (typeof message.f1Score !== "number") + return "f1Score: number expected"; + return null; + }; + + /** + * Creates a ConfidenceMetricsEntry message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.automl.v1beta1.TextExtractionEvaluationMetrics.ConfidenceMetricsEntry + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.automl.v1beta1.TextExtractionEvaluationMetrics.ConfidenceMetricsEntry} ConfidenceMetricsEntry + */ + ConfidenceMetricsEntry.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.automl.v1beta1.TextExtractionEvaluationMetrics.ConfidenceMetricsEntry) + return object; + var message = new $root.google.cloud.automl.v1beta1.TextExtractionEvaluationMetrics.ConfidenceMetricsEntry(); + if (object.confidenceThreshold != null) + message.confidenceThreshold = Number(object.confidenceThreshold); + if (object.recall != null) + message.recall = Number(object.recall); + if (object.precision != null) + message.precision = Number(object.precision); + if (object.f1Score != null) + message.f1Score = Number(object.f1Score); + return message; + }; + + /** + * Creates a plain object from a ConfidenceMetricsEntry message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.automl.v1beta1.TextExtractionEvaluationMetrics.ConfidenceMetricsEntry + * @static + * @param {google.cloud.automl.v1beta1.TextExtractionEvaluationMetrics.ConfidenceMetricsEntry} message ConfidenceMetricsEntry + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ConfidenceMetricsEntry.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.confidenceThreshold = 0; + object.recall = 0; + object.precision = 0; + object.f1Score = 0; + } + if (message.confidenceThreshold != null && message.hasOwnProperty("confidenceThreshold")) + object.confidenceThreshold = options.json && !isFinite(message.confidenceThreshold) ? String(message.confidenceThreshold) : message.confidenceThreshold; + if (message.recall != null && message.hasOwnProperty("recall")) + object.recall = options.json && !isFinite(message.recall) ? String(message.recall) : message.recall; + if (message.precision != null && message.hasOwnProperty("precision")) + object.precision = options.json && !isFinite(message.precision) ? String(message.precision) : message.precision; + if (message.f1Score != null && message.hasOwnProperty("f1Score")) + object.f1Score = options.json && !isFinite(message.f1Score) ? String(message.f1Score) : message.f1Score; + return object; + }; + + /** + * Converts this ConfidenceMetricsEntry to JSON. + * @function toJSON + * @memberof google.cloud.automl.v1beta1.TextExtractionEvaluationMetrics.ConfidenceMetricsEntry + * @instance + * @returns {Object.} JSON object + */ + ConfidenceMetricsEntry.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ConfidenceMetricsEntry + * @function getTypeUrl + * @memberof google.cloud.automl.v1beta1.TextExtractionEvaluationMetrics.ConfidenceMetricsEntry + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ConfidenceMetricsEntry.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.automl.v1beta1.TextExtractionEvaluationMetrics.ConfidenceMetricsEntry"; + }; + + return ConfidenceMetricsEntry; + })(); + + return TextExtractionEvaluationMetrics; + })(); + + v1beta1.TextSentimentAnnotation = (function() { + + /** + * Properties of a TextSentimentAnnotation. + * @memberof google.cloud.automl.v1beta1 + * @interface ITextSentimentAnnotation + * @property {number|null} [sentiment] TextSentimentAnnotation sentiment + */ + + /** + * Constructs a new TextSentimentAnnotation. + * @memberof google.cloud.automl.v1beta1 + * @classdesc Represents a TextSentimentAnnotation. + * @implements ITextSentimentAnnotation + * @constructor + * @param {google.cloud.automl.v1beta1.ITextSentimentAnnotation=} [properties] Properties to set + */ + function TextSentimentAnnotation(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * TextSentimentAnnotation sentiment. + * @member {number} sentiment + * @memberof google.cloud.automl.v1beta1.TextSentimentAnnotation + * @instance + */ + TextSentimentAnnotation.prototype.sentiment = 0; + + /** + * Creates a new TextSentimentAnnotation instance using the specified properties. + * @function create + * @memberof google.cloud.automl.v1beta1.TextSentimentAnnotation + * @static + * @param {google.cloud.automl.v1beta1.ITextSentimentAnnotation=} [properties] Properties to set + * @returns {google.cloud.automl.v1beta1.TextSentimentAnnotation} TextSentimentAnnotation instance + */ + TextSentimentAnnotation.create = function create(properties) { + return new TextSentimentAnnotation(properties); + }; + + /** + * Encodes the specified TextSentimentAnnotation message. Does not implicitly {@link google.cloud.automl.v1beta1.TextSentimentAnnotation.verify|verify} messages. + * @function encode + * @memberof google.cloud.automl.v1beta1.TextSentimentAnnotation + * @static + * @param {google.cloud.automl.v1beta1.ITextSentimentAnnotation} message TextSentimentAnnotation message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TextSentimentAnnotation.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.sentiment != null && Object.hasOwnProperty.call(message, "sentiment")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.sentiment); + return writer; + }; + + /** + * Encodes the specified TextSentimentAnnotation message, length delimited. Does not implicitly {@link google.cloud.automl.v1beta1.TextSentimentAnnotation.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.automl.v1beta1.TextSentimentAnnotation + * @static + * @param {google.cloud.automl.v1beta1.ITextSentimentAnnotation} message TextSentimentAnnotation message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TextSentimentAnnotation.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a TextSentimentAnnotation message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.automl.v1beta1.TextSentimentAnnotation + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.automl.v1beta1.TextSentimentAnnotation} TextSentimentAnnotation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TextSentimentAnnotation.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.automl.v1beta1.TextSentimentAnnotation(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.sentiment = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a TextSentimentAnnotation message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.automl.v1beta1.TextSentimentAnnotation + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.automl.v1beta1.TextSentimentAnnotation} TextSentimentAnnotation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TextSentimentAnnotation.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a TextSentimentAnnotation message. + * @function verify + * @memberof google.cloud.automl.v1beta1.TextSentimentAnnotation + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + TextSentimentAnnotation.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.sentiment != null && message.hasOwnProperty("sentiment")) + if (!$util.isInteger(message.sentiment)) + return "sentiment: integer expected"; + return null; + }; + + /** + * Creates a TextSentimentAnnotation message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.automl.v1beta1.TextSentimentAnnotation + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.automl.v1beta1.TextSentimentAnnotation} TextSentimentAnnotation + */ + TextSentimentAnnotation.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.automl.v1beta1.TextSentimentAnnotation) + return object; + var message = new $root.google.cloud.automl.v1beta1.TextSentimentAnnotation(); + if (object.sentiment != null) + message.sentiment = object.sentiment | 0; + return message; + }; + + /** + * Creates a plain object from a TextSentimentAnnotation message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.automl.v1beta1.TextSentimentAnnotation + * @static + * @param {google.cloud.automl.v1beta1.TextSentimentAnnotation} message TextSentimentAnnotation + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + TextSentimentAnnotation.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.sentiment = 0; + if (message.sentiment != null && message.hasOwnProperty("sentiment")) + object.sentiment = message.sentiment; + return object; + }; + + /** + * Converts this TextSentimentAnnotation to JSON. + * @function toJSON + * @memberof google.cloud.automl.v1beta1.TextSentimentAnnotation + * @instance + * @returns {Object.} JSON object + */ + TextSentimentAnnotation.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for TextSentimentAnnotation + * @function getTypeUrl + * @memberof google.cloud.automl.v1beta1.TextSentimentAnnotation + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TextSentimentAnnotation.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.automl.v1beta1.TextSentimentAnnotation"; + }; + + return TextSentimentAnnotation; + })(); + + v1beta1.TextSentimentEvaluationMetrics = (function() { + + /** + * Properties of a TextSentimentEvaluationMetrics. + * @memberof google.cloud.automl.v1beta1 + * @interface ITextSentimentEvaluationMetrics + * @property {number|null} [precision] TextSentimentEvaluationMetrics precision + * @property {number|null} [recall] TextSentimentEvaluationMetrics recall + * @property {number|null} [f1Score] TextSentimentEvaluationMetrics f1Score + * @property {number|null} [meanAbsoluteError] TextSentimentEvaluationMetrics meanAbsoluteError + * @property {number|null} [meanSquaredError] TextSentimentEvaluationMetrics meanSquaredError + * @property {number|null} [linearKappa] TextSentimentEvaluationMetrics linearKappa + * @property {number|null} [quadraticKappa] TextSentimentEvaluationMetrics quadraticKappa + * @property {google.cloud.automl.v1beta1.ClassificationEvaluationMetrics.IConfusionMatrix|null} [confusionMatrix] TextSentimentEvaluationMetrics confusionMatrix + * @property {Array.|null} [annotationSpecId] TextSentimentEvaluationMetrics annotationSpecId + */ + + /** + * Constructs a new TextSentimentEvaluationMetrics. + * @memberof google.cloud.automl.v1beta1 + * @classdesc Represents a TextSentimentEvaluationMetrics. + * @implements ITextSentimentEvaluationMetrics + * @constructor + * @param {google.cloud.automl.v1beta1.ITextSentimentEvaluationMetrics=} [properties] Properties to set + */ + function TextSentimentEvaluationMetrics(properties) { + this.annotationSpecId = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * TextSentimentEvaluationMetrics precision. + * @member {number} precision + * @memberof google.cloud.automl.v1beta1.TextSentimentEvaluationMetrics + * @instance + */ + TextSentimentEvaluationMetrics.prototype.precision = 0; + + /** + * TextSentimentEvaluationMetrics recall. + * @member {number} recall + * @memberof google.cloud.automl.v1beta1.TextSentimentEvaluationMetrics + * @instance + */ + TextSentimentEvaluationMetrics.prototype.recall = 0; + + /** + * TextSentimentEvaluationMetrics f1Score. + * @member {number} f1Score + * @memberof google.cloud.automl.v1beta1.TextSentimentEvaluationMetrics + * @instance + */ + TextSentimentEvaluationMetrics.prototype.f1Score = 0; + + /** + * TextSentimentEvaluationMetrics meanAbsoluteError. + * @member {number} meanAbsoluteError + * @memberof google.cloud.automl.v1beta1.TextSentimentEvaluationMetrics + * @instance + */ + TextSentimentEvaluationMetrics.prototype.meanAbsoluteError = 0; + + /** + * TextSentimentEvaluationMetrics meanSquaredError. + * @member {number} meanSquaredError + * @memberof google.cloud.automl.v1beta1.TextSentimentEvaluationMetrics + * @instance + */ + TextSentimentEvaluationMetrics.prototype.meanSquaredError = 0; + + /** + * TextSentimentEvaluationMetrics linearKappa. + * @member {number} linearKappa + * @memberof google.cloud.automl.v1beta1.TextSentimentEvaluationMetrics + * @instance + */ + TextSentimentEvaluationMetrics.prototype.linearKappa = 0; + + /** + * TextSentimentEvaluationMetrics quadraticKappa. + * @member {number} quadraticKappa + * @memberof google.cloud.automl.v1beta1.TextSentimentEvaluationMetrics + * @instance + */ + TextSentimentEvaluationMetrics.prototype.quadraticKappa = 0; + + /** + * TextSentimentEvaluationMetrics confusionMatrix. + * @member {google.cloud.automl.v1beta1.ClassificationEvaluationMetrics.IConfusionMatrix|null|undefined} confusionMatrix + * @memberof google.cloud.automl.v1beta1.TextSentimentEvaluationMetrics + * @instance + */ + TextSentimentEvaluationMetrics.prototype.confusionMatrix = null; + + /** + * TextSentimentEvaluationMetrics annotationSpecId. + * @member {Array.} annotationSpecId + * @memberof google.cloud.automl.v1beta1.TextSentimentEvaluationMetrics + * @instance + */ + TextSentimentEvaluationMetrics.prototype.annotationSpecId = $util.emptyArray; + + /** + * Creates a new TextSentimentEvaluationMetrics instance using the specified properties. + * @function create + * @memberof google.cloud.automl.v1beta1.TextSentimentEvaluationMetrics + * @static + * @param {google.cloud.automl.v1beta1.ITextSentimentEvaluationMetrics=} [properties] Properties to set + * @returns {google.cloud.automl.v1beta1.TextSentimentEvaluationMetrics} TextSentimentEvaluationMetrics instance + */ + TextSentimentEvaluationMetrics.create = function create(properties) { + return new TextSentimentEvaluationMetrics(properties); + }; + + /** + * Encodes the specified TextSentimentEvaluationMetrics message. Does not implicitly {@link google.cloud.automl.v1beta1.TextSentimentEvaluationMetrics.verify|verify} messages. + * @function encode + * @memberof google.cloud.automl.v1beta1.TextSentimentEvaluationMetrics + * @static + * @param {google.cloud.automl.v1beta1.ITextSentimentEvaluationMetrics} message TextSentimentEvaluationMetrics message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TextSentimentEvaluationMetrics.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.precision != null && Object.hasOwnProperty.call(message, "precision")) + writer.uint32(/* id 1, wireType 5 =*/13).float(message.precision); + if (message.recall != null && Object.hasOwnProperty.call(message, "recall")) + writer.uint32(/* id 2, wireType 5 =*/21).float(message.recall); + if (message.f1Score != null && Object.hasOwnProperty.call(message, "f1Score")) + writer.uint32(/* id 3, wireType 5 =*/29).float(message.f1Score); + if (message.meanAbsoluteError != null && Object.hasOwnProperty.call(message, "meanAbsoluteError")) + writer.uint32(/* id 4, wireType 5 =*/37).float(message.meanAbsoluteError); + if (message.meanSquaredError != null && Object.hasOwnProperty.call(message, "meanSquaredError")) + writer.uint32(/* id 5, wireType 5 =*/45).float(message.meanSquaredError); + if (message.linearKappa != null && Object.hasOwnProperty.call(message, "linearKappa")) + writer.uint32(/* id 6, wireType 5 =*/53).float(message.linearKappa); + if (message.quadraticKappa != null && Object.hasOwnProperty.call(message, "quadraticKappa")) + writer.uint32(/* id 7, wireType 5 =*/61).float(message.quadraticKappa); + if (message.confusionMatrix != null && Object.hasOwnProperty.call(message, "confusionMatrix")) + $root.google.cloud.automl.v1beta1.ClassificationEvaluationMetrics.ConfusionMatrix.encode(message.confusionMatrix, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); + if (message.annotationSpecId != null && message.annotationSpecId.length) + for (var i = 0; i < message.annotationSpecId.length; ++i) + writer.uint32(/* id 9, wireType 2 =*/74).string(message.annotationSpecId[i]); + return writer; + }; + + /** + * Encodes the specified TextSentimentEvaluationMetrics message, length delimited. Does not implicitly {@link google.cloud.automl.v1beta1.TextSentimentEvaluationMetrics.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.automl.v1beta1.TextSentimentEvaluationMetrics + * @static + * @param {google.cloud.automl.v1beta1.ITextSentimentEvaluationMetrics} message TextSentimentEvaluationMetrics message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TextSentimentEvaluationMetrics.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a TextSentimentEvaluationMetrics message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.automl.v1beta1.TextSentimentEvaluationMetrics + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.automl.v1beta1.TextSentimentEvaluationMetrics} TextSentimentEvaluationMetrics + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TextSentimentEvaluationMetrics.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.automl.v1beta1.TextSentimentEvaluationMetrics(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.precision = reader.float(); + break; + } + case 2: { + message.recall = reader.float(); + break; + } + case 3: { + message.f1Score = reader.float(); + break; + } + case 4: { + message.meanAbsoluteError = reader.float(); + break; + } + case 5: { + message.meanSquaredError = reader.float(); + break; + } + case 6: { + message.linearKappa = reader.float(); + break; + } + case 7: { + message.quadraticKappa = reader.float(); + break; + } + case 8: { + message.confusionMatrix = $root.google.cloud.automl.v1beta1.ClassificationEvaluationMetrics.ConfusionMatrix.decode(reader, reader.uint32()); + break; + } + case 9: { + if (!(message.annotationSpecId && message.annotationSpecId.length)) + message.annotationSpecId = []; + message.annotationSpecId.push(reader.string()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a TextSentimentEvaluationMetrics message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.automl.v1beta1.TextSentimentEvaluationMetrics + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.automl.v1beta1.TextSentimentEvaluationMetrics} TextSentimentEvaluationMetrics + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TextSentimentEvaluationMetrics.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a TextSentimentEvaluationMetrics message. + * @function verify + * @memberof google.cloud.automl.v1beta1.TextSentimentEvaluationMetrics + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + TextSentimentEvaluationMetrics.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.precision != null && message.hasOwnProperty("precision")) + if (typeof message.precision !== "number") + return "precision: number expected"; + if (message.recall != null && message.hasOwnProperty("recall")) + if (typeof message.recall !== "number") + return "recall: number expected"; + if (message.f1Score != null && message.hasOwnProperty("f1Score")) + if (typeof message.f1Score !== "number") + return "f1Score: number expected"; + if (message.meanAbsoluteError != null && message.hasOwnProperty("meanAbsoluteError")) + if (typeof message.meanAbsoluteError !== "number") + return "meanAbsoluteError: number expected"; + if (message.meanSquaredError != null && message.hasOwnProperty("meanSquaredError")) + if (typeof message.meanSquaredError !== "number") + return "meanSquaredError: number expected"; + if (message.linearKappa != null && message.hasOwnProperty("linearKappa")) + if (typeof message.linearKappa !== "number") + return "linearKappa: number expected"; + if (message.quadraticKappa != null && message.hasOwnProperty("quadraticKappa")) + if (typeof message.quadraticKappa !== "number") + return "quadraticKappa: number expected"; + if (message.confusionMatrix != null && message.hasOwnProperty("confusionMatrix")) { + var error = $root.google.cloud.automl.v1beta1.ClassificationEvaluationMetrics.ConfusionMatrix.verify(message.confusionMatrix); + if (error) + return "confusionMatrix." + error; + } + if (message.annotationSpecId != null && message.hasOwnProperty("annotationSpecId")) { + if (!Array.isArray(message.annotationSpecId)) + return "annotationSpecId: array expected"; + for (var i = 0; i < message.annotationSpecId.length; ++i) + if (!$util.isString(message.annotationSpecId[i])) + return "annotationSpecId: string[] expected"; + } + return null; + }; + + /** + * Creates a TextSentimentEvaluationMetrics message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.automl.v1beta1.TextSentimentEvaluationMetrics + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.automl.v1beta1.TextSentimentEvaluationMetrics} TextSentimentEvaluationMetrics + */ + TextSentimentEvaluationMetrics.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.automl.v1beta1.TextSentimentEvaluationMetrics) + return object; + var message = new $root.google.cloud.automl.v1beta1.TextSentimentEvaluationMetrics(); + if (object.precision != null) + message.precision = Number(object.precision); + if (object.recall != null) + message.recall = Number(object.recall); + if (object.f1Score != null) + message.f1Score = Number(object.f1Score); + if (object.meanAbsoluteError != null) + message.meanAbsoluteError = Number(object.meanAbsoluteError); + if (object.meanSquaredError != null) + message.meanSquaredError = Number(object.meanSquaredError); + if (object.linearKappa != null) + message.linearKappa = Number(object.linearKappa); + if (object.quadraticKappa != null) + message.quadraticKappa = Number(object.quadraticKappa); + if (object.confusionMatrix != null) { + if (typeof object.confusionMatrix !== "object") + throw TypeError(".google.cloud.automl.v1beta1.TextSentimentEvaluationMetrics.confusionMatrix: object expected"); + message.confusionMatrix = $root.google.cloud.automl.v1beta1.ClassificationEvaluationMetrics.ConfusionMatrix.fromObject(object.confusionMatrix); + } + if (object.annotationSpecId) { + if (!Array.isArray(object.annotationSpecId)) + throw TypeError(".google.cloud.automl.v1beta1.TextSentimentEvaluationMetrics.annotationSpecId: array expected"); + message.annotationSpecId = []; + for (var i = 0; i < object.annotationSpecId.length; ++i) + message.annotationSpecId[i] = String(object.annotationSpecId[i]); + } + return message; + }; + + /** + * Creates a plain object from a TextSentimentEvaluationMetrics message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.automl.v1beta1.TextSentimentEvaluationMetrics + * @static + * @param {google.cloud.automl.v1beta1.TextSentimentEvaluationMetrics} message TextSentimentEvaluationMetrics + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + TextSentimentEvaluationMetrics.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.annotationSpecId = []; + if (options.defaults) { + object.precision = 0; + object.recall = 0; + object.f1Score = 0; + object.meanAbsoluteError = 0; + object.meanSquaredError = 0; + object.linearKappa = 0; + object.quadraticKappa = 0; + object.confusionMatrix = null; + } + if (message.precision != null && message.hasOwnProperty("precision")) + object.precision = options.json && !isFinite(message.precision) ? String(message.precision) : message.precision; + if (message.recall != null && message.hasOwnProperty("recall")) + object.recall = options.json && !isFinite(message.recall) ? String(message.recall) : message.recall; + if (message.f1Score != null && message.hasOwnProperty("f1Score")) + object.f1Score = options.json && !isFinite(message.f1Score) ? String(message.f1Score) : message.f1Score; + if (message.meanAbsoluteError != null && message.hasOwnProperty("meanAbsoluteError")) + object.meanAbsoluteError = options.json && !isFinite(message.meanAbsoluteError) ? String(message.meanAbsoluteError) : message.meanAbsoluteError; + if (message.meanSquaredError != null && message.hasOwnProperty("meanSquaredError")) + object.meanSquaredError = options.json && !isFinite(message.meanSquaredError) ? String(message.meanSquaredError) : message.meanSquaredError; + if (message.linearKappa != null && message.hasOwnProperty("linearKappa")) + object.linearKappa = options.json && !isFinite(message.linearKappa) ? String(message.linearKappa) : message.linearKappa; + if (message.quadraticKappa != null && message.hasOwnProperty("quadraticKappa")) + object.quadraticKappa = options.json && !isFinite(message.quadraticKappa) ? String(message.quadraticKappa) : message.quadraticKappa; + if (message.confusionMatrix != null && message.hasOwnProperty("confusionMatrix")) + object.confusionMatrix = $root.google.cloud.automl.v1beta1.ClassificationEvaluationMetrics.ConfusionMatrix.toObject(message.confusionMatrix, options); + if (message.annotationSpecId && message.annotationSpecId.length) { + object.annotationSpecId = []; + for (var j = 0; j < message.annotationSpecId.length; ++j) + object.annotationSpecId[j] = message.annotationSpecId[j]; + } + return object; + }; + + /** + * Converts this TextSentimentEvaluationMetrics to JSON. + * @function toJSON + * @memberof google.cloud.automl.v1beta1.TextSentimentEvaluationMetrics + * @instance + * @returns {Object.} JSON object + */ + TextSentimentEvaluationMetrics.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for TextSentimentEvaluationMetrics + * @function getTypeUrl + * @memberof google.cloud.automl.v1beta1.TextSentimentEvaluationMetrics + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TextSentimentEvaluationMetrics.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.automl.v1beta1.TextSentimentEvaluationMetrics"; + }; + + return TextSentimentEvaluationMetrics; + })(); + + v1beta1.TranslationDatasetMetadata = (function() { + + /** + * Properties of a TranslationDatasetMetadata. + * @memberof google.cloud.automl.v1beta1 + * @interface ITranslationDatasetMetadata + * @property {string|null} [sourceLanguageCode] TranslationDatasetMetadata sourceLanguageCode + * @property {string|null} [targetLanguageCode] TranslationDatasetMetadata targetLanguageCode + */ + + /** + * Constructs a new TranslationDatasetMetadata. + * @memberof google.cloud.automl.v1beta1 + * @classdesc Represents a TranslationDatasetMetadata. + * @implements ITranslationDatasetMetadata + * @constructor + * @param {google.cloud.automl.v1beta1.ITranslationDatasetMetadata=} [properties] Properties to set + */ + function TranslationDatasetMetadata(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * TranslationDatasetMetadata sourceLanguageCode. + * @member {string} sourceLanguageCode + * @memberof google.cloud.automl.v1beta1.TranslationDatasetMetadata + * @instance + */ + TranslationDatasetMetadata.prototype.sourceLanguageCode = ""; + + /** + * TranslationDatasetMetadata targetLanguageCode. + * @member {string} targetLanguageCode + * @memberof google.cloud.automl.v1beta1.TranslationDatasetMetadata + * @instance + */ + TranslationDatasetMetadata.prototype.targetLanguageCode = ""; + + /** + * Creates a new TranslationDatasetMetadata instance using the specified properties. + * @function create + * @memberof google.cloud.automl.v1beta1.TranslationDatasetMetadata + * @static + * @param {google.cloud.automl.v1beta1.ITranslationDatasetMetadata=} [properties] Properties to set + * @returns {google.cloud.automl.v1beta1.TranslationDatasetMetadata} TranslationDatasetMetadata instance + */ + TranslationDatasetMetadata.create = function create(properties) { + return new TranslationDatasetMetadata(properties); + }; + + /** + * Encodes the specified TranslationDatasetMetadata message. Does not implicitly {@link google.cloud.automl.v1beta1.TranslationDatasetMetadata.verify|verify} messages. + * @function encode + * @memberof google.cloud.automl.v1beta1.TranslationDatasetMetadata + * @static + * @param {google.cloud.automl.v1beta1.ITranslationDatasetMetadata} message TranslationDatasetMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TranslationDatasetMetadata.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.sourceLanguageCode != null && Object.hasOwnProperty.call(message, "sourceLanguageCode")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.sourceLanguageCode); + if (message.targetLanguageCode != null && Object.hasOwnProperty.call(message, "targetLanguageCode")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.targetLanguageCode); + return writer; + }; + + /** + * Encodes the specified TranslationDatasetMetadata message, length delimited. Does not implicitly {@link google.cloud.automl.v1beta1.TranslationDatasetMetadata.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.automl.v1beta1.TranslationDatasetMetadata + * @static + * @param {google.cloud.automl.v1beta1.ITranslationDatasetMetadata} message TranslationDatasetMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TranslationDatasetMetadata.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a TranslationDatasetMetadata message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.automl.v1beta1.TranslationDatasetMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.automl.v1beta1.TranslationDatasetMetadata} TranslationDatasetMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TranslationDatasetMetadata.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.automl.v1beta1.TranslationDatasetMetadata(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.sourceLanguageCode = reader.string(); + break; + } + case 2: { + message.targetLanguageCode = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a TranslationDatasetMetadata message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.automl.v1beta1.TranslationDatasetMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.automl.v1beta1.TranslationDatasetMetadata} TranslationDatasetMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TranslationDatasetMetadata.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a TranslationDatasetMetadata message. + * @function verify + * @memberof google.cloud.automl.v1beta1.TranslationDatasetMetadata + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + TranslationDatasetMetadata.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.sourceLanguageCode != null && message.hasOwnProperty("sourceLanguageCode")) + if (!$util.isString(message.sourceLanguageCode)) + return "sourceLanguageCode: string expected"; + if (message.targetLanguageCode != null && message.hasOwnProperty("targetLanguageCode")) + if (!$util.isString(message.targetLanguageCode)) + return "targetLanguageCode: string expected"; + return null; + }; + + /** + * Creates a TranslationDatasetMetadata message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.automl.v1beta1.TranslationDatasetMetadata + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.automl.v1beta1.TranslationDatasetMetadata} TranslationDatasetMetadata + */ + TranslationDatasetMetadata.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.automl.v1beta1.TranslationDatasetMetadata) + return object; + var message = new $root.google.cloud.automl.v1beta1.TranslationDatasetMetadata(); + if (object.sourceLanguageCode != null) + message.sourceLanguageCode = String(object.sourceLanguageCode); + if (object.targetLanguageCode != null) + message.targetLanguageCode = String(object.targetLanguageCode); + return message; + }; + + /** + * Creates a plain object from a TranslationDatasetMetadata message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.automl.v1beta1.TranslationDatasetMetadata + * @static + * @param {google.cloud.automl.v1beta1.TranslationDatasetMetadata} message TranslationDatasetMetadata + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + TranslationDatasetMetadata.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.sourceLanguageCode = ""; + object.targetLanguageCode = ""; + } + if (message.sourceLanguageCode != null && message.hasOwnProperty("sourceLanguageCode")) + object.sourceLanguageCode = message.sourceLanguageCode; + if (message.targetLanguageCode != null && message.hasOwnProperty("targetLanguageCode")) + object.targetLanguageCode = message.targetLanguageCode; + return object; + }; + + /** + * Converts this TranslationDatasetMetadata to JSON. + * @function toJSON + * @memberof google.cloud.automl.v1beta1.TranslationDatasetMetadata + * @instance + * @returns {Object.} JSON object + */ + TranslationDatasetMetadata.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for TranslationDatasetMetadata + * @function getTypeUrl + * @memberof google.cloud.automl.v1beta1.TranslationDatasetMetadata + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TranslationDatasetMetadata.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.automl.v1beta1.TranslationDatasetMetadata"; + }; + + return TranslationDatasetMetadata; + })(); + + v1beta1.TranslationEvaluationMetrics = (function() { + + /** + * Properties of a TranslationEvaluationMetrics. + * @memberof google.cloud.automl.v1beta1 + * @interface ITranslationEvaluationMetrics + * @property {number|null} [bleuScore] TranslationEvaluationMetrics bleuScore + * @property {number|null} [baseBleuScore] TranslationEvaluationMetrics baseBleuScore + */ + + /** + * Constructs a new TranslationEvaluationMetrics. + * @memberof google.cloud.automl.v1beta1 + * @classdesc Represents a TranslationEvaluationMetrics. + * @implements ITranslationEvaluationMetrics + * @constructor + * @param {google.cloud.automl.v1beta1.ITranslationEvaluationMetrics=} [properties] Properties to set + */ + function TranslationEvaluationMetrics(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * TranslationEvaluationMetrics bleuScore. + * @member {number} bleuScore + * @memberof google.cloud.automl.v1beta1.TranslationEvaluationMetrics + * @instance + */ + TranslationEvaluationMetrics.prototype.bleuScore = 0; + + /** + * TranslationEvaluationMetrics baseBleuScore. + * @member {number} baseBleuScore + * @memberof google.cloud.automl.v1beta1.TranslationEvaluationMetrics + * @instance + */ + TranslationEvaluationMetrics.prototype.baseBleuScore = 0; + + /** + * Creates a new TranslationEvaluationMetrics instance using the specified properties. + * @function create + * @memberof google.cloud.automl.v1beta1.TranslationEvaluationMetrics + * @static + * @param {google.cloud.automl.v1beta1.ITranslationEvaluationMetrics=} [properties] Properties to set + * @returns {google.cloud.automl.v1beta1.TranslationEvaluationMetrics} TranslationEvaluationMetrics instance + */ + TranslationEvaluationMetrics.create = function create(properties) { + return new TranslationEvaluationMetrics(properties); + }; + + /** + * Encodes the specified TranslationEvaluationMetrics message. Does not implicitly {@link google.cloud.automl.v1beta1.TranslationEvaluationMetrics.verify|verify} messages. + * @function encode + * @memberof google.cloud.automl.v1beta1.TranslationEvaluationMetrics + * @static + * @param {google.cloud.automl.v1beta1.ITranslationEvaluationMetrics} message TranslationEvaluationMetrics message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TranslationEvaluationMetrics.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.bleuScore != null && Object.hasOwnProperty.call(message, "bleuScore")) + writer.uint32(/* id 1, wireType 1 =*/9).double(message.bleuScore); + if (message.baseBleuScore != null && Object.hasOwnProperty.call(message, "baseBleuScore")) + writer.uint32(/* id 2, wireType 1 =*/17).double(message.baseBleuScore); + return writer; + }; + + /** + * Encodes the specified TranslationEvaluationMetrics message, length delimited. Does not implicitly {@link google.cloud.automl.v1beta1.TranslationEvaluationMetrics.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.automl.v1beta1.TranslationEvaluationMetrics + * @static + * @param {google.cloud.automl.v1beta1.ITranslationEvaluationMetrics} message TranslationEvaluationMetrics message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TranslationEvaluationMetrics.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a TranslationEvaluationMetrics message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.automl.v1beta1.TranslationEvaluationMetrics + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.automl.v1beta1.TranslationEvaluationMetrics} TranslationEvaluationMetrics + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TranslationEvaluationMetrics.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.automl.v1beta1.TranslationEvaluationMetrics(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.bleuScore = reader.double(); + break; + } + case 2: { + message.baseBleuScore = reader.double(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a TranslationEvaluationMetrics message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.automl.v1beta1.TranslationEvaluationMetrics + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.automl.v1beta1.TranslationEvaluationMetrics} TranslationEvaluationMetrics + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TranslationEvaluationMetrics.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a TranslationEvaluationMetrics message. + * @function verify + * @memberof google.cloud.automl.v1beta1.TranslationEvaluationMetrics + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + TranslationEvaluationMetrics.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.bleuScore != null && message.hasOwnProperty("bleuScore")) + if (typeof message.bleuScore !== "number") + return "bleuScore: number expected"; + if (message.baseBleuScore != null && message.hasOwnProperty("baseBleuScore")) + if (typeof message.baseBleuScore !== "number") + return "baseBleuScore: number expected"; + return null; + }; + + /** + * Creates a TranslationEvaluationMetrics message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.automl.v1beta1.TranslationEvaluationMetrics + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.automl.v1beta1.TranslationEvaluationMetrics} TranslationEvaluationMetrics + */ + TranslationEvaluationMetrics.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.automl.v1beta1.TranslationEvaluationMetrics) + return object; + var message = new $root.google.cloud.automl.v1beta1.TranslationEvaluationMetrics(); + if (object.bleuScore != null) + message.bleuScore = Number(object.bleuScore); + if (object.baseBleuScore != null) + message.baseBleuScore = Number(object.baseBleuScore); + return message; + }; + + /** + * Creates a plain object from a TranslationEvaluationMetrics message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.automl.v1beta1.TranslationEvaluationMetrics + * @static + * @param {google.cloud.automl.v1beta1.TranslationEvaluationMetrics} message TranslationEvaluationMetrics + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + TranslationEvaluationMetrics.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.bleuScore = 0; + object.baseBleuScore = 0; + } + if (message.bleuScore != null && message.hasOwnProperty("bleuScore")) + object.bleuScore = options.json && !isFinite(message.bleuScore) ? String(message.bleuScore) : message.bleuScore; + if (message.baseBleuScore != null && message.hasOwnProperty("baseBleuScore")) + object.baseBleuScore = options.json && !isFinite(message.baseBleuScore) ? String(message.baseBleuScore) : message.baseBleuScore; + return object; + }; + + /** + * Converts this TranslationEvaluationMetrics to JSON. + * @function toJSON + * @memberof google.cloud.automl.v1beta1.TranslationEvaluationMetrics + * @instance + * @returns {Object.} JSON object + */ + TranslationEvaluationMetrics.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for TranslationEvaluationMetrics + * @function getTypeUrl + * @memberof google.cloud.automl.v1beta1.TranslationEvaluationMetrics + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TranslationEvaluationMetrics.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.automl.v1beta1.TranslationEvaluationMetrics"; + }; + + return TranslationEvaluationMetrics; + })(); + + v1beta1.TranslationModelMetadata = (function() { + + /** + * Properties of a TranslationModelMetadata. + * @memberof google.cloud.automl.v1beta1 + * @interface ITranslationModelMetadata + * @property {string|null} [baseModel] TranslationModelMetadata baseModel + * @property {string|null} [sourceLanguageCode] TranslationModelMetadata sourceLanguageCode + * @property {string|null} [targetLanguageCode] TranslationModelMetadata targetLanguageCode + */ + + /** + * Constructs a new TranslationModelMetadata. + * @memberof google.cloud.automl.v1beta1 + * @classdesc Represents a TranslationModelMetadata. + * @implements ITranslationModelMetadata + * @constructor + * @param {google.cloud.automl.v1beta1.ITranslationModelMetadata=} [properties] Properties to set + */ + function TranslationModelMetadata(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * TranslationModelMetadata baseModel. + * @member {string} baseModel + * @memberof google.cloud.automl.v1beta1.TranslationModelMetadata + * @instance + */ + TranslationModelMetadata.prototype.baseModel = ""; + + /** + * TranslationModelMetadata sourceLanguageCode. + * @member {string} sourceLanguageCode + * @memberof google.cloud.automl.v1beta1.TranslationModelMetadata + * @instance + */ + TranslationModelMetadata.prototype.sourceLanguageCode = ""; + + /** + * TranslationModelMetadata targetLanguageCode. + * @member {string} targetLanguageCode + * @memberof google.cloud.automl.v1beta1.TranslationModelMetadata + * @instance + */ + TranslationModelMetadata.prototype.targetLanguageCode = ""; + + /** + * Creates a new TranslationModelMetadata instance using the specified properties. + * @function create + * @memberof google.cloud.automl.v1beta1.TranslationModelMetadata + * @static + * @param {google.cloud.automl.v1beta1.ITranslationModelMetadata=} [properties] Properties to set + * @returns {google.cloud.automl.v1beta1.TranslationModelMetadata} TranslationModelMetadata instance + */ + TranslationModelMetadata.create = function create(properties) { + return new TranslationModelMetadata(properties); + }; + + /** + * Encodes the specified TranslationModelMetadata message. Does not implicitly {@link google.cloud.automl.v1beta1.TranslationModelMetadata.verify|verify} messages. + * @function encode + * @memberof google.cloud.automl.v1beta1.TranslationModelMetadata + * @static + * @param {google.cloud.automl.v1beta1.ITranslationModelMetadata} message TranslationModelMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TranslationModelMetadata.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.baseModel != null && Object.hasOwnProperty.call(message, "baseModel")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.baseModel); + if (message.sourceLanguageCode != null && Object.hasOwnProperty.call(message, "sourceLanguageCode")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.sourceLanguageCode); + if (message.targetLanguageCode != null && Object.hasOwnProperty.call(message, "targetLanguageCode")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.targetLanguageCode); + return writer; + }; + + /** + * Encodes the specified TranslationModelMetadata message, length delimited. Does not implicitly {@link google.cloud.automl.v1beta1.TranslationModelMetadata.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.automl.v1beta1.TranslationModelMetadata + * @static + * @param {google.cloud.automl.v1beta1.ITranslationModelMetadata} message TranslationModelMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TranslationModelMetadata.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a TranslationModelMetadata message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.automl.v1beta1.TranslationModelMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.automl.v1beta1.TranslationModelMetadata} TranslationModelMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TranslationModelMetadata.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.automl.v1beta1.TranslationModelMetadata(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.baseModel = reader.string(); + break; + } + case 2: { + message.sourceLanguageCode = reader.string(); + break; + } + case 3: { + message.targetLanguageCode = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a TranslationModelMetadata message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.automl.v1beta1.TranslationModelMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.automl.v1beta1.TranslationModelMetadata} TranslationModelMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TranslationModelMetadata.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a TranslationModelMetadata message. + * @function verify + * @memberof google.cloud.automl.v1beta1.TranslationModelMetadata + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + TranslationModelMetadata.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.baseModel != null && message.hasOwnProperty("baseModel")) + if (!$util.isString(message.baseModel)) + return "baseModel: string expected"; + if (message.sourceLanguageCode != null && message.hasOwnProperty("sourceLanguageCode")) + if (!$util.isString(message.sourceLanguageCode)) + return "sourceLanguageCode: string expected"; + if (message.targetLanguageCode != null && message.hasOwnProperty("targetLanguageCode")) + if (!$util.isString(message.targetLanguageCode)) + return "targetLanguageCode: string expected"; + return null; + }; + + /** + * Creates a TranslationModelMetadata message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.automl.v1beta1.TranslationModelMetadata + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.automl.v1beta1.TranslationModelMetadata} TranslationModelMetadata + */ + TranslationModelMetadata.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.automl.v1beta1.TranslationModelMetadata) + return object; + var message = new $root.google.cloud.automl.v1beta1.TranslationModelMetadata(); + if (object.baseModel != null) + message.baseModel = String(object.baseModel); + if (object.sourceLanguageCode != null) + message.sourceLanguageCode = String(object.sourceLanguageCode); + if (object.targetLanguageCode != null) + message.targetLanguageCode = String(object.targetLanguageCode); + return message; + }; + + /** + * Creates a plain object from a TranslationModelMetadata message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.automl.v1beta1.TranslationModelMetadata + * @static + * @param {google.cloud.automl.v1beta1.TranslationModelMetadata} message TranslationModelMetadata + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + TranslationModelMetadata.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.baseModel = ""; + object.sourceLanguageCode = ""; + object.targetLanguageCode = ""; + } + if (message.baseModel != null && message.hasOwnProperty("baseModel")) + object.baseModel = message.baseModel; + if (message.sourceLanguageCode != null && message.hasOwnProperty("sourceLanguageCode")) + object.sourceLanguageCode = message.sourceLanguageCode; + if (message.targetLanguageCode != null && message.hasOwnProperty("targetLanguageCode")) + object.targetLanguageCode = message.targetLanguageCode; + return object; + }; + + /** + * Converts this TranslationModelMetadata to JSON. + * @function toJSON + * @memberof google.cloud.automl.v1beta1.TranslationModelMetadata + * @instance + * @returns {Object.} JSON object + */ + TranslationModelMetadata.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for TranslationModelMetadata + * @function getTypeUrl + * @memberof google.cloud.automl.v1beta1.TranslationModelMetadata + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TranslationModelMetadata.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.automl.v1beta1.TranslationModelMetadata"; + }; + + return TranslationModelMetadata; + })(); + + v1beta1.TranslationAnnotation = (function() { + + /** + * Properties of a TranslationAnnotation. + * @memberof google.cloud.automl.v1beta1 + * @interface ITranslationAnnotation + * @property {google.cloud.automl.v1beta1.ITextSnippet|null} [translatedContent] TranslationAnnotation translatedContent + */ + + /** + * Constructs a new TranslationAnnotation. + * @memberof google.cloud.automl.v1beta1 + * @classdesc Represents a TranslationAnnotation. + * @implements ITranslationAnnotation + * @constructor + * @param {google.cloud.automl.v1beta1.ITranslationAnnotation=} [properties] Properties to set + */ + function TranslationAnnotation(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * TranslationAnnotation translatedContent. + * @member {google.cloud.automl.v1beta1.ITextSnippet|null|undefined} translatedContent + * @memberof google.cloud.automl.v1beta1.TranslationAnnotation + * @instance + */ + TranslationAnnotation.prototype.translatedContent = null; + + /** + * Creates a new TranslationAnnotation instance using the specified properties. + * @function create + * @memberof google.cloud.automl.v1beta1.TranslationAnnotation + * @static + * @param {google.cloud.automl.v1beta1.ITranslationAnnotation=} [properties] Properties to set + * @returns {google.cloud.automl.v1beta1.TranslationAnnotation} TranslationAnnotation instance + */ + TranslationAnnotation.create = function create(properties) { + return new TranslationAnnotation(properties); + }; + + /** + * Encodes the specified TranslationAnnotation message. Does not implicitly {@link google.cloud.automl.v1beta1.TranslationAnnotation.verify|verify} messages. + * @function encode + * @memberof google.cloud.automl.v1beta1.TranslationAnnotation + * @static + * @param {google.cloud.automl.v1beta1.ITranslationAnnotation} message TranslationAnnotation message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TranslationAnnotation.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.translatedContent != null && Object.hasOwnProperty.call(message, "translatedContent")) + $root.google.cloud.automl.v1beta1.TextSnippet.encode(message.translatedContent, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified TranslationAnnotation message, length delimited. Does not implicitly {@link google.cloud.automl.v1beta1.TranslationAnnotation.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.automl.v1beta1.TranslationAnnotation + * @static + * @param {google.cloud.automl.v1beta1.ITranslationAnnotation} message TranslationAnnotation message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TranslationAnnotation.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a TranslationAnnotation message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.automl.v1beta1.TranslationAnnotation + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.automl.v1beta1.TranslationAnnotation} TranslationAnnotation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TranslationAnnotation.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.automl.v1beta1.TranslationAnnotation(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.translatedContent = $root.google.cloud.automl.v1beta1.TextSnippet.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a TranslationAnnotation message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.automl.v1beta1.TranslationAnnotation + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.automl.v1beta1.TranslationAnnotation} TranslationAnnotation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TranslationAnnotation.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a TranslationAnnotation message. + * @function verify + * @memberof google.cloud.automl.v1beta1.TranslationAnnotation + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + TranslationAnnotation.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.translatedContent != null && message.hasOwnProperty("translatedContent")) { + var error = $root.google.cloud.automl.v1beta1.TextSnippet.verify(message.translatedContent); + if (error) + return "translatedContent." + error; + } + return null; + }; + + /** + * Creates a TranslationAnnotation message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.automl.v1beta1.TranslationAnnotation + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.automl.v1beta1.TranslationAnnotation} TranslationAnnotation + */ + TranslationAnnotation.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.automl.v1beta1.TranslationAnnotation) + return object; + var message = new $root.google.cloud.automl.v1beta1.TranslationAnnotation(); + if (object.translatedContent != null) { + if (typeof object.translatedContent !== "object") + throw TypeError(".google.cloud.automl.v1beta1.TranslationAnnotation.translatedContent: object expected"); + message.translatedContent = $root.google.cloud.automl.v1beta1.TextSnippet.fromObject(object.translatedContent); + } + return message; + }; + + /** + * Creates a plain object from a TranslationAnnotation message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.automl.v1beta1.TranslationAnnotation + * @static + * @param {google.cloud.automl.v1beta1.TranslationAnnotation} message TranslationAnnotation + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + TranslationAnnotation.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.translatedContent = null; + if (message.translatedContent != null && message.hasOwnProperty("translatedContent")) + object.translatedContent = $root.google.cloud.automl.v1beta1.TextSnippet.toObject(message.translatedContent, options); + return object; + }; + + /** + * Converts this TranslationAnnotation to JSON. + * @function toJSON + * @memberof google.cloud.automl.v1beta1.TranslationAnnotation + * @instance + * @returns {Object.} JSON object + */ + TranslationAnnotation.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for TranslationAnnotation + * @function getTypeUrl + * @memberof google.cloud.automl.v1beta1.TranslationAnnotation + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TranslationAnnotation.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.automl.v1beta1.TranslationAnnotation"; + }; + + return TranslationAnnotation; + })(); + + v1beta1.AnnotationSpec = (function() { + + /** + * Properties of an AnnotationSpec. + * @memberof google.cloud.automl.v1beta1 + * @interface IAnnotationSpec + * @property {string|null} [name] AnnotationSpec name + * @property {string|null} [displayName] AnnotationSpec displayName + * @property {number|null} [exampleCount] AnnotationSpec exampleCount + */ + + /** + * Constructs a new AnnotationSpec. + * @memberof google.cloud.automl.v1beta1 + * @classdesc Represents an AnnotationSpec. + * @implements IAnnotationSpec + * @constructor + * @param {google.cloud.automl.v1beta1.IAnnotationSpec=} [properties] Properties to set + */ + function AnnotationSpec(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * AnnotationSpec name. + * @member {string} name + * @memberof google.cloud.automl.v1beta1.AnnotationSpec + * @instance + */ + AnnotationSpec.prototype.name = ""; + + /** + * AnnotationSpec displayName. + * @member {string} displayName + * @memberof google.cloud.automl.v1beta1.AnnotationSpec + * @instance + */ + AnnotationSpec.prototype.displayName = ""; + + /** + * AnnotationSpec exampleCount. + * @member {number} exampleCount + * @memberof google.cloud.automl.v1beta1.AnnotationSpec + * @instance + */ + AnnotationSpec.prototype.exampleCount = 0; + + /** + * Creates a new AnnotationSpec instance using the specified properties. + * @function create + * @memberof google.cloud.automl.v1beta1.AnnotationSpec + * @static + * @param {google.cloud.automl.v1beta1.IAnnotationSpec=} [properties] Properties to set + * @returns {google.cloud.automl.v1beta1.AnnotationSpec} AnnotationSpec instance + */ + AnnotationSpec.create = function create(properties) { + return new AnnotationSpec(properties); + }; + + /** + * Encodes the specified AnnotationSpec message. Does not implicitly {@link google.cloud.automl.v1beta1.AnnotationSpec.verify|verify} messages. + * @function encode + * @memberof google.cloud.automl.v1beta1.AnnotationSpec + * @static + * @param {google.cloud.automl.v1beta1.IAnnotationSpec} message AnnotationSpec message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AnnotationSpec.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.displayName != null && Object.hasOwnProperty.call(message, "displayName")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.displayName); + if (message.exampleCount != null && Object.hasOwnProperty.call(message, "exampleCount")) + writer.uint32(/* id 9, wireType 0 =*/72).int32(message.exampleCount); + return writer; + }; + + /** + * Encodes the specified AnnotationSpec message, length delimited. Does not implicitly {@link google.cloud.automl.v1beta1.AnnotationSpec.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.automl.v1beta1.AnnotationSpec + * @static + * @param {google.cloud.automl.v1beta1.IAnnotationSpec} message AnnotationSpec message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AnnotationSpec.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an AnnotationSpec message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.automl.v1beta1.AnnotationSpec + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.automl.v1beta1.AnnotationSpec} AnnotationSpec + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AnnotationSpec.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.automl.v1beta1.AnnotationSpec(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.displayName = reader.string(); + break; + } + case 9: { + message.exampleCount = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an AnnotationSpec message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.automl.v1beta1.AnnotationSpec + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.automl.v1beta1.AnnotationSpec} AnnotationSpec + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AnnotationSpec.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an AnnotationSpec message. + * @function verify + * @memberof google.cloud.automl.v1beta1.AnnotationSpec + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + AnnotationSpec.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.displayName != null && message.hasOwnProperty("displayName")) + if (!$util.isString(message.displayName)) + return "displayName: string expected"; + if (message.exampleCount != null && message.hasOwnProperty("exampleCount")) + if (!$util.isInteger(message.exampleCount)) + return "exampleCount: integer expected"; + return null; + }; + + /** + * Creates an AnnotationSpec message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.automl.v1beta1.AnnotationSpec + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.automl.v1beta1.AnnotationSpec} AnnotationSpec + */ + AnnotationSpec.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.automl.v1beta1.AnnotationSpec) + return object; + var message = new $root.google.cloud.automl.v1beta1.AnnotationSpec(); + if (object.name != null) + message.name = String(object.name); + if (object.displayName != null) + message.displayName = String(object.displayName); + if (object.exampleCount != null) + message.exampleCount = object.exampleCount | 0; + return message; + }; + + /** + * Creates a plain object from an AnnotationSpec message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.automl.v1beta1.AnnotationSpec + * @static + * @param {google.cloud.automl.v1beta1.AnnotationSpec} message AnnotationSpec + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + AnnotationSpec.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.displayName = ""; + object.exampleCount = 0; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.displayName != null && message.hasOwnProperty("displayName")) + object.displayName = message.displayName; + if (message.exampleCount != null && message.hasOwnProperty("exampleCount")) + object.exampleCount = message.exampleCount; + return object; + }; + + /** + * Converts this AnnotationSpec to JSON. + * @function toJSON + * @memberof google.cloud.automl.v1beta1.AnnotationSpec + * @instance + * @returns {Object.} JSON object + */ + AnnotationSpec.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for AnnotationSpec + * @function getTypeUrl + * @memberof google.cloud.automl.v1beta1.AnnotationSpec + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + AnnotationSpec.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.automl.v1beta1.AnnotationSpec"; + }; + + return AnnotationSpec; + })(); + + v1beta1.Dataset = (function() { + + /** + * Properties of a Dataset. + * @memberof google.cloud.automl.v1beta1 + * @interface IDataset + * @property {google.cloud.automl.v1beta1.ITranslationDatasetMetadata|null} [translationDatasetMetadata] Dataset translationDatasetMetadata + * @property {google.cloud.automl.v1beta1.IImageClassificationDatasetMetadata|null} [imageClassificationDatasetMetadata] Dataset imageClassificationDatasetMetadata + * @property {google.cloud.automl.v1beta1.ITextClassificationDatasetMetadata|null} [textClassificationDatasetMetadata] Dataset textClassificationDatasetMetadata + * @property {google.cloud.automl.v1beta1.IImageObjectDetectionDatasetMetadata|null} [imageObjectDetectionDatasetMetadata] Dataset imageObjectDetectionDatasetMetadata + * @property {google.cloud.automl.v1beta1.IVideoClassificationDatasetMetadata|null} [videoClassificationDatasetMetadata] Dataset videoClassificationDatasetMetadata + * @property {google.cloud.automl.v1beta1.IVideoObjectTrackingDatasetMetadata|null} [videoObjectTrackingDatasetMetadata] Dataset videoObjectTrackingDatasetMetadata + * @property {google.cloud.automl.v1beta1.ITextExtractionDatasetMetadata|null} [textExtractionDatasetMetadata] Dataset textExtractionDatasetMetadata + * @property {google.cloud.automl.v1beta1.ITextSentimentDatasetMetadata|null} [textSentimentDatasetMetadata] Dataset textSentimentDatasetMetadata + * @property {google.cloud.automl.v1beta1.ITablesDatasetMetadata|null} [tablesDatasetMetadata] Dataset tablesDatasetMetadata + * @property {string|null} [name] Dataset name + * @property {string|null} [displayName] Dataset displayName + * @property {string|null} [description] Dataset description + * @property {number|null} [exampleCount] Dataset exampleCount + * @property {google.protobuf.ITimestamp|null} [createTime] Dataset createTime + * @property {string|null} [etag] Dataset etag + */ + + /** + * Constructs a new Dataset. + * @memberof google.cloud.automl.v1beta1 + * @classdesc Represents a Dataset. + * @implements IDataset + * @constructor + * @param {google.cloud.automl.v1beta1.IDataset=} [properties] Properties to set + */ + function Dataset(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Dataset translationDatasetMetadata. + * @member {google.cloud.automl.v1beta1.ITranslationDatasetMetadata|null|undefined} translationDatasetMetadata + * @memberof google.cloud.automl.v1beta1.Dataset + * @instance + */ + Dataset.prototype.translationDatasetMetadata = null; + + /** + * Dataset imageClassificationDatasetMetadata. + * @member {google.cloud.automl.v1beta1.IImageClassificationDatasetMetadata|null|undefined} imageClassificationDatasetMetadata + * @memberof google.cloud.automl.v1beta1.Dataset + * @instance + */ + Dataset.prototype.imageClassificationDatasetMetadata = null; + + /** + * Dataset textClassificationDatasetMetadata. + * @member {google.cloud.automl.v1beta1.ITextClassificationDatasetMetadata|null|undefined} textClassificationDatasetMetadata + * @memberof google.cloud.automl.v1beta1.Dataset + * @instance + */ + Dataset.prototype.textClassificationDatasetMetadata = null; + + /** + * Dataset imageObjectDetectionDatasetMetadata. + * @member {google.cloud.automl.v1beta1.IImageObjectDetectionDatasetMetadata|null|undefined} imageObjectDetectionDatasetMetadata + * @memberof google.cloud.automl.v1beta1.Dataset + * @instance + */ + Dataset.prototype.imageObjectDetectionDatasetMetadata = null; + + /** + * Dataset videoClassificationDatasetMetadata. + * @member {google.cloud.automl.v1beta1.IVideoClassificationDatasetMetadata|null|undefined} videoClassificationDatasetMetadata + * @memberof google.cloud.automl.v1beta1.Dataset + * @instance + */ + Dataset.prototype.videoClassificationDatasetMetadata = null; + + /** + * Dataset videoObjectTrackingDatasetMetadata. + * @member {google.cloud.automl.v1beta1.IVideoObjectTrackingDatasetMetadata|null|undefined} videoObjectTrackingDatasetMetadata + * @memberof google.cloud.automl.v1beta1.Dataset + * @instance + */ + Dataset.prototype.videoObjectTrackingDatasetMetadata = null; + + /** + * Dataset textExtractionDatasetMetadata. + * @member {google.cloud.automl.v1beta1.ITextExtractionDatasetMetadata|null|undefined} textExtractionDatasetMetadata + * @memberof google.cloud.automl.v1beta1.Dataset + * @instance + */ + Dataset.prototype.textExtractionDatasetMetadata = null; + + /** + * Dataset textSentimentDatasetMetadata. + * @member {google.cloud.automl.v1beta1.ITextSentimentDatasetMetadata|null|undefined} textSentimentDatasetMetadata + * @memberof google.cloud.automl.v1beta1.Dataset + * @instance + */ + Dataset.prototype.textSentimentDatasetMetadata = null; + + /** + * Dataset tablesDatasetMetadata. + * @member {google.cloud.automl.v1beta1.ITablesDatasetMetadata|null|undefined} tablesDatasetMetadata + * @memberof google.cloud.automl.v1beta1.Dataset + * @instance + */ + Dataset.prototype.tablesDatasetMetadata = null; + + /** + * Dataset name. + * @member {string} name + * @memberof google.cloud.automl.v1beta1.Dataset + * @instance + */ + Dataset.prototype.name = ""; + + /** + * Dataset displayName. + * @member {string} displayName + * @memberof google.cloud.automl.v1beta1.Dataset + * @instance + */ + Dataset.prototype.displayName = ""; + + /** + * Dataset description. + * @member {string} description + * @memberof google.cloud.automl.v1beta1.Dataset + * @instance + */ + Dataset.prototype.description = ""; + + /** + * Dataset exampleCount. + * @member {number} exampleCount + * @memberof google.cloud.automl.v1beta1.Dataset + * @instance + */ + Dataset.prototype.exampleCount = 0; + + /** + * Dataset createTime. + * @member {google.protobuf.ITimestamp|null|undefined} createTime + * @memberof google.cloud.automl.v1beta1.Dataset + * @instance + */ + Dataset.prototype.createTime = null; + + /** + * Dataset etag. + * @member {string} etag + * @memberof google.cloud.automl.v1beta1.Dataset + * @instance + */ + Dataset.prototype.etag = ""; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * Dataset datasetMetadata. + * @member {"translationDatasetMetadata"|"imageClassificationDatasetMetadata"|"textClassificationDatasetMetadata"|"imageObjectDetectionDatasetMetadata"|"videoClassificationDatasetMetadata"|"videoObjectTrackingDatasetMetadata"|"textExtractionDatasetMetadata"|"textSentimentDatasetMetadata"|"tablesDatasetMetadata"|undefined} datasetMetadata + * @memberof google.cloud.automl.v1beta1.Dataset + * @instance + */ + Object.defineProperty(Dataset.prototype, "datasetMetadata", { + get: $util.oneOfGetter($oneOfFields = ["translationDatasetMetadata", "imageClassificationDatasetMetadata", "textClassificationDatasetMetadata", "imageObjectDetectionDatasetMetadata", "videoClassificationDatasetMetadata", "videoObjectTrackingDatasetMetadata", "textExtractionDatasetMetadata", "textSentimentDatasetMetadata", "tablesDatasetMetadata"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new Dataset instance using the specified properties. + * @function create + * @memberof google.cloud.automl.v1beta1.Dataset + * @static + * @param {google.cloud.automl.v1beta1.IDataset=} [properties] Properties to set + * @returns {google.cloud.automl.v1beta1.Dataset} Dataset instance + */ + Dataset.create = function create(properties) { + return new Dataset(properties); + }; + + /** + * Encodes the specified Dataset message. Does not implicitly {@link google.cloud.automl.v1beta1.Dataset.verify|verify} messages. + * @function encode + * @memberof google.cloud.automl.v1beta1.Dataset + * @static + * @param {google.cloud.automl.v1beta1.IDataset} message Dataset message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Dataset.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.displayName != null && Object.hasOwnProperty.call(message, "displayName")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.displayName); + if (message.description != null && Object.hasOwnProperty.call(message, "description")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.description); + if (message.createTime != null && Object.hasOwnProperty.call(message, "createTime")) + $root.google.protobuf.Timestamp.encode(message.createTime, writer.uint32(/* id 14, wireType 2 =*/114).fork()).ldelim(); + if (message.etag != null && Object.hasOwnProperty.call(message, "etag")) + writer.uint32(/* id 17, wireType 2 =*/138).string(message.etag); + if (message.exampleCount != null && Object.hasOwnProperty.call(message, "exampleCount")) + writer.uint32(/* id 21, wireType 0 =*/168).int32(message.exampleCount); + if (message.translationDatasetMetadata != null && Object.hasOwnProperty.call(message, "translationDatasetMetadata")) + $root.google.cloud.automl.v1beta1.TranslationDatasetMetadata.encode(message.translationDatasetMetadata, writer.uint32(/* id 23, wireType 2 =*/186).fork()).ldelim(); + if (message.imageClassificationDatasetMetadata != null && Object.hasOwnProperty.call(message, "imageClassificationDatasetMetadata")) + $root.google.cloud.automl.v1beta1.ImageClassificationDatasetMetadata.encode(message.imageClassificationDatasetMetadata, writer.uint32(/* id 24, wireType 2 =*/194).fork()).ldelim(); + if (message.textClassificationDatasetMetadata != null && Object.hasOwnProperty.call(message, "textClassificationDatasetMetadata")) + $root.google.cloud.automl.v1beta1.TextClassificationDatasetMetadata.encode(message.textClassificationDatasetMetadata, writer.uint32(/* id 25, wireType 2 =*/202).fork()).ldelim(); + if (message.imageObjectDetectionDatasetMetadata != null && Object.hasOwnProperty.call(message, "imageObjectDetectionDatasetMetadata")) + $root.google.cloud.automl.v1beta1.ImageObjectDetectionDatasetMetadata.encode(message.imageObjectDetectionDatasetMetadata, writer.uint32(/* id 26, wireType 2 =*/210).fork()).ldelim(); + if (message.textExtractionDatasetMetadata != null && Object.hasOwnProperty.call(message, "textExtractionDatasetMetadata")) + $root.google.cloud.automl.v1beta1.TextExtractionDatasetMetadata.encode(message.textExtractionDatasetMetadata, writer.uint32(/* id 28, wireType 2 =*/226).fork()).ldelim(); + if (message.videoObjectTrackingDatasetMetadata != null && Object.hasOwnProperty.call(message, "videoObjectTrackingDatasetMetadata")) + $root.google.cloud.automl.v1beta1.VideoObjectTrackingDatasetMetadata.encode(message.videoObjectTrackingDatasetMetadata, writer.uint32(/* id 29, wireType 2 =*/234).fork()).ldelim(); + if (message.textSentimentDatasetMetadata != null && Object.hasOwnProperty.call(message, "textSentimentDatasetMetadata")) + $root.google.cloud.automl.v1beta1.TextSentimentDatasetMetadata.encode(message.textSentimentDatasetMetadata, writer.uint32(/* id 30, wireType 2 =*/242).fork()).ldelim(); + if (message.videoClassificationDatasetMetadata != null && Object.hasOwnProperty.call(message, "videoClassificationDatasetMetadata")) + $root.google.cloud.automl.v1beta1.VideoClassificationDatasetMetadata.encode(message.videoClassificationDatasetMetadata, writer.uint32(/* id 31, wireType 2 =*/250).fork()).ldelim(); + if (message.tablesDatasetMetadata != null && Object.hasOwnProperty.call(message, "tablesDatasetMetadata")) + $root.google.cloud.automl.v1beta1.TablesDatasetMetadata.encode(message.tablesDatasetMetadata, writer.uint32(/* id 33, wireType 2 =*/266).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified Dataset message, length delimited. Does not implicitly {@link google.cloud.automl.v1beta1.Dataset.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.automl.v1beta1.Dataset + * @static + * @param {google.cloud.automl.v1beta1.IDataset} message Dataset message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Dataset.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Dataset message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.automl.v1beta1.Dataset + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.automl.v1beta1.Dataset} Dataset + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Dataset.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.automl.v1beta1.Dataset(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 23: { + message.translationDatasetMetadata = $root.google.cloud.automl.v1beta1.TranslationDatasetMetadata.decode(reader, reader.uint32()); + break; + } + case 24: { + message.imageClassificationDatasetMetadata = $root.google.cloud.automl.v1beta1.ImageClassificationDatasetMetadata.decode(reader, reader.uint32()); + break; + } + case 25: { + message.textClassificationDatasetMetadata = $root.google.cloud.automl.v1beta1.TextClassificationDatasetMetadata.decode(reader, reader.uint32()); + break; + } + case 26: { + message.imageObjectDetectionDatasetMetadata = $root.google.cloud.automl.v1beta1.ImageObjectDetectionDatasetMetadata.decode(reader, reader.uint32()); + break; + } + case 31: { + message.videoClassificationDatasetMetadata = $root.google.cloud.automl.v1beta1.VideoClassificationDatasetMetadata.decode(reader, reader.uint32()); + break; + } + case 29: { + message.videoObjectTrackingDatasetMetadata = $root.google.cloud.automl.v1beta1.VideoObjectTrackingDatasetMetadata.decode(reader, reader.uint32()); + break; + } + case 28: { + message.textExtractionDatasetMetadata = $root.google.cloud.automl.v1beta1.TextExtractionDatasetMetadata.decode(reader, reader.uint32()); + break; + } + case 30: { + message.textSentimentDatasetMetadata = $root.google.cloud.automl.v1beta1.TextSentimentDatasetMetadata.decode(reader, reader.uint32()); + break; + } + case 33: { + message.tablesDatasetMetadata = $root.google.cloud.automl.v1beta1.TablesDatasetMetadata.decode(reader, reader.uint32()); + break; + } + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.displayName = reader.string(); + break; + } + case 3: { + message.description = reader.string(); + break; + } + case 21: { + message.exampleCount = reader.int32(); + break; + } + case 14: { + message.createTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 17: { + message.etag = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Dataset message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.automl.v1beta1.Dataset + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.automl.v1beta1.Dataset} Dataset + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Dataset.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Dataset message. + * @function verify + * @memberof google.cloud.automl.v1beta1.Dataset + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Dataset.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.translationDatasetMetadata != null && message.hasOwnProperty("translationDatasetMetadata")) { + properties.datasetMetadata = 1; + { + var error = $root.google.cloud.automl.v1beta1.TranslationDatasetMetadata.verify(message.translationDatasetMetadata); + if (error) + return "translationDatasetMetadata." + error; + } + } + if (message.imageClassificationDatasetMetadata != null && message.hasOwnProperty("imageClassificationDatasetMetadata")) { + if (properties.datasetMetadata === 1) + return "datasetMetadata: multiple values"; + properties.datasetMetadata = 1; + { + var error = $root.google.cloud.automl.v1beta1.ImageClassificationDatasetMetadata.verify(message.imageClassificationDatasetMetadata); + if (error) + return "imageClassificationDatasetMetadata." + error; + } + } + if (message.textClassificationDatasetMetadata != null && message.hasOwnProperty("textClassificationDatasetMetadata")) { + if (properties.datasetMetadata === 1) + return "datasetMetadata: multiple values"; + properties.datasetMetadata = 1; + { + var error = $root.google.cloud.automl.v1beta1.TextClassificationDatasetMetadata.verify(message.textClassificationDatasetMetadata); + if (error) + return "textClassificationDatasetMetadata." + error; + } + } + if (message.imageObjectDetectionDatasetMetadata != null && message.hasOwnProperty("imageObjectDetectionDatasetMetadata")) { + if (properties.datasetMetadata === 1) + return "datasetMetadata: multiple values"; + properties.datasetMetadata = 1; + { + var error = $root.google.cloud.automl.v1beta1.ImageObjectDetectionDatasetMetadata.verify(message.imageObjectDetectionDatasetMetadata); + if (error) + return "imageObjectDetectionDatasetMetadata." + error; + } + } + if (message.videoClassificationDatasetMetadata != null && message.hasOwnProperty("videoClassificationDatasetMetadata")) { + if (properties.datasetMetadata === 1) + return "datasetMetadata: multiple values"; + properties.datasetMetadata = 1; + { + var error = $root.google.cloud.automl.v1beta1.VideoClassificationDatasetMetadata.verify(message.videoClassificationDatasetMetadata); + if (error) + return "videoClassificationDatasetMetadata." + error; + } + } + if (message.videoObjectTrackingDatasetMetadata != null && message.hasOwnProperty("videoObjectTrackingDatasetMetadata")) { + if (properties.datasetMetadata === 1) + return "datasetMetadata: multiple values"; + properties.datasetMetadata = 1; + { + var error = $root.google.cloud.automl.v1beta1.VideoObjectTrackingDatasetMetadata.verify(message.videoObjectTrackingDatasetMetadata); + if (error) + return "videoObjectTrackingDatasetMetadata." + error; + } + } + if (message.textExtractionDatasetMetadata != null && message.hasOwnProperty("textExtractionDatasetMetadata")) { + if (properties.datasetMetadata === 1) + return "datasetMetadata: multiple values"; + properties.datasetMetadata = 1; + { + var error = $root.google.cloud.automl.v1beta1.TextExtractionDatasetMetadata.verify(message.textExtractionDatasetMetadata); + if (error) + return "textExtractionDatasetMetadata." + error; + } + } + if (message.textSentimentDatasetMetadata != null && message.hasOwnProperty("textSentimentDatasetMetadata")) { + if (properties.datasetMetadata === 1) + return "datasetMetadata: multiple values"; + properties.datasetMetadata = 1; + { + var error = $root.google.cloud.automl.v1beta1.TextSentimentDatasetMetadata.verify(message.textSentimentDatasetMetadata); + if (error) + return "textSentimentDatasetMetadata." + error; + } + } + if (message.tablesDatasetMetadata != null && message.hasOwnProperty("tablesDatasetMetadata")) { + if (properties.datasetMetadata === 1) + return "datasetMetadata: multiple values"; + properties.datasetMetadata = 1; + { + var error = $root.google.cloud.automl.v1beta1.TablesDatasetMetadata.verify(message.tablesDatasetMetadata); + if (error) + return "tablesDatasetMetadata." + error; + } + } + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.displayName != null && message.hasOwnProperty("displayName")) + if (!$util.isString(message.displayName)) + return "displayName: string expected"; + if (message.description != null && message.hasOwnProperty("description")) + if (!$util.isString(message.description)) + return "description: string expected"; + if (message.exampleCount != null && message.hasOwnProperty("exampleCount")) + if (!$util.isInteger(message.exampleCount)) + return "exampleCount: integer expected"; + if (message.createTime != null && message.hasOwnProperty("createTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.createTime); + if (error) + return "createTime." + error; + } + if (message.etag != null && message.hasOwnProperty("etag")) + if (!$util.isString(message.etag)) + return "etag: string expected"; + return null; + }; + + /** + * Creates a Dataset message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.automl.v1beta1.Dataset + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.automl.v1beta1.Dataset} Dataset + */ + Dataset.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.automl.v1beta1.Dataset) + return object; + var message = new $root.google.cloud.automl.v1beta1.Dataset(); + if (object.translationDatasetMetadata != null) { + if (typeof object.translationDatasetMetadata !== "object") + throw TypeError(".google.cloud.automl.v1beta1.Dataset.translationDatasetMetadata: object expected"); + message.translationDatasetMetadata = $root.google.cloud.automl.v1beta1.TranslationDatasetMetadata.fromObject(object.translationDatasetMetadata); + } + if (object.imageClassificationDatasetMetadata != null) { + if (typeof object.imageClassificationDatasetMetadata !== "object") + throw TypeError(".google.cloud.automl.v1beta1.Dataset.imageClassificationDatasetMetadata: object expected"); + message.imageClassificationDatasetMetadata = $root.google.cloud.automl.v1beta1.ImageClassificationDatasetMetadata.fromObject(object.imageClassificationDatasetMetadata); + } + if (object.textClassificationDatasetMetadata != null) { + if (typeof object.textClassificationDatasetMetadata !== "object") + throw TypeError(".google.cloud.automl.v1beta1.Dataset.textClassificationDatasetMetadata: object expected"); + message.textClassificationDatasetMetadata = $root.google.cloud.automl.v1beta1.TextClassificationDatasetMetadata.fromObject(object.textClassificationDatasetMetadata); + } + if (object.imageObjectDetectionDatasetMetadata != null) { + if (typeof object.imageObjectDetectionDatasetMetadata !== "object") + throw TypeError(".google.cloud.automl.v1beta1.Dataset.imageObjectDetectionDatasetMetadata: object expected"); + message.imageObjectDetectionDatasetMetadata = $root.google.cloud.automl.v1beta1.ImageObjectDetectionDatasetMetadata.fromObject(object.imageObjectDetectionDatasetMetadata); + } + if (object.videoClassificationDatasetMetadata != null) { + if (typeof object.videoClassificationDatasetMetadata !== "object") + throw TypeError(".google.cloud.automl.v1beta1.Dataset.videoClassificationDatasetMetadata: object expected"); + message.videoClassificationDatasetMetadata = $root.google.cloud.automl.v1beta1.VideoClassificationDatasetMetadata.fromObject(object.videoClassificationDatasetMetadata); + } + if (object.videoObjectTrackingDatasetMetadata != null) { + if (typeof object.videoObjectTrackingDatasetMetadata !== "object") + throw TypeError(".google.cloud.automl.v1beta1.Dataset.videoObjectTrackingDatasetMetadata: object expected"); + message.videoObjectTrackingDatasetMetadata = $root.google.cloud.automl.v1beta1.VideoObjectTrackingDatasetMetadata.fromObject(object.videoObjectTrackingDatasetMetadata); + } + if (object.textExtractionDatasetMetadata != null) { + if (typeof object.textExtractionDatasetMetadata !== "object") + throw TypeError(".google.cloud.automl.v1beta1.Dataset.textExtractionDatasetMetadata: object expected"); + message.textExtractionDatasetMetadata = $root.google.cloud.automl.v1beta1.TextExtractionDatasetMetadata.fromObject(object.textExtractionDatasetMetadata); + } + if (object.textSentimentDatasetMetadata != null) { + if (typeof object.textSentimentDatasetMetadata !== "object") + throw TypeError(".google.cloud.automl.v1beta1.Dataset.textSentimentDatasetMetadata: object expected"); + message.textSentimentDatasetMetadata = $root.google.cloud.automl.v1beta1.TextSentimentDatasetMetadata.fromObject(object.textSentimentDatasetMetadata); + } + if (object.tablesDatasetMetadata != null) { + if (typeof object.tablesDatasetMetadata !== "object") + throw TypeError(".google.cloud.automl.v1beta1.Dataset.tablesDatasetMetadata: object expected"); + message.tablesDatasetMetadata = $root.google.cloud.automl.v1beta1.TablesDatasetMetadata.fromObject(object.tablesDatasetMetadata); + } + if (object.name != null) + message.name = String(object.name); + if (object.displayName != null) + message.displayName = String(object.displayName); + if (object.description != null) + message.description = String(object.description); + if (object.exampleCount != null) + message.exampleCount = object.exampleCount | 0; + if (object.createTime != null) { + if (typeof object.createTime !== "object") + throw TypeError(".google.cloud.automl.v1beta1.Dataset.createTime: object expected"); + message.createTime = $root.google.protobuf.Timestamp.fromObject(object.createTime); + } + if (object.etag != null) + message.etag = String(object.etag); + return message; + }; + + /** + * Creates a plain object from a Dataset message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.automl.v1beta1.Dataset + * @static + * @param {google.cloud.automl.v1beta1.Dataset} message Dataset + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Dataset.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.displayName = ""; + object.description = ""; + object.createTime = null; + object.etag = ""; + object.exampleCount = 0; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.displayName != null && message.hasOwnProperty("displayName")) + object.displayName = message.displayName; + if (message.description != null && message.hasOwnProperty("description")) + object.description = message.description; + if (message.createTime != null && message.hasOwnProperty("createTime")) + object.createTime = $root.google.protobuf.Timestamp.toObject(message.createTime, options); + if (message.etag != null && message.hasOwnProperty("etag")) + object.etag = message.etag; + if (message.exampleCount != null && message.hasOwnProperty("exampleCount")) + object.exampleCount = message.exampleCount; + if (message.translationDatasetMetadata != null && message.hasOwnProperty("translationDatasetMetadata")) { + object.translationDatasetMetadata = $root.google.cloud.automl.v1beta1.TranslationDatasetMetadata.toObject(message.translationDatasetMetadata, options); + if (options.oneofs) + object.datasetMetadata = "translationDatasetMetadata"; + } + if (message.imageClassificationDatasetMetadata != null && message.hasOwnProperty("imageClassificationDatasetMetadata")) { + object.imageClassificationDatasetMetadata = $root.google.cloud.automl.v1beta1.ImageClassificationDatasetMetadata.toObject(message.imageClassificationDatasetMetadata, options); + if (options.oneofs) + object.datasetMetadata = "imageClassificationDatasetMetadata"; + } + if (message.textClassificationDatasetMetadata != null && message.hasOwnProperty("textClassificationDatasetMetadata")) { + object.textClassificationDatasetMetadata = $root.google.cloud.automl.v1beta1.TextClassificationDatasetMetadata.toObject(message.textClassificationDatasetMetadata, options); + if (options.oneofs) + object.datasetMetadata = "textClassificationDatasetMetadata"; + } + if (message.imageObjectDetectionDatasetMetadata != null && message.hasOwnProperty("imageObjectDetectionDatasetMetadata")) { + object.imageObjectDetectionDatasetMetadata = $root.google.cloud.automl.v1beta1.ImageObjectDetectionDatasetMetadata.toObject(message.imageObjectDetectionDatasetMetadata, options); + if (options.oneofs) + object.datasetMetadata = "imageObjectDetectionDatasetMetadata"; + } + if (message.textExtractionDatasetMetadata != null && message.hasOwnProperty("textExtractionDatasetMetadata")) { + object.textExtractionDatasetMetadata = $root.google.cloud.automl.v1beta1.TextExtractionDatasetMetadata.toObject(message.textExtractionDatasetMetadata, options); + if (options.oneofs) + object.datasetMetadata = "textExtractionDatasetMetadata"; + } + if (message.videoObjectTrackingDatasetMetadata != null && message.hasOwnProperty("videoObjectTrackingDatasetMetadata")) { + object.videoObjectTrackingDatasetMetadata = $root.google.cloud.automl.v1beta1.VideoObjectTrackingDatasetMetadata.toObject(message.videoObjectTrackingDatasetMetadata, options); + if (options.oneofs) + object.datasetMetadata = "videoObjectTrackingDatasetMetadata"; + } + if (message.textSentimentDatasetMetadata != null && message.hasOwnProperty("textSentimentDatasetMetadata")) { + object.textSentimentDatasetMetadata = $root.google.cloud.automl.v1beta1.TextSentimentDatasetMetadata.toObject(message.textSentimentDatasetMetadata, options); + if (options.oneofs) + object.datasetMetadata = "textSentimentDatasetMetadata"; + } + if (message.videoClassificationDatasetMetadata != null && message.hasOwnProperty("videoClassificationDatasetMetadata")) { + object.videoClassificationDatasetMetadata = $root.google.cloud.automl.v1beta1.VideoClassificationDatasetMetadata.toObject(message.videoClassificationDatasetMetadata, options); + if (options.oneofs) + object.datasetMetadata = "videoClassificationDatasetMetadata"; + } + if (message.tablesDatasetMetadata != null && message.hasOwnProperty("tablesDatasetMetadata")) { + object.tablesDatasetMetadata = $root.google.cloud.automl.v1beta1.TablesDatasetMetadata.toObject(message.tablesDatasetMetadata, options); + if (options.oneofs) + object.datasetMetadata = "tablesDatasetMetadata"; + } + return object; + }; + + /** + * Converts this Dataset to JSON. + * @function toJSON + * @memberof google.cloud.automl.v1beta1.Dataset + * @instance + * @returns {Object.} JSON object + */ + Dataset.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Dataset + * @function getTypeUrl + * @memberof google.cloud.automl.v1beta1.Dataset + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Dataset.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.automl.v1beta1.Dataset"; + }; + + return Dataset; + })(); + + v1beta1.ImageClassificationDatasetMetadata = (function() { + + /** + * Properties of an ImageClassificationDatasetMetadata. + * @memberof google.cloud.automl.v1beta1 + * @interface IImageClassificationDatasetMetadata + * @property {google.cloud.automl.v1beta1.ClassificationType|null} [classificationType] ImageClassificationDatasetMetadata classificationType + */ + + /** + * Constructs a new ImageClassificationDatasetMetadata. + * @memberof google.cloud.automl.v1beta1 + * @classdesc Represents an ImageClassificationDatasetMetadata. + * @implements IImageClassificationDatasetMetadata + * @constructor + * @param {google.cloud.automl.v1beta1.IImageClassificationDatasetMetadata=} [properties] Properties to set + */ + function ImageClassificationDatasetMetadata(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ImageClassificationDatasetMetadata classificationType. + * @member {google.cloud.automl.v1beta1.ClassificationType} classificationType + * @memberof google.cloud.automl.v1beta1.ImageClassificationDatasetMetadata + * @instance + */ + ImageClassificationDatasetMetadata.prototype.classificationType = 0; + + /** + * Creates a new ImageClassificationDatasetMetadata instance using the specified properties. + * @function create + * @memberof google.cloud.automl.v1beta1.ImageClassificationDatasetMetadata + * @static + * @param {google.cloud.automl.v1beta1.IImageClassificationDatasetMetadata=} [properties] Properties to set + * @returns {google.cloud.automl.v1beta1.ImageClassificationDatasetMetadata} ImageClassificationDatasetMetadata instance + */ + ImageClassificationDatasetMetadata.create = function create(properties) { + return new ImageClassificationDatasetMetadata(properties); + }; + + /** + * Encodes the specified ImageClassificationDatasetMetadata message. Does not implicitly {@link google.cloud.automl.v1beta1.ImageClassificationDatasetMetadata.verify|verify} messages. + * @function encode + * @memberof google.cloud.automl.v1beta1.ImageClassificationDatasetMetadata + * @static + * @param {google.cloud.automl.v1beta1.IImageClassificationDatasetMetadata} message ImageClassificationDatasetMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ImageClassificationDatasetMetadata.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.classificationType != null && Object.hasOwnProperty.call(message, "classificationType")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.classificationType); + return writer; + }; + + /** + * Encodes the specified ImageClassificationDatasetMetadata message, length delimited. Does not implicitly {@link google.cloud.automl.v1beta1.ImageClassificationDatasetMetadata.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.automl.v1beta1.ImageClassificationDatasetMetadata + * @static + * @param {google.cloud.automl.v1beta1.IImageClassificationDatasetMetadata} message ImageClassificationDatasetMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ImageClassificationDatasetMetadata.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an ImageClassificationDatasetMetadata message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.automl.v1beta1.ImageClassificationDatasetMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.automl.v1beta1.ImageClassificationDatasetMetadata} ImageClassificationDatasetMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ImageClassificationDatasetMetadata.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.automl.v1beta1.ImageClassificationDatasetMetadata(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.classificationType = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an ImageClassificationDatasetMetadata message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.automl.v1beta1.ImageClassificationDatasetMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.automl.v1beta1.ImageClassificationDatasetMetadata} ImageClassificationDatasetMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ImageClassificationDatasetMetadata.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an ImageClassificationDatasetMetadata message. + * @function verify + * @memberof google.cloud.automl.v1beta1.ImageClassificationDatasetMetadata + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ImageClassificationDatasetMetadata.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.classificationType != null && message.hasOwnProperty("classificationType")) + switch (message.classificationType) { + default: + return "classificationType: enum value expected"; + case 0: + case 1: + case 2: + break; + } + return null; + }; + + /** + * Creates an ImageClassificationDatasetMetadata message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.automl.v1beta1.ImageClassificationDatasetMetadata + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.automl.v1beta1.ImageClassificationDatasetMetadata} ImageClassificationDatasetMetadata + */ + ImageClassificationDatasetMetadata.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.automl.v1beta1.ImageClassificationDatasetMetadata) + return object; + var message = new $root.google.cloud.automl.v1beta1.ImageClassificationDatasetMetadata(); + switch (object.classificationType) { + default: + if (typeof object.classificationType === "number") { + message.classificationType = object.classificationType; + break; + } + break; + case "CLASSIFICATION_TYPE_UNSPECIFIED": + case 0: + message.classificationType = 0; + break; + case "MULTICLASS": + case 1: + message.classificationType = 1; + break; + case "MULTILABEL": + case 2: + message.classificationType = 2; + break; + } + return message; + }; + + /** + * Creates a plain object from an ImageClassificationDatasetMetadata message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.automl.v1beta1.ImageClassificationDatasetMetadata + * @static + * @param {google.cloud.automl.v1beta1.ImageClassificationDatasetMetadata} message ImageClassificationDatasetMetadata + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ImageClassificationDatasetMetadata.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.classificationType = options.enums === String ? "CLASSIFICATION_TYPE_UNSPECIFIED" : 0; + if (message.classificationType != null && message.hasOwnProperty("classificationType")) + object.classificationType = options.enums === String ? $root.google.cloud.automl.v1beta1.ClassificationType[message.classificationType] === undefined ? message.classificationType : $root.google.cloud.automl.v1beta1.ClassificationType[message.classificationType] : message.classificationType; + return object; + }; + + /** + * Converts this ImageClassificationDatasetMetadata to JSON. + * @function toJSON + * @memberof google.cloud.automl.v1beta1.ImageClassificationDatasetMetadata + * @instance + * @returns {Object.} JSON object + */ + ImageClassificationDatasetMetadata.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ImageClassificationDatasetMetadata + * @function getTypeUrl + * @memberof google.cloud.automl.v1beta1.ImageClassificationDatasetMetadata + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ImageClassificationDatasetMetadata.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.automl.v1beta1.ImageClassificationDatasetMetadata"; + }; + + return ImageClassificationDatasetMetadata; + })(); + + v1beta1.ImageObjectDetectionDatasetMetadata = (function() { + + /** + * Properties of an ImageObjectDetectionDatasetMetadata. + * @memberof google.cloud.automl.v1beta1 + * @interface IImageObjectDetectionDatasetMetadata + */ + + /** + * Constructs a new ImageObjectDetectionDatasetMetadata. + * @memberof google.cloud.automl.v1beta1 + * @classdesc Represents an ImageObjectDetectionDatasetMetadata. + * @implements IImageObjectDetectionDatasetMetadata + * @constructor + * @param {google.cloud.automl.v1beta1.IImageObjectDetectionDatasetMetadata=} [properties] Properties to set + */ + function ImageObjectDetectionDatasetMetadata(properties) { + if (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 ImageObjectDetectionDatasetMetadata instance using the specified properties. + * @function create + * @memberof google.cloud.automl.v1beta1.ImageObjectDetectionDatasetMetadata + * @static + * @param {google.cloud.automl.v1beta1.IImageObjectDetectionDatasetMetadata=} [properties] Properties to set + * @returns {google.cloud.automl.v1beta1.ImageObjectDetectionDatasetMetadata} ImageObjectDetectionDatasetMetadata instance + */ + ImageObjectDetectionDatasetMetadata.create = function create(properties) { + return new ImageObjectDetectionDatasetMetadata(properties); + }; + + /** + * Encodes the specified ImageObjectDetectionDatasetMetadata message. Does not implicitly {@link google.cloud.automl.v1beta1.ImageObjectDetectionDatasetMetadata.verify|verify} messages. + * @function encode + * @memberof google.cloud.automl.v1beta1.ImageObjectDetectionDatasetMetadata + * @static + * @param {google.cloud.automl.v1beta1.IImageObjectDetectionDatasetMetadata} message ImageObjectDetectionDatasetMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ImageObjectDetectionDatasetMetadata.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + return writer; + }; + + /** + * Encodes the specified ImageObjectDetectionDatasetMetadata message, length delimited. Does not implicitly {@link google.cloud.automl.v1beta1.ImageObjectDetectionDatasetMetadata.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.automl.v1beta1.ImageObjectDetectionDatasetMetadata + * @static + * @param {google.cloud.automl.v1beta1.IImageObjectDetectionDatasetMetadata} message ImageObjectDetectionDatasetMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ImageObjectDetectionDatasetMetadata.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an ImageObjectDetectionDatasetMetadata message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.automl.v1beta1.ImageObjectDetectionDatasetMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.automl.v1beta1.ImageObjectDetectionDatasetMetadata} ImageObjectDetectionDatasetMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ImageObjectDetectionDatasetMetadata.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.automl.v1beta1.ImageObjectDetectionDatasetMetadata(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an ImageObjectDetectionDatasetMetadata message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.automl.v1beta1.ImageObjectDetectionDatasetMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.automl.v1beta1.ImageObjectDetectionDatasetMetadata} ImageObjectDetectionDatasetMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ImageObjectDetectionDatasetMetadata.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an ImageObjectDetectionDatasetMetadata message. + * @function verify + * @memberof google.cloud.automl.v1beta1.ImageObjectDetectionDatasetMetadata + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ImageObjectDetectionDatasetMetadata.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + return null; + }; + + /** + * Creates an ImageObjectDetectionDatasetMetadata message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.automl.v1beta1.ImageObjectDetectionDatasetMetadata + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.automl.v1beta1.ImageObjectDetectionDatasetMetadata} ImageObjectDetectionDatasetMetadata + */ + ImageObjectDetectionDatasetMetadata.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.automl.v1beta1.ImageObjectDetectionDatasetMetadata) + return object; + return new $root.google.cloud.automl.v1beta1.ImageObjectDetectionDatasetMetadata(); + }; + + /** + * Creates a plain object from an ImageObjectDetectionDatasetMetadata message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.automl.v1beta1.ImageObjectDetectionDatasetMetadata + * @static + * @param {google.cloud.automl.v1beta1.ImageObjectDetectionDatasetMetadata} message ImageObjectDetectionDatasetMetadata + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ImageObjectDetectionDatasetMetadata.toObject = function toObject() { + return {}; + }; + + /** + * Converts this ImageObjectDetectionDatasetMetadata to JSON. + * @function toJSON + * @memberof google.cloud.automl.v1beta1.ImageObjectDetectionDatasetMetadata + * @instance + * @returns {Object.} JSON object + */ + ImageObjectDetectionDatasetMetadata.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ImageObjectDetectionDatasetMetadata + * @function getTypeUrl + * @memberof google.cloud.automl.v1beta1.ImageObjectDetectionDatasetMetadata + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ImageObjectDetectionDatasetMetadata.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.automl.v1beta1.ImageObjectDetectionDatasetMetadata"; + }; + + return ImageObjectDetectionDatasetMetadata; + })(); + + v1beta1.ImageClassificationModelMetadata = (function() { + + /** + * Properties of an ImageClassificationModelMetadata. + * @memberof google.cloud.automl.v1beta1 + * @interface IImageClassificationModelMetadata + * @property {string|null} [baseModelId] ImageClassificationModelMetadata baseModelId + * @property {number|Long|null} [trainBudget] ImageClassificationModelMetadata trainBudget + * @property {number|Long|null} [trainCost] ImageClassificationModelMetadata trainCost + * @property {string|null} [stopReason] ImageClassificationModelMetadata stopReason + * @property {string|null} [modelType] ImageClassificationModelMetadata modelType + * @property {number|null} [nodeQps] ImageClassificationModelMetadata nodeQps + * @property {number|Long|null} [nodeCount] ImageClassificationModelMetadata nodeCount + */ + + /** + * Constructs a new ImageClassificationModelMetadata. + * @memberof google.cloud.automl.v1beta1 + * @classdesc Represents an ImageClassificationModelMetadata. + * @implements IImageClassificationModelMetadata + * @constructor + * @param {google.cloud.automl.v1beta1.IImageClassificationModelMetadata=} [properties] Properties to set + */ + function ImageClassificationModelMetadata(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ImageClassificationModelMetadata baseModelId. + * @member {string} baseModelId + * @memberof google.cloud.automl.v1beta1.ImageClassificationModelMetadata + * @instance + */ + ImageClassificationModelMetadata.prototype.baseModelId = ""; + + /** + * ImageClassificationModelMetadata trainBudget. + * @member {number|Long} trainBudget + * @memberof google.cloud.automl.v1beta1.ImageClassificationModelMetadata + * @instance + */ + ImageClassificationModelMetadata.prototype.trainBudget = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * ImageClassificationModelMetadata trainCost. + * @member {number|Long} trainCost + * @memberof google.cloud.automl.v1beta1.ImageClassificationModelMetadata + * @instance + */ + ImageClassificationModelMetadata.prototype.trainCost = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * ImageClassificationModelMetadata stopReason. + * @member {string} stopReason + * @memberof google.cloud.automl.v1beta1.ImageClassificationModelMetadata + * @instance + */ + ImageClassificationModelMetadata.prototype.stopReason = ""; + + /** + * ImageClassificationModelMetadata modelType. + * @member {string} modelType + * @memberof google.cloud.automl.v1beta1.ImageClassificationModelMetadata + * @instance + */ + ImageClassificationModelMetadata.prototype.modelType = ""; + + /** + * ImageClassificationModelMetadata nodeQps. + * @member {number} nodeQps + * @memberof google.cloud.automl.v1beta1.ImageClassificationModelMetadata + * @instance + */ + ImageClassificationModelMetadata.prototype.nodeQps = 0; + + /** + * ImageClassificationModelMetadata nodeCount. + * @member {number|Long} nodeCount + * @memberof google.cloud.automl.v1beta1.ImageClassificationModelMetadata + * @instance + */ + ImageClassificationModelMetadata.prototype.nodeCount = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new ImageClassificationModelMetadata instance using the specified properties. + * @function create + * @memberof google.cloud.automl.v1beta1.ImageClassificationModelMetadata + * @static + * @param {google.cloud.automl.v1beta1.IImageClassificationModelMetadata=} [properties] Properties to set + * @returns {google.cloud.automl.v1beta1.ImageClassificationModelMetadata} ImageClassificationModelMetadata instance + */ + ImageClassificationModelMetadata.create = function create(properties) { + return new ImageClassificationModelMetadata(properties); + }; + + /** + * Encodes the specified ImageClassificationModelMetadata message. Does not implicitly {@link google.cloud.automl.v1beta1.ImageClassificationModelMetadata.verify|verify} messages. + * @function encode + * @memberof google.cloud.automl.v1beta1.ImageClassificationModelMetadata + * @static + * @param {google.cloud.automl.v1beta1.IImageClassificationModelMetadata} message ImageClassificationModelMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ImageClassificationModelMetadata.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.baseModelId != null && Object.hasOwnProperty.call(message, "baseModelId")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.baseModelId); + if (message.trainBudget != null && Object.hasOwnProperty.call(message, "trainBudget")) + writer.uint32(/* id 2, wireType 0 =*/16).int64(message.trainBudget); + if (message.trainCost != null && Object.hasOwnProperty.call(message, "trainCost")) + writer.uint32(/* id 3, wireType 0 =*/24).int64(message.trainCost); + if (message.stopReason != null && Object.hasOwnProperty.call(message, "stopReason")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.stopReason); + if (message.modelType != null && Object.hasOwnProperty.call(message, "modelType")) + writer.uint32(/* id 7, wireType 2 =*/58).string(message.modelType); + if (message.nodeQps != null && Object.hasOwnProperty.call(message, "nodeQps")) + writer.uint32(/* id 13, wireType 1 =*/105).double(message.nodeQps); + if (message.nodeCount != null && Object.hasOwnProperty.call(message, "nodeCount")) + writer.uint32(/* id 14, wireType 0 =*/112).int64(message.nodeCount); + return writer; + }; + + /** + * Encodes the specified ImageClassificationModelMetadata message, length delimited. Does not implicitly {@link google.cloud.automl.v1beta1.ImageClassificationModelMetadata.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.automl.v1beta1.ImageClassificationModelMetadata + * @static + * @param {google.cloud.automl.v1beta1.IImageClassificationModelMetadata} message ImageClassificationModelMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ImageClassificationModelMetadata.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an ImageClassificationModelMetadata message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.automl.v1beta1.ImageClassificationModelMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.automl.v1beta1.ImageClassificationModelMetadata} ImageClassificationModelMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ImageClassificationModelMetadata.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.automl.v1beta1.ImageClassificationModelMetadata(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.baseModelId = reader.string(); + break; + } + case 2: { + message.trainBudget = reader.int64(); + break; + } + case 3: { + message.trainCost = reader.int64(); + break; + } + case 5: { + message.stopReason = reader.string(); + break; + } + case 7: { + message.modelType = reader.string(); + break; + } + case 13: { + message.nodeQps = reader.double(); + break; + } + case 14: { + message.nodeCount = reader.int64(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an ImageClassificationModelMetadata message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.automl.v1beta1.ImageClassificationModelMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.automl.v1beta1.ImageClassificationModelMetadata} ImageClassificationModelMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ImageClassificationModelMetadata.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an ImageClassificationModelMetadata message. + * @function verify + * @memberof google.cloud.automl.v1beta1.ImageClassificationModelMetadata + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ImageClassificationModelMetadata.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.baseModelId != null && message.hasOwnProperty("baseModelId")) + if (!$util.isString(message.baseModelId)) + return "baseModelId: string expected"; + if (message.trainBudget != null && message.hasOwnProperty("trainBudget")) + if (!$util.isInteger(message.trainBudget) && !(message.trainBudget && $util.isInteger(message.trainBudget.low) && $util.isInteger(message.trainBudget.high))) + return "trainBudget: integer|Long expected"; + if (message.trainCost != null && message.hasOwnProperty("trainCost")) + if (!$util.isInteger(message.trainCost) && !(message.trainCost && $util.isInteger(message.trainCost.low) && $util.isInteger(message.trainCost.high))) + return "trainCost: integer|Long expected"; + if (message.stopReason != null && message.hasOwnProperty("stopReason")) + if (!$util.isString(message.stopReason)) + return "stopReason: string expected"; + if (message.modelType != null && message.hasOwnProperty("modelType")) + if (!$util.isString(message.modelType)) + return "modelType: string expected"; + if (message.nodeQps != null && message.hasOwnProperty("nodeQps")) + if (typeof message.nodeQps !== "number") + return "nodeQps: number expected"; + if (message.nodeCount != null && message.hasOwnProperty("nodeCount")) + if (!$util.isInteger(message.nodeCount) && !(message.nodeCount && $util.isInteger(message.nodeCount.low) && $util.isInteger(message.nodeCount.high))) + return "nodeCount: integer|Long expected"; + return null; + }; + + /** + * Creates an ImageClassificationModelMetadata message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.automl.v1beta1.ImageClassificationModelMetadata + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.automl.v1beta1.ImageClassificationModelMetadata} ImageClassificationModelMetadata + */ + ImageClassificationModelMetadata.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.automl.v1beta1.ImageClassificationModelMetadata) + return object; + var message = new $root.google.cloud.automl.v1beta1.ImageClassificationModelMetadata(); + if (object.baseModelId != null) + message.baseModelId = String(object.baseModelId); + if (object.trainBudget != null) + if ($util.Long) + (message.trainBudget = $util.Long.fromValue(object.trainBudget)).unsigned = false; + else if (typeof object.trainBudget === "string") + message.trainBudget = parseInt(object.trainBudget, 10); + else if (typeof object.trainBudget === "number") + message.trainBudget = object.trainBudget; + else if (typeof object.trainBudget === "object") + message.trainBudget = new $util.LongBits(object.trainBudget.low >>> 0, object.trainBudget.high >>> 0).toNumber(); + if (object.trainCost != null) + if ($util.Long) + (message.trainCost = $util.Long.fromValue(object.trainCost)).unsigned = false; + else if (typeof object.trainCost === "string") + message.trainCost = parseInt(object.trainCost, 10); + else if (typeof object.trainCost === "number") + message.trainCost = object.trainCost; + else if (typeof object.trainCost === "object") + message.trainCost = new $util.LongBits(object.trainCost.low >>> 0, object.trainCost.high >>> 0).toNumber(); + if (object.stopReason != null) + message.stopReason = String(object.stopReason); + if (object.modelType != null) + message.modelType = String(object.modelType); + if (object.nodeQps != null) + message.nodeQps = Number(object.nodeQps); + if (object.nodeCount != null) + if ($util.Long) + (message.nodeCount = $util.Long.fromValue(object.nodeCount)).unsigned = false; + else if (typeof object.nodeCount === "string") + message.nodeCount = parseInt(object.nodeCount, 10); + else if (typeof object.nodeCount === "number") + message.nodeCount = object.nodeCount; + else if (typeof object.nodeCount === "object") + message.nodeCount = new $util.LongBits(object.nodeCount.low >>> 0, object.nodeCount.high >>> 0).toNumber(); + return message; + }; + + /** + * Creates a plain object from an ImageClassificationModelMetadata message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.automl.v1beta1.ImageClassificationModelMetadata + * @static + * @param {google.cloud.automl.v1beta1.ImageClassificationModelMetadata} message ImageClassificationModelMetadata + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ImageClassificationModelMetadata.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.baseModelId = ""; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.trainBudget = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.trainBudget = options.longs === String ? "0" : 0; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.trainCost = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.trainCost = options.longs === String ? "0" : 0; + object.stopReason = ""; + object.modelType = ""; + object.nodeQps = 0; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.nodeCount = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.nodeCount = options.longs === String ? "0" : 0; + } + if (message.baseModelId != null && message.hasOwnProperty("baseModelId")) + object.baseModelId = message.baseModelId; + if (message.trainBudget != null && message.hasOwnProperty("trainBudget")) + if (typeof message.trainBudget === "number") + object.trainBudget = options.longs === String ? String(message.trainBudget) : message.trainBudget; + else + object.trainBudget = options.longs === String ? $util.Long.prototype.toString.call(message.trainBudget) : options.longs === Number ? new $util.LongBits(message.trainBudget.low >>> 0, message.trainBudget.high >>> 0).toNumber() : message.trainBudget; + if (message.trainCost != null && message.hasOwnProperty("trainCost")) + if (typeof message.trainCost === "number") + object.trainCost = options.longs === String ? String(message.trainCost) : message.trainCost; + else + object.trainCost = options.longs === String ? $util.Long.prototype.toString.call(message.trainCost) : options.longs === Number ? new $util.LongBits(message.trainCost.low >>> 0, message.trainCost.high >>> 0).toNumber() : message.trainCost; + if (message.stopReason != null && message.hasOwnProperty("stopReason")) + object.stopReason = message.stopReason; + if (message.modelType != null && message.hasOwnProperty("modelType")) + object.modelType = message.modelType; + if (message.nodeQps != null && message.hasOwnProperty("nodeQps")) + object.nodeQps = options.json && !isFinite(message.nodeQps) ? String(message.nodeQps) : message.nodeQps; + if (message.nodeCount != null && message.hasOwnProperty("nodeCount")) + if (typeof message.nodeCount === "number") + object.nodeCount = options.longs === String ? String(message.nodeCount) : message.nodeCount; + else + object.nodeCount = options.longs === String ? $util.Long.prototype.toString.call(message.nodeCount) : options.longs === Number ? new $util.LongBits(message.nodeCount.low >>> 0, message.nodeCount.high >>> 0).toNumber() : message.nodeCount; + return object; + }; + + /** + * Converts this ImageClassificationModelMetadata to JSON. + * @function toJSON + * @memberof google.cloud.automl.v1beta1.ImageClassificationModelMetadata + * @instance + * @returns {Object.} JSON object + */ + ImageClassificationModelMetadata.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ImageClassificationModelMetadata + * @function getTypeUrl + * @memberof google.cloud.automl.v1beta1.ImageClassificationModelMetadata + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ImageClassificationModelMetadata.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.automl.v1beta1.ImageClassificationModelMetadata"; + }; + + return ImageClassificationModelMetadata; + })(); + + v1beta1.ImageObjectDetectionModelMetadata = (function() { + + /** + * Properties of an ImageObjectDetectionModelMetadata. + * @memberof google.cloud.automl.v1beta1 + * @interface IImageObjectDetectionModelMetadata + * @property {string|null} [modelType] ImageObjectDetectionModelMetadata modelType + * @property {number|Long|null} [nodeCount] ImageObjectDetectionModelMetadata nodeCount + * @property {number|null} [nodeQps] ImageObjectDetectionModelMetadata nodeQps + * @property {string|null} [stopReason] ImageObjectDetectionModelMetadata stopReason + * @property {number|Long|null} [trainBudgetMilliNodeHours] ImageObjectDetectionModelMetadata trainBudgetMilliNodeHours + * @property {number|Long|null} [trainCostMilliNodeHours] ImageObjectDetectionModelMetadata trainCostMilliNodeHours + */ + + /** + * Constructs a new ImageObjectDetectionModelMetadata. + * @memberof google.cloud.automl.v1beta1 + * @classdesc Represents an ImageObjectDetectionModelMetadata. + * @implements IImageObjectDetectionModelMetadata + * @constructor + * @param {google.cloud.automl.v1beta1.IImageObjectDetectionModelMetadata=} [properties] Properties to set + */ + function ImageObjectDetectionModelMetadata(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ImageObjectDetectionModelMetadata modelType. + * @member {string} modelType + * @memberof google.cloud.automl.v1beta1.ImageObjectDetectionModelMetadata + * @instance + */ + ImageObjectDetectionModelMetadata.prototype.modelType = ""; + + /** + * ImageObjectDetectionModelMetadata nodeCount. + * @member {number|Long} nodeCount + * @memberof google.cloud.automl.v1beta1.ImageObjectDetectionModelMetadata + * @instance + */ + ImageObjectDetectionModelMetadata.prototype.nodeCount = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * ImageObjectDetectionModelMetadata nodeQps. + * @member {number} nodeQps + * @memberof google.cloud.automl.v1beta1.ImageObjectDetectionModelMetadata + * @instance + */ + ImageObjectDetectionModelMetadata.prototype.nodeQps = 0; + + /** + * ImageObjectDetectionModelMetadata stopReason. + * @member {string} stopReason + * @memberof google.cloud.automl.v1beta1.ImageObjectDetectionModelMetadata + * @instance + */ + ImageObjectDetectionModelMetadata.prototype.stopReason = ""; + + /** + * ImageObjectDetectionModelMetadata trainBudgetMilliNodeHours. + * @member {number|Long} trainBudgetMilliNodeHours + * @memberof google.cloud.automl.v1beta1.ImageObjectDetectionModelMetadata + * @instance + */ + ImageObjectDetectionModelMetadata.prototype.trainBudgetMilliNodeHours = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * ImageObjectDetectionModelMetadata trainCostMilliNodeHours. + * @member {number|Long} trainCostMilliNodeHours + * @memberof google.cloud.automl.v1beta1.ImageObjectDetectionModelMetadata + * @instance + */ + ImageObjectDetectionModelMetadata.prototype.trainCostMilliNodeHours = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new ImageObjectDetectionModelMetadata instance using the specified properties. + * @function create + * @memberof google.cloud.automl.v1beta1.ImageObjectDetectionModelMetadata + * @static + * @param {google.cloud.automl.v1beta1.IImageObjectDetectionModelMetadata=} [properties] Properties to set + * @returns {google.cloud.automl.v1beta1.ImageObjectDetectionModelMetadata} ImageObjectDetectionModelMetadata instance + */ + ImageObjectDetectionModelMetadata.create = function create(properties) { + return new ImageObjectDetectionModelMetadata(properties); + }; + + /** + * Encodes the specified ImageObjectDetectionModelMetadata message. Does not implicitly {@link google.cloud.automl.v1beta1.ImageObjectDetectionModelMetadata.verify|verify} messages. + * @function encode + * @memberof google.cloud.automl.v1beta1.ImageObjectDetectionModelMetadata + * @static + * @param {google.cloud.automl.v1beta1.IImageObjectDetectionModelMetadata} message ImageObjectDetectionModelMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ImageObjectDetectionModelMetadata.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.modelType != null && Object.hasOwnProperty.call(message, "modelType")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.modelType); + if (message.nodeCount != null && Object.hasOwnProperty.call(message, "nodeCount")) + writer.uint32(/* id 3, wireType 0 =*/24).int64(message.nodeCount); + if (message.nodeQps != null && Object.hasOwnProperty.call(message, "nodeQps")) + writer.uint32(/* id 4, wireType 1 =*/33).double(message.nodeQps); + if (message.stopReason != null && Object.hasOwnProperty.call(message, "stopReason")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.stopReason); + if (message.trainBudgetMilliNodeHours != null && Object.hasOwnProperty.call(message, "trainBudgetMilliNodeHours")) + writer.uint32(/* id 6, wireType 0 =*/48).int64(message.trainBudgetMilliNodeHours); + if (message.trainCostMilliNodeHours != null && Object.hasOwnProperty.call(message, "trainCostMilliNodeHours")) + writer.uint32(/* id 7, wireType 0 =*/56).int64(message.trainCostMilliNodeHours); + return writer; + }; + + /** + * Encodes the specified ImageObjectDetectionModelMetadata message, length delimited. Does not implicitly {@link google.cloud.automl.v1beta1.ImageObjectDetectionModelMetadata.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.automl.v1beta1.ImageObjectDetectionModelMetadata + * @static + * @param {google.cloud.automl.v1beta1.IImageObjectDetectionModelMetadata} message ImageObjectDetectionModelMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ImageObjectDetectionModelMetadata.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an ImageObjectDetectionModelMetadata message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.automl.v1beta1.ImageObjectDetectionModelMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.automl.v1beta1.ImageObjectDetectionModelMetadata} ImageObjectDetectionModelMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ImageObjectDetectionModelMetadata.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.automl.v1beta1.ImageObjectDetectionModelMetadata(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.modelType = reader.string(); + break; + } + case 3: { + message.nodeCount = reader.int64(); + break; + } + case 4: { + message.nodeQps = reader.double(); + break; + } + case 5: { + message.stopReason = reader.string(); + break; + } + case 6: { + message.trainBudgetMilliNodeHours = reader.int64(); + break; + } + case 7: { + message.trainCostMilliNodeHours = reader.int64(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an ImageObjectDetectionModelMetadata message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.automl.v1beta1.ImageObjectDetectionModelMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.automl.v1beta1.ImageObjectDetectionModelMetadata} ImageObjectDetectionModelMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ImageObjectDetectionModelMetadata.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an ImageObjectDetectionModelMetadata message. + * @function verify + * @memberof google.cloud.automl.v1beta1.ImageObjectDetectionModelMetadata + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ImageObjectDetectionModelMetadata.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.modelType != null && message.hasOwnProperty("modelType")) + if (!$util.isString(message.modelType)) + return "modelType: string expected"; + if (message.nodeCount != null && message.hasOwnProperty("nodeCount")) + if (!$util.isInteger(message.nodeCount) && !(message.nodeCount && $util.isInteger(message.nodeCount.low) && $util.isInteger(message.nodeCount.high))) + return "nodeCount: integer|Long expected"; + if (message.nodeQps != null && message.hasOwnProperty("nodeQps")) + if (typeof message.nodeQps !== "number") + return "nodeQps: number expected"; + if (message.stopReason != null && message.hasOwnProperty("stopReason")) + if (!$util.isString(message.stopReason)) + return "stopReason: string expected"; + if (message.trainBudgetMilliNodeHours != null && message.hasOwnProperty("trainBudgetMilliNodeHours")) + if (!$util.isInteger(message.trainBudgetMilliNodeHours) && !(message.trainBudgetMilliNodeHours && $util.isInteger(message.trainBudgetMilliNodeHours.low) && $util.isInteger(message.trainBudgetMilliNodeHours.high))) + return "trainBudgetMilliNodeHours: integer|Long expected"; + if (message.trainCostMilliNodeHours != null && message.hasOwnProperty("trainCostMilliNodeHours")) + if (!$util.isInteger(message.trainCostMilliNodeHours) && !(message.trainCostMilliNodeHours && $util.isInteger(message.trainCostMilliNodeHours.low) && $util.isInteger(message.trainCostMilliNodeHours.high))) + return "trainCostMilliNodeHours: integer|Long expected"; + return null; + }; + + /** + * Creates an ImageObjectDetectionModelMetadata message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.automl.v1beta1.ImageObjectDetectionModelMetadata + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.automl.v1beta1.ImageObjectDetectionModelMetadata} ImageObjectDetectionModelMetadata + */ + ImageObjectDetectionModelMetadata.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.automl.v1beta1.ImageObjectDetectionModelMetadata) + return object; + var message = new $root.google.cloud.automl.v1beta1.ImageObjectDetectionModelMetadata(); + if (object.modelType != null) + message.modelType = String(object.modelType); + if (object.nodeCount != null) + if ($util.Long) + (message.nodeCount = $util.Long.fromValue(object.nodeCount)).unsigned = false; + else if (typeof object.nodeCount === "string") + message.nodeCount = parseInt(object.nodeCount, 10); + else if (typeof object.nodeCount === "number") + message.nodeCount = object.nodeCount; + else if (typeof object.nodeCount === "object") + message.nodeCount = new $util.LongBits(object.nodeCount.low >>> 0, object.nodeCount.high >>> 0).toNumber(); + if (object.nodeQps != null) + message.nodeQps = Number(object.nodeQps); + if (object.stopReason != null) + message.stopReason = String(object.stopReason); + if (object.trainBudgetMilliNodeHours != null) + if ($util.Long) + (message.trainBudgetMilliNodeHours = $util.Long.fromValue(object.trainBudgetMilliNodeHours)).unsigned = false; + else if (typeof object.trainBudgetMilliNodeHours === "string") + message.trainBudgetMilliNodeHours = parseInt(object.trainBudgetMilliNodeHours, 10); + else if (typeof object.trainBudgetMilliNodeHours === "number") + message.trainBudgetMilliNodeHours = object.trainBudgetMilliNodeHours; + else if (typeof object.trainBudgetMilliNodeHours === "object") + message.trainBudgetMilliNodeHours = new $util.LongBits(object.trainBudgetMilliNodeHours.low >>> 0, object.trainBudgetMilliNodeHours.high >>> 0).toNumber(); + if (object.trainCostMilliNodeHours != null) + if ($util.Long) + (message.trainCostMilliNodeHours = $util.Long.fromValue(object.trainCostMilliNodeHours)).unsigned = false; + else if (typeof object.trainCostMilliNodeHours === "string") + message.trainCostMilliNodeHours = parseInt(object.trainCostMilliNodeHours, 10); + else if (typeof object.trainCostMilliNodeHours === "number") + message.trainCostMilliNodeHours = object.trainCostMilliNodeHours; + else if (typeof object.trainCostMilliNodeHours === "object") + message.trainCostMilliNodeHours = new $util.LongBits(object.trainCostMilliNodeHours.low >>> 0, object.trainCostMilliNodeHours.high >>> 0).toNumber(); + return message; + }; + + /** + * Creates a plain object from an ImageObjectDetectionModelMetadata message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.automl.v1beta1.ImageObjectDetectionModelMetadata + * @static + * @param {google.cloud.automl.v1beta1.ImageObjectDetectionModelMetadata} message ImageObjectDetectionModelMetadata + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ImageObjectDetectionModelMetadata.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.modelType = ""; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.nodeCount = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.nodeCount = options.longs === String ? "0" : 0; + object.nodeQps = 0; + object.stopReason = ""; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.trainBudgetMilliNodeHours = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.trainBudgetMilliNodeHours = options.longs === String ? "0" : 0; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.trainCostMilliNodeHours = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.trainCostMilliNodeHours = options.longs === String ? "0" : 0; + } + if (message.modelType != null && message.hasOwnProperty("modelType")) + object.modelType = message.modelType; + if (message.nodeCount != null && message.hasOwnProperty("nodeCount")) + if (typeof message.nodeCount === "number") + object.nodeCount = options.longs === String ? String(message.nodeCount) : message.nodeCount; + else + object.nodeCount = options.longs === String ? $util.Long.prototype.toString.call(message.nodeCount) : options.longs === Number ? new $util.LongBits(message.nodeCount.low >>> 0, message.nodeCount.high >>> 0).toNumber() : message.nodeCount; + if (message.nodeQps != null && message.hasOwnProperty("nodeQps")) + object.nodeQps = options.json && !isFinite(message.nodeQps) ? String(message.nodeQps) : message.nodeQps; + if (message.stopReason != null && message.hasOwnProperty("stopReason")) + object.stopReason = message.stopReason; + if (message.trainBudgetMilliNodeHours != null && message.hasOwnProperty("trainBudgetMilliNodeHours")) + if (typeof message.trainBudgetMilliNodeHours === "number") + object.trainBudgetMilliNodeHours = options.longs === String ? String(message.trainBudgetMilliNodeHours) : message.trainBudgetMilliNodeHours; + else + object.trainBudgetMilliNodeHours = options.longs === String ? $util.Long.prototype.toString.call(message.trainBudgetMilliNodeHours) : options.longs === Number ? new $util.LongBits(message.trainBudgetMilliNodeHours.low >>> 0, message.trainBudgetMilliNodeHours.high >>> 0).toNumber() : message.trainBudgetMilliNodeHours; + if (message.trainCostMilliNodeHours != null && message.hasOwnProperty("trainCostMilliNodeHours")) + if (typeof message.trainCostMilliNodeHours === "number") + object.trainCostMilliNodeHours = options.longs === String ? String(message.trainCostMilliNodeHours) : message.trainCostMilliNodeHours; + else + object.trainCostMilliNodeHours = options.longs === String ? $util.Long.prototype.toString.call(message.trainCostMilliNodeHours) : options.longs === Number ? new $util.LongBits(message.trainCostMilliNodeHours.low >>> 0, message.trainCostMilliNodeHours.high >>> 0).toNumber() : message.trainCostMilliNodeHours; + return object; + }; + + /** + * Converts this ImageObjectDetectionModelMetadata to JSON. + * @function toJSON + * @memberof google.cloud.automl.v1beta1.ImageObjectDetectionModelMetadata + * @instance + * @returns {Object.} JSON object + */ + ImageObjectDetectionModelMetadata.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ImageObjectDetectionModelMetadata + * @function getTypeUrl + * @memberof google.cloud.automl.v1beta1.ImageObjectDetectionModelMetadata + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ImageObjectDetectionModelMetadata.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.automl.v1beta1.ImageObjectDetectionModelMetadata"; + }; + + return ImageObjectDetectionModelMetadata; + })(); + + v1beta1.ImageClassificationModelDeploymentMetadata = (function() { + + /** + * Properties of an ImageClassificationModelDeploymentMetadata. + * @memberof google.cloud.automl.v1beta1 + * @interface IImageClassificationModelDeploymentMetadata + * @property {number|Long|null} [nodeCount] ImageClassificationModelDeploymentMetadata nodeCount + */ + + /** + * Constructs a new ImageClassificationModelDeploymentMetadata. + * @memberof google.cloud.automl.v1beta1 + * @classdesc Represents an ImageClassificationModelDeploymentMetadata. + * @implements IImageClassificationModelDeploymentMetadata + * @constructor + * @param {google.cloud.automl.v1beta1.IImageClassificationModelDeploymentMetadata=} [properties] Properties to set + */ + function ImageClassificationModelDeploymentMetadata(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ImageClassificationModelDeploymentMetadata nodeCount. + * @member {number|Long} nodeCount + * @memberof google.cloud.automl.v1beta1.ImageClassificationModelDeploymentMetadata + * @instance + */ + ImageClassificationModelDeploymentMetadata.prototype.nodeCount = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new ImageClassificationModelDeploymentMetadata instance using the specified properties. + * @function create + * @memberof google.cloud.automl.v1beta1.ImageClassificationModelDeploymentMetadata + * @static + * @param {google.cloud.automl.v1beta1.IImageClassificationModelDeploymentMetadata=} [properties] Properties to set + * @returns {google.cloud.automl.v1beta1.ImageClassificationModelDeploymentMetadata} ImageClassificationModelDeploymentMetadata instance + */ + ImageClassificationModelDeploymentMetadata.create = function create(properties) { + return new ImageClassificationModelDeploymentMetadata(properties); + }; + + /** + * Encodes the specified ImageClassificationModelDeploymentMetadata message. Does not implicitly {@link google.cloud.automl.v1beta1.ImageClassificationModelDeploymentMetadata.verify|verify} messages. + * @function encode + * @memberof google.cloud.automl.v1beta1.ImageClassificationModelDeploymentMetadata + * @static + * @param {google.cloud.automl.v1beta1.IImageClassificationModelDeploymentMetadata} message ImageClassificationModelDeploymentMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ImageClassificationModelDeploymentMetadata.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.nodeCount != null && Object.hasOwnProperty.call(message, "nodeCount")) + writer.uint32(/* id 1, wireType 0 =*/8).int64(message.nodeCount); + return writer; + }; + + /** + * Encodes the specified ImageClassificationModelDeploymentMetadata message, length delimited. Does not implicitly {@link google.cloud.automl.v1beta1.ImageClassificationModelDeploymentMetadata.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.automl.v1beta1.ImageClassificationModelDeploymentMetadata + * @static + * @param {google.cloud.automl.v1beta1.IImageClassificationModelDeploymentMetadata} message ImageClassificationModelDeploymentMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ImageClassificationModelDeploymentMetadata.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an ImageClassificationModelDeploymentMetadata message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.automl.v1beta1.ImageClassificationModelDeploymentMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.automl.v1beta1.ImageClassificationModelDeploymentMetadata} ImageClassificationModelDeploymentMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ImageClassificationModelDeploymentMetadata.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.automl.v1beta1.ImageClassificationModelDeploymentMetadata(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.nodeCount = reader.int64(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an ImageClassificationModelDeploymentMetadata message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.automl.v1beta1.ImageClassificationModelDeploymentMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.automl.v1beta1.ImageClassificationModelDeploymentMetadata} ImageClassificationModelDeploymentMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ImageClassificationModelDeploymentMetadata.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an ImageClassificationModelDeploymentMetadata message. + * @function verify + * @memberof google.cloud.automl.v1beta1.ImageClassificationModelDeploymentMetadata + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ImageClassificationModelDeploymentMetadata.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.nodeCount != null && message.hasOwnProperty("nodeCount")) + if (!$util.isInteger(message.nodeCount) && !(message.nodeCount && $util.isInteger(message.nodeCount.low) && $util.isInteger(message.nodeCount.high))) + return "nodeCount: integer|Long expected"; + return null; + }; + + /** + * Creates an ImageClassificationModelDeploymentMetadata message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.automl.v1beta1.ImageClassificationModelDeploymentMetadata + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.automl.v1beta1.ImageClassificationModelDeploymentMetadata} ImageClassificationModelDeploymentMetadata + */ + ImageClassificationModelDeploymentMetadata.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.automl.v1beta1.ImageClassificationModelDeploymentMetadata) + return object; + var message = new $root.google.cloud.automl.v1beta1.ImageClassificationModelDeploymentMetadata(); + if (object.nodeCount != null) + if ($util.Long) + (message.nodeCount = $util.Long.fromValue(object.nodeCount)).unsigned = false; + else if (typeof object.nodeCount === "string") + message.nodeCount = parseInt(object.nodeCount, 10); + else if (typeof object.nodeCount === "number") + message.nodeCount = object.nodeCount; + else if (typeof object.nodeCount === "object") + message.nodeCount = new $util.LongBits(object.nodeCount.low >>> 0, object.nodeCount.high >>> 0).toNumber(); + return message; + }; + + /** + * Creates a plain object from an ImageClassificationModelDeploymentMetadata message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.automl.v1beta1.ImageClassificationModelDeploymentMetadata + * @static + * @param {google.cloud.automl.v1beta1.ImageClassificationModelDeploymentMetadata} message ImageClassificationModelDeploymentMetadata + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ImageClassificationModelDeploymentMetadata.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.nodeCount = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.nodeCount = options.longs === String ? "0" : 0; + if (message.nodeCount != null && message.hasOwnProperty("nodeCount")) + if (typeof message.nodeCount === "number") + object.nodeCount = options.longs === String ? String(message.nodeCount) : message.nodeCount; + else + object.nodeCount = options.longs === String ? $util.Long.prototype.toString.call(message.nodeCount) : options.longs === Number ? new $util.LongBits(message.nodeCount.low >>> 0, message.nodeCount.high >>> 0).toNumber() : message.nodeCount; + return object; + }; + + /** + * Converts this ImageClassificationModelDeploymentMetadata to JSON. + * @function toJSON + * @memberof google.cloud.automl.v1beta1.ImageClassificationModelDeploymentMetadata + * @instance + * @returns {Object.} JSON object + */ + ImageClassificationModelDeploymentMetadata.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ImageClassificationModelDeploymentMetadata + * @function getTypeUrl + * @memberof google.cloud.automl.v1beta1.ImageClassificationModelDeploymentMetadata + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ImageClassificationModelDeploymentMetadata.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.automl.v1beta1.ImageClassificationModelDeploymentMetadata"; + }; + + return ImageClassificationModelDeploymentMetadata; + })(); + + v1beta1.ImageObjectDetectionModelDeploymentMetadata = (function() { + + /** + * Properties of an ImageObjectDetectionModelDeploymentMetadata. + * @memberof google.cloud.automl.v1beta1 + * @interface IImageObjectDetectionModelDeploymentMetadata + * @property {number|Long|null} [nodeCount] ImageObjectDetectionModelDeploymentMetadata nodeCount + */ + + /** + * Constructs a new ImageObjectDetectionModelDeploymentMetadata. + * @memberof google.cloud.automl.v1beta1 + * @classdesc Represents an ImageObjectDetectionModelDeploymentMetadata. + * @implements IImageObjectDetectionModelDeploymentMetadata + * @constructor + * @param {google.cloud.automl.v1beta1.IImageObjectDetectionModelDeploymentMetadata=} [properties] Properties to set + */ + function ImageObjectDetectionModelDeploymentMetadata(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ImageObjectDetectionModelDeploymentMetadata nodeCount. + * @member {number|Long} nodeCount + * @memberof google.cloud.automl.v1beta1.ImageObjectDetectionModelDeploymentMetadata + * @instance + */ + ImageObjectDetectionModelDeploymentMetadata.prototype.nodeCount = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new ImageObjectDetectionModelDeploymentMetadata instance using the specified properties. + * @function create + * @memberof google.cloud.automl.v1beta1.ImageObjectDetectionModelDeploymentMetadata + * @static + * @param {google.cloud.automl.v1beta1.IImageObjectDetectionModelDeploymentMetadata=} [properties] Properties to set + * @returns {google.cloud.automl.v1beta1.ImageObjectDetectionModelDeploymentMetadata} ImageObjectDetectionModelDeploymentMetadata instance + */ + ImageObjectDetectionModelDeploymentMetadata.create = function create(properties) { + return new ImageObjectDetectionModelDeploymentMetadata(properties); + }; + + /** + * Encodes the specified ImageObjectDetectionModelDeploymentMetadata message. Does not implicitly {@link google.cloud.automl.v1beta1.ImageObjectDetectionModelDeploymentMetadata.verify|verify} messages. + * @function encode + * @memberof google.cloud.automl.v1beta1.ImageObjectDetectionModelDeploymentMetadata + * @static + * @param {google.cloud.automl.v1beta1.IImageObjectDetectionModelDeploymentMetadata} message ImageObjectDetectionModelDeploymentMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ImageObjectDetectionModelDeploymentMetadata.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.nodeCount != null && Object.hasOwnProperty.call(message, "nodeCount")) + writer.uint32(/* id 1, wireType 0 =*/8).int64(message.nodeCount); + return writer; + }; + + /** + * Encodes the specified ImageObjectDetectionModelDeploymentMetadata message, length delimited. Does not implicitly {@link google.cloud.automl.v1beta1.ImageObjectDetectionModelDeploymentMetadata.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.automl.v1beta1.ImageObjectDetectionModelDeploymentMetadata + * @static + * @param {google.cloud.automl.v1beta1.IImageObjectDetectionModelDeploymentMetadata} message ImageObjectDetectionModelDeploymentMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ImageObjectDetectionModelDeploymentMetadata.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an ImageObjectDetectionModelDeploymentMetadata message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.automl.v1beta1.ImageObjectDetectionModelDeploymentMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.automl.v1beta1.ImageObjectDetectionModelDeploymentMetadata} ImageObjectDetectionModelDeploymentMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ImageObjectDetectionModelDeploymentMetadata.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.automl.v1beta1.ImageObjectDetectionModelDeploymentMetadata(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.nodeCount = reader.int64(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an ImageObjectDetectionModelDeploymentMetadata message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.automl.v1beta1.ImageObjectDetectionModelDeploymentMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.automl.v1beta1.ImageObjectDetectionModelDeploymentMetadata} ImageObjectDetectionModelDeploymentMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ImageObjectDetectionModelDeploymentMetadata.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an ImageObjectDetectionModelDeploymentMetadata message. + * @function verify + * @memberof google.cloud.automl.v1beta1.ImageObjectDetectionModelDeploymentMetadata + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ImageObjectDetectionModelDeploymentMetadata.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.nodeCount != null && message.hasOwnProperty("nodeCount")) + if (!$util.isInteger(message.nodeCount) && !(message.nodeCount && $util.isInteger(message.nodeCount.low) && $util.isInteger(message.nodeCount.high))) + return "nodeCount: integer|Long expected"; + return null; + }; + + /** + * Creates an ImageObjectDetectionModelDeploymentMetadata message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.automl.v1beta1.ImageObjectDetectionModelDeploymentMetadata + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.automl.v1beta1.ImageObjectDetectionModelDeploymentMetadata} ImageObjectDetectionModelDeploymentMetadata + */ + ImageObjectDetectionModelDeploymentMetadata.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.automl.v1beta1.ImageObjectDetectionModelDeploymentMetadata) + return object; + var message = new $root.google.cloud.automl.v1beta1.ImageObjectDetectionModelDeploymentMetadata(); + if (object.nodeCount != null) + if ($util.Long) + (message.nodeCount = $util.Long.fromValue(object.nodeCount)).unsigned = false; + else if (typeof object.nodeCount === "string") + message.nodeCount = parseInt(object.nodeCount, 10); + else if (typeof object.nodeCount === "number") + message.nodeCount = object.nodeCount; + else if (typeof object.nodeCount === "object") + message.nodeCount = new $util.LongBits(object.nodeCount.low >>> 0, object.nodeCount.high >>> 0).toNumber(); + return message; + }; + + /** + * Creates a plain object from an ImageObjectDetectionModelDeploymentMetadata message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.automl.v1beta1.ImageObjectDetectionModelDeploymentMetadata + * @static + * @param {google.cloud.automl.v1beta1.ImageObjectDetectionModelDeploymentMetadata} message ImageObjectDetectionModelDeploymentMetadata + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ImageObjectDetectionModelDeploymentMetadata.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.nodeCount = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.nodeCount = options.longs === String ? "0" : 0; + if (message.nodeCount != null && message.hasOwnProperty("nodeCount")) + if (typeof message.nodeCount === "number") + object.nodeCount = options.longs === String ? String(message.nodeCount) : message.nodeCount; + else + object.nodeCount = options.longs === String ? $util.Long.prototype.toString.call(message.nodeCount) : options.longs === Number ? new $util.LongBits(message.nodeCount.low >>> 0, message.nodeCount.high >>> 0).toNumber() : message.nodeCount; + return object; + }; + + /** + * Converts this ImageObjectDetectionModelDeploymentMetadata to JSON. + * @function toJSON + * @memberof google.cloud.automl.v1beta1.ImageObjectDetectionModelDeploymentMetadata + * @instance + * @returns {Object.} JSON object + */ + ImageObjectDetectionModelDeploymentMetadata.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ImageObjectDetectionModelDeploymentMetadata + * @function getTypeUrl + * @memberof google.cloud.automl.v1beta1.ImageObjectDetectionModelDeploymentMetadata + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ImageObjectDetectionModelDeploymentMetadata.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.automl.v1beta1.ImageObjectDetectionModelDeploymentMetadata"; + }; + + return ImageObjectDetectionModelDeploymentMetadata; + })(); + + v1beta1.TextClassificationDatasetMetadata = (function() { + + /** + * Properties of a TextClassificationDatasetMetadata. + * @memberof google.cloud.automl.v1beta1 + * @interface ITextClassificationDatasetMetadata + * @property {google.cloud.automl.v1beta1.ClassificationType|null} [classificationType] TextClassificationDatasetMetadata classificationType + */ + + /** + * Constructs a new TextClassificationDatasetMetadata. + * @memberof google.cloud.automl.v1beta1 + * @classdesc Represents a TextClassificationDatasetMetadata. + * @implements ITextClassificationDatasetMetadata + * @constructor + * @param {google.cloud.automl.v1beta1.ITextClassificationDatasetMetadata=} [properties] Properties to set + */ + function TextClassificationDatasetMetadata(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * TextClassificationDatasetMetadata classificationType. + * @member {google.cloud.automl.v1beta1.ClassificationType} classificationType + * @memberof google.cloud.automl.v1beta1.TextClassificationDatasetMetadata + * @instance + */ + TextClassificationDatasetMetadata.prototype.classificationType = 0; + + /** + * Creates a new TextClassificationDatasetMetadata instance using the specified properties. + * @function create + * @memberof google.cloud.automl.v1beta1.TextClassificationDatasetMetadata + * @static + * @param {google.cloud.automl.v1beta1.ITextClassificationDatasetMetadata=} [properties] Properties to set + * @returns {google.cloud.automl.v1beta1.TextClassificationDatasetMetadata} TextClassificationDatasetMetadata instance + */ + TextClassificationDatasetMetadata.create = function create(properties) { + return new TextClassificationDatasetMetadata(properties); + }; + + /** + * Encodes the specified TextClassificationDatasetMetadata message. Does not implicitly {@link google.cloud.automl.v1beta1.TextClassificationDatasetMetadata.verify|verify} messages. + * @function encode + * @memberof google.cloud.automl.v1beta1.TextClassificationDatasetMetadata + * @static + * @param {google.cloud.automl.v1beta1.ITextClassificationDatasetMetadata} message TextClassificationDatasetMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TextClassificationDatasetMetadata.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.classificationType != null && Object.hasOwnProperty.call(message, "classificationType")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.classificationType); + return writer; + }; + + /** + * Encodes the specified TextClassificationDatasetMetadata message, length delimited. Does not implicitly {@link google.cloud.automl.v1beta1.TextClassificationDatasetMetadata.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.automl.v1beta1.TextClassificationDatasetMetadata + * @static + * @param {google.cloud.automl.v1beta1.ITextClassificationDatasetMetadata} message TextClassificationDatasetMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TextClassificationDatasetMetadata.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a TextClassificationDatasetMetadata message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.automl.v1beta1.TextClassificationDatasetMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.automl.v1beta1.TextClassificationDatasetMetadata} TextClassificationDatasetMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TextClassificationDatasetMetadata.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.automl.v1beta1.TextClassificationDatasetMetadata(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.classificationType = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a TextClassificationDatasetMetadata message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.automl.v1beta1.TextClassificationDatasetMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.automl.v1beta1.TextClassificationDatasetMetadata} TextClassificationDatasetMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TextClassificationDatasetMetadata.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a TextClassificationDatasetMetadata message. + * @function verify + * @memberof google.cloud.automl.v1beta1.TextClassificationDatasetMetadata + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + TextClassificationDatasetMetadata.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.classificationType != null && message.hasOwnProperty("classificationType")) + switch (message.classificationType) { + default: + return "classificationType: enum value expected"; + case 0: + case 1: + case 2: + break; + } + return null; + }; + + /** + * Creates a TextClassificationDatasetMetadata message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.automl.v1beta1.TextClassificationDatasetMetadata + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.automl.v1beta1.TextClassificationDatasetMetadata} TextClassificationDatasetMetadata + */ + TextClassificationDatasetMetadata.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.automl.v1beta1.TextClassificationDatasetMetadata) + return object; + var message = new $root.google.cloud.automl.v1beta1.TextClassificationDatasetMetadata(); + switch (object.classificationType) { + default: + if (typeof object.classificationType === "number") { + message.classificationType = object.classificationType; + break; + } + break; + case "CLASSIFICATION_TYPE_UNSPECIFIED": + case 0: + message.classificationType = 0; + break; + case "MULTICLASS": + case 1: + message.classificationType = 1; + break; + case "MULTILABEL": + case 2: + message.classificationType = 2; + break; + } + return message; + }; + + /** + * Creates a plain object from a TextClassificationDatasetMetadata message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.automl.v1beta1.TextClassificationDatasetMetadata + * @static + * @param {google.cloud.automl.v1beta1.TextClassificationDatasetMetadata} message TextClassificationDatasetMetadata + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + TextClassificationDatasetMetadata.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.classificationType = options.enums === String ? "CLASSIFICATION_TYPE_UNSPECIFIED" : 0; + if (message.classificationType != null && message.hasOwnProperty("classificationType")) + object.classificationType = options.enums === String ? $root.google.cloud.automl.v1beta1.ClassificationType[message.classificationType] === undefined ? message.classificationType : $root.google.cloud.automl.v1beta1.ClassificationType[message.classificationType] : message.classificationType; + return object; + }; + + /** + * Converts this TextClassificationDatasetMetadata to JSON. + * @function toJSON + * @memberof google.cloud.automl.v1beta1.TextClassificationDatasetMetadata + * @instance + * @returns {Object.} JSON object + */ + TextClassificationDatasetMetadata.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for TextClassificationDatasetMetadata + * @function getTypeUrl + * @memberof google.cloud.automl.v1beta1.TextClassificationDatasetMetadata + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TextClassificationDatasetMetadata.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.automl.v1beta1.TextClassificationDatasetMetadata"; + }; + + return TextClassificationDatasetMetadata; + })(); + + v1beta1.TextClassificationModelMetadata = (function() { + + /** + * Properties of a TextClassificationModelMetadata. + * @memberof google.cloud.automl.v1beta1 + * @interface ITextClassificationModelMetadata + * @property {google.cloud.automl.v1beta1.ClassificationType|null} [classificationType] TextClassificationModelMetadata classificationType + */ + + /** + * Constructs a new TextClassificationModelMetadata. + * @memberof google.cloud.automl.v1beta1 + * @classdesc Represents a TextClassificationModelMetadata. + * @implements ITextClassificationModelMetadata + * @constructor + * @param {google.cloud.automl.v1beta1.ITextClassificationModelMetadata=} [properties] Properties to set + */ + function TextClassificationModelMetadata(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * TextClassificationModelMetadata classificationType. + * @member {google.cloud.automl.v1beta1.ClassificationType} classificationType + * @memberof google.cloud.automl.v1beta1.TextClassificationModelMetadata + * @instance + */ + TextClassificationModelMetadata.prototype.classificationType = 0; + + /** + * Creates a new TextClassificationModelMetadata instance using the specified properties. + * @function create + * @memberof google.cloud.automl.v1beta1.TextClassificationModelMetadata + * @static + * @param {google.cloud.automl.v1beta1.ITextClassificationModelMetadata=} [properties] Properties to set + * @returns {google.cloud.automl.v1beta1.TextClassificationModelMetadata} TextClassificationModelMetadata instance + */ + TextClassificationModelMetadata.create = function create(properties) { + return new TextClassificationModelMetadata(properties); + }; + + /** + * Encodes the specified TextClassificationModelMetadata message. Does not implicitly {@link google.cloud.automl.v1beta1.TextClassificationModelMetadata.verify|verify} messages. + * @function encode + * @memberof google.cloud.automl.v1beta1.TextClassificationModelMetadata + * @static + * @param {google.cloud.automl.v1beta1.ITextClassificationModelMetadata} message TextClassificationModelMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TextClassificationModelMetadata.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.classificationType != null && Object.hasOwnProperty.call(message, "classificationType")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.classificationType); + return writer; + }; + + /** + * Encodes the specified TextClassificationModelMetadata message, length delimited. Does not implicitly {@link google.cloud.automl.v1beta1.TextClassificationModelMetadata.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.automl.v1beta1.TextClassificationModelMetadata + * @static + * @param {google.cloud.automl.v1beta1.ITextClassificationModelMetadata} message TextClassificationModelMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TextClassificationModelMetadata.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a TextClassificationModelMetadata message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.automl.v1beta1.TextClassificationModelMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.automl.v1beta1.TextClassificationModelMetadata} TextClassificationModelMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TextClassificationModelMetadata.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.automl.v1beta1.TextClassificationModelMetadata(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 3: { + message.classificationType = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a TextClassificationModelMetadata message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.automl.v1beta1.TextClassificationModelMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.automl.v1beta1.TextClassificationModelMetadata} TextClassificationModelMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TextClassificationModelMetadata.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a TextClassificationModelMetadata message. + * @function verify + * @memberof google.cloud.automl.v1beta1.TextClassificationModelMetadata + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + TextClassificationModelMetadata.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.classificationType != null && message.hasOwnProperty("classificationType")) + switch (message.classificationType) { + default: + return "classificationType: enum value expected"; + case 0: + case 1: + case 2: + break; + } + return null; + }; + + /** + * Creates a TextClassificationModelMetadata message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.automl.v1beta1.TextClassificationModelMetadata + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.automl.v1beta1.TextClassificationModelMetadata} TextClassificationModelMetadata + */ + TextClassificationModelMetadata.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.automl.v1beta1.TextClassificationModelMetadata) + return object; + var message = new $root.google.cloud.automl.v1beta1.TextClassificationModelMetadata(); + switch (object.classificationType) { + default: + if (typeof object.classificationType === "number") { + message.classificationType = object.classificationType; + break; + } + break; + case "CLASSIFICATION_TYPE_UNSPECIFIED": + case 0: + message.classificationType = 0; + break; + case "MULTICLASS": + case 1: + message.classificationType = 1; + break; + case "MULTILABEL": + case 2: + message.classificationType = 2; + break; + } + return message; + }; + + /** + * Creates a plain object from a TextClassificationModelMetadata message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.automl.v1beta1.TextClassificationModelMetadata + * @static + * @param {google.cloud.automl.v1beta1.TextClassificationModelMetadata} message TextClassificationModelMetadata + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + TextClassificationModelMetadata.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.classificationType = options.enums === String ? "CLASSIFICATION_TYPE_UNSPECIFIED" : 0; + if (message.classificationType != null && message.hasOwnProperty("classificationType")) + object.classificationType = options.enums === String ? $root.google.cloud.automl.v1beta1.ClassificationType[message.classificationType] === undefined ? message.classificationType : $root.google.cloud.automl.v1beta1.ClassificationType[message.classificationType] : message.classificationType; + return object; + }; + + /** + * Converts this TextClassificationModelMetadata to JSON. + * @function toJSON + * @memberof google.cloud.automl.v1beta1.TextClassificationModelMetadata + * @instance + * @returns {Object.} JSON object + */ + TextClassificationModelMetadata.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for TextClassificationModelMetadata + * @function getTypeUrl + * @memberof google.cloud.automl.v1beta1.TextClassificationModelMetadata + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TextClassificationModelMetadata.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.automl.v1beta1.TextClassificationModelMetadata"; + }; + + return TextClassificationModelMetadata; + })(); + + v1beta1.TextExtractionDatasetMetadata = (function() { + + /** + * Properties of a TextExtractionDatasetMetadata. + * @memberof google.cloud.automl.v1beta1 + * @interface ITextExtractionDatasetMetadata + */ + + /** + * Constructs a new TextExtractionDatasetMetadata. + * @memberof google.cloud.automl.v1beta1 + * @classdesc Represents a TextExtractionDatasetMetadata. + * @implements ITextExtractionDatasetMetadata + * @constructor + * @param {google.cloud.automl.v1beta1.ITextExtractionDatasetMetadata=} [properties] Properties to set + */ + function TextExtractionDatasetMetadata(properties) { + if (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 TextExtractionDatasetMetadata instance using the specified properties. + * @function create + * @memberof google.cloud.automl.v1beta1.TextExtractionDatasetMetadata + * @static + * @param {google.cloud.automl.v1beta1.ITextExtractionDatasetMetadata=} [properties] Properties to set + * @returns {google.cloud.automl.v1beta1.TextExtractionDatasetMetadata} TextExtractionDatasetMetadata instance + */ + TextExtractionDatasetMetadata.create = function create(properties) { + return new TextExtractionDatasetMetadata(properties); + }; + + /** + * Encodes the specified TextExtractionDatasetMetadata message. Does not implicitly {@link google.cloud.automl.v1beta1.TextExtractionDatasetMetadata.verify|verify} messages. + * @function encode + * @memberof google.cloud.automl.v1beta1.TextExtractionDatasetMetadata + * @static + * @param {google.cloud.automl.v1beta1.ITextExtractionDatasetMetadata} message TextExtractionDatasetMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TextExtractionDatasetMetadata.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + return writer; + }; + + /** + * Encodes the specified TextExtractionDatasetMetadata message, length delimited. Does not implicitly {@link google.cloud.automl.v1beta1.TextExtractionDatasetMetadata.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.automl.v1beta1.TextExtractionDatasetMetadata + * @static + * @param {google.cloud.automl.v1beta1.ITextExtractionDatasetMetadata} message TextExtractionDatasetMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TextExtractionDatasetMetadata.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a TextExtractionDatasetMetadata message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.automl.v1beta1.TextExtractionDatasetMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.automl.v1beta1.TextExtractionDatasetMetadata} TextExtractionDatasetMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TextExtractionDatasetMetadata.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.automl.v1beta1.TextExtractionDatasetMetadata(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a TextExtractionDatasetMetadata message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.automl.v1beta1.TextExtractionDatasetMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.automl.v1beta1.TextExtractionDatasetMetadata} TextExtractionDatasetMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TextExtractionDatasetMetadata.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a TextExtractionDatasetMetadata message. + * @function verify + * @memberof google.cloud.automl.v1beta1.TextExtractionDatasetMetadata + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + TextExtractionDatasetMetadata.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + return null; + }; + + /** + * Creates a TextExtractionDatasetMetadata message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.automl.v1beta1.TextExtractionDatasetMetadata + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.automl.v1beta1.TextExtractionDatasetMetadata} TextExtractionDatasetMetadata + */ + TextExtractionDatasetMetadata.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.automl.v1beta1.TextExtractionDatasetMetadata) + return object; + return new $root.google.cloud.automl.v1beta1.TextExtractionDatasetMetadata(); + }; + + /** + * Creates a plain object from a TextExtractionDatasetMetadata message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.automl.v1beta1.TextExtractionDatasetMetadata + * @static + * @param {google.cloud.automl.v1beta1.TextExtractionDatasetMetadata} message TextExtractionDatasetMetadata + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + TextExtractionDatasetMetadata.toObject = function toObject() { + return {}; + }; + + /** + * Converts this TextExtractionDatasetMetadata to JSON. + * @function toJSON + * @memberof google.cloud.automl.v1beta1.TextExtractionDatasetMetadata + * @instance + * @returns {Object.} JSON object + */ + TextExtractionDatasetMetadata.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for TextExtractionDatasetMetadata + * @function getTypeUrl + * @memberof google.cloud.automl.v1beta1.TextExtractionDatasetMetadata + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TextExtractionDatasetMetadata.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.automl.v1beta1.TextExtractionDatasetMetadata"; + }; + + return TextExtractionDatasetMetadata; + })(); + + v1beta1.TextExtractionModelMetadata = (function() { + + /** + * Properties of a TextExtractionModelMetadata. + * @memberof google.cloud.automl.v1beta1 + * @interface ITextExtractionModelMetadata + * @property {string|null} [modelHint] TextExtractionModelMetadata modelHint + */ + + /** + * Constructs a new TextExtractionModelMetadata. + * @memberof google.cloud.automl.v1beta1 + * @classdesc Represents a TextExtractionModelMetadata. + * @implements ITextExtractionModelMetadata + * @constructor + * @param {google.cloud.automl.v1beta1.ITextExtractionModelMetadata=} [properties] Properties to set + */ + function TextExtractionModelMetadata(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * TextExtractionModelMetadata modelHint. + * @member {string} modelHint + * @memberof google.cloud.automl.v1beta1.TextExtractionModelMetadata + * @instance + */ + TextExtractionModelMetadata.prototype.modelHint = ""; + + /** + * Creates a new TextExtractionModelMetadata instance using the specified properties. + * @function create + * @memberof google.cloud.automl.v1beta1.TextExtractionModelMetadata + * @static + * @param {google.cloud.automl.v1beta1.ITextExtractionModelMetadata=} [properties] Properties to set + * @returns {google.cloud.automl.v1beta1.TextExtractionModelMetadata} TextExtractionModelMetadata instance + */ + TextExtractionModelMetadata.create = function create(properties) { + return new TextExtractionModelMetadata(properties); + }; + + /** + * Encodes the specified TextExtractionModelMetadata message. Does not implicitly {@link google.cloud.automl.v1beta1.TextExtractionModelMetadata.verify|verify} messages. + * @function encode + * @memberof google.cloud.automl.v1beta1.TextExtractionModelMetadata + * @static + * @param {google.cloud.automl.v1beta1.ITextExtractionModelMetadata} message TextExtractionModelMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TextExtractionModelMetadata.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.modelHint != null && Object.hasOwnProperty.call(message, "modelHint")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.modelHint); + return writer; + }; + + /** + * Encodes the specified TextExtractionModelMetadata message, length delimited. Does not implicitly {@link google.cloud.automl.v1beta1.TextExtractionModelMetadata.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.automl.v1beta1.TextExtractionModelMetadata + * @static + * @param {google.cloud.automl.v1beta1.ITextExtractionModelMetadata} message TextExtractionModelMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TextExtractionModelMetadata.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a TextExtractionModelMetadata message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.automl.v1beta1.TextExtractionModelMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.automl.v1beta1.TextExtractionModelMetadata} TextExtractionModelMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TextExtractionModelMetadata.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.automl.v1beta1.TextExtractionModelMetadata(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 3: { + message.modelHint = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a TextExtractionModelMetadata message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.automl.v1beta1.TextExtractionModelMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.automl.v1beta1.TextExtractionModelMetadata} TextExtractionModelMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TextExtractionModelMetadata.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a TextExtractionModelMetadata message. + * @function verify + * @memberof google.cloud.automl.v1beta1.TextExtractionModelMetadata + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + TextExtractionModelMetadata.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.modelHint != null && message.hasOwnProperty("modelHint")) + if (!$util.isString(message.modelHint)) + return "modelHint: string expected"; + return null; + }; + + /** + * Creates a TextExtractionModelMetadata message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.automl.v1beta1.TextExtractionModelMetadata + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.automl.v1beta1.TextExtractionModelMetadata} TextExtractionModelMetadata + */ + TextExtractionModelMetadata.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.automl.v1beta1.TextExtractionModelMetadata) + return object; + var message = new $root.google.cloud.automl.v1beta1.TextExtractionModelMetadata(); + if (object.modelHint != null) + message.modelHint = String(object.modelHint); + return message; + }; + + /** + * Creates a plain object from a TextExtractionModelMetadata message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.automl.v1beta1.TextExtractionModelMetadata + * @static + * @param {google.cloud.automl.v1beta1.TextExtractionModelMetadata} message TextExtractionModelMetadata + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + TextExtractionModelMetadata.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.modelHint = ""; + if (message.modelHint != null && message.hasOwnProperty("modelHint")) + object.modelHint = message.modelHint; + return object; + }; + + /** + * Converts this TextExtractionModelMetadata to JSON. + * @function toJSON + * @memberof google.cloud.automl.v1beta1.TextExtractionModelMetadata + * @instance + * @returns {Object.} JSON object + */ + TextExtractionModelMetadata.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for TextExtractionModelMetadata + * @function getTypeUrl + * @memberof google.cloud.automl.v1beta1.TextExtractionModelMetadata + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TextExtractionModelMetadata.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.automl.v1beta1.TextExtractionModelMetadata"; + }; + + return TextExtractionModelMetadata; + })(); + + v1beta1.TextSentimentDatasetMetadata = (function() { + + /** + * Properties of a TextSentimentDatasetMetadata. + * @memberof google.cloud.automl.v1beta1 + * @interface ITextSentimentDatasetMetadata + * @property {number|null} [sentimentMax] TextSentimentDatasetMetadata sentimentMax + */ + + /** + * Constructs a new TextSentimentDatasetMetadata. + * @memberof google.cloud.automl.v1beta1 + * @classdesc Represents a TextSentimentDatasetMetadata. + * @implements ITextSentimentDatasetMetadata + * @constructor + * @param {google.cloud.automl.v1beta1.ITextSentimentDatasetMetadata=} [properties] Properties to set + */ + function TextSentimentDatasetMetadata(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * TextSentimentDatasetMetadata sentimentMax. + * @member {number} sentimentMax + * @memberof google.cloud.automl.v1beta1.TextSentimentDatasetMetadata + * @instance + */ + TextSentimentDatasetMetadata.prototype.sentimentMax = 0; + + /** + * Creates a new TextSentimentDatasetMetadata instance using the specified properties. + * @function create + * @memberof google.cloud.automl.v1beta1.TextSentimentDatasetMetadata + * @static + * @param {google.cloud.automl.v1beta1.ITextSentimentDatasetMetadata=} [properties] Properties to set + * @returns {google.cloud.automl.v1beta1.TextSentimentDatasetMetadata} TextSentimentDatasetMetadata instance + */ + TextSentimentDatasetMetadata.create = function create(properties) { + return new TextSentimentDatasetMetadata(properties); + }; + + /** + * Encodes the specified TextSentimentDatasetMetadata message. Does not implicitly {@link google.cloud.automl.v1beta1.TextSentimentDatasetMetadata.verify|verify} messages. + * @function encode + * @memberof google.cloud.automl.v1beta1.TextSentimentDatasetMetadata + * @static + * @param {google.cloud.automl.v1beta1.ITextSentimentDatasetMetadata} message TextSentimentDatasetMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TextSentimentDatasetMetadata.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.sentimentMax != null && Object.hasOwnProperty.call(message, "sentimentMax")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.sentimentMax); + return writer; + }; + + /** + * Encodes the specified TextSentimentDatasetMetadata message, length delimited. Does not implicitly {@link google.cloud.automl.v1beta1.TextSentimentDatasetMetadata.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.automl.v1beta1.TextSentimentDatasetMetadata + * @static + * @param {google.cloud.automl.v1beta1.ITextSentimentDatasetMetadata} message TextSentimentDatasetMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TextSentimentDatasetMetadata.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a TextSentimentDatasetMetadata message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.automl.v1beta1.TextSentimentDatasetMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.automl.v1beta1.TextSentimentDatasetMetadata} TextSentimentDatasetMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TextSentimentDatasetMetadata.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.automl.v1beta1.TextSentimentDatasetMetadata(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.sentimentMax = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a TextSentimentDatasetMetadata message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.automl.v1beta1.TextSentimentDatasetMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.automl.v1beta1.TextSentimentDatasetMetadata} TextSentimentDatasetMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TextSentimentDatasetMetadata.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a TextSentimentDatasetMetadata message. + * @function verify + * @memberof google.cloud.automl.v1beta1.TextSentimentDatasetMetadata + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + TextSentimentDatasetMetadata.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.sentimentMax != null && message.hasOwnProperty("sentimentMax")) + if (!$util.isInteger(message.sentimentMax)) + return "sentimentMax: integer expected"; + return null; + }; + + /** + * Creates a TextSentimentDatasetMetadata message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.automl.v1beta1.TextSentimentDatasetMetadata + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.automl.v1beta1.TextSentimentDatasetMetadata} TextSentimentDatasetMetadata + */ + TextSentimentDatasetMetadata.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.automl.v1beta1.TextSentimentDatasetMetadata) + return object; + var message = new $root.google.cloud.automl.v1beta1.TextSentimentDatasetMetadata(); + if (object.sentimentMax != null) + message.sentimentMax = object.sentimentMax | 0; + return message; + }; + + /** + * Creates a plain object from a TextSentimentDatasetMetadata message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.automl.v1beta1.TextSentimentDatasetMetadata + * @static + * @param {google.cloud.automl.v1beta1.TextSentimentDatasetMetadata} message TextSentimentDatasetMetadata + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + TextSentimentDatasetMetadata.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.sentimentMax = 0; + if (message.sentimentMax != null && message.hasOwnProperty("sentimentMax")) + object.sentimentMax = message.sentimentMax; + return object; + }; + + /** + * Converts this TextSentimentDatasetMetadata to JSON. + * @function toJSON + * @memberof google.cloud.automl.v1beta1.TextSentimentDatasetMetadata + * @instance + * @returns {Object.} JSON object + */ + TextSentimentDatasetMetadata.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for TextSentimentDatasetMetadata + * @function getTypeUrl + * @memberof google.cloud.automl.v1beta1.TextSentimentDatasetMetadata + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TextSentimentDatasetMetadata.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.automl.v1beta1.TextSentimentDatasetMetadata"; + }; + + return TextSentimentDatasetMetadata; + })(); + + v1beta1.TextSentimentModelMetadata = (function() { + + /** + * Properties of a TextSentimentModelMetadata. + * @memberof google.cloud.automl.v1beta1 + * @interface ITextSentimentModelMetadata + */ + + /** + * Constructs a new TextSentimentModelMetadata. + * @memberof google.cloud.automl.v1beta1 + * @classdesc Represents a TextSentimentModelMetadata. + * @implements ITextSentimentModelMetadata + * @constructor + * @param {google.cloud.automl.v1beta1.ITextSentimentModelMetadata=} [properties] Properties to set + */ + function TextSentimentModelMetadata(properties) { + if (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 TextSentimentModelMetadata instance using the specified properties. + * @function create + * @memberof google.cloud.automl.v1beta1.TextSentimentModelMetadata + * @static + * @param {google.cloud.automl.v1beta1.ITextSentimentModelMetadata=} [properties] Properties to set + * @returns {google.cloud.automl.v1beta1.TextSentimentModelMetadata} TextSentimentModelMetadata instance + */ + TextSentimentModelMetadata.create = function create(properties) { + return new TextSentimentModelMetadata(properties); + }; + + /** + * Encodes the specified TextSentimentModelMetadata message. Does not implicitly {@link google.cloud.automl.v1beta1.TextSentimentModelMetadata.verify|verify} messages. + * @function encode + * @memberof google.cloud.automl.v1beta1.TextSentimentModelMetadata + * @static + * @param {google.cloud.automl.v1beta1.ITextSentimentModelMetadata} message TextSentimentModelMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TextSentimentModelMetadata.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + return writer; + }; + + /** + * Encodes the specified TextSentimentModelMetadata message, length delimited. Does not implicitly {@link google.cloud.automl.v1beta1.TextSentimentModelMetadata.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.automl.v1beta1.TextSentimentModelMetadata + * @static + * @param {google.cloud.automl.v1beta1.ITextSentimentModelMetadata} message TextSentimentModelMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TextSentimentModelMetadata.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a TextSentimentModelMetadata message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.automl.v1beta1.TextSentimentModelMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.automl.v1beta1.TextSentimentModelMetadata} TextSentimentModelMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TextSentimentModelMetadata.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.automl.v1beta1.TextSentimentModelMetadata(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a TextSentimentModelMetadata message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.automl.v1beta1.TextSentimentModelMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.automl.v1beta1.TextSentimentModelMetadata} TextSentimentModelMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TextSentimentModelMetadata.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a TextSentimentModelMetadata message. + * @function verify + * @memberof google.cloud.automl.v1beta1.TextSentimentModelMetadata + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + TextSentimentModelMetadata.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + return null; + }; + + /** + * Creates a TextSentimentModelMetadata message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.automl.v1beta1.TextSentimentModelMetadata + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.automl.v1beta1.TextSentimentModelMetadata} TextSentimentModelMetadata + */ + TextSentimentModelMetadata.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.automl.v1beta1.TextSentimentModelMetadata) + return object; + return new $root.google.cloud.automl.v1beta1.TextSentimentModelMetadata(); + }; + + /** + * Creates a plain object from a TextSentimentModelMetadata message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.automl.v1beta1.TextSentimentModelMetadata + * @static + * @param {google.cloud.automl.v1beta1.TextSentimentModelMetadata} message TextSentimentModelMetadata + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + TextSentimentModelMetadata.toObject = function toObject() { + return {}; + }; + + /** + * Converts this TextSentimentModelMetadata to JSON. + * @function toJSON + * @memberof google.cloud.automl.v1beta1.TextSentimentModelMetadata + * @instance + * @returns {Object.} JSON object + */ + TextSentimentModelMetadata.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for TextSentimentModelMetadata + * @function getTypeUrl + * @memberof google.cloud.automl.v1beta1.TextSentimentModelMetadata + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TextSentimentModelMetadata.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.automl.v1beta1.TextSentimentModelMetadata"; + }; + + return TextSentimentModelMetadata; + })(); + + v1beta1.VideoClassificationDatasetMetadata = (function() { + + /** + * Properties of a VideoClassificationDatasetMetadata. + * @memberof google.cloud.automl.v1beta1 + * @interface IVideoClassificationDatasetMetadata + */ + + /** + * Constructs a new VideoClassificationDatasetMetadata. + * @memberof google.cloud.automl.v1beta1 + * @classdesc Represents a VideoClassificationDatasetMetadata. + * @implements IVideoClassificationDatasetMetadata + * @constructor + * @param {google.cloud.automl.v1beta1.IVideoClassificationDatasetMetadata=} [properties] Properties to set + */ + function VideoClassificationDatasetMetadata(properties) { + if (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 VideoClassificationDatasetMetadata instance using the specified properties. + * @function create + * @memberof google.cloud.automl.v1beta1.VideoClassificationDatasetMetadata + * @static + * @param {google.cloud.automl.v1beta1.IVideoClassificationDatasetMetadata=} [properties] Properties to set + * @returns {google.cloud.automl.v1beta1.VideoClassificationDatasetMetadata} VideoClassificationDatasetMetadata instance + */ + VideoClassificationDatasetMetadata.create = function create(properties) { + return new VideoClassificationDatasetMetadata(properties); + }; + + /** + * Encodes the specified VideoClassificationDatasetMetadata message. Does not implicitly {@link google.cloud.automl.v1beta1.VideoClassificationDatasetMetadata.verify|verify} messages. + * @function encode + * @memberof google.cloud.automl.v1beta1.VideoClassificationDatasetMetadata + * @static + * @param {google.cloud.automl.v1beta1.IVideoClassificationDatasetMetadata} message VideoClassificationDatasetMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + VideoClassificationDatasetMetadata.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + return writer; + }; + + /** + * Encodes the specified VideoClassificationDatasetMetadata message, length delimited. Does not implicitly {@link google.cloud.automl.v1beta1.VideoClassificationDatasetMetadata.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.automl.v1beta1.VideoClassificationDatasetMetadata + * @static + * @param {google.cloud.automl.v1beta1.IVideoClassificationDatasetMetadata} message VideoClassificationDatasetMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + VideoClassificationDatasetMetadata.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a VideoClassificationDatasetMetadata message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.automl.v1beta1.VideoClassificationDatasetMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.automl.v1beta1.VideoClassificationDatasetMetadata} VideoClassificationDatasetMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + VideoClassificationDatasetMetadata.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.automl.v1beta1.VideoClassificationDatasetMetadata(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a VideoClassificationDatasetMetadata message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.automl.v1beta1.VideoClassificationDatasetMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.automl.v1beta1.VideoClassificationDatasetMetadata} VideoClassificationDatasetMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + VideoClassificationDatasetMetadata.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a VideoClassificationDatasetMetadata message. + * @function verify + * @memberof google.cloud.automl.v1beta1.VideoClassificationDatasetMetadata + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + VideoClassificationDatasetMetadata.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + return null; + }; + + /** + * Creates a VideoClassificationDatasetMetadata message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.automl.v1beta1.VideoClassificationDatasetMetadata + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.automl.v1beta1.VideoClassificationDatasetMetadata} VideoClassificationDatasetMetadata + */ + VideoClassificationDatasetMetadata.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.automl.v1beta1.VideoClassificationDatasetMetadata) + return object; + return new $root.google.cloud.automl.v1beta1.VideoClassificationDatasetMetadata(); + }; + + /** + * Creates a plain object from a VideoClassificationDatasetMetadata message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.automl.v1beta1.VideoClassificationDatasetMetadata + * @static + * @param {google.cloud.automl.v1beta1.VideoClassificationDatasetMetadata} message VideoClassificationDatasetMetadata + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + VideoClassificationDatasetMetadata.toObject = function toObject() { + return {}; + }; + + /** + * Converts this VideoClassificationDatasetMetadata to JSON. + * @function toJSON + * @memberof google.cloud.automl.v1beta1.VideoClassificationDatasetMetadata + * @instance + * @returns {Object.} JSON object + */ + VideoClassificationDatasetMetadata.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for VideoClassificationDatasetMetadata + * @function getTypeUrl + * @memberof google.cloud.automl.v1beta1.VideoClassificationDatasetMetadata + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + VideoClassificationDatasetMetadata.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.automl.v1beta1.VideoClassificationDatasetMetadata"; + }; + + return VideoClassificationDatasetMetadata; + })(); + + v1beta1.VideoObjectTrackingDatasetMetadata = (function() { + + /** + * Properties of a VideoObjectTrackingDatasetMetadata. + * @memberof google.cloud.automl.v1beta1 + * @interface IVideoObjectTrackingDatasetMetadata + */ + + /** + * Constructs a new VideoObjectTrackingDatasetMetadata. + * @memberof google.cloud.automl.v1beta1 + * @classdesc Represents a VideoObjectTrackingDatasetMetadata. + * @implements IVideoObjectTrackingDatasetMetadata + * @constructor + * @param {google.cloud.automl.v1beta1.IVideoObjectTrackingDatasetMetadata=} [properties] Properties to set + */ + function VideoObjectTrackingDatasetMetadata(properties) { + if (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 VideoObjectTrackingDatasetMetadata instance using the specified properties. + * @function create + * @memberof google.cloud.automl.v1beta1.VideoObjectTrackingDatasetMetadata + * @static + * @param {google.cloud.automl.v1beta1.IVideoObjectTrackingDatasetMetadata=} [properties] Properties to set + * @returns {google.cloud.automl.v1beta1.VideoObjectTrackingDatasetMetadata} VideoObjectTrackingDatasetMetadata instance + */ + VideoObjectTrackingDatasetMetadata.create = function create(properties) { + return new VideoObjectTrackingDatasetMetadata(properties); + }; + + /** + * Encodes the specified VideoObjectTrackingDatasetMetadata message. Does not implicitly {@link google.cloud.automl.v1beta1.VideoObjectTrackingDatasetMetadata.verify|verify} messages. + * @function encode + * @memberof google.cloud.automl.v1beta1.VideoObjectTrackingDatasetMetadata + * @static + * @param {google.cloud.automl.v1beta1.IVideoObjectTrackingDatasetMetadata} message VideoObjectTrackingDatasetMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + VideoObjectTrackingDatasetMetadata.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + return writer; + }; + + /** + * Encodes the specified VideoObjectTrackingDatasetMetadata message, length delimited. Does not implicitly {@link google.cloud.automl.v1beta1.VideoObjectTrackingDatasetMetadata.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.automl.v1beta1.VideoObjectTrackingDatasetMetadata + * @static + * @param {google.cloud.automl.v1beta1.IVideoObjectTrackingDatasetMetadata} message VideoObjectTrackingDatasetMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + VideoObjectTrackingDatasetMetadata.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a VideoObjectTrackingDatasetMetadata message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.automl.v1beta1.VideoObjectTrackingDatasetMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.automl.v1beta1.VideoObjectTrackingDatasetMetadata} VideoObjectTrackingDatasetMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + VideoObjectTrackingDatasetMetadata.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.automl.v1beta1.VideoObjectTrackingDatasetMetadata(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a VideoObjectTrackingDatasetMetadata message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.automl.v1beta1.VideoObjectTrackingDatasetMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.automl.v1beta1.VideoObjectTrackingDatasetMetadata} VideoObjectTrackingDatasetMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + VideoObjectTrackingDatasetMetadata.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a VideoObjectTrackingDatasetMetadata message. + * @function verify + * @memberof google.cloud.automl.v1beta1.VideoObjectTrackingDatasetMetadata + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + VideoObjectTrackingDatasetMetadata.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + return null; + }; + + /** + * Creates a VideoObjectTrackingDatasetMetadata message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.automl.v1beta1.VideoObjectTrackingDatasetMetadata + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.automl.v1beta1.VideoObjectTrackingDatasetMetadata} VideoObjectTrackingDatasetMetadata + */ + VideoObjectTrackingDatasetMetadata.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.automl.v1beta1.VideoObjectTrackingDatasetMetadata) + return object; + return new $root.google.cloud.automl.v1beta1.VideoObjectTrackingDatasetMetadata(); + }; + + /** + * Creates a plain object from a VideoObjectTrackingDatasetMetadata message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.automl.v1beta1.VideoObjectTrackingDatasetMetadata + * @static + * @param {google.cloud.automl.v1beta1.VideoObjectTrackingDatasetMetadata} message VideoObjectTrackingDatasetMetadata + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + VideoObjectTrackingDatasetMetadata.toObject = function toObject() { + return {}; + }; + + /** + * Converts this VideoObjectTrackingDatasetMetadata to JSON. + * @function toJSON + * @memberof google.cloud.automl.v1beta1.VideoObjectTrackingDatasetMetadata + * @instance + * @returns {Object.} JSON object + */ + VideoObjectTrackingDatasetMetadata.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for VideoObjectTrackingDatasetMetadata + * @function getTypeUrl + * @memberof google.cloud.automl.v1beta1.VideoObjectTrackingDatasetMetadata + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + VideoObjectTrackingDatasetMetadata.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.automl.v1beta1.VideoObjectTrackingDatasetMetadata"; + }; + + return VideoObjectTrackingDatasetMetadata; + })(); + + v1beta1.VideoClassificationModelMetadata = (function() { + + /** + * Properties of a VideoClassificationModelMetadata. + * @memberof google.cloud.automl.v1beta1 + * @interface IVideoClassificationModelMetadata + */ + + /** + * Constructs a new VideoClassificationModelMetadata. + * @memberof google.cloud.automl.v1beta1 + * @classdesc Represents a VideoClassificationModelMetadata. + * @implements IVideoClassificationModelMetadata + * @constructor + * @param {google.cloud.automl.v1beta1.IVideoClassificationModelMetadata=} [properties] Properties to set + */ + function VideoClassificationModelMetadata(properties) { + if (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 VideoClassificationModelMetadata instance using the specified properties. + * @function create + * @memberof google.cloud.automl.v1beta1.VideoClassificationModelMetadata + * @static + * @param {google.cloud.automl.v1beta1.IVideoClassificationModelMetadata=} [properties] Properties to set + * @returns {google.cloud.automl.v1beta1.VideoClassificationModelMetadata} VideoClassificationModelMetadata instance + */ + VideoClassificationModelMetadata.create = function create(properties) { + return new VideoClassificationModelMetadata(properties); + }; + + /** + * Encodes the specified VideoClassificationModelMetadata message. Does not implicitly {@link google.cloud.automl.v1beta1.VideoClassificationModelMetadata.verify|verify} messages. + * @function encode + * @memberof google.cloud.automl.v1beta1.VideoClassificationModelMetadata + * @static + * @param {google.cloud.automl.v1beta1.IVideoClassificationModelMetadata} message VideoClassificationModelMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + VideoClassificationModelMetadata.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + return writer; + }; + + /** + * Encodes the specified VideoClassificationModelMetadata message, length delimited. Does not implicitly {@link google.cloud.automl.v1beta1.VideoClassificationModelMetadata.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.automl.v1beta1.VideoClassificationModelMetadata + * @static + * @param {google.cloud.automl.v1beta1.IVideoClassificationModelMetadata} message VideoClassificationModelMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + VideoClassificationModelMetadata.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a VideoClassificationModelMetadata message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.automl.v1beta1.VideoClassificationModelMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.automl.v1beta1.VideoClassificationModelMetadata} VideoClassificationModelMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + VideoClassificationModelMetadata.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.automl.v1beta1.VideoClassificationModelMetadata(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a VideoClassificationModelMetadata message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.automl.v1beta1.VideoClassificationModelMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.automl.v1beta1.VideoClassificationModelMetadata} VideoClassificationModelMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + VideoClassificationModelMetadata.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a VideoClassificationModelMetadata message. + * @function verify + * @memberof google.cloud.automl.v1beta1.VideoClassificationModelMetadata + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + VideoClassificationModelMetadata.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + return null; + }; + + /** + * Creates a VideoClassificationModelMetadata message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.automl.v1beta1.VideoClassificationModelMetadata + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.automl.v1beta1.VideoClassificationModelMetadata} VideoClassificationModelMetadata + */ + VideoClassificationModelMetadata.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.automl.v1beta1.VideoClassificationModelMetadata) + return object; + return new $root.google.cloud.automl.v1beta1.VideoClassificationModelMetadata(); + }; + + /** + * Creates a plain object from a VideoClassificationModelMetadata message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.automl.v1beta1.VideoClassificationModelMetadata + * @static + * @param {google.cloud.automl.v1beta1.VideoClassificationModelMetadata} message VideoClassificationModelMetadata + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + VideoClassificationModelMetadata.toObject = function toObject() { + return {}; + }; + + /** + * Converts this VideoClassificationModelMetadata to JSON. + * @function toJSON + * @memberof google.cloud.automl.v1beta1.VideoClassificationModelMetadata + * @instance + * @returns {Object.} JSON object + */ + VideoClassificationModelMetadata.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for VideoClassificationModelMetadata + * @function getTypeUrl + * @memberof google.cloud.automl.v1beta1.VideoClassificationModelMetadata + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + VideoClassificationModelMetadata.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.automl.v1beta1.VideoClassificationModelMetadata"; + }; + + return VideoClassificationModelMetadata; + })(); + + v1beta1.VideoObjectTrackingModelMetadata = (function() { + + /** + * Properties of a VideoObjectTrackingModelMetadata. + * @memberof google.cloud.automl.v1beta1 + * @interface IVideoObjectTrackingModelMetadata + */ + + /** + * Constructs a new VideoObjectTrackingModelMetadata. + * @memberof google.cloud.automl.v1beta1 + * @classdesc Represents a VideoObjectTrackingModelMetadata. + * @implements IVideoObjectTrackingModelMetadata + * @constructor + * @param {google.cloud.automl.v1beta1.IVideoObjectTrackingModelMetadata=} [properties] Properties to set + */ + function VideoObjectTrackingModelMetadata(properties) { + if (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 VideoObjectTrackingModelMetadata instance using the specified properties. + * @function create + * @memberof google.cloud.automl.v1beta1.VideoObjectTrackingModelMetadata + * @static + * @param {google.cloud.automl.v1beta1.IVideoObjectTrackingModelMetadata=} [properties] Properties to set + * @returns {google.cloud.automl.v1beta1.VideoObjectTrackingModelMetadata} VideoObjectTrackingModelMetadata instance + */ + VideoObjectTrackingModelMetadata.create = function create(properties) { + return new VideoObjectTrackingModelMetadata(properties); + }; + + /** + * Encodes the specified VideoObjectTrackingModelMetadata message. Does not implicitly {@link google.cloud.automl.v1beta1.VideoObjectTrackingModelMetadata.verify|verify} messages. + * @function encode + * @memberof google.cloud.automl.v1beta1.VideoObjectTrackingModelMetadata + * @static + * @param {google.cloud.automl.v1beta1.IVideoObjectTrackingModelMetadata} message VideoObjectTrackingModelMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + VideoObjectTrackingModelMetadata.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + return writer; + }; + + /** + * Encodes the specified VideoObjectTrackingModelMetadata message, length delimited. Does not implicitly {@link google.cloud.automl.v1beta1.VideoObjectTrackingModelMetadata.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.automl.v1beta1.VideoObjectTrackingModelMetadata + * @static + * @param {google.cloud.automl.v1beta1.IVideoObjectTrackingModelMetadata} message VideoObjectTrackingModelMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + VideoObjectTrackingModelMetadata.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a VideoObjectTrackingModelMetadata message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.automl.v1beta1.VideoObjectTrackingModelMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.automl.v1beta1.VideoObjectTrackingModelMetadata} VideoObjectTrackingModelMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + VideoObjectTrackingModelMetadata.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.automl.v1beta1.VideoObjectTrackingModelMetadata(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a VideoObjectTrackingModelMetadata message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.automl.v1beta1.VideoObjectTrackingModelMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.automl.v1beta1.VideoObjectTrackingModelMetadata} VideoObjectTrackingModelMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + VideoObjectTrackingModelMetadata.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a VideoObjectTrackingModelMetadata message. + * @function verify + * @memberof google.cloud.automl.v1beta1.VideoObjectTrackingModelMetadata + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + VideoObjectTrackingModelMetadata.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + return null; + }; + + /** + * Creates a VideoObjectTrackingModelMetadata message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.automl.v1beta1.VideoObjectTrackingModelMetadata + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.automl.v1beta1.VideoObjectTrackingModelMetadata} VideoObjectTrackingModelMetadata + */ + VideoObjectTrackingModelMetadata.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.automl.v1beta1.VideoObjectTrackingModelMetadata) + return object; + return new $root.google.cloud.automl.v1beta1.VideoObjectTrackingModelMetadata(); + }; + + /** + * Creates a plain object from a VideoObjectTrackingModelMetadata message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.automl.v1beta1.VideoObjectTrackingModelMetadata + * @static + * @param {google.cloud.automl.v1beta1.VideoObjectTrackingModelMetadata} message VideoObjectTrackingModelMetadata + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + VideoObjectTrackingModelMetadata.toObject = function toObject() { + return {}; + }; + + /** + * Converts this VideoObjectTrackingModelMetadata to JSON. + * @function toJSON + * @memberof google.cloud.automl.v1beta1.VideoObjectTrackingModelMetadata + * @instance + * @returns {Object.} JSON object + */ + VideoObjectTrackingModelMetadata.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for VideoObjectTrackingModelMetadata + * @function getTypeUrl + * @memberof google.cloud.automl.v1beta1.VideoObjectTrackingModelMetadata + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + VideoObjectTrackingModelMetadata.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.automl.v1beta1.VideoObjectTrackingModelMetadata"; + }; + + return VideoObjectTrackingModelMetadata; + })(); + + v1beta1.Model = (function() { + + /** + * Properties of a Model. + * @memberof google.cloud.automl.v1beta1 + * @interface IModel + * @property {google.cloud.automl.v1beta1.ITranslationModelMetadata|null} [translationModelMetadata] Model translationModelMetadata + * @property {google.cloud.automl.v1beta1.IImageClassificationModelMetadata|null} [imageClassificationModelMetadata] Model imageClassificationModelMetadata + * @property {google.cloud.automl.v1beta1.ITextClassificationModelMetadata|null} [textClassificationModelMetadata] Model textClassificationModelMetadata + * @property {google.cloud.automl.v1beta1.IImageObjectDetectionModelMetadata|null} [imageObjectDetectionModelMetadata] Model imageObjectDetectionModelMetadata + * @property {google.cloud.automl.v1beta1.IVideoClassificationModelMetadata|null} [videoClassificationModelMetadata] Model videoClassificationModelMetadata + * @property {google.cloud.automl.v1beta1.IVideoObjectTrackingModelMetadata|null} [videoObjectTrackingModelMetadata] Model videoObjectTrackingModelMetadata + * @property {google.cloud.automl.v1beta1.ITextExtractionModelMetadata|null} [textExtractionModelMetadata] Model textExtractionModelMetadata + * @property {google.cloud.automl.v1beta1.ITablesModelMetadata|null} [tablesModelMetadata] Model tablesModelMetadata + * @property {google.cloud.automl.v1beta1.ITextSentimentModelMetadata|null} [textSentimentModelMetadata] Model textSentimentModelMetadata + * @property {string|null} [name] Model name + * @property {string|null} [displayName] Model displayName + * @property {string|null} [datasetId] Model datasetId + * @property {google.protobuf.ITimestamp|null} [createTime] Model createTime + * @property {google.protobuf.ITimestamp|null} [updateTime] Model updateTime + * @property {google.cloud.automl.v1beta1.Model.DeploymentState|null} [deploymentState] Model deploymentState + */ + + /** + * Constructs a new Model. + * @memberof google.cloud.automl.v1beta1 + * @classdesc Represents a Model. + * @implements IModel + * @constructor + * @param {google.cloud.automl.v1beta1.IModel=} [properties] Properties to set + */ + function Model(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Model translationModelMetadata. + * @member {google.cloud.automl.v1beta1.ITranslationModelMetadata|null|undefined} translationModelMetadata + * @memberof google.cloud.automl.v1beta1.Model + * @instance + */ + Model.prototype.translationModelMetadata = null; + + /** + * Model imageClassificationModelMetadata. + * @member {google.cloud.automl.v1beta1.IImageClassificationModelMetadata|null|undefined} imageClassificationModelMetadata + * @memberof google.cloud.automl.v1beta1.Model + * @instance + */ + Model.prototype.imageClassificationModelMetadata = null; + + /** + * Model textClassificationModelMetadata. + * @member {google.cloud.automl.v1beta1.ITextClassificationModelMetadata|null|undefined} textClassificationModelMetadata + * @memberof google.cloud.automl.v1beta1.Model + * @instance + */ + Model.prototype.textClassificationModelMetadata = null; + + /** + * Model imageObjectDetectionModelMetadata. + * @member {google.cloud.automl.v1beta1.IImageObjectDetectionModelMetadata|null|undefined} imageObjectDetectionModelMetadata + * @memberof google.cloud.automl.v1beta1.Model + * @instance + */ + Model.prototype.imageObjectDetectionModelMetadata = null; + + /** + * Model videoClassificationModelMetadata. + * @member {google.cloud.automl.v1beta1.IVideoClassificationModelMetadata|null|undefined} videoClassificationModelMetadata + * @memberof google.cloud.automl.v1beta1.Model + * @instance + */ + Model.prototype.videoClassificationModelMetadata = null; + + /** + * Model videoObjectTrackingModelMetadata. + * @member {google.cloud.automl.v1beta1.IVideoObjectTrackingModelMetadata|null|undefined} videoObjectTrackingModelMetadata + * @memberof google.cloud.automl.v1beta1.Model + * @instance + */ + Model.prototype.videoObjectTrackingModelMetadata = null; + + /** + * Model textExtractionModelMetadata. + * @member {google.cloud.automl.v1beta1.ITextExtractionModelMetadata|null|undefined} textExtractionModelMetadata + * @memberof google.cloud.automl.v1beta1.Model + * @instance + */ + Model.prototype.textExtractionModelMetadata = null; + + /** + * Model tablesModelMetadata. + * @member {google.cloud.automl.v1beta1.ITablesModelMetadata|null|undefined} tablesModelMetadata + * @memberof google.cloud.automl.v1beta1.Model + * @instance + */ + Model.prototype.tablesModelMetadata = null; + + /** + * Model textSentimentModelMetadata. + * @member {google.cloud.automl.v1beta1.ITextSentimentModelMetadata|null|undefined} textSentimentModelMetadata + * @memberof google.cloud.automl.v1beta1.Model + * @instance + */ + Model.prototype.textSentimentModelMetadata = null; + + /** + * Model name. + * @member {string} name + * @memberof google.cloud.automl.v1beta1.Model + * @instance + */ + Model.prototype.name = ""; + + /** + * Model displayName. + * @member {string} displayName + * @memberof google.cloud.automl.v1beta1.Model + * @instance + */ + Model.prototype.displayName = ""; + + /** + * Model datasetId. + * @member {string} datasetId + * @memberof google.cloud.automl.v1beta1.Model + * @instance + */ + Model.prototype.datasetId = ""; + + /** + * Model createTime. + * @member {google.protobuf.ITimestamp|null|undefined} createTime + * @memberof google.cloud.automl.v1beta1.Model + * @instance + */ + Model.prototype.createTime = null; + + /** + * Model updateTime. + * @member {google.protobuf.ITimestamp|null|undefined} updateTime + * @memberof google.cloud.automl.v1beta1.Model + * @instance + */ + Model.prototype.updateTime = null; + + /** + * Model deploymentState. + * @member {google.cloud.automl.v1beta1.Model.DeploymentState} deploymentState + * @memberof google.cloud.automl.v1beta1.Model + * @instance + */ + Model.prototype.deploymentState = 0; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * Model modelMetadata. + * @member {"translationModelMetadata"|"imageClassificationModelMetadata"|"textClassificationModelMetadata"|"imageObjectDetectionModelMetadata"|"videoClassificationModelMetadata"|"videoObjectTrackingModelMetadata"|"textExtractionModelMetadata"|"tablesModelMetadata"|"textSentimentModelMetadata"|undefined} modelMetadata + * @memberof google.cloud.automl.v1beta1.Model + * @instance + */ + Object.defineProperty(Model.prototype, "modelMetadata", { + get: $util.oneOfGetter($oneOfFields = ["translationModelMetadata", "imageClassificationModelMetadata", "textClassificationModelMetadata", "imageObjectDetectionModelMetadata", "videoClassificationModelMetadata", "videoObjectTrackingModelMetadata", "textExtractionModelMetadata", "tablesModelMetadata", "textSentimentModelMetadata"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new Model instance using the specified properties. + * @function create + * @memberof google.cloud.automl.v1beta1.Model + * @static + * @param {google.cloud.automl.v1beta1.IModel=} [properties] Properties to set + * @returns {google.cloud.automl.v1beta1.Model} Model instance + */ + Model.create = function create(properties) { + return new Model(properties); + }; + + /** + * Encodes the specified Model message. Does not implicitly {@link google.cloud.automl.v1beta1.Model.verify|verify} messages. + * @function encode + * @memberof google.cloud.automl.v1beta1.Model + * @static + * @param {google.cloud.automl.v1beta1.IModel} message Model message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Model.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.displayName != null && Object.hasOwnProperty.call(message, "displayName")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.displayName); + if (message.datasetId != null && Object.hasOwnProperty.call(message, "datasetId")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.datasetId); + if (message.createTime != null && Object.hasOwnProperty.call(message, "createTime")) + $root.google.protobuf.Timestamp.encode(message.createTime, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + if (message.deploymentState != null && Object.hasOwnProperty.call(message, "deploymentState")) + writer.uint32(/* id 8, wireType 0 =*/64).int32(message.deploymentState); + if (message.updateTime != null && Object.hasOwnProperty.call(message, "updateTime")) + $root.google.protobuf.Timestamp.encode(message.updateTime, writer.uint32(/* id 11, wireType 2 =*/90).fork()).ldelim(); + if (message.imageClassificationModelMetadata != null && Object.hasOwnProperty.call(message, "imageClassificationModelMetadata")) + $root.google.cloud.automl.v1beta1.ImageClassificationModelMetadata.encode(message.imageClassificationModelMetadata, writer.uint32(/* id 13, wireType 2 =*/106).fork()).ldelim(); + if (message.textClassificationModelMetadata != null && Object.hasOwnProperty.call(message, "textClassificationModelMetadata")) + $root.google.cloud.automl.v1beta1.TextClassificationModelMetadata.encode(message.textClassificationModelMetadata, writer.uint32(/* id 14, wireType 2 =*/114).fork()).ldelim(); + if (message.translationModelMetadata != null && Object.hasOwnProperty.call(message, "translationModelMetadata")) + $root.google.cloud.automl.v1beta1.TranslationModelMetadata.encode(message.translationModelMetadata, writer.uint32(/* id 15, wireType 2 =*/122).fork()).ldelim(); + if (message.textExtractionModelMetadata != null && Object.hasOwnProperty.call(message, "textExtractionModelMetadata")) + $root.google.cloud.automl.v1beta1.TextExtractionModelMetadata.encode(message.textExtractionModelMetadata, writer.uint32(/* id 19, wireType 2 =*/154).fork()).ldelim(); + if (message.imageObjectDetectionModelMetadata != null && Object.hasOwnProperty.call(message, "imageObjectDetectionModelMetadata")) + $root.google.cloud.automl.v1beta1.ImageObjectDetectionModelMetadata.encode(message.imageObjectDetectionModelMetadata, writer.uint32(/* id 20, wireType 2 =*/162).fork()).ldelim(); + if (message.videoObjectTrackingModelMetadata != null && Object.hasOwnProperty.call(message, "videoObjectTrackingModelMetadata")) + $root.google.cloud.automl.v1beta1.VideoObjectTrackingModelMetadata.encode(message.videoObjectTrackingModelMetadata, writer.uint32(/* id 21, wireType 2 =*/170).fork()).ldelim(); + if (message.textSentimentModelMetadata != null && Object.hasOwnProperty.call(message, "textSentimentModelMetadata")) + $root.google.cloud.automl.v1beta1.TextSentimentModelMetadata.encode(message.textSentimentModelMetadata, writer.uint32(/* id 22, wireType 2 =*/178).fork()).ldelim(); + if (message.videoClassificationModelMetadata != null && Object.hasOwnProperty.call(message, "videoClassificationModelMetadata")) + $root.google.cloud.automl.v1beta1.VideoClassificationModelMetadata.encode(message.videoClassificationModelMetadata, writer.uint32(/* id 23, wireType 2 =*/186).fork()).ldelim(); + if (message.tablesModelMetadata != null && Object.hasOwnProperty.call(message, "tablesModelMetadata")) + $root.google.cloud.automl.v1beta1.TablesModelMetadata.encode(message.tablesModelMetadata, writer.uint32(/* id 24, wireType 2 =*/194).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified Model message, length delimited. Does not implicitly {@link google.cloud.automl.v1beta1.Model.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.automl.v1beta1.Model + * @static + * @param {google.cloud.automl.v1beta1.IModel} message Model message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Model.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Model message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.automl.v1beta1.Model + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.automl.v1beta1.Model} Model + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Model.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.automl.v1beta1.Model(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 15: { + message.translationModelMetadata = $root.google.cloud.automl.v1beta1.TranslationModelMetadata.decode(reader, reader.uint32()); + break; + } + case 13: { + message.imageClassificationModelMetadata = $root.google.cloud.automl.v1beta1.ImageClassificationModelMetadata.decode(reader, reader.uint32()); + break; + } + case 14: { + message.textClassificationModelMetadata = $root.google.cloud.automl.v1beta1.TextClassificationModelMetadata.decode(reader, reader.uint32()); + break; + } + case 20: { + message.imageObjectDetectionModelMetadata = $root.google.cloud.automl.v1beta1.ImageObjectDetectionModelMetadata.decode(reader, reader.uint32()); + break; + } + case 23: { + message.videoClassificationModelMetadata = $root.google.cloud.automl.v1beta1.VideoClassificationModelMetadata.decode(reader, reader.uint32()); + break; + } + case 21: { + message.videoObjectTrackingModelMetadata = $root.google.cloud.automl.v1beta1.VideoObjectTrackingModelMetadata.decode(reader, reader.uint32()); + break; + } + case 19: { + message.textExtractionModelMetadata = $root.google.cloud.automl.v1beta1.TextExtractionModelMetadata.decode(reader, reader.uint32()); + break; + } + case 24: { + message.tablesModelMetadata = $root.google.cloud.automl.v1beta1.TablesModelMetadata.decode(reader, reader.uint32()); + break; + } + case 22: { + message.textSentimentModelMetadata = $root.google.cloud.automl.v1beta1.TextSentimentModelMetadata.decode(reader, reader.uint32()); + break; + } + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.displayName = reader.string(); + break; + } + case 3: { + message.datasetId = reader.string(); + break; + } + case 7: { + message.createTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 11: { + message.updateTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 8: { + message.deploymentState = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Model message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.automl.v1beta1.Model + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.automl.v1beta1.Model} Model + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Model.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Model message. + * @function verify + * @memberof google.cloud.automl.v1beta1.Model + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Model.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.translationModelMetadata != null && message.hasOwnProperty("translationModelMetadata")) { + properties.modelMetadata = 1; + { + var error = $root.google.cloud.automl.v1beta1.TranslationModelMetadata.verify(message.translationModelMetadata); + if (error) + return "translationModelMetadata." + error; + } + } + if (message.imageClassificationModelMetadata != null && message.hasOwnProperty("imageClassificationModelMetadata")) { + if (properties.modelMetadata === 1) + return "modelMetadata: multiple values"; + properties.modelMetadata = 1; + { + var error = $root.google.cloud.automl.v1beta1.ImageClassificationModelMetadata.verify(message.imageClassificationModelMetadata); + if (error) + return "imageClassificationModelMetadata." + error; + } + } + if (message.textClassificationModelMetadata != null && message.hasOwnProperty("textClassificationModelMetadata")) { + if (properties.modelMetadata === 1) + return "modelMetadata: multiple values"; + properties.modelMetadata = 1; + { + var error = $root.google.cloud.automl.v1beta1.TextClassificationModelMetadata.verify(message.textClassificationModelMetadata); + if (error) + return "textClassificationModelMetadata." + error; + } + } + if (message.imageObjectDetectionModelMetadata != null && message.hasOwnProperty("imageObjectDetectionModelMetadata")) { + if (properties.modelMetadata === 1) + return "modelMetadata: multiple values"; + properties.modelMetadata = 1; + { + var error = $root.google.cloud.automl.v1beta1.ImageObjectDetectionModelMetadata.verify(message.imageObjectDetectionModelMetadata); + if (error) + return "imageObjectDetectionModelMetadata." + error; + } + } + if (message.videoClassificationModelMetadata != null && message.hasOwnProperty("videoClassificationModelMetadata")) { + if (properties.modelMetadata === 1) + return "modelMetadata: multiple values"; + properties.modelMetadata = 1; + { + var error = $root.google.cloud.automl.v1beta1.VideoClassificationModelMetadata.verify(message.videoClassificationModelMetadata); + if (error) + return "videoClassificationModelMetadata." + error; + } + } + if (message.videoObjectTrackingModelMetadata != null && message.hasOwnProperty("videoObjectTrackingModelMetadata")) { + if (properties.modelMetadata === 1) + return "modelMetadata: multiple values"; + properties.modelMetadata = 1; + { + var error = $root.google.cloud.automl.v1beta1.VideoObjectTrackingModelMetadata.verify(message.videoObjectTrackingModelMetadata); + if (error) + return "videoObjectTrackingModelMetadata." + error; + } + } + if (message.textExtractionModelMetadata != null && message.hasOwnProperty("textExtractionModelMetadata")) { + if (properties.modelMetadata === 1) + return "modelMetadata: multiple values"; + properties.modelMetadata = 1; + { + var error = $root.google.cloud.automl.v1beta1.TextExtractionModelMetadata.verify(message.textExtractionModelMetadata); + if (error) + return "textExtractionModelMetadata." + error; + } + } + if (message.tablesModelMetadata != null && message.hasOwnProperty("tablesModelMetadata")) { + if (properties.modelMetadata === 1) + return "modelMetadata: multiple values"; + properties.modelMetadata = 1; + { + var error = $root.google.cloud.automl.v1beta1.TablesModelMetadata.verify(message.tablesModelMetadata); + if (error) + return "tablesModelMetadata." + error; + } + } + if (message.textSentimentModelMetadata != null && message.hasOwnProperty("textSentimentModelMetadata")) { + if (properties.modelMetadata === 1) + return "modelMetadata: multiple values"; + properties.modelMetadata = 1; + { + var error = $root.google.cloud.automl.v1beta1.TextSentimentModelMetadata.verify(message.textSentimentModelMetadata); + if (error) + return "textSentimentModelMetadata." + error; + } + } + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.displayName != null && message.hasOwnProperty("displayName")) + if (!$util.isString(message.displayName)) + return "displayName: string expected"; + if (message.datasetId != null && message.hasOwnProperty("datasetId")) + if (!$util.isString(message.datasetId)) + return "datasetId: string expected"; + 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.deploymentState != null && message.hasOwnProperty("deploymentState")) + switch (message.deploymentState) { + default: + return "deploymentState: enum value expected"; + case 0: + case 1: + case 2: + break; + } + return null; + }; + + /** + * Creates a Model message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.automl.v1beta1.Model + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.automl.v1beta1.Model} Model + */ + Model.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.automl.v1beta1.Model) + return object; + var message = new $root.google.cloud.automl.v1beta1.Model(); + if (object.translationModelMetadata != null) { + if (typeof object.translationModelMetadata !== "object") + throw TypeError(".google.cloud.automl.v1beta1.Model.translationModelMetadata: object expected"); + message.translationModelMetadata = $root.google.cloud.automl.v1beta1.TranslationModelMetadata.fromObject(object.translationModelMetadata); + } + if (object.imageClassificationModelMetadata != null) { + if (typeof object.imageClassificationModelMetadata !== "object") + throw TypeError(".google.cloud.automl.v1beta1.Model.imageClassificationModelMetadata: object expected"); + message.imageClassificationModelMetadata = $root.google.cloud.automl.v1beta1.ImageClassificationModelMetadata.fromObject(object.imageClassificationModelMetadata); + } + if (object.textClassificationModelMetadata != null) { + if (typeof object.textClassificationModelMetadata !== "object") + throw TypeError(".google.cloud.automl.v1beta1.Model.textClassificationModelMetadata: object expected"); + message.textClassificationModelMetadata = $root.google.cloud.automl.v1beta1.TextClassificationModelMetadata.fromObject(object.textClassificationModelMetadata); + } + if (object.imageObjectDetectionModelMetadata != null) { + if (typeof object.imageObjectDetectionModelMetadata !== "object") + throw TypeError(".google.cloud.automl.v1beta1.Model.imageObjectDetectionModelMetadata: object expected"); + message.imageObjectDetectionModelMetadata = $root.google.cloud.automl.v1beta1.ImageObjectDetectionModelMetadata.fromObject(object.imageObjectDetectionModelMetadata); + } + if (object.videoClassificationModelMetadata != null) { + if (typeof object.videoClassificationModelMetadata !== "object") + throw TypeError(".google.cloud.automl.v1beta1.Model.videoClassificationModelMetadata: object expected"); + message.videoClassificationModelMetadata = $root.google.cloud.automl.v1beta1.VideoClassificationModelMetadata.fromObject(object.videoClassificationModelMetadata); + } + if (object.videoObjectTrackingModelMetadata != null) { + if (typeof object.videoObjectTrackingModelMetadata !== "object") + throw TypeError(".google.cloud.automl.v1beta1.Model.videoObjectTrackingModelMetadata: object expected"); + message.videoObjectTrackingModelMetadata = $root.google.cloud.automl.v1beta1.VideoObjectTrackingModelMetadata.fromObject(object.videoObjectTrackingModelMetadata); + } + if (object.textExtractionModelMetadata != null) { + if (typeof object.textExtractionModelMetadata !== "object") + throw TypeError(".google.cloud.automl.v1beta1.Model.textExtractionModelMetadata: object expected"); + message.textExtractionModelMetadata = $root.google.cloud.automl.v1beta1.TextExtractionModelMetadata.fromObject(object.textExtractionModelMetadata); + } + if (object.tablesModelMetadata != null) { + if (typeof object.tablesModelMetadata !== "object") + throw TypeError(".google.cloud.automl.v1beta1.Model.tablesModelMetadata: object expected"); + message.tablesModelMetadata = $root.google.cloud.automl.v1beta1.TablesModelMetadata.fromObject(object.tablesModelMetadata); + } + if (object.textSentimentModelMetadata != null) { + if (typeof object.textSentimentModelMetadata !== "object") + throw TypeError(".google.cloud.automl.v1beta1.Model.textSentimentModelMetadata: object expected"); + message.textSentimentModelMetadata = $root.google.cloud.automl.v1beta1.TextSentimentModelMetadata.fromObject(object.textSentimentModelMetadata); + } + if (object.name != null) + message.name = String(object.name); + if (object.displayName != null) + message.displayName = String(object.displayName); + if (object.datasetId != null) + message.datasetId = String(object.datasetId); + if (object.createTime != null) { + if (typeof object.createTime !== "object") + throw TypeError(".google.cloud.automl.v1beta1.Model.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.automl.v1beta1.Model.updateTime: object expected"); + message.updateTime = $root.google.protobuf.Timestamp.fromObject(object.updateTime); + } + switch (object.deploymentState) { + default: + if (typeof object.deploymentState === "number") { + message.deploymentState = object.deploymentState; + break; + } + break; + case "DEPLOYMENT_STATE_UNSPECIFIED": + case 0: + message.deploymentState = 0; + break; + case "DEPLOYED": + case 1: + message.deploymentState = 1; + break; + case "UNDEPLOYED": + case 2: + message.deploymentState = 2; + break; + } + return message; + }; + + /** + * Creates a plain object from a Model message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.automl.v1beta1.Model + * @static + * @param {google.cloud.automl.v1beta1.Model} message Model + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Model.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.displayName = ""; + object.datasetId = ""; + object.createTime = null; + object.deploymentState = options.enums === String ? "DEPLOYMENT_STATE_UNSPECIFIED" : 0; + object.updateTime = null; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.displayName != null && message.hasOwnProperty("displayName")) + object.displayName = message.displayName; + if (message.datasetId != null && message.hasOwnProperty("datasetId")) + object.datasetId = message.datasetId; + if (message.createTime != null && message.hasOwnProperty("createTime")) + object.createTime = $root.google.protobuf.Timestamp.toObject(message.createTime, options); + if (message.deploymentState != null && message.hasOwnProperty("deploymentState")) + object.deploymentState = options.enums === String ? $root.google.cloud.automl.v1beta1.Model.DeploymentState[message.deploymentState] === undefined ? message.deploymentState : $root.google.cloud.automl.v1beta1.Model.DeploymentState[message.deploymentState] : message.deploymentState; + if (message.updateTime != null && message.hasOwnProperty("updateTime")) + object.updateTime = $root.google.protobuf.Timestamp.toObject(message.updateTime, options); + if (message.imageClassificationModelMetadata != null && message.hasOwnProperty("imageClassificationModelMetadata")) { + object.imageClassificationModelMetadata = $root.google.cloud.automl.v1beta1.ImageClassificationModelMetadata.toObject(message.imageClassificationModelMetadata, options); + if (options.oneofs) + object.modelMetadata = "imageClassificationModelMetadata"; + } + if (message.textClassificationModelMetadata != null && message.hasOwnProperty("textClassificationModelMetadata")) { + object.textClassificationModelMetadata = $root.google.cloud.automl.v1beta1.TextClassificationModelMetadata.toObject(message.textClassificationModelMetadata, options); + if (options.oneofs) + object.modelMetadata = "textClassificationModelMetadata"; + } + if (message.translationModelMetadata != null && message.hasOwnProperty("translationModelMetadata")) { + object.translationModelMetadata = $root.google.cloud.automl.v1beta1.TranslationModelMetadata.toObject(message.translationModelMetadata, options); + if (options.oneofs) + object.modelMetadata = "translationModelMetadata"; + } + if (message.textExtractionModelMetadata != null && message.hasOwnProperty("textExtractionModelMetadata")) { + object.textExtractionModelMetadata = $root.google.cloud.automl.v1beta1.TextExtractionModelMetadata.toObject(message.textExtractionModelMetadata, options); + if (options.oneofs) + object.modelMetadata = "textExtractionModelMetadata"; + } + if (message.imageObjectDetectionModelMetadata != null && message.hasOwnProperty("imageObjectDetectionModelMetadata")) { + object.imageObjectDetectionModelMetadata = $root.google.cloud.automl.v1beta1.ImageObjectDetectionModelMetadata.toObject(message.imageObjectDetectionModelMetadata, options); + if (options.oneofs) + object.modelMetadata = "imageObjectDetectionModelMetadata"; + } + if (message.videoObjectTrackingModelMetadata != null && message.hasOwnProperty("videoObjectTrackingModelMetadata")) { + object.videoObjectTrackingModelMetadata = $root.google.cloud.automl.v1beta1.VideoObjectTrackingModelMetadata.toObject(message.videoObjectTrackingModelMetadata, options); + if (options.oneofs) + object.modelMetadata = "videoObjectTrackingModelMetadata"; + } + if (message.textSentimentModelMetadata != null && message.hasOwnProperty("textSentimentModelMetadata")) { + object.textSentimentModelMetadata = $root.google.cloud.automl.v1beta1.TextSentimentModelMetadata.toObject(message.textSentimentModelMetadata, options); + if (options.oneofs) + object.modelMetadata = "textSentimentModelMetadata"; + } + if (message.videoClassificationModelMetadata != null && message.hasOwnProperty("videoClassificationModelMetadata")) { + object.videoClassificationModelMetadata = $root.google.cloud.automl.v1beta1.VideoClassificationModelMetadata.toObject(message.videoClassificationModelMetadata, options); + if (options.oneofs) + object.modelMetadata = "videoClassificationModelMetadata"; + } + if (message.tablesModelMetadata != null && message.hasOwnProperty("tablesModelMetadata")) { + object.tablesModelMetadata = $root.google.cloud.automl.v1beta1.TablesModelMetadata.toObject(message.tablesModelMetadata, options); + if (options.oneofs) + object.modelMetadata = "tablesModelMetadata"; + } + return object; + }; + + /** + * Converts this Model to JSON. + * @function toJSON + * @memberof google.cloud.automl.v1beta1.Model + * @instance + * @returns {Object.} JSON object + */ + Model.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Model + * @function getTypeUrl + * @memberof google.cloud.automl.v1beta1.Model + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Model.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.automl.v1beta1.Model"; + }; + + /** + * DeploymentState enum. + * @name google.cloud.automl.v1beta1.Model.DeploymentState + * @enum {number} + * @property {number} DEPLOYMENT_STATE_UNSPECIFIED=0 DEPLOYMENT_STATE_UNSPECIFIED value + * @property {number} DEPLOYED=1 DEPLOYED value + * @property {number} UNDEPLOYED=2 UNDEPLOYED value + */ + Model.DeploymentState = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "DEPLOYMENT_STATE_UNSPECIFIED"] = 0; + values[valuesById[1] = "DEPLOYED"] = 1; + values[valuesById[2] = "UNDEPLOYED"] = 2; + return values; + })(); + + return Model; + })(); + + v1beta1.ModelEvaluation = (function() { + + /** + * Properties of a ModelEvaluation. + * @memberof google.cloud.automl.v1beta1 + * @interface IModelEvaluation + * @property {google.cloud.automl.v1beta1.IClassificationEvaluationMetrics|null} [classificationEvaluationMetrics] ModelEvaluation classificationEvaluationMetrics + * @property {google.cloud.automl.v1beta1.IRegressionEvaluationMetrics|null} [regressionEvaluationMetrics] ModelEvaluation regressionEvaluationMetrics + * @property {google.cloud.automl.v1beta1.ITranslationEvaluationMetrics|null} [translationEvaluationMetrics] ModelEvaluation translationEvaluationMetrics + * @property {google.cloud.automl.v1beta1.IImageObjectDetectionEvaluationMetrics|null} [imageObjectDetectionEvaluationMetrics] ModelEvaluation imageObjectDetectionEvaluationMetrics + * @property {google.cloud.automl.v1beta1.IVideoObjectTrackingEvaluationMetrics|null} [videoObjectTrackingEvaluationMetrics] ModelEvaluation videoObjectTrackingEvaluationMetrics + * @property {google.cloud.automl.v1beta1.ITextSentimentEvaluationMetrics|null} [textSentimentEvaluationMetrics] ModelEvaluation textSentimentEvaluationMetrics + * @property {google.cloud.automl.v1beta1.ITextExtractionEvaluationMetrics|null} [textExtractionEvaluationMetrics] ModelEvaluation textExtractionEvaluationMetrics + * @property {string|null} [name] ModelEvaluation name + * @property {string|null} [annotationSpecId] ModelEvaluation annotationSpecId + * @property {string|null} [displayName] ModelEvaluation displayName + * @property {google.protobuf.ITimestamp|null} [createTime] ModelEvaluation createTime + * @property {number|null} [evaluatedExampleCount] ModelEvaluation evaluatedExampleCount + */ + + /** + * Constructs a new ModelEvaluation. + * @memberof google.cloud.automl.v1beta1 + * @classdesc Represents a ModelEvaluation. + * @implements IModelEvaluation + * @constructor + * @param {google.cloud.automl.v1beta1.IModelEvaluation=} [properties] Properties to set + */ + function ModelEvaluation(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ModelEvaluation classificationEvaluationMetrics. + * @member {google.cloud.automl.v1beta1.IClassificationEvaluationMetrics|null|undefined} classificationEvaluationMetrics + * @memberof google.cloud.automl.v1beta1.ModelEvaluation + * @instance + */ + ModelEvaluation.prototype.classificationEvaluationMetrics = null; + + /** + * ModelEvaluation regressionEvaluationMetrics. + * @member {google.cloud.automl.v1beta1.IRegressionEvaluationMetrics|null|undefined} regressionEvaluationMetrics + * @memberof google.cloud.automl.v1beta1.ModelEvaluation + * @instance + */ + ModelEvaluation.prototype.regressionEvaluationMetrics = null; + + /** + * ModelEvaluation translationEvaluationMetrics. + * @member {google.cloud.automl.v1beta1.ITranslationEvaluationMetrics|null|undefined} translationEvaluationMetrics + * @memberof google.cloud.automl.v1beta1.ModelEvaluation + * @instance + */ + ModelEvaluation.prototype.translationEvaluationMetrics = null; + + /** + * ModelEvaluation imageObjectDetectionEvaluationMetrics. + * @member {google.cloud.automl.v1beta1.IImageObjectDetectionEvaluationMetrics|null|undefined} imageObjectDetectionEvaluationMetrics + * @memberof google.cloud.automl.v1beta1.ModelEvaluation + * @instance + */ + ModelEvaluation.prototype.imageObjectDetectionEvaluationMetrics = null; + + /** + * ModelEvaluation videoObjectTrackingEvaluationMetrics. + * @member {google.cloud.automl.v1beta1.IVideoObjectTrackingEvaluationMetrics|null|undefined} videoObjectTrackingEvaluationMetrics + * @memberof google.cloud.automl.v1beta1.ModelEvaluation + * @instance + */ + ModelEvaluation.prototype.videoObjectTrackingEvaluationMetrics = null; + + /** + * ModelEvaluation textSentimentEvaluationMetrics. + * @member {google.cloud.automl.v1beta1.ITextSentimentEvaluationMetrics|null|undefined} textSentimentEvaluationMetrics + * @memberof google.cloud.automl.v1beta1.ModelEvaluation + * @instance + */ + ModelEvaluation.prototype.textSentimentEvaluationMetrics = null; + + /** + * ModelEvaluation textExtractionEvaluationMetrics. + * @member {google.cloud.automl.v1beta1.ITextExtractionEvaluationMetrics|null|undefined} textExtractionEvaluationMetrics + * @memberof google.cloud.automl.v1beta1.ModelEvaluation + * @instance + */ + ModelEvaluation.prototype.textExtractionEvaluationMetrics = null; + + /** + * ModelEvaluation name. + * @member {string} name + * @memberof google.cloud.automl.v1beta1.ModelEvaluation + * @instance + */ + ModelEvaluation.prototype.name = ""; + + /** + * ModelEvaluation annotationSpecId. + * @member {string} annotationSpecId + * @memberof google.cloud.automl.v1beta1.ModelEvaluation + * @instance + */ + ModelEvaluation.prototype.annotationSpecId = ""; + + /** + * ModelEvaluation displayName. + * @member {string} displayName + * @memberof google.cloud.automl.v1beta1.ModelEvaluation + * @instance + */ + ModelEvaluation.prototype.displayName = ""; + + /** + * ModelEvaluation createTime. + * @member {google.protobuf.ITimestamp|null|undefined} createTime + * @memberof google.cloud.automl.v1beta1.ModelEvaluation + * @instance + */ + ModelEvaluation.prototype.createTime = null; + + /** + * ModelEvaluation evaluatedExampleCount. + * @member {number} evaluatedExampleCount + * @memberof google.cloud.automl.v1beta1.ModelEvaluation + * @instance + */ + ModelEvaluation.prototype.evaluatedExampleCount = 0; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * ModelEvaluation metrics. + * @member {"classificationEvaluationMetrics"|"regressionEvaluationMetrics"|"translationEvaluationMetrics"|"imageObjectDetectionEvaluationMetrics"|"videoObjectTrackingEvaluationMetrics"|"textSentimentEvaluationMetrics"|"textExtractionEvaluationMetrics"|undefined} metrics + * @memberof google.cloud.automl.v1beta1.ModelEvaluation + * @instance + */ + Object.defineProperty(ModelEvaluation.prototype, "metrics", { + get: $util.oneOfGetter($oneOfFields = ["classificationEvaluationMetrics", "regressionEvaluationMetrics", "translationEvaluationMetrics", "imageObjectDetectionEvaluationMetrics", "videoObjectTrackingEvaluationMetrics", "textSentimentEvaluationMetrics", "textExtractionEvaluationMetrics"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new ModelEvaluation instance using the specified properties. + * @function create + * @memberof google.cloud.automl.v1beta1.ModelEvaluation + * @static + * @param {google.cloud.automl.v1beta1.IModelEvaluation=} [properties] Properties to set + * @returns {google.cloud.automl.v1beta1.ModelEvaluation} ModelEvaluation instance + */ + ModelEvaluation.create = function create(properties) { + return new ModelEvaluation(properties); + }; + + /** + * Encodes the specified ModelEvaluation message. Does not implicitly {@link google.cloud.automl.v1beta1.ModelEvaluation.verify|verify} messages. + * @function encode + * @memberof google.cloud.automl.v1beta1.ModelEvaluation + * @static + * @param {google.cloud.automl.v1beta1.IModelEvaluation} message ModelEvaluation message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ModelEvaluation.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.annotationSpecId != null && Object.hasOwnProperty.call(message, "annotationSpecId")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.annotationSpecId); + if (message.createTime != null && Object.hasOwnProperty.call(message, "createTime")) + $root.google.protobuf.Timestamp.encode(message.createTime, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.evaluatedExampleCount != null && Object.hasOwnProperty.call(message, "evaluatedExampleCount")) + writer.uint32(/* id 6, wireType 0 =*/48).int32(message.evaluatedExampleCount); + if (message.classificationEvaluationMetrics != null && Object.hasOwnProperty.call(message, "classificationEvaluationMetrics")) + $root.google.cloud.automl.v1beta1.ClassificationEvaluationMetrics.encode(message.classificationEvaluationMetrics, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); + if (message.translationEvaluationMetrics != null && Object.hasOwnProperty.call(message, "translationEvaluationMetrics")) + $root.google.cloud.automl.v1beta1.TranslationEvaluationMetrics.encode(message.translationEvaluationMetrics, writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim(); + if (message.textSentimentEvaluationMetrics != null && Object.hasOwnProperty.call(message, "textSentimentEvaluationMetrics")) + $root.google.cloud.automl.v1beta1.TextSentimentEvaluationMetrics.encode(message.textSentimentEvaluationMetrics, writer.uint32(/* id 11, wireType 2 =*/90).fork()).ldelim(); + if (message.imageObjectDetectionEvaluationMetrics != null && Object.hasOwnProperty.call(message, "imageObjectDetectionEvaluationMetrics")) + $root.google.cloud.automl.v1beta1.ImageObjectDetectionEvaluationMetrics.encode(message.imageObjectDetectionEvaluationMetrics, writer.uint32(/* id 12, wireType 2 =*/98).fork()).ldelim(); + if (message.textExtractionEvaluationMetrics != null && Object.hasOwnProperty.call(message, "textExtractionEvaluationMetrics")) + $root.google.cloud.automl.v1beta1.TextExtractionEvaluationMetrics.encode(message.textExtractionEvaluationMetrics, writer.uint32(/* id 13, wireType 2 =*/106).fork()).ldelim(); + if (message.videoObjectTrackingEvaluationMetrics != null && Object.hasOwnProperty.call(message, "videoObjectTrackingEvaluationMetrics")) + $root.google.cloud.automl.v1beta1.VideoObjectTrackingEvaluationMetrics.encode(message.videoObjectTrackingEvaluationMetrics, writer.uint32(/* id 14, wireType 2 =*/114).fork()).ldelim(); + if (message.displayName != null && Object.hasOwnProperty.call(message, "displayName")) + writer.uint32(/* id 15, wireType 2 =*/122).string(message.displayName); + if (message.regressionEvaluationMetrics != null && Object.hasOwnProperty.call(message, "regressionEvaluationMetrics")) + $root.google.cloud.automl.v1beta1.RegressionEvaluationMetrics.encode(message.regressionEvaluationMetrics, writer.uint32(/* id 24, wireType 2 =*/194).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified ModelEvaluation message, length delimited. Does not implicitly {@link google.cloud.automl.v1beta1.ModelEvaluation.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.automl.v1beta1.ModelEvaluation + * @static + * @param {google.cloud.automl.v1beta1.IModelEvaluation} message ModelEvaluation message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ModelEvaluation.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ModelEvaluation message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.automl.v1beta1.ModelEvaluation + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.automl.v1beta1.ModelEvaluation} ModelEvaluation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ModelEvaluation.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.automl.v1beta1.ModelEvaluation(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 8: { + message.classificationEvaluationMetrics = $root.google.cloud.automl.v1beta1.ClassificationEvaluationMetrics.decode(reader, reader.uint32()); + break; + } + case 24: { + message.regressionEvaluationMetrics = $root.google.cloud.automl.v1beta1.RegressionEvaluationMetrics.decode(reader, reader.uint32()); + break; + } + case 9: { + message.translationEvaluationMetrics = $root.google.cloud.automl.v1beta1.TranslationEvaluationMetrics.decode(reader, reader.uint32()); + break; + } + case 12: { + message.imageObjectDetectionEvaluationMetrics = $root.google.cloud.automl.v1beta1.ImageObjectDetectionEvaluationMetrics.decode(reader, reader.uint32()); + break; + } + case 14: { + message.videoObjectTrackingEvaluationMetrics = $root.google.cloud.automl.v1beta1.VideoObjectTrackingEvaluationMetrics.decode(reader, reader.uint32()); + break; + } + case 11: { + message.textSentimentEvaluationMetrics = $root.google.cloud.automl.v1beta1.TextSentimentEvaluationMetrics.decode(reader, reader.uint32()); + break; + } + case 13: { + message.textExtractionEvaluationMetrics = $root.google.cloud.automl.v1beta1.TextExtractionEvaluationMetrics.decode(reader, reader.uint32()); + break; + } + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.annotationSpecId = reader.string(); + break; + } + case 15: { + message.displayName = reader.string(); + break; + } + case 5: { + message.createTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 6: { + message.evaluatedExampleCount = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ModelEvaluation message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.automl.v1beta1.ModelEvaluation + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.automl.v1beta1.ModelEvaluation} ModelEvaluation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ModelEvaluation.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ModelEvaluation message. + * @function verify + * @memberof google.cloud.automl.v1beta1.ModelEvaluation + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ModelEvaluation.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.classificationEvaluationMetrics != null && message.hasOwnProperty("classificationEvaluationMetrics")) { + properties.metrics = 1; + { + var error = $root.google.cloud.automl.v1beta1.ClassificationEvaluationMetrics.verify(message.classificationEvaluationMetrics); + if (error) + return "classificationEvaluationMetrics." + error; + } + } + if (message.regressionEvaluationMetrics != null && message.hasOwnProperty("regressionEvaluationMetrics")) { + if (properties.metrics === 1) + return "metrics: multiple values"; + properties.metrics = 1; + { + var error = $root.google.cloud.automl.v1beta1.RegressionEvaluationMetrics.verify(message.regressionEvaluationMetrics); + if (error) + return "regressionEvaluationMetrics." + error; + } + } + if (message.translationEvaluationMetrics != null && message.hasOwnProperty("translationEvaluationMetrics")) { + if (properties.metrics === 1) + return "metrics: multiple values"; + properties.metrics = 1; + { + var error = $root.google.cloud.automl.v1beta1.TranslationEvaluationMetrics.verify(message.translationEvaluationMetrics); + if (error) + return "translationEvaluationMetrics." + error; + } + } + if (message.imageObjectDetectionEvaluationMetrics != null && message.hasOwnProperty("imageObjectDetectionEvaluationMetrics")) { + if (properties.metrics === 1) + return "metrics: multiple values"; + properties.metrics = 1; + { + var error = $root.google.cloud.automl.v1beta1.ImageObjectDetectionEvaluationMetrics.verify(message.imageObjectDetectionEvaluationMetrics); + if (error) + return "imageObjectDetectionEvaluationMetrics." + error; + } + } + if (message.videoObjectTrackingEvaluationMetrics != null && message.hasOwnProperty("videoObjectTrackingEvaluationMetrics")) { + if (properties.metrics === 1) + return "metrics: multiple values"; + properties.metrics = 1; + { + var error = $root.google.cloud.automl.v1beta1.VideoObjectTrackingEvaluationMetrics.verify(message.videoObjectTrackingEvaluationMetrics); + if (error) + return "videoObjectTrackingEvaluationMetrics." + error; + } + } + if (message.textSentimentEvaluationMetrics != null && message.hasOwnProperty("textSentimentEvaluationMetrics")) { + if (properties.metrics === 1) + return "metrics: multiple values"; + properties.metrics = 1; + { + var error = $root.google.cloud.automl.v1beta1.TextSentimentEvaluationMetrics.verify(message.textSentimentEvaluationMetrics); + if (error) + return "textSentimentEvaluationMetrics." + error; + } + } + if (message.textExtractionEvaluationMetrics != null && message.hasOwnProperty("textExtractionEvaluationMetrics")) { + if (properties.metrics === 1) + return "metrics: multiple values"; + properties.metrics = 1; + { + var error = $root.google.cloud.automl.v1beta1.TextExtractionEvaluationMetrics.verify(message.textExtractionEvaluationMetrics); + if (error) + return "textExtractionEvaluationMetrics." + error; + } + } + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.annotationSpecId != null && message.hasOwnProperty("annotationSpecId")) + if (!$util.isString(message.annotationSpecId)) + return "annotationSpecId: string expected"; + if (message.displayName != null && message.hasOwnProperty("displayName")) + if (!$util.isString(message.displayName)) + return "displayName: string expected"; + if (message.createTime != null && message.hasOwnProperty("createTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.createTime); + if (error) + return "createTime." + error; + } + if (message.evaluatedExampleCount != null && message.hasOwnProperty("evaluatedExampleCount")) + if (!$util.isInteger(message.evaluatedExampleCount)) + return "evaluatedExampleCount: integer expected"; + return null; + }; + + /** + * Creates a ModelEvaluation message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.automl.v1beta1.ModelEvaluation + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.automl.v1beta1.ModelEvaluation} ModelEvaluation + */ + ModelEvaluation.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.automl.v1beta1.ModelEvaluation) + return object; + var message = new $root.google.cloud.automl.v1beta1.ModelEvaluation(); + if (object.classificationEvaluationMetrics != null) { + if (typeof object.classificationEvaluationMetrics !== "object") + throw TypeError(".google.cloud.automl.v1beta1.ModelEvaluation.classificationEvaluationMetrics: object expected"); + message.classificationEvaluationMetrics = $root.google.cloud.automl.v1beta1.ClassificationEvaluationMetrics.fromObject(object.classificationEvaluationMetrics); + } + if (object.regressionEvaluationMetrics != null) { + if (typeof object.regressionEvaluationMetrics !== "object") + throw TypeError(".google.cloud.automl.v1beta1.ModelEvaluation.regressionEvaluationMetrics: object expected"); + message.regressionEvaluationMetrics = $root.google.cloud.automl.v1beta1.RegressionEvaluationMetrics.fromObject(object.regressionEvaluationMetrics); + } + if (object.translationEvaluationMetrics != null) { + if (typeof object.translationEvaluationMetrics !== "object") + throw TypeError(".google.cloud.automl.v1beta1.ModelEvaluation.translationEvaluationMetrics: object expected"); + message.translationEvaluationMetrics = $root.google.cloud.automl.v1beta1.TranslationEvaluationMetrics.fromObject(object.translationEvaluationMetrics); + } + if (object.imageObjectDetectionEvaluationMetrics != null) { + if (typeof object.imageObjectDetectionEvaluationMetrics !== "object") + throw TypeError(".google.cloud.automl.v1beta1.ModelEvaluation.imageObjectDetectionEvaluationMetrics: object expected"); + message.imageObjectDetectionEvaluationMetrics = $root.google.cloud.automl.v1beta1.ImageObjectDetectionEvaluationMetrics.fromObject(object.imageObjectDetectionEvaluationMetrics); + } + if (object.videoObjectTrackingEvaluationMetrics != null) { + if (typeof object.videoObjectTrackingEvaluationMetrics !== "object") + throw TypeError(".google.cloud.automl.v1beta1.ModelEvaluation.videoObjectTrackingEvaluationMetrics: object expected"); + message.videoObjectTrackingEvaluationMetrics = $root.google.cloud.automl.v1beta1.VideoObjectTrackingEvaluationMetrics.fromObject(object.videoObjectTrackingEvaluationMetrics); + } + if (object.textSentimentEvaluationMetrics != null) { + if (typeof object.textSentimentEvaluationMetrics !== "object") + throw TypeError(".google.cloud.automl.v1beta1.ModelEvaluation.textSentimentEvaluationMetrics: object expected"); + message.textSentimentEvaluationMetrics = $root.google.cloud.automl.v1beta1.TextSentimentEvaluationMetrics.fromObject(object.textSentimentEvaluationMetrics); + } + if (object.textExtractionEvaluationMetrics != null) { + if (typeof object.textExtractionEvaluationMetrics !== "object") + throw TypeError(".google.cloud.automl.v1beta1.ModelEvaluation.textExtractionEvaluationMetrics: object expected"); + message.textExtractionEvaluationMetrics = $root.google.cloud.automl.v1beta1.TextExtractionEvaluationMetrics.fromObject(object.textExtractionEvaluationMetrics); + } + if (object.name != null) + message.name = String(object.name); + if (object.annotationSpecId != null) + message.annotationSpecId = String(object.annotationSpecId); + if (object.displayName != null) + message.displayName = String(object.displayName); + if (object.createTime != null) { + if (typeof object.createTime !== "object") + throw TypeError(".google.cloud.automl.v1beta1.ModelEvaluation.createTime: object expected"); + message.createTime = $root.google.protobuf.Timestamp.fromObject(object.createTime); + } + if (object.evaluatedExampleCount != null) + message.evaluatedExampleCount = object.evaluatedExampleCount | 0; + return message; + }; + + /** + * Creates a plain object from a ModelEvaluation message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.automl.v1beta1.ModelEvaluation + * @static + * @param {google.cloud.automl.v1beta1.ModelEvaluation} message ModelEvaluation + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ModelEvaluation.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.annotationSpecId = ""; + object.createTime = null; + object.evaluatedExampleCount = 0; + object.displayName = ""; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.annotationSpecId != null && message.hasOwnProperty("annotationSpecId")) + object.annotationSpecId = message.annotationSpecId; + if (message.createTime != null && message.hasOwnProperty("createTime")) + object.createTime = $root.google.protobuf.Timestamp.toObject(message.createTime, options); + if (message.evaluatedExampleCount != null && message.hasOwnProperty("evaluatedExampleCount")) + object.evaluatedExampleCount = message.evaluatedExampleCount; + if (message.classificationEvaluationMetrics != null && message.hasOwnProperty("classificationEvaluationMetrics")) { + object.classificationEvaluationMetrics = $root.google.cloud.automl.v1beta1.ClassificationEvaluationMetrics.toObject(message.classificationEvaluationMetrics, options); + if (options.oneofs) + object.metrics = "classificationEvaluationMetrics"; + } + if (message.translationEvaluationMetrics != null && message.hasOwnProperty("translationEvaluationMetrics")) { + object.translationEvaluationMetrics = $root.google.cloud.automl.v1beta1.TranslationEvaluationMetrics.toObject(message.translationEvaluationMetrics, options); + if (options.oneofs) + object.metrics = "translationEvaluationMetrics"; + } + if (message.textSentimentEvaluationMetrics != null && message.hasOwnProperty("textSentimentEvaluationMetrics")) { + object.textSentimentEvaluationMetrics = $root.google.cloud.automl.v1beta1.TextSentimentEvaluationMetrics.toObject(message.textSentimentEvaluationMetrics, options); + if (options.oneofs) + object.metrics = "textSentimentEvaluationMetrics"; + } + if (message.imageObjectDetectionEvaluationMetrics != null && message.hasOwnProperty("imageObjectDetectionEvaluationMetrics")) { + object.imageObjectDetectionEvaluationMetrics = $root.google.cloud.automl.v1beta1.ImageObjectDetectionEvaluationMetrics.toObject(message.imageObjectDetectionEvaluationMetrics, options); + if (options.oneofs) + object.metrics = "imageObjectDetectionEvaluationMetrics"; + } + if (message.textExtractionEvaluationMetrics != null && message.hasOwnProperty("textExtractionEvaluationMetrics")) { + object.textExtractionEvaluationMetrics = $root.google.cloud.automl.v1beta1.TextExtractionEvaluationMetrics.toObject(message.textExtractionEvaluationMetrics, options); + if (options.oneofs) + object.metrics = "textExtractionEvaluationMetrics"; + } + if (message.videoObjectTrackingEvaluationMetrics != null && message.hasOwnProperty("videoObjectTrackingEvaluationMetrics")) { + object.videoObjectTrackingEvaluationMetrics = $root.google.cloud.automl.v1beta1.VideoObjectTrackingEvaluationMetrics.toObject(message.videoObjectTrackingEvaluationMetrics, options); + if (options.oneofs) + object.metrics = "videoObjectTrackingEvaluationMetrics"; + } + if (message.displayName != null && message.hasOwnProperty("displayName")) + object.displayName = message.displayName; + if (message.regressionEvaluationMetrics != null && message.hasOwnProperty("regressionEvaluationMetrics")) { + object.regressionEvaluationMetrics = $root.google.cloud.automl.v1beta1.RegressionEvaluationMetrics.toObject(message.regressionEvaluationMetrics, options); + if (options.oneofs) + object.metrics = "regressionEvaluationMetrics"; + } + return object; + }; + + /** + * Converts this ModelEvaluation to JSON. + * @function toJSON + * @memberof google.cloud.automl.v1beta1.ModelEvaluation + * @instance + * @returns {Object.} JSON object + */ + ModelEvaluation.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ModelEvaluation + * @function getTypeUrl + * @memberof google.cloud.automl.v1beta1.ModelEvaluation + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ModelEvaluation.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.automl.v1beta1.ModelEvaluation"; + }; + + return ModelEvaluation; + })(); + + v1beta1.OperationMetadata = (function() { + + /** + * Properties of an OperationMetadata. + * @memberof google.cloud.automl.v1beta1 + * @interface IOperationMetadata + * @property {google.cloud.automl.v1beta1.IDeleteOperationMetadata|null} [deleteDetails] OperationMetadata deleteDetails + * @property {google.cloud.automl.v1beta1.IDeployModelOperationMetadata|null} [deployModelDetails] OperationMetadata deployModelDetails + * @property {google.cloud.automl.v1beta1.IUndeployModelOperationMetadata|null} [undeployModelDetails] OperationMetadata undeployModelDetails + * @property {google.cloud.automl.v1beta1.ICreateModelOperationMetadata|null} [createModelDetails] OperationMetadata createModelDetails + * @property {google.cloud.automl.v1beta1.IImportDataOperationMetadata|null} [importDataDetails] OperationMetadata importDataDetails + * @property {google.cloud.automl.v1beta1.IBatchPredictOperationMetadata|null} [batchPredictDetails] OperationMetadata batchPredictDetails + * @property {google.cloud.automl.v1beta1.IExportDataOperationMetadata|null} [exportDataDetails] OperationMetadata exportDataDetails + * @property {google.cloud.automl.v1beta1.IExportModelOperationMetadata|null} [exportModelDetails] OperationMetadata exportModelDetails + * @property {google.cloud.automl.v1beta1.IExportEvaluatedExamplesOperationMetadata|null} [exportEvaluatedExamplesDetails] OperationMetadata exportEvaluatedExamplesDetails + * @property {number|null} [progressPercent] OperationMetadata progressPercent + * @property {Array.|null} [partialFailures] OperationMetadata partialFailures + * @property {google.protobuf.ITimestamp|null} [createTime] OperationMetadata createTime + * @property {google.protobuf.ITimestamp|null} [updateTime] OperationMetadata updateTime + */ + + /** + * Constructs a new OperationMetadata. + * @memberof google.cloud.automl.v1beta1 + * @classdesc Represents an OperationMetadata. + * @implements IOperationMetadata + * @constructor + * @param {google.cloud.automl.v1beta1.IOperationMetadata=} [properties] Properties to set + */ + function OperationMetadata(properties) { + this.partialFailures = []; + if (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 deleteDetails. + * @member {google.cloud.automl.v1beta1.IDeleteOperationMetadata|null|undefined} deleteDetails + * @memberof google.cloud.automl.v1beta1.OperationMetadata + * @instance + */ + OperationMetadata.prototype.deleteDetails = null; + + /** + * OperationMetadata deployModelDetails. + * @member {google.cloud.automl.v1beta1.IDeployModelOperationMetadata|null|undefined} deployModelDetails + * @memberof google.cloud.automl.v1beta1.OperationMetadata + * @instance + */ + OperationMetadata.prototype.deployModelDetails = null; + + /** + * OperationMetadata undeployModelDetails. + * @member {google.cloud.automl.v1beta1.IUndeployModelOperationMetadata|null|undefined} undeployModelDetails + * @memberof google.cloud.automl.v1beta1.OperationMetadata + * @instance + */ + OperationMetadata.prototype.undeployModelDetails = null; + + /** + * OperationMetadata createModelDetails. + * @member {google.cloud.automl.v1beta1.ICreateModelOperationMetadata|null|undefined} createModelDetails + * @memberof google.cloud.automl.v1beta1.OperationMetadata + * @instance + */ + OperationMetadata.prototype.createModelDetails = null; + + /** + * OperationMetadata importDataDetails. + * @member {google.cloud.automl.v1beta1.IImportDataOperationMetadata|null|undefined} importDataDetails + * @memberof google.cloud.automl.v1beta1.OperationMetadata + * @instance + */ + OperationMetadata.prototype.importDataDetails = null; + + /** + * OperationMetadata batchPredictDetails. + * @member {google.cloud.automl.v1beta1.IBatchPredictOperationMetadata|null|undefined} batchPredictDetails + * @memberof google.cloud.automl.v1beta1.OperationMetadata + * @instance + */ + OperationMetadata.prototype.batchPredictDetails = null; + + /** + * OperationMetadata exportDataDetails. + * @member {google.cloud.automl.v1beta1.IExportDataOperationMetadata|null|undefined} exportDataDetails + * @memberof google.cloud.automl.v1beta1.OperationMetadata + * @instance + */ + OperationMetadata.prototype.exportDataDetails = null; + + /** + * OperationMetadata exportModelDetails. + * @member {google.cloud.automl.v1beta1.IExportModelOperationMetadata|null|undefined} exportModelDetails + * @memberof google.cloud.automl.v1beta1.OperationMetadata + * @instance + */ + OperationMetadata.prototype.exportModelDetails = null; + + /** + * OperationMetadata exportEvaluatedExamplesDetails. + * @member {google.cloud.automl.v1beta1.IExportEvaluatedExamplesOperationMetadata|null|undefined} exportEvaluatedExamplesDetails + * @memberof google.cloud.automl.v1beta1.OperationMetadata + * @instance + */ + OperationMetadata.prototype.exportEvaluatedExamplesDetails = null; + + /** + * OperationMetadata progressPercent. + * @member {number} progressPercent + * @memberof google.cloud.automl.v1beta1.OperationMetadata + * @instance + */ + OperationMetadata.prototype.progressPercent = 0; + + /** + * OperationMetadata partialFailures. + * @member {Array.} partialFailures + * @memberof google.cloud.automl.v1beta1.OperationMetadata + * @instance + */ + OperationMetadata.prototype.partialFailures = $util.emptyArray; + + /** + * OperationMetadata createTime. + * @member {google.protobuf.ITimestamp|null|undefined} createTime + * @memberof google.cloud.automl.v1beta1.OperationMetadata + * @instance + */ + OperationMetadata.prototype.createTime = null; + + /** + * OperationMetadata updateTime. + * @member {google.protobuf.ITimestamp|null|undefined} updateTime + * @memberof google.cloud.automl.v1beta1.OperationMetadata + * @instance + */ + OperationMetadata.prototype.updateTime = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * OperationMetadata details. + * @member {"deleteDetails"|"deployModelDetails"|"undeployModelDetails"|"createModelDetails"|"importDataDetails"|"batchPredictDetails"|"exportDataDetails"|"exportModelDetails"|"exportEvaluatedExamplesDetails"|undefined} details + * @memberof google.cloud.automl.v1beta1.OperationMetadata + * @instance + */ + Object.defineProperty(OperationMetadata.prototype, "details", { + get: $util.oneOfGetter($oneOfFields = ["deleteDetails", "deployModelDetails", "undeployModelDetails", "createModelDetails", "importDataDetails", "batchPredictDetails", "exportDataDetails", "exportModelDetails", "exportEvaluatedExamplesDetails"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new OperationMetadata instance using the specified properties. + * @function create + * @memberof google.cloud.automl.v1beta1.OperationMetadata + * @static + * @param {google.cloud.automl.v1beta1.IOperationMetadata=} [properties] Properties to set + * @returns {google.cloud.automl.v1beta1.OperationMetadata} OperationMetadata instance + */ + OperationMetadata.create = function create(properties) { + return new OperationMetadata(properties); + }; + + /** + * Encodes the specified OperationMetadata message. Does not implicitly {@link google.cloud.automl.v1beta1.OperationMetadata.verify|verify} messages. + * @function encode + * @memberof google.cloud.automl.v1beta1.OperationMetadata + * @static + * @param {google.cloud.automl.v1beta1.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.partialFailures != null && message.partialFailures.length) + for (var i = 0; i < message.partialFailures.length; ++i) + $root.google.rpc.Status.encode(message.partialFailures[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.createTime != null && Object.hasOwnProperty.call(message, "createTime")) + $root.google.protobuf.Timestamp.encode(message.createTime, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.updateTime != null && Object.hasOwnProperty.call(message, "updateTime")) + $root.google.protobuf.Timestamp.encode(message.updateTime, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.deleteDetails != null && Object.hasOwnProperty.call(message, "deleteDetails")) + $root.google.cloud.automl.v1beta1.DeleteOperationMetadata.encode(message.deleteDetails, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); + if (message.createModelDetails != null && Object.hasOwnProperty.call(message, "createModelDetails")) + $root.google.cloud.automl.v1beta1.CreateModelOperationMetadata.encode(message.createModelDetails, writer.uint32(/* id 10, wireType 2 =*/82).fork()).ldelim(); + if (message.progressPercent != null && Object.hasOwnProperty.call(message, "progressPercent")) + writer.uint32(/* id 13, wireType 0 =*/104).int32(message.progressPercent); + if (message.importDataDetails != null && Object.hasOwnProperty.call(message, "importDataDetails")) + $root.google.cloud.automl.v1beta1.ImportDataOperationMetadata.encode(message.importDataDetails, writer.uint32(/* id 15, wireType 2 =*/122).fork()).ldelim(); + if (message.batchPredictDetails != null && Object.hasOwnProperty.call(message, "batchPredictDetails")) + $root.google.cloud.automl.v1beta1.BatchPredictOperationMetadata.encode(message.batchPredictDetails, writer.uint32(/* id 16, wireType 2 =*/130).fork()).ldelim(); + if (message.exportDataDetails != null && Object.hasOwnProperty.call(message, "exportDataDetails")) + $root.google.cloud.automl.v1beta1.ExportDataOperationMetadata.encode(message.exportDataDetails, writer.uint32(/* id 21, wireType 2 =*/170).fork()).ldelim(); + if (message.exportModelDetails != null && Object.hasOwnProperty.call(message, "exportModelDetails")) + $root.google.cloud.automl.v1beta1.ExportModelOperationMetadata.encode(message.exportModelDetails, writer.uint32(/* id 22, wireType 2 =*/178).fork()).ldelim(); + if (message.deployModelDetails != null && Object.hasOwnProperty.call(message, "deployModelDetails")) + $root.google.cloud.automl.v1beta1.DeployModelOperationMetadata.encode(message.deployModelDetails, writer.uint32(/* id 24, wireType 2 =*/194).fork()).ldelim(); + if (message.undeployModelDetails != null && Object.hasOwnProperty.call(message, "undeployModelDetails")) + $root.google.cloud.automl.v1beta1.UndeployModelOperationMetadata.encode(message.undeployModelDetails, writer.uint32(/* id 25, wireType 2 =*/202).fork()).ldelim(); + if (message.exportEvaluatedExamplesDetails != null && Object.hasOwnProperty.call(message, "exportEvaluatedExamplesDetails")) + $root.google.cloud.automl.v1beta1.ExportEvaluatedExamplesOperationMetadata.encode(message.exportEvaluatedExamplesDetails, writer.uint32(/* id 26, wireType 2 =*/210).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified OperationMetadata message, length delimited. Does not implicitly {@link google.cloud.automl.v1beta1.OperationMetadata.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.automl.v1beta1.OperationMetadata + * @static + * @param {google.cloud.automl.v1beta1.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.automl.v1beta1.OperationMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.automl.v1beta1.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) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.automl.v1beta1.OperationMetadata(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 8: { + message.deleteDetails = $root.google.cloud.automl.v1beta1.DeleteOperationMetadata.decode(reader, reader.uint32()); + break; + } + case 24: { + message.deployModelDetails = $root.google.cloud.automl.v1beta1.DeployModelOperationMetadata.decode(reader, reader.uint32()); + break; + } + case 25: { + message.undeployModelDetails = $root.google.cloud.automl.v1beta1.UndeployModelOperationMetadata.decode(reader, reader.uint32()); + break; + } + case 10: { + message.createModelDetails = $root.google.cloud.automl.v1beta1.CreateModelOperationMetadata.decode(reader, reader.uint32()); + break; + } + case 15: { + message.importDataDetails = $root.google.cloud.automl.v1beta1.ImportDataOperationMetadata.decode(reader, reader.uint32()); + break; + } + case 16: { + message.batchPredictDetails = $root.google.cloud.automl.v1beta1.BatchPredictOperationMetadata.decode(reader, reader.uint32()); + break; + } + case 21: { + message.exportDataDetails = $root.google.cloud.automl.v1beta1.ExportDataOperationMetadata.decode(reader, reader.uint32()); + break; + } + case 22: { + message.exportModelDetails = $root.google.cloud.automl.v1beta1.ExportModelOperationMetadata.decode(reader, reader.uint32()); + break; + } + case 26: { + message.exportEvaluatedExamplesDetails = $root.google.cloud.automl.v1beta1.ExportEvaluatedExamplesOperationMetadata.decode(reader, reader.uint32()); + break; + } + case 13: { + message.progressPercent = reader.int32(); + break; + } + case 2: { + if (!(message.partialFailures && message.partialFailures.length)) + message.partialFailures = []; + message.partialFailures.push($root.google.rpc.Status.decode(reader, reader.uint32())); + break; + } + case 3: { + message.createTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 4: { + message.updateTime = $root.google.protobuf.Timestamp.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.automl.v1beta1.OperationMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.automl.v1beta1.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.automl.v1beta1.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.deleteDetails != null && message.hasOwnProperty("deleteDetails")) { + properties.details = 1; + { + var error = $root.google.cloud.automl.v1beta1.DeleteOperationMetadata.verify(message.deleteDetails); + if (error) + return "deleteDetails." + error; + } + } + if (message.deployModelDetails != null && message.hasOwnProperty("deployModelDetails")) { + if (properties.details === 1) + return "details: multiple values"; + properties.details = 1; + { + var error = $root.google.cloud.automl.v1beta1.DeployModelOperationMetadata.verify(message.deployModelDetails); + if (error) + return "deployModelDetails." + error; + } + } + if (message.undeployModelDetails != null && message.hasOwnProperty("undeployModelDetails")) { + if (properties.details === 1) + return "details: multiple values"; + properties.details = 1; + { + var error = $root.google.cloud.automl.v1beta1.UndeployModelOperationMetadata.verify(message.undeployModelDetails); + if (error) + return "undeployModelDetails." + error; + } + } + if (message.createModelDetails != null && message.hasOwnProperty("createModelDetails")) { + if (properties.details === 1) + return "details: multiple values"; + properties.details = 1; + { + var error = $root.google.cloud.automl.v1beta1.CreateModelOperationMetadata.verify(message.createModelDetails); + if (error) + return "createModelDetails." + error; + } + } + if (message.importDataDetails != null && message.hasOwnProperty("importDataDetails")) { + if (properties.details === 1) + return "details: multiple values"; + properties.details = 1; + { + var error = $root.google.cloud.automl.v1beta1.ImportDataOperationMetadata.verify(message.importDataDetails); + if (error) + return "importDataDetails." + error; + } + } + if (message.batchPredictDetails != null && message.hasOwnProperty("batchPredictDetails")) { + if (properties.details === 1) + return "details: multiple values"; + properties.details = 1; + { + var error = $root.google.cloud.automl.v1beta1.BatchPredictOperationMetadata.verify(message.batchPredictDetails); + if (error) + return "batchPredictDetails." + error; + } + } + if (message.exportDataDetails != null && message.hasOwnProperty("exportDataDetails")) { + if (properties.details === 1) + return "details: multiple values"; + properties.details = 1; + { + var error = $root.google.cloud.automl.v1beta1.ExportDataOperationMetadata.verify(message.exportDataDetails); + if (error) + return "exportDataDetails." + error; + } + } + if (message.exportModelDetails != null && message.hasOwnProperty("exportModelDetails")) { + if (properties.details === 1) + return "details: multiple values"; + properties.details = 1; + { + var error = $root.google.cloud.automl.v1beta1.ExportModelOperationMetadata.verify(message.exportModelDetails); + if (error) + return "exportModelDetails." + error; + } + } + if (message.exportEvaluatedExamplesDetails != null && message.hasOwnProperty("exportEvaluatedExamplesDetails")) { + if (properties.details === 1) + return "details: multiple values"; + properties.details = 1; + { + var error = $root.google.cloud.automl.v1beta1.ExportEvaluatedExamplesOperationMetadata.verify(message.exportEvaluatedExamplesDetails); + if (error) + return "exportEvaluatedExamplesDetails." + error; + } + } + if (message.progressPercent != null && message.hasOwnProperty("progressPercent")) + if (!$util.isInteger(message.progressPercent)) + return "progressPercent: integer expected"; + if (message.partialFailures != null && message.hasOwnProperty("partialFailures")) { + if (!Array.isArray(message.partialFailures)) + return "partialFailures: array expected"; + for (var i = 0; i < message.partialFailures.length; ++i) { + var error = $root.google.rpc.Status.verify(message.partialFailures[i]); + if (error) + return "partialFailures." + error; + } + } + 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; + } + return null; + }; + + /** + * Creates an OperationMetadata message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.automl.v1beta1.OperationMetadata + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.automl.v1beta1.OperationMetadata} OperationMetadata + */ + OperationMetadata.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.automl.v1beta1.OperationMetadata) + return object; + var message = new $root.google.cloud.automl.v1beta1.OperationMetadata(); + if (object.deleteDetails != null) { + if (typeof object.deleteDetails !== "object") + throw TypeError(".google.cloud.automl.v1beta1.OperationMetadata.deleteDetails: object expected"); + message.deleteDetails = $root.google.cloud.automl.v1beta1.DeleteOperationMetadata.fromObject(object.deleteDetails); + } + if (object.deployModelDetails != null) { + if (typeof object.deployModelDetails !== "object") + throw TypeError(".google.cloud.automl.v1beta1.OperationMetadata.deployModelDetails: object expected"); + message.deployModelDetails = $root.google.cloud.automl.v1beta1.DeployModelOperationMetadata.fromObject(object.deployModelDetails); + } + if (object.undeployModelDetails != null) { + if (typeof object.undeployModelDetails !== "object") + throw TypeError(".google.cloud.automl.v1beta1.OperationMetadata.undeployModelDetails: object expected"); + message.undeployModelDetails = $root.google.cloud.automl.v1beta1.UndeployModelOperationMetadata.fromObject(object.undeployModelDetails); + } + if (object.createModelDetails != null) { + if (typeof object.createModelDetails !== "object") + throw TypeError(".google.cloud.automl.v1beta1.OperationMetadata.createModelDetails: object expected"); + message.createModelDetails = $root.google.cloud.automl.v1beta1.CreateModelOperationMetadata.fromObject(object.createModelDetails); + } + if (object.importDataDetails != null) { + if (typeof object.importDataDetails !== "object") + throw TypeError(".google.cloud.automl.v1beta1.OperationMetadata.importDataDetails: object expected"); + message.importDataDetails = $root.google.cloud.automl.v1beta1.ImportDataOperationMetadata.fromObject(object.importDataDetails); + } + if (object.batchPredictDetails != null) { + if (typeof object.batchPredictDetails !== "object") + throw TypeError(".google.cloud.automl.v1beta1.OperationMetadata.batchPredictDetails: object expected"); + message.batchPredictDetails = $root.google.cloud.automl.v1beta1.BatchPredictOperationMetadata.fromObject(object.batchPredictDetails); + } + if (object.exportDataDetails != null) { + if (typeof object.exportDataDetails !== "object") + throw TypeError(".google.cloud.automl.v1beta1.OperationMetadata.exportDataDetails: object expected"); + message.exportDataDetails = $root.google.cloud.automl.v1beta1.ExportDataOperationMetadata.fromObject(object.exportDataDetails); + } + if (object.exportModelDetails != null) { + if (typeof object.exportModelDetails !== "object") + throw TypeError(".google.cloud.automl.v1beta1.OperationMetadata.exportModelDetails: object expected"); + message.exportModelDetails = $root.google.cloud.automl.v1beta1.ExportModelOperationMetadata.fromObject(object.exportModelDetails); + } + if (object.exportEvaluatedExamplesDetails != null) { + if (typeof object.exportEvaluatedExamplesDetails !== "object") + throw TypeError(".google.cloud.automl.v1beta1.OperationMetadata.exportEvaluatedExamplesDetails: object expected"); + message.exportEvaluatedExamplesDetails = $root.google.cloud.automl.v1beta1.ExportEvaluatedExamplesOperationMetadata.fromObject(object.exportEvaluatedExamplesDetails); + } + if (object.progressPercent != null) + message.progressPercent = object.progressPercent | 0; + if (object.partialFailures) { + if (!Array.isArray(object.partialFailures)) + throw TypeError(".google.cloud.automl.v1beta1.OperationMetadata.partialFailures: array expected"); + message.partialFailures = []; + for (var i = 0; i < object.partialFailures.length; ++i) { + if (typeof object.partialFailures[i] !== "object") + throw TypeError(".google.cloud.automl.v1beta1.OperationMetadata.partialFailures: object expected"); + message.partialFailures[i] = $root.google.rpc.Status.fromObject(object.partialFailures[i]); + } + } + if (object.createTime != null) { + if (typeof object.createTime !== "object") + throw TypeError(".google.cloud.automl.v1beta1.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.automl.v1beta1.OperationMetadata.updateTime: object expected"); + message.updateTime = $root.google.protobuf.Timestamp.fromObject(object.updateTime); + } + return message; + }; + + /** + * Creates a plain object from an OperationMetadata message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.automl.v1beta1.OperationMetadata + * @static + * @param {google.cloud.automl.v1beta1.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.arrays || options.defaults) + object.partialFailures = []; + if (options.defaults) { + object.createTime = null; + object.updateTime = null; + object.progressPercent = 0; + } + if (message.partialFailures && message.partialFailures.length) { + object.partialFailures = []; + for (var j = 0; j < message.partialFailures.length; ++j) + object.partialFailures[j] = $root.google.rpc.Status.toObject(message.partialFailures[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.deleteDetails != null && message.hasOwnProperty("deleteDetails")) { + object.deleteDetails = $root.google.cloud.automl.v1beta1.DeleteOperationMetadata.toObject(message.deleteDetails, options); + if (options.oneofs) + object.details = "deleteDetails"; + } + if (message.createModelDetails != null && message.hasOwnProperty("createModelDetails")) { + object.createModelDetails = $root.google.cloud.automl.v1beta1.CreateModelOperationMetadata.toObject(message.createModelDetails, options); + if (options.oneofs) + object.details = "createModelDetails"; + } + if (message.progressPercent != null && message.hasOwnProperty("progressPercent")) + object.progressPercent = message.progressPercent; + if (message.importDataDetails != null && message.hasOwnProperty("importDataDetails")) { + object.importDataDetails = $root.google.cloud.automl.v1beta1.ImportDataOperationMetadata.toObject(message.importDataDetails, options); + if (options.oneofs) + object.details = "importDataDetails"; + } + if (message.batchPredictDetails != null && message.hasOwnProperty("batchPredictDetails")) { + object.batchPredictDetails = $root.google.cloud.automl.v1beta1.BatchPredictOperationMetadata.toObject(message.batchPredictDetails, options); + if (options.oneofs) + object.details = "batchPredictDetails"; + } + if (message.exportDataDetails != null && message.hasOwnProperty("exportDataDetails")) { + object.exportDataDetails = $root.google.cloud.automl.v1beta1.ExportDataOperationMetadata.toObject(message.exportDataDetails, options); + if (options.oneofs) + object.details = "exportDataDetails"; + } + if (message.exportModelDetails != null && message.hasOwnProperty("exportModelDetails")) { + object.exportModelDetails = $root.google.cloud.automl.v1beta1.ExportModelOperationMetadata.toObject(message.exportModelDetails, options); + if (options.oneofs) + object.details = "exportModelDetails"; + } + if (message.deployModelDetails != null && message.hasOwnProperty("deployModelDetails")) { + object.deployModelDetails = $root.google.cloud.automl.v1beta1.DeployModelOperationMetadata.toObject(message.deployModelDetails, options); + if (options.oneofs) + object.details = "deployModelDetails"; + } + if (message.undeployModelDetails != null && message.hasOwnProperty("undeployModelDetails")) { + object.undeployModelDetails = $root.google.cloud.automl.v1beta1.UndeployModelOperationMetadata.toObject(message.undeployModelDetails, options); + if (options.oneofs) + object.details = "undeployModelDetails"; + } + if (message.exportEvaluatedExamplesDetails != null && message.hasOwnProperty("exportEvaluatedExamplesDetails")) { + object.exportEvaluatedExamplesDetails = $root.google.cloud.automl.v1beta1.ExportEvaluatedExamplesOperationMetadata.toObject(message.exportEvaluatedExamplesDetails, options); + if (options.oneofs) + object.details = "exportEvaluatedExamplesDetails"; + } + return object; + }; + + /** + * Converts this OperationMetadata to JSON. + * @function toJSON + * @memberof google.cloud.automl.v1beta1.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.automl.v1beta1.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.automl.v1beta1.OperationMetadata"; + }; + + return OperationMetadata; + })(); + + v1beta1.DeleteOperationMetadata = (function() { + + /** + * Properties of a DeleteOperationMetadata. + * @memberof google.cloud.automl.v1beta1 + * @interface IDeleteOperationMetadata + */ + + /** + * Constructs a new DeleteOperationMetadata. + * @memberof google.cloud.automl.v1beta1 + * @classdesc Represents a DeleteOperationMetadata. + * @implements IDeleteOperationMetadata + * @constructor + * @param {google.cloud.automl.v1beta1.IDeleteOperationMetadata=} [properties] Properties to set + */ + function DeleteOperationMetadata(properties) { + if (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 DeleteOperationMetadata instance using the specified properties. + * @function create + * @memberof google.cloud.automl.v1beta1.DeleteOperationMetadata + * @static + * @param {google.cloud.automl.v1beta1.IDeleteOperationMetadata=} [properties] Properties to set + * @returns {google.cloud.automl.v1beta1.DeleteOperationMetadata} DeleteOperationMetadata instance + */ + DeleteOperationMetadata.create = function create(properties) { + return new DeleteOperationMetadata(properties); + }; + + /** + * Encodes the specified DeleteOperationMetadata message. Does not implicitly {@link google.cloud.automl.v1beta1.DeleteOperationMetadata.verify|verify} messages. + * @function encode + * @memberof google.cloud.automl.v1beta1.DeleteOperationMetadata + * @static + * @param {google.cloud.automl.v1beta1.IDeleteOperationMetadata} message DeleteOperationMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteOperationMetadata.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + return writer; + }; + + /** + * Encodes the specified DeleteOperationMetadata message, length delimited. Does not implicitly {@link google.cloud.automl.v1beta1.DeleteOperationMetadata.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.automl.v1beta1.DeleteOperationMetadata + * @static + * @param {google.cloud.automl.v1beta1.IDeleteOperationMetadata} message DeleteOperationMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteOperationMetadata.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DeleteOperationMetadata message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.automl.v1beta1.DeleteOperationMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.automl.v1beta1.DeleteOperationMetadata} DeleteOperationMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteOperationMetadata.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.automl.v1beta1.DeleteOperationMetadata(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DeleteOperationMetadata message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.automl.v1beta1.DeleteOperationMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.automl.v1beta1.DeleteOperationMetadata} DeleteOperationMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteOperationMetadata.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DeleteOperationMetadata message. + * @function verify + * @memberof google.cloud.automl.v1beta1.DeleteOperationMetadata + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DeleteOperationMetadata.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + return null; + }; + + /** + * Creates a DeleteOperationMetadata message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.automl.v1beta1.DeleteOperationMetadata + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.automl.v1beta1.DeleteOperationMetadata} DeleteOperationMetadata + */ + DeleteOperationMetadata.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.automl.v1beta1.DeleteOperationMetadata) + return object; + return new $root.google.cloud.automl.v1beta1.DeleteOperationMetadata(); + }; + + /** + * Creates a plain object from a DeleteOperationMetadata message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.automl.v1beta1.DeleteOperationMetadata + * @static + * @param {google.cloud.automl.v1beta1.DeleteOperationMetadata} message DeleteOperationMetadata + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DeleteOperationMetadata.toObject = function toObject() { + return {}; + }; + + /** + * Converts this DeleteOperationMetadata to JSON. + * @function toJSON + * @memberof google.cloud.automl.v1beta1.DeleteOperationMetadata + * @instance + * @returns {Object.} JSON object + */ + DeleteOperationMetadata.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DeleteOperationMetadata + * @function getTypeUrl + * @memberof google.cloud.automl.v1beta1.DeleteOperationMetadata + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DeleteOperationMetadata.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.automl.v1beta1.DeleteOperationMetadata"; + }; + + return DeleteOperationMetadata; + })(); + + v1beta1.DeployModelOperationMetadata = (function() { + + /** + * Properties of a DeployModelOperationMetadata. + * @memberof google.cloud.automl.v1beta1 + * @interface IDeployModelOperationMetadata + */ + + /** + * Constructs a new DeployModelOperationMetadata. + * @memberof google.cloud.automl.v1beta1 + * @classdesc Represents a DeployModelOperationMetadata. + * @implements IDeployModelOperationMetadata + * @constructor + * @param {google.cloud.automl.v1beta1.IDeployModelOperationMetadata=} [properties] Properties to set + */ + function DeployModelOperationMetadata(properties) { + if (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 DeployModelOperationMetadata instance using the specified properties. + * @function create + * @memberof google.cloud.automl.v1beta1.DeployModelOperationMetadata + * @static + * @param {google.cloud.automl.v1beta1.IDeployModelOperationMetadata=} [properties] Properties to set + * @returns {google.cloud.automl.v1beta1.DeployModelOperationMetadata} DeployModelOperationMetadata instance + */ + DeployModelOperationMetadata.create = function create(properties) { + return new DeployModelOperationMetadata(properties); + }; + + /** + * Encodes the specified DeployModelOperationMetadata message. Does not implicitly {@link google.cloud.automl.v1beta1.DeployModelOperationMetadata.verify|verify} messages. + * @function encode + * @memberof google.cloud.automl.v1beta1.DeployModelOperationMetadata + * @static + * @param {google.cloud.automl.v1beta1.IDeployModelOperationMetadata} message DeployModelOperationMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeployModelOperationMetadata.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + return writer; + }; + + /** + * Encodes the specified DeployModelOperationMetadata message, length delimited. Does not implicitly {@link google.cloud.automl.v1beta1.DeployModelOperationMetadata.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.automl.v1beta1.DeployModelOperationMetadata + * @static + * @param {google.cloud.automl.v1beta1.IDeployModelOperationMetadata} message DeployModelOperationMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeployModelOperationMetadata.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DeployModelOperationMetadata message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.automl.v1beta1.DeployModelOperationMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.automl.v1beta1.DeployModelOperationMetadata} DeployModelOperationMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeployModelOperationMetadata.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.automl.v1beta1.DeployModelOperationMetadata(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DeployModelOperationMetadata message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.automl.v1beta1.DeployModelOperationMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.automl.v1beta1.DeployModelOperationMetadata} DeployModelOperationMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeployModelOperationMetadata.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DeployModelOperationMetadata message. + * @function verify + * @memberof google.cloud.automl.v1beta1.DeployModelOperationMetadata + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DeployModelOperationMetadata.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + return null; + }; + + /** + * Creates a DeployModelOperationMetadata message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.automl.v1beta1.DeployModelOperationMetadata + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.automl.v1beta1.DeployModelOperationMetadata} DeployModelOperationMetadata + */ + DeployModelOperationMetadata.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.automl.v1beta1.DeployModelOperationMetadata) + return object; + return new $root.google.cloud.automl.v1beta1.DeployModelOperationMetadata(); + }; + + /** + * Creates a plain object from a DeployModelOperationMetadata message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.automl.v1beta1.DeployModelOperationMetadata + * @static + * @param {google.cloud.automl.v1beta1.DeployModelOperationMetadata} message DeployModelOperationMetadata + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DeployModelOperationMetadata.toObject = function toObject() { + return {}; + }; + + /** + * Converts this DeployModelOperationMetadata to JSON. + * @function toJSON + * @memberof google.cloud.automl.v1beta1.DeployModelOperationMetadata + * @instance + * @returns {Object.} JSON object + */ + DeployModelOperationMetadata.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DeployModelOperationMetadata + * @function getTypeUrl + * @memberof google.cloud.automl.v1beta1.DeployModelOperationMetadata + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DeployModelOperationMetadata.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.automl.v1beta1.DeployModelOperationMetadata"; + }; + + return DeployModelOperationMetadata; + })(); + + v1beta1.UndeployModelOperationMetadata = (function() { + + /** + * Properties of an UndeployModelOperationMetadata. + * @memberof google.cloud.automl.v1beta1 + * @interface IUndeployModelOperationMetadata + */ + + /** + * Constructs a new UndeployModelOperationMetadata. + * @memberof google.cloud.automl.v1beta1 + * @classdesc Represents an UndeployModelOperationMetadata. + * @implements IUndeployModelOperationMetadata + * @constructor + * @param {google.cloud.automl.v1beta1.IUndeployModelOperationMetadata=} [properties] Properties to set + */ + function UndeployModelOperationMetadata(properties) { + if (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 UndeployModelOperationMetadata instance using the specified properties. + * @function create + * @memberof google.cloud.automl.v1beta1.UndeployModelOperationMetadata + * @static + * @param {google.cloud.automl.v1beta1.IUndeployModelOperationMetadata=} [properties] Properties to set + * @returns {google.cloud.automl.v1beta1.UndeployModelOperationMetadata} UndeployModelOperationMetadata instance + */ + UndeployModelOperationMetadata.create = function create(properties) { + return new UndeployModelOperationMetadata(properties); + }; + + /** + * Encodes the specified UndeployModelOperationMetadata message. Does not implicitly {@link google.cloud.automl.v1beta1.UndeployModelOperationMetadata.verify|verify} messages. + * @function encode + * @memberof google.cloud.automl.v1beta1.UndeployModelOperationMetadata + * @static + * @param {google.cloud.automl.v1beta1.IUndeployModelOperationMetadata} message UndeployModelOperationMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UndeployModelOperationMetadata.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + return writer; + }; + + /** + * Encodes the specified UndeployModelOperationMetadata message, length delimited. Does not implicitly {@link google.cloud.automl.v1beta1.UndeployModelOperationMetadata.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.automl.v1beta1.UndeployModelOperationMetadata + * @static + * @param {google.cloud.automl.v1beta1.IUndeployModelOperationMetadata} message UndeployModelOperationMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UndeployModelOperationMetadata.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an UndeployModelOperationMetadata message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.automl.v1beta1.UndeployModelOperationMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.automl.v1beta1.UndeployModelOperationMetadata} UndeployModelOperationMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UndeployModelOperationMetadata.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.automl.v1beta1.UndeployModelOperationMetadata(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an UndeployModelOperationMetadata message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.automl.v1beta1.UndeployModelOperationMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.automl.v1beta1.UndeployModelOperationMetadata} UndeployModelOperationMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UndeployModelOperationMetadata.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an UndeployModelOperationMetadata message. + * @function verify + * @memberof google.cloud.automl.v1beta1.UndeployModelOperationMetadata + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + UndeployModelOperationMetadata.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + return null; + }; + + /** + * Creates an UndeployModelOperationMetadata message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.automl.v1beta1.UndeployModelOperationMetadata + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.automl.v1beta1.UndeployModelOperationMetadata} UndeployModelOperationMetadata + */ + UndeployModelOperationMetadata.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.automl.v1beta1.UndeployModelOperationMetadata) + return object; + return new $root.google.cloud.automl.v1beta1.UndeployModelOperationMetadata(); + }; + + /** + * Creates a plain object from an UndeployModelOperationMetadata message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.automl.v1beta1.UndeployModelOperationMetadata + * @static + * @param {google.cloud.automl.v1beta1.UndeployModelOperationMetadata} message UndeployModelOperationMetadata + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + UndeployModelOperationMetadata.toObject = function toObject() { + return {}; + }; + + /** + * Converts this UndeployModelOperationMetadata to JSON. + * @function toJSON + * @memberof google.cloud.automl.v1beta1.UndeployModelOperationMetadata + * @instance + * @returns {Object.} JSON object + */ + UndeployModelOperationMetadata.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for UndeployModelOperationMetadata + * @function getTypeUrl + * @memberof google.cloud.automl.v1beta1.UndeployModelOperationMetadata + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + UndeployModelOperationMetadata.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.automl.v1beta1.UndeployModelOperationMetadata"; + }; + + return UndeployModelOperationMetadata; + })(); + + v1beta1.CreateModelOperationMetadata = (function() { + + /** + * Properties of a CreateModelOperationMetadata. + * @memberof google.cloud.automl.v1beta1 + * @interface ICreateModelOperationMetadata + */ + + /** + * Constructs a new CreateModelOperationMetadata. + * @memberof google.cloud.automl.v1beta1 + * @classdesc Represents a CreateModelOperationMetadata. + * @implements ICreateModelOperationMetadata + * @constructor + * @param {google.cloud.automl.v1beta1.ICreateModelOperationMetadata=} [properties] Properties to set + */ + function CreateModelOperationMetadata(properties) { + if (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 CreateModelOperationMetadata instance using the specified properties. + * @function create + * @memberof google.cloud.automl.v1beta1.CreateModelOperationMetadata + * @static + * @param {google.cloud.automl.v1beta1.ICreateModelOperationMetadata=} [properties] Properties to set + * @returns {google.cloud.automl.v1beta1.CreateModelOperationMetadata} CreateModelOperationMetadata instance + */ + CreateModelOperationMetadata.create = function create(properties) { + return new CreateModelOperationMetadata(properties); + }; + + /** + * Encodes the specified CreateModelOperationMetadata message. Does not implicitly {@link google.cloud.automl.v1beta1.CreateModelOperationMetadata.verify|verify} messages. + * @function encode + * @memberof google.cloud.automl.v1beta1.CreateModelOperationMetadata + * @static + * @param {google.cloud.automl.v1beta1.ICreateModelOperationMetadata} message CreateModelOperationMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateModelOperationMetadata.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + return writer; + }; + + /** + * Encodes the specified CreateModelOperationMetadata message, length delimited. Does not implicitly {@link google.cloud.automl.v1beta1.CreateModelOperationMetadata.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.automl.v1beta1.CreateModelOperationMetadata + * @static + * @param {google.cloud.automl.v1beta1.ICreateModelOperationMetadata} message CreateModelOperationMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateModelOperationMetadata.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CreateModelOperationMetadata message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.automl.v1beta1.CreateModelOperationMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.automl.v1beta1.CreateModelOperationMetadata} CreateModelOperationMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateModelOperationMetadata.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.automl.v1beta1.CreateModelOperationMetadata(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CreateModelOperationMetadata message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.automl.v1beta1.CreateModelOperationMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.automl.v1beta1.CreateModelOperationMetadata} CreateModelOperationMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateModelOperationMetadata.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CreateModelOperationMetadata message. + * @function verify + * @memberof google.cloud.automl.v1beta1.CreateModelOperationMetadata + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CreateModelOperationMetadata.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + return null; + }; + + /** + * Creates a CreateModelOperationMetadata message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.automl.v1beta1.CreateModelOperationMetadata + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.automl.v1beta1.CreateModelOperationMetadata} CreateModelOperationMetadata + */ + CreateModelOperationMetadata.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.automl.v1beta1.CreateModelOperationMetadata) + return object; + return new $root.google.cloud.automl.v1beta1.CreateModelOperationMetadata(); + }; + + /** + * Creates a plain object from a CreateModelOperationMetadata message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.automl.v1beta1.CreateModelOperationMetadata + * @static + * @param {google.cloud.automl.v1beta1.CreateModelOperationMetadata} message CreateModelOperationMetadata + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CreateModelOperationMetadata.toObject = function toObject() { + return {}; + }; + + /** + * Converts this CreateModelOperationMetadata to JSON. + * @function toJSON + * @memberof google.cloud.automl.v1beta1.CreateModelOperationMetadata + * @instance + * @returns {Object.} JSON object + */ + CreateModelOperationMetadata.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CreateModelOperationMetadata + * @function getTypeUrl + * @memberof google.cloud.automl.v1beta1.CreateModelOperationMetadata + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CreateModelOperationMetadata.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.automl.v1beta1.CreateModelOperationMetadata"; + }; + + return CreateModelOperationMetadata; + })(); + + v1beta1.ImportDataOperationMetadata = (function() { + + /** + * Properties of an ImportDataOperationMetadata. + * @memberof google.cloud.automl.v1beta1 + * @interface IImportDataOperationMetadata + */ + + /** + * Constructs a new ImportDataOperationMetadata. + * @memberof google.cloud.automl.v1beta1 + * @classdesc Represents an ImportDataOperationMetadata. + * @implements IImportDataOperationMetadata + * @constructor + * @param {google.cloud.automl.v1beta1.IImportDataOperationMetadata=} [properties] Properties to set + */ + function ImportDataOperationMetadata(properties) { + if (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 ImportDataOperationMetadata instance using the specified properties. + * @function create + * @memberof google.cloud.automl.v1beta1.ImportDataOperationMetadata + * @static + * @param {google.cloud.automl.v1beta1.IImportDataOperationMetadata=} [properties] Properties to set + * @returns {google.cloud.automl.v1beta1.ImportDataOperationMetadata} ImportDataOperationMetadata instance + */ + ImportDataOperationMetadata.create = function create(properties) { + return new ImportDataOperationMetadata(properties); + }; + + /** + * Encodes the specified ImportDataOperationMetadata message. Does not implicitly {@link google.cloud.automl.v1beta1.ImportDataOperationMetadata.verify|verify} messages. + * @function encode + * @memberof google.cloud.automl.v1beta1.ImportDataOperationMetadata + * @static + * @param {google.cloud.automl.v1beta1.IImportDataOperationMetadata} message ImportDataOperationMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ImportDataOperationMetadata.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + return writer; + }; + + /** + * Encodes the specified ImportDataOperationMetadata message, length delimited. Does not implicitly {@link google.cloud.automl.v1beta1.ImportDataOperationMetadata.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.automl.v1beta1.ImportDataOperationMetadata + * @static + * @param {google.cloud.automl.v1beta1.IImportDataOperationMetadata} message ImportDataOperationMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ImportDataOperationMetadata.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an ImportDataOperationMetadata message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.automl.v1beta1.ImportDataOperationMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.automl.v1beta1.ImportDataOperationMetadata} ImportDataOperationMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ImportDataOperationMetadata.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.automl.v1beta1.ImportDataOperationMetadata(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an ImportDataOperationMetadata message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.automl.v1beta1.ImportDataOperationMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.automl.v1beta1.ImportDataOperationMetadata} ImportDataOperationMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ImportDataOperationMetadata.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an ImportDataOperationMetadata message. + * @function verify + * @memberof google.cloud.automl.v1beta1.ImportDataOperationMetadata + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ImportDataOperationMetadata.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + return null; + }; + + /** + * Creates an ImportDataOperationMetadata message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.automl.v1beta1.ImportDataOperationMetadata + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.automl.v1beta1.ImportDataOperationMetadata} ImportDataOperationMetadata + */ + ImportDataOperationMetadata.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.automl.v1beta1.ImportDataOperationMetadata) + return object; + return new $root.google.cloud.automl.v1beta1.ImportDataOperationMetadata(); + }; + + /** + * Creates a plain object from an ImportDataOperationMetadata message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.automl.v1beta1.ImportDataOperationMetadata + * @static + * @param {google.cloud.automl.v1beta1.ImportDataOperationMetadata} message ImportDataOperationMetadata + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ImportDataOperationMetadata.toObject = function toObject() { + return {}; + }; + + /** + * Converts this ImportDataOperationMetadata to JSON. + * @function toJSON + * @memberof google.cloud.automl.v1beta1.ImportDataOperationMetadata + * @instance + * @returns {Object.} JSON object + */ + ImportDataOperationMetadata.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ImportDataOperationMetadata + * @function getTypeUrl + * @memberof google.cloud.automl.v1beta1.ImportDataOperationMetadata + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ImportDataOperationMetadata.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.automl.v1beta1.ImportDataOperationMetadata"; + }; + + return ImportDataOperationMetadata; + })(); + + v1beta1.ExportDataOperationMetadata = (function() { + + /** + * Properties of an ExportDataOperationMetadata. + * @memberof google.cloud.automl.v1beta1 + * @interface IExportDataOperationMetadata + * @property {google.cloud.automl.v1beta1.ExportDataOperationMetadata.IExportDataOutputInfo|null} [outputInfo] ExportDataOperationMetadata outputInfo + */ + + /** + * Constructs a new ExportDataOperationMetadata. + * @memberof google.cloud.automl.v1beta1 + * @classdesc Represents an ExportDataOperationMetadata. + * @implements IExportDataOperationMetadata + * @constructor + * @param {google.cloud.automl.v1beta1.IExportDataOperationMetadata=} [properties] Properties to set + */ + function ExportDataOperationMetadata(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ExportDataOperationMetadata outputInfo. + * @member {google.cloud.automl.v1beta1.ExportDataOperationMetadata.IExportDataOutputInfo|null|undefined} outputInfo + * @memberof google.cloud.automl.v1beta1.ExportDataOperationMetadata + * @instance + */ + ExportDataOperationMetadata.prototype.outputInfo = null; + + /** + * Creates a new ExportDataOperationMetadata instance using the specified properties. + * @function create + * @memberof google.cloud.automl.v1beta1.ExportDataOperationMetadata + * @static + * @param {google.cloud.automl.v1beta1.IExportDataOperationMetadata=} [properties] Properties to set + * @returns {google.cloud.automl.v1beta1.ExportDataOperationMetadata} ExportDataOperationMetadata instance + */ + ExportDataOperationMetadata.create = function create(properties) { + return new ExportDataOperationMetadata(properties); + }; + + /** + * Encodes the specified ExportDataOperationMetadata message. Does not implicitly {@link google.cloud.automl.v1beta1.ExportDataOperationMetadata.verify|verify} messages. + * @function encode + * @memberof google.cloud.automl.v1beta1.ExportDataOperationMetadata + * @static + * @param {google.cloud.automl.v1beta1.IExportDataOperationMetadata} message ExportDataOperationMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ExportDataOperationMetadata.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.outputInfo != null && Object.hasOwnProperty.call(message, "outputInfo")) + $root.google.cloud.automl.v1beta1.ExportDataOperationMetadata.ExportDataOutputInfo.encode(message.outputInfo, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified ExportDataOperationMetadata message, length delimited. Does not implicitly {@link google.cloud.automl.v1beta1.ExportDataOperationMetadata.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.automl.v1beta1.ExportDataOperationMetadata + * @static + * @param {google.cloud.automl.v1beta1.IExportDataOperationMetadata} message ExportDataOperationMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ExportDataOperationMetadata.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an ExportDataOperationMetadata message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.automl.v1beta1.ExportDataOperationMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.automl.v1beta1.ExportDataOperationMetadata} ExportDataOperationMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ExportDataOperationMetadata.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.automl.v1beta1.ExportDataOperationMetadata(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.outputInfo = $root.google.cloud.automl.v1beta1.ExportDataOperationMetadata.ExportDataOutputInfo.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an ExportDataOperationMetadata message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.automl.v1beta1.ExportDataOperationMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.automl.v1beta1.ExportDataOperationMetadata} ExportDataOperationMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ExportDataOperationMetadata.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an ExportDataOperationMetadata message. + * @function verify + * @memberof google.cloud.automl.v1beta1.ExportDataOperationMetadata + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ExportDataOperationMetadata.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.outputInfo != null && message.hasOwnProperty("outputInfo")) { + var error = $root.google.cloud.automl.v1beta1.ExportDataOperationMetadata.ExportDataOutputInfo.verify(message.outputInfo); + if (error) + return "outputInfo." + error; + } + return null; + }; + + /** + * Creates an ExportDataOperationMetadata message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.automl.v1beta1.ExportDataOperationMetadata + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.automl.v1beta1.ExportDataOperationMetadata} ExportDataOperationMetadata + */ + ExportDataOperationMetadata.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.automl.v1beta1.ExportDataOperationMetadata) + return object; + var message = new $root.google.cloud.automl.v1beta1.ExportDataOperationMetadata(); + if (object.outputInfo != null) { + if (typeof object.outputInfo !== "object") + throw TypeError(".google.cloud.automl.v1beta1.ExportDataOperationMetadata.outputInfo: object expected"); + message.outputInfo = $root.google.cloud.automl.v1beta1.ExportDataOperationMetadata.ExportDataOutputInfo.fromObject(object.outputInfo); + } + return message; + }; + + /** + * Creates a plain object from an ExportDataOperationMetadata message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.automl.v1beta1.ExportDataOperationMetadata + * @static + * @param {google.cloud.automl.v1beta1.ExportDataOperationMetadata} message ExportDataOperationMetadata + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ExportDataOperationMetadata.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.outputInfo = null; + if (message.outputInfo != null && message.hasOwnProperty("outputInfo")) + object.outputInfo = $root.google.cloud.automl.v1beta1.ExportDataOperationMetadata.ExportDataOutputInfo.toObject(message.outputInfo, options); + return object; + }; + + /** + * Converts this ExportDataOperationMetadata to JSON. + * @function toJSON + * @memberof google.cloud.automl.v1beta1.ExportDataOperationMetadata + * @instance + * @returns {Object.} JSON object + */ + ExportDataOperationMetadata.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ExportDataOperationMetadata + * @function getTypeUrl + * @memberof google.cloud.automl.v1beta1.ExportDataOperationMetadata + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ExportDataOperationMetadata.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.automl.v1beta1.ExportDataOperationMetadata"; + }; + + ExportDataOperationMetadata.ExportDataOutputInfo = (function() { + + /** + * Properties of an ExportDataOutputInfo. + * @memberof google.cloud.automl.v1beta1.ExportDataOperationMetadata + * @interface IExportDataOutputInfo + * @property {string|null} [gcsOutputDirectory] ExportDataOutputInfo gcsOutputDirectory + * @property {string|null} [bigqueryOutputDataset] ExportDataOutputInfo bigqueryOutputDataset + */ + + /** + * Constructs a new ExportDataOutputInfo. + * @memberof google.cloud.automl.v1beta1.ExportDataOperationMetadata + * @classdesc Represents an ExportDataOutputInfo. + * @implements IExportDataOutputInfo + * @constructor + * @param {google.cloud.automl.v1beta1.ExportDataOperationMetadata.IExportDataOutputInfo=} [properties] Properties to set + */ + function ExportDataOutputInfo(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ExportDataOutputInfo gcsOutputDirectory. + * @member {string|null|undefined} gcsOutputDirectory + * @memberof google.cloud.automl.v1beta1.ExportDataOperationMetadata.ExportDataOutputInfo + * @instance + */ + ExportDataOutputInfo.prototype.gcsOutputDirectory = null; + + /** + * ExportDataOutputInfo bigqueryOutputDataset. + * @member {string|null|undefined} bigqueryOutputDataset + * @memberof google.cloud.automl.v1beta1.ExportDataOperationMetadata.ExportDataOutputInfo + * @instance + */ + ExportDataOutputInfo.prototype.bigqueryOutputDataset = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * ExportDataOutputInfo outputLocation. + * @member {"gcsOutputDirectory"|"bigqueryOutputDataset"|undefined} outputLocation + * @memberof google.cloud.automl.v1beta1.ExportDataOperationMetadata.ExportDataOutputInfo + * @instance + */ + Object.defineProperty(ExportDataOutputInfo.prototype, "outputLocation", { + get: $util.oneOfGetter($oneOfFields = ["gcsOutputDirectory", "bigqueryOutputDataset"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new ExportDataOutputInfo instance using the specified properties. + * @function create + * @memberof google.cloud.automl.v1beta1.ExportDataOperationMetadata.ExportDataOutputInfo + * @static + * @param {google.cloud.automl.v1beta1.ExportDataOperationMetadata.IExportDataOutputInfo=} [properties] Properties to set + * @returns {google.cloud.automl.v1beta1.ExportDataOperationMetadata.ExportDataOutputInfo} ExportDataOutputInfo instance + */ + ExportDataOutputInfo.create = function create(properties) { + return new ExportDataOutputInfo(properties); + }; + + /** + * Encodes the specified ExportDataOutputInfo message. Does not implicitly {@link google.cloud.automl.v1beta1.ExportDataOperationMetadata.ExportDataOutputInfo.verify|verify} messages. + * @function encode + * @memberof google.cloud.automl.v1beta1.ExportDataOperationMetadata.ExportDataOutputInfo + * @static + * @param {google.cloud.automl.v1beta1.ExportDataOperationMetadata.IExportDataOutputInfo} message ExportDataOutputInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ExportDataOutputInfo.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.gcsOutputDirectory != null && Object.hasOwnProperty.call(message, "gcsOutputDirectory")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.gcsOutputDirectory); + if (message.bigqueryOutputDataset != null && Object.hasOwnProperty.call(message, "bigqueryOutputDataset")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.bigqueryOutputDataset); + return writer; + }; + + /** + * Encodes the specified ExportDataOutputInfo message, length delimited. Does not implicitly {@link google.cloud.automl.v1beta1.ExportDataOperationMetadata.ExportDataOutputInfo.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.automl.v1beta1.ExportDataOperationMetadata.ExportDataOutputInfo + * @static + * @param {google.cloud.automl.v1beta1.ExportDataOperationMetadata.IExportDataOutputInfo} message ExportDataOutputInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ExportDataOutputInfo.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an ExportDataOutputInfo message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.automl.v1beta1.ExportDataOperationMetadata.ExportDataOutputInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.automl.v1beta1.ExportDataOperationMetadata.ExportDataOutputInfo} ExportDataOutputInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ExportDataOutputInfo.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.automl.v1beta1.ExportDataOperationMetadata.ExportDataOutputInfo(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.gcsOutputDirectory = reader.string(); + break; + } + case 2: { + message.bigqueryOutputDataset = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an ExportDataOutputInfo message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.automl.v1beta1.ExportDataOperationMetadata.ExportDataOutputInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.automl.v1beta1.ExportDataOperationMetadata.ExportDataOutputInfo} ExportDataOutputInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ExportDataOutputInfo.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an ExportDataOutputInfo message. + * @function verify + * @memberof google.cloud.automl.v1beta1.ExportDataOperationMetadata.ExportDataOutputInfo + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ExportDataOutputInfo.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.gcsOutputDirectory != null && message.hasOwnProperty("gcsOutputDirectory")) { + properties.outputLocation = 1; + if (!$util.isString(message.gcsOutputDirectory)) + return "gcsOutputDirectory: string expected"; + } + if (message.bigqueryOutputDataset != null && message.hasOwnProperty("bigqueryOutputDataset")) { + if (properties.outputLocation === 1) + return "outputLocation: multiple values"; + properties.outputLocation = 1; + if (!$util.isString(message.bigqueryOutputDataset)) + return "bigqueryOutputDataset: string expected"; + } + return null; + }; + + /** + * Creates an ExportDataOutputInfo message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.automl.v1beta1.ExportDataOperationMetadata.ExportDataOutputInfo + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.automl.v1beta1.ExportDataOperationMetadata.ExportDataOutputInfo} ExportDataOutputInfo + */ + ExportDataOutputInfo.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.automl.v1beta1.ExportDataOperationMetadata.ExportDataOutputInfo) + return object; + var message = new $root.google.cloud.automl.v1beta1.ExportDataOperationMetadata.ExportDataOutputInfo(); + if (object.gcsOutputDirectory != null) + message.gcsOutputDirectory = String(object.gcsOutputDirectory); + if (object.bigqueryOutputDataset != null) + message.bigqueryOutputDataset = String(object.bigqueryOutputDataset); + return message; + }; + + /** + * Creates a plain object from an ExportDataOutputInfo message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.automl.v1beta1.ExportDataOperationMetadata.ExportDataOutputInfo + * @static + * @param {google.cloud.automl.v1beta1.ExportDataOperationMetadata.ExportDataOutputInfo} message ExportDataOutputInfo + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ExportDataOutputInfo.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.gcsOutputDirectory != null && message.hasOwnProperty("gcsOutputDirectory")) { + object.gcsOutputDirectory = message.gcsOutputDirectory; + if (options.oneofs) + object.outputLocation = "gcsOutputDirectory"; + } + if (message.bigqueryOutputDataset != null && message.hasOwnProperty("bigqueryOutputDataset")) { + object.bigqueryOutputDataset = message.bigqueryOutputDataset; + if (options.oneofs) + object.outputLocation = "bigqueryOutputDataset"; + } + return object; + }; + + /** + * Converts this ExportDataOutputInfo to JSON. + * @function toJSON + * @memberof google.cloud.automl.v1beta1.ExportDataOperationMetadata.ExportDataOutputInfo + * @instance + * @returns {Object.} JSON object + */ + ExportDataOutputInfo.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ExportDataOutputInfo + * @function getTypeUrl + * @memberof google.cloud.automl.v1beta1.ExportDataOperationMetadata.ExportDataOutputInfo + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ExportDataOutputInfo.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.automl.v1beta1.ExportDataOperationMetadata.ExportDataOutputInfo"; + }; + + return ExportDataOutputInfo; + })(); + + return ExportDataOperationMetadata; + })(); + + v1beta1.BatchPredictOperationMetadata = (function() { + + /** + * Properties of a BatchPredictOperationMetadata. + * @memberof google.cloud.automl.v1beta1 + * @interface IBatchPredictOperationMetadata + * @property {google.cloud.automl.v1beta1.IBatchPredictInputConfig|null} [inputConfig] BatchPredictOperationMetadata inputConfig + * @property {google.cloud.automl.v1beta1.BatchPredictOperationMetadata.IBatchPredictOutputInfo|null} [outputInfo] BatchPredictOperationMetadata outputInfo + */ + + /** + * Constructs a new BatchPredictOperationMetadata. + * @memberof google.cloud.automl.v1beta1 + * @classdesc Represents a BatchPredictOperationMetadata. + * @implements IBatchPredictOperationMetadata + * @constructor + * @param {google.cloud.automl.v1beta1.IBatchPredictOperationMetadata=} [properties] Properties to set + */ + function BatchPredictOperationMetadata(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * BatchPredictOperationMetadata inputConfig. + * @member {google.cloud.automl.v1beta1.IBatchPredictInputConfig|null|undefined} inputConfig + * @memberof google.cloud.automl.v1beta1.BatchPredictOperationMetadata + * @instance + */ + BatchPredictOperationMetadata.prototype.inputConfig = null; + + /** + * BatchPredictOperationMetadata outputInfo. + * @member {google.cloud.automl.v1beta1.BatchPredictOperationMetadata.IBatchPredictOutputInfo|null|undefined} outputInfo + * @memberof google.cloud.automl.v1beta1.BatchPredictOperationMetadata + * @instance + */ + BatchPredictOperationMetadata.prototype.outputInfo = null; + + /** + * Creates a new BatchPredictOperationMetadata instance using the specified properties. + * @function create + * @memberof google.cloud.automl.v1beta1.BatchPredictOperationMetadata + * @static + * @param {google.cloud.automl.v1beta1.IBatchPredictOperationMetadata=} [properties] Properties to set + * @returns {google.cloud.automl.v1beta1.BatchPredictOperationMetadata} BatchPredictOperationMetadata instance + */ + BatchPredictOperationMetadata.create = function create(properties) { + return new BatchPredictOperationMetadata(properties); + }; + + /** + * Encodes the specified BatchPredictOperationMetadata message. Does not implicitly {@link google.cloud.automl.v1beta1.BatchPredictOperationMetadata.verify|verify} messages. + * @function encode + * @memberof google.cloud.automl.v1beta1.BatchPredictOperationMetadata + * @static + * @param {google.cloud.automl.v1beta1.IBatchPredictOperationMetadata} message BatchPredictOperationMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BatchPredictOperationMetadata.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.inputConfig != null && Object.hasOwnProperty.call(message, "inputConfig")) + $root.google.cloud.automl.v1beta1.BatchPredictInputConfig.encode(message.inputConfig, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.outputInfo != null && Object.hasOwnProperty.call(message, "outputInfo")) + $root.google.cloud.automl.v1beta1.BatchPredictOperationMetadata.BatchPredictOutputInfo.encode(message.outputInfo, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified BatchPredictOperationMetadata message, length delimited. Does not implicitly {@link google.cloud.automl.v1beta1.BatchPredictOperationMetadata.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.automl.v1beta1.BatchPredictOperationMetadata + * @static + * @param {google.cloud.automl.v1beta1.IBatchPredictOperationMetadata} message BatchPredictOperationMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BatchPredictOperationMetadata.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a BatchPredictOperationMetadata message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.automl.v1beta1.BatchPredictOperationMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.automl.v1beta1.BatchPredictOperationMetadata} BatchPredictOperationMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BatchPredictOperationMetadata.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.automl.v1beta1.BatchPredictOperationMetadata(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.inputConfig = $root.google.cloud.automl.v1beta1.BatchPredictInputConfig.decode(reader, reader.uint32()); + break; + } + case 2: { + message.outputInfo = $root.google.cloud.automl.v1beta1.BatchPredictOperationMetadata.BatchPredictOutputInfo.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a BatchPredictOperationMetadata message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.automl.v1beta1.BatchPredictOperationMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.automl.v1beta1.BatchPredictOperationMetadata} BatchPredictOperationMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BatchPredictOperationMetadata.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a BatchPredictOperationMetadata message. + * @function verify + * @memberof google.cloud.automl.v1beta1.BatchPredictOperationMetadata + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + BatchPredictOperationMetadata.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.inputConfig != null && message.hasOwnProperty("inputConfig")) { + var error = $root.google.cloud.automl.v1beta1.BatchPredictInputConfig.verify(message.inputConfig); + if (error) + return "inputConfig." + error; + } + if (message.outputInfo != null && message.hasOwnProperty("outputInfo")) { + var error = $root.google.cloud.automl.v1beta1.BatchPredictOperationMetadata.BatchPredictOutputInfo.verify(message.outputInfo); + if (error) + return "outputInfo." + error; + } + return null; + }; + + /** + * Creates a BatchPredictOperationMetadata message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.automl.v1beta1.BatchPredictOperationMetadata + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.automl.v1beta1.BatchPredictOperationMetadata} BatchPredictOperationMetadata + */ + BatchPredictOperationMetadata.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.automl.v1beta1.BatchPredictOperationMetadata) + return object; + var message = new $root.google.cloud.automl.v1beta1.BatchPredictOperationMetadata(); + if (object.inputConfig != null) { + if (typeof object.inputConfig !== "object") + throw TypeError(".google.cloud.automl.v1beta1.BatchPredictOperationMetadata.inputConfig: object expected"); + message.inputConfig = $root.google.cloud.automl.v1beta1.BatchPredictInputConfig.fromObject(object.inputConfig); + } + if (object.outputInfo != null) { + if (typeof object.outputInfo !== "object") + throw TypeError(".google.cloud.automl.v1beta1.BatchPredictOperationMetadata.outputInfo: object expected"); + message.outputInfo = $root.google.cloud.automl.v1beta1.BatchPredictOperationMetadata.BatchPredictOutputInfo.fromObject(object.outputInfo); + } + return message; + }; + + /** + * Creates a plain object from a BatchPredictOperationMetadata message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.automl.v1beta1.BatchPredictOperationMetadata + * @static + * @param {google.cloud.automl.v1beta1.BatchPredictOperationMetadata} message BatchPredictOperationMetadata + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + BatchPredictOperationMetadata.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.inputConfig = null; + object.outputInfo = null; + } + if (message.inputConfig != null && message.hasOwnProperty("inputConfig")) + object.inputConfig = $root.google.cloud.automl.v1beta1.BatchPredictInputConfig.toObject(message.inputConfig, options); + if (message.outputInfo != null && message.hasOwnProperty("outputInfo")) + object.outputInfo = $root.google.cloud.automl.v1beta1.BatchPredictOperationMetadata.BatchPredictOutputInfo.toObject(message.outputInfo, options); + return object; + }; + + /** + * Converts this BatchPredictOperationMetadata to JSON. + * @function toJSON + * @memberof google.cloud.automl.v1beta1.BatchPredictOperationMetadata + * @instance + * @returns {Object.} JSON object + */ + BatchPredictOperationMetadata.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for BatchPredictOperationMetadata + * @function getTypeUrl + * @memberof google.cloud.automl.v1beta1.BatchPredictOperationMetadata + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + BatchPredictOperationMetadata.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.automl.v1beta1.BatchPredictOperationMetadata"; + }; + + BatchPredictOperationMetadata.BatchPredictOutputInfo = (function() { + + /** + * Properties of a BatchPredictOutputInfo. + * @memberof google.cloud.automl.v1beta1.BatchPredictOperationMetadata + * @interface IBatchPredictOutputInfo + * @property {string|null} [gcsOutputDirectory] BatchPredictOutputInfo gcsOutputDirectory + * @property {string|null} [bigqueryOutputDataset] BatchPredictOutputInfo bigqueryOutputDataset + */ + + /** + * Constructs a new BatchPredictOutputInfo. + * @memberof google.cloud.automl.v1beta1.BatchPredictOperationMetadata + * @classdesc Represents a BatchPredictOutputInfo. + * @implements IBatchPredictOutputInfo + * @constructor + * @param {google.cloud.automl.v1beta1.BatchPredictOperationMetadata.IBatchPredictOutputInfo=} [properties] Properties to set + */ + function BatchPredictOutputInfo(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * BatchPredictOutputInfo gcsOutputDirectory. + * @member {string|null|undefined} gcsOutputDirectory + * @memberof google.cloud.automl.v1beta1.BatchPredictOperationMetadata.BatchPredictOutputInfo + * @instance + */ + BatchPredictOutputInfo.prototype.gcsOutputDirectory = null; + + /** + * BatchPredictOutputInfo bigqueryOutputDataset. + * @member {string|null|undefined} bigqueryOutputDataset + * @memberof google.cloud.automl.v1beta1.BatchPredictOperationMetadata.BatchPredictOutputInfo + * @instance + */ + BatchPredictOutputInfo.prototype.bigqueryOutputDataset = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * BatchPredictOutputInfo outputLocation. + * @member {"gcsOutputDirectory"|"bigqueryOutputDataset"|undefined} outputLocation + * @memberof google.cloud.automl.v1beta1.BatchPredictOperationMetadata.BatchPredictOutputInfo + * @instance + */ + Object.defineProperty(BatchPredictOutputInfo.prototype, "outputLocation", { + get: $util.oneOfGetter($oneOfFields = ["gcsOutputDirectory", "bigqueryOutputDataset"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new BatchPredictOutputInfo instance using the specified properties. + * @function create + * @memberof google.cloud.automl.v1beta1.BatchPredictOperationMetadata.BatchPredictOutputInfo + * @static + * @param {google.cloud.automl.v1beta1.BatchPredictOperationMetadata.IBatchPredictOutputInfo=} [properties] Properties to set + * @returns {google.cloud.automl.v1beta1.BatchPredictOperationMetadata.BatchPredictOutputInfo} BatchPredictOutputInfo instance + */ + BatchPredictOutputInfo.create = function create(properties) { + return new BatchPredictOutputInfo(properties); + }; + + /** + * Encodes the specified BatchPredictOutputInfo message. Does not implicitly {@link google.cloud.automl.v1beta1.BatchPredictOperationMetadata.BatchPredictOutputInfo.verify|verify} messages. + * @function encode + * @memberof google.cloud.automl.v1beta1.BatchPredictOperationMetadata.BatchPredictOutputInfo + * @static + * @param {google.cloud.automl.v1beta1.BatchPredictOperationMetadata.IBatchPredictOutputInfo} message BatchPredictOutputInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BatchPredictOutputInfo.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.gcsOutputDirectory != null && Object.hasOwnProperty.call(message, "gcsOutputDirectory")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.gcsOutputDirectory); + if (message.bigqueryOutputDataset != null && Object.hasOwnProperty.call(message, "bigqueryOutputDataset")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.bigqueryOutputDataset); + return writer; + }; + + /** + * Encodes the specified BatchPredictOutputInfo message, length delimited. Does not implicitly {@link google.cloud.automl.v1beta1.BatchPredictOperationMetadata.BatchPredictOutputInfo.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.automl.v1beta1.BatchPredictOperationMetadata.BatchPredictOutputInfo + * @static + * @param {google.cloud.automl.v1beta1.BatchPredictOperationMetadata.IBatchPredictOutputInfo} message BatchPredictOutputInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BatchPredictOutputInfo.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a BatchPredictOutputInfo message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.automl.v1beta1.BatchPredictOperationMetadata.BatchPredictOutputInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.automl.v1beta1.BatchPredictOperationMetadata.BatchPredictOutputInfo} BatchPredictOutputInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BatchPredictOutputInfo.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.automl.v1beta1.BatchPredictOperationMetadata.BatchPredictOutputInfo(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.gcsOutputDirectory = reader.string(); + break; + } + case 2: { + message.bigqueryOutputDataset = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a BatchPredictOutputInfo message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.automl.v1beta1.BatchPredictOperationMetadata.BatchPredictOutputInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.automl.v1beta1.BatchPredictOperationMetadata.BatchPredictOutputInfo} BatchPredictOutputInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BatchPredictOutputInfo.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a BatchPredictOutputInfo message. + * @function verify + * @memberof google.cloud.automl.v1beta1.BatchPredictOperationMetadata.BatchPredictOutputInfo + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + BatchPredictOutputInfo.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.gcsOutputDirectory != null && message.hasOwnProperty("gcsOutputDirectory")) { + properties.outputLocation = 1; + if (!$util.isString(message.gcsOutputDirectory)) + return "gcsOutputDirectory: string expected"; + } + if (message.bigqueryOutputDataset != null && message.hasOwnProperty("bigqueryOutputDataset")) { + if (properties.outputLocation === 1) + return "outputLocation: multiple values"; + properties.outputLocation = 1; + if (!$util.isString(message.bigqueryOutputDataset)) + return "bigqueryOutputDataset: string expected"; + } + return null; + }; + + /** + * Creates a BatchPredictOutputInfo message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.automl.v1beta1.BatchPredictOperationMetadata.BatchPredictOutputInfo + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.automl.v1beta1.BatchPredictOperationMetadata.BatchPredictOutputInfo} BatchPredictOutputInfo + */ + BatchPredictOutputInfo.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.automl.v1beta1.BatchPredictOperationMetadata.BatchPredictOutputInfo) + return object; + var message = new $root.google.cloud.automl.v1beta1.BatchPredictOperationMetadata.BatchPredictOutputInfo(); + if (object.gcsOutputDirectory != null) + message.gcsOutputDirectory = String(object.gcsOutputDirectory); + if (object.bigqueryOutputDataset != null) + message.bigqueryOutputDataset = String(object.bigqueryOutputDataset); + return message; + }; + + /** + * Creates a plain object from a BatchPredictOutputInfo message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.automl.v1beta1.BatchPredictOperationMetadata.BatchPredictOutputInfo + * @static + * @param {google.cloud.automl.v1beta1.BatchPredictOperationMetadata.BatchPredictOutputInfo} message BatchPredictOutputInfo + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + BatchPredictOutputInfo.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.gcsOutputDirectory != null && message.hasOwnProperty("gcsOutputDirectory")) { + object.gcsOutputDirectory = message.gcsOutputDirectory; + if (options.oneofs) + object.outputLocation = "gcsOutputDirectory"; + } + if (message.bigqueryOutputDataset != null && message.hasOwnProperty("bigqueryOutputDataset")) { + object.bigqueryOutputDataset = message.bigqueryOutputDataset; + if (options.oneofs) + object.outputLocation = "bigqueryOutputDataset"; + } + return object; + }; + + /** + * Converts this BatchPredictOutputInfo to JSON. + * @function toJSON + * @memberof google.cloud.automl.v1beta1.BatchPredictOperationMetadata.BatchPredictOutputInfo + * @instance + * @returns {Object.} JSON object + */ + BatchPredictOutputInfo.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for BatchPredictOutputInfo + * @function getTypeUrl + * @memberof google.cloud.automl.v1beta1.BatchPredictOperationMetadata.BatchPredictOutputInfo + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + BatchPredictOutputInfo.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.automl.v1beta1.BatchPredictOperationMetadata.BatchPredictOutputInfo"; + }; + + return BatchPredictOutputInfo; + })(); + + return BatchPredictOperationMetadata; + })(); + + v1beta1.ExportModelOperationMetadata = (function() { + + /** + * Properties of an ExportModelOperationMetadata. + * @memberof google.cloud.automl.v1beta1 + * @interface IExportModelOperationMetadata + * @property {google.cloud.automl.v1beta1.ExportModelOperationMetadata.IExportModelOutputInfo|null} [outputInfo] ExportModelOperationMetadata outputInfo + */ + + /** + * Constructs a new ExportModelOperationMetadata. + * @memberof google.cloud.automl.v1beta1 + * @classdesc Represents an ExportModelOperationMetadata. + * @implements IExportModelOperationMetadata + * @constructor + * @param {google.cloud.automl.v1beta1.IExportModelOperationMetadata=} [properties] Properties to set + */ + function ExportModelOperationMetadata(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ExportModelOperationMetadata outputInfo. + * @member {google.cloud.automl.v1beta1.ExportModelOperationMetadata.IExportModelOutputInfo|null|undefined} outputInfo + * @memberof google.cloud.automl.v1beta1.ExportModelOperationMetadata + * @instance + */ + ExportModelOperationMetadata.prototype.outputInfo = null; + + /** + * Creates a new ExportModelOperationMetadata instance using the specified properties. + * @function create + * @memberof google.cloud.automl.v1beta1.ExportModelOperationMetadata + * @static + * @param {google.cloud.automl.v1beta1.IExportModelOperationMetadata=} [properties] Properties to set + * @returns {google.cloud.automl.v1beta1.ExportModelOperationMetadata} ExportModelOperationMetadata instance + */ + ExportModelOperationMetadata.create = function create(properties) { + return new ExportModelOperationMetadata(properties); + }; + + /** + * Encodes the specified ExportModelOperationMetadata message. Does not implicitly {@link google.cloud.automl.v1beta1.ExportModelOperationMetadata.verify|verify} messages. + * @function encode + * @memberof google.cloud.automl.v1beta1.ExportModelOperationMetadata + * @static + * @param {google.cloud.automl.v1beta1.IExportModelOperationMetadata} message ExportModelOperationMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ExportModelOperationMetadata.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.outputInfo != null && Object.hasOwnProperty.call(message, "outputInfo")) + $root.google.cloud.automl.v1beta1.ExportModelOperationMetadata.ExportModelOutputInfo.encode(message.outputInfo, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified ExportModelOperationMetadata message, length delimited. Does not implicitly {@link google.cloud.automl.v1beta1.ExportModelOperationMetadata.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.automl.v1beta1.ExportModelOperationMetadata + * @static + * @param {google.cloud.automl.v1beta1.IExportModelOperationMetadata} message ExportModelOperationMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ExportModelOperationMetadata.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an ExportModelOperationMetadata message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.automl.v1beta1.ExportModelOperationMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.automl.v1beta1.ExportModelOperationMetadata} ExportModelOperationMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ExportModelOperationMetadata.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.automl.v1beta1.ExportModelOperationMetadata(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 2: { + message.outputInfo = $root.google.cloud.automl.v1beta1.ExportModelOperationMetadata.ExportModelOutputInfo.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an ExportModelOperationMetadata message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.automl.v1beta1.ExportModelOperationMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.automl.v1beta1.ExportModelOperationMetadata} ExportModelOperationMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ExportModelOperationMetadata.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an ExportModelOperationMetadata message. + * @function verify + * @memberof google.cloud.automl.v1beta1.ExportModelOperationMetadata + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ExportModelOperationMetadata.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.outputInfo != null && message.hasOwnProperty("outputInfo")) { + var error = $root.google.cloud.automl.v1beta1.ExportModelOperationMetadata.ExportModelOutputInfo.verify(message.outputInfo); + if (error) + return "outputInfo." + error; + } + return null; + }; + + /** + * Creates an ExportModelOperationMetadata message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.automl.v1beta1.ExportModelOperationMetadata + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.automl.v1beta1.ExportModelOperationMetadata} ExportModelOperationMetadata + */ + ExportModelOperationMetadata.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.automl.v1beta1.ExportModelOperationMetadata) + return object; + var message = new $root.google.cloud.automl.v1beta1.ExportModelOperationMetadata(); + if (object.outputInfo != null) { + if (typeof object.outputInfo !== "object") + throw TypeError(".google.cloud.automl.v1beta1.ExportModelOperationMetadata.outputInfo: object expected"); + message.outputInfo = $root.google.cloud.automl.v1beta1.ExportModelOperationMetadata.ExportModelOutputInfo.fromObject(object.outputInfo); + } + return message; + }; + + /** + * Creates a plain object from an ExportModelOperationMetadata message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.automl.v1beta1.ExportModelOperationMetadata + * @static + * @param {google.cloud.automl.v1beta1.ExportModelOperationMetadata} message ExportModelOperationMetadata + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ExportModelOperationMetadata.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.outputInfo = null; + if (message.outputInfo != null && message.hasOwnProperty("outputInfo")) + object.outputInfo = $root.google.cloud.automl.v1beta1.ExportModelOperationMetadata.ExportModelOutputInfo.toObject(message.outputInfo, options); + return object; + }; + + /** + * Converts this ExportModelOperationMetadata to JSON. + * @function toJSON + * @memberof google.cloud.automl.v1beta1.ExportModelOperationMetadata + * @instance + * @returns {Object.} JSON object + */ + ExportModelOperationMetadata.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ExportModelOperationMetadata + * @function getTypeUrl + * @memberof google.cloud.automl.v1beta1.ExportModelOperationMetadata + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ExportModelOperationMetadata.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.automl.v1beta1.ExportModelOperationMetadata"; + }; + + ExportModelOperationMetadata.ExportModelOutputInfo = (function() { + + /** + * Properties of an ExportModelOutputInfo. + * @memberof google.cloud.automl.v1beta1.ExportModelOperationMetadata + * @interface IExportModelOutputInfo + * @property {string|null} [gcsOutputDirectory] ExportModelOutputInfo gcsOutputDirectory + */ + + /** + * Constructs a new ExportModelOutputInfo. + * @memberof google.cloud.automl.v1beta1.ExportModelOperationMetadata + * @classdesc Represents an ExportModelOutputInfo. + * @implements IExportModelOutputInfo + * @constructor + * @param {google.cloud.automl.v1beta1.ExportModelOperationMetadata.IExportModelOutputInfo=} [properties] Properties to set + */ + function ExportModelOutputInfo(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ExportModelOutputInfo gcsOutputDirectory. + * @member {string} gcsOutputDirectory + * @memberof google.cloud.automl.v1beta1.ExportModelOperationMetadata.ExportModelOutputInfo + * @instance + */ + ExportModelOutputInfo.prototype.gcsOutputDirectory = ""; + + /** + * Creates a new ExportModelOutputInfo instance using the specified properties. + * @function create + * @memberof google.cloud.automl.v1beta1.ExportModelOperationMetadata.ExportModelOutputInfo + * @static + * @param {google.cloud.automl.v1beta1.ExportModelOperationMetadata.IExportModelOutputInfo=} [properties] Properties to set + * @returns {google.cloud.automl.v1beta1.ExportModelOperationMetadata.ExportModelOutputInfo} ExportModelOutputInfo instance + */ + ExportModelOutputInfo.create = function create(properties) { + return new ExportModelOutputInfo(properties); + }; + + /** + * Encodes the specified ExportModelOutputInfo message. Does not implicitly {@link google.cloud.automl.v1beta1.ExportModelOperationMetadata.ExportModelOutputInfo.verify|verify} messages. + * @function encode + * @memberof google.cloud.automl.v1beta1.ExportModelOperationMetadata.ExportModelOutputInfo + * @static + * @param {google.cloud.automl.v1beta1.ExportModelOperationMetadata.IExportModelOutputInfo} message ExportModelOutputInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ExportModelOutputInfo.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.gcsOutputDirectory != null && Object.hasOwnProperty.call(message, "gcsOutputDirectory")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.gcsOutputDirectory); + return writer; + }; + + /** + * Encodes the specified ExportModelOutputInfo message, length delimited. Does not implicitly {@link google.cloud.automl.v1beta1.ExportModelOperationMetadata.ExportModelOutputInfo.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.automl.v1beta1.ExportModelOperationMetadata.ExportModelOutputInfo + * @static + * @param {google.cloud.automl.v1beta1.ExportModelOperationMetadata.IExportModelOutputInfo} message ExportModelOutputInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ExportModelOutputInfo.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an ExportModelOutputInfo message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.automl.v1beta1.ExportModelOperationMetadata.ExportModelOutputInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.automl.v1beta1.ExportModelOperationMetadata.ExportModelOutputInfo} ExportModelOutputInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ExportModelOutputInfo.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.automl.v1beta1.ExportModelOperationMetadata.ExportModelOutputInfo(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.gcsOutputDirectory = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an ExportModelOutputInfo message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.automl.v1beta1.ExportModelOperationMetadata.ExportModelOutputInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.automl.v1beta1.ExportModelOperationMetadata.ExportModelOutputInfo} ExportModelOutputInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ExportModelOutputInfo.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an ExportModelOutputInfo message. + * @function verify + * @memberof google.cloud.automl.v1beta1.ExportModelOperationMetadata.ExportModelOutputInfo + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ExportModelOutputInfo.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.gcsOutputDirectory != null && message.hasOwnProperty("gcsOutputDirectory")) + if (!$util.isString(message.gcsOutputDirectory)) + return "gcsOutputDirectory: string expected"; + return null; + }; + + /** + * Creates an ExportModelOutputInfo message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.automl.v1beta1.ExportModelOperationMetadata.ExportModelOutputInfo + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.automl.v1beta1.ExportModelOperationMetadata.ExportModelOutputInfo} ExportModelOutputInfo + */ + ExportModelOutputInfo.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.automl.v1beta1.ExportModelOperationMetadata.ExportModelOutputInfo) + return object; + var message = new $root.google.cloud.automl.v1beta1.ExportModelOperationMetadata.ExportModelOutputInfo(); + if (object.gcsOutputDirectory != null) + message.gcsOutputDirectory = String(object.gcsOutputDirectory); + return message; + }; + + /** + * Creates a plain object from an ExportModelOutputInfo message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.automl.v1beta1.ExportModelOperationMetadata.ExportModelOutputInfo + * @static + * @param {google.cloud.automl.v1beta1.ExportModelOperationMetadata.ExportModelOutputInfo} message ExportModelOutputInfo + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ExportModelOutputInfo.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.gcsOutputDirectory = ""; + if (message.gcsOutputDirectory != null && message.hasOwnProperty("gcsOutputDirectory")) + object.gcsOutputDirectory = message.gcsOutputDirectory; + return object; + }; + + /** + * Converts this ExportModelOutputInfo to JSON. + * @function toJSON + * @memberof google.cloud.automl.v1beta1.ExportModelOperationMetadata.ExportModelOutputInfo + * @instance + * @returns {Object.} JSON object + */ + ExportModelOutputInfo.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ExportModelOutputInfo + * @function getTypeUrl + * @memberof google.cloud.automl.v1beta1.ExportModelOperationMetadata.ExportModelOutputInfo + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ExportModelOutputInfo.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.automl.v1beta1.ExportModelOperationMetadata.ExportModelOutputInfo"; + }; + + return ExportModelOutputInfo; + })(); + + return ExportModelOperationMetadata; + })(); + + v1beta1.ExportEvaluatedExamplesOperationMetadata = (function() { + + /** + * Properties of an ExportEvaluatedExamplesOperationMetadata. + * @memberof google.cloud.automl.v1beta1 + * @interface IExportEvaluatedExamplesOperationMetadata + * @property {google.cloud.automl.v1beta1.ExportEvaluatedExamplesOperationMetadata.IExportEvaluatedExamplesOutputInfo|null} [outputInfo] ExportEvaluatedExamplesOperationMetadata outputInfo + */ + + /** + * Constructs a new ExportEvaluatedExamplesOperationMetadata. + * @memberof google.cloud.automl.v1beta1 + * @classdesc Represents an ExportEvaluatedExamplesOperationMetadata. + * @implements IExportEvaluatedExamplesOperationMetadata + * @constructor + * @param {google.cloud.automl.v1beta1.IExportEvaluatedExamplesOperationMetadata=} [properties] Properties to set + */ + function ExportEvaluatedExamplesOperationMetadata(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ExportEvaluatedExamplesOperationMetadata outputInfo. + * @member {google.cloud.automl.v1beta1.ExportEvaluatedExamplesOperationMetadata.IExportEvaluatedExamplesOutputInfo|null|undefined} outputInfo + * @memberof google.cloud.automl.v1beta1.ExportEvaluatedExamplesOperationMetadata + * @instance + */ + ExportEvaluatedExamplesOperationMetadata.prototype.outputInfo = null; + + /** + * Creates a new ExportEvaluatedExamplesOperationMetadata instance using the specified properties. + * @function create + * @memberof google.cloud.automl.v1beta1.ExportEvaluatedExamplesOperationMetadata + * @static + * @param {google.cloud.automl.v1beta1.IExportEvaluatedExamplesOperationMetadata=} [properties] Properties to set + * @returns {google.cloud.automl.v1beta1.ExportEvaluatedExamplesOperationMetadata} ExportEvaluatedExamplesOperationMetadata instance + */ + ExportEvaluatedExamplesOperationMetadata.create = function create(properties) { + return new ExportEvaluatedExamplesOperationMetadata(properties); + }; + + /** + * Encodes the specified ExportEvaluatedExamplesOperationMetadata message. Does not implicitly {@link google.cloud.automl.v1beta1.ExportEvaluatedExamplesOperationMetadata.verify|verify} messages. + * @function encode + * @memberof google.cloud.automl.v1beta1.ExportEvaluatedExamplesOperationMetadata + * @static + * @param {google.cloud.automl.v1beta1.IExportEvaluatedExamplesOperationMetadata} message ExportEvaluatedExamplesOperationMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ExportEvaluatedExamplesOperationMetadata.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.outputInfo != null && Object.hasOwnProperty.call(message, "outputInfo")) + $root.google.cloud.automl.v1beta1.ExportEvaluatedExamplesOperationMetadata.ExportEvaluatedExamplesOutputInfo.encode(message.outputInfo, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified ExportEvaluatedExamplesOperationMetadata message, length delimited. Does not implicitly {@link google.cloud.automl.v1beta1.ExportEvaluatedExamplesOperationMetadata.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.automl.v1beta1.ExportEvaluatedExamplesOperationMetadata + * @static + * @param {google.cloud.automl.v1beta1.IExportEvaluatedExamplesOperationMetadata} message ExportEvaluatedExamplesOperationMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ExportEvaluatedExamplesOperationMetadata.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an ExportEvaluatedExamplesOperationMetadata message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.automl.v1beta1.ExportEvaluatedExamplesOperationMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.automl.v1beta1.ExportEvaluatedExamplesOperationMetadata} ExportEvaluatedExamplesOperationMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ExportEvaluatedExamplesOperationMetadata.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.automl.v1beta1.ExportEvaluatedExamplesOperationMetadata(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 2: { + message.outputInfo = $root.google.cloud.automl.v1beta1.ExportEvaluatedExamplesOperationMetadata.ExportEvaluatedExamplesOutputInfo.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an ExportEvaluatedExamplesOperationMetadata message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.automl.v1beta1.ExportEvaluatedExamplesOperationMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.automl.v1beta1.ExportEvaluatedExamplesOperationMetadata} ExportEvaluatedExamplesOperationMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ExportEvaluatedExamplesOperationMetadata.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an ExportEvaluatedExamplesOperationMetadata message. + * @function verify + * @memberof google.cloud.automl.v1beta1.ExportEvaluatedExamplesOperationMetadata + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ExportEvaluatedExamplesOperationMetadata.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.outputInfo != null && message.hasOwnProperty("outputInfo")) { + var error = $root.google.cloud.automl.v1beta1.ExportEvaluatedExamplesOperationMetadata.ExportEvaluatedExamplesOutputInfo.verify(message.outputInfo); + if (error) + return "outputInfo." + error; + } + return null; + }; + + /** + * Creates an ExportEvaluatedExamplesOperationMetadata message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.automl.v1beta1.ExportEvaluatedExamplesOperationMetadata + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.automl.v1beta1.ExportEvaluatedExamplesOperationMetadata} ExportEvaluatedExamplesOperationMetadata + */ + ExportEvaluatedExamplesOperationMetadata.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.automl.v1beta1.ExportEvaluatedExamplesOperationMetadata) + return object; + var message = new $root.google.cloud.automl.v1beta1.ExportEvaluatedExamplesOperationMetadata(); + if (object.outputInfo != null) { + if (typeof object.outputInfo !== "object") + throw TypeError(".google.cloud.automl.v1beta1.ExportEvaluatedExamplesOperationMetadata.outputInfo: object expected"); + message.outputInfo = $root.google.cloud.automl.v1beta1.ExportEvaluatedExamplesOperationMetadata.ExportEvaluatedExamplesOutputInfo.fromObject(object.outputInfo); + } + return message; + }; + + /** + * Creates a plain object from an ExportEvaluatedExamplesOperationMetadata message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.automl.v1beta1.ExportEvaluatedExamplesOperationMetadata + * @static + * @param {google.cloud.automl.v1beta1.ExportEvaluatedExamplesOperationMetadata} message ExportEvaluatedExamplesOperationMetadata + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ExportEvaluatedExamplesOperationMetadata.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.outputInfo = null; + if (message.outputInfo != null && message.hasOwnProperty("outputInfo")) + object.outputInfo = $root.google.cloud.automl.v1beta1.ExportEvaluatedExamplesOperationMetadata.ExportEvaluatedExamplesOutputInfo.toObject(message.outputInfo, options); + return object; + }; + + /** + * Converts this ExportEvaluatedExamplesOperationMetadata to JSON. + * @function toJSON + * @memberof google.cloud.automl.v1beta1.ExportEvaluatedExamplesOperationMetadata + * @instance + * @returns {Object.} JSON object + */ + ExportEvaluatedExamplesOperationMetadata.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ExportEvaluatedExamplesOperationMetadata + * @function getTypeUrl + * @memberof google.cloud.automl.v1beta1.ExportEvaluatedExamplesOperationMetadata + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ExportEvaluatedExamplesOperationMetadata.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.automl.v1beta1.ExportEvaluatedExamplesOperationMetadata"; + }; + + ExportEvaluatedExamplesOperationMetadata.ExportEvaluatedExamplesOutputInfo = (function() { + + /** + * Properties of an ExportEvaluatedExamplesOutputInfo. + * @memberof google.cloud.automl.v1beta1.ExportEvaluatedExamplesOperationMetadata + * @interface IExportEvaluatedExamplesOutputInfo + * @property {string|null} [bigqueryOutputDataset] ExportEvaluatedExamplesOutputInfo bigqueryOutputDataset + */ + + /** + * Constructs a new ExportEvaluatedExamplesOutputInfo. + * @memberof google.cloud.automl.v1beta1.ExportEvaluatedExamplesOperationMetadata + * @classdesc Represents an ExportEvaluatedExamplesOutputInfo. + * @implements IExportEvaluatedExamplesOutputInfo + * @constructor + * @param {google.cloud.automl.v1beta1.ExportEvaluatedExamplesOperationMetadata.IExportEvaluatedExamplesOutputInfo=} [properties] Properties to set + */ + function ExportEvaluatedExamplesOutputInfo(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ExportEvaluatedExamplesOutputInfo bigqueryOutputDataset. + * @member {string} bigqueryOutputDataset + * @memberof google.cloud.automl.v1beta1.ExportEvaluatedExamplesOperationMetadata.ExportEvaluatedExamplesOutputInfo + * @instance + */ + ExportEvaluatedExamplesOutputInfo.prototype.bigqueryOutputDataset = ""; + + /** + * Creates a new ExportEvaluatedExamplesOutputInfo instance using the specified properties. + * @function create + * @memberof google.cloud.automl.v1beta1.ExportEvaluatedExamplesOperationMetadata.ExportEvaluatedExamplesOutputInfo + * @static + * @param {google.cloud.automl.v1beta1.ExportEvaluatedExamplesOperationMetadata.IExportEvaluatedExamplesOutputInfo=} [properties] Properties to set + * @returns {google.cloud.automl.v1beta1.ExportEvaluatedExamplesOperationMetadata.ExportEvaluatedExamplesOutputInfo} ExportEvaluatedExamplesOutputInfo instance + */ + ExportEvaluatedExamplesOutputInfo.create = function create(properties) { + return new ExportEvaluatedExamplesOutputInfo(properties); + }; + + /** + * Encodes the specified ExportEvaluatedExamplesOutputInfo message. Does not implicitly {@link google.cloud.automl.v1beta1.ExportEvaluatedExamplesOperationMetadata.ExportEvaluatedExamplesOutputInfo.verify|verify} messages. + * @function encode + * @memberof google.cloud.automl.v1beta1.ExportEvaluatedExamplesOperationMetadata.ExportEvaluatedExamplesOutputInfo + * @static + * @param {google.cloud.automl.v1beta1.ExportEvaluatedExamplesOperationMetadata.IExportEvaluatedExamplesOutputInfo} message ExportEvaluatedExamplesOutputInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ExportEvaluatedExamplesOutputInfo.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.bigqueryOutputDataset != null && Object.hasOwnProperty.call(message, "bigqueryOutputDataset")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.bigqueryOutputDataset); + return writer; + }; + + /** + * Encodes the specified ExportEvaluatedExamplesOutputInfo message, length delimited. Does not implicitly {@link google.cloud.automl.v1beta1.ExportEvaluatedExamplesOperationMetadata.ExportEvaluatedExamplesOutputInfo.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.automl.v1beta1.ExportEvaluatedExamplesOperationMetadata.ExportEvaluatedExamplesOutputInfo + * @static + * @param {google.cloud.automl.v1beta1.ExportEvaluatedExamplesOperationMetadata.IExportEvaluatedExamplesOutputInfo} message ExportEvaluatedExamplesOutputInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ExportEvaluatedExamplesOutputInfo.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an ExportEvaluatedExamplesOutputInfo message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.automl.v1beta1.ExportEvaluatedExamplesOperationMetadata.ExportEvaluatedExamplesOutputInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.automl.v1beta1.ExportEvaluatedExamplesOperationMetadata.ExportEvaluatedExamplesOutputInfo} ExportEvaluatedExamplesOutputInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ExportEvaluatedExamplesOutputInfo.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.automl.v1beta1.ExportEvaluatedExamplesOperationMetadata.ExportEvaluatedExamplesOutputInfo(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 2: { + message.bigqueryOutputDataset = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an ExportEvaluatedExamplesOutputInfo message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.automl.v1beta1.ExportEvaluatedExamplesOperationMetadata.ExportEvaluatedExamplesOutputInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.automl.v1beta1.ExportEvaluatedExamplesOperationMetadata.ExportEvaluatedExamplesOutputInfo} ExportEvaluatedExamplesOutputInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ExportEvaluatedExamplesOutputInfo.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an ExportEvaluatedExamplesOutputInfo message. + * @function verify + * @memberof google.cloud.automl.v1beta1.ExportEvaluatedExamplesOperationMetadata.ExportEvaluatedExamplesOutputInfo + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ExportEvaluatedExamplesOutputInfo.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.bigqueryOutputDataset != null && message.hasOwnProperty("bigqueryOutputDataset")) + if (!$util.isString(message.bigqueryOutputDataset)) + return "bigqueryOutputDataset: string expected"; + return null; + }; + + /** + * Creates an ExportEvaluatedExamplesOutputInfo message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.automl.v1beta1.ExportEvaluatedExamplesOperationMetadata.ExportEvaluatedExamplesOutputInfo + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.automl.v1beta1.ExportEvaluatedExamplesOperationMetadata.ExportEvaluatedExamplesOutputInfo} ExportEvaluatedExamplesOutputInfo + */ + ExportEvaluatedExamplesOutputInfo.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.automl.v1beta1.ExportEvaluatedExamplesOperationMetadata.ExportEvaluatedExamplesOutputInfo) + return object; + var message = new $root.google.cloud.automl.v1beta1.ExportEvaluatedExamplesOperationMetadata.ExportEvaluatedExamplesOutputInfo(); + if (object.bigqueryOutputDataset != null) + message.bigqueryOutputDataset = String(object.bigqueryOutputDataset); + return message; + }; + + /** + * Creates a plain object from an ExportEvaluatedExamplesOutputInfo message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.automl.v1beta1.ExportEvaluatedExamplesOperationMetadata.ExportEvaluatedExamplesOutputInfo + * @static + * @param {google.cloud.automl.v1beta1.ExportEvaluatedExamplesOperationMetadata.ExportEvaluatedExamplesOutputInfo} message ExportEvaluatedExamplesOutputInfo + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ExportEvaluatedExamplesOutputInfo.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.bigqueryOutputDataset = ""; + if (message.bigqueryOutputDataset != null && message.hasOwnProperty("bigqueryOutputDataset")) + object.bigqueryOutputDataset = message.bigqueryOutputDataset; + return object; + }; + + /** + * Converts this ExportEvaluatedExamplesOutputInfo to JSON. + * @function toJSON + * @memberof google.cloud.automl.v1beta1.ExportEvaluatedExamplesOperationMetadata.ExportEvaluatedExamplesOutputInfo + * @instance + * @returns {Object.} JSON object + */ + ExportEvaluatedExamplesOutputInfo.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ExportEvaluatedExamplesOutputInfo + * @function getTypeUrl + * @memberof google.cloud.automl.v1beta1.ExportEvaluatedExamplesOperationMetadata.ExportEvaluatedExamplesOutputInfo + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ExportEvaluatedExamplesOutputInfo.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.automl.v1beta1.ExportEvaluatedExamplesOperationMetadata.ExportEvaluatedExamplesOutputInfo"; + }; + + return ExportEvaluatedExamplesOutputInfo; + })(); + + return ExportEvaluatedExamplesOperationMetadata; + })(); + + v1beta1.PredictionService = (function() { + + /** + * Constructs a new PredictionService service. + * @memberof google.cloud.automl.v1beta1 + * @classdesc Represents a PredictionService + * @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 PredictionService(rpcImpl, requestDelimited, responseDelimited) { + $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); + } + + (PredictionService.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = PredictionService; + + /** + * Creates new PredictionService service using the specified rpc implementation. + * @function create + * @memberof google.cloud.automl.v1beta1.PredictionService + * @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 {PredictionService} RPC service. Useful where requests and/or responses are streamed. + */ + PredictionService.create = function create(rpcImpl, requestDelimited, responseDelimited) { + return new this(rpcImpl, requestDelimited, responseDelimited); + }; + + /** + * Callback as used by {@link google.cloud.automl.v1beta1.PredictionService|predict}. + * @memberof google.cloud.automl.v1beta1.PredictionService + * @typedef PredictCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.automl.v1beta1.PredictResponse} [response] PredictResponse + */ + + /** + * Calls Predict. + * @function predict + * @memberof google.cloud.automl.v1beta1.PredictionService + * @instance + * @param {google.cloud.automl.v1beta1.IPredictRequest} request PredictRequest message or plain object + * @param {google.cloud.automl.v1beta1.PredictionService.PredictCallback} callback Node-style callback called with the error, if any, and PredictResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(PredictionService.prototype.predict = function predict(request, callback) { + return this.rpcCall(predict, $root.google.cloud.automl.v1beta1.PredictRequest, $root.google.cloud.automl.v1beta1.PredictResponse, request, callback); + }, "name", { value: "Predict" }); + + /** + * Calls Predict. + * @function predict + * @memberof google.cloud.automl.v1beta1.PredictionService + * @instance + * @param {google.cloud.automl.v1beta1.IPredictRequest} request PredictRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.automl.v1beta1.PredictionService|batchPredict}. + * @memberof google.cloud.automl.v1beta1.PredictionService + * @typedef BatchPredictCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls BatchPredict. + * @function batchPredict + * @memberof google.cloud.automl.v1beta1.PredictionService + * @instance + * @param {google.cloud.automl.v1beta1.IBatchPredictRequest} request BatchPredictRequest message or plain object + * @param {google.cloud.automl.v1beta1.PredictionService.BatchPredictCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(PredictionService.prototype.batchPredict = function batchPredict(request, callback) { + return this.rpcCall(batchPredict, $root.google.cloud.automl.v1beta1.BatchPredictRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "BatchPredict" }); + + /** + * Calls BatchPredict. + * @function batchPredict + * @memberof google.cloud.automl.v1beta1.PredictionService + * @instance + * @param {google.cloud.automl.v1beta1.IBatchPredictRequest} request BatchPredictRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + return PredictionService; + })(); + + v1beta1.PredictRequest = (function() { + + /** + * Properties of a PredictRequest. + * @memberof google.cloud.automl.v1beta1 + * @interface IPredictRequest + * @property {string|null} [name] PredictRequest name + * @property {google.cloud.automl.v1beta1.IExamplePayload|null} [payload] PredictRequest payload + * @property {Object.|null} [params] PredictRequest params + */ + + /** + * Constructs a new PredictRequest. + * @memberof google.cloud.automl.v1beta1 + * @classdesc Represents a PredictRequest. + * @implements IPredictRequest + * @constructor + * @param {google.cloud.automl.v1beta1.IPredictRequest=} [properties] Properties to set + */ + function PredictRequest(properties) { + this.params = {}; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * PredictRequest name. + * @member {string} name + * @memberof google.cloud.automl.v1beta1.PredictRequest + * @instance + */ + PredictRequest.prototype.name = ""; + + /** + * PredictRequest payload. + * @member {google.cloud.automl.v1beta1.IExamplePayload|null|undefined} payload + * @memberof google.cloud.automl.v1beta1.PredictRequest + * @instance + */ + PredictRequest.prototype.payload = null; + + /** + * PredictRequest params. + * @member {Object.} params + * @memberof google.cloud.automl.v1beta1.PredictRequest + * @instance + */ + PredictRequest.prototype.params = $util.emptyObject; + + /** + * Creates a new PredictRequest instance using the specified properties. + * @function create + * @memberof google.cloud.automl.v1beta1.PredictRequest + * @static + * @param {google.cloud.automl.v1beta1.IPredictRequest=} [properties] Properties to set + * @returns {google.cloud.automl.v1beta1.PredictRequest} PredictRequest instance + */ + PredictRequest.create = function create(properties) { + return new PredictRequest(properties); + }; + + /** + * Encodes the specified PredictRequest message. Does not implicitly {@link google.cloud.automl.v1beta1.PredictRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.automl.v1beta1.PredictRequest + * @static + * @param {google.cloud.automl.v1beta1.IPredictRequest} message PredictRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PredictRequest.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.payload != null && Object.hasOwnProperty.call(message, "payload")) + $root.google.cloud.automl.v1beta1.ExamplePayload.encode(message.payload, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.params != null && Object.hasOwnProperty.call(message, "params")) + for (var keys = Object.keys(message.params), 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.params[keys[i]]).ldelim(); + return writer; + }; + + /** + * Encodes the specified PredictRequest message, length delimited. Does not implicitly {@link google.cloud.automl.v1beta1.PredictRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.automl.v1beta1.PredictRequest + * @static + * @param {google.cloud.automl.v1beta1.IPredictRequest} message PredictRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PredictRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a PredictRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.automl.v1beta1.PredictRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.automl.v1beta1.PredictRequest} PredictRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PredictRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.automl.v1beta1.PredictRequest(), key, value; + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.payload = $root.google.cloud.automl.v1beta1.ExamplePayload.decode(reader, reader.uint32()); + break; + } + case 3: { + if (message.params === $util.emptyObject) + message.params = {}; + 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.params[key] = value; + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a PredictRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.automl.v1beta1.PredictRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.automl.v1beta1.PredictRequest} PredictRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PredictRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a PredictRequest message. + * @function verify + * @memberof google.cloud.automl.v1beta1.PredictRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + PredictRequest.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.payload != null && message.hasOwnProperty("payload")) { + var error = $root.google.cloud.automl.v1beta1.ExamplePayload.verify(message.payload); + if (error) + return "payload." + error; + } + if (message.params != null && message.hasOwnProperty("params")) { + if (!$util.isObject(message.params)) + return "params: object expected"; + var key = Object.keys(message.params); + for (var i = 0; i < key.length; ++i) + if (!$util.isString(message.params[key[i]])) + return "params: string{k:string} expected"; + } + return null; + }; + + /** + * Creates a PredictRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.automl.v1beta1.PredictRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.automl.v1beta1.PredictRequest} PredictRequest + */ + PredictRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.automl.v1beta1.PredictRequest) + return object; + var message = new $root.google.cloud.automl.v1beta1.PredictRequest(); + if (object.name != null) + message.name = String(object.name); + if (object.payload != null) { + if (typeof object.payload !== "object") + throw TypeError(".google.cloud.automl.v1beta1.PredictRequest.payload: object expected"); + message.payload = $root.google.cloud.automl.v1beta1.ExamplePayload.fromObject(object.payload); + } + if (object.params) { + if (typeof object.params !== "object") + throw TypeError(".google.cloud.automl.v1beta1.PredictRequest.params: object expected"); + message.params = {}; + for (var keys = Object.keys(object.params), i = 0; i < keys.length; ++i) + message.params[keys[i]] = String(object.params[keys[i]]); + } + return message; + }; + + /** + * Creates a plain object from a PredictRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.automl.v1beta1.PredictRequest + * @static + * @param {google.cloud.automl.v1beta1.PredictRequest} message PredictRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + PredictRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.objects || options.defaults) + object.params = {}; + if (options.defaults) { + object.name = ""; + object.payload = null; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.payload != null && message.hasOwnProperty("payload")) + object.payload = $root.google.cloud.automl.v1beta1.ExamplePayload.toObject(message.payload, options); + var keys2; + if (message.params && (keys2 = Object.keys(message.params)).length) { + object.params = {}; + for (var j = 0; j < keys2.length; ++j) + object.params[keys2[j]] = message.params[keys2[j]]; + } + return object; + }; + + /** + * Converts this PredictRequest to JSON. + * @function toJSON + * @memberof google.cloud.automl.v1beta1.PredictRequest + * @instance + * @returns {Object.} JSON object + */ + PredictRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for PredictRequest + * @function getTypeUrl + * @memberof google.cloud.automl.v1beta1.PredictRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + PredictRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.automl.v1beta1.PredictRequest"; + }; + + return PredictRequest; + })(); + + v1beta1.PredictResponse = (function() { + + /** + * Properties of a PredictResponse. + * @memberof google.cloud.automl.v1beta1 + * @interface IPredictResponse + * @property {Array.|null} [payload] PredictResponse payload + * @property {google.cloud.automl.v1beta1.IExamplePayload|null} [preprocessedInput] PredictResponse preprocessedInput + * @property {Object.|null} [metadata] PredictResponse metadata + */ + + /** + * Constructs a new PredictResponse. + * @memberof google.cloud.automl.v1beta1 + * @classdesc Represents a PredictResponse. + * @implements IPredictResponse + * @constructor + * @param {google.cloud.automl.v1beta1.IPredictResponse=} [properties] Properties to set + */ + function PredictResponse(properties) { + this.payload = []; + this.metadata = {}; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * PredictResponse payload. + * @member {Array.} payload + * @memberof google.cloud.automl.v1beta1.PredictResponse + * @instance + */ + PredictResponse.prototype.payload = $util.emptyArray; + + /** + * PredictResponse preprocessedInput. + * @member {google.cloud.automl.v1beta1.IExamplePayload|null|undefined} preprocessedInput + * @memberof google.cloud.automl.v1beta1.PredictResponse + * @instance + */ + PredictResponse.prototype.preprocessedInput = null; + + /** + * PredictResponse metadata. + * @member {Object.} metadata + * @memberof google.cloud.automl.v1beta1.PredictResponse + * @instance + */ + PredictResponse.prototype.metadata = $util.emptyObject; + + /** + * Creates a new PredictResponse instance using the specified properties. + * @function create + * @memberof google.cloud.automl.v1beta1.PredictResponse + * @static + * @param {google.cloud.automl.v1beta1.IPredictResponse=} [properties] Properties to set + * @returns {google.cloud.automl.v1beta1.PredictResponse} PredictResponse instance + */ + PredictResponse.create = function create(properties) { + return new PredictResponse(properties); + }; + + /** + * Encodes the specified PredictResponse message. Does not implicitly {@link google.cloud.automl.v1beta1.PredictResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.automl.v1beta1.PredictResponse + * @static + * @param {google.cloud.automl.v1beta1.IPredictResponse} message PredictResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PredictResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.payload != null && message.payload.length) + for (var i = 0; i < message.payload.length; ++i) + $root.google.cloud.automl.v1beta1.AnnotationPayload.encode(message.payload[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.metadata != null && Object.hasOwnProperty.call(message, "metadata")) + for (var keys = Object.keys(message.metadata), 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.metadata[keys[i]]).ldelim(); + if (message.preprocessedInput != null && Object.hasOwnProperty.call(message, "preprocessedInput")) + $root.google.cloud.automl.v1beta1.ExamplePayload.encode(message.preprocessedInput, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified PredictResponse message, length delimited. Does not implicitly {@link google.cloud.automl.v1beta1.PredictResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.automl.v1beta1.PredictResponse + * @static + * @param {google.cloud.automl.v1beta1.IPredictResponse} message PredictResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PredictResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a PredictResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.automl.v1beta1.PredictResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.automl.v1beta1.PredictResponse} PredictResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PredictResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.automl.v1beta1.PredictResponse(), key, value; + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.payload && message.payload.length)) + message.payload = []; + message.payload.push($root.google.cloud.automl.v1beta1.AnnotationPayload.decode(reader, reader.uint32())); + break; + } + case 3: { + message.preprocessedInput = $root.google.cloud.automl.v1beta1.ExamplePayload.decode(reader, reader.uint32()); + break; + } + case 2: { + if (message.metadata === $util.emptyObject) + message.metadata = {}; + 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.metadata[key] = value; + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a PredictResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.automl.v1beta1.PredictResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.automl.v1beta1.PredictResponse} PredictResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PredictResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a PredictResponse message. + * @function verify + * @memberof google.cloud.automl.v1beta1.PredictResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + PredictResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.payload != null && message.hasOwnProperty("payload")) { + if (!Array.isArray(message.payload)) + return "payload: array expected"; + for (var i = 0; i < message.payload.length; ++i) { + var error = $root.google.cloud.automl.v1beta1.AnnotationPayload.verify(message.payload[i]); + if (error) + return "payload." + error; + } + } + if (message.preprocessedInput != null && message.hasOwnProperty("preprocessedInput")) { + var error = $root.google.cloud.automl.v1beta1.ExamplePayload.verify(message.preprocessedInput); + if (error) + return "preprocessedInput." + error; + } + if (message.metadata != null && message.hasOwnProperty("metadata")) { + if (!$util.isObject(message.metadata)) + return "metadata: object expected"; + var key = Object.keys(message.metadata); + for (var i = 0; i < key.length; ++i) + if (!$util.isString(message.metadata[key[i]])) + return "metadata: string{k:string} expected"; + } + return null; + }; + + /** + * Creates a PredictResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.automl.v1beta1.PredictResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.automl.v1beta1.PredictResponse} PredictResponse + */ + PredictResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.automl.v1beta1.PredictResponse) + return object; + var message = new $root.google.cloud.automl.v1beta1.PredictResponse(); + if (object.payload) { + if (!Array.isArray(object.payload)) + throw TypeError(".google.cloud.automl.v1beta1.PredictResponse.payload: array expected"); + message.payload = []; + for (var i = 0; i < object.payload.length; ++i) { + if (typeof object.payload[i] !== "object") + throw TypeError(".google.cloud.automl.v1beta1.PredictResponse.payload: object expected"); + message.payload[i] = $root.google.cloud.automl.v1beta1.AnnotationPayload.fromObject(object.payload[i]); + } + } + if (object.preprocessedInput != null) { + if (typeof object.preprocessedInput !== "object") + throw TypeError(".google.cloud.automl.v1beta1.PredictResponse.preprocessedInput: object expected"); + message.preprocessedInput = $root.google.cloud.automl.v1beta1.ExamplePayload.fromObject(object.preprocessedInput); + } + if (object.metadata) { + if (typeof object.metadata !== "object") + throw TypeError(".google.cloud.automl.v1beta1.PredictResponse.metadata: object expected"); + message.metadata = {}; + for (var keys = Object.keys(object.metadata), i = 0; i < keys.length; ++i) + message.metadata[keys[i]] = String(object.metadata[keys[i]]); + } + return message; + }; + + /** + * Creates a plain object from a PredictResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.automl.v1beta1.PredictResponse + * @static + * @param {google.cloud.automl.v1beta1.PredictResponse} message PredictResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + PredictResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.payload = []; + if (options.objects || options.defaults) + object.metadata = {}; + if (options.defaults) + object.preprocessedInput = null; + if (message.payload && message.payload.length) { + object.payload = []; + for (var j = 0; j < message.payload.length; ++j) + object.payload[j] = $root.google.cloud.automl.v1beta1.AnnotationPayload.toObject(message.payload[j], options); + } + var keys2; + if (message.metadata && (keys2 = Object.keys(message.metadata)).length) { + object.metadata = {}; + for (var j = 0; j < keys2.length; ++j) + object.metadata[keys2[j]] = message.metadata[keys2[j]]; + } + if (message.preprocessedInput != null && message.hasOwnProperty("preprocessedInput")) + object.preprocessedInput = $root.google.cloud.automl.v1beta1.ExamplePayload.toObject(message.preprocessedInput, options); + return object; + }; + + /** + * Converts this PredictResponse to JSON. + * @function toJSON + * @memberof google.cloud.automl.v1beta1.PredictResponse + * @instance + * @returns {Object.} JSON object + */ + PredictResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for PredictResponse + * @function getTypeUrl + * @memberof google.cloud.automl.v1beta1.PredictResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + PredictResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.automl.v1beta1.PredictResponse"; + }; + + return PredictResponse; + })(); + + v1beta1.BatchPredictRequest = (function() { + + /** + * Properties of a BatchPredictRequest. + * @memberof google.cloud.automl.v1beta1 + * @interface IBatchPredictRequest + * @property {string|null} [name] BatchPredictRequest name + * @property {google.cloud.automl.v1beta1.IBatchPredictInputConfig|null} [inputConfig] BatchPredictRequest inputConfig + * @property {google.cloud.automl.v1beta1.IBatchPredictOutputConfig|null} [outputConfig] BatchPredictRequest outputConfig + * @property {Object.|null} [params] BatchPredictRequest params + */ + + /** + * Constructs a new BatchPredictRequest. + * @memberof google.cloud.automl.v1beta1 + * @classdesc Represents a BatchPredictRequest. + * @implements IBatchPredictRequest + * @constructor + * @param {google.cloud.automl.v1beta1.IBatchPredictRequest=} [properties] Properties to set + */ + function BatchPredictRequest(properties) { + this.params = {}; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * BatchPredictRequest name. + * @member {string} name + * @memberof google.cloud.automl.v1beta1.BatchPredictRequest + * @instance + */ + BatchPredictRequest.prototype.name = ""; + + /** + * BatchPredictRequest inputConfig. + * @member {google.cloud.automl.v1beta1.IBatchPredictInputConfig|null|undefined} inputConfig + * @memberof google.cloud.automl.v1beta1.BatchPredictRequest + * @instance + */ + BatchPredictRequest.prototype.inputConfig = null; + + /** + * BatchPredictRequest outputConfig. + * @member {google.cloud.automl.v1beta1.IBatchPredictOutputConfig|null|undefined} outputConfig + * @memberof google.cloud.automl.v1beta1.BatchPredictRequest + * @instance + */ + BatchPredictRequest.prototype.outputConfig = null; + + /** + * BatchPredictRequest params. + * @member {Object.} params + * @memberof google.cloud.automl.v1beta1.BatchPredictRequest + * @instance + */ + BatchPredictRequest.prototype.params = $util.emptyObject; + + /** + * Creates a new BatchPredictRequest instance using the specified properties. + * @function create + * @memberof google.cloud.automl.v1beta1.BatchPredictRequest + * @static + * @param {google.cloud.automl.v1beta1.IBatchPredictRequest=} [properties] Properties to set + * @returns {google.cloud.automl.v1beta1.BatchPredictRequest} BatchPredictRequest instance + */ + BatchPredictRequest.create = function create(properties) { + return new BatchPredictRequest(properties); + }; + + /** + * Encodes the specified BatchPredictRequest message. Does not implicitly {@link google.cloud.automl.v1beta1.BatchPredictRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.automl.v1beta1.BatchPredictRequest + * @static + * @param {google.cloud.automl.v1beta1.IBatchPredictRequest} message BatchPredictRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BatchPredictRequest.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.inputConfig != null && Object.hasOwnProperty.call(message, "inputConfig")) + $root.google.cloud.automl.v1beta1.BatchPredictInputConfig.encode(message.inputConfig, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.outputConfig != null && Object.hasOwnProperty.call(message, "outputConfig")) + $root.google.cloud.automl.v1beta1.BatchPredictOutputConfig.encode(message.outputConfig, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.params != null && Object.hasOwnProperty.call(message, "params")) + for (var keys = Object.keys(message.params), i = 0; i < keys.length; ++i) + writer.uint32(/* id 5, wireType 2 =*/42).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.params[keys[i]]).ldelim(); + return writer; + }; + + /** + * Encodes the specified BatchPredictRequest message, length delimited. Does not implicitly {@link google.cloud.automl.v1beta1.BatchPredictRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.automl.v1beta1.BatchPredictRequest + * @static + * @param {google.cloud.automl.v1beta1.IBatchPredictRequest} message BatchPredictRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BatchPredictRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a BatchPredictRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.automl.v1beta1.BatchPredictRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.automl.v1beta1.BatchPredictRequest} BatchPredictRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BatchPredictRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.automl.v1beta1.BatchPredictRequest(), key, value; + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 3: { + message.inputConfig = $root.google.cloud.automl.v1beta1.BatchPredictInputConfig.decode(reader, reader.uint32()); + break; + } + case 4: { + message.outputConfig = $root.google.cloud.automl.v1beta1.BatchPredictOutputConfig.decode(reader, reader.uint32()); + break; + } + case 5: { + if (message.params === $util.emptyObject) + message.params = {}; + 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.params[key] = value; + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a BatchPredictRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.automl.v1beta1.BatchPredictRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.automl.v1beta1.BatchPredictRequest} BatchPredictRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BatchPredictRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a BatchPredictRequest message. + * @function verify + * @memberof google.cloud.automl.v1beta1.BatchPredictRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + BatchPredictRequest.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.inputConfig != null && message.hasOwnProperty("inputConfig")) { + var error = $root.google.cloud.automl.v1beta1.BatchPredictInputConfig.verify(message.inputConfig); + if (error) + return "inputConfig." + error; + } + if (message.outputConfig != null && message.hasOwnProperty("outputConfig")) { + var error = $root.google.cloud.automl.v1beta1.BatchPredictOutputConfig.verify(message.outputConfig); + if (error) + return "outputConfig." + error; + } + if (message.params != null && message.hasOwnProperty("params")) { + if (!$util.isObject(message.params)) + return "params: object expected"; + var key = Object.keys(message.params); + for (var i = 0; i < key.length; ++i) + if (!$util.isString(message.params[key[i]])) + return "params: string{k:string} expected"; + } + return null; + }; + + /** + * Creates a BatchPredictRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.automl.v1beta1.BatchPredictRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.automl.v1beta1.BatchPredictRequest} BatchPredictRequest + */ + BatchPredictRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.automl.v1beta1.BatchPredictRequest) + return object; + var message = new $root.google.cloud.automl.v1beta1.BatchPredictRequest(); + if (object.name != null) + message.name = String(object.name); + if (object.inputConfig != null) { + if (typeof object.inputConfig !== "object") + throw TypeError(".google.cloud.automl.v1beta1.BatchPredictRequest.inputConfig: object expected"); + message.inputConfig = $root.google.cloud.automl.v1beta1.BatchPredictInputConfig.fromObject(object.inputConfig); + } + if (object.outputConfig != null) { + if (typeof object.outputConfig !== "object") + throw TypeError(".google.cloud.automl.v1beta1.BatchPredictRequest.outputConfig: object expected"); + message.outputConfig = $root.google.cloud.automl.v1beta1.BatchPredictOutputConfig.fromObject(object.outputConfig); + } + if (object.params) { + if (typeof object.params !== "object") + throw TypeError(".google.cloud.automl.v1beta1.BatchPredictRequest.params: object expected"); + message.params = {}; + for (var keys = Object.keys(object.params), i = 0; i < keys.length; ++i) + message.params[keys[i]] = String(object.params[keys[i]]); + } + return message; + }; + + /** + * Creates a plain object from a BatchPredictRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.automl.v1beta1.BatchPredictRequest + * @static + * @param {google.cloud.automl.v1beta1.BatchPredictRequest} message BatchPredictRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + BatchPredictRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.objects || options.defaults) + object.params = {}; + if (options.defaults) { + object.name = ""; + object.inputConfig = null; + object.outputConfig = null; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.inputConfig != null && message.hasOwnProperty("inputConfig")) + object.inputConfig = $root.google.cloud.automl.v1beta1.BatchPredictInputConfig.toObject(message.inputConfig, options); + if (message.outputConfig != null && message.hasOwnProperty("outputConfig")) + object.outputConfig = $root.google.cloud.automl.v1beta1.BatchPredictOutputConfig.toObject(message.outputConfig, options); + var keys2; + if (message.params && (keys2 = Object.keys(message.params)).length) { + object.params = {}; + for (var j = 0; j < keys2.length; ++j) + object.params[keys2[j]] = message.params[keys2[j]]; + } + return object; + }; + + /** + * Converts this BatchPredictRequest to JSON. + * @function toJSON + * @memberof google.cloud.automl.v1beta1.BatchPredictRequest + * @instance + * @returns {Object.} JSON object + */ + BatchPredictRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for BatchPredictRequest + * @function getTypeUrl + * @memberof google.cloud.automl.v1beta1.BatchPredictRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + BatchPredictRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.automl.v1beta1.BatchPredictRequest"; + }; + + return BatchPredictRequest; + })(); + + v1beta1.BatchPredictResult = (function() { + + /** + * Properties of a BatchPredictResult. + * @memberof google.cloud.automl.v1beta1 + * @interface IBatchPredictResult + * @property {Object.|null} [metadata] BatchPredictResult metadata + */ + + /** + * Constructs a new BatchPredictResult. + * @memberof google.cloud.automl.v1beta1 + * @classdesc Represents a BatchPredictResult. + * @implements IBatchPredictResult + * @constructor + * @param {google.cloud.automl.v1beta1.IBatchPredictResult=} [properties] Properties to set + */ + function BatchPredictResult(properties) { + this.metadata = {}; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * BatchPredictResult metadata. + * @member {Object.} metadata + * @memberof google.cloud.automl.v1beta1.BatchPredictResult + * @instance + */ + BatchPredictResult.prototype.metadata = $util.emptyObject; + + /** + * Creates a new BatchPredictResult instance using the specified properties. + * @function create + * @memberof google.cloud.automl.v1beta1.BatchPredictResult + * @static + * @param {google.cloud.automl.v1beta1.IBatchPredictResult=} [properties] Properties to set + * @returns {google.cloud.automl.v1beta1.BatchPredictResult} BatchPredictResult instance + */ + BatchPredictResult.create = function create(properties) { + return new BatchPredictResult(properties); + }; + + /** + * Encodes the specified BatchPredictResult message. Does not implicitly {@link google.cloud.automl.v1beta1.BatchPredictResult.verify|verify} messages. + * @function encode + * @memberof google.cloud.automl.v1beta1.BatchPredictResult + * @static + * @param {google.cloud.automl.v1beta1.IBatchPredictResult} message BatchPredictResult message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BatchPredictResult.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.metadata != null && Object.hasOwnProperty.call(message, "metadata")) + for (var keys = Object.keys(message.metadata), i = 0; i < keys.length; ++i) + writer.uint32(/* id 1, wireType 2 =*/10).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.metadata[keys[i]]).ldelim(); + return writer; + }; + + /** + * Encodes the specified BatchPredictResult message, length delimited. Does not implicitly {@link google.cloud.automl.v1beta1.BatchPredictResult.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.automl.v1beta1.BatchPredictResult + * @static + * @param {google.cloud.automl.v1beta1.IBatchPredictResult} message BatchPredictResult message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BatchPredictResult.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a BatchPredictResult message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.automl.v1beta1.BatchPredictResult + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.automl.v1beta1.BatchPredictResult} BatchPredictResult + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BatchPredictResult.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.automl.v1beta1.BatchPredictResult(), key, value; + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (message.metadata === $util.emptyObject) + message.metadata = {}; + 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.metadata[key] = value; + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a BatchPredictResult message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.automl.v1beta1.BatchPredictResult + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.automl.v1beta1.BatchPredictResult} BatchPredictResult + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BatchPredictResult.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a BatchPredictResult message. + * @function verify + * @memberof google.cloud.automl.v1beta1.BatchPredictResult + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + BatchPredictResult.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.metadata != null && message.hasOwnProperty("metadata")) { + if (!$util.isObject(message.metadata)) + return "metadata: object expected"; + var key = Object.keys(message.metadata); + for (var i = 0; i < key.length; ++i) + if (!$util.isString(message.metadata[key[i]])) + return "metadata: string{k:string} expected"; + } + return null; + }; + + /** + * Creates a BatchPredictResult message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.automl.v1beta1.BatchPredictResult + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.automl.v1beta1.BatchPredictResult} BatchPredictResult + */ + BatchPredictResult.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.automl.v1beta1.BatchPredictResult) + return object; + var message = new $root.google.cloud.automl.v1beta1.BatchPredictResult(); + if (object.metadata) { + if (typeof object.metadata !== "object") + throw TypeError(".google.cloud.automl.v1beta1.BatchPredictResult.metadata: object expected"); + message.metadata = {}; + for (var keys = Object.keys(object.metadata), i = 0; i < keys.length; ++i) + message.metadata[keys[i]] = String(object.metadata[keys[i]]); + } + return message; + }; + + /** + * Creates a plain object from a BatchPredictResult message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.automl.v1beta1.BatchPredictResult + * @static + * @param {google.cloud.automl.v1beta1.BatchPredictResult} message BatchPredictResult + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + BatchPredictResult.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.objects || options.defaults) + object.metadata = {}; + var keys2; + if (message.metadata && (keys2 = Object.keys(message.metadata)).length) { + object.metadata = {}; + for (var j = 0; j < keys2.length; ++j) + object.metadata[keys2[j]] = message.metadata[keys2[j]]; + } + return object; + }; + + /** + * Converts this BatchPredictResult to JSON. + * @function toJSON + * @memberof google.cloud.automl.v1beta1.BatchPredictResult + * @instance + * @returns {Object.} JSON object + */ + BatchPredictResult.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for BatchPredictResult + * @function getTypeUrl + * @memberof google.cloud.automl.v1beta1.BatchPredictResult + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + BatchPredictResult.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.automl.v1beta1.BatchPredictResult"; + }; + + return BatchPredictResult; + })(); + + v1beta1.AutoMl = (function() { + + /** + * Constructs a new AutoMl service. + * @memberof google.cloud.automl.v1beta1 + * @classdesc Represents an AutoMl + * @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 AutoMl(rpcImpl, requestDelimited, responseDelimited) { + $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); + } + + (AutoMl.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = AutoMl; + + /** + * Creates new AutoMl service using the specified rpc implementation. + * @function create + * @memberof google.cloud.automl.v1beta1.AutoMl + * @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 {AutoMl} RPC service. Useful where requests and/or responses are streamed. + */ + AutoMl.create = function create(rpcImpl, requestDelimited, responseDelimited) { + return new this(rpcImpl, requestDelimited, responseDelimited); + }; + + /** + * Callback as used by {@link google.cloud.automl.v1beta1.AutoMl|createDataset}. + * @memberof google.cloud.automl.v1beta1.AutoMl + * @typedef CreateDatasetCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.automl.v1beta1.Dataset} [response] Dataset + */ + + /** + * Calls CreateDataset. + * @function createDataset + * @memberof google.cloud.automl.v1beta1.AutoMl + * @instance + * @param {google.cloud.automl.v1beta1.ICreateDatasetRequest} request CreateDatasetRequest message or plain object + * @param {google.cloud.automl.v1beta1.AutoMl.CreateDatasetCallback} callback Node-style callback called with the error, if any, and Dataset + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(AutoMl.prototype.createDataset = function createDataset(request, callback) { + return this.rpcCall(createDataset, $root.google.cloud.automl.v1beta1.CreateDatasetRequest, $root.google.cloud.automl.v1beta1.Dataset, request, callback); + }, "name", { value: "CreateDataset" }); + + /** + * Calls CreateDataset. + * @function createDataset + * @memberof google.cloud.automl.v1beta1.AutoMl + * @instance + * @param {google.cloud.automl.v1beta1.ICreateDatasetRequest} request CreateDatasetRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.automl.v1beta1.AutoMl|getDataset}. + * @memberof google.cloud.automl.v1beta1.AutoMl + * @typedef GetDatasetCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.automl.v1beta1.Dataset} [response] Dataset + */ + + /** + * Calls GetDataset. + * @function getDataset + * @memberof google.cloud.automl.v1beta1.AutoMl + * @instance + * @param {google.cloud.automl.v1beta1.IGetDatasetRequest} request GetDatasetRequest message or plain object + * @param {google.cloud.automl.v1beta1.AutoMl.GetDatasetCallback} callback Node-style callback called with the error, if any, and Dataset + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(AutoMl.prototype.getDataset = function getDataset(request, callback) { + return this.rpcCall(getDataset, $root.google.cloud.automl.v1beta1.GetDatasetRequest, $root.google.cloud.automl.v1beta1.Dataset, request, callback); + }, "name", { value: "GetDataset" }); + + /** + * Calls GetDataset. + * @function getDataset + * @memberof google.cloud.automl.v1beta1.AutoMl + * @instance + * @param {google.cloud.automl.v1beta1.IGetDatasetRequest} request GetDatasetRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.automl.v1beta1.AutoMl|listDatasets}. + * @memberof google.cloud.automl.v1beta1.AutoMl + * @typedef ListDatasetsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.automl.v1beta1.ListDatasetsResponse} [response] ListDatasetsResponse + */ + + /** + * Calls ListDatasets. + * @function listDatasets + * @memberof google.cloud.automl.v1beta1.AutoMl + * @instance + * @param {google.cloud.automl.v1beta1.IListDatasetsRequest} request ListDatasetsRequest message or plain object + * @param {google.cloud.automl.v1beta1.AutoMl.ListDatasetsCallback} callback Node-style callback called with the error, if any, and ListDatasetsResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(AutoMl.prototype.listDatasets = function listDatasets(request, callback) { + return this.rpcCall(listDatasets, $root.google.cloud.automl.v1beta1.ListDatasetsRequest, $root.google.cloud.automl.v1beta1.ListDatasetsResponse, request, callback); + }, "name", { value: "ListDatasets" }); + + /** + * Calls ListDatasets. + * @function listDatasets + * @memberof google.cloud.automl.v1beta1.AutoMl + * @instance + * @param {google.cloud.automl.v1beta1.IListDatasetsRequest} request ListDatasetsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.automl.v1beta1.AutoMl|updateDataset}. + * @memberof google.cloud.automl.v1beta1.AutoMl + * @typedef UpdateDatasetCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.automl.v1beta1.Dataset} [response] Dataset + */ + + /** + * Calls UpdateDataset. + * @function updateDataset + * @memberof google.cloud.automl.v1beta1.AutoMl + * @instance + * @param {google.cloud.automl.v1beta1.IUpdateDatasetRequest} request UpdateDatasetRequest message or plain object + * @param {google.cloud.automl.v1beta1.AutoMl.UpdateDatasetCallback} callback Node-style callback called with the error, if any, and Dataset + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(AutoMl.prototype.updateDataset = function updateDataset(request, callback) { + return this.rpcCall(updateDataset, $root.google.cloud.automl.v1beta1.UpdateDatasetRequest, $root.google.cloud.automl.v1beta1.Dataset, request, callback); + }, "name", { value: "UpdateDataset" }); + + /** + * Calls UpdateDataset. + * @function updateDataset + * @memberof google.cloud.automl.v1beta1.AutoMl + * @instance + * @param {google.cloud.automl.v1beta1.IUpdateDatasetRequest} request UpdateDatasetRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.automl.v1beta1.AutoMl|deleteDataset}. + * @memberof google.cloud.automl.v1beta1.AutoMl + * @typedef DeleteDatasetCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls DeleteDataset. + * @function deleteDataset + * @memberof google.cloud.automl.v1beta1.AutoMl + * @instance + * @param {google.cloud.automl.v1beta1.IDeleteDatasetRequest} request DeleteDatasetRequest message or plain object + * @param {google.cloud.automl.v1beta1.AutoMl.DeleteDatasetCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(AutoMl.prototype.deleteDataset = function deleteDataset(request, callback) { + return this.rpcCall(deleteDataset, $root.google.cloud.automl.v1beta1.DeleteDatasetRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "DeleteDataset" }); + + /** + * Calls DeleteDataset. + * @function deleteDataset + * @memberof google.cloud.automl.v1beta1.AutoMl + * @instance + * @param {google.cloud.automl.v1beta1.IDeleteDatasetRequest} request DeleteDatasetRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.automl.v1beta1.AutoMl|importData}. + * @memberof google.cloud.automl.v1beta1.AutoMl + * @typedef ImportDataCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls ImportData. + * @function importData + * @memberof google.cloud.automl.v1beta1.AutoMl + * @instance + * @param {google.cloud.automl.v1beta1.IImportDataRequest} request ImportDataRequest message or plain object + * @param {google.cloud.automl.v1beta1.AutoMl.ImportDataCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(AutoMl.prototype.importData = function importData(request, callback) { + return this.rpcCall(importData, $root.google.cloud.automl.v1beta1.ImportDataRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "ImportData" }); + + /** + * Calls ImportData. + * @function importData + * @memberof google.cloud.automl.v1beta1.AutoMl + * @instance + * @param {google.cloud.automl.v1beta1.IImportDataRequest} request ImportDataRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.automl.v1beta1.AutoMl|exportData}. + * @memberof google.cloud.automl.v1beta1.AutoMl + * @typedef ExportDataCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls ExportData. + * @function exportData + * @memberof google.cloud.automl.v1beta1.AutoMl + * @instance + * @param {google.cloud.automl.v1beta1.IExportDataRequest} request ExportDataRequest message or plain object + * @param {google.cloud.automl.v1beta1.AutoMl.ExportDataCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(AutoMl.prototype.exportData = function exportData(request, callback) { + return this.rpcCall(exportData, $root.google.cloud.automl.v1beta1.ExportDataRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "ExportData" }); + + /** + * Calls ExportData. + * @function exportData + * @memberof google.cloud.automl.v1beta1.AutoMl + * @instance + * @param {google.cloud.automl.v1beta1.IExportDataRequest} request ExportDataRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.automl.v1beta1.AutoMl|getAnnotationSpec}. + * @memberof google.cloud.automl.v1beta1.AutoMl + * @typedef GetAnnotationSpecCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.automl.v1beta1.AnnotationSpec} [response] AnnotationSpec + */ + + /** + * Calls GetAnnotationSpec. + * @function getAnnotationSpec + * @memberof google.cloud.automl.v1beta1.AutoMl + * @instance + * @param {google.cloud.automl.v1beta1.IGetAnnotationSpecRequest} request GetAnnotationSpecRequest message or plain object + * @param {google.cloud.automl.v1beta1.AutoMl.GetAnnotationSpecCallback} callback Node-style callback called with the error, if any, and AnnotationSpec + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(AutoMl.prototype.getAnnotationSpec = function getAnnotationSpec(request, callback) { + return this.rpcCall(getAnnotationSpec, $root.google.cloud.automl.v1beta1.GetAnnotationSpecRequest, $root.google.cloud.automl.v1beta1.AnnotationSpec, request, callback); + }, "name", { value: "GetAnnotationSpec" }); + + /** + * Calls GetAnnotationSpec. + * @function getAnnotationSpec + * @memberof google.cloud.automl.v1beta1.AutoMl + * @instance + * @param {google.cloud.automl.v1beta1.IGetAnnotationSpecRequest} request GetAnnotationSpecRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.automl.v1beta1.AutoMl|getTableSpec}. + * @memberof google.cloud.automl.v1beta1.AutoMl + * @typedef GetTableSpecCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.automl.v1beta1.TableSpec} [response] TableSpec + */ + + /** + * Calls GetTableSpec. + * @function getTableSpec + * @memberof google.cloud.automl.v1beta1.AutoMl + * @instance + * @param {google.cloud.automl.v1beta1.IGetTableSpecRequest} request GetTableSpecRequest message or plain object + * @param {google.cloud.automl.v1beta1.AutoMl.GetTableSpecCallback} callback Node-style callback called with the error, if any, and TableSpec + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(AutoMl.prototype.getTableSpec = function getTableSpec(request, callback) { + return this.rpcCall(getTableSpec, $root.google.cloud.automl.v1beta1.GetTableSpecRequest, $root.google.cloud.automl.v1beta1.TableSpec, request, callback); + }, "name", { value: "GetTableSpec" }); + + /** + * Calls GetTableSpec. + * @function getTableSpec + * @memberof google.cloud.automl.v1beta1.AutoMl + * @instance + * @param {google.cloud.automl.v1beta1.IGetTableSpecRequest} request GetTableSpecRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.automl.v1beta1.AutoMl|listTableSpecs}. + * @memberof google.cloud.automl.v1beta1.AutoMl + * @typedef ListTableSpecsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.automl.v1beta1.ListTableSpecsResponse} [response] ListTableSpecsResponse + */ + + /** + * Calls ListTableSpecs. + * @function listTableSpecs + * @memberof google.cloud.automl.v1beta1.AutoMl + * @instance + * @param {google.cloud.automl.v1beta1.IListTableSpecsRequest} request ListTableSpecsRequest message or plain object + * @param {google.cloud.automl.v1beta1.AutoMl.ListTableSpecsCallback} callback Node-style callback called with the error, if any, and ListTableSpecsResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(AutoMl.prototype.listTableSpecs = function listTableSpecs(request, callback) { + return this.rpcCall(listTableSpecs, $root.google.cloud.automl.v1beta1.ListTableSpecsRequest, $root.google.cloud.automl.v1beta1.ListTableSpecsResponse, request, callback); + }, "name", { value: "ListTableSpecs" }); + + /** + * Calls ListTableSpecs. + * @function listTableSpecs + * @memberof google.cloud.automl.v1beta1.AutoMl + * @instance + * @param {google.cloud.automl.v1beta1.IListTableSpecsRequest} request ListTableSpecsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.automl.v1beta1.AutoMl|updateTableSpec}. + * @memberof google.cloud.automl.v1beta1.AutoMl + * @typedef UpdateTableSpecCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.automl.v1beta1.TableSpec} [response] TableSpec + */ + + /** + * Calls UpdateTableSpec. + * @function updateTableSpec + * @memberof google.cloud.automl.v1beta1.AutoMl + * @instance + * @param {google.cloud.automl.v1beta1.IUpdateTableSpecRequest} request UpdateTableSpecRequest message or plain object + * @param {google.cloud.automl.v1beta1.AutoMl.UpdateTableSpecCallback} callback Node-style callback called with the error, if any, and TableSpec + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(AutoMl.prototype.updateTableSpec = function updateTableSpec(request, callback) { + return this.rpcCall(updateTableSpec, $root.google.cloud.automl.v1beta1.UpdateTableSpecRequest, $root.google.cloud.automl.v1beta1.TableSpec, request, callback); + }, "name", { value: "UpdateTableSpec" }); + + /** + * Calls UpdateTableSpec. + * @function updateTableSpec + * @memberof google.cloud.automl.v1beta1.AutoMl + * @instance + * @param {google.cloud.automl.v1beta1.IUpdateTableSpecRequest} request UpdateTableSpecRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.automl.v1beta1.AutoMl|getColumnSpec}. + * @memberof google.cloud.automl.v1beta1.AutoMl + * @typedef GetColumnSpecCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.automl.v1beta1.ColumnSpec} [response] ColumnSpec + */ + + /** + * Calls GetColumnSpec. + * @function getColumnSpec + * @memberof google.cloud.automl.v1beta1.AutoMl + * @instance + * @param {google.cloud.automl.v1beta1.IGetColumnSpecRequest} request GetColumnSpecRequest message or plain object + * @param {google.cloud.automl.v1beta1.AutoMl.GetColumnSpecCallback} callback Node-style callback called with the error, if any, and ColumnSpec + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(AutoMl.prototype.getColumnSpec = function getColumnSpec(request, callback) { + return this.rpcCall(getColumnSpec, $root.google.cloud.automl.v1beta1.GetColumnSpecRequest, $root.google.cloud.automl.v1beta1.ColumnSpec, request, callback); + }, "name", { value: "GetColumnSpec" }); + + /** + * Calls GetColumnSpec. + * @function getColumnSpec + * @memberof google.cloud.automl.v1beta1.AutoMl + * @instance + * @param {google.cloud.automl.v1beta1.IGetColumnSpecRequest} request GetColumnSpecRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.automl.v1beta1.AutoMl|listColumnSpecs}. + * @memberof google.cloud.automl.v1beta1.AutoMl + * @typedef ListColumnSpecsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.automl.v1beta1.ListColumnSpecsResponse} [response] ListColumnSpecsResponse + */ + + /** + * Calls ListColumnSpecs. + * @function listColumnSpecs + * @memberof google.cloud.automl.v1beta1.AutoMl + * @instance + * @param {google.cloud.automl.v1beta1.IListColumnSpecsRequest} request ListColumnSpecsRequest message or plain object + * @param {google.cloud.automl.v1beta1.AutoMl.ListColumnSpecsCallback} callback Node-style callback called with the error, if any, and ListColumnSpecsResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(AutoMl.prototype.listColumnSpecs = function listColumnSpecs(request, callback) { + return this.rpcCall(listColumnSpecs, $root.google.cloud.automl.v1beta1.ListColumnSpecsRequest, $root.google.cloud.automl.v1beta1.ListColumnSpecsResponse, request, callback); + }, "name", { value: "ListColumnSpecs" }); + + /** + * Calls ListColumnSpecs. + * @function listColumnSpecs + * @memberof google.cloud.automl.v1beta1.AutoMl + * @instance + * @param {google.cloud.automl.v1beta1.IListColumnSpecsRequest} request ListColumnSpecsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.automl.v1beta1.AutoMl|updateColumnSpec}. + * @memberof google.cloud.automl.v1beta1.AutoMl + * @typedef UpdateColumnSpecCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.automl.v1beta1.ColumnSpec} [response] ColumnSpec + */ + + /** + * Calls UpdateColumnSpec. + * @function updateColumnSpec + * @memberof google.cloud.automl.v1beta1.AutoMl + * @instance + * @param {google.cloud.automl.v1beta1.IUpdateColumnSpecRequest} request UpdateColumnSpecRequest message or plain object + * @param {google.cloud.automl.v1beta1.AutoMl.UpdateColumnSpecCallback} callback Node-style callback called with the error, if any, and ColumnSpec + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(AutoMl.prototype.updateColumnSpec = function updateColumnSpec(request, callback) { + return this.rpcCall(updateColumnSpec, $root.google.cloud.automl.v1beta1.UpdateColumnSpecRequest, $root.google.cloud.automl.v1beta1.ColumnSpec, request, callback); + }, "name", { value: "UpdateColumnSpec" }); + + /** + * Calls UpdateColumnSpec. + * @function updateColumnSpec + * @memberof google.cloud.automl.v1beta1.AutoMl + * @instance + * @param {google.cloud.automl.v1beta1.IUpdateColumnSpecRequest} request UpdateColumnSpecRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.automl.v1beta1.AutoMl|createModel}. + * @memberof google.cloud.automl.v1beta1.AutoMl + * @typedef CreateModelCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls CreateModel. + * @function createModel + * @memberof google.cloud.automl.v1beta1.AutoMl + * @instance + * @param {google.cloud.automl.v1beta1.ICreateModelRequest} request CreateModelRequest message or plain object + * @param {google.cloud.automl.v1beta1.AutoMl.CreateModelCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(AutoMl.prototype.createModel = function createModel(request, callback) { + return this.rpcCall(createModel, $root.google.cloud.automl.v1beta1.CreateModelRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "CreateModel" }); + + /** + * Calls CreateModel. + * @function createModel + * @memberof google.cloud.automl.v1beta1.AutoMl + * @instance + * @param {google.cloud.automl.v1beta1.ICreateModelRequest} request CreateModelRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.automl.v1beta1.AutoMl|getModel}. + * @memberof google.cloud.automl.v1beta1.AutoMl + * @typedef GetModelCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.automl.v1beta1.Model} [response] Model + */ + + /** + * Calls GetModel. + * @function getModel + * @memberof google.cloud.automl.v1beta1.AutoMl + * @instance + * @param {google.cloud.automl.v1beta1.IGetModelRequest} request GetModelRequest message or plain object + * @param {google.cloud.automl.v1beta1.AutoMl.GetModelCallback} callback Node-style callback called with the error, if any, and Model + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(AutoMl.prototype.getModel = function getModel(request, callback) { + return this.rpcCall(getModel, $root.google.cloud.automl.v1beta1.GetModelRequest, $root.google.cloud.automl.v1beta1.Model, request, callback); + }, "name", { value: "GetModel" }); + + /** + * Calls GetModel. + * @function getModel + * @memberof google.cloud.automl.v1beta1.AutoMl + * @instance + * @param {google.cloud.automl.v1beta1.IGetModelRequest} request GetModelRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.automl.v1beta1.AutoMl|listModels}. + * @memberof google.cloud.automl.v1beta1.AutoMl + * @typedef ListModelsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.automl.v1beta1.ListModelsResponse} [response] ListModelsResponse + */ + + /** + * Calls ListModels. + * @function listModels + * @memberof google.cloud.automl.v1beta1.AutoMl + * @instance + * @param {google.cloud.automl.v1beta1.IListModelsRequest} request ListModelsRequest message or plain object + * @param {google.cloud.automl.v1beta1.AutoMl.ListModelsCallback} callback Node-style callback called with the error, if any, and ListModelsResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(AutoMl.prototype.listModels = function listModels(request, callback) { + return this.rpcCall(listModels, $root.google.cloud.automl.v1beta1.ListModelsRequest, $root.google.cloud.automl.v1beta1.ListModelsResponse, request, callback); + }, "name", { value: "ListModels" }); + + /** + * Calls ListModels. + * @function listModels + * @memberof google.cloud.automl.v1beta1.AutoMl + * @instance + * @param {google.cloud.automl.v1beta1.IListModelsRequest} request ListModelsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.automl.v1beta1.AutoMl|deleteModel}. + * @memberof google.cloud.automl.v1beta1.AutoMl + * @typedef DeleteModelCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls DeleteModel. + * @function deleteModel + * @memberof google.cloud.automl.v1beta1.AutoMl + * @instance + * @param {google.cloud.automl.v1beta1.IDeleteModelRequest} request DeleteModelRequest message or plain object + * @param {google.cloud.automl.v1beta1.AutoMl.DeleteModelCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(AutoMl.prototype.deleteModel = function deleteModel(request, callback) { + return this.rpcCall(deleteModel, $root.google.cloud.automl.v1beta1.DeleteModelRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "DeleteModel" }); + + /** + * Calls DeleteModel. + * @function deleteModel + * @memberof google.cloud.automl.v1beta1.AutoMl + * @instance + * @param {google.cloud.automl.v1beta1.IDeleteModelRequest} request DeleteModelRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.automl.v1beta1.AutoMl|deployModel}. + * @memberof google.cloud.automl.v1beta1.AutoMl + * @typedef DeployModelCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls DeployModel. + * @function deployModel + * @memberof google.cloud.automl.v1beta1.AutoMl + * @instance + * @param {google.cloud.automl.v1beta1.IDeployModelRequest} request DeployModelRequest message or plain object + * @param {google.cloud.automl.v1beta1.AutoMl.DeployModelCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(AutoMl.prototype.deployModel = function deployModel(request, callback) { + return this.rpcCall(deployModel, $root.google.cloud.automl.v1beta1.DeployModelRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "DeployModel" }); + + /** + * Calls DeployModel. + * @function deployModel + * @memberof google.cloud.automl.v1beta1.AutoMl + * @instance + * @param {google.cloud.automl.v1beta1.IDeployModelRequest} request DeployModelRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.automl.v1beta1.AutoMl|undeployModel}. + * @memberof google.cloud.automl.v1beta1.AutoMl + * @typedef UndeployModelCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls UndeployModel. + * @function undeployModel + * @memberof google.cloud.automl.v1beta1.AutoMl + * @instance + * @param {google.cloud.automl.v1beta1.IUndeployModelRequest} request UndeployModelRequest message or plain object + * @param {google.cloud.automl.v1beta1.AutoMl.UndeployModelCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(AutoMl.prototype.undeployModel = function undeployModel(request, callback) { + return this.rpcCall(undeployModel, $root.google.cloud.automl.v1beta1.UndeployModelRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "UndeployModel" }); + + /** + * Calls UndeployModel. + * @function undeployModel + * @memberof google.cloud.automl.v1beta1.AutoMl + * @instance + * @param {google.cloud.automl.v1beta1.IUndeployModelRequest} request UndeployModelRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.automl.v1beta1.AutoMl|exportModel}. + * @memberof google.cloud.automl.v1beta1.AutoMl + * @typedef ExportModelCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls ExportModel. + * @function exportModel + * @memberof google.cloud.automl.v1beta1.AutoMl + * @instance + * @param {google.cloud.automl.v1beta1.IExportModelRequest} request ExportModelRequest message or plain object + * @param {google.cloud.automl.v1beta1.AutoMl.ExportModelCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(AutoMl.prototype.exportModel = function exportModel(request, callback) { + return this.rpcCall(exportModel, $root.google.cloud.automl.v1beta1.ExportModelRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "ExportModel" }); + + /** + * Calls ExportModel. + * @function exportModel + * @memberof google.cloud.automl.v1beta1.AutoMl + * @instance + * @param {google.cloud.automl.v1beta1.IExportModelRequest} request ExportModelRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.automl.v1beta1.AutoMl|exportEvaluatedExamples}. + * @memberof google.cloud.automl.v1beta1.AutoMl + * @typedef ExportEvaluatedExamplesCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls ExportEvaluatedExamples. + * @function exportEvaluatedExamples + * @memberof google.cloud.automl.v1beta1.AutoMl + * @instance + * @param {google.cloud.automl.v1beta1.IExportEvaluatedExamplesRequest} request ExportEvaluatedExamplesRequest message or plain object + * @param {google.cloud.automl.v1beta1.AutoMl.ExportEvaluatedExamplesCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(AutoMl.prototype.exportEvaluatedExamples = function exportEvaluatedExamples(request, callback) { + return this.rpcCall(exportEvaluatedExamples, $root.google.cloud.automl.v1beta1.ExportEvaluatedExamplesRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "ExportEvaluatedExamples" }); + + /** + * Calls ExportEvaluatedExamples. + * @function exportEvaluatedExamples + * @memberof google.cloud.automl.v1beta1.AutoMl + * @instance + * @param {google.cloud.automl.v1beta1.IExportEvaluatedExamplesRequest} request ExportEvaluatedExamplesRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.automl.v1beta1.AutoMl|getModelEvaluation}. + * @memberof google.cloud.automl.v1beta1.AutoMl + * @typedef GetModelEvaluationCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.automl.v1beta1.ModelEvaluation} [response] ModelEvaluation + */ + + /** + * Calls GetModelEvaluation. + * @function getModelEvaluation + * @memberof google.cloud.automl.v1beta1.AutoMl + * @instance + * @param {google.cloud.automl.v1beta1.IGetModelEvaluationRequest} request GetModelEvaluationRequest message or plain object + * @param {google.cloud.automl.v1beta1.AutoMl.GetModelEvaluationCallback} callback Node-style callback called with the error, if any, and ModelEvaluation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(AutoMl.prototype.getModelEvaluation = function getModelEvaluation(request, callback) { + return this.rpcCall(getModelEvaluation, $root.google.cloud.automl.v1beta1.GetModelEvaluationRequest, $root.google.cloud.automl.v1beta1.ModelEvaluation, request, callback); + }, "name", { value: "GetModelEvaluation" }); + + /** + * Calls GetModelEvaluation. + * @function getModelEvaluation + * @memberof google.cloud.automl.v1beta1.AutoMl + * @instance + * @param {google.cloud.automl.v1beta1.IGetModelEvaluationRequest} request GetModelEvaluationRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.automl.v1beta1.AutoMl|listModelEvaluations}. + * @memberof google.cloud.automl.v1beta1.AutoMl + * @typedef ListModelEvaluationsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.automl.v1beta1.ListModelEvaluationsResponse} [response] ListModelEvaluationsResponse + */ + + /** + * Calls ListModelEvaluations. + * @function listModelEvaluations + * @memberof google.cloud.automl.v1beta1.AutoMl + * @instance + * @param {google.cloud.automl.v1beta1.IListModelEvaluationsRequest} request ListModelEvaluationsRequest message or plain object + * @param {google.cloud.automl.v1beta1.AutoMl.ListModelEvaluationsCallback} callback Node-style callback called with the error, if any, and ListModelEvaluationsResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(AutoMl.prototype.listModelEvaluations = function listModelEvaluations(request, callback) { + return this.rpcCall(listModelEvaluations, $root.google.cloud.automl.v1beta1.ListModelEvaluationsRequest, $root.google.cloud.automl.v1beta1.ListModelEvaluationsResponse, request, callback); + }, "name", { value: "ListModelEvaluations" }); + + /** + * Calls ListModelEvaluations. + * @function listModelEvaluations + * @memberof google.cloud.automl.v1beta1.AutoMl + * @instance + * @param {google.cloud.automl.v1beta1.IListModelEvaluationsRequest} request ListModelEvaluationsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + return AutoMl; + })(); + + v1beta1.CreateDatasetRequest = (function() { + + /** + * Properties of a CreateDatasetRequest. + * @memberof google.cloud.automl.v1beta1 + * @interface ICreateDatasetRequest + * @property {string|null} [parent] CreateDatasetRequest parent + * @property {google.cloud.automl.v1beta1.IDataset|null} [dataset] CreateDatasetRequest dataset + */ + + /** + * Constructs a new CreateDatasetRequest. + * @memberof google.cloud.automl.v1beta1 + * @classdesc Represents a CreateDatasetRequest. + * @implements ICreateDatasetRequest + * @constructor + * @param {google.cloud.automl.v1beta1.ICreateDatasetRequest=} [properties] Properties to set + */ + function CreateDatasetRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * CreateDatasetRequest parent. + * @member {string} parent + * @memberof google.cloud.automl.v1beta1.CreateDatasetRequest + * @instance + */ + CreateDatasetRequest.prototype.parent = ""; + + /** + * CreateDatasetRequest dataset. + * @member {google.cloud.automl.v1beta1.IDataset|null|undefined} dataset + * @memberof google.cloud.automl.v1beta1.CreateDatasetRequest + * @instance + */ + CreateDatasetRequest.prototype.dataset = null; + + /** + * Creates a new CreateDatasetRequest instance using the specified properties. + * @function create + * @memberof google.cloud.automl.v1beta1.CreateDatasetRequest + * @static + * @param {google.cloud.automl.v1beta1.ICreateDatasetRequest=} [properties] Properties to set + * @returns {google.cloud.automl.v1beta1.CreateDatasetRequest} CreateDatasetRequest instance + */ + CreateDatasetRequest.create = function create(properties) { + return new CreateDatasetRequest(properties); + }; + + /** + * Encodes the specified CreateDatasetRequest message. Does not implicitly {@link google.cloud.automl.v1beta1.CreateDatasetRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.automl.v1beta1.CreateDatasetRequest + * @static + * @param {google.cloud.automl.v1beta1.ICreateDatasetRequest} message CreateDatasetRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateDatasetRequest.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.dataset != null && Object.hasOwnProperty.call(message, "dataset")) + $root.google.cloud.automl.v1beta1.Dataset.encode(message.dataset, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified CreateDatasetRequest message, length delimited. Does not implicitly {@link google.cloud.automl.v1beta1.CreateDatasetRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.automl.v1beta1.CreateDatasetRequest + * @static + * @param {google.cloud.automl.v1beta1.ICreateDatasetRequest} message CreateDatasetRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateDatasetRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CreateDatasetRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.automl.v1beta1.CreateDatasetRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.automl.v1beta1.CreateDatasetRequest} CreateDatasetRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateDatasetRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.automl.v1beta1.CreateDatasetRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.dataset = $root.google.cloud.automl.v1beta1.Dataset.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CreateDatasetRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.automl.v1beta1.CreateDatasetRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.automl.v1beta1.CreateDatasetRequest} CreateDatasetRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateDatasetRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CreateDatasetRequest message. + * @function verify + * @memberof google.cloud.automl.v1beta1.CreateDatasetRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CreateDatasetRequest.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.dataset != null && message.hasOwnProperty("dataset")) { + var error = $root.google.cloud.automl.v1beta1.Dataset.verify(message.dataset); + if (error) + return "dataset." + error; + } + return null; + }; + + /** + * Creates a CreateDatasetRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.automl.v1beta1.CreateDatasetRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.automl.v1beta1.CreateDatasetRequest} CreateDatasetRequest + */ + CreateDatasetRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.automl.v1beta1.CreateDatasetRequest) + return object; + var message = new $root.google.cloud.automl.v1beta1.CreateDatasetRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.dataset != null) { + if (typeof object.dataset !== "object") + throw TypeError(".google.cloud.automl.v1beta1.CreateDatasetRequest.dataset: object expected"); + message.dataset = $root.google.cloud.automl.v1beta1.Dataset.fromObject(object.dataset); + } + return message; + }; + + /** + * Creates a plain object from a CreateDatasetRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.automl.v1beta1.CreateDatasetRequest + * @static + * @param {google.cloud.automl.v1beta1.CreateDatasetRequest} message CreateDatasetRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CreateDatasetRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.dataset = null; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.dataset != null && message.hasOwnProperty("dataset")) + object.dataset = $root.google.cloud.automl.v1beta1.Dataset.toObject(message.dataset, options); + return object; + }; + + /** + * Converts this CreateDatasetRequest to JSON. + * @function toJSON + * @memberof google.cloud.automl.v1beta1.CreateDatasetRequest + * @instance + * @returns {Object.} JSON object + */ + CreateDatasetRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CreateDatasetRequest + * @function getTypeUrl + * @memberof google.cloud.automl.v1beta1.CreateDatasetRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CreateDatasetRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.automl.v1beta1.CreateDatasetRequest"; + }; + + return CreateDatasetRequest; + })(); + + v1beta1.GetDatasetRequest = (function() { + + /** + * Properties of a GetDatasetRequest. + * @memberof google.cloud.automl.v1beta1 + * @interface IGetDatasetRequest + * @property {string|null} [name] GetDatasetRequest name + */ + + /** + * Constructs a new GetDatasetRequest. + * @memberof google.cloud.automl.v1beta1 + * @classdesc Represents a GetDatasetRequest. + * @implements IGetDatasetRequest + * @constructor + * @param {google.cloud.automl.v1beta1.IGetDatasetRequest=} [properties] Properties to set + */ + function GetDatasetRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetDatasetRequest name. + * @member {string} name + * @memberof google.cloud.automl.v1beta1.GetDatasetRequest + * @instance + */ + GetDatasetRequest.prototype.name = ""; + + /** + * Creates a new GetDatasetRequest instance using the specified properties. + * @function create + * @memberof google.cloud.automl.v1beta1.GetDatasetRequest + * @static + * @param {google.cloud.automl.v1beta1.IGetDatasetRequest=} [properties] Properties to set + * @returns {google.cloud.automl.v1beta1.GetDatasetRequest} GetDatasetRequest instance + */ + GetDatasetRequest.create = function create(properties) { + return new GetDatasetRequest(properties); + }; + + /** + * Encodes the specified GetDatasetRequest message. Does not implicitly {@link google.cloud.automl.v1beta1.GetDatasetRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.automl.v1beta1.GetDatasetRequest + * @static + * @param {google.cloud.automl.v1beta1.IGetDatasetRequest} message GetDatasetRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetDatasetRequest.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 GetDatasetRequest message, length delimited. Does not implicitly {@link google.cloud.automl.v1beta1.GetDatasetRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.automl.v1beta1.GetDatasetRequest + * @static + * @param {google.cloud.automl.v1beta1.IGetDatasetRequest} message GetDatasetRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetDatasetRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetDatasetRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.automl.v1beta1.GetDatasetRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.automl.v1beta1.GetDatasetRequest} GetDatasetRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetDatasetRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.automl.v1beta1.GetDatasetRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetDatasetRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.automl.v1beta1.GetDatasetRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.automl.v1beta1.GetDatasetRequest} GetDatasetRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetDatasetRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetDatasetRequest message. + * @function verify + * @memberof google.cloud.automl.v1beta1.GetDatasetRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetDatasetRequest.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 GetDatasetRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.automl.v1beta1.GetDatasetRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.automl.v1beta1.GetDatasetRequest} GetDatasetRequest + */ + GetDatasetRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.automl.v1beta1.GetDatasetRequest) + return object; + var message = new $root.google.cloud.automl.v1beta1.GetDatasetRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a GetDatasetRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.automl.v1beta1.GetDatasetRequest + * @static + * @param {google.cloud.automl.v1beta1.GetDatasetRequest} message GetDatasetRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetDatasetRequest.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 GetDatasetRequest to JSON. + * @function toJSON + * @memberof google.cloud.automl.v1beta1.GetDatasetRequest + * @instance + * @returns {Object.} JSON object + */ + GetDatasetRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GetDatasetRequest + * @function getTypeUrl + * @memberof google.cloud.automl.v1beta1.GetDatasetRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GetDatasetRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.automl.v1beta1.GetDatasetRequest"; + }; + + return GetDatasetRequest; + })(); + + v1beta1.ListDatasetsRequest = (function() { + + /** + * Properties of a ListDatasetsRequest. + * @memberof google.cloud.automl.v1beta1 + * @interface IListDatasetsRequest + * @property {string|null} [parent] ListDatasetsRequest parent + * @property {string|null} [filter] ListDatasetsRequest filter + * @property {number|null} [pageSize] ListDatasetsRequest pageSize + * @property {string|null} [pageToken] ListDatasetsRequest pageToken + */ + + /** + * Constructs a new ListDatasetsRequest. + * @memberof google.cloud.automl.v1beta1 + * @classdesc Represents a ListDatasetsRequest. + * @implements IListDatasetsRequest + * @constructor + * @param {google.cloud.automl.v1beta1.IListDatasetsRequest=} [properties] Properties to set + */ + function ListDatasetsRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListDatasetsRequest parent. + * @member {string} parent + * @memberof google.cloud.automl.v1beta1.ListDatasetsRequest + * @instance + */ + ListDatasetsRequest.prototype.parent = ""; + + /** + * ListDatasetsRequest filter. + * @member {string} filter + * @memberof google.cloud.automl.v1beta1.ListDatasetsRequest + * @instance + */ + ListDatasetsRequest.prototype.filter = ""; + + /** + * ListDatasetsRequest pageSize. + * @member {number} pageSize + * @memberof google.cloud.automl.v1beta1.ListDatasetsRequest + * @instance + */ + ListDatasetsRequest.prototype.pageSize = 0; + + /** + * ListDatasetsRequest pageToken. + * @member {string} pageToken + * @memberof google.cloud.automl.v1beta1.ListDatasetsRequest + * @instance + */ + ListDatasetsRequest.prototype.pageToken = ""; + + /** + * Creates a new ListDatasetsRequest instance using the specified properties. + * @function create + * @memberof google.cloud.automl.v1beta1.ListDatasetsRequest + * @static + * @param {google.cloud.automl.v1beta1.IListDatasetsRequest=} [properties] Properties to set + * @returns {google.cloud.automl.v1beta1.ListDatasetsRequest} ListDatasetsRequest instance + */ + ListDatasetsRequest.create = function create(properties) { + return new ListDatasetsRequest(properties); + }; + + /** + * Encodes the specified ListDatasetsRequest message. Does not implicitly {@link google.cloud.automl.v1beta1.ListDatasetsRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.automl.v1beta1.ListDatasetsRequest + * @static + * @param {google.cloud.automl.v1beta1.IListDatasetsRequest} message ListDatasetsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListDatasetsRequest.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.filter != null && Object.hasOwnProperty.call(message, "filter")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.filter); + if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.pageSize); + if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.pageToken); + return writer; + }; + + /** + * Encodes the specified ListDatasetsRequest message, length delimited. Does not implicitly {@link google.cloud.automl.v1beta1.ListDatasetsRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.automl.v1beta1.ListDatasetsRequest + * @static + * @param {google.cloud.automl.v1beta1.IListDatasetsRequest} message ListDatasetsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListDatasetsRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListDatasetsRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.automl.v1beta1.ListDatasetsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.automl.v1beta1.ListDatasetsRequest} ListDatasetsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListDatasetsRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.automl.v1beta1.ListDatasetsRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 3: { + message.filter = reader.string(); + break; + } + case 4: { + message.pageSize = reader.int32(); + break; + } + case 6: { + message.pageToken = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListDatasetsRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.automl.v1beta1.ListDatasetsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.automl.v1beta1.ListDatasetsRequest} ListDatasetsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListDatasetsRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListDatasetsRequest message. + * @function verify + * @memberof google.cloud.automl.v1beta1.ListDatasetsRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListDatasetsRequest.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.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 ListDatasetsRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.automl.v1beta1.ListDatasetsRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.automl.v1beta1.ListDatasetsRequest} ListDatasetsRequest + */ + ListDatasetsRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.automl.v1beta1.ListDatasetsRequest) + return object; + var message = new $root.google.cloud.automl.v1beta1.ListDatasetsRequest(); + if (object.parent != null) + message.parent = String(object.parent); + 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 ListDatasetsRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.automl.v1beta1.ListDatasetsRequest + * @static + * @param {google.cloud.automl.v1beta1.ListDatasetsRequest} message ListDatasetsRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListDatasetsRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.filter = ""; + object.pageSize = 0; + object.pageToken = ""; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + 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; + return object; + }; + + /** + * Converts this ListDatasetsRequest to JSON. + * @function toJSON + * @memberof google.cloud.automl.v1beta1.ListDatasetsRequest + * @instance + * @returns {Object.} JSON object + */ + ListDatasetsRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListDatasetsRequest + * @function getTypeUrl + * @memberof google.cloud.automl.v1beta1.ListDatasetsRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListDatasetsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.automl.v1beta1.ListDatasetsRequest"; + }; + + return ListDatasetsRequest; + })(); + + v1beta1.ListDatasetsResponse = (function() { + + /** + * Properties of a ListDatasetsResponse. + * @memberof google.cloud.automl.v1beta1 + * @interface IListDatasetsResponse + * @property {Array.|null} [datasets] ListDatasetsResponse datasets + * @property {string|null} [nextPageToken] ListDatasetsResponse nextPageToken + */ + + /** + * Constructs a new ListDatasetsResponse. + * @memberof google.cloud.automl.v1beta1 + * @classdesc Represents a ListDatasetsResponse. + * @implements IListDatasetsResponse + * @constructor + * @param {google.cloud.automl.v1beta1.IListDatasetsResponse=} [properties] Properties to set + */ + function ListDatasetsResponse(properties) { + this.datasets = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListDatasetsResponse datasets. + * @member {Array.} datasets + * @memberof google.cloud.automl.v1beta1.ListDatasetsResponse + * @instance + */ + ListDatasetsResponse.prototype.datasets = $util.emptyArray; + + /** + * ListDatasetsResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.cloud.automl.v1beta1.ListDatasetsResponse + * @instance + */ + ListDatasetsResponse.prototype.nextPageToken = ""; + + /** + * Creates a new ListDatasetsResponse instance using the specified properties. + * @function create + * @memberof google.cloud.automl.v1beta1.ListDatasetsResponse + * @static + * @param {google.cloud.automl.v1beta1.IListDatasetsResponse=} [properties] Properties to set + * @returns {google.cloud.automl.v1beta1.ListDatasetsResponse} ListDatasetsResponse instance + */ + ListDatasetsResponse.create = function create(properties) { + return new ListDatasetsResponse(properties); + }; + + /** + * Encodes the specified ListDatasetsResponse message. Does not implicitly {@link google.cloud.automl.v1beta1.ListDatasetsResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.automl.v1beta1.ListDatasetsResponse + * @static + * @param {google.cloud.automl.v1beta1.IListDatasetsResponse} message ListDatasetsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListDatasetsResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.datasets != null && message.datasets.length) + for (var i = 0; i < message.datasets.length; ++i) + $root.google.cloud.automl.v1beta1.Dataset.encode(message.datasets[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 ListDatasetsResponse message, length delimited. Does not implicitly {@link google.cloud.automl.v1beta1.ListDatasetsResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.automl.v1beta1.ListDatasetsResponse + * @static + * @param {google.cloud.automl.v1beta1.IListDatasetsResponse} message ListDatasetsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListDatasetsResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListDatasetsResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.automl.v1beta1.ListDatasetsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.automl.v1beta1.ListDatasetsResponse} ListDatasetsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListDatasetsResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.automl.v1beta1.ListDatasetsResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.datasets && message.datasets.length)) + message.datasets = []; + message.datasets.push($root.google.cloud.automl.v1beta1.Dataset.decode(reader, reader.uint32())); + break; + } + case 2: { + message.nextPageToken = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListDatasetsResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.automl.v1beta1.ListDatasetsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.automl.v1beta1.ListDatasetsResponse} ListDatasetsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListDatasetsResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListDatasetsResponse message. + * @function verify + * @memberof google.cloud.automl.v1beta1.ListDatasetsResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListDatasetsResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.datasets != null && message.hasOwnProperty("datasets")) { + if (!Array.isArray(message.datasets)) + return "datasets: array expected"; + for (var i = 0; i < message.datasets.length; ++i) { + var error = $root.google.cloud.automl.v1beta1.Dataset.verify(message.datasets[i]); + if (error) + return "datasets." + error; + } + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + return null; + }; + + /** + * Creates a ListDatasetsResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.automl.v1beta1.ListDatasetsResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.automl.v1beta1.ListDatasetsResponse} ListDatasetsResponse + */ + ListDatasetsResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.automl.v1beta1.ListDatasetsResponse) + return object; + var message = new $root.google.cloud.automl.v1beta1.ListDatasetsResponse(); + if (object.datasets) { + if (!Array.isArray(object.datasets)) + throw TypeError(".google.cloud.automl.v1beta1.ListDatasetsResponse.datasets: array expected"); + message.datasets = []; + for (var i = 0; i < object.datasets.length; ++i) { + if (typeof object.datasets[i] !== "object") + throw TypeError(".google.cloud.automl.v1beta1.ListDatasetsResponse.datasets: object expected"); + message.datasets[i] = $root.google.cloud.automl.v1beta1.Dataset.fromObject(object.datasets[i]); + } + } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + return message; + }; + + /** + * Creates a plain object from a ListDatasetsResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.automl.v1beta1.ListDatasetsResponse + * @static + * @param {google.cloud.automl.v1beta1.ListDatasetsResponse} message ListDatasetsResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListDatasetsResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.datasets = []; + if (options.defaults) + object.nextPageToken = ""; + if (message.datasets && message.datasets.length) { + object.datasets = []; + for (var j = 0; j < message.datasets.length; ++j) + object.datasets[j] = $root.google.cloud.automl.v1beta1.Dataset.toObject(message.datasets[j], options); + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + object.nextPageToken = message.nextPageToken; + return object; + }; + + /** + * Converts this ListDatasetsResponse to JSON. + * @function toJSON + * @memberof google.cloud.automl.v1beta1.ListDatasetsResponse + * @instance + * @returns {Object.} JSON object + */ + ListDatasetsResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListDatasetsResponse + * @function getTypeUrl + * @memberof google.cloud.automl.v1beta1.ListDatasetsResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListDatasetsResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.automl.v1beta1.ListDatasetsResponse"; + }; + + return ListDatasetsResponse; + })(); + + v1beta1.UpdateDatasetRequest = (function() { + + /** + * Properties of an UpdateDatasetRequest. + * @memberof google.cloud.automl.v1beta1 + * @interface IUpdateDatasetRequest + * @property {google.cloud.automl.v1beta1.IDataset|null} [dataset] UpdateDatasetRequest dataset + * @property {google.protobuf.IFieldMask|null} [updateMask] UpdateDatasetRequest updateMask + */ + + /** + * Constructs a new UpdateDatasetRequest. + * @memberof google.cloud.automl.v1beta1 + * @classdesc Represents an UpdateDatasetRequest. + * @implements IUpdateDatasetRequest + * @constructor + * @param {google.cloud.automl.v1beta1.IUpdateDatasetRequest=} [properties] Properties to set + */ + function UpdateDatasetRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * UpdateDatasetRequest dataset. + * @member {google.cloud.automl.v1beta1.IDataset|null|undefined} dataset + * @memberof google.cloud.automl.v1beta1.UpdateDatasetRequest + * @instance + */ + UpdateDatasetRequest.prototype.dataset = null; + + /** + * UpdateDatasetRequest updateMask. + * @member {google.protobuf.IFieldMask|null|undefined} updateMask + * @memberof google.cloud.automl.v1beta1.UpdateDatasetRequest + * @instance + */ + UpdateDatasetRequest.prototype.updateMask = null; + + /** + * Creates a new UpdateDatasetRequest instance using the specified properties. + * @function create + * @memberof google.cloud.automl.v1beta1.UpdateDatasetRequest + * @static + * @param {google.cloud.automl.v1beta1.IUpdateDatasetRequest=} [properties] Properties to set + * @returns {google.cloud.automl.v1beta1.UpdateDatasetRequest} UpdateDatasetRequest instance + */ + UpdateDatasetRequest.create = function create(properties) { + return new UpdateDatasetRequest(properties); + }; + + /** + * Encodes the specified UpdateDatasetRequest message. Does not implicitly {@link google.cloud.automl.v1beta1.UpdateDatasetRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.automl.v1beta1.UpdateDatasetRequest + * @static + * @param {google.cloud.automl.v1beta1.IUpdateDatasetRequest} message UpdateDatasetRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateDatasetRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.dataset != null && Object.hasOwnProperty.call(message, "dataset")) + $root.google.cloud.automl.v1beta1.Dataset.encode(message.dataset, 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 UpdateDatasetRequest message, length delimited. Does not implicitly {@link google.cloud.automl.v1beta1.UpdateDatasetRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.automl.v1beta1.UpdateDatasetRequest + * @static + * @param {google.cloud.automl.v1beta1.IUpdateDatasetRequest} message UpdateDatasetRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateDatasetRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an UpdateDatasetRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.automl.v1beta1.UpdateDatasetRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.automl.v1beta1.UpdateDatasetRequest} UpdateDatasetRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateDatasetRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.automl.v1beta1.UpdateDatasetRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.dataset = $root.google.cloud.automl.v1beta1.Dataset.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 UpdateDatasetRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.automl.v1beta1.UpdateDatasetRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.automl.v1beta1.UpdateDatasetRequest} UpdateDatasetRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateDatasetRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an UpdateDatasetRequest message. + * @function verify + * @memberof google.cloud.automl.v1beta1.UpdateDatasetRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + UpdateDatasetRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.dataset != null && message.hasOwnProperty("dataset")) { + var error = $root.google.cloud.automl.v1beta1.Dataset.verify(message.dataset); + if (error) + return "dataset." + 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 UpdateDatasetRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.automl.v1beta1.UpdateDatasetRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.automl.v1beta1.UpdateDatasetRequest} UpdateDatasetRequest + */ + UpdateDatasetRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.automl.v1beta1.UpdateDatasetRequest) + return object; + var message = new $root.google.cloud.automl.v1beta1.UpdateDatasetRequest(); + if (object.dataset != null) { + if (typeof object.dataset !== "object") + throw TypeError(".google.cloud.automl.v1beta1.UpdateDatasetRequest.dataset: object expected"); + message.dataset = $root.google.cloud.automl.v1beta1.Dataset.fromObject(object.dataset); + } + if (object.updateMask != null) { + if (typeof object.updateMask !== "object") + throw TypeError(".google.cloud.automl.v1beta1.UpdateDatasetRequest.updateMask: object expected"); + message.updateMask = $root.google.protobuf.FieldMask.fromObject(object.updateMask); + } + return message; + }; + + /** + * Creates a plain object from an UpdateDatasetRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.automl.v1beta1.UpdateDatasetRequest + * @static + * @param {google.cloud.automl.v1beta1.UpdateDatasetRequest} message UpdateDatasetRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + UpdateDatasetRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.dataset = null; + object.updateMask = null; + } + if (message.dataset != null && message.hasOwnProperty("dataset")) + object.dataset = $root.google.cloud.automl.v1beta1.Dataset.toObject(message.dataset, options); + if (message.updateMask != null && message.hasOwnProperty("updateMask")) + object.updateMask = $root.google.protobuf.FieldMask.toObject(message.updateMask, options); + return object; + }; + + /** + * Converts this UpdateDatasetRequest to JSON. + * @function toJSON + * @memberof google.cloud.automl.v1beta1.UpdateDatasetRequest + * @instance + * @returns {Object.} JSON object + */ + UpdateDatasetRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for UpdateDatasetRequest + * @function getTypeUrl + * @memberof google.cloud.automl.v1beta1.UpdateDatasetRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + UpdateDatasetRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.automl.v1beta1.UpdateDatasetRequest"; + }; + + return UpdateDatasetRequest; + })(); + + v1beta1.DeleteDatasetRequest = (function() { + + /** + * Properties of a DeleteDatasetRequest. + * @memberof google.cloud.automl.v1beta1 + * @interface IDeleteDatasetRequest + * @property {string|null} [name] DeleteDatasetRequest name + */ + + /** + * Constructs a new DeleteDatasetRequest. + * @memberof google.cloud.automl.v1beta1 + * @classdesc Represents a DeleteDatasetRequest. + * @implements IDeleteDatasetRequest + * @constructor + * @param {google.cloud.automl.v1beta1.IDeleteDatasetRequest=} [properties] Properties to set + */ + function DeleteDatasetRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * DeleteDatasetRequest name. + * @member {string} name + * @memberof google.cloud.automl.v1beta1.DeleteDatasetRequest + * @instance + */ + DeleteDatasetRequest.prototype.name = ""; + + /** + * Creates a new DeleteDatasetRequest instance using the specified properties. + * @function create + * @memberof google.cloud.automl.v1beta1.DeleteDatasetRequest + * @static + * @param {google.cloud.automl.v1beta1.IDeleteDatasetRequest=} [properties] Properties to set + * @returns {google.cloud.automl.v1beta1.DeleteDatasetRequest} DeleteDatasetRequest instance + */ + DeleteDatasetRequest.create = function create(properties) { + return new DeleteDatasetRequest(properties); + }; + + /** + * Encodes the specified DeleteDatasetRequest message. Does not implicitly {@link google.cloud.automl.v1beta1.DeleteDatasetRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.automl.v1beta1.DeleteDatasetRequest + * @static + * @param {google.cloud.automl.v1beta1.IDeleteDatasetRequest} message DeleteDatasetRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteDatasetRequest.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 DeleteDatasetRequest message, length delimited. Does not implicitly {@link google.cloud.automl.v1beta1.DeleteDatasetRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.automl.v1beta1.DeleteDatasetRequest + * @static + * @param {google.cloud.automl.v1beta1.IDeleteDatasetRequest} message DeleteDatasetRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteDatasetRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DeleteDatasetRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.automl.v1beta1.DeleteDatasetRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.automl.v1beta1.DeleteDatasetRequest} DeleteDatasetRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteDatasetRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.automl.v1beta1.DeleteDatasetRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DeleteDatasetRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.automl.v1beta1.DeleteDatasetRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.automl.v1beta1.DeleteDatasetRequest} DeleteDatasetRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteDatasetRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DeleteDatasetRequest message. + * @function verify + * @memberof google.cloud.automl.v1beta1.DeleteDatasetRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DeleteDatasetRequest.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 DeleteDatasetRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.automl.v1beta1.DeleteDatasetRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.automl.v1beta1.DeleteDatasetRequest} DeleteDatasetRequest + */ + DeleteDatasetRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.automl.v1beta1.DeleteDatasetRequest) + return object; + var message = new $root.google.cloud.automl.v1beta1.DeleteDatasetRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a DeleteDatasetRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.automl.v1beta1.DeleteDatasetRequest + * @static + * @param {google.cloud.automl.v1beta1.DeleteDatasetRequest} message DeleteDatasetRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DeleteDatasetRequest.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 DeleteDatasetRequest to JSON. + * @function toJSON + * @memberof google.cloud.automl.v1beta1.DeleteDatasetRequest + * @instance + * @returns {Object.} JSON object + */ + DeleteDatasetRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DeleteDatasetRequest + * @function getTypeUrl + * @memberof google.cloud.automl.v1beta1.DeleteDatasetRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DeleteDatasetRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.automl.v1beta1.DeleteDatasetRequest"; + }; + + return DeleteDatasetRequest; + })(); + + v1beta1.ImportDataRequest = (function() { + + /** + * Properties of an ImportDataRequest. + * @memberof google.cloud.automl.v1beta1 + * @interface IImportDataRequest + * @property {string|null} [name] ImportDataRequest name + * @property {google.cloud.automl.v1beta1.IInputConfig|null} [inputConfig] ImportDataRequest inputConfig + */ + + /** + * Constructs a new ImportDataRequest. + * @memberof google.cloud.automl.v1beta1 + * @classdesc Represents an ImportDataRequest. + * @implements IImportDataRequest + * @constructor + * @param {google.cloud.automl.v1beta1.IImportDataRequest=} [properties] Properties to set + */ + function ImportDataRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ImportDataRequest name. + * @member {string} name + * @memberof google.cloud.automl.v1beta1.ImportDataRequest + * @instance + */ + ImportDataRequest.prototype.name = ""; + + /** + * ImportDataRequest inputConfig. + * @member {google.cloud.automl.v1beta1.IInputConfig|null|undefined} inputConfig + * @memberof google.cloud.automl.v1beta1.ImportDataRequest + * @instance + */ + ImportDataRequest.prototype.inputConfig = null; + + /** + * Creates a new ImportDataRequest instance using the specified properties. + * @function create + * @memberof google.cloud.automl.v1beta1.ImportDataRequest + * @static + * @param {google.cloud.automl.v1beta1.IImportDataRequest=} [properties] Properties to set + * @returns {google.cloud.automl.v1beta1.ImportDataRequest} ImportDataRequest instance + */ + ImportDataRequest.create = function create(properties) { + return new ImportDataRequest(properties); + }; + + /** + * Encodes the specified ImportDataRequest message. Does not implicitly {@link google.cloud.automl.v1beta1.ImportDataRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.automl.v1beta1.ImportDataRequest + * @static + * @param {google.cloud.automl.v1beta1.IImportDataRequest} message ImportDataRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ImportDataRequest.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.inputConfig != null && Object.hasOwnProperty.call(message, "inputConfig")) + $root.google.cloud.automl.v1beta1.InputConfig.encode(message.inputConfig, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified ImportDataRequest message, length delimited. Does not implicitly {@link google.cloud.automl.v1beta1.ImportDataRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.automl.v1beta1.ImportDataRequest + * @static + * @param {google.cloud.automl.v1beta1.IImportDataRequest} message ImportDataRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ImportDataRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an ImportDataRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.automl.v1beta1.ImportDataRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.automl.v1beta1.ImportDataRequest} ImportDataRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ImportDataRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.automl.v1beta1.ImportDataRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 3: { + message.inputConfig = $root.google.cloud.automl.v1beta1.InputConfig.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an ImportDataRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.automl.v1beta1.ImportDataRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.automl.v1beta1.ImportDataRequest} ImportDataRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ImportDataRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an ImportDataRequest message. + * @function verify + * @memberof google.cloud.automl.v1beta1.ImportDataRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ImportDataRequest.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.inputConfig != null && message.hasOwnProperty("inputConfig")) { + var error = $root.google.cloud.automl.v1beta1.InputConfig.verify(message.inputConfig); + if (error) + return "inputConfig." + error; + } + return null; + }; + + /** + * Creates an ImportDataRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.automl.v1beta1.ImportDataRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.automl.v1beta1.ImportDataRequest} ImportDataRequest + */ + ImportDataRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.automl.v1beta1.ImportDataRequest) + return object; + var message = new $root.google.cloud.automl.v1beta1.ImportDataRequest(); + if (object.name != null) + message.name = String(object.name); + if (object.inputConfig != null) { + if (typeof object.inputConfig !== "object") + throw TypeError(".google.cloud.automl.v1beta1.ImportDataRequest.inputConfig: object expected"); + message.inputConfig = $root.google.cloud.automl.v1beta1.InputConfig.fromObject(object.inputConfig); + } + return message; + }; + + /** + * Creates a plain object from an ImportDataRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.automl.v1beta1.ImportDataRequest + * @static + * @param {google.cloud.automl.v1beta1.ImportDataRequest} message ImportDataRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ImportDataRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.inputConfig = null; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.inputConfig != null && message.hasOwnProperty("inputConfig")) + object.inputConfig = $root.google.cloud.automl.v1beta1.InputConfig.toObject(message.inputConfig, options); + return object; + }; + + /** + * Converts this ImportDataRequest to JSON. + * @function toJSON + * @memberof google.cloud.automl.v1beta1.ImportDataRequest + * @instance + * @returns {Object.} JSON object + */ + ImportDataRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ImportDataRequest + * @function getTypeUrl + * @memberof google.cloud.automl.v1beta1.ImportDataRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ImportDataRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.automl.v1beta1.ImportDataRequest"; + }; + + return ImportDataRequest; + })(); + + v1beta1.ExportDataRequest = (function() { + + /** + * Properties of an ExportDataRequest. + * @memberof google.cloud.automl.v1beta1 + * @interface IExportDataRequest + * @property {string|null} [name] ExportDataRequest name + * @property {google.cloud.automl.v1beta1.IOutputConfig|null} [outputConfig] ExportDataRequest outputConfig + */ + + /** + * Constructs a new ExportDataRequest. + * @memberof google.cloud.automl.v1beta1 + * @classdesc Represents an ExportDataRequest. + * @implements IExportDataRequest + * @constructor + * @param {google.cloud.automl.v1beta1.IExportDataRequest=} [properties] Properties to set + */ + function ExportDataRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ExportDataRequest name. + * @member {string} name + * @memberof google.cloud.automl.v1beta1.ExportDataRequest + * @instance + */ + ExportDataRequest.prototype.name = ""; + + /** + * ExportDataRequest outputConfig. + * @member {google.cloud.automl.v1beta1.IOutputConfig|null|undefined} outputConfig + * @memberof google.cloud.automl.v1beta1.ExportDataRequest + * @instance + */ + ExportDataRequest.prototype.outputConfig = null; + + /** + * Creates a new ExportDataRequest instance using the specified properties. + * @function create + * @memberof google.cloud.automl.v1beta1.ExportDataRequest + * @static + * @param {google.cloud.automl.v1beta1.IExportDataRequest=} [properties] Properties to set + * @returns {google.cloud.automl.v1beta1.ExportDataRequest} ExportDataRequest instance + */ + ExportDataRequest.create = function create(properties) { + return new ExportDataRequest(properties); + }; + + /** + * Encodes the specified ExportDataRequest message. Does not implicitly {@link google.cloud.automl.v1beta1.ExportDataRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.automl.v1beta1.ExportDataRequest + * @static + * @param {google.cloud.automl.v1beta1.IExportDataRequest} message ExportDataRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ExportDataRequest.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.outputConfig != null && Object.hasOwnProperty.call(message, "outputConfig")) + $root.google.cloud.automl.v1beta1.OutputConfig.encode(message.outputConfig, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified ExportDataRequest message, length delimited. Does not implicitly {@link google.cloud.automl.v1beta1.ExportDataRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.automl.v1beta1.ExportDataRequest + * @static + * @param {google.cloud.automl.v1beta1.IExportDataRequest} message ExportDataRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ExportDataRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an ExportDataRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.automl.v1beta1.ExportDataRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.automl.v1beta1.ExportDataRequest} ExportDataRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ExportDataRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.automl.v1beta1.ExportDataRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 3: { + message.outputConfig = $root.google.cloud.automl.v1beta1.OutputConfig.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an ExportDataRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.automl.v1beta1.ExportDataRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.automl.v1beta1.ExportDataRequest} ExportDataRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ExportDataRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an ExportDataRequest message. + * @function verify + * @memberof google.cloud.automl.v1beta1.ExportDataRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ExportDataRequest.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.outputConfig != null && message.hasOwnProperty("outputConfig")) { + var error = $root.google.cloud.automl.v1beta1.OutputConfig.verify(message.outputConfig); + if (error) + return "outputConfig." + error; + } + return null; + }; + + /** + * Creates an ExportDataRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.automl.v1beta1.ExportDataRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.automl.v1beta1.ExportDataRequest} ExportDataRequest + */ + ExportDataRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.automl.v1beta1.ExportDataRequest) + return object; + var message = new $root.google.cloud.automl.v1beta1.ExportDataRequest(); + if (object.name != null) + message.name = String(object.name); + if (object.outputConfig != null) { + if (typeof object.outputConfig !== "object") + throw TypeError(".google.cloud.automl.v1beta1.ExportDataRequest.outputConfig: object expected"); + message.outputConfig = $root.google.cloud.automl.v1beta1.OutputConfig.fromObject(object.outputConfig); + } + return message; + }; + + /** + * Creates a plain object from an ExportDataRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.automl.v1beta1.ExportDataRequest + * @static + * @param {google.cloud.automl.v1beta1.ExportDataRequest} message ExportDataRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ExportDataRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.outputConfig = null; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.outputConfig != null && message.hasOwnProperty("outputConfig")) + object.outputConfig = $root.google.cloud.automl.v1beta1.OutputConfig.toObject(message.outputConfig, options); + return object; + }; + + /** + * Converts this ExportDataRequest to JSON. + * @function toJSON + * @memberof google.cloud.automl.v1beta1.ExportDataRequest + * @instance + * @returns {Object.} JSON object + */ + ExportDataRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ExportDataRequest + * @function getTypeUrl + * @memberof google.cloud.automl.v1beta1.ExportDataRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ExportDataRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.automl.v1beta1.ExportDataRequest"; + }; + + return ExportDataRequest; + })(); + + v1beta1.GetAnnotationSpecRequest = (function() { + + /** + * Properties of a GetAnnotationSpecRequest. + * @memberof google.cloud.automl.v1beta1 + * @interface IGetAnnotationSpecRequest + * @property {string|null} [name] GetAnnotationSpecRequest name + */ + + /** + * Constructs a new GetAnnotationSpecRequest. + * @memberof google.cloud.automl.v1beta1 + * @classdesc Represents a GetAnnotationSpecRequest. + * @implements IGetAnnotationSpecRequest + * @constructor + * @param {google.cloud.automl.v1beta1.IGetAnnotationSpecRequest=} [properties] Properties to set + */ + function GetAnnotationSpecRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetAnnotationSpecRequest name. + * @member {string} name + * @memberof google.cloud.automl.v1beta1.GetAnnotationSpecRequest + * @instance + */ + GetAnnotationSpecRequest.prototype.name = ""; + + /** + * Creates a new GetAnnotationSpecRequest instance using the specified properties. + * @function create + * @memberof google.cloud.automl.v1beta1.GetAnnotationSpecRequest + * @static + * @param {google.cloud.automl.v1beta1.IGetAnnotationSpecRequest=} [properties] Properties to set + * @returns {google.cloud.automl.v1beta1.GetAnnotationSpecRequest} GetAnnotationSpecRequest instance + */ + GetAnnotationSpecRequest.create = function create(properties) { + return new GetAnnotationSpecRequest(properties); + }; + + /** + * Encodes the specified GetAnnotationSpecRequest message. Does not implicitly {@link google.cloud.automl.v1beta1.GetAnnotationSpecRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.automl.v1beta1.GetAnnotationSpecRequest + * @static + * @param {google.cloud.automl.v1beta1.IGetAnnotationSpecRequest} message GetAnnotationSpecRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetAnnotationSpecRequest.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 GetAnnotationSpecRequest message, length delimited. Does not implicitly {@link google.cloud.automl.v1beta1.GetAnnotationSpecRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.automl.v1beta1.GetAnnotationSpecRequest + * @static + * @param {google.cloud.automl.v1beta1.IGetAnnotationSpecRequest} message GetAnnotationSpecRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetAnnotationSpecRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetAnnotationSpecRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.automl.v1beta1.GetAnnotationSpecRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.automl.v1beta1.GetAnnotationSpecRequest} GetAnnotationSpecRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetAnnotationSpecRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.automl.v1beta1.GetAnnotationSpecRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetAnnotationSpecRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.automl.v1beta1.GetAnnotationSpecRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.automl.v1beta1.GetAnnotationSpecRequest} GetAnnotationSpecRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetAnnotationSpecRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetAnnotationSpecRequest message. + * @function verify + * @memberof google.cloud.automl.v1beta1.GetAnnotationSpecRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetAnnotationSpecRequest.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 GetAnnotationSpecRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.automl.v1beta1.GetAnnotationSpecRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.automl.v1beta1.GetAnnotationSpecRequest} GetAnnotationSpecRequest + */ + GetAnnotationSpecRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.automl.v1beta1.GetAnnotationSpecRequest) + return object; + var message = new $root.google.cloud.automl.v1beta1.GetAnnotationSpecRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a GetAnnotationSpecRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.automl.v1beta1.GetAnnotationSpecRequest + * @static + * @param {google.cloud.automl.v1beta1.GetAnnotationSpecRequest} message GetAnnotationSpecRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetAnnotationSpecRequest.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 GetAnnotationSpecRequest to JSON. + * @function toJSON + * @memberof google.cloud.automl.v1beta1.GetAnnotationSpecRequest + * @instance + * @returns {Object.} JSON object + */ + GetAnnotationSpecRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GetAnnotationSpecRequest + * @function getTypeUrl + * @memberof google.cloud.automl.v1beta1.GetAnnotationSpecRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GetAnnotationSpecRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.automl.v1beta1.GetAnnotationSpecRequest"; + }; + + return GetAnnotationSpecRequest; + })(); + + v1beta1.GetTableSpecRequest = (function() { + + /** + * Properties of a GetTableSpecRequest. + * @memberof google.cloud.automl.v1beta1 + * @interface IGetTableSpecRequest + * @property {string|null} [name] GetTableSpecRequest name + * @property {google.protobuf.IFieldMask|null} [fieldMask] GetTableSpecRequest fieldMask + */ + + /** + * Constructs a new GetTableSpecRequest. + * @memberof google.cloud.automl.v1beta1 + * @classdesc Represents a GetTableSpecRequest. + * @implements IGetTableSpecRequest + * @constructor + * @param {google.cloud.automl.v1beta1.IGetTableSpecRequest=} [properties] Properties to set + */ + function GetTableSpecRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetTableSpecRequest name. + * @member {string} name + * @memberof google.cloud.automl.v1beta1.GetTableSpecRequest + * @instance + */ + GetTableSpecRequest.prototype.name = ""; + + /** + * GetTableSpecRequest fieldMask. + * @member {google.protobuf.IFieldMask|null|undefined} fieldMask + * @memberof google.cloud.automl.v1beta1.GetTableSpecRequest + * @instance + */ + GetTableSpecRequest.prototype.fieldMask = null; + + /** + * Creates a new GetTableSpecRequest instance using the specified properties. + * @function create + * @memberof google.cloud.automl.v1beta1.GetTableSpecRequest + * @static + * @param {google.cloud.automl.v1beta1.IGetTableSpecRequest=} [properties] Properties to set + * @returns {google.cloud.automl.v1beta1.GetTableSpecRequest} GetTableSpecRequest instance + */ + GetTableSpecRequest.create = function create(properties) { + return new GetTableSpecRequest(properties); + }; + + /** + * Encodes the specified GetTableSpecRequest message. Does not implicitly {@link google.cloud.automl.v1beta1.GetTableSpecRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.automl.v1beta1.GetTableSpecRequest + * @static + * @param {google.cloud.automl.v1beta1.IGetTableSpecRequest} message GetTableSpecRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetTableSpecRequest.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.fieldMask != null && Object.hasOwnProperty.call(message, "fieldMask")) + $root.google.protobuf.FieldMask.encode(message.fieldMask, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified GetTableSpecRequest message, length delimited. Does not implicitly {@link google.cloud.automl.v1beta1.GetTableSpecRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.automl.v1beta1.GetTableSpecRequest + * @static + * @param {google.cloud.automl.v1beta1.IGetTableSpecRequest} message GetTableSpecRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetTableSpecRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetTableSpecRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.automl.v1beta1.GetTableSpecRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.automl.v1beta1.GetTableSpecRequest} GetTableSpecRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetTableSpecRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.automl.v1beta1.GetTableSpecRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.fieldMask = $root.google.protobuf.FieldMask.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetTableSpecRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.automl.v1beta1.GetTableSpecRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.automl.v1beta1.GetTableSpecRequest} GetTableSpecRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetTableSpecRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetTableSpecRequest message. + * @function verify + * @memberof google.cloud.automl.v1beta1.GetTableSpecRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetTableSpecRequest.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.fieldMask != null && message.hasOwnProperty("fieldMask")) { + var error = $root.google.protobuf.FieldMask.verify(message.fieldMask); + if (error) + return "fieldMask." + error; + } + return null; + }; + + /** + * Creates a GetTableSpecRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.automl.v1beta1.GetTableSpecRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.automl.v1beta1.GetTableSpecRequest} GetTableSpecRequest + */ + GetTableSpecRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.automl.v1beta1.GetTableSpecRequest) + return object; + var message = new $root.google.cloud.automl.v1beta1.GetTableSpecRequest(); + if (object.name != null) + message.name = String(object.name); + if (object.fieldMask != null) { + if (typeof object.fieldMask !== "object") + throw TypeError(".google.cloud.automl.v1beta1.GetTableSpecRequest.fieldMask: object expected"); + message.fieldMask = $root.google.protobuf.FieldMask.fromObject(object.fieldMask); + } + return message; + }; + + /** + * Creates a plain object from a GetTableSpecRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.automl.v1beta1.GetTableSpecRequest + * @static + * @param {google.cloud.automl.v1beta1.GetTableSpecRequest} message GetTableSpecRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetTableSpecRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.fieldMask = null; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.fieldMask != null && message.hasOwnProperty("fieldMask")) + object.fieldMask = $root.google.protobuf.FieldMask.toObject(message.fieldMask, options); + return object; + }; + + /** + * Converts this GetTableSpecRequest to JSON. + * @function toJSON + * @memberof google.cloud.automl.v1beta1.GetTableSpecRequest + * @instance + * @returns {Object.} JSON object + */ + GetTableSpecRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GetTableSpecRequest + * @function getTypeUrl + * @memberof google.cloud.automl.v1beta1.GetTableSpecRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GetTableSpecRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.automl.v1beta1.GetTableSpecRequest"; + }; + + return GetTableSpecRequest; + })(); + + v1beta1.ListTableSpecsRequest = (function() { + + /** + * Properties of a ListTableSpecsRequest. + * @memberof google.cloud.automl.v1beta1 + * @interface IListTableSpecsRequest + * @property {string|null} [parent] ListTableSpecsRequest parent + * @property {google.protobuf.IFieldMask|null} [fieldMask] ListTableSpecsRequest fieldMask + * @property {string|null} [filter] ListTableSpecsRequest filter + * @property {number|null} [pageSize] ListTableSpecsRequest pageSize + * @property {string|null} [pageToken] ListTableSpecsRequest pageToken + */ + + /** + * Constructs a new ListTableSpecsRequest. + * @memberof google.cloud.automl.v1beta1 + * @classdesc Represents a ListTableSpecsRequest. + * @implements IListTableSpecsRequest + * @constructor + * @param {google.cloud.automl.v1beta1.IListTableSpecsRequest=} [properties] Properties to set + */ + function ListTableSpecsRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListTableSpecsRequest parent. + * @member {string} parent + * @memberof google.cloud.automl.v1beta1.ListTableSpecsRequest + * @instance + */ + ListTableSpecsRequest.prototype.parent = ""; + + /** + * ListTableSpecsRequest fieldMask. + * @member {google.protobuf.IFieldMask|null|undefined} fieldMask + * @memberof google.cloud.automl.v1beta1.ListTableSpecsRequest + * @instance + */ + ListTableSpecsRequest.prototype.fieldMask = null; + + /** + * ListTableSpecsRequest filter. + * @member {string} filter + * @memberof google.cloud.automl.v1beta1.ListTableSpecsRequest + * @instance + */ + ListTableSpecsRequest.prototype.filter = ""; + + /** + * ListTableSpecsRequest pageSize. + * @member {number} pageSize + * @memberof google.cloud.automl.v1beta1.ListTableSpecsRequest + * @instance + */ + ListTableSpecsRequest.prototype.pageSize = 0; + + /** + * ListTableSpecsRequest pageToken. + * @member {string} pageToken + * @memberof google.cloud.automl.v1beta1.ListTableSpecsRequest + * @instance + */ + ListTableSpecsRequest.prototype.pageToken = ""; + + /** + * Creates a new ListTableSpecsRequest instance using the specified properties. + * @function create + * @memberof google.cloud.automl.v1beta1.ListTableSpecsRequest + * @static + * @param {google.cloud.automl.v1beta1.IListTableSpecsRequest=} [properties] Properties to set + * @returns {google.cloud.automl.v1beta1.ListTableSpecsRequest} ListTableSpecsRequest instance + */ + ListTableSpecsRequest.create = function create(properties) { + return new ListTableSpecsRequest(properties); + }; + + /** + * Encodes the specified ListTableSpecsRequest message. Does not implicitly {@link google.cloud.automl.v1beta1.ListTableSpecsRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.automl.v1beta1.ListTableSpecsRequest + * @static + * @param {google.cloud.automl.v1beta1.IListTableSpecsRequest} message ListTableSpecsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListTableSpecsRequest.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.fieldMask != null && Object.hasOwnProperty.call(message, "fieldMask")) + $root.google.protobuf.FieldMask.encode(message.fieldMask, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.filter != null && Object.hasOwnProperty.call(message, "filter")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.filter); + if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.pageSize); + if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.pageToken); + return writer; + }; + + /** + * Encodes the specified ListTableSpecsRequest message, length delimited. Does not implicitly {@link google.cloud.automl.v1beta1.ListTableSpecsRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.automl.v1beta1.ListTableSpecsRequest + * @static + * @param {google.cloud.automl.v1beta1.IListTableSpecsRequest} message ListTableSpecsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListTableSpecsRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListTableSpecsRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.automl.v1beta1.ListTableSpecsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.automl.v1beta1.ListTableSpecsRequest} ListTableSpecsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListTableSpecsRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.automl.v1beta1.ListTableSpecsRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.fieldMask = $root.google.protobuf.FieldMask.decode(reader, reader.uint32()); + break; + } + case 3: { + message.filter = reader.string(); + break; + } + case 4: { + message.pageSize = reader.int32(); + break; + } + case 6: { + message.pageToken = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListTableSpecsRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.automl.v1beta1.ListTableSpecsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.automl.v1beta1.ListTableSpecsRequest} ListTableSpecsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListTableSpecsRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListTableSpecsRequest message. + * @function verify + * @memberof google.cloud.automl.v1beta1.ListTableSpecsRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListTableSpecsRequest.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.fieldMask != null && message.hasOwnProperty("fieldMask")) { + var error = $root.google.protobuf.FieldMask.verify(message.fieldMask); + if (error) + return "fieldMask." + error; + } + 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 ListTableSpecsRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.automl.v1beta1.ListTableSpecsRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.automl.v1beta1.ListTableSpecsRequest} ListTableSpecsRequest + */ + ListTableSpecsRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.automl.v1beta1.ListTableSpecsRequest) + return object; + var message = new $root.google.cloud.automl.v1beta1.ListTableSpecsRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.fieldMask != null) { + if (typeof object.fieldMask !== "object") + throw TypeError(".google.cloud.automl.v1beta1.ListTableSpecsRequest.fieldMask: object expected"); + message.fieldMask = $root.google.protobuf.FieldMask.fromObject(object.fieldMask); + } + 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 ListTableSpecsRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.automl.v1beta1.ListTableSpecsRequest + * @static + * @param {google.cloud.automl.v1beta1.ListTableSpecsRequest} message ListTableSpecsRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListTableSpecsRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.fieldMask = null; + object.filter = ""; + object.pageSize = 0; + object.pageToken = ""; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.fieldMask != null && message.hasOwnProperty("fieldMask")) + object.fieldMask = $root.google.protobuf.FieldMask.toObject(message.fieldMask, options); + 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; + return object; + }; + + /** + * Converts this ListTableSpecsRequest to JSON. + * @function toJSON + * @memberof google.cloud.automl.v1beta1.ListTableSpecsRequest + * @instance + * @returns {Object.} JSON object + */ + ListTableSpecsRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListTableSpecsRequest + * @function getTypeUrl + * @memberof google.cloud.automl.v1beta1.ListTableSpecsRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListTableSpecsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.automl.v1beta1.ListTableSpecsRequest"; + }; + + return ListTableSpecsRequest; + })(); + + v1beta1.ListTableSpecsResponse = (function() { + + /** + * Properties of a ListTableSpecsResponse. + * @memberof google.cloud.automl.v1beta1 + * @interface IListTableSpecsResponse + * @property {Array.|null} [tableSpecs] ListTableSpecsResponse tableSpecs + * @property {string|null} [nextPageToken] ListTableSpecsResponse nextPageToken + */ + + /** + * Constructs a new ListTableSpecsResponse. + * @memberof google.cloud.automl.v1beta1 + * @classdesc Represents a ListTableSpecsResponse. + * @implements IListTableSpecsResponse + * @constructor + * @param {google.cloud.automl.v1beta1.IListTableSpecsResponse=} [properties] Properties to set + */ + function ListTableSpecsResponse(properties) { + this.tableSpecs = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListTableSpecsResponse tableSpecs. + * @member {Array.} tableSpecs + * @memberof google.cloud.automl.v1beta1.ListTableSpecsResponse + * @instance + */ + ListTableSpecsResponse.prototype.tableSpecs = $util.emptyArray; + + /** + * ListTableSpecsResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.cloud.automl.v1beta1.ListTableSpecsResponse + * @instance + */ + ListTableSpecsResponse.prototype.nextPageToken = ""; + + /** + * Creates a new ListTableSpecsResponse instance using the specified properties. + * @function create + * @memberof google.cloud.automl.v1beta1.ListTableSpecsResponse + * @static + * @param {google.cloud.automl.v1beta1.IListTableSpecsResponse=} [properties] Properties to set + * @returns {google.cloud.automl.v1beta1.ListTableSpecsResponse} ListTableSpecsResponse instance + */ + ListTableSpecsResponse.create = function create(properties) { + return new ListTableSpecsResponse(properties); + }; + + /** + * Encodes the specified ListTableSpecsResponse message. Does not implicitly {@link google.cloud.automl.v1beta1.ListTableSpecsResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.automl.v1beta1.ListTableSpecsResponse + * @static + * @param {google.cloud.automl.v1beta1.IListTableSpecsResponse} message ListTableSpecsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListTableSpecsResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.tableSpecs != null && message.tableSpecs.length) + for (var i = 0; i < message.tableSpecs.length; ++i) + $root.google.cloud.automl.v1beta1.TableSpec.encode(message.tableSpecs[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 ListTableSpecsResponse message, length delimited. Does not implicitly {@link google.cloud.automl.v1beta1.ListTableSpecsResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.automl.v1beta1.ListTableSpecsResponse + * @static + * @param {google.cloud.automl.v1beta1.IListTableSpecsResponse} message ListTableSpecsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListTableSpecsResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListTableSpecsResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.automl.v1beta1.ListTableSpecsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.automl.v1beta1.ListTableSpecsResponse} ListTableSpecsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListTableSpecsResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.automl.v1beta1.ListTableSpecsResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.tableSpecs && message.tableSpecs.length)) + message.tableSpecs = []; + message.tableSpecs.push($root.google.cloud.automl.v1beta1.TableSpec.decode(reader, reader.uint32())); + break; + } + case 2: { + message.nextPageToken = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListTableSpecsResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.automl.v1beta1.ListTableSpecsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.automl.v1beta1.ListTableSpecsResponse} ListTableSpecsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListTableSpecsResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListTableSpecsResponse message. + * @function verify + * @memberof google.cloud.automl.v1beta1.ListTableSpecsResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListTableSpecsResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.tableSpecs != null && message.hasOwnProperty("tableSpecs")) { + if (!Array.isArray(message.tableSpecs)) + return "tableSpecs: array expected"; + for (var i = 0; i < message.tableSpecs.length; ++i) { + var error = $root.google.cloud.automl.v1beta1.TableSpec.verify(message.tableSpecs[i]); + if (error) + return "tableSpecs." + error; + } + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + return null; + }; + + /** + * Creates a ListTableSpecsResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.automl.v1beta1.ListTableSpecsResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.automl.v1beta1.ListTableSpecsResponse} ListTableSpecsResponse + */ + ListTableSpecsResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.automl.v1beta1.ListTableSpecsResponse) + return object; + var message = new $root.google.cloud.automl.v1beta1.ListTableSpecsResponse(); + if (object.tableSpecs) { + if (!Array.isArray(object.tableSpecs)) + throw TypeError(".google.cloud.automl.v1beta1.ListTableSpecsResponse.tableSpecs: array expected"); + message.tableSpecs = []; + for (var i = 0; i < object.tableSpecs.length; ++i) { + if (typeof object.tableSpecs[i] !== "object") + throw TypeError(".google.cloud.automl.v1beta1.ListTableSpecsResponse.tableSpecs: object expected"); + message.tableSpecs[i] = $root.google.cloud.automl.v1beta1.TableSpec.fromObject(object.tableSpecs[i]); + } + } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + return message; + }; + + /** + * Creates a plain object from a ListTableSpecsResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.automl.v1beta1.ListTableSpecsResponse + * @static + * @param {google.cloud.automl.v1beta1.ListTableSpecsResponse} message ListTableSpecsResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListTableSpecsResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.tableSpecs = []; + if (options.defaults) + object.nextPageToken = ""; + if (message.tableSpecs && message.tableSpecs.length) { + object.tableSpecs = []; + for (var j = 0; j < message.tableSpecs.length; ++j) + object.tableSpecs[j] = $root.google.cloud.automl.v1beta1.TableSpec.toObject(message.tableSpecs[j], options); + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + object.nextPageToken = message.nextPageToken; + return object; + }; + + /** + * Converts this ListTableSpecsResponse to JSON. + * @function toJSON + * @memberof google.cloud.automl.v1beta1.ListTableSpecsResponse + * @instance + * @returns {Object.} JSON object + */ + ListTableSpecsResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListTableSpecsResponse + * @function getTypeUrl + * @memberof google.cloud.automl.v1beta1.ListTableSpecsResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListTableSpecsResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.automl.v1beta1.ListTableSpecsResponse"; + }; + + return ListTableSpecsResponse; + })(); + + v1beta1.UpdateTableSpecRequest = (function() { + + /** + * Properties of an UpdateTableSpecRequest. + * @memberof google.cloud.automl.v1beta1 + * @interface IUpdateTableSpecRequest + * @property {google.cloud.automl.v1beta1.ITableSpec|null} [tableSpec] UpdateTableSpecRequest tableSpec + * @property {google.protobuf.IFieldMask|null} [updateMask] UpdateTableSpecRequest updateMask + */ + + /** + * Constructs a new UpdateTableSpecRequest. + * @memberof google.cloud.automl.v1beta1 + * @classdesc Represents an UpdateTableSpecRequest. + * @implements IUpdateTableSpecRequest + * @constructor + * @param {google.cloud.automl.v1beta1.IUpdateTableSpecRequest=} [properties] Properties to set + */ + function UpdateTableSpecRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * UpdateTableSpecRequest tableSpec. + * @member {google.cloud.automl.v1beta1.ITableSpec|null|undefined} tableSpec + * @memberof google.cloud.automl.v1beta1.UpdateTableSpecRequest + * @instance + */ + UpdateTableSpecRequest.prototype.tableSpec = null; + + /** + * UpdateTableSpecRequest updateMask. + * @member {google.protobuf.IFieldMask|null|undefined} updateMask + * @memberof google.cloud.automl.v1beta1.UpdateTableSpecRequest + * @instance + */ + UpdateTableSpecRequest.prototype.updateMask = null; + + /** + * Creates a new UpdateTableSpecRequest instance using the specified properties. + * @function create + * @memberof google.cloud.automl.v1beta1.UpdateTableSpecRequest + * @static + * @param {google.cloud.automl.v1beta1.IUpdateTableSpecRequest=} [properties] Properties to set + * @returns {google.cloud.automl.v1beta1.UpdateTableSpecRequest} UpdateTableSpecRequest instance + */ + UpdateTableSpecRequest.create = function create(properties) { + return new UpdateTableSpecRequest(properties); + }; + + /** + * Encodes the specified UpdateTableSpecRequest message. Does not implicitly {@link google.cloud.automl.v1beta1.UpdateTableSpecRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.automl.v1beta1.UpdateTableSpecRequest + * @static + * @param {google.cloud.automl.v1beta1.IUpdateTableSpecRequest} message UpdateTableSpecRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateTableSpecRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.tableSpec != null && Object.hasOwnProperty.call(message, "tableSpec")) + $root.google.cloud.automl.v1beta1.TableSpec.encode(message.tableSpec, 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 UpdateTableSpecRequest message, length delimited. Does not implicitly {@link google.cloud.automl.v1beta1.UpdateTableSpecRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.automl.v1beta1.UpdateTableSpecRequest + * @static + * @param {google.cloud.automl.v1beta1.IUpdateTableSpecRequest} message UpdateTableSpecRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateTableSpecRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an UpdateTableSpecRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.automl.v1beta1.UpdateTableSpecRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.automl.v1beta1.UpdateTableSpecRequest} UpdateTableSpecRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateTableSpecRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.automl.v1beta1.UpdateTableSpecRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.tableSpec = $root.google.cloud.automl.v1beta1.TableSpec.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 UpdateTableSpecRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.automl.v1beta1.UpdateTableSpecRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.automl.v1beta1.UpdateTableSpecRequest} UpdateTableSpecRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateTableSpecRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an UpdateTableSpecRequest message. + * @function verify + * @memberof google.cloud.automl.v1beta1.UpdateTableSpecRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + UpdateTableSpecRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.tableSpec != null && message.hasOwnProperty("tableSpec")) { + var error = $root.google.cloud.automl.v1beta1.TableSpec.verify(message.tableSpec); + if (error) + return "tableSpec." + 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 UpdateTableSpecRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.automl.v1beta1.UpdateTableSpecRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.automl.v1beta1.UpdateTableSpecRequest} UpdateTableSpecRequest + */ + UpdateTableSpecRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.automl.v1beta1.UpdateTableSpecRequest) + return object; + var message = new $root.google.cloud.automl.v1beta1.UpdateTableSpecRequest(); + if (object.tableSpec != null) { + if (typeof object.tableSpec !== "object") + throw TypeError(".google.cloud.automl.v1beta1.UpdateTableSpecRequest.tableSpec: object expected"); + message.tableSpec = $root.google.cloud.automl.v1beta1.TableSpec.fromObject(object.tableSpec); + } + if (object.updateMask != null) { + if (typeof object.updateMask !== "object") + throw TypeError(".google.cloud.automl.v1beta1.UpdateTableSpecRequest.updateMask: object expected"); + message.updateMask = $root.google.protobuf.FieldMask.fromObject(object.updateMask); + } + return message; + }; + + /** + * Creates a plain object from an UpdateTableSpecRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.automl.v1beta1.UpdateTableSpecRequest + * @static + * @param {google.cloud.automl.v1beta1.UpdateTableSpecRequest} message UpdateTableSpecRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + UpdateTableSpecRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.tableSpec = null; + object.updateMask = null; + } + if (message.tableSpec != null && message.hasOwnProperty("tableSpec")) + object.tableSpec = $root.google.cloud.automl.v1beta1.TableSpec.toObject(message.tableSpec, options); + if (message.updateMask != null && message.hasOwnProperty("updateMask")) + object.updateMask = $root.google.protobuf.FieldMask.toObject(message.updateMask, options); + return object; + }; + + /** + * Converts this UpdateTableSpecRequest to JSON. + * @function toJSON + * @memberof google.cloud.automl.v1beta1.UpdateTableSpecRequest + * @instance + * @returns {Object.} JSON object + */ + UpdateTableSpecRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for UpdateTableSpecRequest + * @function getTypeUrl + * @memberof google.cloud.automl.v1beta1.UpdateTableSpecRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + UpdateTableSpecRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.automl.v1beta1.UpdateTableSpecRequest"; + }; + + return UpdateTableSpecRequest; + })(); + + v1beta1.GetColumnSpecRequest = (function() { + + /** + * Properties of a GetColumnSpecRequest. + * @memberof google.cloud.automl.v1beta1 + * @interface IGetColumnSpecRequest + * @property {string|null} [name] GetColumnSpecRequest name + * @property {google.protobuf.IFieldMask|null} [fieldMask] GetColumnSpecRequest fieldMask + */ + + /** + * Constructs a new GetColumnSpecRequest. + * @memberof google.cloud.automl.v1beta1 + * @classdesc Represents a GetColumnSpecRequest. + * @implements IGetColumnSpecRequest + * @constructor + * @param {google.cloud.automl.v1beta1.IGetColumnSpecRequest=} [properties] Properties to set + */ + function GetColumnSpecRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetColumnSpecRequest name. + * @member {string} name + * @memberof google.cloud.automl.v1beta1.GetColumnSpecRequest + * @instance + */ + GetColumnSpecRequest.prototype.name = ""; + + /** + * GetColumnSpecRequest fieldMask. + * @member {google.protobuf.IFieldMask|null|undefined} fieldMask + * @memberof google.cloud.automl.v1beta1.GetColumnSpecRequest + * @instance + */ + GetColumnSpecRequest.prototype.fieldMask = null; + + /** + * Creates a new GetColumnSpecRequest instance using the specified properties. + * @function create + * @memberof google.cloud.automl.v1beta1.GetColumnSpecRequest + * @static + * @param {google.cloud.automl.v1beta1.IGetColumnSpecRequest=} [properties] Properties to set + * @returns {google.cloud.automl.v1beta1.GetColumnSpecRequest} GetColumnSpecRequest instance + */ + GetColumnSpecRequest.create = function create(properties) { + return new GetColumnSpecRequest(properties); + }; + + /** + * Encodes the specified GetColumnSpecRequest message. Does not implicitly {@link google.cloud.automl.v1beta1.GetColumnSpecRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.automl.v1beta1.GetColumnSpecRequest + * @static + * @param {google.cloud.automl.v1beta1.IGetColumnSpecRequest} message GetColumnSpecRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetColumnSpecRequest.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.fieldMask != null && Object.hasOwnProperty.call(message, "fieldMask")) + $root.google.protobuf.FieldMask.encode(message.fieldMask, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified GetColumnSpecRequest message, length delimited. Does not implicitly {@link google.cloud.automl.v1beta1.GetColumnSpecRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.automl.v1beta1.GetColumnSpecRequest + * @static + * @param {google.cloud.automl.v1beta1.IGetColumnSpecRequest} message GetColumnSpecRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetColumnSpecRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetColumnSpecRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.automl.v1beta1.GetColumnSpecRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.automl.v1beta1.GetColumnSpecRequest} GetColumnSpecRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetColumnSpecRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.automl.v1beta1.GetColumnSpecRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.fieldMask = $root.google.protobuf.FieldMask.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetColumnSpecRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.automl.v1beta1.GetColumnSpecRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.automl.v1beta1.GetColumnSpecRequest} GetColumnSpecRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetColumnSpecRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetColumnSpecRequest message. + * @function verify + * @memberof google.cloud.automl.v1beta1.GetColumnSpecRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetColumnSpecRequest.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.fieldMask != null && message.hasOwnProperty("fieldMask")) { + var error = $root.google.protobuf.FieldMask.verify(message.fieldMask); + if (error) + return "fieldMask." + error; + } + return null; + }; + + /** + * Creates a GetColumnSpecRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.automl.v1beta1.GetColumnSpecRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.automl.v1beta1.GetColumnSpecRequest} GetColumnSpecRequest + */ + GetColumnSpecRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.automl.v1beta1.GetColumnSpecRequest) + return object; + var message = new $root.google.cloud.automl.v1beta1.GetColumnSpecRequest(); + if (object.name != null) + message.name = String(object.name); + if (object.fieldMask != null) { + if (typeof object.fieldMask !== "object") + throw TypeError(".google.cloud.automl.v1beta1.GetColumnSpecRequest.fieldMask: object expected"); + message.fieldMask = $root.google.protobuf.FieldMask.fromObject(object.fieldMask); + } + return message; + }; + + /** + * Creates a plain object from a GetColumnSpecRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.automl.v1beta1.GetColumnSpecRequest + * @static + * @param {google.cloud.automl.v1beta1.GetColumnSpecRequest} message GetColumnSpecRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetColumnSpecRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.fieldMask = null; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.fieldMask != null && message.hasOwnProperty("fieldMask")) + object.fieldMask = $root.google.protobuf.FieldMask.toObject(message.fieldMask, options); + return object; + }; + + /** + * Converts this GetColumnSpecRequest to JSON. + * @function toJSON + * @memberof google.cloud.automl.v1beta1.GetColumnSpecRequest + * @instance + * @returns {Object.} JSON object + */ + GetColumnSpecRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GetColumnSpecRequest + * @function getTypeUrl + * @memberof google.cloud.automl.v1beta1.GetColumnSpecRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GetColumnSpecRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.automl.v1beta1.GetColumnSpecRequest"; + }; + + return GetColumnSpecRequest; + })(); + + v1beta1.ListColumnSpecsRequest = (function() { + + /** + * Properties of a ListColumnSpecsRequest. + * @memberof google.cloud.automl.v1beta1 + * @interface IListColumnSpecsRequest + * @property {string|null} [parent] ListColumnSpecsRequest parent + * @property {google.protobuf.IFieldMask|null} [fieldMask] ListColumnSpecsRequest fieldMask + * @property {string|null} [filter] ListColumnSpecsRequest filter + * @property {number|null} [pageSize] ListColumnSpecsRequest pageSize + * @property {string|null} [pageToken] ListColumnSpecsRequest pageToken + */ + + /** + * Constructs a new ListColumnSpecsRequest. + * @memberof google.cloud.automl.v1beta1 + * @classdesc Represents a ListColumnSpecsRequest. + * @implements IListColumnSpecsRequest + * @constructor + * @param {google.cloud.automl.v1beta1.IListColumnSpecsRequest=} [properties] Properties to set + */ + function ListColumnSpecsRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListColumnSpecsRequest parent. + * @member {string} parent + * @memberof google.cloud.automl.v1beta1.ListColumnSpecsRequest + * @instance + */ + ListColumnSpecsRequest.prototype.parent = ""; + + /** + * ListColumnSpecsRequest fieldMask. + * @member {google.protobuf.IFieldMask|null|undefined} fieldMask + * @memberof google.cloud.automl.v1beta1.ListColumnSpecsRequest + * @instance + */ + ListColumnSpecsRequest.prototype.fieldMask = null; + + /** + * ListColumnSpecsRequest filter. + * @member {string} filter + * @memberof google.cloud.automl.v1beta1.ListColumnSpecsRequest + * @instance + */ + ListColumnSpecsRequest.prototype.filter = ""; + + /** + * ListColumnSpecsRequest pageSize. + * @member {number} pageSize + * @memberof google.cloud.automl.v1beta1.ListColumnSpecsRequest + * @instance + */ + ListColumnSpecsRequest.prototype.pageSize = 0; + + /** + * ListColumnSpecsRequest pageToken. + * @member {string} pageToken + * @memberof google.cloud.automl.v1beta1.ListColumnSpecsRequest + * @instance + */ + ListColumnSpecsRequest.prototype.pageToken = ""; + + /** + * Creates a new ListColumnSpecsRequest instance using the specified properties. + * @function create + * @memberof google.cloud.automl.v1beta1.ListColumnSpecsRequest + * @static + * @param {google.cloud.automl.v1beta1.IListColumnSpecsRequest=} [properties] Properties to set + * @returns {google.cloud.automl.v1beta1.ListColumnSpecsRequest} ListColumnSpecsRequest instance + */ + ListColumnSpecsRequest.create = function create(properties) { + return new ListColumnSpecsRequest(properties); + }; + + /** + * Encodes the specified ListColumnSpecsRequest message. Does not implicitly {@link google.cloud.automl.v1beta1.ListColumnSpecsRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.automl.v1beta1.ListColumnSpecsRequest + * @static + * @param {google.cloud.automl.v1beta1.IListColumnSpecsRequest} message ListColumnSpecsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListColumnSpecsRequest.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.fieldMask != null && Object.hasOwnProperty.call(message, "fieldMask")) + $root.google.protobuf.FieldMask.encode(message.fieldMask, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.filter != null && Object.hasOwnProperty.call(message, "filter")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.filter); + if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.pageSize); + if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.pageToken); + return writer; + }; + + /** + * Encodes the specified ListColumnSpecsRequest message, length delimited. Does not implicitly {@link google.cloud.automl.v1beta1.ListColumnSpecsRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.automl.v1beta1.ListColumnSpecsRequest + * @static + * @param {google.cloud.automl.v1beta1.IListColumnSpecsRequest} message ListColumnSpecsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListColumnSpecsRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListColumnSpecsRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.automl.v1beta1.ListColumnSpecsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.automl.v1beta1.ListColumnSpecsRequest} ListColumnSpecsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListColumnSpecsRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.automl.v1beta1.ListColumnSpecsRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.fieldMask = $root.google.protobuf.FieldMask.decode(reader, reader.uint32()); + break; + } + case 3: { + message.filter = reader.string(); + break; + } + case 4: { + message.pageSize = reader.int32(); + break; + } + case 6: { + message.pageToken = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListColumnSpecsRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.automl.v1beta1.ListColumnSpecsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.automl.v1beta1.ListColumnSpecsRequest} ListColumnSpecsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListColumnSpecsRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListColumnSpecsRequest message. + * @function verify + * @memberof google.cloud.automl.v1beta1.ListColumnSpecsRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListColumnSpecsRequest.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.fieldMask != null && message.hasOwnProperty("fieldMask")) { + var error = $root.google.protobuf.FieldMask.verify(message.fieldMask); + if (error) + return "fieldMask." + error; + } + 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 ListColumnSpecsRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.automl.v1beta1.ListColumnSpecsRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.automl.v1beta1.ListColumnSpecsRequest} ListColumnSpecsRequest + */ + ListColumnSpecsRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.automl.v1beta1.ListColumnSpecsRequest) + return object; + var message = new $root.google.cloud.automl.v1beta1.ListColumnSpecsRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.fieldMask != null) { + if (typeof object.fieldMask !== "object") + throw TypeError(".google.cloud.automl.v1beta1.ListColumnSpecsRequest.fieldMask: object expected"); + message.fieldMask = $root.google.protobuf.FieldMask.fromObject(object.fieldMask); + } + 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 ListColumnSpecsRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.automl.v1beta1.ListColumnSpecsRequest + * @static + * @param {google.cloud.automl.v1beta1.ListColumnSpecsRequest} message ListColumnSpecsRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListColumnSpecsRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.fieldMask = null; + object.filter = ""; + object.pageSize = 0; + object.pageToken = ""; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.fieldMask != null && message.hasOwnProperty("fieldMask")) + object.fieldMask = $root.google.protobuf.FieldMask.toObject(message.fieldMask, options); + 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; + return object; + }; + + /** + * Converts this ListColumnSpecsRequest to JSON. + * @function toJSON + * @memberof google.cloud.automl.v1beta1.ListColumnSpecsRequest + * @instance + * @returns {Object.} JSON object + */ + ListColumnSpecsRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListColumnSpecsRequest + * @function getTypeUrl + * @memberof google.cloud.automl.v1beta1.ListColumnSpecsRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListColumnSpecsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.automl.v1beta1.ListColumnSpecsRequest"; + }; + + return ListColumnSpecsRequest; + })(); + + v1beta1.ListColumnSpecsResponse = (function() { + + /** + * Properties of a ListColumnSpecsResponse. + * @memberof google.cloud.automl.v1beta1 + * @interface IListColumnSpecsResponse + * @property {Array.|null} [columnSpecs] ListColumnSpecsResponse columnSpecs + * @property {string|null} [nextPageToken] ListColumnSpecsResponse nextPageToken + */ + + /** + * Constructs a new ListColumnSpecsResponse. + * @memberof google.cloud.automl.v1beta1 + * @classdesc Represents a ListColumnSpecsResponse. + * @implements IListColumnSpecsResponse + * @constructor + * @param {google.cloud.automl.v1beta1.IListColumnSpecsResponse=} [properties] Properties to set + */ + function ListColumnSpecsResponse(properties) { + this.columnSpecs = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListColumnSpecsResponse columnSpecs. + * @member {Array.} columnSpecs + * @memberof google.cloud.automl.v1beta1.ListColumnSpecsResponse + * @instance + */ + ListColumnSpecsResponse.prototype.columnSpecs = $util.emptyArray; + + /** + * ListColumnSpecsResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.cloud.automl.v1beta1.ListColumnSpecsResponse + * @instance + */ + ListColumnSpecsResponse.prototype.nextPageToken = ""; + + /** + * Creates a new ListColumnSpecsResponse instance using the specified properties. + * @function create + * @memberof google.cloud.automl.v1beta1.ListColumnSpecsResponse + * @static + * @param {google.cloud.automl.v1beta1.IListColumnSpecsResponse=} [properties] Properties to set + * @returns {google.cloud.automl.v1beta1.ListColumnSpecsResponse} ListColumnSpecsResponse instance + */ + ListColumnSpecsResponse.create = function create(properties) { + return new ListColumnSpecsResponse(properties); + }; + + /** + * Encodes the specified ListColumnSpecsResponse message. Does not implicitly {@link google.cloud.automl.v1beta1.ListColumnSpecsResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.automl.v1beta1.ListColumnSpecsResponse + * @static + * @param {google.cloud.automl.v1beta1.IListColumnSpecsResponse} message ListColumnSpecsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListColumnSpecsResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.columnSpecs != null && message.columnSpecs.length) + for (var i = 0; i < message.columnSpecs.length; ++i) + $root.google.cloud.automl.v1beta1.ColumnSpec.encode(message.columnSpecs[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 ListColumnSpecsResponse message, length delimited. Does not implicitly {@link google.cloud.automl.v1beta1.ListColumnSpecsResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.automl.v1beta1.ListColumnSpecsResponse + * @static + * @param {google.cloud.automl.v1beta1.IListColumnSpecsResponse} message ListColumnSpecsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListColumnSpecsResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListColumnSpecsResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.automl.v1beta1.ListColumnSpecsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.automl.v1beta1.ListColumnSpecsResponse} ListColumnSpecsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListColumnSpecsResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.automl.v1beta1.ListColumnSpecsResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.columnSpecs && message.columnSpecs.length)) + message.columnSpecs = []; + message.columnSpecs.push($root.google.cloud.automl.v1beta1.ColumnSpec.decode(reader, reader.uint32())); + break; + } + case 2: { + message.nextPageToken = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListColumnSpecsResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.automl.v1beta1.ListColumnSpecsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.automl.v1beta1.ListColumnSpecsResponse} ListColumnSpecsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListColumnSpecsResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListColumnSpecsResponse message. + * @function verify + * @memberof google.cloud.automl.v1beta1.ListColumnSpecsResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListColumnSpecsResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.columnSpecs != null && message.hasOwnProperty("columnSpecs")) { + if (!Array.isArray(message.columnSpecs)) + return "columnSpecs: array expected"; + for (var i = 0; i < message.columnSpecs.length; ++i) { + var error = $root.google.cloud.automl.v1beta1.ColumnSpec.verify(message.columnSpecs[i]); + if (error) + return "columnSpecs." + error; + } + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + return null; + }; + + /** + * Creates a ListColumnSpecsResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.automl.v1beta1.ListColumnSpecsResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.automl.v1beta1.ListColumnSpecsResponse} ListColumnSpecsResponse + */ + ListColumnSpecsResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.automl.v1beta1.ListColumnSpecsResponse) + return object; + var message = new $root.google.cloud.automl.v1beta1.ListColumnSpecsResponse(); + if (object.columnSpecs) { + if (!Array.isArray(object.columnSpecs)) + throw TypeError(".google.cloud.automl.v1beta1.ListColumnSpecsResponse.columnSpecs: array expected"); + message.columnSpecs = []; + for (var i = 0; i < object.columnSpecs.length; ++i) { + if (typeof object.columnSpecs[i] !== "object") + throw TypeError(".google.cloud.automl.v1beta1.ListColumnSpecsResponse.columnSpecs: object expected"); + message.columnSpecs[i] = $root.google.cloud.automl.v1beta1.ColumnSpec.fromObject(object.columnSpecs[i]); + } + } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + return message; + }; + + /** + * Creates a plain object from a ListColumnSpecsResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.automl.v1beta1.ListColumnSpecsResponse + * @static + * @param {google.cloud.automl.v1beta1.ListColumnSpecsResponse} message ListColumnSpecsResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListColumnSpecsResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.columnSpecs = []; + if (options.defaults) + object.nextPageToken = ""; + if (message.columnSpecs && message.columnSpecs.length) { + object.columnSpecs = []; + for (var j = 0; j < message.columnSpecs.length; ++j) + object.columnSpecs[j] = $root.google.cloud.automl.v1beta1.ColumnSpec.toObject(message.columnSpecs[j], options); + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + object.nextPageToken = message.nextPageToken; + return object; + }; + + /** + * Converts this ListColumnSpecsResponse to JSON. + * @function toJSON + * @memberof google.cloud.automl.v1beta1.ListColumnSpecsResponse + * @instance + * @returns {Object.} JSON object + */ + ListColumnSpecsResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListColumnSpecsResponse + * @function getTypeUrl + * @memberof google.cloud.automl.v1beta1.ListColumnSpecsResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListColumnSpecsResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.automl.v1beta1.ListColumnSpecsResponse"; + }; + + return ListColumnSpecsResponse; + })(); + + v1beta1.UpdateColumnSpecRequest = (function() { + + /** + * Properties of an UpdateColumnSpecRequest. + * @memberof google.cloud.automl.v1beta1 + * @interface IUpdateColumnSpecRequest + * @property {google.cloud.automl.v1beta1.IColumnSpec|null} [columnSpec] UpdateColumnSpecRequest columnSpec + * @property {google.protobuf.IFieldMask|null} [updateMask] UpdateColumnSpecRequest updateMask + */ + + /** + * Constructs a new UpdateColumnSpecRequest. + * @memberof google.cloud.automl.v1beta1 + * @classdesc Represents an UpdateColumnSpecRequest. + * @implements IUpdateColumnSpecRequest + * @constructor + * @param {google.cloud.automl.v1beta1.IUpdateColumnSpecRequest=} [properties] Properties to set + */ + function UpdateColumnSpecRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * UpdateColumnSpecRequest columnSpec. + * @member {google.cloud.automl.v1beta1.IColumnSpec|null|undefined} columnSpec + * @memberof google.cloud.automl.v1beta1.UpdateColumnSpecRequest + * @instance + */ + UpdateColumnSpecRequest.prototype.columnSpec = null; + + /** + * UpdateColumnSpecRequest updateMask. + * @member {google.protobuf.IFieldMask|null|undefined} updateMask + * @memberof google.cloud.automl.v1beta1.UpdateColumnSpecRequest + * @instance + */ + UpdateColumnSpecRequest.prototype.updateMask = null; + + /** + * Creates a new UpdateColumnSpecRequest instance using the specified properties. + * @function create + * @memberof google.cloud.automl.v1beta1.UpdateColumnSpecRequest + * @static + * @param {google.cloud.automl.v1beta1.IUpdateColumnSpecRequest=} [properties] Properties to set + * @returns {google.cloud.automl.v1beta1.UpdateColumnSpecRequest} UpdateColumnSpecRequest instance + */ + UpdateColumnSpecRequest.create = function create(properties) { + return new UpdateColumnSpecRequest(properties); + }; + + /** + * Encodes the specified UpdateColumnSpecRequest message. Does not implicitly {@link google.cloud.automl.v1beta1.UpdateColumnSpecRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.automl.v1beta1.UpdateColumnSpecRequest + * @static + * @param {google.cloud.automl.v1beta1.IUpdateColumnSpecRequest} message UpdateColumnSpecRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateColumnSpecRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.columnSpec != null && Object.hasOwnProperty.call(message, "columnSpec")) + $root.google.cloud.automl.v1beta1.ColumnSpec.encode(message.columnSpec, 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 UpdateColumnSpecRequest message, length delimited. Does not implicitly {@link google.cloud.automl.v1beta1.UpdateColumnSpecRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.automl.v1beta1.UpdateColumnSpecRequest + * @static + * @param {google.cloud.automl.v1beta1.IUpdateColumnSpecRequest} message UpdateColumnSpecRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateColumnSpecRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an UpdateColumnSpecRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.automl.v1beta1.UpdateColumnSpecRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.automl.v1beta1.UpdateColumnSpecRequest} UpdateColumnSpecRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateColumnSpecRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.automl.v1beta1.UpdateColumnSpecRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.columnSpec = $root.google.cloud.automl.v1beta1.ColumnSpec.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 UpdateColumnSpecRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.automl.v1beta1.UpdateColumnSpecRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.automl.v1beta1.UpdateColumnSpecRequest} UpdateColumnSpecRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateColumnSpecRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an UpdateColumnSpecRequest message. + * @function verify + * @memberof google.cloud.automl.v1beta1.UpdateColumnSpecRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + UpdateColumnSpecRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.columnSpec != null && message.hasOwnProperty("columnSpec")) { + var error = $root.google.cloud.automl.v1beta1.ColumnSpec.verify(message.columnSpec); + if (error) + return "columnSpec." + 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 UpdateColumnSpecRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.automl.v1beta1.UpdateColumnSpecRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.automl.v1beta1.UpdateColumnSpecRequest} UpdateColumnSpecRequest + */ + UpdateColumnSpecRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.automl.v1beta1.UpdateColumnSpecRequest) + return object; + var message = new $root.google.cloud.automl.v1beta1.UpdateColumnSpecRequest(); + if (object.columnSpec != null) { + if (typeof object.columnSpec !== "object") + throw TypeError(".google.cloud.automl.v1beta1.UpdateColumnSpecRequest.columnSpec: object expected"); + message.columnSpec = $root.google.cloud.automl.v1beta1.ColumnSpec.fromObject(object.columnSpec); + } + if (object.updateMask != null) { + if (typeof object.updateMask !== "object") + throw TypeError(".google.cloud.automl.v1beta1.UpdateColumnSpecRequest.updateMask: object expected"); + message.updateMask = $root.google.protobuf.FieldMask.fromObject(object.updateMask); + } + return message; + }; + + /** + * Creates a plain object from an UpdateColumnSpecRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.automl.v1beta1.UpdateColumnSpecRequest + * @static + * @param {google.cloud.automl.v1beta1.UpdateColumnSpecRequest} message UpdateColumnSpecRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + UpdateColumnSpecRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.columnSpec = null; + object.updateMask = null; + } + if (message.columnSpec != null && message.hasOwnProperty("columnSpec")) + object.columnSpec = $root.google.cloud.automl.v1beta1.ColumnSpec.toObject(message.columnSpec, options); + if (message.updateMask != null && message.hasOwnProperty("updateMask")) + object.updateMask = $root.google.protobuf.FieldMask.toObject(message.updateMask, options); + return object; + }; + + /** + * Converts this UpdateColumnSpecRequest to JSON. + * @function toJSON + * @memberof google.cloud.automl.v1beta1.UpdateColumnSpecRequest + * @instance + * @returns {Object.} JSON object + */ + UpdateColumnSpecRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for UpdateColumnSpecRequest + * @function getTypeUrl + * @memberof google.cloud.automl.v1beta1.UpdateColumnSpecRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + UpdateColumnSpecRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.automl.v1beta1.UpdateColumnSpecRequest"; + }; + + return UpdateColumnSpecRequest; + })(); + + v1beta1.CreateModelRequest = (function() { + + /** + * Properties of a CreateModelRequest. + * @memberof google.cloud.automl.v1beta1 + * @interface ICreateModelRequest + * @property {string|null} [parent] CreateModelRequest parent + * @property {google.cloud.automl.v1beta1.IModel|null} [model] CreateModelRequest model + */ + + /** + * Constructs a new CreateModelRequest. + * @memberof google.cloud.automl.v1beta1 + * @classdesc Represents a CreateModelRequest. + * @implements ICreateModelRequest + * @constructor + * @param {google.cloud.automl.v1beta1.ICreateModelRequest=} [properties] Properties to set + */ + function CreateModelRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * CreateModelRequest parent. + * @member {string} parent + * @memberof google.cloud.automl.v1beta1.CreateModelRequest + * @instance + */ + CreateModelRequest.prototype.parent = ""; + + /** + * CreateModelRequest model. + * @member {google.cloud.automl.v1beta1.IModel|null|undefined} model + * @memberof google.cloud.automl.v1beta1.CreateModelRequest + * @instance + */ + CreateModelRequest.prototype.model = null; + + /** + * Creates a new CreateModelRequest instance using the specified properties. + * @function create + * @memberof google.cloud.automl.v1beta1.CreateModelRequest + * @static + * @param {google.cloud.automl.v1beta1.ICreateModelRequest=} [properties] Properties to set + * @returns {google.cloud.automl.v1beta1.CreateModelRequest} CreateModelRequest instance + */ + CreateModelRequest.create = function create(properties) { + return new CreateModelRequest(properties); + }; + + /** + * Encodes the specified CreateModelRequest message. Does not implicitly {@link google.cloud.automl.v1beta1.CreateModelRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.automl.v1beta1.CreateModelRequest + * @static + * @param {google.cloud.automl.v1beta1.ICreateModelRequest} message CreateModelRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateModelRequest.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.model != null && Object.hasOwnProperty.call(message, "model")) + $root.google.cloud.automl.v1beta1.Model.encode(message.model, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified CreateModelRequest message, length delimited. Does not implicitly {@link google.cloud.automl.v1beta1.CreateModelRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.automl.v1beta1.CreateModelRequest + * @static + * @param {google.cloud.automl.v1beta1.ICreateModelRequest} message CreateModelRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateModelRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CreateModelRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.automl.v1beta1.CreateModelRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.automl.v1beta1.CreateModelRequest} CreateModelRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateModelRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.automl.v1beta1.CreateModelRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 4: { + message.model = $root.google.cloud.automl.v1beta1.Model.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CreateModelRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.automl.v1beta1.CreateModelRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.automl.v1beta1.CreateModelRequest} CreateModelRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateModelRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CreateModelRequest message. + * @function verify + * @memberof google.cloud.automl.v1beta1.CreateModelRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CreateModelRequest.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.model != null && message.hasOwnProperty("model")) { + var error = $root.google.cloud.automl.v1beta1.Model.verify(message.model); + if (error) + return "model." + error; + } + return null; + }; + + /** + * Creates a CreateModelRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.automl.v1beta1.CreateModelRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.automl.v1beta1.CreateModelRequest} CreateModelRequest + */ + CreateModelRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.automl.v1beta1.CreateModelRequest) + return object; + var message = new $root.google.cloud.automl.v1beta1.CreateModelRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.model != null) { + if (typeof object.model !== "object") + throw TypeError(".google.cloud.automl.v1beta1.CreateModelRequest.model: object expected"); + message.model = $root.google.cloud.automl.v1beta1.Model.fromObject(object.model); + } + return message; + }; + + /** + * Creates a plain object from a CreateModelRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.automl.v1beta1.CreateModelRequest + * @static + * @param {google.cloud.automl.v1beta1.CreateModelRequest} message CreateModelRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CreateModelRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.model = null; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.model != null && message.hasOwnProperty("model")) + object.model = $root.google.cloud.automl.v1beta1.Model.toObject(message.model, options); + return object; + }; + + /** + * Converts this CreateModelRequest to JSON. + * @function toJSON + * @memberof google.cloud.automl.v1beta1.CreateModelRequest + * @instance + * @returns {Object.} JSON object + */ + CreateModelRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CreateModelRequest + * @function getTypeUrl + * @memberof google.cloud.automl.v1beta1.CreateModelRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CreateModelRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.automl.v1beta1.CreateModelRequest"; + }; + + return CreateModelRequest; + })(); + + v1beta1.GetModelRequest = (function() { + + /** + * Properties of a GetModelRequest. + * @memberof google.cloud.automl.v1beta1 + * @interface IGetModelRequest + * @property {string|null} [name] GetModelRequest name + */ + + /** + * Constructs a new GetModelRequest. + * @memberof google.cloud.automl.v1beta1 + * @classdesc Represents a GetModelRequest. + * @implements IGetModelRequest + * @constructor + * @param {google.cloud.automl.v1beta1.IGetModelRequest=} [properties] Properties to set + */ + function GetModelRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetModelRequest name. + * @member {string} name + * @memberof google.cloud.automl.v1beta1.GetModelRequest + * @instance + */ + GetModelRequest.prototype.name = ""; + + /** + * Creates a new GetModelRequest instance using the specified properties. + * @function create + * @memberof google.cloud.automl.v1beta1.GetModelRequest + * @static + * @param {google.cloud.automl.v1beta1.IGetModelRequest=} [properties] Properties to set + * @returns {google.cloud.automl.v1beta1.GetModelRequest} GetModelRequest instance + */ + GetModelRequest.create = function create(properties) { + return new GetModelRequest(properties); + }; + + /** + * Encodes the specified GetModelRequest message. Does not implicitly {@link google.cloud.automl.v1beta1.GetModelRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.automl.v1beta1.GetModelRequest + * @static + * @param {google.cloud.automl.v1beta1.IGetModelRequest} message GetModelRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetModelRequest.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 GetModelRequest message, length delimited. Does not implicitly {@link google.cloud.automl.v1beta1.GetModelRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.automl.v1beta1.GetModelRequest + * @static + * @param {google.cloud.automl.v1beta1.IGetModelRequest} message GetModelRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetModelRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetModelRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.automl.v1beta1.GetModelRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.automl.v1beta1.GetModelRequest} GetModelRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetModelRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.automl.v1beta1.GetModelRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetModelRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.automl.v1beta1.GetModelRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.automl.v1beta1.GetModelRequest} GetModelRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetModelRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetModelRequest message. + * @function verify + * @memberof google.cloud.automl.v1beta1.GetModelRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetModelRequest.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 GetModelRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.automl.v1beta1.GetModelRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.automl.v1beta1.GetModelRequest} GetModelRequest + */ + GetModelRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.automl.v1beta1.GetModelRequest) + return object; + var message = new $root.google.cloud.automl.v1beta1.GetModelRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a GetModelRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.automl.v1beta1.GetModelRequest + * @static + * @param {google.cloud.automl.v1beta1.GetModelRequest} message GetModelRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetModelRequest.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 GetModelRequest to JSON. + * @function toJSON + * @memberof google.cloud.automl.v1beta1.GetModelRequest + * @instance + * @returns {Object.} JSON object + */ + GetModelRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GetModelRequest + * @function getTypeUrl + * @memberof google.cloud.automl.v1beta1.GetModelRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GetModelRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.automl.v1beta1.GetModelRequest"; + }; + + return GetModelRequest; + })(); + + v1beta1.ListModelsRequest = (function() { + + /** + * Properties of a ListModelsRequest. + * @memberof google.cloud.automl.v1beta1 + * @interface IListModelsRequest + * @property {string|null} [parent] ListModelsRequest parent + * @property {string|null} [filter] ListModelsRequest filter + * @property {number|null} [pageSize] ListModelsRequest pageSize + * @property {string|null} [pageToken] ListModelsRequest pageToken + */ + + /** + * Constructs a new ListModelsRequest. + * @memberof google.cloud.automl.v1beta1 + * @classdesc Represents a ListModelsRequest. + * @implements IListModelsRequest + * @constructor + * @param {google.cloud.automl.v1beta1.IListModelsRequest=} [properties] Properties to set + */ + function ListModelsRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListModelsRequest parent. + * @member {string} parent + * @memberof google.cloud.automl.v1beta1.ListModelsRequest + * @instance + */ + ListModelsRequest.prototype.parent = ""; + + /** + * ListModelsRequest filter. + * @member {string} filter + * @memberof google.cloud.automl.v1beta1.ListModelsRequest + * @instance + */ + ListModelsRequest.prototype.filter = ""; + + /** + * ListModelsRequest pageSize. + * @member {number} pageSize + * @memberof google.cloud.automl.v1beta1.ListModelsRequest + * @instance + */ + ListModelsRequest.prototype.pageSize = 0; + + /** + * ListModelsRequest pageToken. + * @member {string} pageToken + * @memberof google.cloud.automl.v1beta1.ListModelsRequest + * @instance + */ + ListModelsRequest.prototype.pageToken = ""; + + /** + * Creates a new ListModelsRequest instance using the specified properties. + * @function create + * @memberof google.cloud.automl.v1beta1.ListModelsRequest + * @static + * @param {google.cloud.automl.v1beta1.IListModelsRequest=} [properties] Properties to set + * @returns {google.cloud.automl.v1beta1.ListModelsRequest} ListModelsRequest instance + */ + ListModelsRequest.create = function create(properties) { + return new ListModelsRequest(properties); + }; + + /** + * Encodes the specified ListModelsRequest message. Does not implicitly {@link google.cloud.automl.v1beta1.ListModelsRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.automl.v1beta1.ListModelsRequest + * @static + * @param {google.cloud.automl.v1beta1.IListModelsRequest} message ListModelsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListModelsRequest.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.filter != null && Object.hasOwnProperty.call(message, "filter")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.filter); + if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.pageSize); + if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.pageToken); + return writer; + }; + + /** + * Encodes the specified ListModelsRequest message, length delimited. Does not implicitly {@link google.cloud.automl.v1beta1.ListModelsRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.automl.v1beta1.ListModelsRequest + * @static + * @param {google.cloud.automl.v1beta1.IListModelsRequest} message ListModelsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListModelsRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListModelsRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.automl.v1beta1.ListModelsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.automl.v1beta1.ListModelsRequest} ListModelsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListModelsRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.automl.v1beta1.ListModelsRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 3: { + message.filter = reader.string(); + break; + } + case 4: { + message.pageSize = reader.int32(); + break; + } + case 6: { + message.pageToken = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListModelsRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.automl.v1beta1.ListModelsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.automl.v1beta1.ListModelsRequest} ListModelsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListModelsRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListModelsRequest message. + * @function verify + * @memberof google.cloud.automl.v1beta1.ListModelsRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListModelsRequest.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.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 ListModelsRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.automl.v1beta1.ListModelsRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.automl.v1beta1.ListModelsRequest} ListModelsRequest + */ + ListModelsRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.automl.v1beta1.ListModelsRequest) + return object; + var message = new $root.google.cloud.automl.v1beta1.ListModelsRequest(); + if (object.parent != null) + message.parent = String(object.parent); + 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 ListModelsRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.automl.v1beta1.ListModelsRequest + * @static + * @param {google.cloud.automl.v1beta1.ListModelsRequest} message ListModelsRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListModelsRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.filter = ""; + object.pageSize = 0; + object.pageToken = ""; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + 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; + return object; + }; + + /** + * Converts this ListModelsRequest to JSON. + * @function toJSON + * @memberof google.cloud.automl.v1beta1.ListModelsRequest + * @instance + * @returns {Object.} JSON object + */ + ListModelsRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListModelsRequest + * @function getTypeUrl + * @memberof google.cloud.automl.v1beta1.ListModelsRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListModelsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.automl.v1beta1.ListModelsRequest"; + }; + + return ListModelsRequest; + })(); + + v1beta1.ListModelsResponse = (function() { + + /** + * Properties of a ListModelsResponse. + * @memberof google.cloud.automl.v1beta1 + * @interface IListModelsResponse + * @property {Array.|null} [model] ListModelsResponse model + * @property {string|null} [nextPageToken] ListModelsResponse nextPageToken + */ + + /** + * Constructs a new ListModelsResponse. + * @memberof google.cloud.automl.v1beta1 + * @classdesc Represents a ListModelsResponse. + * @implements IListModelsResponse + * @constructor + * @param {google.cloud.automl.v1beta1.IListModelsResponse=} [properties] Properties to set + */ + function ListModelsResponse(properties) { + this.model = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListModelsResponse model. + * @member {Array.} model + * @memberof google.cloud.automl.v1beta1.ListModelsResponse + * @instance + */ + ListModelsResponse.prototype.model = $util.emptyArray; + + /** + * ListModelsResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.cloud.automl.v1beta1.ListModelsResponse + * @instance + */ + ListModelsResponse.prototype.nextPageToken = ""; + + /** + * Creates a new ListModelsResponse instance using the specified properties. + * @function create + * @memberof google.cloud.automl.v1beta1.ListModelsResponse + * @static + * @param {google.cloud.automl.v1beta1.IListModelsResponse=} [properties] Properties to set + * @returns {google.cloud.automl.v1beta1.ListModelsResponse} ListModelsResponse instance + */ + ListModelsResponse.create = function create(properties) { + return new ListModelsResponse(properties); + }; + + /** + * Encodes the specified ListModelsResponse message. Does not implicitly {@link google.cloud.automl.v1beta1.ListModelsResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.automl.v1beta1.ListModelsResponse + * @static + * @param {google.cloud.automl.v1beta1.IListModelsResponse} message ListModelsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListModelsResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.model != null && message.model.length) + for (var i = 0; i < message.model.length; ++i) + $root.google.cloud.automl.v1beta1.Model.encode(message.model[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 ListModelsResponse message, length delimited. Does not implicitly {@link google.cloud.automl.v1beta1.ListModelsResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.automl.v1beta1.ListModelsResponse + * @static + * @param {google.cloud.automl.v1beta1.IListModelsResponse} message ListModelsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListModelsResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListModelsResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.automl.v1beta1.ListModelsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.automl.v1beta1.ListModelsResponse} ListModelsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListModelsResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.automl.v1beta1.ListModelsResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.model && message.model.length)) + message.model = []; + message.model.push($root.google.cloud.automl.v1beta1.Model.decode(reader, reader.uint32())); + break; + } + case 2: { + message.nextPageToken = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListModelsResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.automl.v1beta1.ListModelsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.automl.v1beta1.ListModelsResponse} ListModelsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListModelsResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListModelsResponse message. + * @function verify + * @memberof google.cloud.automl.v1beta1.ListModelsResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListModelsResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.model != null && message.hasOwnProperty("model")) { + if (!Array.isArray(message.model)) + return "model: array expected"; + for (var i = 0; i < message.model.length; ++i) { + var error = $root.google.cloud.automl.v1beta1.Model.verify(message.model[i]); + if (error) + return "model." + error; + } + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + return null; + }; + + /** + * Creates a ListModelsResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.automl.v1beta1.ListModelsResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.automl.v1beta1.ListModelsResponse} ListModelsResponse + */ + ListModelsResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.automl.v1beta1.ListModelsResponse) + return object; + var message = new $root.google.cloud.automl.v1beta1.ListModelsResponse(); + if (object.model) { + if (!Array.isArray(object.model)) + throw TypeError(".google.cloud.automl.v1beta1.ListModelsResponse.model: array expected"); + message.model = []; + for (var i = 0; i < object.model.length; ++i) { + if (typeof object.model[i] !== "object") + throw TypeError(".google.cloud.automl.v1beta1.ListModelsResponse.model: object expected"); + message.model[i] = $root.google.cloud.automl.v1beta1.Model.fromObject(object.model[i]); + } + } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + return message; + }; + + /** + * Creates a plain object from a ListModelsResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.automl.v1beta1.ListModelsResponse + * @static + * @param {google.cloud.automl.v1beta1.ListModelsResponse} message ListModelsResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListModelsResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.model = []; + if (options.defaults) + object.nextPageToken = ""; + if (message.model && message.model.length) { + object.model = []; + for (var j = 0; j < message.model.length; ++j) + object.model[j] = $root.google.cloud.automl.v1beta1.Model.toObject(message.model[j], options); + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + object.nextPageToken = message.nextPageToken; + return object; + }; + + /** + * Converts this ListModelsResponse to JSON. + * @function toJSON + * @memberof google.cloud.automl.v1beta1.ListModelsResponse + * @instance + * @returns {Object.} JSON object + */ + ListModelsResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListModelsResponse + * @function getTypeUrl + * @memberof google.cloud.automl.v1beta1.ListModelsResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListModelsResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.automl.v1beta1.ListModelsResponse"; + }; + + return ListModelsResponse; + })(); + + v1beta1.DeleteModelRequest = (function() { + + /** + * Properties of a DeleteModelRequest. + * @memberof google.cloud.automl.v1beta1 + * @interface IDeleteModelRequest + * @property {string|null} [name] DeleteModelRequest name + */ + + /** + * Constructs a new DeleteModelRequest. + * @memberof google.cloud.automl.v1beta1 + * @classdesc Represents a DeleteModelRequest. + * @implements IDeleteModelRequest + * @constructor + * @param {google.cloud.automl.v1beta1.IDeleteModelRequest=} [properties] Properties to set + */ + function DeleteModelRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * DeleteModelRequest name. + * @member {string} name + * @memberof google.cloud.automl.v1beta1.DeleteModelRequest + * @instance + */ + DeleteModelRequest.prototype.name = ""; + + /** + * Creates a new DeleteModelRequest instance using the specified properties. + * @function create + * @memberof google.cloud.automl.v1beta1.DeleteModelRequest + * @static + * @param {google.cloud.automl.v1beta1.IDeleteModelRequest=} [properties] Properties to set + * @returns {google.cloud.automl.v1beta1.DeleteModelRequest} DeleteModelRequest instance + */ + DeleteModelRequest.create = function create(properties) { + return new DeleteModelRequest(properties); + }; + + /** + * Encodes the specified DeleteModelRequest message. Does not implicitly {@link google.cloud.automl.v1beta1.DeleteModelRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.automl.v1beta1.DeleteModelRequest + * @static + * @param {google.cloud.automl.v1beta1.IDeleteModelRequest} message DeleteModelRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteModelRequest.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 DeleteModelRequest message, length delimited. Does not implicitly {@link google.cloud.automl.v1beta1.DeleteModelRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.automl.v1beta1.DeleteModelRequest + * @static + * @param {google.cloud.automl.v1beta1.IDeleteModelRequest} message DeleteModelRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteModelRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DeleteModelRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.automl.v1beta1.DeleteModelRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.automl.v1beta1.DeleteModelRequest} DeleteModelRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteModelRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.automl.v1beta1.DeleteModelRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DeleteModelRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.automl.v1beta1.DeleteModelRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.automl.v1beta1.DeleteModelRequest} DeleteModelRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteModelRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DeleteModelRequest message. + * @function verify + * @memberof google.cloud.automl.v1beta1.DeleteModelRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DeleteModelRequest.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 DeleteModelRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.automl.v1beta1.DeleteModelRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.automl.v1beta1.DeleteModelRequest} DeleteModelRequest + */ + DeleteModelRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.automl.v1beta1.DeleteModelRequest) + return object; + var message = new $root.google.cloud.automl.v1beta1.DeleteModelRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a DeleteModelRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.automl.v1beta1.DeleteModelRequest + * @static + * @param {google.cloud.automl.v1beta1.DeleteModelRequest} message DeleteModelRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DeleteModelRequest.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 DeleteModelRequest to JSON. + * @function toJSON + * @memberof google.cloud.automl.v1beta1.DeleteModelRequest + * @instance + * @returns {Object.} JSON object + */ + DeleteModelRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DeleteModelRequest + * @function getTypeUrl + * @memberof google.cloud.automl.v1beta1.DeleteModelRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DeleteModelRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.automl.v1beta1.DeleteModelRequest"; + }; + + return DeleteModelRequest; + })(); + + v1beta1.DeployModelRequest = (function() { + + /** + * Properties of a DeployModelRequest. + * @memberof google.cloud.automl.v1beta1 + * @interface IDeployModelRequest + * @property {google.cloud.automl.v1beta1.IImageObjectDetectionModelDeploymentMetadata|null} [imageObjectDetectionModelDeploymentMetadata] DeployModelRequest imageObjectDetectionModelDeploymentMetadata + * @property {google.cloud.automl.v1beta1.IImageClassificationModelDeploymentMetadata|null} [imageClassificationModelDeploymentMetadata] DeployModelRequest imageClassificationModelDeploymentMetadata + * @property {string|null} [name] DeployModelRequest name + */ + + /** + * Constructs a new DeployModelRequest. + * @memberof google.cloud.automl.v1beta1 + * @classdesc Represents a DeployModelRequest. + * @implements IDeployModelRequest + * @constructor + * @param {google.cloud.automl.v1beta1.IDeployModelRequest=} [properties] Properties to set + */ + function DeployModelRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * DeployModelRequest imageObjectDetectionModelDeploymentMetadata. + * @member {google.cloud.automl.v1beta1.IImageObjectDetectionModelDeploymentMetadata|null|undefined} imageObjectDetectionModelDeploymentMetadata + * @memberof google.cloud.automl.v1beta1.DeployModelRequest + * @instance + */ + DeployModelRequest.prototype.imageObjectDetectionModelDeploymentMetadata = null; + + /** + * DeployModelRequest imageClassificationModelDeploymentMetadata. + * @member {google.cloud.automl.v1beta1.IImageClassificationModelDeploymentMetadata|null|undefined} imageClassificationModelDeploymentMetadata + * @memberof google.cloud.automl.v1beta1.DeployModelRequest + * @instance + */ + DeployModelRequest.prototype.imageClassificationModelDeploymentMetadata = null; + + /** + * DeployModelRequest name. + * @member {string} name + * @memberof google.cloud.automl.v1beta1.DeployModelRequest + * @instance + */ + DeployModelRequest.prototype.name = ""; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * DeployModelRequest modelDeploymentMetadata. + * @member {"imageObjectDetectionModelDeploymentMetadata"|"imageClassificationModelDeploymentMetadata"|undefined} modelDeploymentMetadata + * @memberof google.cloud.automl.v1beta1.DeployModelRequest + * @instance + */ + Object.defineProperty(DeployModelRequest.prototype, "modelDeploymentMetadata", { + get: $util.oneOfGetter($oneOfFields = ["imageObjectDetectionModelDeploymentMetadata", "imageClassificationModelDeploymentMetadata"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new DeployModelRequest instance using the specified properties. + * @function create + * @memberof google.cloud.automl.v1beta1.DeployModelRequest + * @static + * @param {google.cloud.automl.v1beta1.IDeployModelRequest=} [properties] Properties to set + * @returns {google.cloud.automl.v1beta1.DeployModelRequest} DeployModelRequest instance + */ + DeployModelRequest.create = function create(properties) { + return new DeployModelRequest(properties); + }; + + /** + * Encodes the specified DeployModelRequest message. Does not implicitly {@link google.cloud.automl.v1beta1.DeployModelRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.automl.v1beta1.DeployModelRequest + * @static + * @param {google.cloud.automl.v1beta1.IDeployModelRequest} message DeployModelRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeployModelRequest.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.imageObjectDetectionModelDeploymentMetadata != null && Object.hasOwnProperty.call(message, "imageObjectDetectionModelDeploymentMetadata")) + $root.google.cloud.automl.v1beta1.ImageObjectDetectionModelDeploymentMetadata.encode(message.imageObjectDetectionModelDeploymentMetadata, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.imageClassificationModelDeploymentMetadata != null && Object.hasOwnProperty.call(message, "imageClassificationModelDeploymentMetadata")) + $root.google.cloud.automl.v1beta1.ImageClassificationModelDeploymentMetadata.encode(message.imageClassificationModelDeploymentMetadata, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified DeployModelRequest message, length delimited. Does not implicitly {@link google.cloud.automl.v1beta1.DeployModelRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.automl.v1beta1.DeployModelRequest + * @static + * @param {google.cloud.automl.v1beta1.IDeployModelRequest} message DeployModelRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeployModelRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DeployModelRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.automl.v1beta1.DeployModelRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.automl.v1beta1.DeployModelRequest} DeployModelRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeployModelRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.automl.v1beta1.DeployModelRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 2: { + message.imageObjectDetectionModelDeploymentMetadata = $root.google.cloud.automl.v1beta1.ImageObjectDetectionModelDeploymentMetadata.decode(reader, reader.uint32()); + break; + } + case 4: { + message.imageClassificationModelDeploymentMetadata = $root.google.cloud.automl.v1beta1.ImageClassificationModelDeploymentMetadata.decode(reader, reader.uint32()); + break; + } + case 1: { + message.name = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DeployModelRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.automl.v1beta1.DeployModelRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.automl.v1beta1.DeployModelRequest} DeployModelRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeployModelRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DeployModelRequest message. + * @function verify + * @memberof google.cloud.automl.v1beta1.DeployModelRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DeployModelRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.imageObjectDetectionModelDeploymentMetadata != null && message.hasOwnProperty("imageObjectDetectionModelDeploymentMetadata")) { + properties.modelDeploymentMetadata = 1; + { + var error = $root.google.cloud.automl.v1beta1.ImageObjectDetectionModelDeploymentMetadata.verify(message.imageObjectDetectionModelDeploymentMetadata); + if (error) + return "imageObjectDetectionModelDeploymentMetadata." + error; + } + } + if (message.imageClassificationModelDeploymentMetadata != null && message.hasOwnProperty("imageClassificationModelDeploymentMetadata")) { + if (properties.modelDeploymentMetadata === 1) + return "modelDeploymentMetadata: multiple values"; + properties.modelDeploymentMetadata = 1; + { + var error = $root.google.cloud.automl.v1beta1.ImageClassificationModelDeploymentMetadata.verify(message.imageClassificationModelDeploymentMetadata); + if (error) + return "imageClassificationModelDeploymentMetadata." + error; + } + } + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + return null; + }; + + /** + * Creates a DeployModelRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.automl.v1beta1.DeployModelRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.automl.v1beta1.DeployModelRequest} DeployModelRequest + */ + DeployModelRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.automl.v1beta1.DeployModelRequest) + return object; + var message = new $root.google.cloud.automl.v1beta1.DeployModelRequest(); + if (object.imageObjectDetectionModelDeploymentMetadata != null) { + if (typeof object.imageObjectDetectionModelDeploymentMetadata !== "object") + throw TypeError(".google.cloud.automl.v1beta1.DeployModelRequest.imageObjectDetectionModelDeploymentMetadata: object expected"); + message.imageObjectDetectionModelDeploymentMetadata = $root.google.cloud.automl.v1beta1.ImageObjectDetectionModelDeploymentMetadata.fromObject(object.imageObjectDetectionModelDeploymentMetadata); + } + if (object.imageClassificationModelDeploymentMetadata != null) { + if (typeof object.imageClassificationModelDeploymentMetadata !== "object") + throw TypeError(".google.cloud.automl.v1beta1.DeployModelRequest.imageClassificationModelDeploymentMetadata: object expected"); + message.imageClassificationModelDeploymentMetadata = $root.google.cloud.automl.v1beta1.ImageClassificationModelDeploymentMetadata.fromObject(object.imageClassificationModelDeploymentMetadata); + } + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a DeployModelRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.automl.v1beta1.DeployModelRequest + * @static + * @param {google.cloud.automl.v1beta1.DeployModelRequest} message DeployModelRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DeployModelRequest.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; + if (message.imageObjectDetectionModelDeploymentMetadata != null && message.hasOwnProperty("imageObjectDetectionModelDeploymentMetadata")) { + object.imageObjectDetectionModelDeploymentMetadata = $root.google.cloud.automl.v1beta1.ImageObjectDetectionModelDeploymentMetadata.toObject(message.imageObjectDetectionModelDeploymentMetadata, options); + if (options.oneofs) + object.modelDeploymentMetadata = "imageObjectDetectionModelDeploymentMetadata"; + } + if (message.imageClassificationModelDeploymentMetadata != null && message.hasOwnProperty("imageClassificationModelDeploymentMetadata")) { + object.imageClassificationModelDeploymentMetadata = $root.google.cloud.automl.v1beta1.ImageClassificationModelDeploymentMetadata.toObject(message.imageClassificationModelDeploymentMetadata, options); + if (options.oneofs) + object.modelDeploymentMetadata = "imageClassificationModelDeploymentMetadata"; + } + return object; + }; + + /** + * Converts this DeployModelRequest to JSON. + * @function toJSON + * @memberof google.cloud.automl.v1beta1.DeployModelRequest + * @instance + * @returns {Object.} JSON object + */ + DeployModelRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DeployModelRequest + * @function getTypeUrl + * @memberof google.cloud.automl.v1beta1.DeployModelRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DeployModelRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.automl.v1beta1.DeployModelRequest"; + }; + + return DeployModelRequest; + })(); + + v1beta1.UndeployModelRequest = (function() { + + /** + * Properties of an UndeployModelRequest. + * @memberof google.cloud.automl.v1beta1 + * @interface IUndeployModelRequest + * @property {string|null} [name] UndeployModelRequest name + */ + + /** + * Constructs a new UndeployModelRequest. + * @memberof google.cloud.automl.v1beta1 + * @classdesc Represents an UndeployModelRequest. + * @implements IUndeployModelRequest + * @constructor + * @param {google.cloud.automl.v1beta1.IUndeployModelRequest=} [properties] Properties to set + */ + function UndeployModelRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * UndeployModelRequest name. + * @member {string} name + * @memberof google.cloud.automl.v1beta1.UndeployModelRequest + * @instance + */ + UndeployModelRequest.prototype.name = ""; + + /** + * Creates a new UndeployModelRequest instance using the specified properties. + * @function create + * @memberof google.cloud.automl.v1beta1.UndeployModelRequest + * @static + * @param {google.cloud.automl.v1beta1.IUndeployModelRequest=} [properties] Properties to set + * @returns {google.cloud.automl.v1beta1.UndeployModelRequest} UndeployModelRequest instance + */ + UndeployModelRequest.create = function create(properties) { + return new UndeployModelRequest(properties); + }; + + /** + * Encodes the specified UndeployModelRequest message. Does not implicitly {@link google.cloud.automl.v1beta1.UndeployModelRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.automl.v1beta1.UndeployModelRequest + * @static + * @param {google.cloud.automl.v1beta1.IUndeployModelRequest} message UndeployModelRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UndeployModelRequest.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 UndeployModelRequest message, length delimited. Does not implicitly {@link google.cloud.automl.v1beta1.UndeployModelRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.automl.v1beta1.UndeployModelRequest + * @static + * @param {google.cloud.automl.v1beta1.IUndeployModelRequest} message UndeployModelRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UndeployModelRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an UndeployModelRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.automl.v1beta1.UndeployModelRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.automl.v1beta1.UndeployModelRequest} UndeployModelRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UndeployModelRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.automl.v1beta1.UndeployModelRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an UndeployModelRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.automl.v1beta1.UndeployModelRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.automl.v1beta1.UndeployModelRequest} UndeployModelRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UndeployModelRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an UndeployModelRequest message. + * @function verify + * @memberof google.cloud.automl.v1beta1.UndeployModelRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + UndeployModelRequest.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 an UndeployModelRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.automl.v1beta1.UndeployModelRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.automl.v1beta1.UndeployModelRequest} UndeployModelRequest + */ + UndeployModelRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.automl.v1beta1.UndeployModelRequest) + return object; + var message = new $root.google.cloud.automl.v1beta1.UndeployModelRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from an UndeployModelRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.automl.v1beta1.UndeployModelRequest + * @static + * @param {google.cloud.automl.v1beta1.UndeployModelRequest} message UndeployModelRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + UndeployModelRequest.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 UndeployModelRequest to JSON. + * @function toJSON + * @memberof google.cloud.automl.v1beta1.UndeployModelRequest + * @instance + * @returns {Object.} JSON object + */ + UndeployModelRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for UndeployModelRequest + * @function getTypeUrl + * @memberof google.cloud.automl.v1beta1.UndeployModelRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + UndeployModelRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.automl.v1beta1.UndeployModelRequest"; + }; + + return UndeployModelRequest; + })(); + + v1beta1.ExportModelRequest = (function() { + + /** + * Properties of an ExportModelRequest. + * @memberof google.cloud.automl.v1beta1 + * @interface IExportModelRequest + * @property {string|null} [name] ExportModelRequest name + * @property {google.cloud.automl.v1beta1.IModelExportOutputConfig|null} [outputConfig] ExportModelRequest outputConfig + */ + + /** + * Constructs a new ExportModelRequest. + * @memberof google.cloud.automl.v1beta1 + * @classdesc Represents an ExportModelRequest. + * @implements IExportModelRequest + * @constructor + * @param {google.cloud.automl.v1beta1.IExportModelRequest=} [properties] Properties to set + */ + function ExportModelRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ExportModelRequest name. + * @member {string} name + * @memberof google.cloud.automl.v1beta1.ExportModelRequest + * @instance + */ + ExportModelRequest.prototype.name = ""; + + /** + * ExportModelRequest outputConfig. + * @member {google.cloud.automl.v1beta1.IModelExportOutputConfig|null|undefined} outputConfig + * @memberof google.cloud.automl.v1beta1.ExportModelRequest + * @instance + */ + ExportModelRequest.prototype.outputConfig = null; + + /** + * Creates a new ExportModelRequest instance using the specified properties. + * @function create + * @memberof google.cloud.automl.v1beta1.ExportModelRequest + * @static + * @param {google.cloud.automl.v1beta1.IExportModelRequest=} [properties] Properties to set + * @returns {google.cloud.automl.v1beta1.ExportModelRequest} ExportModelRequest instance + */ + ExportModelRequest.create = function create(properties) { + return new ExportModelRequest(properties); + }; + + /** + * Encodes the specified ExportModelRequest message. Does not implicitly {@link google.cloud.automl.v1beta1.ExportModelRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.automl.v1beta1.ExportModelRequest + * @static + * @param {google.cloud.automl.v1beta1.IExportModelRequest} message ExportModelRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ExportModelRequest.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.outputConfig != null && Object.hasOwnProperty.call(message, "outputConfig")) + $root.google.cloud.automl.v1beta1.ModelExportOutputConfig.encode(message.outputConfig, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified ExportModelRequest message, length delimited. Does not implicitly {@link google.cloud.automl.v1beta1.ExportModelRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.automl.v1beta1.ExportModelRequest + * @static + * @param {google.cloud.automl.v1beta1.IExportModelRequest} message ExportModelRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ExportModelRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an ExportModelRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.automl.v1beta1.ExportModelRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.automl.v1beta1.ExportModelRequest} ExportModelRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ExportModelRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.automl.v1beta1.ExportModelRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 3: { + message.outputConfig = $root.google.cloud.automl.v1beta1.ModelExportOutputConfig.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an ExportModelRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.automl.v1beta1.ExportModelRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.automl.v1beta1.ExportModelRequest} ExportModelRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ExportModelRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an ExportModelRequest message. + * @function verify + * @memberof google.cloud.automl.v1beta1.ExportModelRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ExportModelRequest.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.outputConfig != null && message.hasOwnProperty("outputConfig")) { + var error = $root.google.cloud.automl.v1beta1.ModelExportOutputConfig.verify(message.outputConfig); + if (error) + return "outputConfig." + error; + } + return null; + }; + + /** + * Creates an ExportModelRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.automl.v1beta1.ExportModelRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.automl.v1beta1.ExportModelRequest} ExportModelRequest + */ + ExportModelRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.automl.v1beta1.ExportModelRequest) + return object; + var message = new $root.google.cloud.automl.v1beta1.ExportModelRequest(); + if (object.name != null) + message.name = String(object.name); + if (object.outputConfig != null) { + if (typeof object.outputConfig !== "object") + throw TypeError(".google.cloud.automl.v1beta1.ExportModelRequest.outputConfig: object expected"); + message.outputConfig = $root.google.cloud.automl.v1beta1.ModelExportOutputConfig.fromObject(object.outputConfig); + } + return message; + }; + + /** + * Creates a plain object from an ExportModelRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.automl.v1beta1.ExportModelRequest + * @static + * @param {google.cloud.automl.v1beta1.ExportModelRequest} message ExportModelRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ExportModelRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.outputConfig = null; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.outputConfig != null && message.hasOwnProperty("outputConfig")) + object.outputConfig = $root.google.cloud.automl.v1beta1.ModelExportOutputConfig.toObject(message.outputConfig, options); + return object; + }; + + /** + * Converts this ExportModelRequest to JSON. + * @function toJSON + * @memberof google.cloud.automl.v1beta1.ExportModelRequest + * @instance + * @returns {Object.} JSON object + */ + ExportModelRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ExportModelRequest + * @function getTypeUrl + * @memberof google.cloud.automl.v1beta1.ExportModelRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ExportModelRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.automl.v1beta1.ExportModelRequest"; + }; + + return ExportModelRequest; + })(); + + v1beta1.ExportEvaluatedExamplesRequest = (function() { + + /** + * Properties of an ExportEvaluatedExamplesRequest. + * @memberof google.cloud.automl.v1beta1 + * @interface IExportEvaluatedExamplesRequest + * @property {string|null} [name] ExportEvaluatedExamplesRequest name + * @property {google.cloud.automl.v1beta1.IExportEvaluatedExamplesOutputConfig|null} [outputConfig] ExportEvaluatedExamplesRequest outputConfig + */ + + /** + * Constructs a new ExportEvaluatedExamplesRequest. + * @memberof google.cloud.automl.v1beta1 + * @classdesc Represents an ExportEvaluatedExamplesRequest. + * @implements IExportEvaluatedExamplesRequest + * @constructor + * @param {google.cloud.automl.v1beta1.IExportEvaluatedExamplesRequest=} [properties] Properties to set + */ + function ExportEvaluatedExamplesRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ExportEvaluatedExamplesRequest name. + * @member {string} name + * @memberof google.cloud.automl.v1beta1.ExportEvaluatedExamplesRequest + * @instance + */ + ExportEvaluatedExamplesRequest.prototype.name = ""; + + /** + * ExportEvaluatedExamplesRequest outputConfig. + * @member {google.cloud.automl.v1beta1.IExportEvaluatedExamplesOutputConfig|null|undefined} outputConfig + * @memberof google.cloud.automl.v1beta1.ExportEvaluatedExamplesRequest + * @instance + */ + ExportEvaluatedExamplesRequest.prototype.outputConfig = null; + + /** + * Creates a new ExportEvaluatedExamplesRequest instance using the specified properties. + * @function create + * @memberof google.cloud.automl.v1beta1.ExportEvaluatedExamplesRequest + * @static + * @param {google.cloud.automl.v1beta1.IExportEvaluatedExamplesRequest=} [properties] Properties to set + * @returns {google.cloud.automl.v1beta1.ExportEvaluatedExamplesRequest} ExportEvaluatedExamplesRequest instance + */ + ExportEvaluatedExamplesRequest.create = function create(properties) { + return new ExportEvaluatedExamplesRequest(properties); + }; + + /** + * Encodes the specified ExportEvaluatedExamplesRequest message. Does not implicitly {@link google.cloud.automl.v1beta1.ExportEvaluatedExamplesRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.automl.v1beta1.ExportEvaluatedExamplesRequest + * @static + * @param {google.cloud.automl.v1beta1.IExportEvaluatedExamplesRequest} message ExportEvaluatedExamplesRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ExportEvaluatedExamplesRequest.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.outputConfig != null && Object.hasOwnProperty.call(message, "outputConfig")) + $root.google.cloud.automl.v1beta1.ExportEvaluatedExamplesOutputConfig.encode(message.outputConfig, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified ExportEvaluatedExamplesRequest message, length delimited. Does not implicitly {@link google.cloud.automl.v1beta1.ExportEvaluatedExamplesRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.automl.v1beta1.ExportEvaluatedExamplesRequest + * @static + * @param {google.cloud.automl.v1beta1.IExportEvaluatedExamplesRequest} message ExportEvaluatedExamplesRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ExportEvaluatedExamplesRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an ExportEvaluatedExamplesRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.automl.v1beta1.ExportEvaluatedExamplesRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.automl.v1beta1.ExportEvaluatedExamplesRequest} ExportEvaluatedExamplesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ExportEvaluatedExamplesRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.automl.v1beta1.ExportEvaluatedExamplesRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 3: { + message.outputConfig = $root.google.cloud.automl.v1beta1.ExportEvaluatedExamplesOutputConfig.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an ExportEvaluatedExamplesRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.automl.v1beta1.ExportEvaluatedExamplesRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.automl.v1beta1.ExportEvaluatedExamplesRequest} ExportEvaluatedExamplesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ExportEvaluatedExamplesRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an ExportEvaluatedExamplesRequest message. + * @function verify + * @memberof google.cloud.automl.v1beta1.ExportEvaluatedExamplesRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ExportEvaluatedExamplesRequest.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.outputConfig != null && message.hasOwnProperty("outputConfig")) { + var error = $root.google.cloud.automl.v1beta1.ExportEvaluatedExamplesOutputConfig.verify(message.outputConfig); + if (error) + return "outputConfig." + error; + } + return null; + }; + + /** + * Creates an ExportEvaluatedExamplesRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.automl.v1beta1.ExportEvaluatedExamplesRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.automl.v1beta1.ExportEvaluatedExamplesRequest} ExportEvaluatedExamplesRequest + */ + ExportEvaluatedExamplesRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.automl.v1beta1.ExportEvaluatedExamplesRequest) + return object; + var message = new $root.google.cloud.automl.v1beta1.ExportEvaluatedExamplesRequest(); + if (object.name != null) + message.name = String(object.name); + if (object.outputConfig != null) { + if (typeof object.outputConfig !== "object") + throw TypeError(".google.cloud.automl.v1beta1.ExportEvaluatedExamplesRequest.outputConfig: object expected"); + message.outputConfig = $root.google.cloud.automl.v1beta1.ExportEvaluatedExamplesOutputConfig.fromObject(object.outputConfig); + } + return message; + }; + + /** + * Creates a plain object from an ExportEvaluatedExamplesRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.automl.v1beta1.ExportEvaluatedExamplesRequest + * @static + * @param {google.cloud.automl.v1beta1.ExportEvaluatedExamplesRequest} message ExportEvaluatedExamplesRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ExportEvaluatedExamplesRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.outputConfig = null; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.outputConfig != null && message.hasOwnProperty("outputConfig")) + object.outputConfig = $root.google.cloud.automl.v1beta1.ExportEvaluatedExamplesOutputConfig.toObject(message.outputConfig, options); + return object; + }; + + /** + * Converts this ExportEvaluatedExamplesRequest to JSON. + * @function toJSON + * @memberof google.cloud.automl.v1beta1.ExportEvaluatedExamplesRequest + * @instance + * @returns {Object.} JSON object + */ + ExportEvaluatedExamplesRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ExportEvaluatedExamplesRequest + * @function getTypeUrl + * @memberof google.cloud.automl.v1beta1.ExportEvaluatedExamplesRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ExportEvaluatedExamplesRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.automl.v1beta1.ExportEvaluatedExamplesRequest"; + }; + + return ExportEvaluatedExamplesRequest; + })(); + + v1beta1.GetModelEvaluationRequest = (function() { + + /** + * Properties of a GetModelEvaluationRequest. + * @memberof google.cloud.automl.v1beta1 + * @interface IGetModelEvaluationRequest + * @property {string|null} [name] GetModelEvaluationRequest name + */ + + /** + * Constructs a new GetModelEvaluationRequest. + * @memberof google.cloud.automl.v1beta1 + * @classdesc Represents a GetModelEvaluationRequest. + * @implements IGetModelEvaluationRequest + * @constructor + * @param {google.cloud.automl.v1beta1.IGetModelEvaluationRequest=} [properties] Properties to set + */ + function GetModelEvaluationRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetModelEvaluationRequest name. + * @member {string} name + * @memberof google.cloud.automl.v1beta1.GetModelEvaluationRequest + * @instance + */ + GetModelEvaluationRequest.prototype.name = ""; + + /** + * Creates a new GetModelEvaluationRequest instance using the specified properties. + * @function create + * @memberof google.cloud.automl.v1beta1.GetModelEvaluationRequest + * @static + * @param {google.cloud.automl.v1beta1.IGetModelEvaluationRequest=} [properties] Properties to set + * @returns {google.cloud.automl.v1beta1.GetModelEvaluationRequest} GetModelEvaluationRequest instance + */ + GetModelEvaluationRequest.create = function create(properties) { + return new GetModelEvaluationRequest(properties); + }; + + /** + * Encodes the specified GetModelEvaluationRequest message. Does not implicitly {@link google.cloud.automl.v1beta1.GetModelEvaluationRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.automl.v1beta1.GetModelEvaluationRequest + * @static + * @param {google.cloud.automl.v1beta1.IGetModelEvaluationRequest} message GetModelEvaluationRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetModelEvaluationRequest.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 GetModelEvaluationRequest message, length delimited. Does not implicitly {@link google.cloud.automl.v1beta1.GetModelEvaluationRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.automl.v1beta1.GetModelEvaluationRequest + * @static + * @param {google.cloud.automl.v1beta1.IGetModelEvaluationRequest} message GetModelEvaluationRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetModelEvaluationRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetModelEvaluationRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.automl.v1beta1.GetModelEvaluationRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.automl.v1beta1.GetModelEvaluationRequest} GetModelEvaluationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetModelEvaluationRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.automl.v1beta1.GetModelEvaluationRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetModelEvaluationRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.automl.v1beta1.GetModelEvaluationRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.automl.v1beta1.GetModelEvaluationRequest} GetModelEvaluationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetModelEvaluationRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetModelEvaluationRequest message. + * @function verify + * @memberof google.cloud.automl.v1beta1.GetModelEvaluationRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetModelEvaluationRequest.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 GetModelEvaluationRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.automl.v1beta1.GetModelEvaluationRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.automl.v1beta1.GetModelEvaluationRequest} GetModelEvaluationRequest + */ + GetModelEvaluationRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.automl.v1beta1.GetModelEvaluationRequest) + return object; + var message = new $root.google.cloud.automl.v1beta1.GetModelEvaluationRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a GetModelEvaluationRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.automl.v1beta1.GetModelEvaluationRequest + * @static + * @param {google.cloud.automl.v1beta1.GetModelEvaluationRequest} message GetModelEvaluationRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetModelEvaluationRequest.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 GetModelEvaluationRequest to JSON. + * @function toJSON + * @memberof google.cloud.automl.v1beta1.GetModelEvaluationRequest + * @instance + * @returns {Object.} JSON object + */ + GetModelEvaluationRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GetModelEvaluationRequest + * @function getTypeUrl + * @memberof google.cloud.automl.v1beta1.GetModelEvaluationRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GetModelEvaluationRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.automl.v1beta1.GetModelEvaluationRequest"; + }; + + return GetModelEvaluationRequest; + })(); + + v1beta1.ListModelEvaluationsRequest = (function() { + + /** + * Properties of a ListModelEvaluationsRequest. + * @memberof google.cloud.automl.v1beta1 + * @interface IListModelEvaluationsRequest + * @property {string|null} [parent] ListModelEvaluationsRequest parent + * @property {string|null} [filter] ListModelEvaluationsRequest filter + * @property {number|null} [pageSize] ListModelEvaluationsRequest pageSize + * @property {string|null} [pageToken] ListModelEvaluationsRequest pageToken + */ + + /** + * Constructs a new ListModelEvaluationsRequest. + * @memberof google.cloud.automl.v1beta1 + * @classdesc Represents a ListModelEvaluationsRequest. + * @implements IListModelEvaluationsRequest + * @constructor + * @param {google.cloud.automl.v1beta1.IListModelEvaluationsRequest=} [properties] Properties to set + */ + function ListModelEvaluationsRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListModelEvaluationsRequest parent. + * @member {string} parent + * @memberof google.cloud.automl.v1beta1.ListModelEvaluationsRequest + * @instance + */ + ListModelEvaluationsRequest.prototype.parent = ""; + + /** + * ListModelEvaluationsRequest filter. + * @member {string} filter + * @memberof google.cloud.automl.v1beta1.ListModelEvaluationsRequest + * @instance + */ + ListModelEvaluationsRequest.prototype.filter = ""; + + /** + * ListModelEvaluationsRequest pageSize. + * @member {number} pageSize + * @memberof google.cloud.automl.v1beta1.ListModelEvaluationsRequest + * @instance + */ + ListModelEvaluationsRequest.prototype.pageSize = 0; + + /** + * ListModelEvaluationsRequest pageToken. + * @member {string} pageToken + * @memberof google.cloud.automl.v1beta1.ListModelEvaluationsRequest + * @instance + */ + ListModelEvaluationsRequest.prototype.pageToken = ""; + + /** + * Creates a new ListModelEvaluationsRequest instance using the specified properties. + * @function create + * @memberof google.cloud.automl.v1beta1.ListModelEvaluationsRequest + * @static + * @param {google.cloud.automl.v1beta1.IListModelEvaluationsRequest=} [properties] Properties to set + * @returns {google.cloud.automl.v1beta1.ListModelEvaluationsRequest} ListModelEvaluationsRequest instance + */ + ListModelEvaluationsRequest.create = function create(properties) { + return new ListModelEvaluationsRequest(properties); + }; + + /** + * Encodes the specified ListModelEvaluationsRequest message. Does not implicitly {@link google.cloud.automl.v1beta1.ListModelEvaluationsRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.automl.v1beta1.ListModelEvaluationsRequest + * @static + * @param {google.cloud.automl.v1beta1.IListModelEvaluationsRequest} message ListModelEvaluationsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListModelEvaluationsRequest.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.filter != null && Object.hasOwnProperty.call(message, "filter")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.filter); + if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.pageSize); + if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.pageToken); + return writer; + }; + + /** + * Encodes the specified ListModelEvaluationsRequest message, length delimited. Does not implicitly {@link google.cloud.automl.v1beta1.ListModelEvaluationsRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.automl.v1beta1.ListModelEvaluationsRequest + * @static + * @param {google.cloud.automl.v1beta1.IListModelEvaluationsRequest} message ListModelEvaluationsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListModelEvaluationsRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListModelEvaluationsRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.automl.v1beta1.ListModelEvaluationsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.automl.v1beta1.ListModelEvaluationsRequest} ListModelEvaluationsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListModelEvaluationsRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.automl.v1beta1.ListModelEvaluationsRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 3: { + message.filter = reader.string(); + break; + } + case 4: { + message.pageSize = reader.int32(); + break; + } + case 6: { + message.pageToken = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListModelEvaluationsRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.automl.v1beta1.ListModelEvaluationsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.automl.v1beta1.ListModelEvaluationsRequest} ListModelEvaluationsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListModelEvaluationsRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListModelEvaluationsRequest message. + * @function verify + * @memberof google.cloud.automl.v1beta1.ListModelEvaluationsRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListModelEvaluationsRequest.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.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 ListModelEvaluationsRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.automl.v1beta1.ListModelEvaluationsRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.automl.v1beta1.ListModelEvaluationsRequest} ListModelEvaluationsRequest + */ + ListModelEvaluationsRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.automl.v1beta1.ListModelEvaluationsRequest) + return object; + var message = new $root.google.cloud.automl.v1beta1.ListModelEvaluationsRequest(); + if (object.parent != null) + message.parent = String(object.parent); + 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 ListModelEvaluationsRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.automl.v1beta1.ListModelEvaluationsRequest + * @static + * @param {google.cloud.automl.v1beta1.ListModelEvaluationsRequest} message ListModelEvaluationsRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListModelEvaluationsRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.filter = ""; + object.pageSize = 0; + object.pageToken = ""; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + 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; + return object; + }; + + /** + * Converts this ListModelEvaluationsRequest to JSON. + * @function toJSON + * @memberof google.cloud.automl.v1beta1.ListModelEvaluationsRequest + * @instance + * @returns {Object.} JSON object + */ + ListModelEvaluationsRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListModelEvaluationsRequest + * @function getTypeUrl + * @memberof google.cloud.automl.v1beta1.ListModelEvaluationsRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListModelEvaluationsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.automl.v1beta1.ListModelEvaluationsRequest"; + }; + + return ListModelEvaluationsRequest; + })(); + + v1beta1.ListModelEvaluationsResponse = (function() { + + /** + * Properties of a ListModelEvaluationsResponse. + * @memberof google.cloud.automl.v1beta1 + * @interface IListModelEvaluationsResponse + * @property {Array.|null} [modelEvaluation] ListModelEvaluationsResponse modelEvaluation + * @property {string|null} [nextPageToken] ListModelEvaluationsResponse nextPageToken + */ + + /** + * Constructs a new ListModelEvaluationsResponse. + * @memberof google.cloud.automl.v1beta1 + * @classdesc Represents a ListModelEvaluationsResponse. + * @implements IListModelEvaluationsResponse + * @constructor + * @param {google.cloud.automl.v1beta1.IListModelEvaluationsResponse=} [properties] Properties to set + */ + function ListModelEvaluationsResponse(properties) { + this.modelEvaluation = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListModelEvaluationsResponse modelEvaluation. + * @member {Array.} modelEvaluation + * @memberof google.cloud.automl.v1beta1.ListModelEvaluationsResponse + * @instance + */ + ListModelEvaluationsResponse.prototype.modelEvaluation = $util.emptyArray; + + /** + * ListModelEvaluationsResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.cloud.automl.v1beta1.ListModelEvaluationsResponse + * @instance + */ + ListModelEvaluationsResponse.prototype.nextPageToken = ""; + + /** + * Creates a new ListModelEvaluationsResponse instance using the specified properties. + * @function create + * @memberof google.cloud.automl.v1beta1.ListModelEvaluationsResponse + * @static + * @param {google.cloud.automl.v1beta1.IListModelEvaluationsResponse=} [properties] Properties to set + * @returns {google.cloud.automl.v1beta1.ListModelEvaluationsResponse} ListModelEvaluationsResponse instance + */ + ListModelEvaluationsResponse.create = function create(properties) { + return new ListModelEvaluationsResponse(properties); + }; + + /** + * Encodes the specified ListModelEvaluationsResponse message. Does not implicitly {@link google.cloud.automl.v1beta1.ListModelEvaluationsResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.automl.v1beta1.ListModelEvaluationsResponse + * @static + * @param {google.cloud.automl.v1beta1.IListModelEvaluationsResponse} message ListModelEvaluationsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListModelEvaluationsResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.modelEvaluation != null && message.modelEvaluation.length) + for (var i = 0; i < message.modelEvaluation.length; ++i) + $root.google.cloud.automl.v1beta1.ModelEvaluation.encode(message.modelEvaluation[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 ListModelEvaluationsResponse message, length delimited. Does not implicitly {@link google.cloud.automl.v1beta1.ListModelEvaluationsResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.automl.v1beta1.ListModelEvaluationsResponse + * @static + * @param {google.cloud.automl.v1beta1.IListModelEvaluationsResponse} message ListModelEvaluationsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListModelEvaluationsResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListModelEvaluationsResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.automl.v1beta1.ListModelEvaluationsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.automl.v1beta1.ListModelEvaluationsResponse} ListModelEvaluationsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListModelEvaluationsResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.automl.v1beta1.ListModelEvaluationsResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.modelEvaluation && message.modelEvaluation.length)) + message.modelEvaluation = []; + message.modelEvaluation.push($root.google.cloud.automl.v1beta1.ModelEvaluation.decode(reader, reader.uint32())); + break; + } + case 2: { + message.nextPageToken = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListModelEvaluationsResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.automl.v1beta1.ListModelEvaluationsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.automl.v1beta1.ListModelEvaluationsResponse} ListModelEvaluationsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListModelEvaluationsResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListModelEvaluationsResponse message. + * @function verify + * @memberof google.cloud.automl.v1beta1.ListModelEvaluationsResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListModelEvaluationsResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.modelEvaluation != null && message.hasOwnProperty("modelEvaluation")) { + if (!Array.isArray(message.modelEvaluation)) + return "modelEvaluation: array expected"; + for (var i = 0; i < message.modelEvaluation.length; ++i) { + var error = $root.google.cloud.automl.v1beta1.ModelEvaluation.verify(message.modelEvaluation[i]); + if (error) + return "modelEvaluation." + error; + } + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + return null; + }; + + /** + * Creates a ListModelEvaluationsResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.automl.v1beta1.ListModelEvaluationsResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.automl.v1beta1.ListModelEvaluationsResponse} ListModelEvaluationsResponse + */ + ListModelEvaluationsResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.automl.v1beta1.ListModelEvaluationsResponse) + return object; + var message = new $root.google.cloud.automl.v1beta1.ListModelEvaluationsResponse(); + if (object.modelEvaluation) { + if (!Array.isArray(object.modelEvaluation)) + throw TypeError(".google.cloud.automl.v1beta1.ListModelEvaluationsResponse.modelEvaluation: array expected"); + message.modelEvaluation = []; + for (var i = 0; i < object.modelEvaluation.length; ++i) { + if (typeof object.modelEvaluation[i] !== "object") + throw TypeError(".google.cloud.automl.v1beta1.ListModelEvaluationsResponse.modelEvaluation: object expected"); + message.modelEvaluation[i] = $root.google.cloud.automl.v1beta1.ModelEvaluation.fromObject(object.modelEvaluation[i]); + } + } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + return message; + }; + + /** + * Creates a plain object from a ListModelEvaluationsResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.automl.v1beta1.ListModelEvaluationsResponse + * @static + * @param {google.cloud.automl.v1beta1.ListModelEvaluationsResponse} message ListModelEvaluationsResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListModelEvaluationsResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.modelEvaluation = []; + if (options.defaults) + object.nextPageToken = ""; + if (message.modelEvaluation && message.modelEvaluation.length) { + object.modelEvaluation = []; + for (var j = 0; j < message.modelEvaluation.length; ++j) + object.modelEvaluation[j] = $root.google.cloud.automl.v1beta1.ModelEvaluation.toObject(message.modelEvaluation[j], options); + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + object.nextPageToken = message.nextPageToken; + return object; + }; + + /** + * Converts this ListModelEvaluationsResponse to JSON. + * @function toJSON + * @memberof google.cloud.automl.v1beta1.ListModelEvaluationsResponse + * @instance + * @returns {Object.} JSON object + */ + ListModelEvaluationsResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListModelEvaluationsResponse + * @function getTypeUrl + * @memberof google.cloud.automl.v1beta1.ListModelEvaluationsResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListModelEvaluationsResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.automl.v1beta1.ListModelEvaluationsResponse"; + }; + + return ListModelEvaluationsResponse; + })(); + + v1beta1.TableSpec = (function() { + + /** + * Properties of a TableSpec. + * @memberof google.cloud.automl.v1beta1 + * @interface ITableSpec + * @property {string|null} [name] TableSpec name + * @property {string|null} [timeColumnSpecId] TableSpec timeColumnSpecId + * @property {number|Long|null} [rowCount] TableSpec rowCount + * @property {number|Long|null} [validRowCount] TableSpec validRowCount + * @property {number|Long|null} [columnCount] TableSpec columnCount + * @property {Array.|null} [inputConfigs] TableSpec inputConfigs + * @property {string|null} [etag] TableSpec etag + */ + + /** + * Constructs a new TableSpec. + * @memberof google.cloud.automl.v1beta1 + * @classdesc Represents a TableSpec. + * @implements ITableSpec + * @constructor + * @param {google.cloud.automl.v1beta1.ITableSpec=} [properties] Properties to set + */ + function TableSpec(properties) { + this.inputConfigs = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * TableSpec name. + * @member {string} name + * @memberof google.cloud.automl.v1beta1.TableSpec + * @instance + */ + TableSpec.prototype.name = ""; + + /** + * TableSpec timeColumnSpecId. + * @member {string} timeColumnSpecId + * @memberof google.cloud.automl.v1beta1.TableSpec + * @instance + */ + TableSpec.prototype.timeColumnSpecId = ""; + + /** + * TableSpec rowCount. + * @member {number|Long} rowCount + * @memberof google.cloud.automl.v1beta1.TableSpec + * @instance + */ + TableSpec.prototype.rowCount = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * TableSpec validRowCount. + * @member {number|Long} validRowCount + * @memberof google.cloud.automl.v1beta1.TableSpec + * @instance + */ + TableSpec.prototype.validRowCount = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * TableSpec columnCount. + * @member {number|Long} columnCount + * @memberof google.cloud.automl.v1beta1.TableSpec + * @instance + */ + TableSpec.prototype.columnCount = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * TableSpec inputConfigs. + * @member {Array.} inputConfigs + * @memberof google.cloud.automl.v1beta1.TableSpec + * @instance + */ + TableSpec.prototype.inputConfigs = $util.emptyArray; + + /** + * TableSpec etag. + * @member {string} etag + * @memberof google.cloud.automl.v1beta1.TableSpec + * @instance + */ + TableSpec.prototype.etag = ""; + + /** + * Creates a new TableSpec instance using the specified properties. + * @function create + * @memberof google.cloud.automl.v1beta1.TableSpec + * @static + * @param {google.cloud.automl.v1beta1.ITableSpec=} [properties] Properties to set + * @returns {google.cloud.automl.v1beta1.TableSpec} TableSpec instance + */ + TableSpec.create = function create(properties) { + return new TableSpec(properties); + }; + + /** + * Encodes the specified TableSpec message. Does not implicitly {@link google.cloud.automl.v1beta1.TableSpec.verify|verify} messages. + * @function encode + * @memberof google.cloud.automl.v1beta1.TableSpec + * @static + * @param {google.cloud.automl.v1beta1.ITableSpec} message TableSpec message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TableSpec.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.timeColumnSpecId != null && Object.hasOwnProperty.call(message, "timeColumnSpecId")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.timeColumnSpecId); + if (message.rowCount != null && Object.hasOwnProperty.call(message, "rowCount")) + writer.uint32(/* id 3, wireType 0 =*/24).int64(message.rowCount); + if (message.validRowCount != null && Object.hasOwnProperty.call(message, "validRowCount")) + writer.uint32(/* id 4, wireType 0 =*/32).int64(message.validRowCount); + if (message.inputConfigs != null && message.inputConfigs.length) + for (var i = 0; i < message.inputConfigs.length; ++i) + $root.google.cloud.automl.v1beta1.InputConfig.encode(message.inputConfigs[i], writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.etag != null && Object.hasOwnProperty.call(message, "etag")) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.etag); + if (message.columnCount != null && Object.hasOwnProperty.call(message, "columnCount")) + writer.uint32(/* id 7, wireType 0 =*/56).int64(message.columnCount); + return writer; + }; + + /** + * Encodes the specified TableSpec message, length delimited. Does not implicitly {@link google.cloud.automl.v1beta1.TableSpec.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.automl.v1beta1.TableSpec + * @static + * @param {google.cloud.automl.v1beta1.ITableSpec} message TableSpec message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TableSpec.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a TableSpec message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.automl.v1beta1.TableSpec + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.automl.v1beta1.TableSpec} TableSpec + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TableSpec.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.automl.v1beta1.TableSpec(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.timeColumnSpecId = reader.string(); + break; + } + case 3: { + message.rowCount = reader.int64(); + break; + } + case 4: { + message.validRowCount = reader.int64(); + break; + } + case 7: { + message.columnCount = reader.int64(); + break; + } + case 5: { + if (!(message.inputConfigs && message.inputConfigs.length)) + message.inputConfigs = []; + message.inputConfigs.push($root.google.cloud.automl.v1beta1.InputConfig.decode(reader, reader.uint32())); + break; + } + case 6: { + message.etag = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a TableSpec message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.automl.v1beta1.TableSpec + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.automl.v1beta1.TableSpec} TableSpec + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TableSpec.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a TableSpec message. + * @function verify + * @memberof google.cloud.automl.v1beta1.TableSpec + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + TableSpec.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.timeColumnSpecId != null && message.hasOwnProperty("timeColumnSpecId")) + if (!$util.isString(message.timeColumnSpecId)) + return "timeColumnSpecId: string expected"; + if (message.rowCount != null && message.hasOwnProperty("rowCount")) + if (!$util.isInteger(message.rowCount) && !(message.rowCount && $util.isInteger(message.rowCount.low) && $util.isInteger(message.rowCount.high))) + return "rowCount: integer|Long expected"; + if (message.validRowCount != null && message.hasOwnProperty("validRowCount")) + if (!$util.isInteger(message.validRowCount) && !(message.validRowCount && $util.isInteger(message.validRowCount.low) && $util.isInteger(message.validRowCount.high))) + return "validRowCount: integer|Long expected"; + if (message.columnCount != null && message.hasOwnProperty("columnCount")) + if (!$util.isInteger(message.columnCount) && !(message.columnCount && $util.isInteger(message.columnCount.low) && $util.isInteger(message.columnCount.high))) + return "columnCount: integer|Long expected"; + if (message.inputConfigs != null && message.hasOwnProperty("inputConfigs")) { + if (!Array.isArray(message.inputConfigs)) + return "inputConfigs: array expected"; + for (var i = 0; i < message.inputConfigs.length; ++i) { + var error = $root.google.cloud.automl.v1beta1.InputConfig.verify(message.inputConfigs[i]); + if (error) + return "inputConfigs." + error; + } + } + if (message.etag != null && message.hasOwnProperty("etag")) + if (!$util.isString(message.etag)) + return "etag: string expected"; + return null; + }; + + /** + * Creates a TableSpec message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.automl.v1beta1.TableSpec + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.automl.v1beta1.TableSpec} TableSpec + */ + TableSpec.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.automl.v1beta1.TableSpec) + return object; + var message = new $root.google.cloud.automl.v1beta1.TableSpec(); + if (object.name != null) + message.name = String(object.name); + if (object.timeColumnSpecId != null) + message.timeColumnSpecId = String(object.timeColumnSpecId); + if (object.rowCount != null) + if ($util.Long) + (message.rowCount = $util.Long.fromValue(object.rowCount)).unsigned = false; + else if (typeof object.rowCount === "string") + message.rowCount = parseInt(object.rowCount, 10); + else if (typeof object.rowCount === "number") + message.rowCount = object.rowCount; + else if (typeof object.rowCount === "object") + message.rowCount = new $util.LongBits(object.rowCount.low >>> 0, object.rowCount.high >>> 0).toNumber(); + if (object.validRowCount != null) + if ($util.Long) + (message.validRowCount = $util.Long.fromValue(object.validRowCount)).unsigned = false; + else if (typeof object.validRowCount === "string") + message.validRowCount = parseInt(object.validRowCount, 10); + else if (typeof object.validRowCount === "number") + message.validRowCount = object.validRowCount; + else if (typeof object.validRowCount === "object") + message.validRowCount = new $util.LongBits(object.validRowCount.low >>> 0, object.validRowCount.high >>> 0).toNumber(); + if (object.columnCount != null) + if ($util.Long) + (message.columnCount = $util.Long.fromValue(object.columnCount)).unsigned = false; + else if (typeof object.columnCount === "string") + message.columnCount = parseInt(object.columnCount, 10); + else if (typeof object.columnCount === "number") + message.columnCount = object.columnCount; + else if (typeof object.columnCount === "object") + message.columnCount = new $util.LongBits(object.columnCount.low >>> 0, object.columnCount.high >>> 0).toNumber(); + if (object.inputConfigs) { + if (!Array.isArray(object.inputConfigs)) + throw TypeError(".google.cloud.automl.v1beta1.TableSpec.inputConfigs: array expected"); + message.inputConfigs = []; + for (var i = 0; i < object.inputConfigs.length; ++i) { + if (typeof object.inputConfigs[i] !== "object") + throw TypeError(".google.cloud.automl.v1beta1.TableSpec.inputConfigs: object expected"); + message.inputConfigs[i] = $root.google.cloud.automl.v1beta1.InputConfig.fromObject(object.inputConfigs[i]); + } + } + if (object.etag != null) + message.etag = String(object.etag); + return message; + }; + + /** + * Creates a plain object from a TableSpec message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.automl.v1beta1.TableSpec + * @static + * @param {google.cloud.automl.v1beta1.TableSpec} message TableSpec + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + TableSpec.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.inputConfigs = []; + if (options.defaults) { + object.name = ""; + object.timeColumnSpecId = ""; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.rowCount = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.rowCount = options.longs === String ? "0" : 0; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.validRowCount = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.validRowCount = options.longs === String ? "0" : 0; + object.etag = ""; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.columnCount = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.columnCount = options.longs === String ? "0" : 0; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.timeColumnSpecId != null && message.hasOwnProperty("timeColumnSpecId")) + object.timeColumnSpecId = message.timeColumnSpecId; + if (message.rowCount != null && message.hasOwnProperty("rowCount")) + if (typeof message.rowCount === "number") + object.rowCount = options.longs === String ? String(message.rowCount) : message.rowCount; + else + object.rowCount = options.longs === String ? $util.Long.prototype.toString.call(message.rowCount) : options.longs === Number ? new $util.LongBits(message.rowCount.low >>> 0, message.rowCount.high >>> 0).toNumber() : message.rowCount; + if (message.validRowCount != null && message.hasOwnProperty("validRowCount")) + if (typeof message.validRowCount === "number") + object.validRowCount = options.longs === String ? String(message.validRowCount) : message.validRowCount; + else + object.validRowCount = options.longs === String ? $util.Long.prototype.toString.call(message.validRowCount) : options.longs === Number ? new $util.LongBits(message.validRowCount.low >>> 0, message.validRowCount.high >>> 0).toNumber() : message.validRowCount; + if (message.inputConfigs && message.inputConfigs.length) { + object.inputConfigs = []; + for (var j = 0; j < message.inputConfigs.length; ++j) + object.inputConfigs[j] = $root.google.cloud.automl.v1beta1.InputConfig.toObject(message.inputConfigs[j], options); + } + if (message.etag != null && message.hasOwnProperty("etag")) + object.etag = message.etag; + if (message.columnCount != null && message.hasOwnProperty("columnCount")) + if (typeof message.columnCount === "number") + object.columnCount = options.longs === String ? String(message.columnCount) : message.columnCount; + else + object.columnCount = options.longs === String ? $util.Long.prototype.toString.call(message.columnCount) : options.longs === Number ? new $util.LongBits(message.columnCount.low >>> 0, message.columnCount.high >>> 0).toNumber() : message.columnCount; + return object; + }; + + /** + * Converts this TableSpec to JSON. + * @function toJSON + * @memberof google.cloud.automl.v1beta1.TableSpec + * @instance + * @returns {Object.} JSON object + */ + TableSpec.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for TableSpec + * @function getTypeUrl + * @memberof google.cloud.automl.v1beta1.TableSpec + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TableSpec.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.automl.v1beta1.TableSpec"; + }; + + return TableSpec; + })(); + + return v1beta1; + })(); + + return automl; + })(); + + return cloud; + })(); + + google.api = (function() { + + /** + * Namespace api. + * @memberof google + * @namespace + */ + var api = {}; + + /** + * 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 + */ + 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; + 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) { + 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(); + 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) { + 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(); + 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; + })(); + + 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) { + 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(); + 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) { + 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(); + 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) { + 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(); + 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) { + 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(); + 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) { + 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(); + 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 + */ + + /** + * 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; + + /** + * 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(); + 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) { + 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(); + 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; + } + 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: + 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; + } + } + 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; + } + 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]); + } + } + 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; + } + 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); + } + 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) { + 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(); + 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) { + 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(); + 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) { + 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(); + 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) { + 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(); + 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) { + 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(); + 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 + */ + + /** + * 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) { + if (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; + + /** + * 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(); + 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) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.DotnetSettings(); + while (reader.pos < end) { + var tag = reader.uint32(); + 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 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; + } + 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); + } + 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.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 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) { + 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(); + 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) { + 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(); + 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 + */ + + /** + * 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) { + if (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; + + /** + * 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(); + 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) { + 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(); + switch (tag >>> 3) { + case 1: { + message.selector = reader.string(); + break; + } + case 2: { + message.longRunning = $root.google.api.MethodSettings.LongRunning.decode(reader, reader.uint32()); + 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; + } + 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); + } + 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.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); + 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) { + 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(); + 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 + */ + 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; + 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; + })(); + + 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) { + 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(); + 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; + })(); + + 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 {string|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 {string} edition + * @memberof google.protobuf.FileDescriptorProto + * @instance + */ + FileDescriptorProto.prototype.edition = ""; + + /** + * 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 13, wireType 2 =*/106).string(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) { + 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(); + 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 13: { + message.edition = reader.string(); + 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")) + if (!$util.isString(message.edition)) + return "edition: string expected"; + 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); + if (object.edition != null) + message.edition = String(object.edition); + 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 = ""; + } + 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 = 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) { + 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(); + 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) { + 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(); + 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) { + 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(); + 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 + */ + + /** + * 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 = []; + if (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; + + /** + * 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.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) { + 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(); + 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; + } + 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; + } + } + 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]); + } + } + 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.uninterpretedOption = []; + 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"; + }; + + 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) { + 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(); + 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 2: + case 3: + 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_REQUIRED": + case 2: + message.label = 2; + break; + case "LABEL_REPEATED": + case 3: + message.label = 3; + 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_REQUIRED=2 LABEL_REQUIRED value + * @property {number} LABEL_REPEATED=3 LABEL_REPEATED value + */ + FieldDescriptorProto.Label = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[1] = "LABEL_OPTIONAL"] = 1; + values[valuesById[2] = "LABEL_REQUIRED"] = 2; + values[valuesById[3] = "LABEL_REPEATED"] = 3; + 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) { + 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(); + 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) { + 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(); + 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) { + 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(); + 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) { + 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(); + 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) { + 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(); + 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) { + 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(); + 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} [phpGenericServices] FileOptions phpGenericServices + * @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 {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 phpGenericServices. + * @member {boolean} phpGenericServices + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.phpGenericServices = 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 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.phpGenericServices != null && Object.hasOwnProperty.call(message, "phpGenericServices")) + writer.uint32(/* id 42, wireType 0 =*/336).bool(message.phpGenericServices); + 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.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) { + 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(); + 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 42: { + message.phpGenericServices = 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 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.phpGenericServices != null && message.hasOwnProperty("phpGenericServices")) + if (typeof message.phpGenericServices !== "boolean") + return "phpGenericServices: 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.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.phpGenericServices != null) + message.phpGenericServices = Boolean(object.phpGenericServices); + 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.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.phpGenericServices = false; + object.phpMetadataNamespace = ""; + object.rubyPackage = ""; + } + 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.phpGenericServices != null && message.hasOwnProperty("phpGenericServices")) + object.phpGenericServices = message.phpGenericServices; + if (message.phpMetadataNamespace != null && message.hasOwnProperty("phpMetadataNamespace")) + object.phpMetadataNamespace = message.phpMetadataNamespace; + if (message.rubyPackage != null && message.hasOwnProperty("rubyPackage")) + object.rubyPackage = message.rubyPackage; + 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 {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 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.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) { + 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(); + 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 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.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.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[".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.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 {google.protobuf.FieldOptions.OptionTargetType|null} [target] FieldOptions target + * @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.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 target. + * @member {google.protobuf.FieldOptions.OptionTargetType} target + * @memberof google.protobuf.FieldOptions + * @instance + */ + FieldOptions.prototype.target = 0; + + /** + * 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.target != null && Object.hasOwnProperty.call(message, "target")) + writer.uint32(/* id 18, wireType 0 =*/144).int32(message.target); + 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) { + writer.uint32(/* id 1052, wireType 2 =*/8418).fork(); + for (var i = 0; i < message[".google.api.fieldBehavior"].length; ++i) + writer.int32(message[".google.api.fieldBehavior"][i]); + writer.ldelim(); + } + 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) { + 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(); + 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 18: { + message.target = reader.int32(); + 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.target != null && message.hasOwnProperty("target")) + switch (message.target) { + default: + return "target: 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.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: + 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; + } + switch (object.target) { + default: + if (typeof object.target === "number") { + message.target = object.target; + break; + } + break; + case "TARGET_TYPE_UNKNOWN": + case 0: + message.target = 0; + break; + case "TARGET_TYPE_FILE": + case 1: + message.target = 1; + break; + case "TARGET_TYPE_EXTENSION_RANGE": + case 2: + message.target = 2; + break; + case "TARGET_TYPE_MESSAGE": + case 3: + message.target = 3; + break; + case "TARGET_TYPE_FIELD": + case 4: + message.target = 4; + break; + case "TARGET_TYPE_ONEOF": + case 5: + message.target = 5; + break; + case "TARGET_TYPE_ENUM": + case 6: + message.target = 6; + break; + case "TARGET_TYPE_ENUM_ENTRY": + case 7: + message.target = 7; + break; + case "TARGET_TYPE_SERVICE": + case 8: + message.target = 8; + break; + case "TARGET_TYPE_METHOD": + case 9: + message.target = 9; + break; + } + 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; + } + } + 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.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.target = options.enums === String ? "TARGET_TYPE_UNKNOWN" : 0; + 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.target != null && message.hasOwnProperty("target")) + object.target = options.enums === String ? $root.google.protobuf.FieldOptions.OptionTargetType[message.target] === undefined ? message.target : $root.google.protobuf.FieldOptions.OptionTargetType[message.target] : message.target; + 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; + })(); + + return FieldOptions; + })(); + + protobuf.OneofOptions = (function() { + + /** + * Properties of an OneofOptions. + * @memberof google.protobuf + * @interface IOneofOptions + * @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 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.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) { + 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(); + 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; + } + 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.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.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 (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 {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 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.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) { + 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(); + 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 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.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.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; + } + 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.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 {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 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.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) { + 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(); + switch (tag >>> 3) { + case 1: { + 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; + } + 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.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.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; + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + object.deprecated = message.deprecated; + 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 {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 + */ + + /** + * 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 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"] = ""; + + /** + * 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.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"]); + 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) { + 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(); + switch (tag >>> 3) { + 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; + } + 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.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"; + 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.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"]); + 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[".google.api.defaultHost"] = ""; + object[".google.api.oauthScopes"] = ""; + } + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + object.deprecated = message.deprecated; + 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"]; + 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 {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 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.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) { + 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(); + switch (tag >>> 3) { + case 33: { + message.deprecated = reader.bool(); + break; + } + case 34: { + message.idempotencyLevel = reader.int32(); + 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.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.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[".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.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) { + 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(); + 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) { + 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(); + 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.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) { + 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(); + 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) { + 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(); + 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) { + 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(); + 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) { + 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(); + 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.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) { + 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(); + 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) { + 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(); + 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.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) { + 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(); + 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.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) { + 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(); + 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) { + 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(); + 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.Struct = (function() { + + /** + * Properties of a Struct. + * @memberof google.protobuf + * @interface IStruct + * @property {Object.|null} [fields] Struct fields + */ + + /** + * Constructs a new Struct. + * @memberof google.protobuf + * @classdesc Represents a Struct. + * @implements IStruct + * @constructor + * @param {google.protobuf.IStruct=} [properties] Properties to set + */ + function Struct(properties) { + this.fields = {}; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Struct fields. + * @member {Object.} fields + * @memberof google.protobuf.Struct + * @instance + */ + Struct.prototype.fields = $util.emptyObject; + + /** + * Creates a new Struct instance using the specified properties. + * @function create + * @memberof google.protobuf.Struct + * @static + * @param {google.protobuf.IStruct=} [properties] Properties to set + * @returns {google.protobuf.Struct} Struct instance + */ + Struct.create = function create(properties) { + return new Struct(properties); + }; + + /** + * Encodes the specified Struct message. Does not implicitly {@link google.protobuf.Struct.verify|verify} messages. + * @function encode + * @memberof google.protobuf.Struct + * @static + * @param {google.protobuf.IStruct} message Struct message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Struct.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.fields != null && Object.hasOwnProperty.call(message, "fields")) + for (var keys = Object.keys(message.fields), 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.protobuf.Value.encode(message.fields[keys[i]], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim().ldelim(); + } + return writer; + }; + + /** + * Encodes the specified Struct message, length delimited. Does not implicitly {@link google.protobuf.Struct.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.Struct + * @static + * @param {google.protobuf.IStruct} message Struct message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Struct.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Struct message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.Struct + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.Struct} Struct + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Struct.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.Struct(), key, value; + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (message.fields === $util.emptyObject) + message.fields = {}; + 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.protobuf.Value.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag2 & 7); + break; + } + } + message.fields[key] = value; + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Struct message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.Struct + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.Struct} Struct + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Struct.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Struct message. + * @function verify + * @memberof google.protobuf.Struct + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Struct.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.fields != null && message.hasOwnProperty("fields")) { + if (!$util.isObject(message.fields)) + return "fields: object expected"; + var key = Object.keys(message.fields); + for (var i = 0; i < key.length; ++i) { + var error = $root.google.protobuf.Value.verify(message.fields[key[i]]); + if (error) + return "fields." + error; + } + } + return null; + }; + + /** + * Creates a Struct message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.Struct + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.Struct} Struct + */ + Struct.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.Struct) + return object; + var message = new $root.google.protobuf.Struct(); + if (object.fields) { + if (typeof object.fields !== "object") + throw TypeError(".google.protobuf.Struct.fields: object expected"); + message.fields = {}; + for (var keys = Object.keys(object.fields), i = 0; i < keys.length; ++i) { + if (typeof object.fields[keys[i]] !== "object") + throw TypeError(".google.protobuf.Struct.fields: object expected"); + message.fields[keys[i]] = $root.google.protobuf.Value.fromObject(object.fields[keys[i]]); + } + } + return message; + }; + + /** + * Creates a plain object from a Struct message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.Struct + * @static + * @param {google.protobuf.Struct} message Struct + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Struct.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.objects || options.defaults) + object.fields = {}; + var keys2; + if (message.fields && (keys2 = Object.keys(message.fields)).length) { + object.fields = {}; + for (var j = 0; j < keys2.length; ++j) + object.fields[keys2[j]] = $root.google.protobuf.Value.toObject(message.fields[keys2[j]], options); + } + return object; + }; + + /** + * Converts this Struct to JSON. + * @function toJSON + * @memberof google.protobuf.Struct + * @instance + * @returns {Object.} JSON object + */ + Struct.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Struct + * @function getTypeUrl + * @memberof google.protobuf.Struct + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Struct.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.Struct"; + }; + + return Struct; + })(); + + protobuf.Value = (function() { + + /** + * Properties of a Value. + * @memberof google.protobuf + * @interface IValue + * @property {google.protobuf.NullValue|null} [nullValue] Value nullValue + * @property {number|null} [numberValue] Value numberValue + * @property {string|null} [stringValue] Value stringValue + * @property {boolean|null} [boolValue] Value boolValue + * @property {google.protobuf.IStruct|null} [structValue] Value structValue + * @property {google.protobuf.IListValue|null} [listValue] Value listValue + */ + + /** + * Constructs a new Value. + * @memberof google.protobuf + * @classdesc Represents a Value. + * @implements IValue + * @constructor + * @param {google.protobuf.IValue=} [properties] Properties to set + */ + function Value(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Value nullValue. + * @member {google.protobuf.NullValue|null|undefined} nullValue + * @memberof google.protobuf.Value + * @instance + */ + Value.prototype.nullValue = null; + + /** + * Value numberValue. + * @member {number|null|undefined} numberValue + * @memberof google.protobuf.Value + * @instance + */ + Value.prototype.numberValue = null; + + /** + * Value stringValue. + * @member {string|null|undefined} stringValue + * @memberof google.protobuf.Value + * @instance + */ + Value.prototype.stringValue = null; + + /** + * Value boolValue. + * @member {boolean|null|undefined} boolValue + * @memberof google.protobuf.Value + * @instance + */ + Value.prototype.boolValue = null; + + /** + * Value structValue. + * @member {google.protobuf.IStruct|null|undefined} structValue + * @memberof google.protobuf.Value + * @instance + */ + Value.prototype.structValue = null; + + /** + * Value listValue. + * @member {google.protobuf.IListValue|null|undefined} listValue + * @memberof google.protobuf.Value + * @instance + */ + Value.prototype.listValue = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * Value kind. + * @member {"nullValue"|"numberValue"|"stringValue"|"boolValue"|"structValue"|"listValue"|undefined} kind + * @memberof google.protobuf.Value + * @instance + */ + Object.defineProperty(Value.prototype, "kind", { + get: $util.oneOfGetter($oneOfFields = ["nullValue", "numberValue", "stringValue", "boolValue", "structValue", "listValue"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new Value instance using the specified properties. + * @function create + * @memberof google.protobuf.Value + * @static + * @param {google.protobuf.IValue=} [properties] Properties to set + * @returns {google.protobuf.Value} Value instance + */ + Value.create = function create(properties) { + return new Value(properties); + }; + + /** + * Encodes the specified Value message. Does not implicitly {@link google.protobuf.Value.verify|verify} messages. + * @function encode + * @memberof google.protobuf.Value + * @static + * @param {google.protobuf.IValue} message Value message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Value.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.nullValue != null && Object.hasOwnProperty.call(message, "nullValue")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.nullValue); + if (message.numberValue != null && Object.hasOwnProperty.call(message, "numberValue")) + writer.uint32(/* id 2, wireType 1 =*/17).double(message.numberValue); + if (message.stringValue != null && Object.hasOwnProperty.call(message, "stringValue")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.stringValue); + if (message.boolValue != null && Object.hasOwnProperty.call(message, "boolValue")) + writer.uint32(/* id 4, wireType 0 =*/32).bool(message.boolValue); + if (message.structValue != null && Object.hasOwnProperty.call(message, "structValue")) + $root.google.protobuf.Struct.encode(message.structValue, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.listValue != null && Object.hasOwnProperty.call(message, "listValue")) + $root.google.protobuf.ListValue.encode(message.listValue, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified Value message, length delimited. Does not implicitly {@link google.protobuf.Value.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.Value + * @static + * @param {google.protobuf.IValue} message Value message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Value.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Value message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.Value + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.Value} Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Value.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.Value(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.nullValue = reader.int32(); + break; + } + case 2: { + message.numberValue = reader.double(); + break; + } + case 3: { + message.stringValue = reader.string(); + break; + } + case 4: { + message.boolValue = reader.bool(); + break; + } + case 5: { + message.structValue = $root.google.protobuf.Struct.decode(reader, reader.uint32()); + break; + } + case 6: { + message.listValue = $root.google.protobuf.ListValue.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Value message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.Value + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.Value} Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Value.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Value message. + * @function verify + * @memberof google.protobuf.Value + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Value.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.nullValue != null && message.hasOwnProperty("nullValue")) { + properties.kind = 1; + switch (message.nullValue) { + default: + return "nullValue: enum value expected"; + case 0: + break; + } + } + if (message.numberValue != null && message.hasOwnProperty("numberValue")) { + if (properties.kind === 1) + return "kind: multiple values"; + properties.kind = 1; + if (typeof message.numberValue !== "number") + return "numberValue: number expected"; + } + if (message.stringValue != null && message.hasOwnProperty("stringValue")) { + if (properties.kind === 1) + return "kind: multiple values"; + properties.kind = 1; + if (!$util.isString(message.stringValue)) + return "stringValue: string expected"; + } + if (message.boolValue != null && message.hasOwnProperty("boolValue")) { + if (properties.kind === 1) + return "kind: multiple values"; + properties.kind = 1; + if (typeof message.boolValue !== "boolean") + return "boolValue: boolean expected"; + } + if (message.structValue != null && message.hasOwnProperty("structValue")) { + if (properties.kind === 1) + return "kind: multiple values"; + properties.kind = 1; + { + var error = $root.google.protobuf.Struct.verify(message.structValue); + if (error) + return "structValue." + error; + } + } + if (message.listValue != null && message.hasOwnProperty("listValue")) { + if (properties.kind === 1) + return "kind: multiple values"; + properties.kind = 1; + { + var error = $root.google.protobuf.ListValue.verify(message.listValue); + if (error) + return "listValue." + error; + } + } + return null; + }; + + /** + * Creates a Value message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.Value + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.Value} Value + */ + Value.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.Value) + return object; + var message = new $root.google.protobuf.Value(); + switch (object.nullValue) { + default: + if (typeof object.nullValue === "number") { + message.nullValue = object.nullValue; + break; + } + break; + case "NULL_VALUE": + case 0: + message.nullValue = 0; + break; + } + if (object.numberValue != null) + message.numberValue = Number(object.numberValue); + if (object.stringValue != null) + message.stringValue = String(object.stringValue); + if (object.boolValue != null) + message.boolValue = Boolean(object.boolValue); + if (object.structValue != null) { + if (typeof object.structValue !== "object") + throw TypeError(".google.protobuf.Value.structValue: object expected"); + message.structValue = $root.google.protobuf.Struct.fromObject(object.structValue); + } + if (object.listValue != null) { + if (typeof object.listValue !== "object") + throw TypeError(".google.protobuf.Value.listValue: object expected"); + message.listValue = $root.google.protobuf.ListValue.fromObject(object.listValue); + } + return message; + }; + + /** + * Creates a plain object from a Value message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.Value + * @static + * @param {google.protobuf.Value} message Value + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Value.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.nullValue != null && message.hasOwnProperty("nullValue")) { + object.nullValue = options.enums === String ? $root.google.protobuf.NullValue[message.nullValue] === undefined ? message.nullValue : $root.google.protobuf.NullValue[message.nullValue] : message.nullValue; + if (options.oneofs) + object.kind = "nullValue"; + } + if (message.numberValue != null && message.hasOwnProperty("numberValue")) { + object.numberValue = options.json && !isFinite(message.numberValue) ? String(message.numberValue) : message.numberValue; + if (options.oneofs) + object.kind = "numberValue"; + } + if (message.stringValue != null && message.hasOwnProperty("stringValue")) { + object.stringValue = message.stringValue; + if (options.oneofs) + object.kind = "stringValue"; + } + if (message.boolValue != null && message.hasOwnProperty("boolValue")) { + object.boolValue = message.boolValue; + if (options.oneofs) + object.kind = "boolValue"; + } + if (message.structValue != null && message.hasOwnProperty("structValue")) { + object.structValue = $root.google.protobuf.Struct.toObject(message.structValue, options); + if (options.oneofs) + object.kind = "structValue"; + } + if (message.listValue != null && message.hasOwnProperty("listValue")) { + object.listValue = $root.google.protobuf.ListValue.toObject(message.listValue, options); + if (options.oneofs) + object.kind = "listValue"; + } + return object; + }; + + /** + * Converts this Value to JSON. + * @function toJSON + * @memberof google.protobuf.Value + * @instance + * @returns {Object.} JSON object + */ + Value.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Value + * @function getTypeUrl + * @memberof google.protobuf.Value + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Value.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.Value"; + }; + + return Value; + })(); + + /** + * NullValue enum. + * @name google.protobuf.NullValue + * @enum {number} + * @property {number} NULL_VALUE=0 NULL_VALUE value + */ + protobuf.NullValue = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "NULL_VALUE"] = 0; + return values; + })(); + + protobuf.ListValue = (function() { + + /** + * Properties of a ListValue. + * @memberof google.protobuf + * @interface IListValue + * @property {Array.|null} [values] ListValue values + */ + + /** + * Constructs a new ListValue. + * @memberof google.protobuf + * @classdesc Represents a ListValue. + * @implements IListValue + * @constructor + * @param {google.protobuf.IListValue=} [properties] Properties to set + */ + function ListValue(properties) { + this.values = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListValue values. + * @member {Array.} values + * @memberof google.protobuf.ListValue + * @instance + */ + ListValue.prototype.values = $util.emptyArray; + + /** + * Creates a new ListValue instance using the specified properties. + * @function create + * @memberof google.protobuf.ListValue + * @static + * @param {google.protobuf.IListValue=} [properties] Properties to set + * @returns {google.protobuf.ListValue} ListValue instance + */ + ListValue.create = function create(properties) { + return new ListValue(properties); + }; + + /** + * Encodes the specified ListValue message. Does not implicitly {@link google.protobuf.ListValue.verify|verify} messages. + * @function encode + * @memberof google.protobuf.ListValue + * @static + * @param {google.protobuf.IListValue} message ListValue message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListValue.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.values != null && message.values.length) + for (var i = 0; i < message.values.length; ++i) + $root.google.protobuf.Value.encode(message.values[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified ListValue message, length delimited. Does not implicitly {@link google.protobuf.ListValue.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.ListValue + * @static + * @param {google.protobuf.IListValue} message ListValue message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListValue.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListValue message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.ListValue + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.ListValue} ListValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListValue.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.ListValue(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.values && message.values.length)) + message.values = []; + message.values.push($root.google.protobuf.Value.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListValue message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.ListValue + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.ListValue} ListValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListValue.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListValue message. + * @function verify + * @memberof google.protobuf.ListValue + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListValue.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.values != null && message.hasOwnProperty("values")) { + if (!Array.isArray(message.values)) + return "values: array expected"; + for (var i = 0; i < message.values.length; ++i) { + var error = $root.google.protobuf.Value.verify(message.values[i]); + if (error) + return "values." + error; + } + } + return null; + }; + + /** + * Creates a ListValue message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.ListValue + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.ListValue} ListValue + */ + ListValue.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.ListValue) + return object; + var message = new $root.google.protobuf.ListValue(); + if (object.values) { + if (!Array.isArray(object.values)) + throw TypeError(".google.protobuf.ListValue.values: array expected"); + message.values = []; + for (var i = 0; i < object.values.length; ++i) { + if (typeof object.values[i] !== "object") + throw TypeError(".google.protobuf.ListValue.values: object expected"); + message.values[i] = $root.google.protobuf.Value.fromObject(object.values[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a ListValue message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.ListValue + * @static + * @param {google.protobuf.ListValue} message ListValue + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListValue.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.values = []; + if (message.values && message.values.length) { + object.values = []; + for (var j = 0; j < message.values.length; ++j) + object.values[j] = $root.google.protobuf.Value.toObject(message.values[j], options); + } + return object; + }; + + /** + * Converts this ListValue to JSON. + * @function toJSON + * @memberof google.protobuf.ListValue + * @instance + * @returns {Object.} JSON object + */ + ListValue.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListValue + * @function getTypeUrl + * @memberof google.protobuf.ListValue + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListValue.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.ListValue"; + }; + + return ListValue; + })(); + + return protobuf; + })(); + + 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) { + 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(); + 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; + })(); + + 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) { + 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(); + 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) { + 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(); + 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) { + 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(); + 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) { + 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(); + 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) { + 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(); + 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) { + 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(); + 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) { + 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(); + 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) { + 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(); + 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; + })(); + + return google; + })(); + + return $root; +}); diff --git a/packages/google-cloud-automl/protos/protos.json b/packages/google-cloud-automl/protos/protos.json new file mode 100644 index 00000000000..ab60cadef7d --- /dev/null +++ b/packages/google-cloud-automl/protos/protos.json @@ -0,0 +1,7157 @@ +{ + "nested": { + "google": { + "nested": { + "cloud": { + "nested": { + "automl": { + "nested": { + "v1": { + "options": { + "csharp_namespace": "Google.Cloud.AutoML.V1", + "go_package": "cloud.google.com/go/automl/apiv1/automlpb;automlpb", + "java_multiple_files": true, + "java_package": "com.google.cloud.automl.v1", + "php_namespace": "Google\\Cloud\\AutoMl\\V1", + "ruby_package": "Google::Cloud::AutoML::V1", + "java_outer_classname": "AutoMlProto" + }, + "nested": { + "AnnotationPayload": { + "oneofs": { + "detail": { + "oneof": [ + "translation", + "classification", + "imageObjectDetection", + "textExtraction", + "textSentiment" + ] + } + }, + "fields": { + "translation": { + "type": "TranslationAnnotation", + "id": 2 + }, + "classification": { + "type": "ClassificationAnnotation", + "id": 3 + }, + "imageObjectDetection": { + "type": "ImageObjectDetectionAnnotation", + "id": 4 + }, + "textExtraction": { + "type": "TextExtractionAnnotation", + "id": 6 + }, + "textSentiment": { + "type": "TextSentimentAnnotation", + "id": 7 + }, + "annotationSpecId": { + "type": "string", + "id": 1 + }, + "displayName": { + "type": "string", + "id": 5 + } + } + }, + "ClassificationType": { + "values": { + "CLASSIFICATION_TYPE_UNSPECIFIED": 0, + "MULTICLASS": 1, + "MULTILABEL": 2 + } + }, + "ClassificationAnnotation": { + "fields": { + "score": { + "type": "float", + "id": 1 + } + } + }, + "ClassificationEvaluationMetrics": { + "fields": { + "auPrc": { + "type": "float", + "id": 1 + }, + "auRoc": { + "type": "float", + "id": 6 + }, + "logLoss": { + "type": "float", + "id": 7 + }, + "confidenceMetricsEntry": { + "rule": "repeated", + "type": "ConfidenceMetricsEntry", + "id": 3 + }, + "confusionMatrix": { + "type": "ConfusionMatrix", + "id": 4 + }, + "annotationSpecId": { + "rule": "repeated", + "type": "string", + "id": 5 + } + }, + "nested": { + "ConfidenceMetricsEntry": { + "fields": { + "confidenceThreshold": { + "type": "float", + "id": 1 + }, + "positionThreshold": { + "type": "int32", + "id": 14 + }, + "recall": { + "type": "float", + "id": 2 + }, + "precision": { + "type": "float", + "id": 3 + }, + "falsePositiveRate": { + "type": "float", + "id": 8 + }, + "f1Score": { + "type": "float", + "id": 4 + }, + "recallAt1": { + "type": "float", + "id": 5 + }, + "precisionAt1": { + "type": "float", + "id": 6 + }, + "falsePositiveRateAt1": { + "type": "float", + "id": 9 + }, + "f1ScoreAt1": { + "type": "float", + "id": 7 + }, + "truePositiveCount": { + "type": "int64", + "id": 10 + }, + "falsePositiveCount": { + "type": "int64", + "id": 11 + }, + "falseNegativeCount": { + "type": "int64", + "id": 12 + }, + "trueNegativeCount": { + "type": "int64", + "id": 13 + } + } + }, + "ConfusionMatrix": { + "fields": { + "annotationSpecId": { + "rule": "repeated", + "type": "string", + "id": 1 + }, + "displayName": { + "rule": "repeated", + "type": "string", + "id": 3 + }, + "row": { + "rule": "repeated", + "type": "Row", + "id": 2 + } + }, + "nested": { + "Row": { + "fields": { + "exampleCount": { + "rule": "repeated", + "type": "int32", + "id": 1 + } + } + } + } + } + } + }, + "ImageObjectDetectionAnnotation": { + "fields": { + "boundingBox": { + "type": "BoundingPoly", + "id": 1 + }, + "score": { + "type": "float", + "id": 2 + } + } + }, + "BoundingBoxMetricsEntry": { + "fields": { + "iouThreshold": { + "type": "float", + "id": 1 + }, + "meanAveragePrecision": { + "type": "float", + "id": 2 + }, + "confidenceMetricsEntries": { + "rule": "repeated", + "type": "ConfidenceMetricsEntry", + "id": 3 + } + }, + "nested": { + "ConfidenceMetricsEntry": { + "fields": { + "confidenceThreshold": { + "type": "float", + "id": 1 + }, + "recall": { + "type": "float", + "id": 2 + }, + "precision": { + "type": "float", + "id": 3 + }, + "f1Score": { + "type": "float", + "id": 4 + } + } + } + } + }, + "ImageObjectDetectionEvaluationMetrics": { + "fields": { + "evaluatedBoundingBoxCount": { + "type": "int32", + "id": 1 + }, + "boundingBoxMetricsEntries": { + "rule": "repeated", + "type": "BoundingBoxMetricsEntry", + "id": 2 + }, + "boundingBoxMeanAveragePrecision": { + "type": "float", + "id": 3 + } + } + }, + "NormalizedVertex": { + "fields": { + "x": { + "type": "float", + "id": 1 + }, + "y": { + "type": "float", + "id": 2 + } + } + }, + "BoundingPoly": { + "fields": { + "normalizedVertices": { + "rule": "repeated", + "type": "NormalizedVertex", + "id": 2 + } + } + }, + "TextExtractionAnnotation": { + "oneofs": { + "annotation": { + "oneof": [ + "textSegment" + ] + } + }, + "fields": { + "textSegment": { + "type": "TextSegment", + "id": 3 + }, + "score": { + "type": "float", + "id": 1 + } + } + }, + "TextExtractionEvaluationMetrics": { + "fields": { + "auPrc": { + "type": "float", + "id": 1 + }, + "confidenceMetricsEntries": { + "rule": "repeated", + "type": "ConfidenceMetricsEntry", + "id": 2 + } + }, + "nested": { + "ConfidenceMetricsEntry": { + "fields": { + "confidenceThreshold": { + "type": "float", + "id": 1 + }, + "recall": { + "type": "float", + "id": 3 + }, + "precision": { + "type": "float", + "id": 4 + }, + "f1Score": { + "type": "float", + "id": 5 + } + } + } + } + }, + "TextSegment": { + "fields": { + "content": { + "type": "string", + "id": 3 + }, + "startOffset": { + "type": "int64", + "id": 1 + }, + "endOffset": { + "type": "int64", + "id": 2 + } + } + }, + "TextSentimentAnnotation": { + "fields": { + "sentiment": { + "type": "int32", + "id": 1 + } + } + }, + "TextSentimentEvaluationMetrics": { + "fields": { + "precision": { + "type": "float", + "id": 1 + }, + "recall": { + "type": "float", + "id": 2 + }, + "f1Score": { + "type": "float", + "id": 3 + }, + "meanAbsoluteError": { + "type": "float", + "id": 4 + }, + "meanSquaredError": { + "type": "float", + "id": 5 + }, + "linearKappa": { + "type": "float", + "id": 6 + }, + "quadraticKappa": { + "type": "float", + "id": 7 + }, + "confusionMatrix": { + "type": "ClassificationEvaluationMetrics.ConfusionMatrix", + "id": 8 + } + } + }, + "TranslationDatasetMetadata": { + "fields": { + "sourceLanguageCode": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "targetLanguageCode": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "TranslationEvaluationMetrics": { + "fields": { + "bleuScore": { + "type": "double", + "id": 1 + }, + "baseBleuScore": { + "type": "double", + "id": 2 + } + } + }, + "TranslationModelMetadata": { + "fields": { + "baseModel": { + "type": "string", + "id": 1 + }, + "sourceLanguageCode": { + "type": "string", + "id": 2 + }, + "targetLanguageCode": { + "type": "string", + "id": 3 + } + } + }, + "TranslationAnnotation": { + "fields": { + "translatedContent": { + "type": "TextSnippet", + "id": 1 + } + } + }, + "Image": { + "oneofs": { + "data": { + "oneof": [ + "imageBytes" + ] + } + }, + "fields": { + "imageBytes": { + "type": "bytes", + "id": 1 + }, + "thumbnailUri": { + "type": "string", + "id": 4 + } + } + }, + "TextSnippet": { + "fields": { + "content": { + "type": "string", + "id": 1 + }, + "mimeType": { + "type": "string", + "id": 2 + }, + "contentUri": { + "type": "string", + "id": 4 + } + } + }, + "DocumentDimensions": { + "fields": { + "unit": { + "type": "DocumentDimensionUnit", + "id": 1 + }, + "width": { + "type": "float", + "id": 2 + }, + "height": { + "type": "float", + "id": 3 + } + }, + "nested": { + "DocumentDimensionUnit": { + "values": { + "DOCUMENT_DIMENSION_UNIT_UNSPECIFIED": 0, + "INCH": 1, + "CENTIMETER": 2, + "POINT": 3 + } + } + } + }, + "Document": { + "fields": { + "inputConfig": { + "type": "DocumentInputConfig", + "id": 1 + }, + "documentText": { + "type": "TextSnippet", + "id": 2 + }, + "layout": { + "rule": "repeated", + "type": "Layout", + "id": 3 + }, + "documentDimensions": { + "type": "DocumentDimensions", + "id": 4 + }, + "pageCount": { + "type": "int32", + "id": 5 + } + }, + "nested": { + "Layout": { + "fields": { + "textSegment": { + "type": "TextSegment", + "id": 1 + }, + "pageNumber": { + "type": "int32", + "id": 2 + }, + "boundingPoly": { + "type": "BoundingPoly", + "id": 3 + }, + "textSegmentType": { + "type": "TextSegmentType", + "id": 4 + } + }, + "nested": { + "TextSegmentType": { + "values": { + "TEXT_SEGMENT_TYPE_UNSPECIFIED": 0, + "TOKEN": 1, + "PARAGRAPH": 2, + "FORM_FIELD": 3, + "FORM_FIELD_NAME": 4, + "FORM_FIELD_CONTENTS": 5, + "TABLE": 6, + "TABLE_HEADER": 7, + "TABLE_ROW": 8, + "TABLE_CELL": 9 + } + } + } + } + } + }, + "ExamplePayload": { + "oneofs": { + "payload": { + "oneof": [ + "image", + "textSnippet", + "document" + ] + } + }, + "fields": { + "image": { + "type": "Image", + "id": 1 + }, + "textSnippet": { + "type": "TextSnippet", + "id": 2 + }, + "document": { + "type": "Document", + "id": 4 + } + } + }, + "InputConfig": { + "oneofs": { + "source": { + "oneof": [ + "gcsSource" + ] + } + }, + "fields": { + "gcsSource": { + "type": "GcsSource", + "id": 1 + }, + "params": { + "keyType": "string", + "type": "string", + "id": 2 + } + } + }, + "BatchPredictInputConfig": { + "oneofs": { + "source": { + "oneof": [ + "gcsSource" + ] + } + }, + "fields": { + "gcsSource": { + "type": "GcsSource", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "DocumentInputConfig": { + "fields": { + "gcsSource": { + "type": "GcsSource", + "id": 1 + } + } + }, + "OutputConfig": { + "oneofs": { + "destination": { + "oneof": [ + "gcsDestination" + ] + } + }, + "fields": { + "gcsDestination": { + "type": "GcsDestination", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "BatchPredictOutputConfig": { + "oneofs": { + "destination": { + "oneof": [ + "gcsDestination" + ] + } + }, + "fields": { + "gcsDestination": { + "type": "GcsDestination", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "ModelExportOutputConfig": { + "oneofs": { + "destination": { + "oneof": [ + "gcsDestination" + ] + } + }, + "fields": { + "gcsDestination": { + "type": "GcsDestination", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "modelFormat": { + "type": "string", + "id": 4 + }, + "params": { + "keyType": "string", + "type": "string", + "id": 2 + } + } + }, + "GcsSource": { + "fields": { + "inputUris": { + "rule": "repeated", + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "GcsDestination": { + "fields": { + "outputUriPrefix": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "AnnotationSpec": { + "options": { + "(google.api.resource).type": "automl.googleapis.com/AnnotationSpec", + "(google.api.resource).pattern": "projects/{project}/locations/{location}/datasets/{dataset}/annotationSpecs/{annotation_spec}" + }, + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "displayName": { + "type": "string", + "id": 2 + }, + "exampleCount": { + "type": "int32", + "id": 9 + } + } + }, + "Dataset": { + "options": { + "(google.api.resource).type": "automl.googleapis.com/Dataset", + "(google.api.resource).pattern": "projects/{project}/locations/{location}/datasets/{dataset}" + }, + "oneofs": { + "datasetMetadata": { + "oneof": [ + "translationDatasetMetadata", + "imageClassificationDatasetMetadata", + "textClassificationDatasetMetadata", + "imageObjectDetectionDatasetMetadata", + "textExtractionDatasetMetadata", + "textSentimentDatasetMetadata" + ] + } + }, + "fields": { + "translationDatasetMetadata": { + "type": "TranslationDatasetMetadata", + "id": 23 + }, + "imageClassificationDatasetMetadata": { + "type": "ImageClassificationDatasetMetadata", + "id": 24 + }, + "textClassificationDatasetMetadata": { + "type": "TextClassificationDatasetMetadata", + "id": 25 + }, + "imageObjectDetectionDatasetMetadata": { + "type": "ImageObjectDetectionDatasetMetadata", + "id": 26 + }, + "textExtractionDatasetMetadata": { + "type": "TextExtractionDatasetMetadata", + "id": 28 + }, + "textSentimentDatasetMetadata": { + "type": "TextSentimentDatasetMetadata", + "id": 30 + }, + "name": { + "type": "string", + "id": 1 + }, + "displayName": { + "type": "string", + "id": 2 + }, + "description": { + "type": "string", + "id": 3 + }, + "exampleCount": { + "type": "int32", + "id": 21 + }, + "createTime": { + "type": "google.protobuf.Timestamp", + "id": 14 + }, + "etag": { + "type": "string", + "id": 17 + }, + "labels": { + "keyType": "string", + "type": "string", + "id": 39 + } + } + }, + "ImageClassificationDatasetMetadata": { + "fields": { + "classificationType": { + "type": "ClassificationType", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "ImageObjectDetectionDatasetMetadata": { + "fields": {} + }, + "ImageClassificationModelMetadata": { + "fields": { + "baseModelId": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "trainBudgetMilliNodeHours": { + "type": "int64", + "id": 16, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "trainCostMilliNodeHours": { + "type": "int64", + "id": 17, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "stopReason": { + "type": "string", + "id": 5, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "modelType": { + "type": "string", + "id": 7, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "nodeQps": { + "type": "double", + "id": 13, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "nodeCount": { + "type": "int64", + "id": 14, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + } + } + }, + "ImageObjectDetectionModelMetadata": { + "fields": { + "modelType": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "nodeCount": { + "type": "int64", + "id": 3, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "nodeQps": { + "type": "double", + "id": 4, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "stopReason": { + "type": "string", + "id": 5, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "trainBudgetMilliNodeHours": { + "type": "int64", + "id": 6, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "trainCostMilliNodeHours": { + "type": "int64", + "id": 7, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + } + } + }, + "ImageClassificationModelDeploymentMetadata": { + "fields": { + "nodeCount": { + "type": "int64", + "id": 1, + "options": { + "(google.api.field_behavior)": "INPUT_ONLY" + } + } + } + }, + "ImageObjectDetectionModelDeploymentMetadata": { + "fields": { + "nodeCount": { + "type": "int64", + "id": 1, + "options": { + "(google.api.field_behavior)": "INPUT_ONLY" + } + } + } + }, + "TextClassificationDatasetMetadata": { + "fields": { + "classificationType": { + "type": "ClassificationType", + "id": 1 + } + } + }, + "TextClassificationModelMetadata": { + "fields": { + "classificationType": { + "type": "ClassificationType", + "id": 3 + } + } + }, + "TextExtractionDatasetMetadata": { + "fields": {} + }, + "TextExtractionModelMetadata": { + "fields": {} + }, + "TextSentimentDatasetMetadata": { + "fields": { + "sentimentMax": { + "type": "int32", + "id": 1 + } + } + }, + "TextSentimentModelMetadata": { + "fields": {} + }, + "Model": { + "options": { + "(google.api.resource).type": "automl.googleapis.com/Model", + "(google.api.resource).pattern": "projects/{project}/locations/{location}/models/{model}" + }, + "oneofs": { + "modelMetadata": { + "oneof": [ + "translationModelMetadata", + "imageClassificationModelMetadata", + "textClassificationModelMetadata", + "imageObjectDetectionModelMetadata", + "textExtractionModelMetadata", + "textSentimentModelMetadata" + ] + } + }, + "fields": { + "translationModelMetadata": { + "type": "TranslationModelMetadata", + "id": 15 + }, + "imageClassificationModelMetadata": { + "type": "ImageClassificationModelMetadata", + "id": 13 + }, + "textClassificationModelMetadata": { + "type": "TextClassificationModelMetadata", + "id": 14 + }, + "imageObjectDetectionModelMetadata": { + "type": "ImageObjectDetectionModelMetadata", + "id": 20 + }, + "textExtractionModelMetadata": { + "type": "TextExtractionModelMetadata", + "id": 19 + }, + "textSentimentModelMetadata": { + "type": "TextSentimentModelMetadata", + "id": 22 + }, + "name": { + "type": "string", + "id": 1 + }, + "displayName": { + "type": "string", + "id": 2 + }, + "datasetId": { + "type": "string", + "id": 3 + }, + "createTime": { + "type": "google.protobuf.Timestamp", + "id": 7 + }, + "updateTime": { + "type": "google.protobuf.Timestamp", + "id": 11 + }, + "deploymentState": { + "type": "DeploymentState", + "id": 8 + }, + "etag": { + "type": "string", + "id": 10 + }, + "labels": { + "keyType": "string", + "type": "string", + "id": 34 + } + }, + "nested": { + "DeploymentState": { + "values": { + "DEPLOYMENT_STATE_UNSPECIFIED": 0, + "DEPLOYED": 1, + "UNDEPLOYED": 2 + } + } + } + }, + "ModelEvaluation": { + "options": { + "(google.api.resource).type": "automl.googleapis.com/ModelEvaluation", + "(google.api.resource).pattern": "projects/{project}/locations/{location}/models/{model}/modelEvaluations/{model_evaluation}" + }, + "oneofs": { + "metrics": { + "oneof": [ + "classificationEvaluationMetrics", + "translationEvaluationMetrics", + "imageObjectDetectionEvaluationMetrics", + "textSentimentEvaluationMetrics", + "textExtractionEvaluationMetrics" + ] + } + }, + "fields": { + "classificationEvaluationMetrics": { + "type": "ClassificationEvaluationMetrics", + "id": 8 + }, + "translationEvaluationMetrics": { + "type": "TranslationEvaluationMetrics", + "id": 9 + }, + "imageObjectDetectionEvaluationMetrics": { + "type": "ImageObjectDetectionEvaluationMetrics", + "id": 12 + }, + "textSentimentEvaluationMetrics": { + "type": "TextSentimentEvaluationMetrics", + "id": 11 + }, + "textExtractionEvaluationMetrics": { + "type": "TextExtractionEvaluationMetrics", + "id": 13 + }, + "name": { + "type": "string", + "id": 1 + }, + "annotationSpecId": { + "type": "string", + "id": 2 + }, + "displayName": { + "type": "string", + "id": 15 + }, + "createTime": { + "type": "google.protobuf.Timestamp", + "id": 5 + }, + "evaluatedExampleCount": { + "type": "int32", + "id": 6 + } + } + }, + "OperationMetadata": { + "oneofs": { + "details": { + "oneof": [ + "deleteDetails", + "deployModelDetails", + "undeployModelDetails", + "createModelDetails", + "createDatasetDetails", + "importDataDetails", + "batchPredictDetails", + "exportDataDetails", + "exportModelDetails" + ] + } + }, + "fields": { + "deleteDetails": { + "type": "DeleteOperationMetadata", + "id": 8 + }, + "deployModelDetails": { + "type": "DeployModelOperationMetadata", + "id": 24 + }, + "undeployModelDetails": { + "type": "UndeployModelOperationMetadata", + "id": 25 + }, + "createModelDetails": { + "type": "CreateModelOperationMetadata", + "id": 10 + }, + "createDatasetDetails": { + "type": "CreateDatasetOperationMetadata", + "id": 30 + }, + "importDataDetails": { + "type": "ImportDataOperationMetadata", + "id": 15 + }, + "batchPredictDetails": { + "type": "BatchPredictOperationMetadata", + "id": 16 + }, + "exportDataDetails": { + "type": "ExportDataOperationMetadata", + "id": 21 + }, + "exportModelDetails": { + "type": "ExportModelOperationMetadata", + "id": 22 + }, + "progressPercent": { + "type": "int32", + "id": 13 + }, + "partialFailures": { + "rule": "repeated", + "type": "google.rpc.Status", + "id": 2 + }, + "createTime": { + "type": "google.protobuf.Timestamp", + "id": 3 + }, + "updateTime": { + "type": "google.protobuf.Timestamp", + "id": 4 + } + } + }, + "DeleteOperationMetadata": { + "fields": {} + }, + "DeployModelOperationMetadata": { + "fields": {} + }, + "UndeployModelOperationMetadata": { + "fields": {} + }, + "CreateDatasetOperationMetadata": { + "fields": {} + }, + "CreateModelOperationMetadata": { + "fields": {} + }, + "ImportDataOperationMetadata": { + "fields": {} + }, + "ExportDataOperationMetadata": { + "fields": { + "outputInfo": { + "type": "ExportDataOutputInfo", + "id": 1 + } + }, + "nested": { + "ExportDataOutputInfo": { + "oneofs": { + "outputLocation": { + "oneof": [ + "gcsOutputDirectory" + ] + } + }, + "fields": { + "gcsOutputDirectory": { + "type": "string", + "id": 1 + } + } + } + } + }, + "BatchPredictOperationMetadata": { + "fields": { + "inputConfig": { + "type": "BatchPredictInputConfig", + "id": 1 + }, + "outputInfo": { + "type": "BatchPredictOutputInfo", + "id": 2 + } + }, + "nested": { + "BatchPredictOutputInfo": { + "oneofs": { + "outputLocation": { + "oneof": [ + "gcsOutputDirectory" + ] + } + }, + "fields": { + "gcsOutputDirectory": { + "type": "string", + "id": 1 + } + } + } + } + }, + "ExportModelOperationMetadata": { + "fields": { + "outputInfo": { + "type": "ExportModelOutputInfo", + "id": 2 + } + }, + "nested": { + "ExportModelOutputInfo": { + "fields": { + "gcsOutputDirectory": { + "type": "string", + "id": 1 + } + } + } + } + }, + "PredictionService": { + "options": { + "(google.api.default_host)": "automl.googleapis.com", + "(google.api.oauth_scopes)": "https://www.googleapis.com/auth/cloud-platform" + }, + "methods": { + "Predict": { + "requestType": "PredictRequest", + "responseType": "PredictResponse", + "options": { + "(google.api.http).post": "/v1/{name=projects/*/locations/*/models/*}:predict", + "(google.api.http).body": "*", + "(google.api.method_signature)": "name,payload,params" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1/{name=projects/*/locations/*/models/*}:predict", + "body": "*" + } + }, + { + "(google.api.method_signature)": "name,payload,params" + } + ] + }, + "BatchPredict": { + "requestType": "BatchPredictRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).post": "/v1/{name=projects/*/locations/*/models/*}:batchPredict", + "(google.api.http).body": "*", + "(google.api.method_signature)": "name,input_config,output_config,params", + "(google.longrunning.operation_info).response_type": "BatchPredictResult", + "(google.longrunning.operation_info).metadata_type": "OperationMetadata" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1/{name=projects/*/locations/*/models/*}:batchPredict", + "body": "*" + } + }, + { + "(google.api.method_signature)": "name,input_config,output_config,params" + }, + { + "(google.longrunning.operation_info)": { + "response_type": "BatchPredictResult", + "metadata_type": "OperationMetadata" + } + } + ] + } + } + }, + "PredictRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "automl.googleapis.com/Model" + } + }, + "payload": { + "type": "ExamplePayload", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "params": { + "keyType": "string", + "type": "string", + "id": 3 + } + } + }, + "PredictResponse": { + "fields": { + "payload": { + "rule": "repeated", + "type": "AnnotationPayload", + "id": 1 + }, + "preprocessedInput": { + "type": "ExamplePayload", + "id": 3 + }, + "metadata": { + "keyType": "string", + "type": "string", + "id": 2 + } + } + }, + "BatchPredictRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "automl.googleapis.com/Model" + } + }, + "inputConfig": { + "type": "BatchPredictInputConfig", + "id": 3, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "outputConfig": { + "type": "BatchPredictOutputConfig", + "id": 4, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "params": { + "keyType": "string", + "type": "string", + "id": 5 + } + } + }, + "BatchPredictResult": { + "fields": { + "metadata": { + "keyType": "string", + "type": "string", + "id": 1 + } + } + }, + "AutoMl": { + "options": { + "(google.api.default_host)": "automl.googleapis.com", + "(google.api.oauth_scopes)": "https://www.googleapis.com/auth/cloud-platform" + }, + "methods": { + "CreateDataset": { + "requestType": "CreateDatasetRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).post": "/v1/{parent=projects/*/locations/*}/datasets", + "(google.api.http).body": "dataset", + "(google.api.method_signature)": "parent,dataset", + "(google.longrunning.operation_info).response_type": "Dataset", + "(google.longrunning.operation_info).metadata_type": "OperationMetadata" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1/{parent=projects/*/locations/*}/datasets", + "body": "dataset" + } + }, + { + "(google.api.method_signature)": "parent,dataset" + }, + { + "(google.longrunning.operation_info)": { + "response_type": "Dataset", + "metadata_type": "OperationMetadata" + } + } + ] + }, + "GetDataset": { + "requestType": "GetDatasetRequest", + "responseType": "Dataset", + "options": { + "(google.api.http).get": "/v1/{name=projects/*/locations/*/datasets/*}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1/{name=projects/*/locations/*/datasets/*}" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "ListDatasets": { + "requestType": "ListDatasetsRequest", + "responseType": "ListDatasetsResponse", + "options": { + "(google.api.http).get": "/v1/{parent=projects/*/locations/*}/datasets", + "(google.api.method_signature)": "parent" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1/{parent=projects/*/locations/*}/datasets" + } + }, + { + "(google.api.method_signature)": "parent" + } + ] + }, + "UpdateDataset": { + "requestType": "UpdateDatasetRequest", + "responseType": "Dataset", + "options": { + "(google.api.http).patch": "/v1/{dataset.name=projects/*/locations/*/datasets/*}", + "(google.api.http).body": "dataset", + "(google.api.method_signature)": "dataset,update_mask" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "patch": "/v1/{dataset.name=projects/*/locations/*/datasets/*}", + "body": "dataset" + } + }, + { + "(google.api.method_signature)": "dataset,update_mask" + } + ] + }, + "DeleteDataset": { + "requestType": "DeleteDatasetRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).delete": "/v1/{name=projects/*/locations/*/datasets/*}", + "(google.api.method_signature)": "name", + "(google.longrunning.operation_info).response_type": "google.protobuf.Empty", + "(google.longrunning.operation_info).metadata_type": "OperationMetadata" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "delete": "/v1/{name=projects/*/locations/*/datasets/*}" + } + }, + { + "(google.api.method_signature)": "name" + }, + { + "(google.longrunning.operation_info)": { + "response_type": "google.protobuf.Empty", + "metadata_type": "OperationMetadata" + } + } + ] + }, + "ImportData": { + "requestType": "ImportDataRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).post": "/v1/{name=projects/*/locations/*/datasets/*}:importData", + "(google.api.http).body": "*", + "(google.api.method_signature)": "name,input_config", + "(google.longrunning.operation_info).response_type": "google.protobuf.Empty", + "(google.longrunning.operation_info).metadata_type": "OperationMetadata" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1/{name=projects/*/locations/*/datasets/*}:importData", + "body": "*" + } + }, + { + "(google.api.method_signature)": "name,input_config" + }, + { + "(google.longrunning.operation_info)": { + "response_type": "google.protobuf.Empty", + "metadata_type": "OperationMetadata" + } + } + ] + }, + "ExportData": { + "requestType": "ExportDataRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).post": "/v1/{name=projects/*/locations/*/datasets/*}:exportData", + "(google.api.http).body": "*", + "(google.api.method_signature)": "name,output_config", + "(google.longrunning.operation_info).response_type": "google.protobuf.Empty", + "(google.longrunning.operation_info).metadata_type": "OperationMetadata" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1/{name=projects/*/locations/*/datasets/*}:exportData", + "body": "*" + } + }, + { + "(google.api.method_signature)": "name,output_config" + }, + { + "(google.longrunning.operation_info)": { + "response_type": "google.protobuf.Empty", + "metadata_type": "OperationMetadata" + } + } + ] + }, + "GetAnnotationSpec": { + "requestType": "GetAnnotationSpecRequest", + "responseType": "AnnotationSpec", + "options": { + "(google.api.http).get": "/v1/{name=projects/*/locations/*/datasets/*/annotationSpecs/*}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1/{name=projects/*/locations/*/datasets/*/annotationSpecs/*}" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "CreateModel": { + "requestType": "CreateModelRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).post": "/v1/{parent=projects/*/locations/*}/models", + "(google.api.http).body": "model", + "(google.api.method_signature)": "parent,model", + "(google.longrunning.operation_info).response_type": "Model", + "(google.longrunning.operation_info).metadata_type": "OperationMetadata" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1/{parent=projects/*/locations/*}/models", + "body": "model" + } + }, + { + "(google.api.method_signature)": "parent,model" + }, + { + "(google.longrunning.operation_info)": { + "response_type": "Model", + "metadata_type": "OperationMetadata" + } + } + ] + }, + "GetModel": { + "requestType": "GetModelRequest", + "responseType": "Model", + "options": { + "(google.api.http).get": "/v1/{name=projects/*/locations/*/models/*}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1/{name=projects/*/locations/*/models/*}" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "ListModels": { + "requestType": "ListModelsRequest", + "responseType": "ListModelsResponse", + "options": { + "(google.api.http).get": "/v1/{parent=projects/*/locations/*}/models", + "(google.api.method_signature)": "parent" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1/{parent=projects/*/locations/*}/models" + } + }, + { + "(google.api.method_signature)": "parent" + } + ] + }, + "DeleteModel": { + "requestType": "DeleteModelRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).delete": "/v1/{name=projects/*/locations/*/models/*}", + "(google.api.method_signature)": "name", + "(google.longrunning.operation_info).response_type": "google.protobuf.Empty", + "(google.longrunning.operation_info).metadata_type": "OperationMetadata" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "delete": "/v1/{name=projects/*/locations/*/models/*}" + } + }, + { + "(google.api.method_signature)": "name" + }, + { + "(google.longrunning.operation_info)": { + "response_type": "google.protobuf.Empty", + "metadata_type": "OperationMetadata" + } + } + ] + }, + "UpdateModel": { + "requestType": "UpdateModelRequest", + "responseType": "Model", + "options": { + "(google.api.http).patch": "/v1/{model.name=projects/*/locations/*/models/*}", + "(google.api.http).body": "model", + "(google.api.method_signature)": "model,update_mask" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "patch": "/v1/{model.name=projects/*/locations/*/models/*}", + "body": "model" + } + }, + { + "(google.api.method_signature)": "model,update_mask" + } + ] + }, + "DeployModel": { + "requestType": "DeployModelRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).post": "/v1/{name=projects/*/locations/*/models/*}:deploy", + "(google.api.http).body": "*", + "(google.api.method_signature)": "name", + "(google.longrunning.operation_info).response_type": "google.protobuf.Empty", + "(google.longrunning.operation_info).metadata_type": "OperationMetadata" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1/{name=projects/*/locations/*/models/*}:deploy", + "body": "*" + } + }, + { + "(google.api.method_signature)": "name" + }, + { + "(google.longrunning.operation_info)": { + "response_type": "google.protobuf.Empty", + "metadata_type": "OperationMetadata" + } + } + ] + }, + "UndeployModel": { + "requestType": "UndeployModelRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).post": "/v1/{name=projects/*/locations/*/models/*}:undeploy", + "(google.api.http).body": "*", + "(google.api.method_signature)": "name", + "(google.longrunning.operation_info).response_type": "google.protobuf.Empty", + "(google.longrunning.operation_info).metadata_type": "OperationMetadata" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1/{name=projects/*/locations/*/models/*}:undeploy", + "body": "*" + } + }, + { + "(google.api.method_signature)": "name" + }, + { + "(google.longrunning.operation_info)": { + "response_type": "google.protobuf.Empty", + "metadata_type": "OperationMetadata" + } + } + ] + }, + "ExportModel": { + "requestType": "ExportModelRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).post": "/v1/{name=projects/*/locations/*/models/*}:export", + "(google.api.http).body": "*", + "(google.api.method_signature)": "name,output_config", + "(google.longrunning.operation_info).response_type": "google.protobuf.Empty", + "(google.longrunning.operation_info).metadata_type": "OperationMetadata" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1/{name=projects/*/locations/*/models/*}:export", + "body": "*" + } + }, + { + "(google.api.method_signature)": "name,output_config" + }, + { + "(google.longrunning.operation_info)": { + "response_type": "google.protobuf.Empty", + "metadata_type": "OperationMetadata" + } + } + ] + }, + "GetModelEvaluation": { + "requestType": "GetModelEvaluationRequest", + "responseType": "ModelEvaluation", + "options": { + "(google.api.http).get": "/v1/{name=projects/*/locations/*/models/*/modelEvaluations/*}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1/{name=projects/*/locations/*/models/*/modelEvaluations/*}" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "ListModelEvaluations": { + "requestType": "ListModelEvaluationsRequest", + "responseType": "ListModelEvaluationsResponse", + "options": { + "(google.api.http).get": "/v1/{parent=projects/*/locations/*/models/*}/modelEvaluations", + "(google.api.method_signature)": "parent,filter" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1/{parent=projects/*/locations/*/models/*}/modelEvaluations" + } + }, + { + "(google.api.method_signature)": "parent,filter" + } + ] + } + } + }, + "CreateDatasetRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "locations.googleapis.com/Location" + } + }, + "dataset": { + "type": "Dataset", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "GetDatasetRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "automl.googleapis.com/Dataset" + } + } + } + }, + "ListDatasetsRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "locations.googleapis.com/Location" + } + }, + "filter": { + "type": "string", + "id": 3 + }, + "pageSize": { + "type": "int32", + "id": 4 + }, + "pageToken": { + "type": "string", + "id": 6 + } + } + }, + "ListDatasetsResponse": { + "fields": { + "datasets": { + "rule": "repeated", + "type": "Dataset", + "id": 1 + }, + "nextPageToken": { + "type": "string", + "id": 2 + } + } + }, + "UpdateDatasetRequest": { + "fields": { + "dataset": { + "type": "Dataset", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "updateMask": { + "type": "google.protobuf.FieldMask", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "DeleteDatasetRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "automl.googleapis.com/Dataset" + } + } + } + }, + "ImportDataRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "automl.googleapis.com/Dataset" + } + }, + "inputConfig": { + "type": "InputConfig", + "id": 3, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "ExportDataRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "automl.googleapis.com/Dataset" + } + }, + "outputConfig": { + "type": "OutputConfig", + "id": 3, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "GetAnnotationSpecRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "automl.googleapis.com/AnnotationSpec" + } + } + } + }, + "CreateModelRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "locations.googleapis.com/Location" + } + }, + "model": { + "type": "Model", + "id": 4, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "GetModelRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "automl.googleapis.com/Model" + } + } + } + }, + "ListModelsRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "locations.googleapis.com/Location" + } + }, + "filter": { + "type": "string", + "id": 3 + }, + "pageSize": { + "type": "int32", + "id": 4 + }, + "pageToken": { + "type": "string", + "id": 6 + } + } + }, + "ListModelsResponse": { + "fields": { + "model": { + "rule": "repeated", + "type": "Model", + "id": 1 + }, + "nextPageToken": { + "type": "string", + "id": 2 + } + } + }, + "DeleteModelRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "automl.googleapis.com/Model" + } + } + } + }, + "UpdateModelRequest": { + "fields": { + "model": { + "type": "Model", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "updateMask": { + "type": "google.protobuf.FieldMask", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "DeployModelRequest": { + "oneofs": { + "modelDeploymentMetadata": { + "oneof": [ + "imageObjectDetectionModelDeploymentMetadata", + "imageClassificationModelDeploymentMetadata" + ] + } + }, + "fields": { + "imageObjectDetectionModelDeploymentMetadata": { + "type": "ImageObjectDetectionModelDeploymentMetadata", + "id": 2 + }, + "imageClassificationModelDeploymentMetadata": { + "type": "ImageClassificationModelDeploymentMetadata", + "id": 4 + }, + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "automl.googleapis.com/Model" + } + } + } + }, + "UndeployModelRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "automl.googleapis.com/Model" + } + } + } + }, + "ExportModelRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "automl.googleapis.com/Model" + } + }, + "outputConfig": { + "type": "ModelExportOutputConfig", + "id": 3, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "GetModelEvaluationRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "automl.googleapis.com/ModelEvaluation" + } + } + } + }, + "ListModelEvaluationsRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "automl.googleapis.com/Model" + } + }, + "filter": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "pageSize": { + "type": "int32", + "id": 4 + }, + "pageToken": { + "type": "string", + "id": 6 + } + } + }, + "ListModelEvaluationsResponse": { + "fields": { + "modelEvaluation": { + "rule": "repeated", + "type": "ModelEvaluation", + "id": 1 + }, + "nextPageToken": { + "type": "string", + "id": 2 + } + } + } + } + }, + "v1beta1": { + "options": { + "go_package": "cloud.google.com/go/automl/apiv1beta1/automlpb;automlpb", + "java_multiple_files": true, + "java_package": "com.google.cloud.automl.v1beta1", + "php_namespace": "Google\\Cloud\\AutoMl\\V1beta1", + "ruby_package": "Google::Cloud::AutoML::V1beta1", + "java_outer_classname": "AutoMlProto" + }, + "nested": { + "AnnotationPayload": { + "oneofs": { + "detail": { + "oneof": [ + "translation", + "classification", + "imageObjectDetection", + "videoClassification", + "videoObjectTracking", + "textExtraction", + "textSentiment", + "tables" + ] + } + }, + "fields": { + "translation": { + "type": "TranslationAnnotation", + "id": 2 + }, + "classification": { + "type": "ClassificationAnnotation", + "id": 3 + }, + "imageObjectDetection": { + "type": "ImageObjectDetectionAnnotation", + "id": 4 + }, + "videoClassification": { + "type": "VideoClassificationAnnotation", + "id": 9 + }, + "videoObjectTracking": { + "type": "VideoObjectTrackingAnnotation", + "id": 8 + }, + "textExtraction": { + "type": "TextExtractionAnnotation", + "id": 6 + }, + "textSentiment": { + "type": "TextSentimentAnnotation", + "id": 7 + }, + "tables": { + "type": "TablesAnnotation", + "id": 10 + }, + "annotationSpecId": { + "type": "string", + "id": 1 + }, + "displayName": { + "type": "string", + "id": 5 + } + } + }, + "ClassificationType": { + "values": { + "CLASSIFICATION_TYPE_UNSPECIFIED": 0, + "MULTICLASS": 1, + "MULTILABEL": 2 + } + }, + "ClassificationAnnotation": { + "fields": { + "score": { + "type": "float", + "id": 1 + } + } + }, + "VideoClassificationAnnotation": { + "fields": { + "type": { + "type": "string", + "id": 1 + }, + "classificationAnnotation": { + "type": "ClassificationAnnotation", + "id": 2 + }, + "timeSegment": { + "type": "TimeSegment", + "id": 3 + } + } + }, + "ClassificationEvaluationMetrics": { + "fields": { + "auPrc": { + "type": "float", + "id": 1 + }, + "baseAuPrc": { + "type": "float", + "id": 2, + "options": { + "deprecated": true + } + }, + "auRoc": { + "type": "float", + "id": 6 + }, + "logLoss": { + "type": "float", + "id": 7 + }, + "confidenceMetricsEntry": { + "rule": "repeated", + "type": "ConfidenceMetricsEntry", + "id": 3 + }, + "confusionMatrix": { + "type": "ConfusionMatrix", + "id": 4 + }, + "annotationSpecId": { + "rule": "repeated", + "type": "string", + "id": 5 + } + }, + "nested": { + "ConfidenceMetricsEntry": { + "fields": { + "confidenceThreshold": { + "type": "float", + "id": 1 + }, + "positionThreshold": { + "type": "int32", + "id": 14 + }, + "recall": { + "type": "float", + "id": 2 + }, + "precision": { + "type": "float", + "id": 3 + }, + "falsePositiveRate": { + "type": "float", + "id": 8 + }, + "f1Score": { + "type": "float", + "id": 4 + }, + "recallAt1": { + "type": "float", + "id": 5 + }, + "precisionAt1": { + "type": "float", + "id": 6 + }, + "falsePositiveRateAt1": { + "type": "float", + "id": 9 + }, + "f1ScoreAt1": { + "type": "float", + "id": 7 + }, + "truePositiveCount": { + "type": "int64", + "id": 10 + }, + "falsePositiveCount": { + "type": "int64", + "id": 11 + }, + "falseNegativeCount": { + "type": "int64", + "id": 12 + }, + "trueNegativeCount": { + "type": "int64", + "id": 13 + } + } + }, + "ConfusionMatrix": { + "fields": { + "annotationSpecId": { + "rule": "repeated", + "type": "string", + "id": 1 + }, + "displayName": { + "rule": "repeated", + "type": "string", + "id": 3 + }, + "row": { + "rule": "repeated", + "type": "Row", + "id": 2 + } + }, + "nested": { + "Row": { + "fields": { + "exampleCount": { + "rule": "repeated", + "type": "int32", + "id": 1 + } + } + } + } + } + } + }, + "TimeSegment": { + "fields": { + "startTimeOffset": { + "type": "google.protobuf.Duration", + "id": 1 + }, + "endTimeOffset": { + "type": "google.protobuf.Duration", + "id": 2 + } + } + }, + "ImageObjectDetectionAnnotation": { + "fields": { + "boundingBox": { + "type": "BoundingPoly", + "id": 1 + }, + "score": { + "type": "float", + "id": 2 + } + } + }, + "VideoObjectTrackingAnnotation": { + "fields": { + "instanceId": { + "type": "string", + "id": 1 + }, + "timeOffset": { + "type": "google.protobuf.Duration", + "id": 2 + }, + "boundingBox": { + "type": "BoundingPoly", + "id": 3 + }, + "score": { + "type": "float", + "id": 4 + } + } + }, + "BoundingBoxMetricsEntry": { + "fields": { + "iouThreshold": { + "type": "float", + "id": 1 + }, + "meanAveragePrecision": { + "type": "float", + "id": 2 + }, + "confidenceMetricsEntries": { + "rule": "repeated", + "type": "ConfidenceMetricsEntry", + "id": 3 + } + }, + "nested": { + "ConfidenceMetricsEntry": { + "fields": { + "confidenceThreshold": { + "type": "float", + "id": 1 + }, + "recall": { + "type": "float", + "id": 2 + }, + "precision": { + "type": "float", + "id": 3 + }, + "f1Score": { + "type": "float", + "id": 4 + } + } + } + } + }, + "ImageObjectDetectionEvaluationMetrics": { + "fields": { + "evaluatedBoundingBoxCount": { + "type": "int32", + "id": 1 + }, + "boundingBoxMetricsEntries": { + "rule": "repeated", + "type": "BoundingBoxMetricsEntry", + "id": 2 + }, + "boundingBoxMeanAveragePrecision": { + "type": "float", + "id": 3 + } + } + }, + "VideoObjectTrackingEvaluationMetrics": { + "fields": { + "evaluatedFrameCount": { + "type": "int32", + "id": 1 + }, + "evaluatedBoundingBoxCount": { + "type": "int32", + "id": 2 + }, + "boundingBoxMetricsEntries": { + "rule": "repeated", + "type": "BoundingBoxMetricsEntry", + "id": 4 + }, + "boundingBoxMeanAveragePrecision": { + "type": "float", + "id": 6 + } + } + }, + "NormalizedVertex": { + "fields": { + "x": { + "type": "float", + "id": 1 + }, + "y": { + "type": "float", + "id": 2 + } + } + }, + "BoundingPoly": { + "fields": { + "normalizedVertices": { + "rule": "repeated", + "type": "NormalizedVertex", + "id": 2 + } + } + }, + "TablesDatasetMetadata": { + "fields": { + "primaryTableSpecId": { + "type": "string", + "id": 1 + }, + "targetColumnSpecId": { + "type": "string", + "id": 2 + }, + "weightColumnSpecId": { + "type": "string", + "id": 3 + }, + "mlUseColumnSpecId": { + "type": "string", + "id": 4 + }, + "targetColumnCorrelations": { + "keyType": "string", + "type": "CorrelationStats", + "id": 6 + }, + "statsUpdateTime": { + "type": "google.protobuf.Timestamp", + "id": 7 + } + } + }, + "TablesModelMetadata": { + "oneofs": { + "additionalOptimizationObjectiveConfig": { + "oneof": [ + "optimizationObjectiveRecallValue", + "optimizationObjectivePrecisionValue" + ] + } + }, + "fields": { + "optimizationObjectiveRecallValue": { + "type": "float", + "id": 17 + }, + "optimizationObjectivePrecisionValue": { + "type": "float", + "id": 18 + }, + "targetColumnSpec": { + "type": "ColumnSpec", + "id": 2 + }, + "inputFeatureColumnSpecs": { + "rule": "repeated", + "type": "ColumnSpec", + "id": 3 + }, + "optimizationObjective": { + "type": "string", + "id": 4 + }, + "tablesModelColumnInfo": { + "rule": "repeated", + "type": "TablesModelColumnInfo", + "id": 5 + }, + "trainBudgetMilliNodeHours": { + "type": "int64", + "id": 6 + }, + "trainCostMilliNodeHours": { + "type": "int64", + "id": 7 + }, + "disableEarlyStopping": { + "type": "bool", + "id": 12 + } + } + }, + "TablesAnnotation": { + "fields": { + "score": { + "type": "float", + "id": 1 + }, + "predictionInterval": { + "type": "DoubleRange", + "id": 4 + }, + "value": { + "type": "google.protobuf.Value", + "id": 2 + }, + "tablesModelColumnInfo": { + "rule": "repeated", + "type": "TablesModelColumnInfo", + "id": 3 + }, + "baselineScore": { + "type": "float", + "id": 5 + } + } + }, + "TablesModelColumnInfo": { + "fields": { + "columnSpecName": { + "type": "string", + "id": 1 + }, + "columnDisplayName": { + "type": "string", + "id": 2 + }, + "featureImportance": { + "type": "float", + "id": 3 + } + } + }, + "ColumnSpec": { + "options": { + "(google.api.resource).type": "automl.googleapis.com/ColumnSpec", + "(google.api.resource).pattern": "projects/{project}/locations/{location}/datasets/{dataset}/tableSpecs/{table_spec}/columnSpecs/{column_spec}" + }, + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "dataType": { + "type": "DataType", + "id": 2 + }, + "displayName": { + "type": "string", + "id": 3 + }, + "dataStats": { + "type": "DataStats", + "id": 4 + }, + "topCorrelatedColumns": { + "rule": "repeated", + "type": "CorrelatedColumn", + "id": 5 + }, + "etag": { + "type": "string", + "id": 6 + } + }, + "nested": { + "CorrelatedColumn": { + "fields": { + "columnSpecId": { + "type": "string", + "id": 1 + }, + "correlationStats": { + "type": "CorrelationStats", + "id": 2 + } + } + } + } + }, + "DataStats": { + "oneofs": { + "stats": { + "oneof": [ + "float64Stats", + "stringStats", + "timestampStats", + "arrayStats", + "structStats", + "categoryStats" + ] + } + }, + "fields": { + "float64Stats": { + "type": "Float64Stats", + "id": 3 + }, + "stringStats": { + "type": "StringStats", + "id": 4 + }, + "timestampStats": { + "type": "TimestampStats", + "id": 5 + }, + "arrayStats": { + "type": "ArrayStats", + "id": 6 + }, + "structStats": { + "type": "StructStats", + "id": 7 + }, + "categoryStats": { + "type": "CategoryStats", + "id": 8 + }, + "distinctValueCount": { + "type": "int64", + "id": 1 + }, + "nullValueCount": { + "type": "int64", + "id": 2 + }, + "validValueCount": { + "type": "int64", + "id": 9 + } + } + }, + "Float64Stats": { + "fields": { + "mean": { + "type": "double", + "id": 1 + }, + "standardDeviation": { + "type": "double", + "id": 2 + }, + "quantiles": { + "rule": "repeated", + "type": "double", + "id": 3 + }, + "histogramBuckets": { + "rule": "repeated", + "type": "HistogramBucket", + "id": 4 + } + }, + "nested": { + "HistogramBucket": { + "fields": { + "min": { + "type": "double", + "id": 1 + }, + "max": { + "type": "double", + "id": 2 + }, + "count": { + "type": "int64", + "id": 3 + } + } + } + } + }, + "StringStats": { + "fields": { + "topUnigramStats": { + "rule": "repeated", + "type": "UnigramStats", + "id": 1 + } + }, + "nested": { + "UnigramStats": { + "fields": { + "value": { + "type": "string", + "id": 1 + }, + "count": { + "type": "int64", + "id": 2 + } + } + } + } + }, + "TimestampStats": { + "fields": { + "granularStats": { + "keyType": "string", + "type": "GranularStats", + "id": 1 + } + }, + "nested": { + "GranularStats": { + "fields": { + "buckets": { + "keyType": "int32", + "type": "int64", + "id": 1 + } + } + } + } + }, + "ArrayStats": { + "fields": { + "memberStats": { + "type": "DataStats", + "id": 2 + } + } + }, + "StructStats": { + "fields": { + "fieldStats": { + "keyType": "string", + "type": "DataStats", + "id": 1 + } + } + }, + "CategoryStats": { + "fields": { + "topCategoryStats": { + "rule": "repeated", + "type": "SingleCategoryStats", + "id": 1 + } + }, + "nested": { + "SingleCategoryStats": { + "fields": { + "value": { + "type": "string", + "id": 1 + }, + "count": { + "type": "int64", + "id": 2 + } + } + } + } + }, + "CorrelationStats": { + "fields": { + "cramersV": { + "type": "double", + "id": 1 + } + } + }, + "TypeCode": { + "values": { + "TYPE_CODE_UNSPECIFIED": 0, + "FLOAT64": 3, + "TIMESTAMP": 4, + "STRING": 6, + "ARRAY": 8, + "STRUCT": 9, + "CATEGORY": 10 + } + }, + "DataType": { + "oneofs": { + "details": { + "oneof": [ + "listElementType", + "structType", + "timeFormat" + ] + } + }, + "fields": { + "listElementType": { + "type": "DataType", + "id": 2 + }, + "structType": { + "type": "StructType", + "id": 3 + }, + "timeFormat": { + "type": "string", + "id": 5 + }, + "typeCode": { + "type": "TypeCode", + "id": 1 + }, + "nullable": { + "type": "bool", + "id": 4 + } + } + }, + "StructType": { + "fields": { + "fields": { + "keyType": "string", + "type": "DataType", + "id": 1 + } + } + }, + "Image": { + "oneofs": { + "data": { + "oneof": [ + "imageBytes", + "inputConfig" + ] + } + }, + "fields": { + "imageBytes": { + "type": "bytes", + "id": 1 + }, + "inputConfig": { + "type": "InputConfig", + "id": 6 + }, + "thumbnailUri": { + "type": "string", + "id": 4 + } + } + }, + "TextSnippet": { + "fields": { + "content": { + "type": "string", + "id": 1 + }, + "mimeType": { + "type": "string", + "id": 2 + }, + "contentUri": { + "type": "string", + "id": 4 + } + } + }, + "DocumentDimensions": { + "fields": { + "unit": { + "type": "DocumentDimensionUnit", + "id": 1 + }, + "width": { + "type": "float", + "id": 2 + }, + "height": { + "type": "float", + "id": 3 + } + }, + "nested": { + "DocumentDimensionUnit": { + "values": { + "DOCUMENT_DIMENSION_UNIT_UNSPECIFIED": 0, + "INCH": 1, + "CENTIMETER": 2, + "POINT": 3 + } + } + } + }, + "Document": { + "fields": { + "inputConfig": { + "type": "DocumentInputConfig", + "id": 1 + }, + "documentText": { + "type": "TextSnippet", + "id": 2 + }, + "layout": { + "rule": "repeated", + "type": "Layout", + "id": 3 + }, + "documentDimensions": { + "type": "DocumentDimensions", + "id": 4 + }, + "pageCount": { + "type": "int32", + "id": 5 + } + }, + "nested": { + "Layout": { + "fields": { + "textSegment": { + "type": "TextSegment", + "id": 1 + }, + "pageNumber": { + "type": "int32", + "id": 2 + }, + "boundingPoly": { + "type": "BoundingPoly", + "id": 3 + }, + "textSegmentType": { + "type": "TextSegmentType", + "id": 4 + } + }, + "nested": { + "TextSegmentType": { + "values": { + "TEXT_SEGMENT_TYPE_UNSPECIFIED": 0, + "TOKEN": 1, + "PARAGRAPH": 2, + "FORM_FIELD": 3, + "FORM_FIELD_NAME": 4, + "FORM_FIELD_CONTENTS": 5, + "TABLE": 6, + "TABLE_HEADER": 7, + "TABLE_ROW": 8, + "TABLE_CELL": 9 + } + } + } + } + } + }, + "Row": { + "fields": { + "columnSpecIds": { + "rule": "repeated", + "type": "string", + "id": 2 + }, + "values": { + "rule": "repeated", + "type": "google.protobuf.Value", + "id": 3 + } + } + }, + "ExamplePayload": { + "oneofs": { + "payload": { + "oneof": [ + "image", + "textSnippet", + "document", + "row" + ] + } + }, + "fields": { + "image": { + "type": "Image", + "id": 1 + }, + "textSnippet": { + "type": "TextSnippet", + "id": 2 + }, + "document": { + "type": "Document", + "id": 4 + }, + "row": { + "type": "Row", + "id": 3 + } + } + }, + "InputConfig": { + "oneofs": { + "source": { + "oneof": [ + "gcsSource", + "bigquerySource" + ] + } + }, + "fields": { + "gcsSource": { + "type": "GcsSource", + "id": 1 + }, + "bigquerySource": { + "type": "BigQuerySource", + "id": 3 + }, + "params": { + "keyType": "string", + "type": "string", + "id": 2 + } + } + }, + "BatchPredictInputConfig": { + "oneofs": { + "source": { + "oneof": [ + "gcsSource", + "bigquerySource" + ] + } + }, + "fields": { + "gcsSource": { + "type": "GcsSource", + "id": 1 + }, + "bigquerySource": { + "type": "BigQuerySource", + "id": 2 + } + } + }, + "DocumentInputConfig": { + "fields": { + "gcsSource": { + "type": "GcsSource", + "id": 1 + } + } + }, + "OutputConfig": { + "oneofs": { + "destination": { + "oneof": [ + "gcsDestination", + "bigqueryDestination" + ] + } + }, + "fields": { + "gcsDestination": { + "type": "GcsDestination", + "id": 1 + }, + "bigqueryDestination": { + "type": "BigQueryDestination", + "id": 2 + } + } + }, + "BatchPredictOutputConfig": { + "oneofs": { + "destination": { + "oneof": [ + "gcsDestination", + "bigqueryDestination" + ] + } + }, + "fields": { + "gcsDestination": { + "type": "GcsDestination", + "id": 1 + }, + "bigqueryDestination": { + "type": "BigQueryDestination", + "id": 2 + } + } + }, + "ModelExportOutputConfig": { + "oneofs": { + "destination": { + "oneof": [ + "gcsDestination", + "gcrDestination" + ] + } + }, + "fields": { + "gcsDestination": { + "type": "GcsDestination", + "id": 1 + }, + "gcrDestination": { + "type": "GcrDestination", + "id": 3 + }, + "modelFormat": { + "type": "string", + "id": 4 + }, + "params": { + "keyType": "string", + "type": "string", + "id": 2 + } + } + }, + "ExportEvaluatedExamplesOutputConfig": { + "oneofs": { + "destination": { + "oneof": [ + "bigqueryDestination" + ] + } + }, + "fields": { + "bigqueryDestination": { + "type": "BigQueryDestination", + "id": 2 + } + } + }, + "GcsSource": { + "fields": { + "inputUris": { + "rule": "repeated", + "type": "string", + "id": 1 + } + } + }, + "BigQuerySource": { + "fields": { + "inputUri": { + "type": "string", + "id": 1 + } + } + }, + "GcsDestination": { + "fields": { + "outputUriPrefix": { + "type": "string", + "id": 1 + } + } + }, + "BigQueryDestination": { + "fields": { + "outputUri": { + "type": "string", + "id": 1 + } + } + }, + "GcrDestination": { + "fields": { + "outputUri": { + "type": "string", + "id": 1 + } + } + }, + "TextSegment": { + "fields": { + "content": { + "type": "string", + "id": 3 + }, + "startOffset": { + "type": "int64", + "id": 1 + }, + "endOffset": { + "type": "int64", + "id": 2 + } + } + }, + "DoubleRange": { + "fields": { + "start": { + "type": "double", + "id": 1 + }, + "end": { + "type": "double", + "id": 2 + } + } + }, + "RegressionEvaluationMetrics": { + "fields": { + "rootMeanSquaredError": { + "type": "float", + "id": 1 + }, + "meanAbsoluteError": { + "type": "float", + "id": 2 + }, + "meanAbsolutePercentageError": { + "type": "float", + "id": 3 + }, + "rSquared": { + "type": "float", + "id": 4 + }, + "rootMeanSquaredLogError": { + "type": "float", + "id": 5 + } + } + }, + "TextExtractionAnnotation": { + "oneofs": { + "annotation": { + "oneof": [ + "textSegment" + ] + } + }, + "fields": { + "textSegment": { + "type": "TextSegment", + "id": 3 + }, + "score": { + "type": "float", + "id": 1 + } + } + }, + "TextExtractionEvaluationMetrics": { + "fields": { + "auPrc": { + "type": "float", + "id": 1 + }, + "confidenceMetricsEntries": { + "rule": "repeated", + "type": "ConfidenceMetricsEntry", + "id": 2 + } + }, + "nested": { + "ConfidenceMetricsEntry": { + "fields": { + "confidenceThreshold": { + "type": "float", + "id": 1 + }, + "recall": { + "type": "float", + "id": 3 + }, + "precision": { + "type": "float", + "id": 4 + }, + "f1Score": { + "type": "float", + "id": 5 + } + } + } + } + }, + "TextSentimentAnnotation": { + "fields": { + "sentiment": { + "type": "int32", + "id": 1 + } + } + }, + "TextSentimentEvaluationMetrics": { + "fields": { + "precision": { + "type": "float", + "id": 1 + }, + "recall": { + "type": "float", + "id": 2 + }, + "f1Score": { + "type": "float", + "id": 3 + }, + "meanAbsoluteError": { + "type": "float", + "id": 4 + }, + "meanSquaredError": { + "type": "float", + "id": 5 + }, + "linearKappa": { + "type": "float", + "id": 6 + }, + "quadraticKappa": { + "type": "float", + "id": 7 + }, + "confusionMatrix": { + "type": "ClassificationEvaluationMetrics.ConfusionMatrix", + "id": 8 + }, + "annotationSpecId": { + "rule": "repeated", + "type": "string", + "id": 9, + "options": { + "deprecated": true + } + } + } + }, + "TranslationDatasetMetadata": { + "fields": { + "sourceLanguageCode": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "targetLanguageCode": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "TranslationEvaluationMetrics": { + "fields": { + "bleuScore": { + "type": "double", + "id": 1 + }, + "baseBleuScore": { + "type": "double", + "id": 2 + } + } + }, + "TranslationModelMetadata": { + "fields": { + "baseModel": { + "type": "string", + "id": 1 + }, + "sourceLanguageCode": { + "type": "string", + "id": 2 + }, + "targetLanguageCode": { + "type": "string", + "id": 3 + } + } + }, + "TranslationAnnotation": { + "fields": { + "translatedContent": { + "type": "TextSnippet", + "id": 1 + } + } + }, + "AnnotationSpec": { + "options": { + "(google.api.resource).type": "automl.googleapis.com/AnnotationSpec", + "(google.api.resource).pattern": "projects/{project}/locations/{location}/datasets/{dataset}/annotationSpecs/{annotation_spec}" + }, + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "displayName": { + "type": "string", + "id": 2 + }, + "exampleCount": { + "type": "int32", + "id": 9 + } + } + }, + "Dataset": { + "options": { + "(google.api.resource).type": "automl.googleapis.com/Dataset", + "(google.api.resource).pattern": "projects/{project}/locations/{location}/datasets/{dataset}" + }, + "oneofs": { + "datasetMetadata": { + "oneof": [ + "translationDatasetMetadata", + "imageClassificationDatasetMetadata", + "textClassificationDatasetMetadata", + "imageObjectDetectionDatasetMetadata", + "videoClassificationDatasetMetadata", + "videoObjectTrackingDatasetMetadata", + "textExtractionDatasetMetadata", + "textSentimentDatasetMetadata", + "tablesDatasetMetadata" + ] + } + }, + "fields": { + "translationDatasetMetadata": { + "type": "TranslationDatasetMetadata", + "id": 23 + }, + "imageClassificationDatasetMetadata": { + "type": "ImageClassificationDatasetMetadata", + "id": 24 + }, + "textClassificationDatasetMetadata": { + "type": "TextClassificationDatasetMetadata", + "id": 25 + }, + "imageObjectDetectionDatasetMetadata": { + "type": "ImageObjectDetectionDatasetMetadata", + "id": 26 + }, + "videoClassificationDatasetMetadata": { + "type": "VideoClassificationDatasetMetadata", + "id": 31 + }, + "videoObjectTrackingDatasetMetadata": { + "type": "VideoObjectTrackingDatasetMetadata", + "id": 29 + }, + "textExtractionDatasetMetadata": { + "type": "TextExtractionDatasetMetadata", + "id": 28 + }, + "textSentimentDatasetMetadata": { + "type": "TextSentimentDatasetMetadata", + "id": 30 + }, + "tablesDatasetMetadata": { + "type": "TablesDatasetMetadata", + "id": 33 + }, + "name": { + "type": "string", + "id": 1 + }, + "displayName": { + "type": "string", + "id": 2 + }, + "description": { + "type": "string", + "id": 3 + }, + "exampleCount": { + "type": "int32", + "id": 21 + }, + "createTime": { + "type": "google.protobuf.Timestamp", + "id": 14 + }, + "etag": { + "type": "string", + "id": 17 + } + } + }, + "ImageClassificationDatasetMetadata": { + "fields": { + "classificationType": { + "type": "ClassificationType", + "id": 1 + } + } + }, + "ImageObjectDetectionDatasetMetadata": { + "fields": {} + }, + "ImageClassificationModelMetadata": { + "fields": { + "baseModelId": { + "type": "string", + "id": 1 + }, + "trainBudget": { + "type": "int64", + "id": 2 + }, + "trainCost": { + "type": "int64", + "id": 3 + }, + "stopReason": { + "type": "string", + "id": 5 + }, + "modelType": { + "type": "string", + "id": 7 + }, + "nodeQps": { + "type": "double", + "id": 13 + }, + "nodeCount": { + "type": "int64", + "id": 14 + } + } + }, + "ImageObjectDetectionModelMetadata": { + "fields": { + "modelType": { + "type": "string", + "id": 1 + }, + "nodeCount": { + "type": "int64", + "id": 3 + }, + "nodeQps": { + "type": "double", + "id": 4 + }, + "stopReason": { + "type": "string", + "id": 5 + }, + "trainBudgetMilliNodeHours": { + "type": "int64", + "id": 6 + }, + "trainCostMilliNodeHours": { + "type": "int64", + "id": 7 + } + } + }, + "ImageClassificationModelDeploymentMetadata": { + "fields": { + "nodeCount": { + "type": "int64", + "id": 1 + } + } + }, + "ImageObjectDetectionModelDeploymentMetadata": { + "fields": { + "nodeCount": { + "type": "int64", + "id": 1 + } + } + }, + "TextClassificationDatasetMetadata": { + "fields": { + "classificationType": { + "type": "ClassificationType", + "id": 1 + } + } + }, + "TextClassificationModelMetadata": { + "fields": { + "classificationType": { + "type": "ClassificationType", + "id": 3 + } + } + }, + "TextExtractionDatasetMetadata": { + "fields": {} + }, + "TextExtractionModelMetadata": { + "fields": { + "modelHint": { + "type": "string", + "id": 3 + } + } + }, + "TextSentimentDatasetMetadata": { + "fields": { + "sentimentMax": { + "type": "int32", + "id": 1 + } + } + }, + "TextSentimentModelMetadata": { + "fields": {} + }, + "VideoClassificationDatasetMetadata": { + "fields": {} + }, + "VideoObjectTrackingDatasetMetadata": { + "fields": {} + }, + "VideoClassificationModelMetadata": { + "fields": {} + }, + "VideoObjectTrackingModelMetadata": { + "fields": {} + }, + "Model": { + "options": { + "(google.api.resource).type": "automl.googleapis.com/Model", + "(google.api.resource).pattern": "projects/{project}/locations/{location}/models/{model}" + }, + "oneofs": { + "modelMetadata": { + "oneof": [ + "translationModelMetadata", + "imageClassificationModelMetadata", + "textClassificationModelMetadata", + "imageObjectDetectionModelMetadata", + "videoClassificationModelMetadata", + "videoObjectTrackingModelMetadata", + "textExtractionModelMetadata", + "tablesModelMetadata", + "textSentimentModelMetadata" + ] + } + }, + "fields": { + "translationModelMetadata": { + "type": "TranslationModelMetadata", + "id": 15 + }, + "imageClassificationModelMetadata": { + "type": "ImageClassificationModelMetadata", + "id": 13 + }, + "textClassificationModelMetadata": { + "type": "TextClassificationModelMetadata", + "id": 14 + }, + "imageObjectDetectionModelMetadata": { + "type": "ImageObjectDetectionModelMetadata", + "id": 20 + }, + "videoClassificationModelMetadata": { + "type": "VideoClassificationModelMetadata", + "id": 23 + }, + "videoObjectTrackingModelMetadata": { + "type": "VideoObjectTrackingModelMetadata", + "id": 21 + }, + "textExtractionModelMetadata": { + "type": "TextExtractionModelMetadata", + "id": 19 + }, + "tablesModelMetadata": { + "type": "TablesModelMetadata", + "id": 24 + }, + "textSentimentModelMetadata": { + "type": "TextSentimentModelMetadata", + "id": 22 + }, + "name": { + "type": "string", + "id": 1 + }, + "displayName": { + "type": "string", + "id": 2 + }, + "datasetId": { + "type": "string", + "id": 3 + }, + "createTime": { + "type": "google.protobuf.Timestamp", + "id": 7 + }, + "updateTime": { + "type": "google.protobuf.Timestamp", + "id": 11 + }, + "deploymentState": { + "type": "DeploymentState", + "id": 8 + } + }, + "nested": { + "DeploymentState": { + "values": { + "DEPLOYMENT_STATE_UNSPECIFIED": 0, + "DEPLOYED": 1, + "UNDEPLOYED": 2 + } + } + } + }, + "ModelEvaluation": { + "options": { + "(google.api.resource).type": "automl.googleapis.com/ModelEvaluation", + "(google.api.resource).pattern": "projects/{project}/locations/{location}/models/{model}/modelEvaluations/{model_evaluation}" + }, + "oneofs": { + "metrics": { + "oneof": [ + "classificationEvaluationMetrics", + "regressionEvaluationMetrics", + "translationEvaluationMetrics", + "imageObjectDetectionEvaluationMetrics", + "videoObjectTrackingEvaluationMetrics", + "textSentimentEvaluationMetrics", + "textExtractionEvaluationMetrics" + ] + } + }, + "fields": { + "classificationEvaluationMetrics": { + "type": "ClassificationEvaluationMetrics", + "id": 8 + }, + "regressionEvaluationMetrics": { + "type": "RegressionEvaluationMetrics", + "id": 24 + }, + "translationEvaluationMetrics": { + "type": "TranslationEvaluationMetrics", + "id": 9 + }, + "imageObjectDetectionEvaluationMetrics": { + "type": "ImageObjectDetectionEvaluationMetrics", + "id": 12 + }, + "videoObjectTrackingEvaluationMetrics": { + "type": "VideoObjectTrackingEvaluationMetrics", + "id": 14 + }, + "textSentimentEvaluationMetrics": { + "type": "TextSentimentEvaluationMetrics", + "id": 11 + }, + "textExtractionEvaluationMetrics": { + "type": "TextExtractionEvaluationMetrics", + "id": 13 + }, + "name": { + "type": "string", + "id": 1 + }, + "annotationSpecId": { + "type": "string", + "id": 2 + }, + "displayName": { + "type": "string", + "id": 15 + }, + "createTime": { + "type": "google.protobuf.Timestamp", + "id": 5 + }, + "evaluatedExampleCount": { + "type": "int32", + "id": 6 + } + } + }, + "OperationMetadata": { + "oneofs": { + "details": { + "oneof": [ + "deleteDetails", + "deployModelDetails", + "undeployModelDetails", + "createModelDetails", + "importDataDetails", + "batchPredictDetails", + "exportDataDetails", + "exportModelDetails", + "exportEvaluatedExamplesDetails" + ] + } + }, + "fields": { + "deleteDetails": { + "type": "DeleteOperationMetadata", + "id": 8 + }, + "deployModelDetails": { + "type": "DeployModelOperationMetadata", + "id": 24 + }, + "undeployModelDetails": { + "type": "UndeployModelOperationMetadata", + "id": 25 + }, + "createModelDetails": { + "type": "CreateModelOperationMetadata", + "id": 10 + }, + "importDataDetails": { + "type": "ImportDataOperationMetadata", + "id": 15 + }, + "batchPredictDetails": { + "type": "BatchPredictOperationMetadata", + "id": 16 + }, + "exportDataDetails": { + "type": "ExportDataOperationMetadata", + "id": 21 + }, + "exportModelDetails": { + "type": "ExportModelOperationMetadata", + "id": 22 + }, + "exportEvaluatedExamplesDetails": { + "type": "ExportEvaluatedExamplesOperationMetadata", + "id": 26 + }, + "progressPercent": { + "type": "int32", + "id": 13 + }, + "partialFailures": { + "rule": "repeated", + "type": "google.rpc.Status", + "id": 2 + }, + "createTime": { + "type": "google.protobuf.Timestamp", + "id": 3 + }, + "updateTime": { + "type": "google.protobuf.Timestamp", + "id": 4 + } + } + }, + "DeleteOperationMetadata": { + "fields": {} + }, + "DeployModelOperationMetadata": { + "fields": {} + }, + "UndeployModelOperationMetadata": { + "fields": {} + }, + "CreateModelOperationMetadata": { + "fields": {} + }, + "ImportDataOperationMetadata": { + "fields": {} + }, + "ExportDataOperationMetadata": { + "fields": { + "outputInfo": { + "type": "ExportDataOutputInfo", + "id": 1 + } + }, + "nested": { + "ExportDataOutputInfo": { + "oneofs": { + "outputLocation": { + "oneof": [ + "gcsOutputDirectory", + "bigqueryOutputDataset" + ] + } + }, + "fields": { + "gcsOutputDirectory": { + "type": "string", + "id": 1 + }, + "bigqueryOutputDataset": { + "type": "string", + "id": 2 + } + } + } + } + }, + "BatchPredictOperationMetadata": { + "fields": { + "inputConfig": { + "type": "BatchPredictInputConfig", + "id": 1 + }, + "outputInfo": { + "type": "BatchPredictOutputInfo", + "id": 2 + } + }, + "nested": { + "BatchPredictOutputInfo": { + "oneofs": { + "outputLocation": { + "oneof": [ + "gcsOutputDirectory", + "bigqueryOutputDataset" + ] + } + }, + "fields": { + "gcsOutputDirectory": { + "type": "string", + "id": 1 + }, + "bigqueryOutputDataset": { + "type": "string", + "id": 2 + } + } + } + } + }, + "ExportModelOperationMetadata": { + "fields": { + "outputInfo": { + "type": "ExportModelOutputInfo", + "id": 2 + } + }, + "nested": { + "ExportModelOutputInfo": { + "fields": { + "gcsOutputDirectory": { + "type": "string", + "id": 1 + } + } + } + } + }, + "ExportEvaluatedExamplesOperationMetadata": { + "fields": { + "outputInfo": { + "type": "ExportEvaluatedExamplesOutputInfo", + "id": 2 + } + }, + "nested": { + "ExportEvaluatedExamplesOutputInfo": { + "fields": { + "bigqueryOutputDataset": { + "type": "string", + "id": 2 + } + } + } + } + }, + "PredictionService": { + "options": { + "(google.api.default_host)": "automl.googleapis.com", + "(google.api.oauth_scopes)": "https://www.googleapis.com/auth/cloud-platform" + }, + "methods": { + "Predict": { + "requestType": "PredictRequest", + "responseType": "PredictResponse", + "options": { + "(google.api.http).post": "/v1beta1/{name=projects/*/locations/*/models/*}:predict", + "(google.api.http).body": "*", + "(google.api.method_signature)": "name,payload,params" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1beta1/{name=projects/*/locations/*/models/*}:predict", + "body": "*" + } + }, + { + "(google.api.method_signature)": "name,payload,params" + } + ] + }, + "BatchPredict": { + "requestType": "BatchPredictRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).post": "/v1beta1/{name=projects/*/locations/*/models/*}:batchPredict", + "(google.api.http).body": "*", + "(google.api.method_signature)": "name,input_config,output_config,params", + "(google.longrunning.operation_info).response_type": "BatchPredictResult", + "(google.longrunning.operation_info).metadata_type": "OperationMetadata" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1beta1/{name=projects/*/locations/*/models/*}:batchPredict", + "body": "*" + } + }, + { + "(google.api.method_signature)": "name,input_config,output_config,params" + }, + { + "(google.longrunning.operation_info)": { + "response_type": "BatchPredictResult", + "metadata_type": "OperationMetadata" + } + } + ] + } + } + }, + "PredictRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "automl.googleapis.com/Model" + } + }, + "payload": { + "type": "ExamplePayload", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "params": { + "keyType": "string", + "type": "string", + "id": 3 + } + } + }, + "PredictResponse": { + "fields": { + "payload": { + "rule": "repeated", + "type": "AnnotationPayload", + "id": 1 + }, + "preprocessedInput": { + "type": "ExamplePayload", + "id": 3 + }, + "metadata": { + "keyType": "string", + "type": "string", + "id": 2 + } + } + }, + "BatchPredictRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "automl.googleapis.com/Model" + } + }, + "inputConfig": { + "type": "BatchPredictInputConfig", + "id": 3, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "outputConfig": { + "type": "BatchPredictOutputConfig", + "id": 4, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "params": { + "keyType": "string", + "type": "string", + "id": 5, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "BatchPredictResult": { + "fields": { + "metadata": { + "keyType": "string", + "type": "string", + "id": 1 + } + } + }, + "AutoMl": { + "options": { + "(google.api.default_host)": "automl.googleapis.com", + "(google.api.oauth_scopes)": "https://www.googleapis.com/auth/cloud-platform" + }, + "methods": { + "CreateDataset": { + "requestType": "CreateDatasetRequest", + "responseType": "Dataset", + "options": { + "(google.api.http).post": "/v1beta1/{parent=projects/*/locations/*}/datasets", + "(google.api.http).body": "dataset", + "(google.api.method_signature)": "parent,dataset" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1beta1/{parent=projects/*/locations/*}/datasets", + "body": "dataset" + } + }, + { + "(google.api.method_signature)": "parent,dataset" + } + ] + }, + "GetDataset": { + "requestType": "GetDatasetRequest", + "responseType": "Dataset", + "options": { + "(google.api.http).get": "/v1beta1/{name=projects/*/locations/*/datasets/*}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1beta1/{name=projects/*/locations/*/datasets/*}" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "ListDatasets": { + "requestType": "ListDatasetsRequest", + "responseType": "ListDatasetsResponse", + "options": { + "(google.api.http).get": "/v1beta1/{parent=projects/*/locations/*}/datasets", + "(google.api.method_signature)": "parent" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1beta1/{parent=projects/*/locations/*}/datasets" + } + }, + { + "(google.api.method_signature)": "parent" + } + ] + }, + "UpdateDataset": { + "requestType": "UpdateDatasetRequest", + "responseType": "Dataset", + "options": { + "(google.api.http).patch": "/v1beta1/{dataset.name=projects/*/locations/*/datasets/*}", + "(google.api.http).body": "dataset", + "(google.api.method_signature)": "dataset" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "patch": "/v1beta1/{dataset.name=projects/*/locations/*/datasets/*}", + "body": "dataset" + } + }, + { + "(google.api.method_signature)": "dataset" + } + ] + }, + "DeleteDataset": { + "requestType": "DeleteDatasetRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).delete": "/v1beta1/{name=projects/*/locations/*/datasets/*}", + "(google.api.method_signature)": "name", + "(google.longrunning.operation_info).response_type": "google.protobuf.Empty", + "(google.longrunning.operation_info).metadata_type": "OperationMetadata" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "delete": "/v1beta1/{name=projects/*/locations/*/datasets/*}" + } + }, + { + "(google.api.method_signature)": "name" + }, + { + "(google.longrunning.operation_info)": { + "response_type": "google.protobuf.Empty", + "metadata_type": "OperationMetadata" + } + } + ] + }, + "ImportData": { + "requestType": "ImportDataRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).post": "/v1beta1/{name=projects/*/locations/*/datasets/*}:importData", + "(google.api.http).body": "*", + "(google.api.method_signature)": "name,input_config", + "(google.longrunning.operation_info).response_type": "google.protobuf.Empty", + "(google.longrunning.operation_info).metadata_type": "OperationMetadata" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1beta1/{name=projects/*/locations/*/datasets/*}:importData", + "body": "*" + } + }, + { + "(google.api.method_signature)": "name,input_config" + }, + { + "(google.longrunning.operation_info)": { + "response_type": "google.protobuf.Empty", + "metadata_type": "OperationMetadata" + } + } + ] + }, + "ExportData": { + "requestType": "ExportDataRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).post": "/v1beta1/{name=projects/*/locations/*/datasets/*}:exportData", + "(google.api.http).body": "*", + "(google.api.method_signature)": "name,output_config", + "(google.longrunning.operation_info).response_type": "google.protobuf.Empty", + "(google.longrunning.operation_info).metadata_type": "OperationMetadata" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1beta1/{name=projects/*/locations/*/datasets/*}:exportData", + "body": "*" + } + }, + { + "(google.api.method_signature)": "name,output_config" + }, + { + "(google.longrunning.operation_info)": { + "response_type": "google.protobuf.Empty", + "metadata_type": "OperationMetadata" + } + } + ] + }, + "GetAnnotationSpec": { + "requestType": "GetAnnotationSpecRequest", + "responseType": "AnnotationSpec", + "options": { + "(google.api.http).get": "/v1beta1/{name=projects/*/locations/*/datasets/*/annotationSpecs/*}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1beta1/{name=projects/*/locations/*/datasets/*/annotationSpecs/*}" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "GetTableSpec": { + "requestType": "GetTableSpecRequest", + "responseType": "TableSpec", + "options": { + "(google.api.http).get": "/v1beta1/{name=projects/*/locations/*/datasets/*/tableSpecs/*}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1beta1/{name=projects/*/locations/*/datasets/*/tableSpecs/*}" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "ListTableSpecs": { + "requestType": "ListTableSpecsRequest", + "responseType": "ListTableSpecsResponse", + "options": { + "(google.api.http).get": "/v1beta1/{parent=projects/*/locations/*/datasets/*}/tableSpecs", + "(google.api.method_signature)": "parent" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1beta1/{parent=projects/*/locations/*/datasets/*}/tableSpecs" + } + }, + { + "(google.api.method_signature)": "parent" + } + ] + }, + "UpdateTableSpec": { + "requestType": "UpdateTableSpecRequest", + "responseType": "TableSpec", + "options": { + "(google.api.http).patch": "/v1beta1/{table_spec.name=projects/*/locations/*/datasets/*/tableSpecs/*}", + "(google.api.http).body": "table_spec", + "(google.api.method_signature)": "table_spec" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "patch": "/v1beta1/{table_spec.name=projects/*/locations/*/datasets/*/tableSpecs/*}", + "body": "table_spec" + } + }, + { + "(google.api.method_signature)": "table_spec" + } + ] + }, + "GetColumnSpec": { + "requestType": "GetColumnSpecRequest", + "responseType": "ColumnSpec", + "options": { + "(google.api.http).get": "/v1beta1/{name=projects/*/locations/*/datasets/*/tableSpecs/*/columnSpecs/*}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1beta1/{name=projects/*/locations/*/datasets/*/tableSpecs/*/columnSpecs/*}" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "ListColumnSpecs": { + "requestType": "ListColumnSpecsRequest", + "responseType": "ListColumnSpecsResponse", + "options": { + "(google.api.http).get": "/v1beta1/{parent=projects/*/locations/*/datasets/*/tableSpecs/*}/columnSpecs", + "(google.api.method_signature)": "parent" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1beta1/{parent=projects/*/locations/*/datasets/*/tableSpecs/*}/columnSpecs" + } + }, + { + "(google.api.method_signature)": "parent" + } + ] + }, + "UpdateColumnSpec": { + "requestType": "UpdateColumnSpecRequest", + "responseType": "ColumnSpec", + "options": { + "(google.api.http).patch": "/v1beta1/{column_spec.name=projects/*/locations/*/datasets/*/tableSpecs/*/columnSpecs/*}", + "(google.api.http).body": "column_spec", + "(google.api.method_signature)": "column_spec" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "patch": "/v1beta1/{column_spec.name=projects/*/locations/*/datasets/*/tableSpecs/*/columnSpecs/*}", + "body": "column_spec" + } + }, + { + "(google.api.method_signature)": "column_spec" + } + ] + }, + "CreateModel": { + "requestType": "CreateModelRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).post": "/v1beta1/{parent=projects/*/locations/*}/models", + "(google.api.http).body": "model", + "(google.api.method_signature)": "parent,model", + "(google.longrunning.operation_info).response_type": "Model", + "(google.longrunning.operation_info).metadata_type": "OperationMetadata" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1beta1/{parent=projects/*/locations/*}/models", + "body": "model" + } + }, + { + "(google.api.method_signature)": "parent,model" + }, + { + "(google.longrunning.operation_info)": { + "response_type": "Model", + "metadata_type": "OperationMetadata" + } + } + ] + }, + "GetModel": { + "requestType": "GetModelRequest", + "responseType": "Model", + "options": { + "(google.api.http).get": "/v1beta1/{name=projects/*/locations/*/models/*}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1beta1/{name=projects/*/locations/*/models/*}" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "ListModels": { + "requestType": "ListModelsRequest", + "responseType": "ListModelsResponse", + "options": { + "(google.api.http).get": "/v1beta1/{parent=projects/*/locations/*}/models", + "(google.api.method_signature)": "parent" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1beta1/{parent=projects/*/locations/*}/models" + } + }, + { + "(google.api.method_signature)": "parent" + } + ] + }, + "DeleteModel": { + "requestType": "DeleteModelRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).delete": "/v1beta1/{name=projects/*/locations/*/models/*}", + "(google.api.method_signature)": "name", + "(google.longrunning.operation_info).response_type": "google.protobuf.Empty", + "(google.longrunning.operation_info).metadata_type": "OperationMetadata" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "delete": "/v1beta1/{name=projects/*/locations/*/models/*}" + } + }, + { + "(google.api.method_signature)": "name" + }, + { + "(google.longrunning.operation_info)": { + "response_type": "google.protobuf.Empty", + "metadata_type": "OperationMetadata" + } + } + ] + }, + "DeployModel": { + "requestType": "DeployModelRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).post": "/v1beta1/{name=projects/*/locations/*/models/*}:deploy", + "(google.api.http).body": "*", + "(google.api.method_signature)": "name", + "(google.longrunning.operation_info).response_type": "google.protobuf.Empty", + "(google.longrunning.operation_info).metadata_type": "OperationMetadata" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1beta1/{name=projects/*/locations/*/models/*}:deploy", + "body": "*" + } + }, + { + "(google.api.method_signature)": "name" + }, + { + "(google.longrunning.operation_info)": { + "response_type": "google.protobuf.Empty", + "metadata_type": "OperationMetadata" + } + } + ] + }, + "UndeployModel": { + "requestType": "UndeployModelRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).post": "/v1beta1/{name=projects/*/locations/*/models/*}:undeploy", + "(google.api.http).body": "*", + "(google.api.method_signature)": "name", + "(google.longrunning.operation_info).response_type": "google.protobuf.Empty", + "(google.longrunning.operation_info).metadata_type": "OperationMetadata" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1beta1/{name=projects/*/locations/*/models/*}:undeploy", + "body": "*" + } + }, + { + "(google.api.method_signature)": "name" + }, + { + "(google.longrunning.operation_info)": { + "response_type": "google.protobuf.Empty", + "metadata_type": "OperationMetadata" + } + } + ] + }, + "ExportModel": { + "requestType": "ExportModelRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).post": "/v1beta1/{name=projects/*/locations/*/models/*}:export", + "(google.api.http).body": "*", + "(google.api.method_signature)": "name,output_config", + "(google.longrunning.operation_info).response_type": "google.protobuf.Empty", + "(google.longrunning.operation_info).metadata_type": "OperationMetadata" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1beta1/{name=projects/*/locations/*/models/*}:export", + "body": "*" + } + }, + { + "(google.api.method_signature)": "name,output_config" + }, + { + "(google.longrunning.operation_info)": { + "response_type": "google.protobuf.Empty", + "metadata_type": "OperationMetadata" + } + } + ] + }, + "ExportEvaluatedExamples": { + "requestType": "ExportEvaluatedExamplesRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).post": "/v1beta1/{name=projects/*/locations/*/models/*}:exportEvaluatedExamples", + "(google.api.http).body": "*", + "(google.api.method_signature)": "name,output_config", + "(google.longrunning.operation_info).response_type": "google.protobuf.Empty", + "(google.longrunning.operation_info).metadata_type": "OperationMetadata" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1beta1/{name=projects/*/locations/*/models/*}:exportEvaluatedExamples", + "body": "*" + } + }, + { + "(google.api.method_signature)": "name,output_config" + }, + { + "(google.longrunning.operation_info)": { + "response_type": "google.protobuf.Empty", + "metadata_type": "OperationMetadata" + } + } + ] + }, + "GetModelEvaluation": { + "requestType": "GetModelEvaluationRequest", + "responseType": "ModelEvaluation", + "options": { + "(google.api.http).get": "/v1beta1/{name=projects/*/locations/*/models/*/modelEvaluations/*}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1beta1/{name=projects/*/locations/*/models/*/modelEvaluations/*}" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "ListModelEvaluations": { + "requestType": "ListModelEvaluationsRequest", + "responseType": "ListModelEvaluationsResponse", + "options": { + "(google.api.http).get": "/v1beta1/{parent=projects/*/locations/*/models/*}/modelEvaluations", + "(google.api.method_signature)": "parent" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1beta1/{parent=projects/*/locations/*/models/*}/modelEvaluations" + } + }, + { + "(google.api.method_signature)": "parent" + } + ] + } + } + }, + "CreateDatasetRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "locations.googleapis.com/Location" + } + }, + "dataset": { + "type": "Dataset", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "GetDatasetRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "automl.googleapis.com/Dataset" + } + } + } + }, + "ListDatasetsRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "locations.googleapis.com/Location" + } + }, + "filter": { + "type": "string", + "id": 3 + }, + "pageSize": { + "type": "int32", + "id": 4 + }, + "pageToken": { + "type": "string", + "id": 6 + } + } + }, + "ListDatasetsResponse": { + "fields": { + "datasets": { + "rule": "repeated", + "type": "Dataset", + "id": 1 + }, + "nextPageToken": { + "type": "string", + "id": 2 + } + } + }, + "UpdateDatasetRequest": { + "fields": { + "dataset": { + "type": "Dataset", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "updateMask": { + "type": "google.protobuf.FieldMask", + "id": 2 + } + } + }, + "DeleteDatasetRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "automl.googleapis.com/Dataset" + } + } + } + }, + "ImportDataRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "automl.googleapis.com/Dataset" + } + }, + "inputConfig": { + "type": "InputConfig", + "id": 3, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "ExportDataRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "automl.googleapis.com/Dataset" + } + }, + "outputConfig": { + "type": "OutputConfig", + "id": 3, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "GetAnnotationSpecRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "automl.googleapis.com/AnnotationSpec" + } + } + } + }, + "GetTableSpecRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "automl.googleapis.com/TableSpec" + } + }, + "fieldMask": { + "type": "google.protobuf.FieldMask", + "id": 2 + } + } + }, + "ListTableSpecsRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "automl.googleapis.com/Dataset" + } + }, + "fieldMask": { + "type": "google.protobuf.FieldMask", + "id": 2 + }, + "filter": { + "type": "string", + "id": 3 + }, + "pageSize": { + "type": "int32", + "id": 4 + }, + "pageToken": { + "type": "string", + "id": 6 + } + } + }, + "ListTableSpecsResponse": { + "fields": { + "tableSpecs": { + "rule": "repeated", + "type": "TableSpec", + "id": 1 + }, + "nextPageToken": { + "type": "string", + "id": 2 + } + } + }, + "UpdateTableSpecRequest": { + "fields": { + "tableSpec": { + "type": "TableSpec", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "updateMask": { + "type": "google.protobuf.FieldMask", + "id": 2 + } + } + }, + "GetColumnSpecRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "automl.googleapis.com/ColumnSpec" + } + }, + "fieldMask": { + "type": "google.protobuf.FieldMask", + "id": 2 + } + } + }, + "ListColumnSpecsRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "automl.googleapis.com/TableSpec" + } + }, + "fieldMask": { + "type": "google.protobuf.FieldMask", + "id": 2 + }, + "filter": { + "type": "string", + "id": 3 + }, + "pageSize": { + "type": "int32", + "id": 4 + }, + "pageToken": { + "type": "string", + "id": 6 + } + } + }, + "ListColumnSpecsResponse": { + "fields": { + "columnSpecs": { + "rule": "repeated", + "type": "ColumnSpec", + "id": 1 + }, + "nextPageToken": { + "type": "string", + "id": 2 + } + } + }, + "UpdateColumnSpecRequest": { + "fields": { + "columnSpec": { + "type": "ColumnSpec", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "updateMask": { + "type": "google.protobuf.FieldMask", + "id": 2 + } + } + }, + "CreateModelRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "locations.googleapis.com/Location" + } + }, + "model": { + "type": "Model", + "id": 4, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "GetModelRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "automl.googleapis.com/Model" + } + } + } + }, + "ListModelsRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "locations.googleapis.com/Location" + } + }, + "filter": { + "type": "string", + "id": 3 + }, + "pageSize": { + "type": "int32", + "id": 4 + }, + "pageToken": { + "type": "string", + "id": 6 + } + } + }, + "ListModelsResponse": { + "fields": { + "model": { + "rule": "repeated", + "type": "Model", + "id": 1 + }, + "nextPageToken": { + "type": "string", + "id": 2 + } + } + }, + "DeleteModelRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "automl.googleapis.com/Model" + } + } + } + }, + "DeployModelRequest": { + "oneofs": { + "modelDeploymentMetadata": { + "oneof": [ + "imageObjectDetectionModelDeploymentMetadata", + "imageClassificationModelDeploymentMetadata" + ] + } + }, + "fields": { + "imageObjectDetectionModelDeploymentMetadata": { + "type": "ImageObjectDetectionModelDeploymentMetadata", + "id": 2 + }, + "imageClassificationModelDeploymentMetadata": { + "type": "ImageClassificationModelDeploymentMetadata", + "id": 4 + }, + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "automl.googleapis.com/Model" + } + } + } + }, + "UndeployModelRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "automl.googleapis.com/Model" + } + } + } + }, + "ExportModelRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "automl.googleapis.com/Model" + } + }, + "outputConfig": { + "type": "ModelExportOutputConfig", + "id": 3, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "ExportEvaluatedExamplesRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "automl.googleapis.com/Model" + } + }, + "outputConfig": { + "type": "ExportEvaluatedExamplesOutputConfig", + "id": 3, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "GetModelEvaluationRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "automl.googleapis.com/ModelEvaluation" + } + } + } + }, + "ListModelEvaluationsRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "automl.googleapis.com/Model" + } + }, + "filter": { + "type": "string", + "id": 3 + }, + "pageSize": { + "type": "int32", + "id": 4 + }, + "pageToken": { + "type": "string", + "id": 6 + } + } + }, + "ListModelEvaluationsResponse": { + "fields": { + "modelEvaluation": { + "rule": "repeated", + "type": "ModelEvaluation", + "id": 1 + }, + "nextPageToken": { + "type": "string", + "id": 2 + } + } + }, + "TableSpec": { + "options": { + "(google.api.resource).type": "automl.googleapis.com/TableSpec", + "(google.api.resource).pattern": "projects/{project}/locations/{location}/datasets/{dataset}/tableSpecs/{table_spec}" + }, + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "timeColumnSpecId": { + "type": "string", + "id": 2 + }, + "rowCount": { + "type": "int64", + "id": 3 + }, + "validRowCount": { + "type": "int64", + "id": 4 + }, + "columnCount": { + "type": "int64", + "id": 7 + }, + "inputConfigs": { + "rule": "repeated", + "type": "InputConfig", + "id": 5 + }, + "etag": { + "type": "string", + "id": 6 + } + } + } + } + } + } + } + } + }, + "api": { + "options": { + "go_package": "google.golang.org/genproto/googleapis/api;api", + "java_multiple_files": true, + "java_outer_classname": "LaunchStageProto", + "java_package": "com.google.api", + "objc_class_prefix": "GAPI", + "cc_enable_arenas": true + }, + "nested": { + "fieldBehavior": { + "rule": "repeated", + "type": "google.api.FieldBehavior", + "id": 1052, + "extend": "google.protobuf.FieldOptions" + }, + "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 + } + }, + "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 + } + } + }, + "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" + }, + "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 + } + } + }, + "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 + } + } + }, + "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 + } + }, + "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 + } + }, + "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 + } + } + } + }, + "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": { + "fields": { + "file": { + "rule": "repeated", + "type": "FileDescriptorProto", + "id": 1 + } + } + }, + "FileDescriptorProto": { + "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, + "options": { + "packed": false + } + }, + "weakDependency": { + "rule": "repeated", + "type": "int32", + "id": 11, + "options": { + "packed": false + } + }, + "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": "string", + "id": 13 + } + } + }, + "DescriptorProto": { + "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": { + "fields": { + "uninterpretedOption": { + "rule": "repeated", + "type": "UninterpretedOption", + "id": 999 + } + }, + "extensions": [ + [ + 1000, + 536870911 + ] + ] + }, + "FieldDescriptorProto": { + "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_REQUIRED": 2, + "LABEL_REPEATED": 3 + } + } + } + }, + "OneofDescriptorProto": { + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "options": { + "type": "OneofOptions", + "id": 2 + } + } + }, + "EnumDescriptorProto": { + "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": { + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "number": { + "type": "int32", + "id": 2 + }, + "options": { + "type": "EnumValueOptions", + "id": 3 + } + } + }, + "ServiceDescriptorProto": { + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "method": { + "rule": "repeated", + "type": "MethodDescriptorProto", + "id": 2 + }, + "options": { + "type": "ServiceOptions", + "id": 3 + } + } + }, + "MethodDescriptorProto": { + "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": { + "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 + } + }, + "phpGenericServices": { + "type": "bool", + "id": 42, + "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 + }, + "uninterpretedOption": { + "rule": "repeated", + "type": "UninterpretedOption", + "id": 999 + } + }, + "extensions": [ + [ + 1000, + 536870911 + ] + ], + "reserved": [ + [ + 38, + 38 + ] + ], + "nested": { + "OptimizeMode": { + "values": { + "SPEED": 1, + "CODE_SIZE": 2, + "LITE_RUNTIME": 3 + } + } + } + }, + "MessageOptions": { + "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 + } + }, + "uninterpretedOption": { + "rule": "repeated", + "type": "UninterpretedOption", + "id": 999 + } + }, + "extensions": [ + [ + 1000, + 536870911 + ] + ], + "reserved": [ + [ + 4, + 4 + ], + [ + 5, + 5 + ], + [ + 6, + 6 + ], + [ + 8, + 8 + ], + [ + 9, + 9 + ] + ] + }, + "FieldOptions": { + "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 + }, + "target": { + "type": "OptionTargetType", + "id": 18 + }, + "uninterpretedOption": { + "rule": "repeated", + "type": "UninterpretedOption", + "id": 999 + } + }, + "extensions": [ + [ + 1000, + 536870911 + ] + ], + "reserved": [ + [ + 4, + 4 + ] + ], + "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 + } + } + } + }, + "OneofOptions": { + "fields": { + "uninterpretedOption": { + "rule": "repeated", + "type": "UninterpretedOption", + "id": 999 + } + }, + "extensions": [ + [ + 1000, + 536870911 + ] + ] + }, + "EnumOptions": { + "fields": { + "allowAlias": { + "type": "bool", + "id": 2 + }, + "deprecated": { + "type": "bool", + "id": 3, + "options": { + "default": false + } + }, + "deprecatedLegacyJsonFieldConflicts": { + "type": "bool", + "id": 6, + "options": { + "deprecated": true + } + }, + "uninterpretedOption": { + "rule": "repeated", + "type": "UninterpretedOption", + "id": 999 + } + }, + "extensions": [ + [ + 1000, + 536870911 + ] + ], + "reserved": [ + [ + 5, + 5 + ] + ] + }, + "EnumValueOptions": { + "fields": { + "deprecated": { + "type": "bool", + "id": 1, + "options": { + "default": false + } + }, + "uninterpretedOption": { + "rule": "repeated", + "type": "UninterpretedOption", + "id": 999 + } + }, + "extensions": [ + [ + 1000, + 536870911 + ] + ] + }, + "ServiceOptions": { + "fields": { + "deprecated": { + "type": "bool", + "id": 33, + "options": { + "default": false + } + }, + "uninterpretedOption": { + "rule": "repeated", + "type": "UninterpretedOption", + "id": 999 + } + }, + "extensions": [ + [ + 1000, + 536870911 + ] + ] + }, + "MethodOptions": { + "fields": { + "deprecated": { + "type": "bool", + "id": 33, + "options": { + "default": false + } + }, + "idempotencyLevel": { + "type": "IdempotencyLevel", + "id": 34, + "options": { + "default": "IDEMPOTENCY_UNKNOWN" + } + }, + "uninterpretedOption": { + "rule": "repeated", + "type": "UninterpretedOption", + "id": 999 + } + }, + "extensions": [ + [ + 1000, + 536870911 + ] + ], + "nested": { + "IdempotencyLevel": { + "values": { + "IDEMPOTENCY_UNKNOWN": 0, + "NO_SIDE_EFFECTS": 1, + "IDEMPOTENT": 2 + } + } + } + }, + "UninterpretedOption": { + "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 + } + } + } + } + }, + "SourceCodeInfo": { + "fields": { + "location": { + "rule": "repeated", + "type": "Location", + "id": 1 + } + }, + "nested": { + "Location": { + "fields": { + "path": { + "rule": "repeated", + "type": "int32", + "id": 1 + }, + "span": { + "rule": "repeated", + "type": "int32", + "id": 2 + }, + "leadingComments": { + "type": "string", + "id": 3 + }, + "trailingComments": { + "type": "string", + "id": 4 + }, + "leadingDetachedComments": { + "rule": "repeated", + "type": "string", + "id": 6 + } + } + } + } + }, + "GeneratedCodeInfo": { + "fields": { + "annotation": { + "rule": "repeated", + "type": "Annotation", + "id": 1 + } + }, + "nested": { + "Annotation": { + "fields": { + "path": { + "rule": "repeated", + "type": "int32", + "id": 1 + }, + "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 + } + } + } + } + } + }, + "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 + } + } + }, + "Duration": { + "fields": { + "seconds": { + "type": "int64", + "id": 1 + }, + "nanos": { + "type": "int32", + "id": 2 + } + } + }, + "Empty": { + "fields": {} + }, + "FieldMask": { + "fields": { + "paths": { + "rule": "repeated", + "type": "string", + "id": 1 + } + } + }, + "Struct": { + "fields": { + "fields": { + "keyType": "string", + "type": "Value", + "id": 1 + } + } + }, + "Value": { + "oneofs": { + "kind": { + "oneof": [ + "nullValue", + "numberValue", + "stringValue", + "boolValue", + "structValue", + "listValue" + ] + } + }, + "fields": { + "nullValue": { + "type": "NullValue", + "id": 1 + }, + "numberValue": { + "type": "double", + "id": 2 + }, + "stringValue": { + "type": "string", + "id": 3 + }, + "boolValue": { + "type": "bool", + "id": 4 + }, + "structValue": { + "type": "Struct", + "id": 5 + }, + "listValue": { + "type": "ListValue", + "id": 6 + } + } + }, + "NullValue": { + "values": { + "NULL_VALUE": 0 + } + }, + "ListValue": { + "fields": { + "values": { + "rule": "repeated", + "type": "Value", + "id": 1 + } + } + } + } + }, + "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 + } + } + } + } + }, + "longrunning": { + "options": { + "cc_enable_arenas": true, + "csharp_namespace": "Google.LongRunning", + "go_package": "google.golang.org/genproto/googleapis/longrunning;longrunning", + "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 + } + } + } + } + } + } + } + } +} \ No newline at end of file diff --git a/packages/google-cloud-automl/samples/.eslintrc.yml b/packages/google-cloud-automl/samples/.eslintrc.yml new file mode 100644 index 00000000000..282535f55f6 --- /dev/null +++ b/packages/google-cloud-automl/samples/.eslintrc.yml @@ -0,0 +1,3 @@ +--- +rules: + no-console: off diff --git a/packages/google-cloud-automl/samples/README.md b/packages/google-cloud-automl/samples/README.md new file mode 100644 index 00000000000..461b945d23a --- /dev/null +++ b/packages/google-cloud-automl/samples/README.md @@ -0,0 +1,878 @@ +[//]: # "This README.md file is auto-generated, all changes to this file will be lost." +[//]: # "To regenerate it, use `python -m synthtool`." +Google Cloud Platform logo + +# [Cloud AutoML: Node.js Samples](https://github.com/googleapis/google-cloud-node) + +[![Open in Cloud Shell][shell_img]][shell_link] + + + +## Table of Contents + +* [Before you begin](#before-you-begin) +* [Samples](#samples) + * [Auto_ml.create_dataset](#auto_ml.create_dataset) + * [Auto_ml.create_model](#auto_ml.create_model) + * [Auto_ml.delete_dataset](#auto_ml.delete_dataset) + * [Auto_ml.delete_model](#auto_ml.delete_model) + * [Auto_ml.deploy_model](#auto_ml.deploy_model) + * [Auto_ml.export_data](#auto_ml.export_data) + * [Auto_ml.export_model](#auto_ml.export_model) + * [Auto_ml.get_annotation_spec](#auto_ml.get_annotation_spec) + * [Auto_ml.get_dataset](#auto_ml.get_dataset) + * [Auto_ml.get_model](#auto_ml.get_model) + * [Auto_ml.get_model_evaluation](#auto_ml.get_model_evaluation) + * [Auto_ml.import_data](#auto_ml.import_data) + * [Auto_ml.list_datasets](#auto_ml.list_datasets) + * [Auto_ml.list_model_evaluations](#auto_ml.list_model_evaluations) + * [Auto_ml.list_models](#auto_ml.list_models) + * [Auto_ml.undeploy_model](#auto_ml.undeploy_model) + * [Auto_ml.update_dataset](#auto_ml.update_dataset) + * [Auto_ml.update_model](#auto_ml.update_model) + * [Prediction_service.batch_predict](#prediction_service.batch_predict) + * [Prediction_service.predict](#prediction_service.predict) + * [Auto_ml.create_dataset](#auto_ml.create_dataset) + * [Auto_ml.create_model](#auto_ml.create_model) + * [Auto_ml.delete_dataset](#auto_ml.delete_dataset) + * [Auto_ml.delete_model](#auto_ml.delete_model) + * [Auto_ml.deploy_model](#auto_ml.deploy_model) + * [Auto_ml.export_data](#auto_ml.export_data) + * [Auto_ml.export_evaluated_examples](#auto_ml.export_evaluated_examples) + * [Auto_ml.export_model](#auto_ml.export_model) + * [Auto_ml.get_annotation_spec](#auto_ml.get_annotation_spec) + * [Auto_ml.get_column_spec](#auto_ml.get_column_spec) + * [Auto_ml.get_dataset](#auto_ml.get_dataset) + * [Auto_ml.get_model](#auto_ml.get_model) + * [Auto_ml.get_model_evaluation](#auto_ml.get_model_evaluation) + * [Auto_ml.get_table_spec](#auto_ml.get_table_spec) + * [Auto_ml.import_data](#auto_ml.import_data) + * [Auto_ml.list_column_specs](#auto_ml.list_column_specs) + * [Auto_ml.list_datasets](#auto_ml.list_datasets) + * [Auto_ml.list_model_evaluations](#auto_ml.list_model_evaluations) + * [Auto_ml.list_models](#auto_ml.list_models) + * [Auto_ml.list_table_specs](#auto_ml.list_table_specs) + * [Auto_ml.undeploy_model](#auto_ml.undeploy_model) + * [Auto_ml.update_column_spec](#auto_ml.update_column_spec) + * [Auto_ml.update_dataset](#auto_ml.update_dataset) + * [Auto_ml.update_table_spec](#auto_ml.update_table_spec) + * [Prediction_service.batch_predict](#prediction_service.batch_predict) + * [Prediction_service.predict](#prediction_service.predict) + * [Quickstart](#quickstart) + +## Before you begin + +Before running the samples, make sure you've followed the steps outlined in +[Using the client library](https://github.com/googleapis/google-cloud-node#using-the-client-library). + +`cd samples` + +`npm install` + +`cd ..` + +## Samples + + + +### Auto_ml.create_dataset + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-automl/samples/generated/v1/auto_ml.create_dataset.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-cloud-automl/samples/generated/v1/auto_ml.create_dataset.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-automl/samples/generated/v1/auto_ml.create_dataset.js` + + +----- + + + + +### Auto_ml.create_model + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-automl/samples/generated/v1/auto_ml.create_model.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-cloud-automl/samples/generated/v1/auto_ml.create_model.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-automl/samples/generated/v1/auto_ml.create_model.js` + + +----- + + + + +### Auto_ml.delete_dataset + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-automl/samples/generated/v1/auto_ml.delete_dataset.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-cloud-automl/samples/generated/v1/auto_ml.delete_dataset.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-automl/samples/generated/v1/auto_ml.delete_dataset.js` + + +----- + + + + +### Auto_ml.delete_model + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-automl/samples/generated/v1/auto_ml.delete_model.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-cloud-automl/samples/generated/v1/auto_ml.delete_model.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-automl/samples/generated/v1/auto_ml.delete_model.js` + + +----- + + + + +### Auto_ml.deploy_model + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-automl/samples/generated/v1/auto_ml.deploy_model.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-cloud-automl/samples/generated/v1/auto_ml.deploy_model.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-automl/samples/generated/v1/auto_ml.deploy_model.js` + + +----- + + + + +### Auto_ml.export_data + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-automl/samples/generated/v1/auto_ml.export_data.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-cloud-automl/samples/generated/v1/auto_ml.export_data.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-automl/samples/generated/v1/auto_ml.export_data.js` + + +----- + + + + +### Auto_ml.export_model + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-automl/samples/generated/v1/auto_ml.export_model.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-cloud-automl/samples/generated/v1/auto_ml.export_model.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-automl/samples/generated/v1/auto_ml.export_model.js` + + +----- + + + + +### Auto_ml.get_annotation_spec + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-automl/samples/generated/v1/auto_ml.get_annotation_spec.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-cloud-automl/samples/generated/v1/auto_ml.get_annotation_spec.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-automl/samples/generated/v1/auto_ml.get_annotation_spec.js` + + +----- + + + + +### Auto_ml.get_dataset + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-automl/samples/generated/v1/auto_ml.get_dataset.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-cloud-automl/samples/generated/v1/auto_ml.get_dataset.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-automl/samples/generated/v1/auto_ml.get_dataset.js` + + +----- + + + + +### Auto_ml.get_model + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-automl/samples/generated/v1/auto_ml.get_model.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-cloud-automl/samples/generated/v1/auto_ml.get_model.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-automl/samples/generated/v1/auto_ml.get_model.js` + + +----- + + + + +### Auto_ml.get_model_evaluation + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-automl/samples/generated/v1/auto_ml.get_model_evaluation.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-cloud-automl/samples/generated/v1/auto_ml.get_model_evaluation.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-automl/samples/generated/v1/auto_ml.get_model_evaluation.js` + + +----- + + + + +### Auto_ml.import_data + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-automl/samples/generated/v1/auto_ml.import_data.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-cloud-automl/samples/generated/v1/auto_ml.import_data.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-automl/samples/generated/v1/auto_ml.import_data.js` + + +----- + + + + +### Auto_ml.list_datasets + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-automl/samples/generated/v1/auto_ml.list_datasets.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-cloud-automl/samples/generated/v1/auto_ml.list_datasets.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-automl/samples/generated/v1/auto_ml.list_datasets.js` + + +----- + + + + +### Auto_ml.list_model_evaluations + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-automl/samples/generated/v1/auto_ml.list_model_evaluations.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-cloud-automl/samples/generated/v1/auto_ml.list_model_evaluations.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-automl/samples/generated/v1/auto_ml.list_model_evaluations.js` + + +----- + + + + +### Auto_ml.list_models + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-automl/samples/generated/v1/auto_ml.list_models.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-cloud-automl/samples/generated/v1/auto_ml.list_models.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-automl/samples/generated/v1/auto_ml.list_models.js` + + +----- + + + + +### Auto_ml.undeploy_model + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-automl/samples/generated/v1/auto_ml.undeploy_model.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-cloud-automl/samples/generated/v1/auto_ml.undeploy_model.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-automl/samples/generated/v1/auto_ml.undeploy_model.js` + + +----- + + + + +### Auto_ml.update_dataset + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-automl/samples/generated/v1/auto_ml.update_dataset.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-cloud-automl/samples/generated/v1/auto_ml.update_dataset.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-automl/samples/generated/v1/auto_ml.update_dataset.js` + + +----- + + + + +### Auto_ml.update_model + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-automl/samples/generated/v1/auto_ml.update_model.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-cloud-automl/samples/generated/v1/auto_ml.update_model.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-automl/samples/generated/v1/auto_ml.update_model.js` + + +----- + + + + +### Prediction_service.batch_predict + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-automl/samples/generated/v1/prediction_service.batch_predict.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-cloud-automl/samples/generated/v1/prediction_service.batch_predict.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-automl/samples/generated/v1/prediction_service.batch_predict.js` + + +----- + + + + +### Prediction_service.predict + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-automl/samples/generated/v1/prediction_service.predict.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-cloud-automl/samples/generated/v1/prediction_service.predict.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-automl/samples/generated/v1/prediction_service.predict.js` + + +----- + + + + +### Auto_ml.create_dataset + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-automl/samples/generated/v1beta1/auto_ml.create_dataset.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-cloud-automl/samples/generated/v1beta1/auto_ml.create_dataset.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-automl/samples/generated/v1beta1/auto_ml.create_dataset.js` + + +----- + + + + +### Auto_ml.create_model + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-automl/samples/generated/v1beta1/auto_ml.create_model.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-cloud-automl/samples/generated/v1beta1/auto_ml.create_model.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-automl/samples/generated/v1beta1/auto_ml.create_model.js` + + +----- + + + + +### Auto_ml.delete_dataset + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-automl/samples/generated/v1beta1/auto_ml.delete_dataset.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-cloud-automl/samples/generated/v1beta1/auto_ml.delete_dataset.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-automl/samples/generated/v1beta1/auto_ml.delete_dataset.js` + + +----- + + + + +### Auto_ml.delete_model + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-automl/samples/generated/v1beta1/auto_ml.delete_model.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-cloud-automl/samples/generated/v1beta1/auto_ml.delete_model.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-automl/samples/generated/v1beta1/auto_ml.delete_model.js` + + +----- + + + + +### Auto_ml.deploy_model + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-automl/samples/generated/v1beta1/auto_ml.deploy_model.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-cloud-automl/samples/generated/v1beta1/auto_ml.deploy_model.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-automl/samples/generated/v1beta1/auto_ml.deploy_model.js` + + +----- + + + + +### Auto_ml.export_data + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-automl/samples/generated/v1beta1/auto_ml.export_data.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-cloud-automl/samples/generated/v1beta1/auto_ml.export_data.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-automl/samples/generated/v1beta1/auto_ml.export_data.js` + + +----- + + + + +### Auto_ml.export_evaluated_examples + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-automl/samples/generated/v1beta1/auto_ml.export_evaluated_examples.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-cloud-automl/samples/generated/v1beta1/auto_ml.export_evaluated_examples.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-automl/samples/generated/v1beta1/auto_ml.export_evaluated_examples.js` + + +----- + + + + +### Auto_ml.export_model + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-automl/samples/generated/v1beta1/auto_ml.export_model.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-cloud-automl/samples/generated/v1beta1/auto_ml.export_model.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-automl/samples/generated/v1beta1/auto_ml.export_model.js` + + +----- + + + + +### Auto_ml.get_annotation_spec + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-automl/samples/generated/v1beta1/auto_ml.get_annotation_spec.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-cloud-automl/samples/generated/v1beta1/auto_ml.get_annotation_spec.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-automl/samples/generated/v1beta1/auto_ml.get_annotation_spec.js` + + +----- + + + + +### Auto_ml.get_column_spec + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-automl/samples/generated/v1beta1/auto_ml.get_column_spec.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-cloud-automl/samples/generated/v1beta1/auto_ml.get_column_spec.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-automl/samples/generated/v1beta1/auto_ml.get_column_spec.js` + + +----- + + + + +### Auto_ml.get_dataset + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-automl/samples/generated/v1beta1/auto_ml.get_dataset.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-cloud-automl/samples/generated/v1beta1/auto_ml.get_dataset.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-automl/samples/generated/v1beta1/auto_ml.get_dataset.js` + + +----- + + + + +### Auto_ml.get_model + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-automl/samples/generated/v1beta1/auto_ml.get_model.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-cloud-automl/samples/generated/v1beta1/auto_ml.get_model.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-automl/samples/generated/v1beta1/auto_ml.get_model.js` + + +----- + + + + +### Auto_ml.get_model_evaluation + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-automl/samples/generated/v1beta1/auto_ml.get_model_evaluation.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-cloud-automl/samples/generated/v1beta1/auto_ml.get_model_evaluation.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-automl/samples/generated/v1beta1/auto_ml.get_model_evaluation.js` + + +----- + + + + +### Auto_ml.get_table_spec + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-automl/samples/generated/v1beta1/auto_ml.get_table_spec.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-cloud-automl/samples/generated/v1beta1/auto_ml.get_table_spec.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-automl/samples/generated/v1beta1/auto_ml.get_table_spec.js` + + +----- + + + + +### Auto_ml.import_data + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-automl/samples/generated/v1beta1/auto_ml.import_data.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-cloud-automl/samples/generated/v1beta1/auto_ml.import_data.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-automl/samples/generated/v1beta1/auto_ml.import_data.js` + + +----- + + + + +### Auto_ml.list_column_specs + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-automl/samples/generated/v1beta1/auto_ml.list_column_specs.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-cloud-automl/samples/generated/v1beta1/auto_ml.list_column_specs.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-automl/samples/generated/v1beta1/auto_ml.list_column_specs.js` + + +----- + + + + +### Auto_ml.list_datasets + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-automl/samples/generated/v1beta1/auto_ml.list_datasets.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-cloud-automl/samples/generated/v1beta1/auto_ml.list_datasets.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-automl/samples/generated/v1beta1/auto_ml.list_datasets.js` + + +----- + + + + +### Auto_ml.list_model_evaluations + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-automl/samples/generated/v1beta1/auto_ml.list_model_evaluations.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-cloud-automl/samples/generated/v1beta1/auto_ml.list_model_evaluations.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-automl/samples/generated/v1beta1/auto_ml.list_model_evaluations.js` + + +----- + + + + +### Auto_ml.list_models + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-automl/samples/generated/v1beta1/auto_ml.list_models.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-cloud-automl/samples/generated/v1beta1/auto_ml.list_models.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-automl/samples/generated/v1beta1/auto_ml.list_models.js` + + +----- + + + + +### Auto_ml.list_table_specs + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-automl/samples/generated/v1beta1/auto_ml.list_table_specs.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-cloud-automl/samples/generated/v1beta1/auto_ml.list_table_specs.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-automl/samples/generated/v1beta1/auto_ml.list_table_specs.js` + + +----- + + + + +### Auto_ml.undeploy_model + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-automl/samples/generated/v1beta1/auto_ml.undeploy_model.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-cloud-automl/samples/generated/v1beta1/auto_ml.undeploy_model.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-automl/samples/generated/v1beta1/auto_ml.undeploy_model.js` + + +----- + + + + +### Auto_ml.update_column_spec + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-automl/samples/generated/v1beta1/auto_ml.update_column_spec.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-cloud-automl/samples/generated/v1beta1/auto_ml.update_column_spec.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-automl/samples/generated/v1beta1/auto_ml.update_column_spec.js` + + +----- + + + + +### Auto_ml.update_dataset + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-automl/samples/generated/v1beta1/auto_ml.update_dataset.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-cloud-automl/samples/generated/v1beta1/auto_ml.update_dataset.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-automl/samples/generated/v1beta1/auto_ml.update_dataset.js` + + +----- + + + + +### Auto_ml.update_table_spec + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-automl/samples/generated/v1beta1/auto_ml.update_table_spec.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-cloud-automl/samples/generated/v1beta1/auto_ml.update_table_spec.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-automl/samples/generated/v1beta1/auto_ml.update_table_spec.js` + + +----- + + + + +### Prediction_service.batch_predict + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-automl/samples/generated/v1beta1/prediction_service.batch_predict.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-cloud-automl/samples/generated/v1beta1/prediction_service.batch_predict.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-automl/samples/generated/v1beta1/prediction_service.batch_predict.js` + + +----- + + + + +### Prediction_service.predict + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-automl/samples/generated/v1beta1/prediction_service.predict.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-cloud-automl/samples/generated/v1beta1/prediction_service.predict.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-automl/samples/generated/v1beta1/prediction_service.predict.js` + + +----- + + + + +### Quickstart + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-automl/samples/quickstart.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-cloud-automl/samples/quickstart.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-automl/samples/quickstart.js` + + + + + + +[shell_img]: https://gstatic.com/cloudssh/images/open-btn.png +[shell_link]: https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=samples/README.md +[product-docs]: https://cloud.google.com/automl/docs/ diff --git a/packages/google-cloud-automl/samples/generated/v1/auto_ml.create_dataset.js b/packages/google-cloud-automl/samples/generated/v1/auto_ml.create_dataset.js new file mode 100644 index 00000000000..c5d6d661208 --- /dev/null +++ b/packages/google-cloud-automl/samples/generated/v1/auto_ml.create_dataset.js @@ -0,0 +1,67 @@ +// Copyright 2023 Google LLC +// +// Licensed under the Apache License, Version 2.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, dataset) { + // [START automl_v1_generated_AutoMl_CreateDataset_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 resource name of the project to create the dataset for. + */ + // const parent = 'abc123' + /** + * Required. The dataset to create. + */ + // const dataset = {} + + // Imports the Automl library + const {AutoMlClient} = require('@google-cloud/automl').v1; + + // Instantiates a client + const automlClient = new AutoMlClient(); + + async function callCreateDataset() { + // Construct request + const request = { + parent, + dataset, + }; + + // Run request + const [operation] = await automlClient.createDataset(request); + const [response] = await operation.promise(); + console.log(response); + } + + callCreateDataset(); + // [END automl_v1_generated_AutoMl_CreateDataset_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-automl/samples/generated/v1/auto_ml.create_model.js b/packages/google-cloud-automl/samples/generated/v1/auto_ml.create_model.js new file mode 100644 index 00000000000..05724437e2f --- /dev/null +++ b/packages/google-cloud-automl/samples/generated/v1/auto_ml.create_model.js @@ -0,0 +1,67 @@ +// Copyright 2023 Google LLC +// +// Licensed under the Apache License, Version 2.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, model) { + // [START automl_v1_generated_AutoMl_CreateModel_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. Resource name of the parent project where the model is being created. + */ + // const parent = 'abc123' + /** + * Required. The model to create. + */ + // const model = {} + + // Imports the Automl library + const {AutoMlClient} = require('@google-cloud/automl').v1; + + // Instantiates a client + const automlClient = new AutoMlClient(); + + async function callCreateModel() { + // Construct request + const request = { + parent, + model, + }; + + // Run request + const [operation] = await automlClient.createModel(request); + const [response] = await operation.promise(); + console.log(response); + } + + callCreateModel(); + // [END automl_v1_generated_AutoMl_CreateModel_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-automl/samples/generated/v1/auto_ml.delete_dataset.js b/packages/google-cloud-automl/samples/generated/v1/auto_ml.delete_dataset.js new file mode 100644 index 00000000000..f3789e6d4cd --- /dev/null +++ b/packages/google-cloud-automl/samples/generated/v1/auto_ml.delete_dataset.js @@ -0,0 +1,62 @@ +// Copyright 2023 Google LLC +// +// Licensed under the Apache License, Version 2.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 automl_v1_generated_AutoMl_DeleteDataset_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 resource name of the dataset to delete. + */ + // const name = 'abc123' + + // Imports the Automl library + const {AutoMlClient} = require('@google-cloud/automl').v1; + + // Instantiates a client + const automlClient = new AutoMlClient(); + + async function callDeleteDataset() { + // Construct request + const request = { + name, + }; + + // Run request + const [operation] = await automlClient.deleteDataset(request); + const [response] = await operation.promise(); + console.log(response); + } + + callDeleteDataset(); + // [END automl_v1_generated_AutoMl_DeleteDataset_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-automl/samples/generated/v1/auto_ml.delete_model.js b/packages/google-cloud-automl/samples/generated/v1/auto_ml.delete_model.js new file mode 100644 index 00000000000..13112c16b63 --- /dev/null +++ b/packages/google-cloud-automl/samples/generated/v1/auto_ml.delete_model.js @@ -0,0 +1,62 @@ +// Copyright 2023 Google LLC +// +// Licensed under the Apache License, Version 2.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 automl_v1_generated_AutoMl_DeleteModel_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. Resource name of the model being deleted. + */ + // const name = 'abc123' + + // Imports the Automl library + const {AutoMlClient} = require('@google-cloud/automl').v1; + + // Instantiates a client + const automlClient = new AutoMlClient(); + + async function callDeleteModel() { + // Construct request + const request = { + name, + }; + + // Run request + const [operation] = await automlClient.deleteModel(request); + const [response] = await operation.promise(); + console.log(response); + } + + callDeleteModel(); + // [END automl_v1_generated_AutoMl_DeleteModel_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-automl/samples/generated/v1/auto_ml.deploy_model.js b/packages/google-cloud-automl/samples/generated/v1/auto_ml.deploy_model.js new file mode 100644 index 00000000000..2472497e808 --- /dev/null +++ b/packages/google-cloud-automl/samples/generated/v1/auto_ml.deploy_model.js @@ -0,0 +1,70 @@ +// Copyright 2023 Google LLC +// +// Licensed under the Apache License, Version 2.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 automl_v1_generated_AutoMl_DeployModel_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. + */ + /** + * Model deployment metadata specific to Image Object Detection. + */ + // const imageObjectDetectionModelDeploymentMetadata = {} + /** + * Model deployment metadata specific to Image Classification. + */ + // const imageClassificationModelDeploymentMetadata = {} + /** + * Required. Resource name of the model to deploy. + */ + // const name = 'abc123' + + // Imports the Automl library + const {AutoMlClient} = require('@google-cloud/automl').v1; + + // Instantiates a client + const automlClient = new AutoMlClient(); + + async function callDeployModel() { + // Construct request + const request = { + name, + }; + + // Run request + const [operation] = await automlClient.deployModel(request); + const [response] = await operation.promise(); + console.log(response); + } + + callDeployModel(); + // [END automl_v1_generated_AutoMl_DeployModel_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-automl/samples/generated/v1/auto_ml.export_data.js b/packages/google-cloud-automl/samples/generated/v1/auto_ml.export_data.js new file mode 100644 index 00000000000..3933812fdc2 --- /dev/null +++ b/packages/google-cloud-automl/samples/generated/v1/auto_ml.export_data.js @@ -0,0 +1,67 @@ +// Copyright 2023 Google LLC +// +// Licensed under the Apache License, Version 2.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, outputConfig) { + // [START automl_v1_generated_AutoMl_ExportData_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 resource name of the dataset. + */ + // const name = 'abc123' + /** + * Required. The desired output location. + */ + // const outputConfig = {} + + // Imports the Automl library + const {AutoMlClient} = require('@google-cloud/automl').v1; + + // Instantiates a client + const automlClient = new AutoMlClient(); + + async function callExportData() { + // Construct request + const request = { + name, + outputConfig, + }; + + // Run request + const [operation] = await automlClient.exportData(request); + const [response] = await operation.promise(); + console.log(response); + } + + callExportData(); + // [END automl_v1_generated_AutoMl_ExportData_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-automl/samples/generated/v1/auto_ml.export_model.js b/packages/google-cloud-automl/samples/generated/v1/auto_ml.export_model.js new file mode 100644 index 00000000000..36bd57421d2 --- /dev/null +++ b/packages/google-cloud-automl/samples/generated/v1/auto_ml.export_model.js @@ -0,0 +1,67 @@ +// Copyright 2023 Google LLC +// +// Licensed under the Apache License, Version 2.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, outputConfig) { + // [START automl_v1_generated_AutoMl_ExportModel_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 resource name of the model to export. + */ + // const name = 'abc123' + /** + * Required. The desired output location and configuration. + */ + // const outputConfig = {} + + // Imports the Automl library + const {AutoMlClient} = require('@google-cloud/automl').v1; + + // Instantiates a client + const automlClient = new AutoMlClient(); + + async function callExportModel() { + // Construct request + const request = { + name, + outputConfig, + }; + + // Run request + const [operation] = await automlClient.exportModel(request); + const [response] = await operation.promise(); + console.log(response); + } + + callExportModel(); + // [END automl_v1_generated_AutoMl_ExportModel_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-automl/samples/generated/v1/auto_ml.get_annotation_spec.js b/packages/google-cloud-automl/samples/generated/v1/auto_ml.get_annotation_spec.js new file mode 100644 index 00000000000..23c0726abd1 --- /dev/null +++ b/packages/google-cloud-automl/samples/generated/v1/auto_ml.get_annotation_spec.js @@ -0,0 +1,61 @@ +// Copyright 2023 Google LLC +// +// Licensed under the Apache License, Version 2.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 automl_v1_generated_AutoMl_GetAnnotationSpec_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 resource name of the annotation spec to retrieve. + */ + // const name = 'abc123' + + // Imports the Automl library + const {AutoMlClient} = require('@google-cloud/automl').v1; + + // Instantiates a client + const automlClient = new AutoMlClient(); + + async function callGetAnnotationSpec() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await automlClient.getAnnotationSpec(request); + console.log(response); + } + + callGetAnnotationSpec(); + // [END automl_v1_generated_AutoMl_GetAnnotationSpec_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-automl/samples/generated/v1/auto_ml.get_dataset.js b/packages/google-cloud-automl/samples/generated/v1/auto_ml.get_dataset.js new file mode 100644 index 00000000000..524007fe949 --- /dev/null +++ b/packages/google-cloud-automl/samples/generated/v1/auto_ml.get_dataset.js @@ -0,0 +1,61 @@ +// Copyright 2023 Google LLC +// +// Licensed under the Apache License, Version 2.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 automl_v1_generated_AutoMl_GetDataset_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 resource name of the dataset to retrieve. + */ + // const name = 'abc123' + + // Imports the Automl library + const {AutoMlClient} = require('@google-cloud/automl').v1; + + // Instantiates a client + const automlClient = new AutoMlClient(); + + async function callGetDataset() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await automlClient.getDataset(request); + console.log(response); + } + + callGetDataset(); + // [END automl_v1_generated_AutoMl_GetDataset_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-automl/samples/generated/v1/auto_ml.get_model.js b/packages/google-cloud-automl/samples/generated/v1/auto_ml.get_model.js new file mode 100644 index 00000000000..7195722493f --- /dev/null +++ b/packages/google-cloud-automl/samples/generated/v1/auto_ml.get_model.js @@ -0,0 +1,61 @@ +// Copyright 2023 Google LLC +// +// Licensed under the Apache License, Version 2.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 automl_v1_generated_AutoMl_GetModel_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. Resource name of the model. + */ + // const name = 'abc123' + + // Imports the Automl library + const {AutoMlClient} = require('@google-cloud/automl').v1; + + // Instantiates a client + const automlClient = new AutoMlClient(); + + async function callGetModel() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await automlClient.getModel(request); + console.log(response); + } + + callGetModel(); + // [END automl_v1_generated_AutoMl_GetModel_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-automl/samples/generated/v1/auto_ml.get_model_evaluation.js b/packages/google-cloud-automl/samples/generated/v1/auto_ml.get_model_evaluation.js new file mode 100644 index 00000000000..e0605c44151 --- /dev/null +++ b/packages/google-cloud-automl/samples/generated/v1/auto_ml.get_model_evaluation.js @@ -0,0 +1,61 @@ +// Copyright 2023 Google LLC +// +// Licensed under the Apache License, Version 2.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 automl_v1_generated_AutoMl_GetModelEvaluation_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. Resource name for the model evaluation. + */ + // const name = 'abc123' + + // Imports the Automl library + const {AutoMlClient} = require('@google-cloud/automl').v1; + + // Instantiates a client + const automlClient = new AutoMlClient(); + + async function callGetModelEvaluation() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await automlClient.getModelEvaluation(request); + console.log(response); + } + + callGetModelEvaluation(); + // [END automl_v1_generated_AutoMl_GetModelEvaluation_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-automl/samples/generated/v1/auto_ml.import_data.js b/packages/google-cloud-automl/samples/generated/v1/auto_ml.import_data.js new file mode 100644 index 00000000000..f4d2963ef71 --- /dev/null +++ b/packages/google-cloud-automl/samples/generated/v1/auto_ml.import_data.js @@ -0,0 +1,69 @@ +// Copyright 2023 Google LLC +// +// Licensed under the Apache License, Version 2.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, inputConfig) { + // [START automl_v1_generated_AutoMl_ImportData_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. Dataset name. Dataset must already exist. All imported + * annotations and examples will be added. + */ + // const name = 'abc123' + /** + * Required. The desired input location and its domain specific semantics, + * if any. + */ + // const inputConfig = {} + + // Imports the Automl library + const {AutoMlClient} = require('@google-cloud/automl').v1; + + // Instantiates a client + const automlClient = new AutoMlClient(); + + async function callImportData() { + // Construct request + const request = { + name, + inputConfig, + }; + + // Run request + const [operation] = await automlClient.importData(request); + const [response] = await operation.promise(); + console.log(response); + } + + callImportData(); + // [END automl_v1_generated_AutoMl_ImportData_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-automl/samples/generated/v1/auto_ml.list_datasets.js b/packages/google-cloud-automl/samples/generated/v1/auto_ml.list_datasets.js new file mode 100644 index 00000000000..831fd54c9b9 --- /dev/null +++ b/packages/google-cloud-automl/samples/generated/v1/auto_ml.list_datasets.js @@ -0,0 +1,83 @@ +// Copyright 2023 Google LLC +// +// Licensed under the Apache License, Version 2.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 automl_v1_generated_AutoMl_ListDatasets_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 resource name of the project from which to list datasets. + */ + // const parent = 'abc123' + /** + * An expression for filtering the results of the request. + * * `dataset_metadata` - for existence of the case (e.g. + * `image_classification_dataset_metadata:*`). Some examples of using the filter are: + * * `translation_dataset_metadata:*` --> The dataset has + * `translation_dataset_metadata`. + */ + // const filter = 'abc123' + /** + * Requested page size. Server may return fewer results than requested. + * If unspecified, server will pick a default size. + */ + // const pageSize = 1234 + /** + * A token identifying a page of results for the server to return + * Typically obtained via + * ListDatasetsResponse.next_page_token google.cloud.automl.v1.ListDatasetsResponse.next_page_token of the previous + * AutoMl.ListDatasets google.cloud.automl.v1.AutoMl.ListDatasets call. + */ + // const pageToken = 'abc123' + + // Imports the Automl library + const {AutoMlClient} = require('@google-cloud/automl').v1; + + // Instantiates a client + const automlClient = new AutoMlClient(); + + async function callListDatasets() { + // Construct request + const request = { + parent, + }; + + // Run request + const iterable = await automlClient.listDatasetsAsync(request); + for await (const response of iterable) { + console.log(response); + } + } + + callListDatasets(); + // [END automl_v1_generated_AutoMl_ListDatasets_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-automl/samples/generated/v1/auto_ml.list_model_evaluations.js b/packages/google-cloud-automl/samples/generated/v1/auto_ml.list_model_evaluations.js new file mode 100644 index 00000000000..3431ee018bb --- /dev/null +++ b/packages/google-cloud-automl/samples/generated/v1/auto_ml.list_model_evaluations.js @@ -0,0 +1,88 @@ +// Copyright 2023 Google LLC +// +// Licensed under the Apache License, Version 2.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, filter) { + // [START automl_v1_generated_AutoMl_ListModelEvaluations_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. Resource name of the model to list the model evaluations for. + * If modelId is set as "-", this will list model evaluations from across all + * models of the parent location. + */ + // const parent = 'abc123' + /** + * Required. An expression for filtering the results of the request. + * * `annotation_spec_id` - for =, != or existence. See example below for + * the last. + * Some examples of using the filter are: + * * `annotation_spec_id!=4` --> The model evaluation was done for + * annotation spec with ID different than 4. + * * `NOT annotation_spec_id:*` --> The model evaluation was done for + * aggregate of all annotation specs. + */ + // const filter = 'abc123' + /** + * Requested page size. + */ + // const pageSize = 1234 + /** + * A token identifying a page of results for the server to return. + * Typically obtained via + * ListModelEvaluationsResponse.next_page_token google.cloud.automl.v1.ListModelEvaluationsResponse.next_page_token of the previous + * AutoMl.ListModelEvaluations google.cloud.automl.v1.AutoMl.ListModelEvaluations call. + */ + // const pageToken = 'abc123' + + // Imports the Automl library + const {AutoMlClient} = require('@google-cloud/automl').v1; + + // Instantiates a client + const automlClient = new AutoMlClient(); + + async function callListModelEvaluations() { + // Construct request + const request = { + parent, + filter, + }; + + // Run request + const iterable = await automlClient.listModelEvaluationsAsync(request); + for await (const response of iterable) { + console.log(response); + } + } + + callListModelEvaluations(); + // [END automl_v1_generated_AutoMl_ListModelEvaluations_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-automl/samples/generated/v1/auto_ml.list_models.js b/packages/google-cloud-automl/samples/generated/v1/auto_ml.list_models.js new file mode 100644 index 00000000000..849df485f1b --- /dev/null +++ b/packages/google-cloud-automl/samples/generated/v1/auto_ml.list_models.js @@ -0,0 +1,84 @@ +// Copyright 2023 Google LLC +// +// Licensed under the Apache License, Version 2.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 automl_v1_generated_AutoMl_ListModels_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. Resource name of the project, from which to list the models. + */ + // const parent = 'abc123' + /** + * An expression for filtering the results of the request. + * * `model_metadata` - for existence of the case (e.g. + * `video_classification_model_metadata:*`). + * * `dataset_id` - for = or !=. Some examples of using the filter are: + * * `image_classification_model_metadata:*` --> The model has + * `image_classification_model_metadata`. + * * `dataset_id=5` --> The model was created from a dataset with ID 5. + */ + // const filter = 'abc123' + /** + * Requested page size. + */ + // const pageSize = 1234 + /** + * A token identifying a page of results for the server to return + * Typically obtained via + * ListModelsResponse.next_page_token google.cloud.automl.v1.ListModelsResponse.next_page_token of the previous + * AutoMl.ListModels google.cloud.automl.v1.AutoMl.ListModels call. + */ + // const pageToken = 'abc123' + + // Imports the Automl library + const {AutoMlClient} = require('@google-cloud/automl').v1; + + // Instantiates a client + const automlClient = new AutoMlClient(); + + async function callListModels() { + // Construct request + const request = { + parent, + }; + + // Run request + const iterable = await automlClient.listModelsAsync(request); + for await (const response of iterable) { + console.log(response); + } + } + + callListModels(); + // [END automl_v1_generated_AutoMl_ListModels_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-automl/samples/generated/v1/auto_ml.undeploy_model.js b/packages/google-cloud-automl/samples/generated/v1/auto_ml.undeploy_model.js new file mode 100644 index 00000000000..d8c6776f6e9 --- /dev/null +++ b/packages/google-cloud-automl/samples/generated/v1/auto_ml.undeploy_model.js @@ -0,0 +1,62 @@ +// Copyright 2023 Google LLC +// +// Licensed under the Apache License, Version 2.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 automl_v1_generated_AutoMl_UndeployModel_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. Resource name of the model to undeploy. + */ + // const name = 'abc123' + + // Imports the Automl library + const {AutoMlClient} = require('@google-cloud/automl').v1; + + // Instantiates a client + const automlClient = new AutoMlClient(); + + async function callUndeployModel() { + // Construct request + const request = { + name, + }; + + // Run request + const [operation] = await automlClient.undeployModel(request); + const [response] = await operation.promise(); + console.log(response); + } + + callUndeployModel(); + // [END automl_v1_generated_AutoMl_UndeployModel_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-automl/samples/generated/v1/auto_ml.update_dataset.js b/packages/google-cloud-automl/samples/generated/v1/auto_ml.update_dataset.js new file mode 100644 index 00000000000..67cab9e687b --- /dev/null +++ b/packages/google-cloud-automl/samples/generated/v1/auto_ml.update_dataset.js @@ -0,0 +1,66 @@ +// Copyright 2023 Google LLC +// +// Licensed under the Apache License, Version 2.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(dataset, updateMask) { + // [START automl_v1_generated_AutoMl_UpdateDataset_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 dataset which replaces the resource on the server. + */ + // const dataset = {} + /** + * Required. The update mask applies to the resource. + */ + // const updateMask = {} + + // Imports the Automl library + const {AutoMlClient} = require('@google-cloud/automl').v1; + + // Instantiates a client + const automlClient = new AutoMlClient(); + + async function callUpdateDataset() { + // Construct request + const request = { + dataset, + updateMask, + }; + + // Run request + const response = await automlClient.updateDataset(request); + console.log(response); + } + + callUpdateDataset(); + // [END automl_v1_generated_AutoMl_UpdateDataset_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-automl/samples/generated/v1/auto_ml.update_model.js b/packages/google-cloud-automl/samples/generated/v1/auto_ml.update_model.js new file mode 100644 index 00000000000..4116a8ceff9 --- /dev/null +++ b/packages/google-cloud-automl/samples/generated/v1/auto_ml.update_model.js @@ -0,0 +1,66 @@ +// Copyright 2023 Google LLC +// +// Licensed under the Apache License, Version 2.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(model, updateMask) { + // [START automl_v1_generated_AutoMl_UpdateModel_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 model which replaces the resource on the server. + */ + // const model = {} + /** + * Required. The update mask applies to the resource. + */ + // const updateMask = {} + + // Imports the Automl library + const {AutoMlClient} = require('@google-cloud/automl').v1; + + // Instantiates a client + const automlClient = new AutoMlClient(); + + async function callUpdateModel() { + // Construct request + const request = { + model, + updateMask, + }; + + // Run request + const response = await automlClient.updateModel(request); + console.log(response); + } + + callUpdateModel(); + // [END automl_v1_generated_AutoMl_UpdateModel_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-automl/samples/generated/v1/prediction_service.batch_predict.js b/packages/google-cloud-automl/samples/generated/v1/prediction_service.batch_predict.js new file mode 100644 index 00000000000..b6b23e81cb0 --- /dev/null +++ b/packages/google-cloud-automl/samples/generated/v1/prediction_service.batch_predict.js @@ -0,0 +1,141 @@ +// Copyright 2023 Google LLC +// +// Licensed under the Apache License, Version 2.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, inputConfig, outputConfig) { + // [START automl_v1_generated_PredictionService_BatchPredict_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. Name of the model requested to serve the batch prediction. + */ + // const name = 'abc123' + /** + * Required. The input configuration for batch prediction. + */ + // const inputConfig = {} + /** + * Required. The Configuration specifying where output predictions should + * be written. + */ + // const outputConfig = {} + /** + * Additional domain-specific parameters for the predictions, any string must + * be up to 25000 characters long. + * AutoML Natural Language Classification + * `score_threshold` + * : (float) A value from 0.0 to 1.0. When the model + * makes predictions for a text snippet, it will only produce results + * that have at least this confidence score. The default is 0.5. + * AutoML Vision Classification + * `score_threshold` + * : (float) A value from 0.0 to 1.0. When the model + * makes predictions for an image, it will only produce results that + * have at least this confidence score. The default is 0.5. + * AutoML Vision Object Detection + * `score_threshold` + * : (float) When Model detects objects on the image, + * it will only produce bounding boxes which have at least this + * confidence score. Value in 0 to 1 range, default is 0.5. + * `max_bounding_box_count` + * : (int64) The maximum number of bounding + * boxes returned per image. The default is 100, the + * number of bounding boxes returned might be limited by the server. + * AutoML Video Intelligence Classification + * `score_threshold` + * : (float) A value from 0.0 to 1.0. When the model + * makes predictions for a video, it will only produce results that + * have at least this confidence score. The default is 0.5. + * `segment_classification` + * : (boolean) Set to true to request + * segment-level classification. AutoML Video Intelligence returns + * labels and their confidence scores for the entire segment of the + * video that user specified in the request configuration. + * The default is true. + * `shot_classification` + * : (boolean) Set to true to request shot-level + * classification. AutoML Video Intelligence determines the boundaries + * for each camera shot in the entire segment of the video that user + * specified in the request configuration. AutoML Video Intelligence + * then returns labels and their confidence scores for each detected + * shot, along with the start and end time of the shot. + * The default is false. + * WARNING: Model evaluation is not done for this classification type, + * the quality of it depends on training data, but there are no metrics + * provided to describe that quality. + * `1s_interval_classification` + * : (boolean) Set to true to request + * classification for a video at one-second intervals. AutoML Video + * Intelligence returns labels and their confidence scores for each + * second of the entire segment of the video that user specified in the + * request configuration. The default is false. + * WARNING: Model evaluation is not done for this classification + * type, the quality of it depends on training data, but there are no + * metrics provided to describe that quality. + * AutoML Video Intelligence Object Tracking + * `score_threshold` + * : (float) When Model detects objects on video frames, + * it will only produce bounding boxes which have at least this + * confidence score. Value in 0 to 1 range, default is 0.5. + * `max_bounding_box_count` + * : (int64) The maximum number of bounding + * boxes returned per image. The default is 100, the + * number of bounding boxes returned might be limited by the server. + * `min_bounding_box_size` + * : (float) Only bounding boxes with shortest edge + * at least that long as a relative value of video frame size are + * returned. Value in 0 to 1 range. Default is 0. + */ + // const params = [1,2,3,4] + + // Imports the Automl library + const {PredictionServiceClient} = require('@google-cloud/automl').v1; + + // Instantiates a client + const automlClient = new PredictionServiceClient(); + + async function callBatchPredict() { + // Construct request + const request = { + name, + inputConfig, + outputConfig, + }; + + // Run request + const [operation] = await automlClient.batchPredict(request); + const [response] = await operation.promise(); + console.log(response); + } + + callBatchPredict(); + // [END automl_v1_generated_PredictionService_BatchPredict_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-automl/samples/generated/v1/prediction_service.predict.js b/packages/google-cloud-automl/samples/generated/v1/prediction_service.predict.js new file mode 100644 index 00000000000..1f5918695cb --- /dev/null +++ b/packages/google-cloud-automl/samples/generated/v1/prediction_service.predict.js @@ -0,0 +1,93 @@ +// Copyright 2023 Google LLC +// +// Licensed under the Apache License, Version 2.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, payload) { + // [START automl_v1_generated_PredictionService_Predict_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. Name of the model requested to serve the prediction. + */ + // const name = 'abc123' + /** + * Required. Payload to perform a prediction on. The payload must match the + * problem type that the model was trained to solve. + */ + // const payload = {} + /** + * Additional domain-specific parameters, any string must be up to 25000 + * characters long. + * AutoML Vision Classification + * `score_threshold` + * : (float) A value from 0.0 to 1.0. When the model + * makes predictions for an image, it will only produce results that have + * at least this confidence score. The default is 0.5. + * AutoML Vision Object Detection + * `score_threshold` + * : (float) When Model detects objects on the image, + * it will only produce bounding boxes which have at least this + * confidence score. Value in 0 to 1 range, default is 0.5. + * `max_bounding_box_count` + * : (int64) The maximum number of bounding + * boxes returned. The default is 100. The + * number of returned bounding boxes might be limited by the server. + * AutoML Tables + * `feature_importance` + * : (boolean) Whether + * feature_importance google.cloud.automl.v1.TablesModelColumnInfo.feature_importance + * is populated in the returned list of + * TablesAnnotation google.cloud.automl.v1.TablesAnnotation + * objects. The default is false. + */ + // const params = [1,2,3,4] + + // Imports the Automl library + const {PredictionServiceClient} = require('@google-cloud/automl').v1; + + // Instantiates a client + const automlClient = new PredictionServiceClient(); + + async function callPredict() { + // Construct request + const request = { + name, + payload, + }; + + // Run request + const response = await automlClient.predict(request); + console.log(response); + } + + callPredict(); + // [END automl_v1_generated_PredictionService_Predict_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-automl/samples/generated/v1/snippet_metadata.google.cloud.automl.v1.json b/packages/google-cloud-automl/samples/generated/v1/snippet_metadata.google.cloud.automl.v1.json new file mode 100644 index 00000000000..a5cb05232ba --- /dev/null +++ b/packages/google-cloud-automl/samples/generated/v1/snippet_metadata.google.cloud.automl.v1.json @@ -0,0 +1,907 @@ +{ + "clientLibrary": { + "name": "nodejs-automl", + "version": "4.0.2", + "language": "TYPESCRIPT", + "apis": [ + { + "id": "google.cloud.automl.v1", + "version": "v1" + } + ] + }, + "snippets": [ + { + "regionTag": "automl_v1_generated_AutoMl_CreateDataset_async", + "title": "automl createDataset Sample", + "origin": "API_DEFINITION", + "description": " Creates a dataset.", + "canonical": true, + "file": "auto_ml.create_dataset.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 59, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "CreateDataset", + "fullName": "google.cloud.automl.v1.AutoMl.CreateDataset", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "dataset", + "type": ".google.cloud.automl.v1.Dataset" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "AutoMlClient", + "fullName": "google.cloud.automl.v1.AutoMlClient" + }, + "method": { + "shortName": "CreateDataset", + "fullName": "google.cloud.automl.v1.AutoMl.CreateDataset", + "service": { + "shortName": "AutoMl", + "fullName": "google.cloud.automl.v1.AutoMl" + } + } + } + }, + { + "regionTag": "automl_v1_generated_AutoMl_GetDataset_async", + "title": "automl getDataset Sample", + "origin": "API_DEFINITION", + "description": " Gets a dataset.", + "canonical": true, + "file": "auto_ml.get_dataset.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 53, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "GetDataset", + "fullName": "google.cloud.automl.v1.AutoMl.GetDataset", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.automl.v1.Dataset", + "client": { + "shortName": "AutoMlClient", + "fullName": "google.cloud.automl.v1.AutoMlClient" + }, + "method": { + "shortName": "GetDataset", + "fullName": "google.cloud.automl.v1.AutoMl.GetDataset", + "service": { + "shortName": "AutoMl", + "fullName": "google.cloud.automl.v1.AutoMl" + } + } + } + }, + { + "regionTag": "automl_v1_generated_AutoMl_ListDatasets_async", + "title": "automl listDatasets Sample", + "origin": "API_DEFINITION", + "description": " Lists datasets in a project.", + "canonical": true, + "file": "auto_ml.list_datasets.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 75, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "ListDatasets", + "fullName": "google.cloud.automl.v1.AutoMl.ListDatasets", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "filter", + "type": "TYPE_STRING" + }, + { + "name": "page_size", + "type": "TYPE_INT32" + }, + { + "name": "page_token", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.automl.v1.ListDatasetsResponse", + "client": { + "shortName": "AutoMlClient", + "fullName": "google.cloud.automl.v1.AutoMlClient" + }, + "method": { + "shortName": "ListDatasets", + "fullName": "google.cloud.automl.v1.AutoMl.ListDatasets", + "service": { + "shortName": "AutoMl", + "fullName": "google.cloud.automl.v1.AutoMl" + } + } + } + }, + { + "regionTag": "automl_v1_generated_AutoMl_UpdateDataset_async", + "title": "automl updateDataset Sample", + "origin": "API_DEFINITION", + "description": " Updates a dataset.", + "canonical": true, + "file": "auto_ml.update_dataset.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 58, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "UpdateDataset", + "fullName": "google.cloud.automl.v1.AutoMl.UpdateDataset", + "async": true, + "parameters": [ + { + "name": "dataset", + "type": ".google.cloud.automl.v1.Dataset" + }, + { + "name": "update_mask", + "type": ".google.protobuf.FieldMask" + } + ], + "resultType": ".google.cloud.automl.v1.Dataset", + "client": { + "shortName": "AutoMlClient", + "fullName": "google.cloud.automl.v1.AutoMlClient" + }, + "method": { + "shortName": "UpdateDataset", + "fullName": "google.cloud.automl.v1.AutoMl.UpdateDataset", + "service": { + "shortName": "AutoMl", + "fullName": "google.cloud.automl.v1.AutoMl" + } + } + } + }, + { + "regionTag": "automl_v1_generated_AutoMl_DeleteDataset_async", + "title": "automl deleteDataset Sample", + "origin": "API_DEFINITION", + "description": " Deletes a dataset and all of its contents. Returns empty response in the [response][google.longrunning.Operation.response] field when it completes, and `delete_details` in the [metadata][google.longrunning.Operation.metadata] field.", + "canonical": true, + "file": "auto_ml.delete_dataset.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 54, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "DeleteDataset", + "fullName": "google.cloud.automl.v1.AutoMl.DeleteDataset", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "AutoMlClient", + "fullName": "google.cloud.automl.v1.AutoMlClient" + }, + "method": { + "shortName": "DeleteDataset", + "fullName": "google.cloud.automl.v1.AutoMl.DeleteDataset", + "service": { + "shortName": "AutoMl", + "fullName": "google.cloud.automl.v1.AutoMl" + } + } + } + }, + { + "regionTag": "automl_v1_generated_AutoMl_ImportData_async", + "title": "automl importData Sample", + "origin": "API_DEFINITION", + "description": " Imports data into a dataset. For Tables this method can only be called on an empty Dataset. For Tables: * A [schema_inference_version][google.cloud.automl.v1.InputConfig.params] parameter must be explicitly set. Returns an empty response in the [response][google.longrunning.Operation.response] field when it completes.", + "canonical": true, + "file": "auto_ml.import_data.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 61, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "ImportData", + "fullName": "google.cloud.automl.v1.AutoMl.ImportData", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + }, + { + "name": "input_config", + "type": ".google.cloud.automl.v1.InputConfig" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "AutoMlClient", + "fullName": "google.cloud.automl.v1.AutoMlClient" + }, + "method": { + "shortName": "ImportData", + "fullName": "google.cloud.automl.v1.AutoMl.ImportData", + "service": { + "shortName": "AutoMl", + "fullName": "google.cloud.automl.v1.AutoMl" + } + } + } + }, + { + "regionTag": "automl_v1_generated_AutoMl_ExportData_async", + "title": "automl exportData Sample", + "origin": "API_DEFINITION", + "description": " Exports dataset's data to the provided output location. Returns an empty response in the [response][google.longrunning.Operation.response] field when it completes.", + "canonical": true, + "file": "auto_ml.export_data.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 59, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "ExportData", + "fullName": "google.cloud.automl.v1.AutoMl.ExportData", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + }, + { + "name": "output_config", + "type": ".google.cloud.automl.v1.OutputConfig" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "AutoMlClient", + "fullName": "google.cloud.automl.v1.AutoMlClient" + }, + "method": { + "shortName": "ExportData", + "fullName": "google.cloud.automl.v1.AutoMl.ExportData", + "service": { + "shortName": "AutoMl", + "fullName": "google.cloud.automl.v1.AutoMl" + } + } + } + }, + { + "regionTag": "automl_v1_generated_AutoMl_GetAnnotationSpec_async", + "title": "automl getAnnotationSpec Sample", + "origin": "API_DEFINITION", + "description": " Gets an annotation spec.", + "canonical": true, + "file": "auto_ml.get_annotation_spec.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 53, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "GetAnnotationSpec", + "fullName": "google.cloud.automl.v1.AutoMl.GetAnnotationSpec", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.automl.v1.AnnotationSpec", + "client": { + "shortName": "AutoMlClient", + "fullName": "google.cloud.automl.v1.AutoMlClient" + }, + "method": { + "shortName": "GetAnnotationSpec", + "fullName": "google.cloud.automl.v1.AutoMl.GetAnnotationSpec", + "service": { + "shortName": "AutoMl", + "fullName": "google.cloud.automl.v1.AutoMl" + } + } + } + }, + { + "regionTag": "automl_v1_generated_AutoMl_CreateModel_async", + "title": "automl createModel Sample", + "origin": "API_DEFINITION", + "description": " Creates a model. Returns a Model in the [response][google.longrunning.Operation.response] field when it completes. When you create a model, several model evaluations are created for it: a global evaluation, and one evaluation for each annotation spec.", + "canonical": true, + "file": "auto_ml.create_model.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 59, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "CreateModel", + "fullName": "google.cloud.automl.v1.AutoMl.CreateModel", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "model", + "type": ".google.cloud.automl.v1.Model" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "AutoMlClient", + "fullName": "google.cloud.automl.v1.AutoMlClient" + }, + "method": { + "shortName": "CreateModel", + "fullName": "google.cloud.automl.v1.AutoMl.CreateModel", + "service": { + "shortName": "AutoMl", + "fullName": "google.cloud.automl.v1.AutoMl" + } + } + } + }, + { + "regionTag": "automl_v1_generated_AutoMl_GetModel_async", + "title": "automl getModel Sample", + "origin": "API_DEFINITION", + "description": " Gets a model.", + "canonical": true, + "file": "auto_ml.get_model.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 53, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "GetModel", + "fullName": "google.cloud.automl.v1.AutoMl.GetModel", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.automl.v1.Model", + "client": { + "shortName": "AutoMlClient", + "fullName": "google.cloud.automl.v1.AutoMlClient" + }, + "method": { + "shortName": "GetModel", + "fullName": "google.cloud.automl.v1.AutoMl.GetModel", + "service": { + "shortName": "AutoMl", + "fullName": "google.cloud.automl.v1.AutoMl" + } + } + } + }, + { + "regionTag": "automl_v1_generated_AutoMl_ListModels_async", + "title": "automl listModels Sample", + "origin": "API_DEFINITION", + "description": " Lists models.", + "canonical": true, + "file": "auto_ml.list_models.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 76, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "ListModels", + "fullName": "google.cloud.automl.v1.AutoMl.ListModels", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "filter", + "type": "TYPE_STRING" + }, + { + "name": "page_size", + "type": "TYPE_INT32" + }, + { + "name": "page_token", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.automl.v1.ListModelsResponse", + "client": { + "shortName": "AutoMlClient", + "fullName": "google.cloud.automl.v1.AutoMlClient" + }, + "method": { + "shortName": "ListModels", + "fullName": "google.cloud.automl.v1.AutoMl.ListModels", + "service": { + "shortName": "AutoMl", + "fullName": "google.cloud.automl.v1.AutoMl" + } + } + } + }, + { + "regionTag": "automl_v1_generated_AutoMl_DeleteModel_async", + "title": "automl deleteModel Sample", + "origin": "API_DEFINITION", + "description": " Deletes a model. Returns `google.protobuf.Empty` in the [response][google.longrunning.Operation.response] field when it completes, and `delete_details` in the [metadata][google.longrunning.Operation.metadata] field.", + "canonical": true, + "file": "auto_ml.delete_model.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 54, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "DeleteModel", + "fullName": "google.cloud.automl.v1.AutoMl.DeleteModel", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "AutoMlClient", + "fullName": "google.cloud.automl.v1.AutoMlClient" + }, + "method": { + "shortName": "DeleteModel", + "fullName": "google.cloud.automl.v1.AutoMl.DeleteModel", + "service": { + "shortName": "AutoMl", + "fullName": "google.cloud.automl.v1.AutoMl" + } + } + } + }, + { + "regionTag": "automl_v1_generated_AutoMl_UpdateModel_async", + "title": "automl updateModel Sample", + "origin": "API_DEFINITION", + "description": " Updates a model.", + "canonical": true, + "file": "auto_ml.update_model.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 58, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "UpdateModel", + "fullName": "google.cloud.automl.v1.AutoMl.UpdateModel", + "async": true, + "parameters": [ + { + "name": "model", + "type": ".google.cloud.automl.v1.Model" + }, + { + "name": "update_mask", + "type": ".google.protobuf.FieldMask" + } + ], + "resultType": ".google.cloud.automl.v1.Model", + "client": { + "shortName": "AutoMlClient", + "fullName": "google.cloud.automl.v1.AutoMlClient" + }, + "method": { + "shortName": "UpdateModel", + "fullName": "google.cloud.automl.v1.AutoMl.UpdateModel", + "service": { + "shortName": "AutoMl", + "fullName": "google.cloud.automl.v1.AutoMl" + } + } + } + }, + { + "regionTag": "automl_v1_generated_AutoMl_DeployModel_async", + "title": "automl deployModel Sample", + "origin": "API_DEFINITION", + "description": " Deploys a model. If a model is already deployed, deploying it with the same parameters has no effect. Deploying with different parametrs (as e.g. changing [node_number][google.cloud.automl.v1p1beta.ImageObjectDetectionModelDeploymentMetadata.node_number]) will reset the deployment state without pausing the model's availability. Only applicable for Text Classification, Image Object Detection , Tables, and Image Segmentation; all other domains manage deployment automatically. Returns an empty response in the [response][google.longrunning.Operation.response] field when it completes.", + "canonical": true, + "file": "auto_ml.deploy_model.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 62, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "DeployModel", + "fullName": "google.cloud.automl.v1.AutoMl.DeployModel", + "async": true, + "parameters": [ + { + "name": "image_object_detection_model_deployment_metadata", + "type": ".google.cloud.automl.v1.ImageObjectDetectionModelDeploymentMetadata" + }, + { + "name": "image_classification_model_deployment_metadata", + "type": ".google.cloud.automl.v1.ImageClassificationModelDeploymentMetadata" + }, + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "AutoMlClient", + "fullName": "google.cloud.automl.v1.AutoMlClient" + }, + "method": { + "shortName": "DeployModel", + "fullName": "google.cloud.automl.v1.AutoMl.DeployModel", + "service": { + "shortName": "AutoMl", + "fullName": "google.cloud.automl.v1.AutoMl" + } + } + } + }, + { + "regionTag": "automl_v1_generated_AutoMl_UndeployModel_async", + "title": "automl undeployModel Sample", + "origin": "API_DEFINITION", + "description": " Undeploys a model. If the model is not deployed this method has no effect. Only applicable for Text Classification, Image Object Detection and Tables; all other domains manage deployment automatically. Returns an empty response in the [response][google.longrunning.Operation.response] field when it completes.", + "canonical": true, + "file": "auto_ml.undeploy_model.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 54, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "UndeployModel", + "fullName": "google.cloud.automl.v1.AutoMl.UndeployModel", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "AutoMlClient", + "fullName": "google.cloud.automl.v1.AutoMlClient" + }, + "method": { + "shortName": "UndeployModel", + "fullName": "google.cloud.automl.v1.AutoMl.UndeployModel", + "service": { + "shortName": "AutoMl", + "fullName": "google.cloud.automl.v1.AutoMl" + } + } + } + }, + { + "regionTag": "automl_v1_generated_AutoMl_ExportModel_async", + "title": "automl exportModel Sample", + "origin": "API_DEFINITION", + "description": " Exports a trained, \"export-able\", model to a user specified Google Cloud Storage location. A model is considered export-able if and only if it has an export format defined for it in [ModelExportOutputConfig][google.cloud.automl.v1.ModelExportOutputConfig]. Returns an empty response in the [response][google.longrunning.Operation.response] field when it completes.", + "canonical": true, + "file": "auto_ml.export_model.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 59, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "ExportModel", + "fullName": "google.cloud.automl.v1.AutoMl.ExportModel", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + }, + { + "name": "output_config", + "type": ".google.cloud.automl.v1.ModelExportOutputConfig" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "AutoMlClient", + "fullName": "google.cloud.automl.v1.AutoMlClient" + }, + "method": { + "shortName": "ExportModel", + "fullName": "google.cloud.automl.v1.AutoMl.ExportModel", + "service": { + "shortName": "AutoMl", + "fullName": "google.cloud.automl.v1.AutoMl" + } + } + } + }, + { + "regionTag": "automl_v1_generated_AutoMl_GetModelEvaluation_async", + "title": "automl getModelEvaluation Sample", + "origin": "API_DEFINITION", + "description": " Gets a model evaluation.", + "canonical": true, + "file": "auto_ml.get_model_evaluation.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 53, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "GetModelEvaluation", + "fullName": "google.cloud.automl.v1.AutoMl.GetModelEvaluation", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.automl.v1.ModelEvaluation", + "client": { + "shortName": "AutoMlClient", + "fullName": "google.cloud.automl.v1.AutoMlClient" + }, + "method": { + "shortName": "GetModelEvaluation", + "fullName": "google.cloud.automl.v1.AutoMl.GetModelEvaluation", + "service": { + "shortName": "AutoMl", + "fullName": "google.cloud.automl.v1.AutoMl" + } + } + } + }, + { + "regionTag": "automl_v1_generated_AutoMl_ListModelEvaluations_async", + "title": "automl listModelEvaluations Sample", + "origin": "API_DEFINITION", + "description": " Lists model evaluations.", + "canonical": true, + "file": "auto_ml.list_model_evaluations.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 80, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "ListModelEvaluations", + "fullName": "google.cloud.automl.v1.AutoMl.ListModelEvaluations", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "filter", + "type": "TYPE_STRING" + }, + { + "name": "page_size", + "type": "TYPE_INT32" + }, + { + "name": "page_token", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.automl.v1.ListModelEvaluationsResponse", + "client": { + "shortName": "AutoMlClient", + "fullName": "google.cloud.automl.v1.AutoMlClient" + }, + "method": { + "shortName": "ListModelEvaluations", + "fullName": "google.cloud.automl.v1.AutoMl.ListModelEvaluations", + "service": { + "shortName": "AutoMl", + "fullName": "google.cloud.automl.v1.AutoMl" + } + } + } + }, + { + "regionTag": "automl_v1_generated_PredictionService_Predict_async", + "title": "automl predict Sample", + "origin": "API_DEFINITION", + "description": " Perform an online prediction. The prediction result is directly returned in the response. Available for following ML scenarios, and their expected request payloads: AutoML Vision Classification * An image in .JPEG, .GIF or .PNG format, image_bytes up to 30MB. AutoML Vision Object Detection * An image in .JPEG, .GIF or .PNG format, image_bytes up to 30MB. AutoML Natural Language Classification * A TextSnippet up to 60,000 characters, UTF-8 encoded or a document in .PDF, .TIF or .TIFF format with size upto 2MB. AutoML Natural Language Entity Extraction * A TextSnippet up to 10,000 characters, UTF-8 NFC encoded or a document in .PDF, .TIF or .TIFF format with size upto 20MB. AutoML Natural Language Sentiment Analysis * A TextSnippet up to 60,000 characters, UTF-8 encoded or a document in .PDF, .TIF or .TIFF format with size upto 2MB. AutoML Translation * A TextSnippet up to 25,000 characters, UTF-8 encoded. AutoML Tables * A row with column values matching the columns of the model, up to 5MB. Not available for FORECASTING `prediction_type`.", + "canonical": true, + "file": "prediction_service.predict.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 85, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "Predict", + "fullName": "google.cloud.automl.v1.PredictionService.Predict", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + }, + { + "name": "payload", + "type": ".google.cloud.automl.v1.ExamplePayload" + }, + { + "name": "params", + "type": "TYPE_MESSAGE[]" + } + ], + "resultType": ".google.cloud.automl.v1.PredictResponse", + "client": { + "shortName": "PredictionServiceClient", + "fullName": "google.cloud.automl.v1.PredictionServiceClient" + }, + "method": { + "shortName": "Predict", + "fullName": "google.cloud.automl.v1.PredictionService.Predict", + "service": { + "shortName": "PredictionService", + "fullName": "google.cloud.automl.v1.PredictionService" + } + } + } + }, + { + "regionTag": "automl_v1_generated_PredictionService_BatchPredict_async", + "title": "automl batchPredict Sample", + "origin": "API_DEFINITION", + "description": " Perform a batch prediction. Unlike the online [Predict][google.cloud.automl.v1.PredictionService.Predict], batch prediction result won't be immediately available in the response. Instead, a long running operation object is returned. User can poll the operation result via [GetOperation][google.longrunning.Operations.GetOperation] method. Once the operation is done, [BatchPredictResult][google.cloud.automl.v1.BatchPredictResult] is returned in the [response][google.longrunning.Operation.response] field. Available for following ML scenarios: * AutoML Vision Classification * AutoML Vision Object Detection * AutoML Video Intelligence Classification * AutoML Video Intelligence Object Tracking * AutoML Natural Language Classification * AutoML Natural Language Entity Extraction * AutoML Natural Language Sentiment Analysis * AutoML Tables", + "canonical": true, + "file": "prediction_service.batch_predict.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 133, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "BatchPredict", + "fullName": "google.cloud.automl.v1.PredictionService.BatchPredict", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + }, + { + "name": "input_config", + "type": ".google.cloud.automl.v1.BatchPredictInputConfig" + }, + { + "name": "output_config", + "type": ".google.cloud.automl.v1.BatchPredictOutputConfig" + }, + { + "name": "params", + "type": "TYPE_MESSAGE[]" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "PredictionServiceClient", + "fullName": "google.cloud.automl.v1.PredictionServiceClient" + }, + "method": { + "shortName": "BatchPredict", + "fullName": "google.cloud.automl.v1.PredictionService.BatchPredict", + "service": { + "shortName": "PredictionService", + "fullName": "google.cloud.automl.v1.PredictionService" + } + } + } + } + ] +} \ No newline at end of file diff --git a/packages/google-cloud-automl/samples/generated/v1/snippet_metadata_google.cloud.automl.v1.json b/packages/google-cloud-automl/samples/generated/v1/snippet_metadata_google.cloud.automl.v1.json new file mode 100644 index 00000000000..a5cb05232ba --- /dev/null +++ b/packages/google-cloud-automl/samples/generated/v1/snippet_metadata_google.cloud.automl.v1.json @@ -0,0 +1,907 @@ +{ + "clientLibrary": { + "name": "nodejs-automl", + "version": "4.0.2", + "language": "TYPESCRIPT", + "apis": [ + { + "id": "google.cloud.automl.v1", + "version": "v1" + } + ] + }, + "snippets": [ + { + "regionTag": "automl_v1_generated_AutoMl_CreateDataset_async", + "title": "automl createDataset Sample", + "origin": "API_DEFINITION", + "description": " Creates a dataset.", + "canonical": true, + "file": "auto_ml.create_dataset.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 59, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "CreateDataset", + "fullName": "google.cloud.automl.v1.AutoMl.CreateDataset", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "dataset", + "type": ".google.cloud.automl.v1.Dataset" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "AutoMlClient", + "fullName": "google.cloud.automl.v1.AutoMlClient" + }, + "method": { + "shortName": "CreateDataset", + "fullName": "google.cloud.automl.v1.AutoMl.CreateDataset", + "service": { + "shortName": "AutoMl", + "fullName": "google.cloud.automl.v1.AutoMl" + } + } + } + }, + { + "regionTag": "automl_v1_generated_AutoMl_GetDataset_async", + "title": "automl getDataset Sample", + "origin": "API_DEFINITION", + "description": " Gets a dataset.", + "canonical": true, + "file": "auto_ml.get_dataset.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 53, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "GetDataset", + "fullName": "google.cloud.automl.v1.AutoMl.GetDataset", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.automl.v1.Dataset", + "client": { + "shortName": "AutoMlClient", + "fullName": "google.cloud.automl.v1.AutoMlClient" + }, + "method": { + "shortName": "GetDataset", + "fullName": "google.cloud.automl.v1.AutoMl.GetDataset", + "service": { + "shortName": "AutoMl", + "fullName": "google.cloud.automl.v1.AutoMl" + } + } + } + }, + { + "regionTag": "automl_v1_generated_AutoMl_ListDatasets_async", + "title": "automl listDatasets Sample", + "origin": "API_DEFINITION", + "description": " Lists datasets in a project.", + "canonical": true, + "file": "auto_ml.list_datasets.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 75, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "ListDatasets", + "fullName": "google.cloud.automl.v1.AutoMl.ListDatasets", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "filter", + "type": "TYPE_STRING" + }, + { + "name": "page_size", + "type": "TYPE_INT32" + }, + { + "name": "page_token", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.automl.v1.ListDatasetsResponse", + "client": { + "shortName": "AutoMlClient", + "fullName": "google.cloud.automl.v1.AutoMlClient" + }, + "method": { + "shortName": "ListDatasets", + "fullName": "google.cloud.automl.v1.AutoMl.ListDatasets", + "service": { + "shortName": "AutoMl", + "fullName": "google.cloud.automl.v1.AutoMl" + } + } + } + }, + { + "regionTag": "automl_v1_generated_AutoMl_UpdateDataset_async", + "title": "automl updateDataset Sample", + "origin": "API_DEFINITION", + "description": " Updates a dataset.", + "canonical": true, + "file": "auto_ml.update_dataset.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 58, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "UpdateDataset", + "fullName": "google.cloud.automl.v1.AutoMl.UpdateDataset", + "async": true, + "parameters": [ + { + "name": "dataset", + "type": ".google.cloud.automl.v1.Dataset" + }, + { + "name": "update_mask", + "type": ".google.protobuf.FieldMask" + } + ], + "resultType": ".google.cloud.automl.v1.Dataset", + "client": { + "shortName": "AutoMlClient", + "fullName": "google.cloud.automl.v1.AutoMlClient" + }, + "method": { + "shortName": "UpdateDataset", + "fullName": "google.cloud.automl.v1.AutoMl.UpdateDataset", + "service": { + "shortName": "AutoMl", + "fullName": "google.cloud.automl.v1.AutoMl" + } + } + } + }, + { + "regionTag": "automl_v1_generated_AutoMl_DeleteDataset_async", + "title": "automl deleteDataset Sample", + "origin": "API_DEFINITION", + "description": " Deletes a dataset and all of its contents. Returns empty response in the [response][google.longrunning.Operation.response] field when it completes, and `delete_details` in the [metadata][google.longrunning.Operation.metadata] field.", + "canonical": true, + "file": "auto_ml.delete_dataset.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 54, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "DeleteDataset", + "fullName": "google.cloud.automl.v1.AutoMl.DeleteDataset", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "AutoMlClient", + "fullName": "google.cloud.automl.v1.AutoMlClient" + }, + "method": { + "shortName": "DeleteDataset", + "fullName": "google.cloud.automl.v1.AutoMl.DeleteDataset", + "service": { + "shortName": "AutoMl", + "fullName": "google.cloud.automl.v1.AutoMl" + } + } + } + }, + { + "regionTag": "automl_v1_generated_AutoMl_ImportData_async", + "title": "automl importData Sample", + "origin": "API_DEFINITION", + "description": " Imports data into a dataset. For Tables this method can only be called on an empty Dataset. For Tables: * A [schema_inference_version][google.cloud.automl.v1.InputConfig.params] parameter must be explicitly set. Returns an empty response in the [response][google.longrunning.Operation.response] field when it completes.", + "canonical": true, + "file": "auto_ml.import_data.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 61, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "ImportData", + "fullName": "google.cloud.automl.v1.AutoMl.ImportData", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + }, + { + "name": "input_config", + "type": ".google.cloud.automl.v1.InputConfig" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "AutoMlClient", + "fullName": "google.cloud.automl.v1.AutoMlClient" + }, + "method": { + "shortName": "ImportData", + "fullName": "google.cloud.automl.v1.AutoMl.ImportData", + "service": { + "shortName": "AutoMl", + "fullName": "google.cloud.automl.v1.AutoMl" + } + } + } + }, + { + "regionTag": "automl_v1_generated_AutoMl_ExportData_async", + "title": "automl exportData Sample", + "origin": "API_DEFINITION", + "description": " Exports dataset's data to the provided output location. Returns an empty response in the [response][google.longrunning.Operation.response] field when it completes.", + "canonical": true, + "file": "auto_ml.export_data.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 59, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "ExportData", + "fullName": "google.cloud.automl.v1.AutoMl.ExportData", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + }, + { + "name": "output_config", + "type": ".google.cloud.automl.v1.OutputConfig" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "AutoMlClient", + "fullName": "google.cloud.automl.v1.AutoMlClient" + }, + "method": { + "shortName": "ExportData", + "fullName": "google.cloud.automl.v1.AutoMl.ExportData", + "service": { + "shortName": "AutoMl", + "fullName": "google.cloud.automl.v1.AutoMl" + } + } + } + }, + { + "regionTag": "automl_v1_generated_AutoMl_GetAnnotationSpec_async", + "title": "automl getAnnotationSpec Sample", + "origin": "API_DEFINITION", + "description": " Gets an annotation spec.", + "canonical": true, + "file": "auto_ml.get_annotation_spec.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 53, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "GetAnnotationSpec", + "fullName": "google.cloud.automl.v1.AutoMl.GetAnnotationSpec", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.automl.v1.AnnotationSpec", + "client": { + "shortName": "AutoMlClient", + "fullName": "google.cloud.automl.v1.AutoMlClient" + }, + "method": { + "shortName": "GetAnnotationSpec", + "fullName": "google.cloud.automl.v1.AutoMl.GetAnnotationSpec", + "service": { + "shortName": "AutoMl", + "fullName": "google.cloud.automl.v1.AutoMl" + } + } + } + }, + { + "regionTag": "automl_v1_generated_AutoMl_CreateModel_async", + "title": "automl createModel Sample", + "origin": "API_DEFINITION", + "description": " Creates a model. Returns a Model in the [response][google.longrunning.Operation.response] field when it completes. When you create a model, several model evaluations are created for it: a global evaluation, and one evaluation for each annotation spec.", + "canonical": true, + "file": "auto_ml.create_model.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 59, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "CreateModel", + "fullName": "google.cloud.automl.v1.AutoMl.CreateModel", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "model", + "type": ".google.cloud.automl.v1.Model" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "AutoMlClient", + "fullName": "google.cloud.automl.v1.AutoMlClient" + }, + "method": { + "shortName": "CreateModel", + "fullName": "google.cloud.automl.v1.AutoMl.CreateModel", + "service": { + "shortName": "AutoMl", + "fullName": "google.cloud.automl.v1.AutoMl" + } + } + } + }, + { + "regionTag": "automl_v1_generated_AutoMl_GetModel_async", + "title": "automl getModel Sample", + "origin": "API_DEFINITION", + "description": " Gets a model.", + "canonical": true, + "file": "auto_ml.get_model.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 53, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "GetModel", + "fullName": "google.cloud.automl.v1.AutoMl.GetModel", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.automl.v1.Model", + "client": { + "shortName": "AutoMlClient", + "fullName": "google.cloud.automl.v1.AutoMlClient" + }, + "method": { + "shortName": "GetModel", + "fullName": "google.cloud.automl.v1.AutoMl.GetModel", + "service": { + "shortName": "AutoMl", + "fullName": "google.cloud.automl.v1.AutoMl" + } + } + } + }, + { + "regionTag": "automl_v1_generated_AutoMl_ListModels_async", + "title": "automl listModels Sample", + "origin": "API_DEFINITION", + "description": " Lists models.", + "canonical": true, + "file": "auto_ml.list_models.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 76, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "ListModels", + "fullName": "google.cloud.automl.v1.AutoMl.ListModels", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "filter", + "type": "TYPE_STRING" + }, + { + "name": "page_size", + "type": "TYPE_INT32" + }, + { + "name": "page_token", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.automl.v1.ListModelsResponse", + "client": { + "shortName": "AutoMlClient", + "fullName": "google.cloud.automl.v1.AutoMlClient" + }, + "method": { + "shortName": "ListModels", + "fullName": "google.cloud.automl.v1.AutoMl.ListModels", + "service": { + "shortName": "AutoMl", + "fullName": "google.cloud.automl.v1.AutoMl" + } + } + } + }, + { + "regionTag": "automl_v1_generated_AutoMl_DeleteModel_async", + "title": "automl deleteModel Sample", + "origin": "API_DEFINITION", + "description": " Deletes a model. Returns `google.protobuf.Empty` in the [response][google.longrunning.Operation.response] field when it completes, and `delete_details` in the [metadata][google.longrunning.Operation.metadata] field.", + "canonical": true, + "file": "auto_ml.delete_model.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 54, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "DeleteModel", + "fullName": "google.cloud.automl.v1.AutoMl.DeleteModel", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "AutoMlClient", + "fullName": "google.cloud.automl.v1.AutoMlClient" + }, + "method": { + "shortName": "DeleteModel", + "fullName": "google.cloud.automl.v1.AutoMl.DeleteModel", + "service": { + "shortName": "AutoMl", + "fullName": "google.cloud.automl.v1.AutoMl" + } + } + } + }, + { + "regionTag": "automl_v1_generated_AutoMl_UpdateModel_async", + "title": "automl updateModel Sample", + "origin": "API_DEFINITION", + "description": " Updates a model.", + "canonical": true, + "file": "auto_ml.update_model.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 58, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "UpdateModel", + "fullName": "google.cloud.automl.v1.AutoMl.UpdateModel", + "async": true, + "parameters": [ + { + "name": "model", + "type": ".google.cloud.automl.v1.Model" + }, + { + "name": "update_mask", + "type": ".google.protobuf.FieldMask" + } + ], + "resultType": ".google.cloud.automl.v1.Model", + "client": { + "shortName": "AutoMlClient", + "fullName": "google.cloud.automl.v1.AutoMlClient" + }, + "method": { + "shortName": "UpdateModel", + "fullName": "google.cloud.automl.v1.AutoMl.UpdateModel", + "service": { + "shortName": "AutoMl", + "fullName": "google.cloud.automl.v1.AutoMl" + } + } + } + }, + { + "regionTag": "automl_v1_generated_AutoMl_DeployModel_async", + "title": "automl deployModel Sample", + "origin": "API_DEFINITION", + "description": " Deploys a model. If a model is already deployed, deploying it with the same parameters has no effect. Deploying with different parametrs (as e.g. changing [node_number][google.cloud.automl.v1p1beta.ImageObjectDetectionModelDeploymentMetadata.node_number]) will reset the deployment state without pausing the model's availability. Only applicable for Text Classification, Image Object Detection , Tables, and Image Segmentation; all other domains manage deployment automatically. Returns an empty response in the [response][google.longrunning.Operation.response] field when it completes.", + "canonical": true, + "file": "auto_ml.deploy_model.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 62, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "DeployModel", + "fullName": "google.cloud.automl.v1.AutoMl.DeployModel", + "async": true, + "parameters": [ + { + "name": "image_object_detection_model_deployment_metadata", + "type": ".google.cloud.automl.v1.ImageObjectDetectionModelDeploymentMetadata" + }, + { + "name": "image_classification_model_deployment_metadata", + "type": ".google.cloud.automl.v1.ImageClassificationModelDeploymentMetadata" + }, + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "AutoMlClient", + "fullName": "google.cloud.automl.v1.AutoMlClient" + }, + "method": { + "shortName": "DeployModel", + "fullName": "google.cloud.automl.v1.AutoMl.DeployModel", + "service": { + "shortName": "AutoMl", + "fullName": "google.cloud.automl.v1.AutoMl" + } + } + } + }, + { + "regionTag": "automl_v1_generated_AutoMl_UndeployModel_async", + "title": "automl undeployModel Sample", + "origin": "API_DEFINITION", + "description": " Undeploys a model. If the model is not deployed this method has no effect. Only applicable for Text Classification, Image Object Detection and Tables; all other domains manage deployment automatically. Returns an empty response in the [response][google.longrunning.Operation.response] field when it completes.", + "canonical": true, + "file": "auto_ml.undeploy_model.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 54, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "UndeployModel", + "fullName": "google.cloud.automl.v1.AutoMl.UndeployModel", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "AutoMlClient", + "fullName": "google.cloud.automl.v1.AutoMlClient" + }, + "method": { + "shortName": "UndeployModel", + "fullName": "google.cloud.automl.v1.AutoMl.UndeployModel", + "service": { + "shortName": "AutoMl", + "fullName": "google.cloud.automl.v1.AutoMl" + } + } + } + }, + { + "regionTag": "automl_v1_generated_AutoMl_ExportModel_async", + "title": "automl exportModel Sample", + "origin": "API_DEFINITION", + "description": " Exports a trained, \"export-able\", model to a user specified Google Cloud Storage location. A model is considered export-able if and only if it has an export format defined for it in [ModelExportOutputConfig][google.cloud.automl.v1.ModelExportOutputConfig]. Returns an empty response in the [response][google.longrunning.Operation.response] field when it completes.", + "canonical": true, + "file": "auto_ml.export_model.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 59, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "ExportModel", + "fullName": "google.cloud.automl.v1.AutoMl.ExportModel", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + }, + { + "name": "output_config", + "type": ".google.cloud.automl.v1.ModelExportOutputConfig" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "AutoMlClient", + "fullName": "google.cloud.automl.v1.AutoMlClient" + }, + "method": { + "shortName": "ExportModel", + "fullName": "google.cloud.automl.v1.AutoMl.ExportModel", + "service": { + "shortName": "AutoMl", + "fullName": "google.cloud.automl.v1.AutoMl" + } + } + } + }, + { + "regionTag": "automl_v1_generated_AutoMl_GetModelEvaluation_async", + "title": "automl getModelEvaluation Sample", + "origin": "API_DEFINITION", + "description": " Gets a model evaluation.", + "canonical": true, + "file": "auto_ml.get_model_evaluation.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 53, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "GetModelEvaluation", + "fullName": "google.cloud.automl.v1.AutoMl.GetModelEvaluation", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.automl.v1.ModelEvaluation", + "client": { + "shortName": "AutoMlClient", + "fullName": "google.cloud.automl.v1.AutoMlClient" + }, + "method": { + "shortName": "GetModelEvaluation", + "fullName": "google.cloud.automl.v1.AutoMl.GetModelEvaluation", + "service": { + "shortName": "AutoMl", + "fullName": "google.cloud.automl.v1.AutoMl" + } + } + } + }, + { + "regionTag": "automl_v1_generated_AutoMl_ListModelEvaluations_async", + "title": "automl listModelEvaluations Sample", + "origin": "API_DEFINITION", + "description": " Lists model evaluations.", + "canonical": true, + "file": "auto_ml.list_model_evaluations.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 80, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "ListModelEvaluations", + "fullName": "google.cloud.automl.v1.AutoMl.ListModelEvaluations", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "filter", + "type": "TYPE_STRING" + }, + { + "name": "page_size", + "type": "TYPE_INT32" + }, + { + "name": "page_token", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.automl.v1.ListModelEvaluationsResponse", + "client": { + "shortName": "AutoMlClient", + "fullName": "google.cloud.automl.v1.AutoMlClient" + }, + "method": { + "shortName": "ListModelEvaluations", + "fullName": "google.cloud.automl.v1.AutoMl.ListModelEvaluations", + "service": { + "shortName": "AutoMl", + "fullName": "google.cloud.automl.v1.AutoMl" + } + } + } + }, + { + "regionTag": "automl_v1_generated_PredictionService_Predict_async", + "title": "automl predict Sample", + "origin": "API_DEFINITION", + "description": " Perform an online prediction. The prediction result is directly returned in the response. Available for following ML scenarios, and their expected request payloads: AutoML Vision Classification * An image in .JPEG, .GIF or .PNG format, image_bytes up to 30MB. AutoML Vision Object Detection * An image in .JPEG, .GIF or .PNG format, image_bytes up to 30MB. AutoML Natural Language Classification * A TextSnippet up to 60,000 characters, UTF-8 encoded or a document in .PDF, .TIF or .TIFF format with size upto 2MB. AutoML Natural Language Entity Extraction * A TextSnippet up to 10,000 characters, UTF-8 NFC encoded or a document in .PDF, .TIF or .TIFF format with size upto 20MB. AutoML Natural Language Sentiment Analysis * A TextSnippet up to 60,000 characters, UTF-8 encoded or a document in .PDF, .TIF or .TIFF format with size upto 2MB. AutoML Translation * A TextSnippet up to 25,000 characters, UTF-8 encoded. AutoML Tables * A row with column values matching the columns of the model, up to 5MB. Not available for FORECASTING `prediction_type`.", + "canonical": true, + "file": "prediction_service.predict.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 85, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "Predict", + "fullName": "google.cloud.automl.v1.PredictionService.Predict", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + }, + { + "name": "payload", + "type": ".google.cloud.automl.v1.ExamplePayload" + }, + { + "name": "params", + "type": "TYPE_MESSAGE[]" + } + ], + "resultType": ".google.cloud.automl.v1.PredictResponse", + "client": { + "shortName": "PredictionServiceClient", + "fullName": "google.cloud.automl.v1.PredictionServiceClient" + }, + "method": { + "shortName": "Predict", + "fullName": "google.cloud.automl.v1.PredictionService.Predict", + "service": { + "shortName": "PredictionService", + "fullName": "google.cloud.automl.v1.PredictionService" + } + } + } + }, + { + "regionTag": "automl_v1_generated_PredictionService_BatchPredict_async", + "title": "automl batchPredict Sample", + "origin": "API_DEFINITION", + "description": " Perform a batch prediction. Unlike the online [Predict][google.cloud.automl.v1.PredictionService.Predict], batch prediction result won't be immediately available in the response. Instead, a long running operation object is returned. User can poll the operation result via [GetOperation][google.longrunning.Operations.GetOperation] method. Once the operation is done, [BatchPredictResult][google.cloud.automl.v1.BatchPredictResult] is returned in the [response][google.longrunning.Operation.response] field. Available for following ML scenarios: * AutoML Vision Classification * AutoML Vision Object Detection * AutoML Video Intelligence Classification * AutoML Video Intelligence Object Tracking * AutoML Natural Language Classification * AutoML Natural Language Entity Extraction * AutoML Natural Language Sentiment Analysis * AutoML Tables", + "canonical": true, + "file": "prediction_service.batch_predict.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 133, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "BatchPredict", + "fullName": "google.cloud.automl.v1.PredictionService.BatchPredict", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + }, + { + "name": "input_config", + "type": ".google.cloud.automl.v1.BatchPredictInputConfig" + }, + { + "name": "output_config", + "type": ".google.cloud.automl.v1.BatchPredictOutputConfig" + }, + { + "name": "params", + "type": "TYPE_MESSAGE[]" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "PredictionServiceClient", + "fullName": "google.cloud.automl.v1.PredictionServiceClient" + }, + "method": { + "shortName": "BatchPredict", + "fullName": "google.cloud.automl.v1.PredictionService.BatchPredict", + "service": { + "shortName": "PredictionService", + "fullName": "google.cloud.automl.v1.PredictionService" + } + } + } + } + ] +} \ No newline at end of file diff --git a/packages/google-cloud-automl/samples/generated/v1beta1/auto_ml.create_dataset.js b/packages/google-cloud-automl/samples/generated/v1beta1/auto_ml.create_dataset.js new file mode 100644 index 00000000000..94d9e03dcaa --- /dev/null +++ b/packages/google-cloud-automl/samples/generated/v1beta1/auto_ml.create_dataset.js @@ -0,0 +1,66 @@ +// Copyright 2023 Google LLC +// +// Licensed under the Apache License, Version 2.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, dataset) { + // [START automl_v1beta1_generated_AutoMl_CreateDataset_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 resource name of the project to create the dataset for. + */ + // const parent = 'abc123' + /** + * Required. The dataset to create. + */ + // const dataset = {} + + // Imports the Automl library + const {AutoMlClient} = require('@google-cloud/automl').v1beta1; + + // Instantiates a client + const automlClient = new AutoMlClient(); + + async function callCreateDataset() { + // Construct request + const request = { + parent, + dataset, + }; + + // Run request + const response = await automlClient.createDataset(request); + console.log(response); + } + + callCreateDataset(); + // [END automl_v1beta1_generated_AutoMl_CreateDataset_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-automl/samples/generated/v1beta1/auto_ml.create_model.js b/packages/google-cloud-automl/samples/generated/v1beta1/auto_ml.create_model.js new file mode 100644 index 00000000000..214fc85d2f9 --- /dev/null +++ b/packages/google-cloud-automl/samples/generated/v1beta1/auto_ml.create_model.js @@ -0,0 +1,67 @@ +// Copyright 2023 Google LLC +// +// Licensed under the Apache License, Version 2.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, model) { + // [START automl_v1beta1_generated_AutoMl_CreateModel_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. Resource name of the parent project where the model is being created. + */ + // const parent = 'abc123' + /** + * Required. The model to create. + */ + // const model = {} + + // Imports the Automl library + const {AutoMlClient} = require('@google-cloud/automl').v1beta1; + + // Instantiates a client + const automlClient = new AutoMlClient(); + + async function callCreateModel() { + // Construct request + const request = { + parent, + model, + }; + + // Run request + const [operation] = await automlClient.createModel(request); + const [response] = await operation.promise(); + console.log(response); + } + + callCreateModel(); + // [END automl_v1beta1_generated_AutoMl_CreateModel_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-automl/samples/generated/v1beta1/auto_ml.delete_dataset.js b/packages/google-cloud-automl/samples/generated/v1beta1/auto_ml.delete_dataset.js new file mode 100644 index 00000000000..eeaa8bbb71c --- /dev/null +++ b/packages/google-cloud-automl/samples/generated/v1beta1/auto_ml.delete_dataset.js @@ -0,0 +1,62 @@ +// Copyright 2023 Google LLC +// +// Licensed under the Apache License, Version 2.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 automl_v1beta1_generated_AutoMl_DeleteDataset_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 resource name of the dataset to delete. + */ + // const name = 'abc123' + + // Imports the Automl library + const {AutoMlClient} = require('@google-cloud/automl').v1beta1; + + // Instantiates a client + const automlClient = new AutoMlClient(); + + async function callDeleteDataset() { + // Construct request + const request = { + name, + }; + + // Run request + const [operation] = await automlClient.deleteDataset(request); + const [response] = await operation.promise(); + console.log(response); + } + + callDeleteDataset(); + // [END automl_v1beta1_generated_AutoMl_DeleteDataset_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-automl/samples/generated/v1beta1/auto_ml.delete_model.js b/packages/google-cloud-automl/samples/generated/v1beta1/auto_ml.delete_model.js new file mode 100644 index 00000000000..41beedb4443 --- /dev/null +++ b/packages/google-cloud-automl/samples/generated/v1beta1/auto_ml.delete_model.js @@ -0,0 +1,62 @@ +// Copyright 2023 Google LLC +// +// Licensed under the Apache License, Version 2.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 automl_v1beta1_generated_AutoMl_DeleteModel_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. Resource name of the model being deleted. + */ + // const name = 'abc123' + + // Imports the Automl library + const {AutoMlClient} = require('@google-cloud/automl').v1beta1; + + // Instantiates a client + const automlClient = new AutoMlClient(); + + async function callDeleteModel() { + // Construct request + const request = { + name, + }; + + // Run request + const [operation] = await automlClient.deleteModel(request); + const [response] = await operation.promise(); + console.log(response); + } + + callDeleteModel(); + // [END automl_v1beta1_generated_AutoMl_DeleteModel_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-automl/samples/generated/v1beta1/auto_ml.deploy_model.js b/packages/google-cloud-automl/samples/generated/v1beta1/auto_ml.deploy_model.js new file mode 100644 index 00000000000..f074578247e --- /dev/null +++ b/packages/google-cloud-automl/samples/generated/v1beta1/auto_ml.deploy_model.js @@ -0,0 +1,70 @@ +// Copyright 2023 Google LLC +// +// Licensed under the Apache License, Version 2.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 automl_v1beta1_generated_AutoMl_DeployModel_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. + */ + /** + * Model deployment metadata specific to Image Object Detection. + */ + // const imageObjectDetectionModelDeploymentMetadata = {} + /** + * Model deployment metadata specific to Image Classification. + */ + // const imageClassificationModelDeploymentMetadata = {} + /** + * Required. Resource name of the model to deploy. + */ + // const name = 'abc123' + + // Imports the Automl library + const {AutoMlClient} = require('@google-cloud/automl').v1beta1; + + // Instantiates a client + const automlClient = new AutoMlClient(); + + async function callDeployModel() { + // Construct request + const request = { + name, + }; + + // Run request + const [operation] = await automlClient.deployModel(request); + const [response] = await operation.promise(); + console.log(response); + } + + callDeployModel(); + // [END automl_v1beta1_generated_AutoMl_DeployModel_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-automl/samples/generated/v1beta1/auto_ml.export_data.js b/packages/google-cloud-automl/samples/generated/v1beta1/auto_ml.export_data.js new file mode 100644 index 00000000000..9216d524f48 --- /dev/null +++ b/packages/google-cloud-automl/samples/generated/v1beta1/auto_ml.export_data.js @@ -0,0 +1,67 @@ +// Copyright 2023 Google LLC +// +// Licensed under the Apache License, Version 2.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, outputConfig) { + // [START automl_v1beta1_generated_AutoMl_ExportData_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 resource name of the dataset. + */ + // const name = 'abc123' + /** + * Required. The desired output location. + */ + // const outputConfig = {} + + // Imports the Automl library + const {AutoMlClient} = require('@google-cloud/automl').v1beta1; + + // Instantiates a client + const automlClient = new AutoMlClient(); + + async function callExportData() { + // Construct request + const request = { + name, + outputConfig, + }; + + // Run request + const [operation] = await automlClient.exportData(request); + const [response] = await operation.promise(); + console.log(response); + } + + callExportData(); + // [END automl_v1beta1_generated_AutoMl_ExportData_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-automl/samples/generated/v1beta1/auto_ml.export_evaluated_examples.js b/packages/google-cloud-automl/samples/generated/v1beta1/auto_ml.export_evaluated_examples.js new file mode 100644 index 00000000000..a58e2827e64 --- /dev/null +++ b/packages/google-cloud-automl/samples/generated/v1beta1/auto_ml.export_evaluated_examples.js @@ -0,0 +1,68 @@ +// Copyright 2023 Google LLC +// +// Licensed under the Apache License, Version 2.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, outputConfig) { + // [START automl_v1beta1_generated_AutoMl_ExportEvaluatedExamples_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 resource name of the model whose evaluated examples are to + * be exported. + */ + // const name = 'abc123' + /** + * Required. The desired output location and configuration. + */ + // const outputConfig = {} + + // Imports the Automl library + const {AutoMlClient} = require('@google-cloud/automl').v1beta1; + + // Instantiates a client + const automlClient = new AutoMlClient(); + + async function callExportEvaluatedExamples() { + // Construct request + const request = { + name, + outputConfig, + }; + + // Run request + const [operation] = await automlClient.exportEvaluatedExamples(request); + const [response] = await operation.promise(); + console.log(response); + } + + callExportEvaluatedExamples(); + // [END automl_v1beta1_generated_AutoMl_ExportEvaluatedExamples_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-automl/samples/generated/v1beta1/auto_ml.export_model.js b/packages/google-cloud-automl/samples/generated/v1beta1/auto_ml.export_model.js new file mode 100644 index 00000000000..ccdc3f36c97 --- /dev/null +++ b/packages/google-cloud-automl/samples/generated/v1beta1/auto_ml.export_model.js @@ -0,0 +1,67 @@ +// Copyright 2023 Google LLC +// +// Licensed under the Apache License, Version 2.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, outputConfig) { + // [START automl_v1beta1_generated_AutoMl_ExportModel_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 resource name of the model to export. + */ + // const name = 'abc123' + /** + * Required. The desired output location and configuration. + */ + // const outputConfig = {} + + // Imports the Automl library + const {AutoMlClient} = require('@google-cloud/automl').v1beta1; + + // Instantiates a client + const automlClient = new AutoMlClient(); + + async function callExportModel() { + // Construct request + const request = { + name, + outputConfig, + }; + + // Run request + const [operation] = await automlClient.exportModel(request); + const [response] = await operation.promise(); + console.log(response); + } + + callExportModel(); + // [END automl_v1beta1_generated_AutoMl_ExportModel_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-automl/samples/generated/v1beta1/auto_ml.get_annotation_spec.js b/packages/google-cloud-automl/samples/generated/v1beta1/auto_ml.get_annotation_spec.js new file mode 100644 index 00000000000..ce6b959935d --- /dev/null +++ b/packages/google-cloud-automl/samples/generated/v1beta1/auto_ml.get_annotation_spec.js @@ -0,0 +1,61 @@ +// Copyright 2023 Google LLC +// +// Licensed under the Apache License, Version 2.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 automl_v1beta1_generated_AutoMl_GetAnnotationSpec_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 resource name of the annotation spec to retrieve. + */ + // const name = 'abc123' + + // Imports the Automl library + const {AutoMlClient} = require('@google-cloud/automl').v1beta1; + + // Instantiates a client + const automlClient = new AutoMlClient(); + + async function callGetAnnotationSpec() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await automlClient.getAnnotationSpec(request); + console.log(response); + } + + callGetAnnotationSpec(); + // [END automl_v1beta1_generated_AutoMl_GetAnnotationSpec_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-automl/samples/generated/v1beta1/auto_ml.get_column_spec.js b/packages/google-cloud-automl/samples/generated/v1beta1/auto_ml.get_column_spec.js new file mode 100644 index 00000000000..c958e329441 --- /dev/null +++ b/packages/google-cloud-automl/samples/generated/v1beta1/auto_ml.get_column_spec.js @@ -0,0 +1,65 @@ +// Copyright 2023 Google LLC +// +// Licensed under the Apache License, Version 2.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 automl_v1beta1_generated_AutoMl_GetColumnSpec_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 resource name of the column spec to retrieve. + */ + // const name = 'abc123' + /** + * Mask specifying which fields to read. + */ + // const fieldMask = {} + + // Imports the Automl library + const {AutoMlClient} = require('@google-cloud/automl').v1beta1; + + // Instantiates a client + const automlClient = new AutoMlClient(); + + async function callGetColumnSpec() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await automlClient.getColumnSpec(request); + console.log(response); + } + + callGetColumnSpec(); + // [END automl_v1beta1_generated_AutoMl_GetColumnSpec_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-automl/samples/generated/v1beta1/auto_ml.get_dataset.js b/packages/google-cloud-automl/samples/generated/v1beta1/auto_ml.get_dataset.js new file mode 100644 index 00000000000..05cf1a6e5cc --- /dev/null +++ b/packages/google-cloud-automl/samples/generated/v1beta1/auto_ml.get_dataset.js @@ -0,0 +1,61 @@ +// Copyright 2023 Google LLC +// +// Licensed under the Apache License, Version 2.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 automl_v1beta1_generated_AutoMl_GetDataset_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 resource name of the dataset to retrieve. + */ + // const name = 'abc123' + + // Imports the Automl library + const {AutoMlClient} = require('@google-cloud/automl').v1beta1; + + // Instantiates a client + const automlClient = new AutoMlClient(); + + async function callGetDataset() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await automlClient.getDataset(request); + console.log(response); + } + + callGetDataset(); + // [END automl_v1beta1_generated_AutoMl_GetDataset_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-automl/samples/generated/v1beta1/auto_ml.get_model.js b/packages/google-cloud-automl/samples/generated/v1beta1/auto_ml.get_model.js new file mode 100644 index 00000000000..fabf33d25d5 --- /dev/null +++ b/packages/google-cloud-automl/samples/generated/v1beta1/auto_ml.get_model.js @@ -0,0 +1,61 @@ +// Copyright 2023 Google LLC +// +// Licensed under the Apache License, Version 2.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 automl_v1beta1_generated_AutoMl_GetModel_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. Resource name of the model. + */ + // const name = 'abc123' + + // Imports the Automl library + const {AutoMlClient} = require('@google-cloud/automl').v1beta1; + + // Instantiates a client + const automlClient = new AutoMlClient(); + + async function callGetModel() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await automlClient.getModel(request); + console.log(response); + } + + callGetModel(); + // [END automl_v1beta1_generated_AutoMl_GetModel_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-automl/samples/generated/v1beta1/auto_ml.get_model_evaluation.js b/packages/google-cloud-automl/samples/generated/v1beta1/auto_ml.get_model_evaluation.js new file mode 100644 index 00000000000..10b9e7b8e87 --- /dev/null +++ b/packages/google-cloud-automl/samples/generated/v1beta1/auto_ml.get_model_evaluation.js @@ -0,0 +1,61 @@ +// Copyright 2023 Google LLC +// +// Licensed under the Apache License, Version 2.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 automl_v1beta1_generated_AutoMl_GetModelEvaluation_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. Resource name for the model evaluation. + */ + // const name = 'abc123' + + // Imports the Automl library + const {AutoMlClient} = require('@google-cloud/automl').v1beta1; + + // Instantiates a client + const automlClient = new AutoMlClient(); + + async function callGetModelEvaluation() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await automlClient.getModelEvaluation(request); + console.log(response); + } + + callGetModelEvaluation(); + // [END automl_v1beta1_generated_AutoMl_GetModelEvaluation_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-automl/samples/generated/v1beta1/auto_ml.get_table_spec.js b/packages/google-cloud-automl/samples/generated/v1beta1/auto_ml.get_table_spec.js new file mode 100644 index 00000000000..dd665f67d40 --- /dev/null +++ b/packages/google-cloud-automl/samples/generated/v1beta1/auto_ml.get_table_spec.js @@ -0,0 +1,65 @@ +// Copyright 2023 Google LLC +// +// Licensed under the Apache License, Version 2.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 automl_v1beta1_generated_AutoMl_GetTableSpec_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 resource name of the table spec to retrieve. + */ + // const name = 'abc123' + /** + * Mask specifying which fields to read. + */ + // const fieldMask = {} + + // Imports the Automl library + const {AutoMlClient} = require('@google-cloud/automl').v1beta1; + + // Instantiates a client + const automlClient = new AutoMlClient(); + + async function callGetTableSpec() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await automlClient.getTableSpec(request); + console.log(response); + } + + callGetTableSpec(); + // [END automl_v1beta1_generated_AutoMl_GetTableSpec_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-automl/samples/generated/v1beta1/auto_ml.import_data.js b/packages/google-cloud-automl/samples/generated/v1beta1/auto_ml.import_data.js new file mode 100644 index 00000000000..58fea1a5bb0 --- /dev/null +++ b/packages/google-cloud-automl/samples/generated/v1beta1/auto_ml.import_data.js @@ -0,0 +1,69 @@ +// Copyright 2023 Google LLC +// +// Licensed under the Apache License, Version 2.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, inputConfig) { + // [START automl_v1beta1_generated_AutoMl_ImportData_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. Dataset name. Dataset must already exist. All imported + * annotations and examples will be added. + */ + // const name = 'abc123' + /** + * Required. The desired input location and its domain specific semantics, + * if any. + */ + // const inputConfig = {} + + // Imports the Automl library + const {AutoMlClient} = require('@google-cloud/automl').v1beta1; + + // Instantiates a client + const automlClient = new AutoMlClient(); + + async function callImportData() { + // Construct request + const request = { + name, + inputConfig, + }; + + // Run request + const [operation] = await automlClient.importData(request); + const [response] = await operation.promise(); + console.log(response); + } + + callImportData(); + // [END automl_v1beta1_generated_AutoMl_ImportData_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-automl/samples/generated/v1beta1/auto_ml.list_column_specs.js b/packages/google-cloud-automl/samples/generated/v1beta1/auto_ml.list_column_specs.js new file mode 100644 index 00000000000..eab1faabd7b --- /dev/null +++ b/packages/google-cloud-automl/samples/generated/v1beta1/auto_ml.list_column_specs.js @@ -0,0 +1,83 @@ +// Copyright 2023 Google LLC +// +// Licensed under the Apache License, Version 2.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 automl_v1beta1_generated_AutoMl_ListColumnSpecs_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 resource name of the table spec to list column specs from. + */ + // const parent = 'abc123' + /** + * Mask specifying which fields to read. + */ + // const fieldMask = {} + /** + * Filter expression, see go/filtering. + */ + // const filter = 'abc123' + /** + * Requested page size. The server can return fewer results than requested. + * If unspecified, the server will pick a default size. + */ + // const pageSize = 1234 + /** + * A token identifying a page of results for the server to return. + * Typically obtained from the + * ListColumnSpecsResponse.next_page_token google.cloud.automl.v1beta1.ListColumnSpecsResponse.next_page_token field of the previous + * AutoMl.ListColumnSpecs google.cloud.automl.v1beta1.AutoMl.ListColumnSpecs call. + */ + // const pageToken = 'abc123' + + // Imports the Automl library + const {AutoMlClient} = require('@google-cloud/automl').v1beta1; + + // Instantiates a client + const automlClient = new AutoMlClient(); + + async function callListColumnSpecs() { + // Construct request + const request = { + parent, + }; + + // Run request + const iterable = await automlClient.listColumnSpecsAsync(request); + for await (const response of iterable) { + console.log(response); + } + } + + callListColumnSpecs(); + // [END automl_v1beta1_generated_AutoMl_ListColumnSpecs_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-automl/samples/generated/v1beta1/auto_ml.list_datasets.js b/packages/google-cloud-automl/samples/generated/v1beta1/auto_ml.list_datasets.js new file mode 100644 index 00000000000..98315294040 --- /dev/null +++ b/packages/google-cloud-automl/samples/generated/v1beta1/auto_ml.list_datasets.js @@ -0,0 +1,84 @@ +// Copyright 2023 Google LLC +// +// Licensed under the Apache License, Version 2.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 automl_v1beta1_generated_AutoMl_ListDatasets_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 resource name of the project from which to list datasets. + */ + // const parent = 'abc123' + /** + * An expression for filtering the results of the request. + * * `dataset_metadata` - for existence of the case (e.g. + * `image_classification_dataset_metadata:*`). Some examples of + * using the filter are: + * * `translation_dataset_metadata:*` --> The dataset has + * `translation_dataset_metadata`. + */ + // const filter = 'abc123' + /** + * Requested page size. Server may return fewer results than requested. + * If unspecified, server will pick a default size. + */ + // const pageSize = 1234 + /** + * A token identifying a page of results for the server to return + * Typically obtained via + * ListDatasetsResponse.next_page_token google.cloud.automl.v1beta1.ListDatasetsResponse.next_page_token of the previous + * AutoMl.ListDatasets google.cloud.automl.v1beta1.AutoMl.ListDatasets call. + */ + // const pageToken = 'abc123' + + // Imports the Automl library + const {AutoMlClient} = require('@google-cloud/automl').v1beta1; + + // Instantiates a client + const automlClient = new AutoMlClient(); + + async function callListDatasets() { + // Construct request + const request = { + parent, + }; + + // Run request + const iterable = await automlClient.listDatasetsAsync(request); + for await (const response of iterable) { + console.log(response); + } + } + + callListDatasets(); + // [END automl_v1beta1_generated_AutoMl_ListDatasets_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-automl/samples/generated/v1beta1/auto_ml.list_model_evaluations.js b/packages/google-cloud-automl/samples/generated/v1beta1/auto_ml.list_model_evaluations.js new file mode 100644 index 00000000000..1c2add7392f --- /dev/null +++ b/packages/google-cloud-automl/samples/generated/v1beta1/auto_ml.list_model_evaluations.js @@ -0,0 +1,87 @@ +// Copyright 2023 Google LLC +// +// Licensed under the Apache License, Version 2.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 automl_v1beta1_generated_AutoMl_ListModelEvaluations_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. Resource name of the model to list the model evaluations for. + * If modelId is set as "-", this will list model evaluations from across all + * models of the parent location. + */ + // const parent = 'abc123' + /** + * An expression for filtering the results of the request. + * * `annotation_spec_id` - for =, != or existence. See example below for + * the last. + * Some examples of using the filter are: + * * `annotation_spec_id!=4` --> The model evaluation was done for + * annotation spec with ID different than 4. + * * `NOT annotation_spec_id:*` --> The model evaluation was done for + * aggregate of all annotation specs. + */ + // const filter = 'abc123' + /** + * Requested page size. + */ + // const pageSize = 1234 + /** + * A token identifying a page of results for the server to return. + * Typically obtained via + * ListModelEvaluationsResponse.next_page_token google.cloud.automl.v1beta1.ListModelEvaluationsResponse.next_page_token of the previous + * AutoMl.ListModelEvaluations google.cloud.automl.v1beta1.AutoMl.ListModelEvaluations call. + */ + // const pageToken = 'abc123' + + // Imports the Automl library + const {AutoMlClient} = require('@google-cloud/automl').v1beta1; + + // Instantiates a client + const automlClient = new AutoMlClient(); + + async function callListModelEvaluations() { + // Construct request + const request = { + parent, + }; + + // Run request + const iterable = await automlClient.listModelEvaluationsAsync(request); + for await (const response of iterable) { + console.log(response); + } + } + + callListModelEvaluations(); + // [END automl_v1beta1_generated_AutoMl_ListModelEvaluations_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-automl/samples/generated/v1beta1/auto_ml.list_models.js b/packages/google-cloud-automl/samples/generated/v1beta1/auto_ml.list_models.js new file mode 100644 index 00000000000..a157f91485b --- /dev/null +++ b/packages/google-cloud-automl/samples/generated/v1beta1/auto_ml.list_models.js @@ -0,0 +1,84 @@ +// Copyright 2023 Google LLC +// +// Licensed under the Apache License, Version 2.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 automl_v1beta1_generated_AutoMl_ListModels_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. Resource name of the project, from which to list the models. + */ + // const parent = 'abc123' + /** + * An expression for filtering the results of the request. + * * `model_metadata` - for existence of the case (e.g. + * `video_classification_model_metadata:*`). + * * `dataset_id` - for = or !=. Some examples of using the filter are: + * * `image_classification_model_metadata:*` --> The model has + * `image_classification_model_metadata`. + * * `dataset_id=5` --> The model was created from a dataset with ID 5. + */ + // const filter = 'abc123' + /** + * Requested page size. + */ + // const pageSize = 1234 + /** + * A token identifying a page of results for the server to return + * Typically obtained via + * ListModelsResponse.next_page_token google.cloud.automl.v1beta1.ListModelsResponse.next_page_token of the previous + * AutoMl.ListModels google.cloud.automl.v1beta1.AutoMl.ListModels call. + */ + // const pageToken = 'abc123' + + // Imports the Automl library + const {AutoMlClient} = require('@google-cloud/automl').v1beta1; + + // Instantiates a client + const automlClient = new AutoMlClient(); + + async function callListModels() { + // Construct request + const request = { + parent, + }; + + // Run request + const iterable = await automlClient.listModelsAsync(request); + for await (const response of iterable) { + console.log(response); + } + } + + callListModels(); + // [END automl_v1beta1_generated_AutoMl_ListModels_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-automl/samples/generated/v1beta1/auto_ml.list_table_specs.js b/packages/google-cloud-automl/samples/generated/v1beta1/auto_ml.list_table_specs.js new file mode 100644 index 00000000000..46f95c6d3a9 --- /dev/null +++ b/packages/google-cloud-automl/samples/generated/v1beta1/auto_ml.list_table_specs.js @@ -0,0 +1,83 @@ +// Copyright 2023 Google LLC +// +// Licensed under the Apache License, Version 2.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 automl_v1beta1_generated_AutoMl_ListTableSpecs_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 resource name of the dataset to list table specs from. + */ + // const parent = 'abc123' + /** + * Mask specifying which fields to read. + */ + // const fieldMask = {} + /** + * Filter expression, see go/filtering. + */ + // const filter = 'abc123' + /** + * Requested page size. The server can return fewer results than requested. + * If unspecified, the server will pick a default size. + */ + // const pageSize = 1234 + /** + * A token identifying a page of results for the server to return. + * Typically obtained from the + * ListTableSpecsResponse.next_page_token google.cloud.automl.v1beta1.ListTableSpecsResponse.next_page_token field of the previous + * AutoMl.ListTableSpecs google.cloud.automl.v1beta1.AutoMl.ListTableSpecs call. + */ + // const pageToken = 'abc123' + + // Imports the Automl library + const {AutoMlClient} = require('@google-cloud/automl').v1beta1; + + // Instantiates a client + const automlClient = new AutoMlClient(); + + async function callListTableSpecs() { + // Construct request + const request = { + parent, + }; + + // Run request + const iterable = await automlClient.listTableSpecsAsync(request); + for await (const response of iterable) { + console.log(response); + } + } + + callListTableSpecs(); + // [END automl_v1beta1_generated_AutoMl_ListTableSpecs_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-automl/samples/generated/v1beta1/auto_ml.undeploy_model.js b/packages/google-cloud-automl/samples/generated/v1beta1/auto_ml.undeploy_model.js new file mode 100644 index 00000000000..7af99326c79 --- /dev/null +++ b/packages/google-cloud-automl/samples/generated/v1beta1/auto_ml.undeploy_model.js @@ -0,0 +1,62 @@ +// Copyright 2023 Google LLC +// +// Licensed under the Apache License, Version 2.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 automl_v1beta1_generated_AutoMl_UndeployModel_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. Resource name of the model to undeploy. + */ + // const name = 'abc123' + + // Imports the Automl library + const {AutoMlClient} = require('@google-cloud/automl').v1beta1; + + // Instantiates a client + const automlClient = new AutoMlClient(); + + async function callUndeployModel() { + // Construct request + const request = { + name, + }; + + // Run request + const [operation] = await automlClient.undeployModel(request); + const [response] = await operation.promise(); + console.log(response); + } + + callUndeployModel(); + // [END automl_v1beta1_generated_AutoMl_UndeployModel_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-automl/samples/generated/v1beta1/auto_ml.update_column_spec.js b/packages/google-cloud-automl/samples/generated/v1beta1/auto_ml.update_column_spec.js new file mode 100644 index 00000000000..424f65a0042 --- /dev/null +++ b/packages/google-cloud-automl/samples/generated/v1beta1/auto_ml.update_column_spec.js @@ -0,0 +1,65 @@ +// Copyright 2023 Google LLC +// +// Licensed under the Apache License, Version 2.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(columnSpec) { + // [START automl_v1beta1_generated_AutoMl_UpdateColumnSpec_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 column spec which replaces the resource on the server. + */ + // const columnSpec = {} + /** + * The update mask applies to the resource. + */ + // const updateMask = {} + + // Imports the Automl library + const {AutoMlClient} = require('@google-cloud/automl').v1beta1; + + // Instantiates a client + const automlClient = new AutoMlClient(); + + async function callUpdateColumnSpec() { + // Construct request + const request = { + columnSpec, + }; + + // Run request + const response = await automlClient.updateColumnSpec(request); + console.log(response); + } + + callUpdateColumnSpec(); + // [END automl_v1beta1_generated_AutoMl_UpdateColumnSpec_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-automl/samples/generated/v1beta1/auto_ml.update_dataset.js b/packages/google-cloud-automl/samples/generated/v1beta1/auto_ml.update_dataset.js new file mode 100644 index 00000000000..1e782b62195 --- /dev/null +++ b/packages/google-cloud-automl/samples/generated/v1beta1/auto_ml.update_dataset.js @@ -0,0 +1,65 @@ +// Copyright 2023 Google LLC +// +// Licensed under the Apache License, Version 2.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(dataset) { + // [START automl_v1beta1_generated_AutoMl_UpdateDataset_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 dataset which replaces the resource on the server. + */ + // const dataset = {} + /** + * The update mask applies to the resource. + */ + // const updateMask = {} + + // Imports the Automl library + const {AutoMlClient} = require('@google-cloud/automl').v1beta1; + + // Instantiates a client + const automlClient = new AutoMlClient(); + + async function callUpdateDataset() { + // Construct request + const request = { + dataset, + }; + + // Run request + const response = await automlClient.updateDataset(request); + console.log(response); + } + + callUpdateDataset(); + // [END automl_v1beta1_generated_AutoMl_UpdateDataset_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-automl/samples/generated/v1beta1/auto_ml.update_table_spec.js b/packages/google-cloud-automl/samples/generated/v1beta1/auto_ml.update_table_spec.js new file mode 100644 index 00000000000..68fecefaa93 --- /dev/null +++ b/packages/google-cloud-automl/samples/generated/v1beta1/auto_ml.update_table_spec.js @@ -0,0 +1,65 @@ +// Copyright 2023 Google LLC +// +// Licensed under the Apache License, Version 2.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(tableSpec) { + // [START automl_v1beta1_generated_AutoMl_UpdateTableSpec_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 table spec which replaces the resource on the server. + */ + // const tableSpec = {} + /** + * The update mask applies to the resource. + */ + // const updateMask = {} + + // Imports the Automl library + const {AutoMlClient} = require('@google-cloud/automl').v1beta1; + + // Instantiates a client + const automlClient = new AutoMlClient(); + + async function callUpdateTableSpec() { + // Construct request + const request = { + tableSpec, + }; + + // Run request + const response = await automlClient.updateTableSpec(request); + console.log(response); + } + + callUpdateTableSpec(); + // [END automl_v1beta1_generated_AutoMl_UpdateTableSpec_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-automl/samples/generated/v1beta1/prediction_service.batch_predict.js b/packages/google-cloud-automl/samples/generated/v1beta1/prediction_service.batch_predict.js new file mode 100644 index 00000000000..57e2b419a52 --- /dev/null +++ b/packages/google-cloud-automl/samples/generated/v1beta1/prediction_service.batch_predict.js @@ -0,0 +1,135 @@ +// Copyright 2023 Google LLC +// +// Licensed under the Apache License, Version 2.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, inputConfig, outputConfig, params) { + // [START automl_v1beta1_generated_PredictionService_BatchPredict_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. Name of the model requested to serve the batch prediction. + */ + // const name = 'abc123' + /** + * Required. The input configuration for batch prediction. + */ + // const inputConfig = {} + /** + * Required. The Configuration specifying where output predictions should + * be written. + */ + // const outputConfig = {} + /** + * Required. Additional domain-specific parameters for the predictions, any string must + * be up to 25000 characters long. + * * For Text Classification: + * `score_threshold` - (float) A value from 0.0 to 1.0. When the model + * makes predictions for a text snippet, it will only produce results + * that have at least this confidence score. The default is 0.5. + * * For Image Classification: + * `score_threshold` - (float) A value from 0.0 to 1.0. When the model + * makes predictions for an image, it will only produce results that + * have at least this confidence score. The default is 0.5. + * * For Image Object Detection: + * `score_threshold` - (float) When Model detects objects on the image, + * it will only produce bounding boxes which have at least this + * confidence score. Value in 0 to 1 range, default is 0.5. + * `max_bounding_box_count` - (int64) No more than this number of bounding + * boxes will be produced per image. Default is 100, the + * requested value may be limited by server. + * * For Video Classification : + * `score_threshold` - (float) A value from 0.0 to 1.0. When the model + * makes predictions for a video, it will only produce results that + * have at least this confidence score. The default is 0.5. + * `segment_classification` - (boolean) Set to true to request + * segment-level classification. AutoML Video Intelligence returns + * labels and their confidence scores for the entire segment of the + * video that user specified in the request configuration. + * The default is "true". + * `shot_classification` - (boolean) Set to true to request shot-level + * classification. AutoML Video Intelligence determines the boundaries + * for each camera shot in the entire segment of the video that user + * specified in the request configuration. AutoML Video Intelligence + * then returns labels and their confidence scores for each detected + * shot, along with the start and end time of the shot. + * WARNING: Model evaluation is not done for this classification type, + * the quality of it depends on training data, but there are no metrics + * provided to describe that quality. The default is "false". + * `1s_interval_classification` - (boolean) Set to true to request + * classification for a video at one-second intervals. AutoML Video + * Intelligence returns labels and their confidence scores for each + * second of the entire segment of the video that user specified in the + * request configuration. + * WARNING: Model evaluation is not done for this classification + * type, the quality of it depends on training data, but there are no + * metrics provided to describe that quality. The default is + * "false". + * * For Tables: + * feature_importance - (boolean) Whether feature importance + * should be populated in the returned TablesAnnotations. The + * default is false. + * * For Video Object Tracking: + * `score_threshold` - (float) When Model detects objects on video frames, + * it will only produce bounding boxes which have at least this + * confidence score. Value in 0 to 1 range, default is 0.5. + * `max_bounding_box_count` - (int64) No more than this number of bounding + * boxes will be returned per frame. Default is 100, the requested + * value may be limited by server. + * `min_bounding_box_size` - (float) Only bounding boxes with shortest edge + * at least that long as a relative value of video frame size will be + * returned. Value in 0 to 1 range. Default is 0. + */ + // const params = [1,2,3,4] + + // Imports the Automl library + const {PredictionServiceClient} = require('@google-cloud/automl').v1beta1; + + // Instantiates a client + const automlClient = new PredictionServiceClient(); + + async function callBatchPredict() { + // Construct request + const request = { + name, + inputConfig, + outputConfig, + params, + }; + + // Run request + const [operation] = await automlClient.batchPredict(request); + const [response] = await operation.promise(); + console.log(response); + } + + callBatchPredict(); + // [END automl_v1beta1_generated_PredictionService_BatchPredict_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-automl/samples/generated/v1beta1/prediction_service.predict.js b/packages/google-cloud-automl/samples/generated/v1beta1/prediction_service.predict.js new file mode 100644 index 00000000000..1ae50901843 --- /dev/null +++ b/packages/google-cloud-automl/samples/generated/v1beta1/prediction_service.predict.js @@ -0,0 +1,87 @@ +// Copyright 2023 Google LLC +// +// Licensed under the Apache License, Version 2.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, payload) { + // [START automl_v1beta1_generated_PredictionService_Predict_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. Name of the model requested to serve the prediction. + */ + // const name = 'abc123' + /** + * Required. Payload to perform a prediction on. The payload must match the + * problem type that the model was trained to solve. + */ + // const payload = {} + /** + * Additional domain-specific parameters, any string must be up to 25000 + * characters long. + * * For Image Classification: + * `score_threshold` - (float) A value from 0.0 to 1.0. When the model + * makes predictions for an image, it will only produce results that have + * at least this confidence score. The default is 0.5. + * * For Image Object Detection: + * `score_threshold` - (float) When Model detects objects on the image, + * it will only produce bounding boxes which have at least this + * confidence score. Value in 0 to 1 range, default is 0.5. + * `max_bounding_box_count` - (int64) No more than this number of bounding + * boxes will be returned in the response. Default is 100, the + * requested value may be limited by server. + * * For Tables: + * feature_importance - (boolean) Whether feature importance + * should be populated in the returned TablesAnnotation. + * The default is false. + */ + // const params = [1,2,3,4] + + // Imports the Automl library + const {PredictionServiceClient} = require('@google-cloud/automl').v1beta1; + + // Instantiates a client + const automlClient = new PredictionServiceClient(); + + async function callPredict() { + // Construct request + const request = { + name, + payload, + }; + + // Run request + const response = await automlClient.predict(request); + console.log(response); + } + + callPredict(); + // [END automl_v1beta1_generated_PredictionService_Predict_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-automl/samples/generated/v1beta1/snippet_metadata.google.cloud.automl.v1beta1.json b/packages/google-cloud-automl/samples/generated/v1beta1/snippet_metadata.google.cloud.automl.v1beta1.json new file mode 100644 index 00000000000..24edb8dc6dd --- /dev/null +++ b/packages/google-cloud-automl/samples/generated/v1beta1/snippet_metadata.google.cloud.automl.v1beta1.json @@ -0,0 +1,1195 @@ +{ + "clientLibrary": { + "name": "nodejs-automl", + "version": "4.0.2", + "language": "TYPESCRIPT", + "apis": [ + { + "id": "google.cloud.automl.v1beta1", + "version": "v1beta1" + } + ] + }, + "snippets": [ + { + "regionTag": "automl_v1beta1_generated_AutoMl_CreateDataset_async", + "title": "automl createDataset Sample", + "origin": "API_DEFINITION", + "description": " Creates a dataset.", + "canonical": true, + "file": "auto_ml.create_dataset.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 58, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "CreateDataset", + "fullName": "google.cloud.automl.v1beta1.AutoMl.CreateDataset", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "dataset", + "type": ".google.cloud.automl.v1beta1.Dataset" + } + ], + "resultType": ".google.cloud.automl.v1beta1.Dataset", + "client": { + "shortName": "AutoMlClient", + "fullName": "google.cloud.automl.v1beta1.AutoMlClient" + }, + "method": { + "shortName": "CreateDataset", + "fullName": "google.cloud.automl.v1beta1.AutoMl.CreateDataset", + "service": { + "shortName": "AutoMl", + "fullName": "google.cloud.automl.v1beta1.AutoMl" + } + } + } + }, + { + "regionTag": "automl_v1beta1_generated_AutoMl_GetDataset_async", + "title": "automl getDataset Sample", + "origin": "API_DEFINITION", + "description": " Gets a dataset.", + "canonical": true, + "file": "auto_ml.get_dataset.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 53, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "GetDataset", + "fullName": "google.cloud.automl.v1beta1.AutoMl.GetDataset", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.automl.v1beta1.Dataset", + "client": { + "shortName": "AutoMlClient", + "fullName": "google.cloud.automl.v1beta1.AutoMlClient" + }, + "method": { + "shortName": "GetDataset", + "fullName": "google.cloud.automl.v1beta1.AutoMl.GetDataset", + "service": { + "shortName": "AutoMl", + "fullName": "google.cloud.automl.v1beta1.AutoMl" + } + } + } + }, + { + "regionTag": "automl_v1beta1_generated_AutoMl_ListDatasets_async", + "title": "automl listDatasets Sample", + "origin": "API_DEFINITION", + "description": " Lists datasets in a project.", + "canonical": true, + "file": "auto_ml.list_datasets.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 76, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "ListDatasets", + "fullName": "google.cloud.automl.v1beta1.AutoMl.ListDatasets", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "filter", + "type": "TYPE_STRING" + }, + { + "name": "page_size", + "type": "TYPE_INT32" + }, + { + "name": "page_token", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.automl.v1beta1.ListDatasetsResponse", + "client": { + "shortName": "AutoMlClient", + "fullName": "google.cloud.automl.v1beta1.AutoMlClient" + }, + "method": { + "shortName": "ListDatasets", + "fullName": "google.cloud.automl.v1beta1.AutoMl.ListDatasets", + "service": { + "shortName": "AutoMl", + "fullName": "google.cloud.automl.v1beta1.AutoMl" + } + } + } + }, + { + "regionTag": "automl_v1beta1_generated_AutoMl_UpdateDataset_async", + "title": "automl updateDataset Sample", + "origin": "API_DEFINITION", + "description": " Updates a dataset.", + "canonical": true, + "file": "auto_ml.update_dataset.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 57, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "UpdateDataset", + "fullName": "google.cloud.automl.v1beta1.AutoMl.UpdateDataset", + "async": true, + "parameters": [ + { + "name": "dataset", + "type": ".google.cloud.automl.v1beta1.Dataset" + }, + { + "name": "update_mask", + "type": ".google.protobuf.FieldMask" + } + ], + "resultType": ".google.cloud.automl.v1beta1.Dataset", + "client": { + "shortName": "AutoMlClient", + "fullName": "google.cloud.automl.v1beta1.AutoMlClient" + }, + "method": { + "shortName": "UpdateDataset", + "fullName": "google.cloud.automl.v1beta1.AutoMl.UpdateDataset", + "service": { + "shortName": "AutoMl", + "fullName": "google.cloud.automl.v1beta1.AutoMl" + } + } + } + }, + { + "regionTag": "automl_v1beta1_generated_AutoMl_DeleteDataset_async", + "title": "automl deleteDataset Sample", + "origin": "API_DEFINITION", + "description": " Deletes a dataset and all of its contents. Returns empty response in the [response][google.longrunning.Operation.response] field when it completes, and `delete_details` in the [metadata][google.longrunning.Operation.metadata] field.", + "canonical": true, + "file": "auto_ml.delete_dataset.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 54, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "DeleteDataset", + "fullName": "google.cloud.automl.v1beta1.AutoMl.DeleteDataset", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "AutoMlClient", + "fullName": "google.cloud.automl.v1beta1.AutoMlClient" + }, + "method": { + "shortName": "DeleteDataset", + "fullName": "google.cloud.automl.v1beta1.AutoMl.DeleteDataset", + "service": { + "shortName": "AutoMl", + "fullName": "google.cloud.automl.v1beta1.AutoMl" + } + } + } + }, + { + "regionTag": "automl_v1beta1_generated_AutoMl_ImportData_async", + "title": "automl importData Sample", + "origin": "API_DEFINITION", + "description": " Imports data into a dataset. For Tables this method can only be called on an empty Dataset. For Tables: * A [schema_inference_version][google.cloud.automl.v1beta1.InputConfig.params] parameter must be explicitly set. Returns an empty response in the [response][google.longrunning.Operation.response] field when it completes.", + "canonical": true, + "file": "auto_ml.import_data.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 61, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "ImportData", + "fullName": "google.cloud.automl.v1beta1.AutoMl.ImportData", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + }, + { + "name": "input_config", + "type": ".google.cloud.automl.v1beta1.InputConfig" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "AutoMlClient", + "fullName": "google.cloud.automl.v1beta1.AutoMlClient" + }, + "method": { + "shortName": "ImportData", + "fullName": "google.cloud.automl.v1beta1.AutoMl.ImportData", + "service": { + "shortName": "AutoMl", + "fullName": "google.cloud.automl.v1beta1.AutoMl" + } + } + } + }, + { + "regionTag": "automl_v1beta1_generated_AutoMl_ExportData_async", + "title": "automl exportData Sample", + "origin": "API_DEFINITION", + "description": " Exports dataset's data to the provided output location. Returns an empty response in the [response][google.longrunning.Operation.response] field when it completes.", + "canonical": true, + "file": "auto_ml.export_data.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 59, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "ExportData", + "fullName": "google.cloud.automl.v1beta1.AutoMl.ExportData", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + }, + { + "name": "output_config", + "type": ".google.cloud.automl.v1beta1.OutputConfig" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "AutoMlClient", + "fullName": "google.cloud.automl.v1beta1.AutoMlClient" + }, + "method": { + "shortName": "ExportData", + "fullName": "google.cloud.automl.v1beta1.AutoMl.ExportData", + "service": { + "shortName": "AutoMl", + "fullName": "google.cloud.automl.v1beta1.AutoMl" + } + } + } + }, + { + "regionTag": "automl_v1beta1_generated_AutoMl_GetAnnotationSpec_async", + "title": "automl getAnnotationSpec Sample", + "origin": "API_DEFINITION", + "description": " Gets an annotation spec.", + "canonical": true, + "file": "auto_ml.get_annotation_spec.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 53, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "GetAnnotationSpec", + "fullName": "google.cloud.automl.v1beta1.AutoMl.GetAnnotationSpec", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.automl.v1beta1.AnnotationSpec", + "client": { + "shortName": "AutoMlClient", + "fullName": "google.cloud.automl.v1beta1.AutoMlClient" + }, + "method": { + "shortName": "GetAnnotationSpec", + "fullName": "google.cloud.automl.v1beta1.AutoMl.GetAnnotationSpec", + "service": { + "shortName": "AutoMl", + "fullName": "google.cloud.automl.v1beta1.AutoMl" + } + } + } + }, + { + "regionTag": "automl_v1beta1_generated_AutoMl_GetTableSpec_async", + "title": "automl getTableSpec Sample", + "origin": "API_DEFINITION", + "description": " Gets a table spec.", + "canonical": true, + "file": "auto_ml.get_table_spec.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 57, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "GetTableSpec", + "fullName": "google.cloud.automl.v1beta1.AutoMl.GetTableSpec", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + }, + { + "name": "field_mask", + "type": ".google.protobuf.FieldMask" + } + ], + "resultType": ".google.cloud.automl.v1beta1.TableSpec", + "client": { + "shortName": "AutoMlClient", + "fullName": "google.cloud.automl.v1beta1.AutoMlClient" + }, + "method": { + "shortName": "GetTableSpec", + "fullName": "google.cloud.automl.v1beta1.AutoMl.GetTableSpec", + "service": { + "shortName": "AutoMl", + "fullName": "google.cloud.automl.v1beta1.AutoMl" + } + } + } + }, + { + "regionTag": "automl_v1beta1_generated_AutoMl_ListTableSpecs_async", + "title": "automl listTableSpecs Sample", + "origin": "API_DEFINITION", + "description": " Lists table specs in a dataset.", + "canonical": true, + "file": "auto_ml.list_table_specs.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 75, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "ListTableSpecs", + "fullName": "google.cloud.automl.v1beta1.AutoMl.ListTableSpecs", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "field_mask", + "type": ".google.protobuf.FieldMask" + }, + { + "name": "filter", + "type": "TYPE_STRING" + }, + { + "name": "page_size", + "type": "TYPE_INT32" + }, + { + "name": "page_token", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.automl.v1beta1.ListTableSpecsResponse", + "client": { + "shortName": "AutoMlClient", + "fullName": "google.cloud.automl.v1beta1.AutoMlClient" + }, + "method": { + "shortName": "ListTableSpecs", + "fullName": "google.cloud.automl.v1beta1.AutoMl.ListTableSpecs", + "service": { + "shortName": "AutoMl", + "fullName": "google.cloud.automl.v1beta1.AutoMl" + } + } + } + }, + { + "regionTag": "automl_v1beta1_generated_AutoMl_UpdateTableSpec_async", + "title": "automl updateTableSpec Sample", + "origin": "API_DEFINITION", + "description": " Updates a table spec.", + "canonical": true, + "file": "auto_ml.update_table_spec.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 57, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "UpdateTableSpec", + "fullName": "google.cloud.automl.v1beta1.AutoMl.UpdateTableSpec", + "async": true, + "parameters": [ + { + "name": "table_spec", + "type": ".google.cloud.automl.v1beta1.TableSpec" + }, + { + "name": "update_mask", + "type": ".google.protobuf.FieldMask" + } + ], + "resultType": ".google.cloud.automl.v1beta1.TableSpec", + "client": { + "shortName": "AutoMlClient", + "fullName": "google.cloud.automl.v1beta1.AutoMlClient" + }, + "method": { + "shortName": "UpdateTableSpec", + "fullName": "google.cloud.automl.v1beta1.AutoMl.UpdateTableSpec", + "service": { + "shortName": "AutoMl", + "fullName": "google.cloud.automl.v1beta1.AutoMl" + } + } + } + }, + { + "regionTag": "automl_v1beta1_generated_AutoMl_GetColumnSpec_async", + "title": "automl getColumnSpec Sample", + "origin": "API_DEFINITION", + "description": " Gets a column spec.", + "canonical": true, + "file": "auto_ml.get_column_spec.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 57, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "GetColumnSpec", + "fullName": "google.cloud.automl.v1beta1.AutoMl.GetColumnSpec", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + }, + { + "name": "field_mask", + "type": ".google.protobuf.FieldMask" + } + ], + "resultType": ".google.cloud.automl.v1beta1.ColumnSpec", + "client": { + "shortName": "AutoMlClient", + "fullName": "google.cloud.automl.v1beta1.AutoMlClient" + }, + "method": { + "shortName": "GetColumnSpec", + "fullName": "google.cloud.automl.v1beta1.AutoMl.GetColumnSpec", + "service": { + "shortName": "AutoMl", + "fullName": "google.cloud.automl.v1beta1.AutoMl" + } + } + } + }, + { + "regionTag": "automl_v1beta1_generated_AutoMl_ListColumnSpecs_async", + "title": "automl listColumnSpecs Sample", + "origin": "API_DEFINITION", + "description": " Lists column specs in a table spec.", + "canonical": true, + "file": "auto_ml.list_column_specs.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 75, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "ListColumnSpecs", + "fullName": "google.cloud.automl.v1beta1.AutoMl.ListColumnSpecs", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "field_mask", + "type": ".google.protobuf.FieldMask" + }, + { + "name": "filter", + "type": "TYPE_STRING" + }, + { + "name": "page_size", + "type": "TYPE_INT32" + }, + { + "name": "page_token", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.automl.v1beta1.ListColumnSpecsResponse", + "client": { + "shortName": "AutoMlClient", + "fullName": "google.cloud.automl.v1beta1.AutoMlClient" + }, + "method": { + "shortName": "ListColumnSpecs", + "fullName": "google.cloud.automl.v1beta1.AutoMl.ListColumnSpecs", + "service": { + "shortName": "AutoMl", + "fullName": "google.cloud.automl.v1beta1.AutoMl" + } + } + } + }, + { + "regionTag": "automl_v1beta1_generated_AutoMl_UpdateColumnSpec_async", + "title": "automl updateColumnSpec Sample", + "origin": "API_DEFINITION", + "description": " Updates a column spec.", + "canonical": true, + "file": "auto_ml.update_column_spec.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 57, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "UpdateColumnSpec", + "fullName": "google.cloud.automl.v1beta1.AutoMl.UpdateColumnSpec", + "async": true, + "parameters": [ + { + "name": "column_spec", + "type": ".google.cloud.automl.v1beta1.ColumnSpec" + }, + { + "name": "update_mask", + "type": ".google.protobuf.FieldMask" + } + ], + "resultType": ".google.cloud.automl.v1beta1.ColumnSpec", + "client": { + "shortName": "AutoMlClient", + "fullName": "google.cloud.automl.v1beta1.AutoMlClient" + }, + "method": { + "shortName": "UpdateColumnSpec", + "fullName": "google.cloud.automl.v1beta1.AutoMl.UpdateColumnSpec", + "service": { + "shortName": "AutoMl", + "fullName": "google.cloud.automl.v1beta1.AutoMl" + } + } + } + }, + { + "regionTag": "automl_v1beta1_generated_AutoMl_CreateModel_async", + "title": "automl createModel Sample", + "origin": "API_DEFINITION", + "description": " Creates a model. Returns a Model in the [response][google.longrunning.Operation.response] field when it completes. When you create a model, several model evaluations are created for it: a global evaluation, and one evaluation for each annotation spec.", + "canonical": true, + "file": "auto_ml.create_model.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 59, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "CreateModel", + "fullName": "google.cloud.automl.v1beta1.AutoMl.CreateModel", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "model", + "type": ".google.cloud.automl.v1beta1.Model" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "AutoMlClient", + "fullName": "google.cloud.automl.v1beta1.AutoMlClient" + }, + "method": { + "shortName": "CreateModel", + "fullName": "google.cloud.automl.v1beta1.AutoMl.CreateModel", + "service": { + "shortName": "AutoMl", + "fullName": "google.cloud.automl.v1beta1.AutoMl" + } + } + } + }, + { + "regionTag": "automl_v1beta1_generated_AutoMl_GetModel_async", + "title": "automl getModel Sample", + "origin": "API_DEFINITION", + "description": " Gets a model.", + "canonical": true, + "file": "auto_ml.get_model.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 53, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "GetModel", + "fullName": "google.cloud.automl.v1beta1.AutoMl.GetModel", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.automl.v1beta1.Model", + "client": { + "shortName": "AutoMlClient", + "fullName": "google.cloud.automl.v1beta1.AutoMlClient" + }, + "method": { + "shortName": "GetModel", + "fullName": "google.cloud.automl.v1beta1.AutoMl.GetModel", + "service": { + "shortName": "AutoMl", + "fullName": "google.cloud.automl.v1beta1.AutoMl" + } + } + } + }, + { + "regionTag": "automl_v1beta1_generated_AutoMl_ListModels_async", + "title": "automl listModels Sample", + "origin": "API_DEFINITION", + "description": " Lists models.", + "canonical": true, + "file": "auto_ml.list_models.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 76, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "ListModels", + "fullName": "google.cloud.automl.v1beta1.AutoMl.ListModels", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "filter", + "type": "TYPE_STRING" + }, + { + "name": "page_size", + "type": "TYPE_INT32" + }, + { + "name": "page_token", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.automl.v1beta1.ListModelsResponse", + "client": { + "shortName": "AutoMlClient", + "fullName": "google.cloud.automl.v1beta1.AutoMlClient" + }, + "method": { + "shortName": "ListModels", + "fullName": "google.cloud.automl.v1beta1.AutoMl.ListModels", + "service": { + "shortName": "AutoMl", + "fullName": "google.cloud.automl.v1beta1.AutoMl" + } + } + } + }, + { + "regionTag": "automl_v1beta1_generated_AutoMl_DeleteModel_async", + "title": "automl deleteModel Sample", + "origin": "API_DEFINITION", + "description": " Deletes a model. Returns `google.protobuf.Empty` in the [response][google.longrunning.Operation.response] field when it completes, and `delete_details` in the [metadata][google.longrunning.Operation.metadata] field.", + "canonical": true, + "file": "auto_ml.delete_model.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 54, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "DeleteModel", + "fullName": "google.cloud.automl.v1beta1.AutoMl.DeleteModel", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "AutoMlClient", + "fullName": "google.cloud.automl.v1beta1.AutoMlClient" + }, + "method": { + "shortName": "DeleteModel", + "fullName": "google.cloud.automl.v1beta1.AutoMl.DeleteModel", + "service": { + "shortName": "AutoMl", + "fullName": "google.cloud.automl.v1beta1.AutoMl" + } + } + } + }, + { + "regionTag": "automl_v1beta1_generated_AutoMl_DeployModel_async", + "title": "automl deployModel Sample", + "origin": "API_DEFINITION", + "description": " Deploys a model. If a model is already deployed, deploying it with the same parameters has no effect. Deploying with different parametrs (as e.g. changing [node_number][google.cloud.automl.v1beta1.ImageObjectDetectionModelDeploymentMetadata.node_number]) will reset the deployment state without pausing the model's availability. Only applicable for Text Classification, Image Object Detection , Tables, and Image Segmentation; all other domains manage deployment automatically. Returns an empty response in the [response][google.longrunning.Operation.response] field when it completes.", + "canonical": true, + "file": "auto_ml.deploy_model.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 62, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "DeployModel", + "fullName": "google.cloud.automl.v1beta1.AutoMl.DeployModel", + "async": true, + "parameters": [ + { + "name": "image_object_detection_model_deployment_metadata", + "type": ".google.cloud.automl.v1beta1.ImageObjectDetectionModelDeploymentMetadata" + }, + { + "name": "image_classification_model_deployment_metadata", + "type": ".google.cloud.automl.v1beta1.ImageClassificationModelDeploymentMetadata" + }, + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "AutoMlClient", + "fullName": "google.cloud.automl.v1beta1.AutoMlClient" + }, + "method": { + "shortName": "DeployModel", + "fullName": "google.cloud.automl.v1beta1.AutoMl.DeployModel", + "service": { + "shortName": "AutoMl", + "fullName": "google.cloud.automl.v1beta1.AutoMl" + } + } + } + }, + { + "regionTag": "automl_v1beta1_generated_AutoMl_UndeployModel_async", + "title": "automl undeployModel Sample", + "origin": "API_DEFINITION", + "description": " Undeploys a model. If the model is not deployed this method has no effect. Only applicable for Text Classification, Image Object Detection and Tables; all other domains manage deployment automatically. Returns an empty response in the [response][google.longrunning.Operation.response] field when it completes.", + "canonical": true, + "file": "auto_ml.undeploy_model.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 54, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "UndeployModel", + "fullName": "google.cloud.automl.v1beta1.AutoMl.UndeployModel", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "AutoMlClient", + "fullName": "google.cloud.automl.v1beta1.AutoMlClient" + }, + "method": { + "shortName": "UndeployModel", + "fullName": "google.cloud.automl.v1beta1.AutoMl.UndeployModel", + "service": { + "shortName": "AutoMl", + "fullName": "google.cloud.automl.v1beta1.AutoMl" + } + } + } + }, + { + "regionTag": "automl_v1beta1_generated_AutoMl_ExportModel_async", + "title": "automl exportModel Sample", + "origin": "API_DEFINITION", + "description": " Exports a trained, \"export-able\", model to a user specified Google Cloud Storage location. A model is considered export-able if and only if it has an export format defined for it in [ModelExportOutputConfig][google.cloud.automl.v1beta1.ModelExportOutputConfig]. Returns an empty response in the [response][google.longrunning.Operation.response] field when it completes.", + "canonical": true, + "file": "auto_ml.export_model.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 59, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "ExportModel", + "fullName": "google.cloud.automl.v1beta1.AutoMl.ExportModel", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + }, + { + "name": "output_config", + "type": ".google.cloud.automl.v1beta1.ModelExportOutputConfig" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "AutoMlClient", + "fullName": "google.cloud.automl.v1beta1.AutoMlClient" + }, + "method": { + "shortName": "ExportModel", + "fullName": "google.cloud.automl.v1beta1.AutoMl.ExportModel", + "service": { + "shortName": "AutoMl", + "fullName": "google.cloud.automl.v1beta1.AutoMl" + } + } + } + }, + { + "regionTag": "automl_v1beta1_generated_AutoMl_ExportEvaluatedExamples_async", + "title": "automl exportEvaluatedExamples Sample", + "origin": "API_DEFINITION", + "description": " Exports examples on which the model was evaluated (i.e. which were in the TEST set of the dataset the model was created from), together with their ground truth annotations and the annotations created (predicted) by the model. The examples, ground truth and predictions are exported in the state they were at the moment the model was evaluated. This export is available only for 30 days since the model evaluation is created. Currently only available for Tables. Returns an empty response in the [response][google.longrunning.Operation.response] field when it completes.", + "canonical": true, + "file": "auto_ml.export_evaluated_examples.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 60, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "ExportEvaluatedExamples", + "fullName": "google.cloud.automl.v1beta1.AutoMl.ExportEvaluatedExamples", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + }, + { + "name": "output_config", + "type": ".google.cloud.automl.v1beta1.ExportEvaluatedExamplesOutputConfig" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "AutoMlClient", + "fullName": "google.cloud.automl.v1beta1.AutoMlClient" + }, + "method": { + "shortName": "ExportEvaluatedExamples", + "fullName": "google.cloud.automl.v1beta1.AutoMl.ExportEvaluatedExamples", + "service": { + "shortName": "AutoMl", + "fullName": "google.cloud.automl.v1beta1.AutoMl" + } + } + } + }, + { + "regionTag": "automl_v1beta1_generated_AutoMl_GetModelEvaluation_async", + "title": "automl getModelEvaluation Sample", + "origin": "API_DEFINITION", + "description": " Gets a model evaluation.", + "canonical": true, + "file": "auto_ml.get_model_evaluation.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 53, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "GetModelEvaluation", + "fullName": "google.cloud.automl.v1beta1.AutoMl.GetModelEvaluation", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.automl.v1beta1.ModelEvaluation", + "client": { + "shortName": "AutoMlClient", + "fullName": "google.cloud.automl.v1beta1.AutoMlClient" + }, + "method": { + "shortName": "GetModelEvaluation", + "fullName": "google.cloud.automl.v1beta1.AutoMl.GetModelEvaluation", + "service": { + "shortName": "AutoMl", + "fullName": "google.cloud.automl.v1beta1.AutoMl" + } + } + } + }, + { + "regionTag": "automl_v1beta1_generated_AutoMl_ListModelEvaluations_async", + "title": "automl listModelEvaluations Sample", + "origin": "API_DEFINITION", + "description": " Lists model evaluations.", + "canonical": true, + "file": "auto_ml.list_model_evaluations.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 79, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "ListModelEvaluations", + "fullName": "google.cloud.automl.v1beta1.AutoMl.ListModelEvaluations", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "filter", + "type": "TYPE_STRING" + }, + { + "name": "page_size", + "type": "TYPE_INT32" + }, + { + "name": "page_token", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.automl.v1beta1.ListModelEvaluationsResponse", + "client": { + "shortName": "AutoMlClient", + "fullName": "google.cloud.automl.v1beta1.AutoMlClient" + }, + "method": { + "shortName": "ListModelEvaluations", + "fullName": "google.cloud.automl.v1beta1.AutoMl.ListModelEvaluations", + "service": { + "shortName": "AutoMl", + "fullName": "google.cloud.automl.v1beta1.AutoMl" + } + } + } + }, + { + "regionTag": "automl_v1beta1_generated_PredictionService_Predict_async", + "title": "automl predict Sample", + "origin": "API_DEFINITION", + "description": " Perform an online prediction. The prediction result will be directly returned in the response. Available for following ML problems, and their expected request payloads: * Image Classification - Image in .JPEG, .GIF or .PNG format, image_bytes up to 30MB. * Image Object Detection - Image in .JPEG, .GIF or .PNG format, image_bytes up to 30MB. * Text Classification - TextSnippet, content up to 60,000 characters, UTF-8 encoded. * Text Extraction - TextSnippet, content up to 30,000 characters, UTF-8 NFC encoded. * Translation - TextSnippet, content up to 25,000 characters, UTF-8 encoded. * Tables - Row, with column values matching the columns of the model, up to 5MB. Not available for FORECASTING [prediction_type][google.cloud.automl.v1beta1.TablesModelMetadata.prediction_type]. * Text Sentiment - TextSnippet, content up 500 characters, UTF-8 encoded.", + "canonical": true, + "file": "prediction_service.predict.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 79, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "Predict", + "fullName": "google.cloud.automl.v1beta1.PredictionService.Predict", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + }, + { + "name": "payload", + "type": ".google.cloud.automl.v1beta1.ExamplePayload" + }, + { + "name": "params", + "type": "TYPE_MESSAGE[]" + } + ], + "resultType": ".google.cloud.automl.v1beta1.PredictResponse", + "client": { + "shortName": "PredictionServiceClient", + "fullName": "google.cloud.automl.v1beta1.PredictionServiceClient" + }, + "method": { + "shortName": "Predict", + "fullName": "google.cloud.automl.v1beta1.PredictionService.Predict", + "service": { + "shortName": "PredictionService", + "fullName": "google.cloud.automl.v1beta1.PredictionService" + } + } + } + }, + { + "regionTag": "automl_v1beta1_generated_PredictionService_BatchPredict_async", + "title": "automl batchPredict Sample", + "origin": "API_DEFINITION", + "description": " Perform a batch prediction. Unlike the online [Predict][google.cloud.automl.v1beta1.PredictionService.Predict], batch prediction result won't be immediately available in the response. Instead, a long running operation object is returned. User can poll the operation result via [GetOperation][google.longrunning.Operations.GetOperation] method. Once the operation is done, [BatchPredictResult][google.cloud.automl.v1beta1.BatchPredictResult] is returned in the [response][google.longrunning.Operation.response] field. Available for following ML problems: * Image Classification * Image Object Detection * Video Classification * Video Object Tracking * Text Extraction * Tables", + "canonical": true, + "file": "prediction_service.batch_predict.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 127, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "BatchPredict", + "fullName": "google.cloud.automl.v1beta1.PredictionService.BatchPredict", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + }, + { + "name": "input_config", + "type": ".google.cloud.automl.v1beta1.BatchPredictInputConfig" + }, + { + "name": "output_config", + "type": ".google.cloud.automl.v1beta1.BatchPredictOutputConfig" + }, + { + "name": "params", + "type": "TYPE_MESSAGE[]" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "PredictionServiceClient", + "fullName": "google.cloud.automl.v1beta1.PredictionServiceClient" + }, + "method": { + "shortName": "BatchPredict", + "fullName": "google.cloud.automl.v1beta1.PredictionService.BatchPredict", + "service": { + "shortName": "PredictionService", + "fullName": "google.cloud.automl.v1beta1.PredictionService" + } + } + } + } + ] +} \ No newline at end of file diff --git a/packages/google-cloud-automl/samples/generated/v1beta1/snippet_metadata_google.cloud.automl.v1beta1.json b/packages/google-cloud-automl/samples/generated/v1beta1/snippet_metadata_google.cloud.automl.v1beta1.json new file mode 100644 index 00000000000..24edb8dc6dd --- /dev/null +++ b/packages/google-cloud-automl/samples/generated/v1beta1/snippet_metadata_google.cloud.automl.v1beta1.json @@ -0,0 +1,1195 @@ +{ + "clientLibrary": { + "name": "nodejs-automl", + "version": "4.0.2", + "language": "TYPESCRIPT", + "apis": [ + { + "id": "google.cloud.automl.v1beta1", + "version": "v1beta1" + } + ] + }, + "snippets": [ + { + "regionTag": "automl_v1beta1_generated_AutoMl_CreateDataset_async", + "title": "automl createDataset Sample", + "origin": "API_DEFINITION", + "description": " Creates a dataset.", + "canonical": true, + "file": "auto_ml.create_dataset.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 58, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "CreateDataset", + "fullName": "google.cloud.automl.v1beta1.AutoMl.CreateDataset", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "dataset", + "type": ".google.cloud.automl.v1beta1.Dataset" + } + ], + "resultType": ".google.cloud.automl.v1beta1.Dataset", + "client": { + "shortName": "AutoMlClient", + "fullName": "google.cloud.automl.v1beta1.AutoMlClient" + }, + "method": { + "shortName": "CreateDataset", + "fullName": "google.cloud.automl.v1beta1.AutoMl.CreateDataset", + "service": { + "shortName": "AutoMl", + "fullName": "google.cloud.automl.v1beta1.AutoMl" + } + } + } + }, + { + "regionTag": "automl_v1beta1_generated_AutoMl_GetDataset_async", + "title": "automl getDataset Sample", + "origin": "API_DEFINITION", + "description": " Gets a dataset.", + "canonical": true, + "file": "auto_ml.get_dataset.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 53, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "GetDataset", + "fullName": "google.cloud.automl.v1beta1.AutoMl.GetDataset", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.automl.v1beta1.Dataset", + "client": { + "shortName": "AutoMlClient", + "fullName": "google.cloud.automl.v1beta1.AutoMlClient" + }, + "method": { + "shortName": "GetDataset", + "fullName": "google.cloud.automl.v1beta1.AutoMl.GetDataset", + "service": { + "shortName": "AutoMl", + "fullName": "google.cloud.automl.v1beta1.AutoMl" + } + } + } + }, + { + "regionTag": "automl_v1beta1_generated_AutoMl_ListDatasets_async", + "title": "automl listDatasets Sample", + "origin": "API_DEFINITION", + "description": " Lists datasets in a project.", + "canonical": true, + "file": "auto_ml.list_datasets.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 76, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "ListDatasets", + "fullName": "google.cloud.automl.v1beta1.AutoMl.ListDatasets", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "filter", + "type": "TYPE_STRING" + }, + { + "name": "page_size", + "type": "TYPE_INT32" + }, + { + "name": "page_token", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.automl.v1beta1.ListDatasetsResponse", + "client": { + "shortName": "AutoMlClient", + "fullName": "google.cloud.automl.v1beta1.AutoMlClient" + }, + "method": { + "shortName": "ListDatasets", + "fullName": "google.cloud.automl.v1beta1.AutoMl.ListDatasets", + "service": { + "shortName": "AutoMl", + "fullName": "google.cloud.automl.v1beta1.AutoMl" + } + } + } + }, + { + "regionTag": "automl_v1beta1_generated_AutoMl_UpdateDataset_async", + "title": "automl updateDataset Sample", + "origin": "API_DEFINITION", + "description": " Updates a dataset.", + "canonical": true, + "file": "auto_ml.update_dataset.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 57, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "UpdateDataset", + "fullName": "google.cloud.automl.v1beta1.AutoMl.UpdateDataset", + "async": true, + "parameters": [ + { + "name": "dataset", + "type": ".google.cloud.automl.v1beta1.Dataset" + }, + { + "name": "update_mask", + "type": ".google.protobuf.FieldMask" + } + ], + "resultType": ".google.cloud.automl.v1beta1.Dataset", + "client": { + "shortName": "AutoMlClient", + "fullName": "google.cloud.automl.v1beta1.AutoMlClient" + }, + "method": { + "shortName": "UpdateDataset", + "fullName": "google.cloud.automl.v1beta1.AutoMl.UpdateDataset", + "service": { + "shortName": "AutoMl", + "fullName": "google.cloud.automl.v1beta1.AutoMl" + } + } + } + }, + { + "regionTag": "automl_v1beta1_generated_AutoMl_DeleteDataset_async", + "title": "automl deleteDataset Sample", + "origin": "API_DEFINITION", + "description": " Deletes a dataset and all of its contents. Returns empty response in the [response][google.longrunning.Operation.response] field when it completes, and `delete_details` in the [metadata][google.longrunning.Operation.metadata] field.", + "canonical": true, + "file": "auto_ml.delete_dataset.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 54, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "DeleteDataset", + "fullName": "google.cloud.automl.v1beta1.AutoMl.DeleteDataset", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "AutoMlClient", + "fullName": "google.cloud.automl.v1beta1.AutoMlClient" + }, + "method": { + "shortName": "DeleteDataset", + "fullName": "google.cloud.automl.v1beta1.AutoMl.DeleteDataset", + "service": { + "shortName": "AutoMl", + "fullName": "google.cloud.automl.v1beta1.AutoMl" + } + } + } + }, + { + "regionTag": "automl_v1beta1_generated_AutoMl_ImportData_async", + "title": "automl importData Sample", + "origin": "API_DEFINITION", + "description": " Imports data into a dataset. For Tables this method can only be called on an empty Dataset. For Tables: * A [schema_inference_version][google.cloud.automl.v1beta1.InputConfig.params] parameter must be explicitly set. Returns an empty response in the [response][google.longrunning.Operation.response] field when it completes.", + "canonical": true, + "file": "auto_ml.import_data.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 61, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "ImportData", + "fullName": "google.cloud.automl.v1beta1.AutoMl.ImportData", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + }, + { + "name": "input_config", + "type": ".google.cloud.automl.v1beta1.InputConfig" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "AutoMlClient", + "fullName": "google.cloud.automl.v1beta1.AutoMlClient" + }, + "method": { + "shortName": "ImportData", + "fullName": "google.cloud.automl.v1beta1.AutoMl.ImportData", + "service": { + "shortName": "AutoMl", + "fullName": "google.cloud.automl.v1beta1.AutoMl" + } + } + } + }, + { + "regionTag": "automl_v1beta1_generated_AutoMl_ExportData_async", + "title": "automl exportData Sample", + "origin": "API_DEFINITION", + "description": " Exports dataset's data to the provided output location. Returns an empty response in the [response][google.longrunning.Operation.response] field when it completes.", + "canonical": true, + "file": "auto_ml.export_data.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 59, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "ExportData", + "fullName": "google.cloud.automl.v1beta1.AutoMl.ExportData", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + }, + { + "name": "output_config", + "type": ".google.cloud.automl.v1beta1.OutputConfig" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "AutoMlClient", + "fullName": "google.cloud.automl.v1beta1.AutoMlClient" + }, + "method": { + "shortName": "ExportData", + "fullName": "google.cloud.automl.v1beta1.AutoMl.ExportData", + "service": { + "shortName": "AutoMl", + "fullName": "google.cloud.automl.v1beta1.AutoMl" + } + } + } + }, + { + "regionTag": "automl_v1beta1_generated_AutoMl_GetAnnotationSpec_async", + "title": "automl getAnnotationSpec Sample", + "origin": "API_DEFINITION", + "description": " Gets an annotation spec.", + "canonical": true, + "file": "auto_ml.get_annotation_spec.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 53, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "GetAnnotationSpec", + "fullName": "google.cloud.automl.v1beta1.AutoMl.GetAnnotationSpec", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.automl.v1beta1.AnnotationSpec", + "client": { + "shortName": "AutoMlClient", + "fullName": "google.cloud.automl.v1beta1.AutoMlClient" + }, + "method": { + "shortName": "GetAnnotationSpec", + "fullName": "google.cloud.automl.v1beta1.AutoMl.GetAnnotationSpec", + "service": { + "shortName": "AutoMl", + "fullName": "google.cloud.automl.v1beta1.AutoMl" + } + } + } + }, + { + "regionTag": "automl_v1beta1_generated_AutoMl_GetTableSpec_async", + "title": "automl getTableSpec Sample", + "origin": "API_DEFINITION", + "description": " Gets a table spec.", + "canonical": true, + "file": "auto_ml.get_table_spec.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 57, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "GetTableSpec", + "fullName": "google.cloud.automl.v1beta1.AutoMl.GetTableSpec", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + }, + { + "name": "field_mask", + "type": ".google.protobuf.FieldMask" + } + ], + "resultType": ".google.cloud.automl.v1beta1.TableSpec", + "client": { + "shortName": "AutoMlClient", + "fullName": "google.cloud.automl.v1beta1.AutoMlClient" + }, + "method": { + "shortName": "GetTableSpec", + "fullName": "google.cloud.automl.v1beta1.AutoMl.GetTableSpec", + "service": { + "shortName": "AutoMl", + "fullName": "google.cloud.automl.v1beta1.AutoMl" + } + } + } + }, + { + "regionTag": "automl_v1beta1_generated_AutoMl_ListTableSpecs_async", + "title": "automl listTableSpecs Sample", + "origin": "API_DEFINITION", + "description": " Lists table specs in a dataset.", + "canonical": true, + "file": "auto_ml.list_table_specs.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 75, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "ListTableSpecs", + "fullName": "google.cloud.automl.v1beta1.AutoMl.ListTableSpecs", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "field_mask", + "type": ".google.protobuf.FieldMask" + }, + { + "name": "filter", + "type": "TYPE_STRING" + }, + { + "name": "page_size", + "type": "TYPE_INT32" + }, + { + "name": "page_token", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.automl.v1beta1.ListTableSpecsResponse", + "client": { + "shortName": "AutoMlClient", + "fullName": "google.cloud.automl.v1beta1.AutoMlClient" + }, + "method": { + "shortName": "ListTableSpecs", + "fullName": "google.cloud.automl.v1beta1.AutoMl.ListTableSpecs", + "service": { + "shortName": "AutoMl", + "fullName": "google.cloud.automl.v1beta1.AutoMl" + } + } + } + }, + { + "regionTag": "automl_v1beta1_generated_AutoMl_UpdateTableSpec_async", + "title": "automl updateTableSpec Sample", + "origin": "API_DEFINITION", + "description": " Updates a table spec.", + "canonical": true, + "file": "auto_ml.update_table_spec.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 57, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "UpdateTableSpec", + "fullName": "google.cloud.automl.v1beta1.AutoMl.UpdateTableSpec", + "async": true, + "parameters": [ + { + "name": "table_spec", + "type": ".google.cloud.automl.v1beta1.TableSpec" + }, + { + "name": "update_mask", + "type": ".google.protobuf.FieldMask" + } + ], + "resultType": ".google.cloud.automl.v1beta1.TableSpec", + "client": { + "shortName": "AutoMlClient", + "fullName": "google.cloud.automl.v1beta1.AutoMlClient" + }, + "method": { + "shortName": "UpdateTableSpec", + "fullName": "google.cloud.automl.v1beta1.AutoMl.UpdateTableSpec", + "service": { + "shortName": "AutoMl", + "fullName": "google.cloud.automl.v1beta1.AutoMl" + } + } + } + }, + { + "regionTag": "automl_v1beta1_generated_AutoMl_GetColumnSpec_async", + "title": "automl getColumnSpec Sample", + "origin": "API_DEFINITION", + "description": " Gets a column spec.", + "canonical": true, + "file": "auto_ml.get_column_spec.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 57, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "GetColumnSpec", + "fullName": "google.cloud.automl.v1beta1.AutoMl.GetColumnSpec", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + }, + { + "name": "field_mask", + "type": ".google.protobuf.FieldMask" + } + ], + "resultType": ".google.cloud.automl.v1beta1.ColumnSpec", + "client": { + "shortName": "AutoMlClient", + "fullName": "google.cloud.automl.v1beta1.AutoMlClient" + }, + "method": { + "shortName": "GetColumnSpec", + "fullName": "google.cloud.automl.v1beta1.AutoMl.GetColumnSpec", + "service": { + "shortName": "AutoMl", + "fullName": "google.cloud.automl.v1beta1.AutoMl" + } + } + } + }, + { + "regionTag": "automl_v1beta1_generated_AutoMl_ListColumnSpecs_async", + "title": "automl listColumnSpecs Sample", + "origin": "API_DEFINITION", + "description": " Lists column specs in a table spec.", + "canonical": true, + "file": "auto_ml.list_column_specs.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 75, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "ListColumnSpecs", + "fullName": "google.cloud.automl.v1beta1.AutoMl.ListColumnSpecs", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "field_mask", + "type": ".google.protobuf.FieldMask" + }, + { + "name": "filter", + "type": "TYPE_STRING" + }, + { + "name": "page_size", + "type": "TYPE_INT32" + }, + { + "name": "page_token", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.automl.v1beta1.ListColumnSpecsResponse", + "client": { + "shortName": "AutoMlClient", + "fullName": "google.cloud.automl.v1beta1.AutoMlClient" + }, + "method": { + "shortName": "ListColumnSpecs", + "fullName": "google.cloud.automl.v1beta1.AutoMl.ListColumnSpecs", + "service": { + "shortName": "AutoMl", + "fullName": "google.cloud.automl.v1beta1.AutoMl" + } + } + } + }, + { + "regionTag": "automl_v1beta1_generated_AutoMl_UpdateColumnSpec_async", + "title": "automl updateColumnSpec Sample", + "origin": "API_DEFINITION", + "description": " Updates a column spec.", + "canonical": true, + "file": "auto_ml.update_column_spec.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 57, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "UpdateColumnSpec", + "fullName": "google.cloud.automl.v1beta1.AutoMl.UpdateColumnSpec", + "async": true, + "parameters": [ + { + "name": "column_spec", + "type": ".google.cloud.automl.v1beta1.ColumnSpec" + }, + { + "name": "update_mask", + "type": ".google.protobuf.FieldMask" + } + ], + "resultType": ".google.cloud.automl.v1beta1.ColumnSpec", + "client": { + "shortName": "AutoMlClient", + "fullName": "google.cloud.automl.v1beta1.AutoMlClient" + }, + "method": { + "shortName": "UpdateColumnSpec", + "fullName": "google.cloud.automl.v1beta1.AutoMl.UpdateColumnSpec", + "service": { + "shortName": "AutoMl", + "fullName": "google.cloud.automl.v1beta1.AutoMl" + } + } + } + }, + { + "regionTag": "automl_v1beta1_generated_AutoMl_CreateModel_async", + "title": "automl createModel Sample", + "origin": "API_DEFINITION", + "description": " Creates a model. Returns a Model in the [response][google.longrunning.Operation.response] field when it completes. When you create a model, several model evaluations are created for it: a global evaluation, and one evaluation for each annotation spec.", + "canonical": true, + "file": "auto_ml.create_model.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 59, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "CreateModel", + "fullName": "google.cloud.automl.v1beta1.AutoMl.CreateModel", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "model", + "type": ".google.cloud.automl.v1beta1.Model" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "AutoMlClient", + "fullName": "google.cloud.automl.v1beta1.AutoMlClient" + }, + "method": { + "shortName": "CreateModel", + "fullName": "google.cloud.automl.v1beta1.AutoMl.CreateModel", + "service": { + "shortName": "AutoMl", + "fullName": "google.cloud.automl.v1beta1.AutoMl" + } + } + } + }, + { + "regionTag": "automl_v1beta1_generated_AutoMl_GetModel_async", + "title": "automl getModel Sample", + "origin": "API_DEFINITION", + "description": " Gets a model.", + "canonical": true, + "file": "auto_ml.get_model.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 53, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "GetModel", + "fullName": "google.cloud.automl.v1beta1.AutoMl.GetModel", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.automl.v1beta1.Model", + "client": { + "shortName": "AutoMlClient", + "fullName": "google.cloud.automl.v1beta1.AutoMlClient" + }, + "method": { + "shortName": "GetModel", + "fullName": "google.cloud.automl.v1beta1.AutoMl.GetModel", + "service": { + "shortName": "AutoMl", + "fullName": "google.cloud.automl.v1beta1.AutoMl" + } + } + } + }, + { + "regionTag": "automl_v1beta1_generated_AutoMl_ListModels_async", + "title": "automl listModels Sample", + "origin": "API_DEFINITION", + "description": " Lists models.", + "canonical": true, + "file": "auto_ml.list_models.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 76, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "ListModels", + "fullName": "google.cloud.automl.v1beta1.AutoMl.ListModels", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "filter", + "type": "TYPE_STRING" + }, + { + "name": "page_size", + "type": "TYPE_INT32" + }, + { + "name": "page_token", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.automl.v1beta1.ListModelsResponse", + "client": { + "shortName": "AutoMlClient", + "fullName": "google.cloud.automl.v1beta1.AutoMlClient" + }, + "method": { + "shortName": "ListModels", + "fullName": "google.cloud.automl.v1beta1.AutoMl.ListModels", + "service": { + "shortName": "AutoMl", + "fullName": "google.cloud.automl.v1beta1.AutoMl" + } + } + } + }, + { + "regionTag": "automl_v1beta1_generated_AutoMl_DeleteModel_async", + "title": "automl deleteModel Sample", + "origin": "API_DEFINITION", + "description": " Deletes a model. Returns `google.protobuf.Empty` in the [response][google.longrunning.Operation.response] field when it completes, and `delete_details` in the [metadata][google.longrunning.Operation.metadata] field.", + "canonical": true, + "file": "auto_ml.delete_model.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 54, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "DeleteModel", + "fullName": "google.cloud.automl.v1beta1.AutoMl.DeleteModel", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "AutoMlClient", + "fullName": "google.cloud.automl.v1beta1.AutoMlClient" + }, + "method": { + "shortName": "DeleteModel", + "fullName": "google.cloud.automl.v1beta1.AutoMl.DeleteModel", + "service": { + "shortName": "AutoMl", + "fullName": "google.cloud.automl.v1beta1.AutoMl" + } + } + } + }, + { + "regionTag": "automl_v1beta1_generated_AutoMl_DeployModel_async", + "title": "automl deployModel Sample", + "origin": "API_DEFINITION", + "description": " Deploys a model. If a model is already deployed, deploying it with the same parameters has no effect. Deploying with different parametrs (as e.g. changing [node_number][google.cloud.automl.v1beta1.ImageObjectDetectionModelDeploymentMetadata.node_number]) will reset the deployment state without pausing the model's availability. Only applicable for Text Classification, Image Object Detection , Tables, and Image Segmentation; all other domains manage deployment automatically. Returns an empty response in the [response][google.longrunning.Operation.response] field when it completes.", + "canonical": true, + "file": "auto_ml.deploy_model.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 62, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "DeployModel", + "fullName": "google.cloud.automl.v1beta1.AutoMl.DeployModel", + "async": true, + "parameters": [ + { + "name": "image_object_detection_model_deployment_metadata", + "type": ".google.cloud.automl.v1beta1.ImageObjectDetectionModelDeploymentMetadata" + }, + { + "name": "image_classification_model_deployment_metadata", + "type": ".google.cloud.automl.v1beta1.ImageClassificationModelDeploymentMetadata" + }, + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "AutoMlClient", + "fullName": "google.cloud.automl.v1beta1.AutoMlClient" + }, + "method": { + "shortName": "DeployModel", + "fullName": "google.cloud.automl.v1beta1.AutoMl.DeployModel", + "service": { + "shortName": "AutoMl", + "fullName": "google.cloud.automl.v1beta1.AutoMl" + } + } + } + }, + { + "regionTag": "automl_v1beta1_generated_AutoMl_UndeployModel_async", + "title": "automl undeployModel Sample", + "origin": "API_DEFINITION", + "description": " Undeploys a model. If the model is not deployed this method has no effect. Only applicable for Text Classification, Image Object Detection and Tables; all other domains manage deployment automatically. Returns an empty response in the [response][google.longrunning.Operation.response] field when it completes.", + "canonical": true, + "file": "auto_ml.undeploy_model.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 54, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "UndeployModel", + "fullName": "google.cloud.automl.v1beta1.AutoMl.UndeployModel", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "AutoMlClient", + "fullName": "google.cloud.automl.v1beta1.AutoMlClient" + }, + "method": { + "shortName": "UndeployModel", + "fullName": "google.cloud.automl.v1beta1.AutoMl.UndeployModel", + "service": { + "shortName": "AutoMl", + "fullName": "google.cloud.automl.v1beta1.AutoMl" + } + } + } + }, + { + "regionTag": "automl_v1beta1_generated_AutoMl_ExportModel_async", + "title": "automl exportModel Sample", + "origin": "API_DEFINITION", + "description": " Exports a trained, \"export-able\", model to a user specified Google Cloud Storage location. A model is considered export-able if and only if it has an export format defined for it in [ModelExportOutputConfig][google.cloud.automl.v1beta1.ModelExportOutputConfig]. Returns an empty response in the [response][google.longrunning.Operation.response] field when it completes.", + "canonical": true, + "file": "auto_ml.export_model.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 59, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "ExportModel", + "fullName": "google.cloud.automl.v1beta1.AutoMl.ExportModel", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + }, + { + "name": "output_config", + "type": ".google.cloud.automl.v1beta1.ModelExportOutputConfig" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "AutoMlClient", + "fullName": "google.cloud.automl.v1beta1.AutoMlClient" + }, + "method": { + "shortName": "ExportModel", + "fullName": "google.cloud.automl.v1beta1.AutoMl.ExportModel", + "service": { + "shortName": "AutoMl", + "fullName": "google.cloud.automl.v1beta1.AutoMl" + } + } + } + }, + { + "regionTag": "automl_v1beta1_generated_AutoMl_ExportEvaluatedExamples_async", + "title": "automl exportEvaluatedExamples Sample", + "origin": "API_DEFINITION", + "description": " Exports examples on which the model was evaluated (i.e. which were in the TEST set of the dataset the model was created from), together with their ground truth annotations and the annotations created (predicted) by the model. The examples, ground truth and predictions are exported in the state they were at the moment the model was evaluated. This export is available only for 30 days since the model evaluation is created. Currently only available for Tables. Returns an empty response in the [response][google.longrunning.Operation.response] field when it completes.", + "canonical": true, + "file": "auto_ml.export_evaluated_examples.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 60, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "ExportEvaluatedExamples", + "fullName": "google.cloud.automl.v1beta1.AutoMl.ExportEvaluatedExamples", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + }, + { + "name": "output_config", + "type": ".google.cloud.automl.v1beta1.ExportEvaluatedExamplesOutputConfig" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "AutoMlClient", + "fullName": "google.cloud.automl.v1beta1.AutoMlClient" + }, + "method": { + "shortName": "ExportEvaluatedExamples", + "fullName": "google.cloud.automl.v1beta1.AutoMl.ExportEvaluatedExamples", + "service": { + "shortName": "AutoMl", + "fullName": "google.cloud.automl.v1beta1.AutoMl" + } + } + } + }, + { + "regionTag": "automl_v1beta1_generated_AutoMl_GetModelEvaluation_async", + "title": "automl getModelEvaluation Sample", + "origin": "API_DEFINITION", + "description": " Gets a model evaluation.", + "canonical": true, + "file": "auto_ml.get_model_evaluation.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 53, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "GetModelEvaluation", + "fullName": "google.cloud.automl.v1beta1.AutoMl.GetModelEvaluation", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.automl.v1beta1.ModelEvaluation", + "client": { + "shortName": "AutoMlClient", + "fullName": "google.cloud.automl.v1beta1.AutoMlClient" + }, + "method": { + "shortName": "GetModelEvaluation", + "fullName": "google.cloud.automl.v1beta1.AutoMl.GetModelEvaluation", + "service": { + "shortName": "AutoMl", + "fullName": "google.cloud.automl.v1beta1.AutoMl" + } + } + } + }, + { + "regionTag": "automl_v1beta1_generated_AutoMl_ListModelEvaluations_async", + "title": "automl listModelEvaluations Sample", + "origin": "API_DEFINITION", + "description": " Lists model evaluations.", + "canonical": true, + "file": "auto_ml.list_model_evaluations.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 79, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "ListModelEvaluations", + "fullName": "google.cloud.automl.v1beta1.AutoMl.ListModelEvaluations", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "filter", + "type": "TYPE_STRING" + }, + { + "name": "page_size", + "type": "TYPE_INT32" + }, + { + "name": "page_token", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.automl.v1beta1.ListModelEvaluationsResponse", + "client": { + "shortName": "AutoMlClient", + "fullName": "google.cloud.automl.v1beta1.AutoMlClient" + }, + "method": { + "shortName": "ListModelEvaluations", + "fullName": "google.cloud.automl.v1beta1.AutoMl.ListModelEvaluations", + "service": { + "shortName": "AutoMl", + "fullName": "google.cloud.automl.v1beta1.AutoMl" + } + } + } + }, + { + "regionTag": "automl_v1beta1_generated_PredictionService_Predict_async", + "title": "automl predict Sample", + "origin": "API_DEFINITION", + "description": " Perform an online prediction. The prediction result will be directly returned in the response. Available for following ML problems, and their expected request payloads: * Image Classification - Image in .JPEG, .GIF or .PNG format, image_bytes up to 30MB. * Image Object Detection - Image in .JPEG, .GIF or .PNG format, image_bytes up to 30MB. * Text Classification - TextSnippet, content up to 60,000 characters, UTF-8 encoded. * Text Extraction - TextSnippet, content up to 30,000 characters, UTF-8 NFC encoded. * Translation - TextSnippet, content up to 25,000 characters, UTF-8 encoded. * Tables - Row, with column values matching the columns of the model, up to 5MB. Not available for FORECASTING [prediction_type][google.cloud.automl.v1beta1.TablesModelMetadata.prediction_type]. * Text Sentiment - TextSnippet, content up 500 characters, UTF-8 encoded.", + "canonical": true, + "file": "prediction_service.predict.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 79, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "Predict", + "fullName": "google.cloud.automl.v1beta1.PredictionService.Predict", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + }, + { + "name": "payload", + "type": ".google.cloud.automl.v1beta1.ExamplePayload" + }, + { + "name": "params", + "type": "TYPE_MESSAGE[]" + } + ], + "resultType": ".google.cloud.automl.v1beta1.PredictResponse", + "client": { + "shortName": "PredictionServiceClient", + "fullName": "google.cloud.automl.v1beta1.PredictionServiceClient" + }, + "method": { + "shortName": "Predict", + "fullName": "google.cloud.automl.v1beta1.PredictionService.Predict", + "service": { + "shortName": "PredictionService", + "fullName": "google.cloud.automl.v1beta1.PredictionService" + } + } + } + }, + { + "regionTag": "automl_v1beta1_generated_PredictionService_BatchPredict_async", + "title": "automl batchPredict Sample", + "origin": "API_DEFINITION", + "description": " Perform a batch prediction. Unlike the online [Predict][google.cloud.automl.v1beta1.PredictionService.Predict], batch prediction result won't be immediately available in the response. Instead, a long running operation object is returned. User can poll the operation result via [GetOperation][google.longrunning.Operations.GetOperation] method. Once the operation is done, [BatchPredictResult][google.cloud.automl.v1beta1.BatchPredictResult] is returned in the [response][google.longrunning.Operation.response] field. Available for following ML problems: * Image Classification * Image Object Detection * Video Classification * Video Object Tracking * Text Extraction * Tables", + "canonical": true, + "file": "prediction_service.batch_predict.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 127, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "BatchPredict", + "fullName": "google.cloud.automl.v1beta1.PredictionService.BatchPredict", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + }, + { + "name": "input_config", + "type": ".google.cloud.automl.v1beta1.BatchPredictInputConfig" + }, + { + "name": "output_config", + "type": ".google.cloud.automl.v1beta1.BatchPredictOutputConfig" + }, + { + "name": "params", + "type": "TYPE_MESSAGE[]" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "PredictionServiceClient", + "fullName": "google.cloud.automl.v1beta1.PredictionServiceClient" + }, + "method": { + "shortName": "BatchPredict", + "fullName": "google.cloud.automl.v1beta1.PredictionService.BatchPredict", + "service": { + "shortName": "PredictionService", + "fullName": "google.cloud.automl.v1beta1.PredictionService" + } + } + } + } + ] +} \ No newline at end of file diff --git a/packages/google-cloud-automl/samples/package.json b/packages/google-cloud-automl/samples/package.json new file mode 100644 index 00000000000..2bb360ef214 --- /dev/null +++ b/packages/google-cloud-automl/samples/package.json @@ -0,0 +1,30 @@ +{ + "name": "@google-cloud/automl-samples", + "description": "Samples for the Cloud AutoML Client Library for Node.js.", + "license": "Apache-2.0", + "author": "Google LLC", + "engines": { + "node": ">=14.0.0" + }, + "repository": "googleapis/nodejs-automl", + "private": true, + "scripts": { + "test": "mocha --timeout 9000000" + }, + "files": [ + "**/*.js", + "!test/" + ], + "dependencies": { + "@google-cloud/automl": "^4.0.2", + "csv": "^6.0.0", + "mathjs": "^11.0.0", + "yargs": "^17.0.0" + }, + "devDependencies": { + "@google-cloud/storage": "^7.0.1", + "chai": "^4.2.0", + "mocha": "^8.0.0", + "uuid": "^9.0.0" + } +} diff --git a/packages/google-cloud-automl/samples/quickstart.js b/packages/google-cloud-automl/samples/quickstart.js new file mode 100644 index 00000000000..7c4b2edf701 --- /dev/null +++ b/packages/google-cloud-automl/samples/quickstart.js @@ -0,0 +1,106 @@ +// Copyright 2019 Google LLC +// +// Licensed under the Apache License, Version 2.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. + +'use strict'; + +function main(projectId = 'YOUR_PROJECT_ID', location = 'us-central1') { + // [START automl_quickstart] + /** + * TODO(developer): Uncomment these variables before running the sample. + */ + // const projectId = 'YOUR_PROJECT_ID'; + // const location = 'us-central1'; + + // Imports the Google Cloud AutoML library + const {AutoMlClient} = require('@google-cloud/automl').v1; + + // Instantiates a client + const client = new AutoMlClient(); + + async function listDatasets() { + // Construct request + const request = { + parent: client.locationPath(projectId, location), + filter: 'translation_dataset_metadata:*', + }; + + const [response] = await client.listDatasets(request); + + console.log('List of datasets:'); + for (const dataset of response) { + console.log(`Dataset name: ${dataset.name}`); + console.log( + `Dataset id: ${ + dataset.name.split('/')[dataset.name.split('/').length - 1] + }` + ); + console.log(`Dataset display name: ${dataset.displayName}`); + console.log('Dataset create time'); + console.log(`\tseconds ${dataset.createTime.seconds}`); + console.log(`\tnanos ${dataset.createTime.nanos / 1e9}`); + // [END automl_language_text_classification_list_datasets] + // [END automl_translate_list_datasets] + // [END automl_vision_classification_list_datasets] + // [END automl_vision_object_detection_list_datasets] + console.log( + `Text extraction dataset metadata: ${dataset.textExtractionDatasetMetadata}` + ); + + console.log( + `Text sentiment dataset metadata: ${dataset.textSentimentDatasetMetadata}` + ); + + // [START automl_language_text_classification_list_datasets] + console.log( + `Text classification dataset metadata: ${dataset.textClassificationDatasetMetadata}` + ); + // [END automl_language_text_classification_list_datasets] + + // [START automl_translate_list_datasets] + if (dataset.translationDatasetMetadata !== undefined) { + console.log('Translation dataset metadata:'); + console.log( + `\tSource language code: ${dataset.translationDatasetMetadata.sourceLanguageCode}` + ); + console.log( + `\tTarget language code: ${dataset.translationDatasetMetadata.targetLanguageCode}` + ); + } + // [END automl_translate_list_datasets] + + // [START automl_vision_classification_list_datasets] + console.log( + `Image classification dataset metadata: ${dataset.imageClassificationDatasetMetadata}` + ); + // [END automl_vision_classification_list_datasets] + + // [START automl_vision_object_detection_list_datasets] + console.log( + `Image object detection dataset metatdata: ${dataset.imageObjectDetectionDatasetMetatdata}` + ); + // [START automl_language_text_classification_list_datasets] + // [START automl_translate_list_datasets] + // [START automl_vision_classification_list_datasets] + } + } + + listDatasets(); + // [END automl_quickstart] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-automl/samples/test/quickstart.test.js b/packages/google-cloud-automl/samples/test/quickstart.test.js new file mode 100644 index 00000000000..b8fc0708b4d --- /dev/null +++ b/packages/google-cloud-automl/samples/test/quickstart.test.js @@ -0,0 +1,36 @@ +// Copyright 2023 Google LLC +// +// Licensed under the Apache License, Version 2.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. + +'use strict'; + +const {assert} = require('chai'); +const {describe, it} = require('mocha'); +const {AutoMlClient} = require('@google-cloud/automl').v1; + +const cp = require('child_process'); + +const execSync = cmd => cp.execSync(cmd, {encoding: 'utf-8'}); + +const LOCATION = 'us-central1'; + +describe('Automl List Dataset Tests', () => { + const client = new AutoMlClient(); + + it('should list datasets', async () => { + const projectId = await client.getProjectId(); + const list_output = execSync(`node quickstart.js ${projectId} ${LOCATION}`); + + assert.match(list_output, /Dataset id/); + }); +}); diff --git a/packages/google-cloud-automl/src/index.ts b/packages/google-cloud-automl/src/index.ts new file mode 100644 index 00000000000..d8a6023d937 --- /dev/null +++ b/packages/google-cloud-automl/src/index.ts @@ -0,0 +1,30 @@ +// Copyright 2023 Google LLC +// +// Licensed under the Apache License, Version 2.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. ** + +import * as v1 from './v1'; +import * as v1beta1 from './v1beta1'; + +const AutoMlClient = v1.AutoMlClient; +type AutoMlClient = v1.AutoMlClient; +const PredictionServiceClient = v1.PredictionServiceClient; +type PredictionServiceClient = v1.PredictionServiceClient; + +export {v1, v1beta1, AutoMlClient, PredictionServiceClient}; +export default {v1, v1beta1, AutoMlClient, PredictionServiceClient}; +import * as protos from '../protos/protos'; +export {protos}; diff --git a/packages/google-cloud-automl/src/v1/auto_ml_client.ts b/packages/google-cloud-automl/src/v1/auto_ml_client.ts new file mode 100644 index 00000000000..5c794103027 --- /dev/null +++ b/packages/google-cloud-automl/src/v1/auto_ml_client.ts @@ -0,0 +1,3342 @@ +// Copyright 2023 Google LLC +// +// Licensed under the Apache License, Version 2.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, +} from 'google-gax'; +import {Transform} from 'stream'; +import * as protos from '../../protos/protos'; +import jsonProtos = require('../../protos/protos.json'); +/** + * Client JSON configuration object, loaded from + * `src/v1/auto_ml_client_config.json`. + * This file defines retry strategy and timeouts for all API methods in this library. + */ +import * as gapicConfig from './auto_ml_client_config.json'; +const version = require('../../../package.json').version; + +/** + * AutoML Server API. + * + * The resource names are assigned by the server. + * The server never reuses names that it has created after the resources with + * those names are deleted. + * + * An ID of a resource is the last element of the item's resource name. For + * `projects/{project_id}/locations/{location_id}/datasets/{dataset_id}`, then + * the id for the item is `{dataset_id}`. + * + * Currently the only supported `location_id` is "us-central1". + * + * On any input that is documented to expect a string parameter in + * snake_case or dash-case, either of those cases is accepted. + * @class + * @memberof v1 + */ +export class AutoMlClient { + 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}; + 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; + autoMlStub?: Promise<{[name: string]: Function}>; + + /** + * Construct an instance of AutoMlClient. + * + * @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://developers.google.com/identity/protocols/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 AutoMlClient({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 AutoMlClient; + const servicePath = + opts?.servicePath || opts?.apiEndpoint || staticMembers.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 !== staticMembers.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 = staticMembers.servicePath; + + // Set the default scopes in auth client if needed. + if (servicePath === staticMembers.servicePath) { + this.auth.defaultScopes = staticMembers.scopes; + } + + // Determine the client header string. + const clientHeader = [`gax/${this._gaxModule.version}`, `gapic/${version}`]; + if (typeof process !== 'undefined' && '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 = { + annotationSpecPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/datasets/{dataset}/annotationSpecs/{annotation_spec}' + ), + datasetPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/datasets/{dataset}' + ), + locationPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}' + ), + modelPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/models/{model}' + ), + modelEvaluationPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/models/{model}/modelEvaluations/{model_evaluation}' + ), + }; + + // 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 = { + listDatasets: new this._gaxModule.PageDescriptor( + 'pageToken', + 'nextPageToken', + 'datasets' + ), + listModels: new this._gaxModule.PageDescriptor( + 'pageToken', + 'nextPageToken', + 'model' + ), + listModelEvaluations: new this._gaxModule.PageDescriptor( + 'pageToken', + 'nextPageToken', + 'modelEvaluation' + ), + }; + + const protoFilesRoot = this._gaxModule.protobuf.Root.fromJSON(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: '/v1/{name=projects/*/locations/*}', + }, + { + selector: 'google.cloud.location.Locations.ListLocations', + get: '/v1/{name=projects/*}/locations', + }, + { + selector: 'google.iam.v1.IAMPolicy.GetIamPolicy', + get: '/v1/{resource=projects/*/locations/*}:getIamPolicy', + additional_bindings: [ + { + get: '/v1/{resource=projects/*/locations/*/datasets/*}:getIamPolicy', + }, + { + get: '/v1/{resource=projects/*/locations/*/models/*}:getIamPolicy', + }, + ], + }, + { + selector: 'google.iam.v1.IAMPolicy.SetIamPolicy', + post: '/v1/{resource=projects/*/locations/*}:setIamPolicy', + body: '*', + additional_bindings: [ + { + post: '/v1/{resource=projects/*/locations/*/datasets/*}:setIamPolicy', + body: '*', + }, + { + post: '/v1/{resource=projects/*/locations/*/models/*}:setIamPolicy', + body: '*', + }, + ], + }, + { + selector: 'google.iam.v1.IAMPolicy.TestIamPermissions', + post: '/v1/{resource=projects/*/locations/*/**}:testIamPermissions', + body: '*', + }, + { + selector: 'google.longrunning.Operations.CancelOperation', + post: '/v1/{name=projects/*/locations/*/operations/*}:cancel', + body: '*', + }, + { + selector: 'google.longrunning.Operations.DeleteOperation', + delete: '/v1/{name=projects/*/locations/*/operations/*}', + }, + { + selector: 'google.longrunning.Operations.GetOperation', + get: '/v1/{name=projects/*/locations/*/operations/*}', + }, + { + selector: 'google.longrunning.Operations.ListOperations', + get: '/v1/{name=projects/*/locations/*}/operations', + }, + { + selector: 'google.longrunning.Operations.WaitOperation', + post: '/v1/{name=projects/*/locations/*/operations/*}:wait', + body: '*', + }, + ]; + } + this.operationsClient = this._gaxModule + .lro(lroOptions) + .operationsClient(opts); + const createDatasetResponse = protoFilesRoot.lookup( + '.google.cloud.automl.v1.Dataset' + ) as gax.protobuf.Type; + const createDatasetMetadata = protoFilesRoot.lookup( + '.google.cloud.automl.v1.OperationMetadata' + ) as gax.protobuf.Type; + const deleteDatasetResponse = protoFilesRoot.lookup( + '.google.protobuf.Empty' + ) as gax.protobuf.Type; + const deleteDatasetMetadata = protoFilesRoot.lookup( + '.google.cloud.automl.v1.OperationMetadata' + ) as gax.protobuf.Type; + const importDataResponse = protoFilesRoot.lookup( + '.google.protobuf.Empty' + ) as gax.protobuf.Type; + const importDataMetadata = protoFilesRoot.lookup( + '.google.cloud.automl.v1.OperationMetadata' + ) as gax.protobuf.Type; + const exportDataResponse = protoFilesRoot.lookup( + '.google.protobuf.Empty' + ) as gax.protobuf.Type; + const exportDataMetadata = protoFilesRoot.lookup( + '.google.cloud.automl.v1.OperationMetadata' + ) as gax.protobuf.Type; + const createModelResponse = protoFilesRoot.lookup( + '.google.cloud.automl.v1.Model' + ) as gax.protobuf.Type; + const createModelMetadata = protoFilesRoot.lookup( + '.google.cloud.automl.v1.OperationMetadata' + ) as gax.protobuf.Type; + const deleteModelResponse = protoFilesRoot.lookup( + '.google.protobuf.Empty' + ) as gax.protobuf.Type; + const deleteModelMetadata = protoFilesRoot.lookup( + '.google.cloud.automl.v1.OperationMetadata' + ) as gax.protobuf.Type; + const deployModelResponse = protoFilesRoot.lookup( + '.google.protobuf.Empty' + ) as gax.protobuf.Type; + const deployModelMetadata = protoFilesRoot.lookup( + '.google.cloud.automl.v1.OperationMetadata' + ) as gax.protobuf.Type; + const undeployModelResponse = protoFilesRoot.lookup( + '.google.protobuf.Empty' + ) as gax.protobuf.Type; + const undeployModelMetadata = protoFilesRoot.lookup( + '.google.cloud.automl.v1.OperationMetadata' + ) as gax.protobuf.Type; + const exportModelResponse = protoFilesRoot.lookup( + '.google.protobuf.Empty' + ) as gax.protobuf.Type; + const exportModelMetadata = protoFilesRoot.lookup( + '.google.cloud.automl.v1.OperationMetadata' + ) as gax.protobuf.Type; + + this.descriptors.longrunning = { + createDataset: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + createDatasetResponse.decode.bind(createDatasetResponse), + createDatasetMetadata.decode.bind(createDatasetMetadata) + ), + deleteDataset: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + deleteDatasetResponse.decode.bind(deleteDatasetResponse), + deleteDatasetMetadata.decode.bind(deleteDatasetMetadata) + ), + importData: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + importDataResponse.decode.bind(importDataResponse), + importDataMetadata.decode.bind(importDataMetadata) + ), + exportData: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + exportDataResponse.decode.bind(exportDataResponse), + exportDataMetadata.decode.bind(exportDataMetadata) + ), + createModel: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + createModelResponse.decode.bind(createModelResponse), + createModelMetadata.decode.bind(createModelMetadata) + ), + deleteModel: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + deleteModelResponse.decode.bind(deleteModelResponse), + deleteModelMetadata.decode.bind(deleteModelMetadata) + ), + deployModel: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + deployModelResponse.decode.bind(deployModelResponse), + deployModelMetadata.decode.bind(deployModelMetadata) + ), + undeployModel: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + undeployModelResponse.decode.bind(undeployModelResponse), + undeployModelMetadata.decode.bind(undeployModelMetadata) + ), + exportModel: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + exportModelResponse.decode.bind(exportModelResponse), + exportModelMetadata.decode.bind(exportModelMetadata) + ), + }; + + // Put together the default options sent with requests. + this._defaults = this._gaxGrpc.constructSettings( + 'google.cloud.automl.v1.AutoMl', + 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.autoMlStub) { + return this.autoMlStub; + } + + // Put together the "service stub" for + // google.cloud.automl.v1.AutoMl. + this.autoMlStub = this._gaxGrpc.createStub( + this._opts.fallback + ? (this._protos as protobuf.Root).lookupService( + 'google.cloud.automl.v1.AutoMl' + ) + : // eslint-disable-next-line @typescript-eslint/no-explicit-any + (this._protos as any).google.cloud.automl.v1.AutoMl, + 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 autoMlStubMethods = [ + 'createDataset', + 'getDataset', + 'listDatasets', + 'updateDataset', + 'deleteDataset', + 'importData', + 'exportData', + 'getAnnotationSpec', + 'createModel', + 'getModel', + 'listModels', + 'deleteModel', + 'updateModel', + 'deployModel', + 'undeployModel', + 'exportModel', + 'getModelEvaluation', + 'listModelEvaluations', + ]; + for (const methodName of autoMlStubMethods) { + const callPromise = this.autoMlStub.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] || + this.descriptors.longrunning[methodName] || + undefined; + const apiCall = this._gaxModule.createApiCall( + callPromise, + this._defaults[methodName], + descriptor, + this._opts.fallback + ); + + this.innerApiCalls[methodName] = apiCall; + } + + return this.autoMlStub; + } + + /** + * The DNS address for this API service. + * @returns {string} The DNS address for this service. + */ + static get servicePath() { + return 'automl.googleapis.com'; + } + + /** + * The DNS address for this API service - same as servicePath(), + * exists for compatibility reasons. + * @returns {string} The DNS address for this service. + */ + static get apiEndpoint() { + return 'automl.googleapis.com'; + } + + /** + * 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 -- + // ------------------- + /** + * Gets a dataset. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The resource name of the dataset to retrieve. + * @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.automl.v1.Dataset|Dataset}. + * 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/auto_ml.get_dataset.js + * region_tag:automl_v1_generated_AutoMl_GetDataset_async + */ + getDataset( + request?: protos.google.cloud.automl.v1.IGetDatasetRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.automl.v1.IDataset, + protos.google.cloud.automl.v1.IGetDatasetRequest | undefined, + {} | undefined, + ] + >; + getDataset( + request: protos.google.cloud.automl.v1.IGetDatasetRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.automl.v1.IDataset, + protos.google.cloud.automl.v1.IGetDatasetRequest | null | undefined, + {} | null | undefined + > + ): void; + getDataset( + request: protos.google.cloud.automl.v1.IGetDatasetRequest, + callback: Callback< + protos.google.cloud.automl.v1.IDataset, + protos.google.cloud.automl.v1.IGetDatasetRequest | null | undefined, + {} | null | undefined + > + ): void; + getDataset( + request?: protos.google.cloud.automl.v1.IGetDatasetRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.automl.v1.IDataset, + protos.google.cloud.automl.v1.IGetDatasetRequest | null | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.automl.v1.IDataset, + protos.google.cloud.automl.v1.IGetDatasetRequest | null | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.automl.v1.IDataset, + protos.google.cloud.automl.v1.IGetDatasetRequest | 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(); + return this.innerApiCalls.getDataset(request, options, callback); + } + /** + * Updates a dataset. + * + * @param {Object} request + * The request object that will be sent. + * @param {google.cloud.automl.v1.Dataset} request.dataset + * Required. The dataset which replaces the resource on the server. + * @param {google.protobuf.FieldMask} request.updateMask + * Required. The update mask applies to the resource. + * @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.automl.v1.Dataset|Dataset}. + * 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/auto_ml.update_dataset.js + * region_tag:automl_v1_generated_AutoMl_UpdateDataset_async + */ + updateDataset( + request?: protos.google.cloud.automl.v1.IUpdateDatasetRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.automl.v1.IDataset, + protos.google.cloud.automl.v1.IUpdateDatasetRequest | undefined, + {} | undefined, + ] + >; + updateDataset( + request: protos.google.cloud.automl.v1.IUpdateDatasetRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.automl.v1.IDataset, + protos.google.cloud.automl.v1.IUpdateDatasetRequest | null | undefined, + {} | null | undefined + > + ): void; + updateDataset( + request: protos.google.cloud.automl.v1.IUpdateDatasetRequest, + callback: Callback< + protos.google.cloud.automl.v1.IDataset, + protos.google.cloud.automl.v1.IUpdateDatasetRequest | null | undefined, + {} | null | undefined + > + ): void; + updateDataset( + request?: protos.google.cloud.automl.v1.IUpdateDatasetRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.automl.v1.IDataset, + | protos.google.cloud.automl.v1.IUpdateDatasetRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.automl.v1.IDataset, + protos.google.cloud.automl.v1.IUpdateDatasetRequest | null | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.automl.v1.IDataset, + protos.google.cloud.automl.v1.IUpdateDatasetRequest | 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({ + 'dataset.name': request.dataset!.name ?? '', + }); + this.initialize(); + return this.innerApiCalls.updateDataset(request, options, callback); + } + /** + * Gets an annotation spec. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The resource name of the annotation spec to retrieve. + * @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.automl.v1.AnnotationSpec|AnnotationSpec}. + * 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/auto_ml.get_annotation_spec.js + * region_tag:automl_v1_generated_AutoMl_GetAnnotationSpec_async + */ + getAnnotationSpec( + request?: protos.google.cloud.automl.v1.IGetAnnotationSpecRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.automl.v1.IAnnotationSpec, + protos.google.cloud.automl.v1.IGetAnnotationSpecRequest | undefined, + {} | undefined, + ] + >; + getAnnotationSpec( + request: protos.google.cloud.automl.v1.IGetAnnotationSpecRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.automl.v1.IAnnotationSpec, + | protos.google.cloud.automl.v1.IGetAnnotationSpecRequest + | null + | undefined, + {} | null | undefined + > + ): void; + getAnnotationSpec( + request: protos.google.cloud.automl.v1.IGetAnnotationSpecRequest, + callback: Callback< + protos.google.cloud.automl.v1.IAnnotationSpec, + | protos.google.cloud.automl.v1.IGetAnnotationSpecRequest + | null + | undefined, + {} | null | undefined + > + ): void; + getAnnotationSpec( + request?: protos.google.cloud.automl.v1.IGetAnnotationSpecRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.automl.v1.IAnnotationSpec, + | protos.google.cloud.automl.v1.IGetAnnotationSpecRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.automl.v1.IAnnotationSpec, + | protos.google.cloud.automl.v1.IGetAnnotationSpecRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.automl.v1.IAnnotationSpec, + protos.google.cloud.automl.v1.IGetAnnotationSpecRequest | 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(); + return this.innerApiCalls.getAnnotationSpec(request, options, callback); + } + /** + * Gets a model. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. Resource name of the model. + * @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.automl.v1.Model|Model}. + * 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/auto_ml.get_model.js + * region_tag:automl_v1_generated_AutoMl_GetModel_async + */ + getModel( + request?: protos.google.cloud.automl.v1.IGetModelRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.automl.v1.IModel, + protos.google.cloud.automl.v1.IGetModelRequest | undefined, + {} | undefined, + ] + >; + getModel( + request: protos.google.cloud.automl.v1.IGetModelRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.automl.v1.IModel, + protos.google.cloud.automl.v1.IGetModelRequest | null | undefined, + {} | null | undefined + > + ): void; + getModel( + request: protos.google.cloud.automl.v1.IGetModelRequest, + callback: Callback< + protos.google.cloud.automl.v1.IModel, + protos.google.cloud.automl.v1.IGetModelRequest | null | undefined, + {} | null | undefined + > + ): void; + getModel( + request?: protos.google.cloud.automl.v1.IGetModelRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.automl.v1.IModel, + protos.google.cloud.automl.v1.IGetModelRequest | null | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.automl.v1.IModel, + protos.google.cloud.automl.v1.IGetModelRequest | null | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.automl.v1.IModel, + protos.google.cloud.automl.v1.IGetModelRequest | 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(); + return this.innerApiCalls.getModel(request, options, callback); + } + /** + * Updates a model. + * + * @param {Object} request + * The request object that will be sent. + * @param {google.cloud.automl.v1.Model} request.model + * Required. The model which replaces the resource on the server. + * @param {google.protobuf.FieldMask} request.updateMask + * Required. The update mask applies to the resource. + * @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.automl.v1.Model|Model}. + * 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/auto_ml.update_model.js + * region_tag:automl_v1_generated_AutoMl_UpdateModel_async + */ + updateModel( + request?: protos.google.cloud.automl.v1.IUpdateModelRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.automl.v1.IModel, + protos.google.cloud.automl.v1.IUpdateModelRequest | undefined, + {} | undefined, + ] + >; + updateModel( + request: protos.google.cloud.automl.v1.IUpdateModelRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.automl.v1.IModel, + protos.google.cloud.automl.v1.IUpdateModelRequest | null | undefined, + {} | null | undefined + > + ): void; + updateModel( + request: protos.google.cloud.automl.v1.IUpdateModelRequest, + callback: Callback< + protos.google.cloud.automl.v1.IModel, + protos.google.cloud.automl.v1.IUpdateModelRequest | null | undefined, + {} | null | undefined + > + ): void; + updateModel( + request?: protos.google.cloud.automl.v1.IUpdateModelRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.automl.v1.IModel, + protos.google.cloud.automl.v1.IUpdateModelRequest | null | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.automl.v1.IModel, + protos.google.cloud.automl.v1.IUpdateModelRequest | null | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.automl.v1.IModel, + protos.google.cloud.automl.v1.IUpdateModelRequest | 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({ + 'model.name': request.model!.name ?? '', + }); + this.initialize(); + return this.innerApiCalls.updateModel(request, options, callback); + } + /** + * Gets a model evaluation. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. Resource name for the model evaluation. + * @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.automl.v1.ModelEvaluation|ModelEvaluation}. + * 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/auto_ml.get_model_evaluation.js + * region_tag:automl_v1_generated_AutoMl_GetModelEvaluation_async + */ + getModelEvaluation( + request?: protos.google.cloud.automl.v1.IGetModelEvaluationRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.automl.v1.IModelEvaluation, + protos.google.cloud.automl.v1.IGetModelEvaluationRequest | undefined, + {} | undefined, + ] + >; + getModelEvaluation( + request: protos.google.cloud.automl.v1.IGetModelEvaluationRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.automl.v1.IModelEvaluation, + | protos.google.cloud.automl.v1.IGetModelEvaluationRequest + | null + | undefined, + {} | null | undefined + > + ): void; + getModelEvaluation( + request: protos.google.cloud.automl.v1.IGetModelEvaluationRequest, + callback: Callback< + protos.google.cloud.automl.v1.IModelEvaluation, + | protos.google.cloud.automl.v1.IGetModelEvaluationRequest + | null + | undefined, + {} | null | undefined + > + ): void; + getModelEvaluation( + request?: protos.google.cloud.automl.v1.IGetModelEvaluationRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.automl.v1.IModelEvaluation, + | protos.google.cloud.automl.v1.IGetModelEvaluationRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.automl.v1.IModelEvaluation, + | protos.google.cloud.automl.v1.IGetModelEvaluationRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.automl.v1.IModelEvaluation, + protos.google.cloud.automl.v1.IGetModelEvaluationRequest | 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(); + return this.innerApiCalls.getModelEvaluation(request, options, callback); + } + + /** + * Creates a dataset. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The resource name of the project to create the dataset for. + * @param {google.cloud.automl.v1.Dataset} request.dataset + * Required. The dataset 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 + * 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/auto_ml.create_dataset.js + * region_tag:automl_v1_generated_AutoMl_CreateDataset_async + */ + createDataset( + request?: protos.google.cloud.automl.v1.ICreateDatasetRequest, + options?: CallOptions + ): Promise< + [ + LROperation< + protos.google.cloud.automl.v1.IDataset, + protos.google.cloud.automl.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined, + ] + >; + createDataset( + request: protos.google.cloud.automl.v1.ICreateDatasetRequest, + options: CallOptions, + callback: Callback< + LROperation< + protos.google.cloud.automl.v1.IDataset, + protos.google.cloud.automl.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + createDataset( + request: protos.google.cloud.automl.v1.ICreateDatasetRequest, + callback: Callback< + LROperation< + protos.google.cloud.automl.v1.IDataset, + protos.google.cloud.automl.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + createDataset( + request?: protos.google.cloud.automl.v1.ICreateDatasetRequest, + optionsOrCallback?: + | CallOptions + | Callback< + LROperation< + protos.google.cloud.automl.v1.IDataset, + protos.google.cloud.automl.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + callback?: Callback< + LROperation< + protos.google.cloud.automl.v1.IDataset, + protos.google.cloud.automl.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): Promise< + [ + LROperation< + protos.google.cloud.automl.v1.IDataset, + protos.google.cloud.automl.v1.IOperationMetadata + >, + 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(); + return this.innerApiCalls.createDataset(request, options, callback); + } + /** + * Check the status of the long running operation returned by `createDataset()`. + * @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/auto_ml.create_dataset.js + * region_tag:automl_v1_generated_AutoMl_CreateDataset_async + */ + async checkCreateDatasetProgress( + name: string + ): Promise< + LROperation< + protos.google.cloud.automl.v1.Dataset, + protos.google.cloud.automl.v1.OperationMetadata + > + > { + 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.createDataset, + this._gaxModule.createDefaultBackoffSettings() + ); + return decodeOperation as LROperation< + protos.google.cloud.automl.v1.Dataset, + protos.google.cloud.automl.v1.OperationMetadata + >; + } + /** + * Deletes a dataset and all of its contents. + * Returns empty response in the + * {@link protos.google.longrunning.Operation.response|response} field when it completes, + * and `delete_details` in the + * {@link protos.google.longrunning.Operation.metadata|metadata} field. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The resource name of the dataset to delete. + * @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/auto_ml.delete_dataset.js + * region_tag:automl_v1_generated_AutoMl_DeleteDataset_async + */ + deleteDataset( + request?: protos.google.cloud.automl.v1.IDeleteDatasetRequest, + options?: CallOptions + ): Promise< + [ + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.automl.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined, + ] + >; + deleteDataset( + request: protos.google.cloud.automl.v1.IDeleteDatasetRequest, + options: CallOptions, + callback: Callback< + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.automl.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + deleteDataset( + request: protos.google.cloud.automl.v1.IDeleteDatasetRequest, + callback: Callback< + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.automl.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + deleteDataset( + request?: protos.google.cloud.automl.v1.IDeleteDatasetRequest, + optionsOrCallback?: + | CallOptions + | Callback< + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.automl.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + callback?: Callback< + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.automl.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): Promise< + [ + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.automl.v1.IOperationMetadata + >, + 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(); + return this.innerApiCalls.deleteDataset(request, options, callback); + } + /** + * Check the status of the long running operation returned by `deleteDataset()`. + * @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/auto_ml.delete_dataset.js + * region_tag:automl_v1_generated_AutoMl_DeleteDataset_async + */ + async checkDeleteDatasetProgress( + name: string + ): Promise< + LROperation< + protos.google.protobuf.Empty, + protos.google.cloud.automl.v1.OperationMetadata + > + > { + 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.deleteDataset, + this._gaxModule.createDefaultBackoffSettings() + ); + return decodeOperation as LROperation< + protos.google.protobuf.Empty, + protos.google.cloud.automl.v1.OperationMetadata + >; + } + /** + * Imports data into a dataset. + * For Tables this method can only be called on an empty Dataset. + * + * For Tables: + * * A + * {@link protos.google.cloud.automl.v1.InputConfig.params|schema_inference_version} + * parameter must be explicitly set. + * Returns an empty response in the + * {@link protos.google.longrunning.Operation.response|response} field when it completes. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. Dataset name. Dataset must already exist. All imported + * annotations and examples will be added. + * @param {google.cloud.automl.v1.InputConfig} request.inputConfig + * Required. The desired input location and its domain specific semantics, + * if any. + * @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/auto_ml.import_data.js + * region_tag:automl_v1_generated_AutoMl_ImportData_async + */ + importData( + request?: protos.google.cloud.automl.v1.IImportDataRequest, + options?: CallOptions + ): Promise< + [ + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.automl.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined, + ] + >; + importData( + request: protos.google.cloud.automl.v1.IImportDataRequest, + options: CallOptions, + callback: Callback< + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.automl.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + importData( + request: protos.google.cloud.automl.v1.IImportDataRequest, + callback: Callback< + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.automl.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + importData( + request?: protos.google.cloud.automl.v1.IImportDataRequest, + optionsOrCallback?: + | CallOptions + | Callback< + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.automl.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + callback?: Callback< + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.automl.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): Promise< + [ + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.automl.v1.IOperationMetadata + >, + 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(); + return this.innerApiCalls.importData(request, options, callback); + } + /** + * Check the status of the long running operation returned by `importData()`. + * @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/auto_ml.import_data.js + * region_tag:automl_v1_generated_AutoMl_ImportData_async + */ + async checkImportDataProgress( + name: string + ): Promise< + LROperation< + protos.google.protobuf.Empty, + protos.google.cloud.automl.v1.OperationMetadata + > + > { + 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.importData, + this._gaxModule.createDefaultBackoffSettings() + ); + return decodeOperation as LROperation< + protos.google.protobuf.Empty, + protos.google.cloud.automl.v1.OperationMetadata + >; + } + /** + * Exports dataset's data to the provided output location. + * Returns an empty response in the + * {@link protos.google.longrunning.Operation.response|response} field when it completes. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The resource name of the dataset. + * @param {google.cloud.automl.v1.OutputConfig} request.outputConfig + * Required. The desired output 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/v1/auto_ml.export_data.js + * region_tag:automl_v1_generated_AutoMl_ExportData_async + */ + exportData( + request?: protos.google.cloud.automl.v1.IExportDataRequest, + options?: CallOptions + ): Promise< + [ + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.automl.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined, + ] + >; + exportData( + request: protos.google.cloud.automl.v1.IExportDataRequest, + options: CallOptions, + callback: Callback< + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.automl.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + exportData( + request: protos.google.cloud.automl.v1.IExportDataRequest, + callback: Callback< + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.automl.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + exportData( + request?: protos.google.cloud.automl.v1.IExportDataRequest, + optionsOrCallback?: + | CallOptions + | Callback< + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.automl.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + callback?: Callback< + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.automl.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): Promise< + [ + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.automl.v1.IOperationMetadata + >, + 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(); + return this.innerApiCalls.exportData(request, options, callback); + } + /** + * Check the status of the long running operation returned by `exportData()`. + * @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/auto_ml.export_data.js + * region_tag:automl_v1_generated_AutoMl_ExportData_async + */ + async checkExportDataProgress( + name: string + ): Promise< + LROperation< + protos.google.protobuf.Empty, + protos.google.cloud.automl.v1.OperationMetadata + > + > { + 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.exportData, + this._gaxModule.createDefaultBackoffSettings() + ); + return decodeOperation as LROperation< + protos.google.protobuf.Empty, + protos.google.cloud.automl.v1.OperationMetadata + >; + } + /** + * Creates a model. + * Returns a Model in the {@link protos.google.longrunning.Operation.response|response} + * field when it completes. + * When you create a model, several model evaluations are created for it: + * a global evaluation, and one evaluation for each annotation spec. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. Resource name of the parent project where the model is being created. + * @param {google.cloud.automl.v1.Model} request.model + * Required. The model 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 + * 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/auto_ml.create_model.js + * region_tag:automl_v1_generated_AutoMl_CreateModel_async + */ + createModel( + request?: protos.google.cloud.automl.v1.ICreateModelRequest, + options?: CallOptions + ): Promise< + [ + LROperation< + protos.google.cloud.automl.v1.IModel, + protos.google.cloud.automl.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined, + ] + >; + createModel( + request: protos.google.cloud.automl.v1.ICreateModelRequest, + options: CallOptions, + callback: Callback< + LROperation< + protos.google.cloud.automl.v1.IModel, + protos.google.cloud.automl.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + createModel( + request: protos.google.cloud.automl.v1.ICreateModelRequest, + callback: Callback< + LROperation< + protos.google.cloud.automl.v1.IModel, + protos.google.cloud.automl.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + createModel( + request?: protos.google.cloud.automl.v1.ICreateModelRequest, + optionsOrCallback?: + | CallOptions + | Callback< + LROperation< + protos.google.cloud.automl.v1.IModel, + protos.google.cloud.automl.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + callback?: Callback< + LROperation< + protos.google.cloud.automl.v1.IModel, + protos.google.cloud.automl.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): Promise< + [ + LROperation< + protos.google.cloud.automl.v1.IModel, + protos.google.cloud.automl.v1.IOperationMetadata + >, + 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(); + return this.innerApiCalls.createModel(request, options, callback); + } + /** + * Check the status of the long running operation returned by `createModel()`. + * @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/auto_ml.create_model.js + * region_tag:automl_v1_generated_AutoMl_CreateModel_async + */ + async checkCreateModelProgress( + name: string + ): Promise< + LROperation< + protos.google.cloud.automl.v1.Model, + protos.google.cloud.automl.v1.OperationMetadata + > + > { + 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.createModel, + this._gaxModule.createDefaultBackoffSettings() + ); + return decodeOperation as LROperation< + protos.google.cloud.automl.v1.Model, + protos.google.cloud.automl.v1.OperationMetadata + >; + } + /** + * Deletes a model. + * Returns `google.protobuf.Empty` in the + * {@link protos.google.longrunning.Operation.response|response} field when it completes, + * and `delete_details` in the + * {@link protos.google.longrunning.Operation.metadata|metadata} field. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. Resource name of the model being 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 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/auto_ml.delete_model.js + * region_tag:automl_v1_generated_AutoMl_DeleteModel_async + */ + deleteModel( + request?: protos.google.cloud.automl.v1.IDeleteModelRequest, + options?: CallOptions + ): Promise< + [ + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.automl.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined, + ] + >; + deleteModel( + request: protos.google.cloud.automl.v1.IDeleteModelRequest, + options: CallOptions, + callback: Callback< + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.automl.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + deleteModel( + request: protos.google.cloud.automl.v1.IDeleteModelRequest, + callback: Callback< + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.automl.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + deleteModel( + request?: protos.google.cloud.automl.v1.IDeleteModelRequest, + optionsOrCallback?: + | CallOptions + | Callback< + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.automl.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + callback?: Callback< + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.automl.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): Promise< + [ + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.automl.v1.IOperationMetadata + >, + 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(); + return this.innerApiCalls.deleteModel(request, options, callback); + } + /** + * Check the status of the long running operation returned by `deleteModel()`. + * @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/auto_ml.delete_model.js + * region_tag:automl_v1_generated_AutoMl_DeleteModel_async + */ + async checkDeleteModelProgress( + name: string + ): Promise< + LROperation< + protos.google.protobuf.Empty, + protos.google.cloud.automl.v1.OperationMetadata + > + > { + 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.deleteModel, + this._gaxModule.createDefaultBackoffSettings() + ); + return decodeOperation as LROperation< + protos.google.protobuf.Empty, + protos.google.cloud.automl.v1.OperationMetadata + >; + } + /** + * Deploys a model. If a model is already deployed, deploying it with the + * same parameters has no effect. Deploying with different parametrs + * (as e.g. changing + * {@link protos.google.cloud.automl.v1p1beta.ImageObjectDetectionModelDeploymentMetadata.node_number|node_number}) + * will reset the deployment state without pausing the model's availability. + * + * Only applicable for Text Classification, Image Object Detection , Tables, and Image Segmentation; all other domains manage + * deployment automatically. + * + * Returns an empty response in the + * {@link protos.google.longrunning.Operation.response|response} field when it completes. + * + * @param {Object} request + * The request object that will be sent. + * @param {google.cloud.automl.v1.ImageObjectDetectionModelDeploymentMetadata} request.imageObjectDetectionModelDeploymentMetadata + * Model deployment metadata specific to Image Object Detection. + * @param {google.cloud.automl.v1.ImageClassificationModelDeploymentMetadata} request.imageClassificationModelDeploymentMetadata + * Model deployment metadata specific to Image Classification. + * @param {string} request.name + * Required. Resource name of the model to deploy. + * @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/auto_ml.deploy_model.js + * region_tag:automl_v1_generated_AutoMl_DeployModel_async + */ + deployModel( + request?: protos.google.cloud.automl.v1.IDeployModelRequest, + options?: CallOptions + ): Promise< + [ + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.automl.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined, + ] + >; + deployModel( + request: protos.google.cloud.automl.v1.IDeployModelRequest, + options: CallOptions, + callback: Callback< + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.automl.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + deployModel( + request: protos.google.cloud.automl.v1.IDeployModelRequest, + callback: Callback< + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.automl.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + deployModel( + request?: protos.google.cloud.automl.v1.IDeployModelRequest, + optionsOrCallback?: + | CallOptions + | Callback< + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.automl.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + callback?: Callback< + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.automl.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): Promise< + [ + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.automl.v1.IOperationMetadata + >, + 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(); + return this.innerApiCalls.deployModel(request, options, callback); + } + /** + * Check the status of the long running operation returned by `deployModel()`. + * @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/auto_ml.deploy_model.js + * region_tag:automl_v1_generated_AutoMl_DeployModel_async + */ + async checkDeployModelProgress( + name: string + ): Promise< + LROperation< + protos.google.protobuf.Empty, + protos.google.cloud.automl.v1.OperationMetadata + > + > { + 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.deployModel, + this._gaxModule.createDefaultBackoffSettings() + ); + return decodeOperation as LROperation< + protos.google.protobuf.Empty, + protos.google.cloud.automl.v1.OperationMetadata + >; + } + /** + * Undeploys a model. If the model is not deployed this method has no effect. + * + * Only applicable for Text Classification, Image Object Detection and Tables; + * all other domains manage deployment automatically. + * + * Returns an empty response in the + * {@link protos.google.longrunning.Operation.response|response} field when it completes. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. Resource name of the model to undeploy. + * @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/auto_ml.undeploy_model.js + * region_tag:automl_v1_generated_AutoMl_UndeployModel_async + */ + undeployModel( + request?: protos.google.cloud.automl.v1.IUndeployModelRequest, + options?: CallOptions + ): Promise< + [ + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.automl.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined, + ] + >; + undeployModel( + request: protos.google.cloud.automl.v1.IUndeployModelRequest, + options: CallOptions, + callback: Callback< + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.automl.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + undeployModel( + request: protos.google.cloud.automl.v1.IUndeployModelRequest, + callback: Callback< + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.automl.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + undeployModel( + request?: protos.google.cloud.automl.v1.IUndeployModelRequest, + optionsOrCallback?: + | CallOptions + | Callback< + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.automl.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + callback?: Callback< + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.automl.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): Promise< + [ + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.automl.v1.IOperationMetadata + >, + 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(); + return this.innerApiCalls.undeployModel(request, options, callback); + } + /** + * Check the status of the long running operation returned by `undeployModel()`. + * @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/auto_ml.undeploy_model.js + * region_tag:automl_v1_generated_AutoMl_UndeployModel_async + */ + async checkUndeployModelProgress( + name: string + ): Promise< + LROperation< + protos.google.protobuf.Empty, + protos.google.cloud.automl.v1.OperationMetadata + > + > { + 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.undeployModel, + this._gaxModule.createDefaultBackoffSettings() + ); + return decodeOperation as LROperation< + protos.google.protobuf.Empty, + protos.google.cloud.automl.v1.OperationMetadata + >; + } + /** + * Exports a trained, "export-able", model to a user specified Google Cloud + * Storage location. A model is considered export-able if and only if it has + * an export format defined for it in + * {@link protos.google.cloud.automl.v1.ModelExportOutputConfig|ModelExportOutputConfig}. + * + * Returns an empty response in the + * {@link protos.google.longrunning.Operation.response|response} field when it completes. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The resource name of the model to export. + * @param {google.cloud.automl.v1.ModelExportOutputConfig} request.outputConfig + * Required. The desired output location and configuration. + * @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/auto_ml.export_model.js + * region_tag:automl_v1_generated_AutoMl_ExportModel_async + */ + exportModel( + request?: protos.google.cloud.automl.v1.IExportModelRequest, + options?: CallOptions + ): Promise< + [ + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.automl.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined, + ] + >; + exportModel( + request: protos.google.cloud.automl.v1.IExportModelRequest, + options: CallOptions, + callback: Callback< + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.automl.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + exportModel( + request: protos.google.cloud.automl.v1.IExportModelRequest, + callback: Callback< + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.automl.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + exportModel( + request?: protos.google.cloud.automl.v1.IExportModelRequest, + optionsOrCallback?: + | CallOptions + | Callback< + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.automl.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + callback?: Callback< + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.automl.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): Promise< + [ + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.automl.v1.IOperationMetadata + >, + 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(); + return this.innerApiCalls.exportModel(request, options, callback); + } + /** + * Check the status of the long running operation returned by `exportModel()`. + * @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/auto_ml.export_model.js + * region_tag:automl_v1_generated_AutoMl_ExportModel_async + */ + async checkExportModelProgress( + name: string + ): Promise< + LROperation< + protos.google.protobuf.Empty, + protos.google.cloud.automl.v1.OperationMetadata + > + > { + 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.exportModel, + this._gaxModule.createDefaultBackoffSettings() + ); + return decodeOperation as LROperation< + protos.google.protobuf.Empty, + protos.google.cloud.automl.v1.OperationMetadata + >; + } + /** + * Lists datasets in a project. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The resource name of the project from which to list datasets. + * @param {string} request.filter + * An expression for filtering the results of the request. + * + * * `dataset_metadata` - for existence of the case (e.g. + * `image_classification_dataset_metadata:*`). Some examples of using the filter are: + * + * * `translation_dataset_metadata:*` --> The dataset has + * `translation_dataset_metadata`. + * @param {number} request.pageSize + * Requested page size. Server may return fewer results than requested. + * If unspecified, server will pick a default size. + * @param {string} request.pageToken + * A token identifying a page of results for the server to return + * Typically obtained via + * {@link protos.google.cloud.automl.v1.ListDatasetsResponse.next_page_token|ListDatasetsResponse.next_page_token} of the previous + * {@link protos.google.cloud.automl.v1.AutoMl.ListDatasets|AutoMl.ListDatasets} call. + * @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.automl.v1.Dataset|Dataset}. + * 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 `listDatasetsAsync()` + * 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. + */ + listDatasets( + request?: protos.google.cloud.automl.v1.IListDatasetsRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.automl.v1.IDataset[], + protos.google.cloud.automl.v1.IListDatasetsRequest | null, + protos.google.cloud.automl.v1.IListDatasetsResponse, + ] + >; + listDatasets( + request: protos.google.cloud.automl.v1.IListDatasetsRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.cloud.automl.v1.IListDatasetsRequest, + protos.google.cloud.automl.v1.IListDatasetsResponse | null | undefined, + protos.google.cloud.automl.v1.IDataset + > + ): void; + listDatasets( + request: protos.google.cloud.automl.v1.IListDatasetsRequest, + callback: PaginationCallback< + protos.google.cloud.automl.v1.IListDatasetsRequest, + protos.google.cloud.automl.v1.IListDatasetsResponse | null | undefined, + protos.google.cloud.automl.v1.IDataset + > + ): void; + listDatasets( + request?: protos.google.cloud.automl.v1.IListDatasetsRequest, + optionsOrCallback?: + | CallOptions + | PaginationCallback< + protos.google.cloud.automl.v1.IListDatasetsRequest, + | protos.google.cloud.automl.v1.IListDatasetsResponse + | null + | undefined, + protos.google.cloud.automl.v1.IDataset + >, + callback?: PaginationCallback< + protos.google.cloud.automl.v1.IListDatasetsRequest, + protos.google.cloud.automl.v1.IListDatasetsResponse | null | undefined, + protos.google.cloud.automl.v1.IDataset + > + ): Promise< + [ + protos.google.cloud.automl.v1.IDataset[], + protos.google.cloud.automl.v1.IListDatasetsRequest | null, + protos.google.cloud.automl.v1.IListDatasetsResponse, + ] + > | 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(); + return this.innerApiCalls.listDatasets(request, options, callback); + } + + /** + * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The resource name of the project from which to list datasets. + * @param {string} request.filter + * An expression for filtering the results of the request. + * + * * `dataset_metadata` - for existence of the case (e.g. + * `image_classification_dataset_metadata:*`). Some examples of using the filter are: + * + * * `translation_dataset_metadata:*` --> The dataset has + * `translation_dataset_metadata`. + * @param {number} request.pageSize + * Requested page size. Server may return fewer results than requested. + * If unspecified, server will pick a default size. + * @param {string} request.pageToken + * A token identifying a page of results for the server to return + * Typically obtained via + * {@link protos.google.cloud.automl.v1.ListDatasetsResponse.next_page_token|ListDatasetsResponse.next_page_token} of the previous + * {@link protos.google.cloud.automl.v1.AutoMl.ListDatasets|AutoMl.ListDatasets} call. + * @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.automl.v1.Dataset|Dataset} 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 `listDatasetsAsync()` + * 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. + */ + listDatasetsStream( + request?: protos.google.cloud.automl.v1.IListDatasetsRequest, + 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['listDatasets']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.listDatasets.createStream( + this.innerApiCalls.listDatasets as GaxCall, + request, + callSettings + ); + } + + /** + * Equivalent to `listDatasets`, 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 resource name of the project from which to list datasets. + * @param {string} request.filter + * An expression for filtering the results of the request. + * + * * `dataset_metadata` - for existence of the case (e.g. + * `image_classification_dataset_metadata:*`). Some examples of using the filter are: + * + * * `translation_dataset_metadata:*` --> The dataset has + * `translation_dataset_metadata`. + * @param {number} request.pageSize + * Requested page size. Server may return fewer results than requested. + * If unspecified, server will pick a default size. + * @param {string} request.pageToken + * A token identifying a page of results for the server to return + * Typically obtained via + * {@link protos.google.cloud.automl.v1.ListDatasetsResponse.next_page_token|ListDatasetsResponse.next_page_token} of the previous + * {@link protos.google.cloud.automl.v1.AutoMl.ListDatasets|AutoMl.ListDatasets} call. + * @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.automl.v1.Dataset|Dataset}. 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/auto_ml.list_datasets.js + * region_tag:automl_v1_generated_AutoMl_ListDatasets_async + */ + listDatasetsAsync( + request?: protos.google.cloud.automl.v1.IListDatasetsRequest, + 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['listDatasets']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.listDatasets.asyncIterate( + this.innerApiCalls['listDatasets'] as GaxCall, + request as {}, + callSettings + ) as AsyncIterable; + } + /** + * Lists models. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. Resource name of the project, from which to list the models. + * @param {string} request.filter + * An expression for filtering the results of the request. + * + * * `model_metadata` - for existence of the case (e.g. + * `video_classification_model_metadata:*`). + * * `dataset_id` - for = or !=. Some examples of using the filter are: + * + * * `image_classification_model_metadata:*` --> The model has + * `image_classification_model_metadata`. + * * `dataset_id=5` --> The model was created from a dataset with ID 5. + * @param {number} request.pageSize + * Requested page size. + * @param {string} request.pageToken + * A token identifying a page of results for the server to return + * Typically obtained via + * {@link protos.google.cloud.automl.v1.ListModelsResponse.next_page_token|ListModelsResponse.next_page_token} of the previous + * {@link protos.google.cloud.automl.v1.AutoMl.ListModels|AutoMl.ListModels} call. + * @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.automl.v1.Model|Model}. + * 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 `listModelsAsync()` + * 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. + */ + listModels( + request?: protos.google.cloud.automl.v1.IListModelsRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.automl.v1.IModel[], + protos.google.cloud.automl.v1.IListModelsRequest | null, + protos.google.cloud.automl.v1.IListModelsResponse, + ] + >; + listModels( + request: protos.google.cloud.automl.v1.IListModelsRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.cloud.automl.v1.IListModelsRequest, + protos.google.cloud.automl.v1.IListModelsResponse | null | undefined, + protos.google.cloud.automl.v1.IModel + > + ): void; + listModels( + request: protos.google.cloud.automl.v1.IListModelsRequest, + callback: PaginationCallback< + protos.google.cloud.automl.v1.IListModelsRequest, + protos.google.cloud.automl.v1.IListModelsResponse | null | undefined, + protos.google.cloud.automl.v1.IModel + > + ): void; + listModels( + request?: protos.google.cloud.automl.v1.IListModelsRequest, + optionsOrCallback?: + | CallOptions + | PaginationCallback< + protos.google.cloud.automl.v1.IListModelsRequest, + protos.google.cloud.automl.v1.IListModelsResponse | null | undefined, + protos.google.cloud.automl.v1.IModel + >, + callback?: PaginationCallback< + protos.google.cloud.automl.v1.IListModelsRequest, + protos.google.cloud.automl.v1.IListModelsResponse | null | undefined, + protos.google.cloud.automl.v1.IModel + > + ): Promise< + [ + protos.google.cloud.automl.v1.IModel[], + protos.google.cloud.automl.v1.IListModelsRequest | null, + protos.google.cloud.automl.v1.IListModelsResponse, + ] + > | 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(); + return this.innerApiCalls.listModels(request, options, callback); + } + + /** + * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. Resource name of the project, from which to list the models. + * @param {string} request.filter + * An expression for filtering the results of the request. + * + * * `model_metadata` - for existence of the case (e.g. + * `video_classification_model_metadata:*`). + * * `dataset_id` - for = or !=. Some examples of using the filter are: + * + * * `image_classification_model_metadata:*` --> The model has + * `image_classification_model_metadata`. + * * `dataset_id=5` --> The model was created from a dataset with ID 5. + * @param {number} request.pageSize + * Requested page size. + * @param {string} request.pageToken + * A token identifying a page of results for the server to return + * Typically obtained via + * {@link protos.google.cloud.automl.v1.ListModelsResponse.next_page_token|ListModelsResponse.next_page_token} of the previous + * {@link protos.google.cloud.automl.v1.AutoMl.ListModels|AutoMl.ListModels} call. + * @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.automl.v1.Model|Model} 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 `listModelsAsync()` + * 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. + */ + listModelsStream( + request?: protos.google.cloud.automl.v1.IListModelsRequest, + 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['listModels']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.listModels.createStream( + this.innerApiCalls.listModels as GaxCall, + request, + callSettings + ); + } + + /** + * Equivalent to `listModels`, 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. Resource name of the project, from which to list the models. + * @param {string} request.filter + * An expression for filtering the results of the request. + * + * * `model_metadata` - for existence of the case (e.g. + * `video_classification_model_metadata:*`). + * * `dataset_id` - for = or !=. Some examples of using the filter are: + * + * * `image_classification_model_metadata:*` --> The model has + * `image_classification_model_metadata`. + * * `dataset_id=5` --> The model was created from a dataset with ID 5. + * @param {number} request.pageSize + * Requested page size. + * @param {string} request.pageToken + * A token identifying a page of results for the server to return + * Typically obtained via + * {@link protos.google.cloud.automl.v1.ListModelsResponse.next_page_token|ListModelsResponse.next_page_token} of the previous + * {@link protos.google.cloud.automl.v1.AutoMl.ListModels|AutoMl.ListModels} call. + * @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.automl.v1.Model|Model}. 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/auto_ml.list_models.js + * region_tag:automl_v1_generated_AutoMl_ListModels_async + */ + listModelsAsync( + request?: protos.google.cloud.automl.v1.IListModelsRequest, + 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['listModels']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.listModels.asyncIterate( + this.innerApiCalls['listModels'] as GaxCall, + request as {}, + callSettings + ) as AsyncIterable; + } + /** + * Lists model evaluations. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. Resource name of the model to list the model evaluations for. + * If modelId is set as "-", this will list model evaluations from across all + * models of the parent location. + * @param {string} request.filter + * Required. An expression for filtering the results of the request. + * + * * `annotation_spec_id` - for =, != or existence. See example below for + * the last. + * + * Some examples of using the filter are: + * + * * `annotation_spec_id!=4` --> The model evaluation was done for + * annotation spec with ID different than 4. + * * `NOT annotation_spec_id:*` --> The model evaluation was done for + * aggregate of all annotation specs. + * @param {number} request.pageSize + * Requested page size. + * @param {string} request.pageToken + * A token identifying a page of results for the server to return. + * Typically obtained via + * {@link protos.google.cloud.automl.v1.ListModelEvaluationsResponse.next_page_token|ListModelEvaluationsResponse.next_page_token} of the previous + * {@link protos.google.cloud.automl.v1.AutoMl.ListModelEvaluations|AutoMl.ListModelEvaluations} call. + * @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.automl.v1.ModelEvaluation|ModelEvaluation}. + * 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 `listModelEvaluationsAsync()` + * 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. + */ + listModelEvaluations( + request?: protos.google.cloud.automl.v1.IListModelEvaluationsRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.automl.v1.IModelEvaluation[], + protos.google.cloud.automl.v1.IListModelEvaluationsRequest | null, + protos.google.cloud.automl.v1.IListModelEvaluationsResponse, + ] + >; + listModelEvaluations( + request: protos.google.cloud.automl.v1.IListModelEvaluationsRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.cloud.automl.v1.IListModelEvaluationsRequest, + | protos.google.cloud.automl.v1.IListModelEvaluationsResponse + | null + | undefined, + protos.google.cloud.automl.v1.IModelEvaluation + > + ): void; + listModelEvaluations( + request: protos.google.cloud.automl.v1.IListModelEvaluationsRequest, + callback: PaginationCallback< + protos.google.cloud.automl.v1.IListModelEvaluationsRequest, + | protos.google.cloud.automl.v1.IListModelEvaluationsResponse + | null + | undefined, + protos.google.cloud.automl.v1.IModelEvaluation + > + ): void; + listModelEvaluations( + request?: protos.google.cloud.automl.v1.IListModelEvaluationsRequest, + optionsOrCallback?: + | CallOptions + | PaginationCallback< + protos.google.cloud.automl.v1.IListModelEvaluationsRequest, + | protos.google.cloud.automl.v1.IListModelEvaluationsResponse + | null + | undefined, + protos.google.cloud.automl.v1.IModelEvaluation + >, + callback?: PaginationCallback< + protos.google.cloud.automl.v1.IListModelEvaluationsRequest, + | protos.google.cloud.automl.v1.IListModelEvaluationsResponse + | null + | undefined, + protos.google.cloud.automl.v1.IModelEvaluation + > + ): Promise< + [ + protos.google.cloud.automl.v1.IModelEvaluation[], + protos.google.cloud.automl.v1.IListModelEvaluationsRequest | null, + protos.google.cloud.automl.v1.IListModelEvaluationsResponse, + ] + > | 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(); + return this.innerApiCalls.listModelEvaluations(request, options, callback); + } + + /** + * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. Resource name of the model to list the model evaluations for. + * If modelId is set as "-", this will list model evaluations from across all + * models of the parent location. + * @param {string} request.filter + * Required. An expression for filtering the results of the request. + * + * * `annotation_spec_id` - for =, != or existence. See example below for + * the last. + * + * Some examples of using the filter are: + * + * * `annotation_spec_id!=4` --> The model evaluation was done for + * annotation spec with ID different than 4. + * * `NOT annotation_spec_id:*` --> The model evaluation was done for + * aggregate of all annotation specs. + * @param {number} request.pageSize + * Requested page size. + * @param {string} request.pageToken + * A token identifying a page of results for the server to return. + * Typically obtained via + * {@link protos.google.cloud.automl.v1.ListModelEvaluationsResponse.next_page_token|ListModelEvaluationsResponse.next_page_token} of the previous + * {@link protos.google.cloud.automl.v1.AutoMl.ListModelEvaluations|AutoMl.ListModelEvaluations} call. + * @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.automl.v1.ModelEvaluation|ModelEvaluation} 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 `listModelEvaluationsAsync()` + * 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. + */ + listModelEvaluationsStream( + request?: protos.google.cloud.automl.v1.IListModelEvaluationsRequest, + 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['listModelEvaluations']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.listModelEvaluations.createStream( + this.innerApiCalls.listModelEvaluations as GaxCall, + request, + callSettings + ); + } + + /** + * Equivalent to `listModelEvaluations`, 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. Resource name of the model to list the model evaluations for. + * If modelId is set as "-", this will list model evaluations from across all + * models of the parent location. + * @param {string} request.filter + * Required. An expression for filtering the results of the request. + * + * * `annotation_spec_id` - for =, != or existence. See example below for + * the last. + * + * Some examples of using the filter are: + * + * * `annotation_spec_id!=4` --> The model evaluation was done for + * annotation spec with ID different than 4. + * * `NOT annotation_spec_id:*` --> The model evaluation was done for + * aggregate of all annotation specs. + * @param {number} request.pageSize + * Requested page size. + * @param {string} request.pageToken + * A token identifying a page of results for the server to return. + * Typically obtained via + * {@link protos.google.cloud.automl.v1.ListModelEvaluationsResponse.next_page_token|ListModelEvaluationsResponse.next_page_token} of the previous + * {@link protos.google.cloud.automl.v1.AutoMl.ListModelEvaluations|AutoMl.ListModelEvaluations} call. + * @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.automl.v1.ModelEvaluation|ModelEvaluation}. 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/auto_ml.list_model_evaluations.js + * region_tag:automl_v1_generated_AutoMl_ListModelEvaluations_async + */ + listModelEvaluationsAsync( + request?: protos.google.cloud.automl.v1.IListModelEvaluationsRequest, + 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['listModelEvaluations']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.listModelEvaluations.asyncIterate( + this.innerApiCalls['listModelEvaluations'] as GaxCall, + request as {}, + callSettings + ) as AsyncIterable; + } + // -------------------- + // -- Path templates -- + // -------------------- + + /** + * Return a fully-qualified annotationSpec resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} dataset + * @param {string} annotation_spec + * @returns {string} Resource name string. + */ + annotationSpecPath( + project: string, + location: string, + dataset: string, + annotationSpec: string + ) { + return this.pathTemplates.annotationSpecPathTemplate.render({ + project: project, + location: location, + dataset: dataset, + annotation_spec: annotationSpec, + }); + } + + /** + * Parse the project from AnnotationSpec resource. + * + * @param {string} annotationSpecName + * A fully-qualified path representing AnnotationSpec resource. + * @returns {string} A string representing the project. + */ + matchProjectFromAnnotationSpecName(annotationSpecName: string) { + return this.pathTemplates.annotationSpecPathTemplate.match( + annotationSpecName + ).project; + } + + /** + * Parse the location from AnnotationSpec resource. + * + * @param {string} annotationSpecName + * A fully-qualified path representing AnnotationSpec resource. + * @returns {string} A string representing the location. + */ + matchLocationFromAnnotationSpecName(annotationSpecName: string) { + return this.pathTemplates.annotationSpecPathTemplate.match( + annotationSpecName + ).location; + } + + /** + * Parse the dataset from AnnotationSpec resource. + * + * @param {string} annotationSpecName + * A fully-qualified path representing AnnotationSpec resource. + * @returns {string} A string representing the dataset. + */ + matchDatasetFromAnnotationSpecName(annotationSpecName: string) { + return this.pathTemplates.annotationSpecPathTemplate.match( + annotationSpecName + ).dataset; + } + + /** + * Parse the annotation_spec from AnnotationSpec resource. + * + * @param {string} annotationSpecName + * A fully-qualified path representing AnnotationSpec resource. + * @returns {string} A string representing the annotation_spec. + */ + matchAnnotationSpecFromAnnotationSpecName(annotationSpecName: string) { + return this.pathTemplates.annotationSpecPathTemplate.match( + annotationSpecName + ).annotation_spec; + } + + /** + * Return a fully-qualified dataset resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} dataset + * @returns {string} Resource name string. + */ + datasetPath(project: string, location: string, dataset: string) { + return this.pathTemplates.datasetPathTemplate.render({ + project: project, + location: location, + dataset: dataset, + }); + } + + /** + * Parse the project from Dataset resource. + * + * @param {string} datasetName + * A fully-qualified path representing Dataset resource. + * @returns {string} A string representing the project. + */ + matchProjectFromDatasetName(datasetName: string) { + return this.pathTemplates.datasetPathTemplate.match(datasetName).project; + } + + /** + * Parse the location from Dataset resource. + * + * @param {string} datasetName + * A fully-qualified path representing Dataset resource. + * @returns {string} A string representing the location. + */ + matchLocationFromDatasetName(datasetName: string) { + return this.pathTemplates.datasetPathTemplate.match(datasetName).location; + } + + /** + * Parse the dataset from Dataset resource. + * + * @param {string} datasetName + * A fully-qualified path representing Dataset resource. + * @returns {string} A string representing the dataset. + */ + matchDatasetFromDatasetName(datasetName: string) { + return this.pathTemplates.datasetPathTemplate.match(datasetName).dataset; + } + + /** + * 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 model resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} model + * @returns {string} Resource name string. + */ + modelPath(project: string, location: string, model: string) { + return this.pathTemplates.modelPathTemplate.render({ + project: project, + location: location, + model: model, + }); + } + + /** + * Parse the project from Model resource. + * + * @param {string} modelName + * A fully-qualified path representing Model resource. + * @returns {string} A string representing the project. + */ + matchProjectFromModelName(modelName: string) { + return this.pathTemplates.modelPathTemplate.match(modelName).project; + } + + /** + * Parse the location from Model resource. + * + * @param {string} modelName + * A fully-qualified path representing Model resource. + * @returns {string} A string representing the location. + */ + matchLocationFromModelName(modelName: string) { + return this.pathTemplates.modelPathTemplate.match(modelName).location; + } + + /** + * Parse the model from Model resource. + * + * @param {string} modelName + * A fully-qualified path representing Model resource. + * @returns {string} A string representing the model. + */ + matchModelFromModelName(modelName: string) { + return this.pathTemplates.modelPathTemplate.match(modelName).model; + } + + /** + * Return a fully-qualified modelEvaluation resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} model + * @param {string} model_evaluation + * @returns {string} Resource name string. + */ + modelEvaluationPath( + project: string, + location: string, + model: string, + modelEvaluation: string + ) { + return this.pathTemplates.modelEvaluationPathTemplate.render({ + project: project, + location: location, + model: model, + model_evaluation: modelEvaluation, + }); + } + + /** + * Parse the project from ModelEvaluation resource. + * + * @param {string} modelEvaluationName + * A fully-qualified path representing ModelEvaluation resource. + * @returns {string} A string representing the project. + */ + matchProjectFromModelEvaluationName(modelEvaluationName: string) { + return this.pathTemplates.modelEvaluationPathTemplate.match( + modelEvaluationName + ).project; + } + + /** + * Parse the location from ModelEvaluation resource. + * + * @param {string} modelEvaluationName + * A fully-qualified path representing ModelEvaluation resource. + * @returns {string} A string representing the location. + */ + matchLocationFromModelEvaluationName(modelEvaluationName: string) { + return this.pathTemplates.modelEvaluationPathTemplate.match( + modelEvaluationName + ).location; + } + + /** + * Parse the model from ModelEvaluation resource. + * + * @param {string} modelEvaluationName + * A fully-qualified path representing ModelEvaluation resource. + * @returns {string} A string representing the model. + */ + matchModelFromModelEvaluationName(modelEvaluationName: string) { + return this.pathTemplates.modelEvaluationPathTemplate.match( + modelEvaluationName + ).model; + } + + /** + * Parse the model_evaluation from ModelEvaluation resource. + * + * @param {string} modelEvaluationName + * A fully-qualified path representing ModelEvaluation resource. + * @returns {string} A string representing the model_evaluation. + */ + matchModelEvaluationFromModelEvaluationName(modelEvaluationName: string) { + return this.pathTemplates.modelEvaluationPathTemplate.match( + modelEvaluationName + ).model_evaluation; + } + + /** + * 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.autoMlStub && !this._terminated) { + return this.autoMlStub.then(stub => { + this._terminated = true; + stub.close(); + this.operationsClient.close(); + }); + } + return Promise.resolve(); + } +} diff --git a/packages/google-cloud-automl/src/v1/auto_ml_client_config.json b/packages/google-cloud-automl/src/v1/auto_ml_client_config.json new file mode 100644 index 00000000000..3ad4956b39f --- /dev/null +++ b/packages/google-cloud-automl/src/v1/auto_ml_client_config.json @@ -0,0 +1,116 @@ +{ + "interfaces": { + "google.cloud.automl.v1.AutoMl": { + "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": { + "CreateDataset": { + "timeout_millis": 5000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "GetDataset": { + "timeout_millis": 5000, + "retry_codes_name": "idempotent", + "retry_params_name": "default" + }, + "ListDatasets": { + "timeout_millis": 5000, + "retry_codes_name": "idempotent", + "retry_params_name": "default" + }, + "UpdateDataset": { + "timeout_millis": 5000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "DeleteDataset": { + "timeout_millis": 5000, + "retry_codes_name": "idempotent", + "retry_params_name": "default" + }, + "ImportData": { + "timeout_millis": 5000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "ExportData": { + "timeout_millis": 5000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "GetAnnotationSpec": { + "timeout_millis": 5000, + "retry_codes_name": "idempotent", + "retry_params_name": "default" + }, + "CreateModel": { + "timeout_millis": 5000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "GetModel": { + "timeout_millis": 5000, + "retry_codes_name": "idempotent", + "retry_params_name": "default" + }, + "ListModels": { + "timeout_millis": 5000, + "retry_codes_name": "idempotent", + "retry_params_name": "default" + }, + "DeleteModel": { + "timeout_millis": 5000, + "retry_codes_name": "idempotent", + "retry_params_name": "default" + }, + "UpdateModel": { + "timeout_millis": 5000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "DeployModel": { + "timeout_millis": 5000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "UndeployModel": { + "timeout_millis": 5000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "ExportModel": { + "timeout_millis": 5000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "GetModelEvaluation": { + "timeout_millis": 5000, + "retry_codes_name": "idempotent", + "retry_params_name": "default" + }, + "ListModelEvaluations": { + "timeout_millis": 5000, + "retry_codes_name": "idempotent", + "retry_params_name": "default" + } + } + } + } +} diff --git a/packages/google-cloud-automl/src/v1/auto_ml_proto_list.json b/packages/google-cloud-automl/src/v1/auto_ml_proto_list.json new file mode 100644 index 00000000000..f15ad4ecded --- /dev/null +++ b/packages/google-cloud-automl/src/v1/auto_ml_proto_list.json @@ -0,0 +1,21 @@ +[ + "../../protos/google/cloud/automl/v1/annotation_payload.proto", + "../../protos/google/cloud/automl/v1/annotation_spec.proto", + "../../protos/google/cloud/automl/v1/classification.proto", + "../../protos/google/cloud/automl/v1/data_items.proto", + "../../protos/google/cloud/automl/v1/dataset.proto", + "../../protos/google/cloud/automl/v1/detection.proto", + "../../protos/google/cloud/automl/v1/geometry.proto", + "../../protos/google/cloud/automl/v1/image.proto", + "../../protos/google/cloud/automl/v1/io.proto", + "../../protos/google/cloud/automl/v1/model.proto", + "../../protos/google/cloud/automl/v1/model_evaluation.proto", + "../../protos/google/cloud/automl/v1/operations.proto", + "../../protos/google/cloud/automl/v1/prediction_service.proto", + "../../protos/google/cloud/automl/v1/service.proto", + "../../protos/google/cloud/automl/v1/text.proto", + "../../protos/google/cloud/automl/v1/text_extraction.proto", + "../../protos/google/cloud/automl/v1/text_segment.proto", + "../../protos/google/cloud/automl/v1/text_sentiment.proto", + "../../protos/google/cloud/automl/v1/translation.proto" +] diff --git a/packages/google-cloud-automl/src/v1/gapic_metadata.json b/packages/google-cloud-automl/src/v1/gapic_metadata.json new file mode 100644 index 00000000000..dc46712ae9b --- /dev/null +++ b/packages/google-cloud-automl/src/v1/gapic_metadata.json @@ -0,0 +1,249 @@ +{ + "schema": "1.0", + "comment": "This file maps proto services/RPCs to the corresponding library clients/methods", + "language": "typescript", + "protoPackage": "google.cloud.automl.v1", + "libraryPackage": "@google-cloud/automl", + "services": { + "AutoMl": { + "clients": { + "grpc": { + "libraryClient": "AutoMlClient", + "rpcs": { + "GetDataset": { + "methods": [ + "getDataset" + ] + }, + "UpdateDataset": { + "methods": [ + "updateDataset" + ] + }, + "GetAnnotationSpec": { + "methods": [ + "getAnnotationSpec" + ] + }, + "GetModel": { + "methods": [ + "getModel" + ] + }, + "UpdateModel": { + "methods": [ + "updateModel" + ] + }, + "GetModelEvaluation": { + "methods": [ + "getModelEvaluation" + ] + }, + "CreateDataset": { + "methods": [ + "createDataset" + ] + }, + "DeleteDataset": { + "methods": [ + "deleteDataset" + ] + }, + "ImportData": { + "methods": [ + "importData" + ] + }, + "ExportData": { + "methods": [ + "exportData" + ] + }, + "CreateModel": { + "methods": [ + "createModel" + ] + }, + "DeleteModel": { + "methods": [ + "deleteModel" + ] + }, + "DeployModel": { + "methods": [ + "deployModel" + ] + }, + "UndeployModel": { + "methods": [ + "undeployModel" + ] + }, + "ExportModel": { + "methods": [ + "exportModel" + ] + }, + "ListDatasets": { + "methods": [ + "listDatasets", + "listDatasetsStream", + "listDatasetsAsync" + ] + }, + "ListModels": { + "methods": [ + "listModels", + "listModelsStream", + "listModelsAsync" + ] + }, + "ListModelEvaluations": { + "methods": [ + "listModelEvaluations", + "listModelEvaluationsStream", + "listModelEvaluationsAsync" + ] + } + } + }, + "grpc-fallback": { + "libraryClient": "AutoMlClient", + "rpcs": { + "GetDataset": { + "methods": [ + "getDataset" + ] + }, + "UpdateDataset": { + "methods": [ + "updateDataset" + ] + }, + "GetAnnotationSpec": { + "methods": [ + "getAnnotationSpec" + ] + }, + "GetModel": { + "methods": [ + "getModel" + ] + }, + "UpdateModel": { + "methods": [ + "updateModel" + ] + }, + "GetModelEvaluation": { + "methods": [ + "getModelEvaluation" + ] + }, + "CreateDataset": { + "methods": [ + "createDataset" + ] + }, + "DeleteDataset": { + "methods": [ + "deleteDataset" + ] + }, + "ImportData": { + "methods": [ + "importData" + ] + }, + "ExportData": { + "methods": [ + "exportData" + ] + }, + "CreateModel": { + "methods": [ + "createModel" + ] + }, + "DeleteModel": { + "methods": [ + "deleteModel" + ] + }, + "DeployModel": { + "methods": [ + "deployModel" + ] + }, + "UndeployModel": { + "methods": [ + "undeployModel" + ] + }, + "ExportModel": { + "methods": [ + "exportModel" + ] + }, + "ListDatasets": { + "methods": [ + "listDatasets", + "listDatasetsStream", + "listDatasetsAsync" + ] + }, + "ListModels": { + "methods": [ + "listModels", + "listModelsStream", + "listModelsAsync" + ] + }, + "ListModelEvaluations": { + "methods": [ + "listModelEvaluations", + "listModelEvaluationsStream", + "listModelEvaluationsAsync" + ] + } + } + } + } + }, + "PredictionService": { + "clients": { + "grpc": { + "libraryClient": "PredictionServiceClient", + "rpcs": { + "Predict": { + "methods": [ + "predict" + ] + }, + "BatchPredict": { + "methods": [ + "batchPredict" + ] + } + } + }, + "grpc-fallback": { + "libraryClient": "PredictionServiceClient", + "rpcs": { + "Predict": { + "methods": [ + "predict" + ] + }, + "BatchPredict": { + "methods": [ + "batchPredict" + ] + } + } + } + } + } + } +} diff --git a/packages/google-cloud-automl/src/v1/index.ts b/packages/google-cloud-automl/src/v1/index.ts new file mode 100644 index 00000000000..d736d0fb81a --- /dev/null +++ b/packages/google-cloud-automl/src/v1/index.ts @@ -0,0 +1,20 @@ +// Copyright 2023 Google LLC +// +// Licensed under the Apache License, Version 2.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 {AutoMlClient} from './auto_ml_client'; +export {PredictionServiceClient} from './prediction_service_client'; diff --git a/packages/google-cloud-automl/src/v1/prediction_service_client.ts b/packages/google-cloud-automl/src/v1/prediction_service_client.ts new file mode 100644 index 00000000000..88ff607ae29 --- /dev/null +++ b/packages/google-cloud-automl/src/v1/prediction_service_client.ts @@ -0,0 +1,1083 @@ +// Copyright 2023 Google LLC +// +// Licensed under the Apache License, Version 2.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 * as protos from '../../protos/protos'; +import jsonProtos = require('../../protos/protos.json'); +/** + * Client JSON configuration object, loaded from + * `src/v1/prediction_service_client_config.json`. + * This file defines retry strategy and timeouts for all API methods in this library. + */ +import * as gapicConfig from './prediction_service_client_config.json'; +const version = require('../../../package.json').version; + +/** + * AutoML Prediction API. + * + * On any input that is documented to expect a string parameter in + * snake_case or dash-case, either of those cases is accepted. + * @class + * @memberof v1 + */ +export class PredictionServiceClient { + 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}; + 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; + predictionServiceStub?: Promise<{[name: string]: Function}>; + + /** + * Construct an instance of PredictionServiceClient. + * + * @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://developers.google.com/identity/protocols/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 PredictionServiceClient({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 PredictionServiceClient; + const servicePath = + opts?.servicePath || opts?.apiEndpoint || staticMembers.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 !== staticMembers.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 = staticMembers.servicePath; + + // Set the default scopes in auth client if needed. + if (servicePath === staticMembers.servicePath) { + this.auth.defaultScopes = staticMembers.scopes; + } + + // Determine the client header string. + const clientHeader = [`gax/${this._gaxModule.version}`, `gapic/${version}`]; + if (typeof process !== 'undefined' && '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 = { + annotationSpecPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/datasets/{dataset}/annotationSpecs/{annotation_spec}' + ), + datasetPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/datasets/{dataset}' + ), + modelPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/models/{model}' + ), + modelEvaluationPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/models/{model}/modelEvaluations/{model_evaluation}' + ), + }; + + const protoFilesRoot = this._gaxModule.protobuf.Root.fromJSON(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: '/v1/{name=projects/*/locations/*}', + }, + { + selector: 'google.cloud.location.Locations.ListLocations', + get: '/v1/{name=projects/*}/locations', + }, + { + selector: 'google.iam.v1.IAMPolicy.GetIamPolicy', + get: '/v1/{resource=projects/*/locations/*}:getIamPolicy', + additional_bindings: [ + { + get: '/v1/{resource=projects/*/locations/*/datasets/*}:getIamPolicy', + }, + { + get: '/v1/{resource=projects/*/locations/*/models/*}:getIamPolicy', + }, + ], + }, + { + selector: 'google.iam.v1.IAMPolicy.SetIamPolicy', + post: '/v1/{resource=projects/*/locations/*}:setIamPolicy', + body: '*', + additional_bindings: [ + { + post: '/v1/{resource=projects/*/locations/*/datasets/*}:setIamPolicy', + body: '*', + }, + { + post: '/v1/{resource=projects/*/locations/*/models/*}:setIamPolicy', + body: '*', + }, + ], + }, + { + selector: 'google.iam.v1.IAMPolicy.TestIamPermissions', + post: '/v1/{resource=projects/*/locations/*/**}:testIamPermissions', + body: '*', + }, + { + selector: 'google.longrunning.Operations.CancelOperation', + post: '/v1/{name=projects/*/locations/*/operations/*}:cancel', + body: '*', + }, + { + selector: 'google.longrunning.Operations.DeleteOperation', + delete: '/v1/{name=projects/*/locations/*/operations/*}', + }, + { + selector: 'google.longrunning.Operations.GetOperation', + get: '/v1/{name=projects/*/locations/*/operations/*}', + }, + { + selector: 'google.longrunning.Operations.ListOperations', + get: '/v1/{name=projects/*/locations/*}/operations', + }, + { + selector: 'google.longrunning.Operations.WaitOperation', + post: '/v1/{name=projects/*/locations/*/operations/*}:wait', + body: '*', + }, + ]; + } + this.operationsClient = this._gaxModule + .lro(lroOptions) + .operationsClient(opts); + const batchPredictResponse = protoFilesRoot.lookup( + '.google.cloud.automl.v1.BatchPredictResult' + ) as gax.protobuf.Type; + const batchPredictMetadata = protoFilesRoot.lookup( + '.google.cloud.automl.v1.OperationMetadata' + ) as gax.protobuf.Type; + + this.descriptors.longrunning = { + batchPredict: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + batchPredictResponse.decode.bind(batchPredictResponse), + batchPredictMetadata.decode.bind(batchPredictMetadata) + ), + }; + + // Put together the default options sent with requests. + this._defaults = this._gaxGrpc.constructSettings( + 'google.cloud.automl.v1.PredictionService', + 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.predictionServiceStub) { + return this.predictionServiceStub; + } + + // Put together the "service stub" for + // google.cloud.automl.v1.PredictionService. + this.predictionServiceStub = this._gaxGrpc.createStub( + this._opts.fallback + ? (this._protos as protobuf.Root).lookupService( + 'google.cloud.automl.v1.PredictionService' + ) + : // eslint-disable-next-line @typescript-eslint/no-explicit-any + (this._protos as any).google.cloud.automl.v1.PredictionService, + 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 predictionServiceStubMethods = ['predict', 'batchPredict']; + for (const methodName of predictionServiceStubMethods) { + const callPromise = this.predictionServiceStub.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.longrunning[methodName] || undefined; + const apiCall = this._gaxModule.createApiCall( + callPromise, + this._defaults[methodName], + descriptor, + this._opts.fallback + ); + + this.innerApiCalls[methodName] = apiCall; + } + + return this.predictionServiceStub; + } + + /** + * The DNS address for this API service. + * @returns {string} The DNS address for this service. + */ + static get servicePath() { + return 'automl.googleapis.com'; + } + + /** + * The DNS address for this API service - same as servicePath(), + * exists for compatibility reasons. + * @returns {string} The DNS address for this service. + */ + static get apiEndpoint() { + return 'automl.googleapis.com'; + } + + /** + * 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 -- + // ------------------- + /** + * Perform an online prediction. The prediction result is directly + * returned in the response. + * Available for following ML scenarios, and their expected request payloads: + * + * AutoML Vision Classification + * + * * An image in .JPEG, .GIF or .PNG format, image_bytes up to 30MB. + * + * AutoML Vision Object Detection + * + * * An image in .JPEG, .GIF or .PNG format, image_bytes up to 30MB. + * + * AutoML Natural Language Classification + * + * * A TextSnippet up to 60,000 characters, UTF-8 encoded or a document in + * .PDF, .TIF or .TIFF format with size upto 2MB. + * + * AutoML Natural Language Entity Extraction + * + * * A TextSnippet up to 10,000 characters, UTF-8 NFC encoded or a document + * in .PDF, .TIF or .TIFF format with size upto 20MB. + * + * AutoML Natural Language Sentiment Analysis + * + * * A TextSnippet up to 60,000 characters, UTF-8 encoded or a document in + * .PDF, .TIF or .TIFF format with size upto 2MB. + * + * AutoML Translation + * + * * A TextSnippet up to 25,000 characters, UTF-8 encoded. + * + * AutoML Tables + * + * * A row with column values matching + * the columns of the model, up to 5MB. Not available for FORECASTING + * `prediction_type`. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. Name of the model requested to serve the prediction. + * @param {google.cloud.automl.v1.ExamplePayload} request.payload + * Required. Payload to perform a prediction on. The payload must match the + * problem type that the model was trained to solve. + * @param {number[]} request.params + * Additional domain-specific parameters, any string must be up to 25000 + * characters long. + * + * AutoML Vision Classification + * + * `score_threshold` + * : (float) A value from 0.0 to 1.0. When the model + * makes predictions for an image, it will only produce results that have + * at least this confidence score. The default is 0.5. + * + * AutoML Vision Object Detection + * + * `score_threshold` + * : (float) When Model detects objects on the image, + * it will only produce bounding boxes which have at least this + * confidence score. Value in 0 to 1 range, default is 0.5. + * + * `max_bounding_box_count` + * : (int64) The maximum number of bounding + * boxes returned. The default is 100. The + * number of returned bounding boxes might be limited by the server. + * + * AutoML Tables + * + * `feature_importance` + * : (boolean) Whether + * {@link protos.google.cloud.automl.v1.TablesModelColumnInfo.feature_importance|feature_importance} + * is populated in the returned list of + * {@link protos.google.cloud.automl.v1.TablesAnnotation|TablesAnnotation} + * objects. The default is false. + * @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.automl.v1.PredictResponse|PredictResponse}. + * 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/prediction_service.predict.js + * region_tag:automl_v1_generated_PredictionService_Predict_async + */ + predict( + request?: protos.google.cloud.automl.v1.IPredictRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.automl.v1.IPredictResponse, + protos.google.cloud.automl.v1.IPredictRequest | undefined, + {} | undefined, + ] + >; + predict( + request: protos.google.cloud.automl.v1.IPredictRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.automl.v1.IPredictResponse, + protos.google.cloud.automl.v1.IPredictRequest | null | undefined, + {} | null | undefined + > + ): void; + predict( + request: protos.google.cloud.automl.v1.IPredictRequest, + callback: Callback< + protos.google.cloud.automl.v1.IPredictResponse, + protos.google.cloud.automl.v1.IPredictRequest | null | undefined, + {} | null | undefined + > + ): void; + predict( + request?: protos.google.cloud.automl.v1.IPredictRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.automl.v1.IPredictResponse, + protos.google.cloud.automl.v1.IPredictRequest | null | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.automl.v1.IPredictResponse, + protos.google.cloud.automl.v1.IPredictRequest | null | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.automl.v1.IPredictResponse, + protos.google.cloud.automl.v1.IPredictRequest | 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(); + return this.innerApiCalls.predict(request, options, callback); + } + + /** + * Perform a batch prediction. Unlike the online {@link protos.google.cloud.automl.v1.PredictionService.Predict|Predict}, batch + * prediction result won't be immediately available in the response. Instead, + * a long running operation object is returned. User can poll the operation + * result via {@link protos.google.longrunning.Operations.GetOperation|GetOperation} + * method. Once the operation is done, {@link protos.google.cloud.automl.v1.BatchPredictResult|BatchPredictResult} is returned in + * the {@link protos.google.longrunning.Operation.response|response} field. + * Available for following ML scenarios: + * + * * AutoML Vision Classification + * * AutoML Vision Object Detection + * * AutoML Video Intelligence Classification + * * AutoML Video Intelligence Object Tracking * AutoML Natural Language Classification + * * AutoML Natural Language Entity Extraction + * * AutoML Natural Language Sentiment Analysis + * * AutoML Tables + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. Name of the model requested to serve the batch prediction. + * @param {google.cloud.automl.v1.BatchPredictInputConfig} request.inputConfig + * Required. The input configuration for batch prediction. + * @param {google.cloud.automl.v1.BatchPredictOutputConfig} request.outputConfig + * Required. The Configuration specifying where output predictions should + * be written. + * @param {number[]} request.params + * Additional domain-specific parameters for the predictions, any string must + * be up to 25000 characters long. + * + * AutoML Natural Language Classification + * + * `score_threshold` + * : (float) A value from 0.0 to 1.0. When the model + * makes predictions for a text snippet, it will only produce results + * that have at least this confidence score. The default is 0.5. + * + * + * AutoML Vision Classification + * + * `score_threshold` + * : (float) A value from 0.0 to 1.0. When the model + * makes predictions for an image, it will only produce results that + * have at least this confidence score. The default is 0.5. + * + * AutoML Vision Object Detection + * + * `score_threshold` + * : (float) When Model detects objects on the image, + * it will only produce bounding boxes which have at least this + * confidence score. Value in 0 to 1 range, default is 0.5. + * + * `max_bounding_box_count` + * : (int64) The maximum number of bounding + * boxes returned per image. The default is 100, the + * number of bounding boxes returned might be limited by the server. + * AutoML Video Intelligence Classification + * + * `score_threshold` + * : (float) A value from 0.0 to 1.0. When the model + * makes predictions for a video, it will only produce results that + * have at least this confidence score. The default is 0.5. + * + * `segment_classification` + * : (boolean) Set to true to request + * segment-level classification. AutoML Video Intelligence returns + * labels and their confidence scores for the entire segment of the + * video that user specified in the request configuration. + * The default is true. + * + * `shot_classification` + * : (boolean) Set to true to request shot-level + * classification. AutoML Video Intelligence determines the boundaries + * for each camera shot in the entire segment of the video that user + * specified in the request configuration. AutoML Video Intelligence + * then returns labels and their confidence scores for each detected + * shot, along with the start and end time of the shot. + * The default is false. + * + * WARNING: Model evaluation is not done for this classification type, + * the quality of it depends on training data, but there are no metrics + * provided to describe that quality. + * + * `1s_interval_classification` + * : (boolean) Set to true to request + * classification for a video at one-second intervals. AutoML Video + * Intelligence returns labels and their confidence scores for each + * second of the entire segment of the video that user specified in the + * request configuration. The default is false. + * + * WARNING: Model evaluation is not done for this classification + * type, the quality of it depends on training data, but there are no + * metrics provided to describe that quality. + * + * AutoML Video Intelligence Object Tracking + * + * `score_threshold` + * : (float) When Model detects objects on video frames, + * it will only produce bounding boxes which have at least this + * confidence score. Value in 0 to 1 range, default is 0.5. + * + * `max_bounding_box_count` + * : (int64) The maximum number of bounding + * boxes returned per image. The default is 100, the + * number of bounding boxes returned might be limited by the server. + * + * `min_bounding_box_size` + * : (float) Only bounding boxes with shortest edge + * at least that long as a relative value of video frame size are + * returned. Value in 0 to 1 range. Default is 0. + * + * @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/prediction_service.batch_predict.js + * region_tag:automl_v1_generated_PredictionService_BatchPredict_async + */ + batchPredict( + request?: protos.google.cloud.automl.v1.IBatchPredictRequest, + options?: CallOptions + ): Promise< + [ + LROperation< + protos.google.cloud.automl.v1.IBatchPredictResult, + protos.google.cloud.automl.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined, + ] + >; + batchPredict( + request: protos.google.cloud.automl.v1.IBatchPredictRequest, + options: CallOptions, + callback: Callback< + LROperation< + protos.google.cloud.automl.v1.IBatchPredictResult, + protos.google.cloud.automl.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + batchPredict( + request: protos.google.cloud.automl.v1.IBatchPredictRequest, + callback: Callback< + LROperation< + protos.google.cloud.automl.v1.IBatchPredictResult, + protos.google.cloud.automl.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + batchPredict( + request?: protos.google.cloud.automl.v1.IBatchPredictRequest, + optionsOrCallback?: + | CallOptions + | Callback< + LROperation< + protos.google.cloud.automl.v1.IBatchPredictResult, + protos.google.cloud.automl.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + callback?: Callback< + LROperation< + protos.google.cloud.automl.v1.IBatchPredictResult, + protos.google.cloud.automl.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): Promise< + [ + LROperation< + protos.google.cloud.automl.v1.IBatchPredictResult, + protos.google.cloud.automl.v1.IOperationMetadata + >, + 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(); + return this.innerApiCalls.batchPredict(request, options, callback); + } + /** + * Check the status of the long running operation returned by `batchPredict()`. + * @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/prediction_service.batch_predict.js + * region_tag:automl_v1_generated_PredictionService_BatchPredict_async + */ + async checkBatchPredictProgress( + name: string + ): Promise< + LROperation< + protos.google.cloud.automl.v1.BatchPredictResult, + protos.google.cloud.automl.v1.OperationMetadata + > + > { + 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.batchPredict, + this._gaxModule.createDefaultBackoffSettings() + ); + return decodeOperation as LROperation< + protos.google.cloud.automl.v1.BatchPredictResult, + protos.google.cloud.automl.v1.OperationMetadata + >; + } + // -------------------- + // -- Path templates -- + // -------------------- + + /** + * Return a fully-qualified annotationSpec resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} dataset + * @param {string} annotation_spec + * @returns {string} Resource name string. + */ + annotationSpecPath( + project: string, + location: string, + dataset: string, + annotationSpec: string + ) { + return this.pathTemplates.annotationSpecPathTemplate.render({ + project: project, + location: location, + dataset: dataset, + annotation_spec: annotationSpec, + }); + } + + /** + * Parse the project from AnnotationSpec resource. + * + * @param {string} annotationSpecName + * A fully-qualified path representing AnnotationSpec resource. + * @returns {string} A string representing the project. + */ + matchProjectFromAnnotationSpecName(annotationSpecName: string) { + return this.pathTemplates.annotationSpecPathTemplate.match( + annotationSpecName + ).project; + } + + /** + * Parse the location from AnnotationSpec resource. + * + * @param {string} annotationSpecName + * A fully-qualified path representing AnnotationSpec resource. + * @returns {string} A string representing the location. + */ + matchLocationFromAnnotationSpecName(annotationSpecName: string) { + return this.pathTemplates.annotationSpecPathTemplate.match( + annotationSpecName + ).location; + } + + /** + * Parse the dataset from AnnotationSpec resource. + * + * @param {string} annotationSpecName + * A fully-qualified path representing AnnotationSpec resource. + * @returns {string} A string representing the dataset. + */ + matchDatasetFromAnnotationSpecName(annotationSpecName: string) { + return this.pathTemplates.annotationSpecPathTemplate.match( + annotationSpecName + ).dataset; + } + + /** + * Parse the annotation_spec from AnnotationSpec resource. + * + * @param {string} annotationSpecName + * A fully-qualified path representing AnnotationSpec resource. + * @returns {string} A string representing the annotation_spec. + */ + matchAnnotationSpecFromAnnotationSpecName(annotationSpecName: string) { + return this.pathTemplates.annotationSpecPathTemplate.match( + annotationSpecName + ).annotation_spec; + } + + /** + * Return a fully-qualified dataset resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} dataset + * @returns {string} Resource name string. + */ + datasetPath(project: string, location: string, dataset: string) { + return this.pathTemplates.datasetPathTemplate.render({ + project: project, + location: location, + dataset: dataset, + }); + } + + /** + * Parse the project from Dataset resource. + * + * @param {string} datasetName + * A fully-qualified path representing Dataset resource. + * @returns {string} A string representing the project. + */ + matchProjectFromDatasetName(datasetName: string) { + return this.pathTemplates.datasetPathTemplate.match(datasetName).project; + } + + /** + * Parse the location from Dataset resource. + * + * @param {string} datasetName + * A fully-qualified path representing Dataset resource. + * @returns {string} A string representing the location. + */ + matchLocationFromDatasetName(datasetName: string) { + return this.pathTemplates.datasetPathTemplate.match(datasetName).location; + } + + /** + * Parse the dataset from Dataset resource. + * + * @param {string} datasetName + * A fully-qualified path representing Dataset resource. + * @returns {string} A string representing the dataset. + */ + matchDatasetFromDatasetName(datasetName: string) { + return this.pathTemplates.datasetPathTemplate.match(datasetName).dataset; + } + + /** + * Return a fully-qualified model resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} model + * @returns {string} Resource name string. + */ + modelPath(project: string, location: string, model: string) { + return this.pathTemplates.modelPathTemplate.render({ + project: project, + location: location, + model: model, + }); + } + + /** + * Parse the project from Model resource. + * + * @param {string} modelName + * A fully-qualified path representing Model resource. + * @returns {string} A string representing the project. + */ + matchProjectFromModelName(modelName: string) { + return this.pathTemplates.modelPathTemplate.match(modelName).project; + } + + /** + * Parse the location from Model resource. + * + * @param {string} modelName + * A fully-qualified path representing Model resource. + * @returns {string} A string representing the location. + */ + matchLocationFromModelName(modelName: string) { + return this.pathTemplates.modelPathTemplate.match(modelName).location; + } + + /** + * Parse the model from Model resource. + * + * @param {string} modelName + * A fully-qualified path representing Model resource. + * @returns {string} A string representing the model. + */ + matchModelFromModelName(modelName: string) { + return this.pathTemplates.modelPathTemplate.match(modelName).model; + } + + /** + * Return a fully-qualified modelEvaluation resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} model + * @param {string} model_evaluation + * @returns {string} Resource name string. + */ + modelEvaluationPath( + project: string, + location: string, + model: string, + modelEvaluation: string + ) { + return this.pathTemplates.modelEvaluationPathTemplate.render({ + project: project, + location: location, + model: model, + model_evaluation: modelEvaluation, + }); + } + + /** + * Parse the project from ModelEvaluation resource. + * + * @param {string} modelEvaluationName + * A fully-qualified path representing ModelEvaluation resource. + * @returns {string} A string representing the project. + */ + matchProjectFromModelEvaluationName(modelEvaluationName: string) { + return this.pathTemplates.modelEvaluationPathTemplate.match( + modelEvaluationName + ).project; + } + + /** + * Parse the location from ModelEvaluation resource. + * + * @param {string} modelEvaluationName + * A fully-qualified path representing ModelEvaluation resource. + * @returns {string} A string representing the location. + */ + matchLocationFromModelEvaluationName(modelEvaluationName: string) { + return this.pathTemplates.modelEvaluationPathTemplate.match( + modelEvaluationName + ).location; + } + + /** + * Parse the model from ModelEvaluation resource. + * + * @param {string} modelEvaluationName + * A fully-qualified path representing ModelEvaluation resource. + * @returns {string} A string representing the model. + */ + matchModelFromModelEvaluationName(modelEvaluationName: string) { + return this.pathTemplates.modelEvaluationPathTemplate.match( + modelEvaluationName + ).model; + } + + /** + * Parse the model_evaluation from ModelEvaluation resource. + * + * @param {string} modelEvaluationName + * A fully-qualified path representing ModelEvaluation resource. + * @returns {string} A string representing the model_evaluation. + */ + matchModelEvaluationFromModelEvaluationName(modelEvaluationName: string) { + return this.pathTemplates.modelEvaluationPathTemplate.match( + modelEvaluationName + ).model_evaluation; + } + + /** + * 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.predictionServiceStub && !this._terminated) { + return this.predictionServiceStub.then(stub => { + this._terminated = true; + stub.close(); + this.operationsClient.close(); + }); + } + return Promise.resolve(); + } +} diff --git a/packages/google-cloud-automl/src/v1/prediction_service_client_config.json b/packages/google-cloud-automl/src/v1/prediction_service_client_config.json new file mode 100644 index 00000000000..d0cf33d835c --- /dev/null +++ b/packages/google-cloud-automl/src/v1/prediction_service_client_config.json @@ -0,0 +1,36 @@ +{ + "interfaces": { + "google.cloud.automl.v1.PredictionService": { + "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": { + "Predict": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "BatchPredict": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + } + } + } + } +} diff --git a/packages/google-cloud-automl/src/v1/prediction_service_proto_list.json b/packages/google-cloud-automl/src/v1/prediction_service_proto_list.json new file mode 100644 index 00000000000..f15ad4ecded --- /dev/null +++ b/packages/google-cloud-automl/src/v1/prediction_service_proto_list.json @@ -0,0 +1,21 @@ +[ + "../../protos/google/cloud/automl/v1/annotation_payload.proto", + "../../protos/google/cloud/automl/v1/annotation_spec.proto", + "../../protos/google/cloud/automl/v1/classification.proto", + "../../protos/google/cloud/automl/v1/data_items.proto", + "../../protos/google/cloud/automl/v1/dataset.proto", + "../../protos/google/cloud/automl/v1/detection.proto", + "../../protos/google/cloud/automl/v1/geometry.proto", + "../../protos/google/cloud/automl/v1/image.proto", + "../../protos/google/cloud/automl/v1/io.proto", + "../../protos/google/cloud/automl/v1/model.proto", + "../../protos/google/cloud/automl/v1/model_evaluation.proto", + "../../protos/google/cloud/automl/v1/operations.proto", + "../../protos/google/cloud/automl/v1/prediction_service.proto", + "../../protos/google/cloud/automl/v1/service.proto", + "../../protos/google/cloud/automl/v1/text.proto", + "../../protos/google/cloud/automl/v1/text_extraction.proto", + "../../protos/google/cloud/automl/v1/text_segment.proto", + "../../protos/google/cloud/automl/v1/text_sentiment.proto", + "../../protos/google/cloud/automl/v1/translation.proto" +] diff --git a/packages/google-cloud-automl/src/v1beta1/auto_ml_client.ts b/packages/google-cloud-automl/src/v1beta1/auto_ml_client.ts new file mode 100644 index 00000000000..99c19bcd874 --- /dev/null +++ b/packages/google-cloud-automl/src/v1beta1/auto_ml_client.ts @@ -0,0 +1,4354 @@ +// Copyright 2023 Google LLC +// +// Licensed under the Apache License, Version 2.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, +} from 'google-gax'; +import {Transform} from 'stream'; +import * as protos from '../../protos/protos'; +import jsonProtos = require('../../protos/protos.json'); +/** + * Client JSON configuration object, loaded from + * `src/v1beta1/auto_ml_client_config.json`. + * This file defines retry strategy and timeouts for all API methods in this library. + */ +import * as gapicConfig from './auto_ml_client_config.json'; +const version = require('../../../package.json').version; + +/** + * AutoML Server API. + * + * The resource names are assigned by the server. + * The server never reuses names that it has created after the resources with + * those names are deleted. + * + * An ID of a resource is the last element of the item's resource name. For + * `projects/{project_id}/locations/{location_id}/datasets/{dataset_id}`, then + * the id for the item is `{dataset_id}`. + * + * Currently the only supported `location_id` is "us-central1". + * + * On any input that is documented to expect a string parameter in + * snake_case or kebab-case, either of those cases is accepted. + * @class + * @memberof v1beta1 + */ +export class AutoMlClient { + 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}; + 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; + autoMlStub?: Promise<{[name: string]: Function}>; + + /** + * Construct an instance of AutoMlClient. + * + * @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://developers.google.com/identity/protocols/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 AutoMlClient({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 AutoMlClient; + const servicePath = + opts?.servicePath || opts?.apiEndpoint || staticMembers.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 !== staticMembers.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 = staticMembers.servicePath; + + // Set the default scopes in auth client if needed. + if (servicePath === staticMembers.servicePath) { + this.auth.defaultScopes = staticMembers.scopes; + } + + // Determine the client header string. + const clientHeader = [`gax/${this._gaxModule.version}`, `gapic/${version}`]; + if (typeof process !== 'undefined' && '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 = { + annotationSpecPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/datasets/{dataset}/annotationSpecs/{annotation_spec}' + ), + columnSpecPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/datasets/{dataset}/tableSpecs/{table_spec}/columnSpecs/{column_spec}' + ), + datasetPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/datasets/{dataset}' + ), + locationPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}' + ), + modelPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/models/{model}' + ), + modelEvaluationPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/models/{model}/modelEvaluations/{model_evaluation}' + ), + tableSpecPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/datasets/{dataset}/tableSpecs/{table_spec}' + ), + }; + + // 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 = { + listDatasets: new this._gaxModule.PageDescriptor( + 'pageToken', + 'nextPageToken', + 'datasets' + ), + listTableSpecs: new this._gaxModule.PageDescriptor( + 'pageToken', + 'nextPageToken', + 'tableSpecs' + ), + listColumnSpecs: new this._gaxModule.PageDescriptor( + 'pageToken', + 'nextPageToken', + 'columnSpecs' + ), + listModels: new this._gaxModule.PageDescriptor( + 'pageToken', + 'nextPageToken', + 'model' + ), + listModelEvaluations: new this._gaxModule.PageDescriptor( + 'pageToken', + 'nextPageToken', + 'modelEvaluation' + ), + }; + + const protoFilesRoot = this._gaxModule.protobuf.Root.fromJSON(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.iam.v1.IAMPolicy.GetIamPolicy', + get: '/v1beta1/{resource=projects/*/locations/*}:getIamPolicy', + additional_bindings: [ + { + get: '/v1beta1/{resource=projects/*/locations/*/datasets/*}:getIamPolicy', + }, + { + get: '/v1beta1/{resource=projects/*/locations/*/models/*}:getIamPolicy', + }, + ], + }, + { + selector: 'google.iam.v1.IAMPolicy.SetIamPolicy', + post: '/v1beta1/{resource=projects/*/locations/*}:setIamPolicy', + body: '*', + additional_bindings: [ + { + post: '/v1beta1/{resource=projects/*/locations/*/datasets/*}:setIamPolicy', + body: '*', + }, + { + post: '/v1beta1/{resource=projects/*/locations/*/models/*}:setIamPolicy', + body: '*', + }, + ], + }, + { + selector: 'google.iam.v1.IAMPolicy.TestIamPermissions', + post: '/v1beta1/{resource=projects/*/locations/*/**}:testIamPermissions', + body: '*', + }, + { + selector: 'google.longrunning.Operations.CancelOperation', + post: '/v1beta1/{name=projects/*/locations/*/operations/*}:cancel', + body: '*', + }, + { + selector: 'google.longrunning.Operations.DeleteOperation', + delete: '/v1beta1/{name=projects/*/locations/*/operations/*}', + }, + { + selector: 'google.longrunning.Operations.GetOperation', + get: '/v1beta1/{name=projects/*/locations/*/operations/*}', + }, + { + selector: 'google.longrunning.Operations.ListOperations', + get: '/v1beta1/{name=projects/*/locations/*}/operations', + }, + { + selector: 'google.longrunning.Operations.WaitOperation', + post: '/v1beta1/{name=projects/*/locations/*/operations/*}:wait', + body: '*', + }, + ]; + } + this.operationsClient = this._gaxModule + .lro(lroOptions) + .operationsClient(opts); + const deleteDatasetResponse = protoFilesRoot.lookup( + '.google.protobuf.Empty' + ) as gax.protobuf.Type; + const deleteDatasetMetadata = protoFilesRoot.lookup( + '.google.cloud.automl.v1beta1.OperationMetadata' + ) as gax.protobuf.Type; + const importDataResponse = protoFilesRoot.lookup( + '.google.protobuf.Empty' + ) as gax.protobuf.Type; + const importDataMetadata = protoFilesRoot.lookup( + '.google.cloud.automl.v1beta1.OperationMetadata' + ) as gax.protobuf.Type; + const exportDataResponse = protoFilesRoot.lookup( + '.google.protobuf.Empty' + ) as gax.protobuf.Type; + const exportDataMetadata = protoFilesRoot.lookup( + '.google.cloud.automl.v1beta1.OperationMetadata' + ) as gax.protobuf.Type; + const createModelResponse = protoFilesRoot.lookup( + '.google.cloud.automl.v1beta1.Model' + ) as gax.protobuf.Type; + const createModelMetadata = protoFilesRoot.lookup( + '.google.cloud.automl.v1beta1.OperationMetadata' + ) as gax.protobuf.Type; + const deleteModelResponse = protoFilesRoot.lookup( + '.google.protobuf.Empty' + ) as gax.protobuf.Type; + const deleteModelMetadata = protoFilesRoot.lookup( + '.google.cloud.automl.v1beta1.OperationMetadata' + ) as gax.protobuf.Type; + const deployModelResponse = protoFilesRoot.lookup( + '.google.protobuf.Empty' + ) as gax.protobuf.Type; + const deployModelMetadata = protoFilesRoot.lookup( + '.google.cloud.automl.v1beta1.OperationMetadata' + ) as gax.protobuf.Type; + const undeployModelResponse = protoFilesRoot.lookup( + '.google.protobuf.Empty' + ) as gax.protobuf.Type; + const undeployModelMetadata = protoFilesRoot.lookup( + '.google.cloud.automl.v1beta1.OperationMetadata' + ) as gax.protobuf.Type; + const exportModelResponse = protoFilesRoot.lookup( + '.google.protobuf.Empty' + ) as gax.protobuf.Type; + const exportModelMetadata = protoFilesRoot.lookup( + '.google.cloud.automl.v1beta1.OperationMetadata' + ) as gax.protobuf.Type; + const exportEvaluatedExamplesResponse = protoFilesRoot.lookup( + '.google.protobuf.Empty' + ) as gax.protobuf.Type; + const exportEvaluatedExamplesMetadata = protoFilesRoot.lookup( + '.google.cloud.automl.v1beta1.OperationMetadata' + ) as gax.protobuf.Type; + + this.descriptors.longrunning = { + deleteDataset: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + deleteDatasetResponse.decode.bind(deleteDatasetResponse), + deleteDatasetMetadata.decode.bind(deleteDatasetMetadata) + ), + importData: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + importDataResponse.decode.bind(importDataResponse), + importDataMetadata.decode.bind(importDataMetadata) + ), + exportData: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + exportDataResponse.decode.bind(exportDataResponse), + exportDataMetadata.decode.bind(exportDataMetadata) + ), + createModel: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + createModelResponse.decode.bind(createModelResponse), + createModelMetadata.decode.bind(createModelMetadata) + ), + deleteModel: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + deleteModelResponse.decode.bind(deleteModelResponse), + deleteModelMetadata.decode.bind(deleteModelMetadata) + ), + deployModel: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + deployModelResponse.decode.bind(deployModelResponse), + deployModelMetadata.decode.bind(deployModelMetadata) + ), + undeployModel: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + undeployModelResponse.decode.bind(undeployModelResponse), + undeployModelMetadata.decode.bind(undeployModelMetadata) + ), + exportModel: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + exportModelResponse.decode.bind(exportModelResponse), + exportModelMetadata.decode.bind(exportModelMetadata) + ), + exportEvaluatedExamples: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + exportEvaluatedExamplesResponse.decode.bind( + exportEvaluatedExamplesResponse + ), + exportEvaluatedExamplesMetadata.decode.bind( + exportEvaluatedExamplesMetadata + ) + ), + }; + + // Put together the default options sent with requests. + this._defaults = this._gaxGrpc.constructSettings( + 'google.cloud.automl.v1beta1.AutoMl', + 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.autoMlStub) { + return this.autoMlStub; + } + + // Put together the "service stub" for + // google.cloud.automl.v1beta1.AutoMl. + this.autoMlStub = this._gaxGrpc.createStub( + this._opts.fallback + ? (this._protos as protobuf.Root).lookupService( + 'google.cloud.automl.v1beta1.AutoMl' + ) + : // eslint-disable-next-line @typescript-eslint/no-explicit-any + (this._protos as any).google.cloud.automl.v1beta1.AutoMl, + 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 autoMlStubMethods = [ + 'createDataset', + 'getDataset', + 'listDatasets', + 'updateDataset', + 'deleteDataset', + 'importData', + 'exportData', + 'getAnnotationSpec', + 'getTableSpec', + 'listTableSpecs', + 'updateTableSpec', + 'getColumnSpec', + 'listColumnSpecs', + 'updateColumnSpec', + 'createModel', + 'getModel', + 'listModels', + 'deleteModel', + 'deployModel', + 'undeployModel', + 'exportModel', + 'exportEvaluatedExamples', + 'getModelEvaluation', + 'listModelEvaluations', + ]; + for (const methodName of autoMlStubMethods) { + const callPromise = this.autoMlStub.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] || + this.descriptors.longrunning[methodName] || + undefined; + const apiCall = this._gaxModule.createApiCall( + callPromise, + this._defaults[methodName], + descriptor, + this._opts.fallback + ); + + this.innerApiCalls[methodName] = apiCall; + } + + return this.autoMlStub; + } + + /** + * The DNS address for this API service. + * @returns {string} The DNS address for this service. + */ + static get servicePath() { + return 'automl.googleapis.com'; + } + + /** + * The DNS address for this API service - same as servicePath(), + * exists for compatibility reasons. + * @returns {string} The DNS address for this service. + */ + static get apiEndpoint() { + return 'automl.googleapis.com'; + } + + /** + * 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 -- + // ------------------- + /** + * Creates a dataset. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The resource name of the project to create the dataset for. + * @param {google.cloud.automl.v1beta1.Dataset} request.dataset + * Required. The dataset 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.automl.v1beta1.Dataset|Dataset}. + * 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/v1beta1/auto_ml.create_dataset.js + * region_tag:automl_v1beta1_generated_AutoMl_CreateDataset_async + */ + createDataset( + request?: protos.google.cloud.automl.v1beta1.ICreateDatasetRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.automl.v1beta1.IDataset, + protos.google.cloud.automl.v1beta1.ICreateDatasetRequest | undefined, + {} | undefined, + ] + >; + createDataset( + request: protos.google.cloud.automl.v1beta1.ICreateDatasetRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.automl.v1beta1.IDataset, + | protos.google.cloud.automl.v1beta1.ICreateDatasetRequest + | null + | undefined, + {} | null | undefined + > + ): void; + createDataset( + request: protos.google.cloud.automl.v1beta1.ICreateDatasetRequest, + callback: Callback< + protos.google.cloud.automl.v1beta1.IDataset, + | protos.google.cloud.automl.v1beta1.ICreateDatasetRequest + | null + | undefined, + {} | null | undefined + > + ): void; + createDataset( + request?: protos.google.cloud.automl.v1beta1.ICreateDatasetRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.automl.v1beta1.IDataset, + | protos.google.cloud.automl.v1beta1.ICreateDatasetRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.automl.v1beta1.IDataset, + | protos.google.cloud.automl.v1beta1.ICreateDatasetRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.automl.v1beta1.IDataset, + protos.google.cloud.automl.v1beta1.ICreateDatasetRequest | 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(); + return this.innerApiCalls.createDataset(request, options, callback); + } + /** + * Gets a dataset. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The resource name of the dataset to retrieve. + * @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.automl.v1beta1.Dataset|Dataset}. + * 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/v1beta1/auto_ml.get_dataset.js + * region_tag:automl_v1beta1_generated_AutoMl_GetDataset_async + */ + getDataset( + request?: protos.google.cloud.automl.v1beta1.IGetDatasetRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.automl.v1beta1.IDataset, + protos.google.cloud.automl.v1beta1.IGetDatasetRequest | undefined, + {} | undefined, + ] + >; + getDataset( + request: protos.google.cloud.automl.v1beta1.IGetDatasetRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.automl.v1beta1.IDataset, + protos.google.cloud.automl.v1beta1.IGetDatasetRequest | null | undefined, + {} | null | undefined + > + ): void; + getDataset( + request: protos.google.cloud.automl.v1beta1.IGetDatasetRequest, + callback: Callback< + protos.google.cloud.automl.v1beta1.IDataset, + protos.google.cloud.automl.v1beta1.IGetDatasetRequest | null | undefined, + {} | null | undefined + > + ): void; + getDataset( + request?: protos.google.cloud.automl.v1beta1.IGetDatasetRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.automl.v1beta1.IDataset, + | protos.google.cloud.automl.v1beta1.IGetDatasetRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.automl.v1beta1.IDataset, + protos.google.cloud.automl.v1beta1.IGetDatasetRequest | null | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.automl.v1beta1.IDataset, + protos.google.cloud.automl.v1beta1.IGetDatasetRequest | 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(); + return this.innerApiCalls.getDataset(request, options, callback); + } + /** + * Updates a dataset. + * + * @param {Object} request + * The request object that will be sent. + * @param {google.cloud.automl.v1beta1.Dataset} request.dataset + * Required. The dataset which replaces the resource on the server. + * @param {google.protobuf.FieldMask} request.updateMask + * The update mask applies to the resource. + * @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.automl.v1beta1.Dataset|Dataset}. + * 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/v1beta1/auto_ml.update_dataset.js + * region_tag:automl_v1beta1_generated_AutoMl_UpdateDataset_async + */ + updateDataset( + request?: protos.google.cloud.automl.v1beta1.IUpdateDatasetRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.automl.v1beta1.IDataset, + protos.google.cloud.automl.v1beta1.IUpdateDatasetRequest | undefined, + {} | undefined, + ] + >; + updateDataset( + request: protos.google.cloud.automl.v1beta1.IUpdateDatasetRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.automl.v1beta1.IDataset, + | protos.google.cloud.automl.v1beta1.IUpdateDatasetRequest + | null + | undefined, + {} | null | undefined + > + ): void; + updateDataset( + request: protos.google.cloud.automl.v1beta1.IUpdateDatasetRequest, + callback: Callback< + protos.google.cloud.automl.v1beta1.IDataset, + | protos.google.cloud.automl.v1beta1.IUpdateDatasetRequest + | null + | undefined, + {} | null | undefined + > + ): void; + updateDataset( + request?: protos.google.cloud.automl.v1beta1.IUpdateDatasetRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.automl.v1beta1.IDataset, + | protos.google.cloud.automl.v1beta1.IUpdateDatasetRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.automl.v1beta1.IDataset, + | protos.google.cloud.automl.v1beta1.IUpdateDatasetRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.automl.v1beta1.IDataset, + protos.google.cloud.automl.v1beta1.IUpdateDatasetRequest | 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({ + 'dataset.name': request.dataset!.name ?? '', + }); + this.initialize(); + return this.innerApiCalls.updateDataset(request, options, callback); + } + /** + * Gets an annotation spec. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The resource name of the annotation spec to retrieve. + * @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.automl.v1beta1.AnnotationSpec|AnnotationSpec}. + * 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/v1beta1/auto_ml.get_annotation_spec.js + * region_tag:automl_v1beta1_generated_AutoMl_GetAnnotationSpec_async + */ + getAnnotationSpec( + request?: protos.google.cloud.automl.v1beta1.IGetAnnotationSpecRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.automl.v1beta1.IAnnotationSpec, + protos.google.cloud.automl.v1beta1.IGetAnnotationSpecRequest | undefined, + {} | undefined, + ] + >; + getAnnotationSpec( + request: protos.google.cloud.automl.v1beta1.IGetAnnotationSpecRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.automl.v1beta1.IAnnotationSpec, + | protos.google.cloud.automl.v1beta1.IGetAnnotationSpecRequest + | null + | undefined, + {} | null | undefined + > + ): void; + getAnnotationSpec( + request: protos.google.cloud.automl.v1beta1.IGetAnnotationSpecRequest, + callback: Callback< + protos.google.cloud.automl.v1beta1.IAnnotationSpec, + | protos.google.cloud.automl.v1beta1.IGetAnnotationSpecRequest + | null + | undefined, + {} | null | undefined + > + ): void; + getAnnotationSpec( + request?: protos.google.cloud.automl.v1beta1.IGetAnnotationSpecRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.automl.v1beta1.IAnnotationSpec, + | protos.google.cloud.automl.v1beta1.IGetAnnotationSpecRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.automl.v1beta1.IAnnotationSpec, + | protos.google.cloud.automl.v1beta1.IGetAnnotationSpecRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.automl.v1beta1.IAnnotationSpec, + protos.google.cloud.automl.v1beta1.IGetAnnotationSpecRequest | 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(); + return this.innerApiCalls.getAnnotationSpec(request, options, callback); + } + /** + * Gets a table spec. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The resource name of the table spec to retrieve. + * @param {google.protobuf.FieldMask} request.fieldMask + * Mask specifying which fields to read. + * @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.automl.v1beta1.TableSpec|TableSpec}. + * 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/v1beta1/auto_ml.get_table_spec.js + * region_tag:automl_v1beta1_generated_AutoMl_GetTableSpec_async + */ + getTableSpec( + request?: protos.google.cloud.automl.v1beta1.IGetTableSpecRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.automl.v1beta1.ITableSpec, + protos.google.cloud.automl.v1beta1.IGetTableSpecRequest | undefined, + {} | undefined, + ] + >; + getTableSpec( + request: protos.google.cloud.automl.v1beta1.IGetTableSpecRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.automl.v1beta1.ITableSpec, + | protos.google.cloud.automl.v1beta1.IGetTableSpecRequest + | null + | undefined, + {} | null | undefined + > + ): void; + getTableSpec( + request: protos.google.cloud.automl.v1beta1.IGetTableSpecRequest, + callback: Callback< + protos.google.cloud.automl.v1beta1.ITableSpec, + | protos.google.cloud.automl.v1beta1.IGetTableSpecRequest + | null + | undefined, + {} | null | undefined + > + ): void; + getTableSpec( + request?: protos.google.cloud.automl.v1beta1.IGetTableSpecRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.automl.v1beta1.ITableSpec, + | protos.google.cloud.automl.v1beta1.IGetTableSpecRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.automl.v1beta1.ITableSpec, + | protos.google.cloud.automl.v1beta1.IGetTableSpecRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.automl.v1beta1.ITableSpec, + protos.google.cloud.automl.v1beta1.IGetTableSpecRequest | 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(); + return this.innerApiCalls.getTableSpec(request, options, callback); + } + /** + * Updates a table spec. + * + * @param {Object} request + * The request object that will be sent. + * @param {google.cloud.automl.v1beta1.TableSpec} request.tableSpec + * Required. The table spec which replaces the resource on the server. + * @param {google.protobuf.FieldMask} request.updateMask + * The update mask applies to the resource. + * @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.automl.v1beta1.TableSpec|TableSpec}. + * 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/v1beta1/auto_ml.update_table_spec.js + * region_tag:automl_v1beta1_generated_AutoMl_UpdateTableSpec_async + */ + updateTableSpec( + request?: protos.google.cloud.automl.v1beta1.IUpdateTableSpecRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.automl.v1beta1.ITableSpec, + protos.google.cloud.automl.v1beta1.IUpdateTableSpecRequest | undefined, + {} | undefined, + ] + >; + updateTableSpec( + request: protos.google.cloud.automl.v1beta1.IUpdateTableSpecRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.automl.v1beta1.ITableSpec, + | protos.google.cloud.automl.v1beta1.IUpdateTableSpecRequest + | null + | undefined, + {} | null | undefined + > + ): void; + updateTableSpec( + request: protos.google.cloud.automl.v1beta1.IUpdateTableSpecRequest, + callback: Callback< + protos.google.cloud.automl.v1beta1.ITableSpec, + | protos.google.cloud.automl.v1beta1.IUpdateTableSpecRequest + | null + | undefined, + {} | null | undefined + > + ): void; + updateTableSpec( + request?: protos.google.cloud.automl.v1beta1.IUpdateTableSpecRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.automl.v1beta1.ITableSpec, + | protos.google.cloud.automl.v1beta1.IUpdateTableSpecRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.automl.v1beta1.ITableSpec, + | protos.google.cloud.automl.v1beta1.IUpdateTableSpecRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.automl.v1beta1.ITableSpec, + protos.google.cloud.automl.v1beta1.IUpdateTableSpecRequest | 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({ + 'table_spec.name': request.tableSpec!.name ?? '', + }); + this.initialize(); + return this.innerApiCalls.updateTableSpec(request, options, callback); + } + /** + * Gets a column spec. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The resource name of the column spec to retrieve. + * @param {google.protobuf.FieldMask} request.fieldMask + * Mask specifying which fields to read. + * @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.automl.v1beta1.ColumnSpec|ColumnSpec}. + * 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/v1beta1/auto_ml.get_column_spec.js + * region_tag:automl_v1beta1_generated_AutoMl_GetColumnSpec_async + */ + getColumnSpec( + request?: protos.google.cloud.automl.v1beta1.IGetColumnSpecRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.automl.v1beta1.IColumnSpec, + protos.google.cloud.automl.v1beta1.IGetColumnSpecRequest | undefined, + {} | undefined, + ] + >; + getColumnSpec( + request: protos.google.cloud.automl.v1beta1.IGetColumnSpecRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.automl.v1beta1.IColumnSpec, + | protos.google.cloud.automl.v1beta1.IGetColumnSpecRequest + | null + | undefined, + {} | null | undefined + > + ): void; + getColumnSpec( + request: protos.google.cloud.automl.v1beta1.IGetColumnSpecRequest, + callback: Callback< + protos.google.cloud.automl.v1beta1.IColumnSpec, + | protos.google.cloud.automl.v1beta1.IGetColumnSpecRequest + | null + | undefined, + {} | null | undefined + > + ): void; + getColumnSpec( + request?: protos.google.cloud.automl.v1beta1.IGetColumnSpecRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.automl.v1beta1.IColumnSpec, + | protos.google.cloud.automl.v1beta1.IGetColumnSpecRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.automl.v1beta1.IColumnSpec, + | protos.google.cloud.automl.v1beta1.IGetColumnSpecRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.automl.v1beta1.IColumnSpec, + protos.google.cloud.automl.v1beta1.IGetColumnSpecRequest | 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(); + return this.innerApiCalls.getColumnSpec(request, options, callback); + } + /** + * Updates a column spec. + * + * @param {Object} request + * The request object that will be sent. + * @param {google.cloud.automl.v1beta1.ColumnSpec} request.columnSpec + * Required. The column spec which replaces the resource on the server. + * @param {google.protobuf.FieldMask} request.updateMask + * The update mask applies to the resource. + * @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.automl.v1beta1.ColumnSpec|ColumnSpec}. + * 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/v1beta1/auto_ml.update_column_spec.js + * region_tag:automl_v1beta1_generated_AutoMl_UpdateColumnSpec_async + */ + updateColumnSpec( + request?: protos.google.cloud.automl.v1beta1.IUpdateColumnSpecRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.automl.v1beta1.IColumnSpec, + protos.google.cloud.automl.v1beta1.IUpdateColumnSpecRequest | undefined, + {} | undefined, + ] + >; + updateColumnSpec( + request: protos.google.cloud.automl.v1beta1.IUpdateColumnSpecRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.automl.v1beta1.IColumnSpec, + | protos.google.cloud.automl.v1beta1.IUpdateColumnSpecRequest + | null + | undefined, + {} | null | undefined + > + ): void; + updateColumnSpec( + request: protos.google.cloud.automl.v1beta1.IUpdateColumnSpecRequest, + callback: Callback< + protos.google.cloud.automl.v1beta1.IColumnSpec, + | protos.google.cloud.automl.v1beta1.IUpdateColumnSpecRequest + | null + | undefined, + {} | null | undefined + > + ): void; + updateColumnSpec( + request?: protos.google.cloud.automl.v1beta1.IUpdateColumnSpecRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.automl.v1beta1.IColumnSpec, + | protos.google.cloud.automl.v1beta1.IUpdateColumnSpecRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.automl.v1beta1.IColumnSpec, + | protos.google.cloud.automl.v1beta1.IUpdateColumnSpecRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.automl.v1beta1.IColumnSpec, + protos.google.cloud.automl.v1beta1.IUpdateColumnSpecRequest | 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({ + 'column_spec.name': request.columnSpec!.name ?? '', + }); + this.initialize(); + return this.innerApiCalls.updateColumnSpec(request, options, callback); + } + /** + * Gets a model. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. Resource name of the model. + * @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.automl.v1beta1.Model|Model}. + * 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/v1beta1/auto_ml.get_model.js + * region_tag:automl_v1beta1_generated_AutoMl_GetModel_async + */ + getModel( + request?: protos.google.cloud.automl.v1beta1.IGetModelRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.automl.v1beta1.IModel, + protos.google.cloud.automl.v1beta1.IGetModelRequest | undefined, + {} | undefined, + ] + >; + getModel( + request: protos.google.cloud.automl.v1beta1.IGetModelRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.automl.v1beta1.IModel, + protos.google.cloud.automl.v1beta1.IGetModelRequest | null | undefined, + {} | null | undefined + > + ): void; + getModel( + request: protos.google.cloud.automl.v1beta1.IGetModelRequest, + callback: Callback< + protos.google.cloud.automl.v1beta1.IModel, + protos.google.cloud.automl.v1beta1.IGetModelRequest | null | undefined, + {} | null | undefined + > + ): void; + getModel( + request?: protos.google.cloud.automl.v1beta1.IGetModelRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.automl.v1beta1.IModel, + | protos.google.cloud.automl.v1beta1.IGetModelRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.automl.v1beta1.IModel, + protos.google.cloud.automl.v1beta1.IGetModelRequest | null | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.automl.v1beta1.IModel, + protos.google.cloud.automl.v1beta1.IGetModelRequest | 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(); + return this.innerApiCalls.getModel(request, options, callback); + } + /** + * Gets a model evaluation. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. Resource name for the model evaluation. + * @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.automl.v1beta1.ModelEvaluation|ModelEvaluation}. + * 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/v1beta1/auto_ml.get_model_evaluation.js + * region_tag:automl_v1beta1_generated_AutoMl_GetModelEvaluation_async + */ + getModelEvaluation( + request?: protos.google.cloud.automl.v1beta1.IGetModelEvaluationRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.automl.v1beta1.IModelEvaluation, + protos.google.cloud.automl.v1beta1.IGetModelEvaluationRequest | undefined, + {} | undefined, + ] + >; + getModelEvaluation( + request: protos.google.cloud.automl.v1beta1.IGetModelEvaluationRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.automl.v1beta1.IModelEvaluation, + | protos.google.cloud.automl.v1beta1.IGetModelEvaluationRequest + | null + | undefined, + {} | null | undefined + > + ): void; + getModelEvaluation( + request: protos.google.cloud.automl.v1beta1.IGetModelEvaluationRequest, + callback: Callback< + protos.google.cloud.automl.v1beta1.IModelEvaluation, + | protos.google.cloud.automl.v1beta1.IGetModelEvaluationRequest + | null + | undefined, + {} | null | undefined + > + ): void; + getModelEvaluation( + request?: protos.google.cloud.automl.v1beta1.IGetModelEvaluationRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.automl.v1beta1.IModelEvaluation, + | protos.google.cloud.automl.v1beta1.IGetModelEvaluationRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.automl.v1beta1.IModelEvaluation, + | protos.google.cloud.automl.v1beta1.IGetModelEvaluationRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.automl.v1beta1.IModelEvaluation, + protos.google.cloud.automl.v1beta1.IGetModelEvaluationRequest | 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(); + return this.innerApiCalls.getModelEvaluation(request, options, callback); + } + + /** + * Deletes a dataset and all of its contents. + * Returns empty response in the + * {@link protos.google.longrunning.Operation.response|response} field when it completes, + * and `delete_details` in the + * {@link protos.google.longrunning.Operation.metadata|metadata} field. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The resource name of the dataset to delete. + * @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/v1beta1/auto_ml.delete_dataset.js + * region_tag:automl_v1beta1_generated_AutoMl_DeleteDataset_async + */ + deleteDataset( + request?: protos.google.cloud.automl.v1beta1.IDeleteDatasetRequest, + options?: CallOptions + ): Promise< + [ + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.automl.v1beta1.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined, + ] + >; + deleteDataset( + request: protos.google.cloud.automl.v1beta1.IDeleteDatasetRequest, + options: CallOptions, + callback: Callback< + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.automl.v1beta1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + deleteDataset( + request: protos.google.cloud.automl.v1beta1.IDeleteDatasetRequest, + callback: Callback< + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.automl.v1beta1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + deleteDataset( + request?: protos.google.cloud.automl.v1beta1.IDeleteDatasetRequest, + optionsOrCallback?: + | CallOptions + | Callback< + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.automl.v1beta1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + callback?: Callback< + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.automl.v1beta1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): Promise< + [ + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.automl.v1beta1.IOperationMetadata + >, + 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(); + return this.innerApiCalls.deleteDataset(request, options, callback); + } + /** + * Check the status of the long running operation returned by `deleteDataset()`. + * @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/v1beta1/auto_ml.delete_dataset.js + * region_tag:automl_v1beta1_generated_AutoMl_DeleteDataset_async + */ + async checkDeleteDatasetProgress( + name: string + ): Promise< + LROperation< + protos.google.protobuf.Empty, + protos.google.cloud.automl.v1beta1.OperationMetadata + > + > { + 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.deleteDataset, + this._gaxModule.createDefaultBackoffSettings() + ); + return decodeOperation as LROperation< + protos.google.protobuf.Empty, + protos.google.cloud.automl.v1beta1.OperationMetadata + >; + } + /** + * Imports data into a dataset. + * For Tables this method can only be called on an empty Dataset. + * + * For Tables: + * * A + * {@link protos.google.cloud.automl.v1beta1.InputConfig.params|schema_inference_version} + * parameter must be explicitly set. + * Returns an empty response in the + * {@link protos.google.longrunning.Operation.response|response} field when it completes. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. Dataset name. Dataset must already exist. All imported + * annotations and examples will be added. + * @param {google.cloud.automl.v1beta1.InputConfig} request.inputConfig + * Required. The desired input location and its domain specific semantics, + * if any. + * @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/v1beta1/auto_ml.import_data.js + * region_tag:automl_v1beta1_generated_AutoMl_ImportData_async + */ + importData( + request?: protos.google.cloud.automl.v1beta1.IImportDataRequest, + options?: CallOptions + ): Promise< + [ + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.automl.v1beta1.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined, + ] + >; + importData( + request: protos.google.cloud.automl.v1beta1.IImportDataRequest, + options: CallOptions, + callback: Callback< + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.automl.v1beta1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + importData( + request: protos.google.cloud.automl.v1beta1.IImportDataRequest, + callback: Callback< + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.automl.v1beta1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + importData( + request?: protos.google.cloud.automl.v1beta1.IImportDataRequest, + optionsOrCallback?: + | CallOptions + | Callback< + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.automl.v1beta1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + callback?: Callback< + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.automl.v1beta1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): Promise< + [ + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.automl.v1beta1.IOperationMetadata + >, + 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(); + return this.innerApiCalls.importData(request, options, callback); + } + /** + * Check the status of the long running operation returned by `importData()`. + * @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/v1beta1/auto_ml.import_data.js + * region_tag:automl_v1beta1_generated_AutoMl_ImportData_async + */ + async checkImportDataProgress( + name: string + ): Promise< + LROperation< + protos.google.protobuf.Empty, + protos.google.cloud.automl.v1beta1.OperationMetadata + > + > { + 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.importData, + this._gaxModule.createDefaultBackoffSettings() + ); + return decodeOperation as LROperation< + protos.google.protobuf.Empty, + protos.google.cloud.automl.v1beta1.OperationMetadata + >; + } + /** + * Exports dataset's data to the provided output location. + * Returns an empty response in the + * {@link protos.google.longrunning.Operation.response|response} field when it completes. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The resource name of the dataset. + * @param {google.cloud.automl.v1beta1.OutputConfig} request.outputConfig + * Required. The desired output 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/v1beta1/auto_ml.export_data.js + * region_tag:automl_v1beta1_generated_AutoMl_ExportData_async + */ + exportData( + request?: protos.google.cloud.automl.v1beta1.IExportDataRequest, + options?: CallOptions + ): Promise< + [ + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.automl.v1beta1.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined, + ] + >; + exportData( + request: protos.google.cloud.automl.v1beta1.IExportDataRequest, + options: CallOptions, + callback: Callback< + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.automl.v1beta1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + exportData( + request: protos.google.cloud.automl.v1beta1.IExportDataRequest, + callback: Callback< + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.automl.v1beta1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + exportData( + request?: protos.google.cloud.automl.v1beta1.IExportDataRequest, + optionsOrCallback?: + | CallOptions + | Callback< + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.automl.v1beta1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + callback?: Callback< + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.automl.v1beta1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): Promise< + [ + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.automl.v1beta1.IOperationMetadata + >, + 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(); + return this.innerApiCalls.exportData(request, options, callback); + } + /** + * Check the status of the long running operation returned by `exportData()`. + * @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/v1beta1/auto_ml.export_data.js + * region_tag:automl_v1beta1_generated_AutoMl_ExportData_async + */ + async checkExportDataProgress( + name: string + ): Promise< + LROperation< + protos.google.protobuf.Empty, + protos.google.cloud.automl.v1beta1.OperationMetadata + > + > { + 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.exportData, + this._gaxModule.createDefaultBackoffSettings() + ); + return decodeOperation as LROperation< + protos.google.protobuf.Empty, + protos.google.cloud.automl.v1beta1.OperationMetadata + >; + } + /** + * Creates a model. + * Returns a Model in the {@link protos.google.longrunning.Operation.response|response} + * field when it completes. + * When you create a model, several model evaluations are created for it: + * a global evaluation, and one evaluation for each annotation spec. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. Resource name of the parent project where the model is being created. + * @param {google.cloud.automl.v1beta1.Model} request.model + * Required. The model 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 + * 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/v1beta1/auto_ml.create_model.js + * region_tag:automl_v1beta1_generated_AutoMl_CreateModel_async + */ + createModel( + request?: protos.google.cloud.automl.v1beta1.ICreateModelRequest, + options?: CallOptions + ): Promise< + [ + LROperation< + protos.google.cloud.automl.v1beta1.IModel, + protos.google.cloud.automl.v1beta1.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined, + ] + >; + createModel( + request: protos.google.cloud.automl.v1beta1.ICreateModelRequest, + options: CallOptions, + callback: Callback< + LROperation< + protos.google.cloud.automl.v1beta1.IModel, + protos.google.cloud.automl.v1beta1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + createModel( + request: protos.google.cloud.automl.v1beta1.ICreateModelRequest, + callback: Callback< + LROperation< + protos.google.cloud.automl.v1beta1.IModel, + protos.google.cloud.automl.v1beta1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + createModel( + request?: protos.google.cloud.automl.v1beta1.ICreateModelRequest, + optionsOrCallback?: + | CallOptions + | Callback< + LROperation< + protos.google.cloud.automl.v1beta1.IModel, + protos.google.cloud.automl.v1beta1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + callback?: Callback< + LROperation< + protos.google.cloud.automl.v1beta1.IModel, + protos.google.cloud.automl.v1beta1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): Promise< + [ + LROperation< + protos.google.cloud.automl.v1beta1.IModel, + protos.google.cloud.automl.v1beta1.IOperationMetadata + >, + 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(); + return this.innerApiCalls.createModel(request, options, callback); + } + /** + * Check the status of the long running operation returned by `createModel()`. + * @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/v1beta1/auto_ml.create_model.js + * region_tag:automl_v1beta1_generated_AutoMl_CreateModel_async + */ + async checkCreateModelProgress( + name: string + ): Promise< + LROperation< + protos.google.cloud.automl.v1beta1.Model, + protos.google.cloud.automl.v1beta1.OperationMetadata + > + > { + 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.createModel, + this._gaxModule.createDefaultBackoffSettings() + ); + return decodeOperation as LROperation< + protos.google.cloud.automl.v1beta1.Model, + protos.google.cloud.automl.v1beta1.OperationMetadata + >; + } + /** + * Deletes a model. + * Returns `google.protobuf.Empty` in the + * {@link protos.google.longrunning.Operation.response|response} field when it completes, + * and `delete_details` in the + * {@link protos.google.longrunning.Operation.metadata|metadata} field. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. Resource name of the model being 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 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/v1beta1/auto_ml.delete_model.js + * region_tag:automl_v1beta1_generated_AutoMl_DeleteModel_async + */ + deleteModel( + request?: protos.google.cloud.automl.v1beta1.IDeleteModelRequest, + options?: CallOptions + ): Promise< + [ + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.automl.v1beta1.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined, + ] + >; + deleteModel( + request: protos.google.cloud.automl.v1beta1.IDeleteModelRequest, + options: CallOptions, + callback: Callback< + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.automl.v1beta1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + deleteModel( + request: protos.google.cloud.automl.v1beta1.IDeleteModelRequest, + callback: Callback< + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.automl.v1beta1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + deleteModel( + request?: protos.google.cloud.automl.v1beta1.IDeleteModelRequest, + optionsOrCallback?: + | CallOptions + | Callback< + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.automl.v1beta1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + callback?: Callback< + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.automl.v1beta1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): Promise< + [ + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.automl.v1beta1.IOperationMetadata + >, + 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(); + return this.innerApiCalls.deleteModel(request, options, callback); + } + /** + * Check the status of the long running operation returned by `deleteModel()`. + * @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/v1beta1/auto_ml.delete_model.js + * region_tag:automl_v1beta1_generated_AutoMl_DeleteModel_async + */ + async checkDeleteModelProgress( + name: string + ): Promise< + LROperation< + protos.google.protobuf.Empty, + protos.google.cloud.automl.v1beta1.OperationMetadata + > + > { + 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.deleteModel, + this._gaxModule.createDefaultBackoffSettings() + ); + return decodeOperation as LROperation< + protos.google.protobuf.Empty, + protos.google.cloud.automl.v1beta1.OperationMetadata + >; + } + /** + * Deploys a model. If a model is already deployed, deploying it with the + * same parameters has no effect. Deploying with different parametrs + * (as e.g. changing + * + * {@link protos.google.cloud.automl.v1beta1.ImageObjectDetectionModelDeploymentMetadata.node_number|node_number}) + * will reset the deployment state without pausing the model's availability. + * + * Only applicable for Text Classification, Image Object Detection , Tables, and Image Segmentation; all other domains manage + * deployment automatically. + * + * Returns an empty response in the + * {@link protos.google.longrunning.Operation.response|response} field when it completes. + * + * @param {Object} request + * The request object that will be sent. + * @param {google.cloud.automl.v1beta1.ImageObjectDetectionModelDeploymentMetadata} request.imageObjectDetectionModelDeploymentMetadata + * Model deployment metadata specific to Image Object Detection. + * @param {google.cloud.automl.v1beta1.ImageClassificationModelDeploymentMetadata} request.imageClassificationModelDeploymentMetadata + * Model deployment metadata specific to Image Classification. + * @param {string} request.name + * Required. Resource name of the model to deploy. + * @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/v1beta1/auto_ml.deploy_model.js + * region_tag:automl_v1beta1_generated_AutoMl_DeployModel_async + */ + deployModel( + request?: protos.google.cloud.automl.v1beta1.IDeployModelRequest, + options?: CallOptions + ): Promise< + [ + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.automl.v1beta1.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined, + ] + >; + deployModel( + request: protos.google.cloud.automl.v1beta1.IDeployModelRequest, + options: CallOptions, + callback: Callback< + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.automl.v1beta1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + deployModel( + request: protos.google.cloud.automl.v1beta1.IDeployModelRequest, + callback: Callback< + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.automl.v1beta1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + deployModel( + request?: protos.google.cloud.automl.v1beta1.IDeployModelRequest, + optionsOrCallback?: + | CallOptions + | Callback< + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.automl.v1beta1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + callback?: Callback< + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.automl.v1beta1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): Promise< + [ + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.automl.v1beta1.IOperationMetadata + >, + 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(); + return this.innerApiCalls.deployModel(request, options, callback); + } + /** + * Check the status of the long running operation returned by `deployModel()`. + * @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/v1beta1/auto_ml.deploy_model.js + * region_tag:automl_v1beta1_generated_AutoMl_DeployModel_async + */ + async checkDeployModelProgress( + name: string + ): Promise< + LROperation< + protos.google.protobuf.Empty, + protos.google.cloud.automl.v1beta1.OperationMetadata + > + > { + 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.deployModel, + this._gaxModule.createDefaultBackoffSettings() + ); + return decodeOperation as LROperation< + protos.google.protobuf.Empty, + protos.google.cloud.automl.v1beta1.OperationMetadata + >; + } + /** + * Undeploys a model. If the model is not deployed this method has no effect. + * + * Only applicable for Text Classification, Image Object Detection and Tables; + * all other domains manage deployment automatically. + * + * Returns an empty response in the + * {@link protos.google.longrunning.Operation.response|response} field when it completes. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. Resource name of the model to undeploy. + * @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/v1beta1/auto_ml.undeploy_model.js + * region_tag:automl_v1beta1_generated_AutoMl_UndeployModel_async + */ + undeployModel( + request?: protos.google.cloud.automl.v1beta1.IUndeployModelRequest, + options?: CallOptions + ): Promise< + [ + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.automl.v1beta1.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined, + ] + >; + undeployModel( + request: protos.google.cloud.automl.v1beta1.IUndeployModelRequest, + options: CallOptions, + callback: Callback< + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.automl.v1beta1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + undeployModel( + request: protos.google.cloud.automl.v1beta1.IUndeployModelRequest, + callback: Callback< + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.automl.v1beta1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + undeployModel( + request?: protos.google.cloud.automl.v1beta1.IUndeployModelRequest, + optionsOrCallback?: + | CallOptions + | Callback< + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.automl.v1beta1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + callback?: Callback< + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.automl.v1beta1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): Promise< + [ + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.automl.v1beta1.IOperationMetadata + >, + 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(); + return this.innerApiCalls.undeployModel(request, options, callback); + } + /** + * Check the status of the long running operation returned by `undeployModel()`. + * @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/v1beta1/auto_ml.undeploy_model.js + * region_tag:automl_v1beta1_generated_AutoMl_UndeployModel_async + */ + async checkUndeployModelProgress( + name: string + ): Promise< + LROperation< + protos.google.protobuf.Empty, + protos.google.cloud.automl.v1beta1.OperationMetadata + > + > { + 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.undeployModel, + this._gaxModule.createDefaultBackoffSettings() + ); + return decodeOperation as LROperation< + protos.google.protobuf.Empty, + protos.google.cloud.automl.v1beta1.OperationMetadata + >; + } + /** + * Exports a trained, "export-able", model to a user specified Google Cloud + * Storage location. A model is considered export-able if and only if it has + * an export format defined for it in + * + * {@link protos.google.cloud.automl.v1beta1.ModelExportOutputConfig|ModelExportOutputConfig}. + * + * Returns an empty response in the + * {@link protos.google.longrunning.Operation.response|response} field when it completes. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The resource name of the model to export. + * @param {google.cloud.automl.v1beta1.ModelExportOutputConfig} request.outputConfig + * Required. The desired output location and configuration. + * @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/v1beta1/auto_ml.export_model.js + * region_tag:automl_v1beta1_generated_AutoMl_ExportModel_async + */ + exportModel( + request?: protos.google.cloud.automl.v1beta1.IExportModelRequest, + options?: CallOptions + ): Promise< + [ + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.automl.v1beta1.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined, + ] + >; + exportModel( + request: protos.google.cloud.automl.v1beta1.IExportModelRequest, + options: CallOptions, + callback: Callback< + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.automl.v1beta1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + exportModel( + request: protos.google.cloud.automl.v1beta1.IExportModelRequest, + callback: Callback< + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.automl.v1beta1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + exportModel( + request?: protos.google.cloud.automl.v1beta1.IExportModelRequest, + optionsOrCallback?: + | CallOptions + | Callback< + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.automl.v1beta1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + callback?: Callback< + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.automl.v1beta1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): Promise< + [ + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.automl.v1beta1.IOperationMetadata + >, + 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(); + return this.innerApiCalls.exportModel(request, options, callback); + } + /** + * Check the status of the long running operation returned by `exportModel()`. + * @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/v1beta1/auto_ml.export_model.js + * region_tag:automl_v1beta1_generated_AutoMl_ExportModel_async + */ + async checkExportModelProgress( + name: string + ): Promise< + LROperation< + protos.google.protobuf.Empty, + protos.google.cloud.automl.v1beta1.OperationMetadata + > + > { + 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.exportModel, + this._gaxModule.createDefaultBackoffSettings() + ); + return decodeOperation as LROperation< + protos.google.protobuf.Empty, + protos.google.cloud.automl.v1beta1.OperationMetadata + >; + } + /** + * Exports examples on which the model was evaluated (i.e. which were in the + * TEST set of the dataset the model was created from), together with their + * ground truth annotations and the annotations created (predicted) by the + * model. + * The examples, ground truth and predictions are exported in the state + * they were at the moment the model was evaluated. + * + * This export is available only for 30 days since the model evaluation is + * created. + * + * Currently only available for Tables. + * + * Returns an empty response in the + * {@link protos.google.longrunning.Operation.response|response} field when it completes. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The resource name of the model whose evaluated examples are to + * be exported. + * @param {google.cloud.automl.v1beta1.ExportEvaluatedExamplesOutputConfig} request.outputConfig + * Required. The desired output location and configuration. + * @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/v1beta1/auto_ml.export_evaluated_examples.js + * region_tag:automl_v1beta1_generated_AutoMl_ExportEvaluatedExamples_async + */ + exportEvaluatedExamples( + request?: protos.google.cloud.automl.v1beta1.IExportEvaluatedExamplesRequest, + options?: CallOptions + ): Promise< + [ + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.automl.v1beta1.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined, + ] + >; + exportEvaluatedExamples( + request: protos.google.cloud.automl.v1beta1.IExportEvaluatedExamplesRequest, + options: CallOptions, + callback: Callback< + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.automl.v1beta1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + exportEvaluatedExamples( + request: protos.google.cloud.automl.v1beta1.IExportEvaluatedExamplesRequest, + callback: Callback< + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.automl.v1beta1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + exportEvaluatedExamples( + request?: protos.google.cloud.automl.v1beta1.IExportEvaluatedExamplesRequest, + optionsOrCallback?: + | CallOptions + | Callback< + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.automl.v1beta1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + callback?: Callback< + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.automl.v1beta1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): Promise< + [ + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.automl.v1beta1.IOperationMetadata + >, + 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(); + return this.innerApiCalls.exportEvaluatedExamples( + request, + options, + callback + ); + } + /** + * Check the status of the long running operation returned by `exportEvaluatedExamples()`. + * @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/v1beta1/auto_ml.export_evaluated_examples.js + * region_tag:automl_v1beta1_generated_AutoMl_ExportEvaluatedExamples_async + */ + async checkExportEvaluatedExamplesProgress( + name: string + ): Promise< + LROperation< + protos.google.protobuf.Empty, + protos.google.cloud.automl.v1beta1.OperationMetadata + > + > { + 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.exportEvaluatedExamples, + this._gaxModule.createDefaultBackoffSettings() + ); + return decodeOperation as LROperation< + protos.google.protobuf.Empty, + protos.google.cloud.automl.v1beta1.OperationMetadata + >; + } + /** + * Lists datasets in a project. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The resource name of the project from which to list datasets. + * @param {string} request.filter + * An expression for filtering the results of the request. + * + * * `dataset_metadata` - for existence of the case (e.g. + * `image_classification_dataset_metadata:*`). Some examples of + * using the filter are: + * + * * `translation_dataset_metadata:*` --> The dataset has + * `translation_dataset_metadata`. + * @param {number} request.pageSize + * Requested page size. Server may return fewer results than requested. + * If unspecified, server will pick a default size. + * @param {string} request.pageToken + * A token identifying a page of results for the server to return + * Typically obtained via + * {@link protos.google.cloud.automl.v1beta1.ListDatasetsResponse.next_page_token|ListDatasetsResponse.next_page_token} of the previous + * {@link protos.google.cloud.automl.v1beta1.AutoMl.ListDatasets|AutoMl.ListDatasets} call. + * @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.automl.v1beta1.Dataset|Dataset}. + * 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 `listDatasetsAsync()` + * 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. + */ + listDatasets( + request?: protos.google.cloud.automl.v1beta1.IListDatasetsRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.automl.v1beta1.IDataset[], + protos.google.cloud.automl.v1beta1.IListDatasetsRequest | null, + protos.google.cloud.automl.v1beta1.IListDatasetsResponse, + ] + >; + listDatasets( + request: protos.google.cloud.automl.v1beta1.IListDatasetsRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.cloud.automl.v1beta1.IListDatasetsRequest, + | protos.google.cloud.automl.v1beta1.IListDatasetsResponse + | null + | undefined, + protos.google.cloud.automl.v1beta1.IDataset + > + ): void; + listDatasets( + request: protos.google.cloud.automl.v1beta1.IListDatasetsRequest, + callback: PaginationCallback< + protos.google.cloud.automl.v1beta1.IListDatasetsRequest, + | protos.google.cloud.automl.v1beta1.IListDatasetsResponse + | null + | undefined, + protos.google.cloud.automl.v1beta1.IDataset + > + ): void; + listDatasets( + request?: protos.google.cloud.automl.v1beta1.IListDatasetsRequest, + optionsOrCallback?: + | CallOptions + | PaginationCallback< + protos.google.cloud.automl.v1beta1.IListDatasetsRequest, + | protos.google.cloud.automl.v1beta1.IListDatasetsResponse + | null + | undefined, + protos.google.cloud.automl.v1beta1.IDataset + >, + callback?: PaginationCallback< + protos.google.cloud.automl.v1beta1.IListDatasetsRequest, + | protos.google.cloud.automl.v1beta1.IListDatasetsResponse + | null + | undefined, + protos.google.cloud.automl.v1beta1.IDataset + > + ): Promise< + [ + protos.google.cloud.automl.v1beta1.IDataset[], + protos.google.cloud.automl.v1beta1.IListDatasetsRequest | null, + protos.google.cloud.automl.v1beta1.IListDatasetsResponse, + ] + > | 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(); + return this.innerApiCalls.listDatasets(request, options, callback); + } + + /** + * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The resource name of the project from which to list datasets. + * @param {string} request.filter + * An expression for filtering the results of the request. + * + * * `dataset_metadata` - for existence of the case (e.g. + * `image_classification_dataset_metadata:*`). Some examples of + * using the filter are: + * + * * `translation_dataset_metadata:*` --> The dataset has + * `translation_dataset_metadata`. + * @param {number} request.pageSize + * Requested page size. Server may return fewer results than requested. + * If unspecified, server will pick a default size. + * @param {string} request.pageToken + * A token identifying a page of results for the server to return + * Typically obtained via + * {@link protos.google.cloud.automl.v1beta1.ListDatasetsResponse.next_page_token|ListDatasetsResponse.next_page_token} of the previous + * {@link protos.google.cloud.automl.v1beta1.AutoMl.ListDatasets|AutoMl.ListDatasets} call. + * @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.automl.v1beta1.Dataset|Dataset} 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 `listDatasetsAsync()` + * 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. + */ + listDatasetsStream( + request?: protos.google.cloud.automl.v1beta1.IListDatasetsRequest, + 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['listDatasets']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.listDatasets.createStream( + this.innerApiCalls.listDatasets as GaxCall, + request, + callSettings + ); + } + + /** + * Equivalent to `listDatasets`, 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 resource name of the project from which to list datasets. + * @param {string} request.filter + * An expression for filtering the results of the request. + * + * * `dataset_metadata` - for existence of the case (e.g. + * `image_classification_dataset_metadata:*`). Some examples of + * using the filter are: + * + * * `translation_dataset_metadata:*` --> The dataset has + * `translation_dataset_metadata`. + * @param {number} request.pageSize + * Requested page size. Server may return fewer results than requested. + * If unspecified, server will pick a default size. + * @param {string} request.pageToken + * A token identifying a page of results for the server to return + * Typically obtained via + * {@link protos.google.cloud.automl.v1beta1.ListDatasetsResponse.next_page_token|ListDatasetsResponse.next_page_token} of the previous + * {@link protos.google.cloud.automl.v1beta1.AutoMl.ListDatasets|AutoMl.ListDatasets} call. + * @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.automl.v1beta1.Dataset|Dataset}. 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/v1beta1/auto_ml.list_datasets.js + * region_tag:automl_v1beta1_generated_AutoMl_ListDatasets_async + */ + listDatasetsAsync( + request?: protos.google.cloud.automl.v1beta1.IListDatasetsRequest, + 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['listDatasets']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.listDatasets.asyncIterate( + this.innerApiCalls['listDatasets'] as GaxCall, + request as {}, + callSettings + ) as AsyncIterable; + } + /** + * Lists table specs in a dataset. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The resource name of the dataset to list table specs from. + * @param {google.protobuf.FieldMask} request.fieldMask + * Mask specifying which fields to read. + * @param {string} request.filter + * Filter expression, see go/filtering. + * @param {number} request.pageSize + * Requested page size. The server can return fewer results than requested. + * If unspecified, the server will pick a default size. + * @param {string} request.pageToken + * A token identifying a page of results for the server to return. + * Typically obtained from the + * {@link protos.google.cloud.automl.v1beta1.ListTableSpecsResponse.next_page_token|ListTableSpecsResponse.next_page_token} field of the previous + * {@link protos.google.cloud.automl.v1beta1.AutoMl.ListTableSpecs|AutoMl.ListTableSpecs} call. + * @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.automl.v1beta1.TableSpec|TableSpec}. + * 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 `listTableSpecsAsync()` + * 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. + */ + listTableSpecs( + request?: protos.google.cloud.automl.v1beta1.IListTableSpecsRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.automl.v1beta1.ITableSpec[], + protos.google.cloud.automl.v1beta1.IListTableSpecsRequest | null, + protos.google.cloud.automl.v1beta1.IListTableSpecsResponse, + ] + >; + listTableSpecs( + request: protos.google.cloud.automl.v1beta1.IListTableSpecsRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.cloud.automl.v1beta1.IListTableSpecsRequest, + | protos.google.cloud.automl.v1beta1.IListTableSpecsResponse + | null + | undefined, + protos.google.cloud.automl.v1beta1.ITableSpec + > + ): void; + listTableSpecs( + request: protos.google.cloud.automl.v1beta1.IListTableSpecsRequest, + callback: PaginationCallback< + protos.google.cloud.automl.v1beta1.IListTableSpecsRequest, + | protos.google.cloud.automl.v1beta1.IListTableSpecsResponse + | null + | undefined, + protos.google.cloud.automl.v1beta1.ITableSpec + > + ): void; + listTableSpecs( + request?: protos.google.cloud.automl.v1beta1.IListTableSpecsRequest, + optionsOrCallback?: + | CallOptions + | PaginationCallback< + protos.google.cloud.automl.v1beta1.IListTableSpecsRequest, + | protos.google.cloud.automl.v1beta1.IListTableSpecsResponse + | null + | undefined, + protos.google.cloud.automl.v1beta1.ITableSpec + >, + callback?: PaginationCallback< + protos.google.cloud.automl.v1beta1.IListTableSpecsRequest, + | protos.google.cloud.automl.v1beta1.IListTableSpecsResponse + | null + | undefined, + protos.google.cloud.automl.v1beta1.ITableSpec + > + ): Promise< + [ + protos.google.cloud.automl.v1beta1.ITableSpec[], + protos.google.cloud.automl.v1beta1.IListTableSpecsRequest | null, + protos.google.cloud.automl.v1beta1.IListTableSpecsResponse, + ] + > | 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(); + return this.innerApiCalls.listTableSpecs(request, options, callback); + } + + /** + * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The resource name of the dataset to list table specs from. + * @param {google.protobuf.FieldMask} request.fieldMask + * Mask specifying which fields to read. + * @param {string} request.filter + * Filter expression, see go/filtering. + * @param {number} request.pageSize + * Requested page size. The server can return fewer results than requested. + * If unspecified, the server will pick a default size. + * @param {string} request.pageToken + * A token identifying a page of results for the server to return. + * Typically obtained from the + * {@link protos.google.cloud.automl.v1beta1.ListTableSpecsResponse.next_page_token|ListTableSpecsResponse.next_page_token} field of the previous + * {@link protos.google.cloud.automl.v1beta1.AutoMl.ListTableSpecs|AutoMl.ListTableSpecs} call. + * @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.automl.v1beta1.TableSpec|TableSpec} 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 `listTableSpecsAsync()` + * 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. + */ + listTableSpecsStream( + request?: protos.google.cloud.automl.v1beta1.IListTableSpecsRequest, + 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['listTableSpecs']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.listTableSpecs.createStream( + this.innerApiCalls.listTableSpecs as GaxCall, + request, + callSettings + ); + } + + /** + * Equivalent to `listTableSpecs`, 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 resource name of the dataset to list table specs from. + * @param {google.protobuf.FieldMask} request.fieldMask + * Mask specifying which fields to read. + * @param {string} request.filter + * Filter expression, see go/filtering. + * @param {number} request.pageSize + * Requested page size. The server can return fewer results than requested. + * If unspecified, the server will pick a default size. + * @param {string} request.pageToken + * A token identifying a page of results for the server to return. + * Typically obtained from the + * {@link protos.google.cloud.automl.v1beta1.ListTableSpecsResponse.next_page_token|ListTableSpecsResponse.next_page_token} field of the previous + * {@link protos.google.cloud.automl.v1beta1.AutoMl.ListTableSpecs|AutoMl.ListTableSpecs} call. + * @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.automl.v1beta1.TableSpec|TableSpec}. 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/v1beta1/auto_ml.list_table_specs.js + * region_tag:automl_v1beta1_generated_AutoMl_ListTableSpecs_async + */ + listTableSpecsAsync( + request?: protos.google.cloud.automl.v1beta1.IListTableSpecsRequest, + 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['listTableSpecs']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.listTableSpecs.asyncIterate( + this.innerApiCalls['listTableSpecs'] as GaxCall, + request as {}, + callSettings + ) as AsyncIterable; + } + /** + * Lists column specs in a table spec. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The resource name of the table spec to list column specs from. + * @param {google.protobuf.FieldMask} request.fieldMask + * Mask specifying which fields to read. + * @param {string} request.filter + * Filter expression, see go/filtering. + * @param {number} request.pageSize + * Requested page size. The server can return fewer results than requested. + * If unspecified, the server will pick a default size. + * @param {string} request.pageToken + * A token identifying a page of results for the server to return. + * Typically obtained from the + * {@link protos.google.cloud.automl.v1beta1.ListColumnSpecsResponse.next_page_token|ListColumnSpecsResponse.next_page_token} field of the previous + * {@link protos.google.cloud.automl.v1beta1.AutoMl.ListColumnSpecs|AutoMl.ListColumnSpecs} call. + * @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.automl.v1beta1.ColumnSpec|ColumnSpec}. + * 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 `listColumnSpecsAsync()` + * 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. + */ + listColumnSpecs( + request?: protos.google.cloud.automl.v1beta1.IListColumnSpecsRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.automl.v1beta1.IColumnSpec[], + protos.google.cloud.automl.v1beta1.IListColumnSpecsRequest | null, + protos.google.cloud.automl.v1beta1.IListColumnSpecsResponse, + ] + >; + listColumnSpecs( + request: protos.google.cloud.automl.v1beta1.IListColumnSpecsRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.cloud.automl.v1beta1.IListColumnSpecsRequest, + | protos.google.cloud.automl.v1beta1.IListColumnSpecsResponse + | null + | undefined, + protos.google.cloud.automl.v1beta1.IColumnSpec + > + ): void; + listColumnSpecs( + request: protos.google.cloud.automl.v1beta1.IListColumnSpecsRequest, + callback: PaginationCallback< + protos.google.cloud.automl.v1beta1.IListColumnSpecsRequest, + | protos.google.cloud.automl.v1beta1.IListColumnSpecsResponse + | null + | undefined, + protos.google.cloud.automl.v1beta1.IColumnSpec + > + ): void; + listColumnSpecs( + request?: protos.google.cloud.automl.v1beta1.IListColumnSpecsRequest, + optionsOrCallback?: + | CallOptions + | PaginationCallback< + protos.google.cloud.automl.v1beta1.IListColumnSpecsRequest, + | protos.google.cloud.automl.v1beta1.IListColumnSpecsResponse + | null + | undefined, + protos.google.cloud.automl.v1beta1.IColumnSpec + >, + callback?: PaginationCallback< + protos.google.cloud.automl.v1beta1.IListColumnSpecsRequest, + | protos.google.cloud.automl.v1beta1.IListColumnSpecsResponse + | null + | undefined, + protos.google.cloud.automl.v1beta1.IColumnSpec + > + ): Promise< + [ + protos.google.cloud.automl.v1beta1.IColumnSpec[], + protos.google.cloud.automl.v1beta1.IListColumnSpecsRequest | null, + protos.google.cloud.automl.v1beta1.IListColumnSpecsResponse, + ] + > | 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(); + return this.innerApiCalls.listColumnSpecs(request, options, callback); + } + + /** + * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The resource name of the table spec to list column specs from. + * @param {google.protobuf.FieldMask} request.fieldMask + * Mask specifying which fields to read. + * @param {string} request.filter + * Filter expression, see go/filtering. + * @param {number} request.pageSize + * Requested page size. The server can return fewer results than requested. + * If unspecified, the server will pick a default size. + * @param {string} request.pageToken + * A token identifying a page of results for the server to return. + * Typically obtained from the + * {@link protos.google.cloud.automl.v1beta1.ListColumnSpecsResponse.next_page_token|ListColumnSpecsResponse.next_page_token} field of the previous + * {@link protos.google.cloud.automl.v1beta1.AutoMl.ListColumnSpecs|AutoMl.ListColumnSpecs} call. + * @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.automl.v1beta1.ColumnSpec|ColumnSpec} 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 `listColumnSpecsAsync()` + * 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. + */ + listColumnSpecsStream( + request?: protos.google.cloud.automl.v1beta1.IListColumnSpecsRequest, + 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['listColumnSpecs']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.listColumnSpecs.createStream( + this.innerApiCalls.listColumnSpecs as GaxCall, + request, + callSettings + ); + } + + /** + * Equivalent to `listColumnSpecs`, 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 resource name of the table spec to list column specs from. + * @param {google.protobuf.FieldMask} request.fieldMask + * Mask specifying which fields to read. + * @param {string} request.filter + * Filter expression, see go/filtering. + * @param {number} request.pageSize + * Requested page size. The server can return fewer results than requested. + * If unspecified, the server will pick a default size. + * @param {string} request.pageToken + * A token identifying a page of results for the server to return. + * Typically obtained from the + * {@link protos.google.cloud.automl.v1beta1.ListColumnSpecsResponse.next_page_token|ListColumnSpecsResponse.next_page_token} field of the previous + * {@link protos.google.cloud.automl.v1beta1.AutoMl.ListColumnSpecs|AutoMl.ListColumnSpecs} call. + * @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.automl.v1beta1.ColumnSpec|ColumnSpec}. 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/v1beta1/auto_ml.list_column_specs.js + * region_tag:automl_v1beta1_generated_AutoMl_ListColumnSpecs_async + */ + listColumnSpecsAsync( + request?: protos.google.cloud.automl.v1beta1.IListColumnSpecsRequest, + 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['listColumnSpecs']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.listColumnSpecs.asyncIterate( + this.innerApiCalls['listColumnSpecs'] as GaxCall, + request as {}, + callSettings + ) as AsyncIterable; + } + /** + * Lists models. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. Resource name of the project, from which to list the models. + * @param {string} request.filter + * An expression for filtering the results of the request. + * + * * `model_metadata` - for existence of the case (e.g. + * `video_classification_model_metadata:*`). + * * `dataset_id` - for = or !=. Some examples of using the filter are: + * + * * `image_classification_model_metadata:*` --> The model has + * `image_classification_model_metadata`. + * * `dataset_id=5` --> The model was created from a dataset with ID 5. + * @param {number} request.pageSize + * Requested page size. + * @param {string} request.pageToken + * A token identifying a page of results for the server to return + * Typically obtained via + * {@link protos.google.cloud.automl.v1beta1.ListModelsResponse.next_page_token|ListModelsResponse.next_page_token} of the previous + * {@link protos.google.cloud.automl.v1beta1.AutoMl.ListModels|AutoMl.ListModels} call. + * @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.automl.v1beta1.Model|Model}. + * 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 `listModelsAsync()` + * 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. + */ + listModels( + request?: protos.google.cloud.automl.v1beta1.IListModelsRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.automl.v1beta1.IModel[], + protos.google.cloud.automl.v1beta1.IListModelsRequest | null, + protos.google.cloud.automl.v1beta1.IListModelsResponse, + ] + >; + listModels( + request: protos.google.cloud.automl.v1beta1.IListModelsRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.cloud.automl.v1beta1.IListModelsRequest, + protos.google.cloud.automl.v1beta1.IListModelsResponse | null | undefined, + protos.google.cloud.automl.v1beta1.IModel + > + ): void; + listModels( + request: protos.google.cloud.automl.v1beta1.IListModelsRequest, + callback: PaginationCallback< + protos.google.cloud.automl.v1beta1.IListModelsRequest, + protos.google.cloud.automl.v1beta1.IListModelsResponse | null | undefined, + protos.google.cloud.automl.v1beta1.IModel + > + ): void; + listModels( + request?: protos.google.cloud.automl.v1beta1.IListModelsRequest, + optionsOrCallback?: + | CallOptions + | PaginationCallback< + protos.google.cloud.automl.v1beta1.IListModelsRequest, + | protos.google.cloud.automl.v1beta1.IListModelsResponse + | null + | undefined, + protos.google.cloud.automl.v1beta1.IModel + >, + callback?: PaginationCallback< + protos.google.cloud.automl.v1beta1.IListModelsRequest, + protos.google.cloud.automl.v1beta1.IListModelsResponse | null | undefined, + protos.google.cloud.automl.v1beta1.IModel + > + ): Promise< + [ + protos.google.cloud.automl.v1beta1.IModel[], + protos.google.cloud.automl.v1beta1.IListModelsRequest | null, + protos.google.cloud.automl.v1beta1.IListModelsResponse, + ] + > | 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(); + return this.innerApiCalls.listModels(request, options, callback); + } + + /** + * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. Resource name of the project, from which to list the models. + * @param {string} request.filter + * An expression for filtering the results of the request. + * + * * `model_metadata` - for existence of the case (e.g. + * `video_classification_model_metadata:*`). + * * `dataset_id` - for = or !=. Some examples of using the filter are: + * + * * `image_classification_model_metadata:*` --> The model has + * `image_classification_model_metadata`. + * * `dataset_id=5` --> The model was created from a dataset with ID 5. + * @param {number} request.pageSize + * Requested page size. + * @param {string} request.pageToken + * A token identifying a page of results for the server to return + * Typically obtained via + * {@link protos.google.cloud.automl.v1beta1.ListModelsResponse.next_page_token|ListModelsResponse.next_page_token} of the previous + * {@link protos.google.cloud.automl.v1beta1.AutoMl.ListModels|AutoMl.ListModels} call. + * @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.automl.v1beta1.Model|Model} 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 `listModelsAsync()` + * 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. + */ + listModelsStream( + request?: protos.google.cloud.automl.v1beta1.IListModelsRequest, + 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['listModels']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.listModels.createStream( + this.innerApiCalls.listModels as GaxCall, + request, + callSettings + ); + } + + /** + * Equivalent to `listModels`, 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. Resource name of the project, from which to list the models. + * @param {string} request.filter + * An expression for filtering the results of the request. + * + * * `model_metadata` - for existence of the case (e.g. + * `video_classification_model_metadata:*`). + * * `dataset_id` - for = or !=. Some examples of using the filter are: + * + * * `image_classification_model_metadata:*` --> The model has + * `image_classification_model_metadata`. + * * `dataset_id=5` --> The model was created from a dataset with ID 5. + * @param {number} request.pageSize + * Requested page size. + * @param {string} request.pageToken + * A token identifying a page of results for the server to return + * Typically obtained via + * {@link protos.google.cloud.automl.v1beta1.ListModelsResponse.next_page_token|ListModelsResponse.next_page_token} of the previous + * {@link protos.google.cloud.automl.v1beta1.AutoMl.ListModels|AutoMl.ListModels} call. + * @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.automl.v1beta1.Model|Model}. 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/v1beta1/auto_ml.list_models.js + * region_tag:automl_v1beta1_generated_AutoMl_ListModels_async + */ + listModelsAsync( + request?: protos.google.cloud.automl.v1beta1.IListModelsRequest, + 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['listModels']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.listModels.asyncIterate( + this.innerApiCalls['listModels'] as GaxCall, + request as {}, + callSettings + ) as AsyncIterable; + } + /** + * Lists model evaluations. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. Resource name of the model to list the model evaluations for. + * If modelId is set as "-", this will list model evaluations from across all + * models of the parent location. + * @param {string} request.filter + * An expression for filtering the results of the request. + * + * * `annotation_spec_id` - for =, != or existence. See example below for + * the last. + * + * Some examples of using the filter are: + * + * * `annotation_spec_id!=4` --> The model evaluation was done for + * annotation spec with ID different than 4. + * * `NOT annotation_spec_id:*` --> The model evaluation was done for + * aggregate of all annotation specs. + * @param {number} request.pageSize + * Requested page size. + * @param {string} request.pageToken + * A token identifying a page of results for the server to return. + * Typically obtained via + * {@link protos.google.cloud.automl.v1beta1.ListModelEvaluationsResponse.next_page_token|ListModelEvaluationsResponse.next_page_token} of the previous + * {@link protos.google.cloud.automl.v1beta1.AutoMl.ListModelEvaluations|AutoMl.ListModelEvaluations} call. + * @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.automl.v1beta1.ModelEvaluation|ModelEvaluation}. + * 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 `listModelEvaluationsAsync()` + * 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. + */ + listModelEvaluations( + request?: protos.google.cloud.automl.v1beta1.IListModelEvaluationsRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.automl.v1beta1.IModelEvaluation[], + protos.google.cloud.automl.v1beta1.IListModelEvaluationsRequest | null, + protos.google.cloud.automl.v1beta1.IListModelEvaluationsResponse, + ] + >; + listModelEvaluations( + request: protos.google.cloud.automl.v1beta1.IListModelEvaluationsRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.cloud.automl.v1beta1.IListModelEvaluationsRequest, + | protos.google.cloud.automl.v1beta1.IListModelEvaluationsResponse + | null + | undefined, + protos.google.cloud.automl.v1beta1.IModelEvaluation + > + ): void; + listModelEvaluations( + request: protos.google.cloud.automl.v1beta1.IListModelEvaluationsRequest, + callback: PaginationCallback< + protos.google.cloud.automl.v1beta1.IListModelEvaluationsRequest, + | protos.google.cloud.automl.v1beta1.IListModelEvaluationsResponse + | null + | undefined, + protos.google.cloud.automl.v1beta1.IModelEvaluation + > + ): void; + listModelEvaluations( + request?: protos.google.cloud.automl.v1beta1.IListModelEvaluationsRequest, + optionsOrCallback?: + | CallOptions + | PaginationCallback< + protos.google.cloud.automl.v1beta1.IListModelEvaluationsRequest, + | protos.google.cloud.automl.v1beta1.IListModelEvaluationsResponse + | null + | undefined, + protos.google.cloud.automl.v1beta1.IModelEvaluation + >, + callback?: PaginationCallback< + protos.google.cloud.automl.v1beta1.IListModelEvaluationsRequest, + | protos.google.cloud.automl.v1beta1.IListModelEvaluationsResponse + | null + | undefined, + protos.google.cloud.automl.v1beta1.IModelEvaluation + > + ): Promise< + [ + protos.google.cloud.automl.v1beta1.IModelEvaluation[], + protos.google.cloud.automl.v1beta1.IListModelEvaluationsRequest | null, + protos.google.cloud.automl.v1beta1.IListModelEvaluationsResponse, + ] + > | 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(); + return this.innerApiCalls.listModelEvaluations(request, options, callback); + } + + /** + * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. Resource name of the model to list the model evaluations for. + * If modelId is set as "-", this will list model evaluations from across all + * models of the parent location. + * @param {string} request.filter + * An expression for filtering the results of the request. + * + * * `annotation_spec_id` - for =, != or existence. See example below for + * the last. + * + * Some examples of using the filter are: + * + * * `annotation_spec_id!=4` --> The model evaluation was done for + * annotation spec with ID different than 4. + * * `NOT annotation_spec_id:*` --> The model evaluation was done for + * aggregate of all annotation specs. + * @param {number} request.pageSize + * Requested page size. + * @param {string} request.pageToken + * A token identifying a page of results for the server to return. + * Typically obtained via + * {@link protos.google.cloud.automl.v1beta1.ListModelEvaluationsResponse.next_page_token|ListModelEvaluationsResponse.next_page_token} of the previous + * {@link protos.google.cloud.automl.v1beta1.AutoMl.ListModelEvaluations|AutoMl.ListModelEvaluations} call. + * @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.automl.v1beta1.ModelEvaluation|ModelEvaluation} 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 `listModelEvaluationsAsync()` + * 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. + */ + listModelEvaluationsStream( + request?: protos.google.cloud.automl.v1beta1.IListModelEvaluationsRequest, + 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['listModelEvaluations']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.listModelEvaluations.createStream( + this.innerApiCalls.listModelEvaluations as GaxCall, + request, + callSettings + ); + } + + /** + * Equivalent to `listModelEvaluations`, 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. Resource name of the model to list the model evaluations for. + * If modelId is set as "-", this will list model evaluations from across all + * models of the parent location. + * @param {string} request.filter + * An expression for filtering the results of the request. + * + * * `annotation_spec_id` - for =, != or existence. See example below for + * the last. + * + * Some examples of using the filter are: + * + * * `annotation_spec_id!=4` --> The model evaluation was done for + * annotation spec with ID different than 4. + * * `NOT annotation_spec_id:*` --> The model evaluation was done for + * aggregate of all annotation specs. + * @param {number} request.pageSize + * Requested page size. + * @param {string} request.pageToken + * A token identifying a page of results for the server to return. + * Typically obtained via + * {@link protos.google.cloud.automl.v1beta1.ListModelEvaluationsResponse.next_page_token|ListModelEvaluationsResponse.next_page_token} of the previous + * {@link protos.google.cloud.automl.v1beta1.AutoMl.ListModelEvaluations|AutoMl.ListModelEvaluations} call. + * @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.automl.v1beta1.ModelEvaluation|ModelEvaluation}. 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/v1beta1/auto_ml.list_model_evaluations.js + * region_tag:automl_v1beta1_generated_AutoMl_ListModelEvaluations_async + */ + listModelEvaluationsAsync( + request?: protos.google.cloud.automl.v1beta1.IListModelEvaluationsRequest, + 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['listModelEvaluations']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.listModelEvaluations.asyncIterate( + this.innerApiCalls['listModelEvaluations'] as GaxCall, + request as {}, + callSettings + ) as AsyncIterable; + } + // -------------------- + // -- Path templates -- + // -------------------- + + /** + * Return a fully-qualified annotationSpec resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} dataset + * @param {string} annotation_spec + * @returns {string} Resource name string. + */ + annotationSpecPath( + project: string, + location: string, + dataset: string, + annotationSpec: string + ) { + return this.pathTemplates.annotationSpecPathTemplate.render({ + project: project, + location: location, + dataset: dataset, + annotation_spec: annotationSpec, + }); + } + + /** + * Parse the project from AnnotationSpec resource. + * + * @param {string} annotationSpecName + * A fully-qualified path representing AnnotationSpec resource. + * @returns {string} A string representing the project. + */ + matchProjectFromAnnotationSpecName(annotationSpecName: string) { + return this.pathTemplates.annotationSpecPathTemplate.match( + annotationSpecName + ).project; + } + + /** + * Parse the location from AnnotationSpec resource. + * + * @param {string} annotationSpecName + * A fully-qualified path representing AnnotationSpec resource. + * @returns {string} A string representing the location. + */ + matchLocationFromAnnotationSpecName(annotationSpecName: string) { + return this.pathTemplates.annotationSpecPathTemplate.match( + annotationSpecName + ).location; + } + + /** + * Parse the dataset from AnnotationSpec resource. + * + * @param {string} annotationSpecName + * A fully-qualified path representing AnnotationSpec resource. + * @returns {string} A string representing the dataset. + */ + matchDatasetFromAnnotationSpecName(annotationSpecName: string) { + return this.pathTemplates.annotationSpecPathTemplate.match( + annotationSpecName + ).dataset; + } + + /** + * Parse the annotation_spec from AnnotationSpec resource. + * + * @param {string} annotationSpecName + * A fully-qualified path representing AnnotationSpec resource. + * @returns {string} A string representing the annotation_spec. + */ + matchAnnotationSpecFromAnnotationSpecName(annotationSpecName: string) { + return this.pathTemplates.annotationSpecPathTemplate.match( + annotationSpecName + ).annotation_spec; + } + + /** + * Return a fully-qualified columnSpec resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} dataset + * @param {string} table_spec + * @param {string} column_spec + * @returns {string} Resource name string. + */ + columnSpecPath( + project: string, + location: string, + dataset: string, + tableSpec: string, + columnSpec: string + ) { + return this.pathTemplates.columnSpecPathTemplate.render({ + project: project, + location: location, + dataset: dataset, + table_spec: tableSpec, + column_spec: columnSpec, + }); + } + + /** + * Parse the project from ColumnSpec resource. + * + * @param {string} columnSpecName + * A fully-qualified path representing ColumnSpec resource. + * @returns {string} A string representing the project. + */ + matchProjectFromColumnSpecName(columnSpecName: string) { + return this.pathTemplates.columnSpecPathTemplate.match(columnSpecName) + .project; + } + + /** + * Parse the location from ColumnSpec resource. + * + * @param {string} columnSpecName + * A fully-qualified path representing ColumnSpec resource. + * @returns {string} A string representing the location. + */ + matchLocationFromColumnSpecName(columnSpecName: string) { + return this.pathTemplates.columnSpecPathTemplate.match(columnSpecName) + .location; + } + + /** + * Parse the dataset from ColumnSpec resource. + * + * @param {string} columnSpecName + * A fully-qualified path representing ColumnSpec resource. + * @returns {string} A string representing the dataset. + */ + matchDatasetFromColumnSpecName(columnSpecName: string) { + return this.pathTemplates.columnSpecPathTemplate.match(columnSpecName) + .dataset; + } + + /** + * Parse the table_spec from ColumnSpec resource. + * + * @param {string} columnSpecName + * A fully-qualified path representing ColumnSpec resource. + * @returns {string} A string representing the table_spec. + */ + matchTableSpecFromColumnSpecName(columnSpecName: string) { + return this.pathTemplates.columnSpecPathTemplate.match(columnSpecName) + .table_spec; + } + + /** + * Parse the column_spec from ColumnSpec resource. + * + * @param {string} columnSpecName + * A fully-qualified path representing ColumnSpec resource. + * @returns {string} A string representing the column_spec. + */ + matchColumnSpecFromColumnSpecName(columnSpecName: string) { + return this.pathTemplates.columnSpecPathTemplate.match(columnSpecName) + .column_spec; + } + + /** + * Return a fully-qualified dataset resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} dataset + * @returns {string} Resource name string. + */ + datasetPath(project: string, location: string, dataset: string) { + return this.pathTemplates.datasetPathTemplate.render({ + project: project, + location: location, + dataset: dataset, + }); + } + + /** + * Parse the project from Dataset resource. + * + * @param {string} datasetName + * A fully-qualified path representing Dataset resource. + * @returns {string} A string representing the project. + */ + matchProjectFromDatasetName(datasetName: string) { + return this.pathTemplates.datasetPathTemplate.match(datasetName).project; + } + + /** + * Parse the location from Dataset resource. + * + * @param {string} datasetName + * A fully-qualified path representing Dataset resource. + * @returns {string} A string representing the location. + */ + matchLocationFromDatasetName(datasetName: string) { + return this.pathTemplates.datasetPathTemplate.match(datasetName).location; + } + + /** + * Parse the dataset from Dataset resource. + * + * @param {string} datasetName + * A fully-qualified path representing Dataset resource. + * @returns {string} A string representing the dataset. + */ + matchDatasetFromDatasetName(datasetName: string) { + return this.pathTemplates.datasetPathTemplate.match(datasetName).dataset; + } + + /** + * 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 model resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} model + * @returns {string} Resource name string. + */ + modelPath(project: string, location: string, model: string) { + return this.pathTemplates.modelPathTemplate.render({ + project: project, + location: location, + model: model, + }); + } + + /** + * Parse the project from Model resource. + * + * @param {string} modelName + * A fully-qualified path representing Model resource. + * @returns {string} A string representing the project. + */ + matchProjectFromModelName(modelName: string) { + return this.pathTemplates.modelPathTemplate.match(modelName).project; + } + + /** + * Parse the location from Model resource. + * + * @param {string} modelName + * A fully-qualified path representing Model resource. + * @returns {string} A string representing the location. + */ + matchLocationFromModelName(modelName: string) { + return this.pathTemplates.modelPathTemplate.match(modelName).location; + } + + /** + * Parse the model from Model resource. + * + * @param {string} modelName + * A fully-qualified path representing Model resource. + * @returns {string} A string representing the model. + */ + matchModelFromModelName(modelName: string) { + return this.pathTemplates.modelPathTemplate.match(modelName).model; + } + + /** + * Return a fully-qualified modelEvaluation resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} model + * @param {string} model_evaluation + * @returns {string} Resource name string. + */ + modelEvaluationPath( + project: string, + location: string, + model: string, + modelEvaluation: string + ) { + return this.pathTemplates.modelEvaluationPathTemplate.render({ + project: project, + location: location, + model: model, + model_evaluation: modelEvaluation, + }); + } + + /** + * Parse the project from ModelEvaluation resource. + * + * @param {string} modelEvaluationName + * A fully-qualified path representing ModelEvaluation resource. + * @returns {string} A string representing the project. + */ + matchProjectFromModelEvaluationName(modelEvaluationName: string) { + return this.pathTemplates.modelEvaluationPathTemplate.match( + modelEvaluationName + ).project; + } + + /** + * Parse the location from ModelEvaluation resource. + * + * @param {string} modelEvaluationName + * A fully-qualified path representing ModelEvaluation resource. + * @returns {string} A string representing the location. + */ + matchLocationFromModelEvaluationName(modelEvaluationName: string) { + return this.pathTemplates.modelEvaluationPathTemplate.match( + modelEvaluationName + ).location; + } + + /** + * Parse the model from ModelEvaluation resource. + * + * @param {string} modelEvaluationName + * A fully-qualified path representing ModelEvaluation resource. + * @returns {string} A string representing the model. + */ + matchModelFromModelEvaluationName(modelEvaluationName: string) { + return this.pathTemplates.modelEvaluationPathTemplate.match( + modelEvaluationName + ).model; + } + + /** + * Parse the model_evaluation from ModelEvaluation resource. + * + * @param {string} modelEvaluationName + * A fully-qualified path representing ModelEvaluation resource. + * @returns {string} A string representing the model_evaluation. + */ + matchModelEvaluationFromModelEvaluationName(modelEvaluationName: string) { + return this.pathTemplates.modelEvaluationPathTemplate.match( + modelEvaluationName + ).model_evaluation; + } + + /** + * Return a fully-qualified tableSpec resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} dataset + * @param {string} table_spec + * @returns {string} Resource name string. + */ + tableSpecPath( + project: string, + location: string, + dataset: string, + tableSpec: string + ) { + return this.pathTemplates.tableSpecPathTemplate.render({ + project: project, + location: location, + dataset: dataset, + table_spec: tableSpec, + }); + } + + /** + * Parse the project from TableSpec resource. + * + * @param {string} tableSpecName + * A fully-qualified path representing TableSpec resource. + * @returns {string} A string representing the project. + */ + matchProjectFromTableSpecName(tableSpecName: string) { + return this.pathTemplates.tableSpecPathTemplate.match(tableSpecName) + .project; + } + + /** + * Parse the location from TableSpec resource. + * + * @param {string} tableSpecName + * A fully-qualified path representing TableSpec resource. + * @returns {string} A string representing the location. + */ + matchLocationFromTableSpecName(tableSpecName: string) { + return this.pathTemplates.tableSpecPathTemplate.match(tableSpecName) + .location; + } + + /** + * Parse the dataset from TableSpec resource. + * + * @param {string} tableSpecName + * A fully-qualified path representing TableSpec resource. + * @returns {string} A string representing the dataset. + */ + matchDatasetFromTableSpecName(tableSpecName: string) { + return this.pathTemplates.tableSpecPathTemplate.match(tableSpecName) + .dataset; + } + + /** + * Parse the table_spec from TableSpec resource. + * + * @param {string} tableSpecName + * A fully-qualified path representing TableSpec resource. + * @returns {string} A string representing the table_spec. + */ + matchTableSpecFromTableSpecName(tableSpecName: string) { + return this.pathTemplates.tableSpecPathTemplate.match(tableSpecName) + .table_spec; + } + + /** + * 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.autoMlStub && !this._terminated) { + return this.autoMlStub.then(stub => { + this._terminated = true; + stub.close(); + this.operationsClient.close(); + }); + } + return Promise.resolve(); + } +} diff --git a/packages/google-cloud-automl/src/v1beta1/auto_ml_client_config.json b/packages/google-cloud-automl/src/v1beta1/auto_ml_client_config.json new file mode 100644 index 00000000000..019742ff974 --- /dev/null +++ b/packages/google-cloud-automl/src/v1beta1/auto_ml_client_config.json @@ -0,0 +1,146 @@ +{ + "interfaces": { + "google.cloud.automl.v1beta1.AutoMl": { + "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": { + "CreateDataset": { + "timeout_millis": 5000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "GetDataset": { + "timeout_millis": 5000, + "retry_codes_name": "idempotent", + "retry_params_name": "default" + }, + "ListDatasets": { + "timeout_millis": 5000, + "retry_codes_name": "idempotent", + "retry_params_name": "default" + }, + "UpdateDataset": { + "timeout_millis": 5000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "DeleteDataset": { + "timeout_millis": 5000, + "retry_codes_name": "idempotent", + "retry_params_name": "default" + }, + "ImportData": { + "timeout_millis": 5000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "ExportData": { + "timeout_millis": 5000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "GetAnnotationSpec": { + "timeout_millis": 5000, + "retry_codes_name": "idempotent", + "retry_params_name": "default" + }, + "GetTableSpec": { + "timeout_millis": 5000, + "retry_codes_name": "idempotent", + "retry_params_name": "default" + }, + "ListTableSpecs": { + "timeout_millis": 5000, + "retry_codes_name": "idempotent", + "retry_params_name": "default" + }, + "UpdateTableSpec": { + "timeout_millis": 5000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "GetColumnSpec": { + "timeout_millis": 5000, + "retry_codes_name": "idempotent", + "retry_params_name": "default" + }, + "ListColumnSpecs": { + "timeout_millis": 5000, + "retry_codes_name": "idempotent", + "retry_params_name": "default" + }, + "UpdateColumnSpec": { + "timeout_millis": 5000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "CreateModel": { + "timeout_millis": 5000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "GetModel": { + "timeout_millis": 5000, + "retry_codes_name": "idempotent", + "retry_params_name": "default" + }, + "ListModels": { + "timeout_millis": 5000, + "retry_codes_name": "idempotent", + "retry_params_name": "default" + }, + "DeleteModel": { + "timeout_millis": 5000, + "retry_codes_name": "idempotent", + "retry_params_name": "default" + }, + "DeployModel": { + "timeout_millis": 5000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "UndeployModel": { + "timeout_millis": 5000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "ExportModel": { + "timeout_millis": 5000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "ExportEvaluatedExamples": { + "timeout_millis": 5000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "GetModelEvaluation": { + "timeout_millis": 5000, + "retry_codes_name": "idempotent", + "retry_params_name": "default" + }, + "ListModelEvaluations": { + "timeout_millis": 5000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + } + } + } + } +} diff --git a/packages/google-cloud-automl/src/v1beta1/auto_ml_proto_list.json b/packages/google-cloud-automl/src/v1beta1/auto_ml_proto_list.json new file mode 100644 index 00000000000..3a493dbb13a --- /dev/null +++ b/packages/google-cloud-automl/src/v1beta1/auto_ml_proto_list.json @@ -0,0 +1,30 @@ +[ + "../../protos/google/cloud/automl/v1beta1/annotation_payload.proto", + "../../protos/google/cloud/automl/v1beta1/annotation_spec.proto", + "../../protos/google/cloud/automl/v1beta1/classification.proto", + "../../protos/google/cloud/automl/v1beta1/column_spec.proto", + "../../protos/google/cloud/automl/v1beta1/data_items.proto", + "../../protos/google/cloud/automl/v1beta1/data_stats.proto", + "../../protos/google/cloud/automl/v1beta1/data_types.proto", + "../../protos/google/cloud/automl/v1beta1/dataset.proto", + "../../protos/google/cloud/automl/v1beta1/detection.proto", + "../../protos/google/cloud/automl/v1beta1/geometry.proto", + "../../protos/google/cloud/automl/v1beta1/image.proto", + "../../protos/google/cloud/automl/v1beta1/io.proto", + "../../protos/google/cloud/automl/v1beta1/model.proto", + "../../protos/google/cloud/automl/v1beta1/model_evaluation.proto", + "../../protos/google/cloud/automl/v1beta1/operations.proto", + "../../protos/google/cloud/automl/v1beta1/prediction_service.proto", + "../../protos/google/cloud/automl/v1beta1/ranges.proto", + "../../protos/google/cloud/automl/v1beta1/regression.proto", + "../../protos/google/cloud/automl/v1beta1/service.proto", + "../../protos/google/cloud/automl/v1beta1/table_spec.proto", + "../../protos/google/cloud/automl/v1beta1/tables.proto", + "../../protos/google/cloud/automl/v1beta1/temporal.proto", + "../../protos/google/cloud/automl/v1beta1/text.proto", + "../../protos/google/cloud/automl/v1beta1/text_extraction.proto", + "../../protos/google/cloud/automl/v1beta1/text_segment.proto", + "../../protos/google/cloud/automl/v1beta1/text_sentiment.proto", + "../../protos/google/cloud/automl/v1beta1/translation.proto", + "../../protos/google/cloud/automl/v1beta1/video.proto" +] diff --git a/packages/google-cloud-automl/src/v1beta1/gapic_metadata.json b/packages/google-cloud-automl/src/v1beta1/gapic_metadata.json new file mode 100644 index 00000000000..ab872c5f77b --- /dev/null +++ b/packages/google-cloud-automl/src/v1beta1/gapic_metadata.json @@ -0,0 +1,317 @@ +{ + "schema": "1.0", + "comment": "This file maps proto services/RPCs to the corresponding library clients/methods", + "language": "typescript", + "protoPackage": "google.cloud.automl.v1beta1", + "libraryPackage": "@google-cloud/automl", + "services": { + "AutoMl": { + "clients": { + "grpc": { + "libraryClient": "AutoMlClient", + "rpcs": { + "CreateDataset": { + "methods": [ + "createDataset" + ] + }, + "GetDataset": { + "methods": [ + "getDataset" + ] + }, + "UpdateDataset": { + "methods": [ + "updateDataset" + ] + }, + "GetAnnotationSpec": { + "methods": [ + "getAnnotationSpec" + ] + }, + "GetTableSpec": { + "methods": [ + "getTableSpec" + ] + }, + "UpdateTableSpec": { + "methods": [ + "updateTableSpec" + ] + }, + "GetColumnSpec": { + "methods": [ + "getColumnSpec" + ] + }, + "UpdateColumnSpec": { + "methods": [ + "updateColumnSpec" + ] + }, + "GetModel": { + "methods": [ + "getModel" + ] + }, + "GetModelEvaluation": { + "methods": [ + "getModelEvaluation" + ] + }, + "DeleteDataset": { + "methods": [ + "deleteDataset" + ] + }, + "ImportData": { + "methods": [ + "importData" + ] + }, + "ExportData": { + "methods": [ + "exportData" + ] + }, + "CreateModel": { + "methods": [ + "createModel" + ] + }, + "DeleteModel": { + "methods": [ + "deleteModel" + ] + }, + "DeployModel": { + "methods": [ + "deployModel" + ] + }, + "UndeployModel": { + "methods": [ + "undeployModel" + ] + }, + "ExportModel": { + "methods": [ + "exportModel" + ] + }, + "ExportEvaluatedExamples": { + "methods": [ + "exportEvaluatedExamples" + ] + }, + "ListDatasets": { + "methods": [ + "listDatasets", + "listDatasetsStream", + "listDatasetsAsync" + ] + }, + "ListTableSpecs": { + "methods": [ + "listTableSpecs", + "listTableSpecsStream", + "listTableSpecsAsync" + ] + }, + "ListColumnSpecs": { + "methods": [ + "listColumnSpecs", + "listColumnSpecsStream", + "listColumnSpecsAsync" + ] + }, + "ListModels": { + "methods": [ + "listModels", + "listModelsStream", + "listModelsAsync" + ] + }, + "ListModelEvaluations": { + "methods": [ + "listModelEvaluations", + "listModelEvaluationsStream", + "listModelEvaluationsAsync" + ] + } + } + }, + "grpc-fallback": { + "libraryClient": "AutoMlClient", + "rpcs": { + "CreateDataset": { + "methods": [ + "createDataset" + ] + }, + "GetDataset": { + "methods": [ + "getDataset" + ] + }, + "UpdateDataset": { + "methods": [ + "updateDataset" + ] + }, + "GetAnnotationSpec": { + "methods": [ + "getAnnotationSpec" + ] + }, + "GetTableSpec": { + "methods": [ + "getTableSpec" + ] + }, + "UpdateTableSpec": { + "methods": [ + "updateTableSpec" + ] + }, + "GetColumnSpec": { + "methods": [ + "getColumnSpec" + ] + }, + "UpdateColumnSpec": { + "methods": [ + "updateColumnSpec" + ] + }, + "GetModel": { + "methods": [ + "getModel" + ] + }, + "GetModelEvaluation": { + "methods": [ + "getModelEvaluation" + ] + }, + "DeleteDataset": { + "methods": [ + "deleteDataset" + ] + }, + "ImportData": { + "methods": [ + "importData" + ] + }, + "ExportData": { + "methods": [ + "exportData" + ] + }, + "CreateModel": { + "methods": [ + "createModel" + ] + }, + "DeleteModel": { + "methods": [ + "deleteModel" + ] + }, + "DeployModel": { + "methods": [ + "deployModel" + ] + }, + "UndeployModel": { + "methods": [ + "undeployModel" + ] + }, + "ExportModel": { + "methods": [ + "exportModel" + ] + }, + "ExportEvaluatedExamples": { + "methods": [ + "exportEvaluatedExamples" + ] + }, + "ListDatasets": { + "methods": [ + "listDatasets", + "listDatasetsStream", + "listDatasetsAsync" + ] + }, + "ListTableSpecs": { + "methods": [ + "listTableSpecs", + "listTableSpecsStream", + "listTableSpecsAsync" + ] + }, + "ListColumnSpecs": { + "methods": [ + "listColumnSpecs", + "listColumnSpecsStream", + "listColumnSpecsAsync" + ] + }, + "ListModels": { + "methods": [ + "listModels", + "listModelsStream", + "listModelsAsync" + ] + }, + "ListModelEvaluations": { + "methods": [ + "listModelEvaluations", + "listModelEvaluationsStream", + "listModelEvaluationsAsync" + ] + } + } + } + } + }, + "PredictionService": { + "clients": { + "grpc": { + "libraryClient": "PredictionServiceClient", + "rpcs": { + "Predict": { + "methods": [ + "predict" + ] + }, + "BatchPredict": { + "methods": [ + "batchPredict" + ] + } + } + }, + "grpc-fallback": { + "libraryClient": "PredictionServiceClient", + "rpcs": { + "Predict": { + "methods": [ + "predict" + ] + }, + "BatchPredict": { + "methods": [ + "batchPredict" + ] + } + } + } + } + } + } +} diff --git a/packages/google-cloud-automl/src/v1beta1/index.ts b/packages/google-cloud-automl/src/v1beta1/index.ts new file mode 100644 index 00000000000..d736d0fb81a --- /dev/null +++ b/packages/google-cloud-automl/src/v1beta1/index.ts @@ -0,0 +1,20 @@ +// Copyright 2023 Google LLC +// +// Licensed under the Apache License, Version 2.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 {AutoMlClient} from './auto_ml_client'; +export {PredictionServiceClient} from './prediction_service_client'; diff --git a/packages/google-cloud-automl/src/v1beta1/prediction_service_client.ts b/packages/google-cloud-automl/src/v1beta1/prediction_service_client.ts new file mode 100644 index 00000000000..86c19c5f851 --- /dev/null +++ b/packages/google-cloud-automl/src/v1beta1/prediction_service_client.ts @@ -0,0 +1,1194 @@ +// Copyright 2023 Google LLC +// +// Licensed under the Apache License, Version 2.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 * as protos from '../../protos/protos'; +import jsonProtos = require('../../protos/protos.json'); +/** + * Client JSON configuration object, loaded from + * `src/v1beta1/prediction_service_client_config.json`. + * This file defines retry strategy and timeouts for all API methods in this library. + */ +import * as gapicConfig from './prediction_service_client_config.json'; +const version = require('../../../package.json').version; + +/** + * AutoML Prediction API. + * + * On any input that is documented to expect a string parameter in + * snake_case or kebab-case, either of those cases is accepted. + * @class + * @memberof v1beta1 + */ +export class PredictionServiceClient { + 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}; + 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; + predictionServiceStub?: Promise<{[name: string]: Function}>; + + /** + * Construct an instance of PredictionServiceClient. + * + * @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://developers.google.com/identity/protocols/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 PredictionServiceClient({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 PredictionServiceClient; + const servicePath = + opts?.servicePath || opts?.apiEndpoint || staticMembers.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 !== staticMembers.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 = staticMembers.servicePath; + + // Set the default scopes in auth client if needed. + if (servicePath === staticMembers.servicePath) { + this.auth.defaultScopes = staticMembers.scopes; + } + + // Determine the client header string. + const clientHeader = [`gax/${this._gaxModule.version}`, `gapic/${version}`]; + if (typeof process !== 'undefined' && '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 = { + annotationSpecPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/datasets/{dataset}/annotationSpecs/{annotation_spec}' + ), + columnSpecPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/datasets/{dataset}/tableSpecs/{table_spec}/columnSpecs/{column_spec}' + ), + datasetPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/datasets/{dataset}' + ), + modelPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/models/{model}' + ), + modelEvaluationPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/models/{model}/modelEvaluations/{model_evaluation}' + ), + tableSpecPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/datasets/{dataset}/tableSpecs/{table_spec}' + ), + }; + + const protoFilesRoot = this._gaxModule.protobuf.Root.fromJSON(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.iam.v1.IAMPolicy.GetIamPolicy', + get: '/v1beta1/{resource=projects/*/locations/*}:getIamPolicy', + additional_bindings: [ + { + get: '/v1beta1/{resource=projects/*/locations/*/datasets/*}:getIamPolicy', + }, + { + get: '/v1beta1/{resource=projects/*/locations/*/models/*}:getIamPolicy', + }, + ], + }, + { + selector: 'google.iam.v1.IAMPolicy.SetIamPolicy', + post: '/v1beta1/{resource=projects/*/locations/*}:setIamPolicy', + body: '*', + additional_bindings: [ + { + post: '/v1beta1/{resource=projects/*/locations/*/datasets/*}:setIamPolicy', + body: '*', + }, + { + post: '/v1beta1/{resource=projects/*/locations/*/models/*}:setIamPolicy', + body: '*', + }, + ], + }, + { + selector: 'google.iam.v1.IAMPolicy.TestIamPermissions', + post: '/v1beta1/{resource=projects/*/locations/*/**}:testIamPermissions', + body: '*', + }, + { + selector: 'google.longrunning.Operations.CancelOperation', + post: '/v1beta1/{name=projects/*/locations/*/operations/*}:cancel', + body: '*', + }, + { + selector: 'google.longrunning.Operations.DeleteOperation', + delete: '/v1beta1/{name=projects/*/locations/*/operations/*}', + }, + { + selector: 'google.longrunning.Operations.GetOperation', + get: '/v1beta1/{name=projects/*/locations/*/operations/*}', + }, + { + selector: 'google.longrunning.Operations.ListOperations', + get: '/v1beta1/{name=projects/*/locations/*}/operations', + }, + { + selector: 'google.longrunning.Operations.WaitOperation', + post: '/v1beta1/{name=projects/*/locations/*/operations/*}:wait', + body: '*', + }, + ]; + } + this.operationsClient = this._gaxModule + .lro(lroOptions) + .operationsClient(opts); + const batchPredictResponse = protoFilesRoot.lookup( + '.google.cloud.automl.v1beta1.BatchPredictResult' + ) as gax.protobuf.Type; + const batchPredictMetadata = protoFilesRoot.lookup( + '.google.cloud.automl.v1beta1.OperationMetadata' + ) as gax.protobuf.Type; + + this.descriptors.longrunning = { + batchPredict: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + batchPredictResponse.decode.bind(batchPredictResponse), + batchPredictMetadata.decode.bind(batchPredictMetadata) + ), + }; + + // Put together the default options sent with requests. + this._defaults = this._gaxGrpc.constructSettings( + 'google.cloud.automl.v1beta1.PredictionService', + 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.predictionServiceStub) { + return this.predictionServiceStub; + } + + // Put together the "service stub" for + // google.cloud.automl.v1beta1.PredictionService. + this.predictionServiceStub = this._gaxGrpc.createStub( + this._opts.fallback + ? (this._protos as protobuf.Root).lookupService( + 'google.cloud.automl.v1beta1.PredictionService' + ) + : // eslint-disable-next-line @typescript-eslint/no-explicit-any + (this._protos as any).google.cloud.automl.v1beta1.PredictionService, + 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 predictionServiceStubMethods = ['predict', 'batchPredict']; + for (const methodName of predictionServiceStubMethods) { + const callPromise = this.predictionServiceStub.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.longrunning[methodName] || undefined; + const apiCall = this._gaxModule.createApiCall( + callPromise, + this._defaults[methodName], + descriptor, + this._opts.fallback + ); + + this.innerApiCalls[methodName] = apiCall; + } + + return this.predictionServiceStub; + } + + /** + * The DNS address for this API service. + * @returns {string} The DNS address for this service. + */ + static get servicePath() { + return 'automl.googleapis.com'; + } + + /** + * The DNS address for this API service - same as servicePath(), + * exists for compatibility reasons. + * @returns {string} The DNS address for this service. + */ + static get apiEndpoint() { + return 'automl.googleapis.com'; + } + + /** + * 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 -- + // ------------------- + /** + * Perform an online prediction. The prediction result will be directly + * returned in the response. + * Available for following ML problems, and their expected request payloads: + * * Image Classification - Image in .JPEG, .GIF or .PNG format, image_bytes + * up to 30MB. + * * Image Object Detection - Image in .JPEG, .GIF or .PNG format, image_bytes + * up to 30MB. + * * Text Classification - TextSnippet, content up to 60,000 characters, + * UTF-8 encoded. + * * Text Extraction - TextSnippet, content up to 30,000 characters, + * UTF-8 NFC encoded. + * * Translation - TextSnippet, content up to 25,000 characters, UTF-8 + * encoded. + * * Tables - Row, with column values matching the columns of the model, + * up to 5MB. Not available for FORECASTING + * + * {@link protos.google.cloud.automl.v1beta1.TablesModelMetadata.prediction_type|prediction_type}. + * * Text Sentiment - TextSnippet, content up 500 characters, UTF-8 + * encoded. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. Name of the model requested to serve the prediction. + * @param {google.cloud.automl.v1beta1.ExamplePayload} request.payload + * Required. Payload to perform a prediction on. The payload must match the + * problem type that the model was trained to solve. + * @param {number[]} request.params + * Additional domain-specific parameters, any string must be up to 25000 + * characters long. + * + * * For Image Classification: + * + * `score_threshold` - (float) A value from 0.0 to 1.0. When the model + * makes predictions for an image, it will only produce results that have + * at least this confidence score. The default is 0.5. + * + * * For Image Object Detection: + * `score_threshold` - (float) When Model detects objects on the image, + * it will only produce bounding boxes which have at least this + * confidence score. Value in 0 to 1 range, default is 0.5. + * `max_bounding_box_count` - (int64) No more than this number of bounding + * boxes will be returned in the response. Default is 100, the + * requested value may be limited by server. + * * For Tables: + * feature_importance - (boolean) Whether feature importance + * should be populated in the returned TablesAnnotation. + * The default is false. + * @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.automl.v1beta1.PredictResponse|PredictResponse}. + * 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/v1beta1/prediction_service.predict.js + * region_tag:automl_v1beta1_generated_PredictionService_Predict_async + */ + predict( + request?: protos.google.cloud.automl.v1beta1.IPredictRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.automl.v1beta1.IPredictResponse, + protos.google.cloud.automl.v1beta1.IPredictRequest | undefined, + {} | undefined, + ] + >; + predict( + request: protos.google.cloud.automl.v1beta1.IPredictRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.automl.v1beta1.IPredictResponse, + protos.google.cloud.automl.v1beta1.IPredictRequest | null | undefined, + {} | null | undefined + > + ): void; + predict( + request: protos.google.cloud.automl.v1beta1.IPredictRequest, + callback: Callback< + protos.google.cloud.automl.v1beta1.IPredictResponse, + protos.google.cloud.automl.v1beta1.IPredictRequest | null | undefined, + {} | null | undefined + > + ): void; + predict( + request?: protos.google.cloud.automl.v1beta1.IPredictRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.automl.v1beta1.IPredictResponse, + protos.google.cloud.automl.v1beta1.IPredictRequest | null | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.automl.v1beta1.IPredictResponse, + protos.google.cloud.automl.v1beta1.IPredictRequest | null | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.automl.v1beta1.IPredictResponse, + protos.google.cloud.automl.v1beta1.IPredictRequest | 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(); + return this.innerApiCalls.predict(request, options, callback); + } + + /** + * Perform a batch prediction. Unlike the online {@link protos.google.cloud.automl.v1beta1.PredictionService.Predict|Predict}, batch + * prediction result won't be immediately available in the response. Instead, + * a long running operation object is returned. User can poll the operation + * result via {@link protos.google.longrunning.Operations.GetOperation|GetOperation} + * method. Once the operation is done, {@link protos.google.cloud.automl.v1beta1.BatchPredictResult|BatchPredictResult} is returned in + * the {@link protos.google.longrunning.Operation.response|response} field. + * Available for following ML problems: + * * Image Classification + * * Image Object Detection + * * Video Classification + * * Video Object Tracking * Text Extraction + * * Tables + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. Name of the model requested to serve the batch prediction. + * @param {google.cloud.automl.v1beta1.BatchPredictInputConfig} request.inputConfig + * Required. The input configuration for batch prediction. + * @param {google.cloud.automl.v1beta1.BatchPredictOutputConfig} request.outputConfig + * Required. The Configuration specifying where output predictions should + * be written. + * @param {number[]} request.params + * Required. Additional domain-specific parameters for the predictions, any string must + * be up to 25000 characters long. + * + * * For Text Classification: + * + * `score_threshold` - (float) A value from 0.0 to 1.0. When the model + * makes predictions for a text snippet, it will only produce results + * that have at least this confidence score. The default is 0.5. + * + * * For Image Classification: + * + * `score_threshold` - (float) A value from 0.0 to 1.0. When the model + * makes predictions for an image, it will only produce results that + * have at least this confidence score. The default is 0.5. + * + * * For Image Object Detection: + * + * `score_threshold` - (float) When Model detects objects on the image, + * it will only produce bounding boxes which have at least this + * confidence score. Value in 0 to 1 range, default is 0.5. + * `max_bounding_box_count` - (int64) No more than this number of bounding + * boxes will be produced per image. Default is 100, the + * requested value may be limited by server. + * + * * For Video Classification : + * + * `score_threshold` - (float) A value from 0.0 to 1.0. When the model + * makes predictions for a video, it will only produce results that + * have at least this confidence score. The default is 0.5. + * `segment_classification` - (boolean) Set to true to request + * segment-level classification. AutoML Video Intelligence returns + * labels and their confidence scores for the entire segment of the + * video that user specified in the request configuration. + * The default is "true". + * `shot_classification` - (boolean) Set to true to request shot-level + * classification. AutoML Video Intelligence determines the boundaries + * for each camera shot in the entire segment of the video that user + * specified in the request configuration. AutoML Video Intelligence + * then returns labels and their confidence scores for each detected + * shot, along with the start and end time of the shot. + * WARNING: Model evaluation is not done for this classification type, + * the quality of it depends on training data, but there are no metrics + * provided to describe that quality. The default is "false". + * `1s_interval_classification` - (boolean) Set to true to request + * classification for a video at one-second intervals. AutoML Video + * Intelligence returns labels and their confidence scores for each + * second of the entire segment of the video that user specified in the + * request configuration. + * WARNING: Model evaluation is not done for this classification + * type, the quality of it depends on training data, but there are no + * metrics provided to describe that quality. The default is + * "false". + * + * * For Tables: + * + * feature_importance - (boolean) Whether feature importance + * should be populated in the returned TablesAnnotations. The + * default is false. + * + * * For Video Object Tracking: + * + * `score_threshold` - (float) When Model detects objects on video frames, + * it will only produce bounding boxes which have at least this + * confidence score. Value in 0 to 1 range, default is 0.5. + * `max_bounding_box_count` - (int64) No more than this number of bounding + * boxes will be returned per frame. Default is 100, the requested + * value may be limited by server. + * `min_bounding_box_size` - (float) Only bounding boxes with shortest edge + * at least that long as a relative value of video frame size will be + * returned. Value in 0 to 1 range. Default is 0. + * @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/v1beta1/prediction_service.batch_predict.js + * region_tag:automl_v1beta1_generated_PredictionService_BatchPredict_async + */ + batchPredict( + request?: protos.google.cloud.automl.v1beta1.IBatchPredictRequest, + options?: CallOptions + ): Promise< + [ + LROperation< + protos.google.cloud.automl.v1beta1.IBatchPredictResult, + protos.google.cloud.automl.v1beta1.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined, + ] + >; + batchPredict( + request: protos.google.cloud.automl.v1beta1.IBatchPredictRequest, + options: CallOptions, + callback: Callback< + LROperation< + protos.google.cloud.automl.v1beta1.IBatchPredictResult, + protos.google.cloud.automl.v1beta1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + batchPredict( + request: protos.google.cloud.automl.v1beta1.IBatchPredictRequest, + callback: Callback< + LROperation< + protos.google.cloud.automl.v1beta1.IBatchPredictResult, + protos.google.cloud.automl.v1beta1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + batchPredict( + request?: protos.google.cloud.automl.v1beta1.IBatchPredictRequest, + optionsOrCallback?: + | CallOptions + | Callback< + LROperation< + protos.google.cloud.automl.v1beta1.IBatchPredictResult, + protos.google.cloud.automl.v1beta1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + callback?: Callback< + LROperation< + protos.google.cloud.automl.v1beta1.IBatchPredictResult, + protos.google.cloud.automl.v1beta1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): Promise< + [ + LROperation< + protos.google.cloud.automl.v1beta1.IBatchPredictResult, + protos.google.cloud.automl.v1beta1.IOperationMetadata + >, + 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(); + return this.innerApiCalls.batchPredict(request, options, callback); + } + /** + * Check the status of the long running operation returned by `batchPredict()`. + * @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/v1beta1/prediction_service.batch_predict.js + * region_tag:automl_v1beta1_generated_PredictionService_BatchPredict_async + */ + async checkBatchPredictProgress( + name: string + ): Promise< + LROperation< + protos.google.cloud.automl.v1beta1.BatchPredictResult, + protos.google.cloud.automl.v1beta1.OperationMetadata + > + > { + 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.batchPredict, + this._gaxModule.createDefaultBackoffSettings() + ); + return decodeOperation as LROperation< + protos.google.cloud.automl.v1beta1.BatchPredictResult, + protos.google.cloud.automl.v1beta1.OperationMetadata + >; + } + // -------------------- + // -- Path templates -- + // -------------------- + + /** + * Return a fully-qualified annotationSpec resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} dataset + * @param {string} annotation_spec + * @returns {string} Resource name string. + */ + annotationSpecPath( + project: string, + location: string, + dataset: string, + annotationSpec: string + ) { + return this.pathTemplates.annotationSpecPathTemplate.render({ + project: project, + location: location, + dataset: dataset, + annotation_spec: annotationSpec, + }); + } + + /** + * Parse the project from AnnotationSpec resource. + * + * @param {string} annotationSpecName + * A fully-qualified path representing AnnotationSpec resource. + * @returns {string} A string representing the project. + */ + matchProjectFromAnnotationSpecName(annotationSpecName: string) { + return this.pathTemplates.annotationSpecPathTemplate.match( + annotationSpecName + ).project; + } + + /** + * Parse the location from AnnotationSpec resource. + * + * @param {string} annotationSpecName + * A fully-qualified path representing AnnotationSpec resource. + * @returns {string} A string representing the location. + */ + matchLocationFromAnnotationSpecName(annotationSpecName: string) { + return this.pathTemplates.annotationSpecPathTemplate.match( + annotationSpecName + ).location; + } + + /** + * Parse the dataset from AnnotationSpec resource. + * + * @param {string} annotationSpecName + * A fully-qualified path representing AnnotationSpec resource. + * @returns {string} A string representing the dataset. + */ + matchDatasetFromAnnotationSpecName(annotationSpecName: string) { + return this.pathTemplates.annotationSpecPathTemplate.match( + annotationSpecName + ).dataset; + } + + /** + * Parse the annotation_spec from AnnotationSpec resource. + * + * @param {string} annotationSpecName + * A fully-qualified path representing AnnotationSpec resource. + * @returns {string} A string representing the annotation_spec. + */ + matchAnnotationSpecFromAnnotationSpecName(annotationSpecName: string) { + return this.pathTemplates.annotationSpecPathTemplate.match( + annotationSpecName + ).annotation_spec; + } + + /** + * Return a fully-qualified columnSpec resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} dataset + * @param {string} table_spec + * @param {string} column_spec + * @returns {string} Resource name string. + */ + columnSpecPath( + project: string, + location: string, + dataset: string, + tableSpec: string, + columnSpec: string + ) { + return this.pathTemplates.columnSpecPathTemplate.render({ + project: project, + location: location, + dataset: dataset, + table_spec: tableSpec, + column_spec: columnSpec, + }); + } + + /** + * Parse the project from ColumnSpec resource. + * + * @param {string} columnSpecName + * A fully-qualified path representing ColumnSpec resource. + * @returns {string} A string representing the project. + */ + matchProjectFromColumnSpecName(columnSpecName: string) { + return this.pathTemplates.columnSpecPathTemplate.match(columnSpecName) + .project; + } + + /** + * Parse the location from ColumnSpec resource. + * + * @param {string} columnSpecName + * A fully-qualified path representing ColumnSpec resource. + * @returns {string} A string representing the location. + */ + matchLocationFromColumnSpecName(columnSpecName: string) { + return this.pathTemplates.columnSpecPathTemplate.match(columnSpecName) + .location; + } + + /** + * Parse the dataset from ColumnSpec resource. + * + * @param {string} columnSpecName + * A fully-qualified path representing ColumnSpec resource. + * @returns {string} A string representing the dataset. + */ + matchDatasetFromColumnSpecName(columnSpecName: string) { + return this.pathTemplates.columnSpecPathTemplate.match(columnSpecName) + .dataset; + } + + /** + * Parse the table_spec from ColumnSpec resource. + * + * @param {string} columnSpecName + * A fully-qualified path representing ColumnSpec resource. + * @returns {string} A string representing the table_spec. + */ + matchTableSpecFromColumnSpecName(columnSpecName: string) { + return this.pathTemplates.columnSpecPathTemplate.match(columnSpecName) + .table_spec; + } + + /** + * Parse the column_spec from ColumnSpec resource. + * + * @param {string} columnSpecName + * A fully-qualified path representing ColumnSpec resource. + * @returns {string} A string representing the column_spec. + */ + matchColumnSpecFromColumnSpecName(columnSpecName: string) { + return this.pathTemplates.columnSpecPathTemplate.match(columnSpecName) + .column_spec; + } + + /** + * Return a fully-qualified dataset resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} dataset + * @returns {string} Resource name string. + */ + datasetPath(project: string, location: string, dataset: string) { + return this.pathTemplates.datasetPathTemplate.render({ + project: project, + location: location, + dataset: dataset, + }); + } + + /** + * Parse the project from Dataset resource. + * + * @param {string} datasetName + * A fully-qualified path representing Dataset resource. + * @returns {string} A string representing the project. + */ + matchProjectFromDatasetName(datasetName: string) { + return this.pathTemplates.datasetPathTemplate.match(datasetName).project; + } + + /** + * Parse the location from Dataset resource. + * + * @param {string} datasetName + * A fully-qualified path representing Dataset resource. + * @returns {string} A string representing the location. + */ + matchLocationFromDatasetName(datasetName: string) { + return this.pathTemplates.datasetPathTemplate.match(datasetName).location; + } + + /** + * Parse the dataset from Dataset resource. + * + * @param {string} datasetName + * A fully-qualified path representing Dataset resource. + * @returns {string} A string representing the dataset. + */ + matchDatasetFromDatasetName(datasetName: string) { + return this.pathTemplates.datasetPathTemplate.match(datasetName).dataset; + } + + /** + * Return a fully-qualified model resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} model + * @returns {string} Resource name string. + */ + modelPath(project: string, location: string, model: string) { + return this.pathTemplates.modelPathTemplate.render({ + project: project, + location: location, + model: model, + }); + } + + /** + * Parse the project from Model resource. + * + * @param {string} modelName + * A fully-qualified path representing Model resource. + * @returns {string} A string representing the project. + */ + matchProjectFromModelName(modelName: string) { + return this.pathTemplates.modelPathTemplate.match(modelName).project; + } + + /** + * Parse the location from Model resource. + * + * @param {string} modelName + * A fully-qualified path representing Model resource. + * @returns {string} A string representing the location. + */ + matchLocationFromModelName(modelName: string) { + return this.pathTemplates.modelPathTemplate.match(modelName).location; + } + + /** + * Parse the model from Model resource. + * + * @param {string} modelName + * A fully-qualified path representing Model resource. + * @returns {string} A string representing the model. + */ + matchModelFromModelName(modelName: string) { + return this.pathTemplates.modelPathTemplate.match(modelName).model; + } + + /** + * Return a fully-qualified modelEvaluation resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} model + * @param {string} model_evaluation + * @returns {string} Resource name string. + */ + modelEvaluationPath( + project: string, + location: string, + model: string, + modelEvaluation: string + ) { + return this.pathTemplates.modelEvaluationPathTemplate.render({ + project: project, + location: location, + model: model, + model_evaluation: modelEvaluation, + }); + } + + /** + * Parse the project from ModelEvaluation resource. + * + * @param {string} modelEvaluationName + * A fully-qualified path representing ModelEvaluation resource. + * @returns {string} A string representing the project. + */ + matchProjectFromModelEvaluationName(modelEvaluationName: string) { + return this.pathTemplates.modelEvaluationPathTemplate.match( + modelEvaluationName + ).project; + } + + /** + * Parse the location from ModelEvaluation resource. + * + * @param {string} modelEvaluationName + * A fully-qualified path representing ModelEvaluation resource. + * @returns {string} A string representing the location. + */ + matchLocationFromModelEvaluationName(modelEvaluationName: string) { + return this.pathTemplates.modelEvaluationPathTemplate.match( + modelEvaluationName + ).location; + } + + /** + * Parse the model from ModelEvaluation resource. + * + * @param {string} modelEvaluationName + * A fully-qualified path representing ModelEvaluation resource. + * @returns {string} A string representing the model. + */ + matchModelFromModelEvaluationName(modelEvaluationName: string) { + return this.pathTemplates.modelEvaluationPathTemplate.match( + modelEvaluationName + ).model; + } + + /** + * Parse the model_evaluation from ModelEvaluation resource. + * + * @param {string} modelEvaluationName + * A fully-qualified path representing ModelEvaluation resource. + * @returns {string} A string representing the model_evaluation. + */ + matchModelEvaluationFromModelEvaluationName(modelEvaluationName: string) { + return this.pathTemplates.modelEvaluationPathTemplate.match( + modelEvaluationName + ).model_evaluation; + } + + /** + * Return a fully-qualified tableSpec resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} dataset + * @param {string} table_spec + * @returns {string} Resource name string. + */ + tableSpecPath( + project: string, + location: string, + dataset: string, + tableSpec: string + ) { + return this.pathTemplates.tableSpecPathTemplate.render({ + project: project, + location: location, + dataset: dataset, + table_spec: tableSpec, + }); + } + + /** + * Parse the project from TableSpec resource. + * + * @param {string} tableSpecName + * A fully-qualified path representing TableSpec resource. + * @returns {string} A string representing the project. + */ + matchProjectFromTableSpecName(tableSpecName: string) { + return this.pathTemplates.tableSpecPathTemplate.match(tableSpecName) + .project; + } + + /** + * Parse the location from TableSpec resource. + * + * @param {string} tableSpecName + * A fully-qualified path representing TableSpec resource. + * @returns {string} A string representing the location. + */ + matchLocationFromTableSpecName(tableSpecName: string) { + return this.pathTemplates.tableSpecPathTemplate.match(tableSpecName) + .location; + } + + /** + * Parse the dataset from TableSpec resource. + * + * @param {string} tableSpecName + * A fully-qualified path representing TableSpec resource. + * @returns {string} A string representing the dataset. + */ + matchDatasetFromTableSpecName(tableSpecName: string) { + return this.pathTemplates.tableSpecPathTemplate.match(tableSpecName) + .dataset; + } + + /** + * Parse the table_spec from TableSpec resource. + * + * @param {string} tableSpecName + * A fully-qualified path representing TableSpec resource. + * @returns {string} A string representing the table_spec. + */ + matchTableSpecFromTableSpecName(tableSpecName: string) { + return this.pathTemplates.tableSpecPathTemplate.match(tableSpecName) + .table_spec; + } + + /** + * 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.predictionServiceStub && !this._terminated) { + return this.predictionServiceStub.then(stub => { + this._terminated = true; + stub.close(); + this.operationsClient.close(); + }); + } + return Promise.resolve(); + } +} diff --git a/packages/google-cloud-automl/src/v1beta1/prediction_service_client_config.json b/packages/google-cloud-automl/src/v1beta1/prediction_service_client_config.json new file mode 100644 index 00000000000..cc9f502b67c --- /dev/null +++ b/packages/google-cloud-automl/src/v1beta1/prediction_service_client_config.json @@ -0,0 +1,36 @@ +{ + "interfaces": { + "google.cloud.automl.v1beta1.PredictionService": { + "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": { + "Predict": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "BatchPredict": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + } + } + } + } +} diff --git a/packages/google-cloud-automl/src/v1beta1/prediction_service_proto_list.json b/packages/google-cloud-automl/src/v1beta1/prediction_service_proto_list.json new file mode 100644 index 00000000000..3a493dbb13a --- /dev/null +++ b/packages/google-cloud-automl/src/v1beta1/prediction_service_proto_list.json @@ -0,0 +1,30 @@ +[ + "../../protos/google/cloud/automl/v1beta1/annotation_payload.proto", + "../../protos/google/cloud/automl/v1beta1/annotation_spec.proto", + "../../protos/google/cloud/automl/v1beta1/classification.proto", + "../../protos/google/cloud/automl/v1beta1/column_spec.proto", + "../../protos/google/cloud/automl/v1beta1/data_items.proto", + "../../protos/google/cloud/automl/v1beta1/data_stats.proto", + "../../protos/google/cloud/automl/v1beta1/data_types.proto", + "../../protos/google/cloud/automl/v1beta1/dataset.proto", + "../../protos/google/cloud/automl/v1beta1/detection.proto", + "../../protos/google/cloud/automl/v1beta1/geometry.proto", + "../../protos/google/cloud/automl/v1beta1/image.proto", + "../../protos/google/cloud/automl/v1beta1/io.proto", + "../../protos/google/cloud/automl/v1beta1/model.proto", + "../../protos/google/cloud/automl/v1beta1/model_evaluation.proto", + "../../protos/google/cloud/automl/v1beta1/operations.proto", + "../../protos/google/cloud/automl/v1beta1/prediction_service.proto", + "../../protos/google/cloud/automl/v1beta1/ranges.proto", + "../../protos/google/cloud/automl/v1beta1/regression.proto", + "../../protos/google/cloud/automl/v1beta1/service.proto", + "../../protos/google/cloud/automl/v1beta1/table_spec.proto", + "../../protos/google/cloud/automl/v1beta1/tables.proto", + "../../protos/google/cloud/automl/v1beta1/temporal.proto", + "../../protos/google/cloud/automl/v1beta1/text.proto", + "../../protos/google/cloud/automl/v1beta1/text_extraction.proto", + "../../protos/google/cloud/automl/v1beta1/text_segment.proto", + "../../protos/google/cloud/automl/v1beta1/text_sentiment.proto", + "../../protos/google/cloud/automl/v1beta1/translation.proto", + "../../protos/google/cloud/automl/v1beta1/video.proto" +] diff --git a/packages/google-cloud-automl/system-test/automl.ts b/packages/google-cloud-automl/system-test/automl.ts new file mode 100644 index 00000000000..3667a8c1d53 --- /dev/null +++ b/packages/google-cloud-automl/system-test/automl.ts @@ -0,0 +1,35 @@ +// Copyright 2018 Google LLC +// +// Licensed under the Apache License, Version 2.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. + +'use strict'; + +import * as automl from '../src'; +import * as assert from 'assert'; +import {describe, it, before} from 'mocha'; + +const client = new automl.AutoMlClient(); +const location = 'us-central1'; + +describe('automl system tests', () => { + let projectId: string; + before(async () => { + projectId = await client.getProjectId(); + }); + + it('should list all datasets', async () => { + const parent = client.locationPath(projectId, location); + const [datasets] = await client.listDatasets({parent}); + assert.ok(Array.isArray(datasets)); + }); +}); diff --git a/packages/google-cloud-automl/system-test/fixtures/sample/src/index.js b/packages/google-cloud-automl/system-test/fixtures/sample/src/index.js new file mode 100644 index 00000000000..54d1151df35 --- /dev/null +++ b/packages/google-cloud-automl/system-test/fixtures/sample/src/index.js @@ -0,0 +1,27 @@ +// Copyright 2023 Google LLC +// +// Licensed under the Apache License, Version 2.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 automl = require('@google-cloud/automl'); + +function main() { + const autoMlClient = new automl.AutoMlClient(); + const predictionServiceClient = new automl.PredictionServiceClient(); +} + +main(); diff --git a/packages/google-cloud-automl/system-test/fixtures/sample/src/index.ts b/packages/google-cloud-automl/system-test/fixtures/sample/src/index.ts new file mode 100644 index 00000000000..e32ff22a428 --- /dev/null +++ b/packages/google-cloud-automl/system-test/fixtures/sample/src/index.ts @@ -0,0 +1,38 @@ +// Copyright 2023 Google LLC +// +// Licensed under the Apache License, Version 2.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 {AutoMlClient, PredictionServiceClient} from '@google-cloud/automl'; + +// check that the client class type name can be used +function doStuffWithAutoMlClient(client: AutoMlClient) { + client.close(); +} +function doStuffWithPredictionServiceClient(client: PredictionServiceClient) { + client.close(); +} + +function main() { + // check that the client instance can be created + const autoMlClient = new AutoMlClient(); + doStuffWithAutoMlClient(autoMlClient); + // check that the client instance can be created + const predictionServiceClient = new PredictionServiceClient(); + doStuffWithPredictionServiceClient(predictionServiceClient); +} + +main(); diff --git a/packages/google-cloud-automl/system-test/install.ts b/packages/google-cloud-automl/system-test/install.ts new file mode 100644 index 00000000000..f61fe236476 --- /dev/null +++ b/packages/google-cloud-automl/system-test/install.ts @@ -0,0 +1,51 @@ +// Copyright 2023 Google LLC +// +// Licensed under the Apache License, Version 2.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/google-cloud-automl/test/gapic_auto_ml_v1.ts b/packages/google-cloud-automl/test/gapic_auto_ml_v1.ts new file mode 100644 index 00000000000..04cf88aafc2 --- /dev/null +++ b/packages/google-cloud-automl/test/gapic_auto_ml_v1.ts @@ -0,0 +1,4022 @@ +// Copyright 2023 Google LLC +// +// Licensed under the Apache License, Version 2.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 automlModule 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 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('v1.AutoMlClient', () => { + describe('Common methods', () => { + it('has servicePath', () => { + const servicePath = automlModule.v1.AutoMlClient.servicePath; + assert(servicePath); + }); + + it('has apiEndpoint', () => { + const apiEndpoint = automlModule.v1.AutoMlClient.apiEndpoint; + assert(apiEndpoint); + }); + + it('has port', () => { + const port = automlModule.v1.AutoMlClient.port; + assert(port); + assert(typeof port === 'number'); + }); + + it('should create a client with no option', () => { + const client = new automlModule.v1.AutoMlClient(); + assert(client); + }); + + it('should create a client with gRPC fallback', () => { + const client = new automlModule.v1.AutoMlClient({ + fallback: true, + }); + assert(client); + }); + + it('has initialize method and supports deferred initialization', async () => { + const client = new automlModule.v1.AutoMlClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + assert.strictEqual(client.autoMlStub, undefined); + await client.initialize(); + assert(client.autoMlStub); + }); + + it('has close method for the initialized client', done => { + const client = new automlModule.v1.AutoMlClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + assert(client.autoMlStub); + client.close().then(() => { + done(); + }); + }); + + it('has close method for the non-initialized client', done => { + const client = new automlModule.v1.AutoMlClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + assert.strictEqual(client.autoMlStub, undefined); + client.close().then(() => { + done(); + }); + }); + + it('has getProjectId method', async () => { + const fakeProjectId = 'fake-project-id'; + const client = new automlModule.v1.AutoMlClient({ + 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 automlModule.v1.AutoMlClient({ + 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('getDataset', () => { + it('invokes getDataset without error', async () => { + const client = new automlModule.v1.AutoMlClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.automl.v1.GetDatasetRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.automl.v1.GetDatasetRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.automl.v1.Dataset() + ); + client.innerApiCalls.getDataset = stubSimpleCall(expectedResponse); + const [response] = await client.getDataset(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.getDataset as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getDataset as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getDataset without error using callback', async () => { + const client = new automlModule.v1.AutoMlClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.automl.v1.GetDatasetRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.automl.v1.GetDatasetRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.automl.v1.Dataset() + ); + client.innerApiCalls.getDataset = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getDataset( + request, + ( + err?: Error | null, + result?: protos.google.cloud.automl.v1.IDataset | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.getDataset as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getDataset as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getDataset with error', async () => { + const client = new automlModule.v1.AutoMlClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.automl.v1.GetDatasetRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.automl.v1.GetDatasetRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.getDataset = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.getDataset(request), expectedError); + const actualRequest = ( + client.innerApiCalls.getDataset as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getDataset as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getDataset with closed client', async () => { + const client = new automlModule.v1.AutoMlClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.automl.v1.GetDatasetRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.automl.v1.GetDatasetRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.getDataset(request), expectedError); + }); + }); + + describe('updateDataset', () => { + it('invokes updateDataset without error', async () => { + const client = new automlModule.v1.AutoMlClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.automl.v1.UpdateDatasetRequest() + ); + request.dataset ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.automl.v1.UpdateDatasetRequest', + ['dataset', 'name'] + ); + request.dataset.name = defaultValue1; + const expectedHeaderRequestParams = `dataset.name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.automl.v1.Dataset() + ); + client.innerApiCalls.updateDataset = stubSimpleCall(expectedResponse); + const [response] = await client.updateDataset(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.updateDataset as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateDataset as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateDataset without error using callback', async () => { + const client = new automlModule.v1.AutoMlClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.automl.v1.UpdateDatasetRequest() + ); + request.dataset ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.automl.v1.UpdateDatasetRequest', + ['dataset', 'name'] + ); + request.dataset.name = defaultValue1; + const expectedHeaderRequestParams = `dataset.name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.automl.v1.Dataset() + ); + client.innerApiCalls.updateDataset = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.updateDataset( + request, + ( + err?: Error | null, + result?: protos.google.cloud.automl.v1.IDataset | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.updateDataset as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateDataset as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateDataset with error', async () => { + const client = new automlModule.v1.AutoMlClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.automl.v1.UpdateDatasetRequest() + ); + request.dataset ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.automl.v1.UpdateDatasetRequest', + ['dataset', 'name'] + ); + request.dataset.name = defaultValue1; + const expectedHeaderRequestParams = `dataset.name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.updateDataset = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.updateDataset(request), expectedError); + const actualRequest = ( + client.innerApiCalls.updateDataset as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateDataset as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateDataset with closed client', async () => { + const client = new automlModule.v1.AutoMlClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.automl.v1.UpdateDatasetRequest() + ); + request.dataset ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.automl.v1.UpdateDatasetRequest', + ['dataset', 'name'] + ); + request.dataset.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.updateDataset(request), expectedError); + }); + }); + + describe('getAnnotationSpec', () => { + it('invokes getAnnotationSpec without error', async () => { + const client = new automlModule.v1.AutoMlClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.automl.v1.GetAnnotationSpecRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.automl.v1.GetAnnotationSpecRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.automl.v1.AnnotationSpec() + ); + client.innerApiCalls.getAnnotationSpec = stubSimpleCall(expectedResponse); + const [response] = await client.getAnnotationSpec(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.getAnnotationSpec as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getAnnotationSpec as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getAnnotationSpec without error using callback', async () => { + const client = new automlModule.v1.AutoMlClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.automl.v1.GetAnnotationSpecRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.automl.v1.GetAnnotationSpecRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.automl.v1.AnnotationSpec() + ); + client.innerApiCalls.getAnnotationSpec = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getAnnotationSpec( + request, + ( + err?: Error | null, + result?: protos.google.cloud.automl.v1.IAnnotationSpec | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.getAnnotationSpec as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getAnnotationSpec as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getAnnotationSpec with error', async () => { + const client = new automlModule.v1.AutoMlClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.automl.v1.GetAnnotationSpecRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.automl.v1.GetAnnotationSpecRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.getAnnotationSpec = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.getAnnotationSpec(request), expectedError); + const actualRequest = ( + client.innerApiCalls.getAnnotationSpec as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getAnnotationSpec as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getAnnotationSpec with closed client', async () => { + const client = new automlModule.v1.AutoMlClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.automl.v1.GetAnnotationSpecRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.automl.v1.GetAnnotationSpecRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.getAnnotationSpec(request), expectedError); + }); + }); + + describe('getModel', () => { + it('invokes getModel without error', async () => { + const client = new automlModule.v1.AutoMlClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.automl.v1.GetModelRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.automl.v1.GetModelRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.automl.v1.Model() + ); + client.innerApiCalls.getModel = stubSimpleCall(expectedResponse); + const [response] = await client.getModel(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.getModel as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getModel as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getModel without error using callback', async () => { + const client = new automlModule.v1.AutoMlClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.automl.v1.GetModelRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.automl.v1.GetModelRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.automl.v1.Model() + ); + client.innerApiCalls.getModel = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getModel( + request, + ( + err?: Error | null, + result?: protos.google.cloud.automl.v1.IModel | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.getModel as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getModel as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getModel with error', async () => { + const client = new automlModule.v1.AutoMlClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.automl.v1.GetModelRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.automl.v1.GetModelRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.getModel = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.getModel(request), expectedError); + const actualRequest = ( + client.innerApiCalls.getModel as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getModel as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getModel with closed client', async () => { + const client = new automlModule.v1.AutoMlClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.automl.v1.GetModelRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.automl.v1.GetModelRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.getModel(request), expectedError); + }); + }); + + describe('updateModel', () => { + it('invokes updateModel without error', async () => { + const client = new automlModule.v1.AutoMlClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.automl.v1.UpdateModelRequest() + ); + request.model ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.automl.v1.UpdateModelRequest', + ['model', 'name'] + ); + request.model.name = defaultValue1; + const expectedHeaderRequestParams = `model.name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.automl.v1.Model() + ); + client.innerApiCalls.updateModel = stubSimpleCall(expectedResponse); + const [response] = await client.updateModel(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.updateModel as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateModel as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateModel without error using callback', async () => { + const client = new automlModule.v1.AutoMlClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.automl.v1.UpdateModelRequest() + ); + request.model ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.automl.v1.UpdateModelRequest', + ['model', 'name'] + ); + request.model.name = defaultValue1; + const expectedHeaderRequestParams = `model.name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.automl.v1.Model() + ); + client.innerApiCalls.updateModel = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.updateModel( + request, + ( + err?: Error | null, + result?: protos.google.cloud.automl.v1.IModel | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.updateModel as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateModel as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateModel with error', async () => { + const client = new automlModule.v1.AutoMlClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.automl.v1.UpdateModelRequest() + ); + request.model ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.automl.v1.UpdateModelRequest', + ['model', 'name'] + ); + request.model.name = defaultValue1; + const expectedHeaderRequestParams = `model.name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.updateModel = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.updateModel(request), expectedError); + const actualRequest = ( + client.innerApiCalls.updateModel as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateModel as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateModel with closed client', async () => { + const client = new automlModule.v1.AutoMlClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.automl.v1.UpdateModelRequest() + ); + request.model ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.automl.v1.UpdateModelRequest', + ['model', 'name'] + ); + request.model.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.updateModel(request), expectedError); + }); + }); + + describe('getModelEvaluation', () => { + it('invokes getModelEvaluation without error', async () => { + const client = new automlModule.v1.AutoMlClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.automl.v1.GetModelEvaluationRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.automl.v1.GetModelEvaluationRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.automl.v1.ModelEvaluation() + ); + client.innerApiCalls.getModelEvaluation = + stubSimpleCall(expectedResponse); + const [response] = await client.getModelEvaluation(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.getModelEvaluation as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getModelEvaluation as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getModelEvaluation without error using callback', async () => { + const client = new automlModule.v1.AutoMlClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.automl.v1.GetModelEvaluationRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.automl.v1.GetModelEvaluationRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.automl.v1.ModelEvaluation() + ); + client.innerApiCalls.getModelEvaluation = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getModelEvaluation( + request, + ( + err?: Error | null, + result?: protos.google.cloud.automl.v1.IModelEvaluation | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.getModelEvaluation as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getModelEvaluation as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getModelEvaluation with error', async () => { + const client = new automlModule.v1.AutoMlClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.automl.v1.GetModelEvaluationRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.automl.v1.GetModelEvaluationRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.getModelEvaluation = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.getModelEvaluation(request), expectedError); + const actualRequest = ( + client.innerApiCalls.getModelEvaluation as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getModelEvaluation as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getModelEvaluation with closed client', async () => { + const client = new automlModule.v1.AutoMlClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.automl.v1.GetModelEvaluationRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.automl.v1.GetModelEvaluationRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.getModelEvaluation(request), expectedError); + }); + }); + + describe('createDataset', () => { + it('invokes createDataset without error', async () => { + const client = new automlModule.v1.AutoMlClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.automl.v1.CreateDatasetRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.automl.v1.CreateDatasetRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.createDataset = + stubLongRunningCall(expectedResponse); + const [operation] = await client.createDataset(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.createDataset as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createDataset as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createDataset without error using callback', async () => { + const client = new automlModule.v1.AutoMlClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.automl.v1.CreateDatasetRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.automl.v1.CreateDatasetRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.createDataset = + stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.createDataset( + request, + ( + err?: Error | null, + result?: LROperation< + protos.google.cloud.automl.v1.IDataset, + protos.google.cloud.automl.v1.IOperationMetadata + > | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const operation = (await promise) as LROperation< + protos.google.cloud.automl.v1.IDataset, + protos.google.cloud.automl.v1.IOperationMetadata + >; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.createDataset as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createDataset as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createDataset with call error', async () => { + const client = new automlModule.v1.AutoMlClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.automl.v1.CreateDatasetRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.automl.v1.CreateDatasetRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.createDataset = stubLongRunningCall( + undefined, + expectedError + ); + await assert.rejects(client.createDataset(request), expectedError); + const actualRequest = ( + client.innerApiCalls.createDataset as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createDataset as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createDataset with LRO error', async () => { + const client = new automlModule.v1.AutoMlClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.automl.v1.CreateDatasetRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.automl.v1.CreateDatasetRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.createDataset = stubLongRunningCall( + undefined, + undefined, + expectedError + ); + const [operation] = await client.createDataset(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = ( + client.innerApiCalls.createDataset as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createDataset as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkCreateDatasetProgress without error', async () => { + const client = new automlModule.v1.AutoMlClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + 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.checkCreateDatasetProgress( + expectedResponse.name + ); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkCreateDatasetProgress with error', async () => { + const client = new automlModule.v1.AutoMlClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const expectedError = new Error('expected'); + + client.operationsClient.getOperation = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects( + client.checkCreateDatasetProgress(''), + expectedError + ); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + }); + + describe('deleteDataset', () => { + it('invokes deleteDataset without error', async () => { + const client = new automlModule.v1.AutoMlClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.automl.v1.DeleteDatasetRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.automl.v1.DeleteDatasetRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.deleteDataset = + stubLongRunningCall(expectedResponse); + const [operation] = await client.deleteDataset(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.deleteDataset as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteDataset as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteDataset without error using callback', async () => { + const client = new automlModule.v1.AutoMlClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.automl.v1.DeleteDatasetRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.automl.v1.DeleteDatasetRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.deleteDataset = + stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.deleteDataset( + request, + ( + err?: Error | null, + result?: LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.automl.v1.IOperationMetadata + > | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const operation = (await promise) as LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.automl.v1.IOperationMetadata + >; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.deleteDataset as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteDataset as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteDataset with call error', async () => { + const client = new automlModule.v1.AutoMlClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.automl.v1.DeleteDatasetRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.automl.v1.DeleteDatasetRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteDataset = stubLongRunningCall( + undefined, + expectedError + ); + await assert.rejects(client.deleteDataset(request), expectedError); + const actualRequest = ( + client.innerApiCalls.deleteDataset as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteDataset as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteDataset with LRO error', async () => { + const client = new automlModule.v1.AutoMlClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.automl.v1.DeleteDatasetRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.automl.v1.DeleteDatasetRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteDataset = stubLongRunningCall( + undefined, + undefined, + expectedError + ); + const [operation] = await client.deleteDataset(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = ( + client.innerApiCalls.deleteDataset as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteDataset as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkDeleteDatasetProgress without error', async () => { + const client = new automlModule.v1.AutoMlClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + 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.checkDeleteDatasetProgress( + expectedResponse.name + ); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkDeleteDatasetProgress with error', async () => { + const client = new automlModule.v1.AutoMlClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const expectedError = new Error('expected'); + + client.operationsClient.getOperation = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects( + client.checkDeleteDatasetProgress(''), + expectedError + ); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + }); + + describe('importData', () => { + it('invokes importData without error', async () => { + const client = new automlModule.v1.AutoMlClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.automl.v1.ImportDataRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.automl.v1.ImportDataRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.importData = stubLongRunningCall(expectedResponse); + const [operation] = await client.importData(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.importData as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.importData as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes importData without error using callback', async () => { + const client = new automlModule.v1.AutoMlClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.automl.v1.ImportDataRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.automl.v1.ImportDataRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.importData = + stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.importData( + request, + ( + err?: Error | null, + result?: LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.automl.v1.IOperationMetadata + > | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const operation = (await promise) as LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.automl.v1.IOperationMetadata + >; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.importData as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.importData as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes importData with call error', async () => { + const client = new automlModule.v1.AutoMlClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.automl.v1.ImportDataRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.automl.v1.ImportDataRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.importData = stubLongRunningCall( + undefined, + expectedError + ); + await assert.rejects(client.importData(request), expectedError); + const actualRequest = ( + client.innerApiCalls.importData as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.importData as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes importData with LRO error', async () => { + const client = new automlModule.v1.AutoMlClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.automl.v1.ImportDataRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.automl.v1.ImportDataRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.importData = stubLongRunningCall( + undefined, + undefined, + expectedError + ); + const [operation] = await client.importData(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = ( + client.innerApiCalls.importData as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.importData as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkImportDataProgress without error', async () => { + const client = new automlModule.v1.AutoMlClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + 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.checkImportDataProgress( + expectedResponse.name + ); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkImportDataProgress with error', async () => { + const client = new automlModule.v1.AutoMlClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const expectedError = new Error('expected'); + + client.operationsClient.getOperation = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.checkImportDataProgress(''), expectedError); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + }); + + describe('exportData', () => { + it('invokes exportData without error', async () => { + const client = new automlModule.v1.AutoMlClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.automl.v1.ExportDataRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.automl.v1.ExportDataRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.exportData = stubLongRunningCall(expectedResponse); + const [operation] = await client.exportData(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.exportData as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.exportData as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes exportData without error using callback', async () => { + const client = new automlModule.v1.AutoMlClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.automl.v1.ExportDataRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.automl.v1.ExportDataRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.exportData = + stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.exportData( + request, + ( + err?: Error | null, + result?: LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.automl.v1.IOperationMetadata + > | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const operation = (await promise) as LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.automl.v1.IOperationMetadata + >; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.exportData as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.exportData as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes exportData with call error', async () => { + const client = new automlModule.v1.AutoMlClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.automl.v1.ExportDataRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.automl.v1.ExportDataRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.exportData = stubLongRunningCall( + undefined, + expectedError + ); + await assert.rejects(client.exportData(request), expectedError); + const actualRequest = ( + client.innerApiCalls.exportData as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.exportData as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes exportData with LRO error', async () => { + const client = new automlModule.v1.AutoMlClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.automl.v1.ExportDataRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.automl.v1.ExportDataRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.exportData = stubLongRunningCall( + undefined, + undefined, + expectedError + ); + const [operation] = await client.exportData(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = ( + client.innerApiCalls.exportData as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.exportData as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkExportDataProgress without error', async () => { + const client = new automlModule.v1.AutoMlClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + 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.checkExportDataProgress( + expectedResponse.name + ); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkExportDataProgress with error', async () => { + const client = new automlModule.v1.AutoMlClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const expectedError = new Error('expected'); + + client.operationsClient.getOperation = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.checkExportDataProgress(''), expectedError); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + }); + + describe('createModel', () => { + it('invokes createModel without error', async () => { + const client = new automlModule.v1.AutoMlClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.automl.v1.CreateModelRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.automl.v1.CreateModelRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.createModel = stubLongRunningCall(expectedResponse); + const [operation] = await client.createModel(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.createModel as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createModel as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createModel without error using callback', async () => { + const client = new automlModule.v1.AutoMlClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.automl.v1.CreateModelRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.automl.v1.CreateModelRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.createModel = + stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.createModel( + request, + ( + err?: Error | null, + result?: LROperation< + protos.google.cloud.automl.v1.IModel, + protos.google.cloud.automl.v1.IOperationMetadata + > | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const operation = (await promise) as LROperation< + protos.google.cloud.automl.v1.IModel, + protos.google.cloud.automl.v1.IOperationMetadata + >; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.createModel as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createModel as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createModel with call error', async () => { + const client = new automlModule.v1.AutoMlClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.automl.v1.CreateModelRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.automl.v1.CreateModelRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.createModel = stubLongRunningCall( + undefined, + expectedError + ); + await assert.rejects(client.createModel(request), expectedError); + const actualRequest = ( + client.innerApiCalls.createModel as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createModel as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createModel with LRO error', async () => { + const client = new automlModule.v1.AutoMlClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.automl.v1.CreateModelRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.automl.v1.CreateModelRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.createModel = stubLongRunningCall( + undefined, + undefined, + expectedError + ); + const [operation] = await client.createModel(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = ( + client.innerApiCalls.createModel as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createModel as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkCreateModelProgress without error', async () => { + const client = new automlModule.v1.AutoMlClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + 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.checkCreateModelProgress( + expectedResponse.name + ); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkCreateModelProgress with error', async () => { + const client = new automlModule.v1.AutoMlClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const expectedError = new Error('expected'); + + client.operationsClient.getOperation = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.checkCreateModelProgress(''), expectedError); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + }); + + describe('deleteModel', () => { + it('invokes deleteModel without error', async () => { + const client = new automlModule.v1.AutoMlClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.automl.v1.DeleteModelRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.automl.v1.DeleteModelRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.deleteModel = stubLongRunningCall(expectedResponse); + const [operation] = await client.deleteModel(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.deleteModel as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteModel as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteModel without error using callback', async () => { + const client = new automlModule.v1.AutoMlClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.automl.v1.DeleteModelRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.automl.v1.DeleteModelRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.deleteModel = + stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.deleteModel( + request, + ( + err?: Error | null, + result?: LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.automl.v1.IOperationMetadata + > | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const operation = (await promise) as LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.automl.v1.IOperationMetadata + >; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.deleteModel as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteModel as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteModel with call error', async () => { + const client = new automlModule.v1.AutoMlClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.automl.v1.DeleteModelRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.automl.v1.DeleteModelRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteModel = stubLongRunningCall( + undefined, + expectedError + ); + await assert.rejects(client.deleteModel(request), expectedError); + const actualRequest = ( + client.innerApiCalls.deleteModel as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteModel as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteModel with LRO error', async () => { + const client = new automlModule.v1.AutoMlClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.automl.v1.DeleteModelRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.automl.v1.DeleteModelRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteModel = stubLongRunningCall( + undefined, + undefined, + expectedError + ); + const [operation] = await client.deleteModel(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = ( + client.innerApiCalls.deleteModel as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteModel as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkDeleteModelProgress without error', async () => { + const client = new automlModule.v1.AutoMlClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + 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.checkDeleteModelProgress( + expectedResponse.name + ); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkDeleteModelProgress with error', async () => { + const client = new automlModule.v1.AutoMlClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const expectedError = new Error('expected'); + + client.operationsClient.getOperation = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.checkDeleteModelProgress(''), expectedError); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + }); + + describe('deployModel', () => { + it('invokes deployModel without error', async () => { + const client = new automlModule.v1.AutoMlClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.automl.v1.DeployModelRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.automl.v1.DeployModelRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.deployModel = stubLongRunningCall(expectedResponse); + const [operation] = await client.deployModel(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.deployModel as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deployModel as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deployModel without error using callback', async () => { + const client = new automlModule.v1.AutoMlClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.automl.v1.DeployModelRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.automl.v1.DeployModelRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.deployModel = + stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.deployModel( + request, + ( + err?: Error | null, + result?: LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.automl.v1.IOperationMetadata + > | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const operation = (await promise) as LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.automl.v1.IOperationMetadata + >; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.deployModel as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deployModel as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deployModel with call error', async () => { + const client = new automlModule.v1.AutoMlClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.automl.v1.DeployModelRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.automl.v1.DeployModelRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.deployModel = stubLongRunningCall( + undefined, + expectedError + ); + await assert.rejects(client.deployModel(request), expectedError); + const actualRequest = ( + client.innerApiCalls.deployModel as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deployModel as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deployModel with LRO error', async () => { + const client = new automlModule.v1.AutoMlClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.automl.v1.DeployModelRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.automl.v1.DeployModelRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.deployModel = stubLongRunningCall( + undefined, + undefined, + expectedError + ); + const [operation] = await client.deployModel(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = ( + client.innerApiCalls.deployModel as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deployModel as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkDeployModelProgress without error', async () => { + const client = new automlModule.v1.AutoMlClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + 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.checkDeployModelProgress( + expectedResponse.name + ); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkDeployModelProgress with error', async () => { + const client = new automlModule.v1.AutoMlClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const expectedError = new Error('expected'); + + client.operationsClient.getOperation = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.checkDeployModelProgress(''), expectedError); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + }); + + describe('undeployModel', () => { + it('invokes undeployModel without error', async () => { + const client = new automlModule.v1.AutoMlClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.automl.v1.UndeployModelRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.automl.v1.UndeployModelRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.undeployModel = + stubLongRunningCall(expectedResponse); + const [operation] = await client.undeployModel(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.undeployModel as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.undeployModel as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes undeployModel without error using callback', async () => { + const client = new automlModule.v1.AutoMlClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.automl.v1.UndeployModelRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.automl.v1.UndeployModelRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.undeployModel = + stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.undeployModel( + request, + ( + err?: Error | null, + result?: LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.automl.v1.IOperationMetadata + > | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const operation = (await promise) as LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.automl.v1.IOperationMetadata + >; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.undeployModel as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.undeployModel as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes undeployModel with call error', async () => { + const client = new automlModule.v1.AutoMlClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.automl.v1.UndeployModelRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.automl.v1.UndeployModelRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.undeployModel = stubLongRunningCall( + undefined, + expectedError + ); + await assert.rejects(client.undeployModel(request), expectedError); + const actualRequest = ( + client.innerApiCalls.undeployModel as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.undeployModel as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes undeployModel with LRO error', async () => { + const client = new automlModule.v1.AutoMlClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.automl.v1.UndeployModelRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.automl.v1.UndeployModelRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.undeployModel = stubLongRunningCall( + undefined, + undefined, + expectedError + ); + const [operation] = await client.undeployModel(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = ( + client.innerApiCalls.undeployModel as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.undeployModel as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkUndeployModelProgress without error', async () => { + const client = new automlModule.v1.AutoMlClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + 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.checkUndeployModelProgress( + expectedResponse.name + ); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkUndeployModelProgress with error', async () => { + const client = new automlModule.v1.AutoMlClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const expectedError = new Error('expected'); + + client.operationsClient.getOperation = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects( + client.checkUndeployModelProgress(''), + expectedError + ); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + }); + + describe('exportModel', () => { + it('invokes exportModel without error', async () => { + const client = new automlModule.v1.AutoMlClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.automl.v1.ExportModelRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.automl.v1.ExportModelRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.exportModel = stubLongRunningCall(expectedResponse); + const [operation] = await client.exportModel(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.exportModel as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.exportModel as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes exportModel without error using callback', async () => { + const client = new automlModule.v1.AutoMlClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.automl.v1.ExportModelRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.automl.v1.ExportModelRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.exportModel = + stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.exportModel( + request, + ( + err?: Error | null, + result?: LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.automl.v1.IOperationMetadata + > | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const operation = (await promise) as LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.automl.v1.IOperationMetadata + >; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.exportModel as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.exportModel as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes exportModel with call error', async () => { + const client = new automlModule.v1.AutoMlClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.automl.v1.ExportModelRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.automl.v1.ExportModelRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.exportModel = stubLongRunningCall( + undefined, + expectedError + ); + await assert.rejects(client.exportModel(request), expectedError); + const actualRequest = ( + client.innerApiCalls.exportModel as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.exportModel as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes exportModel with LRO error', async () => { + const client = new automlModule.v1.AutoMlClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.automl.v1.ExportModelRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.automl.v1.ExportModelRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.exportModel = stubLongRunningCall( + undefined, + undefined, + expectedError + ); + const [operation] = await client.exportModel(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = ( + client.innerApiCalls.exportModel as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.exportModel as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkExportModelProgress without error', async () => { + const client = new automlModule.v1.AutoMlClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + 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.checkExportModelProgress( + expectedResponse.name + ); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkExportModelProgress with error', async () => { + const client = new automlModule.v1.AutoMlClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const expectedError = new Error('expected'); + + client.operationsClient.getOperation = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.checkExportModelProgress(''), expectedError); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + }); + + describe('listDatasets', () => { + it('invokes listDatasets without error', async () => { + const client = new automlModule.v1.AutoMlClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.automl.v1.ListDatasetsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.automl.v1.ListDatasetsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.automl.v1.Dataset()), + generateSampleMessage(new protos.google.cloud.automl.v1.Dataset()), + generateSampleMessage(new protos.google.cloud.automl.v1.Dataset()), + ]; + client.innerApiCalls.listDatasets = stubSimpleCall(expectedResponse); + const [response] = await client.listDatasets(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.listDatasets as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listDatasets as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listDatasets without error using callback', async () => { + const client = new automlModule.v1.AutoMlClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.automl.v1.ListDatasetsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.automl.v1.ListDatasetsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.automl.v1.Dataset()), + generateSampleMessage(new protos.google.cloud.automl.v1.Dataset()), + generateSampleMessage(new protos.google.cloud.automl.v1.Dataset()), + ]; + client.innerApiCalls.listDatasets = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.listDatasets( + request, + ( + err?: Error | null, + result?: protos.google.cloud.automl.v1.IDataset[] | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.listDatasets as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listDatasets as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listDatasets with error', async () => { + const client = new automlModule.v1.AutoMlClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.automl.v1.ListDatasetsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.automl.v1.ListDatasetsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.listDatasets = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.listDatasets(request), expectedError); + const actualRequest = ( + client.innerApiCalls.listDatasets as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listDatasets as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listDatasetsStream without error', async () => { + const client = new automlModule.v1.AutoMlClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.automl.v1.ListDatasetsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.automl.v1.ListDatasetsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.automl.v1.Dataset()), + generateSampleMessage(new protos.google.cloud.automl.v1.Dataset()), + generateSampleMessage(new protos.google.cloud.automl.v1.Dataset()), + ]; + client.descriptors.page.listDatasets.createStream = + stubPageStreamingCall(expectedResponse); + const stream = client.listDatasetsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.automl.v1.Dataset[] = []; + stream.on('data', (response: protos.google.cloud.automl.v1.Dataset) => { + 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.listDatasets.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.listDatasets, request) + ); + assert( + (client.descriptors.page.listDatasets.createStream as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('invokes listDatasetsStream with error', async () => { + const client = new automlModule.v1.AutoMlClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.automl.v1.ListDatasetsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.automl.v1.ListDatasetsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.descriptors.page.listDatasets.createStream = stubPageStreamingCall( + undefined, + expectedError + ); + const stream = client.listDatasetsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.automl.v1.Dataset[] = []; + stream.on('data', (response: protos.google.cloud.automl.v1.Dataset) => { + responses.push(response); + }); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert( + (client.descriptors.page.listDatasets.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.listDatasets, request) + ); + assert( + (client.descriptors.page.listDatasets.createStream as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listDatasets without error', async () => { + const client = new automlModule.v1.AutoMlClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.automl.v1.ListDatasetsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.automl.v1.ListDatasetsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.automl.v1.Dataset()), + generateSampleMessage(new protos.google.cloud.automl.v1.Dataset()), + generateSampleMessage(new protos.google.cloud.automl.v1.Dataset()), + ]; + client.descriptors.page.listDatasets.asyncIterate = + stubAsyncIterationCall(expectedResponse); + const responses: protos.google.cloud.automl.v1.IDataset[] = []; + const iterable = client.listDatasetsAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + ( + client.descriptors.page.listDatasets.asyncIterate as SinonStub + ).getCall(0).args[1], + request + ); + assert( + (client.descriptors.page.listDatasets.asyncIterate as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listDatasets with error', async () => { + const client = new automlModule.v1.AutoMlClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.automl.v1.ListDatasetsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.automl.v1.ListDatasetsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.descriptors.page.listDatasets.asyncIterate = + stubAsyncIterationCall(undefined, expectedError); + const iterable = client.listDatasetsAsync(request); + await assert.rejects(async () => { + const responses: protos.google.cloud.automl.v1.IDataset[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + ( + client.descriptors.page.listDatasets.asyncIterate as SinonStub + ).getCall(0).args[1], + request + ); + assert( + (client.descriptors.page.listDatasets.asyncIterate as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + }); + + describe('listModels', () => { + it('invokes listModels without error', async () => { + const client = new automlModule.v1.AutoMlClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.automl.v1.ListModelsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.automl.v1.ListModelsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.automl.v1.Model()), + generateSampleMessage(new protos.google.cloud.automl.v1.Model()), + generateSampleMessage(new protos.google.cloud.automl.v1.Model()), + ]; + client.innerApiCalls.listModels = stubSimpleCall(expectedResponse); + const [response] = await client.listModels(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.listModels as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listModels as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listModels without error using callback', async () => { + const client = new automlModule.v1.AutoMlClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.automl.v1.ListModelsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.automl.v1.ListModelsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.automl.v1.Model()), + generateSampleMessage(new protos.google.cloud.automl.v1.Model()), + generateSampleMessage(new protos.google.cloud.automl.v1.Model()), + ]; + client.innerApiCalls.listModels = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.listModels( + request, + ( + err?: Error | null, + result?: protos.google.cloud.automl.v1.IModel[] | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.listModels as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listModels as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listModels with error', async () => { + const client = new automlModule.v1.AutoMlClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.automl.v1.ListModelsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.automl.v1.ListModelsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.listModels = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.listModels(request), expectedError); + const actualRequest = ( + client.innerApiCalls.listModels as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listModels as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listModelsStream without error', async () => { + const client = new automlModule.v1.AutoMlClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.automl.v1.ListModelsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.automl.v1.ListModelsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.automl.v1.Model()), + generateSampleMessage(new protos.google.cloud.automl.v1.Model()), + generateSampleMessage(new protos.google.cloud.automl.v1.Model()), + ]; + client.descriptors.page.listModels.createStream = + stubPageStreamingCall(expectedResponse); + const stream = client.listModelsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.automl.v1.Model[] = []; + stream.on('data', (response: protos.google.cloud.automl.v1.Model) => { + 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.listModels.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.listModels, request) + ); + assert( + (client.descriptors.page.listModels.createStream as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('invokes listModelsStream with error', async () => { + const client = new automlModule.v1.AutoMlClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.automl.v1.ListModelsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.automl.v1.ListModelsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.descriptors.page.listModels.createStream = stubPageStreamingCall( + undefined, + expectedError + ); + const stream = client.listModelsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.automl.v1.Model[] = []; + stream.on('data', (response: protos.google.cloud.automl.v1.Model) => { + responses.push(response); + }); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert( + (client.descriptors.page.listModels.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.listModels, request) + ); + assert( + (client.descriptors.page.listModels.createStream as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listModels without error', async () => { + const client = new automlModule.v1.AutoMlClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.automl.v1.ListModelsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.automl.v1.ListModelsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.automl.v1.Model()), + generateSampleMessage(new protos.google.cloud.automl.v1.Model()), + generateSampleMessage(new protos.google.cloud.automl.v1.Model()), + ]; + client.descriptors.page.listModels.asyncIterate = + stubAsyncIterationCall(expectedResponse); + const responses: protos.google.cloud.automl.v1.IModel[] = []; + const iterable = client.listModelsAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + (client.descriptors.page.listModels.asyncIterate as SinonStub).getCall( + 0 + ).args[1], + request + ); + assert( + (client.descriptors.page.listModels.asyncIterate as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listModels with error', async () => { + const client = new automlModule.v1.AutoMlClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.automl.v1.ListModelsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.automl.v1.ListModelsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.descriptors.page.listModels.asyncIterate = stubAsyncIterationCall( + undefined, + expectedError + ); + const iterable = client.listModelsAsync(request); + await assert.rejects(async () => { + const responses: protos.google.cloud.automl.v1.IModel[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + (client.descriptors.page.listModels.asyncIterate as SinonStub).getCall( + 0 + ).args[1], + request + ); + assert( + (client.descriptors.page.listModels.asyncIterate as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + }); + + describe('listModelEvaluations', () => { + it('invokes listModelEvaluations without error', async () => { + const client = new automlModule.v1.AutoMlClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.automl.v1.ListModelEvaluationsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.automl.v1.ListModelEvaluationsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.automl.v1.ModelEvaluation() + ), + generateSampleMessage( + new protos.google.cloud.automl.v1.ModelEvaluation() + ), + generateSampleMessage( + new protos.google.cloud.automl.v1.ModelEvaluation() + ), + ]; + client.innerApiCalls.listModelEvaluations = + stubSimpleCall(expectedResponse); + const [response] = await client.listModelEvaluations(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.listModelEvaluations as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listModelEvaluations as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listModelEvaluations without error using callback', async () => { + const client = new automlModule.v1.AutoMlClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.automl.v1.ListModelEvaluationsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.automl.v1.ListModelEvaluationsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.automl.v1.ModelEvaluation() + ), + generateSampleMessage( + new protos.google.cloud.automl.v1.ModelEvaluation() + ), + generateSampleMessage( + new protos.google.cloud.automl.v1.ModelEvaluation() + ), + ]; + client.innerApiCalls.listModelEvaluations = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.listModelEvaluations( + request, + ( + err?: Error | null, + result?: protos.google.cloud.automl.v1.IModelEvaluation[] | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.listModelEvaluations as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listModelEvaluations as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listModelEvaluations with error', async () => { + const client = new automlModule.v1.AutoMlClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.automl.v1.ListModelEvaluationsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.automl.v1.ListModelEvaluationsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.listModelEvaluations = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.listModelEvaluations(request), expectedError); + const actualRequest = ( + client.innerApiCalls.listModelEvaluations as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listModelEvaluations as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listModelEvaluationsStream without error', async () => { + const client = new automlModule.v1.AutoMlClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.automl.v1.ListModelEvaluationsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.automl.v1.ListModelEvaluationsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.automl.v1.ModelEvaluation() + ), + generateSampleMessage( + new protos.google.cloud.automl.v1.ModelEvaluation() + ), + generateSampleMessage( + new protos.google.cloud.automl.v1.ModelEvaluation() + ), + ]; + client.descriptors.page.listModelEvaluations.createStream = + stubPageStreamingCall(expectedResponse); + const stream = client.listModelEvaluationsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.automl.v1.ModelEvaluation[] = []; + stream.on( + 'data', + (response: protos.google.cloud.automl.v1.ModelEvaluation) => { + 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.listModelEvaluations.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.listModelEvaluations, request) + ); + assert( + (client.descriptors.page.listModelEvaluations.createStream as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('invokes listModelEvaluationsStream with error', async () => { + const client = new automlModule.v1.AutoMlClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.automl.v1.ListModelEvaluationsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.automl.v1.ListModelEvaluationsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.descriptors.page.listModelEvaluations.createStream = + stubPageStreamingCall(undefined, expectedError); + const stream = client.listModelEvaluationsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.automl.v1.ModelEvaluation[] = []; + stream.on( + 'data', + (response: protos.google.cloud.automl.v1.ModelEvaluation) => { + responses.push(response); + } + ); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert( + (client.descriptors.page.listModelEvaluations.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.listModelEvaluations, request) + ); + assert( + (client.descriptors.page.listModelEvaluations.createStream as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listModelEvaluations without error', async () => { + const client = new automlModule.v1.AutoMlClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.automl.v1.ListModelEvaluationsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.automl.v1.ListModelEvaluationsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.automl.v1.ModelEvaluation() + ), + generateSampleMessage( + new protos.google.cloud.automl.v1.ModelEvaluation() + ), + generateSampleMessage( + new protos.google.cloud.automl.v1.ModelEvaluation() + ), + ]; + client.descriptors.page.listModelEvaluations.asyncIterate = + stubAsyncIterationCall(expectedResponse); + const responses: protos.google.cloud.automl.v1.IModelEvaluation[] = []; + const iterable = client.listModelEvaluationsAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + ( + client.descriptors.page.listModelEvaluations.asyncIterate as SinonStub + ).getCall(0).args[1], + request + ); + assert( + (client.descriptors.page.listModelEvaluations.asyncIterate as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listModelEvaluations with error', async () => { + const client = new automlModule.v1.AutoMlClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.automl.v1.ListModelEvaluationsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.automl.v1.ListModelEvaluationsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.descriptors.page.listModelEvaluations.asyncIterate = + stubAsyncIterationCall(undefined, expectedError); + const iterable = client.listModelEvaluationsAsync(request); + await assert.rejects(async () => { + const responses: protos.google.cloud.automl.v1.IModelEvaluation[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + ( + client.descriptors.page.listModelEvaluations.asyncIterate as SinonStub + ).getCall(0).args[1], + request + ); + assert( + (client.descriptors.page.listModelEvaluations.asyncIterate as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + }); + + describe('Path templates', () => { + describe('annotationSpec', () => { + const fakePath = '/rendered/path/annotationSpec'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + dataset: 'datasetValue', + annotation_spec: 'annotationSpecValue', + }; + const client = new automlModule.v1.AutoMlClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.annotationSpecPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.annotationSpecPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('annotationSpecPath', () => { + const result = client.annotationSpecPath( + 'projectValue', + 'locationValue', + 'datasetValue', + 'annotationSpecValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.annotationSpecPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromAnnotationSpecName', () => { + const result = client.matchProjectFromAnnotationSpecName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.annotationSpecPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromAnnotationSpecName', () => { + const result = client.matchLocationFromAnnotationSpecName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.annotationSpecPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchDatasetFromAnnotationSpecName', () => { + const result = client.matchDatasetFromAnnotationSpecName(fakePath); + assert.strictEqual(result, 'datasetValue'); + assert( + (client.pathTemplates.annotationSpecPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchAnnotationSpecFromAnnotationSpecName', () => { + const result = + client.matchAnnotationSpecFromAnnotationSpecName(fakePath); + assert.strictEqual(result, 'annotationSpecValue'); + assert( + (client.pathTemplates.annotationSpecPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('dataset', () => { + const fakePath = '/rendered/path/dataset'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + dataset: 'datasetValue', + }; + const client = new automlModule.v1.AutoMlClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.datasetPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.datasetPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('datasetPath', () => { + const result = client.datasetPath( + 'projectValue', + 'locationValue', + 'datasetValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.datasetPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromDatasetName', () => { + const result = client.matchProjectFromDatasetName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.datasetPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromDatasetName', () => { + const result = client.matchLocationFromDatasetName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.datasetPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchDatasetFromDatasetName', () => { + const result = client.matchDatasetFromDatasetName(fakePath); + assert.strictEqual(result, 'datasetValue'); + assert( + (client.pathTemplates.datasetPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('location', () => { + const fakePath = '/rendered/path/location'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + }; + const client = new automlModule.v1.AutoMlClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + 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('model', () => { + const fakePath = '/rendered/path/model'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + model: 'modelValue', + }; + const client = new automlModule.v1.AutoMlClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.modelPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.modelPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('modelPath', () => { + const result = client.modelPath( + 'projectValue', + 'locationValue', + 'modelValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.modelPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromModelName', () => { + const result = client.matchProjectFromModelName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.modelPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromModelName', () => { + const result = client.matchLocationFromModelName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.modelPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchModelFromModelName', () => { + const result = client.matchModelFromModelName(fakePath); + assert.strictEqual(result, 'modelValue'); + assert( + (client.pathTemplates.modelPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('modelEvaluation', () => { + const fakePath = '/rendered/path/modelEvaluation'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + model: 'modelValue', + model_evaluation: 'modelEvaluationValue', + }; + const client = new automlModule.v1.AutoMlClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.modelEvaluationPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.modelEvaluationPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('modelEvaluationPath', () => { + const result = client.modelEvaluationPath( + 'projectValue', + 'locationValue', + 'modelValue', + 'modelEvaluationValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.modelEvaluationPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromModelEvaluationName', () => { + const result = client.matchProjectFromModelEvaluationName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.modelEvaluationPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromModelEvaluationName', () => { + const result = client.matchLocationFromModelEvaluationName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.modelEvaluationPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchModelFromModelEvaluationName', () => { + const result = client.matchModelFromModelEvaluationName(fakePath); + assert.strictEqual(result, 'modelValue'); + assert( + (client.pathTemplates.modelEvaluationPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchModelEvaluationFromModelEvaluationName', () => { + const result = + client.matchModelEvaluationFromModelEvaluationName(fakePath); + assert.strictEqual(result, 'modelEvaluationValue'); + assert( + (client.pathTemplates.modelEvaluationPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + }); +}); diff --git a/packages/google-cloud-automl/test/gapic_auto_ml_v1beta1.ts b/packages/google-cloud-automl/test/gapic_auto_ml_v1beta1.ts new file mode 100644 index 00000000000..e3b9b02fc78 --- /dev/null +++ b/packages/google-cloud-automl/test/gapic_auto_ml_v1beta1.ts @@ -0,0 +1,5382 @@ +// Copyright 2023 Google LLC +// +// Licensed under the Apache License, Version 2.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 automlModule 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 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('v1beta1.AutoMlClient', () => { + describe('Common methods', () => { + it('has servicePath', () => { + const servicePath = automlModule.v1beta1.AutoMlClient.servicePath; + assert(servicePath); + }); + + it('has apiEndpoint', () => { + const apiEndpoint = automlModule.v1beta1.AutoMlClient.apiEndpoint; + assert(apiEndpoint); + }); + + it('has port', () => { + const port = automlModule.v1beta1.AutoMlClient.port; + assert(port); + assert(typeof port === 'number'); + }); + + it('should create a client with no option', () => { + const client = new automlModule.v1beta1.AutoMlClient(); + assert(client); + }); + + it('should create a client with gRPC fallback', () => { + const client = new automlModule.v1beta1.AutoMlClient({ + fallback: true, + }); + assert(client); + }); + + it('has initialize method and supports deferred initialization', async () => { + const client = new automlModule.v1beta1.AutoMlClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + assert.strictEqual(client.autoMlStub, undefined); + await client.initialize(); + assert(client.autoMlStub); + }); + + it('has close method for the initialized client', done => { + const client = new automlModule.v1beta1.AutoMlClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + assert(client.autoMlStub); + client.close().then(() => { + done(); + }); + }); + + it('has close method for the non-initialized client', done => { + const client = new automlModule.v1beta1.AutoMlClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + assert.strictEqual(client.autoMlStub, undefined); + client.close().then(() => { + done(); + }); + }); + + it('has getProjectId method', async () => { + const fakeProjectId = 'fake-project-id'; + const client = new automlModule.v1beta1.AutoMlClient({ + 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 automlModule.v1beta1.AutoMlClient({ + 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('createDataset', () => { + it('invokes createDataset without error', async () => { + const client = new automlModule.v1beta1.AutoMlClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.automl.v1beta1.CreateDatasetRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.automl.v1beta1.CreateDatasetRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.automl.v1beta1.Dataset() + ); + client.innerApiCalls.createDataset = stubSimpleCall(expectedResponse); + const [response] = await client.createDataset(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.createDataset as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createDataset as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createDataset without error using callback', async () => { + const client = new automlModule.v1beta1.AutoMlClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.automl.v1beta1.CreateDatasetRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.automl.v1beta1.CreateDatasetRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.automl.v1beta1.Dataset() + ); + client.innerApiCalls.createDataset = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.createDataset( + request, + ( + err?: Error | null, + result?: protos.google.cloud.automl.v1beta1.IDataset | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.createDataset as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createDataset as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createDataset with error', async () => { + const client = new automlModule.v1beta1.AutoMlClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.automl.v1beta1.CreateDatasetRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.automl.v1beta1.CreateDatasetRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.createDataset = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.createDataset(request), expectedError); + const actualRequest = ( + client.innerApiCalls.createDataset as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createDataset as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createDataset with closed client', async () => { + const client = new automlModule.v1beta1.AutoMlClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.automl.v1beta1.CreateDatasetRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.automl.v1beta1.CreateDatasetRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.createDataset(request), expectedError); + }); + }); + + describe('getDataset', () => { + it('invokes getDataset without error', async () => { + const client = new automlModule.v1beta1.AutoMlClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.automl.v1beta1.GetDatasetRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.automl.v1beta1.GetDatasetRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.automl.v1beta1.Dataset() + ); + client.innerApiCalls.getDataset = stubSimpleCall(expectedResponse); + const [response] = await client.getDataset(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.getDataset as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getDataset as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getDataset without error using callback', async () => { + const client = new automlModule.v1beta1.AutoMlClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.automl.v1beta1.GetDatasetRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.automl.v1beta1.GetDatasetRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.automl.v1beta1.Dataset() + ); + client.innerApiCalls.getDataset = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getDataset( + request, + ( + err?: Error | null, + result?: protos.google.cloud.automl.v1beta1.IDataset | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.getDataset as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getDataset as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getDataset with error', async () => { + const client = new automlModule.v1beta1.AutoMlClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.automl.v1beta1.GetDatasetRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.automl.v1beta1.GetDatasetRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.getDataset = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.getDataset(request), expectedError); + const actualRequest = ( + client.innerApiCalls.getDataset as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getDataset as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getDataset with closed client', async () => { + const client = new automlModule.v1beta1.AutoMlClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.automl.v1beta1.GetDatasetRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.automl.v1beta1.GetDatasetRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.getDataset(request), expectedError); + }); + }); + + describe('updateDataset', () => { + it('invokes updateDataset without error', async () => { + const client = new automlModule.v1beta1.AutoMlClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.automl.v1beta1.UpdateDatasetRequest() + ); + request.dataset ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.automl.v1beta1.UpdateDatasetRequest', + ['dataset', 'name'] + ); + request.dataset.name = defaultValue1; + const expectedHeaderRequestParams = `dataset.name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.automl.v1beta1.Dataset() + ); + client.innerApiCalls.updateDataset = stubSimpleCall(expectedResponse); + const [response] = await client.updateDataset(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.updateDataset as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateDataset as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateDataset without error using callback', async () => { + const client = new automlModule.v1beta1.AutoMlClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.automl.v1beta1.UpdateDatasetRequest() + ); + request.dataset ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.automl.v1beta1.UpdateDatasetRequest', + ['dataset', 'name'] + ); + request.dataset.name = defaultValue1; + const expectedHeaderRequestParams = `dataset.name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.automl.v1beta1.Dataset() + ); + client.innerApiCalls.updateDataset = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.updateDataset( + request, + ( + err?: Error | null, + result?: protos.google.cloud.automl.v1beta1.IDataset | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.updateDataset as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateDataset as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateDataset with error', async () => { + const client = new automlModule.v1beta1.AutoMlClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.automl.v1beta1.UpdateDatasetRequest() + ); + request.dataset ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.automl.v1beta1.UpdateDatasetRequest', + ['dataset', 'name'] + ); + request.dataset.name = defaultValue1; + const expectedHeaderRequestParams = `dataset.name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.updateDataset = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.updateDataset(request), expectedError); + const actualRequest = ( + client.innerApiCalls.updateDataset as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateDataset as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateDataset with closed client', async () => { + const client = new automlModule.v1beta1.AutoMlClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.automl.v1beta1.UpdateDatasetRequest() + ); + request.dataset ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.automl.v1beta1.UpdateDatasetRequest', + ['dataset', 'name'] + ); + request.dataset.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.updateDataset(request), expectedError); + }); + }); + + describe('getAnnotationSpec', () => { + it('invokes getAnnotationSpec without error', async () => { + const client = new automlModule.v1beta1.AutoMlClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.automl.v1beta1.GetAnnotationSpecRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.automl.v1beta1.GetAnnotationSpecRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.automl.v1beta1.AnnotationSpec() + ); + client.innerApiCalls.getAnnotationSpec = stubSimpleCall(expectedResponse); + const [response] = await client.getAnnotationSpec(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.getAnnotationSpec as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getAnnotationSpec as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getAnnotationSpec without error using callback', async () => { + const client = new automlModule.v1beta1.AutoMlClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.automl.v1beta1.GetAnnotationSpecRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.automl.v1beta1.GetAnnotationSpecRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.automl.v1beta1.AnnotationSpec() + ); + client.innerApiCalls.getAnnotationSpec = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getAnnotationSpec( + request, + ( + err?: Error | null, + result?: protos.google.cloud.automl.v1beta1.IAnnotationSpec | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.getAnnotationSpec as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getAnnotationSpec as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getAnnotationSpec with error', async () => { + const client = new automlModule.v1beta1.AutoMlClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.automl.v1beta1.GetAnnotationSpecRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.automl.v1beta1.GetAnnotationSpecRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.getAnnotationSpec = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.getAnnotationSpec(request), expectedError); + const actualRequest = ( + client.innerApiCalls.getAnnotationSpec as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getAnnotationSpec as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getAnnotationSpec with closed client', async () => { + const client = new automlModule.v1beta1.AutoMlClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.automl.v1beta1.GetAnnotationSpecRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.automl.v1beta1.GetAnnotationSpecRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.getAnnotationSpec(request), expectedError); + }); + }); + + describe('getTableSpec', () => { + it('invokes getTableSpec without error', async () => { + const client = new automlModule.v1beta1.AutoMlClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.automl.v1beta1.GetTableSpecRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.automl.v1beta1.GetTableSpecRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.automl.v1beta1.TableSpec() + ); + client.innerApiCalls.getTableSpec = stubSimpleCall(expectedResponse); + const [response] = await client.getTableSpec(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.getTableSpec as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getTableSpec as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getTableSpec without error using callback', async () => { + const client = new automlModule.v1beta1.AutoMlClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.automl.v1beta1.GetTableSpecRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.automl.v1beta1.GetTableSpecRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.automl.v1beta1.TableSpec() + ); + client.innerApiCalls.getTableSpec = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getTableSpec( + request, + ( + err?: Error | null, + result?: protos.google.cloud.automl.v1beta1.ITableSpec | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.getTableSpec as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getTableSpec as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getTableSpec with error', async () => { + const client = new automlModule.v1beta1.AutoMlClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.automl.v1beta1.GetTableSpecRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.automl.v1beta1.GetTableSpecRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.getTableSpec = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.getTableSpec(request), expectedError); + const actualRequest = ( + client.innerApiCalls.getTableSpec as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getTableSpec as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getTableSpec with closed client', async () => { + const client = new automlModule.v1beta1.AutoMlClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.automl.v1beta1.GetTableSpecRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.automl.v1beta1.GetTableSpecRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.getTableSpec(request), expectedError); + }); + }); + + describe('updateTableSpec', () => { + it('invokes updateTableSpec without error', async () => { + const client = new automlModule.v1beta1.AutoMlClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.automl.v1beta1.UpdateTableSpecRequest() + ); + request.tableSpec ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.automl.v1beta1.UpdateTableSpecRequest', + ['tableSpec', 'name'] + ); + request.tableSpec.name = defaultValue1; + const expectedHeaderRequestParams = `table_spec.name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.automl.v1beta1.TableSpec() + ); + client.innerApiCalls.updateTableSpec = stubSimpleCall(expectedResponse); + const [response] = await client.updateTableSpec(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.updateTableSpec as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateTableSpec as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateTableSpec without error using callback', async () => { + const client = new automlModule.v1beta1.AutoMlClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.automl.v1beta1.UpdateTableSpecRequest() + ); + request.tableSpec ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.automl.v1beta1.UpdateTableSpecRequest', + ['tableSpec', 'name'] + ); + request.tableSpec.name = defaultValue1; + const expectedHeaderRequestParams = `table_spec.name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.automl.v1beta1.TableSpec() + ); + client.innerApiCalls.updateTableSpec = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.updateTableSpec( + request, + ( + err?: Error | null, + result?: protos.google.cloud.automl.v1beta1.ITableSpec | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.updateTableSpec as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateTableSpec as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateTableSpec with error', async () => { + const client = new automlModule.v1beta1.AutoMlClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.automl.v1beta1.UpdateTableSpecRequest() + ); + request.tableSpec ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.automl.v1beta1.UpdateTableSpecRequest', + ['tableSpec', 'name'] + ); + request.tableSpec.name = defaultValue1; + const expectedHeaderRequestParams = `table_spec.name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.updateTableSpec = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.updateTableSpec(request), expectedError); + const actualRequest = ( + client.innerApiCalls.updateTableSpec as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateTableSpec as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateTableSpec with closed client', async () => { + const client = new automlModule.v1beta1.AutoMlClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.automl.v1beta1.UpdateTableSpecRequest() + ); + request.tableSpec ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.automl.v1beta1.UpdateTableSpecRequest', + ['tableSpec', 'name'] + ); + request.tableSpec.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.updateTableSpec(request), expectedError); + }); + }); + + describe('getColumnSpec', () => { + it('invokes getColumnSpec without error', async () => { + const client = new automlModule.v1beta1.AutoMlClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.automl.v1beta1.GetColumnSpecRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.automl.v1beta1.GetColumnSpecRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.automl.v1beta1.ColumnSpec() + ); + client.innerApiCalls.getColumnSpec = stubSimpleCall(expectedResponse); + const [response] = await client.getColumnSpec(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.getColumnSpec as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getColumnSpec as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getColumnSpec without error using callback', async () => { + const client = new automlModule.v1beta1.AutoMlClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.automl.v1beta1.GetColumnSpecRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.automl.v1beta1.GetColumnSpecRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.automl.v1beta1.ColumnSpec() + ); + client.innerApiCalls.getColumnSpec = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getColumnSpec( + request, + ( + err?: Error | null, + result?: protos.google.cloud.automl.v1beta1.IColumnSpec | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.getColumnSpec as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getColumnSpec as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getColumnSpec with error', async () => { + const client = new automlModule.v1beta1.AutoMlClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.automl.v1beta1.GetColumnSpecRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.automl.v1beta1.GetColumnSpecRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.getColumnSpec = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.getColumnSpec(request), expectedError); + const actualRequest = ( + client.innerApiCalls.getColumnSpec as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getColumnSpec as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getColumnSpec with closed client', async () => { + const client = new automlModule.v1beta1.AutoMlClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.automl.v1beta1.GetColumnSpecRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.automl.v1beta1.GetColumnSpecRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.getColumnSpec(request), expectedError); + }); + }); + + describe('updateColumnSpec', () => { + it('invokes updateColumnSpec without error', async () => { + const client = new automlModule.v1beta1.AutoMlClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.automl.v1beta1.UpdateColumnSpecRequest() + ); + request.columnSpec ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.automl.v1beta1.UpdateColumnSpecRequest', + ['columnSpec', 'name'] + ); + request.columnSpec.name = defaultValue1; + const expectedHeaderRequestParams = `column_spec.name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.automl.v1beta1.ColumnSpec() + ); + client.innerApiCalls.updateColumnSpec = stubSimpleCall(expectedResponse); + const [response] = await client.updateColumnSpec(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.updateColumnSpec as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateColumnSpec as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateColumnSpec without error using callback', async () => { + const client = new automlModule.v1beta1.AutoMlClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.automl.v1beta1.UpdateColumnSpecRequest() + ); + request.columnSpec ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.automl.v1beta1.UpdateColumnSpecRequest', + ['columnSpec', 'name'] + ); + request.columnSpec.name = defaultValue1; + const expectedHeaderRequestParams = `column_spec.name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.automl.v1beta1.ColumnSpec() + ); + client.innerApiCalls.updateColumnSpec = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.updateColumnSpec( + request, + ( + err?: Error | null, + result?: protos.google.cloud.automl.v1beta1.IColumnSpec | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.updateColumnSpec as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateColumnSpec as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateColumnSpec with error', async () => { + const client = new automlModule.v1beta1.AutoMlClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.automl.v1beta1.UpdateColumnSpecRequest() + ); + request.columnSpec ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.automl.v1beta1.UpdateColumnSpecRequest', + ['columnSpec', 'name'] + ); + request.columnSpec.name = defaultValue1; + const expectedHeaderRequestParams = `column_spec.name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.updateColumnSpec = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.updateColumnSpec(request), expectedError); + const actualRequest = ( + client.innerApiCalls.updateColumnSpec as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateColumnSpec as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateColumnSpec with closed client', async () => { + const client = new automlModule.v1beta1.AutoMlClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.automl.v1beta1.UpdateColumnSpecRequest() + ); + request.columnSpec ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.automl.v1beta1.UpdateColumnSpecRequest', + ['columnSpec', 'name'] + ); + request.columnSpec.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.updateColumnSpec(request), expectedError); + }); + }); + + describe('getModel', () => { + it('invokes getModel without error', async () => { + const client = new automlModule.v1beta1.AutoMlClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.automl.v1beta1.GetModelRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.automl.v1beta1.GetModelRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.automl.v1beta1.Model() + ); + client.innerApiCalls.getModel = stubSimpleCall(expectedResponse); + const [response] = await client.getModel(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.getModel as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getModel as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getModel without error using callback', async () => { + const client = new automlModule.v1beta1.AutoMlClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.automl.v1beta1.GetModelRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.automl.v1beta1.GetModelRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.automl.v1beta1.Model() + ); + client.innerApiCalls.getModel = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getModel( + request, + ( + err?: Error | null, + result?: protos.google.cloud.automl.v1beta1.IModel | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.getModel as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getModel as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getModel with error', async () => { + const client = new automlModule.v1beta1.AutoMlClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.automl.v1beta1.GetModelRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.automl.v1beta1.GetModelRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.getModel = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.getModel(request), expectedError); + const actualRequest = ( + client.innerApiCalls.getModel as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getModel as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getModel with closed client', async () => { + const client = new automlModule.v1beta1.AutoMlClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.automl.v1beta1.GetModelRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.automl.v1beta1.GetModelRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.getModel(request), expectedError); + }); + }); + + describe('getModelEvaluation', () => { + it('invokes getModelEvaluation without error', async () => { + const client = new automlModule.v1beta1.AutoMlClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.automl.v1beta1.GetModelEvaluationRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.automl.v1beta1.GetModelEvaluationRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.automl.v1beta1.ModelEvaluation() + ); + client.innerApiCalls.getModelEvaluation = + stubSimpleCall(expectedResponse); + const [response] = await client.getModelEvaluation(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.getModelEvaluation as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getModelEvaluation as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getModelEvaluation without error using callback', async () => { + const client = new automlModule.v1beta1.AutoMlClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.automl.v1beta1.GetModelEvaluationRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.automl.v1beta1.GetModelEvaluationRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.automl.v1beta1.ModelEvaluation() + ); + client.innerApiCalls.getModelEvaluation = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getModelEvaluation( + request, + ( + err?: Error | null, + result?: protos.google.cloud.automl.v1beta1.IModelEvaluation | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.getModelEvaluation as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getModelEvaluation as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getModelEvaluation with error', async () => { + const client = new automlModule.v1beta1.AutoMlClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.automl.v1beta1.GetModelEvaluationRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.automl.v1beta1.GetModelEvaluationRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.getModelEvaluation = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.getModelEvaluation(request), expectedError); + const actualRequest = ( + client.innerApiCalls.getModelEvaluation as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getModelEvaluation as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getModelEvaluation with closed client', async () => { + const client = new automlModule.v1beta1.AutoMlClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.automl.v1beta1.GetModelEvaluationRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.automl.v1beta1.GetModelEvaluationRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.getModelEvaluation(request), expectedError); + }); + }); + + describe('deleteDataset', () => { + it('invokes deleteDataset without error', async () => { + const client = new automlModule.v1beta1.AutoMlClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.automl.v1beta1.DeleteDatasetRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.automl.v1beta1.DeleteDatasetRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.deleteDataset = + stubLongRunningCall(expectedResponse); + const [operation] = await client.deleteDataset(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.deleteDataset as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteDataset as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteDataset without error using callback', async () => { + const client = new automlModule.v1beta1.AutoMlClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.automl.v1beta1.DeleteDatasetRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.automl.v1beta1.DeleteDatasetRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.deleteDataset = + stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.deleteDataset( + request, + ( + err?: Error | null, + result?: LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.automl.v1beta1.IOperationMetadata + > | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const operation = (await promise) as LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.automl.v1beta1.IOperationMetadata + >; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.deleteDataset as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteDataset as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteDataset with call error', async () => { + const client = new automlModule.v1beta1.AutoMlClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.automl.v1beta1.DeleteDatasetRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.automl.v1beta1.DeleteDatasetRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteDataset = stubLongRunningCall( + undefined, + expectedError + ); + await assert.rejects(client.deleteDataset(request), expectedError); + const actualRequest = ( + client.innerApiCalls.deleteDataset as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteDataset as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteDataset with LRO error', async () => { + const client = new automlModule.v1beta1.AutoMlClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.automl.v1beta1.DeleteDatasetRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.automl.v1beta1.DeleteDatasetRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteDataset = stubLongRunningCall( + undefined, + undefined, + expectedError + ); + const [operation] = await client.deleteDataset(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = ( + client.innerApiCalls.deleteDataset as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteDataset as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkDeleteDatasetProgress without error', async () => { + const client = new automlModule.v1beta1.AutoMlClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + 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.checkDeleteDatasetProgress( + expectedResponse.name + ); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkDeleteDatasetProgress with error', async () => { + const client = new automlModule.v1beta1.AutoMlClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const expectedError = new Error('expected'); + + client.operationsClient.getOperation = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects( + client.checkDeleteDatasetProgress(''), + expectedError + ); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + }); + + describe('importData', () => { + it('invokes importData without error', async () => { + const client = new automlModule.v1beta1.AutoMlClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.automl.v1beta1.ImportDataRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.automl.v1beta1.ImportDataRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.importData = stubLongRunningCall(expectedResponse); + const [operation] = await client.importData(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.importData as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.importData as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes importData without error using callback', async () => { + const client = new automlModule.v1beta1.AutoMlClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.automl.v1beta1.ImportDataRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.automl.v1beta1.ImportDataRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.importData = + stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.importData( + request, + ( + err?: Error | null, + result?: LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.automl.v1beta1.IOperationMetadata + > | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const operation = (await promise) as LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.automl.v1beta1.IOperationMetadata + >; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.importData as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.importData as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes importData with call error', async () => { + const client = new automlModule.v1beta1.AutoMlClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.automl.v1beta1.ImportDataRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.automl.v1beta1.ImportDataRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.importData = stubLongRunningCall( + undefined, + expectedError + ); + await assert.rejects(client.importData(request), expectedError); + const actualRequest = ( + client.innerApiCalls.importData as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.importData as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes importData with LRO error', async () => { + const client = new automlModule.v1beta1.AutoMlClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.automl.v1beta1.ImportDataRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.automl.v1beta1.ImportDataRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.importData = stubLongRunningCall( + undefined, + undefined, + expectedError + ); + const [operation] = await client.importData(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = ( + client.innerApiCalls.importData as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.importData as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkImportDataProgress without error', async () => { + const client = new automlModule.v1beta1.AutoMlClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + 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.checkImportDataProgress( + expectedResponse.name + ); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkImportDataProgress with error', async () => { + const client = new automlModule.v1beta1.AutoMlClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const expectedError = new Error('expected'); + + client.operationsClient.getOperation = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.checkImportDataProgress(''), expectedError); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + }); + + describe('exportData', () => { + it('invokes exportData without error', async () => { + const client = new automlModule.v1beta1.AutoMlClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.automl.v1beta1.ExportDataRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.automl.v1beta1.ExportDataRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.exportData = stubLongRunningCall(expectedResponse); + const [operation] = await client.exportData(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.exportData as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.exportData as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes exportData without error using callback', async () => { + const client = new automlModule.v1beta1.AutoMlClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.automl.v1beta1.ExportDataRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.automl.v1beta1.ExportDataRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.exportData = + stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.exportData( + request, + ( + err?: Error | null, + result?: LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.automl.v1beta1.IOperationMetadata + > | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const operation = (await promise) as LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.automl.v1beta1.IOperationMetadata + >; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.exportData as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.exportData as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes exportData with call error', async () => { + const client = new automlModule.v1beta1.AutoMlClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.automl.v1beta1.ExportDataRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.automl.v1beta1.ExportDataRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.exportData = stubLongRunningCall( + undefined, + expectedError + ); + await assert.rejects(client.exportData(request), expectedError); + const actualRequest = ( + client.innerApiCalls.exportData as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.exportData as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes exportData with LRO error', async () => { + const client = new automlModule.v1beta1.AutoMlClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.automl.v1beta1.ExportDataRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.automl.v1beta1.ExportDataRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.exportData = stubLongRunningCall( + undefined, + undefined, + expectedError + ); + const [operation] = await client.exportData(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = ( + client.innerApiCalls.exportData as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.exportData as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkExportDataProgress without error', async () => { + const client = new automlModule.v1beta1.AutoMlClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + 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.checkExportDataProgress( + expectedResponse.name + ); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkExportDataProgress with error', async () => { + const client = new automlModule.v1beta1.AutoMlClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const expectedError = new Error('expected'); + + client.operationsClient.getOperation = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.checkExportDataProgress(''), expectedError); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + }); + + describe('createModel', () => { + it('invokes createModel without error', async () => { + const client = new automlModule.v1beta1.AutoMlClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.automl.v1beta1.CreateModelRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.automl.v1beta1.CreateModelRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.createModel = stubLongRunningCall(expectedResponse); + const [operation] = await client.createModel(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.createModel as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createModel as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createModel without error using callback', async () => { + const client = new automlModule.v1beta1.AutoMlClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.automl.v1beta1.CreateModelRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.automl.v1beta1.CreateModelRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.createModel = + stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.createModel( + request, + ( + err?: Error | null, + result?: LROperation< + protos.google.cloud.automl.v1beta1.IModel, + protos.google.cloud.automl.v1beta1.IOperationMetadata + > | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const operation = (await promise) as LROperation< + protos.google.cloud.automl.v1beta1.IModel, + protos.google.cloud.automl.v1beta1.IOperationMetadata + >; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.createModel as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createModel as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createModel with call error', async () => { + const client = new automlModule.v1beta1.AutoMlClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.automl.v1beta1.CreateModelRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.automl.v1beta1.CreateModelRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.createModel = stubLongRunningCall( + undefined, + expectedError + ); + await assert.rejects(client.createModel(request), expectedError); + const actualRequest = ( + client.innerApiCalls.createModel as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createModel as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createModel with LRO error', async () => { + const client = new automlModule.v1beta1.AutoMlClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.automl.v1beta1.CreateModelRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.automl.v1beta1.CreateModelRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.createModel = stubLongRunningCall( + undefined, + undefined, + expectedError + ); + const [operation] = await client.createModel(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = ( + client.innerApiCalls.createModel as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createModel as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkCreateModelProgress without error', async () => { + const client = new automlModule.v1beta1.AutoMlClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + 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.checkCreateModelProgress( + expectedResponse.name + ); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkCreateModelProgress with error', async () => { + const client = new automlModule.v1beta1.AutoMlClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const expectedError = new Error('expected'); + + client.operationsClient.getOperation = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.checkCreateModelProgress(''), expectedError); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + }); + + describe('deleteModel', () => { + it('invokes deleteModel without error', async () => { + const client = new automlModule.v1beta1.AutoMlClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.automl.v1beta1.DeleteModelRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.automl.v1beta1.DeleteModelRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.deleteModel = stubLongRunningCall(expectedResponse); + const [operation] = await client.deleteModel(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.deleteModel as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteModel as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteModel without error using callback', async () => { + const client = new automlModule.v1beta1.AutoMlClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.automl.v1beta1.DeleteModelRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.automl.v1beta1.DeleteModelRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.deleteModel = + stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.deleteModel( + request, + ( + err?: Error | null, + result?: LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.automl.v1beta1.IOperationMetadata + > | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const operation = (await promise) as LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.automl.v1beta1.IOperationMetadata + >; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.deleteModel as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteModel as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteModel with call error', async () => { + const client = new automlModule.v1beta1.AutoMlClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.automl.v1beta1.DeleteModelRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.automl.v1beta1.DeleteModelRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteModel = stubLongRunningCall( + undefined, + expectedError + ); + await assert.rejects(client.deleteModel(request), expectedError); + const actualRequest = ( + client.innerApiCalls.deleteModel as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteModel as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteModel with LRO error', async () => { + const client = new automlModule.v1beta1.AutoMlClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.automl.v1beta1.DeleteModelRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.automl.v1beta1.DeleteModelRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteModel = stubLongRunningCall( + undefined, + undefined, + expectedError + ); + const [operation] = await client.deleteModel(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = ( + client.innerApiCalls.deleteModel as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteModel as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkDeleteModelProgress without error', async () => { + const client = new automlModule.v1beta1.AutoMlClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + 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.checkDeleteModelProgress( + expectedResponse.name + ); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkDeleteModelProgress with error', async () => { + const client = new automlModule.v1beta1.AutoMlClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const expectedError = new Error('expected'); + + client.operationsClient.getOperation = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.checkDeleteModelProgress(''), expectedError); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + }); + + describe('deployModel', () => { + it('invokes deployModel without error', async () => { + const client = new automlModule.v1beta1.AutoMlClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.automl.v1beta1.DeployModelRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.automl.v1beta1.DeployModelRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.deployModel = stubLongRunningCall(expectedResponse); + const [operation] = await client.deployModel(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.deployModel as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deployModel as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deployModel without error using callback', async () => { + const client = new automlModule.v1beta1.AutoMlClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.automl.v1beta1.DeployModelRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.automl.v1beta1.DeployModelRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.deployModel = + stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.deployModel( + request, + ( + err?: Error | null, + result?: LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.automl.v1beta1.IOperationMetadata + > | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const operation = (await promise) as LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.automl.v1beta1.IOperationMetadata + >; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.deployModel as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deployModel as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deployModel with call error', async () => { + const client = new automlModule.v1beta1.AutoMlClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.automl.v1beta1.DeployModelRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.automl.v1beta1.DeployModelRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.deployModel = stubLongRunningCall( + undefined, + expectedError + ); + await assert.rejects(client.deployModel(request), expectedError); + const actualRequest = ( + client.innerApiCalls.deployModel as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deployModel as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deployModel with LRO error', async () => { + const client = new automlModule.v1beta1.AutoMlClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.automl.v1beta1.DeployModelRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.automl.v1beta1.DeployModelRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.deployModel = stubLongRunningCall( + undefined, + undefined, + expectedError + ); + const [operation] = await client.deployModel(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = ( + client.innerApiCalls.deployModel as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deployModel as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkDeployModelProgress without error', async () => { + const client = new automlModule.v1beta1.AutoMlClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + 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.checkDeployModelProgress( + expectedResponse.name + ); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkDeployModelProgress with error', async () => { + const client = new automlModule.v1beta1.AutoMlClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const expectedError = new Error('expected'); + + client.operationsClient.getOperation = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.checkDeployModelProgress(''), expectedError); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + }); + + describe('undeployModel', () => { + it('invokes undeployModel without error', async () => { + const client = new automlModule.v1beta1.AutoMlClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.automl.v1beta1.UndeployModelRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.automl.v1beta1.UndeployModelRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.undeployModel = + stubLongRunningCall(expectedResponse); + const [operation] = await client.undeployModel(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.undeployModel as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.undeployModel as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes undeployModel without error using callback', async () => { + const client = new automlModule.v1beta1.AutoMlClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.automl.v1beta1.UndeployModelRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.automl.v1beta1.UndeployModelRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.undeployModel = + stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.undeployModel( + request, + ( + err?: Error | null, + result?: LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.automl.v1beta1.IOperationMetadata + > | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const operation = (await promise) as LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.automl.v1beta1.IOperationMetadata + >; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.undeployModel as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.undeployModel as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes undeployModel with call error', async () => { + const client = new automlModule.v1beta1.AutoMlClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.automl.v1beta1.UndeployModelRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.automl.v1beta1.UndeployModelRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.undeployModel = stubLongRunningCall( + undefined, + expectedError + ); + await assert.rejects(client.undeployModel(request), expectedError); + const actualRequest = ( + client.innerApiCalls.undeployModel as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.undeployModel as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes undeployModel with LRO error', async () => { + const client = new automlModule.v1beta1.AutoMlClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.automl.v1beta1.UndeployModelRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.automl.v1beta1.UndeployModelRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.undeployModel = stubLongRunningCall( + undefined, + undefined, + expectedError + ); + const [operation] = await client.undeployModel(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = ( + client.innerApiCalls.undeployModel as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.undeployModel as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkUndeployModelProgress without error', async () => { + const client = new automlModule.v1beta1.AutoMlClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + 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.checkUndeployModelProgress( + expectedResponse.name + ); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkUndeployModelProgress with error', async () => { + const client = new automlModule.v1beta1.AutoMlClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const expectedError = new Error('expected'); + + client.operationsClient.getOperation = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects( + client.checkUndeployModelProgress(''), + expectedError + ); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + }); + + describe('exportModel', () => { + it('invokes exportModel without error', async () => { + const client = new automlModule.v1beta1.AutoMlClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.automl.v1beta1.ExportModelRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.automl.v1beta1.ExportModelRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.exportModel = stubLongRunningCall(expectedResponse); + const [operation] = await client.exportModel(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.exportModel as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.exportModel as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes exportModel without error using callback', async () => { + const client = new automlModule.v1beta1.AutoMlClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.automl.v1beta1.ExportModelRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.automl.v1beta1.ExportModelRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.exportModel = + stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.exportModel( + request, + ( + err?: Error | null, + result?: LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.automl.v1beta1.IOperationMetadata + > | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const operation = (await promise) as LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.automl.v1beta1.IOperationMetadata + >; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.exportModel as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.exportModel as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes exportModel with call error', async () => { + const client = new automlModule.v1beta1.AutoMlClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.automl.v1beta1.ExportModelRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.automl.v1beta1.ExportModelRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.exportModel = stubLongRunningCall( + undefined, + expectedError + ); + await assert.rejects(client.exportModel(request), expectedError); + const actualRequest = ( + client.innerApiCalls.exportModel as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.exportModel as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes exportModel with LRO error', async () => { + const client = new automlModule.v1beta1.AutoMlClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.automl.v1beta1.ExportModelRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.automl.v1beta1.ExportModelRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.exportModel = stubLongRunningCall( + undefined, + undefined, + expectedError + ); + const [operation] = await client.exportModel(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = ( + client.innerApiCalls.exportModel as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.exportModel as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkExportModelProgress without error', async () => { + const client = new automlModule.v1beta1.AutoMlClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + 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.checkExportModelProgress( + expectedResponse.name + ); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkExportModelProgress with error', async () => { + const client = new automlModule.v1beta1.AutoMlClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const expectedError = new Error('expected'); + + client.operationsClient.getOperation = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.checkExportModelProgress(''), expectedError); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + }); + + describe('exportEvaluatedExamples', () => { + it('invokes exportEvaluatedExamples without error', async () => { + const client = new automlModule.v1beta1.AutoMlClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.automl.v1beta1.ExportEvaluatedExamplesRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.automl.v1beta1.ExportEvaluatedExamplesRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.exportEvaluatedExamples = + stubLongRunningCall(expectedResponse); + const [operation] = await client.exportEvaluatedExamples(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.exportEvaluatedExamples as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.exportEvaluatedExamples as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes exportEvaluatedExamples without error using callback', async () => { + const client = new automlModule.v1beta1.AutoMlClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.automl.v1beta1.ExportEvaluatedExamplesRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.automl.v1beta1.ExportEvaluatedExamplesRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.exportEvaluatedExamples = + stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.exportEvaluatedExamples( + request, + ( + err?: Error | null, + result?: LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.automl.v1beta1.IOperationMetadata + > | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const operation = (await promise) as LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.automl.v1beta1.IOperationMetadata + >; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.exportEvaluatedExamples as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.exportEvaluatedExamples as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes exportEvaluatedExamples with call error', async () => { + const client = new automlModule.v1beta1.AutoMlClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.automl.v1beta1.ExportEvaluatedExamplesRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.automl.v1beta1.ExportEvaluatedExamplesRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.exportEvaluatedExamples = stubLongRunningCall( + undefined, + expectedError + ); + await assert.rejects( + client.exportEvaluatedExamples(request), + expectedError + ); + const actualRequest = ( + client.innerApiCalls.exportEvaluatedExamples as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.exportEvaluatedExamples as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes exportEvaluatedExamples with LRO error', async () => { + const client = new automlModule.v1beta1.AutoMlClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.automl.v1beta1.ExportEvaluatedExamplesRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.automl.v1beta1.ExportEvaluatedExamplesRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.exportEvaluatedExamples = stubLongRunningCall( + undefined, + undefined, + expectedError + ); + const [operation] = await client.exportEvaluatedExamples(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = ( + client.innerApiCalls.exportEvaluatedExamples as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.exportEvaluatedExamples as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkExportEvaluatedExamplesProgress without error', async () => { + const client = new automlModule.v1beta1.AutoMlClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + 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.checkExportEvaluatedExamplesProgress( + expectedResponse.name + ); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkExportEvaluatedExamplesProgress with error', async () => { + const client = new automlModule.v1beta1.AutoMlClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const expectedError = new Error('expected'); + + client.operationsClient.getOperation = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects( + client.checkExportEvaluatedExamplesProgress(''), + expectedError + ); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + }); + + describe('listDatasets', () => { + it('invokes listDatasets without error', async () => { + const client = new automlModule.v1beta1.AutoMlClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.automl.v1beta1.ListDatasetsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.automl.v1beta1.ListDatasetsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.automl.v1beta1.Dataset()), + generateSampleMessage(new protos.google.cloud.automl.v1beta1.Dataset()), + generateSampleMessage(new protos.google.cloud.automl.v1beta1.Dataset()), + ]; + client.innerApiCalls.listDatasets = stubSimpleCall(expectedResponse); + const [response] = await client.listDatasets(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.listDatasets as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listDatasets as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listDatasets without error using callback', async () => { + const client = new automlModule.v1beta1.AutoMlClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.automl.v1beta1.ListDatasetsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.automl.v1beta1.ListDatasetsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.automl.v1beta1.Dataset()), + generateSampleMessage(new protos.google.cloud.automl.v1beta1.Dataset()), + generateSampleMessage(new protos.google.cloud.automl.v1beta1.Dataset()), + ]; + client.innerApiCalls.listDatasets = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.listDatasets( + request, + ( + err?: Error | null, + result?: protos.google.cloud.automl.v1beta1.IDataset[] | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.listDatasets as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listDatasets as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listDatasets with error', async () => { + const client = new automlModule.v1beta1.AutoMlClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.automl.v1beta1.ListDatasetsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.automl.v1beta1.ListDatasetsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.listDatasets = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.listDatasets(request), expectedError); + const actualRequest = ( + client.innerApiCalls.listDatasets as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listDatasets as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listDatasetsStream without error', async () => { + const client = new automlModule.v1beta1.AutoMlClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.automl.v1beta1.ListDatasetsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.automl.v1beta1.ListDatasetsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.automl.v1beta1.Dataset()), + generateSampleMessage(new protos.google.cloud.automl.v1beta1.Dataset()), + generateSampleMessage(new protos.google.cloud.automl.v1beta1.Dataset()), + ]; + client.descriptors.page.listDatasets.createStream = + stubPageStreamingCall(expectedResponse); + const stream = client.listDatasetsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.automl.v1beta1.Dataset[] = []; + stream.on( + 'data', + (response: protos.google.cloud.automl.v1beta1.Dataset) => { + 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.listDatasets.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.listDatasets, request) + ); + assert( + (client.descriptors.page.listDatasets.createStream as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('invokes listDatasetsStream with error', async () => { + const client = new automlModule.v1beta1.AutoMlClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.automl.v1beta1.ListDatasetsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.automl.v1beta1.ListDatasetsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.descriptors.page.listDatasets.createStream = stubPageStreamingCall( + undefined, + expectedError + ); + const stream = client.listDatasetsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.automl.v1beta1.Dataset[] = []; + stream.on( + 'data', + (response: protos.google.cloud.automl.v1beta1.Dataset) => { + responses.push(response); + } + ); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert( + (client.descriptors.page.listDatasets.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.listDatasets, request) + ); + assert( + (client.descriptors.page.listDatasets.createStream as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listDatasets without error', async () => { + const client = new automlModule.v1beta1.AutoMlClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.automl.v1beta1.ListDatasetsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.automl.v1beta1.ListDatasetsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.automl.v1beta1.Dataset()), + generateSampleMessage(new protos.google.cloud.automl.v1beta1.Dataset()), + generateSampleMessage(new protos.google.cloud.automl.v1beta1.Dataset()), + ]; + client.descriptors.page.listDatasets.asyncIterate = + stubAsyncIterationCall(expectedResponse); + const responses: protos.google.cloud.automl.v1beta1.IDataset[] = []; + const iterable = client.listDatasetsAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + ( + client.descriptors.page.listDatasets.asyncIterate as SinonStub + ).getCall(0).args[1], + request + ); + assert( + (client.descriptors.page.listDatasets.asyncIterate as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listDatasets with error', async () => { + const client = new automlModule.v1beta1.AutoMlClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.automl.v1beta1.ListDatasetsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.automl.v1beta1.ListDatasetsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.descriptors.page.listDatasets.asyncIterate = + stubAsyncIterationCall(undefined, expectedError); + const iterable = client.listDatasetsAsync(request); + await assert.rejects(async () => { + const responses: protos.google.cloud.automl.v1beta1.IDataset[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + ( + client.descriptors.page.listDatasets.asyncIterate as SinonStub + ).getCall(0).args[1], + request + ); + assert( + (client.descriptors.page.listDatasets.asyncIterate as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + }); + + describe('listTableSpecs', () => { + it('invokes listTableSpecs without error', async () => { + const client = new automlModule.v1beta1.AutoMlClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.automl.v1beta1.ListTableSpecsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.automl.v1beta1.ListTableSpecsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.automl.v1beta1.TableSpec() + ), + generateSampleMessage( + new protos.google.cloud.automl.v1beta1.TableSpec() + ), + generateSampleMessage( + new protos.google.cloud.automl.v1beta1.TableSpec() + ), + ]; + client.innerApiCalls.listTableSpecs = stubSimpleCall(expectedResponse); + const [response] = await client.listTableSpecs(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.listTableSpecs as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listTableSpecs as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listTableSpecs without error using callback', async () => { + const client = new automlModule.v1beta1.AutoMlClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.automl.v1beta1.ListTableSpecsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.automl.v1beta1.ListTableSpecsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.automl.v1beta1.TableSpec() + ), + generateSampleMessage( + new protos.google.cloud.automl.v1beta1.TableSpec() + ), + generateSampleMessage( + new protos.google.cloud.automl.v1beta1.TableSpec() + ), + ]; + client.innerApiCalls.listTableSpecs = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.listTableSpecs( + request, + ( + err?: Error | null, + result?: protos.google.cloud.automl.v1beta1.ITableSpec[] | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.listTableSpecs as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listTableSpecs as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listTableSpecs with error', async () => { + const client = new automlModule.v1beta1.AutoMlClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.automl.v1beta1.ListTableSpecsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.automl.v1beta1.ListTableSpecsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.listTableSpecs = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.listTableSpecs(request), expectedError); + const actualRequest = ( + client.innerApiCalls.listTableSpecs as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listTableSpecs as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listTableSpecsStream without error', async () => { + const client = new automlModule.v1beta1.AutoMlClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.automl.v1beta1.ListTableSpecsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.automl.v1beta1.ListTableSpecsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.automl.v1beta1.TableSpec() + ), + generateSampleMessage( + new protos.google.cloud.automl.v1beta1.TableSpec() + ), + generateSampleMessage( + new protos.google.cloud.automl.v1beta1.TableSpec() + ), + ]; + client.descriptors.page.listTableSpecs.createStream = + stubPageStreamingCall(expectedResponse); + const stream = client.listTableSpecsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.automl.v1beta1.TableSpec[] = []; + stream.on( + 'data', + (response: protos.google.cloud.automl.v1beta1.TableSpec) => { + 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.listTableSpecs.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.listTableSpecs, request) + ); + assert( + (client.descriptors.page.listTableSpecs.createStream as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('invokes listTableSpecsStream with error', async () => { + const client = new automlModule.v1beta1.AutoMlClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.automl.v1beta1.ListTableSpecsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.automl.v1beta1.ListTableSpecsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.descriptors.page.listTableSpecs.createStream = + stubPageStreamingCall(undefined, expectedError); + const stream = client.listTableSpecsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.automl.v1beta1.TableSpec[] = []; + stream.on( + 'data', + (response: protos.google.cloud.automl.v1beta1.TableSpec) => { + responses.push(response); + } + ); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert( + (client.descriptors.page.listTableSpecs.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.listTableSpecs, request) + ); + assert( + (client.descriptors.page.listTableSpecs.createStream as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listTableSpecs without error', async () => { + const client = new automlModule.v1beta1.AutoMlClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.automl.v1beta1.ListTableSpecsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.automl.v1beta1.ListTableSpecsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.automl.v1beta1.TableSpec() + ), + generateSampleMessage( + new protos.google.cloud.automl.v1beta1.TableSpec() + ), + generateSampleMessage( + new protos.google.cloud.automl.v1beta1.TableSpec() + ), + ]; + client.descriptors.page.listTableSpecs.asyncIterate = + stubAsyncIterationCall(expectedResponse); + const responses: protos.google.cloud.automl.v1beta1.ITableSpec[] = []; + const iterable = client.listTableSpecsAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + ( + client.descriptors.page.listTableSpecs.asyncIterate as SinonStub + ).getCall(0).args[1], + request + ); + assert( + (client.descriptors.page.listTableSpecs.asyncIterate as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listTableSpecs with error', async () => { + const client = new automlModule.v1beta1.AutoMlClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.automl.v1beta1.ListTableSpecsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.automl.v1beta1.ListTableSpecsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.descriptors.page.listTableSpecs.asyncIterate = + stubAsyncIterationCall(undefined, expectedError); + const iterable = client.listTableSpecsAsync(request); + await assert.rejects(async () => { + const responses: protos.google.cloud.automl.v1beta1.ITableSpec[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + ( + client.descriptors.page.listTableSpecs.asyncIterate as SinonStub + ).getCall(0).args[1], + request + ); + assert( + (client.descriptors.page.listTableSpecs.asyncIterate as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + }); + + describe('listColumnSpecs', () => { + it('invokes listColumnSpecs without error', async () => { + const client = new automlModule.v1beta1.AutoMlClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.automl.v1beta1.ListColumnSpecsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.automl.v1beta1.ListColumnSpecsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.automl.v1beta1.ColumnSpec() + ), + generateSampleMessage( + new protos.google.cloud.automl.v1beta1.ColumnSpec() + ), + generateSampleMessage( + new protos.google.cloud.automl.v1beta1.ColumnSpec() + ), + ]; + client.innerApiCalls.listColumnSpecs = stubSimpleCall(expectedResponse); + const [response] = await client.listColumnSpecs(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.listColumnSpecs as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listColumnSpecs as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listColumnSpecs without error using callback', async () => { + const client = new automlModule.v1beta1.AutoMlClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.automl.v1beta1.ListColumnSpecsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.automl.v1beta1.ListColumnSpecsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.automl.v1beta1.ColumnSpec() + ), + generateSampleMessage( + new protos.google.cloud.automl.v1beta1.ColumnSpec() + ), + generateSampleMessage( + new protos.google.cloud.automl.v1beta1.ColumnSpec() + ), + ]; + client.innerApiCalls.listColumnSpecs = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.listColumnSpecs( + request, + ( + err?: Error | null, + result?: protos.google.cloud.automl.v1beta1.IColumnSpec[] | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.listColumnSpecs as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listColumnSpecs as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listColumnSpecs with error', async () => { + const client = new automlModule.v1beta1.AutoMlClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.automl.v1beta1.ListColumnSpecsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.automl.v1beta1.ListColumnSpecsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.listColumnSpecs = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.listColumnSpecs(request), expectedError); + const actualRequest = ( + client.innerApiCalls.listColumnSpecs as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listColumnSpecs as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listColumnSpecsStream without error', async () => { + const client = new automlModule.v1beta1.AutoMlClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.automl.v1beta1.ListColumnSpecsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.automl.v1beta1.ListColumnSpecsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.automl.v1beta1.ColumnSpec() + ), + generateSampleMessage( + new protos.google.cloud.automl.v1beta1.ColumnSpec() + ), + generateSampleMessage( + new protos.google.cloud.automl.v1beta1.ColumnSpec() + ), + ]; + client.descriptors.page.listColumnSpecs.createStream = + stubPageStreamingCall(expectedResponse); + const stream = client.listColumnSpecsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.automl.v1beta1.ColumnSpec[] = []; + stream.on( + 'data', + (response: protos.google.cloud.automl.v1beta1.ColumnSpec) => { + 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.listColumnSpecs.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.listColumnSpecs, request) + ); + assert( + (client.descriptors.page.listColumnSpecs.createStream as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('invokes listColumnSpecsStream with error', async () => { + const client = new automlModule.v1beta1.AutoMlClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.automl.v1beta1.ListColumnSpecsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.automl.v1beta1.ListColumnSpecsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.descriptors.page.listColumnSpecs.createStream = + stubPageStreamingCall(undefined, expectedError); + const stream = client.listColumnSpecsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.automl.v1beta1.ColumnSpec[] = []; + stream.on( + 'data', + (response: protos.google.cloud.automl.v1beta1.ColumnSpec) => { + responses.push(response); + } + ); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert( + (client.descriptors.page.listColumnSpecs.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.listColumnSpecs, request) + ); + assert( + (client.descriptors.page.listColumnSpecs.createStream as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listColumnSpecs without error', async () => { + const client = new automlModule.v1beta1.AutoMlClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.automl.v1beta1.ListColumnSpecsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.automl.v1beta1.ListColumnSpecsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.automl.v1beta1.ColumnSpec() + ), + generateSampleMessage( + new protos.google.cloud.automl.v1beta1.ColumnSpec() + ), + generateSampleMessage( + new protos.google.cloud.automl.v1beta1.ColumnSpec() + ), + ]; + client.descriptors.page.listColumnSpecs.asyncIterate = + stubAsyncIterationCall(expectedResponse); + const responses: protos.google.cloud.automl.v1beta1.IColumnSpec[] = []; + const iterable = client.listColumnSpecsAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + ( + client.descriptors.page.listColumnSpecs.asyncIterate as SinonStub + ).getCall(0).args[1], + request + ); + assert( + (client.descriptors.page.listColumnSpecs.asyncIterate as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listColumnSpecs with error', async () => { + const client = new automlModule.v1beta1.AutoMlClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.automl.v1beta1.ListColumnSpecsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.automl.v1beta1.ListColumnSpecsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.descriptors.page.listColumnSpecs.asyncIterate = + stubAsyncIterationCall(undefined, expectedError); + const iterable = client.listColumnSpecsAsync(request); + await assert.rejects(async () => { + const responses: protos.google.cloud.automl.v1beta1.IColumnSpec[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + ( + client.descriptors.page.listColumnSpecs.asyncIterate as SinonStub + ).getCall(0).args[1], + request + ); + assert( + (client.descriptors.page.listColumnSpecs.asyncIterate as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + }); + + describe('listModels', () => { + it('invokes listModels without error', async () => { + const client = new automlModule.v1beta1.AutoMlClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.automl.v1beta1.ListModelsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.automl.v1beta1.ListModelsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.automl.v1beta1.Model()), + generateSampleMessage(new protos.google.cloud.automl.v1beta1.Model()), + generateSampleMessage(new protos.google.cloud.automl.v1beta1.Model()), + ]; + client.innerApiCalls.listModels = stubSimpleCall(expectedResponse); + const [response] = await client.listModels(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.listModels as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listModels as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listModels without error using callback', async () => { + const client = new automlModule.v1beta1.AutoMlClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.automl.v1beta1.ListModelsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.automl.v1beta1.ListModelsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.automl.v1beta1.Model()), + generateSampleMessage(new protos.google.cloud.automl.v1beta1.Model()), + generateSampleMessage(new protos.google.cloud.automl.v1beta1.Model()), + ]; + client.innerApiCalls.listModels = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.listModels( + request, + ( + err?: Error | null, + result?: protos.google.cloud.automl.v1beta1.IModel[] | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.listModels as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listModels as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listModels with error', async () => { + const client = new automlModule.v1beta1.AutoMlClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.automl.v1beta1.ListModelsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.automl.v1beta1.ListModelsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.listModels = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.listModels(request), expectedError); + const actualRequest = ( + client.innerApiCalls.listModels as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listModels as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listModelsStream without error', async () => { + const client = new automlModule.v1beta1.AutoMlClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.automl.v1beta1.ListModelsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.automl.v1beta1.ListModelsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.automl.v1beta1.Model()), + generateSampleMessage(new protos.google.cloud.automl.v1beta1.Model()), + generateSampleMessage(new protos.google.cloud.automl.v1beta1.Model()), + ]; + client.descriptors.page.listModels.createStream = + stubPageStreamingCall(expectedResponse); + const stream = client.listModelsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.automl.v1beta1.Model[] = []; + stream.on( + 'data', + (response: protos.google.cloud.automl.v1beta1.Model) => { + 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.listModels.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.listModels, request) + ); + assert( + (client.descriptors.page.listModels.createStream as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('invokes listModelsStream with error', async () => { + const client = new automlModule.v1beta1.AutoMlClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.automl.v1beta1.ListModelsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.automl.v1beta1.ListModelsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.descriptors.page.listModels.createStream = stubPageStreamingCall( + undefined, + expectedError + ); + const stream = client.listModelsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.automl.v1beta1.Model[] = []; + stream.on( + 'data', + (response: protos.google.cloud.automl.v1beta1.Model) => { + responses.push(response); + } + ); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert( + (client.descriptors.page.listModels.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.listModels, request) + ); + assert( + (client.descriptors.page.listModels.createStream as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listModels without error', async () => { + const client = new automlModule.v1beta1.AutoMlClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.automl.v1beta1.ListModelsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.automl.v1beta1.ListModelsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.automl.v1beta1.Model()), + generateSampleMessage(new protos.google.cloud.automl.v1beta1.Model()), + generateSampleMessage(new protos.google.cloud.automl.v1beta1.Model()), + ]; + client.descriptors.page.listModels.asyncIterate = + stubAsyncIterationCall(expectedResponse); + const responses: protos.google.cloud.automl.v1beta1.IModel[] = []; + const iterable = client.listModelsAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + (client.descriptors.page.listModels.asyncIterate as SinonStub).getCall( + 0 + ).args[1], + request + ); + assert( + (client.descriptors.page.listModels.asyncIterate as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listModels with error', async () => { + const client = new automlModule.v1beta1.AutoMlClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.automl.v1beta1.ListModelsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.automl.v1beta1.ListModelsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.descriptors.page.listModels.asyncIterate = stubAsyncIterationCall( + undefined, + expectedError + ); + const iterable = client.listModelsAsync(request); + await assert.rejects(async () => { + const responses: protos.google.cloud.automl.v1beta1.IModel[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + (client.descriptors.page.listModels.asyncIterate as SinonStub).getCall( + 0 + ).args[1], + request + ); + assert( + (client.descriptors.page.listModels.asyncIterate as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + }); + + describe('listModelEvaluations', () => { + it('invokes listModelEvaluations without error', async () => { + const client = new automlModule.v1beta1.AutoMlClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.automl.v1beta1.ListModelEvaluationsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.automl.v1beta1.ListModelEvaluationsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.automl.v1beta1.ModelEvaluation() + ), + generateSampleMessage( + new protos.google.cloud.automl.v1beta1.ModelEvaluation() + ), + generateSampleMessage( + new protos.google.cloud.automl.v1beta1.ModelEvaluation() + ), + ]; + client.innerApiCalls.listModelEvaluations = + stubSimpleCall(expectedResponse); + const [response] = await client.listModelEvaluations(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.listModelEvaluations as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listModelEvaluations as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listModelEvaluations without error using callback', async () => { + const client = new automlModule.v1beta1.AutoMlClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.automl.v1beta1.ListModelEvaluationsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.automl.v1beta1.ListModelEvaluationsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.automl.v1beta1.ModelEvaluation() + ), + generateSampleMessage( + new protos.google.cloud.automl.v1beta1.ModelEvaluation() + ), + generateSampleMessage( + new protos.google.cloud.automl.v1beta1.ModelEvaluation() + ), + ]; + client.innerApiCalls.listModelEvaluations = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.listModelEvaluations( + request, + ( + err?: Error | null, + result?: + | protos.google.cloud.automl.v1beta1.IModelEvaluation[] + | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.listModelEvaluations as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listModelEvaluations as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listModelEvaluations with error', async () => { + const client = new automlModule.v1beta1.AutoMlClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.automl.v1beta1.ListModelEvaluationsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.automl.v1beta1.ListModelEvaluationsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.listModelEvaluations = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.listModelEvaluations(request), expectedError); + const actualRequest = ( + client.innerApiCalls.listModelEvaluations as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listModelEvaluations as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listModelEvaluationsStream without error', async () => { + const client = new automlModule.v1beta1.AutoMlClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.automl.v1beta1.ListModelEvaluationsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.automl.v1beta1.ListModelEvaluationsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.automl.v1beta1.ModelEvaluation() + ), + generateSampleMessage( + new protos.google.cloud.automl.v1beta1.ModelEvaluation() + ), + generateSampleMessage( + new protos.google.cloud.automl.v1beta1.ModelEvaluation() + ), + ]; + client.descriptors.page.listModelEvaluations.createStream = + stubPageStreamingCall(expectedResponse); + const stream = client.listModelEvaluationsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.automl.v1beta1.ModelEvaluation[] = + []; + stream.on( + 'data', + (response: protos.google.cloud.automl.v1beta1.ModelEvaluation) => { + 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.listModelEvaluations.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.listModelEvaluations, request) + ); + assert( + (client.descriptors.page.listModelEvaluations.createStream as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('invokes listModelEvaluationsStream with error', async () => { + const client = new automlModule.v1beta1.AutoMlClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.automl.v1beta1.ListModelEvaluationsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.automl.v1beta1.ListModelEvaluationsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.descriptors.page.listModelEvaluations.createStream = + stubPageStreamingCall(undefined, expectedError); + const stream = client.listModelEvaluationsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.automl.v1beta1.ModelEvaluation[] = + []; + stream.on( + 'data', + (response: protos.google.cloud.automl.v1beta1.ModelEvaluation) => { + responses.push(response); + } + ); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert( + (client.descriptors.page.listModelEvaluations.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.listModelEvaluations, request) + ); + assert( + (client.descriptors.page.listModelEvaluations.createStream as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listModelEvaluations without error', async () => { + const client = new automlModule.v1beta1.AutoMlClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.automl.v1beta1.ListModelEvaluationsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.automl.v1beta1.ListModelEvaluationsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.automl.v1beta1.ModelEvaluation() + ), + generateSampleMessage( + new protos.google.cloud.automl.v1beta1.ModelEvaluation() + ), + generateSampleMessage( + new protos.google.cloud.automl.v1beta1.ModelEvaluation() + ), + ]; + client.descriptors.page.listModelEvaluations.asyncIterate = + stubAsyncIterationCall(expectedResponse); + const responses: protos.google.cloud.automl.v1beta1.IModelEvaluation[] = + []; + const iterable = client.listModelEvaluationsAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + ( + client.descriptors.page.listModelEvaluations.asyncIterate as SinonStub + ).getCall(0).args[1], + request + ); + assert( + (client.descriptors.page.listModelEvaluations.asyncIterate as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listModelEvaluations with error', async () => { + const client = new automlModule.v1beta1.AutoMlClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.automl.v1beta1.ListModelEvaluationsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.automl.v1beta1.ListModelEvaluationsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.descriptors.page.listModelEvaluations.asyncIterate = + stubAsyncIterationCall(undefined, expectedError); + const iterable = client.listModelEvaluationsAsync(request); + await assert.rejects(async () => { + const responses: protos.google.cloud.automl.v1beta1.IModelEvaluation[] = + []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + ( + client.descriptors.page.listModelEvaluations.asyncIterate as SinonStub + ).getCall(0).args[1], + request + ); + assert( + (client.descriptors.page.listModelEvaluations.asyncIterate as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + }); + + describe('Path templates', () => { + describe('annotationSpec', () => { + const fakePath = '/rendered/path/annotationSpec'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + dataset: 'datasetValue', + annotation_spec: 'annotationSpecValue', + }; + const client = new automlModule.v1beta1.AutoMlClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.annotationSpecPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.annotationSpecPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('annotationSpecPath', () => { + const result = client.annotationSpecPath( + 'projectValue', + 'locationValue', + 'datasetValue', + 'annotationSpecValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.annotationSpecPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromAnnotationSpecName', () => { + const result = client.matchProjectFromAnnotationSpecName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.annotationSpecPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromAnnotationSpecName', () => { + const result = client.matchLocationFromAnnotationSpecName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.annotationSpecPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchDatasetFromAnnotationSpecName', () => { + const result = client.matchDatasetFromAnnotationSpecName(fakePath); + assert.strictEqual(result, 'datasetValue'); + assert( + (client.pathTemplates.annotationSpecPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchAnnotationSpecFromAnnotationSpecName', () => { + const result = + client.matchAnnotationSpecFromAnnotationSpecName(fakePath); + assert.strictEqual(result, 'annotationSpecValue'); + assert( + (client.pathTemplates.annotationSpecPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('columnSpec', () => { + const fakePath = '/rendered/path/columnSpec'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + dataset: 'datasetValue', + table_spec: 'tableSpecValue', + column_spec: 'columnSpecValue', + }; + const client = new automlModule.v1beta1.AutoMlClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.columnSpecPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.columnSpecPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('columnSpecPath', () => { + const result = client.columnSpecPath( + 'projectValue', + 'locationValue', + 'datasetValue', + 'tableSpecValue', + 'columnSpecValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.columnSpecPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromColumnSpecName', () => { + const result = client.matchProjectFromColumnSpecName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.columnSpecPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromColumnSpecName', () => { + const result = client.matchLocationFromColumnSpecName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.columnSpecPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchDatasetFromColumnSpecName', () => { + const result = client.matchDatasetFromColumnSpecName(fakePath); + assert.strictEqual(result, 'datasetValue'); + assert( + (client.pathTemplates.columnSpecPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchTableSpecFromColumnSpecName', () => { + const result = client.matchTableSpecFromColumnSpecName(fakePath); + assert.strictEqual(result, 'tableSpecValue'); + assert( + (client.pathTemplates.columnSpecPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchColumnSpecFromColumnSpecName', () => { + const result = client.matchColumnSpecFromColumnSpecName(fakePath); + assert.strictEqual(result, 'columnSpecValue'); + assert( + (client.pathTemplates.columnSpecPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('dataset', () => { + const fakePath = '/rendered/path/dataset'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + dataset: 'datasetValue', + }; + const client = new automlModule.v1beta1.AutoMlClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.datasetPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.datasetPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('datasetPath', () => { + const result = client.datasetPath( + 'projectValue', + 'locationValue', + 'datasetValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.datasetPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromDatasetName', () => { + const result = client.matchProjectFromDatasetName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.datasetPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromDatasetName', () => { + const result = client.matchLocationFromDatasetName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.datasetPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchDatasetFromDatasetName', () => { + const result = client.matchDatasetFromDatasetName(fakePath); + assert.strictEqual(result, 'datasetValue'); + assert( + (client.pathTemplates.datasetPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('location', () => { + const fakePath = '/rendered/path/location'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + }; + const client = new automlModule.v1beta1.AutoMlClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + 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('model', () => { + const fakePath = '/rendered/path/model'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + model: 'modelValue', + }; + const client = new automlModule.v1beta1.AutoMlClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.modelPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.modelPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('modelPath', () => { + const result = client.modelPath( + 'projectValue', + 'locationValue', + 'modelValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.modelPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromModelName', () => { + const result = client.matchProjectFromModelName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.modelPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromModelName', () => { + const result = client.matchLocationFromModelName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.modelPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchModelFromModelName', () => { + const result = client.matchModelFromModelName(fakePath); + assert.strictEqual(result, 'modelValue'); + assert( + (client.pathTemplates.modelPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('modelEvaluation', () => { + const fakePath = '/rendered/path/modelEvaluation'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + model: 'modelValue', + model_evaluation: 'modelEvaluationValue', + }; + const client = new automlModule.v1beta1.AutoMlClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.modelEvaluationPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.modelEvaluationPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('modelEvaluationPath', () => { + const result = client.modelEvaluationPath( + 'projectValue', + 'locationValue', + 'modelValue', + 'modelEvaluationValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.modelEvaluationPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromModelEvaluationName', () => { + const result = client.matchProjectFromModelEvaluationName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.modelEvaluationPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromModelEvaluationName', () => { + const result = client.matchLocationFromModelEvaluationName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.modelEvaluationPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchModelFromModelEvaluationName', () => { + const result = client.matchModelFromModelEvaluationName(fakePath); + assert.strictEqual(result, 'modelValue'); + assert( + (client.pathTemplates.modelEvaluationPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchModelEvaluationFromModelEvaluationName', () => { + const result = + client.matchModelEvaluationFromModelEvaluationName(fakePath); + assert.strictEqual(result, 'modelEvaluationValue'); + assert( + (client.pathTemplates.modelEvaluationPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('tableSpec', () => { + const fakePath = '/rendered/path/tableSpec'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + dataset: 'datasetValue', + table_spec: 'tableSpecValue', + }; + const client = new automlModule.v1beta1.AutoMlClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.tableSpecPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.tableSpecPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('tableSpecPath', () => { + const result = client.tableSpecPath( + 'projectValue', + 'locationValue', + 'datasetValue', + 'tableSpecValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.tableSpecPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromTableSpecName', () => { + const result = client.matchProjectFromTableSpecName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.tableSpecPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromTableSpecName', () => { + const result = client.matchLocationFromTableSpecName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.tableSpecPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchDatasetFromTableSpecName', () => { + const result = client.matchDatasetFromTableSpecName(fakePath); + assert.strictEqual(result, 'datasetValue'); + assert( + (client.pathTemplates.tableSpecPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchTableSpecFromTableSpecName', () => { + const result = client.matchTableSpecFromTableSpecName(fakePath); + assert.strictEqual(result, 'tableSpecValue'); + assert( + (client.pathTemplates.tableSpecPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + }); +}); diff --git a/packages/google-cloud-automl/test/gapic_prediction_service_v1.ts b/packages/google-cloud-automl/test/gapic_prediction_service_v1.ts new file mode 100644 index 00000000000..71b641a384e --- /dev/null +++ b/packages/google-cloud-automl/test/gapic_prediction_service_v1.ts @@ -0,0 +1,799 @@ +// Copyright 2023 Google LLC +// +// Licensed under the Apache License, Version 2.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 predictionserviceModule from '../src'; + +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 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); +} + +describe('v1.PredictionServiceClient', () => { + describe('Common methods', () => { + it('has servicePath', () => { + const servicePath = + predictionserviceModule.v1.PredictionServiceClient.servicePath; + assert(servicePath); + }); + + it('has apiEndpoint', () => { + const apiEndpoint = + predictionserviceModule.v1.PredictionServiceClient.apiEndpoint; + assert(apiEndpoint); + }); + + it('has port', () => { + const port = predictionserviceModule.v1.PredictionServiceClient.port; + assert(port); + assert(typeof port === 'number'); + }); + + it('should create a client with no option', () => { + const client = new predictionserviceModule.v1.PredictionServiceClient(); + assert(client); + }); + + it('should create a client with gRPC fallback', () => { + const client = new predictionserviceModule.v1.PredictionServiceClient({ + fallback: true, + }); + assert(client); + }); + + it('has initialize method and supports deferred initialization', async () => { + const client = new predictionserviceModule.v1.PredictionServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + assert.strictEqual(client.predictionServiceStub, undefined); + await client.initialize(); + assert(client.predictionServiceStub); + }); + + it('has close method for the initialized client', done => { + const client = new predictionserviceModule.v1.PredictionServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + assert(client.predictionServiceStub); + client.close().then(() => { + done(); + }); + }); + + it('has close method for the non-initialized client', done => { + const client = new predictionserviceModule.v1.PredictionServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + assert.strictEqual(client.predictionServiceStub, undefined); + client.close().then(() => { + done(); + }); + }); + + it('has getProjectId method', async () => { + const fakeProjectId = 'fake-project-id'; + const client = new predictionserviceModule.v1.PredictionServiceClient({ + 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 predictionserviceModule.v1.PredictionServiceClient({ + 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('predict', () => { + it('invokes predict without error', async () => { + const client = new predictionserviceModule.v1.PredictionServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.automl.v1.PredictRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.automl.v1.PredictRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.automl.v1.PredictResponse() + ); + client.innerApiCalls.predict = stubSimpleCall(expectedResponse); + const [response] = await client.predict(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.predict as SinonStub).getCall( + 0 + ).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.predict as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes predict without error using callback', async () => { + const client = new predictionserviceModule.v1.PredictionServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.automl.v1.PredictRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.automl.v1.PredictRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.automl.v1.PredictResponse() + ); + client.innerApiCalls.predict = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.predict( + request, + ( + err?: Error | null, + result?: protos.google.cloud.automl.v1.IPredictResponse | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.predict as SinonStub).getCall( + 0 + ).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.predict as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes predict with error', async () => { + const client = new predictionserviceModule.v1.PredictionServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.automl.v1.PredictRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.automl.v1.PredictRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.predict = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.predict(request), expectedError); + const actualRequest = (client.innerApiCalls.predict as SinonStub).getCall( + 0 + ).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.predict as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes predict with closed client', async () => { + const client = new predictionserviceModule.v1.PredictionServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.automl.v1.PredictRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.automl.v1.PredictRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.predict(request), expectedError); + }); + }); + + describe('batchPredict', () => { + it('invokes batchPredict without error', async () => { + const client = new predictionserviceModule.v1.PredictionServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.automl.v1.BatchPredictRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.automl.v1.BatchPredictRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.batchPredict = stubLongRunningCall(expectedResponse); + const [operation] = await client.batchPredict(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.batchPredict as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.batchPredict as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes batchPredict without error using callback', async () => { + const client = new predictionserviceModule.v1.PredictionServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.automl.v1.BatchPredictRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.automl.v1.BatchPredictRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.batchPredict = + stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.batchPredict( + request, + ( + err?: Error | null, + result?: LROperation< + protos.google.cloud.automl.v1.IBatchPredictResult, + protos.google.cloud.automl.v1.IOperationMetadata + > | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const operation = (await promise) as LROperation< + protos.google.cloud.automl.v1.IBatchPredictResult, + protos.google.cloud.automl.v1.IOperationMetadata + >; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.batchPredict as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.batchPredict as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes batchPredict with call error', async () => { + const client = new predictionserviceModule.v1.PredictionServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.automl.v1.BatchPredictRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.automl.v1.BatchPredictRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.batchPredict = stubLongRunningCall( + undefined, + expectedError + ); + await assert.rejects(client.batchPredict(request), expectedError); + const actualRequest = ( + client.innerApiCalls.batchPredict as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.batchPredict as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes batchPredict with LRO error', async () => { + const client = new predictionserviceModule.v1.PredictionServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.automl.v1.BatchPredictRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.automl.v1.BatchPredictRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.batchPredict = stubLongRunningCall( + undefined, + undefined, + expectedError + ); + const [operation] = await client.batchPredict(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = ( + client.innerApiCalls.batchPredict as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.batchPredict as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkBatchPredictProgress without error', async () => { + const client = new predictionserviceModule.v1.PredictionServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + 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.checkBatchPredictProgress( + expectedResponse.name + ); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkBatchPredictProgress with error', async () => { + const client = new predictionserviceModule.v1.PredictionServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const expectedError = new Error('expected'); + + client.operationsClient.getOperation = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.checkBatchPredictProgress(''), expectedError); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + }); + + describe('Path templates', () => { + describe('annotationSpec', () => { + const fakePath = '/rendered/path/annotationSpec'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + dataset: 'datasetValue', + annotation_spec: 'annotationSpecValue', + }; + const client = new predictionserviceModule.v1.PredictionServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.annotationSpecPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.annotationSpecPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('annotationSpecPath', () => { + const result = client.annotationSpecPath( + 'projectValue', + 'locationValue', + 'datasetValue', + 'annotationSpecValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.annotationSpecPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromAnnotationSpecName', () => { + const result = client.matchProjectFromAnnotationSpecName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.annotationSpecPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromAnnotationSpecName', () => { + const result = client.matchLocationFromAnnotationSpecName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.annotationSpecPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchDatasetFromAnnotationSpecName', () => { + const result = client.matchDatasetFromAnnotationSpecName(fakePath); + assert.strictEqual(result, 'datasetValue'); + assert( + (client.pathTemplates.annotationSpecPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchAnnotationSpecFromAnnotationSpecName', () => { + const result = + client.matchAnnotationSpecFromAnnotationSpecName(fakePath); + assert.strictEqual(result, 'annotationSpecValue'); + assert( + (client.pathTemplates.annotationSpecPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('dataset', () => { + const fakePath = '/rendered/path/dataset'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + dataset: 'datasetValue', + }; + const client = new predictionserviceModule.v1.PredictionServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.datasetPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.datasetPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('datasetPath', () => { + const result = client.datasetPath( + 'projectValue', + 'locationValue', + 'datasetValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.datasetPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromDatasetName', () => { + const result = client.matchProjectFromDatasetName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.datasetPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromDatasetName', () => { + const result = client.matchLocationFromDatasetName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.datasetPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchDatasetFromDatasetName', () => { + const result = client.matchDatasetFromDatasetName(fakePath); + assert.strictEqual(result, 'datasetValue'); + assert( + (client.pathTemplates.datasetPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('model', () => { + const fakePath = '/rendered/path/model'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + model: 'modelValue', + }; + const client = new predictionserviceModule.v1.PredictionServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.modelPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.modelPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('modelPath', () => { + const result = client.modelPath( + 'projectValue', + 'locationValue', + 'modelValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.modelPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromModelName', () => { + const result = client.matchProjectFromModelName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.modelPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromModelName', () => { + const result = client.matchLocationFromModelName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.modelPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchModelFromModelName', () => { + const result = client.matchModelFromModelName(fakePath); + assert.strictEqual(result, 'modelValue'); + assert( + (client.pathTemplates.modelPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('modelEvaluation', () => { + const fakePath = '/rendered/path/modelEvaluation'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + model: 'modelValue', + model_evaluation: 'modelEvaluationValue', + }; + const client = new predictionserviceModule.v1.PredictionServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.modelEvaluationPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.modelEvaluationPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('modelEvaluationPath', () => { + const result = client.modelEvaluationPath( + 'projectValue', + 'locationValue', + 'modelValue', + 'modelEvaluationValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.modelEvaluationPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromModelEvaluationName', () => { + const result = client.matchProjectFromModelEvaluationName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.modelEvaluationPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromModelEvaluationName', () => { + const result = client.matchLocationFromModelEvaluationName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.modelEvaluationPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchModelFromModelEvaluationName', () => { + const result = client.matchModelFromModelEvaluationName(fakePath); + assert.strictEqual(result, 'modelValue'); + assert( + (client.pathTemplates.modelEvaluationPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchModelEvaluationFromModelEvaluationName', () => { + const result = + client.matchModelEvaluationFromModelEvaluationName(fakePath); + assert.strictEqual(result, 'modelEvaluationValue'); + assert( + (client.pathTemplates.modelEvaluationPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + }); +}); diff --git a/packages/google-cloud-automl/test/gapic_prediction_service_v1beta1.ts b/packages/google-cloud-automl/test/gapic_prediction_service_v1beta1.ts new file mode 100644 index 00000000000..8a1b8804682 --- /dev/null +++ b/packages/google-cloud-automl/test/gapic_prediction_service_v1beta1.ts @@ -0,0 +1,986 @@ +// Copyright 2023 Google LLC +// +// Licensed under the Apache License, Version 2.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 predictionserviceModule from '../src'; + +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 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); +} + +describe('v1beta1.PredictionServiceClient', () => { + describe('Common methods', () => { + it('has servicePath', () => { + const servicePath = + predictionserviceModule.v1beta1.PredictionServiceClient.servicePath; + assert(servicePath); + }); + + it('has apiEndpoint', () => { + const apiEndpoint = + predictionserviceModule.v1beta1.PredictionServiceClient.apiEndpoint; + assert(apiEndpoint); + }); + + it('has port', () => { + const port = predictionserviceModule.v1beta1.PredictionServiceClient.port; + assert(port); + assert(typeof port === 'number'); + }); + + it('should create a client with no option', () => { + const client = + new predictionserviceModule.v1beta1.PredictionServiceClient(); + assert(client); + }); + + it('should create a client with gRPC fallback', () => { + const client = + new predictionserviceModule.v1beta1.PredictionServiceClient({ + fallback: true, + }); + assert(client); + }); + + it('has initialize method and supports deferred initialization', async () => { + const client = + new predictionserviceModule.v1beta1.PredictionServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + assert.strictEqual(client.predictionServiceStub, undefined); + await client.initialize(); + assert(client.predictionServiceStub); + }); + + it('has close method for the initialized client', done => { + const client = + new predictionserviceModule.v1beta1.PredictionServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + assert(client.predictionServiceStub); + client.close().then(() => { + done(); + }); + }); + + it('has close method for the non-initialized client', done => { + const client = + new predictionserviceModule.v1beta1.PredictionServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + assert.strictEqual(client.predictionServiceStub, undefined); + client.close().then(() => { + done(); + }); + }); + + it('has getProjectId method', async () => { + const fakeProjectId = 'fake-project-id'; + const client = + new predictionserviceModule.v1beta1.PredictionServiceClient({ + 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 predictionserviceModule.v1beta1.PredictionServiceClient({ + 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('predict', () => { + it('invokes predict without error', async () => { + const client = + new predictionserviceModule.v1beta1.PredictionServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.automl.v1beta1.PredictRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.automl.v1beta1.PredictRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.automl.v1beta1.PredictResponse() + ); + client.innerApiCalls.predict = stubSimpleCall(expectedResponse); + const [response] = await client.predict(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.predict as SinonStub).getCall( + 0 + ).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.predict as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes predict without error using callback', async () => { + const client = + new predictionserviceModule.v1beta1.PredictionServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.automl.v1beta1.PredictRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.automl.v1beta1.PredictRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.automl.v1beta1.PredictResponse() + ); + client.innerApiCalls.predict = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.predict( + request, + ( + err?: Error | null, + result?: protos.google.cloud.automl.v1beta1.IPredictResponse | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.predict as SinonStub).getCall( + 0 + ).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.predict as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes predict with error', async () => { + const client = + new predictionserviceModule.v1beta1.PredictionServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.automl.v1beta1.PredictRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.automl.v1beta1.PredictRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.predict = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.predict(request), expectedError); + const actualRequest = (client.innerApiCalls.predict as SinonStub).getCall( + 0 + ).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.predict as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes predict with closed client', async () => { + const client = + new predictionserviceModule.v1beta1.PredictionServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.automl.v1beta1.PredictRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.automl.v1beta1.PredictRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.predict(request), expectedError); + }); + }); + + describe('batchPredict', () => { + it('invokes batchPredict without error', async () => { + const client = + new predictionserviceModule.v1beta1.PredictionServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.automl.v1beta1.BatchPredictRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.automl.v1beta1.BatchPredictRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.batchPredict = stubLongRunningCall(expectedResponse); + const [operation] = await client.batchPredict(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.batchPredict as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.batchPredict as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes batchPredict without error using callback', async () => { + const client = + new predictionserviceModule.v1beta1.PredictionServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.automl.v1beta1.BatchPredictRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.automl.v1beta1.BatchPredictRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.batchPredict = + stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.batchPredict( + request, + ( + err?: Error | null, + result?: LROperation< + protos.google.cloud.automl.v1beta1.IBatchPredictResult, + protos.google.cloud.automl.v1beta1.IOperationMetadata + > | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const operation = (await promise) as LROperation< + protos.google.cloud.automl.v1beta1.IBatchPredictResult, + protos.google.cloud.automl.v1beta1.IOperationMetadata + >; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.batchPredict as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.batchPredict as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes batchPredict with call error', async () => { + const client = + new predictionserviceModule.v1beta1.PredictionServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.automl.v1beta1.BatchPredictRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.automl.v1beta1.BatchPredictRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.batchPredict = stubLongRunningCall( + undefined, + expectedError + ); + await assert.rejects(client.batchPredict(request), expectedError); + const actualRequest = ( + client.innerApiCalls.batchPredict as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.batchPredict as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes batchPredict with LRO error', async () => { + const client = + new predictionserviceModule.v1beta1.PredictionServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.automl.v1beta1.BatchPredictRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.automl.v1beta1.BatchPredictRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.batchPredict = stubLongRunningCall( + undefined, + undefined, + expectedError + ); + const [operation] = await client.batchPredict(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = ( + client.innerApiCalls.batchPredict as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.batchPredict as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkBatchPredictProgress without error', async () => { + const client = + new predictionserviceModule.v1beta1.PredictionServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + 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.checkBatchPredictProgress( + expectedResponse.name + ); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkBatchPredictProgress with error', async () => { + const client = + new predictionserviceModule.v1beta1.PredictionServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const expectedError = new Error('expected'); + + client.operationsClient.getOperation = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.checkBatchPredictProgress(''), expectedError); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + }); + + describe('Path templates', () => { + describe('annotationSpec', () => { + const fakePath = '/rendered/path/annotationSpec'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + dataset: 'datasetValue', + annotation_spec: 'annotationSpecValue', + }; + const client = + new predictionserviceModule.v1beta1.PredictionServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.annotationSpecPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.annotationSpecPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('annotationSpecPath', () => { + const result = client.annotationSpecPath( + 'projectValue', + 'locationValue', + 'datasetValue', + 'annotationSpecValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.annotationSpecPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromAnnotationSpecName', () => { + const result = client.matchProjectFromAnnotationSpecName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.annotationSpecPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromAnnotationSpecName', () => { + const result = client.matchLocationFromAnnotationSpecName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.annotationSpecPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchDatasetFromAnnotationSpecName', () => { + const result = client.matchDatasetFromAnnotationSpecName(fakePath); + assert.strictEqual(result, 'datasetValue'); + assert( + (client.pathTemplates.annotationSpecPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchAnnotationSpecFromAnnotationSpecName', () => { + const result = + client.matchAnnotationSpecFromAnnotationSpecName(fakePath); + assert.strictEqual(result, 'annotationSpecValue'); + assert( + (client.pathTemplates.annotationSpecPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('columnSpec', () => { + const fakePath = '/rendered/path/columnSpec'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + dataset: 'datasetValue', + table_spec: 'tableSpecValue', + column_spec: 'columnSpecValue', + }; + const client = + new predictionserviceModule.v1beta1.PredictionServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.columnSpecPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.columnSpecPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('columnSpecPath', () => { + const result = client.columnSpecPath( + 'projectValue', + 'locationValue', + 'datasetValue', + 'tableSpecValue', + 'columnSpecValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.columnSpecPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromColumnSpecName', () => { + const result = client.matchProjectFromColumnSpecName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.columnSpecPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromColumnSpecName', () => { + const result = client.matchLocationFromColumnSpecName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.columnSpecPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchDatasetFromColumnSpecName', () => { + const result = client.matchDatasetFromColumnSpecName(fakePath); + assert.strictEqual(result, 'datasetValue'); + assert( + (client.pathTemplates.columnSpecPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchTableSpecFromColumnSpecName', () => { + const result = client.matchTableSpecFromColumnSpecName(fakePath); + assert.strictEqual(result, 'tableSpecValue'); + assert( + (client.pathTemplates.columnSpecPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchColumnSpecFromColumnSpecName', () => { + const result = client.matchColumnSpecFromColumnSpecName(fakePath); + assert.strictEqual(result, 'columnSpecValue'); + assert( + (client.pathTemplates.columnSpecPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('dataset', () => { + const fakePath = '/rendered/path/dataset'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + dataset: 'datasetValue', + }; + const client = + new predictionserviceModule.v1beta1.PredictionServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.datasetPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.datasetPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('datasetPath', () => { + const result = client.datasetPath( + 'projectValue', + 'locationValue', + 'datasetValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.datasetPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromDatasetName', () => { + const result = client.matchProjectFromDatasetName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.datasetPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromDatasetName', () => { + const result = client.matchLocationFromDatasetName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.datasetPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchDatasetFromDatasetName', () => { + const result = client.matchDatasetFromDatasetName(fakePath); + assert.strictEqual(result, 'datasetValue'); + assert( + (client.pathTemplates.datasetPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('model', () => { + const fakePath = '/rendered/path/model'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + model: 'modelValue', + }; + const client = + new predictionserviceModule.v1beta1.PredictionServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.modelPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.modelPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('modelPath', () => { + const result = client.modelPath( + 'projectValue', + 'locationValue', + 'modelValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.modelPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromModelName', () => { + const result = client.matchProjectFromModelName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.modelPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromModelName', () => { + const result = client.matchLocationFromModelName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.modelPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchModelFromModelName', () => { + const result = client.matchModelFromModelName(fakePath); + assert.strictEqual(result, 'modelValue'); + assert( + (client.pathTemplates.modelPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('modelEvaluation', () => { + const fakePath = '/rendered/path/modelEvaluation'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + model: 'modelValue', + model_evaluation: 'modelEvaluationValue', + }; + const client = + new predictionserviceModule.v1beta1.PredictionServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.modelEvaluationPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.modelEvaluationPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('modelEvaluationPath', () => { + const result = client.modelEvaluationPath( + 'projectValue', + 'locationValue', + 'modelValue', + 'modelEvaluationValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.modelEvaluationPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromModelEvaluationName', () => { + const result = client.matchProjectFromModelEvaluationName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.modelEvaluationPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromModelEvaluationName', () => { + const result = client.matchLocationFromModelEvaluationName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.modelEvaluationPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchModelFromModelEvaluationName', () => { + const result = client.matchModelFromModelEvaluationName(fakePath); + assert.strictEqual(result, 'modelValue'); + assert( + (client.pathTemplates.modelEvaluationPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchModelEvaluationFromModelEvaluationName', () => { + const result = + client.matchModelEvaluationFromModelEvaluationName(fakePath); + assert.strictEqual(result, 'modelEvaluationValue'); + assert( + (client.pathTemplates.modelEvaluationPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('tableSpec', () => { + const fakePath = '/rendered/path/tableSpec'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + dataset: 'datasetValue', + table_spec: 'tableSpecValue', + }; + const client = + new predictionserviceModule.v1beta1.PredictionServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.tableSpecPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.tableSpecPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('tableSpecPath', () => { + const result = client.tableSpecPath( + 'projectValue', + 'locationValue', + 'datasetValue', + 'tableSpecValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.tableSpecPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromTableSpecName', () => { + const result = client.matchProjectFromTableSpecName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.tableSpecPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromTableSpecName', () => { + const result = client.matchLocationFromTableSpecName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.tableSpecPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchDatasetFromTableSpecName', () => { + const result = client.matchDatasetFromTableSpecName(fakePath); + assert.strictEqual(result, 'datasetValue'); + assert( + (client.pathTemplates.tableSpecPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchTableSpecFromTableSpecName', () => { + const result = client.matchTableSpecFromTableSpecName(fakePath); + assert.strictEqual(result, 'tableSpecValue'); + assert( + (client.pathTemplates.tableSpecPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + }); +}); diff --git a/packages/google-cloud-automl/tsconfig.json b/packages/google-cloud-automl/tsconfig.json new file mode 100644 index 00000000000..c78f1c884ef --- /dev/null +++ b/packages/google-cloud-automl/tsconfig.json @@ -0,0 +1,19 @@ +{ + "extends": "./node_modules/gts/tsconfig-google.json", + "compilerOptions": { + "rootDir": ".", + "outDir": "build", + "resolveJsonModule": true, + "lib": [ + "es2018", + "dom" + ] + }, + "include": [ + "src/*.ts", + "src/**/*.ts", + "test/*.ts", + "test/**/*.ts", + "system-test/*.ts" + ] +} diff --git a/packages/google-cloud-automl/webpack.config.js b/packages/google-cloud-automl/webpack.config.js new file mode 100644 index 00000000000..d8f4d4f6c9b --- /dev/null +++ b/packages/google-cloud-automl/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: 'automl', + filename: './automl.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/google-cloud-bigquery-datatransfer/protos/google/cloud/bigquery/datatransfer/v1/transfer.proto b/packages/google-cloud-bigquery-datatransfer/protos/google/cloud/bigquery/datatransfer/v1/transfer.proto index 7bcf8f54978..e65b536bc26 100644 --- a/packages/google-cloud-bigquery-datatransfer/protos/google/cloud/bigquery/datatransfer/v1/transfer.proto +++ b/packages/google-cloud-bigquery-datatransfer/protos/google/cloud/bigquery/datatransfer/v1/transfer.proto @@ -118,9 +118,10 @@ message TransferConfig { }; // The resource name of the transfer config. - // Transfer config names have the form - // `projects/{project_id}/locations/{region}/transferConfigs/{config_id}`. - // Where `config_id` is usually a uuid, even though it is not + // Transfer config names have the form either + // `projects/{project_id}/locations/{region}/transferConfigs/{config_id}` or + // `projects/{project_id}/transferConfigs/{config_id}`, + // where `config_id` is usually a UUID, even though it is not // guaranteed or required. The name is ignored when creating a transfer // config. string name = 1; diff --git a/packages/google-cloud-channel/CHANGELOG.md b/packages/google-cloud-channel/CHANGELOG.md index 48c0fd93dff..d187606d712 100644 --- a/packages/google-cloud-channel/CHANGELOG.md +++ b/packages/google-cloud-channel/CHANGELOG.md @@ -1,5 +1,12 @@ # Changelog +## [3.1.0](https://github.com/googleapis/google-cloud-node/compare/channel-v3.0.1...channel-v3.1.0) (2023-09-11) + + +### Features + +* [channel] mark ChannelPartnerGranularity as deprecated and offer alternatives ([#4623](https://github.com/googleapis/google-cloud-node/issues/4623)) ([0805d0f](https://github.com/googleapis/google-cloud-node/commit/0805d0f4417a853f5c0f365f357f078f8c481c17)) + ## [3.0.1](https://github.com/googleapis/google-cloud-node/compare/channel-v3.0.0...channel-v3.0.1) (2023-09-06) diff --git a/packages/google-cloud-channel/README.md b/packages/google-cloud-channel/README.md index 65de8752f97..e4d2a80185a 100644 --- a/packages/google-cloud-channel/README.md +++ b/packages/google-cloud-channel/README.md @@ -215,6 +215,7 @@ Samples are in the [`samples/`](https://github.com/googleapis/google-cloud-node/ | Cloud_channel_service.list_transferable_skus | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-channel/samples/generated/v1/cloud_channel_service.list_transferable_skus.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-cloud-channel/samples/generated/v1/cloud_channel_service.list_transferable_skus.js,packages/google-cloud-channel/samples/README.md) | | Cloud_channel_service.lookup_offer | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-channel/samples/generated/v1/cloud_channel_service.lookup_offer.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-cloud-channel/samples/generated/v1/cloud_channel_service.lookup_offer.js,packages/google-cloud-channel/samples/README.md) | | Cloud_channel_service.provision_cloud_identity | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-channel/samples/generated/v1/cloud_channel_service.provision_cloud_identity.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-cloud-channel/samples/generated/v1/cloud_channel_service.provision_cloud_identity.js,packages/google-cloud-channel/samples/README.md) | +| Cloud_channel_service.query_eligible_billing_accounts | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-channel/samples/generated/v1/cloud_channel_service.query_eligible_billing_accounts.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-cloud-channel/samples/generated/v1/cloud_channel_service.query_eligible_billing_accounts.js,packages/google-cloud-channel/samples/README.md) | | Cloud_channel_service.register_subscriber | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-channel/samples/generated/v1/cloud_channel_service.register_subscriber.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-cloud-channel/samples/generated/v1/cloud_channel_service.register_subscriber.js,packages/google-cloud-channel/samples/README.md) | | Cloud_channel_service.start_paid_service | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-channel/samples/generated/v1/cloud_channel_service.start_paid_service.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-cloud-channel/samples/generated/v1/cloud_channel_service.start_paid_service.js,packages/google-cloud-channel/samples/README.md) | | Cloud_channel_service.suspend_entitlement | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-channel/samples/generated/v1/cloud_channel_service.suspend_entitlement.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-cloud-channel/samples/generated/v1/cloud_channel_service.suspend_entitlement.js,packages/google-cloud-channel/samples/README.md) | diff --git a/packages/google-cloud-channel/package.json b/packages/google-cloud-channel/package.json index aa5f2112e38..72d6a602e65 100644 --- a/packages/google-cloud-channel/package.json +++ b/packages/google-cloud-channel/package.json @@ -1,6 +1,6 @@ { "name": "@google-cloud/channel", - "version": "3.0.1", + "version": "3.1.0", "description": "Channel client for Node.js", "repository": { "type": "git", diff --git a/packages/google-cloud-channel/protos/google/cloud/channel/v1/billing_accounts.proto b/packages/google-cloud-channel/protos/google/cloud/channel/v1/billing_accounts.proto new file mode 100644 index 00000000000..7ab8ba006a6 --- /dev/null +++ b/packages/google-cloud-channel/protos/google/cloud/channel/v1/billing_accounts.proto @@ -0,0 +1,51 @@ +// Copyright 2023 Google LLC +// +// Licensed under the Apache License, Version 2.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.channel.v1; + +import "google/api/field_behavior.proto"; +import "google/api/resource.proto"; +import "google/protobuf/timestamp.proto"; + +option go_package = "cloud.google.com/go/channel/apiv1/channelpb;channelpb"; +option java_multiple_files = true; +option java_outer_classname = "BillingAccountsProto"; +option java_package = "com.google.cloud.channel.v1"; + +// Represents a billing account. +message BillingAccount { + option (google.api.resource) = { + type: "cloudchannel.googleapis.com/BillingAccount" + pattern: "accounts/{account}/billingAccounts/{billing_account}" + }; + + // Output only. Resource name of the billing account. + // Format: accounts/{account_id}/billingAccounts/{billing_account_id}. + string name = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Display name of the billing account. + string display_name = 2; + + // Output only. The time when this billing account was created. + google.protobuf.Timestamp create_time = 3 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The 3-letter currency code defined in ISO 4217. + string currency_code = 4 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The CLDR region code. + string region_code = 5 [(google.api.field_behavior) = OUTPUT_ONLY]; +} diff --git a/packages/google-cloud-channel/protos/google/cloud/channel/v1/customers.proto b/packages/google-cloud-channel/protos/google/cloud/channel/v1/customers.proto index 02ad3f55e9b..304a0749659 100644 --- a/packages/google-cloud-channel/protos/google/cloud/channel/v1/customers.proto +++ b/packages/google-cloud-channel/protos/google/cloud/channel/v1/customers.proto @@ -42,9 +42,9 @@ message Customer { string org_display_name = 2 [(google.api.field_behavior) = REQUIRED]; // Required. The organization address for the customer. To enforce US laws and - // embargoes, we require a region and zip code. You must provide valid - // addresses for every customer. To set the customer's language, use the - // Customer-level language code. + // embargoes, we require a region, postal code, and address lines. You must + // provide valid addresses for every customer. To set the customer's + // language, use the Customer-level language code. google.type.PostalAddress org_postal_address = 3 [(google.api.field_behavior) = REQUIRED]; diff --git a/packages/google-cloud-channel/protos/google/cloud/channel/v1/entitlements.proto b/packages/google-cloud-channel/protos/google/cloud/channel/v1/entitlements.proto index 82834312cee..f0b168922c8 100644 --- a/packages/google-cloud-channel/protos/google/cloud/channel/v1/entitlements.proto +++ b/packages/google-cloud-channel/protos/google/cloud/channel/v1/entitlements.proto @@ -175,7 +175,7 @@ message AssociationInfo { message ProvisionedService { // Output only. Provisioning ID of the entitlement. For Google Workspace, this // is the underlying Subscription ID. For Google Cloud, this is the Billing - // Account ID of the billing subaccount." + // Account ID of the billing subaccount. string provisioning_id = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; // Output only. The product pertaining to the provisioning resource as @@ -262,6 +262,10 @@ message TransferEligibility { // SKU subscription is suspended SKU_SUSPENDED = 3; + + // The reseller is not authorized to transact on this Product. See + // https://support.google.com/channelservices/answer/9759265 + CHANNEL_PARTNER_NOT_AUTHORIZED_FOR_SKU = 4; } // Whether reseller is eligible to transfer the SKU. diff --git a/packages/google-cloud-channel/protos/google/cloud/channel/v1/offers.proto b/packages/google-cloud-channel/protos/google/cloud/channel/v1/offers.proto index 930925a5df9..6f40198e03e 100644 --- a/packages/google-cloud-channel/protos/google/cloud/channel/v1/offers.proto +++ b/packages/google-cloud-channel/protos/google/cloud/channel/v1/offers.proto @@ -181,6 +181,9 @@ message ParameterDefinition { // Double type. DOUBLE = 3; + + // Boolean type. + BOOLEAN = 4; } // Name of the parameter. diff --git a/packages/google-cloud-channel/protos/google/cloud/channel/v1/repricing.proto b/packages/google-cloud-channel/protos/google/cloud/channel/v1/repricing.proto index a88b1bc6619..c452619a622 100644 --- a/packages/google-cloud-channel/protos/google/cloud/channel/v1/repricing.proto +++ b/packages/google-cloud-channel/protos/google/cloud/channel/v1/repricing.proto @@ -106,17 +106,39 @@ message RepricingConfig { // Applies the repricing configuration at the channel partner level. // The channel partner value is derived from the resource name. Takes an // empty json object. - message ChannelPartnerGranularity {} + // Deprecated: This is no longer supported. Use + // [RepricingConfig.EntitlementGranularity][google.cloud.channel.v1.RepricingConfig.EntitlementGranularity] + // instead. + message ChannelPartnerGranularity { + option deprecated = true; + } // Required. Defines the granularity for repricing. oneof granularity { - // Applies the repricing configuration at the entitlement level. This is - // the only supported value for CustomerRepricingConfig. + // Applies the repricing configuration at the entitlement level. + // + // Note: If a + // [ChannelPartnerRepricingConfig][google.cloud.channel.v1.ChannelPartnerRepricingConfig] + // using + // [RepricingConfig.EntitlementGranularity][google.cloud.channel.v1.RepricingConfig.EntitlementGranularity] + // becomes effective, then no existing or future + // [RepricingConfig.ChannelPartnerGranularity][google.cloud.channel.v1.RepricingConfig.ChannelPartnerGranularity] + // will apply to the + // [RepricingConfig.EntitlementGranularity.entitlement][google.cloud.channel.v1.RepricingConfig.EntitlementGranularity.entitlement]. + // This is the recommended value for both + // [CustomerRepricingConfig][google.cloud.channel.v1.CustomerRepricingConfig] + // and + // [ChannelPartnerRepricingConfig][google.cloud.channel.v1.ChannelPartnerRepricingConfig]. EntitlementGranularity entitlement_granularity = 4; // Applies the repricing configuration at the channel partner level. - // This is the only supported value for ChannelPartnerRepricingConfig. - ChannelPartnerGranularity channel_partner_granularity = 5; + // Only + // [ChannelPartnerRepricingConfig][google.cloud.channel.v1.ChannelPartnerRepricingConfig] + // supports this value. Deprecated: This is no longer supported. Use + // [RepricingConfig.entitlement_granularity][google.cloud.channel.v1.RepricingConfig.entitlement_granularity] + // instead. + ChannelPartnerGranularity channel_partner_granularity = 5 + [deprecated = true]; } // Required. The YearMonth when these adjustments activate. The Day field diff --git a/packages/google-cloud-channel/protos/google/cloud/channel/v1/service.proto b/packages/google-cloud-channel/protos/google/cloud/channel/v1/service.proto index eee63aea794..98aa066f737 100644 --- a/packages/google-cloud-channel/protos/google/cloud/channel/v1/service.proto +++ b/packages/google-cloud-channel/protos/google/cloud/channel/v1/service.proto @@ -20,6 +20,7 @@ import "google/api/annotations.proto"; import "google/api/client.proto"; import "google/api/field_behavior.proto"; import "google/api/resource.proto"; +import "google/cloud/channel/v1/billing_accounts.proto"; import "google/cloud/channel/v1/channel_partner_links.proto"; import "google/cloud/channel/v1/common.proto"; import "google/cloud/channel/v1/customers.proto"; @@ -138,8 +139,11 @@ service CloudChannelService { // // Possible error codes: // - // * PERMISSION_DENIED: The reseller account making the request is different - // from the reseller account in the API request. + // * PERMISSION_DENIED: + // * The reseller account making the request is different from the + // reseller account in the API request. + // * You are not authorized to create a customer. See + // https://support.google.com/channelservices/answer/9759265 // * INVALID_ARGUMENT: // * Required request parameters are missing or invalid. // * Domain field value doesn't match the primary email domain. @@ -208,8 +212,11 @@ service CloudChannelService { // // Possible error codes: // - // * PERMISSION_DENIED: The reseller account making the request is different - // from the reseller account in the API request. + // * PERMISSION_DENIED: + // * The reseller account making the request is different from the + // reseller account in the API request. + // * You are not authorized to import the customer. See + // https://support.google.com/channelservices/answer/9759265 // * NOT_FOUND: Cloud Identity doesn't exist or was deleted. // * INVALID_ARGUMENT: Required parameters are missing, or the auth_token is // expired or invalid. @@ -234,7 +241,10 @@ service CloudChannelService { // // Possible error codes: // - // * PERMISSION_DENIED: The customer doesn't belong to the reseller. + // * PERMISSION_DENIED: + // * The customer doesn't belong to the reseller. + // * You are not authorized to provision cloud identity id. See + // https://support.google.com/channelservices/answer/9759265 // * INVALID_ARGUMENT: Required request parameters are missing or invalid. // * NOT_FOUND: The customer was not found. // * ALREADY_EXISTS: The customer's primary email already exists. Retry @@ -322,6 +332,8 @@ service CloudChannelService { // auth token. // * The reseller account making the request is different // from the reseller account in the query. + // * The reseller is not authorized to transact on this Product. See + // https://support.google.com/channelservices/answer/9759265 // * INVALID_ARGUMENT: Required request parameters are missing or invalid. // // Return value: @@ -356,7 +368,10 @@ service CloudChannelService { // // Possible error codes: // - // * PERMISSION_DENIED: The customer doesn't belong to the reseller. + // * PERMISSION_DENIED: + // * The customer doesn't belong to the reseller. + // * The reseller is not authorized to transact on this Product. See + // https://support.google.com/channelservices/answer/9759265 // * INVALID_ARGUMENT: // * Required request parameters are missing or invalid. // * There is already a customer entitlement for a SKU from the same @@ -652,7 +667,10 @@ service CloudChannelService { // // Possible error codes: // - // * PERMISSION_DENIED: The customer doesn't belong to the reseller. + // * PERMISSION_DENIED: + // * The customer doesn't belong to the reseller. + // * The reseller is not authorized to transact on this Product. See + // https://support.google.com/channelservices/answer/9759265 // * INVALID_ARGUMENT: Required request parameters are missing or invalid. // * NOT_FOUND: The customer or offer resource was not found. // * ALREADY_EXISTS: The SKU was already transferred for the customer. @@ -907,12 +925,12 @@ service CloudChannelService { // * The new config will not modify exports used with other configs. // Changes to the config may be immediate, but may take up to 24 hours. // * There is a limit of ten configs for any - // [RepricingConfig.EntitlementGranularity.entitlement][google.cloud.channel.v1.RepricingConfig.EntitlementGranularity.entitlement] - // or + // [RepricingConfig.EntitlementGranularity.entitlement][google.cloud.channel.v1.RepricingConfig.EntitlementGranularity.entitlement], + // for any // [RepricingConfig.effective_invoice_month][google.cloud.channel.v1.RepricingConfig.effective_invoice_month]. // * The contained // [CustomerRepricingConfig.repricing_config][google.cloud.channel.v1.CustomerRepricingConfig.repricing_config] - // vaule must be different from the value used in the current config for a + // value must be different from the value used in the current config for a // [RepricingConfig.EntitlementGranularity.entitlement][google.cloud.channel.v1.RepricingConfig.EntitlementGranularity.entitlement]. // // Possible Error Codes: @@ -1083,10 +1101,12 @@ service CloudChannelService { // * The new config will not modify exports used with other configs. // Changes to the config may be immediate, but may take up to 24 hours. // * There is a limit of ten configs for any ChannelPartner or + // [RepricingConfig.EntitlementGranularity.entitlement][google.cloud.channel.v1.RepricingConfig.EntitlementGranularity.entitlement], + // for any // [RepricingConfig.effective_invoice_month][google.cloud.channel.v1.RepricingConfig.effective_invoice_month]. // * The contained // [ChannelPartnerRepricingConfig.repricing_config][google.cloud.channel.v1.ChannelPartnerRepricingConfig.repricing_config] - // vaule must be different from the value used in the current config for a + // value must be different from the value used in the current config for a // ChannelPartner. // // Possible Error Codes: @@ -1310,7 +1330,10 @@ service CloudChannelService { // // Possible error codes: // - // * PERMISSION_DENIED: The customer doesn't belong to the reseller + // * PERMISSION_DENIED: + // * The customer doesn't belong to the reseller + // * The reseller is not authorized to transact on this Product. See + // https://support.google.com/channelservices/answer/9759265 // * INVALID_ARGUMENT: Required request parameters are missing or invalid. rpc ListPurchasableOffers(ListPurchasableOffersRequest) returns (ListPurchasableOffersResponse) { @@ -1319,6 +1342,25 @@ service CloudChannelService { }; } + // Lists the billing accounts that are eligible to purchase particular SKUs + // for a given customer. + // + // Possible error codes: + // + // * PERMISSION_DENIED: The customer doesn't belong to the reseller. + // * INVALID_ARGUMENT: Required request parameters are missing or invalid. + // + // Return value: + // Based on the provided list of SKUs, returns a list of SKU groups that must + // be purchased using the same billing account and the billing accounts + // eligible to purchase each SKU group. + rpc QueryEligibleBillingAccounts(QueryEligibleBillingAccountsRequest) + returns (QueryEligibleBillingAccountsResponse) { + option (google.api.http) = { + get: "/v1/{customer=accounts/*/customers/*}:queryEligibleBillingAccounts" + }; + } + // Registers a service account with subscriber privileges on the Cloud Pub/Sub // topic for this Channel Services account. After you create a // subscriber, you get the events through @@ -1757,6 +1799,13 @@ message ListTransferableOffersRequest { // response will localize in the corresponding language code, if specified. // The default value is "en-US". string language_code = 7 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The Billing Account to look up Offers for. Format: + // accounts/{account_id}/billingAccounts/{billing_account_id}. + // + // This field is only relevant for multi-currency accounts. It should be left + // empty for single currency accounts. + string billing_account = 8 [(google.api.field_behavior) = OPTIONAL]; } // Response message for @@ -2389,6 +2438,13 @@ message ChangeOfferRequest { // with the exception that zero UUID is not supported // (`00000000-0000-0000-0000-000000000000`). string request_id = 6 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The billing account resource name that is used to pay for this + // entitlement when setting up billing on a trial subscription. + // + // This field is only relevant for multi-currency accounts. It should be + // left empty for single currency accounts. + string billing_account = 7 [(google.api.field_behavior) = OPTIONAL]; } // Request message for @@ -2698,6 +2754,10 @@ message ListPurchasableOffersRequest { // Required. SKU that the result should be restricted to. // Format: products/{product_id}/skus/{sku_id}. string sku = 1 [(google.api.field_behavior) = REQUIRED]; + + // Optional. Billing account that the result should be restricted to. + // Format: accounts/{account_id}/billingAccounts/{billing_account_id}. + string billing_account = 2 [(google.api.field_behavior) = OPTIONAL]; } // List Offers for ChangeOffer purchase. @@ -2711,6 +2771,14 @@ message ListPurchasableOffersRequest { // upgrading or downgrading an entitlement. Format: // products/{product_id}/skus/{sku_id} string new_sku = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Resource name of the new target Billing Account. Provide this + // Billing Account when setting up billing for a trial subscription. Format: + // accounts/{account_id}/billingAccounts/{billing_account_id}. + // + // This field is only relevant for multi-currency accounts. It should be + // left empty for single currency accounts. + string billing_account = 3 [(google.api.field_behavior) = OPTIONAL]; } // Defines the intended purchase. @@ -2761,6 +2829,48 @@ message PurchasableOffer { Offer offer = 1; } +// Request message for QueryEligibleBillingAccounts. +message QueryEligibleBillingAccountsRequest { + // Required. The resource name of the customer to list eligible billing + // accounts for. Format: accounts/{account_id}/customers/{customer_id}. + string customer = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "cloudchannel.googleapis.com/Customer" + } + ]; + + // Required. List of SKUs to list eligible billing accounts for. At least one + // SKU is required. Format: products/{product_id}/skus/{sku_id}. + repeated string skus = 2 [(google.api.field_behavior) = REQUIRED]; +} + +// Response message for QueryEligibleBillingAccounts. +message QueryEligibleBillingAccountsResponse { + // List of SKU purchase groups where each group represents a set of SKUs that + // must be purchased using the same billing account. Each SKU from + // [QueryEligibleBillingAccountsRequest.skus] will appear in exactly one SKU + // group. + repeated SkuPurchaseGroup sku_purchase_groups = 1; +} + +// Represents a set of SKUs that must be purchased using the same billing +// account. +message SkuPurchaseGroup { + // Resource names of the SKUs included in this group. + // Format: products/{product_id}/skus/{sku_id}. + repeated string skus = 1; + + // List of billing accounts that are eligible to purhcase these SKUs. + repeated BillingAccountPurchaseInfo billing_account_purchase_infos = 2; +} + +// Represents a billing account that can be used to make a purchase. +message BillingAccountPurchaseInfo { + // The billing account resource. + BillingAccount billing_account = 1; +} + // Request Message for RegisterSubscriber. message RegisterSubscriberRequest { // Required. Resource name of the account. diff --git a/packages/google-cloud-channel/protos/protos.d.ts b/packages/google-cloud-channel/protos/protos.d.ts index 070b5e5b531..3c0a5476567 100644 --- a/packages/google-cloud-channel/protos/protos.d.ts +++ b/packages/google-cloud-channel/protos/protos.d.ts @@ -26,6 +26,127 @@ export namespace google { /** Namespace v1. */ namespace v1 { + /** Properties of a BillingAccount. */ + interface IBillingAccount { + + /** BillingAccount name */ + name?: (string|null); + + /** BillingAccount displayName */ + displayName?: (string|null); + + /** BillingAccount createTime */ + createTime?: (google.protobuf.ITimestamp|null); + + /** BillingAccount currencyCode */ + currencyCode?: (string|null); + + /** BillingAccount regionCode */ + regionCode?: (string|null); + } + + /** Represents a BillingAccount. */ + class BillingAccount implements IBillingAccount { + + /** + * Constructs a new BillingAccount. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.channel.v1.IBillingAccount); + + /** BillingAccount name. */ + public name: string; + + /** BillingAccount displayName. */ + public displayName: string; + + /** BillingAccount createTime. */ + public createTime?: (google.protobuf.ITimestamp|null); + + /** BillingAccount currencyCode. */ + public currencyCode: string; + + /** BillingAccount regionCode. */ + public regionCode: string; + + /** + * Creates a new BillingAccount instance using the specified properties. + * @param [properties] Properties to set + * @returns BillingAccount instance + */ + public static create(properties?: google.cloud.channel.v1.IBillingAccount): google.cloud.channel.v1.BillingAccount; + + /** + * Encodes the specified BillingAccount message. Does not implicitly {@link google.cloud.channel.v1.BillingAccount.verify|verify} messages. + * @param message BillingAccount message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.channel.v1.IBillingAccount, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified BillingAccount message, length delimited. Does not implicitly {@link google.cloud.channel.v1.BillingAccount.verify|verify} messages. + * @param message BillingAccount message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.channel.v1.IBillingAccount, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a BillingAccount message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns BillingAccount + * @throws {Error} If the payload is not 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.channel.v1.BillingAccount; + + /** + * Decodes a BillingAccount message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns BillingAccount + * @throws {Error} If the payload 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.channel.v1.BillingAccount; + + /** + * Verifies a BillingAccount message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a BillingAccount message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns BillingAccount + */ + public static fromObject(object: { [k: string]: any }): google.cloud.channel.v1.BillingAccount; + + /** + * Creates a plain object from a BillingAccount message. Also converts values to other types if specified. + * @param message BillingAccount + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.channel.v1.BillingAccount, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this BillingAccount to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for BillingAccount + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + /** ChannelPartnerLinkView enum. */ enum ChannelPartnerLinkView { UNSPECIFIED = 0, @@ -2260,7 +2381,8 @@ export namespace google { REASON_UNSPECIFIED = 0, PENDING_TOS_ACCEPTANCE = 1, SKU_NOT_ELIGIBLE = 2, - SKU_SUSPENDED = 3 + SKU_SUSPENDED = 3, + CHANNEL_PARTNER_NOT_AUTHORIZED_FOR_SKU = 4 } } @@ -2594,7 +2716,8 @@ export namespace google { PARAMETER_TYPE_UNSPECIFIED = 0, INT64 = 1, STRING = 2, - DOUBLE = 3 + DOUBLE = 3, + BOOLEAN = 4 } } @@ -7391,6 +7514,20 @@ export namespace google { */ public listPurchasableOffers(request: google.cloud.channel.v1.IListPurchasableOffersRequest): Promise; + /** + * Calls QueryEligibleBillingAccounts. + * @param request QueryEligibleBillingAccountsRequest message or plain object + * @param callback Node-style callback called with the error, if any, and QueryEligibleBillingAccountsResponse + */ + public queryEligibleBillingAccounts(request: google.cloud.channel.v1.IQueryEligibleBillingAccountsRequest, callback: google.cloud.channel.v1.CloudChannelService.QueryEligibleBillingAccountsCallback): void; + + /** + * Calls QueryEligibleBillingAccounts. + * @param request QueryEligibleBillingAccountsRequest message or plain object + * @returns Promise + */ + public queryEligibleBillingAccounts(request: google.cloud.channel.v1.IQueryEligibleBillingAccountsRequest): Promise; + /** * Calls RegisterSubscriber. * @param request RegisterSubscriberRequest message or plain object @@ -7758,6 +7895,13 @@ export namespace google { */ type ListPurchasableOffersCallback = (error: (Error|null), response?: google.cloud.channel.v1.ListPurchasableOffersResponse) => void; + /** + * Callback as used by {@link google.cloud.channel.v1.CloudChannelService|queryEligibleBillingAccounts}. + * @param error Error, if any + * @param [response] QueryEligibleBillingAccountsResponse + */ + type QueryEligibleBillingAccountsCallback = (error: (Error|null), response?: google.cloud.channel.v1.QueryEligibleBillingAccountsResponse) => void; + /** * Callback as used by {@link google.cloud.channel.v1.CloudChannelService|registerSubscriber}. * @param error Error, if any @@ -9445,6 +9589,9 @@ export namespace google { /** ListTransferableOffersRequest languageCode */ languageCode?: (string|null); + + /** ListTransferableOffersRequest billingAccount */ + billingAccount?: (string|null); } /** Represents a ListTransferableOffersRequest. */ @@ -9477,6 +9624,9 @@ export namespace google { /** ListTransferableOffersRequest languageCode. */ public languageCode: string; + /** ListTransferableOffersRequest billingAccount. */ + public billingAccount: string; + /** ListTransferableOffersRequest transferredCustomerIdentity. */ public transferredCustomerIdentity?: ("cloudIdentityId"|"customerName"); @@ -12925,6 +13075,9 @@ export namespace google { /** ChangeOfferRequest requestId */ requestId?: (string|null); + + /** ChangeOfferRequest billingAccount */ + billingAccount?: (string|null); } /** Represents a ChangeOfferRequest. */ @@ -12951,6 +13104,9 @@ export namespace google { /** ChangeOfferRequest requestId. */ public requestId: string; + /** ChangeOfferRequest billingAccount. */ + public billingAccount: string; + /** * Creates a new ChangeOfferRequest instance using the specified properties. * @param [properties] Properties to set @@ -14890,6 +15046,9 @@ export namespace google { /** CreateEntitlementPurchase sku */ sku?: (string|null); + + /** CreateEntitlementPurchase billingAccount */ + billingAccount?: (string|null); } /** Represents a CreateEntitlementPurchase. */ @@ -14904,6 +15063,9 @@ export namespace google { /** CreateEntitlementPurchase sku. */ public sku: string; + /** CreateEntitlementPurchase billingAccount. */ + public billingAccount: string; + /** * Creates a new CreateEntitlementPurchase instance using the specified properties. * @param [properties] Properties to set @@ -14990,6 +15152,9 @@ export namespace google { /** ChangeOfferPurchase newSku */ newSku?: (string|null); + + /** ChangeOfferPurchase billingAccount */ + billingAccount?: (string|null); } /** Represents a ChangeOfferPurchase. */ @@ -15007,6 +15172,9 @@ export namespace google { /** ChangeOfferPurchase newSku. */ public newSku: string; + /** ChangeOfferPurchase billingAccount. */ + public billingAccount: string; + /** * Creates a new ChangeOfferPurchase instance using the specified properties. * @param [properties] Properties to set @@ -15286,6 +15454,406 @@ export namespace google { public static getTypeUrl(typeUrlPrefix?: string): string; } + /** Properties of a QueryEligibleBillingAccountsRequest. */ + interface IQueryEligibleBillingAccountsRequest { + + /** QueryEligibleBillingAccountsRequest customer */ + customer?: (string|null); + + /** QueryEligibleBillingAccountsRequest skus */ + skus?: (string[]|null); + } + + /** Represents a QueryEligibleBillingAccountsRequest. */ + class QueryEligibleBillingAccountsRequest implements IQueryEligibleBillingAccountsRequest { + + /** + * Constructs a new QueryEligibleBillingAccountsRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.channel.v1.IQueryEligibleBillingAccountsRequest); + + /** QueryEligibleBillingAccountsRequest customer. */ + public customer: string; + + /** QueryEligibleBillingAccountsRequest skus. */ + public skus: string[]; + + /** + * Creates a new QueryEligibleBillingAccountsRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns QueryEligibleBillingAccountsRequest instance + */ + public static create(properties?: google.cloud.channel.v1.IQueryEligibleBillingAccountsRequest): google.cloud.channel.v1.QueryEligibleBillingAccountsRequest; + + /** + * Encodes the specified QueryEligibleBillingAccountsRequest message. Does not implicitly {@link google.cloud.channel.v1.QueryEligibleBillingAccountsRequest.verify|verify} messages. + * @param message QueryEligibleBillingAccountsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.channel.v1.IQueryEligibleBillingAccountsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified QueryEligibleBillingAccountsRequest message, length delimited. Does not implicitly {@link google.cloud.channel.v1.QueryEligibleBillingAccountsRequest.verify|verify} messages. + * @param message QueryEligibleBillingAccountsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.channel.v1.IQueryEligibleBillingAccountsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a QueryEligibleBillingAccountsRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns QueryEligibleBillingAccountsRequest + * @throws {Error} If the payload is not 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.channel.v1.QueryEligibleBillingAccountsRequest; + + /** + * Decodes a QueryEligibleBillingAccountsRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns QueryEligibleBillingAccountsRequest + * @throws {Error} If the payload 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.channel.v1.QueryEligibleBillingAccountsRequest; + + /** + * Verifies a QueryEligibleBillingAccountsRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a QueryEligibleBillingAccountsRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns QueryEligibleBillingAccountsRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.channel.v1.QueryEligibleBillingAccountsRequest; + + /** + * Creates a plain object from a QueryEligibleBillingAccountsRequest message. Also converts values to other types if specified. + * @param message QueryEligibleBillingAccountsRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.channel.v1.QueryEligibleBillingAccountsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this QueryEligibleBillingAccountsRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for QueryEligibleBillingAccountsRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a QueryEligibleBillingAccountsResponse. */ + interface IQueryEligibleBillingAccountsResponse { + + /** QueryEligibleBillingAccountsResponse skuPurchaseGroups */ + skuPurchaseGroups?: (google.cloud.channel.v1.ISkuPurchaseGroup[]|null); + } + + /** Represents a QueryEligibleBillingAccountsResponse. */ + class QueryEligibleBillingAccountsResponse implements IQueryEligibleBillingAccountsResponse { + + /** + * Constructs a new QueryEligibleBillingAccountsResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.channel.v1.IQueryEligibleBillingAccountsResponse); + + /** QueryEligibleBillingAccountsResponse skuPurchaseGroups. */ + public skuPurchaseGroups: google.cloud.channel.v1.ISkuPurchaseGroup[]; + + /** + * Creates a new QueryEligibleBillingAccountsResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns QueryEligibleBillingAccountsResponse instance + */ + public static create(properties?: google.cloud.channel.v1.IQueryEligibleBillingAccountsResponse): google.cloud.channel.v1.QueryEligibleBillingAccountsResponse; + + /** + * Encodes the specified QueryEligibleBillingAccountsResponse message. Does not implicitly {@link google.cloud.channel.v1.QueryEligibleBillingAccountsResponse.verify|verify} messages. + * @param message QueryEligibleBillingAccountsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.channel.v1.IQueryEligibleBillingAccountsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified QueryEligibleBillingAccountsResponse message, length delimited. Does not implicitly {@link google.cloud.channel.v1.QueryEligibleBillingAccountsResponse.verify|verify} messages. + * @param message QueryEligibleBillingAccountsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.channel.v1.IQueryEligibleBillingAccountsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a QueryEligibleBillingAccountsResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns QueryEligibleBillingAccountsResponse + * @throws {Error} If the payload is not 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.channel.v1.QueryEligibleBillingAccountsResponse; + + /** + * Decodes a QueryEligibleBillingAccountsResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns QueryEligibleBillingAccountsResponse + * @throws {Error} If the payload 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.channel.v1.QueryEligibleBillingAccountsResponse; + + /** + * Verifies a QueryEligibleBillingAccountsResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a QueryEligibleBillingAccountsResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns QueryEligibleBillingAccountsResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.channel.v1.QueryEligibleBillingAccountsResponse; + + /** + * Creates a plain object from a QueryEligibleBillingAccountsResponse message. Also converts values to other types if specified. + * @param message QueryEligibleBillingAccountsResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.channel.v1.QueryEligibleBillingAccountsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this QueryEligibleBillingAccountsResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for QueryEligibleBillingAccountsResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a SkuPurchaseGroup. */ + interface ISkuPurchaseGroup { + + /** SkuPurchaseGroup skus */ + skus?: (string[]|null); + + /** SkuPurchaseGroup billingAccountPurchaseInfos */ + billingAccountPurchaseInfos?: (google.cloud.channel.v1.IBillingAccountPurchaseInfo[]|null); + } + + /** Represents a SkuPurchaseGroup. */ + class SkuPurchaseGroup implements ISkuPurchaseGroup { + + /** + * Constructs a new SkuPurchaseGroup. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.channel.v1.ISkuPurchaseGroup); + + /** SkuPurchaseGroup skus. */ + public skus: string[]; + + /** SkuPurchaseGroup billingAccountPurchaseInfos. */ + public billingAccountPurchaseInfos: google.cloud.channel.v1.IBillingAccountPurchaseInfo[]; + + /** + * Creates a new SkuPurchaseGroup instance using the specified properties. + * @param [properties] Properties to set + * @returns SkuPurchaseGroup instance + */ + public static create(properties?: google.cloud.channel.v1.ISkuPurchaseGroup): google.cloud.channel.v1.SkuPurchaseGroup; + + /** + * Encodes the specified SkuPurchaseGroup message. Does not implicitly {@link google.cloud.channel.v1.SkuPurchaseGroup.verify|verify} messages. + * @param message SkuPurchaseGroup message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.channel.v1.ISkuPurchaseGroup, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified SkuPurchaseGroup message, length delimited. Does not implicitly {@link google.cloud.channel.v1.SkuPurchaseGroup.verify|verify} messages. + * @param message SkuPurchaseGroup message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.channel.v1.ISkuPurchaseGroup, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SkuPurchaseGroup message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns SkuPurchaseGroup + * @throws {Error} If the payload is not 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.channel.v1.SkuPurchaseGroup; + + /** + * Decodes a SkuPurchaseGroup message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns SkuPurchaseGroup + * @throws {Error} If the payload 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.channel.v1.SkuPurchaseGroup; + + /** + * Verifies a SkuPurchaseGroup message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a SkuPurchaseGroup message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns SkuPurchaseGroup + */ + public static fromObject(object: { [k: string]: any }): google.cloud.channel.v1.SkuPurchaseGroup; + + /** + * Creates a plain object from a SkuPurchaseGroup message. Also converts values to other types if specified. + * @param message SkuPurchaseGroup + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.channel.v1.SkuPurchaseGroup, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this SkuPurchaseGroup to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for SkuPurchaseGroup + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a BillingAccountPurchaseInfo. */ + interface IBillingAccountPurchaseInfo { + + /** BillingAccountPurchaseInfo billingAccount */ + billingAccount?: (google.cloud.channel.v1.IBillingAccount|null); + } + + /** Represents a BillingAccountPurchaseInfo. */ + class BillingAccountPurchaseInfo implements IBillingAccountPurchaseInfo { + + /** + * Constructs a new BillingAccountPurchaseInfo. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.channel.v1.IBillingAccountPurchaseInfo); + + /** BillingAccountPurchaseInfo billingAccount. */ + public billingAccount?: (google.cloud.channel.v1.IBillingAccount|null); + + /** + * Creates a new BillingAccountPurchaseInfo instance using the specified properties. + * @param [properties] Properties to set + * @returns BillingAccountPurchaseInfo instance + */ + public static create(properties?: google.cloud.channel.v1.IBillingAccountPurchaseInfo): google.cloud.channel.v1.BillingAccountPurchaseInfo; + + /** + * Encodes the specified BillingAccountPurchaseInfo message. Does not implicitly {@link google.cloud.channel.v1.BillingAccountPurchaseInfo.verify|verify} messages. + * @param message BillingAccountPurchaseInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.channel.v1.IBillingAccountPurchaseInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified BillingAccountPurchaseInfo message, length delimited. Does not implicitly {@link google.cloud.channel.v1.BillingAccountPurchaseInfo.verify|verify} messages. + * @param message BillingAccountPurchaseInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.channel.v1.IBillingAccountPurchaseInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a BillingAccountPurchaseInfo message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns BillingAccountPurchaseInfo + * @throws {Error} If the payload is not 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.channel.v1.BillingAccountPurchaseInfo; + + /** + * Decodes a BillingAccountPurchaseInfo message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns BillingAccountPurchaseInfo + * @throws {Error} If the payload 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.channel.v1.BillingAccountPurchaseInfo; + + /** + * Verifies a BillingAccountPurchaseInfo message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a BillingAccountPurchaseInfo message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns BillingAccountPurchaseInfo + */ + public static fromObject(object: { [k: string]: any }): google.cloud.channel.v1.BillingAccountPurchaseInfo; + + /** + * Creates a plain object from a BillingAccountPurchaseInfo message. Also converts values to other types if specified. + * @param message BillingAccountPurchaseInfo + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.channel.v1.BillingAccountPurchaseInfo, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this BillingAccountPurchaseInfo to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for BillingAccountPurchaseInfo + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + /** Properties of a RegisterSubscriberRequest. */ interface IRegisterSubscriberRequest { @@ -21937,206 +22505,206 @@ export namespace google { } } - /** Properties of an Any. */ - interface IAny { + /** Properties of a Timestamp. */ + interface ITimestamp { - /** Any type_url */ - type_url?: (string|null); + /** Timestamp seconds */ + seconds?: (number|Long|string|null); - /** Any value */ - value?: (Uint8Array|string|null); + /** Timestamp nanos */ + nanos?: (number|null); } - /** Represents an Any. */ - class Any implements IAny { + /** Represents a Timestamp. */ + class Timestamp implements ITimestamp { /** - * Constructs a new Any. + * Constructs a new Timestamp. * @param [properties] Properties to set */ - constructor(properties?: google.protobuf.IAny); + constructor(properties?: google.protobuf.ITimestamp); - /** Any type_url. */ - public type_url: string; + /** Timestamp seconds. */ + public seconds: (number|Long|string); - /** Any value. */ - public value: (Uint8Array|string); + /** Timestamp nanos. */ + public nanos: number; /** - * Creates a new Any instance using the specified properties. + * Creates a new Timestamp instance using the specified properties. * @param [properties] Properties to set - * @returns Any instance + * @returns Timestamp instance */ - public static create(properties?: google.protobuf.IAny): google.protobuf.Any; + public static create(properties?: google.protobuf.ITimestamp): google.protobuf.Timestamp; /** - * Encodes the specified Any message. Does not implicitly {@link google.protobuf.Any.verify|verify} messages. - * @param message Any message or plain object to encode + * 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.IAny, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.protobuf.ITimestamp, 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 + * 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.IAny, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.protobuf.ITimestamp, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes an Any message from the specified reader or buffer. + * 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 Any + * @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.Any; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.Timestamp; /** - * Decodes an Any message from the specified reader or buffer, length delimited. + * Decodes a Timestamp message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns Any + * @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.Any; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.Timestamp; /** - * Verifies an Any message. + * 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 an Any message from a plain object. Also converts values to their respective internal types. + * Creates a Timestamp message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns Any + * @returns Timestamp */ - public static fromObject(object: { [k: string]: any }): google.protobuf.Any; + public static fromObject(object: { [k: string]: any }): google.protobuf.Timestamp; /** - * Creates a plain object from an Any message. Also converts values to other types if specified. - * @param message Any + * 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.Any, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.protobuf.Timestamp, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this Any to JSON. + * Converts this Timestamp to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; /** - * Gets the default type url for 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 Timestamp. */ - interface ITimestamp { + /** Properties of an Any. */ + interface IAny { - /** Timestamp seconds */ - seconds?: (number|Long|string|null); + /** Any type_url */ + type_url?: (string|null); - /** Timestamp nanos */ - nanos?: (number|null); + /** Any value */ + value?: (Uint8Array|string|null); } - /** Represents a Timestamp. */ - class Timestamp implements ITimestamp { + /** Represents an Any. */ + class Any implements IAny { /** - * Constructs a new Timestamp. + * Constructs a new Any. * @param [properties] Properties to set */ - constructor(properties?: google.protobuf.ITimestamp); + constructor(properties?: google.protobuf.IAny); - /** Timestamp seconds. */ - public seconds: (number|Long|string); + /** Any type_url. */ + public type_url: string; - /** Timestamp nanos. */ - public nanos: number; + /** Any value. */ + public value: (Uint8Array|string); /** - * Creates a new Timestamp instance using the specified properties. + * Creates a new Any instance using the specified properties. * @param [properties] Properties to set - * @returns Timestamp instance + * @returns Any instance */ - public static create(properties?: google.protobuf.ITimestamp): google.protobuf.Timestamp; + public static create(properties?: google.protobuf.IAny): google.protobuf.Any; /** - * Encodes the specified Timestamp message. Does not implicitly {@link google.protobuf.Timestamp.verify|verify} messages. - * @param message Timestamp message or plain object to encode + * 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.ITimestamp, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.protobuf.IAny, 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 + * 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.ITimestamp, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.protobuf.IAny, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a Timestamp message from the specified reader or buffer. + * 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 Timestamp + * @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.Timestamp; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.Any; /** - * Decodes a Timestamp message from the specified reader or buffer, length delimited. + * Decodes an Any message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns Timestamp + * @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.Timestamp; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.Any; /** - * Verifies a Timestamp message. + * 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 a Timestamp message from a plain object. Also converts values to their respective internal types. + * Creates an Any message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns Timestamp + * @returns Any */ - public static fromObject(object: { [k: string]: any }): google.protobuf.Timestamp; + public static fromObject(object: { [k: string]: any }): google.protobuf.Any; /** - * Creates a plain object from a Timestamp message. Also converts values to other types if specified. - * @param message Timestamp + * 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.Timestamp, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.protobuf.Any, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this Timestamp to JSON. + * Converts this Any to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; /** - * Gets the default type url for Timestamp + * Gets the default type url for Any * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns The default type url */ diff --git a/packages/google-cloud-channel/protos/protos.js b/packages/google-cloud-channel/protos/protos.js index f1b308a1b8e..94c2cb6d447 100644 --- a/packages/google-cloud-channel/protos/protos.js +++ b/packages/google-cloud-channel/protos/protos.js @@ -66,6 +66,307 @@ */ var v1 = {}; + v1.BillingAccount = (function() { + + /** + * Properties of a BillingAccount. + * @memberof google.cloud.channel.v1 + * @interface IBillingAccount + * @property {string|null} [name] BillingAccount name + * @property {string|null} [displayName] BillingAccount displayName + * @property {google.protobuf.ITimestamp|null} [createTime] BillingAccount createTime + * @property {string|null} [currencyCode] BillingAccount currencyCode + * @property {string|null} [regionCode] BillingAccount regionCode + */ + + /** + * Constructs a new BillingAccount. + * @memberof google.cloud.channel.v1 + * @classdesc Represents a BillingAccount. + * @implements IBillingAccount + * @constructor + * @param {google.cloud.channel.v1.IBillingAccount=} [properties] Properties to set + */ + function BillingAccount(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * BillingAccount name. + * @member {string} name + * @memberof google.cloud.channel.v1.BillingAccount + * @instance + */ + BillingAccount.prototype.name = ""; + + /** + * BillingAccount displayName. + * @member {string} displayName + * @memberof google.cloud.channel.v1.BillingAccount + * @instance + */ + BillingAccount.prototype.displayName = ""; + + /** + * BillingAccount createTime. + * @member {google.protobuf.ITimestamp|null|undefined} createTime + * @memberof google.cloud.channel.v1.BillingAccount + * @instance + */ + BillingAccount.prototype.createTime = null; + + /** + * BillingAccount currencyCode. + * @member {string} currencyCode + * @memberof google.cloud.channel.v1.BillingAccount + * @instance + */ + BillingAccount.prototype.currencyCode = ""; + + /** + * BillingAccount regionCode. + * @member {string} regionCode + * @memberof google.cloud.channel.v1.BillingAccount + * @instance + */ + BillingAccount.prototype.regionCode = ""; + + /** + * Creates a new BillingAccount instance using the specified properties. + * @function create + * @memberof google.cloud.channel.v1.BillingAccount + * @static + * @param {google.cloud.channel.v1.IBillingAccount=} [properties] Properties to set + * @returns {google.cloud.channel.v1.BillingAccount} BillingAccount instance + */ + BillingAccount.create = function create(properties) { + return new BillingAccount(properties); + }; + + /** + * Encodes the specified BillingAccount message. Does not implicitly {@link google.cloud.channel.v1.BillingAccount.verify|verify} messages. + * @function encode + * @memberof google.cloud.channel.v1.BillingAccount + * @static + * @param {google.cloud.channel.v1.IBillingAccount} message BillingAccount message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BillingAccount.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.displayName != null && Object.hasOwnProperty.call(message, "displayName")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.displayName); + if (message.createTime != null && Object.hasOwnProperty.call(message, "createTime")) + $root.google.protobuf.Timestamp.encode(message.createTime, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.currencyCode != null && Object.hasOwnProperty.call(message, "currencyCode")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.currencyCode); + if (message.regionCode != null && Object.hasOwnProperty.call(message, "regionCode")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.regionCode); + return writer; + }; + + /** + * Encodes the specified BillingAccount message, length delimited. Does not implicitly {@link google.cloud.channel.v1.BillingAccount.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.channel.v1.BillingAccount + * @static + * @param {google.cloud.channel.v1.IBillingAccount} message BillingAccount message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BillingAccount.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a BillingAccount message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.channel.v1.BillingAccount + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.channel.v1.BillingAccount} BillingAccount + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BillingAccount.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.channel.v1.BillingAccount(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.displayName = reader.string(); + break; + } + case 3: { + message.createTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 4: { + message.currencyCode = reader.string(); + break; + } + case 5: { + message.regionCode = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a BillingAccount message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.channel.v1.BillingAccount + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.channel.v1.BillingAccount} BillingAccount + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BillingAccount.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a BillingAccount message. + * @function verify + * @memberof google.cloud.channel.v1.BillingAccount + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + BillingAccount.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.displayName != null && message.hasOwnProperty("displayName")) + if (!$util.isString(message.displayName)) + return "displayName: string expected"; + if (message.createTime != null && message.hasOwnProperty("createTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.createTime); + if (error) + return "createTime." + error; + } + if (message.currencyCode != null && message.hasOwnProperty("currencyCode")) + if (!$util.isString(message.currencyCode)) + return "currencyCode: string expected"; + if (message.regionCode != null && message.hasOwnProperty("regionCode")) + if (!$util.isString(message.regionCode)) + return "regionCode: string expected"; + return null; + }; + + /** + * Creates a BillingAccount message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.channel.v1.BillingAccount + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.channel.v1.BillingAccount} BillingAccount + */ + BillingAccount.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.channel.v1.BillingAccount) + return object; + var message = new $root.google.cloud.channel.v1.BillingAccount(); + if (object.name != null) + message.name = String(object.name); + if (object.displayName != null) + message.displayName = String(object.displayName); + if (object.createTime != null) { + if (typeof object.createTime !== "object") + throw TypeError(".google.cloud.channel.v1.BillingAccount.createTime: object expected"); + message.createTime = $root.google.protobuf.Timestamp.fromObject(object.createTime); + } + if (object.currencyCode != null) + message.currencyCode = String(object.currencyCode); + if (object.regionCode != null) + message.regionCode = String(object.regionCode); + return message; + }; + + /** + * Creates a plain object from a BillingAccount message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.channel.v1.BillingAccount + * @static + * @param {google.cloud.channel.v1.BillingAccount} message BillingAccount + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + BillingAccount.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.displayName = ""; + object.createTime = null; + object.currencyCode = ""; + object.regionCode = ""; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + 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.currencyCode != null && message.hasOwnProperty("currencyCode")) + object.currencyCode = message.currencyCode; + if (message.regionCode != null && message.hasOwnProperty("regionCode")) + object.regionCode = message.regionCode; + return object; + }; + + /** + * Converts this BillingAccount to JSON. + * @function toJSON + * @memberof google.cloud.channel.v1.BillingAccount + * @instance + * @returns {Object.} JSON object + */ + BillingAccount.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for BillingAccount + * @function getTypeUrl + * @memberof google.cloud.channel.v1.BillingAccount + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + BillingAccount.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.channel.v1.BillingAccount"; + }; + + return BillingAccount; + })(); + /** * ChannelPartnerLinkView enum. * @name google.cloud.channel.v1.ChannelPartnerLinkView @@ -6182,6 +6483,7 @@ case 1: case 2: case 3: + case 4: break; } return null; @@ -6226,6 +6528,10 @@ case 3: message.ineligibilityReason = 3; break; + case "CHANNEL_PARTNER_NOT_AUTHORIZED_FOR_SKU": + case 4: + message.ineligibilityReason = 4; + break; } return message; }; @@ -6291,6 +6597,7 @@ * @property {number} PENDING_TOS_ACCEPTANCE=1 PENDING_TOS_ACCEPTANCE value * @property {number} SKU_NOT_ELIGIBLE=2 SKU_NOT_ELIGIBLE value * @property {number} SKU_SUSPENDED=3 SKU_SUSPENDED value + * @property {number} CHANNEL_PARTNER_NOT_AUTHORIZED_FOR_SKU=4 CHANNEL_PARTNER_NOT_AUTHORIZED_FOR_SKU value */ TransferEligibility.Reason = (function() { var valuesById = {}, values = Object.create(valuesById); @@ -6298,6 +6605,7 @@ values[valuesById[1] = "PENDING_TOS_ACCEPTANCE"] = 1; values[valuesById[2] = "SKU_NOT_ELIGIBLE"] = 2; values[valuesById[3] = "SKU_SUSPENDED"] = 3; + values[valuesById[4] = "CHANNEL_PARTNER_NOT_AUTHORIZED_FOR_SKU"] = 4; return values; })(); @@ -7110,6 +7418,7 @@ case 1: case 2: case 3: + case 4: break; } if (message.minValue != null && message.hasOwnProperty("minValue")) { @@ -7174,6 +7483,10 @@ case 3: message.parameterType = 3; break; + case "BOOLEAN": + case 4: + message.parameterType = 4; + break; } if (object.minValue != null) { if (typeof object.minValue !== "object") @@ -7274,6 +7587,7 @@ * @property {number} INT64=1 INT64 value * @property {number} STRING=2 STRING value * @property {number} DOUBLE=3 DOUBLE value + * @property {number} BOOLEAN=4 BOOLEAN value */ ParameterDefinition.ParameterType = (function() { var valuesById = {}, values = Object.create(valuesById); @@ -7281,6 +7595,7 @@ values[valuesById[1] = "INT64"] = 1; values[valuesById[2] = "STRING"] = 2; values[valuesById[3] = "DOUBLE"] = 3; + values[valuesById[4] = "BOOLEAN"] = 4; return values; })(); @@ -19137,6 +19452,39 @@ * @variation 2 */ + /** + * Callback as used by {@link google.cloud.channel.v1.CloudChannelService|queryEligibleBillingAccounts}. + * @memberof google.cloud.channel.v1.CloudChannelService + * @typedef QueryEligibleBillingAccountsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.channel.v1.QueryEligibleBillingAccountsResponse} [response] QueryEligibleBillingAccountsResponse + */ + + /** + * Calls QueryEligibleBillingAccounts. + * @function queryEligibleBillingAccounts + * @memberof google.cloud.channel.v1.CloudChannelService + * @instance + * @param {google.cloud.channel.v1.IQueryEligibleBillingAccountsRequest} request QueryEligibleBillingAccountsRequest message or plain object + * @param {google.cloud.channel.v1.CloudChannelService.QueryEligibleBillingAccountsCallback} callback Node-style callback called with the error, if any, and QueryEligibleBillingAccountsResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(CloudChannelService.prototype.queryEligibleBillingAccounts = function queryEligibleBillingAccounts(request, callback) { + return this.rpcCall(queryEligibleBillingAccounts, $root.google.cloud.channel.v1.QueryEligibleBillingAccountsRequest, $root.google.cloud.channel.v1.QueryEligibleBillingAccountsResponse, request, callback); + }, "name", { value: "QueryEligibleBillingAccounts" }); + + /** + * Calls QueryEligibleBillingAccounts. + * @function queryEligibleBillingAccounts + * @memberof google.cloud.channel.v1.CloudChannelService + * @instance + * @param {google.cloud.channel.v1.IQueryEligibleBillingAccountsRequest} request QueryEligibleBillingAccountsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + /** * Callback as used by {@link google.cloud.channel.v1.CloudChannelService|registerSubscriber}. * @memberof google.cloud.channel.v1.CloudChannelService @@ -23168,6 +23516,7 @@ * @property {string|null} [pageToken] ListTransferableOffersRequest pageToken * @property {string|null} [sku] ListTransferableOffersRequest sku * @property {string|null} [languageCode] ListTransferableOffersRequest languageCode + * @property {string|null} [billingAccount] ListTransferableOffersRequest billingAccount */ /** @@ -23241,6 +23590,14 @@ */ ListTransferableOffersRequest.prototype.languageCode = ""; + /** + * ListTransferableOffersRequest billingAccount. + * @member {string} billingAccount + * @memberof google.cloud.channel.v1.ListTransferableOffersRequest + * @instance + */ + ListTransferableOffersRequest.prototype.billingAccount = ""; + // OneOf field names bound to virtual getters and setters var $oneOfFields; @@ -23293,6 +23650,8 @@ writer.uint32(/* id 6, wireType 2 =*/50).string(message.sku); if (message.languageCode != null && Object.hasOwnProperty.call(message, "languageCode")) writer.uint32(/* id 7, wireType 2 =*/58).string(message.languageCode); + if (message.billingAccount != null && Object.hasOwnProperty.call(message, "billingAccount")) + writer.uint32(/* id 8, wireType 2 =*/66).string(message.billingAccount); return writer; }; @@ -23355,6 +23714,10 @@ message.languageCode = reader.string(); break; } + case 8: { + message.billingAccount = reader.string(); + break; + } default: reader.skipType(tag & 7); break; @@ -23418,6 +23781,9 @@ if (message.languageCode != null && message.hasOwnProperty("languageCode")) if (!$util.isString(message.languageCode)) return "languageCode: string expected"; + if (message.billingAccount != null && message.hasOwnProperty("billingAccount")) + if (!$util.isString(message.billingAccount)) + return "billingAccount: string expected"; return null; }; @@ -23447,6 +23813,8 @@ message.sku = String(object.sku); if (object.languageCode != null) message.languageCode = String(object.languageCode); + if (object.billingAccount != null) + message.billingAccount = String(object.billingAccount); return message; }; @@ -23469,6 +23837,7 @@ object.pageToken = ""; object.sku = ""; object.languageCode = ""; + object.billingAccount = ""; } if (message.parent != null && message.hasOwnProperty("parent")) object.parent = message.parent; @@ -23490,6 +23859,8 @@ object.sku = message.sku; if (message.languageCode != null && message.hasOwnProperty("languageCode")) object.languageCode = message.languageCode; + if (message.billingAccount != null && message.hasOwnProperty("billingAccount")) + object.billingAccount = message.billingAccount; return object; }; @@ -31306,6 +31677,7 @@ * @property {Array.|null} [parameters] ChangeOfferRequest parameters * @property {string|null} [purchaseOrderId] ChangeOfferRequest purchaseOrderId * @property {string|null} [requestId] ChangeOfferRequest requestId + * @property {string|null} [billingAccount] ChangeOfferRequest billingAccount */ /** @@ -31364,6 +31736,14 @@ */ ChangeOfferRequest.prototype.requestId = ""; + /** + * ChangeOfferRequest billingAccount. + * @member {string} billingAccount + * @memberof google.cloud.channel.v1.ChangeOfferRequest + * @instance + */ + ChangeOfferRequest.prototype.billingAccount = ""; + /** * Creates a new ChangeOfferRequest instance using the specified properties. * @function create @@ -31399,6 +31779,8 @@ writer.uint32(/* id 5, wireType 2 =*/42).string(message.purchaseOrderId); if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) writer.uint32(/* id 6, wireType 2 =*/50).string(message.requestId); + if (message.billingAccount != null && Object.hasOwnProperty.call(message, "billingAccount")) + writer.uint32(/* id 7, wireType 2 =*/58).string(message.billingAccount); return writer; }; @@ -31455,6 +31837,10 @@ message.requestId = reader.string(); break; } + case 7: { + message.billingAccount = reader.string(); + break; + } default: reader.skipType(tag & 7); break; @@ -31511,6 +31897,9 @@ if (message.requestId != null && message.hasOwnProperty("requestId")) if (!$util.isString(message.requestId)) return "requestId: string expected"; + if (message.billingAccount != null && message.hasOwnProperty("billingAccount")) + if (!$util.isString(message.billingAccount)) + return "billingAccount: string expected"; return null; }; @@ -31544,6 +31933,8 @@ message.purchaseOrderId = String(object.purchaseOrderId); if (object.requestId != null) message.requestId = String(object.requestId); + if (object.billingAccount != null) + message.billingAccount = String(object.billingAccount); return message; }; @@ -31567,6 +31958,7 @@ object.offer = ""; object.purchaseOrderId = ""; object.requestId = ""; + object.billingAccount = ""; } if (message.name != null && message.hasOwnProperty("name")) object.name = message.name; @@ -31581,6 +31973,8 @@ object.purchaseOrderId = message.purchaseOrderId; if (message.requestId != null && message.hasOwnProperty("requestId")) object.requestId = message.requestId; + if (message.billingAccount != null && message.hasOwnProperty("billingAccount")) + object.billingAccount = message.billingAccount; return object; }; @@ -35998,6 +36392,7 @@ * @memberof google.cloud.channel.v1.ListPurchasableOffersRequest * @interface ICreateEntitlementPurchase * @property {string|null} [sku] CreateEntitlementPurchase sku + * @property {string|null} [billingAccount] CreateEntitlementPurchase billingAccount */ /** @@ -36023,6 +36418,14 @@ */ CreateEntitlementPurchase.prototype.sku = ""; + /** + * CreateEntitlementPurchase billingAccount. + * @member {string} billingAccount + * @memberof google.cloud.channel.v1.ListPurchasableOffersRequest.CreateEntitlementPurchase + * @instance + */ + CreateEntitlementPurchase.prototype.billingAccount = ""; + /** * Creates a new CreateEntitlementPurchase instance using the specified properties. * @function create @@ -36049,6 +36452,8 @@ writer = $Writer.create(); if (message.sku != null && Object.hasOwnProperty.call(message, "sku")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.sku); + if (message.billingAccount != null && Object.hasOwnProperty.call(message, "billingAccount")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.billingAccount); return writer; }; @@ -36087,6 +36492,10 @@ message.sku = reader.string(); break; } + case 2: { + message.billingAccount = reader.string(); + break; + } default: reader.skipType(tag & 7); break; @@ -36125,6 +36534,9 @@ if (message.sku != null && message.hasOwnProperty("sku")) if (!$util.isString(message.sku)) return "sku: string expected"; + if (message.billingAccount != null && message.hasOwnProperty("billingAccount")) + if (!$util.isString(message.billingAccount)) + return "billingAccount: string expected"; return null; }; @@ -36142,6 +36554,8 @@ var message = new $root.google.cloud.channel.v1.ListPurchasableOffersRequest.CreateEntitlementPurchase(); if (object.sku != null) message.sku = String(object.sku); + if (object.billingAccount != null) + message.billingAccount = String(object.billingAccount); return message; }; @@ -36158,10 +36572,14 @@ if (!options) options = {}; var object = {}; - if (options.defaults) + if (options.defaults) { object.sku = ""; + object.billingAccount = ""; + } if (message.sku != null && message.hasOwnProperty("sku")) object.sku = message.sku; + if (message.billingAccount != null && message.hasOwnProperty("billingAccount")) + object.billingAccount = message.billingAccount; return object; }; @@ -36202,6 +36620,7 @@ * @interface IChangeOfferPurchase * @property {string|null} [entitlement] ChangeOfferPurchase entitlement * @property {string|null} [newSku] ChangeOfferPurchase newSku + * @property {string|null} [billingAccount] ChangeOfferPurchase billingAccount */ /** @@ -36235,6 +36654,14 @@ */ ChangeOfferPurchase.prototype.newSku = ""; + /** + * ChangeOfferPurchase billingAccount. + * @member {string} billingAccount + * @memberof google.cloud.channel.v1.ListPurchasableOffersRequest.ChangeOfferPurchase + * @instance + */ + ChangeOfferPurchase.prototype.billingAccount = ""; + /** * Creates a new ChangeOfferPurchase instance using the specified properties. * @function create @@ -36263,6 +36690,8 @@ writer.uint32(/* id 1, wireType 2 =*/10).string(message.entitlement); if (message.newSku != null && Object.hasOwnProperty.call(message, "newSku")) writer.uint32(/* id 2, wireType 2 =*/18).string(message.newSku); + if (message.billingAccount != null && Object.hasOwnProperty.call(message, "billingAccount")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.billingAccount); return writer; }; @@ -36305,6 +36734,10 @@ message.newSku = reader.string(); break; } + case 3: { + message.billingAccount = reader.string(); + break; + } default: reader.skipType(tag & 7); break; @@ -36346,6 +36779,9 @@ if (message.newSku != null && message.hasOwnProperty("newSku")) if (!$util.isString(message.newSku)) return "newSku: string expected"; + if (message.billingAccount != null && message.hasOwnProperty("billingAccount")) + if (!$util.isString(message.billingAccount)) + return "billingAccount: string expected"; return null; }; @@ -36365,6 +36801,8 @@ message.entitlement = String(object.entitlement); if (object.newSku != null) message.newSku = String(object.newSku); + if (object.billingAccount != null) + message.billingAccount = String(object.billingAccount); return message; }; @@ -36384,11 +36822,14 @@ if (options.defaults) { object.entitlement = ""; object.newSku = ""; + object.billingAccount = ""; } if (message.entitlement != null && message.hasOwnProperty("entitlement")) object.entitlement = message.entitlement; if (message.newSku != null && message.hasOwnProperty("newSku")) object.newSku = message.newSku; + if (message.billingAccount != null && message.hasOwnProperty("billingAccount")) + object.billingAccount = message.billingAccount; return object; }; @@ -36880,6 +37321,945 @@ return PurchasableOffer; })(); + v1.QueryEligibleBillingAccountsRequest = (function() { + + /** + * Properties of a QueryEligibleBillingAccountsRequest. + * @memberof google.cloud.channel.v1 + * @interface IQueryEligibleBillingAccountsRequest + * @property {string|null} [customer] QueryEligibleBillingAccountsRequest customer + * @property {Array.|null} [skus] QueryEligibleBillingAccountsRequest skus + */ + + /** + * Constructs a new QueryEligibleBillingAccountsRequest. + * @memberof google.cloud.channel.v1 + * @classdesc Represents a QueryEligibleBillingAccountsRequest. + * @implements IQueryEligibleBillingAccountsRequest + * @constructor + * @param {google.cloud.channel.v1.IQueryEligibleBillingAccountsRequest=} [properties] Properties to set + */ + function QueryEligibleBillingAccountsRequest(properties) { + this.skus = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * QueryEligibleBillingAccountsRequest customer. + * @member {string} customer + * @memberof google.cloud.channel.v1.QueryEligibleBillingAccountsRequest + * @instance + */ + QueryEligibleBillingAccountsRequest.prototype.customer = ""; + + /** + * QueryEligibleBillingAccountsRequest skus. + * @member {Array.} skus + * @memberof google.cloud.channel.v1.QueryEligibleBillingAccountsRequest + * @instance + */ + QueryEligibleBillingAccountsRequest.prototype.skus = $util.emptyArray; + + /** + * Creates a new QueryEligibleBillingAccountsRequest instance using the specified properties. + * @function create + * @memberof google.cloud.channel.v1.QueryEligibleBillingAccountsRequest + * @static + * @param {google.cloud.channel.v1.IQueryEligibleBillingAccountsRequest=} [properties] Properties to set + * @returns {google.cloud.channel.v1.QueryEligibleBillingAccountsRequest} QueryEligibleBillingAccountsRequest instance + */ + QueryEligibleBillingAccountsRequest.create = function create(properties) { + return new QueryEligibleBillingAccountsRequest(properties); + }; + + /** + * Encodes the specified QueryEligibleBillingAccountsRequest message. Does not implicitly {@link google.cloud.channel.v1.QueryEligibleBillingAccountsRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.channel.v1.QueryEligibleBillingAccountsRequest + * @static + * @param {google.cloud.channel.v1.IQueryEligibleBillingAccountsRequest} message QueryEligibleBillingAccountsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + QueryEligibleBillingAccountsRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.customer != null && Object.hasOwnProperty.call(message, "customer")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.customer); + if (message.skus != null && message.skus.length) + for (var i = 0; i < message.skus.length; ++i) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.skus[i]); + return writer; + }; + + /** + * Encodes the specified QueryEligibleBillingAccountsRequest message, length delimited. Does not implicitly {@link google.cloud.channel.v1.QueryEligibleBillingAccountsRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.channel.v1.QueryEligibleBillingAccountsRequest + * @static + * @param {google.cloud.channel.v1.IQueryEligibleBillingAccountsRequest} message QueryEligibleBillingAccountsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + QueryEligibleBillingAccountsRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a QueryEligibleBillingAccountsRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.channel.v1.QueryEligibleBillingAccountsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.channel.v1.QueryEligibleBillingAccountsRequest} QueryEligibleBillingAccountsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + QueryEligibleBillingAccountsRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.channel.v1.QueryEligibleBillingAccountsRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.customer = reader.string(); + break; + } + case 2: { + if (!(message.skus && message.skus.length)) + message.skus = []; + message.skus.push(reader.string()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a QueryEligibleBillingAccountsRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.channel.v1.QueryEligibleBillingAccountsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.channel.v1.QueryEligibleBillingAccountsRequest} QueryEligibleBillingAccountsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + QueryEligibleBillingAccountsRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a QueryEligibleBillingAccountsRequest message. + * @function verify + * @memberof google.cloud.channel.v1.QueryEligibleBillingAccountsRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + QueryEligibleBillingAccountsRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.customer != null && message.hasOwnProperty("customer")) + if (!$util.isString(message.customer)) + return "customer: string expected"; + if (message.skus != null && message.hasOwnProperty("skus")) { + if (!Array.isArray(message.skus)) + return "skus: array expected"; + for (var i = 0; i < message.skus.length; ++i) + if (!$util.isString(message.skus[i])) + return "skus: string[] expected"; + } + return null; + }; + + /** + * Creates a QueryEligibleBillingAccountsRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.channel.v1.QueryEligibleBillingAccountsRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.channel.v1.QueryEligibleBillingAccountsRequest} QueryEligibleBillingAccountsRequest + */ + QueryEligibleBillingAccountsRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.channel.v1.QueryEligibleBillingAccountsRequest) + return object; + var message = new $root.google.cloud.channel.v1.QueryEligibleBillingAccountsRequest(); + if (object.customer != null) + message.customer = String(object.customer); + if (object.skus) { + if (!Array.isArray(object.skus)) + throw TypeError(".google.cloud.channel.v1.QueryEligibleBillingAccountsRequest.skus: array expected"); + message.skus = []; + for (var i = 0; i < object.skus.length; ++i) + message.skus[i] = String(object.skus[i]); + } + return message; + }; + + /** + * Creates a plain object from a QueryEligibleBillingAccountsRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.channel.v1.QueryEligibleBillingAccountsRequest + * @static + * @param {google.cloud.channel.v1.QueryEligibleBillingAccountsRequest} message QueryEligibleBillingAccountsRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + QueryEligibleBillingAccountsRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.skus = []; + if (options.defaults) + object.customer = ""; + if (message.customer != null && message.hasOwnProperty("customer")) + object.customer = message.customer; + if (message.skus && message.skus.length) { + object.skus = []; + for (var j = 0; j < message.skus.length; ++j) + object.skus[j] = message.skus[j]; + } + return object; + }; + + /** + * Converts this QueryEligibleBillingAccountsRequest to JSON. + * @function toJSON + * @memberof google.cloud.channel.v1.QueryEligibleBillingAccountsRequest + * @instance + * @returns {Object.} JSON object + */ + QueryEligibleBillingAccountsRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for QueryEligibleBillingAccountsRequest + * @function getTypeUrl + * @memberof google.cloud.channel.v1.QueryEligibleBillingAccountsRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + QueryEligibleBillingAccountsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.channel.v1.QueryEligibleBillingAccountsRequest"; + }; + + return QueryEligibleBillingAccountsRequest; + })(); + + v1.QueryEligibleBillingAccountsResponse = (function() { + + /** + * Properties of a QueryEligibleBillingAccountsResponse. + * @memberof google.cloud.channel.v1 + * @interface IQueryEligibleBillingAccountsResponse + * @property {Array.|null} [skuPurchaseGroups] QueryEligibleBillingAccountsResponse skuPurchaseGroups + */ + + /** + * Constructs a new QueryEligibleBillingAccountsResponse. + * @memberof google.cloud.channel.v1 + * @classdesc Represents a QueryEligibleBillingAccountsResponse. + * @implements IQueryEligibleBillingAccountsResponse + * @constructor + * @param {google.cloud.channel.v1.IQueryEligibleBillingAccountsResponse=} [properties] Properties to set + */ + function QueryEligibleBillingAccountsResponse(properties) { + this.skuPurchaseGroups = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * QueryEligibleBillingAccountsResponse skuPurchaseGroups. + * @member {Array.} skuPurchaseGroups + * @memberof google.cloud.channel.v1.QueryEligibleBillingAccountsResponse + * @instance + */ + QueryEligibleBillingAccountsResponse.prototype.skuPurchaseGroups = $util.emptyArray; + + /** + * Creates a new QueryEligibleBillingAccountsResponse instance using the specified properties. + * @function create + * @memberof google.cloud.channel.v1.QueryEligibleBillingAccountsResponse + * @static + * @param {google.cloud.channel.v1.IQueryEligibleBillingAccountsResponse=} [properties] Properties to set + * @returns {google.cloud.channel.v1.QueryEligibleBillingAccountsResponse} QueryEligibleBillingAccountsResponse instance + */ + QueryEligibleBillingAccountsResponse.create = function create(properties) { + return new QueryEligibleBillingAccountsResponse(properties); + }; + + /** + * Encodes the specified QueryEligibleBillingAccountsResponse message. Does not implicitly {@link google.cloud.channel.v1.QueryEligibleBillingAccountsResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.channel.v1.QueryEligibleBillingAccountsResponse + * @static + * @param {google.cloud.channel.v1.IQueryEligibleBillingAccountsResponse} message QueryEligibleBillingAccountsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + QueryEligibleBillingAccountsResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.skuPurchaseGroups != null && message.skuPurchaseGroups.length) + for (var i = 0; i < message.skuPurchaseGroups.length; ++i) + $root.google.cloud.channel.v1.SkuPurchaseGroup.encode(message.skuPurchaseGroups[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified QueryEligibleBillingAccountsResponse message, length delimited. Does not implicitly {@link google.cloud.channel.v1.QueryEligibleBillingAccountsResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.channel.v1.QueryEligibleBillingAccountsResponse + * @static + * @param {google.cloud.channel.v1.IQueryEligibleBillingAccountsResponse} message QueryEligibleBillingAccountsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + QueryEligibleBillingAccountsResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a QueryEligibleBillingAccountsResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.channel.v1.QueryEligibleBillingAccountsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.channel.v1.QueryEligibleBillingAccountsResponse} QueryEligibleBillingAccountsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + QueryEligibleBillingAccountsResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.channel.v1.QueryEligibleBillingAccountsResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.skuPurchaseGroups && message.skuPurchaseGroups.length)) + message.skuPurchaseGroups = []; + message.skuPurchaseGroups.push($root.google.cloud.channel.v1.SkuPurchaseGroup.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a QueryEligibleBillingAccountsResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.channel.v1.QueryEligibleBillingAccountsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.channel.v1.QueryEligibleBillingAccountsResponse} QueryEligibleBillingAccountsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + QueryEligibleBillingAccountsResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a QueryEligibleBillingAccountsResponse message. + * @function verify + * @memberof google.cloud.channel.v1.QueryEligibleBillingAccountsResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + QueryEligibleBillingAccountsResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.skuPurchaseGroups != null && message.hasOwnProperty("skuPurchaseGroups")) { + if (!Array.isArray(message.skuPurchaseGroups)) + return "skuPurchaseGroups: array expected"; + for (var i = 0; i < message.skuPurchaseGroups.length; ++i) { + var error = $root.google.cloud.channel.v1.SkuPurchaseGroup.verify(message.skuPurchaseGroups[i]); + if (error) + return "skuPurchaseGroups." + error; + } + } + return null; + }; + + /** + * Creates a QueryEligibleBillingAccountsResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.channel.v1.QueryEligibleBillingAccountsResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.channel.v1.QueryEligibleBillingAccountsResponse} QueryEligibleBillingAccountsResponse + */ + QueryEligibleBillingAccountsResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.channel.v1.QueryEligibleBillingAccountsResponse) + return object; + var message = new $root.google.cloud.channel.v1.QueryEligibleBillingAccountsResponse(); + if (object.skuPurchaseGroups) { + if (!Array.isArray(object.skuPurchaseGroups)) + throw TypeError(".google.cloud.channel.v1.QueryEligibleBillingAccountsResponse.skuPurchaseGroups: array expected"); + message.skuPurchaseGroups = []; + for (var i = 0; i < object.skuPurchaseGroups.length; ++i) { + if (typeof object.skuPurchaseGroups[i] !== "object") + throw TypeError(".google.cloud.channel.v1.QueryEligibleBillingAccountsResponse.skuPurchaseGroups: object expected"); + message.skuPurchaseGroups[i] = $root.google.cloud.channel.v1.SkuPurchaseGroup.fromObject(object.skuPurchaseGroups[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a QueryEligibleBillingAccountsResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.channel.v1.QueryEligibleBillingAccountsResponse + * @static + * @param {google.cloud.channel.v1.QueryEligibleBillingAccountsResponse} message QueryEligibleBillingAccountsResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + QueryEligibleBillingAccountsResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.skuPurchaseGroups = []; + if (message.skuPurchaseGroups && message.skuPurchaseGroups.length) { + object.skuPurchaseGroups = []; + for (var j = 0; j < message.skuPurchaseGroups.length; ++j) + object.skuPurchaseGroups[j] = $root.google.cloud.channel.v1.SkuPurchaseGroup.toObject(message.skuPurchaseGroups[j], options); + } + return object; + }; + + /** + * Converts this QueryEligibleBillingAccountsResponse to JSON. + * @function toJSON + * @memberof google.cloud.channel.v1.QueryEligibleBillingAccountsResponse + * @instance + * @returns {Object.} JSON object + */ + QueryEligibleBillingAccountsResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for QueryEligibleBillingAccountsResponse + * @function getTypeUrl + * @memberof google.cloud.channel.v1.QueryEligibleBillingAccountsResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + QueryEligibleBillingAccountsResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.channel.v1.QueryEligibleBillingAccountsResponse"; + }; + + return QueryEligibleBillingAccountsResponse; + })(); + + v1.SkuPurchaseGroup = (function() { + + /** + * Properties of a SkuPurchaseGroup. + * @memberof google.cloud.channel.v1 + * @interface ISkuPurchaseGroup + * @property {Array.|null} [skus] SkuPurchaseGroup skus + * @property {Array.|null} [billingAccountPurchaseInfos] SkuPurchaseGroup billingAccountPurchaseInfos + */ + + /** + * Constructs a new SkuPurchaseGroup. + * @memberof google.cloud.channel.v1 + * @classdesc Represents a SkuPurchaseGroup. + * @implements ISkuPurchaseGroup + * @constructor + * @param {google.cloud.channel.v1.ISkuPurchaseGroup=} [properties] Properties to set + */ + function SkuPurchaseGroup(properties) { + this.skus = []; + this.billingAccountPurchaseInfos = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * SkuPurchaseGroup skus. + * @member {Array.} skus + * @memberof google.cloud.channel.v1.SkuPurchaseGroup + * @instance + */ + SkuPurchaseGroup.prototype.skus = $util.emptyArray; + + /** + * SkuPurchaseGroup billingAccountPurchaseInfos. + * @member {Array.} billingAccountPurchaseInfos + * @memberof google.cloud.channel.v1.SkuPurchaseGroup + * @instance + */ + SkuPurchaseGroup.prototype.billingAccountPurchaseInfos = $util.emptyArray; + + /** + * Creates a new SkuPurchaseGroup instance using the specified properties. + * @function create + * @memberof google.cloud.channel.v1.SkuPurchaseGroup + * @static + * @param {google.cloud.channel.v1.ISkuPurchaseGroup=} [properties] Properties to set + * @returns {google.cloud.channel.v1.SkuPurchaseGroup} SkuPurchaseGroup instance + */ + SkuPurchaseGroup.create = function create(properties) { + return new SkuPurchaseGroup(properties); + }; + + /** + * Encodes the specified SkuPurchaseGroup message. Does not implicitly {@link google.cloud.channel.v1.SkuPurchaseGroup.verify|verify} messages. + * @function encode + * @memberof google.cloud.channel.v1.SkuPurchaseGroup + * @static + * @param {google.cloud.channel.v1.ISkuPurchaseGroup} message SkuPurchaseGroup message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SkuPurchaseGroup.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.skus != null && message.skus.length) + for (var i = 0; i < message.skus.length; ++i) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.skus[i]); + if (message.billingAccountPurchaseInfos != null && message.billingAccountPurchaseInfos.length) + for (var i = 0; i < message.billingAccountPurchaseInfos.length; ++i) + $root.google.cloud.channel.v1.BillingAccountPurchaseInfo.encode(message.billingAccountPurchaseInfos[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified SkuPurchaseGroup message, length delimited. Does not implicitly {@link google.cloud.channel.v1.SkuPurchaseGroup.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.channel.v1.SkuPurchaseGroup + * @static + * @param {google.cloud.channel.v1.ISkuPurchaseGroup} message SkuPurchaseGroup message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SkuPurchaseGroup.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a SkuPurchaseGroup message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.channel.v1.SkuPurchaseGroup + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.channel.v1.SkuPurchaseGroup} SkuPurchaseGroup + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SkuPurchaseGroup.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.channel.v1.SkuPurchaseGroup(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.skus && message.skus.length)) + message.skus = []; + message.skus.push(reader.string()); + break; + } + case 2: { + if (!(message.billingAccountPurchaseInfos && message.billingAccountPurchaseInfos.length)) + message.billingAccountPurchaseInfos = []; + message.billingAccountPurchaseInfos.push($root.google.cloud.channel.v1.BillingAccountPurchaseInfo.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a SkuPurchaseGroup message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.channel.v1.SkuPurchaseGroup + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.channel.v1.SkuPurchaseGroup} SkuPurchaseGroup + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SkuPurchaseGroup.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a SkuPurchaseGroup message. + * @function verify + * @memberof google.cloud.channel.v1.SkuPurchaseGroup + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + SkuPurchaseGroup.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.skus != null && message.hasOwnProperty("skus")) { + if (!Array.isArray(message.skus)) + return "skus: array expected"; + for (var i = 0; i < message.skus.length; ++i) + if (!$util.isString(message.skus[i])) + return "skus: string[] expected"; + } + if (message.billingAccountPurchaseInfos != null && message.hasOwnProperty("billingAccountPurchaseInfos")) { + if (!Array.isArray(message.billingAccountPurchaseInfos)) + return "billingAccountPurchaseInfos: array expected"; + for (var i = 0; i < message.billingAccountPurchaseInfos.length; ++i) { + var error = $root.google.cloud.channel.v1.BillingAccountPurchaseInfo.verify(message.billingAccountPurchaseInfos[i]); + if (error) + return "billingAccountPurchaseInfos." + error; + } + } + return null; + }; + + /** + * Creates a SkuPurchaseGroup message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.channel.v1.SkuPurchaseGroup + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.channel.v1.SkuPurchaseGroup} SkuPurchaseGroup + */ + SkuPurchaseGroup.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.channel.v1.SkuPurchaseGroup) + return object; + var message = new $root.google.cloud.channel.v1.SkuPurchaseGroup(); + if (object.skus) { + if (!Array.isArray(object.skus)) + throw TypeError(".google.cloud.channel.v1.SkuPurchaseGroup.skus: array expected"); + message.skus = []; + for (var i = 0; i < object.skus.length; ++i) + message.skus[i] = String(object.skus[i]); + } + if (object.billingAccountPurchaseInfos) { + if (!Array.isArray(object.billingAccountPurchaseInfos)) + throw TypeError(".google.cloud.channel.v1.SkuPurchaseGroup.billingAccountPurchaseInfos: array expected"); + message.billingAccountPurchaseInfos = []; + for (var i = 0; i < object.billingAccountPurchaseInfos.length; ++i) { + if (typeof object.billingAccountPurchaseInfos[i] !== "object") + throw TypeError(".google.cloud.channel.v1.SkuPurchaseGroup.billingAccountPurchaseInfos: object expected"); + message.billingAccountPurchaseInfos[i] = $root.google.cloud.channel.v1.BillingAccountPurchaseInfo.fromObject(object.billingAccountPurchaseInfos[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a SkuPurchaseGroup message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.channel.v1.SkuPurchaseGroup + * @static + * @param {google.cloud.channel.v1.SkuPurchaseGroup} message SkuPurchaseGroup + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + SkuPurchaseGroup.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.skus = []; + object.billingAccountPurchaseInfos = []; + } + if (message.skus && message.skus.length) { + object.skus = []; + for (var j = 0; j < message.skus.length; ++j) + object.skus[j] = message.skus[j]; + } + if (message.billingAccountPurchaseInfos && message.billingAccountPurchaseInfos.length) { + object.billingAccountPurchaseInfos = []; + for (var j = 0; j < message.billingAccountPurchaseInfos.length; ++j) + object.billingAccountPurchaseInfos[j] = $root.google.cloud.channel.v1.BillingAccountPurchaseInfo.toObject(message.billingAccountPurchaseInfos[j], options); + } + return object; + }; + + /** + * Converts this SkuPurchaseGroup to JSON. + * @function toJSON + * @memberof google.cloud.channel.v1.SkuPurchaseGroup + * @instance + * @returns {Object.} JSON object + */ + SkuPurchaseGroup.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for SkuPurchaseGroup + * @function getTypeUrl + * @memberof google.cloud.channel.v1.SkuPurchaseGroup + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + SkuPurchaseGroup.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.channel.v1.SkuPurchaseGroup"; + }; + + return SkuPurchaseGroup; + })(); + + v1.BillingAccountPurchaseInfo = (function() { + + /** + * Properties of a BillingAccountPurchaseInfo. + * @memberof google.cloud.channel.v1 + * @interface IBillingAccountPurchaseInfo + * @property {google.cloud.channel.v1.IBillingAccount|null} [billingAccount] BillingAccountPurchaseInfo billingAccount + */ + + /** + * Constructs a new BillingAccountPurchaseInfo. + * @memberof google.cloud.channel.v1 + * @classdesc Represents a BillingAccountPurchaseInfo. + * @implements IBillingAccountPurchaseInfo + * @constructor + * @param {google.cloud.channel.v1.IBillingAccountPurchaseInfo=} [properties] Properties to set + */ + function BillingAccountPurchaseInfo(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * BillingAccountPurchaseInfo billingAccount. + * @member {google.cloud.channel.v1.IBillingAccount|null|undefined} billingAccount + * @memberof google.cloud.channel.v1.BillingAccountPurchaseInfo + * @instance + */ + BillingAccountPurchaseInfo.prototype.billingAccount = null; + + /** + * Creates a new BillingAccountPurchaseInfo instance using the specified properties. + * @function create + * @memberof google.cloud.channel.v1.BillingAccountPurchaseInfo + * @static + * @param {google.cloud.channel.v1.IBillingAccountPurchaseInfo=} [properties] Properties to set + * @returns {google.cloud.channel.v1.BillingAccountPurchaseInfo} BillingAccountPurchaseInfo instance + */ + BillingAccountPurchaseInfo.create = function create(properties) { + return new BillingAccountPurchaseInfo(properties); + }; + + /** + * Encodes the specified BillingAccountPurchaseInfo message. Does not implicitly {@link google.cloud.channel.v1.BillingAccountPurchaseInfo.verify|verify} messages. + * @function encode + * @memberof google.cloud.channel.v1.BillingAccountPurchaseInfo + * @static + * @param {google.cloud.channel.v1.IBillingAccountPurchaseInfo} message BillingAccountPurchaseInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BillingAccountPurchaseInfo.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.billingAccount != null && Object.hasOwnProperty.call(message, "billingAccount")) + $root.google.cloud.channel.v1.BillingAccount.encode(message.billingAccount, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified BillingAccountPurchaseInfo message, length delimited. Does not implicitly {@link google.cloud.channel.v1.BillingAccountPurchaseInfo.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.channel.v1.BillingAccountPurchaseInfo + * @static + * @param {google.cloud.channel.v1.IBillingAccountPurchaseInfo} message BillingAccountPurchaseInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BillingAccountPurchaseInfo.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a BillingAccountPurchaseInfo message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.channel.v1.BillingAccountPurchaseInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.channel.v1.BillingAccountPurchaseInfo} BillingAccountPurchaseInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BillingAccountPurchaseInfo.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.channel.v1.BillingAccountPurchaseInfo(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.billingAccount = $root.google.cloud.channel.v1.BillingAccount.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a BillingAccountPurchaseInfo message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.channel.v1.BillingAccountPurchaseInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.channel.v1.BillingAccountPurchaseInfo} BillingAccountPurchaseInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BillingAccountPurchaseInfo.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a BillingAccountPurchaseInfo message. + * @function verify + * @memberof google.cloud.channel.v1.BillingAccountPurchaseInfo + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + BillingAccountPurchaseInfo.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.billingAccount != null && message.hasOwnProperty("billingAccount")) { + var error = $root.google.cloud.channel.v1.BillingAccount.verify(message.billingAccount); + if (error) + return "billingAccount." + error; + } + return null; + }; + + /** + * Creates a BillingAccountPurchaseInfo message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.channel.v1.BillingAccountPurchaseInfo + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.channel.v1.BillingAccountPurchaseInfo} BillingAccountPurchaseInfo + */ + BillingAccountPurchaseInfo.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.channel.v1.BillingAccountPurchaseInfo) + return object; + var message = new $root.google.cloud.channel.v1.BillingAccountPurchaseInfo(); + if (object.billingAccount != null) { + if (typeof object.billingAccount !== "object") + throw TypeError(".google.cloud.channel.v1.BillingAccountPurchaseInfo.billingAccount: object expected"); + message.billingAccount = $root.google.cloud.channel.v1.BillingAccount.fromObject(object.billingAccount); + } + return message; + }; + + /** + * Creates a plain object from a BillingAccountPurchaseInfo message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.channel.v1.BillingAccountPurchaseInfo + * @static + * @param {google.cloud.channel.v1.BillingAccountPurchaseInfo} message BillingAccountPurchaseInfo + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + BillingAccountPurchaseInfo.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.billingAccount = null; + if (message.billingAccount != null && message.hasOwnProperty("billingAccount")) + object.billingAccount = $root.google.cloud.channel.v1.BillingAccount.toObject(message.billingAccount, options); + return object; + }; + + /** + * Converts this BillingAccountPurchaseInfo to JSON. + * @function toJSON + * @memberof google.cloud.channel.v1.BillingAccountPurchaseInfo + * @instance + * @returns {Object.} JSON object + */ + BillingAccountPurchaseInfo.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for BillingAccountPurchaseInfo + * @function getTypeUrl + * @memberof google.cloud.channel.v1.BillingAccountPurchaseInfo + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + BillingAccountPurchaseInfo.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.channel.v1.BillingAccountPurchaseInfo"; + }; + + return BillingAccountPurchaseInfo; + })(); + v1.RegisterSubscriberRequest = (function() { /** @@ -54600,25 +55980,25 @@ return GeneratedCodeInfo; })(); - protobuf.Any = (function() { + protobuf.Timestamp = (function() { /** - * Properties of an Any. + * Properties of a Timestamp. * @memberof google.protobuf - * @interface IAny - * @property {string|null} [type_url] Any type_url - * @property {Uint8Array|null} [value] Any value + * @interface ITimestamp + * @property {number|Long|null} [seconds] Timestamp seconds + * @property {number|null} [nanos] Timestamp nanos */ /** - * Constructs a new Any. + * Constructs a new Timestamp. * @memberof google.protobuf - * @classdesc Represents an Any. - * @implements IAny + * @classdesc Represents a Timestamp. + * @implements ITimestamp * @constructor - * @param {google.protobuf.IAny=} [properties] Properties to set + * @param {google.protobuf.ITimestamp=} [properties] Properties to set */ - function Any(properties) { + function Timestamp(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -54626,89 +56006,89 @@ } /** - * Any type_url. - * @member {string} type_url - * @memberof google.protobuf.Any + * Timestamp seconds. + * @member {number|Long} seconds + * @memberof google.protobuf.Timestamp * @instance */ - Any.prototype.type_url = ""; + Timestamp.prototype.seconds = $util.Long ? $util.Long.fromBits(0,0,false) : 0; /** - * Any value. - * @member {Uint8Array} value - * @memberof google.protobuf.Any + * Timestamp nanos. + * @member {number} nanos + * @memberof google.protobuf.Timestamp * @instance */ - Any.prototype.value = $util.newBuffer([]); + Timestamp.prototype.nanos = 0; /** - * Creates a new Any instance using the specified properties. + * Creates a new Timestamp instance using the specified properties. * @function create - * @memberof google.protobuf.Any + * @memberof google.protobuf.Timestamp * @static - * @param {google.protobuf.IAny=} [properties] Properties to set - * @returns {google.protobuf.Any} Any instance + * @param {google.protobuf.ITimestamp=} [properties] Properties to set + * @returns {google.protobuf.Timestamp} Timestamp instance */ - Any.create = function create(properties) { - return new Any(properties); + Timestamp.create = function create(properties) { + return new Timestamp(properties); }; /** - * Encodes the specified Any message. Does not implicitly {@link google.protobuf.Any.verify|verify} messages. + * Encodes the specified Timestamp message. Does not implicitly {@link google.protobuf.Timestamp.verify|verify} messages. * @function encode - * @memberof google.protobuf.Any + * @memberof google.protobuf.Timestamp * @static - * @param {google.protobuf.IAny} message Any message or plain object to encode + * @param {google.protobuf.ITimestamp} message Timestamp message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - Any.encode = function encode(message, writer) { + Timestamp.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); + 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 Any message, length delimited. Does not implicitly {@link google.protobuf.Any.verify|verify} messages. + * Encodes the specified Timestamp message, length delimited. Does not implicitly {@link google.protobuf.Timestamp.verify|verify} messages. * @function encodeDelimited - * @memberof google.protobuf.Any + * @memberof google.protobuf.Timestamp * @static - * @param {google.protobuf.IAny} message Any message or plain object to encode + * @param {google.protobuf.ITimestamp} message Timestamp message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - Any.encodeDelimited = function encodeDelimited(message, writer) { + Timestamp.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes an Any message from the specified reader or buffer. + * Decodes a Timestamp message from the specified reader or buffer. * @function decode - * @memberof google.protobuf.Any + * @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.Any} Any + * @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 */ - Any.decode = function decode(reader, length) { + Timestamp.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.Any(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.Timestamp(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: { - message.type_url = reader.string(); + message.seconds = reader.int64(); break; } case 2: { - message.value = reader.bytes(); + message.nanos = reader.int32(); break; } default: @@ -54720,141 +56100,146 @@ }; /** - * Decodes an Any message from the specified reader or buffer, length delimited. + * Decodes a Timestamp message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.protobuf.Any + * @memberof google.protobuf.Timestamp * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.Any} Any + * @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 */ - Any.decodeDelimited = function decodeDelimited(reader) { + Timestamp.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies an Any message. + * Verifies a Timestamp message. * @function verify - * @memberof google.protobuf.Any + * @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 */ - Any.verify = function verify(message) { + Timestamp.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"; + 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 an Any message from a plain object. Also converts values to their respective internal types. + * Creates a Timestamp message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.protobuf.Any + * @memberof google.protobuf.Timestamp * @static * @param {Object.} object Plain object - * @returns {google.protobuf.Any} Any + * @returns {google.protobuf.Timestamp} Timestamp */ - Any.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.Any) + Timestamp.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.Timestamp) 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; + 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 an Any message. Also converts values to other types if specified. + * Creates a plain object from a Timestamp message. Also converts values to other types if specified. * @function toObject - * @memberof google.protobuf.Any + * @memberof google.protobuf.Timestamp * @static - * @param {google.protobuf.Any} message Any + * @param {google.protobuf.Timestamp} message Timestamp * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - Any.toObject = function toObject(message, options) { + Timestamp.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 ($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.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; + 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 Any to JSON. + * Converts this Timestamp to JSON. * @function toJSON - * @memberof google.protobuf.Any + * @memberof google.protobuf.Timestamp * @instance * @returns {Object.} JSON object */ - Any.prototype.toJSON = function toJSON() { + Timestamp.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for Any + * Gets the default type url for Timestamp * @function getTypeUrl - * @memberof google.protobuf.Any + * @memberof google.protobuf.Timestamp * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - Any.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + Timestamp.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.protobuf.Any"; + return typeUrlPrefix + "/google.protobuf.Timestamp"; }; - return Any; + return Timestamp; })(); - protobuf.Timestamp = (function() { + protobuf.Any = (function() { /** - * Properties of a Timestamp. + * Properties of an Any. * @memberof google.protobuf - * @interface ITimestamp - * @property {number|Long|null} [seconds] Timestamp seconds - * @property {number|null} [nanos] Timestamp nanos + * @interface IAny + * @property {string|null} [type_url] Any type_url + * @property {Uint8Array|null} [value] Any value */ /** - * Constructs a new Timestamp. + * Constructs a new Any. * @memberof google.protobuf - * @classdesc Represents a Timestamp. - * @implements ITimestamp + * @classdesc Represents an Any. + * @implements IAny * @constructor - * @param {google.protobuf.ITimestamp=} [properties] Properties to set + * @param {google.protobuf.IAny=} [properties] Properties to set */ - function Timestamp(properties) { + function Any(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -54862,89 +56247,89 @@ } /** - * Timestamp seconds. - * @member {number|Long} seconds - * @memberof google.protobuf.Timestamp + * Any type_url. + * @member {string} type_url + * @memberof google.protobuf.Any * @instance */ - Timestamp.prototype.seconds = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + Any.prototype.type_url = ""; /** - * Timestamp nanos. - * @member {number} nanos - * @memberof google.protobuf.Timestamp + * Any value. + * @member {Uint8Array} value + * @memberof google.protobuf.Any * @instance */ - Timestamp.prototype.nanos = 0; + Any.prototype.value = $util.newBuffer([]); /** - * Creates a new Timestamp instance using the specified properties. + * Creates a new Any instance using the specified properties. * @function create - * @memberof google.protobuf.Timestamp + * @memberof google.protobuf.Any * @static - * @param {google.protobuf.ITimestamp=} [properties] Properties to set - * @returns {google.protobuf.Timestamp} Timestamp instance + * @param {google.protobuf.IAny=} [properties] Properties to set + * @returns {google.protobuf.Any} Any instance */ - Timestamp.create = function create(properties) { - return new Timestamp(properties); + Any.create = function create(properties) { + return new Any(properties); }; /** - * Encodes the specified Timestamp message. Does not implicitly {@link google.protobuf.Timestamp.verify|verify} messages. + * Encodes the specified Any message. Does not implicitly {@link google.protobuf.Any.verify|verify} messages. * @function encode - * @memberof google.protobuf.Timestamp + * @memberof google.protobuf.Any * @static - * @param {google.protobuf.ITimestamp} message Timestamp message or plain object to encode + * @param {google.protobuf.IAny} message Any message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - Timestamp.encode = function encode(message, writer) { + Any.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); + 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 Timestamp message, length delimited. Does not implicitly {@link google.protobuf.Timestamp.verify|verify} messages. + * Encodes the specified Any message, length delimited. Does not implicitly {@link google.protobuf.Any.verify|verify} messages. * @function encodeDelimited - * @memberof google.protobuf.Timestamp + * @memberof google.protobuf.Any * @static - * @param {google.protobuf.ITimestamp} message Timestamp message or plain object to encode + * @param {google.protobuf.IAny} message Any message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - Timestamp.encodeDelimited = function encodeDelimited(message, writer) { + Any.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a Timestamp message from the specified reader or buffer. + * Decodes an Any message from the specified reader or buffer. * @function decode - * @memberof google.protobuf.Timestamp + * @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.Timestamp} Timestamp + * @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 */ - Timestamp.decode = function decode(reader, length) { + Any.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.Timestamp(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.Any(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: { - message.seconds = reader.int64(); + message.type_url = reader.string(); break; } case 2: { - message.nanos = reader.int32(); + message.value = reader.bytes(); break; } default: @@ -54956,125 +56341,120 @@ }; /** - * Decodes a Timestamp message from the specified reader or buffer, length delimited. + * Decodes an Any message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.protobuf.Timestamp + * @memberof google.protobuf.Any * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.Timestamp} Timestamp + * @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 */ - Timestamp.decodeDelimited = function decodeDelimited(reader) { + Any.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a Timestamp message. + * Verifies an Any message. * @function verify - * @memberof google.protobuf.Timestamp + * @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 */ - Timestamp.verify = function verify(message) { + Any.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"; + 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 a Timestamp message from a plain object. Also converts values to their respective internal types. + * Creates an Any message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.protobuf.Timestamp + * @memberof google.protobuf.Any * @static * @param {Object.} object Plain object - * @returns {google.protobuf.Timestamp} Timestamp + * @returns {google.protobuf.Any} Any */ - Timestamp.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.Timestamp) + Any.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.Any) 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; + 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 a Timestamp message. Also converts values to other types if specified. + * Creates a plain object from an Any message. Also converts values to other types if specified. * @function toObject - * @memberof google.protobuf.Timestamp + * @memberof google.protobuf.Any * @static - * @param {google.protobuf.Timestamp} message Timestamp + * @param {google.protobuf.Any} message Any * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - Timestamp.toObject = function toObject(message, options) { + Any.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; + object.type_url = ""; + if (options.bytes === String) + object.value = ""; + else { + object.value = []; + if (options.bytes !== Array) + object.value = $util.newBuffer(object.value); + } } - 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; + 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 Timestamp to JSON. + * Converts this Any to JSON. * @function toJSON - * @memberof google.protobuf.Timestamp + * @memberof google.protobuf.Any * @instance * @returns {Object.} JSON object */ - Timestamp.prototype.toJSON = function toJSON() { + Any.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for Timestamp + * Gets the default type url for Any * @function getTypeUrl - * @memberof google.protobuf.Timestamp + * @memberof google.protobuf.Any * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - Timestamp.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + Any.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.protobuf.Timestamp"; + return typeUrlPrefix + "/google.protobuf.Any"; }; - return Timestamp; + return Any; })(); protobuf.Duration = (function() { diff --git a/packages/google-cloud-channel/protos/protos.json b/packages/google-cloud-channel/protos/protos.json index 0b5a06fe1ac..844aca95b77 100644 --- a/packages/google-cloud-channel/protos/protos.json +++ b/packages/google-cloud-channel/protos/protos.json @@ -14,6 +14,46 @@ "java_package": "com.google.cloud.channel.v1" }, "nested": { + "BillingAccount": { + "options": { + "(google.api.resource).type": "cloudchannel.googleapis.com/BillingAccount", + "(google.api.resource).pattern": "accounts/{account}/billingAccounts/{billing_account}" + }, + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "displayName": { + "type": "string", + "id": 2 + }, + "createTime": { + "type": "google.protobuf.Timestamp", + "id": 3, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "currencyCode": { + "type": "string", + "id": 4, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "regionCode": { + "type": "string", + "id": 5, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + } + } + }, "ChannelPartnerLinkView": { "values": { "UNSPECIFIED": 0, @@ -742,7 +782,8 @@ "REASON_UNSPECIFIED": 0, "PENDING_TOS_ACCEPTANCE": 1, "SKU_NOT_ELIGIBLE": 2, - "SKU_SUSPENDED": 3 + "SKU_SUSPENDED": 3, + "CHANNEL_PARTNER_NOT_AUTHORIZED_FOR_SKU": 4 } } } @@ -879,7 +920,8 @@ "PARAMETER_TYPE_UNSPECIFIED": 0, "INT64": 1, "STRING": 2, - "DOUBLE": 3 + "DOUBLE": 3, + "BOOLEAN": 4 } } } @@ -1613,7 +1655,10 @@ }, "channelPartnerGranularity": { "type": "ChannelPartnerGranularity", - "id": 5 + "id": 5, + "options": { + "deprecated": true + } }, "effectiveInvoiceMonth": { "type": "google.type.Date", @@ -1655,6 +1700,9 @@ } }, "ChannelPartnerGranularity": { + "options": { + "deprecated": true + }, "fields": {} } } @@ -2572,6 +2620,20 @@ } ] }, + "QueryEligibleBillingAccounts": { + "requestType": "QueryEligibleBillingAccountsRequest", + "responseType": "QueryEligibleBillingAccountsResponse", + "options": { + "(google.api.http).get": "/v1/{customer=accounts/*/customers/*}:queryEligibleBillingAccounts" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1/{customer=accounts/*/customers/*}:queryEligibleBillingAccounts" + } + } + ] + }, "RegisterSubscriber": { "requestType": "RegisterSubscriberRequest", "responseType": "RegisterSubscriberResponse", @@ -3017,6 +3079,13 @@ "options": { "(google.api.field_behavior)": "OPTIONAL" } + }, + "billingAccount": { + "type": "string", + "id": 8, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } } } }, @@ -3659,6 +3728,13 @@ "options": { "(google.api.field_behavior)": "OPTIONAL" } + }, + "billingAccount": { + "type": "string", + "id": 7, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } } } }, @@ -4070,6 +4146,13 @@ "options": { "(google.api.field_behavior)": "REQUIRED" } + }, + "billingAccount": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } } } }, @@ -4088,6 +4171,13 @@ "options": { "(google.api.field_behavior)": "OPTIONAL" } + }, + "billingAccount": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } } } } @@ -4114,6 +4204,57 @@ } } }, + "QueryEligibleBillingAccountsRequest": { + "fields": { + "customer": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "cloudchannel.googleapis.com/Customer" + } + }, + "skus": { + "rule": "repeated", + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "QueryEligibleBillingAccountsResponse": { + "fields": { + "skuPurchaseGroups": { + "rule": "repeated", + "type": "SkuPurchaseGroup", + "id": 1 + } + } + }, + "SkuPurchaseGroup": { + "fields": { + "skus": { + "rule": "repeated", + "type": "string", + "id": 1 + }, + "billingAccountPurchaseInfos": { + "rule": "repeated", + "type": "BillingAccountPurchaseInfo", + "id": 2 + } + } + }, + "BillingAccountPurchaseInfo": { + "fields": { + "billingAccount": { + "type": "BillingAccount", + "id": 1 + } + } + }, "RegisterSubscriberRequest": { "fields": { "account": { @@ -5771,26 +5912,26 @@ } } }, - "Any": { + "Timestamp": { "fields": { - "type_url": { - "type": "string", + "seconds": { + "type": "int64", "id": 1 }, - "value": { - "type": "bytes", + "nanos": { + "type": "int32", "id": 2 } } }, - "Timestamp": { + "Any": { "fields": { - "seconds": { - "type": "int64", + "type_url": { + "type": "string", "id": 1 }, - "nanos": { - "type": "int32", + "value": { + "type": "bytes", "id": 2 } } diff --git a/packages/google-cloud-channel/samples/README.md b/packages/google-cloud-channel/samples/README.md index ddbe490b5c9..4a266111ffe 100644 --- a/packages/google-cloud-channel/samples/README.md +++ b/packages/google-cloud-channel/samples/README.md @@ -53,6 +53,7 @@ * [Cloud_channel_service.list_transferable_skus](#cloud_channel_service.list_transferable_skus) * [Cloud_channel_service.lookup_offer](#cloud_channel_service.lookup_offer) * [Cloud_channel_service.provision_cloud_identity](#cloud_channel_service.provision_cloud_identity) + * [Cloud_channel_service.query_eligible_billing_accounts](#cloud_channel_service.query_eligible_billing_accounts) * [Cloud_channel_service.register_subscriber](#cloud_channel_service.register_subscriber) * [Cloud_channel_service.start_paid_service](#cloud_channel_service.start_paid_service) * [Cloud_channel_service.suspend_entitlement](#cloud_channel_service.suspend_entitlement) @@ -777,6 +778,23 @@ __Usage:__ +### Cloud_channel_service.query_eligible_billing_accounts + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-channel/samples/generated/v1/cloud_channel_service.query_eligible_billing_accounts.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-cloud-channel/samples/generated/v1/cloud_channel_service.query_eligible_billing_accounts.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-channel/samples/generated/v1/cloud_channel_service.query_eligible_billing_accounts.js` + + +----- + + + + ### Cloud_channel_service.register_subscriber View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-channel/samples/generated/v1/cloud_channel_service.register_subscriber.js). diff --git a/packages/google-cloud-channel/samples/generated/v1/cloud_channel_service.change_offer.js b/packages/google-cloud-channel/samples/generated/v1/cloud_channel_service.change_offer.js index 04242d5dcda..766b582e17f 100644 --- a/packages/google-cloud-channel/samples/generated/v1/cloud_channel_service.change_offer.js +++ b/packages/google-cloud-channel/samples/generated/v1/cloud_channel_service.change_offer.js @@ -63,6 +63,13 @@ function main(name, offer) { * (`00000000-0000-0000-0000-000000000000`). */ // const requestId = 'abc123' + /** + * Optional. The billing account resource name that is used to pay for this + * entitlement when setting up billing on a trial subscription. + * This field is only relevant for multi-currency accounts. It should be + * left empty for single currency accounts. + */ + // const billingAccount = 'abc123' // Imports the Channel library const {CloudChannelServiceClient} = require('@google-cloud/channel').v1; diff --git a/packages/google-cloud-channel/samples/generated/v1/cloud_channel_service.list_transferable_offers.js b/packages/google-cloud-channel/samples/generated/v1/cloud_channel_service.list_transferable_offers.js index 7c29086337d..23981a92bfc 100644 --- a/packages/google-cloud-channel/samples/generated/v1/cloud_channel_service.list_transferable_offers.js +++ b/packages/google-cloud-channel/samples/generated/v1/cloud_channel_service.list_transferable_offers.js @@ -66,6 +66,13 @@ function main(parent, sku) { * The default value is "en-US". */ // const languageCode = 'abc123' + /** + * Optional. The Billing Account to look up Offers for. Format: + * accounts/{account_id}/billingAccounts/{billing_account_id}. + * This field is only relevant for multi-currency accounts. It should be left + * empty for single currency accounts. + */ + // const billingAccount = 'abc123' // Imports the Channel library const {CloudChannelServiceClient} = require('@google-cloud/channel').v1; diff --git a/packages/google-cloud-channel/samples/generated/v1/cloud_channel_service.query_eligible_billing_accounts.js b/packages/google-cloud-channel/samples/generated/v1/cloud_channel_service.query_eligible_billing_accounts.js new file mode 100644 index 00000000000..e926e5c8175 --- /dev/null +++ b/packages/google-cloud-channel/samples/generated/v1/cloud_channel_service.query_eligible_billing_accounts.js @@ -0,0 +1,68 @@ +// Copyright 2023 Google LLC +// +// Licensed under the Apache License, Version 2.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(customer, skus) { + // [START cloudchannel_v1_generated_CloudChannelService_QueryEligibleBillingAccounts_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 resource name of the customer to list eligible billing + * accounts for. Format: accounts/{account_id}/customers/{customer_id}. + */ + // const customer = 'abc123' + /** + * Required. List of SKUs to list eligible billing accounts for. At least one + * SKU is required. Format: products/{product_id}/skus/{sku_id}. + */ + // const skus = ['abc','def'] + + // Imports the Channel library + const {CloudChannelServiceClient} = require('@google-cloud/channel').v1; + + // Instantiates a client + const channelClient = new CloudChannelServiceClient(); + + async function callQueryEligibleBillingAccounts() { + // Construct request + const request = { + customer, + skus, + }; + + // Run request + const response = await channelClient.queryEligibleBillingAccounts(request); + console.log(response); + } + + callQueryEligibleBillingAccounts(); + // [END cloudchannel_v1_generated_CloudChannelService_QueryEligibleBillingAccounts_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-channel/samples/generated/v1/snippet_metadata.google.cloud.channel.v1.json b/packages/google-cloud-channel/samples/generated/v1/snippet_metadata.google.cloud.channel.v1.json index 86d15ec83dc..eead4a7ae7b 100644 --- a/packages/google-cloud-channel/samples/generated/v1/snippet_metadata.google.cloud.channel.v1.json +++ b/packages/google-cloud-channel/samples/generated/v1/snippet_metadata.google.cloud.channel.v1.json @@ -1,7 +1,7 @@ { "clientLibrary": { "name": "nodejs-channel", - "version": "3.0.1", + "version": "3.1.0", "language": "TYPESCRIPT", "apis": [ { diff --git a/packages/google-cloud-channel/samples/generated/v1/snippet_metadata_google.cloud.channel.v1.json b/packages/google-cloud-channel/samples/generated/v1/snippet_metadata_google.cloud.channel.v1.json index 86d15ec83dc..7c70472aa3d 100644 --- a/packages/google-cloud-channel/samples/generated/v1/snippet_metadata_google.cloud.channel.v1.json +++ b/packages/google-cloud-channel/samples/generated/v1/snippet_metadata_google.cloud.channel.v1.json @@ -1,7 +1,7 @@ { "clientLibrary": { "name": "nodejs-channel", - "version": "3.0.1", + "version": "3.1.0", "language": "TYPESCRIPT", "apis": [ { @@ -307,7 +307,7 @@ "regionTag": "cloudchannel_v1_generated_CloudChannelService_CreateCustomer_async", "title": "CloudChannelReportsService createCustomer Sample", "origin": "API_DEFINITION", - "description": " Creates a new [Customer][google.cloud.channel.v1.Customer] resource under the reseller or distributor account. Possible error codes: * PERMISSION_DENIED: The reseller account making the request is different from the reseller account in the API request. * INVALID_ARGUMENT: * Required request parameters are missing or invalid. * Domain field value doesn't match the primary email domain. Return value: The newly created [Customer][google.cloud.channel.v1.Customer] resource.", + "description": " Creates a new [Customer][google.cloud.channel.v1.Customer] resource under the reseller or distributor account. Possible error codes: * PERMISSION_DENIED: * The reseller account making the request is different from the reseller account in the API request. * You are not authorized to create a customer. See https://support.google.com/channelservices/answer/9759265 * INVALID_ARGUMENT: * Required request parameters are missing or invalid. * Domain field value doesn't match the primary email domain. Return value: The newly created [Customer][google.cloud.channel.v1.Customer] resource.", "canonical": true, "file": "cloud_channel_service.create_customer.js", "language": "JAVASCRIPT", @@ -435,7 +435,7 @@ "regionTag": "cloudchannel_v1_generated_CloudChannelService_ImportCustomer_async", "title": "CloudChannelReportsService importCustomer Sample", "origin": "API_DEFINITION", - "description": " Imports a [Customer][google.cloud.channel.v1.Customer] from the Cloud Identity associated with the provided Cloud Identity ID or domain before a TransferEntitlements call. If a linked Customer already exists and overwrite_if_exists is true, it will update that Customer's data. Possible error codes: * PERMISSION_DENIED: The reseller account making the request is different from the reseller account in the API request. * NOT_FOUND: Cloud Identity doesn't exist or was deleted. * INVALID_ARGUMENT: Required parameters are missing, or the auth_token is expired or invalid. * ALREADY_EXISTS: A customer already exists and has conflicting critical fields. Requires an overwrite. Return value: The [Customer][google.cloud.channel.v1.Customer].", + "description": " Imports a [Customer][google.cloud.channel.v1.Customer] from the Cloud Identity associated with the provided Cloud Identity ID or domain before a TransferEntitlements call. If a linked Customer already exists and overwrite_if_exists is true, it will update that Customer's data. Possible error codes: * PERMISSION_DENIED: * The reseller account making the request is different from the reseller account in the API request. * You are not authorized to import the customer. See https://support.google.com/channelservices/answer/9759265 * NOT_FOUND: Cloud Identity doesn't exist or was deleted. * INVALID_ARGUMENT: Required parameters are missing, or the auth_token is expired or invalid. * ALREADY_EXISTS: A customer already exists and has conflicting critical fields. Requires an overwrite. Return value: The [Customer][google.cloud.channel.v1.Customer].", "canonical": true, "file": "cloud_channel_service.import_customer.js", "language": "JAVASCRIPT", @@ -499,7 +499,7 @@ "regionTag": "cloudchannel_v1_generated_CloudChannelService_ProvisionCloudIdentity_async", "title": "CloudChannelReportsService provisionCloudIdentity Sample", "origin": "API_DEFINITION", - "description": " Creates a Cloud Identity for the given customer using the customer's information, or the information provided here. Possible error codes: * PERMISSION_DENIED: The customer doesn't belong to the reseller. * INVALID_ARGUMENT: Required request parameters are missing or invalid. * NOT_FOUND: The customer was not found. * ALREADY_EXISTS: The customer's primary email already exists. Retry after changing the customer's primary contact email. * INTERNAL: Any non-user error related to a technical issue in the backend. Contact Cloud Channel support. * UNKNOWN: Any non-user error related to a technical issue in the backend. Contact Cloud Channel support. Return value: The ID of a long-running operation. To get the results of the operation, call the GetOperation method of CloudChannelOperationsService. The Operation metadata contains an instance of [OperationMetadata][google.cloud.channel.v1.OperationMetadata].", + "description": " Creates a Cloud Identity for the given customer using the customer's information, or the information provided here. Possible error codes: * PERMISSION_DENIED: * The customer doesn't belong to the reseller. * You are not authorized to provision cloud identity id. See https://support.google.com/channelservices/answer/9759265 * INVALID_ARGUMENT: Required request parameters are missing or invalid. * NOT_FOUND: The customer was not found. * ALREADY_EXISTS: The customer's primary email already exists. Retry after changing the customer's primary contact email. * INTERNAL: Any non-user error related to a technical issue in the backend. Contact Cloud Channel support. * UNKNOWN: Any non-user error related to a technical issue in the backend. Contact Cloud Channel support. Return value: The ID of a long-running operation. To get the results of the operation, call the GetOperation method of CloudChannelOperationsService. The Operation metadata contains an instance of [OperationMetadata][google.cloud.channel.v1.OperationMetadata].", "canonical": true, "file": "cloud_channel_service.provision_cloud_identity.js", "language": "JAVASCRIPT", @@ -663,14 +663,14 @@ "regionTag": "cloudchannel_v1_generated_CloudChannelService_ListTransferableOffers_async", "title": "CloudChannelReportsService listTransferableOffers Sample", "origin": "API_DEFINITION", - "description": " List [TransferableOffer][google.cloud.channel.v1.TransferableOffer]s of a customer based on Cloud Identity ID or Customer Name in the request. Use this method when a reseller gets the entitlement information of an unowned customer. The reseller should provide the customer's Cloud Identity ID or Customer Name. Possible error codes: * PERMISSION_DENIED: * The customer doesn't belong to the reseller and has no auth token. * The customer provided incorrect reseller information when generating auth token. * The reseller account making the request is different from the reseller account in the query. * INVALID_ARGUMENT: Required request parameters are missing or invalid. Return value: List of [TransferableOffer][google.cloud.channel.v1.TransferableOffer] for the given customer and SKU.", + "description": " List [TransferableOffer][google.cloud.channel.v1.TransferableOffer]s of a customer based on Cloud Identity ID or Customer Name in the request. Use this method when a reseller gets the entitlement information of an unowned customer. The reseller should provide the customer's Cloud Identity ID or Customer Name. Possible error codes: * PERMISSION_DENIED: * The customer doesn't belong to the reseller and has no auth token. * The customer provided incorrect reseller information when generating auth token. * The reseller account making the request is different from the reseller account in the query. * The reseller is not authorized to transact on this Product. See https://support.google.com/channelservices/answer/9759265 * INVALID_ARGUMENT: Required request parameters are missing or invalid. Return value: List of [TransferableOffer][google.cloud.channel.v1.TransferableOffer] for the given customer and SKU.", "canonical": true, "file": "cloud_channel_service.list_transferable_offers.js", "language": "JAVASCRIPT", "segments": [ { "start": 25, - "end": 90, + "end": 97, "type": "FULL" } ], @@ -706,6 +706,10 @@ { "name": "language_code", "type": "TYPE_STRING" + }, + { + "name": "billing_account", + "type": "TYPE_STRING" } ], "resultType": ".google.cloud.channel.v1.ListTransferableOffersResponse", @@ -767,7 +771,7 @@ "regionTag": "cloudchannel_v1_generated_CloudChannelService_CreateEntitlement_async", "title": "CloudChannelReportsService createEntitlement Sample", "origin": "API_DEFINITION", - "description": " Creates an entitlement for a customer. Possible error codes: * PERMISSION_DENIED: The customer doesn't belong to the reseller. * INVALID_ARGUMENT: * Required request parameters are missing or invalid. * There is already a customer entitlement for a SKU from the same product family. * INVALID_VALUE: Make sure the OfferId is valid. If it is, contact Google Channel support for further troubleshooting. * NOT_FOUND: The customer or offer resource was not found. * ALREADY_EXISTS: * The SKU was already purchased for the customer. * The customer's primary email already exists. Retry after changing the customer's primary contact email. * CONDITION_NOT_MET or FAILED_PRECONDITION: * The domain required for purchasing a SKU has not been verified. * A pre-requisite SKU required to purchase an Add-On SKU is missing. For example, Google Workspace Business Starter is required to purchase Vault or Drive. * (Developer accounts only) Reseller and resold domain must meet the following naming requirements: * Domain names must start with goog-test. * Domain names must include the reseller domain. * INTERNAL: Any non-user error related to a technical issue in the backend. Contact Cloud Channel support. * UNKNOWN: Any non-user error related to a technical issue in the backend. Contact Cloud Channel support. Return value: The ID of a long-running operation. To get the results of the operation, call the GetOperation method of CloudChannelOperationsService. The Operation metadata will contain an instance of [OperationMetadata][google.cloud.channel.v1.OperationMetadata].", + "description": " Creates an entitlement for a customer. Possible error codes: * PERMISSION_DENIED: * The customer doesn't belong to the reseller. * The reseller is not authorized to transact on this Product. See https://support.google.com/channelservices/answer/9759265 * INVALID_ARGUMENT: * Required request parameters are missing or invalid. * There is already a customer entitlement for a SKU from the same product family. * INVALID_VALUE: Make sure the OfferId is valid. If it is, contact Google Channel support for further troubleshooting. * NOT_FOUND: The customer or offer resource was not found. * ALREADY_EXISTS: * The SKU was already purchased for the customer. * The customer's primary email already exists. Retry after changing the customer's primary contact email. * CONDITION_NOT_MET or FAILED_PRECONDITION: * The domain required for purchasing a SKU has not been verified. * A pre-requisite SKU required to purchase an Add-On SKU is missing. For example, Google Workspace Business Starter is required to purchase Vault or Drive. * (Developer accounts only) Reseller and resold domain must meet the following naming requirements: * Domain names must start with goog-test. * Domain names must include the reseller domain. * INTERNAL: Any non-user error related to a technical issue in the backend. Contact Cloud Channel support. * UNKNOWN: Any non-user error related to a technical issue in the backend. Contact Cloud Channel support. Return value: The ID of a long-running operation. To get the results of the operation, call the GetOperation method of CloudChannelOperationsService. The Operation metadata will contain an instance of [OperationMetadata][google.cloud.channel.v1.OperationMetadata].", "canonical": true, "file": "cloud_channel_service.create_entitlement.js", "language": "JAVASCRIPT", @@ -922,7 +926,7 @@ "segments": [ { "start": 25, - "end": 86, + "end": 93, "type": "FULL" } ], @@ -950,6 +954,10 @@ { "name": "request_id", "type": "TYPE_STRING" + }, + { + "name": "billing_account", + "type": "TYPE_STRING" } ], "resultType": ".google.longrunning.Operation", @@ -1147,7 +1155,7 @@ "regionTag": "cloudchannel_v1_generated_CloudChannelService_TransferEntitlements_async", "title": "CloudChannelReportsService transferEntitlements Sample", "origin": "API_DEFINITION", - "description": " Transfers customer entitlements to new reseller. Possible error codes: * PERMISSION_DENIED: The customer doesn't belong to the reseller. * INVALID_ARGUMENT: Required request parameters are missing or invalid. * NOT_FOUND: The customer or offer resource was not found. * ALREADY_EXISTS: The SKU was already transferred for the customer. * CONDITION_NOT_MET or FAILED_PRECONDITION: * The SKU requires domain verification to transfer, but the domain is not verified. * An Add-On SKU (example, Vault or Drive) is missing the pre-requisite SKU (example, G Suite Basic). * (Developer accounts only) Reseller and resold domain must meet the following naming requirements: * Domain names must start with goog-test. * Domain names must include the reseller domain. * Specify all transferring entitlements. * INTERNAL: Any non-user error related to a technical issue in the backend. Contact Cloud Channel support. * UNKNOWN: Any non-user error related to a technical issue in the backend. Contact Cloud Channel support. Return value: The ID of a long-running operation. To get the results of the operation, call the GetOperation method of CloudChannelOperationsService. The Operation metadata will contain an instance of [OperationMetadata][google.cloud.channel.v1.OperationMetadata].", + "description": " Transfers customer entitlements to new reseller. Possible error codes: * PERMISSION_DENIED: * The customer doesn't belong to the reseller. * The reseller is not authorized to transact on this Product. See https://support.google.com/channelservices/answer/9759265 * INVALID_ARGUMENT: Required request parameters are missing or invalid. * NOT_FOUND: The customer or offer resource was not found. * ALREADY_EXISTS: The SKU was already transferred for the customer. * CONDITION_NOT_MET or FAILED_PRECONDITION: * The SKU requires domain verification to transfer, but the domain is not verified. * An Add-On SKU (example, Vault or Drive) is missing the pre-requisite SKU (example, G Suite Basic). * (Developer accounts only) Reseller and resold domain must meet the following naming requirements: * Domain names must start with goog-test. * Domain names must include the reseller domain. * Specify all transferring entitlements. * INTERNAL: Any non-user error related to a technical issue in the backend. Contact Cloud Channel support. * UNKNOWN: Any non-user error related to a technical issue in the backend. Contact Cloud Channel support. Return value: The ID of a long-running operation. To get the results of the operation, call the GetOperation method of CloudChannelOperationsService. The Operation metadata will contain an instance of [OperationMetadata][google.cloud.channel.v1.OperationMetadata].", "canonical": true, "file": "cloud_channel_service.transfer_entitlements.js", "language": "JAVASCRIPT", @@ -1527,7 +1535,7 @@ "regionTag": "cloudchannel_v1_generated_CloudChannelService_CreateCustomerRepricingConfig_async", "title": "CloudChannelReportsService createCustomerRepricingConfig Sample", "origin": "API_DEFINITION", - "description": " Creates a CustomerRepricingConfig. Call this method to set modifications for a specific customer's bill. You can only create configs if the [RepricingConfig.effective_invoice_month][google.cloud.channel.v1.RepricingConfig.effective_invoice_month] is a future month. If needed, you can create a config for the current month, with some restrictions. When creating a config for a future month, make sure there are no existing configs for that [RepricingConfig.effective_invoice_month][google.cloud.channel.v1.RepricingConfig.effective_invoice_month]. The following restrictions are for creating configs in the current month. * This functionality is reserved for recovering from an erroneous config, and should not be used for regular business cases. * The new config will not modify exports used with other configs. Changes to the config may be immediate, but may take up to 24 hours. * There is a limit of ten configs for any [RepricingConfig.EntitlementGranularity.entitlement][google.cloud.channel.v1.RepricingConfig.EntitlementGranularity.entitlement] or [RepricingConfig.effective_invoice_month][google.cloud.channel.v1.RepricingConfig.effective_invoice_month]. * The contained [CustomerRepricingConfig.repricing_config][google.cloud.channel.v1.CustomerRepricingConfig.repricing_config] vaule must be different from the value used in the current config for a [RepricingConfig.EntitlementGranularity.entitlement][google.cloud.channel.v1.RepricingConfig.EntitlementGranularity.entitlement]. Possible Error Codes: * PERMISSION_DENIED: If the account making the request and the account being queried are different. * INVALID_ARGUMENT: Missing or invalid required parameters in the request. Also displays if the updated config is for the current month or past months. * NOT_FOUND: The [CustomerRepricingConfig][google.cloud.channel.v1.CustomerRepricingConfig] specified does not exist or is not associated with the given account. * INTERNAL: Any non-user error related to technical issues in the backend. In this case, contact Cloud Channel support. Return Value: If successful, the updated [CustomerRepricingConfig][google.cloud.channel.v1.CustomerRepricingConfig] resource, otherwise returns an error.", + "description": " Creates a CustomerRepricingConfig. Call this method to set modifications for a specific customer's bill. You can only create configs if the [RepricingConfig.effective_invoice_month][google.cloud.channel.v1.RepricingConfig.effective_invoice_month] is a future month. If needed, you can create a config for the current month, with some restrictions. When creating a config for a future month, make sure there are no existing configs for that [RepricingConfig.effective_invoice_month][google.cloud.channel.v1.RepricingConfig.effective_invoice_month]. The following restrictions are for creating configs in the current month. * This functionality is reserved for recovering from an erroneous config, and should not be used for regular business cases. * The new config will not modify exports used with other configs. Changes to the config may be immediate, but may take up to 24 hours. * There is a limit of ten configs for any [RepricingConfig.EntitlementGranularity.entitlement][google.cloud.channel.v1.RepricingConfig.EntitlementGranularity.entitlement], for any [RepricingConfig.effective_invoice_month][google.cloud.channel.v1.RepricingConfig.effective_invoice_month]. * The contained [CustomerRepricingConfig.repricing_config][google.cloud.channel.v1.CustomerRepricingConfig.repricing_config] value must be different from the value used in the current config for a [RepricingConfig.EntitlementGranularity.entitlement][google.cloud.channel.v1.RepricingConfig.EntitlementGranularity.entitlement]. Possible Error Codes: * PERMISSION_DENIED: If the account making the request and the account being queried are different. * INVALID_ARGUMENT: Missing or invalid required parameters in the request. Also displays if the updated config is for the current month or past months. * NOT_FOUND: The [CustomerRepricingConfig][google.cloud.channel.v1.CustomerRepricingConfig] specified does not exist or is not associated with the given account. * INTERNAL: Any non-user error related to technical issues in the backend. In this case, contact Cloud Channel support. Return Value: If successful, the updated [CustomerRepricingConfig][google.cloud.channel.v1.CustomerRepricingConfig] resource, otherwise returns an error.", "canonical": true, "file": "cloud_channel_service.create_customer_repricing_config.js", "language": "JAVASCRIPT", @@ -1743,7 +1751,7 @@ "regionTag": "cloudchannel_v1_generated_CloudChannelService_CreateChannelPartnerRepricingConfig_async", "title": "CloudChannelReportsService createChannelPartnerRepricingConfig Sample", "origin": "API_DEFINITION", - "description": " Creates a ChannelPartnerRepricingConfig. Call this method to set modifications for a specific ChannelPartner's bill. You can only create configs if the [RepricingConfig.effective_invoice_month][google.cloud.channel.v1.RepricingConfig.effective_invoice_month] is a future month. If needed, you can create a config for the current month, with some restrictions. When creating a config for a future month, make sure there are no existing configs for that [RepricingConfig.effective_invoice_month][google.cloud.channel.v1.RepricingConfig.effective_invoice_month]. The following restrictions are for creating configs in the current month. * This functionality is reserved for recovering from an erroneous config, and should not be used for regular business cases. * The new config will not modify exports used with other configs. Changes to the config may be immediate, but may take up to 24 hours. * There is a limit of ten configs for any ChannelPartner or [RepricingConfig.effective_invoice_month][google.cloud.channel.v1.RepricingConfig.effective_invoice_month]. * The contained [ChannelPartnerRepricingConfig.repricing_config][google.cloud.channel.v1.ChannelPartnerRepricingConfig.repricing_config] vaule must be different from the value used in the current config for a ChannelPartner. Possible Error Codes: * PERMISSION_DENIED: If the account making the request and the account being queried are different. * INVALID_ARGUMENT: Missing or invalid required parameters in the request. Also displays if the updated config is for the current month or past months. * NOT_FOUND: The [ChannelPartnerRepricingConfig][google.cloud.channel.v1.ChannelPartnerRepricingConfig] specified does not exist or is not associated with the given account. * INTERNAL: Any non-user error related to technical issues in the backend. In this case, contact Cloud Channel support. Return Value: If successful, the updated [ChannelPartnerRepricingConfig][google.cloud.channel.v1.ChannelPartnerRepricingConfig] resource, otherwise returns an error.", + "description": " Creates a ChannelPartnerRepricingConfig. Call this method to set modifications for a specific ChannelPartner's bill. You can only create configs if the [RepricingConfig.effective_invoice_month][google.cloud.channel.v1.RepricingConfig.effective_invoice_month] is a future month. If needed, you can create a config for the current month, with some restrictions. When creating a config for a future month, make sure there are no existing configs for that [RepricingConfig.effective_invoice_month][google.cloud.channel.v1.RepricingConfig.effective_invoice_month]. The following restrictions are for creating configs in the current month. * This functionality is reserved for recovering from an erroneous config, and should not be used for regular business cases. * The new config will not modify exports used with other configs. Changes to the config may be immediate, but may take up to 24 hours. * There is a limit of ten configs for any ChannelPartner or [RepricingConfig.EntitlementGranularity.entitlement][google.cloud.channel.v1.RepricingConfig.EntitlementGranularity.entitlement], for any [RepricingConfig.effective_invoice_month][google.cloud.channel.v1.RepricingConfig.effective_invoice_month]. * The contained [ChannelPartnerRepricingConfig.repricing_config][google.cloud.channel.v1.ChannelPartnerRepricingConfig.repricing_config] value must be different from the value used in the current config for a ChannelPartner. Possible Error Codes: * PERMISSION_DENIED: If the account making the request and the account being queried are different. * INVALID_ARGUMENT: Missing or invalid required parameters in the request. Also displays if the updated config is for the current month or past months. * NOT_FOUND: The [ChannelPartnerRepricingConfig][google.cloud.channel.v1.ChannelPartnerRepricingConfig] specified does not exist or is not associated with the given account. * INTERNAL: Any non-user error related to technical issues in the backend. In this case, contact Cloud Channel support. Return Value: If successful, the updated [ChannelPartnerRepricingConfig][google.cloud.channel.v1.ChannelPartnerRepricingConfig] resource, otherwise returns an error.", "canonical": true, "file": "cloud_channel_service.create_channel_partner_repricing_config.js", "language": "JAVASCRIPT", @@ -2231,7 +2239,7 @@ "regionTag": "cloudchannel_v1_generated_CloudChannelService_ListPurchasableOffers_async", "title": "CloudChannelReportsService listPurchasableOffers Sample", "origin": "API_DEFINITION", - "description": " Lists the following: * Offers that you can purchase for a customer. * Offers that you can change for an entitlement. Possible error codes: * PERMISSION_DENIED: The customer doesn't belong to the reseller * INVALID_ARGUMENT: Required request parameters are missing or invalid.", + "description": " Lists the following: * Offers that you can purchase for a customer. * Offers that you can change for an entitlement. Possible error codes: * PERMISSION_DENIED: * The customer doesn't belong to the reseller * The reseller is not authorized to transact on this Product. See https://support.google.com/channelservices/answer/9759265 * INVALID_ARGUMENT: Required request parameters are missing or invalid.", "canonical": true, "file": "cloud_channel_service.list_purchasable_offers.js", "language": "JAVASCRIPT", @@ -2287,6 +2295,50 @@ } } }, + { + "regionTag": "cloudchannel_v1_generated_CloudChannelService_QueryEligibleBillingAccounts_async", + "title": "CloudChannelReportsService queryEligibleBillingAccounts Sample", + "origin": "API_DEFINITION", + "description": " Lists the billing accounts that are eligible to purchase particular SKUs for a given customer. Possible error codes: * PERMISSION_DENIED: The customer doesn't belong to the reseller. * INVALID_ARGUMENT: Required request parameters are missing or invalid. Return value: Based on the provided list of SKUs, returns a list of SKU groups that must be purchased using the same billing account and the billing accounts eligible to purchase each SKU group.", + "canonical": true, + "file": "cloud_channel_service.query_eligible_billing_accounts.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 60, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "QueryEligibleBillingAccounts", + "fullName": "google.cloud.channel.v1.CloudChannelService.QueryEligibleBillingAccounts", + "async": true, + "parameters": [ + { + "name": "customer", + "type": "TYPE_STRING" + }, + { + "name": "skus", + "type": "TYPE_STRING[]" + } + ], + "resultType": ".google.cloud.channel.v1.QueryEligibleBillingAccountsResponse", + "client": { + "shortName": "CloudChannelServiceClient", + "fullName": "google.cloud.channel.v1.CloudChannelServiceClient" + }, + "method": { + "shortName": "QueryEligibleBillingAccounts", + "fullName": "google.cloud.channel.v1.CloudChannelService.QueryEligibleBillingAccounts", + "service": { + "shortName": "CloudChannelService", + "fullName": "google.cloud.channel.v1.CloudChannelService" + } + } + } + }, { "regionTag": "cloudchannel_v1_generated_CloudChannelService_RegisterSubscriber_async", "title": "CloudChannelReportsService registerSubscriber Sample", diff --git a/packages/google-cloud-channel/samples/package.json b/packages/google-cloud-channel/samples/package.json index 5ce41a1f849..8b8e546b8ad 100644 --- a/packages/google-cloud-channel/samples/package.json +++ b/packages/google-cloud-channel/samples/package.json @@ -13,7 +13,7 @@ "test": "c8 mocha --timeout 600000 test/*.js" }, "dependencies": { - "@google-cloud/channel": "^3.0.1", + "@google-cloud/channel": "^3.1.0", "@google-cloud/local-auth": "^3.0.0", "google-auth-library": "^9.0.0", "google-gax": "^3.0.0", diff --git a/packages/google-cloud-channel/src/v1/cloud_channel_reports_service_client.ts b/packages/google-cloud-channel/src/v1/cloud_channel_reports_service_client.ts index 3f6d39c30ad..35bc202a4b0 100644 --- a/packages/google-cloud-channel/src/v1/cloud_channel_reports_service_client.ts +++ b/packages/google-cloud-channel/src/v1/cloud_channel_reports_service_client.ts @@ -183,6 +183,9 @@ export class CloudChannelReportsServiceClient { // identifiers to uniquely identify resources within the API. // Create useful helper objects for these. this.pathTemplates = { + billingAccountPathTemplate: new this._gaxModule.PathTemplate( + 'accounts/{account}/billingAccounts/{billing_account}' + ), channelPartnerLinkPathTemplate: new this._gaxModule.PathTemplate( 'accounts/{account}/channelPartnerLinks/{channel_partner_link}' ), @@ -1240,6 +1243,46 @@ export class CloudChannelReportsServiceClient { // -- Path templates -- // -------------------- + /** + * Return a fully-qualified billingAccount resource name string. + * + * @param {string} account + * @param {string} billing_account + * @returns {string} Resource name string. + */ + billingAccountPath(account: string, billingAccount: string) { + return this.pathTemplates.billingAccountPathTemplate.render({ + account: account, + billing_account: billingAccount, + }); + } + + /** + * Parse the account from BillingAccount resource. + * + * @param {string} billingAccountName + * A fully-qualified path representing BillingAccount resource. + * @returns {string} A string representing the account. + */ + matchAccountFromBillingAccountName(billingAccountName: string) { + return this.pathTemplates.billingAccountPathTemplate.match( + billingAccountName + ).account; + } + + /** + * Parse the billing_account from BillingAccount resource. + * + * @param {string} billingAccountName + * A fully-qualified path representing BillingAccount resource. + * @returns {string} A string representing the billing_account. + */ + matchBillingAccountFromBillingAccountName(billingAccountName: string) { + return this.pathTemplates.billingAccountPathTemplate.match( + billingAccountName + ).billing_account; + } + /** * Return a fully-qualified channelPartnerLink resource name string. * diff --git a/packages/google-cloud-channel/src/v1/cloud_channel_reports_service_proto_list.json b/packages/google-cloud-channel/src/v1/cloud_channel_reports_service_proto_list.json index d562b3acebb..e1aabcfaa9b 100644 --- a/packages/google-cloud-channel/src/v1/cloud_channel_reports_service_proto_list.json +++ b/packages/google-cloud-channel/src/v1/cloud_channel_reports_service_proto_list.json @@ -1,4 +1,5 @@ [ + "../../protos/google/cloud/channel/v1/billing_accounts.proto", "../../protos/google/cloud/channel/v1/channel_partner_links.proto", "../../protos/google/cloud/channel/v1/common.proto", "../../protos/google/cloud/channel/v1/customers.proto", diff --git a/packages/google-cloud-channel/src/v1/cloud_channel_service_client.ts b/packages/google-cloud-channel/src/v1/cloud_channel_service_client.ts index fab52333d5b..dc06c5f0b33 100644 --- a/packages/google-cloud-channel/src/v1/cloud_channel_service_client.ts +++ b/packages/google-cloud-channel/src/v1/cloud_channel_service_client.ts @@ -199,6 +199,9 @@ export class CloudChannelServiceClient { // identifiers to uniquely identify resources within the API. // Create useful helper objects for these. this.pathTemplates = { + billingAccountPathTemplate: new this._gaxModule.PathTemplate( + 'accounts/{account}/billingAccounts/{billing_account}' + ), channelPartnerLinkPathTemplate: new this._gaxModule.PathTemplate( 'accounts/{account}/channelPartnerLinks/{channel_partner_link}' ), @@ -583,6 +586,7 @@ export class CloudChannelServiceClient { 'listOffers', 'listPurchasableSkus', 'listPurchasableOffers', + 'queryEligibleBillingAccounts', 'registerSubscriber', 'unregisterSubscriber', 'listSubscribers', @@ -895,8 +899,11 @@ export class CloudChannelServiceClient { * * Possible error codes: * - * * PERMISSION_DENIED: The reseller account making the request is different - * from the reseller account in the API request. + * * PERMISSION_DENIED: + * * The reseller account making the request is different from the + * reseller account in the API request. + * * You are not authorized to create a customer. See + * https://support.google.com/channelservices/answer/9759265 * * INVALID_ARGUMENT: * * Required request parameters are missing or invalid. * * Domain field value doesn't match the primary email domain. @@ -1188,8 +1195,11 @@ export class CloudChannelServiceClient { * * Possible error codes: * - * * PERMISSION_DENIED: The reseller account making the request is different - * from the reseller account in the API request. + * * PERMISSION_DENIED: + * * The reseller account making the request is different from the + * reseller account in the API request. + * * You are not authorized to import the customer. See + * https://support.google.com/channelservices/answer/9759265 * * NOT_FOUND: Cloud Identity doesn't exist or was deleted. * * INVALID_ARGUMENT: Required parameters are missing, or the auth_token is * expired or invalid. @@ -1902,12 +1912,12 @@ export class CloudChannelServiceClient { * * The new config will not modify exports used with other configs. * Changes to the config may be immediate, but may take up to 24 hours. * * There is a limit of ten configs for any - * {@link protos.google.cloud.channel.v1.RepricingConfig.EntitlementGranularity.entitlement|RepricingConfig.EntitlementGranularity.entitlement} - * or + * {@link protos.google.cloud.channel.v1.RepricingConfig.EntitlementGranularity.entitlement|RepricingConfig.EntitlementGranularity.entitlement}, + * for any * {@link protos.google.cloud.channel.v1.RepricingConfig.effective_invoice_month|RepricingConfig.effective_invoice_month}. * * The contained * {@link protos.google.cloud.channel.v1.CustomerRepricingConfig.repricing_config|CustomerRepricingConfig.repricing_config} - * vaule must be different from the value used in the current config for a + * value must be different from the value used in the current config for a * {@link protos.google.cloud.channel.v1.RepricingConfig.EntitlementGranularity.entitlement|RepricingConfig.EntitlementGranularity.entitlement}. * * Possible Error Codes: @@ -2416,10 +2426,12 @@ export class CloudChannelServiceClient { * * The new config will not modify exports used with other configs. * Changes to the config may be immediate, but may take up to 24 hours. * * There is a limit of ten configs for any ChannelPartner or + * {@link protos.google.cloud.channel.v1.RepricingConfig.EntitlementGranularity.entitlement|RepricingConfig.EntitlementGranularity.entitlement}, + * for any * {@link protos.google.cloud.channel.v1.RepricingConfig.effective_invoice_month|RepricingConfig.effective_invoice_month}. * * The contained * {@link protos.google.cloud.channel.v1.ChannelPartnerRepricingConfig.repricing_config|ChannelPartnerRepricingConfig.repricing_config} - * vaule must be different from the value used in the current config for a + * value must be different from the value used in the current config for a * ChannelPartner. * * Possible Error Codes: @@ -2883,6 +2895,121 @@ export class CloudChannelServiceClient { this.initialize(); return this.innerApiCalls.lookupOffer(request, options, callback); } + /** + * Lists the billing accounts that are eligible to purchase particular SKUs + * for a given customer. + * + * Possible error codes: + * + * * PERMISSION_DENIED: The customer doesn't belong to the reseller. + * * INVALID_ARGUMENT: Required request parameters are missing or invalid. + * + * Return value: + * Based on the provided list of SKUs, returns a list of SKU groups that must + * be purchased using the same billing account and the billing accounts + * eligible to purchase each SKU group. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.customer + * Required. The resource name of the customer to list eligible billing + * accounts for. Format: accounts/{account_id}/customers/{customer_id}. + * @param {string[]} request.skus + * Required. List of SKUs to list eligible billing accounts for. At least one + * SKU is required. Format: products/{product_id}/skus/{sku_id}. + * @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.channel.v1.QueryEligibleBillingAccountsResponse|QueryEligibleBillingAccountsResponse}. + * 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/cloud_channel_service.query_eligible_billing_accounts.js + * region_tag:cloudchannel_v1_generated_CloudChannelService_QueryEligibleBillingAccounts_async + */ + queryEligibleBillingAccounts( + request?: protos.google.cloud.channel.v1.IQueryEligibleBillingAccountsRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.channel.v1.IQueryEligibleBillingAccountsResponse, + ( + | protos.google.cloud.channel.v1.IQueryEligibleBillingAccountsRequest + | undefined + ), + {} | undefined, + ] + >; + queryEligibleBillingAccounts( + request: protos.google.cloud.channel.v1.IQueryEligibleBillingAccountsRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.channel.v1.IQueryEligibleBillingAccountsResponse, + | protos.google.cloud.channel.v1.IQueryEligibleBillingAccountsRequest + | null + | undefined, + {} | null | undefined + > + ): void; + queryEligibleBillingAccounts( + request: protos.google.cloud.channel.v1.IQueryEligibleBillingAccountsRequest, + callback: Callback< + protos.google.cloud.channel.v1.IQueryEligibleBillingAccountsResponse, + | protos.google.cloud.channel.v1.IQueryEligibleBillingAccountsRequest + | null + | undefined, + {} | null | undefined + > + ): void; + queryEligibleBillingAccounts( + request?: protos.google.cloud.channel.v1.IQueryEligibleBillingAccountsRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.channel.v1.IQueryEligibleBillingAccountsResponse, + | protos.google.cloud.channel.v1.IQueryEligibleBillingAccountsRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.channel.v1.IQueryEligibleBillingAccountsResponse, + | protos.google.cloud.channel.v1.IQueryEligibleBillingAccountsRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.channel.v1.IQueryEligibleBillingAccountsResponse, + ( + | protos.google.cloud.channel.v1.IQueryEligibleBillingAccountsRequest + | 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({ + customer: request.customer ?? '', + }); + this.initialize(); + return this.innerApiCalls.queryEligibleBillingAccounts( + request, + options, + callback + ); + } /** * Registers a service account with subscriber privileges on the Cloud Pub/Sub * topic for this Channel Services account. After you create a @@ -3113,7 +3240,10 @@ export class CloudChannelServiceClient { * * Possible error codes: * - * * PERMISSION_DENIED: The customer doesn't belong to the reseller. + * * PERMISSION_DENIED: + * * The customer doesn't belong to the reseller. + * * You are not authorized to provision cloud identity id. See + * https://support.google.com/channelservices/answer/9759265 * * INVALID_ARGUMENT: Required request parameters are missing or invalid. * * NOT_FOUND: The customer was not found. * * ALREADY_EXISTS: The customer's primary email already exists. Retry @@ -3279,7 +3409,10 @@ export class CloudChannelServiceClient { * * Possible error codes: * - * * PERMISSION_DENIED: The customer doesn't belong to the reseller. + * * PERMISSION_DENIED: + * * The customer doesn't belong to the reseller. + * * The reseller is not authorized to transact on this Product. See + * https://support.google.com/channelservices/answer/9759265 * * INVALID_ARGUMENT: * * Required request parameters are missing or invalid. * * There is already a customer entitlement for a SKU from the same @@ -3871,6 +4004,12 @@ export class CloudChannelServiceClient { * The request ID must be a valid [UUID](https://tools.ietf.org/html/rfc4122) * with the exception that zero UUID is not supported * (`00000000-0000-0000-0000-000000000000`). + * @param {string} [request.billingAccount] + * Optional. The billing account resource name that is used to pay for this + * entitlement when setting up billing on a trial subscription. + * + * This field is only relevant for multi-currency accounts. It should be + * left empty for single currency accounts. * @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. @@ -4703,7 +4842,10 @@ export class CloudChannelServiceClient { * * Possible error codes: * - * * PERMISSION_DENIED: The customer doesn't belong to the reseller. + * * PERMISSION_DENIED: + * * The customer doesn't belong to the reseller. + * * The reseller is not authorized to transact on this Product. See + * https://support.google.com/channelservices/answer/9759265 * * INVALID_ARGUMENT: Required request parameters are missing or invalid. * * NOT_FOUND: The customer or offer resource was not found. * * ALREADY_EXISTS: The SKU was already transferred for the customer. @@ -5819,6 +5961,8 @@ export class CloudChannelServiceClient { * auth token. * * The reseller account making the request is different * from the reseller account in the query. + * * The reseller is not authorized to transact on this Product. See + * https://support.google.com/channelservices/answer/9759265 * * INVALID_ARGUMENT: Required request parameters are missing or invalid. * * Return value: @@ -5851,6 +5995,12 @@ export class CloudChannelServiceClient { * Optional. The BCP-47 language code. For example, "en-US". The * response will localize in the corresponding language code, if specified. * The default value is "en-US". + * @param {string} [request.billingAccount] + * Optional. The Billing Account to look up Offers for. Format: + * accounts/{account_id}/billingAccounts/{billing_account_id}. + * + * This field is only relevant for multi-currency accounts. It should be left + * empty for single currency accounts. * @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. @@ -5970,6 +6120,12 @@ export class CloudChannelServiceClient { * Optional. The BCP-47 language code. For example, "en-US". The * response will localize in the corresponding language code, if specified. * The default value is "en-US". + * @param {string} [request.billingAccount] + * Optional. The Billing Account to look up Offers for. Format: + * accounts/{account_id}/billingAccounts/{billing_account_id}. + * + * This field is only relevant for multi-currency accounts. It should be left + * empty for single currency accounts. * @param {object} [options] * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Stream} @@ -6033,6 +6189,12 @@ export class CloudChannelServiceClient { * Optional. The BCP-47 language code. For example, "en-US". The * response will localize in the corresponding language code, if specified. * The default value is "en-US". + * @param {string} [request.billingAccount] + * Optional. The Billing Account to look up Offers for. Format: + * accounts/{account_id}/billingAccounts/{billing_account_id}. + * + * This field is only relevant for multi-currency accounts. It should be left + * empty for single currency accounts. * @param {object} [options] * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Object} @@ -8179,7 +8341,10 @@ export class CloudChannelServiceClient { * * Possible error codes: * - * * PERMISSION_DENIED: The customer doesn't belong to the reseller + * * PERMISSION_DENIED: + * * The customer doesn't belong to the reseller + * * The reseller is not authorized to transact on this Product. See + * https://support.google.com/channelservices/answer/9759265 * * INVALID_ARGUMENT: Required request parameters are missing or invalid. * * @param {Object} request @@ -9053,6 +9218,46 @@ export class CloudChannelServiceClient { // -- Path templates -- // -------------------- + /** + * Return a fully-qualified billingAccount resource name string. + * + * @param {string} account + * @param {string} billing_account + * @returns {string} Resource name string. + */ + billingAccountPath(account: string, billingAccount: string) { + return this.pathTemplates.billingAccountPathTemplate.render({ + account: account, + billing_account: billingAccount, + }); + } + + /** + * Parse the account from BillingAccount resource. + * + * @param {string} billingAccountName + * A fully-qualified path representing BillingAccount resource. + * @returns {string} A string representing the account. + */ + matchAccountFromBillingAccountName(billingAccountName: string) { + return this.pathTemplates.billingAccountPathTemplate.match( + billingAccountName + ).account; + } + + /** + * Parse the billing_account from BillingAccount resource. + * + * @param {string} billingAccountName + * A fully-qualified path representing BillingAccount resource. + * @returns {string} A string representing the billing_account. + */ + matchBillingAccountFromBillingAccountName(billingAccountName: string) { + return this.pathTemplates.billingAccountPathTemplate.match( + billingAccountName + ).billing_account; + } + /** * Return a fully-qualified channelPartnerLink resource name string. * diff --git a/packages/google-cloud-channel/src/v1/cloud_channel_service_client_config.json b/packages/google-cloud-channel/src/v1/cloud_channel_service_client_config.json index 96804dd8776..6acd624ee55 100644 --- a/packages/google-cloud-channel/src/v1/cloud_channel_service_client_config.json +++ b/packages/google-cloud-channel/src/v1/cloud_channel_service_client_config.json @@ -252,6 +252,11 @@ "retry_codes_name": "unavailable", "retry_params_name": "ce5b960a6ed052e690863808e4f0deff3dc7d49f" }, + "QueryEligibleBillingAccounts": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "ce5b960a6ed052e690863808e4f0deff3dc7d49f" + }, "RegisterSubscriber": { "timeout_millis": 60000, "retry_codes_name": "unavailable", diff --git a/packages/google-cloud-channel/src/v1/cloud_channel_service_proto_list.json b/packages/google-cloud-channel/src/v1/cloud_channel_service_proto_list.json index d562b3acebb..e1aabcfaa9b 100644 --- a/packages/google-cloud-channel/src/v1/cloud_channel_service_proto_list.json +++ b/packages/google-cloud-channel/src/v1/cloud_channel_service_proto_list.json @@ -1,4 +1,5 @@ [ + "../../protos/google/cloud/channel/v1/billing_accounts.proto", "../../protos/google/cloud/channel/v1/channel_partner_links.proto", "../../protos/google/cloud/channel/v1/common.proto", "../../protos/google/cloud/channel/v1/customers.proto", diff --git a/packages/google-cloud-channel/src/v1/gapic_metadata.json b/packages/google-cloud-channel/src/v1/gapic_metadata.json index 7a1eec3f2ba..3413e571971 100644 --- a/packages/google-cloud-channel/src/v1/gapic_metadata.json +++ b/packages/google-cloud-channel/src/v1/gapic_metadata.json @@ -157,6 +157,11 @@ "lookupOffer" ] }, + "QueryEligibleBillingAccounts": { + "methods": [ + "queryEligibleBillingAccounts" + ] + }, "RegisterSubscriber": { "methods": [ "registerSubscriber" @@ -434,6 +439,11 @@ "lookupOffer" ] }, + "QueryEligibleBillingAccounts": { + "methods": [ + "queryEligibleBillingAccounts" + ] + }, "RegisterSubscriber": { "methods": [ "registerSubscriber" diff --git a/packages/google-cloud-channel/test/gapic_cloud_channel_reports_service_v1.ts b/packages/google-cloud-channel/test/gapic_cloud_channel_reports_service_v1.ts index d598e52802c..24d6e4c2623 100644 --- a/packages/google-cloud-channel/test/gapic_cloud_channel_reports_service_v1.ts +++ b/packages/google-cloud-channel/test/gapic_cloud_channel_reports_service_v1.ts @@ -1466,6 +1466,62 @@ describe('v1.CloudChannelReportsServiceClient', () => { }); describe('Path templates', () => { + describe('billingAccount', () => { + const fakePath = '/rendered/path/billingAccount'; + const expectedParameters = { + account: 'accountValue', + billing_account: 'billingAccountValue', + }; + const client = + new cloudchannelreportsserviceModule.v1.CloudChannelReportsServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + client.pathTemplates.billingAccountPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.billingAccountPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('billingAccountPath', () => { + const result = client.billingAccountPath( + 'accountValue', + 'billingAccountValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.billingAccountPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchAccountFromBillingAccountName', () => { + const result = client.matchAccountFromBillingAccountName(fakePath); + assert.strictEqual(result, 'accountValue'); + assert( + (client.pathTemplates.billingAccountPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchBillingAccountFromBillingAccountName', () => { + const result = + client.matchBillingAccountFromBillingAccountName(fakePath); + assert.strictEqual(result, 'billingAccountValue'); + assert( + (client.pathTemplates.billingAccountPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + describe('channelPartnerLink', () => { const fakePath = '/rendered/path/channelPartnerLink'; const expectedParameters = { diff --git a/packages/google-cloud-channel/test/gapic_cloud_channel_service_v1.ts b/packages/google-cloud-channel/test/gapic_cloud_channel_service_v1.ts index c2d06909a9e..7839a08dc83 100644 --- a/packages/google-cloud-channel/test/gapic_cloud_channel_service_v1.ts +++ b/packages/google-cloud-channel/test/gapic_cloud_channel_service_v1.ts @@ -2996,6 +2996,151 @@ describe('v1.CloudChannelServiceClient', () => { }); }); + describe('queryEligibleBillingAccounts', () => { + it('invokes queryEligibleBillingAccounts without error', async () => { + const client = new cloudchannelserviceModule.v1.CloudChannelServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.channel.v1.QueryEligibleBillingAccountsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.channel.v1.QueryEligibleBillingAccountsRequest', + ['customer'] + ); + request.customer = defaultValue1; + const expectedHeaderRequestParams = `customer=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.channel.v1.QueryEligibleBillingAccountsResponse() + ); + client.innerApiCalls.queryEligibleBillingAccounts = + stubSimpleCall(expectedResponse); + const [response] = await client.queryEligibleBillingAccounts(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.queryEligibleBillingAccounts as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.queryEligibleBillingAccounts as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes queryEligibleBillingAccounts without error using callback', async () => { + const client = new cloudchannelserviceModule.v1.CloudChannelServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.channel.v1.QueryEligibleBillingAccountsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.channel.v1.QueryEligibleBillingAccountsRequest', + ['customer'] + ); + request.customer = defaultValue1; + const expectedHeaderRequestParams = `customer=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.channel.v1.QueryEligibleBillingAccountsResponse() + ); + client.innerApiCalls.queryEligibleBillingAccounts = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.queryEligibleBillingAccounts( + request, + ( + err?: Error | null, + result?: protos.google.cloud.channel.v1.IQueryEligibleBillingAccountsResponse | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.queryEligibleBillingAccounts as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.queryEligibleBillingAccounts as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes queryEligibleBillingAccounts with error', async () => { + const client = new cloudchannelserviceModule.v1.CloudChannelServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.channel.v1.QueryEligibleBillingAccountsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.channel.v1.QueryEligibleBillingAccountsRequest', + ['customer'] + ); + request.customer = defaultValue1; + const expectedHeaderRequestParams = `customer=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.queryEligibleBillingAccounts = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects( + client.queryEligibleBillingAccounts(request), + expectedError + ); + const actualRequest = ( + client.innerApiCalls.queryEligibleBillingAccounts as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.queryEligibleBillingAccounts as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes queryEligibleBillingAccounts with closed client', async () => { + const client = new cloudchannelserviceModule.v1.CloudChannelServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.channel.v1.QueryEligibleBillingAccountsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.channel.v1.QueryEligibleBillingAccountsRequest', + ['customer'] + ); + request.customer = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects( + client.queryEligibleBillingAccounts(request), + expectedError + ); + }); + }); + describe('registerSubscriber', () => { it('invokes registerSubscriber without error', async () => { const client = new cloudchannelserviceModule.v1.CloudChannelServiceClient( @@ -11195,6 +11340,61 @@ describe('v1.CloudChannelServiceClient', () => { }); describe('Path templates', () => { + describe('billingAccount', () => { + const fakePath = '/rendered/path/billingAccount'; + const expectedParameters = { + account: 'accountValue', + billing_account: 'billingAccountValue', + }; + const client = new cloudchannelserviceModule.v1.CloudChannelServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + client.pathTemplates.billingAccountPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.billingAccountPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('billingAccountPath', () => { + const result = client.billingAccountPath( + 'accountValue', + 'billingAccountValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.billingAccountPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchAccountFromBillingAccountName', () => { + const result = client.matchAccountFromBillingAccountName(fakePath); + assert.strictEqual(result, 'accountValue'); + assert( + (client.pathTemplates.billingAccountPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchBillingAccountFromBillingAccountName', () => { + const result = + client.matchBillingAccountFromBillingAccountName(fakePath); + assert.strictEqual(result, 'billingAccountValue'); + assert( + (client.pathTemplates.billingAccountPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + describe('channelPartnerLink', () => { const fakePath = '/rendered/path/channelPartnerLink'; const expectedParameters = { diff --git a/packages/google-cloud-config/.repo-metadata.json b/packages/google-cloud-config/.repo-metadata.json index 9480240efef..046526d8791 100644 --- a/packages/google-cloud-config/.repo-metadata.json +++ b/packages/google-cloud-config/.repo-metadata.json @@ -12,6 +12,6 @@ "default_version": "v1", "requires_billing": true, "library_type": "GAPIC_AUTO", - "api_shortname": "infra-manager" + "api_shortname": "config" } diff --git a/packages/google-cloud-config/CHANGELOG.md b/packages/google-cloud-config/CHANGELOG.md index 0e24ac026c2..1715234ab61 100644 --- a/packages/google-cloud-config/CHANGELOG.md +++ b/packages/google-cloud-config/CHANGELOG.md @@ -1,5 +1,12 @@ # Changelog +## [0.1.1](https://github.com/googleapis/google-cloud-node/compare/config-v0.1.0...config-v0.1.1) (2023-09-20) + + +### Bug Fixes + +* [infra-manager] change the config service's Ruby namespace to avoid a collision with a base class in the Ruby client platform ([#4684](https://github.com/googleapis/google-cloud-node/issues/4684)) ([d611d3f](https://github.com/googleapis/google-cloud-node/commit/d611d3ffada146439d3badebd2b4627b0ac45376)) + ## 0.1.0 (2023-09-08) diff --git a/packages/google-cloud-config/package.json b/packages/google-cloud-config/package.json index 40906add27f..43ef5bfc052 100644 --- a/packages/google-cloud-config/package.json +++ b/packages/google-cloud-config/package.json @@ -1,6 +1,6 @@ { "name": "@google-cloud/config", - "version": "0.1.0", + "version": "0.1.1", "description": "Infrastructure Manager API client for Node.js", "repository": { "type": "git", diff --git a/packages/google-cloud-config/protos/google/cloud/config/v1/config.proto b/packages/google-cloud-config/protos/google/cloud/config/v1/config.proto index 74b56003028..5af6cdd1f06 100644 --- a/packages/google-cloud-config/protos/google/cloud/config/v1/config.proto +++ b/packages/google-cloud-config/protos/google/cloud/config/v1/config.proto @@ -33,7 +33,7 @@ option java_multiple_files = true; option java_outer_classname = "ConfigProto"; option java_package = "com.google.cloud.config.v1"; option php_namespace = "Google\\Cloud\\Config\\V1"; -option ruby_package = "Google::Cloud::Config::V1"; +option ruby_package = "Google::Cloud::ConfigService::V1"; option (google.api.resource_definition) = { type: "iam.googleapis.com/ServiceAccount" pattern: "projects/{project}/serviceAccounts/{service_account}" diff --git a/packages/google-cloud-config/protos/protos.json b/packages/google-cloud-config/protos/protos.json index ada5726f37a..976c9e1bf5b 100644 --- a/packages/google-cloud-config/protos/protos.json +++ b/packages/google-cloud-config/protos/protos.json @@ -14,7 +14,7 @@ "java_outer_classname": "ConfigProto", "java_package": "com.google.cloud.config.v1", "php_namespace": "Google\\Cloud\\Config\\V1", - "ruby_package": "Google::Cloud::Config::V1", + "ruby_package": "Google::Cloud::ConfigService::V1", "(google.api.resource_definition).type": "cloudbuild.googleapis.com/WorkerPool", "(google.api.resource_definition).pattern": "projects/{project}/locations/{location}/workerPools/{worker_pool}" }, diff --git a/packages/google-cloud-config/samples/generated/v1/snippet_metadata_google.cloud.config.v1.json b/packages/google-cloud-config/samples/generated/v1/snippet_metadata_google.cloud.config.v1.json index 908c13f2e76..91d681c84c0 100644 --- a/packages/google-cloud-config/samples/generated/v1/snippet_metadata_google.cloud.config.v1.json +++ b/packages/google-cloud-config/samples/generated/v1/snippet_metadata_google.cloud.config.v1.json @@ -1,7 +1,7 @@ { "clientLibrary": { "name": "nodejs-config", - "version": "0.1.0", + "version": "0.1.1", "language": "TYPESCRIPT", "apis": [ { diff --git a/packages/google-cloud-config/samples/package.json b/packages/google-cloud-config/samples/package.json index cd6b6231cca..d524eb7932b 100644 --- a/packages/google-cloud-config/samples/package.json +++ b/packages/google-cloud-config/samples/package.json @@ -14,7 +14,7 @@ "publish": "echo 'sample test; do not publish'" }, "dependencies": { - "@google-cloud/config": "^0.1.0" + "@google-cloud/config": "^0.1.1" }, "devDependencies": { "c8": "^8.0.0", diff --git a/packages/google-cloud-connectors/.OwlBot.yaml b/packages/google-cloud-connectors/.OwlBot.yaml new file mode 100644 index 00000000000..2f09abb76d0 --- /dev/null +++ b/packages/google-cloud-connectors/.OwlBot.yaml @@ -0,0 +1,19 @@ +# 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. + +deep-copy-regex: + - source: /google/cloud/connectors/(.*)/.*-nodejs + dest: /owl-bot-staging/google-cloud-connectors/$1 + +api-name: connectors \ No newline at end of file diff --git a/packages/google-cloud-connectors/.eslintignore b/packages/google-cloud-connectors/.eslintignore new file mode 100644 index 00000000000..ea5b04aebe6 --- /dev/null +++ b/packages/google-cloud-connectors/.eslintignore @@ -0,0 +1,7 @@ +**/node_modules +**/coverage +test/fixtures +build/ +docs/ +protos/ +samples/generated/ diff --git a/packages/google-cloud-connectors/.eslintrc.json b/packages/google-cloud-connectors/.eslintrc.json new file mode 100644 index 00000000000..78215349546 --- /dev/null +++ b/packages/google-cloud-connectors/.eslintrc.json @@ -0,0 +1,3 @@ +{ + "extends": "./node_modules/gts" +} diff --git a/packages/google-cloud-connectors/.gitattributes b/packages/google-cloud-connectors/.gitattributes new file mode 100644 index 00000000000..33739cb74e4 --- /dev/null +++ b/packages/google-cloud-connectors/.gitattributes @@ -0,0 +1,4 @@ +*.ts text eol=lf +*.js text eol=lf +protos/* linguist-generated +**/api-extractor.json linguist-language=JSON-with-Comments diff --git a/packages/google-cloud-connectors/.gitignore b/packages/google-cloud-connectors/.gitignore new file mode 100644 index 00000000000..d4f03a0df2e --- /dev/null +++ b/packages/google-cloud-connectors/.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/google-cloud-connectors/.jsdoc.js b/packages/google-cloud-connectors/.jsdoc.js new file mode 100644 index 00000000000..b9105690d39 --- /dev/null +++ b/packages/google-cloud-connectors/.jsdoc.js @@ -0,0 +1,55 @@ +// Copyright 2023 Google LLC +// +// Licensed under the Apache License, Version 2.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 2023 Google LLC', + includeDate: false, + sourceFiles: false, + systemName: '@google-cloud/connectors', + theme: 'lumen', + default: { + outputSourceFiles: false + } + }, + markdown: { + idInHeadings: true + } +}; diff --git a/packages/google-cloud-connectors/.mocharc.js b/packages/google-cloud-connectors/.mocharc.js new file mode 100644 index 00000000000..49e7e228701 --- /dev/null +++ b/packages/google-cloud-connectors/.mocharc.js @@ -0,0 +1,29 @@ +// Copyright 2023 Google LLC +// +// Licensed under the Apache License, Version 2.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. +const config = { + "enable-source-maps": true, + "throw-deprecation": true, + "timeout": 10000, + "recursive": true +} +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/google-cloud-connectors/.nycrc b/packages/google-cloud-connectors/.nycrc new file mode 100644 index 00000000000..b18d5472b62 --- /dev/null +++ b/packages/google-cloud-connectors/.nycrc @@ -0,0 +1,24 @@ +{ + "report-dir": "./.coverage", + "reporter": ["text", "lcov"], + "exclude": [ + "**/*-test", + "**/.coverage", + "**/apis", + "**/benchmark", + "**/conformance", + "**/docs", + "**/samples", + "**/scripts", + "**/protos", + "**/test", + "**/*.d.ts", + ".jsdoc.js", + "**/.jsdoc.js", + "karma.conf.js", + "webpack-tests.config.js", + "webpack.config.js" + ], + "exclude-after-remap": false, + "all": true +} diff --git a/packages/google-cloud-connectors/.prettierignore b/packages/google-cloud-connectors/.prettierignore new file mode 100644 index 00000000000..9340ad9b86d --- /dev/null +++ b/packages/google-cloud-connectors/.prettierignore @@ -0,0 +1,6 @@ +**/node_modules +**/coverage +test/fixtures +build/ +docs/ +protos/ diff --git a/packages/google-cloud-connectors/.prettierrc.js b/packages/google-cloud-connectors/.prettierrc.js new file mode 100644 index 00000000000..1e6cec783e4 --- /dev/null +++ b/packages/google-cloud-connectors/.prettierrc.js @@ -0,0 +1,17 @@ +// Copyright 2023 Google LLC +// +// Licensed under the Apache License, Version 2.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. + +module.exports = { + ...require('gts/.prettierrc.json') +} diff --git a/packages/google-cloud-connectors/.repo-metadata.json b/packages/google-cloud-connectors/.repo-metadata.json new file mode 100644 index 00000000000..3436f6bbe66 --- /dev/null +++ b/packages/google-cloud-connectors/.repo-metadata.json @@ -0,0 +1,17 @@ +{ + "name": "connectors", + "name_pretty": "Connectors API", + "product_documentation": "", + "client_documentation": "https://cloud.google.com/nodejs/docs/reference/connectors/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/connectors", + "api_id": "connectors.googleapis.com", + "default_version": "v1", + "requires_billing": true, + "library_type": "GAPIC_AUTO", + "api_shortname": "connectors" +} + diff --git a/packages/google-cloud-connectors/CHANGELOG.md b/packages/google-cloud-connectors/CHANGELOG.md new file mode 100644 index 00000000000..5e5c55ecde8 --- /dev/null +++ b/packages/google-cloud-connectors/CHANGELOG.md @@ -0,0 +1,8 @@ +# Changelog + +## 0.1.0 (2023-09-14) + + +### Features + +* Add initial files for google.cloud.connectors.v1 ([#4641](https://github.com/googleapis/google-cloud-node/issues/4641)) ([6f5461a](https://github.com/googleapis/google-cloud-node/commit/6f5461ac147e39c7028cabe3a7943a2e48f06196)) diff --git a/packages/google-cloud-connectors/CODE_OF_CONDUCT.md b/packages/google-cloud-connectors/CODE_OF_CONDUCT.md new file mode 100644 index 00000000000..2add2547a81 --- /dev/null +++ b/packages/google-cloud-connectors/CODE_OF_CONDUCT.md @@ -0,0 +1,94 @@ + +# Code of Conduct + +## Our Pledge + +In the interest of fostering an open and welcoming environment, we as +contributors and maintainers pledge to making participation in our project and +our community a harassment-free experience for everyone, regardless of age, body +size, disability, ethnicity, gender identity and expression, level of +experience, education, socio-economic status, nationality, personal appearance, +race, religion, or sexual identity and orientation. + +## Our Standards + +Examples of behavior that contributes to creating a positive environment +include: + +* Using welcoming and inclusive language +* Being respectful of differing viewpoints and experiences +* Gracefully accepting constructive criticism +* Focusing on what is best for the community +* Showing empathy towards other community members + +Examples of unacceptable behavior by participants include: + +* The use of sexualized language or imagery and unwelcome sexual attention or + advances +* Trolling, insulting/derogatory comments, and personal or political attacks +* Public or private harassment +* Publishing others' private information, such as a physical or electronic + address, without explicit permission +* Other conduct which could reasonably be considered inappropriate in a + professional setting + +## Our Responsibilities + +Project maintainers are responsible for clarifying the standards of acceptable +behavior and are expected to take appropriate and fair corrective action in +response to any instances of unacceptable behavior. + +Project maintainers have the right and responsibility to remove, edit, or reject +comments, commits, code, wiki edits, issues, and other contributions that are +not aligned to this Code of Conduct, or to ban temporarily or permanently any +contributor for other behaviors that they deem inappropriate, threatening, +offensive, or harmful. + +## Scope + +This Code of Conduct applies both within project spaces and in public spaces +when an individual is representing the project or its community. Examples of +representing a project or community include using an official project e-mail +address, posting via an official social media account, or acting as an appointed +representative at an online or offline event. Representation of a project may be +further defined and clarified by project maintainers. + +This Code of Conduct also applies outside the project spaces when the Project +Steward has a reasonable belief that an individual's behavior may have a +negative impact on the project or its community. + +## Conflict Resolution + +We do not believe that all conflict is bad; healthy debate and disagreement +often yield positive results. However, it is never okay to be disrespectful or +to engage in behavior that violates the project’s code of conduct. + +If you see someone violating the code of conduct, you are encouraged to address +the behavior directly with those involved. Many issues can be resolved quickly +and easily, and this gives people more control over the outcome of their +dispute. If you are unable to resolve the matter for any reason, or if the +behavior is threatening or harassing, report it. We are dedicated to providing +an environment where participants feel welcome and safe. + +Reports should be directed to *googleapis-stewards@google.com*, the +Project Steward(s) for *Google Cloud Client Libraries*. It is the Project Steward’s duty to +receive and address reported violations of the code of conduct. They will then +work with a committee consisting of representatives from the Open Source +Programs Office and the Google Open Source Strategy team. If for any reason you +are uncomfortable reaching out to the Project Steward, please email +opensource@google.com. + +We will investigate every complaint, but you may not receive a direct response. +We will use our discretion in determining when and how to follow up on reported +incidents, which may range from not taking action to permanent expulsion from +the project and project-sponsored spaces. We will notify the accused of the +report and provide them an opportunity to discuss it before any action is taken. +The identity of the reporter will be omitted from the details of the report +supplied to the accused. In potentially harmful situations, such as ongoing +harassment or threats to anyone's safety, we may take action without notice. + +## Attribution + +This Code of Conduct is adapted from the Contributor Covenant, version 1.4, +available at +https://www.contributor-covenant.org/version/1/4/code-of-conduct.html \ No newline at end of file diff --git a/packages/google-cloud-connectors/CONTRIBUTING.md b/packages/google-cloud-connectors/CONTRIBUTING.md new file mode 100644 index 00000000000..c9b184fabcc --- /dev/null +++ b/packages/google-cloud-connectors/CONTRIBUTING.md @@ -0,0 +1,76 @@ +# How to become a contributor and submit your own code + +**Table of contents** + +* [Contributor License Agreements](#contributor-license-agreements) +* [Contributing a patch](#contributing-a-patch) +* [Running the tests](#running-the-tests) +* [Releasing the library](#releasing-the-library) + +## Contributor License Agreements + +We'd love to accept your sample apps and patches! Before we can take them, we +have to jump a couple of legal hurdles. + +Please fill out either the individual or corporate Contributor License Agreement +(CLA). + + * If you are an individual writing original source code and you're sure you + own the intellectual property, then you'll need to sign an [individual CLA](https://developers.google.com/open-source/cla/individual). + * If you work for a company that wants to allow you to contribute your work, + then you'll need to sign a [corporate CLA](https://developers.google.com/open-source/cla/corporate). + +Follow either of the two links above to access the appropriate CLA and +instructions for how to sign and return it. Once we receive it, we'll be able to +accept your pull requests. + +## Contributing A Patch + +1. Submit an issue describing your proposed change to the repo in question. +1. The repo owner will respond to your issue promptly. +1. If your proposed change is accepted, and you haven't already done so, sign a + Contributor License Agreement (see details above). +1. Fork the desired repo, develop and test your code changes. +1. Ensure that your code adheres to the existing style in the code to which + you are contributing. +1. Ensure that your code has an appropriate set of tests which all pass. +1. Title your pull request following [Conventional Commits](https://www.conventionalcommits.org/) styling. +1. Submit a pull request. + +### Before you begin + +1. [Select or create a Cloud Platform project][projects]. +1. [Enable billing for your project][billing]. +1. [Enable the Connectors API API][enable_api]. +1. [Set up authentication with a service account][auth] so you can access the + API from your local workstation. + + +## Running the tests + +1. [Prepare your environment for Node.js setup][setup]. + +1. Install dependencies: + + npm install + +1. Run the tests: + + # Run unit tests. + npm test + + # Run sample integration tests. + npm run samples-test + + # Run all system tests. + npm run system-test + +1. Lint (and maybe fix) any changes: + + npm run fix + +[setup]: https://cloud.google.com/nodejs/docs/setup +[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=connectors.googleapis.com +[auth]: https://cloud.google.com/docs/authentication/getting-started \ No newline at end of file diff --git a/packages/google-cloud-connectors/LICENSE b/packages/google-cloud-connectors/LICENSE new file mode 100644 index 00000000000..d6456956733 --- /dev/null +++ b/packages/google-cloud-connectors/LICENSE @@ -0,0 +1,202 @@ + + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright [yyyy] [name of copyright owner] + + Licensed under the Apache License, Version 2.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. diff --git a/packages/google-cloud-connectors/README.md b/packages/google-cloud-connectors/README.md new file mode 100644 index 00000000000..8a67d32d1e8 --- /dev/null +++ b/packages/google-cloud-connectors/README.md @@ -0,0 +1,210 @@ +[//]: # "This README.md file is auto-generated, all changes to this file will be lost." +[//]: # "To regenerate it, use `python -m synthtool`." +Google Cloud Platform logo + +# [Connectors API: Node.js Client](https://github.com/googleapis/google-cloud-node/tree/main/packages/google-cloud-connectors) + +[![release level](https://img.shields.io/badge/release%20level-preview-yellow.svg?style=flat)](https://cloud.google.com/terms/launch-stages) +[![npm version](https://img.shields.io/npm/v/@google-cloud/connectors.svg)](https://www.npmjs.org/package/@google-cloud/connectors) + + + + +Connectors API client for Node.js + + +A comprehensive list of changes in each version may be found in +[the CHANGELOG](https://github.com/googleapis/google-cloud-node/tree/main/packages/google-cloud-connectors/CHANGELOG.md). + +* [Connectors API Node.js Client API Reference][client-docs] + +* [github.com/googleapis/google-cloud-node/packages/google-cloud-connectors](https://github.com/googleapis/google-cloud-node/tree/main/packages/google-cloud-connectors) + +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) + * [Using the client library](#using-the-client-library) +* [Samples](#samples) +* [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 Connectors API API][enable_api]. +1. [Set up authentication with a service account][auth] so you can access the + API from your local workstation. + +### Installing the client library + +```bash +npm install @google-cloud/connectors +``` + + +### Using the client library + +```javascript +/** + * 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. Parent resource of the Connection, of the form: + * `projects/* /locations/*` + */ +// const parent = 'abc123' +/** + * Page size. + */ +// const pageSize = 1234 +/** + * Page token. + */ +// const pageToken = 'abc123' +/** + * Filter. + */ +// const filter = 'abc123' +/** + * Order by parameters. + */ +// const orderBy = 'abc123' +/** + * Specifies which fields of the Connection are returned in the response. + * Defaults to `BASIC` view. + */ +// const view = {} + +// Imports the Connectors library +const {ConnectorsClient} = require('@google-cloud/connectors').v1; + +// Instantiates a client +const connectorsClient = new ConnectorsClient(); + +async function callListConnections() { + // Construct request + const request = { + parent, + }; + + // Run request + const iterable = await connectorsClient.listConnectionsAsync(request); + for await (const response of iterable) { + console.log(response); + } +} + +callListConnections(); + +``` + + + +## Samples + +Samples are in the [`samples/`](https://github.com/googleapis/google-cloud-node/tree/main/packages/google-cloud-connectors/samples) directory. Each sample's `README.md` has instructions for running its sample. + +| Sample | Source Code | Try it | +| --------------------------- | --------------------------------- | ------ | +| Connectors.create_connection | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-connectors/samples/generated/v1/connectors.create_connection.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-cloud-connectors/samples/generated/v1/connectors.create_connection.js,packages/google-cloud-connectors/samples/README.md) | +| Connectors.delete_connection | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-connectors/samples/generated/v1/connectors.delete_connection.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-cloud-connectors/samples/generated/v1/connectors.delete_connection.js,packages/google-cloud-connectors/samples/README.md) | +| Connectors.get_connection | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-connectors/samples/generated/v1/connectors.get_connection.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-cloud-connectors/samples/generated/v1/connectors.get_connection.js,packages/google-cloud-connectors/samples/README.md) | +| Connectors.get_connection_schema_metadata | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-connectors/samples/generated/v1/connectors.get_connection_schema_metadata.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-cloud-connectors/samples/generated/v1/connectors.get_connection_schema_metadata.js,packages/google-cloud-connectors/samples/README.md) | +| Connectors.get_connector | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-connectors/samples/generated/v1/connectors.get_connector.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-cloud-connectors/samples/generated/v1/connectors.get_connector.js,packages/google-cloud-connectors/samples/README.md) | +| Connectors.get_connector_version | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-connectors/samples/generated/v1/connectors.get_connector_version.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-cloud-connectors/samples/generated/v1/connectors.get_connector_version.js,packages/google-cloud-connectors/samples/README.md) | +| Connectors.get_global_settings | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-connectors/samples/generated/v1/connectors.get_global_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-cloud-connectors/samples/generated/v1/connectors.get_global_settings.js,packages/google-cloud-connectors/samples/README.md) | +| Connectors.get_provider | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-connectors/samples/generated/v1/connectors.get_provider.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-cloud-connectors/samples/generated/v1/connectors.get_provider.js,packages/google-cloud-connectors/samples/README.md) | +| Connectors.get_runtime_config | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-connectors/samples/generated/v1/connectors.get_runtime_config.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-cloud-connectors/samples/generated/v1/connectors.get_runtime_config.js,packages/google-cloud-connectors/samples/README.md) | +| Connectors.list_connections | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-connectors/samples/generated/v1/connectors.list_connections.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-cloud-connectors/samples/generated/v1/connectors.list_connections.js,packages/google-cloud-connectors/samples/README.md) | +| Connectors.list_connector_versions | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-connectors/samples/generated/v1/connectors.list_connector_versions.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-cloud-connectors/samples/generated/v1/connectors.list_connector_versions.js,packages/google-cloud-connectors/samples/README.md) | +| Connectors.list_connectors | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-connectors/samples/generated/v1/connectors.list_connectors.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-cloud-connectors/samples/generated/v1/connectors.list_connectors.js,packages/google-cloud-connectors/samples/README.md) | +| Connectors.list_providers | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-connectors/samples/generated/v1/connectors.list_providers.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-cloud-connectors/samples/generated/v1/connectors.list_providers.js,packages/google-cloud-connectors/samples/README.md) | +| Connectors.list_runtime_action_schemas | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-connectors/samples/generated/v1/connectors.list_runtime_action_schemas.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-cloud-connectors/samples/generated/v1/connectors.list_runtime_action_schemas.js,packages/google-cloud-connectors/samples/README.md) | +| Connectors.list_runtime_entity_schemas | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-connectors/samples/generated/v1/connectors.list_runtime_entity_schemas.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-cloud-connectors/samples/generated/v1/connectors.list_runtime_entity_schemas.js,packages/google-cloud-connectors/samples/README.md) | +| Connectors.refresh_connection_schema_metadata | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-connectors/samples/generated/v1/connectors.refresh_connection_schema_metadata.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-cloud-connectors/samples/generated/v1/connectors.refresh_connection_schema_metadata.js,packages/google-cloud-connectors/samples/README.md) | +| Connectors.update_connection | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-connectors/samples/generated/v1/connectors.update_connection.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-cloud-connectors/samples/generated/v1/connectors.update_connection.js,packages/google-cloud-connectors/samples/README.md) | +| Quickstart | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-connectors/samples/quickstart.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-cloud-connectors/samples/quickstart.js,packages/google-cloud-connectors/samples/README.md) | + + + +The [Connectors API Node.js Client API Reference][client-docs] documentation +also contains 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/connectors@legacy-8` installs client libraries +for versions compatible with Node.js 8. + +## Versioning + +This library follows [Semantic Versioning](http://semver.org/). + + + + + + + +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. + + +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](https://github.com/googleapis/google-cloud-node/blob/main/CONTRIBUTING.md). + +Please note that this `README.md`, the `samples/README.md`, +and a variety of configuration files in this repository (including `.nycrc` and `tsconfig.json`) +are generated from a central template. To edit one of these files, make an edit +to its templates in +[directory](https://github.com/googleapis/synthtool). + +## License + +Apache Version 2.0 + +See [LICENSE](https://github.com/googleapis/google-cloud-node/blob/main/LICENSE) + +[client-docs]: https://cloud.google.com/nodejs/docs/reference/connectors/latest + +[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=connectors.googleapis.com +[auth]: https://cloud.google.com/docs/authentication/getting-started diff --git a/packages/google-cloud-connectors/package.json b/packages/google-cloud-connectors/package.json new file mode 100644 index 00000000000..066d246a406 --- /dev/null +++ b/packages/google-cloud-connectors/package.json @@ -0,0 +1,70 @@ +{ + "name": "@google-cloud/connectors", + "version": "0.1.0", + "description": "Connectors API client for Node.js", + "repository": { + "type": "git", + "url": "https://github.com/googleapis/google-cloud-node.git", + "directory": "packages/google-cloud-connectors" + }, + "license": "Apache-2.0", + "author": "Google LLC", + "main": "build/src/index.js", + "files": [ + "build/src", + "build/protos" + ], + "homepage": "https://github.com/googleapis/google-cloud-node/tree/main/packages/google-cloud-connectors", + "keywords": [ + "google apis client", + "google api client", + "google apis", + "google api", + "google", + "google cloud platform", + "google cloud", + "cloud", + "google connectors", + "connectors", + "Connectors API" + ], + "scripts": { + "clean": "gts clean", + "compile": "tsc -p . && cp -r protos build/", + "compile-protos": "compileProtos src", + "docs": "jsdoc -c .jsdoc.js", + "predocs-test": "npm run docs", + "docs-test": "linkinator docs", + "fix": "gts fix", + "lint": "gts check", + "postpack": "minifyProtoJson", + "prepare": "npm run compile-protos && npm run compile", + "system-test": "c8 mocha build/system-test", + "test": "c8 mocha build/test", + "samples-test": "cd samples/ && npm link ../ && npm i && npm test", + "prelint": "cd samples; npm link ../; npm i" + }, + "dependencies": { + "google-gax": "^4.0.3" + }, + "devDependencies": { + "@types/mocha": "^9.0.0", + "@types/node": "^20.4.5", + "@types/sinon": "^10.0.0", + "c8": "^8.0.1", + "gapic-tools": "^0.1.8", + "gts": "^5.0.0", + "jsdoc": "^4.0.0", + "jsdoc-fresh": "^3.0.0", + "jsdoc-region-tag": "^3.0.0", + "linkinator": "4.1.2", + "long": "^5.2.3", + "mocha": "^9.2.2", + "pack-n-play": "^1.0.0-2", + "sinon": "^15.0.0", + "typescript": "^5.1.6" + }, + "engines": { + "node": ">=14.0.0" + } +} diff --git a/packages/google-cloud-connectors/protos/google/cloud/connectors/v1/authconfig.proto b/packages/google-cloud-connectors/protos/google/cloud/connectors/v1/authconfig.proto new file mode 100644 index 00000000000..d7ef19b4e7d --- /dev/null +++ b/packages/google-cloud-connectors/protos/google/cloud/connectors/v1/authconfig.proto @@ -0,0 +1,145 @@ +// Copyright 2023 Google LLC +// +// Licensed under the Apache License, Version 2.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.connectors.v1; + +import "google/cloud/connectors/v1/common.proto"; + +option go_package = "cloud.google.com/go/connectors/apiv1/connectorspb;connectorspb"; +option java_multiple_files = true; +option java_outer_classname = "AuthConfigProto"; +option java_package = "com.google.cloud.connectors.v1"; + +// AuthConfig defines details of a authentication type. +message AuthConfig { + // Parameters to support Username and Password Authentication. + message UserPassword { + // Username. + string username = 1; + + // Secret version reference containing the password. + Secret password = 2; + } + + // Parameters to support JSON Web Token (JWT) Profile for Oauth 2.0 + // Authorization Grant based authentication. + // See https://tools.ietf.org/html/rfc7523 for more details. + message Oauth2JwtBearer { + // JWT claims used for the jwt-bearer authorization grant. + message JwtClaims { + // Value for the "iss" claim. + string issuer = 1; + + // Value for the "sub" claim. + string subject = 2; + + // Value for the "aud" claim. + string audience = 3; + } + + // Secret version reference containing a PKCS#8 PEM-encoded private + // key associated with the Client Certificate. This private key will be + // used to sign JWTs used for the jwt-bearer authorization grant. + // Specified in the form as: `projects/*/secrets/*/versions/*`. + Secret client_key = 1; + + // JwtClaims providers fields to generate the token. + JwtClaims jwt_claims = 2; + } + + // Parameters to support Oauth 2.0 Client Credentials Grant Authentication. + // See https://tools.ietf.org/html/rfc6749#section-1.3.4 for more details. + message Oauth2ClientCredentials { + // The client identifier. + string client_id = 1; + + // Secret version reference containing the client secret. + Secret client_secret = 2; + } + + // Parameters to support Ssh public key Authentication. + message SshPublicKey { + // The user account used to authenticate. + string username = 1; + + // SSH Client Cert. It should contain both public and private key. + Secret ssh_client_cert = 3; + + // Format of SSH Client cert. + string cert_type = 4; + + // Password (passphrase) for ssh client certificate if it has one. + Secret ssh_client_cert_pass = 5; + } + + // The type of authentication configured. + AuthType auth_type = 1; + + // Supported auth types. + oneof type { + // UserPassword. + UserPassword user_password = 2; + + // Oauth2JwtBearer. + Oauth2JwtBearer oauth2_jwt_bearer = 3; + + // Oauth2ClientCredentials. + Oauth2ClientCredentials oauth2_client_credentials = 4; + + // SSH Public Key. + SshPublicKey ssh_public_key = 6; + } + + // List containing additional auth configs. + repeated ConfigVariable additional_variables = 5; +} + +// AuthConfigTemplate defines required field over an authentication type. +message AuthConfigTemplate { + // The type of authentication configured. + AuthType auth_type = 1; + + // Config variables to describe an `AuthConfig` for a `Connection`. + repeated ConfigVariableTemplate config_variable_templates = 2; + + // Display name for authentication template. + string display_name = 3; + + // Connector specific description for an authentication template. + string description = 4; +} + +// AuthType defines different authentication types. +enum AuthType { + // Authentication type not specified. + AUTH_TYPE_UNSPECIFIED = 0; + + // Username and Password Authentication. + USER_PASSWORD = 1; + + // JSON Web Token (JWT) Profile for Oauth 2.0 + // Authorization Grant based authentication + OAUTH2_JWT_BEARER = 2; + + // Oauth 2.0 Client Credentials Grant Authentication + OAUTH2_CLIENT_CREDENTIALS = 3; + + // SSH Public Key Authentication + SSH_PUBLIC_KEY = 4; + + // Oauth 2.0 Authorization Code Flow + OAUTH2_AUTH_CODE_FLOW = 5; +} diff --git a/packages/google-cloud-connectors/protos/google/cloud/connectors/v1/common.proto b/packages/google-cloud-connectors/protos/google/cloud/connectors/v1/common.proto new file mode 100644 index 00000000000..64efe869311 --- /dev/null +++ b/packages/google-cloud-connectors/protos/google/cloud/connectors/v1/common.proto @@ -0,0 +1,267 @@ +// Copyright 2023 Google LLC +// +// Licensed under the Apache License, Version 2.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.connectors.v1; + +import "google/api/field_behavior.proto"; +import "google/protobuf/timestamp.proto"; + +option go_package = "cloud.google.com/go/connectors/apiv1/connectorspb;connectorspb"; +option java_multiple_files = true; +option java_outer_classname = "CommonProto"; +option java_package = "com.google.cloud.connectors.v1"; + +// Represents the metadata of the long-running operation. +message OperationMetadata { + // Output only. The time the operation was created. + google.protobuf.Timestamp create_time = 1 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The time the operation finished running. + google.protobuf.Timestamp end_time = 2 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Server-defined resource path for the target of the operation. + string target = 3 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Name of the verb executed by the operation. + string verb = 4 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Human-readable status of the operation, if any. + string status_message = 5 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Identifies whether the user has requested cancellation + // of the operation. Operations that have successfully been cancelled + // have [Operation.error][] value with a + // [google.rpc.Status.code][google.rpc.Status.code] of 1, corresponding to + // `Code.CANCELLED`. + bool requested_cancellation = 6 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. API version used to start the operation. + string api_version = 7 [(google.api.field_behavior) = OUTPUT_ONLY]; +} + +// ConfigVariableTemplate provides metadata about a `ConfigVariable` that is +// used in a Connection. +message ConfigVariableTemplate { + // ValueType indicates the data type of the value. + enum ValueType { + // Value type is not specified. + VALUE_TYPE_UNSPECIFIED = 0; + + // Value type is string. + STRING = 1; + + // Value type is integer. + INT = 2; + + // Value type is boolean. + BOOL = 3; + + // Value type is secret. + SECRET = 4; + + // Value type is enum. + ENUM = 5; + + // Value type is authorization code. + AUTHORIZATION_CODE = 6; + } + + // Indicates the state of the config variable. + enum State { + // Status is unspecified. + STATE_UNSPECIFIED = 0; + + // Config variable is active + ACTIVE = 1; + + // Config variable is deprecated. + DEPRECATED = 2; + } + + // Key of the config variable. + string key = 1; + + // Type of the parameter: string, int, bool etc. + // consider custom type for the benefit for the validation. + ValueType value_type = 2; + + // Display name of the parameter. + string display_name = 3; + + // Description. + string description = 4; + + // Regular expression in RE2 syntax used for validating the `value` of a + // `ConfigVariable`. + string validation_regex = 5; + + // Flag represents that this `ConfigVariable` must be provided for a + // connection. + bool required = 6; + + // Role grant configuration for the config variable. + RoleGrant role_grant = 7; + + // Enum options. To be populated if `ValueType` is `ENUM` + repeated EnumOption enum_options = 8; + + // Authorization code link options. To be populated if `ValueType` is + // `AUTHORIZATION_CODE` + AuthorizationCodeLink authorization_code_link = 9; + + // State of the config variable. + State state = 10; + + // Indicates if current template is part of advanced settings + bool is_advanced = 11; +} + +// Secret provides a reference to entries in Secret Manager. +message Secret { + // The resource name of the secret version in the format, + // format as: `projects/*/secrets/*/versions/*`. + string secret_version = 1; +} + +// EnumOption definition +message EnumOption { + // Id of the option. + string id = 1; + + // Display name of the option. + string display_name = 2; +} + +// ConfigVariable represents a configuration variable present in a Connection. +// or AuthConfig. +message ConfigVariable { + // Key of the config variable. + string key = 1; + + // Value type of the config variable. + oneof value { + // Value is an integer + int64 int_value = 2; + + // Value is a bool. + bool bool_value = 3; + + // Value is a string. + string string_value = 4; + + // Value is a secret. + Secret secret_value = 5; + } +} + +// This configuration defines all the Cloud IAM roles that needs to be granted +// to a particular GCP resource for the selected prinicpal like service +// account. These configurations will let UI display to customers what +// IAM roles need to be granted by them. Or these configurations can be used +// by the UI to render a 'grant' button to do the same on behalf of the user. +message RoleGrant { + // Supported Principal values. + enum Principal { + // Value type is not specified. + PRINCIPAL_UNSPECIFIED = 0; + + // Service Account used for Connector workload identity + // This is either the default service account if unspecified or Service + // Account provided by Customers through BYOSA. + CONNECTOR_SA = 1; + } + + // Resource definition + message Resource { + // Resource Type definition. + enum Type { + // Value type is not specified. + TYPE_UNSPECIFIED = 0; + + // GCP Project Resource. + GCP_PROJECT = 1; + + // Any GCP Resource which is identified uniquely by IAM. + GCP_RESOURCE = 2; + + // GCP Secret Resource. + GCP_SECRETMANAGER_SECRET = 3; + + // GCP Secret Version Resource. + GCP_SECRETMANAGER_SECRET_VERSION = 4; + } + + // Different types of resource supported. + Type type = 1; + + // Template to uniquely represent a GCP resource in a format IAM expects + // This is a template that can have references to other values provided in + // the config variable template. + string path_template = 3; + } + + // Prinicipal/Identity for whom the role need to assigned. + Principal principal = 1; + + // List of roles that need to be granted. + repeated string roles = 2; + + // Resource on which the roles needs to be granted for the principal. + Resource resource = 3; + + // Template that UI can use to provide helper text to customers. + string helper_text_template = 4; +} + +// This configuration captures the details required to render an authorization +// link for the OAuth Authorization Code Flow. +message AuthorizationCodeLink { + // The base URI the user must click to trigger the authorization code login + // flow. + string uri = 1; + + // The scopes for which the user will authorize GCP Connectors on the + // connector data source. + repeated string scopes = 2; + + // The client ID assigned to the GCP Connectors OAuth app for the connector + // data source. + string client_id = 3; + + // Whether to enable PKCE for the auth code flow. + bool enable_pkce = 4; +} + +// LaunchStage is a enum to indicate launch stage: +// PREVIEW, GA, DEPRECATED, PRIVATE_PREVIEW. +enum LaunchStage { + // LAUNCH_STAGE_UNSPECIFIED. + LAUNCH_STAGE_UNSPECIFIED = 0; + + // PREVIEW. + PREVIEW = 1; + + // GA. + GA = 2; + + // DEPRECATED. + DEPRECATED = 3; + + // PRIVATE_PREVIEW. + PRIVATE_PREVIEW = 5; +} diff --git a/packages/google-cloud-connectors/protos/google/cloud/connectors/v1/connection.proto b/packages/google-cloud-connectors/protos/google/cloud/connectors/v1/connection.proto new file mode 100644 index 00000000000..16fd258b32c --- /dev/null +++ b/packages/google-cloud-connectors/protos/google/cloud/connectors/v1/connection.proto @@ -0,0 +1,673 @@ +// Copyright 2023 Google LLC +// +// Licensed under the Apache License, Version 2.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.connectors.v1; + +import "google/api/field_behavior.proto"; +import "google/api/resource.proto"; +import "google/cloud/connectors/v1/authconfig.proto"; +import "google/cloud/connectors/v1/common.proto"; +import "google/cloud/connectors/v1/destination_config.proto"; +import "google/cloud/connectors/v1/ssl_config.proto"; +import "google/protobuf/field_mask.proto"; +import "google/protobuf/struct.proto"; +import "google/protobuf/timestamp.proto"; + +option go_package = "cloud.google.com/go/connectors/apiv1/connectorspb;connectorspb"; +option java_multiple_files = true; +option java_outer_classname = "ConnectionProto"; +option java_package = "com.google.cloud.connectors.v1"; + +// Connection represents an instance of connector. +message Connection { + option (google.api.resource) = { + type: "connectors.googleapis.com/Connection" + pattern: "projects/{project}/locations/{location}/connections/{connection}" + }; + + // Output only. Resource name of the Connection. + // Format: projects/{project}/locations/{location}/connections/{connection} + string name = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Created time. + google.protobuf.Timestamp create_time = 2 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Updated time. + google.protobuf.Timestamp update_time = 3 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Optional. Resource labels to represent user-provided metadata. + // Refer to cloud documentation on labels for more details. + // https://cloud.google.com/compute/docs/labeling-resources + map labels = 4 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Description of the resource. + string description = 5 [(google.api.field_behavior) = OPTIONAL]; + + // Required. Connector version on which the connection is created. + // The format is: + // projects/*/locations/*/providers/*/connectors/*/versions/* + // Only global location is supported for ConnectorVersion resource. + string connector_version = 6 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "connectors.googleapis.com/ConnectorVersion" + } + ]; + + // Output only. Current status of the connection. + ConnectionStatus status = 7 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Optional. Configuration for configuring the connection with an external + // system. + repeated ConfigVariable config_variables = 8 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Configuration for establishing the connection's authentication + // with an external system. + AuthConfig auth_config = 9 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Configuration that indicates whether or not the Connection can be + // edited. + LockConfig lock_config = 10 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Configuration of the Connector's destination. Only accepted for + // Connectors that accepts user defined destination(s). + repeated DestinationConfig destination_configs = 18 + [(google.api.field_behavior) = OPTIONAL]; + + // Output only. GCR location where the runtime image is stored. + // formatted like: gcr.io/{bucketName}/{imageName} + string image_location = 11 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Optional. Service account needed for runtime plane to access GCP resources. + string service_account = 12 [(google.api.field_behavior) = OPTIONAL]; + + // Output only. The name of the Service Directory service name. Used for + // Private Harpoon to resolve the ILB address. + // e.g. + // "projects/cloud-connectors-e2e-testing/locations/us-central1/namespaces/istio-system/services/istio-ingressgateway-connectors" + string service_directory = 13 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. GCR location where the envoy image is stored. + // formatted like: gcr.io/{bucketName}/{imageName} + string envoy_image_location = 15 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Optional. Suspended indicates if a user has suspended a connection or not. + bool suspended = 17 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Node configuration for the connection. + NodeConfig node_config = 19 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Ssl config of a connection + SslConfig ssl_config = 21 [(google.api.field_behavior) = OPTIONAL]; +} + +// Node configuration for the connection. +message NodeConfig { + // Minimum number of nodes in the runtime nodes. + int32 min_node_count = 1; + + // Maximum number of nodes in the runtime nodes. + int32 max_node_count = 2; +} + +// ConnectionSchemaMetadata is the singleton resource of each connection. +// It includes the entity and action names of runtime resources exposed +// by a connection backend. +message ConnectionSchemaMetadata { + option (google.api.resource) = { + type: "connectors.googleapis.com/ConnectionSchemaMetadata" + pattern: "projects/{project}/locations/{location}/connections/{connection}/connectionSchemaMetadata" + }; + + // State of connection runtime schema. + enum State { + // Default state. + STATE_UNSPECIFIED = 0; + + // Schema refresh is in progress. + REFRESHING = 1; + + // Schema has been updated. + UPDATED = 2; + } + + // Output only. List of entity names. + repeated string entities = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. List of actions. + repeated string actions = 2 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Resource name. + // Format: + // projects/{project}/locations/{location}/connections/{connection}/connectionSchemaMetadata + string name = 3 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Timestamp when the connection runtime schema was updated. + google.protobuf.Timestamp update_time = 4 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Timestamp when the connection runtime schema refresh was + // triggered. + google.protobuf.Timestamp refresh_time = 5 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The current state of runtime schema. + State state = 6 [(google.api.field_behavior) = OUTPUT_ONLY]; +} + +// Schema of a runtime entity. +message RuntimeEntitySchema { + // Metadata of an entity field. + message Field { + // Name of the Field. + string field = 1; + + // A brief description of the Field. + string description = 2; + + // The data type of the Field. + DataType data_type = 3; + + // The following boolean field specifies if the current Field acts + // as a primary key or id if the parent is of type entity. + bool key = 4; + + // Specifies if the Field is readonly. + bool readonly = 5; + + // Specifies whether a null value is allowed. + bool nullable = 6; + + // The following field specifies the default value of the Field provided + // by the external system if a value is not provided. + google.protobuf.Value default_value = 7; + + // The following map contains fields that are not explicitly mentioned + // above,this give connectors the flexibility to add new metadata + // fields. + google.protobuf.Struct additional_details = 8; + } + + // Output only. Name of the entity. + string entity = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. List of fields in the entity. + repeated Field fields = 2 [(google.api.field_behavior) = OUTPUT_ONLY]; +} + +// Schema of a runtime action. +message RuntimeActionSchema { + // Metadata of an input parameter. + message InputParameter { + // Name of the Parameter. + string parameter = 1; + + // A brief description of the Parameter. + string description = 2; + + // The data type of the Parameter. + DataType data_type = 3; + + // Specifies whether a null value is allowed. + bool nullable = 4; + + // The following field specifies the default value of the Parameter + // provided by the external system if a value is not provided. + google.protobuf.Value default_value = 5; + } + + // Metadata of result field. + message ResultMetadata { + // Name of the result field. + string field = 1; + + // A brief description of the field. + string description = 2; + + // The data type of the field. + DataType data_type = 3; + } + + // Output only. Name of the action. + string action = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. List of input parameter metadata for the action. + repeated InputParameter input_parameters = 2 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. List of result field metadata. + repeated ResultMetadata result_metadata = 3 + [(google.api.field_behavior) = OUTPUT_ONLY]; +} + +// Determines whether or no a connection is locked. If locked, a reason must be +// specified. +message LockConfig { + // Indicates whether or not the connection is locked. + bool locked = 1; + + // Describes why a connection is locked. + string reason = 2; +} + +// Request message for ConnectorsService.ListConnections +message ListConnectionsRequest { + // Required. Parent resource of the Connection, of the form: + // `projects/*/locations/*` + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "connectors.googleapis.com/Connection" + } + ]; + + // Page size. + int32 page_size = 2; + + // Page token. + string page_token = 3; + + // Filter. + string filter = 4; + + // Order by parameters. + string order_by = 5; + + // Specifies which fields of the Connection are returned in the response. + // Defaults to `BASIC` view. + ConnectionView view = 6; +} + +// Response message for ConnectorsService.ListConnections +message ListConnectionsResponse { + // Connections. + repeated Connection connections = 1; + + // Next page token. + string next_page_token = 2; + + // Locations that could not be reached. + repeated string unreachable = 3; +} + +// Request message for ConnectorsService.GetConnection +message GetConnectionRequest { + // Required. Resource name of the form: + // `projects/*/locations/*/connections/*` + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "connectors.googleapis.com/Connection" + } + ]; + + // Specifies which fields of the Connection are returned in the response. + // Defaults to `BASIC` view. + ConnectionView view = 2; +} + +// Request message for ConnectorsService.CreateConnection +message CreateConnectionRequest { + // Required. Parent resource of the Connection, of the form: + // `projects/*/locations/*` + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "connectors.googleapis.com/Connection" + } + ]; + + // Required. Identifier to assign to the Connection. Must be unique within + // scope of the parent resource. + string connection_id = 2 [(google.api.field_behavior) = REQUIRED]; + + // Required. Connection resource. + Connection connection = 3 [(google.api.field_behavior) = REQUIRED]; +} + +// Request message for ConnectorsService.UpdateConnection +message UpdateConnectionRequest { + // Required. Connection resource. + Connection connection = 1 [(google.api.field_behavior) = REQUIRED]; + + // Required. You can modify only the fields listed below. + // + // To lock/unlock a connection: + // * `lock_config` + // + // To suspend/resume a connection: + // * `suspended` + // + // To update the connection details: + // * `description` + // * `labels` + // * `connector_version` + // * `config_variables` + // * `auth_config` + // * `destination_configs` + // * `node_config` + google.protobuf.FieldMask update_mask = 2 + [(google.api.field_behavior) = REQUIRED]; +} + +// Request message for ConnectorsService.DeleteConnection. +message DeleteConnectionRequest { + // Required. Resource name of the form: + // `projects/*/locations/*/connections/*` + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "connectors.googleapis.com/Connection" + } + ]; +} + +// Request message for ConnectorsService.GetConnectionSchemaMetadata. +message GetConnectionSchemaMetadataRequest { + // Required. Connection name + // Format: + // projects/{project}/locations/{location}/connections/{connection}/connectionSchemaMetadata + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "connectors.googleapis.com/ConnectionSchemaMetadata" + } + ]; +} + +// Request message for ConnectorsService.RefreshConnectionSchemaMetadata. +message RefreshConnectionSchemaMetadataRequest { + // Required. Resource name. + // Format: + // projects/{project}/locations/{location}/connections/{connection}/connectionSchemaMetadata + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "connectors.googleapis.com/ConnectionSchemaMetadata" + } + ]; +} + +// Request message for ConnectorsService.ListRuntimeEntitySchemas. +// For filter, only entity field is supported with literal equality operator. +// Accepted filter example: entity="Order" +// Wildcards are not supported in the filter currently. +message ListRuntimeEntitySchemasRequest { + // Required. Parent resource of RuntimeEntitySchema + // Format: + // projects/{project}/locations/{location}/connections/{connection} + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "connectors.googleapis.com/Connection" + } + ]; + + // Page size. + int32 page_size = 2; + + // Page token. + string page_token = 3; + + // Required. Filter + // Format: + // entity="{entityId}" + // Only entity field is supported with literal equality operator. + // Accepted filter example: entity="Order" + // Wildcards are not supported in the filter currently. + string filter = 4 [(google.api.field_behavior) = REQUIRED]; +} + +// Response message for ConnectorsService.ListRuntimeEntitySchemas. +message ListRuntimeEntitySchemasResponse { + // Runtime entity schemas. + repeated RuntimeEntitySchema runtime_entity_schemas = 1; + + // Next page token. + string next_page_token = 2; +} + +// Request message for ConnectorsService.ListRuntimeActionSchemas. +// For filter, only action field is supported with literal equality operator. +// Accepted filter example: action="approveOrder" +// Wildcards are not supported in the filter currently. +message ListRuntimeActionSchemasRequest { + // Required. Parent resource of RuntimeActionSchema + // Format: + // projects/{project}/locations/{location}/connections/{connection} + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "connectors.googleapis.com/Connection" + } + ]; + + // Page size. + int32 page_size = 2; + + // Page token. + string page_token = 3; + + // Required. Filter + // Format: + // action="{actionId}" + // Only action field is supported with literal equality operator. + // Accepted filter example: action="CancelOrder" + // Wildcards are not supported in the filter currently. + string filter = 4 [(google.api.field_behavior) = REQUIRED]; +} + +// Response message for ConnectorsService.ListRuntimeActionSchemas. +message ListRuntimeActionSchemasResponse { + // Runtime action schemas. + repeated RuntimeActionSchema runtime_action_schemas = 1; + + // Next page token. + string next_page_token = 2; +} + +// ConnectionStatus indicates the state of the connection. +message ConnectionStatus { + // All the possible Connection State. + enum State { + // Connection does not have a state yet. + STATE_UNSPECIFIED = 0; + + // Connection is being created. + CREATING = 1; + + // Connection is running and ready for requests. + ACTIVE = 2; + + // Connection is stopped. + INACTIVE = 3; + + // Connection is being deleted. + DELETING = 4; + + // Connection is being updated. + UPDATING = 5; + + // Connection is not running due to an error. + ERROR = 6; + + // Connection is not running due to an auth error for the Oauth2 Auth Code + // based connector. + AUTHORIZATION_REQUIRED = 7; + } + + // State. + State state = 1; + + // Description. + string description = 2; + + // Status provides detailed information for the state. + string status = 3; +} + +// All possible data types of a entity or action field. +enum DataType { + // Data type is not specified. + DATA_TYPE_UNSPECIFIED = 0; + + // DEPRECATED! Use DATA_TYPE_INTEGER. + DATA_TYPE_INT = 1 [deprecated = true]; + + // Short integer(int16) data type. + DATA_TYPE_SMALLINT = 2; + + // Double data type. + DATA_TYPE_DOUBLE = 3; + + // Date data type. + DATA_TYPE_DATE = 4; + + // DEPRECATED! Use DATA_TYPE_TIMESTAMP. + DATA_TYPE_DATETIME = 5 [deprecated = true]; + + // Time data type. + DATA_TYPE_TIME = 6; + + // DEPRECATED! Use DATA_TYPE_VARCHAR. + DATA_TYPE_STRING = 7 [deprecated = true]; + + // DEPRECATED! Use DATA_TYPE_BIGINT. + DATA_TYPE_LONG = 8 [deprecated = true]; + + // Boolean data type. + DATA_TYPE_BOOLEAN = 9; + + // Decimal data type. + DATA_TYPE_DECIMAL = 10; + + // DEPRECATED! Use DATA_TYPE_VARCHAR. + DATA_TYPE_UUID = 11 [deprecated = true]; + + // UNSUPPORTED! Binary data type. + DATA_TYPE_BLOB = 12; + + // Bit data type. + DATA_TYPE_BIT = 13; + + // Small integer(int8) data type. + DATA_TYPE_TINYINT = 14; + + // Integer(int32) data type. + DATA_TYPE_INTEGER = 15; + + // Long integer(int64) data type. + DATA_TYPE_BIGINT = 16; + + // Float data type. + DATA_TYPE_FLOAT = 17; + + // Real data type. + DATA_TYPE_REAL = 18; + + // Numeric data type. + DATA_TYPE_NUMERIC = 19; + + // Char data type. + DATA_TYPE_CHAR = 20; + + // Varchar data type. + DATA_TYPE_VARCHAR = 21; + + // Longvarchar data type. + DATA_TYPE_LONGVARCHAR = 22; + + // Timestamp data type. + DATA_TYPE_TIMESTAMP = 23; + + // Nchar data type. + DATA_TYPE_NCHAR = 24; + + // Nvarchar data type. + DATA_TYPE_NVARCHAR = 25; + + // Longnvarchar data type. + DATA_TYPE_LONGNVARCHAR = 26; + + // Null data type. + DATA_TYPE_NULL = 27; + + // UNSUPPORTED! Binary data type. + DATA_TYPE_OTHER = 28; + + // UNSUPPORTED! Binary data type. + DATA_TYPE_JAVA_OBJECT = 29; + + // UNSUPPORTED! Binary data type. + DATA_TYPE_DISTINCT = 30; + + // UNSUPPORTED! Binary data type. + DATA_TYPE_STRUCT = 31; + + // UNSUPPORTED! Binary data type. + DATA_TYPE_ARRAY = 32; + + // UNSUPPORTED! Binary data type. + DATA_TYPE_CLOB = 33; + + // UNSUPPORTED! Binary data type. + DATA_TYPE_REF = 34; + + // UNSUPPORTED! Binary data type. + DATA_TYPE_DATALINK = 35; + + // UNSUPPORTED! Row id data type. + DATA_TYPE_ROWID = 36; + + // UNSUPPORTED! Binary data type. + DATA_TYPE_BINARY = 37; + + // UNSUPPORTED! Variable binary data type. + DATA_TYPE_VARBINARY = 38; + + // UNSUPPORTED! Long variable binary data type. + DATA_TYPE_LONGVARBINARY = 39; + + // UNSUPPORTED! NCLOB data type. + DATA_TYPE_NCLOB = 40; + + // UNSUPPORTED! SQL XML data type is not supported. + DATA_TYPE_SQLXML = 41; + + // UNSUPPORTED! Cursor reference type is not supported. + DATA_TYPE_REF_CURSOR = 42; + + // UNSUPPORTED! Use TIME or TIMESTAMP instead. + DATA_TYPE_TIME_WITH_TIMEZONE = 43; + + // UNSUPPORTED! Use TIMESTAMP instead. + DATA_TYPE_TIMESTAMP_WITH_TIMEZONE = 44; +} + +// Enum to control which fields should be included in the response. +enum ConnectionView { + // CONNECTION_UNSPECIFIED. + CONNECTION_VIEW_UNSPECIFIED = 0; + + // Do not include runtime required configs. + BASIC = 1; + + // Include runtime required configs. + FULL = 2; +} diff --git a/packages/google-cloud-connectors/protos/google/cloud/connectors/v1/connector.proto b/packages/google-cloud-connectors/protos/google/cloud/connectors/v1/connector.proto new file mode 100644 index 00000000000..0aeb357c69c --- /dev/null +++ b/packages/google-cloud-connectors/protos/google/cloud/connectors/v1/connector.proto @@ -0,0 +1,116 @@ +// Copyright 2023 Google LLC +// +// Licensed under the Apache License, Version 2.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.connectors.v1; + +import "google/api/field_behavior.proto"; +import "google/api/resource.proto"; +import "google/cloud/connectors/v1/common.proto"; +import "google/protobuf/timestamp.proto"; + +option go_package = "cloud.google.com/go/connectors/apiv1/connectorspb;connectorspb"; +option java_multiple_files = true; +option java_outer_classname = "ConnectorProto"; +option java_package = "com.google.cloud.connectors.v1"; + +// Connectors indicates a specific connector type, e.x. Salesforce, SAP etc. +message Connector { + option (google.api.resource) = { + type: "connectors.googleapis.com/Connector" + pattern: "projects/{project}/locations/{location}/providers/{provider}/connectors/{connector}" + }; + + // Output only. Resource name of the Connector. + // Format: + // projects/{project}/locations/{location}/providers/{provider}/connectors/{connector} + // Only global location is supported for Connector resource. + string name = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Created time. + google.protobuf.Timestamp create_time = 2 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Updated time. + google.protobuf.Timestamp update_time = 3 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Resource labels to represent user-provided metadata. + // Refer to cloud documentation on labels for more details. + // https://cloud.google.com/compute/docs/labeling-resources + map labels = 4 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Link to documentation page. + string documentation_uri = 6 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Link to external page. + string external_uri = 7 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Description of the resource. + string description = 8 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Cloud storage location of icons etc consumed by UI. + string web_assets_location = 9 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Display name. + string display_name = 10 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Flag to mark the version indicating the launch stage. + LaunchStage launch_stage = 11 [(google.api.field_behavior) = OUTPUT_ONLY]; +} + +// Request message for Connectors.GetConnector. +message GetConnectorRequest { + // Required. Resource name of the form: + // `projects/*/locations/*/providers/*/connectors/*` + // Only global location is supported for Connector resource. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "connectors.googleapis.com/Connector" + } + ]; +} + +// Request message for Connectors.ListConnectors. +message ListConnectorsRequest { + // Required. Parent resource of the connectors, of the form: + // `projects/*/locations/*/providers/*` + // Only global location is supported for Connector resource. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "connectors.googleapis.com/Provider" + } + ]; + + // Page size. + int32 page_size = 2; + + // Page token. + string page_token = 3; +} + +// Response message for Connectors.ListConnectors. +message ListConnectorsResponse { + // A list of connectors. + repeated Connector connectors = 1; + + // Next page token. + string next_page_token = 2; + + // Locations that could not be reached. + repeated string unreachable = 3; +} diff --git a/packages/google-cloud-connectors/protos/google/cloud/connectors/v1/connector_version.proto b/packages/google-cloud-connectors/protos/google/cloud/connectors/v1/connector_version.proto new file mode 100644 index 00000000000..00c8c603627 --- /dev/null +++ b/packages/google-cloud-connectors/protos/google/cloud/connectors/v1/connector_version.proto @@ -0,0 +1,226 @@ +// Copyright 2023 Google LLC +// +// Licensed under the Apache License, Version 2.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.connectors.v1; + +import "google/api/field_behavior.proto"; +import "google/api/resource.proto"; +import "google/cloud/connectors/v1/authconfig.proto"; +import "google/cloud/connectors/v1/common.proto"; +import "google/cloud/connectors/v1/ssl_config.proto"; +import "google/protobuf/timestamp.proto"; + +option go_package = "cloud.google.com/go/connectors/apiv1/connectorspb;connectorspb"; +option java_multiple_files = true; +option java_outer_classname = "ConnectorVersionProto"; +option java_package = "com.google.cloud.connectors.v1"; + +// ConnectorVersion indicates a specific version of a connector. +message ConnectorVersion { + option (google.api.resource) = { + type: "connectors.googleapis.com/ConnectorVersion" + pattern: "projects/{project}/locations/{location}/providers/{provider}/connectors/{connector}/versions/{version}" + }; + + // Output only. Resource name of the Version. + // Format: + // projects/{project}/locations/{location}/providers/{provider}/connectors/{connector}/versions/{version} + // Only global location is supported for Connector resource. + string name = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Created time. + google.protobuf.Timestamp create_time = 2 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Updated time. + google.protobuf.Timestamp update_time = 3 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Resource labels to represent user-provided metadata. + // Refer to cloud documentation on labels for more details. + // https://cloud.google.com/compute/docs/labeling-resources + map labels = 4 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Flag to mark the version indicating the launch stage. + LaunchStage launch_stage = 6 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. ReleaseVersion of the connector, for example: "1.0.1-alpha". + string release_version = 7 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. List of auth configs supported by the Connector Version. + repeated AuthConfigTemplate auth_config_templates = 8 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. List of config variables needed to create a connection. + repeated ConfigVariableTemplate config_variable_templates = 9 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Information about the runtime features supported by the + // Connector. + SupportedRuntimeFeatures supported_runtime_features = 10 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Display name. + string display_name = 11 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Configuration for Egress Control. + EgressControlConfig egress_control_config = 12 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Role grant configurations for this connector version. + repeated RoleGrant role_grants = 14 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Role grant configuration for this config variable. It will be + // DEPRECATED soon. + RoleGrant role_grant = 15 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Ssl configuration supported by the Connector. + SslConfigTemplate ssl_config_template = 17 + [(google.api.field_behavior) = OUTPUT_ONLY]; +} + +// Request message for Connectors.GetConnectorVersion. +message GetConnectorVersionRequest { + // Required. Resource name of the form: + // `projects/*/locations/*/providers/*/connectors/*/versions/*` + // Only global location is supported for ConnectorVersion resource. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "connectors.googleapis.com/ConnectorVersion" + } + ]; + + // Specifies which fields of the ConnectorVersion are returned in the + // response. Defaults to `CUSTOMER` view. + ConnectorVersionView view = 2; +} + +// Request message for Connectors.ListConnectorVersions. +message ListConnectorVersionsRequest { + // Required. Parent resource of the connectors, of the form: + // `projects/*/locations/*/providers/*/connectors/*` + // Only global location is supported for ConnectorVersion resource. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "connectors.googleapis.com/Connector" + } + ]; + + // Page size. + int32 page_size = 2; + + // Page token. + string page_token = 3; + + // Specifies which fields of the ConnectorVersion are returned in the + // response. Defaults to `BASIC` view. + ConnectorVersionView view = 4; +} + +// Response message for Connectors.ListConnectorVersions. +message ListConnectorVersionsResponse { + // A list of connector versions. + repeated ConnectorVersion connector_versions = 1; + + // Next page token. + string next_page_token = 2; + + // Locations that could not be reached. + repeated string unreachable = 3; +} + +// Supported runtime features of a connector version. This is passed to the +// management layer to add a new connector version by the connector developer. +// Details about how this proto is passed to the management layer is covered in +// this doc - go/runtime-manifest. +message SupportedRuntimeFeatures { + // Specifies if the connector supports entity apis like 'createEntity'. + bool entity_apis = 1; + + // Specifies if the connector supports action apis like 'executeAction'. + bool action_apis = 2; + + // Specifies if the connector supports 'ExecuteSqlQuery' operation. + bool sql_query = 3; +} + +// Egress control config for connector runtime. These configurations define the +// rules to identify which outbound domains/hosts needs to be whitelisted. It +// may be a static information for a particular connector version or it is +// derived from the configurations provided by the customer in Connection +// resource. +message EgressControlConfig { + oneof oneof_backends { + // Static Comma separated backends which are common for all Connection + // resources. Supported formats for each backend are host:port or just + // host (host can be ip address or domain name). + string backends = 1; + + // Extractions Rules to extract the backends from customer provided + // configuration. + ExtractionRules extraction_rules = 2; + } +} + +// Extraction Rules to identity the backends from customer provided +// configuration in Connection resource. +message ExtractionRules { + // Collection of Extraction Rule. + repeated ExtractionRule extraction_rule = 1; +} + +// Extraction Rule. +message ExtractionRule { + // Source to extract the backend from. + message Source { + // Type of the source. + SourceType source_type = 1; + + // Field identifier. For example config vaiable name. + string field_id = 2; + } + + // Supported Source types for extraction. + enum SourceType { + // Default SOURCE. + SOURCE_TYPE_UNSPECIFIED = 0; + + // Config Variable source type. + CONFIG_VARIABLE = 1; + } + + // Source on which the rule is applied. + Source source = 1; + + // Regex used to extract backend details from source. If empty, whole source + // value will be used. + string extraction_regex = 2; +} + +// Enum to control which fields should be included in the response. +enum ConnectorVersionView { + // CONNECTOR_VERSION_VIEW_UNSPECIFIED. + CONNECTOR_VERSION_VIEW_UNSPECIFIED = 0; + + // Do not include role grant configs. + CONNECTOR_VERSION_VIEW_BASIC = 1; + + // Include role grant configs. + CONNECTOR_VERSION_VIEW_FULL = 2; +} diff --git a/packages/google-cloud-connectors/protos/google/cloud/connectors/v1/connectors_service.proto b/packages/google-cloud-connectors/protos/google/cloud/connectors/v1/connectors_service.proto new file mode 100644 index 00000000000..2f1d3e03365 --- /dev/null +++ b/packages/google-cloud-connectors/protos/google/cloud/connectors/v1/connectors_service.proto @@ -0,0 +1,209 @@ +// Copyright 2023 Google LLC +// +// Licensed under the Apache License, Version 2.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.connectors.v1; + +import "google/api/annotations.proto"; +import "google/api/client.proto"; +import "google/cloud/connectors/v1/common.proto"; +import "google/cloud/connectors/v1/connection.proto"; +import "google/cloud/connectors/v1/connector.proto"; +import "google/cloud/connectors/v1/connector_version.proto"; +import "google/cloud/connectors/v1/provider.proto"; +import "google/cloud/connectors/v1/runtime.proto"; +import "google/cloud/connectors/v1/settings.proto"; +import "google/longrunning/operations.proto"; +import "google/protobuf/empty.proto"; + +option go_package = "cloud.google.com/go/connectors/apiv1/connectorspb;connectorspb"; +option java_multiple_files = true; +option java_outer_classname = "ConnectorsServiceProto"; +option java_package = "com.google.cloud.connectors.v1"; + +// Connectors is the interface for managing Connectors. +service Connectors { + option (google.api.default_host) = "connectors.googleapis.com"; + option (google.api.oauth_scopes) = + "https://www.googleapis.com/auth/cloud-platform"; + + // Lists Connections in a given project and location. + rpc ListConnections(ListConnectionsRequest) + returns (ListConnectionsResponse) { + option (google.api.http) = { + get: "/v1/{parent=projects/*/locations/*}/connections" + }; + option (google.api.method_signature) = "parent"; + } + + // Gets details of a single Connection. + rpc GetConnection(GetConnectionRequest) returns (Connection) { + option (google.api.http) = { + get: "/v1/{name=projects/*/locations/*/connections/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Creates a new Connection in a given project and location. + rpc CreateConnection(CreateConnectionRequest) + returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v1/{parent=projects/*/locations/*}/connections" + body: "connection" + }; + option (google.api.method_signature) = "parent,connection,connection_id"; + option (google.longrunning.operation_info) = { + response_type: "Connection" + metadata_type: "OperationMetadata" + }; + } + + // Updates the parameters of a single Connection. + rpc UpdateConnection(UpdateConnectionRequest) + returns (google.longrunning.Operation) { + option (google.api.http) = { + patch: "/v1/{connection.name=projects/*/locations/*/connections/*}" + body: "connection" + }; + option (google.api.method_signature) = "connection,update_mask"; + option (google.longrunning.operation_info) = { + response_type: "Connection" + metadata_type: "OperationMetadata" + }; + } + + // Deletes a single Connection. + rpc DeleteConnection(DeleteConnectionRequest) + returns (google.longrunning.Operation) { + option (google.api.http) = { + delete: "/v1/{name=projects/*/locations/*/connections/*}" + }; + option (google.api.method_signature) = "name"; + option (google.longrunning.operation_info) = { + response_type: "google.protobuf.Empty" + metadata_type: "OperationMetadata" + }; + } + + // Lists Providers in a given project and location. + rpc ListProviders(ListProvidersRequest) returns (ListProvidersResponse) { + option (google.api.http) = { + get: "/v1/{parent=projects/*/locations/*}/providers" + }; + option (google.api.method_signature) = "parent"; + } + + // Gets details of a provider. + rpc GetProvider(GetProviderRequest) returns (Provider) { + option (google.api.http) = { + get: "/v1/{name=projects/*/locations/*/providers/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Lists Connectors in a given project and location. + rpc ListConnectors(ListConnectorsRequest) returns (ListConnectorsResponse) { + option (google.api.http) = { + get: "/v1/{parent=projects/*/locations/*/providers/*}/connectors" + }; + option (google.api.method_signature) = "parent"; + } + + // Gets details of a single Connector. + rpc GetConnector(GetConnectorRequest) returns (Connector) { + option (google.api.http) = { + get: "/v1/{name=projects/*/locations/*/providers/*/connectors/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Lists Connector Versions in a given project and location. + rpc ListConnectorVersions(ListConnectorVersionsRequest) + returns (ListConnectorVersionsResponse) { + option (google.api.http) = { + get: "/v1/{parent=projects/*/locations/*/providers/*/connectors/*}/versions" + }; + option (google.api.method_signature) = "parent"; + } + + // Gets details of a single connector version. + rpc GetConnectorVersion(GetConnectorVersionRequest) + returns (ConnectorVersion) { + option (google.api.http) = { + get: "/v1/{name=projects/*/locations/*/providers/*/connectors/*/versions/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Gets schema metadata of a connection. + // SchemaMetadata is a singleton resource for each connection. + rpc GetConnectionSchemaMetadata(GetConnectionSchemaMetadataRequest) + returns (ConnectionSchemaMetadata) { + option (google.api.http) = { + get: "/v1/{name=projects/*/locations/*/connections/*/connectionSchemaMetadata}" + }; + option (google.api.method_signature) = "name"; + } + + // Refresh runtime schema of a connection. + rpc RefreshConnectionSchemaMetadata(RefreshConnectionSchemaMetadataRequest) + returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v1/{name=projects/*/locations/*/connections/*/connectionSchemaMetadata}:refresh" + body: "*" + }; + option (google.api.method_signature) = "name"; + option (google.longrunning.operation_info) = { + response_type: "ConnectionSchemaMetadata" + metadata_type: "OperationMetadata" + }; + } + + // List schema of a runtime entities filtered by entity name. + rpc ListRuntimeEntitySchemas(ListRuntimeEntitySchemasRequest) + returns (ListRuntimeEntitySchemasResponse) { + option (google.api.http) = { + get: "/v1/{parent=projects/*/locations/*/connections/*}/runtimeEntitySchemas" + }; + option (google.api.method_signature) = "parent"; + } + + // List schema of a runtime actions filtered by action name. + rpc ListRuntimeActionSchemas(ListRuntimeActionSchemasRequest) + returns (ListRuntimeActionSchemasResponse) { + option (google.api.http) = { + get: "/v1/{parent=projects/*/locations/*/connections/*}/runtimeActionSchemas" + }; + option (google.api.method_signature) = "parent"; + } + + // Gets the runtimeConfig of a location. + // RuntimeConfig is a singleton resource for each location. + rpc GetRuntimeConfig(GetRuntimeConfigRequest) returns (RuntimeConfig) { + option (google.api.http) = { + get: "/v1/{name=projects/*/locations/*/runtimeConfig}" + }; + option (google.api.method_signature) = "name"; + } + + // GetGlobalSettings gets settings of a project. + // GlobalSettings is a singleton resource. + rpc GetGlobalSettings(GetGlobalSettingsRequest) returns (Settings) { + option (google.api.http) = { + get: "/v1/{name=projects/*/locations/global/settings}" + }; + option (google.api.method_signature) = "name"; + } +} diff --git a/packages/google-cloud-connectors/protos/google/cloud/connectors/v1/destination_config.proto b/packages/google-cloud-connectors/protos/google/cloud/connectors/v1/destination_config.proto new file mode 100644 index 00000000000..b8a2665884d --- /dev/null +++ b/packages/google-cloud-connectors/protos/google/cloud/connectors/v1/destination_config.proto @@ -0,0 +1,43 @@ +// Copyright 2023 Google LLC +// +// Licensed under the Apache License, Version 2.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.connectors.v1; + +option go_package = "cloud.google.com/go/connectors/apiv1/connectorspb;connectorspb"; +option java_multiple_files = true; + +// Define the Connectors target endpoint. +message DestinationConfig { + // The key is the destination identifier that is supported by the Connector. + string key = 1; + + // The destinations for the key. + repeated Destination destinations = 2; +} + +message Destination { + oneof destination { + // PSC service attachments. + // Format: projects/*/regions/*/serviceAttachments/* + string service_attachment = 1; + + // For publicly routable host. + string host = 2; + } + + // The port is the target port number that is accepted by the destination. + int32 port = 3; +} diff --git a/packages/google-cloud-connectors/protos/google/cloud/connectors/v1/provider.proto b/packages/google-cloud-connectors/protos/google/cloud/connectors/v1/provider.proto new file mode 100644 index 00000000000..6f908a45614 --- /dev/null +++ b/packages/google-cloud-connectors/protos/google/cloud/connectors/v1/provider.proto @@ -0,0 +1,115 @@ +// Copyright 2023 Google LLC +// +// Licensed under the Apache License, Version 2.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.connectors.v1; + +import "google/api/field_behavior.proto"; +import "google/api/resource.proto"; +import "google/cloud/connectors/v1/common.proto"; +import "google/protobuf/timestamp.proto"; + +option go_package = "cloud.google.com/go/connectors/apiv1/connectorspb;connectorspb"; +option java_multiple_files = true; +option java_outer_classname = "ProviderProto"; +option java_package = "com.google.cloud.connectors.v1"; + +// Provider indicates the owner who provides the connectors. +message Provider { + option (google.api.resource) = { + type: "connectors.googleapis.com/Provider" + pattern: "projects/{project}/locations/{location}/providers/{provider}" + }; + + // Output only. Resource name of the Provider. + // Format: projects/{project}/locations/{location}/providers/{provider} + // Only global location is supported for Provider resource. + string name = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Created time. + google.protobuf.Timestamp create_time = 2 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Updated time. + google.protobuf.Timestamp update_time = 3 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Resource labels to represent user-provided metadata. + // Refer to cloud documentation on labels for more details. + // https://cloud.google.com/compute/docs/labeling-resources + map labels = 4 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Link to documentation page. + string documentation_uri = 6 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Link to external page. + string external_uri = 7 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Description of the resource. + string description = 8 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Cloud storage location of icons etc consumed by UI. + string web_assets_location = 9 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Display name. + string display_name = 10 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Flag to mark the version indicating the launch stage. + LaunchStage launch_stage = 11 [(google.api.field_behavior) = OUTPUT_ONLY]; +} + +// Request message for Connectors.GetProvider. +message GetProviderRequest { + // Required. Resource name of the form: + // `projects/*/locations/*/providers/*` + // Only global location is supported for Provider resource. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "connectors.googleapis.com/Provider" + } + ]; +} + +// Request message for Connectors.ListProviders. +message ListProvidersRequest { + // Required. Parent resource of the API, of the form: + // `projects/*/locations/*` + // Only global location is supported for Provider resource. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "connectors.googleapis.com/Provider" + } + ]; + + // Page size. + int32 page_size = 2; + + // Page token. + string page_token = 3; +} + +// Response message for Connectors.ListProviders. +message ListProvidersResponse { + // A list of providers. + repeated Provider providers = 1; + + // Next page token. + string next_page_token = 2; + + // Locations that could not be reached. + repeated string unreachable = 3; +} diff --git a/packages/google-cloud-connectors/protos/google/cloud/connectors/v1/runtime.proto b/packages/google-cloud-connectors/protos/google/cloud/connectors/v1/runtime.proto new file mode 100644 index 00000000000..80408246223 --- /dev/null +++ b/packages/google-cloud-connectors/protos/google/cloud/connectors/v1/runtime.proto @@ -0,0 +1,110 @@ +// Copyright 2023 Google LLC +// +// Licensed under the Apache License, Version 2.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.connectors.v1; + +import "google/api/field_behavior.proto"; +import "google/api/resource.proto"; + +option go_package = "cloud.google.com/go/connectors/apiv1/connectorspb;connectorspb"; +option java_multiple_files = true; +option java_outer_classname = "RuntimeProto"; +option java_package = "com.google.cloud.connectors.v1"; + +// Request message for Connectors.GetRuntimeConfig. +message GetRuntimeConfigRequest { + // Required. Resource name of the form: + // `projects/*/locations/*/runtimeConfig` + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "connectors.googleapis.com/RuntimeConfig" + } + ]; +} + +// RuntimeConfig is the singleton resource of each location. +// It includes generic resource configs consumed by control plane and runtime +// plane like: pub/sub topic/subscription resource name, Cloud Storage location +// storing schema etc. +message RuntimeConfig { + option (google.api.resource) = { + type: "connectors.googleapis.com/RuntimeConfig" + pattern: "projects/{project}/locations/{location}/runtimeConfig" + }; + + // State of the location. + enum State { + // STATE_UNSPECIFIED. + STATE_UNSPECIFIED = 0; + + // INACTIVE. + INACTIVE = 1 [deprecated = true]; + + // ACTIVATING. + ACTIVATING = 2 [deprecated = true]; + + // ACTIVE. + ACTIVE = 3; + + // CREATING. + CREATING = 4; + + // DELETING. + DELETING = 5; + + // UPDATING. + UPDATING = 6; + } + + // Output only. location_id of the runtime location. E.g. "us-west1". + string location_id = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Pub/Sub topic for connd to send message. + // E.g. projects/{project-id}/topics/{topic-id} + string connd_topic = 2 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Pub/Sub subscription for connd to receive message. + // E.g. projects/{project-id}/subscriptions/{topic-id} + string connd_subscription = 3 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Pub/Sub topic for control plne to send message. + // communication. + // E.g. projects/{project-id}/topics/{topic-id} + string control_plane_topic = 4 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Pub/Sub subscription for control plane to receive message. + // E.g. projects/{project-id}/subscriptions/{topic-id} + string control_plane_subscription = 5 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The endpoint of the connectors runtime ingress. + string runtime_endpoint = 6 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The state of the location. + State state = 7 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The Cloud Storage bucket that stores connector's schema + // reports. + string schema_gcs_bucket = 8 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The name of the Service Directory service name. + string service_directory = 9 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Name of the runtimeConfig resource. + // Format: projects/{project}/locations/{location}/runtimeConfig + string name = 11 [(google.api.field_behavior) = OUTPUT_ONLY]; +} diff --git a/packages/google-cloud-connectors/protos/google/cloud/connectors/v1/settings.proto b/packages/google-cloud-connectors/protos/google/cloud/connectors/v1/settings.proto new file mode 100644 index 00000000000..31879187d72 --- /dev/null +++ b/packages/google-cloud-connectors/protos/google/cloud/connectors/v1/settings.proto @@ -0,0 +1,54 @@ +// Copyright 2023 Google LLC +// +// Licensed under the Apache License, Version 2.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.connectors.v1; + +import "google/api/field_behavior.proto"; +import "google/api/resource.proto"; + +option go_package = "cloud.google.com/go/connectors/apiv1/connectorspb;connectorspb"; +option java_multiple_files = true; +option java_outer_classname = "SettingsProto"; +option java_package = "com.google.cloud.connectors.v1"; + +// Request for [GetGlobalSettingsRequest]. +message GetGlobalSettingsRequest { + // Required. The resource name of the Settings. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "connectors.googleapis.com/Settings" + } + ]; +} + +// Global Settings details. +message Settings { + option (google.api.resource) = { + type: "connectors.googleapis.com/Settings" + pattern: "projects/{project}/locations/global/settings" + }; + + // Output only. Resource name of the Connection. + // Format: projects/{project}/locations/global/settings} + string name = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Optional. Flag indicates whether vpc-sc is enabled. + bool vpcsc = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Output only. Flag indicates if user is in PayG model + bool payg = 3 [(google.api.field_behavior) = OUTPUT_ONLY]; +} diff --git a/packages/google-cloud-connectors/protos/google/cloud/connectors/v1/ssl_config.proto b/packages/google-cloud-connectors/protos/google/cloud/connectors/v1/ssl_config.proto new file mode 100644 index 00000000000..cc4ae370701 --- /dev/null +++ b/packages/google-cloud-connectors/protos/google/cloud/connectors/v1/ssl_config.proto @@ -0,0 +1,109 @@ +// Copyright 2023 Google LLC +// +// Licensed under the Apache License, Version 2.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.connectors.v1; + +import "google/cloud/connectors/v1/common.proto"; + +option go_package = "cloud.google.com/go/connectors/apiv1/connectorspb;connectorspb"; +option java_multiple_files = true; +option java_outer_classname = "SslConfigProto"; +option java_package = "com.google.cloud.connectors.v1"; + +// Ssl config details of a connector version +message SslConfigTemplate { + // Controls the ssl type for the given connector version + SslType ssl_type = 1; + + // Boolean for determining if the connector version mandates TLS. + bool is_tls_mandatory = 2; + + // List of supported Server Cert Types + repeated CertType server_cert_type = 3; + + // List of supported Client Cert Types + repeated CertType client_cert_type = 4; + + // Any additional fields that need to be rendered + repeated ConfigVariableTemplate additional_variables = 5; +} + +// SSL Configuration of a connection +message SslConfig { + // Enum for Ttust Model + enum TrustModel { + // Public Trust Model. Takes the Default Java trust store. + PUBLIC = 0; + + // Private Trust Model. Takes custom/private trust store. + PRIVATE = 1; + + // Insecure Trust Model. Accept all certificates. + INSECURE = 2; + } + + // Controls the ssl type for the given connector version. + SslType type = 1; + + // Trust Model of the SSL connection + TrustModel trust_model = 2; + + // Private Server Certificate. Needs to be specified if trust model is + // `PRIVATE`. + Secret private_server_certificate = 3; + + // Client Certificate + Secret client_certificate = 4; + + // Client Private Key + Secret client_private_key = 5; + + // Secret containing the passphrase protecting the Client Private Key + Secret client_private_key_pass = 6; + + // Type of Server Cert (PEM/JKS/.. etc.) + CertType server_cert_type = 7; + + // Type of Client Cert (PEM/JKS/.. etc.) + CertType client_cert_type = 8; + + // Bool for enabling SSL + bool use_ssl = 9; + + // Additional SSL related field values + repeated ConfigVariable additional_variables = 10; +} + +// Enum for controlling the SSL Type (TLS/MTLS) +enum SslType { + // No SSL configuration required. + SSL_TYPE_UNSPECIFIED = 0; + + // TLS Handshake + TLS = 1; + + // mutual TLS (MTLS) Handshake + MTLS = 2; +} + +// Enum for Cert Types +enum CertType { + // Cert type unspecified. + CERT_TYPE_UNSPECIFIED = 0; + + // Privacy Enhanced Mail (PEM) Type + PEM = 1; +} diff --git a/packages/google-cloud-connectors/protos/protos.d.ts b/packages/google-cloud-connectors/protos/protos.d.ts new file mode 100644 index 00000000000..af4d4ceff65 --- /dev/null +++ b/packages/google-cloud-connectors/protos/protos.d.ts @@ -0,0 +1,15119 @@ +// Copyright 2023 Google LLC +// +// Licensed under the Apache License, Version 2.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 connectors. */ + namespace connectors { + + /** Namespace v1. */ + namespace v1 { + + /** Properties of an AuthConfig. */ + interface IAuthConfig { + + /** AuthConfig authType */ + authType?: (google.cloud.connectors.v1.AuthType|keyof typeof google.cloud.connectors.v1.AuthType|null); + + /** AuthConfig userPassword */ + userPassword?: (google.cloud.connectors.v1.AuthConfig.IUserPassword|null); + + /** AuthConfig oauth2JwtBearer */ + oauth2JwtBearer?: (google.cloud.connectors.v1.AuthConfig.IOauth2JwtBearer|null); + + /** AuthConfig oauth2ClientCredentials */ + oauth2ClientCredentials?: (google.cloud.connectors.v1.AuthConfig.IOauth2ClientCredentials|null); + + /** AuthConfig sshPublicKey */ + sshPublicKey?: (google.cloud.connectors.v1.AuthConfig.ISshPublicKey|null); + + /** AuthConfig additionalVariables */ + additionalVariables?: (google.cloud.connectors.v1.IConfigVariable[]|null); + } + + /** Represents an AuthConfig. */ + class AuthConfig implements IAuthConfig { + + /** + * Constructs a new AuthConfig. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.connectors.v1.IAuthConfig); + + /** AuthConfig authType. */ + public authType: (google.cloud.connectors.v1.AuthType|keyof typeof google.cloud.connectors.v1.AuthType); + + /** AuthConfig userPassword. */ + public userPassword?: (google.cloud.connectors.v1.AuthConfig.IUserPassword|null); + + /** AuthConfig oauth2JwtBearer. */ + public oauth2JwtBearer?: (google.cloud.connectors.v1.AuthConfig.IOauth2JwtBearer|null); + + /** AuthConfig oauth2ClientCredentials. */ + public oauth2ClientCredentials?: (google.cloud.connectors.v1.AuthConfig.IOauth2ClientCredentials|null); + + /** AuthConfig sshPublicKey. */ + public sshPublicKey?: (google.cloud.connectors.v1.AuthConfig.ISshPublicKey|null); + + /** AuthConfig additionalVariables. */ + public additionalVariables: google.cloud.connectors.v1.IConfigVariable[]; + + /** AuthConfig type. */ + public type?: ("userPassword"|"oauth2JwtBearer"|"oauth2ClientCredentials"|"sshPublicKey"); + + /** + * Creates a new AuthConfig instance using the specified properties. + * @param [properties] Properties to set + * @returns AuthConfig instance + */ + public static create(properties?: google.cloud.connectors.v1.IAuthConfig): google.cloud.connectors.v1.AuthConfig; + + /** + * Encodes the specified AuthConfig message. Does not implicitly {@link google.cloud.connectors.v1.AuthConfig.verify|verify} messages. + * @param message AuthConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.connectors.v1.IAuthConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified AuthConfig message, length delimited. Does not implicitly {@link google.cloud.connectors.v1.AuthConfig.verify|verify} messages. + * @param message AuthConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.connectors.v1.IAuthConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an AuthConfig message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns AuthConfig + * @throws {Error} If the payload is not 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.connectors.v1.AuthConfig; + + /** + * Decodes an AuthConfig message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns AuthConfig + * @throws {Error} If the payload 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.connectors.v1.AuthConfig; + + /** + * Verifies an AuthConfig message. + * @param message Plain 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 AuthConfig message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns AuthConfig + */ + public static fromObject(object: { [k: string]: any }): google.cloud.connectors.v1.AuthConfig; + + /** + * Creates a plain object from an AuthConfig message. Also converts values to other types if specified. + * @param message AuthConfig + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.connectors.v1.AuthConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this AuthConfig to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for AuthConfig + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace AuthConfig { + + /** Properties of a UserPassword. */ + interface IUserPassword { + + /** UserPassword username */ + username?: (string|null); + + /** UserPassword password */ + password?: (google.cloud.connectors.v1.ISecret|null); + } + + /** Represents a UserPassword. */ + class UserPassword implements IUserPassword { + + /** + * Constructs a new UserPassword. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.connectors.v1.AuthConfig.IUserPassword); + + /** UserPassword username. */ + public username: string; + + /** UserPassword password. */ + public password?: (google.cloud.connectors.v1.ISecret|null); + + /** + * Creates a new UserPassword instance using the specified properties. + * @param [properties] Properties to set + * @returns UserPassword instance + */ + public static create(properties?: google.cloud.connectors.v1.AuthConfig.IUserPassword): google.cloud.connectors.v1.AuthConfig.UserPassword; + + /** + * Encodes the specified UserPassword message. Does not implicitly {@link google.cloud.connectors.v1.AuthConfig.UserPassword.verify|verify} messages. + * @param message UserPassword message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.connectors.v1.AuthConfig.IUserPassword, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified UserPassword message, length delimited. Does not implicitly {@link google.cloud.connectors.v1.AuthConfig.UserPassword.verify|verify} messages. + * @param message UserPassword message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.connectors.v1.AuthConfig.IUserPassword, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a UserPassword message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns UserPassword + * @throws {Error} If the payload is not 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.connectors.v1.AuthConfig.UserPassword; + + /** + * Decodes a UserPassword message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns UserPassword + * @throws {Error} If the payload 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.connectors.v1.AuthConfig.UserPassword; + + /** + * Verifies a UserPassword message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a UserPassword message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns UserPassword + */ + public static fromObject(object: { [k: string]: any }): google.cloud.connectors.v1.AuthConfig.UserPassword; + + /** + * Creates a plain object from a UserPassword message. Also converts values to other types if specified. + * @param message UserPassword + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.connectors.v1.AuthConfig.UserPassword, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this UserPassword to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for UserPassword + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an Oauth2JwtBearer. */ + interface IOauth2JwtBearer { + + /** Oauth2JwtBearer clientKey */ + clientKey?: (google.cloud.connectors.v1.ISecret|null); + + /** Oauth2JwtBearer jwtClaims */ + jwtClaims?: (google.cloud.connectors.v1.AuthConfig.Oauth2JwtBearer.IJwtClaims|null); + } + + /** Represents an Oauth2JwtBearer. */ + class Oauth2JwtBearer implements IOauth2JwtBearer { + + /** + * Constructs a new Oauth2JwtBearer. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.connectors.v1.AuthConfig.IOauth2JwtBearer); + + /** Oauth2JwtBearer clientKey. */ + public clientKey?: (google.cloud.connectors.v1.ISecret|null); + + /** Oauth2JwtBearer jwtClaims. */ + public jwtClaims?: (google.cloud.connectors.v1.AuthConfig.Oauth2JwtBearer.IJwtClaims|null); + + /** + * Creates a new Oauth2JwtBearer instance using the specified properties. + * @param [properties] Properties to set + * @returns Oauth2JwtBearer instance + */ + public static create(properties?: google.cloud.connectors.v1.AuthConfig.IOauth2JwtBearer): google.cloud.connectors.v1.AuthConfig.Oauth2JwtBearer; + + /** + * Encodes the specified Oauth2JwtBearer message. Does not implicitly {@link google.cloud.connectors.v1.AuthConfig.Oauth2JwtBearer.verify|verify} messages. + * @param message Oauth2JwtBearer message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.connectors.v1.AuthConfig.IOauth2JwtBearer, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Oauth2JwtBearer message, length delimited. Does not implicitly {@link google.cloud.connectors.v1.AuthConfig.Oauth2JwtBearer.verify|verify} messages. + * @param message Oauth2JwtBearer message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.connectors.v1.AuthConfig.IOauth2JwtBearer, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an Oauth2JwtBearer message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Oauth2JwtBearer + * @throws {Error} If the payload is not 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.connectors.v1.AuthConfig.Oauth2JwtBearer; + + /** + * Decodes an Oauth2JwtBearer message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Oauth2JwtBearer + * @throws {Error} If the payload 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.connectors.v1.AuthConfig.Oauth2JwtBearer; + + /** + * Verifies an Oauth2JwtBearer message. + * @param message Plain 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 Oauth2JwtBearer message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Oauth2JwtBearer + */ + public static fromObject(object: { [k: string]: any }): google.cloud.connectors.v1.AuthConfig.Oauth2JwtBearer; + + /** + * Creates a plain object from an Oauth2JwtBearer message. Also converts values to other types if specified. + * @param message Oauth2JwtBearer + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.connectors.v1.AuthConfig.Oauth2JwtBearer, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Oauth2JwtBearer to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Oauth2JwtBearer + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace Oauth2JwtBearer { + + /** Properties of a JwtClaims. */ + interface IJwtClaims { + + /** JwtClaims issuer */ + issuer?: (string|null); + + /** JwtClaims subject */ + subject?: (string|null); + + /** JwtClaims audience */ + audience?: (string|null); + } + + /** Represents a JwtClaims. */ + class JwtClaims implements IJwtClaims { + + /** + * Constructs a new JwtClaims. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.connectors.v1.AuthConfig.Oauth2JwtBearer.IJwtClaims); + + /** JwtClaims issuer. */ + public issuer: string; + + /** JwtClaims subject. */ + public subject: string; + + /** JwtClaims audience. */ + public audience: string; + + /** + * Creates a new JwtClaims instance using the specified properties. + * @param [properties] Properties to set + * @returns JwtClaims instance + */ + public static create(properties?: google.cloud.connectors.v1.AuthConfig.Oauth2JwtBearer.IJwtClaims): google.cloud.connectors.v1.AuthConfig.Oauth2JwtBearer.JwtClaims; + + /** + * Encodes the specified JwtClaims message. Does not implicitly {@link google.cloud.connectors.v1.AuthConfig.Oauth2JwtBearer.JwtClaims.verify|verify} messages. + * @param message JwtClaims message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.connectors.v1.AuthConfig.Oauth2JwtBearer.IJwtClaims, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified JwtClaims message, length delimited. Does not implicitly {@link google.cloud.connectors.v1.AuthConfig.Oauth2JwtBearer.JwtClaims.verify|verify} messages. + * @param message JwtClaims message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.connectors.v1.AuthConfig.Oauth2JwtBearer.IJwtClaims, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a JwtClaims message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns JwtClaims + * @throws {Error} If the payload is not 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.connectors.v1.AuthConfig.Oauth2JwtBearer.JwtClaims; + + /** + * Decodes a JwtClaims message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns JwtClaims + * @throws {Error} If the payload 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.connectors.v1.AuthConfig.Oauth2JwtBearer.JwtClaims; + + /** + * Verifies a JwtClaims message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a JwtClaims message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns JwtClaims + */ + public static fromObject(object: { [k: string]: any }): google.cloud.connectors.v1.AuthConfig.Oauth2JwtBearer.JwtClaims; + + /** + * Creates a plain object from a JwtClaims message. Also converts values to other types if specified. + * @param message JwtClaims + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.connectors.v1.AuthConfig.Oauth2JwtBearer.JwtClaims, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this JwtClaims to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for JwtClaims + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Properties of an Oauth2ClientCredentials. */ + interface IOauth2ClientCredentials { + + /** Oauth2ClientCredentials clientId */ + clientId?: (string|null); + + /** Oauth2ClientCredentials clientSecret */ + clientSecret?: (google.cloud.connectors.v1.ISecret|null); + } + + /** Represents an Oauth2ClientCredentials. */ + class Oauth2ClientCredentials implements IOauth2ClientCredentials { + + /** + * Constructs a new Oauth2ClientCredentials. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.connectors.v1.AuthConfig.IOauth2ClientCredentials); + + /** Oauth2ClientCredentials clientId. */ + public clientId: string; + + /** Oauth2ClientCredentials clientSecret. */ + public clientSecret?: (google.cloud.connectors.v1.ISecret|null); + + /** + * Creates a new Oauth2ClientCredentials instance using the specified properties. + * @param [properties] Properties to set + * @returns Oauth2ClientCredentials instance + */ + public static create(properties?: google.cloud.connectors.v1.AuthConfig.IOauth2ClientCredentials): google.cloud.connectors.v1.AuthConfig.Oauth2ClientCredentials; + + /** + * Encodes the specified Oauth2ClientCredentials message. Does not implicitly {@link google.cloud.connectors.v1.AuthConfig.Oauth2ClientCredentials.verify|verify} messages. + * @param message Oauth2ClientCredentials message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.connectors.v1.AuthConfig.IOauth2ClientCredentials, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Oauth2ClientCredentials message, length delimited. Does not implicitly {@link google.cloud.connectors.v1.AuthConfig.Oauth2ClientCredentials.verify|verify} messages. + * @param message Oauth2ClientCredentials message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.connectors.v1.AuthConfig.IOauth2ClientCredentials, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an Oauth2ClientCredentials message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Oauth2ClientCredentials + * @throws {Error} If the payload is not 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.connectors.v1.AuthConfig.Oauth2ClientCredentials; + + /** + * Decodes an Oauth2ClientCredentials message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Oauth2ClientCredentials + * @throws {Error} If the payload 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.connectors.v1.AuthConfig.Oauth2ClientCredentials; + + /** + * Verifies an Oauth2ClientCredentials message. + * @param message Plain 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 Oauth2ClientCredentials message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Oauth2ClientCredentials + */ + public static fromObject(object: { [k: string]: any }): google.cloud.connectors.v1.AuthConfig.Oauth2ClientCredentials; + + /** + * Creates a plain object from an Oauth2ClientCredentials message. Also converts values to other types if specified. + * @param message Oauth2ClientCredentials + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.connectors.v1.AuthConfig.Oauth2ClientCredentials, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Oauth2ClientCredentials to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Oauth2ClientCredentials + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a SshPublicKey. */ + interface ISshPublicKey { + + /** SshPublicKey username */ + username?: (string|null); + + /** SshPublicKey sshClientCert */ + sshClientCert?: (google.cloud.connectors.v1.ISecret|null); + + /** SshPublicKey certType */ + certType?: (string|null); + + /** SshPublicKey sshClientCertPass */ + sshClientCertPass?: (google.cloud.connectors.v1.ISecret|null); + } + + /** Represents a SshPublicKey. */ + class SshPublicKey implements ISshPublicKey { + + /** + * Constructs a new SshPublicKey. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.connectors.v1.AuthConfig.ISshPublicKey); + + /** SshPublicKey username. */ + public username: string; + + /** SshPublicKey sshClientCert. */ + public sshClientCert?: (google.cloud.connectors.v1.ISecret|null); + + /** SshPublicKey certType. */ + public certType: string; + + /** SshPublicKey sshClientCertPass. */ + public sshClientCertPass?: (google.cloud.connectors.v1.ISecret|null); + + /** + * Creates a new SshPublicKey instance using the specified properties. + * @param [properties] Properties to set + * @returns SshPublicKey instance + */ + public static create(properties?: google.cloud.connectors.v1.AuthConfig.ISshPublicKey): google.cloud.connectors.v1.AuthConfig.SshPublicKey; + + /** + * Encodes the specified SshPublicKey message. Does not implicitly {@link google.cloud.connectors.v1.AuthConfig.SshPublicKey.verify|verify} messages. + * @param message SshPublicKey message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.connectors.v1.AuthConfig.ISshPublicKey, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified SshPublicKey message, length delimited. Does not implicitly {@link google.cloud.connectors.v1.AuthConfig.SshPublicKey.verify|verify} messages. + * @param message SshPublicKey message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.connectors.v1.AuthConfig.ISshPublicKey, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SshPublicKey message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns SshPublicKey + * @throws {Error} If the payload is not 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.connectors.v1.AuthConfig.SshPublicKey; + + /** + * Decodes a SshPublicKey message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns SshPublicKey + * @throws {Error} If the payload 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.connectors.v1.AuthConfig.SshPublicKey; + + /** + * Verifies a SshPublicKey message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a SshPublicKey message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns SshPublicKey + */ + public static fromObject(object: { [k: string]: any }): google.cloud.connectors.v1.AuthConfig.SshPublicKey; + + /** + * Creates a plain object from a SshPublicKey message. Also converts values to other types if specified. + * @param message SshPublicKey + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.connectors.v1.AuthConfig.SshPublicKey, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this SshPublicKey to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for SshPublicKey + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Properties of an AuthConfigTemplate. */ + interface IAuthConfigTemplate { + + /** AuthConfigTemplate authType */ + authType?: (google.cloud.connectors.v1.AuthType|keyof typeof google.cloud.connectors.v1.AuthType|null); + + /** AuthConfigTemplate configVariableTemplates */ + configVariableTemplates?: (google.cloud.connectors.v1.IConfigVariableTemplate[]|null); + + /** AuthConfigTemplate displayName */ + displayName?: (string|null); + + /** AuthConfigTemplate description */ + description?: (string|null); + } + + /** Represents an AuthConfigTemplate. */ + class AuthConfigTemplate implements IAuthConfigTemplate { + + /** + * Constructs a new AuthConfigTemplate. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.connectors.v1.IAuthConfigTemplate); + + /** AuthConfigTemplate authType. */ + public authType: (google.cloud.connectors.v1.AuthType|keyof typeof google.cloud.connectors.v1.AuthType); + + /** AuthConfigTemplate configVariableTemplates. */ + public configVariableTemplates: google.cloud.connectors.v1.IConfigVariableTemplate[]; + + /** AuthConfigTemplate displayName. */ + public displayName: string; + + /** AuthConfigTemplate description. */ + public description: string; + + /** + * Creates a new AuthConfigTemplate instance using the specified properties. + * @param [properties] Properties to set + * @returns AuthConfigTemplate instance + */ + public static create(properties?: google.cloud.connectors.v1.IAuthConfigTemplate): google.cloud.connectors.v1.AuthConfigTemplate; + + /** + * Encodes the specified AuthConfigTemplate message. Does not implicitly {@link google.cloud.connectors.v1.AuthConfigTemplate.verify|verify} messages. + * @param message AuthConfigTemplate message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.connectors.v1.IAuthConfigTemplate, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified AuthConfigTemplate message, length delimited. Does not implicitly {@link google.cloud.connectors.v1.AuthConfigTemplate.verify|verify} messages. + * @param message AuthConfigTemplate message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.connectors.v1.IAuthConfigTemplate, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an AuthConfigTemplate message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns AuthConfigTemplate + * @throws {Error} If the payload is not 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.connectors.v1.AuthConfigTemplate; + + /** + * Decodes an AuthConfigTemplate message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns AuthConfigTemplate + * @throws {Error} If the payload 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.connectors.v1.AuthConfigTemplate; + + /** + * Verifies an AuthConfigTemplate message. + * @param message Plain 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 AuthConfigTemplate message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns AuthConfigTemplate + */ + public static fromObject(object: { [k: string]: any }): google.cloud.connectors.v1.AuthConfigTemplate; + + /** + * Creates a plain object from an AuthConfigTemplate message. Also converts values to other types if specified. + * @param message AuthConfigTemplate + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.connectors.v1.AuthConfigTemplate, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this AuthConfigTemplate to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for AuthConfigTemplate + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** AuthType enum. */ + enum AuthType { + AUTH_TYPE_UNSPECIFIED = 0, + USER_PASSWORD = 1, + OAUTH2_JWT_BEARER = 2, + OAUTH2_CLIENT_CREDENTIALS = 3, + SSH_PUBLIC_KEY = 4, + OAUTH2_AUTH_CODE_FLOW = 5 + } + + /** Properties of an OperationMetadata. */ + interface IOperationMetadata { + + /** OperationMetadata createTime */ + createTime?: (google.protobuf.ITimestamp|null); + + /** OperationMetadata endTime */ + endTime?: (google.protobuf.ITimestamp|null); + + /** OperationMetadata target */ + target?: (string|null); + + /** OperationMetadata verb */ + verb?: (string|null); + + /** OperationMetadata statusMessage */ + statusMessage?: (string|null); + + /** OperationMetadata requestedCancellation */ + requestedCancellation?: (boolean|null); + + /** OperationMetadata apiVersion */ + apiVersion?: (string|null); + } + + /** Represents an OperationMetadata. */ + class OperationMetadata implements IOperationMetadata { + + /** + * Constructs a new OperationMetadata. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.connectors.v1.IOperationMetadata); + + /** OperationMetadata createTime. */ + public createTime?: (google.protobuf.ITimestamp|null); + + /** OperationMetadata endTime. */ + public endTime?: (google.protobuf.ITimestamp|null); + + /** OperationMetadata target. */ + public target: string; + + /** OperationMetadata verb. */ + public verb: string; + + /** OperationMetadata statusMessage. */ + public statusMessage: string; + + /** OperationMetadata requestedCancellation. */ + public requestedCancellation: boolean; + + /** OperationMetadata apiVersion. */ + public apiVersion: string; + + /** + * Creates a new OperationMetadata instance using the specified properties. + * @param [properties] Properties to set + * @returns OperationMetadata instance + */ + public static create(properties?: google.cloud.connectors.v1.IOperationMetadata): google.cloud.connectors.v1.OperationMetadata; + + /** + * Encodes the specified OperationMetadata message. Does not implicitly {@link google.cloud.connectors.v1.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.connectors.v1.IOperationMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified OperationMetadata message, length delimited. Does not implicitly {@link google.cloud.connectors.v1.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.connectors.v1.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.connectors.v1.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.connectors.v1.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.connectors.v1.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.connectors.v1.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 ConfigVariableTemplate. */ + interface IConfigVariableTemplate { + + /** ConfigVariableTemplate key */ + key?: (string|null); + + /** ConfigVariableTemplate valueType */ + valueType?: (google.cloud.connectors.v1.ConfigVariableTemplate.ValueType|keyof typeof google.cloud.connectors.v1.ConfigVariableTemplate.ValueType|null); + + /** ConfigVariableTemplate displayName */ + displayName?: (string|null); + + /** ConfigVariableTemplate description */ + description?: (string|null); + + /** ConfigVariableTemplate validationRegex */ + validationRegex?: (string|null); + + /** ConfigVariableTemplate required */ + required?: (boolean|null); + + /** ConfigVariableTemplate roleGrant */ + roleGrant?: (google.cloud.connectors.v1.IRoleGrant|null); + + /** ConfigVariableTemplate enumOptions */ + enumOptions?: (google.cloud.connectors.v1.IEnumOption[]|null); + + /** ConfigVariableTemplate authorizationCodeLink */ + authorizationCodeLink?: (google.cloud.connectors.v1.IAuthorizationCodeLink|null); + + /** ConfigVariableTemplate state */ + state?: (google.cloud.connectors.v1.ConfigVariableTemplate.State|keyof typeof google.cloud.connectors.v1.ConfigVariableTemplate.State|null); + + /** ConfigVariableTemplate isAdvanced */ + isAdvanced?: (boolean|null); + } + + /** Represents a ConfigVariableTemplate. */ + class ConfigVariableTemplate implements IConfigVariableTemplate { + + /** + * Constructs a new ConfigVariableTemplate. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.connectors.v1.IConfigVariableTemplate); + + /** ConfigVariableTemplate key. */ + public key: string; + + /** ConfigVariableTemplate valueType. */ + public valueType: (google.cloud.connectors.v1.ConfigVariableTemplate.ValueType|keyof typeof google.cloud.connectors.v1.ConfigVariableTemplate.ValueType); + + /** ConfigVariableTemplate displayName. */ + public displayName: string; + + /** ConfigVariableTemplate description. */ + public description: string; + + /** ConfigVariableTemplate validationRegex. */ + public validationRegex: string; + + /** ConfigVariableTemplate required. */ + public required: boolean; + + /** ConfigVariableTemplate roleGrant. */ + public roleGrant?: (google.cloud.connectors.v1.IRoleGrant|null); + + /** ConfigVariableTemplate enumOptions. */ + public enumOptions: google.cloud.connectors.v1.IEnumOption[]; + + /** ConfigVariableTemplate authorizationCodeLink. */ + public authorizationCodeLink?: (google.cloud.connectors.v1.IAuthorizationCodeLink|null); + + /** ConfigVariableTemplate state. */ + public state: (google.cloud.connectors.v1.ConfigVariableTemplate.State|keyof typeof google.cloud.connectors.v1.ConfigVariableTemplate.State); + + /** ConfigVariableTemplate isAdvanced. */ + public isAdvanced: boolean; + + /** + * Creates a new ConfigVariableTemplate instance using the specified properties. + * @param [properties] Properties to set + * @returns ConfigVariableTemplate instance + */ + public static create(properties?: google.cloud.connectors.v1.IConfigVariableTemplate): google.cloud.connectors.v1.ConfigVariableTemplate; + + /** + * Encodes the specified ConfigVariableTemplate message. Does not implicitly {@link google.cloud.connectors.v1.ConfigVariableTemplate.verify|verify} messages. + * @param message ConfigVariableTemplate message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.connectors.v1.IConfigVariableTemplate, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ConfigVariableTemplate message, length delimited. Does not implicitly {@link google.cloud.connectors.v1.ConfigVariableTemplate.verify|verify} messages. + * @param message ConfigVariableTemplate message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.connectors.v1.IConfigVariableTemplate, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ConfigVariableTemplate message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ConfigVariableTemplate + * @throws {Error} If the payload is not 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.connectors.v1.ConfigVariableTemplate; + + /** + * Decodes a ConfigVariableTemplate message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ConfigVariableTemplate + * @throws {Error} If the payload 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.connectors.v1.ConfigVariableTemplate; + + /** + * Verifies a ConfigVariableTemplate message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ConfigVariableTemplate message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ConfigVariableTemplate + */ + public static fromObject(object: { [k: string]: any }): google.cloud.connectors.v1.ConfigVariableTemplate; + + /** + * Creates a plain object from a ConfigVariableTemplate message. Also converts values to other types if specified. + * @param message ConfigVariableTemplate + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.connectors.v1.ConfigVariableTemplate, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ConfigVariableTemplate to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ConfigVariableTemplate + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace ConfigVariableTemplate { + + /** ValueType enum. */ + enum ValueType { + VALUE_TYPE_UNSPECIFIED = 0, + STRING = 1, + INT = 2, + BOOL = 3, + SECRET = 4, + ENUM = 5, + AUTHORIZATION_CODE = 6 + } + + /** State enum. */ + enum State { + STATE_UNSPECIFIED = 0, + ACTIVE = 1, + DEPRECATED = 2 + } + } + + /** Properties of a Secret. */ + interface ISecret { + + /** Secret secretVersion */ + secretVersion?: (string|null); + } + + /** Represents a Secret. */ + class Secret implements ISecret { + + /** + * Constructs a new Secret. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.connectors.v1.ISecret); + + /** Secret secretVersion. */ + public secretVersion: string; + + /** + * Creates a new Secret instance using the specified properties. + * @param [properties] Properties to set + * @returns Secret instance + */ + public static create(properties?: google.cloud.connectors.v1.ISecret): google.cloud.connectors.v1.Secret; + + /** + * Encodes the specified Secret message. Does not implicitly {@link google.cloud.connectors.v1.Secret.verify|verify} messages. + * @param message Secret message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.connectors.v1.ISecret, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Secret message, length delimited. Does not implicitly {@link google.cloud.connectors.v1.Secret.verify|verify} messages. + * @param message Secret message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.connectors.v1.ISecret, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Secret message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Secret + * @throws {Error} If the payload is not 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.connectors.v1.Secret; + + /** + * Decodes a Secret message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Secret + * @throws {Error} If the payload 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.connectors.v1.Secret; + + /** + * Verifies a Secret message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Secret message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Secret + */ + public static fromObject(object: { [k: string]: any }): google.cloud.connectors.v1.Secret; + + /** + * Creates a plain object from a Secret message. Also converts values to other types if specified. + * @param message Secret + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.connectors.v1.Secret, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Secret to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Secret + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an EnumOption. */ + interface IEnumOption { + + /** EnumOption id */ + id?: (string|null); + + /** EnumOption displayName */ + displayName?: (string|null); + } + + /** Represents an EnumOption. */ + class EnumOption implements IEnumOption { + + /** + * Constructs a new EnumOption. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.connectors.v1.IEnumOption); + + /** EnumOption id. */ + public id: string; + + /** EnumOption displayName. */ + public displayName: string; + + /** + * Creates a new EnumOption instance using the specified properties. + * @param [properties] Properties to set + * @returns EnumOption instance + */ + public static create(properties?: google.cloud.connectors.v1.IEnumOption): google.cloud.connectors.v1.EnumOption; + + /** + * Encodes the specified EnumOption message. Does not implicitly {@link google.cloud.connectors.v1.EnumOption.verify|verify} messages. + * @param message EnumOption message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.connectors.v1.IEnumOption, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified EnumOption message, length delimited. Does not implicitly {@link google.cloud.connectors.v1.EnumOption.verify|verify} messages. + * @param message EnumOption message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.connectors.v1.IEnumOption, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an EnumOption message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns EnumOption + * @throws {Error} If the payload is not 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.connectors.v1.EnumOption; + + /** + * Decodes an EnumOption message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns EnumOption + * @throws {Error} If the payload 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.connectors.v1.EnumOption; + + /** + * Verifies an EnumOption message. + * @param message Plain 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 EnumOption message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns EnumOption + */ + public static fromObject(object: { [k: string]: any }): google.cloud.connectors.v1.EnumOption; + + /** + * Creates a plain object from an EnumOption message. Also converts values to other types if specified. + * @param message EnumOption + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.connectors.v1.EnumOption, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this EnumOption to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for EnumOption + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ConfigVariable. */ + interface IConfigVariable { + + /** ConfigVariable key */ + key?: (string|null); + + /** ConfigVariable intValue */ + intValue?: (number|Long|string|null); + + /** ConfigVariable boolValue */ + boolValue?: (boolean|null); + + /** ConfigVariable stringValue */ + stringValue?: (string|null); + + /** ConfigVariable secretValue */ + secretValue?: (google.cloud.connectors.v1.ISecret|null); + } + + /** Represents a ConfigVariable. */ + class ConfigVariable implements IConfigVariable { + + /** + * Constructs a new ConfigVariable. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.connectors.v1.IConfigVariable); + + /** ConfigVariable key. */ + public key: string; + + /** ConfigVariable intValue. */ + public intValue?: (number|Long|string|null); + + /** ConfigVariable boolValue. */ + public boolValue?: (boolean|null); + + /** ConfigVariable stringValue. */ + public stringValue?: (string|null); + + /** ConfigVariable secretValue. */ + public secretValue?: (google.cloud.connectors.v1.ISecret|null); + + /** ConfigVariable value. */ + public value?: ("intValue"|"boolValue"|"stringValue"|"secretValue"); + + /** + * Creates a new ConfigVariable instance using the specified properties. + * @param [properties] Properties to set + * @returns ConfigVariable instance + */ + public static create(properties?: google.cloud.connectors.v1.IConfigVariable): google.cloud.connectors.v1.ConfigVariable; + + /** + * Encodes the specified ConfigVariable message. Does not implicitly {@link google.cloud.connectors.v1.ConfigVariable.verify|verify} messages. + * @param message ConfigVariable message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.connectors.v1.IConfigVariable, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ConfigVariable message, length delimited. Does not implicitly {@link google.cloud.connectors.v1.ConfigVariable.verify|verify} messages. + * @param message ConfigVariable message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.connectors.v1.IConfigVariable, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ConfigVariable message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ConfigVariable + * @throws {Error} If the payload is not 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.connectors.v1.ConfigVariable; + + /** + * Decodes a ConfigVariable message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ConfigVariable + * @throws {Error} If the payload 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.connectors.v1.ConfigVariable; + + /** + * Verifies a ConfigVariable message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ConfigVariable message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ConfigVariable + */ + public static fromObject(object: { [k: string]: any }): google.cloud.connectors.v1.ConfigVariable; + + /** + * Creates a plain object from a ConfigVariable message. Also converts values to other types if specified. + * @param message ConfigVariable + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.connectors.v1.ConfigVariable, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ConfigVariable to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ConfigVariable + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a RoleGrant. */ + interface IRoleGrant { + + /** RoleGrant principal */ + principal?: (google.cloud.connectors.v1.RoleGrant.Principal|keyof typeof google.cloud.connectors.v1.RoleGrant.Principal|null); + + /** RoleGrant roles */ + roles?: (string[]|null); + + /** RoleGrant resource */ + resource?: (google.cloud.connectors.v1.RoleGrant.IResource|null); + + /** RoleGrant helperTextTemplate */ + helperTextTemplate?: (string|null); + } + + /** Represents a RoleGrant. */ + class RoleGrant implements IRoleGrant { + + /** + * Constructs a new RoleGrant. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.connectors.v1.IRoleGrant); + + /** RoleGrant principal. */ + public principal: (google.cloud.connectors.v1.RoleGrant.Principal|keyof typeof google.cloud.connectors.v1.RoleGrant.Principal); + + /** RoleGrant roles. */ + public roles: string[]; + + /** RoleGrant resource. */ + public resource?: (google.cloud.connectors.v1.RoleGrant.IResource|null); + + /** RoleGrant helperTextTemplate. */ + public helperTextTemplate: string; + + /** + * Creates a new RoleGrant instance using the specified properties. + * @param [properties] Properties to set + * @returns RoleGrant instance + */ + public static create(properties?: google.cloud.connectors.v1.IRoleGrant): google.cloud.connectors.v1.RoleGrant; + + /** + * Encodes the specified RoleGrant message. Does not implicitly {@link google.cloud.connectors.v1.RoleGrant.verify|verify} messages. + * @param message RoleGrant message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.connectors.v1.IRoleGrant, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified RoleGrant message, length delimited. Does not implicitly {@link google.cloud.connectors.v1.RoleGrant.verify|verify} messages. + * @param message RoleGrant message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.connectors.v1.IRoleGrant, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a RoleGrant message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns RoleGrant + * @throws {Error} If the payload is not 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.connectors.v1.RoleGrant; + + /** + * Decodes a RoleGrant message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns RoleGrant + * @throws {Error} If the payload 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.connectors.v1.RoleGrant; + + /** + * Verifies a RoleGrant message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a RoleGrant message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns RoleGrant + */ + public static fromObject(object: { [k: string]: any }): google.cloud.connectors.v1.RoleGrant; + + /** + * Creates a plain object from a RoleGrant message. Also converts values to other types if specified. + * @param message RoleGrant + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.connectors.v1.RoleGrant, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this RoleGrant to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for RoleGrant + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace RoleGrant { + + /** Principal enum. */ + enum Principal { + PRINCIPAL_UNSPECIFIED = 0, + CONNECTOR_SA = 1 + } + + /** Properties of a Resource. */ + interface IResource { + + /** Resource type */ + type?: (google.cloud.connectors.v1.RoleGrant.Resource.Type|keyof typeof google.cloud.connectors.v1.RoleGrant.Resource.Type|null); + + /** Resource pathTemplate */ + pathTemplate?: (string|null); + } + + /** Represents a Resource. */ + class Resource implements IResource { + + /** + * Constructs a new Resource. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.connectors.v1.RoleGrant.IResource); + + /** Resource type. */ + public type: (google.cloud.connectors.v1.RoleGrant.Resource.Type|keyof typeof google.cloud.connectors.v1.RoleGrant.Resource.Type); + + /** Resource pathTemplate. */ + public pathTemplate: string; + + /** + * Creates a new Resource instance using the specified properties. + * @param [properties] Properties to set + * @returns Resource instance + */ + public static create(properties?: google.cloud.connectors.v1.RoleGrant.IResource): google.cloud.connectors.v1.RoleGrant.Resource; + + /** + * Encodes the specified Resource message. Does not implicitly {@link google.cloud.connectors.v1.RoleGrant.Resource.verify|verify} messages. + * @param message Resource message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.connectors.v1.RoleGrant.IResource, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Resource message, length delimited. Does not implicitly {@link google.cloud.connectors.v1.RoleGrant.Resource.verify|verify} messages. + * @param message Resource message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.connectors.v1.RoleGrant.IResource, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Resource message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Resource + * @throws {Error} If the payload is not 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.connectors.v1.RoleGrant.Resource; + + /** + * Decodes a Resource message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Resource + * @throws {Error} If the payload 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.connectors.v1.RoleGrant.Resource; + + /** + * Verifies a Resource message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Resource message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Resource + */ + public static fromObject(object: { [k: string]: any }): google.cloud.connectors.v1.RoleGrant.Resource; + + /** + * Creates a plain object from a Resource message. Also converts values to other types if specified. + * @param message Resource + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.connectors.v1.RoleGrant.Resource, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Resource to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Resource + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace Resource { + + /** Type enum. */ + enum Type { + TYPE_UNSPECIFIED = 0, + GCP_PROJECT = 1, + GCP_RESOURCE = 2, + GCP_SECRETMANAGER_SECRET = 3, + GCP_SECRETMANAGER_SECRET_VERSION = 4 + } + } + } + + /** Properties of an AuthorizationCodeLink. */ + interface IAuthorizationCodeLink { + + /** AuthorizationCodeLink uri */ + uri?: (string|null); + + /** AuthorizationCodeLink scopes */ + scopes?: (string[]|null); + + /** AuthorizationCodeLink clientId */ + clientId?: (string|null); + + /** AuthorizationCodeLink enablePkce */ + enablePkce?: (boolean|null); + } + + /** Represents an AuthorizationCodeLink. */ + class AuthorizationCodeLink implements IAuthorizationCodeLink { + + /** + * Constructs a new AuthorizationCodeLink. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.connectors.v1.IAuthorizationCodeLink); + + /** AuthorizationCodeLink uri. */ + public uri: string; + + /** AuthorizationCodeLink scopes. */ + public scopes: string[]; + + /** AuthorizationCodeLink clientId. */ + public clientId: string; + + /** AuthorizationCodeLink enablePkce. */ + public enablePkce: boolean; + + /** + * Creates a new AuthorizationCodeLink instance using the specified properties. + * @param [properties] Properties to set + * @returns AuthorizationCodeLink instance + */ + public static create(properties?: google.cloud.connectors.v1.IAuthorizationCodeLink): google.cloud.connectors.v1.AuthorizationCodeLink; + + /** + * Encodes the specified AuthorizationCodeLink message. Does not implicitly {@link google.cloud.connectors.v1.AuthorizationCodeLink.verify|verify} messages. + * @param message AuthorizationCodeLink message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.connectors.v1.IAuthorizationCodeLink, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified AuthorizationCodeLink message, length delimited. Does not implicitly {@link google.cloud.connectors.v1.AuthorizationCodeLink.verify|verify} messages. + * @param message AuthorizationCodeLink message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.connectors.v1.IAuthorizationCodeLink, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an AuthorizationCodeLink message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns AuthorizationCodeLink + * @throws {Error} If the payload is not 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.connectors.v1.AuthorizationCodeLink; + + /** + * Decodes an AuthorizationCodeLink message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns AuthorizationCodeLink + * @throws {Error} If the payload 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.connectors.v1.AuthorizationCodeLink; + + /** + * Verifies an AuthorizationCodeLink message. + * @param message Plain 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 AuthorizationCodeLink message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns AuthorizationCodeLink + */ + public static fromObject(object: { [k: string]: any }): google.cloud.connectors.v1.AuthorizationCodeLink; + + /** + * Creates a plain object from an AuthorizationCodeLink message. Also converts values to other types if specified. + * @param message AuthorizationCodeLink + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.connectors.v1.AuthorizationCodeLink, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this AuthorizationCodeLink to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for AuthorizationCodeLink + * @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, + PREVIEW = 1, + GA = 2, + DEPRECATED = 3, + PRIVATE_PREVIEW = 5 + } + + /** Properties of a Connection. */ + interface IConnection { + + /** Connection name */ + name?: (string|null); + + /** Connection createTime */ + createTime?: (google.protobuf.ITimestamp|null); + + /** Connection updateTime */ + updateTime?: (google.protobuf.ITimestamp|null); + + /** Connection labels */ + labels?: ({ [k: string]: string }|null); + + /** Connection description */ + description?: (string|null); + + /** Connection connectorVersion */ + connectorVersion?: (string|null); + + /** Connection status */ + status?: (google.cloud.connectors.v1.IConnectionStatus|null); + + /** Connection configVariables */ + configVariables?: (google.cloud.connectors.v1.IConfigVariable[]|null); + + /** Connection authConfig */ + authConfig?: (google.cloud.connectors.v1.IAuthConfig|null); + + /** Connection lockConfig */ + lockConfig?: (google.cloud.connectors.v1.ILockConfig|null); + + /** Connection destinationConfigs */ + destinationConfigs?: (google.cloud.connectors.v1.IDestinationConfig[]|null); + + /** Connection imageLocation */ + imageLocation?: (string|null); + + /** Connection serviceAccount */ + serviceAccount?: (string|null); + + /** Connection serviceDirectory */ + serviceDirectory?: (string|null); + + /** Connection envoyImageLocation */ + envoyImageLocation?: (string|null); + + /** Connection suspended */ + suspended?: (boolean|null); + + /** Connection nodeConfig */ + nodeConfig?: (google.cloud.connectors.v1.INodeConfig|null); + + /** Connection sslConfig */ + sslConfig?: (google.cloud.connectors.v1.ISslConfig|null); + } + + /** Represents a Connection. */ + class Connection implements IConnection { + + /** + * Constructs a new Connection. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.connectors.v1.IConnection); + + /** Connection name. */ + public name: string; + + /** Connection createTime. */ + public createTime?: (google.protobuf.ITimestamp|null); + + /** Connection updateTime. */ + public updateTime?: (google.protobuf.ITimestamp|null); + + /** Connection labels. */ + public labels: { [k: string]: string }; + + /** Connection description. */ + public description: string; + + /** Connection connectorVersion. */ + public connectorVersion: string; + + /** Connection status. */ + public status?: (google.cloud.connectors.v1.IConnectionStatus|null); + + /** Connection configVariables. */ + public configVariables: google.cloud.connectors.v1.IConfigVariable[]; + + /** Connection authConfig. */ + public authConfig?: (google.cloud.connectors.v1.IAuthConfig|null); + + /** Connection lockConfig. */ + public lockConfig?: (google.cloud.connectors.v1.ILockConfig|null); + + /** Connection destinationConfigs. */ + public destinationConfigs: google.cloud.connectors.v1.IDestinationConfig[]; + + /** Connection imageLocation. */ + public imageLocation: string; + + /** Connection serviceAccount. */ + public serviceAccount: string; + + /** Connection serviceDirectory. */ + public serviceDirectory: string; + + /** Connection envoyImageLocation. */ + public envoyImageLocation: string; + + /** Connection suspended. */ + public suspended: boolean; + + /** Connection nodeConfig. */ + public nodeConfig?: (google.cloud.connectors.v1.INodeConfig|null); + + /** Connection sslConfig. */ + public sslConfig?: (google.cloud.connectors.v1.ISslConfig|null); + + /** + * Creates a new Connection instance using the specified properties. + * @param [properties] Properties to set + * @returns Connection instance + */ + public static create(properties?: google.cloud.connectors.v1.IConnection): google.cloud.connectors.v1.Connection; + + /** + * Encodes the specified Connection message. Does not implicitly {@link google.cloud.connectors.v1.Connection.verify|verify} messages. + * @param message Connection message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.connectors.v1.IConnection, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Connection message, length delimited. Does not implicitly {@link google.cloud.connectors.v1.Connection.verify|verify} messages. + * @param message Connection message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.connectors.v1.IConnection, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Connection message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Connection + * @throws {Error} If the payload is not 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.connectors.v1.Connection; + + /** + * Decodes a Connection message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Connection + * @throws {Error} If the payload 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.connectors.v1.Connection; + + /** + * Verifies a Connection message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Connection message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Connection + */ + public static fromObject(object: { [k: string]: any }): google.cloud.connectors.v1.Connection; + + /** + * Creates a plain object from a Connection message. Also converts values to other types if specified. + * @param message Connection + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.connectors.v1.Connection, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Connection to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Connection + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a NodeConfig. */ + interface INodeConfig { + + /** NodeConfig minNodeCount */ + minNodeCount?: (number|null); + + /** NodeConfig maxNodeCount */ + maxNodeCount?: (number|null); + } + + /** Represents a NodeConfig. */ + class NodeConfig implements INodeConfig { + + /** + * Constructs a new NodeConfig. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.connectors.v1.INodeConfig); + + /** NodeConfig minNodeCount. */ + public minNodeCount: number; + + /** NodeConfig maxNodeCount. */ + public maxNodeCount: number; + + /** + * Creates a new NodeConfig instance using the specified properties. + * @param [properties] Properties to set + * @returns NodeConfig instance + */ + public static create(properties?: google.cloud.connectors.v1.INodeConfig): google.cloud.connectors.v1.NodeConfig; + + /** + * Encodes the specified NodeConfig message. Does not implicitly {@link google.cloud.connectors.v1.NodeConfig.verify|verify} messages. + * @param message NodeConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.connectors.v1.INodeConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified NodeConfig message, length delimited. Does not implicitly {@link google.cloud.connectors.v1.NodeConfig.verify|verify} messages. + * @param message NodeConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.connectors.v1.INodeConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a NodeConfig message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns NodeConfig + * @throws {Error} If the payload is not 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.connectors.v1.NodeConfig; + + /** + * Decodes a NodeConfig message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns NodeConfig + * @throws {Error} If the payload 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.connectors.v1.NodeConfig; + + /** + * Verifies a NodeConfig message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a NodeConfig message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns NodeConfig + */ + public static fromObject(object: { [k: string]: any }): google.cloud.connectors.v1.NodeConfig; + + /** + * Creates a plain object from a NodeConfig message. Also converts values to other types if specified. + * @param message NodeConfig + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.connectors.v1.NodeConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this NodeConfig to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for NodeConfig + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ConnectionSchemaMetadata. */ + interface IConnectionSchemaMetadata { + + /** ConnectionSchemaMetadata entities */ + entities?: (string[]|null); + + /** ConnectionSchemaMetadata actions */ + actions?: (string[]|null); + + /** ConnectionSchemaMetadata name */ + name?: (string|null); + + /** ConnectionSchemaMetadata updateTime */ + updateTime?: (google.protobuf.ITimestamp|null); + + /** ConnectionSchemaMetadata refreshTime */ + refreshTime?: (google.protobuf.ITimestamp|null); + + /** ConnectionSchemaMetadata state */ + state?: (google.cloud.connectors.v1.ConnectionSchemaMetadata.State|keyof typeof google.cloud.connectors.v1.ConnectionSchemaMetadata.State|null); + } + + /** Represents a ConnectionSchemaMetadata. */ + class ConnectionSchemaMetadata implements IConnectionSchemaMetadata { + + /** + * Constructs a new ConnectionSchemaMetadata. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.connectors.v1.IConnectionSchemaMetadata); + + /** ConnectionSchemaMetadata entities. */ + public entities: string[]; + + /** ConnectionSchemaMetadata actions. */ + public actions: string[]; + + /** ConnectionSchemaMetadata name. */ + public name: string; + + /** ConnectionSchemaMetadata updateTime. */ + public updateTime?: (google.protobuf.ITimestamp|null); + + /** ConnectionSchemaMetadata refreshTime. */ + public refreshTime?: (google.protobuf.ITimestamp|null); + + /** ConnectionSchemaMetadata state. */ + public state: (google.cloud.connectors.v1.ConnectionSchemaMetadata.State|keyof typeof google.cloud.connectors.v1.ConnectionSchemaMetadata.State); + + /** + * Creates a new ConnectionSchemaMetadata instance using the specified properties. + * @param [properties] Properties to set + * @returns ConnectionSchemaMetadata instance + */ + public static create(properties?: google.cloud.connectors.v1.IConnectionSchemaMetadata): google.cloud.connectors.v1.ConnectionSchemaMetadata; + + /** + * Encodes the specified ConnectionSchemaMetadata message. Does not implicitly {@link google.cloud.connectors.v1.ConnectionSchemaMetadata.verify|verify} messages. + * @param message ConnectionSchemaMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.connectors.v1.IConnectionSchemaMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ConnectionSchemaMetadata message, length delimited. Does not implicitly {@link google.cloud.connectors.v1.ConnectionSchemaMetadata.verify|verify} messages. + * @param message ConnectionSchemaMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.connectors.v1.IConnectionSchemaMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ConnectionSchemaMetadata message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ConnectionSchemaMetadata + * @throws {Error} If the payload is not 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.connectors.v1.ConnectionSchemaMetadata; + + /** + * Decodes a ConnectionSchemaMetadata message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ConnectionSchemaMetadata + * @throws {Error} If the payload 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.connectors.v1.ConnectionSchemaMetadata; + + /** + * Verifies a ConnectionSchemaMetadata message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ConnectionSchemaMetadata message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ConnectionSchemaMetadata + */ + public static fromObject(object: { [k: string]: any }): google.cloud.connectors.v1.ConnectionSchemaMetadata; + + /** + * Creates a plain object from a ConnectionSchemaMetadata message. Also converts values to other types if specified. + * @param message ConnectionSchemaMetadata + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.connectors.v1.ConnectionSchemaMetadata, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ConnectionSchemaMetadata to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ConnectionSchemaMetadata + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace ConnectionSchemaMetadata { + + /** State enum. */ + enum State { + STATE_UNSPECIFIED = 0, + REFRESHING = 1, + UPDATED = 2 + } + } + + /** Properties of a RuntimeEntitySchema. */ + interface IRuntimeEntitySchema { + + /** RuntimeEntitySchema entity */ + entity?: (string|null); + + /** RuntimeEntitySchema fields */ + fields?: (google.cloud.connectors.v1.RuntimeEntitySchema.IField[]|null); + } + + /** Represents a RuntimeEntitySchema. */ + class RuntimeEntitySchema implements IRuntimeEntitySchema { + + /** + * Constructs a new RuntimeEntitySchema. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.connectors.v1.IRuntimeEntitySchema); + + /** RuntimeEntitySchema entity. */ + public entity: string; + + /** RuntimeEntitySchema fields. */ + public fields: google.cloud.connectors.v1.RuntimeEntitySchema.IField[]; + + /** + * Creates a new RuntimeEntitySchema instance using the specified properties. + * @param [properties] Properties to set + * @returns RuntimeEntitySchema instance + */ + public static create(properties?: google.cloud.connectors.v1.IRuntimeEntitySchema): google.cloud.connectors.v1.RuntimeEntitySchema; + + /** + * Encodes the specified RuntimeEntitySchema message. Does not implicitly {@link google.cloud.connectors.v1.RuntimeEntitySchema.verify|verify} messages. + * @param message RuntimeEntitySchema message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.connectors.v1.IRuntimeEntitySchema, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified RuntimeEntitySchema message, length delimited. Does not implicitly {@link google.cloud.connectors.v1.RuntimeEntitySchema.verify|verify} messages. + * @param message RuntimeEntitySchema message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.connectors.v1.IRuntimeEntitySchema, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a RuntimeEntitySchema message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns RuntimeEntitySchema + * @throws {Error} If the payload is not 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.connectors.v1.RuntimeEntitySchema; + + /** + * Decodes a RuntimeEntitySchema message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns RuntimeEntitySchema + * @throws {Error} If the payload 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.connectors.v1.RuntimeEntitySchema; + + /** + * Verifies a RuntimeEntitySchema message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a RuntimeEntitySchema message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns RuntimeEntitySchema + */ + public static fromObject(object: { [k: string]: any }): google.cloud.connectors.v1.RuntimeEntitySchema; + + /** + * Creates a plain object from a RuntimeEntitySchema message. Also converts values to other types if specified. + * @param message RuntimeEntitySchema + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.connectors.v1.RuntimeEntitySchema, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this RuntimeEntitySchema to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for RuntimeEntitySchema + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace RuntimeEntitySchema { + + /** Properties of a Field. */ + interface IField { + + /** Field field */ + field?: (string|null); + + /** Field description */ + description?: (string|null); + + /** Field dataType */ + dataType?: (google.cloud.connectors.v1.DataType|keyof typeof google.cloud.connectors.v1.DataType|null); + + /** Field key */ + key?: (boolean|null); + + /** Field readonly */ + readonly?: (boolean|null); + + /** Field nullable */ + nullable?: (boolean|null); + + /** Field defaultValue */ + defaultValue?: (google.protobuf.IValue|null); + + /** Field additionalDetails */ + additionalDetails?: (google.protobuf.IStruct|null); + } + + /** Represents a Field. */ + class Field implements IField { + + /** + * Constructs a new Field. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.connectors.v1.RuntimeEntitySchema.IField); + + /** Field field. */ + public field: string; + + /** Field description. */ + public description: string; + + /** Field dataType. */ + public dataType: (google.cloud.connectors.v1.DataType|keyof typeof google.cloud.connectors.v1.DataType); + + /** Field key. */ + public key: boolean; + + /** Field readonly. */ + public readonly: boolean; + + /** Field nullable. */ + public nullable: boolean; + + /** Field defaultValue. */ + public defaultValue?: (google.protobuf.IValue|null); + + /** Field additionalDetails. */ + public additionalDetails?: (google.protobuf.IStruct|null); + + /** + * Creates a new Field instance using the specified properties. + * @param [properties] Properties to set + * @returns Field instance + */ + public static create(properties?: google.cloud.connectors.v1.RuntimeEntitySchema.IField): google.cloud.connectors.v1.RuntimeEntitySchema.Field; + + /** + * Encodes the specified Field message. Does not implicitly {@link google.cloud.connectors.v1.RuntimeEntitySchema.Field.verify|verify} messages. + * @param message Field message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.connectors.v1.RuntimeEntitySchema.IField, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Field message, length delimited. Does not implicitly {@link google.cloud.connectors.v1.RuntimeEntitySchema.Field.verify|verify} messages. + * @param message Field message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.connectors.v1.RuntimeEntitySchema.IField, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Field message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Field + * @throws {Error} If the payload is not 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.connectors.v1.RuntimeEntitySchema.Field; + + /** + * Decodes a Field message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Field + * @throws {Error} If the payload 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.connectors.v1.RuntimeEntitySchema.Field; + + /** + * Verifies a Field message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Field message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Field + */ + public static fromObject(object: { [k: string]: any }): google.cloud.connectors.v1.RuntimeEntitySchema.Field; + + /** + * Creates a plain object from a Field message. Also converts values to other types if specified. + * @param message Field + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.connectors.v1.RuntimeEntitySchema.Field, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Field to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Field + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Properties of a RuntimeActionSchema. */ + interface IRuntimeActionSchema { + + /** RuntimeActionSchema action */ + action?: (string|null); + + /** RuntimeActionSchema inputParameters */ + inputParameters?: (google.cloud.connectors.v1.RuntimeActionSchema.IInputParameter[]|null); + + /** RuntimeActionSchema resultMetadata */ + resultMetadata?: (google.cloud.connectors.v1.RuntimeActionSchema.IResultMetadata[]|null); + } + + /** Represents a RuntimeActionSchema. */ + class RuntimeActionSchema implements IRuntimeActionSchema { + + /** + * Constructs a new RuntimeActionSchema. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.connectors.v1.IRuntimeActionSchema); + + /** RuntimeActionSchema action. */ + public action: string; + + /** RuntimeActionSchema inputParameters. */ + public inputParameters: google.cloud.connectors.v1.RuntimeActionSchema.IInputParameter[]; + + /** RuntimeActionSchema resultMetadata. */ + public resultMetadata: google.cloud.connectors.v1.RuntimeActionSchema.IResultMetadata[]; + + /** + * Creates a new RuntimeActionSchema instance using the specified properties. + * @param [properties] Properties to set + * @returns RuntimeActionSchema instance + */ + public static create(properties?: google.cloud.connectors.v1.IRuntimeActionSchema): google.cloud.connectors.v1.RuntimeActionSchema; + + /** + * Encodes the specified RuntimeActionSchema message. Does not implicitly {@link google.cloud.connectors.v1.RuntimeActionSchema.verify|verify} messages. + * @param message RuntimeActionSchema message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.connectors.v1.IRuntimeActionSchema, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified RuntimeActionSchema message, length delimited. Does not implicitly {@link google.cloud.connectors.v1.RuntimeActionSchema.verify|verify} messages. + * @param message RuntimeActionSchema message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.connectors.v1.IRuntimeActionSchema, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a RuntimeActionSchema message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns RuntimeActionSchema + * @throws {Error} If the payload is not 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.connectors.v1.RuntimeActionSchema; + + /** + * Decodes a RuntimeActionSchema message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns RuntimeActionSchema + * @throws {Error} If the payload 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.connectors.v1.RuntimeActionSchema; + + /** + * Verifies a RuntimeActionSchema message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a RuntimeActionSchema message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns RuntimeActionSchema + */ + public static fromObject(object: { [k: string]: any }): google.cloud.connectors.v1.RuntimeActionSchema; + + /** + * Creates a plain object from a RuntimeActionSchema message. Also converts values to other types if specified. + * @param message RuntimeActionSchema + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.connectors.v1.RuntimeActionSchema, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this RuntimeActionSchema to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for RuntimeActionSchema + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace RuntimeActionSchema { + + /** Properties of an InputParameter. */ + interface IInputParameter { + + /** InputParameter parameter */ + parameter?: (string|null); + + /** InputParameter description */ + description?: (string|null); + + /** InputParameter dataType */ + dataType?: (google.cloud.connectors.v1.DataType|keyof typeof google.cloud.connectors.v1.DataType|null); + + /** InputParameter nullable */ + nullable?: (boolean|null); + + /** InputParameter defaultValue */ + defaultValue?: (google.protobuf.IValue|null); + } + + /** Represents an InputParameter. */ + class InputParameter implements IInputParameter { + + /** + * Constructs a new InputParameter. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.connectors.v1.RuntimeActionSchema.IInputParameter); + + /** InputParameter parameter. */ + public parameter: string; + + /** InputParameter description. */ + public description: string; + + /** InputParameter dataType. */ + public dataType: (google.cloud.connectors.v1.DataType|keyof typeof google.cloud.connectors.v1.DataType); + + /** InputParameter nullable. */ + public nullable: boolean; + + /** InputParameter defaultValue. */ + public defaultValue?: (google.protobuf.IValue|null); + + /** + * Creates a new InputParameter instance using the specified properties. + * @param [properties] Properties to set + * @returns InputParameter instance + */ + public static create(properties?: google.cloud.connectors.v1.RuntimeActionSchema.IInputParameter): google.cloud.connectors.v1.RuntimeActionSchema.InputParameter; + + /** + * Encodes the specified InputParameter message. Does not implicitly {@link google.cloud.connectors.v1.RuntimeActionSchema.InputParameter.verify|verify} messages. + * @param message InputParameter message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.connectors.v1.RuntimeActionSchema.IInputParameter, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified InputParameter message, length delimited. Does not implicitly {@link google.cloud.connectors.v1.RuntimeActionSchema.InputParameter.verify|verify} messages. + * @param message InputParameter message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.connectors.v1.RuntimeActionSchema.IInputParameter, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an InputParameter message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns InputParameter + * @throws {Error} If the payload is not 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.connectors.v1.RuntimeActionSchema.InputParameter; + + /** + * Decodes an InputParameter message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns InputParameter + * @throws {Error} If the payload 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.connectors.v1.RuntimeActionSchema.InputParameter; + + /** + * Verifies an InputParameter message. + * @param message Plain 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 InputParameter message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns InputParameter + */ + public static fromObject(object: { [k: string]: any }): google.cloud.connectors.v1.RuntimeActionSchema.InputParameter; + + /** + * Creates a plain object from an InputParameter message. Also converts values to other types if specified. + * @param message InputParameter + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.connectors.v1.RuntimeActionSchema.InputParameter, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this InputParameter to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for InputParameter + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ResultMetadata. */ + interface IResultMetadata { + + /** ResultMetadata field */ + field?: (string|null); + + /** ResultMetadata description */ + description?: (string|null); + + /** ResultMetadata dataType */ + dataType?: (google.cloud.connectors.v1.DataType|keyof typeof google.cloud.connectors.v1.DataType|null); + } + + /** Represents a ResultMetadata. */ + class ResultMetadata implements IResultMetadata { + + /** + * Constructs a new ResultMetadata. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.connectors.v1.RuntimeActionSchema.IResultMetadata); + + /** ResultMetadata field. */ + public field: string; + + /** ResultMetadata description. */ + public description: string; + + /** ResultMetadata dataType. */ + public dataType: (google.cloud.connectors.v1.DataType|keyof typeof google.cloud.connectors.v1.DataType); + + /** + * Creates a new ResultMetadata instance using the specified properties. + * @param [properties] Properties to set + * @returns ResultMetadata instance + */ + public static create(properties?: google.cloud.connectors.v1.RuntimeActionSchema.IResultMetadata): google.cloud.connectors.v1.RuntimeActionSchema.ResultMetadata; + + /** + * Encodes the specified ResultMetadata message. Does not implicitly {@link google.cloud.connectors.v1.RuntimeActionSchema.ResultMetadata.verify|verify} messages. + * @param message ResultMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.connectors.v1.RuntimeActionSchema.IResultMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ResultMetadata message, length delimited. Does not implicitly {@link google.cloud.connectors.v1.RuntimeActionSchema.ResultMetadata.verify|verify} messages. + * @param message ResultMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.connectors.v1.RuntimeActionSchema.IResultMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ResultMetadata message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ResultMetadata + * @throws {Error} If the payload is not 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.connectors.v1.RuntimeActionSchema.ResultMetadata; + + /** + * Decodes a ResultMetadata message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ResultMetadata + * @throws {Error} If the payload 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.connectors.v1.RuntimeActionSchema.ResultMetadata; + + /** + * Verifies a ResultMetadata message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ResultMetadata message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ResultMetadata + */ + public static fromObject(object: { [k: string]: any }): google.cloud.connectors.v1.RuntimeActionSchema.ResultMetadata; + + /** + * Creates a plain object from a ResultMetadata message. Also converts values to other types if specified. + * @param message ResultMetadata + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.connectors.v1.RuntimeActionSchema.ResultMetadata, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ResultMetadata to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ResultMetadata + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Properties of a LockConfig. */ + interface ILockConfig { + + /** LockConfig locked */ + locked?: (boolean|null); + + /** LockConfig reason */ + reason?: (string|null); + } + + /** Represents a LockConfig. */ + class LockConfig implements ILockConfig { + + /** + * Constructs a new LockConfig. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.connectors.v1.ILockConfig); + + /** LockConfig locked. */ + public locked: boolean; + + /** LockConfig reason. */ + public reason: string; + + /** + * Creates a new LockConfig instance using the specified properties. + * @param [properties] Properties to set + * @returns LockConfig instance + */ + public static create(properties?: google.cloud.connectors.v1.ILockConfig): google.cloud.connectors.v1.LockConfig; + + /** + * Encodes the specified LockConfig message. Does not implicitly {@link google.cloud.connectors.v1.LockConfig.verify|verify} messages. + * @param message LockConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.connectors.v1.ILockConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified LockConfig message, length delimited. Does not implicitly {@link google.cloud.connectors.v1.LockConfig.verify|verify} messages. + * @param message LockConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.connectors.v1.ILockConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a LockConfig message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns LockConfig + * @throws {Error} If the payload is not 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.connectors.v1.LockConfig; + + /** + * Decodes a LockConfig message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns LockConfig + * @throws {Error} If the payload 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.connectors.v1.LockConfig; + + /** + * Verifies a LockConfig message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a LockConfig message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns LockConfig + */ + public static fromObject(object: { [k: string]: any }): google.cloud.connectors.v1.LockConfig; + + /** + * Creates a plain object from a LockConfig message. Also converts values to other types if specified. + * @param message LockConfig + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.connectors.v1.LockConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this LockConfig to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for LockConfig + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListConnectionsRequest. */ + interface IListConnectionsRequest { + + /** ListConnectionsRequest parent */ + parent?: (string|null); + + /** ListConnectionsRequest pageSize */ + pageSize?: (number|null); + + /** ListConnectionsRequest pageToken */ + pageToken?: (string|null); + + /** ListConnectionsRequest filter */ + filter?: (string|null); + + /** ListConnectionsRequest orderBy */ + orderBy?: (string|null); + + /** ListConnectionsRequest view */ + view?: (google.cloud.connectors.v1.ConnectionView|keyof typeof google.cloud.connectors.v1.ConnectionView|null); + } + + /** Represents a ListConnectionsRequest. */ + class ListConnectionsRequest implements IListConnectionsRequest { + + /** + * Constructs a new ListConnectionsRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.connectors.v1.IListConnectionsRequest); + + /** ListConnectionsRequest parent. */ + public parent: string; + + /** ListConnectionsRequest pageSize. */ + public pageSize: number; + + /** ListConnectionsRequest pageToken. */ + public pageToken: string; + + /** ListConnectionsRequest filter. */ + public filter: string; + + /** ListConnectionsRequest orderBy. */ + public orderBy: string; + + /** ListConnectionsRequest view. */ + public view: (google.cloud.connectors.v1.ConnectionView|keyof typeof google.cloud.connectors.v1.ConnectionView); + + /** + * Creates a new ListConnectionsRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ListConnectionsRequest instance + */ + public static create(properties?: google.cloud.connectors.v1.IListConnectionsRequest): google.cloud.connectors.v1.ListConnectionsRequest; + + /** + * Encodes the specified ListConnectionsRequest message. Does not implicitly {@link google.cloud.connectors.v1.ListConnectionsRequest.verify|verify} messages. + * @param message ListConnectionsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.connectors.v1.IListConnectionsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListConnectionsRequest message, length delimited. Does not implicitly {@link google.cloud.connectors.v1.ListConnectionsRequest.verify|verify} messages. + * @param message ListConnectionsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.connectors.v1.IListConnectionsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListConnectionsRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListConnectionsRequest + * @throws {Error} If the payload is not 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.connectors.v1.ListConnectionsRequest; + + /** + * Decodes a ListConnectionsRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListConnectionsRequest + * @throws {Error} If the payload 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.connectors.v1.ListConnectionsRequest; + + /** + * Verifies a ListConnectionsRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListConnectionsRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListConnectionsRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.connectors.v1.ListConnectionsRequest; + + /** + * Creates a plain object from a ListConnectionsRequest message. Also converts values to other types if specified. + * @param message ListConnectionsRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.connectors.v1.ListConnectionsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListConnectionsRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListConnectionsRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListConnectionsResponse. */ + interface IListConnectionsResponse { + + /** ListConnectionsResponse connections */ + connections?: (google.cloud.connectors.v1.IConnection[]|null); + + /** ListConnectionsResponse nextPageToken */ + nextPageToken?: (string|null); + + /** ListConnectionsResponse unreachable */ + unreachable?: (string[]|null); + } + + /** Represents a ListConnectionsResponse. */ + class ListConnectionsResponse implements IListConnectionsResponse { + + /** + * Constructs a new ListConnectionsResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.connectors.v1.IListConnectionsResponse); + + /** ListConnectionsResponse connections. */ + public connections: google.cloud.connectors.v1.IConnection[]; + + /** ListConnectionsResponse nextPageToken. */ + public nextPageToken: string; + + /** ListConnectionsResponse unreachable. */ + public unreachable: string[]; + + /** + * Creates a new ListConnectionsResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ListConnectionsResponse instance + */ + public static create(properties?: google.cloud.connectors.v1.IListConnectionsResponse): google.cloud.connectors.v1.ListConnectionsResponse; + + /** + * Encodes the specified ListConnectionsResponse message. Does not implicitly {@link google.cloud.connectors.v1.ListConnectionsResponse.verify|verify} messages. + * @param message ListConnectionsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.connectors.v1.IListConnectionsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListConnectionsResponse message, length delimited. Does not implicitly {@link google.cloud.connectors.v1.ListConnectionsResponse.verify|verify} messages. + * @param message ListConnectionsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.connectors.v1.IListConnectionsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListConnectionsResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListConnectionsResponse + * @throws {Error} If the payload is not 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.connectors.v1.ListConnectionsResponse; + + /** + * Decodes a ListConnectionsResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListConnectionsResponse + * @throws {Error} If the payload 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.connectors.v1.ListConnectionsResponse; + + /** + * Verifies a ListConnectionsResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListConnectionsResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListConnectionsResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.connectors.v1.ListConnectionsResponse; + + /** + * Creates a plain object from a ListConnectionsResponse message. Also converts values to other types if specified. + * @param message ListConnectionsResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.connectors.v1.ListConnectionsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListConnectionsResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListConnectionsResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a GetConnectionRequest. */ + interface IGetConnectionRequest { + + /** GetConnectionRequest name */ + name?: (string|null); + + /** GetConnectionRequest view */ + view?: (google.cloud.connectors.v1.ConnectionView|keyof typeof google.cloud.connectors.v1.ConnectionView|null); + } + + /** Represents a GetConnectionRequest. */ + class GetConnectionRequest implements IGetConnectionRequest { + + /** + * Constructs a new GetConnectionRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.connectors.v1.IGetConnectionRequest); + + /** GetConnectionRequest name. */ + public name: string; + + /** GetConnectionRequest view. */ + public view: (google.cloud.connectors.v1.ConnectionView|keyof typeof google.cloud.connectors.v1.ConnectionView); + + /** + * Creates a new GetConnectionRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GetConnectionRequest instance + */ + public static create(properties?: google.cloud.connectors.v1.IGetConnectionRequest): google.cloud.connectors.v1.GetConnectionRequest; + + /** + * Encodes the specified GetConnectionRequest message. Does not implicitly {@link google.cloud.connectors.v1.GetConnectionRequest.verify|verify} messages. + * @param message GetConnectionRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.connectors.v1.IGetConnectionRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GetConnectionRequest message, length delimited. Does not implicitly {@link google.cloud.connectors.v1.GetConnectionRequest.verify|verify} messages. + * @param message GetConnectionRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.connectors.v1.IGetConnectionRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GetConnectionRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GetConnectionRequest + * @throws {Error} If the payload is not 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.connectors.v1.GetConnectionRequest; + + /** + * Decodes a GetConnectionRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GetConnectionRequest + * @throws {Error} If the payload 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.connectors.v1.GetConnectionRequest; + + /** + * Verifies a GetConnectionRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GetConnectionRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GetConnectionRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.connectors.v1.GetConnectionRequest; + + /** + * Creates a plain object from a GetConnectionRequest message. Also converts values to other types if specified. + * @param message GetConnectionRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.connectors.v1.GetConnectionRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GetConnectionRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GetConnectionRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a CreateConnectionRequest. */ + interface ICreateConnectionRequest { + + /** CreateConnectionRequest parent */ + parent?: (string|null); + + /** CreateConnectionRequest connectionId */ + connectionId?: (string|null); + + /** CreateConnectionRequest connection */ + connection?: (google.cloud.connectors.v1.IConnection|null); + } + + /** Represents a CreateConnectionRequest. */ + class CreateConnectionRequest implements ICreateConnectionRequest { + + /** + * Constructs a new CreateConnectionRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.connectors.v1.ICreateConnectionRequest); + + /** CreateConnectionRequest parent. */ + public parent: string; + + /** CreateConnectionRequest connectionId. */ + public connectionId: string; + + /** CreateConnectionRequest connection. */ + public connection?: (google.cloud.connectors.v1.IConnection|null); + + /** + * Creates a new CreateConnectionRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns CreateConnectionRequest instance + */ + public static create(properties?: google.cloud.connectors.v1.ICreateConnectionRequest): google.cloud.connectors.v1.CreateConnectionRequest; + + /** + * Encodes the specified CreateConnectionRequest message. Does not implicitly {@link google.cloud.connectors.v1.CreateConnectionRequest.verify|verify} messages. + * @param message CreateConnectionRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.connectors.v1.ICreateConnectionRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CreateConnectionRequest message, length delimited. Does not implicitly {@link google.cloud.connectors.v1.CreateConnectionRequest.verify|verify} messages. + * @param message CreateConnectionRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.connectors.v1.ICreateConnectionRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CreateConnectionRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CreateConnectionRequest + * @throws {Error} If the payload is not 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.connectors.v1.CreateConnectionRequest; + + /** + * Decodes a CreateConnectionRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CreateConnectionRequest + * @throws {Error} If the payload 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.connectors.v1.CreateConnectionRequest; + + /** + * Verifies a CreateConnectionRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CreateConnectionRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CreateConnectionRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.connectors.v1.CreateConnectionRequest; + + /** + * Creates a plain object from a CreateConnectionRequest message. Also converts values to other types if specified. + * @param message CreateConnectionRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.connectors.v1.CreateConnectionRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CreateConnectionRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CreateConnectionRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an UpdateConnectionRequest. */ + interface IUpdateConnectionRequest { + + /** UpdateConnectionRequest connection */ + connection?: (google.cloud.connectors.v1.IConnection|null); + + /** UpdateConnectionRequest updateMask */ + updateMask?: (google.protobuf.IFieldMask|null); + } + + /** Represents an UpdateConnectionRequest. */ + class UpdateConnectionRequest implements IUpdateConnectionRequest { + + /** + * Constructs a new UpdateConnectionRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.connectors.v1.IUpdateConnectionRequest); + + /** UpdateConnectionRequest connection. */ + public connection?: (google.cloud.connectors.v1.IConnection|null); + + /** UpdateConnectionRequest updateMask. */ + public updateMask?: (google.protobuf.IFieldMask|null); + + /** + * Creates a new UpdateConnectionRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns UpdateConnectionRequest instance + */ + public static create(properties?: google.cloud.connectors.v1.IUpdateConnectionRequest): google.cloud.connectors.v1.UpdateConnectionRequest; + + /** + * Encodes the specified UpdateConnectionRequest message. Does not implicitly {@link google.cloud.connectors.v1.UpdateConnectionRequest.verify|verify} messages. + * @param message UpdateConnectionRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.connectors.v1.IUpdateConnectionRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified UpdateConnectionRequest message, length delimited. Does not implicitly {@link google.cloud.connectors.v1.UpdateConnectionRequest.verify|verify} messages. + * @param message UpdateConnectionRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.connectors.v1.IUpdateConnectionRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an UpdateConnectionRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns UpdateConnectionRequest + * @throws {Error} If the payload is not 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.connectors.v1.UpdateConnectionRequest; + + /** + * Decodes an UpdateConnectionRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns UpdateConnectionRequest + * @throws {Error} If the payload 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.connectors.v1.UpdateConnectionRequest; + + /** + * Verifies an UpdateConnectionRequest message. + * @param message Plain 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 UpdateConnectionRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns UpdateConnectionRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.connectors.v1.UpdateConnectionRequest; + + /** + * Creates a plain object from an UpdateConnectionRequest message. Also converts values to other types if specified. + * @param message UpdateConnectionRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.connectors.v1.UpdateConnectionRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this UpdateConnectionRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for UpdateConnectionRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a DeleteConnectionRequest. */ + interface IDeleteConnectionRequest { + + /** DeleteConnectionRequest name */ + name?: (string|null); + } + + /** Represents a DeleteConnectionRequest. */ + class DeleteConnectionRequest implements IDeleteConnectionRequest { + + /** + * Constructs a new DeleteConnectionRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.connectors.v1.IDeleteConnectionRequest); + + /** DeleteConnectionRequest name. */ + public name: string; + + /** + * Creates a new DeleteConnectionRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns DeleteConnectionRequest instance + */ + public static create(properties?: google.cloud.connectors.v1.IDeleteConnectionRequest): google.cloud.connectors.v1.DeleteConnectionRequest; + + /** + * Encodes the specified DeleteConnectionRequest message. Does not implicitly {@link google.cloud.connectors.v1.DeleteConnectionRequest.verify|verify} messages. + * @param message DeleteConnectionRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.connectors.v1.IDeleteConnectionRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DeleteConnectionRequest message, length delimited. Does not implicitly {@link google.cloud.connectors.v1.DeleteConnectionRequest.verify|verify} messages. + * @param message DeleteConnectionRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.connectors.v1.IDeleteConnectionRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DeleteConnectionRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DeleteConnectionRequest + * @throws {Error} If the payload is not 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.connectors.v1.DeleteConnectionRequest; + + /** + * Decodes a DeleteConnectionRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DeleteConnectionRequest + * @throws {Error} If the payload 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.connectors.v1.DeleteConnectionRequest; + + /** + * Verifies a DeleteConnectionRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DeleteConnectionRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DeleteConnectionRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.connectors.v1.DeleteConnectionRequest; + + /** + * Creates a plain object from a DeleteConnectionRequest message. Also converts values to other types if specified. + * @param message DeleteConnectionRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.connectors.v1.DeleteConnectionRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DeleteConnectionRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DeleteConnectionRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a GetConnectionSchemaMetadataRequest. */ + interface IGetConnectionSchemaMetadataRequest { + + /** GetConnectionSchemaMetadataRequest name */ + name?: (string|null); + } + + /** Represents a GetConnectionSchemaMetadataRequest. */ + class GetConnectionSchemaMetadataRequest implements IGetConnectionSchemaMetadataRequest { + + /** + * Constructs a new GetConnectionSchemaMetadataRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.connectors.v1.IGetConnectionSchemaMetadataRequest); + + /** GetConnectionSchemaMetadataRequest name. */ + public name: string; + + /** + * Creates a new GetConnectionSchemaMetadataRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GetConnectionSchemaMetadataRequest instance + */ + public static create(properties?: google.cloud.connectors.v1.IGetConnectionSchemaMetadataRequest): google.cloud.connectors.v1.GetConnectionSchemaMetadataRequest; + + /** + * Encodes the specified GetConnectionSchemaMetadataRequest message. Does not implicitly {@link google.cloud.connectors.v1.GetConnectionSchemaMetadataRequest.verify|verify} messages. + * @param message GetConnectionSchemaMetadataRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.connectors.v1.IGetConnectionSchemaMetadataRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GetConnectionSchemaMetadataRequest message, length delimited. Does not implicitly {@link google.cloud.connectors.v1.GetConnectionSchemaMetadataRequest.verify|verify} messages. + * @param message GetConnectionSchemaMetadataRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.connectors.v1.IGetConnectionSchemaMetadataRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GetConnectionSchemaMetadataRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GetConnectionSchemaMetadataRequest + * @throws {Error} If the payload is not 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.connectors.v1.GetConnectionSchemaMetadataRequest; + + /** + * Decodes a GetConnectionSchemaMetadataRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GetConnectionSchemaMetadataRequest + * @throws {Error} If the payload 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.connectors.v1.GetConnectionSchemaMetadataRequest; + + /** + * Verifies a GetConnectionSchemaMetadataRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GetConnectionSchemaMetadataRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GetConnectionSchemaMetadataRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.connectors.v1.GetConnectionSchemaMetadataRequest; + + /** + * Creates a plain object from a GetConnectionSchemaMetadataRequest message. Also converts values to other types if specified. + * @param message GetConnectionSchemaMetadataRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.connectors.v1.GetConnectionSchemaMetadataRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GetConnectionSchemaMetadataRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GetConnectionSchemaMetadataRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a RefreshConnectionSchemaMetadataRequest. */ + interface IRefreshConnectionSchemaMetadataRequest { + + /** RefreshConnectionSchemaMetadataRequest name */ + name?: (string|null); + } + + /** Represents a RefreshConnectionSchemaMetadataRequest. */ + class RefreshConnectionSchemaMetadataRequest implements IRefreshConnectionSchemaMetadataRequest { + + /** + * Constructs a new RefreshConnectionSchemaMetadataRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.connectors.v1.IRefreshConnectionSchemaMetadataRequest); + + /** RefreshConnectionSchemaMetadataRequest name. */ + public name: string; + + /** + * Creates a new RefreshConnectionSchemaMetadataRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns RefreshConnectionSchemaMetadataRequest instance + */ + public static create(properties?: google.cloud.connectors.v1.IRefreshConnectionSchemaMetadataRequest): google.cloud.connectors.v1.RefreshConnectionSchemaMetadataRequest; + + /** + * Encodes the specified RefreshConnectionSchemaMetadataRequest message. Does not implicitly {@link google.cloud.connectors.v1.RefreshConnectionSchemaMetadataRequest.verify|verify} messages. + * @param message RefreshConnectionSchemaMetadataRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.connectors.v1.IRefreshConnectionSchemaMetadataRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified RefreshConnectionSchemaMetadataRequest message, length delimited. Does not implicitly {@link google.cloud.connectors.v1.RefreshConnectionSchemaMetadataRequest.verify|verify} messages. + * @param message RefreshConnectionSchemaMetadataRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.connectors.v1.IRefreshConnectionSchemaMetadataRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a RefreshConnectionSchemaMetadataRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns RefreshConnectionSchemaMetadataRequest + * @throws {Error} If the payload is not 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.connectors.v1.RefreshConnectionSchemaMetadataRequest; + + /** + * Decodes a RefreshConnectionSchemaMetadataRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns RefreshConnectionSchemaMetadataRequest + * @throws {Error} If the payload 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.connectors.v1.RefreshConnectionSchemaMetadataRequest; + + /** + * Verifies a RefreshConnectionSchemaMetadataRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a RefreshConnectionSchemaMetadataRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns RefreshConnectionSchemaMetadataRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.connectors.v1.RefreshConnectionSchemaMetadataRequest; + + /** + * Creates a plain object from a RefreshConnectionSchemaMetadataRequest message. Also converts values to other types if specified. + * @param message RefreshConnectionSchemaMetadataRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.connectors.v1.RefreshConnectionSchemaMetadataRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this RefreshConnectionSchemaMetadataRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for RefreshConnectionSchemaMetadataRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListRuntimeEntitySchemasRequest. */ + interface IListRuntimeEntitySchemasRequest { + + /** ListRuntimeEntitySchemasRequest parent */ + parent?: (string|null); + + /** ListRuntimeEntitySchemasRequest pageSize */ + pageSize?: (number|null); + + /** ListRuntimeEntitySchemasRequest pageToken */ + pageToken?: (string|null); + + /** ListRuntimeEntitySchemasRequest filter */ + filter?: (string|null); + } + + /** Represents a ListRuntimeEntitySchemasRequest. */ + class ListRuntimeEntitySchemasRequest implements IListRuntimeEntitySchemasRequest { + + /** + * Constructs a new ListRuntimeEntitySchemasRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.connectors.v1.IListRuntimeEntitySchemasRequest); + + /** ListRuntimeEntitySchemasRequest parent. */ + public parent: string; + + /** ListRuntimeEntitySchemasRequest pageSize. */ + public pageSize: number; + + /** ListRuntimeEntitySchemasRequest pageToken. */ + public pageToken: string; + + /** ListRuntimeEntitySchemasRequest filter. */ + public filter: string; + + /** + * Creates a new ListRuntimeEntitySchemasRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ListRuntimeEntitySchemasRequest instance + */ + public static create(properties?: google.cloud.connectors.v1.IListRuntimeEntitySchemasRequest): google.cloud.connectors.v1.ListRuntimeEntitySchemasRequest; + + /** + * Encodes the specified ListRuntimeEntitySchemasRequest message. Does not implicitly {@link google.cloud.connectors.v1.ListRuntimeEntitySchemasRequest.verify|verify} messages. + * @param message ListRuntimeEntitySchemasRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.connectors.v1.IListRuntimeEntitySchemasRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListRuntimeEntitySchemasRequest message, length delimited. Does not implicitly {@link google.cloud.connectors.v1.ListRuntimeEntitySchemasRequest.verify|verify} messages. + * @param message ListRuntimeEntitySchemasRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.connectors.v1.IListRuntimeEntitySchemasRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListRuntimeEntitySchemasRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListRuntimeEntitySchemasRequest + * @throws {Error} If the payload is not 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.connectors.v1.ListRuntimeEntitySchemasRequest; + + /** + * Decodes a ListRuntimeEntitySchemasRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListRuntimeEntitySchemasRequest + * @throws {Error} If the payload 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.connectors.v1.ListRuntimeEntitySchemasRequest; + + /** + * Verifies a ListRuntimeEntitySchemasRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListRuntimeEntitySchemasRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListRuntimeEntitySchemasRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.connectors.v1.ListRuntimeEntitySchemasRequest; + + /** + * Creates a plain object from a ListRuntimeEntitySchemasRequest message. Also converts values to other types if specified. + * @param message ListRuntimeEntitySchemasRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.connectors.v1.ListRuntimeEntitySchemasRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListRuntimeEntitySchemasRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListRuntimeEntitySchemasRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListRuntimeEntitySchemasResponse. */ + interface IListRuntimeEntitySchemasResponse { + + /** ListRuntimeEntitySchemasResponse runtimeEntitySchemas */ + runtimeEntitySchemas?: (google.cloud.connectors.v1.IRuntimeEntitySchema[]|null); + + /** ListRuntimeEntitySchemasResponse nextPageToken */ + nextPageToken?: (string|null); + } + + /** Represents a ListRuntimeEntitySchemasResponse. */ + class ListRuntimeEntitySchemasResponse implements IListRuntimeEntitySchemasResponse { + + /** + * Constructs a new ListRuntimeEntitySchemasResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.connectors.v1.IListRuntimeEntitySchemasResponse); + + /** ListRuntimeEntitySchemasResponse runtimeEntitySchemas. */ + public runtimeEntitySchemas: google.cloud.connectors.v1.IRuntimeEntitySchema[]; + + /** ListRuntimeEntitySchemasResponse nextPageToken. */ + public nextPageToken: string; + + /** + * Creates a new ListRuntimeEntitySchemasResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ListRuntimeEntitySchemasResponse instance + */ + public static create(properties?: google.cloud.connectors.v1.IListRuntimeEntitySchemasResponse): google.cloud.connectors.v1.ListRuntimeEntitySchemasResponse; + + /** + * Encodes the specified ListRuntimeEntitySchemasResponse message. Does not implicitly {@link google.cloud.connectors.v1.ListRuntimeEntitySchemasResponse.verify|verify} messages. + * @param message ListRuntimeEntitySchemasResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.connectors.v1.IListRuntimeEntitySchemasResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListRuntimeEntitySchemasResponse message, length delimited. Does not implicitly {@link google.cloud.connectors.v1.ListRuntimeEntitySchemasResponse.verify|verify} messages. + * @param message ListRuntimeEntitySchemasResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.connectors.v1.IListRuntimeEntitySchemasResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListRuntimeEntitySchemasResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListRuntimeEntitySchemasResponse + * @throws {Error} If the payload is not 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.connectors.v1.ListRuntimeEntitySchemasResponse; + + /** + * Decodes a ListRuntimeEntitySchemasResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListRuntimeEntitySchemasResponse + * @throws {Error} If the payload 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.connectors.v1.ListRuntimeEntitySchemasResponse; + + /** + * Verifies a ListRuntimeEntitySchemasResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListRuntimeEntitySchemasResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListRuntimeEntitySchemasResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.connectors.v1.ListRuntimeEntitySchemasResponse; + + /** + * Creates a plain object from a ListRuntimeEntitySchemasResponse message. Also converts values to other types if specified. + * @param message ListRuntimeEntitySchemasResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.connectors.v1.ListRuntimeEntitySchemasResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListRuntimeEntitySchemasResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListRuntimeEntitySchemasResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListRuntimeActionSchemasRequest. */ + interface IListRuntimeActionSchemasRequest { + + /** ListRuntimeActionSchemasRequest parent */ + parent?: (string|null); + + /** ListRuntimeActionSchemasRequest pageSize */ + pageSize?: (number|null); + + /** ListRuntimeActionSchemasRequest pageToken */ + pageToken?: (string|null); + + /** ListRuntimeActionSchemasRequest filter */ + filter?: (string|null); + } + + /** Represents a ListRuntimeActionSchemasRequest. */ + class ListRuntimeActionSchemasRequest implements IListRuntimeActionSchemasRequest { + + /** + * Constructs a new ListRuntimeActionSchemasRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.connectors.v1.IListRuntimeActionSchemasRequest); + + /** ListRuntimeActionSchemasRequest parent. */ + public parent: string; + + /** ListRuntimeActionSchemasRequest pageSize. */ + public pageSize: number; + + /** ListRuntimeActionSchemasRequest pageToken. */ + public pageToken: string; + + /** ListRuntimeActionSchemasRequest filter. */ + public filter: string; + + /** + * Creates a new ListRuntimeActionSchemasRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ListRuntimeActionSchemasRequest instance + */ + public static create(properties?: google.cloud.connectors.v1.IListRuntimeActionSchemasRequest): google.cloud.connectors.v1.ListRuntimeActionSchemasRequest; + + /** + * Encodes the specified ListRuntimeActionSchemasRequest message. Does not implicitly {@link google.cloud.connectors.v1.ListRuntimeActionSchemasRequest.verify|verify} messages. + * @param message ListRuntimeActionSchemasRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.connectors.v1.IListRuntimeActionSchemasRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListRuntimeActionSchemasRequest message, length delimited. Does not implicitly {@link google.cloud.connectors.v1.ListRuntimeActionSchemasRequest.verify|verify} messages. + * @param message ListRuntimeActionSchemasRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.connectors.v1.IListRuntimeActionSchemasRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListRuntimeActionSchemasRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListRuntimeActionSchemasRequest + * @throws {Error} If the payload is not 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.connectors.v1.ListRuntimeActionSchemasRequest; + + /** + * Decodes a ListRuntimeActionSchemasRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListRuntimeActionSchemasRequest + * @throws {Error} If the payload 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.connectors.v1.ListRuntimeActionSchemasRequest; + + /** + * Verifies a ListRuntimeActionSchemasRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListRuntimeActionSchemasRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListRuntimeActionSchemasRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.connectors.v1.ListRuntimeActionSchemasRequest; + + /** + * Creates a plain object from a ListRuntimeActionSchemasRequest message. Also converts values to other types if specified. + * @param message ListRuntimeActionSchemasRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.connectors.v1.ListRuntimeActionSchemasRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListRuntimeActionSchemasRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListRuntimeActionSchemasRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListRuntimeActionSchemasResponse. */ + interface IListRuntimeActionSchemasResponse { + + /** ListRuntimeActionSchemasResponse runtimeActionSchemas */ + runtimeActionSchemas?: (google.cloud.connectors.v1.IRuntimeActionSchema[]|null); + + /** ListRuntimeActionSchemasResponse nextPageToken */ + nextPageToken?: (string|null); + } + + /** Represents a ListRuntimeActionSchemasResponse. */ + class ListRuntimeActionSchemasResponse implements IListRuntimeActionSchemasResponse { + + /** + * Constructs a new ListRuntimeActionSchemasResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.connectors.v1.IListRuntimeActionSchemasResponse); + + /** ListRuntimeActionSchemasResponse runtimeActionSchemas. */ + public runtimeActionSchemas: google.cloud.connectors.v1.IRuntimeActionSchema[]; + + /** ListRuntimeActionSchemasResponse nextPageToken. */ + public nextPageToken: string; + + /** + * Creates a new ListRuntimeActionSchemasResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ListRuntimeActionSchemasResponse instance + */ + public static create(properties?: google.cloud.connectors.v1.IListRuntimeActionSchemasResponse): google.cloud.connectors.v1.ListRuntimeActionSchemasResponse; + + /** + * Encodes the specified ListRuntimeActionSchemasResponse message. Does not implicitly {@link google.cloud.connectors.v1.ListRuntimeActionSchemasResponse.verify|verify} messages. + * @param message ListRuntimeActionSchemasResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.connectors.v1.IListRuntimeActionSchemasResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListRuntimeActionSchemasResponse message, length delimited. Does not implicitly {@link google.cloud.connectors.v1.ListRuntimeActionSchemasResponse.verify|verify} messages. + * @param message ListRuntimeActionSchemasResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.connectors.v1.IListRuntimeActionSchemasResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListRuntimeActionSchemasResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListRuntimeActionSchemasResponse + * @throws {Error} If the payload is not 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.connectors.v1.ListRuntimeActionSchemasResponse; + + /** + * Decodes a ListRuntimeActionSchemasResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListRuntimeActionSchemasResponse + * @throws {Error} If the payload 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.connectors.v1.ListRuntimeActionSchemasResponse; + + /** + * Verifies a ListRuntimeActionSchemasResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListRuntimeActionSchemasResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListRuntimeActionSchemasResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.connectors.v1.ListRuntimeActionSchemasResponse; + + /** + * Creates a plain object from a ListRuntimeActionSchemasResponse message. Also converts values to other types if specified. + * @param message ListRuntimeActionSchemasResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.connectors.v1.ListRuntimeActionSchemasResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListRuntimeActionSchemasResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListRuntimeActionSchemasResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ConnectionStatus. */ + interface IConnectionStatus { + + /** ConnectionStatus state */ + state?: (google.cloud.connectors.v1.ConnectionStatus.State|keyof typeof google.cloud.connectors.v1.ConnectionStatus.State|null); + + /** ConnectionStatus description */ + description?: (string|null); + + /** ConnectionStatus status */ + status?: (string|null); + } + + /** Represents a ConnectionStatus. */ + class ConnectionStatus implements IConnectionStatus { + + /** + * Constructs a new ConnectionStatus. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.connectors.v1.IConnectionStatus); + + /** ConnectionStatus state. */ + public state: (google.cloud.connectors.v1.ConnectionStatus.State|keyof typeof google.cloud.connectors.v1.ConnectionStatus.State); + + /** ConnectionStatus description. */ + public description: string; + + /** ConnectionStatus status. */ + public status: string; + + /** + * Creates a new ConnectionStatus instance using the specified properties. + * @param [properties] Properties to set + * @returns ConnectionStatus instance + */ + public static create(properties?: google.cloud.connectors.v1.IConnectionStatus): google.cloud.connectors.v1.ConnectionStatus; + + /** + * Encodes the specified ConnectionStatus message. Does not implicitly {@link google.cloud.connectors.v1.ConnectionStatus.verify|verify} messages. + * @param message ConnectionStatus message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.connectors.v1.IConnectionStatus, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ConnectionStatus message, length delimited. Does not implicitly {@link google.cloud.connectors.v1.ConnectionStatus.verify|verify} messages. + * @param message ConnectionStatus message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.connectors.v1.IConnectionStatus, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ConnectionStatus message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ConnectionStatus + * @throws {Error} If the payload is not 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.connectors.v1.ConnectionStatus; + + /** + * Decodes a ConnectionStatus message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ConnectionStatus + * @throws {Error} If the payload 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.connectors.v1.ConnectionStatus; + + /** + * Verifies a ConnectionStatus message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ConnectionStatus message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ConnectionStatus + */ + public static fromObject(object: { [k: string]: any }): google.cloud.connectors.v1.ConnectionStatus; + + /** + * Creates a plain object from a ConnectionStatus message. Also converts values to other types if specified. + * @param message ConnectionStatus + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.connectors.v1.ConnectionStatus, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ConnectionStatus to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ConnectionStatus + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace ConnectionStatus { + + /** State enum. */ + enum State { + STATE_UNSPECIFIED = 0, + CREATING = 1, + ACTIVE = 2, + INACTIVE = 3, + DELETING = 4, + UPDATING = 5, + ERROR = 6, + AUTHORIZATION_REQUIRED = 7 + } + } + + /** DataType enum. */ + enum DataType { + DATA_TYPE_UNSPECIFIED = 0, + DATA_TYPE_INT = 1, + DATA_TYPE_SMALLINT = 2, + DATA_TYPE_DOUBLE = 3, + DATA_TYPE_DATE = 4, + DATA_TYPE_DATETIME = 5, + DATA_TYPE_TIME = 6, + DATA_TYPE_STRING = 7, + DATA_TYPE_LONG = 8, + DATA_TYPE_BOOLEAN = 9, + DATA_TYPE_DECIMAL = 10, + DATA_TYPE_UUID = 11, + DATA_TYPE_BLOB = 12, + DATA_TYPE_BIT = 13, + DATA_TYPE_TINYINT = 14, + DATA_TYPE_INTEGER = 15, + DATA_TYPE_BIGINT = 16, + DATA_TYPE_FLOAT = 17, + DATA_TYPE_REAL = 18, + DATA_TYPE_NUMERIC = 19, + DATA_TYPE_CHAR = 20, + DATA_TYPE_VARCHAR = 21, + DATA_TYPE_LONGVARCHAR = 22, + DATA_TYPE_TIMESTAMP = 23, + DATA_TYPE_NCHAR = 24, + DATA_TYPE_NVARCHAR = 25, + DATA_TYPE_LONGNVARCHAR = 26, + DATA_TYPE_NULL = 27, + DATA_TYPE_OTHER = 28, + DATA_TYPE_JAVA_OBJECT = 29, + DATA_TYPE_DISTINCT = 30, + DATA_TYPE_STRUCT = 31, + DATA_TYPE_ARRAY = 32, + DATA_TYPE_CLOB = 33, + DATA_TYPE_REF = 34, + DATA_TYPE_DATALINK = 35, + DATA_TYPE_ROWID = 36, + DATA_TYPE_BINARY = 37, + DATA_TYPE_VARBINARY = 38, + DATA_TYPE_LONGVARBINARY = 39, + DATA_TYPE_NCLOB = 40, + DATA_TYPE_SQLXML = 41, + DATA_TYPE_REF_CURSOR = 42, + DATA_TYPE_TIME_WITH_TIMEZONE = 43, + DATA_TYPE_TIMESTAMP_WITH_TIMEZONE = 44 + } + + /** ConnectionView enum. */ + enum ConnectionView { + CONNECTION_VIEW_UNSPECIFIED = 0, + BASIC = 1, + FULL = 2 + } + + /** Properties of a DestinationConfig. */ + interface IDestinationConfig { + + /** DestinationConfig key */ + key?: (string|null); + + /** DestinationConfig destinations */ + destinations?: (google.cloud.connectors.v1.IDestination[]|null); + } + + /** Represents a DestinationConfig. */ + class DestinationConfig implements IDestinationConfig { + + /** + * Constructs a new DestinationConfig. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.connectors.v1.IDestinationConfig); + + /** DestinationConfig key. */ + public key: string; + + /** DestinationConfig destinations. */ + public destinations: google.cloud.connectors.v1.IDestination[]; + + /** + * Creates a new DestinationConfig instance using the specified properties. + * @param [properties] Properties to set + * @returns DestinationConfig instance + */ + public static create(properties?: google.cloud.connectors.v1.IDestinationConfig): google.cloud.connectors.v1.DestinationConfig; + + /** + * Encodes the specified DestinationConfig message. Does not implicitly {@link google.cloud.connectors.v1.DestinationConfig.verify|verify} messages. + * @param message DestinationConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.connectors.v1.IDestinationConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DestinationConfig message, length delimited. Does not implicitly {@link google.cloud.connectors.v1.DestinationConfig.verify|verify} messages. + * @param message DestinationConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.connectors.v1.IDestinationConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DestinationConfig message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DestinationConfig + * @throws {Error} If the payload is not 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.connectors.v1.DestinationConfig; + + /** + * Decodes a DestinationConfig message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DestinationConfig + * @throws {Error} If the payload 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.connectors.v1.DestinationConfig; + + /** + * Verifies a DestinationConfig message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DestinationConfig message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DestinationConfig + */ + public static fromObject(object: { [k: string]: any }): google.cloud.connectors.v1.DestinationConfig; + + /** + * Creates a plain object from a DestinationConfig message. Also converts values to other types if specified. + * @param message DestinationConfig + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.connectors.v1.DestinationConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DestinationConfig to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DestinationConfig + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Destination. */ + interface IDestination { + + /** Destination serviceAttachment */ + serviceAttachment?: (string|null); + + /** Destination host */ + host?: (string|null); + + /** Destination port */ + port?: (number|null); + } + + /** Represents a Destination. */ + class Destination implements IDestination { + + /** + * Constructs a new Destination. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.connectors.v1.IDestination); + + /** Destination serviceAttachment. */ + public serviceAttachment?: (string|null); + + /** Destination host. */ + public host?: (string|null); + + /** Destination port. */ + public port: number; + + /** Destination destination. */ + public destination?: ("serviceAttachment"|"host"); + + /** + * Creates a new Destination instance using the specified properties. + * @param [properties] Properties to set + * @returns Destination instance + */ + public static create(properties?: google.cloud.connectors.v1.IDestination): google.cloud.connectors.v1.Destination; + + /** + * Encodes the specified Destination message. Does not implicitly {@link google.cloud.connectors.v1.Destination.verify|verify} messages. + * @param message Destination message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.connectors.v1.IDestination, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Destination message, length delimited. Does not implicitly {@link google.cloud.connectors.v1.Destination.verify|verify} messages. + * @param message Destination message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.connectors.v1.IDestination, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Destination message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Destination + * @throws {Error} If the payload is not 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.connectors.v1.Destination; + + /** + * Decodes a Destination message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Destination + * @throws {Error} If the payload 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.connectors.v1.Destination; + + /** + * Verifies a Destination message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Destination message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Destination + */ + public static fromObject(object: { [k: string]: any }): google.cloud.connectors.v1.Destination; + + /** + * Creates a plain object from a Destination message. Also converts values to other types if specified. + * @param message Destination + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.connectors.v1.Destination, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Destination to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Destination + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a SslConfigTemplate. */ + interface ISslConfigTemplate { + + /** SslConfigTemplate sslType */ + sslType?: (google.cloud.connectors.v1.SslType|keyof typeof google.cloud.connectors.v1.SslType|null); + + /** SslConfigTemplate isTlsMandatory */ + isTlsMandatory?: (boolean|null); + + /** SslConfigTemplate serverCertType */ + serverCertType?: (google.cloud.connectors.v1.CertType[]|null); + + /** SslConfigTemplate clientCertType */ + clientCertType?: (google.cloud.connectors.v1.CertType[]|null); + + /** SslConfigTemplate additionalVariables */ + additionalVariables?: (google.cloud.connectors.v1.IConfigVariableTemplate[]|null); + } + + /** Represents a SslConfigTemplate. */ + class SslConfigTemplate implements ISslConfigTemplate { + + /** + * Constructs a new SslConfigTemplate. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.connectors.v1.ISslConfigTemplate); + + /** SslConfigTemplate sslType. */ + public sslType: (google.cloud.connectors.v1.SslType|keyof typeof google.cloud.connectors.v1.SslType); + + /** SslConfigTemplate isTlsMandatory. */ + public isTlsMandatory: boolean; + + /** SslConfigTemplate serverCertType. */ + public serverCertType: google.cloud.connectors.v1.CertType[]; + + /** SslConfigTemplate clientCertType. */ + public clientCertType: google.cloud.connectors.v1.CertType[]; + + /** SslConfigTemplate additionalVariables. */ + public additionalVariables: google.cloud.connectors.v1.IConfigVariableTemplate[]; + + /** + * Creates a new SslConfigTemplate instance using the specified properties. + * @param [properties] Properties to set + * @returns SslConfigTemplate instance + */ + public static create(properties?: google.cloud.connectors.v1.ISslConfigTemplate): google.cloud.connectors.v1.SslConfigTemplate; + + /** + * Encodes the specified SslConfigTemplate message. Does not implicitly {@link google.cloud.connectors.v1.SslConfigTemplate.verify|verify} messages. + * @param message SslConfigTemplate message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.connectors.v1.ISslConfigTemplate, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified SslConfigTemplate message, length delimited. Does not implicitly {@link google.cloud.connectors.v1.SslConfigTemplate.verify|verify} messages. + * @param message SslConfigTemplate message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.connectors.v1.ISslConfigTemplate, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SslConfigTemplate message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns SslConfigTemplate + * @throws {Error} If the payload is not 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.connectors.v1.SslConfigTemplate; + + /** + * Decodes a SslConfigTemplate message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns SslConfigTemplate + * @throws {Error} If the payload 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.connectors.v1.SslConfigTemplate; + + /** + * Verifies a SslConfigTemplate message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a SslConfigTemplate message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns SslConfigTemplate + */ + public static fromObject(object: { [k: string]: any }): google.cloud.connectors.v1.SslConfigTemplate; + + /** + * Creates a plain object from a SslConfigTemplate message. Also converts values to other types if specified. + * @param message SslConfigTemplate + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.connectors.v1.SslConfigTemplate, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this SslConfigTemplate to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for SslConfigTemplate + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a SslConfig. */ + interface ISslConfig { + + /** SslConfig type */ + type?: (google.cloud.connectors.v1.SslType|keyof typeof google.cloud.connectors.v1.SslType|null); + + /** SslConfig trustModel */ + trustModel?: (google.cloud.connectors.v1.SslConfig.TrustModel|keyof typeof google.cloud.connectors.v1.SslConfig.TrustModel|null); + + /** SslConfig privateServerCertificate */ + privateServerCertificate?: (google.cloud.connectors.v1.ISecret|null); + + /** SslConfig clientCertificate */ + clientCertificate?: (google.cloud.connectors.v1.ISecret|null); + + /** SslConfig clientPrivateKey */ + clientPrivateKey?: (google.cloud.connectors.v1.ISecret|null); + + /** SslConfig clientPrivateKeyPass */ + clientPrivateKeyPass?: (google.cloud.connectors.v1.ISecret|null); + + /** SslConfig serverCertType */ + serverCertType?: (google.cloud.connectors.v1.CertType|keyof typeof google.cloud.connectors.v1.CertType|null); + + /** SslConfig clientCertType */ + clientCertType?: (google.cloud.connectors.v1.CertType|keyof typeof google.cloud.connectors.v1.CertType|null); + + /** SslConfig useSsl */ + useSsl?: (boolean|null); + + /** SslConfig additionalVariables */ + additionalVariables?: (google.cloud.connectors.v1.IConfigVariable[]|null); + } + + /** Represents a SslConfig. */ + class SslConfig implements ISslConfig { + + /** + * Constructs a new SslConfig. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.connectors.v1.ISslConfig); + + /** SslConfig type. */ + public type: (google.cloud.connectors.v1.SslType|keyof typeof google.cloud.connectors.v1.SslType); + + /** SslConfig trustModel. */ + public trustModel: (google.cloud.connectors.v1.SslConfig.TrustModel|keyof typeof google.cloud.connectors.v1.SslConfig.TrustModel); + + /** SslConfig privateServerCertificate. */ + public privateServerCertificate?: (google.cloud.connectors.v1.ISecret|null); + + /** SslConfig clientCertificate. */ + public clientCertificate?: (google.cloud.connectors.v1.ISecret|null); + + /** SslConfig clientPrivateKey. */ + public clientPrivateKey?: (google.cloud.connectors.v1.ISecret|null); + + /** SslConfig clientPrivateKeyPass. */ + public clientPrivateKeyPass?: (google.cloud.connectors.v1.ISecret|null); + + /** SslConfig serverCertType. */ + public serverCertType: (google.cloud.connectors.v1.CertType|keyof typeof google.cloud.connectors.v1.CertType); + + /** SslConfig clientCertType. */ + public clientCertType: (google.cloud.connectors.v1.CertType|keyof typeof google.cloud.connectors.v1.CertType); + + /** SslConfig useSsl. */ + public useSsl: boolean; + + /** SslConfig additionalVariables. */ + public additionalVariables: google.cloud.connectors.v1.IConfigVariable[]; + + /** + * Creates a new SslConfig instance using the specified properties. + * @param [properties] Properties to set + * @returns SslConfig instance + */ + public static create(properties?: google.cloud.connectors.v1.ISslConfig): google.cloud.connectors.v1.SslConfig; + + /** + * Encodes the specified SslConfig message. Does not implicitly {@link google.cloud.connectors.v1.SslConfig.verify|verify} messages. + * @param message SslConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.connectors.v1.ISslConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified SslConfig message, length delimited. Does not implicitly {@link google.cloud.connectors.v1.SslConfig.verify|verify} messages. + * @param message SslConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.connectors.v1.ISslConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SslConfig message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns SslConfig + * @throws {Error} If the payload is not 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.connectors.v1.SslConfig; + + /** + * Decodes a SslConfig message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns SslConfig + * @throws {Error} If the payload 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.connectors.v1.SslConfig; + + /** + * Verifies a SslConfig message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a SslConfig message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns SslConfig + */ + public static fromObject(object: { [k: string]: any }): google.cloud.connectors.v1.SslConfig; + + /** + * Creates a plain object from a SslConfig message. Also converts values to other types if specified. + * @param message SslConfig + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.connectors.v1.SslConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this SslConfig to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for SslConfig + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace SslConfig { + + /** TrustModel enum. */ + enum TrustModel { + PUBLIC = 0, + PRIVATE = 1, + INSECURE = 2 + } + } + + /** SslType enum. */ + enum SslType { + SSL_TYPE_UNSPECIFIED = 0, + TLS = 1, + MTLS = 2 + } + + /** CertType enum. */ + enum CertType { + CERT_TYPE_UNSPECIFIED = 0, + PEM = 1 + } + + /** Properties of a Connector. */ + interface IConnector { + + /** Connector name */ + name?: (string|null); + + /** Connector createTime */ + createTime?: (google.protobuf.ITimestamp|null); + + /** Connector updateTime */ + updateTime?: (google.protobuf.ITimestamp|null); + + /** Connector labels */ + labels?: ({ [k: string]: string }|null); + + /** Connector documentationUri */ + documentationUri?: (string|null); + + /** Connector externalUri */ + externalUri?: (string|null); + + /** Connector description */ + description?: (string|null); + + /** Connector webAssetsLocation */ + webAssetsLocation?: (string|null); + + /** Connector displayName */ + displayName?: (string|null); + + /** Connector launchStage */ + launchStage?: (google.cloud.connectors.v1.LaunchStage|keyof typeof google.cloud.connectors.v1.LaunchStage|null); + } + + /** Represents a Connector. */ + class Connector implements IConnector { + + /** + * Constructs a new Connector. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.connectors.v1.IConnector); + + /** Connector name. */ + public name: string; + + /** Connector createTime. */ + public createTime?: (google.protobuf.ITimestamp|null); + + /** Connector updateTime. */ + public updateTime?: (google.protobuf.ITimestamp|null); + + /** Connector labels. */ + public labels: { [k: string]: string }; + + /** Connector documentationUri. */ + public documentationUri: string; + + /** Connector externalUri. */ + public externalUri: string; + + /** Connector description. */ + public description: string; + + /** Connector webAssetsLocation. */ + public webAssetsLocation: string; + + /** Connector displayName. */ + public displayName: string; + + /** Connector launchStage. */ + public launchStage: (google.cloud.connectors.v1.LaunchStage|keyof typeof google.cloud.connectors.v1.LaunchStage); + + /** + * Creates a new Connector instance using the specified properties. + * @param [properties] Properties to set + * @returns Connector instance + */ + public static create(properties?: google.cloud.connectors.v1.IConnector): google.cloud.connectors.v1.Connector; + + /** + * Encodes the specified Connector message. Does not implicitly {@link google.cloud.connectors.v1.Connector.verify|verify} messages. + * @param message Connector message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.connectors.v1.IConnector, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Connector message, length delimited. Does not implicitly {@link google.cloud.connectors.v1.Connector.verify|verify} messages. + * @param message Connector message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.connectors.v1.IConnector, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Connector message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Connector + * @throws {Error} If the payload is not 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.connectors.v1.Connector; + + /** + * Decodes a Connector message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Connector + * @throws {Error} If the payload 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.connectors.v1.Connector; + + /** + * Verifies a Connector message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Connector message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Connector + */ + public static fromObject(object: { [k: string]: any }): google.cloud.connectors.v1.Connector; + + /** + * Creates a plain object from a Connector message. Also converts values to other types if specified. + * @param message Connector + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.connectors.v1.Connector, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Connector to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Connector + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a GetConnectorRequest. */ + interface IGetConnectorRequest { + + /** GetConnectorRequest name */ + name?: (string|null); + } + + /** Represents a GetConnectorRequest. */ + class GetConnectorRequest implements IGetConnectorRequest { + + /** + * Constructs a new GetConnectorRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.connectors.v1.IGetConnectorRequest); + + /** GetConnectorRequest name. */ + public name: string; + + /** + * Creates a new GetConnectorRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GetConnectorRequest instance + */ + public static create(properties?: google.cloud.connectors.v1.IGetConnectorRequest): google.cloud.connectors.v1.GetConnectorRequest; + + /** + * Encodes the specified GetConnectorRequest message. Does not implicitly {@link google.cloud.connectors.v1.GetConnectorRequest.verify|verify} messages. + * @param message GetConnectorRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.connectors.v1.IGetConnectorRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GetConnectorRequest message, length delimited. Does not implicitly {@link google.cloud.connectors.v1.GetConnectorRequest.verify|verify} messages. + * @param message GetConnectorRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.connectors.v1.IGetConnectorRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GetConnectorRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GetConnectorRequest + * @throws {Error} If the payload is not 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.connectors.v1.GetConnectorRequest; + + /** + * Decodes a GetConnectorRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GetConnectorRequest + * @throws {Error} If the payload 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.connectors.v1.GetConnectorRequest; + + /** + * Verifies a GetConnectorRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GetConnectorRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GetConnectorRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.connectors.v1.GetConnectorRequest; + + /** + * Creates a plain object from a GetConnectorRequest message. Also converts values to other types if specified. + * @param message GetConnectorRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.connectors.v1.GetConnectorRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GetConnectorRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GetConnectorRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListConnectorsRequest. */ + interface IListConnectorsRequest { + + /** ListConnectorsRequest parent */ + parent?: (string|null); + + /** ListConnectorsRequest pageSize */ + pageSize?: (number|null); + + /** ListConnectorsRequest pageToken */ + pageToken?: (string|null); + } + + /** Represents a ListConnectorsRequest. */ + class ListConnectorsRequest implements IListConnectorsRequest { + + /** + * Constructs a new ListConnectorsRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.connectors.v1.IListConnectorsRequest); + + /** ListConnectorsRequest parent. */ + public parent: string; + + /** ListConnectorsRequest pageSize. */ + public pageSize: number; + + /** ListConnectorsRequest pageToken. */ + public pageToken: string; + + /** + * Creates a new ListConnectorsRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ListConnectorsRequest instance + */ + public static create(properties?: google.cloud.connectors.v1.IListConnectorsRequest): google.cloud.connectors.v1.ListConnectorsRequest; + + /** + * Encodes the specified ListConnectorsRequest message. Does not implicitly {@link google.cloud.connectors.v1.ListConnectorsRequest.verify|verify} messages. + * @param message ListConnectorsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.connectors.v1.IListConnectorsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListConnectorsRequest message, length delimited. Does not implicitly {@link google.cloud.connectors.v1.ListConnectorsRequest.verify|verify} messages. + * @param message ListConnectorsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.connectors.v1.IListConnectorsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListConnectorsRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListConnectorsRequest + * @throws {Error} If the payload is not 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.connectors.v1.ListConnectorsRequest; + + /** + * Decodes a ListConnectorsRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListConnectorsRequest + * @throws {Error} If the payload 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.connectors.v1.ListConnectorsRequest; + + /** + * Verifies a ListConnectorsRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListConnectorsRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListConnectorsRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.connectors.v1.ListConnectorsRequest; + + /** + * Creates a plain object from a ListConnectorsRequest message. Also converts values to other types if specified. + * @param message ListConnectorsRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.connectors.v1.ListConnectorsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListConnectorsRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListConnectorsRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListConnectorsResponse. */ + interface IListConnectorsResponse { + + /** ListConnectorsResponse connectors */ + connectors?: (google.cloud.connectors.v1.IConnector[]|null); + + /** ListConnectorsResponse nextPageToken */ + nextPageToken?: (string|null); + + /** ListConnectorsResponse unreachable */ + unreachable?: (string[]|null); + } + + /** Represents a ListConnectorsResponse. */ + class ListConnectorsResponse implements IListConnectorsResponse { + + /** + * Constructs a new ListConnectorsResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.connectors.v1.IListConnectorsResponse); + + /** ListConnectorsResponse connectors. */ + public connectors: google.cloud.connectors.v1.IConnector[]; + + /** ListConnectorsResponse nextPageToken. */ + public nextPageToken: string; + + /** ListConnectorsResponse unreachable. */ + public unreachable: string[]; + + /** + * Creates a new ListConnectorsResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ListConnectorsResponse instance + */ + public static create(properties?: google.cloud.connectors.v1.IListConnectorsResponse): google.cloud.connectors.v1.ListConnectorsResponse; + + /** + * Encodes the specified ListConnectorsResponse message. Does not implicitly {@link google.cloud.connectors.v1.ListConnectorsResponse.verify|verify} messages. + * @param message ListConnectorsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.connectors.v1.IListConnectorsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListConnectorsResponse message, length delimited. Does not implicitly {@link google.cloud.connectors.v1.ListConnectorsResponse.verify|verify} messages. + * @param message ListConnectorsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.connectors.v1.IListConnectorsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListConnectorsResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListConnectorsResponse + * @throws {Error} If the payload is not 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.connectors.v1.ListConnectorsResponse; + + /** + * Decodes a ListConnectorsResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListConnectorsResponse + * @throws {Error} If the payload 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.connectors.v1.ListConnectorsResponse; + + /** + * Verifies a ListConnectorsResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListConnectorsResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListConnectorsResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.connectors.v1.ListConnectorsResponse; + + /** + * Creates a plain object from a ListConnectorsResponse message. Also converts values to other types if specified. + * @param message ListConnectorsResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.connectors.v1.ListConnectorsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListConnectorsResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListConnectorsResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ConnectorVersion. */ + interface IConnectorVersion { + + /** ConnectorVersion name */ + name?: (string|null); + + /** ConnectorVersion createTime */ + createTime?: (google.protobuf.ITimestamp|null); + + /** ConnectorVersion updateTime */ + updateTime?: (google.protobuf.ITimestamp|null); + + /** ConnectorVersion labels */ + labels?: ({ [k: string]: string }|null); + + /** ConnectorVersion launchStage */ + launchStage?: (google.cloud.connectors.v1.LaunchStage|keyof typeof google.cloud.connectors.v1.LaunchStage|null); + + /** ConnectorVersion releaseVersion */ + releaseVersion?: (string|null); + + /** ConnectorVersion authConfigTemplates */ + authConfigTemplates?: (google.cloud.connectors.v1.IAuthConfigTemplate[]|null); + + /** ConnectorVersion configVariableTemplates */ + configVariableTemplates?: (google.cloud.connectors.v1.IConfigVariableTemplate[]|null); + + /** ConnectorVersion supportedRuntimeFeatures */ + supportedRuntimeFeatures?: (google.cloud.connectors.v1.ISupportedRuntimeFeatures|null); + + /** ConnectorVersion displayName */ + displayName?: (string|null); + + /** ConnectorVersion egressControlConfig */ + egressControlConfig?: (google.cloud.connectors.v1.IEgressControlConfig|null); + + /** ConnectorVersion roleGrants */ + roleGrants?: (google.cloud.connectors.v1.IRoleGrant[]|null); + + /** ConnectorVersion roleGrant */ + roleGrant?: (google.cloud.connectors.v1.IRoleGrant|null); + + /** ConnectorVersion sslConfigTemplate */ + sslConfigTemplate?: (google.cloud.connectors.v1.ISslConfigTemplate|null); + } + + /** Represents a ConnectorVersion. */ + class ConnectorVersion implements IConnectorVersion { + + /** + * Constructs a new ConnectorVersion. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.connectors.v1.IConnectorVersion); + + /** ConnectorVersion name. */ + public name: string; + + /** ConnectorVersion createTime. */ + public createTime?: (google.protobuf.ITimestamp|null); + + /** ConnectorVersion updateTime. */ + public updateTime?: (google.protobuf.ITimestamp|null); + + /** ConnectorVersion labels. */ + public labels: { [k: string]: string }; + + /** ConnectorVersion launchStage. */ + public launchStage: (google.cloud.connectors.v1.LaunchStage|keyof typeof google.cloud.connectors.v1.LaunchStage); + + /** ConnectorVersion releaseVersion. */ + public releaseVersion: string; + + /** ConnectorVersion authConfigTemplates. */ + public authConfigTemplates: google.cloud.connectors.v1.IAuthConfigTemplate[]; + + /** ConnectorVersion configVariableTemplates. */ + public configVariableTemplates: google.cloud.connectors.v1.IConfigVariableTemplate[]; + + /** ConnectorVersion supportedRuntimeFeatures. */ + public supportedRuntimeFeatures?: (google.cloud.connectors.v1.ISupportedRuntimeFeatures|null); + + /** ConnectorVersion displayName. */ + public displayName: string; + + /** ConnectorVersion egressControlConfig. */ + public egressControlConfig?: (google.cloud.connectors.v1.IEgressControlConfig|null); + + /** ConnectorVersion roleGrants. */ + public roleGrants: google.cloud.connectors.v1.IRoleGrant[]; + + /** ConnectorVersion roleGrant. */ + public roleGrant?: (google.cloud.connectors.v1.IRoleGrant|null); + + /** ConnectorVersion sslConfigTemplate. */ + public sslConfigTemplate?: (google.cloud.connectors.v1.ISslConfigTemplate|null); + + /** + * Creates a new ConnectorVersion instance using the specified properties. + * @param [properties] Properties to set + * @returns ConnectorVersion instance + */ + public static create(properties?: google.cloud.connectors.v1.IConnectorVersion): google.cloud.connectors.v1.ConnectorVersion; + + /** + * Encodes the specified ConnectorVersion message. Does not implicitly {@link google.cloud.connectors.v1.ConnectorVersion.verify|verify} messages. + * @param message ConnectorVersion message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.connectors.v1.IConnectorVersion, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ConnectorVersion message, length delimited. Does not implicitly {@link google.cloud.connectors.v1.ConnectorVersion.verify|verify} messages. + * @param message ConnectorVersion message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.connectors.v1.IConnectorVersion, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ConnectorVersion message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ConnectorVersion + * @throws {Error} If the payload is not 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.connectors.v1.ConnectorVersion; + + /** + * Decodes a ConnectorVersion message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ConnectorVersion + * @throws {Error} If the payload 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.connectors.v1.ConnectorVersion; + + /** + * Verifies a ConnectorVersion message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ConnectorVersion message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ConnectorVersion + */ + public static fromObject(object: { [k: string]: any }): google.cloud.connectors.v1.ConnectorVersion; + + /** + * Creates a plain object from a ConnectorVersion message. Also converts values to other types if specified. + * @param message ConnectorVersion + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.connectors.v1.ConnectorVersion, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ConnectorVersion to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ConnectorVersion + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a GetConnectorVersionRequest. */ + interface IGetConnectorVersionRequest { + + /** GetConnectorVersionRequest name */ + name?: (string|null); + + /** GetConnectorVersionRequest view */ + view?: (google.cloud.connectors.v1.ConnectorVersionView|keyof typeof google.cloud.connectors.v1.ConnectorVersionView|null); + } + + /** Represents a GetConnectorVersionRequest. */ + class GetConnectorVersionRequest implements IGetConnectorVersionRequest { + + /** + * Constructs a new GetConnectorVersionRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.connectors.v1.IGetConnectorVersionRequest); + + /** GetConnectorVersionRequest name. */ + public name: string; + + /** GetConnectorVersionRequest view. */ + public view: (google.cloud.connectors.v1.ConnectorVersionView|keyof typeof google.cloud.connectors.v1.ConnectorVersionView); + + /** + * Creates a new GetConnectorVersionRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GetConnectorVersionRequest instance + */ + public static create(properties?: google.cloud.connectors.v1.IGetConnectorVersionRequest): google.cloud.connectors.v1.GetConnectorVersionRequest; + + /** + * Encodes the specified GetConnectorVersionRequest message. Does not implicitly {@link google.cloud.connectors.v1.GetConnectorVersionRequest.verify|verify} messages. + * @param message GetConnectorVersionRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.connectors.v1.IGetConnectorVersionRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GetConnectorVersionRequest message, length delimited. Does not implicitly {@link google.cloud.connectors.v1.GetConnectorVersionRequest.verify|verify} messages. + * @param message GetConnectorVersionRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.connectors.v1.IGetConnectorVersionRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GetConnectorVersionRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GetConnectorVersionRequest + * @throws {Error} If the payload is not 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.connectors.v1.GetConnectorVersionRequest; + + /** + * Decodes a GetConnectorVersionRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GetConnectorVersionRequest + * @throws {Error} If the payload 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.connectors.v1.GetConnectorVersionRequest; + + /** + * Verifies a GetConnectorVersionRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GetConnectorVersionRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GetConnectorVersionRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.connectors.v1.GetConnectorVersionRequest; + + /** + * Creates a plain object from a GetConnectorVersionRequest message. Also converts values to other types if specified. + * @param message GetConnectorVersionRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.connectors.v1.GetConnectorVersionRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GetConnectorVersionRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GetConnectorVersionRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListConnectorVersionsRequest. */ + interface IListConnectorVersionsRequest { + + /** ListConnectorVersionsRequest parent */ + parent?: (string|null); + + /** ListConnectorVersionsRequest pageSize */ + pageSize?: (number|null); + + /** ListConnectorVersionsRequest pageToken */ + pageToken?: (string|null); + + /** ListConnectorVersionsRequest view */ + view?: (google.cloud.connectors.v1.ConnectorVersionView|keyof typeof google.cloud.connectors.v1.ConnectorVersionView|null); + } + + /** Represents a ListConnectorVersionsRequest. */ + class ListConnectorVersionsRequest implements IListConnectorVersionsRequest { + + /** + * Constructs a new ListConnectorVersionsRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.connectors.v1.IListConnectorVersionsRequest); + + /** ListConnectorVersionsRequest parent. */ + public parent: string; + + /** ListConnectorVersionsRequest pageSize. */ + public pageSize: number; + + /** ListConnectorVersionsRequest pageToken. */ + public pageToken: string; + + /** ListConnectorVersionsRequest view. */ + public view: (google.cloud.connectors.v1.ConnectorVersionView|keyof typeof google.cloud.connectors.v1.ConnectorVersionView); + + /** + * Creates a new ListConnectorVersionsRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ListConnectorVersionsRequest instance + */ + public static create(properties?: google.cloud.connectors.v1.IListConnectorVersionsRequest): google.cloud.connectors.v1.ListConnectorVersionsRequest; + + /** + * Encodes the specified ListConnectorVersionsRequest message. Does not implicitly {@link google.cloud.connectors.v1.ListConnectorVersionsRequest.verify|verify} messages. + * @param message ListConnectorVersionsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.connectors.v1.IListConnectorVersionsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListConnectorVersionsRequest message, length delimited. Does not implicitly {@link google.cloud.connectors.v1.ListConnectorVersionsRequest.verify|verify} messages. + * @param message ListConnectorVersionsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.connectors.v1.IListConnectorVersionsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListConnectorVersionsRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListConnectorVersionsRequest + * @throws {Error} If the payload is not 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.connectors.v1.ListConnectorVersionsRequest; + + /** + * Decodes a ListConnectorVersionsRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListConnectorVersionsRequest + * @throws {Error} If the payload 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.connectors.v1.ListConnectorVersionsRequest; + + /** + * Verifies a ListConnectorVersionsRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListConnectorVersionsRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListConnectorVersionsRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.connectors.v1.ListConnectorVersionsRequest; + + /** + * Creates a plain object from a ListConnectorVersionsRequest message. Also converts values to other types if specified. + * @param message ListConnectorVersionsRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.connectors.v1.ListConnectorVersionsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListConnectorVersionsRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListConnectorVersionsRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListConnectorVersionsResponse. */ + interface IListConnectorVersionsResponse { + + /** ListConnectorVersionsResponse connectorVersions */ + connectorVersions?: (google.cloud.connectors.v1.IConnectorVersion[]|null); + + /** ListConnectorVersionsResponse nextPageToken */ + nextPageToken?: (string|null); + + /** ListConnectorVersionsResponse unreachable */ + unreachable?: (string[]|null); + } + + /** Represents a ListConnectorVersionsResponse. */ + class ListConnectorVersionsResponse implements IListConnectorVersionsResponse { + + /** + * Constructs a new ListConnectorVersionsResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.connectors.v1.IListConnectorVersionsResponse); + + /** ListConnectorVersionsResponse connectorVersions. */ + public connectorVersions: google.cloud.connectors.v1.IConnectorVersion[]; + + /** ListConnectorVersionsResponse nextPageToken. */ + public nextPageToken: string; + + /** ListConnectorVersionsResponse unreachable. */ + public unreachable: string[]; + + /** + * Creates a new ListConnectorVersionsResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ListConnectorVersionsResponse instance + */ + public static create(properties?: google.cloud.connectors.v1.IListConnectorVersionsResponse): google.cloud.connectors.v1.ListConnectorVersionsResponse; + + /** + * Encodes the specified ListConnectorVersionsResponse message. Does not implicitly {@link google.cloud.connectors.v1.ListConnectorVersionsResponse.verify|verify} messages. + * @param message ListConnectorVersionsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.connectors.v1.IListConnectorVersionsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListConnectorVersionsResponse message, length delimited. Does not implicitly {@link google.cloud.connectors.v1.ListConnectorVersionsResponse.verify|verify} messages. + * @param message ListConnectorVersionsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.connectors.v1.IListConnectorVersionsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListConnectorVersionsResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListConnectorVersionsResponse + * @throws {Error} If the payload is not 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.connectors.v1.ListConnectorVersionsResponse; + + /** + * Decodes a ListConnectorVersionsResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListConnectorVersionsResponse + * @throws {Error} If the payload 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.connectors.v1.ListConnectorVersionsResponse; + + /** + * Verifies a ListConnectorVersionsResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListConnectorVersionsResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListConnectorVersionsResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.connectors.v1.ListConnectorVersionsResponse; + + /** + * Creates a plain object from a ListConnectorVersionsResponse message. Also converts values to other types if specified. + * @param message ListConnectorVersionsResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.connectors.v1.ListConnectorVersionsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListConnectorVersionsResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListConnectorVersionsResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a SupportedRuntimeFeatures. */ + interface ISupportedRuntimeFeatures { + + /** SupportedRuntimeFeatures entityApis */ + entityApis?: (boolean|null); + + /** SupportedRuntimeFeatures actionApis */ + actionApis?: (boolean|null); + + /** SupportedRuntimeFeatures sqlQuery */ + sqlQuery?: (boolean|null); + } + + /** Represents a SupportedRuntimeFeatures. */ + class SupportedRuntimeFeatures implements ISupportedRuntimeFeatures { + + /** + * Constructs a new SupportedRuntimeFeatures. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.connectors.v1.ISupportedRuntimeFeatures); + + /** SupportedRuntimeFeatures entityApis. */ + public entityApis: boolean; + + /** SupportedRuntimeFeatures actionApis. */ + public actionApis: boolean; + + /** SupportedRuntimeFeatures sqlQuery. */ + public sqlQuery: boolean; + + /** + * Creates a new SupportedRuntimeFeatures instance using the specified properties. + * @param [properties] Properties to set + * @returns SupportedRuntimeFeatures instance + */ + public static create(properties?: google.cloud.connectors.v1.ISupportedRuntimeFeatures): google.cloud.connectors.v1.SupportedRuntimeFeatures; + + /** + * Encodes the specified SupportedRuntimeFeatures message. Does not implicitly {@link google.cloud.connectors.v1.SupportedRuntimeFeatures.verify|verify} messages. + * @param message SupportedRuntimeFeatures message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.connectors.v1.ISupportedRuntimeFeatures, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified SupportedRuntimeFeatures message, length delimited. Does not implicitly {@link google.cloud.connectors.v1.SupportedRuntimeFeatures.verify|verify} messages. + * @param message SupportedRuntimeFeatures message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.connectors.v1.ISupportedRuntimeFeatures, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SupportedRuntimeFeatures message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns SupportedRuntimeFeatures + * @throws {Error} If the payload is not 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.connectors.v1.SupportedRuntimeFeatures; + + /** + * Decodes a SupportedRuntimeFeatures message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns SupportedRuntimeFeatures + * @throws {Error} If the payload 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.connectors.v1.SupportedRuntimeFeatures; + + /** + * Verifies a SupportedRuntimeFeatures message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a SupportedRuntimeFeatures message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns SupportedRuntimeFeatures + */ + public static fromObject(object: { [k: string]: any }): google.cloud.connectors.v1.SupportedRuntimeFeatures; + + /** + * Creates a plain object from a SupportedRuntimeFeatures message. Also converts values to other types if specified. + * @param message SupportedRuntimeFeatures + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.connectors.v1.SupportedRuntimeFeatures, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this SupportedRuntimeFeatures to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for SupportedRuntimeFeatures + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an EgressControlConfig. */ + interface IEgressControlConfig { + + /** EgressControlConfig backends */ + backends?: (string|null); + + /** EgressControlConfig extractionRules */ + extractionRules?: (google.cloud.connectors.v1.IExtractionRules|null); + } + + /** Represents an EgressControlConfig. */ + class EgressControlConfig implements IEgressControlConfig { + + /** + * Constructs a new EgressControlConfig. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.connectors.v1.IEgressControlConfig); + + /** EgressControlConfig backends. */ + public backends?: (string|null); + + /** EgressControlConfig extractionRules. */ + public extractionRules?: (google.cloud.connectors.v1.IExtractionRules|null); + + /** EgressControlConfig oneofBackends. */ + public oneofBackends?: ("backends"|"extractionRules"); + + /** + * Creates a new EgressControlConfig instance using the specified properties. + * @param [properties] Properties to set + * @returns EgressControlConfig instance + */ + public static create(properties?: google.cloud.connectors.v1.IEgressControlConfig): google.cloud.connectors.v1.EgressControlConfig; + + /** + * Encodes the specified EgressControlConfig message. Does not implicitly {@link google.cloud.connectors.v1.EgressControlConfig.verify|verify} messages. + * @param message EgressControlConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.connectors.v1.IEgressControlConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified EgressControlConfig message, length delimited. Does not implicitly {@link google.cloud.connectors.v1.EgressControlConfig.verify|verify} messages. + * @param message EgressControlConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.connectors.v1.IEgressControlConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an EgressControlConfig message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns EgressControlConfig + * @throws {Error} If the payload is not 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.connectors.v1.EgressControlConfig; + + /** + * Decodes an EgressControlConfig message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns EgressControlConfig + * @throws {Error} If the payload 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.connectors.v1.EgressControlConfig; + + /** + * Verifies an EgressControlConfig message. + * @param message Plain 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 EgressControlConfig message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns EgressControlConfig + */ + public static fromObject(object: { [k: string]: any }): google.cloud.connectors.v1.EgressControlConfig; + + /** + * Creates a plain object from an EgressControlConfig message. Also converts values to other types if specified. + * @param message EgressControlConfig + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.connectors.v1.EgressControlConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this EgressControlConfig to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for EgressControlConfig + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an ExtractionRules. */ + interface IExtractionRules { + + /** ExtractionRules extractionRule */ + extractionRule?: (google.cloud.connectors.v1.IExtractionRule[]|null); + } + + /** Represents an ExtractionRules. */ + class ExtractionRules implements IExtractionRules { + + /** + * Constructs a new ExtractionRules. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.connectors.v1.IExtractionRules); + + /** ExtractionRules extractionRule. */ + public extractionRule: google.cloud.connectors.v1.IExtractionRule[]; + + /** + * Creates a new ExtractionRules instance using the specified properties. + * @param [properties] Properties to set + * @returns ExtractionRules instance + */ + public static create(properties?: google.cloud.connectors.v1.IExtractionRules): google.cloud.connectors.v1.ExtractionRules; + + /** + * Encodes the specified ExtractionRules message. Does not implicitly {@link google.cloud.connectors.v1.ExtractionRules.verify|verify} messages. + * @param message ExtractionRules message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.connectors.v1.IExtractionRules, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ExtractionRules message, length delimited. Does not implicitly {@link google.cloud.connectors.v1.ExtractionRules.verify|verify} messages. + * @param message ExtractionRules message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.connectors.v1.IExtractionRules, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an ExtractionRules message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ExtractionRules + * @throws {Error} If the payload is not 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.connectors.v1.ExtractionRules; + + /** + * Decodes an ExtractionRules message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ExtractionRules + * @throws {Error} If the payload 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.connectors.v1.ExtractionRules; + + /** + * Verifies an ExtractionRules message. + * @param message Plain 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 ExtractionRules message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ExtractionRules + */ + public static fromObject(object: { [k: string]: any }): google.cloud.connectors.v1.ExtractionRules; + + /** + * Creates a plain object from an ExtractionRules message. Also converts values to other types if specified. + * @param message ExtractionRules + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.connectors.v1.ExtractionRules, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ExtractionRules to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ExtractionRules + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an ExtractionRule. */ + interface IExtractionRule { + + /** ExtractionRule source */ + source?: (google.cloud.connectors.v1.ExtractionRule.ISource|null); + + /** ExtractionRule extractionRegex */ + extractionRegex?: (string|null); + } + + /** Represents an ExtractionRule. */ + class ExtractionRule implements IExtractionRule { + + /** + * Constructs a new ExtractionRule. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.connectors.v1.IExtractionRule); + + /** ExtractionRule source. */ + public source?: (google.cloud.connectors.v1.ExtractionRule.ISource|null); + + /** ExtractionRule extractionRegex. */ + public extractionRegex: string; + + /** + * Creates a new ExtractionRule instance using the specified properties. + * @param [properties] Properties to set + * @returns ExtractionRule instance + */ + public static create(properties?: google.cloud.connectors.v1.IExtractionRule): google.cloud.connectors.v1.ExtractionRule; + + /** + * Encodes the specified ExtractionRule message. Does not implicitly {@link google.cloud.connectors.v1.ExtractionRule.verify|verify} messages. + * @param message ExtractionRule message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.connectors.v1.IExtractionRule, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ExtractionRule message, length delimited. Does not implicitly {@link google.cloud.connectors.v1.ExtractionRule.verify|verify} messages. + * @param message ExtractionRule message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.connectors.v1.IExtractionRule, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an ExtractionRule message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ExtractionRule + * @throws {Error} If the payload is not 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.connectors.v1.ExtractionRule; + + /** + * Decodes an ExtractionRule message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ExtractionRule + * @throws {Error} If the payload 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.connectors.v1.ExtractionRule; + + /** + * Verifies an ExtractionRule message. + * @param message Plain 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 ExtractionRule message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ExtractionRule + */ + public static fromObject(object: { [k: string]: any }): google.cloud.connectors.v1.ExtractionRule; + + /** + * Creates a plain object from an ExtractionRule message. Also converts values to other types if specified. + * @param message ExtractionRule + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.connectors.v1.ExtractionRule, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ExtractionRule to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ExtractionRule + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace ExtractionRule { + + /** Properties of a Source. */ + interface ISource { + + /** Source sourceType */ + sourceType?: (google.cloud.connectors.v1.ExtractionRule.SourceType|keyof typeof google.cloud.connectors.v1.ExtractionRule.SourceType|null); + + /** Source fieldId */ + fieldId?: (string|null); + } + + /** Represents a Source. */ + class Source implements ISource { + + /** + * Constructs a new Source. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.connectors.v1.ExtractionRule.ISource); + + /** Source sourceType. */ + public sourceType: (google.cloud.connectors.v1.ExtractionRule.SourceType|keyof typeof google.cloud.connectors.v1.ExtractionRule.SourceType); + + /** Source fieldId. */ + public fieldId: string; + + /** + * Creates a new Source instance using the specified properties. + * @param [properties] Properties to set + * @returns Source instance + */ + public static create(properties?: google.cloud.connectors.v1.ExtractionRule.ISource): google.cloud.connectors.v1.ExtractionRule.Source; + + /** + * Encodes the specified Source message. Does not implicitly {@link google.cloud.connectors.v1.ExtractionRule.Source.verify|verify} messages. + * @param message Source message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.connectors.v1.ExtractionRule.ISource, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Source message, length delimited. Does not implicitly {@link google.cloud.connectors.v1.ExtractionRule.Source.verify|verify} messages. + * @param message Source message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.connectors.v1.ExtractionRule.ISource, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Source message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Source + * @throws {Error} If the payload is not 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.connectors.v1.ExtractionRule.Source; + + /** + * Decodes a Source message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Source + * @throws {Error} If the payload 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.connectors.v1.ExtractionRule.Source; + + /** + * Verifies a Source message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Source message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Source + */ + public static fromObject(object: { [k: string]: any }): google.cloud.connectors.v1.ExtractionRule.Source; + + /** + * Creates a plain object from a Source message. Also converts values to other types if specified. + * @param message Source + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.connectors.v1.ExtractionRule.Source, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Source to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Source + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** SourceType enum. */ + enum SourceType { + SOURCE_TYPE_UNSPECIFIED = 0, + CONFIG_VARIABLE = 1 + } + } + + /** ConnectorVersionView enum. */ + enum ConnectorVersionView { + CONNECTOR_VERSION_VIEW_UNSPECIFIED = 0, + CONNECTOR_VERSION_VIEW_BASIC = 1, + CONNECTOR_VERSION_VIEW_FULL = 2 + } + + /** Represents a Connectors */ + class Connectors extends $protobuf.rpc.Service { + + /** + * Constructs a new Connectors 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 Connectors 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): Connectors; + + /** + * Calls ListConnections. + * @param request ListConnectionsRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ListConnectionsResponse + */ + public listConnections(request: google.cloud.connectors.v1.IListConnectionsRequest, callback: google.cloud.connectors.v1.Connectors.ListConnectionsCallback): void; + + /** + * Calls ListConnections. + * @param request ListConnectionsRequest message or plain object + * @returns Promise + */ + public listConnections(request: google.cloud.connectors.v1.IListConnectionsRequest): Promise; + + /** + * Calls GetConnection. + * @param request GetConnectionRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Connection + */ + public getConnection(request: google.cloud.connectors.v1.IGetConnectionRequest, callback: google.cloud.connectors.v1.Connectors.GetConnectionCallback): void; + + /** + * Calls GetConnection. + * @param request GetConnectionRequest message or plain object + * @returns Promise + */ + public getConnection(request: google.cloud.connectors.v1.IGetConnectionRequest): Promise; + + /** + * Calls CreateConnection. + * @param request CreateConnectionRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public createConnection(request: google.cloud.connectors.v1.ICreateConnectionRequest, callback: google.cloud.connectors.v1.Connectors.CreateConnectionCallback): void; + + /** + * Calls CreateConnection. + * @param request CreateConnectionRequest message or plain object + * @returns Promise + */ + public createConnection(request: google.cloud.connectors.v1.ICreateConnectionRequest): Promise; + + /** + * Calls UpdateConnection. + * @param request UpdateConnectionRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public updateConnection(request: google.cloud.connectors.v1.IUpdateConnectionRequest, callback: google.cloud.connectors.v1.Connectors.UpdateConnectionCallback): void; + + /** + * Calls UpdateConnection. + * @param request UpdateConnectionRequest message or plain object + * @returns Promise + */ + public updateConnection(request: google.cloud.connectors.v1.IUpdateConnectionRequest): Promise; + + /** + * Calls DeleteConnection. + * @param request DeleteConnectionRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public deleteConnection(request: google.cloud.connectors.v1.IDeleteConnectionRequest, callback: google.cloud.connectors.v1.Connectors.DeleteConnectionCallback): void; + + /** + * Calls DeleteConnection. + * @param request DeleteConnectionRequest message or plain object + * @returns Promise + */ + public deleteConnection(request: google.cloud.connectors.v1.IDeleteConnectionRequest): Promise; + + /** + * Calls ListProviders. + * @param request ListProvidersRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ListProvidersResponse + */ + public listProviders(request: google.cloud.connectors.v1.IListProvidersRequest, callback: google.cloud.connectors.v1.Connectors.ListProvidersCallback): void; + + /** + * Calls ListProviders. + * @param request ListProvidersRequest message or plain object + * @returns Promise + */ + public listProviders(request: google.cloud.connectors.v1.IListProvidersRequest): Promise; + + /** + * Calls GetProvider. + * @param request GetProviderRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Provider + */ + public getProvider(request: google.cloud.connectors.v1.IGetProviderRequest, callback: google.cloud.connectors.v1.Connectors.GetProviderCallback): void; + + /** + * Calls GetProvider. + * @param request GetProviderRequest message or plain object + * @returns Promise + */ + public getProvider(request: google.cloud.connectors.v1.IGetProviderRequest): Promise; + + /** + * Calls ListConnectors. + * @param request ListConnectorsRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ListConnectorsResponse + */ + public listConnectors(request: google.cloud.connectors.v1.IListConnectorsRequest, callback: google.cloud.connectors.v1.Connectors.ListConnectorsCallback): void; + + /** + * Calls ListConnectors. + * @param request ListConnectorsRequest message or plain object + * @returns Promise + */ + public listConnectors(request: google.cloud.connectors.v1.IListConnectorsRequest): Promise; + + /** + * Calls GetConnector. + * @param request GetConnectorRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Connector + */ + public getConnector(request: google.cloud.connectors.v1.IGetConnectorRequest, callback: google.cloud.connectors.v1.Connectors.GetConnectorCallback): void; + + /** + * Calls GetConnector. + * @param request GetConnectorRequest message or plain object + * @returns Promise + */ + public getConnector(request: google.cloud.connectors.v1.IGetConnectorRequest): Promise; + + /** + * Calls ListConnectorVersions. + * @param request ListConnectorVersionsRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ListConnectorVersionsResponse + */ + public listConnectorVersions(request: google.cloud.connectors.v1.IListConnectorVersionsRequest, callback: google.cloud.connectors.v1.Connectors.ListConnectorVersionsCallback): void; + + /** + * Calls ListConnectorVersions. + * @param request ListConnectorVersionsRequest message or plain object + * @returns Promise + */ + public listConnectorVersions(request: google.cloud.connectors.v1.IListConnectorVersionsRequest): Promise; + + /** + * Calls GetConnectorVersion. + * @param request GetConnectorVersionRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ConnectorVersion + */ + public getConnectorVersion(request: google.cloud.connectors.v1.IGetConnectorVersionRequest, callback: google.cloud.connectors.v1.Connectors.GetConnectorVersionCallback): void; + + /** + * Calls GetConnectorVersion. + * @param request GetConnectorVersionRequest message or plain object + * @returns Promise + */ + public getConnectorVersion(request: google.cloud.connectors.v1.IGetConnectorVersionRequest): Promise; + + /** + * Calls GetConnectionSchemaMetadata. + * @param request GetConnectionSchemaMetadataRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ConnectionSchemaMetadata + */ + public getConnectionSchemaMetadata(request: google.cloud.connectors.v1.IGetConnectionSchemaMetadataRequest, callback: google.cloud.connectors.v1.Connectors.GetConnectionSchemaMetadataCallback): void; + + /** + * Calls GetConnectionSchemaMetadata. + * @param request GetConnectionSchemaMetadataRequest message or plain object + * @returns Promise + */ + public getConnectionSchemaMetadata(request: google.cloud.connectors.v1.IGetConnectionSchemaMetadataRequest): Promise; + + /** + * Calls RefreshConnectionSchemaMetadata. + * @param request RefreshConnectionSchemaMetadataRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public refreshConnectionSchemaMetadata(request: google.cloud.connectors.v1.IRefreshConnectionSchemaMetadataRequest, callback: google.cloud.connectors.v1.Connectors.RefreshConnectionSchemaMetadataCallback): void; + + /** + * Calls RefreshConnectionSchemaMetadata. + * @param request RefreshConnectionSchemaMetadataRequest message or plain object + * @returns Promise + */ + public refreshConnectionSchemaMetadata(request: google.cloud.connectors.v1.IRefreshConnectionSchemaMetadataRequest): Promise; + + /** + * Calls ListRuntimeEntitySchemas. + * @param request ListRuntimeEntitySchemasRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ListRuntimeEntitySchemasResponse + */ + public listRuntimeEntitySchemas(request: google.cloud.connectors.v1.IListRuntimeEntitySchemasRequest, callback: google.cloud.connectors.v1.Connectors.ListRuntimeEntitySchemasCallback): void; + + /** + * Calls ListRuntimeEntitySchemas. + * @param request ListRuntimeEntitySchemasRequest message or plain object + * @returns Promise + */ + public listRuntimeEntitySchemas(request: google.cloud.connectors.v1.IListRuntimeEntitySchemasRequest): Promise; + + /** + * Calls ListRuntimeActionSchemas. + * @param request ListRuntimeActionSchemasRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ListRuntimeActionSchemasResponse + */ + public listRuntimeActionSchemas(request: google.cloud.connectors.v1.IListRuntimeActionSchemasRequest, callback: google.cloud.connectors.v1.Connectors.ListRuntimeActionSchemasCallback): void; + + /** + * Calls ListRuntimeActionSchemas. + * @param request ListRuntimeActionSchemasRequest message or plain object + * @returns Promise + */ + public listRuntimeActionSchemas(request: google.cloud.connectors.v1.IListRuntimeActionSchemasRequest): Promise; + + /** + * Calls GetRuntimeConfig. + * @param request GetRuntimeConfigRequest message or plain object + * @param callback Node-style callback called with the error, if any, and RuntimeConfig + */ + public getRuntimeConfig(request: google.cloud.connectors.v1.IGetRuntimeConfigRequest, callback: google.cloud.connectors.v1.Connectors.GetRuntimeConfigCallback): void; + + /** + * Calls GetRuntimeConfig. + * @param request GetRuntimeConfigRequest message or plain object + * @returns Promise + */ + public getRuntimeConfig(request: google.cloud.connectors.v1.IGetRuntimeConfigRequest): Promise; + + /** + * Calls GetGlobalSettings. + * @param request GetGlobalSettingsRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Settings + */ + public getGlobalSettings(request: google.cloud.connectors.v1.IGetGlobalSettingsRequest, callback: google.cloud.connectors.v1.Connectors.GetGlobalSettingsCallback): void; + + /** + * Calls GetGlobalSettings. + * @param request GetGlobalSettingsRequest message or plain object + * @returns Promise + */ + public getGlobalSettings(request: google.cloud.connectors.v1.IGetGlobalSettingsRequest): Promise; + } + + namespace Connectors { + + /** + * Callback as used by {@link google.cloud.connectors.v1.Connectors|listConnections}. + * @param error Error, if any + * @param [response] ListConnectionsResponse + */ + type ListConnectionsCallback = (error: (Error|null), response?: google.cloud.connectors.v1.ListConnectionsResponse) => void; + + /** + * Callback as used by {@link google.cloud.connectors.v1.Connectors|getConnection}. + * @param error Error, if any + * @param [response] Connection + */ + type GetConnectionCallback = (error: (Error|null), response?: google.cloud.connectors.v1.Connection) => void; + + /** + * Callback as used by {@link google.cloud.connectors.v1.Connectors|createConnection}. + * @param error Error, if any + * @param [response] Operation + */ + type CreateConnectionCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.cloud.connectors.v1.Connectors|updateConnection}. + * @param error Error, if any + * @param [response] Operation + */ + type UpdateConnectionCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.cloud.connectors.v1.Connectors|deleteConnection}. + * @param error Error, if any + * @param [response] Operation + */ + type DeleteConnectionCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.cloud.connectors.v1.Connectors|listProviders}. + * @param error Error, if any + * @param [response] ListProvidersResponse + */ + type ListProvidersCallback = (error: (Error|null), response?: google.cloud.connectors.v1.ListProvidersResponse) => void; + + /** + * Callback as used by {@link google.cloud.connectors.v1.Connectors|getProvider}. + * @param error Error, if any + * @param [response] Provider + */ + type GetProviderCallback = (error: (Error|null), response?: google.cloud.connectors.v1.Provider) => void; + + /** + * Callback as used by {@link google.cloud.connectors.v1.Connectors|listConnectors}. + * @param error Error, if any + * @param [response] ListConnectorsResponse + */ + type ListConnectorsCallback = (error: (Error|null), response?: google.cloud.connectors.v1.ListConnectorsResponse) => void; + + /** + * Callback as used by {@link google.cloud.connectors.v1.Connectors|getConnector}. + * @param error Error, if any + * @param [response] Connector + */ + type GetConnectorCallback = (error: (Error|null), response?: google.cloud.connectors.v1.Connector) => void; + + /** + * Callback as used by {@link google.cloud.connectors.v1.Connectors|listConnectorVersions}. + * @param error Error, if any + * @param [response] ListConnectorVersionsResponse + */ + type ListConnectorVersionsCallback = (error: (Error|null), response?: google.cloud.connectors.v1.ListConnectorVersionsResponse) => void; + + /** + * Callback as used by {@link google.cloud.connectors.v1.Connectors|getConnectorVersion}. + * @param error Error, if any + * @param [response] ConnectorVersion + */ + type GetConnectorVersionCallback = (error: (Error|null), response?: google.cloud.connectors.v1.ConnectorVersion) => void; + + /** + * Callback as used by {@link google.cloud.connectors.v1.Connectors|getConnectionSchemaMetadata}. + * @param error Error, if any + * @param [response] ConnectionSchemaMetadata + */ + type GetConnectionSchemaMetadataCallback = (error: (Error|null), response?: google.cloud.connectors.v1.ConnectionSchemaMetadata) => void; + + /** + * Callback as used by {@link google.cloud.connectors.v1.Connectors|refreshConnectionSchemaMetadata}. + * @param error Error, if any + * @param [response] Operation + */ + type RefreshConnectionSchemaMetadataCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.cloud.connectors.v1.Connectors|listRuntimeEntitySchemas}. + * @param error Error, if any + * @param [response] ListRuntimeEntitySchemasResponse + */ + type ListRuntimeEntitySchemasCallback = (error: (Error|null), response?: google.cloud.connectors.v1.ListRuntimeEntitySchemasResponse) => void; + + /** + * Callback as used by {@link google.cloud.connectors.v1.Connectors|listRuntimeActionSchemas}. + * @param error Error, if any + * @param [response] ListRuntimeActionSchemasResponse + */ + type ListRuntimeActionSchemasCallback = (error: (Error|null), response?: google.cloud.connectors.v1.ListRuntimeActionSchemasResponse) => void; + + /** + * Callback as used by {@link google.cloud.connectors.v1.Connectors|getRuntimeConfig}. + * @param error Error, if any + * @param [response] RuntimeConfig + */ + type GetRuntimeConfigCallback = (error: (Error|null), response?: google.cloud.connectors.v1.RuntimeConfig) => void; + + /** + * Callback as used by {@link google.cloud.connectors.v1.Connectors|getGlobalSettings}. + * @param error Error, if any + * @param [response] Settings + */ + type GetGlobalSettingsCallback = (error: (Error|null), response?: google.cloud.connectors.v1.Settings) => void; + } + + /** Properties of a Provider. */ + interface IProvider { + + /** Provider name */ + name?: (string|null); + + /** Provider createTime */ + createTime?: (google.protobuf.ITimestamp|null); + + /** Provider updateTime */ + updateTime?: (google.protobuf.ITimestamp|null); + + /** Provider labels */ + labels?: ({ [k: string]: string }|null); + + /** Provider documentationUri */ + documentationUri?: (string|null); + + /** Provider externalUri */ + externalUri?: (string|null); + + /** Provider description */ + description?: (string|null); + + /** Provider webAssetsLocation */ + webAssetsLocation?: (string|null); + + /** Provider displayName */ + displayName?: (string|null); + + /** Provider launchStage */ + launchStage?: (google.cloud.connectors.v1.LaunchStage|keyof typeof google.cloud.connectors.v1.LaunchStage|null); + } + + /** Represents a Provider. */ + class Provider implements IProvider { + + /** + * Constructs a new Provider. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.connectors.v1.IProvider); + + /** Provider name. */ + public name: string; + + /** Provider createTime. */ + public createTime?: (google.protobuf.ITimestamp|null); + + /** Provider updateTime. */ + public updateTime?: (google.protobuf.ITimestamp|null); + + /** Provider labels. */ + public labels: { [k: string]: string }; + + /** Provider documentationUri. */ + public documentationUri: string; + + /** Provider externalUri. */ + public externalUri: string; + + /** Provider description. */ + public description: string; + + /** Provider webAssetsLocation. */ + public webAssetsLocation: string; + + /** Provider displayName. */ + public displayName: string; + + /** Provider launchStage. */ + public launchStage: (google.cloud.connectors.v1.LaunchStage|keyof typeof google.cloud.connectors.v1.LaunchStage); + + /** + * Creates a new Provider instance using the specified properties. + * @param [properties] Properties to set + * @returns Provider instance + */ + public static create(properties?: google.cloud.connectors.v1.IProvider): google.cloud.connectors.v1.Provider; + + /** + * Encodes the specified Provider message. Does not implicitly {@link google.cloud.connectors.v1.Provider.verify|verify} messages. + * @param message Provider message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.connectors.v1.IProvider, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Provider message, length delimited. Does not implicitly {@link google.cloud.connectors.v1.Provider.verify|verify} messages. + * @param message Provider message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.connectors.v1.IProvider, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Provider message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Provider + * @throws {Error} If the payload is not 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.connectors.v1.Provider; + + /** + * Decodes a Provider message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Provider + * @throws {Error} If the payload 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.connectors.v1.Provider; + + /** + * Verifies a Provider message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Provider message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Provider + */ + public static fromObject(object: { [k: string]: any }): google.cloud.connectors.v1.Provider; + + /** + * Creates a plain object from a Provider message. Also converts values to other types if specified. + * @param message Provider + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.connectors.v1.Provider, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Provider to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Provider + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a GetProviderRequest. */ + interface IGetProviderRequest { + + /** GetProviderRequest name */ + name?: (string|null); + } + + /** Represents a GetProviderRequest. */ + class GetProviderRequest implements IGetProviderRequest { + + /** + * Constructs a new GetProviderRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.connectors.v1.IGetProviderRequest); + + /** GetProviderRequest name. */ + public name: string; + + /** + * Creates a new GetProviderRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GetProviderRequest instance + */ + public static create(properties?: google.cloud.connectors.v1.IGetProviderRequest): google.cloud.connectors.v1.GetProviderRequest; + + /** + * Encodes the specified GetProviderRequest message. Does not implicitly {@link google.cloud.connectors.v1.GetProviderRequest.verify|verify} messages. + * @param message GetProviderRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.connectors.v1.IGetProviderRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GetProviderRequest message, length delimited. Does not implicitly {@link google.cloud.connectors.v1.GetProviderRequest.verify|verify} messages. + * @param message GetProviderRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.connectors.v1.IGetProviderRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GetProviderRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GetProviderRequest + * @throws {Error} If the payload is not 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.connectors.v1.GetProviderRequest; + + /** + * Decodes a GetProviderRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GetProviderRequest + * @throws {Error} If the payload 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.connectors.v1.GetProviderRequest; + + /** + * Verifies a GetProviderRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GetProviderRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GetProviderRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.connectors.v1.GetProviderRequest; + + /** + * Creates a plain object from a GetProviderRequest message. Also converts values to other types if specified. + * @param message GetProviderRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.connectors.v1.GetProviderRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GetProviderRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GetProviderRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListProvidersRequest. */ + interface IListProvidersRequest { + + /** ListProvidersRequest parent */ + parent?: (string|null); + + /** ListProvidersRequest pageSize */ + pageSize?: (number|null); + + /** ListProvidersRequest pageToken */ + pageToken?: (string|null); + } + + /** Represents a ListProvidersRequest. */ + class ListProvidersRequest implements IListProvidersRequest { + + /** + * Constructs a new ListProvidersRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.connectors.v1.IListProvidersRequest); + + /** ListProvidersRequest parent. */ + public parent: string; + + /** ListProvidersRequest pageSize. */ + public pageSize: number; + + /** ListProvidersRequest pageToken. */ + public pageToken: string; + + /** + * Creates a new ListProvidersRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ListProvidersRequest instance + */ + public static create(properties?: google.cloud.connectors.v1.IListProvidersRequest): google.cloud.connectors.v1.ListProvidersRequest; + + /** + * Encodes the specified ListProvidersRequest message. Does not implicitly {@link google.cloud.connectors.v1.ListProvidersRequest.verify|verify} messages. + * @param message ListProvidersRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.connectors.v1.IListProvidersRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListProvidersRequest message, length delimited. Does not implicitly {@link google.cloud.connectors.v1.ListProvidersRequest.verify|verify} messages. + * @param message ListProvidersRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.connectors.v1.IListProvidersRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListProvidersRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListProvidersRequest + * @throws {Error} If the payload is not 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.connectors.v1.ListProvidersRequest; + + /** + * Decodes a ListProvidersRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListProvidersRequest + * @throws {Error} If the payload 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.connectors.v1.ListProvidersRequest; + + /** + * Verifies a ListProvidersRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListProvidersRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListProvidersRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.connectors.v1.ListProvidersRequest; + + /** + * Creates a plain object from a ListProvidersRequest message. Also converts values to other types if specified. + * @param message ListProvidersRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.connectors.v1.ListProvidersRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListProvidersRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListProvidersRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListProvidersResponse. */ + interface IListProvidersResponse { + + /** ListProvidersResponse providers */ + providers?: (google.cloud.connectors.v1.IProvider[]|null); + + /** ListProvidersResponse nextPageToken */ + nextPageToken?: (string|null); + + /** ListProvidersResponse unreachable */ + unreachable?: (string[]|null); + } + + /** Represents a ListProvidersResponse. */ + class ListProvidersResponse implements IListProvidersResponse { + + /** + * Constructs a new ListProvidersResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.connectors.v1.IListProvidersResponse); + + /** ListProvidersResponse providers. */ + public providers: google.cloud.connectors.v1.IProvider[]; + + /** ListProvidersResponse nextPageToken. */ + public nextPageToken: string; + + /** ListProvidersResponse unreachable. */ + public unreachable: string[]; + + /** + * Creates a new ListProvidersResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ListProvidersResponse instance + */ + public static create(properties?: google.cloud.connectors.v1.IListProvidersResponse): google.cloud.connectors.v1.ListProvidersResponse; + + /** + * Encodes the specified ListProvidersResponse message. Does not implicitly {@link google.cloud.connectors.v1.ListProvidersResponse.verify|verify} messages. + * @param message ListProvidersResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.connectors.v1.IListProvidersResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListProvidersResponse message, length delimited. Does not implicitly {@link google.cloud.connectors.v1.ListProvidersResponse.verify|verify} messages. + * @param message ListProvidersResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.connectors.v1.IListProvidersResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListProvidersResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListProvidersResponse + * @throws {Error} If the payload is not 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.connectors.v1.ListProvidersResponse; + + /** + * Decodes a ListProvidersResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListProvidersResponse + * @throws {Error} If the payload 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.connectors.v1.ListProvidersResponse; + + /** + * Verifies a ListProvidersResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListProvidersResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListProvidersResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.connectors.v1.ListProvidersResponse; + + /** + * Creates a plain object from a ListProvidersResponse message. Also converts values to other types if specified. + * @param message ListProvidersResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.connectors.v1.ListProvidersResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListProvidersResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListProvidersResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a GetRuntimeConfigRequest. */ + interface IGetRuntimeConfigRequest { + + /** GetRuntimeConfigRequest name */ + name?: (string|null); + } + + /** Represents a GetRuntimeConfigRequest. */ + class GetRuntimeConfigRequest implements IGetRuntimeConfigRequest { + + /** + * Constructs a new GetRuntimeConfigRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.connectors.v1.IGetRuntimeConfigRequest); + + /** GetRuntimeConfigRequest name. */ + public name: string; + + /** + * Creates a new GetRuntimeConfigRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GetRuntimeConfigRequest instance + */ + public static create(properties?: google.cloud.connectors.v1.IGetRuntimeConfigRequest): google.cloud.connectors.v1.GetRuntimeConfigRequest; + + /** + * Encodes the specified GetRuntimeConfigRequest message. Does not implicitly {@link google.cloud.connectors.v1.GetRuntimeConfigRequest.verify|verify} messages. + * @param message GetRuntimeConfigRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.connectors.v1.IGetRuntimeConfigRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GetRuntimeConfigRequest message, length delimited. Does not implicitly {@link google.cloud.connectors.v1.GetRuntimeConfigRequest.verify|verify} messages. + * @param message GetRuntimeConfigRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.connectors.v1.IGetRuntimeConfigRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GetRuntimeConfigRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GetRuntimeConfigRequest + * @throws {Error} If the payload is not 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.connectors.v1.GetRuntimeConfigRequest; + + /** + * Decodes a GetRuntimeConfigRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GetRuntimeConfigRequest + * @throws {Error} If the payload 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.connectors.v1.GetRuntimeConfigRequest; + + /** + * Verifies a GetRuntimeConfigRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GetRuntimeConfigRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GetRuntimeConfigRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.connectors.v1.GetRuntimeConfigRequest; + + /** + * Creates a plain object from a GetRuntimeConfigRequest message. Also converts values to other types if specified. + * @param message GetRuntimeConfigRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.connectors.v1.GetRuntimeConfigRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GetRuntimeConfigRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GetRuntimeConfigRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a RuntimeConfig. */ + interface IRuntimeConfig { + + /** RuntimeConfig locationId */ + locationId?: (string|null); + + /** RuntimeConfig conndTopic */ + conndTopic?: (string|null); + + /** RuntimeConfig conndSubscription */ + conndSubscription?: (string|null); + + /** RuntimeConfig controlPlaneTopic */ + controlPlaneTopic?: (string|null); + + /** RuntimeConfig controlPlaneSubscription */ + controlPlaneSubscription?: (string|null); + + /** RuntimeConfig runtimeEndpoint */ + runtimeEndpoint?: (string|null); + + /** RuntimeConfig state */ + state?: (google.cloud.connectors.v1.RuntimeConfig.State|keyof typeof google.cloud.connectors.v1.RuntimeConfig.State|null); + + /** RuntimeConfig schemaGcsBucket */ + schemaGcsBucket?: (string|null); + + /** RuntimeConfig serviceDirectory */ + serviceDirectory?: (string|null); + + /** RuntimeConfig name */ + name?: (string|null); + } + + /** Represents a RuntimeConfig. */ + class RuntimeConfig implements IRuntimeConfig { + + /** + * Constructs a new RuntimeConfig. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.connectors.v1.IRuntimeConfig); + + /** RuntimeConfig locationId. */ + public locationId: string; + + /** RuntimeConfig conndTopic. */ + public conndTopic: string; + + /** RuntimeConfig conndSubscription. */ + public conndSubscription: string; + + /** RuntimeConfig controlPlaneTopic. */ + public controlPlaneTopic: string; + + /** RuntimeConfig controlPlaneSubscription. */ + public controlPlaneSubscription: string; + + /** RuntimeConfig runtimeEndpoint. */ + public runtimeEndpoint: string; + + /** RuntimeConfig state. */ + public state: (google.cloud.connectors.v1.RuntimeConfig.State|keyof typeof google.cloud.connectors.v1.RuntimeConfig.State); + + /** RuntimeConfig schemaGcsBucket. */ + public schemaGcsBucket: string; + + /** RuntimeConfig serviceDirectory. */ + public serviceDirectory: string; + + /** RuntimeConfig name. */ + public name: string; + + /** + * Creates a new RuntimeConfig instance using the specified properties. + * @param [properties] Properties to set + * @returns RuntimeConfig instance + */ + public static create(properties?: google.cloud.connectors.v1.IRuntimeConfig): google.cloud.connectors.v1.RuntimeConfig; + + /** + * Encodes the specified RuntimeConfig message. Does not implicitly {@link google.cloud.connectors.v1.RuntimeConfig.verify|verify} messages. + * @param message RuntimeConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.connectors.v1.IRuntimeConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified RuntimeConfig message, length delimited. Does not implicitly {@link google.cloud.connectors.v1.RuntimeConfig.verify|verify} messages. + * @param message RuntimeConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.connectors.v1.IRuntimeConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a RuntimeConfig message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns RuntimeConfig + * @throws {Error} If the payload is not 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.connectors.v1.RuntimeConfig; + + /** + * Decodes a RuntimeConfig message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns RuntimeConfig + * @throws {Error} If the payload 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.connectors.v1.RuntimeConfig; + + /** + * Verifies a RuntimeConfig message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a RuntimeConfig message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns RuntimeConfig + */ + public static fromObject(object: { [k: string]: any }): google.cloud.connectors.v1.RuntimeConfig; + + /** + * Creates a plain object from a RuntimeConfig message. Also converts values to other types if specified. + * @param message RuntimeConfig + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.connectors.v1.RuntimeConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this RuntimeConfig to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for RuntimeConfig + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace RuntimeConfig { + + /** State enum. */ + enum State { + STATE_UNSPECIFIED = 0, + INACTIVE = 1, + ACTIVATING = 2, + ACTIVE = 3, + CREATING = 4, + DELETING = 5, + UPDATING = 6 + } + } + + /** Properties of a GetGlobalSettingsRequest. */ + interface IGetGlobalSettingsRequest { + + /** GetGlobalSettingsRequest name */ + name?: (string|null); + } + + /** Represents a GetGlobalSettingsRequest. */ + class GetGlobalSettingsRequest implements IGetGlobalSettingsRequest { + + /** + * Constructs a new GetGlobalSettingsRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.connectors.v1.IGetGlobalSettingsRequest); + + /** GetGlobalSettingsRequest name. */ + public name: string; + + /** + * Creates a new GetGlobalSettingsRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GetGlobalSettingsRequest instance + */ + public static create(properties?: google.cloud.connectors.v1.IGetGlobalSettingsRequest): google.cloud.connectors.v1.GetGlobalSettingsRequest; + + /** + * Encodes the specified GetGlobalSettingsRequest message. Does not implicitly {@link google.cloud.connectors.v1.GetGlobalSettingsRequest.verify|verify} messages. + * @param message GetGlobalSettingsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.connectors.v1.IGetGlobalSettingsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GetGlobalSettingsRequest message, length delimited. Does not implicitly {@link google.cloud.connectors.v1.GetGlobalSettingsRequest.verify|verify} messages. + * @param message GetGlobalSettingsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.connectors.v1.IGetGlobalSettingsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GetGlobalSettingsRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GetGlobalSettingsRequest + * @throws {Error} If the payload is not 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.connectors.v1.GetGlobalSettingsRequest; + + /** + * Decodes a GetGlobalSettingsRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GetGlobalSettingsRequest + * @throws {Error} If the payload 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.connectors.v1.GetGlobalSettingsRequest; + + /** + * Verifies a GetGlobalSettingsRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GetGlobalSettingsRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GetGlobalSettingsRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.connectors.v1.GetGlobalSettingsRequest; + + /** + * Creates a plain object from a GetGlobalSettingsRequest message. Also converts values to other types if specified. + * @param message GetGlobalSettingsRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.connectors.v1.GetGlobalSettingsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GetGlobalSettingsRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GetGlobalSettingsRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Settings. */ + interface ISettings { + + /** Settings name */ + name?: (string|null); + + /** Settings vpcsc */ + vpcsc?: (boolean|null); + + /** Settings payg */ + payg?: (boolean|null); + } + + /** Represents a Settings. */ + class Settings implements ISettings { + + /** + * Constructs a new Settings. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.connectors.v1.ISettings); + + /** Settings name. */ + public name: string; + + /** Settings vpcsc. */ + public vpcsc: boolean; + + /** Settings payg. */ + public payg: boolean; + + /** + * Creates a new Settings instance using the specified properties. + * @param [properties] Properties to set + * @returns Settings instance + */ + public static create(properties?: google.cloud.connectors.v1.ISettings): google.cloud.connectors.v1.Settings; + + /** + * Encodes the specified Settings message. Does not implicitly {@link google.cloud.connectors.v1.Settings.verify|verify} messages. + * @param message Settings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.connectors.v1.ISettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Settings message, length delimited. Does not implicitly {@link google.cloud.connectors.v1.Settings.verify|verify} messages. + * @param message Settings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.connectors.v1.ISettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Settings message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Settings + * @throws {Error} If the payload is not 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.connectors.v1.Settings; + + /** + * Decodes a Settings message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Settings + * @throws {Error} If the payload 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.connectors.v1.Settings; + + /** + * Verifies a Settings message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Settings message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Settings + */ + public static fromObject(object: { [k: string]: any }): google.cloud.connectors.v1.Settings; + + /** + * Creates a plain object from a Settings message. Also converts values to other types if specified. + * @param message Settings + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.connectors.v1.Settings, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Settings to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Settings + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + } + } + + /** 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 + } + + /** 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; + } + + /** 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); + } + + /** 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[]; + + /** + * 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); + } + + /** 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); + + /** + * 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); + } + + /** 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); + + /** + * 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 + } + + /** 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 + } + } + + /** 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; + } + + /** 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?: (string|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: string; + + /** + * 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); + } + + /** 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[]; + + /** + * 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; + } + + /** 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_REQUIRED = 2, + LABEL_REPEATED = 3 + } + } + + /** 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 phpGenericServices */ + phpGenericServices?: (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 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 phpGenericServices. */ + public phpGenericServices: 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 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 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 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 target */ + target?: (google.protobuf.FieldOptions.OptionTargetType|keyof typeof google.protobuf.FieldOptions.OptionTargetType|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 target. */ + public target: (google.protobuf.FieldOptions.OptionTargetType|keyof typeof google.protobuf.FieldOptions.OptionTargetType); + + /** 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 OneofOptions. */ + interface IOneofOptions { + + /** 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 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 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 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 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 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 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); + } + + /** Represents a ServiceOptions. */ + class ServiceOptions implements IServiceOptions { + + /** + * Constructs a new ServiceOptions. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IServiceOptions); + + /** 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 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 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|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|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 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 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 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 Struct. */ + interface IStruct { + + /** Struct fields */ + fields?: ({ [k: string]: google.protobuf.IValue }|null); + } + + /** Represents a Struct. */ + class Struct implements IStruct { + + /** + * Constructs a new Struct. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IStruct); + + /** Struct fields. */ + public fields: { [k: string]: google.protobuf.IValue }; + + /** + * Creates a new Struct instance using the specified properties. + * @param [properties] Properties to set + * @returns Struct instance + */ + public static create(properties?: google.protobuf.IStruct): google.protobuf.Struct; + + /** + * Encodes the specified Struct message. Does not implicitly {@link google.protobuf.Struct.verify|verify} messages. + * @param message Struct message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IStruct, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Struct message, length delimited. Does not implicitly {@link google.protobuf.Struct.verify|verify} messages. + * @param message Struct message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IStruct, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Struct message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Struct + * @throws {Error} If the payload is not 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.Struct; + + /** + * Decodes a Struct message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Struct + * @throws {Error} If the payload 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.Struct; + + /** + * Verifies a Struct message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Struct message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Struct + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.Struct; + + /** + * Creates a plain object from a Struct message. Also converts values to other types if specified. + * @param message Struct + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.Struct, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Struct to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Struct + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Value. */ + interface IValue { + + /** Value nullValue */ + nullValue?: (google.protobuf.NullValue|keyof typeof google.protobuf.NullValue|null); + + /** Value numberValue */ + numberValue?: (number|null); + + /** Value stringValue */ + stringValue?: (string|null); + + /** Value boolValue */ + boolValue?: (boolean|null); + + /** Value structValue */ + structValue?: (google.protobuf.IStruct|null); + + /** Value listValue */ + listValue?: (google.protobuf.IListValue|null); + } + + /** Represents a Value. */ + class Value implements IValue { + + /** + * Constructs a new Value. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IValue); + + /** Value nullValue. */ + public nullValue?: (google.protobuf.NullValue|keyof typeof google.protobuf.NullValue|null); + + /** Value numberValue. */ + public numberValue?: (number|null); + + /** Value stringValue. */ + public stringValue?: (string|null); + + /** Value boolValue. */ + public boolValue?: (boolean|null); + + /** Value structValue. */ + public structValue?: (google.protobuf.IStruct|null); + + /** Value listValue. */ + public listValue?: (google.protobuf.IListValue|null); + + /** Value kind. */ + public kind?: ("nullValue"|"numberValue"|"stringValue"|"boolValue"|"structValue"|"listValue"); + + /** + * Creates a new Value instance using the specified properties. + * @param [properties] Properties to set + * @returns Value instance + */ + public static create(properties?: google.protobuf.IValue): google.protobuf.Value; + + /** + * Encodes the specified Value message. Does not implicitly {@link google.protobuf.Value.verify|verify} messages. + * @param message Value message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IValue, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Value message, length delimited. Does not implicitly {@link google.protobuf.Value.verify|verify} messages. + * @param message Value message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IValue, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Value message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Value + * @throws {Error} If the payload is not 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.Value; + + /** + * Decodes a Value message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Value + * @throws {Error} If the payload 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.Value; + + /** + * Verifies a Value message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Value message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Value + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.Value; + + /** + * Creates a plain object from a Value message. Also converts values to other types if specified. + * @param message Value + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.Value, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Value to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Value + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** NullValue enum. */ + enum NullValue { + NULL_VALUE = 0 + } + + /** Properties of a ListValue. */ + interface IListValue { + + /** ListValue values */ + values?: (google.protobuf.IValue[]|null); + } + + /** Represents a ListValue. */ + class ListValue implements IListValue { + + /** + * Constructs a new ListValue. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IListValue); + + /** ListValue values. */ + public values: google.protobuf.IValue[]; + + /** + * Creates a new ListValue instance using the specified properties. + * @param [properties] Properties to set + * @returns ListValue instance + */ + public static create(properties?: google.protobuf.IListValue): google.protobuf.ListValue; + + /** + * Encodes the specified ListValue message. Does not implicitly {@link google.protobuf.ListValue.verify|verify} messages. + * @param message ListValue message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IListValue, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListValue message, length delimited. Does not implicitly {@link google.protobuf.ListValue.verify|verify} messages. + * @param message ListValue message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IListValue, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListValue message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListValue + * @throws {Error} If the payload is not 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.ListValue; + + /** + * Decodes a ListValue message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListValue + * @throws {Error} If the payload 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.ListValue; + + /** + * Verifies a ListValue message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListValue message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListValue + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.ListValue; + + /** + * Creates a plain object from a ListValue message. Also converts values to other types if specified. + * @param message ListValue + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.ListValue, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListValue to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListValue + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** 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|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|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; + } + } + + /** 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/google-cloud-connectors/protos/protos.js b/packages/google-cloud-connectors/protos/protos.js new file mode 100644 index 00000000000..6d0d124bfc7 --- /dev/null +++ b/packages/google-cloud-connectors/protos/protos.js @@ -0,0 +1,39768 @@ +// Copyright 2023 Google LLC +// +// Licensed under the Apache License, Version 2.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_connectors_protos || ($protobuf.roots._google_cloud_connectors_protos = {}); + + $root.google = (function() { + + /** + * Namespace google. + * @exports google + * @namespace + */ + var google = {}; + + google.cloud = (function() { + + /** + * Namespace cloud. + * @memberof google + * @namespace + */ + var cloud = {}; + + cloud.connectors = (function() { + + /** + * Namespace connectors. + * @memberof google.cloud + * @namespace + */ + var connectors = {}; + + connectors.v1 = (function() { + + /** + * Namespace v1. + * @memberof google.cloud.connectors + * @namespace + */ + var v1 = {}; + + v1.AuthConfig = (function() { + + /** + * Properties of an AuthConfig. + * @memberof google.cloud.connectors.v1 + * @interface IAuthConfig + * @property {google.cloud.connectors.v1.AuthType|null} [authType] AuthConfig authType + * @property {google.cloud.connectors.v1.AuthConfig.IUserPassword|null} [userPassword] AuthConfig userPassword + * @property {google.cloud.connectors.v1.AuthConfig.IOauth2JwtBearer|null} [oauth2JwtBearer] AuthConfig oauth2JwtBearer + * @property {google.cloud.connectors.v1.AuthConfig.IOauth2ClientCredentials|null} [oauth2ClientCredentials] AuthConfig oauth2ClientCredentials + * @property {google.cloud.connectors.v1.AuthConfig.ISshPublicKey|null} [sshPublicKey] AuthConfig sshPublicKey + * @property {Array.|null} [additionalVariables] AuthConfig additionalVariables + */ + + /** + * Constructs a new AuthConfig. + * @memberof google.cloud.connectors.v1 + * @classdesc Represents an AuthConfig. + * @implements IAuthConfig + * @constructor + * @param {google.cloud.connectors.v1.IAuthConfig=} [properties] Properties to set + */ + function AuthConfig(properties) { + this.additionalVariables = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * AuthConfig authType. + * @member {google.cloud.connectors.v1.AuthType} authType + * @memberof google.cloud.connectors.v1.AuthConfig + * @instance + */ + AuthConfig.prototype.authType = 0; + + /** + * AuthConfig userPassword. + * @member {google.cloud.connectors.v1.AuthConfig.IUserPassword|null|undefined} userPassword + * @memberof google.cloud.connectors.v1.AuthConfig + * @instance + */ + AuthConfig.prototype.userPassword = null; + + /** + * AuthConfig oauth2JwtBearer. + * @member {google.cloud.connectors.v1.AuthConfig.IOauth2JwtBearer|null|undefined} oauth2JwtBearer + * @memberof google.cloud.connectors.v1.AuthConfig + * @instance + */ + AuthConfig.prototype.oauth2JwtBearer = null; + + /** + * AuthConfig oauth2ClientCredentials. + * @member {google.cloud.connectors.v1.AuthConfig.IOauth2ClientCredentials|null|undefined} oauth2ClientCredentials + * @memberof google.cloud.connectors.v1.AuthConfig + * @instance + */ + AuthConfig.prototype.oauth2ClientCredentials = null; + + /** + * AuthConfig sshPublicKey. + * @member {google.cloud.connectors.v1.AuthConfig.ISshPublicKey|null|undefined} sshPublicKey + * @memberof google.cloud.connectors.v1.AuthConfig + * @instance + */ + AuthConfig.prototype.sshPublicKey = null; + + /** + * AuthConfig additionalVariables. + * @member {Array.} additionalVariables + * @memberof google.cloud.connectors.v1.AuthConfig + * @instance + */ + AuthConfig.prototype.additionalVariables = $util.emptyArray; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * AuthConfig type. + * @member {"userPassword"|"oauth2JwtBearer"|"oauth2ClientCredentials"|"sshPublicKey"|undefined} type + * @memberof google.cloud.connectors.v1.AuthConfig + * @instance + */ + Object.defineProperty(AuthConfig.prototype, "type", { + get: $util.oneOfGetter($oneOfFields = ["userPassword", "oauth2JwtBearer", "oauth2ClientCredentials", "sshPublicKey"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new AuthConfig instance using the specified properties. + * @function create + * @memberof google.cloud.connectors.v1.AuthConfig + * @static + * @param {google.cloud.connectors.v1.IAuthConfig=} [properties] Properties to set + * @returns {google.cloud.connectors.v1.AuthConfig} AuthConfig instance + */ + AuthConfig.create = function create(properties) { + return new AuthConfig(properties); + }; + + /** + * Encodes the specified AuthConfig message. Does not implicitly {@link google.cloud.connectors.v1.AuthConfig.verify|verify} messages. + * @function encode + * @memberof google.cloud.connectors.v1.AuthConfig + * @static + * @param {google.cloud.connectors.v1.IAuthConfig} message AuthConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AuthConfig.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.authType != null && Object.hasOwnProperty.call(message, "authType")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.authType); + if (message.userPassword != null && Object.hasOwnProperty.call(message, "userPassword")) + $root.google.cloud.connectors.v1.AuthConfig.UserPassword.encode(message.userPassword, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.oauth2JwtBearer != null && Object.hasOwnProperty.call(message, "oauth2JwtBearer")) + $root.google.cloud.connectors.v1.AuthConfig.Oauth2JwtBearer.encode(message.oauth2JwtBearer, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.oauth2ClientCredentials != null && Object.hasOwnProperty.call(message, "oauth2ClientCredentials")) + $root.google.cloud.connectors.v1.AuthConfig.Oauth2ClientCredentials.encode(message.oauth2ClientCredentials, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.additionalVariables != null && message.additionalVariables.length) + for (var i = 0; i < message.additionalVariables.length; ++i) + $root.google.cloud.connectors.v1.ConfigVariable.encode(message.additionalVariables[i], writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.sshPublicKey != null && Object.hasOwnProperty.call(message, "sshPublicKey")) + $root.google.cloud.connectors.v1.AuthConfig.SshPublicKey.encode(message.sshPublicKey, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified AuthConfig message, length delimited. Does not implicitly {@link google.cloud.connectors.v1.AuthConfig.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.connectors.v1.AuthConfig + * @static + * @param {google.cloud.connectors.v1.IAuthConfig} message AuthConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AuthConfig.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an AuthConfig message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.connectors.v1.AuthConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.connectors.v1.AuthConfig} AuthConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AuthConfig.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.connectors.v1.AuthConfig(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.authType = reader.int32(); + break; + } + case 2: { + message.userPassword = $root.google.cloud.connectors.v1.AuthConfig.UserPassword.decode(reader, reader.uint32()); + break; + } + case 3: { + message.oauth2JwtBearer = $root.google.cloud.connectors.v1.AuthConfig.Oauth2JwtBearer.decode(reader, reader.uint32()); + break; + } + case 4: { + message.oauth2ClientCredentials = $root.google.cloud.connectors.v1.AuthConfig.Oauth2ClientCredentials.decode(reader, reader.uint32()); + break; + } + case 6: { + message.sshPublicKey = $root.google.cloud.connectors.v1.AuthConfig.SshPublicKey.decode(reader, reader.uint32()); + break; + } + case 5: { + if (!(message.additionalVariables && message.additionalVariables.length)) + message.additionalVariables = []; + message.additionalVariables.push($root.google.cloud.connectors.v1.ConfigVariable.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an AuthConfig message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.connectors.v1.AuthConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.connectors.v1.AuthConfig} AuthConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AuthConfig.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an AuthConfig message. + * @function verify + * @memberof google.cloud.connectors.v1.AuthConfig + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + AuthConfig.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.authType != null && message.hasOwnProperty("authType")) + switch (message.authType) { + default: + return "authType: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + case 5: + break; + } + if (message.userPassword != null && message.hasOwnProperty("userPassword")) { + properties.type = 1; + { + var error = $root.google.cloud.connectors.v1.AuthConfig.UserPassword.verify(message.userPassword); + if (error) + return "userPassword." + error; + } + } + if (message.oauth2JwtBearer != null && message.hasOwnProperty("oauth2JwtBearer")) { + if (properties.type === 1) + return "type: multiple values"; + properties.type = 1; + { + var error = $root.google.cloud.connectors.v1.AuthConfig.Oauth2JwtBearer.verify(message.oauth2JwtBearer); + if (error) + return "oauth2JwtBearer." + error; + } + } + if (message.oauth2ClientCredentials != null && message.hasOwnProperty("oauth2ClientCredentials")) { + if (properties.type === 1) + return "type: multiple values"; + properties.type = 1; + { + var error = $root.google.cloud.connectors.v1.AuthConfig.Oauth2ClientCredentials.verify(message.oauth2ClientCredentials); + if (error) + return "oauth2ClientCredentials." + error; + } + } + if (message.sshPublicKey != null && message.hasOwnProperty("sshPublicKey")) { + if (properties.type === 1) + return "type: multiple values"; + properties.type = 1; + { + var error = $root.google.cloud.connectors.v1.AuthConfig.SshPublicKey.verify(message.sshPublicKey); + if (error) + return "sshPublicKey." + error; + } + } + if (message.additionalVariables != null && message.hasOwnProperty("additionalVariables")) { + if (!Array.isArray(message.additionalVariables)) + return "additionalVariables: array expected"; + for (var i = 0; i < message.additionalVariables.length; ++i) { + var error = $root.google.cloud.connectors.v1.ConfigVariable.verify(message.additionalVariables[i]); + if (error) + return "additionalVariables." + error; + } + } + return null; + }; + + /** + * Creates an AuthConfig message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.connectors.v1.AuthConfig + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.connectors.v1.AuthConfig} AuthConfig + */ + AuthConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.connectors.v1.AuthConfig) + return object; + var message = new $root.google.cloud.connectors.v1.AuthConfig(); + switch (object.authType) { + default: + if (typeof object.authType === "number") { + message.authType = object.authType; + break; + } + break; + case "AUTH_TYPE_UNSPECIFIED": + case 0: + message.authType = 0; + break; + case "USER_PASSWORD": + case 1: + message.authType = 1; + break; + case "OAUTH2_JWT_BEARER": + case 2: + message.authType = 2; + break; + case "OAUTH2_CLIENT_CREDENTIALS": + case 3: + message.authType = 3; + break; + case "SSH_PUBLIC_KEY": + case 4: + message.authType = 4; + break; + case "OAUTH2_AUTH_CODE_FLOW": + case 5: + message.authType = 5; + break; + } + if (object.userPassword != null) { + if (typeof object.userPassword !== "object") + throw TypeError(".google.cloud.connectors.v1.AuthConfig.userPassword: object expected"); + message.userPassword = $root.google.cloud.connectors.v1.AuthConfig.UserPassword.fromObject(object.userPassword); + } + if (object.oauth2JwtBearer != null) { + if (typeof object.oauth2JwtBearer !== "object") + throw TypeError(".google.cloud.connectors.v1.AuthConfig.oauth2JwtBearer: object expected"); + message.oauth2JwtBearer = $root.google.cloud.connectors.v1.AuthConfig.Oauth2JwtBearer.fromObject(object.oauth2JwtBearer); + } + if (object.oauth2ClientCredentials != null) { + if (typeof object.oauth2ClientCredentials !== "object") + throw TypeError(".google.cloud.connectors.v1.AuthConfig.oauth2ClientCredentials: object expected"); + message.oauth2ClientCredentials = $root.google.cloud.connectors.v1.AuthConfig.Oauth2ClientCredentials.fromObject(object.oauth2ClientCredentials); + } + if (object.sshPublicKey != null) { + if (typeof object.sshPublicKey !== "object") + throw TypeError(".google.cloud.connectors.v1.AuthConfig.sshPublicKey: object expected"); + message.sshPublicKey = $root.google.cloud.connectors.v1.AuthConfig.SshPublicKey.fromObject(object.sshPublicKey); + } + if (object.additionalVariables) { + if (!Array.isArray(object.additionalVariables)) + throw TypeError(".google.cloud.connectors.v1.AuthConfig.additionalVariables: array expected"); + message.additionalVariables = []; + for (var i = 0; i < object.additionalVariables.length; ++i) { + if (typeof object.additionalVariables[i] !== "object") + throw TypeError(".google.cloud.connectors.v1.AuthConfig.additionalVariables: object expected"); + message.additionalVariables[i] = $root.google.cloud.connectors.v1.ConfigVariable.fromObject(object.additionalVariables[i]); + } + } + return message; + }; + + /** + * Creates a plain object from an AuthConfig message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.connectors.v1.AuthConfig + * @static + * @param {google.cloud.connectors.v1.AuthConfig} message AuthConfig + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + AuthConfig.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.additionalVariables = []; + if (options.defaults) + object.authType = options.enums === String ? "AUTH_TYPE_UNSPECIFIED" : 0; + if (message.authType != null && message.hasOwnProperty("authType")) + object.authType = options.enums === String ? $root.google.cloud.connectors.v1.AuthType[message.authType] === undefined ? message.authType : $root.google.cloud.connectors.v1.AuthType[message.authType] : message.authType; + if (message.userPassword != null && message.hasOwnProperty("userPassword")) { + object.userPassword = $root.google.cloud.connectors.v1.AuthConfig.UserPassword.toObject(message.userPassword, options); + if (options.oneofs) + object.type = "userPassword"; + } + if (message.oauth2JwtBearer != null && message.hasOwnProperty("oauth2JwtBearer")) { + object.oauth2JwtBearer = $root.google.cloud.connectors.v1.AuthConfig.Oauth2JwtBearer.toObject(message.oauth2JwtBearer, options); + if (options.oneofs) + object.type = "oauth2JwtBearer"; + } + if (message.oauth2ClientCredentials != null && message.hasOwnProperty("oauth2ClientCredentials")) { + object.oauth2ClientCredentials = $root.google.cloud.connectors.v1.AuthConfig.Oauth2ClientCredentials.toObject(message.oauth2ClientCredentials, options); + if (options.oneofs) + object.type = "oauth2ClientCredentials"; + } + if (message.additionalVariables && message.additionalVariables.length) { + object.additionalVariables = []; + for (var j = 0; j < message.additionalVariables.length; ++j) + object.additionalVariables[j] = $root.google.cloud.connectors.v1.ConfigVariable.toObject(message.additionalVariables[j], options); + } + if (message.sshPublicKey != null && message.hasOwnProperty("sshPublicKey")) { + object.sshPublicKey = $root.google.cloud.connectors.v1.AuthConfig.SshPublicKey.toObject(message.sshPublicKey, options); + if (options.oneofs) + object.type = "sshPublicKey"; + } + return object; + }; + + /** + * Converts this AuthConfig to JSON. + * @function toJSON + * @memberof google.cloud.connectors.v1.AuthConfig + * @instance + * @returns {Object.} JSON object + */ + AuthConfig.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for AuthConfig + * @function getTypeUrl + * @memberof google.cloud.connectors.v1.AuthConfig + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + AuthConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.connectors.v1.AuthConfig"; + }; + + AuthConfig.UserPassword = (function() { + + /** + * Properties of a UserPassword. + * @memberof google.cloud.connectors.v1.AuthConfig + * @interface IUserPassword + * @property {string|null} [username] UserPassword username + * @property {google.cloud.connectors.v1.ISecret|null} [password] UserPassword password + */ + + /** + * Constructs a new UserPassword. + * @memberof google.cloud.connectors.v1.AuthConfig + * @classdesc Represents a UserPassword. + * @implements IUserPassword + * @constructor + * @param {google.cloud.connectors.v1.AuthConfig.IUserPassword=} [properties] Properties to set + */ + function UserPassword(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * UserPassword username. + * @member {string} username + * @memberof google.cloud.connectors.v1.AuthConfig.UserPassword + * @instance + */ + UserPassword.prototype.username = ""; + + /** + * UserPassword password. + * @member {google.cloud.connectors.v1.ISecret|null|undefined} password + * @memberof google.cloud.connectors.v1.AuthConfig.UserPassword + * @instance + */ + UserPassword.prototype.password = null; + + /** + * Creates a new UserPassword instance using the specified properties. + * @function create + * @memberof google.cloud.connectors.v1.AuthConfig.UserPassword + * @static + * @param {google.cloud.connectors.v1.AuthConfig.IUserPassword=} [properties] Properties to set + * @returns {google.cloud.connectors.v1.AuthConfig.UserPassword} UserPassword instance + */ + UserPassword.create = function create(properties) { + return new UserPassword(properties); + }; + + /** + * Encodes the specified UserPassword message. Does not implicitly {@link google.cloud.connectors.v1.AuthConfig.UserPassword.verify|verify} messages. + * @function encode + * @memberof google.cloud.connectors.v1.AuthConfig.UserPassword + * @static + * @param {google.cloud.connectors.v1.AuthConfig.IUserPassword} message UserPassword message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UserPassword.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.username != null && Object.hasOwnProperty.call(message, "username")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.username); + if (message.password != null && Object.hasOwnProperty.call(message, "password")) + $root.google.cloud.connectors.v1.Secret.encode(message.password, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified UserPassword message, length delimited. Does not implicitly {@link google.cloud.connectors.v1.AuthConfig.UserPassword.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.connectors.v1.AuthConfig.UserPassword + * @static + * @param {google.cloud.connectors.v1.AuthConfig.IUserPassword} message UserPassword message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UserPassword.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a UserPassword message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.connectors.v1.AuthConfig.UserPassword + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.connectors.v1.AuthConfig.UserPassword} UserPassword + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UserPassword.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.connectors.v1.AuthConfig.UserPassword(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.username = reader.string(); + break; + } + case 2: { + message.password = $root.google.cloud.connectors.v1.Secret.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a UserPassword message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.connectors.v1.AuthConfig.UserPassword + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.connectors.v1.AuthConfig.UserPassword} UserPassword + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UserPassword.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a UserPassword message. + * @function verify + * @memberof google.cloud.connectors.v1.AuthConfig.UserPassword + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + UserPassword.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.username != null && message.hasOwnProperty("username")) + if (!$util.isString(message.username)) + return "username: string expected"; + if (message.password != null && message.hasOwnProperty("password")) { + var error = $root.google.cloud.connectors.v1.Secret.verify(message.password); + if (error) + return "password." + error; + } + return null; + }; + + /** + * Creates a UserPassword message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.connectors.v1.AuthConfig.UserPassword + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.connectors.v1.AuthConfig.UserPassword} UserPassword + */ + UserPassword.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.connectors.v1.AuthConfig.UserPassword) + return object; + var message = new $root.google.cloud.connectors.v1.AuthConfig.UserPassword(); + if (object.username != null) + message.username = String(object.username); + if (object.password != null) { + if (typeof object.password !== "object") + throw TypeError(".google.cloud.connectors.v1.AuthConfig.UserPassword.password: object expected"); + message.password = $root.google.cloud.connectors.v1.Secret.fromObject(object.password); + } + return message; + }; + + /** + * Creates a plain object from a UserPassword message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.connectors.v1.AuthConfig.UserPassword + * @static + * @param {google.cloud.connectors.v1.AuthConfig.UserPassword} message UserPassword + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + UserPassword.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.username = ""; + object.password = null; + } + if (message.username != null && message.hasOwnProperty("username")) + object.username = message.username; + if (message.password != null && message.hasOwnProperty("password")) + object.password = $root.google.cloud.connectors.v1.Secret.toObject(message.password, options); + return object; + }; + + /** + * Converts this UserPassword to JSON. + * @function toJSON + * @memberof google.cloud.connectors.v1.AuthConfig.UserPassword + * @instance + * @returns {Object.} JSON object + */ + UserPassword.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for UserPassword + * @function getTypeUrl + * @memberof google.cloud.connectors.v1.AuthConfig.UserPassword + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + UserPassword.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.connectors.v1.AuthConfig.UserPassword"; + }; + + return UserPassword; + })(); + + AuthConfig.Oauth2JwtBearer = (function() { + + /** + * Properties of an Oauth2JwtBearer. + * @memberof google.cloud.connectors.v1.AuthConfig + * @interface IOauth2JwtBearer + * @property {google.cloud.connectors.v1.ISecret|null} [clientKey] Oauth2JwtBearer clientKey + * @property {google.cloud.connectors.v1.AuthConfig.Oauth2JwtBearer.IJwtClaims|null} [jwtClaims] Oauth2JwtBearer jwtClaims + */ + + /** + * Constructs a new Oauth2JwtBearer. + * @memberof google.cloud.connectors.v1.AuthConfig + * @classdesc Represents an Oauth2JwtBearer. + * @implements IOauth2JwtBearer + * @constructor + * @param {google.cloud.connectors.v1.AuthConfig.IOauth2JwtBearer=} [properties] Properties to set + */ + function Oauth2JwtBearer(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Oauth2JwtBearer clientKey. + * @member {google.cloud.connectors.v1.ISecret|null|undefined} clientKey + * @memberof google.cloud.connectors.v1.AuthConfig.Oauth2JwtBearer + * @instance + */ + Oauth2JwtBearer.prototype.clientKey = null; + + /** + * Oauth2JwtBearer jwtClaims. + * @member {google.cloud.connectors.v1.AuthConfig.Oauth2JwtBearer.IJwtClaims|null|undefined} jwtClaims + * @memberof google.cloud.connectors.v1.AuthConfig.Oauth2JwtBearer + * @instance + */ + Oauth2JwtBearer.prototype.jwtClaims = null; + + /** + * Creates a new Oauth2JwtBearer instance using the specified properties. + * @function create + * @memberof google.cloud.connectors.v1.AuthConfig.Oauth2JwtBearer + * @static + * @param {google.cloud.connectors.v1.AuthConfig.IOauth2JwtBearer=} [properties] Properties to set + * @returns {google.cloud.connectors.v1.AuthConfig.Oauth2JwtBearer} Oauth2JwtBearer instance + */ + Oauth2JwtBearer.create = function create(properties) { + return new Oauth2JwtBearer(properties); + }; + + /** + * Encodes the specified Oauth2JwtBearer message. Does not implicitly {@link google.cloud.connectors.v1.AuthConfig.Oauth2JwtBearer.verify|verify} messages. + * @function encode + * @memberof google.cloud.connectors.v1.AuthConfig.Oauth2JwtBearer + * @static + * @param {google.cloud.connectors.v1.AuthConfig.IOauth2JwtBearer} message Oauth2JwtBearer message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Oauth2JwtBearer.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.clientKey != null && Object.hasOwnProperty.call(message, "clientKey")) + $root.google.cloud.connectors.v1.Secret.encode(message.clientKey, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.jwtClaims != null && Object.hasOwnProperty.call(message, "jwtClaims")) + $root.google.cloud.connectors.v1.AuthConfig.Oauth2JwtBearer.JwtClaims.encode(message.jwtClaims, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified Oauth2JwtBearer message, length delimited. Does not implicitly {@link google.cloud.connectors.v1.AuthConfig.Oauth2JwtBearer.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.connectors.v1.AuthConfig.Oauth2JwtBearer + * @static + * @param {google.cloud.connectors.v1.AuthConfig.IOauth2JwtBearer} message Oauth2JwtBearer message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Oauth2JwtBearer.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an Oauth2JwtBearer message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.connectors.v1.AuthConfig.Oauth2JwtBearer + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.connectors.v1.AuthConfig.Oauth2JwtBearer} Oauth2JwtBearer + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Oauth2JwtBearer.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.connectors.v1.AuthConfig.Oauth2JwtBearer(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.clientKey = $root.google.cloud.connectors.v1.Secret.decode(reader, reader.uint32()); + break; + } + case 2: { + message.jwtClaims = $root.google.cloud.connectors.v1.AuthConfig.Oauth2JwtBearer.JwtClaims.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an Oauth2JwtBearer message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.connectors.v1.AuthConfig.Oauth2JwtBearer + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.connectors.v1.AuthConfig.Oauth2JwtBearer} Oauth2JwtBearer + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Oauth2JwtBearer.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an Oauth2JwtBearer message. + * @function verify + * @memberof google.cloud.connectors.v1.AuthConfig.Oauth2JwtBearer + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Oauth2JwtBearer.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.clientKey != null && message.hasOwnProperty("clientKey")) { + var error = $root.google.cloud.connectors.v1.Secret.verify(message.clientKey); + if (error) + return "clientKey." + error; + } + if (message.jwtClaims != null && message.hasOwnProperty("jwtClaims")) { + var error = $root.google.cloud.connectors.v1.AuthConfig.Oauth2JwtBearer.JwtClaims.verify(message.jwtClaims); + if (error) + return "jwtClaims." + error; + } + return null; + }; + + /** + * Creates an Oauth2JwtBearer message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.connectors.v1.AuthConfig.Oauth2JwtBearer + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.connectors.v1.AuthConfig.Oauth2JwtBearer} Oauth2JwtBearer + */ + Oauth2JwtBearer.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.connectors.v1.AuthConfig.Oauth2JwtBearer) + return object; + var message = new $root.google.cloud.connectors.v1.AuthConfig.Oauth2JwtBearer(); + if (object.clientKey != null) { + if (typeof object.clientKey !== "object") + throw TypeError(".google.cloud.connectors.v1.AuthConfig.Oauth2JwtBearer.clientKey: object expected"); + message.clientKey = $root.google.cloud.connectors.v1.Secret.fromObject(object.clientKey); + } + if (object.jwtClaims != null) { + if (typeof object.jwtClaims !== "object") + throw TypeError(".google.cloud.connectors.v1.AuthConfig.Oauth2JwtBearer.jwtClaims: object expected"); + message.jwtClaims = $root.google.cloud.connectors.v1.AuthConfig.Oauth2JwtBearer.JwtClaims.fromObject(object.jwtClaims); + } + return message; + }; + + /** + * Creates a plain object from an Oauth2JwtBearer message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.connectors.v1.AuthConfig.Oauth2JwtBearer + * @static + * @param {google.cloud.connectors.v1.AuthConfig.Oauth2JwtBearer} message Oauth2JwtBearer + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Oauth2JwtBearer.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.clientKey = null; + object.jwtClaims = null; + } + if (message.clientKey != null && message.hasOwnProperty("clientKey")) + object.clientKey = $root.google.cloud.connectors.v1.Secret.toObject(message.clientKey, options); + if (message.jwtClaims != null && message.hasOwnProperty("jwtClaims")) + object.jwtClaims = $root.google.cloud.connectors.v1.AuthConfig.Oauth2JwtBearer.JwtClaims.toObject(message.jwtClaims, options); + return object; + }; + + /** + * Converts this Oauth2JwtBearer to JSON. + * @function toJSON + * @memberof google.cloud.connectors.v1.AuthConfig.Oauth2JwtBearer + * @instance + * @returns {Object.} JSON object + */ + Oauth2JwtBearer.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Oauth2JwtBearer + * @function getTypeUrl + * @memberof google.cloud.connectors.v1.AuthConfig.Oauth2JwtBearer + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Oauth2JwtBearer.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.connectors.v1.AuthConfig.Oauth2JwtBearer"; + }; + + Oauth2JwtBearer.JwtClaims = (function() { + + /** + * Properties of a JwtClaims. + * @memberof google.cloud.connectors.v1.AuthConfig.Oauth2JwtBearer + * @interface IJwtClaims + * @property {string|null} [issuer] JwtClaims issuer + * @property {string|null} [subject] JwtClaims subject + * @property {string|null} [audience] JwtClaims audience + */ + + /** + * Constructs a new JwtClaims. + * @memberof google.cloud.connectors.v1.AuthConfig.Oauth2JwtBearer + * @classdesc Represents a JwtClaims. + * @implements IJwtClaims + * @constructor + * @param {google.cloud.connectors.v1.AuthConfig.Oauth2JwtBearer.IJwtClaims=} [properties] Properties to set + */ + function JwtClaims(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * JwtClaims issuer. + * @member {string} issuer + * @memberof google.cloud.connectors.v1.AuthConfig.Oauth2JwtBearer.JwtClaims + * @instance + */ + JwtClaims.prototype.issuer = ""; + + /** + * JwtClaims subject. + * @member {string} subject + * @memberof google.cloud.connectors.v1.AuthConfig.Oauth2JwtBearer.JwtClaims + * @instance + */ + JwtClaims.prototype.subject = ""; + + /** + * JwtClaims audience. + * @member {string} audience + * @memberof google.cloud.connectors.v1.AuthConfig.Oauth2JwtBearer.JwtClaims + * @instance + */ + JwtClaims.prototype.audience = ""; + + /** + * Creates a new JwtClaims instance using the specified properties. + * @function create + * @memberof google.cloud.connectors.v1.AuthConfig.Oauth2JwtBearer.JwtClaims + * @static + * @param {google.cloud.connectors.v1.AuthConfig.Oauth2JwtBearer.IJwtClaims=} [properties] Properties to set + * @returns {google.cloud.connectors.v1.AuthConfig.Oauth2JwtBearer.JwtClaims} JwtClaims instance + */ + JwtClaims.create = function create(properties) { + return new JwtClaims(properties); + }; + + /** + * Encodes the specified JwtClaims message. Does not implicitly {@link google.cloud.connectors.v1.AuthConfig.Oauth2JwtBearer.JwtClaims.verify|verify} messages. + * @function encode + * @memberof google.cloud.connectors.v1.AuthConfig.Oauth2JwtBearer.JwtClaims + * @static + * @param {google.cloud.connectors.v1.AuthConfig.Oauth2JwtBearer.IJwtClaims} message JwtClaims message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + JwtClaims.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.issuer != null && Object.hasOwnProperty.call(message, "issuer")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.issuer); + if (message.subject != null && Object.hasOwnProperty.call(message, "subject")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.subject); + if (message.audience != null && Object.hasOwnProperty.call(message, "audience")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.audience); + return writer; + }; + + /** + * Encodes the specified JwtClaims message, length delimited. Does not implicitly {@link google.cloud.connectors.v1.AuthConfig.Oauth2JwtBearer.JwtClaims.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.connectors.v1.AuthConfig.Oauth2JwtBearer.JwtClaims + * @static + * @param {google.cloud.connectors.v1.AuthConfig.Oauth2JwtBearer.IJwtClaims} message JwtClaims message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + JwtClaims.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a JwtClaims message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.connectors.v1.AuthConfig.Oauth2JwtBearer.JwtClaims + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.connectors.v1.AuthConfig.Oauth2JwtBearer.JwtClaims} JwtClaims + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + JwtClaims.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.connectors.v1.AuthConfig.Oauth2JwtBearer.JwtClaims(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.issuer = reader.string(); + break; + } + case 2: { + message.subject = reader.string(); + break; + } + case 3: { + message.audience = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a JwtClaims message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.connectors.v1.AuthConfig.Oauth2JwtBearer.JwtClaims + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.connectors.v1.AuthConfig.Oauth2JwtBearer.JwtClaims} JwtClaims + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + JwtClaims.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a JwtClaims message. + * @function verify + * @memberof google.cloud.connectors.v1.AuthConfig.Oauth2JwtBearer.JwtClaims + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + JwtClaims.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.issuer != null && message.hasOwnProperty("issuer")) + if (!$util.isString(message.issuer)) + return "issuer: string expected"; + if (message.subject != null && message.hasOwnProperty("subject")) + if (!$util.isString(message.subject)) + return "subject: string expected"; + if (message.audience != null && message.hasOwnProperty("audience")) + if (!$util.isString(message.audience)) + return "audience: string expected"; + return null; + }; + + /** + * Creates a JwtClaims message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.connectors.v1.AuthConfig.Oauth2JwtBearer.JwtClaims + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.connectors.v1.AuthConfig.Oauth2JwtBearer.JwtClaims} JwtClaims + */ + JwtClaims.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.connectors.v1.AuthConfig.Oauth2JwtBearer.JwtClaims) + return object; + var message = new $root.google.cloud.connectors.v1.AuthConfig.Oauth2JwtBearer.JwtClaims(); + if (object.issuer != null) + message.issuer = String(object.issuer); + if (object.subject != null) + message.subject = String(object.subject); + if (object.audience != null) + message.audience = String(object.audience); + return message; + }; + + /** + * Creates a plain object from a JwtClaims message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.connectors.v1.AuthConfig.Oauth2JwtBearer.JwtClaims + * @static + * @param {google.cloud.connectors.v1.AuthConfig.Oauth2JwtBearer.JwtClaims} message JwtClaims + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + JwtClaims.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.issuer = ""; + object.subject = ""; + object.audience = ""; + } + if (message.issuer != null && message.hasOwnProperty("issuer")) + object.issuer = message.issuer; + if (message.subject != null && message.hasOwnProperty("subject")) + object.subject = message.subject; + if (message.audience != null && message.hasOwnProperty("audience")) + object.audience = message.audience; + return object; + }; + + /** + * Converts this JwtClaims to JSON. + * @function toJSON + * @memberof google.cloud.connectors.v1.AuthConfig.Oauth2JwtBearer.JwtClaims + * @instance + * @returns {Object.} JSON object + */ + JwtClaims.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for JwtClaims + * @function getTypeUrl + * @memberof google.cloud.connectors.v1.AuthConfig.Oauth2JwtBearer.JwtClaims + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + JwtClaims.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.connectors.v1.AuthConfig.Oauth2JwtBearer.JwtClaims"; + }; + + return JwtClaims; + })(); + + return Oauth2JwtBearer; + })(); + + AuthConfig.Oauth2ClientCredentials = (function() { + + /** + * Properties of an Oauth2ClientCredentials. + * @memberof google.cloud.connectors.v1.AuthConfig + * @interface IOauth2ClientCredentials + * @property {string|null} [clientId] Oauth2ClientCredentials clientId + * @property {google.cloud.connectors.v1.ISecret|null} [clientSecret] Oauth2ClientCredentials clientSecret + */ + + /** + * Constructs a new Oauth2ClientCredentials. + * @memberof google.cloud.connectors.v1.AuthConfig + * @classdesc Represents an Oauth2ClientCredentials. + * @implements IOauth2ClientCredentials + * @constructor + * @param {google.cloud.connectors.v1.AuthConfig.IOauth2ClientCredentials=} [properties] Properties to set + */ + function Oauth2ClientCredentials(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Oauth2ClientCredentials clientId. + * @member {string} clientId + * @memberof google.cloud.connectors.v1.AuthConfig.Oauth2ClientCredentials + * @instance + */ + Oauth2ClientCredentials.prototype.clientId = ""; + + /** + * Oauth2ClientCredentials clientSecret. + * @member {google.cloud.connectors.v1.ISecret|null|undefined} clientSecret + * @memberof google.cloud.connectors.v1.AuthConfig.Oauth2ClientCredentials + * @instance + */ + Oauth2ClientCredentials.prototype.clientSecret = null; + + /** + * Creates a new Oauth2ClientCredentials instance using the specified properties. + * @function create + * @memberof google.cloud.connectors.v1.AuthConfig.Oauth2ClientCredentials + * @static + * @param {google.cloud.connectors.v1.AuthConfig.IOauth2ClientCredentials=} [properties] Properties to set + * @returns {google.cloud.connectors.v1.AuthConfig.Oauth2ClientCredentials} Oauth2ClientCredentials instance + */ + Oauth2ClientCredentials.create = function create(properties) { + return new Oauth2ClientCredentials(properties); + }; + + /** + * Encodes the specified Oauth2ClientCredentials message. Does not implicitly {@link google.cloud.connectors.v1.AuthConfig.Oauth2ClientCredentials.verify|verify} messages. + * @function encode + * @memberof google.cloud.connectors.v1.AuthConfig.Oauth2ClientCredentials + * @static + * @param {google.cloud.connectors.v1.AuthConfig.IOauth2ClientCredentials} message Oauth2ClientCredentials message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Oauth2ClientCredentials.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.clientId != null && Object.hasOwnProperty.call(message, "clientId")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.clientId); + if (message.clientSecret != null && Object.hasOwnProperty.call(message, "clientSecret")) + $root.google.cloud.connectors.v1.Secret.encode(message.clientSecret, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified Oauth2ClientCredentials message, length delimited. Does not implicitly {@link google.cloud.connectors.v1.AuthConfig.Oauth2ClientCredentials.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.connectors.v1.AuthConfig.Oauth2ClientCredentials + * @static + * @param {google.cloud.connectors.v1.AuthConfig.IOauth2ClientCredentials} message Oauth2ClientCredentials message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Oauth2ClientCredentials.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an Oauth2ClientCredentials message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.connectors.v1.AuthConfig.Oauth2ClientCredentials + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.connectors.v1.AuthConfig.Oauth2ClientCredentials} Oauth2ClientCredentials + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Oauth2ClientCredentials.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.connectors.v1.AuthConfig.Oauth2ClientCredentials(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.clientId = reader.string(); + break; + } + case 2: { + message.clientSecret = $root.google.cloud.connectors.v1.Secret.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an Oauth2ClientCredentials message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.connectors.v1.AuthConfig.Oauth2ClientCredentials + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.connectors.v1.AuthConfig.Oauth2ClientCredentials} Oauth2ClientCredentials + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Oauth2ClientCredentials.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an Oauth2ClientCredentials message. + * @function verify + * @memberof google.cloud.connectors.v1.AuthConfig.Oauth2ClientCredentials + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Oauth2ClientCredentials.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.clientId != null && message.hasOwnProperty("clientId")) + if (!$util.isString(message.clientId)) + return "clientId: string expected"; + if (message.clientSecret != null && message.hasOwnProperty("clientSecret")) { + var error = $root.google.cloud.connectors.v1.Secret.verify(message.clientSecret); + if (error) + return "clientSecret." + error; + } + return null; + }; + + /** + * Creates an Oauth2ClientCredentials message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.connectors.v1.AuthConfig.Oauth2ClientCredentials + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.connectors.v1.AuthConfig.Oauth2ClientCredentials} Oauth2ClientCredentials + */ + Oauth2ClientCredentials.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.connectors.v1.AuthConfig.Oauth2ClientCredentials) + return object; + var message = new $root.google.cloud.connectors.v1.AuthConfig.Oauth2ClientCredentials(); + if (object.clientId != null) + message.clientId = String(object.clientId); + if (object.clientSecret != null) { + if (typeof object.clientSecret !== "object") + throw TypeError(".google.cloud.connectors.v1.AuthConfig.Oauth2ClientCredentials.clientSecret: object expected"); + message.clientSecret = $root.google.cloud.connectors.v1.Secret.fromObject(object.clientSecret); + } + return message; + }; + + /** + * Creates a plain object from an Oauth2ClientCredentials message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.connectors.v1.AuthConfig.Oauth2ClientCredentials + * @static + * @param {google.cloud.connectors.v1.AuthConfig.Oauth2ClientCredentials} message Oauth2ClientCredentials + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Oauth2ClientCredentials.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.clientId = ""; + object.clientSecret = null; + } + if (message.clientId != null && message.hasOwnProperty("clientId")) + object.clientId = message.clientId; + if (message.clientSecret != null && message.hasOwnProperty("clientSecret")) + object.clientSecret = $root.google.cloud.connectors.v1.Secret.toObject(message.clientSecret, options); + return object; + }; + + /** + * Converts this Oauth2ClientCredentials to JSON. + * @function toJSON + * @memberof google.cloud.connectors.v1.AuthConfig.Oauth2ClientCredentials + * @instance + * @returns {Object.} JSON object + */ + Oauth2ClientCredentials.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Oauth2ClientCredentials + * @function getTypeUrl + * @memberof google.cloud.connectors.v1.AuthConfig.Oauth2ClientCredentials + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Oauth2ClientCredentials.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.connectors.v1.AuthConfig.Oauth2ClientCredentials"; + }; + + return Oauth2ClientCredentials; + })(); + + AuthConfig.SshPublicKey = (function() { + + /** + * Properties of a SshPublicKey. + * @memberof google.cloud.connectors.v1.AuthConfig + * @interface ISshPublicKey + * @property {string|null} [username] SshPublicKey username + * @property {google.cloud.connectors.v1.ISecret|null} [sshClientCert] SshPublicKey sshClientCert + * @property {string|null} [certType] SshPublicKey certType + * @property {google.cloud.connectors.v1.ISecret|null} [sshClientCertPass] SshPublicKey sshClientCertPass + */ + + /** + * Constructs a new SshPublicKey. + * @memberof google.cloud.connectors.v1.AuthConfig + * @classdesc Represents a SshPublicKey. + * @implements ISshPublicKey + * @constructor + * @param {google.cloud.connectors.v1.AuthConfig.ISshPublicKey=} [properties] Properties to set + */ + function SshPublicKey(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * SshPublicKey username. + * @member {string} username + * @memberof google.cloud.connectors.v1.AuthConfig.SshPublicKey + * @instance + */ + SshPublicKey.prototype.username = ""; + + /** + * SshPublicKey sshClientCert. + * @member {google.cloud.connectors.v1.ISecret|null|undefined} sshClientCert + * @memberof google.cloud.connectors.v1.AuthConfig.SshPublicKey + * @instance + */ + SshPublicKey.prototype.sshClientCert = null; + + /** + * SshPublicKey certType. + * @member {string} certType + * @memberof google.cloud.connectors.v1.AuthConfig.SshPublicKey + * @instance + */ + SshPublicKey.prototype.certType = ""; + + /** + * SshPublicKey sshClientCertPass. + * @member {google.cloud.connectors.v1.ISecret|null|undefined} sshClientCertPass + * @memberof google.cloud.connectors.v1.AuthConfig.SshPublicKey + * @instance + */ + SshPublicKey.prototype.sshClientCertPass = null; + + /** + * Creates a new SshPublicKey instance using the specified properties. + * @function create + * @memberof google.cloud.connectors.v1.AuthConfig.SshPublicKey + * @static + * @param {google.cloud.connectors.v1.AuthConfig.ISshPublicKey=} [properties] Properties to set + * @returns {google.cloud.connectors.v1.AuthConfig.SshPublicKey} SshPublicKey instance + */ + SshPublicKey.create = function create(properties) { + return new SshPublicKey(properties); + }; + + /** + * Encodes the specified SshPublicKey message. Does not implicitly {@link google.cloud.connectors.v1.AuthConfig.SshPublicKey.verify|verify} messages. + * @function encode + * @memberof google.cloud.connectors.v1.AuthConfig.SshPublicKey + * @static + * @param {google.cloud.connectors.v1.AuthConfig.ISshPublicKey} message SshPublicKey message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SshPublicKey.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.username != null && Object.hasOwnProperty.call(message, "username")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.username); + if (message.sshClientCert != null && Object.hasOwnProperty.call(message, "sshClientCert")) + $root.google.cloud.connectors.v1.Secret.encode(message.sshClientCert, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.certType != null && Object.hasOwnProperty.call(message, "certType")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.certType); + if (message.sshClientCertPass != null && Object.hasOwnProperty.call(message, "sshClientCertPass")) + $root.google.cloud.connectors.v1.Secret.encode(message.sshClientCertPass, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified SshPublicKey message, length delimited. Does not implicitly {@link google.cloud.connectors.v1.AuthConfig.SshPublicKey.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.connectors.v1.AuthConfig.SshPublicKey + * @static + * @param {google.cloud.connectors.v1.AuthConfig.ISshPublicKey} message SshPublicKey message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SshPublicKey.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a SshPublicKey message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.connectors.v1.AuthConfig.SshPublicKey + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.connectors.v1.AuthConfig.SshPublicKey} SshPublicKey + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SshPublicKey.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.connectors.v1.AuthConfig.SshPublicKey(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.username = reader.string(); + break; + } + case 3: { + message.sshClientCert = $root.google.cloud.connectors.v1.Secret.decode(reader, reader.uint32()); + break; + } + case 4: { + message.certType = reader.string(); + break; + } + case 5: { + message.sshClientCertPass = $root.google.cloud.connectors.v1.Secret.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a SshPublicKey message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.connectors.v1.AuthConfig.SshPublicKey + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.connectors.v1.AuthConfig.SshPublicKey} SshPublicKey + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SshPublicKey.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a SshPublicKey message. + * @function verify + * @memberof google.cloud.connectors.v1.AuthConfig.SshPublicKey + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + SshPublicKey.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.username != null && message.hasOwnProperty("username")) + if (!$util.isString(message.username)) + return "username: string expected"; + if (message.sshClientCert != null && message.hasOwnProperty("sshClientCert")) { + var error = $root.google.cloud.connectors.v1.Secret.verify(message.sshClientCert); + if (error) + return "sshClientCert." + error; + } + if (message.certType != null && message.hasOwnProperty("certType")) + if (!$util.isString(message.certType)) + return "certType: string expected"; + if (message.sshClientCertPass != null && message.hasOwnProperty("sshClientCertPass")) { + var error = $root.google.cloud.connectors.v1.Secret.verify(message.sshClientCertPass); + if (error) + return "sshClientCertPass." + error; + } + return null; + }; + + /** + * Creates a SshPublicKey message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.connectors.v1.AuthConfig.SshPublicKey + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.connectors.v1.AuthConfig.SshPublicKey} SshPublicKey + */ + SshPublicKey.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.connectors.v1.AuthConfig.SshPublicKey) + return object; + var message = new $root.google.cloud.connectors.v1.AuthConfig.SshPublicKey(); + if (object.username != null) + message.username = String(object.username); + if (object.sshClientCert != null) { + if (typeof object.sshClientCert !== "object") + throw TypeError(".google.cloud.connectors.v1.AuthConfig.SshPublicKey.sshClientCert: object expected"); + message.sshClientCert = $root.google.cloud.connectors.v1.Secret.fromObject(object.sshClientCert); + } + if (object.certType != null) + message.certType = String(object.certType); + if (object.sshClientCertPass != null) { + if (typeof object.sshClientCertPass !== "object") + throw TypeError(".google.cloud.connectors.v1.AuthConfig.SshPublicKey.sshClientCertPass: object expected"); + message.sshClientCertPass = $root.google.cloud.connectors.v1.Secret.fromObject(object.sshClientCertPass); + } + return message; + }; + + /** + * Creates a plain object from a SshPublicKey message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.connectors.v1.AuthConfig.SshPublicKey + * @static + * @param {google.cloud.connectors.v1.AuthConfig.SshPublicKey} message SshPublicKey + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + SshPublicKey.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.username = ""; + object.sshClientCert = null; + object.certType = ""; + object.sshClientCertPass = null; + } + if (message.username != null && message.hasOwnProperty("username")) + object.username = message.username; + if (message.sshClientCert != null && message.hasOwnProperty("sshClientCert")) + object.sshClientCert = $root.google.cloud.connectors.v1.Secret.toObject(message.sshClientCert, options); + if (message.certType != null && message.hasOwnProperty("certType")) + object.certType = message.certType; + if (message.sshClientCertPass != null && message.hasOwnProperty("sshClientCertPass")) + object.sshClientCertPass = $root.google.cloud.connectors.v1.Secret.toObject(message.sshClientCertPass, options); + return object; + }; + + /** + * Converts this SshPublicKey to JSON. + * @function toJSON + * @memberof google.cloud.connectors.v1.AuthConfig.SshPublicKey + * @instance + * @returns {Object.} JSON object + */ + SshPublicKey.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for SshPublicKey + * @function getTypeUrl + * @memberof google.cloud.connectors.v1.AuthConfig.SshPublicKey + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + SshPublicKey.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.connectors.v1.AuthConfig.SshPublicKey"; + }; + + return SshPublicKey; + })(); + + return AuthConfig; + })(); + + v1.AuthConfigTemplate = (function() { + + /** + * Properties of an AuthConfigTemplate. + * @memberof google.cloud.connectors.v1 + * @interface IAuthConfigTemplate + * @property {google.cloud.connectors.v1.AuthType|null} [authType] AuthConfigTemplate authType + * @property {Array.|null} [configVariableTemplates] AuthConfigTemplate configVariableTemplates + * @property {string|null} [displayName] AuthConfigTemplate displayName + * @property {string|null} [description] AuthConfigTemplate description + */ + + /** + * Constructs a new AuthConfigTemplate. + * @memberof google.cloud.connectors.v1 + * @classdesc Represents an AuthConfigTemplate. + * @implements IAuthConfigTemplate + * @constructor + * @param {google.cloud.connectors.v1.IAuthConfigTemplate=} [properties] Properties to set + */ + function AuthConfigTemplate(properties) { + this.configVariableTemplates = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * AuthConfigTemplate authType. + * @member {google.cloud.connectors.v1.AuthType} authType + * @memberof google.cloud.connectors.v1.AuthConfigTemplate + * @instance + */ + AuthConfigTemplate.prototype.authType = 0; + + /** + * AuthConfigTemplate configVariableTemplates. + * @member {Array.} configVariableTemplates + * @memberof google.cloud.connectors.v1.AuthConfigTemplate + * @instance + */ + AuthConfigTemplate.prototype.configVariableTemplates = $util.emptyArray; + + /** + * AuthConfigTemplate displayName. + * @member {string} displayName + * @memberof google.cloud.connectors.v1.AuthConfigTemplate + * @instance + */ + AuthConfigTemplate.prototype.displayName = ""; + + /** + * AuthConfigTemplate description. + * @member {string} description + * @memberof google.cloud.connectors.v1.AuthConfigTemplate + * @instance + */ + AuthConfigTemplate.prototype.description = ""; + + /** + * Creates a new AuthConfigTemplate instance using the specified properties. + * @function create + * @memberof google.cloud.connectors.v1.AuthConfigTemplate + * @static + * @param {google.cloud.connectors.v1.IAuthConfigTemplate=} [properties] Properties to set + * @returns {google.cloud.connectors.v1.AuthConfigTemplate} AuthConfigTemplate instance + */ + AuthConfigTemplate.create = function create(properties) { + return new AuthConfigTemplate(properties); + }; + + /** + * Encodes the specified AuthConfigTemplate message. Does not implicitly {@link google.cloud.connectors.v1.AuthConfigTemplate.verify|verify} messages. + * @function encode + * @memberof google.cloud.connectors.v1.AuthConfigTemplate + * @static + * @param {google.cloud.connectors.v1.IAuthConfigTemplate} message AuthConfigTemplate message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AuthConfigTemplate.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.authType != null && Object.hasOwnProperty.call(message, "authType")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.authType); + if (message.configVariableTemplates != null && message.configVariableTemplates.length) + for (var i = 0; i < message.configVariableTemplates.length; ++i) + $root.google.cloud.connectors.v1.ConfigVariableTemplate.encode(message.configVariableTemplates[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.displayName != null && Object.hasOwnProperty.call(message, "displayName")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.displayName); + if (message.description != null && Object.hasOwnProperty.call(message, "description")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.description); + return writer; + }; + + /** + * Encodes the specified AuthConfigTemplate message, length delimited. Does not implicitly {@link google.cloud.connectors.v1.AuthConfigTemplate.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.connectors.v1.AuthConfigTemplate + * @static + * @param {google.cloud.connectors.v1.IAuthConfigTemplate} message AuthConfigTemplate message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AuthConfigTemplate.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an AuthConfigTemplate message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.connectors.v1.AuthConfigTemplate + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.connectors.v1.AuthConfigTemplate} AuthConfigTemplate + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AuthConfigTemplate.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.connectors.v1.AuthConfigTemplate(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.authType = reader.int32(); + break; + } + case 2: { + if (!(message.configVariableTemplates && message.configVariableTemplates.length)) + message.configVariableTemplates = []; + message.configVariableTemplates.push($root.google.cloud.connectors.v1.ConfigVariableTemplate.decode(reader, reader.uint32())); + break; + } + case 3: { + message.displayName = reader.string(); + break; + } + case 4: { + message.description = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an AuthConfigTemplate message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.connectors.v1.AuthConfigTemplate + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.connectors.v1.AuthConfigTemplate} AuthConfigTemplate + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AuthConfigTemplate.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an AuthConfigTemplate message. + * @function verify + * @memberof google.cloud.connectors.v1.AuthConfigTemplate + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + AuthConfigTemplate.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.authType != null && message.hasOwnProperty("authType")) + switch (message.authType) { + default: + return "authType: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + case 5: + break; + } + if (message.configVariableTemplates != null && message.hasOwnProperty("configVariableTemplates")) { + if (!Array.isArray(message.configVariableTemplates)) + return "configVariableTemplates: array expected"; + for (var i = 0; i < message.configVariableTemplates.length; ++i) { + var error = $root.google.cloud.connectors.v1.ConfigVariableTemplate.verify(message.configVariableTemplates[i]); + if (error) + return "configVariableTemplates." + error; + } + } + if (message.displayName != null && message.hasOwnProperty("displayName")) + if (!$util.isString(message.displayName)) + return "displayName: string expected"; + if (message.description != null && message.hasOwnProperty("description")) + if (!$util.isString(message.description)) + return "description: string expected"; + return null; + }; + + /** + * Creates an AuthConfigTemplate message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.connectors.v1.AuthConfigTemplate + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.connectors.v1.AuthConfigTemplate} AuthConfigTemplate + */ + AuthConfigTemplate.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.connectors.v1.AuthConfigTemplate) + return object; + var message = new $root.google.cloud.connectors.v1.AuthConfigTemplate(); + switch (object.authType) { + default: + if (typeof object.authType === "number") { + message.authType = object.authType; + break; + } + break; + case "AUTH_TYPE_UNSPECIFIED": + case 0: + message.authType = 0; + break; + case "USER_PASSWORD": + case 1: + message.authType = 1; + break; + case "OAUTH2_JWT_BEARER": + case 2: + message.authType = 2; + break; + case "OAUTH2_CLIENT_CREDENTIALS": + case 3: + message.authType = 3; + break; + case "SSH_PUBLIC_KEY": + case 4: + message.authType = 4; + break; + case "OAUTH2_AUTH_CODE_FLOW": + case 5: + message.authType = 5; + break; + } + if (object.configVariableTemplates) { + if (!Array.isArray(object.configVariableTemplates)) + throw TypeError(".google.cloud.connectors.v1.AuthConfigTemplate.configVariableTemplates: array expected"); + message.configVariableTemplates = []; + for (var i = 0; i < object.configVariableTemplates.length; ++i) { + if (typeof object.configVariableTemplates[i] !== "object") + throw TypeError(".google.cloud.connectors.v1.AuthConfigTemplate.configVariableTemplates: object expected"); + message.configVariableTemplates[i] = $root.google.cloud.connectors.v1.ConfigVariableTemplate.fromObject(object.configVariableTemplates[i]); + } + } + if (object.displayName != null) + message.displayName = String(object.displayName); + if (object.description != null) + message.description = String(object.description); + return message; + }; + + /** + * Creates a plain object from an AuthConfigTemplate message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.connectors.v1.AuthConfigTemplate + * @static + * @param {google.cloud.connectors.v1.AuthConfigTemplate} message AuthConfigTemplate + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + AuthConfigTemplate.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.configVariableTemplates = []; + if (options.defaults) { + object.authType = options.enums === String ? "AUTH_TYPE_UNSPECIFIED" : 0; + object.displayName = ""; + object.description = ""; + } + if (message.authType != null && message.hasOwnProperty("authType")) + object.authType = options.enums === String ? $root.google.cloud.connectors.v1.AuthType[message.authType] === undefined ? message.authType : $root.google.cloud.connectors.v1.AuthType[message.authType] : message.authType; + if (message.configVariableTemplates && message.configVariableTemplates.length) { + object.configVariableTemplates = []; + for (var j = 0; j < message.configVariableTemplates.length; ++j) + object.configVariableTemplates[j] = $root.google.cloud.connectors.v1.ConfigVariableTemplate.toObject(message.configVariableTemplates[j], options); + } + if (message.displayName != null && message.hasOwnProperty("displayName")) + object.displayName = message.displayName; + if (message.description != null && message.hasOwnProperty("description")) + object.description = message.description; + return object; + }; + + /** + * Converts this AuthConfigTemplate to JSON. + * @function toJSON + * @memberof google.cloud.connectors.v1.AuthConfigTemplate + * @instance + * @returns {Object.} JSON object + */ + AuthConfigTemplate.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for AuthConfigTemplate + * @function getTypeUrl + * @memberof google.cloud.connectors.v1.AuthConfigTemplate + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + AuthConfigTemplate.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.connectors.v1.AuthConfigTemplate"; + }; + + return AuthConfigTemplate; + })(); + + /** + * AuthType enum. + * @name google.cloud.connectors.v1.AuthType + * @enum {number} + * @property {number} AUTH_TYPE_UNSPECIFIED=0 AUTH_TYPE_UNSPECIFIED value + * @property {number} USER_PASSWORD=1 USER_PASSWORD value + * @property {number} OAUTH2_JWT_BEARER=2 OAUTH2_JWT_BEARER value + * @property {number} OAUTH2_CLIENT_CREDENTIALS=3 OAUTH2_CLIENT_CREDENTIALS value + * @property {number} SSH_PUBLIC_KEY=4 SSH_PUBLIC_KEY value + * @property {number} OAUTH2_AUTH_CODE_FLOW=5 OAUTH2_AUTH_CODE_FLOW value + */ + v1.AuthType = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "AUTH_TYPE_UNSPECIFIED"] = 0; + values[valuesById[1] = "USER_PASSWORD"] = 1; + values[valuesById[2] = "OAUTH2_JWT_BEARER"] = 2; + values[valuesById[3] = "OAUTH2_CLIENT_CREDENTIALS"] = 3; + values[valuesById[4] = "SSH_PUBLIC_KEY"] = 4; + values[valuesById[5] = "OAUTH2_AUTH_CODE_FLOW"] = 5; + return values; + })(); + + v1.OperationMetadata = (function() { + + /** + * Properties of an OperationMetadata. + * @memberof google.cloud.connectors.v1 + * @interface IOperationMetadata + * @property {google.protobuf.ITimestamp|null} [createTime] OperationMetadata createTime + * @property {google.protobuf.ITimestamp|null} [endTime] OperationMetadata endTime + * @property {string|null} [target] OperationMetadata target + * @property {string|null} [verb] OperationMetadata verb + * @property {string|null} [statusMessage] OperationMetadata statusMessage + * @property {boolean|null} [requestedCancellation] OperationMetadata requestedCancellation + * @property {string|null} [apiVersion] OperationMetadata apiVersion + */ + + /** + * Constructs a new OperationMetadata. + * @memberof google.cloud.connectors.v1 + * @classdesc Represents an OperationMetadata. + * @implements IOperationMetadata + * @constructor + * @param {google.cloud.connectors.v1.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.connectors.v1.OperationMetadata + * @instance + */ + OperationMetadata.prototype.createTime = null; + + /** + * OperationMetadata endTime. + * @member {google.protobuf.ITimestamp|null|undefined} endTime + * @memberof google.cloud.connectors.v1.OperationMetadata + * @instance + */ + OperationMetadata.prototype.endTime = null; + + /** + * OperationMetadata target. + * @member {string} target + * @memberof google.cloud.connectors.v1.OperationMetadata + * @instance + */ + OperationMetadata.prototype.target = ""; + + /** + * OperationMetadata verb. + * @member {string} verb + * @memberof google.cloud.connectors.v1.OperationMetadata + * @instance + */ + OperationMetadata.prototype.verb = ""; + + /** + * OperationMetadata statusMessage. + * @member {string} statusMessage + * @memberof google.cloud.connectors.v1.OperationMetadata + * @instance + */ + OperationMetadata.prototype.statusMessage = ""; + + /** + * OperationMetadata requestedCancellation. + * @member {boolean} requestedCancellation + * @memberof google.cloud.connectors.v1.OperationMetadata + * @instance + */ + OperationMetadata.prototype.requestedCancellation = false; + + /** + * OperationMetadata apiVersion. + * @member {string} apiVersion + * @memberof google.cloud.connectors.v1.OperationMetadata + * @instance + */ + OperationMetadata.prototype.apiVersion = ""; + + /** + * Creates a new OperationMetadata instance using the specified properties. + * @function create + * @memberof google.cloud.connectors.v1.OperationMetadata + * @static + * @param {google.cloud.connectors.v1.IOperationMetadata=} [properties] Properties to set + * @returns {google.cloud.connectors.v1.OperationMetadata} OperationMetadata instance + */ + OperationMetadata.create = function create(properties) { + return new OperationMetadata(properties); + }; + + /** + * Encodes the specified OperationMetadata message. Does not implicitly {@link google.cloud.connectors.v1.OperationMetadata.verify|verify} messages. + * @function encode + * @memberof google.cloud.connectors.v1.OperationMetadata + * @static + * @param {google.cloud.connectors.v1.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.endTime != null && Object.hasOwnProperty.call(message, "endTime")) + $root.google.protobuf.Timestamp.encode(message.endTime, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.target != null && Object.hasOwnProperty.call(message, "target")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.target); + if (message.verb != null && Object.hasOwnProperty.call(message, "verb")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.verb); + if (message.statusMessage != null && Object.hasOwnProperty.call(message, "statusMessage")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.statusMessage); + if (message.requestedCancellation != null && Object.hasOwnProperty.call(message, "requestedCancellation")) + writer.uint32(/* id 6, wireType 0 =*/48).bool(message.requestedCancellation); + if (message.apiVersion != null && Object.hasOwnProperty.call(message, "apiVersion")) + writer.uint32(/* id 7, wireType 2 =*/58).string(message.apiVersion); + return writer; + }; + + /** + * Encodes the specified OperationMetadata message, length delimited. Does not implicitly {@link google.cloud.connectors.v1.OperationMetadata.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.connectors.v1.OperationMetadata + * @static + * @param {google.cloud.connectors.v1.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.connectors.v1.OperationMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.connectors.v1.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) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.connectors.v1.OperationMetadata(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.createTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 2: { + message.endTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 3: { + message.target = reader.string(); + break; + } + case 4: { + message.verb = reader.string(); + break; + } + case 5: { + message.statusMessage = reader.string(); + break; + } + case 6: { + message.requestedCancellation = reader.bool(); + break; + } + case 7: { + message.apiVersion = reader.string(); + 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.connectors.v1.OperationMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.connectors.v1.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.connectors.v1.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"; + if (message.createTime != null && message.hasOwnProperty("createTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.createTime); + if (error) + return "createTime." + error; + } + if (message.endTime != null && message.hasOwnProperty("endTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.endTime); + if (error) + return "endTime." + error; + } + if (message.target != null && message.hasOwnProperty("target")) + if (!$util.isString(message.target)) + return "target: string expected"; + if (message.verb != null && message.hasOwnProperty("verb")) + if (!$util.isString(message.verb)) + return "verb: string expected"; + if (message.statusMessage != null && message.hasOwnProperty("statusMessage")) + if (!$util.isString(message.statusMessage)) + return "statusMessage: string expected"; + if (message.requestedCancellation != null && message.hasOwnProperty("requestedCancellation")) + if (typeof message.requestedCancellation !== "boolean") + return "requestedCancellation: boolean expected"; + if (message.apiVersion != null && message.hasOwnProperty("apiVersion")) + if (!$util.isString(message.apiVersion)) + return "apiVersion: string expected"; + return null; + }; + + /** + * Creates an OperationMetadata message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.connectors.v1.OperationMetadata + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.connectors.v1.OperationMetadata} OperationMetadata + */ + OperationMetadata.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.connectors.v1.OperationMetadata) + return object; + var message = new $root.google.cloud.connectors.v1.OperationMetadata(); + if (object.createTime != null) { + if (typeof object.createTime !== "object") + throw TypeError(".google.cloud.connectors.v1.OperationMetadata.createTime: object expected"); + message.createTime = $root.google.protobuf.Timestamp.fromObject(object.createTime); + } + if (object.endTime != null) { + if (typeof object.endTime !== "object") + throw TypeError(".google.cloud.connectors.v1.OperationMetadata.endTime: object expected"); + message.endTime = $root.google.protobuf.Timestamp.fromObject(object.endTime); + } + if (object.target != null) + message.target = String(object.target); + if (object.verb != null) + message.verb = String(object.verb); + if (object.statusMessage != null) + message.statusMessage = String(object.statusMessage); + if (object.requestedCancellation != null) + message.requestedCancellation = Boolean(object.requestedCancellation); + if (object.apiVersion != null) + message.apiVersion = String(object.apiVersion); + return message; + }; + + /** + * Creates a plain object from an OperationMetadata message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.connectors.v1.OperationMetadata + * @static + * @param {google.cloud.connectors.v1.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.endTime = null; + object.target = ""; + object.verb = ""; + object.statusMessage = ""; + object.requestedCancellation = false; + object.apiVersion = ""; + } + if (message.createTime != null && message.hasOwnProperty("createTime")) + object.createTime = $root.google.protobuf.Timestamp.toObject(message.createTime, options); + if (message.endTime != null && message.hasOwnProperty("endTime")) + object.endTime = $root.google.protobuf.Timestamp.toObject(message.endTime, options); + if (message.target != null && message.hasOwnProperty("target")) + object.target = message.target; + if (message.verb != null && message.hasOwnProperty("verb")) + object.verb = message.verb; + if (message.statusMessage != null && message.hasOwnProperty("statusMessage")) + object.statusMessage = message.statusMessage; + if (message.requestedCancellation != null && message.hasOwnProperty("requestedCancellation")) + object.requestedCancellation = message.requestedCancellation; + if (message.apiVersion != null && message.hasOwnProperty("apiVersion")) + object.apiVersion = message.apiVersion; + return object; + }; + + /** + * Converts this OperationMetadata to JSON. + * @function toJSON + * @memberof google.cloud.connectors.v1.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.connectors.v1.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.connectors.v1.OperationMetadata"; + }; + + return OperationMetadata; + })(); + + v1.ConfigVariableTemplate = (function() { + + /** + * Properties of a ConfigVariableTemplate. + * @memberof google.cloud.connectors.v1 + * @interface IConfigVariableTemplate + * @property {string|null} [key] ConfigVariableTemplate key + * @property {google.cloud.connectors.v1.ConfigVariableTemplate.ValueType|null} [valueType] ConfigVariableTemplate valueType + * @property {string|null} [displayName] ConfigVariableTemplate displayName + * @property {string|null} [description] ConfigVariableTemplate description + * @property {string|null} [validationRegex] ConfigVariableTemplate validationRegex + * @property {boolean|null} [required] ConfigVariableTemplate required + * @property {google.cloud.connectors.v1.IRoleGrant|null} [roleGrant] ConfigVariableTemplate roleGrant + * @property {Array.|null} [enumOptions] ConfigVariableTemplate enumOptions + * @property {google.cloud.connectors.v1.IAuthorizationCodeLink|null} [authorizationCodeLink] ConfigVariableTemplate authorizationCodeLink + * @property {google.cloud.connectors.v1.ConfigVariableTemplate.State|null} [state] ConfigVariableTemplate state + * @property {boolean|null} [isAdvanced] ConfigVariableTemplate isAdvanced + */ + + /** + * Constructs a new ConfigVariableTemplate. + * @memberof google.cloud.connectors.v1 + * @classdesc Represents a ConfigVariableTemplate. + * @implements IConfigVariableTemplate + * @constructor + * @param {google.cloud.connectors.v1.IConfigVariableTemplate=} [properties] Properties to set + */ + function ConfigVariableTemplate(properties) { + this.enumOptions = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ConfigVariableTemplate key. + * @member {string} key + * @memberof google.cloud.connectors.v1.ConfigVariableTemplate + * @instance + */ + ConfigVariableTemplate.prototype.key = ""; + + /** + * ConfigVariableTemplate valueType. + * @member {google.cloud.connectors.v1.ConfigVariableTemplate.ValueType} valueType + * @memberof google.cloud.connectors.v1.ConfigVariableTemplate + * @instance + */ + ConfigVariableTemplate.prototype.valueType = 0; + + /** + * ConfigVariableTemplate displayName. + * @member {string} displayName + * @memberof google.cloud.connectors.v1.ConfigVariableTemplate + * @instance + */ + ConfigVariableTemplate.prototype.displayName = ""; + + /** + * ConfigVariableTemplate description. + * @member {string} description + * @memberof google.cloud.connectors.v1.ConfigVariableTemplate + * @instance + */ + ConfigVariableTemplate.prototype.description = ""; + + /** + * ConfigVariableTemplate validationRegex. + * @member {string} validationRegex + * @memberof google.cloud.connectors.v1.ConfigVariableTemplate + * @instance + */ + ConfigVariableTemplate.prototype.validationRegex = ""; + + /** + * ConfigVariableTemplate required. + * @member {boolean} required + * @memberof google.cloud.connectors.v1.ConfigVariableTemplate + * @instance + */ + ConfigVariableTemplate.prototype.required = false; + + /** + * ConfigVariableTemplate roleGrant. + * @member {google.cloud.connectors.v1.IRoleGrant|null|undefined} roleGrant + * @memberof google.cloud.connectors.v1.ConfigVariableTemplate + * @instance + */ + ConfigVariableTemplate.prototype.roleGrant = null; + + /** + * ConfigVariableTemplate enumOptions. + * @member {Array.} enumOptions + * @memberof google.cloud.connectors.v1.ConfigVariableTemplate + * @instance + */ + ConfigVariableTemplate.prototype.enumOptions = $util.emptyArray; + + /** + * ConfigVariableTemplate authorizationCodeLink. + * @member {google.cloud.connectors.v1.IAuthorizationCodeLink|null|undefined} authorizationCodeLink + * @memberof google.cloud.connectors.v1.ConfigVariableTemplate + * @instance + */ + ConfigVariableTemplate.prototype.authorizationCodeLink = null; + + /** + * ConfigVariableTemplate state. + * @member {google.cloud.connectors.v1.ConfigVariableTemplate.State} state + * @memberof google.cloud.connectors.v1.ConfigVariableTemplate + * @instance + */ + ConfigVariableTemplate.prototype.state = 0; + + /** + * ConfigVariableTemplate isAdvanced. + * @member {boolean} isAdvanced + * @memberof google.cloud.connectors.v1.ConfigVariableTemplate + * @instance + */ + ConfigVariableTemplate.prototype.isAdvanced = false; + + /** + * Creates a new ConfigVariableTemplate instance using the specified properties. + * @function create + * @memberof google.cloud.connectors.v1.ConfigVariableTemplate + * @static + * @param {google.cloud.connectors.v1.IConfigVariableTemplate=} [properties] Properties to set + * @returns {google.cloud.connectors.v1.ConfigVariableTemplate} ConfigVariableTemplate instance + */ + ConfigVariableTemplate.create = function create(properties) { + return new ConfigVariableTemplate(properties); + }; + + /** + * Encodes the specified ConfigVariableTemplate message. Does not implicitly {@link google.cloud.connectors.v1.ConfigVariableTemplate.verify|verify} messages. + * @function encode + * @memberof google.cloud.connectors.v1.ConfigVariableTemplate + * @static + * @param {google.cloud.connectors.v1.IConfigVariableTemplate} message ConfigVariableTemplate message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ConfigVariableTemplate.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.key != null && Object.hasOwnProperty.call(message, "key")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.key); + if (message.valueType != null && Object.hasOwnProperty.call(message, "valueType")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.valueType); + if (message.displayName != null && Object.hasOwnProperty.call(message, "displayName")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.displayName); + if (message.description != null && Object.hasOwnProperty.call(message, "description")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.description); + if (message.validationRegex != null && Object.hasOwnProperty.call(message, "validationRegex")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.validationRegex); + if (message.required != null && Object.hasOwnProperty.call(message, "required")) + writer.uint32(/* id 6, wireType 0 =*/48).bool(message.required); + if (message.roleGrant != null && Object.hasOwnProperty.call(message, "roleGrant")) + $root.google.cloud.connectors.v1.RoleGrant.encode(message.roleGrant, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + if (message.enumOptions != null && message.enumOptions.length) + for (var i = 0; i < message.enumOptions.length; ++i) + $root.google.cloud.connectors.v1.EnumOption.encode(message.enumOptions[i], writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); + if (message.authorizationCodeLink != null && Object.hasOwnProperty.call(message, "authorizationCodeLink")) + $root.google.cloud.connectors.v1.AuthorizationCodeLink.encode(message.authorizationCodeLink, writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim(); + if (message.state != null && Object.hasOwnProperty.call(message, "state")) + writer.uint32(/* id 10, wireType 0 =*/80).int32(message.state); + if (message.isAdvanced != null && Object.hasOwnProperty.call(message, "isAdvanced")) + writer.uint32(/* id 11, wireType 0 =*/88).bool(message.isAdvanced); + return writer; + }; + + /** + * Encodes the specified ConfigVariableTemplate message, length delimited. Does not implicitly {@link google.cloud.connectors.v1.ConfigVariableTemplate.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.connectors.v1.ConfigVariableTemplate + * @static + * @param {google.cloud.connectors.v1.IConfigVariableTemplate} message ConfigVariableTemplate message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ConfigVariableTemplate.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ConfigVariableTemplate message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.connectors.v1.ConfigVariableTemplate + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.connectors.v1.ConfigVariableTemplate} ConfigVariableTemplate + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ConfigVariableTemplate.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.connectors.v1.ConfigVariableTemplate(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.key = reader.string(); + break; + } + case 2: { + message.valueType = reader.int32(); + break; + } + case 3: { + message.displayName = reader.string(); + break; + } + case 4: { + message.description = reader.string(); + break; + } + case 5: { + message.validationRegex = reader.string(); + break; + } + case 6: { + message.required = reader.bool(); + break; + } + case 7: { + message.roleGrant = $root.google.cloud.connectors.v1.RoleGrant.decode(reader, reader.uint32()); + break; + } + case 8: { + if (!(message.enumOptions && message.enumOptions.length)) + message.enumOptions = []; + message.enumOptions.push($root.google.cloud.connectors.v1.EnumOption.decode(reader, reader.uint32())); + break; + } + case 9: { + message.authorizationCodeLink = $root.google.cloud.connectors.v1.AuthorizationCodeLink.decode(reader, reader.uint32()); + break; + } + case 10: { + message.state = reader.int32(); + break; + } + case 11: { + message.isAdvanced = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ConfigVariableTemplate message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.connectors.v1.ConfigVariableTemplate + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.connectors.v1.ConfigVariableTemplate} ConfigVariableTemplate + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ConfigVariableTemplate.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ConfigVariableTemplate message. + * @function verify + * @memberof google.cloud.connectors.v1.ConfigVariableTemplate + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ConfigVariableTemplate.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.key != null && message.hasOwnProperty("key")) + if (!$util.isString(message.key)) + return "key: string expected"; + if (message.valueType != null && message.hasOwnProperty("valueType")) + switch (message.valueType) { + default: + return "valueType: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + case 5: + case 6: + break; + } + if (message.displayName != null && message.hasOwnProperty("displayName")) + if (!$util.isString(message.displayName)) + return "displayName: string expected"; + if (message.description != null && message.hasOwnProperty("description")) + if (!$util.isString(message.description)) + return "description: string expected"; + if (message.validationRegex != null && message.hasOwnProperty("validationRegex")) + if (!$util.isString(message.validationRegex)) + return "validationRegex: string expected"; + if (message.required != null && message.hasOwnProperty("required")) + if (typeof message.required !== "boolean") + return "required: boolean expected"; + if (message.roleGrant != null && message.hasOwnProperty("roleGrant")) { + var error = $root.google.cloud.connectors.v1.RoleGrant.verify(message.roleGrant); + if (error) + return "roleGrant." + error; + } + if (message.enumOptions != null && message.hasOwnProperty("enumOptions")) { + if (!Array.isArray(message.enumOptions)) + return "enumOptions: array expected"; + for (var i = 0; i < message.enumOptions.length; ++i) { + var error = $root.google.cloud.connectors.v1.EnumOption.verify(message.enumOptions[i]); + if (error) + return "enumOptions." + error; + } + } + if (message.authorizationCodeLink != null && message.hasOwnProperty("authorizationCodeLink")) { + var error = $root.google.cloud.connectors.v1.AuthorizationCodeLink.verify(message.authorizationCodeLink); + if (error) + return "authorizationCodeLink." + error; + } + if (message.state != null && message.hasOwnProperty("state")) + switch (message.state) { + default: + return "state: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.isAdvanced != null && message.hasOwnProperty("isAdvanced")) + if (typeof message.isAdvanced !== "boolean") + return "isAdvanced: boolean expected"; + return null; + }; + + /** + * Creates a ConfigVariableTemplate message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.connectors.v1.ConfigVariableTemplate + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.connectors.v1.ConfigVariableTemplate} ConfigVariableTemplate + */ + ConfigVariableTemplate.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.connectors.v1.ConfigVariableTemplate) + return object; + var message = new $root.google.cloud.connectors.v1.ConfigVariableTemplate(); + if (object.key != null) + message.key = String(object.key); + switch (object.valueType) { + default: + if (typeof object.valueType === "number") { + message.valueType = object.valueType; + break; + } + break; + case "VALUE_TYPE_UNSPECIFIED": + case 0: + message.valueType = 0; + break; + case "STRING": + case 1: + message.valueType = 1; + break; + case "INT": + case 2: + message.valueType = 2; + break; + case "BOOL": + case 3: + message.valueType = 3; + break; + case "SECRET": + case 4: + message.valueType = 4; + break; + case "ENUM": + case 5: + message.valueType = 5; + break; + case "AUTHORIZATION_CODE": + case 6: + message.valueType = 6; + break; + } + if (object.displayName != null) + message.displayName = String(object.displayName); + if (object.description != null) + message.description = String(object.description); + if (object.validationRegex != null) + message.validationRegex = String(object.validationRegex); + if (object.required != null) + message.required = Boolean(object.required); + if (object.roleGrant != null) { + if (typeof object.roleGrant !== "object") + throw TypeError(".google.cloud.connectors.v1.ConfigVariableTemplate.roleGrant: object expected"); + message.roleGrant = $root.google.cloud.connectors.v1.RoleGrant.fromObject(object.roleGrant); + } + if (object.enumOptions) { + if (!Array.isArray(object.enumOptions)) + throw TypeError(".google.cloud.connectors.v1.ConfigVariableTemplate.enumOptions: array expected"); + message.enumOptions = []; + for (var i = 0; i < object.enumOptions.length; ++i) { + if (typeof object.enumOptions[i] !== "object") + throw TypeError(".google.cloud.connectors.v1.ConfigVariableTemplate.enumOptions: object expected"); + message.enumOptions[i] = $root.google.cloud.connectors.v1.EnumOption.fromObject(object.enumOptions[i]); + } + } + if (object.authorizationCodeLink != null) { + if (typeof object.authorizationCodeLink !== "object") + throw TypeError(".google.cloud.connectors.v1.ConfigVariableTemplate.authorizationCodeLink: object expected"); + message.authorizationCodeLink = $root.google.cloud.connectors.v1.AuthorizationCodeLink.fromObject(object.authorizationCodeLink); + } + 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 1: + message.state = 1; + break; + case "DEPRECATED": + case 2: + message.state = 2; + break; + } + if (object.isAdvanced != null) + message.isAdvanced = Boolean(object.isAdvanced); + return message; + }; + + /** + * Creates a plain object from a ConfigVariableTemplate message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.connectors.v1.ConfigVariableTemplate + * @static + * @param {google.cloud.connectors.v1.ConfigVariableTemplate} message ConfigVariableTemplate + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ConfigVariableTemplate.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.enumOptions = []; + if (options.defaults) { + object.key = ""; + object.valueType = options.enums === String ? "VALUE_TYPE_UNSPECIFIED" : 0; + object.displayName = ""; + object.description = ""; + object.validationRegex = ""; + object.required = false; + object.roleGrant = null; + object.authorizationCodeLink = null; + object.state = options.enums === String ? "STATE_UNSPECIFIED" : 0; + object.isAdvanced = false; + } + if (message.key != null && message.hasOwnProperty("key")) + object.key = message.key; + if (message.valueType != null && message.hasOwnProperty("valueType")) + object.valueType = options.enums === String ? $root.google.cloud.connectors.v1.ConfigVariableTemplate.ValueType[message.valueType] === undefined ? message.valueType : $root.google.cloud.connectors.v1.ConfigVariableTemplate.ValueType[message.valueType] : message.valueType; + if (message.displayName != null && message.hasOwnProperty("displayName")) + object.displayName = message.displayName; + if (message.description != null && message.hasOwnProperty("description")) + object.description = message.description; + if (message.validationRegex != null && message.hasOwnProperty("validationRegex")) + object.validationRegex = message.validationRegex; + if (message.required != null && message.hasOwnProperty("required")) + object.required = message.required; + if (message.roleGrant != null && message.hasOwnProperty("roleGrant")) + object.roleGrant = $root.google.cloud.connectors.v1.RoleGrant.toObject(message.roleGrant, options); + if (message.enumOptions && message.enumOptions.length) { + object.enumOptions = []; + for (var j = 0; j < message.enumOptions.length; ++j) + object.enumOptions[j] = $root.google.cloud.connectors.v1.EnumOption.toObject(message.enumOptions[j], options); + } + if (message.authorizationCodeLink != null && message.hasOwnProperty("authorizationCodeLink")) + object.authorizationCodeLink = $root.google.cloud.connectors.v1.AuthorizationCodeLink.toObject(message.authorizationCodeLink, options); + if (message.state != null && message.hasOwnProperty("state")) + object.state = options.enums === String ? $root.google.cloud.connectors.v1.ConfigVariableTemplate.State[message.state] === undefined ? message.state : $root.google.cloud.connectors.v1.ConfigVariableTemplate.State[message.state] : message.state; + if (message.isAdvanced != null && message.hasOwnProperty("isAdvanced")) + object.isAdvanced = message.isAdvanced; + return object; + }; + + /** + * Converts this ConfigVariableTemplate to JSON. + * @function toJSON + * @memberof google.cloud.connectors.v1.ConfigVariableTemplate + * @instance + * @returns {Object.} JSON object + */ + ConfigVariableTemplate.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ConfigVariableTemplate + * @function getTypeUrl + * @memberof google.cloud.connectors.v1.ConfigVariableTemplate + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ConfigVariableTemplate.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.connectors.v1.ConfigVariableTemplate"; + }; + + /** + * ValueType enum. + * @name google.cloud.connectors.v1.ConfigVariableTemplate.ValueType + * @enum {number} + * @property {number} VALUE_TYPE_UNSPECIFIED=0 VALUE_TYPE_UNSPECIFIED value + * @property {number} STRING=1 STRING value + * @property {number} INT=2 INT value + * @property {number} BOOL=3 BOOL value + * @property {number} SECRET=4 SECRET value + * @property {number} ENUM=5 ENUM value + * @property {number} AUTHORIZATION_CODE=6 AUTHORIZATION_CODE value + */ + ConfigVariableTemplate.ValueType = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "VALUE_TYPE_UNSPECIFIED"] = 0; + values[valuesById[1] = "STRING"] = 1; + values[valuesById[2] = "INT"] = 2; + values[valuesById[3] = "BOOL"] = 3; + values[valuesById[4] = "SECRET"] = 4; + values[valuesById[5] = "ENUM"] = 5; + values[valuesById[6] = "AUTHORIZATION_CODE"] = 6; + return values; + })(); + + /** + * State enum. + * @name google.cloud.connectors.v1.ConfigVariableTemplate.State + * @enum {number} + * @property {number} STATE_UNSPECIFIED=0 STATE_UNSPECIFIED value + * @property {number} ACTIVE=1 ACTIVE value + * @property {number} DEPRECATED=2 DEPRECATED value + */ + ConfigVariableTemplate.State = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "STATE_UNSPECIFIED"] = 0; + values[valuesById[1] = "ACTIVE"] = 1; + values[valuesById[2] = "DEPRECATED"] = 2; + return values; + })(); + + return ConfigVariableTemplate; + })(); + + v1.Secret = (function() { + + /** + * Properties of a Secret. + * @memberof google.cloud.connectors.v1 + * @interface ISecret + * @property {string|null} [secretVersion] Secret secretVersion + */ + + /** + * Constructs a new Secret. + * @memberof google.cloud.connectors.v1 + * @classdesc Represents a Secret. + * @implements ISecret + * @constructor + * @param {google.cloud.connectors.v1.ISecret=} [properties] Properties to set + */ + function Secret(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Secret secretVersion. + * @member {string} secretVersion + * @memberof google.cloud.connectors.v1.Secret + * @instance + */ + Secret.prototype.secretVersion = ""; + + /** + * Creates a new Secret instance using the specified properties. + * @function create + * @memberof google.cloud.connectors.v1.Secret + * @static + * @param {google.cloud.connectors.v1.ISecret=} [properties] Properties to set + * @returns {google.cloud.connectors.v1.Secret} Secret instance + */ + Secret.create = function create(properties) { + return new Secret(properties); + }; + + /** + * Encodes the specified Secret message. Does not implicitly {@link google.cloud.connectors.v1.Secret.verify|verify} messages. + * @function encode + * @memberof google.cloud.connectors.v1.Secret + * @static + * @param {google.cloud.connectors.v1.ISecret} message Secret message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Secret.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.secretVersion != null && Object.hasOwnProperty.call(message, "secretVersion")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.secretVersion); + return writer; + }; + + /** + * Encodes the specified Secret message, length delimited. Does not implicitly {@link google.cloud.connectors.v1.Secret.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.connectors.v1.Secret + * @static + * @param {google.cloud.connectors.v1.ISecret} message Secret message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Secret.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Secret message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.connectors.v1.Secret + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.connectors.v1.Secret} Secret + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Secret.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.connectors.v1.Secret(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.secretVersion = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Secret message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.connectors.v1.Secret + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.connectors.v1.Secret} Secret + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Secret.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Secret message. + * @function verify + * @memberof google.cloud.connectors.v1.Secret + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Secret.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.secretVersion != null && message.hasOwnProperty("secretVersion")) + if (!$util.isString(message.secretVersion)) + return "secretVersion: string expected"; + return null; + }; + + /** + * Creates a Secret message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.connectors.v1.Secret + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.connectors.v1.Secret} Secret + */ + Secret.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.connectors.v1.Secret) + return object; + var message = new $root.google.cloud.connectors.v1.Secret(); + if (object.secretVersion != null) + message.secretVersion = String(object.secretVersion); + return message; + }; + + /** + * Creates a plain object from a Secret message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.connectors.v1.Secret + * @static + * @param {google.cloud.connectors.v1.Secret} message Secret + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Secret.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.secretVersion = ""; + if (message.secretVersion != null && message.hasOwnProperty("secretVersion")) + object.secretVersion = message.secretVersion; + return object; + }; + + /** + * Converts this Secret to JSON. + * @function toJSON + * @memberof google.cloud.connectors.v1.Secret + * @instance + * @returns {Object.} JSON object + */ + Secret.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Secret + * @function getTypeUrl + * @memberof google.cloud.connectors.v1.Secret + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Secret.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.connectors.v1.Secret"; + }; + + return Secret; + })(); + + v1.EnumOption = (function() { + + /** + * Properties of an EnumOption. + * @memberof google.cloud.connectors.v1 + * @interface IEnumOption + * @property {string|null} [id] EnumOption id + * @property {string|null} [displayName] EnumOption displayName + */ + + /** + * Constructs a new EnumOption. + * @memberof google.cloud.connectors.v1 + * @classdesc Represents an EnumOption. + * @implements IEnumOption + * @constructor + * @param {google.cloud.connectors.v1.IEnumOption=} [properties] Properties to set + */ + function EnumOption(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * EnumOption id. + * @member {string} id + * @memberof google.cloud.connectors.v1.EnumOption + * @instance + */ + EnumOption.prototype.id = ""; + + /** + * EnumOption displayName. + * @member {string} displayName + * @memberof google.cloud.connectors.v1.EnumOption + * @instance + */ + EnumOption.prototype.displayName = ""; + + /** + * Creates a new EnumOption instance using the specified properties. + * @function create + * @memberof google.cloud.connectors.v1.EnumOption + * @static + * @param {google.cloud.connectors.v1.IEnumOption=} [properties] Properties to set + * @returns {google.cloud.connectors.v1.EnumOption} EnumOption instance + */ + EnumOption.create = function create(properties) { + return new EnumOption(properties); + }; + + /** + * Encodes the specified EnumOption message. Does not implicitly {@link google.cloud.connectors.v1.EnumOption.verify|verify} messages. + * @function encode + * @memberof google.cloud.connectors.v1.EnumOption + * @static + * @param {google.cloud.connectors.v1.IEnumOption} message EnumOption message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EnumOption.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.id != null && Object.hasOwnProperty.call(message, "id")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.id); + if (message.displayName != null && Object.hasOwnProperty.call(message, "displayName")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.displayName); + return writer; + }; + + /** + * Encodes the specified EnumOption message, length delimited. Does not implicitly {@link google.cloud.connectors.v1.EnumOption.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.connectors.v1.EnumOption + * @static + * @param {google.cloud.connectors.v1.IEnumOption} message EnumOption message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EnumOption.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an EnumOption message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.connectors.v1.EnumOption + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.connectors.v1.EnumOption} EnumOption + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EnumOption.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.connectors.v1.EnumOption(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.id = reader.string(); + break; + } + case 2: { + message.displayName = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an EnumOption message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.connectors.v1.EnumOption + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.connectors.v1.EnumOption} EnumOption + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EnumOption.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an EnumOption message. + * @function verify + * @memberof google.cloud.connectors.v1.EnumOption + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + EnumOption.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.id != null && message.hasOwnProperty("id")) + if (!$util.isString(message.id)) + return "id: string expected"; + if (message.displayName != null && message.hasOwnProperty("displayName")) + if (!$util.isString(message.displayName)) + return "displayName: string expected"; + return null; + }; + + /** + * Creates an EnumOption message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.connectors.v1.EnumOption + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.connectors.v1.EnumOption} EnumOption + */ + EnumOption.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.connectors.v1.EnumOption) + return object; + var message = new $root.google.cloud.connectors.v1.EnumOption(); + if (object.id != null) + message.id = String(object.id); + if (object.displayName != null) + message.displayName = String(object.displayName); + return message; + }; + + /** + * Creates a plain object from an EnumOption message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.connectors.v1.EnumOption + * @static + * @param {google.cloud.connectors.v1.EnumOption} message EnumOption + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + EnumOption.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.id = ""; + object.displayName = ""; + } + if (message.id != null && message.hasOwnProperty("id")) + object.id = message.id; + if (message.displayName != null && message.hasOwnProperty("displayName")) + object.displayName = message.displayName; + return object; + }; + + /** + * Converts this EnumOption to JSON. + * @function toJSON + * @memberof google.cloud.connectors.v1.EnumOption + * @instance + * @returns {Object.} JSON object + */ + EnumOption.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for EnumOption + * @function getTypeUrl + * @memberof google.cloud.connectors.v1.EnumOption + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + EnumOption.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.connectors.v1.EnumOption"; + }; + + return EnumOption; + })(); + + v1.ConfigVariable = (function() { + + /** + * Properties of a ConfigVariable. + * @memberof google.cloud.connectors.v1 + * @interface IConfigVariable + * @property {string|null} [key] ConfigVariable key + * @property {number|Long|null} [intValue] ConfigVariable intValue + * @property {boolean|null} [boolValue] ConfigVariable boolValue + * @property {string|null} [stringValue] ConfigVariable stringValue + * @property {google.cloud.connectors.v1.ISecret|null} [secretValue] ConfigVariable secretValue + */ + + /** + * Constructs a new ConfigVariable. + * @memberof google.cloud.connectors.v1 + * @classdesc Represents a ConfigVariable. + * @implements IConfigVariable + * @constructor + * @param {google.cloud.connectors.v1.IConfigVariable=} [properties] Properties to set + */ + function ConfigVariable(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ConfigVariable key. + * @member {string} key + * @memberof google.cloud.connectors.v1.ConfigVariable + * @instance + */ + ConfigVariable.prototype.key = ""; + + /** + * ConfigVariable intValue. + * @member {number|Long|null|undefined} intValue + * @memberof google.cloud.connectors.v1.ConfigVariable + * @instance + */ + ConfigVariable.prototype.intValue = null; + + /** + * ConfigVariable boolValue. + * @member {boolean|null|undefined} boolValue + * @memberof google.cloud.connectors.v1.ConfigVariable + * @instance + */ + ConfigVariable.prototype.boolValue = null; + + /** + * ConfigVariable stringValue. + * @member {string|null|undefined} stringValue + * @memberof google.cloud.connectors.v1.ConfigVariable + * @instance + */ + ConfigVariable.prototype.stringValue = null; + + /** + * ConfigVariable secretValue. + * @member {google.cloud.connectors.v1.ISecret|null|undefined} secretValue + * @memberof google.cloud.connectors.v1.ConfigVariable + * @instance + */ + ConfigVariable.prototype.secretValue = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * ConfigVariable value. + * @member {"intValue"|"boolValue"|"stringValue"|"secretValue"|undefined} value + * @memberof google.cloud.connectors.v1.ConfigVariable + * @instance + */ + Object.defineProperty(ConfigVariable.prototype, "value", { + get: $util.oneOfGetter($oneOfFields = ["intValue", "boolValue", "stringValue", "secretValue"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new ConfigVariable instance using the specified properties. + * @function create + * @memberof google.cloud.connectors.v1.ConfigVariable + * @static + * @param {google.cloud.connectors.v1.IConfigVariable=} [properties] Properties to set + * @returns {google.cloud.connectors.v1.ConfigVariable} ConfigVariable instance + */ + ConfigVariable.create = function create(properties) { + return new ConfigVariable(properties); + }; + + /** + * Encodes the specified ConfigVariable message. Does not implicitly {@link google.cloud.connectors.v1.ConfigVariable.verify|verify} messages. + * @function encode + * @memberof google.cloud.connectors.v1.ConfigVariable + * @static + * @param {google.cloud.connectors.v1.IConfigVariable} message ConfigVariable message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ConfigVariable.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.key != null && Object.hasOwnProperty.call(message, "key")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.key); + if (message.intValue != null && Object.hasOwnProperty.call(message, "intValue")) + writer.uint32(/* id 2, wireType 0 =*/16).int64(message.intValue); + if (message.boolValue != null && Object.hasOwnProperty.call(message, "boolValue")) + writer.uint32(/* id 3, wireType 0 =*/24).bool(message.boolValue); + if (message.stringValue != null && Object.hasOwnProperty.call(message, "stringValue")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.stringValue); + if (message.secretValue != null && Object.hasOwnProperty.call(message, "secretValue")) + $root.google.cloud.connectors.v1.Secret.encode(message.secretValue, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified ConfigVariable message, length delimited. Does not implicitly {@link google.cloud.connectors.v1.ConfigVariable.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.connectors.v1.ConfigVariable + * @static + * @param {google.cloud.connectors.v1.IConfigVariable} message ConfigVariable message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ConfigVariable.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ConfigVariable message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.connectors.v1.ConfigVariable + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.connectors.v1.ConfigVariable} ConfigVariable + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ConfigVariable.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.connectors.v1.ConfigVariable(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.key = reader.string(); + break; + } + case 2: { + message.intValue = reader.int64(); + break; + } + case 3: { + message.boolValue = reader.bool(); + break; + } + case 4: { + message.stringValue = reader.string(); + break; + } + case 5: { + message.secretValue = $root.google.cloud.connectors.v1.Secret.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ConfigVariable message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.connectors.v1.ConfigVariable + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.connectors.v1.ConfigVariable} ConfigVariable + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ConfigVariable.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ConfigVariable message. + * @function verify + * @memberof google.cloud.connectors.v1.ConfigVariable + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ConfigVariable.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.key != null && message.hasOwnProperty("key")) + if (!$util.isString(message.key)) + return "key: string expected"; + if (message.intValue != null && message.hasOwnProperty("intValue")) { + properties.value = 1; + if (!$util.isInteger(message.intValue) && !(message.intValue && $util.isInteger(message.intValue.low) && $util.isInteger(message.intValue.high))) + return "intValue: integer|Long expected"; + } + if (message.boolValue != null && message.hasOwnProperty("boolValue")) { + if (properties.value === 1) + return "value: multiple values"; + properties.value = 1; + if (typeof message.boolValue !== "boolean") + return "boolValue: boolean expected"; + } + if (message.stringValue != null && message.hasOwnProperty("stringValue")) { + if (properties.value === 1) + return "value: multiple values"; + properties.value = 1; + if (!$util.isString(message.stringValue)) + return "stringValue: string expected"; + } + if (message.secretValue != null && message.hasOwnProperty("secretValue")) { + if (properties.value === 1) + return "value: multiple values"; + properties.value = 1; + { + var error = $root.google.cloud.connectors.v1.Secret.verify(message.secretValue); + if (error) + return "secretValue." + error; + } + } + return null; + }; + + /** + * Creates a ConfigVariable message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.connectors.v1.ConfigVariable + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.connectors.v1.ConfigVariable} ConfigVariable + */ + ConfigVariable.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.connectors.v1.ConfigVariable) + return object; + var message = new $root.google.cloud.connectors.v1.ConfigVariable(); + if (object.key != null) + message.key = String(object.key); + if (object.intValue != null) + if ($util.Long) + (message.intValue = $util.Long.fromValue(object.intValue)).unsigned = false; + else if (typeof object.intValue === "string") + message.intValue = parseInt(object.intValue, 10); + else if (typeof object.intValue === "number") + message.intValue = object.intValue; + else if (typeof object.intValue === "object") + message.intValue = new $util.LongBits(object.intValue.low >>> 0, object.intValue.high >>> 0).toNumber(); + if (object.boolValue != null) + message.boolValue = Boolean(object.boolValue); + if (object.stringValue != null) + message.stringValue = String(object.stringValue); + if (object.secretValue != null) { + if (typeof object.secretValue !== "object") + throw TypeError(".google.cloud.connectors.v1.ConfigVariable.secretValue: object expected"); + message.secretValue = $root.google.cloud.connectors.v1.Secret.fromObject(object.secretValue); + } + return message; + }; + + /** + * Creates a plain object from a ConfigVariable message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.connectors.v1.ConfigVariable + * @static + * @param {google.cloud.connectors.v1.ConfigVariable} message ConfigVariable + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ConfigVariable.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.key = ""; + if (message.key != null && message.hasOwnProperty("key")) + object.key = message.key; + if (message.intValue != null && message.hasOwnProperty("intValue")) { + if (typeof message.intValue === "number") + object.intValue = options.longs === String ? String(message.intValue) : message.intValue; + else + object.intValue = options.longs === String ? $util.Long.prototype.toString.call(message.intValue) : options.longs === Number ? new $util.LongBits(message.intValue.low >>> 0, message.intValue.high >>> 0).toNumber() : message.intValue; + if (options.oneofs) + object.value = "intValue"; + } + if (message.boolValue != null && message.hasOwnProperty("boolValue")) { + object.boolValue = message.boolValue; + if (options.oneofs) + object.value = "boolValue"; + } + if (message.stringValue != null && message.hasOwnProperty("stringValue")) { + object.stringValue = message.stringValue; + if (options.oneofs) + object.value = "stringValue"; + } + if (message.secretValue != null && message.hasOwnProperty("secretValue")) { + object.secretValue = $root.google.cloud.connectors.v1.Secret.toObject(message.secretValue, options); + if (options.oneofs) + object.value = "secretValue"; + } + return object; + }; + + /** + * Converts this ConfigVariable to JSON. + * @function toJSON + * @memberof google.cloud.connectors.v1.ConfigVariable + * @instance + * @returns {Object.} JSON object + */ + ConfigVariable.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ConfigVariable + * @function getTypeUrl + * @memberof google.cloud.connectors.v1.ConfigVariable + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ConfigVariable.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.connectors.v1.ConfigVariable"; + }; + + return ConfigVariable; + })(); + + v1.RoleGrant = (function() { + + /** + * Properties of a RoleGrant. + * @memberof google.cloud.connectors.v1 + * @interface IRoleGrant + * @property {google.cloud.connectors.v1.RoleGrant.Principal|null} [principal] RoleGrant principal + * @property {Array.|null} [roles] RoleGrant roles + * @property {google.cloud.connectors.v1.RoleGrant.IResource|null} [resource] RoleGrant resource + * @property {string|null} [helperTextTemplate] RoleGrant helperTextTemplate + */ + + /** + * Constructs a new RoleGrant. + * @memberof google.cloud.connectors.v1 + * @classdesc Represents a RoleGrant. + * @implements IRoleGrant + * @constructor + * @param {google.cloud.connectors.v1.IRoleGrant=} [properties] Properties to set + */ + function RoleGrant(properties) { + this.roles = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * RoleGrant principal. + * @member {google.cloud.connectors.v1.RoleGrant.Principal} principal + * @memberof google.cloud.connectors.v1.RoleGrant + * @instance + */ + RoleGrant.prototype.principal = 0; + + /** + * RoleGrant roles. + * @member {Array.} roles + * @memberof google.cloud.connectors.v1.RoleGrant + * @instance + */ + RoleGrant.prototype.roles = $util.emptyArray; + + /** + * RoleGrant resource. + * @member {google.cloud.connectors.v1.RoleGrant.IResource|null|undefined} resource + * @memberof google.cloud.connectors.v1.RoleGrant + * @instance + */ + RoleGrant.prototype.resource = null; + + /** + * RoleGrant helperTextTemplate. + * @member {string} helperTextTemplate + * @memberof google.cloud.connectors.v1.RoleGrant + * @instance + */ + RoleGrant.prototype.helperTextTemplate = ""; + + /** + * Creates a new RoleGrant instance using the specified properties. + * @function create + * @memberof google.cloud.connectors.v1.RoleGrant + * @static + * @param {google.cloud.connectors.v1.IRoleGrant=} [properties] Properties to set + * @returns {google.cloud.connectors.v1.RoleGrant} RoleGrant instance + */ + RoleGrant.create = function create(properties) { + return new RoleGrant(properties); + }; + + /** + * Encodes the specified RoleGrant message. Does not implicitly {@link google.cloud.connectors.v1.RoleGrant.verify|verify} messages. + * @function encode + * @memberof google.cloud.connectors.v1.RoleGrant + * @static + * @param {google.cloud.connectors.v1.IRoleGrant} message RoleGrant message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RoleGrant.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.principal != null && Object.hasOwnProperty.call(message, "principal")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.principal); + if (message.roles != null && message.roles.length) + for (var i = 0; i < message.roles.length; ++i) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.roles[i]); + if (message.resource != null && Object.hasOwnProperty.call(message, "resource")) + $root.google.cloud.connectors.v1.RoleGrant.Resource.encode(message.resource, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.helperTextTemplate != null && Object.hasOwnProperty.call(message, "helperTextTemplate")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.helperTextTemplate); + return writer; + }; + + /** + * Encodes the specified RoleGrant message, length delimited. Does not implicitly {@link google.cloud.connectors.v1.RoleGrant.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.connectors.v1.RoleGrant + * @static + * @param {google.cloud.connectors.v1.IRoleGrant} message RoleGrant message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RoleGrant.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a RoleGrant message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.connectors.v1.RoleGrant + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.connectors.v1.RoleGrant} RoleGrant + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RoleGrant.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.connectors.v1.RoleGrant(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.principal = reader.int32(); + break; + } + case 2: { + if (!(message.roles && message.roles.length)) + message.roles = []; + message.roles.push(reader.string()); + break; + } + case 3: { + message.resource = $root.google.cloud.connectors.v1.RoleGrant.Resource.decode(reader, reader.uint32()); + break; + } + case 4: { + message.helperTextTemplate = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a RoleGrant message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.connectors.v1.RoleGrant + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.connectors.v1.RoleGrant} RoleGrant + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RoleGrant.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a RoleGrant message. + * @function verify + * @memberof google.cloud.connectors.v1.RoleGrant + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + RoleGrant.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.principal != null && message.hasOwnProperty("principal")) + switch (message.principal) { + default: + return "principal: enum value expected"; + case 0: + case 1: + break; + } + if (message.roles != null && message.hasOwnProperty("roles")) { + if (!Array.isArray(message.roles)) + return "roles: array expected"; + for (var i = 0; i < message.roles.length; ++i) + if (!$util.isString(message.roles[i])) + return "roles: string[] expected"; + } + if (message.resource != null && message.hasOwnProperty("resource")) { + var error = $root.google.cloud.connectors.v1.RoleGrant.Resource.verify(message.resource); + if (error) + return "resource." + error; + } + if (message.helperTextTemplate != null && message.hasOwnProperty("helperTextTemplate")) + if (!$util.isString(message.helperTextTemplate)) + return "helperTextTemplate: string expected"; + return null; + }; + + /** + * Creates a RoleGrant message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.connectors.v1.RoleGrant + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.connectors.v1.RoleGrant} RoleGrant + */ + RoleGrant.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.connectors.v1.RoleGrant) + return object; + var message = new $root.google.cloud.connectors.v1.RoleGrant(); + switch (object.principal) { + default: + if (typeof object.principal === "number") { + message.principal = object.principal; + break; + } + break; + case "PRINCIPAL_UNSPECIFIED": + case 0: + message.principal = 0; + break; + case "CONNECTOR_SA": + case 1: + message.principal = 1; + break; + } + if (object.roles) { + if (!Array.isArray(object.roles)) + throw TypeError(".google.cloud.connectors.v1.RoleGrant.roles: array expected"); + message.roles = []; + for (var i = 0; i < object.roles.length; ++i) + message.roles[i] = String(object.roles[i]); + } + if (object.resource != null) { + if (typeof object.resource !== "object") + throw TypeError(".google.cloud.connectors.v1.RoleGrant.resource: object expected"); + message.resource = $root.google.cloud.connectors.v1.RoleGrant.Resource.fromObject(object.resource); + } + if (object.helperTextTemplate != null) + message.helperTextTemplate = String(object.helperTextTemplate); + return message; + }; + + /** + * Creates a plain object from a RoleGrant message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.connectors.v1.RoleGrant + * @static + * @param {google.cloud.connectors.v1.RoleGrant} message RoleGrant + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + RoleGrant.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.roles = []; + if (options.defaults) { + object.principal = options.enums === String ? "PRINCIPAL_UNSPECIFIED" : 0; + object.resource = null; + object.helperTextTemplate = ""; + } + if (message.principal != null && message.hasOwnProperty("principal")) + object.principal = options.enums === String ? $root.google.cloud.connectors.v1.RoleGrant.Principal[message.principal] === undefined ? message.principal : $root.google.cloud.connectors.v1.RoleGrant.Principal[message.principal] : message.principal; + if (message.roles && message.roles.length) { + object.roles = []; + for (var j = 0; j < message.roles.length; ++j) + object.roles[j] = message.roles[j]; + } + if (message.resource != null && message.hasOwnProperty("resource")) + object.resource = $root.google.cloud.connectors.v1.RoleGrant.Resource.toObject(message.resource, options); + if (message.helperTextTemplate != null && message.hasOwnProperty("helperTextTemplate")) + object.helperTextTemplate = message.helperTextTemplate; + return object; + }; + + /** + * Converts this RoleGrant to JSON. + * @function toJSON + * @memberof google.cloud.connectors.v1.RoleGrant + * @instance + * @returns {Object.} JSON object + */ + RoleGrant.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for RoleGrant + * @function getTypeUrl + * @memberof google.cloud.connectors.v1.RoleGrant + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + RoleGrant.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.connectors.v1.RoleGrant"; + }; + + /** + * Principal enum. + * @name google.cloud.connectors.v1.RoleGrant.Principal + * @enum {number} + * @property {number} PRINCIPAL_UNSPECIFIED=0 PRINCIPAL_UNSPECIFIED value + * @property {number} CONNECTOR_SA=1 CONNECTOR_SA value + */ + RoleGrant.Principal = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "PRINCIPAL_UNSPECIFIED"] = 0; + values[valuesById[1] = "CONNECTOR_SA"] = 1; + return values; + })(); + + RoleGrant.Resource = (function() { + + /** + * Properties of a Resource. + * @memberof google.cloud.connectors.v1.RoleGrant + * @interface IResource + * @property {google.cloud.connectors.v1.RoleGrant.Resource.Type|null} [type] Resource type + * @property {string|null} [pathTemplate] Resource pathTemplate + */ + + /** + * Constructs a new Resource. + * @memberof google.cloud.connectors.v1.RoleGrant + * @classdesc Represents a Resource. + * @implements IResource + * @constructor + * @param {google.cloud.connectors.v1.RoleGrant.IResource=} [properties] Properties to set + */ + function Resource(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Resource type. + * @member {google.cloud.connectors.v1.RoleGrant.Resource.Type} type + * @memberof google.cloud.connectors.v1.RoleGrant.Resource + * @instance + */ + Resource.prototype.type = 0; + + /** + * Resource pathTemplate. + * @member {string} pathTemplate + * @memberof google.cloud.connectors.v1.RoleGrant.Resource + * @instance + */ + Resource.prototype.pathTemplate = ""; + + /** + * Creates a new Resource instance using the specified properties. + * @function create + * @memberof google.cloud.connectors.v1.RoleGrant.Resource + * @static + * @param {google.cloud.connectors.v1.RoleGrant.IResource=} [properties] Properties to set + * @returns {google.cloud.connectors.v1.RoleGrant.Resource} Resource instance + */ + Resource.create = function create(properties) { + return new Resource(properties); + }; + + /** + * Encodes the specified Resource message. Does not implicitly {@link google.cloud.connectors.v1.RoleGrant.Resource.verify|verify} messages. + * @function encode + * @memberof google.cloud.connectors.v1.RoleGrant.Resource + * @static + * @param {google.cloud.connectors.v1.RoleGrant.IResource} message Resource message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Resource.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.type != null && Object.hasOwnProperty.call(message, "type")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.type); + if (message.pathTemplate != null && Object.hasOwnProperty.call(message, "pathTemplate")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.pathTemplate); + return writer; + }; + + /** + * Encodes the specified Resource message, length delimited. Does not implicitly {@link google.cloud.connectors.v1.RoleGrant.Resource.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.connectors.v1.RoleGrant.Resource + * @static + * @param {google.cloud.connectors.v1.RoleGrant.IResource} message Resource message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Resource.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Resource message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.connectors.v1.RoleGrant.Resource + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.connectors.v1.RoleGrant.Resource} Resource + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Resource.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.connectors.v1.RoleGrant.Resource(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.type = reader.int32(); + break; + } + case 3: { + message.pathTemplate = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Resource message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.connectors.v1.RoleGrant.Resource + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.connectors.v1.RoleGrant.Resource} Resource + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Resource.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Resource message. + * @function verify + * @memberof google.cloud.connectors.v1.RoleGrant.Resource + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Resource.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.type != null && message.hasOwnProperty("type")) + switch (message.type) { + default: + return "type: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + break; + } + if (message.pathTemplate != null && message.hasOwnProperty("pathTemplate")) + if (!$util.isString(message.pathTemplate)) + return "pathTemplate: string expected"; + return null; + }; + + /** + * Creates a Resource message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.connectors.v1.RoleGrant.Resource + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.connectors.v1.RoleGrant.Resource} Resource + */ + Resource.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.connectors.v1.RoleGrant.Resource) + return object; + var message = new $root.google.cloud.connectors.v1.RoleGrant.Resource(); + switch (object.type) { + default: + if (typeof object.type === "number") { + message.type = object.type; + break; + } + break; + case "TYPE_UNSPECIFIED": + case 0: + message.type = 0; + break; + case "GCP_PROJECT": + case 1: + message.type = 1; + break; + case "GCP_RESOURCE": + case 2: + message.type = 2; + break; + case "GCP_SECRETMANAGER_SECRET": + case 3: + message.type = 3; + break; + case "GCP_SECRETMANAGER_SECRET_VERSION": + case 4: + message.type = 4; + break; + } + if (object.pathTemplate != null) + message.pathTemplate = String(object.pathTemplate); + return message; + }; + + /** + * Creates a plain object from a Resource message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.connectors.v1.RoleGrant.Resource + * @static + * @param {google.cloud.connectors.v1.RoleGrant.Resource} message Resource + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Resource.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.type = options.enums === String ? "TYPE_UNSPECIFIED" : 0; + object.pathTemplate = ""; + } + if (message.type != null && message.hasOwnProperty("type")) + object.type = options.enums === String ? $root.google.cloud.connectors.v1.RoleGrant.Resource.Type[message.type] === undefined ? message.type : $root.google.cloud.connectors.v1.RoleGrant.Resource.Type[message.type] : message.type; + if (message.pathTemplate != null && message.hasOwnProperty("pathTemplate")) + object.pathTemplate = message.pathTemplate; + return object; + }; + + /** + * Converts this Resource to JSON. + * @function toJSON + * @memberof google.cloud.connectors.v1.RoleGrant.Resource + * @instance + * @returns {Object.} JSON object + */ + Resource.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Resource + * @function getTypeUrl + * @memberof google.cloud.connectors.v1.RoleGrant.Resource + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Resource.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.connectors.v1.RoleGrant.Resource"; + }; + + /** + * Type enum. + * @name google.cloud.connectors.v1.RoleGrant.Resource.Type + * @enum {number} + * @property {number} TYPE_UNSPECIFIED=0 TYPE_UNSPECIFIED value + * @property {number} GCP_PROJECT=1 GCP_PROJECT value + * @property {number} GCP_RESOURCE=2 GCP_RESOURCE value + * @property {number} GCP_SECRETMANAGER_SECRET=3 GCP_SECRETMANAGER_SECRET value + * @property {number} GCP_SECRETMANAGER_SECRET_VERSION=4 GCP_SECRETMANAGER_SECRET_VERSION value + */ + Resource.Type = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "TYPE_UNSPECIFIED"] = 0; + values[valuesById[1] = "GCP_PROJECT"] = 1; + values[valuesById[2] = "GCP_RESOURCE"] = 2; + values[valuesById[3] = "GCP_SECRETMANAGER_SECRET"] = 3; + values[valuesById[4] = "GCP_SECRETMANAGER_SECRET_VERSION"] = 4; + return values; + })(); + + return Resource; + })(); + + return RoleGrant; + })(); + + v1.AuthorizationCodeLink = (function() { + + /** + * Properties of an AuthorizationCodeLink. + * @memberof google.cloud.connectors.v1 + * @interface IAuthorizationCodeLink + * @property {string|null} [uri] AuthorizationCodeLink uri + * @property {Array.|null} [scopes] AuthorizationCodeLink scopes + * @property {string|null} [clientId] AuthorizationCodeLink clientId + * @property {boolean|null} [enablePkce] AuthorizationCodeLink enablePkce + */ + + /** + * Constructs a new AuthorizationCodeLink. + * @memberof google.cloud.connectors.v1 + * @classdesc Represents an AuthorizationCodeLink. + * @implements IAuthorizationCodeLink + * @constructor + * @param {google.cloud.connectors.v1.IAuthorizationCodeLink=} [properties] Properties to set + */ + function AuthorizationCodeLink(properties) { + this.scopes = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * AuthorizationCodeLink uri. + * @member {string} uri + * @memberof google.cloud.connectors.v1.AuthorizationCodeLink + * @instance + */ + AuthorizationCodeLink.prototype.uri = ""; + + /** + * AuthorizationCodeLink scopes. + * @member {Array.} scopes + * @memberof google.cloud.connectors.v1.AuthorizationCodeLink + * @instance + */ + AuthorizationCodeLink.prototype.scopes = $util.emptyArray; + + /** + * AuthorizationCodeLink clientId. + * @member {string} clientId + * @memberof google.cloud.connectors.v1.AuthorizationCodeLink + * @instance + */ + AuthorizationCodeLink.prototype.clientId = ""; + + /** + * AuthorizationCodeLink enablePkce. + * @member {boolean} enablePkce + * @memberof google.cloud.connectors.v1.AuthorizationCodeLink + * @instance + */ + AuthorizationCodeLink.prototype.enablePkce = false; + + /** + * Creates a new AuthorizationCodeLink instance using the specified properties. + * @function create + * @memberof google.cloud.connectors.v1.AuthorizationCodeLink + * @static + * @param {google.cloud.connectors.v1.IAuthorizationCodeLink=} [properties] Properties to set + * @returns {google.cloud.connectors.v1.AuthorizationCodeLink} AuthorizationCodeLink instance + */ + AuthorizationCodeLink.create = function create(properties) { + return new AuthorizationCodeLink(properties); + }; + + /** + * Encodes the specified AuthorizationCodeLink message. Does not implicitly {@link google.cloud.connectors.v1.AuthorizationCodeLink.verify|verify} messages. + * @function encode + * @memberof google.cloud.connectors.v1.AuthorizationCodeLink + * @static + * @param {google.cloud.connectors.v1.IAuthorizationCodeLink} message AuthorizationCodeLink message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AuthorizationCodeLink.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.scopes != null && message.scopes.length) + for (var i = 0; i < message.scopes.length; ++i) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.scopes[i]); + if (message.clientId != null && Object.hasOwnProperty.call(message, "clientId")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.clientId); + if (message.enablePkce != null && Object.hasOwnProperty.call(message, "enablePkce")) + writer.uint32(/* id 4, wireType 0 =*/32).bool(message.enablePkce); + return writer; + }; + + /** + * Encodes the specified AuthorizationCodeLink message, length delimited. Does not implicitly {@link google.cloud.connectors.v1.AuthorizationCodeLink.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.connectors.v1.AuthorizationCodeLink + * @static + * @param {google.cloud.connectors.v1.IAuthorizationCodeLink} message AuthorizationCodeLink message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AuthorizationCodeLink.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an AuthorizationCodeLink message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.connectors.v1.AuthorizationCodeLink + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.connectors.v1.AuthorizationCodeLink} AuthorizationCodeLink + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AuthorizationCodeLink.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.connectors.v1.AuthorizationCodeLink(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.uri = reader.string(); + break; + } + case 2: { + if (!(message.scopes && message.scopes.length)) + message.scopes = []; + message.scopes.push(reader.string()); + break; + } + case 3: { + message.clientId = reader.string(); + break; + } + case 4: { + message.enablePkce = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an AuthorizationCodeLink message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.connectors.v1.AuthorizationCodeLink + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.connectors.v1.AuthorizationCodeLink} AuthorizationCodeLink + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AuthorizationCodeLink.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an AuthorizationCodeLink message. + * @function verify + * @memberof google.cloud.connectors.v1.AuthorizationCodeLink + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + AuthorizationCodeLink.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.scopes != null && message.hasOwnProperty("scopes")) { + if (!Array.isArray(message.scopes)) + return "scopes: array expected"; + for (var i = 0; i < message.scopes.length; ++i) + if (!$util.isString(message.scopes[i])) + return "scopes: string[] expected"; + } + if (message.clientId != null && message.hasOwnProperty("clientId")) + if (!$util.isString(message.clientId)) + return "clientId: string expected"; + if (message.enablePkce != null && message.hasOwnProperty("enablePkce")) + if (typeof message.enablePkce !== "boolean") + return "enablePkce: boolean expected"; + return null; + }; + + /** + * Creates an AuthorizationCodeLink message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.connectors.v1.AuthorizationCodeLink + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.connectors.v1.AuthorizationCodeLink} AuthorizationCodeLink + */ + AuthorizationCodeLink.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.connectors.v1.AuthorizationCodeLink) + return object; + var message = new $root.google.cloud.connectors.v1.AuthorizationCodeLink(); + if (object.uri != null) + message.uri = String(object.uri); + if (object.scopes) { + if (!Array.isArray(object.scopes)) + throw TypeError(".google.cloud.connectors.v1.AuthorizationCodeLink.scopes: array expected"); + message.scopes = []; + for (var i = 0; i < object.scopes.length; ++i) + message.scopes[i] = String(object.scopes[i]); + } + if (object.clientId != null) + message.clientId = String(object.clientId); + if (object.enablePkce != null) + message.enablePkce = Boolean(object.enablePkce); + return message; + }; + + /** + * Creates a plain object from an AuthorizationCodeLink message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.connectors.v1.AuthorizationCodeLink + * @static + * @param {google.cloud.connectors.v1.AuthorizationCodeLink} message AuthorizationCodeLink + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + AuthorizationCodeLink.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.scopes = []; + if (options.defaults) { + object.uri = ""; + object.clientId = ""; + object.enablePkce = false; + } + if (message.uri != null && message.hasOwnProperty("uri")) + object.uri = message.uri; + if (message.scopes && message.scopes.length) { + object.scopes = []; + for (var j = 0; j < message.scopes.length; ++j) + object.scopes[j] = message.scopes[j]; + } + if (message.clientId != null && message.hasOwnProperty("clientId")) + object.clientId = message.clientId; + if (message.enablePkce != null && message.hasOwnProperty("enablePkce")) + object.enablePkce = message.enablePkce; + return object; + }; + + /** + * Converts this AuthorizationCodeLink to JSON. + * @function toJSON + * @memberof google.cloud.connectors.v1.AuthorizationCodeLink + * @instance + * @returns {Object.} JSON object + */ + AuthorizationCodeLink.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for AuthorizationCodeLink + * @function getTypeUrl + * @memberof google.cloud.connectors.v1.AuthorizationCodeLink + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + AuthorizationCodeLink.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.connectors.v1.AuthorizationCodeLink"; + }; + + return AuthorizationCodeLink; + })(); + + /** + * LaunchStage enum. + * @name google.cloud.connectors.v1.LaunchStage + * @enum {number} + * @property {number} LAUNCH_STAGE_UNSPECIFIED=0 LAUNCH_STAGE_UNSPECIFIED value + * @property {number} PREVIEW=1 PREVIEW value + * @property {number} GA=2 GA value + * @property {number} DEPRECATED=3 DEPRECATED value + * @property {number} PRIVATE_PREVIEW=5 PRIVATE_PREVIEW value + */ + v1.LaunchStage = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "LAUNCH_STAGE_UNSPECIFIED"] = 0; + values[valuesById[1] = "PREVIEW"] = 1; + values[valuesById[2] = "GA"] = 2; + values[valuesById[3] = "DEPRECATED"] = 3; + values[valuesById[5] = "PRIVATE_PREVIEW"] = 5; + return values; + })(); + + v1.Connection = (function() { + + /** + * Properties of a Connection. + * @memberof google.cloud.connectors.v1 + * @interface IConnection + * @property {string|null} [name] Connection name + * @property {google.protobuf.ITimestamp|null} [createTime] Connection createTime + * @property {google.protobuf.ITimestamp|null} [updateTime] Connection updateTime + * @property {Object.|null} [labels] Connection labels + * @property {string|null} [description] Connection description + * @property {string|null} [connectorVersion] Connection connectorVersion + * @property {google.cloud.connectors.v1.IConnectionStatus|null} [status] Connection status + * @property {Array.|null} [configVariables] Connection configVariables + * @property {google.cloud.connectors.v1.IAuthConfig|null} [authConfig] Connection authConfig + * @property {google.cloud.connectors.v1.ILockConfig|null} [lockConfig] Connection lockConfig + * @property {Array.|null} [destinationConfigs] Connection destinationConfigs + * @property {string|null} [imageLocation] Connection imageLocation + * @property {string|null} [serviceAccount] Connection serviceAccount + * @property {string|null} [serviceDirectory] Connection serviceDirectory + * @property {string|null} [envoyImageLocation] Connection envoyImageLocation + * @property {boolean|null} [suspended] Connection suspended + * @property {google.cloud.connectors.v1.INodeConfig|null} [nodeConfig] Connection nodeConfig + * @property {google.cloud.connectors.v1.ISslConfig|null} [sslConfig] Connection sslConfig + */ + + /** + * Constructs a new Connection. + * @memberof google.cloud.connectors.v1 + * @classdesc Represents a Connection. + * @implements IConnection + * @constructor + * @param {google.cloud.connectors.v1.IConnection=} [properties] Properties to set + */ + function Connection(properties) { + this.labels = {}; + this.configVariables = []; + this.destinationConfigs = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Connection name. + * @member {string} name + * @memberof google.cloud.connectors.v1.Connection + * @instance + */ + Connection.prototype.name = ""; + + /** + * Connection createTime. + * @member {google.protobuf.ITimestamp|null|undefined} createTime + * @memberof google.cloud.connectors.v1.Connection + * @instance + */ + Connection.prototype.createTime = null; + + /** + * Connection updateTime. + * @member {google.protobuf.ITimestamp|null|undefined} updateTime + * @memberof google.cloud.connectors.v1.Connection + * @instance + */ + Connection.prototype.updateTime = null; + + /** + * Connection labels. + * @member {Object.} labels + * @memberof google.cloud.connectors.v1.Connection + * @instance + */ + Connection.prototype.labels = $util.emptyObject; + + /** + * Connection description. + * @member {string} description + * @memberof google.cloud.connectors.v1.Connection + * @instance + */ + Connection.prototype.description = ""; + + /** + * Connection connectorVersion. + * @member {string} connectorVersion + * @memberof google.cloud.connectors.v1.Connection + * @instance + */ + Connection.prototype.connectorVersion = ""; + + /** + * Connection status. + * @member {google.cloud.connectors.v1.IConnectionStatus|null|undefined} status + * @memberof google.cloud.connectors.v1.Connection + * @instance + */ + Connection.prototype.status = null; + + /** + * Connection configVariables. + * @member {Array.} configVariables + * @memberof google.cloud.connectors.v1.Connection + * @instance + */ + Connection.prototype.configVariables = $util.emptyArray; + + /** + * Connection authConfig. + * @member {google.cloud.connectors.v1.IAuthConfig|null|undefined} authConfig + * @memberof google.cloud.connectors.v1.Connection + * @instance + */ + Connection.prototype.authConfig = null; + + /** + * Connection lockConfig. + * @member {google.cloud.connectors.v1.ILockConfig|null|undefined} lockConfig + * @memberof google.cloud.connectors.v1.Connection + * @instance + */ + Connection.prototype.lockConfig = null; + + /** + * Connection destinationConfigs. + * @member {Array.} destinationConfigs + * @memberof google.cloud.connectors.v1.Connection + * @instance + */ + Connection.prototype.destinationConfigs = $util.emptyArray; + + /** + * Connection imageLocation. + * @member {string} imageLocation + * @memberof google.cloud.connectors.v1.Connection + * @instance + */ + Connection.prototype.imageLocation = ""; + + /** + * Connection serviceAccount. + * @member {string} serviceAccount + * @memberof google.cloud.connectors.v1.Connection + * @instance + */ + Connection.prototype.serviceAccount = ""; + + /** + * Connection serviceDirectory. + * @member {string} serviceDirectory + * @memberof google.cloud.connectors.v1.Connection + * @instance + */ + Connection.prototype.serviceDirectory = ""; + + /** + * Connection envoyImageLocation. + * @member {string} envoyImageLocation + * @memberof google.cloud.connectors.v1.Connection + * @instance + */ + Connection.prototype.envoyImageLocation = ""; + + /** + * Connection suspended. + * @member {boolean} suspended + * @memberof google.cloud.connectors.v1.Connection + * @instance + */ + Connection.prototype.suspended = false; + + /** + * Connection nodeConfig. + * @member {google.cloud.connectors.v1.INodeConfig|null|undefined} nodeConfig + * @memberof google.cloud.connectors.v1.Connection + * @instance + */ + Connection.prototype.nodeConfig = null; + + /** + * Connection sslConfig. + * @member {google.cloud.connectors.v1.ISslConfig|null|undefined} sslConfig + * @memberof google.cloud.connectors.v1.Connection + * @instance + */ + Connection.prototype.sslConfig = null; + + /** + * Creates a new Connection instance using the specified properties. + * @function create + * @memberof google.cloud.connectors.v1.Connection + * @static + * @param {google.cloud.connectors.v1.IConnection=} [properties] Properties to set + * @returns {google.cloud.connectors.v1.Connection} Connection instance + */ + Connection.create = function create(properties) { + return new Connection(properties); + }; + + /** + * Encodes the specified Connection message. Does not implicitly {@link google.cloud.connectors.v1.Connection.verify|verify} messages. + * @function encode + * @memberof google.cloud.connectors.v1.Connection + * @static + * @param {google.cloud.connectors.v1.IConnection} message Connection message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Connection.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.createTime != null && Object.hasOwnProperty.call(message, "createTime")) + $root.google.protobuf.Timestamp.encode(message.createTime, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + 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(); + if (message.labels != null && Object.hasOwnProperty.call(message, "labels")) + for (var keys = Object.keys(message.labels), i = 0; i < keys.length; ++i) + writer.uint32(/* id 4, wireType 2 =*/34).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.labels[keys[i]]).ldelim(); + if (message.description != null && Object.hasOwnProperty.call(message, "description")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.description); + if (message.connectorVersion != null && Object.hasOwnProperty.call(message, "connectorVersion")) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.connectorVersion); + if (message.status != null && Object.hasOwnProperty.call(message, "status")) + $root.google.cloud.connectors.v1.ConnectionStatus.encode(message.status, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + if (message.configVariables != null && message.configVariables.length) + for (var i = 0; i < message.configVariables.length; ++i) + $root.google.cloud.connectors.v1.ConfigVariable.encode(message.configVariables[i], writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); + if (message.authConfig != null && Object.hasOwnProperty.call(message, "authConfig")) + $root.google.cloud.connectors.v1.AuthConfig.encode(message.authConfig, writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim(); + if (message.lockConfig != null && Object.hasOwnProperty.call(message, "lockConfig")) + $root.google.cloud.connectors.v1.LockConfig.encode(message.lockConfig, writer.uint32(/* id 10, wireType 2 =*/82).fork()).ldelim(); + if (message.imageLocation != null && Object.hasOwnProperty.call(message, "imageLocation")) + writer.uint32(/* id 11, wireType 2 =*/90).string(message.imageLocation); + if (message.serviceAccount != null && Object.hasOwnProperty.call(message, "serviceAccount")) + writer.uint32(/* id 12, wireType 2 =*/98).string(message.serviceAccount); + if (message.serviceDirectory != null && Object.hasOwnProperty.call(message, "serviceDirectory")) + writer.uint32(/* id 13, wireType 2 =*/106).string(message.serviceDirectory); + if (message.envoyImageLocation != null && Object.hasOwnProperty.call(message, "envoyImageLocation")) + writer.uint32(/* id 15, wireType 2 =*/122).string(message.envoyImageLocation); + if (message.suspended != null && Object.hasOwnProperty.call(message, "suspended")) + writer.uint32(/* id 17, wireType 0 =*/136).bool(message.suspended); + if (message.destinationConfigs != null && message.destinationConfigs.length) + for (var i = 0; i < message.destinationConfigs.length; ++i) + $root.google.cloud.connectors.v1.DestinationConfig.encode(message.destinationConfigs[i], writer.uint32(/* id 18, wireType 2 =*/146).fork()).ldelim(); + if (message.nodeConfig != null && Object.hasOwnProperty.call(message, "nodeConfig")) + $root.google.cloud.connectors.v1.NodeConfig.encode(message.nodeConfig, writer.uint32(/* id 19, wireType 2 =*/154).fork()).ldelim(); + if (message.sslConfig != null && Object.hasOwnProperty.call(message, "sslConfig")) + $root.google.cloud.connectors.v1.SslConfig.encode(message.sslConfig, writer.uint32(/* id 21, wireType 2 =*/170).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified Connection message, length delimited. Does not implicitly {@link google.cloud.connectors.v1.Connection.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.connectors.v1.Connection + * @static + * @param {google.cloud.connectors.v1.IConnection} message Connection message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Connection.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Connection message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.connectors.v1.Connection + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.connectors.v1.Connection} Connection + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Connection.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.connectors.v1.Connection(), key, value; + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.createTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 3: { + message.updateTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 4: { + if (message.labels === $util.emptyObject) + message.labels = {}; + 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.labels[key] = value; + break; + } + case 5: { + message.description = reader.string(); + break; + } + case 6: { + message.connectorVersion = reader.string(); + break; + } + case 7: { + message.status = $root.google.cloud.connectors.v1.ConnectionStatus.decode(reader, reader.uint32()); + break; + } + case 8: { + if (!(message.configVariables && message.configVariables.length)) + message.configVariables = []; + message.configVariables.push($root.google.cloud.connectors.v1.ConfigVariable.decode(reader, reader.uint32())); + break; + } + case 9: { + message.authConfig = $root.google.cloud.connectors.v1.AuthConfig.decode(reader, reader.uint32()); + break; + } + case 10: { + message.lockConfig = $root.google.cloud.connectors.v1.LockConfig.decode(reader, reader.uint32()); + break; + } + case 18: { + if (!(message.destinationConfigs && message.destinationConfigs.length)) + message.destinationConfigs = []; + message.destinationConfigs.push($root.google.cloud.connectors.v1.DestinationConfig.decode(reader, reader.uint32())); + break; + } + case 11: { + message.imageLocation = reader.string(); + break; + } + case 12: { + message.serviceAccount = reader.string(); + break; + } + case 13: { + message.serviceDirectory = reader.string(); + break; + } + case 15: { + message.envoyImageLocation = reader.string(); + break; + } + case 17: { + message.suspended = reader.bool(); + break; + } + case 19: { + message.nodeConfig = $root.google.cloud.connectors.v1.NodeConfig.decode(reader, reader.uint32()); + break; + } + case 21: { + message.sslConfig = $root.google.cloud.connectors.v1.SslConfig.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Connection message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.connectors.v1.Connection + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.connectors.v1.Connection} Connection + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Connection.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Connection message. + * @function verify + * @memberof google.cloud.connectors.v1.Connection + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Connection.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.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.labels != null && message.hasOwnProperty("labels")) { + if (!$util.isObject(message.labels)) + return "labels: object expected"; + var key = Object.keys(message.labels); + for (var i = 0; i < key.length; ++i) + if (!$util.isString(message.labels[key[i]])) + return "labels: string{k:string} expected"; + } + if (message.description != null && message.hasOwnProperty("description")) + if (!$util.isString(message.description)) + return "description: string expected"; + if (message.connectorVersion != null && message.hasOwnProperty("connectorVersion")) + if (!$util.isString(message.connectorVersion)) + return "connectorVersion: string expected"; + if (message.status != null && message.hasOwnProperty("status")) { + var error = $root.google.cloud.connectors.v1.ConnectionStatus.verify(message.status); + if (error) + return "status." + error; + } + if (message.configVariables != null && message.hasOwnProperty("configVariables")) { + if (!Array.isArray(message.configVariables)) + return "configVariables: array expected"; + for (var i = 0; i < message.configVariables.length; ++i) { + var error = $root.google.cloud.connectors.v1.ConfigVariable.verify(message.configVariables[i]); + if (error) + return "configVariables." + error; + } + } + if (message.authConfig != null && message.hasOwnProperty("authConfig")) { + var error = $root.google.cloud.connectors.v1.AuthConfig.verify(message.authConfig); + if (error) + return "authConfig." + error; + } + if (message.lockConfig != null && message.hasOwnProperty("lockConfig")) { + var error = $root.google.cloud.connectors.v1.LockConfig.verify(message.lockConfig); + if (error) + return "lockConfig." + error; + } + if (message.destinationConfigs != null && message.hasOwnProperty("destinationConfigs")) { + if (!Array.isArray(message.destinationConfigs)) + return "destinationConfigs: array expected"; + for (var i = 0; i < message.destinationConfigs.length; ++i) { + var error = $root.google.cloud.connectors.v1.DestinationConfig.verify(message.destinationConfigs[i]); + if (error) + return "destinationConfigs." + error; + } + } + if (message.imageLocation != null && message.hasOwnProperty("imageLocation")) + if (!$util.isString(message.imageLocation)) + return "imageLocation: string expected"; + if (message.serviceAccount != null && message.hasOwnProperty("serviceAccount")) + if (!$util.isString(message.serviceAccount)) + return "serviceAccount: string expected"; + if (message.serviceDirectory != null && message.hasOwnProperty("serviceDirectory")) + if (!$util.isString(message.serviceDirectory)) + return "serviceDirectory: string expected"; + if (message.envoyImageLocation != null && message.hasOwnProperty("envoyImageLocation")) + if (!$util.isString(message.envoyImageLocation)) + return "envoyImageLocation: string expected"; + if (message.suspended != null && message.hasOwnProperty("suspended")) + if (typeof message.suspended !== "boolean") + return "suspended: boolean expected"; + if (message.nodeConfig != null && message.hasOwnProperty("nodeConfig")) { + var error = $root.google.cloud.connectors.v1.NodeConfig.verify(message.nodeConfig); + if (error) + return "nodeConfig." + error; + } + if (message.sslConfig != null && message.hasOwnProperty("sslConfig")) { + var error = $root.google.cloud.connectors.v1.SslConfig.verify(message.sslConfig); + if (error) + return "sslConfig." + error; + } + return null; + }; + + /** + * Creates a Connection message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.connectors.v1.Connection + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.connectors.v1.Connection} Connection + */ + Connection.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.connectors.v1.Connection) + return object; + var message = new $root.google.cloud.connectors.v1.Connection(); + if (object.name != null) + message.name = String(object.name); + if (object.createTime != null) { + if (typeof object.createTime !== "object") + throw TypeError(".google.cloud.connectors.v1.Connection.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.connectors.v1.Connection.updateTime: object expected"); + message.updateTime = $root.google.protobuf.Timestamp.fromObject(object.updateTime); + } + if (object.labels) { + if (typeof object.labels !== "object") + throw TypeError(".google.cloud.connectors.v1.Connection.labels: object expected"); + message.labels = {}; + for (var keys = Object.keys(object.labels), i = 0; i < keys.length; ++i) + message.labels[keys[i]] = String(object.labels[keys[i]]); + } + if (object.description != null) + message.description = String(object.description); + if (object.connectorVersion != null) + message.connectorVersion = String(object.connectorVersion); + if (object.status != null) { + if (typeof object.status !== "object") + throw TypeError(".google.cloud.connectors.v1.Connection.status: object expected"); + message.status = $root.google.cloud.connectors.v1.ConnectionStatus.fromObject(object.status); + } + if (object.configVariables) { + if (!Array.isArray(object.configVariables)) + throw TypeError(".google.cloud.connectors.v1.Connection.configVariables: array expected"); + message.configVariables = []; + for (var i = 0; i < object.configVariables.length; ++i) { + if (typeof object.configVariables[i] !== "object") + throw TypeError(".google.cloud.connectors.v1.Connection.configVariables: object expected"); + message.configVariables[i] = $root.google.cloud.connectors.v1.ConfigVariable.fromObject(object.configVariables[i]); + } + } + if (object.authConfig != null) { + if (typeof object.authConfig !== "object") + throw TypeError(".google.cloud.connectors.v1.Connection.authConfig: object expected"); + message.authConfig = $root.google.cloud.connectors.v1.AuthConfig.fromObject(object.authConfig); + } + if (object.lockConfig != null) { + if (typeof object.lockConfig !== "object") + throw TypeError(".google.cloud.connectors.v1.Connection.lockConfig: object expected"); + message.lockConfig = $root.google.cloud.connectors.v1.LockConfig.fromObject(object.lockConfig); + } + if (object.destinationConfigs) { + if (!Array.isArray(object.destinationConfigs)) + throw TypeError(".google.cloud.connectors.v1.Connection.destinationConfigs: array expected"); + message.destinationConfigs = []; + for (var i = 0; i < object.destinationConfigs.length; ++i) { + if (typeof object.destinationConfigs[i] !== "object") + throw TypeError(".google.cloud.connectors.v1.Connection.destinationConfigs: object expected"); + message.destinationConfigs[i] = $root.google.cloud.connectors.v1.DestinationConfig.fromObject(object.destinationConfigs[i]); + } + } + if (object.imageLocation != null) + message.imageLocation = String(object.imageLocation); + if (object.serviceAccount != null) + message.serviceAccount = String(object.serviceAccount); + if (object.serviceDirectory != null) + message.serviceDirectory = String(object.serviceDirectory); + if (object.envoyImageLocation != null) + message.envoyImageLocation = String(object.envoyImageLocation); + if (object.suspended != null) + message.suspended = Boolean(object.suspended); + if (object.nodeConfig != null) { + if (typeof object.nodeConfig !== "object") + throw TypeError(".google.cloud.connectors.v1.Connection.nodeConfig: object expected"); + message.nodeConfig = $root.google.cloud.connectors.v1.NodeConfig.fromObject(object.nodeConfig); + } + if (object.sslConfig != null) { + if (typeof object.sslConfig !== "object") + throw TypeError(".google.cloud.connectors.v1.Connection.sslConfig: object expected"); + message.sslConfig = $root.google.cloud.connectors.v1.SslConfig.fromObject(object.sslConfig); + } + return message; + }; + + /** + * Creates a plain object from a Connection message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.connectors.v1.Connection + * @static + * @param {google.cloud.connectors.v1.Connection} message Connection + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Connection.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.configVariables = []; + object.destinationConfigs = []; + } + if (options.objects || options.defaults) + object.labels = {}; + if (options.defaults) { + object.name = ""; + object.createTime = null; + object.updateTime = null; + object.description = ""; + object.connectorVersion = ""; + object.status = null; + object.authConfig = null; + object.lockConfig = null; + object.imageLocation = ""; + object.serviceAccount = ""; + object.serviceDirectory = ""; + object.envoyImageLocation = ""; + object.suspended = false; + object.nodeConfig = null; + object.sslConfig = null; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + 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); + var keys2; + if (message.labels && (keys2 = Object.keys(message.labels)).length) { + object.labels = {}; + for (var j = 0; j < keys2.length; ++j) + object.labels[keys2[j]] = message.labels[keys2[j]]; + } + if (message.description != null && message.hasOwnProperty("description")) + object.description = message.description; + if (message.connectorVersion != null && message.hasOwnProperty("connectorVersion")) + object.connectorVersion = message.connectorVersion; + if (message.status != null && message.hasOwnProperty("status")) + object.status = $root.google.cloud.connectors.v1.ConnectionStatus.toObject(message.status, options); + if (message.configVariables && message.configVariables.length) { + object.configVariables = []; + for (var j = 0; j < message.configVariables.length; ++j) + object.configVariables[j] = $root.google.cloud.connectors.v1.ConfigVariable.toObject(message.configVariables[j], options); + } + if (message.authConfig != null && message.hasOwnProperty("authConfig")) + object.authConfig = $root.google.cloud.connectors.v1.AuthConfig.toObject(message.authConfig, options); + if (message.lockConfig != null && message.hasOwnProperty("lockConfig")) + object.lockConfig = $root.google.cloud.connectors.v1.LockConfig.toObject(message.lockConfig, options); + if (message.imageLocation != null && message.hasOwnProperty("imageLocation")) + object.imageLocation = message.imageLocation; + if (message.serviceAccount != null && message.hasOwnProperty("serviceAccount")) + object.serviceAccount = message.serviceAccount; + if (message.serviceDirectory != null && message.hasOwnProperty("serviceDirectory")) + object.serviceDirectory = message.serviceDirectory; + if (message.envoyImageLocation != null && message.hasOwnProperty("envoyImageLocation")) + object.envoyImageLocation = message.envoyImageLocation; + if (message.suspended != null && message.hasOwnProperty("suspended")) + object.suspended = message.suspended; + if (message.destinationConfigs && message.destinationConfigs.length) { + object.destinationConfigs = []; + for (var j = 0; j < message.destinationConfigs.length; ++j) + object.destinationConfigs[j] = $root.google.cloud.connectors.v1.DestinationConfig.toObject(message.destinationConfigs[j], options); + } + if (message.nodeConfig != null && message.hasOwnProperty("nodeConfig")) + object.nodeConfig = $root.google.cloud.connectors.v1.NodeConfig.toObject(message.nodeConfig, options); + if (message.sslConfig != null && message.hasOwnProperty("sslConfig")) + object.sslConfig = $root.google.cloud.connectors.v1.SslConfig.toObject(message.sslConfig, options); + return object; + }; + + /** + * Converts this Connection to JSON. + * @function toJSON + * @memberof google.cloud.connectors.v1.Connection + * @instance + * @returns {Object.} JSON object + */ + Connection.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Connection + * @function getTypeUrl + * @memberof google.cloud.connectors.v1.Connection + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Connection.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.connectors.v1.Connection"; + }; + + return Connection; + })(); + + v1.NodeConfig = (function() { + + /** + * Properties of a NodeConfig. + * @memberof google.cloud.connectors.v1 + * @interface INodeConfig + * @property {number|null} [minNodeCount] NodeConfig minNodeCount + * @property {number|null} [maxNodeCount] NodeConfig maxNodeCount + */ + + /** + * Constructs a new NodeConfig. + * @memberof google.cloud.connectors.v1 + * @classdesc Represents a NodeConfig. + * @implements INodeConfig + * @constructor + * @param {google.cloud.connectors.v1.INodeConfig=} [properties] Properties to set + */ + function NodeConfig(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * NodeConfig minNodeCount. + * @member {number} minNodeCount + * @memberof google.cloud.connectors.v1.NodeConfig + * @instance + */ + NodeConfig.prototype.minNodeCount = 0; + + /** + * NodeConfig maxNodeCount. + * @member {number} maxNodeCount + * @memberof google.cloud.connectors.v1.NodeConfig + * @instance + */ + NodeConfig.prototype.maxNodeCount = 0; + + /** + * Creates a new NodeConfig instance using the specified properties. + * @function create + * @memberof google.cloud.connectors.v1.NodeConfig + * @static + * @param {google.cloud.connectors.v1.INodeConfig=} [properties] Properties to set + * @returns {google.cloud.connectors.v1.NodeConfig} NodeConfig instance + */ + NodeConfig.create = function create(properties) { + return new NodeConfig(properties); + }; + + /** + * Encodes the specified NodeConfig message. Does not implicitly {@link google.cloud.connectors.v1.NodeConfig.verify|verify} messages. + * @function encode + * @memberof google.cloud.connectors.v1.NodeConfig + * @static + * @param {google.cloud.connectors.v1.INodeConfig} message NodeConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + NodeConfig.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.minNodeCount != null && Object.hasOwnProperty.call(message, "minNodeCount")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.minNodeCount); + if (message.maxNodeCount != null && Object.hasOwnProperty.call(message, "maxNodeCount")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.maxNodeCount); + return writer; + }; + + /** + * Encodes the specified NodeConfig message, length delimited. Does not implicitly {@link google.cloud.connectors.v1.NodeConfig.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.connectors.v1.NodeConfig + * @static + * @param {google.cloud.connectors.v1.INodeConfig} message NodeConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + NodeConfig.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a NodeConfig message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.connectors.v1.NodeConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.connectors.v1.NodeConfig} NodeConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + NodeConfig.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.connectors.v1.NodeConfig(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.minNodeCount = reader.int32(); + break; + } + case 2: { + message.maxNodeCount = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a NodeConfig message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.connectors.v1.NodeConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.connectors.v1.NodeConfig} NodeConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + NodeConfig.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a NodeConfig message. + * @function verify + * @memberof google.cloud.connectors.v1.NodeConfig + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + NodeConfig.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.minNodeCount != null && message.hasOwnProperty("minNodeCount")) + if (!$util.isInteger(message.minNodeCount)) + return "minNodeCount: integer expected"; + if (message.maxNodeCount != null && message.hasOwnProperty("maxNodeCount")) + if (!$util.isInteger(message.maxNodeCount)) + return "maxNodeCount: integer expected"; + return null; + }; + + /** + * Creates a NodeConfig message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.connectors.v1.NodeConfig + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.connectors.v1.NodeConfig} NodeConfig + */ + NodeConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.connectors.v1.NodeConfig) + return object; + var message = new $root.google.cloud.connectors.v1.NodeConfig(); + if (object.minNodeCount != null) + message.minNodeCount = object.minNodeCount | 0; + if (object.maxNodeCount != null) + message.maxNodeCount = object.maxNodeCount | 0; + return message; + }; + + /** + * Creates a plain object from a NodeConfig message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.connectors.v1.NodeConfig + * @static + * @param {google.cloud.connectors.v1.NodeConfig} message NodeConfig + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + NodeConfig.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.minNodeCount = 0; + object.maxNodeCount = 0; + } + if (message.minNodeCount != null && message.hasOwnProperty("minNodeCount")) + object.minNodeCount = message.minNodeCount; + if (message.maxNodeCount != null && message.hasOwnProperty("maxNodeCount")) + object.maxNodeCount = message.maxNodeCount; + return object; + }; + + /** + * Converts this NodeConfig to JSON. + * @function toJSON + * @memberof google.cloud.connectors.v1.NodeConfig + * @instance + * @returns {Object.} JSON object + */ + NodeConfig.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for NodeConfig + * @function getTypeUrl + * @memberof google.cloud.connectors.v1.NodeConfig + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + NodeConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.connectors.v1.NodeConfig"; + }; + + return NodeConfig; + })(); + + v1.ConnectionSchemaMetadata = (function() { + + /** + * Properties of a ConnectionSchemaMetadata. + * @memberof google.cloud.connectors.v1 + * @interface IConnectionSchemaMetadata + * @property {Array.|null} [entities] ConnectionSchemaMetadata entities + * @property {Array.|null} [actions] ConnectionSchemaMetadata actions + * @property {string|null} [name] ConnectionSchemaMetadata name + * @property {google.protobuf.ITimestamp|null} [updateTime] ConnectionSchemaMetadata updateTime + * @property {google.protobuf.ITimestamp|null} [refreshTime] ConnectionSchemaMetadata refreshTime + * @property {google.cloud.connectors.v1.ConnectionSchemaMetadata.State|null} [state] ConnectionSchemaMetadata state + */ + + /** + * Constructs a new ConnectionSchemaMetadata. + * @memberof google.cloud.connectors.v1 + * @classdesc Represents a ConnectionSchemaMetadata. + * @implements IConnectionSchemaMetadata + * @constructor + * @param {google.cloud.connectors.v1.IConnectionSchemaMetadata=} [properties] Properties to set + */ + function ConnectionSchemaMetadata(properties) { + this.entities = []; + this.actions = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ConnectionSchemaMetadata entities. + * @member {Array.} entities + * @memberof google.cloud.connectors.v1.ConnectionSchemaMetadata + * @instance + */ + ConnectionSchemaMetadata.prototype.entities = $util.emptyArray; + + /** + * ConnectionSchemaMetadata actions. + * @member {Array.} actions + * @memberof google.cloud.connectors.v1.ConnectionSchemaMetadata + * @instance + */ + ConnectionSchemaMetadata.prototype.actions = $util.emptyArray; + + /** + * ConnectionSchemaMetadata name. + * @member {string} name + * @memberof google.cloud.connectors.v1.ConnectionSchemaMetadata + * @instance + */ + ConnectionSchemaMetadata.prototype.name = ""; + + /** + * ConnectionSchemaMetadata updateTime. + * @member {google.protobuf.ITimestamp|null|undefined} updateTime + * @memberof google.cloud.connectors.v1.ConnectionSchemaMetadata + * @instance + */ + ConnectionSchemaMetadata.prototype.updateTime = null; + + /** + * ConnectionSchemaMetadata refreshTime. + * @member {google.protobuf.ITimestamp|null|undefined} refreshTime + * @memberof google.cloud.connectors.v1.ConnectionSchemaMetadata + * @instance + */ + ConnectionSchemaMetadata.prototype.refreshTime = null; + + /** + * ConnectionSchemaMetadata state. + * @member {google.cloud.connectors.v1.ConnectionSchemaMetadata.State} state + * @memberof google.cloud.connectors.v1.ConnectionSchemaMetadata + * @instance + */ + ConnectionSchemaMetadata.prototype.state = 0; + + /** + * Creates a new ConnectionSchemaMetadata instance using the specified properties. + * @function create + * @memberof google.cloud.connectors.v1.ConnectionSchemaMetadata + * @static + * @param {google.cloud.connectors.v1.IConnectionSchemaMetadata=} [properties] Properties to set + * @returns {google.cloud.connectors.v1.ConnectionSchemaMetadata} ConnectionSchemaMetadata instance + */ + ConnectionSchemaMetadata.create = function create(properties) { + return new ConnectionSchemaMetadata(properties); + }; + + /** + * Encodes the specified ConnectionSchemaMetadata message. Does not implicitly {@link google.cloud.connectors.v1.ConnectionSchemaMetadata.verify|verify} messages. + * @function encode + * @memberof google.cloud.connectors.v1.ConnectionSchemaMetadata + * @static + * @param {google.cloud.connectors.v1.IConnectionSchemaMetadata} message ConnectionSchemaMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ConnectionSchemaMetadata.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.entities != null && message.entities.length) + for (var i = 0; i < message.entities.length; ++i) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.entities[i]); + if (message.actions != null && message.actions.length) + for (var i = 0; i < message.actions.length; ++i) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.actions[i]); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.name); + if (message.updateTime != null && Object.hasOwnProperty.call(message, "updateTime")) + $root.google.protobuf.Timestamp.encode(message.updateTime, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.refreshTime != null && Object.hasOwnProperty.call(message, "refreshTime")) + $root.google.protobuf.Timestamp.encode(message.refreshTime, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.state != null && Object.hasOwnProperty.call(message, "state")) + writer.uint32(/* id 6, wireType 0 =*/48).int32(message.state); + return writer; + }; + + /** + * Encodes the specified ConnectionSchemaMetadata message, length delimited. Does not implicitly {@link google.cloud.connectors.v1.ConnectionSchemaMetadata.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.connectors.v1.ConnectionSchemaMetadata + * @static + * @param {google.cloud.connectors.v1.IConnectionSchemaMetadata} message ConnectionSchemaMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ConnectionSchemaMetadata.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ConnectionSchemaMetadata message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.connectors.v1.ConnectionSchemaMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.connectors.v1.ConnectionSchemaMetadata} ConnectionSchemaMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ConnectionSchemaMetadata.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.connectors.v1.ConnectionSchemaMetadata(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.entities && message.entities.length)) + message.entities = []; + message.entities.push(reader.string()); + break; + } + case 2: { + if (!(message.actions && message.actions.length)) + message.actions = []; + message.actions.push(reader.string()); + break; + } + case 3: { + message.name = reader.string(); + break; + } + case 4: { + message.updateTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 5: { + message.refreshTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 6: { + message.state = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ConnectionSchemaMetadata message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.connectors.v1.ConnectionSchemaMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.connectors.v1.ConnectionSchemaMetadata} ConnectionSchemaMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ConnectionSchemaMetadata.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ConnectionSchemaMetadata message. + * @function verify + * @memberof google.cloud.connectors.v1.ConnectionSchemaMetadata + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ConnectionSchemaMetadata.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.entities != null && message.hasOwnProperty("entities")) { + if (!Array.isArray(message.entities)) + return "entities: array expected"; + for (var i = 0; i < message.entities.length; ++i) + if (!$util.isString(message.entities[i])) + return "entities: string[] expected"; + } + if (message.actions != null && message.hasOwnProperty("actions")) { + if (!Array.isArray(message.actions)) + return "actions: array expected"; + for (var i = 0; i < message.actions.length; ++i) + if (!$util.isString(message.actions[i])) + return "actions: string[] expected"; + } + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.updateTime != null && message.hasOwnProperty("updateTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.updateTime); + if (error) + return "updateTime." + error; + } + if (message.refreshTime != null && message.hasOwnProperty("refreshTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.refreshTime); + if (error) + return "refreshTime." + error; + } + if (message.state != null && message.hasOwnProperty("state")) + switch (message.state) { + default: + return "state: enum value expected"; + case 0: + case 1: + case 2: + break; + } + return null; + }; + + /** + * Creates a ConnectionSchemaMetadata message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.connectors.v1.ConnectionSchemaMetadata + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.connectors.v1.ConnectionSchemaMetadata} ConnectionSchemaMetadata + */ + ConnectionSchemaMetadata.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.connectors.v1.ConnectionSchemaMetadata) + return object; + var message = new $root.google.cloud.connectors.v1.ConnectionSchemaMetadata(); + if (object.entities) { + if (!Array.isArray(object.entities)) + throw TypeError(".google.cloud.connectors.v1.ConnectionSchemaMetadata.entities: array expected"); + message.entities = []; + for (var i = 0; i < object.entities.length; ++i) + message.entities[i] = String(object.entities[i]); + } + if (object.actions) { + if (!Array.isArray(object.actions)) + throw TypeError(".google.cloud.connectors.v1.ConnectionSchemaMetadata.actions: array expected"); + message.actions = []; + for (var i = 0; i < object.actions.length; ++i) + message.actions[i] = String(object.actions[i]); + } + if (object.name != null) + message.name = String(object.name); + if (object.updateTime != null) { + if (typeof object.updateTime !== "object") + throw TypeError(".google.cloud.connectors.v1.ConnectionSchemaMetadata.updateTime: object expected"); + message.updateTime = $root.google.protobuf.Timestamp.fromObject(object.updateTime); + } + if (object.refreshTime != null) { + if (typeof object.refreshTime !== "object") + throw TypeError(".google.cloud.connectors.v1.ConnectionSchemaMetadata.refreshTime: object expected"); + message.refreshTime = $root.google.protobuf.Timestamp.fromObject(object.refreshTime); + } + 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 "REFRESHING": + case 1: + message.state = 1; + break; + case "UPDATED": + case 2: + message.state = 2; + break; + } + return message; + }; + + /** + * Creates a plain object from a ConnectionSchemaMetadata message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.connectors.v1.ConnectionSchemaMetadata + * @static + * @param {google.cloud.connectors.v1.ConnectionSchemaMetadata} message ConnectionSchemaMetadata + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ConnectionSchemaMetadata.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.entities = []; + object.actions = []; + } + if (options.defaults) { + object.name = ""; + object.updateTime = null; + object.refreshTime = null; + object.state = options.enums === String ? "STATE_UNSPECIFIED" : 0; + } + if (message.entities && message.entities.length) { + object.entities = []; + for (var j = 0; j < message.entities.length; ++j) + object.entities[j] = message.entities[j]; + } + if (message.actions && message.actions.length) { + object.actions = []; + for (var j = 0; j < message.actions.length; ++j) + object.actions[j] = message.actions[j]; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.updateTime != null && message.hasOwnProperty("updateTime")) + object.updateTime = $root.google.protobuf.Timestamp.toObject(message.updateTime, options); + if (message.refreshTime != null && message.hasOwnProperty("refreshTime")) + object.refreshTime = $root.google.protobuf.Timestamp.toObject(message.refreshTime, options); + if (message.state != null && message.hasOwnProperty("state")) + object.state = options.enums === String ? $root.google.cloud.connectors.v1.ConnectionSchemaMetadata.State[message.state] === undefined ? message.state : $root.google.cloud.connectors.v1.ConnectionSchemaMetadata.State[message.state] : message.state; + return object; + }; + + /** + * Converts this ConnectionSchemaMetadata to JSON. + * @function toJSON + * @memberof google.cloud.connectors.v1.ConnectionSchemaMetadata + * @instance + * @returns {Object.} JSON object + */ + ConnectionSchemaMetadata.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ConnectionSchemaMetadata + * @function getTypeUrl + * @memberof google.cloud.connectors.v1.ConnectionSchemaMetadata + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ConnectionSchemaMetadata.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.connectors.v1.ConnectionSchemaMetadata"; + }; + + /** + * State enum. + * @name google.cloud.connectors.v1.ConnectionSchemaMetadata.State + * @enum {number} + * @property {number} STATE_UNSPECIFIED=0 STATE_UNSPECIFIED value + * @property {number} REFRESHING=1 REFRESHING value + * @property {number} UPDATED=2 UPDATED value + */ + ConnectionSchemaMetadata.State = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "STATE_UNSPECIFIED"] = 0; + values[valuesById[1] = "REFRESHING"] = 1; + values[valuesById[2] = "UPDATED"] = 2; + return values; + })(); + + return ConnectionSchemaMetadata; + })(); + + v1.RuntimeEntitySchema = (function() { + + /** + * Properties of a RuntimeEntitySchema. + * @memberof google.cloud.connectors.v1 + * @interface IRuntimeEntitySchema + * @property {string|null} [entity] RuntimeEntitySchema entity + * @property {Array.|null} [fields] RuntimeEntitySchema fields + */ + + /** + * Constructs a new RuntimeEntitySchema. + * @memberof google.cloud.connectors.v1 + * @classdesc Represents a RuntimeEntitySchema. + * @implements IRuntimeEntitySchema + * @constructor + * @param {google.cloud.connectors.v1.IRuntimeEntitySchema=} [properties] Properties to set + */ + function RuntimeEntitySchema(properties) { + this.fields = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * RuntimeEntitySchema entity. + * @member {string} entity + * @memberof google.cloud.connectors.v1.RuntimeEntitySchema + * @instance + */ + RuntimeEntitySchema.prototype.entity = ""; + + /** + * RuntimeEntitySchema fields. + * @member {Array.} fields + * @memberof google.cloud.connectors.v1.RuntimeEntitySchema + * @instance + */ + RuntimeEntitySchema.prototype.fields = $util.emptyArray; + + /** + * Creates a new RuntimeEntitySchema instance using the specified properties. + * @function create + * @memberof google.cloud.connectors.v1.RuntimeEntitySchema + * @static + * @param {google.cloud.connectors.v1.IRuntimeEntitySchema=} [properties] Properties to set + * @returns {google.cloud.connectors.v1.RuntimeEntitySchema} RuntimeEntitySchema instance + */ + RuntimeEntitySchema.create = function create(properties) { + return new RuntimeEntitySchema(properties); + }; + + /** + * Encodes the specified RuntimeEntitySchema message. Does not implicitly {@link google.cloud.connectors.v1.RuntimeEntitySchema.verify|verify} messages. + * @function encode + * @memberof google.cloud.connectors.v1.RuntimeEntitySchema + * @static + * @param {google.cloud.connectors.v1.IRuntimeEntitySchema} message RuntimeEntitySchema message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RuntimeEntitySchema.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.entity != null && Object.hasOwnProperty.call(message, "entity")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.entity); + if (message.fields != null && message.fields.length) + for (var i = 0; i < message.fields.length; ++i) + $root.google.cloud.connectors.v1.RuntimeEntitySchema.Field.encode(message.fields[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified RuntimeEntitySchema message, length delimited. Does not implicitly {@link google.cloud.connectors.v1.RuntimeEntitySchema.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.connectors.v1.RuntimeEntitySchema + * @static + * @param {google.cloud.connectors.v1.IRuntimeEntitySchema} message RuntimeEntitySchema message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RuntimeEntitySchema.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a RuntimeEntitySchema message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.connectors.v1.RuntimeEntitySchema + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.connectors.v1.RuntimeEntitySchema} RuntimeEntitySchema + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RuntimeEntitySchema.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.connectors.v1.RuntimeEntitySchema(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.entity = reader.string(); + break; + } + case 2: { + if (!(message.fields && message.fields.length)) + message.fields = []; + message.fields.push($root.google.cloud.connectors.v1.RuntimeEntitySchema.Field.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a RuntimeEntitySchema message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.connectors.v1.RuntimeEntitySchema + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.connectors.v1.RuntimeEntitySchema} RuntimeEntitySchema + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RuntimeEntitySchema.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a RuntimeEntitySchema message. + * @function verify + * @memberof google.cloud.connectors.v1.RuntimeEntitySchema + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + RuntimeEntitySchema.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.entity != null && message.hasOwnProperty("entity")) + if (!$util.isString(message.entity)) + return "entity: string expected"; + if (message.fields != null && message.hasOwnProperty("fields")) { + if (!Array.isArray(message.fields)) + return "fields: array expected"; + for (var i = 0; i < message.fields.length; ++i) { + var error = $root.google.cloud.connectors.v1.RuntimeEntitySchema.Field.verify(message.fields[i]); + if (error) + return "fields." + error; + } + } + return null; + }; + + /** + * Creates a RuntimeEntitySchema message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.connectors.v1.RuntimeEntitySchema + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.connectors.v1.RuntimeEntitySchema} RuntimeEntitySchema + */ + RuntimeEntitySchema.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.connectors.v1.RuntimeEntitySchema) + return object; + var message = new $root.google.cloud.connectors.v1.RuntimeEntitySchema(); + if (object.entity != null) + message.entity = String(object.entity); + if (object.fields) { + if (!Array.isArray(object.fields)) + throw TypeError(".google.cloud.connectors.v1.RuntimeEntitySchema.fields: array expected"); + message.fields = []; + for (var i = 0; i < object.fields.length; ++i) { + if (typeof object.fields[i] !== "object") + throw TypeError(".google.cloud.connectors.v1.RuntimeEntitySchema.fields: object expected"); + message.fields[i] = $root.google.cloud.connectors.v1.RuntimeEntitySchema.Field.fromObject(object.fields[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a RuntimeEntitySchema message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.connectors.v1.RuntimeEntitySchema + * @static + * @param {google.cloud.connectors.v1.RuntimeEntitySchema} message RuntimeEntitySchema + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + RuntimeEntitySchema.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.fields = []; + if (options.defaults) + object.entity = ""; + if (message.entity != null && message.hasOwnProperty("entity")) + object.entity = message.entity; + if (message.fields && message.fields.length) { + object.fields = []; + for (var j = 0; j < message.fields.length; ++j) + object.fields[j] = $root.google.cloud.connectors.v1.RuntimeEntitySchema.Field.toObject(message.fields[j], options); + } + return object; + }; + + /** + * Converts this RuntimeEntitySchema to JSON. + * @function toJSON + * @memberof google.cloud.connectors.v1.RuntimeEntitySchema + * @instance + * @returns {Object.} JSON object + */ + RuntimeEntitySchema.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for RuntimeEntitySchema + * @function getTypeUrl + * @memberof google.cloud.connectors.v1.RuntimeEntitySchema + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + RuntimeEntitySchema.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.connectors.v1.RuntimeEntitySchema"; + }; + + RuntimeEntitySchema.Field = (function() { + + /** + * Properties of a Field. + * @memberof google.cloud.connectors.v1.RuntimeEntitySchema + * @interface IField + * @property {string|null} [field] Field field + * @property {string|null} [description] Field description + * @property {google.cloud.connectors.v1.DataType|null} [dataType] Field dataType + * @property {boolean|null} [key] Field key + * @property {boolean|null} [readonly] Field readonly + * @property {boolean|null} [nullable] Field nullable + * @property {google.protobuf.IValue|null} [defaultValue] Field defaultValue + * @property {google.protobuf.IStruct|null} [additionalDetails] Field additionalDetails + */ + + /** + * Constructs a new Field. + * @memberof google.cloud.connectors.v1.RuntimeEntitySchema + * @classdesc Represents a Field. + * @implements IField + * @constructor + * @param {google.cloud.connectors.v1.RuntimeEntitySchema.IField=} [properties] Properties to set + */ + function Field(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Field field. + * @member {string} field + * @memberof google.cloud.connectors.v1.RuntimeEntitySchema.Field + * @instance + */ + Field.prototype.field = ""; + + /** + * Field description. + * @member {string} description + * @memberof google.cloud.connectors.v1.RuntimeEntitySchema.Field + * @instance + */ + Field.prototype.description = ""; + + /** + * Field dataType. + * @member {google.cloud.connectors.v1.DataType} dataType + * @memberof google.cloud.connectors.v1.RuntimeEntitySchema.Field + * @instance + */ + Field.prototype.dataType = 0; + + /** + * Field key. + * @member {boolean} key + * @memberof google.cloud.connectors.v1.RuntimeEntitySchema.Field + * @instance + */ + Field.prototype.key = false; + + /** + * Field readonly. + * @member {boolean} readonly + * @memberof google.cloud.connectors.v1.RuntimeEntitySchema.Field + * @instance + */ + Field.prototype.readonly = false; + + /** + * Field nullable. + * @member {boolean} nullable + * @memberof google.cloud.connectors.v1.RuntimeEntitySchema.Field + * @instance + */ + Field.prototype.nullable = false; + + /** + * Field defaultValue. + * @member {google.protobuf.IValue|null|undefined} defaultValue + * @memberof google.cloud.connectors.v1.RuntimeEntitySchema.Field + * @instance + */ + Field.prototype.defaultValue = null; + + /** + * Field additionalDetails. + * @member {google.protobuf.IStruct|null|undefined} additionalDetails + * @memberof google.cloud.connectors.v1.RuntimeEntitySchema.Field + * @instance + */ + Field.prototype.additionalDetails = null; + + /** + * Creates a new Field instance using the specified properties. + * @function create + * @memberof google.cloud.connectors.v1.RuntimeEntitySchema.Field + * @static + * @param {google.cloud.connectors.v1.RuntimeEntitySchema.IField=} [properties] Properties to set + * @returns {google.cloud.connectors.v1.RuntimeEntitySchema.Field} Field instance + */ + Field.create = function create(properties) { + return new Field(properties); + }; + + /** + * Encodes the specified Field message. Does not implicitly {@link google.cloud.connectors.v1.RuntimeEntitySchema.Field.verify|verify} messages. + * @function encode + * @memberof google.cloud.connectors.v1.RuntimeEntitySchema.Field + * @static + * @param {google.cloud.connectors.v1.RuntimeEntitySchema.IField} message Field message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Field.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.field != null && Object.hasOwnProperty.call(message, "field")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.field); + if (message.description != null && Object.hasOwnProperty.call(message, "description")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.description); + if (message.dataType != null && Object.hasOwnProperty.call(message, "dataType")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.dataType); + if (message.key != null && Object.hasOwnProperty.call(message, "key")) + writer.uint32(/* id 4, wireType 0 =*/32).bool(message.key); + if (message.readonly != null && Object.hasOwnProperty.call(message, "readonly")) + writer.uint32(/* id 5, wireType 0 =*/40).bool(message.readonly); + if (message.nullable != null && Object.hasOwnProperty.call(message, "nullable")) + writer.uint32(/* id 6, wireType 0 =*/48).bool(message.nullable); + if (message.defaultValue != null && Object.hasOwnProperty.call(message, "defaultValue")) + $root.google.protobuf.Value.encode(message.defaultValue, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + if (message.additionalDetails != null && Object.hasOwnProperty.call(message, "additionalDetails")) + $root.google.protobuf.Struct.encode(message.additionalDetails, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified Field message, length delimited. Does not implicitly {@link google.cloud.connectors.v1.RuntimeEntitySchema.Field.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.connectors.v1.RuntimeEntitySchema.Field + * @static + * @param {google.cloud.connectors.v1.RuntimeEntitySchema.IField} message Field message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Field.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Field message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.connectors.v1.RuntimeEntitySchema.Field + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.connectors.v1.RuntimeEntitySchema.Field} Field + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Field.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.connectors.v1.RuntimeEntitySchema.Field(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.field = reader.string(); + break; + } + case 2: { + message.description = reader.string(); + break; + } + case 3: { + message.dataType = reader.int32(); + break; + } + case 4: { + message.key = reader.bool(); + break; + } + case 5: { + message.readonly = reader.bool(); + break; + } + case 6: { + message.nullable = reader.bool(); + break; + } + case 7: { + message.defaultValue = $root.google.protobuf.Value.decode(reader, reader.uint32()); + break; + } + case 8: { + message.additionalDetails = $root.google.protobuf.Struct.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Field message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.connectors.v1.RuntimeEntitySchema.Field + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.connectors.v1.RuntimeEntitySchema.Field} Field + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Field.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Field message. + * @function verify + * @memberof google.cloud.connectors.v1.RuntimeEntitySchema.Field + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Field.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.field != null && message.hasOwnProperty("field")) + if (!$util.isString(message.field)) + return "field: string expected"; + if (message.description != null && message.hasOwnProperty("description")) + if (!$util.isString(message.description)) + return "description: string expected"; + if (message.dataType != null && message.hasOwnProperty("dataType")) + switch (message.dataType) { + default: + return "dataType: 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: + case 13: + case 14: + case 15: + case 16: + case 17: + case 18: + case 19: + case 20: + case 21: + case 22: + case 23: + case 24: + case 25: + case 26: + case 27: + case 28: + case 29: + case 30: + case 31: + case 32: + case 33: + case 34: + case 35: + case 36: + case 37: + case 38: + case 39: + case 40: + case 41: + case 42: + case 43: + case 44: + break; + } + if (message.key != null && message.hasOwnProperty("key")) + if (typeof message.key !== "boolean") + return "key: boolean expected"; + if (message.readonly != null && message.hasOwnProperty("readonly")) + if (typeof message.readonly !== "boolean") + return "readonly: boolean expected"; + if (message.nullable != null && message.hasOwnProperty("nullable")) + if (typeof message.nullable !== "boolean") + return "nullable: boolean expected"; + if (message.defaultValue != null && message.hasOwnProperty("defaultValue")) { + var error = $root.google.protobuf.Value.verify(message.defaultValue); + if (error) + return "defaultValue." + error; + } + if (message.additionalDetails != null && message.hasOwnProperty("additionalDetails")) { + var error = $root.google.protobuf.Struct.verify(message.additionalDetails); + if (error) + return "additionalDetails." + error; + } + return null; + }; + + /** + * Creates a Field message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.connectors.v1.RuntimeEntitySchema.Field + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.connectors.v1.RuntimeEntitySchema.Field} Field + */ + Field.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.connectors.v1.RuntimeEntitySchema.Field) + return object; + var message = new $root.google.cloud.connectors.v1.RuntimeEntitySchema.Field(); + if (object.field != null) + message.field = String(object.field); + if (object.description != null) + message.description = String(object.description); + switch (object.dataType) { + default: + if (typeof object.dataType === "number") { + message.dataType = object.dataType; + break; + } + break; + case "DATA_TYPE_UNSPECIFIED": + case 0: + message.dataType = 0; + break; + case "DATA_TYPE_INT": + case 1: + message.dataType = 1; + break; + case "DATA_TYPE_SMALLINT": + case 2: + message.dataType = 2; + break; + case "DATA_TYPE_DOUBLE": + case 3: + message.dataType = 3; + break; + case "DATA_TYPE_DATE": + case 4: + message.dataType = 4; + break; + case "DATA_TYPE_DATETIME": + case 5: + message.dataType = 5; + break; + case "DATA_TYPE_TIME": + case 6: + message.dataType = 6; + break; + case "DATA_TYPE_STRING": + case 7: + message.dataType = 7; + break; + case "DATA_TYPE_LONG": + case 8: + message.dataType = 8; + break; + case "DATA_TYPE_BOOLEAN": + case 9: + message.dataType = 9; + break; + case "DATA_TYPE_DECIMAL": + case 10: + message.dataType = 10; + break; + case "DATA_TYPE_UUID": + case 11: + message.dataType = 11; + break; + case "DATA_TYPE_BLOB": + case 12: + message.dataType = 12; + break; + case "DATA_TYPE_BIT": + case 13: + message.dataType = 13; + break; + case "DATA_TYPE_TINYINT": + case 14: + message.dataType = 14; + break; + case "DATA_TYPE_INTEGER": + case 15: + message.dataType = 15; + break; + case "DATA_TYPE_BIGINT": + case 16: + message.dataType = 16; + break; + case "DATA_TYPE_FLOAT": + case 17: + message.dataType = 17; + break; + case "DATA_TYPE_REAL": + case 18: + message.dataType = 18; + break; + case "DATA_TYPE_NUMERIC": + case 19: + message.dataType = 19; + break; + case "DATA_TYPE_CHAR": + case 20: + message.dataType = 20; + break; + case "DATA_TYPE_VARCHAR": + case 21: + message.dataType = 21; + break; + case "DATA_TYPE_LONGVARCHAR": + case 22: + message.dataType = 22; + break; + case "DATA_TYPE_TIMESTAMP": + case 23: + message.dataType = 23; + break; + case "DATA_TYPE_NCHAR": + case 24: + message.dataType = 24; + break; + case "DATA_TYPE_NVARCHAR": + case 25: + message.dataType = 25; + break; + case "DATA_TYPE_LONGNVARCHAR": + case 26: + message.dataType = 26; + break; + case "DATA_TYPE_NULL": + case 27: + message.dataType = 27; + break; + case "DATA_TYPE_OTHER": + case 28: + message.dataType = 28; + break; + case "DATA_TYPE_JAVA_OBJECT": + case 29: + message.dataType = 29; + break; + case "DATA_TYPE_DISTINCT": + case 30: + message.dataType = 30; + break; + case "DATA_TYPE_STRUCT": + case 31: + message.dataType = 31; + break; + case "DATA_TYPE_ARRAY": + case 32: + message.dataType = 32; + break; + case "DATA_TYPE_CLOB": + case 33: + message.dataType = 33; + break; + case "DATA_TYPE_REF": + case 34: + message.dataType = 34; + break; + case "DATA_TYPE_DATALINK": + case 35: + message.dataType = 35; + break; + case "DATA_TYPE_ROWID": + case 36: + message.dataType = 36; + break; + case "DATA_TYPE_BINARY": + case 37: + message.dataType = 37; + break; + case "DATA_TYPE_VARBINARY": + case 38: + message.dataType = 38; + break; + case "DATA_TYPE_LONGVARBINARY": + case 39: + message.dataType = 39; + break; + case "DATA_TYPE_NCLOB": + case 40: + message.dataType = 40; + break; + case "DATA_TYPE_SQLXML": + case 41: + message.dataType = 41; + break; + case "DATA_TYPE_REF_CURSOR": + case 42: + message.dataType = 42; + break; + case "DATA_TYPE_TIME_WITH_TIMEZONE": + case 43: + message.dataType = 43; + break; + case "DATA_TYPE_TIMESTAMP_WITH_TIMEZONE": + case 44: + message.dataType = 44; + break; + } + if (object.key != null) + message.key = Boolean(object.key); + if (object.readonly != null) + message.readonly = Boolean(object.readonly); + if (object.nullable != null) + message.nullable = Boolean(object.nullable); + if (object.defaultValue != null) { + if (typeof object.defaultValue !== "object") + throw TypeError(".google.cloud.connectors.v1.RuntimeEntitySchema.Field.defaultValue: object expected"); + message.defaultValue = $root.google.protobuf.Value.fromObject(object.defaultValue); + } + if (object.additionalDetails != null) { + if (typeof object.additionalDetails !== "object") + throw TypeError(".google.cloud.connectors.v1.RuntimeEntitySchema.Field.additionalDetails: object expected"); + message.additionalDetails = $root.google.protobuf.Struct.fromObject(object.additionalDetails); + } + return message; + }; + + /** + * Creates a plain object from a Field message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.connectors.v1.RuntimeEntitySchema.Field + * @static + * @param {google.cloud.connectors.v1.RuntimeEntitySchema.Field} message Field + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Field.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.field = ""; + object.description = ""; + object.dataType = options.enums === String ? "DATA_TYPE_UNSPECIFIED" : 0; + object.key = false; + object.readonly = false; + object.nullable = false; + object.defaultValue = null; + object.additionalDetails = null; + } + if (message.field != null && message.hasOwnProperty("field")) + object.field = message.field; + if (message.description != null && message.hasOwnProperty("description")) + object.description = message.description; + if (message.dataType != null && message.hasOwnProperty("dataType")) + object.dataType = options.enums === String ? $root.google.cloud.connectors.v1.DataType[message.dataType] === undefined ? message.dataType : $root.google.cloud.connectors.v1.DataType[message.dataType] : message.dataType; + if (message.key != null && message.hasOwnProperty("key")) + object.key = message.key; + if (message.readonly != null && message.hasOwnProperty("readonly")) + object.readonly = message.readonly; + if (message.nullable != null && message.hasOwnProperty("nullable")) + object.nullable = message.nullable; + if (message.defaultValue != null && message.hasOwnProperty("defaultValue")) + object.defaultValue = $root.google.protobuf.Value.toObject(message.defaultValue, options); + if (message.additionalDetails != null && message.hasOwnProperty("additionalDetails")) + object.additionalDetails = $root.google.protobuf.Struct.toObject(message.additionalDetails, options); + return object; + }; + + /** + * Converts this Field to JSON. + * @function toJSON + * @memberof google.cloud.connectors.v1.RuntimeEntitySchema.Field + * @instance + * @returns {Object.} JSON object + */ + Field.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Field + * @function getTypeUrl + * @memberof google.cloud.connectors.v1.RuntimeEntitySchema.Field + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Field.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.connectors.v1.RuntimeEntitySchema.Field"; + }; + + return Field; + })(); + + return RuntimeEntitySchema; + })(); + + v1.RuntimeActionSchema = (function() { + + /** + * Properties of a RuntimeActionSchema. + * @memberof google.cloud.connectors.v1 + * @interface IRuntimeActionSchema + * @property {string|null} [action] RuntimeActionSchema action + * @property {Array.|null} [inputParameters] RuntimeActionSchema inputParameters + * @property {Array.|null} [resultMetadata] RuntimeActionSchema resultMetadata + */ + + /** + * Constructs a new RuntimeActionSchema. + * @memberof google.cloud.connectors.v1 + * @classdesc Represents a RuntimeActionSchema. + * @implements IRuntimeActionSchema + * @constructor + * @param {google.cloud.connectors.v1.IRuntimeActionSchema=} [properties] Properties to set + */ + function RuntimeActionSchema(properties) { + this.inputParameters = []; + this.resultMetadata = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * RuntimeActionSchema action. + * @member {string} action + * @memberof google.cloud.connectors.v1.RuntimeActionSchema + * @instance + */ + RuntimeActionSchema.prototype.action = ""; + + /** + * RuntimeActionSchema inputParameters. + * @member {Array.} inputParameters + * @memberof google.cloud.connectors.v1.RuntimeActionSchema + * @instance + */ + RuntimeActionSchema.prototype.inputParameters = $util.emptyArray; + + /** + * RuntimeActionSchema resultMetadata. + * @member {Array.} resultMetadata + * @memberof google.cloud.connectors.v1.RuntimeActionSchema + * @instance + */ + RuntimeActionSchema.prototype.resultMetadata = $util.emptyArray; + + /** + * Creates a new RuntimeActionSchema instance using the specified properties. + * @function create + * @memberof google.cloud.connectors.v1.RuntimeActionSchema + * @static + * @param {google.cloud.connectors.v1.IRuntimeActionSchema=} [properties] Properties to set + * @returns {google.cloud.connectors.v1.RuntimeActionSchema} RuntimeActionSchema instance + */ + RuntimeActionSchema.create = function create(properties) { + return new RuntimeActionSchema(properties); + }; + + /** + * Encodes the specified RuntimeActionSchema message. Does not implicitly {@link google.cloud.connectors.v1.RuntimeActionSchema.verify|verify} messages. + * @function encode + * @memberof google.cloud.connectors.v1.RuntimeActionSchema + * @static + * @param {google.cloud.connectors.v1.IRuntimeActionSchema} message RuntimeActionSchema message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RuntimeActionSchema.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.action != null && Object.hasOwnProperty.call(message, "action")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.action); + if (message.inputParameters != null && message.inputParameters.length) + for (var i = 0; i < message.inputParameters.length; ++i) + $root.google.cloud.connectors.v1.RuntimeActionSchema.InputParameter.encode(message.inputParameters[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.resultMetadata != null && message.resultMetadata.length) + for (var i = 0; i < message.resultMetadata.length; ++i) + $root.google.cloud.connectors.v1.RuntimeActionSchema.ResultMetadata.encode(message.resultMetadata[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified RuntimeActionSchema message, length delimited. Does not implicitly {@link google.cloud.connectors.v1.RuntimeActionSchema.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.connectors.v1.RuntimeActionSchema + * @static + * @param {google.cloud.connectors.v1.IRuntimeActionSchema} message RuntimeActionSchema message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RuntimeActionSchema.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a RuntimeActionSchema message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.connectors.v1.RuntimeActionSchema + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.connectors.v1.RuntimeActionSchema} RuntimeActionSchema + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RuntimeActionSchema.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.connectors.v1.RuntimeActionSchema(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.action = reader.string(); + break; + } + case 2: { + if (!(message.inputParameters && message.inputParameters.length)) + message.inputParameters = []; + message.inputParameters.push($root.google.cloud.connectors.v1.RuntimeActionSchema.InputParameter.decode(reader, reader.uint32())); + break; + } + case 3: { + if (!(message.resultMetadata && message.resultMetadata.length)) + message.resultMetadata = []; + message.resultMetadata.push($root.google.cloud.connectors.v1.RuntimeActionSchema.ResultMetadata.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a RuntimeActionSchema message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.connectors.v1.RuntimeActionSchema + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.connectors.v1.RuntimeActionSchema} RuntimeActionSchema + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RuntimeActionSchema.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a RuntimeActionSchema message. + * @function verify + * @memberof google.cloud.connectors.v1.RuntimeActionSchema + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + RuntimeActionSchema.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.action != null && message.hasOwnProperty("action")) + if (!$util.isString(message.action)) + return "action: string expected"; + if (message.inputParameters != null && message.hasOwnProperty("inputParameters")) { + if (!Array.isArray(message.inputParameters)) + return "inputParameters: array expected"; + for (var i = 0; i < message.inputParameters.length; ++i) { + var error = $root.google.cloud.connectors.v1.RuntimeActionSchema.InputParameter.verify(message.inputParameters[i]); + if (error) + return "inputParameters." + error; + } + } + if (message.resultMetadata != null && message.hasOwnProperty("resultMetadata")) { + if (!Array.isArray(message.resultMetadata)) + return "resultMetadata: array expected"; + for (var i = 0; i < message.resultMetadata.length; ++i) { + var error = $root.google.cloud.connectors.v1.RuntimeActionSchema.ResultMetadata.verify(message.resultMetadata[i]); + if (error) + return "resultMetadata." + error; + } + } + return null; + }; + + /** + * Creates a RuntimeActionSchema message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.connectors.v1.RuntimeActionSchema + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.connectors.v1.RuntimeActionSchema} RuntimeActionSchema + */ + RuntimeActionSchema.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.connectors.v1.RuntimeActionSchema) + return object; + var message = new $root.google.cloud.connectors.v1.RuntimeActionSchema(); + if (object.action != null) + message.action = String(object.action); + if (object.inputParameters) { + if (!Array.isArray(object.inputParameters)) + throw TypeError(".google.cloud.connectors.v1.RuntimeActionSchema.inputParameters: array expected"); + message.inputParameters = []; + for (var i = 0; i < object.inputParameters.length; ++i) { + if (typeof object.inputParameters[i] !== "object") + throw TypeError(".google.cloud.connectors.v1.RuntimeActionSchema.inputParameters: object expected"); + message.inputParameters[i] = $root.google.cloud.connectors.v1.RuntimeActionSchema.InputParameter.fromObject(object.inputParameters[i]); + } + } + if (object.resultMetadata) { + if (!Array.isArray(object.resultMetadata)) + throw TypeError(".google.cloud.connectors.v1.RuntimeActionSchema.resultMetadata: array expected"); + message.resultMetadata = []; + for (var i = 0; i < object.resultMetadata.length; ++i) { + if (typeof object.resultMetadata[i] !== "object") + throw TypeError(".google.cloud.connectors.v1.RuntimeActionSchema.resultMetadata: object expected"); + message.resultMetadata[i] = $root.google.cloud.connectors.v1.RuntimeActionSchema.ResultMetadata.fromObject(object.resultMetadata[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a RuntimeActionSchema message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.connectors.v1.RuntimeActionSchema + * @static + * @param {google.cloud.connectors.v1.RuntimeActionSchema} message RuntimeActionSchema + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + RuntimeActionSchema.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.inputParameters = []; + object.resultMetadata = []; + } + if (options.defaults) + object.action = ""; + if (message.action != null && message.hasOwnProperty("action")) + object.action = message.action; + if (message.inputParameters && message.inputParameters.length) { + object.inputParameters = []; + for (var j = 0; j < message.inputParameters.length; ++j) + object.inputParameters[j] = $root.google.cloud.connectors.v1.RuntimeActionSchema.InputParameter.toObject(message.inputParameters[j], options); + } + if (message.resultMetadata && message.resultMetadata.length) { + object.resultMetadata = []; + for (var j = 0; j < message.resultMetadata.length; ++j) + object.resultMetadata[j] = $root.google.cloud.connectors.v1.RuntimeActionSchema.ResultMetadata.toObject(message.resultMetadata[j], options); + } + return object; + }; + + /** + * Converts this RuntimeActionSchema to JSON. + * @function toJSON + * @memberof google.cloud.connectors.v1.RuntimeActionSchema + * @instance + * @returns {Object.} JSON object + */ + RuntimeActionSchema.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for RuntimeActionSchema + * @function getTypeUrl + * @memberof google.cloud.connectors.v1.RuntimeActionSchema + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + RuntimeActionSchema.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.connectors.v1.RuntimeActionSchema"; + }; + + RuntimeActionSchema.InputParameter = (function() { + + /** + * Properties of an InputParameter. + * @memberof google.cloud.connectors.v1.RuntimeActionSchema + * @interface IInputParameter + * @property {string|null} [parameter] InputParameter parameter + * @property {string|null} [description] InputParameter description + * @property {google.cloud.connectors.v1.DataType|null} [dataType] InputParameter dataType + * @property {boolean|null} [nullable] InputParameter nullable + * @property {google.protobuf.IValue|null} [defaultValue] InputParameter defaultValue + */ + + /** + * Constructs a new InputParameter. + * @memberof google.cloud.connectors.v1.RuntimeActionSchema + * @classdesc Represents an InputParameter. + * @implements IInputParameter + * @constructor + * @param {google.cloud.connectors.v1.RuntimeActionSchema.IInputParameter=} [properties] Properties to set + */ + function InputParameter(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * InputParameter parameter. + * @member {string} parameter + * @memberof google.cloud.connectors.v1.RuntimeActionSchema.InputParameter + * @instance + */ + InputParameter.prototype.parameter = ""; + + /** + * InputParameter description. + * @member {string} description + * @memberof google.cloud.connectors.v1.RuntimeActionSchema.InputParameter + * @instance + */ + InputParameter.prototype.description = ""; + + /** + * InputParameter dataType. + * @member {google.cloud.connectors.v1.DataType} dataType + * @memberof google.cloud.connectors.v1.RuntimeActionSchema.InputParameter + * @instance + */ + InputParameter.prototype.dataType = 0; + + /** + * InputParameter nullable. + * @member {boolean} nullable + * @memberof google.cloud.connectors.v1.RuntimeActionSchema.InputParameter + * @instance + */ + InputParameter.prototype.nullable = false; + + /** + * InputParameter defaultValue. + * @member {google.protobuf.IValue|null|undefined} defaultValue + * @memberof google.cloud.connectors.v1.RuntimeActionSchema.InputParameter + * @instance + */ + InputParameter.prototype.defaultValue = null; + + /** + * Creates a new InputParameter instance using the specified properties. + * @function create + * @memberof google.cloud.connectors.v1.RuntimeActionSchema.InputParameter + * @static + * @param {google.cloud.connectors.v1.RuntimeActionSchema.IInputParameter=} [properties] Properties to set + * @returns {google.cloud.connectors.v1.RuntimeActionSchema.InputParameter} InputParameter instance + */ + InputParameter.create = function create(properties) { + return new InputParameter(properties); + }; + + /** + * Encodes the specified InputParameter message. Does not implicitly {@link google.cloud.connectors.v1.RuntimeActionSchema.InputParameter.verify|verify} messages. + * @function encode + * @memberof google.cloud.connectors.v1.RuntimeActionSchema.InputParameter + * @static + * @param {google.cloud.connectors.v1.RuntimeActionSchema.IInputParameter} message InputParameter message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + InputParameter.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.parameter != null && Object.hasOwnProperty.call(message, "parameter")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.parameter); + if (message.description != null && Object.hasOwnProperty.call(message, "description")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.description); + if (message.dataType != null && Object.hasOwnProperty.call(message, "dataType")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.dataType); + if (message.nullable != null && Object.hasOwnProperty.call(message, "nullable")) + writer.uint32(/* id 4, wireType 0 =*/32).bool(message.nullable); + if (message.defaultValue != null && Object.hasOwnProperty.call(message, "defaultValue")) + $root.google.protobuf.Value.encode(message.defaultValue, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified InputParameter message, length delimited. Does not implicitly {@link google.cloud.connectors.v1.RuntimeActionSchema.InputParameter.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.connectors.v1.RuntimeActionSchema.InputParameter + * @static + * @param {google.cloud.connectors.v1.RuntimeActionSchema.IInputParameter} message InputParameter message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + InputParameter.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an InputParameter message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.connectors.v1.RuntimeActionSchema.InputParameter + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.connectors.v1.RuntimeActionSchema.InputParameter} InputParameter + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + InputParameter.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.connectors.v1.RuntimeActionSchema.InputParameter(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.parameter = reader.string(); + break; + } + case 2: { + message.description = reader.string(); + break; + } + case 3: { + message.dataType = reader.int32(); + break; + } + case 4: { + message.nullable = reader.bool(); + break; + } + case 5: { + message.defaultValue = $root.google.protobuf.Value.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an InputParameter message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.connectors.v1.RuntimeActionSchema.InputParameter + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.connectors.v1.RuntimeActionSchema.InputParameter} InputParameter + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + InputParameter.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an InputParameter message. + * @function verify + * @memberof google.cloud.connectors.v1.RuntimeActionSchema.InputParameter + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + InputParameter.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.parameter != null && message.hasOwnProperty("parameter")) + if (!$util.isString(message.parameter)) + return "parameter: string expected"; + if (message.description != null && message.hasOwnProperty("description")) + if (!$util.isString(message.description)) + return "description: string expected"; + if (message.dataType != null && message.hasOwnProperty("dataType")) + switch (message.dataType) { + default: + return "dataType: 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: + case 13: + case 14: + case 15: + case 16: + case 17: + case 18: + case 19: + case 20: + case 21: + case 22: + case 23: + case 24: + case 25: + case 26: + case 27: + case 28: + case 29: + case 30: + case 31: + case 32: + case 33: + case 34: + case 35: + case 36: + case 37: + case 38: + case 39: + case 40: + case 41: + case 42: + case 43: + case 44: + break; + } + if (message.nullable != null && message.hasOwnProperty("nullable")) + if (typeof message.nullable !== "boolean") + return "nullable: boolean expected"; + if (message.defaultValue != null && message.hasOwnProperty("defaultValue")) { + var error = $root.google.protobuf.Value.verify(message.defaultValue); + if (error) + return "defaultValue." + error; + } + return null; + }; + + /** + * Creates an InputParameter message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.connectors.v1.RuntimeActionSchema.InputParameter + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.connectors.v1.RuntimeActionSchema.InputParameter} InputParameter + */ + InputParameter.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.connectors.v1.RuntimeActionSchema.InputParameter) + return object; + var message = new $root.google.cloud.connectors.v1.RuntimeActionSchema.InputParameter(); + if (object.parameter != null) + message.parameter = String(object.parameter); + if (object.description != null) + message.description = String(object.description); + switch (object.dataType) { + default: + if (typeof object.dataType === "number") { + message.dataType = object.dataType; + break; + } + break; + case "DATA_TYPE_UNSPECIFIED": + case 0: + message.dataType = 0; + break; + case "DATA_TYPE_INT": + case 1: + message.dataType = 1; + break; + case "DATA_TYPE_SMALLINT": + case 2: + message.dataType = 2; + break; + case "DATA_TYPE_DOUBLE": + case 3: + message.dataType = 3; + break; + case "DATA_TYPE_DATE": + case 4: + message.dataType = 4; + break; + case "DATA_TYPE_DATETIME": + case 5: + message.dataType = 5; + break; + case "DATA_TYPE_TIME": + case 6: + message.dataType = 6; + break; + case "DATA_TYPE_STRING": + case 7: + message.dataType = 7; + break; + case "DATA_TYPE_LONG": + case 8: + message.dataType = 8; + break; + case "DATA_TYPE_BOOLEAN": + case 9: + message.dataType = 9; + break; + case "DATA_TYPE_DECIMAL": + case 10: + message.dataType = 10; + break; + case "DATA_TYPE_UUID": + case 11: + message.dataType = 11; + break; + case "DATA_TYPE_BLOB": + case 12: + message.dataType = 12; + break; + case "DATA_TYPE_BIT": + case 13: + message.dataType = 13; + break; + case "DATA_TYPE_TINYINT": + case 14: + message.dataType = 14; + break; + case "DATA_TYPE_INTEGER": + case 15: + message.dataType = 15; + break; + case "DATA_TYPE_BIGINT": + case 16: + message.dataType = 16; + break; + case "DATA_TYPE_FLOAT": + case 17: + message.dataType = 17; + break; + case "DATA_TYPE_REAL": + case 18: + message.dataType = 18; + break; + case "DATA_TYPE_NUMERIC": + case 19: + message.dataType = 19; + break; + case "DATA_TYPE_CHAR": + case 20: + message.dataType = 20; + break; + case "DATA_TYPE_VARCHAR": + case 21: + message.dataType = 21; + break; + case "DATA_TYPE_LONGVARCHAR": + case 22: + message.dataType = 22; + break; + case "DATA_TYPE_TIMESTAMP": + case 23: + message.dataType = 23; + break; + case "DATA_TYPE_NCHAR": + case 24: + message.dataType = 24; + break; + case "DATA_TYPE_NVARCHAR": + case 25: + message.dataType = 25; + break; + case "DATA_TYPE_LONGNVARCHAR": + case 26: + message.dataType = 26; + break; + case "DATA_TYPE_NULL": + case 27: + message.dataType = 27; + break; + case "DATA_TYPE_OTHER": + case 28: + message.dataType = 28; + break; + case "DATA_TYPE_JAVA_OBJECT": + case 29: + message.dataType = 29; + break; + case "DATA_TYPE_DISTINCT": + case 30: + message.dataType = 30; + break; + case "DATA_TYPE_STRUCT": + case 31: + message.dataType = 31; + break; + case "DATA_TYPE_ARRAY": + case 32: + message.dataType = 32; + break; + case "DATA_TYPE_CLOB": + case 33: + message.dataType = 33; + break; + case "DATA_TYPE_REF": + case 34: + message.dataType = 34; + break; + case "DATA_TYPE_DATALINK": + case 35: + message.dataType = 35; + break; + case "DATA_TYPE_ROWID": + case 36: + message.dataType = 36; + break; + case "DATA_TYPE_BINARY": + case 37: + message.dataType = 37; + break; + case "DATA_TYPE_VARBINARY": + case 38: + message.dataType = 38; + break; + case "DATA_TYPE_LONGVARBINARY": + case 39: + message.dataType = 39; + break; + case "DATA_TYPE_NCLOB": + case 40: + message.dataType = 40; + break; + case "DATA_TYPE_SQLXML": + case 41: + message.dataType = 41; + break; + case "DATA_TYPE_REF_CURSOR": + case 42: + message.dataType = 42; + break; + case "DATA_TYPE_TIME_WITH_TIMEZONE": + case 43: + message.dataType = 43; + break; + case "DATA_TYPE_TIMESTAMP_WITH_TIMEZONE": + case 44: + message.dataType = 44; + break; + } + if (object.nullable != null) + message.nullable = Boolean(object.nullable); + if (object.defaultValue != null) { + if (typeof object.defaultValue !== "object") + throw TypeError(".google.cloud.connectors.v1.RuntimeActionSchema.InputParameter.defaultValue: object expected"); + message.defaultValue = $root.google.protobuf.Value.fromObject(object.defaultValue); + } + return message; + }; + + /** + * Creates a plain object from an InputParameter message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.connectors.v1.RuntimeActionSchema.InputParameter + * @static + * @param {google.cloud.connectors.v1.RuntimeActionSchema.InputParameter} message InputParameter + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + InputParameter.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parameter = ""; + object.description = ""; + object.dataType = options.enums === String ? "DATA_TYPE_UNSPECIFIED" : 0; + object.nullable = false; + object.defaultValue = null; + } + if (message.parameter != null && message.hasOwnProperty("parameter")) + object.parameter = message.parameter; + if (message.description != null && message.hasOwnProperty("description")) + object.description = message.description; + if (message.dataType != null && message.hasOwnProperty("dataType")) + object.dataType = options.enums === String ? $root.google.cloud.connectors.v1.DataType[message.dataType] === undefined ? message.dataType : $root.google.cloud.connectors.v1.DataType[message.dataType] : message.dataType; + if (message.nullable != null && message.hasOwnProperty("nullable")) + object.nullable = message.nullable; + if (message.defaultValue != null && message.hasOwnProperty("defaultValue")) + object.defaultValue = $root.google.protobuf.Value.toObject(message.defaultValue, options); + return object; + }; + + /** + * Converts this InputParameter to JSON. + * @function toJSON + * @memberof google.cloud.connectors.v1.RuntimeActionSchema.InputParameter + * @instance + * @returns {Object.} JSON object + */ + InputParameter.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for InputParameter + * @function getTypeUrl + * @memberof google.cloud.connectors.v1.RuntimeActionSchema.InputParameter + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + InputParameter.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.connectors.v1.RuntimeActionSchema.InputParameter"; + }; + + return InputParameter; + })(); + + RuntimeActionSchema.ResultMetadata = (function() { + + /** + * Properties of a ResultMetadata. + * @memberof google.cloud.connectors.v1.RuntimeActionSchema + * @interface IResultMetadata + * @property {string|null} [field] ResultMetadata field + * @property {string|null} [description] ResultMetadata description + * @property {google.cloud.connectors.v1.DataType|null} [dataType] ResultMetadata dataType + */ + + /** + * Constructs a new ResultMetadata. + * @memberof google.cloud.connectors.v1.RuntimeActionSchema + * @classdesc Represents a ResultMetadata. + * @implements IResultMetadata + * @constructor + * @param {google.cloud.connectors.v1.RuntimeActionSchema.IResultMetadata=} [properties] Properties to set + */ + function ResultMetadata(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ResultMetadata field. + * @member {string} field + * @memberof google.cloud.connectors.v1.RuntimeActionSchema.ResultMetadata + * @instance + */ + ResultMetadata.prototype.field = ""; + + /** + * ResultMetadata description. + * @member {string} description + * @memberof google.cloud.connectors.v1.RuntimeActionSchema.ResultMetadata + * @instance + */ + ResultMetadata.prototype.description = ""; + + /** + * ResultMetadata dataType. + * @member {google.cloud.connectors.v1.DataType} dataType + * @memberof google.cloud.connectors.v1.RuntimeActionSchema.ResultMetadata + * @instance + */ + ResultMetadata.prototype.dataType = 0; + + /** + * Creates a new ResultMetadata instance using the specified properties. + * @function create + * @memberof google.cloud.connectors.v1.RuntimeActionSchema.ResultMetadata + * @static + * @param {google.cloud.connectors.v1.RuntimeActionSchema.IResultMetadata=} [properties] Properties to set + * @returns {google.cloud.connectors.v1.RuntimeActionSchema.ResultMetadata} ResultMetadata instance + */ + ResultMetadata.create = function create(properties) { + return new ResultMetadata(properties); + }; + + /** + * Encodes the specified ResultMetadata message. Does not implicitly {@link google.cloud.connectors.v1.RuntimeActionSchema.ResultMetadata.verify|verify} messages. + * @function encode + * @memberof google.cloud.connectors.v1.RuntimeActionSchema.ResultMetadata + * @static + * @param {google.cloud.connectors.v1.RuntimeActionSchema.IResultMetadata} message ResultMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ResultMetadata.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.field != null && Object.hasOwnProperty.call(message, "field")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.field); + if (message.description != null && Object.hasOwnProperty.call(message, "description")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.description); + if (message.dataType != null && Object.hasOwnProperty.call(message, "dataType")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.dataType); + return writer; + }; + + /** + * Encodes the specified ResultMetadata message, length delimited. Does not implicitly {@link google.cloud.connectors.v1.RuntimeActionSchema.ResultMetadata.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.connectors.v1.RuntimeActionSchema.ResultMetadata + * @static + * @param {google.cloud.connectors.v1.RuntimeActionSchema.IResultMetadata} message ResultMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ResultMetadata.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ResultMetadata message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.connectors.v1.RuntimeActionSchema.ResultMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.connectors.v1.RuntimeActionSchema.ResultMetadata} ResultMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ResultMetadata.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.connectors.v1.RuntimeActionSchema.ResultMetadata(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.field = reader.string(); + break; + } + case 2: { + message.description = reader.string(); + break; + } + case 3: { + message.dataType = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ResultMetadata message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.connectors.v1.RuntimeActionSchema.ResultMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.connectors.v1.RuntimeActionSchema.ResultMetadata} ResultMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ResultMetadata.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ResultMetadata message. + * @function verify + * @memberof google.cloud.connectors.v1.RuntimeActionSchema.ResultMetadata + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ResultMetadata.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.field != null && message.hasOwnProperty("field")) + if (!$util.isString(message.field)) + return "field: string expected"; + if (message.description != null && message.hasOwnProperty("description")) + if (!$util.isString(message.description)) + return "description: string expected"; + if (message.dataType != null && message.hasOwnProperty("dataType")) + switch (message.dataType) { + default: + return "dataType: 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: + case 13: + case 14: + case 15: + case 16: + case 17: + case 18: + case 19: + case 20: + case 21: + case 22: + case 23: + case 24: + case 25: + case 26: + case 27: + case 28: + case 29: + case 30: + case 31: + case 32: + case 33: + case 34: + case 35: + case 36: + case 37: + case 38: + case 39: + case 40: + case 41: + case 42: + case 43: + case 44: + break; + } + return null; + }; + + /** + * Creates a ResultMetadata message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.connectors.v1.RuntimeActionSchema.ResultMetadata + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.connectors.v1.RuntimeActionSchema.ResultMetadata} ResultMetadata + */ + ResultMetadata.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.connectors.v1.RuntimeActionSchema.ResultMetadata) + return object; + var message = new $root.google.cloud.connectors.v1.RuntimeActionSchema.ResultMetadata(); + if (object.field != null) + message.field = String(object.field); + if (object.description != null) + message.description = String(object.description); + switch (object.dataType) { + default: + if (typeof object.dataType === "number") { + message.dataType = object.dataType; + break; + } + break; + case "DATA_TYPE_UNSPECIFIED": + case 0: + message.dataType = 0; + break; + case "DATA_TYPE_INT": + case 1: + message.dataType = 1; + break; + case "DATA_TYPE_SMALLINT": + case 2: + message.dataType = 2; + break; + case "DATA_TYPE_DOUBLE": + case 3: + message.dataType = 3; + break; + case "DATA_TYPE_DATE": + case 4: + message.dataType = 4; + break; + case "DATA_TYPE_DATETIME": + case 5: + message.dataType = 5; + break; + case "DATA_TYPE_TIME": + case 6: + message.dataType = 6; + break; + case "DATA_TYPE_STRING": + case 7: + message.dataType = 7; + break; + case "DATA_TYPE_LONG": + case 8: + message.dataType = 8; + break; + case "DATA_TYPE_BOOLEAN": + case 9: + message.dataType = 9; + break; + case "DATA_TYPE_DECIMAL": + case 10: + message.dataType = 10; + break; + case "DATA_TYPE_UUID": + case 11: + message.dataType = 11; + break; + case "DATA_TYPE_BLOB": + case 12: + message.dataType = 12; + break; + case "DATA_TYPE_BIT": + case 13: + message.dataType = 13; + break; + case "DATA_TYPE_TINYINT": + case 14: + message.dataType = 14; + break; + case "DATA_TYPE_INTEGER": + case 15: + message.dataType = 15; + break; + case "DATA_TYPE_BIGINT": + case 16: + message.dataType = 16; + break; + case "DATA_TYPE_FLOAT": + case 17: + message.dataType = 17; + break; + case "DATA_TYPE_REAL": + case 18: + message.dataType = 18; + break; + case "DATA_TYPE_NUMERIC": + case 19: + message.dataType = 19; + break; + case "DATA_TYPE_CHAR": + case 20: + message.dataType = 20; + break; + case "DATA_TYPE_VARCHAR": + case 21: + message.dataType = 21; + break; + case "DATA_TYPE_LONGVARCHAR": + case 22: + message.dataType = 22; + break; + case "DATA_TYPE_TIMESTAMP": + case 23: + message.dataType = 23; + break; + case "DATA_TYPE_NCHAR": + case 24: + message.dataType = 24; + break; + case "DATA_TYPE_NVARCHAR": + case 25: + message.dataType = 25; + break; + case "DATA_TYPE_LONGNVARCHAR": + case 26: + message.dataType = 26; + break; + case "DATA_TYPE_NULL": + case 27: + message.dataType = 27; + break; + case "DATA_TYPE_OTHER": + case 28: + message.dataType = 28; + break; + case "DATA_TYPE_JAVA_OBJECT": + case 29: + message.dataType = 29; + break; + case "DATA_TYPE_DISTINCT": + case 30: + message.dataType = 30; + break; + case "DATA_TYPE_STRUCT": + case 31: + message.dataType = 31; + break; + case "DATA_TYPE_ARRAY": + case 32: + message.dataType = 32; + break; + case "DATA_TYPE_CLOB": + case 33: + message.dataType = 33; + break; + case "DATA_TYPE_REF": + case 34: + message.dataType = 34; + break; + case "DATA_TYPE_DATALINK": + case 35: + message.dataType = 35; + break; + case "DATA_TYPE_ROWID": + case 36: + message.dataType = 36; + break; + case "DATA_TYPE_BINARY": + case 37: + message.dataType = 37; + break; + case "DATA_TYPE_VARBINARY": + case 38: + message.dataType = 38; + break; + case "DATA_TYPE_LONGVARBINARY": + case 39: + message.dataType = 39; + break; + case "DATA_TYPE_NCLOB": + case 40: + message.dataType = 40; + break; + case "DATA_TYPE_SQLXML": + case 41: + message.dataType = 41; + break; + case "DATA_TYPE_REF_CURSOR": + case 42: + message.dataType = 42; + break; + case "DATA_TYPE_TIME_WITH_TIMEZONE": + case 43: + message.dataType = 43; + break; + case "DATA_TYPE_TIMESTAMP_WITH_TIMEZONE": + case 44: + message.dataType = 44; + break; + } + return message; + }; + + /** + * Creates a plain object from a ResultMetadata message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.connectors.v1.RuntimeActionSchema.ResultMetadata + * @static + * @param {google.cloud.connectors.v1.RuntimeActionSchema.ResultMetadata} message ResultMetadata + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ResultMetadata.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.field = ""; + object.description = ""; + object.dataType = options.enums === String ? "DATA_TYPE_UNSPECIFIED" : 0; + } + if (message.field != null && message.hasOwnProperty("field")) + object.field = message.field; + if (message.description != null && message.hasOwnProperty("description")) + object.description = message.description; + if (message.dataType != null && message.hasOwnProperty("dataType")) + object.dataType = options.enums === String ? $root.google.cloud.connectors.v1.DataType[message.dataType] === undefined ? message.dataType : $root.google.cloud.connectors.v1.DataType[message.dataType] : message.dataType; + return object; + }; + + /** + * Converts this ResultMetadata to JSON. + * @function toJSON + * @memberof google.cloud.connectors.v1.RuntimeActionSchema.ResultMetadata + * @instance + * @returns {Object.} JSON object + */ + ResultMetadata.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ResultMetadata + * @function getTypeUrl + * @memberof google.cloud.connectors.v1.RuntimeActionSchema.ResultMetadata + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ResultMetadata.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.connectors.v1.RuntimeActionSchema.ResultMetadata"; + }; + + return ResultMetadata; + })(); + + return RuntimeActionSchema; + })(); + + v1.LockConfig = (function() { + + /** + * Properties of a LockConfig. + * @memberof google.cloud.connectors.v1 + * @interface ILockConfig + * @property {boolean|null} [locked] LockConfig locked + * @property {string|null} [reason] LockConfig reason + */ + + /** + * Constructs a new LockConfig. + * @memberof google.cloud.connectors.v1 + * @classdesc Represents a LockConfig. + * @implements ILockConfig + * @constructor + * @param {google.cloud.connectors.v1.ILockConfig=} [properties] Properties to set + */ + function LockConfig(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * LockConfig locked. + * @member {boolean} locked + * @memberof google.cloud.connectors.v1.LockConfig + * @instance + */ + LockConfig.prototype.locked = false; + + /** + * LockConfig reason. + * @member {string} reason + * @memberof google.cloud.connectors.v1.LockConfig + * @instance + */ + LockConfig.prototype.reason = ""; + + /** + * Creates a new LockConfig instance using the specified properties. + * @function create + * @memberof google.cloud.connectors.v1.LockConfig + * @static + * @param {google.cloud.connectors.v1.ILockConfig=} [properties] Properties to set + * @returns {google.cloud.connectors.v1.LockConfig} LockConfig instance + */ + LockConfig.create = function create(properties) { + return new LockConfig(properties); + }; + + /** + * Encodes the specified LockConfig message. Does not implicitly {@link google.cloud.connectors.v1.LockConfig.verify|verify} messages. + * @function encode + * @memberof google.cloud.connectors.v1.LockConfig + * @static + * @param {google.cloud.connectors.v1.ILockConfig} message LockConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + LockConfig.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.locked != null && Object.hasOwnProperty.call(message, "locked")) + writer.uint32(/* id 1, wireType 0 =*/8).bool(message.locked); + if (message.reason != null && Object.hasOwnProperty.call(message, "reason")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.reason); + return writer; + }; + + /** + * Encodes the specified LockConfig message, length delimited. Does not implicitly {@link google.cloud.connectors.v1.LockConfig.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.connectors.v1.LockConfig + * @static + * @param {google.cloud.connectors.v1.ILockConfig} message LockConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + LockConfig.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a LockConfig message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.connectors.v1.LockConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.connectors.v1.LockConfig} LockConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + LockConfig.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.connectors.v1.LockConfig(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.locked = reader.bool(); + break; + } + case 2: { + message.reason = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a LockConfig message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.connectors.v1.LockConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.connectors.v1.LockConfig} LockConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + LockConfig.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a LockConfig message. + * @function verify + * @memberof google.cloud.connectors.v1.LockConfig + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + LockConfig.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.locked != null && message.hasOwnProperty("locked")) + if (typeof message.locked !== "boolean") + return "locked: boolean expected"; + if (message.reason != null && message.hasOwnProperty("reason")) + if (!$util.isString(message.reason)) + return "reason: string expected"; + return null; + }; + + /** + * Creates a LockConfig message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.connectors.v1.LockConfig + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.connectors.v1.LockConfig} LockConfig + */ + LockConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.connectors.v1.LockConfig) + return object; + var message = new $root.google.cloud.connectors.v1.LockConfig(); + if (object.locked != null) + message.locked = Boolean(object.locked); + if (object.reason != null) + message.reason = String(object.reason); + return message; + }; + + /** + * Creates a plain object from a LockConfig message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.connectors.v1.LockConfig + * @static + * @param {google.cloud.connectors.v1.LockConfig} message LockConfig + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + LockConfig.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.locked = false; + object.reason = ""; + } + if (message.locked != null && message.hasOwnProperty("locked")) + object.locked = message.locked; + if (message.reason != null && message.hasOwnProperty("reason")) + object.reason = message.reason; + return object; + }; + + /** + * Converts this LockConfig to JSON. + * @function toJSON + * @memberof google.cloud.connectors.v1.LockConfig + * @instance + * @returns {Object.} JSON object + */ + LockConfig.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for LockConfig + * @function getTypeUrl + * @memberof google.cloud.connectors.v1.LockConfig + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + LockConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.connectors.v1.LockConfig"; + }; + + return LockConfig; + })(); + + v1.ListConnectionsRequest = (function() { + + /** + * Properties of a ListConnectionsRequest. + * @memberof google.cloud.connectors.v1 + * @interface IListConnectionsRequest + * @property {string|null} [parent] ListConnectionsRequest parent + * @property {number|null} [pageSize] ListConnectionsRequest pageSize + * @property {string|null} [pageToken] ListConnectionsRequest pageToken + * @property {string|null} [filter] ListConnectionsRequest filter + * @property {string|null} [orderBy] ListConnectionsRequest orderBy + * @property {google.cloud.connectors.v1.ConnectionView|null} [view] ListConnectionsRequest view + */ + + /** + * Constructs a new ListConnectionsRequest. + * @memberof google.cloud.connectors.v1 + * @classdesc Represents a ListConnectionsRequest. + * @implements IListConnectionsRequest + * @constructor + * @param {google.cloud.connectors.v1.IListConnectionsRequest=} [properties] Properties to set + */ + function ListConnectionsRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListConnectionsRequest parent. + * @member {string} parent + * @memberof google.cloud.connectors.v1.ListConnectionsRequest + * @instance + */ + ListConnectionsRequest.prototype.parent = ""; + + /** + * ListConnectionsRequest pageSize. + * @member {number} pageSize + * @memberof google.cloud.connectors.v1.ListConnectionsRequest + * @instance + */ + ListConnectionsRequest.prototype.pageSize = 0; + + /** + * ListConnectionsRequest pageToken. + * @member {string} pageToken + * @memberof google.cloud.connectors.v1.ListConnectionsRequest + * @instance + */ + ListConnectionsRequest.prototype.pageToken = ""; + + /** + * ListConnectionsRequest filter. + * @member {string} filter + * @memberof google.cloud.connectors.v1.ListConnectionsRequest + * @instance + */ + ListConnectionsRequest.prototype.filter = ""; + + /** + * ListConnectionsRequest orderBy. + * @member {string} orderBy + * @memberof google.cloud.connectors.v1.ListConnectionsRequest + * @instance + */ + ListConnectionsRequest.prototype.orderBy = ""; + + /** + * ListConnectionsRequest view. + * @member {google.cloud.connectors.v1.ConnectionView} view + * @memberof google.cloud.connectors.v1.ListConnectionsRequest + * @instance + */ + ListConnectionsRequest.prototype.view = 0; + + /** + * Creates a new ListConnectionsRequest instance using the specified properties. + * @function create + * @memberof google.cloud.connectors.v1.ListConnectionsRequest + * @static + * @param {google.cloud.connectors.v1.IListConnectionsRequest=} [properties] Properties to set + * @returns {google.cloud.connectors.v1.ListConnectionsRequest} ListConnectionsRequest instance + */ + ListConnectionsRequest.create = function create(properties) { + return new ListConnectionsRequest(properties); + }; + + /** + * Encodes the specified ListConnectionsRequest message. Does not implicitly {@link google.cloud.connectors.v1.ListConnectionsRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.connectors.v1.ListConnectionsRequest + * @static + * @param {google.cloud.connectors.v1.IListConnectionsRequest} message ListConnectionsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListConnectionsRequest.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.filter != null && Object.hasOwnProperty.call(message, "filter")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.filter); + if (message.orderBy != null && Object.hasOwnProperty.call(message, "orderBy")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.orderBy); + if (message.view != null && Object.hasOwnProperty.call(message, "view")) + writer.uint32(/* id 6, wireType 0 =*/48).int32(message.view); + return writer; + }; + + /** + * Encodes the specified ListConnectionsRequest message, length delimited. Does not implicitly {@link google.cloud.connectors.v1.ListConnectionsRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.connectors.v1.ListConnectionsRequest + * @static + * @param {google.cloud.connectors.v1.IListConnectionsRequest} message ListConnectionsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListConnectionsRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListConnectionsRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.connectors.v1.ListConnectionsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.connectors.v1.ListConnectionsRequest} ListConnectionsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListConnectionsRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.connectors.v1.ListConnectionsRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + 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.filter = reader.string(); + break; + } + case 5: { + message.orderBy = reader.string(); + break; + } + case 6: { + message.view = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListConnectionsRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.connectors.v1.ListConnectionsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.connectors.v1.ListConnectionsRequest} ListConnectionsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListConnectionsRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListConnectionsRequest message. + * @function verify + * @memberof google.cloud.connectors.v1.ListConnectionsRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListConnectionsRequest.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.filter != null && message.hasOwnProperty("filter")) + if (!$util.isString(message.filter)) + return "filter: string expected"; + if (message.orderBy != null && message.hasOwnProperty("orderBy")) + if (!$util.isString(message.orderBy)) + return "orderBy: string expected"; + if (message.view != null && message.hasOwnProperty("view")) + switch (message.view) { + default: + return "view: enum value expected"; + case 0: + case 1: + case 2: + break; + } + return null; + }; + + /** + * Creates a ListConnectionsRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.connectors.v1.ListConnectionsRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.connectors.v1.ListConnectionsRequest} ListConnectionsRequest + */ + ListConnectionsRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.connectors.v1.ListConnectionsRequest) + return object; + var message = new $root.google.cloud.connectors.v1.ListConnectionsRequest(); + 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.filter != null) + message.filter = String(object.filter); + if (object.orderBy != null) + message.orderBy = String(object.orderBy); + switch (object.view) { + default: + if (typeof object.view === "number") { + message.view = object.view; + break; + } + break; + case "CONNECTION_VIEW_UNSPECIFIED": + case 0: + message.view = 0; + break; + case "BASIC": + case 1: + message.view = 1; + break; + case "FULL": + case 2: + message.view = 2; + break; + } + return message; + }; + + /** + * Creates a plain object from a ListConnectionsRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.connectors.v1.ListConnectionsRequest + * @static + * @param {google.cloud.connectors.v1.ListConnectionsRequest} message ListConnectionsRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListConnectionsRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.pageSize = 0; + object.pageToken = ""; + object.filter = ""; + object.orderBy = ""; + object.view = options.enums === String ? "CONNECTION_VIEW_UNSPECIFIED" : 0; + } + 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.filter != null && message.hasOwnProperty("filter")) + object.filter = message.filter; + if (message.orderBy != null && message.hasOwnProperty("orderBy")) + object.orderBy = message.orderBy; + if (message.view != null && message.hasOwnProperty("view")) + object.view = options.enums === String ? $root.google.cloud.connectors.v1.ConnectionView[message.view] === undefined ? message.view : $root.google.cloud.connectors.v1.ConnectionView[message.view] : message.view; + return object; + }; + + /** + * Converts this ListConnectionsRequest to JSON. + * @function toJSON + * @memberof google.cloud.connectors.v1.ListConnectionsRequest + * @instance + * @returns {Object.} JSON object + */ + ListConnectionsRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListConnectionsRequest + * @function getTypeUrl + * @memberof google.cloud.connectors.v1.ListConnectionsRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListConnectionsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.connectors.v1.ListConnectionsRequest"; + }; + + return ListConnectionsRequest; + })(); + + v1.ListConnectionsResponse = (function() { + + /** + * Properties of a ListConnectionsResponse. + * @memberof google.cloud.connectors.v1 + * @interface IListConnectionsResponse + * @property {Array.|null} [connections] ListConnectionsResponse connections + * @property {string|null} [nextPageToken] ListConnectionsResponse nextPageToken + * @property {Array.|null} [unreachable] ListConnectionsResponse unreachable + */ + + /** + * Constructs a new ListConnectionsResponse. + * @memberof google.cloud.connectors.v1 + * @classdesc Represents a ListConnectionsResponse. + * @implements IListConnectionsResponse + * @constructor + * @param {google.cloud.connectors.v1.IListConnectionsResponse=} [properties] Properties to set + */ + function ListConnectionsResponse(properties) { + this.connections = []; + this.unreachable = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListConnectionsResponse connections. + * @member {Array.} connections + * @memberof google.cloud.connectors.v1.ListConnectionsResponse + * @instance + */ + ListConnectionsResponse.prototype.connections = $util.emptyArray; + + /** + * ListConnectionsResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.cloud.connectors.v1.ListConnectionsResponse + * @instance + */ + ListConnectionsResponse.prototype.nextPageToken = ""; + + /** + * ListConnectionsResponse unreachable. + * @member {Array.} unreachable + * @memberof google.cloud.connectors.v1.ListConnectionsResponse + * @instance + */ + ListConnectionsResponse.prototype.unreachable = $util.emptyArray; + + /** + * Creates a new ListConnectionsResponse instance using the specified properties. + * @function create + * @memberof google.cloud.connectors.v1.ListConnectionsResponse + * @static + * @param {google.cloud.connectors.v1.IListConnectionsResponse=} [properties] Properties to set + * @returns {google.cloud.connectors.v1.ListConnectionsResponse} ListConnectionsResponse instance + */ + ListConnectionsResponse.create = function create(properties) { + return new ListConnectionsResponse(properties); + }; + + /** + * Encodes the specified ListConnectionsResponse message. Does not implicitly {@link google.cloud.connectors.v1.ListConnectionsResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.connectors.v1.ListConnectionsResponse + * @static + * @param {google.cloud.connectors.v1.IListConnectionsResponse} message ListConnectionsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListConnectionsResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.connections != null && message.connections.length) + for (var i = 0; i < message.connections.length; ++i) + $root.google.cloud.connectors.v1.Connection.encode(message.connections[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); + if (message.unreachable != null && message.unreachable.length) + for (var i = 0; i < message.unreachable.length; ++i) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.unreachable[i]); + return writer; + }; + + /** + * Encodes the specified ListConnectionsResponse message, length delimited. Does not implicitly {@link google.cloud.connectors.v1.ListConnectionsResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.connectors.v1.ListConnectionsResponse + * @static + * @param {google.cloud.connectors.v1.IListConnectionsResponse} message ListConnectionsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListConnectionsResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListConnectionsResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.connectors.v1.ListConnectionsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.connectors.v1.ListConnectionsResponse} ListConnectionsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListConnectionsResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.connectors.v1.ListConnectionsResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.connections && message.connections.length)) + message.connections = []; + message.connections.push($root.google.cloud.connectors.v1.Connection.decode(reader, reader.uint32())); + break; + } + case 2: { + message.nextPageToken = reader.string(); + break; + } + case 3: { + if (!(message.unreachable && message.unreachable.length)) + message.unreachable = []; + message.unreachable.push(reader.string()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListConnectionsResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.connectors.v1.ListConnectionsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.connectors.v1.ListConnectionsResponse} ListConnectionsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListConnectionsResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListConnectionsResponse message. + * @function verify + * @memberof google.cloud.connectors.v1.ListConnectionsResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListConnectionsResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.connections != null && message.hasOwnProperty("connections")) { + if (!Array.isArray(message.connections)) + return "connections: array expected"; + for (var i = 0; i < message.connections.length; ++i) { + var error = $root.google.cloud.connectors.v1.Connection.verify(message.connections[i]); + if (error) + return "connections." + error; + } + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + if (message.unreachable != null && message.hasOwnProperty("unreachable")) { + if (!Array.isArray(message.unreachable)) + return "unreachable: array expected"; + for (var i = 0; i < message.unreachable.length; ++i) + if (!$util.isString(message.unreachable[i])) + return "unreachable: string[] expected"; + } + return null; + }; + + /** + * Creates a ListConnectionsResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.connectors.v1.ListConnectionsResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.connectors.v1.ListConnectionsResponse} ListConnectionsResponse + */ + ListConnectionsResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.connectors.v1.ListConnectionsResponse) + return object; + var message = new $root.google.cloud.connectors.v1.ListConnectionsResponse(); + if (object.connections) { + if (!Array.isArray(object.connections)) + throw TypeError(".google.cloud.connectors.v1.ListConnectionsResponse.connections: array expected"); + message.connections = []; + for (var i = 0; i < object.connections.length; ++i) { + if (typeof object.connections[i] !== "object") + throw TypeError(".google.cloud.connectors.v1.ListConnectionsResponse.connections: object expected"); + message.connections[i] = $root.google.cloud.connectors.v1.Connection.fromObject(object.connections[i]); + } + } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + if (object.unreachable) { + if (!Array.isArray(object.unreachable)) + throw TypeError(".google.cloud.connectors.v1.ListConnectionsResponse.unreachable: array expected"); + message.unreachable = []; + for (var i = 0; i < object.unreachable.length; ++i) + message.unreachable[i] = String(object.unreachable[i]); + } + return message; + }; + + /** + * Creates a plain object from a ListConnectionsResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.connectors.v1.ListConnectionsResponse + * @static + * @param {google.cloud.connectors.v1.ListConnectionsResponse} message ListConnectionsResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListConnectionsResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.connections = []; + object.unreachable = []; + } + if (options.defaults) + object.nextPageToken = ""; + if (message.connections && message.connections.length) { + object.connections = []; + for (var j = 0; j < message.connections.length; ++j) + object.connections[j] = $root.google.cloud.connectors.v1.Connection.toObject(message.connections[j], options); + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + object.nextPageToken = message.nextPageToken; + if (message.unreachable && message.unreachable.length) { + object.unreachable = []; + for (var j = 0; j < message.unreachable.length; ++j) + object.unreachable[j] = message.unreachable[j]; + } + return object; + }; + + /** + * Converts this ListConnectionsResponse to JSON. + * @function toJSON + * @memberof google.cloud.connectors.v1.ListConnectionsResponse + * @instance + * @returns {Object.} JSON object + */ + ListConnectionsResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListConnectionsResponse + * @function getTypeUrl + * @memberof google.cloud.connectors.v1.ListConnectionsResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListConnectionsResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.connectors.v1.ListConnectionsResponse"; + }; + + return ListConnectionsResponse; + })(); + + v1.GetConnectionRequest = (function() { + + /** + * Properties of a GetConnectionRequest. + * @memberof google.cloud.connectors.v1 + * @interface IGetConnectionRequest + * @property {string|null} [name] GetConnectionRequest name + * @property {google.cloud.connectors.v1.ConnectionView|null} [view] GetConnectionRequest view + */ + + /** + * Constructs a new GetConnectionRequest. + * @memberof google.cloud.connectors.v1 + * @classdesc Represents a GetConnectionRequest. + * @implements IGetConnectionRequest + * @constructor + * @param {google.cloud.connectors.v1.IGetConnectionRequest=} [properties] Properties to set + */ + function GetConnectionRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetConnectionRequest name. + * @member {string} name + * @memberof google.cloud.connectors.v1.GetConnectionRequest + * @instance + */ + GetConnectionRequest.prototype.name = ""; + + /** + * GetConnectionRequest view. + * @member {google.cloud.connectors.v1.ConnectionView} view + * @memberof google.cloud.connectors.v1.GetConnectionRequest + * @instance + */ + GetConnectionRequest.prototype.view = 0; + + /** + * Creates a new GetConnectionRequest instance using the specified properties. + * @function create + * @memberof google.cloud.connectors.v1.GetConnectionRequest + * @static + * @param {google.cloud.connectors.v1.IGetConnectionRequest=} [properties] Properties to set + * @returns {google.cloud.connectors.v1.GetConnectionRequest} GetConnectionRequest instance + */ + GetConnectionRequest.create = function create(properties) { + return new GetConnectionRequest(properties); + }; + + /** + * Encodes the specified GetConnectionRequest message. Does not implicitly {@link google.cloud.connectors.v1.GetConnectionRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.connectors.v1.GetConnectionRequest + * @static + * @param {google.cloud.connectors.v1.IGetConnectionRequest} message GetConnectionRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetConnectionRequest.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.view != null && Object.hasOwnProperty.call(message, "view")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.view); + return writer; + }; + + /** + * Encodes the specified GetConnectionRequest message, length delimited. Does not implicitly {@link google.cloud.connectors.v1.GetConnectionRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.connectors.v1.GetConnectionRequest + * @static + * @param {google.cloud.connectors.v1.IGetConnectionRequest} message GetConnectionRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetConnectionRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetConnectionRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.connectors.v1.GetConnectionRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.connectors.v1.GetConnectionRequest} GetConnectionRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetConnectionRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.connectors.v1.GetConnectionRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.view = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetConnectionRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.connectors.v1.GetConnectionRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.connectors.v1.GetConnectionRequest} GetConnectionRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetConnectionRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetConnectionRequest message. + * @function verify + * @memberof google.cloud.connectors.v1.GetConnectionRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetConnectionRequest.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.view != null && message.hasOwnProperty("view")) + switch (message.view) { + default: + return "view: enum value expected"; + case 0: + case 1: + case 2: + break; + } + return null; + }; + + /** + * Creates a GetConnectionRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.connectors.v1.GetConnectionRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.connectors.v1.GetConnectionRequest} GetConnectionRequest + */ + GetConnectionRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.connectors.v1.GetConnectionRequest) + return object; + var message = new $root.google.cloud.connectors.v1.GetConnectionRequest(); + if (object.name != null) + message.name = String(object.name); + switch (object.view) { + default: + if (typeof object.view === "number") { + message.view = object.view; + break; + } + break; + case "CONNECTION_VIEW_UNSPECIFIED": + case 0: + message.view = 0; + break; + case "BASIC": + case 1: + message.view = 1; + break; + case "FULL": + case 2: + message.view = 2; + break; + } + return message; + }; + + /** + * Creates a plain object from a GetConnectionRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.connectors.v1.GetConnectionRequest + * @static + * @param {google.cloud.connectors.v1.GetConnectionRequest} message GetConnectionRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetConnectionRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.view = options.enums === String ? "CONNECTION_VIEW_UNSPECIFIED" : 0; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.view != null && message.hasOwnProperty("view")) + object.view = options.enums === String ? $root.google.cloud.connectors.v1.ConnectionView[message.view] === undefined ? message.view : $root.google.cloud.connectors.v1.ConnectionView[message.view] : message.view; + return object; + }; + + /** + * Converts this GetConnectionRequest to JSON. + * @function toJSON + * @memberof google.cloud.connectors.v1.GetConnectionRequest + * @instance + * @returns {Object.} JSON object + */ + GetConnectionRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GetConnectionRequest + * @function getTypeUrl + * @memberof google.cloud.connectors.v1.GetConnectionRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GetConnectionRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.connectors.v1.GetConnectionRequest"; + }; + + return GetConnectionRequest; + })(); + + v1.CreateConnectionRequest = (function() { + + /** + * Properties of a CreateConnectionRequest. + * @memberof google.cloud.connectors.v1 + * @interface ICreateConnectionRequest + * @property {string|null} [parent] CreateConnectionRequest parent + * @property {string|null} [connectionId] CreateConnectionRequest connectionId + * @property {google.cloud.connectors.v1.IConnection|null} [connection] CreateConnectionRequest connection + */ + + /** + * Constructs a new CreateConnectionRequest. + * @memberof google.cloud.connectors.v1 + * @classdesc Represents a CreateConnectionRequest. + * @implements ICreateConnectionRequest + * @constructor + * @param {google.cloud.connectors.v1.ICreateConnectionRequest=} [properties] Properties to set + */ + function CreateConnectionRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * CreateConnectionRequest parent. + * @member {string} parent + * @memberof google.cloud.connectors.v1.CreateConnectionRequest + * @instance + */ + CreateConnectionRequest.prototype.parent = ""; + + /** + * CreateConnectionRequest connectionId. + * @member {string} connectionId + * @memberof google.cloud.connectors.v1.CreateConnectionRequest + * @instance + */ + CreateConnectionRequest.prototype.connectionId = ""; + + /** + * CreateConnectionRequest connection. + * @member {google.cloud.connectors.v1.IConnection|null|undefined} connection + * @memberof google.cloud.connectors.v1.CreateConnectionRequest + * @instance + */ + CreateConnectionRequest.prototype.connection = null; + + /** + * Creates a new CreateConnectionRequest instance using the specified properties. + * @function create + * @memberof google.cloud.connectors.v1.CreateConnectionRequest + * @static + * @param {google.cloud.connectors.v1.ICreateConnectionRequest=} [properties] Properties to set + * @returns {google.cloud.connectors.v1.CreateConnectionRequest} CreateConnectionRequest instance + */ + CreateConnectionRequest.create = function create(properties) { + return new CreateConnectionRequest(properties); + }; + + /** + * Encodes the specified CreateConnectionRequest message. Does not implicitly {@link google.cloud.connectors.v1.CreateConnectionRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.connectors.v1.CreateConnectionRequest + * @static + * @param {google.cloud.connectors.v1.ICreateConnectionRequest} message CreateConnectionRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateConnectionRequest.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.connectionId != null && Object.hasOwnProperty.call(message, "connectionId")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.connectionId); + if (message.connection != null && Object.hasOwnProperty.call(message, "connection")) + $root.google.cloud.connectors.v1.Connection.encode(message.connection, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified CreateConnectionRequest message, length delimited. Does not implicitly {@link google.cloud.connectors.v1.CreateConnectionRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.connectors.v1.CreateConnectionRequest + * @static + * @param {google.cloud.connectors.v1.ICreateConnectionRequest} message CreateConnectionRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateConnectionRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CreateConnectionRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.connectors.v1.CreateConnectionRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.connectors.v1.CreateConnectionRequest} CreateConnectionRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateConnectionRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.connectors.v1.CreateConnectionRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.connectionId = reader.string(); + break; + } + case 3: { + message.connection = $root.google.cloud.connectors.v1.Connection.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CreateConnectionRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.connectors.v1.CreateConnectionRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.connectors.v1.CreateConnectionRequest} CreateConnectionRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateConnectionRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CreateConnectionRequest message. + * @function verify + * @memberof google.cloud.connectors.v1.CreateConnectionRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CreateConnectionRequest.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.connectionId != null && message.hasOwnProperty("connectionId")) + if (!$util.isString(message.connectionId)) + return "connectionId: string expected"; + if (message.connection != null && message.hasOwnProperty("connection")) { + var error = $root.google.cloud.connectors.v1.Connection.verify(message.connection); + if (error) + return "connection." + error; + } + return null; + }; + + /** + * Creates a CreateConnectionRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.connectors.v1.CreateConnectionRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.connectors.v1.CreateConnectionRequest} CreateConnectionRequest + */ + CreateConnectionRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.connectors.v1.CreateConnectionRequest) + return object; + var message = new $root.google.cloud.connectors.v1.CreateConnectionRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.connectionId != null) + message.connectionId = String(object.connectionId); + if (object.connection != null) { + if (typeof object.connection !== "object") + throw TypeError(".google.cloud.connectors.v1.CreateConnectionRequest.connection: object expected"); + message.connection = $root.google.cloud.connectors.v1.Connection.fromObject(object.connection); + } + return message; + }; + + /** + * Creates a plain object from a CreateConnectionRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.connectors.v1.CreateConnectionRequest + * @static + * @param {google.cloud.connectors.v1.CreateConnectionRequest} message CreateConnectionRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CreateConnectionRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.connectionId = ""; + object.connection = null; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.connectionId != null && message.hasOwnProperty("connectionId")) + object.connectionId = message.connectionId; + if (message.connection != null && message.hasOwnProperty("connection")) + object.connection = $root.google.cloud.connectors.v1.Connection.toObject(message.connection, options); + return object; + }; + + /** + * Converts this CreateConnectionRequest to JSON. + * @function toJSON + * @memberof google.cloud.connectors.v1.CreateConnectionRequest + * @instance + * @returns {Object.} JSON object + */ + CreateConnectionRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CreateConnectionRequest + * @function getTypeUrl + * @memberof google.cloud.connectors.v1.CreateConnectionRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CreateConnectionRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.connectors.v1.CreateConnectionRequest"; + }; + + return CreateConnectionRequest; + })(); + + v1.UpdateConnectionRequest = (function() { + + /** + * Properties of an UpdateConnectionRequest. + * @memberof google.cloud.connectors.v1 + * @interface IUpdateConnectionRequest + * @property {google.cloud.connectors.v1.IConnection|null} [connection] UpdateConnectionRequest connection + * @property {google.protobuf.IFieldMask|null} [updateMask] UpdateConnectionRequest updateMask + */ + + /** + * Constructs a new UpdateConnectionRequest. + * @memberof google.cloud.connectors.v1 + * @classdesc Represents an UpdateConnectionRequest. + * @implements IUpdateConnectionRequest + * @constructor + * @param {google.cloud.connectors.v1.IUpdateConnectionRequest=} [properties] Properties to set + */ + function UpdateConnectionRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * UpdateConnectionRequest connection. + * @member {google.cloud.connectors.v1.IConnection|null|undefined} connection + * @memberof google.cloud.connectors.v1.UpdateConnectionRequest + * @instance + */ + UpdateConnectionRequest.prototype.connection = null; + + /** + * UpdateConnectionRequest updateMask. + * @member {google.protobuf.IFieldMask|null|undefined} updateMask + * @memberof google.cloud.connectors.v1.UpdateConnectionRequest + * @instance + */ + UpdateConnectionRequest.prototype.updateMask = null; + + /** + * Creates a new UpdateConnectionRequest instance using the specified properties. + * @function create + * @memberof google.cloud.connectors.v1.UpdateConnectionRequest + * @static + * @param {google.cloud.connectors.v1.IUpdateConnectionRequest=} [properties] Properties to set + * @returns {google.cloud.connectors.v1.UpdateConnectionRequest} UpdateConnectionRequest instance + */ + UpdateConnectionRequest.create = function create(properties) { + return new UpdateConnectionRequest(properties); + }; + + /** + * Encodes the specified UpdateConnectionRequest message. Does not implicitly {@link google.cloud.connectors.v1.UpdateConnectionRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.connectors.v1.UpdateConnectionRequest + * @static + * @param {google.cloud.connectors.v1.IUpdateConnectionRequest} message UpdateConnectionRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateConnectionRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.connection != null && Object.hasOwnProperty.call(message, "connection")) + $root.google.cloud.connectors.v1.Connection.encode(message.connection, 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 UpdateConnectionRequest message, length delimited. Does not implicitly {@link google.cloud.connectors.v1.UpdateConnectionRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.connectors.v1.UpdateConnectionRequest + * @static + * @param {google.cloud.connectors.v1.IUpdateConnectionRequest} message UpdateConnectionRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateConnectionRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an UpdateConnectionRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.connectors.v1.UpdateConnectionRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.connectors.v1.UpdateConnectionRequest} UpdateConnectionRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateConnectionRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.connectors.v1.UpdateConnectionRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.connection = $root.google.cloud.connectors.v1.Connection.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 UpdateConnectionRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.connectors.v1.UpdateConnectionRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.connectors.v1.UpdateConnectionRequest} UpdateConnectionRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateConnectionRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an UpdateConnectionRequest message. + * @function verify + * @memberof google.cloud.connectors.v1.UpdateConnectionRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + UpdateConnectionRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.connection != null && message.hasOwnProperty("connection")) { + var error = $root.google.cloud.connectors.v1.Connection.verify(message.connection); + if (error) + return "connection." + 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 UpdateConnectionRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.connectors.v1.UpdateConnectionRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.connectors.v1.UpdateConnectionRequest} UpdateConnectionRequest + */ + UpdateConnectionRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.connectors.v1.UpdateConnectionRequest) + return object; + var message = new $root.google.cloud.connectors.v1.UpdateConnectionRequest(); + if (object.connection != null) { + if (typeof object.connection !== "object") + throw TypeError(".google.cloud.connectors.v1.UpdateConnectionRequest.connection: object expected"); + message.connection = $root.google.cloud.connectors.v1.Connection.fromObject(object.connection); + } + if (object.updateMask != null) { + if (typeof object.updateMask !== "object") + throw TypeError(".google.cloud.connectors.v1.UpdateConnectionRequest.updateMask: object expected"); + message.updateMask = $root.google.protobuf.FieldMask.fromObject(object.updateMask); + } + return message; + }; + + /** + * Creates a plain object from an UpdateConnectionRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.connectors.v1.UpdateConnectionRequest + * @static + * @param {google.cloud.connectors.v1.UpdateConnectionRequest} message UpdateConnectionRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + UpdateConnectionRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.connection = null; + object.updateMask = null; + } + if (message.connection != null && message.hasOwnProperty("connection")) + object.connection = $root.google.cloud.connectors.v1.Connection.toObject(message.connection, options); + if (message.updateMask != null && message.hasOwnProperty("updateMask")) + object.updateMask = $root.google.protobuf.FieldMask.toObject(message.updateMask, options); + return object; + }; + + /** + * Converts this UpdateConnectionRequest to JSON. + * @function toJSON + * @memberof google.cloud.connectors.v1.UpdateConnectionRequest + * @instance + * @returns {Object.} JSON object + */ + UpdateConnectionRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for UpdateConnectionRequest + * @function getTypeUrl + * @memberof google.cloud.connectors.v1.UpdateConnectionRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + UpdateConnectionRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.connectors.v1.UpdateConnectionRequest"; + }; + + return UpdateConnectionRequest; + })(); + + v1.DeleteConnectionRequest = (function() { + + /** + * Properties of a DeleteConnectionRequest. + * @memberof google.cloud.connectors.v1 + * @interface IDeleteConnectionRequest + * @property {string|null} [name] DeleteConnectionRequest name + */ + + /** + * Constructs a new DeleteConnectionRequest. + * @memberof google.cloud.connectors.v1 + * @classdesc Represents a DeleteConnectionRequest. + * @implements IDeleteConnectionRequest + * @constructor + * @param {google.cloud.connectors.v1.IDeleteConnectionRequest=} [properties] Properties to set + */ + function DeleteConnectionRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * DeleteConnectionRequest name. + * @member {string} name + * @memberof google.cloud.connectors.v1.DeleteConnectionRequest + * @instance + */ + DeleteConnectionRequest.prototype.name = ""; + + /** + * Creates a new DeleteConnectionRequest instance using the specified properties. + * @function create + * @memberof google.cloud.connectors.v1.DeleteConnectionRequest + * @static + * @param {google.cloud.connectors.v1.IDeleteConnectionRequest=} [properties] Properties to set + * @returns {google.cloud.connectors.v1.DeleteConnectionRequest} DeleteConnectionRequest instance + */ + DeleteConnectionRequest.create = function create(properties) { + return new DeleteConnectionRequest(properties); + }; + + /** + * Encodes the specified DeleteConnectionRequest message. Does not implicitly {@link google.cloud.connectors.v1.DeleteConnectionRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.connectors.v1.DeleteConnectionRequest + * @static + * @param {google.cloud.connectors.v1.IDeleteConnectionRequest} message DeleteConnectionRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteConnectionRequest.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 DeleteConnectionRequest message, length delimited. Does not implicitly {@link google.cloud.connectors.v1.DeleteConnectionRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.connectors.v1.DeleteConnectionRequest + * @static + * @param {google.cloud.connectors.v1.IDeleteConnectionRequest} message DeleteConnectionRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteConnectionRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DeleteConnectionRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.connectors.v1.DeleteConnectionRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.connectors.v1.DeleteConnectionRequest} DeleteConnectionRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteConnectionRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.connectors.v1.DeleteConnectionRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DeleteConnectionRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.connectors.v1.DeleteConnectionRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.connectors.v1.DeleteConnectionRequest} DeleteConnectionRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteConnectionRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DeleteConnectionRequest message. + * @function verify + * @memberof google.cloud.connectors.v1.DeleteConnectionRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DeleteConnectionRequest.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 DeleteConnectionRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.connectors.v1.DeleteConnectionRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.connectors.v1.DeleteConnectionRequest} DeleteConnectionRequest + */ + DeleteConnectionRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.connectors.v1.DeleteConnectionRequest) + return object; + var message = new $root.google.cloud.connectors.v1.DeleteConnectionRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a DeleteConnectionRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.connectors.v1.DeleteConnectionRequest + * @static + * @param {google.cloud.connectors.v1.DeleteConnectionRequest} message DeleteConnectionRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DeleteConnectionRequest.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 DeleteConnectionRequest to JSON. + * @function toJSON + * @memberof google.cloud.connectors.v1.DeleteConnectionRequest + * @instance + * @returns {Object.} JSON object + */ + DeleteConnectionRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DeleteConnectionRequest + * @function getTypeUrl + * @memberof google.cloud.connectors.v1.DeleteConnectionRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DeleteConnectionRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.connectors.v1.DeleteConnectionRequest"; + }; + + return DeleteConnectionRequest; + })(); + + v1.GetConnectionSchemaMetadataRequest = (function() { + + /** + * Properties of a GetConnectionSchemaMetadataRequest. + * @memberof google.cloud.connectors.v1 + * @interface IGetConnectionSchemaMetadataRequest + * @property {string|null} [name] GetConnectionSchemaMetadataRequest name + */ + + /** + * Constructs a new GetConnectionSchemaMetadataRequest. + * @memberof google.cloud.connectors.v1 + * @classdesc Represents a GetConnectionSchemaMetadataRequest. + * @implements IGetConnectionSchemaMetadataRequest + * @constructor + * @param {google.cloud.connectors.v1.IGetConnectionSchemaMetadataRequest=} [properties] Properties to set + */ + function GetConnectionSchemaMetadataRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetConnectionSchemaMetadataRequest name. + * @member {string} name + * @memberof google.cloud.connectors.v1.GetConnectionSchemaMetadataRequest + * @instance + */ + GetConnectionSchemaMetadataRequest.prototype.name = ""; + + /** + * Creates a new GetConnectionSchemaMetadataRequest instance using the specified properties. + * @function create + * @memberof google.cloud.connectors.v1.GetConnectionSchemaMetadataRequest + * @static + * @param {google.cloud.connectors.v1.IGetConnectionSchemaMetadataRequest=} [properties] Properties to set + * @returns {google.cloud.connectors.v1.GetConnectionSchemaMetadataRequest} GetConnectionSchemaMetadataRequest instance + */ + GetConnectionSchemaMetadataRequest.create = function create(properties) { + return new GetConnectionSchemaMetadataRequest(properties); + }; + + /** + * Encodes the specified GetConnectionSchemaMetadataRequest message. Does not implicitly {@link google.cloud.connectors.v1.GetConnectionSchemaMetadataRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.connectors.v1.GetConnectionSchemaMetadataRequest + * @static + * @param {google.cloud.connectors.v1.IGetConnectionSchemaMetadataRequest} message GetConnectionSchemaMetadataRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetConnectionSchemaMetadataRequest.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 GetConnectionSchemaMetadataRequest message, length delimited. Does not implicitly {@link google.cloud.connectors.v1.GetConnectionSchemaMetadataRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.connectors.v1.GetConnectionSchemaMetadataRequest + * @static + * @param {google.cloud.connectors.v1.IGetConnectionSchemaMetadataRequest} message GetConnectionSchemaMetadataRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetConnectionSchemaMetadataRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetConnectionSchemaMetadataRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.connectors.v1.GetConnectionSchemaMetadataRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.connectors.v1.GetConnectionSchemaMetadataRequest} GetConnectionSchemaMetadataRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetConnectionSchemaMetadataRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.connectors.v1.GetConnectionSchemaMetadataRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetConnectionSchemaMetadataRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.connectors.v1.GetConnectionSchemaMetadataRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.connectors.v1.GetConnectionSchemaMetadataRequest} GetConnectionSchemaMetadataRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetConnectionSchemaMetadataRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetConnectionSchemaMetadataRequest message. + * @function verify + * @memberof google.cloud.connectors.v1.GetConnectionSchemaMetadataRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetConnectionSchemaMetadataRequest.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 GetConnectionSchemaMetadataRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.connectors.v1.GetConnectionSchemaMetadataRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.connectors.v1.GetConnectionSchemaMetadataRequest} GetConnectionSchemaMetadataRequest + */ + GetConnectionSchemaMetadataRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.connectors.v1.GetConnectionSchemaMetadataRequest) + return object; + var message = new $root.google.cloud.connectors.v1.GetConnectionSchemaMetadataRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a GetConnectionSchemaMetadataRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.connectors.v1.GetConnectionSchemaMetadataRequest + * @static + * @param {google.cloud.connectors.v1.GetConnectionSchemaMetadataRequest} message GetConnectionSchemaMetadataRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetConnectionSchemaMetadataRequest.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 GetConnectionSchemaMetadataRequest to JSON. + * @function toJSON + * @memberof google.cloud.connectors.v1.GetConnectionSchemaMetadataRequest + * @instance + * @returns {Object.} JSON object + */ + GetConnectionSchemaMetadataRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GetConnectionSchemaMetadataRequest + * @function getTypeUrl + * @memberof google.cloud.connectors.v1.GetConnectionSchemaMetadataRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GetConnectionSchemaMetadataRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.connectors.v1.GetConnectionSchemaMetadataRequest"; + }; + + return GetConnectionSchemaMetadataRequest; + })(); + + v1.RefreshConnectionSchemaMetadataRequest = (function() { + + /** + * Properties of a RefreshConnectionSchemaMetadataRequest. + * @memberof google.cloud.connectors.v1 + * @interface IRefreshConnectionSchemaMetadataRequest + * @property {string|null} [name] RefreshConnectionSchemaMetadataRequest name + */ + + /** + * Constructs a new RefreshConnectionSchemaMetadataRequest. + * @memberof google.cloud.connectors.v1 + * @classdesc Represents a RefreshConnectionSchemaMetadataRequest. + * @implements IRefreshConnectionSchemaMetadataRequest + * @constructor + * @param {google.cloud.connectors.v1.IRefreshConnectionSchemaMetadataRequest=} [properties] Properties to set + */ + function RefreshConnectionSchemaMetadataRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * RefreshConnectionSchemaMetadataRequest name. + * @member {string} name + * @memberof google.cloud.connectors.v1.RefreshConnectionSchemaMetadataRequest + * @instance + */ + RefreshConnectionSchemaMetadataRequest.prototype.name = ""; + + /** + * Creates a new RefreshConnectionSchemaMetadataRequest instance using the specified properties. + * @function create + * @memberof google.cloud.connectors.v1.RefreshConnectionSchemaMetadataRequest + * @static + * @param {google.cloud.connectors.v1.IRefreshConnectionSchemaMetadataRequest=} [properties] Properties to set + * @returns {google.cloud.connectors.v1.RefreshConnectionSchemaMetadataRequest} RefreshConnectionSchemaMetadataRequest instance + */ + RefreshConnectionSchemaMetadataRequest.create = function create(properties) { + return new RefreshConnectionSchemaMetadataRequest(properties); + }; + + /** + * Encodes the specified RefreshConnectionSchemaMetadataRequest message. Does not implicitly {@link google.cloud.connectors.v1.RefreshConnectionSchemaMetadataRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.connectors.v1.RefreshConnectionSchemaMetadataRequest + * @static + * @param {google.cloud.connectors.v1.IRefreshConnectionSchemaMetadataRequest} message RefreshConnectionSchemaMetadataRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RefreshConnectionSchemaMetadataRequest.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 RefreshConnectionSchemaMetadataRequest message, length delimited. Does not implicitly {@link google.cloud.connectors.v1.RefreshConnectionSchemaMetadataRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.connectors.v1.RefreshConnectionSchemaMetadataRequest + * @static + * @param {google.cloud.connectors.v1.IRefreshConnectionSchemaMetadataRequest} message RefreshConnectionSchemaMetadataRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RefreshConnectionSchemaMetadataRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a RefreshConnectionSchemaMetadataRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.connectors.v1.RefreshConnectionSchemaMetadataRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.connectors.v1.RefreshConnectionSchemaMetadataRequest} RefreshConnectionSchemaMetadataRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RefreshConnectionSchemaMetadataRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.connectors.v1.RefreshConnectionSchemaMetadataRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a RefreshConnectionSchemaMetadataRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.connectors.v1.RefreshConnectionSchemaMetadataRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.connectors.v1.RefreshConnectionSchemaMetadataRequest} RefreshConnectionSchemaMetadataRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RefreshConnectionSchemaMetadataRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a RefreshConnectionSchemaMetadataRequest message. + * @function verify + * @memberof google.cloud.connectors.v1.RefreshConnectionSchemaMetadataRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + RefreshConnectionSchemaMetadataRequest.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 RefreshConnectionSchemaMetadataRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.connectors.v1.RefreshConnectionSchemaMetadataRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.connectors.v1.RefreshConnectionSchemaMetadataRequest} RefreshConnectionSchemaMetadataRequest + */ + RefreshConnectionSchemaMetadataRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.connectors.v1.RefreshConnectionSchemaMetadataRequest) + return object; + var message = new $root.google.cloud.connectors.v1.RefreshConnectionSchemaMetadataRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a RefreshConnectionSchemaMetadataRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.connectors.v1.RefreshConnectionSchemaMetadataRequest + * @static + * @param {google.cloud.connectors.v1.RefreshConnectionSchemaMetadataRequest} message RefreshConnectionSchemaMetadataRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + RefreshConnectionSchemaMetadataRequest.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 RefreshConnectionSchemaMetadataRequest to JSON. + * @function toJSON + * @memberof google.cloud.connectors.v1.RefreshConnectionSchemaMetadataRequest + * @instance + * @returns {Object.} JSON object + */ + RefreshConnectionSchemaMetadataRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for RefreshConnectionSchemaMetadataRequest + * @function getTypeUrl + * @memberof google.cloud.connectors.v1.RefreshConnectionSchemaMetadataRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + RefreshConnectionSchemaMetadataRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.connectors.v1.RefreshConnectionSchemaMetadataRequest"; + }; + + return RefreshConnectionSchemaMetadataRequest; + })(); + + v1.ListRuntimeEntitySchemasRequest = (function() { + + /** + * Properties of a ListRuntimeEntitySchemasRequest. + * @memberof google.cloud.connectors.v1 + * @interface IListRuntimeEntitySchemasRequest + * @property {string|null} [parent] ListRuntimeEntitySchemasRequest parent + * @property {number|null} [pageSize] ListRuntimeEntitySchemasRequest pageSize + * @property {string|null} [pageToken] ListRuntimeEntitySchemasRequest pageToken + * @property {string|null} [filter] ListRuntimeEntitySchemasRequest filter + */ + + /** + * Constructs a new ListRuntimeEntitySchemasRequest. + * @memberof google.cloud.connectors.v1 + * @classdesc Represents a ListRuntimeEntitySchemasRequest. + * @implements IListRuntimeEntitySchemasRequest + * @constructor + * @param {google.cloud.connectors.v1.IListRuntimeEntitySchemasRequest=} [properties] Properties to set + */ + function ListRuntimeEntitySchemasRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListRuntimeEntitySchemasRequest parent. + * @member {string} parent + * @memberof google.cloud.connectors.v1.ListRuntimeEntitySchemasRequest + * @instance + */ + ListRuntimeEntitySchemasRequest.prototype.parent = ""; + + /** + * ListRuntimeEntitySchemasRequest pageSize. + * @member {number} pageSize + * @memberof google.cloud.connectors.v1.ListRuntimeEntitySchemasRequest + * @instance + */ + ListRuntimeEntitySchemasRequest.prototype.pageSize = 0; + + /** + * ListRuntimeEntitySchemasRequest pageToken. + * @member {string} pageToken + * @memberof google.cloud.connectors.v1.ListRuntimeEntitySchemasRequest + * @instance + */ + ListRuntimeEntitySchemasRequest.prototype.pageToken = ""; + + /** + * ListRuntimeEntitySchemasRequest filter. + * @member {string} filter + * @memberof google.cloud.connectors.v1.ListRuntimeEntitySchemasRequest + * @instance + */ + ListRuntimeEntitySchemasRequest.prototype.filter = ""; + + /** + * Creates a new ListRuntimeEntitySchemasRequest instance using the specified properties. + * @function create + * @memberof google.cloud.connectors.v1.ListRuntimeEntitySchemasRequest + * @static + * @param {google.cloud.connectors.v1.IListRuntimeEntitySchemasRequest=} [properties] Properties to set + * @returns {google.cloud.connectors.v1.ListRuntimeEntitySchemasRequest} ListRuntimeEntitySchemasRequest instance + */ + ListRuntimeEntitySchemasRequest.create = function create(properties) { + return new ListRuntimeEntitySchemasRequest(properties); + }; + + /** + * Encodes the specified ListRuntimeEntitySchemasRequest message. Does not implicitly {@link google.cloud.connectors.v1.ListRuntimeEntitySchemasRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.connectors.v1.ListRuntimeEntitySchemasRequest + * @static + * @param {google.cloud.connectors.v1.IListRuntimeEntitySchemasRequest} message ListRuntimeEntitySchemasRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListRuntimeEntitySchemasRequest.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.filter != null && Object.hasOwnProperty.call(message, "filter")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.filter); + return writer; + }; + + /** + * Encodes the specified ListRuntimeEntitySchemasRequest message, length delimited. Does not implicitly {@link google.cloud.connectors.v1.ListRuntimeEntitySchemasRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.connectors.v1.ListRuntimeEntitySchemasRequest + * @static + * @param {google.cloud.connectors.v1.IListRuntimeEntitySchemasRequest} message ListRuntimeEntitySchemasRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListRuntimeEntitySchemasRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListRuntimeEntitySchemasRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.connectors.v1.ListRuntimeEntitySchemasRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.connectors.v1.ListRuntimeEntitySchemasRequest} ListRuntimeEntitySchemasRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListRuntimeEntitySchemasRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.connectors.v1.ListRuntimeEntitySchemasRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + 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.filter = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListRuntimeEntitySchemasRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.connectors.v1.ListRuntimeEntitySchemasRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.connectors.v1.ListRuntimeEntitySchemasRequest} ListRuntimeEntitySchemasRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListRuntimeEntitySchemasRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListRuntimeEntitySchemasRequest message. + * @function verify + * @memberof google.cloud.connectors.v1.ListRuntimeEntitySchemasRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListRuntimeEntitySchemasRequest.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.filter != null && message.hasOwnProperty("filter")) + if (!$util.isString(message.filter)) + return "filter: string expected"; + return null; + }; + + /** + * Creates a ListRuntimeEntitySchemasRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.connectors.v1.ListRuntimeEntitySchemasRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.connectors.v1.ListRuntimeEntitySchemasRequest} ListRuntimeEntitySchemasRequest + */ + ListRuntimeEntitySchemasRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.connectors.v1.ListRuntimeEntitySchemasRequest) + return object; + var message = new $root.google.cloud.connectors.v1.ListRuntimeEntitySchemasRequest(); + 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.filter != null) + message.filter = String(object.filter); + return message; + }; + + /** + * Creates a plain object from a ListRuntimeEntitySchemasRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.connectors.v1.ListRuntimeEntitySchemasRequest + * @static + * @param {google.cloud.connectors.v1.ListRuntimeEntitySchemasRequest} message ListRuntimeEntitySchemasRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListRuntimeEntitySchemasRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.pageSize = 0; + object.pageToken = ""; + object.filter = ""; + } + 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.filter != null && message.hasOwnProperty("filter")) + object.filter = message.filter; + return object; + }; + + /** + * Converts this ListRuntimeEntitySchemasRequest to JSON. + * @function toJSON + * @memberof google.cloud.connectors.v1.ListRuntimeEntitySchemasRequest + * @instance + * @returns {Object.} JSON object + */ + ListRuntimeEntitySchemasRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListRuntimeEntitySchemasRequest + * @function getTypeUrl + * @memberof google.cloud.connectors.v1.ListRuntimeEntitySchemasRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListRuntimeEntitySchemasRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.connectors.v1.ListRuntimeEntitySchemasRequest"; + }; + + return ListRuntimeEntitySchemasRequest; + })(); + + v1.ListRuntimeEntitySchemasResponse = (function() { + + /** + * Properties of a ListRuntimeEntitySchemasResponse. + * @memberof google.cloud.connectors.v1 + * @interface IListRuntimeEntitySchemasResponse + * @property {Array.|null} [runtimeEntitySchemas] ListRuntimeEntitySchemasResponse runtimeEntitySchemas + * @property {string|null} [nextPageToken] ListRuntimeEntitySchemasResponse nextPageToken + */ + + /** + * Constructs a new ListRuntimeEntitySchemasResponse. + * @memberof google.cloud.connectors.v1 + * @classdesc Represents a ListRuntimeEntitySchemasResponse. + * @implements IListRuntimeEntitySchemasResponse + * @constructor + * @param {google.cloud.connectors.v1.IListRuntimeEntitySchemasResponse=} [properties] Properties to set + */ + function ListRuntimeEntitySchemasResponse(properties) { + this.runtimeEntitySchemas = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListRuntimeEntitySchemasResponse runtimeEntitySchemas. + * @member {Array.} runtimeEntitySchemas + * @memberof google.cloud.connectors.v1.ListRuntimeEntitySchemasResponse + * @instance + */ + ListRuntimeEntitySchemasResponse.prototype.runtimeEntitySchemas = $util.emptyArray; + + /** + * ListRuntimeEntitySchemasResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.cloud.connectors.v1.ListRuntimeEntitySchemasResponse + * @instance + */ + ListRuntimeEntitySchemasResponse.prototype.nextPageToken = ""; + + /** + * Creates a new ListRuntimeEntitySchemasResponse instance using the specified properties. + * @function create + * @memberof google.cloud.connectors.v1.ListRuntimeEntitySchemasResponse + * @static + * @param {google.cloud.connectors.v1.IListRuntimeEntitySchemasResponse=} [properties] Properties to set + * @returns {google.cloud.connectors.v1.ListRuntimeEntitySchemasResponse} ListRuntimeEntitySchemasResponse instance + */ + ListRuntimeEntitySchemasResponse.create = function create(properties) { + return new ListRuntimeEntitySchemasResponse(properties); + }; + + /** + * Encodes the specified ListRuntimeEntitySchemasResponse message. Does not implicitly {@link google.cloud.connectors.v1.ListRuntimeEntitySchemasResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.connectors.v1.ListRuntimeEntitySchemasResponse + * @static + * @param {google.cloud.connectors.v1.IListRuntimeEntitySchemasResponse} message ListRuntimeEntitySchemasResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListRuntimeEntitySchemasResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.runtimeEntitySchemas != null && message.runtimeEntitySchemas.length) + for (var i = 0; i < message.runtimeEntitySchemas.length; ++i) + $root.google.cloud.connectors.v1.RuntimeEntitySchema.encode(message.runtimeEntitySchemas[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 ListRuntimeEntitySchemasResponse message, length delimited. Does not implicitly {@link google.cloud.connectors.v1.ListRuntimeEntitySchemasResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.connectors.v1.ListRuntimeEntitySchemasResponse + * @static + * @param {google.cloud.connectors.v1.IListRuntimeEntitySchemasResponse} message ListRuntimeEntitySchemasResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListRuntimeEntitySchemasResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListRuntimeEntitySchemasResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.connectors.v1.ListRuntimeEntitySchemasResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.connectors.v1.ListRuntimeEntitySchemasResponse} ListRuntimeEntitySchemasResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListRuntimeEntitySchemasResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.connectors.v1.ListRuntimeEntitySchemasResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.runtimeEntitySchemas && message.runtimeEntitySchemas.length)) + message.runtimeEntitySchemas = []; + message.runtimeEntitySchemas.push($root.google.cloud.connectors.v1.RuntimeEntitySchema.decode(reader, reader.uint32())); + break; + } + case 2: { + message.nextPageToken = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListRuntimeEntitySchemasResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.connectors.v1.ListRuntimeEntitySchemasResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.connectors.v1.ListRuntimeEntitySchemasResponse} ListRuntimeEntitySchemasResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListRuntimeEntitySchemasResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListRuntimeEntitySchemasResponse message. + * @function verify + * @memberof google.cloud.connectors.v1.ListRuntimeEntitySchemasResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListRuntimeEntitySchemasResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.runtimeEntitySchemas != null && message.hasOwnProperty("runtimeEntitySchemas")) { + if (!Array.isArray(message.runtimeEntitySchemas)) + return "runtimeEntitySchemas: array expected"; + for (var i = 0; i < message.runtimeEntitySchemas.length; ++i) { + var error = $root.google.cloud.connectors.v1.RuntimeEntitySchema.verify(message.runtimeEntitySchemas[i]); + if (error) + return "runtimeEntitySchemas." + error; + } + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + return null; + }; + + /** + * Creates a ListRuntimeEntitySchemasResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.connectors.v1.ListRuntimeEntitySchemasResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.connectors.v1.ListRuntimeEntitySchemasResponse} ListRuntimeEntitySchemasResponse + */ + ListRuntimeEntitySchemasResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.connectors.v1.ListRuntimeEntitySchemasResponse) + return object; + var message = new $root.google.cloud.connectors.v1.ListRuntimeEntitySchemasResponse(); + if (object.runtimeEntitySchemas) { + if (!Array.isArray(object.runtimeEntitySchemas)) + throw TypeError(".google.cloud.connectors.v1.ListRuntimeEntitySchemasResponse.runtimeEntitySchemas: array expected"); + message.runtimeEntitySchemas = []; + for (var i = 0; i < object.runtimeEntitySchemas.length; ++i) { + if (typeof object.runtimeEntitySchemas[i] !== "object") + throw TypeError(".google.cloud.connectors.v1.ListRuntimeEntitySchemasResponse.runtimeEntitySchemas: object expected"); + message.runtimeEntitySchemas[i] = $root.google.cloud.connectors.v1.RuntimeEntitySchema.fromObject(object.runtimeEntitySchemas[i]); + } + } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + return message; + }; + + /** + * Creates a plain object from a ListRuntimeEntitySchemasResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.connectors.v1.ListRuntimeEntitySchemasResponse + * @static + * @param {google.cloud.connectors.v1.ListRuntimeEntitySchemasResponse} message ListRuntimeEntitySchemasResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListRuntimeEntitySchemasResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.runtimeEntitySchemas = []; + if (options.defaults) + object.nextPageToken = ""; + if (message.runtimeEntitySchemas && message.runtimeEntitySchemas.length) { + object.runtimeEntitySchemas = []; + for (var j = 0; j < message.runtimeEntitySchemas.length; ++j) + object.runtimeEntitySchemas[j] = $root.google.cloud.connectors.v1.RuntimeEntitySchema.toObject(message.runtimeEntitySchemas[j], options); + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + object.nextPageToken = message.nextPageToken; + return object; + }; + + /** + * Converts this ListRuntimeEntitySchemasResponse to JSON. + * @function toJSON + * @memberof google.cloud.connectors.v1.ListRuntimeEntitySchemasResponse + * @instance + * @returns {Object.} JSON object + */ + ListRuntimeEntitySchemasResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListRuntimeEntitySchemasResponse + * @function getTypeUrl + * @memberof google.cloud.connectors.v1.ListRuntimeEntitySchemasResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListRuntimeEntitySchemasResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.connectors.v1.ListRuntimeEntitySchemasResponse"; + }; + + return ListRuntimeEntitySchemasResponse; + })(); + + v1.ListRuntimeActionSchemasRequest = (function() { + + /** + * Properties of a ListRuntimeActionSchemasRequest. + * @memberof google.cloud.connectors.v1 + * @interface IListRuntimeActionSchemasRequest + * @property {string|null} [parent] ListRuntimeActionSchemasRequest parent + * @property {number|null} [pageSize] ListRuntimeActionSchemasRequest pageSize + * @property {string|null} [pageToken] ListRuntimeActionSchemasRequest pageToken + * @property {string|null} [filter] ListRuntimeActionSchemasRequest filter + */ + + /** + * Constructs a new ListRuntimeActionSchemasRequest. + * @memberof google.cloud.connectors.v1 + * @classdesc Represents a ListRuntimeActionSchemasRequest. + * @implements IListRuntimeActionSchemasRequest + * @constructor + * @param {google.cloud.connectors.v1.IListRuntimeActionSchemasRequest=} [properties] Properties to set + */ + function ListRuntimeActionSchemasRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListRuntimeActionSchemasRequest parent. + * @member {string} parent + * @memberof google.cloud.connectors.v1.ListRuntimeActionSchemasRequest + * @instance + */ + ListRuntimeActionSchemasRequest.prototype.parent = ""; + + /** + * ListRuntimeActionSchemasRequest pageSize. + * @member {number} pageSize + * @memberof google.cloud.connectors.v1.ListRuntimeActionSchemasRequest + * @instance + */ + ListRuntimeActionSchemasRequest.prototype.pageSize = 0; + + /** + * ListRuntimeActionSchemasRequest pageToken. + * @member {string} pageToken + * @memberof google.cloud.connectors.v1.ListRuntimeActionSchemasRequest + * @instance + */ + ListRuntimeActionSchemasRequest.prototype.pageToken = ""; + + /** + * ListRuntimeActionSchemasRequest filter. + * @member {string} filter + * @memberof google.cloud.connectors.v1.ListRuntimeActionSchemasRequest + * @instance + */ + ListRuntimeActionSchemasRequest.prototype.filter = ""; + + /** + * Creates a new ListRuntimeActionSchemasRequest instance using the specified properties. + * @function create + * @memberof google.cloud.connectors.v1.ListRuntimeActionSchemasRequest + * @static + * @param {google.cloud.connectors.v1.IListRuntimeActionSchemasRequest=} [properties] Properties to set + * @returns {google.cloud.connectors.v1.ListRuntimeActionSchemasRequest} ListRuntimeActionSchemasRequest instance + */ + ListRuntimeActionSchemasRequest.create = function create(properties) { + return new ListRuntimeActionSchemasRequest(properties); + }; + + /** + * Encodes the specified ListRuntimeActionSchemasRequest message. Does not implicitly {@link google.cloud.connectors.v1.ListRuntimeActionSchemasRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.connectors.v1.ListRuntimeActionSchemasRequest + * @static + * @param {google.cloud.connectors.v1.IListRuntimeActionSchemasRequest} message ListRuntimeActionSchemasRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListRuntimeActionSchemasRequest.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.filter != null && Object.hasOwnProperty.call(message, "filter")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.filter); + return writer; + }; + + /** + * Encodes the specified ListRuntimeActionSchemasRequest message, length delimited. Does not implicitly {@link google.cloud.connectors.v1.ListRuntimeActionSchemasRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.connectors.v1.ListRuntimeActionSchemasRequest + * @static + * @param {google.cloud.connectors.v1.IListRuntimeActionSchemasRequest} message ListRuntimeActionSchemasRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListRuntimeActionSchemasRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListRuntimeActionSchemasRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.connectors.v1.ListRuntimeActionSchemasRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.connectors.v1.ListRuntimeActionSchemasRequest} ListRuntimeActionSchemasRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListRuntimeActionSchemasRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.connectors.v1.ListRuntimeActionSchemasRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + 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.filter = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListRuntimeActionSchemasRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.connectors.v1.ListRuntimeActionSchemasRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.connectors.v1.ListRuntimeActionSchemasRequest} ListRuntimeActionSchemasRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListRuntimeActionSchemasRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListRuntimeActionSchemasRequest message. + * @function verify + * @memberof google.cloud.connectors.v1.ListRuntimeActionSchemasRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListRuntimeActionSchemasRequest.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.filter != null && message.hasOwnProperty("filter")) + if (!$util.isString(message.filter)) + return "filter: string expected"; + return null; + }; + + /** + * Creates a ListRuntimeActionSchemasRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.connectors.v1.ListRuntimeActionSchemasRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.connectors.v1.ListRuntimeActionSchemasRequest} ListRuntimeActionSchemasRequest + */ + ListRuntimeActionSchemasRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.connectors.v1.ListRuntimeActionSchemasRequest) + return object; + var message = new $root.google.cloud.connectors.v1.ListRuntimeActionSchemasRequest(); + 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.filter != null) + message.filter = String(object.filter); + return message; + }; + + /** + * Creates a plain object from a ListRuntimeActionSchemasRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.connectors.v1.ListRuntimeActionSchemasRequest + * @static + * @param {google.cloud.connectors.v1.ListRuntimeActionSchemasRequest} message ListRuntimeActionSchemasRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListRuntimeActionSchemasRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.pageSize = 0; + object.pageToken = ""; + object.filter = ""; + } + 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.filter != null && message.hasOwnProperty("filter")) + object.filter = message.filter; + return object; + }; + + /** + * Converts this ListRuntimeActionSchemasRequest to JSON. + * @function toJSON + * @memberof google.cloud.connectors.v1.ListRuntimeActionSchemasRequest + * @instance + * @returns {Object.} JSON object + */ + ListRuntimeActionSchemasRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListRuntimeActionSchemasRequest + * @function getTypeUrl + * @memberof google.cloud.connectors.v1.ListRuntimeActionSchemasRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListRuntimeActionSchemasRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.connectors.v1.ListRuntimeActionSchemasRequest"; + }; + + return ListRuntimeActionSchemasRequest; + })(); + + v1.ListRuntimeActionSchemasResponse = (function() { + + /** + * Properties of a ListRuntimeActionSchemasResponse. + * @memberof google.cloud.connectors.v1 + * @interface IListRuntimeActionSchemasResponse + * @property {Array.|null} [runtimeActionSchemas] ListRuntimeActionSchemasResponse runtimeActionSchemas + * @property {string|null} [nextPageToken] ListRuntimeActionSchemasResponse nextPageToken + */ + + /** + * Constructs a new ListRuntimeActionSchemasResponse. + * @memberof google.cloud.connectors.v1 + * @classdesc Represents a ListRuntimeActionSchemasResponse. + * @implements IListRuntimeActionSchemasResponse + * @constructor + * @param {google.cloud.connectors.v1.IListRuntimeActionSchemasResponse=} [properties] Properties to set + */ + function ListRuntimeActionSchemasResponse(properties) { + this.runtimeActionSchemas = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListRuntimeActionSchemasResponse runtimeActionSchemas. + * @member {Array.} runtimeActionSchemas + * @memberof google.cloud.connectors.v1.ListRuntimeActionSchemasResponse + * @instance + */ + ListRuntimeActionSchemasResponse.prototype.runtimeActionSchemas = $util.emptyArray; + + /** + * ListRuntimeActionSchemasResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.cloud.connectors.v1.ListRuntimeActionSchemasResponse + * @instance + */ + ListRuntimeActionSchemasResponse.prototype.nextPageToken = ""; + + /** + * Creates a new ListRuntimeActionSchemasResponse instance using the specified properties. + * @function create + * @memberof google.cloud.connectors.v1.ListRuntimeActionSchemasResponse + * @static + * @param {google.cloud.connectors.v1.IListRuntimeActionSchemasResponse=} [properties] Properties to set + * @returns {google.cloud.connectors.v1.ListRuntimeActionSchemasResponse} ListRuntimeActionSchemasResponse instance + */ + ListRuntimeActionSchemasResponse.create = function create(properties) { + return new ListRuntimeActionSchemasResponse(properties); + }; + + /** + * Encodes the specified ListRuntimeActionSchemasResponse message. Does not implicitly {@link google.cloud.connectors.v1.ListRuntimeActionSchemasResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.connectors.v1.ListRuntimeActionSchemasResponse + * @static + * @param {google.cloud.connectors.v1.IListRuntimeActionSchemasResponse} message ListRuntimeActionSchemasResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListRuntimeActionSchemasResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.runtimeActionSchemas != null && message.runtimeActionSchemas.length) + for (var i = 0; i < message.runtimeActionSchemas.length; ++i) + $root.google.cloud.connectors.v1.RuntimeActionSchema.encode(message.runtimeActionSchemas[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 ListRuntimeActionSchemasResponse message, length delimited. Does not implicitly {@link google.cloud.connectors.v1.ListRuntimeActionSchemasResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.connectors.v1.ListRuntimeActionSchemasResponse + * @static + * @param {google.cloud.connectors.v1.IListRuntimeActionSchemasResponse} message ListRuntimeActionSchemasResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListRuntimeActionSchemasResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListRuntimeActionSchemasResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.connectors.v1.ListRuntimeActionSchemasResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.connectors.v1.ListRuntimeActionSchemasResponse} ListRuntimeActionSchemasResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListRuntimeActionSchemasResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.connectors.v1.ListRuntimeActionSchemasResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.runtimeActionSchemas && message.runtimeActionSchemas.length)) + message.runtimeActionSchemas = []; + message.runtimeActionSchemas.push($root.google.cloud.connectors.v1.RuntimeActionSchema.decode(reader, reader.uint32())); + break; + } + case 2: { + message.nextPageToken = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListRuntimeActionSchemasResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.connectors.v1.ListRuntimeActionSchemasResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.connectors.v1.ListRuntimeActionSchemasResponse} ListRuntimeActionSchemasResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListRuntimeActionSchemasResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListRuntimeActionSchemasResponse message. + * @function verify + * @memberof google.cloud.connectors.v1.ListRuntimeActionSchemasResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListRuntimeActionSchemasResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.runtimeActionSchemas != null && message.hasOwnProperty("runtimeActionSchemas")) { + if (!Array.isArray(message.runtimeActionSchemas)) + return "runtimeActionSchemas: array expected"; + for (var i = 0; i < message.runtimeActionSchemas.length; ++i) { + var error = $root.google.cloud.connectors.v1.RuntimeActionSchema.verify(message.runtimeActionSchemas[i]); + if (error) + return "runtimeActionSchemas." + error; + } + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + return null; + }; + + /** + * Creates a ListRuntimeActionSchemasResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.connectors.v1.ListRuntimeActionSchemasResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.connectors.v1.ListRuntimeActionSchemasResponse} ListRuntimeActionSchemasResponse + */ + ListRuntimeActionSchemasResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.connectors.v1.ListRuntimeActionSchemasResponse) + return object; + var message = new $root.google.cloud.connectors.v1.ListRuntimeActionSchemasResponse(); + if (object.runtimeActionSchemas) { + if (!Array.isArray(object.runtimeActionSchemas)) + throw TypeError(".google.cloud.connectors.v1.ListRuntimeActionSchemasResponse.runtimeActionSchemas: array expected"); + message.runtimeActionSchemas = []; + for (var i = 0; i < object.runtimeActionSchemas.length; ++i) { + if (typeof object.runtimeActionSchemas[i] !== "object") + throw TypeError(".google.cloud.connectors.v1.ListRuntimeActionSchemasResponse.runtimeActionSchemas: object expected"); + message.runtimeActionSchemas[i] = $root.google.cloud.connectors.v1.RuntimeActionSchema.fromObject(object.runtimeActionSchemas[i]); + } + } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + return message; + }; + + /** + * Creates a plain object from a ListRuntimeActionSchemasResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.connectors.v1.ListRuntimeActionSchemasResponse + * @static + * @param {google.cloud.connectors.v1.ListRuntimeActionSchemasResponse} message ListRuntimeActionSchemasResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListRuntimeActionSchemasResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.runtimeActionSchemas = []; + if (options.defaults) + object.nextPageToken = ""; + if (message.runtimeActionSchemas && message.runtimeActionSchemas.length) { + object.runtimeActionSchemas = []; + for (var j = 0; j < message.runtimeActionSchemas.length; ++j) + object.runtimeActionSchemas[j] = $root.google.cloud.connectors.v1.RuntimeActionSchema.toObject(message.runtimeActionSchemas[j], options); + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + object.nextPageToken = message.nextPageToken; + return object; + }; + + /** + * Converts this ListRuntimeActionSchemasResponse to JSON. + * @function toJSON + * @memberof google.cloud.connectors.v1.ListRuntimeActionSchemasResponse + * @instance + * @returns {Object.} JSON object + */ + ListRuntimeActionSchemasResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListRuntimeActionSchemasResponse + * @function getTypeUrl + * @memberof google.cloud.connectors.v1.ListRuntimeActionSchemasResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListRuntimeActionSchemasResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.connectors.v1.ListRuntimeActionSchemasResponse"; + }; + + return ListRuntimeActionSchemasResponse; + })(); + + v1.ConnectionStatus = (function() { + + /** + * Properties of a ConnectionStatus. + * @memberof google.cloud.connectors.v1 + * @interface IConnectionStatus + * @property {google.cloud.connectors.v1.ConnectionStatus.State|null} [state] ConnectionStatus state + * @property {string|null} [description] ConnectionStatus description + * @property {string|null} [status] ConnectionStatus status + */ + + /** + * Constructs a new ConnectionStatus. + * @memberof google.cloud.connectors.v1 + * @classdesc Represents a ConnectionStatus. + * @implements IConnectionStatus + * @constructor + * @param {google.cloud.connectors.v1.IConnectionStatus=} [properties] Properties to set + */ + function ConnectionStatus(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ConnectionStatus state. + * @member {google.cloud.connectors.v1.ConnectionStatus.State} state + * @memberof google.cloud.connectors.v1.ConnectionStatus + * @instance + */ + ConnectionStatus.prototype.state = 0; + + /** + * ConnectionStatus description. + * @member {string} description + * @memberof google.cloud.connectors.v1.ConnectionStatus + * @instance + */ + ConnectionStatus.prototype.description = ""; + + /** + * ConnectionStatus status. + * @member {string} status + * @memberof google.cloud.connectors.v1.ConnectionStatus + * @instance + */ + ConnectionStatus.prototype.status = ""; + + /** + * Creates a new ConnectionStatus instance using the specified properties. + * @function create + * @memberof google.cloud.connectors.v1.ConnectionStatus + * @static + * @param {google.cloud.connectors.v1.IConnectionStatus=} [properties] Properties to set + * @returns {google.cloud.connectors.v1.ConnectionStatus} ConnectionStatus instance + */ + ConnectionStatus.create = function create(properties) { + return new ConnectionStatus(properties); + }; + + /** + * Encodes the specified ConnectionStatus message. Does not implicitly {@link google.cloud.connectors.v1.ConnectionStatus.verify|verify} messages. + * @function encode + * @memberof google.cloud.connectors.v1.ConnectionStatus + * @static + * @param {google.cloud.connectors.v1.IConnectionStatus} message ConnectionStatus message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ConnectionStatus.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.state != null && Object.hasOwnProperty.call(message, "state")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.state); + if (message.description != null && Object.hasOwnProperty.call(message, "description")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.description); + if (message.status != null && Object.hasOwnProperty.call(message, "status")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.status); + return writer; + }; + + /** + * Encodes the specified ConnectionStatus message, length delimited. Does not implicitly {@link google.cloud.connectors.v1.ConnectionStatus.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.connectors.v1.ConnectionStatus + * @static + * @param {google.cloud.connectors.v1.IConnectionStatus} message ConnectionStatus message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ConnectionStatus.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ConnectionStatus message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.connectors.v1.ConnectionStatus + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.connectors.v1.ConnectionStatus} ConnectionStatus + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ConnectionStatus.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.connectors.v1.ConnectionStatus(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.state = reader.int32(); + break; + } + case 2: { + message.description = reader.string(); + break; + } + case 3: { + message.status = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ConnectionStatus message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.connectors.v1.ConnectionStatus + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.connectors.v1.ConnectionStatus} ConnectionStatus + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ConnectionStatus.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ConnectionStatus message. + * @function verify + * @memberof google.cloud.connectors.v1.ConnectionStatus + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ConnectionStatus.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.state != null && message.hasOwnProperty("state")) + switch (message.state) { + default: + return "state: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + case 5: + case 6: + case 7: + break; + } + if (message.description != null && message.hasOwnProperty("description")) + if (!$util.isString(message.description)) + return "description: string expected"; + if (message.status != null && message.hasOwnProperty("status")) + if (!$util.isString(message.status)) + return "status: string expected"; + return null; + }; + + /** + * Creates a ConnectionStatus message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.connectors.v1.ConnectionStatus + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.connectors.v1.ConnectionStatus} ConnectionStatus + */ + ConnectionStatus.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.connectors.v1.ConnectionStatus) + return object; + var message = new $root.google.cloud.connectors.v1.ConnectionStatus(); + 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 "CREATING": + case 1: + message.state = 1; + break; + case "ACTIVE": + case 2: + message.state = 2; + break; + case "INACTIVE": + case 3: + message.state = 3; + break; + case "DELETING": + case 4: + message.state = 4; + break; + case "UPDATING": + case 5: + message.state = 5; + break; + case "ERROR": + case 6: + message.state = 6; + break; + case "AUTHORIZATION_REQUIRED": + case 7: + message.state = 7; + break; + } + if (object.description != null) + message.description = String(object.description); + if (object.status != null) + message.status = String(object.status); + return message; + }; + + /** + * Creates a plain object from a ConnectionStatus message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.connectors.v1.ConnectionStatus + * @static + * @param {google.cloud.connectors.v1.ConnectionStatus} message ConnectionStatus + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ConnectionStatus.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.state = options.enums === String ? "STATE_UNSPECIFIED" : 0; + object.description = ""; + object.status = ""; + } + if (message.state != null && message.hasOwnProperty("state")) + object.state = options.enums === String ? $root.google.cloud.connectors.v1.ConnectionStatus.State[message.state] === undefined ? message.state : $root.google.cloud.connectors.v1.ConnectionStatus.State[message.state] : message.state; + if (message.description != null && message.hasOwnProperty("description")) + object.description = message.description; + if (message.status != null && message.hasOwnProperty("status")) + object.status = message.status; + return object; + }; + + /** + * Converts this ConnectionStatus to JSON. + * @function toJSON + * @memberof google.cloud.connectors.v1.ConnectionStatus + * @instance + * @returns {Object.} JSON object + */ + ConnectionStatus.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ConnectionStatus + * @function getTypeUrl + * @memberof google.cloud.connectors.v1.ConnectionStatus + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ConnectionStatus.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.connectors.v1.ConnectionStatus"; + }; + + /** + * State enum. + * @name google.cloud.connectors.v1.ConnectionStatus.State + * @enum {number} + * @property {number} STATE_UNSPECIFIED=0 STATE_UNSPECIFIED value + * @property {number} CREATING=1 CREATING value + * @property {number} ACTIVE=2 ACTIVE value + * @property {number} INACTIVE=3 INACTIVE value + * @property {number} DELETING=4 DELETING value + * @property {number} UPDATING=5 UPDATING value + * @property {number} ERROR=6 ERROR value + * @property {number} AUTHORIZATION_REQUIRED=7 AUTHORIZATION_REQUIRED value + */ + ConnectionStatus.State = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "STATE_UNSPECIFIED"] = 0; + values[valuesById[1] = "CREATING"] = 1; + values[valuesById[2] = "ACTIVE"] = 2; + values[valuesById[3] = "INACTIVE"] = 3; + values[valuesById[4] = "DELETING"] = 4; + values[valuesById[5] = "UPDATING"] = 5; + values[valuesById[6] = "ERROR"] = 6; + values[valuesById[7] = "AUTHORIZATION_REQUIRED"] = 7; + return values; + })(); + + return ConnectionStatus; + })(); + + /** + * DataType enum. + * @name google.cloud.connectors.v1.DataType + * @enum {number} + * @property {number} DATA_TYPE_UNSPECIFIED=0 DATA_TYPE_UNSPECIFIED value + * @property {number} DATA_TYPE_INT=1 DATA_TYPE_INT value + * @property {number} DATA_TYPE_SMALLINT=2 DATA_TYPE_SMALLINT value + * @property {number} DATA_TYPE_DOUBLE=3 DATA_TYPE_DOUBLE value + * @property {number} DATA_TYPE_DATE=4 DATA_TYPE_DATE value + * @property {number} DATA_TYPE_DATETIME=5 DATA_TYPE_DATETIME value + * @property {number} DATA_TYPE_TIME=6 DATA_TYPE_TIME value + * @property {number} DATA_TYPE_STRING=7 DATA_TYPE_STRING value + * @property {number} DATA_TYPE_LONG=8 DATA_TYPE_LONG value + * @property {number} DATA_TYPE_BOOLEAN=9 DATA_TYPE_BOOLEAN value + * @property {number} DATA_TYPE_DECIMAL=10 DATA_TYPE_DECIMAL value + * @property {number} DATA_TYPE_UUID=11 DATA_TYPE_UUID value + * @property {number} DATA_TYPE_BLOB=12 DATA_TYPE_BLOB value + * @property {number} DATA_TYPE_BIT=13 DATA_TYPE_BIT value + * @property {number} DATA_TYPE_TINYINT=14 DATA_TYPE_TINYINT value + * @property {number} DATA_TYPE_INTEGER=15 DATA_TYPE_INTEGER value + * @property {number} DATA_TYPE_BIGINT=16 DATA_TYPE_BIGINT value + * @property {number} DATA_TYPE_FLOAT=17 DATA_TYPE_FLOAT value + * @property {number} DATA_TYPE_REAL=18 DATA_TYPE_REAL value + * @property {number} DATA_TYPE_NUMERIC=19 DATA_TYPE_NUMERIC value + * @property {number} DATA_TYPE_CHAR=20 DATA_TYPE_CHAR value + * @property {number} DATA_TYPE_VARCHAR=21 DATA_TYPE_VARCHAR value + * @property {number} DATA_TYPE_LONGVARCHAR=22 DATA_TYPE_LONGVARCHAR value + * @property {number} DATA_TYPE_TIMESTAMP=23 DATA_TYPE_TIMESTAMP value + * @property {number} DATA_TYPE_NCHAR=24 DATA_TYPE_NCHAR value + * @property {number} DATA_TYPE_NVARCHAR=25 DATA_TYPE_NVARCHAR value + * @property {number} DATA_TYPE_LONGNVARCHAR=26 DATA_TYPE_LONGNVARCHAR value + * @property {number} DATA_TYPE_NULL=27 DATA_TYPE_NULL value + * @property {number} DATA_TYPE_OTHER=28 DATA_TYPE_OTHER value + * @property {number} DATA_TYPE_JAVA_OBJECT=29 DATA_TYPE_JAVA_OBJECT value + * @property {number} DATA_TYPE_DISTINCT=30 DATA_TYPE_DISTINCT value + * @property {number} DATA_TYPE_STRUCT=31 DATA_TYPE_STRUCT value + * @property {number} DATA_TYPE_ARRAY=32 DATA_TYPE_ARRAY value + * @property {number} DATA_TYPE_CLOB=33 DATA_TYPE_CLOB value + * @property {number} DATA_TYPE_REF=34 DATA_TYPE_REF value + * @property {number} DATA_TYPE_DATALINK=35 DATA_TYPE_DATALINK value + * @property {number} DATA_TYPE_ROWID=36 DATA_TYPE_ROWID value + * @property {number} DATA_TYPE_BINARY=37 DATA_TYPE_BINARY value + * @property {number} DATA_TYPE_VARBINARY=38 DATA_TYPE_VARBINARY value + * @property {number} DATA_TYPE_LONGVARBINARY=39 DATA_TYPE_LONGVARBINARY value + * @property {number} DATA_TYPE_NCLOB=40 DATA_TYPE_NCLOB value + * @property {number} DATA_TYPE_SQLXML=41 DATA_TYPE_SQLXML value + * @property {number} DATA_TYPE_REF_CURSOR=42 DATA_TYPE_REF_CURSOR value + * @property {number} DATA_TYPE_TIME_WITH_TIMEZONE=43 DATA_TYPE_TIME_WITH_TIMEZONE value + * @property {number} DATA_TYPE_TIMESTAMP_WITH_TIMEZONE=44 DATA_TYPE_TIMESTAMP_WITH_TIMEZONE value + */ + v1.DataType = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "DATA_TYPE_UNSPECIFIED"] = 0; + values[valuesById[1] = "DATA_TYPE_INT"] = 1; + values[valuesById[2] = "DATA_TYPE_SMALLINT"] = 2; + values[valuesById[3] = "DATA_TYPE_DOUBLE"] = 3; + values[valuesById[4] = "DATA_TYPE_DATE"] = 4; + values[valuesById[5] = "DATA_TYPE_DATETIME"] = 5; + values[valuesById[6] = "DATA_TYPE_TIME"] = 6; + values[valuesById[7] = "DATA_TYPE_STRING"] = 7; + values[valuesById[8] = "DATA_TYPE_LONG"] = 8; + values[valuesById[9] = "DATA_TYPE_BOOLEAN"] = 9; + values[valuesById[10] = "DATA_TYPE_DECIMAL"] = 10; + values[valuesById[11] = "DATA_TYPE_UUID"] = 11; + values[valuesById[12] = "DATA_TYPE_BLOB"] = 12; + values[valuesById[13] = "DATA_TYPE_BIT"] = 13; + values[valuesById[14] = "DATA_TYPE_TINYINT"] = 14; + values[valuesById[15] = "DATA_TYPE_INTEGER"] = 15; + values[valuesById[16] = "DATA_TYPE_BIGINT"] = 16; + values[valuesById[17] = "DATA_TYPE_FLOAT"] = 17; + values[valuesById[18] = "DATA_TYPE_REAL"] = 18; + values[valuesById[19] = "DATA_TYPE_NUMERIC"] = 19; + values[valuesById[20] = "DATA_TYPE_CHAR"] = 20; + values[valuesById[21] = "DATA_TYPE_VARCHAR"] = 21; + values[valuesById[22] = "DATA_TYPE_LONGVARCHAR"] = 22; + values[valuesById[23] = "DATA_TYPE_TIMESTAMP"] = 23; + values[valuesById[24] = "DATA_TYPE_NCHAR"] = 24; + values[valuesById[25] = "DATA_TYPE_NVARCHAR"] = 25; + values[valuesById[26] = "DATA_TYPE_LONGNVARCHAR"] = 26; + values[valuesById[27] = "DATA_TYPE_NULL"] = 27; + values[valuesById[28] = "DATA_TYPE_OTHER"] = 28; + values[valuesById[29] = "DATA_TYPE_JAVA_OBJECT"] = 29; + values[valuesById[30] = "DATA_TYPE_DISTINCT"] = 30; + values[valuesById[31] = "DATA_TYPE_STRUCT"] = 31; + values[valuesById[32] = "DATA_TYPE_ARRAY"] = 32; + values[valuesById[33] = "DATA_TYPE_CLOB"] = 33; + values[valuesById[34] = "DATA_TYPE_REF"] = 34; + values[valuesById[35] = "DATA_TYPE_DATALINK"] = 35; + values[valuesById[36] = "DATA_TYPE_ROWID"] = 36; + values[valuesById[37] = "DATA_TYPE_BINARY"] = 37; + values[valuesById[38] = "DATA_TYPE_VARBINARY"] = 38; + values[valuesById[39] = "DATA_TYPE_LONGVARBINARY"] = 39; + values[valuesById[40] = "DATA_TYPE_NCLOB"] = 40; + values[valuesById[41] = "DATA_TYPE_SQLXML"] = 41; + values[valuesById[42] = "DATA_TYPE_REF_CURSOR"] = 42; + values[valuesById[43] = "DATA_TYPE_TIME_WITH_TIMEZONE"] = 43; + values[valuesById[44] = "DATA_TYPE_TIMESTAMP_WITH_TIMEZONE"] = 44; + return values; + })(); + + /** + * ConnectionView enum. + * @name google.cloud.connectors.v1.ConnectionView + * @enum {number} + * @property {number} CONNECTION_VIEW_UNSPECIFIED=0 CONNECTION_VIEW_UNSPECIFIED value + * @property {number} BASIC=1 BASIC value + * @property {number} FULL=2 FULL value + */ + v1.ConnectionView = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "CONNECTION_VIEW_UNSPECIFIED"] = 0; + values[valuesById[1] = "BASIC"] = 1; + values[valuesById[2] = "FULL"] = 2; + return values; + })(); + + v1.DestinationConfig = (function() { + + /** + * Properties of a DestinationConfig. + * @memberof google.cloud.connectors.v1 + * @interface IDestinationConfig + * @property {string|null} [key] DestinationConfig key + * @property {Array.|null} [destinations] DestinationConfig destinations + */ + + /** + * Constructs a new DestinationConfig. + * @memberof google.cloud.connectors.v1 + * @classdesc Represents a DestinationConfig. + * @implements IDestinationConfig + * @constructor + * @param {google.cloud.connectors.v1.IDestinationConfig=} [properties] Properties to set + */ + function DestinationConfig(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]]; + } + + /** + * DestinationConfig key. + * @member {string} key + * @memberof google.cloud.connectors.v1.DestinationConfig + * @instance + */ + DestinationConfig.prototype.key = ""; + + /** + * DestinationConfig destinations. + * @member {Array.} destinations + * @memberof google.cloud.connectors.v1.DestinationConfig + * @instance + */ + DestinationConfig.prototype.destinations = $util.emptyArray; + + /** + * Creates a new DestinationConfig instance using the specified properties. + * @function create + * @memberof google.cloud.connectors.v1.DestinationConfig + * @static + * @param {google.cloud.connectors.v1.IDestinationConfig=} [properties] Properties to set + * @returns {google.cloud.connectors.v1.DestinationConfig} DestinationConfig instance + */ + DestinationConfig.create = function create(properties) { + return new DestinationConfig(properties); + }; + + /** + * Encodes the specified DestinationConfig message. Does not implicitly {@link google.cloud.connectors.v1.DestinationConfig.verify|verify} messages. + * @function encode + * @memberof google.cloud.connectors.v1.DestinationConfig + * @static + * @param {google.cloud.connectors.v1.IDestinationConfig} message DestinationConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DestinationConfig.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.key != null && Object.hasOwnProperty.call(message, "key")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.key); + if (message.destinations != null && message.destinations.length) + for (var i = 0; i < message.destinations.length; ++i) + $root.google.cloud.connectors.v1.Destination.encode(message.destinations[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified DestinationConfig message, length delimited. Does not implicitly {@link google.cloud.connectors.v1.DestinationConfig.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.connectors.v1.DestinationConfig + * @static + * @param {google.cloud.connectors.v1.IDestinationConfig} message DestinationConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DestinationConfig.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DestinationConfig message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.connectors.v1.DestinationConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.connectors.v1.DestinationConfig} DestinationConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DestinationConfig.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.connectors.v1.DestinationConfig(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.key = reader.string(); + break; + } + case 2: { + if (!(message.destinations && message.destinations.length)) + message.destinations = []; + message.destinations.push($root.google.cloud.connectors.v1.Destination.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DestinationConfig message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.connectors.v1.DestinationConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.connectors.v1.DestinationConfig} DestinationConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DestinationConfig.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DestinationConfig message. + * @function verify + * @memberof google.cloud.connectors.v1.DestinationConfig + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DestinationConfig.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.key != null && message.hasOwnProperty("key")) + if (!$util.isString(message.key)) + return "key: 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) { + var error = $root.google.cloud.connectors.v1.Destination.verify(message.destinations[i]); + if (error) + return "destinations." + error; + } + } + return null; + }; + + /** + * Creates a DestinationConfig message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.connectors.v1.DestinationConfig + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.connectors.v1.DestinationConfig} DestinationConfig + */ + DestinationConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.connectors.v1.DestinationConfig) + return object; + var message = new $root.google.cloud.connectors.v1.DestinationConfig(); + if (object.key != null) + message.key = String(object.key); + if (object.destinations) { + if (!Array.isArray(object.destinations)) + throw TypeError(".google.cloud.connectors.v1.DestinationConfig.destinations: array expected"); + message.destinations = []; + for (var i = 0; i < object.destinations.length; ++i) { + if (typeof object.destinations[i] !== "object") + throw TypeError(".google.cloud.connectors.v1.DestinationConfig.destinations: object expected"); + message.destinations[i] = $root.google.cloud.connectors.v1.Destination.fromObject(object.destinations[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a DestinationConfig message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.connectors.v1.DestinationConfig + * @static + * @param {google.cloud.connectors.v1.DestinationConfig} message DestinationConfig + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DestinationConfig.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.destinations = []; + if (options.defaults) + object.key = ""; + if (message.key != null && message.hasOwnProperty("key")) + object.key = message.key; + if (message.destinations && message.destinations.length) { + object.destinations = []; + for (var j = 0; j < message.destinations.length; ++j) + object.destinations[j] = $root.google.cloud.connectors.v1.Destination.toObject(message.destinations[j], options); + } + return object; + }; + + /** + * Converts this DestinationConfig to JSON. + * @function toJSON + * @memberof google.cloud.connectors.v1.DestinationConfig + * @instance + * @returns {Object.} JSON object + */ + DestinationConfig.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DestinationConfig + * @function getTypeUrl + * @memberof google.cloud.connectors.v1.DestinationConfig + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DestinationConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.connectors.v1.DestinationConfig"; + }; + + return DestinationConfig; + })(); + + v1.Destination = (function() { + + /** + * Properties of a Destination. + * @memberof google.cloud.connectors.v1 + * @interface IDestination + * @property {string|null} [serviceAttachment] Destination serviceAttachment + * @property {string|null} [host] Destination host + * @property {number|null} [port] Destination port + */ + + /** + * Constructs a new Destination. + * @memberof google.cloud.connectors.v1 + * @classdesc Represents a Destination. + * @implements IDestination + * @constructor + * @param {google.cloud.connectors.v1.IDestination=} [properties] Properties to set + */ + function Destination(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Destination serviceAttachment. + * @member {string|null|undefined} serviceAttachment + * @memberof google.cloud.connectors.v1.Destination + * @instance + */ + Destination.prototype.serviceAttachment = null; + + /** + * Destination host. + * @member {string|null|undefined} host + * @memberof google.cloud.connectors.v1.Destination + * @instance + */ + Destination.prototype.host = null; + + /** + * Destination port. + * @member {number} port + * @memberof google.cloud.connectors.v1.Destination + * @instance + */ + Destination.prototype.port = 0; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * Destination destination. + * @member {"serviceAttachment"|"host"|undefined} destination + * @memberof google.cloud.connectors.v1.Destination + * @instance + */ + Object.defineProperty(Destination.prototype, "destination", { + get: $util.oneOfGetter($oneOfFields = ["serviceAttachment", "host"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new Destination instance using the specified properties. + * @function create + * @memberof google.cloud.connectors.v1.Destination + * @static + * @param {google.cloud.connectors.v1.IDestination=} [properties] Properties to set + * @returns {google.cloud.connectors.v1.Destination} Destination instance + */ + Destination.create = function create(properties) { + return new Destination(properties); + }; + + /** + * Encodes the specified Destination message. Does not implicitly {@link google.cloud.connectors.v1.Destination.verify|verify} messages. + * @function encode + * @memberof google.cloud.connectors.v1.Destination + * @static + * @param {google.cloud.connectors.v1.IDestination} message Destination message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Destination.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.serviceAttachment != null && Object.hasOwnProperty.call(message, "serviceAttachment")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.serviceAttachment); + if (message.host != null && Object.hasOwnProperty.call(message, "host")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.host); + if (message.port != null && Object.hasOwnProperty.call(message, "port")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.port); + return writer; + }; + + /** + * Encodes the specified Destination message, length delimited. Does not implicitly {@link google.cloud.connectors.v1.Destination.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.connectors.v1.Destination + * @static + * @param {google.cloud.connectors.v1.IDestination} message Destination message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Destination.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Destination message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.connectors.v1.Destination + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.connectors.v1.Destination} Destination + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Destination.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.connectors.v1.Destination(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.serviceAttachment = reader.string(); + break; + } + case 2: { + message.host = reader.string(); + break; + } + case 3: { + message.port = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Destination message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.connectors.v1.Destination + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.connectors.v1.Destination} Destination + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Destination.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Destination message. + * @function verify + * @memberof google.cloud.connectors.v1.Destination + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Destination.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.serviceAttachment != null && message.hasOwnProperty("serviceAttachment")) { + properties.destination = 1; + if (!$util.isString(message.serviceAttachment)) + return "serviceAttachment: string expected"; + } + if (message.host != null && message.hasOwnProperty("host")) { + if (properties.destination === 1) + return "destination: multiple values"; + properties.destination = 1; + if (!$util.isString(message.host)) + return "host: string expected"; + } + if (message.port != null && message.hasOwnProperty("port")) + if (!$util.isInteger(message.port)) + return "port: integer expected"; + return null; + }; + + /** + * Creates a Destination message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.connectors.v1.Destination + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.connectors.v1.Destination} Destination + */ + Destination.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.connectors.v1.Destination) + return object; + var message = new $root.google.cloud.connectors.v1.Destination(); + if (object.serviceAttachment != null) + message.serviceAttachment = String(object.serviceAttachment); + if (object.host != null) + message.host = String(object.host); + if (object.port != null) + message.port = object.port | 0; + return message; + }; + + /** + * Creates a plain object from a Destination message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.connectors.v1.Destination + * @static + * @param {google.cloud.connectors.v1.Destination} message Destination + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Destination.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.port = 0; + if (message.serviceAttachment != null && message.hasOwnProperty("serviceAttachment")) { + object.serviceAttachment = message.serviceAttachment; + if (options.oneofs) + object.destination = "serviceAttachment"; + } + if (message.host != null && message.hasOwnProperty("host")) { + object.host = message.host; + if (options.oneofs) + object.destination = "host"; + } + if (message.port != null && message.hasOwnProperty("port")) + object.port = message.port; + return object; + }; + + /** + * Converts this Destination to JSON. + * @function toJSON + * @memberof google.cloud.connectors.v1.Destination + * @instance + * @returns {Object.} JSON object + */ + Destination.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Destination + * @function getTypeUrl + * @memberof google.cloud.connectors.v1.Destination + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Destination.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.connectors.v1.Destination"; + }; + + return Destination; + })(); + + v1.SslConfigTemplate = (function() { + + /** + * Properties of a SslConfigTemplate. + * @memberof google.cloud.connectors.v1 + * @interface ISslConfigTemplate + * @property {google.cloud.connectors.v1.SslType|null} [sslType] SslConfigTemplate sslType + * @property {boolean|null} [isTlsMandatory] SslConfigTemplate isTlsMandatory + * @property {Array.|null} [serverCertType] SslConfigTemplate serverCertType + * @property {Array.|null} [clientCertType] SslConfigTemplate clientCertType + * @property {Array.|null} [additionalVariables] SslConfigTemplate additionalVariables + */ + + /** + * Constructs a new SslConfigTemplate. + * @memberof google.cloud.connectors.v1 + * @classdesc Represents a SslConfigTemplate. + * @implements ISslConfigTemplate + * @constructor + * @param {google.cloud.connectors.v1.ISslConfigTemplate=} [properties] Properties to set + */ + function SslConfigTemplate(properties) { + this.serverCertType = []; + this.clientCertType = []; + this.additionalVariables = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * SslConfigTemplate sslType. + * @member {google.cloud.connectors.v1.SslType} sslType + * @memberof google.cloud.connectors.v1.SslConfigTemplate + * @instance + */ + SslConfigTemplate.prototype.sslType = 0; + + /** + * SslConfigTemplate isTlsMandatory. + * @member {boolean} isTlsMandatory + * @memberof google.cloud.connectors.v1.SslConfigTemplate + * @instance + */ + SslConfigTemplate.prototype.isTlsMandatory = false; + + /** + * SslConfigTemplate serverCertType. + * @member {Array.} serverCertType + * @memberof google.cloud.connectors.v1.SslConfigTemplate + * @instance + */ + SslConfigTemplate.prototype.serverCertType = $util.emptyArray; + + /** + * SslConfigTemplate clientCertType. + * @member {Array.} clientCertType + * @memberof google.cloud.connectors.v1.SslConfigTemplate + * @instance + */ + SslConfigTemplate.prototype.clientCertType = $util.emptyArray; + + /** + * SslConfigTemplate additionalVariables. + * @member {Array.} additionalVariables + * @memberof google.cloud.connectors.v1.SslConfigTemplate + * @instance + */ + SslConfigTemplate.prototype.additionalVariables = $util.emptyArray; + + /** + * Creates a new SslConfigTemplate instance using the specified properties. + * @function create + * @memberof google.cloud.connectors.v1.SslConfigTemplate + * @static + * @param {google.cloud.connectors.v1.ISslConfigTemplate=} [properties] Properties to set + * @returns {google.cloud.connectors.v1.SslConfigTemplate} SslConfigTemplate instance + */ + SslConfigTemplate.create = function create(properties) { + return new SslConfigTemplate(properties); + }; + + /** + * Encodes the specified SslConfigTemplate message. Does not implicitly {@link google.cloud.connectors.v1.SslConfigTemplate.verify|verify} messages. + * @function encode + * @memberof google.cloud.connectors.v1.SslConfigTemplate + * @static + * @param {google.cloud.connectors.v1.ISslConfigTemplate} message SslConfigTemplate message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SslConfigTemplate.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.sslType != null && Object.hasOwnProperty.call(message, "sslType")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.sslType); + if (message.isTlsMandatory != null && Object.hasOwnProperty.call(message, "isTlsMandatory")) + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.isTlsMandatory); + if (message.serverCertType != null && message.serverCertType.length) { + writer.uint32(/* id 3, wireType 2 =*/26).fork(); + for (var i = 0; i < message.serverCertType.length; ++i) + writer.int32(message.serverCertType[i]); + writer.ldelim(); + } + if (message.clientCertType != null && message.clientCertType.length) { + writer.uint32(/* id 4, wireType 2 =*/34).fork(); + for (var i = 0; i < message.clientCertType.length; ++i) + writer.int32(message.clientCertType[i]); + writer.ldelim(); + } + if (message.additionalVariables != null && message.additionalVariables.length) + for (var i = 0; i < message.additionalVariables.length; ++i) + $root.google.cloud.connectors.v1.ConfigVariableTemplate.encode(message.additionalVariables[i], writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified SslConfigTemplate message, length delimited. Does not implicitly {@link google.cloud.connectors.v1.SslConfigTemplate.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.connectors.v1.SslConfigTemplate + * @static + * @param {google.cloud.connectors.v1.ISslConfigTemplate} message SslConfigTemplate message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SslConfigTemplate.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a SslConfigTemplate message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.connectors.v1.SslConfigTemplate + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.connectors.v1.SslConfigTemplate} SslConfigTemplate + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SslConfigTemplate.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.connectors.v1.SslConfigTemplate(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.sslType = reader.int32(); + break; + } + case 2: { + message.isTlsMandatory = reader.bool(); + break; + } + case 3: { + if (!(message.serverCertType && message.serverCertType.length)) + message.serverCertType = []; + if ((tag & 7) === 2) { + var end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) + message.serverCertType.push(reader.int32()); + } else + message.serverCertType.push(reader.int32()); + break; + } + case 4: { + if (!(message.clientCertType && message.clientCertType.length)) + message.clientCertType = []; + if ((tag & 7) === 2) { + var end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) + message.clientCertType.push(reader.int32()); + } else + message.clientCertType.push(reader.int32()); + break; + } + case 5: { + if (!(message.additionalVariables && message.additionalVariables.length)) + message.additionalVariables = []; + message.additionalVariables.push($root.google.cloud.connectors.v1.ConfigVariableTemplate.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a SslConfigTemplate message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.connectors.v1.SslConfigTemplate + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.connectors.v1.SslConfigTemplate} SslConfigTemplate + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SslConfigTemplate.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a SslConfigTemplate message. + * @function verify + * @memberof google.cloud.connectors.v1.SslConfigTemplate + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + SslConfigTemplate.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.sslType != null && message.hasOwnProperty("sslType")) + switch (message.sslType) { + default: + return "sslType: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.isTlsMandatory != null && message.hasOwnProperty("isTlsMandatory")) + if (typeof message.isTlsMandatory !== "boolean") + return "isTlsMandatory: boolean expected"; + if (message.serverCertType != null && message.hasOwnProperty("serverCertType")) { + if (!Array.isArray(message.serverCertType)) + return "serverCertType: array expected"; + for (var i = 0; i < message.serverCertType.length; ++i) + switch (message.serverCertType[i]) { + default: + return "serverCertType: enum value[] expected"; + case 0: + case 1: + break; + } + } + if (message.clientCertType != null && message.hasOwnProperty("clientCertType")) { + if (!Array.isArray(message.clientCertType)) + return "clientCertType: array expected"; + for (var i = 0; i < message.clientCertType.length; ++i) + switch (message.clientCertType[i]) { + default: + return "clientCertType: enum value[] expected"; + case 0: + case 1: + break; + } + } + if (message.additionalVariables != null && message.hasOwnProperty("additionalVariables")) { + if (!Array.isArray(message.additionalVariables)) + return "additionalVariables: array expected"; + for (var i = 0; i < message.additionalVariables.length; ++i) { + var error = $root.google.cloud.connectors.v1.ConfigVariableTemplate.verify(message.additionalVariables[i]); + if (error) + return "additionalVariables." + error; + } + } + return null; + }; + + /** + * Creates a SslConfigTemplate message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.connectors.v1.SslConfigTemplate + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.connectors.v1.SslConfigTemplate} SslConfigTemplate + */ + SslConfigTemplate.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.connectors.v1.SslConfigTemplate) + return object; + var message = new $root.google.cloud.connectors.v1.SslConfigTemplate(); + switch (object.sslType) { + default: + if (typeof object.sslType === "number") { + message.sslType = object.sslType; + break; + } + break; + case "SSL_TYPE_UNSPECIFIED": + case 0: + message.sslType = 0; + break; + case "TLS": + case 1: + message.sslType = 1; + break; + case "MTLS": + case 2: + message.sslType = 2; + break; + } + if (object.isTlsMandatory != null) + message.isTlsMandatory = Boolean(object.isTlsMandatory); + if (object.serverCertType) { + if (!Array.isArray(object.serverCertType)) + throw TypeError(".google.cloud.connectors.v1.SslConfigTemplate.serverCertType: array expected"); + message.serverCertType = []; + for (var i = 0; i < object.serverCertType.length; ++i) + switch (object.serverCertType[i]) { + default: + if (typeof object.serverCertType[i] === "number") { + message.serverCertType[i] = object.serverCertType[i]; + break; + } + case "CERT_TYPE_UNSPECIFIED": + case 0: + message.serverCertType[i] = 0; + break; + case "PEM": + case 1: + message.serverCertType[i] = 1; + break; + } + } + if (object.clientCertType) { + if (!Array.isArray(object.clientCertType)) + throw TypeError(".google.cloud.connectors.v1.SslConfigTemplate.clientCertType: array expected"); + message.clientCertType = []; + for (var i = 0; i < object.clientCertType.length; ++i) + switch (object.clientCertType[i]) { + default: + if (typeof object.clientCertType[i] === "number") { + message.clientCertType[i] = object.clientCertType[i]; + break; + } + case "CERT_TYPE_UNSPECIFIED": + case 0: + message.clientCertType[i] = 0; + break; + case "PEM": + case 1: + message.clientCertType[i] = 1; + break; + } + } + if (object.additionalVariables) { + if (!Array.isArray(object.additionalVariables)) + throw TypeError(".google.cloud.connectors.v1.SslConfigTemplate.additionalVariables: array expected"); + message.additionalVariables = []; + for (var i = 0; i < object.additionalVariables.length; ++i) { + if (typeof object.additionalVariables[i] !== "object") + throw TypeError(".google.cloud.connectors.v1.SslConfigTemplate.additionalVariables: object expected"); + message.additionalVariables[i] = $root.google.cloud.connectors.v1.ConfigVariableTemplate.fromObject(object.additionalVariables[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a SslConfigTemplate message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.connectors.v1.SslConfigTemplate + * @static + * @param {google.cloud.connectors.v1.SslConfigTemplate} message SslConfigTemplate + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + SslConfigTemplate.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.serverCertType = []; + object.clientCertType = []; + object.additionalVariables = []; + } + if (options.defaults) { + object.sslType = options.enums === String ? "SSL_TYPE_UNSPECIFIED" : 0; + object.isTlsMandatory = false; + } + if (message.sslType != null && message.hasOwnProperty("sslType")) + object.sslType = options.enums === String ? $root.google.cloud.connectors.v1.SslType[message.sslType] === undefined ? message.sslType : $root.google.cloud.connectors.v1.SslType[message.sslType] : message.sslType; + if (message.isTlsMandatory != null && message.hasOwnProperty("isTlsMandatory")) + object.isTlsMandatory = message.isTlsMandatory; + if (message.serverCertType && message.serverCertType.length) { + object.serverCertType = []; + for (var j = 0; j < message.serverCertType.length; ++j) + object.serverCertType[j] = options.enums === String ? $root.google.cloud.connectors.v1.CertType[message.serverCertType[j]] === undefined ? message.serverCertType[j] : $root.google.cloud.connectors.v1.CertType[message.serverCertType[j]] : message.serverCertType[j]; + } + if (message.clientCertType && message.clientCertType.length) { + object.clientCertType = []; + for (var j = 0; j < message.clientCertType.length; ++j) + object.clientCertType[j] = options.enums === String ? $root.google.cloud.connectors.v1.CertType[message.clientCertType[j]] === undefined ? message.clientCertType[j] : $root.google.cloud.connectors.v1.CertType[message.clientCertType[j]] : message.clientCertType[j]; + } + if (message.additionalVariables && message.additionalVariables.length) { + object.additionalVariables = []; + for (var j = 0; j < message.additionalVariables.length; ++j) + object.additionalVariables[j] = $root.google.cloud.connectors.v1.ConfigVariableTemplate.toObject(message.additionalVariables[j], options); + } + return object; + }; + + /** + * Converts this SslConfigTemplate to JSON. + * @function toJSON + * @memberof google.cloud.connectors.v1.SslConfigTemplate + * @instance + * @returns {Object.} JSON object + */ + SslConfigTemplate.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for SslConfigTemplate + * @function getTypeUrl + * @memberof google.cloud.connectors.v1.SslConfigTemplate + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + SslConfigTemplate.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.connectors.v1.SslConfigTemplate"; + }; + + return SslConfigTemplate; + })(); + + v1.SslConfig = (function() { + + /** + * Properties of a SslConfig. + * @memberof google.cloud.connectors.v1 + * @interface ISslConfig + * @property {google.cloud.connectors.v1.SslType|null} [type] SslConfig type + * @property {google.cloud.connectors.v1.SslConfig.TrustModel|null} [trustModel] SslConfig trustModel + * @property {google.cloud.connectors.v1.ISecret|null} [privateServerCertificate] SslConfig privateServerCertificate + * @property {google.cloud.connectors.v1.ISecret|null} [clientCertificate] SslConfig clientCertificate + * @property {google.cloud.connectors.v1.ISecret|null} [clientPrivateKey] SslConfig clientPrivateKey + * @property {google.cloud.connectors.v1.ISecret|null} [clientPrivateKeyPass] SslConfig clientPrivateKeyPass + * @property {google.cloud.connectors.v1.CertType|null} [serverCertType] SslConfig serverCertType + * @property {google.cloud.connectors.v1.CertType|null} [clientCertType] SslConfig clientCertType + * @property {boolean|null} [useSsl] SslConfig useSsl + * @property {Array.|null} [additionalVariables] SslConfig additionalVariables + */ + + /** + * Constructs a new SslConfig. + * @memberof google.cloud.connectors.v1 + * @classdesc Represents a SslConfig. + * @implements ISslConfig + * @constructor + * @param {google.cloud.connectors.v1.ISslConfig=} [properties] Properties to set + */ + function SslConfig(properties) { + this.additionalVariables = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * SslConfig type. + * @member {google.cloud.connectors.v1.SslType} type + * @memberof google.cloud.connectors.v1.SslConfig + * @instance + */ + SslConfig.prototype.type = 0; + + /** + * SslConfig trustModel. + * @member {google.cloud.connectors.v1.SslConfig.TrustModel} trustModel + * @memberof google.cloud.connectors.v1.SslConfig + * @instance + */ + SslConfig.prototype.trustModel = 0; + + /** + * SslConfig privateServerCertificate. + * @member {google.cloud.connectors.v1.ISecret|null|undefined} privateServerCertificate + * @memberof google.cloud.connectors.v1.SslConfig + * @instance + */ + SslConfig.prototype.privateServerCertificate = null; + + /** + * SslConfig clientCertificate. + * @member {google.cloud.connectors.v1.ISecret|null|undefined} clientCertificate + * @memberof google.cloud.connectors.v1.SslConfig + * @instance + */ + SslConfig.prototype.clientCertificate = null; + + /** + * SslConfig clientPrivateKey. + * @member {google.cloud.connectors.v1.ISecret|null|undefined} clientPrivateKey + * @memberof google.cloud.connectors.v1.SslConfig + * @instance + */ + SslConfig.prototype.clientPrivateKey = null; + + /** + * SslConfig clientPrivateKeyPass. + * @member {google.cloud.connectors.v1.ISecret|null|undefined} clientPrivateKeyPass + * @memberof google.cloud.connectors.v1.SslConfig + * @instance + */ + SslConfig.prototype.clientPrivateKeyPass = null; + + /** + * SslConfig serverCertType. + * @member {google.cloud.connectors.v1.CertType} serverCertType + * @memberof google.cloud.connectors.v1.SslConfig + * @instance + */ + SslConfig.prototype.serverCertType = 0; + + /** + * SslConfig clientCertType. + * @member {google.cloud.connectors.v1.CertType} clientCertType + * @memberof google.cloud.connectors.v1.SslConfig + * @instance + */ + SslConfig.prototype.clientCertType = 0; + + /** + * SslConfig useSsl. + * @member {boolean} useSsl + * @memberof google.cloud.connectors.v1.SslConfig + * @instance + */ + SslConfig.prototype.useSsl = false; + + /** + * SslConfig additionalVariables. + * @member {Array.} additionalVariables + * @memberof google.cloud.connectors.v1.SslConfig + * @instance + */ + SslConfig.prototype.additionalVariables = $util.emptyArray; + + /** + * Creates a new SslConfig instance using the specified properties. + * @function create + * @memberof google.cloud.connectors.v1.SslConfig + * @static + * @param {google.cloud.connectors.v1.ISslConfig=} [properties] Properties to set + * @returns {google.cloud.connectors.v1.SslConfig} SslConfig instance + */ + SslConfig.create = function create(properties) { + return new SslConfig(properties); + }; + + /** + * Encodes the specified SslConfig message. Does not implicitly {@link google.cloud.connectors.v1.SslConfig.verify|verify} messages. + * @function encode + * @memberof google.cloud.connectors.v1.SslConfig + * @static + * @param {google.cloud.connectors.v1.ISslConfig} message SslConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SslConfig.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.type != null && Object.hasOwnProperty.call(message, "type")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.type); + if (message.trustModel != null && Object.hasOwnProperty.call(message, "trustModel")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.trustModel); + if (message.privateServerCertificate != null && Object.hasOwnProperty.call(message, "privateServerCertificate")) + $root.google.cloud.connectors.v1.Secret.encode(message.privateServerCertificate, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.clientCertificate != null && Object.hasOwnProperty.call(message, "clientCertificate")) + $root.google.cloud.connectors.v1.Secret.encode(message.clientCertificate, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.clientPrivateKey != null && Object.hasOwnProperty.call(message, "clientPrivateKey")) + $root.google.cloud.connectors.v1.Secret.encode(message.clientPrivateKey, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.clientPrivateKeyPass != null && Object.hasOwnProperty.call(message, "clientPrivateKeyPass")) + $root.google.cloud.connectors.v1.Secret.encode(message.clientPrivateKeyPass, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + if (message.serverCertType != null && Object.hasOwnProperty.call(message, "serverCertType")) + writer.uint32(/* id 7, wireType 0 =*/56).int32(message.serverCertType); + if (message.clientCertType != null && Object.hasOwnProperty.call(message, "clientCertType")) + writer.uint32(/* id 8, wireType 0 =*/64).int32(message.clientCertType); + if (message.useSsl != null && Object.hasOwnProperty.call(message, "useSsl")) + writer.uint32(/* id 9, wireType 0 =*/72).bool(message.useSsl); + if (message.additionalVariables != null && message.additionalVariables.length) + for (var i = 0; i < message.additionalVariables.length; ++i) + $root.google.cloud.connectors.v1.ConfigVariable.encode(message.additionalVariables[i], writer.uint32(/* id 10, wireType 2 =*/82).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified SslConfig message, length delimited. Does not implicitly {@link google.cloud.connectors.v1.SslConfig.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.connectors.v1.SslConfig + * @static + * @param {google.cloud.connectors.v1.ISslConfig} message SslConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SslConfig.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a SslConfig message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.connectors.v1.SslConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.connectors.v1.SslConfig} SslConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SslConfig.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.connectors.v1.SslConfig(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.type = reader.int32(); + break; + } + case 2: { + message.trustModel = reader.int32(); + break; + } + case 3: { + message.privateServerCertificate = $root.google.cloud.connectors.v1.Secret.decode(reader, reader.uint32()); + break; + } + case 4: { + message.clientCertificate = $root.google.cloud.connectors.v1.Secret.decode(reader, reader.uint32()); + break; + } + case 5: { + message.clientPrivateKey = $root.google.cloud.connectors.v1.Secret.decode(reader, reader.uint32()); + break; + } + case 6: { + message.clientPrivateKeyPass = $root.google.cloud.connectors.v1.Secret.decode(reader, reader.uint32()); + break; + } + case 7: { + message.serverCertType = reader.int32(); + break; + } + case 8: { + message.clientCertType = reader.int32(); + break; + } + case 9: { + message.useSsl = reader.bool(); + break; + } + case 10: { + if (!(message.additionalVariables && message.additionalVariables.length)) + message.additionalVariables = []; + message.additionalVariables.push($root.google.cloud.connectors.v1.ConfigVariable.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a SslConfig message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.connectors.v1.SslConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.connectors.v1.SslConfig} SslConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SslConfig.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a SslConfig message. + * @function verify + * @memberof google.cloud.connectors.v1.SslConfig + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + SslConfig.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.type != null && message.hasOwnProperty("type")) + switch (message.type) { + default: + return "type: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.trustModel != null && message.hasOwnProperty("trustModel")) + switch (message.trustModel) { + default: + return "trustModel: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.privateServerCertificate != null && message.hasOwnProperty("privateServerCertificate")) { + var error = $root.google.cloud.connectors.v1.Secret.verify(message.privateServerCertificate); + if (error) + return "privateServerCertificate." + error; + } + if (message.clientCertificate != null && message.hasOwnProperty("clientCertificate")) { + var error = $root.google.cloud.connectors.v1.Secret.verify(message.clientCertificate); + if (error) + return "clientCertificate." + error; + } + if (message.clientPrivateKey != null && message.hasOwnProperty("clientPrivateKey")) { + var error = $root.google.cloud.connectors.v1.Secret.verify(message.clientPrivateKey); + if (error) + return "clientPrivateKey." + error; + } + if (message.clientPrivateKeyPass != null && message.hasOwnProperty("clientPrivateKeyPass")) { + var error = $root.google.cloud.connectors.v1.Secret.verify(message.clientPrivateKeyPass); + if (error) + return "clientPrivateKeyPass." + error; + } + if (message.serverCertType != null && message.hasOwnProperty("serverCertType")) + switch (message.serverCertType) { + default: + return "serverCertType: enum value expected"; + case 0: + case 1: + break; + } + if (message.clientCertType != null && message.hasOwnProperty("clientCertType")) + switch (message.clientCertType) { + default: + return "clientCertType: enum value expected"; + case 0: + case 1: + break; + } + if (message.useSsl != null && message.hasOwnProperty("useSsl")) + if (typeof message.useSsl !== "boolean") + return "useSsl: boolean expected"; + if (message.additionalVariables != null && message.hasOwnProperty("additionalVariables")) { + if (!Array.isArray(message.additionalVariables)) + return "additionalVariables: array expected"; + for (var i = 0; i < message.additionalVariables.length; ++i) { + var error = $root.google.cloud.connectors.v1.ConfigVariable.verify(message.additionalVariables[i]); + if (error) + return "additionalVariables." + error; + } + } + return null; + }; + + /** + * Creates a SslConfig message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.connectors.v1.SslConfig + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.connectors.v1.SslConfig} SslConfig + */ + SslConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.connectors.v1.SslConfig) + return object; + var message = new $root.google.cloud.connectors.v1.SslConfig(); + switch (object.type) { + default: + if (typeof object.type === "number") { + message.type = object.type; + break; + } + break; + case "SSL_TYPE_UNSPECIFIED": + case 0: + message.type = 0; + break; + case "TLS": + case 1: + message.type = 1; + break; + case "MTLS": + case 2: + message.type = 2; + break; + } + switch (object.trustModel) { + default: + if (typeof object.trustModel === "number") { + message.trustModel = object.trustModel; + break; + } + break; + case "PUBLIC": + case 0: + message.trustModel = 0; + break; + case "PRIVATE": + case 1: + message.trustModel = 1; + break; + case "INSECURE": + case 2: + message.trustModel = 2; + break; + } + if (object.privateServerCertificate != null) { + if (typeof object.privateServerCertificate !== "object") + throw TypeError(".google.cloud.connectors.v1.SslConfig.privateServerCertificate: object expected"); + message.privateServerCertificate = $root.google.cloud.connectors.v1.Secret.fromObject(object.privateServerCertificate); + } + if (object.clientCertificate != null) { + if (typeof object.clientCertificate !== "object") + throw TypeError(".google.cloud.connectors.v1.SslConfig.clientCertificate: object expected"); + message.clientCertificate = $root.google.cloud.connectors.v1.Secret.fromObject(object.clientCertificate); + } + if (object.clientPrivateKey != null) { + if (typeof object.clientPrivateKey !== "object") + throw TypeError(".google.cloud.connectors.v1.SslConfig.clientPrivateKey: object expected"); + message.clientPrivateKey = $root.google.cloud.connectors.v1.Secret.fromObject(object.clientPrivateKey); + } + if (object.clientPrivateKeyPass != null) { + if (typeof object.clientPrivateKeyPass !== "object") + throw TypeError(".google.cloud.connectors.v1.SslConfig.clientPrivateKeyPass: object expected"); + message.clientPrivateKeyPass = $root.google.cloud.connectors.v1.Secret.fromObject(object.clientPrivateKeyPass); + } + switch (object.serverCertType) { + default: + if (typeof object.serverCertType === "number") { + message.serverCertType = object.serverCertType; + break; + } + break; + case "CERT_TYPE_UNSPECIFIED": + case 0: + message.serverCertType = 0; + break; + case "PEM": + case 1: + message.serverCertType = 1; + break; + } + switch (object.clientCertType) { + default: + if (typeof object.clientCertType === "number") { + message.clientCertType = object.clientCertType; + break; + } + break; + case "CERT_TYPE_UNSPECIFIED": + case 0: + message.clientCertType = 0; + break; + case "PEM": + case 1: + message.clientCertType = 1; + break; + } + if (object.useSsl != null) + message.useSsl = Boolean(object.useSsl); + if (object.additionalVariables) { + if (!Array.isArray(object.additionalVariables)) + throw TypeError(".google.cloud.connectors.v1.SslConfig.additionalVariables: array expected"); + message.additionalVariables = []; + for (var i = 0; i < object.additionalVariables.length; ++i) { + if (typeof object.additionalVariables[i] !== "object") + throw TypeError(".google.cloud.connectors.v1.SslConfig.additionalVariables: object expected"); + message.additionalVariables[i] = $root.google.cloud.connectors.v1.ConfigVariable.fromObject(object.additionalVariables[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a SslConfig message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.connectors.v1.SslConfig + * @static + * @param {google.cloud.connectors.v1.SslConfig} message SslConfig + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + SslConfig.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.additionalVariables = []; + if (options.defaults) { + object.type = options.enums === String ? "SSL_TYPE_UNSPECIFIED" : 0; + object.trustModel = options.enums === String ? "PUBLIC" : 0; + object.privateServerCertificate = null; + object.clientCertificate = null; + object.clientPrivateKey = null; + object.clientPrivateKeyPass = null; + object.serverCertType = options.enums === String ? "CERT_TYPE_UNSPECIFIED" : 0; + object.clientCertType = options.enums === String ? "CERT_TYPE_UNSPECIFIED" : 0; + object.useSsl = false; + } + if (message.type != null && message.hasOwnProperty("type")) + object.type = options.enums === String ? $root.google.cloud.connectors.v1.SslType[message.type] === undefined ? message.type : $root.google.cloud.connectors.v1.SslType[message.type] : message.type; + if (message.trustModel != null && message.hasOwnProperty("trustModel")) + object.trustModel = options.enums === String ? $root.google.cloud.connectors.v1.SslConfig.TrustModel[message.trustModel] === undefined ? message.trustModel : $root.google.cloud.connectors.v1.SslConfig.TrustModel[message.trustModel] : message.trustModel; + if (message.privateServerCertificate != null && message.hasOwnProperty("privateServerCertificate")) + object.privateServerCertificate = $root.google.cloud.connectors.v1.Secret.toObject(message.privateServerCertificate, options); + if (message.clientCertificate != null && message.hasOwnProperty("clientCertificate")) + object.clientCertificate = $root.google.cloud.connectors.v1.Secret.toObject(message.clientCertificate, options); + if (message.clientPrivateKey != null && message.hasOwnProperty("clientPrivateKey")) + object.clientPrivateKey = $root.google.cloud.connectors.v1.Secret.toObject(message.clientPrivateKey, options); + if (message.clientPrivateKeyPass != null && message.hasOwnProperty("clientPrivateKeyPass")) + object.clientPrivateKeyPass = $root.google.cloud.connectors.v1.Secret.toObject(message.clientPrivateKeyPass, options); + if (message.serverCertType != null && message.hasOwnProperty("serverCertType")) + object.serverCertType = options.enums === String ? $root.google.cloud.connectors.v1.CertType[message.serverCertType] === undefined ? message.serverCertType : $root.google.cloud.connectors.v1.CertType[message.serverCertType] : message.serverCertType; + if (message.clientCertType != null && message.hasOwnProperty("clientCertType")) + object.clientCertType = options.enums === String ? $root.google.cloud.connectors.v1.CertType[message.clientCertType] === undefined ? message.clientCertType : $root.google.cloud.connectors.v1.CertType[message.clientCertType] : message.clientCertType; + if (message.useSsl != null && message.hasOwnProperty("useSsl")) + object.useSsl = message.useSsl; + if (message.additionalVariables && message.additionalVariables.length) { + object.additionalVariables = []; + for (var j = 0; j < message.additionalVariables.length; ++j) + object.additionalVariables[j] = $root.google.cloud.connectors.v1.ConfigVariable.toObject(message.additionalVariables[j], options); + } + return object; + }; + + /** + * Converts this SslConfig to JSON. + * @function toJSON + * @memberof google.cloud.connectors.v1.SslConfig + * @instance + * @returns {Object.} JSON object + */ + SslConfig.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for SslConfig + * @function getTypeUrl + * @memberof google.cloud.connectors.v1.SslConfig + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + SslConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.connectors.v1.SslConfig"; + }; + + /** + * TrustModel enum. + * @name google.cloud.connectors.v1.SslConfig.TrustModel + * @enum {number} + * @property {number} PUBLIC=0 PUBLIC value + * @property {number} PRIVATE=1 PRIVATE value + * @property {number} INSECURE=2 INSECURE value + */ + SslConfig.TrustModel = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "PUBLIC"] = 0; + values[valuesById[1] = "PRIVATE"] = 1; + values[valuesById[2] = "INSECURE"] = 2; + return values; + })(); + + return SslConfig; + })(); + + /** + * SslType enum. + * @name google.cloud.connectors.v1.SslType + * @enum {number} + * @property {number} SSL_TYPE_UNSPECIFIED=0 SSL_TYPE_UNSPECIFIED value + * @property {number} TLS=1 TLS value + * @property {number} MTLS=2 MTLS value + */ + v1.SslType = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "SSL_TYPE_UNSPECIFIED"] = 0; + values[valuesById[1] = "TLS"] = 1; + values[valuesById[2] = "MTLS"] = 2; + return values; + })(); + + /** + * CertType enum. + * @name google.cloud.connectors.v1.CertType + * @enum {number} + * @property {number} CERT_TYPE_UNSPECIFIED=0 CERT_TYPE_UNSPECIFIED value + * @property {number} PEM=1 PEM value + */ + v1.CertType = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "CERT_TYPE_UNSPECIFIED"] = 0; + values[valuesById[1] = "PEM"] = 1; + return values; + })(); + + v1.Connector = (function() { + + /** + * Properties of a Connector. + * @memberof google.cloud.connectors.v1 + * @interface IConnector + * @property {string|null} [name] Connector name + * @property {google.protobuf.ITimestamp|null} [createTime] Connector createTime + * @property {google.protobuf.ITimestamp|null} [updateTime] Connector updateTime + * @property {Object.|null} [labels] Connector labels + * @property {string|null} [documentationUri] Connector documentationUri + * @property {string|null} [externalUri] Connector externalUri + * @property {string|null} [description] Connector description + * @property {string|null} [webAssetsLocation] Connector webAssetsLocation + * @property {string|null} [displayName] Connector displayName + * @property {google.cloud.connectors.v1.LaunchStage|null} [launchStage] Connector launchStage + */ + + /** + * Constructs a new Connector. + * @memberof google.cloud.connectors.v1 + * @classdesc Represents a Connector. + * @implements IConnector + * @constructor + * @param {google.cloud.connectors.v1.IConnector=} [properties] Properties to set + */ + function Connector(properties) { + this.labels = {}; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Connector name. + * @member {string} name + * @memberof google.cloud.connectors.v1.Connector + * @instance + */ + Connector.prototype.name = ""; + + /** + * Connector createTime. + * @member {google.protobuf.ITimestamp|null|undefined} createTime + * @memberof google.cloud.connectors.v1.Connector + * @instance + */ + Connector.prototype.createTime = null; + + /** + * Connector updateTime. + * @member {google.protobuf.ITimestamp|null|undefined} updateTime + * @memberof google.cloud.connectors.v1.Connector + * @instance + */ + Connector.prototype.updateTime = null; + + /** + * Connector labels. + * @member {Object.} labels + * @memberof google.cloud.connectors.v1.Connector + * @instance + */ + Connector.prototype.labels = $util.emptyObject; + + /** + * Connector documentationUri. + * @member {string} documentationUri + * @memberof google.cloud.connectors.v1.Connector + * @instance + */ + Connector.prototype.documentationUri = ""; + + /** + * Connector externalUri. + * @member {string} externalUri + * @memberof google.cloud.connectors.v1.Connector + * @instance + */ + Connector.prototype.externalUri = ""; + + /** + * Connector description. + * @member {string} description + * @memberof google.cloud.connectors.v1.Connector + * @instance + */ + Connector.prototype.description = ""; + + /** + * Connector webAssetsLocation. + * @member {string} webAssetsLocation + * @memberof google.cloud.connectors.v1.Connector + * @instance + */ + Connector.prototype.webAssetsLocation = ""; + + /** + * Connector displayName. + * @member {string} displayName + * @memberof google.cloud.connectors.v1.Connector + * @instance + */ + Connector.prototype.displayName = ""; + + /** + * Connector launchStage. + * @member {google.cloud.connectors.v1.LaunchStage} launchStage + * @memberof google.cloud.connectors.v1.Connector + * @instance + */ + Connector.prototype.launchStage = 0; + + /** + * Creates a new Connector instance using the specified properties. + * @function create + * @memberof google.cloud.connectors.v1.Connector + * @static + * @param {google.cloud.connectors.v1.IConnector=} [properties] Properties to set + * @returns {google.cloud.connectors.v1.Connector} Connector instance + */ + Connector.create = function create(properties) { + return new Connector(properties); + }; + + /** + * Encodes the specified Connector message. Does not implicitly {@link google.cloud.connectors.v1.Connector.verify|verify} messages. + * @function encode + * @memberof google.cloud.connectors.v1.Connector + * @static + * @param {google.cloud.connectors.v1.IConnector} message Connector message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Connector.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.createTime != null && Object.hasOwnProperty.call(message, "createTime")) + $root.google.protobuf.Timestamp.encode(message.createTime, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + 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(); + if (message.labels != null && Object.hasOwnProperty.call(message, "labels")) + for (var keys = Object.keys(message.labels), i = 0; i < keys.length; ++i) + writer.uint32(/* id 4, wireType 2 =*/34).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.labels[keys[i]]).ldelim(); + if (message.documentationUri != null && Object.hasOwnProperty.call(message, "documentationUri")) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.documentationUri); + if (message.externalUri != null && Object.hasOwnProperty.call(message, "externalUri")) + writer.uint32(/* id 7, wireType 2 =*/58).string(message.externalUri); + if (message.description != null && Object.hasOwnProperty.call(message, "description")) + writer.uint32(/* id 8, wireType 2 =*/66).string(message.description); + if (message.webAssetsLocation != null && Object.hasOwnProperty.call(message, "webAssetsLocation")) + writer.uint32(/* id 9, wireType 2 =*/74).string(message.webAssetsLocation); + if (message.displayName != null && Object.hasOwnProperty.call(message, "displayName")) + writer.uint32(/* id 10, wireType 2 =*/82).string(message.displayName); + if (message.launchStage != null && Object.hasOwnProperty.call(message, "launchStage")) + writer.uint32(/* id 11, wireType 0 =*/88).int32(message.launchStage); + return writer; + }; + + /** + * Encodes the specified Connector message, length delimited. Does not implicitly {@link google.cloud.connectors.v1.Connector.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.connectors.v1.Connector + * @static + * @param {google.cloud.connectors.v1.IConnector} message Connector message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Connector.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Connector message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.connectors.v1.Connector + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.connectors.v1.Connector} Connector + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Connector.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.connectors.v1.Connector(), key, value; + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.createTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 3: { + message.updateTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 4: { + if (message.labels === $util.emptyObject) + message.labels = {}; + 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.labels[key] = value; + break; + } + case 6: { + message.documentationUri = reader.string(); + break; + } + case 7: { + message.externalUri = reader.string(); + break; + } + case 8: { + message.description = reader.string(); + break; + } + case 9: { + message.webAssetsLocation = reader.string(); + break; + } + case 10: { + message.displayName = reader.string(); + break; + } + case 11: { + message.launchStage = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Connector message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.connectors.v1.Connector + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.connectors.v1.Connector} Connector + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Connector.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Connector message. + * @function verify + * @memberof google.cloud.connectors.v1.Connector + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Connector.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.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.labels != null && message.hasOwnProperty("labels")) { + if (!$util.isObject(message.labels)) + return "labels: object expected"; + var key = Object.keys(message.labels); + for (var i = 0; i < key.length; ++i) + if (!$util.isString(message.labels[key[i]])) + return "labels: string{k:string} expected"; + } + if (message.documentationUri != null && message.hasOwnProperty("documentationUri")) + if (!$util.isString(message.documentationUri)) + return "documentationUri: string expected"; + if (message.externalUri != null && message.hasOwnProperty("externalUri")) + if (!$util.isString(message.externalUri)) + return "externalUri: string expected"; + if (message.description != null && message.hasOwnProperty("description")) + if (!$util.isString(message.description)) + return "description: string expected"; + if (message.webAssetsLocation != null && message.hasOwnProperty("webAssetsLocation")) + if (!$util.isString(message.webAssetsLocation)) + return "webAssetsLocation: string expected"; + if (message.displayName != null && message.hasOwnProperty("displayName")) + if (!$util.isString(message.displayName)) + return "displayName: string expected"; + if (message.launchStage != null && message.hasOwnProperty("launchStage")) + switch (message.launchStage) { + default: + return "launchStage: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 5: + break; + } + return null; + }; + + /** + * Creates a Connector message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.connectors.v1.Connector + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.connectors.v1.Connector} Connector + */ + Connector.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.connectors.v1.Connector) + return object; + var message = new $root.google.cloud.connectors.v1.Connector(); + if (object.name != null) + message.name = String(object.name); + if (object.createTime != null) { + if (typeof object.createTime !== "object") + throw TypeError(".google.cloud.connectors.v1.Connector.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.connectors.v1.Connector.updateTime: object expected"); + message.updateTime = $root.google.protobuf.Timestamp.fromObject(object.updateTime); + } + if (object.labels) { + if (typeof object.labels !== "object") + throw TypeError(".google.cloud.connectors.v1.Connector.labels: object expected"); + message.labels = {}; + for (var keys = Object.keys(object.labels), i = 0; i < keys.length; ++i) + message.labels[keys[i]] = String(object.labels[keys[i]]); + } + if (object.documentationUri != null) + message.documentationUri = String(object.documentationUri); + if (object.externalUri != null) + message.externalUri = String(object.externalUri); + if (object.description != null) + message.description = String(object.description); + if (object.webAssetsLocation != null) + message.webAssetsLocation = String(object.webAssetsLocation); + if (object.displayName != null) + message.displayName = String(object.displayName); + 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 "PREVIEW": + case 1: + message.launchStage = 1; + break; + case "GA": + case 2: + message.launchStage = 2; + break; + case "DEPRECATED": + case 3: + message.launchStage = 3; + break; + case "PRIVATE_PREVIEW": + case 5: + message.launchStage = 5; + break; + } + return message; + }; + + /** + * Creates a plain object from a Connector message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.connectors.v1.Connector + * @static + * @param {google.cloud.connectors.v1.Connector} message Connector + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Connector.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.objects || options.defaults) + object.labels = {}; + if (options.defaults) { + object.name = ""; + object.createTime = null; + object.updateTime = null; + object.documentationUri = ""; + object.externalUri = ""; + object.description = ""; + object.webAssetsLocation = ""; + object.displayName = ""; + object.launchStage = options.enums === String ? "LAUNCH_STAGE_UNSPECIFIED" : 0; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + 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); + var keys2; + if (message.labels && (keys2 = Object.keys(message.labels)).length) { + object.labels = {}; + for (var j = 0; j < keys2.length; ++j) + object.labels[keys2[j]] = message.labels[keys2[j]]; + } + if (message.documentationUri != null && message.hasOwnProperty("documentationUri")) + object.documentationUri = message.documentationUri; + if (message.externalUri != null && message.hasOwnProperty("externalUri")) + object.externalUri = message.externalUri; + if (message.description != null && message.hasOwnProperty("description")) + object.description = message.description; + if (message.webAssetsLocation != null && message.hasOwnProperty("webAssetsLocation")) + object.webAssetsLocation = message.webAssetsLocation; + if (message.displayName != null && message.hasOwnProperty("displayName")) + object.displayName = message.displayName; + if (message.launchStage != null && message.hasOwnProperty("launchStage")) + object.launchStage = options.enums === String ? $root.google.cloud.connectors.v1.LaunchStage[message.launchStage] === undefined ? message.launchStage : $root.google.cloud.connectors.v1.LaunchStage[message.launchStage] : message.launchStage; + return object; + }; + + /** + * Converts this Connector to JSON. + * @function toJSON + * @memberof google.cloud.connectors.v1.Connector + * @instance + * @returns {Object.} JSON object + */ + Connector.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Connector + * @function getTypeUrl + * @memberof google.cloud.connectors.v1.Connector + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Connector.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.connectors.v1.Connector"; + }; + + return Connector; + })(); + + v1.GetConnectorRequest = (function() { + + /** + * Properties of a GetConnectorRequest. + * @memberof google.cloud.connectors.v1 + * @interface IGetConnectorRequest + * @property {string|null} [name] GetConnectorRequest name + */ + + /** + * Constructs a new GetConnectorRequest. + * @memberof google.cloud.connectors.v1 + * @classdesc Represents a GetConnectorRequest. + * @implements IGetConnectorRequest + * @constructor + * @param {google.cloud.connectors.v1.IGetConnectorRequest=} [properties] Properties to set + */ + function GetConnectorRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetConnectorRequest name. + * @member {string} name + * @memberof google.cloud.connectors.v1.GetConnectorRequest + * @instance + */ + GetConnectorRequest.prototype.name = ""; + + /** + * Creates a new GetConnectorRequest instance using the specified properties. + * @function create + * @memberof google.cloud.connectors.v1.GetConnectorRequest + * @static + * @param {google.cloud.connectors.v1.IGetConnectorRequest=} [properties] Properties to set + * @returns {google.cloud.connectors.v1.GetConnectorRequest} GetConnectorRequest instance + */ + GetConnectorRequest.create = function create(properties) { + return new GetConnectorRequest(properties); + }; + + /** + * Encodes the specified GetConnectorRequest message. Does not implicitly {@link google.cloud.connectors.v1.GetConnectorRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.connectors.v1.GetConnectorRequest + * @static + * @param {google.cloud.connectors.v1.IGetConnectorRequest} message GetConnectorRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetConnectorRequest.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 GetConnectorRequest message, length delimited. Does not implicitly {@link google.cloud.connectors.v1.GetConnectorRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.connectors.v1.GetConnectorRequest + * @static + * @param {google.cloud.connectors.v1.IGetConnectorRequest} message GetConnectorRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetConnectorRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetConnectorRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.connectors.v1.GetConnectorRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.connectors.v1.GetConnectorRequest} GetConnectorRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetConnectorRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.connectors.v1.GetConnectorRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetConnectorRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.connectors.v1.GetConnectorRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.connectors.v1.GetConnectorRequest} GetConnectorRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetConnectorRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetConnectorRequest message. + * @function verify + * @memberof google.cloud.connectors.v1.GetConnectorRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetConnectorRequest.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 GetConnectorRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.connectors.v1.GetConnectorRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.connectors.v1.GetConnectorRequest} GetConnectorRequest + */ + GetConnectorRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.connectors.v1.GetConnectorRequest) + return object; + var message = new $root.google.cloud.connectors.v1.GetConnectorRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a GetConnectorRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.connectors.v1.GetConnectorRequest + * @static + * @param {google.cloud.connectors.v1.GetConnectorRequest} message GetConnectorRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetConnectorRequest.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 GetConnectorRequest to JSON. + * @function toJSON + * @memberof google.cloud.connectors.v1.GetConnectorRequest + * @instance + * @returns {Object.} JSON object + */ + GetConnectorRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GetConnectorRequest + * @function getTypeUrl + * @memberof google.cloud.connectors.v1.GetConnectorRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GetConnectorRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.connectors.v1.GetConnectorRequest"; + }; + + return GetConnectorRequest; + })(); + + v1.ListConnectorsRequest = (function() { + + /** + * Properties of a ListConnectorsRequest. + * @memberof google.cloud.connectors.v1 + * @interface IListConnectorsRequest + * @property {string|null} [parent] ListConnectorsRequest parent + * @property {number|null} [pageSize] ListConnectorsRequest pageSize + * @property {string|null} [pageToken] ListConnectorsRequest pageToken + */ + + /** + * Constructs a new ListConnectorsRequest. + * @memberof google.cloud.connectors.v1 + * @classdesc Represents a ListConnectorsRequest. + * @implements IListConnectorsRequest + * @constructor + * @param {google.cloud.connectors.v1.IListConnectorsRequest=} [properties] Properties to set + */ + function ListConnectorsRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListConnectorsRequest parent. + * @member {string} parent + * @memberof google.cloud.connectors.v1.ListConnectorsRequest + * @instance + */ + ListConnectorsRequest.prototype.parent = ""; + + /** + * ListConnectorsRequest pageSize. + * @member {number} pageSize + * @memberof google.cloud.connectors.v1.ListConnectorsRequest + * @instance + */ + ListConnectorsRequest.prototype.pageSize = 0; + + /** + * ListConnectorsRequest pageToken. + * @member {string} pageToken + * @memberof google.cloud.connectors.v1.ListConnectorsRequest + * @instance + */ + ListConnectorsRequest.prototype.pageToken = ""; + + /** + * Creates a new ListConnectorsRequest instance using the specified properties. + * @function create + * @memberof google.cloud.connectors.v1.ListConnectorsRequest + * @static + * @param {google.cloud.connectors.v1.IListConnectorsRequest=} [properties] Properties to set + * @returns {google.cloud.connectors.v1.ListConnectorsRequest} ListConnectorsRequest instance + */ + ListConnectorsRequest.create = function create(properties) { + return new ListConnectorsRequest(properties); + }; + + /** + * Encodes the specified ListConnectorsRequest message. Does not implicitly {@link google.cloud.connectors.v1.ListConnectorsRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.connectors.v1.ListConnectorsRequest + * @static + * @param {google.cloud.connectors.v1.IListConnectorsRequest} message ListConnectorsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListConnectorsRequest.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 ListConnectorsRequest message, length delimited. Does not implicitly {@link google.cloud.connectors.v1.ListConnectorsRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.connectors.v1.ListConnectorsRequest + * @static + * @param {google.cloud.connectors.v1.IListConnectorsRequest} message ListConnectorsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListConnectorsRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListConnectorsRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.connectors.v1.ListConnectorsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.connectors.v1.ListConnectorsRequest} ListConnectorsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListConnectorsRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.connectors.v1.ListConnectorsRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + 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 ListConnectorsRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.connectors.v1.ListConnectorsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.connectors.v1.ListConnectorsRequest} ListConnectorsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListConnectorsRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListConnectorsRequest message. + * @function verify + * @memberof google.cloud.connectors.v1.ListConnectorsRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListConnectorsRequest.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 ListConnectorsRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.connectors.v1.ListConnectorsRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.connectors.v1.ListConnectorsRequest} ListConnectorsRequest + */ + ListConnectorsRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.connectors.v1.ListConnectorsRequest) + return object; + var message = new $root.google.cloud.connectors.v1.ListConnectorsRequest(); + 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 ListConnectorsRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.connectors.v1.ListConnectorsRequest + * @static + * @param {google.cloud.connectors.v1.ListConnectorsRequest} message ListConnectorsRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListConnectorsRequest.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 ListConnectorsRequest to JSON. + * @function toJSON + * @memberof google.cloud.connectors.v1.ListConnectorsRequest + * @instance + * @returns {Object.} JSON object + */ + ListConnectorsRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListConnectorsRequest + * @function getTypeUrl + * @memberof google.cloud.connectors.v1.ListConnectorsRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListConnectorsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.connectors.v1.ListConnectorsRequest"; + }; + + return ListConnectorsRequest; + })(); + + v1.ListConnectorsResponse = (function() { + + /** + * Properties of a ListConnectorsResponse. + * @memberof google.cloud.connectors.v1 + * @interface IListConnectorsResponse + * @property {Array.|null} [connectors] ListConnectorsResponse connectors + * @property {string|null} [nextPageToken] ListConnectorsResponse nextPageToken + * @property {Array.|null} [unreachable] ListConnectorsResponse unreachable + */ + + /** + * Constructs a new ListConnectorsResponse. + * @memberof google.cloud.connectors.v1 + * @classdesc Represents a ListConnectorsResponse. + * @implements IListConnectorsResponse + * @constructor + * @param {google.cloud.connectors.v1.IListConnectorsResponse=} [properties] Properties to set + */ + function ListConnectorsResponse(properties) { + this.connectors = []; + this.unreachable = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListConnectorsResponse connectors. + * @member {Array.} connectors + * @memberof google.cloud.connectors.v1.ListConnectorsResponse + * @instance + */ + ListConnectorsResponse.prototype.connectors = $util.emptyArray; + + /** + * ListConnectorsResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.cloud.connectors.v1.ListConnectorsResponse + * @instance + */ + ListConnectorsResponse.prototype.nextPageToken = ""; + + /** + * ListConnectorsResponse unreachable. + * @member {Array.} unreachable + * @memberof google.cloud.connectors.v1.ListConnectorsResponse + * @instance + */ + ListConnectorsResponse.prototype.unreachable = $util.emptyArray; + + /** + * Creates a new ListConnectorsResponse instance using the specified properties. + * @function create + * @memberof google.cloud.connectors.v1.ListConnectorsResponse + * @static + * @param {google.cloud.connectors.v1.IListConnectorsResponse=} [properties] Properties to set + * @returns {google.cloud.connectors.v1.ListConnectorsResponse} ListConnectorsResponse instance + */ + ListConnectorsResponse.create = function create(properties) { + return new ListConnectorsResponse(properties); + }; + + /** + * Encodes the specified ListConnectorsResponse message. Does not implicitly {@link google.cloud.connectors.v1.ListConnectorsResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.connectors.v1.ListConnectorsResponse + * @static + * @param {google.cloud.connectors.v1.IListConnectorsResponse} message ListConnectorsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListConnectorsResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.connectors != null && message.connectors.length) + for (var i = 0; i < message.connectors.length; ++i) + $root.google.cloud.connectors.v1.Connector.encode(message.connectors[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); + if (message.unreachable != null && message.unreachable.length) + for (var i = 0; i < message.unreachable.length; ++i) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.unreachable[i]); + return writer; + }; + + /** + * Encodes the specified ListConnectorsResponse message, length delimited. Does not implicitly {@link google.cloud.connectors.v1.ListConnectorsResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.connectors.v1.ListConnectorsResponse + * @static + * @param {google.cloud.connectors.v1.IListConnectorsResponse} message ListConnectorsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListConnectorsResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListConnectorsResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.connectors.v1.ListConnectorsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.connectors.v1.ListConnectorsResponse} ListConnectorsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListConnectorsResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.connectors.v1.ListConnectorsResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.connectors && message.connectors.length)) + message.connectors = []; + message.connectors.push($root.google.cloud.connectors.v1.Connector.decode(reader, reader.uint32())); + break; + } + case 2: { + message.nextPageToken = reader.string(); + break; + } + case 3: { + if (!(message.unreachable && message.unreachable.length)) + message.unreachable = []; + message.unreachable.push(reader.string()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListConnectorsResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.connectors.v1.ListConnectorsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.connectors.v1.ListConnectorsResponse} ListConnectorsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListConnectorsResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListConnectorsResponse message. + * @function verify + * @memberof google.cloud.connectors.v1.ListConnectorsResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListConnectorsResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.connectors != null && message.hasOwnProperty("connectors")) { + if (!Array.isArray(message.connectors)) + return "connectors: array expected"; + for (var i = 0; i < message.connectors.length; ++i) { + var error = $root.google.cloud.connectors.v1.Connector.verify(message.connectors[i]); + if (error) + return "connectors." + error; + } + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + if (message.unreachable != null && message.hasOwnProperty("unreachable")) { + if (!Array.isArray(message.unreachable)) + return "unreachable: array expected"; + for (var i = 0; i < message.unreachable.length; ++i) + if (!$util.isString(message.unreachable[i])) + return "unreachable: string[] expected"; + } + return null; + }; + + /** + * Creates a ListConnectorsResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.connectors.v1.ListConnectorsResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.connectors.v1.ListConnectorsResponse} ListConnectorsResponse + */ + ListConnectorsResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.connectors.v1.ListConnectorsResponse) + return object; + var message = new $root.google.cloud.connectors.v1.ListConnectorsResponse(); + if (object.connectors) { + if (!Array.isArray(object.connectors)) + throw TypeError(".google.cloud.connectors.v1.ListConnectorsResponse.connectors: array expected"); + message.connectors = []; + for (var i = 0; i < object.connectors.length; ++i) { + if (typeof object.connectors[i] !== "object") + throw TypeError(".google.cloud.connectors.v1.ListConnectorsResponse.connectors: object expected"); + message.connectors[i] = $root.google.cloud.connectors.v1.Connector.fromObject(object.connectors[i]); + } + } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + if (object.unreachable) { + if (!Array.isArray(object.unreachable)) + throw TypeError(".google.cloud.connectors.v1.ListConnectorsResponse.unreachable: array expected"); + message.unreachable = []; + for (var i = 0; i < object.unreachable.length; ++i) + message.unreachable[i] = String(object.unreachable[i]); + } + return message; + }; + + /** + * Creates a plain object from a ListConnectorsResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.connectors.v1.ListConnectorsResponse + * @static + * @param {google.cloud.connectors.v1.ListConnectorsResponse} message ListConnectorsResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListConnectorsResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.connectors = []; + object.unreachable = []; + } + if (options.defaults) + object.nextPageToken = ""; + if (message.connectors && message.connectors.length) { + object.connectors = []; + for (var j = 0; j < message.connectors.length; ++j) + object.connectors[j] = $root.google.cloud.connectors.v1.Connector.toObject(message.connectors[j], options); + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + object.nextPageToken = message.nextPageToken; + if (message.unreachable && message.unreachable.length) { + object.unreachable = []; + for (var j = 0; j < message.unreachable.length; ++j) + object.unreachable[j] = message.unreachable[j]; + } + return object; + }; + + /** + * Converts this ListConnectorsResponse to JSON. + * @function toJSON + * @memberof google.cloud.connectors.v1.ListConnectorsResponse + * @instance + * @returns {Object.} JSON object + */ + ListConnectorsResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListConnectorsResponse + * @function getTypeUrl + * @memberof google.cloud.connectors.v1.ListConnectorsResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListConnectorsResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.connectors.v1.ListConnectorsResponse"; + }; + + return ListConnectorsResponse; + })(); + + v1.ConnectorVersion = (function() { + + /** + * Properties of a ConnectorVersion. + * @memberof google.cloud.connectors.v1 + * @interface IConnectorVersion + * @property {string|null} [name] ConnectorVersion name + * @property {google.protobuf.ITimestamp|null} [createTime] ConnectorVersion createTime + * @property {google.protobuf.ITimestamp|null} [updateTime] ConnectorVersion updateTime + * @property {Object.|null} [labels] ConnectorVersion labels + * @property {google.cloud.connectors.v1.LaunchStage|null} [launchStage] ConnectorVersion launchStage + * @property {string|null} [releaseVersion] ConnectorVersion releaseVersion + * @property {Array.|null} [authConfigTemplates] ConnectorVersion authConfigTemplates + * @property {Array.|null} [configVariableTemplates] ConnectorVersion configVariableTemplates + * @property {google.cloud.connectors.v1.ISupportedRuntimeFeatures|null} [supportedRuntimeFeatures] ConnectorVersion supportedRuntimeFeatures + * @property {string|null} [displayName] ConnectorVersion displayName + * @property {google.cloud.connectors.v1.IEgressControlConfig|null} [egressControlConfig] ConnectorVersion egressControlConfig + * @property {Array.|null} [roleGrants] ConnectorVersion roleGrants + * @property {google.cloud.connectors.v1.IRoleGrant|null} [roleGrant] ConnectorVersion roleGrant + * @property {google.cloud.connectors.v1.ISslConfigTemplate|null} [sslConfigTemplate] ConnectorVersion sslConfigTemplate + */ + + /** + * Constructs a new ConnectorVersion. + * @memberof google.cloud.connectors.v1 + * @classdesc Represents a ConnectorVersion. + * @implements IConnectorVersion + * @constructor + * @param {google.cloud.connectors.v1.IConnectorVersion=} [properties] Properties to set + */ + function ConnectorVersion(properties) { + this.labels = {}; + this.authConfigTemplates = []; + this.configVariableTemplates = []; + this.roleGrants = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ConnectorVersion name. + * @member {string} name + * @memberof google.cloud.connectors.v1.ConnectorVersion + * @instance + */ + ConnectorVersion.prototype.name = ""; + + /** + * ConnectorVersion createTime. + * @member {google.protobuf.ITimestamp|null|undefined} createTime + * @memberof google.cloud.connectors.v1.ConnectorVersion + * @instance + */ + ConnectorVersion.prototype.createTime = null; + + /** + * ConnectorVersion updateTime. + * @member {google.protobuf.ITimestamp|null|undefined} updateTime + * @memberof google.cloud.connectors.v1.ConnectorVersion + * @instance + */ + ConnectorVersion.prototype.updateTime = null; + + /** + * ConnectorVersion labels. + * @member {Object.} labels + * @memberof google.cloud.connectors.v1.ConnectorVersion + * @instance + */ + ConnectorVersion.prototype.labels = $util.emptyObject; + + /** + * ConnectorVersion launchStage. + * @member {google.cloud.connectors.v1.LaunchStage} launchStage + * @memberof google.cloud.connectors.v1.ConnectorVersion + * @instance + */ + ConnectorVersion.prototype.launchStage = 0; + + /** + * ConnectorVersion releaseVersion. + * @member {string} releaseVersion + * @memberof google.cloud.connectors.v1.ConnectorVersion + * @instance + */ + ConnectorVersion.prototype.releaseVersion = ""; + + /** + * ConnectorVersion authConfigTemplates. + * @member {Array.} authConfigTemplates + * @memberof google.cloud.connectors.v1.ConnectorVersion + * @instance + */ + ConnectorVersion.prototype.authConfigTemplates = $util.emptyArray; + + /** + * ConnectorVersion configVariableTemplates. + * @member {Array.} configVariableTemplates + * @memberof google.cloud.connectors.v1.ConnectorVersion + * @instance + */ + ConnectorVersion.prototype.configVariableTemplates = $util.emptyArray; + + /** + * ConnectorVersion supportedRuntimeFeatures. + * @member {google.cloud.connectors.v1.ISupportedRuntimeFeatures|null|undefined} supportedRuntimeFeatures + * @memberof google.cloud.connectors.v1.ConnectorVersion + * @instance + */ + ConnectorVersion.prototype.supportedRuntimeFeatures = null; + + /** + * ConnectorVersion displayName. + * @member {string} displayName + * @memberof google.cloud.connectors.v1.ConnectorVersion + * @instance + */ + ConnectorVersion.prototype.displayName = ""; + + /** + * ConnectorVersion egressControlConfig. + * @member {google.cloud.connectors.v1.IEgressControlConfig|null|undefined} egressControlConfig + * @memberof google.cloud.connectors.v1.ConnectorVersion + * @instance + */ + ConnectorVersion.prototype.egressControlConfig = null; + + /** + * ConnectorVersion roleGrants. + * @member {Array.} roleGrants + * @memberof google.cloud.connectors.v1.ConnectorVersion + * @instance + */ + ConnectorVersion.prototype.roleGrants = $util.emptyArray; + + /** + * ConnectorVersion roleGrant. + * @member {google.cloud.connectors.v1.IRoleGrant|null|undefined} roleGrant + * @memberof google.cloud.connectors.v1.ConnectorVersion + * @instance + */ + ConnectorVersion.prototype.roleGrant = null; + + /** + * ConnectorVersion sslConfigTemplate. + * @member {google.cloud.connectors.v1.ISslConfigTemplate|null|undefined} sslConfigTemplate + * @memberof google.cloud.connectors.v1.ConnectorVersion + * @instance + */ + ConnectorVersion.prototype.sslConfigTemplate = null; + + /** + * Creates a new ConnectorVersion instance using the specified properties. + * @function create + * @memberof google.cloud.connectors.v1.ConnectorVersion + * @static + * @param {google.cloud.connectors.v1.IConnectorVersion=} [properties] Properties to set + * @returns {google.cloud.connectors.v1.ConnectorVersion} ConnectorVersion instance + */ + ConnectorVersion.create = function create(properties) { + return new ConnectorVersion(properties); + }; + + /** + * Encodes the specified ConnectorVersion message. Does not implicitly {@link google.cloud.connectors.v1.ConnectorVersion.verify|verify} messages. + * @function encode + * @memberof google.cloud.connectors.v1.ConnectorVersion + * @static + * @param {google.cloud.connectors.v1.IConnectorVersion} message ConnectorVersion message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ConnectorVersion.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.createTime != null && Object.hasOwnProperty.call(message, "createTime")) + $root.google.protobuf.Timestamp.encode(message.createTime, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + 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(); + if (message.labels != null && Object.hasOwnProperty.call(message, "labels")) + for (var keys = Object.keys(message.labels), i = 0; i < keys.length; ++i) + writer.uint32(/* id 4, wireType 2 =*/34).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.labels[keys[i]]).ldelim(); + if (message.launchStage != null && Object.hasOwnProperty.call(message, "launchStage")) + writer.uint32(/* id 6, wireType 0 =*/48).int32(message.launchStage); + if (message.releaseVersion != null && Object.hasOwnProperty.call(message, "releaseVersion")) + writer.uint32(/* id 7, wireType 2 =*/58).string(message.releaseVersion); + if (message.authConfigTemplates != null && message.authConfigTemplates.length) + for (var i = 0; i < message.authConfigTemplates.length; ++i) + $root.google.cloud.connectors.v1.AuthConfigTemplate.encode(message.authConfigTemplates[i], writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); + if (message.configVariableTemplates != null && message.configVariableTemplates.length) + for (var i = 0; i < message.configVariableTemplates.length; ++i) + $root.google.cloud.connectors.v1.ConfigVariableTemplate.encode(message.configVariableTemplates[i], writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim(); + if (message.supportedRuntimeFeatures != null && Object.hasOwnProperty.call(message, "supportedRuntimeFeatures")) + $root.google.cloud.connectors.v1.SupportedRuntimeFeatures.encode(message.supportedRuntimeFeatures, writer.uint32(/* id 10, wireType 2 =*/82).fork()).ldelim(); + if (message.displayName != null && Object.hasOwnProperty.call(message, "displayName")) + writer.uint32(/* id 11, wireType 2 =*/90).string(message.displayName); + if (message.egressControlConfig != null && Object.hasOwnProperty.call(message, "egressControlConfig")) + $root.google.cloud.connectors.v1.EgressControlConfig.encode(message.egressControlConfig, writer.uint32(/* id 12, wireType 2 =*/98).fork()).ldelim(); + if (message.roleGrants != null && message.roleGrants.length) + for (var i = 0; i < message.roleGrants.length; ++i) + $root.google.cloud.connectors.v1.RoleGrant.encode(message.roleGrants[i], writer.uint32(/* id 14, wireType 2 =*/114).fork()).ldelim(); + if (message.roleGrant != null && Object.hasOwnProperty.call(message, "roleGrant")) + $root.google.cloud.connectors.v1.RoleGrant.encode(message.roleGrant, writer.uint32(/* id 15, wireType 2 =*/122).fork()).ldelim(); + if (message.sslConfigTemplate != null && Object.hasOwnProperty.call(message, "sslConfigTemplate")) + $root.google.cloud.connectors.v1.SslConfigTemplate.encode(message.sslConfigTemplate, writer.uint32(/* id 17, wireType 2 =*/138).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified ConnectorVersion message, length delimited. Does not implicitly {@link google.cloud.connectors.v1.ConnectorVersion.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.connectors.v1.ConnectorVersion + * @static + * @param {google.cloud.connectors.v1.IConnectorVersion} message ConnectorVersion message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ConnectorVersion.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ConnectorVersion message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.connectors.v1.ConnectorVersion + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.connectors.v1.ConnectorVersion} ConnectorVersion + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ConnectorVersion.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.connectors.v1.ConnectorVersion(), key, value; + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.createTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 3: { + message.updateTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 4: { + if (message.labels === $util.emptyObject) + message.labels = {}; + 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.labels[key] = value; + break; + } + case 6: { + message.launchStage = reader.int32(); + break; + } + case 7: { + message.releaseVersion = reader.string(); + break; + } + case 8: { + if (!(message.authConfigTemplates && message.authConfigTemplates.length)) + message.authConfigTemplates = []; + message.authConfigTemplates.push($root.google.cloud.connectors.v1.AuthConfigTemplate.decode(reader, reader.uint32())); + break; + } + case 9: { + if (!(message.configVariableTemplates && message.configVariableTemplates.length)) + message.configVariableTemplates = []; + message.configVariableTemplates.push($root.google.cloud.connectors.v1.ConfigVariableTemplate.decode(reader, reader.uint32())); + break; + } + case 10: { + message.supportedRuntimeFeatures = $root.google.cloud.connectors.v1.SupportedRuntimeFeatures.decode(reader, reader.uint32()); + break; + } + case 11: { + message.displayName = reader.string(); + break; + } + case 12: { + message.egressControlConfig = $root.google.cloud.connectors.v1.EgressControlConfig.decode(reader, reader.uint32()); + break; + } + case 14: { + if (!(message.roleGrants && message.roleGrants.length)) + message.roleGrants = []; + message.roleGrants.push($root.google.cloud.connectors.v1.RoleGrant.decode(reader, reader.uint32())); + break; + } + case 15: { + message.roleGrant = $root.google.cloud.connectors.v1.RoleGrant.decode(reader, reader.uint32()); + break; + } + case 17: { + message.sslConfigTemplate = $root.google.cloud.connectors.v1.SslConfigTemplate.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ConnectorVersion message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.connectors.v1.ConnectorVersion + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.connectors.v1.ConnectorVersion} ConnectorVersion + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ConnectorVersion.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ConnectorVersion message. + * @function verify + * @memberof google.cloud.connectors.v1.ConnectorVersion + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ConnectorVersion.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.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.labels != null && message.hasOwnProperty("labels")) { + if (!$util.isObject(message.labels)) + return "labels: object expected"; + var key = Object.keys(message.labels); + for (var i = 0; i < key.length; ++i) + if (!$util.isString(message.labels[key[i]])) + return "labels: string{k:string} expected"; + } + if (message.launchStage != null && message.hasOwnProperty("launchStage")) + switch (message.launchStage) { + default: + return "launchStage: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 5: + break; + } + if (message.releaseVersion != null && message.hasOwnProperty("releaseVersion")) + if (!$util.isString(message.releaseVersion)) + return "releaseVersion: string expected"; + if (message.authConfigTemplates != null && message.hasOwnProperty("authConfigTemplates")) { + if (!Array.isArray(message.authConfigTemplates)) + return "authConfigTemplates: array expected"; + for (var i = 0; i < message.authConfigTemplates.length; ++i) { + var error = $root.google.cloud.connectors.v1.AuthConfigTemplate.verify(message.authConfigTemplates[i]); + if (error) + return "authConfigTemplates." + error; + } + } + if (message.configVariableTemplates != null && message.hasOwnProperty("configVariableTemplates")) { + if (!Array.isArray(message.configVariableTemplates)) + return "configVariableTemplates: array expected"; + for (var i = 0; i < message.configVariableTemplates.length; ++i) { + var error = $root.google.cloud.connectors.v1.ConfigVariableTemplate.verify(message.configVariableTemplates[i]); + if (error) + return "configVariableTemplates." + error; + } + } + if (message.supportedRuntimeFeatures != null && message.hasOwnProperty("supportedRuntimeFeatures")) { + var error = $root.google.cloud.connectors.v1.SupportedRuntimeFeatures.verify(message.supportedRuntimeFeatures); + if (error) + return "supportedRuntimeFeatures." + error; + } + if (message.displayName != null && message.hasOwnProperty("displayName")) + if (!$util.isString(message.displayName)) + return "displayName: string expected"; + if (message.egressControlConfig != null && message.hasOwnProperty("egressControlConfig")) { + var error = $root.google.cloud.connectors.v1.EgressControlConfig.verify(message.egressControlConfig); + if (error) + return "egressControlConfig." + error; + } + if (message.roleGrants != null && message.hasOwnProperty("roleGrants")) { + if (!Array.isArray(message.roleGrants)) + return "roleGrants: array expected"; + for (var i = 0; i < message.roleGrants.length; ++i) { + var error = $root.google.cloud.connectors.v1.RoleGrant.verify(message.roleGrants[i]); + if (error) + return "roleGrants." + error; + } + } + if (message.roleGrant != null && message.hasOwnProperty("roleGrant")) { + var error = $root.google.cloud.connectors.v1.RoleGrant.verify(message.roleGrant); + if (error) + return "roleGrant." + error; + } + if (message.sslConfigTemplate != null && message.hasOwnProperty("sslConfigTemplate")) { + var error = $root.google.cloud.connectors.v1.SslConfigTemplate.verify(message.sslConfigTemplate); + if (error) + return "sslConfigTemplate." + error; + } + return null; + }; + + /** + * Creates a ConnectorVersion message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.connectors.v1.ConnectorVersion + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.connectors.v1.ConnectorVersion} ConnectorVersion + */ + ConnectorVersion.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.connectors.v1.ConnectorVersion) + return object; + var message = new $root.google.cloud.connectors.v1.ConnectorVersion(); + if (object.name != null) + message.name = String(object.name); + if (object.createTime != null) { + if (typeof object.createTime !== "object") + throw TypeError(".google.cloud.connectors.v1.ConnectorVersion.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.connectors.v1.ConnectorVersion.updateTime: object expected"); + message.updateTime = $root.google.protobuf.Timestamp.fromObject(object.updateTime); + } + if (object.labels) { + if (typeof object.labels !== "object") + throw TypeError(".google.cloud.connectors.v1.ConnectorVersion.labels: object expected"); + message.labels = {}; + for (var keys = Object.keys(object.labels), i = 0; i < keys.length; ++i) + message.labels[keys[i]] = String(object.labels[keys[i]]); + } + 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 "PREVIEW": + case 1: + message.launchStage = 1; + break; + case "GA": + case 2: + message.launchStage = 2; + break; + case "DEPRECATED": + case 3: + message.launchStage = 3; + break; + case "PRIVATE_PREVIEW": + case 5: + message.launchStage = 5; + break; + } + if (object.releaseVersion != null) + message.releaseVersion = String(object.releaseVersion); + if (object.authConfigTemplates) { + if (!Array.isArray(object.authConfigTemplates)) + throw TypeError(".google.cloud.connectors.v1.ConnectorVersion.authConfigTemplates: array expected"); + message.authConfigTemplates = []; + for (var i = 0; i < object.authConfigTemplates.length; ++i) { + if (typeof object.authConfigTemplates[i] !== "object") + throw TypeError(".google.cloud.connectors.v1.ConnectorVersion.authConfigTemplates: object expected"); + message.authConfigTemplates[i] = $root.google.cloud.connectors.v1.AuthConfigTemplate.fromObject(object.authConfigTemplates[i]); + } + } + if (object.configVariableTemplates) { + if (!Array.isArray(object.configVariableTemplates)) + throw TypeError(".google.cloud.connectors.v1.ConnectorVersion.configVariableTemplates: array expected"); + message.configVariableTemplates = []; + for (var i = 0; i < object.configVariableTemplates.length; ++i) { + if (typeof object.configVariableTemplates[i] !== "object") + throw TypeError(".google.cloud.connectors.v1.ConnectorVersion.configVariableTemplates: object expected"); + message.configVariableTemplates[i] = $root.google.cloud.connectors.v1.ConfigVariableTemplate.fromObject(object.configVariableTemplates[i]); + } + } + if (object.supportedRuntimeFeatures != null) { + if (typeof object.supportedRuntimeFeatures !== "object") + throw TypeError(".google.cloud.connectors.v1.ConnectorVersion.supportedRuntimeFeatures: object expected"); + message.supportedRuntimeFeatures = $root.google.cloud.connectors.v1.SupportedRuntimeFeatures.fromObject(object.supportedRuntimeFeatures); + } + if (object.displayName != null) + message.displayName = String(object.displayName); + if (object.egressControlConfig != null) { + if (typeof object.egressControlConfig !== "object") + throw TypeError(".google.cloud.connectors.v1.ConnectorVersion.egressControlConfig: object expected"); + message.egressControlConfig = $root.google.cloud.connectors.v1.EgressControlConfig.fromObject(object.egressControlConfig); + } + if (object.roleGrants) { + if (!Array.isArray(object.roleGrants)) + throw TypeError(".google.cloud.connectors.v1.ConnectorVersion.roleGrants: array expected"); + message.roleGrants = []; + for (var i = 0; i < object.roleGrants.length; ++i) { + if (typeof object.roleGrants[i] !== "object") + throw TypeError(".google.cloud.connectors.v1.ConnectorVersion.roleGrants: object expected"); + message.roleGrants[i] = $root.google.cloud.connectors.v1.RoleGrant.fromObject(object.roleGrants[i]); + } + } + if (object.roleGrant != null) { + if (typeof object.roleGrant !== "object") + throw TypeError(".google.cloud.connectors.v1.ConnectorVersion.roleGrant: object expected"); + message.roleGrant = $root.google.cloud.connectors.v1.RoleGrant.fromObject(object.roleGrant); + } + if (object.sslConfigTemplate != null) { + if (typeof object.sslConfigTemplate !== "object") + throw TypeError(".google.cloud.connectors.v1.ConnectorVersion.sslConfigTemplate: object expected"); + message.sslConfigTemplate = $root.google.cloud.connectors.v1.SslConfigTemplate.fromObject(object.sslConfigTemplate); + } + return message; + }; + + /** + * Creates a plain object from a ConnectorVersion message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.connectors.v1.ConnectorVersion + * @static + * @param {google.cloud.connectors.v1.ConnectorVersion} message ConnectorVersion + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ConnectorVersion.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.authConfigTemplates = []; + object.configVariableTemplates = []; + object.roleGrants = []; + } + if (options.objects || options.defaults) + object.labels = {}; + if (options.defaults) { + object.name = ""; + object.createTime = null; + object.updateTime = null; + object.launchStage = options.enums === String ? "LAUNCH_STAGE_UNSPECIFIED" : 0; + object.releaseVersion = ""; + object.supportedRuntimeFeatures = null; + object.displayName = ""; + object.egressControlConfig = null; + object.roleGrant = null; + object.sslConfigTemplate = null; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + 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); + var keys2; + if (message.labels && (keys2 = Object.keys(message.labels)).length) { + object.labels = {}; + for (var j = 0; j < keys2.length; ++j) + object.labels[keys2[j]] = message.labels[keys2[j]]; + } + if (message.launchStage != null && message.hasOwnProperty("launchStage")) + object.launchStage = options.enums === String ? $root.google.cloud.connectors.v1.LaunchStage[message.launchStage] === undefined ? message.launchStage : $root.google.cloud.connectors.v1.LaunchStage[message.launchStage] : message.launchStage; + if (message.releaseVersion != null && message.hasOwnProperty("releaseVersion")) + object.releaseVersion = message.releaseVersion; + if (message.authConfigTemplates && message.authConfigTemplates.length) { + object.authConfigTemplates = []; + for (var j = 0; j < message.authConfigTemplates.length; ++j) + object.authConfigTemplates[j] = $root.google.cloud.connectors.v1.AuthConfigTemplate.toObject(message.authConfigTemplates[j], options); + } + if (message.configVariableTemplates && message.configVariableTemplates.length) { + object.configVariableTemplates = []; + for (var j = 0; j < message.configVariableTemplates.length; ++j) + object.configVariableTemplates[j] = $root.google.cloud.connectors.v1.ConfigVariableTemplate.toObject(message.configVariableTemplates[j], options); + } + if (message.supportedRuntimeFeatures != null && message.hasOwnProperty("supportedRuntimeFeatures")) + object.supportedRuntimeFeatures = $root.google.cloud.connectors.v1.SupportedRuntimeFeatures.toObject(message.supportedRuntimeFeatures, options); + if (message.displayName != null && message.hasOwnProperty("displayName")) + object.displayName = message.displayName; + if (message.egressControlConfig != null && message.hasOwnProperty("egressControlConfig")) + object.egressControlConfig = $root.google.cloud.connectors.v1.EgressControlConfig.toObject(message.egressControlConfig, options); + if (message.roleGrants && message.roleGrants.length) { + object.roleGrants = []; + for (var j = 0; j < message.roleGrants.length; ++j) + object.roleGrants[j] = $root.google.cloud.connectors.v1.RoleGrant.toObject(message.roleGrants[j], options); + } + if (message.roleGrant != null && message.hasOwnProperty("roleGrant")) + object.roleGrant = $root.google.cloud.connectors.v1.RoleGrant.toObject(message.roleGrant, options); + if (message.sslConfigTemplate != null && message.hasOwnProperty("sslConfigTemplate")) + object.sslConfigTemplate = $root.google.cloud.connectors.v1.SslConfigTemplate.toObject(message.sslConfigTemplate, options); + return object; + }; + + /** + * Converts this ConnectorVersion to JSON. + * @function toJSON + * @memberof google.cloud.connectors.v1.ConnectorVersion + * @instance + * @returns {Object.} JSON object + */ + ConnectorVersion.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ConnectorVersion + * @function getTypeUrl + * @memberof google.cloud.connectors.v1.ConnectorVersion + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ConnectorVersion.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.connectors.v1.ConnectorVersion"; + }; + + return ConnectorVersion; + })(); + + v1.GetConnectorVersionRequest = (function() { + + /** + * Properties of a GetConnectorVersionRequest. + * @memberof google.cloud.connectors.v1 + * @interface IGetConnectorVersionRequest + * @property {string|null} [name] GetConnectorVersionRequest name + * @property {google.cloud.connectors.v1.ConnectorVersionView|null} [view] GetConnectorVersionRequest view + */ + + /** + * Constructs a new GetConnectorVersionRequest. + * @memberof google.cloud.connectors.v1 + * @classdesc Represents a GetConnectorVersionRequest. + * @implements IGetConnectorVersionRequest + * @constructor + * @param {google.cloud.connectors.v1.IGetConnectorVersionRequest=} [properties] Properties to set + */ + function GetConnectorVersionRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetConnectorVersionRequest name. + * @member {string} name + * @memberof google.cloud.connectors.v1.GetConnectorVersionRequest + * @instance + */ + GetConnectorVersionRequest.prototype.name = ""; + + /** + * GetConnectorVersionRequest view. + * @member {google.cloud.connectors.v1.ConnectorVersionView} view + * @memberof google.cloud.connectors.v1.GetConnectorVersionRequest + * @instance + */ + GetConnectorVersionRequest.prototype.view = 0; + + /** + * Creates a new GetConnectorVersionRequest instance using the specified properties. + * @function create + * @memberof google.cloud.connectors.v1.GetConnectorVersionRequest + * @static + * @param {google.cloud.connectors.v1.IGetConnectorVersionRequest=} [properties] Properties to set + * @returns {google.cloud.connectors.v1.GetConnectorVersionRequest} GetConnectorVersionRequest instance + */ + GetConnectorVersionRequest.create = function create(properties) { + return new GetConnectorVersionRequest(properties); + }; + + /** + * Encodes the specified GetConnectorVersionRequest message. Does not implicitly {@link google.cloud.connectors.v1.GetConnectorVersionRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.connectors.v1.GetConnectorVersionRequest + * @static + * @param {google.cloud.connectors.v1.IGetConnectorVersionRequest} message GetConnectorVersionRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetConnectorVersionRequest.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.view != null && Object.hasOwnProperty.call(message, "view")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.view); + return writer; + }; + + /** + * Encodes the specified GetConnectorVersionRequest message, length delimited. Does not implicitly {@link google.cloud.connectors.v1.GetConnectorVersionRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.connectors.v1.GetConnectorVersionRequest + * @static + * @param {google.cloud.connectors.v1.IGetConnectorVersionRequest} message GetConnectorVersionRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetConnectorVersionRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetConnectorVersionRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.connectors.v1.GetConnectorVersionRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.connectors.v1.GetConnectorVersionRequest} GetConnectorVersionRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetConnectorVersionRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.connectors.v1.GetConnectorVersionRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.view = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetConnectorVersionRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.connectors.v1.GetConnectorVersionRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.connectors.v1.GetConnectorVersionRequest} GetConnectorVersionRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetConnectorVersionRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetConnectorVersionRequest message. + * @function verify + * @memberof google.cloud.connectors.v1.GetConnectorVersionRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetConnectorVersionRequest.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.view != null && message.hasOwnProperty("view")) + switch (message.view) { + default: + return "view: enum value expected"; + case 0: + case 1: + case 2: + break; + } + return null; + }; + + /** + * Creates a GetConnectorVersionRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.connectors.v1.GetConnectorVersionRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.connectors.v1.GetConnectorVersionRequest} GetConnectorVersionRequest + */ + GetConnectorVersionRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.connectors.v1.GetConnectorVersionRequest) + return object; + var message = new $root.google.cloud.connectors.v1.GetConnectorVersionRequest(); + if (object.name != null) + message.name = String(object.name); + switch (object.view) { + default: + if (typeof object.view === "number") { + message.view = object.view; + break; + } + break; + case "CONNECTOR_VERSION_VIEW_UNSPECIFIED": + case 0: + message.view = 0; + break; + case "CONNECTOR_VERSION_VIEW_BASIC": + case 1: + message.view = 1; + break; + case "CONNECTOR_VERSION_VIEW_FULL": + case 2: + message.view = 2; + break; + } + return message; + }; + + /** + * Creates a plain object from a GetConnectorVersionRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.connectors.v1.GetConnectorVersionRequest + * @static + * @param {google.cloud.connectors.v1.GetConnectorVersionRequest} message GetConnectorVersionRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetConnectorVersionRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.view = options.enums === String ? "CONNECTOR_VERSION_VIEW_UNSPECIFIED" : 0; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.view != null && message.hasOwnProperty("view")) + object.view = options.enums === String ? $root.google.cloud.connectors.v1.ConnectorVersionView[message.view] === undefined ? message.view : $root.google.cloud.connectors.v1.ConnectorVersionView[message.view] : message.view; + return object; + }; + + /** + * Converts this GetConnectorVersionRequest to JSON. + * @function toJSON + * @memberof google.cloud.connectors.v1.GetConnectorVersionRequest + * @instance + * @returns {Object.} JSON object + */ + GetConnectorVersionRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GetConnectorVersionRequest + * @function getTypeUrl + * @memberof google.cloud.connectors.v1.GetConnectorVersionRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GetConnectorVersionRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.connectors.v1.GetConnectorVersionRequest"; + }; + + return GetConnectorVersionRequest; + })(); + + v1.ListConnectorVersionsRequest = (function() { + + /** + * Properties of a ListConnectorVersionsRequest. + * @memberof google.cloud.connectors.v1 + * @interface IListConnectorVersionsRequest + * @property {string|null} [parent] ListConnectorVersionsRequest parent + * @property {number|null} [pageSize] ListConnectorVersionsRequest pageSize + * @property {string|null} [pageToken] ListConnectorVersionsRequest pageToken + * @property {google.cloud.connectors.v1.ConnectorVersionView|null} [view] ListConnectorVersionsRequest view + */ + + /** + * Constructs a new ListConnectorVersionsRequest. + * @memberof google.cloud.connectors.v1 + * @classdesc Represents a ListConnectorVersionsRequest. + * @implements IListConnectorVersionsRequest + * @constructor + * @param {google.cloud.connectors.v1.IListConnectorVersionsRequest=} [properties] Properties to set + */ + function ListConnectorVersionsRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListConnectorVersionsRequest parent. + * @member {string} parent + * @memberof google.cloud.connectors.v1.ListConnectorVersionsRequest + * @instance + */ + ListConnectorVersionsRequest.prototype.parent = ""; + + /** + * ListConnectorVersionsRequest pageSize. + * @member {number} pageSize + * @memberof google.cloud.connectors.v1.ListConnectorVersionsRequest + * @instance + */ + ListConnectorVersionsRequest.prototype.pageSize = 0; + + /** + * ListConnectorVersionsRequest pageToken. + * @member {string} pageToken + * @memberof google.cloud.connectors.v1.ListConnectorVersionsRequest + * @instance + */ + ListConnectorVersionsRequest.prototype.pageToken = ""; + + /** + * ListConnectorVersionsRequest view. + * @member {google.cloud.connectors.v1.ConnectorVersionView} view + * @memberof google.cloud.connectors.v1.ListConnectorVersionsRequest + * @instance + */ + ListConnectorVersionsRequest.prototype.view = 0; + + /** + * Creates a new ListConnectorVersionsRequest instance using the specified properties. + * @function create + * @memberof google.cloud.connectors.v1.ListConnectorVersionsRequest + * @static + * @param {google.cloud.connectors.v1.IListConnectorVersionsRequest=} [properties] Properties to set + * @returns {google.cloud.connectors.v1.ListConnectorVersionsRequest} ListConnectorVersionsRequest instance + */ + ListConnectorVersionsRequest.create = function create(properties) { + return new ListConnectorVersionsRequest(properties); + }; + + /** + * Encodes the specified ListConnectorVersionsRequest message. Does not implicitly {@link google.cloud.connectors.v1.ListConnectorVersionsRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.connectors.v1.ListConnectorVersionsRequest + * @static + * @param {google.cloud.connectors.v1.IListConnectorVersionsRequest} message ListConnectorVersionsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListConnectorVersionsRequest.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.view != null && Object.hasOwnProperty.call(message, "view")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.view); + return writer; + }; + + /** + * Encodes the specified ListConnectorVersionsRequest message, length delimited. Does not implicitly {@link google.cloud.connectors.v1.ListConnectorVersionsRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.connectors.v1.ListConnectorVersionsRequest + * @static + * @param {google.cloud.connectors.v1.IListConnectorVersionsRequest} message ListConnectorVersionsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListConnectorVersionsRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListConnectorVersionsRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.connectors.v1.ListConnectorVersionsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.connectors.v1.ListConnectorVersionsRequest} ListConnectorVersionsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListConnectorVersionsRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.connectors.v1.ListConnectorVersionsRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + 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.view = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListConnectorVersionsRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.connectors.v1.ListConnectorVersionsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.connectors.v1.ListConnectorVersionsRequest} ListConnectorVersionsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListConnectorVersionsRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListConnectorVersionsRequest message. + * @function verify + * @memberof google.cloud.connectors.v1.ListConnectorVersionsRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListConnectorVersionsRequest.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.view != null && message.hasOwnProperty("view")) + switch (message.view) { + default: + return "view: enum value expected"; + case 0: + case 1: + case 2: + break; + } + return null; + }; + + /** + * Creates a ListConnectorVersionsRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.connectors.v1.ListConnectorVersionsRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.connectors.v1.ListConnectorVersionsRequest} ListConnectorVersionsRequest + */ + ListConnectorVersionsRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.connectors.v1.ListConnectorVersionsRequest) + return object; + var message = new $root.google.cloud.connectors.v1.ListConnectorVersionsRequest(); + 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); + switch (object.view) { + default: + if (typeof object.view === "number") { + message.view = object.view; + break; + } + break; + case "CONNECTOR_VERSION_VIEW_UNSPECIFIED": + case 0: + message.view = 0; + break; + case "CONNECTOR_VERSION_VIEW_BASIC": + case 1: + message.view = 1; + break; + case "CONNECTOR_VERSION_VIEW_FULL": + case 2: + message.view = 2; + break; + } + return message; + }; + + /** + * Creates a plain object from a ListConnectorVersionsRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.connectors.v1.ListConnectorVersionsRequest + * @static + * @param {google.cloud.connectors.v1.ListConnectorVersionsRequest} message ListConnectorVersionsRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListConnectorVersionsRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.pageSize = 0; + object.pageToken = ""; + object.view = options.enums === String ? "CONNECTOR_VERSION_VIEW_UNSPECIFIED" : 0; + } + 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.view != null && message.hasOwnProperty("view")) + object.view = options.enums === String ? $root.google.cloud.connectors.v1.ConnectorVersionView[message.view] === undefined ? message.view : $root.google.cloud.connectors.v1.ConnectorVersionView[message.view] : message.view; + return object; + }; + + /** + * Converts this ListConnectorVersionsRequest to JSON. + * @function toJSON + * @memberof google.cloud.connectors.v1.ListConnectorVersionsRequest + * @instance + * @returns {Object.} JSON object + */ + ListConnectorVersionsRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListConnectorVersionsRequest + * @function getTypeUrl + * @memberof google.cloud.connectors.v1.ListConnectorVersionsRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListConnectorVersionsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.connectors.v1.ListConnectorVersionsRequest"; + }; + + return ListConnectorVersionsRequest; + })(); + + v1.ListConnectorVersionsResponse = (function() { + + /** + * Properties of a ListConnectorVersionsResponse. + * @memberof google.cloud.connectors.v1 + * @interface IListConnectorVersionsResponse + * @property {Array.|null} [connectorVersions] ListConnectorVersionsResponse connectorVersions + * @property {string|null} [nextPageToken] ListConnectorVersionsResponse nextPageToken + * @property {Array.|null} [unreachable] ListConnectorVersionsResponse unreachable + */ + + /** + * Constructs a new ListConnectorVersionsResponse. + * @memberof google.cloud.connectors.v1 + * @classdesc Represents a ListConnectorVersionsResponse. + * @implements IListConnectorVersionsResponse + * @constructor + * @param {google.cloud.connectors.v1.IListConnectorVersionsResponse=} [properties] Properties to set + */ + function ListConnectorVersionsResponse(properties) { + this.connectorVersions = []; + this.unreachable = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListConnectorVersionsResponse connectorVersions. + * @member {Array.} connectorVersions + * @memberof google.cloud.connectors.v1.ListConnectorVersionsResponse + * @instance + */ + ListConnectorVersionsResponse.prototype.connectorVersions = $util.emptyArray; + + /** + * ListConnectorVersionsResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.cloud.connectors.v1.ListConnectorVersionsResponse + * @instance + */ + ListConnectorVersionsResponse.prototype.nextPageToken = ""; + + /** + * ListConnectorVersionsResponse unreachable. + * @member {Array.} unreachable + * @memberof google.cloud.connectors.v1.ListConnectorVersionsResponse + * @instance + */ + ListConnectorVersionsResponse.prototype.unreachable = $util.emptyArray; + + /** + * Creates a new ListConnectorVersionsResponse instance using the specified properties. + * @function create + * @memberof google.cloud.connectors.v1.ListConnectorVersionsResponse + * @static + * @param {google.cloud.connectors.v1.IListConnectorVersionsResponse=} [properties] Properties to set + * @returns {google.cloud.connectors.v1.ListConnectorVersionsResponse} ListConnectorVersionsResponse instance + */ + ListConnectorVersionsResponse.create = function create(properties) { + return new ListConnectorVersionsResponse(properties); + }; + + /** + * Encodes the specified ListConnectorVersionsResponse message. Does not implicitly {@link google.cloud.connectors.v1.ListConnectorVersionsResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.connectors.v1.ListConnectorVersionsResponse + * @static + * @param {google.cloud.connectors.v1.IListConnectorVersionsResponse} message ListConnectorVersionsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListConnectorVersionsResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.connectorVersions != null && message.connectorVersions.length) + for (var i = 0; i < message.connectorVersions.length; ++i) + $root.google.cloud.connectors.v1.ConnectorVersion.encode(message.connectorVersions[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); + if (message.unreachable != null && message.unreachable.length) + for (var i = 0; i < message.unreachable.length; ++i) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.unreachable[i]); + return writer; + }; + + /** + * Encodes the specified ListConnectorVersionsResponse message, length delimited. Does not implicitly {@link google.cloud.connectors.v1.ListConnectorVersionsResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.connectors.v1.ListConnectorVersionsResponse + * @static + * @param {google.cloud.connectors.v1.IListConnectorVersionsResponse} message ListConnectorVersionsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListConnectorVersionsResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListConnectorVersionsResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.connectors.v1.ListConnectorVersionsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.connectors.v1.ListConnectorVersionsResponse} ListConnectorVersionsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListConnectorVersionsResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.connectors.v1.ListConnectorVersionsResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.connectorVersions && message.connectorVersions.length)) + message.connectorVersions = []; + message.connectorVersions.push($root.google.cloud.connectors.v1.ConnectorVersion.decode(reader, reader.uint32())); + break; + } + case 2: { + message.nextPageToken = reader.string(); + break; + } + case 3: { + if (!(message.unreachable && message.unreachable.length)) + message.unreachable = []; + message.unreachable.push(reader.string()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListConnectorVersionsResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.connectors.v1.ListConnectorVersionsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.connectors.v1.ListConnectorVersionsResponse} ListConnectorVersionsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListConnectorVersionsResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListConnectorVersionsResponse message. + * @function verify + * @memberof google.cloud.connectors.v1.ListConnectorVersionsResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListConnectorVersionsResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.connectorVersions != null && message.hasOwnProperty("connectorVersions")) { + if (!Array.isArray(message.connectorVersions)) + return "connectorVersions: array expected"; + for (var i = 0; i < message.connectorVersions.length; ++i) { + var error = $root.google.cloud.connectors.v1.ConnectorVersion.verify(message.connectorVersions[i]); + if (error) + return "connectorVersions." + error; + } + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + if (message.unreachable != null && message.hasOwnProperty("unreachable")) { + if (!Array.isArray(message.unreachable)) + return "unreachable: array expected"; + for (var i = 0; i < message.unreachable.length; ++i) + if (!$util.isString(message.unreachable[i])) + return "unreachable: string[] expected"; + } + return null; + }; + + /** + * Creates a ListConnectorVersionsResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.connectors.v1.ListConnectorVersionsResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.connectors.v1.ListConnectorVersionsResponse} ListConnectorVersionsResponse + */ + ListConnectorVersionsResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.connectors.v1.ListConnectorVersionsResponse) + return object; + var message = new $root.google.cloud.connectors.v1.ListConnectorVersionsResponse(); + if (object.connectorVersions) { + if (!Array.isArray(object.connectorVersions)) + throw TypeError(".google.cloud.connectors.v1.ListConnectorVersionsResponse.connectorVersions: array expected"); + message.connectorVersions = []; + for (var i = 0; i < object.connectorVersions.length; ++i) { + if (typeof object.connectorVersions[i] !== "object") + throw TypeError(".google.cloud.connectors.v1.ListConnectorVersionsResponse.connectorVersions: object expected"); + message.connectorVersions[i] = $root.google.cloud.connectors.v1.ConnectorVersion.fromObject(object.connectorVersions[i]); + } + } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + if (object.unreachable) { + if (!Array.isArray(object.unreachable)) + throw TypeError(".google.cloud.connectors.v1.ListConnectorVersionsResponse.unreachable: array expected"); + message.unreachable = []; + for (var i = 0; i < object.unreachable.length; ++i) + message.unreachable[i] = String(object.unreachable[i]); + } + return message; + }; + + /** + * Creates a plain object from a ListConnectorVersionsResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.connectors.v1.ListConnectorVersionsResponse + * @static + * @param {google.cloud.connectors.v1.ListConnectorVersionsResponse} message ListConnectorVersionsResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListConnectorVersionsResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.connectorVersions = []; + object.unreachable = []; + } + if (options.defaults) + object.nextPageToken = ""; + if (message.connectorVersions && message.connectorVersions.length) { + object.connectorVersions = []; + for (var j = 0; j < message.connectorVersions.length; ++j) + object.connectorVersions[j] = $root.google.cloud.connectors.v1.ConnectorVersion.toObject(message.connectorVersions[j], options); + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + object.nextPageToken = message.nextPageToken; + if (message.unreachable && message.unreachable.length) { + object.unreachable = []; + for (var j = 0; j < message.unreachable.length; ++j) + object.unreachable[j] = message.unreachable[j]; + } + return object; + }; + + /** + * Converts this ListConnectorVersionsResponse to JSON. + * @function toJSON + * @memberof google.cloud.connectors.v1.ListConnectorVersionsResponse + * @instance + * @returns {Object.} JSON object + */ + ListConnectorVersionsResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListConnectorVersionsResponse + * @function getTypeUrl + * @memberof google.cloud.connectors.v1.ListConnectorVersionsResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListConnectorVersionsResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.connectors.v1.ListConnectorVersionsResponse"; + }; + + return ListConnectorVersionsResponse; + })(); + + v1.SupportedRuntimeFeatures = (function() { + + /** + * Properties of a SupportedRuntimeFeatures. + * @memberof google.cloud.connectors.v1 + * @interface ISupportedRuntimeFeatures + * @property {boolean|null} [entityApis] SupportedRuntimeFeatures entityApis + * @property {boolean|null} [actionApis] SupportedRuntimeFeatures actionApis + * @property {boolean|null} [sqlQuery] SupportedRuntimeFeatures sqlQuery + */ + + /** + * Constructs a new SupportedRuntimeFeatures. + * @memberof google.cloud.connectors.v1 + * @classdesc Represents a SupportedRuntimeFeatures. + * @implements ISupportedRuntimeFeatures + * @constructor + * @param {google.cloud.connectors.v1.ISupportedRuntimeFeatures=} [properties] Properties to set + */ + function SupportedRuntimeFeatures(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * SupportedRuntimeFeatures entityApis. + * @member {boolean} entityApis + * @memberof google.cloud.connectors.v1.SupportedRuntimeFeatures + * @instance + */ + SupportedRuntimeFeatures.prototype.entityApis = false; + + /** + * SupportedRuntimeFeatures actionApis. + * @member {boolean} actionApis + * @memberof google.cloud.connectors.v1.SupportedRuntimeFeatures + * @instance + */ + SupportedRuntimeFeatures.prototype.actionApis = false; + + /** + * SupportedRuntimeFeatures sqlQuery. + * @member {boolean} sqlQuery + * @memberof google.cloud.connectors.v1.SupportedRuntimeFeatures + * @instance + */ + SupportedRuntimeFeatures.prototype.sqlQuery = false; + + /** + * Creates a new SupportedRuntimeFeatures instance using the specified properties. + * @function create + * @memberof google.cloud.connectors.v1.SupportedRuntimeFeatures + * @static + * @param {google.cloud.connectors.v1.ISupportedRuntimeFeatures=} [properties] Properties to set + * @returns {google.cloud.connectors.v1.SupportedRuntimeFeatures} SupportedRuntimeFeatures instance + */ + SupportedRuntimeFeatures.create = function create(properties) { + return new SupportedRuntimeFeatures(properties); + }; + + /** + * Encodes the specified SupportedRuntimeFeatures message. Does not implicitly {@link google.cloud.connectors.v1.SupportedRuntimeFeatures.verify|verify} messages. + * @function encode + * @memberof google.cloud.connectors.v1.SupportedRuntimeFeatures + * @static + * @param {google.cloud.connectors.v1.ISupportedRuntimeFeatures} message SupportedRuntimeFeatures message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SupportedRuntimeFeatures.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.entityApis != null && Object.hasOwnProperty.call(message, "entityApis")) + writer.uint32(/* id 1, wireType 0 =*/8).bool(message.entityApis); + if (message.actionApis != null && Object.hasOwnProperty.call(message, "actionApis")) + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.actionApis); + if (message.sqlQuery != null && Object.hasOwnProperty.call(message, "sqlQuery")) + writer.uint32(/* id 3, wireType 0 =*/24).bool(message.sqlQuery); + return writer; + }; + + /** + * Encodes the specified SupportedRuntimeFeatures message, length delimited. Does not implicitly {@link google.cloud.connectors.v1.SupportedRuntimeFeatures.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.connectors.v1.SupportedRuntimeFeatures + * @static + * @param {google.cloud.connectors.v1.ISupportedRuntimeFeatures} message SupportedRuntimeFeatures message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SupportedRuntimeFeatures.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a SupportedRuntimeFeatures message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.connectors.v1.SupportedRuntimeFeatures + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.connectors.v1.SupportedRuntimeFeatures} SupportedRuntimeFeatures + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SupportedRuntimeFeatures.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.connectors.v1.SupportedRuntimeFeatures(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.entityApis = reader.bool(); + break; + } + case 2: { + message.actionApis = reader.bool(); + break; + } + case 3: { + message.sqlQuery = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a SupportedRuntimeFeatures message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.connectors.v1.SupportedRuntimeFeatures + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.connectors.v1.SupportedRuntimeFeatures} SupportedRuntimeFeatures + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SupportedRuntimeFeatures.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a SupportedRuntimeFeatures message. + * @function verify + * @memberof google.cloud.connectors.v1.SupportedRuntimeFeatures + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + SupportedRuntimeFeatures.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.entityApis != null && message.hasOwnProperty("entityApis")) + if (typeof message.entityApis !== "boolean") + return "entityApis: boolean expected"; + if (message.actionApis != null && message.hasOwnProperty("actionApis")) + if (typeof message.actionApis !== "boolean") + return "actionApis: boolean expected"; + if (message.sqlQuery != null && message.hasOwnProperty("sqlQuery")) + if (typeof message.sqlQuery !== "boolean") + return "sqlQuery: boolean expected"; + return null; + }; + + /** + * Creates a SupportedRuntimeFeatures message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.connectors.v1.SupportedRuntimeFeatures + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.connectors.v1.SupportedRuntimeFeatures} SupportedRuntimeFeatures + */ + SupportedRuntimeFeatures.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.connectors.v1.SupportedRuntimeFeatures) + return object; + var message = new $root.google.cloud.connectors.v1.SupportedRuntimeFeatures(); + if (object.entityApis != null) + message.entityApis = Boolean(object.entityApis); + if (object.actionApis != null) + message.actionApis = Boolean(object.actionApis); + if (object.sqlQuery != null) + message.sqlQuery = Boolean(object.sqlQuery); + return message; + }; + + /** + * Creates a plain object from a SupportedRuntimeFeatures message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.connectors.v1.SupportedRuntimeFeatures + * @static + * @param {google.cloud.connectors.v1.SupportedRuntimeFeatures} message SupportedRuntimeFeatures + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + SupportedRuntimeFeatures.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.entityApis = false; + object.actionApis = false; + object.sqlQuery = false; + } + if (message.entityApis != null && message.hasOwnProperty("entityApis")) + object.entityApis = message.entityApis; + if (message.actionApis != null && message.hasOwnProperty("actionApis")) + object.actionApis = message.actionApis; + if (message.sqlQuery != null && message.hasOwnProperty("sqlQuery")) + object.sqlQuery = message.sqlQuery; + return object; + }; + + /** + * Converts this SupportedRuntimeFeatures to JSON. + * @function toJSON + * @memberof google.cloud.connectors.v1.SupportedRuntimeFeatures + * @instance + * @returns {Object.} JSON object + */ + SupportedRuntimeFeatures.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for SupportedRuntimeFeatures + * @function getTypeUrl + * @memberof google.cloud.connectors.v1.SupportedRuntimeFeatures + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + SupportedRuntimeFeatures.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.connectors.v1.SupportedRuntimeFeatures"; + }; + + return SupportedRuntimeFeatures; + })(); + + v1.EgressControlConfig = (function() { + + /** + * Properties of an EgressControlConfig. + * @memberof google.cloud.connectors.v1 + * @interface IEgressControlConfig + * @property {string|null} [backends] EgressControlConfig backends + * @property {google.cloud.connectors.v1.IExtractionRules|null} [extractionRules] EgressControlConfig extractionRules + */ + + /** + * Constructs a new EgressControlConfig. + * @memberof google.cloud.connectors.v1 + * @classdesc Represents an EgressControlConfig. + * @implements IEgressControlConfig + * @constructor + * @param {google.cloud.connectors.v1.IEgressControlConfig=} [properties] Properties to set + */ + function EgressControlConfig(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * EgressControlConfig backends. + * @member {string|null|undefined} backends + * @memberof google.cloud.connectors.v1.EgressControlConfig + * @instance + */ + EgressControlConfig.prototype.backends = null; + + /** + * EgressControlConfig extractionRules. + * @member {google.cloud.connectors.v1.IExtractionRules|null|undefined} extractionRules + * @memberof google.cloud.connectors.v1.EgressControlConfig + * @instance + */ + EgressControlConfig.prototype.extractionRules = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * EgressControlConfig oneofBackends. + * @member {"backends"|"extractionRules"|undefined} oneofBackends + * @memberof google.cloud.connectors.v1.EgressControlConfig + * @instance + */ + Object.defineProperty(EgressControlConfig.prototype, "oneofBackends", { + get: $util.oneOfGetter($oneOfFields = ["backends", "extractionRules"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new EgressControlConfig instance using the specified properties. + * @function create + * @memberof google.cloud.connectors.v1.EgressControlConfig + * @static + * @param {google.cloud.connectors.v1.IEgressControlConfig=} [properties] Properties to set + * @returns {google.cloud.connectors.v1.EgressControlConfig} EgressControlConfig instance + */ + EgressControlConfig.create = function create(properties) { + return new EgressControlConfig(properties); + }; + + /** + * Encodes the specified EgressControlConfig message. Does not implicitly {@link google.cloud.connectors.v1.EgressControlConfig.verify|verify} messages. + * @function encode + * @memberof google.cloud.connectors.v1.EgressControlConfig + * @static + * @param {google.cloud.connectors.v1.IEgressControlConfig} message EgressControlConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EgressControlConfig.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.backends != null && Object.hasOwnProperty.call(message, "backends")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.backends); + if (message.extractionRules != null && Object.hasOwnProperty.call(message, "extractionRules")) + $root.google.cloud.connectors.v1.ExtractionRules.encode(message.extractionRules, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified EgressControlConfig message, length delimited. Does not implicitly {@link google.cloud.connectors.v1.EgressControlConfig.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.connectors.v1.EgressControlConfig + * @static + * @param {google.cloud.connectors.v1.IEgressControlConfig} message EgressControlConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EgressControlConfig.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an EgressControlConfig message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.connectors.v1.EgressControlConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.connectors.v1.EgressControlConfig} EgressControlConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EgressControlConfig.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.connectors.v1.EgressControlConfig(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.backends = reader.string(); + break; + } + case 2: { + message.extractionRules = $root.google.cloud.connectors.v1.ExtractionRules.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an EgressControlConfig message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.connectors.v1.EgressControlConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.connectors.v1.EgressControlConfig} EgressControlConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EgressControlConfig.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an EgressControlConfig message. + * @function verify + * @memberof google.cloud.connectors.v1.EgressControlConfig + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + EgressControlConfig.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.backends != null && message.hasOwnProperty("backends")) { + properties.oneofBackends = 1; + if (!$util.isString(message.backends)) + return "backends: string expected"; + } + if (message.extractionRules != null && message.hasOwnProperty("extractionRules")) { + if (properties.oneofBackends === 1) + return "oneofBackends: multiple values"; + properties.oneofBackends = 1; + { + var error = $root.google.cloud.connectors.v1.ExtractionRules.verify(message.extractionRules); + if (error) + return "extractionRules." + error; + } + } + return null; + }; + + /** + * Creates an EgressControlConfig message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.connectors.v1.EgressControlConfig + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.connectors.v1.EgressControlConfig} EgressControlConfig + */ + EgressControlConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.connectors.v1.EgressControlConfig) + return object; + var message = new $root.google.cloud.connectors.v1.EgressControlConfig(); + if (object.backends != null) + message.backends = String(object.backends); + if (object.extractionRules != null) { + if (typeof object.extractionRules !== "object") + throw TypeError(".google.cloud.connectors.v1.EgressControlConfig.extractionRules: object expected"); + message.extractionRules = $root.google.cloud.connectors.v1.ExtractionRules.fromObject(object.extractionRules); + } + return message; + }; + + /** + * Creates a plain object from an EgressControlConfig message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.connectors.v1.EgressControlConfig + * @static + * @param {google.cloud.connectors.v1.EgressControlConfig} message EgressControlConfig + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + EgressControlConfig.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.backends != null && message.hasOwnProperty("backends")) { + object.backends = message.backends; + if (options.oneofs) + object.oneofBackends = "backends"; + } + if (message.extractionRules != null && message.hasOwnProperty("extractionRules")) { + object.extractionRules = $root.google.cloud.connectors.v1.ExtractionRules.toObject(message.extractionRules, options); + if (options.oneofs) + object.oneofBackends = "extractionRules"; + } + return object; + }; + + /** + * Converts this EgressControlConfig to JSON. + * @function toJSON + * @memberof google.cloud.connectors.v1.EgressControlConfig + * @instance + * @returns {Object.} JSON object + */ + EgressControlConfig.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for EgressControlConfig + * @function getTypeUrl + * @memberof google.cloud.connectors.v1.EgressControlConfig + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + EgressControlConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.connectors.v1.EgressControlConfig"; + }; + + return EgressControlConfig; + })(); + + v1.ExtractionRules = (function() { + + /** + * Properties of an ExtractionRules. + * @memberof google.cloud.connectors.v1 + * @interface IExtractionRules + * @property {Array.|null} [extractionRule] ExtractionRules extractionRule + */ + + /** + * Constructs a new ExtractionRules. + * @memberof google.cloud.connectors.v1 + * @classdesc Represents an ExtractionRules. + * @implements IExtractionRules + * @constructor + * @param {google.cloud.connectors.v1.IExtractionRules=} [properties] Properties to set + */ + function ExtractionRules(properties) { + this.extractionRule = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ExtractionRules extractionRule. + * @member {Array.} extractionRule + * @memberof google.cloud.connectors.v1.ExtractionRules + * @instance + */ + ExtractionRules.prototype.extractionRule = $util.emptyArray; + + /** + * Creates a new ExtractionRules instance using the specified properties. + * @function create + * @memberof google.cloud.connectors.v1.ExtractionRules + * @static + * @param {google.cloud.connectors.v1.IExtractionRules=} [properties] Properties to set + * @returns {google.cloud.connectors.v1.ExtractionRules} ExtractionRules instance + */ + ExtractionRules.create = function create(properties) { + return new ExtractionRules(properties); + }; + + /** + * Encodes the specified ExtractionRules message. Does not implicitly {@link google.cloud.connectors.v1.ExtractionRules.verify|verify} messages. + * @function encode + * @memberof google.cloud.connectors.v1.ExtractionRules + * @static + * @param {google.cloud.connectors.v1.IExtractionRules} message ExtractionRules message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ExtractionRules.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.extractionRule != null && message.extractionRule.length) + for (var i = 0; i < message.extractionRule.length; ++i) + $root.google.cloud.connectors.v1.ExtractionRule.encode(message.extractionRule[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified ExtractionRules message, length delimited. Does not implicitly {@link google.cloud.connectors.v1.ExtractionRules.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.connectors.v1.ExtractionRules + * @static + * @param {google.cloud.connectors.v1.IExtractionRules} message ExtractionRules message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ExtractionRules.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an ExtractionRules message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.connectors.v1.ExtractionRules + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.connectors.v1.ExtractionRules} ExtractionRules + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ExtractionRules.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.connectors.v1.ExtractionRules(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.extractionRule && message.extractionRule.length)) + message.extractionRule = []; + message.extractionRule.push($root.google.cloud.connectors.v1.ExtractionRule.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an ExtractionRules message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.connectors.v1.ExtractionRules + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.connectors.v1.ExtractionRules} ExtractionRules + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ExtractionRules.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an ExtractionRules message. + * @function verify + * @memberof google.cloud.connectors.v1.ExtractionRules + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ExtractionRules.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.extractionRule != null && message.hasOwnProperty("extractionRule")) { + if (!Array.isArray(message.extractionRule)) + return "extractionRule: array expected"; + for (var i = 0; i < message.extractionRule.length; ++i) { + var error = $root.google.cloud.connectors.v1.ExtractionRule.verify(message.extractionRule[i]); + if (error) + return "extractionRule." + error; + } + } + return null; + }; + + /** + * Creates an ExtractionRules message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.connectors.v1.ExtractionRules + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.connectors.v1.ExtractionRules} ExtractionRules + */ + ExtractionRules.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.connectors.v1.ExtractionRules) + return object; + var message = new $root.google.cloud.connectors.v1.ExtractionRules(); + if (object.extractionRule) { + if (!Array.isArray(object.extractionRule)) + throw TypeError(".google.cloud.connectors.v1.ExtractionRules.extractionRule: array expected"); + message.extractionRule = []; + for (var i = 0; i < object.extractionRule.length; ++i) { + if (typeof object.extractionRule[i] !== "object") + throw TypeError(".google.cloud.connectors.v1.ExtractionRules.extractionRule: object expected"); + message.extractionRule[i] = $root.google.cloud.connectors.v1.ExtractionRule.fromObject(object.extractionRule[i]); + } + } + return message; + }; + + /** + * Creates a plain object from an ExtractionRules message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.connectors.v1.ExtractionRules + * @static + * @param {google.cloud.connectors.v1.ExtractionRules} message ExtractionRules + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ExtractionRules.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.extractionRule = []; + if (message.extractionRule && message.extractionRule.length) { + object.extractionRule = []; + for (var j = 0; j < message.extractionRule.length; ++j) + object.extractionRule[j] = $root.google.cloud.connectors.v1.ExtractionRule.toObject(message.extractionRule[j], options); + } + return object; + }; + + /** + * Converts this ExtractionRules to JSON. + * @function toJSON + * @memberof google.cloud.connectors.v1.ExtractionRules + * @instance + * @returns {Object.} JSON object + */ + ExtractionRules.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ExtractionRules + * @function getTypeUrl + * @memberof google.cloud.connectors.v1.ExtractionRules + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ExtractionRules.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.connectors.v1.ExtractionRules"; + }; + + return ExtractionRules; + })(); + + v1.ExtractionRule = (function() { + + /** + * Properties of an ExtractionRule. + * @memberof google.cloud.connectors.v1 + * @interface IExtractionRule + * @property {google.cloud.connectors.v1.ExtractionRule.ISource|null} [source] ExtractionRule source + * @property {string|null} [extractionRegex] ExtractionRule extractionRegex + */ + + /** + * Constructs a new ExtractionRule. + * @memberof google.cloud.connectors.v1 + * @classdesc Represents an ExtractionRule. + * @implements IExtractionRule + * @constructor + * @param {google.cloud.connectors.v1.IExtractionRule=} [properties] Properties to set + */ + function ExtractionRule(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ExtractionRule source. + * @member {google.cloud.connectors.v1.ExtractionRule.ISource|null|undefined} source + * @memberof google.cloud.connectors.v1.ExtractionRule + * @instance + */ + ExtractionRule.prototype.source = null; + + /** + * ExtractionRule extractionRegex. + * @member {string} extractionRegex + * @memberof google.cloud.connectors.v1.ExtractionRule + * @instance + */ + ExtractionRule.prototype.extractionRegex = ""; + + /** + * Creates a new ExtractionRule instance using the specified properties. + * @function create + * @memberof google.cloud.connectors.v1.ExtractionRule + * @static + * @param {google.cloud.connectors.v1.IExtractionRule=} [properties] Properties to set + * @returns {google.cloud.connectors.v1.ExtractionRule} ExtractionRule instance + */ + ExtractionRule.create = function create(properties) { + return new ExtractionRule(properties); + }; + + /** + * Encodes the specified ExtractionRule message. Does not implicitly {@link google.cloud.connectors.v1.ExtractionRule.verify|verify} messages. + * @function encode + * @memberof google.cloud.connectors.v1.ExtractionRule + * @static + * @param {google.cloud.connectors.v1.IExtractionRule} message ExtractionRule message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ExtractionRule.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.source != null && Object.hasOwnProperty.call(message, "source")) + $root.google.cloud.connectors.v1.ExtractionRule.Source.encode(message.source, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.extractionRegex != null && Object.hasOwnProperty.call(message, "extractionRegex")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.extractionRegex); + return writer; + }; + + /** + * Encodes the specified ExtractionRule message, length delimited. Does not implicitly {@link google.cloud.connectors.v1.ExtractionRule.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.connectors.v1.ExtractionRule + * @static + * @param {google.cloud.connectors.v1.IExtractionRule} message ExtractionRule message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ExtractionRule.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an ExtractionRule message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.connectors.v1.ExtractionRule + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.connectors.v1.ExtractionRule} ExtractionRule + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ExtractionRule.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.connectors.v1.ExtractionRule(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.source = $root.google.cloud.connectors.v1.ExtractionRule.Source.decode(reader, reader.uint32()); + break; + } + case 2: { + message.extractionRegex = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an ExtractionRule message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.connectors.v1.ExtractionRule + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.connectors.v1.ExtractionRule} ExtractionRule + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ExtractionRule.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an ExtractionRule message. + * @function verify + * @memberof google.cloud.connectors.v1.ExtractionRule + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ExtractionRule.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.source != null && message.hasOwnProperty("source")) { + var error = $root.google.cloud.connectors.v1.ExtractionRule.Source.verify(message.source); + if (error) + return "source." + error; + } + if (message.extractionRegex != null && message.hasOwnProperty("extractionRegex")) + if (!$util.isString(message.extractionRegex)) + return "extractionRegex: string expected"; + return null; + }; + + /** + * Creates an ExtractionRule message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.connectors.v1.ExtractionRule + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.connectors.v1.ExtractionRule} ExtractionRule + */ + ExtractionRule.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.connectors.v1.ExtractionRule) + return object; + var message = new $root.google.cloud.connectors.v1.ExtractionRule(); + if (object.source != null) { + if (typeof object.source !== "object") + throw TypeError(".google.cloud.connectors.v1.ExtractionRule.source: object expected"); + message.source = $root.google.cloud.connectors.v1.ExtractionRule.Source.fromObject(object.source); + } + if (object.extractionRegex != null) + message.extractionRegex = String(object.extractionRegex); + return message; + }; + + /** + * Creates a plain object from an ExtractionRule message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.connectors.v1.ExtractionRule + * @static + * @param {google.cloud.connectors.v1.ExtractionRule} message ExtractionRule + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ExtractionRule.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.source = null; + object.extractionRegex = ""; + } + if (message.source != null && message.hasOwnProperty("source")) + object.source = $root.google.cloud.connectors.v1.ExtractionRule.Source.toObject(message.source, options); + if (message.extractionRegex != null && message.hasOwnProperty("extractionRegex")) + object.extractionRegex = message.extractionRegex; + return object; + }; + + /** + * Converts this ExtractionRule to JSON. + * @function toJSON + * @memberof google.cloud.connectors.v1.ExtractionRule + * @instance + * @returns {Object.} JSON object + */ + ExtractionRule.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ExtractionRule + * @function getTypeUrl + * @memberof google.cloud.connectors.v1.ExtractionRule + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ExtractionRule.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.connectors.v1.ExtractionRule"; + }; + + ExtractionRule.Source = (function() { + + /** + * Properties of a Source. + * @memberof google.cloud.connectors.v1.ExtractionRule + * @interface ISource + * @property {google.cloud.connectors.v1.ExtractionRule.SourceType|null} [sourceType] Source sourceType + * @property {string|null} [fieldId] Source fieldId + */ + + /** + * Constructs a new Source. + * @memberof google.cloud.connectors.v1.ExtractionRule + * @classdesc Represents a Source. + * @implements ISource + * @constructor + * @param {google.cloud.connectors.v1.ExtractionRule.ISource=} [properties] Properties to set + */ + function Source(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Source sourceType. + * @member {google.cloud.connectors.v1.ExtractionRule.SourceType} sourceType + * @memberof google.cloud.connectors.v1.ExtractionRule.Source + * @instance + */ + Source.prototype.sourceType = 0; + + /** + * Source fieldId. + * @member {string} fieldId + * @memberof google.cloud.connectors.v1.ExtractionRule.Source + * @instance + */ + Source.prototype.fieldId = ""; + + /** + * Creates a new Source instance using the specified properties. + * @function create + * @memberof google.cloud.connectors.v1.ExtractionRule.Source + * @static + * @param {google.cloud.connectors.v1.ExtractionRule.ISource=} [properties] Properties to set + * @returns {google.cloud.connectors.v1.ExtractionRule.Source} Source instance + */ + Source.create = function create(properties) { + return new Source(properties); + }; + + /** + * Encodes the specified Source message. Does not implicitly {@link google.cloud.connectors.v1.ExtractionRule.Source.verify|verify} messages. + * @function encode + * @memberof google.cloud.connectors.v1.ExtractionRule.Source + * @static + * @param {google.cloud.connectors.v1.ExtractionRule.ISource} message Source message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Source.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.sourceType != null && Object.hasOwnProperty.call(message, "sourceType")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.sourceType); + if (message.fieldId != null && Object.hasOwnProperty.call(message, "fieldId")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.fieldId); + return writer; + }; + + /** + * Encodes the specified Source message, length delimited. Does not implicitly {@link google.cloud.connectors.v1.ExtractionRule.Source.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.connectors.v1.ExtractionRule.Source + * @static + * @param {google.cloud.connectors.v1.ExtractionRule.ISource} message Source message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Source.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Source message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.connectors.v1.ExtractionRule.Source + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.connectors.v1.ExtractionRule.Source} Source + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Source.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.connectors.v1.ExtractionRule.Source(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.sourceType = reader.int32(); + break; + } + case 2: { + message.fieldId = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Source message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.connectors.v1.ExtractionRule.Source + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.connectors.v1.ExtractionRule.Source} Source + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Source.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Source message. + * @function verify + * @memberof google.cloud.connectors.v1.ExtractionRule.Source + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Source.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.sourceType != null && message.hasOwnProperty("sourceType")) + switch (message.sourceType) { + default: + return "sourceType: enum value expected"; + case 0: + case 1: + break; + } + if (message.fieldId != null && message.hasOwnProperty("fieldId")) + if (!$util.isString(message.fieldId)) + return "fieldId: string expected"; + return null; + }; + + /** + * Creates a Source message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.connectors.v1.ExtractionRule.Source + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.connectors.v1.ExtractionRule.Source} Source + */ + Source.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.connectors.v1.ExtractionRule.Source) + return object; + var message = new $root.google.cloud.connectors.v1.ExtractionRule.Source(); + switch (object.sourceType) { + default: + if (typeof object.sourceType === "number") { + message.sourceType = object.sourceType; + break; + } + break; + case "SOURCE_TYPE_UNSPECIFIED": + case 0: + message.sourceType = 0; + break; + case "CONFIG_VARIABLE": + case 1: + message.sourceType = 1; + break; + } + if (object.fieldId != null) + message.fieldId = String(object.fieldId); + return message; + }; + + /** + * Creates a plain object from a Source message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.connectors.v1.ExtractionRule.Source + * @static + * @param {google.cloud.connectors.v1.ExtractionRule.Source} message Source + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Source.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.sourceType = options.enums === String ? "SOURCE_TYPE_UNSPECIFIED" : 0; + object.fieldId = ""; + } + if (message.sourceType != null && message.hasOwnProperty("sourceType")) + object.sourceType = options.enums === String ? $root.google.cloud.connectors.v1.ExtractionRule.SourceType[message.sourceType] === undefined ? message.sourceType : $root.google.cloud.connectors.v1.ExtractionRule.SourceType[message.sourceType] : message.sourceType; + if (message.fieldId != null && message.hasOwnProperty("fieldId")) + object.fieldId = message.fieldId; + return object; + }; + + /** + * Converts this Source to JSON. + * @function toJSON + * @memberof google.cloud.connectors.v1.ExtractionRule.Source + * @instance + * @returns {Object.} JSON object + */ + Source.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Source + * @function getTypeUrl + * @memberof google.cloud.connectors.v1.ExtractionRule.Source + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Source.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.connectors.v1.ExtractionRule.Source"; + }; + + return Source; + })(); + + /** + * SourceType enum. + * @name google.cloud.connectors.v1.ExtractionRule.SourceType + * @enum {number} + * @property {number} SOURCE_TYPE_UNSPECIFIED=0 SOURCE_TYPE_UNSPECIFIED value + * @property {number} CONFIG_VARIABLE=1 CONFIG_VARIABLE value + */ + ExtractionRule.SourceType = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "SOURCE_TYPE_UNSPECIFIED"] = 0; + values[valuesById[1] = "CONFIG_VARIABLE"] = 1; + return values; + })(); + + return ExtractionRule; + })(); + + /** + * ConnectorVersionView enum. + * @name google.cloud.connectors.v1.ConnectorVersionView + * @enum {number} + * @property {number} CONNECTOR_VERSION_VIEW_UNSPECIFIED=0 CONNECTOR_VERSION_VIEW_UNSPECIFIED value + * @property {number} CONNECTOR_VERSION_VIEW_BASIC=1 CONNECTOR_VERSION_VIEW_BASIC value + * @property {number} CONNECTOR_VERSION_VIEW_FULL=2 CONNECTOR_VERSION_VIEW_FULL value + */ + v1.ConnectorVersionView = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "CONNECTOR_VERSION_VIEW_UNSPECIFIED"] = 0; + values[valuesById[1] = "CONNECTOR_VERSION_VIEW_BASIC"] = 1; + values[valuesById[2] = "CONNECTOR_VERSION_VIEW_FULL"] = 2; + return values; + })(); + + v1.Connectors = (function() { + + /** + * Constructs a new Connectors service. + * @memberof google.cloud.connectors.v1 + * @classdesc Represents a Connectors + * @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 Connectors(rpcImpl, requestDelimited, responseDelimited) { + $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); + } + + (Connectors.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = Connectors; + + /** + * Creates new Connectors service using the specified rpc implementation. + * @function create + * @memberof google.cloud.connectors.v1.Connectors + * @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 {Connectors} RPC service. Useful where requests and/or responses are streamed. + */ + Connectors.create = function create(rpcImpl, requestDelimited, responseDelimited) { + return new this(rpcImpl, requestDelimited, responseDelimited); + }; + + /** + * Callback as used by {@link google.cloud.connectors.v1.Connectors|listConnections}. + * @memberof google.cloud.connectors.v1.Connectors + * @typedef ListConnectionsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.connectors.v1.ListConnectionsResponse} [response] ListConnectionsResponse + */ + + /** + * Calls ListConnections. + * @function listConnections + * @memberof google.cloud.connectors.v1.Connectors + * @instance + * @param {google.cloud.connectors.v1.IListConnectionsRequest} request ListConnectionsRequest message or plain object + * @param {google.cloud.connectors.v1.Connectors.ListConnectionsCallback} callback Node-style callback called with the error, if any, and ListConnectionsResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Connectors.prototype.listConnections = function listConnections(request, callback) { + return this.rpcCall(listConnections, $root.google.cloud.connectors.v1.ListConnectionsRequest, $root.google.cloud.connectors.v1.ListConnectionsResponse, request, callback); + }, "name", { value: "ListConnections" }); + + /** + * Calls ListConnections. + * @function listConnections + * @memberof google.cloud.connectors.v1.Connectors + * @instance + * @param {google.cloud.connectors.v1.IListConnectionsRequest} request ListConnectionsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.connectors.v1.Connectors|getConnection}. + * @memberof google.cloud.connectors.v1.Connectors + * @typedef GetConnectionCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.connectors.v1.Connection} [response] Connection + */ + + /** + * Calls GetConnection. + * @function getConnection + * @memberof google.cloud.connectors.v1.Connectors + * @instance + * @param {google.cloud.connectors.v1.IGetConnectionRequest} request GetConnectionRequest message or plain object + * @param {google.cloud.connectors.v1.Connectors.GetConnectionCallback} callback Node-style callback called with the error, if any, and Connection + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Connectors.prototype.getConnection = function getConnection(request, callback) { + return this.rpcCall(getConnection, $root.google.cloud.connectors.v1.GetConnectionRequest, $root.google.cloud.connectors.v1.Connection, request, callback); + }, "name", { value: "GetConnection" }); + + /** + * Calls GetConnection. + * @function getConnection + * @memberof google.cloud.connectors.v1.Connectors + * @instance + * @param {google.cloud.connectors.v1.IGetConnectionRequest} request GetConnectionRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.connectors.v1.Connectors|createConnection}. + * @memberof google.cloud.connectors.v1.Connectors + * @typedef CreateConnectionCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls CreateConnection. + * @function createConnection + * @memberof google.cloud.connectors.v1.Connectors + * @instance + * @param {google.cloud.connectors.v1.ICreateConnectionRequest} request CreateConnectionRequest message or plain object + * @param {google.cloud.connectors.v1.Connectors.CreateConnectionCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Connectors.prototype.createConnection = function createConnection(request, callback) { + return this.rpcCall(createConnection, $root.google.cloud.connectors.v1.CreateConnectionRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "CreateConnection" }); + + /** + * Calls CreateConnection. + * @function createConnection + * @memberof google.cloud.connectors.v1.Connectors + * @instance + * @param {google.cloud.connectors.v1.ICreateConnectionRequest} request CreateConnectionRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.connectors.v1.Connectors|updateConnection}. + * @memberof google.cloud.connectors.v1.Connectors + * @typedef UpdateConnectionCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls UpdateConnection. + * @function updateConnection + * @memberof google.cloud.connectors.v1.Connectors + * @instance + * @param {google.cloud.connectors.v1.IUpdateConnectionRequest} request UpdateConnectionRequest message or plain object + * @param {google.cloud.connectors.v1.Connectors.UpdateConnectionCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Connectors.prototype.updateConnection = function updateConnection(request, callback) { + return this.rpcCall(updateConnection, $root.google.cloud.connectors.v1.UpdateConnectionRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "UpdateConnection" }); + + /** + * Calls UpdateConnection. + * @function updateConnection + * @memberof google.cloud.connectors.v1.Connectors + * @instance + * @param {google.cloud.connectors.v1.IUpdateConnectionRequest} request UpdateConnectionRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.connectors.v1.Connectors|deleteConnection}. + * @memberof google.cloud.connectors.v1.Connectors + * @typedef DeleteConnectionCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls DeleteConnection. + * @function deleteConnection + * @memberof google.cloud.connectors.v1.Connectors + * @instance + * @param {google.cloud.connectors.v1.IDeleteConnectionRequest} request DeleteConnectionRequest message or plain object + * @param {google.cloud.connectors.v1.Connectors.DeleteConnectionCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Connectors.prototype.deleteConnection = function deleteConnection(request, callback) { + return this.rpcCall(deleteConnection, $root.google.cloud.connectors.v1.DeleteConnectionRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "DeleteConnection" }); + + /** + * Calls DeleteConnection. + * @function deleteConnection + * @memberof google.cloud.connectors.v1.Connectors + * @instance + * @param {google.cloud.connectors.v1.IDeleteConnectionRequest} request DeleteConnectionRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.connectors.v1.Connectors|listProviders}. + * @memberof google.cloud.connectors.v1.Connectors + * @typedef ListProvidersCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.connectors.v1.ListProvidersResponse} [response] ListProvidersResponse + */ + + /** + * Calls ListProviders. + * @function listProviders + * @memberof google.cloud.connectors.v1.Connectors + * @instance + * @param {google.cloud.connectors.v1.IListProvidersRequest} request ListProvidersRequest message or plain object + * @param {google.cloud.connectors.v1.Connectors.ListProvidersCallback} callback Node-style callback called with the error, if any, and ListProvidersResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Connectors.prototype.listProviders = function listProviders(request, callback) { + return this.rpcCall(listProviders, $root.google.cloud.connectors.v1.ListProvidersRequest, $root.google.cloud.connectors.v1.ListProvidersResponse, request, callback); + }, "name", { value: "ListProviders" }); + + /** + * Calls ListProviders. + * @function listProviders + * @memberof google.cloud.connectors.v1.Connectors + * @instance + * @param {google.cloud.connectors.v1.IListProvidersRequest} request ListProvidersRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.connectors.v1.Connectors|getProvider}. + * @memberof google.cloud.connectors.v1.Connectors + * @typedef GetProviderCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.connectors.v1.Provider} [response] Provider + */ + + /** + * Calls GetProvider. + * @function getProvider + * @memberof google.cloud.connectors.v1.Connectors + * @instance + * @param {google.cloud.connectors.v1.IGetProviderRequest} request GetProviderRequest message or plain object + * @param {google.cloud.connectors.v1.Connectors.GetProviderCallback} callback Node-style callback called with the error, if any, and Provider + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Connectors.prototype.getProvider = function getProvider(request, callback) { + return this.rpcCall(getProvider, $root.google.cloud.connectors.v1.GetProviderRequest, $root.google.cloud.connectors.v1.Provider, request, callback); + }, "name", { value: "GetProvider" }); + + /** + * Calls GetProvider. + * @function getProvider + * @memberof google.cloud.connectors.v1.Connectors + * @instance + * @param {google.cloud.connectors.v1.IGetProviderRequest} request GetProviderRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.connectors.v1.Connectors|listConnectors}. + * @memberof google.cloud.connectors.v1.Connectors + * @typedef ListConnectorsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.connectors.v1.ListConnectorsResponse} [response] ListConnectorsResponse + */ + + /** + * Calls ListConnectors. + * @function listConnectors + * @memberof google.cloud.connectors.v1.Connectors + * @instance + * @param {google.cloud.connectors.v1.IListConnectorsRequest} request ListConnectorsRequest message or plain object + * @param {google.cloud.connectors.v1.Connectors.ListConnectorsCallback} callback Node-style callback called with the error, if any, and ListConnectorsResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Connectors.prototype.listConnectors = function listConnectors(request, callback) { + return this.rpcCall(listConnectors, $root.google.cloud.connectors.v1.ListConnectorsRequest, $root.google.cloud.connectors.v1.ListConnectorsResponse, request, callback); + }, "name", { value: "ListConnectors" }); + + /** + * Calls ListConnectors. + * @function listConnectors + * @memberof google.cloud.connectors.v1.Connectors + * @instance + * @param {google.cloud.connectors.v1.IListConnectorsRequest} request ListConnectorsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.connectors.v1.Connectors|getConnector}. + * @memberof google.cloud.connectors.v1.Connectors + * @typedef GetConnectorCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.connectors.v1.Connector} [response] Connector + */ + + /** + * Calls GetConnector. + * @function getConnector + * @memberof google.cloud.connectors.v1.Connectors + * @instance + * @param {google.cloud.connectors.v1.IGetConnectorRequest} request GetConnectorRequest message or plain object + * @param {google.cloud.connectors.v1.Connectors.GetConnectorCallback} callback Node-style callback called with the error, if any, and Connector + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Connectors.prototype.getConnector = function getConnector(request, callback) { + return this.rpcCall(getConnector, $root.google.cloud.connectors.v1.GetConnectorRequest, $root.google.cloud.connectors.v1.Connector, request, callback); + }, "name", { value: "GetConnector" }); + + /** + * Calls GetConnector. + * @function getConnector + * @memberof google.cloud.connectors.v1.Connectors + * @instance + * @param {google.cloud.connectors.v1.IGetConnectorRequest} request GetConnectorRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.connectors.v1.Connectors|listConnectorVersions}. + * @memberof google.cloud.connectors.v1.Connectors + * @typedef ListConnectorVersionsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.connectors.v1.ListConnectorVersionsResponse} [response] ListConnectorVersionsResponse + */ + + /** + * Calls ListConnectorVersions. + * @function listConnectorVersions + * @memberof google.cloud.connectors.v1.Connectors + * @instance + * @param {google.cloud.connectors.v1.IListConnectorVersionsRequest} request ListConnectorVersionsRequest message or plain object + * @param {google.cloud.connectors.v1.Connectors.ListConnectorVersionsCallback} callback Node-style callback called with the error, if any, and ListConnectorVersionsResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Connectors.prototype.listConnectorVersions = function listConnectorVersions(request, callback) { + return this.rpcCall(listConnectorVersions, $root.google.cloud.connectors.v1.ListConnectorVersionsRequest, $root.google.cloud.connectors.v1.ListConnectorVersionsResponse, request, callback); + }, "name", { value: "ListConnectorVersions" }); + + /** + * Calls ListConnectorVersions. + * @function listConnectorVersions + * @memberof google.cloud.connectors.v1.Connectors + * @instance + * @param {google.cloud.connectors.v1.IListConnectorVersionsRequest} request ListConnectorVersionsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.connectors.v1.Connectors|getConnectorVersion}. + * @memberof google.cloud.connectors.v1.Connectors + * @typedef GetConnectorVersionCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.connectors.v1.ConnectorVersion} [response] ConnectorVersion + */ + + /** + * Calls GetConnectorVersion. + * @function getConnectorVersion + * @memberof google.cloud.connectors.v1.Connectors + * @instance + * @param {google.cloud.connectors.v1.IGetConnectorVersionRequest} request GetConnectorVersionRequest message or plain object + * @param {google.cloud.connectors.v1.Connectors.GetConnectorVersionCallback} callback Node-style callback called with the error, if any, and ConnectorVersion + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Connectors.prototype.getConnectorVersion = function getConnectorVersion(request, callback) { + return this.rpcCall(getConnectorVersion, $root.google.cloud.connectors.v1.GetConnectorVersionRequest, $root.google.cloud.connectors.v1.ConnectorVersion, request, callback); + }, "name", { value: "GetConnectorVersion" }); + + /** + * Calls GetConnectorVersion. + * @function getConnectorVersion + * @memberof google.cloud.connectors.v1.Connectors + * @instance + * @param {google.cloud.connectors.v1.IGetConnectorVersionRequest} request GetConnectorVersionRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.connectors.v1.Connectors|getConnectionSchemaMetadata}. + * @memberof google.cloud.connectors.v1.Connectors + * @typedef GetConnectionSchemaMetadataCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.connectors.v1.ConnectionSchemaMetadata} [response] ConnectionSchemaMetadata + */ + + /** + * Calls GetConnectionSchemaMetadata. + * @function getConnectionSchemaMetadata + * @memberof google.cloud.connectors.v1.Connectors + * @instance + * @param {google.cloud.connectors.v1.IGetConnectionSchemaMetadataRequest} request GetConnectionSchemaMetadataRequest message or plain object + * @param {google.cloud.connectors.v1.Connectors.GetConnectionSchemaMetadataCallback} callback Node-style callback called with the error, if any, and ConnectionSchemaMetadata + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Connectors.prototype.getConnectionSchemaMetadata = function getConnectionSchemaMetadata(request, callback) { + return this.rpcCall(getConnectionSchemaMetadata, $root.google.cloud.connectors.v1.GetConnectionSchemaMetadataRequest, $root.google.cloud.connectors.v1.ConnectionSchemaMetadata, request, callback); + }, "name", { value: "GetConnectionSchemaMetadata" }); + + /** + * Calls GetConnectionSchemaMetadata. + * @function getConnectionSchemaMetadata + * @memberof google.cloud.connectors.v1.Connectors + * @instance + * @param {google.cloud.connectors.v1.IGetConnectionSchemaMetadataRequest} request GetConnectionSchemaMetadataRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.connectors.v1.Connectors|refreshConnectionSchemaMetadata}. + * @memberof google.cloud.connectors.v1.Connectors + * @typedef RefreshConnectionSchemaMetadataCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls RefreshConnectionSchemaMetadata. + * @function refreshConnectionSchemaMetadata + * @memberof google.cloud.connectors.v1.Connectors + * @instance + * @param {google.cloud.connectors.v1.IRefreshConnectionSchemaMetadataRequest} request RefreshConnectionSchemaMetadataRequest message or plain object + * @param {google.cloud.connectors.v1.Connectors.RefreshConnectionSchemaMetadataCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Connectors.prototype.refreshConnectionSchemaMetadata = function refreshConnectionSchemaMetadata(request, callback) { + return this.rpcCall(refreshConnectionSchemaMetadata, $root.google.cloud.connectors.v1.RefreshConnectionSchemaMetadataRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "RefreshConnectionSchemaMetadata" }); + + /** + * Calls RefreshConnectionSchemaMetadata. + * @function refreshConnectionSchemaMetadata + * @memberof google.cloud.connectors.v1.Connectors + * @instance + * @param {google.cloud.connectors.v1.IRefreshConnectionSchemaMetadataRequest} request RefreshConnectionSchemaMetadataRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.connectors.v1.Connectors|listRuntimeEntitySchemas}. + * @memberof google.cloud.connectors.v1.Connectors + * @typedef ListRuntimeEntitySchemasCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.connectors.v1.ListRuntimeEntitySchemasResponse} [response] ListRuntimeEntitySchemasResponse + */ + + /** + * Calls ListRuntimeEntitySchemas. + * @function listRuntimeEntitySchemas + * @memberof google.cloud.connectors.v1.Connectors + * @instance + * @param {google.cloud.connectors.v1.IListRuntimeEntitySchemasRequest} request ListRuntimeEntitySchemasRequest message or plain object + * @param {google.cloud.connectors.v1.Connectors.ListRuntimeEntitySchemasCallback} callback Node-style callback called with the error, if any, and ListRuntimeEntitySchemasResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Connectors.prototype.listRuntimeEntitySchemas = function listRuntimeEntitySchemas(request, callback) { + return this.rpcCall(listRuntimeEntitySchemas, $root.google.cloud.connectors.v1.ListRuntimeEntitySchemasRequest, $root.google.cloud.connectors.v1.ListRuntimeEntitySchemasResponse, request, callback); + }, "name", { value: "ListRuntimeEntitySchemas" }); + + /** + * Calls ListRuntimeEntitySchemas. + * @function listRuntimeEntitySchemas + * @memberof google.cloud.connectors.v1.Connectors + * @instance + * @param {google.cloud.connectors.v1.IListRuntimeEntitySchemasRequest} request ListRuntimeEntitySchemasRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.connectors.v1.Connectors|listRuntimeActionSchemas}. + * @memberof google.cloud.connectors.v1.Connectors + * @typedef ListRuntimeActionSchemasCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.connectors.v1.ListRuntimeActionSchemasResponse} [response] ListRuntimeActionSchemasResponse + */ + + /** + * Calls ListRuntimeActionSchemas. + * @function listRuntimeActionSchemas + * @memberof google.cloud.connectors.v1.Connectors + * @instance + * @param {google.cloud.connectors.v1.IListRuntimeActionSchemasRequest} request ListRuntimeActionSchemasRequest message or plain object + * @param {google.cloud.connectors.v1.Connectors.ListRuntimeActionSchemasCallback} callback Node-style callback called with the error, if any, and ListRuntimeActionSchemasResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Connectors.prototype.listRuntimeActionSchemas = function listRuntimeActionSchemas(request, callback) { + return this.rpcCall(listRuntimeActionSchemas, $root.google.cloud.connectors.v1.ListRuntimeActionSchemasRequest, $root.google.cloud.connectors.v1.ListRuntimeActionSchemasResponse, request, callback); + }, "name", { value: "ListRuntimeActionSchemas" }); + + /** + * Calls ListRuntimeActionSchemas. + * @function listRuntimeActionSchemas + * @memberof google.cloud.connectors.v1.Connectors + * @instance + * @param {google.cloud.connectors.v1.IListRuntimeActionSchemasRequest} request ListRuntimeActionSchemasRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.connectors.v1.Connectors|getRuntimeConfig}. + * @memberof google.cloud.connectors.v1.Connectors + * @typedef GetRuntimeConfigCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.connectors.v1.RuntimeConfig} [response] RuntimeConfig + */ + + /** + * Calls GetRuntimeConfig. + * @function getRuntimeConfig + * @memberof google.cloud.connectors.v1.Connectors + * @instance + * @param {google.cloud.connectors.v1.IGetRuntimeConfigRequest} request GetRuntimeConfigRequest message or plain object + * @param {google.cloud.connectors.v1.Connectors.GetRuntimeConfigCallback} callback Node-style callback called with the error, if any, and RuntimeConfig + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Connectors.prototype.getRuntimeConfig = function getRuntimeConfig(request, callback) { + return this.rpcCall(getRuntimeConfig, $root.google.cloud.connectors.v1.GetRuntimeConfigRequest, $root.google.cloud.connectors.v1.RuntimeConfig, request, callback); + }, "name", { value: "GetRuntimeConfig" }); + + /** + * Calls GetRuntimeConfig. + * @function getRuntimeConfig + * @memberof google.cloud.connectors.v1.Connectors + * @instance + * @param {google.cloud.connectors.v1.IGetRuntimeConfigRequest} request GetRuntimeConfigRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.connectors.v1.Connectors|getGlobalSettings}. + * @memberof google.cloud.connectors.v1.Connectors + * @typedef GetGlobalSettingsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.connectors.v1.Settings} [response] Settings + */ + + /** + * Calls GetGlobalSettings. + * @function getGlobalSettings + * @memberof google.cloud.connectors.v1.Connectors + * @instance + * @param {google.cloud.connectors.v1.IGetGlobalSettingsRequest} request GetGlobalSettingsRequest message or plain object + * @param {google.cloud.connectors.v1.Connectors.GetGlobalSettingsCallback} callback Node-style callback called with the error, if any, and Settings + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Connectors.prototype.getGlobalSettings = function getGlobalSettings(request, callback) { + return this.rpcCall(getGlobalSettings, $root.google.cloud.connectors.v1.GetGlobalSettingsRequest, $root.google.cloud.connectors.v1.Settings, request, callback); + }, "name", { value: "GetGlobalSettings" }); + + /** + * Calls GetGlobalSettings. + * @function getGlobalSettings + * @memberof google.cloud.connectors.v1.Connectors + * @instance + * @param {google.cloud.connectors.v1.IGetGlobalSettingsRequest} request GetGlobalSettingsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + return Connectors; + })(); + + v1.Provider = (function() { + + /** + * Properties of a Provider. + * @memberof google.cloud.connectors.v1 + * @interface IProvider + * @property {string|null} [name] Provider name + * @property {google.protobuf.ITimestamp|null} [createTime] Provider createTime + * @property {google.protobuf.ITimestamp|null} [updateTime] Provider updateTime + * @property {Object.|null} [labels] Provider labels + * @property {string|null} [documentationUri] Provider documentationUri + * @property {string|null} [externalUri] Provider externalUri + * @property {string|null} [description] Provider description + * @property {string|null} [webAssetsLocation] Provider webAssetsLocation + * @property {string|null} [displayName] Provider displayName + * @property {google.cloud.connectors.v1.LaunchStage|null} [launchStage] Provider launchStage + */ + + /** + * Constructs a new Provider. + * @memberof google.cloud.connectors.v1 + * @classdesc Represents a Provider. + * @implements IProvider + * @constructor + * @param {google.cloud.connectors.v1.IProvider=} [properties] Properties to set + */ + function Provider(properties) { + this.labels = {}; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Provider name. + * @member {string} name + * @memberof google.cloud.connectors.v1.Provider + * @instance + */ + Provider.prototype.name = ""; + + /** + * Provider createTime. + * @member {google.protobuf.ITimestamp|null|undefined} createTime + * @memberof google.cloud.connectors.v1.Provider + * @instance + */ + Provider.prototype.createTime = null; + + /** + * Provider updateTime. + * @member {google.protobuf.ITimestamp|null|undefined} updateTime + * @memberof google.cloud.connectors.v1.Provider + * @instance + */ + Provider.prototype.updateTime = null; + + /** + * Provider labels. + * @member {Object.} labels + * @memberof google.cloud.connectors.v1.Provider + * @instance + */ + Provider.prototype.labels = $util.emptyObject; + + /** + * Provider documentationUri. + * @member {string} documentationUri + * @memberof google.cloud.connectors.v1.Provider + * @instance + */ + Provider.prototype.documentationUri = ""; + + /** + * Provider externalUri. + * @member {string} externalUri + * @memberof google.cloud.connectors.v1.Provider + * @instance + */ + Provider.prototype.externalUri = ""; + + /** + * Provider description. + * @member {string} description + * @memberof google.cloud.connectors.v1.Provider + * @instance + */ + Provider.prototype.description = ""; + + /** + * Provider webAssetsLocation. + * @member {string} webAssetsLocation + * @memberof google.cloud.connectors.v1.Provider + * @instance + */ + Provider.prototype.webAssetsLocation = ""; + + /** + * Provider displayName. + * @member {string} displayName + * @memberof google.cloud.connectors.v1.Provider + * @instance + */ + Provider.prototype.displayName = ""; + + /** + * Provider launchStage. + * @member {google.cloud.connectors.v1.LaunchStage} launchStage + * @memberof google.cloud.connectors.v1.Provider + * @instance + */ + Provider.prototype.launchStage = 0; + + /** + * Creates a new Provider instance using the specified properties. + * @function create + * @memberof google.cloud.connectors.v1.Provider + * @static + * @param {google.cloud.connectors.v1.IProvider=} [properties] Properties to set + * @returns {google.cloud.connectors.v1.Provider} Provider instance + */ + Provider.create = function create(properties) { + return new Provider(properties); + }; + + /** + * Encodes the specified Provider message. Does not implicitly {@link google.cloud.connectors.v1.Provider.verify|verify} messages. + * @function encode + * @memberof google.cloud.connectors.v1.Provider + * @static + * @param {google.cloud.connectors.v1.IProvider} message Provider message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Provider.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.createTime != null && Object.hasOwnProperty.call(message, "createTime")) + $root.google.protobuf.Timestamp.encode(message.createTime, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + 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(); + if (message.labels != null && Object.hasOwnProperty.call(message, "labels")) + for (var keys = Object.keys(message.labels), i = 0; i < keys.length; ++i) + writer.uint32(/* id 4, wireType 2 =*/34).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.labels[keys[i]]).ldelim(); + if (message.documentationUri != null && Object.hasOwnProperty.call(message, "documentationUri")) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.documentationUri); + if (message.externalUri != null && Object.hasOwnProperty.call(message, "externalUri")) + writer.uint32(/* id 7, wireType 2 =*/58).string(message.externalUri); + if (message.description != null && Object.hasOwnProperty.call(message, "description")) + writer.uint32(/* id 8, wireType 2 =*/66).string(message.description); + if (message.webAssetsLocation != null && Object.hasOwnProperty.call(message, "webAssetsLocation")) + writer.uint32(/* id 9, wireType 2 =*/74).string(message.webAssetsLocation); + if (message.displayName != null && Object.hasOwnProperty.call(message, "displayName")) + writer.uint32(/* id 10, wireType 2 =*/82).string(message.displayName); + if (message.launchStage != null && Object.hasOwnProperty.call(message, "launchStage")) + writer.uint32(/* id 11, wireType 0 =*/88).int32(message.launchStage); + return writer; + }; + + /** + * Encodes the specified Provider message, length delimited. Does not implicitly {@link google.cloud.connectors.v1.Provider.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.connectors.v1.Provider + * @static + * @param {google.cloud.connectors.v1.IProvider} message Provider message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Provider.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Provider message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.connectors.v1.Provider + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.connectors.v1.Provider} Provider + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Provider.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.connectors.v1.Provider(), key, value; + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.createTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 3: { + message.updateTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 4: { + if (message.labels === $util.emptyObject) + message.labels = {}; + 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.labels[key] = value; + break; + } + case 6: { + message.documentationUri = reader.string(); + break; + } + case 7: { + message.externalUri = reader.string(); + break; + } + case 8: { + message.description = reader.string(); + break; + } + case 9: { + message.webAssetsLocation = reader.string(); + break; + } + case 10: { + message.displayName = reader.string(); + break; + } + case 11: { + message.launchStage = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Provider message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.connectors.v1.Provider + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.connectors.v1.Provider} Provider + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Provider.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Provider message. + * @function verify + * @memberof google.cloud.connectors.v1.Provider + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Provider.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.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.labels != null && message.hasOwnProperty("labels")) { + if (!$util.isObject(message.labels)) + return "labels: object expected"; + var key = Object.keys(message.labels); + for (var i = 0; i < key.length; ++i) + if (!$util.isString(message.labels[key[i]])) + return "labels: string{k:string} expected"; + } + if (message.documentationUri != null && message.hasOwnProperty("documentationUri")) + if (!$util.isString(message.documentationUri)) + return "documentationUri: string expected"; + if (message.externalUri != null && message.hasOwnProperty("externalUri")) + if (!$util.isString(message.externalUri)) + return "externalUri: string expected"; + if (message.description != null && message.hasOwnProperty("description")) + if (!$util.isString(message.description)) + return "description: string expected"; + if (message.webAssetsLocation != null && message.hasOwnProperty("webAssetsLocation")) + if (!$util.isString(message.webAssetsLocation)) + return "webAssetsLocation: string expected"; + if (message.displayName != null && message.hasOwnProperty("displayName")) + if (!$util.isString(message.displayName)) + return "displayName: string expected"; + if (message.launchStage != null && message.hasOwnProperty("launchStage")) + switch (message.launchStage) { + default: + return "launchStage: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 5: + break; + } + return null; + }; + + /** + * Creates a Provider message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.connectors.v1.Provider + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.connectors.v1.Provider} Provider + */ + Provider.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.connectors.v1.Provider) + return object; + var message = new $root.google.cloud.connectors.v1.Provider(); + if (object.name != null) + message.name = String(object.name); + if (object.createTime != null) { + if (typeof object.createTime !== "object") + throw TypeError(".google.cloud.connectors.v1.Provider.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.connectors.v1.Provider.updateTime: object expected"); + message.updateTime = $root.google.protobuf.Timestamp.fromObject(object.updateTime); + } + if (object.labels) { + if (typeof object.labels !== "object") + throw TypeError(".google.cloud.connectors.v1.Provider.labels: object expected"); + message.labels = {}; + for (var keys = Object.keys(object.labels), i = 0; i < keys.length; ++i) + message.labels[keys[i]] = String(object.labels[keys[i]]); + } + if (object.documentationUri != null) + message.documentationUri = String(object.documentationUri); + if (object.externalUri != null) + message.externalUri = String(object.externalUri); + if (object.description != null) + message.description = String(object.description); + if (object.webAssetsLocation != null) + message.webAssetsLocation = String(object.webAssetsLocation); + if (object.displayName != null) + message.displayName = String(object.displayName); + 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 "PREVIEW": + case 1: + message.launchStage = 1; + break; + case "GA": + case 2: + message.launchStage = 2; + break; + case "DEPRECATED": + case 3: + message.launchStage = 3; + break; + case "PRIVATE_PREVIEW": + case 5: + message.launchStage = 5; + break; + } + return message; + }; + + /** + * Creates a plain object from a Provider message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.connectors.v1.Provider + * @static + * @param {google.cloud.connectors.v1.Provider} message Provider + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Provider.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.objects || options.defaults) + object.labels = {}; + if (options.defaults) { + object.name = ""; + object.createTime = null; + object.updateTime = null; + object.documentationUri = ""; + object.externalUri = ""; + object.description = ""; + object.webAssetsLocation = ""; + object.displayName = ""; + object.launchStage = options.enums === String ? "LAUNCH_STAGE_UNSPECIFIED" : 0; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + 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); + var keys2; + if (message.labels && (keys2 = Object.keys(message.labels)).length) { + object.labels = {}; + for (var j = 0; j < keys2.length; ++j) + object.labels[keys2[j]] = message.labels[keys2[j]]; + } + if (message.documentationUri != null && message.hasOwnProperty("documentationUri")) + object.documentationUri = message.documentationUri; + if (message.externalUri != null && message.hasOwnProperty("externalUri")) + object.externalUri = message.externalUri; + if (message.description != null && message.hasOwnProperty("description")) + object.description = message.description; + if (message.webAssetsLocation != null && message.hasOwnProperty("webAssetsLocation")) + object.webAssetsLocation = message.webAssetsLocation; + if (message.displayName != null && message.hasOwnProperty("displayName")) + object.displayName = message.displayName; + if (message.launchStage != null && message.hasOwnProperty("launchStage")) + object.launchStage = options.enums === String ? $root.google.cloud.connectors.v1.LaunchStage[message.launchStage] === undefined ? message.launchStage : $root.google.cloud.connectors.v1.LaunchStage[message.launchStage] : message.launchStage; + return object; + }; + + /** + * Converts this Provider to JSON. + * @function toJSON + * @memberof google.cloud.connectors.v1.Provider + * @instance + * @returns {Object.} JSON object + */ + Provider.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Provider + * @function getTypeUrl + * @memberof google.cloud.connectors.v1.Provider + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Provider.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.connectors.v1.Provider"; + }; + + return Provider; + })(); + + v1.GetProviderRequest = (function() { + + /** + * Properties of a GetProviderRequest. + * @memberof google.cloud.connectors.v1 + * @interface IGetProviderRequest + * @property {string|null} [name] GetProviderRequest name + */ + + /** + * Constructs a new GetProviderRequest. + * @memberof google.cloud.connectors.v1 + * @classdesc Represents a GetProviderRequest. + * @implements IGetProviderRequest + * @constructor + * @param {google.cloud.connectors.v1.IGetProviderRequest=} [properties] Properties to set + */ + function GetProviderRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetProviderRequest name. + * @member {string} name + * @memberof google.cloud.connectors.v1.GetProviderRequest + * @instance + */ + GetProviderRequest.prototype.name = ""; + + /** + * Creates a new GetProviderRequest instance using the specified properties. + * @function create + * @memberof google.cloud.connectors.v1.GetProviderRequest + * @static + * @param {google.cloud.connectors.v1.IGetProviderRequest=} [properties] Properties to set + * @returns {google.cloud.connectors.v1.GetProviderRequest} GetProviderRequest instance + */ + GetProviderRequest.create = function create(properties) { + return new GetProviderRequest(properties); + }; + + /** + * Encodes the specified GetProviderRequest message. Does not implicitly {@link google.cloud.connectors.v1.GetProviderRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.connectors.v1.GetProviderRequest + * @static + * @param {google.cloud.connectors.v1.IGetProviderRequest} message GetProviderRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetProviderRequest.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 GetProviderRequest message, length delimited. Does not implicitly {@link google.cloud.connectors.v1.GetProviderRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.connectors.v1.GetProviderRequest + * @static + * @param {google.cloud.connectors.v1.IGetProviderRequest} message GetProviderRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetProviderRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetProviderRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.connectors.v1.GetProviderRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.connectors.v1.GetProviderRequest} GetProviderRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetProviderRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.connectors.v1.GetProviderRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetProviderRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.connectors.v1.GetProviderRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.connectors.v1.GetProviderRequest} GetProviderRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetProviderRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetProviderRequest message. + * @function verify + * @memberof google.cloud.connectors.v1.GetProviderRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetProviderRequest.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 GetProviderRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.connectors.v1.GetProviderRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.connectors.v1.GetProviderRequest} GetProviderRequest + */ + GetProviderRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.connectors.v1.GetProviderRequest) + return object; + var message = new $root.google.cloud.connectors.v1.GetProviderRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a GetProviderRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.connectors.v1.GetProviderRequest + * @static + * @param {google.cloud.connectors.v1.GetProviderRequest} message GetProviderRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetProviderRequest.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 GetProviderRequest to JSON. + * @function toJSON + * @memberof google.cloud.connectors.v1.GetProviderRequest + * @instance + * @returns {Object.} JSON object + */ + GetProviderRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GetProviderRequest + * @function getTypeUrl + * @memberof google.cloud.connectors.v1.GetProviderRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GetProviderRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.connectors.v1.GetProviderRequest"; + }; + + return GetProviderRequest; + })(); + + v1.ListProvidersRequest = (function() { + + /** + * Properties of a ListProvidersRequest. + * @memberof google.cloud.connectors.v1 + * @interface IListProvidersRequest + * @property {string|null} [parent] ListProvidersRequest parent + * @property {number|null} [pageSize] ListProvidersRequest pageSize + * @property {string|null} [pageToken] ListProvidersRequest pageToken + */ + + /** + * Constructs a new ListProvidersRequest. + * @memberof google.cloud.connectors.v1 + * @classdesc Represents a ListProvidersRequest. + * @implements IListProvidersRequest + * @constructor + * @param {google.cloud.connectors.v1.IListProvidersRequest=} [properties] Properties to set + */ + function ListProvidersRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListProvidersRequest parent. + * @member {string} parent + * @memberof google.cloud.connectors.v1.ListProvidersRequest + * @instance + */ + ListProvidersRequest.prototype.parent = ""; + + /** + * ListProvidersRequest pageSize. + * @member {number} pageSize + * @memberof google.cloud.connectors.v1.ListProvidersRequest + * @instance + */ + ListProvidersRequest.prototype.pageSize = 0; + + /** + * ListProvidersRequest pageToken. + * @member {string} pageToken + * @memberof google.cloud.connectors.v1.ListProvidersRequest + * @instance + */ + ListProvidersRequest.prototype.pageToken = ""; + + /** + * Creates a new ListProvidersRequest instance using the specified properties. + * @function create + * @memberof google.cloud.connectors.v1.ListProvidersRequest + * @static + * @param {google.cloud.connectors.v1.IListProvidersRequest=} [properties] Properties to set + * @returns {google.cloud.connectors.v1.ListProvidersRequest} ListProvidersRequest instance + */ + ListProvidersRequest.create = function create(properties) { + return new ListProvidersRequest(properties); + }; + + /** + * Encodes the specified ListProvidersRequest message. Does not implicitly {@link google.cloud.connectors.v1.ListProvidersRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.connectors.v1.ListProvidersRequest + * @static + * @param {google.cloud.connectors.v1.IListProvidersRequest} message ListProvidersRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListProvidersRequest.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 ListProvidersRequest message, length delimited. Does not implicitly {@link google.cloud.connectors.v1.ListProvidersRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.connectors.v1.ListProvidersRequest + * @static + * @param {google.cloud.connectors.v1.IListProvidersRequest} message ListProvidersRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListProvidersRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListProvidersRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.connectors.v1.ListProvidersRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.connectors.v1.ListProvidersRequest} ListProvidersRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListProvidersRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.connectors.v1.ListProvidersRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + 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 ListProvidersRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.connectors.v1.ListProvidersRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.connectors.v1.ListProvidersRequest} ListProvidersRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListProvidersRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListProvidersRequest message. + * @function verify + * @memberof google.cloud.connectors.v1.ListProvidersRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListProvidersRequest.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 ListProvidersRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.connectors.v1.ListProvidersRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.connectors.v1.ListProvidersRequest} ListProvidersRequest + */ + ListProvidersRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.connectors.v1.ListProvidersRequest) + return object; + var message = new $root.google.cloud.connectors.v1.ListProvidersRequest(); + 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 ListProvidersRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.connectors.v1.ListProvidersRequest + * @static + * @param {google.cloud.connectors.v1.ListProvidersRequest} message ListProvidersRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListProvidersRequest.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 ListProvidersRequest to JSON. + * @function toJSON + * @memberof google.cloud.connectors.v1.ListProvidersRequest + * @instance + * @returns {Object.} JSON object + */ + ListProvidersRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListProvidersRequest + * @function getTypeUrl + * @memberof google.cloud.connectors.v1.ListProvidersRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListProvidersRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.connectors.v1.ListProvidersRequest"; + }; + + return ListProvidersRequest; + })(); + + v1.ListProvidersResponse = (function() { + + /** + * Properties of a ListProvidersResponse. + * @memberof google.cloud.connectors.v1 + * @interface IListProvidersResponse + * @property {Array.|null} [providers] ListProvidersResponse providers + * @property {string|null} [nextPageToken] ListProvidersResponse nextPageToken + * @property {Array.|null} [unreachable] ListProvidersResponse unreachable + */ + + /** + * Constructs a new ListProvidersResponse. + * @memberof google.cloud.connectors.v1 + * @classdesc Represents a ListProvidersResponse. + * @implements IListProvidersResponse + * @constructor + * @param {google.cloud.connectors.v1.IListProvidersResponse=} [properties] Properties to set + */ + function ListProvidersResponse(properties) { + this.providers = []; + this.unreachable = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListProvidersResponse providers. + * @member {Array.} providers + * @memberof google.cloud.connectors.v1.ListProvidersResponse + * @instance + */ + ListProvidersResponse.prototype.providers = $util.emptyArray; + + /** + * ListProvidersResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.cloud.connectors.v1.ListProvidersResponse + * @instance + */ + ListProvidersResponse.prototype.nextPageToken = ""; + + /** + * ListProvidersResponse unreachable. + * @member {Array.} unreachable + * @memberof google.cloud.connectors.v1.ListProvidersResponse + * @instance + */ + ListProvidersResponse.prototype.unreachable = $util.emptyArray; + + /** + * Creates a new ListProvidersResponse instance using the specified properties. + * @function create + * @memberof google.cloud.connectors.v1.ListProvidersResponse + * @static + * @param {google.cloud.connectors.v1.IListProvidersResponse=} [properties] Properties to set + * @returns {google.cloud.connectors.v1.ListProvidersResponse} ListProvidersResponse instance + */ + ListProvidersResponse.create = function create(properties) { + return new ListProvidersResponse(properties); + }; + + /** + * Encodes the specified ListProvidersResponse message. Does not implicitly {@link google.cloud.connectors.v1.ListProvidersResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.connectors.v1.ListProvidersResponse + * @static + * @param {google.cloud.connectors.v1.IListProvidersResponse} message ListProvidersResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListProvidersResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.providers != null && message.providers.length) + for (var i = 0; i < message.providers.length; ++i) + $root.google.cloud.connectors.v1.Provider.encode(message.providers[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); + if (message.unreachable != null && message.unreachable.length) + for (var i = 0; i < message.unreachable.length; ++i) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.unreachable[i]); + return writer; + }; + + /** + * Encodes the specified ListProvidersResponse message, length delimited. Does not implicitly {@link google.cloud.connectors.v1.ListProvidersResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.connectors.v1.ListProvidersResponse + * @static + * @param {google.cloud.connectors.v1.IListProvidersResponse} message ListProvidersResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListProvidersResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListProvidersResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.connectors.v1.ListProvidersResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.connectors.v1.ListProvidersResponse} ListProvidersResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListProvidersResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.connectors.v1.ListProvidersResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.providers && message.providers.length)) + message.providers = []; + message.providers.push($root.google.cloud.connectors.v1.Provider.decode(reader, reader.uint32())); + break; + } + case 2: { + message.nextPageToken = reader.string(); + break; + } + case 3: { + if (!(message.unreachable && message.unreachable.length)) + message.unreachable = []; + message.unreachable.push(reader.string()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListProvidersResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.connectors.v1.ListProvidersResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.connectors.v1.ListProvidersResponse} ListProvidersResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListProvidersResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListProvidersResponse message. + * @function verify + * @memberof google.cloud.connectors.v1.ListProvidersResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListProvidersResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.providers != null && message.hasOwnProperty("providers")) { + if (!Array.isArray(message.providers)) + return "providers: array expected"; + for (var i = 0; i < message.providers.length; ++i) { + var error = $root.google.cloud.connectors.v1.Provider.verify(message.providers[i]); + if (error) + return "providers." + error; + } + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + if (message.unreachable != null && message.hasOwnProperty("unreachable")) { + if (!Array.isArray(message.unreachable)) + return "unreachable: array expected"; + for (var i = 0; i < message.unreachable.length; ++i) + if (!$util.isString(message.unreachable[i])) + return "unreachable: string[] expected"; + } + return null; + }; + + /** + * Creates a ListProvidersResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.connectors.v1.ListProvidersResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.connectors.v1.ListProvidersResponse} ListProvidersResponse + */ + ListProvidersResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.connectors.v1.ListProvidersResponse) + return object; + var message = new $root.google.cloud.connectors.v1.ListProvidersResponse(); + if (object.providers) { + if (!Array.isArray(object.providers)) + throw TypeError(".google.cloud.connectors.v1.ListProvidersResponse.providers: array expected"); + message.providers = []; + for (var i = 0; i < object.providers.length; ++i) { + if (typeof object.providers[i] !== "object") + throw TypeError(".google.cloud.connectors.v1.ListProvidersResponse.providers: object expected"); + message.providers[i] = $root.google.cloud.connectors.v1.Provider.fromObject(object.providers[i]); + } + } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + if (object.unreachable) { + if (!Array.isArray(object.unreachable)) + throw TypeError(".google.cloud.connectors.v1.ListProvidersResponse.unreachable: array expected"); + message.unreachable = []; + for (var i = 0; i < object.unreachable.length; ++i) + message.unreachable[i] = String(object.unreachable[i]); + } + return message; + }; + + /** + * Creates a plain object from a ListProvidersResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.connectors.v1.ListProvidersResponse + * @static + * @param {google.cloud.connectors.v1.ListProvidersResponse} message ListProvidersResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListProvidersResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.providers = []; + object.unreachable = []; + } + if (options.defaults) + object.nextPageToken = ""; + if (message.providers && message.providers.length) { + object.providers = []; + for (var j = 0; j < message.providers.length; ++j) + object.providers[j] = $root.google.cloud.connectors.v1.Provider.toObject(message.providers[j], options); + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + object.nextPageToken = message.nextPageToken; + if (message.unreachable && message.unreachable.length) { + object.unreachable = []; + for (var j = 0; j < message.unreachable.length; ++j) + object.unreachable[j] = message.unreachable[j]; + } + return object; + }; + + /** + * Converts this ListProvidersResponse to JSON. + * @function toJSON + * @memberof google.cloud.connectors.v1.ListProvidersResponse + * @instance + * @returns {Object.} JSON object + */ + ListProvidersResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListProvidersResponse + * @function getTypeUrl + * @memberof google.cloud.connectors.v1.ListProvidersResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListProvidersResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.connectors.v1.ListProvidersResponse"; + }; + + return ListProvidersResponse; + })(); + + v1.GetRuntimeConfigRequest = (function() { + + /** + * Properties of a GetRuntimeConfigRequest. + * @memberof google.cloud.connectors.v1 + * @interface IGetRuntimeConfigRequest + * @property {string|null} [name] GetRuntimeConfigRequest name + */ + + /** + * Constructs a new GetRuntimeConfigRequest. + * @memberof google.cloud.connectors.v1 + * @classdesc Represents a GetRuntimeConfigRequest. + * @implements IGetRuntimeConfigRequest + * @constructor + * @param {google.cloud.connectors.v1.IGetRuntimeConfigRequest=} [properties] Properties to set + */ + function GetRuntimeConfigRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetRuntimeConfigRequest name. + * @member {string} name + * @memberof google.cloud.connectors.v1.GetRuntimeConfigRequest + * @instance + */ + GetRuntimeConfigRequest.prototype.name = ""; + + /** + * Creates a new GetRuntimeConfigRequest instance using the specified properties. + * @function create + * @memberof google.cloud.connectors.v1.GetRuntimeConfigRequest + * @static + * @param {google.cloud.connectors.v1.IGetRuntimeConfigRequest=} [properties] Properties to set + * @returns {google.cloud.connectors.v1.GetRuntimeConfigRequest} GetRuntimeConfigRequest instance + */ + GetRuntimeConfigRequest.create = function create(properties) { + return new GetRuntimeConfigRequest(properties); + }; + + /** + * Encodes the specified GetRuntimeConfigRequest message. Does not implicitly {@link google.cloud.connectors.v1.GetRuntimeConfigRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.connectors.v1.GetRuntimeConfigRequest + * @static + * @param {google.cloud.connectors.v1.IGetRuntimeConfigRequest} message GetRuntimeConfigRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetRuntimeConfigRequest.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 GetRuntimeConfigRequest message, length delimited. Does not implicitly {@link google.cloud.connectors.v1.GetRuntimeConfigRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.connectors.v1.GetRuntimeConfigRequest + * @static + * @param {google.cloud.connectors.v1.IGetRuntimeConfigRequest} message GetRuntimeConfigRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetRuntimeConfigRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetRuntimeConfigRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.connectors.v1.GetRuntimeConfigRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.connectors.v1.GetRuntimeConfigRequest} GetRuntimeConfigRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetRuntimeConfigRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.connectors.v1.GetRuntimeConfigRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetRuntimeConfigRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.connectors.v1.GetRuntimeConfigRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.connectors.v1.GetRuntimeConfigRequest} GetRuntimeConfigRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetRuntimeConfigRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetRuntimeConfigRequest message. + * @function verify + * @memberof google.cloud.connectors.v1.GetRuntimeConfigRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetRuntimeConfigRequest.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 GetRuntimeConfigRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.connectors.v1.GetRuntimeConfigRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.connectors.v1.GetRuntimeConfigRequest} GetRuntimeConfigRequest + */ + GetRuntimeConfigRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.connectors.v1.GetRuntimeConfigRequest) + return object; + var message = new $root.google.cloud.connectors.v1.GetRuntimeConfigRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a GetRuntimeConfigRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.connectors.v1.GetRuntimeConfigRequest + * @static + * @param {google.cloud.connectors.v1.GetRuntimeConfigRequest} message GetRuntimeConfigRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetRuntimeConfigRequest.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 GetRuntimeConfigRequest to JSON. + * @function toJSON + * @memberof google.cloud.connectors.v1.GetRuntimeConfigRequest + * @instance + * @returns {Object.} JSON object + */ + GetRuntimeConfigRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GetRuntimeConfigRequest + * @function getTypeUrl + * @memberof google.cloud.connectors.v1.GetRuntimeConfigRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GetRuntimeConfigRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.connectors.v1.GetRuntimeConfigRequest"; + }; + + return GetRuntimeConfigRequest; + })(); + + v1.RuntimeConfig = (function() { + + /** + * Properties of a RuntimeConfig. + * @memberof google.cloud.connectors.v1 + * @interface IRuntimeConfig + * @property {string|null} [locationId] RuntimeConfig locationId + * @property {string|null} [conndTopic] RuntimeConfig conndTopic + * @property {string|null} [conndSubscription] RuntimeConfig conndSubscription + * @property {string|null} [controlPlaneTopic] RuntimeConfig controlPlaneTopic + * @property {string|null} [controlPlaneSubscription] RuntimeConfig controlPlaneSubscription + * @property {string|null} [runtimeEndpoint] RuntimeConfig runtimeEndpoint + * @property {google.cloud.connectors.v1.RuntimeConfig.State|null} [state] RuntimeConfig state + * @property {string|null} [schemaGcsBucket] RuntimeConfig schemaGcsBucket + * @property {string|null} [serviceDirectory] RuntimeConfig serviceDirectory + * @property {string|null} [name] RuntimeConfig name + */ + + /** + * Constructs a new RuntimeConfig. + * @memberof google.cloud.connectors.v1 + * @classdesc Represents a RuntimeConfig. + * @implements IRuntimeConfig + * @constructor + * @param {google.cloud.connectors.v1.IRuntimeConfig=} [properties] Properties to set + */ + function RuntimeConfig(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * RuntimeConfig locationId. + * @member {string} locationId + * @memberof google.cloud.connectors.v1.RuntimeConfig + * @instance + */ + RuntimeConfig.prototype.locationId = ""; + + /** + * RuntimeConfig conndTopic. + * @member {string} conndTopic + * @memberof google.cloud.connectors.v1.RuntimeConfig + * @instance + */ + RuntimeConfig.prototype.conndTopic = ""; + + /** + * RuntimeConfig conndSubscription. + * @member {string} conndSubscription + * @memberof google.cloud.connectors.v1.RuntimeConfig + * @instance + */ + RuntimeConfig.prototype.conndSubscription = ""; + + /** + * RuntimeConfig controlPlaneTopic. + * @member {string} controlPlaneTopic + * @memberof google.cloud.connectors.v1.RuntimeConfig + * @instance + */ + RuntimeConfig.prototype.controlPlaneTopic = ""; + + /** + * RuntimeConfig controlPlaneSubscription. + * @member {string} controlPlaneSubscription + * @memberof google.cloud.connectors.v1.RuntimeConfig + * @instance + */ + RuntimeConfig.prototype.controlPlaneSubscription = ""; + + /** + * RuntimeConfig runtimeEndpoint. + * @member {string} runtimeEndpoint + * @memberof google.cloud.connectors.v1.RuntimeConfig + * @instance + */ + RuntimeConfig.prototype.runtimeEndpoint = ""; + + /** + * RuntimeConfig state. + * @member {google.cloud.connectors.v1.RuntimeConfig.State} state + * @memberof google.cloud.connectors.v1.RuntimeConfig + * @instance + */ + RuntimeConfig.prototype.state = 0; + + /** + * RuntimeConfig schemaGcsBucket. + * @member {string} schemaGcsBucket + * @memberof google.cloud.connectors.v1.RuntimeConfig + * @instance + */ + RuntimeConfig.prototype.schemaGcsBucket = ""; + + /** + * RuntimeConfig serviceDirectory. + * @member {string} serviceDirectory + * @memberof google.cloud.connectors.v1.RuntimeConfig + * @instance + */ + RuntimeConfig.prototype.serviceDirectory = ""; + + /** + * RuntimeConfig name. + * @member {string} name + * @memberof google.cloud.connectors.v1.RuntimeConfig + * @instance + */ + RuntimeConfig.prototype.name = ""; + + /** + * Creates a new RuntimeConfig instance using the specified properties. + * @function create + * @memberof google.cloud.connectors.v1.RuntimeConfig + * @static + * @param {google.cloud.connectors.v1.IRuntimeConfig=} [properties] Properties to set + * @returns {google.cloud.connectors.v1.RuntimeConfig} RuntimeConfig instance + */ + RuntimeConfig.create = function create(properties) { + return new RuntimeConfig(properties); + }; + + /** + * Encodes the specified RuntimeConfig message. Does not implicitly {@link google.cloud.connectors.v1.RuntimeConfig.verify|verify} messages. + * @function encode + * @memberof google.cloud.connectors.v1.RuntimeConfig + * @static + * @param {google.cloud.connectors.v1.IRuntimeConfig} message RuntimeConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RuntimeConfig.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.locationId != null && Object.hasOwnProperty.call(message, "locationId")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.locationId); + if (message.conndTopic != null && Object.hasOwnProperty.call(message, "conndTopic")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.conndTopic); + if (message.conndSubscription != null && Object.hasOwnProperty.call(message, "conndSubscription")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.conndSubscription); + if (message.controlPlaneTopic != null && Object.hasOwnProperty.call(message, "controlPlaneTopic")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.controlPlaneTopic); + if (message.controlPlaneSubscription != null && Object.hasOwnProperty.call(message, "controlPlaneSubscription")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.controlPlaneSubscription); + if (message.runtimeEndpoint != null && Object.hasOwnProperty.call(message, "runtimeEndpoint")) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.runtimeEndpoint); + if (message.state != null && Object.hasOwnProperty.call(message, "state")) + writer.uint32(/* id 7, wireType 0 =*/56).int32(message.state); + if (message.schemaGcsBucket != null && Object.hasOwnProperty.call(message, "schemaGcsBucket")) + writer.uint32(/* id 8, wireType 2 =*/66).string(message.schemaGcsBucket); + if (message.serviceDirectory != null && Object.hasOwnProperty.call(message, "serviceDirectory")) + writer.uint32(/* id 9, wireType 2 =*/74).string(message.serviceDirectory); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 11, wireType 2 =*/90).string(message.name); + return writer; + }; + + /** + * Encodes the specified RuntimeConfig message, length delimited. Does not implicitly {@link google.cloud.connectors.v1.RuntimeConfig.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.connectors.v1.RuntimeConfig + * @static + * @param {google.cloud.connectors.v1.IRuntimeConfig} message RuntimeConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RuntimeConfig.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a RuntimeConfig message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.connectors.v1.RuntimeConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.connectors.v1.RuntimeConfig} RuntimeConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RuntimeConfig.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.connectors.v1.RuntimeConfig(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.locationId = reader.string(); + break; + } + case 2: { + message.conndTopic = reader.string(); + break; + } + case 3: { + message.conndSubscription = reader.string(); + break; + } + case 4: { + message.controlPlaneTopic = reader.string(); + break; + } + case 5: { + message.controlPlaneSubscription = reader.string(); + break; + } + case 6: { + message.runtimeEndpoint = reader.string(); + break; + } + case 7: { + message.state = reader.int32(); + break; + } + case 8: { + message.schemaGcsBucket = reader.string(); + break; + } + case 9: { + message.serviceDirectory = reader.string(); + break; + } + case 11: { + message.name = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a RuntimeConfig message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.connectors.v1.RuntimeConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.connectors.v1.RuntimeConfig} RuntimeConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RuntimeConfig.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a RuntimeConfig message. + * @function verify + * @memberof google.cloud.connectors.v1.RuntimeConfig + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + RuntimeConfig.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.locationId != null && message.hasOwnProperty("locationId")) + if (!$util.isString(message.locationId)) + return "locationId: string expected"; + if (message.conndTopic != null && message.hasOwnProperty("conndTopic")) + if (!$util.isString(message.conndTopic)) + return "conndTopic: string expected"; + if (message.conndSubscription != null && message.hasOwnProperty("conndSubscription")) + if (!$util.isString(message.conndSubscription)) + return "conndSubscription: string expected"; + if (message.controlPlaneTopic != null && message.hasOwnProperty("controlPlaneTopic")) + if (!$util.isString(message.controlPlaneTopic)) + return "controlPlaneTopic: string expected"; + if (message.controlPlaneSubscription != null && message.hasOwnProperty("controlPlaneSubscription")) + if (!$util.isString(message.controlPlaneSubscription)) + return "controlPlaneSubscription: string expected"; + if (message.runtimeEndpoint != null && message.hasOwnProperty("runtimeEndpoint")) + if (!$util.isString(message.runtimeEndpoint)) + return "runtimeEndpoint: string expected"; + if (message.state != null && message.hasOwnProperty("state")) + switch (message.state) { + default: + return "state: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + case 5: + case 6: + break; + } + if (message.schemaGcsBucket != null && message.hasOwnProperty("schemaGcsBucket")) + if (!$util.isString(message.schemaGcsBucket)) + return "schemaGcsBucket: string expected"; + if (message.serviceDirectory != null && message.hasOwnProperty("serviceDirectory")) + if (!$util.isString(message.serviceDirectory)) + return "serviceDirectory: string expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + return null; + }; + + /** + * Creates a RuntimeConfig message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.connectors.v1.RuntimeConfig + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.connectors.v1.RuntimeConfig} RuntimeConfig + */ + RuntimeConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.connectors.v1.RuntimeConfig) + return object; + var message = new $root.google.cloud.connectors.v1.RuntimeConfig(); + if (object.locationId != null) + message.locationId = String(object.locationId); + if (object.conndTopic != null) + message.conndTopic = String(object.conndTopic); + if (object.conndSubscription != null) + message.conndSubscription = String(object.conndSubscription); + if (object.controlPlaneTopic != null) + message.controlPlaneTopic = String(object.controlPlaneTopic); + if (object.controlPlaneSubscription != null) + message.controlPlaneSubscription = String(object.controlPlaneSubscription); + if (object.runtimeEndpoint != null) + message.runtimeEndpoint = String(object.runtimeEndpoint); + 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 "INACTIVE": + case 1: + message.state = 1; + break; + case "ACTIVATING": + case 2: + message.state = 2; + break; + case "ACTIVE": + case 3: + message.state = 3; + break; + case "CREATING": + case 4: + message.state = 4; + break; + case "DELETING": + case 5: + message.state = 5; + break; + case "UPDATING": + case 6: + message.state = 6; + break; + } + if (object.schemaGcsBucket != null) + message.schemaGcsBucket = String(object.schemaGcsBucket); + if (object.serviceDirectory != null) + message.serviceDirectory = String(object.serviceDirectory); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a RuntimeConfig message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.connectors.v1.RuntimeConfig + * @static + * @param {google.cloud.connectors.v1.RuntimeConfig} message RuntimeConfig + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + RuntimeConfig.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.locationId = ""; + object.conndTopic = ""; + object.conndSubscription = ""; + object.controlPlaneTopic = ""; + object.controlPlaneSubscription = ""; + object.runtimeEndpoint = ""; + object.state = options.enums === String ? "STATE_UNSPECIFIED" : 0; + object.schemaGcsBucket = ""; + object.serviceDirectory = ""; + object.name = ""; + } + if (message.locationId != null && message.hasOwnProperty("locationId")) + object.locationId = message.locationId; + if (message.conndTopic != null && message.hasOwnProperty("conndTopic")) + object.conndTopic = message.conndTopic; + if (message.conndSubscription != null && message.hasOwnProperty("conndSubscription")) + object.conndSubscription = message.conndSubscription; + if (message.controlPlaneTopic != null && message.hasOwnProperty("controlPlaneTopic")) + object.controlPlaneTopic = message.controlPlaneTopic; + if (message.controlPlaneSubscription != null && message.hasOwnProperty("controlPlaneSubscription")) + object.controlPlaneSubscription = message.controlPlaneSubscription; + if (message.runtimeEndpoint != null && message.hasOwnProperty("runtimeEndpoint")) + object.runtimeEndpoint = message.runtimeEndpoint; + if (message.state != null && message.hasOwnProperty("state")) + object.state = options.enums === String ? $root.google.cloud.connectors.v1.RuntimeConfig.State[message.state] === undefined ? message.state : $root.google.cloud.connectors.v1.RuntimeConfig.State[message.state] : message.state; + if (message.schemaGcsBucket != null && message.hasOwnProperty("schemaGcsBucket")) + object.schemaGcsBucket = message.schemaGcsBucket; + if (message.serviceDirectory != null && message.hasOwnProperty("serviceDirectory")) + object.serviceDirectory = message.serviceDirectory; + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + return object; + }; + + /** + * Converts this RuntimeConfig to JSON. + * @function toJSON + * @memberof google.cloud.connectors.v1.RuntimeConfig + * @instance + * @returns {Object.} JSON object + */ + RuntimeConfig.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for RuntimeConfig + * @function getTypeUrl + * @memberof google.cloud.connectors.v1.RuntimeConfig + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + RuntimeConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.connectors.v1.RuntimeConfig"; + }; + + /** + * State enum. + * @name google.cloud.connectors.v1.RuntimeConfig.State + * @enum {number} + * @property {number} STATE_UNSPECIFIED=0 STATE_UNSPECIFIED value + * @property {number} INACTIVE=1 INACTIVE value + * @property {number} ACTIVATING=2 ACTIVATING value + * @property {number} ACTIVE=3 ACTIVE value + * @property {number} CREATING=4 CREATING value + * @property {number} DELETING=5 DELETING value + * @property {number} UPDATING=6 UPDATING value + */ + RuntimeConfig.State = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "STATE_UNSPECIFIED"] = 0; + values[valuesById[1] = "INACTIVE"] = 1; + values[valuesById[2] = "ACTIVATING"] = 2; + values[valuesById[3] = "ACTIVE"] = 3; + values[valuesById[4] = "CREATING"] = 4; + values[valuesById[5] = "DELETING"] = 5; + values[valuesById[6] = "UPDATING"] = 6; + return values; + })(); + + return RuntimeConfig; + })(); + + v1.GetGlobalSettingsRequest = (function() { + + /** + * Properties of a GetGlobalSettingsRequest. + * @memberof google.cloud.connectors.v1 + * @interface IGetGlobalSettingsRequest + * @property {string|null} [name] GetGlobalSettingsRequest name + */ + + /** + * Constructs a new GetGlobalSettingsRequest. + * @memberof google.cloud.connectors.v1 + * @classdesc Represents a GetGlobalSettingsRequest. + * @implements IGetGlobalSettingsRequest + * @constructor + * @param {google.cloud.connectors.v1.IGetGlobalSettingsRequest=} [properties] Properties to set + */ + function GetGlobalSettingsRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetGlobalSettingsRequest name. + * @member {string} name + * @memberof google.cloud.connectors.v1.GetGlobalSettingsRequest + * @instance + */ + GetGlobalSettingsRequest.prototype.name = ""; + + /** + * Creates a new GetGlobalSettingsRequest instance using the specified properties. + * @function create + * @memberof google.cloud.connectors.v1.GetGlobalSettingsRequest + * @static + * @param {google.cloud.connectors.v1.IGetGlobalSettingsRequest=} [properties] Properties to set + * @returns {google.cloud.connectors.v1.GetGlobalSettingsRequest} GetGlobalSettingsRequest instance + */ + GetGlobalSettingsRequest.create = function create(properties) { + return new GetGlobalSettingsRequest(properties); + }; + + /** + * Encodes the specified GetGlobalSettingsRequest message. Does not implicitly {@link google.cloud.connectors.v1.GetGlobalSettingsRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.connectors.v1.GetGlobalSettingsRequest + * @static + * @param {google.cloud.connectors.v1.IGetGlobalSettingsRequest} message GetGlobalSettingsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetGlobalSettingsRequest.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 GetGlobalSettingsRequest message, length delimited. Does not implicitly {@link google.cloud.connectors.v1.GetGlobalSettingsRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.connectors.v1.GetGlobalSettingsRequest + * @static + * @param {google.cloud.connectors.v1.IGetGlobalSettingsRequest} message GetGlobalSettingsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetGlobalSettingsRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetGlobalSettingsRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.connectors.v1.GetGlobalSettingsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.connectors.v1.GetGlobalSettingsRequest} GetGlobalSettingsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetGlobalSettingsRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.connectors.v1.GetGlobalSettingsRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetGlobalSettingsRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.connectors.v1.GetGlobalSettingsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.connectors.v1.GetGlobalSettingsRequest} GetGlobalSettingsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetGlobalSettingsRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetGlobalSettingsRequest message. + * @function verify + * @memberof google.cloud.connectors.v1.GetGlobalSettingsRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetGlobalSettingsRequest.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 GetGlobalSettingsRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.connectors.v1.GetGlobalSettingsRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.connectors.v1.GetGlobalSettingsRequest} GetGlobalSettingsRequest + */ + GetGlobalSettingsRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.connectors.v1.GetGlobalSettingsRequest) + return object; + var message = new $root.google.cloud.connectors.v1.GetGlobalSettingsRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a GetGlobalSettingsRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.connectors.v1.GetGlobalSettingsRequest + * @static + * @param {google.cloud.connectors.v1.GetGlobalSettingsRequest} message GetGlobalSettingsRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetGlobalSettingsRequest.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 GetGlobalSettingsRequest to JSON. + * @function toJSON + * @memberof google.cloud.connectors.v1.GetGlobalSettingsRequest + * @instance + * @returns {Object.} JSON object + */ + GetGlobalSettingsRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GetGlobalSettingsRequest + * @function getTypeUrl + * @memberof google.cloud.connectors.v1.GetGlobalSettingsRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GetGlobalSettingsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.connectors.v1.GetGlobalSettingsRequest"; + }; + + return GetGlobalSettingsRequest; + })(); + + v1.Settings = (function() { + + /** + * Properties of a Settings. + * @memberof google.cloud.connectors.v1 + * @interface ISettings + * @property {string|null} [name] Settings name + * @property {boolean|null} [vpcsc] Settings vpcsc + * @property {boolean|null} [payg] Settings payg + */ + + /** + * Constructs a new Settings. + * @memberof google.cloud.connectors.v1 + * @classdesc Represents a Settings. + * @implements ISettings + * @constructor + * @param {google.cloud.connectors.v1.ISettings=} [properties] Properties to set + */ + function Settings(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Settings name. + * @member {string} name + * @memberof google.cloud.connectors.v1.Settings + * @instance + */ + Settings.prototype.name = ""; + + /** + * Settings vpcsc. + * @member {boolean} vpcsc + * @memberof google.cloud.connectors.v1.Settings + * @instance + */ + Settings.prototype.vpcsc = false; + + /** + * Settings payg. + * @member {boolean} payg + * @memberof google.cloud.connectors.v1.Settings + * @instance + */ + Settings.prototype.payg = false; + + /** + * Creates a new Settings instance using the specified properties. + * @function create + * @memberof google.cloud.connectors.v1.Settings + * @static + * @param {google.cloud.connectors.v1.ISettings=} [properties] Properties to set + * @returns {google.cloud.connectors.v1.Settings} Settings instance + */ + Settings.create = function create(properties) { + return new Settings(properties); + }; + + /** + * Encodes the specified Settings message. Does not implicitly {@link google.cloud.connectors.v1.Settings.verify|verify} messages. + * @function encode + * @memberof google.cloud.connectors.v1.Settings + * @static + * @param {google.cloud.connectors.v1.ISettings} message Settings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Settings.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.vpcsc != null && Object.hasOwnProperty.call(message, "vpcsc")) + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.vpcsc); + if (message.payg != null && Object.hasOwnProperty.call(message, "payg")) + writer.uint32(/* id 3, wireType 0 =*/24).bool(message.payg); + return writer; + }; + + /** + * Encodes the specified Settings message, length delimited. Does not implicitly {@link google.cloud.connectors.v1.Settings.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.connectors.v1.Settings + * @static + * @param {google.cloud.connectors.v1.ISettings} message Settings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Settings.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Settings message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.connectors.v1.Settings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.connectors.v1.Settings} Settings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Settings.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.connectors.v1.Settings(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.vpcsc = reader.bool(); + break; + } + case 3: { + message.payg = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Settings message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.connectors.v1.Settings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.connectors.v1.Settings} Settings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Settings.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Settings message. + * @function verify + * @memberof google.cloud.connectors.v1.Settings + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Settings.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.vpcsc != null && message.hasOwnProperty("vpcsc")) + if (typeof message.vpcsc !== "boolean") + return "vpcsc: boolean expected"; + if (message.payg != null && message.hasOwnProperty("payg")) + if (typeof message.payg !== "boolean") + return "payg: boolean expected"; + return null; + }; + + /** + * Creates a Settings message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.connectors.v1.Settings + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.connectors.v1.Settings} Settings + */ + Settings.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.connectors.v1.Settings) + return object; + var message = new $root.google.cloud.connectors.v1.Settings(); + if (object.name != null) + message.name = String(object.name); + if (object.vpcsc != null) + message.vpcsc = Boolean(object.vpcsc); + if (object.payg != null) + message.payg = Boolean(object.payg); + return message; + }; + + /** + * Creates a plain object from a Settings message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.connectors.v1.Settings + * @static + * @param {google.cloud.connectors.v1.Settings} message Settings + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Settings.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.vpcsc = false; + object.payg = false; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.vpcsc != null && message.hasOwnProperty("vpcsc")) + object.vpcsc = message.vpcsc; + if (message.payg != null && message.hasOwnProperty("payg")) + object.payg = message.payg; + return object; + }; + + /** + * Converts this Settings to JSON. + * @function toJSON + * @memberof google.cloud.connectors.v1.Settings + * @instance + * @returns {Object.} JSON object + */ + Settings.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Settings + * @function getTypeUrl + * @memberof google.cloud.connectors.v1.Settings + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Settings.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.connectors.v1.Settings"; + }; + + return Settings; + })(); + + return v1; + })(); + + return connectors; + })(); + + return cloud; + })(); + + google.api = (function() { + + /** + * Namespace api. + * @memberof google + * @namespace + */ + var api = {}; + + /** + * 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 + */ + 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; + 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) { + 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(); + 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) { + 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(); + 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; + })(); + + 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) { + 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(); + 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) { + 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(); + 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) { + 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(); + 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) { + 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(); + 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) { + 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(); + 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 + */ + + /** + * 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; + + /** + * 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(); + 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) { + 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(); + 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; + } + 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: + 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; + } + } + 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; + } + 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]); + } + } + 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; + } + 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); + } + 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) { + 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(); + 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) { + 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(); + 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) { + 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(); + 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) { + 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(); + 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) { + 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(); + 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 + */ + + /** + * 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) { + if (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; + + /** + * 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(); + 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) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.DotnetSettings(); + while (reader.pos < end) { + var tag = reader.uint32(); + 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 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; + } + 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); + } + 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.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 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) { + 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(); + 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) { + 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(); + 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 + */ + + /** + * 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) { + if (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; + + /** + * 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(); + 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) { + 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(); + switch (tag >>> 3) { + case 1: { + message.selector = reader.string(); + break; + } + case 2: { + message.longRunning = $root.google.api.MethodSettings.LongRunning.decode(reader, reader.uint32()); + 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; + } + 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); + } + 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.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); + 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) { + 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(); + 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 + */ + 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; + 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; + })(); + + 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) { + 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(); + 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; + })(); + + 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 {string|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 {string} edition + * @memberof google.protobuf.FileDescriptorProto + * @instance + */ + FileDescriptorProto.prototype.edition = ""; + + /** + * 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 13, wireType 2 =*/106).string(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) { + 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(); + 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 13: { + message.edition = reader.string(); + 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")) + if (!$util.isString(message.edition)) + return "edition: string expected"; + 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); + if (object.edition != null) + message.edition = String(object.edition); + 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 = ""; + } + 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 = 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) { + 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(); + 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) { + 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(); + 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) { + 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(); + 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 + */ + + /** + * 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 = []; + if (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; + + /** + * 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.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) { + 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(); + 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; + } + 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; + } + } + 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]); + } + } + 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.uninterpretedOption = []; + 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"; + }; + + 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) { + 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(); + 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 2: + case 3: + 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_REQUIRED": + case 2: + message.label = 2; + break; + case "LABEL_REPEATED": + case 3: + message.label = 3; + 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_REQUIRED=2 LABEL_REQUIRED value + * @property {number} LABEL_REPEATED=3 LABEL_REPEATED value + */ + FieldDescriptorProto.Label = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[1] = "LABEL_OPTIONAL"] = 1; + values[valuesById[2] = "LABEL_REQUIRED"] = 2; + values[valuesById[3] = "LABEL_REPEATED"] = 3; + 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) { + 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(); + 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) { + 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(); + 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) { + 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(); + 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) { + 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(); + 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) { + 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(); + 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) { + 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(); + 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} [phpGenericServices] FileOptions phpGenericServices + * @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 {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 phpGenericServices. + * @member {boolean} phpGenericServices + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.phpGenericServices = 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 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.phpGenericServices != null && Object.hasOwnProperty.call(message, "phpGenericServices")) + writer.uint32(/* id 42, wireType 0 =*/336).bool(message.phpGenericServices); + 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.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) { + 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(); + 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 42: { + message.phpGenericServices = 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 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.phpGenericServices != null && message.hasOwnProperty("phpGenericServices")) + if (typeof message.phpGenericServices !== "boolean") + return "phpGenericServices: 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.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.phpGenericServices != null) + message.phpGenericServices = Boolean(object.phpGenericServices); + 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.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.phpGenericServices = false; + object.phpMetadataNamespace = ""; + object.rubyPackage = ""; + } + 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.phpGenericServices != null && message.hasOwnProperty("phpGenericServices")) + object.phpGenericServices = message.phpGenericServices; + if (message.phpMetadataNamespace != null && message.hasOwnProperty("phpMetadataNamespace")) + object.phpMetadataNamespace = message.phpMetadataNamespace; + if (message.rubyPackage != null && message.hasOwnProperty("rubyPackage")) + object.rubyPackage = message.rubyPackage; + 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 {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 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.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) { + 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(); + 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 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.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.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[".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.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 {google.protobuf.FieldOptions.OptionTargetType|null} [target] FieldOptions target + * @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.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 target. + * @member {google.protobuf.FieldOptions.OptionTargetType} target + * @memberof google.protobuf.FieldOptions + * @instance + */ + FieldOptions.prototype.target = 0; + + /** + * 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.target != null && Object.hasOwnProperty.call(message, "target")) + writer.uint32(/* id 18, wireType 0 =*/144).int32(message.target); + 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) { + writer.uint32(/* id 1052, wireType 2 =*/8418).fork(); + for (var i = 0; i < message[".google.api.fieldBehavior"].length; ++i) + writer.int32(message[".google.api.fieldBehavior"][i]); + writer.ldelim(); + } + 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) { + 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(); + 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 18: { + message.target = reader.int32(); + 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.target != null && message.hasOwnProperty("target")) + switch (message.target) { + default: + return "target: 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.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: + 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; + } + switch (object.target) { + default: + if (typeof object.target === "number") { + message.target = object.target; + break; + } + break; + case "TARGET_TYPE_UNKNOWN": + case 0: + message.target = 0; + break; + case "TARGET_TYPE_FILE": + case 1: + message.target = 1; + break; + case "TARGET_TYPE_EXTENSION_RANGE": + case 2: + message.target = 2; + break; + case "TARGET_TYPE_MESSAGE": + case 3: + message.target = 3; + break; + case "TARGET_TYPE_FIELD": + case 4: + message.target = 4; + break; + case "TARGET_TYPE_ONEOF": + case 5: + message.target = 5; + break; + case "TARGET_TYPE_ENUM": + case 6: + message.target = 6; + break; + case "TARGET_TYPE_ENUM_ENTRY": + case 7: + message.target = 7; + break; + case "TARGET_TYPE_SERVICE": + case 8: + message.target = 8; + break; + case "TARGET_TYPE_METHOD": + case 9: + message.target = 9; + break; + } + 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; + } + } + 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.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.target = options.enums === String ? "TARGET_TYPE_UNKNOWN" : 0; + 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.target != null && message.hasOwnProperty("target")) + object.target = options.enums === String ? $root.google.protobuf.FieldOptions.OptionTargetType[message.target] === undefined ? message.target : $root.google.protobuf.FieldOptions.OptionTargetType[message.target] : message.target; + 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; + })(); + + return FieldOptions; + })(); + + protobuf.OneofOptions = (function() { + + /** + * Properties of an OneofOptions. + * @memberof google.protobuf + * @interface IOneofOptions + * @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 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.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) { + 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(); + 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; + } + 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.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.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 (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 {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 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.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) { + 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(); + 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 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.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.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; + } + 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.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 {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 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.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) { + 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(); + switch (tag >>> 3) { + case 1: { + 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; + } + 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.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.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; + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + object.deprecated = message.deprecated; + 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 {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 + */ + + /** + * 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 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"] = ""; + + /** + * 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.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"]); + 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) { + 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(); + switch (tag >>> 3) { + 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; + } + 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.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"; + 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.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"]); + 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[".google.api.defaultHost"] = ""; + object[".google.api.oauthScopes"] = ""; + } + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + object.deprecated = message.deprecated; + 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"]; + 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 {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 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.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) { + 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(); + switch (tag >>> 3) { + case 33: { + message.deprecated = reader.bool(); + break; + } + case 34: { + message.idempotencyLevel = reader.int32(); + 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.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.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[".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.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) { + 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(); + 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) { + 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(); + 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.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) { + 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(); + 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) { + 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(); + 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) { + 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(); + 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) { + 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(); + 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.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) { + 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(); + 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.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) { + 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(); + 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.Struct = (function() { + + /** + * Properties of a Struct. + * @memberof google.protobuf + * @interface IStruct + * @property {Object.|null} [fields] Struct fields + */ + + /** + * Constructs a new Struct. + * @memberof google.protobuf + * @classdesc Represents a Struct. + * @implements IStruct + * @constructor + * @param {google.protobuf.IStruct=} [properties] Properties to set + */ + function Struct(properties) { + this.fields = {}; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Struct fields. + * @member {Object.} fields + * @memberof google.protobuf.Struct + * @instance + */ + Struct.prototype.fields = $util.emptyObject; + + /** + * Creates a new Struct instance using the specified properties. + * @function create + * @memberof google.protobuf.Struct + * @static + * @param {google.protobuf.IStruct=} [properties] Properties to set + * @returns {google.protobuf.Struct} Struct instance + */ + Struct.create = function create(properties) { + return new Struct(properties); + }; + + /** + * Encodes the specified Struct message. Does not implicitly {@link google.protobuf.Struct.verify|verify} messages. + * @function encode + * @memberof google.protobuf.Struct + * @static + * @param {google.protobuf.IStruct} message Struct message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Struct.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.fields != null && Object.hasOwnProperty.call(message, "fields")) + for (var keys = Object.keys(message.fields), 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.protobuf.Value.encode(message.fields[keys[i]], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim().ldelim(); + } + return writer; + }; + + /** + * Encodes the specified Struct message, length delimited. Does not implicitly {@link google.protobuf.Struct.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.Struct + * @static + * @param {google.protobuf.IStruct} message Struct message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Struct.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Struct message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.Struct + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.Struct} Struct + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Struct.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.Struct(), key, value; + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (message.fields === $util.emptyObject) + message.fields = {}; + 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.protobuf.Value.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag2 & 7); + break; + } + } + message.fields[key] = value; + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Struct message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.Struct + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.Struct} Struct + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Struct.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Struct message. + * @function verify + * @memberof google.protobuf.Struct + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Struct.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.fields != null && message.hasOwnProperty("fields")) { + if (!$util.isObject(message.fields)) + return "fields: object expected"; + var key = Object.keys(message.fields); + for (var i = 0; i < key.length; ++i) { + var error = $root.google.protobuf.Value.verify(message.fields[key[i]]); + if (error) + return "fields." + error; + } + } + return null; + }; + + /** + * Creates a Struct message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.Struct + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.Struct} Struct + */ + Struct.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.Struct) + return object; + var message = new $root.google.protobuf.Struct(); + if (object.fields) { + if (typeof object.fields !== "object") + throw TypeError(".google.protobuf.Struct.fields: object expected"); + message.fields = {}; + for (var keys = Object.keys(object.fields), i = 0; i < keys.length; ++i) { + if (typeof object.fields[keys[i]] !== "object") + throw TypeError(".google.protobuf.Struct.fields: object expected"); + message.fields[keys[i]] = $root.google.protobuf.Value.fromObject(object.fields[keys[i]]); + } + } + return message; + }; + + /** + * Creates a plain object from a Struct message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.Struct + * @static + * @param {google.protobuf.Struct} message Struct + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Struct.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.objects || options.defaults) + object.fields = {}; + var keys2; + if (message.fields && (keys2 = Object.keys(message.fields)).length) { + object.fields = {}; + for (var j = 0; j < keys2.length; ++j) + object.fields[keys2[j]] = $root.google.protobuf.Value.toObject(message.fields[keys2[j]], options); + } + return object; + }; + + /** + * Converts this Struct to JSON. + * @function toJSON + * @memberof google.protobuf.Struct + * @instance + * @returns {Object.} JSON object + */ + Struct.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Struct + * @function getTypeUrl + * @memberof google.protobuf.Struct + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Struct.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.Struct"; + }; + + return Struct; + })(); + + protobuf.Value = (function() { + + /** + * Properties of a Value. + * @memberof google.protobuf + * @interface IValue + * @property {google.protobuf.NullValue|null} [nullValue] Value nullValue + * @property {number|null} [numberValue] Value numberValue + * @property {string|null} [stringValue] Value stringValue + * @property {boolean|null} [boolValue] Value boolValue + * @property {google.protobuf.IStruct|null} [structValue] Value structValue + * @property {google.protobuf.IListValue|null} [listValue] Value listValue + */ + + /** + * Constructs a new Value. + * @memberof google.protobuf + * @classdesc Represents a Value. + * @implements IValue + * @constructor + * @param {google.protobuf.IValue=} [properties] Properties to set + */ + function Value(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Value nullValue. + * @member {google.protobuf.NullValue|null|undefined} nullValue + * @memberof google.protobuf.Value + * @instance + */ + Value.prototype.nullValue = null; + + /** + * Value numberValue. + * @member {number|null|undefined} numberValue + * @memberof google.protobuf.Value + * @instance + */ + Value.prototype.numberValue = null; + + /** + * Value stringValue. + * @member {string|null|undefined} stringValue + * @memberof google.protobuf.Value + * @instance + */ + Value.prototype.stringValue = null; + + /** + * Value boolValue. + * @member {boolean|null|undefined} boolValue + * @memberof google.protobuf.Value + * @instance + */ + Value.prototype.boolValue = null; + + /** + * Value structValue. + * @member {google.protobuf.IStruct|null|undefined} structValue + * @memberof google.protobuf.Value + * @instance + */ + Value.prototype.structValue = null; + + /** + * Value listValue. + * @member {google.protobuf.IListValue|null|undefined} listValue + * @memberof google.protobuf.Value + * @instance + */ + Value.prototype.listValue = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * Value kind. + * @member {"nullValue"|"numberValue"|"stringValue"|"boolValue"|"structValue"|"listValue"|undefined} kind + * @memberof google.protobuf.Value + * @instance + */ + Object.defineProperty(Value.prototype, "kind", { + get: $util.oneOfGetter($oneOfFields = ["nullValue", "numberValue", "stringValue", "boolValue", "structValue", "listValue"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new Value instance using the specified properties. + * @function create + * @memberof google.protobuf.Value + * @static + * @param {google.protobuf.IValue=} [properties] Properties to set + * @returns {google.protobuf.Value} Value instance + */ + Value.create = function create(properties) { + return new Value(properties); + }; + + /** + * Encodes the specified Value message. Does not implicitly {@link google.protobuf.Value.verify|verify} messages. + * @function encode + * @memberof google.protobuf.Value + * @static + * @param {google.protobuf.IValue} message Value message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Value.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.nullValue != null && Object.hasOwnProperty.call(message, "nullValue")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.nullValue); + if (message.numberValue != null && Object.hasOwnProperty.call(message, "numberValue")) + writer.uint32(/* id 2, wireType 1 =*/17).double(message.numberValue); + if (message.stringValue != null && Object.hasOwnProperty.call(message, "stringValue")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.stringValue); + if (message.boolValue != null && Object.hasOwnProperty.call(message, "boolValue")) + writer.uint32(/* id 4, wireType 0 =*/32).bool(message.boolValue); + if (message.structValue != null && Object.hasOwnProperty.call(message, "structValue")) + $root.google.protobuf.Struct.encode(message.structValue, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.listValue != null && Object.hasOwnProperty.call(message, "listValue")) + $root.google.protobuf.ListValue.encode(message.listValue, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified Value message, length delimited. Does not implicitly {@link google.protobuf.Value.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.Value + * @static + * @param {google.protobuf.IValue} message Value message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Value.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Value message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.Value + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.Value} Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Value.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.Value(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.nullValue = reader.int32(); + break; + } + case 2: { + message.numberValue = reader.double(); + break; + } + case 3: { + message.stringValue = reader.string(); + break; + } + case 4: { + message.boolValue = reader.bool(); + break; + } + case 5: { + message.structValue = $root.google.protobuf.Struct.decode(reader, reader.uint32()); + break; + } + case 6: { + message.listValue = $root.google.protobuf.ListValue.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Value message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.Value + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.Value} Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Value.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Value message. + * @function verify + * @memberof google.protobuf.Value + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Value.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.nullValue != null && message.hasOwnProperty("nullValue")) { + properties.kind = 1; + switch (message.nullValue) { + default: + return "nullValue: enum value expected"; + case 0: + break; + } + } + if (message.numberValue != null && message.hasOwnProperty("numberValue")) { + if (properties.kind === 1) + return "kind: multiple values"; + properties.kind = 1; + if (typeof message.numberValue !== "number") + return "numberValue: number expected"; + } + if (message.stringValue != null && message.hasOwnProperty("stringValue")) { + if (properties.kind === 1) + return "kind: multiple values"; + properties.kind = 1; + if (!$util.isString(message.stringValue)) + return "stringValue: string expected"; + } + if (message.boolValue != null && message.hasOwnProperty("boolValue")) { + if (properties.kind === 1) + return "kind: multiple values"; + properties.kind = 1; + if (typeof message.boolValue !== "boolean") + return "boolValue: boolean expected"; + } + if (message.structValue != null && message.hasOwnProperty("structValue")) { + if (properties.kind === 1) + return "kind: multiple values"; + properties.kind = 1; + { + var error = $root.google.protobuf.Struct.verify(message.structValue); + if (error) + return "structValue." + error; + } + } + if (message.listValue != null && message.hasOwnProperty("listValue")) { + if (properties.kind === 1) + return "kind: multiple values"; + properties.kind = 1; + { + var error = $root.google.protobuf.ListValue.verify(message.listValue); + if (error) + return "listValue." + error; + } + } + return null; + }; + + /** + * Creates a Value message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.Value + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.Value} Value + */ + Value.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.Value) + return object; + var message = new $root.google.protobuf.Value(); + switch (object.nullValue) { + default: + if (typeof object.nullValue === "number") { + message.nullValue = object.nullValue; + break; + } + break; + case "NULL_VALUE": + case 0: + message.nullValue = 0; + break; + } + if (object.numberValue != null) + message.numberValue = Number(object.numberValue); + if (object.stringValue != null) + message.stringValue = String(object.stringValue); + if (object.boolValue != null) + message.boolValue = Boolean(object.boolValue); + if (object.structValue != null) { + if (typeof object.structValue !== "object") + throw TypeError(".google.protobuf.Value.structValue: object expected"); + message.structValue = $root.google.protobuf.Struct.fromObject(object.structValue); + } + if (object.listValue != null) { + if (typeof object.listValue !== "object") + throw TypeError(".google.protobuf.Value.listValue: object expected"); + message.listValue = $root.google.protobuf.ListValue.fromObject(object.listValue); + } + return message; + }; + + /** + * Creates a plain object from a Value message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.Value + * @static + * @param {google.protobuf.Value} message Value + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Value.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.nullValue != null && message.hasOwnProperty("nullValue")) { + object.nullValue = options.enums === String ? $root.google.protobuf.NullValue[message.nullValue] === undefined ? message.nullValue : $root.google.protobuf.NullValue[message.nullValue] : message.nullValue; + if (options.oneofs) + object.kind = "nullValue"; + } + if (message.numberValue != null && message.hasOwnProperty("numberValue")) { + object.numberValue = options.json && !isFinite(message.numberValue) ? String(message.numberValue) : message.numberValue; + if (options.oneofs) + object.kind = "numberValue"; + } + if (message.stringValue != null && message.hasOwnProperty("stringValue")) { + object.stringValue = message.stringValue; + if (options.oneofs) + object.kind = "stringValue"; + } + if (message.boolValue != null && message.hasOwnProperty("boolValue")) { + object.boolValue = message.boolValue; + if (options.oneofs) + object.kind = "boolValue"; + } + if (message.structValue != null && message.hasOwnProperty("structValue")) { + object.structValue = $root.google.protobuf.Struct.toObject(message.structValue, options); + if (options.oneofs) + object.kind = "structValue"; + } + if (message.listValue != null && message.hasOwnProperty("listValue")) { + object.listValue = $root.google.protobuf.ListValue.toObject(message.listValue, options); + if (options.oneofs) + object.kind = "listValue"; + } + return object; + }; + + /** + * Converts this Value to JSON. + * @function toJSON + * @memberof google.protobuf.Value + * @instance + * @returns {Object.} JSON object + */ + Value.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Value + * @function getTypeUrl + * @memberof google.protobuf.Value + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Value.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.Value"; + }; + + return Value; + })(); + + /** + * NullValue enum. + * @name google.protobuf.NullValue + * @enum {number} + * @property {number} NULL_VALUE=0 NULL_VALUE value + */ + protobuf.NullValue = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "NULL_VALUE"] = 0; + return values; + })(); + + protobuf.ListValue = (function() { + + /** + * Properties of a ListValue. + * @memberof google.protobuf + * @interface IListValue + * @property {Array.|null} [values] ListValue values + */ + + /** + * Constructs a new ListValue. + * @memberof google.protobuf + * @classdesc Represents a ListValue. + * @implements IListValue + * @constructor + * @param {google.protobuf.IListValue=} [properties] Properties to set + */ + function ListValue(properties) { + this.values = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListValue values. + * @member {Array.} values + * @memberof google.protobuf.ListValue + * @instance + */ + ListValue.prototype.values = $util.emptyArray; + + /** + * Creates a new ListValue instance using the specified properties. + * @function create + * @memberof google.protobuf.ListValue + * @static + * @param {google.protobuf.IListValue=} [properties] Properties to set + * @returns {google.protobuf.ListValue} ListValue instance + */ + ListValue.create = function create(properties) { + return new ListValue(properties); + }; + + /** + * Encodes the specified ListValue message. Does not implicitly {@link google.protobuf.ListValue.verify|verify} messages. + * @function encode + * @memberof google.protobuf.ListValue + * @static + * @param {google.protobuf.IListValue} message ListValue message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListValue.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.values != null && message.values.length) + for (var i = 0; i < message.values.length; ++i) + $root.google.protobuf.Value.encode(message.values[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified ListValue message, length delimited. Does not implicitly {@link google.protobuf.ListValue.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.ListValue + * @static + * @param {google.protobuf.IListValue} message ListValue message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListValue.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListValue message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.ListValue + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.ListValue} ListValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListValue.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.ListValue(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.values && message.values.length)) + message.values = []; + message.values.push($root.google.protobuf.Value.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListValue message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.ListValue + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.ListValue} ListValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListValue.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListValue message. + * @function verify + * @memberof google.protobuf.ListValue + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListValue.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.values != null && message.hasOwnProperty("values")) { + if (!Array.isArray(message.values)) + return "values: array expected"; + for (var i = 0; i < message.values.length; ++i) { + var error = $root.google.protobuf.Value.verify(message.values[i]); + if (error) + return "values." + error; + } + } + return null; + }; + + /** + * Creates a ListValue message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.ListValue + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.ListValue} ListValue + */ + ListValue.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.ListValue) + return object; + var message = new $root.google.protobuf.ListValue(); + if (object.values) { + if (!Array.isArray(object.values)) + throw TypeError(".google.protobuf.ListValue.values: array expected"); + message.values = []; + for (var i = 0; i < object.values.length; ++i) { + if (typeof object.values[i] !== "object") + throw TypeError(".google.protobuf.ListValue.values: object expected"); + message.values[i] = $root.google.protobuf.Value.fromObject(object.values[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a ListValue message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.ListValue + * @static + * @param {google.protobuf.ListValue} message ListValue + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListValue.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.values = []; + if (message.values && message.values.length) { + object.values = []; + for (var j = 0; j < message.values.length; ++j) + object.values[j] = $root.google.protobuf.Value.toObject(message.values[j], options); + } + return object; + }; + + /** + * Converts this ListValue to JSON. + * @function toJSON + * @memberof google.protobuf.ListValue + * @instance + * @returns {Object.} JSON object + */ + ListValue.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListValue + * @function getTypeUrl + * @memberof google.protobuf.ListValue + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListValue.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.ListValue"; + }; + + return ListValue; + })(); + + 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) { + 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(); + 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) { + 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(); + 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) { + 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(); + 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; + })(); + + 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) { + 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(); + 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) { + 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(); + 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) { + 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(); + 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) { + 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(); + 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) { + 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(); + 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) { + 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(); + 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) { + 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(); + 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) { + 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(); + 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) { + 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(); + 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/google-cloud-connectors/protos/protos.json b/packages/google-cloud-connectors/protos/protos.json new file mode 100644 index 00000000000..e1fba014d95 --- /dev/null +++ b/packages/google-cloud-connectors/protos/protos.json @@ -0,0 +1,4044 @@ +{ + "nested": { + "google": { + "nested": { + "cloud": { + "nested": { + "connectors": { + "nested": { + "v1": { + "options": { + "go_package": "cloud.google.com/go/connectors/apiv1/connectorspb;connectorspb", + "java_multiple_files": true, + "java_outer_classname": "SettingsProto", + "java_package": "com.google.cloud.connectors.v1" + }, + "nested": { + "AuthConfig": { + "oneofs": { + "type": { + "oneof": [ + "userPassword", + "oauth2JwtBearer", + "oauth2ClientCredentials", + "sshPublicKey" + ] + } + }, + "fields": { + "authType": { + "type": "AuthType", + "id": 1 + }, + "userPassword": { + "type": "UserPassword", + "id": 2 + }, + "oauth2JwtBearer": { + "type": "Oauth2JwtBearer", + "id": 3 + }, + "oauth2ClientCredentials": { + "type": "Oauth2ClientCredentials", + "id": 4 + }, + "sshPublicKey": { + "type": "SshPublicKey", + "id": 6 + }, + "additionalVariables": { + "rule": "repeated", + "type": "ConfigVariable", + "id": 5 + } + }, + "nested": { + "UserPassword": { + "fields": { + "username": { + "type": "string", + "id": 1 + }, + "password": { + "type": "Secret", + "id": 2 + } + } + }, + "Oauth2JwtBearer": { + "fields": { + "clientKey": { + "type": "Secret", + "id": 1 + }, + "jwtClaims": { + "type": "JwtClaims", + "id": 2 + } + }, + "nested": { + "JwtClaims": { + "fields": { + "issuer": { + "type": "string", + "id": 1 + }, + "subject": { + "type": "string", + "id": 2 + }, + "audience": { + "type": "string", + "id": 3 + } + } + } + } + }, + "Oauth2ClientCredentials": { + "fields": { + "clientId": { + "type": "string", + "id": 1 + }, + "clientSecret": { + "type": "Secret", + "id": 2 + } + } + }, + "SshPublicKey": { + "fields": { + "username": { + "type": "string", + "id": 1 + }, + "sshClientCert": { + "type": "Secret", + "id": 3 + }, + "certType": { + "type": "string", + "id": 4 + }, + "sshClientCertPass": { + "type": "Secret", + "id": 5 + } + } + } + } + }, + "AuthConfigTemplate": { + "fields": { + "authType": { + "type": "AuthType", + "id": 1 + }, + "configVariableTemplates": { + "rule": "repeated", + "type": "ConfigVariableTemplate", + "id": 2 + }, + "displayName": { + "type": "string", + "id": 3 + }, + "description": { + "type": "string", + "id": 4 + } + } + }, + "AuthType": { + "values": { + "AUTH_TYPE_UNSPECIFIED": 0, + "USER_PASSWORD": 1, + "OAUTH2_JWT_BEARER": 2, + "OAUTH2_CLIENT_CREDENTIALS": 3, + "SSH_PUBLIC_KEY": 4, + "OAUTH2_AUTH_CODE_FLOW": 5 + } + }, + "OperationMetadata": { + "fields": { + "createTime": { + "type": "google.protobuf.Timestamp", + "id": 1, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "endTime": { + "type": "google.protobuf.Timestamp", + "id": 2, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "target": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "verb": { + "type": "string", + "id": 4, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "statusMessage": { + "type": "string", + "id": 5, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "requestedCancellation": { + "type": "bool", + "id": 6, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "apiVersion": { + "type": "string", + "id": 7, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + } + } + }, + "ConfigVariableTemplate": { + "fields": { + "key": { + "type": "string", + "id": 1 + }, + "valueType": { + "type": "ValueType", + "id": 2 + }, + "displayName": { + "type": "string", + "id": 3 + }, + "description": { + "type": "string", + "id": 4 + }, + "validationRegex": { + "type": "string", + "id": 5 + }, + "required": { + "type": "bool", + "id": 6 + }, + "roleGrant": { + "type": "RoleGrant", + "id": 7 + }, + "enumOptions": { + "rule": "repeated", + "type": "EnumOption", + "id": 8 + }, + "authorizationCodeLink": { + "type": "AuthorizationCodeLink", + "id": 9 + }, + "state": { + "type": "State", + "id": 10 + }, + "isAdvanced": { + "type": "bool", + "id": 11 + } + }, + "nested": { + "ValueType": { + "values": { + "VALUE_TYPE_UNSPECIFIED": 0, + "STRING": 1, + "INT": 2, + "BOOL": 3, + "SECRET": 4, + "ENUM": 5, + "AUTHORIZATION_CODE": 6 + } + }, + "State": { + "values": { + "STATE_UNSPECIFIED": 0, + "ACTIVE": 1, + "DEPRECATED": 2 + } + } + } + }, + "Secret": { + "fields": { + "secretVersion": { + "type": "string", + "id": 1 + } + } + }, + "EnumOption": { + "fields": { + "id": { + "type": "string", + "id": 1 + }, + "displayName": { + "type": "string", + "id": 2 + } + } + }, + "ConfigVariable": { + "oneofs": { + "value": { + "oneof": [ + "intValue", + "boolValue", + "stringValue", + "secretValue" + ] + } + }, + "fields": { + "key": { + "type": "string", + "id": 1 + }, + "intValue": { + "type": "int64", + "id": 2 + }, + "boolValue": { + "type": "bool", + "id": 3 + }, + "stringValue": { + "type": "string", + "id": 4 + }, + "secretValue": { + "type": "Secret", + "id": 5 + } + } + }, + "RoleGrant": { + "fields": { + "principal": { + "type": "Principal", + "id": 1 + }, + "roles": { + "rule": "repeated", + "type": "string", + "id": 2 + }, + "resource": { + "type": "Resource", + "id": 3 + }, + "helperTextTemplate": { + "type": "string", + "id": 4 + } + }, + "nested": { + "Principal": { + "values": { + "PRINCIPAL_UNSPECIFIED": 0, + "CONNECTOR_SA": 1 + } + }, + "Resource": { + "fields": { + "type": { + "type": "Type", + "id": 1 + }, + "pathTemplate": { + "type": "string", + "id": 3 + } + }, + "nested": { + "Type": { + "values": { + "TYPE_UNSPECIFIED": 0, + "GCP_PROJECT": 1, + "GCP_RESOURCE": 2, + "GCP_SECRETMANAGER_SECRET": 3, + "GCP_SECRETMANAGER_SECRET_VERSION": 4 + } + } + } + } + } + }, + "AuthorizationCodeLink": { + "fields": { + "uri": { + "type": "string", + "id": 1 + }, + "scopes": { + "rule": "repeated", + "type": "string", + "id": 2 + }, + "clientId": { + "type": "string", + "id": 3 + }, + "enablePkce": { + "type": "bool", + "id": 4 + } + } + }, + "LaunchStage": { + "values": { + "LAUNCH_STAGE_UNSPECIFIED": 0, + "PREVIEW": 1, + "GA": 2, + "DEPRECATED": 3, + "PRIVATE_PREVIEW": 5 + } + }, + "Connection": { + "options": { + "(google.api.resource).type": "connectors.googleapis.com/Connection", + "(google.api.resource).pattern": "projects/{project}/locations/{location}/connections/{connection}" + }, + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "createTime": { + "type": "google.protobuf.Timestamp", + "id": 2, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "updateTime": { + "type": "google.protobuf.Timestamp", + "id": 3, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "labels": { + "keyType": "string", + "type": "string", + "id": 4, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "description": { + "type": "string", + "id": 5, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "connectorVersion": { + "type": "string", + "id": 6, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "connectors.googleapis.com/ConnectorVersion" + } + }, + "status": { + "type": "ConnectionStatus", + "id": 7, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "configVariables": { + "rule": "repeated", + "type": "ConfigVariable", + "id": 8, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "authConfig": { + "type": "AuthConfig", + "id": 9, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "lockConfig": { + "type": "LockConfig", + "id": 10, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "destinationConfigs": { + "rule": "repeated", + "type": "DestinationConfig", + "id": 18, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "imageLocation": { + "type": "string", + "id": 11, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "serviceAccount": { + "type": "string", + "id": 12, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "serviceDirectory": { + "type": "string", + "id": 13, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "envoyImageLocation": { + "type": "string", + "id": 15, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "suspended": { + "type": "bool", + "id": 17, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "nodeConfig": { + "type": "NodeConfig", + "id": 19, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "sslConfig": { + "type": "SslConfig", + "id": 21, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "NodeConfig": { + "fields": { + "minNodeCount": { + "type": "int32", + "id": 1 + }, + "maxNodeCount": { + "type": "int32", + "id": 2 + } + } + }, + "ConnectionSchemaMetadata": { + "options": { + "(google.api.resource).type": "connectors.googleapis.com/ConnectionSchemaMetadata", + "(google.api.resource).pattern": "projects/{project}/locations/{location}/connections/{connection}/connectionSchemaMetadata" + }, + "fields": { + "entities": { + "rule": "repeated", + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "actions": { + "rule": "repeated", + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "name": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "updateTime": { + "type": "google.protobuf.Timestamp", + "id": 4, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "refreshTime": { + "type": "google.protobuf.Timestamp", + "id": 5, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "state": { + "type": "State", + "id": 6, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + } + }, + "nested": { + "State": { + "values": { + "STATE_UNSPECIFIED": 0, + "REFRESHING": 1, + "UPDATED": 2 + } + } + } + }, + "RuntimeEntitySchema": { + "fields": { + "entity": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "fields": { + "rule": "repeated", + "type": "Field", + "id": 2, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + } + }, + "nested": { + "Field": { + "fields": { + "field": { + "type": "string", + "id": 1 + }, + "description": { + "type": "string", + "id": 2 + }, + "dataType": { + "type": "DataType", + "id": 3 + }, + "key": { + "type": "bool", + "id": 4 + }, + "readonly": { + "type": "bool", + "id": 5 + }, + "nullable": { + "type": "bool", + "id": 6 + }, + "defaultValue": { + "type": "google.protobuf.Value", + "id": 7 + }, + "additionalDetails": { + "type": "google.protobuf.Struct", + "id": 8 + } + } + } + } + }, + "RuntimeActionSchema": { + "fields": { + "action": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "inputParameters": { + "rule": "repeated", + "type": "InputParameter", + "id": 2, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "resultMetadata": { + "rule": "repeated", + "type": "ResultMetadata", + "id": 3, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + } + }, + "nested": { + "InputParameter": { + "fields": { + "parameter": { + "type": "string", + "id": 1 + }, + "description": { + "type": "string", + "id": 2 + }, + "dataType": { + "type": "DataType", + "id": 3 + }, + "nullable": { + "type": "bool", + "id": 4 + }, + "defaultValue": { + "type": "google.protobuf.Value", + "id": 5 + } + } + }, + "ResultMetadata": { + "fields": { + "field": { + "type": "string", + "id": 1 + }, + "description": { + "type": "string", + "id": 2 + }, + "dataType": { + "type": "DataType", + "id": 3 + } + } + } + } + }, + "LockConfig": { + "fields": { + "locked": { + "type": "bool", + "id": 1 + }, + "reason": { + "type": "string", + "id": 2 + } + } + }, + "ListConnectionsRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).child_type": "connectors.googleapis.com/Connection" + } + }, + "pageSize": { + "type": "int32", + "id": 2 + }, + "pageToken": { + "type": "string", + "id": 3 + }, + "filter": { + "type": "string", + "id": 4 + }, + "orderBy": { + "type": "string", + "id": 5 + }, + "view": { + "type": "ConnectionView", + "id": 6 + } + } + }, + "ListConnectionsResponse": { + "fields": { + "connections": { + "rule": "repeated", + "type": "Connection", + "id": 1 + }, + "nextPageToken": { + "type": "string", + "id": 2 + }, + "unreachable": { + "rule": "repeated", + "type": "string", + "id": 3 + } + } + }, + "GetConnectionRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "connectors.googleapis.com/Connection" + } + }, + "view": { + "type": "ConnectionView", + "id": 2 + } + } + }, + "CreateConnectionRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).child_type": "connectors.googleapis.com/Connection" + } + }, + "connectionId": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "connection": { + "type": "Connection", + "id": 3, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "UpdateConnectionRequest": { + "fields": { + "connection": { + "type": "Connection", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "updateMask": { + "type": "google.protobuf.FieldMask", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "DeleteConnectionRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "connectors.googleapis.com/Connection" + } + } + } + }, + "GetConnectionSchemaMetadataRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "connectors.googleapis.com/ConnectionSchemaMetadata" + } + } + } + }, + "RefreshConnectionSchemaMetadataRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "connectors.googleapis.com/ConnectionSchemaMetadata" + } + } + } + }, + "ListRuntimeEntitySchemasRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "connectors.googleapis.com/Connection" + } + }, + "pageSize": { + "type": "int32", + "id": 2 + }, + "pageToken": { + "type": "string", + "id": 3 + }, + "filter": { + "type": "string", + "id": 4, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "ListRuntimeEntitySchemasResponse": { + "fields": { + "runtimeEntitySchemas": { + "rule": "repeated", + "type": "RuntimeEntitySchema", + "id": 1 + }, + "nextPageToken": { + "type": "string", + "id": 2 + } + } + }, + "ListRuntimeActionSchemasRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "connectors.googleapis.com/Connection" + } + }, + "pageSize": { + "type": "int32", + "id": 2 + }, + "pageToken": { + "type": "string", + "id": 3 + }, + "filter": { + "type": "string", + "id": 4, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "ListRuntimeActionSchemasResponse": { + "fields": { + "runtimeActionSchemas": { + "rule": "repeated", + "type": "RuntimeActionSchema", + "id": 1 + }, + "nextPageToken": { + "type": "string", + "id": 2 + } + } + }, + "ConnectionStatus": { + "fields": { + "state": { + "type": "State", + "id": 1 + }, + "description": { + "type": "string", + "id": 2 + }, + "status": { + "type": "string", + "id": 3 + } + }, + "nested": { + "State": { + "values": { + "STATE_UNSPECIFIED": 0, + "CREATING": 1, + "ACTIVE": 2, + "INACTIVE": 3, + "DELETING": 4, + "UPDATING": 5, + "ERROR": 6, + "AUTHORIZATION_REQUIRED": 7 + } + } + } + }, + "DataType": { + "valuesOptions": { + "DATA_TYPE_INT": { + "deprecated": true + }, + "DATA_TYPE_DATETIME": { + "deprecated": true + }, + "DATA_TYPE_STRING": { + "deprecated": true + }, + "DATA_TYPE_LONG": { + "deprecated": true + }, + "DATA_TYPE_UUID": { + "deprecated": true + } + }, + "values": { + "DATA_TYPE_UNSPECIFIED": 0, + "DATA_TYPE_INT": 1, + "DATA_TYPE_SMALLINT": 2, + "DATA_TYPE_DOUBLE": 3, + "DATA_TYPE_DATE": 4, + "DATA_TYPE_DATETIME": 5, + "DATA_TYPE_TIME": 6, + "DATA_TYPE_STRING": 7, + "DATA_TYPE_LONG": 8, + "DATA_TYPE_BOOLEAN": 9, + "DATA_TYPE_DECIMAL": 10, + "DATA_TYPE_UUID": 11, + "DATA_TYPE_BLOB": 12, + "DATA_TYPE_BIT": 13, + "DATA_TYPE_TINYINT": 14, + "DATA_TYPE_INTEGER": 15, + "DATA_TYPE_BIGINT": 16, + "DATA_TYPE_FLOAT": 17, + "DATA_TYPE_REAL": 18, + "DATA_TYPE_NUMERIC": 19, + "DATA_TYPE_CHAR": 20, + "DATA_TYPE_VARCHAR": 21, + "DATA_TYPE_LONGVARCHAR": 22, + "DATA_TYPE_TIMESTAMP": 23, + "DATA_TYPE_NCHAR": 24, + "DATA_TYPE_NVARCHAR": 25, + "DATA_TYPE_LONGNVARCHAR": 26, + "DATA_TYPE_NULL": 27, + "DATA_TYPE_OTHER": 28, + "DATA_TYPE_JAVA_OBJECT": 29, + "DATA_TYPE_DISTINCT": 30, + "DATA_TYPE_STRUCT": 31, + "DATA_TYPE_ARRAY": 32, + "DATA_TYPE_CLOB": 33, + "DATA_TYPE_REF": 34, + "DATA_TYPE_DATALINK": 35, + "DATA_TYPE_ROWID": 36, + "DATA_TYPE_BINARY": 37, + "DATA_TYPE_VARBINARY": 38, + "DATA_TYPE_LONGVARBINARY": 39, + "DATA_TYPE_NCLOB": 40, + "DATA_TYPE_SQLXML": 41, + "DATA_TYPE_REF_CURSOR": 42, + "DATA_TYPE_TIME_WITH_TIMEZONE": 43, + "DATA_TYPE_TIMESTAMP_WITH_TIMEZONE": 44 + } + }, + "ConnectionView": { + "values": { + "CONNECTION_VIEW_UNSPECIFIED": 0, + "BASIC": 1, + "FULL": 2 + } + }, + "DestinationConfig": { + "fields": { + "key": { + "type": "string", + "id": 1 + }, + "destinations": { + "rule": "repeated", + "type": "Destination", + "id": 2 + } + } + }, + "Destination": { + "oneofs": { + "destination": { + "oneof": [ + "serviceAttachment", + "host" + ] + } + }, + "fields": { + "serviceAttachment": { + "type": "string", + "id": 1 + }, + "host": { + "type": "string", + "id": 2 + }, + "port": { + "type": "int32", + "id": 3 + } + } + }, + "SslConfigTemplate": { + "fields": { + "sslType": { + "type": "SslType", + "id": 1 + }, + "isTlsMandatory": { + "type": "bool", + "id": 2 + }, + "serverCertType": { + "rule": "repeated", + "type": "CertType", + "id": 3 + }, + "clientCertType": { + "rule": "repeated", + "type": "CertType", + "id": 4 + }, + "additionalVariables": { + "rule": "repeated", + "type": "ConfigVariableTemplate", + "id": 5 + } + } + }, + "SslConfig": { + "fields": { + "type": { + "type": "SslType", + "id": 1 + }, + "trustModel": { + "type": "TrustModel", + "id": 2 + }, + "privateServerCertificate": { + "type": "Secret", + "id": 3 + }, + "clientCertificate": { + "type": "Secret", + "id": 4 + }, + "clientPrivateKey": { + "type": "Secret", + "id": 5 + }, + "clientPrivateKeyPass": { + "type": "Secret", + "id": 6 + }, + "serverCertType": { + "type": "CertType", + "id": 7 + }, + "clientCertType": { + "type": "CertType", + "id": 8 + }, + "useSsl": { + "type": "bool", + "id": 9 + }, + "additionalVariables": { + "rule": "repeated", + "type": "ConfigVariable", + "id": 10 + } + }, + "nested": { + "TrustModel": { + "values": { + "PUBLIC": 0, + "PRIVATE": 1, + "INSECURE": 2 + } + } + } + }, + "SslType": { + "values": { + "SSL_TYPE_UNSPECIFIED": 0, + "TLS": 1, + "MTLS": 2 + } + }, + "CertType": { + "values": { + "CERT_TYPE_UNSPECIFIED": 0, + "PEM": 1 + } + }, + "Connector": { + "options": { + "(google.api.resource).type": "connectors.googleapis.com/Connector", + "(google.api.resource).pattern": "projects/{project}/locations/{location}/providers/{provider}/connectors/{connector}" + }, + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "createTime": { + "type": "google.protobuf.Timestamp", + "id": 2, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "updateTime": { + "type": "google.protobuf.Timestamp", + "id": 3, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "labels": { + "keyType": "string", + "type": "string", + "id": 4, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "documentationUri": { + "type": "string", + "id": 6, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "externalUri": { + "type": "string", + "id": 7, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "description": { + "type": "string", + "id": 8, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "webAssetsLocation": { + "type": "string", + "id": 9, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "displayName": { + "type": "string", + "id": 10, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "launchStage": { + "type": "LaunchStage", + "id": 11, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + } + } + }, + "GetConnectorRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "connectors.googleapis.com/Connector" + } + } + } + }, + "ListConnectorsRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "connectors.googleapis.com/Provider" + } + }, + "pageSize": { + "type": "int32", + "id": 2 + }, + "pageToken": { + "type": "string", + "id": 3 + } + } + }, + "ListConnectorsResponse": { + "fields": { + "connectors": { + "rule": "repeated", + "type": "Connector", + "id": 1 + }, + "nextPageToken": { + "type": "string", + "id": 2 + }, + "unreachable": { + "rule": "repeated", + "type": "string", + "id": 3 + } + } + }, + "ConnectorVersion": { + "options": { + "(google.api.resource).type": "connectors.googleapis.com/ConnectorVersion", + "(google.api.resource).pattern": "projects/{project}/locations/{location}/providers/{provider}/connectors/{connector}/versions/{version}" + }, + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "createTime": { + "type": "google.protobuf.Timestamp", + "id": 2, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "updateTime": { + "type": "google.protobuf.Timestamp", + "id": 3, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "labels": { + "keyType": "string", + "type": "string", + "id": 4, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "launchStage": { + "type": "LaunchStage", + "id": 6, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "releaseVersion": { + "type": "string", + "id": 7, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "authConfigTemplates": { + "rule": "repeated", + "type": "AuthConfigTemplate", + "id": 8, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "configVariableTemplates": { + "rule": "repeated", + "type": "ConfigVariableTemplate", + "id": 9, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "supportedRuntimeFeatures": { + "type": "SupportedRuntimeFeatures", + "id": 10, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "displayName": { + "type": "string", + "id": 11, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "egressControlConfig": { + "type": "EgressControlConfig", + "id": 12, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "roleGrants": { + "rule": "repeated", + "type": "RoleGrant", + "id": 14, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "roleGrant": { + "type": "RoleGrant", + "id": 15, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "sslConfigTemplate": { + "type": "SslConfigTemplate", + "id": 17, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + } + } + }, + "GetConnectorVersionRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "connectors.googleapis.com/ConnectorVersion" + } + }, + "view": { + "type": "ConnectorVersionView", + "id": 2 + } + } + }, + "ListConnectorVersionsRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "connectors.googleapis.com/Connector" + } + }, + "pageSize": { + "type": "int32", + "id": 2 + }, + "pageToken": { + "type": "string", + "id": 3 + }, + "view": { + "type": "ConnectorVersionView", + "id": 4 + } + } + }, + "ListConnectorVersionsResponse": { + "fields": { + "connectorVersions": { + "rule": "repeated", + "type": "ConnectorVersion", + "id": 1 + }, + "nextPageToken": { + "type": "string", + "id": 2 + }, + "unreachable": { + "rule": "repeated", + "type": "string", + "id": 3 + } + } + }, + "SupportedRuntimeFeatures": { + "fields": { + "entityApis": { + "type": "bool", + "id": 1 + }, + "actionApis": { + "type": "bool", + "id": 2 + }, + "sqlQuery": { + "type": "bool", + "id": 3 + } + } + }, + "EgressControlConfig": { + "oneofs": { + "oneofBackends": { + "oneof": [ + "backends", + "extractionRules" + ] + } + }, + "fields": { + "backends": { + "type": "string", + "id": 1 + }, + "extractionRules": { + "type": "ExtractionRules", + "id": 2 + } + } + }, + "ExtractionRules": { + "fields": { + "extractionRule": { + "rule": "repeated", + "type": "ExtractionRule", + "id": 1 + } + } + }, + "ExtractionRule": { + "fields": { + "source": { + "type": "Source", + "id": 1 + }, + "extractionRegex": { + "type": "string", + "id": 2 + } + }, + "nested": { + "Source": { + "fields": { + "sourceType": { + "type": "SourceType", + "id": 1 + }, + "fieldId": { + "type": "string", + "id": 2 + } + } + }, + "SourceType": { + "values": { + "SOURCE_TYPE_UNSPECIFIED": 0, + "CONFIG_VARIABLE": 1 + } + } + } + }, + "ConnectorVersionView": { + "values": { + "CONNECTOR_VERSION_VIEW_UNSPECIFIED": 0, + "CONNECTOR_VERSION_VIEW_BASIC": 1, + "CONNECTOR_VERSION_VIEW_FULL": 2 + } + }, + "Connectors": { + "options": { + "(google.api.default_host)": "connectors.googleapis.com", + "(google.api.oauth_scopes)": "https://www.googleapis.com/auth/cloud-platform" + }, + "methods": { + "ListConnections": { + "requestType": "ListConnectionsRequest", + "responseType": "ListConnectionsResponse", + "options": { + "(google.api.http).get": "/v1/{parent=projects/*/locations/*}/connections", + "(google.api.method_signature)": "parent" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1/{parent=projects/*/locations/*}/connections" + } + }, + { + "(google.api.method_signature)": "parent" + } + ] + }, + "GetConnection": { + "requestType": "GetConnectionRequest", + "responseType": "Connection", + "options": { + "(google.api.http).get": "/v1/{name=projects/*/locations/*/connections/*}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1/{name=projects/*/locations/*/connections/*}" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "CreateConnection": { + "requestType": "CreateConnectionRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).post": "/v1/{parent=projects/*/locations/*}/connections", + "(google.api.http).body": "connection", + "(google.api.method_signature)": "parent,connection,connection_id", + "(google.longrunning.operation_info).response_type": "Connection", + "(google.longrunning.operation_info).metadata_type": "OperationMetadata" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1/{parent=projects/*/locations/*}/connections", + "body": "connection" + } + }, + { + "(google.api.method_signature)": "parent,connection,connection_id" + }, + { + "(google.longrunning.operation_info)": { + "response_type": "Connection", + "metadata_type": "OperationMetadata" + } + } + ] + }, + "UpdateConnection": { + "requestType": "UpdateConnectionRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).patch": "/v1/{connection.name=projects/*/locations/*/connections/*}", + "(google.api.http).body": "connection", + "(google.api.method_signature)": "connection,update_mask", + "(google.longrunning.operation_info).response_type": "Connection", + "(google.longrunning.operation_info).metadata_type": "OperationMetadata" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "patch": "/v1/{connection.name=projects/*/locations/*/connections/*}", + "body": "connection" + } + }, + { + "(google.api.method_signature)": "connection,update_mask" + }, + { + "(google.longrunning.operation_info)": { + "response_type": "Connection", + "metadata_type": "OperationMetadata" + } + } + ] + }, + "DeleteConnection": { + "requestType": "DeleteConnectionRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).delete": "/v1/{name=projects/*/locations/*/connections/*}", + "(google.api.method_signature)": "name", + "(google.longrunning.operation_info).response_type": "google.protobuf.Empty", + "(google.longrunning.operation_info).metadata_type": "OperationMetadata" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "delete": "/v1/{name=projects/*/locations/*/connections/*}" + } + }, + { + "(google.api.method_signature)": "name" + }, + { + "(google.longrunning.operation_info)": { + "response_type": "google.protobuf.Empty", + "metadata_type": "OperationMetadata" + } + } + ] + }, + "ListProviders": { + "requestType": "ListProvidersRequest", + "responseType": "ListProvidersResponse", + "options": { + "(google.api.http).get": "/v1/{parent=projects/*/locations/*}/providers", + "(google.api.method_signature)": "parent" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1/{parent=projects/*/locations/*}/providers" + } + }, + { + "(google.api.method_signature)": "parent" + } + ] + }, + "GetProvider": { + "requestType": "GetProviderRequest", + "responseType": "Provider", + "options": { + "(google.api.http).get": "/v1/{name=projects/*/locations/*/providers/*}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1/{name=projects/*/locations/*/providers/*}" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "ListConnectors": { + "requestType": "ListConnectorsRequest", + "responseType": "ListConnectorsResponse", + "options": { + "(google.api.http).get": "/v1/{parent=projects/*/locations/*/providers/*}/connectors", + "(google.api.method_signature)": "parent" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1/{parent=projects/*/locations/*/providers/*}/connectors" + } + }, + { + "(google.api.method_signature)": "parent" + } + ] + }, + "GetConnector": { + "requestType": "GetConnectorRequest", + "responseType": "Connector", + "options": { + "(google.api.http).get": "/v1/{name=projects/*/locations/*/providers/*/connectors/*}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1/{name=projects/*/locations/*/providers/*/connectors/*}" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "ListConnectorVersions": { + "requestType": "ListConnectorVersionsRequest", + "responseType": "ListConnectorVersionsResponse", + "options": { + "(google.api.http).get": "/v1/{parent=projects/*/locations/*/providers/*/connectors/*}/versions", + "(google.api.method_signature)": "parent" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1/{parent=projects/*/locations/*/providers/*/connectors/*}/versions" + } + }, + { + "(google.api.method_signature)": "parent" + } + ] + }, + "GetConnectorVersion": { + "requestType": "GetConnectorVersionRequest", + "responseType": "ConnectorVersion", + "options": { + "(google.api.http).get": "/v1/{name=projects/*/locations/*/providers/*/connectors/*/versions/*}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1/{name=projects/*/locations/*/providers/*/connectors/*/versions/*}" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "GetConnectionSchemaMetadata": { + "requestType": "GetConnectionSchemaMetadataRequest", + "responseType": "ConnectionSchemaMetadata", + "options": { + "(google.api.http).get": "/v1/{name=projects/*/locations/*/connections/*/connectionSchemaMetadata}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1/{name=projects/*/locations/*/connections/*/connectionSchemaMetadata}" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "RefreshConnectionSchemaMetadata": { + "requestType": "RefreshConnectionSchemaMetadataRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).post": "/v1/{name=projects/*/locations/*/connections/*/connectionSchemaMetadata}:refresh", + "(google.api.http).body": "*", + "(google.api.method_signature)": "name", + "(google.longrunning.operation_info).response_type": "ConnectionSchemaMetadata", + "(google.longrunning.operation_info).metadata_type": "OperationMetadata" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1/{name=projects/*/locations/*/connections/*/connectionSchemaMetadata}:refresh", + "body": "*" + } + }, + { + "(google.api.method_signature)": "name" + }, + { + "(google.longrunning.operation_info)": { + "response_type": "ConnectionSchemaMetadata", + "metadata_type": "OperationMetadata" + } + } + ] + }, + "ListRuntimeEntitySchemas": { + "requestType": "ListRuntimeEntitySchemasRequest", + "responseType": "ListRuntimeEntitySchemasResponse", + "options": { + "(google.api.http).get": "/v1/{parent=projects/*/locations/*/connections/*}/runtimeEntitySchemas", + "(google.api.method_signature)": "parent" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1/{parent=projects/*/locations/*/connections/*}/runtimeEntitySchemas" + } + }, + { + "(google.api.method_signature)": "parent" + } + ] + }, + "ListRuntimeActionSchemas": { + "requestType": "ListRuntimeActionSchemasRequest", + "responseType": "ListRuntimeActionSchemasResponse", + "options": { + "(google.api.http).get": "/v1/{parent=projects/*/locations/*/connections/*}/runtimeActionSchemas", + "(google.api.method_signature)": "parent" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1/{parent=projects/*/locations/*/connections/*}/runtimeActionSchemas" + } + }, + { + "(google.api.method_signature)": "parent" + } + ] + }, + "GetRuntimeConfig": { + "requestType": "GetRuntimeConfigRequest", + "responseType": "RuntimeConfig", + "options": { + "(google.api.http).get": "/v1/{name=projects/*/locations/*/runtimeConfig}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1/{name=projects/*/locations/*/runtimeConfig}" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "GetGlobalSettings": { + "requestType": "GetGlobalSettingsRequest", + "responseType": "Settings", + "options": { + "(google.api.http).get": "/v1/{name=projects/*/locations/global/settings}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1/{name=projects/*/locations/global/settings}" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + } + } + }, + "Provider": { + "options": { + "(google.api.resource).type": "connectors.googleapis.com/Provider", + "(google.api.resource).pattern": "projects/{project}/locations/{location}/providers/{provider}" + }, + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "createTime": { + "type": "google.protobuf.Timestamp", + "id": 2, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "updateTime": { + "type": "google.protobuf.Timestamp", + "id": 3, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "labels": { + "keyType": "string", + "type": "string", + "id": 4, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "documentationUri": { + "type": "string", + "id": 6, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "externalUri": { + "type": "string", + "id": 7, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "description": { + "type": "string", + "id": 8, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "webAssetsLocation": { + "type": "string", + "id": 9, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "displayName": { + "type": "string", + "id": 10, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "launchStage": { + "type": "LaunchStage", + "id": 11, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + } + } + }, + "GetProviderRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "connectors.googleapis.com/Provider" + } + } + } + }, + "ListProvidersRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).child_type": "connectors.googleapis.com/Provider" + } + }, + "pageSize": { + "type": "int32", + "id": 2 + }, + "pageToken": { + "type": "string", + "id": 3 + } + } + }, + "ListProvidersResponse": { + "fields": { + "providers": { + "rule": "repeated", + "type": "Provider", + "id": 1 + }, + "nextPageToken": { + "type": "string", + "id": 2 + }, + "unreachable": { + "rule": "repeated", + "type": "string", + "id": 3 + } + } + }, + "GetRuntimeConfigRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "connectors.googleapis.com/RuntimeConfig" + } + } + } + }, + "RuntimeConfig": { + "options": { + "(google.api.resource).type": "connectors.googleapis.com/RuntimeConfig", + "(google.api.resource).pattern": "projects/{project}/locations/{location}/runtimeConfig" + }, + "fields": { + "locationId": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "conndTopic": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "conndSubscription": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "controlPlaneTopic": { + "type": "string", + "id": 4, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "controlPlaneSubscription": { + "type": "string", + "id": 5, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "runtimeEndpoint": { + "type": "string", + "id": 6, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "state": { + "type": "State", + "id": 7, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "schemaGcsBucket": { + "type": "string", + "id": 8, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "serviceDirectory": { + "type": "string", + "id": 9, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "name": { + "type": "string", + "id": 11, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + } + }, + "nested": { + "State": { + "valuesOptions": { + "INACTIVE": { + "deprecated": true + }, + "ACTIVATING": { + "deprecated": true + } + }, + "values": { + "STATE_UNSPECIFIED": 0, + "INACTIVE": 1, + "ACTIVATING": 2, + "ACTIVE": 3, + "CREATING": 4, + "DELETING": 5, + "UPDATING": 6 + } + } + } + }, + "GetGlobalSettingsRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "connectors.googleapis.com/Settings" + } + } + } + }, + "Settings": { + "options": { + "(google.api.resource).type": "connectors.googleapis.com/Settings", + "(google.api.resource).pattern": "projects/{project}/locations/global/settings" + }, + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "vpcsc": { + "type": "bool", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "payg": { + "type": "bool", + "id": 3, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + } + } + } + } + } + } + } + } + }, + "api": { + "options": { + "go_package": "google.golang.org/genproto/googleapis/api;api", + "java_multiple_files": true, + "java_outer_classname": "LaunchStageProto", + "java_package": "com.google.api", + "objc_class_prefix": "GAPI", + "cc_enable_arenas": true + }, + "nested": { + "fieldBehavior": { + "rule": "repeated", + "type": "google.api.FieldBehavior", + "id": 1052, + "extend": "google.protobuf.FieldOptions" + }, + "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 + } + }, + "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 + } + } + }, + "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" + }, + "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 + } + } + }, + "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 + } + } + }, + "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 + } + }, + "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 + } + }, + "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 + } + } + } + }, + "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": { + "fields": { + "file": { + "rule": "repeated", + "type": "FileDescriptorProto", + "id": 1 + } + } + }, + "FileDescriptorProto": { + "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, + "options": { + "packed": false + } + }, + "weakDependency": { + "rule": "repeated", + "type": "int32", + "id": 11, + "options": { + "packed": false + } + }, + "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": "string", + "id": 13 + } + } + }, + "DescriptorProto": { + "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": { + "fields": { + "uninterpretedOption": { + "rule": "repeated", + "type": "UninterpretedOption", + "id": 999 + } + }, + "extensions": [ + [ + 1000, + 536870911 + ] + ] + }, + "FieldDescriptorProto": { + "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_REQUIRED": 2, + "LABEL_REPEATED": 3 + } + } + } + }, + "OneofDescriptorProto": { + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "options": { + "type": "OneofOptions", + "id": 2 + } + } + }, + "EnumDescriptorProto": { + "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": { + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "number": { + "type": "int32", + "id": 2 + }, + "options": { + "type": "EnumValueOptions", + "id": 3 + } + } + }, + "ServiceDescriptorProto": { + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "method": { + "rule": "repeated", + "type": "MethodDescriptorProto", + "id": 2 + }, + "options": { + "type": "ServiceOptions", + "id": 3 + } + } + }, + "MethodDescriptorProto": { + "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": { + "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 + } + }, + "phpGenericServices": { + "type": "bool", + "id": 42, + "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 + }, + "uninterpretedOption": { + "rule": "repeated", + "type": "UninterpretedOption", + "id": 999 + } + }, + "extensions": [ + [ + 1000, + 536870911 + ] + ], + "reserved": [ + [ + 38, + 38 + ] + ], + "nested": { + "OptimizeMode": { + "values": { + "SPEED": 1, + "CODE_SIZE": 2, + "LITE_RUNTIME": 3 + } + } + } + }, + "MessageOptions": { + "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 + } + }, + "uninterpretedOption": { + "rule": "repeated", + "type": "UninterpretedOption", + "id": 999 + } + }, + "extensions": [ + [ + 1000, + 536870911 + ] + ], + "reserved": [ + [ + 4, + 4 + ], + [ + 5, + 5 + ], + [ + 6, + 6 + ], + [ + 8, + 8 + ], + [ + 9, + 9 + ] + ] + }, + "FieldOptions": { + "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 + }, + "target": { + "type": "OptionTargetType", + "id": 18 + }, + "uninterpretedOption": { + "rule": "repeated", + "type": "UninterpretedOption", + "id": 999 + } + }, + "extensions": [ + [ + 1000, + 536870911 + ] + ], + "reserved": [ + [ + 4, + 4 + ] + ], + "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 + } + } + } + }, + "OneofOptions": { + "fields": { + "uninterpretedOption": { + "rule": "repeated", + "type": "UninterpretedOption", + "id": 999 + } + }, + "extensions": [ + [ + 1000, + 536870911 + ] + ] + }, + "EnumOptions": { + "fields": { + "allowAlias": { + "type": "bool", + "id": 2 + }, + "deprecated": { + "type": "bool", + "id": 3, + "options": { + "default": false + } + }, + "deprecatedLegacyJsonFieldConflicts": { + "type": "bool", + "id": 6, + "options": { + "deprecated": true + } + }, + "uninterpretedOption": { + "rule": "repeated", + "type": "UninterpretedOption", + "id": 999 + } + }, + "extensions": [ + [ + 1000, + 536870911 + ] + ], + "reserved": [ + [ + 5, + 5 + ] + ] + }, + "EnumValueOptions": { + "fields": { + "deprecated": { + "type": "bool", + "id": 1, + "options": { + "default": false + } + }, + "uninterpretedOption": { + "rule": "repeated", + "type": "UninterpretedOption", + "id": 999 + } + }, + "extensions": [ + [ + 1000, + 536870911 + ] + ] + }, + "ServiceOptions": { + "fields": { + "deprecated": { + "type": "bool", + "id": 33, + "options": { + "default": false + } + }, + "uninterpretedOption": { + "rule": "repeated", + "type": "UninterpretedOption", + "id": 999 + } + }, + "extensions": [ + [ + 1000, + 536870911 + ] + ] + }, + "MethodOptions": { + "fields": { + "deprecated": { + "type": "bool", + "id": 33, + "options": { + "default": false + } + }, + "idempotencyLevel": { + "type": "IdempotencyLevel", + "id": 34, + "options": { + "default": "IDEMPOTENCY_UNKNOWN" + } + }, + "uninterpretedOption": { + "rule": "repeated", + "type": "UninterpretedOption", + "id": 999 + } + }, + "extensions": [ + [ + 1000, + 536870911 + ] + ], + "nested": { + "IdempotencyLevel": { + "values": { + "IDEMPOTENCY_UNKNOWN": 0, + "NO_SIDE_EFFECTS": 1, + "IDEMPOTENT": 2 + } + } + } + }, + "UninterpretedOption": { + "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 + } + } + } + } + }, + "SourceCodeInfo": { + "fields": { + "location": { + "rule": "repeated", + "type": "Location", + "id": 1 + } + }, + "nested": { + "Location": { + "fields": { + "path": { + "rule": "repeated", + "type": "int32", + "id": 1 + }, + "span": { + "rule": "repeated", + "type": "int32", + "id": 2 + }, + "leadingComments": { + "type": "string", + "id": 3 + }, + "trailingComments": { + "type": "string", + "id": 4 + }, + "leadingDetachedComments": { + "rule": "repeated", + "type": "string", + "id": 6 + } + } + } + } + }, + "GeneratedCodeInfo": { + "fields": { + "annotation": { + "rule": "repeated", + "type": "Annotation", + "id": 1 + } + }, + "nested": { + "Annotation": { + "fields": { + "path": { + "rule": "repeated", + "type": "int32", + "id": 1 + }, + "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 + } + } + } + } + } + }, + "Timestamp": { + "fields": { + "seconds": { + "type": "int64", + "id": 1 + }, + "nanos": { + "type": "int32", + "id": 2 + } + } + }, + "FieldMask": { + "fields": { + "paths": { + "rule": "repeated", + "type": "string", + "id": 1 + } + } + }, + "Struct": { + "fields": { + "fields": { + "keyType": "string", + "type": "Value", + "id": 1 + } + } + }, + "Value": { + "oneofs": { + "kind": { + "oneof": [ + "nullValue", + "numberValue", + "stringValue", + "boolValue", + "structValue", + "listValue" + ] + } + }, + "fields": { + "nullValue": { + "type": "NullValue", + "id": 1 + }, + "numberValue": { + "type": "double", + "id": 2 + }, + "stringValue": { + "type": "string", + "id": 3 + }, + "boolValue": { + "type": "bool", + "id": 4 + }, + "structValue": { + "type": "Struct", + "id": 5 + }, + "listValue": { + "type": "ListValue", + "id": 6 + } + } + }, + "NullValue": { + "values": { + "NULL_VALUE": 0 + } + }, + "ListValue": { + "fields": { + "values": { + "rule": "repeated", + "type": "Value", + "id": 1 + } + } + }, + "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": {} + } + } + }, + "longrunning": { + "options": { + "cc_enable_arenas": true, + "csharp_namespace": "Google.LongRunning", + "go_package": "google.golang.org/genproto/googleapis/longrunning;longrunning", + "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/google-cloud-connectors/samples/README.md b/packages/google-cloud-connectors/samples/README.md new file mode 100644 index 00000000000..6665d886a7a --- /dev/null +++ b/packages/google-cloud-connectors/samples/README.md @@ -0,0 +1,356 @@ +[//]: # "This README.md file is auto-generated, all changes to this file will be lost." +[//]: # "To regenerate it, use `python -m synthtool`." +Google Cloud Platform logo + +# [Connectors API: Node.js Samples](https://github.com/googleapis/google-cloud-node) + +[![Open in Cloud Shell][shell_img]][shell_link] + + + +## Table of Contents + +* [Before you begin](#before-you-begin) +* [Samples](#samples) + * [Connectors.create_connection](#connectors.create_connection) + * [Connectors.delete_connection](#connectors.delete_connection) + * [Connectors.get_connection](#connectors.get_connection) + * [Connectors.get_connection_schema_metadata](#connectors.get_connection_schema_metadata) + * [Connectors.get_connector](#connectors.get_connector) + * [Connectors.get_connector_version](#connectors.get_connector_version) + * [Connectors.get_global_settings](#connectors.get_global_settings) + * [Connectors.get_provider](#connectors.get_provider) + * [Connectors.get_runtime_config](#connectors.get_runtime_config) + * [Connectors.list_connections](#connectors.list_connections) + * [Connectors.list_connector_versions](#connectors.list_connector_versions) + * [Connectors.list_connectors](#connectors.list_connectors) + * [Connectors.list_providers](#connectors.list_providers) + * [Connectors.list_runtime_action_schemas](#connectors.list_runtime_action_schemas) + * [Connectors.list_runtime_entity_schemas](#connectors.list_runtime_entity_schemas) + * [Connectors.refresh_connection_schema_metadata](#connectors.refresh_connection_schema_metadata) + * [Connectors.update_connection](#connectors.update_connection) + * [Quickstart](#quickstart) + +## Before you begin + +Before running the samples, make sure you've followed the steps outlined in +[Using the client library](https://github.com/googleapis/google-cloud-node#using-the-client-library). + +`cd samples` + +`npm install` + +`cd ..` + +## Samples + + + +### Connectors.create_connection + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-connectors/samples/generated/v1/connectors.create_connection.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-cloud-connectors/samples/generated/v1/connectors.create_connection.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-connectors/samples/generated/v1/connectors.create_connection.js` + + +----- + + + + +### Connectors.delete_connection + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-connectors/samples/generated/v1/connectors.delete_connection.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-cloud-connectors/samples/generated/v1/connectors.delete_connection.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-connectors/samples/generated/v1/connectors.delete_connection.js` + + +----- + + + + +### Connectors.get_connection + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-connectors/samples/generated/v1/connectors.get_connection.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-cloud-connectors/samples/generated/v1/connectors.get_connection.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-connectors/samples/generated/v1/connectors.get_connection.js` + + +----- + + + + +### Connectors.get_connection_schema_metadata + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-connectors/samples/generated/v1/connectors.get_connection_schema_metadata.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-cloud-connectors/samples/generated/v1/connectors.get_connection_schema_metadata.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-connectors/samples/generated/v1/connectors.get_connection_schema_metadata.js` + + +----- + + + + +### Connectors.get_connector + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-connectors/samples/generated/v1/connectors.get_connector.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-cloud-connectors/samples/generated/v1/connectors.get_connector.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-connectors/samples/generated/v1/connectors.get_connector.js` + + +----- + + + + +### Connectors.get_connector_version + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-connectors/samples/generated/v1/connectors.get_connector_version.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-cloud-connectors/samples/generated/v1/connectors.get_connector_version.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-connectors/samples/generated/v1/connectors.get_connector_version.js` + + +----- + + + + +### Connectors.get_global_settings + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-connectors/samples/generated/v1/connectors.get_global_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-cloud-connectors/samples/generated/v1/connectors.get_global_settings.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-connectors/samples/generated/v1/connectors.get_global_settings.js` + + +----- + + + + +### Connectors.get_provider + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-connectors/samples/generated/v1/connectors.get_provider.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-cloud-connectors/samples/generated/v1/connectors.get_provider.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-connectors/samples/generated/v1/connectors.get_provider.js` + + +----- + + + + +### Connectors.get_runtime_config + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-connectors/samples/generated/v1/connectors.get_runtime_config.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-cloud-connectors/samples/generated/v1/connectors.get_runtime_config.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-connectors/samples/generated/v1/connectors.get_runtime_config.js` + + +----- + + + + +### Connectors.list_connections + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-connectors/samples/generated/v1/connectors.list_connections.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-cloud-connectors/samples/generated/v1/connectors.list_connections.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-connectors/samples/generated/v1/connectors.list_connections.js` + + +----- + + + + +### Connectors.list_connector_versions + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-connectors/samples/generated/v1/connectors.list_connector_versions.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-cloud-connectors/samples/generated/v1/connectors.list_connector_versions.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-connectors/samples/generated/v1/connectors.list_connector_versions.js` + + +----- + + + + +### Connectors.list_connectors + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-connectors/samples/generated/v1/connectors.list_connectors.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-cloud-connectors/samples/generated/v1/connectors.list_connectors.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-connectors/samples/generated/v1/connectors.list_connectors.js` + + +----- + + + + +### Connectors.list_providers + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-connectors/samples/generated/v1/connectors.list_providers.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-cloud-connectors/samples/generated/v1/connectors.list_providers.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-connectors/samples/generated/v1/connectors.list_providers.js` + + +----- + + + + +### Connectors.list_runtime_action_schemas + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-connectors/samples/generated/v1/connectors.list_runtime_action_schemas.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-cloud-connectors/samples/generated/v1/connectors.list_runtime_action_schemas.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-connectors/samples/generated/v1/connectors.list_runtime_action_schemas.js` + + +----- + + + + +### Connectors.list_runtime_entity_schemas + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-connectors/samples/generated/v1/connectors.list_runtime_entity_schemas.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-cloud-connectors/samples/generated/v1/connectors.list_runtime_entity_schemas.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-connectors/samples/generated/v1/connectors.list_runtime_entity_schemas.js` + + +----- + + + + +### Connectors.refresh_connection_schema_metadata + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-connectors/samples/generated/v1/connectors.refresh_connection_schema_metadata.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-cloud-connectors/samples/generated/v1/connectors.refresh_connection_schema_metadata.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-connectors/samples/generated/v1/connectors.refresh_connection_schema_metadata.js` + + +----- + + + + +### Connectors.update_connection + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-connectors/samples/generated/v1/connectors.update_connection.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-cloud-connectors/samples/generated/v1/connectors.update_connection.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-connectors/samples/generated/v1/connectors.update_connection.js` + + +----- + + + + +### Quickstart + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-connectors/samples/quickstart.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-cloud-connectors/samples/quickstart.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-connectors/samples/quickstart.js` + + + + + + +[shell_img]: https://gstatic.com/cloudssh/images/open-btn.png +[shell_link]: https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=samples/README.md +[product-docs]: diff --git a/packages/google-cloud-connectors/samples/generated/v1/connectors.create_connection.js b/packages/google-cloud-connectors/samples/generated/v1/connectors.create_connection.js new file mode 100644 index 00000000000..c6d7fe861cb --- /dev/null +++ b/packages/google-cloud-connectors/samples/generated/v1/connectors.create_connection.js @@ -0,0 +1,74 @@ +// Copyright 2023 Google LLC +// +// Licensed under the Apache License, Version 2.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, connectionId, connection) { + // [START connectors_v1_generated_Connectors_CreateConnection_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. Parent resource of the Connection, of the form: + * `projects/* /locations/*` + */ + // const parent = 'abc123' + /** + * Required. Identifier to assign to the Connection. Must be unique within + * scope of the parent resource. + */ + // const connectionId = 'abc123' + /** + * Required. Connection resource. + */ + // const connection = {} + + // Imports the Connectors library + const {ConnectorsClient} = require('@google-cloud/connectors').v1; + + // Instantiates a client + const connectorsClient = new ConnectorsClient(); + + async function callCreateConnection() { + // Construct request + const request = { + parent, + connectionId, + connection, + }; + + // Run request + const [operation] = await connectorsClient.createConnection(request); + const [response] = await operation.promise(); + console.log(response); + } + + callCreateConnection(); + // [END connectors_v1_generated_Connectors_CreateConnection_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-connectors/samples/generated/v1/connectors.delete_connection.js b/packages/google-cloud-connectors/samples/generated/v1/connectors.delete_connection.js new file mode 100644 index 00000000000..36cd11e8439 --- /dev/null +++ b/packages/google-cloud-connectors/samples/generated/v1/connectors.delete_connection.js @@ -0,0 +1,63 @@ +// Copyright 2023 Google LLC +// +// Licensed under the Apache License, Version 2.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 connectors_v1_generated_Connectors_DeleteConnection_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. Resource name of the form: + * `projects/* /locations/* /connections/*` + */ + // const name = 'abc123' + + // Imports the Connectors library + const {ConnectorsClient} = require('@google-cloud/connectors').v1; + + // Instantiates a client + const connectorsClient = new ConnectorsClient(); + + async function callDeleteConnection() { + // Construct request + const request = { + name, + }; + + // Run request + const [operation] = await connectorsClient.deleteConnection(request); + const [response] = await operation.promise(); + console.log(response); + } + + callDeleteConnection(); + // [END connectors_v1_generated_Connectors_DeleteConnection_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-connectors/samples/generated/v1/connectors.get_connection.js b/packages/google-cloud-connectors/samples/generated/v1/connectors.get_connection.js new file mode 100644 index 00000000000..4da725507f2 --- /dev/null +++ b/packages/google-cloud-connectors/samples/generated/v1/connectors.get_connection.js @@ -0,0 +1,67 @@ +// Copyright 2023 Google LLC +// +// Licensed under the Apache License, Version 2.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 connectors_v1_generated_Connectors_GetConnection_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. Resource name of the form: + * `projects/* /locations/* /connections/*` + */ + // const name = 'abc123' + /** + * Specifies which fields of the Connection are returned in the response. + * Defaults to `BASIC` view. + */ + // const view = {} + + // Imports the Connectors library + const {ConnectorsClient} = require('@google-cloud/connectors').v1; + + // Instantiates a client + const connectorsClient = new ConnectorsClient(); + + async function callGetConnection() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await connectorsClient.getConnection(request); + console.log(response); + } + + callGetConnection(); + // [END connectors_v1_generated_Connectors_GetConnection_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-connectors/samples/generated/v1/connectors.get_connection_schema_metadata.js b/packages/google-cloud-connectors/samples/generated/v1/connectors.get_connection_schema_metadata.js new file mode 100644 index 00000000000..c64889ac5f8 --- /dev/null +++ b/packages/google-cloud-connectors/samples/generated/v1/connectors.get_connection_schema_metadata.js @@ -0,0 +1,63 @@ +// Copyright 2023 Google LLC +// +// Licensed under the Apache License, Version 2.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 connectors_v1_generated_Connectors_GetConnectionSchemaMetadata_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. Connection name + * Format: + * projects/{project}/locations/{location}/connections/{connection}/connectionSchemaMetadata + */ + // const name = 'abc123' + + // Imports the Connectors library + const {ConnectorsClient} = require('@google-cloud/connectors').v1; + + // Instantiates a client + const connectorsClient = new ConnectorsClient(); + + async function callGetConnectionSchemaMetadata() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await connectorsClient.getConnectionSchemaMetadata(request); + console.log(response); + } + + callGetConnectionSchemaMetadata(); + // [END connectors_v1_generated_Connectors_GetConnectionSchemaMetadata_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-connectors/samples/generated/v1/connectors.get_connector.js b/packages/google-cloud-connectors/samples/generated/v1/connectors.get_connector.js new file mode 100644 index 00000000000..03efc2f445c --- /dev/null +++ b/packages/google-cloud-connectors/samples/generated/v1/connectors.get_connector.js @@ -0,0 +1,63 @@ +// Copyright 2023 Google LLC +// +// Licensed under the Apache License, Version 2.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 connectors_v1_generated_Connectors_GetConnector_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. Resource name of the form: + * `projects/* /locations/* /providers/* /connectors/*` + * Only global location is supported for Connector resource. + */ + // const name = 'abc123' + + // Imports the Connectors library + const {ConnectorsClient} = require('@google-cloud/connectors').v1; + + // Instantiates a client + const connectorsClient = new ConnectorsClient(); + + async function callGetConnector() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await connectorsClient.getConnector(request); + console.log(response); + } + + callGetConnector(); + // [END connectors_v1_generated_Connectors_GetConnector_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-connectors/samples/generated/v1/connectors.get_connector_version.js b/packages/google-cloud-connectors/samples/generated/v1/connectors.get_connector_version.js new file mode 100644 index 00000000000..e90bd2d661f --- /dev/null +++ b/packages/google-cloud-connectors/samples/generated/v1/connectors.get_connector_version.js @@ -0,0 +1,68 @@ +// Copyright 2023 Google LLC +// +// Licensed under the Apache License, Version 2.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 connectors_v1_generated_Connectors_GetConnectorVersion_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. Resource name of the form: + * `projects/* /locations/* /providers/* /connectors/* /versions/*` + * Only global location is supported for ConnectorVersion resource. + */ + // const name = 'abc123' + /** + * Specifies which fields of the ConnectorVersion are returned in the + * response. Defaults to `CUSTOMER` view. + */ + // const view = {} + + // Imports the Connectors library + const {ConnectorsClient} = require('@google-cloud/connectors').v1; + + // Instantiates a client + const connectorsClient = new ConnectorsClient(); + + async function callGetConnectorVersion() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await connectorsClient.getConnectorVersion(request); + console.log(response); + } + + callGetConnectorVersion(); + // [END connectors_v1_generated_Connectors_GetConnectorVersion_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-connectors/samples/generated/v1/connectors.get_global_settings.js b/packages/google-cloud-connectors/samples/generated/v1/connectors.get_global_settings.js new file mode 100644 index 00000000000..4ed3eee53d5 --- /dev/null +++ b/packages/google-cloud-connectors/samples/generated/v1/connectors.get_global_settings.js @@ -0,0 +1,61 @@ +// Copyright 2023 Google LLC +// +// Licensed under the Apache License, Version 2.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 connectors_v1_generated_Connectors_GetGlobalSettings_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 resource name of the Settings. + */ + // const name = 'abc123' + + // Imports the Connectors library + const {ConnectorsClient} = require('@google-cloud/connectors').v1; + + // Instantiates a client + const connectorsClient = new ConnectorsClient(); + + async function callGetGlobalSettings() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await connectorsClient.getGlobalSettings(request); + console.log(response); + } + + callGetGlobalSettings(); + // [END connectors_v1_generated_Connectors_GetGlobalSettings_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-connectors/samples/generated/v1/connectors.get_provider.js b/packages/google-cloud-connectors/samples/generated/v1/connectors.get_provider.js new file mode 100644 index 00000000000..ec599e855a9 --- /dev/null +++ b/packages/google-cloud-connectors/samples/generated/v1/connectors.get_provider.js @@ -0,0 +1,63 @@ +// Copyright 2023 Google LLC +// +// Licensed under the Apache License, Version 2.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 connectors_v1_generated_Connectors_GetProvider_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. Resource name of the form: + * `projects/* /locations/* /providers/*` + * Only global location is supported for Provider resource. + */ + // const name = 'abc123' + + // Imports the Connectors library + const {ConnectorsClient} = require('@google-cloud/connectors').v1; + + // Instantiates a client + const connectorsClient = new ConnectorsClient(); + + async function callGetProvider() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await connectorsClient.getProvider(request); + console.log(response); + } + + callGetProvider(); + // [END connectors_v1_generated_Connectors_GetProvider_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-connectors/samples/generated/v1/connectors.get_runtime_config.js b/packages/google-cloud-connectors/samples/generated/v1/connectors.get_runtime_config.js new file mode 100644 index 00000000000..3266bb68b14 --- /dev/null +++ b/packages/google-cloud-connectors/samples/generated/v1/connectors.get_runtime_config.js @@ -0,0 +1,62 @@ +// Copyright 2023 Google LLC +// +// Licensed under the Apache License, Version 2.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 connectors_v1_generated_Connectors_GetRuntimeConfig_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. Resource name of the form: + * `projects/* /locations/* /runtimeConfig` + */ + // const name = 'abc123' + + // Imports the Connectors library + const {ConnectorsClient} = require('@google-cloud/connectors').v1; + + // Instantiates a client + const connectorsClient = new ConnectorsClient(); + + async function callGetRuntimeConfig() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await connectorsClient.getRuntimeConfig(request); + console.log(response); + } + + callGetRuntimeConfig(); + // [END connectors_v1_generated_Connectors_GetRuntimeConfig_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-connectors/samples/generated/v1/connectors.list_connections.js b/packages/google-cloud-connectors/samples/generated/v1/connectors.list_connections.js new file mode 100644 index 00000000000..feb26e3f100 --- /dev/null +++ b/packages/google-cloud-connectors/samples/generated/v1/connectors.list_connections.js @@ -0,0 +1,85 @@ +// Copyright 2023 Google LLC +// +// Licensed under the Apache License, Version 2.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 connectors_v1_generated_Connectors_ListConnections_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. Parent resource of the Connection, of the form: + * `projects/* /locations/*` + */ + // const parent = 'abc123' + /** + * Page size. + */ + // const pageSize = 1234 + /** + * Page token. + */ + // const pageToken = 'abc123' + /** + * Filter. + */ + // const filter = 'abc123' + /** + * Order by parameters. + */ + // const orderBy = 'abc123' + /** + * Specifies which fields of the Connection are returned in the response. + * Defaults to `BASIC` view. + */ + // const view = {} + + // Imports the Connectors library + const {ConnectorsClient} = require('@google-cloud/connectors').v1; + + // Instantiates a client + const connectorsClient = new ConnectorsClient(); + + async function callListConnections() { + // Construct request + const request = { + parent, + }; + + // Run request + const iterable = await connectorsClient.listConnectionsAsync(request); + for await (const response of iterable) { + console.log(response); + } + } + + callListConnections(); + // [END connectors_v1_generated_Connectors_ListConnections_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-connectors/samples/generated/v1/connectors.list_connector_versions.js b/packages/google-cloud-connectors/samples/generated/v1/connectors.list_connector_versions.js new file mode 100644 index 00000000000..2b3ab0042e5 --- /dev/null +++ b/packages/google-cloud-connectors/samples/generated/v1/connectors.list_connector_versions.js @@ -0,0 +1,78 @@ +// Copyright 2023 Google LLC +// +// Licensed under the Apache License, Version 2.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 connectors_v1_generated_Connectors_ListConnectorVersions_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. Parent resource of the connectors, of the form: + * `projects/* /locations/* /providers/* /connectors/*` + * Only global location is supported for ConnectorVersion resource. + */ + // const parent = 'abc123' + /** + * Page size. + */ + // const pageSize = 1234 + /** + * Page token. + */ + // const pageToken = 'abc123' + /** + * Specifies which fields of the ConnectorVersion are returned in the + * response. Defaults to `BASIC` view. + */ + // const view = {} + + // Imports the Connectors library + const {ConnectorsClient} = require('@google-cloud/connectors').v1; + + // Instantiates a client + const connectorsClient = new ConnectorsClient(); + + async function callListConnectorVersions() { + // Construct request + const request = { + parent, + }; + + // Run request + const iterable = await connectorsClient.listConnectorVersionsAsync(request); + for await (const response of iterable) { + console.log(response); + } + } + + callListConnectorVersions(); + // [END connectors_v1_generated_Connectors_ListConnectorVersions_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-connectors/samples/generated/v1/connectors.list_connectors.js b/packages/google-cloud-connectors/samples/generated/v1/connectors.list_connectors.js new file mode 100644 index 00000000000..f96a2ac317f --- /dev/null +++ b/packages/google-cloud-connectors/samples/generated/v1/connectors.list_connectors.js @@ -0,0 +1,73 @@ +// Copyright 2023 Google LLC +// +// Licensed under the Apache License, Version 2.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 connectors_v1_generated_Connectors_ListConnectors_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. Parent resource of the connectors, of the form: + * `projects/* /locations/* /providers/*` + * Only global location is supported for Connector resource. + */ + // const parent = 'abc123' + /** + * Page size. + */ + // const pageSize = 1234 + /** + * Page token. + */ + // const pageToken = 'abc123' + + // Imports the Connectors library + const {ConnectorsClient} = require('@google-cloud/connectors').v1; + + // Instantiates a client + const connectorsClient = new ConnectorsClient(); + + async function callListConnectors() { + // Construct request + const request = { + parent, + }; + + // Run request + const iterable = await connectorsClient.listConnectorsAsync(request); + for await (const response of iterable) { + console.log(response); + } + } + + callListConnectors(); + // [END connectors_v1_generated_Connectors_ListConnectors_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-connectors/samples/generated/v1/connectors.list_providers.js b/packages/google-cloud-connectors/samples/generated/v1/connectors.list_providers.js new file mode 100644 index 00000000000..b1a45a781b7 --- /dev/null +++ b/packages/google-cloud-connectors/samples/generated/v1/connectors.list_providers.js @@ -0,0 +1,73 @@ +// Copyright 2023 Google LLC +// +// Licensed under the Apache License, Version 2.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 connectors_v1_generated_Connectors_ListProviders_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. Parent resource of the API, of the form: + * `projects/* /locations/*` + * Only global location is supported for Provider resource. + */ + // const parent = 'abc123' + /** + * Page size. + */ + // const pageSize = 1234 + /** + * Page token. + */ + // const pageToken = 'abc123' + + // Imports the Connectors library + const {ConnectorsClient} = require('@google-cloud/connectors').v1; + + // Instantiates a client + const connectorsClient = new ConnectorsClient(); + + async function callListProviders() { + // Construct request + const request = { + parent, + }; + + // Run request + const iterable = await connectorsClient.listProvidersAsync(request); + for await (const response of iterable) { + console.log(response); + } + } + + callListProviders(); + // [END connectors_v1_generated_Connectors_ListProviders_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-connectors/samples/generated/v1/connectors.list_runtime_action_schemas.js b/packages/google-cloud-connectors/samples/generated/v1/connectors.list_runtime_action_schemas.js new file mode 100644 index 00000000000..c26fca88836 --- /dev/null +++ b/packages/google-cloud-connectors/samples/generated/v1/connectors.list_runtime_action_schemas.js @@ -0,0 +1,83 @@ +// Copyright 2023 Google LLC +// +// Licensed under the Apache License, Version 2.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, filter) { + // [START connectors_v1_generated_Connectors_ListRuntimeActionSchemas_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. Parent resource of RuntimeActionSchema + * Format: + * projects/{project}/locations/{location}/connections/{connection} + */ + // const parent = 'abc123' + /** + * Page size. + */ + // const pageSize = 1234 + /** + * Page token. + */ + // const pageToken = 'abc123' + /** + * Required. Filter + * Format: + * action="{actionId}" + * Only action field is supported with literal equality operator. + * Accepted filter example: action="CancelOrder" + * Wildcards are not supported in the filter currently. + */ + // const filter = 'abc123' + + // Imports the Connectors library + const {ConnectorsClient} = require('@google-cloud/connectors').v1; + + // Instantiates a client + const connectorsClient = new ConnectorsClient(); + + async function callListRuntimeActionSchemas() { + // Construct request + const request = { + parent, + filter, + }; + + // Run request + const iterable = await connectorsClient.listRuntimeActionSchemasAsync(request); + for await (const response of iterable) { + console.log(response); + } + } + + callListRuntimeActionSchemas(); + // [END connectors_v1_generated_Connectors_ListRuntimeActionSchemas_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-connectors/samples/generated/v1/connectors.list_runtime_entity_schemas.js b/packages/google-cloud-connectors/samples/generated/v1/connectors.list_runtime_entity_schemas.js new file mode 100644 index 00000000000..ed743190002 --- /dev/null +++ b/packages/google-cloud-connectors/samples/generated/v1/connectors.list_runtime_entity_schemas.js @@ -0,0 +1,83 @@ +// Copyright 2023 Google LLC +// +// Licensed under the Apache License, Version 2.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, filter) { + // [START connectors_v1_generated_Connectors_ListRuntimeEntitySchemas_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. Parent resource of RuntimeEntitySchema + * Format: + * projects/{project}/locations/{location}/connections/{connection} + */ + // const parent = 'abc123' + /** + * Page size. + */ + // const pageSize = 1234 + /** + * Page token. + */ + // const pageToken = 'abc123' + /** + * Required. Filter + * Format: + * entity="{entityId}" + * Only entity field is supported with literal equality operator. + * Accepted filter example: entity="Order" + * Wildcards are not supported in the filter currently. + */ + // const filter = 'abc123' + + // Imports the Connectors library + const {ConnectorsClient} = require('@google-cloud/connectors').v1; + + // Instantiates a client + const connectorsClient = new ConnectorsClient(); + + async function callListRuntimeEntitySchemas() { + // Construct request + const request = { + parent, + filter, + }; + + // Run request + const iterable = await connectorsClient.listRuntimeEntitySchemasAsync(request); + for await (const response of iterable) { + console.log(response); + } + } + + callListRuntimeEntitySchemas(); + // [END connectors_v1_generated_Connectors_ListRuntimeEntitySchemas_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-connectors/samples/generated/v1/connectors.refresh_connection_schema_metadata.js b/packages/google-cloud-connectors/samples/generated/v1/connectors.refresh_connection_schema_metadata.js new file mode 100644 index 00000000000..dee14288e82 --- /dev/null +++ b/packages/google-cloud-connectors/samples/generated/v1/connectors.refresh_connection_schema_metadata.js @@ -0,0 +1,64 @@ +// Copyright 2023 Google LLC +// +// Licensed under the Apache License, Version 2.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 connectors_v1_generated_Connectors_RefreshConnectionSchemaMetadata_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. Resource name. + * Format: + * projects/{project}/locations/{location}/connections/{connection}/connectionSchemaMetadata + */ + // const name = 'abc123' + + // Imports the Connectors library + const {ConnectorsClient} = require('@google-cloud/connectors').v1; + + // Instantiates a client + const connectorsClient = new ConnectorsClient(); + + async function callRefreshConnectionSchemaMetadata() { + // Construct request + const request = { + name, + }; + + // Run request + const [operation] = await connectorsClient.refreshConnectionSchemaMetadata(request); + const [response] = await operation.promise(); + console.log(response); + } + + callRefreshConnectionSchemaMetadata(); + // [END connectors_v1_generated_Connectors_RefreshConnectionSchemaMetadata_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-connectors/samples/generated/v1/connectors.update_connection.js b/packages/google-cloud-connectors/samples/generated/v1/connectors.update_connection.js new file mode 100644 index 00000000000..0f156de4ad4 --- /dev/null +++ b/packages/google-cloud-connectors/samples/generated/v1/connectors.update_connection.js @@ -0,0 +1,79 @@ +// Copyright 2023 Google LLC +// +// Licensed under the Apache License, Version 2.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(connection, updateMask) { + // [START connectors_v1_generated_Connectors_UpdateConnection_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. Connection resource. + */ + // const connection = {} + /** + * Required. You can modify only the fields listed below. + * To lock/unlock a connection: + * * `lock_config` + * To suspend/resume a connection: + * * `suspended` + * To update the connection details: + * * `description` + * * `labels` + * * `connector_version` + * * `config_variables` + * * `auth_config` + * * `destination_configs` + * * `node_config` + */ + // const updateMask = {} + + // Imports the Connectors library + const {ConnectorsClient} = require('@google-cloud/connectors').v1; + + // Instantiates a client + const connectorsClient = new ConnectorsClient(); + + async function callUpdateConnection() { + // Construct request + const request = { + connection, + updateMask, + }; + + // Run request + const [operation] = await connectorsClient.updateConnection(request); + const [response] = await operation.promise(); + console.log(response); + } + + callUpdateConnection(); + // [END connectors_v1_generated_Connectors_UpdateConnection_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-connectors/samples/generated/v1/snippet_metadata_google.cloud.connectors.v1.json b/packages/google-cloud-connectors/samples/generated/v1/snippet_metadata_google.cloud.connectors.v1.json new file mode 100644 index 00000000000..34266687927 --- /dev/null +++ b/packages/google-cloud-connectors/samples/generated/v1/snippet_metadata_google.cloud.connectors.v1.json @@ -0,0 +1,787 @@ +{ + "clientLibrary": { + "name": "nodejs-connectors", + "version": "0.1.0", + "language": "TYPESCRIPT", + "apis": [ + { + "id": "google.cloud.connectors.v1", + "version": "v1" + } + ] + }, + "snippets": [ + { + "regionTag": "connectors_v1_generated_Connectors_ListConnections_async", + "title": "Connectors listConnections Sample", + "origin": "API_DEFINITION", + "description": " Lists Connections in a given project and location.", + "canonical": true, + "file": "connectors.list_connections.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 77, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "ListConnections", + "fullName": "google.cloud.connectors.v1.Connectors.ListConnections", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "page_size", + "type": "TYPE_INT32" + }, + { + "name": "page_token", + "type": "TYPE_STRING" + }, + { + "name": "filter", + "type": "TYPE_STRING" + }, + { + "name": "order_by", + "type": "TYPE_STRING" + }, + { + "name": "view", + "type": ".google.cloud.connectors.v1.ConnectionView" + } + ], + "resultType": ".google.cloud.connectors.v1.ListConnectionsResponse", + "client": { + "shortName": "ConnectorsClient", + "fullName": "google.cloud.connectors.v1.ConnectorsClient" + }, + "method": { + "shortName": "ListConnections", + "fullName": "google.cloud.connectors.v1.Connectors.ListConnections", + "service": { + "shortName": "Connectors", + "fullName": "google.cloud.connectors.v1.Connectors" + } + } + } + }, + { + "regionTag": "connectors_v1_generated_Connectors_GetConnection_async", + "title": "Connectors getConnection Sample", + "origin": "API_DEFINITION", + "description": " Gets details of a single Connection.", + "canonical": true, + "file": "connectors.get_connection.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 59, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "GetConnection", + "fullName": "google.cloud.connectors.v1.Connectors.GetConnection", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + }, + { + "name": "view", + "type": ".google.cloud.connectors.v1.ConnectionView" + } + ], + "resultType": ".google.cloud.connectors.v1.Connection", + "client": { + "shortName": "ConnectorsClient", + "fullName": "google.cloud.connectors.v1.ConnectorsClient" + }, + "method": { + "shortName": "GetConnection", + "fullName": "google.cloud.connectors.v1.Connectors.GetConnection", + "service": { + "shortName": "Connectors", + "fullName": "google.cloud.connectors.v1.Connectors" + } + } + } + }, + { + "regionTag": "connectors_v1_generated_Connectors_CreateConnection_async", + "title": "Connectors createConnection Sample", + "origin": "API_DEFINITION", + "description": " Creates a new Connection in a given project and location.", + "canonical": true, + "file": "connectors.create_connection.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 66, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "CreateConnection", + "fullName": "google.cloud.connectors.v1.Connectors.CreateConnection", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "connection_id", + "type": "TYPE_STRING" + }, + { + "name": "connection", + "type": ".google.cloud.connectors.v1.Connection" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "ConnectorsClient", + "fullName": "google.cloud.connectors.v1.ConnectorsClient" + }, + "method": { + "shortName": "CreateConnection", + "fullName": "google.cloud.connectors.v1.Connectors.CreateConnection", + "service": { + "shortName": "Connectors", + "fullName": "google.cloud.connectors.v1.Connectors" + } + } + } + }, + { + "regionTag": "connectors_v1_generated_Connectors_UpdateConnection_async", + "title": "Connectors updateConnection Sample", + "origin": "API_DEFINITION", + "description": " Updates the parameters of a single Connection.", + "canonical": true, + "file": "connectors.update_connection.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 71, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "UpdateConnection", + "fullName": "google.cloud.connectors.v1.Connectors.UpdateConnection", + "async": true, + "parameters": [ + { + "name": "connection", + "type": ".google.cloud.connectors.v1.Connection" + }, + { + "name": "update_mask", + "type": ".google.protobuf.FieldMask" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "ConnectorsClient", + "fullName": "google.cloud.connectors.v1.ConnectorsClient" + }, + "method": { + "shortName": "UpdateConnection", + "fullName": "google.cloud.connectors.v1.Connectors.UpdateConnection", + "service": { + "shortName": "Connectors", + "fullName": "google.cloud.connectors.v1.Connectors" + } + } + } + }, + { + "regionTag": "connectors_v1_generated_Connectors_DeleteConnection_async", + "title": "Connectors deleteConnection Sample", + "origin": "API_DEFINITION", + "description": " Deletes a single Connection.", + "canonical": true, + "file": "connectors.delete_connection.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 55, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "DeleteConnection", + "fullName": "google.cloud.connectors.v1.Connectors.DeleteConnection", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "ConnectorsClient", + "fullName": "google.cloud.connectors.v1.ConnectorsClient" + }, + "method": { + "shortName": "DeleteConnection", + "fullName": "google.cloud.connectors.v1.Connectors.DeleteConnection", + "service": { + "shortName": "Connectors", + "fullName": "google.cloud.connectors.v1.Connectors" + } + } + } + }, + { + "regionTag": "connectors_v1_generated_Connectors_ListProviders_async", + "title": "Connectors listProviders Sample", + "origin": "API_DEFINITION", + "description": " Lists Providers in a given project and location.", + "canonical": true, + "file": "connectors.list_providers.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 65, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "ListProviders", + "fullName": "google.cloud.connectors.v1.Connectors.ListProviders", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "page_size", + "type": "TYPE_INT32" + }, + { + "name": "page_token", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.connectors.v1.ListProvidersResponse", + "client": { + "shortName": "ConnectorsClient", + "fullName": "google.cloud.connectors.v1.ConnectorsClient" + }, + "method": { + "shortName": "ListProviders", + "fullName": "google.cloud.connectors.v1.Connectors.ListProviders", + "service": { + "shortName": "Connectors", + "fullName": "google.cloud.connectors.v1.Connectors" + } + } + } + }, + { + "regionTag": "connectors_v1_generated_Connectors_GetProvider_async", + "title": "Connectors getProvider Sample", + "origin": "API_DEFINITION", + "description": " Gets details of a provider.", + "canonical": true, + "file": "connectors.get_provider.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 55, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "GetProvider", + "fullName": "google.cloud.connectors.v1.Connectors.GetProvider", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.connectors.v1.Provider", + "client": { + "shortName": "ConnectorsClient", + "fullName": "google.cloud.connectors.v1.ConnectorsClient" + }, + "method": { + "shortName": "GetProvider", + "fullName": "google.cloud.connectors.v1.Connectors.GetProvider", + "service": { + "shortName": "Connectors", + "fullName": "google.cloud.connectors.v1.Connectors" + } + } + } + }, + { + "regionTag": "connectors_v1_generated_Connectors_ListConnectors_async", + "title": "Connectors listConnectors Sample", + "origin": "API_DEFINITION", + "description": " Lists Connectors in a given project and location.", + "canonical": true, + "file": "connectors.list_connectors.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 65, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "ListConnectors", + "fullName": "google.cloud.connectors.v1.Connectors.ListConnectors", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "page_size", + "type": "TYPE_INT32" + }, + { + "name": "page_token", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.connectors.v1.ListConnectorsResponse", + "client": { + "shortName": "ConnectorsClient", + "fullName": "google.cloud.connectors.v1.ConnectorsClient" + }, + "method": { + "shortName": "ListConnectors", + "fullName": "google.cloud.connectors.v1.Connectors.ListConnectors", + "service": { + "shortName": "Connectors", + "fullName": "google.cloud.connectors.v1.Connectors" + } + } + } + }, + { + "regionTag": "connectors_v1_generated_Connectors_GetConnector_async", + "title": "Connectors getConnector Sample", + "origin": "API_DEFINITION", + "description": " Gets details of a single Connector.", + "canonical": true, + "file": "connectors.get_connector.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 55, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "GetConnector", + "fullName": "google.cloud.connectors.v1.Connectors.GetConnector", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.connectors.v1.Connector", + "client": { + "shortName": "ConnectorsClient", + "fullName": "google.cloud.connectors.v1.ConnectorsClient" + }, + "method": { + "shortName": "GetConnector", + "fullName": "google.cloud.connectors.v1.Connectors.GetConnector", + "service": { + "shortName": "Connectors", + "fullName": "google.cloud.connectors.v1.Connectors" + } + } + } + }, + { + "regionTag": "connectors_v1_generated_Connectors_ListConnectorVersions_async", + "title": "Connectors listConnectorVersions Sample", + "origin": "API_DEFINITION", + "description": " Lists Connector Versions in a given project and location.", + "canonical": true, + "file": "connectors.list_connector_versions.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 70, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "ListConnectorVersions", + "fullName": "google.cloud.connectors.v1.Connectors.ListConnectorVersions", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "page_size", + "type": "TYPE_INT32" + }, + { + "name": "page_token", + "type": "TYPE_STRING" + }, + { + "name": "view", + "type": ".google.cloud.connectors.v1.ConnectorVersionView" + } + ], + "resultType": ".google.cloud.connectors.v1.ListConnectorVersionsResponse", + "client": { + "shortName": "ConnectorsClient", + "fullName": "google.cloud.connectors.v1.ConnectorsClient" + }, + "method": { + "shortName": "ListConnectorVersions", + "fullName": "google.cloud.connectors.v1.Connectors.ListConnectorVersions", + "service": { + "shortName": "Connectors", + "fullName": "google.cloud.connectors.v1.Connectors" + } + } + } + }, + { + "regionTag": "connectors_v1_generated_Connectors_GetConnectorVersion_async", + "title": "Connectors getConnectorVersion Sample", + "origin": "API_DEFINITION", + "description": " Gets details of a single connector version.", + "canonical": true, + "file": "connectors.get_connector_version.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 60, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "GetConnectorVersion", + "fullName": "google.cloud.connectors.v1.Connectors.GetConnectorVersion", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + }, + { + "name": "view", + "type": ".google.cloud.connectors.v1.ConnectorVersionView" + } + ], + "resultType": ".google.cloud.connectors.v1.ConnectorVersion", + "client": { + "shortName": "ConnectorsClient", + "fullName": "google.cloud.connectors.v1.ConnectorsClient" + }, + "method": { + "shortName": "GetConnectorVersion", + "fullName": "google.cloud.connectors.v1.Connectors.GetConnectorVersion", + "service": { + "shortName": "Connectors", + "fullName": "google.cloud.connectors.v1.Connectors" + } + } + } + }, + { + "regionTag": "connectors_v1_generated_Connectors_GetConnectionSchemaMetadata_async", + "title": "Connectors getConnectionSchemaMetadata Sample", + "origin": "API_DEFINITION", + "description": " Gets schema metadata of a connection. SchemaMetadata is a singleton resource for each connection.", + "canonical": true, + "file": "connectors.get_connection_schema_metadata.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 55, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "GetConnectionSchemaMetadata", + "fullName": "google.cloud.connectors.v1.Connectors.GetConnectionSchemaMetadata", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.connectors.v1.ConnectionSchemaMetadata", + "client": { + "shortName": "ConnectorsClient", + "fullName": "google.cloud.connectors.v1.ConnectorsClient" + }, + "method": { + "shortName": "GetConnectionSchemaMetadata", + "fullName": "google.cloud.connectors.v1.Connectors.GetConnectionSchemaMetadata", + "service": { + "shortName": "Connectors", + "fullName": "google.cloud.connectors.v1.Connectors" + } + } + } + }, + { + "regionTag": "connectors_v1_generated_Connectors_RefreshConnectionSchemaMetadata_async", + "title": "Connectors refreshConnectionSchemaMetadata Sample", + "origin": "API_DEFINITION", + "description": " Refresh runtime schema of a connection.", + "canonical": true, + "file": "connectors.refresh_connection_schema_metadata.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 56, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "RefreshConnectionSchemaMetadata", + "fullName": "google.cloud.connectors.v1.Connectors.RefreshConnectionSchemaMetadata", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "ConnectorsClient", + "fullName": "google.cloud.connectors.v1.ConnectorsClient" + }, + "method": { + "shortName": "RefreshConnectionSchemaMetadata", + "fullName": "google.cloud.connectors.v1.Connectors.RefreshConnectionSchemaMetadata", + "service": { + "shortName": "Connectors", + "fullName": "google.cloud.connectors.v1.Connectors" + } + } + } + }, + { + "regionTag": "connectors_v1_generated_Connectors_ListRuntimeEntitySchemas_async", + "title": "Connectors listRuntimeEntitySchemas Sample", + "origin": "API_DEFINITION", + "description": " List schema of a runtime entities filtered by entity name.", + "canonical": true, + "file": "connectors.list_runtime_entity_schemas.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 75, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "ListRuntimeEntitySchemas", + "fullName": "google.cloud.connectors.v1.Connectors.ListRuntimeEntitySchemas", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "page_size", + "type": "TYPE_INT32" + }, + { + "name": "page_token", + "type": "TYPE_STRING" + }, + { + "name": "filter", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.connectors.v1.ListRuntimeEntitySchemasResponse", + "client": { + "shortName": "ConnectorsClient", + "fullName": "google.cloud.connectors.v1.ConnectorsClient" + }, + "method": { + "shortName": "ListRuntimeEntitySchemas", + "fullName": "google.cloud.connectors.v1.Connectors.ListRuntimeEntitySchemas", + "service": { + "shortName": "Connectors", + "fullName": "google.cloud.connectors.v1.Connectors" + } + } + } + }, + { + "regionTag": "connectors_v1_generated_Connectors_ListRuntimeActionSchemas_async", + "title": "Connectors listRuntimeActionSchemas Sample", + "origin": "API_DEFINITION", + "description": " List schema of a runtime actions filtered by action name.", + "canonical": true, + "file": "connectors.list_runtime_action_schemas.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 75, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "ListRuntimeActionSchemas", + "fullName": "google.cloud.connectors.v1.Connectors.ListRuntimeActionSchemas", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "page_size", + "type": "TYPE_INT32" + }, + { + "name": "page_token", + "type": "TYPE_STRING" + }, + { + "name": "filter", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.connectors.v1.ListRuntimeActionSchemasResponse", + "client": { + "shortName": "ConnectorsClient", + "fullName": "google.cloud.connectors.v1.ConnectorsClient" + }, + "method": { + "shortName": "ListRuntimeActionSchemas", + "fullName": "google.cloud.connectors.v1.Connectors.ListRuntimeActionSchemas", + "service": { + "shortName": "Connectors", + "fullName": "google.cloud.connectors.v1.Connectors" + } + } + } + }, + { + "regionTag": "connectors_v1_generated_Connectors_GetRuntimeConfig_async", + "title": "Connectors getRuntimeConfig Sample", + "origin": "API_DEFINITION", + "description": " Gets the runtimeConfig of a location. RuntimeConfig is a singleton resource for each location.", + "canonical": true, + "file": "connectors.get_runtime_config.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 54, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "GetRuntimeConfig", + "fullName": "google.cloud.connectors.v1.Connectors.GetRuntimeConfig", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.connectors.v1.RuntimeConfig", + "client": { + "shortName": "ConnectorsClient", + "fullName": "google.cloud.connectors.v1.ConnectorsClient" + }, + "method": { + "shortName": "GetRuntimeConfig", + "fullName": "google.cloud.connectors.v1.Connectors.GetRuntimeConfig", + "service": { + "shortName": "Connectors", + "fullName": "google.cloud.connectors.v1.Connectors" + } + } + } + }, + { + "regionTag": "connectors_v1_generated_Connectors_GetGlobalSettings_async", + "title": "Connectors getGlobalSettings Sample", + "origin": "API_DEFINITION", + "description": " GetGlobalSettings gets settings of a project. GlobalSettings is a singleton resource.", + "canonical": true, + "file": "connectors.get_global_settings.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 53, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "GetGlobalSettings", + "fullName": "google.cloud.connectors.v1.Connectors.GetGlobalSettings", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.connectors.v1.Settings", + "client": { + "shortName": "ConnectorsClient", + "fullName": "google.cloud.connectors.v1.ConnectorsClient" + }, + "method": { + "shortName": "GetGlobalSettings", + "fullName": "google.cloud.connectors.v1.Connectors.GetGlobalSettings", + "service": { + "shortName": "Connectors", + "fullName": "google.cloud.connectors.v1.Connectors" + } + } + } + } + ] +} \ No newline at end of file diff --git a/packages/google-cloud-connectors/samples/package.json b/packages/google-cloud-connectors/samples/package.json new file mode 100644 index 00000000000..42ffb6e95ea --- /dev/null +++ b/packages/google-cloud-connectors/samples/package.json @@ -0,0 +1,24 @@ +{ + "name": "connectors-samples", + "private": true, + "license": "Apache-2.0", + "author": "Google LLC", + "engines": { + "node": ">=14.0.0" + }, + "files": [ + "*.js" + ], + "scripts": { + "test": "c8 mocha --timeout 600000 test/*.js", + "publish": "echo 'sample test; do not publish'" + }, + "dependencies": { + "@google-cloud/connectors": "^0.1.0" + }, + "devDependencies": { + "c8": "^8.0.0", + "chai": "^4.2.0", + "mocha": "^8.0.0" + } +} diff --git a/packages/google-cloud-connectors/samples/quickstart.js b/packages/google-cloud-connectors/samples/quickstart.js new file mode 100644 index 00000000000..9fd14a90d68 --- /dev/null +++ b/packages/google-cloud-connectors/samples/quickstart.js @@ -0,0 +1,83 @@ +// Copyright 2023 Google LLC +// +// Licensed under the Apache License, Version 2.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 connectors_quickstart] + /** + * 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. Parent resource of the Connection, of the form: + * `projects/* /locations/*` + */ + // const parent = 'abc123' + /** + * Page size. + */ + // const pageSize = 1234 + /** + * Page token. + */ + // const pageToken = 'abc123' + /** + * Filter. + */ + // const filter = 'abc123' + /** + * Order by parameters. + */ + // const orderBy = 'abc123' + /** + * Specifies which fields of the Connection are returned in the response. + * Defaults to `BASIC` view. + */ + // const view = {} + + // Imports the Connectors library + const {ConnectorsClient} = require('@google-cloud/connectors').v1; + + // Instantiates a client + const connectorsClient = new ConnectorsClient(); + + async function callListConnections() { + // Construct request + const request = { + parent, + }; + + // Run request + const iterable = await connectorsClient.listConnectionsAsync(request); + for await (const response of iterable) { + console.log(response); + } + } + + callListConnections(); + // [END connectors_quickstart] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-connectors/samples/test/quickstart.js b/packages/google-cloud-connectors/samples/test/quickstart.js new file mode 100644 index 00000000000..c89d0c0db5f --- /dev/null +++ b/packages/google-cloud-connectors/samples/test/quickstart.js @@ -0,0 +1,42 @@ +// Copyright 2023 Google LLC +// +// Licensed under the Apache License, Version 2.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. + +'use strict'; + +const assert = require('assert'); +const path = require('path'); +const cp = require('child_process'); +const {describe, it, before} = require('mocha'); +const {ConnectorsClient} = require('@google-cloud/connectors').v1; +const connectorsClient = new ConnectorsClient(); + +const execSync = cmd => cp.execSync(cmd, {encoding: 'utf-8'}); + +const cwd = path.join(__dirname, '..'); + +describe('Quickstart', () => { + let projectId; + + before(async () => { + projectId = await connectorsClient.getProjectId(); + }); + + it('should run quickstart', async () => { + const output = execSync( + `node ./quickstart.js projects/${projectId}/locations/global`, + {cwd} + ); + assert(output !== null); + }); +}); diff --git a/packages/google-cloud-connectors/src/index.ts b/packages/google-cloud-connectors/src/index.ts new file mode 100644 index 00000000000..5d37ce824af --- /dev/null +++ b/packages/google-cloud-connectors/src/index.ts @@ -0,0 +1,27 @@ +// Copyright 2023 Google LLC +// +// Licensed under the Apache License, Version 2.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. ** + +import * as v1 from './v1'; + +const ConnectorsClient = v1.ConnectorsClient; +type ConnectorsClient = v1.ConnectorsClient; + +export {v1, ConnectorsClient}; +export default {v1, ConnectorsClient}; +import * as protos from '../protos/protos'; +export {protos}; diff --git a/packages/google-cloud-connectors/src/v1/connectors_client.ts b/packages/google-cloud-connectors/src/v1/connectors_client.ts new file mode 100644 index 00000000000..d36e86d4773 --- /dev/null +++ b/packages/google-cloud-connectors/src/v1/connectors_client.ts @@ -0,0 +1,3785 @@ +// Copyright 2023 Google LLC +// +// Licensed under the Apache License, Version 2.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, + IamClient, + IamProtos, + LocationsClient, + LocationProtos, +} from 'google-gax'; +import {Transform} from 'stream'; +import * as protos from '../../protos/protos'; +import jsonProtos = require('../../protos/protos.json'); +/** + * Client JSON configuration object, loaded from + * `src/v1/connectors_client_config.json`. + * This file defines retry strategy and timeouts for all API methods in this library. + */ +import * as gapicConfig from './connectors_client_config.json'; +const version = require('../../../package.json').version; + +/** + * Connectors is the interface for managing Connectors. + * @class + * @memberof v1 + */ +export class ConnectorsClient { + 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}; + auth: gax.GoogleAuth; + descriptors: Descriptors = { + page: {}, + stream: {}, + longrunning: {}, + batching: {}, + }; + warn: (code: string, message: string, warnType?: string) => void; + innerApiCalls: {[name: string]: Function}; + iamClient: IamClient; + locationsClient: LocationsClient; + pathTemplates: {[name: string]: gax.PathTemplate}; + operationsClient: gax.OperationsClient; + connectorsStub?: Promise<{[name: string]: Function}>; + + /** + * Construct an instance of ConnectorsClient. + * + * @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://developers.google.com/identity/protocols/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 ConnectorsClient({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 ConnectorsClient; + const servicePath = + opts?.servicePath || opts?.apiEndpoint || staticMembers.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 !== staticMembers.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 = staticMembers.servicePath; + + // Set the default scopes in auth client if needed. + if (servicePath === staticMembers.servicePath) { + this.auth.defaultScopes = staticMembers.scopes; + } + this.iamClient = new this._gaxModule.IamClient(this._gaxGrpc, opts); + + 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 !== 'undefined' && '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 = { + connectionPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/connections/{connection}' + ), + connectionSchemaMetadataPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/connections/{connection}/connectionSchemaMetadata' + ), + connectorPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/providers/{provider}/connectors/{connector}' + ), + connectorVersionPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/providers/{provider}/connectors/{connector}/versions/{version}' + ), + providerPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/providers/{provider}' + ), + runtimeConfigPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/runtimeConfig' + ), + settingsPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/global/settings' + ), + }; + + // 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 = { + listConnections: new this._gaxModule.PageDescriptor( + 'pageToken', + 'nextPageToken', + 'connections' + ), + listProviders: new this._gaxModule.PageDescriptor( + 'pageToken', + 'nextPageToken', + 'providers' + ), + listConnectors: new this._gaxModule.PageDescriptor( + 'pageToken', + 'nextPageToken', + 'connectors' + ), + listConnectorVersions: new this._gaxModule.PageDescriptor( + 'pageToken', + 'nextPageToken', + 'connectorVersions' + ), + listRuntimeEntitySchemas: new this._gaxModule.PageDescriptor( + 'pageToken', + 'nextPageToken', + 'runtimeEntitySchemas' + ), + listRuntimeActionSchemas: new this._gaxModule.PageDescriptor( + 'pageToken', + 'nextPageToken', + 'runtimeActionSchemas' + ), + }; + + const protoFilesRoot = this._gaxModule.protobuf.Root.fromJSON(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: '/v1/{name=projects/*/locations/*}', + }, + { + selector: 'google.cloud.location.Locations.ListLocations', + get: '/v1/{name=projects/*}/locations', + }, + { + selector: 'google.iam.v1.IAMPolicy.GetIamPolicy', + get: '/v1/{resource=projects/*/locations/*/connections/*}:getIamPolicy', + additional_bindings: [ + { + get: '/v1/{resource=projects/*/locations/*/providers/*}:getIamPolicy', + }, + ], + }, + { + selector: 'google.iam.v1.IAMPolicy.SetIamPolicy', + post: '/v1/{resource=projects/*/locations/*/connections/*}:setIamPolicy', + body: '*', + additional_bindings: [ + { + post: '/v1/{resource=projects/*/locations/*/providers/*}:setIamPolicy', + body: '*', + }, + ], + }, + { + selector: 'google.iam.v1.IAMPolicy.TestIamPermissions', + post: '/v1/{resource=projects/*/locations/*/connections/*}:testIamPermissions', + body: '*', + additional_bindings: [ + { + post: '/v1/{resource=projects/*/locations/*/providers/*}:testIamPermissions', + body: '*', + }, + ], + }, + { + selector: 'google.longrunning.Operations.CancelOperation', + post: '/v1/{name=projects/*/locations/*/operations/*}:cancel', + body: '*', + }, + { + selector: 'google.longrunning.Operations.DeleteOperation', + delete: '/v1/{name=projects/*/locations/*/operations/*}', + }, + { + selector: 'google.longrunning.Operations.GetOperation', + get: '/v1/{name=projects/*/locations/*/operations/*}', + }, + { + selector: 'google.longrunning.Operations.ListOperations', + get: '/v1/{name=projects/*/locations/*}/operations', + }, + ]; + } + this.operationsClient = this._gaxModule + .lro(lroOptions) + .operationsClient(opts); + const createConnectionResponse = protoFilesRoot.lookup( + '.google.cloud.connectors.v1.Connection' + ) as gax.protobuf.Type; + const createConnectionMetadata = protoFilesRoot.lookup( + '.google.cloud.connectors.v1.OperationMetadata' + ) as gax.protobuf.Type; + const updateConnectionResponse = protoFilesRoot.lookup( + '.google.cloud.connectors.v1.Connection' + ) as gax.protobuf.Type; + const updateConnectionMetadata = protoFilesRoot.lookup( + '.google.cloud.connectors.v1.OperationMetadata' + ) as gax.protobuf.Type; + const deleteConnectionResponse = protoFilesRoot.lookup( + '.google.protobuf.Empty' + ) as gax.protobuf.Type; + const deleteConnectionMetadata = protoFilesRoot.lookup( + '.google.cloud.connectors.v1.OperationMetadata' + ) as gax.protobuf.Type; + const refreshConnectionSchemaMetadataResponse = protoFilesRoot.lookup( + '.google.cloud.connectors.v1.ConnectionSchemaMetadata' + ) as gax.protobuf.Type; + const refreshConnectionSchemaMetadataMetadata = protoFilesRoot.lookup( + '.google.cloud.connectors.v1.OperationMetadata' + ) as gax.protobuf.Type; + + this.descriptors.longrunning = { + createConnection: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + createConnectionResponse.decode.bind(createConnectionResponse), + createConnectionMetadata.decode.bind(createConnectionMetadata) + ), + updateConnection: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + updateConnectionResponse.decode.bind(updateConnectionResponse), + updateConnectionMetadata.decode.bind(updateConnectionMetadata) + ), + deleteConnection: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + deleteConnectionResponse.decode.bind(deleteConnectionResponse), + deleteConnectionMetadata.decode.bind(deleteConnectionMetadata) + ), + refreshConnectionSchemaMetadata: + new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + refreshConnectionSchemaMetadataResponse.decode.bind( + refreshConnectionSchemaMetadataResponse + ), + refreshConnectionSchemaMetadataMetadata.decode.bind( + refreshConnectionSchemaMetadataMetadata + ) + ), + }; + + // Put together the default options sent with requests. + this._defaults = this._gaxGrpc.constructSettings( + 'google.cloud.connectors.v1.Connectors', + 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.connectorsStub) { + return this.connectorsStub; + } + + // Put together the "service stub" for + // google.cloud.connectors.v1.Connectors. + this.connectorsStub = this._gaxGrpc.createStub( + this._opts.fallback + ? (this._protos as protobuf.Root).lookupService( + 'google.cloud.connectors.v1.Connectors' + ) + : // eslint-disable-next-line @typescript-eslint/no-explicit-any + (this._protos as any).google.cloud.connectors.v1.Connectors, + 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 connectorsStubMethods = [ + 'listConnections', + 'getConnection', + 'createConnection', + 'updateConnection', + 'deleteConnection', + 'listProviders', + 'getProvider', + 'listConnectors', + 'getConnector', + 'listConnectorVersions', + 'getConnectorVersion', + 'getConnectionSchemaMetadata', + 'refreshConnectionSchemaMetadata', + 'listRuntimeEntitySchemas', + 'listRuntimeActionSchemas', + 'getRuntimeConfig', + 'getGlobalSettings', + ]; + for (const methodName of connectorsStubMethods) { + const callPromise = this.connectorsStub.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] || + this.descriptors.longrunning[methodName] || + undefined; + const apiCall = this._gaxModule.createApiCall( + callPromise, + this._defaults[methodName], + descriptor, + this._opts.fallback + ); + + this.innerApiCalls[methodName] = apiCall; + } + + return this.connectorsStub; + } + + /** + * The DNS address for this API service. + * @returns {string} The DNS address for this service. + */ + static get servicePath() { + return 'connectors.googleapis.com'; + } + + /** + * The DNS address for this API service - same as servicePath(), + * exists for compatibility reasons. + * @returns {string} The DNS address for this service. + */ + static get apiEndpoint() { + return 'connectors.googleapis.com'; + } + + /** + * 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 -- + // ------------------- + /** + * Gets details of a single Connection. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. Resource name of the form: + * `projects/* /locations/* /connections/*` + * @param {google.cloud.connectors.v1.ConnectionView} request.view + * Specifies which fields of the Connection are returned in the response. + * Defaults to `BASIC` view. + * @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.connectors.v1.Connection|Connection}. + * 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/connectors.get_connection.js + * region_tag:connectors_v1_generated_Connectors_GetConnection_async + */ + getConnection( + request?: protos.google.cloud.connectors.v1.IGetConnectionRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.connectors.v1.IConnection, + protos.google.cloud.connectors.v1.IGetConnectionRequest | undefined, + {} | undefined, + ] + >; + getConnection( + request: protos.google.cloud.connectors.v1.IGetConnectionRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.connectors.v1.IConnection, + | protos.google.cloud.connectors.v1.IGetConnectionRequest + | null + | undefined, + {} | null | undefined + > + ): void; + getConnection( + request: protos.google.cloud.connectors.v1.IGetConnectionRequest, + callback: Callback< + protos.google.cloud.connectors.v1.IConnection, + | protos.google.cloud.connectors.v1.IGetConnectionRequest + | null + | undefined, + {} | null | undefined + > + ): void; + getConnection( + request?: protos.google.cloud.connectors.v1.IGetConnectionRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.connectors.v1.IConnection, + | protos.google.cloud.connectors.v1.IGetConnectionRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.connectors.v1.IConnection, + | protos.google.cloud.connectors.v1.IGetConnectionRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.connectors.v1.IConnection, + protos.google.cloud.connectors.v1.IGetConnectionRequest | 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(); + return this.innerApiCalls.getConnection(request, options, callback); + } + /** + * Gets details of a provider. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. Resource name of the form: + * `projects/* /locations/* /providers/*` + * Only global location is supported for Provider resource. + * @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.connectors.v1.Provider|Provider}. + * 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/connectors.get_provider.js + * region_tag:connectors_v1_generated_Connectors_GetProvider_async + */ + getProvider( + request?: protos.google.cloud.connectors.v1.IGetProviderRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.connectors.v1.IProvider, + protos.google.cloud.connectors.v1.IGetProviderRequest | undefined, + {} | undefined, + ] + >; + getProvider( + request: protos.google.cloud.connectors.v1.IGetProviderRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.connectors.v1.IProvider, + protos.google.cloud.connectors.v1.IGetProviderRequest | null | undefined, + {} | null | undefined + > + ): void; + getProvider( + request: protos.google.cloud.connectors.v1.IGetProviderRequest, + callback: Callback< + protos.google.cloud.connectors.v1.IProvider, + protos.google.cloud.connectors.v1.IGetProviderRequest | null | undefined, + {} | null | undefined + > + ): void; + getProvider( + request?: protos.google.cloud.connectors.v1.IGetProviderRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.connectors.v1.IProvider, + | protos.google.cloud.connectors.v1.IGetProviderRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.connectors.v1.IProvider, + protos.google.cloud.connectors.v1.IGetProviderRequest | null | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.connectors.v1.IProvider, + protos.google.cloud.connectors.v1.IGetProviderRequest | 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(); + return this.innerApiCalls.getProvider(request, options, callback); + } + /** + * Gets details of a single Connector. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. Resource name of the form: + * `projects/* /locations/* /providers/* /connectors/*` + * Only global location is supported for Connector resource. + * @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.connectors.v1.Connector|Connector}. + * 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/connectors.get_connector.js + * region_tag:connectors_v1_generated_Connectors_GetConnector_async + */ + getConnector( + request?: protos.google.cloud.connectors.v1.IGetConnectorRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.connectors.v1.IConnector, + protos.google.cloud.connectors.v1.IGetConnectorRequest | undefined, + {} | undefined, + ] + >; + getConnector( + request: protos.google.cloud.connectors.v1.IGetConnectorRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.connectors.v1.IConnector, + protos.google.cloud.connectors.v1.IGetConnectorRequest | null | undefined, + {} | null | undefined + > + ): void; + getConnector( + request: protos.google.cloud.connectors.v1.IGetConnectorRequest, + callback: Callback< + protos.google.cloud.connectors.v1.IConnector, + protos.google.cloud.connectors.v1.IGetConnectorRequest | null | undefined, + {} | null | undefined + > + ): void; + getConnector( + request?: protos.google.cloud.connectors.v1.IGetConnectorRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.connectors.v1.IConnector, + | protos.google.cloud.connectors.v1.IGetConnectorRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.connectors.v1.IConnector, + protos.google.cloud.connectors.v1.IGetConnectorRequest | null | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.connectors.v1.IConnector, + protos.google.cloud.connectors.v1.IGetConnectorRequest | 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(); + return this.innerApiCalls.getConnector(request, options, callback); + } + /** + * Gets details of a single connector version. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. Resource name of the form: + * `projects/* /locations/* /providers/* /connectors/* /versions/*` + * Only global location is supported for ConnectorVersion resource. + * @param {google.cloud.connectors.v1.ConnectorVersionView} request.view + * Specifies which fields of the ConnectorVersion are returned in the + * response. Defaults to `CUSTOMER` view. + * @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.connectors.v1.ConnectorVersion|ConnectorVersion}. + * 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/connectors.get_connector_version.js + * region_tag:connectors_v1_generated_Connectors_GetConnectorVersion_async + */ + getConnectorVersion( + request?: protos.google.cloud.connectors.v1.IGetConnectorVersionRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.connectors.v1.IConnectorVersion, + protos.google.cloud.connectors.v1.IGetConnectorVersionRequest | undefined, + {} | undefined, + ] + >; + getConnectorVersion( + request: protos.google.cloud.connectors.v1.IGetConnectorVersionRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.connectors.v1.IConnectorVersion, + | protos.google.cloud.connectors.v1.IGetConnectorVersionRequest + | null + | undefined, + {} | null | undefined + > + ): void; + getConnectorVersion( + request: protos.google.cloud.connectors.v1.IGetConnectorVersionRequest, + callback: Callback< + protos.google.cloud.connectors.v1.IConnectorVersion, + | protos.google.cloud.connectors.v1.IGetConnectorVersionRequest + | null + | undefined, + {} | null | undefined + > + ): void; + getConnectorVersion( + request?: protos.google.cloud.connectors.v1.IGetConnectorVersionRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.connectors.v1.IConnectorVersion, + | protos.google.cloud.connectors.v1.IGetConnectorVersionRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.connectors.v1.IConnectorVersion, + | protos.google.cloud.connectors.v1.IGetConnectorVersionRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.connectors.v1.IConnectorVersion, + protos.google.cloud.connectors.v1.IGetConnectorVersionRequest | 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(); + return this.innerApiCalls.getConnectorVersion(request, options, callback); + } + /** + * Gets schema metadata of a connection. + * SchemaMetadata is a singleton resource for each connection. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. Connection name + * Format: + * projects/{project}/locations/{location}/connections/{connection}/connectionSchemaMetadata + * @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.connectors.v1.ConnectionSchemaMetadata|ConnectionSchemaMetadata}. + * 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/connectors.get_connection_schema_metadata.js + * region_tag:connectors_v1_generated_Connectors_GetConnectionSchemaMetadata_async + */ + getConnectionSchemaMetadata( + request?: protos.google.cloud.connectors.v1.IGetConnectionSchemaMetadataRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.connectors.v1.IConnectionSchemaMetadata, + ( + | protos.google.cloud.connectors.v1.IGetConnectionSchemaMetadataRequest + | undefined + ), + {} | undefined, + ] + >; + getConnectionSchemaMetadata( + request: protos.google.cloud.connectors.v1.IGetConnectionSchemaMetadataRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.connectors.v1.IConnectionSchemaMetadata, + | protos.google.cloud.connectors.v1.IGetConnectionSchemaMetadataRequest + | null + | undefined, + {} | null | undefined + > + ): void; + getConnectionSchemaMetadata( + request: protos.google.cloud.connectors.v1.IGetConnectionSchemaMetadataRequest, + callback: Callback< + protos.google.cloud.connectors.v1.IConnectionSchemaMetadata, + | protos.google.cloud.connectors.v1.IGetConnectionSchemaMetadataRequest + | null + | undefined, + {} | null | undefined + > + ): void; + getConnectionSchemaMetadata( + request?: protos.google.cloud.connectors.v1.IGetConnectionSchemaMetadataRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.connectors.v1.IConnectionSchemaMetadata, + | protos.google.cloud.connectors.v1.IGetConnectionSchemaMetadataRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.connectors.v1.IConnectionSchemaMetadata, + | protos.google.cloud.connectors.v1.IGetConnectionSchemaMetadataRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.connectors.v1.IConnectionSchemaMetadata, + ( + | protos.google.cloud.connectors.v1.IGetConnectionSchemaMetadataRequest + | 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(); + return this.innerApiCalls.getConnectionSchemaMetadata( + request, + options, + callback + ); + } + /** + * Gets the runtimeConfig of a location. + * RuntimeConfig is a singleton resource for each location. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. Resource name of the form: + * `projects/* /locations/* /runtimeConfig` + * @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.connectors.v1.RuntimeConfig|RuntimeConfig}. + * 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/connectors.get_runtime_config.js + * region_tag:connectors_v1_generated_Connectors_GetRuntimeConfig_async + */ + getRuntimeConfig( + request?: protos.google.cloud.connectors.v1.IGetRuntimeConfigRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.connectors.v1.IRuntimeConfig, + protos.google.cloud.connectors.v1.IGetRuntimeConfigRequest | undefined, + {} | undefined, + ] + >; + getRuntimeConfig( + request: protos.google.cloud.connectors.v1.IGetRuntimeConfigRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.connectors.v1.IRuntimeConfig, + | protos.google.cloud.connectors.v1.IGetRuntimeConfigRequest + | null + | undefined, + {} | null | undefined + > + ): void; + getRuntimeConfig( + request: protos.google.cloud.connectors.v1.IGetRuntimeConfigRequest, + callback: Callback< + protos.google.cloud.connectors.v1.IRuntimeConfig, + | protos.google.cloud.connectors.v1.IGetRuntimeConfigRequest + | null + | undefined, + {} | null | undefined + > + ): void; + getRuntimeConfig( + request?: protos.google.cloud.connectors.v1.IGetRuntimeConfigRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.connectors.v1.IRuntimeConfig, + | protos.google.cloud.connectors.v1.IGetRuntimeConfigRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.connectors.v1.IRuntimeConfig, + | protos.google.cloud.connectors.v1.IGetRuntimeConfigRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.connectors.v1.IRuntimeConfig, + protos.google.cloud.connectors.v1.IGetRuntimeConfigRequest | 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(); + return this.innerApiCalls.getRuntimeConfig(request, options, callback); + } + /** + * GetGlobalSettings gets settings of a project. + * GlobalSettings is a singleton resource. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The resource name of the Settings. + * @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.connectors.v1.Settings|Settings}. + * 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/connectors.get_global_settings.js + * region_tag:connectors_v1_generated_Connectors_GetGlobalSettings_async + */ + getGlobalSettings( + request?: protos.google.cloud.connectors.v1.IGetGlobalSettingsRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.connectors.v1.ISettings, + protos.google.cloud.connectors.v1.IGetGlobalSettingsRequest | undefined, + {} | undefined, + ] + >; + getGlobalSettings( + request: protos.google.cloud.connectors.v1.IGetGlobalSettingsRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.connectors.v1.ISettings, + | protos.google.cloud.connectors.v1.IGetGlobalSettingsRequest + | null + | undefined, + {} | null | undefined + > + ): void; + getGlobalSettings( + request: protos.google.cloud.connectors.v1.IGetGlobalSettingsRequest, + callback: Callback< + protos.google.cloud.connectors.v1.ISettings, + | protos.google.cloud.connectors.v1.IGetGlobalSettingsRequest + | null + | undefined, + {} | null | undefined + > + ): void; + getGlobalSettings( + request?: protos.google.cloud.connectors.v1.IGetGlobalSettingsRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.connectors.v1.ISettings, + | protos.google.cloud.connectors.v1.IGetGlobalSettingsRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.connectors.v1.ISettings, + | protos.google.cloud.connectors.v1.IGetGlobalSettingsRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.connectors.v1.ISettings, + protos.google.cloud.connectors.v1.IGetGlobalSettingsRequest | 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(); + return this.innerApiCalls.getGlobalSettings(request, options, callback); + } + + /** + * Creates a new Connection in a given project and location. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. Parent resource of the Connection, of the form: + * `projects/* /locations/*` + * @param {string} request.connectionId + * Required. Identifier to assign to the Connection. Must be unique within + * scope of the parent resource. + * @param {google.cloud.connectors.v1.Connection} request.connection + * Required. Connection resource. + * @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/connectors.create_connection.js + * region_tag:connectors_v1_generated_Connectors_CreateConnection_async + */ + createConnection( + request?: protos.google.cloud.connectors.v1.ICreateConnectionRequest, + options?: CallOptions + ): Promise< + [ + LROperation< + protos.google.cloud.connectors.v1.IConnection, + protos.google.cloud.connectors.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined, + ] + >; + createConnection( + request: protos.google.cloud.connectors.v1.ICreateConnectionRequest, + options: CallOptions, + callback: Callback< + LROperation< + protos.google.cloud.connectors.v1.IConnection, + protos.google.cloud.connectors.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + createConnection( + request: protos.google.cloud.connectors.v1.ICreateConnectionRequest, + callback: Callback< + LROperation< + protos.google.cloud.connectors.v1.IConnection, + protos.google.cloud.connectors.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + createConnection( + request?: protos.google.cloud.connectors.v1.ICreateConnectionRequest, + optionsOrCallback?: + | CallOptions + | Callback< + LROperation< + protos.google.cloud.connectors.v1.IConnection, + protos.google.cloud.connectors.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + callback?: Callback< + LROperation< + protos.google.cloud.connectors.v1.IConnection, + protos.google.cloud.connectors.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): Promise< + [ + LROperation< + protos.google.cloud.connectors.v1.IConnection, + protos.google.cloud.connectors.v1.IOperationMetadata + >, + 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(); + return this.innerApiCalls.createConnection(request, options, callback); + } + /** + * Check the status of the long running operation returned by `createConnection()`. + * @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/connectors.create_connection.js + * region_tag:connectors_v1_generated_Connectors_CreateConnection_async + */ + async checkCreateConnectionProgress( + name: string + ): Promise< + LROperation< + protos.google.cloud.connectors.v1.Connection, + protos.google.cloud.connectors.v1.OperationMetadata + > + > { + 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.createConnection, + this._gaxModule.createDefaultBackoffSettings() + ); + return decodeOperation as LROperation< + protos.google.cloud.connectors.v1.Connection, + protos.google.cloud.connectors.v1.OperationMetadata + >; + } + /** + * Updates the parameters of a single Connection. + * + * @param {Object} request + * The request object that will be sent. + * @param {google.cloud.connectors.v1.Connection} request.connection + * Required. Connection resource. + * @param {google.protobuf.FieldMask} request.updateMask + * Required. You can modify only the fields listed below. + * + * To lock/unlock a connection: + * * `lock_config` + * + * To suspend/resume a connection: + * * `suspended` + * + * To update the connection details: + * * `description` + * * `labels` + * * `connector_version` + * * `config_variables` + * * `auth_config` + * * `destination_configs` + * * `node_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 + * 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/connectors.update_connection.js + * region_tag:connectors_v1_generated_Connectors_UpdateConnection_async + */ + updateConnection( + request?: protos.google.cloud.connectors.v1.IUpdateConnectionRequest, + options?: CallOptions + ): Promise< + [ + LROperation< + protos.google.cloud.connectors.v1.IConnection, + protos.google.cloud.connectors.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined, + ] + >; + updateConnection( + request: protos.google.cloud.connectors.v1.IUpdateConnectionRequest, + options: CallOptions, + callback: Callback< + LROperation< + protos.google.cloud.connectors.v1.IConnection, + protos.google.cloud.connectors.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + updateConnection( + request: protos.google.cloud.connectors.v1.IUpdateConnectionRequest, + callback: Callback< + LROperation< + protos.google.cloud.connectors.v1.IConnection, + protos.google.cloud.connectors.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + updateConnection( + request?: protos.google.cloud.connectors.v1.IUpdateConnectionRequest, + optionsOrCallback?: + | CallOptions + | Callback< + LROperation< + protos.google.cloud.connectors.v1.IConnection, + protos.google.cloud.connectors.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + callback?: Callback< + LROperation< + protos.google.cloud.connectors.v1.IConnection, + protos.google.cloud.connectors.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): Promise< + [ + LROperation< + protos.google.cloud.connectors.v1.IConnection, + protos.google.cloud.connectors.v1.IOperationMetadata + >, + 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({ + 'connection.name': request.connection!.name ?? '', + }); + this.initialize(); + return this.innerApiCalls.updateConnection(request, options, callback); + } + /** + * Check the status of the long running operation returned by `updateConnection()`. + * @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/connectors.update_connection.js + * region_tag:connectors_v1_generated_Connectors_UpdateConnection_async + */ + async checkUpdateConnectionProgress( + name: string + ): Promise< + LROperation< + protos.google.cloud.connectors.v1.Connection, + protos.google.cloud.connectors.v1.OperationMetadata + > + > { + 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.updateConnection, + this._gaxModule.createDefaultBackoffSettings() + ); + return decodeOperation as LROperation< + protos.google.cloud.connectors.v1.Connection, + protos.google.cloud.connectors.v1.OperationMetadata + >; + } + /** + * Deletes a single Connection. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. Resource name of the form: + * `projects/* /locations/* /connections/*` + * @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/connectors.delete_connection.js + * region_tag:connectors_v1_generated_Connectors_DeleteConnection_async + */ + deleteConnection( + request?: protos.google.cloud.connectors.v1.IDeleteConnectionRequest, + options?: CallOptions + ): Promise< + [ + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.connectors.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined, + ] + >; + deleteConnection( + request: protos.google.cloud.connectors.v1.IDeleteConnectionRequest, + options: CallOptions, + callback: Callback< + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.connectors.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + deleteConnection( + request: protos.google.cloud.connectors.v1.IDeleteConnectionRequest, + callback: Callback< + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.connectors.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + deleteConnection( + request?: protos.google.cloud.connectors.v1.IDeleteConnectionRequest, + optionsOrCallback?: + | CallOptions + | Callback< + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.connectors.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + callback?: Callback< + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.connectors.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): Promise< + [ + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.connectors.v1.IOperationMetadata + >, + 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(); + return this.innerApiCalls.deleteConnection(request, options, callback); + } + /** + * Check the status of the long running operation returned by `deleteConnection()`. + * @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/connectors.delete_connection.js + * region_tag:connectors_v1_generated_Connectors_DeleteConnection_async + */ + async checkDeleteConnectionProgress( + name: string + ): Promise< + LROperation< + protos.google.protobuf.Empty, + protos.google.cloud.connectors.v1.OperationMetadata + > + > { + 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.deleteConnection, + this._gaxModule.createDefaultBackoffSettings() + ); + return decodeOperation as LROperation< + protos.google.protobuf.Empty, + protos.google.cloud.connectors.v1.OperationMetadata + >; + } + /** + * Refresh runtime schema of a connection. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. Resource name. + * Format: + * projects/{project}/locations/{location}/connections/{connection}/connectionSchemaMetadata + * @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/connectors.refresh_connection_schema_metadata.js + * region_tag:connectors_v1_generated_Connectors_RefreshConnectionSchemaMetadata_async + */ + refreshConnectionSchemaMetadata( + request?: protos.google.cloud.connectors.v1.IRefreshConnectionSchemaMetadataRequest, + options?: CallOptions + ): Promise< + [ + LROperation< + protos.google.cloud.connectors.v1.IConnectionSchemaMetadata, + protos.google.cloud.connectors.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined, + ] + >; + refreshConnectionSchemaMetadata( + request: protos.google.cloud.connectors.v1.IRefreshConnectionSchemaMetadataRequest, + options: CallOptions, + callback: Callback< + LROperation< + protos.google.cloud.connectors.v1.IConnectionSchemaMetadata, + protos.google.cloud.connectors.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + refreshConnectionSchemaMetadata( + request: protos.google.cloud.connectors.v1.IRefreshConnectionSchemaMetadataRequest, + callback: Callback< + LROperation< + protos.google.cloud.connectors.v1.IConnectionSchemaMetadata, + protos.google.cloud.connectors.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + refreshConnectionSchemaMetadata( + request?: protos.google.cloud.connectors.v1.IRefreshConnectionSchemaMetadataRequest, + optionsOrCallback?: + | CallOptions + | Callback< + LROperation< + protos.google.cloud.connectors.v1.IConnectionSchemaMetadata, + protos.google.cloud.connectors.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + callback?: Callback< + LROperation< + protos.google.cloud.connectors.v1.IConnectionSchemaMetadata, + protos.google.cloud.connectors.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): Promise< + [ + LROperation< + protos.google.cloud.connectors.v1.IConnectionSchemaMetadata, + protos.google.cloud.connectors.v1.IOperationMetadata + >, + 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(); + return this.innerApiCalls.refreshConnectionSchemaMetadata( + request, + options, + callback + ); + } + /** + * Check the status of the long running operation returned by `refreshConnectionSchemaMetadata()`. + * @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/connectors.refresh_connection_schema_metadata.js + * region_tag:connectors_v1_generated_Connectors_RefreshConnectionSchemaMetadata_async + */ + async checkRefreshConnectionSchemaMetadataProgress( + name: string + ): Promise< + LROperation< + protos.google.cloud.connectors.v1.ConnectionSchemaMetadata, + protos.google.cloud.connectors.v1.OperationMetadata + > + > { + 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.refreshConnectionSchemaMetadata, + this._gaxModule.createDefaultBackoffSettings() + ); + return decodeOperation as LROperation< + protos.google.cloud.connectors.v1.ConnectionSchemaMetadata, + protos.google.cloud.connectors.v1.OperationMetadata + >; + } + /** + * Lists Connections in a given project and location. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. Parent resource of the Connection, of the form: + * `projects/* /locations/*` + * @param {number} request.pageSize + * Page size. + * @param {string} request.pageToken + * Page token. + * @param {string} request.filter + * Filter. + * @param {string} request.orderBy + * Order by parameters. + * @param {google.cloud.connectors.v1.ConnectionView} request.view + * Specifies which fields of the Connection are returned in the response. + * Defaults to `BASIC` view. + * @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.connectors.v1.Connection|Connection}. + * 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 `listConnectionsAsync()` + * 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. + */ + listConnections( + request?: protos.google.cloud.connectors.v1.IListConnectionsRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.connectors.v1.IConnection[], + protos.google.cloud.connectors.v1.IListConnectionsRequest | null, + protos.google.cloud.connectors.v1.IListConnectionsResponse, + ] + >; + listConnections( + request: protos.google.cloud.connectors.v1.IListConnectionsRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.cloud.connectors.v1.IListConnectionsRequest, + | protos.google.cloud.connectors.v1.IListConnectionsResponse + | null + | undefined, + protos.google.cloud.connectors.v1.IConnection + > + ): void; + listConnections( + request: protos.google.cloud.connectors.v1.IListConnectionsRequest, + callback: PaginationCallback< + protos.google.cloud.connectors.v1.IListConnectionsRequest, + | protos.google.cloud.connectors.v1.IListConnectionsResponse + | null + | undefined, + protos.google.cloud.connectors.v1.IConnection + > + ): void; + listConnections( + request?: protos.google.cloud.connectors.v1.IListConnectionsRequest, + optionsOrCallback?: + | CallOptions + | PaginationCallback< + protos.google.cloud.connectors.v1.IListConnectionsRequest, + | protos.google.cloud.connectors.v1.IListConnectionsResponse + | null + | undefined, + protos.google.cloud.connectors.v1.IConnection + >, + callback?: PaginationCallback< + protos.google.cloud.connectors.v1.IListConnectionsRequest, + | protos.google.cloud.connectors.v1.IListConnectionsResponse + | null + | undefined, + protos.google.cloud.connectors.v1.IConnection + > + ): Promise< + [ + protos.google.cloud.connectors.v1.IConnection[], + protos.google.cloud.connectors.v1.IListConnectionsRequest | null, + protos.google.cloud.connectors.v1.IListConnectionsResponse, + ] + > | 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(); + return this.innerApiCalls.listConnections(request, options, callback); + } + + /** + * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. Parent resource of the Connection, of the form: + * `projects/* /locations/*` + * @param {number} request.pageSize + * Page size. + * @param {string} request.pageToken + * Page token. + * @param {string} request.filter + * Filter. + * @param {string} request.orderBy + * Order by parameters. + * @param {google.cloud.connectors.v1.ConnectionView} request.view + * Specifies which fields of the Connection are returned in the response. + * Defaults to `BASIC` view. + * @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.connectors.v1.Connection|Connection} 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 `listConnectionsAsync()` + * 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. + */ + listConnectionsStream( + request?: protos.google.cloud.connectors.v1.IListConnectionsRequest, + 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['listConnections']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.listConnections.createStream( + this.innerApiCalls.listConnections as GaxCall, + request, + callSettings + ); + } + + /** + * Equivalent to `listConnections`, 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. Parent resource of the Connection, of the form: + * `projects/* /locations/*` + * @param {number} request.pageSize + * Page size. + * @param {string} request.pageToken + * Page token. + * @param {string} request.filter + * Filter. + * @param {string} request.orderBy + * Order by parameters. + * @param {google.cloud.connectors.v1.ConnectionView} request.view + * Specifies which fields of the Connection are returned in the response. + * Defaults to `BASIC` view. + * @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.connectors.v1.Connection|Connection}. 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/connectors.list_connections.js + * region_tag:connectors_v1_generated_Connectors_ListConnections_async + */ + listConnectionsAsync( + request?: protos.google.cloud.connectors.v1.IListConnectionsRequest, + 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['listConnections']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.listConnections.asyncIterate( + this.innerApiCalls['listConnections'] as GaxCall, + request as {}, + callSettings + ) as AsyncIterable; + } + /** + * Lists Providers in a given project and location. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. Parent resource of the API, of the form: + * `projects/* /locations/*` + * Only global location is supported for Provider resource. + * @param {number} request.pageSize + * Page size. + * @param {string} request.pageToken + * 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.connectors.v1.Provider|Provider}. + * 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 `listProvidersAsync()` + * 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. + */ + listProviders( + request?: protos.google.cloud.connectors.v1.IListProvidersRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.connectors.v1.IProvider[], + protos.google.cloud.connectors.v1.IListProvidersRequest | null, + protos.google.cloud.connectors.v1.IListProvidersResponse, + ] + >; + listProviders( + request: protos.google.cloud.connectors.v1.IListProvidersRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.cloud.connectors.v1.IListProvidersRequest, + | protos.google.cloud.connectors.v1.IListProvidersResponse + | null + | undefined, + protos.google.cloud.connectors.v1.IProvider + > + ): void; + listProviders( + request: protos.google.cloud.connectors.v1.IListProvidersRequest, + callback: PaginationCallback< + protos.google.cloud.connectors.v1.IListProvidersRequest, + | protos.google.cloud.connectors.v1.IListProvidersResponse + | null + | undefined, + protos.google.cloud.connectors.v1.IProvider + > + ): void; + listProviders( + request?: protos.google.cloud.connectors.v1.IListProvidersRequest, + optionsOrCallback?: + | CallOptions + | PaginationCallback< + protos.google.cloud.connectors.v1.IListProvidersRequest, + | protos.google.cloud.connectors.v1.IListProvidersResponse + | null + | undefined, + protos.google.cloud.connectors.v1.IProvider + >, + callback?: PaginationCallback< + protos.google.cloud.connectors.v1.IListProvidersRequest, + | protos.google.cloud.connectors.v1.IListProvidersResponse + | null + | undefined, + protos.google.cloud.connectors.v1.IProvider + > + ): Promise< + [ + protos.google.cloud.connectors.v1.IProvider[], + protos.google.cloud.connectors.v1.IListProvidersRequest | null, + protos.google.cloud.connectors.v1.IListProvidersResponse, + ] + > | 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(); + return this.innerApiCalls.listProviders(request, options, callback); + } + + /** + * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. Parent resource of the API, of the form: + * `projects/* /locations/*` + * Only global location is supported for Provider resource. + * @param {number} request.pageSize + * Page size. + * @param {string} request.pageToken + * 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.connectors.v1.Provider|Provider} 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 `listProvidersAsync()` + * 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. + */ + listProvidersStream( + request?: protos.google.cloud.connectors.v1.IListProvidersRequest, + 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['listProviders']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.listProviders.createStream( + this.innerApiCalls.listProviders as GaxCall, + request, + callSettings + ); + } + + /** + * Equivalent to `listProviders`, 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. Parent resource of the API, of the form: + * `projects/* /locations/*` + * Only global location is supported for Provider resource. + * @param {number} request.pageSize + * Page size. + * @param {string} request.pageToken + * 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.connectors.v1.Provider|Provider}. 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/connectors.list_providers.js + * region_tag:connectors_v1_generated_Connectors_ListProviders_async + */ + listProvidersAsync( + request?: protos.google.cloud.connectors.v1.IListProvidersRequest, + 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['listProviders']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.listProviders.asyncIterate( + this.innerApiCalls['listProviders'] as GaxCall, + request as {}, + callSettings + ) as AsyncIterable; + } + /** + * Lists Connectors in a given project and location. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. Parent resource of the connectors, of the form: + * `projects/* /locations/* /providers/*` + * Only global location is supported for Connector resource. + * @param {number} request.pageSize + * Page size. + * @param {string} request.pageToken + * 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.connectors.v1.Connector|Connector}. + * 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 `listConnectorsAsync()` + * 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. + */ + listConnectors( + request?: protos.google.cloud.connectors.v1.IListConnectorsRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.connectors.v1.IConnector[], + protos.google.cloud.connectors.v1.IListConnectorsRequest | null, + protos.google.cloud.connectors.v1.IListConnectorsResponse, + ] + >; + listConnectors( + request: protos.google.cloud.connectors.v1.IListConnectorsRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.cloud.connectors.v1.IListConnectorsRequest, + | protos.google.cloud.connectors.v1.IListConnectorsResponse + | null + | undefined, + protos.google.cloud.connectors.v1.IConnector + > + ): void; + listConnectors( + request: protos.google.cloud.connectors.v1.IListConnectorsRequest, + callback: PaginationCallback< + protos.google.cloud.connectors.v1.IListConnectorsRequest, + | protos.google.cloud.connectors.v1.IListConnectorsResponse + | null + | undefined, + protos.google.cloud.connectors.v1.IConnector + > + ): void; + listConnectors( + request?: protos.google.cloud.connectors.v1.IListConnectorsRequest, + optionsOrCallback?: + | CallOptions + | PaginationCallback< + protos.google.cloud.connectors.v1.IListConnectorsRequest, + | protos.google.cloud.connectors.v1.IListConnectorsResponse + | null + | undefined, + protos.google.cloud.connectors.v1.IConnector + >, + callback?: PaginationCallback< + protos.google.cloud.connectors.v1.IListConnectorsRequest, + | protos.google.cloud.connectors.v1.IListConnectorsResponse + | null + | undefined, + protos.google.cloud.connectors.v1.IConnector + > + ): Promise< + [ + protos.google.cloud.connectors.v1.IConnector[], + protos.google.cloud.connectors.v1.IListConnectorsRequest | null, + protos.google.cloud.connectors.v1.IListConnectorsResponse, + ] + > | 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(); + return this.innerApiCalls.listConnectors(request, options, callback); + } + + /** + * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. Parent resource of the connectors, of the form: + * `projects/* /locations/* /providers/*` + * Only global location is supported for Connector resource. + * @param {number} request.pageSize + * Page size. + * @param {string} request.pageToken + * 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.connectors.v1.Connector|Connector} 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 `listConnectorsAsync()` + * 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. + */ + listConnectorsStream( + request?: protos.google.cloud.connectors.v1.IListConnectorsRequest, + 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['listConnectors']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.listConnectors.createStream( + this.innerApiCalls.listConnectors as GaxCall, + request, + callSettings + ); + } + + /** + * Equivalent to `listConnectors`, 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. Parent resource of the connectors, of the form: + * `projects/* /locations/* /providers/*` + * Only global location is supported for Connector resource. + * @param {number} request.pageSize + * Page size. + * @param {string} request.pageToken + * 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.connectors.v1.Connector|Connector}. 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/connectors.list_connectors.js + * region_tag:connectors_v1_generated_Connectors_ListConnectors_async + */ + listConnectorsAsync( + request?: protos.google.cloud.connectors.v1.IListConnectorsRequest, + 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['listConnectors']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.listConnectors.asyncIterate( + this.innerApiCalls['listConnectors'] as GaxCall, + request as {}, + callSettings + ) as AsyncIterable; + } + /** + * Lists Connector Versions in a given project and location. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. Parent resource of the connectors, of the form: + * `projects/* /locations/* /providers/* /connectors/*` + * Only global location is supported for ConnectorVersion resource. + * @param {number} request.pageSize + * Page size. + * @param {string} request.pageToken + * Page token. + * @param {google.cloud.connectors.v1.ConnectorVersionView} request.view + * Specifies which fields of the ConnectorVersion are returned in the + * response. Defaults to `BASIC` view. + * @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.connectors.v1.ConnectorVersion|ConnectorVersion}. + * 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 `listConnectorVersionsAsync()` + * 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. + */ + listConnectorVersions( + request?: protos.google.cloud.connectors.v1.IListConnectorVersionsRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.connectors.v1.IConnectorVersion[], + protos.google.cloud.connectors.v1.IListConnectorVersionsRequest | null, + protos.google.cloud.connectors.v1.IListConnectorVersionsResponse, + ] + >; + listConnectorVersions( + request: protos.google.cloud.connectors.v1.IListConnectorVersionsRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.cloud.connectors.v1.IListConnectorVersionsRequest, + | protos.google.cloud.connectors.v1.IListConnectorVersionsResponse + | null + | undefined, + protos.google.cloud.connectors.v1.IConnectorVersion + > + ): void; + listConnectorVersions( + request: protos.google.cloud.connectors.v1.IListConnectorVersionsRequest, + callback: PaginationCallback< + protos.google.cloud.connectors.v1.IListConnectorVersionsRequest, + | protos.google.cloud.connectors.v1.IListConnectorVersionsResponse + | null + | undefined, + protos.google.cloud.connectors.v1.IConnectorVersion + > + ): void; + listConnectorVersions( + request?: protos.google.cloud.connectors.v1.IListConnectorVersionsRequest, + optionsOrCallback?: + | CallOptions + | PaginationCallback< + protos.google.cloud.connectors.v1.IListConnectorVersionsRequest, + | protos.google.cloud.connectors.v1.IListConnectorVersionsResponse + | null + | undefined, + protos.google.cloud.connectors.v1.IConnectorVersion + >, + callback?: PaginationCallback< + protos.google.cloud.connectors.v1.IListConnectorVersionsRequest, + | protos.google.cloud.connectors.v1.IListConnectorVersionsResponse + | null + | undefined, + protos.google.cloud.connectors.v1.IConnectorVersion + > + ): Promise< + [ + protos.google.cloud.connectors.v1.IConnectorVersion[], + protos.google.cloud.connectors.v1.IListConnectorVersionsRequest | null, + protos.google.cloud.connectors.v1.IListConnectorVersionsResponse, + ] + > | 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(); + return this.innerApiCalls.listConnectorVersions(request, options, callback); + } + + /** + * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. Parent resource of the connectors, of the form: + * `projects/* /locations/* /providers/* /connectors/*` + * Only global location is supported for ConnectorVersion resource. + * @param {number} request.pageSize + * Page size. + * @param {string} request.pageToken + * Page token. + * @param {google.cloud.connectors.v1.ConnectorVersionView} request.view + * Specifies which fields of the ConnectorVersion are returned in the + * response. Defaults to `BASIC` view. + * @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.connectors.v1.ConnectorVersion|ConnectorVersion} 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 `listConnectorVersionsAsync()` + * 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. + */ + listConnectorVersionsStream( + request?: protos.google.cloud.connectors.v1.IListConnectorVersionsRequest, + 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['listConnectorVersions']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.listConnectorVersions.createStream( + this.innerApiCalls.listConnectorVersions as GaxCall, + request, + callSettings + ); + } + + /** + * Equivalent to `listConnectorVersions`, 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. Parent resource of the connectors, of the form: + * `projects/* /locations/* /providers/* /connectors/*` + * Only global location is supported for ConnectorVersion resource. + * @param {number} request.pageSize + * Page size. + * @param {string} request.pageToken + * Page token. + * @param {google.cloud.connectors.v1.ConnectorVersionView} request.view + * Specifies which fields of the ConnectorVersion are returned in the + * response. Defaults to `BASIC` view. + * @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.connectors.v1.ConnectorVersion|ConnectorVersion}. 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/connectors.list_connector_versions.js + * region_tag:connectors_v1_generated_Connectors_ListConnectorVersions_async + */ + listConnectorVersionsAsync( + request?: protos.google.cloud.connectors.v1.IListConnectorVersionsRequest, + 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['listConnectorVersions']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.listConnectorVersions.asyncIterate( + this.innerApiCalls['listConnectorVersions'] as GaxCall, + request as {}, + callSettings + ) as AsyncIterable; + } + /** + * List schema of a runtime entities filtered by entity name. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. Parent resource of RuntimeEntitySchema + * Format: + * projects/{project}/locations/{location}/connections/{connection} + * @param {number} request.pageSize + * Page size. + * @param {string} request.pageToken + * Page token. + * @param {string} request.filter + * Required. Filter + * Format: + * entity="{entityId}" + * Only entity field is supported with literal equality operator. + * Accepted filter example: entity="Order" + * Wildcards are not supported in the filter currently. + * @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.connectors.v1.RuntimeEntitySchema|RuntimeEntitySchema}. + * 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 `listRuntimeEntitySchemasAsync()` + * 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. + */ + listRuntimeEntitySchemas( + request?: protos.google.cloud.connectors.v1.IListRuntimeEntitySchemasRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.connectors.v1.IRuntimeEntitySchema[], + protos.google.cloud.connectors.v1.IListRuntimeEntitySchemasRequest | null, + protos.google.cloud.connectors.v1.IListRuntimeEntitySchemasResponse, + ] + >; + listRuntimeEntitySchemas( + request: protos.google.cloud.connectors.v1.IListRuntimeEntitySchemasRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.cloud.connectors.v1.IListRuntimeEntitySchemasRequest, + | protos.google.cloud.connectors.v1.IListRuntimeEntitySchemasResponse + | null + | undefined, + protos.google.cloud.connectors.v1.IRuntimeEntitySchema + > + ): void; + listRuntimeEntitySchemas( + request: protos.google.cloud.connectors.v1.IListRuntimeEntitySchemasRequest, + callback: PaginationCallback< + protos.google.cloud.connectors.v1.IListRuntimeEntitySchemasRequest, + | protos.google.cloud.connectors.v1.IListRuntimeEntitySchemasResponse + | null + | undefined, + protos.google.cloud.connectors.v1.IRuntimeEntitySchema + > + ): void; + listRuntimeEntitySchemas( + request?: protos.google.cloud.connectors.v1.IListRuntimeEntitySchemasRequest, + optionsOrCallback?: + | CallOptions + | PaginationCallback< + protos.google.cloud.connectors.v1.IListRuntimeEntitySchemasRequest, + | protos.google.cloud.connectors.v1.IListRuntimeEntitySchemasResponse + | null + | undefined, + protos.google.cloud.connectors.v1.IRuntimeEntitySchema + >, + callback?: PaginationCallback< + protos.google.cloud.connectors.v1.IListRuntimeEntitySchemasRequest, + | protos.google.cloud.connectors.v1.IListRuntimeEntitySchemasResponse + | null + | undefined, + protos.google.cloud.connectors.v1.IRuntimeEntitySchema + > + ): Promise< + [ + protos.google.cloud.connectors.v1.IRuntimeEntitySchema[], + protos.google.cloud.connectors.v1.IListRuntimeEntitySchemasRequest | null, + protos.google.cloud.connectors.v1.IListRuntimeEntitySchemasResponse, + ] + > | 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(); + return this.innerApiCalls.listRuntimeEntitySchemas( + request, + options, + callback + ); + } + + /** + * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. Parent resource of RuntimeEntitySchema + * Format: + * projects/{project}/locations/{location}/connections/{connection} + * @param {number} request.pageSize + * Page size. + * @param {string} request.pageToken + * Page token. + * @param {string} request.filter + * Required. Filter + * Format: + * entity="{entityId}" + * Only entity field is supported with literal equality operator. + * Accepted filter example: entity="Order" + * Wildcards are not supported in the filter currently. + * @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.connectors.v1.RuntimeEntitySchema|RuntimeEntitySchema} 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 `listRuntimeEntitySchemasAsync()` + * 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. + */ + listRuntimeEntitySchemasStream( + request?: protos.google.cloud.connectors.v1.IListRuntimeEntitySchemasRequest, + 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['listRuntimeEntitySchemas']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.listRuntimeEntitySchemas.createStream( + this.innerApiCalls.listRuntimeEntitySchemas as GaxCall, + request, + callSettings + ); + } + + /** + * Equivalent to `listRuntimeEntitySchemas`, 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. Parent resource of RuntimeEntitySchema + * Format: + * projects/{project}/locations/{location}/connections/{connection} + * @param {number} request.pageSize + * Page size. + * @param {string} request.pageToken + * Page token. + * @param {string} request.filter + * Required. Filter + * Format: + * entity="{entityId}" + * Only entity field is supported with literal equality operator. + * Accepted filter example: entity="Order" + * Wildcards are not supported in the filter currently. + * @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.connectors.v1.RuntimeEntitySchema|RuntimeEntitySchema}. 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/connectors.list_runtime_entity_schemas.js + * region_tag:connectors_v1_generated_Connectors_ListRuntimeEntitySchemas_async + */ + listRuntimeEntitySchemasAsync( + request?: protos.google.cloud.connectors.v1.IListRuntimeEntitySchemasRequest, + 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['listRuntimeEntitySchemas']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.listRuntimeEntitySchemas.asyncIterate( + this.innerApiCalls['listRuntimeEntitySchemas'] as GaxCall, + request as {}, + callSettings + ) as AsyncIterable; + } + /** + * List schema of a runtime actions filtered by action name. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. Parent resource of RuntimeActionSchema + * Format: + * projects/{project}/locations/{location}/connections/{connection} + * @param {number} request.pageSize + * Page size. + * @param {string} request.pageToken + * Page token. + * @param {string} request.filter + * Required. Filter + * Format: + * action="{actionId}" + * Only action field is supported with literal equality operator. + * Accepted filter example: action="CancelOrder" + * Wildcards are not supported in the filter currently. + * @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.connectors.v1.RuntimeActionSchema|RuntimeActionSchema}. + * 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 `listRuntimeActionSchemasAsync()` + * 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. + */ + listRuntimeActionSchemas( + request?: protos.google.cloud.connectors.v1.IListRuntimeActionSchemasRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.connectors.v1.IRuntimeActionSchema[], + protos.google.cloud.connectors.v1.IListRuntimeActionSchemasRequest | null, + protos.google.cloud.connectors.v1.IListRuntimeActionSchemasResponse, + ] + >; + listRuntimeActionSchemas( + request: protos.google.cloud.connectors.v1.IListRuntimeActionSchemasRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.cloud.connectors.v1.IListRuntimeActionSchemasRequest, + | protos.google.cloud.connectors.v1.IListRuntimeActionSchemasResponse + | null + | undefined, + protos.google.cloud.connectors.v1.IRuntimeActionSchema + > + ): void; + listRuntimeActionSchemas( + request: protos.google.cloud.connectors.v1.IListRuntimeActionSchemasRequest, + callback: PaginationCallback< + protos.google.cloud.connectors.v1.IListRuntimeActionSchemasRequest, + | protos.google.cloud.connectors.v1.IListRuntimeActionSchemasResponse + | null + | undefined, + protos.google.cloud.connectors.v1.IRuntimeActionSchema + > + ): void; + listRuntimeActionSchemas( + request?: protos.google.cloud.connectors.v1.IListRuntimeActionSchemasRequest, + optionsOrCallback?: + | CallOptions + | PaginationCallback< + protos.google.cloud.connectors.v1.IListRuntimeActionSchemasRequest, + | protos.google.cloud.connectors.v1.IListRuntimeActionSchemasResponse + | null + | undefined, + protos.google.cloud.connectors.v1.IRuntimeActionSchema + >, + callback?: PaginationCallback< + protos.google.cloud.connectors.v1.IListRuntimeActionSchemasRequest, + | protos.google.cloud.connectors.v1.IListRuntimeActionSchemasResponse + | null + | undefined, + protos.google.cloud.connectors.v1.IRuntimeActionSchema + > + ): Promise< + [ + protos.google.cloud.connectors.v1.IRuntimeActionSchema[], + protos.google.cloud.connectors.v1.IListRuntimeActionSchemasRequest | null, + protos.google.cloud.connectors.v1.IListRuntimeActionSchemasResponse, + ] + > | 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(); + return this.innerApiCalls.listRuntimeActionSchemas( + request, + options, + callback + ); + } + + /** + * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. Parent resource of RuntimeActionSchema + * Format: + * projects/{project}/locations/{location}/connections/{connection} + * @param {number} request.pageSize + * Page size. + * @param {string} request.pageToken + * Page token. + * @param {string} request.filter + * Required. Filter + * Format: + * action="{actionId}" + * Only action field is supported with literal equality operator. + * Accepted filter example: action="CancelOrder" + * Wildcards are not supported in the filter currently. + * @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.connectors.v1.RuntimeActionSchema|RuntimeActionSchema} 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 `listRuntimeActionSchemasAsync()` + * 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. + */ + listRuntimeActionSchemasStream( + request?: protos.google.cloud.connectors.v1.IListRuntimeActionSchemasRequest, + 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['listRuntimeActionSchemas']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.listRuntimeActionSchemas.createStream( + this.innerApiCalls.listRuntimeActionSchemas as GaxCall, + request, + callSettings + ); + } + + /** + * Equivalent to `listRuntimeActionSchemas`, 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. Parent resource of RuntimeActionSchema + * Format: + * projects/{project}/locations/{location}/connections/{connection} + * @param {number} request.pageSize + * Page size. + * @param {string} request.pageToken + * Page token. + * @param {string} request.filter + * Required. Filter + * Format: + * action="{actionId}" + * Only action field is supported with literal equality operator. + * Accepted filter example: action="CancelOrder" + * Wildcards are not supported in the filter currently. + * @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.connectors.v1.RuntimeActionSchema|RuntimeActionSchema}. 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/connectors.list_runtime_action_schemas.js + * region_tag:connectors_v1_generated_Connectors_ListRuntimeActionSchemas_async + */ + listRuntimeActionSchemasAsync( + request?: protos.google.cloud.connectors.v1.IListRuntimeActionSchemasRequest, + 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['listRuntimeActionSchemas']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.listRuntimeActionSchemas.asyncIterate( + this.innerApiCalls['listRuntimeActionSchemas'] as GaxCall, + request as {}, + callSettings + ) as AsyncIterable; + } + /** + * Gets the access control policy for a resource. Returns an empty policy + * if the resource exists and does not have a policy set. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.resource + * REQUIRED: The resource for which the policy is being requested. + * See the operation documentation for the appropriate value for this field. + * @param {Object} [request.options] + * OPTIONAL: A `GetPolicyOptions` object for specifying options to + * `GetIamPolicy`. This field is only used by Cloud IAM. + * + * This object should have the same structure as {@link google.iam.v1.GetPolicyOptions | GetPolicyOptions}. + * @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/interfaces/CallOptions.html | 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.iam.v1.Policy | Policy}. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link google.iam.v1.Policy | Policy}. + * The promise has a method named "cancel" which cancels the ongoing API call. + */ + getIamPolicy( + request: IamProtos.google.iam.v1.GetIamPolicyRequest, + options?: + | gax.CallOptions + | Callback< + IamProtos.google.iam.v1.Policy, + IamProtos.google.iam.v1.GetIamPolicyRequest | null | undefined, + {} | null | undefined + >, + callback?: Callback< + IamProtos.google.iam.v1.Policy, + IamProtos.google.iam.v1.GetIamPolicyRequest | null | undefined, + {} | null | undefined + > + ): Promise<[IamProtos.google.iam.v1.Policy]> { + return this.iamClient.getIamPolicy(request, options, callback); + } + + /** + * Returns permissions that a caller has on the specified resource. If the + * resource does not exist, this will return an empty set of + * permissions, not a NOT_FOUND error. + * + * Note: This operation is designed to be used for building + * permission-aware UIs and command-line tools, not for authorization + * checking. This operation may "fail open" without warning. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.resource + * REQUIRED: The resource for which the policy detail is being requested. + * See the operation documentation for the appropriate value for this field. + * @param {string[]} request.permissions + * The set of permissions to check for the `resource`. Permissions with + * wildcards (such as '*' or 'storage.*') are not allowed. For more + * information see {@link https://cloud.google.com/iam/docs/overview#permissions | IAM Overview }. + * @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/interfaces/CallOptions.html | 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.iam.v1.TestIamPermissionsResponse | TestIamPermissionsResponse}. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link google.iam.v1.TestIamPermissionsResponse | TestIamPermissionsResponse}. + * The promise has a method named "cancel" which cancels the ongoing API call. + */ + setIamPolicy( + request: IamProtos.google.iam.v1.SetIamPolicyRequest, + options?: + | gax.CallOptions + | Callback< + IamProtos.google.iam.v1.Policy, + IamProtos.google.iam.v1.SetIamPolicyRequest | null | undefined, + {} | null | undefined + >, + callback?: Callback< + IamProtos.google.iam.v1.Policy, + IamProtos.google.iam.v1.SetIamPolicyRequest | null | undefined, + {} | null | undefined + > + ): Promise<[IamProtos.google.iam.v1.Policy]> { + return this.iamClient.setIamPolicy(request, options, callback); + } + + /** + * Returns permissions that a caller has on the specified resource. If the + * resource does not exist, this will return an empty set of + * permissions, not a NOT_FOUND error. + * + * Note: This operation is designed to be used for building + * permission-aware UIs and command-line tools, not for authorization + * checking. This operation may "fail open" without warning. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.resource + * REQUIRED: The resource for which the policy detail is being requested. + * See the operation documentation for the appropriate value for this field. + * @param {string[]} request.permissions + * The set of permissions to check for the `resource`. Permissions with + * wildcards (such as '*' or 'storage.*') are not allowed. For more + * information see {@link https://cloud.google.com/iam/docs/overview#permissions | IAM Overview }. + * @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/interfaces/CallOptions.html | 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.iam.v1.TestIamPermissionsResponse | TestIamPermissionsResponse}. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link google.iam.v1.TestIamPermissionsResponse | TestIamPermissionsResponse}. + * The promise has a method named "cancel" which cancels the ongoing API call. + * + */ + testIamPermissions( + request: IamProtos.google.iam.v1.TestIamPermissionsRequest, + options?: + | gax.CallOptions + | Callback< + IamProtos.google.iam.v1.TestIamPermissionsResponse, + IamProtos.google.iam.v1.TestIamPermissionsRequest | null | undefined, + {} | null | undefined + >, + callback?: Callback< + IamProtos.google.iam.v1.TestIamPermissionsResponse, + IamProtos.google.iam.v1.TestIamPermissionsRequest | null | undefined, + {} | null | undefined + > + ): Promise<[IamProtos.google.iam.v1.TestIamPermissionsResponse]> { + return this.iamClient.testIamPermissions(request, options, callback); + } + + /** + * 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, + options?: + | 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]> { + 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 { + 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, + options?: + | gax.CallOptions + | Callback< + protos.google.protobuf.Empty, + protos.google.longrunning.CancelOperationRequest, + {} | undefined | null + >, + callback?: Callback< + protos.google.longrunning.CancelOperationRequest, + protos.google.protobuf.Empty, + {} | undefined | null + > + ): Promise { + 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, + options?: + | 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 { + return this.operationsClient.deleteOperation(request, options, callback); + } + + // -------------------- + // -- Path templates -- + // -------------------- + + /** + * Return a fully-qualified connection resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} connection + * @returns {string} Resource name string. + */ + connectionPath(project: string, location: string, connection: string) { + return this.pathTemplates.connectionPathTemplate.render({ + project: project, + location: location, + connection: connection, + }); + } + + /** + * Parse the project from Connection resource. + * + * @param {string} connectionName + * A fully-qualified path representing Connection resource. + * @returns {string} A string representing the project. + */ + matchProjectFromConnectionName(connectionName: string) { + return this.pathTemplates.connectionPathTemplate.match(connectionName) + .project; + } + + /** + * Parse the location from Connection resource. + * + * @param {string} connectionName + * A fully-qualified path representing Connection resource. + * @returns {string} A string representing the location. + */ + matchLocationFromConnectionName(connectionName: string) { + return this.pathTemplates.connectionPathTemplate.match(connectionName) + .location; + } + + /** + * Parse the connection from Connection resource. + * + * @param {string} connectionName + * A fully-qualified path representing Connection resource. + * @returns {string} A string representing the connection. + */ + matchConnectionFromConnectionName(connectionName: string) { + return this.pathTemplates.connectionPathTemplate.match(connectionName) + .connection; + } + + /** + * Return a fully-qualified connectionSchemaMetadata resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} connection + * @returns {string} Resource name string. + */ + connectionSchemaMetadataPath( + project: string, + location: string, + connection: string + ) { + return this.pathTemplates.connectionSchemaMetadataPathTemplate.render({ + project: project, + location: location, + connection: connection, + }); + } + + /** + * Parse the project from ConnectionSchemaMetadata resource. + * + * @param {string} connectionSchemaMetadataName + * A fully-qualified path representing ConnectionSchemaMetadata resource. + * @returns {string} A string representing the project. + */ + matchProjectFromConnectionSchemaMetadataName( + connectionSchemaMetadataName: string + ) { + return this.pathTemplates.connectionSchemaMetadataPathTemplate.match( + connectionSchemaMetadataName + ).project; + } + + /** + * Parse the location from ConnectionSchemaMetadata resource. + * + * @param {string} connectionSchemaMetadataName + * A fully-qualified path representing ConnectionSchemaMetadata resource. + * @returns {string} A string representing the location. + */ + matchLocationFromConnectionSchemaMetadataName( + connectionSchemaMetadataName: string + ) { + return this.pathTemplates.connectionSchemaMetadataPathTemplate.match( + connectionSchemaMetadataName + ).location; + } + + /** + * Parse the connection from ConnectionSchemaMetadata resource. + * + * @param {string} connectionSchemaMetadataName + * A fully-qualified path representing ConnectionSchemaMetadata resource. + * @returns {string} A string representing the connection. + */ + matchConnectionFromConnectionSchemaMetadataName( + connectionSchemaMetadataName: string + ) { + return this.pathTemplates.connectionSchemaMetadataPathTemplate.match( + connectionSchemaMetadataName + ).connection; + } + + /** + * Return a fully-qualified connector resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} provider + * @param {string} connector + * @returns {string} Resource name string. + */ + connectorPath( + project: string, + location: string, + provider: string, + connector: string + ) { + return this.pathTemplates.connectorPathTemplate.render({ + project: project, + location: location, + provider: provider, + connector: connector, + }); + } + + /** + * Parse the project from Connector resource. + * + * @param {string} connectorName + * A fully-qualified path representing Connector resource. + * @returns {string} A string representing the project. + */ + matchProjectFromConnectorName(connectorName: string) { + return this.pathTemplates.connectorPathTemplate.match(connectorName) + .project; + } + + /** + * Parse the location from Connector resource. + * + * @param {string} connectorName + * A fully-qualified path representing Connector resource. + * @returns {string} A string representing the location. + */ + matchLocationFromConnectorName(connectorName: string) { + return this.pathTemplates.connectorPathTemplate.match(connectorName) + .location; + } + + /** + * Parse the provider from Connector resource. + * + * @param {string} connectorName + * A fully-qualified path representing Connector resource. + * @returns {string} A string representing the provider. + */ + matchProviderFromConnectorName(connectorName: string) { + return this.pathTemplates.connectorPathTemplate.match(connectorName) + .provider; + } + + /** + * Parse the connector from Connector resource. + * + * @param {string} connectorName + * A fully-qualified path representing Connector resource. + * @returns {string} A string representing the connector. + */ + matchConnectorFromConnectorName(connectorName: string) { + return this.pathTemplates.connectorPathTemplate.match(connectorName) + .connector; + } + + /** + * Return a fully-qualified connectorVersion resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} provider + * @param {string} connector + * @param {string} version + * @returns {string} Resource name string. + */ + connectorVersionPath( + project: string, + location: string, + provider: string, + connector: string, + version: string + ) { + return this.pathTemplates.connectorVersionPathTemplate.render({ + project: project, + location: location, + provider: provider, + connector: connector, + version: version, + }); + } + + /** + * Parse the project from ConnectorVersion resource. + * + * @param {string} connectorVersionName + * A fully-qualified path representing ConnectorVersion resource. + * @returns {string} A string representing the project. + */ + matchProjectFromConnectorVersionName(connectorVersionName: string) { + return this.pathTemplates.connectorVersionPathTemplate.match( + connectorVersionName + ).project; + } + + /** + * Parse the location from ConnectorVersion resource. + * + * @param {string} connectorVersionName + * A fully-qualified path representing ConnectorVersion resource. + * @returns {string} A string representing the location. + */ + matchLocationFromConnectorVersionName(connectorVersionName: string) { + return this.pathTemplates.connectorVersionPathTemplate.match( + connectorVersionName + ).location; + } + + /** + * Parse the provider from ConnectorVersion resource. + * + * @param {string} connectorVersionName + * A fully-qualified path representing ConnectorVersion resource. + * @returns {string} A string representing the provider. + */ + matchProviderFromConnectorVersionName(connectorVersionName: string) { + return this.pathTemplates.connectorVersionPathTemplate.match( + connectorVersionName + ).provider; + } + + /** + * Parse the connector from ConnectorVersion resource. + * + * @param {string} connectorVersionName + * A fully-qualified path representing ConnectorVersion resource. + * @returns {string} A string representing the connector. + */ + matchConnectorFromConnectorVersionName(connectorVersionName: string) { + return this.pathTemplates.connectorVersionPathTemplate.match( + connectorVersionName + ).connector; + } + + /** + * Parse the version from ConnectorVersion resource. + * + * @param {string} connectorVersionName + * A fully-qualified path representing ConnectorVersion resource. + * @returns {string} A string representing the version. + */ + matchVersionFromConnectorVersionName(connectorVersionName: string) { + return this.pathTemplates.connectorVersionPathTemplate.match( + connectorVersionName + ).version; + } + + /** + * Return a fully-qualified provider resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} provider + * @returns {string} Resource name string. + */ + providerPath(project: string, location: string, provider: string) { + return this.pathTemplates.providerPathTemplate.render({ + project: project, + location: location, + provider: provider, + }); + } + + /** + * Parse the project from Provider resource. + * + * @param {string} providerName + * A fully-qualified path representing Provider resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProviderName(providerName: string) { + return this.pathTemplates.providerPathTemplate.match(providerName).project; + } + + /** + * Parse the location from Provider resource. + * + * @param {string} providerName + * A fully-qualified path representing Provider resource. + * @returns {string} A string representing the location. + */ + matchLocationFromProviderName(providerName: string) { + return this.pathTemplates.providerPathTemplate.match(providerName).location; + } + + /** + * Parse the provider from Provider resource. + * + * @param {string} providerName + * A fully-qualified path representing Provider resource. + * @returns {string} A string representing the provider. + */ + matchProviderFromProviderName(providerName: string) { + return this.pathTemplates.providerPathTemplate.match(providerName).provider; + } + + /** + * Return a fully-qualified runtimeConfig resource name string. + * + * @param {string} project + * @param {string} location + * @returns {string} Resource name string. + */ + runtimeConfigPath(project: string, location: string) { + return this.pathTemplates.runtimeConfigPathTemplate.render({ + project: project, + location: location, + }); + } + + /** + * Parse the project from RuntimeConfig resource. + * + * @param {string} runtimeConfigName + * A fully-qualified path representing RuntimeConfig resource. + * @returns {string} A string representing the project. + */ + matchProjectFromRuntimeConfigName(runtimeConfigName: string) { + return this.pathTemplates.runtimeConfigPathTemplate.match(runtimeConfigName) + .project; + } + + /** + * Parse the location from RuntimeConfig resource. + * + * @param {string} runtimeConfigName + * A fully-qualified path representing RuntimeConfig resource. + * @returns {string} A string representing the location. + */ + matchLocationFromRuntimeConfigName(runtimeConfigName: string) { + return this.pathTemplates.runtimeConfigPathTemplate.match(runtimeConfigName) + .location; + } + + /** + * Return a fully-qualified settings resource name string. + * + * @param {string} project + * @returns {string} Resource name string. + */ + settingsPath(project: string) { + return this.pathTemplates.settingsPathTemplate.render({ + project: project, + }); + } + + /** + * Parse the project from Settings resource. + * + * @param {string} settingsName + * A fully-qualified path representing Settings resource. + * @returns {string} A string representing the project. + */ + matchProjectFromSettingsName(settingsName: string) { + return this.pathTemplates.settingsPathTemplate.match(settingsName).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.connectorsStub && !this._terminated) { + return this.connectorsStub.then(stub => { + this._terminated = true; + stub.close(); + this.iamClient.close(); + this.locationsClient.close(); + this.operationsClient.close(); + }); + } + return Promise.resolve(); + } +} diff --git a/packages/google-cloud-connectors/src/v1/connectors_client_config.json b/packages/google-cloud-connectors/src/v1/connectors_client_config.json new file mode 100644 index 00000000000..5ad6188283a --- /dev/null +++ b/packages/google-cloud-connectors/src/v1/connectors_client_config.json @@ -0,0 +1,121 @@ +{ + "interfaces": { + "google.cloud.connectors.v1.Connectors": { + "retry_codes": { + "non_idempotent": [], + "idempotent": [ + "DEADLINE_EXCEEDED", + "UNAVAILABLE" + ], + "unavailable": [ + "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 + }, + "ce5b960a6ed052e690863808e4f0deff3dc7d49f": { + "initial_retry_delay_millis": 1000, + "retry_delay_multiplier": 1.3, + "max_retry_delay_millis": 10000, + "initial_rpc_timeout_millis": 60000, + "rpc_timeout_multiplier": 1, + "max_rpc_timeout_millis": 60000, + "total_timeout_millis": 600000 + } + }, + "methods": { + "ListConnections": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "ce5b960a6ed052e690863808e4f0deff3dc7d49f" + }, + "GetConnection": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "ce5b960a6ed052e690863808e4f0deff3dc7d49f" + }, + "CreateConnection": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "UpdateConnection": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "DeleteConnection": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "ListProviders": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "ce5b960a6ed052e690863808e4f0deff3dc7d49f" + }, + "GetProvider": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "ce5b960a6ed052e690863808e4f0deff3dc7d49f" + }, + "ListConnectors": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "ce5b960a6ed052e690863808e4f0deff3dc7d49f" + }, + "GetConnector": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "ce5b960a6ed052e690863808e4f0deff3dc7d49f" + }, + "ListConnectorVersions": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "ce5b960a6ed052e690863808e4f0deff3dc7d49f" + }, + "GetConnectorVersion": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "ce5b960a6ed052e690863808e4f0deff3dc7d49f" + }, + "GetConnectionSchemaMetadata": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "ce5b960a6ed052e690863808e4f0deff3dc7d49f" + }, + "RefreshConnectionSchemaMetadata": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "ListRuntimeEntitySchemas": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "ce5b960a6ed052e690863808e4f0deff3dc7d49f" + }, + "ListRuntimeActionSchemas": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "ce5b960a6ed052e690863808e4f0deff3dc7d49f" + }, + "GetRuntimeConfig": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "ce5b960a6ed052e690863808e4f0deff3dc7d49f" + }, + "GetGlobalSettings": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + } + } + } + } +} diff --git a/packages/google-cloud-connectors/src/v1/connectors_proto_list.json b/packages/google-cloud-connectors/src/v1/connectors_proto_list.json new file mode 100644 index 00000000000..446890c3971 --- /dev/null +++ b/packages/google-cloud-connectors/src/v1/connectors_proto_list.json @@ -0,0 +1,13 @@ +[ + "../../protos/google/cloud/connectors/v1/authconfig.proto", + "../../protos/google/cloud/connectors/v1/common.proto", + "../../protos/google/cloud/connectors/v1/connection.proto", + "../../protos/google/cloud/connectors/v1/connector.proto", + "../../protos/google/cloud/connectors/v1/connector_version.proto", + "../../protos/google/cloud/connectors/v1/connectors_service.proto", + "../../protos/google/cloud/connectors/v1/destination_config.proto", + "../../protos/google/cloud/connectors/v1/provider.proto", + "../../protos/google/cloud/connectors/v1/runtime.proto", + "../../protos/google/cloud/connectors/v1/settings.proto", + "../../protos/google/cloud/connectors/v1/ssl_config.proto" +] diff --git a/packages/google-cloud-connectors/src/v1/gapic_metadata.json b/packages/google-cloud-connectors/src/v1/gapic_metadata.json new file mode 100644 index 00000000000..6a631566481 --- /dev/null +++ b/packages/google-cloud-connectors/src/v1/gapic_metadata.json @@ -0,0 +1,217 @@ +{ + "schema": "1.0", + "comment": "This file maps proto services/RPCs to the corresponding library clients/methods", + "language": "typescript", + "protoPackage": "google.cloud.connectors.v1", + "libraryPackage": "@google-cloud/connectors", + "services": { + "Connectors": { + "clients": { + "grpc": { + "libraryClient": "ConnectorsClient", + "rpcs": { + "GetConnection": { + "methods": [ + "getConnection" + ] + }, + "GetProvider": { + "methods": [ + "getProvider" + ] + }, + "GetConnector": { + "methods": [ + "getConnector" + ] + }, + "GetConnectorVersion": { + "methods": [ + "getConnectorVersion" + ] + }, + "GetConnectionSchemaMetadata": { + "methods": [ + "getConnectionSchemaMetadata" + ] + }, + "GetRuntimeConfig": { + "methods": [ + "getRuntimeConfig" + ] + }, + "GetGlobalSettings": { + "methods": [ + "getGlobalSettings" + ] + }, + "CreateConnection": { + "methods": [ + "createConnection" + ] + }, + "UpdateConnection": { + "methods": [ + "updateConnection" + ] + }, + "DeleteConnection": { + "methods": [ + "deleteConnection" + ] + }, + "RefreshConnectionSchemaMetadata": { + "methods": [ + "refreshConnectionSchemaMetadata" + ] + }, + "ListConnections": { + "methods": [ + "listConnections", + "listConnectionsStream", + "listConnectionsAsync" + ] + }, + "ListProviders": { + "methods": [ + "listProviders", + "listProvidersStream", + "listProvidersAsync" + ] + }, + "ListConnectors": { + "methods": [ + "listConnectors", + "listConnectorsStream", + "listConnectorsAsync" + ] + }, + "ListConnectorVersions": { + "methods": [ + "listConnectorVersions", + "listConnectorVersionsStream", + "listConnectorVersionsAsync" + ] + }, + "ListRuntimeEntitySchemas": { + "methods": [ + "listRuntimeEntitySchemas", + "listRuntimeEntitySchemasStream", + "listRuntimeEntitySchemasAsync" + ] + }, + "ListRuntimeActionSchemas": { + "methods": [ + "listRuntimeActionSchemas", + "listRuntimeActionSchemasStream", + "listRuntimeActionSchemasAsync" + ] + } + } + }, + "grpc-fallback": { + "libraryClient": "ConnectorsClient", + "rpcs": { + "GetConnection": { + "methods": [ + "getConnection" + ] + }, + "GetProvider": { + "methods": [ + "getProvider" + ] + }, + "GetConnector": { + "methods": [ + "getConnector" + ] + }, + "GetConnectorVersion": { + "methods": [ + "getConnectorVersion" + ] + }, + "GetConnectionSchemaMetadata": { + "methods": [ + "getConnectionSchemaMetadata" + ] + }, + "GetRuntimeConfig": { + "methods": [ + "getRuntimeConfig" + ] + }, + "GetGlobalSettings": { + "methods": [ + "getGlobalSettings" + ] + }, + "CreateConnection": { + "methods": [ + "createConnection" + ] + }, + "UpdateConnection": { + "methods": [ + "updateConnection" + ] + }, + "DeleteConnection": { + "methods": [ + "deleteConnection" + ] + }, + "RefreshConnectionSchemaMetadata": { + "methods": [ + "refreshConnectionSchemaMetadata" + ] + }, + "ListConnections": { + "methods": [ + "listConnections", + "listConnectionsStream", + "listConnectionsAsync" + ] + }, + "ListProviders": { + "methods": [ + "listProviders", + "listProvidersStream", + "listProvidersAsync" + ] + }, + "ListConnectors": { + "methods": [ + "listConnectors", + "listConnectorsStream", + "listConnectorsAsync" + ] + }, + "ListConnectorVersions": { + "methods": [ + "listConnectorVersions", + "listConnectorVersionsStream", + "listConnectorVersionsAsync" + ] + }, + "ListRuntimeEntitySchemas": { + "methods": [ + "listRuntimeEntitySchemas", + "listRuntimeEntitySchemasStream", + "listRuntimeEntitySchemasAsync" + ] + }, + "ListRuntimeActionSchemas": { + "methods": [ + "listRuntimeActionSchemas", + "listRuntimeActionSchemasStream", + "listRuntimeActionSchemasAsync" + ] + } + } + } + } + } + } +} diff --git a/packages/google-cloud-connectors/src/v1/index.ts b/packages/google-cloud-connectors/src/v1/index.ts new file mode 100644 index 00000000000..eac9244d2ce --- /dev/null +++ b/packages/google-cloud-connectors/src/v1/index.ts @@ -0,0 +1,19 @@ +// Copyright 2023 Google LLC +// +// Licensed under the Apache License, Version 2.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 {ConnectorsClient} from './connectors_client'; diff --git a/packages/google-cloud-connectors/system-test/fixtures/sample/src/index.js b/packages/google-cloud-connectors/system-test/fixtures/sample/src/index.js new file mode 100644 index 00000000000..62ab7f01e19 --- /dev/null +++ b/packages/google-cloud-connectors/system-test/fixtures/sample/src/index.js @@ -0,0 +1,26 @@ +// Copyright 2023 Google LLC +// +// Licensed under the Apache License, Version 2.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 connectors = require('@google-cloud/connectors'); + +function main() { + const connectorsClient = new connectors.ConnectorsClient(); +} + +main(); diff --git a/packages/google-cloud-connectors/system-test/fixtures/sample/src/index.ts b/packages/google-cloud-connectors/system-test/fixtures/sample/src/index.ts new file mode 100644 index 00000000000..02748d561c2 --- /dev/null +++ b/packages/google-cloud-connectors/system-test/fixtures/sample/src/index.ts @@ -0,0 +1,32 @@ +// Copyright 2023 Google LLC +// +// Licensed under the Apache License, Version 2.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 {ConnectorsClient} from '@google-cloud/connectors'; + +// check that the client class type name can be used +function doStuffWithConnectorsClient(client: ConnectorsClient) { + client.close(); +} + +function main() { + // check that the client instance can be created + const connectorsClient = new ConnectorsClient(); + doStuffWithConnectorsClient(connectorsClient); +} + +main(); diff --git a/packages/google-cloud-connectors/system-test/install.ts b/packages/google-cloud-connectors/system-test/install.ts new file mode 100644 index 00000000000..f61fe236476 --- /dev/null +++ b/packages/google-cloud-connectors/system-test/install.ts @@ -0,0 +1,51 @@ +// Copyright 2023 Google LLC +// +// Licensed under the Apache License, Version 2.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/google-cloud-connectors/test/gapic_connectors_v1.ts b/packages/google-cloud-connectors/test/gapic_connectors_v1.ts new file mode 100644 index 00000000000..d97ad9a0440 --- /dev/null +++ b/packages/google-cloud-connectors/test/gapic_connectors_v1.ts @@ -0,0 +1,5271 @@ +// Copyright 2023 Google LLC +// +// Licensed under the Apache License, Version 2.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 connectorsModule from '../src'; + +import {PassThrough} from 'stream'; + +import { + protobuf, + LROperation, + operationsProtos, + IamProtos, + 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 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('v1.ConnectorsClient', () => { + describe('Common methods', () => { + it('has servicePath', () => { + const servicePath = connectorsModule.v1.ConnectorsClient.servicePath; + assert(servicePath); + }); + + it('has apiEndpoint', () => { + const apiEndpoint = connectorsModule.v1.ConnectorsClient.apiEndpoint; + assert(apiEndpoint); + }); + + it('has port', () => { + const port = connectorsModule.v1.ConnectorsClient.port; + assert(port); + assert(typeof port === 'number'); + }); + + it('should create a client with no option', () => { + const client = new connectorsModule.v1.ConnectorsClient(); + assert(client); + }); + + it('should create a client with gRPC fallback', () => { + const client = new connectorsModule.v1.ConnectorsClient({ + fallback: true, + }); + assert(client); + }); + + it('has initialize method and supports deferred initialization', async () => { + const client = new connectorsModule.v1.ConnectorsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + assert.strictEqual(client.connectorsStub, undefined); + await client.initialize(); + assert(client.connectorsStub); + }); + + it('has close method for the initialized client', done => { + const client = new connectorsModule.v1.ConnectorsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + assert(client.connectorsStub); + client.close().then(() => { + done(); + }); + }); + + it('has close method for the non-initialized client', done => { + const client = new connectorsModule.v1.ConnectorsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + assert.strictEqual(client.connectorsStub, undefined); + client.close().then(() => { + done(); + }); + }); + + it('has getProjectId method', async () => { + const fakeProjectId = 'fake-project-id'; + const client = new connectorsModule.v1.ConnectorsClient({ + 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 connectorsModule.v1.ConnectorsClient({ + 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('getConnection', () => { + it('invokes getConnection without error', async () => { + const client = new connectorsModule.v1.ConnectorsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.connectors.v1.GetConnectionRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.connectors.v1.GetConnectionRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.connectors.v1.Connection() + ); + client.innerApiCalls.getConnection = stubSimpleCall(expectedResponse); + const [response] = await client.getConnection(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.getConnection as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getConnection as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getConnection without error using callback', async () => { + const client = new connectorsModule.v1.ConnectorsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.connectors.v1.GetConnectionRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.connectors.v1.GetConnectionRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.connectors.v1.Connection() + ); + client.innerApiCalls.getConnection = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getConnection( + request, + ( + err?: Error | null, + result?: protos.google.cloud.connectors.v1.IConnection | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.getConnection as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getConnection as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getConnection with error', async () => { + const client = new connectorsModule.v1.ConnectorsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.connectors.v1.GetConnectionRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.connectors.v1.GetConnectionRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.getConnection = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.getConnection(request), expectedError); + const actualRequest = ( + client.innerApiCalls.getConnection as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getConnection as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getConnection with closed client', async () => { + const client = new connectorsModule.v1.ConnectorsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.connectors.v1.GetConnectionRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.connectors.v1.GetConnectionRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.getConnection(request), expectedError); + }); + }); + + describe('getProvider', () => { + it('invokes getProvider without error', async () => { + const client = new connectorsModule.v1.ConnectorsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.connectors.v1.GetProviderRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.connectors.v1.GetProviderRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.connectors.v1.Provider() + ); + client.innerApiCalls.getProvider = stubSimpleCall(expectedResponse); + const [response] = await client.getProvider(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.getProvider as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getProvider as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getProvider without error using callback', async () => { + const client = new connectorsModule.v1.ConnectorsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.connectors.v1.GetProviderRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.connectors.v1.GetProviderRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.connectors.v1.Provider() + ); + client.innerApiCalls.getProvider = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getProvider( + request, + ( + err?: Error | null, + result?: protos.google.cloud.connectors.v1.IProvider | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.getProvider as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getProvider as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getProvider with error', async () => { + const client = new connectorsModule.v1.ConnectorsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.connectors.v1.GetProviderRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.connectors.v1.GetProviderRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.getProvider = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.getProvider(request), expectedError); + const actualRequest = ( + client.innerApiCalls.getProvider as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getProvider as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getProvider with closed client', async () => { + const client = new connectorsModule.v1.ConnectorsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.connectors.v1.GetProviderRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.connectors.v1.GetProviderRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.getProvider(request), expectedError); + }); + }); + + describe('getConnector', () => { + it('invokes getConnector without error', async () => { + const client = new connectorsModule.v1.ConnectorsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.connectors.v1.GetConnectorRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.connectors.v1.GetConnectorRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.connectors.v1.Connector() + ); + client.innerApiCalls.getConnector = stubSimpleCall(expectedResponse); + const [response] = await client.getConnector(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.getConnector as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getConnector as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getConnector without error using callback', async () => { + const client = new connectorsModule.v1.ConnectorsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.connectors.v1.GetConnectorRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.connectors.v1.GetConnectorRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.connectors.v1.Connector() + ); + client.innerApiCalls.getConnector = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getConnector( + request, + ( + err?: Error | null, + result?: protos.google.cloud.connectors.v1.IConnector | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.getConnector as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getConnector as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getConnector with error', async () => { + const client = new connectorsModule.v1.ConnectorsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.connectors.v1.GetConnectorRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.connectors.v1.GetConnectorRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.getConnector = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.getConnector(request), expectedError); + const actualRequest = ( + client.innerApiCalls.getConnector as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getConnector as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getConnector with closed client', async () => { + const client = new connectorsModule.v1.ConnectorsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.connectors.v1.GetConnectorRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.connectors.v1.GetConnectorRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.getConnector(request), expectedError); + }); + }); + + describe('getConnectorVersion', () => { + it('invokes getConnectorVersion without error', async () => { + const client = new connectorsModule.v1.ConnectorsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.connectors.v1.GetConnectorVersionRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.connectors.v1.GetConnectorVersionRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.connectors.v1.ConnectorVersion() + ); + client.innerApiCalls.getConnectorVersion = + stubSimpleCall(expectedResponse); + const [response] = await client.getConnectorVersion(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.getConnectorVersion as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getConnectorVersion as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getConnectorVersion without error using callback', async () => { + const client = new connectorsModule.v1.ConnectorsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.connectors.v1.GetConnectorVersionRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.connectors.v1.GetConnectorVersionRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.connectors.v1.ConnectorVersion() + ); + client.innerApiCalls.getConnectorVersion = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getConnectorVersion( + request, + ( + err?: Error | null, + result?: protos.google.cloud.connectors.v1.IConnectorVersion | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.getConnectorVersion as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getConnectorVersion as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getConnectorVersion with error', async () => { + const client = new connectorsModule.v1.ConnectorsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.connectors.v1.GetConnectorVersionRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.connectors.v1.GetConnectorVersionRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.getConnectorVersion = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.getConnectorVersion(request), expectedError); + const actualRequest = ( + client.innerApiCalls.getConnectorVersion as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getConnectorVersion as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getConnectorVersion with closed client', async () => { + const client = new connectorsModule.v1.ConnectorsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.connectors.v1.GetConnectorVersionRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.connectors.v1.GetConnectorVersionRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.getConnectorVersion(request), expectedError); + }); + }); + + describe('getConnectionSchemaMetadata', () => { + it('invokes getConnectionSchemaMetadata without error', async () => { + const client = new connectorsModule.v1.ConnectorsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.connectors.v1.GetConnectionSchemaMetadataRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.connectors.v1.GetConnectionSchemaMetadataRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.connectors.v1.ConnectionSchemaMetadata() + ); + client.innerApiCalls.getConnectionSchemaMetadata = + stubSimpleCall(expectedResponse); + const [response] = await client.getConnectionSchemaMetadata(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.getConnectionSchemaMetadata as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getConnectionSchemaMetadata as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getConnectionSchemaMetadata without error using callback', async () => { + const client = new connectorsModule.v1.ConnectorsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.connectors.v1.GetConnectionSchemaMetadataRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.connectors.v1.GetConnectionSchemaMetadataRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.connectors.v1.ConnectionSchemaMetadata() + ); + client.innerApiCalls.getConnectionSchemaMetadata = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getConnectionSchemaMetadata( + request, + ( + err?: Error | null, + result?: protos.google.cloud.connectors.v1.IConnectionSchemaMetadata | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.getConnectionSchemaMetadata as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getConnectionSchemaMetadata as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getConnectionSchemaMetadata with error', async () => { + const client = new connectorsModule.v1.ConnectorsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.connectors.v1.GetConnectionSchemaMetadataRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.connectors.v1.GetConnectionSchemaMetadataRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.getConnectionSchemaMetadata = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects( + client.getConnectionSchemaMetadata(request), + expectedError + ); + const actualRequest = ( + client.innerApiCalls.getConnectionSchemaMetadata as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getConnectionSchemaMetadata as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getConnectionSchemaMetadata with closed client', async () => { + const client = new connectorsModule.v1.ConnectorsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.connectors.v1.GetConnectionSchemaMetadataRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.connectors.v1.GetConnectionSchemaMetadataRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects( + client.getConnectionSchemaMetadata(request), + expectedError + ); + }); + }); + + describe('getRuntimeConfig', () => { + it('invokes getRuntimeConfig without error', async () => { + const client = new connectorsModule.v1.ConnectorsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.connectors.v1.GetRuntimeConfigRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.connectors.v1.GetRuntimeConfigRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.connectors.v1.RuntimeConfig() + ); + client.innerApiCalls.getRuntimeConfig = stubSimpleCall(expectedResponse); + const [response] = await client.getRuntimeConfig(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.getRuntimeConfig as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getRuntimeConfig as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getRuntimeConfig without error using callback', async () => { + const client = new connectorsModule.v1.ConnectorsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.connectors.v1.GetRuntimeConfigRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.connectors.v1.GetRuntimeConfigRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.connectors.v1.RuntimeConfig() + ); + client.innerApiCalls.getRuntimeConfig = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getRuntimeConfig( + request, + ( + err?: Error | null, + result?: protos.google.cloud.connectors.v1.IRuntimeConfig | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.getRuntimeConfig as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getRuntimeConfig as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getRuntimeConfig with error', async () => { + const client = new connectorsModule.v1.ConnectorsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.connectors.v1.GetRuntimeConfigRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.connectors.v1.GetRuntimeConfigRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.getRuntimeConfig = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.getRuntimeConfig(request), expectedError); + const actualRequest = ( + client.innerApiCalls.getRuntimeConfig as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getRuntimeConfig as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getRuntimeConfig with closed client', async () => { + const client = new connectorsModule.v1.ConnectorsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.connectors.v1.GetRuntimeConfigRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.connectors.v1.GetRuntimeConfigRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.getRuntimeConfig(request), expectedError); + }); + }); + + describe('getGlobalSettings', () => { + it('invokes getGlobalSettings without error', async () => { + const client = new connectorsModule.v1.ConnectorsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.connectors.v1.GetGlobalSettingsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.connectors.v1.GetGlobalSettingsRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.connectors.v1.Settings() + ); + client.innerApiCalls.getGlobalSettings = stubSimpleCall(expectedResponse); + const [response] = await client.getGlobalSettings(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.getGlobalSettings as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getGlobalSettings as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getGlobalSettings without error using callback', async () => { + const client = new connectorsModule.v1.ConnectorsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.connectors.v1.GetGlobalSettingsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.connectors.v1.GetGlobalSettingsRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.connectors.v1.Settings() + ); + client.innerApiCalls.getGlobalSettings = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getGlobalSettings( + request, + ( + err?: Error | null, + result?: protos.google.cloud.connectors.v1.ISettings | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.getGlobalSettings as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getGlobalSettings as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getGlobalSettings with error', async () => { + const client = new connectorsModule.v1.ConnectorsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.connectors.v1.GetGlobalSettingsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.connectors.v1.GetGlobalSettingsRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.getGlobalSettings = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.getGlobalSettings(request), expectedError); + const actualRequest = ( + client.innerApiCalls.getGlobalSettings as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getGlobalSettings as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getGlobalSettings with closed client', async () => { + const client = new connectorsModule.v1.ConnectorsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.connectors.v1.GetGlobalSettingsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.connectors.v1.GetGlobalSettingsRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.getGlobalSettings(request), expectedError); + }); + }); + + describe('createConnection', () => { + it('invokes createConnection without error', async () => { + const client = new connectorsModule.v1.ConnectorsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.connectors.v1.CreateConnectionRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.connectors.v1.CreateConnectionRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.createConnection = + stubLongRunningCall(expectedResponse); + const [operation] = await client.createConnection(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.createConnection as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createConnection as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createConnection without error using callback', async () => { + const client = new connectorsModule.v1.ConnectorsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.connectors.v1.CreateConnectionRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.connectors.v1.CreateConnectionRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.createConnection = + stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.createConnection( + request, + ( + err?: Error | null, + result?: LROperation< + protos.google.cloud.connectors.v1.IConnection, + protos.google.cloud.connectors.v1.IOperationMetadata + > | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const operation = (await promise) as LROperation< + protos.google.cloud.connectors.v1.IConnection, + protos.google.cloud.connectors.v1.IOperationMetadata + >; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.createConnection as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createConnection as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createConnection with call error', async () => { + const client = new connectorsModule.v1.ConnectorsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.connectors.v1.CreateConnectionRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.connectors.v1.CreateConnectionRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.createConnection = stubLongRunningCall( + undefined, + expectedError + ); + await assert.rejects(client.createConnection(request), expectedError); + const actualRequest = ( + client.innerApiCalls.createConnection as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createConnection as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createConnection with LRO error', async () => { + const client = new connectorsModule.v1.ConnectorsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.connectors.v1.CreateConnectionRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.connectors.v1.CreateConnectionRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.createConnection = stubLongRunningCall( + undefined, + undefined, + expectedError + ); + const [operation] = await client.createConnection(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = ( + client.innerApiCalls.createConnection as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createConnection as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkCreateConnectionProgress without error', async () => { + const client = new connectorsModule.v1.ConnectorsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + 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.checkCreateConnectionProgress( + expectedResponse.name + ); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkCreateConnectionProgress with error', async () => { + const client = new connectorsModule.v1.ConnectorsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const expectedError = new Error('expected'); + + client.operationsClient.getOperation = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects( + client.checkCreateConnectionProgress(''), + expectedError + ); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + }); + + describe('updateConnection', () => { + it('invokes updateConnection without error', async () => { + const client = new connectorsModule.v1.ConnectorsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.connectors.v1.UpdateConnectionRequest() + ); + request.connection ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.connectors.v1.UpdateConnectionRequest', + ['connection', 'name'] + ); + request.connection.name = defaultValue1; + const expectedHeaderRequestParams = `connection.name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.updateConnection = + stubLongRunningCall(expectedResponse); + const [operation] = await client.updateConnection(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.updateConnection as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateConnection as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateConnection without error using callback', async () => { + const client = new connectorsModule.v1.ConnectorsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.connectors.v1.UpdateConnectionRequest() + ); + request.connection ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.connectors.v1.UpdateConnectionRequest', + ['connection', 'name'] + ); + request.connection.name = defaultValue1; + const expectedHeaderRequestParams = `connection.name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.updateConnection = + stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.updateConnection( + request, + ( + err?: Error | null, + result?: LROperation< + protos.google.cloud.connectors.v1.IConnection, + protos.google.cloud.connectors.v1.IOperationMetadata + > | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const operation = (await promise) as LROperation< + protos.google.cloud.connectors.v1.IConnection, + protos.google.cloud.connectors.v1.IOperationMetadata + >; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.updateConnection as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateConnection as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateConnection with call error', async () => { + const client = new connectorsModule.v1.ConnectorsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.connectors.v1.UpdateConnectionRequest() + ); + request.connection ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.connectors.v1.UpdateConnectionRequest', + ['connection', 'name'] + ); + request.connection.name = defaultValue1; + const expectedHeaderRequestParams = `connection.name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.updateConnection = stubLongRunningCall( + undefined, + expectedError + ); + await assert.rejects(client.updateConnection(request), expectedError); + const actualRequest = ( + client.innerApiCalls.updateConnection as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateConnection as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateConnection with LRO error', async () => { + const client = new connectorsModule.v1.ConnectorsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.connectors.v1.UpdateConnectionRequest() + ); + request.connection ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.connectors.v1.UpdateConnectionRequest', + ['connection', 'name'] + ); + request.connection.name = defaultValue1; + const expectedHeaderRequestParams = `connection.name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.updateConnection = stubLongRunningCall( + undefined, + undefined, + expectedError + ); + const [operation] = await client.updateConnection(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = ( + client.innerApiCalls.updateConnection as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateConnection as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkUpdateConnectionProgress without error', async () => { + const client = new connectorsModule.v1.ConnectorsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + 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.checkUpdateConnectionProgress( + expectedResponse.name + ); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkUpdateConnectionProgress with error', async () => { + const client = new connectorsModule.v1.ConnectorsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const expectedError = new Error('expected'); + + client.operationsClient.getOperation = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects( + client.checkUpdateConnectionProgress(''), + expectedError + ); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + }); + + describe('deleteConnection', () => { + it('invokes deleteConnection without error', async () => { + const client = new connectorsModule.v1.ConnectorsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.connectors.v1.DeleteConnectionRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.connectors.v1.DeleteConnectionRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.deleteConnection = + stubLongRunningCall(expectedResponse); + const [operation] = await client.deleteConnection(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.deleteConnection as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteConnection as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteConnection without error using callback', async () => { + const client = new connectorsModule.v1.ConnectorsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.connectors.v1.DeleteConnectionRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.connectors.v1.DeleteConnectionRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.deleteConnection = + stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.deleteConnection( + request, + ( + err?: Error | null, + result?: LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.connectors.v1.IOperationMetadata + > | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const operation = (await promise) as LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.connectors.v1.IOperationMetadata + >; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.deleteConnection as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteConnection as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteConnection with call error', async () => { + const client = new connectorsModule.v1.ConnectorsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.connectors.v1.DeleteConnectionRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.connectors.v1.DeleteConnectionRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteConnection = stubLongRunningCall( + undefined, + expectedError + ); + await assert.rejects(client.deleteConnection(request), expectedError); + const actualRequest = ( + client.innerApiCalls.deleteConnection as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteConnection as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteConnection with LRO error', async () => { + const client = new connectorsModule.v1.ConnectorsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.connectors.v1.DeleteConnectionRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.connectors.v1.DeleteConnectionRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteConnection = stubLongRunningCall( + undefined, + undefined, + expectedError + ); + const [operation] = await client.deleteConnection(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = ( + client.innerApiCalls.deleteConnection as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteConnection as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkDeleteConnectionProgress without error', async () => { + const client = new connectorsModule.v1.ConnectorsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + 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.checkDeleteConnectionProgress( + expectedResponse.name + ); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkDeleteConnectionProgress with error', async () => { + const client = new connectorsModule.v1.ConnectorsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const expectedError = new Error('expected'); + + client.operationsClient.getOperation = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects( + client.checkDeleteConnectionProgress(''), + expectedError + ); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + }); + + describe('refreshConnectionSchemaMetadata', () => { + it('invokes refreshConnectionSchemaMetadata without error', async () => { + const client = new connectorsModule.v1.ConnectorsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.connectors.v1.RefreshConnectionSchemaMetadataRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.connectors.v1.RefreshConnectionSchemaMetadataRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.refreshConnectionSchemaMetadata = + stubLongRunningCall(expectedResponse); + const [operation] = await client.refreshConnectionSchemaMetadata(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.refreshConnectionSchemaMetadata as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.refreshConnectionSchemaMetadata as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes refreshConnectionSchemaMetadata without error using callback', async () => { + const client = new connectorsModule.v1.ConnectorsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.connectors.v1.RefreshConnectionSchemaMetadataRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.connectors.v1.RefreshConnectionSchemaMetadataRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.refreshConnectionSchemaMetadata = + stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.refreshConnectionSchemaMetadata( + request, + ( + err?: Error | null, + result?: LROperation< + protos.google.cloud.connectors.v1.IConnectionSchemaMetadata, + protos.google.cloud.connectors.v1.IOperationMetadata + > | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const operation = (await promise) as LROperation< + protos.google.cloud.connectors.v1.IConnectionSchemaMetadata, + protos.google.cloud.connectors.v1.IOperationMetadata + >; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.refreshConnectionSchemaMetadata as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.refreshConnectionSchemaMetadata as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes refreshConnectionSchemaMetadata with call error', async () => { + const client = new connectorsModule.v1.ConnectorsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.connectors.v1.RefreshConnectionSchemaMetadataRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.connectors.v1.RefreshConnectionSchemaMetadataRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.refreshConnectionSchemaMetadata = + stubLongRunningCall(undefined, expectedError); + await assert.rejects( + client.refreshConnectionSchemaMetadata(request), + expectedError + ); + const actualRequest = ( + client.innerApiCalls.refreshConnectionSchemaMetadata as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.refreshConnectionSchemaMetadata as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes refreshConnectionSchemaMetadata with LRO error', async () => { + const client = new connectorsModule.v1.ConnectorsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.connectors.v1.RefreshConnectionSchemaMetadataRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.connectors.v1.RefreshConnectionSchemaMetadataRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.refreshConnectionSchemaMetadata = + stubLongRunningCall(undefined, undefined, expectedError); + const [operation] = await client.refreshConnectionSchemaMetadata(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = ( + client.innerApiCalls.refreshConnectionSchemaMetadata as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.refreshConnectionSchemaMetadata as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkRefreshConnectionSchemaMetadataProgress without error', async () => { + const client = new connectorsModule.v1.ConnectorsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + 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.checkRefreshConnectionSchemaMetadataProgress( + expectedResponse.name + ); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkRefreshConnectionSchemaMetadataProgress with error', async () => { + const client = new connectorsModule.v1.ConnectorsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const expectedError = new Error('expected'); + + client.operationsClient.getOperation = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects( + client.checkRefreshConnectionSchemaMetadataProgress(''), + expectedError + ); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + }); + + describe('listConnections', () => { + it('invokes listConnections without error', async () => { + const client = new connectorsModule.v1.ConnectorsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.connectors.v1.ListConnectionsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.connectors.v1.ListConnectionsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.connectors.v1.Connection() + ), + generateSampleMessage( + new protos.google.cloud.connectors.v1.Connection() + ), + generateSampleMessage( + new protos.google.cloud.connectors.v1.Connection() + ), + ]; + client.innerApiCalls.listConnections = stubSimpleCall(expectedResponse); + const [response] = await client.listConnections(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.listConnections as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listConnections as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listConnections without error using callback', async () => { + const client = new connectorsModule.v1.ConnectorsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.connectors.v1.ListConnectionsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.connectors.v1.ListConnectionsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.connectors.v1.Connection() + ), + generateSampleMessage( + new protos.google.cloud.connectors.v1.Connection() + ), + generateSampleMessage( + new protos.google.cloud.connectors.v1.Connection() + ), + ]; + client.innerApiCalls.listConnections = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.listConnections( + request, + ( + err?: Error | null, + result?: protos.google.cloud.connectors.v1.IConnection[] | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.listConnections as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listConnections as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listConnections with error', async () => { + const client = new connectorsModule.v1.ConnectorsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.connectors.v1.ListConnectionsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.connectors.v1.ListConnectionsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.listConnections = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.listConnections(request), expectedError); + const actualRequest = ( + client.innerApiCalls.listConnections as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listConnections as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listConnectionsStream without error', async () => { + const client = new connectorsModule.v1.ConnectorsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.connectors.v1.ListConnectionsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.connectors.v1.ListConnectionsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.connectors.v1.Connection() + ), + generateSampleMessage( + new protos.google.cloud.connectors.v1.Connection() + ), + generateSampleMessage( + new protos.google.cloud.connectors.v1.Connection() + ), + ]; + client.descriptors.page.listConnections.createStream = + stubPageStreamingCall(expectedResponse); + const stream = client.listConnectionsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.connectors.v1.Connection[] = []; + stream.on( + 'data', + (response: protos.google.cloud.connectors.v1.Connection) => { + 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.listConnections.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.listConnections, request) + ); + assert( + (client.descriptors.page.listConnections.createStream as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('invokes listConnectionsStream with error', async () => { + const client = new connectorsModule.v1.ConnectorsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.connectors.v1.ListConnectionsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.connectors.v1.ListConnectionsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.descriptors.page.listConnections.createStream = + stubPageStreamingCall(undefined, expectedError); + const stream = client.listConnectionsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.connectors.v1.Connection[] = []; + stream.on( + 'data', + (response: protos.google.cloud.connectors.v1.Connection) => { + responses.push(response); + } + ); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert( + (client.descriptors.page.listConnections.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.listConnections, request) + ); + assert( + (client.descriptors.page.listConnections.createStream as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listConnections without error', async () => { + const client = new connectorsModule.v1.ConnectorsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.connectors.v1.ListConnectionsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.connectors.v1.ListConnectionsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.connectors.v1.Connection() + ), + generateSampleMessage( + new protos.google.cloud.connectors.v1.Connection() + ), + generateSampleMessage( + new protos.google.cloud.connectors.v1.Connection() + ), + ]; + client.descriptors.page.listConnections.asyncIterate = + stubAsyncIterationCall(expectedResponse); + const responses: protos.google.cloud.connectors.v1.IConnection[] = []; + const iterable = client.listConnectionsAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + ( + client.descriptors.page.listConnections.asyncIterate as SinonStub + ).getCall(0).args[1], + request + ); + assert( + (client.descriptors.page.listConnections.asyncIterate as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listConnections with error', async () => { + const client = new connectorsModule.v1.ConnectorsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.connectors.v1.ListConnectionsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.connectors.v1.ListConnectionsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.descriptors.page.listConnections.asyncIterate = + stubAsyncIterationCall(undefined, expectedError); + const iterable = client.listConnectionsAsync(request); + await assert.rejects(async () => { + const responses: protos.google.cloud.connectors.v1.IConnection[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + ( + client.descriptors.page.listConnections.asyncIterate as SinonStub + ).getCall(0).args[1], + request + ); + assert( + (client.descriptors.page.listConnections.asyncIterate as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + }); + + describe('listProviders', () => { + it('invokes listProviders without error', async () => { + const client = new connectorsModule.v1.ConnectorsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.connectors.v1.ListProvidersRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.connectors.v1.ListProvidersRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.connectors.v1.Provider()), + generateSampleMessage(new protos.google.cloud.connectors.v1.Provider()), + generateSampleMessage(new protos.google.cloud.connectors.v1.Provider()), + ]; + client.innerApiCalls.listProviders = stubSimpleCall(expectedResponse); + const [response] = await client.listProviders(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.listProviders as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listProviders as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listProviders without error using callback', async () => { + const client = new connectorsModule.v1.ConnectorsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.connectors.v1.ListProvidersRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.connectors.v1.ListProvidersRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.connectors.v1.Provider()), + generateSampleMessage(new protos.google.cloud.connectors.v1.Provider()), + generateSampleMessage(new protos.google.cloud.connectors.v1.Provider()), + ]; + client.innerApiCalls.listProviders = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.listProviders( + request, + ( + err?: Error | null, + result?: protos.google.cloud.connectors.v1.IProvider[] | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.listProviders as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listProviders as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listProviders with error', async () => { + const client = new connectorsModule.v1.ConnectorsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.connectors.v1.ListProvidersRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.connectors.v1.ListProvidersRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.listProviders = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.listProviders(request), expectedError); + const actualRequest = ( + client.innerApiCalls.listProviders as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listProviders as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listProvidersStream without error', async () => { + const client = new connectorsModule.v1.ConnectorsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.connectors.v1.ListProvidersRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.connectors.v1.ListProvidersRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.connectors.v1.Provider()), + generateSampleMessage(new protos.google.cloud.connectors.v1.Provider()), + generateSampleMessage(new protos.google.cloud.connectors.v1.Provider()), + ]; + client.descriptors.page.listProviders.createStream = + stubPageStreamingCall(expectedResponse); + const stream = client.listProvidersStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.connectors.v1.Provider[] = []; + stream.on( + 'data', + (response: protos.google.cloud.connectors.v1.Provider) => { + 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.listProviders.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.listProviders, request) + ); + assert( + (client.descriptors.page.listProviders.createStream as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('invokes listProvidersStream with error', async () => { + const client = new connectorsModule.v1.ConnectorsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.connectors.v1.ListProvidersRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.connectors.v1.ListProvidersRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.descriptors.page.listProviders.createStream = + stubPageStreamingCall(undefined, expectedError); + const stream = client.listProvidersStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.connectors.v1.Provider[] = []; + stream.on( + 'data', + (response: protos.google.cloud.connectors.v1.Provider) => { + responses.push(response); + } + ); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert( + (client.descriptors.page.listProviders.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.listProviders, request) + ); + assert( + (client.descriptors.page.listProviders.createStream as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listProviders without error', async () => { + const client = new connectorsModule.v1.ConnectorsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.connectors.v1.ListProvidersRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.connectors.v1.ListProvidersRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.connectors.v1.Provider()), + generateSampleMessage(new protos.google.cloud.connectors.v1.Provider()), + generateSampleMessage(new protos.google.cloud.connectors.v1.Provider()), + ]; + client.descriptors.page.listProviders.asyncIterate = + stubAsyncIterationCall(expectedResponse); + const responses: protos.google.cloud.connectors.v1.IProvider[] = []; + const iterable = client.listProvidersAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + ( + client.descriptors.page.listProviders.asyncIterate as SinonStub + ).getCall(0).args[1], + request + ); + assert( + (client.descriptors.page.listProviders.asyncIterate as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listProviders with error', async () => { + const client = new connectorsModule.v1.ConnectorsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.connectors.v1.ListProvidersRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.connectors.v1.ListProvidersRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.descriptors.page.listProviders.asyncIterate = + stubAsyncIterationCall(undefined, expectedError); + const iterable = client.listProvidersAsync(request); + await assert.rejects(async () => { + const responses: protos.google.cloud.connectors.v1.IProvider[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + ( + client.descriptors.page.listProviders.asyncIterate as SinonStub + ).getCall(0).args[1], + request + ); + assert( + (client.descriptors.page.listProviders.asyncIterate as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + }); + + describe('listConnectors', () => { + it('invokes listConnectors without error', async () => { + const client = new connectorsModule.v1.ConnectorsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.connectors.v1.ListConnectorsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.connectors.v1.ListConnectorsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.connectors.v1.Connector() + ), + generateSampleMessage( + new protos.google.cloud.connectors.v1.Connector() + ), + generateSampleMessage( + new protos.google.cloud.connectors.v1.Connector() + ), + ]; + client.innerApiCalls.listConnectors = stubSimpleCall(expectedResponse); + const [response] = await client.listConnectors(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.listConnectors as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listConnectors as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listConnectors without error using callback', async () => { + const client = new connectorsModule.v1.ConnectorsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.connectors.v1.ListConnectorsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.connectors.v1.ListConnectorsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.connectors.v1.Connector() + ), + generateSampleMessage( + new protos.google.cloud.connectors.v1.Connector() + ), + generateSampleMessage( + new protos.google.cloud.connectors.v1.Connector() + ), + ]; + client.innerApiCalls.listConnectors = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.listConnectors( + request, + ( + err?: Error | null, + result?: protos.google.cloud.connectors.v1.IConnector[] | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.listConnectors as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listConnectors as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listConnectors with error', async () => { + const client = new connectorsModule.v1.ConnectorsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.connectors.v1.ListConnectorsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.connectors.v1.ListConnectorsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.listConnectors = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.listConnectors(request), expectedError); + const actualRequest = ( + client.innerApiCalls.listConnectors as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listConnectors as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listConnectorsStream without error', async () => { + const client = new connectorsModule.v1.ConnectorsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.connectors.v1.ListConnectorsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.connectors.v1.ListConnectorsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.connectors.v1.Connector() + ), + generateSampleMessage( + new protos.google.cloud.connectors.v1.Connector() + ), + generateSampleMessage( + new protos.google.cloud.connectors.v1.Connector() + ), + ]; + client.descriptors.page.listConnectors.createStream = + stubPageStreamingCall(expectedResponse); + const stream = client.listConnectorsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.connectors.v1.Connector[] = []; + stream.on( + 'data', + (response: protos.google.cloud.connectors.v1.Connector) => { + 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.listConnectors.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.listConnectors, request) + ); + assert( + (client.descriptors.page.listConnectors.createStream as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('invokes listConnectorsStream with error', async () => { + const client = new connectorsModule.v1.ConnectorsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.connectors.v1.ListConnectorsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.connectors.v1.ListConnectorsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.descriptors.page.listConnectors.createStream = + stubPageStreamingCall(undefined, expectedError); + const stream = client.listConnectorsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.connectors.v1.Connector[] = []; + stream.on( + 'data', + (response: protos.google.cloud.connectors.v1.Connector) => { + responses.push(response); + } + ); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert( + (client.descriptors.page.listConnectors.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.listConnectors, request) + ); + assert( + (client.descriptors.page.listConnectors.createStream as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listConnectors without error', async () => { + const client = new connectorsModule.v1.ConnectorsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.connectors.v1.ListConnectorsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.connectors.v1.ListConnectorsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.connectors.v1.Connector() + ), + generateSampleMessage( + new protos.google.cloud.connectors.v1.Connector() + ), + generateSampleMessage( + new protos.google.cloud.connectors.v1.Connector() + ), + ]; + client.descriptors.page.listConnectors.asyncIterate = + stubAsyncIterationCall(expectedResponse); + const responses: protos.google.cloud.connectors.v1.IConnector[] = []; + const iterable = client.listConnectorsAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + ( + client.descriptors.page.listConnectors.asyncIterate as SinonStub + ).getCall(0).args[1], + request + ); + assert( + (client.descriptors.page.listConnectors.asyncIterate as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listConnectors with error', async () => { + const client = new connectorsModule.v1.ConnectorsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.connectors.v1.ListConnectorsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.connectors.v1.ListConnectorsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.descriptors.page.listConnectors.asyncIterate = + stubAsyncIterationCall(undefined, expectedError); + const iterable = client.listConnectorsAsync(request); + await assert.rejects(async () => { + const responses: protos.google.cloud.connectors.v1.IConnector[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + ( + client.descriptors.page.listConnectors.asyncIterate as SinonStub + ).getCall(0).args[1], + request + ); + assert( + (client.descriptors.page.listConnectors.asyncIterate as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + }); + + describe('listConnectorVersions', () => { + it('invokes listConnectorVersions without error', async () => { + const client = new connectorsModule.v1.ConnectorsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.connectors.v1.ListConnectorVersionsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.connectors.v1.ListConnectorVersionsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.connectors.v1.ConnectorVersion() + ), + generateSampleMessage( + new protos.google.cloud.connectors.v1.ConnectorVersion() + ), + generateSampleMessage( + new protos.google.cloud.connectors.v1.ConnectorVersion() + ), + ]; + client.innerApiCalls.listConnectorVersions = + stubSimpleCall(expectedResponse); + const [response] = await client.listConnectorVersions(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.listConnectorVersions as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listConnectorVersions as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listConnectorVersions without error using callback', async () => { + const client = new connectorsModule.v1.ConnectorsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.connectors.v1.ListConnectorVersionsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.connectors.v1.ListConnectorVersionsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.connectors.v1.ConnectorVersion() + ), + generateSampleMessage( + new protos.google.cloud.connectors.v1.ConnectorVersion() + ), + generateSampleMessage( + new protos.google.cloud.connectors.v1.ConnectorVersion() + ), + ]; + client.innerApiCalls.listConnectorVersions = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.listConnectorVersions( + request, + ( + err?: Error | null, + result?: + | protos.google.cloud.connectors.v1.IConnectorVersion[] + | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.listConnectorVersions as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listConnectorVersions as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listConnectorVersions with error', async () => { + const client = new connectorsModule.v1.ConnectorsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.connectors.v1.ListConnectorVersionsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.connectors.v1.ListConnectorVersionsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.listConnectorVersions = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects( + client.listConnectorVersions(request), + expectedError + ); + const actualRequest = ( + client.innerApiCalls.listConnectorVersions as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listConnectorVersions as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listConnectorVersionsStream without error', async () => { + const client = new connectorsModule.v1.ConnectorsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.connectors.v1.ListConnectorVersionsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.connectors.v1.ListConnectorVersionsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.connectors.v1.ConnectorVersion() + ), + generateSampleMessage( + new protos.google.cloud.connectors.v1.ConnectorVersion() + ), + generateSampleMessage( + new protos.google.cloud.connectors.v1.ConnectorVersion() + ), + ]; + client.descriptors.page.listConnectorVersions.createStream = + stubPageStreamingCall(expectedResponse); + const stream = client.listConnectorVersionsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.connectors.v1.ConnectorVersion[] = + []; + stream.on( + 'data', + (response: protos.google.cloud.connectors.v1.ConnectorVersion) => { + 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.listConnectorVersions + .createStream as SinonStub + ) + .getCall(0) + .calledWith(client.innerApiCalls.listConnectorVersions, request) + ); + assert( + ( + client.descriptors.page.listConnectorVersions + .createStream as SinonStub + ) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('invokes listConnectorVersionsStream with error', async () => { + const client = new connectorsModule.v1.ConnectorsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.connectors.v1.ListConnectorVersionsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.connectors.v1.ListConnectorVersionsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.descriptors.page.listConnectorVersions.createStream = + stubPageStreamingCall(undefined, expectedError); + const stream = client.listConnectorVersionsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.connectors.v1.ConnectorVersion[] = + []; + stream.on( + 'data', + (response: protos.google.cloud.connectors.v1.ConnectorVersion) => { + responses.push(response); + } + ); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert( + ( + client.descriptors.page.listConnectorVersions + .createStream as SinonStub + ) + .getCall(0) + .calledWith(client.innerApiCalls.listConnectorVersions, request) + ); + assert( + ( + client.descriptors.page.listConnectorVersions + .createStream as SinonStub + ) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listConnectorVersions without error', async () => { + const client = new connectorsModule.v1.ConnectorsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.connectors.v1.ListConnectorVersionsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.connectors.v1.ListConnectorVersionsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.connectors.v1.ConnectorVersion() + ), + generateSampleMessage( + new protos.google.cloud.connectors.v1.ConnectorVersion() + ), + generateSampleMessage( + new protos.google.cloud.connectors.v1.ConnectorVersion() + ), + ]; + client.descriptors.page.listConnectorVersions.asyncIterate = + stubAsyncIterationCall(expectedResponse); + const responses: protos.google.cloud.connectors.v1.IConnectorVersion[] = + []; + const iterable = client.listConnectorVersionsAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + ( + client.descriptors.page.listConnectorVersions + .asyncIterate as SinonStub + ).getCall(0).args[1], + request + ); + assert( + ( + client.descriptors.page.listConnectorVersions + .asyncIterate as SinonStub + ) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listConnectorVersions with error', async () => { + const client = new connectorsModule.v1.ConnectorsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.connectors.v1.ListConnectorVersionsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.connectors.v1.ListConnectorVersionsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.descriptors.page.listConnectorVersions.asyncIterate = + stubAsyncIterationCall(undefined, expectedError); + const iterable = client.listConnectorVersionsAsync(request); + await assert.rejects(async () => { + const responses: protos.google.cloud.connectors.v1.IConnectorVersion[] = + []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + ( + client.descriptors.page.listConnectorVersions + .asyncIterate as SinonStub + ).getCall(0).args[1], + request + ); + assert( + ( + client.descriptors.page.listConnectorVersions + .asyncIterate as SinonStub + ) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + }); + + describe('listRuntimeEntitySchemas', () => { + it('invokes listRuntimeEntitySchemas without error', async () => { + const client = new connectorsModule.v1.ConnectorsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.connectors.v1.ListRuntimeEntitySchemasRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.connectors.v1.ListRuntimeEntitySchemasRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.connectors.v1.RuntimeEntitySchema() + ), + generateSampleMessage( + new protos.google.cloud.connectors.v1.RuntimeEntitySchema() + ), + generateSampleMessage( + new protos.google.cloud.connectors.v1.RuntimeEntitySchema() + ), + ]; + client.innerApiCalls.listRuntimeEntitySchemas = + stubSimpleCall(expectedResponse); + const [response] = await client.listRuntimeEntitySchemas(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.listRuntimeEntitySchemas as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listRuntimeEntitySchemas as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listRuntimeEntitySchemas without error using callback', async () => { + const client = new connectorsModule.v1.ConnectorsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.connectors.v1.ListRuntimeEntitySchemasRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.connectors.v1.ListRuntimeEntitySchemasRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.connectors.v1.RuntimeEntitySchema() + ), + generateSampleMessage( + new protos.google.cloud.connectors.v1.RuntimeEntitySchema() + ), + generateSampleMessage( + new protos.google.cloud.connectors.v1.RuntimeEntitySchema() + ), + ]; + client.innerApiCalls.listRuntimeEntitySchemas = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.listRuntimeEntitySchemas( + request, + ( + err?: Error | null, + result?: + | protos.google.cloud.connectors.v1.IRuntimeEntitySchema[] + | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.listRuntimeEntitySchemas as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listRuntimeEntitySchemas as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listRuntimeEntitySchemas with error', async () => { + const client = new connectorsModule.v1.ConnectorsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.connectors.v1.ListRuntimeEntitySchemasRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.connectors.v1.ListRuntimeEntitySchemasRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.listRuntimeEntitySchemas = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects( + client.listRuntimeEntitySchemas(request), + expectedError + ); + const actualRequest = ( + client.innerApiCalls.listRuntimeEntitySchemas as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listRuntimeEntitySchemas as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listRuntimeEntitySchemasStream without error', async () => { + const client = new connectorsModule.v1.ConnectorsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.connectors.v1.ListRuntimeEntitySchemasRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.connectors.v1.ListRuntimeEntitySchemasRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.connectors.v1.RuntimeEntitySchema() + ), + generateSampleMessage( + new protos.google.cloud.connectors.v1.RuntimeEntitySchema() + ), + generateSampleMessage( + new protos.google.cloud.connectors.v1.RuntimeEntitySchema() + ), + ]; + client.descriptors.page.listRuntimeEntitySchemas.createStream = + stubPageStreamingCall(expectedResponse); + const stream = client.listRuntimeEntitySchemasStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.connectors.v1.RuntimeEntitySchema[] = + []; + stream.on( + 'data', + (response: protos.google.cloud.connectors.v1.RuntimeEntitySchema) => { + 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.listRuntimeEntitySchemas + .createStream as SinonStub + ) + .getCall(0) + .calledWith(client.innerApiCalls.listRuntimeEntitySchemas, request) + ); + assert( + ( + client.descriptors.page.listRuntimeEntitySchemas + .createStream as SinonStub + ) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('invokes listRuntimeEntitySchemasStream with error', async () => { + const client = new connectorsModule.v1.ConnectorsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.connectors.v1.ListRuntimeEntitySchemasRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.connectors.v1.ListRuntimeEntitySchemasRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.descriptors.page.listRuntimeEntitySchemas.createStream = + stubPageStreamingCall(undefined, expectedError); + const stream = client.listRuntimeEntitySchemasStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.connectors.v1.RuntimeEntitySchema[] = + []; + stream.on( + 'data', + (response: protos.google.cloud.connectors.v1.RuntimeEntitySchema) => { + responses.push(response); + } + ); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert( + ( + client.descriptors.page.listRuntimeEntitySchemas + .createStream as SinonStub + ) + .getCall(0) + .calledWith(client.innerApiCalls.listRuntimeEntitySchemas, request) + ); + assert( + ( + client.descriptors.page.listRuntimeEntitySchemas + .createStream as SinonStub + ) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listRuntimeEntitySchemas without error', async () => { + const client = new connectorsModule.v1.ConnectorsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.connectors.v1.ListRuntimeEntitySchemasRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.connectors.v1.ListRuntimeEntitySchemasRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.connectors.v1.RuntimeEntitySchema() + ), + generateSampleMessage( + new protos.google.cloud.connectors.v1.RuntimeEntitySchema() + ), + generateSampleMessage( + new protos.google.cloud.connectors.v1.RuntimeEntitySchema() + ), + ]; + client.descriptors.page.listRuntimeEntitySchemas.asyncIterate = + stubAsyncIterationCall(expectedResponse); + const responses: protos.google.cloud.connectors.v1.IRuntimeEntitySchema[] = + []; + const iterable = client.listRuntimeEntitySchemasAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + ( + client.descriptors.page.listRuntimeEntitySchemas + .asyncIterate as SinonStub + ).getCall(0).args[1], + request + ); + assert( + ( + client.descriptors.page.listRuntimeEntitySchemas + .asyncIterate as SinonStub + ) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listRuntimeEntitySchemas with error', async () => { + const client = new connectorsModule.v1.ConnectorsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.connectors.v1.ListRuntimeEntitySchemasRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.connectors.v1.ListRuntimeEntitySchemasRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.descriptors.page.listRuntimeEntitySchemas.asyncIterate = + stubAsyncIterationCall(undefined, expectedError); + const iterable = client.listRuntimeEntitySchemasAsync(request); + await assert.rejects(async () => { + const responses: protos.google.cloud.connectors.v1.IRuntimeEntitySchema[] = + []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + ( + client.descriptors.page.listRuntimeEntitySchemas + .asyncIterate as SinonStub + ).getCall(0).args[1], + request + ); + assert( + ( + client.descriptors.page.listRuntimeEntitySchemas + .asyncIterate as SinonStub + ) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + }); + + describe('listRuntimeActionSchemas', () => { + it('invokes listRuntimeActionSchemas without error', async () => { + const client = new connectorsModule.v1.ConnectorsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.connectors.v1.ListRuntimeActionSchemasRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.connectors.v1.ListRuntimeActionSchemasRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.connectors.v1.RuntimeActionSchema() + ), + generateSampleMessage( + new protos.google.cloud.connectors.v1.RuntimeActionSchema() + ), + generateSampleMessage( + new protos.google.cloud.connectors.v1.RuntimeActionSchema() + ), + ]; + client.innerApiCalls.listRuntimeActionSchemas = + stubSimpleCall(expectedResponse); + const [response] = await client.listRuntimeActionSchemas(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.listRuntimeActionSchemas as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listRuntimeActionSchemas as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listRuntimeActionSchemas without error using callback', async () => { + const client = new connectorsModule.v1.ConnectorsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.connectors.v1.ListRuntimeActionSchemasRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.connectors.v1.ListRuntimeActionSchemasRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.connectors.v1.RuntimeActionSchema() + ), + generateSampleMessage( + new protos.google.cloud.connectors.v1.RuntimeActionSchema() + ), + generateSampleMessage( + new protos.google.cloud.connectors.v1.RuntimeActionSchema() + ), + ]; + client.innerApiCalls.listRuntimeActionSchemas = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.listRuntimeActionSchemas( + request, + ( + err?: Error | null, + result?: + | protos.google.cloud.connectors.v1.IRuntimeActionSchema[] + | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.listRuntimeActionSchemas as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listRuntimeActionSchemas as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listRuntimeActionSchemas with error', async () => { + const client = new connectorsModule.v1.ConnectorsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.connectors.v1.ListRuntimeActionSchemasRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.connectors.v1.ListRuntimeActionSchemasRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.listRuntimeActionSchemas = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects( + client.listRuntimeActionSchemas(request), + expectedError + ); + const actualRequest = ( + client.innerApiCalls.listRuntimeActionSchemas as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listRuntimeActionSchemas as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listRuntimeActionSchemasStream without error', async () => { + const client = new connectorsModule.v1.ConnectorsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.connectors.v1.ListRuntimeActionSchemasRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.connectors.v1.ListRuntimeActionSchemasRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.connectors.v1.RuntimeActionSchema() + ), + generateSampleMessage( + new protos.google.cloud.connectors.v1.RuntimeActionSchema() + ), + generateSampleMessage( + new protos.google.cloud.connectors.v1.RuntimeActionSchema() + ), + ]; + client.descriptors.page.listRuntimeActionSchemas.createStream = + stubPageStreamingCall(expectedResponse); + const stream = client.listRuntimeActionSchemasStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.connectors.v1.RuntimeActionSchema[] = + []; + stream.on( + 'data', + (response: protos.google.cloud.connectors.v1.RuntimeActionSchema) => { + 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.listRuntimeActionSchemas + .createStream as SinonStub + ) + .getCall(0) + .calledWith(client.innerApiCalls.listRuntimeActionSchemas, request) + ); + assert( + ( + client.descriptors.page.listRuntimeActionSchemas + .createStream as SinonStub + ) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('invokes listRuntimeActionSchemasStream with error', async () => { + const client = new connectorsModule.v1.ConnectorsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.connectors.v1.ListRuntimeActionSchemasRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.connectors.v1.ListRuntimeActionSchemasRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.descriptors.page.listRuntimeActionSchemas.createStream = + stubPageStreamingCall(undefined, expectedError); + const stream = client.listRuntimeActionSchemasStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.connectors.v1.RuntimeActionSchema[] = + []; + stream.on( + 'data', + (response: protos.google.cloud.connectors.v1.RuntimeActionSchema) => { + responses.push(response); + } + ); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert( + ( + client.descriptors.page.listRuntimeActionSchemas + .createStream as SinonStub + ) + .getCall(0) + .calledWith(client.innerApiCalls.listRuntimeActionSchemas, request) + ); + assert( + ( + client.descriptors.page.listRuntimeActionSchemas + .createStream as SinonStub + ) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listRuntimeActionSchemas without error', async () => { + const client = new connectorsModule.v1.ConnectorsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.connectors.v1.ListRuntimeActionSchemasRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.connectors.v1.ListRuntimeActionSchemasRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.connectors.v1.RuntimeActionSchema() + ), + generateSampleMessage( + new protos.google.cloud.connectors.v1.RuntimeActionSchema() + ), + generateSampleMessage( + new protos.google.cloud.connectors.v1.RuntimeActionSchema() + ), + ]; + client.descriptors.page.listRuntimeActionSchemas.asyncIterate = + stubAsyncIterationCall(expectedResponse); + const responses: protos.google.cloud.connectors.v1.IRuntimeActionSchema[] = + []; + const iterable = client.listRuntimeActionSchemasAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + ( + client.descriptors.page.listRuntimeActionSchemas + .asyncIterate as SinonStub + ).getCall(0).args[1], + request + ); + assert( + ( + client.descriptors.page.listRuntimeActionSchemas + .asyncIterate as SinonStub + ) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listRuntimeActionSchemas with error', async () => { + const client = new connectorsModule.v1.ConnectorsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.connectors.v1.ListRuntimeActionSchemasRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.connectors.v1.ListRuntimeActionSchemasRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.descriptors.page.listRuntimeActionSchemas.asyncIterate = + stubAsyncIterationCall(undefined, expectedError); + const iterable = client.listRuntimeActionSchemasAsync(request); + await assert.rejects(async () => { + const responses: protos.google.cloud.connectors.v1.IRuntimeActionSchema[] = + []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + ( + client.descriptors.page.listRuntimeActionSchemas + .asyncIterate as SinonStub + ).getCall(0).args[1], + request + ); + assert( + ( + client.descriptors.page.listRuntimeActionSchemas + .asyncIterate as SinonStub + ) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + }); + describe('getIamPolicy', () => { + it('invokes getIamPolicy without error', async () => { + const client = new connectorsModule.v1.ConnectorsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new IamProtos.google.iam.v1.GetIamPolicyRequest() + ); + request.resource = ''; + const expectedHeaderRequestParams = 'resource='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new IamProtos.google.iam.v1.Policy() + ); + client.iamClient.getIamPolicy = stubSimpleCall(expectedResponse); + const response = await client.getIamPolicy(request, expectedOptions); + assert.deepStrictEqual(response, [expectedResponse]); + assert( + (client.iamClient.getIamPolicy as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + it('invokes getIamPolicy without error using callback', async () => { + const client = new connectorsModule.v1.ConnectorsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new IamProtos.google.iam.v1.GetIamPolicyRequest() + ); + request.resource = ''; + const expectedHeaderRequestParams = 'resource='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new IamProtos.google.iam.v1.Policy() + ); + client.iamClient.getIamPolicy = sinon + .stub() + .callsArgWith(2, null, expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getIamPolicy( + request, + expectedOptions, + ( + err?: Error | null, + result?: IamProtos.google.iam.v1.Policy | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.iamClient.getIamPolicy as SinonStub).getCall(0)); + }); + it('invokes getIamPolicy with error', async () => { + const client = new connectorsModule.v1.ConnectorsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new IamProtos.google.iam.v1.GetIamPolicyRequest() + ); + request.resource = ''; + const expectedHeaderRequestParams = 'resource='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.iamClient.getIamPolicy = stubSimpleCall(undefined, expectedError); + await assert.rejects( + client.getIamPolicy(request, expectedOptions), + expectedError + ); + assert( + (client.iamClient.getIamPolicy as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + }); + describe('setIamPolicy', () => { + it('invokes setIamPolicy without error', async () => { + const client = new connectorsModule.v1.ConnectorsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new IamProtos.google.iam.v1.SetIamPolicyRequest() + ); + request.resource = ''; + const expectedHeaderRequestParams = 'resource='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new IamProtos.google.iam.v1.Policy() + ); + client.iamClient.setIamPolicy = stubSimpleCall(expectedResponse); + const response = await client.setIamPolicy(request, expectedOptions); + assert.deepStrictEqual(response, [expectedResponse]); + assert( + (client.iamClient.setIamPolicy as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + it('invokes setIamPolicy without error using callback', async () => { + const client = new connectorsModule.v1.ConnectorsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new IamProtos.google.iam.v1.SetIamPolicyRequest() + ); + request.resource = ''; + const expectedHeaderRequestParams = 'resource='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new IamProtos.google.iam.v1.Policy() + ); + client.iamClient.setIamPolicy = sinon + .stub() + .callsArgWith(2, null, expectedResponse); + const promise = new Promise((resolve, reject) => { + client.setIamPolicy( + request, + expectedOptions, + ( + err?: Error | null, + result?: IamProtos.google.iam.v1.Policy | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.iamClient.setIamPolicy as SinonStub).getCall(0)); + }); + it('invokes setIamPolicy with error', async () => { + const client = new connectorsModule.v1.ConnectorsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new IamProtos.google.iam.v1.SetIamPolicyRequest() + ); + request.resource = ''; + const expectedHeaderRequestParams = 'resource='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.iamClient.setIamPolicy = stubSimpleCall(undefined, expectedError); + await assert.rejects( + client.setIamPolicy(request, expectedOptions), + expectedError + ); + assert( + (client.iamClient.setIamPolicy as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + }); + describe('testIamPermissions', () => { + it('invokes testIamPermissions without error', async () => { + const client = new connectorsModule.v1.ConnectorsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new IamProtos.google.iam.v1.TestIamPermissionsRequest() + ); + request.resource = ''; + const expectedHeaderRequestParams = 'resource='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new IamProtos.google.iam.v1.TestIamPermissionsResponse() + ); + client.iamClient.testIamPermissions = stubSimpleCall(expectedResponse); + const response = await client.testIamPermissions( + request, + expectedOptions + ); + assert.deepStrictEqual(response, [expectedResponse]); + assert( + (client.iamClient.testIamPermissions as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + it('invokes testIamPermissions without error using callback', async () => { + const client = new connectorsModule.v1.ConnectorsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new IamProtos.google.iam.v1.TestIamPermissionsRequest() + ); + request.resource = ''; + const expectedHeaderRequestParams = 'resource='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new IamProtos.google.iam.v1.TestIamPermissionsResponse() + ); + client.iamClient.testIamPermissions = sinon + .stub() + .callsArgWith(2, null, expectedResponse); + const promise = new Promise((resolve, reject) => { + client.testIamPermissions( + request, + expectedOptions, + ( + err?: Error | null, + result?: IamProtos.google.iam.v1.TestIamPermissionsResponse | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.iamClient.testIamPermissions as SinonStub).getCall(0)); + }); + it('invokes testIamPermissions with error', async () => { + const client = new connectorsModule.v1.ConnectorsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new IamProtos.google.iam.v1.TestIamPermissionsRequest() + ); + request.resource = ''; + const expectedHeaderRequestParams = 'resource='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.iamClient.testIamPermissions = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects( + client.testIamPermissions(request, expectedOptions), + expectedError + ); + assert( + (client.iamClient.testIamPermissions as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + }); + describe('getLocation', () => { + it('invokes getLocation without error', async () => { + const client = new connectorsModule.v1.ConnectorsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + 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 connectorsModule.v1.ConnectorsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + 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 connectorsModule.v1.ConnectorsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + 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 connectorsModule.v1.ConnectorsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + 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 connectorsModule.v1.ConnectorsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + 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 connectorsModule.v1.ConnectorsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + 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 connectorsModule.v1.ConnectorsClient({ + 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); + } + } + ); + }); + 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 connectorsModule.v1.ConnectorsClient({ + 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 connectorsModule.v1.ConnectorsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + 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 connectorsModule.v1.ConnectorsClient({ + 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); + } + } + ); + }); + 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 connectorsModule.v1.ConnectorsClient({ + 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 connectorsModule.v1.ConnectorsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + 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 connectorsModule.v1.ConnectorsClient({ + 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); + } + } + ); + }); + 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 connectorsModule.v1.ConnectorsClient({ + 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 connectorsModule.v1.ConnectorsClient({ + 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.ListOperationsResponse[] = + []; + 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 connectorsModule.v1.ConnectorsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + 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.ListOperationsResponse[] = + []; + 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('connection', () => { + const fakePath = '/rendered/path/connection'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + connection: 'connectionValue', + }; + const client = new connectorsModule.v1.ConnectorsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.connectionPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.connectionPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('connectionPath', () => { + const result = client.connectionPath( + 'projectValue', + 'locationValue', + 'connectionValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.connectionPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromConnectionName', () => { + const result = client.matchProjectFromConnectionName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.connectionPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromConnectionName', () => { + const result = client.matchLocationFromConnectionName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.connectionPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchConnectionFromConnectionName', () => { + const result = client.matchConnectionFromConnectionName(fakePath); + assert.strictEqual(result, 'connectionValue'); + assert( + (client.pathTemplates.connectionPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('connectionSchemaMetadata', () => { + const fakePath = '/rendered/path/connectionSchemaMetadata'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + connection: 'connectionValue', + }; + const client = new connectorsModule.v1.ConnectorsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.connectionSchemaMetadataPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.connectionSchemaMetadataPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('connectionSchemaMetadataPath', () => { + const result = client.connectionSchemaMetadataPath( + 'projectValue', + 'locationValue', + 'connectionValue' + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates.connectionSchemaMetadataPathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromConnectionSchemaMetadataName', () => { + const result = + client.matchProjectFromConnectionSchemaMetadataName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + ( + client.pathTemplates.connectionSchemaMetadataPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromConnectionSchemaMetadataName', () => { + const result = + client.matchLocationFromConnectionSchemaMetadataName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + ( + client.pathTemplates.connectionSchemaMetadataPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchConnectionFromConnectionSchemaMetadataName', () => { + const result = + client.matchConnectionFromConnectionSchemaMetadataName(fakePath); + assert.strictEqual(result, 'connectionValue'); + assert( + ( + client.pathTemplates.connectionSchemaMetadataPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('connector', () => { + const fakePath = '/rendered/path/connector'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + provider: 'providerValue', + connector: 'connectorValue', + }; + const client = new connectorsModule.v1.ConnectorsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.connectorPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.connectorPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('connectorPath', () => { + const result = client.connectorPath( + 'projectValue', + 'locationValue', + 'providerValue', + 'connectorValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.connectorPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromConnectorName', () => { + const result = client.matchProjectFromConnectorName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.connectorPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromConnectorName', () => { + const result = client.matchLocationFromConnectorName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.connectorPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchProviderFromConnectorName', () => { + const result = client.matchProviderFromConnectorName(fakePath); + assert.strictEqual(result, 'providerValue'); + assert( + (client.pathTemplates.connectorPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchConnectorFromConnectorName', () => { + const result = client.matchConnectorFromConnectorName(fakePath); + assert.strictEqual(result, 'connectorValue'); + assert( + (client.pathTemplates.connectorPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('connectorVersion', () => { + const fakePath = '/rendered/path/connectorVersion'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + provider: 'providerValue', + connector: 'connectorValue', + version: 'versionValue', + }; + const client = new connectorsModule.v1.ConnectorsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.connectorVersionPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.connectorVersionPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('connectorVersionPath', () => { + const result = client.connectorVersionPath( + 'projectValue', + 'locationValue', + 'providerValue', + 'connectorValue', + 'versionValue' + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates.connectorVersionPathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromConnectorVersionName', () => { + const result = client.matchProjectFromConnectorVersionName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.connectorVersionPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromConnectorVersionName', () => { + const result = client.matchLocationFromConnectorVersionName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.connectorVersionPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchProviderFromConnectorVersionName', () => { + const result = client.matchProviderFromConnectorVersionName(fakePath); + assert.strictEqual(result, 'providerValue'); + assert( + (client.pathTemplates.connectorVersionPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchConnectorFromConnectorVersionName', () => { + const result = client.matchConnectorFromConnectorVersionName(fakePath); + assert.strictEqual(result, 'connectorValue'); + assert( + (client.pathTemplates.connectorVersionPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchVersionFromConnectorVersionName', () => { + const result = client.matchVersionFromConnectorVersionName(fakePath); + assert.strictEqual(result, 'versionValue'); + assert( + (client.pathTemplates.connectorVersionPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('provider', () => { + const fakePath = '/rendered/path/provider'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + provider: 'providerValue', + }; + const client = new connectorsModule.v1.ConnectorsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.providerPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.providerPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('providerPath', () => { + const result = client.providerPath( + 'projectValue', + 'locationValue', + 'providerValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.providerPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromProviderName', () => { + const result = client.matchProjectFromProviderName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.providerPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromProviderName', () => { + const result = client.matchLocationFromProviderName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.providerPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchProviderFromProviderName', () => { + const result = client.matchProviderFromProviderName(fakePath); + assert.strictEqual(result, 'providerValue'); + assert( + (client.pathTemplates.providerPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('runtimeConfig', () => { + const fakePath = '/rendered/path/runtimeConfig'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + }; + const client = new connectorsModule.v1.ConnectorsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.runtimeConfigPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.runtimeConfigPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('runtimeConfigPath', () => { + const result = client.runtimeConfigPath( + 'projectValue', + 'locationValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.runtimeConfigPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromRuntimeConfigName', () => { + const result = client.matchProjectFromRuntimeConfigName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.runtimeConfigPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromRuntimeConfigName', () => { + const result = client.matchLocationFromRuntimeConfigName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.runtimeConfigPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('settings', () => { + const fakePath = '/rendered/path/settings'; + const expectedParameters = { + project: 'projectValue', + }; + const client = new connectorsModule.v1.ConnectorsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.settingsPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.settingsPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('settingsPath', () => { + const result = client.settingsPath('projectValue'); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.settingsPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromSettingsName', () => { + const result = client.matchProjectFromSettingsName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.settingsPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + }); +}); diff --git a/packages/google-cloud-connectors/tsconfig.json b/packages/google-cloud-connectors/tsconfig.json new file mode 100644 index 00000000000..c78f1c884ef --- /dev/null +++ b/packages/google-cloud-connectors/tsconfig.json @@ -0,0 +1,19 @@ +{ + "extends": "./node_modules/gts/tsconfig-google.json", + "compilerOptions": { + "rootDir": ".", + "outDir": "build", + "resolveJsonModule": true, + "lib": [ + "es2018", + "dom" + ] + }, + "include": [ + "src/*.ts", + "src/**/*.ts", + "test/*.ts", + "test/**/*.ts", + "system-test/*.ts" + ] +} diff --git a/packages/google-cloud-connectors/webpack.config.js b/packages/google-cloud-connectors/webpack.config.js new file mode 100644 index 00000000000..e733962191b --- /dev/null +++ b/packages/google-cloud-connectors/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: 'Connectors', + filename: './connectors.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/google-cloud-contentwarehouse/CHANGELOG.md b/packages/google-cloud-contentwarehouse/CHANGELOG.md index 2fea7d98702..393edeb79f7 100644 --- a/packages/google-cloud-contentwarehouse/CHANGELOG.md +++ b/packages/google-cloud-contentwarehouse/CHANGELOG.md @@ -1,5 +1,12 @@ # Changelog +## [1.2.0](https://github.com/googleapis/google-cloud-node/compare/contentwarehouse-v1.1.0...contentwarehouse-v1.2.0) (2023-09-19) + + +### Features + +* [contentwarehouse] add `ROOT_FOLDER` field to Document Warehouse API v1 ([#4672](https://github.com/googleapis/google-cloud-node/issues/4672)) ([998711e](https://github.com/googleapis/google-cloud-node/commit/998711e948c717d5b0bd878d1e0e8cf861831d52)) + ## [1.1.0](https://github.com/googleapis/google-cloud-node/compare/contentwarehouse-v1.0.0...contentwarehouse-v1.1.0) (2023-09-06) diff --git a/packages/google-cloud-contentwarehouse/package.json b/packages/google-cloud-contentwarehouse/package.json index 5544adf4d67..effdac4bb64 100644 --- a/packages/google-cloud-contentwarehouse/package.json +++ b/packages/google-cloud-contentwarehouse/package.json @@ -1,6 +1,6 @@ { "name": "@google-cloud/contentwarehouse", - "version": "1.1.0", + "version": "1.2.0", "description": "Document AI Warehouse client for Node.js", "repository": { "type": "git", diff --git a/packages/google-cloud-contentwarehouse/protos/google/cloud/contentwarehouse/v1/filters.proto b/packages/google-cloud-contentwarehouse/protos/google/cloud/contentwarehouse/v1/filters.proto index ababb2821e7..cd490a9902f 100644 --- a/packages/google-cloud-contentwarehouse/protos/google/cloud/contentwarehouse/v1/filters.proto +++ b/packages/google-cloud-contentwarehouse/protos/google/cloud/contentwarehouse/v1/filters.proto @@ -262,6 +262,9 @@ message FileTypeFilter { // Returns only non-folder documents. DOCUMENT = 3; + + // Returns only root folders + ROOT_FOLDER = 4; } // The type of files to return. diff --git a/packages/google-cloud-contentwarehouse/protos/google/cloud/contentwarehouse/v1/pipelines.proto b/packages/google-cloud-contentwarehouse/protos/google/cloud/contentwarehouse/v1/pipelines.proto index 27b2d5e4ff6..db34b5c6d62 100644 --- a/packages/google-cloud-contentwarehouse/protos/google/cloud/contentwarehouse/v1/pipelines.proto +++ b/packages/google-cloud-contentwarehouse/protos/google/cloud/contentwarehouse/v1/pipelines.proto @@ -29,6 +29,10 @@ option java_outer_classname = "PipelinesProto"; option java_package = "com.google.cloud.contentwarehouse.v1"; option php_namespace = "Google\\Cloud\\ContentWarehouse\\V1"; option ruby_package = "Google::Cloud::ContentWarehouse::V1"; +option (google.api.resource_definition) = { + type: "cloudfunctions.googleapis.com/CloudFunction" + pattern: "projects/{project}/locations/{location}/functions/{function}" +}; // Response message of RunPipeline method. message RunPipelineResponse {} @@ -146,6 +150,33 @@ message IngestPipelineConfig { // linked during ingestion process. Format is // `projects/{project}/locations/{location}/documents/{folder_id}` string folder = 3 [(google.api.field_behavior) = OPTIONAL]; + + // The Cloud Function resource name. The Cloud Function needs to live inside + // consumer project and is accessible to Document AI Warehouse P4SA. + // Only Cloud Functions V2 is supported. Cloud function execution should + // complete within 5 minutes or this file ingestion may fail due to timeout. + // Format: `https://{region}-{project_id}.cloudfunctions.net/{cloud_function}` + // The following keys are available the request json payload. + // * display_name + // * properties + // * plain_text + // * reference_id + // * document_schema_name + // * raw_document_path + // * raw_document_file_type + // + // The following keys from the cloud function json response payload will be + // ingested to the Document AI Warehouse as part of Document proto content + // and/or related information. The original values will be overridden if any + // key is present in the response. + // * display_name + // * properties + // * plain_text + // * document_acl_policy + // * folder + string cloud_function = 4 [(google.api.resource_reference) = { + type: "cloudfunctions.googleapis.com/CloudFunction" + }]; } // The configuration of the Cloud Storage Ingestion pipeline. diff --git a/packages/google-cloud-contentwarehouse/protos/protos.d.ts b/packages/google-cloud-contentwarehouse/protos/protos.d.ts index 19138897caa..2ab1c7db451 100644 --- a/packages/google-cloud-contentwarehouse/protos/protos.d.ts +++ b/packages/google-cloud-contentwarehouse/protos/protos.d.ts @@ -7850,7 +7850,8 @@ export namespace google { FILE_TYPE_UNSPECIFIED = 0, ALL = 1, FOLDER = 2, - DOCUMENT = 3 + DOCUMENT = 3, + ROOT_FOLDER = 4 } } @@ -11061,6 +11062,9 @@ export namespace google { /** IngestPipelineConfig folder */ folder?: (string|null); + + /** IngestPipelineConfig cloudFunction */ + cloudFunction?: (string|null); } /** Represents an IngestPipelineConfig. */ @@ -11081,6 +11085,9 @@ export namespace google { /** IngestPipelineConfig folder. */ public folder: string; + /** IngestPipelineConfig cloudFunction. */ + public cloudFunction: string; + /** * Creates a new IngestPipelineConfig instance using the specified properties. * @param [properties] Properties to set diff --git a/packages/google-cloud-contentwarehouse/protos/protos.js b/packages/google-cloud-contentwarehouse/protos/protos.js index 69e530e4fcd..95f75f1327b 100644 --- a/packages/google-cloud-contentwarehouse/protos/protos.js +++ b/packages/google-cloud-contentwarehouse/protos/protos.js @@ -19086,6 +19086,7 @@ case 1: case 2: case 3: + case 4: break; } return null; @@ -19126,6 +19127,10 @@ case 3: message.fileType = 3; break; + case "ROOT_FOLDER": + case 4: + message.fileType = 4; + break; } return message; }; @@ -19184,6 +19189,7 @@ * @property {number} ALL=1 ALL value * @property {number} FOLDER=2 FOLDER value * @property {number} DOCUMENT=3 DOCUMENT value + * @property {number} ROOT_FOLDER=4 ROOT_FOLDER value */ FileTypeFilter.FileType = (function() { var valuesById = {}, values = Object.create(valuesById); @@ -19191,6 +19197,7 @@ values[valuesById[1] = "ALL"] = 1; values[valuesById[2] = "FOLDER"] = 2; values[valuesById[3] = "DOCUMENT"] = 3; + values[valuesById[4] = "ROOT_FOLDER"] = 4; return values; })(); @@ -27123,6 +27130,7 @@ * @property {google.iam.v1.IPolicy|null} [documentAclPolicy] IngestPipelineConfig documentAclPolicy * @property {boolean|null} [enableDocumentTextExtraction] IngestPipelineConfig enableDocumentTextExtraction * @property {string|null} [folder] IngestPipelineConfig folder + * @property {string|null} [cloudFunction] IngestPipelineConfig cloudFunction */ /** @@ -27164,6 +27172,14 @@ */ IngestPipelineConfig.prototype.folder = ""; + /** + * IngestPipelineConfig cloudFunction. + * @member {string} cloudFunction + * @memberof google.cloud.contentwarehouse.v1.IngestPipelineConfig + * @instance + */ + IngestPipelineConfig.prototype.cloudFunction = ""; + /** * Creates a new IngestPipelineConfig instance using the specified properties. * @function create @@ -27194,6 +27210,8 @@ writer.uint32(/* id 2, wireType 0 =*/16).bool(message.enableDocumentTextExtraction); if (message.folder != null && Object.hasOwnProperty.call(message, "folder")) writer.uint32(/* id 3, wireType 2 =*/26).string(message.folder); + if (message.cloudFunction != null && Object.hasOwnProperty.call(message, "cloudFunction")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.cloudFunction); return writer; }; @@ -27240,6 +27258,10 @@ message.folder = reader.string(); break; } + case 4: { + message.cloudFunction = reader.string(); + break; + } default: reader.skipType(tag & 7); break; @@ -27286,6 +27308,9 @@ if (message.folder != null && message.hasOwnProperty("folder")) if (!$util.isString(message.folder)) return "folder: string expected"; + if (message.cloudFunction != null && message.hasOwnProperty("cloudFunction")) + if (!$util.isString(message.cloudFunction)) + return "cloudFunction: string expected"; return null; }; @@ -27310,6 +27335,8 @@ message.enableDocumentTextExtraction = Boolean(object.enableDocumentTextExtraction); if (object.folder != null) message.folder = String(object.folder); + if (object.cloudFunction != null) + message.cloudFunction = String(object.cloudFunction); return message; }; @@ -27330,6 +27357,7 @@ object.documentAclPolicy = null; object.enableDocumentTextExtraction = false; object.folder = ""; + object.cloudFunction = ""; } if (message.documentAclPolicy != null && message.hasOwnProperty("documentAclPolicy")) object.documentAclPolicy = $root.google.iam.v1.Policy.toObject(message.documentAclPolicy, options); @@ -27337,6 +27365,8 @@ object.enableDocumentTextExtraction = message.enableDocumentTextExtraction; if (message.folder != null && message.hasOwnProperty("folder")) object.folder = message.folder; + if (message.cloudFunction != null && message.hasOwnProperty("cloudFunction")) + object.cloudFunction = message.cloudFunction; return object; }; diff --git a/packages/google-cloud-contentwarehouse/protos/protos.json b/packages/google-cloud-contentwarehouse/protos/protos.json index 59ccda1ea23..f8d59562fe3 100644 --- a/packages/google-cloud-contentwarehouse/protos/protos.json +++ b/packages/google-cloud-contentwarehouse/protos/protos.json @@ -15,8 +15,8 @@ "java_package": "com.google.cloud.contentwarehouse.v1", "php_namespace": "Google\\Cloud\\ContentWarehouse\\V1", "ruby_package": "Google::Cloud::ContentWarehouse::V1", - "(google.api.resource_definition).type": "contentwarehouse.googleapis.com/Location", - "(google.api.resource_definition).pattern": "projects/{project}/locations/{location}" + "(google.api.resource_definition).type": "cloudfunctions.googleapis.com/CloudFunction", + "(google.api.resource_definition).pattern": "projects/{project}/locations/{location}/functions/{function}" }, "nested": { "CreateDocumentMetadata": { @@ -1886,7 +1886,8 @@ "FILE_TYPE_UNSPECIFIED": 0, "ALL": 1, "FOLDER": 2, - "DOCUMENT": 3 + "DOCUMENT": 3, + "ROOT_FOLDER": 4 } } } @@ -2478,6 +2479,13 @@ "options": { "(google.api.field_behavior)": "OPTIONAL" } + }, + "cloudFunction": { + "type": "string", + "id": 4, + "options": { + "(google.api.resource_reference).type": "cloudfunctions.googleapis.com/CloudFunction" + } } } }, diff --git a/packages/google-cloud-contentwarehouse/samples/generated/v1/snippet_metadata.google.cloud.contentwarehouse.v1.json b/packages/google-cloud-contentwarehouse/samples/generated/v1/snippet_metadata.google.cloud.contentwarehouse.v1.json index 0bb439559ee..78c35801ed6 100644 --- a/packages/google-cloud-contentwarehouse/samples/generated/v1/snippet_metadata.google.cloud.contentwarehouse.v1.json +++ b/packages/google-cloud-contentwarehouse/samples/generated/v1/snippet_metadata.google.cloud.contentwarehouse.v1.json @@ -1,7 +1,7 @@ { "clientLibrary": { "name": "nodejs-contentwarehouse", - "version": "1.1.0", + "version": "1.2.0", "language": "TYPESCRIPT", "apis": [ { diff --git a/packages/google-cloud-contentwarehouse/samples/generated/v1/snippet_metadata_google.cloud.contentwarehouse.v1.json b/packages/google-cloud-contentwarehouse/samples/generated/v1/snippet_metadata_google.cloud.contentwarehouse.v1.json index c2b74f68fba..7793e713dfd 100644 --- a/packages/google-cloud-contentwarehouse/samples/generated/v1/snippet_metadata_google.cloud.contentwarehouse.v1.json +++ b/packages/google-cloud-contentwarehouse/samples/generated/v1/snippet_metadata_google.cloud.contentwarehouse.v1.json @@ -1,7 +1,7 @@ { "clientLibrary": { "name": "nodejs-contentwarehouse", - "version": "1.1.0", + "version": "1.2.0", "language": "TYPESCRIPT", "apis": [ { diff --git a/packages/google-cloud-contentwarehouse/samples/package.json b/packages/google-cloud-contentwarehouse/samples/package.json index 7e2ec5acad6..039c8eb768d 100644 --- a/packages/google-cloud-contentwarehouse/samples/package.json +++ b/packages/google-cloud-contentwarehouse/samples/package.json @@ -14,7 +14,7 @@ "publish": "echo 'sample test; do not publish'" }, "dependencies": { - "@google-cloud/contentwarehouse": "^1.1.0" + "@google-cloud/contentwarehouse": "^1.2.0" }, "devDependencies": { "c8": "^7.1.0", diff --git a/packages/google-cloud-dataform/CHANGELOG.md b/packages/google-cloud-dataform/CHANGELOG.md index d642494bb05..e1455e707a5 100644 --- a/packages/google-cloud-dataform/CHANGELOG.md +++ b/packages/google-cloud-dataform/CHANGELOG.md @@ -1,5 +1,92 @@ # Changelog +## [1.0.2](https://github.com/googleapis/google-cloud-node/compare/dataform-v1.0.1...dataform-v1.0.2) (2023-09-19) + + +### ⚠ BREAKING CHANGES + +* migrate to Node 14 ([#4443](https://github.com/googleapis/google-cloud-node/issues/4443)) + +### Bug Fixes + +* [Many APIs] fix typings for IAM methods ([#4460](https://github.com/googleapis/google-cloud-node/issues/4460)) ([c32965c](https://github.com/googleapis/google-cloud-node/commit/c32965c0c4a5975ba37371ecd819d9cffb080aa5)) +* [Many APIs] simplify logic for HTTP/1.1 REST fallback option ([#4585](https://github.com/googleapis/google-cloud-node/issues/4585)) ([b6cea45](https://github.com/googleapis/google-cloud-node/commit/b6cea45d03faaa7bd6e5daa36ebd0063a1e1f251)) +* Dataform version ([240a69f](https://github.com/googleapis/google-cloud-node/commit/240a69f10d1d5e3fe45169dedfc5f1c2d6492df9)) +* **deps:** Bump `google-gax` to ^3.5.8 ([#4117](https://github.com/googleapis/google-cloud-node/issues/4117)) ([0b67d88](https://github.com/googleapis/google-cloud-node/commit/0b67d883963643ce1b4f6d2ccd3e8d37adf6e029)) +* **deps:** Update dependency @google-cloud/dataform to v1 ([#4532](https://github.com/googleapis/google-cloud-node/issues/4532)) ([a4507aa](https://github.com/googleapis/google-cloud-node/commit/a4507aa1166832c2d9624cb55879a543f65ec4cb)) +* **deps:** Update dependency @google-cloud/dataform to v1 ([#4631](https://github.com/googleapis/google-cloud-node/issues/4631)) ([7d4c40f](https://github.com/googleapis/google-cloud-node/commit/7d4c40ffab7fe98257560f2986acfcb888f15747)) +* Minify JSON and JS files, and remove .map files ([#4143](https://github.com/googleapis/google-cloud-node/issues/4143)) ([170f7d5](https://github.com/googleapis/google-cloud-node/commit/170f7d57b8fd344d182a8e758867b8124722eebc)) + + +### Miscellaneous Chores + +* Migrate to Node 14 ([#4443](https://github.com/googleapis/google-cloud-node/issues/4443)) ([2260f12](https://github.com/googleapis/google-cloud-node/commit/2260f12543d171bda95345e53475f5f0fdc45770)) + +## [1.0.1](https://github.com/googleapis/google-cloud-node/compare/dataform-v0.4.1...dataform-v1.0.1) (2023-09-19) + + +### ⚠ BREAKING CHANGES + +* migrate to Node 14 ([#4443](https://github.com/googleapis/google-cloud-node/issues/4443)) + +### Bug Fixes + +* [Many APIs] fix typings for IAM methods ([#4460](https://github.com/googleapis/google-cloud-node/issues/4460)) ([c32965c](https://github.com/googleapis/google-cloud-node/commit/c32965c0c4a5975ba37371ecd819d9cffb080aa5)) +* [Many APIs] simplify logic for HTTP/1.1 REST fallback option ([#4585](https://github.com/googleapis/google-cloud-node/issues/4585)) ([b6cea45](https://github.com/googleapis/google-cloud-node/commit/b6cea45d03faaa7bd6e5daa36ebd0063a1e1f251)) +* Dataform version ([240a69f](https://github.com/googleapis/google-cloud-node/commit/240a69f10d1d5e3fe45169dedfc5f1c2d6492df9)) +* **deps:** Bump `google-gax` to ^3.5.8 ([#4117](https://github.com/googleapis/google-cloud-node/issues/4117)) ([0b67d88](https://github.com/googleapis/google-cloud-node/commit/0b67d883963643ce1b4f6d2ccd3e8d37adf6e029)) +* **deps:** Update dependency @google-cloud/dataform to v1 ([#4532](https://github.com/googleapis/google-cloud-node/issues/4532)) ([a4507aa](https://github.com/googleapis/google-cloud-node/commit/a4507aa1166832c2d9624cb55879a543f65ec4cb)) +* **deps:** Update dependency @google-cloud/dataform to v1 ([#4631](https://github.com/googleapis/google-cloud-node/issues/4631)) ([7d4c40f](https://github.com/googleapis/google-cloud-node/commit/7d4c40ffab7fe98257560f2986acfcb888f15747)) +* Minify JSON and JS files, and remove .map files ([#4143](https://github.com/googleapis/google-cloud-node/issues/4143)) ([170f7d5](https://github.com/googleapis/google-cloud-node/commit/170f7d57b8fd344d182a8e758867b8124722eebc)) + + +### Miscellaneous Chores + +* Migrate to Node 14 ([#4443](https://github.com/googleapis/google-cloud-node/issues/4443)) ([2260f12](https://github.com/googleapis/google-cloud-node/commit/2260f12543d171bda95345e53475f5f0fdc45770)) + +## [0.4.1](https://github.com/googleapis/google-cloud-node/compare/dataform-v1.0.0...dataform-v0.4.1) (2023-09-14) + + +### ⚠ BREAKING CHANGES + +* migrate to Node 14 ([#4443](https://github.com/googleapis/google-cloud-node/issues/4443)) + +### Bug Fixes + +* [Many APIs] fix typings for IAM methods ([#4460](https://github.com/googleapis/google-cloud-node/issues/4460)) ([c32965c](https://github.com/googleapis/google-cloud-node/commit/c32965c0c4a5975ba37371ecd819d9cffb080aa5)) +* [Many APIs] simplify logic for HTTP/1.1 REST fallback option ([#4585](https://github.com/googleapis/google-cloud-node/issues/4585)) ([b6cea45](https://github.com/googleapis/google-cloud-node/commit/b6cea45d03faaa7bd6e5daa36ebd0063a1e1f251)) +* **deps:** Bump `google-gax` to ^3.5.8 ([#4117](https://github.com/googleapis/google-cloud-node/issues/4117)) ([0b67d88](https://github.com/googleapis/google-cloud-node/commit/0b67d883963643ce1b4f6d2ccd3e8d37adf6e029)) +* **deps:** Update dependency @google-cloud/dataform to v1 ([#4532](https://github.com/googleapis/google-cloud-node/issues/4532)) ([a4507aa](https://github.com/googleapis/google-cloud-node/commit/a4507aa1166832c2d9624cb55879a543f65ec4cb)) +* **deps:** Update dependency @google-cloud/dataform to v1 ([#4631](https://github.com/googleapis/google-cloud-node/issues/4631)) ([7d4c40f](https://github.com/googleapis/google-cloud-node/commit/7d4c40ffab7fe98257560f2986acfcb888f15747)) +* Minify JSON and JS files, and remove .map files ([#4143](https://github.com/googleapis/google-cloud-node/issues/4143)) ([170f7d5](https://github.com/googleapis/google-cloud-node/commit/170f7d57b8fd344d182a8e758867b8124722eebc)) +* Revert package.json version ([65ee10e](https://github.com/googleapis/google-cloud-node/commit/65ee10e09d7c69e00bdfd7be2a591c866873ceda)) + + +### Miscellaneous Chores + +* Migrate to Node 14 ([#4443](https://github.com/googleapis/google-cloud-node/issues/4443)) ([2260f12](https://github.com/googleapis/google-cloud-node/commit/2260f12543d171bda95345e53475f5f0fdc45770)) + +## [1.0.0](https://github.com/googleapis/google-cloud-node/compare/dataform-v0.4.1...dataform-v1.0.0) (2023-09-11) + + +### ⚠ BREAKING CHANGES + +* migrate to Node 14 ([#4443](https://github.com/googleapis/google-cloud-node/issues/4443)) + +### Bug Fixes + +* [Many APIs] fix typings for IAM methods ([#4460](https://github.com/googleapis/google-cloud-node/issues/4460)) ([c32965c](https://github.com/googleapis/google-cloud-node/commit/c32965c0c4a5975ba37371ecd819d9cffb080aa5)) +* [Many APIs] simplify logic for HTTP/1.1 REST fallback option ([#4585](https://github.com/googleapis/google-cloud-node/issues/4585)) ([b6cea45](https://github.com/googleapis/google-cloud-node/commit/b6cea45d03faaa7bd6e5daa36ebd0063a1e1f251)) +* **deps:** Bump `google-gax` to ^3.5.8 ([#4117](https://github.com/googleapis/google-cloud-node/issues/4117)) ([0b67d88](https://github.com/googleapis/google-cloud-node/commit/0b67d883963643ce1b4f6d2ccd3e8d37adf6e029)) +* **deps:** Update dependency @google-cloud/dataform to v1 ([#4532](https://github.com/googleapis/google-cloud-node/issues/4532)) ([a4507aa](https://github.com/googleapis/google-cloud-node/commit/a4507aa1166832c2d9624cb55879a543f65ec4cb)) +* **deps:** Update dependency @google-cloud/dataform to v1 ([#4631](https://github.com/googleapis/google-cloud-node/issues/4631)) ([7d4c40f](https://github.com/googleapis/google-cloud-node/commit/7d4c40ffab7fe98257560f2986acfcb888f15747)) +* Minify JSON and JS files, and remove .map files ([#4143](https://github.com/googleapis/google-cloud-node/issues/4143)) ([170f7d5](https://github.com/googleapis/google-cloud-node/commit/170f7d57b8fd344d182a8e758867b8124722eebc)) + + +### Miscellaneous Chores + +* Migrate to Node 14 ([#4443](https://github.com/googleapis/google-cloud-node/issues/4443)) ([2260f12](https://github.com/googleapis/google-cloud-node/commit/2260f12543d171bda95345e53475f5f0fdc45770)) + ## [0.4.1](https://github.com/googleapis/google-cloud-node/compare/dataform-v1.0.0...dataform-v0.4.1) (2023-09-08) diff --git a/packages/google-cloud-dataform/package.json b/packages/google-cloud-dataform/package.json index 4b9d7e44862..04a22958229 100644 --- a/packages/google-cloud-dataform/package.json +++ b/packages/google-cloud-dataform/package.json @@ -1,6 +1,6 @@ { "name": "@google-cloud/dataform", - "version": "0.4.1", + "version": "1.0.2", "description": "dataform client for Node.js", "repository": { "type": "git", diff --git a/packages/google-cloud-dataform/samples/generated/v1alpha2/snippet_metadata.google.cloud.dataform.v1alpha2.json b/packages/google-cloud-dataform/samples/generated/v1alpha2/snippet_metadata.google.cloud.dataform.v1alpha2.json index cb28b997e36..dfba67575f0 100644 --- a/packages/google-cloud-dataform/samples/generated/v1alpha2/snippet_metadata.google.cloud.dataform.v1alpha2.json +++ b/packages/google-cloud-dataform/samples/generated/v1alpha2/snippet_metadata.google.cloud.dataform.v1alpha2.json @@ -1,7 +1,7 @@ { "clientLibrary": { "name": "nodejs-dataform", - "version": "0.4.1", + "version": "1.0.2", "language": "TYPESCRIPT", "apis": [ { diff --git a/packages/google-cloud-dataform/samples/generated/v1alpha2/snippet_metadata_google.cloud.dataform.v1alpha2.json b/packages/google-cloud-dataform/samples/generated/v1alpha2/snippet_metadata_google.cloud.dataform.v1alpha2.json index cb28b997e36..dfba67575f0 100644 --- a/packages/google-cloud-dataform/samples/generated/v1alpha2/snippet_metadata_google.cloud.dataform.v1alpha2.json +++ b/packages/google-cloud-dataform/samples/generated/v1alpha2/snippet_metadata_google.cloud.dataform.v1alpha2.json @@ -1,7 +1,7 @@ { "clientLibrary": { "name": "nodejs-dataform", - "version": "0.4.1", + "version": "1.0.2", "language": "TYPESCRIPT", "apis": [ { diff --git a/packages/google-cloud-dataform/samples/generated/v1beta1/snippet_metadata.google.cloud.dataform.v1beta1.json b/packages/google-cloud-dataform/samples/generated/v1beta1/snippet_metadata.google.cloud.dataform.v1beta1.json index e48562ca65d..0d40643271d 100644 --- a/packages/google-cloud-dataform/samples/generated/v1beta1/snippet_metadata.google.cloud.dataform.v1beta1.json +++ b/packages/google-cloud-dataform/samples/generated/v1beta1/snippet_metadata.google.cloud.dataform.v1beta1.json @@ -1,7 +1,7 @@ { "clientLibrary": { "name": "nodejs-dataform", - "version": "0.4.1", + "version": "1.0.2", "language": "TYPESCRIPT", "apis": [ { diff --git a/packages/google-cloud-dataform/samples/generated/v1beta1/snippet_metadata_google.cloud.dataform.v1beta1.json b/packages/google-cloud-dataform/samples/generated/v1beta1/snippet_metadata_google.cloud.dataform.v1beta1.json index e48562ca65d..0d40643271d 100644 --- a/packages/google-cloud-dataform/samples/generated/v1beta1/snippet_metadata_google.cloud.dataform.v1beta1.json +++ b/packages/google-cloud-dataform/samples/generated/v1beta1/snippet_metadata_google.cloud.dataform.v1beta1.json @@ -1,7 +1,7 @@ { "clientLibrary": { "name": "nodejs-dataform", - "version": "0.4.1", + "version": "1.0.2", "language": "TYPESCRIPT", "apis": [ { diff --git a/packages/google-cloud-dataform/samples/package.json b/packages/google-cloud-dataform/samples/package.json index 23e6036417d..086d051b6c3 100644 --- a/packages/google-cloud-dataform/samples/package.json +++ b/packages/google-cloud-dataform/samples/package.json @@ -13,7 +13,7 @@ "test": "c8 mocha --timeout 600000 test/*.js" }, "dependencies": { - "@google-cloud/dataform": "^0.4.1" + "@google-cloud/dataform": "^1.0.2" }, "devDependencies": { "c8": "^7.1.0", diff --git a/packages/google-cloud-dataplex/CHANGELOG.md b/packages/google-cloud-dataplex/CHANGELOG.md index 035f721640f..8d1623e6afa 100644 --- a/packages/google-cloud-dataplex/CHANGELOG.md +++ b/packages/google-cloud-dataplex/CHANGELOG.md @@ -1,5 +1,12 @@ # Changelog +## [3.1.0](https://github.com/googleapis/google-cloud-node/compare/dataplex-v3.0.1...dataplex-v3.1.0) (2023-09-20) + + +### Features + +* [dataplex] additional HTTP bindings for IAM methods ([#4683](https://github.com/googleapis/google-cloud-node/issues/4683)) ([fb6e827](https://github.com/googleapis/google-cloud-node/commit/fb6e827399bad7b39d3a058c2eb8ad2275e967d1)) + ## [3.0.1](https://github.com/googleapis/google-cloud-node/compare/dataplex-v3.0.0...dataplex-v3.0.1) (2023-09-06) diff --git a/packages/google-cloud-dataplex/package.json b/packages/google-cloud-dataplex/package.json index 817b6824354..0af83e8b396 100644 --- a/packages/google-cloud-dataplex/package.json +++ b/packages/google-cloud-dataplex/package.json @@ -1,6 +1,6 @@ { "name": "@google-cloud/dataplex", - "version": "3.0.1", + "version": "3.1.0", "description": "dataplex client for Node.js", "repository": { "type": "git", diff --git a/packages/google-cloud-dataplex/samples/generated/v1/snippet_metadata.google.cloud.dataplex.v1.json b/packages/google-cloud-dataplex/samples/generated/v1/snippet_metadata.google.cloud.dataplex.v1.json index aac8eefae64..0ddb2d50fe5 100644 --- a/packages/google-cloud-dataplex/samples/generated/v1/snippet_metadata.google.cloud.dataplex.v1.json +++ b/packages/google-cloud-dataplex/samples/generated/v1/snippet_metadata.google.cloud.dataplex.v1.json @@ -1,7 +1,7 @@ { "clientLibrary": { "name": "nodejs-dataplex", - "version": "3.0.1", + "version": "3.1.0", "language": "TYPESCRIPT", "apis": [ { diff --git a/packages/google-cloud-dataplex/samples/generated/v1/snippet_metadata_google.cloud.dataplex.v1.json b/packages/google-cloud-dataplex/samples/generated/v1/snippet_metadata_google.cloud.dataplex.v1.json index aac8eefae64..0ddb2d50fe5 100644 --- a/packages/google-cloud-dataplex/samples/generated/v1/snippet_metadata_google.cloud.dataplex.v1.json +++ b/packages/google-cloud-dataplex/samples/generated/v1/snippet_metadata_google.cloud.dataplex.v1.json @@ -1,7 +1,7 @@ { "clientLibrary": { "name": "nodejs-dataplex", - "version": "3.0.1", + "version": "3.1.0", "language": "TYPESCRIPT", "apis": [ { diff --git a/packages/google-cloud-dataplex/samples/package.json b/packages/google-cloud-dataplex/samples/package.json index 854ba32278a..3ce9fd34c9d 100644 --- a/packages/google-cloud-dataplex/samples/package.json +++ b/packages/google-cloud-dataplex/samples/package.json @@ -13,7 +13,7 @@ "test": "c8 mocha --timeout 600000 test/*.js" }, "dependencies": { - "@google-cloud/dataplex": "^3.0.1" + "@google-cloud/dataplex": "^3.1.0" }, "devDependencies": { "c8": "^7.1.0", diff --git a/packages/google-cloud-dataplex/src/v1/content_service_client.ts b/packages/google-cloud-dataplex/src/v1/content_service_client.ts index a17cde443d1..a62449249a5 100644 --- a/packages/google-cloud-dataplex/src/v1/content_service_client.ts +++ b/packages/google-cloud-dataplex/src/v1/content_service_client.ts @@ -311,6 +311,9 @@ export class ContentServiceClient { { get: '/v1/{resource=projects/*/locations/*/entryGroups/*}:getIamPolicy', }, + { + get: '/v1/{resource=projects/*/locations/*/governanceRules/*}:getIamPolicy', + }, ], }, { @@ -362,6 +365,10 @@ export class ContentServiceClient { post: '/v1/{resource=projects/*/locations/*/entryGroups/*}:setIamPolicy', body: '*', }, + { + post: '/v1/{resource=projects/*/locations/*/governanceRules/*}:setIamPolicy', + body: '*', + }, ], }, { @@ -413,6 +420,10 @@ export class ContentServiceClient { post: '/v1/{resource=projects/*/locations/*/entryGroups/*}:testIamPermissions', body: '*', }, + { + post: '/v1/{resource=projects/*/locations/*/governanceRules/*}:testIamPermissions', + body: '*', + }, ], }, { diff --git a/packages/google-cloud-dataplex/src/v1/data_scan_service_client.ts b/packages/google-cloud-dataplex/src/v1/data_scan_service_client.ts index 0bef2d45d69..93188a04a43 100644 --- a/packages/google-cloud-dataplex/src/v1/data_scan_service_client.ts +++ b/packages/google-cloud-dataplex/src/v1/data_scan_service_client.ts @@ -322,6 +322,9 @@ export class DataScanServiceClient { { get: '/v1/{resource=projects/*/locations/*/entryGroups/*}:getIamPolicy', }, + { + get: '/v1/{resource=projects/*/locations/*/governanceRules/*}:getIamPolicy', + }, ], }, { @@ -373,6 +376,10 @@ export class DataScanServiceClient { post: '/v1/{resource=projects/*/locations/*/entryGroups/*}:setIamPolicy', body: '*', }, + { + post: '/v1/{resource=projects/*/locations/*/governanceRules/*}:setIamPolicy', + body: '*', + }, ], }, { @@ -424,6 +431,10 @@ export class DataScanServiceClient { post: '/v1/{resource=projects/*/locations/*/entryGroups/*}:testIamPermissions', body: '*', }, + { + post: '/v1/{resource=projects/*/locations/*/governanceRules/*}:testIamPermissions', + body: '*', + }, ], }, { diff --git a/packages/google-cloud-dataplex/src/v1/data_taxonomy_service_client.ts b/packages/google-cloud-dataplex/src/v1/data_taxonomy_service_client.ts index 055438e155f..53528ff455d 100644 --- a/packages/google-cloud-dataplex/src/v1/data_taxonomy_service_client.ts +++ b/packages/google-cloud-dataplex/src/v1/data_taxonomy_service_client.ts @@ -326,6 +326,9 @@ export class DataTaxonomyServiceClient { { get: '/v1/{resource=projects/*/locations/*/entryGroups/*}:getIamPolicy', }, + { + get: '/v1/{resource=projects/*/locations/*/governanceRules/*}:getIamPolicy', + }, ], }, { @@ -377,6 +380,10 @@ export class DataTaxonomyServiceClient { post: '/v1/{resource=projects/*/locations/*/entryGroups/*}:setIamPolicy', body: '*', }, + { + post: '/v1/{resource=projects/*/locations/*/governanceRules/*}:setIamPolicy', + body: '*', + }, ], }, { @@ -428,6 +435,10 @@ export class DataTaxonomyServiceClient { post: '/v1/{resource=projects/*/locations/*/entryGroups/*}:testIamPermissions', body: '*', }, + { + post: '/v1/{resource=projects/*/locations/*/governanceRules/*}:testIamPermissions', + body: '*', + }, ], }, { diff --git a/packages/google-cloud-dataplex/src/v1/dataplex_service_client.ts b/packages/google-cloud-dataplex/src/v1/dataplex_service_client.ts index 1f0d21147ce..67c41c7eaaa 100644 --- a/packages/google-cloud-dataplex/src/v1/dataplex_service_client.ts +++ b/packages/google-cloud-dataplex/src/v1/dataplex_service_client.ts @@ -364,6 +364,9 @@ export class DataplexServiceClient { { get: '/v1/{resource=projects/*/locations/*/entryGroups/*}:getIamPolicy', }, + { + get: '/v1/{resource=projects/*/locations/*/governanceRules/*}:getIamPolicy', + }, ], }, { @@ -415,6 +418,10 @@ export class DataplexServiceClient { post: '/v1/{resource=projects/*/locations/*/entryGroups/*}:setIamPolicy', body: '*', }, + { + post: '/v1/{resource=projects/*/locations/*/governanceRules/*}:setIamPolicy', + body: '*', + }, ], }, { @@ -466,6 +473,10 @@ export class DataplexServiceClient { post: '/v1/{resource=projects/*/locations/*/entryGroups/*}:testIamPermissions', body: '*', }, + { + post: '/v1/{resource=projects/*/locations/*/governanceRules/*}:testIamPermissions', + body: '*', + }, ], }, { diff --git a/packages/google-cloud-dataplex/src/v1/metadata_service_client.ts b/packages/google-cloud-dataplex/src/v1/metadata_service_client.ts index fd7a194abcd..5e1ac395446 100644 --- a/packages/google-cloud-dataplex/src/v1/metadata_service_client.ts +++ b/packages/google-cloud-dataplex/src/v1/metadata_service_client.ts @@ -317,6 +317,9 @@ export class MetadataServiceClient { { get: '/v1/{resource=projects/*/locations/*/entryGroups/*}:getIamPolicy', }, + { + get: '/v1/{resource=projects/*/locations/*/governanceRules/*}:getIamPolicy', + }, ], }, { @@ -368,6 +371,10 @@ export class MetadataServiceClient { post: '/v1/{resource=projects/*/locations/*/entryGroups/*}:setIamPolicy', body: '*', }, + { + post: '/v1/{resource=projects/*/locations/*/governanceRules/*}:setIamPolicy', + body: '*', + }, ], }, { @@ -419,6 +426,10 @@ export class MetadataServiceClient { post: '/v1/{resource=projects/*/locations/*/entryGroups/*}:testIamPermissions', body: '*', }, + { + post: '/v1/{resource=projects/*/locations/*/governanceRules/*}:testIamPermissions', + body: '*', + }, ], }, { diff --git a/packages/google-cloud-dataproc/CHANGELOG.md b/packages/google-cloud-dataproc/CHANGELOG.md index a245c7cac4e..0a76d55ff7b 100644 --- a/packages/google-cloud-dataproc/CHANGELOG.md +++ b/packages/google-cloud-dataproc/CHANGELOG.md @@ -4,6 +4,13 @@ [1]: https://www.npmjs.com/package/@google-cloud/dataproc?activeTab=versions +## [5.2.0](https://github.com/googleapis/google-cloud-node/compare/dataproc-v5.1.0...dataproc-v5.2.0) (2023-09-19) + + +### Features + +* [dataproc] add optional parameters (tarball_gcs_dir, diagnosis_interval, jobs, yarn_application_ids) in DiagnoseClusterRequest ([#4661](https://github.com/googleapis/google-cloud-node/issues/4661)) ([9c2bd8e](https://github.com/googleapis/google-cloud-node/commit/9c2bd8e3675ef4021fe166a514e022fe70821f02)) + ## [5.1.0](https://github.com/googleapis/google-cloud-node/compare/dataproc-v5.0.0...dataproc-v5.1.0) (2023-09-06) diff --git a/packages/google-cloud-dataproc/package.json b/packages/google-cloud-dataproc/package.json index 115dba2739c..f6fc16410a2 100644 --- a/packages/google-cloud-dataproc/package.json +++ b/packages/google-cloud-dataproc/package.json @@ -1,7 +1,7 @@ { "name": "@google-cloud/dataproc", "description": "Google Cloud Dataproc API client for Node.js", - "version": "5.1.0", + "version": "5.2.0", "license": "Apache-2.0", "author": "Google Inc", "engines": { diff --git a/packages/google-cloud-dataproc/protos/google/cloud/dataproc/v1/clusters.proto b/packages/google-cloud-dataproc/protos/google/cloud/dataproc/v1/clusters.proto index 854a6059365..03a4e8d6006 100644 --- a/packages/google-cloud-dataproc/protos/google/cloud/dataproc/v1/clusters.proto +++ b/packages/google-cloud-dataproc/protos/google/cloud/dataproc/v1/clusters.proto @@ -25,6 +25,8 @@ import "google/longrunning/operations.proto"; import "google/protobuf/duration.proto"; import "google/protobuf/field_mask.proto"; import "google/protobuf/timestamp.proto"; +import "google/protobuf/wrappers.proto"; +import "google/type/interval.proto"; option go_package = "cloud.google.com/go/dataproc/v2/apiv1/dataprocpb;dataprocpb"; option java_multiple_files = true; @@ -671,22 +673,20 @@ message InstanceGroupConfig { // Platform](https://cloud.google.com/dataproc/docs/concepts/compute/dataproc-min-cpu). string min_cpu_platform = 9 [(google.api.field_behavior) = OPTIONAL]; - // Optional. The minimum number of instances to create. - // If min_num_instances is set, min_num_instances is used for a criteria to - // decide the cluster. Cluster creation will be failed by being an error state - // if the total number of instances created is less than the - // min_num_instances. - // For example, given that num_instances = 5 and min_num_instances = 3, - // * if 4 instances are created and then registered successfully but one - // instance is failed, the failed VM will be deleted and the cluster will be - // resized to 4 instances in running state. - // * if 2 instances are created successfully and 3 instances are failed, - // the cluster will be in an error state and does not delete failed VMs for - // debugging. - // * if 2 instance are created and then registered successfully but 3 - // instances are failed to initialize, the cluster will be in an error state - // and does not delete failed VMs for debugging. - // NB: This can only be set for primary workers now. + // Optional. The minimum number of primary worker instances to create. + // If `min_num_instances` is set, cluster creation will succeed if + // the number of primary workers created is at least equal to the + // `min_num_instances` number. + // + // Example: Cluster creation request with `num_instances` = `5` and + // `min_num_instances` = `3`: + // + // * If 4 VMs are created and 1 instance fails, + // the failed VM is deleted. The cluster is + // resized to 4 instances and placed in a `RUNNING` state. + // * If 2 instances are created and 3 instances fail, + // the cluster in placed in an `ERROR` state. The failed VMs + // are not deleted. int32 min_num_instances = 12 [(google.api.field_behavior) = OPTIONAL]; // Optional. Instance flexibility Policy allowing a mixture of VM shapes and @@ -843,12 +843,12 @@ message NodeGroup { pattern: "projects/{project}/regions/{region}/clusters/{cluster}/nodeGroups/{node_group}" }; - // Node group roles. + // Node pool roles. enum Role { // Required unspecified role. ROLE_UNSPECIFIED = 0; - // Job drivers run on the node group. + // Job drivers run on the node pool. DRIVER = 1; } @@ -1531,6 +1531,25 @@ message DiagnoseClusterRequest { // Required. The cluster name. string cluster_name = 2 [(google.api.field_behavior) = REQUIRED]; + + // Optional. The output Cloud Storage directory for the diagnostic + // tarball. If not specified, a task-specific directory in the cluster's + // staging bucket will be used. + string tarball_gcs_dir = 4 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Time interval in which diagnosis should be carried out on the + // cluster. + google.type.Interval diagnosis_interval = 6 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Specifies a list of jobs on which diagnosis is to be performed. + // Format: projects/{project}/regions/{region}/jobs/{job} + repeated string jobs = 10 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Specifies a list of yarn applications on which diagnosis is to be + // performed. + repeated string yarn_application_ids = 11 + [(google.api.field_behavior) = OPTIONAL]; } // The location of diagnostic output. diff --git a/packages/google-cloud-dataproc/protos/protos.d.ts b/packages/google-cloud-dataproc/protos/protos.d.ts index c391b761258..03ccf0259cc 100644 --- a/packages/google-cloud-dataproc/protos/protos.d.ts +++ b/packages/google-cloud-dataproc/protos/protos.d.ts @@ -9396,6 +9396,18 @@ export namespace google { /** DiagnoseClusterRequest clusterName */ clusterName?: (string|null); + + /** DiagnoseClusterRequest tarballGcsDir */ + tarballGcsDir?: (string|null); + + /** DiagnoseClusterRequest diagnosisInterval */ + diagnosisInterval?: (google.type.IInterval|null); + + /** DiagnoseClusterRequest jobs */ + jobs?: (string[]|null); + + /** DiagnoseClusterRequest yarnApplicationIds */ + yarnApplicationIds?: (string[]|null); } /** Represents a DiagnoseClusterRequest. */ @@ -9416,6 +9428,18 @@ export namespace google { /** DiagnoseClusterRequest clusterName. */ public clusterName: string; + /** DiagnoseClusterRequest tarballGcsDir. */ + public tarballGcsDir: string; + + /** DiagnoseClusterRequest diagnosisInterval. */ + public diagnosisInterval?: (google.type.IInterval|null); + + /** DiagnoseClusterRequest jobs. */ + public jobs: string[]; + + /** DiagnoseClusterRequest yarnApplicationIds. */ + public yarnApplicationIds: string[]; + /** * Creates a new DiagnoseClusterRequest instance using the specified properties. * @param [properties] Properties to set @@ -22685,372 +22709,1245 @@ export namespace google { */ public static getTypeUrl(typeUrlPrefix?: string): string; } - } - /** Namespace longrunning. */ - namespace longrunning { + /** Properties of a DoubleValue. */ + interface IDoubleValue { - /** Represents an Operations */ - class Operations extends $protobuf.rpc.Service { + /** DoubleValue value */ + value?: (number|null); + } + + /** Represents a DoubleValue. */ + class DoubleValue implements IDoubleValue { /** - * 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 + * Constructs a new DoubleValue. + * @param [properties] Properties to set */ - constructor(rpcImpl: $protobuf.RPCImpl, requestDelimited?: boolean, responseDelimited?: boolean); + constructor(properties?: google.protobuf.IDoubleValue); + + /** DoubleValue value. */ + public value: number; /** - * 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. + * Creates a new DoubleValue instance using the specified properties. + * @param [properties] Properties to set + * @returns DoubleValue instance */ - public static create(rpcImpl: $protobuf.RPCImpl, requestDelimited?: boolean, responseDelimited?: boolean): Operations; + public static create(properties?: google.protobuf.IDoubleValue): google.protobuf.DoubleValue; /** - * Calls ListOperations. - * @param request ListOperationsRequest message or plain object - * @param callback Node-style callback called with the error, if any, and ListOperationsResponse + * 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 listOperations(request: google.longrunning.IListOperationsRequest, callback: google.longrunning.Operations.ListOperationsCallback): void; + public static encode(message: google.protobuf.IDoubleValue, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Calls ListOperations. - * @param request ListOperationsRequest message or plain object - * @returns Promise + * 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 listOperations(request: google.longrunning.IListOperationsRequest): Promise; + public static encodeDelimited(message: google.protobuf.IDoubleValue, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Calls GetOperation. - * @param request GetOperationRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Operation + * 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 getOperation(request: google.longrunning.IGetOperationRequest, callback: google.longrunning.Operations.GetOperationCallback): void; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.DoubleValue; /** - * Calls GetOperation. - * @param request GetOperationRequest message or plain object - * @returns Promise + * 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 getOperation(request: google.longrunning.IGetOperationRequest): Promise; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.DoubleValue; /** - * Calls DeleteOperation. - * @param request DeleteOperationRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Empty + * Verifies a DoubleValue message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not */ - public deleteOperation(request: google.longrunning.IDeleteOperationRequest, callback: google.longrunning.Operations.DeleteOperationCallback): void; + public static verify(message: { [k: string]: any }): (string|null); /** - * Calls DeleteOperation. - * @param request DeleteOperationRequest message or plain object - * @returns Promise + * Creates a DoubleValue message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DoubleValue */ - public deleteOperation(request: google.longrunning.IDeleteOperationRequest): Promise; + public static fromObject(object: { [k: string]: any }): google.protobuf.DoubleValue; /** - * Calls CancelOperation. - * @param request CancelOperationRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Empty + * 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 cancelOperation(request: google.longrunning.ICancelOperationRequest, callback: google.longrunning.Operations.CancelOperationCallback): void; + public static toObject(message: google.protobuf.DoubleValue, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Calls CancelOperation. - * @param request CancelOperationRequest message or plain object - * @returns Promise + * Converts this DoubleValue to JSON. + * @returns JSON object */ - public cancelOperation(request: google.longrunning.ICancelOperationRequest): Promise; + public toJSON(): { [k: string]: any }; /** - * Calls WaitOperation. - * @param request WaitOperationRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Operation + * Gets the default type url for DoubleValue + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url */ - public waitOperation(request: google.longrunning.IWaitOperationRequest, callback: google.longrunning.Operations.WaitOperationCallback): void; + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a FloatValue. */ + interface IFloatValue { + + /** FloatValue value */ + value?: (number|null); + } + + /** Represents a FloatValue. */ + class FloatValue implements IFloatValue { /** - * Calls WaitOperation. - * @param request WaitOperationRequest message or plain object - * @returns Promise + * Constructs a new FloatValue. + * @param [properties] Properties to set */ - public waitOperation(request: google.longrunning.IWaitOperationRequest): Promise; - } + constructor(properties?: google.protobuf.IFloatValue); - namespace Operations { + /** FloatValue value. */ + public value: number; /** - * Callback as used by {@link google.longrunning.Operations|listOperations}. - * @param error Error, if any - * @param [response] ListOperationsResponse + * Creates a new FloatValue instance using the specified properties. + * @param [properties] Properties to set + * @returns FloatValue instance */ - type ListOperationsCallback = (error: (Error|null), response?: google.longrunning.ListOperationsResponse) => void; + public static create(properties?: google.protobuf.IFloatValue): google.protobuf.FloatValue; /** - * Callback as used by {@link google.longrunning.Operations|getOperation}. - * @param error Error, if any - * @param [response] Operation + * 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 */ - type GetOperationCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + public static encode(message: google.protobuf.IFloatValue, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Callback as used by {@link google.longrunning.Operations|deleteOperation}. - * @param error Error, if any - * @param [response] Empty + * 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 */ - type DeleteOperationCallback = (error: (Error|null), response?: google.protobuf.Empty) => void; + public static encodeDelimited(message: google.protobuf.IFloatValue, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Callback as used by {@link google.longrunning.Operations|cancelOperation}. - * @param error Error, if any - * @param [response] Empty + * 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 */ - type CancelOperationCallback = (error: (Error|null), response?: google.protobuf.Empty) => void; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.FloatValue; /** - * Callback as used by {@link google.longrunning.Operations|waitOperation}. - * @param error Error, if any - * @param [response] Operation + * 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 */ - type WaitOperationCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; - } + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.FloatValue; - /** Properties of an Operation. */ - interface IOperation { + /** + * 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); - /** Operation name */ - name?: (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; - /** Operation metadata */ - metadata?: (google.protobuf.IAny|null); + /** + * 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 }; - /** Operation done */ - done?: (boolean|null); + /** + * Converts this FloatValue to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; - /** Operation error */ - error?: (google.rpc.IStatus|null); + /** + * 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; + } - /** Operation response */ - response?: (google.protobuf.IAny|null); + /** Properties of an Int64Value. */ + interface IInt64Value { + + /** Int64Value value */ + value?: (number|Long|string|null); } - /** Represents an Operation. */ - class Operation implements IOperation { + /** Represents an Int64Value. */ + class Int64Value implements IInt64Value { /** - * Constructs a new Operation. + * Constructs a new Int64Value. * @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); + constructor(properties?: google.protobuf.IInt64Value); - /** Operation result. */ - public result?: ("error"|"response"); + /** Int64Value value. */ + public value: (number|Long|string); /** - * Creates a new Operation instance using the specified properties. + * Creates a new Int64Value instance using the specified properties. * @param [properties] Properties to set - * @returns Operation instance + * @returns Int64Value instance */ - public static create(properties?: google.longrunning.IOperation): google.longrunning.Operation; + public static create(properties?: google.protobuf.IInt64Value): google.protobuf.Int64Value; /** - * Encodes the specified Operation message. Does not implicitly {@link google.longrunning.Operation.verify|verify} messages. - * @param message Operation message or plain object to encode + * 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.longrunning.IOperation, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.protobuf.IInt64Value, 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 + * 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.longrunning.IOperation, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.protobuf.IInt64Value, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes an Operation message from the specified reader or buffer. + * 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 Operation + * @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.longrunning.Operation; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.Int64Value; /** - * Decodes an Operation message from the specified reader or buffer, length delimited. + * Decodes an Int64Value message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns Operation + * @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.longrunning.Operation; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.Int64Value; /** - * Verifies an Operation message. + * 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 Operation message from a plain object. Also converts values to their respective internal types. + * Creates an Int64Value message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns Operation + * @returns Int64Value */ - public static fromObject(object: { [k: string]: any }): google.longrunning.Operation; + public static fromObject(object: { [k: string]: any }): google.protobuf.Int64Value; /** - * Creates a plain object from an Operation message. Also converts values to other types if specified. - * @param message Operation + * 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.longrunning.Operation, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.protobuf.Int64Value, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this Operation to JSON. + * Converts this Int64Value to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; /** - * Gets the default type url for Operation + * 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 GetOperationRequest. */ - interface IGetOperationRequest { + /** Properties of a UInt64Value. */ + interface IUInt64Value { - /** GetOperationRequest name */ - name?: (string|null); + /** UInt64Value value */ + value?: (number|Long|string|null); } - /** Represents a GetOperationRequest. */ - class GetOperationRequest implements IGetOperationRequest { + /** Represents a UInt64Value. */ + class UInt64Value implements IUInt64Value { /** - * Constructs a new GetOperationRequest. + * Constructs a new UInt64Value. * @param [properties] Properties to set */ - constructor(properties?: google.longrunning.IGetOperationRequest); + constructor(properties?: google.protobuf.IUInt64Value); - /** GetOperationRequest name. */ - public name: string; + /** UInt64Value value. */ + public value: (number|Long|string); /** - * Creates a new GetOperationRequest instance using the specified properties. + * Creates a new UInt64Value instance using the specified properties. * @param [properties] Properties to set - * @returns GetOperationRequest instance + * @returns UInt64Value instance */ - public static create(properties?: google.longrunning.IGetOperationRequest): google.longrunning.GetOperationRequest; + public static create(properties?: google.protobuf.IUInt64Value): google.protobuf.UInt64Value; /** - * Encodes the specified GetOperationRequest message. Does not implicitly {@link google.longrunning.GetOperationRequest.verify|verify} messages. - * @param message GetOperationRequest message or plain object to encode + * 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.longrunning.IGetOperationRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.protobuf.IUInt64Value, 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 + * 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.longrunning.IGetOperationRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.protobuf.IUInt64Value, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a GetOperationRequest message from the specified reader or buffer. + * 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 GetOperationRequest + * @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.longrunning.GetOperationRequest; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.UInt64Value; /** - * Decodes a GetOperationRequest message from the specified reader or buffer, length delimited. + * Decodes a UInt64Value message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns GetOperationRequest + * @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.longrunning.GetOperationRequest; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.UInt64Value; /** - * Verifies a GetOperationRequest message. + * 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 GetOperationRequest message from a plain object. Also converts values to their respective internal types. + * Creates a UInt64Value message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns GetOperationRequest + * @returns UInt64Value */ - public static fromObject(object: { [k: string]: any }): google.longrunning.GetOperationRequest; + public static fromObject(object: { [k: string]: any }): google.protobuf.UInt64Value; /** - * Creates a plain object from a GetOperationRequest message. Also converts values to other types if specified. - * @param message GetOperationRequest + * 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.longrunning.GetOperationRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.protobuf.UInt64Value, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this GetOperationRequest to JSON. + * Converts this UInt64Value to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; /** - * Gets the default type url for GetOperationRequest + * 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 a ListOperationsRequest. */ - interface IListOperationsRequest { - - /** ListOperationsRequest name */ - name?: (string|null); + /** Properties of an Int32Value. */ + interface IInt32Value { - /** ListOperationsRequest filter */ - filter?: (string|null); + /** Int32Value value */ + value?: (number|null); + } - /** ListOperationsRequest pageSize */ - pageSize?: (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|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|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; + } + } + + /** 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); @@ -23771,4 +24668,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-cloud-dataproc/protos/protos.js b/packages/google-cloud-dataproc/protos/protos.js index 253586cb239..fcb7b9969de 100644 --- a/packages/google-cloud-dataproc/protos/protos.js +++ b/packages/google-cloud-dataproc/protos/protos.js @@ -24027,6 +24027,10 @@ * @property {string|null} [projectId] DiagnoseClusterRequest projectId * @property {string|null} [region] DiagnoseClusterRequest region * @property {string|null} [clusterName] DiagnoseClusterRequest clusterName + * @property {string|null} [tarballGcsDir] DiagnoseClusterRequest tarballGcsDir + * @property {google.type.IInterval|null} [diagnosisInterval] DiagnoseClusterRequest diagnosisInterval + * @property {Array.|null} [jobs] DiagnoseClusterRequest jobs + * @property {Array.|null} [yarnApplicationIds] DiagnoseClusterRequest yarnApplicationIds */ /** @@ -24038,6 +24042,8 @@ * @param {google.cloud.dataproc.v1.IDiagnoseClusterRequest=} [properties] Properties to set */ function DiagnoseClusterRequest(properties) { + this.jobs = []; + this.yarnApplicationIds = []; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -24068,6 +24074,38 @@ */ DiagnoseClusterRequest.prototype.clusterName = ""; + /** + * DiagnoseClusterRequest tarballGcsDir. + * @member {string} tarballGcsDir + * @memberof google.cloud.dataproc.v1.DiagnoseClusterRequest + * @instance + */ + DiagnoseClusterRequest.prototype.tarballGcsDir = ""; + + /** + * DiagnoseClusterRequest diagnosisInterval. + * @member {google.type.IInterval|null|undefined} diagnosisInterval + * @memberof google.cloud.dataproc.v1.DiagnoseClusterRequest + * @instance + */ + DiagnoseClusterRequest.prototype.diagnosisInterval = null; + + /** + * DiagnoseClusterRequest jobs. + * @member {Array.} jobs + * @memberof google.cloud.dataproc.v1.DiagnoseClusterRequest + * @instance + */ + DiagnoseClusterRequest.prototype.jobs = $util.emptyArray; + + /** + * DiagnoseClusterRequest yarnApplicationIds. + * @member {Array.} yarnApplicationIds + * @memberof google.cloud.dataproc.v1.DiagnoseClusterRequest + * @instance + */ + DiagnoseClusterRequest.prototype.yarnApplicationIds = $util.emptyArray; + /** * Creates a new DiagnoseClusterRequest instance using the specified properties. * @function create @@ -24098,6 +24136,16 @@ writer.uint32(/* id 2, wireType 2 =*/18).string(message.clusterName); if (message.region != null && Object.hasOwnProperty.call(message, "region")) writer.uint32(/* id 3, wireType 2 =*/26).string(message.region); + if (message.tarballGcsDir != null && Object.hasOwnProperty.call(message, "tarballGcsDir")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.tarballGcsDir); + if (message.diagnosisInterval != null && Object.hasOwnProperty.call(message, "diagnosisInterval")) + $root.google.type.Interval.encode(message.diagnosisInterval, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + if (message.jobs != null && message.jobs.length) + for (var i = 0; i < message.jobs.length; ++i) + writer.uint32(/* id 10, wireType 2 =*/82).string(message.jobs[i]); + if (message.yarnApplicationIds != null && message.yarnApplicationIds.length) + for (var i = 0; i < message.yarnApplicationIds.length; ++i) + writer.uint32(/* id 11, wireType 2 =*/90).string(message.yarnApplicationIds[i]); return writer; }; @@ -24144,6 +24192,26 @@ message.clusterName = reader.string(); break; } + case 4: { + message.tarballGcsDir = reader.string(); + break; + } + case 6: { + message.diagnosisInterval = $root.google.type.Interval.decode(reader, reader.uint32()); + break; + } + case 10: { + if (!(message.jobs && message.jobs.length)) + message.jobs = []; + message.jobs.push(reader.string()); + break; + } + case 11: { + if (!(message.yarnApplicationIds && message.yarnApplicationIds.length)) + message.yarnApplicationIds = []; + message.yarnApplicationIds.push(reader.string()); + break; + } default: reader.skipType(tag & 7); break; @@ -24188,6 +24256,28 @@ if (message.clusterName != null && message.hasOwnProperty("clusterName")) if (!$util.isString(message.clusterName)) return "clusterName: string expected"; + if (message.tarballGcsDir != null && message.hasOwnProperty("tarballGcsDir")) + if (!$util.isString(message.tarballGcsDir)) + return "tarballGcsDir: string expected"; + if (message.diagnosisInterval != null && message.hasOwnProperty("diagnosisInterval")) { + var error = $root.google.type.Interval.verify(message.diagnosisInterval); + if (error) + return "diagnosisInterval." + error; + } + if (message.jobs != null && message.hasOwnProperty("jobs")) { + if (!Array.isArray(message.jobs)) + return "jobs: array expected"; + for (var i = 0; i < message.jobs.length; ++i) + if (!$util.isString(message.jobs[i])) + return "jobs: string[] expected"; + } + if (message.yarnApplicationIds != null && message.hasOwnProperty("yarnApplicationIds")) { + if (!Array.isArray(message.yarnApplicationIds)) + return "yarnApplicationIds: array expected"; + for (var i = 0; i < message.yarnApplicationIds.length; ++i) + if (!$util.isString(message.yarnApplicationIds[i])) + return "yarnApplicationIds: string[] expected"; + } return null; }; @@ -24209,6 +24299,27 @@ message.region = String(object.region); if (object.clusterName != null) message.clusterName = String(object.clusterName); + if (object.tarballGcsDir != null) + message.tarballGcsDir = String(object.tarballGcsDir); + if (object.diagnosisInterval != null) { + if (typeof object.diagnosisInterval !== "object") + throw TypeError(".google.cloud.dataproc.v1.DiagnoseClusterRequest.diagnosisInterval: object expected"); + message.diagnosisInterval = $root.google.type.Interval.fromObject(object.diagnosisInterval); + } + if (object.jobs) { + if (!Array.isArray(object.jobs)) + throw TypeError(".google.cloud.dataproc.v1.DiagnoseClusterRequest.jobs: array expected"); + message.jobs = []; + for (var i = 0; i < object.jobs.length; ++i) + message.jobs[i] = String(object.jobs[i]); + } + if (object.yarnApplicationIds) { + if (!Array.isArray(object.yarnApplicationIds)) + throw TypeError(".google.cloud.dataproc.v1.DiagnoseClusterRequest.yarnApplicationIds: array expected"); + message.yarnApplicationIds = []; + for (var i = 0; i < object.yarnApplicationIds.length; ++i) + message.yarnApplicationIds[i] = String(object.yarnApplicationIds[i]); + } return message; }; @@ -24225,10 +24336,16 @@ if (!options) options = {}; var object = {}; + if (options.arrays || options.defaults) { + object.jobs = []; + object.yarnApplicationIds = []; + } if (options.defaults) { object.projectId = ""; object.clusterName = ""; object.region = ""; + object.tarballGcsDir = ""; + object.diagnosisInterval = null; } if (message.projectId != null && message.hasOwnProperty("projectId")) object.projectId = message.projectId; @@ -24236,6 +24353,20 @@ object.clusterName = message.clusterName; if (message.region != null && message.hasOwnProperty("region")) object.region = message.region; + if (message.tarballGcsDir != null && message.hasOwnProperty("tarballGcsDir")) + object.tarballGcsDir = message.tarballGcsDir; + if (message.diagnosisInterval != null && message.hasOwnProperty("diagnosisInterval")) + object.diagnosisInterval = $root.google.type.Interval.toObject(message.diagnosisInterval, options); + if (message.jobs && message.jobs.length) { + object.jobs = []; + for (var j = 0; j < message.jobs.length; ++j) + object.jobs[j] = message.jobs[j]; + } + if (message.yarnApplicationIds && message.yarnApplicationIds.length) { + object.yarnApplicationIds = []; + for (var j = 0; j < message.yarnApplicationIds.length; ++j) + object.yarnApplicationIds[j] = message.yarnApplicationIds[j]; + } return object; }; @@ -59932,240 +60063,24 @@ 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() { + protobuf.DoubleValue = (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 + * Properties of a DoubleValue. + * @memberof google.protobuf + * @interface IDoubleValue + * @property {number|null} [value] DoubleValue value */ /** - * Constructs a new Operation. - * @memberof google.longrunning - * @classdesc Represents an Operation. - * @implements IOperation + * Constructs a new DoubleValue. + * @memberof google.protobuf + * @classdesc Represents a DoubleValue. + * @implements IDoubleValue * @constructor - * @param {google.longrunning.IOperation=} [properties] Properties to set + * @param {google.protobuf.IDoubleValue=} [properties] Properties to set */ - function Operation(properties) { + function DoubleValue(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -60173,145 +60088,75 @@ } /** - * 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 + * DoubleValue value. + * @member {number} value + * @memberof google.protobuf.DoubleValue * @instance */ - Object.defineProperty(Operation.prototype, "result", { - get: $util.oneOfGetter($oneOfFields = ["error", "response"]), - set: $util.oneOfSetter($oneOfFields) - }); + DoubleValue.prototype.value = 0; /** - * Creates a new Operation instance using the specified properties. + * Creates a new DoubleValue instance using the specified properties. * @function create - * @memberof google.longrunning.Operation + * @memberof google.protobuf.DoubleValue * @static - * @param {google.longrunning.IOperation=} [properties] Properties to set - * @returns {google.longrunning.Operation} Operation instance + * @param {google.protobuf.IDoubleValue=} [properties] Properties to set + * @returns {google.protobuf.DoubleValue} DoubleValue instance */ - Operation.create = function create(properties) { - return new Operation(properties); + DoubleValue.create = function create(properties) { + return new DoubleValue(properties); }; /** - * Encodes the specified Operation message. Does not implicitly {@link google.longrunning.Operation.verify|verify} messages. + * Encodes the specified DoubleValue message. Does not implicitly {@link google.protobuf.DoubleValue.verify|verify} messages. * @function encode - * @memberof google.longrunning.Operation + * @memberof google.protobuf.DoubleValue * @static - * @param {google.longrunning.IOperation} message Operation message or plain object to encode + * @param {google.protobuf.IDoubleValue} message DoubleValue message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - Operation.encode = function encode(message, writer) { + DoubleValue.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(); + if (message.value != null && Object.hasOwnProperty.call(message, "value")) + writer.uint32(/* id 1, wireType 1 =*/9).double(message.value); return writer; }; /** - * Encodes the specified Operation message, length delimited. Does not implicitly {@link google.longrunning.Operation.verify|verify} messages. + * Encodes the specified DoubleValue message, length delimited. Does not implicitly {@link google.protobuf.DoubleValue.verify|verify} messages. * @function encodeDelimited - * @memberof google.longrunning.Operation + * @memberof google.protobuf.DoubleValue * @static - * @param {google.longrunning.IOperation} message Operation message or plain object to encode + * @param {google.protobuf.IDoubleValue} message DoubleValue message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - Operation.encodeDelimited = function encodeDelimited(message, writer) { + DoubleValue.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes an Operation message from the specified reader or buffer. + * Decodes a DoubleValue message from the specified reader or buffer. * @function decode - * @memberof google.longrunning.Operation + * @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.longrunning.Operation} Operation + * @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 */ - Operation.decode = function decode(reader, length) { + DoubleValue.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.longrunning.Operation(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.DoubleValue(); while (reader.pos < end) { var tag = reader.uint32(); 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()); + message.value = reader.double(); break; } default: @@ -60323,183 +60168,122 @@ }; /** - * Decodes an Operation message from the specified reader or buffer, length delimited. + * Decodes a DoubleValue message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.longrunning.Operation + * @memberof google.protobuf.DoubleValue * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.longrunning.Operation} Operation + * @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 */ - Operation.decodeDelimited = function decodeDelimited(reader) { + DoubleValue.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies an Operation message. + * Verifies a DoubleValue message. * @function verify - * @memberof google.longrunning.Operation + * @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 */ - Operation.verify = function verify(message) { + DoubleValue.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; - } - } + if (message.value != null && message.hasOwnProperty("value")) + if (typeof message.value !== "number") + return "value: number expected"; return null; }; /** - * Creates an Operation message from a plain object. Also converts values to their respective internal types. + * Creates a DoubleValue message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.longrunning.Operation + * @memberof google.protobuf.DoubleValue * @static * @param {Object.} object Plain object - * @returns {google.longrunning.Operation} Operation + * @returns {google.protobuf.DoubleValue} DoubleValue */ - Operation.fromObject = function fromObject(object) { - if (object instanceof $root.google.longrunning.Operation) + DoubleValue.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.DoubleValue) 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); - } + var message = new $root.google.protobuf.DoubleValue(); + if (object.value != null) + message.value = Number(object.value); return message; }; /** - * Creates a plain object from an Operation message. Also converts values to other types if specified. + * Creates a plain object from a DoubleValue message. Also converts values to other types if specified. * @function toObject - * @memberof google.longrunning.Operation + * @memberof google.protobuf.DoubleValue * @static - * @param {google.longrunning.Operation} message Operation + * @param {google.protobuf.DoubleValue} message DoubleValue * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - Operation.toObject = function toObject(message, options) { + DoubleValue.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"; - } + 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 Operation to JSON. + * Converts this DoubleValue to JSON. * @function toJSON - * @memberof google.longrunning.Operation + * @memberof google.protobuf.DoubleValue * @instance * @returns {Object.} JSON object */ - Operation.prototype.toJSON = function toJSON() { + DoubleValue.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for Operation + * Gets the default type url for DoubleValue * @function getTypeUrl - * @memberof google.longrunning.Operation + * @memberof google.protobuf.DoubleValue * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - Operation.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + DoubleValue.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.longrunning.Operation"; + return typeUrlPrefix + "/google.protobuf.DoubleValue"; }; - return Operation; + return DoubleValue; })(); - longrunning.GetOperationRequest = (function() { + protobuf.FloatValue = (function() { /** - * Properties of a GetOperationRequest. - * @memberof google.longrunning - * @interface IGetOperationRequest - * @property {string|null} [name] GetOperationRequest name + * Properties of a FloatValue. + * @memberof google.protobuf + * @interface IFloatValue + * @property {number|null} [value] FloatValue value */ /** - * Constructs a new GetOperationRequest. - * @memberof google.longrunning - * @classdesc Represents a GetOperationRequest. - * @implements IGetOperationRequest + * Constructs a new FloatValue. + * @memberof google.protobuf + * @classdesc Represents a FloatValue. + * @implements IFloatValue * @constructor - * @param {google.longrunning.IGetOperationRequest=} [properties] Properties to set + * @param {google.protobuf.IFloatValue=} [properties] Properties to set */ - function GetOperationRequest(properties) { + function FloatValue(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -60507,38 +60291,2249 @@ } /** - * GetOperationRequest name. - * @member {string} name - * @memberof google.longrunning.GetOperationRequest + * FloatValue value. + * @member {number} value + * @memberof google.protobuf.FloatValue * @instance */ - GetOperationRequest.prototype.name = ""; + FloatValue.prototype.value = 0; /** - * Creates a new GetOperationRequest instance using the specified properties. + * Creates a new FloatValue instance using the specified properties. * @function create - * @memberof google.longrunning.GetOperationRequest + * @memberof google.protobuf.FloatValue * @static - * @param {google.longrunning.IGetOperationRequest=} [properties] Properties to set - * @returns {google.longrunning.GetOperationRequest} GetOperationRequest instance + * @param {google.protobuf.IFloatValue=} [properties] Properties to set + * @returns {google.protobuf.FloatValue} FloatValue instance */ - GetOperationRequest.create = function create(properties) { - return new GetOperationRequest(properties); + FloatValue.create = function create(properties) { + return new FloatValue(properties); }; /** - * Encodes the specified GetOperationRequest message. Does not implicitly {@link google.longrunning.GetOperationRequest.verify|verify} messages. + * Encodes the specified FloatValue message. Does not implicitly {@link google.protobuf.FloatValue.verify|verify} messages. * @function encode - * @memberof google.longrunning.GetOperationRequest + * @memberof google.protobuf.FloatValue * @static - * @param {google.longrunning.IGetOperationRequest} message GetOperationRequest message or plain object to encode + * @param {google.protobuf.IFloatValue} message FloatValue message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - GetOperationRequest.encode = function encode(message, writer) { + FloatValue.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.name != null && Object.hasOwnProperty.call(message, "name")) + 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) { + 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(); + 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) { + 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(); + 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) { + 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(); + 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) { + 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(); + 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) { + 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(); + 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) { + 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(); + 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) { + 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(); + 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) { + 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(); + 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; + })(); + + 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) { + 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(); + 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; }; @@ -62358,6 +64353,255 @@ return rpc; })(); + 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) { + 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(); + 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-cloud-dataproc/protos/protos.json b/packages/google-cloud-dataproc/protos/protos.json index 5b2e96e27d4..6e6c25837b7 100644 --- a/packages/google-cloud-dataproc/protos/protos.json +++ b/packages/google-cloud-dataproc/protos/protos.json @@ -3050,6 +3050,36 @@ "options": { "(google.api.field_behavior)": "REQUIRED" } + }, + "tarballGcsDir": { + "type": "string", + "id": 4, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "diagnosisInterval": { + "type": "google.type.Interval", + "id": 6, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "jobs": { + "rule": "repeated", + "type": "string", + "id": 10, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "yarnApplicationIds": { + "rule": "repeated", + "type": "string", + "id": 11, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } } } }, @@ -7192,6 +7222,78 @@ "id": 1 } } + }, + "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 + } + } } } }, @@ -7439,6 +7541,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-cloud-dataproc/samples/generated/v1/cluster_controller.diagnose_cluster.js b/packages/google-cloud-dataproc/samples/generated/v1/cluster_controller.diagnose_cluster.js index 308aa3c5586..78bbe9e700d 100644 --- a/packages/google-cloud-dataproc/samples/generated/v1/cluster_controller.diagnose_cluster.js +++ b/packages/google-cloud-dataproc/samples/generated/v1/cluster_controller.diagnose_cluster.js @@ -41,6 +41,27 @@ function main(projectId, region, clusterName) { * Required. The cluster name. */ // const clusterName = 'abc123' + /** + * Optional. The output Cloud Storage directory for the diagnostic + * tarball. If not specified, a task-specific directory in the cluster's + * staging bucket will be used. + */ + // const tarballGcsDir = 'abc123' + /** + * Optional. Time interval in which diagnosis should be carried out on the + * cluster. + */ + // const diagnosisInterval = {} + /** + * Optional. Specifies a list of jobs on which diagnosis is to be performed. + * Format: projects/{project}/regions/{region}/jobs/{job} + */ + // const jobs = ['abc','def'] + /** + * Optional. Specifies a list of yarn applications on which diagnosis is to be + * performed. + */ + // const yarnApplicationIds = ['abc','def'] // Imports the Dataproc library const {ClusterControllerClient} = require('@google-cloud/dataproc').v1; diff --git a/packages/google-cloud-dataproc/samples/generated/v1/snippet_metadata.google.cloud.dataproc.v1.json b/packages/google-cloud-dataproc/samples/generated/v1/snippet_metadata.google.cloud.dataproc.v1.json index 1d15561eae3..d0f0f41047c 100644 --- a/packages/google-cloud-dataproc/samples/generated/v1/snippet_metadata.google.cloud.dataproc.v1.json +++ b/packages/google-cloud-dataproc/samples/generated/v1/snippet_metadata.google.cloud.dataproc.v1.json @@ -1,7 +1,7 @@ { "clientLibrary": { "name": "nodejs-dataproc", - "version": "5.1.0", + "version": "5.2.0", "language": "TYPESCRIPT", "apis": [ { diff --git a/packages/google-cloud-dataproc/samples/generated/v1/snippet_metadata_google.cloud.dataproc.v1.json b/packages/google-cloud-dataproc/samples/generated/v1/snippet_metadata_google.cloud.dataproc.v1.json index 1d15561eae3..b30ff91cc25 100644 --- a/packages/google-cloud-dataproc/samples/generated/v1/snippet_metadata_google.cloud.dataproc.v1.json +++ b/packages/google-cloud-dataproc/samples/generated/v1/snippet_metadata_google.cloud.dataproc.v1.json @@ -1,7 +1,7 @@ { "clientLibrary": { "name": "nodejs-dataproc", - "version": "5.1.0", + "version": "5.2.0", "language": "TYPESCRIPT", "apis": [ { @@ -814,7 +814,7 @@ "segments": [ { "start": 25, - "end": 65, + "end": 86, "type": "FULL" } ], @@ -834,6 +834,22 @@ { "name": "cluster_name", "type": "TYPE_STRING" + }, + { + "name": "tarball_gcs_dir", + "type": "TYPE_STRING" + }, + { + "name": "diagnosis_interval", + "type": ".google.type.Interval" + }, + { + "name": "jobs", + "type": "TYPE_STRING[]" + }, + { + "name": "yarn_application_ids", + "type": "TYPE_STRING[]" } ], "resultType": ".google.longrunning.Operation", diff --git a/packages/google-cloud-dataproc/samples/package.json b/packages/google-cloud-dataproc/samples/package.json index 6460fe60b17..54ca3117e5d 100644 --- a/packages/google-cloud-dataproc/samples/package.json +++ b/packages/google-cloud-dataproc/samples/package.json @@ -14,7 +14,7 @@ "test": "mocha test --timeout 600000" }, "dependencies": { - "@google-cloud/dataproc": "^5.1.0", + "@google-cloud/dataproc": "^5.2.0", "@google-cloud/storage": "^7.0.0" }, "devDependencies": { diff --git a/packages/google-cloud-dataproc/src/v1/cluster_controller_client.ts b/packages/google-cloud-dataproc/src/v1/cluster_controller_client.ts index 16acc3143ce..e9d95df957f 100644 --- a/packages/google-cloud-dataproc/src/v1/cluster_controller_client.ts +++ b/packages/google-cloud-dataproc/src/v1/cluster_controller_client.ts @@ -1545,6 +1545,19 @@ export class ClusterControllerClient { * Required. The Dataproc region in which to handle the request. * @param {string} request.clusterName * Required. The cluster name. + * @param {string} [request.tarballGcsDir] + * Optional. The output Cloud Storage directory for the diagnostic + * tarball. If not specified, a task-specific directory in the cluster's + * staging bucket will be used. + * @param {google.type.Interval} [request.diagnosisInterval] + * Optional. Time interval in which diagnosis should be carried out on the + * cluster. + * @param {string[]} [request.jobs] + * Optional. Specifies a list of jobs on which diagnosis is to be performed. + * Format: projects/{project}/regions/{region}/jobs/{job} + * @param {string[]} [request.yarnApplicationIds] + * Optional. Specifies a list of yarn applications on which diagnosis is to be + * performed. * @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. diff --git a/packages/google-cloud-dialogflow-cx/protos/google/cloud/dialogflow/cx/v3/data_store_connection.proto b/packages/google-cloud-dialogflow-cx/protos/google/cloud/dialogflow/cx/v3/data_store_connection.proto index e1bffb30782..9dde0067186 100644 --- a/packages/google-cloud-dialogflow-cx/protos/google/cloud/dialogflow/cx/v3/data_store_connection.proto +++ b/packages/google-cloud-dialogflow-cx/protos/google/cloud/dialogflow/cx/v3/data_store_connection.proto @@ -23,6 +23,7 @@ option java_multiple_files = true; option java_outer_classname = "DataStoreConnectionProto"; option java_package = "com.google.cloud.dialogflow.cx.v3"; option objc_class_prefix = "DF"; +option ruby_package = "Google::Cloud::Dialogflow::CX::V3"; // A data store connection. It represents a data store in Discovery Engine and // the type of the contents it contains. diff --git a/packages/google-cloud-dialogflow-cx/protos/google/cloud/dialogflow/cx/v3/generative_settings.proto b/packages/google-cloud-dialogflow-cx/protos/google/cloud/dialogflow/cx/v3/generative_settings.proto index 87053e1b941..389c1da7235 100644 --- a/packages/google-cloud-dialogflow-cx/protos/google/cloud/dialogflow/cx/v3/generative_settings.proto +++ b/packages/google-cloud-dialogflow-cx/protos/google/cloud/dialogflow/cx/v3/generative_settings.proto @@ -26,6 +26,7 @@ option java_multiple_files = true; option java_outer_classname = "GenerativeSettingsProto"; option java_package = "com.google.cloud.dialogflow.cx.v3"; option objc_class_prefix = "DF"; +option ruby_package = "Google::Cloud::Dialogflow::CX::V3"; // Settings for Generative AI. message GenerativeSettings { diff --git a/packages/google-cloud-dialogflow-cx/protos/google/cloud/dialogflow/cx/v3/import_strategy.proto b/packages/google-cloud-dialogflow-cx/protos/google/cloud/dialogflow/cx/v3/import_strategy.proto index 68cf3373c7d..91f2c2b9ac5 100644 --- a/packages/google-cloud-dialogflow-cx/protos/google/cloud/dialogflow/cx/v3/import_strategy.proto +++ b/packages/google-cloud-dialogflow-cx/protos/google/cloud/dialogflow/cx/v3/import_strategy.proto @@ -23,6 +23,7 @@ option java_multiple_files = true; option java_outer_classname = "ImportStrategyProto"; option java_package = "com.google.cloud.dialogflow.cx.v3"; option objc_class_prefix = "DF"; +option ruby_package = "Google::Cloud::Dialogflow::CX::V3"; // Import strategies for the conflict resolution of resources (i.e. intents, // entities, and webhooks) with identical display names during import diff --git a/packages/google-cloud-dialogflow-cx/protos/google/cloud/dialogflow/cx/v3/safety_settings.proto b/packages/google-cloud-dialogflow-cx/protos/google/cloud/dialogflow/cx/v3/safety_settings.proto index c1ad021316b..042bd16d7a3 100644 --- a/packages/google-cloud-dialogflow-cx/protos/google/cloud/dialogflow/cx/v3/safety_settings.proto +++ b/packages/google-cloud-dialogflow-cx/protos/google/cloud/dialogflow/cx/v3/safety_settings.proto @@ -25,6 +25,7 @@ option java_multiple_files = true; option java_outer_classname = "SafetySettingsProto"; option java_package = "com.google.cloud.dialogflow.cx.v3"; option objc_class_prefix = "DF"; +option ruby_package = "Google::Cloud::Dialogflow::CX::V3"; // Settings for Generative Safety. message SafetySettings { diff --git a/packages/google-cloud-dialogflow-cx/protos/google/cloud/dialogflow/cx/v3beta1/data_store_connection.proto b/packages/google-cloud-dialogflow-cx/protos/google/cloud/dialogflow/cx/v3beta1/data_store_connection.proto index 59572e39dd5..d3896d8a5e6 100644 --- a/packages/google-cloud-dialogflow-cx/protos/google/cloud/dialogflow/cx/v3beta1/data_store_connection.proto +++ b/packages/google-cloud-dialogflow-cx/protos/google/cloud/dialogflow/cx/v3beta1/data_store_connection.proto @@ -23,6 +23,7 @@ option java_multiple_files = true; option java_outer_classname = "DataStoreConnectionProto"; option java_package = "com.google.cloud.dialogflow.cx.v3beta1"; option objc_class_prefix = "DF"; +option ruby_package = "Google::Cloud::Dialogflow::CX::V3beta1"; // A data store connection. It represents a data store in Discovery Engine and // the type of the contents it contains. diff --git a/packages/google-cloud-dialogflow-cx/protos/google/cloud/dialogflow/cx/v3beta1/generative_settings.proto b/packages/google-cloud-dialogflow-cx/protos/google/cloud/dialogflow/cx/v3beta1/generative_settings.proto index 680223a455f..86c60400f42 100644 --- a/packages/google-cloud-dialogflow-cx/protos/google/cloud/dialogflow/cx/v3beta1/generative_settings.proto +++ b/packages/google-cloud-dialogflow-cx/protos/google/cloud/dialogflow/cx/v3beta1/generative_settings.proto @@ -26,6 +26,7 @@ option java_multiple_files = true; option java_outer_classname = "GenerativeSettingsProto"; option java_package = "com.google.cloud.dialogflow.cx.v3beta1"; option objc_class_prefix = "DF"; +option ruby_package = "Google::Cloud::Dialogflow::CX::V3beta1"; // Settings for Generative AI. message GenerativeSettings { diff --git a/packages/google-cloud-dialogflow-cx/protos/google/cloud/dialogflow/cx/v3beta1/import_strategy.proto b/packages/google-cloud-dialogflow-cx/protos/google/cloud/dialogflow/cx/v3beta1/import_strategy.proto index 3b3f3baee55..a00f25d58f9 100644 --- a/packages/google-cloud-dialogflow-cx/protos/google/cloud/dialogflow/cx/v3beta1/import_strategy.proto +++ b/packages/google-cloud-dialogflow-cx/protos/google/cloud/dialogflow/cx/v3beta1/import_strategy.proto @@ -23,6 +23,7 @@ option java_multiple_files = true; option java_outer_classname = "ImportStrategyProto"; option java_package = "com.google.cloud.dialogflow.cx.v3beta1"; option objc_class_prefix = "DF"; +option ruby_package = "Google::Cloud::Dialogflow::CX::V3beta1"; // Import strategies for the conflict resolution of resources (i.e. intents, // entities, and webhooks) with identical display names during import diff --git a/packages/google-cloud-dialogflow-cx/protos/google/cloud/dialogflow/cx/v3beta1/safety_settings.proto b/packages/google-cloud-dialogflow-cx/protos/google/cloud/dialogflow/cx/v3beta1/safety_settings.proto index d87ae3d1dd5..88c287e9c6b 100644 --- a/packages/google-cloud-dialogflow-cx/protos/google/cloud/dialogflow/cx/v3beta1/safety_settings.proto +++ b/packages/google-cloud-dialogflow-cx/protos/google/cloud/dialogflow/cx/v3beta1/safety_settings.proto @@ -25,6 +25,7 @@ option java_multiple_files = true; option java_outer_classname = "SafetySettingsProto"; option java_package = "com.google.cloud.dialogflow.cx.v3beta1"; option objc_class_prefix = "DF"; +option ruby_package = "Google::Cloud::Dialogflow::CX::V3beta1"; // Settings for Generative Safety. message SafetySettings { diff --git a/packages/google-cloud-dns/.OwlBot.yaml b/packages/google-cloud-dns/.OwlBot.yaml new file mode 100644 index 00000000000..46bbeee9f9f --- /dev/null +++ b/packages/google-cloud-dns/.OwlBot.yaml @@ -0,0 +1,17 @@ +# 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 +# +# 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. + + +begin-after-commit-hash: 397c0bfd367a2427104f988d5329bc117caafd95 + diff --git a/packages/google-cloud-dns/.eslintignore b/packages/google-cloud-dns/.eslintignore new file mode 100644 index 00000000000..ea5b04aebe6 --- /dev/null +++ b/packages/google-cloud-dns/.eslintignore @@ -0,0 +1,7 @@ +**/node_modules +**/coverage +test/fixtures +build/ +docs/ +protos/ +samples/generated/ diff --git a/packages/google-cloud-dns/.eslintrc.json b/packages/google-cloud-dns/.eslintrc.json new file mode 100644 index 00000000000..78215349546 --- /dev/null +++ b/packages/google-cloud-dns/.eslintrc.json @@ -0,0 +1,3 @@ +{ + "extends": "./node_modules/gts" +} diff --git a/packages/google-cloud-dns/.gitattributes b/packages/google-cloud-dns/.gitattributes new file mode 100644 index 00000000000..33739cb74e4 --- /dev/null +++ b/packages/google-cloud-dns/.gitattributes @@ -0,0 +1,4 @@ +*.ts text eol=lf +*.js text eol=lf +protos/* linguist-generated +**/api-extractor.json linguist-language=JSON-with-Comments diff --git a/packages/google-cloud-dns/.gitignore b/packages/google-cloud-dns/.gitignore new file mode 100644 index 00000000000..2036b7c6583 --- /dev/null +++ b/packages/google-cloud-dns/.gitignore @@ -0,0 +1,13 @@ +**/*.log +**/node_modules +.coverage +.nyc_output +docs/ +out/ +system-test/secrets.js +system-test/*key.json +*.lock +package-lock.json +build/ +__pycache__ +.DS_Store \ No newline at end of file diff --git a/packages/google-cloud-dns/.jsdoc.js b/packages/google-cloud-dns/.jsdoc.js new file mode 100644 index 00000000000..605cb7c914b --- /dev/null +++ b/packages/google-cloud-dns/.jsdoc.js @@ -0,0 +1,51 @@ +// Copyright 2019 Google LLC +// +// Licensed under the Apache License, Version 2.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. +// + +'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' + ], + includePattern: '\\.js$' + }, + templates: { + copyright: 'Copyright 2019 Google, LLC.', + includeDate: false, + sourceFiles: false, + systemName: '@google-cloud/dns', + theme: 'lumen', + default: { + "outputSourceFiles": false + } + }, + markdown: { + idInHeadings: true + } +}; diff --git a/packages/google-cloud-dns/.mocharc.js b/packages/google-cloud-dns/.mocharc.js new file mode 100644 index 00000000000..49e7e228701 --- /dev/null +++ b/packages/google-cloud-dns/.mocharc.js @@ -0,0 +1,29 @@ +// Copyright 2023 Google LLC +// +// Licensed under the Apache License, Version 2.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. +const config = { + "enable-source-maps": true, + "throw-deprecation": true, + "timeout": 10000, + "recursive": true +} +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/google-cloud-dns/.nycrc b/packages/google-cloud-dns/.nycrc new file mode 100644 index 00000000000..b18d5472b62 --- /dev/null +++ b/packages/google-cloud-dns/.nycrc @@ -0,0 +1,24 @@ +{ + "report-dir": "./.coverage", + "reporter": ["text", "lcov"], + "exclude": [ + "**/*-test", + "**/.coverage", + "**/apis", + "**/benchmark", + "**/conformance", + "**/docs", + "**/samples", + "**/scripts", + "**/protos", + "**/test", + "**/*.d.ts", + ".jsdoc.js", + "**/.jsdoc.js", + "karma.conf.js", + "webpack-tests.config.js", + "webpack.config.js" + ], + "exclude-after-remap": false, + "all": true +} diff --git a/packages/google-cloud-dns/.prettierignore b/packages/google-cloud-dns/.prettierignore new file mode 100644 index 00000000000..9340ad9b86d --- /dev/null +++ b/packages/google-cloud-dns/.prettierignore @@ -0,0 +1,6 @@ +**/node_modules +**/coverage +test/fixtures +build/ +docs/ +protos/ diff --git a/packages/google-cloud-dns/.prettierrc.js b/packages/google-cloud-dns/.prettierrc.js new file mode 100644 index 00000000000..1e6cec783e4 --- /dev/null +++ b/packages/google-cloud-dns/.prettierrc.js @@ -0,0 +1,17 @@ +// Copyright 2023 Google LLC +// +// Licensed under the Apache License, Version 2.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. + +module.exports = { + ...require('gts/.prettierrc.json') +} diff --git a/packages/google-cloud-dns/.repo-metadata.json b/packages/google-cloud-dns/.repo-metadata.json new file mode 100644 index 00000000000..d2f8c93fe56 --- /dev/null +++ b/packages/google-cloud-dns/.repo-metadata.json @@ -0,0 +1,15 @@ +{ + "name": "dns", + "name_pretty": "Cloud DNS", + "product_documentation": "https://cloud.google.com/dns", + "client_documentation": "https://cloud.google.com/nodejs/docs/reference/dns/latest", + "issue_tracker": "https://issuetracker.google.com/savedsearches/559772", + "release_level": "stable", + "language": "nodejs", + "repo": "googleapis/google-cloud-node", + "distribution_name": "@google-cloud/dns", + "api_id": "dns.googleapis.com", + "requires_billing": true, + "api_shortname": "dns", + "library_type": "REST" +} diff --git a/packages/google-cloud-dns/CHANGELOG.md b/packages/google-cloud-dns/CHANGELOG.md new file mode 100644 index 00000000000..5675bb3c88c --- /dev/null +++ b/packages/google-cloud-dns/CHANGELOG.md @@ -0,0 +1,446 @@ +# Changelog + +[npm history][1] + +[1]: https://www.npmjs.com/package/@google-cloud/dns?activeTab=versions + +## [4.0.0](https://github.com/googleapis/nodejs-dns/compare/v3.0.2...v4.0.0) (2023-08-10) + + +### ⚠ BREAKING CHANGES + +* upgrade to Node 14 ([#556](https://github.com/googleapis/nodejs-dns/issues/556)) + +### Miscellaneous Chores + +* Upgrade to Node 14 ([#556](https://github.com/googleapis/nodejs-dns/issues/556)) ([75b5a56](https://github.com/googleapis/nodejs-dns/commit/75b5a56993e74826b69650c8c7601e977802b15f)) + +## [3.0.2](https://github.com/googleapis/nodejs-dns/compare/v3.0.1...v3.0.2) (2022-08-23) + + +### Bug Fixes + +* remove pip install statements ([#1546](https://github.com/googleapis/nodejs-dns/issues/1546)) ([#534](https://github.com/googleapis/nodejs-dns/issues/534)) ([b3a77f0](https://github.com/googleapis/nodejs-dns/commit/b3a77f071df17739c2fcd682f181ac5bdddffae6)) + +## [3.0.1](https://github.com/googleapis/nodejs-dns/compare/v3.0.0...v3.0.1) (2022-06-09) + + +### Bug Fixes + +* **deps:** update dependency @google-cloud/common to v4 ([#529](https://github.com/googleapis/nodejs-dns/issues/529)) ([4e8b02f](https://github.com/googleapis/nodejs-dns/commit/4e8b02ff70ce3158d10cf37970f4d9ea371a2fcb)) + +## [3.0.0](https://github.com/googleapis/nodejs-dns/compare/v2.2.4...v3.0.0) (2022-06-06) + + +### ⚠ BREAKING CHANGES + +* update library to use Node 12 (#524) + +### Bug Fixes + +* **deps:** update dependency @google-cloud/paginator to v4 ([#525](https://github.com/googleapis/nodejs-dns/issues/525)) ([e82ead7](https://github.com/googleapis/nodejs-dns/commit/e82ead7460db28e4a434ba321e1e1d0e3f7b12ed)) +* **deps:** update dependency @google-cloud/promisify to v3 ([#523](https://github.com/googleapis/nodejs-dns/issues/523)) ([7cfb445](https://github.com/googleapis/nodejs-dns/commit/7cfb445dd432ccdc71d13ef1eea43797dc898157)) + + +### Build System + +* update library to use Node 12 ([#524](https://github.com/googleapis/nodejs-dns/issues/524)) ([ab3ce39](https://github.com/googleapis/nodejs-dns/commit/ab3ce39f2257cde3740bd51302667d2f24111aa8)) + +### [2.2.4](https://www.github.com/googleapis/nodejs-dns/compare/v2.2.3...v2.2.4) (2022-01-06) + + +### Bug Fixes + +* **deps:** update dependency dns-zonefile to v0.2.10 ([#503](https://www.github.com/googleapis/nodejs-dns/issues/503)) ([dc59d1c](https://www.github.com/googleapis/nodejs-dns/commit/dc59d1c8c733348e8500a751a71ccb0a9b13656d)) + +### [2.2.3](https://www.github.com/googleapis/nodejs-dns/compare/v2.2.2...v2.2.3) (2021-09-22) + + +### Bug Fixes + +* **deps:** update dependency dns-zonefile to v0.2.9 ([#487](https://www.github.com/googleapis/nodejs-dns/issues/487)) ([53788bd](https://www.github.com/googleapis/nodejs-dns/commit/53788bd5676bf0f5dfd35dde18c912eb98247aa1)) + +### [2.2.2](https://www.github.com/googleapis/nodejs-dns/compare/v2.2.1...v2.2.2) (2021-08-09) + + +### Bug Fixes + +* **build:** migrate to using main branch ([#478](https://www.github.com/googleapis/nodejs-dns/issues/478)) ([2f19b00](https://www.github.com/googleapis/nodejs-dns/commit/2f19b0066a26910262abff94974c55cda41b3fae)) + +### [2.2.1](https://www.github.com/googleapis/nodejs-dns/compare/v2.2.0...v2.2.1) (2021-08-06) + + +### Bug Fixes + +* **deps:** update dependency dns-zonefile to v0.2.8 ([#469](https://www.github.com/googleapis/nodejs-dns/issues/469)) ([3a9bb0e](https://www.github.com/googleapis/nodejs-dns/commit/3a9bb0ebcb9a77fbfe7ee911929c780d5ae2d28b)) + +## [2.2.0](https://www.github.com/googleapis/nodejs-dns/compare/v2.1.0...v2.2.0) (2021-06-07) + + +### Features + +* add `gcf-owl-bot[bot]` to `ignoreAuthors` ([#452](https://www.github.com/googleapis/nodejs-dns/issues/452)) ([6148f03](https://www.github.com/googleapis/nodejs-dns/commit/6148f03b37be1960bd5ed6ce32d696a8c0acdd2f)) + +## [2.1.0](https://www.github.com/googleapis/nodejs-dns/compare/v2.0.2...v2.1.0) (2020-12-22) + + +### Features + +* add support for setting DNS Sec ([#439](https://www.github.com/googleapis/nodejs-dns/issues/439)) ([32792e1](https://www.github.com/googleapis/nodejs-dns/commit/32792e1659bb7df5b15a65b5ff3f0c6f5e80b949)) + +### [2.0.2](https://www.github.com/googleapis/nodejs-dns/compare/v2.0.1...v2.0.2) (2020-07-09) + + +### Bug Fixes + +* typeo in nodejs .gitattribute ([#401](https://www.github.com/googleapis/nodejs-dns/issues/401)) ([c02a9da](https://www.github.com/googleapis/nodejs-dns/commit/c02a9daa5290922928f313a59a59af0f244d8eb9)) + +### [2.0.1](https://www.github.com/googleapis/nodejs-dns/compare/v2.0.0...v2.0.1) (2020-06-04) + + +### Bug Fixes + +* **autosynth:** synthesis was failing due to breaking TypeScript changes ([#392](https://www.github.com/googleapis/nodejs-dns/issues/392)) ([cf32c50](https://www.github.com/googleapis/nodejs-dns/commit/cf32c506c878052867abbc148818f1f3e2747c1c)) + +## [2.0.0](https://www.github.com/googleapis/nodejs-dns/compare/v1.2.9...v2.0.0) (2020-04-14) + + +### ⚠ BREAKING CHANGES + +* update to latest version of gts and typescript (#376) +* require node 10 in engines field (#374) + +### Features + +* require node 10 in engines field ([#374](https://www.github.com/googleapis/nodejs-dns/issues/374)) ([aba0475](https://www.github.com/googleapis/nodejs-dns/commit/aba047555b12b8c6a243581fc65579381d497b1f)) + + +### Bug Fixes + +* apache license URL ([#468](https://www.github.com/googleapis/nodejs-dns/issues/468)) ([#372](https://www.github.com/googleapis/nodejs-dns/issues/372)) ([32e13a1](https://www.github.com/googleapis/nodejs-dns/commit/32e13a10bdcbea7abaa25add7cb133e5bf854c60)) +* **deps:** update dependency @google-cloud/common to v3 ([#367](https://www.github.com/googleapis/nodejs-dns/issues/367)) ([3d8b083](https://www.github.com/googleapis/nodejs-dns/commit/3d8b08380e56dfb62d7b596fde9624119d08b4ec)) +* **deps:** update dependency @google-cloud/paginator to v3 ([#365](https://www.github.com/googleapis/nodejs-dns/issues/365)) ([25ea868](https://www.github.com/googleapis/nodejs-dns/commit/25ea86858f27afbcda7bf8370ac742d0a8abbcb6)) +* **deps:** update dependency @google-cloud/promisify to v2 ([#364](https://www.github.com/googleapis/nodejs-dns/issues/364)) ([2f732bf](https://www.github.com/googleapis/nodejs-dns/commit/2f732bf6fdc44c0f7c471126935ddb62cba5fbd3)) + + +### Build System + +* update to latest version of gts and typescript ([#376](https://www.github.com/googleapis/nodejs-dns/issues/376)) ([c35b94e](https://www.github.com/googleapis/nodejs-dns/commit/c35b94e4a49c5d2644aa64fe4ad85b2de4002e01)) + +### [1.2.9](https://www.github.com/googleapis/nodejs-dns/compare/v1.2.8...v1.2.9) (2020-03-17) + + +### Bug Fixes + +* **deps:** update dependency dns-zonefile to v0.2.6 ([#351](https://www.github.com/googleapis/nodejs-dns/issues/351)) ([437505b](https://www.github.com/googleapis/nodejs-dns/commit/437505b52ab43d7beeb5ce3f5bd6266c1067db96)) + +### [1.2.8](https://www.github.com/googleapis/nodejs-dns/compare/v1.2.7...v1.2.8) (2019-12-05) + + +### Bug Fixes + +* **deps:** pin TypeScript below 3.7.0 ([609120a](https://www.github.com/googleapis/nodejs-dns/commit/609120a5cf39a54f0187fb0a6e4907548a488aa0)) + +### [1.2.7](https://www.github.com/googleapis/nodejs-dns/compare/v1.2.6...v1.2.7) (2019-11-19) + + +### Bug Fixes + +* **docs:** bump release level to GA ([#319](https://www.github.com/googleapis/nodejs-dns/issues/319)) ([8de7f06](https://www.github.com/googleapis/nodejs-dns/commit/8de7f06c178ce07e106f21b922fc9a86ada7964c)) + +### [1.2.6](https://www.github.com/googleapis/nodejs-dns/compare/v1.2.5...v1.2.6) (2019-11-15) + + +### Bug Fixes + +* **docs:** bump release level to beta ([f8ffa40](https://www.github.com/googleapis/nodejs-dns/commit/f8ffa401842cce93565ab8f5aedc47289f62cf39)) +* **docs:** snippets are now replaced in jsdoc comments ([#314](https://www.github.com/googleapis/nodejs-dns/issues/314)) ([06cb858](https://www.github.com/googleapis/nodejs-dns/commit/06cb858d1623b7382c794805571b8311916e20e2)) + +### [1.2.5](https://www.github.com/googleapis/nodejs-dns/compare/v1.2.4...v1.2.5) (2019-10-21) + + +### Bug Fixes + +* **typescript:** make dnsName a required field ([#310](https://www.github.com/googleapis/nodejs-dns/issues/310)) ([887f42a](https://www.github.com/googleapis/nodejs-dns/commit/887f42a7a9389460cc566293d7525b94eccb39e4)) + +### [1.2.4](https://www.github.com/googleapis/nodejs-dns/compare/v1.2.3...v1.2.4) (2019-10-16) + + +### Bug Fixes + +* **typescript:** add correct type safety to zone#create ([#307](https://www.github.com/googleapis/nodejs-dns/issues/307)) ([d5b78b8](https://www.github.com/googleapis/nodejs-dns/commit/d5b78b836d02e7c990b9ae51c932a8b93b451520)) + +### [1.2.3](https://www.github.com/googleapis/nodejs-dns/compare/v1.2.2...v1.2.3) (2019-09-11) + + +### Bug Fixes + +* **deps:** update dependency dns-zonefile to v0.2.3 ([#296](https://www.github.com/googleapis/nodejs-dns/issues/296)) ([06b3f04](https://www.github.com/googleapis/nodejs-dns/commit/06b3f04)) + +### [1.2.2](https://www.github.com/googleapis/nodejs-dns/compare/v1.2.1...v1.2.2) (2019-09-06) + + +### Bug Fixes + +* **docs:** remove anchor from reference doc link ([8e68f6e](https://www.github.com/googleapis/nodejs-dns/commit/8e68f6e)) + +### [1.2.1](https://www.github.com/googleapis/nodejs-dns/compare/v1.2.0...v1.2.1) (2019-07-26) + + +### Bug Fixes + +* **deps:** update dependency @google-cloud/paginator to v2 ([#286](https://www.github.com/googleapis/nodejs-dns/issues/286)) ([bc30fcc](https://www.github.com/googleapis/nodejs-dns/commit/bc30fcc)) + +## [1.2.0](https://www.github.com/googleapis/nodejs-dns/compare/v1.1.2...v1.2.0) (2019-07-14) + + +### Features + +* switch to dns endpoint (options.apiEndpoint is available if time is needed to migrate) ([#283](https://www.github.com/googleapis/nodejs-dns/issues/283)) ([5c180b4](https://www.github.com/googleapis/nodejs-dns/commit/5c180b4)) + +### [1.1.2](https://www.github.com/googleapis/nodejs-dns/compare/v1.1.1...v1.1.2) (2019-06-26) + + +### Bug Fixes + +* **docs:** link to reference docs section on googleapis.dev ([#279](https://www.github.com/googleapis/nodejs-dns/issues/279)) ([a13e5a1](https://www.github.com/googleapis/nodejs-dns/commit/a13e5a1)) + +### [1.1.1](https://www.github.com/googleapis/nodejs-dns/compare/v1.1.0...v1.1.1) (2019-06-14) + + +### Bug Fixes + +* **docs:** move to new client docs URL ([#276](https://www.github.com/googleapis/nodejs-dns/issues/276)) ([53cebe1](https://www.github.com/googleapis/nodejs-dns/commit/53cebe1)) + +## [1.1.0](https://www.github.com/googleapis/nodejs-dns/compare/v1.0.1...v1.1.0) (2019-06-05) + + +### Features + +* support apiEndpoint overrides ([#272](https://www.github.com/googleapis/nodejs-dns/issues/272)) ([2c42f20](https://www.github.com/googleapis/nodejs-dns/commit/2c42f20)) + +### [1.0.1](https://www.github.com/googleapis/nodejs-dns/compare/v1.0.0...v1.0.1) (2019-05-24) + + +### Bug Fixes + +* **types:** use Metadata type instead of r.Response ([#266](https://www.github.com/googleapis/nodejs-dns/issues/266)) ([cf32552](https://www.github.com/googleapis/nodejs-dns/commit/cf32552)) + +## [1.0.0](https://www.github.com/googleapis/nodejs-dns/compare/v0.9.2...v1.0.0) (2019-05-20) + + +### ⚠ BREAKING CHANGES + +* upgrade engines field to >=8.10.0 (#246) + +### Bug Fixes + +* **deps:** update dependency @google-cloud/common to ^0.32.0 ([#238](https://www.github.com/googleapis/nodejs-dns/issues/238)) ([e1ba124](https://www.github.com/googleapis/nodejs-dns/commit/e1ba124)) +* **deps:** update dependency @google-cloud/common to v1 ([#257](https://www.github.com/googleapis/nodejs-dns/issues/257)) ([f8f7398](https://www.github.com/googleapis/nodejs-dns/commit/f8f7398)) +* **deps:** update dependency @google-cloud/paginator to v1 ([#250](https://www.github.com/googleapis/nodejs-dns/issues/250)) ([002e85a](https://www.github.com/googleapis/nodejs-dns/commit/002e85a)) +* **deps:** update dependency @google-cloud/promisify to v1 ([#249](https://www.github.com/googleapis/nodejs-dns/issues/249)) ([25319bf](https://www.github.com/googleapis/nodejs-dns/commit/25319bf)) +* **deps:** update dependency arrify to v2 ([#240](https://www.github.com/googleapis/nodejs-dns/issues/240)) ([5f86971](https://www.github.com/googleapis/nodejs-dns/commit/5f86971)) + + +### Build System + +* upgrade engines field to >=8.10.0 ([#246](https://www.github.com/googleapis/nodejs-dns/issues/246)) ([30d840b](https://www.github.com/googleapis/nodejs-dns/commit/30d840b)) + +## v0.9.2 + +03-12-2019 13:47 PDT + +This patch release has a few bug fixes, and dependency updates. Enjoy! + +### Bug Fixes +- fix: improve types for zone.get ([#201](https://github.com/googleapis/nodejs-dns/pull/201)) + +### Dependencies +- fix(deps): update dependency @google-cloud/paginator to ^0.2.0 +- fix(deps): update dependency @google-cloud/promisify to ^0.4.0 ([#218](https://github.com/googleapis/nodejs-dns/pull/218)) +- fix(deps): update dependency @google-cloud/common to ^0.31.0 ([#209](https://github.com/googleapis/nodejs-dns/pull/209)) + +### Documentation +- docs: update links in contrib guide ([#219](https://github.com/googleapis/nodejs-dns/pull/219)) +- docs: update contributing path in README ([#212](https://github.com/googleapis/nodejs-dns/pull/212)) +- docs: move CONTRIBUTING.md to root ([#211](https://github.com/googleapis/nodejs-dns/pull/211)) +- docs: add lint/fix example to contributing guide ([#208](https://github.com/googleapis/nodejs-dns/pull/208)) + +### Internal / Testing Changes +- build: Add docuploader credentials to node publish jobs ([#223](https://github.com/googleapis/nodejs-dns/pull/223)) +- build: use node10 to run samples-test, system-test etc ([#222](https://github.com/googleapis/nodejs-dns/pull/222)) +- build: update release configuration +- chore(deps): update dependency mocha to v6 +- build: use linkinator for docs test ([#216](https://github.com/googleapis/nodejs-dns/pull/216)) +- chore(deps): update dependency @types/tmp to v0.0.34 ([#217](https://github.com/googleapis/nodejs-dns/pull/217)) +- fix(deps): update dependency yargs to v13 ([#215](https://github.com/googleapis/nodejs-dns/pull/215)) +- build: create docs test npm scripts ([#214](https://github.com/googleapis/nodejs-dns/pull/214)) +- build: test using @grpc/grpc-js in CI ([#213](https://github.com/googleapis/nodejs-dns/pull/213)) +- chore(deps): update dependency eslint-config-prettier to v4 ([#206](https://github.com/googleapis/nodejs-dns/pull/206)) +- build: ignore googleapis.com in doc link check ([#204](https://github.com/googleapis/nodejs-dns/pull/204)) +- build: check broken links in generated docs ([#202](https://github.com/googleapis/nodejs-dns/pull/202)) +- refactor: modernize the sample tests ([#199](https://github.com/googleapis/nodejs-dns/pull/199)) + +## v0.9.1 + +### Dependencies +- chore(deps): update dependency typescript to ~3.2.0 ([#177](https://github.com/googleapis/nodejs-dns/pull/177)) +- fix(deps): update dependency @google-cloud/common to ^0.27.0 ([#176](https://github.com/googleapis/nodejs-dns/pull/176)) + +### Documentation +- fix(docs): place doc comment above the last overload ([#187](https://github.com/googleapis/nodejs-dns/pull/187)) +- docs: update readme badges ([#180](https://github.com/googleapis/nodejs-dns/pull/180)) + +### Internal / Testing Changes +- chore: always nyc report before calling codecov ([#185](https://github.com/googleapis/nodejs-dns/pull/185)) +- chore: nyc ignore build/test by default ([#184](https://github.com/googleapis/nodejs-dns/pull/184)) +- chore: update license file ([#182](https://github.com/googleapis/nodejs-dns/pull/182)) +- fix(build): fix system key decryption ([#178](https://github.com/googleapis/nodejs-dns/pull/178)) +- chore: add synth.metadata + +## v0.9.0 + +11-16-2018 14:11 PST + +### Bug fixes +- fix: fix typescript build ([#171](https://github.com/googleapis/nodejs-dns/pull/171)) +- refactor: remove dependency on extend ([#163](https://github.com/googleapis/nodejs-dns/pull/163)) +- refactor: reduce the number of deps ([#161](https://github.com/googleapis/nodejs-dns/pull/161)) +- fix(deps): update dependency @google-cloud/common to ^0.26.0 ([#145](https://github.com/googleapis/nodejs-dns/pull/145)) +- fix(types): A few more promisified method overloads ([#134](https://github.com/googleapis/nodejs-dns/pull/134)) +- fix(types): Consolidate "createChange" wrappers, add overloads ([#133](https://github.com/googleapis/nodejs-dns/pull/133)) +- fix(docs): add missing methods jsdoc declaration ([#129](https://github.com/googleapis/nodejs-dns/pull/129)) +- docs: First argument of Zone#create is required ([#125](https://github.com/googleapis/nodejs-dns/pull/125)) +- fix: Don't publish sourcemaps ([#120](https://github.com/googleapis/nodejs-dns/pull/120)) + +### Internal / Testing Changes +- chore(deps): update dependency gts to ^0.9.0 ([#169](https://github.com/googleapis/nodejs-dns/pull/169)) +- chore: update eslintignore config ([#168](https://github.com/googleapis/nodejs-dns/pull/168)) +- refactor(samples): convert samples test from ava to mocha ([#154](https://github.com/googleapis/nodejs-dns/pull/154)) +- chore(deps): update dependency @google-cloud/nodejs-repo-tools to v3 ([#165](https://github.com/googleapis/nodejs-dns/pull/165)) +- chore: drop contributors from multiple places ([#164](https://github.com/googleapis/nodejs-dns/pull/164)) +- chore(deps): update dependency @types/is to v0.0.21 ([#162](https://github.com/googleapis/nodejs-dns/pull/162)) +- chore: use latest npm on Windows ([#160](https://github.com/googleapis/nodejs-dns/pull/160)) +- docs(samples): Update samples to use async/await ([#159](https://github.com/googleapis/nodejs-dns/pull/159)) +- chore: update CircleCI config ([#158](https://github.com/googleapis/nodejs-dns/pull/158)) +- chore: include build in eslintignore ([#155](https://github.com/googleapis/nodejs-dns/pull/155)) +- chore(deps): update dependency eslint-plugin-node to v8 ([#150](https://github.com/googleapis/nodejs-dns/pull/150)) +- chore: update issue templates ([#149](https://github.com/googleapis/nodejs-dns/pull/149)) +- chore: remove old issue template ([#147](https://github.com/googleapis/nodejs-dns/pull/147)) +- build: run tests on node11 ([#146](https://github.com/googleapis/nodejs-dns/pull/146)) +- chores(build): do not collect sponge.xml from windows builds ([#144](https://github.com/googleapis/nodejs-dns/pull/144)) +- chores(build): run codecov on continuous builds ([#143](https://github.com/googleapis/nodejs-dns/pull/143)) +- refactor: Use @types/lodash.groupBy ([#136](https://github.com/googleapis/nodejs-dns/pull/136)) +- chore: update new issue template ([#141](https://github.com/googleapis/nodejs-dns/pull/141)) +- chore(deps): update dependency sinon to v7 ([#137](https://github.com/googleapis/nodejs-dns/pull/137)) +- build: fix codecov uploading on Kokoro ([#138](https://github.com/googleapis/nodejs-dns/pull/138)) +- Update kokoro config ([#130](https://github.com/googleapis/nodejs-dns/pull/130)) +- chore(deps): update dependency eslint-plugin-prettier to v3 ([#128](https://github.com/googleapis/nodejs-dns/pull/128)) +- chore(deps): update dependency typescript to ~3.1.0 ([#123](https://github.com/googleapis/nodejs-dns/pull/123)) +- Update CI config ([#122](https://github.com/googleapis/nodejs-dns/pull/122)) +- build: prevent system/sample-test from leaking credentials + +## v0.8.0 + +**THIS RELEASE HAS BREAKING CHANGES**. It also has a few new great features like TypeScript support. Enjoy 🎉 + +#### Support for node.js 4.x and 9.x has ended +Please upgrade to an LTS version of node. + +#### es-style imports +This module now supports es module style imports. This provides forward compatibility with TypeScript, Babel, and the new es module spec. + +#### Old code +```js +const DNS = require('@google-cloud/dns'); +const dns = new DNS(); +// OR... +const dns = require('@google-cloud/dns')(); +``` + +#### New code +```js +const {DNS} = require('@google-cloud/dns'); +const dns = new DNS(); +``` + +### Bug fixes +- fix: improve the types ([#114](https://github.com/googleapis/nodejs-dns/pull/114)) +- fix(DNS): Refine type of getZonesStream ([#113](https://github.com/googleapis/nodejs-dns/pull/113)) +- fix(DNS): Add post-promisify type overloads to DNS methods ([#112](https://github.com/googleapis/nodejs-dns/pull/112)) +- fix: Improve typescript types ([#109](https://github.com/googleapis/nodejs-dns/pull/109)) +- fix: drop support for node.js 4.x and 9.x ([#68](https://github.com/googleapis/nodejs-dns/pull/68)) +- fix: update all dependencies ([#43](https://github.com/googleapis/nodejs-dns/pull/43)) + +### New Features +- feat: use small HTTP dependency ([#93](https://github.com/googleapis/nodejs-dns/pull/93)) +- feat: Convert to TypeScript ([#97](https://github.com/googleapis/nodejs-dns/pull/97)) + +### Dependencies +- fix(deps): update dependency @google-cloud/common to ^0.25.0 ([#107](https://github.com/googleapis/nodejs-dns/pull/107)) +- chore(deps): update dependency @google-cloud/common to ^0.23.0 ([#92](https://github.com/googleapis/nodejs-dns/pull/92)) +- fix(deps): update dependency @google-cloud/common to ^0.22.0 ([#87](https://github.com/googleapis/nodejs-dns/pull/87)) +- fix(deps): update dependency @google-cloud/common to ^0.21.0 ([#82](https://github.com/googleapis/nodejs-dns/pull/82)) +- fix(package): update @google-cloud/common to version 0.20.0 ([#52](https://github.com/googleapis/nodejs-dns/pull/52)) +- Update @google-cloud/common to the latest version 🚀 ([#31](https://github.com/googleapis/nodejs-dns/pull/31)) + +### Documentation +- docs(DNS): Remove extra space in "high- performance" ([#111](https://github.com/googleapis/nodejs-dns/pull/111)) + +### Internal / Testing Changes +- fix: Remove "prettier" from "npm run fix" ([#116](https://github.com/googleapis/nodejs-dns/pull/116)) +- Update kokoro config ([#117](https://github.com/googleapis/nodejs-dns/pull/117)) +- test: remove appveyor config ([#115](https://github.com/googleapis/nodejs-dns/pull/115)) +- Update kokoro config ([#110](https://github.com/googleapis/nodejs-dns/pull/110)) +- Enable prefer-const in the eslint config ([#108](https://github.com/googleapis/nodejs-dns/pull/108)) +- Enable no-var in eslint ([#106](https://github.com/googleapis/nodejs-dns/pull/106)) +- Enable noImplicitAny ([#105](https://github.com/googleapis/nodejs-dns/pull/105)) +- Improve the types ([#103](https://github.com/googleapis/nodejs-dns/pull/103)) +- Update CI config ([#104](https://github.com/googleapis/nodejs-dns/pull/104)) +- Enable noImplicitThis ([#102](https://github.com/googleapis/nodejs-dns/pull/102)) +- chore(deps): update dependency typescript to v3 ([#101](https://github.com/googleapis/nodejs-dns/pull/101)) +- Enable gts fix ([#98](https://github.com/googleapis/nodejs-dns/pull/98)) +- Add synth script and update CI ([#96](https://github.com/googleapis/nodejs-dns/pull/96)) +- Retry npm install in CI ([#95](https://github.com/googleapis/nodejs-dns/pull/95)) +- chore(deps): update dependency nyc to v13 ([#90](https://github.com/googleapis/nodejs-dns/pull/90)) +- chore: use es classes ([#88](https://github.com/googleapis/nodejs-dns/pull/88)) +- test: fail when system-tests do not run ([#86](https://github.com/googleapis/nodejs-dns/pull/86)) +- chore(deps): update dependency eslint-config-prettier to v3 ([#85](https://github.com/googleapis/nodejs-dns/pull/85)) +- chore: split the usage of common ([#84](https://github.com/googleapis/nodejs-dns/pull/84)) +- chore: ignore package-lock.json ([#83](https://github.com/googleapis/nodejs-dns/pull/83)) +- chore(deps): lock file maintenance ([#81](https://github.com/googleapis/nodejs-dns/pull/81)) +- chore: update renovate config ([#80](https://github.com/googleapis/nodejs-dns/pull/80)) +- remove that whitespace ([#79](https://github.com/googleapis/nodejs-dns/pull/79)) +- chore(deps): lock file maintenance ([#78](https://github.com/googleapis/nodejs-dns/pull/78)) +- chore: assert.deelEqual => assert.deepStrictEqual ([#77](https://github.com/googleapis/nodejs-dns/pull/77)) +- chore: move mocha options to mocha.opts ([#75](https://github.com/googleapis/nodejs-dns/pull/75)) +- chore: require node 8 for samples ([#76](https://github.com/googleapis/nodejs-dns/pull/76)) +- chore(deps): lock file maintenance ([#74](https://github.com/googleapis/nodejs-dns/pull/74)) +- chore(deps): update dependency eslint-plugin-node to v7 ([#72](https://github.com/googleapis/nodejs-dns/pull/72)) +- test: use strictEqual in tests ([#73](https://github.com/googleapis/nodejs-dns/pull/73)) +- chore(deps): lock file maintenance ([#71](https://github.com/googleapis/nodejs-dns/pull/71)) +- chore(deps): lock file maintenance ([#70](https://github.com/googleapis/nodejs-dns/pull/70)) +- chore(deps): lock file maintenance ([#69](https://github.com/googleapis/nodejs-dns/pull/69)) +- chore(deps): lock file maintenance ([#67](https://github.com/googleapis/nodejs-dns/pull/67)) +- chore(deps): lock file maintenance ([#66](https://github.com/googleapis/nodejs-dns/pull/66)) +- chore(deps): lock file maintenance ([#65](https://github.com/googleapis/nodejs-dns/pull/65)) +- chore(deps): lock file maintenance ([#64](https://github.com/googleapis/nodejs-dns/pull/64)) +- fix(deps): update dependency yargs to v12 ([#63](https://github.com/googleapis/nodejs-dns/pull/63)) +- chore(deps): update dependency uuid to v3.3.0 ([#59](https://github.com/googleapis/nodejs-dns/pull/59)) +- chore(deps): update dependency sinon to v6 ([#60](https://github.com/googleapis/nodejs-dns/pull/60)) +- Configure Renovate ([#54](https://github.com/googleapis/nodejs-dns/pull/54)) +- refactor: drop repo-tool as an exec wrapper ([#58](https://github.com/googleapis/nodejs-dns/pull/58)) +- chore: update sample lockfiles ([#57](https://github.com/googleapis/nodejs-dns/pull/57)) +- fix: update linking for samples ([#56](https://github.com/googleapis/nodejs-dns/pull/56)) +- chore(package): update eslint to version 5.0.0 ([#55](https://github.com/googleapis/nodejs-dns/pull/55)) +- refactor: switch from var => let/const ([#53](https://github.com/googleapis/nodejs-dns/pull/53)) +- chore(package): update nyc to version 12.0.2 ([#42](https://github.com/googleapis/nodejs-dns/pull/42)) +- chore: lock files maintenance ([#40](https://github.com/googleapis/nodejs-dns/pull/40)) +- chore: timeout for system test ([#38](https://github.com/googleapis/nodejs-dns/pull/38)) +- chore: lock files maintenance ([#37](https://github.com/googleapis/nodejs-dns/pull/37)) +- chore: test on node10 ([#36](https://github.com/googleapis/nodejs-dns/pull/36)) +- chore: lock files maintenance ([#35](https://github.com/googleapis/nodejs-dns/pull/35)) +- chore: one more workaround for repo-tools EPERM ([#33](https://github.com/googleapis/nodejs-dns/pull/33)) +- chore: workaround for repo-tools EPERM ([#32](https://github.com/googleapis/nodejs-dns/pull/32)) +- chore: setup nighty build in CircleCI ([#30](https://github.com/googleapis/nodejs-dns/pull/30)) +- Upgrade repo-tools and regenerate scaffolding. ([#29](https://github.com/googleapis/nodejs-dns/pull/29)) diff --git a/packages/google-cloud-dns/CODE_OF_CONDUCT.md b/packages/google-cloud-dns/CODE_OF_CONDUCT.md new file mode 100644 index 00000000000..2add2547a81 --- /dev/null +++ b/packages/google-cloud-dns/CODE_OF_CONDUCT.md @@ -0,0 +1,94 @@ + +# Code of Conduct + +## Our Pledge + +In the interest of fostering an open and welcoming environment, we as +contributors and maintainers pledge to making participation in our project and +our community a harassment-free experience for everyone, regardless of age, body +size, disability, ethnicity, gender identity and expression, level of +experience, education, socio-economic status, nationality, personal appearance, +race, religion, or sexual identity and orientation. + +## Our Standards + +Examples of behavior that contributes to creating a positive environment +include: + +* Using welcoming and inclusive language +* Being respectful of differing viewpoints and experiences +* Gracefully accepting constructive criticism +* Focusing on what is best for the community +* Showing empathy towards other community members + +Examples of unacceptable behavior by participants include: + +* The use of sexualized language or imagery and unwelcome sexual attention or + advances +* Trolling, insulting/derogatory comments, and personal or political attacks +* Public or private harassment +* Publishing others' private information, such as a physical or electronic + address, without explicit permission +* Other conduct which could reasonably be considered inappropriate in a + professional setting + +## Our Responsibilities + +Project maintainers are responsible for clarifying the standards of acceptable +behavior and are expected to take appropriate and fair corrective action in +response to any instances of unacceptable behavior. + +Project maintainers have the right and responsibility to remove, edit, or reject +comments, commits, code, wiki edits, issues, and other contributions that are +not aligned to this Code of Conduct, or to ban temporarily or permanently any +contributor for other behaviors that they deem inappropriate, threatening, +offensive, or harmful. + +## Scope + +This Code of Conduct applies both within project spaces and in public spaces +when an individual is representing the project or its community. Examples of +representing a project or community include using an official project e-mail +address, posting via an official social media account, or acting as an appointed +representative at an online or offline event. Representation of a project may be +further defined and clarified by project maintainers. + +This Code of Conduct also applies outside the project spaces when the Project +Steward has a reasonable belief that an individual's behavior may have a +negative impact on the project or its community. + +## Conflict Resolution + +We do not believe that all conflict is bad; healthy debate and disagreement +often yield positive results. However, it is never okay to be disrespectful or +to engage in behavior that violates the project’s code of conduct. + +If you see someone violating the code of conduct, you are encouraged to address +the behavior directly with those involved. Many issues can be resolved quickly +and easily, and this gives people more control over the outcome of their +dispute. If you are unable to resolve the matter for any reason, or if the +behavior is threatening or harassing, report it. We are dedicated to providing +an environment where participants feel welcome and safe. + +Reports should be directed to *googleapis-stewards@google.com*, the +Project Steward(s) for *Google Cloud Client Libraries*. It is the Project Steward’s duty to +receive and address reported violations of the code of conduct. They will then +work with a committee consisting of representatives from the Open Source +Programs Office and the Google Open Source Strategy team. If for any reason you +are uncomfortable reaching out to the Project Steward, please email +opensource@google.com. + +We will investigate every complaint, but you may not receive a direct response. +We will use our discretion in determining when and how to follow up on reported +incidents, which may range from not taking action to permanent expulsion from +the project and project-sponsored spaces. We will notify the accused of the +report and provide them an opportunity to discuss it before any action is taken. +The identity of the reporter will be omitted from the details of the report +supplied to the accused. In potentially harmful situations, such as ongoing +harassment or threats to anyone's safety, we may take action without notice. + +## Attribution + +This Code of Conduct is adapted from the Contributor Covenant, version 1.4, +available at +https://www.contributor-covenant.org/version/1/4/code-of-conduct.html \ No newline at end of file diff --git a/packages/google-cloud-dns/CONTRIBUTING.md b/packages/google-cloud-dns/CONTRIBUTING.md new file mode 100644 index 00000000000..cbf3017bb6a --- /dev/null +++ b/packages/google-cloud-dns/CONTRIBUTING.md @@ -0,0 +1,76 @@ +# How to become a contributor and submit your own code + +**Table of contents** + +* [Contributor License Agreements](#contributor-license-agreements) +* [Contributing a patch](#contributing-a-patch) +* [Running the tests](#running-the-tests) +* [Releasing the library](#releasing-the-library) + +## Contributor License Agreements + +We'd love to accept your sample apps and patches! Before we can take them, we +have to jump a couple of legal hurdles. + +Please fill out either the individual or corporate Contributor License Agreement +(CLA). + + * If you are an individual writing original source code and you're sure you + own the intellectual property, then you'll need to sign an [individual CLA](https://developers.google.com/open-source/cla/individual). + * If you work for a company that wants to allow you to contribute your work, + then you'll need to sign a [corporate CLA](https://developers.google.com/open-source/cla/corporate). + +Follow either of the two links above to access the appropriate CLA and +instructions for how to sign and return it. Once we receive it, we'll be able to +accept your pull requests. + +## Contributing A Patch + +1. Submit an issue describing your proposed change to the repo in question. +1. The repo owner will respond to your issue promptly. +1. If your proposed change is accepted, and you haven't already done so, sign a + Contributor License Agreement (see details above). +1. Fork the desired repo, develop and test your code changes. +1. Ensure that your code adheres to the existing style in the code to which + you are contributing. +1. Ensure that your code has an appropriate set of tests which all pass. +1. Title your pull request following [Conventional Commits](https://www.conventionalcommits.org/) styling. +1. Submit a pull request. + +### Before you begin + +1. [Select or create a Cloud Platform project][projects]. +1. [Enable billing for your project][billing]. +1. [Enable the Cloud DNS API][enable_api]. +1. [Set up authentication with a service account][auth] so you can access the + API from your local workstation. + + +## Running the tests + +1. [Prepare your environment for Node.js setup][setup]. + +1. Install dependencies: + + npm install + +1. Run the tests: + + # Run unit tests. + npm test + + # Run sample integration tests. + npm run samples-test + + # Run all system tests. + npm run system-test + +1. Lint (and maybe fix) any changes: + + npm run fix + +[setup]: https://cloud.google.com/nodejs/docs/setup +[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=dns.googleapis.com +[auth]: https://cloud.google.com/docs/authentication/getting-started \ No newline at end of file diff --git a/packages/google-cloud-dns/LICENSE b/packages/google-cloud-dns/LICENSE new file mode 100644 index 00000000000..d6456956733 --- /dev/null +++ b/packages/google-cloud-dns/LICENSE @@ -0,0 +1,202 @@ + + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright [yyyy] [name of copyright owner] + + Licensed under the Apache License, Version 2.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. diff --git a/packages/google-cloud-dns/README.md b/packages/google-cloud-dns/README.md new file mode 100644 index 00000000000..5097a551443 --- /dev/null +++ b/packages/google-cloud-dns/README.md @@ -0,0 +1,154 @@ +[//]: # "This README.md file is auto-generated, all changes to this file will be lost." +[//]: # "To regenerate it, use `python -m synthtool`." +Google Cloud Platform logo + +# [Cloud DNS: Node.js Client](https://github.com/googleapis/google-cloud-node/tree/main/packages/google-cloud-dns) + +[![release level](https://img.shields.io/badge/release%20level-stable-brightgreen.svg?style=flat)](https://cloud.google.com/terms/launch-stages) +[![npm version](https://img.shields.io/npm/v/@google-cloud/dns.svg)](https://www.npmjs.org/package/@google-cloud/dns) + + + + +Cloud DNS Client Library for Node.js + + +A comprehensive list of changes in each version may be found in +[the CHANGELOG](https://github.com/googleapis/google-cloud-node/tree/main/packages/google-cloud-dns/CHANGELOG.md). + +* [Cloud DNS Node.js Client API Reference][client-docs] +* [Cloud DNS Documentation][product-docs] +* [github.com/googleapis/google-cloud-node/packages/google-cloud-dns](https://github.com/googleapis/google-cloud-node/tree/main/packages/google-cloud-dns) + +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) + * [Using the client library](#using-the-client-library) +* [Samples](#samples) +* [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 Cloud DNS API][enable_api]. +1. [Set up authentication with a service account][auth] so you can access the + API from your local workstation. + +### Installing the client library + +```bash +npm install @google-cloud/dns +``` + + +### Using the client library + +```javascript +// Imports the Google Cloud client library +const {DNS} = require('@google-cloud/dns'); + +// Creates a client +const dns = new DNS(); + +async function quickstart() { + // Lists all zones in the current project + const [zones] = await dns.getZones(); + console.log('Zones:'); + zones.forEach(zone => console.log(zone.name)); +} +quickstart(); + +``` + + + +## Samples + +Samples are in the [`samples/`](https://github.com/googleapis/google-cloud-node/tree/main/packages/google-cloud-dns/samples) directory. Each sample's `README.md` has instructions for running its sample. + +| Sample | Source Code | Try it | +| --------------------------- | --------------------------------- | ------ | +| Quickstart | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-dns/samples/quickstart.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-cloud-dns/samples/quickstart.js,packages/google-cloud-dns/samples/README.md) | + + + +The [Cloud DNS Node.js Client API Reference][client-docs] documentation +also contains 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/dns@legacy-8` installs client libraries +for versions compatible with Node.js 8. + +## Versioning + +This library follows [Semantic Versioning](http://semver.org/). + + + +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. + + + + + + +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](https://github.com/googleapis/google-cloud-node/blob/main/CONTRIBUTING.md). + +Please note that this `README.md`, the `samples/README.md`, +and a variety of configuration files in this repository (including `.nycrc` and `tsconfig.json`) +are generated from a central template. To edit one of these files, make an edit +to its templates in +[directory](https://github.com/googleapis/synthtool). + +## License + +Apache Version 2.0 + +See [LICENSE](https://github.com/googleapis/google-cloud-node/blob/main/LICENSE) + +[client-docs]: https://cloud.google.com/nodejs/docs/reference/dns/latest +[product-docs]: https://cloud.google.com/dns +[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=dns.googleapis.com +[auth]: https://cloud.google.com/docs/authentication/getting-started diff --git a/packages/google-cloud-dns/linkinator.config.json b/packages/google-cloud-dns/linkinator.config.json new file mode 100644 index 00000000000..30840bc10c3 --- /dev/null +++ b/packages/google-cloud-dns/linkinator.config.json @@ -0,0 +1,9 @@ +{ + "recurse": true, + "skip": [ + "https://codecov.io/gh/googleapis/", + "img.shields.io" + ], + "silent": true, + "concurrency": 10 +} diff --git a/packages/google-cloud-dns/package.json b/packages/google-cloud-dns/package.json new file mode 100644 index 00000000000..2a39f921043 --- /dev/null +++ b/packages/google-cloud-dns/package.json @@ -0,0 +1,82 @@ +{ + "name": "@google-cloud/dns", + "description": "Cloud DNS Client Library for Node.js", + "version": "4.0.0", + "license": "Apache-2.0", + "author": "Google Inc.", + "engines": { + "node": ">=14.0.0" + }, + "repository": { + "type": "git", + "directory": "packages/google-cloud-dns", + "url": "https://github.com/googleapis/google-cloud-node.git" + }, + "main": "./build/src/index.js", + "types": "./build/src/index.d.ts", + "files": [ + "build/src", + "!build/src/**/*.map" + ], + "keywords": [ + "google apis client", + "google api client", + "google apis", + "google api", + "google", + "google cloud platform", + "google cloud", + "cloud", + "google dns", + "dns" + ], + "scripts": { + "docs": "jsdoc -c .jsdoc.js", + "lint": "gts check", + "test": "c8 mocha build/test", + "samples-test": "npm run compile && cd samples/ && npm link ../ && npm i && npm test", + "presystem-test": "npm run compile", + "system-test": "npm run compile && c8 mocha build/system-test", + "clean": "gts clean", + "compile": "tsc -p .", + "fix": "gts fix", + "prepare": "npm run compile", + "pretest": "npm run compile", + "docs-test": "linkinator docs", + "predocs-test": "npm run docs", + "prelint": "cd samples; npm link ../; npm install", + "precompile": "gts clean" + }, + "dependencies": { + "@google-cloud/common": "^5.0.0", + "@google-cloud/paginator": "^5.0.0", + "@google-cloud/promisify": "^4.0.0", + "arrify": "^2.0.0", + "dns-zonefile": "0.2.10", + "lodash.groupby": "^4.6.0", + "string-format-obj": "^1.1.1" + }, + "devDependencies": { + "@types/lodash.groupby": "^4.6.4", + "@types/mocha": "^9.0.0", + "@types/node": "^20.4.9", + "@types/proxyquire": "^1.3.28", + "@types/request": "^2.48.1", + "@types/tmp": "0.2.4", + "@types/uuid": "^9.0.0", + "c8": "^8.0.1", + "codecov": "^3.0.2", + "gts": "^5.0.0", + "jsdoc": "^4.0.0", + "jsdoc-fresh": "^3.0.0", + "jsdoc-region-tag": "^3.0.0", + "linkinator": "4.1.2", + "long": "^5.2.3", + "mocha": "^9.2.2", + "proxyquire": "^2.0.1", + "tmp": "^0.2.0", + "typescript": "^5.1.6", + "uuid": "^9.0.0" + }, + "homepage": "https://github.com/googleapis/google-cloud-node/tree/main/packages/google-cloud-dns" +} diff --git a/packages/google-cloud-dns/samples/.eslintrc.yml b/packages/google-cloud-dns/samples/.eslintrc.yml new file mode 100644 index 00000000000..282535f55f6 --- /dev/null +++ b/packages/google-cloud-dns/samples/.eslintrc.yml @@ -0,0 +1,3 @@ +--- +rules: + no-console: off diff --git a/packages/google-cloud-dns/samples/README.md b/packages/google-cloud-dns/samples/README.md new file mode 100644 index 00000000000..8ae6c20a689 --- /dev/null +++ b/packages/google-cloud-dns/samples/README.md @@ -0,0 +1,52 @@ +[//]: # "This README.md file is auto-generated, all changes to this file will be lost." +[//]: # "To regenerate it, use `python -m synthtool`." +Google Cloud Platform logo + +# [Cloud DNS: Node.js Samples](https://github.com/googleapis/google-cloud-node) + +[![Open in Cloud Shell][shell_img]][shell_link] + + + +## Table of Contents + +* [Before you begin](#before-you-begin) +* [Samples](#samples) + * [Quickstart](#quickstart) + +## Before you begin + +Before running the samples, make sure you've followed the steps outlined in +[Using the client library](https://github.com/googleapis/google-cloud-node#using-the-client-library). + +`cd samples` + +`npm install` + +`cd ..` + +## Samples + + + +### Quickstart + +Fetches a list of all available zones. + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-dns/samples/quickstart.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-cloud-dns/samples/quickstart.js,samples/README.md) + +__Usage:__ + + +`node quickstart` + + + + + + +[shell_img]: https://gstatic.com/cloudssh/images/open-btn.png +[shell_link]: https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=samples/README.md +[product-docs]: https://cloud.google.com/dns diff --git a/packages/google-cloud-dns/samples/package.json b/packages/google-cloud-dns/samples/package.json new file mode 100644 index 00000000000..d4a25ed9c44 --- /dev/null +++ b/packages/google-cloud-dns/samples/package.json @@ -0,0 +1,25 @@ +{ + "name": "nodejs-docs-samples-dns", + "private": true, + "license": "Apache-2.0", + "author": "Google Inc.", + "repository": "googleapis/nodejs-dns", + "engines": { + "node": ">=14.0.0" + }, + "files": [ + "*.js", + "!test/" + ], + "scripts": { + "test": "mocha --timeout 600000" + }, + "dependencies": { + "@google-cloud/dns": "^4.0.0" + }, + "devDependencies": { + "chai": "^4.2.0", + "mocha": "^8.0.0", + "uuid": "^9.0.0" + } +} \ No newline at end of file diff --git a/packages/google-cloud-dns/samples/quickstart.js b/packages/google-cloud-dns/samples/quickstart.js new file mode 100644 index 00000000000..2084222e717 --- /dev/null +++ b/packages/google-cloud-dns/samples/quickstart.js @@ -0,0 +1,40 @@ +// Copyright 2016 Google LLC +// +// Licensed under the Apache License, Version 2.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. + +'use strict'; + +// sample-metadata: +// name: Quickstart +// description: Fetches a list of all available zones. +// usage: node quickstart + +async function main() { + // [START dns_quickstart] + // Imports the Google Cloud client library + const {DNS} = require('@google-cloud/dns'); + + // Creates a client + const dns = new DNS(); + + async function quickstart() { + // Lists all zones in the current project + const [zones] = await dns.getZones(); + console.log('Zones:'); + zones.forEach(zone => console.log(zone.name)); + } + quickstart(); + // [END dns_quickstart] +} + +main(); diff --git a/packages/google-cloud-dns/samples/test/quickstart.test.js b/packages/google-cloud-dns/samples/test/quickstart.test.js new file mode 100644 index 00000000000..836c9f094b9 --- /dev/null +++ b/packages/google-cloud-dns/samples/test/quickstart.test.js @@ -0,0 +1,47 @@ +// Copyright 2017 Google LLC +// +// Licensed under the Apache License, Version 2.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. + +'use strict'; + +const {execSync} = require('child_process'); +const {assert} = require('chai'); +const {describe, it, before, after} = require('mocha'); +const {DNS} = require('@google-cloud/dns'); +const {v4} = require('uuid'); + +const exec = cmd => execSync(cmd, {encoding: 'utf8'}); + +describe(__filename, () => { + const zoneName = `test-${v4().substr(0, 13)}`; + const dns = new DNS(); + + before(async () => { + const projectId = await dns.getProjectId(); + await dns.createZone(zoneName, { + dnsName: `${projectId}.appspot.com.`, + dnssecConfig: { + state: 'on', + }, + }); + }); + + after(async () => { + await dns.zone(zoneName).delete(); + }); + + it('should run the quickstart', () => { + const output = exec('node quickstart'); + assert.include(output, 'Zones:'); + }); +}); diff --git a/packages/google-cloud-dns/src/change.ts b/packages/google-cloud-dns/src/change.ts new file mode 100644 index 00000000000..0d5e3a29532 --- /dev/null +++ b/packages/google-cloud-dns/src/change.ts @@ -0,0 +1,259 @@ +/*! + * Copyright 2014 Google Inc. All Rights Reserved. + * + * Licensed under the Apache License, Version 2.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 {Metadata, ServiceObject} from '@google-cloud/common'; +import {promisifyAll} from '@google-cloud/promisify'; + +import {Record} from './record'; +import {Zone} from './zone'; + +export interface CreateChangeRequest { + add?: Record | Record[]; + delete?: Record | Record[]; +} + +export type CreateChangeResponse = [Change, Metadata]; + +export interface CreateChangeCallback { + (err: Error | null, change?: Change | null, apiResponse?: Metadata): void; +} + +/** + * @class + * + * @param {Zone} zone The parent zone object. + * @param {string} id ID of the change. + * + * @example + * const {DNS} = require('@google-cloud/dns'); + * const dns = new DNS(); + * const zone = dns.zone('zone-id'); + * const change = zone.change('change-id'); + */ +export class Change extends ServiceObject { + parent!: Zone; + constructor(zone: Zone, id?: string) { + const methods = { + /** + * @typedef {array} ChangeExistsResponse + * @property {boolean} 0 Whether the {@link Change} exists. + */ + /** + * @callback ChangeExistsCallback + * @param {?Error} err Request error, if any. + * @param {boolean} exists Whether the {@link Change} exists. + */ + /** + * Check if the change exists. + * + * @method Change#exists + * @param {ChangeExistsCallback} [callback] Callback function. + * @returns {Promise} + * + * @example + * const {DNS} = require('@google-cloud/dns'); + * const dns = new DNS(); + * const zone = dns.zone('zone-id'); + * const change = zone.change('change-id'); + * + * change.exists((err, exists) => {}); + * + * //- + * // If the callback is omitted, we'll return a Promise. + * //- + * change.exists().then((data) => { + * const exists = data[0]; + * }); + */ + exists: true, + /** + * @typedef {array} GetChangeResponse + * @property {Change} 0 The {@link Change}. + * @property {object} 1 The full API response. + */ + /** + * @callback GetChangeCallback + * @param {?Error} err Request error, if any. + * @param {Change} change The {@link Change}. + * @param {object} apiResponse The full API response. + */ + /** + * Get a change if it exists. + * + * You may optionally use this to "get or create" an object by providing + * an object with `autoCreate` set to `true`. Any extra configuration that + * is normally required for the `create` method must be contained within + * this object as well. + * + * @method Change#get + * @param {options} [options] Configuration object. + * @param {boolean} [options.autoCreate=false] Automatically create the + * object if it does not exist. + * @param {GetChangeCallback} [callback] Callback function. + * @returns {Promise} + * + * @example + * const {DNS} = require('@google-cloud/dns'); + * const dns = new DNS(); + * const zone = dns.zone('zone-id'); + * const change = zone.change('change-id'); + * + * change.get((err, change, apiResponse) => { + * // `change.metadata` has been populated. + * }); + * + * //- + * // If the callback is omitted, we'll return a Promise. + * //- + * change.get().then((data) => { + * const change = data[0]; + * const apiResponse = data[1]; + * }); + */ + get: true, + /** + * @typedef {array} GetChangeMetadataResponse + * @property {object} 0 The {@link Change} metadata. + * @property {object} 1 The full API response. + */ + /** + * @callback GetChangeMetadataCallback + * @param {?Error} err Request error, if any. + * @param {object} metadata The {@link Change} metadata. + * @param {object} apiResponse The full API response. + */ + /** + * Get the metadata for the change in the zone. + * + * @see [Changes: get API Documentation]{@link https://cloud.google.com/dns/api/v1/changes/get} + * + * @method Change#getMetadata + * @param {GetChangeMetadataCallback} [callback] Callback function. + * @returns {Promise} + * + * @example + * const {DNS} = require('@google-cloud/dns'); + * const dns = new DNS(); + * const zone = dns.zone('zone-id'); + * const change = zone.change('change-id'); + * + * change.getMetadata((err, metadata, apiResponse) => { + * if (!err) { + * // metadata = { + * // kind: 'dns#change', + * // additions: [{...}], + * // deletions: [{...}], + * // startTime: '2015-07-21T14:40:06.056Z', + * // id: '1', + * // status: 'done' + * // } + * } + * }); + * + * + * //- + * // If the callback is omitted, we'll return a Promise. + * //- + * change.getMetadata().then((data) => { + * const metadata = data[0]; + * const apiResponse = data[1]; + * }); + */ + getMetadata: true, + }; + /** + * @name Change#metadata + * @type {object} + */ + super({ + parent: zone, + /** + * @name Zone#baseUrl + * @type {string} + * @default "/changes" + */ + baseUrl: '/changes', + /** + * @name Change#id + * @type {string} + */ + id, + methods, + }); + } + + create(config?: CreateChangeRequest): Promise; + create(config: CreateChangeRequest, callback: CreateChangeCallback): void; + create(callback: CreateChangeCallback): void; + /** + * Create a change. + * + * @method Change#create + * @param {CreateChangeRequest} config The configuration object. + * @param {CreateChangeCallback} [callback] Callback function. + * @returns {Promise} + * + * @example + * const {DNS} = require('@google-cloud/dns'); + * const dns = new DNS(); + * const zone = dns.zone('zone-id'); + * const change = zone.change('change-id'); + * + * const config = { + * add: { + * // ... + * } + * }; + * + * change.create(config, (err, change, apiResponse) => { + * if (!err) { + * // The change was created successfully. + * } + * }); + * + * //- + * // If the callback is omitted, we'll return a Promise. + * //- + * change.create(config).then((data) => { + * const change = data[0]; + * const apiResponse = data[1]; + * }); + */ + create( + configOrCallback?: CreateChangeRequest | CreateChangeCallback, + callback?: CreateChangeCallback + ): void | Promise { + const config = typeof configOrCallback === 'object' ? configOrCallback : {}; + callback = + typeof configOrCallback === 'function' ? configOrCallback! : callback; + this.parent.createChange(config, (err, change, apiResponse) => { + if (err) { + callback!(err, null, apiResponse); + return; + } + this.id = change!.id; + this.metadata = change!.metadata; + callback!(null, this, apiResponse); + }); + } +} + +/*! Developer Documentation + * + * All async methods (except for streams) will return a Promise in the event + * that a callback is omitted. + */ +promisifyAll(Change); diff --git a/packages/google-cloud-dns/src/index.ts b/packages/google-cloud-dns/src/index.ts new file mode 100644 index 00000000000..3bcf8ff9af0 --- /dev/null +++ b/packages/google-cloud-dns/src/index.ts @@ -0,0 +1,468 @@ +/*! + * Copyright 2014 Google Inc. All Rights Reserved. + * + * Licensed under the Apache License, Version 2.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 {GoogleAuthOptions, Metadata, Service} from '@google-cloud/common'; +import {paginator} from '@google-cloud/paginator'; +import {promisifyAll} from '@google-cloud/promisify'; +import arrify = require('arrify'); +import {Stream} from 'stream'; + +import {Zone} from './zone'; + +export {Record, RecordMetadata} from './record'; + +export interface GetZonesRequest { + autoPaginate?: boolean; + maxApiCalls?: number; + maxResults?: number; + pageToken?: string; +} + +export interface DNSConfig extends GoogleAuthOptions { + autoRetry?: boolean; + maxRetries?: number; +} + +export interface GetZonesCallback { + ( + err: Error | null, + zones: Zone[] | null, + nextQuery?: GetZonesRequest | null, + apiResponse?: Metadata + ): void; +} + +export type GetZonesResponse = [Zone[], GetZonesRequest | null, Metadata]; + +export interface GetZoneCallback { + (err: Error | null, zone?: Zone | null, apiResponse?: Metadata): void; +} + +export interface CreateZoneRequest { + dnsName: string; + description?: string; + name?: string; + dnssecConfig?: ManagedZoneDnsSecConfig; +} + +export interface ManagedZoneDnsSecConfig { + /** + * Specifies parameters for generating initial DnsKeys for this ManagedZone. Can only be changed while the state is OFF. + */ + defaultKeySpecs?: DnsKeySpec[]; + kind?: string | null; + /** + * Specifies the mechanism for authenticated denial-of-existence responses. Can only be changed while the state is OFF. + */ + nonExistence?: string | null; + /** + * Specifies whether DNSSEC is enabled, and what mode it is in. + */ + state?: 'on' | 'off' | null; +} + +export interface DnsKeySpec { + /** + * String mnemonic specifying the DNSSEC algorithm of this key. + */ + algorithm?: string | null; + /** + * Length of the keys in bits. + */ + keyLength?: number | null; + /** + * Specifies whether this is a key signing key (KSK) or a zone signing key (ZSK). Key signing keys have the Secure Entry Point flag set and, when active, will only be used to sign resource record sets of type DNSKEY. Zone signing keys do not have the Secure Entry Point flag set and will be used to sign all other types of resource record sets. + */ + keyType?: string | null; + kind?: string | null; +} + +export type CreateZoneResponse = [Zone, Metadata]; +export type CreateZoneCallback = GetZoneCallback; + +export interface DNSOptions extends GoogleAuthOptions { + /** + * The API endpoint of the service used to make requests. + * Defaults to `dns.googleapis.com`. + */ + apiEndpoint?: string; +} + +/** + * @typedef {object} ClientConfig + * @property {string} [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/production#providing_credentials_to_your_application + * Application Default Credentials}, your project ID will be detected + * automatically. + * @property {string} [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 above is not necessary. NOTE: .pem and + * .p12 require you to specify the `email` option as well. + * @property {string} [email] Account email address. Required when using a .pem + * or .p12 keyFilename. + * @property {object} [credentials] Credentials object. + * @property {string} [credentials.client_email] + * @property {string} [credentials.private_key] + * @property {boolean} [autoRetry=true] Automatically retry requests if the + * response is related to rate limits or certain intermittent server errors. + * We will exponentially backoff subsequent requests by default. + * @property {number} [maxRetries=3] Maximum number of automatic retries + * attempted before returning the error. + * @property {Constructor} [promise] Custom promise module to use instead of + * native Promises. + */ +/** + * [Cloud DNS](https://cloud.google.com/dns/what-is-cloud-dns) is a + * high-performance, resilient, global DNS service that provides a + * cost-effective way to make your applications and services available to your + * users. This programmable, authoritative DNS service can be used to easily + * publish and manage DNS records using the same infrastructure relied upon by + * Google. + * + * @class + * + * @see [What is Cloud DNS?]{@link https://cloud.google.com/dns/what-is-cloud-dns} + * + * @param {ClientConfig} [options] Configuration options. + * + * @example Import the client library + * const {DNS} = require('@google-cloud/dns'); + * + * @example Create a client that uses Application + * Default Credentials (ADC): const dns = new DNS(); + * + * @example Create a client with explicit + * credentials: const dns = new DNS({ projectId: + * 'your-project-id', keyFilename: '/path/to/keyfile.json' + * }); + * + * @example include:samples/quickstart.js + * region_tag:dns_quickstart + * Full quickstart example: + */ +class DNS extends Service { + getZonesStream: (query: GetZonesRequest) => Stream; + constructor(options: DNSOptions = {}) { + options.apiEndpoint = options.apiEndpoint || 'dns.googleapis.com'; + const config = { + apiEndpoint: options.apiEndpoint, + baseUrl: `https://${options.apiEndpoint}/dns/v1`, + scopes: [ + 'https://www.googleapis.com/auth/ndev.clouddns.readwrite', + 'https://www.googleapis.com/auth/cloud-platform', + ], + packageJson: require('../../package.json'), + }; + super(config, options); + + /** + * Get {@link Zone} objects for all of the zones in your project as + * a readable object stream. + * + * @method DNS#getZonesStream + * @param {GetZonesRequest} [query] Query object for listing zones. + * @returns {ReadableStream} A readable stream that emits {@link Zone} instances. + * + * @example + * const {DNS} = require('@google-cloud/dns'); + * const dns = new DNS(); + * + * dns.getZonesStream() + * .on('error', console.error) + * .on('data', function(zone) { + * // zone is a Zone object. + * }) + * .on('end', () => { + * // All zones retrieved. + * }); + * + * //- + * // If you anticipate many results, you can end a stream early to prevent + * // unnecessary processing and API requests. + * //- + * dns.getZonesStream() + * .on('data', function(zone) { + * this.end(); + * }); + */ + this.getZonesStream = paginator.streamify('getZones'); + } + + createZone( + name: string, + config: CreateZoneRequest + ): Promise; + createZone( + name: string, + config: CreateZoneRequest, + callback: GetZoneCallback + ): void; + /** + * Config to set for the zone. + * + * @typedef {object} CreateZoneRequest + * @property {string} dnsName DNS name for the zone. E.g. "example.com." + * @property {string} [description] Description text for the zone. + */ + /** + * @typedef {array} CreateZoneResponse + * @property {Zone} 0 The new {@link Zone}. + * @property {object} 1 The full API response. + */ + /** + * @callback CreateZoneCallback + * @param {?Error} err Request error, if any. + * @param {Zone} zone The new {@link Zone}. + * @param {object} apiResponse The full API response. + */ + /** + * Create a managed zone. + * + * @method DNS#createZone + * @see [ManagedZones: create API Documentation]{@link https://cloud.google.com/dns/api/v1/managedZones/create} + * + * @throws {error} If a zone name is not provided. + * @throws {error} If a zone dnsName is not provided. + * + * @param {string} name Name of the zone to create, e.g. "my-zone". + * @param {CreateZoneRequest} config Config to set for the zone. + * @param {CreateZoneCallback} [callback] Callback function. + * @returns {Promise} + * @throws {Error} If a name is not provided. + * @see Zone#create + * + * @example + * const {DNS} = require('@google-cloud/dns'); + * const dns = new DNS(); + * + * const config = { + * dnsName: 'example.com.', // note the period at the end of the domain. + * description: 'This zone is awesome!' + * }; + * + * dns.createZone('my-awesome-zone', config, (err, zone, apiResponse) => { + * if (!err) { + * // The zone was created successfully. + * } + * }); + * + * //- + * // If the callback is omitted, we'll return a Promise. + * //- + * dns.createZone('my-awesome-zone', config).then((data) => { + * const zone = data[0]; + * const apiResponse = data[1]; + * }); + */ + createZone( + name: string, + config: CreateZoneRequest, + callback?: GetZoneCallback + ): void | Promise { + if (!name) { + throw new Error('A zone name is required.'); + } + if (!config || !config.dnsName) { + throw new Error('A zone dnsName is required.'); + } + config.name = name; + // Required by the API. + config.description = config.description || ''; + this.request( + { + method: 'POST', + uri: '/managedZones', + json: config, + }, + (err, resp) => { + if (err) { + callback!(err, null, resp); + return; + } + const zone = this.zone(resp.name); + zone.metadata = resp; + callback!(null, zone, resp); + } + ); + } + + getZones(query?: GetZonesRequest): Promise; + getZones(callback: GetZonesCallback): void; + getZones(query: GetZonesRequest, callback: GetZonesCallback): void; + /** + * Query object for listing zones. + * + * @typedef {object} GetZonesRequest + * @property {boolean} [autoPaginate=true] Have pagination handled + * automatically. + * @property {number} [maxApiCalls] Maximum number of API calls to make. + * @property {number} [maxResults] Maximum number of items plus prefixes to + * return. + * @property {string} [pageToken] A previously-returned page token + * representing part of the larger set of results to view. + */ + /** + * @typedef {array} GetZonesResponse + * @property {Zone[]} 0 Array of {@link Zone} instances. + * @property {object} 1 The full API response. + */ + /** + * @callback GetZonesCallback + * @param {?Error} err Request error, if any. + * @param {Zone[]} zones Array of {@link Zone} instances. + * @param {object} apiResponse The full API response. + */ + /** + * Gets a list of managed zones for the project. + * + * @method DNS#getZones + * @see [ManagedZones: list API Documentation]{@link https://cloud.google.com/dns/api/v1/managedZones/list} + * + * @param {GetZonesRequest} [query] Query object for listing zones. + * @param {GetZonesCallback} [callback] Callback function. + * @returns {Promise} + * + * @example + * const {DNS} = require('@google-cloud/dns'); + * const dns = new DNS(); + * + * dns.getZones((err, zones, apiResponse) {}); + * + * //- + * // If the callback is omitted, we'll return a Promise. + * //- + * dns.getZones().then(data => { + * const zones = data[0]; + * }); + */ + getZones( + queryOrCallback?: GetZonesRequest | GetZonesCallback, + callback?: GetZonesCallback + ): void | Promise { + const query = typeof queryOrCallback === 'object' ? queryOrCallback : {}; + callback = + typeof queryOrCallback === 'function' ? queryOrCallback : callback; + this.request( + { + uri: '/managedZones', + qs: query, + }, + (err, resp) => { + if (err) { + callback!(err, null, null, resp); + return; + } + // eslint-disable-next-line @typescript-eslint/no-explicit-any + const zones = arrify(resp.managedZones).map((zone: any) => { + const zoneInstance = this.zone(zone.name); + zoneInstance.metadata = zone; + return zoneInstance; + }); + let nextQuery: GetZonesRequest | null = null; + if (resp.nextPageToken) { + nextQuery = Object.assign({}, query, { + pageToken: resp.nextPageToken, + }); + } + callback!(null, zones, nextQuery, resp); + } + ); + } + + /** + * Get a reference to a Zone. + * + * @param {string} name The unique name of the zone. + * @returns {Zone} + * @see Zone + * + * @throws {error} If a zone name is not provided. + * + * @example + * const {DNS} = require('@google-cloud/dns'); + * const dns = new DNS(); + * + * const zone = dns.zone('my-zone'); + */ + zone(name: string) { + if (!name) { + throw new Error('A zone name is required.'); + } + return new Zone(this, name); + } +} + +/*! Developer Documentation + * + * These methods can be auto-paginated. + */ +paginator.extend(DNS, 'getZones'); + +/*! Developer Documentation + * + * All async methods (except for streams) will return a Promise in the event + * that a callback is omitted. + */ +promisifyAll(DNS, { + exclude: ['zone'], +}); + +/** + * {@link Zone} class. + * + * @name DNS.Zone + * @see Zone + * @type {Constructor} + */ +export {Zone}; + +/** + * The default export of the `@google-cloud/dns` package is the {@link DNS} + * class. + * + * See {@link DNS} and {@link ClientConfig} for client methods and + * configuration options. + * + * @module {DNS} @google-cloud/dns + * @alias nodejs-dns + * + * @example Install the client library with npm: npm install --save + * @google-cloud/dns + * + * @example Import the client library + * const {DNS} = require('@google-cloud/dns'); + * + * @example Create a client that uses Application + * Default Credentials (ADC): const dns = new DNS(); + * + * @example Create a client with explicit + * credentials: const dns = new DNS({ projectId: + * 'your-project-id', keyFilename: '/path/to/keyfile.json' + * }); + * + * @example include:samples/quickstart.js + * region_tag:dns_quickstart + * Full quickstart example: + */ +export {DNS}; diff --git a/packages/google-cloud-dns/src/record.ts b/packages/google-cloud-dns/src/record.ts new file mode 100644 index 00000000000..fabebb42620 --- /dev/null +++ b/packages/google-cloud-dns/src/record.ts @@ -0,0 +1,228 @@ +/*! + * Copyright 2014 Google Inc. All Rights Reserved. + * + * Licensed under the Apache License, Version 2.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 {promisifyAll} from '@google-cloud/promisify'; +import arrify = require('arrify'); +import {Change, CreateChangeCallback} from './change'; +import {Zone} from './zone'; +import {Metadata} from '@google-cloud/common'; + +// eslint-disable-next-line @typescript-eslint/no-var-requires +const format = require('string-format-obj'); + +export interface RecordObject { + rrdatas?: Array<{}>; + rrdata?: {}; + data?: {}; + type?: string; +} + +export interface RecordMetadata { + name: string; + data: string | string[]; + ttl: number; + type?: string; + signatureRrdatas?: string[]; +} + +/** + * @typedef {array} DeleteRecordResponse + * @property {Change} 0 A {@link Change} object. + * @property {object} 1 The full API response. + */ +export type DeleteRecordResponse = [Change, Metadata]; + +/** + * @callback DeleteRecordCallback + * @param {?Error} err Request error, if any. + * @param {?Change} change A {@link Change} object. + * @param {object} apiResponse The full API response. + */ +export interface DeleteRecordCallback { + (err: Error | null, change?: Change, apiResponse?: Metadata): void; +} + +/** + * Create a Resource Record object. + * + * @class + * + * @param {string} type The record type, e.g. `A`, `AAAA`, `MX`. + * @param {object} metadata The metadata of this record. + * @param {string} metadata.name The name of the record, e.g. + * `www.example.com.`. + * @param {string[]} metadata.data Defined in + * [RFC 1035, section 5](https://goo.gl/9EiM0e) and + * [RFC 1034, section 3.6.1](https://goo.gl/Hwhsu9). + * @param {number} metadata.ttl Seconds that the resource is cached by + * resolvers. + * + * @example + * const {DNS} = require('@google-cloud/dns'); + * const dns = new DNS(); + * const zone = dns.zone('my-awesome-zone'); + * + * const record = zone.record('a', { + * name: 'example.com.', + * ttl: 86400, + * data: '1.2.3.4' + * }); + */ +export class Record implements RecordObject { + zone_: Zone; + type: string; + metadata: RecordMetadata; + rrdatas?: Array<{}>; + data?: {}; + constructor(zone: Zone, type: string, metadata: RecordMetadata) { + this.zone_ = zone; + /** + * @name Record#type + * @type {string} + */ + this.type = type; + /** + * @name Record#metadata + * @type {object} + * @property {string} name + * @property {string[]} data + * @property {number} metadata.ttl + */ + this.metadata = metadata; + Object.assign(this, this.toJSON()); + if (this.rrdatas) { + /** + * @name Record#data + * @type {?object[]} + */ + this.data = this.rrdatas; + delete this.rrdatas; + } + } + + delete(): Promise; + delete(callback: CreateChangeCallback): void; + /** + * Delete this record by creating a change on your zone. This is a convenience + * method for: + * + * zone.createChange({ + * delete: record + * }, (err, change, apiResponse) => {}); + * + * @see [ManagedZones: create API Documentation]{@link https://cloud.google.com/dns/api/v1/managedZones/create} + * + * @param {DeleteRecordCallback} [callback] Callback function. + * @returns {Promise} + * + * @example + * const {DNS} = require('@google-cloud/dns'); + * const dns = new DNS(); + * const zone = dns.zone('zone-id'); + * const record = zone.record('a', { + * name: 'example.com.', + * ttl: 86400, + * data: '1.2.3.4' + * }); + * + * record.delete((err, change, apiResponse) => { + * if (!err) { + * // Delete change modification was created. + * } + * }); + * + * //- + * // If the callback is omitted, we'll return a Promise. + * //- + * record.delete().then((data) => { + * const change = data[0]; + * const apiResponse = data[1]; + * }); + */ + delete( + callback?: CreateChangeCallback + ): void | Promise { + this.zone_.deleteRecords(this, callback!); + } + /** + * Serialize the record instance to the format the API expects. + * + * @returns {object} + */ + toJSON() { + const recordObject: RecordObject = Object.assign({}, this.metadata, { + type: this.type.toUpperCase(), + }); + if (recordObject.data) { + recordObject.rrdatas = arrify(recordObject.data); + delete recordObject.data; + } + return recordObject; + } + /** + * Convert the record to a string, formatted for a zone file. + * + * @returns {string} + */ + toString() { + const json = this.toJSON(); + return (json.rrdatas || [{}]) + .map(data => { + json.rrdata = data; + return format('{name} {ttl} IN {type} {rrdata}', json); + }) + .join('\n'); + } + /** + * Create a Record instance from a resource record set in a zone file. + * + * @private + * + * @param {Zone} zone The zone. + * @param {string} type The record type, e.g. `A`, `AAAA`, `MX`. + * @param {object} bindData Metadata parsed from dns-zonefile. Properties vary + * based on the type of record. + * @returns {Record} + */ + static fromZoneRecord_(zone: Zone, type: string, bindData: RecordMetadata) { + const typeToZoneFormat = { + a: '{ip}', + aaaa: '{ip}', + cname: '{alias}', + mx: '{preference} {host}', + ns: '{host}', + soa: '{mname} {rname} {serial} {retry} {refresh} {expire} {minimum}', + spf: '{data}', + srv: '{priority} {weight} {port} {target}', + txt: '{txt}', + } as {[index: string]: string}; + const metadata = { + data: format(typeToZoneFormat[type.toLowerCase()], bindData), + name: bindData.name, + ttl: bindData.ttl, + }; + return new Record(zone, type, metadata); + } +} + +/*! Developer Documentation + * + * All async methods (except for streams) will return a Promise in the event + * that a callback is omitted. + */ +promisifyAll(Record, { + exclude: ['toJSON', 'toString'], +}); diff --git a/packages/google-cloud-dns/src/zone.ts b/packages/google-cloud-dns/src/zone.ts new file mode 100644 index 00000000000..03df70aca66 --- /dev/null +++ b/packages/google-cloud-dns/src/zone.ts @@ -0,0 +1,1363 @@ +/*! + * Copyright 2014 Google Inc. All Rights Reserved. + * + * Licensed under the Apache License, Version 2.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 { + DeleteCallback, + GetConfig, + Metadata, + ServiceObject, + ServiceObjectConfig, +} from '@google-cloud/common'; +import {paginator} from '@google-cloud/paginator'; +import {promisifyAll} from '@google-cloud/promisify'; +import arrify = require('arrify'); +import * as fs from 'fs'; + +import groupBy = require('lodash.groupby'); + +// eslint-disable-next-line @typescript-eslint/no-var-requires +const zonefile = require('dns-zonefile'); + +import {Change} from './change'; +import {Record, RecordMetadata, RecordObject} from './record'; +import { + DNS, + CreateZoneRequest, + CreateZoneResponse, + CreateZoneCallback, +} from '.'; +import {Readable} from 'stream'; +import {InstanceResponseCallback} from '@google-cloud/common'; +import {GetResponse} from '@google-cloud/common/build/src/service-object'; + +/** + * Config to set for the change. + * + * @typedef {object} CreateChangeRequest + * @property {Record|Record[]} add {@link Record} objects to add to this zone. + * @property {Record|Record[]} delete {@link Record} objects to delete + * from this zone. Be aware that the resource records here must match + * exactly to be deleted. + */ +export interface CreateChangeRequest { + add?: Record | Record[]; + delete?: Record | Record[]; +} + +/** + * @typedef {array} CreateChangeResponse + * @property {Change} 0 A {@link Change} object. + * @property {object} 1 The full API response. + */ +export type CreateChangeResponse = [Change, Metadata]; + +/** + * @callback CreateChangeCallback + * @param {?Error} err Request error, if any. + * @param {?Change} change A {@link Change} object. + * @param {object} apiResponse The full API response. + */ +export interface CreateChangeCallback { + (err: Error | null, change?: Change, apiResponse?: Metadata): void; +} + +/** + * @typedef {array} DeleteZoneResponse + * @property {object} 0 The full API response. + */ +export type DeleteZoneResponse = [Metadata]; + +/** + * @callback DeleteZoneCallback + * @param {?Error} err Request error, if any. + * @param {object} apiResponse The full API response. + */ +export type DeleteZoneCallback = DeleteCallback; + +export interface DeleteZoneConfig { + force?: boolean; +} + +export interface GetRecordsCallback { + ( + err: Error | null, + records?: Record[] | null, + nextQuery?: {} | null, + apiResponse?: Metadata + ): void; +} + +export type GetRecordsResponse = [Record[], Metadata]; + +export interface GetRecordsRequest { + autoPaginate?: boolean; + maxApiCalls?: number; + maxResults?: number; + name?: string; + pageToken?: string; + type?: string; + filterByTypes_?: {[index: string]: boolean}; +} + +export interface GetZoneRequest extends CreateZoneRequest, GetConfig {} + +/** + * Query object for listing changes. + * + * @typedef {object} GetChangesRequest + * @property {boolean} [autoPaginate=true] Have pagination handled automatically. + * @property {number} [maxApiCalls] Maximum number of API calls to make. + * @property {number} [maxResults] Maximum number of items plus prefixes to + * return. + * @property {string} [pageToken] A previously-returned page token + * representing part of the larger set of results to view. + * @property {string} [sort] Set to 'asc' for ascending, and 'desc' for + * descending or omit for no sorting. + */ +export interface GetChangesRequest { + autoPaginate?: boolean; + maxApiCalls?: number; + maxResults?: number; + pageToken?: string; + sort?: string; + sortOrder?: string; +} + +/** + * @typedef {array} GetChangesResponse + * @property {Change[]} 0 Array of {@link Change} instances. + * @property {object} 1 The full API response. + */ +export type GetChangesResponse = [Change[], Metadata]; + +/** + * @callback GetChangesCallback + * @param {?Error} err Request error, if any. + * @param {Change[]} changes Array of {@link Change} instances. + * @param {object} apiResponse The full API response. + */ + +export interface GetChangesCallback { + ( + err: Error | null, + changes?: Change[] | null, + nextQuery?: {} | null, + apiResponse?: Metadata + ): void; +} + +/** + * @typedef {array} ZoneExportResponse + * @property {object} 0 The full API response. + */ +export type ZoneExportResponse = [Metadata]; + +/** + * @callback ZoneExportCallback + * @param {?Error} err Request error, if any. + * @param {object} apiResponse The full API response. + */ +export interface ZoneExportCallback { + (err: Error | null): void; +} + +// This type essentially just clones a class but allows us to exclude methods +// from the type itself. In this case it is useful because we want to override +// the Zone#create signature that is defined in the common library. +type Without = { + [P in Exclude]: T[P]; +}; + +// Using the Without type, we essentially make a new ServiceObject type that +// doesn't contain any of the methods that have signatures we wish to override. +type ZoneServiceObject = new ( + config: ServiceObjectConfig +) => Without, 'create' | 'delete' | 'get'>; + +// This is used purely for making TypeScript think that the object we are +// subclassing does not contain a signature mismatch for methods we are +// overriding. +// tslint:disable-next-line variable-name +const ZoneServiceObject = ServiceObject as ZoneServiceObject; + +/** + * A Zone object is used to interact with your project's managed zone. It will + * help you add or delete records, delete your zone, and many other convenience + * methods. + * + * @class + * + * @example + * const {DNS} = require('@google-cloud/dns'); + * const dns = new DNS(); + * + * const zone = dns.zone('zone-id'); + */ +class Zone extends ZoneServiceObject { + name: string; + getRecordsStream: (query?: GetRecordsRequest | string | string[]) => Readable; + getChangesStream: (query?: GetChangesRequest) => Readable; + constructor(dns: DNS, name: string) { + const methods = { + /** + * Create a zone. + * + * @method Zone#create + * @param {CreateZoneRequest} metadata Metadata to set for the zone. + * @param {CreateZoneCallback} [callback] Callback function. + * @returns {Promise} + * + * @example + * const {DNS} = require('@google-cloud/dns'); + * const dns = new DNS(); + * const zone = dns.zone('zone-id'); + * + * const config = { + * dnsName: 'example.com.', + * // ... + * }; + * + * zone.create(config, (err, zone, apiResponse) => { + * if (!err) { + * // The zone was created successfully. + * } + * }); + * + * //- + * // If the callback is omitted, we'll return a Promise. + * //- + * zone.create(config).then((data) => { + * const zone = data[0]; + * const apiResponse = data[1]; + * }); + */ + create: true, + /** + * @typedef {array} ZoneExistsResponse + * @property {boolean} 0 Whether the {@link Zone} exists. + */ + /** + * @callback ZoneExistsCallback + * @param {?Error} err Request error, if any. + * @param {boolean} exists Whether the {@link Zone} exists. + */ + /** + * Check if the zone exists. + * + * @method Zone#exists + * @param {ZoneExistsCallback} [callback] Callback function. + * @returns {Promise} + * + * @example + * const {DNS} = require('@google-cloud/dns'); + * const dns = new DNS(); + * const zone = dns.zone('zone-id'); + * + * zone.exists((err, exists) => {}); + * + * //- + * // If the callback is omitted, we'll return a Promise. + * //- + * zone.exists().then((data) => { + * const exists = data[0]; + * }); + */ + exists: true, + /** + * @typedef {array} GetZoneResponse + * @property {Zone} 0 The {@link Zone}. + * @property {object} 1 The full API response. + */ + /** + * @callback GetZoneCallback + * @param {?Error} err Request error, if any. + * @param {Zone} zone The {@link Zone}. + * @param {object} apiResponse The full API response. + */ + /** + * Get a zone if it exists. + * + * You may optionally use this to "get or create" an object by providing + * an object with `autoCreate` set to `true`. Any extra configuration that + * is normally required for the `create` method must be contained within + * this object as well. + * + * @method Zone#get + * @param {options} [options] Configuration object. + * @param {boolean} [options.autoCreate=false] Automatically create the + * object if it does not exist. + * @param {GetZoneCallback} [callback] Callback function. + * @returns {Promise} + * + * @example + * const {DNS} = require('@google-cloud/dns'); + * const dns = new DNS(); + * const zone = dns.zone('zone-id'); + * + * zone.get((err, zone, apiResponse) => { + * // `zone.metadata` has been populated. + * }); + * + * //- + * // If the callback is omitted, we'll return a Promise. + * //- + * zone.get().then(data => { + * const zone = data[0]; + * const apiResponse = data[1]; + * }); + */ + get: true, + /** + * @typedef {array} GetZoneMetadataResponse + * @property {object} 0 The {@link Zone} metadata. + * @property {object} 1 The full API response. + */ + /** + * @callback GetZoneMetadataCallback + * @param {?Error} err Request error, if any. + * @param {object} metadata The {@link Zone} metadata. + * @param {object} apiResponse The full API response. + */ + /** + * Get the metadata for the zone. + * + * @see [ManagedZones: get API Documentation]{@link https://cloud.google.com/dns/api/v1/managedZones/get} + * + * @method Zone#getMetadata + * @param {GetZoneMetadataCallback} [callback] Callback function. + * @returns {Promise} + * + * @example + * const {DNS} = require('@google-cloud/dns'); + * const dns = new DNS(); + * const zone = dns.zone('zone-id'); + * + * zone.getMetadata((err, metadata, apiResponse) => {}); + * + * //- + * // If the callback is omitted, we'll return a Promise. + * //- + * zone.getMetadata().then((data) => { + * const metadata = data[0]; + * const apiResponse = data[1]; + * }); + */ + getMetadata: true, + }; + /** + * @name Zone#metadata + * @type {object} + */ + super({ + parent: dns, + /** + * @name Zone#baseUrl + * @type {string} + * @default "/managedZones" + */ + baseUrl: '/managedZones', + /** + * @name Zone#id + * @type {string} + */ + id: name, + createMethod: dns.createZone.bind(dns), + methods, + }); + /** + * @name Zone#name + * @type {string} + */ + this.name = name; + this.getRecordsStream = paginator.streamify('getRecords'); + this.getChangesStream = paginator.streamify('getChanges'); + } + + create(config: CreateZoneRequest): Promise; + create(config: CreateZoneRequest, callback: CreateZoneCallback): void; + create( + config: CreateZoneRequest, + callback?: CreateZoneCallback + ): void | Promise { + // eslint-disable-next-line @typescript-eslint/no-explicit-any + const args = [config, callback!] as any; + ServiceObject.prototype.create.apply(this, args); + } + + get(config?: GetZoneRequest): Promise>; + get(callback: InstanceResponseCallback): void; + get(config: GetZoneRequest, callback: InstanceResponseCallback): void; + get( + configOrCallback?: GetZoneRequest | InstanceResponseCallback, + callback?: InstanceResponseCallback + ): void | Promise> { + const config = typeof configOrCallback === 'object' ? configOrCallback : {}; + callback = + typeof configOrCallback === 'function' ? configOrCallback : callback; + ServiceObject.prototype.get.call(this, config, callback!); + } + + addRecords(records: Record | Record[]): Promise; + addRecords(records: Record | Record[], callback: CreateChangeCallback): void; + /** + * Add records to this zone. This is a convenience wrapper around + * {@link Zone#createChange}. + * + * @see [ManagedZones: create API Documentation]{@link https://cloud.google.com/dns/api/v1/managedZones/create} + * + * @param {Record|Record[]} record The {@link Record} object(s) to add. + * @param {CreateChangeCallback} [callback] Callback function. + * @returns {Promise} + */ + addRecords( + records: Record | Record[], + callback?: CreateChangeCallback + ): void | Promise { + this.createChange({add: records}, callback!); + } + /** + * Create a reference to a {@link Change} object in this zone. + * + * @param {string} id The change id. + * @returns {Change} + * + * @example + * const {DNS} = require('@google-cloud/dns'); + * const dns = new DNS(); + * const zone = dns.zone('zone-id'); + * const change = zone.change('change-id'); + */ + change(id?: string) { + return new Change(this, id); + } + + createChange(config: CreateChangeRequest): Promise; + createChange( + config: CreateChangeRequest, + callback: CreateChangeCallback + ): void; + /** + * Create a change of resource record sets for the zone. + * + * @see [ManagedZones: create API Documentation]{@link https://cloud.google.com/dns/api/v1/managedZones/create} + * + * @param {CreateChangeRequest} config The configuration object. + * @param {CreateChangeCallback} [callback] Callback function. + * @returns {Promise} + * + * @example + * const {DNS} = require('@google-cloud/dns'); + * const dns = new DNS(); + * const zone = dns.zone('zone-id'); + * + * const oldARecord = zone.record('a', { + * name: 'example.com.', + * data: '1.2.3.4', + * ttl: 86400 + * }); + * + * const newARecord = zone.record('a', { + * name: 'example.com.', + * data: '5.6.7.8', + * ttl: 86400 + * }); + * + * const config = { + * add: newARecord, + * delete: oldARecord + * }; + * + * zone.createChange(config, (err, change, apiResponse) => { + * if (!err) { + * // The change was created successfully. + * } + * }); + * + * //- + * // If the callback is omitted, we'll return a Promise. + * //- + * zone.createChange(config).then((data) => { + * const change = data[0]; + * const apiResponse = data[1]; + * }); + */ + createChange( + config: CreateChangeRequest, + callback?: CreateChangeCallback + ): void | Promise { + if (!config || (!config.add && !config.delete)) { + throw new Error('Cannot create a change with no additions or deletions.'); + } + const groupByType = (recordsIn: RecordObject[]) => { + const recordsByType = groupBy(recordsIn, 'type'); + const recordsOut: RecordObject[] = []; + // tslint:disable-next-line:forin + for (const recordType in recordsByType) { + const recordsByName = groupBy(recordsByType[recordType], 'name'); + // tslint:disable-next-line:forin + for (const recordName in recordsByName) { + const records = recordsByName[recordName]; + const templateRecord = Object.assign({}, records[0]); + if (records.length > 1) { + // Combine the `rrdatas` values from all records of the same type. + templateRecord.rrdatas = records + .map(x => x.rrdatas) + .reduce((acc, rrdata) => acc!.concat(rrdata!), []); + } + recordsOut.push(templateRecord); + } + } + return recordsOut; + }; + const body = Object.assign( + { + additions: groupByType( + (arrify(config.add) as Record[]).map(x => x.toJSON()) + ), + deletions: groupByType( + (arrify(config.delete) as Record[]).map(x => x.toJSON()) + ), + }, + config + ); + delete body.add; + delete body.delete; + this.request( + { + method: 'POST', + uri: '/changes', + json: body, + }, + (err, resp) => { + if (err) { + callback!(err, undefined, resp); + return; + } + const change = this.change(resp.id); + change.metadata = resp; + callback!(null, change, resp); + } + ); + } + + delete(options?: DeleteZoneConfig): Promise; + delete(callback: DeleteZoneCallback): void; + delete(options: DeleteZoneConfig, callback: DeleteZoneCallback): void; + /** + * Delete the zone. + * + * Only empty zones can be deleted. Set `options.force` to `true` to call + * {@link Zone#empty} before deleting the zone. Two API calls will then be + * made (one to empty, another to delete), which means this is not an + * atomic request. + * + * @see [ManagedZones: delete API Documentation]{@link https://cloud.google.com/dns/api/v1/managedZones/delete} + * + * @param {object} [options] Configuration object. + * @param {boolean} [options.force=false] Empty the zone before deleting. + * @param {DeleteZoneCallback} [callback] Callback function. + * @returns {Promise} + * + * @example + * const {DNS} = require('@google-cloud/dns'); + * const dns = new DNS(); + * const zone = dns.zone('zone-id'); + * + * zone.delete((err, apiResponse) => { + * if (!err) { + * // The zone is now deleted. + * } + * }); + * + * //- + * // Use `force` to first empty the zone before deleting it. + * //- + * zone.delete({ + * force: true + * }, (err, apiResponse) => { + * if (!err) { + * // The zone is now deleted. + * } + * }); + * + * //- + * // If the callback is omitted, we'll return a Promise. + * //- + * zone.delete().then(data => { + * const apiResponse = data[0]; + * }); + */ + delete( + optionsOrCallback?: DeleteZoneConfig | DeleteZoneCallback, + callback?: DeleteZoneCallback + ): void | Promise { + const options = + typeof optionsOrCallback === 'object' ? optionsOrCallback : {}; + callback = + typeof optionsOrCallback === 'function' ? optionsOrCallback : callback; + if (options.force) { + this.empty(err => { + if (err) { + callback!(err); + return; + } + this.delete(callback!); + }); + return; + } + + ServiceObject.prototype.delete.call(this, callback!); + } + + deleteRecords( + records?: Record | Record[] | string + ): Promise; + deleteRecords(callback: CreateChangeCallback): void; + deleteRecords( + records: Record | Record[] | string, + callback: CreateChangeCallback + ): void; + /** + * Delete records from this zone. This is a convenience wrapper around + * {@link Zone#createChange}. + * + * This method accepts {@link Record} objects or string record types in + * its place. This means that you can delete all A records or NS records, etc. + * If used this way, two API requests are made (one to get, then another to + * delete), which means **the operation is not atomic** and could result in + * unexpected changes. + * + * @see [ManagedZones: create API Documentation]{@link https://cloud.google.com/dns/api/v1/managedZones/create} + * + * @param {Record|Record[]|string} record If given a string, it is interpreted + * as a record type. All records that match that type will be retrieved + * and then deleted. You can also provide a {@link Record} object or array of + * {@link Record} objects. + * @param {CreateChangeCallback} [callback] Callback function. + * @returns {Promise} + * + * @example + * const {DNS} = require('@google-cloud/dns'); + * const dns = new DNS(); + * const zone = dns.zone('zone-id'); + * + * const oldARecord = zone.record('a', { + * name: 'example.com.', + * data: '1.2.3.4', + * ttl: 86400 + * }); + * + * const callback = (err, change, apiResponse) => { + * if (!err) { + * // Delete change modification was created. + * } + * }; + * + * zone.deleteRecords(oldARecord, callback); + * + * //- + * // Delete multiple records at once. + * //- + * const oldNs1Record = zone.record('ns', { + * name: 'example.com.', + * data: 'ns-cloud1.googledomains.com.', + * ttl: 86400 + * }); + * + * const oldNs2Record = zone.record('ns', { + * name: 'example.com.', + * data: 'ns-cloud2.googledomains.com.', + * ttl: 86400 + * }); + * + * zone.deleteRecords([ + * oldNs1Record, + * oldNs2Record + * ], callback); + * + * //- + * // Possibly a simpler way to perform the above change is deleting records + * by + * // type. + * //- + * zone.deleteRecords('ns', callback); + * + * //- + * // You can also delete records of multiple types. + * //- + * zone.deleteRecords(['ns', 'a'], callback); + * + * //- + * // If the callback is omitted, we'll return a Promise. + * //- + * zone.deleteRecords(oldARecord).then((data) => { + * const change = data[0]; + * const apiResponse = data[1]; + * }); + */ + deleteRecords( + recordsOrCallback?: Record | Record[] | string | CreateChangeCallback, + callback?: CreateChangeCallback + ): void | Promise { + let records: Array; + if (typeof recordsOrCallback === 'function') { + callback = recordsOrCallback; + records = []; + } else { + records = arrify(recordsOrCallback) as Array; + } + + if (typeof records[0] === 'string') { + this.deleteRecordsByType_(records as string[], callback!); + return; + } + this.createChange({delete: records as Record[]}, callback!); + } + + empty(): Promise; + empty(callback: CreateChangeCallback): void; + /** + * Emptying your zone means leaving only 'NS' and 'SOA' records. This method + * will first fetch the non-NS and non-SOA records from your zone using + * {@link Zone#getRecords}, then use {@link Zone#createChange} to + * create a deletion change. + * + * @see [ManagedZones: create API Documentation]{@link https://cloud.google.com/dns/api/v1/managedZones/create} + * + * @param {CreateChangeCallback} [callback] Callback function. + * @returns {Promise} + */ + empty( + callback?: CreateChangeCallback + ): void | Promise { + this.getRecords((err, records) => { + if (err) { + callback!(err); + return; + } + const recordsToDelete = records!.filter(record => { + return record.type !== 'NS' && record.type !== 'SOA'; + }); + if (recordsToDelete.length === 0) { + callback!(null); + } else { + this.deleteRecords(recordsToDelete, callback!); + } + }); + } + + export(localPath: string): Promise; + export(localPath: string, callback: ZoneExportCallback): void; + /** + * Provide a path to a zone file to copy records into the zone. + * + * @see [ResourceRecordSets: list API Documentation]{@link https://cloud.google.com/dns/api/v1/resourceRecordSets/list} + * + * @param {string} localPath The fully qualified path to the zone file. + * @param {ZoneExportCallback} [callback] Callback function. + * @returns {Promise} + * + * @example + * const {DNS} = require('@google-cloud/dns'); + * const dns = new DNS(); + * const zone = dns.zone('zone-id'); + * + * const zoneFilename = '/Users/stephen/zonefile.zone'; + * + * zone.export(zoneFilename, err => { + * if (!err) { + * // The zone file was created successfully. + * } + * }); + * + * //- + * // If the callback is omitted, we'll return a Promise. + * //- + * zone.export(zoneFilename).then(() => {}); + */ + export( + localPath: string, + callback?: ZoneExportCallback + ): void | Promise { + this.getRecords((err, records) => { + if (err) { + callback!(err); + return; + } + const stringRecords = records!.map(x => x.toString()).join('\n'); + fs.writeFile(localPath, stringRecords, 'utf-8', err => { + callback!(err || null); + }); + }); + } + + getChanges(query?: GetChangesRequest): Promise; + getChanges(callback: GetChangesCallback): void; + getChanges(query: GetChangesRequest, callback: GetChangesCallback): void; + /** + * Get the list of changes associated with this zone. A change is an atomic + * update to a collection of records. + * + * @see [Changes: get API Documentation]{@link https://cloud.google.com/dns/api/v1/changes/get} + * + * @param {GetChangesRequest} [query] Query object for listing changes. + * @param {GetChangesCallback} [callback] Callback function. + * @returns {Promise} + * + * @example + * const {DNS} = require('@google-cloud/dns'); + * const dns = new DNS(); + * + * const callback = (err, changes, nextQuery, apiResponse) => { + * // The `metadata` property is populated for you with the metadata at the + * // time of fetching. + * changes[0].metadata; + * + * // However, in cases where you are concerned the metadata could have + * // changed, use the `getMetadata` method. + * changes[0].getMetadata((err, metadata) => {}); + * if (nextQuery) { + * // nextQuery will be non-null if there are more results. + * zone.getChanges(nextQuery, callback); + * } + * }; + * + * const zone = dns.zone('zone-id'); + * + * zone.getChanges(callback); + * + * //- + * // If the callback is omitted, we'll return a Promise. + * //- + * zone.getChanges().then((data) => { + * const changes = data[0]; + * }); + */ + getChanges( + queryOrCallback?: GetChangesRequest | GetChangesCallback, + callback?: GetChangesCallback + ): void | Promise { + let query = queryOrCallback as GetChangesRequest; + if (typeof query === 'function') { + callback = query; + query = {}; + } + if (query.sort) { + query.sortOrder = query.sort === 'asc' ? 'ascending' : 'descending'; + delete query.sort; + } + this.request( + { + uri: '/changes', + qs: query, + }, + (err, resp) => { + if (err) { + callback!(err, null, null, resp); + return; + } + const changes = (resp.changes || []).map((change: Change) => { + const changeInstance = this.change(change.id); + changeInstance.metadata = change; + return changeInstance; + }); + let nextQuery = null; + if (resp.nextPageToken) { + nextQuery = Object.assign({}, query, { + pageToken: resp.nextPageToken, + }); + } + callback!(null, changes, nextQuery, resp); + } + ); + } + + getRecords( + query?: GetRecordsRequest | string | string[] + ): Promise; + getRecords(callback: GetRecordsCallback): void; + getRecords( + query: GetRecordsRequest | string | string[], + callback: GetRecordsCallback + ): void; + /** + * Query object for listing records. + * + * @typedef {object} GetRecordsRequest + * @property {boolean} [autoPaginate=true] Have pagination handled automatically. + * @property {number} [maxApiCalls] Maximum number of API calls to make. + * @property {number} [maxResults] Maximum number of items plus prefixes to + * return. + * @property {string} [name] Restricts the list to return only records with this + * fully qualified domain name. + * @property {string} [pageToken] A previously-returned page token + * representing part of the larger set of results to view. + * @property {string} [type] Restricts the list to return only records of this + * type. If present, the "name" parameter must also be present. + */ + /** + * @typedef {array} GetRecordsResponse + * @property {Record[]} 0 Array of {@link Record} instances. + * @property {object} 1 The full API response. + */ + /** + * @callback GetRecordsCallback + * @param {?Error} err Request error, if any. + * @param {Record[]} records Array of {@link Record} instances. + * @param {object} apiResponse The full API response. + */ + /** + * Get the list of records for this zone. + * + * @see [ResourceRecordSets: list API Documentation]{@link https://cloud.google.com/dns/api/v1/resourceRecordSets/list} + * + * @param {GetRecordsRequest} [query] Query object for listing records. + * @param {GetRecordsCallback} [callback] Callback function. + * @returns {Promise} + * + * @example + * const {DNS} = require('@google-cloud/dns'); + * const dns = new DNS(); + * + * const callback = (err, records, nextQuery, apiResponse) => { + * if (!err) { + * // records is an array of Record objects. + * } + * + * if (nextQuery) { + * zone.getRecords(nextQuery, callback); + * } + * }; + * + * const zone = dns.zone('zone-id'); + * + * zone.getRecords(callback); + * + * //- + * // Provide a query for further customization. + * //- + * + * // Get the namespace records for example.com. + * const query = { + * name: 'example.com.', + * type: 'NS' + * }; + * + * zone.getRecords(query, callback); + * + * //- + * // If you only want records of a specific type or types, provide them in + * // place of the query object. + * //- + * zone.getRecords('ns', (err, records) => { + * if (!err) { + * // records is an array of NS Record objects in your zone. + * } + * }); + * + * //- + * // You can also specify multiple record types. + * //- + * zone.getRecords(['ns', 'a', 'cname'], (err, records) => { + * if (!err) { + * // records is an array of NS, A, and CNAME records in your zone. + * } + * }); + * + * //- + * // If the callback is omitted, we'll return a Promise. + * //- + * zone.getRecords(query).then(data => { + * const records = data[0]; + * }); + */ + getRecords( + queryOrCallback?: + | GetRecordsRequest + | GetRecordsCallback + | string + | string[], + callback?: GetRecordsCallback + ): void | Promise { + let query: string | string[] | GetRecordsRequest; + if (typeof queryOrCallback === 'function') { + callback = queryOrCallback; + query = []; + } else { + query = queryOrCallback!; + } + + if (typeof query === 'string' || Array.isArray(query)) { + const filterByTypes_: {[index: string]: boolean} = {}; + // For faster lookups, store the record types the user wants in an object. + arrify(query as string).forEach(type => { + filterByTypes_[type.toUpperCase()] = true; + }); + query = { + filterByTypes_, + }; + } + const requestQuery = Object.assign({}, query) as GetRecordsRequest; + delete requestQuery.filterByTypes_; + this.request( + { + uri: '/rrsets', + qs: requestQuery, + }, + (err, resp) => { + if (err) { + callback!(err, null, null, resp); + return; + } + let records = (resp.rrsets || []).map((record: RecordMetadata) => { + return this.record(record.type!, record); + }); + if ((query as GetRecordsRequest).filterByTypes_) { + records = records.filter((record: RecordMetadata) => { + return (query as GetRecordsRequest).filterByTypes_![record.type!]; + }); + } + let nextQuery: {} | null = null; + if (resp.nextPageToken) { + nextQuery = Object.assign({}, query, { + pageToken: resp.nextPageToken, + }); + } + callback!(null, records, nextQuery, resp); + } + ); + } + + import(localPath: string): Promise; + import(localPath: string, callback: CreateChangeCallback): void; + /** + * Copy the records from a zone file into this zone. + * + * @see [ManagedZones: create API Documentation]{@link https://cloud.google.com/dns/api/v1/managedZones/create} + * + * @param {string} localPath The fully qualified path to the zone file. + * @param {CreateChangeCallback} [callback] Callback function. + * @returns {Promise} + * @example + * const {DNS} = require('@google-cloud/dns'); + * const dns = new DNS(); + * const zone = dns.zone('zone-id'); + * + * const zoneFilename = '/Users/dave/zonefile.zone'; + * + * zone.import(zoneFilename, (err, change, apiResponse) => { + * if (!err) { + * // The change was created successfully. + * } + * }); + * + * //- + * // If the callback is omitted, we'll return a Promise. + * //- + * zone.import(zoneFilename).then(data => { + * const change = data[0]; + * const apiResponse = data[1]; + * }); + */ + import( + localPath: string, + callback?: CreateChangeCallback + ): void | Promise { + fs.readFile(localPath, 'utf-8', (err, file) => { + if (err) { + callback!(err); + return; + } + const parsedZonefile = zonefile.parse(file); + const defaultTTL = parsedZonefile.$ttl; + delete parsedZonefile.$ttl; + const recordTypes = Object.keys(parsedZonefile); + const recordsToCreate: Record[] = []; + recordTypes.forEach(recordType => { + const recordTypeSet = arrify(parsedZonefile[recordType]); + // eslint-disable-next-line @typescript-eslint/no-explicit-any + recordTypeSet.forEach((record: any) => { + record.ttl = record.ttl || defaultTTL; + recordsToCreate.push( + Record.fromZoneRecord_(this, recordType, record) + ); + }); + }); + this.addRecords(recordsToCreate, callback!); + }); + } + /** + * A {@link Record} object can be used to construct a record you want to + * add to your zone, or to refer to an existing one. + * + * Note that using this method will not itself make any API requests. You will + * use the object returned in other API calls, for example to add a record to + * your zone or to delete an existing one. + * + * @param {string} type The type of record to construct or the type of record + * you are referencing. + * @param {object} metadata The metadata of this record. + * @param {string} metadata.name The name of the record, e.g. + * `www.example.com.`. + * @param {string[]} metadata.data Defined in + * [RFC 1035, section 5](https://goo.gl/9EiM0e) and + * [RFC 1034, section 3.6.1](https://goo.gl/Hwhsu9). + * @param {number} metadata.ttl Seconds that the resource is cached by + * resolvers. + * @returns {Record} + * + * @example + * const {DNS} = require('@google-cloud/dns'); + * const dns = new DNS(); + * + * const zone = dns.zone('zone-id'); + * + * //- + * // Reference an existing record to delete from your zone. + * //- + * const oldARecord = zone.record('a', { + * name: 'example.com.', + * data: '1.2.3.4', + * ttl: 86400 + * }); + * + * //- + * // Construct a record to add to your zone. + * //- + * const newARecord = zone.record('a', { + * name: 'example.com.', + * data: '5.6.7.8', + * ttl: 86400 + * }); + * + * //- + * // Use these records together to create a change. + * //- + * zone.createChange({ + * add: newARecord, + * delete: oldARecord + * }, (err, change, apiResponse) => {}); + */ + record(type: string, metadata: RecordMetadata) { + return new Record(this, type, metadata); + } + + replaceRecords( + recordType: string | string[], + newRecords: Record | Record[] + ): Promise; + replaceRecords( + recordType: string | string[], + newRecords: Record | Record[], + callback: CreateChangeCallback + ): void; + /** + * Provide a record type that should be deleted and replaced with other + * records. + * + * **This is not an atomic request.** Two API requests are made + * (one to get records of the type that you've requested, then another to + * replace them), which means the operation is not atomic and could result in + * unexpected changes. + * + * @see [ManagedZones: create API Documentation]{@link https://cloud.google.com/dns/api/v1/managedZones/create} + * + * @param {string|string[]} recordTypes The type(s) of records to replace. + * @param {Record|Record[]} newRecords The {@link Record} object(s) to add. + * @param {CreateChangeCallback} [callback] Callback function. + * @returns {Promise} + * + * @example + * const {DNS} = require('@google-cloud/dns'); + * const dns = new DNS(); + * + * const zone = dns.zone('zone-id'); + * + * const newNs1Record = zone.record('ns', { + * name: 'example.com.', + * data: 'ns-cloud1.googledomains.com.', + * ttl: 86400 + * }); + * + * const newNs2Record = zone.record('ns', { + * name: 'example.com.', + * data: 'ns-cloud2.googledomains.com.', + * ttl: 86400 + * }); + * + * const newNsRecords = [ + * newNs1Record, + * newNs2Record + * ]; + * + * zone.replaceRecords('ns', newNsRecords, (err, change, apiResponse) => { + * if (!err) { + * // The change was created successfully. + * } + * }); + * + * //- + * // If the callback is omitted, we'll return a Promise. + * //- + * zone.replaceRecords('ns', newNsRecords).then(data => { + * const change = data[0]; + * const apiResponse = data[1]; + * }); + */ + replaceRecords( + recordType: string | string[], + newRecords: Record | Record[], + callback?: CreateChangeCallback + ): void | Promise { + this.getRecords(recordType, (err, recordsToDelete) => { + if (err) { + callback!(err); + return; + } + this.createChange( + { + add: newRecords, + delete: recordsToDelete!, + }, + callback! + ); + }); + } + + deleteRecordsByType_(recordTypes: string[]): Promise; + deleteRecordsByType_( + recordTypes: string[], + callback: CreateChangeCallback + ): void; + /** + * Delete records from the zone matching an array of types. + * + * @private + * + * @param {string[]} recordTypes Types of records to delete. Ex: 'NS', 'A'. + * @param {function} callback Callback function. + * + * @example + * const {DNS} = require('@google-cloud/dns'); + * const dns = new DNS(); + * const zone = dns.zone('zone-id'); + * zone.deleteRecordsByType_(['NS', 'A'], (err, change, apiResponse) => { + * if (!err) { + * // The change was created successfully. + * } + * }); + */ + deleteRecordsByType_( + recordTypes: string[], + callback?: CreateChangeCallback + ): void | Promise { + this.getRecords(recordTypes, (err, records) => { + if (err) { + callback!(err); + return; + } + if (records!.length === 0) { + callback!(null); + return; + } + this.deleteRecords(records!, callback!); + }); + } +} + +/** + * Get the list of {@link Change} objects associated with this zone as a + * readable object stream. + * + * @method Zone#getChangesStream + * @param {GetChangesRequest} [query] Query object for listing changes. + * @returns {ReadableStream} A readable stream that emits {@link Change} + * instances. + * + * @example + * zone.getChangesStream() + * .on('error', console.error) + * .on('data', change => { + * // change is a Change object. + * }) + * .on('end', () => { + * // All changes retrieved. + * }); + * + * //- + * // If you anticipate many results, you can end a stream early to prevent + * // unnecessary processing and API requests. + * //- + * zone.getChangesStream() + * .on('data', function(change) { + * this.end(); + * }); + */ + +/** + * Get the list of {module:dns/record} objects for this zone as a readable + * object stream. + * + * @method Zone#getRecordsStream + * @param {GetRecordsRequest} [query] Query object for listing records. + * @returns {ReadableStream} A readable stream that emits {@link Record} + * instances. + * + * @example + * const {DNS} = require('@google-cloud/dns'); + * const dns = new DNS(); + * const zone = dns.zone('zone-id'); + * + * zone.getRecordsStream() + * .on('error', console.error) + * .on('data', record => { + * // record is a Record object. + * }) + * .on('end', () => { + * // All records retrieved. + * }); + * + * //- + * // If you anticipate many results, you can end a stream early to prevent + * // unnecessary processing and API requests. + * //- + * zone.getRecordsStream() + * .on('data', function(change) { + * this.end(); + * }); + */ + +/*! Developer Documentation + * + * These methods can be auto-paginated. + */ +paginator.extend(Zone, ['getChanges', 'getRecords']); + +/*! Developer Documentation + * + * All async methods (except for streams) will return a Promise in the event + * that a callback is omitted. + */ +promisifyAll(Zone, { + exclude: ['change', 'record'], +}); + +/** + * Reference to the {@link Zone} class. + * @name module:@google-cloud/dns.Zone + * @see Zone + */ +export {Zone}; diff --git a/packages/google-cloud-dns/system-test/data/zonefile.zone b/packages/google-cloud-dns/system-test/data/zonefile.zone new file mode 100644 index 00000000000..cd68c741f90 --- /dev/null +++ b/packages/google-cloud-dns/system-test/data/zonefile.zone @@ -0,0 +1,9 @@ +$TTL 3600 +{DNS_DOMAIN} 21600 IN SPF "v=spf1" "mx:{DNS_DOMAIN}" "-all" +{DNS_DOMAIN} IN TXT "google-site-verification=xxxxxxxxxxxxYYYYYYXXX" +{DNS_DOMAIN} 21600 MX 10 mail.example.com. +{DNS_DOMAIN} 21600 MX 30 mail.example.com. +{DNS_DOMAIN} A 128.9.0.32 + A 10.1.0.52 +{DNS_DOMAIN} A 10.2.0.27 + A 128.9.0.33 diff --git a/packages/google-cloud-dns/system-test/dns.ts b/packages/google-cloud-dns/system-test/dns.ts new file mode 100644 index 00000000000..aa56cb2c1de --- /dev/null +++ b/packages/google-cloud-dns/system-test/dns.ts @@ -0,0 +1,347 @@ +// Copyright 2015 Google LLC +// +// Licensed under the Apache License, Version 2.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 {describe, it, before, after} from 'mocha'; +import * as fs from 'fs'; +import * as tmp from 'tmp'; +import * as util from 'util'; +import * as uuid from 'uuid'; + +// eslint-disable-next-line @typescript-eslint/no-var-requires +const format = require('string-format-obj'); + +import {DNS, Record} from '../src'; +import {Metadata} from '@google-cloud/common'; + +const dns = new DNS(); +const DNS_DOMAIN = process.env.GCLOUD_TESTS_DNS_DOMAIN || 'gitnpm.com.'; + +const delayMs = async (ms = 1000) => { + return new Promise(resolve => { + setTimeout(resolve, ms); + }); +}; + +// Only run the tests if there is a domain to test with. +describe('dns', () => { + const ZONE_NAME = 'test-zone-' + uuid.v4().substr(0, 18); + const ZONE = dns.zone(ZONE_NAME); + + const records = { + a: ZONE.record('a', { + ttl: 86400, + name: DNS_DOMAIN, + data: '1.2.3.4', + }), + + aaaa: ZONE.record('aaaa', { + ttl: 86400, + name: DNS_DOMAIN, + data: '2607:f8b0:400a:801::1005', + }), + + cname: ZONE.record('cname', { + ttl: 86400, + name: 'mail.' + DNS_DOMAIN, + data: 'example.com.', + }), + + mx: ZONE.record('mx', { + ttl: 86400, + name: DNS_DOMAIN, + data: ['10 mail.' + DNS_DOMAIN, '20 mail2.' + DNS_DOMAIN], + }), + + naptr: ZONE.record('naptr', { + ttl: 300, + name: '2.1.2.1.5.5.5.0.7.7.1.e164.arpa.', + data: [ + '100 10 "u" "sip+E2U" "!^.*$!sip:information@foo.se!i" .', + '102 10 "u" "smtp+E2U" "!^.*$!mailto:information@foo.se!i" .', + ], + }), + + ns: ZONE.record('ns', { + ttl: 86400, + name: DNS_DOMAIN, + data: 'ns-cloud1.googledomains.com.', + }), + + ptr: ZONE.record('ptr', { + ttl: 60, + name: '2.1.0.10.in-addr.arpa.', + data: 'server.' + DNS_DOMAIN, + }), + + soa: ZONE.record('soa', { + ttl: 21600, + name: DNS_DOMAIN, + data: [ + 'ns-cloud1.googledomains.com.', + 'dns-admin.google.com.', + '1 21600 3600 1209600 300', + ].join(' '), + }), + + spf: ZONE.record('spf', { + ttl: 21600, + name: DNS_DOMAIN, + data: 'v=spf1 mx:' + DNS_DOMAIN.replace(/.$/, '') + ' -all', + }), + + srv: ZONE.record('srv', { + ttl: 21600, + name: 'sip.' + DNS_DOMAIN, + data: '0 5 5060 sip.' + DNS_DOMAIN, + }), + + txt: ZONE.record('txt', { + ttl: 21600, + name: DNS_DOMAIN, + data: 'google-site-verification=xxxxxxxxxxxxYYYYYYXXX', + }), + }; + + before(async () => { + // Clean up any leaked resources + const [zones] = await dns.getZones(); + await Promise.all( + zones.map(async zone => { + const hoursOld = + (Date.now() - new Date(zone.metadata.creationTime).getTime()) / + 1000 / + 60 / + 60; + if (hoursOld > 1) { + await zone.delete({force: true}); + } + }) + ); + await ZONE.create({ + dnsName: DNS_DOMAIN, + dnssecConfig: { + state: 'on', + }, + }); + }); + + after(done => { + ZONE.delete({force: true}, done); + }); + + // deal with eventual consistency of ZONE.create(): + it('should return 0 or more zones', async function () { + this.retries(3); + await delayMs(1000); + const zones = await dns.getZones(); + assert(zones!.length >= 0); + }); + + describe('Zones', () => { + it('should get the metadata for a zone', done => { + ZONE.getMetadata((err: Error, metadata: Metadata) => { + assert.ifError(err); + assert.strictEqual(metadata.name, ZONE_NAME); + done(); + }); + }); + + it('should support all types of records', done => { + const recordsToCreate = [ + records.a, + records.aaaa, + records.cname, + records.mx, + // records.naptr, + records.ns, + // records.ptr, + records.soa, + records.spf, + records.srv, + records.txt, + ]; + + ZONE.replaceRecords(['ns', 'soa'], recordsToCreate, done); + }); + + it('should import records from a zone file', done => { + const zoneFilename = require.resolve( + '../../system-test/data/zonefile.zone' + ); + let zoneFileTemplate = fs.readFileSync(zoneFilename, 'utf-8'); + zoneFileTemplate = format(zoneFileTemplate, { + DNS_DOMAIN, + }); + + tmp.setGracefulCleanup(); + tmp.file((err, tmpFilePath) => { + assert.ifError(err); + fs.writeFileSync(tmpFilePath, zoneFileTemplate, 'utf-8'); + ZONE.empty(err => { + assert.ifError(err); + ZONE.import(tmpFilePath, err => { + assert.ifError(err); + + ZONE.getRecords(['spf', 'txt'], (err, records) => { + assert.ifError(err); + + const spfRecord = records!.filter(record => { + return record.type === 'SPF'; + })[0]; + + assert.strictEqual( + spfRecord.toJSON().rrdatas![0], + '"v=spf1" "mx:' + DNS_DOMAIN + '" "-all"' + ); + + const txtRecord = records!.filter(record => { + return record.type === 'TXT'; + })[0]; + + assert.strictEqual( + txtRecord.toJSON().rrdatas![0], + '"google-site-verification=xxxxxxxxxxxxYYYYYYXXX"' + ); + + done(); + }); + }); + }); + }); + }); + + it('should export records to a zone file', async () => { + tmp.setGracefulCleanup(); + const tmpFile: Function = util.promisify(tmp.file); + const tmpFilename = await tmpFile(); + await ZONE.empty(); + await ZONE.addRecords([records.spf, records.srv]); + await ZONE.export(tmpFilename); + }); + + describe('changes', () => { + it('should create a change', done => { + const record = ZONE.record('srv', { + ttl: 3600, + name: DNS_DOMAIN, + data: '10 0 5222 127.0.0.1.', + signatureRrdatas: [], + }); + const change = ZONE.change(); + change.create({add: record}, err => { + assert.ifError(err); + const addition = change.metadata.additions[0]; + delete addition.kind; + assert.deepStrictEqual(addition, record.toJSON()); + done(); + }); + }); + + it('should get a list of changes', done => { + ZONE.getChanges((err, changes) => { + assert.ifError(err); + assert(changes!.length >= 0); + done(); + }); + }); + + it('should get metadata', done => { + ZONE.getChanges((err, changes) => { + assert.ifError(err); + const change = changes![0]; + const expectedMetadata = change.metadata; + change.getMetadata((err: Error, metadata: Metadata) => { + assert.ifError(err); + delete metadata.status; + delete expectedMetadata.status; + assert.deepStrictEqual(metadata, expectedMetadata); + done(); + }); + }); + }); + }); + }); + + describe('Records', () => { + it('should return 0 or more records', done => { + ZONE.getRecords((err, records) => { + assert.ifError(err); + assert(records!.length >= 0); + done(); + }); + }); + + it('should cursor through records by type', done => { + const newRecords = [ + ZONE.record('cname', { + ttl: 86400, + name: '1.' + DNS_DOMAIN, + data: DNS_DOMAIN, + }), + ZONE.record('cname', { + ttl: 86400, + name: '2.' + DNS_DOMAIN, + data: DNS_DOMAIN, + }), + ]; + + ZONE.replaceRecords('cname', newRecords, err => { + assert.ifError(err); + const onRecordsReceived = ( + err?: Error | null, + records?: Record[] | null, + nextQuery?: {} | null + ) => { + if (nextQuery) { + ZONE.getRecords(nextQuery, onRecordsReceived); + return; + } + ZONE.deleteRecords(newRecords, done); + }; + ZONE.getRecords( + { + type: 'cname', + maxResults: 2, + }, + onRecordsReceived + ); + }); + }); + + it('should replace records', async () => { + const name = 'test-zone-' + uuid.v4().substr(0, 18); + // Do this in a new zone so no existing records are affected. + const [zone] = await dns.createZone(name, { + dnsName: DNS_DOMAIN, + dnssecConfig: { + state: 'on', + }, + }); + const [originalRecords] = await zone.getRecords('ns'); + const originalData = originalRecords[0].data; + const newRecord = zone.record('ns', { + ttl: 3600, + name: DNS_DOMAIN, + data: ['ns1.nameserver.net.', 'ns2.nameserver.net.'], + }); + const [change] = await zone.replaceRecords('ns', newRecord); + const deleted = change.metadata.deletions[0].rrdatas; + const added = change.metadata.additions[0].rrdatas; + assert.deepStrictEqual(deleted, originalData); + assert.deepStrictEqual(added, newRecord.data); + await zone.delete({force: true}); + }); + }); +}); diff --git a/packages/google-cloud-dns/test/change.ts b/packages/google-cloud-dns/test/change.ts new file mode 100644 index 00000000000..f2d7d37844c --- /dev/null +++ b/packages/google-cloud-dns/test/change.ts @@ -0,0 +1,162 @@ +// Copyright 2015 Google LLC +// +// Licensed under the Apache License, Version 2.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 { + Metadata, + ServiceObject, + ServiceObjectConfig, +} from '@google-cloud/common'; +import * as promisify from '@google-cloud/promisify'; +import * as assert from 'assert'; +import {describe, it, before, beforeEach} from 'mocha'; +import * as proxyquire from 'proxyquire'; +import {Change} from '../src/change'; + +let promisified = false; +const fakePromisify = Object.assign({}, promisify, { + promisifyAll(esClass: Function) { + if (esClass.name === 'Change') { + promisified = true; + } + }, +}); + +class FakeServiceObject extends ServiceObject { + calledWith_: IArguments; + constructor(config: ServiceObjectConfig) { + super(config); + // eslint-disable-next-line prefer-rest-params + this.calledWith_ = arguments; + } +} + +describe('Change', () => { + // eslint-disable-next-line @typescript-eslint/no-explicit-any + let Change: any; + // eslint-disable-next-line @typescript-eslint/no-explicit-any + let change: any; + + const ZONE = { + name: 'zone-name', + createChange() {}, + }; + + const CHANGE_ID = 'change-id'; + + before(() => { + Change = proxyquire('../src/change', { + '@google-cloud/common': { + ServiceObject: FakeServiceObject, + }, + '@google-cloud/promisify': fakePromisify, + }).Change; + }); + + beforeEach(() => { + change = new Change(ZONE, CHANGE_ID); + }); + + describe('instantiation', () => { + it('should inherit from ServiceObject', () => { + assert(change instanceof ServiceObject); + + // eslint-disable-next-line @typescript-eslint/no-explicit-any + const calledWith = (change as any).calledWith_[0]; + + assert.strictEqual(calledWith.parent, ZONE); + assert.strictEqual(calledWith.baseUrl, '/changes'); + assert.strictEqual(calledWith.id, CHANGE_ID); + assert.deepStrictEqual(calledWith.methods, { + exists: true, + get: true, + getMetadata: true, + }); + }); + + it('should promisify all the things', () => { + assert(promisified); + }); + }); + + describe('change', () => { + it('should call the parent change method', done => { + const config = {}; + + change.parent.createChange = (config_: {}) => { + assert.strictEqual(config, config_); + done(); + }; + + change.create(config, assert.ifError); + }); + + describe('error', () => { + const error = new Error('Error.'); + const apiResponse = {}; + + beforeEach(() => { + change.parent.createChange = (config: {}, callback: Function) => { + callback(error, null, apiResponse); + }; + }); + + it('should execute callback with error & apiResponse', done => { + change.create( + {}, + (err: Error, change: Change, apiResponse_: Metadata) => { + assert.strictEqual(err, error); + assert.strictEqual(change, null); + assert.strictEqual(apiResponse_, apiResponse); + done(); + } + ); + }); + }); + + describe('success', () => { + const changeInstance = { + id: 'id', + metadata: {}, + }; + const apiResponse = {}; + + beforeEach(() => { + change.parent.createChange = (config: {}, callback: Function) => { + callback(null, changeInstance, apiResponse); + }; + }); + + it('should execute callback with self & API response', done => { + change.create( + {}, + (err: Error, change_: Change, apiResponse_: Metadata) => { + assert.ifError(err); + assert.strictEqual(change_, change); + assert.strictEqual(apiResponse_, apiResponse); + done(); + } + ); + }); + + it('should assign the ID and metadata from the change', done => { + change.create({}, (err: Error, change_: Change) => { + assert.ifError(err); + assert.strictEqual(change_.id, changeInstance.id); + assert.strictEqual(change_.metadata, changeInstance.metadata); + done(); + }); + }); + }); + }); +}); diff --git a/packages/google-cloud-dns/test/index.ts b/packages/google-cloud-dns/test/index.ts new file mode 100644 index 00000000000..9a105b8cc00 --- /dev/null +++ b/packages/google-cloud-dns/test/index.ts @@ -0,0 +1,431 @@ +// Copyright 2015 Google LLC +// +// Licensed under the Apache License, Version 2.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 { + Service, + ServiceConfig, + ServiceOptions, + util, +} from '@google-cloud/common'; +import * as promisify from '@google-cloud/promisify'; +import arrify = require('arrify'); +import * as assert from 'assert'; +import {describe, it, before, beforeEach} from 'mocha'; +import * as proxyquire from 'proxyquire'; +import {CoreOptions, OptionsWithUri, Response} from 'request'; + +import {Zone} from '../src'; + +let extended = false; +const fakePaginator = { + paginator: { + extend(esClass: Function, methods: string[]) { + if (esClass.name !== 'DNS') { + return; + } + extended = true; + methods = arrify(methods); + assert.strictEqual(esClass.name, 'DNS'); + assert.deepStrictEqual(methods, ['getZones']); + }, + streamify(methodName: string) { + return methodName; + }, + }, +}; + +class FakeService extends Service { + calledWith_: IArguments; + constructor(config: ServiceConfig, options?: ServiceOptions) { + super(config, options); + // eslint-disable-next-line prefer-rest-params + this.calledWith_ = arguments; + } +} + +const fakeUtil = Object.assign({}, util, { + makeAuthenticatedRequestFactory() {}, +}); +const originalFakeUtil = Object.assign({}, fakeUtil); + +let promisified = false; +const fakePromisify = Object.assign({}, promisify, { + // tslint:disable-next-line:variable-name + promisifyAll(esClass: Function, options: promisify.PromisifyAllOptions) { + if (esClass.name !== 'DNS') { + return; + } + promisified = true; + assert.deepStrictEqual(options.exclude, ['zone']); + }, +}); + +class FakeZone { + calledWith_: IArguments; + constructor() { + // eslint-disable-next-line prefer-rest-params + this.calledWith_ = arguments; + } +} + +describe('DNS', () => { + // eslint-disable-next-line @typescript-eslint/no-explicit-any + let DNS: any; + // eslint-disable-next-line @typescript-eslint/no-explicit-any + let dns: any; + + const PROJECT_ID = 'project-id'; + + before(() => { + DNS = proxyquire('../src', { + '@google-cloud/common': { + Service: FakeService, + }, + '@google-cloud/paginator': fakePaginator, + '@google-cloud/promisify': fakePromisify, + './zone': { + Zone: FakeZone, + }, + }).DNS; + }); + + beforeEach(() => { + Object.assign(fakeUtil, originalFakeUtil); + dns = new DNS({ + projectId: PROJECT_ID, + }); + }); + + describe('instantiation', () => { + it('should extend the correct methods', () => { + assert(extended); // See `fakePaginator.extend` + }); + + it('should streamify the correct methods', () => { + assert.strictEqual(dns.getZonesStream, 'getZones'); + }); + + it('should promisify all the things', () => { + assert(promisified); + }); + + it('should inherit from Service', () => { + assert(dns instanceof Service); + + // eslint-disable-next-line @typescript-eslint/no-explicit-any + const calledWith = (dns as any).calledWith_[0]; + + const baseUrl = 'https://dns.googleapis.com/dns/v1'; + assert.strictEqual(calledWith.baseUrl, baseUrl); + assert.deepStrictEqual(calledWith.scopes, [ + 'https://www.googleapis.com/auth/ndev.clouddns.readwrite', + 'https://www.googleapis.com/auth/cloud-platform', + ]); + assert.deepStrictEqual( + calledWith.packageJson, + // eslint-disable-next-line @typescript-eslint/no-var-requires + require('../../package.json') + ); + }); + + it('should enable apiEndpoint override', () => { + const apiEndpoint = 'fake.endpoint'; + dns = new DNS({ + projectId: PROJECT_ID, + apiEndpoint, + }); + const calledWith = dns.calledWith_[0]; + assert.strictEqual(calledWith.apiEndpoint, apiEndpoint); + assert.strictEqual(calledWith.baseUrl, `https://${apiEndpoint}/dns/v1`); + }); + }); + + describe('createZone', () => { + const zoneName = 'zone-name'; + const config = {dnsName: 'dns-name'}; + + it('should throw if a zone name is not provided', () => { + assert.throws(() => { + dns.createZone(); + }, /A zone name is required/); + }); + + it('should throw if a zone dnsname is not provided', () => { + assert.throws(() => { + dns.createZone(zoneName); + }, /A zone dnsName is required/); + + assert.throws(() => { + dns.createZone(zoneName, {}); + }, /A zone dnsName is required/); + }); + + it('should use a provided description', done => { + const cfg = Object.assign({}, config, {description: 'description'}); + + dns.request = (reqOpts: CoreOptions) => { + assert.strictEqual(reqOpts.json.description, cfg.description); + done(); + }; + + dns.createZone(zoneName, cfg, assert.ifError); + }); + + it('should default a description to ""', done => { + dns.request = (reqOpts: CoreOptions) => { + assert.strictEqual(reqOpts.json.description, ''); + done(); + }; + + dns.createZone(zoneName, config, assert.ifError); + }); + + it('should make the correct API request', done => { + dns.request = (reqOpts: OptionsWithUri) => { + assert.strictEqual(reqOpts.method, 'POST'); + assert.strictEqual(reqOpts.uri, '/managedZones'); + const expectedBody = Object.assign({}, config, { + name: zoneName, + description: '', + }); + assert.deepStrictEqual(reqOpts.json, expectedBody); + + done(); + }; + + dns.createZone(zoneName, config, assert.ifError); + }); + + describe('error', () => { + const error = new Error('Error.'); + const apiResponse = {a: 'b', c: 'd'}; + + beforeEach(() => { + dns.request = (reqOpts: {}, callback: Function) => { + callback(error, apiResponse); + }; + }); + + it('should execute callback with error and API response', done => { + dns.createZone( + zoneName, + config, + (err: Error, zone: Zone, apiResponse_: Response) => { + assert.strictEqual(err, error); + assert.strictEqual(zone, null); + assert.strictEqual(apiResponse_, apiResponse); + done(); + } + ); + }); + }); + + describe('success', () => { + const apiResponse = {name: zoneName}; + const zone = {}; + + beforeEach(() => { + dns.request = (reqOpts: {}, callback: Function) => { + callback(null, apiResponse); + }; + + dns.zone = () => { + return zone; + }; + }); + + it('should create a zone from the response', done => { + dns.zone = (name: string) => { + assert.strictEqual(name, apiResponse.name); + setImmediate(done); + return zone; + }; + + dns.createZone(zoneName, config, assert.ifError); + }); + + it('should execute callback with zone and API response', done => { + dns.createZone( + zoneName, + config, + (err: Error, zone_: Zone, apiResponse_: Response) => { + assert.ifError(err); + assert.strictEqual(zone_, zone); + assert.strictEqual(apiResponse_, apiResponse); + + done(); + } + ); + }); + + it('should set the metadata to the response', done => { + dns.createZone(zoneName, config, (err: Error, zone: Zone) => { + assert.strictEqual(zone.metadata, apiResponse); + done(); + }); + }); + }); + }); + + describe('getZones', () => { + it('should make the correct request', done => { + const query = {a: 'b', c: 'd'}; + + dns.request = (reqOpts: OptionsWithUri) => { + assert.strictEqual(reqOpts.uri, '/managedZones'); + assert.strictEqual(reqOpts.qs, query); + + done(); + }; + + dns.getZones(query, assert.ifError); + }); + + it('should use an empty query if one was not provided', done => { + dns.request = (reqOpts: CoreOptions) => { + assert.strictEqual(Object.keys(reqOpts.qs).length, 0); + done(); + }; + + dns.getZones(assert.ifError); + }); + + describe('error', () => { + const error = new Error('Error.'); + const apiResponse = {a: 'b', c: 'd'}; + + beforeEach(() => { + dns.request = (reqOpts: {}, callback: Function) => { + callback(error, apiResponse); + }; + }); + + it('should execute callback with error and API response', done => { + dns.getZones( + {}, + ( + err: Error, + zones: Zone[], + nextQuery: {}, + apiResponse_: Response + ) => { + assert.strictEqual(err, error); + assert.strictEqual(zones, null); + assert.strictEqual(nextQuery, null); + assert.strictEqual(apiResponse_, apiResponse); + + done(); + } + ); + }); + }); + + describe('success', () => { + const zone = {name: 'zone-1', a: 'b', c: 'd'}; + const apiResponse = {managedZones: [zone]}; + + beforeEach(() => { + dns.request = (reqOpts: {}, callback: Function) => { + callback(null, apiResponse); + }; + + dns.zone = () => { + return zone; + }; + }); + + it('should create zones from the response', done => { + dns.zone = (zoneName: string) => { + assert.strictEqual(zoneName, zone.name); + setImmediate(done); + return zone; + }; + + dns.getZones({}, assert.ifError); + }); + + it('should set a nextQuery if necessary', done => { + const apiResponseWithNextPageToken = Object.assign({}, apiResponse, { + nextPageToken: 'next-page-token', + }); + + const query = {a: 'b', c: 'd'}; + const originalQuery = Object.assign({}, query); + + dns.request = (reqOpts: {}, callback: Function) => { + callback(null, apiResponseWithNextPageToken); + }; + + dns.getZones(query, (err: Error, zones: Zone[], nextQuery: {}) => { + assert.ifError(err); + + // Check the original query wasn't modified. + assert.deepStrictEqual(query, originalQuery); + + assert.deepStrictEqual( + nextQuery, + Object.assign({}, query, { + pageToken: apiResponseWithNextPageToken.nextPageToken, + }) + ); + + done(); + }); + }); + + it('should execute callback with zones and API response', done => { + dns.getZones( + {}, + ( + err: Error, + zones: Zone[], + nextQuery: {}, + apiResponse_: Response + ) => { + assert.ifError(err); + assert.strictEqual(zones[0], zone); + assert.strictEqual(nextQuery, null); + assert.strictEqual(apiResponse_, apiResponse); + + done(); + } + ); + }); + + it('should assign metadata to zones', done => { + dns.getZones({}, (err: Error, zones: Zone[]) => { + assert.ifError(err); + assert.strictEqual(zones[0].metadata, zone); + done(); + }); + }); + }); + }); + + describe('zone', () => { + it('should throw if a name is not provided', () => { + assert.throws(() => { + dns.zone(); + }, /A zone name is required/); + }); + + it('should return a Zone', () => { + const newZoneName = 'new-zone-name'; + const newZone = dns.zone(newZoneName); + assert(newZone instanceof FakeZone); + assert.strictEqual(newZone.calledWith_[0], dns); + assert.strictEqual(newZone.calledWith_[1], newZoneName); + }); + }); +}); diff --git a/packages/google-cloud-dns/test/record.ts b/packages/google-cloud-dns/test/record.ts new file mode 100644 index 00000000000..23125baa24c --- /dev/null +++ b/packages/google-cloud-dns/test/record.ts @@ -0,0 +1,357 @@ +// Copyright 2015 Google LLC +// +// Licensed under the Apache License, Version 2.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 promisify from '@google-cloud/promisify'; +import * as assert from 'assert'; +import {describe, it, before, beforeEach} from 'mocha'; +import * as proxyquire from 'proxyquire'; + +// eslint-disable-next-line @typescript-eslint/no-unused-vars +import {Record} from '../src'; + +interface Metadata { + name: string; + data?: string[]; + ttl: number; +} +let promisified = false; +const fakePromisify = Object.assign({}, promisify, { + promisifyAll(esClass: Function, options: promisify.PromisifyAllOptions) { + if (esClass.name !== 'Record') { + return; + } + promisified = true; + assert.deepStrictEqual(options.exclude, ['toJSON', 'toString']); + }, +}); + +describe('Record', () => { + // eslint-disable-next-line @typescript-eslint/no-explicit-any + let Record: any; + // eslint-disable-next-line @typescript-eslint/no-explicit-any + let record: any; + + const ZONE = { + deleteRecords() {}, + }; + const TYPE = 'A'; + const METADATA = { + name: 'name', + data: [], + ttl: 86400, + }; + + before(() => { + Record = proxyquire('../src/record', { + '@google-cloud/promisify': fakePromisify, + }).Record; + }); + + beforeEach(() => { + record = new Record(ZONE, TYPE, METADATA); + }); + + describe('instantiation', () => { + it('should promisify all the things', () => { + assert(promisified); + }); + + it('should localize the zone instance', () => { + assert.strictEqual(record.zone_, ZONE); + }); + + it('should localize the type', () => { + assert.strictEqual(record.type, TYPE); + }); + + it('should localize the metadata', () => { + assert.strictEqual(record.metadata, METADATA); + }); + + it('should assign the parsed metadata', () => { + const parsedMetadata = record.toJSON(); + delete parsedMetadata.rrdatas; + // tslint:disable-next-line:forin + for (const prop in parsedMetadata) { + assert.strictEqual(record[prop], parsedMetadata[prop]); + } + }); + + it('should re-assign rrdatas to data', () => { + const originalRrdatas = new Array(); + + const recordThatHadRrdatas = new Record(ZONE, TYPE, { + rrdatas: originalRrdatas, + }); + + assert.strictEqual(recordThatHadRrdatas.rrdatas, undefined); + assert.strictEqual(recordThatHadRrdatas.data, originalRrdatas); + }); + }); + + describe('fromZoneRecord_', () => { + describe('a', () => { + const aRecord = { + ip: '0.0.0.0', + name: 'name', + ttl: 86400, + }; + + const expectedData = aRecord.ip; + + it('should parse an A record', () => { + const record = Record.fromZoneRecord_(ZONE, 'a', aRecord); + + assert.strictEqual(record.type, 'A'); + assert.deepStrictEqual(record.metadata.data, expectedData); + assert.strictEqual(record.metadata.name, aRecord.name); + assert.strictEqual(record.metadata.ttl, aRecord.ttl); + }); + }); + + describe('aaaa', () => { + const aaaaRecord = { + ip: '2607:f8b0:400a:801::1005', + name: 'name', + ttl: 86400, + }; + + const expectedData = aaaaRecord.ip; + + it('should parse an AAAA record', () => { + const record = Record.fromZoneRecord_(ZONE, 'aaaa', aaaaRecord); + + assert.strictEqual(record.type, 'AAAA'); + assert.strictEqual(record.metadata.data, expectedData); + assert.strictEqual(record.metadata.name, aaaaRecord.name); + assert.strictEqual(record.metadata.ttl, aaaaRecord.ttl); + }); + }); + + describe('cname', () => { + const cnameRecord = { + alias: 'example.com.', + name: 'name', + ttl: 86400, + }; + + const expectedData = cnameRecord.alias; + + it('should parse a CNAME record', () => { + const record = Record.fromZoneRecord_(ZONE, 'cname', cnameRecord); + + assert.strictEqual(record.type, 'CNAME'); + assert.strictEqual(record.metadata.data, expectedData); + assert.strictEqual(record.metadata.name, cnameRecord.name); + assert.strictEqual(record.metadata.ttl, cnameRecord.ttl); + }); + }); + + describe('mx', () => { + const mxRecord = { + preference: 0, + host: 'mail', + name: 'name', + ttl: 86400, + }; + + const expectedData = mxRecord.preference + ' ' + mxRecord.host; + + it('should parse an MX record', () => { + const record = Record.fromZoneRecord_(ZONE, 'mx', mxRecord); + + assert.strictEqual(record.type, 'MX'); + assert.strictEqual(record.metadata.data, expectedData); + assert.strictEqual(record.metadata.name, mxRecord.name); + assert.strictEqual(record.metadata.ttl, mxRecord.ttl); + }); + }); + + describe('ns', () => { + const nsRecord = { + host: 'example.com', + name: 'name', + ttl: 86400, + }; + + const expectedData = nsRecord.host; + + it('should parse an NS record', () => { + const record = Record.fromZoneRecord_(ZONE, 'ns', nsRecord); + + assert.strictEqual(record.type, 'NS'); + assert.strictEqual(record.metadata.data, expectedData); + assert.strictEqual(record.metadata.name, nsRecord.name); + assert.strictEqual(record.metadata.ttl, nsRecord.ttl); + }); + }); + + describe('soa', () => { + const soaRecord = { + mname: 'ns1.nameserver.net.', + rname: 'hostmaster.mydomain.com.', + serial: 86400, + retry: 600, + refresh: 3600, + expire: 604800, + minimum: 86400, + name: 'name', + ttl: 86400, + }; + + const expectedData = [ + soaRecord.mname, + soaRecord.rname, + soaRecord.serial, + soaRecord.retry, + soaRecord.refresh, + soaRecord.expire, + soaRecord.minimum, + ].join(' '); + + it('should parse an SOA record', () => { + const record = Record.fromZoneRecord_(ZONE, 'soa', soaRecord); + + assert.strictEqual(record.type, 'SOA'); + assert.strictEqual(record.metadata.data, expectedData); + assert.strictEqual(record.metadata.name, soaRecord.name); + assert.strictEqual(record.metadata.ttl, soaRecord.ttl); + }); + }); + + describe('spf', () => { + const spfRecord = { + data: '"v=spf1" "mx:example.com"', + name: 'name', + ttl: 86400, + }; + + const expectedData = spfRecord.data; + + it('should parse an SPF record', () => { + const record = Record.fromZoneRecord_(ZONE, 'spf', spfRecord); + + assert.strictEqual(record.type, 'SPF'); + assert.strictEqual(record.metadata.data, expectedData); + assert.strictEqual(record.metadata.name, spfRecord.name); + assert.strictEqual(record.metadata.ttl, spfRecord.ttl); + }); + }); + + describe('srv', () => { + const srvRecord = { + priority: 10, + weight: 0, + port: 5222, + target: 'jabber', + name: 'name', + ttl: 86400, + }; + + const expectedData = [ + srvRecord.priority, + srvRecord.weight, + srvRecord.port, + srvRecord.target, + ].join(' '); + + it('should parse an SRV record', () => { + const record = Record.fromZoneRecord_(ZONE, 'srv', srvRecord); + + assert.strictEqual(record.type, 'SRV'); + assert.strictEqual(record.metadata.data, expectedData); + assert.strictEqual(record.metadata.name, srvRecord.name); + assert.strictEqual(record.metadata.ttl, srvRecord.ttl); + }); + }); + + describe('txt', () => { + const txtRecord = { + txt: 'txt-record-txt', + name: 'name', + ttl: 86400, + }; + + const expectedData = txtRecord.txt; + + it('should parse a TXT record', () => { + const record = Record.fromZoneRecord_(ZONE, 'txt', txtRecord); + + assert.strictEqual(record.type, 'TXT'); + assert.strictEqual(record.metadata.data, expectedData); + assert.strictEqual(record.metadata.name, txtRecord.name); + assert.strictEqual(record.metadata.ttl, txtRecord.ttl); + }); + }); + }); + + describe('delete', () => { + it('should call zone.deleteRecords', (done: any) => { + record.zone_.deleteRecords = (records: Record[], callback: Function) => { + assert.strictEqual(records, record); + callback(); + }; + record.delete(done); + }); + }); + + describe('toJSON', () => { + it('should format the data for the API', () => { + const expectedRecord: Metadata = Object.assign({}, METADATA, { + type: 'A', + rrdatas: METADATA.data, + }); + delete expectedRecord.data; + + assert.deepStrictEqual(record.toJSON(), expectedRecord); + }); + }); + + describe('toString', () => { + it('should format the data for a zonefile', () => { + const jsonRecord = Object.assign({}, METADATA, { + type: TYPE, + rrdatas: ['example.com.', 'example2.com.'], + }); + + record.toJSON = () => { + return jsonRecord; + }; + + const expectedRecordString = [ + [ + jsonRecord.name, + jsonRecord.ttl, + 'IN', + TYPE, + jsonRecord.rrdatas[0], + ].join(' '), + + [ + jsonRecord.name, + jsonRecord.ttl, + 'IN', + TYPE, + jsonRecord.rrdatas[1], + ].join(' '), + ].join('\n'); + + // That's a bunch of silliness, but it generates simply: + // name 86400 IN A example.com. + // name 86400 IN A example2.com. + + assert.strictEqual(record.toString(), expectedRecordString); + }); + }); +}); diff --git a/packages/google-cloud-dns/test/zone.ts b/packages/google-cloud-dns/test/zone.ts new file mode 100644 index 00000000000..6968b68baad --- /dev/null +++ b/packages/google-cloud-dns/test/zone.ts @@ -0,0 +1,1067 @@ +// Copyright 2015 Google LLC +// +// Licensed under the Apache License, Version 2.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 {ServiceObject, ServiceObjectConfig} from '@google-cloud/common'; +import * as promisify from '@google-cloud/promisify'; +import arrify = require('arrify'); +import * as assert from 'assert'; +import {describe, it, before, beforeEach} from 'mocha'; +import * as proxyquire from 'proxyquire'; +import {CoreOptions, OptionsWithUri, Response} from 'request'; +import * as uuid from 'uuid'; + +import {Change, CreateChangeRequest} from '../src/change'; +import {Record, RecordObject, RecordMetadata} from '../src/record'; + +let promisified = false; +const fakePromisify = Object.assign({}, promisify, { + promisifyAll(esClass: Function, options: promisify.PromisifyAllOptions) { + if (esClass.name !== 'Zone') { + return; + } + promisified = true; + assert.deepStrictEqual(options.exclude, ['change', 'record']); + }, +}); + +let parseOverride: Function | null; +const fakeDnsZonefile = { + parse() { + // eslint-disable-next-line prefer-spread, prefer-rest-params + return (parseOverride || (() => {})).apply(null, arguments); + }, +}; + +let writeFileOverride: Function | null; +let readFileOverride: Function | null; +const fakeFs = { + readFile() { + // eslint-disable-next-line prefer-spread, prefer-rest-params + return (readFileOverride || (() => {})).apply(null, arguments); + }, + writeFile() { + // eslint-disable-next-line prefer-spread, prefer-rest-params + return (writeFileOverride || (() => {})).apply(null, arguments); + }, +}; + +class FakeChange { + calledWith_: Array<{}>; + constructor(...args: Array<{}>) { + this.calledWith_ = args; + } +} + +class FakeRecord { + calledWith_: Array<{}>; + constructor(...args: Array<{}>) { + this.calledWith_ = args; + } + static fromZoneRecord_(...args: Array<{}>) { + const record = new FakeRecord(); + record.calledWith_ = args; + return record; + } +} + +class FakeServiceObject extends ServiceObject { + calledWith_: Array<{}>; + constructor(config: ServiceObjectConfig, ...args: Array<{}>) { + super(config); + this.calledWith_ = args; + } +} + +let extended = false; +const fakePaginator = { + paginator: { + extend(esClass: Function, methods: string[]) { + if (esClass.name !== 'Zone') { + return; + } + extended = true; + methods = arrify(methods); + assert.strictEqual(esClass.name, 'Zone'); + assert.deepStrictEqual(methods, ['getChanges', 'getRecords']); + }, + streamify(methodName: string) { + return methodName; + }, + }, +}; + +describe('Zone', () => { + // eslint-disable-next-line @typescript-eslint/no-explicit-any + let Zone: any; + // eslint-disable-next-line @typescript-eslint/no-explicit-any + let zone: any; + + const DNS = { + createZone() {}, + }; + const ZONE_NAME = 'zone-name'; + + before(() => { + Zone = proxyquire('../src/zone.js', { + 'dns-zonefile': fakeDnsZonefile, + fs: fakeFs, + '@google-cloud/common': { + ServiceObject: FakeServiceObject, + }, + '@google-cloud/promisify': fakePromisify, + '@google-cloud/paginator': fakePaginator, + './change': { + Change: FakeChange, + }, + './record': {Record: FakeRecord}, + }).Zone; + }); + + beforeEach(() => { + parseOverride = null; + readFileOverride = null; + writeFileOverride = null; + zone = new Zone(DNS, ZONE_NAME); + }); + + describe('instantiation', () => { + it('should promisify all the things', () => { + assert(promisified); + }); + + it('should extend the correct methods', () => { + assert(extended); // See `fakePaginator.extend` + }); + + it('should streamify the correct methods', () => { + assert.strictEqual(zone.getChangesStream, 'getChanges'); + assert.strictEqual(zone.getRecordsStream, 'getRecords'); + }); + + it('should localize the name', () => { + assert.strictEqual(zone.name, ZONE_NAME); + }); + + it('should inherit from ServiceObject', done => { + const dnsInstance = Object.assign({}, DNS, { + createZone: { + bind(context: {}) { + assert.strictEqual(context, dnsInstance); + done(); + }, + }, + }); + + const zone = new Zone(dnsInstance, ZONE_NAME); + assert(zone instanceof ServiceObject); + + // eslint-disable-next-line @typescript-eslint/no-explicit-any + const calledWith = (zone as any).calledWith_[0]; + + assert.strictEqual(calledWith.parent, dnsInstance); + assert.strictEqual(calledWith.baseUrl, '/managedZones'); + assert.strictEqual(calledWith.id, ZONE_NAME); + assert.deepStrictEqual(calledWith.methods, { + create: true, + exists: true, + get: true, + getMetadata: true, + }); + }); + }); + + describe('addRecords', () => { + it('should create a change with additions', done => { + const records = ['a', 'b', 'c']; + + zone.createChange = ( + options: CreateChangeRequest, + callback: Function + ) => { + assert.strictEqual(options.add, records); + callback(); + }; + + zone.addRecords(records, done); + }); + }); + + describe('change', () => { + it('should return a Change object', () => { + const changeId = 'change-id'; + const change = zone.change(changeId); + assert(change instanceof FakeChange); + assert.strictEqual(change.calledWith_[0], zone); + assert.strictEqual(change.calledWith_[1], changeId); + }); + }); + + describe('createChange', () => { + function generateRecord(recordJson?: {}) { + recordJson = Object.assign( + { + name: uuid.v1(), + type: uuid.v1(), + rrdatas: [uuid.v1(), uuid.v1()], + }, + recordJson + ); + + return { + toJSON() { + return recordJson! as {rrdatas: Array<{}>}; + }, + }; + } + + it('should throw error if add or delete is not provided', () => { + assert.throws(() => { + zone.createChange({}, () => {}); + }, /Cannot create a change with no additions or deletions/); + }); + + it('should parse and rename add to additions', done => { + const recordsToAdd = [generateRecord(), generateRecord()]; + + const expectedAdditions = recordsToAdd.map(x => x.toJSON()); + + zone.request = (reqOpts: CoreOptions) => { + assert.strictEqual(reqOpts.json.add, undefined); + assert.deepStrictEqual(reqOpts.json.additions, expectedAdditions); + done(); + }; + + zone.createChange({add: recordsToAdd}, assert.ifError); + }); + + it('should parse and rename delete to deletions', done => { + const recordsToDelete = [generateRecord(), generateRecord()]; + + const expectedDeletions = recordsToDelete.map(x => x.toJSON()); + + zone.request = (reqOpts: CoreOptions) => { + assert.strictEqual(reqOpts.json.delete, undefined); + assert.deepStrictEqual(reqOpts.json.deletions, expectedDeletions); + done(); + }; + + zone.createChange({delete: recordsToDelete}, assert.ifError); + }); + + it('should group changes by name and type', done => { + const recordsToAdd = [ + generateRecord({name: 'name.com.', type: 'mx'}), + generateRecord({name: 'name.com.', type: 'mx'}), + ]; + + zone.request = (reqOpts: CoreOptions) => { + const expectedRRDatas = recordsToAdd + .map(x => x.toJSON().rrdatas) + .reduce((acc, rrdata) => acc.concat(rrdata), []); + + assert.deepStrictEqual(reqOpts.json.additions, [ + { + name: 'name.com.', + type: 'mx', + rrdatas: expectedRRDatas, + }, + ]); + + done(); + }; + + zone.createChange({add: recordsToAdd}, assert.ifError); + }); + + it('should make correct API request', done => { + zone.request = (reqOpts: OptionsWithUri) => { + assert.strictEqual(reqOpts.method, 'POST'); + assert.strictEqual(reqOpts.uri, '/changes'); + + done(); + }; + + zone.createChange({add: []}, assert.ifError); + }); + + describe('error', () => { + const error = new Error('Error.'); + const apiResponse = {a: 'b', c: 'd'}; + + beforeEach(() => { + zone.request = (reqOpts: {}, callback: Function) => { + callback(error, apiResponse); + }; + }); + + it('should execute callback with error & API response', done => { + zone.createChange( + {add: []}, + (err: Error, change: Change, apiResponse_: Response) => { + assert.strictEqual(err, error); + assert.strictEqual(apiResponse_, apiResponse); + done(); + } + ); + }); + }); + + describe('success', () => { + const apiResponse = {id: 1, a: 'b', c: 'd'}; + + beforeEach(() => { + zone.request = (reqOpts: {}, callback: Function) => { + callback(null, apiResponse); + }; + }); + + it('should execute callback with Change & API response', done => { + const change = {}; + + zone.change = (id: string) => { + assert.strictEqual(id, apiResponse.id); + return change; + }; + + zone.createChange( + {add: []}, + (err: Error, change_: Change, apiResponse_: Response) => { + assert.ifError(err); + assert.strictEqual(change_, change); + assert.strictEqual(change_.metadata, apiResponse); + assert.strictEqual(apiResponse_, apiResponse); + done(); + } + ); + }); + }); + }); + + describe('delete', () => { + describe('force', () => { + it('should empty the zone', done => { + zone.empty = () => { + done(); + }; + + zone.delete({force: true}, assert.ifError); + }); + + it('should try to delete again after emptying', done => { + // eslint-disable-next-line @typescript-eslint/no-explicit-any + (FakeServiceObject.prototype as any).delete = () => { + done(); + }; + + zone.empty = (callback: Function) => { + callback(); + }; + + zone.delete({force: true}, assert.ifError); + }); + }); + }); + + describe('deleteRecords', () => { + it('should delete records by type if a string is given', done => { + const recordsToDelete = 'ns'; + + zone.deleteRecordsByType_ = (types: string[], callback: Function) => { + assert.deepStrictEqual(types, [recordsToDelete]); + callback(); + }; + + zone.deleteRecords(recordsToDelete, done); + }); + + it('should create a change if record objects given', done => { + const recordsToDelete = {a: 'b', c: 'd'}; + + zone.createChange = ( + options: CreateChangeRequest, + callback: Function + ) => { + assert.deepStrictEqual(options.delete, [recordsToDelete]); + callback(); + }; + + zone.deleteRecords(recordsToDelete, done); + }); + }); + + describe('empty', () => { + it('should get all records', done => { + zone.getRecords = () => { + done(); + }; + + zone.empty(assert.ifError); + }); + + describe('error', () => { + const error = new Error('Error.'); + + beforeEach(() => { + zone.getRecords = (callback: Function) => { + callback(error); + }; + }); + + it('should execute callback with error', done => { + zone.empty((err: Error) => { + assert.strictEqual(err, error); + done(); + }); + }); + }); + + describe('success', () => { + const records = [ + {type: 'A'}, + {type: 'AAAA'}, + {type: 'CNAME'}, + {type: 'MX'}, + {type: 'NAPTR'}, + {type: 'NS'}, + {type: 'PTR'}, + {type: 'SOA'}, + {type: 'SPF'}, + {type: 'SRV'}, + {type: 'TXT'}, + ]; + + const expectedRecordsToDelete = records.filter(record => { + return record.type !== 'NS' && record.type !== 'SOA'; + }); + + beforeEach(() => { + zone.getRecords = (callback: Function) => { + callback(null, records); + }; + }); + + it('should execute callback if no records matched', done => { + zone.getRecords = (callback: Function) => { + callback(null, []); + }; + + zone.empty(done); + }); + + it('should delete non-NS and non-SOA records', done => { + zone.deleteRecords = ( + recordsToDelete: string[], + callback: Function + ) => { + assert.deepStrictEqual(recordsToDelete, expectedRecordsToDelete); + callback(); + }; + + zone.empty(done); + }); + }); + }); + + describe('export', () => { + const path = './zonefile'; + + const records = [ + { + toString() { + return 'a'; + }, + }, + { + toString() { + return 'a'; + }, + }, + { + toString() { + return 'a'; + }, + }, + { + toString() { + return 'a'; + }, + }, + ]; + + const expectedZonefileContents = 'a\na\na\na'; + + beforeEach(() => { + zone.getRecords = (callback: Function) => { + callback(null, records); + }; + }); + + describe('get records', () => { + describe('error', () => { + const error = new Error('Error.'); + + it('should execute callback with error', done => { + zone.getRecords = (callback: Function) => { + callback(error); + }; + + zone.export(path, (err: Error) => { + assert.strictEqual(err, error); + done(); + }); + }); + }); + + describe('success', () => { + it('should get all records', done => { + zone.getRecords = () => { + done(); + }; + + zone.export(path, assert.ifError); + }); + }); + }); + + describe('write file', () => { + it('should write correct zone file', done => { + writeFileOverride = ( + path_: string, + content: string, + encoding: string + ) => { + assert.strictEqual(path_, path); + assert.strictEqual(content, expectedZonefileContents); + assert.strictEqual(encoding, 'utf-8'); + + done(); + }; + + zone.export(path, assert.ifError); + }); + + describe('error', () => { + const error = new Error('Error.'); + + beforeEach(() => { + writeFileOverride = ( + path: string, + content: string, + encoding: string, + callback: Function + ) => { + callback(error); + }; + }); + + it('should execute the callback with an error', done => { + zone.export(path, (err: Error) => { + assert.strictEqual(err, error); + done(); + }); + }); + }); + + describe('success', () => { + beforeEach(() => { + writeFileOverride = ( + path: string, + content: string, + encoding: string, + callback: Function + ) => { + callback(); + }; + }); + + it('should execute the callback', done => { + zone.export(path, (err: Error) => { + assert.ifError(err); + done(); + }); + }); + }); + }); + }); + + describe('getChanges', () => { + it('should accept only a callback', done => { + zone.request = (reqOpts: CoreOptions) => { + assert.deepStrictEqual(reqOpts.qs, {}); + done(); + }; + + zone.getChanges(assert.ifError); + }); + + it('should accept a sort', done => { + const query = {sort: 'desc'}; + + zone.request = (reqOpts: CoreOptions) => { + assert.strictEqual(reqOpts.qs.sortOrder, 'descending'); + assert.strictEqual(reqOpts.qs.sort, undefined); + + done(); + }; + + zone.getChanges(query, assert.ifError); + }); + + it('should make the correct API request', done => { + const query = {a: 'b', c: 'd'}; + + zone.request = (reqOpts: OptionsWithUri) => { + assert.strictEqual(reqOpts.uri, '/changes'); + assert.strictEqual(reqOpts.qs, query); + + done(); + }; + + zone.getChanges(query, assert.ifError); + }); + + describe('error', () => { + const error = new Error('Error.'); + const apiResponse = {a: 'b', c: 'd'}; + + beforeEach(() => { + zone.request = (reqOpts: {}, callback: Function) => { + callback(error, apiResponse); + }; + }); + + it('should execute callback with error & API response', done => { + zone.getChanges( + {}, + ( + err: Error, + changes: Change[], + nextQuery: {}, + apiResponse_: Response + ) => { + assert.strictEqual(err, error); + assert.strictEqual(apiResponse_, apiResponse); + done(); + } + ); + }); + }); + + describe('success', () => { + const apiResponse = { + changes: [{id: 1}], + }; + + beforeEach(() => { + zone.request = (reqOpts: {}, callback: Function) => { + callback(null, apiResponse); + }; + }); + + it('should build a nextQuery if necessary', done => { + const nextPageToken = 'next-page-token'; + const apiResponseWithNextPageToken = Object.assign({}, apiResponse, { + nextPageToken, + }); + const expectedNextQuery = { + pageToken: nextPageToken, + }; + + zone.request = (reqOpts: {}, callback: Function) => { + callback(null, apiResponseWithNextPageToken); + }; + + zone.getChanges({}, (err: Error, changes: Change[], nextQuery: {}) => { + assert.ifError(err); + assert.deepStrictEqual(nextQuery, expectedNextQuery); + done(); + }); + }); + + it('should execute callback with Changes & API response', done => { + const change = {}; + + zone.change = (id: string) => { + assert.strictEqual(id, apiResponse.changes[0].id); + return change; + }; + + zone.getChanges( + {}, + ( + err: Error, + changes: Change[], + nextQuery: {}, + apiResponse_: Response + ) => { + assert.ifError(err); + assert.strictEqual(changes[0], change); + assert.strictEqual(changes[0].metadata, apiResponse.changes[0]); + assert.strictEqual(apiResponse_, apiResponse); + done(); + } + ); + }); + }); + }); + + describe('getRecords', () => { + describe('error', () => { + const error = new Error('Error.'); + const apiResponse = {a: 'b', c: 'd'}; + + beforeEach(() => { + zone.request = (reqOpts: {}, callback: Function) => { + callback(error, apiResponse); + }; + }); + + it('should execute callback with error & API response', done => { + zone.getRecords( + {}, + ( + err: Error, + changes: Change[], + nextQuery: {}, + apiResponse_: Response + ) => { + assert.strictEqual(err, error); + assert.strictEqual(apiResponse_, apiResponse); + done(); + } + ); + }); + + it('should not require a query', done => { + zone.getRecords((err: Error) => { + assert.strictEqual(err, error); + done(); + }); + }); + }); + + describe('success', () => { + const apiResponse = { + rrsets: [{type: 'NS'}], + }; + + beforeEach(() => { + zone.request = (reqOpts: {}, callback: Function) => { + callback(null, apiResponse); + }; + }); + + it('should execute callback with nextQuery if necessary', done => { + const nextPageToken = 'next-page-token'; + const apiResponseWithNextPageToken = Object.assign({}, apiResponse, { + nextPageToken, + }); + const expectedNextQuery = {pageToken: nextPageToken}; + + zone.request = (reqOpts: {}, callback: Function) => { + callback(null, apiResponseWithNextPageToken); + }; + + zone.getRecords({}, (err: Error, records: Record[], nextQuery: {}) => { + assert.ifError(err); + assert.deepStrictEqual(nextQuery, expectedNextQuery); + done(); + }); + }); + + it('should execute callback with Records & API response', done => { + const record = {}; + + zone.record = (type: string, recordObject: RecordObject) => { + assert.strictEqual(type, apiResponse.rrsets[0].type); + assert.strictEqual(recordObject, apiResponse.rrsets[0]); + return record; + }; + + zone.getRecords( + {}, + ( + err: Error, + records: Record[], + nextQuery: {}, + apiResponse_: Response + ) => { + assert.ifError(err); + assert.strictEqual(records[0], record); + assert.strictEqual(apiResponse_, apiResponse); + done(); + } + ); + + it('should not require a query', done => { + zone.getRecords(done); + }); + }); + + describe('filtering', () => { + it('should accept a string type', done => { + const types = ['MX', 'CNAME']; + + zone.getRecords(types, (err: Error, records: Record[]) => { + assert.ifError(err); + + assert.strictEqual(records.length, 0); + + done(); + }); + }); + + it('should accept an array of types', done => { + const type = 'MX'; + + zone.getRecords(type, (err: Error, records: Record[]) => { + assert.ifError(err); + + assert.strictEqual(records.length, 0); + + done(); + }); + }); + + it('should not send filterByTypes_ in API request', done => { + zone.request = (reqOpts: CoreOptions) => { + assert.strictEqual(reqOpts.qs.filterByTypes_, undefined); + done(); + }; + + zone.getRecords('NS', assert.ifError); + }); + }); + }); + }); + + describe('import', () => { + const path = './zonefile'; + + it('should read from the file', done => { + readFileOverride = (path_: string, encoding: string) => { + assert.strictEqual(path, path); + assert.strictEqual(encoding, 'utf-8'); + done(); + }; + + zone.import(path, assert.ifError); + }); + + describe('error', () => { + const error = new Error('Error.'); + + beforeEach(() => { + readFileOverride = ( + path: string, + encoding: string, + callback: Function + ) => { + callback(error); + }; + }); + + it('should execute the callback', done => { + zone.import(path, (err: Error) => { + assert.strictEqual(err, error); + done(); + }); + }); + }); + + describe('success', () => { + const recordType = 'ns'; + // eslint-disable-next-line @typescript-eslint/no-explicit-any + let parsedZonefile: any = {}; + + beforeEach(() => { + parsedZonefile = { + [recordType]: {a: 'b', c: 'd'}, + }; + + parseOverride = () => { + return parsedZonefile; + }; + + readFileOverride = ( + path: string, + encoding: string, + callback: Function + ) => { + callback(); + }; + }); + + it('should add records', done => { + zone.addRecords = ( + recordsToCreate: FakeRecord[], + callback: Function + ) => { + assert.strictEqual(recordsToCreate.length, 1); + const recordToCreate = recordsToCreate[0]; + assert(recordToCreate instanceof FakeRecord); + const args = recordToCreate.calledWith_; + assert.strictEqual(args[0], zone); + assert.strictEqual(args[1], recordType); + assert.strictEqual(args[2], parsedZonefile[recordType]); + callback(); + }; + zone.import(path, done); + }); + + it('should use the default ttl', done => { + const defaultTTL = '90'; + parsedZonefile.$ttl = defaultTTL; + parsedZonefile[recordType] = {}; + parsedZonefile.mx = {ttl: '180'}; + zone.addRecords = (recordsToCreate: FakeRecord[]) => { + const record1 = recordsToCreate[0].calledWith_[2]; + assert.strictEqual((record1 as RecordMetadata).ttl, defaultTTL); + const record2 = recordsToCreate[1].calledWith_[2]; + assert.strictEqual((record2 as RecordMetadata).ttl, '180'); + done(); + }; + zone.import(path, done); + }); + }); + }); + + describe('record', () => { + it('should return a Record object', () => { + const type = 'a'; + const metadata = {a: 'b', c: 'd'}; + const record = zone.record(type, metadata); + assert(record instanceof FakeRecord); + const args = record.calledWith_; + assert.strictEqual(args[0], zone); + assert.strictEqual(args[1], type); + assert.strictEqual(args[2], metadata); + }); + }); + + describe('replaceRecords', () => { + it('should get records', done => { + const recordType = 'ns'; + zone.getRecords = (recordType_: string) => { + assert.strictEqual(recordType_, recordType); + done(); + }; + zone.replaceRecords(recordType, [], assert.ifError); + }); + + describe('error', () => { + const error = new Error('Error.'); + beforeEach(() => { + zone.getRecords = (recordType: string, callback: Function) => { + callback(error); + }; + }); + + it('should execute callback with error', done => { + zone.replaceRecords('a', [], (err: Error) => { + assert.strictEqual(err, error); + done(); + }); + }); + }); + + describe('success', () => { + const recordsToCreate = [ + {a: 'b', c: 'd'}, + {a: 'b', c: 'd'}, + {a: 'b', c: 'd'}, + ]; + + const recordsToDelete = [ + {a: 'b', c: 'd'}, + {a: 'b', c: 'd'}, + {a: 'b', c: 'd'}, + ]; + + beforeEach(() => { + zone.getRecords = (recordType: string, callback: Function) => { + callback(null, recordsToDelete); + }; + }); + + it('should create a change', done => { + zone.createChange = ( + options: CreateChangeRequest, + callback: Function + ) => { + assert.strictEqual(options.add, recordsToCreate); + assert.strictEqual(options.delete, recordsToDelete); + callback(); + }; + zone.replaceRecords('a', recordsToCreate, done); + }); + }); + }); + + describe('deleteRecordsByType_', () => { + it('should get records', done => { + const recordType = 'ns'; + zone.getRecords = (recordType_: string) => { + assert.strictEqual(recordType_, recordType); + done(); + }; + zone.deleteRecordsByType_(recordType, assert.ifError); + }); + + describe('error', () => { + const error = new Error('Error.'); + beforeEach(() => { + zone.getRecords = (recordType: string, callback: Function) => { + callback(error); + }; + }); + + it('should execute callback with error', done => { + zone.deleteRecordsByType_('a', (err: Error) => { + assert.strictEqual(err, error); + done(); + }); + }); + }); + + describe('success', () => { + const recordsToDelete = [ + {a: 'b', c: 'd'}, + {a: 'b', c: 'd'}, + {a: 'b', c: 'd'}, + ]; + + beforeEach(() => { + zone.getRecords = (recordType: string, callback: Function) => { + callback(null, recordsToDelete); + }; + }); + + it('should execute callback if no records matched', done => { + zone.getRecords = (recordType: string, callback: Function) => { + callback(null, []); + }; + zone.deleteRecordsByType_('a', done); + }); + + it('should delete records', done => { + zone.deleteRecords = (records: Record[], callback: Function) => { + assert.strictEqual(records, recordsToDelete); + callback(); + }; + zone.deleteRecordsByType_('a', done); + }); + }); + }); +}); diff --git a/packages/google-cloud-dns/tsconfig.json b/packages/google-cloud-dns/tsconfig.json new file mode 100644 index 00000000000..8b14ad98550 --- /dev/null +++ b/packages/google-cloud-dns/tsconfig.json @@ -0,0 +1,13 @@ +{ + "extends": "./node_modules/gts/tsconfig-google.json", + "compilerOptions": { + "lib": ["es2018", "dom"], + "rootDir": ".", + "outDir": "build" + }, + "include": [ + "src/*.ts", + "test/*.ts", + "system-test/*.ts" + ] +} diff --git a/packages/google-cloud-documentai/protos/google/cloud/documentai/v1beta3/document_io.proto b/packages/google-cloud-documentai/protos/google/cloud/documentai/v1beta3/document_io.proto index 1b7e7ce2f06..b9681860194 100644 --- a/packages/google-cloud-documentai/protos/google/cloud/documentai/v1beta3/document_io.proto +++ b/packages/google-cloud-documentai/protos/google/cloud/documentai/v1beta3/document_io.proto @@ -115,6 +115,19 @@ message OcrConfig { repeated string language_hints = 1; } + // Configurations for premium OCR features. + message PremiumFeatures { + // Turn on selection mark detector in OCR engine. Only available in OCR 2.0+ + // processors. + bool enable_selection_mark_detection = 3; + + // Turn on font identification model and return font style information. + bool compute_style_info = 4; + + // Turn on the model that can extract LaTeX math formulas. + bool enable_math_ocr = 5; + } + // Hints for the OCR model. Hints hints = 2; @@ -139,6 +152,16 @@ message OcrConfig { // Includes symbol level OCR information if set to true. bool enable_symbol = 6; - // Turn on font id model and returns font style information. - bool compute_style_info = 8; + // Turn on font identification model and return font style information. + // Deprecated, use + // [PremiumFeatures.compute_style_info][google.cloud.documentai.v1beta3.OcrConfig.PremiumFeatures.compute_style_info] + // instead. + bool compute_style_info = 8 [deprecated = true]; + + // Turn off character box detector in OCR engine. Character box detection is + // enabled by default in OCR 2.0+ processors. + bool disable_character_boxes_detection = 10; + + // Configurations for premium OCR features. + PremiumFeatures premium_features = 11; } diff --git a/packages/google-cloud-documentai/protos/google/cloud/documentai/v1beta3/document_processor_service.proto b/packages/google-cloud-documentai/protos/google/cloud/documentai/v1beta3/document_processor_service.proto index d29545d90fe..f2be1c4a159 100644 --- a/packages/google-cloud-documentai/protos/google/cloud/documentai/v1beta3/document_processor_service.proto +++ b/packages/google-cloud-documentai/protos/google/cloud/documentai/v1beta3/document_processor_service.proto @@ -342,6 +342,28 @@ service DocumentProcessorService { // Options for Process API message ProcessOptions { + // A list of individual page numbers. + message IndividualPageSelector { + // Optional. Indices of the pages (starting from 1). + repeated int32 pages = 1 [(google.api.field_behavior) = OPTIONAL]; + } + + // A subset of pages to process. If not specified, all pages will be + // processed. NOTICE: If any of the page range is set, we will extract and + // process only the given pages from the document. In the output document, + // the page_number is referring to the page number in the original document. + oneof page_range { + // Which pages to process (1-indexed). + IndividualPageSelector individual_page_selector = 5; + + // Only process certain pages from the start, process all if the document + // has less pages. + int32 from_start = 6; + + // Only process certain pages from the end, same as above. + int32 from_end = 7; + } + // Only applicable to `OCR_PROCESSOR`. Returns error if set on other // processor types. OcrConfig ocr_config = 1; diff --git a/packages/google-cloud-documentai/protos/protos.d.ts b/packages/google-cloud-documentai/protos/protos.d.ts index 6822bccd191..f4f70c61632 100644 --- a/packages/google-cloud-documentai/protos/protos.d.ts +++ b/packages/google-cloud-documentai/protos/protos.d.ts @@ -32461,6 +32461,12 @@ export namespace google { /** OcrConfig computeStyleInfo */ computeStyleInfo?: (boolean|null); + + /** OcrConfig disableCharacterBoxesDetection */ + disableCharacterBoxesDetection?: (boolean|null); + + /** OcrConfig premiumFeatures */ + premiumFeatures?: (google.cloud.documentai.v1beta3.OcrConfig.IPremiumFeatures|null); } /** Represents an OcrConfig. */ @@ -32490,6 +32496,12 @@ export namespace google { /** OcrConfig computeStyleInfo. */ public computeStyleInfo: boolean; + /** OcrConfig disableCharacterBoxesDetection. */ + public disableCharacterBoxesDetection: boolean; + + /** OcrConfig premiumFeatures. */ + public premiumFeatures?: (google.cloud.documentai.v1beta3.OcrConfig.IPremiumFeatures|null); + /** * Creates a new OcrConfig instance using the specified properties. * @param [properties] Properties to set @@ -32666,6 +32678,115 @@ export namespace google { */ public static getTypeUrl(typeUrlPrefix?: string): string; } + + /** Properties of a PremiumFeatures. */ + interface IPremiumFeatures { + + /** PremiumFeatures enableSelectionMarkDetection */ + enableSelectionMarkDetection?: (boolean|null); + + /** PremiumFeatures computeStyleInfo */ + computeStyleInfo?: (boolean|null); + + /** PremiumFeatures enableMathOcr */ + enableMathOcr?: (boolean|null); + } + + /** Represents a PremiumFeatures. */ + class PremiumFeatures implements IPremiumFeatures { + + /** + * Constructs a new PremiumFeatures. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.documentai.v1beta3.OcrConfig.IPremiumFeatures); + + /** PremiumFeatures enableSelectionMarkDetection. */ + public enableSelectionMarkDetection: boolean; + + /** PremiumFeatures computeStyleInfo. */ + public computeStyleInfo: boolean; + + /** PremiumFeatures enableMathOcr. */ + public enableMathOcr: boolean; + + /** + * Creates a new PremiumFeatures instance using the specified properties. + * @param [properties] Properties to set + * @returns PremiumFeatures instance + */ + public static create(properties?: google.cloud.documentai.v1beta3.OcrConfig.IPremiumFeatures): google.cloud.documentai.v1beta3.OcrConfig.PremiumFeatures; + + /** + * Encodes the specified PremiumFeatures message. Does not implicitly {@link google.cloud.documentai.v1beta3.OcrConfig.PremiumFeatures.verify|verify} messages. + * @param message PremiumFeatures message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.documentai.v1beta3.OcrConfig.IPremiumFeatures, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified PremiumFeatures message, length delimited. Does not implicitly {@link google.cloud.documentai.v1beta3.OcrConfig.PremiumFeatures.verify|verify} messages. + * @param message PremiumFeatures message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.documentai.v1beta3.OcrConfig.IPremiumFeatures, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a PremiumFeatures message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns PremiumFeatures + * @throws {Error} If the payload is not 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.documentai.v1beta3.OcrConfig.PremiumFeatures; + + /** + * Decodes a PremiumFeatures message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns PremiumFeatures + * @throws {Error} If the payload 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.documentai.v1beta3.OcrConfig.PremiumFeatures; + + /** + * Verifies a PremiumFeatures message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a PremiumFeatures message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns PremiumFeatures + */ + public static fromObject(object: { [k: string]: any }): google.cloud.documentai.v1beta3.OcrConfig.PremiumFeatures; + + /** + * Creates a plain object from a PremiumFeatures message. Also converts values to other types if specified. + * @param message PremiumFeatures + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.documentai.v1beta3.OcrConfig.PremiumFeatures, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this PremiumFeatures to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for PremiumFeatures + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } } /** Properties of a PropertyMetadata. */ @@ -33962,6 +34083,15 @@ export namespace google { /** Properties of a ProcessOptions. */ interface IProcessOptions { + /** ProcessOptions individualPageSelector */ + individualPageSelector?: (google.cloud.documentai.v1beta3.ProcessOptions.IIndividualPageSelector|null); + + /** ProcessOptions fromStart */ + fromStart?: (number|null); + + /** ProcessOptions fromEnd */ + fromEnd?: (number|null); + /** ProcessOptions ocrConfig */ ocrConfig?: (google.cloud.documentai.v1beta3.IOcrConfig|null); } @@ -33975,9 +34105,21 @@ export namespace google { */ constructor(properties?: google.cloud.documentai.v1beta3.IProcessOptions); + /** ProcessOptions individualPageSelector. */ + public individualPageSelector?: (google.cloud.documentai.v1beta3.ProcessOptions.IIndividualPageSelector|null); + + /** ProcessOptions fromStart. */ + public fromStart?: (number|null); + + /** ProcessOptions fromEnd. */ + public fromEnd?: (number|null); + /** ProcessOptions ocrConfig. */ public ocrConfig?: (google.cloud.documentai.v1beta3.IOcrConfig|null); + /** ProcessOptions pageRange. */ + public pageRange?: ("individualPageSelector"|"fromStart"|"fromEnd"); + /** * Creates a new ProcessOptions instance using the specified properties. * @param [properties] Properties to set @@ -34056,6 +34198,106 @@ export namespace google { public static getTypeUrl(typeUrlPrefix?: string): string; } + namespace ProcessOptions { + + /** Properties of an IndividualPageSelector. */ + interface IIndividualPageSelector { + + /** IndividualPageSelector pages */ + pages?: (number[]|null); + } + + /** Represents an IndividualPageSelector. */ + class IndividualPageSelector implements IIndividualPageSelector { + + /** + * Constructs a new IndividualPageSelector. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.documentai.v1beta3.ProcessOptions.IIndividualPageSelector); + + /** IndividualPageSelector pages. */ + public pages: number[]; + + /** + * Creates a new IndividualPageSelector instance using the specified properties. + * @param [properties] Properties to set + * @returns IndividualPageSelector instance + */ + public static create(properties?: google.cloud.documentai.v1beta3.ProcessOptions.IIndividualPageSelector): google.cloud.documentai.v1beta3.ProcessOptions.IndividualPageSelector; + + /** + * Encodes the specified IndividualPageSelector message. Does not implicitly {@link google.cloud.documentai.v1beta3.ProcessOptions.IndividualPageSelector.verify|verify} messages. + * @param message IndividualPageSelector message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.documentai.v1beta3.ProcessOptions.IIndividualPageSelector, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified IndividualPageSelector message, length delimited. Does not implicitly {@link google.cloud.documentai.v1beta3.ProcessOptions.IndividualPageSelector.verify|verify} messages. + * @param message IndividualPageSelector message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.documentai.v1beta3.ProcessOptions.IIndividualPageSelector, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an IndividualPageSelector message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns IndividualPageSelector + * @throws {Error} If the payload is not 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.documentai.v1beta3.ProcessOptions.IndividualPageSelector; + + /** + * Decodes an IndividualPageSelector message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns IndividualPageSelector + * @throws {Error} If the payload 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.documentai.v1beta3.ProcessOptions.IndividualPageSelector; + + /** + * Verifies an IndividualPageSelector message. + * @param message Plain 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 IndividualPageSelector message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns IndividualPageSelector + */ + public static fromObject(object: { [k: string]: any }): google.cloud.documentai.v1beta3.ProcessOptions.IndividualPageSelector; + + /** + * Creates a plain object from an IndividualPageSelector message. Also converts values to other types if specified. + * @param message IndividualPageSelector + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.documentai.v1beta3.ProcessOptions.IndividualPageSelector, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this IndividualPageSelector to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for IndividualPageSelector + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + /** Properties of a ProcessRequest. */ interface IProcessRequest { diff --git a/packages/google-cloud-documentai/protos/protos.js b/packages/google-cloud-documentai/protos/protos.js index ec25723ba1d..359ea2e035c 100644 --- a/packages/google-cloud-documentai/protos/protos.js +++ b/packages/google-cloud-documentai/protos/protos.js @@ -81533,6 +81533,8 @@ * @property {Array.|null} [advancedOcrOptions] OcrConfig advancedOcrOptions * @property {boolean|null} [enableSymbol] OcrConfig enableSymbol * @property {boolean|null} [computeStyleInfo] OcrConfig computeStyleInfo + * @property {boolean|null} [disableCharacterBoxesDetection] OcrConfig disableCharacterBoxesDetection + * @property {google.cloud.documentai.v1beta3.OcrConfig.IPremiumFeatures|null} [premiumFeatures] OcrConfig premiumFeatures */ /** @@ -81599,6 +81601,22 @@ */ OcrConfig.prototype.computeStyleInfo = false; + /** + * OcrConfig disableCharacterBoxesDetection. + * @member {boolean} disableCharacterBoxesDetection + * @memberof google.cloud.documentai.v1beta3.OcrConfig + * @instance + */ + OcrConfig.prototype.disableCharacterBoxesDetection = false; + + /** + * OcrConfig premiumFeatures. + * @member {google.cloud.documentai.v1beta3.OcrConfig.IPremiumFeatures|null|undefined} premiumFeatures + * @memberof google.cloud.documentai.v1beta3.OcrConfig + * @instance + */ + OcrConfig.prototype.premiumFeatures = null; + /** * Creates a new OcrConfig instance using the specified properties. * @function create @@ -81636,6 +81654,10 @@ writer.uint32(/* id 6, wireType 0 =*/48).bool(message.enableSymbol); if (message.computeStyleInfo != null && Object.hasOwnProperty.call(message, "computeStyleInfo")) writer.uint32(/* id 8, wireType 0 =*/64).bool(message.computeStyleInfo); + if (message.disableCharacterBoxesDetection != null && Object.hasOwnProperty.call(message, "disableCharacterBoxesDetection")) + writer.uint32(/* id 10, wireType 0 =*/80).bool(message.disableCharacterBoxesDetection); + if (message.premiumFeatures != null && Object.hasOwnProperty.call(message, "premiumFeatures")) + $root.google.cloud.documentai.v1beta3.OcrConfig.PremiumFeatures.encode(message.premiumFeatures, writer.uint32(/* id 11, wireType 2 =*/90).fork()).ldelim(); return writer; }; @@ -81696,6 +81718,14 @@ message.computeStyleInfo = reader.bool(); break; } + case 10: { + message.disableCharacterBoxesDetection = reader.bool(); + break; + } + case 11: { + message.premiumFeatures = $root.google.cloud.documentai.v1beta3.OcrConfig.PremiumFeatures.decode(reader, reader.uint32()); + break; + } default: reader.skipType(tag & 7); break; @@ -81755,6 +81785,14 @@ if (message.computeStyleInfo != null && message.hasOwnProperty("computeStyleInfo")) if (typeof message.computeStyleInfo !== "boolean") return "computeStyleInfo: boolean expected"; + if (message.disableCharacterBoxesDetection != null && message.hasOwnProperty("disableCharacterBoxesDetection")) + if (typeof message.disableCharacterBoxesDetection !== "boolean") + return "disableCharacterBoxesDetection: boolean expected"; + if (message.premiumFeatures != null && message.hasOwnProperty("premiumFeatures")) { + var error = $root.google.cloud.documentai.v1beta3.OcrConfig.PremiumFeatures.verify(message.premiumFeatures); + if (error) + return "premiumFeatures." + error; + } return null; }; @@ -81790,6 +81828,13 @@ message.enableSymbol = Boolean(object.enableSymbol); if (object.computeStyleInfo != null) message.computeStyleInfo = Boolean(object.computeStyleInfo); + if (object.disableCharacterBoxesDetection != null) + message.disableCharacterBoxesDetection = Boolean(object.disableCharacterBoxesDetection); + if (object.premiumFeatures != null) { + if (typeof object.premiumFeatures !== "object") + throw TypeError(".google.cloud.documentai.v1beta3.OcrConfig.premiumFeatures: object expected"); + message.premiumFeatures = $root.google.cloud.documentai.v1beta3.OcrConfig.PremiumFeatures.fromObject(object.premiumFeatures); + } return message; }; @@ -81814,6 +81859,8 @@ object.enableImageQualityScores = false; object.enableSymbol = false; object.computeStyleInfo = false; + object.disableCharacterBoxesDetection = false; + object.premiumFeatures = null; } if (message.hints != null && message.hasOwnProperty("hints")) object.hints = $root.google.cloud.documentai.v1beta3.OcrConfig.Hints.toObject(message.hints, options); @@ -81830,6 +81877,10 @@ object.enableSymbol = message.enableSymbol; if (message.computeStyleInfo != null && message.hasOwnProperty("computeStyleInfo")) object.computeStyleInfo = message.computeStyleInfo; + if (message.disableCharacterBoxesDetection != null && message.hasOwnProperty("disableCharacterBoxesDetection")) + object.disableCharacterBoxesDetection = message.disableCharacterBoxesDetection; + if (message.premiumFeatures != null && message.hasOwnProperty("premiumFeatures")) + object.premiumFeatures = $root.google.cloud.documentai.v1beta3.OcrConfig.PremiumFeatures.toObject(message.premiumFeatures, options); return object; }; @@ -82078,6 +82129,256 @@ return Hints; })(); + OcrConfig.PremiumFeatures = (function() { + + /** + * Properties of a PremiumFeatures. + * @memberof google.cloud.documentai.v1beta3.OcrConfig + * @interface IPremiumFeatures + * @property {boolean|null} [enableSelectionMarkDetection] PremiumFeatures enableSelectionMarkDetection + * @property {boolean|null} [computeStyleInfo] PremiumFeatures computeStyleInfo + * @property {boolean|null} [enableMathOcr] PremiumFeatures enableMathOcr + */ + + /** + * Constructs a new PremiumFeatures. + * @memberof google.cloud.documentai.v1beta3.OcrConfig + * @classdesc Represents a PremiumFeatures. + * @implements IPremiumFeatures + * @constructor + * @param {google.cloud.documentai.v1beta3.OcrConfig.IPremiumFeatures=} [properties] Properties to set + */ + function PremiumFeatures(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * PremiumFeatures enableSelectionMarkDetection. + * @member {boolean} enableSelectionMarkDetection + * @memberof google.cloud.documentai.v1beta3.OcrConfig.PremiumFeatures + * @instance + */ + PremiumFeatures.prototype.enableSelectionMarkDetection = false; + + /** + * PremiumFeatures computeStyleInfo. + * @member {boolean} computeStyleInfo + * @memberof google.cloud.documentai.v1beta3.OcrConfig.PremiumFeatures + * @instance + */ + PremiumFeatures.prototype.computeStyleInfo = false; + + /** + * PremiumFeatures enableMathOcr. + * @member {boolean} enableMathOcr + * @memberof google.cloud.documentai.v1beta3.OcrConfig.PremiumFeatures + * @instance + */ + PremiumFeatures.prototype.enableMathOcr = false; + + /** + * Creates a new PremiumFeatures instance using the specified properties. + * @function create + * @memberof google.cloud.documentai.v1beta3.OcrConfig.PremiumFeatures + * @static + * @param {google.cloud.documentai.v1beta3.OcrConfig.IPremiumFeatures=} [properties] Properties to set + * @returns {google.cloud.documentai.v1beta3.OcrConfig.PremiumFeatures} PremiumFeatures instance + */ + PremiumFeatures.create = function create(properties) { + return new PremiumFeatures(properties); + }; + + /** + * Encodes the specified PremiumFeatures message. Does not implicitly {@link google.cloud.documentai.v1beta3.OcrConfig.PremiumFeatures.verify|verify} messages. + * @function encode + * @memberof google.cloud.documentai.v1beta3.OcrConfig.PremiumFeatures + * @static + * @param {google.cloud.documentai.v1beta3.OcrConfig.IPremiumFeatures} message PremiumFeatures message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PremiumFeatures.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.enableSelectionMarkDetection != null && Object.hasOwnProperty.call(message, "enableSelectionMarkDetection")) + writer.uint32(/* id 3, wireType 0 =*/24).bool(message.enableSelectionMarkDetection); + if (message.computeStyleInfo != null && Object.hasOwnProperty.call(message, "computeStyleInfo")) + writer.uint32(/* id 4, wireType 0 =*/32).bool(message.computeStyleInfo); + if (message.enableMathOcr != null && Object.hasOwnProperty.call(message, "enableMathOcr")) + writer.uint32(/* id 5, wireType 0 =*/40).bool(message.enableMathOcr); + return writer; + }; + + /** + * Encodes the specified PremiumFeatures message, length delimited. Does not implicitly {@link google.cloud.documentai.v1beta3.OcrConfig.PremiumFeatures.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.documentai.v1beta3.OcrConfig.PremiumFeatures + * @static + * @param {google.cloud.documentai.v1beta3.OcrConfig.IPremiumFeatures} message PremiumFeatures message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PremiumFeatures.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a PremiumFeatures message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.documentai.v1beta3.OcrConfig.PremiumFeatures + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.documentai.v1beta3.OcrConfig.PremiumFeatures} PremiumFeatures + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PremiumFeatures.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.documentai.v1beta3.OcrConfig.PremiumFeatures(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 3: { + message.enableSelectionMarkDetection = reader.bool(); + break; + } + case 4: { + message.computeStyleInfo = reader.bool(); + break; + } + case 5: { + message.enableMathOcr = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a PremiumFeatures message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.documentai.v1beta3.OcrConfig.PremiumFeatures + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.documentai.v1beta3.OcrConfig.PremiumFeatures} PremiumFeatures + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PremiumFeatures.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a PremiumFeatures message. + * @function verify + * @memberof google.cloud.documentai.v1beta3.OcrConfig.PremiumFeatures + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + PremiumFeatures.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.enableSelectionMarkDetection != null && message.hasOwnProperty("enableSelectionMarkDetection")) + if (typeof message.enableSelectionMarkDetection !== "boolean") + return "enableSelectionMarkDetection: boolean expected"; + if (message.computeStyleInfo != null && message.hasOwnProperty("computeStyleInfo")) + if (typeof message.computeStyleInfo !== "boolean") + return "computeStyleInfo: boolean expected"; + if (message.enableMathOcr != null && message.hasOwnProperty("enableMathOcr")) + if (typeof message.enableMathOcr !== "boolean") + return "enableMathOcr: boolean expected"; + return null; + }; + + /** + * Creates a PremiumFeatures message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.documentai.v1beta3.OcrConfig.PremiumFeatures + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.documentai.v1beta3.OcrConfig.PremiumFeatures} PremiumFeatures + */ + PremiumFeatures.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.documentai.v1beta3.OcrConfig.PremiumFeatures) + return object; + var message = new $root.google.cloud.documentai.v1beta3.OcrConfig.PremiumFeatures(); + if (object.enableSelectionMarkDetection != null) + message.enableSelectionMarkDetection = Boolean(object.enableSelectionMarkDetection); + if (object.computeStyleInfo != null) + message.computeStyleInfo = Boolean(object.computeStyleInfo); + if (object.enableMathOcr != null) + message.enableMathOcr = Boolean(object.enableMathOcr); + return message; + }; + + /** + * Creates a plain object from a PremiumFeatures message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.documentai.v1beta3.OcrConfig.PremiumFeatures + * @static + * @param {google.cloud.documentai.v1beta3.OcrConfig.PremiumFeatures} message PremiumFeatures + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + PremiumFeatures.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.enableSelectionMarkDetection = false; + object.computeStyleInfo = false; + object.enableMathOcr = false; + } + if (message.enableSelectionMarkDetection != null && message.hasOwnProperty("enableSelectionMarkDetection")) + object.enableSelectionMarkDetection = message.enableSelectionMarkDetection; + if (message.computeStyleInfo != null && message.hasOwnProperty("computeStyleInfo")) + object.computeStyleInfo = message.computeStyleInfo; + if (message.enableMathOcr != null && message.hasOwnProperty("enableMathOcr")) + object.enableMathOcr = message.enableMathOcr; + return object; + }; + + /** + * Converts this PremiumFeatures to JSON. + * @function toJSON + * @memberof google.cloud.documentai.v1beta3.OcrConfig.PremiumFeatures + * @instance + * @returns {Object.} JSON object + */ + PremiumFeatures.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for PremiumFeatures + * @function getTypeUrl + * @memberof google.cloud.documentai.v1beta3.OcrConfig.PremiumFeatures + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + PremiumFeatures.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.documentai.v1beta3.OcrConfig.PremiumFeatures"; + }; + + return PremiumFeatures; + })(); + return OcrConfig; })(); @@ -84799,6 +85100,9 @@ * Properties of a ProcessOptions. * @memberof google.cloud.documentai.v1beta3 * @interface IProcessOptions + * @property {google.cloud.documentai.v1beta3.ProcessOptions.IIndividualPageSelector|null} [individualPageSelector] ProcessOptions individualPageSelector + * @property {number|null} [fromStart] ProcessOptions fromStart + * @property {number|null} [fromEnd] ProcessOptions fromEnd * @property {google.cloud.documentai.v1beta3.IOcrConfig|null} [ocrConfig] ProcessOptions ocrConfig */ @@ -84817,6 +85121,30 @@ this[keys[i]] = properties[keys[i]]; } + /** + * ProcessOptions individualPageSelector. + * @member {google.cloud.documentai.v1beta3.ProcessOptions.IIndividualPageSelector|null|undefined} individualPageSelector + * @memberof google.cloud.documentai.v1beta3.ProcessOptions + * @instance + */ + ProcessOptions.prototype.individualPageSelector = null; + + /** + * ProcessOptions fromStart. + * @member {number|null|undefined} fromStart + * @memberof google.cloud.documentai.v1beta3.ProcessOptions + * @instance + */ + ProcessOptions.prototype.fromStart = null; + + /** + * ProcessOptions fromEnd. + * @member {number|null|undefined} fromEnd + * @memberof google.cloud.documentai.v1beta3.ProcessOptions + * @instance + */ + ProcessOptions.prototype.fromEnd = null; + /** * ProcessOptions ocrConfig. * @member {google.cloud.documentai.v1beta3.IOcrConfig|null|undefined} ocrConfig @@ -84825,6 +85153,20 @@ */ ProcessOptions.prototype.ocrConfig = null; + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * ProcessOptions pageRange. + * @member {"individualPageSelector"|"fromStart"|"fromEnd"|undefined} pageRange + * @memberof google.cloud.documentai.v1beta3.ProcessOptions + * @instance + */ + Object.defineProperty(ProcessOptions.prototype, "pageRange", { + get: $util.oneOfGetter($oneOfFields = ["individualPageSelector", "fromStart", "fromEnd"]), + set: $util.oneOfSetter($oneOfFields) + }); + /** * Creates a new ProcessOptions instance using the specified properties. * @function create @@ -84851,6 +85193,12 @@ writer = $Writer.create(); if (message.ocrConfig != null && Object.hasOwnProperty.call(message, "ocrConfig")) $root.google.cloud.documentai.v1beta3.OcrConfig.encode(message.ocrConfig, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.individualPageSelector != null && Object.hasOwnProperty.call(message, "individualPageSelector")) + $root.google.cloud.documentai.v1beta3.ProcessOptions.IndividualPageSelector.encode(message.individualPageSelector, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.fromStart != null && Object.hasOwnProperty.call(message, "fromStart")) + writer.uint32(/* id 6, wireType 0 =*/48).int32(message.fromStart); + if (message.fromEnd != null && Object.hasOwnProperty.call(message, "fromEnd")) + writer.uint32(/* id 7, wireType 0 =*/56).int32(message.fromEnd); return writer; }; @@ -84885,6 +85233,18 @@ while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { + case 5: { + message.individualPageSelector = $root.google.cloud.documentai.v1beta3.ProcessOptions.IndividualPageSelector.decode(reader, reader.uint32()); + break; + } + case 6: { + message.fromStart = reader.int32(); + break; + } + case 7: { + message.fromEnd = reader.int32(); + break; + } case 1: { message.ocrConfig = $root.google.cloud.documentai.v1beta3.OcrConfig.decode(reader, reader.uint32()); break; @@ -84924,6 +85284,29 @@ ProcessOptions.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; + var properties = {}; + if (message.individualPageSelector != null && message.hasOwnProperty("individualPageSelector")) { + properties.pageRange = 1; + { + var error = $root.google.cloud.documentai.v1beta3.ProcessOptions.IndividualPageSelector.verify(message.individualPageSelector); + if (error) + return "individualPageSelector." + error; + } + } + if (message.fromStart != null && message.hasOwnProperty("fromStart")) { + if (properties.pageRange === 1) + return "pageRange: multiple values"; + properties.pageRange = 1; + if (!$util.isInteger(message.fromStart)) + return "fromStart: integer expected"; + } + if (message.fromEnd != null && message.hasOwnProperty("fromEnd")) { + if (properties.pageRange === 1) + return "pageRange: multiple values"; + properties.pageRange = 1; + if (!$util.isInteger(message.fromEnd)) + return "fromEnd: integer expected"; + } if (message.ocrConfig != null && message.hasOwnProperty("ocrConfig")) { var error = $root.google.cloud.documentai.v1beta3.OcrConfig.verify(message.ocrConfig); if (error) @@ -84944,6 +85327,15 @@ if (object instanceof $root.google.cloud.documentai.v1beta3.ProcessOptions) return object; var message = new $root.google.cloud.documentai.v1beta3.ProcessOptions(); + if (object.individualPageSelector != null) { + if (typeof object.individualPageSelector !== "object") + throw TypeError(".google.cloud.documentai.v1beta3.ProcessOptions.individualPageSelector: object expected"); + message.individualPageSelector = $root.google.cloud.documentai.v1beta3.ProcessOptions.IndividualPageSelector.fromObject(object.individualPageSelector); + } + if (object.fromStart != null) + message.fromStart = object.fromStart | 0; + if (object.fromEnd != null) + message.fromEnd = object.fromEnd | 0; if (object.ocrConfig != null) { if (typeof object.ocrConfig !== "object") throw TypeError(".google.cloud.documentai.v1beta3.ProcessOptions.ocrConfig: object expected"); @@ -84969,6 +85361,21 @@ object.ocrConfig = null; if (message.ocrConfig != null && message.hasOwnProperty("ocrConfig")) object.ocrConfig = $root.google.cloud.documentai.v1beta3.OcrConfig.toObject(message.ocrConfig, options); + if (message.individualPageSelector != null && message.hasOwnProperty("individualPageSelector")) { + object.individualPageSelector = $root.google.cloud.documentai.v1beta3.ProcessOptions.IndividualPageSelector.toObject(message.individualPageSelector, options); + if (options.oneofs) + object.pageRange = "individualPageSelector"; + } + if (message.fromStart != null && message.hasOwnProperty("fromStart")) { + object.fromStart = message.fromStart; + if (options.oneofs) + object.pageRange = "fromStart"; + } + if (message.fromEnd != null && message.hasOwnProperty("fromEnd")) { + object.fromEnd = message.fromEnd; + if (options.oneofs) + object.pageRange = "fromEnd"; + } return object; }; @@ -84998,6 +85405,233 @@ return typeUrlPrefix + "/google.cloud.documentai.v1beta3.ProcessOptions"; }; + ProcessOptions.IndividualPageSelector = (function() { + + /** + * Properties of an IndividualPageSelector. + * @memberof google.cloud.documentai.v1beta3.ProcessOptions + * @interface IIndividualPageSelector + * @property {Array.|null} [pages] IndividualPageSelector pages + */ + + /** + * Constructs a new IndividualPageSelector. + * @memberof google.cloud.documentai.v1beta3.ProcessOptions + * @classdesc Represents an IndividualPageSelector. + * @implements IIndividualPageSelector + * @constructor + * @param {google.cloud.documentai.v1beta3.ProcessOptions.IIndividualPageSelector=} [properties] Properties to set + */ + function IndividualPageSelector(properties) { + this.pages = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * IndividualPageSelector pages. + * @member {Array.} pages + * @memberof google.cloud.documentai.v1beta3.ProcessOptions.IndividualPageSelector + * @instance + */ + IndividualPageSelector.prototype.pages = $util.emptyArray; + + /** + * Creates a new IndividualPageSelector instance using the specified properties. + * @function create + * @memberof google.cloud.documentai.v1beta3.ProcessOptions.IndividualPageSelector + * @static + * @param {google.cloud.documentai.v1beta3.ProcessOptions.IIndividualPageSelector=} [properties] Properties to set + * @returns {google.cloud.documentai.v1beta3.ProcessOptions.IndividualPageSelector} IndividualPageSelector instance + */ + IndividualPageSelector.create = function create(properties) { + return new IndividualPageSelector(properties); + }; + + /** + * Encodes the specified IndividualPageSelector message. Does not implicitly {@link google.cloud.documentai.v1beta3.ProcessOptions.IndividualPageSelector.verify|verify} messages. + * @function encode + * @memberof google.cloud.documentai.v1beta3.ProcessOptions.IndividualPageSelector + * @static + * @param {google.cloud.documentai.v1beta3.ProcessOptions.IIndividualPageSelector} message IndividualPageSelector message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + IndividualPageSelector.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.pages != null && message.pages.length) { + writer.uint32(/* id 1, wireType 2 =*/10).fork(); + for (var i = 0; i < message.pages.length; ++i) + writer.int32(message.pages[i]); + writer.ldelim(); + } + return writer; + }; + + /** + * Encodes the specified IndividualPageSelector message, length delimited. Does not implicitly {@link google.cloud.documentai.v1beta3.ProcessOptions.IndividualPageSelector.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.documentai.v1beta3.ProcessOptions.IndividualPageSelector + * @static + * @param {google.cloud.documentai.v1beta3.ProcessOptions.IIndividualPageSelector} message IndividualPageSelector message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + IndividualPageSelector.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an IndividualPageSelector message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.documentai.v1beta3.ProcessOptions.IndividualPageSelector + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.documentai.v1beta3.ProcessOptions.IndividualPageSelector} IndividualPageSelector + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + IndividualPageSelector.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.documentai.v1beta3.ProcessOptions.IndividualPageSelector(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.pages && message.pages.length)) + message.pages = []; + if ((tag & 7) === 2) { + var end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) + message.pages.push(reader.int32()); + } else + message.pages.push(reader.int32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an IndividualPageSelector message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.documentai.v1beta3.ProcessOptions.IndividualPageSelector + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.documentai.v1beta3.ProcessOptions.IndividualPageSelector} IndividualPageSelector + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + IndividualPageSelector.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an IndividualPageSelector message. + * @function verify + * @memberof google.cloud.documentai.v1beta3.ProcessOptions.IndividualPageSelector + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + IndividualPageSelector.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.pages != null && message.hasOwnProperty("pages")) { + if (!Array.isArray(message.pages)) + return "pages: array expected"; + for (var i = 0; i < message.pages.length; ++i) + if (!$util.isInteger(message.pages[i])) + return "pages: integer[] expected"; + } + return null; + }; + + /** + * Creates an IndividualPageSelector message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.documentai.v1beta3.ProcessOptions.IndividualPageSelector + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.documentai.v1beta3.ProcessOptions.IndividualPageSelector} IndividualPageSelector + */ + IndividualPageSelector.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.documentai.v1beta3.ProcessOptions.IndividualPageSelector) + return object; + var message = new $root.google.cloud.documentai.v1beta3.ProcessOptions.IndividualPageSelector(); + if (object.pages) { + if (!Array.isArray(object.pages)) + throw TypeError(".google.cloud.documentai.v1beta3.ProcessOptions.IndividualPageSelector.pages: array expected"); + message.pages = []; + for (var i = 0; i < object.pages.length; ++i) + message.pages[i] = object.pages[i] | 0; + } + return message; + }; + + /** + * Creates a plain object from an IndividualPageSelector message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.documentai.v1beta3.ProcessOptions.IndividualPageSelector + * @static + * @param {google.cloud.documentai.v1beta3.ProcessOptions.IndividualPageSelector} message IndividualPageSelector + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + IndividualPageSelector.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.pages = []; + if (message.pages && message.pages.length) { + object.pages = []; + for (var j = 0; j < message.pages.length; ++j) + object.pages[j] = message.pages[j]; + } + return object; + }; + + /** + * Converts this IndividualPageSelector to JSON. + * @function toJSON + * @memberof google.cloud.documentai.v1beta3.ProcessOptions.IndividualPageSelector + * @instance + * @returns {Object.} JSON object + */ + IndividualPageSelector.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for IndividualPageSelector + * @function getTypeUrl + * @memberof google.cloud.documentai.v1beta3.ProcessOptions.IndividualPageSelector + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + IndividualPageSelector.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.documentai.v1beta3.ProcessOptions.IndividualPageSelector"; + }; + + return IndividualPageSelector; + })(); + return ProcessOptions; })(); diff --git a/packages/google-cloud-documentai/protos/protos.json b/packages/google-cloud-documentai/protos/protos.json index 70ee5b63f65..cff06dc29bb 100644 --- a/packages/google-cloud-documentai/protos/protos.json +++ b/packages/google-cloud-documentai/protos/protos.json @@ -6998,7 +6998,18 @@ }, "computeStyleInfo": { "type": "bool", - "id": 8 + "id": 8, + "options": { + "deprecated": true + } + }, + "disableCharacterBoxesDetection": { + "type": "bool", + "id": 10 + }, + "premiumFeatures": { + "type": "PremiumFeatures", + "id": 11 } }, "nested": { @@ -7010,6 +7021,22 @@ "id": 1 } } + }, + "PremiumFeatures": { + "fields": { + "enableSelectionMarkDetection": { + "type": "bool", + "id": 3 + }, + "computeStyleInfo": { + "type": "bool", + "id": 4 + }, + "enableMathOcr": { + "type": "bool", + "id": 5 + } + } } } }, @@ -7694,11 +7721,46 @@ } }, "ProcessOptions": { + "oneofs": { + "pageRange": { + "oneof": [ + "individualPageSelector", + "fromStart", + "fromEnd" + ] + } + }, "fields": { + "individualPageSelector": { + "type": "IndividualPageSelector", + "id": 5 + }, + "fromStart": { + "type": "int32", + "id": 6 + }, + "fromEnd": { + "type": "int32", + "id": 7 + }, "ocrConfig": { "type": "OcrConfig", "id": 1 } + }, + "nested": { + "IndividualPageSelector": { + "fields": { + "pages": { + "rule": "repeated", + "type": "int32", + "id": 1, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + } } }, "ProcessRequest": { diff --git a/packages/google-cloud-edgecontainer/.OwlBot.yaml b/packages/google-cloud-edgecontainer/.OwlBot.yaml new file mode 100644 index 00000000000..895a0de3c87 --- /dev/null +++ b/packages/google-cloud-edgecontainer/.OwlBot.yaml @@ -0,0 +1,19 @@ +# 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. + +deep-copy-regex: + - source: /google/cloud/edgecontainer/(.*)/.*-nodejs + dest: /owl-bot-staging/google-cloud-edgecontainer/$1 + +api-name: edgecontainer \ No newline at end of file diff --git a/packages/google-cloud-edgecontainer/.eslintignore b/packages/google-cloud-edgecontainer/.eslintignore new file mode 100644 index 00000000000..ea5b04aebe6 --- /dev/null +++ b/packages/google-cloud-edgecontainer/.eslintignore @@ -0,0 +1,7 @@ +**/node_modules +**/coverage +test/fixtures +build/ +docs/ +protos/ +samples/generated/ diff --git a/packages/google-cloud-edgecontainer/.eslintrc.json b/packages/google-cloud-edgecontainer/.eslintrc.json new file mode 100644 index 00000000000..78215349546 --- /dev/null +++ b/packages/google-cloud-edgecontainer/.eslintrc.json @@ -0,0 +1,3 @@ +{ + "extends": "./node_modules/gts" +} diff --git a/packages/google-cloud-edgecontainer/.gitattributes b/packages/google-cloud-edgecontainer/.gitattributes new file mode 100644 index 00000000000..33739cb74e4 --- /dev/null +++ b/packages/google-cloud-edgecontainer/.gitattributes @@ -0,0 +1,4 @@ +*.ts text eol=lf +*.js text eol=lf +protos/* linguist-generated +**/api-extractor.json linguist-language=JSON-with-Comments diff --git a/packages/google-cloud-edgecontainer/.gitignore b/packages/google-cloud-edgecontainer/.gitignore new file mode 100644 index 00000000000..d4f03a0df2e --- /dev/null +++ b/packages/google-cloud-edgecontainer/.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/google-cloud-edgecontainer/.jsdoc.js b/packages/google-cloud-edgecontainer/.jsdoc.js new file mode 100644 index 00000000000..e8a630e8ad4 --- /dev/null +++ b/packages/google-cloud-edgecontainer/.jsdoc.js @@ -0,0 +1,55 @@ +// Copyright 2023 Google LLC +// +// Licensed under the Apache License, Version 2.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 2023 Google LLC', + includeDate: false, + sourceFiles: false, + systemName: '@google-cloud/edgecontainer', + theme: 'lumen', + default: { + outputSourceFiles: false + } + }, + markdown: { + idInHeadings: true + } +}; diff --git a/packages/google-cloud-edgecontainer/.mocharc.js b/packages/google-cloud-edgecontainer/.mocharc.js new file mode 100644 index 00000000000..49e7e228701 --- /dev/null +++ b/packages/google-cloud-edgecontainer/.mocharc.js @@ -0,0 +1,29 @@ +// Copyright 2023 Google LLC +// +// Licensed under the Apache License, Version 2.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. +const config = { + "enable-source-maps": true, + "throw-deprecation": true, + "timeout": 10000, + "recursive": true +} +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/google-cloud-edgecontainer/.nycrc b/packages/google-cloud-edgecontainer/.nycrc new file mode 100644 index 00000000000..b18d5472b62 --- /dev/null +++ b/packages/google-cloud-edgecontainer/.nycrc @@ -0,0 +1,24 @@ +{ + "report-dir": "./.coverage", + "reporter": ["text", "lcov"], + "exclude": [ + "**/*-test", + "**/.coverage", + "**/apis", + "**/benchmark", + "**/conformance", + "**/docs", + "**/samples", + "**/scripts", + "**/protos", + "**/test", + "**/*.d.ts", + ".jsdoc.js", + "**/.jsdoc.js", + "karma.conf.js", + "webpack-tests.config.js", + "webpack.config.js" + ], + "exclude-after-remap": false, + "all": true +} diff --git a/packages/google-cloud-edgecontainer/.prettierignore b/packages/google-cloud-edgecontainer/.prettierignore new file mode 100644 index 00000000000..9340ad9b86d --- /dev/null +++ b/packages/google-cloud-edgecontainer/.prettierignore @@ -0,0 +1,6 @@ +**/node_modules +**/coverage +test/fixtures +build/ +docs/ +protos/ diff --git a/packages/google-cloud-edgecontainer/.prettierrc.js b/packages/google-cloud-edgecontainer/.prettierrc.js new file mode 100644 index 00000000000..1e6cec783e4 --- /dev/null +++ b/packages/google-cloud-edgecontainer/.prettierrc.js @@ -0,0 +1,17 @@ +// Copyright 2023 Google LLC +// +// Licensed under the Apache License, Version 2.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. + +module.exports = { + ...require('gts/.prettierrc.json') +} diff --git a/packages/google-cloud-edgecontainer/.repo-metadata.json b/packages/google-cloud-edgecontainer/.repo-metadata.json new file mode 100644 index 00000000000..466127cf635 --- /dev/null +++ b/packages/google-cloud-edgecontainer/.repo-metadata.json @@ -0,0 +1,17 @@ +{ + "name": "edgecontainer", + "name_pretty": "Distributed Cloud Edge Container API", + "product_documentation": "", + "client_documentation": "https://cloud.google.com/nodejs/docs/reference/edgecontainer/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/edgecontainer", + "api_id": "edgecontainer.googleapis.com", + "default_version": "v1", + "requires_billing": true, + "library_type": "GAPIC_AUTO", + "api_shortname": "edgecontainer" +} + diff --git a/packages/google-cloud-edgecontainer/CHANGELOG.md b/packages/google-cloud-edgecontainer/CHANGELOG.md new file mode 100644 index 00000000000..fd3a8e2b6c2 --- /dev/null +++ b/packages/google-cloud-edgecontainer/CHANGELOG.md @@ -0,0 +1,8 @@ +# Changelog + +## 0.1.0 (2023-09-14) + + +### Features + +* Add initial files for google.cloud.edgecontainer.v1 ([#4649](https://github.com/googleapis/google-cloud-node/issues/4649)) ([f826ea9](https://github.com/googleapis/google-cloud-node/commit/f826ea9f8e1325d48dd8b343b9af5e994e871108)) diff --git a/packages/google-cloud-edgecontainer/CODE_OF_CONDUCT.md b/packages/google-cloud-edgecontainer/CODE_OF_CONDUCT.md new file mode 100644 index 00000000000..2add2547a81 --- /dev/null +++ b/packages/google-cloud-edgecontainer/CODE_OF_CONDUCT.md @@ -0,0 +1,94 @@ + +# Code of Conduct + +## Our Pledge + +In the interest of fostering an open and welcoming environment, we as +contributors and maintainers pledge to making participation in our project and +our community a harassment-free experience for everyone, regardless of age, body +size, disability, ethnicity, gender identity and expression, level of +experience, education, socio-economic status, nationality, personal appearance, +race, religion, or sexual identity and orientation. + +## Our Standards + +Examples of behavior that contributes to creating a positive environment +include: + +* Using welcoming and inclusive language +* Being respectful of differing viewpoints and experiences +* Gracefully accepting constructive criticism +* Focusing on what is best for the community +* Showing empathy towards other community members + +Examples of unacceptable behavior by participants include: + +* The use of sexualized language or imagery and unwelcome sexual attention or + advances +* Trolling, insulting/derogatory comments, and personal or political attacks +* Public or private harassment +* Publishing others' private information, such as a physical or electronic + address, without explicit permission +* Other conduct which could reasonably be considered inappropriate in a + professional setting + +## Our Responsibilities + +Project maintainers are responsible for clarifying the standards of acceptable +behavior and are expected to take appropriate and fair corrective action in +response to any instances of unacceptable behavior. + +Project maintainers have the right and responsibility to remove, edit, or reject +comments, commits, code, wiki edits, issues, and other contributions that are +not aligned to this Code of Conduct, or to ban temporarily or permanently any +contributor for other behaviors that they deem inappropriate, threatening, +offensive, or harmful. + +## Scope + +This Code of Conduct applies both within project spaces and in public spaces +when an individual is representing the project or its community. Examples of +representing a project or community include using an official project e-mail +address, posting via an official social media account, or acting as an appointed +representative at an online or offline event. Representation of a project may be +further defined and clarified by project maintainers. + +This Code of Conduct also applies outside the project spaces when the Project +Steward has a reasonable belief that an individual's behavior may have a +negative impact on the project or its community. + +## Conflict Resolution + +We do not believe that all conflict is bad; healthy debate and disagreement +often yield positive results. However, it is never okay to be disrespectful or +to engage in behavior that violates the project’s code of conduct. + +If you see someone violating the code of conduct, you are encouraged to address +the behavior directly with those involved. Many issues can be resolved quickly +and easily, and this gives people more control over the outcome of their +dispute. If you are unable to resolve the matter for any reason, or if the +behavior is threatening or harassing, report it. We are dedicated to providing +an environment where participants feel welcome and safe. + +Reports should be directed to *googleapis-stewards@google.com*, the +Project Steward(s) for *Google Cloud Client Libraries*. It is the Project Steward’s duty to +receive and address reported violations of the code of conduct. They will then +work with a committee consisting of representatives from the Open Source +Programs Office and the Google Open Source Strategy team. If for any reason you +are uncomfortable reaching out to the Project Steward, please email +opensource@google.com. + +We will investigate every complaint, but you may not receive a direct response. +We will use our discretion in determining when and how to follow up on reported +incidents, which may range from not taking action to permanent expulsion from +the project and project-sponsored spaces. We will notify the accused of the +report and provide them an opportunity to discuss it before any action is taken. +The identity of the reporter will be omitted from the details of the report +supplied to the accused. In potentially harmful situations, such as ongoing +harassment or threats to anyone's safety, we may take action without notice. + +## Attribution + +This Code of Conduct is adapted from the Contributor Covenant, version 1.4, +available at +https://www.contributor-covenant.org/version/1/4/code-of-conduct.html \ No newline at end of file diff --git a/packages/google-cloud-edgecontainer/CONTRIBUTING.md b/packages/google-cloud-edgecontainer/CONTRIBUTING.md new file mode 100644 index 00000000000..73e868d2530 --- /dev/null +++ b/packages/google-cloud-edgecontainer/CONTRIBUTING.md @@ -0,0 +1,76 @@ +# How to become a contributor and submit your own code + +**Table of contents** + +* [Contributor License Agreements](#contributor-license-agreements) +* [Contributing a patch](#contributing-a-patch) +* [Running the tests](#running-the-tests) +* [Releasing the library](#releasing-the-library) + +## Contributor License Agreements + +We'd love to accept your sample apps and patches! Before we can take them, we +have to jump a couple of legal hurdles. + +Please fill out either the individual or corporate Contributor License Agreement +(CLA). + + * If you are an individual writing original source code and you're sure you + own the intellectual property, then you'll need to sign an [individual CLA](https://developers.google.com/open-source/cla/individual). + * If you work for a company that wants to allow you to contribute your work, + then you'll need to sign a [corporate CLA](https://developers.google.com/open-source/cla/corporate). + +Follow either of the two links above to access the appropriate CLA and +instructions for how to sign and return it. Once we receive it, we'll be able to +accept your pull requests. + +## Contributing A Patch + +1. Submit an issue describing your proposed change to the repo in question. +1. The repo owner will respond to your issue promptly. +1. If your proposed change is accepted, and you haven't already done so, sign a + Contributor License Agreement (see details above). +1. Fork the desired repo, develop and test your code changes. +1. Ensure that your code adheres to the existing style in the code to which + you are contributing. +1. Ensure that your code has an appropriate set of tests which all pass. +1. Title your pull request following [Conventional Commits](https://www.conventionalcommits.org/) styling. +1. Submit a pull request. + +### Before you begin + +1. [Select or create a Cloud Platform project][projects]. +1. [Enable billing for your project][billing]. +1. [Enable the Distributed Cloud Edge Container API API][enable_api]. +1. [Set up authentication with a service account][auth] so you can access the + API from your local workstation. + + +## Running the tests + +1. [Prepare your environment for Node.js setup][setup]. + +1. Install dependencies: + + npm install + +1. Run the tests: + + # Run unit tests. + npm test + + # Run sample integration tests. + npm run samples-test + + # Run all system tests. + npm run system-test + +1. Lint (and maybe fix) any changes: + + npm run fix + +[setup]: https://cloud.google.com/nodejs/docs/setup +[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=edgecontainer.googleapis.com +[auth]: https://cloud.google.com/docs/authentication/getting-started \ No newline at end of file diff --git a/packages/google-cloud-edgecontainer/LICENSE b/packages/google-cloud-edgecontainer/LICENSE new file mode 100644 index 00000000000..d6456956733 --- /dev/null +++ b/packages/google-cloud-edgecontainer/LICENSE @@ -0,0 +1,202 @@ + + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright [yyyy] [name of copyright owner] + + Licensed under the Apache License, Version 2.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. diff --git a/packages/google-cloud-edgecontainer/README.md b/packages/google-cloud-edgecontainer/README.md new file mode 100644 index 00000000000..2da1dd45ffa --- /dev/null +++ b/packages/google-cloud-edgecontainer/README.md @@ -0,0 +1,205 @@ +[//]: # "This README.md file is auto-generated, all changes to this file will be lost." +[//]: # "To regenerate it, use `python -m synthtool`." +Google Cloud Platform logo + +# [Distributed Cloud Edge Container API: Node.js Client](https://github.com/googleapis/google-cloud-node/tree/main/packages/google-cloud-edgecontainer) + +[![release level](https://img.shields.io/badge/release%20level-preview-yellow.svg?style=flat)](https://cloud.google.com/terms/launch-stages) +[![npm version](https://img.shields.io/npm/v/@google-cloud/edgecontainer.svg)](https://www.npmjs.org/package/@google-cloud/edgecontainer) + + + + +Distributed Cloud Edge Container API client for Node.js + + +A comprehensive list of changes in each version may be found in +[the CHANGELOG](https://github.com/googleapis/google-cloud-node/tree/main/packages/google-cloud-edgecontainer/CHANGELOG.md). + +* [Distributed Cloud Edge Container API Node.js Client API Reference][client-docs] + +* [github.com/googleapis/google-cloud-node/packages/google-cloud-edgecontainer](https://github.com/googleapis/google-cloud-node/tree/main/packages/google-cloud-edgecontainer) + +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) + * [Using the client library](#using-the-client-library) +* [Samples](#samples) +* [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 Distributed Cloud Edge Container API API][enable_api]. +1. [Set up authentication with a service account][auth] so you can access the + API from your local workstation. + +### Installing the client library + +```bash +npm install @google-cloud/edgecontainer +``` + + +### Using the client library + +```javascript +/** + * 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 location, which owns this collection of clusters. + */ +// const parent = 'abc123' +/** + * The maximum number of resources to list. + */ +// const pageSize = 1234 +/** + * A page token received from previous list request. + * A page token received from previous list request. + */ +// const pageToken = 'abc123' +/** + * Only resources matching this filter will be listed. + */ +// const filter = 'abc123' +/** + * Specifies the order in which resources will be listed. + */ +// const orderBy = 'abc123' + +// Imports the Edgecontainer library +const {EdgeContainerClient} = require('@google-cloud/edgecontainer').v1; + +// Instantiates a client +const edgecontainerClient = new EdgeContainerClient(); + +async function callListClusters() { + // Construct request + const request = { + parent, + }; + + // Run request + const iterable = await edgecontainerClient.listClustersAsync(request); + for await (const response of iterable) { + console.log(response); + } +} + +callListClusters(); + +``` + + + +## Samples + +Samples are in the [`samples/`](https://github.com/googleapis/google-cloud-node/tree/main/packages/google-cloud-edgecontainer/samples) directory. Each sample's `README.md` has instructions for running its sample. + +| Sample | Source Code | Try it | +| --------------------------- | --------------------------------- | ------ | +| Edge_container.create_cluster | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-edgecontainer/samples/generated/v1/edge_container.create_cluster.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-cloud-edgecontainer/samples/generated/v1/edge_container.create_cluster.js,packages/google-cloud-edgecontainer/samples/README.md) | +| Edge_container.create_node_pool | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-edgecontainer/samples/generated/v1/edge_container.create_node_pool.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-cloud-edgecontainer/samples/generated/v1/edge_container.create_node_pool.js,packages/google-cloud-edgecontainer/samples/README.md) | +| Edge_container.create_vpn_connection | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-edgecontainer/samples/generated/v1/edge_container.create_vpn_connection.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-cloud-edgecontainer/samples/generated/v1/edge_container.create_vpn_connection.js,packages/google-cloud-edgecontainer/samples/README.md) | +| Edge_container.delete_cluster | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-edgecontainer/samples/generated/v1/edge_container.delete_cluster.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-cloud-edgecontainer/samples/generated/v1/edge_container.delete_cluster.js,packages/google-cloud-edgecontainer/samples/README.md) | +| Edge_container.delete_node_pool | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-edgecontainer/samples/generated/v1/edge_container.delete_node_pool.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-cloud-edgecontainer/samples/generated/v1/edge_container.delete_node_pool.js,packages/google-cloud-edgecontainer/samples/README.md) | +| Edge_container.delete_vpn_connection | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-edgecontainer/samples/generated/v1/edge_container.delete_vpn_connection.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-cloud-edgecontainer/samples/generated/v1/edge_container.delete_vpn_connection.js,packages/google-cloud-edgecontainer/samples/README.md) | +| Edge_container.generate_access_token | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-edgecontainer/samples/generated/v1/edge_container.generate_access_token.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-cloud-edgecontainer/samples/generated/v1/edge_container.generate_access_token.js,packages/google-cloud-edgecontainer/samples/README.md) | +| Edge_container.get_cluster | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-edgecontainer/samples/generated/v1/edge_container.get_cluster.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-cloud-edgecontainer/samples/generated/v1/edge_container.get_cluster.js,packages/google-cloud-edgecontainer/samples/README.md) | +| Edge_container.get_machine | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-edgecontainer/samples/generated/v1/edge_container.get_machine.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-cloud-edgecontainer/samples/generated/v1/edge_container.get_machine.js,packages/google-cloud-edgecontainer/samples/README.md) | +| Edge_container.get_node_pool | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-edgecontainer/samples/generated/v1/edge_container.get_node_pool.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-cloud-edgecontainer/samples/generated/v1/edge_container.get_node_pool.js,packages/google-cloud-edgecontainer/samples/README.md) | +| Edge_container.get_vpn_connection | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-edgecontainer/samples/generated/v1/edge_container.get_vpn_connection.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-cloud-edgecontainer/samples/generated/v1/edge_container.get_vpn_connection.js,packages/google-cloud-edgecontainer/samples/README.md) | +| Edge_container.list_clusters | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-edgecontainer/samples/generated/v1/edge_container.list_clusters.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-cloud-edgecontainer/samples/generated/v1/edge_container.list_clusters.js,packages/google-cloud-edgecontainer/samples/README.md) | +| Edge_container.list_machines | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-edgecontainer/samples/generated/v1/edge_container.list_machines.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-cloud-edgecontainer/samples/generated/v1/edge_container.list_machines.js,packages/google-cloud-edgecontainer/samples/README.md) | +| Edge_container.list_node_pools | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-edgecontainer/samples/generated/v1/edge_container.list_node_pools.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-cloud-edgecontainer/samples/generated/v1/edge_container.list_node_pools.js,packages/google-cloud-edgecontainer/samples/README.md) | +| Edge_container.list_vpn_connections | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-edgecontainer/samples/generated/v1/edge_container.list_vpn_connections.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-cloud-edgecontainer/samples/generated/v1/edge_container.list_vpn_connections.js,packages/google-cloud-edgecontainer/samples/README.md) | +| Edge_container.update_cluster | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-edgecontainer/samples/generated/v1/edge_container.update_cluster.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-cloud-edgecontainer/samples/generated/v1/edge_container.update_cluster.js,packages/google-cloud-edgecontainer/samples/README.md) | +| Edge_container.update_node_pool | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-edgecontainer/samples/generated/v1/edge_container.update_node_pool.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-cloud-edgecontainer/samples/generated/v1/edge_container.update_node_pool.js,packages/google-cloud-edgecontainer/samples/README.md) | +| Quickstart | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-edgecontainer/samples/quickstart.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-cloud-edgecontainer/samples/quickstart.js,packages/google-cloud-edgecontainer/samples/README.md) | + + + +The [Distributed Cloud Edge Container API Node.js Client API Reference][client-docs] documentation +also contains 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/edgecontainer@legacy-8` installs client libraries +for versions compatible with Node.js 8. + +## Versioning + +This library follows [Semantic Versioning](http://semver.org/). + + + + + + + +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. + + +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](https://github.com/googleapis/google-cloud-node/blob/main/CONTRIBUTING.md). + +Please note that this `README.md`, the `samples/README.md`, +and a variety of configuration files in this repository (including `.nycrc` and `tsconfig.json`) +are generated from a central template. To edit one of these files, make an edit +to its templates in +[directory](https://github.com/googleapis/synthtool). + +## License + +Apache Version 2.0 + +See [LICENSE](https://github.com/googleapis/google-cloud-node/blob/main/LICENSE) + +[client-docs]: https://cloud.google.com/nodejs/docs/reference/edgecontainer/latest + +[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=edgecontainer.googleapis.com +[auth]: https://cloud.google.com/docs/authentication/getting-started diff --git a/packages/google-cloud-edgecontainer/package.json b/packages/google-cloud-edgecontainer/package.json new file mode 100644 index 00000000000..227dbc581b9 --- /dev/null +++ b/packages/google-cloud-edgecontainer/package.json @@ -0,0 +1,70 @@ +{ + "name": "@google-cloud/edgecontainer", + "version": "0.1.0", + "description": "Distributed Cloud Edge Container API client for Node.js", + "repository": { + "type": "git", + "url": "https://github.com/googleapis/google-cloud-node.git", + "directory": "packages/google-cloud-edgecontainer" + }, + "license": "Apache-2.0", + "author": "Google LLC", + "main": "build/src/index.js", + "files": [ + "build/src", + "build/protos" + ], + "homepage": "https://github.com/googleapis/google-cloud-node/tree/main/packages/google-cloud-edgecontainer", + "keywords": [ + "google apis client", + "google api client", + "google apis", + "google api", + "google", + "google cloud platform", + "google cloud", + "cloud", + "google edgecontainer", + "edgecontainer", + "Distributed Cloud Edge Container API" + ], + "scripts": { + "clean": "gts clean", + "compile": "tsc -p . && cp -r protos build/", + "compile-protos": "compileProtos src", + "docs": "jsdoc -c .jsdoc.js", + "predocs-test": "npm run docs", + "docs-test": "linkinator docs", + "fix": "gts fix", + "lint": "gts check", + "postpack": "minifyProtoJson", + "prepare": "npm run compile-protos && npm run compile", + "system-test": "c8 mocha build/system-test", + "test": "c8 mocha build/test", + "samples-test": "cd samples/ && npm link ../ && npm i && npm test", + "prelint": "cd samples; npm link ../; npm i" + }, + "dependencies": { + "google-gax": "^4.0.3" + }, + "devDependencies": { + "@types/mocha": "^9.0.0", + "@types/node": "^20.4.5", + "@types/sinon": "^10.0.0", + "c8": "^8.0.1", + "gapic-tools": "^0.1.8", + "gts": "^5.0.0", + "jsdoc": "^4.0.0", + "jsdoc-fresh": "^3.0.0", + "jsdoc-region-tag": "^3.0.0", + "linkinator": "4.1.2", + "long": "^5.2.3", + "mocha": "^9.2.2", + "pack-n-play": "^1.0.0-2", + "sinon": "^15.0.0", + "typescript": "^5.1.6" + }, + "engines": { + "node": ">=14.0.0" + } +} diff --git a/packages/google-cloud-edgecontainer/protos/google/cloud/edgecontainer/v1/resources.proto b/packages/google-cloud-edgecontainer/protos/google/cloud/edgecontainer/v1/resources.proto new file mode 100644 index 00000000000..35fb43d40af --- /dev/null +++ b/packages/google-cloud-edgecontainer/protos/google/cloud/edgecontainer/v1/resources.proto @@ -0,0 +1,441 @@ +// 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. + +syntax = "proto3"; + +package google.cloud.edgecontainer.v1; + +import "google/api/field_behavior.proto"; +import "google/api/resource.proto"; +import "google/protobuf/timestamp.proto"; +import "google/rpc/status.proto"; + +option go_package = "cloud.google.com/go/edgecontainer/apiv1/edgecontainerpb;edgecontainerpb"; +option java_multiple_files = true; +option java_outer_classname = "ResourcesProto"; +option java_package = "com.google.cloud.edgecontainer.v1"; +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}" +}; + +// Represents the accessibility state of a customer-managed KMS key used for +// CMEK integration. +enum KmsKeyState { + // Unspecified. + KMS_KEY_STATE_UNSPECIFIED = 0; + + // The key is available for use, and dependent resources should be accessible. + KMS_KEY_STATE_KEY_AVAILABLE = 1; + + // The key is unavailable for an unspecified reason. Dependent resources may + // be inaccessible. + KMS_KEY_STATE_KEY_UNAVAILABLE = 2; +} + +// A Google Distributed Cloud Edge Kubernetes cluster. +message Cluster { + option (google.api.resource) = { + type: "edgecontainer.googleapis.com/Cluster" + pattern: "projects/{project}/locations/{location}/clusters/{cluster}" + }; + + // Required. The resource name of the cluster. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "edgecontainer.googleapis.com/Cluster" + } + ]; + + // Output only. The time when the cluster was created. + google.protobuf.Timestamp create_time = 2 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The time when the cluster was last updated. + google.protobuf.Timestamp update_time = 3 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Labels associated with this resource. + map labels = 4; + + // Optional. Fleet configuration. + Fleet fleet = 11 [(google.api.field_behavior) = OPTIONAL]; + + // Required. Cluster-wide networking configuration. + ClusterNetworking networking = 7 [(google.api.field_behavior) = REQUIRED]; + + // Required. Immutable. RBAC policy that will be applied and managed by GEC. + Authorization authorization = 9 [ + (google.api.field_behavior) = REQUIRED, + (google.api.field_behavior) = IMMUTABLE + ]; + + // Optional. The default maximum number of pods per node used if a maximum value is not + // specified explicitly for a node pool in this cluster. If unspecified, the + // Kubernetes default value will be used. + int32 default_max_pods_per_node = 8 [(google.api.field_behavior) = OPTIONAL]; + + // Output only. The IP address of the Kubernetes API server. + string endpoint = 6 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The PEM-encoded public certificate of the cluster's CA. + string cluster_ca_certificate = 10 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Optional. Cluster-wide maintenance policy configuration. + MaintenancePolicy maintenance_policy = 12 [(google.api.field_behavior) = OPTIONAL]; +} + +// Cluster-wide networking configuration. +message ClusterNetworking { + // Required. All pods in the cluster are assigned an RFC1918 IPv4 address from these + // blocks. Only a single block is supported. This field cannot be changed + // after creation. + repeated string cluster_ipv4_cidr_blocks = 1 [(google.api.field_behavior) = REQUIRED]; + + // Required. All services in the cluster are assigned an RFC1918 IPv4 address from these + // blocks. Only a single block is supported. This field cannot be changed + // after creation. + repeated string services_ipv4_cidr_blocks = 2 [(google.api.field_behavior) = REQUIRED]; +} + +// Fleet related configuration. +// +// Fleets are a Google Cloud concept for logically organizing clusters, +// letting you use and manage multi-cluster capabilities and apply +// consistent policies across your systems. +message Fleet { + // Required. The name of the Fleet host project where this cluster will be registered. + // + // Project names are formatted as + // `projects/`. + string project = 1 [(google.api.field_behavior) = REQUIRED]; + + // Output only. The name of the managed Hub Membership resource associated to this cluster. + // + // Membership names are formatted as + // `projects//locations/global/membership/`. + string membership = 2 [(google.api.field_behavior) = OUTPUT_ONLY]; +} + +// A user principal for an RBAC policy. +message ClusterUser { + // Required. An active Google username. + string username = 1 [(google.api.field_behavior) = REQUIRED]; +} + +// RBAC policy that will be applied and managed by GEC. +message Authorization { + // Required. User that will be granted the cluster-admin role on the cluster, providing + // full access to the cluster. Currently, this is a singular field, but will + // be expanded to allow multiple admins in the future. + ClusterUser admin_users = 1 [(google.api.field_behavior) = REQUIRED]; +} + +// A set of Kubernetes nodes in a cluster with common configuration and +// specification. +message NodePool { + option (google.api.resource) = { + type: "edgecontainer.googleapis.com/NodePool" + pattern: "projects/{project}/locations/{location}/clusters/{cluster}/nodePools/{node_pool}" + }; + + // Configuration for CMEK support for edge machine local disk encryption. + message LocalDiskEncryption { + // Immutable. The Cloud KMS CryptoKey e.g. + // projects/{project}/locations/{location}/keyRings/{keyRing}/cryptoKeys/{cryptoKey} + // to use for protecting node local disks. If not specified, a + // Google-managed key will be used instead. + string kms_key = 1 [ + (google.api.field_behavior) = IMMUTABLE, + (google.api.resource_reference) = { + type: "cloudkms.googleapis.com/CryptoKey" + } + ]; + + // Output only. The Cloud KMS CryptoKeyVersion currently in use for protecting node local + // disks. Only applicable if kms_key is set. + string kms_key_active_version = 2 [ + (google.api.field_behavior) = OUTPUT_ONLY, + (google.api.resource_reference) = { + type: "cloudkms.googleapis.com/CryptoKeyVersion" + } + ]; + + // Output only. Availability of the Cloud KMS CryptoKey. If not `KEY_AVAILABLE`, then + // nodes may go offline as they cannot access their local data. This can be + // caused by a lack of permissions to use the key, or if the key is disabled + // or deleted. + KmsKeyState kms_key_state = 3 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Error status returned by Cloud KMS when using this key. This field may be + // populated only if `kms_key_state` is not `KMS_KEY_STATE_KEY_AVAILABLE`. + // If populated, this field contains the error status reported by Cloud KMS. + google.rpc.Status kms_status = 4 [(google.api.field_behavior) = OUTPUT_ONLY]; + } + + // Required. The resource name of the node pool. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "edgecontainer.googleapis.com/NodePool" + } + ]; + + // Output only. The time when the node pool was created. + google.protobuf.Timestamp create_time = 2 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The time when the node pool was last updated. + google.protobuf.Timestamp update_time = 3 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Labels associated with this resource. + map labels = 4; + + // Name of the Google Distributed Cloud Edge zone where this node pool will be + // created. For example: `us-central1-edge-customer-a`. + string node_location = 8; + + // Required. The number of nodes in the pool. + int32 node_count = 6 [(google.api.field_behavior) = REQUIRED]; + + // Only machines matching this filter will be allowed to join the node pool. + // The filtering language accepts strings like "name=", and is + // documented in more detail in [AIP-160](https://google.aip.dev/160). + string machine_filter = 7; + + // Optional. Local disk encryption options. This field is only used when enabling CMEK + // support. + LocalDiskEncryption local_disk_encryption = 9 [(google.api.field_behavior) = OPTIONAL]; +} + +// A Google Distributed Cloud Edge machine capable of acting as a Kubernetes +// node. +message Machine { + option (google.api.resource) = { + type: "edgecontainer.googleapis.com/Machine" + pattern: "projects/{project}/locations/{location}/machines/{machine}" + }; + + // Required. The resource name of the machine. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "edgecontainer.googleapis.com/Machine" + } + ]; + + // Output only. The time when the node pool was created. + google.protobuf.Timestamp create_time = 2 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The time when the node pool was last updated. + google.protobuf.Timestamp update_time = 3 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Labels associated with this resource. + map labels = 4; + + // Canonical resource name of the node that this machine is responsible for + // hosting e.g. + // projects/{project}/locations/{location}/clusters/{cluster_id}/nodePools/{pool_id}/{node}, + // Or empty if the machine is not assigned to assume the role of a node. + string hosted_node = 5; + + // The Google Distributed Cloud Edge zone of this machine. + string zone = 6; + + // Output only. Whether the machine is disabled. If disabled, the machine is unable to + // enter service. + bool disabled = 8 [(google.api.field_behavior) = OUTPUT_ONLY]; +} + +// A VPN connection . +message VpnConnection { + option (google.api.resource) = { + type: "edgecontainer.googleapis.com/VpnConnection" + pattern: "projects/{project}/locations/{location}/vpnConnections/{vpn_connection}" + }; + + // Project detail of the VPC network. + message VpcProject { + // The project of the VPC to connect to. If not specified, it is the same as + // the cluster project. + string project_id = 1; + + // Optional. The service account in the VPC project configured by user. It is used to + // create/delete Cloud Router and Cloud HA VPNs for VPN connection. If this + // SA is changed during/after a VPN connection is created, you need to + // remove the Cloud Router and Cloud VPN resources in |project_id|. + // It is in the form of + // service-{project_number}@gcp-sa-edgecontainer.iam.gserviceaccount.com. + string service_account = 2 [(google.api.field_behavior) = OPTIONAL]; + } + + // The created connection details. + message Details { + // The Cloud Router info. + message CloudRouter { + // The created Cloud Router name. + string name = 1; + } + + // The Cloud VPN info. + message CloudVpn { + // The created Cloud VPN gateway name. + string gateway = 1; + } + + // The current connection state. + enum State { + // Unknown. + STATE_UNSPECIFIED = 0; + + // Connected. + STATE_CONNECTED = 1; + + // Still connecting. + STATE_CONNECTING = 2; + + // Error occurred. + STATE_ERROR = 3; + } + + // The state of this connection. + State state = 1; + + // The error message. This is only populated when state=ERROR. + string error = 2; + + // The Cloud Router info. + CloudRouter cloud_router = 3; + + // Each connection has multiple Cloud VPN gateways. + repeated CloudVpn cloud_vpns = 4; + } + + // Routing mode. + enum BgpRoutingMode { + // Unknown. + BGP_ROUTING_MODE_UNSPECIFIED = 0; + + // Regional mode. + REGIONAL = 1; + + // Global mode. + GLOBAL = 2; + } + + // Required. The resource name of VPN connection + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "edgecontainer.googleapis.com/VpnConnection" + } + ]; + + // Output only. The time when the VPN connection was created. + google.protobuf.Timestamp create_time = 2 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The time when the VPN connection was last updated. + google.protobuf.Timestamp update_time = 3 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Labels associated with this resource. + map labels = 4; + + // NAT gateway IP, or WAN IP address. If a customer has multiple NAT IPs, the + // customer needs to configure NAT such that only one external IP maps to the + // GMEC Anthos cluster. This is empty if NAT is not used. + string nat_gateway_ip = 5; + + // Dynamic routing mode of the VPC network, `regional` or `global`. + BgpRoutingMode bgp_routing_mode = 6 [deprecated = true]; + + // The canonical Cluster name to connect to. It is in the form of + // projects/{project}/locations/{location}/clusters/{cluster}. + string cluster = 7 [(google.api.resource_reference) = { + type: "edgecontainer.googleapis.com/Cluster" + }]; + + // The network ID of VPC to connect to. + string vpc = 8; + + // Optional. Project detail of the VPC network. Required if VPC is in a different + // project than the cluster project. + VpcProject vpc_project = 11 [(google.api.field_behavior) = OPTIONAL]; + + // Whether this VPN connection has HA enabled on cluster side. If enabled, + // when creating VPN connection we will attempt to use 2 ANG floating IPs. + bool enable_high_availability = 9; + + // Output only. The created connection details. + Details details = 10 [(google.api.field_behavior) = OUTPUT_ONLY]; +} + +// Metadata for a given [google.cloud.location.Location][google.cloud.location.Location]. +message LocationMetadata { + // The set of available Google Distributed Cloud Edge zones in the location. + // The map is keyed by the lowercase ID of each zone. + map available_zones = 1; +} + +// A Google Distributed Cloud Edge zone where edge machines are located. +message ZoneMetadata { + // Quota for resources in this zone. + repeated Quota quota = 1; +} + +// Represents quota for Edge Container resources. +message Quota { + // Name of the quota metric. + string metric = 1; + + // Quota limit for this metric. + double limit = 2; + + // Current usage of this metric. + double usage = 3; +} + +// Maintenance policy configuration. +message MaintenancePolicy { + // Specifies the maintenance window in which maintenance may be performed. + MaintenanceWindow window = 1; +} + +// Maintenance window configuration +message MaintenanceWindow { + // Configuration of a recurring maintenance window. + RecurringTimeWindow recurring_window = 1; +} + +// Represents an arbitrary window of time that recurs. +message RecurringTimeWindow { + // The window of the first recurrence. + TimeWindow window = 1; + + // An RRULE (https://tools.ietf.org/html/rfc5545#section-3.8.5.3) for how + // this window recurs. They go on for the span of time between the start and + // end time. + string recurrence = 2; +} + +// Represents an arbitrary window of time. +message TimeWindow { + // The time that the window first starts. + google.protobuf.Timestamp start_time = 1; + + // The time that the window ends. The end time must take place after the + // start time. + google.protobuf.Timestamp end_time = 2; +} diff --git a/packages/google-cloud-edgecontainer/protos/google/cloud/edgecontainer/v1/service.proto b/packages/google-cloud-edgecontainer/protos/google/cloud/edgecontainer/v1/service.proto new file mode 100644 index 00000000000..5ff6020a19a --- /dev/null +++ b/packages/google-cloud-edgecontainer/protos/google/cloud/edgecontainer/v1/service.proto @@ -0,0 +1,593 @@ +// 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. + +syntax = "proto3"; + +package google.cloud.edgecontainer.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/edgecontainer/v1/resources.proto"; +import "google/longrunning/operations.proto"; +import "google/protobuf/field_mask.proto"; +import "google/protobuf/timestamp.proto"; + +option go_package = "cloud.google.com/go/edgecontainer/apiv1/edgecontainerpb;edgecontainerpb"; +option java_multiple_files = true; +option java_outer_classname = "ServiceProto"; +option java_package = "com.google.cloud.edgecontainer.v1"; + +// EdgeContainer API provides management of Kubernetes Clusters on Google Edge +// Cloud deployments. +service EdgeContainer { + option (google.api.default_host) = "edgecontainer.googleapis.com"; + option (google.api.oauth_scopes) = "https://www.googleapis.com/auth/cloud-platform"; + + // Lists Clusters in a given project and location. + rpc ListClusters(ListClustersRequest) returns (ListClustersResponse) { + option (google.api.http) = { + get: "/v1/{parent=projects/*/locations/*}/clusters" + }; + option (google.api.method_signature) = "parent"; + } + + // Gets details of a single Cluster. + rpc GetCluster(GetClusterRequest) returns (Cluster) { + option (google.api.http) = { + get: "/v1/{name=projects/*/locations/*/clusters/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Creates a new Cluster in a given project and location. + rpc CreateCluster(CreateClusterRequest) returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v1/{parent=projects/*/locations/*}/clusters" + body: "cluster" + }; + option (google.api.method_signature) = "parent,cluster,cluster_id"; + option (google.longrunning.operation_info) = { + response_type: "Cluster" + metadata_type: "OperationMetadata" + }; + } + + // Updates the parameters of a single Cluster. + rpc UpdateCluster(UpdateClusterRequest) returns (google.longrunning.Operation) { + option (google.api.http) = { + patch: "/v1/{cluster.name=projects/*/locations/*/clusters/*}" + body: "cluster" + }; + option (google.api.method_signature) = "cluster,update_mask"; + option (google.longrunning.operation_info) = { + response_type: "Cluster" + metadata_type: "OperationMetadata" + }; + } + + // Deletes a single Cluster. + rpc DeleteCluster(DeleteClusterRequest) returns (google.longrunning.Operation) { + option (google.api.http) = { + delete: "/v1/{name=projects/*/locations/*/clusters/*}" + }; + option (google.api.method_signature) = "name"; + option (google.longrunning.operation_info) = { + response_type: "google.protobuf.Empty" + metadata_type: "OperationMetadata" + }; + } + + // Generates an access token for a Cluster. + rpc GenerateAccessToken(GenerateAccessTokenRequest) returns (GenerateAccessTokenResponse) { + option (google.api.http) = { + get: "/v1/{cluster=projects/*/locations/*/clusters/*}:generateAccessToken" + }; + option (google.api.method_signature) = "cluster"; + } + + // Lists NodePools in a given project and location. + rpc ListNodePools(ListNodePoolsRequest) returns (ListNodePoolsResponse) { + option (google.api.http) = { + get: "/v1/{parent=projects/*/locations/*/clusters/*}/nodePools" + }; + option (google.api.method_signature) = "parent"; + } + + // Gets details of a single NodePool. + rpc GetNodePool(GetNodePoolRequest) returns (NodePool) { + option (google.api.http) = { + get: "/v1/{name=projects/*/locations/*/clusters/*/nodePools/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Creates a new NodePool in a given project and location. + rpc CreateNodePool(CreateNodePoolRequest) returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v1/{parent=projects/*/locations/*/clusters/*}/nodePools" + body: "node_pool" + }; + option (google.api.method_signature) = "parent,node_pool,node_pool_id"; + option (google.longrunning.operation_info) = { + response_type: "NodePool" + metadata_type: "OperationMetadata" + }; + } + + // Updates the parameters of a single NodePool. + rpc UpdateNodePool(UpdateNodePoolRequest) returns (google.longrunning.Operation) { + option (google.api.http) = { + patch: "/v1/{node_pool.name=projects/*/locations/*/clusters/*/nodePools/*}" + body: "node_pool" + }; + option (google.api.method_signature) = "node_pool,update_mask"; + option (google.longrunning.operation_info) = { + response_type: "NodePool" + metadata_type: "OperationMetadata" + }; + } + + // Deletes a single NodePool. + rpc DeleteNodePool(DeleteNodePoolRequest) returns (google.longrunning.Operation) { + option (google.api.http) = { + delete: "/v1/{name=projects/*/locations/*/clusters/*/nodePools/*}" + }; + option (google.api.method_signature) = "name"; + option (google.longrunning.operation_info) = { + response_type: "google.protobuf.Empty" + metadata_type: "OperationMetadata" + }; + } + + // Lists Machines in a given project and location. + rpc ListMachines(ListMachinesRequest) returns (ListMachinesResponse) { + option (google.api.http) = { + get: "/v1/{parent=projects/*/locations/*}/machines" + }; + option (google.api.method_signature) = "parent"; + } + + // Gets details of a single Machine. + rpc GetMachine(GetMachineRequest) returns (Machine) { + option (google.api.http) = { + get: "/v1/{name=projects/*/locations/*/machines/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Lists VPN connections in a given project and location. + rpc ListVpnConnections(ListVpnConnectionsRequest) returns (ListVpnConnectionsResponse) { + option (google.api.http) = { + get: "/v1/{parent=projects/*/locations/*}/vpnConnections" + }; + option (google.api.method_signature) = "parent"; + } + + // Gets details of a single VPN connection. + rpc GetVpnConnection(GetVpnConnectionRequest) returns (VpnConnection) { + option (google.api.http) = { + get: "/v1/{name=projects/*/locations/*/vpnConnections/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Creates a new VPN connection in a given project and location. + rpc CreateVpnConnection(CreateVpnConnectionRequest) returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v1/{parent=projects/*/locations/*}/vpnConnections" + body: "vpn_connection" + }; + option (google.api.method_signature) = "parent,vpn_connection,vpn_connection_id"; + option (google.longrunning.operation_info) = { + response_type: "VpnConnection" + metadata_type: "OperationMetadata" + }; + } + + // Deletes a single VPN connection. + rpc DeleteVpnConnection(DeleteVpnConnectionRequest) returns (google.longrunning.Operation) { + option (google.api.http) = { + delete: "/v1/{name=projects/*/locations/*/vpnConnections/*}" + }; + option (google.api.method_signature) = "name"; + option (google.longrunning.operation_info) = { + response_type: "google.protobuf.Empty" + metadata_type: "OperationMetadata" + }; + } +} + +// Long-running operation metadata for Edge Container API methods. +message OperationMetadata { + // The time the operation was created. + google.protobuf.Timestamp create_time = 1; + + // The time the operation finished running. + google.protobuf.Timestamp end_time = 2; + + // Server-defined resource path for the target of the operation. + string target = 3; + + // The verb executed by the operation. + string verb = 4; + + // Human-readable status of the operation, if any. + string status_message = 5; + + // Identifies whether the user has requested cancellation of the operation. + // Operations that have successfully been cancelled have [Operation.error][] + // value with a [google.rpc.Status.code][google.rpc.Status.code] of 1, corresponding to + // `Code.CANCELLED`. + bool requested_cancellation = 6; + + // API version used to start the operation. + string api_version = 7; +} + +// Lists clusters in a location. +message ListClustersRequest { + // Required. The parent location, which owns this collection of clusters. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "edgecontainer.googleapis.com/Cluster" + } + ]; + + // The maximum number of resources to list. + int32 page_size = 2; + + // A page token received from previous list request. + // A page token received from previous list request. + string page_token = 3; + + // Only resources matching this filter will be listed. + string filter = 4; + + // Specifies the order in which resources will be listed. + string order_by = 5; +} + +// List of clusters in a location. +message ListClustersResponse { + // Clusters in the location. + repeated Cluster clusters = 1; + + // A token to retrieve next page of results. + string next_page_token = 2; + + // Locations that could not be reached. + repeated string unreachable = 3; +} + +// Gets a cluster. +message GetClusterRequest { + // Required. The resource name of the cluster. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "edgecontainer.googleapis.com/Cluster" + } + ]; +} + +// Creates a cluster. +message CreateClusterRequest { + // Required. The parent location where this cluster will be created. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "edgecontainer.googleapis.com/Cluster" + } + ]; + + // Required. A client-specified unique identifier for the cluster. + string cluster_id = 2 [(google.api.field_behavior) = REQUIRED]; + + // Required. The cluster to create. + Cluster cluster = 3 [(google.api.field_behavior) = REQUIRED]; + + // A unique identifier for this request. Restricted to 36 ASCII characters. A + // random UUID is recommended. This request is only idempotent if + // `request_id` is provided. + string request_id = 4; +} + +// Updates a cluster. +message UpdateClusterRequest { + // Field mask is used to specify the fields to be overwritten in the + // Cluster resource by the update. + // The fields specified in the update_mask are relative to the resource, not + // the full request. A field will be overwritten if it is in the mask. If the + // user does not provide a mask then all fields will be overwritten. + google.protobuf.FieldMask update_mask = 1; + + // The updated cluster. + Cluster cluster = 2; + + // A unique identifier for this request. Restricted to 36 ASCII characters. + // A random UUID is recommended. + // This request is only idempotent if `request_id` is provided. + string request_id = 3; +} + +// Deletes a cluster. +message DeleteClusterRequest { + // Required. The resource name of the cluster. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "edgecontainer.googleapis.com/Cluster" + } + ]; + + // A unique identifier for this request. Restricted to 36 ASCII characters. A + // random UUID is recommended. This request is only idempotent if + // `request_id` is provided. + string request_id = 2; +} + +// Generates an access token for a cluster. +message GenerateAccessTokenRequest { + // Required. The resource name of the cluster. + string cluster = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "edgecontainer.googleapis.com/Cluster" + } + ]; +} + +// An access token for a cluster. +message GenerateAccessTokenResponse { + // Output only. Access token to authenticate to k8s api-server. + string access_token = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Timestamp at which the token will expire. + google.protobuf.Timestamp expire_time = 2 [(google.api.field_behavior) = OUTPUT_ONLY]; +} + +// Lists node pools in a cluster. +message ListNodePoolsRequest { + // Required. The parent cluster, which owns this collection of node pools. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "edgecontainer.googleapis.com/NodePool" + } + ]; + + // The maximum number of resources to list. + int32 page_size = 2; + + // A page token received from previous list request. + string page_token = 3; + + // Only resources matching this filter will be listed. + string filter = 4; + + // Specifies the order in which resources will be listed. + string order_by = 5; +} + +// List of node pools in a cluster. +message ListNodePoolsResponse { + // Node pools in the cluster. + repeated NodePool node_pools = 1; + + // A token to retrieve next page of results. + string next_page_token = 2; + + // Locations that could not be reached. + repeated string unreachable = 3; +} + +// Gets a node pool. +message GetNodePoolRequest { + // Required. The resource name of the node pool. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "edgecontainer.googleapis.com/NodePool" + } + ]; +} + +// Creates a node pool. +message CreateNodePoolRequest { + // Required. The parent cluster where this node pool will be created. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "edgecontainer.googleapis.com/NodePool" + } + ]; + + // Required. A client-specified unique identifier for the node pool. + string node_pool_id = 2 [(google.api.field_behavior) = REQUIRED]; + + // Required. The node pool to create. + NodePool node_pool = 3 [(google.api.field_behavior) = REQUIRED]; + + // A unique identifier for this request. Restricted to 36 ASCII characters. A + // random UUID is recommended. This request is only idempotent if + // `request_id` is provided. + string request_id = 4; +} + +// Updates a node pool. +message UpdateNodePoolRequest { + // Field mask is used to specify the fields to be overwritten in the + // NodePool resource by the update. + // The fields specified in the update_mask are relative to the resource, not + // the full request. A field will be overwritten if it is in the mask. If the + // user does not provide a mask then all fields will be overwritten. + google.protobuf.FieldMask update_mask = 1; + + // The updated node pool. + NodePool node_pool = 2; + + // A unique identifier for this request. Restricted to 36 ASCII characters. A + // random UUID is recommended. This request is only idempotent if + // `request_id` is provided. + string request_id = 3; +} + +// Deletes a node pool. +message DeleteNodePoolRequest { + // Required. The resource name of the node pool. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "edgecontainer.googleapis.com/NodePool" + } + ]; + + // A unique identifier for this request. Restricted to 36 ASCII characters. A + // random UUID is recommended. This request is only idempotent if + // `request_id` is provided. + string request_id = 2; +} + +// Lists machines in a site. +message ListMachinesRequest { + // Required. The parent site, which owns this collection of machines. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "edgecontainer.googleapis.com/Machine" + } + ]; + + // The maximum number of resources to list. + int32 page_size = 2; + + // A page token received from previous list request. + string page_token = 3; + + // Only resources matching this filter will be listed. + string filter = 4; + + // Specifies the order in which resources will be listed. + string order_by = 5; +} + +// List of machines in a site. +message ListMachinesResponse { + // Machines in the site. + repeated Machine machines = 1; + + // A token to retrieve next page of results. + string next_page_token = 2; + + // Locations that could not be reached. + repeated string unreachable = 3; +} + +// Gets a machine. +message GetMachineRequest { + // Required. The resource name of the machine. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "edgecontainer.googleapis.com/Machine" + } + ]; +} + +// Lists VPN connections. +message ListVpnConnectionsRequest { + // Required. The parent location, which owns this collection of VPN connections. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "edgecontainer.googleapis.com/VpnConnection" + } + ]; + + // The maximum number of resources to list. + int32 page_size = 2; + + // A page token received from previous list request. + string page_token = 3; + + // Only resources matching this filter will be listed. + string filter = 4; + + // Specifies the order in which resources will be listed. + string order_by = 5; +} + +// List of VPN connections in a location. +message ListVpnConnectionsResponse { + // VpnConnections in the location. + repeated VpnConnection vpn_connections = 1; + + // A token to retrieve next page of results. + string next_page_token = 2; + + // Locations that could not be reached. + repeated string unreachable = 3; +} + +// Gets a VPN connection. +message GetVpnConnectionRequest { + // Required. The resource name of the vpn connection. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "edgecontainer.googleapis.com/VpnConnection" + } + ]; +} + +// Creates a VPN connection. +message CreateVpnConnectionRequest { + // Required. The parent location where this vpn connection will be created. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "edgecontainer.googleapis.com/VpnConnection" + } + ]; + + // Required. The VPN connection identifier. + string vpn_connection_id = 2 [(google.api.field_behavior) = REQUIRED]; + + // Required. The VPN connection to create. + VpnConnection vpn_connection = 3 [(google.api.field_behavior) = REQUIRED]; + + // A unique identifier for this request. Restricted to 36 ASCII characters. A + // random UUID is recommended. This request is only idempotent if + // `request_id` is provided. + string request_id = 4; +} + +// Deletes a vpn connection. +message DeleteVpnConnectionRequest { + // Required. The resource name of the vpn connection. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "edgecontainer.googleapis.com/VpnConnection" + } + ]; + + // A unique identifier for this request. Restricted to 36 ASCII characters. A + // random UUID is recommended. This request is only idempotent if + // `request_id` is provided. + string request_id = 2; +} diff --git a/packages/google-cloud-edgecontainer/protos/protos.d.ts b/packages/google-cloud-edgecontainer/protos/protos.d.ts new file mode 100644 index 00000000000..0fc5d43277a --- /dev/null +++ b/packages/google-cloud-edgecontainer/protos/protos.d.ts @@ -0,0 +1,12225 @@ +// Copyright 2023 Google LLC +// +// Licensed under the Apache License, Version 2.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 edgecontainer. */ + namespace edgecontainer { + + /** Namespace v1. */ + namespace v1 { + + /** KmsKeyState enum. */ + enum KmsKeyState { + KMS_KEY_STATE_UNSPECIFIED = 0, + KMS_KEY_STATE_KEY_AVAILABLE = 1, + KMS_KEY_STATE_KEY_UNAVAILABLE = 2 + } + + /** Properties of a Cluster. */ + interface ICluster { + + /** Cluster name */ + name?: (string|null); + + /** Cluster createTime */ + createTime?: (google.protobuf.ITimestamp|null); + + /** Cluster updateTime */ + updateTime?: (google.protobuf.ITimestamp|null); + + /** Cluster labels */ + labels?: ({ [k: string]: string }|null); + + /** Cluster fleet */ + fleet?: (google.cloud.edgecontainer.v1.IFleet|null); + + /** Cluster networking */ + networking?: (google.cloud.edgecontainer.v1.IClusterNetworking|null); + + /** Cluster authorization */ + authorization?: (google.cloud.edgecontainer.v1.IAuthorization|null); + + /** Cluster defaultMaxPodsPerNode */ + defaultMaxPodsPerNode?: (number|null); + + /** Cluster endpoint */ + endpoint?: (string|null); + + /** Cluster clusterCaCertificate */ + clusterCaCertificate?: (string|null); + + /** Cluster maintenancePolicy */ + maintenancePolicy?: (google.cloud.edgecontainer.v1.IMaintenancePolicy|null); + } + + /** Represents a Cluster. */ + class Cluster implements ICluster { + + /** + * Constructs a new Cluster. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.edgecontainer.v1.ICluster); + + /** Cluster name. */ + public name: string; + + /** Cluster createTime. */ + public createTime?: (google.protobuf.ITimestamp|null); + + /** Cluster updateTime. */ + public updateTime?: (google.protobuf.ITimestamp|null); + + /** Cluster labels. */ + public labels: { [k: string]: string }; + + /** Cluster fleet. */ + public fleet?: (google.cloud.edgecontainer.v1.IFleet|null); + + /** Cluster networking. */ + public networking?: (google.cloud.edgecontainer.v1.IClusterNetworking|null); + + /** Cluster authorization. */ + public authorization?: (google.cloud.edgecontainer.v1.IAuthorization|null); + + /** Cluster defaultMaxPodsPerNode. */ + public defaultMaxPodsPerNode: number; + + /** Cluster endpoint. */ + public endpoint: string; + + /** Cluster clusterCaCertificate. */ + public clusterCaCertificate: string; + + /** Cluster maintenancePolicy. */ + public maintenancePolicy?: (google.cloud.edgecontainer.v1.IMaintenancePolicy|null); + + /** + * Creates a new Cluster instance using the specified properties. + * @param [properties] Properties to set + * @returns Cluster instance + */ + public static create(properties?: google.cloud.edgecontainer.v1.ICluster): google.cloud.edgecontainer.v1.Cluster; + + /** + * Encodes the specified Cluster message. Does not implicitly {@link google.cloud.edgecontainer.v1.Cluster.verify|verify} messages. + * @param message Cluster message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.edgecontainer.v1.ICluster, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Cluster message, length delimited. Does not implicitly {@link google.cloud.edgecontainer.v1.Cluster.verify|verify} messages. + * @param message Cluster message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.edgecontainer.v1.ICluster, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Cluster message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Cluster + * @throws {Error} If the payload is not 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.edgecontainer.v1.Cluster; + + /** + * Decodes a Cluster message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Cluster + * @throws {Error} If the payload 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.edgecontainer.v1.Cluster; + + /** + * Verifies a Cluster message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Cluster message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Cluster + */ + public static fromObject(object: { [k: string]: any }): google.cloud.edgecontainer.v1.Cluster; + + /** + * Creates a plain object from a Cluster message. Also converts values to other types if specified. + * @param message Cluster + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.edgecontainer.v1.Cluster, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Cluster to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Cluster + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ClusterNetworking. */ + interface IClusterNetworking { + + /** ClusterNetworking clusterIpv4CidrBlocks */ + clusterIpv4CidrBlocks?: (string[]|null); + + /** ClusterNetworking servicesIpv4CidrBlocks */ + servicesIpv4CidrBlocks?: (string[]|null); + } + + /** Represents a ClusterNetworking. */ + class ClusterNetworking implements IClusterNetworking { + + /** + * Constructs a new ClusterNetworking. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.edgecontainer.v1.IClusterNetworking); + + /** ClusterNetworking clusterIpv4CidrBlocks. */ + public clusterIpv4CidrBlocks: string[]; + + /** ClusterNetworking servicesIpv4CidrBlocks. */ + public servicesIpv4CidrBlocks: string[]; + + /** + * Creates a new ClusterNetworking instance using the specified properties. + * @param [properties] Properties to set + * @returns ClusterNetworking instance + */ + public static create(properties?: google.cloud.edgecontainer.v1.IClusterNetworking): google.cloud.edgecontainer.v1.ClusterNetworking; + + /** + * Encodes the specified ClusterNetworking message. Does not implicitly {@link google.cloud.edgecontainer.v1.ClusterNetworking.verify|verify} messages. + * @param message ClusterNetworking message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.edgecontainer.v1.IClusterNetworking, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ClusterNetworking message, length delimited. Does not implicitly {@link google.cloud.edgecontainer.v1.ClusterNetworking.verify|verify} messages. + * @param message ClusterNetworking message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.edgecontainer.v1.IClusterNetworking, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ClusterNetworking message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ClusterNetworking + * @throws {Error} If the payload is not 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.edgecontainer.v1.ClusterNetworking; + + /** + * Decodes a ClusterNetworking message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ClusterNetworking + * @throws {Error} If the payload 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.edgecontainer.v1.ClusterNetworking; + + /** + * Verifies a ClusterNetworking message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ClusterNetworking message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ClusterNetworking + */ + public static fromObject(object: { [k: string]: any }): google.cloud.edgecontainer.v1.ClusterNetworking; + + /** + * Creates a plain object from a ClusterNetworking message. Also converts values to other types if specified. + * @param message ClusterNetworking + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.edgecontainer.v1.ClusterNetworking, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ClusterNetworking to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ClusterNetworking + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Fleet. */ + interface IFleet { + + /** Fleet project */ + project?: (string|null); + + /** Fleet membership */ + membership?: (string|null); + } + + /** Represents a Fleet. */ + class Fleet implements IFleet { + + /** + * Constructs a new Fleet. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.edgecontainer.v1.IFleet); + + /** Fleet project. */ + public project: string; + + /** Fleet membership. */ + public membership: string; + + /** + * Creates a new Fleet instance using the specified properties. + * @param [properties] Properties to set + * @returns Fleet instance + */ + public static create(properties?: google.cloud.edgecontainer.v1.IFleet): google.cloud.edgecontainer.v1.Fleet; + + /** + * Encodes the specified Fleet message. Does not implicitly {@link google.cloud.edgecontainer.v1.Fleet.verify|verify} messages. + * @param message Fleet message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.edgecontainer.v1.IFleet, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Fleet message, length delimited. Does not implicitly {@link google.cloud.edgecontainer.v1.Fleet.verify|verify} messages. + * @param message Fleet message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.edgecontainer.v1.IFleet, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Fleet message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Fleet + * @throws {Error} If the payload is not 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.edgecontainer.v1.Fleet; + + /** + * Decodes a Fleet message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Fleet + * @throws {Error} If the payload 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.edgecontainer.v1.Fleet; + + /** + * Verifies a Fleet message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Fleet message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Fleet + */ + public static fromObject(object: { [k: string]: any }): google.cloud.edgecontainer.v1.Fleet; + + /** + * Creates a plain object from a Fleet message. Also converts values to other types if specified. + * @param message Fleet + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.edgecontainer.v1.Fleet, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Fleet to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Fleet + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ClusterUser. */ + interface IClusterUser { + + /** ClusterUser username */ + username?: (string|null); + } + + /** Represents a ClusterUser. */ + class ClusterUser implements IClusterUser { + + /** + * Constructs a new ClusterUser. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.edgecontainer.v1.IClusterUser); + + /** ClusterUser username. */ + public username: string; + + /** + * Creates a new ClusterUser instance using the specified properties. + * @param [properties] Properties to set + * @returns ClusterUser instance + */ + public static create(properties?: google.cloud.edgecontainer.v1.IClusterUser): google.cloud.edgecontainer.v1.ClusterUser; + + /** + * Encodes the specified ClusterUser message. Does not implicitly {@link google.cloud.edgecontainer.v1.ClusterUser.verify|verify} messages. + * @param message ClusterUser message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.edgecontainer.v1.IClusterUser, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ClusterUser message, length delimited. Does not implicitly {@link google.cloud.edgecontainer.v1.ClusterUser.verify|verify} messages. + * @param message ClusterUser message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.edgecontainer.v1.IClusterUser, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ClusterUser message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ClusterUser + * @throws {Error} If the payload is not 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.edgecontainer.v1.ClusterUser; + + /** + * Decodes a ClusterUser message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ClusterUser + * @throws {Error} If the payload 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.edgecontainer.v1.ClusterUser; + + /** + * Verifies a ClusterUser message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ClusterUser message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ClusterUser + */ + public static fromObject(object: { [k: string]: any }): google.cloud.edgecontainer.v1.ClusterUser; + + /** + * Creates a plain object from a ClusterUser message. Also converts values to other types if specified. + * @param message ClusterUser + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.edgecontainer.v1.ClusterUser, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ClusterUser to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ClusterUser + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an Authorization. */ + interface IAuthorization { + + /** Authorization adminUsers */ + adminUsers?: (google.cloud.edgecontainer.v1.IClusterUser|null); + } + + /** Represents an Authorization. */ + class Authorization implements IAuthorization { + + /** + * Constructs a new Authorization. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.edgecontainer.v1.IAuthorization); + + /** Authorization adminUsers. */ + public adminUsers?: (google.cloud.edgecontainer.v1.IClusterUser|null); + + /** + * Creates a new Authorization instance using the specified properties. + * @param [properties] Properties to set + * @returns Authorization instance + */ + public static create(properties?: google.cloud.edgecontainer.v1.IAuthorization): google.cloud.edgecontainer.v1.Authorization; + + /** + * Encodes the specified Authorization message. Does not implicitly {@link google.cloud.edgecontainer.v1.Authorization.verify|verify} messages. + * @param message Authorization message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.edgecontainer.v1.IAuthorization, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Authorization message, length delimited. Does not implicitly {@link google.cloud.edgecontainer.v1.Authorization.verify|verify} messages. + * @param message Authorization message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.edgecontainer.v1.IAuthorization, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an Authorization message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Authorization + * @throws {Error} If the payload is not 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.edgecontainer.v1.Authorization; + + /** + * Decodes an Authorization message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Authorization + * @throws {Error} If the payload 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.edgecontainer.v1.Authorization; + + /** + * Verifies an Authorization message. + * @param message Plain 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 Authorization message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Authorization + */ + public static fromObject(object: { [k: string]: any }): google.cloud.edgecontainer.v1.Authorization; + + /** + * Creates a plain object from an Authorization message. Also converts values to other types if specified. + * @param message Authorization + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.edgecontainer.v1.Authorization, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Authorization to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Authorization + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a NodePool. */ + interface INodePool { + + /** NodePool name */ + name?: (string|null); + + /** NodePool createTime */ + createTime?: (google.protobuf.ITimestamp|null); + + /** NodePool updateTime */ + updateTime?: (google.protobuf.ITimestamp|null); + + /** NodePool labels */ + labels?: ({ [k: string]: string }|null); + + /** NodePool nodeLocation */ + nodeLocation?: (string|null); + + /** NodePool nodeCount */ + nodeCount?: (number|null); + + /** NodePool machineFilter */ + machineFilter?: (string|null); + + /** NodePool localDiskEncryption */ + localDiskEncryption?: (google.cloud.edgecontainer.v1.NodePool.ILocalDiskEncryption|null); + } + + /** Represents a NodePool. */ + class NodePool implements INodePool { + + /** + * Constructs a new NodePool. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.edgecontainer.v1.INodePool); + + /** NodePool name. */ + public name: string; + + /** NodePool createTime. */ + public createTime?: (google.protobuf.ITimestamp|null); + + /** NodePool updateTime. */ + public updateTime?: (google.protobuf.ITimestamp|null); + + /** NodePool labels. */ + public labels: { [k: string]: string }; + + /** NodePool nodeLocation. */ + public nodeLocation: string; + + /** NodePool nodeCount. */ + public nodeCount: number; + + /** NodePool machineFilter. */ + public machineFilter: string; + + /** NodePool localDiskEncryption. */ + public localDiskEncryption?: (google.cloud.edgecontainer.v1.NodePool.ILocalDiskEncryption|null); + + /** + * Creates a new NodePool instance using the specified properties. + * @param [properties] Properties to set + * @returns NodePool instance + */ + public static create(properties?: google.cloud.edgecontainer.v1.INodePool): google.cloud.edgecontainer.v1.NodePool; + + /** + * Encodes the specified NodePool message. Does not implicitly {@link google.cloud.edgecontainer.v1.NodePool.verify|verify} messages. + * @param message NodePool message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.edgecontainer.v1.INodePool, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified NodePool message, length delimited. Does not implicitly {@link google.cloud.edgecontainer.v1.NodePool.verify|verify} messages. + * @param message NodePool message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.edgecontainer.v1.INodePool, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a NodePool message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns NodePool + * @throws {Error} If the payload is not 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.edgecontainer.v1.NodePool; + + /** + * Decodes a NodePool message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns NodePool + * @throws {Error} If the payload 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.edgecontainer.v1.NodePool; + + /** + * Verifies a NodePool message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a NodePool message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns NodePool + */ + public static fromObject(object: { [k: string]: any }): google.cloud.edgecontainer.v1.NodePool; + + /** + * Creates a plain object from a NodePool message. Also converts values to other types if specified. + * @param message NodePool + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.edgecontainer.v1.NodePool, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this NodePool to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for NodePool + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace NodePool { + + /** Properties of a LocalDiskEncryption. */ + interface ILocalDiskEncryption { + + /** LocalDiskEncryption kmsKey */ + kmsKey?: (string|null); + + /** LocalDiskEncryption kmsKeyActiveVersion */ + kmsKeyActiveVersion?: (string|null); + + /** LocalDiskEncryption kmsKeyState */ + kmsKeyState?: (google.cloud.edgecontainer.v1.KmsKeyState|keyof typeof google.cloud.edgecontainer.v1.KmsKeyState|null); + + /** LocalDiskEncryption kmsStatus */ + kmsStatus?: (google.rpc.IStatus|null); + } + + /** Represents a LocalDiskEncryption. */ + class LocalDiskEncryption implements ILocalDiskEncryption { + + /** + * Constructs a new LocalDiskEncryption. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.edgecontainer.v1.NodePool.ILocalDiskEncryption); + + /** LocalDiskEncryption kmsKey. */ + public kmsKey: string; + + /** LocalDiskEncryption kmsKeyActiveVersion. */ + public kmsKeyActiveVersion: string; + + /** LocalDiskEncryption kmsKeyState. */ + public kmsKeyState: (google.cloud.edgecontainer.v1.KmsKeyState|keyof typeof google.cloud.edgecontainer.v1.KmsKeyState); + + /** LocalDiskEncryption kmsStatus. */ + public kmsStatus?: (google.rpc.IStatus|null); + + /** + * Creates a new LocalDiskEncryption instance using the specified properties. + * @param [properties] Properties to set + * @returns LocalDiskEncryption instance + */ + public static create(properties?: google.cloud.edgecontainer.v1.NodePool.ILocalDiskEncryption): google.cloud.edgecontainer.v1.NodePool.LocalDiskEncryption; + + /** + * Encodes the specified LocalDiskEncryption message. Does not implicitly {@link google.cloud.edgecontainer.v1.NodePool.LocalDiskEncryption.verify|verify} messages. + * @param message LocalDiskEncryption message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.edgecontainer.v1.NodePool.ILocalDiskEncryption, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified LocalDiskEncryption message, length delimited. Does not implicitly {@link google.cloud.edgecontainer.v1.NodePool.LocalDiskEncryption.verify|verify} messages. + * @param message LocalDiskEncryption message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.edgecontainer.v1.NodePool.ILocalDiskEncryption, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a LocalDiskEncryption message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns LocalDiskEncryption + * @throws {Error} If the payload is not 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.edgecontainer.v1.NodePool.LocalDiskEncryption; + + /** + * Decodes a LocalDiskEncryption message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns LocalDiskEncryption + * @throws {Error} If the payload 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.edgecontainer.v1.NodePool.LocalDiskEncryption; + + /** + * Verifies a LocalDiskEncryption message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a LocalDiskEncryption message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns LocalDiskEncryption + */ + public static fromObject(object: { [k: string]: any }): google.cloud.edgecontainer.v1.NodePool.LocalDiskEncryption; + + /** + * Creates a plain object from a LocalDiskEncryption message. Also converts values to other types if specified. + * @param message LocalDiskEncryption + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.edgecontainer.v1.NodePool.LocalDiskEncryption, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this LocalDiskEncryption to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for LocalDiskEncryption + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Properties of a Machine. */ + interface IMachine { + + /** Machine name */ + name?: (string|null); + + /** Machine createTime */ + createTime?: (google.protobuf.ITimestamp|null); + + /** Machine updateTime */ + updateTime?: (google.protobuf.ITimestamp|null); + + /** Machine labels */ + labels?: ({ [k: string]: string }|null); + + /** Machine hostedNode */ + hostedNode?: (string|null); + + /** Machine zone */ + zone?: (string|null); + + /** Machine disabled */ + disabled?: (boolean|null); + } + + /** Represents a Machine. */ + class Machine implements IMachine { + + /** + * Constructs a new Machine. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.edgecontainer.v1.IMachine); + + /** Machine name. */ + public name: string; + + /** Machine createTime. */ + public createTime?: (google.protobuf.ITimestamp|null); + + /** Machine updateTime. */ + public updateTime?: (google.protobuf.ITimestamp|null); + + /** Machine labels. */ + public labels: { [k: string]: string }; + + /** Machine hostedNode. */ + public hostedNode: string; + + /** Machine zone. */ + public zone: string; + + /** Machine disabled. */ + public disabled: boolean; + + /** + * Creates a new Machine instance using the specified properties. + * @param [properties] Properties to set + * @returns Machine instance + */ + public static create(properties?: google.cloud.edgecontainer.v1.IMachine): google.cloud.edgecontainer.v1.Machine; + + /** + * Encodes the specified Machine message. Does not implicitly {@link google.cloud.edgecontainer.v1.Machine.verify|verify} messages. + * @param message Machine message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.edgecontainer.v1.IMachine, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Machine message, length delimited. Does not implicitly {@link google.cloud.edgecontainer.v1.Machine.verify|verify} messages. + * @param message Machine message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.edgecontainer.v1.IMachine, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Machine message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Machine + * @throws {Error} If the payload is not 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.edgecontainer.v1.Machine; + + /** + * Decodes a Machine message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Machine + * @throws {Error} If the payload 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.edgecontainer.v1.Machine; + + /** + * Verifies a Machine message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Machine message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Machine + */ + public static fromObject(object: { [k: string]: any }): google.cloud.edgecontainer.v1.Machine; + + /** + * Creates a plain object from a Machine message. Also converts values to other types if specified. + * @param message Machine + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.edgecontainer.v1.Machine, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Machine to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Machine + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a VpnConnection. */ + interface IVpnConnection { + + /** VpnConnection name */ + name?: (string|null); + + /** VpnConnection createTime */ + createTime?: (google.protobuf.ITimestamp|null); + + /** VpnConnection updateTime */ + updateTime?: (google.protobuf.ITimestamp|null); + + /** VpnConnection labels */ + labels?: ({ [k: string]: string }|null); + + /** VpnConnection natGatewayIp */ + natGatewayIp?: (string|null); + + /** VpnConnection bgpRoutingMode */ + bgpRoutingMode?: (google.cloud.edgecontainer.v1.VpnConnection.BgpRoutingMode|keyof typeof google.cloud.edgecontainer.v1.VpnConnection.BgpRoutingMode|null); + + /** VpnConnection cluster */ + cluster?: (string|null); + + /** VpnConnection vpc */ + vpc?: (string|null); + + /** VpnConnection vpcProject */ + vpcProject?: (google.cloud.edgecontainer.v1.VpnConnection.IVpcProject|null); + + /** VpnConnection enableHighAvailability */ + enableHighAvailability?: (boolean|null); + + /** VpnConnection details */ + details?: (google.cloud.edgecontainer.v1.VpnConnection.IDetails|null); + } + + /** Represents a VpnConnection. */ + class VpnConnection implements IVpnConnection { + + /** + * Constructs a new VpnConnection. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.edgecontainer.v1.IVpnConnection); + + /** VpnConnection name. */ + public name: string; + + /** VpnConnection createTime. */ + public createTime?: (google.protobuf.ITimestamp|null); + + /** VpnConnection updateTime. */ + public updateTime?: (google.protobuf.ITimestamp|null); + + /** VpnConnection labels. */ + public labels: { [k: string]: string }; + + /** VpnConnection natGatewayIp. */ + public natGatewayIp: string; + + /** VpnConnection bgpRoutingMode. */ + public bgpRoutingMode: (google.cloud.edgecontainer.v1.VpnConnection.BgpRoutingMode|keyof typeof google.cloud.edgecontainer.v1.VpnConnection.BgpRoutingMode); + + /** VpnConnection cluster. */ + public cluster: string; + + /** VpnConnection vpc. */ + public vpc: string; + + /** VpnConnection vpcProject. */ + public vpcProject?: (google.cloud.edgecontainer.v1.VpnConnection.IVpcProject|null); + + /** VpnConnection enableHighAvailability. */ + public enableHighAvailability: boolean; + + /** VpnConnection details. */ + public details?: (google.cloud.edgecontainer.v1.VpnConnection.IDetails|null); + + /** + * Creates a new VpnConnection instance using the specified properties. + * @param [properties] Properties to set + * @returns VpnConnection instance + */ + public static create(properties?: google.cloud.edgecontainer.v1.IVpnConnection): google.cloud.edgecontainer.v1.VpnConnection; + + /** + * Encodes the specified VpnConnection message. Does not implicitly {@link google.cloud.edgecontainer.v1.VpnConnection.verify|verify} messages. + * @param message VpnConnection message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.edgecontainer.v1.IVpnConnection, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified VpnConnection message, length delimited. Does not implicitly {@link google.cloud.edgecontainer.v1.VpnConnection.verify|verify} messages. + * @param message VpnConnection message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.edgecontainer.v1.IVpnConnection, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a VpnConnection message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns VpnConnection + * @throws {Error} If the payload is not 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.edgecontainer.v1.VpnConnection; + + /** + * Decodes a VpnConnection message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns VpnConnection + * @throws {Error} If the payload 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.edgecontainer.v1.VpnConnection; + + /** + * Verifies a VpnConnection message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a VpnConnection message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns VpnConnection + */ + public static fromObject(object: { [k: string]: any }): google.cloud.edgecontainer.v1.VpnConnection; + + /** + * Creates a plain object from a VpnConnection message. Also converts values to other types if specified. + * @param message VpnConnection + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.edgecontainer.v1.VpnConnection, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this VpnConnection to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for VpnConnection + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace VpnConnection { + + /** Properties of a VpcProject. */ + interface IVpcProject { + + /** VpcProject projectId */ + projectId?: (string|null); + + /** VpcProject serviceAccount */ + serviceAccount?: (string|null); + } + + /** Represents a VpcProject. */ + class VpcProject implements IVpcProject { + + /** + * Constructs a new VpcProject. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.edgecontainer.v1.VpnConnection.IVpcProject); + + /** VpcProject projectId. */ + public projectId: string; + + /** VpcProject serviceAccount. */ + public serviceAccount: string; + + /** + * Creates a new VpcProject instance using the specified properties. + * @param [properties] Properties to set + * @returns VpcProject instance + */ + public static create(properties?: google.cloud.edgecontainer.v1.VpnConnection.IVpcProject): google.cloud.edgecontainer.v1.VpnConnection.VpcProject; + + /** + * Encodes the specified VpcProject message. Does not implicitly {@link google.cloud.edgecontainer.v1.VpnConnection.VpcProject.verify|verify} messages. + * @param message VpcProject message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.edgecontainer.v1.VpnConnection.IVpcProject, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified VpcProject message, length delimited. Does not implicitly {@link google.cloud.edgecontainer.v1.VpnConnection.VpcProject.verify|verify} messages. + * @param message VpcProject message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.edgecontainer.v1.VpnConnection.IVpcProject, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a VpcProject message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns VpcProject + * @throws {Error} If the payload is not 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.edgecontainer.v1.VpnConnection.VpcProject; + + /** + * Decodes a VpcProject message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns VpcProject + * @throws {Error} If the payload 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.edgecontainer.v1.VpnConnection.VpcProject; + + /** + * Verifies a VpcProject message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a VpcProject message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns VpcProject + */ + public static fromObject(object: { [k: string]: any }): google.cloud.edgecontainer.v1.VpnConnection.VpcProject; + + /** + * Creates a plain object from a VpcProject message. Also converts values to other types if specified. + * @param message VpcProject + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.edgecontainer.v1.VpnConnection.VpcProject, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this VpcProject to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for VpcProject + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Details. */ + interface IDetails { + + /** Details state */ + state?: (google.cloud.edgecontainer.v1.VpnConnection.Details.State|keyof typeof google.cloud.edgecontainer.v1.VpnConnection.Details.State|null); + + /** Details error */ + error?: (string|null); + + /** Details cloudRouter */ + cloudRouter?: (google.cloud.edgecontainer.v1.VpnConnection.Details.ICloudRouter|null); + + /** Details cloudVpns */ + cloudVpns?: (google.cloud.edgecontainer.v1.VpnConnection.Details.ICloudVpn[]|null); + } + + /** Represents a Details. */ + class Details implements IDetails { + + /** + * Constructs a new Details. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.edgecontainer.v1.VpnConnection.IDetails); + + /** Details state. */ + public state: (google.cloud.edgecontainer.v1.VpnConnection.Details.State|keyof typeof google.cloud.edgecontainer.v1.VpnConnection.Details.State); + + /** Details error. */ + public error: string; + + /** Details cloudRouter. */ + public cloudRouter?: (google.cloud.edgecontainer.v1.VpnConnection.Details.ICloudRouter|null); + + /** Details cloudVpns. */ + public cloudVpns: google.cloud.edgecontainer.v1.VpnConnection.Details.ICloudVpn[]; + + /** + * Creates a new Details instance using the specified properties. + * @param [properties] Properties to set + * @returns Details instance + */ + public static create(properties?: google.cloud.edgecontainer.v1.VpnConnection.IDetails): google.cloud.edgecontainer.v1.VpnConnection.Details; + + /** + * Encodes the specified Details message. Does not implicitly {@link google.cloud.edgecontainer.v1.VpnConnection.Details.verify|verify} messages. + * @param message Details message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.edgecontainer.v1.VpnConnection.IDetails, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Details message, length delimited. Does not implicitly {@link google.cloud.edgecontainer.v1.VpnConnection.Details.verify|verify} messages. + * @param message Details message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.edgecontainer.v1.VpnConnection.IDetails, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Details message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Details + * @throws {Error} If the payload is not 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.edgecontainer.v1.VpnConnection.Details; + + /** + * Decodes a Details message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Details + * @throws {Error} If the payload 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.edgecontainer.v1.VpnConnection.Details; + + /** + * Verifies a Details message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Details message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Details + */ + public static fromObject(object: { [k: string]: any }): google.cloud.edgecontainer.v1.VpnConnection.Details; + + /** + * Creates a plain object from a Details message. Also converts values to other types if specified. + * @param message Details + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.edgecontainer.v1.VpnConnection.Details, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Details to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Details + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace Details { + + /** Properties of a CloudRouter. */ + interface ICloudRouter { + + /** CloudRouter name */ + name?: (string|null); + } + + /** Represents a CloudRouter. */ + class CloudRouter implements ICloudRouter { + + /** + * Constructs a new CloudRouter. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.edgecontainer.v1.VpnConnection.Details.ICloudRouter); + + /** CloudRouter name. */ + public name: string; + + /** + * Creates a new CloudRouter instance using the specified properties. + * @param [properties] Properties to set + * @returns CloudRouter instance + */ + public static create(properties?: google.cloud.edgecontainer.v1.VpnConnection.Details.ICloudRouter): google.cloud.edgecontainer.v1.VpnConnection.Details.CloudRouter; + + /** + * Encodes the specified CloudRouter message. Does not implicitly {@link google.cloud.edgecontainer.v1.VpnConnection.Details.CloudRouter.verify|verify} messages. + * @param message CloudRouter message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.edgecontainer.v1.VpnConnection.Details.ICloudRouter, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CloudRouter message, length delimited. Does not implicitly {@link google.cloud.edgecontainer.v1.VpnConnection.Details.CloudRouter.verify|verify} messages. + * @param message CloudRouter message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.edgecontainer.v1.VpnConnection.Details.ICloudRouter, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CloudRouter message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CloudRouter + * @throws {Error} If the payload is not 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.edgecontainer.v1.VpnConnection.Details.CloudRouter; + + /** + * Decodes a CloudRouter message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CloudRouter + * @throws {Error} If the payload 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.edgecontainer.v1.VpnConnection.Details.CloudRouter; + + /** + * Verifies a CloudRouter message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CloudRouter message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CloudRouter + */ + public static fromObject(object: { [k: string]: any }): google.cloud.edgecontainer.v1.VpnConnection.Details.CloudRouter; + + /** + * Creates a plain object from a CloudRouter message. Also converts values to other types if specified. + * @param message CloudRouter + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.edgecontainer.v1.VpnConnection.Details.CloudRouter, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CloudRouter to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CloudRouter + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a CloudVpn. */ + interface ICloudVpn { + + /** CloudVpn gateway */ + gateway?: (string|null); + } + + /** Represents a CloudVpn. */ + class CloudVpn implements ICloudVpn { + + /** + * Constructs a new CloudVpn. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.edgecontainer.v1.VpnConnection.Details.ICloudVpn); + + /** CloudVpn gateway. */ + public gateway: string; + + /** + * Creates a new CloudVpn instance using the specified properties. + * @param [properties] Properties to set + * @returns CloudVpn instance + */ + public static create(properties?: google.cloud.edgecontainer.v1.VpnConnection.Details.ICloudVpn): google.cloud.edgecontainer.v1.VpnConnection.Details.CloudVpn; + + /** + * Encodes the specified CloudVpn message. Does not implicitly {@link google.cloud.edgecontainer.v1.VpnConnection.Details.CloudVpn.verify|verify} messages. + * @param message CloudVpn message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.edgecontainer.v1.VpnConnection.Details.ICloudVpn, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CloudVpn message, length delimited. Does not implicitly {@link google.cloud.edgecontainer.v1.VpnConnection.Details.CloudVpn.verify|verify} messages. + * @param message CloudVpn message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.edgecontainer.v1.VpnConnection.Details.ICloudVpn, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CloudVpn message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CloudVpn + * @throws {Error} If the payload is not 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.edgecontainer.v1.VpnConnection.Details.CloudVpn; + + /** + * Decodes a CloudVpn message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CloudVpn + * @throws {Error} If the payload 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.edgecontainer.v1.VpnConnection.Details.CloudVpn; + + /** + * Verifies a CloudVpn message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CloudVpn message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CloudVpn + */ + public static fromObject(object: { [k: string]: any }): google.cloud.edgecontainer.v1.VpnConnection.Details.CloudVpn; + + /** + * Creates a plain object from a CloudVpn message. Also converts values to other types if specified. + * @param message CloudVpn + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.edgecontainer.v1.VpnConnection.Details.CloudVpn, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CloudVpn to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CloudVpn + * @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, + STATE_CONNECTED = 1, + STATE_CONNECTING = 2, + STATE_ERROR = 3 + } + } + + /** BgpRoutingMode enum. */ + enum BgpRoutingMode { + BGP_ROUTING_MODE_UNSPECIFIED = 0, + REGIONAL = 1, + GLOBAL = 2 + } + } + + /** Properties of a LocationMetadata. */ + interface ILocationMetadata { + + /** LocationMetadata availableZones */ + availableZones?: ({ [k: string]: google.cloud.edgecontainer.v1.IZoneMetadata }|null); + } + + /** Represents a LocationMetadata. */ + class LocationMetadata implements ILocationMetadata { + + /** + * Constructs a new LocationMetadata. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.edgecontainer.v1.ILocationMetadata); + + /** LocationMetadata availableZones. */ + public availableZones: { [k: string]: google.cloud.edgecontainer.v1.IZoneMetadata }; + + /** + * Creates a new LocationMetadata instance using the specified properties. + * @param [properties] Properties to set + * @returns LocationMetadata instance + */ + public static create(properties?: google.cloud.edgecontainer.v1.ILocationMetadata): google.cloud.edgecontainer.v1.LocationMetadata; + + /** + * Encodes the specified LocationMetadata message. Does not implicitly {@link google.cloud.edgecontainer.v1.LocationMetadata.verify|verify} messages. + * @param message LocationMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.edgecontainer.v1.ILocationMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified LocationMetadata message, length delimited. Does not implicitly {@link google.cloud.edgecontainer.v1.LocationMetadata.verify|verify} messages. + * @param message LocationMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.edgecontainer.v1.ILocationMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a LocationMetadata message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns LocationMetadata + * @throws {Error} If the payload is not 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.edgecontainer.v1.LocationMetadata; + + /** + * Decodes a LocationMetadata message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns LocationMetadata + * @throws {Error} If the payload 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.edgecontainer.v1.LocationMetadata; + + /** + * Verifies a LocationMetadata message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a LocationMetadata message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns LocationMetadata + */ + public static fromObject(object: { [k: string]: any }): google.cloud.edgecontainer.v1.LocationMetadata; + + /** + * Creates a plain object from a LocationMetadata message. Also converts values to other types if specified. + * @param message LocationMetadata + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.edgecontainer.v1.LocationMetadata, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this LocationMetadata to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for LocationMetadata + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ZoneMetadata. */ + interface IZoneMetadata { + + /** ZoneMetadata quota */ + quota?: (google.cloud.edgecontainer.v1.IQuota[]|null); + } + + /** Represents a ZoneMetadata. */ + class ZoneMetadata implements IZoneMetadata { + + /** + * Constructs a new ZoneMetadata. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.edgecontainer.v1.IZoneMetadata); + + /** ZoneMetadata quota. */ + public quota: google.cloud.edgecontainer.v1.IQuota[]; + + /** + * Creates a new ZoneMetadata instance using the specified properties. + * @param [properties] Properties to set + * @returns ZoneMetadata instance + */ + public static create(properties?: google.cloud.edgecontainer.v1.IZoneMetadata): google.cloud.edgecontainer.v1.ZoneMetadata; + + /** + * Encodes the specified ZoneMetadata message. Does not implicitly {@link google.cloud.edgecontainer.v1.ZoneMetadata.verify|verify} messages. + * @param message ZoneMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.edgecontainer.v1.IZoneMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ZoneMetadata message, length delimited. Does not implicitly {@link google.cloud.edgecontainer.v1.ZoneMetadata.verify|verify} messages. + * @param message ZoneMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.edgecontainer.v1.IZoneMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ZoneMetadata message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ZoneMetadata + * @throws {Error} If the payload is not 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.edgecontainer.v1.ZoneMetadata; + + /** + * Decodes a ZoneMetadata message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ZoneMetadata + * @throws {Error} If the payload 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.edgecontainer.v1.ZoneMetadata; + + /** + * Verifies a ZoneMetadata message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ZoneMetadata message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ZoneMetadata + */ + public static fromObject(object: { [k: string]: any }): google.cloud.edgecontainer.v1.ZoneMetadata; + + /** + * Creates a plain object from a ZoneMetadata message. Also converts values to other types if specified. + * @param message ZoneMetadata + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.edgecontainer.v1.ZoneMetadata, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ZoneMetadata to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ZoneMetadata + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Quota. */ + interface IQuota { + + /** Quota metric */ + metric?: (string|null); + + /** Quota limit */ + limit?: (number|null); + + /** Quota usage */ + usage?: (number|null); + } + + /** Represents a Quota. */ + class Quota implements IQuota { + + /** + * Constructs a new Quota. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.edgecontainer.v1.IQuota); + + /** Quota metric. */ + public metric: string; + + /** Quota limit. */ + public limit: number; + + /** Quota usage. */ + public usage: number; + + /** + * Creates a new Quota instance using the specified properties. + * @param [properties] Properties to set + * @returns Quota instance + */ + public static create(properties?: google.cloud.edgecontainer.v1.IQuota): google.cloud.edgecontainer.v1.Quota; + + /** + * Encodes the specified Quota message. Does not implicitly {@link google.cloud.edgecontainer.v1.Quota.verify|verify} messages. + * @param message Quota message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.edgecontainer.v1.IQuota, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Quota message, length delimited. Does not implicitly {@link google.cloud.edgecontainer.v1.Quota.verify|verify} messages. + * @param message Quota message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.edgecontainer.v1.IQuota, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Quota message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Quota + * @throws {Error} If the payload is not 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.edgecontainer.v1.Quota; + + /** + * Decodes a Quota message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Quota + * @throws {Error} If the payload 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.edgecontainer.v1.Quota; + + /** + * Verifies a Quota message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Quota message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Quota + */ + public static fromObject(object: { [k: string]: any }): google.cloud.edgecontainer.v1.Quota; + + /** + * Creates a plain object from a Quota message. Also converts values to other types if specified. + * @param message Quota + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.edgecontainer.v1.Quota, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Quota to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Quota + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a MaintenancePolicy. */ + interface IMaintenancePolicy { + + /** MaintenancePolicy window */ + window?: (google.cloud.edgecontainer.v1.IMaintenanceWindow|null); + } + + /** Represents a MaintenancePolicy. */ + class MaintenancePolicy implements IMaintenancePolicy { + + /** + * Constructs a new MaintenancePolicy. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.edgecontainer.v1.IMaintenancePolicy); + + /** MaintenancePolicy window. */ + public window?: (google.cloud.edgecontainer.v1.IMaintenanceWindow|null); + + /** + * Creates a new MaintenancePolicy instance using the specified properties. + * @param [properties] Properties to set + * @returns MaintenancePolicy instance + */ + public static create(properties?: google.cloud.edgecontainer.v1.IMaintenancePolicy): google.cloud.edgecontainer.v1.MaintenancePolicy; + + /** + * Encodes the specified MaintenancePolicy message. Does not implicitly {@link google.cloud.edgecontainer.v1.MaintenancePolicy.verify|verify} messages. + * @param message MaintenancePolicy message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.edgecontainer.v1.IMaintenancePolicy, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified MaintenancePolicy message, length delimited. Does not implicitly {@link google.cloud.edgecontainer.v1.MaintenancePolicy.verify|verify} messages. + * @param message MaintenancePolicy message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.edgecontainer.v1.IMaintenancePolicy, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a MaintenancePolicy message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns MaintenancePolicy + * @throws {Error} If the payload is not 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.edgecontainer.v1.MaintenancePolicy; + + /** + * Decodes a MaintenancePolicy message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns MaintenancePolicy + * @throws {Error} If the payload 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.edgecontainer.v1.MaintenancePolicy; + + /** + * Verifies a MaintenancePolicy message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a MaintenancePolicy message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns MaintenancePolicy + */ + public static fromObject(object: { [k: string]: any }): google.cloud.edgecontainer.v1.MaintenancePolicy; + + /** + * Creates a plain object from a MaintenancePolicy message. Also converts values to other types if specified. + * @param message MaintenancePolicy + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.edgecontainer.v1.MaintenancePolicy, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this MaintenancePolicy to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for MaintenancePolicy + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a MaintenanceWindow. */ + interface IMaintenanceWindow { + + /** MaintenanceWindow recurringWindow */ + recurringWindow?: (google.cloud.edgecontainer.v1.IRecurringTimeWindow|null); + } + + /** Represents a MaintenanceWindow. */ + class MaintenanceWindow implements IMaintenanceWindow { + + /** + * Constructs a new MaintenanceWindow. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.edgecontainer.v1.IMaintenanceWindow); + + /** MaintenanceWindow recurringWindow. */ + public recurringWindow?: (google.cloud.edgecontainer.v1.IRecurringTimeWindow|null); + + /** + * Creates a new MaintenanceWindow instance using the specified properties. + * @param [properties] Properties to set + * @returns MaintenanceWindow instance + */ + public static create(properties?: google.cloud.edgecontainer.v1.IMaintenanceWindow): google.cloud.edgecontainer.v1.MaintenanceWindow; + + /** + * Encodes the specified MaintenanceWindow message. Does not implicitly {@link google.cloud.edgecontainer.v1.MaintenanceWindow.verify|verify} messages. + * @param message MaintenanceWindow message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.edgecontainer.v1.IMaintenanceWindow, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified MaintenanceWindow message, length delimited. Does not implicitly {@link google.cloud.edgecontainer.v1.MaintenanceWindow.verify|verify} messages. + * @param message MaintenanceWindow message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.edgecontainer.v1.IMaintenanceWindow, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a MaintenanceWindow message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns MaintenanceWindow + * @throws {Error} If the payload is not 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.edgecontainer.v1.MaintenanceWindow; + + /** + * Decodes a MaintenanceWindow message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns MaintenanceWindow + * @throws {Error} If the payload 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.edgecontainer.v1.MaintenanceWindow; + + /** + * Verifies a MaintenanceWindow message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a MaintenanceWindow message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns MaintenanceWindow + */ + public static fromObject(object: { [k: string]: any }): google.cloud.edgecontainer.v1.MaintenanceWindow; + + /** + * Creates a plain object from a MaintenanceWindow message. Also converts values to other types if specified. + * @param message MaintenanceWindow + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.edgecontainer.v1.MaintenanceWindow, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this MaintenanceWindow to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for MaintenanceWindow + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a RecurringTimeWindow. */ + interface IRecurringTimeWindow { + + /** RecurringTimeWindow window */ + window?: (google.cloud.edgecontainer.v1.ITimeWindow|null); + + /** RecurringTimeWindow recurrence */ + recurrence?: (string|null); + } + + /** Represents a RecurringTimeWindow. */ + class RecurringTimeWindow implements IRecurringTimeWindow { + + /** + * Constructs a new RecurringTimeWindow. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.edgecontainer.v1.IRecurringTimeWindow); + + /** RecurringTimeWindow window. */ + public window?: (google.cloud.edgecontainer.v1.ITimeWindow|null); + + /** RecurringTimeWindow recurrence. */ + public recurrence: string; + + /** + * Creates a new RecurringTimeWindow instance using the specified properties. + * @param [properties] Properties to set + * @returns RecurringTimeWindow instance + */ + public static create(properties?: google.cloud.edgecontainer.v1.IRecurringTimeWindow): google.cloud.edgecontainer.v1.RecurringTimeWindow; + + /** + * Encodes the specified RecurringTimeWindow message. Does not implicitly {@link google.cloud.edgecontainer.v1.RecurringTimeWindow.verify|verify} messages. + * @param message RecurringTimeWindow message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.edgecontainer.v1.IRecurringTimeWindow, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified RecurringTimeWindow message, length delimited. Does not implicitly {@link google.cloud.edgecontainer.v1.RecurringTimeWindow.verify|verify} messages. + * @param message RecurringTimeWindow message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.edgecontainer.v1.IRecurringTimeWindow, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a RecurringTimeWindow message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns RecurringTimeWindow + * @throws {Error} If the payload is not 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.edgecontainer.v1.RecurringTimeWindow; + + /** + * Decodes a RecurringTimeWindow message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns RecurringTimeWindow + * @throws {Error} If the payload 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.edgecontainer.v1.RecurringTimeWindow; + + /** + * Verifies a RecurringTimeWindow message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a RecurringTimeWindow message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns RecurringTimeWindow + */ + public static fromObject(object: { [k: string]: any }): google.cloud.edgecontainer.v1.RecurringTimeWindow; + + /** + * Creates a plain object from a RecurringTimeWindow message. Also converts values to other types if specified. + * @param message RecurringTimeWindow + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.edgecontainer.v1.RecurringTimeWindow, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this RecurringTimeWindow to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for RecurringTimeWindow + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TimeWindow. */ + interface ITimeWindow { + + /** TimeWindow startTime */ + startTime?: (google.protobuf.ITimestamp|null); + + /** TimeWindow endTime */ + endTime?: (google.protobuf.ITimestamp|null); + } + + /** Represents a TimeWindow. */ + class TimeWindow implements ITimeWindow { + + /** + * Constructs a new TimeWindow. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.edgecontainer.v1.ITimeWindow); + + /** TimeWindow startTime. */ + public startTime?: (google.protobuf.ITimestamp|null); + + /** TimeWindow endTime. */ + public endTime?: (google.protobuf.ITimestamp|null); + + /** + * Creates a new TimeWindow instance using the specified properties. + * @param [properties] Properties to set + * @returns TimeWindow instance + */ + public static create(properties?: google.cloud.edgecontainer.v1.ITimeWindow): google.cloud.edgecontainer.v1.TimeWindow; + + /** + * Encodes the specified TimeWindow message. Does not implicitly {@link google.cloud.edgecontainer.v1.TimeWindow.verify|verify} messages. + * @param message TimeWindow message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.edgecontainer.v1.ITimeWindow, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified TimeWindow message, length delimited. Does not implicitly {@link google.cloud.edgecontainer.v1.TimeWindow.verify|verify} messages. + * @param message TimeWindow message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.edgecontainer.v1.ITimeWindow, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TimeWindow message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns TimeWindow + * @throws {Error} If the payload is not 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.edgecontainer.v1.TimeWindow; + + /** + * Decodes a TimeWindow message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns TimeWindow + * @throws {Error} If the payload 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.edgecontainer.v1.TimeWindow; + + /** + * Verifies a TimeWindow message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a TimeWindow message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns TimeWindow + */ + public static fromObject(object: { [k: string]: any }): google.cloud.edgecontainer.v1.TimeWindow; + + /** + * Creates a plain object from a TimeWindow message. Also converts values to other types if specified. + * @param message TimeWindow + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.edgecontainer.v1.TimeWindow, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this TimeWindow to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for TimeWindow + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Represents an EdgeContainer */ + class EdgeContainer extends $protobuf.rpc.Service { + + /** + * Constructs a new EdgeContainer 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 EdgeContainer 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): EdgeContainer; + + /** + * Calls ListClusters. + * @param request ListClustersRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ListClustersResponse + */ + public listClusters(request: google.cloud.edgecontainer.v1.IListClustersRequest, callback: google.cloud.edgecontainer.v1.EdgeContainer.ListClustersCallback): void; + + /** + * Calls ListClusters. + * @param request ListClustersRequest message or plain object + * @returns Promise + */ + public listClusters(request: google.cloud.edgecontainer.v1.IListClustersRequest): Promise; + + /** + * Calls GetCluster. + * @param request GetClusterRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Cluster + */ + public getCluster(request: google.cloud.edgecontainer.v1.IGetClusterRequest, callback: google.cloud.edgecontainer.v1.EdgeContainer.GetClusterCallback): void; + + /** + * Calls GetCluster. + * @param request GetClusterRequest message or plain object + * @returns Promise + */ + public getCluster(request: google.cloud.edgecontainer.v1.IGetClusterRequest): Promise; + + /** + * Calls CreateCluster. + * @param request CreateClusterRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public createCluster(request: google.cloud.edgecontainer.v1.ICreateClusterRequest, callback: google.cloud.edgecontainer.v1.EdgeContainer.CreateClusterCallback): void; + + /** + * Calls CreateCluster. + * @param request CreateClusterRequest message or plain object + * @returns Promise + */ + public createCluster(request: google.cloud.edgecontainer.v1.ICreateClusterRequest): Promise; + + /** + * Calls UpdateCluster. + * @param request UpdateClusterRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public updateCluster(request: google.cloud.edgecontainer.v1.IUpdateClusterRequest, callback: google.cloud.edgecontainer.v1.EdgeContainer.UpdateClusterCallback): void; + + /** + * Calls UpdateCluster. + * @param request UpdateClusterRequest message or plain object + * @returns Promise + */ + public updateCluster(request: google.cloud.edgecontainer.v1.IUpdateClusterRequest): Promise; + + /** + * Calls DeleteCluster. + * @param request DeleteClusterRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public deleteCluster(request: google.cloud.edgecontainer.v1.IDeleteClusterRequest, callback: google.cloud.edgecontainer.v1.EdgeContainer.DeleteClusterCallback): void; + + /** + * Calls DeleteCluster. + * @param request DeleteClusterRequest message or plain object + * @returns Promise + */ + public deleteCluster(request: google.cloud.edgecontainer.v1.IDeleteClusterRequest): Promise; + + /** + * Calls GenerateAccessToken. + * @param request GenerateAccessTokenRequest message or plain object + * @param callback Node-style callback called with the error, if any, and GenerateAccessTokenResponse + */ + public generateAccessToken(request: google.cloud.edgecontainer.v1.IGenerateAccessTokenRequest, callback: google.cloud.edgecontainer.v1.EdgeContainer.GenerateAccessTokenCallback): void; + + /** + * Calls GenerateAccessToken. + * @param request GenerateAccessTokenRequest message or plain object + * @returns Promise + */ + public generateAccessToken(request: google.cloud.edgecontainer.v1.IGenerateAccessTokenRequest): Promise; + + /** + * Calls ListNodePools. + * @param request ListNodePoolsRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ListNodePoolsResponse + */ + public listNodePools(request: google.cloud.edgecontainer.v1.IListNodePoolsRequest, callback: google.cloud.edgecontainer.v1.EdgeContainer.ListNodePoolsCallback): void; + + /** + * Calls ListNodePools. + * @param request ListNodePoolsRequest message or plain object + * @returns Promise + */ + public listNodePools(request: google.cloud.edgecontainer.v1.IListNodePoolsRequest): Promise; + + /** + * Calls GetNodePool. + * @param request GetNodePoolRequest message or plain object + * @param callback Node-style callback called with the error, if any, and NodePool + */ + public getNodePool(request: google.cloud.edgecontainer.v1.IGetNodePoolRequest, callback: google.cloud.edgecontainer.v1.EdgeContainer.GetNodePoolCallback): void; + + /** + * Calls GetNodePool. + * @param request GetNodePoolRequest message or plain object + * @returns Promise + */ + public getNodePool(request: google.cloud.edgecontainer.v1.IGetNodePoolRequest): Promise; + + /** + * Calls CreateNodePool. + * @param request CreateNodePoolRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public createNodePool(request: google.cloud.edgecontainer.v1.ICreateNodePoolRequest, callback: google.cloud.edgecontainer.v1.EdgeContainer.CreateNodePoolCallback): void; + + /** + * Calls CreateNodePool. + * @param request CreateNodePoolRequest message or plain object + * @returns Promise + */ + public createNodePool(request: google.cloud.edgecontainer.v1.ICreateNodePoolRequest): Promise; + + /** + * Calls UpdateNodePool. + * @param request UpdateNodePoolRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public updateNodePool(request: google.cloud.edgecontainer.v1.IUpdateNodePoolRequest, callback: google.cloud.edgecontainer.v1.EdgeContainer.UpdateNodePoolCallback): void; + + /** + * Calls UpdateNodePool. + * @param request UpdateNodePoolRequest message or plain object + * @returns Promise + */ + public updateNodePool(request: google.cloud.edgecontainer.v1.IUpdateNodePoolRequest): Promise; + + /** + * Calls DeleteNodePool. + * @param request DeleteNodePoolRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public deleteNodePool(request: google.cloud.edgecontainer.v1.IDeleteNodePoolRequest, callback: google.cloud.edgecontainer.v1.EdgeContainer.DeleteNodePoolCallback): void; + + /** + * Calls DeleteNodePool. + * @param request DeleteNodePoolRequest message or plain object + * @returns Promise + */ + public deleteNodePool(request: google.cloud.edgecontainer.v1.IDeleteNodePoolRequest): Promise; + + /** + * Calls ListMachines. + * @param request ListMachinesRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ListMachinesResponse + */ + public listMachines(request: google.cloud.edgecontainer.v1.IListMachinesRequest, callback: google.cloud.edgecontainer.v1.EdgeContainer.ListMachinesCallback): void; + + /** + * Calls ListMachines. + * @param request ListMachinesRequest message or plain object + * @returns Promise + */ + public listMachines(request: google.cloud.edgecontainer.v1.IListMachinesRequest): Promise; + + /** + * Calls GetMachine. + * @param request GetMachineRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Machine + */ + public getMachine(request: google.cloud.edgecontainer.v1.IGetMachineRequest, callback: google.cloud.edgecontainer.v1.EdgeContainer.GetMachineCallback): void; + + /** + * Calls GetMachine. + * @param request GetMachineRequest message or plain object + * @returns Promise + */ + public getMachine(request: google.cloud.edgecontainer.v1.IGetMachineRequest): Promise; + + /** + * Calls ListVpnConnections. + * @param request ListVpnConnectionsRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ListVpnConnectionsResponse + */ + public listVpnConnections(request: google.cloud.edgecontainer.v1.IListVpnConnectionsRequest, callback: google.cloud.edgecontainer.v1.EdgeContainer.ListVpnConnectionsCallback): void; + + /** + * Calls ListVpnConnections. + * @param request ListVpnConnectionsRequest message or plain object + * @returns Promise + */ + public listVpnConnections(request: google.cloud.edgecontainer.v1.IListVpnConnectionsRequest): Promise; + + /** + * Calls GetVpnConnection. + * @param request GetVpnConnectionRequest message or plain object + * @param callback Node-style callback called with the error, if any, and VpnConnection + */ + public getVpnConnection(request: google.cloud.edgecontainer.v1.IGetVpnConnectionRequest, callback: google.cloud.edgecontainer.v1.EdgeContainer.GetVpnConnectionCallback): void; + + /** + * Calls GetVpnConnection. + * @param request GetVpnConnectionRequest message or plain object + * @returns Promise + */ + public getVpnConnection(request: google.cloud.edgecontainer.v1.IGetVpnConnectionRequest): Promise; + + /** + * Calls CreateVpnConnection. + * @param request CreateVpnConnectionRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public createVpnConnection(request: google.cloud.edgecontainer.v1.ICreateVpnConnectionRequest, callback: google.cloud.edgecontainer.v1.EdgeContainer.CreateVpnConnectionCallback): void; + + /** + * Calls CreateVpnConnection. + * @param request CreateVpnConnectionRequest message or plain object + * @returns Promise + */ + public createVpnConnection(request: google.cloud.edgecontainer.v1.ICreateVpnConnectionRequest): Promise; + + /** + * Calls DeleteVpnConnection. + * @param request DeleteVpnConnectionRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public deleteVpnConnection(request: google.cloud.edgecontainer.v1.IDeleteVpnConnectionRequest, callback: google.cloud.edgecontainer.v1.EdgeContainer.DeleteVpnConnectionCallback): void; + + /** + * Calls DeleteVpnConnection. + * @param request DeleteVpnConnectionRequest message or plain object + * @returns Promise + */ + public deleteVpnConnection(request: google.cloud.edgecontainer.v1.IDeleteVpnConnectionRequest): Promise; + } + + namespace EdgeContainer { + + /** + * Callback as used by {@link google.cloud.edgecontainer.v1.EdgeContainer|listClusters}. + * @param error Error, if any + * @param [response] ListClustersResponse + */ + type ListClustersCallback = (error: (Error|null), response?: google.cloud.edgecontainer.v1.ListClustersResponse) => void; + + /** + * Callback as used by {@link google.cloud.edgecontainer.v1.EdgeContainer|getCluster}. + * @param error Error, if any + * @param [response] Cluster + */ + type GetClusterCallback = (error: (Error|null), response?: google.cloud.edgecontainer.v1.Cluster) => void; + + /** + * Callback as used by {@link google.cloud.edgecontainer.v1.EdgeContainer|createCluster}. + * @param error Error, if any + * @param [response] Operation + */ + type CreateClusterCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.cloud.edgecontainer.v1.EdgeContainer|updateCluster}. + * @param error Error, if any + * @param [response] Operation + */ + type UpdateClusterCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.cloud.edgecontainer.v1.EdgeContainer|deleteCluster}. + * @param error Error, if any + * @param [response] Operation + */ + type DeleteClusterCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.cloud.edgecontainer.v1.EdgeContainer|generateAccessToken}. + * @param error Error, if any + * @param [response] GenerateAccessTokenResponse + */ + type GenerateAccessTokenCallback = (error: (Error|null), response?: google.cloud.edgecontainer.v1.GenerateAccessTokenResponse) => void; + + /** + * Callback as used by {@link google.cloud.edgecontainer.v1.EdgeContainer|listNodePools}. + * @param error Error, if any + * @param [response] ListNodePoolsResponse + */ + type ListNodePoolsCallback = (error: (Error|null), response?: google.cloud.edgecontainer.v1.ListNodePoolsResponse) => void; + + /** + * Callback as used by {@link google.cloud.edgecontainer.v1.EdgeContainer|getNodePool}. + * @param error Error, if any + * @param [response] NodePool + */ + type GetNodePoolCallback = (error: (Error|null), response?: google.cloud.edgecontainer.v1.NodePool) => void; + + /** + * Callback as used by {@link google.cloud.edgecontainer.v1.EdgeContainer|createNodePool}. + * @param error Error, if any + * @param [response] Operation + */ + type CreateNodePoolCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.cloud.edgecontainer.v1.EdgeContainer|updateNodePool}. + * @param error Error, if any + * @param [response] Operation + */ + type UpdateNodePoolCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.cloud.edgecontainer.v1.EdgeContainer|deleteNodePool}. + * @param error Error, if any + * @param [response] Operation + */ + type DeleteNodePoolCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.cloud.edgecontainer.v1.EdgeContainer|listMachines}. + * @param error Error, if any + * @param [response] ListMachinesResponse + */ + type ListMachinesCallback = (error: (Error|null), response?: google.cloud.edgecontainer.v1.ListMachinesResponse) => void; + + /** + * Callback as used by {@link google.cloud.edgecontainer.v1.EdgeContainer|getMachine}. + * @param error Error, if any + * @param [response] Machine + */ + type GetMachineCallback = (error: (Error|null), response?: google.cloud.edgecontainer.v1.Machine) => void; + + /** + * Callback as used by {@link google.cloud.edgecontainer.v1.EdgeContainer|listVpnConnections}. + * @param error Error, if any + * @param [response] ListVpnConnectionsResponse + */ + type ListVpnConnectionsCallback = (error: (Error|null), response?: google.cloud.edgecontainer.v1.ListVpnConnectionsResponse) => void; + + /** + * Callback as used by {@link google.cloud.edgecontainer.v1.EdgeContainer|getVpnConnection}. + * @param error Error, if any + * @param [response] VpnConnection + */ + type GetVpnConnectionCallback = (error: (Error|null), response?: google.cloud.edgecontainer.v1.VpnConnection) => void; + + /** + * Callback as used by {@link google.cloud.edgecontainer.v1.EdgeContainer|createVpnConnection}. + * @param error Error, if any + * @param [response] Operation + */ + type CreateVpnConnectionCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.cloud.edgecontainer.v1.EdgeContainer|deleteVpnConnection}. + * @param error Error, if any + * @param [response] Operation + */ + type DeleteVpnConnectionCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + } + + /** Properties of an OperationMetadata. */ + interface IOperationMetadata { + + /** OperationMetadata createTime */ + createTime?: (google.protobuf.ITimestamp|null); + + /** OperationMetadata endTime */ + endTime?: (google.protobuf.ITimestamp|null); + + /** OperationMetadata target */ + target?: (string|null); + + /** OperationMetadata verb */ + verb?: (string|null); + + /** OperationMetadata statusMessage */ + statusMessage?: (string|null); + + /** OperationMetadata requestedCancellation */ + requestedCancellation?: (boolean|null); + + /** OperationMetadata apiVersion */ + apiVersion?: (string|null); + } + + /** Represents an OperationMetadata. */ + class OperationMetadata implements IOperationMetadata { + + /** + * Constructs a new OperationMetadata. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.edgecontainer.v1.IOperationMetadata); + + /** OperationMetadata createTime. */ + public createTime?: (google.protobuf.ITimestamp|null); + + /** OperationMetadata endTime. */ + public endTime?: (google.protobuf.ITimestamp|null); + + /** OperationMetadata target. */ + public target: string; + + /** OperationMetadata verb. */ + public verb: string; + + /** OperationMetadata statusMessage. */ + public statusMessage: string; + + /** OperationMetadata requestedCancellation. */ + public requestedCancellation: boolean; + + /** OperationMetadata apiVersion. */ + public apiVersion: string; + + /** + * Creates a new OperationMetadata instance using the specified properties. + * @param [properties] Properties to set + * @returns OperationMetadata instance + */ + public static create(properties?: google.cloud.edgecontainer.v1.IOperationMetadata): google.cloud.edgecontainer.v1.OperationMetadata; + + /** + * Encodes the specified OperationMetadata message. Does not implicitly {@link google.cloud.edgecontainer.v1.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.edgecontainer.v1.IOperationMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified OperationMetadata message, length delimited. Does not implicitly {@link google.cloud.edgecontainer.v1.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.edgecontainer.v1.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.edgecontainer.v1.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.edgecontainer.v1.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.edgecontainer.v1.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.edgecontainer.v1.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 ListClustersRequest. */ + interface IListClustersRequest { + + /** ListClustersRequest parent */ + parent?: (string|null); + + /** ListClustersRequest pageSize */ + pageSize?: (number|null); + + /** ListClustersRequest pageToken */ + pageToken?: (string|null); + + /** ListClustersRequest filter */ + filter?: (string|null); + + /** ListClustersRequest orderBy */ + orderBy?: (string|null); + } + + /** Represents a ListClustersRequest. */ + class ListClustersRequest implements IListClustersRequest { + + /** + * Constructs a new ListClustersRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.edgecontainer.v1.IListClustersRequest); + + /** ListClustersRequest parent. */ + public parent: string; + + /** ListClustersRequest pageSize. */ + public pageSize: number; + + /** ListClustersRequest pageToken. */ + public pageToken: string; + + /** ListClustersRequest filter. */ + public filter: string; + + /** ListClustersRequest orderBy. */ + public orderBy: string; + + /** + * Creates a new ListClustersRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ListClustersRequest instance + */ + public static create(properties?: google.cloud.edgecontainer.v1.IListClustersRequest): google.cloud.edgecontainer.v1.ListClustersRequest; + + /** + * Encodes the specified ListClustersRequest message. Does not implicitly {@link google.cloud.edgecontainer.v1.ListClustersRequest.verify|verify} messages. + * @param message ListClustersRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.edgecontainer.v1.IListClustersRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListClustersRequest message, length delimited. Does not implicitly {@link google.cloud.edgecontainer.v1.ListClustersRequest.verify|verify} messages. + * @param message ListClustersRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.edgecontainer.v1.IListClustersRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListClustersRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListClustersRequest + * @throws {Error} If the payload is not 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.edgecontainer.v1.ListClustersRequest; + + /** + * Decodes a ListClustersRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListClustersRequest + * @throws {Error} If the payload 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.edgecontainer.v1.ListClustersRequest; + + /** + * Verifies a ListClustersRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListClustersRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListClustersRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.edgecontainer.v1.ListClustersRequest; + + /** + * Creates a plain object from a ListClustersRequest message. Also converts values to other types if specified. + * @param message ListClustersRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.edgecontainer.v1.ListClustersRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListClustersRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListClustersRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListClustersResponse. */ + interface IListClustersResponse { + + /** ListClustersResponse clusters */ + clusters?: (google.cloud.edgecontainer.v1.ICluster[]|null); + + /** ListClustersResponse nextPageToken */ + nextPageToken?: (string|null); + + /** ListClustersResponse unreachable */ + unreachable?: (string[]|null); + } + + /** Represents a ListClustersResponse. */ + class ListClustersResponse implements IListClustersResponse { + + /** + * Constructs a new ListClustersResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.edgecontainer.v1.IListClustersResponse); + + /** ListClustersResponse clusters. */ + public clusters: google.cloud.edgecontainer.v1.ICluster[]; + + /** ListClustersResponse nextPageToken. */ + public nextPageToken: string; + + /** ListClustersResponse unreachable. */ + public unreachable: string[]; + + /** + * Creates a new ListClustersResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ListClustersResponse instance + */ + public static create(properties?: google.cloud.edgecontainer.v1.IListClustersResponse): google.cloud.edgecontainer.v1.ListClustersResponse; + + /** + * Encodes the specified ListClustersResponse message. Does not implicitly {@link google.cloud.edgecontainer.v1.ListClustersResponse.verify|verify} messages. + * @param message ListClustersResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.edgecontainer.v1.IListClustersResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListClustersResponse message, length delimited. Does not implicitly {@link google.cloud.edgecontainer.v1.ListClustersResponse.verify|verify} messages. + * @param message ListClustersResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.edgecontainer.v1.IListClustersResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListClustersResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListClustersResponse + * @throws {Error} If the payload is not 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.edgecontainer.v1.ListClustersResponse; + + /** + * Decodes a ListClustersResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListClustersResponse + * @throws {Error} If the payload 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.edgecontainer.v1.ListClustersResponse; + + /** + * Verifies a ListClustersResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListClustersResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListClustersResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.edgecontainer.v1.ListClustersResponse; + + /** + * Creates a plain object from a ListClustersResponse message. Also converts values to other types if specified. + * @param message ListClustersResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.edgecontainer.v1.ListClustersResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListClustersResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListClustersResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a GetClusterRequest. */ + interface IGetClusterRequest { + + /** GetClusterRequest name */ + name?: (string|null); + } + + /** Represents a GetClusterRequest. */ + class GetClusterRequest implements IGetClusterRequest { + + /** + * Constructs a new GetClusterRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.edgecontainer.v1.IGetClusterRequest); + + /** GetClusterRequest name. */ + public name: string; + + /** + * Creates a new GetClusterRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GetClusterRequest instance + */ + public static create(properties?: google.cloud.edgecontainer.v1.IGetClusterRequest): google.cloud.edgecontainer.v1.GetClusterRequest; + + /** + * Encodes the specified GetClusterRequest message. Does not implicitly {@link google.cloud.edgecontainer.v1.GetClusterRequest.verify|verify} messages. + * @param message GetClusterRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.edgecontainer.v1.IGetClusterRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GetClusterRequest message, length delimited. Does not implicitly {@link google.cloud.edgecontainer.v1.GetClusterRequest.verify|verify} messages. + * @param message GetClusterRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.edgecontainer.v1.IGetClusterRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GetClusterRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GetClusterRequest + * @throws {Error} If the payload is not 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.edgecontainer.v1.GetClusterRequest; + + /** + * Decodes a GetClusterRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GetClusterRequest + * @throws {Error} If the payload 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.edgecontainer.v1.GetClusterRequest; + + /** + * Verifies a GetClusterRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GetClusterRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GetClusterRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.edgecontainer.v1.GetClusterRequest; + + /** + * Creates a plain object from a GetClusterRequest message. Also converts values to other types if specified. + * @param message GetClusterRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.edgecontainer.v1.GetClusterRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GetClusterRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GetClusterRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a CreateClusterRequest. */ + interface ICreateClusterRequest { + + /** CreateClusterRequest parent */ + parent?: (string|null); + + /** CreateClusterRequest clusterId */ + clusterId?: (string|null); + + /** CreateClusterRequest cluster */ + cluster?: (google.cloud.edgecontainer.v1.ICluster|null); + + /** CreateClusterRequest requestId */ + requestId?: (string|null); + } + + /** Represents a CreateClusterRequest. */ + class CreateClusterRequest implements ICreateClusterRequest { + + /** + * Constructs a new CreateClusterRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.edgecontainer.v1.ICreateClusterRequest); + + /** CreateClusterRequest parent. */ + public parent: string; + + /** CreateClusterRequest clusterId. */ + public clusterId: string; + + /** CreateClusterRequest cluster. */ + public cluster?: (google.cloud.edgecontainer.v1.ICluster|null); + + /** CreateClusterRequest requestId. */ + public requestId: string; + + /** + * Creates a new CreateClusterRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns CreateClusterRequest instance + */ + public static create(properties?: google.cloud.edgecontainer.v1.ICreateClusterRequest): google.cloud.edgecontainer.v1.CreateClusterRequest; + + /** + * Encodes the specified CreateClusterRequest message. Does not implicitly {@link google.cloud.edgecontainer.v1.CreateClusterRequest.verify|verify} messages. + * @param message CreateClusterRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.edgecontainer.v1.ICreateClusterRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CreateClusterRequest message, length delimited. Does not implicitly {@link google.cloud.edgecontainer.v1.CreateClusterRequest.verify|verify} messages. + * @param message CreateClusterRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.edgecontainer.v1.ICreateClusterRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CreateClusterRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CreateClusterRequest + * @throws {Error} If the payload is not 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.edgecontainer.v1.CreateClusterRequest; + + /** + * Decodes a CreateClusterRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CreateClusterRequest + * @throws {Error} If the payload 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.edgecontainer.v1.CreateClusterRequest; + + /** + * Verifies a CreateClusterRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CreateClusterRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CreateClusterRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.edgecontainer.v1.CreateClusterRequest; + + /** + * Creates a plain object from a CreateClusterRequest message. Also converts values to other types if specified. + * @param message CreateClusterRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.edgecontainer.v1.CreateClusterRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CreateClusterRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CreateClusterRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an UpdateClusterRequest. */ + interface IUpdateClusterRequest { + + /** UpdateClusterRequest updateMask */ + updateMask?: (google.protobuf.IFieldMask|null); + + /** UpdateClusterRequest cluster */ + cluster?: (google.cloud.edgecontainer.v1.ICluster|null); + + /** UpdateClusterRequest requestId */ + requestId?: (string|null); + } + + /** Represents an UpdateClusterRequest. */ + class UpdateClusterRequest implements IUpdateClusterRequest { + + /** + * Constructs a new UpdateClusterRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.edgecontainer.v1.IUpdateClusterRequest); + + /** UpdateClusterRequest updateMask. */ + public updateMask?: (google.protobuf.IFieldMask|null); + + /** UpdateClusterRequest cluster. */ + public cluster?: (google.cloud.edgecontainer.v1.ICluster|null); + + /** UpdateClusterRequest requestId. */ + public requestId: string; + + /** + * Creates a new UpdateClusterRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns UpdateClusterRequest instance + */ + public static create(properties?: google.cloud.edgecontainer.v1.IUpdateClusterRequest): google.cloud.edgecontainer.v1.UpdateClusterRequest; + + /** + * Encodes the specified UpdateClusterRequest message. Does not implicitly {@link google.cloud.edgecontainer.v1.UpdateClusterRequest.verify|verify} messages. + * @param message UpdateClusterRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.edgecontainer.v1.IUpdateClusterRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified UpdateClusterRequest message, length delimited. Does not implicitly {@link google.cloud.edgecontainer.v1.UpdateClusterRequest.verify|verify} messages. + * @param message UpdateClusterRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.edgecontainer.v1.IUpdateClusterRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an UpdateClusterRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns UpdateClusterRequest + * @throws {Error} If the payload is not 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.edgecontainer.v1.UpdateClusterRequest; + + /** + * Decodes an UpdateClusterRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns UpdateClusterRequest + * @throws {Error} If the payload 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.edgecontainer.v1.UpdateClusterRequest; + + /** + * Verifies an UpdateClusterRequest message. + * @param message Plain 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 UpdateClusterRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns UpdateClusterRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.edgecontainer.v1.UpdateClusterRequest; + + /** + * Creates a plain object from an UpdateClusterRequest message. Also converts values to other types if specified. + * @param message UpdateClusterRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.edgecontainer.v1.UpdateClusterRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this UpdateClusterRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for UpdateClusterRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a DeleteClusterRequest. */ + interface IDeleteClusterRequest { + + /** DeleteClusterRequest name */ + name?: (string|null); + + /** DeleteClusterRequest requestId */ + requestId?: (string|null); + } + + /** Represents a DeleteClusterRequest. */ + class DeleteClusterRequest implements IDeleteClusterRequest { + + /** + * Constructs a new DeleteClusterRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.edgecontainer.v1.IDeleteClusterRequest); + + /** DeleteClusterRequest name. */ + public name: string; + + /** DeleteClusterRequest requestId. */ + public requestId: string; + + /** + * Creates a new DeleteClusterRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns DeleteClusterRequest instance + */ + public static create(properties?: google.cloud.edgecontainer.v1.IDeleteClusterRequest): google.cloud.edgecontainer.v1.DeleteClusterRequest; + + /** + * Encodes the specified DeleteClusterRequest message. Does not implicitly {@link google.cloud.edgecontainer.v1.DeleteClusterRequest.verify|verify} messages. + * @param message DeleteClusterRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.edgecontainer.v1.IDeleteClusterRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DeleteClusterRequest message, length delimited. Does not implicitly {@link google.cloud.edgecontainer.v1.DeleteClusterRequest.verify|verify} messages. + * @param message DeleteClusterRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.edgecontainer.v1.IDeleteClusterRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DeleteClusterRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DeleteClusterRequest + * @throws {Error} If the payload is not 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.edgecontainer.v1.DeleteClusterRequest; + + /** + * Decodes a DeleteClusterRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DeleteClusterRequest + * @throws {Error} If the payload 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.edgecontainer.v1.DeleteClusterRequest; + + /** + * Verifies a DeleteClusterRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DeleteClusterRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DeleteClusterRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.edgecontainer.v1.DeleteClusterRequest; + + /** + * Creates a plain object from a DeleteClusterRequest message. Also converts values to other types if specified. + * @param message DeleteClusterRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.edgecontainer.v1.DeleteClusterRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DeleteClusterRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DeleteClusterRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a GenerateAccessTokenRequest. */ + interface IGenerateAccessTokenRequest { + + /** GenerateAccessTokenRequest cluster */ + cluster?: (string|null); + } + + /** Represents a GenerateAccessTokenRequest. */ + class GenerateAccessTokenRequest implements IGenerateAccessTokenRequest { + + /** + * Constructs a new GenerateAccessTokenRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.edgecontainer.v1.IGenerateAccessTokenRequest); + + /** GenerateAccessTokenRequest cluster. */ + public cluster: string; + + /** + * Creates a new GenerateAccessTokenRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GenerateAccessTokenRequest instance + */ + public static create(properties?: google.cloud.edgecontainer.v1.IGenerateAccessTokenRequest): google.cloud.edgecontainer.v1.GenerateAccessTokenRequest; + + /** + * Encodes the specified GenerateAccessTokenRequest message. Does not implicitly {@link google.cloud.edgecontainer.v1.GenerateAccessTokenRequest.verify|verify} messages. + * @param message GenerateAccessTokenRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.edgecontainer.v1.IGenerateAccessTokenRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GenerateAccessTokenRequest message, length delimited. Does not implicitly {@link google.cloud.edgecontainer.v1.GenerateAccessTokenRequest.verify|verify} messages. + * @param message GenerateAccessTokenRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.edgecontainer.v1.IGenerateAccessTokenRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GenerateAccessTokenRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GenerateAccessTokenRequest + * @throws {Error} If the payload is not 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.edgecontainer.v1.GenerateAccessTokenRequest; + + /** + * Decodes a GenerateAccessTokenRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GenerateAccessTokenRequest + * @throws {Error} If the payload 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.edgecontainer.v1.GenerateAccessTokenRequest; + + /** + * Verifies a GenerateAccessTokenRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GenerateAccessTokenRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GenerateAccessTokenRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.edgecontainer.v1.GenerateAccessTokenRequest; + + /** + * Creates a plain object from a GenerateAccessTokenRequest message. Also converts values to other types if specified. + * @param message GenerateAccessTokenRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.edgecontainer.v1.GenerateAccessTokenRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GenerateAccessTokenRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GenerateAccessTokenRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a GenerateAccessTokenResponse. */ + interface IGenerateAccessTokenResponse { + + /** GenerateAccessTokenResponse accessToken */ + accessToken?: (string|null); + + /** GenerateAccessTokenResponse expireTime */ + expireTime?: (google.protobuf.ITimestamp|null); + } + + /** Represents a GenerateAccessTokenResponse. */ + class GenerateAccessTokenResponse implements IGenerateAccessTokenResponse { + + /** + * Constructs a new GenerateAccessTokenResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.edgecontainer.v1.IGenerateAccessTokenResponse); + + /** GenerateAccessTokenResponse accessToken. */ + public accessToken: string; + + /** GenerateAccessTokenResponse expireTime. */ + public expireTime?: (google.protobuf.ITimestamp|null); + + /** + * Creates a new GenerateAccessTokenResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns GenerateAccessTokenResponse instance + */ + public static create(properties?: google.cloud.edgecontainer.v1.IGenerateAccessTokenResponse): google.cloud.edgecontainer.v1.GenerateAccessTokenResponse; + + /** + * Encodes the specified GenerateAccessTokenResponse message. Does not implicitly {@link google.cloud.edgecontainer.v1.GenerateAccessTokenResponse.verify|verify} messages. + * @param message GenerateAccessTokenResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.edgecontainer.v1.IGenerateAccessTokenResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GenerateAccessTokenResponse message, length delimited. Does not implicitly {@link google.cloud.edgecontainer.v1.GenerateAccessTokenResponse.verify|verify} messages. + * @param message GenerateAccessTokenResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.edgecontainer.v1.IGenerateAccessTokenResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GenerateAccessTokenResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GenerateAccessTokenResponse + * @throws {Error} If the payload is not 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.edgecontainer.v1.GenerateAccessTokenResponse; + + /** + * Decodes a GenerateAccessTokenResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GenerateAccessTokenResponse + * @throws {Error} If the payload 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.edgecontainer.v1.GenerateAccessTokenResponse; + + /** + * Verifies a GenerateAccessTokenResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GenerateAccessTokenResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GenerateAccessTokenResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.edgecontainer.v1.GenerateAccessTokenResponse; + + /** + * Creates a plain object from a GenerateAccessTokenResponse message. Also converts values to other types if specified. + * @param message GenerateAccessTokenResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.edgecontainer.v1.GenerateAccessTokenResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GenerateAccessTokenResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GenerateAccessTokenResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListNodePoolsRequest. */ + interface IListNodePoolsRequest { + + /** ListNodePoolsRequest parent */ + parent?: (string|null); + + /** ListNodePoolsRequest pageSize */ + pageSize?: (number|null); + + /** ListNodePoolsRequest pageToken */ + pageToken?: (string|null); + + /** ListNodePoolsRequest filter */ + filter?: (string|null); + + /** ListNodePoolsRequest orderBy */ + orderBy?: (string|null); + } + + /** Represents a ListNodePoolsRequest. */ + class ListNodePoolsRequest implements IListNodePoolsRequest { + + /** + * Constructs a new ListNodePoolsRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.edgecontainer.v1.IListNodePoolsRequest); + + /** ListNodePoolsRequest parent. */ + public parent: string; + + /** ListNodePoolsRequest pageSize. */ + public pageSize: number; + + /** ListNodePoolsRequest pageToken. */ + public pageToken: string; + + /** ListNodePoolsRequest filter. */ + public filter: string; + + /** ListNodePoolsRequest orderBy. */ + public orderBy: string; + + /** + * Creates a new ListNodePoolsRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ListNodePoolsRequest instance + */ + public static create(properties?: google.cloud.edgecontainer.v1.IListNodePoolsRequest): google.cloud.edgecontainer.v1.ListNodePoolsRequest; + + /** + * Encodes the specified ListNodePoolsRequest message. Does not implicitly {@link google.cloud.edgecontainer.v1.ListNodePoolsRequest.verify|verify} messages. + * @param message ListNodePoolsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.edgecontainer.v1.IListNodePoolsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListNodePoolsRequest message, length delimited. Does not implicitly {@link google.cloud.edgecontainer.v1.ListNodePoolsRequest.verify|verify} messages. + * @param message ListNodePoolsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.edgecontainer.v1.IListNodePoolsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListNodePoolsRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListNodePoolsRequest + * @throws {Error} If the payload is not 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.edgecontainer.v1.ListNodePoolsRequest; + + /** + * Decodes a ListNodePoolsRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListNodePoolsRequest + * @throws {Error} If the payload 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.edgecontainer.v1.ListNodePoolsRequest; + + /** + * Verifies a ListNodePoolsRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListNodePoolsRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListNodePoolsRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.edgecontainer.v1.ListNodePoolsRequest; + + /** + * Creates a plain object from a ListNodePoolsRequest message. Also converts values to other types if specified. + * @param message ListNodePoolsRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.edgecontainer.v1.ListNodePoolsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListNodePoolsRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListNodePoolsRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListNodePoolsResponse. */ + interface IListNodePoolsResponse { + + /** ListNodePoolsResponse nodePools */ + nodePools?: (google.cloud.edgecontainer.v1.INodePool[]|null); + + /** ListNodePoolsResponse nextPageToken */ + nextPageToken?: (string|null); + + /** ListNodePoolsResponse unreachable */ + unreachable?: (string[]|null); + } + + /** Represents a ListNodePoolsResponse. */ + class ListNodePoolsResponse implements IListNodePoolsResponse { + + /** + * Constructs a new ListNodePoolsResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.edgecontainer.v1.IListNodePoolsResponse); + + /** ListNodePoolsResponse nodePools. */ + public nodePools: google.cloud.edgecontainer.v1.INodePool[]; + + /** ListNodePoolsResponse nextPageToken. */ + public nextPageToken: string; + + /** ListNodePoolsResponse unreachable. */ + public unreachable: string[]; + + /** + * Creates a new ListNodePoolsResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ListNodePoolsResponse instance + */ + public static create(properties?: google.cloud.edgecontainer.v1.IListNodePoolsResponse): google.cloud.edgecontainer.v1.ListNodePoolsResponse; + + /** + * Encodes the specified ListNodePoolsResponse message. Does not implicitly {@link google.cloud.edgecontainer.v1.ListNodePoolsResponse.verify|verify} messages. + * @param message ListNodePoolsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.edgecontainer.v1.IListNodePoolsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListNodePoolsResponse message, length delimited. Does not implicitly {@link google.cloud.edgecontainer.v1.ListNodePoolsResponse.verify|verify} messages. + * @param message ListNodePoolsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.edgecontainer.v1.IListNodePoolsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListNodePoolsResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListNodePoolsResponse + * @throws {Error} If the payload is not 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.edgecontainer.v1.ListNodePoolsResponse; + + /** + * Decodes a ListNodePoolsResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListNodePoolsResponse + * @throws {Error} If the payload 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.edgecontainer.v1.ListNodePoolsResponse; + + /** + * Verifies a ListNodePoolsResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListNodePoolsResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListNodePoolsResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.edgecontainer.v1.ListNodePoolsResponse; + + /** + * Creates a plain object from a ListNodePoolsResponse message. Also converts values to other types if specified. + * @param message ListNodePoolsResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.edgecontainer.v1.ListNodePoolsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListNodePoolsResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListNodePoolsResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a GetNodePoolRequest. */ + interface IGetNodePoolRequest { + + /** GetNodePoolRequest name */ + name?: (string|null); + } + + /** Represents a GetNodePoolRequest. */ + class GetNodePoolRequest implements IGetNodePoolRequest { + + /** + * Constructs a new GetNodePoolRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.edgecontainer.v1.IGetNodePoolRequest); + + /** GetNodePoolRequest name. */ + public name: string; + + /** + * Creates a new GetNodePoolRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GetNodePoolRequest instance + */ + public static create(properties?: google.cloud.edgecontainer.v1.IGetNodePoolRequest): google.cloud.edgecontainer.v1.GetNodePoolRequest; + + /** + * Encodes the specified GetNodePoolRequest message. Does not implicitly {@link google.cloud.edgecontainer.v1.GetNodePoolRequest.verify|verify} messages. + * @param message GetNodePoolRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.edgecontainer.v1.IGetNodePoolRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GetNodePoolRequest message, length delimited. Does not implicitly {@link google.cloud.edgecontainer.v1.GetNodePoolRequest.verify|verify} messages. + * @param message GetNodePoolRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.edgecontainer.v1.IGetNodePoolRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GetNodePoolRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GetNodePoolRequest + * @throws {Error} If the payload is not 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.edgecontainer.v1.GetNodePoolRequest; + + /** + * Decodes a GetNodePoolRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GetNodePoolRequest + * @throws {Error} If the payload 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.edgecontainer.v1.GetNodePoolRequest; + + /** + * Verifies a GetNodePoolRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GetNodePoolRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GetNodePoolRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.edgecontainer.v1.GetNodePoolRequest; + + /** + * Creates a plain object from a GetNodePoolRequest message. Also converts values to other types if specified. + * @param message GetNodePoolRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.edgecontainer.v1.GetNodePoolRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GetNodePoolRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GetNodePoolRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a CreateNodePoolRequest. */ + interface ICreateNodePoolRequest { + + /** CreateNodePoolRequest parent */ + parent?: (string|null); + + /** CreateNodePoolRequest nodePoolId */ + nodePoolId?: (string|null); + + /** CreateNodePoolRequest nodePool */ + nodePool?: (google.cloud.edgecontainer.v1.INodePool|null); + + /** CreateNodePoolRequest requestId */ + requestId?: (string|null); + } + + /** Represents a CreateNodePoolRequest. */ + class CreateNodePoolRequest implements ICreateNodePoolRequest { + + /** + * Constructs a new CreateNodePoolRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.edgecontainer.v1.ICreateNodePoolRequest); + + /** CreateNodePoolRequest parent. */ + public parent: string; + + /** CreateNodePoolRequest nodePoolId. */ + public nodePoolId: string; + + /** CreateNodePoolRequest nodePool. */ + public nodePool?: (google.cloud.edgecontainer.v1.INodePool|null); + + /** CreateNodePoolRequest requestId. */ + public requestId: string; + + /** + * Creates a new CreateNodePoolRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns CreateNodePoolRequest instance + */ + public static create(properties?: google.cloud.edgecontainer.v1.ICreateNodePoolRequest): google.cloud.edgecontainer.v1.CreateNodePoolRequest; + + /** + * Encodes the specified CreateNodePoolRequest message. Does not implicitly {@link google.cloud.edgecontainer.v1.CreateNodePoolRequest.verify|verify} messages. + * @param message CreateNodePoolRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.edgecontainer.v1.ICreateNodePoolRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CreateNodePoolRequest message, length delimited. Does not implicitly {@link google.cloud.edgecontainer.v1.CreateNodePoolRequest.verify|verify} messages. + * @param message CreateNodePoolRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.edgecontainer.v1.ICreateNodePoolRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CreateNodePoolRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CreateNodePoolRequest + * @throws {Error} If the payload is not 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.edgecontainer.v1.CreateNodePoolRequest; + + /** + * Decodes a CreateNodePoolRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CreateNodePoolRequest + * @throws {Error} If the payload 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.edgecontainer.v1.CreateNodePoolRequest; + + /** + * Verifies a CreateNodePoolRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CreateNodePoolRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CreateNodePoolRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.edgecontainer.v1.CreateNodePoolRequest; + + /** + * Creates a plain object from a CreateNodePoolRequest message. Also converts values to other types if specified. + * @param message CreateNodePoolRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.edgecontainer.v1.CreateNodePoolRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CreateNodePoolRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CreateNodePoolRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an UpdateNodePoolRequest. */ + interface IUpdateNodePoolRequest { + + /** UpdateNodePoolRequest updateMask */ + updateMask?: (google.protobuf.IFieldMask|null); + + /** UpdateNodePoolRequest nodePool */ + nodePool?: (google.cloud.edgecontainer.v1.INodePool|null); + + /** UpdateNodePoolRequest requestId */ + requestId?: (string|null); + } + + /** Represents an UpdateNodePoolRequest. */ + class UpdateNodePoolRequest implements IUpdateNodePoolRequest { + + /** + * Constructs a new UpdateNodePoolRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.edgecontainer.v1.IUpdateNodePoolRequest); + + /** UpdateNodePoolRequest updateMask. */ + public updateMask?: (google.protobuf.IFieldMask|null); + + /** UpdateNodePoolRequest nodePool. */ + public nodePool?: (google.cloud.edgecontainer.v1.INodePool|null); + + /** UpdateNodePoolRequest requestId. */ + public requestId: string; + + /** + * Creates a new UpdateNodePoolRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns UpdateNodePoolRequest instance + */ + public static create(properties?: google.cloud.edgecontainer.v1.IUpdateNodePoolRequest): google.cloud.edgecontainer.v1.UpdateNodePoolRequest; + + /** + * Encodes the specified UpdateNodePoolRequest message. Does not implicitly {@link google.cloud.edgecontainer.v1.UpdateNodePoolRequest.verify|verify} messages. + * @param message UpdateNodePoolRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.edgecontainer.v1.IUpdateNodePoolRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified UpdateNodePoolRequest message, length delimited. Does not implicitly {@link google.cloud.edgecontainer.v1.UpdateNodePoolRequest.verify|verify} messages. + * @param message UpdateNodePoolRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.edgecontainer.v1.IUpdateNodePoolRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an UpdateNodePoolRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns UpdateNodePoolRequest + * @throws {Error} If the payload is not 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.edgecontainer.v1.UpdateNodePoolRequest; + + /** + * Decodes an UpdateNodePoolRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns UpdateNodePoolRequest + * @throws {Error} If the payload 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.edgecontainer.v1.UpdateNodePoolRequest; + + /** + * Verifies an UpdateNodePoolRequest message. + * @param message Plain 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 UpdateNodePoolRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns UpdateNodePoolRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.edgecontainer.v1.UpdateNodePoolRequest; + + /** + * Creates a plain object from an UpdateNodePoolRequest message. Also converts values to other types if specified. + * @param message UpdateNodePoolRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.edgecontainer.v1.UpdateNodePoolRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this UpdateNodePoolRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for UpdateNodePoolRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a DeleteNodePoolRequest. */ + interface IDeleteNodePoolRequest { + + /** DeleteNodePoolRequest name */ + name?: (string|null); + + /** DeleteNodePoolRequest requestId */ + requestId?: (string|null); + } + + /** Represents a DeleteNodePoolRequest. */ + class DeleteNodePoolRequest implements IDeleteNodePoolRequest { + + /** + * Constructs a new DeleteNodePoolRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.edgecontainer.v1.IDeleteNodePoolRequest); + + /** DeleteNodePoolRequest name. */ + public name: string; + + /** DeleteNodePoolRequest requestId. */ + public requestId: string; + + /** + * Creates a new DeleteNodePoolRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns DeleteNodePoolRequest instance + */ + public static create(properties?: google.cloud.edgecontainer.v1.IDeleteNodePoolRequest): google.cloud.edgecontainer.v1.DeleteNodePoolRequest; + + /** + * Encodes the specified DeleteNodePoolRequest message. Does not implicitly {@link google.cloud.edgecontainer.v1.DeleteNodePoolRequest.verify|verify} messages. + * @param message DeleteNodePoolRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.edgecontainer.v1.IDeleteNodePoolRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DeleteNodePoolRequest message, length delimited. Does not implicitly {@link google.cloud.edgecontainer.v1.DeleteNodePoolRequest.verify|verify} messages. + * @param message DeleteNodePoolRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.edgecontainer.v1.IDeleteNodePoolRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DeleteNodePoolRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DeleteNodePoolRequest + * @throws {Error} If the payload is not 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.edgecontainer.v1.DeleteNodePoolRequest; + + /** + * Decodes a DeleteNodePoolRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DeleteNodePoolRequest + * @throws {Error} If the payload 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.edgecontainer.v1.DeleteNodePoolRequest; + + /** + * Verifies a DeleteNodePoolRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DeleteNodePoolRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DeleteNodePoolRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.edgecontainer.v1.DeleteNodePoolRequest; + + /** + * Creates a plain object from a DeleteNodePoolRequest message. Also converts values to other types if specified. + * @param message DeleteNodePoolRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.edgecontainer.v1.DeleteNodePoolRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DeleteNodePoolRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DeleteNodePoolRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListMachinesRequest. */ + interface IListMachinesRequest { + + /** ListMachinesRequest parent */ + parent?: (string|null); + + /** ListMachinesRequest pageSize */ + pageSize?: (number|null); + + /** ListMachinesRequest pageToken */ + pageToken?: (string|null); + + /** ListMachinesRequest filter */ + filter?: (string|null); + + /** ListMachinesRequest orderBy */ + orderBy?: (string|null); + } + + /** Represents a ListMachinesRequest. */ + class ListMachinesRequest implements IListMachinesRequest { + + /** + * Constructs a new ListMachinesRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.edgecontainer.v1.IListMachinesRequest); + + /** ListMachinesRequest parent. */ + public parent: string; + + /** ListMachinesRequest pageSize. */ + public pageSize: number; + + /** ListMachinesRequest pageToken. */ + public pageToken: string; + + /** ListMachinesRequest filter. */ + public filter: string; + + /** ListMachinesRequest orderBy. */ + public orderBy: string; + + /** + * Creates a new ListMachinesRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ListMachinesRequest instance + */ + public static create(properties?: google.cloud.edgecontainer.v1.IListMachinesRequest): google.cloud.edgecontainer.v1.ListMachinesRequest; + + /** + * Encodes the specified ListMachinesRequest message. Does not implicitly {@link google.cloud.edgecontainer.v1.ListMachinesRequest.verify|verify} messages. + * @param message ListMachinesRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.edgecontainer.v1.IListMachinesRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListMachinesRequest message, length delimited. Does not implicitly {@link google.cloud.edgecontainer.v1.ListMachinesRequest.verify|verify} messages. + * @param message ListMachinesRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.edgecontainer.v1.IListMachinesRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListMachinesRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListMachinesRequest + * @throws {Error} If the payload is not 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.edgecontainer.v1.ListMachinesRequest; + + /** + * Decodes a ListMachinesRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListMachinesRequest + * @throws {Error} If the payload 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.edgecontainer.v1.ListMachinesRequest; + + /** + * Verifies a ListMachinesRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListMachinesRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListMachinesRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.edgecontainer.v1.ListMachinesRequest; + + /** + * Creates a plain object from a ListMachinesRequest message. Also converts values to other types if specified. + * @param message ListMachinesRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.edgecontainer.v1.ListMachinesRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListMachinesRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListMachinesRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListMachinesResponse. */ + interface IListMachinesResponse { + + /** ListMachinesResponse machines */ + machines?: (google.cloud.edgecontainer.v1.IMachine[]|null); + + /** ListMachinesResponse nextPageToken */ + nextPageToken?: (string|null); + + /** ListMachinesResponse unreachable */ + unreachable?: (string[]|null); + } + + /** Represents a ListMachinesResponse. */ + class ListMachinesResponse implements IListMachinesResponse { + + /** + * Constructs a new ListMachinesResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.edgecontainer.v1.IListMachinesResponse); + + /** ListMachinesResponse machines. */ + public machines: google.cloud.edgecontainer.v1.IMachine[]; + + /** ListMachinesResponse nextPageToken. */ + public nextPageToken: string; + + /** ListMachinesResponse unreachable. */ + public unreachable: string[]; + + /** + * Creates a new ListMachinesResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ListMachinesResponse instance + */ + public static create(properties?: google.cloud.edgecontainer.v1.IListMachinesResponse): google.cloud.edgecontainer.v1.ListMachinesResponse; + + /** + * Encodes the specified ListMachinesResponse message. Does not implicitly {@link google.cloud.edgecontainer.v1.ListMachinesResponse.verify|verify} messages. + * @param message ListMachinesResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.edgecontainer.v1.IListMachinesResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListMachinesResponse message, length delimited. Does not implicitly {@link google.cloud.edgecontainer.v1.ListMachinesResponse.verify|verify} messages. + * @param message ListMachinesResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.edgecontainer.v1.IListMachinesResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListMachinesResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListMachinesResponse + * @throws {Error} If the payload is not 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.edgecontainer.v1.ListMachinesResponse; + + /** + * Decodes a ListMachinesResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListMachinesResponse + * @throws {Error} If the payload 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.edgecontainer.v1.ListMachinesResponse; + + /** + * Verifies a ListMachinesResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListMachinesResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListMachinesResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.edgecontainer.v1.ListMachinesResponse; + + /** + * Creates a plain object from a ListMachinesResponse message. Also converts values to other types if specified. + * @param message ListMachinesResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.edgecontainer.v1.ListMachinesResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListMachinesResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListMachinesResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a GetMachineRequest. */ + interface IGetMachineRequest { + + /** GetMachineRequest name */ + name?: (string|null); + } + + /** Represents a GetMachineRequest. */ + class GetMachineRequest implements IGetMachineRequest { + + /** + * Constructs a new GetMachineRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.edgecontainer.v1.IGetMachineRequest); + + /** GetMachineRequest name. */ + public name: string; + + /** + * Creates a new GetMachineRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GetMachineRequest instance + */ + public static create(properties?: google.cloud.edgecontainer.v1.IGetMachineRequest): google.cloud.edgecontainer.v1.GetMachineRequest; + + /** + * Encodes the specified GetMachineRequest message. Does not implicitly {@link google.cloud.edgecontainer.v1.GetMachineRequest.verify|verify} messages. + * @param message GetMachineRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.edgecontainer.v1.IGetMachineRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GetMachineRequest message, length delimited. Does not implicitly {@link google.cloud.edgecontainer.v1.GetMachineRequest.verify|verify} messages. + * @param message GetMachineRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.edgecontainer.v1.IGetMachineRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GetMachineRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GetMachineRequest + * @throws {Error} If the payload is not 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.edgecontainer.v1.GetMachineRequest; + + /** + * Decodes a GetMachineRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GetMachineRequest + * @throws {Error} If the payload 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.edgecontainer.v1.GetMachineRequest; + + /** + * Verifies a GetMachineRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GetMachineRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GetMachineRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.edgecontainer.v1.GetMachineRequest; + + /** + * Creates a plain object from a GetMachineRequest message. Also converts values to other types if specified. + * @param message GetMachineRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.edgecontainer.v1.GetMachineRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GetMachineRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GetMachineRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListVpnConnectionsRequest. */ + interface IListVpnConnectionsRequest { + + /** ListVpnConnectionsRequest parent */ + parent?: (string|null); + + /** ListVpnConnectionsRequest pageSize */ + pageSize?: (number|null); + + /** ListVpnConnectionsRequest pageToken */ + pageToken?: (string|null); + + /** ListVpnConnectionsRequest filter */ + filter?: (string|null); + + /** ListVpnConnectionsRequest orderBy */ + orderBy?: (string|null); + } + + /** Represents a ListVpnConnectionsRequest. */ + class ListVpnConnectionsRequest implements IListVpnConnectionsRequest { + + /** + * Constructs a new ListVpnConnectionsRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.edgecontainer.v1.IListVpnConnectionsRequest); + + /** ListVpnConnectionsRequest parent. */ + public parent: string; + + /** ListVpnConnectionsRequest pageSize. */ + public pageSize: number; + + /** ListVpnConnectionsRequest pageToken. */ + public pageToken: string; + + /** ListVpnConnectionsRequest filter. */ + public filter: string; + + /** ListVpnConnectionsRequest orderBy. */ + public orderBy: string; + + /** + * Creates a new ListVpnConnectionsRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ListVpnConnectionsRequest instance + */ + public static create(properties?: google.cloud.edgecontainer.v1.IListVpnConnectionsRequest): google.cloud.edgecontainer.v1.ListVpnConnectionsRequest; + + /** + * Encodes the specified ListVpnConnectionsRequest message. Does not implicitly {@link google.cloud.edgecontainer.v1.ListVpnConnectionsRequest.verify|verify} messages. + * @param message ListVpnConnectionsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.edgecontainer.v1.IListVpnConnectionsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListVpnConnectionsRequest message, length delimited. Does not implicitly {@link google.cloud.edgecontainer.v1.ListVpnConnectionsRequest.verify|verify} messages. + * @param message ListVpnConnectionsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.edgecontainer.v1.IListVpnConnectionsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListVpnConnectionsRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListVpnConnectionsRequest + * @throws {Error} If the payload is not 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.edgecontainer.v1.ListVpnConnectionsRequest; + + /** + * Decodes a ListVpnConnectionsRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListVpnConnectionsRequest + * @throws {Error} If the payload 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.edgecontainer.v1.ListVpnConnectionsRequest; + + /** + * Verifies a ListVpnConnectionsRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListVpnConnectionsRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListVpnConnectionsRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.edgecontainer.v1.ListVpnConnectionsRequest; + + /** + * Creates a plain object from a ListVpnConnectionsRequest message. Also converts values to other types if specified. + * @param message ListVpnConnectionsRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.edgecontainer.v1.ListVpnConnectionsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListVpnConnectionsRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListVpnConnectionsRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListVpnConnectionsResponse. */ + interface IListVpnConnectionsResponse { + + /** ListVpnConnectionsResponse vpnConnections */ + vpnConnections?: (google.cloud.edgecontainer.v1.IVpnConnection[]|null); + + /** ListVpnConnectionsResponse nextPageToken */ + nextPageToken?: (string|null); + + /** ListVpnConnectionsResponse unreachable */ + unreachable?: (string[]|null); + } + + /** Represents a ListVpnConnectionsResponse. */ + class ListVpnConnectionsResponse implements IListVpnConnectionsResponse { + + /** + * Constructs a new ListVpnConnectionsResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.edgecontainer.v1.IListVpnConnectionsResponse); + + /** ListVpnConnectionsResponse vpnConnections. */ + public vpnConnections: google.cloud.edgecontainer.v1.IVpnConnection[]; + + /** ListVpnConnectionsResponse nextPageToken. */ + public nextPageToken: string; + + /** ListVpnConnectionsResponse unreachable. */ + public unreachable: string[]; + + /** + * Creates a new ListVpnConnectionsResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ListVpnConnectionsResponse instance + */ + public static create(properties?: google.cloud.edgecontainer.v1.IListVpnConnectionsResponse): google.cloud.edgecontainer.v1.ListVpnConnectionsResponse; + + /** + * Encodes the specified ListVpnConnectionsResponse message. Does not implicitly {@link google.cloud.edgecontainer.v1.ListVpnConnectionsResponse.verify|verify} messages. + * @param message ListVpnConnectionsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.edgecontainer.v1.IListVpnConnectionsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListVpnConnectionsResponse message, length delimited. Does not implicitly {@link google.cloud.edgecontainer.v1.ListVpnConnectionsResponse.verify|verify} messages. + * @param message ListVpnConnectionsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.edgecontainer.v1.IListVpnConnectionsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListVpnConnectionsResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListVpnConnectionsResponse + * @throws {Error} If the payload is not 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.edgecontainer.v1.ListVpnConnectionsResponse; + + /** + * Decodes a ListVpnConnectionsResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListVpnConnectionsResponse + * @throws {Error} If the payload 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.edgecontainer.v1.ListVpnConnectionsResponse; + + /** + * Verifies a ListVpnConnectionsResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListVpnConnectionsResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListVpnConnectionsResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.edgecontainer.v1.ListVpnConnectionsResponse; + + /** + * Creates a plain object from a ListVpnConnectionsResponse message. Also converts values to other types if specified. + * @param message ListVpnConnectionsResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.edgecontainer.v1.ListVpnConnectionsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListVpnConnectionsResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListVpnConnectionsResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a GetVpnConnectionRequest. */ + interface IGetVpnConnectionRequest { + + /** GetVpnConnectionRequest name */ + name?: (string|null); + } + + /** Represents a GetVpnConnectionRequest. */ + class GetVpnConnectionRequest implements IGetVpnConnectionRequest { + + /** + * Constructs a new GetVpnConnectionRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.edgecontainer.v1.IGetVpnConnectionRequest); + + /** GetVpnConnectionRequest name. */ + public name: string; + + /** + * Creates a new GetVpnConnectionRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GetVpnConnectionRequest instance + */ + public static create(properties?: google.cloud.edgecontainer.v1.IGetVpnConnectionRequest): google.cloud.edgecontainer.v1.GetVpnConnectionRequest; + + /** + * Encodes the specified GetVpnConnectionRequest message. Does not implicitly {@link google.cloud.edgecontainer.v1.GetVpnConnectionRequest.verify|verify} messages. + * @param message GetVpnConnectionRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.edgecontainer.v1.IGetVpnConnectionRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GetVpnConnectionRequest message, length delimited. Does not implicitly {@link google.cloud.edgecontainer.v1.GetVpnConnectionRequest.verify|verify} messages. + * @param message GetVpnConnectionRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.edgecontainer.v1.IGetVpnConnectionRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GetVpnConnectionRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GetVpnConnectionRequest + * @throws {Error} If the payload is not 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.edgecontainer.v1.GetVpnConnectionRequest; + + /** + * Decodes a GetVpnConnectionRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GetVpnConnectionRequest + * @throws {Error} If the payload 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.edgecontainer.v1.GetVpnConnectionRequest; + + /** + * Verifies a GetVpnConnectionRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GetVpnConnectionRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GetVpnConnectionRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.edgecontainer.v1.GetVpnConnectionRequest; + + /** + * Creates a plain object from a GetVpnConnectionRequest message. Also converts values to other types if specified. + * @param message GetVpnConnectionRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.edgecontainer.v1.GetVpnConnectionRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GetVpnConnectionRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GetVpnConnectionRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a CreateVpnConnectionRequest. */ + interface ICreateVpnConnectionRequest { + + /** CreateVpnConnectionRequest parent */ + parent?: (string|null); + + /** CreateVpnConnectionRequest vpnConnectionId */ + vpnConnectionId?: (string|null); + + /** CreateVpnConnectionRequest vpnConnection */ + vpnConnection?: (google.cloud.edgecontainer.v1.IVpnConnection|null); + + /** CreateVpnConnectionRequest requestId */ + requestId?: (string|null); + } + + /** Represents a CreateVpnConnectionRequest. */ + class CreateVpnConnectionRequest implements ICreateVpnConnectionRequest { + + /** + * Constructs a new CreateVpnConnectionRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.edgecontainer.v1.ICreateVpnConnectionRequest); + + /** CreateVpnConnectionRequest parent. */ + public parent: string; + + /** CreateVpnConnectionRequest vpnConnectionId. */ + public vpnConnectionId: string; + + /** CreateVpnConnectionRequest vpnConnection. */ + public vpnConnection?: (google.cloud.edgecontainer.v1.IVpnConnection|null); + + /** CreateVpnConnectionRequest requestId. */ + public requestId: string; + + /** + * Creates a new CreateVpnConnectionRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns CreateVpnConnectionRequest instance + */ + public static create(properties?: google.cloud.edgecontainer.v1.ICreateVpnConnectionRequest): google.cloud.edgecontainer.v1.CreateVpnConnectionRequest; + + /** + * Encodes the specified CreateVpnConnectionRequest message. Does not implicitly {@link google.cloud.edgecontainer.v1.CreateVpnConnectionRequest.verify|verify} messages. + * @param message CreateVpnConnectionRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.edgecontainer.v1.ICreateVpnConnectionRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CreateVpnConnectionRequest message, length delimited. Does not implicitly {@link google.cloud.edgecontainer.v1.CreateVpnConnectionRequest.verify|verify} messages. + * @param message CreateVpnConnectionRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.edgecontainer.v1.ICreateVpnConnectionRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CreateVpnConnectionRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CreateVpnConnectionRequest + * @throws {Error} If the payload is not 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.edgecontainer.v1.CreateVpnConnectionRequest; + + /** + * Decodes a CreateVpnConnectionRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CreateVpnConnectionRequest + * @throws {Error} If the payload 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.edgecontainer.v1.CreateVpnConnectionRequest; + + /** + * Verifies a CreateVpnConnectionRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CreateVpnConnectionRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CreateVpnConnectionRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.edgecontainer.v1.CreateVpnConnectionRequest; + + /** + * Creates a plain object from a CreateVpnConnectionRequest message. Also converts values to other types if specified. + * @param message CreateVpnConnectionRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.edgecontainer.v1.CreateVpnConnectionRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CreateVpnConnectionRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CreateVpnConnectionRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a DeleteVpnConnectionRequest. */ + interface IDeleteVpnConnectionRequest { + + /** DeleteVpnConnectionRequest name */ + name?: (string|null); + + /** DeleteVpnConnectionRequest requestId */ + requestId?: (string|null); + } + + /** Represents a DeleteVpnConnectionRequest. */ + class DeleteVpnConnectionRequest implements IDeleteVpnConnectionRequest { + + /** + * Constructs a new DeleteVpnConnectionRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.edgecontainer.v1.IDeleteVpnConnectionRequest); + + /** DeleteVpnConnectionRequest name. */ + public name: string; + + /** DeleteVpnConnectionRequest requestId. */ + public requestId: string; + + /** + * Creates a new DeleteVpnConnectionRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns DeleteVpnConnectionRequest instance + */ + public static create(properties?: google.cloud.edgecontainer.v1.IDeleteVpnConnectionRequest): google.cloud.edgecontainer.v1.DeleteVpnConnectionRequest; + + /** + * Encodes the specified DeleteVpnConnectionRequest message. Does not implicitly {@link google.cloud.edgecontainer.v1.DeleteVpnConnectionRequest.verify|verify} messages. + * @param message DeleteVpnConnectionRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.edgecontainer.v1.IDeleteVpnConnectionRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DeleteVpnConnectionRequest message, length delimited. Does not implicitly {@link google.cloud.edgecontainer.v1.DeleteVpnConnectionRequest.verify|verify} messages. + * @param message DeleteVpnConnectionRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.edgecontainer.v1.IDeleteVpnConnectionRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DeleteVpnConnectionRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DeleteVpnConnectionRequest + * @throws {Error} If the payload is not 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.edgecontainer.v1.DeleteVpnConnectionRequest; + + /** + * Decodes a DeleteVpnConnectionRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DeleteVpnConnectionRequest + * @throws {Error} If the payload 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.edgecontainer.v1.DeleteVpnConnectionRequest; + + /** + * Verifies a DeleteVpnConnectionRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DeleteVpnConnectionRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DeleteVpnConnectionRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.edgecontainer.v1.DeleteVpnConnectionRequest; + + /** + * Creates a plain object from a DeleteVpnConnectionRequest message. Also converts values to other types if specified. + * @param message DeleteVpnConnectionRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.edgecontainer.v1.DeleteVpnConnectionRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DeleteVpnConnectionRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DeleteVpnConnectionRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + } + } + + /** 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 + } + + /** 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; + } + + /** 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); + } + + /** 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[]; + + /** + * 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); + } + + /** 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); + + /** + * 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); + } + + /** 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); + + /** + * 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 + } + + /** 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 + } + } + + /** 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; + } + + /** 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?: (string|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: string; + + /** + * 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); + } + + /** 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[]; + + /** + * 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; + } + + /** 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_REQUIRED = 2, + LABEL_REPEATED = 3 + } + } + + /** 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 phpGenericServices */ + phpGenericServices?: (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 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 phpGenericServices. */ + public phpGenericServices: 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 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 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 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 target */ + target?: (google.protobuf.FieldOptions.OptionTargetType|keyof typeof google.protobuf.FieldOptions.OptionTargetType|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 target. */ + public target: (google.protobuf.FieldOptions.OptionTargetType|keyof typeof google.protobuf.FieldOptions.OptionTargetType); + + /** 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 OneofOptions. */ + interface IOneofOptions { + + /** 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 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 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 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 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 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 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); + } + + /** Represents a ServiceOptions. */ + class ServiceOptions implements IServiceOptions { + + /** + * Constructs a new ServiceOptions. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IServiceOptions); + + /** 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 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 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|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|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 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 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|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|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 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 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; + } + } + + /** 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; + } + } + + /** 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; + } + } +} diff --git a/packages/google-cloud-edgecontainer/protos/protos.js b/packages/google-cloud-edgecontainer/protos/protos.js new file mode 100644 index 00000000000..c6d83a99875 --- /dev/null +++ b/packages/google-cloud-edgecontainer/protos/protos.js @@ -0,0 +1,30766 @@ +// Copyright 2023 Google LLC +// +// Licensed under the Apache License, Version 2.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_edgecontainer_protos || ($protobuf.roots._google_cloud_edgecontainer_protos = {}); + + $root.google = (function() { + + /** + * Namespace google. + * @exports google + * @namespace + */ + var google = {}; + + google.cloud = (function() { + + /** + * Namespace cloud. + * @memberof google + * @namespace + */ + var cloud = {}; + + cloud.edgecontainer = (function() { + + /** + * Namespace edgecontainer. + * @memberof google.cloud + * @namespace + */ + var edgecontainer = {}; + + edgecontainer.v1 = (function() { + + /** + * Namespace v1. + * @memberof google.cloud.edgecontainer + * @namespace + */ + var v1 = {}; + + /** + * KmsKeyState enum. + * @name google.cloud.edgecontainer.v1.KmsKeyState + * @enum {number} + * @property {number} KMS_KEY_STATE_UNSPECIFIED=0 KMS_KEY_STATE_UNSPECIFIED value + * @property {number} KMS_KEY_STATE_KEY_AVAILABLE=1 KMS_KEY_STATE_KEY_AVAILABLE value + * @property {number} KMS_KEY_STATE_KEY_UNAVAILABLE=2 KMS_KEY_STATE_KEY_UNAVAILABLE value + */ + v1.KmsKeyState = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "KMS_KEY_STATE_UNSPECIFIED"] = 0; + values[valuesById[1] = "KMS_KEY_STATE_KEY_AVAILABLE"] = 1; + values[valuesById[2] = "KMS_KEY_STATE_KEY_UNAVAILABLE"] = 2; + return values; + })(); + + v1.Cluster = (function() { + + /** + * Properties of a Cluster. + * @memberof google.cloud.edgecontainer.v1 + * @interface ICluster + * @property {string|null} [name] Cluster name + * @property {google.protobuf.ITimestamp|null} [createTime] Cluster createTime + * @property {google.protobuf.ITimestamp|null} [updateTime] Cluster updateTime + * @property {Object.|null} [labels] Cluster labels + * @property {google.cloud.edgecontainer.v1.IFleet|null} [fleet] Cluster fleet + * @property {google.cloud.edgecontainer.v1.IClusterNetworking|null} [networking] Cluster networking + * @property {google.cloud.edgecontainer.v1.IAuthorization|null} [authorization] Cluster authorization + * @property {number|null} [defaultMaxPodsPerNode] Cluster defaultMaxPodsPerNode + * @property {string|null} [endpoint] Cluster endpoint + * @property {string|null} [clusterCaCertificate] Cluster clusterCaCertificate + * @property {google.cloud.edgecontainer.v1.IMaintenancePolicy|null} [maintenancePolicy] Cluster maintenancePolicy + */ + + /** + * Constructs a new Cluster. + * @memberof google.cloud.edgecontainer.v1 + * @classdesc Represents a Cluster. + * @implements ICluster + * @constructor + * @param {google.cloud.edgecontainer.v1.ICluster=} [properties] Properties to set + */ + function Cluster(properties) { + this.labels = {}; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Cluster name. + * @member {string} name + * @memberof google.cloud.edgecontainer.v1.Cluster + * @instance + */ + Cluster.prototype.name = ""; + + /** + * Cluster createTime. + * @member {google.protobuf.ITimestamp|null|undefined} createTime + * @memberof google.cloud.edgecontainer.v1.Cluster + * @instance + */ + Cluster.prototype.createTime = null; + + /** + * Cluster updateTime. + * @member {google.protobuf.ITimestamp|null|undefined} updateTime + * @memberof google.cloud.edgecontainer.v1.Cluster + * @instance + */ + Cluster.prototype.updateTime = null; + + /** + * Cluster labels. + * @member {Object.} labels + * @memberof google.cloud.edgecontainer.v1.Cluster + * @instance + */ + Cluster.prototype.labels = $util.emptyObject; + + /** + * Cluster fleet. + * @member {google.cloud.edgecontainer.v1.IFleet|null|undefined} fleet + * @memberof google.cloud.edgecontainer.v1.Cluster + * @instance + */ + Cluster.prototype.fleet = null; + + /** + * Cluster networking. + * @member {google.cloud.edgecontainer.v1.IClusterNetworking|null|undefined} networking + * @memberof google.cloud.edgecontainer.v1.Cluster + * @instance + */ + Cluster.prototype.networking = null; + + /** + * Cluster authorization. + * @member {google.cloud.edgecontainer.v1.IAuthorization|null|undefined} authorization + * @memberof google.cloud.edgecontainer.v1.Cluster + * @instance + */ + Cluster.prototype.authorization = null; + + /** + * Cluster defaultMaxPodsPerNode. + * @member {number} defaultMaxPodsPerNode + * @memberof google.cloud.edgecontainer.v1.Cluster + * @instance + */ + Cluster.prototype.defaultMaxPodsPerNode = 0; + + /** + * Cluster endpoint. + * @member {string} endpoint + * @memberof google.cloud.edgecontainer.v1.Cluster + * @instance + */ + Cluster.prototype.endpoint = ""; + + /** + * Cluster clusterCaCertificate. + * @member {string} clusterCaCertificate + * @memberof google.cloud.edgecontainer.v1.Cluster + * @instance + */ + Cluster.prototype.clusterCaCertificate = ""; + + /** + * Cluster maintenancePolicy. + * @member {google.cloud.edgecontainer.v1.IMaintenancePolicy|null|undefined} maintenancePolicy + * @memberof google.cloud.edgecontainer.v1.Cluster + * @instance + */ + Cluster.prototype.maintenancePolicy = null; + + /** + * Creates a new Cluster instance using the specified properties. + * @function create + * @memberof google.cloud.edgecontainer.v1.Cluster + * @static + * @param {google.cloud.edgecontainer.v1.ICluster=} [properties] Properties to set + * @returns {google.cloud.edgecontainer.v1.Cluster} Cluster instance + */ + Cluster.create = function create(properties) { + return new Cluster(properties); + }; + + /** + * Encodes the specified Cluster message. Does not implicitly {@link google.cloud.edgecontainer.v1.Cluster.verify|verify} messages. + * @function encode + * @memberof google.cloud.edgecontainer.v1.Cluster + * @static + * @param {google.cloud.edgecontainer.v1.ICluster} message Cluster message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Cluster.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.createTime != null && Object.hasOwnProperty.call(message, "createTime")) + $root.google.protobuf.Timestamp.encode(message.createTime, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + 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(); + if (message.labels != null && Object.hasOwnProperty.call(message, "labels")) + for (var keys = Object.keys(message.labels), i = 0; i < keys.length; ++i) + writer.uint32(/* id 4, wireType 2 =*/34).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.labels[keys[i]]).ldelim(); + if (message.endpoint != null && Object.hasOwnProperty.call(message, "endpoint")) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.endpoint); + if (message.networking != null && Object.hasOwnProperty.call(message, "networking")) + $root.google.cloud.edgecontainer.v1.ClusterNetworking.encode(message.networking, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + if (message.defaultMaxPodsPerNode != null && Object.hasOwnProperty.call(message, "defaultMaxPodsPerNode")) + writer.uint32(/* id 8, wireType 0 =*/64).int32(message.defaultMaxPodsPerNode); + if (message.authorization != null && Object.hasOwnProperty.call(message, "authorization")) + $root.google.cloud.edgecontainer.v1.Authorization.encode(message.authorization, writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim(); + if (message.clusterCaCertificate != null && Object.hasOwnProperty.call(message, "clusterCaCertificate")) + writer.uint32(/* id 10, wireType 2 =*/82).string(message.clusterCaCertificate); + if (message.fleet != null && Object.hasOwnProperty.call(message, "fleet")) + $root.google.cloud.edgecontainer.v1.Fleet.encode(message.fleet, writer.uint32(/* id 11, wireType 2 =*/90).fork()).ldelim(); + if (message.maintenancePolicy != null && Object.hasOwnProperty.call(message, "maintenancePolicy")) + $root.google.cloud.edgecontainer.v1.MaintenancePolicy.encode(message.maintenancePolicy, writer.uint32(/* id 12, wireType 2 =*/98).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified Cluster message, length delimited. Does not implicitly {@link google.cloud.edgecontainer.v1.Cluster.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.edgecontainer.v1.Cluster + * @static + * @param {google.cloud.edgecontainer.v1.ICluster} message Cluster message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Cluster.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Cluster message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.edgecontainer.v1.Cluster + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.edgecontainer.v1.Cluster} Cluster + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Cluster.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.edgecontainer.v1.Cluster(), key, value; + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.createTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 3: { + message.updateTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 4: { + if (message.labels === $util.emptyObject) + message.labels = {}; + 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.labels[key] = value; + break; + } + case 11: { + message.fleet = $root.google.cloud.edgecontainer.v1.Fleet.decode(reader, reader.uint32()); + break; + } + case 7: { + message.networking = $root.google.cloud.edgecontainer.v1.ClusterNetworking.decode(reader, reader.uint32()); + break; + } + case 9: { + message.authorization = $root.google.cloud.edgecontainer.v1.Authorization.decode(reader, reader.uint32()); + break; + } + case 8: { + message.defaultMaxPodsPerNode = reader.int32(); + break; + } + case 6: { + message.endpoint = reader.string(); + break; + } + case 10: { + message.clusterCaCertificate = reader.string(); + break; + } + case 12: { + message.maintenancePolicy = $root.google.cloud.edgecontainer.v1.MaintenancePolicy.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Cluster message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.edgecontainer.v1.Cluster + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.edgecontainer.v1.Cluster} Cluster + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Cluster.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Cluster message. + * @function verify + * @memberof google.cloud.edgecontainer.v1.Cluster + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Cluster.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.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.labels != null && message.hasOwnProperty("labels")) { + if (!$util.isObject(message.labels)) + return "labels: object expected"; + var key = Object.keys(message.labels); + for (var i = 0; i < key.length; ++i) + if (!$util.isString(message.labels[key[i]])) + return "labels: string{k:string} expected"; + } + if (message.fleet != null && message.hasOwnProperty("fleet")) { + var error = $root.google.cloud.edgecontainer.v1.Fleet.verify(message.fleet); + if (error) + return "fleet." + error; + } + if (message.networking != null && message.hasOwnProperty("networking")) { + var error = $root.google.cloud.edgecontainer.v1.ClusterNetworking.verify(message.networking); + if (error) + return "networking." + error; + } + if (message.authorization != null && message.hasOwnProperty("authorization")) { + var error = $root.google.cloud.edgecontainer.v1.Authorization.verify(message.authorization); + if (error) + return "authorization." + error; + } + if (message.defaultMaxPodsPerNode != null && message.hasOwnProperty("defaultMaxPodsPerNode")) + if (!$util.isInteger(message.defaultMaxPodsPerNode)) + return "defaultMaxPodsPerNode: integer expected"; + if (message.endpoint != null && message.hasOwnProperty("endpoint")) + if (!$util.isString(message.endpoint)) + return "endpoint: string expected"; + if (message.clusterCaCertificate != null && message.hasOwnProperty("clusterCaCertificate")) + if (!$util.isString(message.clusterCaCertificate)) + return "clusterCaCertificate: string expected"; + if (message.maintenancePolicy != null && message.hasOwnProperty("maintenancePolicy")) { + var error = $root.google.cloud.edgecontainer.v1.MaintenancePolicy.verify(message.maintenancePolicy); + if (error) + return "maintenancePolicy." + error; + } + return null; + }; + + /** + * Creates a Cluster message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.edgecontainer.v1.Cluster + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.edgecontainer.v1.Cluster} Cluster + */ + Cluster.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.edgecontainer.v1.Cluster) + return object; + var message = new $root.google.cloud.edgecontainer.v1.Cluster(); + if (object.name != null) + message.name = String(object.name); + if (object.createTime != null) { + if (typeof object.createTime !== "object") + throw TypeError(".google.cloud.edgecontainer.v1.Cluster.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.edgecontainer.v1.Cluster.updateTime: object expected"); + message.updateTime = $root.google.protobuf.Timestamp.fromObject(object.updateTime); + } + if (object.labels) { + if (typeof object.labels !== "object") + throw TypeError(".google.cloud.edgecontainer.v1.Cluster.labels: object expected"); + message.labels = {}; + for (var keys = Object.keys(object.labels), i = 0; i < keys.length; ++i) + message.labels[keys[i]] = String(object.labels[keys[i]]); + } + if (object.fleet != null) { + if (typeof object.fleet !== "object") + throw TypeError(".google.cloud.edgecontainer.v1.Cluster.fleet: object expected"); + message.fleet = $root.google.cloud.edgecontainer.v1.Fleet.fromObject(object.fleet); + } + if (object.networking != null) { + if (typeof object.networking !== "object") + throw TypeError(".google.cloud.edgecontainer.v1.Cluster.networking: object expected"); + message.networking = $root.google.cloud.edgecontainer.v1.ClusterNetworking.fromObject(object.networking); + } + if (object.authorization != null) { + if (typeof object.authorization !== "object") + throw TypeError(".google.cloud.edgecontainer.v1.Cluster.authorization: object expected"); + message.authorization = $root.google.cloud.edgecontainer.v1.Authorization.fromObject(object.authorization); + } + if (object.defaultMaxPodsPerNode != null) + message.defaultMaxPodsPerNode = object.defaultMaxPodsPerNode | 0; + if (object.endpoint != null) + message.endpoint = String(object.endpoint); + if (object.clusterCaCertificate != null) + message.clusterCaCertificate = String(object.clusterCaCertificate); + if (object.maintenancePolicy != null) { + if (typeof object.maintenancePolicy !== "object") + throw TypeError(".google.cloud.edgecontainer.v1.Cluster.maintenancePolicy: object expected"); + message.maintenancePolicy = $root.google.cloud.edgecontainer.v1.MaintenancePolicy.fromObject(object.maintenancePolicy); + } + return message; + }; + + /** + * Creates a plain object from a Cluster message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.edgecontainer.v1.Cluster + * @static + * @param {google.cloud.edgecontainer.v1.Cluster} message Cluster + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Cluster.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.objects || options.defaults) + object.labels = {}; + if (options.defaults) { + object.name = ""; + object.createTime = null; + object.updateTime = null; + object.endpoint = ""; + object.networking = null; + object.defaultMaxPodsPerNode = 0; + object.authorization = null; + object.clusterCaCertificate = ""; + object.fleet = null; + object.maintenancePolicy = null; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + 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); + var keys2; + if (message.labels && (keys2 = Object.keys(message.labels)).length) { + object.labels = {}; + for (var j = 0; j < keys2.length; ++j) + object.labels[keys2[j]] = message.labels[keys2[j]]; + } + if (message.endpoint != null && message.hasOwnProperty("endpoint")) + object.endpoint = message.endpoint; + if (message.networking != null && message.hasOwnProperty("networking")) + object.networking = $root.google.cloud.edgecontainer.v1.ClusterNetworking.toObject(message.networking, options); + if (message.defaultMaxPodsPerNode != null && message.hasOwnProperty("defaultMaxPodsPerNode")) + object.defaultMaxPodsPerNode = message.defaultMaxPodsPerNode; + if (message.authorization != null && message.hasOwnProperty("authorization")) + object.authorization = $root.google.cloud.edgecontainer.v1.Authorization.toObject(message.authorization, options); + if (message.clusterCaCertificate != null && message.hasOwnProperty("clusterCaCertificate")) + object.clusterCaCertificate = message.clusterCaCertificate; + if (message.fleet != null && message.hasOwnProperty("fleet")) + object.fleet = $root.google.cloud.edgecontainer.v1.Fleet.toObject(message.fleet, options); + if (message.maintenancePolicy != null && message.hasOwnProperty("maintenancePolicy")) + object.maintenancePolicy = $root.google.cloud.edgecontainer.v1.MaintenancePolicy.toObject(message.maintenancePolicy, options); + return object; + }; + + /** + * Converts this Cluster to JSON. + * @function toJSON + * @memberof google.cloud.edgecontainer.v1.Cluster + * @instance + * @returns {Object.} JSON object + */ + Cluster.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Cluster + * @function getTypeUrl + * @memberof google.cloud.edgecontainer.v1.Cluster + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Cluster.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.edgecontainer.v1.Cluster"; + }; + + return Cluster; + })(); + + v1.ClusterNetworking = (function() { + + /** + * Properties of a ClusterNetworking. + * @memberof google.cloud.edgecontainer.v1 + * @interface IClusterNetworking + * @property {Array.|null} [clusterIpv4CidrBlocks] ClusterNetworking clusterIpv4CidrBlocks + * @property {Array.|null} [servicesIpv4CidrBlocks] ClusterNetworking servicesIpv4CidrBlocks + */ + + /** + * Constructs a new ClusterNetworking. + * @memberof google.cloud.edgecontainer.v1 + * @classdesc Represents a ClusterNetworking. + * @implements IClusterNetworking + * @constructor + * @param {google.cloud.edgecontainer.v1.IClusterNetworking=} [properties] Properties to set + */ + function ClusterNetworking(properties) { + this.clusterIpv4CidrBlocks = []; + this.servicesIpv4CidrBlocks = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ClusterNetworking clusterIpv4CidrBlocks. + * @member {Array.} clusterIpv4CidrBlocks + * @memberof google.cloud.edgecontainer.v1.ClusterNetworking + * @instance + */ + ClusterNetworking.prototype.clusterIpv4CidrBlocks = $util.emptyArray; + + /** + * ClusterNetworking servicesIpv4CidrBlocks. + * @member {Array.} servicesIpv4CidrBlocks + * @memberof google.cloud.edgecontainer.v1.ClusterNetworking + * @instance + */ + ClusterNetworking.prototype.servicesIpv4CidrBlocks = $util.emptyArray; + + /** + * Creates a new ClusterNetworking instance using the specified properties. + * @function create + * @memberof google.cloud.edgecontainer.v1.ClusterNetworking + * @static + * @param {google.cloud.edgecontainer.v1.IClusterNetworking=} [properties] Properties to set + * @returns {google.cloud.edgecontainer.v1.ClusterNetworking} ClusterNetworking instance + */ + ClusterNetworking.create = function create(properties) { + return new ClusterNetworking(properties); + }; + + /** + * Encodes the specified ClusterNetworking message. Does not implicitly {@link google.cloud.edgecontainer.v1.ClusterNetworking.verify|verify} messages. + * @function encode + * @memberof google.cloud.edgecontainer.v1.ClusterNetworking + * @static + * @param {google.cloud.edgecontainer.v1.IClusterNetworking} message ClusterNetworking message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ClusterNetworking.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.clusterIpv4CidrBlocks != null && message.clusterIpv4CidrBlocks.length) + for (var i = 0; i < message.clusterIpv4CidrBlocks.length; ++i) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.clusterIpv4CidrBlocks[i]); + if (message.servicesIpv4CidrBlocks != null && message.servicesIpv4CidrBlocks.length) + for (var i = 0; i < message.servicesIpv4CidrBlocks.length; ++i) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.servicesIpv4CidrBlocks[i]); + return writer; + }; + + /** + * Encodes the specified ClusterNetworking message, length delimited. Does not implicitly {@link google.cloud.edgecontainer.v1.ClusterNetworking.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.edgecontainer.v1.ClusterNetworking + * @static + * @param {google.cloud.edgecontainer.v1.IClusterNetworking} message ClusterNetworking message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ClusterNetworking.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ClusterNetworking message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.edgecontainer.v1.ClusterNetworking + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.edgecontainer.v1.ClusterNetworking} ClusterNetworking + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ClusterNetworking.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.edgecontainer.v1.ClusterNetworking(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.clusterIpv4CidrBlocks && message.clusterIpv4CidrBlocks.length)) + message.clusterIpv4CidrBlocks = []; + message.clusterIpv4CidrBlocks.push(reader.string()); + break; + } + case 2: { + if (!(message.servicesIpv4CidrBlocks && message.servicesIpv4CidrBlocks.length)) + message.servicesIpv4CidrBlocks = []; + message.servicesIpv4CidrBlocks.push(reader.string()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ClusterNetworking message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.edgecontainer.v1.ClusterNetworking + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.edgecontainer.v1.ClusterNetworking} ClusterNetworking + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ClusterNetworking.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ClusterNetworking message. + * @function verify + * @memberof google.cloud.edgecontainer.v1.ClusterNetworking + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ClusterNetworking.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.clusterIpv4CidrBlocks != null && message.hasOwnProperty("clusterIpv4CidrBlocks")) { + if (!Array.isArray(message.clusterIpv4CidrBlocks)) + return "clusterIpv4CidrBlocks: array expected"; + for (var i = 0; i < message.clusterIpv4CidrBlocks.length; ++i) + if (!$util.isString(message.clusterIpv4CidrBlocks[i])) + return "clusterIpv4CidrBlocks: string[] expected"; + } + if (message.servicesIpv4CidrBlocks != null && message.hasOwnProperty("servicesIpv4CidrBlocks")) { + if (!Array.isArray(message.servicesIpv4CidrBlocks)) + return "servicesIpv4CidrBlocks: array expected"; + for (var i = 0; i < message.servicesIpv4CidrBlocks.length; ++i) + if (!$util.isString(message.servicesIpv4CidrBlocks[i])) + return "servicesIpv4CidrBlocks: string[] expected"; + } + return null; + }; + + /** + * Creates a ClusterNetworking message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.edgecontainer.v1.ClusterNetworking + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.edgecontainer.v1.ClusterNetworking} ClusterNetworking + */ + ClusterNetworking.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.edgecontainer.v1.ClusterNetworking) + return object; + var message = new $root.google.cloud.edgecontainer.v1.ClusterNetworking(); + if (object.clusterIpv4CidrBlocks) { + if (!Array.isArray(object.clusterIpv4CidrBlocks)) + throw TypeError(".google.cloud.edgecontainer.v1.ClusterNetworking.clusterIpv4CidrBlocks: array expected"); + message.clusterIpv4CidrBlocks = []; + for (var i = 0; i < object.clusterIpv4CidrBlocks.length; ++i) + message.clusterIpv4CidrBlocks[i] = String(object.clusterIpv4CidrBlocks[i]); + } + if (object.servicesIpv4CidrBlocks) { + if (!Array.isArray(object.servicesIpv4CidrBlocks)) + throw TypeError(".google.cloud.edgecontainer.v1.ClusterNetworking.servicesIpv4CidrBlocks: array expected"); + message.servicesIpv4CidrBlocks = []; + for (var i = 0; i < object.servicesIpv4CidrBlocks.length; ++i) + message.servicesIpv4CidrBlocks[i] = String(object.servicesIpv4CidrBlocks[i]); + } + return message; + }; + + /** + * Creates a plain object from a ClusterNetworking message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.edgecontainer.v1.ClusterNetworking + * @static + * @param {google.cloud.edgecontainer.v1.ClusterNetworking} message ClusterNetworking + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ClusterNetworking.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.clusterIpv4CidrBlocks = []; + object.servicesIpv4CidrBlocks = []; + } + if (message.clusterIpv4CidrBlocks && message.clusterIpv4CidrBlocks.length) { + object.clusterIpv4CidrBlocks = []; + for (var j = 0; j < message.clusterIpv4CidrBlocks.length; ++j) + object.clusterIpv4CidrBlocks[j] = message.clusterIpv4CidrBlocks[j]; + } + if (message.servicesIpv4CidrBlocks && message.servicesIpv4CidrBlocks.length) { + object.servicesIpv4CidrBlocks = []; + for (var j = 0; j < message.servicesIpv4CidrBlocks.length; ++j) + object.servicesIpv4CidrBlocks[j] = message.servicesIpv4CidrBlocks[j]; + } + return object; + }; + + /** + * Converts this ClusterNetworking to JSON. + * @function toJSON + * @memberof google.cloud.edgecontainer.v1.ClusterNetworking + * @instance + * @returns {Object.} JSON object + */ + ClusterNetworking.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ClusterNetworking + * @function getTypeUrl + * @memberof google.cloud.edgecontainer.v1.ClusterNetworking + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ClusterNetworking.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.edgecontainer.v1.ClusterNetworking"; + }; + + return ClusterNetworking; + })(); + + v1.Fleet = (function() { + + /** + * Properties of a Fleet. + * @memberof google.cloud.edgecontainer.v1 + * @interface IFleet + * @property {string|null} [project] Fleet project + * @property {string|null} [membership] Fleet membership + */ + + /** + * Constructs a new Fleet. + * @memberof google.cloud.edgecontainer.v1 + * @classdesc Represents a Fleet. + * @implements IFleet + * @constructor + * @param {google.cloud.edgecontainer.v1.IFleet=} [properties] Properties to set + */ + function Fleet(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Fleet project. + * @member {string} project + * @memberof google.cloud.edgecontainer.v1.Fleet + * @instance + */ + Fleet.prototype.project = ""; + + /** + * Fleet membership. + * @member {string} membership + * @memberof google.cloud.edgecontainer.v1.Fleet + * @instance + */ + Fleet.prototype.membership = ""; + + /** + * Creates a new Fleet instance using the specified properties. + * @function create + * @memberof google.cloud.edgecontainer.v1.Fleet + * @static + * @param {google.cloud.edgecontainer.v1.IFleet=} [properties] Properties to set + * @returns {google.cloud.edgecontainer.v1.Fleet} Fleet instance + */ + Fleet.create = function create(properties) { + return new Fleet(properties); + }; + + /** + * Encodes the specified Fleet message. Does not implicitly {@link google.cloud.edgecontainer.v1.Fleet.verify|verify} messages. + * @function encode + * @memberof google.cloud.edgecontainer.v1.Fleet + * @static + * @param {google.cloud.edgecontainer.v1.IFleet} message Fleet message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Fleet.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.project != null && Object.hasOwnProperty.call(message, "project")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.project); + if (message.membership != null && Object.hasOwnProperty.call(message, "membership")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.membership); + return writer; + }; + + /** + * Encodes the specified Fleet message, length delimited. Does not implicitly {@link google.cloud.edgecontainer.v1.Fleet.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.edgecontainer.v1.Fleet + * @static + * @param {google.cloud.edgecontainer.v1.IFleet} message Fleet message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Fleet.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Fleet message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.edgecontainer.v1.Fleet + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.edgecontainer.v1.Fleet} Fleet + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Fleet.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.edgecontainer.v1.Fleet(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.project = reader.string(); + break; + } + case 2: { + message.membership = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Fleet message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.edgecontainer.v1.Fleet + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.edgecontainer.v1.Fleet} Fleet + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Fleet.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Fleet message. + * @function verify + * @memberof google.cloud.edgecontainer.v1.Fleet + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Fleet.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.project != null && message.hasOwnProperty("project")) + if (!$util.isString(message.project)) + return "project: string expected"; + if (message.membership != null && message.hasOwnProperty("membership")) + if (!$util.isString(message.membership)) + return "membership: string expected"; + return null; + }; + + /** + * Creates a Fleet message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.edgecontainer.v1.Fleet + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.edgecontainer.v1.Fleet} Fleet + */ + Fleet.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.edgecontainer.v1.Fleet) + return object; + var message = new $root.google.cloud.edgecontainer.v1.Fleet(); + if (object.project != null) + message.project = String(object.project); + if (object.membership != null) + message.membership = String(object.membership); + return message; + }; + + /** + * Creates a plain object from a Fleet message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.edgecontainer.v1.Fleet + * @static + * @param {google.cloud.edgecontainer.v1.Fleet} message Fleet + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Fleet.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.project = ""; + object.membership = ""; + } + if (message.project != null && message.hasOwnProperty("project")) + object.project = message.project; + if (message.membership != null && message.hasOwnProperty("membership")) + object.membership = message.membership; + return object; + }; + + /** + * Converts this Fleet to JSON. + * @function toJSON + * @memberof google.cloud.edgecontainer.v1.Fleet + * @instance + * @returns {Object.} JSON object + */ + Fleet.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Fleet + * @function getTypeUrl + * @memberof google.cloud.edgecontainer.v1.Fleet + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Fleet.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.edgecontainer.v1.Fleet"; + }; + + return Fleet; + })(); + + v1.ClusterUser = (function() { + + /** + * Properties of a ClusterUser. + * @memberof google.cloud.edgecontainer.v1 + * @interface IClusterUser + * @property {string|null} [username] ClusterUser username + */ + + /** + * Constructs a new ClusterUser. + * @memberof google.cloud.edgecontainer.v1 + * @classdesc Represents a ClusterUser. + * @implements IClusterUser + * @constructor + * @param {google.cloud.edgecontainer.v1.IClusterUser=} [properties] Properties to set + */ + function ClusterUser(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ClusterUser username. + * @member {string} username + * @memberof google.cloud.edgecontainer.v1.ClusterUser + * @instance + */ + ClusterUser.prototype.username = ""; + + /** + * Creates a new ClusterUser instance using the specified properties. + * @function create + * @memberof google.cloud.edgecontainer.v1.ClusterUser + * @static + * @param {google.cloud.edgecontainer.v1.IClusterUser=} [properties] Properties to set + * @returns {google.cloud.edgecontainer.v1.ClusterUser} ClusterUser instance + */ + ClusterUser.create = function create(properties) { + return new ClusterUser(properties); + }; + + /** + * Encodes the specified ClusterUser message. Does not implicitly {@link google.cloud.edgecontainer.v1.ClusterUser.verify|verify} messages. + * @function encode + * @memberof google.cloud.edgecontainer.v1.ClusterUser + * @static + * @param {google.cloud.edgecontainer.v1.IClusterUser} message ClusterUser message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ClusterUser.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.username != null && Object.hasOwnProperty.call(message, "username")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.username); + return writer; + }; + + /** + * Encodes the specified ClusterUser message, length delimited. Does not implicitly {@link google.cloud.edgecontainer.v1.ClusterUser.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.edgecontainer.v1.ClusterUser + * @static + * @param {google.cloud.edgecontainer.v1.IClusterUser} message ClusterUser message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ClusterUser.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ClusterUser message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.edgecontainer.v1.ClusterUser + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.edgecontainer.v1.ClusterUser} ClusterUser + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ClusterUser.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.edgecontainer.v1.ClusterUser(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.username = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ClusterUser message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.edgecontainer.v1.ClusterUser + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.edgecontainer.v1.ClusterUser} ClusterUser + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ClusterUser.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ClusterUser message. + * @function verify + * @memberof google.cloud.edgecontainer.v1.ClusterUser + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ClusterUser.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.username != null && message.hasOwnProperty("username")) + if (!$util.isString(message.username)) + return "username: string expected"; + return null; + }; + + /** + * Creates a ClusterUser message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.edgecontainer.v1.ClusterUser + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.edgecontainer.v1.ClusterUser} ClusterUser + */ + ClusterUser.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.edgecontainer.v1.ClusterUser) + return object; + var message = new $root.google.cloud.edgecontainer.v1.ClusterUser(); + if (object.username != null) + message.username = String(object.username); + return message; + }; + + /** + * Creates a plain object from a ClusterUser message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.edgecontainer.v1.ClusterUser + * @static + * @param {google.cloud.edgecontainer.v1.ClusterUser} message ClusterUser + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ClusterUser.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.username = ""; + if (message.username != null && message.hasOwnProperty("username")) + object.username = message.username; + return object; + }; + + /** + * Converts this ClusterUser to JSON. + * @function toJSON + * @memberof google.cloud.edgecontainer.v1.ClusterUser + * @instance + * @returns {Object.} JSON object + */ + ClusterUser.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ClusterUser + * @function getTypeUrl + * @memberof google.cloud.edgecontainer.v1.ClusterUser + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ClusterUser.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.edgecontainer.v1.ClusterUser"; + }; + + return ClusterUser; + })(); + + v1.Authorization = (function() { + + /** + * Properties of an Authorization. + * @memberof google.cloud.edgecontainer.v1 + * @interface IAuthorization + * @property {google.cloud.edgecontainer.v1.IClusterUser|null} [adminUsers] Authorization adminUsers + */ + + /** + * Constructs a new Authorization. + * @memberof google.cloud.edgecontainer.v1 + * @classdesc Represents an Authorization. + * @implements IAuthorization + * @constructor + * @param {google.cloud.edgecontainer.v1.IAuthorization=} [properties] Properties to set + */ + function Authorization(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Authorization adminUsers. + * @member {google.cloud.edgecontainer.v1.IClusterUser|null|undefined} adminUsers + * @memberof google.cloud.edgecontainer.v1.Authorization + * @instance + */ + Authorization.prototype.adminUsers = null; + + /** + * Creates a new Authorization instance using the specified properties. + * @function create + * @memberof google.cloud.edgecontainer.v1.Authorization + * @static + * @param {google.cloud.edgecontainer.v1.IAuthorization=} [properties] Properties to set + * @returns {google.cloud.edgecontainer.v1.Authorization} Authorization instance + */ + Authorization.create = function create(properties) { + return new Authorization(properties); + }; + + /** + * Encodes the specified Authorization message. Does not implicitly {@link google.cloud.edgecontainer.v1.Authorization.verify|verify} messages. + * @function encode + * @memberof google.cloud.edgecontainer.v1.Authorization + * @static + * @param {google.cloud.edgecontainer.v1.IAuthorization} message Authorization message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Authorization.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.adminUsers != null && Object.hasOwnProperty.call(message, "adminUsers")) + $root.google.cloud.edgecontainer.v1.ClusterUser.encode(message.adminUsers, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified Authorization message, length delimited. Does not implicitly {@link google.cloud.edgecontainer.v1.Authorization.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.edgecontainer.v1.Authorization + * @static + * @param {google.cloud.edgecontainer.v1.IAuthorization} message Authorization message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Authorization.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an Authorization message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.edgecontainer.v1.Authorization + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.edgecontainer.v1.Authorization} Authorization + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Authorization.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.edgecontainer.v1.Authorization(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.adminUsers = $root.google.cloud.edgecontainer.v1.ClusterUser.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an Authorization message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.edgecontainer.v1.Authorization + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.edgecontainer.v1.Authorization} Authorization + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Authorization.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an Authorization message. + * @function verify + * @memberof google.cloud.edgecontainer.v1.Authorization + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Authorization.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.adminUsers != null && message.hasOwnProperty("adminUsers")) { + var error = $root.google.cloud.edgecontainer.v1.ClusterUser.verify(message.adminUsers); + if (error) + return "adminUsers." + error; + } + return null; + }; + + /** + * Creates an Authorization message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.edgecontainer.v1.Authorization + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.edgecontainer.v1.Authorization} Authorization + */ + Authorization.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.edgecontainer.v1.Authorization) + return object; + var message = new $root.google.cloud.edgecontainer.v1.Authorization(); + if (object.adminUsers != null) { + if (typeof object.adminUsers !== "object") + throw TypeError(".google.cloud.edgecontainer.v1.Authorization.adminUsers: object expected"); + message.adminUsers = $root.google.cloud.edgecontainer.v1.ClusterUser.fromObject(object.adminUsers); + } + return message; + }; + + /** + * Creates a plain object from an Authorization message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.edgecontainer.v1.Authorization + * @static + * @param {google.cloud.edgecontainer.v1.Authorization} message Authorization + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Authorization.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.adminUsers = null; + if (message.adminUsers != null && message.hasOwnProperty("adminUsers")) + object.adminUsers = $root.google.cloud.edgecontainer.v1.ClusterUser.toObject(message.adminUsers, options); + return object; + }; + + /** + * Converts this Authorization to JSON. + * @function toJSON + * @memberof google.cloud.edgecontainer.v1.Authorization + * @instance + * @returns {Object.} JSON object + */ + Authorization.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Authorization + * @function getTypeUrl + * @memberof google.cloud.edgecontainer.v1.Authorization + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Authorization.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.edgecontainer.v1.Authorization"; + }; + + return Authorization; + })(); + + v1.NodePool = (function() { + + /** + * Properties of a NodePool. + * @memberof google.cloud.edgecontainer.v1 + * @interface INodePool + * @property {string|null} [name] NodePool name + * @property {google.protobuf.ITimestamp|null} [createTime] NodePool createTime + * @property {google.protobuf.ITimestamp|null} [updateTime] NodePool updateTime + * @property {Object.|null} [labels] NodePool labels + * @property {string|null} [nodeLocation] NodePool nodeLocation + * @property {number|null} [nodeCount] NodePool nodeCount + * @property {string|null} [machineFilter] NodePool machineFilter + * @property {google.cloud.edgecontainer.v1.NodePool.ILocalDiskEncryption|null} [localDiskEncryption] NodePool localDiskEncryption + */ + + /** + * Constructs a new NodePool. + * @memberof google.cloud.edgecontainer.v1 + * @classdesc Represents a NodePool. + * @implements INodePool + * @constructor + * @param {google.cloud.edgecontainer.v1.INodePool=} [properties] Properties to set + */ + function NodePool(properties) { + this.labels = {}; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * NodePool name. + * @member {string} name + * @memberof google.cloud.edgecontainer.v1.NodePool + * @instance + */ + NodePool.prototype.name = ""; + + /** + * NodePool createTime. + * @member {google.protobuf.ITimestamp|null|undefined} createTime + * @memberof google.cloud.edgecontainer.v1.NodePool + * @instance + */ + NodePool.prototype.createTime = null; + + /** + * NodePool updateTime. + * @member {google.protobuf.ITimestamp|null|undefined} updateTime + * @memberof google.cloud.edgecontainer.v1.NodePool + * @instance + */ + NodePool.prototype.updateTime = null; + + /** + * NodePool labels. + * @member {Object.} labels + * @memberof google.cloud.edgecontainer.v1.NodePool + * @instance + */ + NodePool.prototype.labels = $util.emptyObject; + + /** + * NodePool nodeLocation. + * @member {string} nodeLocation + * @memberof google.cloud.edgecontainer.v1.NodePool + * @instance + */ + NodePool.prototype.nodeLocation = ""; + + /** + * NodePool nodeCount. + * @member {number} nodeCount + * @memberof google.cloud.edgecontainer.v1.NodePool + * @instance + */ + NodePool.prototype.nodeCount = 0; + + /** + * NodePool machineFilter. + * @member {string} machineFilter + * @memberof google.cloud.edgecontainer.v1.NodePool + * @instance + */ + NodePool.prototype.machineFilter = ""; + + /** + * NodePool localDiskEncryption. + * @member {google.cloud.edgecontainer.v1.NodePool.ILocalDiskEncryption|null|undefined} localDiskEncryption + * @memberof google.cloud.edgecontainer.v1.NodePool + * @instance + */ + NodePool.prototype.localDiskEncryption = null; + + /** + * Creates a new NodePool instance using the specified properties. + * @function create + * @memberof google.cloud.edgecontainer.v1.NodePool + * @static + * @param {google.cloud.edgecontainer.v1.INodePool=} [properties] Properties to set + * @returns {google.cloud.edgecontainer.v1.NodePool} NodePool instance + */ + NodePool.create = function create(properties) { + return new NodePool(properties); + }; + + /** + * Encodes the specified NodePool message. Does not implicitly {@link google.cloud.edgecontainer.v1.NodePool.verify|verify} messages. + * @function encode + * @memberof google.cloud.edgecontainer.v1.NodePool + * @static + * @param {google.cloud.edgecontainer.v1.INodePool} message NodePool message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + NodePool.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.createTime != null && Object.hasOwnProperty.call(message, "createTime")) + $root.google.protobuf.Timestamp.encode(message.createTime, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + 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(); + if (message.labels != null && Object.hasOwnProperty.call(message, "labels")) + for (var keys = Object.keys(message.labels), i = 0; i < keys.length; ++i) + writer.uint32(/* id 4, wireType 2 =*/34).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.labels[keys[i]]).ldelim(); + if (message.nodeCount != null && Object.hasOwnProperty.call(message, "nodeCount")) + writer.uint32(/* id 6, wireType 0 =*/48).int32(message.nodeCount); + if (message.machineFilter != null && Object.hasOwnProperty.call(message, "machineFilter")) + writer.uint32(/* id 7, wireType 2 =*/58).string(message.machineFilter); + if (message.nodeLocation != null && Object.hasOwnProperty.call(message, "nodeLocation")) + writer.uint32(/* id 8, wireType 2 =*/66).string(message.nodeLocation); + if (message.localDiskEncryption != null && Object.hasOwnProperty.call(message, "localDiskEncryption")) + $root.google.cloud.edgecontainer.v1.NodePool.LocalDiskEncryption.encode(message.localDiskEncryption, writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified NodePool message, length delimited. Does not implicitly {@link google.cloud.edgecontainer.v1.NodePool.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.edgecontainer.v1.NodePool + * @static + * @param {google.cloud.edgecontainer.v1.INodePool} message NodePool message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + NodePool.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a NodePool message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.edgecontainer.v1.NodePool + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.edgecontainer.v1.NodePool} NodePool + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + NodePool.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.edgecontainer.v1.NodePool(), key, value; + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.createTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 3: { + message.updateTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 4: { + if (message.labels === $util.emptyObject) + message.labels = {}; + 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.labels[key] = value; + break; + } + case 8: { + message.nodeLocation = reader.string(); + break; + } + case 6: { + message.nodeCount = reader.int32(); + break; + } + case 7: { + message.machineFilter = reader.string(); + break; + } + case 9: { + message.localDiskEncryption = $root.google.cloud.edgecontainer.v1.NodePool.LocalDiskEncryption.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a NodePool message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.edgecontainer.v1.NodePool + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.edgecontainer.v1.NodePool} NodePool + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + NodePool.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a NodePool message. + * @function verify + * @memberof google.cloud.edgecontainer.v1.NodePool + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + NodePool.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.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.labels != null && message.hasOwnProperty("labels")) { + if (!$util.isObject(message.labels)) + return "labels: object expected"; + var key = Object.keys(message.labels); + for (var i = 0; i < key.length; ++i) + if (!$util.isString(message.labels[key[i]])) + return "labels: string{k:string} expected"; + } + if (message.nodeLocation != null && message.hasOwnProperty("nodeLocation")) + if (!$util.isString(message.nodeLocation)) + return "nodeLocation: string expected"; + if (message.nodeCount != null && message.hasOwnProperty("nodeCount")) + if (!$util.isInteger(message.nodeCount)) + return "nodeCount: integer expected"; + if (message.machineFilter != null && message.hasOwnProperty("machineFilter")) + if (!$util.isString(message.machineFilter)) + return "machineFilter: string expected"; + if (message.localDiskEncryption != null && message.hasOwnProperty("localDiskEncryption")) { + var error = $root.google.cloud.edgecontainer.v1.NodePool.LocalDiskEncryption.verify(message.localDiskEncryption); + if (error) + return "localDiskEncryption." + error; + } + return null; + }; + + /** + * Creates a NodePool message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.edgecontainer.v1.NodePool + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.edgecontainer.v1.NodePool} NodePool + */ + NodePool.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.edgecontainer.v1.NodePool) + return object; + var message = new $root.google.cloud.edgecontainer.v1.NodePool(); + if (object.name != null) + message.name = String(object.name); + if (object.createTime != null) { + if (typeof object.createTime !== "object") + throw TypeError(".google.cloud.edgecontainer.v1.NodePool.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.edgecontainer.v1.NodePool.updateTime: object expected"); + message.updateTime = $root.google.protobuf.Timestamp.fromObject(object.updateTime); + } + if (object.labels) { + if (typeof object.labels !== "object") + throw TypeError(".google.cloud.edgecontainer.v1.NodePool.labels: object expected"); + message.labels = {}; + for (var keys = Object.keys(object.labels), i = 0; i < keys.length; ++i) + message.labels[keys[i]] = String(object.labels[keys[i]]); + } + if (object.nodeLocation != null) + message.nodeLocation = String(object.nodeLocation); + if (object.nodeCount != null) + message.nodeCount = object.nodeCount | 0; + if (object.machineFilter != null) + message.machineFilter = String(object.machineFilter); + if (object.localDiskEncryption != null) { + if (typeof object.localDiskEncryption !== "object") + throw TypeError(".google.cloud.edgecontainer.v1.NodePool.localDiskEncryption: object expected"); + message.localDiskEncryption = $root.google.cloud.edgecontainer.v1.NodePool.LocalDiskEncryption.fromObject(object.localDiskEncryption); + } + return message; + }; + + /** + * Creates a plain object from a NodePool message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.edgecontainer.v1.NodePool + * @static + * @param {google.cloud.edgecontainer.v1.NodePool} message NodePool + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + NodePool.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.objects || options.defaults) + object.labels = {}; + if (options.defaults) { + object.name = ""; + object.createTime = null; + object.updateTime = null; + object.nodeCount = 0; + object.machineFilter = ""; + object.nodeLocation = ""; + object.localDiskEncryption = null; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + 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); + var keys2; + if (message.labels && (keys2 = Object.keys(message.labels)).length) { + object.labels = {}; + for (var j = 0; j < keys2.length; ++j) + object.labels[keys2[j]] = message.labels[keys2[j]]; + } + if (message.nodeCount != null && message.hasOwnProperty("nodeCount")) + object.nodeCount = message.nodeCount; + if (message.machineFilter != null && message.hasOwnProperty("machineFilter")) + object.machineFilter = message.machineFilter; + if (message.nodeLocation != null && message.hasOwnProperty("nodeLocation")) + object.nodeLocation = message.nodeLocation; + if (message.localDiskEncryption != null && message.hasOwnProperty("localDiskEncryption")) + object.localDiskEncryption = $root.google.cloud.edgecontainer.v1.NodePool.LocalDiskEncryption.toObject(message.localDiskEncryption, options); + return object; + }; + + /** + * Converts this NodePool to JSON. + * @function toJSON + * @memberof google.cloud.edgecontainer.v1.NodePool + * @instance + * @returns {Object.} JSON object + */ + NodePool.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for NodePool + * @function getTypeUrl + * @memberof google.cloud.edgecontainer.v1.NodePool + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + NodePool.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.edgecontainer.v1.NodePool"; + }; + + NodePool.LocalDiskEncryption = (function() { + + /** + * Properties of a LocalDiskEncryption. + * @memberof google.cloud.edgecontainer.v1.NodePool + * @interface ILocalDiskEncryption + * @property {string|null} [kmsKey] LocalDiskEncryption kmsKey + * @property {string|null} [kmsKeyActiveVersion] LocalDiskEncryption kmsKeyActiveVersion + * @property {google.cloud.edgecontainer.v1.KmsKeyState|null} [kmsKeyState] LocalDiskEncryption kmsKeyState + * @property {google.rpc.IStatus|null} [kmsStatus] LocalDiskEncryption kmsStatus + */ + + /** + * Constructs a new LocalDiskEncryption. + * @memberof google.cloud.edgecontainer.v1.NodePool + * @classdesc Represents a LocalDiskEncryption. + * @implements ILocalDiskEncryption + * @constructor + * @param {google.cloud.edgecontainer.v1.NodePool.ILocalDiskEncryption=} [properties] Properties to set + */ + function LocalDiskEncryption(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * LocalDiskEncryption kmsKey. + * @member {string} kmsKey + * @memberof google.cloud.edgecontainer.v1.NodePool.LocalDiskEncryption + * @instance + */ + LocalDiskEncryption.prototype.kmsKey = ""; + + /** + * LocalDiskEncryption kmsKeyActiveVersion. + * @member {string} kmsKeyActiveVersion + * @memberof google.cloud.edgecontainer.v1.NodePool.LocalDiskEncryption + * @instance + */ + LocalDiskEncryption.prototype.kmsKeyActiveVersion = ""; + + /** + * LocalDiskEncryption kmsKeyState. + * @member {google.cloud.edgecontainer.v1.KmsKeyState} kmsKeyState + * @memberof google.cloud.edgecontainer.v1.NodePool.LocalDiskEncryption + * @instance + */ + LocalDiskEncryption.prototype.kmsKeyState = 0; + + /** + * LocalDiskEncryption kmsStatus. + * @member {google.rpc.IStatus|null|undefined} kmsStatus + * @memberof google.cloud.edgecontainer.v1.NodePool.LocalDiskEncryption + * @instance + */ + LocalDiskEncryption.prototype.kmsStatus = null; + + /** + * Creates a new LocalDiskEncryption instance using the specified properties. + * @function create + * @memberof google.cloud.edgecontainer.v1.NodePool.LocalDiskEncryption + * @static + * @param {google.cloud.edgecontainer.v1.NodePool.ILocalDiskEncryption=} [properties] Properties to set + * @returns {google.cloud.edgecontainer.v1.NodePool.LocalDiskEncryption} LocalDiskEncryption instance + */ + LocalDiskEncryption.create = function create(properties) { + return new LocalDiskEncryption(properties); + }; + + /** + * Encodes the specified LocalDiskEncryption message. Does not implicitly {@link google.cloud.edgecontainer.v1.NodePool.LocalDiskEncryption.verify|verify} messages. + * @function encode + * @memberof google.cloud.edgecontainer.v1.NodePool.LocalDiskEncryption + * @static + * @param {google.cloud.edgecontainer.v1.NodePool.ILocalDiskEncryption} message LocalDiskEncryption message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + LocalDiskEncryption.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.kmsKey != null && Object.hasOwnProperty.call(message, "kmsKey")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.kmsKey); + if (message.kmsKeyActiveVersion != null && Object.hasOwnProperty.call(message, "kmsKeyActiveVersion")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.kmsKeyActiveVersion); + if (message.kmsKeyState != null && Object.hasOwnProperty.call(message, "kmsKeyState")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.kmsKeyState); + if (message.kmsStatus != null && Object.hasOwnProperty.call(message, "kmsStatus")) + $root.google.rpc.Status.encode(message.kmsStatus, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified LocalDiskEncryption message, length delimited. Does not implicitly {@link google.cloud.edgecontainer.v1.NodePool.LocalDiskEncryption.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.edgecontainer.v1.NodePool.LocalDiskEncryption + * @static + * @param {google.cloud.edgecontainer.v1.NodePool.ILocalDiskEncryption} message LocalDiskEncryption message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + LocalDiskEncryption.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a LocalDiskEncryption message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.edgecontainer.v1.NodePool.LocalDiskEncryption + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.edgecontainer.v1.NodePool.LocalDiskEncryption} LocalDiskEncryption + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + LocalDiskEncryption.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.edgecontainer.v1.NodePool.LocalDiskEncryption(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.kmsKey = reader.string(); + break; + } + case 2: { + message.kmsKeyActiveVersion = reader.string(); + break; + } + case 3: { + message.kmsKeyState = reader.int32(); + break; + } + case 4: { + message.kmsStatus = $root.google.rpc.Status.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a LocalDiskEncryption message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.edgecontainer.v1.NodePool.LocalDiskEncryption + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.edgecontainer.v1.NodePool.LocalDiskEncryption} LocalDiskEncryption + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + LocalDiskEncryption.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a LocalDiskEncryption message. + * @function verify + * @memberof google.cloud.edgecontainer.v1.NodePool.LocalDiskEncryption + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + LocalDiskEncryption.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.kmsKey != null && message.hasOwnProperty("kmsKey")) + if (!$util.isString(message.kmsKey)) + return "kmsKey: string expected"; + if (message.kmsKeyActiveVersion != null && message.hasOwnProperty("kmsKeyActiveVersion")) + if (!$util.isString(message.kmsKeyActiveVersion)) + return "kmsKeyActiveVersion: string expected"; + if (message.kmsKeyState != null && message.hasOwnProperty("kmsKeyState")) + switch (message.kmsKeyState) { + default: + return "kmsKeyState: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.kmsStatus != null && message.hasOwnProperty("kmsStatus")) { + var error = $root.google.rpc.Status.verify(message.kmsStatus); + if (error) + return "kmsStatus." + error; + } + return null; + }; + + /** + * Creates a LocalDiskEncryption message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.edgecontainer.v1.NodePool.LocalDiskEncryption + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.edgecontainer.v1.NodePool.LocalDiskEncryption} LocalDiskEncryption + */ + LocalDiskEncryption.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.edgecontainer.v1.NodePool.LocalDiskEncryption) + return object; + var message = new $root.google.cloud.edgecontainer.v1.NodePool.LocalDiskEncryption(); + if (object.kmsKey != null) + message.kmsKey = String(object.kmsKey); + if (object.kmsKeyActiveVersion != null) + message.kmsKeyActiveVersion = String(object.kmsKeyActiveVersion); + switch (object.kmsKeyState) { + default: + if (typeof object.kmsKeyState === "number") { + message.kmsKeyState = object.kmsKeyState; + break; + } + break; + case "KMS_KEY_STATE_UNSPECIFIED": + case 0: + message.kmsKeyState = 0; + break; + case "KMS_KEY_STATE_KEY_AVAILABLE": + case 1: + message.kmsKeyState = 1; + break; + case "KMS_KEY_STATE_KEY_UNAVAILABLE": + case 2: + message.kmsKeyState = 2; + break; + } + if (object.kmsStatus != null) { + if (typeof object.kmsStatus !== "object") + throw TypeError(".google.cloud.edgecontainer.v1.NodePool.LocalDiskEncryption.kmsStatus: object expected"); + message.kmsStatus = $root.google.rpc.Status.fromObject(object.kmsStatus); + } + return message; + }; + + /** + * Creates a plain object from a LocalDiskEncryption message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.edgecontainer.v1.NodePool.LocalDiskEncryption + * @static + * @param {google.cloud.edgecontainer.v1.NodePool.LocalDiskEncryption} message LocalDiskEncryption + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + LocalDiskEncryption.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.kmsKey = ""; + object.kmsKeyActiveVersion = ""; + object.kmsKeyState = options.enums === String ? "KMS_KEY_STATE_UNSPECIFIED" : 0; + object.kmsStatus = null; + } + if (message.kmsKey != null && message.hasOwnProperty("kmsKey")) + object.kmsKey = message.kmsKey; + if (message.kmsKeyActiveVersion != null && message.hasOwnProperty("kmsKeyActiveVersion")) + object.kmsKeyActiveVersion = message.kmsKeyActiveVersion; + if (message.kmsKeyState != null && message.hasOwnProperty("kmsKeyState")) + object.kmsKeyState = options.enums === String ? $root.google.cloud.edgecontainer.v1.KmsKeyState[message.kmsKeyState] === undefined ? message.kmsKeyState : $root.google.cloud.edgecontainer.v1.KmsKeyState[message.kmsKeyState] : message.kmsKeyState; + if (message.kmsStatus != null && message.hasOwnProperty("kmsStatus")) + object.kmsStatus = $root.google.rpc.Status.toObject(message.kmsStatus, options); + return object; + }; + + /** + * Converts this LocalDiskEncryption to JSON. + * @function toJSON + * @memberof google.cloud.edgecontainer.v1.NodePool.LocalDiskEncryption + * @instance + * @returns {Object.} JSON object + */ + LocalDiskEncryption.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for LocalDiskEncryption + * @function getTypeUrl + * @memberof google.cloud.edgecontainer.v1.NodePool.LocalDiskEncryption + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + LocalDiskEncryption.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.edgecontainer.v1.NodePool.LocalDiskEncryption"; + }; + + return LocalDiskEncryption; + })(); + + return NodePool; + })(); + + v1.Machine = (function() { + + /** + * Properties of a Machine. + * @memberof google.cloud.edgecontainer.v1 + * @interface IMachine + * @property {string|null} [name] Machine name + * @property {google.protobuf.ITimestamp|null} [createTime] Machine createTime + * @property {google.protobuf.ITimestamp|null} [updateTime] Machine updateTime + * @property {Object.|null} [labels] Machine labels + * @property {string|null} [hostedNode] Machine hostedNode + * @property {string|null} [zone] Machine zone + * @property {boolean|null} [disabled] Machine disabled + */ + + /** + * Constructs a new Machine. + * @memberof google.cloud.edgecontainer.v1 + * @classdesc Represents a Machine. + * @implements IMachine + * @constructor + * @param {google.cloud.edgecontainer.v1.IMachine=} [properties] Properties to set + */ + function Machine(properties) { + this.labels = {}; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Machine name. + * @member {string} name + * @memberof google.cloud.edgecontainer.v1.Machine + * @instance + */ + Machine.prototype.name = ""; + + /** + * Machine createTime. + * @member {google.protobuf.ITimestamp|null|undefined} createTime + * @memberof google.cloud.edgecontainer.v1.Machine + * @instance + */ + Machine.prototype.createTime = null; + + /** + * Machine updateTime. + * @member {google.protobuf.ITimestamp|null|undefined} updateTime + * @memberof google.cloud.edgecontainer.v1.Machine + * @instance + */ + Machine.prototype.updateTime = null; + + /** + * Machine labels. + * @member {Object.} labels + * @memberof google.cloud.edgecontainer.v1.Machine + * @instance + */ + Machine.prototype.labels = $util.emptyObject; + + /** + * Machine hostedNode. + * @member {string} hostedNode + * @memberof google.cloud.edgecontainer.v1.Machine + * @instance + */ + Machine.prototype.hostedNode = ""; + + /** + * Machine zone. + * @member {string} zone + * @memberof google.cloud.edgecontainer.v1.Machine + * @instance + */ + Machine.prototype.zone = ""; + + /** + * Machine disabled. + * @member {boolean} disabled + * @memberof google.cloud.edgecontainer.v1.Machine + * @instance + */ + Machine.prototype.disabled = false; + + /** + * Creates a new Machine instance using the specified properties. + * @function create + * @memberof google.cloud.edgecontainer.v1.Machine + * @static + * @param {google.cloud.edgecontainer.v1.IMachine=} [properties] Properties to set + * @returns {google.cloud.edgecontainer.v1.Machine} Machine instance + */ + Machine.create = function create(properties) { + return new Machine(properties); + }; + + /** + * Encodes the specified Machine message. Does not implicitly {@link google.cloud.edgecontainer.v1.Machine.verify|verify} messages. + * @function encode + * @memberof google.cloud.edgecontainer.v1.Machine + * @static + * @param {google.cloud.edgecontainer.v1.IMachine} message Machine message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Machine.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.createTime != null && Object.hasOwnProperty.call(message, "createTime")) + $root.google.protobuf.Timestamp.encode(message.createTime, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + 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(); + if (message.labels != null && Object.hasOwnProperty.call(message, "labels")) + for (var keys = Object.keys(message.labels), i = 0; i < keys.length; ++i) + writer.uint32(/* id 4, wireType 2 =*/34).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.labels[keys[i]]).ldelim(); + if (message.hostedNode != null && Object.hasOwnProperty.call(message, "hostedNode")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.hostedNode); + if (message.zone != null && Object.hasOwnProperty.call(message, "zone")) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.zone); + if (message.disabled != null && Object.hasOwnProperty.call(message, "disabled")) + writer.uint32(/* id 8, wireType 0 =*/64).bool(message.disabled); + return writer; + }; + + /** + * Encodes the specified Machine message, length delimited. Does not implicitly {@link google.cloud.edgecontainer.v1.Machine.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.edgecontainer.v1.Machine + * @static + * @param {google.cloud.edgecontainer.v1.IMachine} message Machine message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Machine.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Machine message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.edgecontainer.v1.Machine + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.edgecontainer.v1.Machine} Machine + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Machine.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.edgecontainer.v1.Machine(), key, value; + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.createTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 3: { + message.updateTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 4: { + if (message.labels === $util.emptyObject) + message.labels = {}; + 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.labels[key] = value; + break; + } + case 5: { + message.hostedNode = reader.string(); + break; + } + case 6: { + message.zone = reader.string(); + break; + } + case 8: { + message.disabled = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Machine message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.edgecontainer.v1.Machine + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.edgecontainer.v1.Machine} Machine + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Machine.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Machine message. + * @function verify + * @memberof google.cloud.edgecontainer.v1.Machine + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Machine.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.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.labels != null && message.hasOwnProperty("labels")) { + if (!$util.isObject(message.labels)) + return "labels: object expected"; + var key = Object.keys(message.labels); + for (var i = 0; i < key.length; ++i) + if (!$util.isString(message.labels[key[i]])) + return "labels: string{k:string} expected"; + } + if (message.hostedNode != null && message.hasOwnProperty("hostedNode")) + if (!$util.isString(message.hostedNode)) + return "hostedNode: string expected"; + if (message.zone != null && message.hasOwnProperty("zone")) + if (!$util.isString(message.zone)) + return "zone: string expected"; + if (message.disabled != null && message.hasOwnProperty("disabled")) + if (typeof message.disabled !== "boolean") + return "disabled: boolean expected"; + return null; + }; + + /** + * Creates a Machine message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.edgecontainer.v1.Machine + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.edgecontainer.v1.Machine} Machine + */ + Machine.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.edgecontainer.v1.Machine) + return object; + var message = new $root.google.cloud.edgecontainer.v1.Machine(); + if (object.name != null) + message.name = String(object.name); + if (object.createTime != null) { + if (typeof object.createTime !== "object") + throw TypeError(".google.cloud.edgecontainer.v1.Machine.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.edgecontainer.v1.Machine.updateTime: object expected"); + message.updateTime = $root.google.protobuf.Timestamp.fromObject(object.updateTime); + } + if (object.labels) { + if (typeof object.labels !== "object") + throw TypeError(".google.cloud.edgecontainer.v1.Machine.labels: object expected"); + message.labels = {}; + for (var keys = Object.keys(object.labels), i = 0; i < keys.length; ++i) + message.labels[keys[i]] = String(object.labels[keys[i]]); + } + if (object.hostedNode != null) + message.hostedNode = String(object.hostedNode); + if (object.zone != null) + message.zone = String(object.zone); + if (object.disabled != null) + message.disabled = Boolean(object.disabled); + return message; + }; + + /** + * Creates a plain object from a Machine message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.edgecontainer.v1.Machine + * @static + * @param {google.cloud.edgecontainer.v1.Machine} message Machine + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Machine.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.objects || options.defaults) + object.labels = {}; + if (options.defaults) { + object.name = ""; + object.createTime = null; + object.updateTime = null; + object.hostedNode = ""; + object.zone = ""; + object.disabled = false; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + 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); + var keys2; + if (message.labels && (keys2 = Object.keys(message.labels)).length) { + object.labels = {}; + for (var j = 0; j < keys2.length; ++j) + object.labels[keys2[j]] = message.labels[keys2[j]]; + } + if (message.hostedNode != null && message.hasOwnProperty("hostedNode")) + object.hostedNode = message.hostedNode; + if (message.zone != null && message.hasOwnProperty("zone")) + object.zone = message.zone; + if (message.disabled != null && message.hasOwnProperty("disabled")) + object.disabled = message.disabled; + return object; + }; + + /** + * Converts this Machine to JSON. + * @function toJSON + * @memberof google.cloud.edgecontainer.v1.Machine + * @instance + * @returns {Object.} JSON object + */ + Machine.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Machine + * @function getTypeUrl + * @memberof google.cloud.edgecontainer.v1.Machine + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Machine.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.edgecontainer.v1.Machine"; + }; + + return Machine; + })(); + + v1.VpnConnection = (function() { + + /** + * Properties of a VpnConnection. + * @memberof google.cloud.edgecontainer.v1 + * @interface IVpnConnection + * @property {string|null} [name] VpnConnection name + * @property {google.protobuf.ITimestamp|null} [createTime] VpnConnection createTime + * @property {google.protobuf.ITimestamp|null} [updateTime] VpnConnection updateTime + * @property {Object.|null} [labels] VpnConnection labels + * @property {string|null} [natGatewayIp] VpnConnection natGatewayIp + * @property {google.cloud.edgecontainer.v1.VpnConnection.BgpRoutingMode|null} [bgpRoutingMode] VpnConnection bgpRoutingMode + * @property {string|null} [cluster] VpnConnection cluster + * @property {string|null} [vpc] VpnConnection vpc + * @property {google.cloud.edgecontainer.v1.VpnConnection.IVpcProject|null} [vpcProject] VpnConnection vpcProject + * @property {boolean|null} [enableHighAvailability] VpnConnection enableHighAvailability + * @property {google.cloud.edgecontainer.v1.VpnConnection.IDetails|null} [details] VpnConnection details + */ + + /** + * Constructs a new VpnConnection. + * @memberof google.cloud.edgecontainer.v1 + * @classdesc Represents a VpnConnection. + * @implements IVpnConnection + * @constructor + * @param {google.cloud.edgecontainer.v1.IVpnConnection=} [properties] Properties to set + */ + function VpnConnection(properties) { + this.labels = {}; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * VpnConnection name. + * @member {string} name + * @memberof google.cloud.edgecontainer.v1.VpnConnection + * @instance + */ + VpnConnection.prototype.name = ""; + + /** + * VpnConnection createTime. + * @member {google.protobuf.ITimestamp|null|undefined} createTime + * @memberof google.cloud.edgecontainer.v1.VpnConnection + * @instance + */ + VpnConnection.prototype.createTime = null; + + /** + * VpnConnection updateTime. + * @member {google.protobuf.ITimestamp|null|undefined} updateTime + * @memberof google.cloud.edgecontainer.v1.VpnConnection + * @instance + */ + VpnConnection.prototype.updateTime = null; + + /** + * VpnConnection labels. + * @member {Object.} labels + * @memberof google.cloud.edgecontainer.v1.VpnConnection + * @instance + */ + VpnConnection.prototype.labels = $util.emptyObject; + + /** + * VpnConnection natGatewayIp. + * @member {string} natGatewayIp + * @memberof google.cloud.edgecontainer.v1.VpnConnection + * @instance + */ + VpnConnection.prototype.natGatewayIp = ""; + + /** + * VpnConnection bgpRoutingMode. + * @member {google.cloud.edgecontainer.v1.VpnConnection.BgpRoutingMode} bgpRoutingMode + * @memberof google.cloud.edgecontainer.v1.VpnConnection + * @instance + */ + VpnConnection.prototype.bgpRoutingMode = 0; + + /** + * VpnConnection cluster. + * @member {string} cluster + * @memberof google.cloud.edgecontainer.v1.VpnConnection + * @instance + */ + VpnConnection.prototype.cluster = ""; + + /** + * VpnConnection vpc. + * @member {string} vpc + * @memberof google.cloud.edgecontainer.v1.VpnConnection + * @instance + */ + VpnConnection.prototype.vpc = ""; + + /** + * VpnConnection vpcProject. + * @member {google.cloud.edgecontainer.v1.VpnConnection.IVpcProject|null|undefined} vpcProject + * @memberof google.cloud.edgecontainer.v1.VpnConnection + * @instance + */ + VpnConnection.prototype.vpcProject = null; + + /** + * VpnConnection enableHighAvailability. + * @member {boolean} enableHighAvailability + * @memberof google.cloud.edgecontainer.v1.VpnConnection + * @instance + */ + VpnConnection.prototype.enableHighAvailability = false; + + /** + * VpnConnection details. + * @member {google.cloud.edgecontainer.v1.VpnConnection.IDetails|null|undefined} details + * @memberof google.cloud.edgecontainer.v1.VpnConnection + * @instance + */ + VpnConnection.prototype.details = null; + + /** + * Creates a new VpnConnection instance using the specified properties. + * @function create + * @memberof google.cloud.edgecontainer.v1.VpnConnection + * @static + * @param {google.cloud.edgecontainer.v1.IVpnConnection=} [properties] Properties to set + * @returns {google.cloud.edgecontainer.v1.VpnConnection} VpnConnection instance + */ + VpnConnection.create = function create(properties) { + return new VpnConnection(properties); + }; + + /** + * Encodes the specified VpnConnection message. Does not implicitly {@link google.cloud.edgecontainer.v1.VpnConnection.verify|verify} messages. + * @function encode + * @memberof google.cloud.edgecontainer.v1.VpnConnection + * @static + * @param {google.cloud.edgecontainer.v1.IVpnConnection} message VpnConnection message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + VpnConnection.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.createTime != null && Object.hasOwnProperty.call(message, "createTime")) + $root.google.protobuf.Timestamp.encode(message.createTime, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + 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(); + if (message.labels != null && Object.hasOwnProperty.call(message, "labels")) + for (var keys = Object.keys(message.labels), i = 0; i < keys.length; ++i) + writer.uint32(/* id 4, wireType 2 =*/34).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.labels[keys[i]]).ldelim(); + if (message.natGatewayIp != null && Object.hasOwnProperty.call(message, "natGatewayIp")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.natGatewayIp); + if (message.bgpRoutingMode != null && Object.hasOwnProperty.call(message, "bgpRoutingMode")) + writer.uint32(/* id 6, wireType 0 =*/48).int32(message.bgpRoutingMode); + if (message.cluster != null && Object.hasOwnProperty.call(message, "cluster")) + writer.uint32(/* id 7, wireType 2 =*/58).string(message.cluster); + if (message.vpc != null && Object.hasOwnProperty.call(message, "vpc")) + writer.uint32(/* id 8, wireType 2 =*/66).string(message.vpc); + if (message.enableHighAvailability != null && Object.hasOwnProperty.call(message, "enableHighAvailability")) + writer.uint32(/* id 9, wireType 0 =*/72).bool(message.enableHighAvailability); + if (message.details != null && Object.hasOwnProperty.call(message, "details")) + $root.google.cloud.edgecontainer.v1.VpnConnection.Details.encode(message.details, writer.uint32(/* id 10, wireType 2 =*/82).fork()).ldelim(); + if (message.vpcProject != null && Object.hasOwnProperty.call(message, "vpcProject")) + $root.google.cloud.edgecontainer.v1.VpnConnection.VpcProject.encode(message.vpcProject, writer.uint32(/* id 11, wireType 2 =*/90).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified VpnConnection message, length delimited. Does not implicitly {@link google.cloud.edgecontainer.v1.VpnConnection.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.edgecontainer.v1.VpnConnection + * @static + * @param {google.cloud.edgecontainer.v1.IVpnConnection} message VpnConnection message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + VpnConnection.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a VpnConnection message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.edgecontainer.v1.VpnConnection + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.edgecontainer.v1.VpnConnection} VpnConnection + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + VpnConnection.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.edgecontainer.v1.VpnConnection(), key, value; + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.createTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 3: { + message.updateTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 4: { + if (message.labels === $util.emptyObject) + message.labels = {}; + 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.labels[key] = value; + break; + } + case 5: { + message.natGatewayIp = reader.string(); + break; + } + case 6: { + message.bgpRoutingMode = reader.int32(); + break; + } + case 7: { + message.cluster = reader.string(); + break; + } + case 8: { + message.vpc = reader.string(); + break; + } + case 11: { + message.vpcProject = $root.google.cloud.edgecontainer.v1.VpnConnection.VpcProject.decode(reader, reader.uint32()); + break; + } + case 9: { + message.enableHighAvailability = reader.bool(); + break; + } + case 10: { + message.details = $root.google.cloud.edgecontainer.v1.VpnConnection.Details.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a VpnConnection message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.edgecontainer.v1.VpnConnection + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.edgecontainer.v1.VpnConnection} VpnConnection + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + VpnConnection.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a VpnConnection message. + * @function verify + * @memberof google.cloud.edgecontainer.v1.VpnConnection + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + VpnConnection.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.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.labels != null && message.hasOwnProperty("labels")) { + if (!$util.isObject(message.labels)) + return "labels: object expected"; + var key = Object.keys(message.labels); + for (var i = 0; i < key.length; ++i) + if (!$util.isString(message.labels[key[i]])) + return "labels: string{k:string} expected"; + } + if (message.natGatewayIp != null && message.hasOwnProperty("natGatewayIp")) + if (!$util.isString(message.natGatewayIp)) + return "natGatewayIp: string expected"; + if (message.bgpRoutingMode != null && message.hasOwnProperty("bgpRoutingMode")) + switch (message.bgpRoutingMode) { + default: + return "bgpRoutingMode: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.cluster != null && message.hasOwnProperty("cluster")) + if (!$util.isString(message.cluster)) + return "cluster: string expected"; + if (message.vpc != null && message.hasOwnProperty("vpc")) + if (!$util.isString(message.vpc)) + return "vpc: string expected"; + if (message.vpcProject != null && message.hasOwnProperty("vpcProject")) { + var error = $root.google.cloud.edgecontainer.v1.VpnConnection.VpcProject.verify(message.vpcProject); + if (error) + return "vpcProject." + error; + } + if (message.enableHighAvailability != null && message.hasOwnProperty("enableHighAvailability")) + if (typeof message.enableHighAvailability !== "boolean") + return "enableHighAvailability: boolean expected"; + if (message.details != null && message.hasOwnProperty("details")) { + var error = $root.google.cloud.edgecontainer.v1.VpnConnection.Details.verify(message.details); + if (error) + return "details." + error; + } + return null; + }; + + /** + * Creates a VpnConnection message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.edgecontainer.v1.VpnConnection + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.edgecontainer.v1.VpnConnection} VpnConnection + */ + VpnConnection.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.edgecontainer.v1.VpnConnection) + return object; + var message = new $root.google.cloud.edgecontainer.v1.VpnConnection(); + if (object.name != null) + message.name = String(object.name); + if (object.createTime != null) { + if (typeof object.createTime !== "object") + throw TypeError(".google.cloud.edgecontainer.v1.VpnConnection.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.edgecontainer.v1.VpnConnection.updateTime: object expected"); + message.updateTime = $root.google.protobuf.Timestamp.fromObject(object.updateTime); + } + if (object.labels) { + if (typeof object.labels !== "object") + throw TypeError(".google.cloud.edgecontainer.v1.VpnConnection.labels: object expected"); + message.labels = {}; + for (var keys = Object.keys(object.labels), i = 0; i < keys.length; ++i) + message.labels[keys[i]] = String(object.labels[keys[i]]); + } + if (object.natGatewayIp != null) + message.natGatewayIp = String(object.natGatewayIp); + switch (object.bgpRoutingMode) { + default: + if (typeof object.bgpRoutingMode === "number") { + message.bgpRoutingMode = object.bgpRoutingMode; + break; + } + break; + case "BGP_ROUTING_MODE_UNSPECIFIED": + case 0: + message.bgpRoutingMode = 0; + break; + case "REGIONAL": + case 1: + message.bgpRoutingMode = 1; + break; + case "GLOBAL": + case 2: + message.bgpRoutingMode = 2; + break; + } + if (object.cluster != null) + message.cluster = String(object.cluster); + if (object.vpc != null) + message.vpc = String(object.vpc); + if (object.vpcProject != null) { + if (typeof object.vpcProject !== "object") + throw TypeError(".google.cloud.edgecontainer.v1.VpnConnection.vpcProject: object expected"); + message.vpcProject = $root.google.cloud.edgecontainer.v1.VpnConnection.VpcProject.fromObject(object.vpcProject); + } + if (object.enableHighAvailability != null) + message.enableHighAvailability = Boolean(object.enableHighAvailability); + if (object.details != null) { + if (typeof object.details !== "object") + throw TypeError(".google.cloud.edgecontainer.v1.VpnConnection.details: object expected"); + message.details = $root.google.cloud.edgecontainer.v1.VpnConnection.Details.fromObject(object.details); + } + return message; + }; + + /** + * Creates a plain object from a VpnConnection message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.edgecontainer.v1.VpnConnection + * @static + * @param {google.cloud.edgecontainer.v1.VpnConnection} message VpnConnection + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + VpnConnection.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.objects || options.defaults) + object.labels = {}; + if (options.defaults) { + object.name = ""; + object.createTime = null; + object.updateTime = null; + object.natGatewayIp = ""; + object.bgpRoutingMode = options.enums === String ? "BGP_ROUTING_MODE_UNSPECIFIED" : 0; + object.cluster = ""; + object.vpc = ""; + object.enableHighAvailability = false; + object.details = null; + object.vpcProject = null; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + 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); + var keys2; + if (message.labels && (keys2 = Object.keys(message.labels)).length) { + object.labels = {}; + for (var j = 0; j < keys2.length; ++j) + object.labels[keys2[j]] = message.labels[keys2[j]]; + } + if (message.natGatewayIp != null && message.hasOwnProperty("natGatewayIp")) + object.natGatewayIp = message.natGatewayIp; + if (message.bgpRoutingMode != null && message.hasOwnProperty("bgpRoutingMode")) + object.bgpRoutingMode = options.enums === String ? $root.google.cloud.edgecontainer.v1.VpnConnection.BgpRoutingMode[message.bgpRoutingMode] === undefined ? message.bgpRoutingMode : $root.google.cloud.edgecontainer.v1.VpnConnection.BgpRoutingMode[message.bgpRoutingMode] : message.bgpRoutingMode; + if (message.cluster != null && message.hasOwnProperty("cluster")) + object.cluster = message.cluster; + if (message.vpc != null && message.hasOwnProperty("vpc")) + object.vpc = message.vpc; + if (message.enableHighAvailability != null && message.hasOwnProperty("enableHighAvailability")) + object.enableHighAvailability = message.enableHighAvailability; + if (message.details != null && message.hasOwnProperty("details")) + object.details = $root.google.cloud.edgecontainer.v1.VpnConnection.Details.toObject(message.details, options); + if (message.vpcProject != null && message.hasOwnProperty("vpcProject")) + object.vpcProject = $root.google.cloud.edgecontainer.v1.VpnConnection.VpcProject.toObject(message.vpcProject, options); + return object; + }; + + /** + * Converts this VpnConnection to JSON. + * @function toJSON + * @memberof google.cloud.edgecontainer.v1.VpnConnection + * @instance + * @returns {Object.} JSON object + */ + VpnConnection.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for VpnConnection + * @function getTypeUrl + * @memberof google.cloud.edgecontainer.v1.VpnConnection + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + VpnConnection.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.edgecontainer.v1.VpnConnection"; + }; + + VpnConnection.VpcProject = (function() { + + /** + * Properties of a VpcProject. + * @memberof google.cloud.edgecontainer.v1.VpnConnection + * @interface IVpcProject + * @property {string|null} [projectId] VpcProject projectId + * @property {string|null} [serviceAccount] VpcProject serviceAccount + */ + + /** + * Constructs a new VpcProject. + * @memberof google.cloud.edgecontainer.v1.VpnConnection + * @classdesc Represents a VpcProject. + * @implements IVpcProject + * @constructor + * @param {google.cloud.edgecontainer.v1.VpnConnection.IVpcProject=} [properties] Properties to set + */ + function VpcProject(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * VpcProject projectId. + * @member {string} projectId + * @memberof google.cloud.edgecontainer.v1.VpnConnection.VpcProject + * @instance + */ + VpcProject.prototype.projectId = ""; + + /** + * VpcProject serviceAccount. + * @member {string} serviceAccount + * @memberof google.cloud.edgecontainer.v1.VpnConnection.VpcProject + * @instance + */ + VpcProject.prototype.serviceAccount = ""; + + /** + * Creates a new VpcProject instance using the specified properties. + * @function create + * @memberof google.cloud.edgecontainer.v1.VpnConnection.VpcProject + * @static + * @param {google.cloud.edgecontainer.v1.VpnConnection.IVpcProject=} [properties] Properties to set + * @returns {google.cloud.edgecontainer.v1.VpnConnection.VpcProject} VpcProject instance + */ + VpcProject.create = function create(properties) { + return new VpcProject(properties); + }; + + /** + * Encodes the specified VpcProject message. Does not implicitly {@link google.cloud.edgecontainer.v1.VpnConnection.VpcProject.verify|verify} messages. + * @function encode + * @memberof google.cloud.edgecontainer.v1.VpnConnection.VpcProject + * @static + * @param {google.cloud.edgecontainer.v1.VpnConnection.IVpcProject} message VpcProject message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + VpcProject.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.projectId != null && Object.hasOwnProperty.call(message, "projectId")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.projectId); + if (message.serviceAccount != null && Object.hasOwnProperty.call(message, "serviceAccount")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.serviceAccount); + return writer; + }; + + /** + * Encodes the specified VpcProject message, length delimited. Does not implicitly {@link google.cloud.edgecontainer.v1.VpnConnection.VpcProject.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.edgecontainer.v1.VpnConnection.VpcProject + * @static + * @param {google.cloud.edgecontainer.v1.VpnConnection.IVpcProject} message VpcProject message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + VpcProject.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a VpcProject message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.edgecontainer.v1.VpnConnection.VpcProject + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.edgecontainer.v1.VpnConnection.VpcProject} VpcProject + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + VpcProject.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.edgecontainer.v1.VpnConnection.VpcProject(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.projectId = reader.string(); + break; + } + case 2: { + message.serviceAccount = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a VpcProject message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.edgecontainer.v1.VpnConnection.VpcProject + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.edgecontainer.v1.VpnConnection.VpcProject} VpcProject + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + VpcProject.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a VpcProject message. + * @function verify + * @memberof google.cloud.edgecontainer.v1.VpnConnection.VpcProject + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + VpcProject.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.projectId != null && message.hasOwnProperty("projectId")) + if (!$util.isString(message.projectId)) + return "projectId: string expected"; + if (message.serviceAccount != null && message.hasOwnProperty("serviceAccount")) + if (!$util.isString(message.serviceAccount)) + return "serviceAccount: string expected"; + return null; + }; + + /** + * Creates a VpcProject message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.edgecontainer.v1.VpnConnection.VpcProject + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.edgecontainer.v1.VpnConnection.VpcProject} VpcProject + */ + VpcProject.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.edgecontainer.v1.VpnConnection.VpcProject) + return object; + var message = new $root.google.cloud.edgecontainer.v1.VpnConnection.VpcProject(); + if (object.projectId != null) + message.projectId = String(object.projectId); + if (object.serviceAccount != null) + message.serviceAccount = String(object.serviceAccount); + return message; + }; + + /** + * Creates a plain object from a VpcProject message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.edgecontainer.v1.VpnConnection.VpcProject + * @static + * @param {google.cloud.edgecontainer.v1.VpnConnection.VpcProject} message VpcProject + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + VpcProject.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.projectId = ""; + object.serviceAccount = ""; + } + if (message.projectId != null && message.hasOwnProperty("projectId")) + object.projectId = message.projectId; + if (message.serviceAccount != null && message.hasOwnProperty("serviceAccount")) + object.serviceAccount = message.serviceAccount; + return object; + }; + + /** + * Converts this VpcProject to JSON. + * @function toJSON + * @memberof google.cloud.edgecontainer.v1.VpnConnection.VpcProject + * @instance + * @returns {Object.} JSON object + */ + VpcProject.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for VpcProject + * @function getTypeUrl + * @memberof google.cloud.edgecontainer.v1.VpnConnection.VpcProject + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + VpcProject.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.edgecontainer.v1.VpnConnection.VpcProject"; + }; + + return VpcProject; + })(); + + VpnConnection.Details = (function() { + + /** + * Properties of a Details. + * @memberof google.cloud.edgecontainer.v1.VpnConnection + * @interface IDetails + * @property {google.cloud.edgecontainer.v1.VpnConnection.Details.State|null} [state] Details state + * @property {string|null} [error] Details error + * @property {google.cloud.edgecontainer.v1.VpnConnection.Details.ICloudRouter|null} [cloudRouter] Details cloudRouter + * @property {Array.|null} [cloudVpns] Details cloudVpns + */ + + /** + * Constructs a new Details. + * @memberof google.cloud.edgecontainer.v1.VpnConnection + * @classdesc Represents a Details. + * @implements IDetails + * @constructor + * @param {google.cloud.edgecontainer.v1.VpnConnection.IDetails=} [properties] Properties to set + */ + function Details(properties) { + this.cloudVpns = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Details state. + * @member {google.cloud.edgecontainer.v1.VpnConnection.Details.State} state + * @memberof google.cloud.edgecontainer.v1.VpnConnection.Details + * @instance + */ + Details.prototype.state = 0; + + /** + * Details error. + * @member {string} error + * @memberof google.cloud.edgecontainer.v1.VpnConnection.Details + * @instance + */ + Details.prototype.error = ""; + + /** + * Details cloudRouter. + * @member {google.cloud.edgecontainer.v1.VpnConnection.Details.ICloudRouter|null|undefined} cloudRouter + * @memberof google.cloud.edgecontainer.v1.VpnConnection.Details + * @instance + */ + Details.prototype.cloudRouter = null; + + /** + * Details cloudVpns. + * @member {Array.} cloudVpns + * @memberof google.cloud.edgecontainer.v1.VpnConnection.Details + * @instance + */ + Details.prototype.cloudVpns = $util.emptyArray; + + /** + * Creates a new Details instance using the specified properties. + * @function create + * @memberof google.cloud.edgecontainer.v1.VpnConnection.Details + * @static + * @param {google.cloud.edgecontainer.v1.VpnConnection.IDetails=} [properties] Properties to set + * @returns {google.cloud.edgecontainer.v1.VpnConnection.Details} Details instance + */ + Details.create = function create(properties) { + return new Details(properties); + }; + + /** + * Encodes the specified Details message. Does not implicitly {@link google.cloud.edgecontainer.v1.VpnConnection.Details.verify|verify} messages. + * @function encode + * @memberof google.cloud.edgecontainer.v1.VpnConnection.Details + * @static + * @param {google.cloud.edgecontainer.v1.VpnConnection.IDetails} message Details message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Details.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.state != null && Object.hasOwnProperty.call(message, "state")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.state); + if (message.error != null && Object.hasOwnProperty.call(message, "error")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.error); + if (message.cloudRouter != null && Object.hasOwnProperty.call(message, "cloudRouter")) + $root.google.cloud.edgecontainer.v1.VpnConnection.Details.CloudRouter.encode(message.cloudRouter, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.cloudVpns != null && message.cloudVpns.length) + for (var i = 0; i < message.cloudVpns.length; ++i) + $root.google.cloud.edgecontainer.v1.VpnConnection.Details.CloudVpn.encode(message.cloudVpns[i], writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified Details message, length delimited. Does not implicitly {@link google.cloud.edgecontainer.v1.VpnConnection.Details.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.edgecontainer.v1.VpnConnection.Details + * @static + * @param {google.cloud.edgecontainer.v1.VpnConnection.IDetails} message Details message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Details.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Details message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.edgecontainer.v1.VpnConnection.Details + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.edgecontainer.v1.VpnConnection.Details} Details + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Details.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.edgecontainer.v1.VpnConnection.Details(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.state = reader.int32(); + break; + } + case 2: { + message.error = reader.string(); + break; + } + case 3: { + message.cloudRouter = $root.google.cloud.edgecontainer.v1.VpnConnection.Details.CloudRouter.decode(reader, reader.uint32()); + break; + } + case 4: { + if (!(message.cloudVpns && message.cloudVpns.length)) + message.cloudVpns = []; + message.cloudVpns.push($root.google.cloud.edgecontainer.v1.VpnConnection.Details.CloudVpn.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Details message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.edgecontainer.v1.VpnConnection.Details + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.edgecontainer.v1.VpnConnection.Details} Details + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Details.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Details message. + * @function verify + * @memberof google.cloud.edgecontainer.v1.VpnConnection.Details + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Details.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.state != null && message.hasOwnProperty("state")) + switch (message.state) { + default: + return "state: enum value expected"; + case 0: + case 1: + case 2: + case 3: + break; + } + if (message.error != null && message.hasOwnProperty("error")) + if (!$util.isString(message.error)) + return "error: string expected"; + if (message.cloudRouter != null && message.hasOwnProperty("cloudRouter")) { + var error = $root.google.cloud.edgecontainer.v1.VpnConnection.Details.CloudRouter.verify(message.cloudRouter); + if (error) + return "cloudRouter." + error; + } + if (message.cloudVpns != null && message.hasOwnProperty("cloudVpns")) { + if (!Array.isArray(message.cloudVpns)) + return "cloudVpns: array expected"; + for (var i = 0; i < message.cloudVpns.length; ++i) { + var error = $root.google.cloud.edgecontainer.v1.VpnConnection.Details.CloudVpn.verify(message.cloudVpns[i]); + if (error) + return "cloudVpns." + error; + } + } + return null; + }; + + /** + * Creates a Details message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.edgecontainer.v1.VpnConnection.Details + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.edgecontainer.v1.VpnConnection.Details} Details + */ + Details.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.edgecontainer.v1.VpnConnection.Details) + return object; + var message = new $root.google.cloud.edgecontainer.v1.VpnConnection.Details(); + 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 "STATE_CONNECTED": + case 1: + message.state = 1; + break; + case "STATE_CONNECTING": + case 2: + message.state = 2; + break; + case "STATE_ERROR": + case 3: + message.state = 3; + break; + } + if (object.error != null) + message.error = String(object.error); + if (object.cloudRouter != null) { + if (typeof object.cloudRouter !== "object") + throw TypeError(".google.cloud.edgecontainer.v1.VpnConnection.Details.cloudRouter: object expected"); + message.cloudRouter = $root.google.cloud.edgecontainer.v1.VpnConnection.Details.CloudRouter.fromObject(object.cloudRouter); + } + if (object.cloudVpns) { + if (!Array.isArray(object.cloudVpns)) + throw TypeError(".google.cloud.edgecontainer.v1.VpnConnection.Details.cloudVpns: array expected"); + message.cloudVpns = []; + for (var i = 0; i < object.cloudVpns.length; ++i) { + if (typeof object.cloudVpns[i] !== "object") + throw TypeError(".google.cloud.edgecontainer.v1.VpnConnection.Details.cloudVpns: object expected"); + message.cloudVpns[i] = $root.google.cloud.edgecontainer.v1.VpnConnection.Details.CloudVpn.fromObject(object.cloudVpns[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a Details message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.edgecontainer.v1.VpnConnection.Details + * @static + * @param {google.cloud.edgecontainer.v1.VpnConnection.Details} message Details + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Details.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.cloudVpns = []; + if (options.defaults) { + object.state = options.enums === String ? "STATE_UNSPECIFIED" : 0; + object.error = ""; + object.cloudRouter = null; + } + if (message.state != null && message.hasOwnProperty("state")) + object.state = options.enums === String ? $root.google.cloud.edgecontainer.v1.VpnConnection.Details.State[message.state] === undefined ? message.state : $root.google.cloud.edgecontainer.v1.VpnConnection.Details.State[message.state] : message.state; + if (message.error != null && message.hasOwnProperty("error")) + object.error = message.error; + if (message.cloudRouter != null && message.hasOwnProperty("cloudRouter")) + object.cloudRouter = $root.google.cloud.edgecontainer.v1.VpnConnection.Details.CloudRouter.toObject(message.cloudRouter, options); + if (message.cloudVpns && message.cloudVpns.length) { + object.cloudVpns = []; + for (var j = 0; j < message.cloudVpns.length; ++j) + object.cloudVpns[j] = $root.google.cloud.edgecontainer.v1.VpnConnection.Details.CloudVpn.toObject(message.cloudVpns[j], options); + } + return object; + }; + + /** + * Converts this Details to JSON. + * @function toJSON + * @memberof google.cloud.edgecontainer.v1.VpnConnection.Details + * @instance + * @returns {Object.} JSON object + */ + Details.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Details + * @function getTypeUrl + * @memberof google.cloud.edgecontainer.v1.VpnConnection.Details + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Details.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.edgecontainer.v1.VpnConnection.Details"; + }; + + Details.CloudRouter = (function() { + + /** + * Properties of a CloudRouter. + * @memberof google.cloud.edgecontainer.v1.VpnConnection.Details + * @interface ICloudRouter + * @property {string|null} [name] CloudRouter name + */ + + /** + * Constructs a new CloudRouter. + * @memberof google.cloud.edgecontainer.v1.VpnConnection.Details + * @classdesc Represents a CloudRouter. + * @implements ICloudRouter + * @constructor + * @param {google.cloud.edgecontainer.v1.VpnConnection.Details.ICloudRouter=} [properties] Properties to set + */ + function CloudRouter(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * CloudRouter name. + * @member {string} name + * @memberof google.cloud.edgecontainer.v1.VpnConnection.Details.CloudRouter + * @instance + */ + CloudRouter.prototype.name = ""; + + /** + * Creates a new CloudRouter instance using the specified properties. + * @function create + * @memberof google.cloud.edgecontainer.v1.VpnConnection.Details.CloudRouter + * @static + * @param {google.cloud.edgecontainer.v1.VpnConnection.Details.ICloudRouter=} [properties] Properties to set + * @returns {google.cloud.edgecontainer.v1.VpnConnection.Details.CloudRouter} CloudRouter instance + */ + CloudRouter.create = function create(properties) { + return new CloudRouter(properties); + }; + + /** + * Encodes the specified CloudRouter message. Does not implicitly {@link google.cloud.edgecontainer.v1.VpnConnection.Details.CloudRouter.verify|verify} messages. + * @function encode + * @memberof google.cloud.edgecontainer.v1.VpnConnection.Details.CloudRouter + * @static + * @param {google.cloud.edgecontainer.v1.VpnConnection.Details.ICloudRouter} message CloudRouter message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CloudRouter.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 CloudRouter message, length delimited. Does not implicitly {@link google.cloud.edgecontainer.v1.VpnConnection.Details.CloudRouter.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.edgecontainer.v1.VpnConnection.Details.CloudRouter + * @static + * @param {google.cloud.edgecontainer.v1.VpnConnection.Details.ICloudRouter} message CloudRouter message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CloudRouter.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CloudRouter message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.edgecontainer.v1.VpnConnection.Details.CloudRouter + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.edgecontainer.v1.VpnConnection.Details.CloudRouter} CloudRouter + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CloudRouter.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.edgecontainer.v1.VpnConnection.Details.CloudRouter(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CloudRouter message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.edgecontainer.v1.VpnConnection.Details.CloudRouter + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.edgecontainer.v1.VpnConnection.Details.CloudRouter} CloudRouter + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CloudRouter.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CloudRouter message. + * @function verify + * @memberof google.cloud.edgecontainer.v1.VpnConnection.Details.CloudRouter + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CloudRouter.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 CloudRouter message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.edgecontainer.v1.VpnConnection.Details.CloudRouter + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.edgecontainer.v1.VpnConnection.Details.CloudRouter} CloudRouter + */ + CloudRouter.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.edgecontainer.v1.VpnConnection.Details.CloudRouter) + return object; + var message = new $root.google.cloud.edgecontainer.v1.VpnConnection.Details.CloudRouter(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a CloudRouter message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.edgecontainer.v1.VpnConnection.Details.CloudRouter + * @static + * @param {google.cloud.edgecontainer.v1.VpnConnection.Details.CloudRouter} message CloudRouter + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CloudRouter.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 CloudRouter to JSON. + * @function toJSON + * @memberof google.cloud.edgecontainer.v1.VpnConnection.Details.CloudRouter + * @instance + * @returns {Object.} JSON object + */ + CloudRouter.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CloudRouter + * @function getTypeUrl + * @memberof google.cloud.edgecontainer.v1.VpnConnection.Details.CloudRouter + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CloudRouter.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.edgecontainer.v1.VpnConnection.Details.CloudRouter"; + }; + + return CloudRouter; + })(); + + Details.CloudVpn = (function() { + + /** + * Properties of a CloudVpn. + * @memberof google.cloud.edgecontainer.v1.VpnConnection.Details + * @interface ICloudVpn + * @property {string|null} [gateway] CloudVpn gateway + */ + + /** + * Constructs a new CloudVpn. + * @memberof google.cloud.edgecontainer.v1.VpnConnection.Details + * @classdesc Represents a CloudVpn. + * @implements ICloudVpn + * @constructor + * @param {google.cloud.edgecontainer.v1.VpnConnection.Details.ICloudVpn=} [properties] Properties to set + */ + function CloudVpn(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * CloudVpn gateway. + * @member {string} gateway + * @memberof google.cloud.edgecontainer.v1.VpnConnection.Details.CloudVpn + * @instance + */ + CloudVpn.prototype.gateway = ""; + + /** + * Creates a new CloudVpn instance using the specified properties. + * @function create + * @memberof google.cloud.edgecontainer.v1.VpnConnection.Details.CloudVpn + * @static + * @param {google.cloud.edgecontainer.v1.VpnConnection.Details.ICloudVpn=} [properties] Properties to set + * @returns {google.cloud.edgecontainer.v1.VpnConnection.Details.CloudVpn} CloudVpn instance + */ + CloudVpn.create = function create(properties) { + return new CloudVpn(properties); + }; + + /** + * Encodes the specified CloudVpn message. Does not implicitly {@link google.cloud.edgecontainer.v1.VpnConnection.Details.CloudVpn.verify|verify} messages. + * @function encode + * @memberof google.cloud.edgecontainer.v1.VpnConnection.Details.CloudVpn + * @static + * @param {google.cloud.edgecontainer.v1.VpnConnection.Details.ICloudVpn} message CloudVpn message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CloudVpn.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.gateway != null && Object.hasOwnProperty.call(message, "gateway")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.gateway); + return writer; + }; + + /** + * Encodes the specified CloudVpn message, length delimited. Does not implicitly {@link google.cloud.edgecontainer.v1.VpnConnection.Details.CloudVpn.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.edgecontainer.v1.VpnConnection.Details.CloudVpn + * @static + * @param {google.cloud.edgecontainer.v1.VpnConnection.Details.ICloudVpn} message CloudVpn message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CloudVpn.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CloudVpn message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.edgecontainer.v1.VpnConnection.Details.CloudVpn + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.edgecontainer.v1.VpnConnection.Details.CloudVpn} CloudVpn + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CloudVpn.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.edgecontainer.v1.VpnConnection.Details.CloudVpn(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.gateway = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CloudVpn message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.edgecontainer.v1.VpnConnection.Details.CloudVpn + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.edgecontainer.v1.VpnConnection.Details.CloudVpn} CloudVpn + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CloudVpn.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CloudVpn message. + * @function verify + * @memberof google.cloud.edgecontainer.v1.VpnConnection.Details.CloudVpn + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CloudVpn.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.gateway != null && message.hasOwnProperty("gateway")) + if (!$util.isString(message.gateway)) + return "gateway: string expected"; + return null; + }; + + /** + * Creates a CloudVpn message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.edgecontainer.v1.VpnConnection.Details.CloudVpn + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.edgecontainer.v1.VpnConnection.Details.CloudVpn} CloudVpn + */ + CloudVpn.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.edgecontainer.v1.VpnConnection.Details.CloudVpn) + return object; + var message = new $root.google.cloud.edgecontainer.v1.VpnConnection.Details.CloudVpn(); + if (object.gateway != null) + message.gateway = String(object.gateway); + return message; + }; + + /** + * Creates a plain object from a CloudVpn message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.edgecontainer.v1.VpnConnection.Details.CloudVpn + * @static + * @param {google.cloud.edgecontainer.v1.VpnConnection.Details.CloudVpn} message CloudVpn + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CloudVpn.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.gateway = ""; + if (message.gateway != null && message.hasOwnProperty("gateway")) + object.gateway = message.gateway; + return object; + }; + + /** + * Converts this CloudVpn to JSON. + * @function toJSON + * @memberof google.cloud.edgecontainer.v1.VpnConnection.Details.CloudVpn + * @instance + * @returns {Object.} JSON object + */ + CloudVpn.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CloudVpn + * @function getTypeUrl + * @memberof google.cloud.edgecontainer.v1.VpnConnection.Details.CloudVpn + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CloudVpn.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.edgecontainer.v1.VpnConnection.Details.CloudVpn"; + }; + + return CloudVpn; + })(); + + /** + * State enum. + * @name google.cloud.edgecontainer.v1.VpnConnection.Details.State + * @enum {number} + * @property {number} STATE_UNSPECIFIED=0 STATE_UNSPECIFIED value + * @property {number} STATE_CONNECTED=1 STATE_CONNECTED value + * @property {number} STATE_CONNECTING=2 STATE_CONNECTING value + * @property {number} STATE_ERROR=3 STATE_ERROR value + */ + Details.State = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "STATE_UNSPECIFIED"] = 0; + values[valuesById[1] = "STATE_CONNECTED"] = 1; + values[valuesById[2] = "STATE_CONNECTING"] = 2; + values[valuesById[3] = "STATE_ERROR"] = 3; + return values; + })(); + + return Details; + })(); + + /** + * BgpRoutingMode enum. + * @name google.cloud.edgecontainer.v1.VpnConnection.BgpRoutingMode + * @enum {number} + * @property {number} BGP_ROUTING_MODE_UNSPECIFIED=0 BGP_ROUTING_MODE_UNSPECIFIED value + * @property {number} REGIONAL=1 REGIONAL value + * @property {number} GLOBAL=2 GLOBAL value + */ + VpnConnection.BgpRoutingMode = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "BGP_ROUTING_MODE_UNSPECIFIED"] = 0; + values[valuesById[1] = "REGIONAL"] = 1; + values[valuesById[2] = "GLOBAL"] = 2; + return values; + })(); + + return VpnConnection; + })(); + + v1.LocationMetadata = (function() { + + /** + * Properties of a LocationMetadata. + * @memberof google.cloud.edgecontainer.v1 + * @interface ILocationMetadata + * @property {Object.|null} [availableZones] LocationMetadata availableZones + */ + + /** + * Constructs a new LocationMetadata. + * @memberof google.cloud.edgecontainer.v1 + * @classdesc Represents a LocationMetadata. + * @implements ILocationMetadata + * @constructor + * @param {google.cloud.edgecontainer.v1.ILocationMetadata=} [properties] Properties to set + */ + function LocationMetadata(properties) { + this.availableZones = {}; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * LocationMetadata availableZones. + * @member {Object.} availableZones + * @memberof google.cloud.edgecontainer.v1.LocationMetadata + * @instance + */ + LocationMetadata.prototype.availableZones = $util.emptyObject; + + /** + * Creates a new LocationMetadata instance using the specified properties. + * @function create + * @memberof google.cloud.edgecontainer.v1.LocationMetadata + * @static + * @param {google.cloud.edgecontainer.v1.ILocationMetadata=} [properties] Properties to set + * @returns {google.cloud.edgecontainer.v1.LocationMetadata} LocationMetadata instance + */ + LocationMetadata.create = function create(properties) { + return new LocationMetadata(properties); + }; + + /** + * Encodes the specified LocationMetadata message. Does not implicitly {@link google.cloud.edgecontainer.v1.LocationMetadata.verify|verify} messages. + * @function encode + * @memberof google.cloud.edgecontainer.v1.LocationMetadata + * @static + * @param {google.cloud.edgecontainer.v1.ILocationMetadata} message LocationMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + LocationMetadata.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.availableZones != null && Object.hasOwnProperty.call(message, "availableZones")) + for (var keys = Object.keys(message.availableZones), 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.edgecontainer.v1.ZoneMetadata.encode(message.availableZones[keys[i]], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim().ldelim(); + } + return writer; + }; + + /** + * Encodes the specified LocationMetadata message, length delimited. Does not implicitly {@link google.cloud.edgecontainer.v1.LocationMetadata.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.edgecontainer.v1.LocationMetadata + * @static + * @param {google.cloud.edgecontainer.v1.ILocationMetadata} message LocationMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + LocationMetadata.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a LocationMetadata message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.edgecontainer.v1.LocationMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.edgecontainer.v1.LocationMetadata} LocationMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + LocationMetadata.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.edgecontainer.v1.LocationMetadata(), key, value; + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (message.availableZones === $util.emptyObject) + message.availableZones = {}; + 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.edgecontainer.v1.ZoneMetadata.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag2 & 7); + break; + } + } + message.availableZones[key] = value; + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a LocationMetadata message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.edgecontainer.v1.LocationMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.edgecontainer.v1.LocationMetadata} LocationMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + LocationMetadata.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a LocationMetadata message. + * @function verify + * @memberof google.cloud.edgecontainer.v1.LocationMetadata + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + LocationMetadata.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.availableZones != null && message.hasOwnProperty("availableZones")) { + if (!$util.isObject(message.availableZones)) + return "availableZones: object expected"; + var key = Object.keys(message.availableZones); + for (var i = 0; i < key.length; ++i) { + var error = $root.google.cloud.edgecontainer.v1.ZoneMetadata.verify(message.availableZones[key[i]]); + if (error) + return "availableZones." + error; + } + } + return null; + }; + + /** + * Creates a LocationMetadata message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.edgecontainer.v1.LocationMetadata + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.edgecontainer.v1.LocationMetadata} LocationMetadata + */ + LocationMetadata.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.edgecontainer.v1.LocationMetadata) + return object; + var message = new $root.google.cloud.edgecontainer.v1.LocationMetadata(); + if (object.availableZones) { + if (typeof object.availableZones !== "object") + throw TypeError(".google.cloud.edgecontainer.v1.LocationMetadata.availableZones: object expected"); + message.availableZones = {}; + for (var keys = Object.keys(object.availableZones), i = 0; i < keys.length; ++i) { + if (typeof object.availableZones[keys[i]] !== "object") + throw TypeError(".google.cloud.edgecontainer.v1.LocationMetadata.availableZones: object expected"); + message.availableZones[keys[i]] = $root.google.cloud.edgecontainer.v1.ZoneMetadata.fromObject(object.availableZones[keys[i]]); + } + } + return message; + }; + + /** + * Creates a plain object from a LocationMetadata message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.edgecontainer.v1.LocationMetadata + * @static + * @param {google.cloud.edgecontainer.v1.LocationMetadata} message LocationMetadata + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + LocationMetadata.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.objects || options.defaults) + object.availableZones = {}; + var keys2; + if (message.availableZones && (keys2 = Object.keys(message.availableZones)).length) { + object.availableZones = {}; + for (var j = 0; j < keys2.length; ++j) + object.availableZones[keys2[j]] = $root.google.cloud.edgecontainer.v1.ZoneMetadata.toObject(message.availableZones[keys2[j]], options); + } + return object; + }; + + /** + * Converts this LocationMetadata to JSON. + * @function toJSON + * @memberof google.cloud.edgecontainer.v1.LocationMetadata + * @instance + * @returns {Object.} JSON object + */ + LocationMetadata.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for LocationMetadata + * @function getTypeUrl + * @memberof google.cloud.edgecontainer.v1.LocationMetadata + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + LocationMetadata.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.edgecontainer.v1.LocationMetadata"; + }; + + return LocationMetadata; + })(); + + v1.ZoneMetadata = (function() { + + /** + * Properties of a ZoneMetadata. + * @memberof google.cloud.edgecontainer.v1 + * @interface IZoneMetadata + * @property {Array.|null} [quota] ZoneMetadata quota + */ + + /** + * Constructs a new ZoneMetadata. + * @memberof google.cloud.edgecontainer.v1 + * @classdesc Represents a ZoneMetadata. + * @implements IZoneMetadata + * @constructor + * @param {google.cloud.edgecontainer.v1.IZoneMetadata=} [properties] Properties to set + */ + function ZoneMetadata(properties) { + this.quota = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ZoneMetadata quota. + * @member {Array.} quota + * @memberof google.cloud.edgecontainer.v1.ZoneMetadata + * @instance + */ + ZoneMetadata.prototype.quota = $util.emptyArray; + + /** + * Creates a new ZoneMetadata instance using the specified properties. + * @function create + * @memberof google.cloud.edgecontainer.v1.ZoneMetadata + * @static + * @param {google.cloud.edgecontainer.v1.IZoneMetadata=} [properties] Properties to set + * @returns {google.cloud.edgecontainer.v1.ZoneMetadata} ZoneMetadata instance + */ + ZoneMetadata.create = function create(properties) { + return new ZoneMetadata(properties); + }; + + /** + * Encodes the specified ZoneMetadata message. Does not implicitly {@link google.cloud.edgecontainer.v1.ZoneMetadata.verify|verify} messages. + * @function encode + * @memberof google.cloud.edgecontainer.v1.ZoneMetadata + * @static + * @param {google.cloud.edgecontainer.v1.IZoneMetadata} message ZoneMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ZoneMetadata.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.quota != null && message.quota.length) + for (var i = 0; i < message.quota.length; ++i) + $root.google.cloud.edgecontainer.v1.Quota.encode(message.quota[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified ZoneMetadata message, length delimited. Does not implicitly {@link google.cloud.edgecontainer.v1.ZoneMetadata.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.edgecontainer.v1.ZoneMetadata + * @static + * @param {google.cloud.edgecontainer.v1.IZoneMetadata} message ZoneMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ZoneMetadata.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ZoneMetadata message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.edgecontainer.v1.ZoneMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.edgecontainer.v1.ZoneMetadata} ZoneMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ZoneMetadata.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.edgecontainer.v1.ZoneMetadata(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.quota && message.quota.length)) + message.quota = []; + message.quota.push($root.google.cloud.edgecontainer.v1.Quota.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ZoneMetadata message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.edgecontainer.v1.ZoneMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.edgecontainer.v1.ZoneMetadata} ZoneMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ZoneMetadata.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ZoneMetadata message. + * @function verify + * @memberof google.cloud.edgecontainer.v1.ZoneMetadata + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ZoneMetadata.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.quota != null && message.hasOwnProperty("quota")) { + if (!Array.isArray(message.quota)) + return "quota: array expected"; + for (var i = 0; i < message.quota.length; ++i) { + var error = $root.google.cloud.edgecontainer.v1.Quota.verify(message.quota[i]); + if (error) + return "quota." + error; + } + } + return null; + }; + + /** + * Creates a ZoneMetadata message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.edgecontainer.v1.ZoneMetadata + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.edgecontainer.v1.ZoneMetadata} ZoneMetadata + */ + ZoneMetadata.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.edgecontainer.v1.ZoneMetadata) + return object; + var message = new $root.google.cloud.edgecontainer.v1.ZoneMetadata(); + if (object.quota) { + if (!Array.isArray(object.quota)) + throw TypeError(".google.cloud.edgecontainer.v1.ZoneMetadata.quota: array expected"); + message.quota = []; + for (var i = 0; i < object.quota.length; ++i) { + if (typeof object.quota[i] !== "object") + throw TypeError(".google.cloud.edgecontainer.v1.ZoneMetadata.quota: object expected"); + message.quota[i] = $root.google.cloud.edgecontainer.v1.Quota.fromObject(object.quota[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a ZoneMetadata message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.edgecontainer.v1.ZoneMetadata + * @static + * @param {google.cloud.edgecontainer.v1.ZoneMetadata} message ZoneMetadata + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ZoneMetadata.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.quota = []; + if (message.quota && message.quota.length) { + object.quota = []; + for (var j = 0; j < message.quota.length; ++j) + object.quota[j] = $root.google.cloud.edgecontainer.v1.Quota.toObject(message.quota[j], options); + } + return object; + }; + + /** + * Converts this ZoneMetadata to JSON. + * @function toJSON + * @memberof google.cloud.edgecontainer.v1.ZoneMetadata + * @instance + * @returns {Object.} JSON object + */ + ZoneMetadata.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ZoneMetadata + * @function getTypeUrl + * @memberof google.cloud.edgecontainer.v1.ZoneMetadata + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ZoneMetadata.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.edgecontainer.v1.ZoneMetadata"; + }; + + return ZoneMetadata; + })(); + + v1.Quota = (function() { + + /** + * Properties of a Quota. + * @memberof google.cloud.edgecontainer.v1 + * @interface IQuota + * @property {string|null} [metric] Quota metric + * @property {number|null} [limit] Quota limit + * @property {number|null} [usage] Quota usage + */ + + /** + * Constructs a new Quota. + * @memberof google.cloud.edgecontainer.v1 + * @classdesc Represents a Quota. + * @implements IQuota + * @constructor + * @param {google.cloud.edgecontainer.v1.IQuota=} [properties] Properties to set + */ + function Quota(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Quota metric. + * @member {string} metric + * @memberof google.cloud.edgecontainer.v1.Quota + * @instance + */ + Quota.prototype.metric = ""; + + /** + * Quota limit. + * @member {number} limit + * @memberof google.cloud.edgecontainer.v1.Quota + * @instance + */ + Quota.prototype.limit = 0; + + /** + * Quota usage. + * @member {number} usage + * @memberof google.cloud.edgecontainer.v1.Quota + * @instance + */ + Quota.prototype.usage = 0; + + /** + * Creates a new Quota instance using the specified properties. + * @function create + * @memberof google.cloud.edgecontainer.v1.Quota + * @static + * @param {google.cloud.edgecontainer.v1.IQuota=} [properties] Properties to set + * @returns {google.cloud.edgecontainer.v1.Quota} Quota instance + */ + Quota.create = function create(properties) { + return new Quota(properties); + }; + + /** + * Encodes the specified Quota message. Does not implicitly {@link google.cloud.edgecontainer.v1.Quota.verify|verify} messages. + * @function encode + * @memberof google.cloud.edgecontainer.v1.Quota + * @static + * @param {google.cloud.edgecontainer.v1.IQuota} message Quota message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Quota.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.metric != null && Object.hasOwnProperty.call(message, "metric")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.metric); + if (message.limit != null && Object.hasOwnProperty.call(message, "limit")) + writer.uint32(/* id 2, wireType 1 =*/17).double(message.limit); + if (message.usage != null && Object.hasOwnProperty.call(message, "usage")) + writer.uint32(/* id 3, wireType 1 =*/25).double(message.usage); + return writer; + }; + + /** + * Encodes the specified Quota message, length delimited. Does not implicitly {@link google.cloud.edgecontainer.v1.Quota.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.edgecontainer.v1.Quota + * @static + * @param {google.cloud.edgecontainer.v1.IQuota} message Quota message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Quota.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Quota message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.edgecontainer.v1.Quota + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.edgecontainer.v1.Quota} Quota + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Quota.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.edgecontainer.v1.Quota(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.metric = reader.string(); + break; + } + case 2: { + message.limit = reader.double(); + break; + } + case 3: { + message.usage = reader.double(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Quota message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.edgecontainer.v1.Quota + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.edgecontainer.v1.Quota} Quota + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Quota.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Quota message. + * @function verify + * @memberof google.cloud.edgecontainer.v1.Quota + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Quota.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.metric != null && message.hasOwnProperty("metric")) + if (!$util.isString(message.metric)) + return "metric: string expected"; + if (message.limit != null && message.hasOwnProperty("limit")) + if (typeof message.limit !== "number") + return "limit: number expected"; + if (message.usage != null && message.hasOwnProperty("usage")) + if (typeof message.usage !== "number") + return "usage: number expected"; + return null; + }; + + /** + * Creates a Quota message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.edgecontainer.v1.Quota + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.edgecontainer.v1.Quota} Quota + */ + Quota.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.edgecontainer.v1.Quota) + return object; + var message = new $root.google.cloud.edgecontainer.v1.Quota(); + if (object.metric != null) + message.metric = String(object.metric); + if (object.limit != null) + message.limit = Number(object.limit); + if (object.usage != null) + message.usage = Number(object.usage); + return message; + }; + + /** + * Creates a plain object from a Quota message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.edgecontainer.v1.Quota + * @static + * @param {google.cloud.edgecontainer.v1.Quota} message Quota + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Quota.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.metric = ""; + object.limit = 0; + object.usage = 0; + } + if (message.metric != null && message.hasOwnProperty("metric")) + object.metric = message.metric; + if (message.limit != null && message.hasOwnProperty("limit")) + object.limit = options.json && !isFinite(message.limit) ? String(message.limit) : message.limit; + if (message.usage != null && message.hasOwnProperty("usage")) + object.usage = options.json && !isFinite(message.usage) ? String(message.usage) : message.usage; + return object; + }; + + /** + * Converts this Quota to JSON. + * @function toJSON + * @memberof google.cloud.edgecontainer.v1.Quota + * @instance + * @returns {Object.} JSON object + */ + Quota.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Quota + * @function getTypeUrl + * @memberof google.cloud.edgecontainer.v1.Quota + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Quota.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.edgecontainer.v1.Quota"; + }; + + return Quota; + })(); + + v1.MaintenancePolicy = (function() { + + /** + * Properties of a MaintenancePolicy. + * @memberof google.cloud.edgecontainer.v1 + * @interface IMaintenancePolicy + * @property {google.cloud.edgecontainer.v1.IMaintenanceWindow|null} [window] MaintenancePolicy window + */ + + /** + * Constructs a new MaintenancePolicy. + * @memberof google.cloud.edgecontainer.v1 + * @classdesc Represents a MaintenancePolicy. + * @implements IMaintenancePolicy + * @constructor + * @param {google.cloud.edgecontainer.v1.IMaintenancePolicy=} [properties] Properties to set + */ + function MaintenancePolicy(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * MaintenancePolicy window. + * @member {google.cloud.edgecontainer.v1.IMaintenanceWindow|null|undefined} window + * @memberof google.cloud.edgecontainer.v1.MaintenancePolicy + * @instance + */ + MaintenancePolicy.prototype.window = null; + + /** + * Creates a new MaintenancePolicy instance using the specified properties. + * @function create + * @memberof google.cloud.edgecontainer.v1.MaintenancePolicy + * @static + * @param {google.cloud.edgecontainer.v1.IMaintenancePolicy=} [properties] Properties to set + * @returns {google.cloud.edgecontainer.v1.MaintenancePolicy} MaintenancePolicy instance + */ + MaintenancePolicy.create = function create(properties) { + return new MaintenancePolicy(properties); + }; + + /** + * Encodes the specified MaintenancePolicy message. Does not implicitly {@link google.cloud.edgecontainer.v1.MaintenancePolicy.verify|verify} messages. + * @function encode + * @memberof google.cloud.edgecontainer.v1.MaintenancePolicy + * @static + * @param {google.cloud.edgecontainer.v1.IMaintenancePolicy} message MaintenancePolicy message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MaintenancePolicy.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.window != null && Object.hasOwnProperty.call(message, "window")) + $root.google.cloud.edgecontainer.v1.MaintenanceWindow.encode(message.window, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified MaintenancePolicy message, length delimited. Does not implicitly {@link google.cloud.edgecontainer.v1.MaintenancePolicy.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.edgecontainer.v1.MaintenancePolicy + * @static + * @param {google.cloud.edgecontainer.v1.IMaintenancePolicy} message MaintenancePolicy message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MaintenancePolicy.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a MaintenancePolicy message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.edgecontainer.v1.MaintenancePolicy + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.edgecontainer.v1.MaintenancePolicy} MaintenancePolicy + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MaintenancePolicy.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.edgecontainer.v1.MaintenancePolicy(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.window = $root.google.cloud.edgecontainer.v1.MaintenanceWindow.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a MaintenancePolicy message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.edgecontainer.v1.MaintenancePolicy + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.edgecontainer.v1.MaintenancePolicy} MaintenancePolicy + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MaintenancePolicy.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a MaintenancePolicy message. + * @function verify + * @memberof google.cloud.edgecontainer.v1.MaintenancePolicy + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + MaintenancePolicy.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.window != null && message.hasOwnProperty("window")) { + var error = $root.google.cloud.edgecontainer.v1.MaintenanceWindow.verify(message.window); + if (error) + return "window." + error; + } + return null; + }; + + /** + * Creates a MaintenancePolicy message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.edgecontainer.v1.MaintenancePolicy + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.edgecontainer.v1.MaintenancePolicy} MaintenancePolicy + */ + MaintenancePolicy.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.edgecontainer.v1.MaintenancePolicy) + return object; + var message = new $root.google.cloud.edgecontainer.v1.MaintenancePolicy(); + if (object.window != null) { + if (typeof object.window !== "object") + throw TypeError(".google.cloud.edgecontainer.v1.MaintenancePolicy.window: object expected"); + message.window = $root.google.cloud.edgecontainer.v1.MaintenanceWindow.fromObject(object.window); + } + return message; + }; + + /** + * Creates a plain object from a MaintenancePolicy message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.edgecontainer.v1.MaintenancePolicy + * @static + * @param {google.cloud.edgecontainer.v1.MaintenancePolicy} message MaintenancePolicy + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + MaintenancePolicy.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.window = null; + if (message.window != null && message.hasOwnProperty("window")) + object.window = $root.google.cloud.edgecontainer.v1.MaintenanceWindow.toObject(message.window, options); + return object; + }; + + /** + * Converts this MaintenancePolicy to JSON. + * @function toJSON + * @memberof google.cloud.edgecontainer.v1.MaintenancePolicy + * @instance + * @returns {Object.} JSON object + */ + MaintenancePolicy.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for MaintenancePolicy + * @function getTypeUrl + * @memberof google.cloud.edgecontainer.v1.MaintenancePolicy + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + MaintenancePolicy.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.edgecontainer.v1.MaintenancePolicy"; + }; + + return MaintenancePolicy; + })(); + + v1.MaintenanceWindow = (function() { + + /** + * Properties of a MaintenanceWindow. + * @memberof google.cloud.edgecontainer.v1 + * @interface IMaintenanceWindow + * @property {google.cloud.edgecontainer.v1.IRecurringTimeWindow|null} [recurringWindow] MaintenanceWindow recurringWindow + */ + + /** + * Constructs a new MaintenanceWindow. + * @memberof google.cloud.edgecontainer.v1 + * @classdesc Represents a MaintenanceWindow. + * @implements IMaintenanceWindow + * @constructor + * @param {google.cloud.edgecontainer.v1.IMaintenanceWindow=} [properties] Properties to set + */ + function MaintenanceWindow(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * MaintenanceWindow recurringWindow. + * @member {google.cloud.edgecontainer.v1.IRecurringTimeWindow|null|undefined} recurringWindow + * @memberof google.cloud.edgecontainer.v1.MaintenanceWindow + * @instance + */ + MaintenanceWindow.prototype.recurringWindow = null; + + /** + * Creates a new MaintenanceWindow instance using the specified properties. + * @function create + * @memberof google.cloud.edgecontainer.v1.MaintenanceWindow + * @static + * @param {google.cloud.edgecontainer.v1.IMaintenanceWindow=} [properties] Properties to set + * @returns {google.cloud.edgecontainer.v1.MaintenanceWindow} MaintenanceWindow instance + */ + MaintenanceWindow.create = function create(properties) { + return new MaintenanceWindow(properties); + }; + + /** + * Encodes the specified MaintenanceWindow message. Does not implicitly {@link google.cloud.edgecontainer.v1.MaintenanceWindow.verify|verify} messages. + * @function encode + * @memberof google.cloud.edgecontainer.v1.MaintenanceWindow + * @static + * @param {google.cloud.edgecontainer.v1.IMaintenanceWindow} message MaintenanceWindow message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MaintenanceWindow.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.recurringWindow != null && Object.hasOwnProperty.call(message, "recurringWindow")) + $root.google.cloud.edgecontainer.v1.RecurringTimeWindow.encode(message.recurringWindow, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified MaintenanceWindow message, length delimited. Does not implicitly {@link google.cloud.edgecontainer.v1.MaintenanceWindow.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.edgecontainer.v1.MaintenanceWindow + * @static + * @param {google.cloud.edgecontainer.v1.IMaintenanceWindow} message MaintenanceWindow message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MaintenanceWindow.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a MaintenanceWindow message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.edgecontainer.v1.MaintenanceWindow + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.edgecontainer.v1.MaintenanceWindow} MaintenanceWindow + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MaintenanceWindow.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.edgecontainer.v1.MaintenanceWindow(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.recurringWindow = $root.google.cloud.edgecontainer.v1.RecurringTimeWindow.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a MaintenanceWindow message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.edgecontainer.v1.MaintenanceWindow + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.edgecontainer.v1.MaintenanceWindow} MaintenanceWindow + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MaintenanceWindow.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a MaintenanceWindow message. + * @function verify + * @memberof google.cloud.edgecontainer.v1.MaintenanceWindow + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + MaintenanceWindow.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.recurringWindow != null && message.hasOwnProperty("recurringWindow")) { + var error = $root.google.cloud.edgecontainer.v1.RecurringTimeWindow.verify(message.recurringWindow); + if (error) + return "recurringWindow." + error; + } + return null; + }; + + /** + * Creates a MaintenanceWindow message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.edgecontainer.v1.MaintenanceWindow + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.edgecontainer.v1.MaintenanceWindow} MaintenanceWindow + */ + MaintenanceWindow.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.edgecontainer.v1.MaintenanceWindow) + return object; + var message = new $root.google.cloud.edgecontainer.v1.MaintenanceWindow(); + if (object.recurringWindow != null) { + if (typeof object.recurringWindow !== "object") + throw TypeError(".google.cloud.edgecontainer.v1.MaintenanceWindow.recurringWindow: object expected"); + message.recurringWindow = $root.google.cloud.edgecontainer.v1.RecurringTimeWindow.fromObject(object.recurringWindow); + } + return message; + }; + + /** + * Creates a plain object from a MaintenanceWindow message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.edgecontainer.v1.MaintenanceWindow + * @static + * @param {google.cloud.edgecontainer.v1.MaintenanceWindow} message MaintenanceWindow + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + MaintenanceWindow.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.recurringWindow = null; + if (message.recurringWindow != null && message.hasOwnProperty("recurringWindow")) + object.recurringWindow = $root.google.cloud.edgecontainer.v1.RecurringTimeWindow.toObject(message.recurringWindow, options); + return object; + }; + + /** + * Converts this MaintenanceWindow to JSON. + * @function toJSON + * @memberof google.cloud.edgecontainer.v1.MaintenanceWindow + * @instance + * @returns {Object.} JSON object + */ + MaintenanceWindow.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for MaintenanceWindow + * @function getTypeUrl + * @memberof google.cloud.edgecontainer.v1.MaintenanceWindow + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + MaintenanceWindow.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.edgecontainer.v1.MaintenanceWindow"; + }; + + return MaintenanceWindow; + })(); + + v1.RecurringTimeWindow = (function() { + + /** + * Properties of a RecurringTimeWindow. + * @memberof google.cloud.edgecontainer.v1 + * @interface IRecurringTimeWindow + * @property {google.cloud.edgecontainer.v1.ITimeWindow|null} [window] RecurringTimeWindow window + * @property {string|null} [recurrence] RecurringTimeWindow recurrence + */ + + /** + * Constructs a new RecurringTimeWindow. + * @memberof google.cloud.edgecontainer.v1 + * @classdesc Represents a RecurringTimeWindow. + * @implements IRecurringTimeWindow + * @constructor + * @param {google.cloud.edgecontainer.v1.IRecurringTimeWindow=} [properties] Properties to set + */ + function RecurringTimeWindow(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * RecurringTimeWindow window. + * @member {google.cloud.edgecontainer.v1.ITimeWindow|null|undefined} window + * @memberof google.cloud.edgecontainer.v1.RecurringTimeWindow + * @instance + */ + RecurringTimeWindow.prototype.window = null; + + /** + * RecurringTimeWindow recurrence. + * @member {string} recurrence + * @memberof google.cloud.edgecontainer.v1.RecurringTimeWindow + * @instance + */ + RecurringTimeWindow.prototype.recurrence = ""; + + /** + * Creates a new RecurringTimeWindow instance using the specified properties. + * @function create + * @memberof google.cloud.edgecontainer.v1.RecurringTimeWindow + * @static + * @param {google.cloud.edgecontainer.v1.IRecurringTimeWindow=} [properties] Properties to set + * @returns {google.cloud.edgecontainer.v1.RecurringTimeWindow} RecurringTimeWindow instance + */ + RecurringTimeWindow.create = function create(properties) { + return new RecurringTimeWindow(properties); + }; + + /** + * Encodes the specified RecurringTimeWindow message. Does not implicitly {@link google.cloud.edgecontainer.v1.RecurringTimeWindow.verify|verify} messages. + * @function encode + * @memberof google.cloud.edgecontainer.v1.RecurringTimeWindow + * @static + * @param {google.cloud.edgecontainer.v1.IRecurringTimeWindow} message RecurringTimeWindow message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RecurringTimeWindow.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.window != null && Object.hasOwnProperty.call(message, "window")) + $root.google.cloud.edgecontainer.v1.TimeWindow.encode(message.window, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.recurrence != null && Object.hasOwnProperty.call(message, "recurrence")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.recurrence); + return writer; + }; + + /** + * Encodes the specified RecurringTimeWindow message, length delimited. Does not implicitly {@link google.cloud.edgecontainer.v1.RecurringTimeWindow.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.edgecontainer.v1.RecurringTimeWindow + * @static + * @param {google.cloud.edgecontainer.v1.IRecurringTimeWindow} message RecurringTimeWindow message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RecurringTimeWindow.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a RecurringTimeWindow message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.edgecontainer.v1.RecurringTimeWindow + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.edgecontainer.v1.RecurringTimeWindow} RecurringTimeWindow + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RecurringTimeWindow.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.edgecontainer.v1.RecurringTimeWindow(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.window = $root.google.cloud.edgecontainer.v1.TimeWindow.decode(reader, reader.uint32()); + break; + } + case 2: { + message.recurrence = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a RecurringTimeWindow message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.edgecontainer.v1.RecurringTimeWindow + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.edgecontainer.v1.RecurringTimeWindow} RecurringTimeWindow + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RecurringTimeWindow.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a RecurringTimeWindow message. + * @function verify + * @memberof google.cloud.edgecontainer.v1.RecurringTimeWindow + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + RecurringTimeWindow.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.window != null && message.hasOwnProperty("window")) { + var error = $root.google.cloud.edgecontainer.v1.TimeWindow.verify(message.window); + if (error) + return "window." + error; + } + if (message.recurrence != null && message.hasOwnProperty("recurrence")) + if (!$util.isString(message.recurrence)) + return "recurrence: string expected"; + return null; + }; + + /** + * Creates a RecurringTimeWindow message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.edgecontainer.v1.RecurringTimeWindow + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.edgecontainer.v1.RecurringTimeWindow} RecurringTimeWindow + */ + RecurringTimeWindow.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.edgecontainer.v1.RecurringTimeWindow) + return object; + var message = new $root.google.cloud.edgecontainer.v1.RecurringTimeWindow(); + if (object.window != null) { + if (typeof object.window !== "object") + throw TypeError(".google.cloud.edgecontainer.v1.RecurringTimeWindow.window: object expected"); + message.window = $root.google.cloud.edgecontainer.v1.TimeWindow.fromObject(object.window); + } + if (object.recurrence != null) + message.recurrence = String(object.recurrence); + return message; + }; + + /** + * Creates a plain object from a RecurringTimeWindow message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.edgecontainer.v1.RecurringTimeWindow + * @static + * @param {google.cloud.edgecontainer.v1.RecurringTimeWindow} message RecurringTimeWindow + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + RecurringTimeWindow.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.window = null; + object.recurrence = ""; + } + if (message.window != null && message.hasOwnProperty("window")) + object.window = $root.google.cloud.edgecontainer.v1.TimeWindow.toObject(message.window, options); + if (message.recurrence != null && message.hasOwnProperty("recurrence")) + object.recurrence = message.recurrence; + return object; + }; + + /** + * Converts this RecurringTimeWindow to JSON. + * @function toJSON + * @memberof google.cloud.edgecontainer.v1.RecurringTimeWindow + * @instance + * @returns {Object.} JSON object + */ + RecurringTimeWindow.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for RecurringTimeWindow + * @function getTypeUrl + * @memberof google.cloud.edgecontainer.v1.RecurringTimeWindow + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + RecurringTimeWindow.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.edgecontainer.v1.RecurringTimeWindow"; + }; + + return RecurringTimeWindow; + })(); + + v1.TimeWindow = (function() { + + /** + * Properties of a TimeWindow. + * @memberof google.cloud.edgecontainer.v1 + * @interface ITimeWindow + * @property {google.protobuf.ITimestamp|null} [startTime] TimeWindow startTime + * @property {google.protobuf.ITimestamp|null} [endTime] TimeWindow endTime + */ + + /** + * Constructs a new TimeWindow. + * @memberof google.cloud.edgecontainer.v1 + * @classdesc Represents a TimeWindow. + * @implements ITimeWindow + * @constructor + * @param {google.cloud.edgecontainer.v1.ITimeWindow=} [properties] Properties to set + */ + function TimeWindow(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * TimeWindow startTime. + * @member {google.protobuf.ITimestamp|null|undefined} startTime + * @memberof google.cloud.edgecontainer.v1.TimeWindow + * @instance + */ + TimeWindow.prototype.startTime = null; + + /** + * TimeWindow endTime. + * @member {google.protobuf.ITimestamp|null|undefined} endTime + * @memberof google.cloud.edgecontainer.v1.TimeWindow + * @instance + */ + TimeWindow.prototype.endTime = null; + + /** + * Creates a new TimeWindow instance using the specified properties. + * @function create + * @memberof google.cloud.edgecontainer.v1.TimeWindow + * @static + * @param {google.cloud.edgecontainer.v1.ITimeWindow=} [properties] Properties to set + * @returns {google.cloud.edgecontainer.v1.TimeWindow} TimeWindow instance + */ + TimeWindow.create = function create(properties) { + return new TimeWindow(properties); + }; + + /** + * Encodes the specified TimeWindow message. Does not implicitly {@link google.cloud.edgecontainer.v1.TimeWindow.verify|verify} messages. + * @function encode + * @memberof google.cloud.edgecontainer.v1.TimeWindow + * @static + * @param {google.cloud.edgecontainer.v1.ITimeWindow} message TimeWindow message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TimeWindow.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 TimeWindow message, length delimited. Does not implicitly {@link google.cloud.edgecontainer.v1.TimeWindow.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.edgecontainer.v1.TimeWindow + * @static + * @param {google.cloud.edgecontainer.v1.ITimeWindow} message TimeWindow message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TimeWindow.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a TimeWindow message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.edgecontainer.v1.TimeWindow + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.edgecontainer.v1.TimeWindow} TimeWindow + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TimeWindow.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.edgecontainer.v1.TimeWindow(); + while (reader.pos < end) { + var tag = reader.uint32(); + 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 a TimeWindow message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.edgecontainer.v1.TimeWindow + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.edgecontainer.v1.TimeWindow} TimeWindow + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TimeWindow.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a TimeWindow message. + * @function verify + * @memberof google.cloud.edgecontainer.v1.TimeWindow + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + TimeWindow.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 a TimeWindow message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.edgecontainer.v1.TimeWindow + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.edgecontainer.v1.TimeWindow} TimeWindow + */ + TimeWindow.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.edgecontainer.v1.TimeWindow) + return object; + var message = new $root.google.cloud.edgecontainer.v1.TimeWindow(); + if (object.startTime != null) { + if (typeof object.startTime !== "object") + throw TypeError(".google.cloud.edgecontainer.v1.TimeWindow.startTime: object expected"); + message.startTime = $root.google.protobuf.Timestamp.fromObject(object.startTime); + } + if (object.endTime != null) { + if (typeof object.endTime !== "object") + throw TypeError(".google.cloud.edgecontainer.v1.TimeWindow.endTime: object expected"); + message.endTime = $root.google.protobuf.Timestamp.fromObject(object.endTime); + } + return message; + }; + + /** + * Creates a plain object from a TimeWindow message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.edgecontainer.v1.TimeWindow + * @static + * @param {google.cloud.edgecontainer.v1.TimeWindow} message TimeWindow + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + TimeWindow.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 TimeWindow to JSON. + * @function toJSON + * @memberof google.cloud.edgecontainer.v1.TimeWindow + * @instance + * @returns {Object.} JSON object + */ + TimeWindow.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for TimeWindow + * @function getTypeUrl + * @memberof google.cloud.edgecontainer.v1.TimeWindow + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TimeWindow.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.edgecontainer.v1.TimeWindow"; + }; + + return TimeWindow; + })(); + + v1.EdgeContainer = (function() { + + /** + * Constructs a new EdgeContainer service. + * @memberof google.cloud.edgecontainer.v1 + * @classdesc Represents an EdgeContainer + * @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 EdgeContainer(rpcImpl, requestDelimited, responseDelimited) { + $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); + } + + (EdgeContainer.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = EdgeContainer; + + /** + * Creates new EdgeContainer service using the specified rpc implementation. + * @function create + * @memberof google.cloud.edgecontainer.v1.EdgeContainer + * @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 {EdgeContainer} RPC service. Useful where requests and/or responses are streamed. + */ + EdgeContainer.create = function create(rpcImpl, requestDelimited, responseDelimited) { + return new this(rpcImpl, requestDelimited, responseDelimited); + }; + + /** + * Callback as used by {@link google.cloud.edgecontainer.v1.EdgeContainer|listClusters}. + * @memberof google.cloud.edgecontainer.v1.EdgeContainer + * @typedef ListClustersCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.edgecontainer.v1.ListClustersResponse} [response] ListClustersResponse + */ + + /** + * Calls ListClusters. + * @function listClusters + * @memberof google.cloud.edgecontainer.v1.EdgeContainer + * @instance + * @param {google.cloud.edgecontainer.v1.IListClustersRequest} request ListClustersRequest message or plain object + * @param {google.cloud.edgecontainer.v1.EdgeContainer.ListClustersCallback} callback Node-style callback called with the error, if any, and ListClustersResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(EdgeContainer.prototype.listClusters = function listClusters(request, callback) { + return this.rpcCall(listClusters, $root.google.cloud.edgecontainer.v1.ListClustersRequest, $root.google.cloud.edgecontainer.v1.ListClustersResponse, request, callback); + }, "name", { value: "ListClusters" }); + + /** + * Calls ListClusters. + * @function listClusters + * @memberof google.cloud.edgecontainer.v1.EdgeContainer + * @instance + * @param {google.cloud.edgecontainer.v1.IListClustersRequest} request ListClustersRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.edgecontainer.v1.EdgeContainer|getCluster}. + * @memberof google.cloud.edgecontainer.v1.EdgeContainer + * @typedef GetClusterCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.edgecontainer.v1.Cluster} [response] Cluster + */ + + /** + * Calls GetCluster. + * @function getCluster + * @memberof google.cloud.edgecontainer.v1.EdgeContainer + * @instance + * @param {google.cloud.edgecontainer.v1.IGetClusterRequest} request GetClusterRequest message or plain object + * @param {google.cloud.edgecontainer.v1.EdgeContainer.GetClusterCallback} callback Node-style callback called with the error, if any, and Cluster + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(EdgeContainer.prototype.getCluster = function getCluster(request, callback) { + return this.rpcCall(getCluster, $root.google.cloud.edgecontainer.v1.GetClusterRequest, $root.google.cloud.edgecontainer.v1.Cluster, request, callback); + }, "name", { value: "GetCluster" }); + + /** + * Calls GetCluster. + * @function getCluster + * @memberof google.cloud.edgecontainer.v1.EdgeContainer + * @instance + * @param {google.cloud.edgecontainer.v1.IGetClusterRequest} request GetClusterRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.edgecontainer.v1.EdgeContainer|createCluster}. + * @memberof google.cloud.edgecontainer.v1.EdgeContainer + * @typedef CreateClusterCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls CreateCluster. + * @function createCluster + * @memberof google.cloud.edgecontainer.v1.EdgeContainer + * @instance + * @param {google.cloud.edgecontainer.v1.ICreateClusterRequest} request CreateClusterRequest message or plain object + * @param {google.cloud.edgecontainer.v1.EdgeContainer.CreateClusterCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(EdgeContainer.prototype.createCluster = function createCluster(request, callback) { + return this.rpcCall(createCluster, $root.google.cloud.edgecontainer.v1.CreateClusterRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "CreateCluster" }); + + /** + * Calls CreateCluster. + * @function createCluster + * @memberof google.cloud.edgecontainer.v1.EdgeContainer + * @instance + * @param {google.cloud.edgecontainer.v1.ICreateClusterRequest} request CreateClusterRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.edgecontainer.v1.EdgeContainer|updateCluster}. + * @memberof google.cloud.edgecontainer.v1.EdgeContainer + * @typedef UpdateClusterCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls UpdateCluster. + * @function updateCluster + * @memberof google.cloud.edgecontainer.v1.EdgeContainer + * @instance + * @param {google.cloud.edgecontainer.v1.IUpdateClusterRequest} request UpdateClusterRequest message or plain object + * @param {google.cloud.edgecontainer.v1.EdgeContainer.UpdateClusterCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(EdgeContainer.prototype.updateCluster = function updateCluster(request, callback) { + return this.rpcCall(updateCluster, $root.google.cloud.edgecontainer.v1.UpdateClusterRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "UpdateCluster" }); + + /** + * Calls UpdateCluster. + * @function updateCluster + * @memberof google.cloud.edgecontainer.v1.EdgeContainer + * @instance + * @param {google.cloud.edgecontainer.v1.IUpdateClusterRequest} request UpdateClusterRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.edgecontainer.v1.EdgeContainer|deleteCluster}. + * @memberof google.cloud.edgecontainer.v1.EdgeContainer + * @typedef DeleteClusterCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls DeleteCluster. + * @function deleteCluster + * @memberof google.cloud.edgecontainer.v1.EdgeContainer + * @instance + * @param {google.cloud.edgecontainer.v1.IDeleteClusterRequest} request DeleteClusterRequest message or plain object + * @param {google.cloud.edgecontainer.v1.EdgeContainer.DeleteClusterCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(EdgeContainer.prototype.deleteCluster = function deleteCluster(request, callback) { + return this.rpcCall(deleteCluster, $root.google.cloud.edgecontainer.v1.DeleteClusterRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "DeleteCluster" }); + + /** + * Calls DeleteCluster. + * @function deleteCluster + * @memberof google.cloud.edgecontainer.v1.EdgeContainer + * @instance + * @param {google.cloud.edgecontainer.v1.IDeleteClusterRequest} request DeleteClusterRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.edgecontainer.v1.EdgeContainer|generateAccessToken}. + * @memberof google.cloud.edgecontainer.v1.EdgeContainer + * @typedef GenerateAccessTokenCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.edgecontainer.v1.GenerateAccessTokenResponse} [response] GenerateAccessTokenResponse + */ + + /** + * Calls GenerateAccessToken. + * @function generateAccessToken + * @memberof google.cloud.edgecontainer.v1.EdgeContainer + * @instance + * @param {google.cloud.edgecontainer.v1.IGenerateAccessTokenRequest} request GenerateAccessTokenRequest message or plain object + * @param {google.cloud.edgecontainer.v1.EdgeContainer.GenerateAccessTokenCallback} callback Node-style callback called with the error, if any, and GenerateAccessTokenResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(EdgeContainer.prototype.generateAccessToken = function generateAccessToken(request, callback) { + return this.rpcCall(generateAccessToken, $root.google.cloud.edgecontainer.v1.GenerateAccessTokenRequest, $root.google.cloud.edgecontainer.v1.GenerateAccessTokenResponse, request, callback); + }, "name", { value: "GenerateAccessToken" }); + + /** + * Calls GenerateAccessToken. + * @function generateAccessToken + * @memberof google.cloud.edgecontainer.v1.EdgeContainer + * @instance + * @param {google.cloud.edgecontainer.v1.IGenerateAccessTokenRequest} request GenerateAccessTokenRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.edgecontainer.v1.EdgeContainer|listNodePools}. + * @memberof google.cloud.edgecontainer.v1.EdgeContainer + * @typedef ListNodePoolsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.edgecontainer.v1.ListNodePoolsResponse} [response] ListNodePoolsResponse + */ + + /** + * Calls ListNodePools. + * @function listNodePools + * @memberof google.cloud.edgecontainer.v1.EdgeContainer + * @instance + * @param {google.cloud.edgecontainer.v1.IListNodePoolsRequest} request ListNodePoolsRequest message or plain object + * @param {google.cloud.edgecontainer.v1.EdgeContainer.ListNodePoolsCallback} callback Node-style callback called with the error, if any, and ListNodePoolsResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(EdgeContainer.prototype.listNodePools = function listNodePools(request, callback) { + return this.rpcCall(listNodePools, $root.google.cloud.edgecontainer.v1.ListNodePoolsRequest, $root.google.cloud.edgecontainer.v1.ListNodePoolsResponse, request, callback); + }, "name", { value: "ListNodePools" }); + + /** + * Calls ListNodePools. + * @function listNodePools + * @memberof google.cloud.edgecontainer.v1.EdgeContainer + * @instance + * @param {google.cloud.edgecontainer.v1.IListNodePoolsRequest} request ListNodePoolsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.edgecontainer.v1.EdgeContainer|getNodePool}. + * @memberof google.cloud.edgecontainer.v1.EdgeContainer + * @typedef GetNodePoolCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.edgecontainer.v1.NodePool} [response] NodePool + */ + + /** + * Calls GetNodePool. + * @function getNodePool + * @memberof google.cloud.edgecontainer.v1.EdgeContainer + * @instance + * @param {google.cloud.edgecontainer.v1.IGetNodePoolRequest} request GetNodePoolRequest message or plain object + * @param {google.cloud.edgecontainer.v1.EdgeContainer.GetNodePoolCallback} callback Node-style callback called with the error, if any, and NodePool + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(EdgeContainer.prototype.getNodePool = function getNodePool(request, callback) { + return this.rpcCall(getNodePool, $root.google.cloud.edgecontainer.v1.GetNodePoolRequest, $root.google.cloud.edgecontainer.v1.NodePool, request, callback); + }, "name", { value: "GetNodePool" }); + + /** + * Calls GetNodePool. + * @function getNodePool + * @memberof google.cloud.edgecontainer.v1.EdgeContainer + * @instance + * @param {google.cloud.edgecontainer.v1.IGetNodePoolRequest} request GetNodePoolRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.edgecontainer.v1.EdgeContainer|createNodePool}. + * @memberof google.cloud.edgecontainer.v1.EdgeContainer + * @typedef CreateNodePoolCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls CreateNodePool. + * @function createNodePool + * @memberof google.cloud.edgecontainer.v1.EdgeContainer + * @instance + * @param {google.cloud.edgecontainer.v1.ICreateNodePoolRequest} request CreateNodePoolRequest message or plain object + * @param {google.cloud.edgecontainer.v1.EdgeContainer.CreateNodePoolCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(EdgeContainer.prototype.createNodePool = function createNodePool(request, callback) { + return this.rpcCall(createNodePool, $root.google.cloud.edgecontainer.v1.CreateNodePoolRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "CreateNodePool" }); + + /** + * Calls CreateNodePool. + * @function createNodePool + * @memberof google.cloud.edgecontainer.v1.EdgeContainer + * @instance + * @param {google.cloud.edgecontainer.v1.ICreateNodePoolRequest} request CreateNodePoolRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.edgecontainer.v1.EdgeContainer|updateNodePool}. + * @memberof google.cloud.edgecontainer.v1.EdgeContainer + * @typedef UpdateNodePoolCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls UpdateNodePool. + * @function updateNodePool + * @memberof google.cloud.edgecontainer.v1.EdgeContainer + * @instance + * @param {google.cloud.edgecontainer.v1.IUpdateNodePoolRequest} request UpdateNodePoolRequest message or plain object + * @param {google.cloud.edgecontainer.v1.EdgeContainer.UpdateNodePoolCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(EdgeContainer.prototype.updateNodePool = function updateNodePool(request, callback) { + return this.rpcCall(updateNodePool, $root.google.cloud.edgecontainer.v1.UpdateNodePoolRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "UpdateNodePool" }); + + /** + * Calls UpdateNodePool. + * @function updateNodePool + * @memberof google.cloud.edgecontainer.v1.EdgeContainer + * @instance + * @param {google.cloud.edgecontainer.v1.IUpdateNodePoolRequest} request UpdateNodePoolRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.edgecontainer.v1.EdgeContainer|deleteNodePool}. + * @memberof google.cloud.edgecontainer.v1.EdgeContainer + * @typedef DeleteNodePoolCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls DeleteNodePool. + * @function deleteNodePool + * @memberof google.cloud.edgecontainer.v1.EdgeContainer + * @instance + * @param {google.cloud.edgecontainer.v1.IDeleteNodePoolRequest} request DeleteNodePoolRequest message or plain object + * @param {google.cloud.edgecontainer.v1.EdgeContainer.DeleteNodePoolCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(EdgeContainer.prototype.deleteNodePool = function deleteNodePool(request, callback) { + return this.rpcCall(deleteNodePool, $root.google.cloud.edgecontainer.v1.DeleteNodePoolRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "DeleteNodePool" }); + + /** + * Calls DeleteNodePool. + * @function deleteNodePool + * @memberof google.cloud.edgecontainer.v1.EdgeContainer + * @instance + * @param {google.cloud.edgecontainer.v1.IDeleteNodePoolRequest} request DeleteNodePoolRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.edgecontainer.v1.EdgeContainer|listMachines}. + * @memberof google.cloud.edgecontainer.v1.EdgeContainer + * @typedef ListMachinesCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.edgecontainer.v1.ListMachinesResponse} [response] ListMachinesResponse + */ + + /** + * Calls ListMachines. + * @function listMachines + * @memberof google.cloud.edgecontainer.v1.EdgeContainer + * @instance + * @param {google.cloud.edgecontainer.v1.IListMachinesRequest} request ListMachinesRequest message or plain object + * @param {google.cloud.edgecontainer.v1.EdgeContainer.ListMachinesCallback} callback Node-style callback called with the error, if any, and ListMachinesResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(EdgeContainer.prototype.listMachines = function listMachines(request, callback) { + return this.rpcCall(listMachines, $root.google.cloud.edgecontainer.v1.ListMachinesRequest, $root.google.cloud.edgecontainer.v1.ListMachinesResponse, request, callback); + }, "name", { value: "ListMachines" }); + + /** + * Calls ListMachines. + * @function listMachines + * @memberof google.cloud.edgecontainer.v1.EdgeContainer + * @instance + * @param {google.cloud.edgecontainer.v1.IListMachinesRequest} request ListMachinesRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.edgecontainer.v1.EdgeContainer|getMachine}. + * @memberof google.cloud.edgecontainer.v1.EdgeContainer + * @typedef GetMachineCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.edgecontainer.v1.Machine} [response] Machine + */ + + /** + * Calls GetMachine. + * @function getMachine + * @memberof google.cloud.edgecontainer.v1.EdgeContainer + * @instance + * @param {google.cloud.edgecontainer.v1.IGetMachineRequest} request GetMachineRequest message or plain object + * @param {google.cloud.edgecontainer.v1.EdgeContainer.GetMachineCallback} callback Node-style callback called with the error, if any, and Machine + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(EdgeContainer.prototype.getMachine = function getMachine(request, callback) { + return this.rpcCall(getMachine, $root.google.cloud.edgecontainer.v1.GetMachineRequest, $root.google.cloud.edgecontainer.v1.Machine, request, callback); + }, "name", { value: "GetMachine" }); + + /** + * Calls GetMachine. + * @function getMachine + * @memberof google.cloud.edgecontainer.v1.EdgeContainer + * @instance + * @param {google.cloud.edgecontainer.v1.IGetMachineRequest} request GetMachineRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.edgecontainer.v1.EdgeContainer|listVpnConnections}. + * @memberof google.cloud.edgecontainer.v1.EdgeContainer + * @typedef ListVpnConnectionsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.edgecontainer.v1.ListVpnConnectionsResponse} [response] ListVpnConnectionsResponse + */ + + /** + * Calls ListVpnConnections. + * @function listVpnConnections + * @memberof google.cloud.edgecontainer.v1.EdgeContainer + * @instance + * @param {google.cloud.edgecontainer.v1.IListVpnConnectionsRequest} request ListVpnConnectionsRequest message or plain object + * @param {google.cloud.edgecontainer.v1.EdgeContainer.ListVpnConnectionsCallback} callback Node-style callback called with the error, if any, and ListVpnConnectionsResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(EdgeContainer.prototype.listVpnConnections = function listVpnConnections(request, callback) { + return this.rpcCall(listVpnConnections, $root.google.cloud.edgecontainer.v1.ListVpnConnectionsRequest, $root.google.cloud.edgecontainer.v1.ListVpnConnectionsResponse, request, callback); + }, "name", { value: "ListVpnConnections" }); + + /** + * Calls ListVpnConnections. + * @function listVpnConnections + * @memberof google.cloud.edgecontainer.v1.EdgeContainer + * @instance + * @param {google.cloud.edgecontainer.v1.IListVpnConnectionsRequest} request ListVpnConnectionsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.edgecontainer.v1.EdgeContainer|getVpnConnection}. + * @memberof google.cloud.edgecontainer.v1.EdgeContainer + * @typedef GetVpnConnectionCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.edgecontainer.v1.VpnConnection} [response] VpnConnection + */ + + /** + * Calls GetVpnConnection. + * @function getVpnConnection + * @memberof google.cloud.edgecontainer.v1.EdgeContainer + * @instance + * @param {google.cloud.edgecontainer.v1.IGetVpnConnectionRequest} request GetVpnConnectionRequest message or plain object + * @param {google.cloud.edgecontainer.v1.EdgeContainer.GetVpnConnectionCallback} callback Node-style callback called with the error, if any, and VpnConnection + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(EdgeContainer.prototype.getVpnConnection = function getVpnConnection(request, callback) { + return this.rpcCall(getVpnConnection, $root.google.cloud.edgecontainer.v1.GetVpnConnectionRequest, $root.google.cloud.edgecontainer.v1.VpnConnection, request, callback); + }, "name", { value: "GetVpnConnection" }); + + /** + * Calls GetVpnConnection. + * @function getVpnConnection + * @memberof google.cloud.edgecontainer.v1.EdgeContainer + * @instance + * @param {google.cloud.edgecontainer.v1.IGetVpnConnectionRequest} request GetVpnConnectionRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.edgecontainer.v1.EdgeContainer|createVpnConnection}. + * @memberof google.cloud.edgecontainer.v1.EdgeContainer + * @typedef CreateVpnConnectionCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls CreateVpnConnection. + * @function createVpnConnection + * @memberof google.cloud.edgecontainer.v1.EdgeContainer + * @instance + * @param {google.cloud.edgecontainer.v1.ICreateVpnConnectionRequest} request CreateVpnConnectionRequest message or plain object + * @param {google.cloud.edgecontainer.v1.EdgeContainer.CreateVpnConnectionCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(EdgeContainer.prototype.createVpnConnection = function createVpnConnection(request, callback) { + return this.rpcCall(createVpnConnection, $root.google.cloud.edgecontainer.v1.CreateVpnConnectionRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "CreateVpnConnection" }); + + /** + * Calls CreateVpnConnection. + * @function createVpnConnection + * @memberof google.cloud.edgecontainer.v1.EdgeContainer + * @instance + * @param {google.cloud.edgecontainer.v1.ICreateVpnConnectionRequest} request CreateVpnConnectionRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.edgecontainer.v1.EdgeContainer|deleteVpnConnection}. + * @memberof google.cloud.edgecontainer.v1.EdgeContainer + * @typedef DeleteVpnConnectionCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls DeleteVpnConnection. + * @function deleteVpnConnection + * @memberof google.cloud.edgecontainer.v1.EdgeContainer + * @instance + * @param {google.cloud.edgecontainer.v1.IDeleteVpnConnectionRequest} request DeleteVpnConnectionRequest message or plain object + * @param {google.cloud.edgecontainer.v1.EdgeContainer.DeleteVpnConnectionCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(EdgeContainer.prototype.deleteVpnConnection = function deleteVpnConnection(request, callback) { + return this.rpcCall(deleteVpnConnection, $root.google.cloud.edgecontainer.v1.DeleteVpnConnectionRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "DeleteVpnConnection" }); + + /** + * Calls DeleteVpnConnection. + * @function deleteVpnConnection + * @memberof google.cloud.edgecontainer.v1.EdgeContainer + * @instance + * @param {google.cloud.edgecontainer.v1.IDeleteVpnConnectionRequest} request DeleteVpnConnectionRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + return EdgeContainer; + })(); + + v1.OperationMetadata = (function() { + + /** + * Properties of an OperationMetadata. + * @memberof google.cloud.edgecontainer.v1 + * @interface IOperationMetadata + * @property {google.protobuf.ITimestamp|null} [createTime] OperationMetadata createTime + * @property {google.protobuf.ITimestamp|null} [endTime] OperationMetadata endTime + * @property {string|null} [target] OperationMetadata target + * @property {string|null} [verb] OperationMetadata verb + * @property {string|null} [statusMessage] OperationMetadata statusMessage + * @property {boolean|null} [requestedCancellation] OperationMetadata requestedCancellation + * @property {string|null} [apiVersion] OperationMetadata apiVersion + */ + + /** + * Constructs a new OperationMetadata. + * @memberof google.cloud.edgecontainer.v1 + * @classdesc Represents an OperationMetadata. + * @implements IOperationMetadata + * @constructor + * @param {google.cloud.edgecontainer.v1.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.edgecontainer.v1.OperationMetadata + * @instance + */ + OperationMetadata.prototype.createTime = null; + + /** + * OperationMetadata endTime. + * @member {google.protobuf.ITimestamp|null|undefined} endTime + * @memberof google.cloud.edgecontainer.v1.OperationMetadata + * @instance + */ + OperationMetadata.prototype.endTime = null; + + /** + * OperationMetadata target. + * @member {string} target + * @memberof google.cloud.edgecontainer.v1.OperationMetadata + * @instance + */ + OperationMetadata.prototype.target = ""; + + /** + * OperationMetadata verb. + * @member {string} verb + * @memberof google.cloud.edgecontainer.v1.OperationMetadata + * @instance + */ + OperationMetadata.prototype.verb = ""; + + /** + * OperationMetadata statusMessage. + * @member {string} statusMessage + * @memberof google.cloud.edgecontainer.v1.OperationMetadata + * @instance + */ + OperationMetadata.prototype.statusMessage = ""; + + /** + * OperationMetadata requestedCancellation. + * @member {boolean} requestedCancellation + * @memberof google.cloud.edgecontainer.v1.OperationMetadata + * @instance + */ + OperationMetadata.prototype.requestedCancellation = false; + + /** + * OperationMetadata apiVersion. + * @member {string} apiVersion + * @memberof google.cloud.edgecontainer.v1.OperationMetadata + * @instance + */ + OperationMetadata.prototype.apiVersion = ""; + + /** + * Creates a new OperationMetadata instance using the specified properties. + * @function create + * @memberof google.cloud.edgecontainer.v1.OperationMetadata + * @static + * @param {google.cloud.edgecontainer.v1.IOperationMetadata=} [properties] Properties to set + * @returns {google.cloud.edgecontainer.v1.OperationMetadata} OperationMetadata instance + */ + OperationMetadata.create = function create(properties) { + return new OperationMetadata(properties); + }; + + /** + * Encodes the specified OperationMetadata message. Does not implicitly {@link google.cloud.edgecontainer.v1.OperationMetadata.verify|verify} messages. + * @function encode + * @memberof google.cloud.edgecontainer.v1.OperationMetadata + * @static + * @param {google.cloud.edgecontainer.v1.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.endTime != null && Object.hasOwnProperty.call(message, "endTime")) + $root.google.protobuf.Timestamp.encode(message.endTime, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.target != null && Object.hasOwnProperty.call(message, "target")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.target); + if (message.verb != null && Object.hasOwnProperty.call(message, "verb")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.verb); + if (message.statusMessage != null && Object.hasOwnProperty.call(message, "statusMessage")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.statusMessage); + if (message.requestedCancellation != null && Object.hasOwnProperty.call(message, "requestedCancellation")) + writer.uint32(/* id 6, wireType 0 =*/48).bool(message.requestedCancellation); + if (message.apiVersion != null && Object.hasOwnProperty.call(message, "apiVersion")) + writer.uint32(/* id 7, wireType 2 =*/58).string(message.apiVersion); + return writer; + }; + + /** + * Encodes the specified OperationMetadata message, length delimited. Does not implicitly {@link google.cloud.edgecontainer.v1.OperationMetadata.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.edgecontainer.v1.OperationMetadata + * @static + * @param {google.cloud.edgecontainer.v1.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.edgecontainer.v1.OperationMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.edgecontainer.v1.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) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.edgecontainer.v1.OperationMetadata(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.createTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 2: { + message.endTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 3: { + message.target = reader.string(); + break; + } + case 4: { + message.verb = reader.string(); + break; + } + case 5: { + message.statusMessage = reader.string(); + break; + } + case 6: { + message.requestedCancellation = reader.bool(); + break; + } + case 7: { + message.apiVersion = reader.string(); + 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.edgecontainer.v1.OperationMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.edgecontainer.v1.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.edgecontainer.v1.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"; + if (message.createTime != null && message.hasOwnProperty("createTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.createTime); + if (error) + return "createTime." + error; + } + if (message.endTime != null && message.hasOwnProperty("endTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.endTime); + if (error) + return "endTime." + error; + } + if (message.target != null && message.hasOwnProperty("target")) + if (!$util.isString(message.target)) + return "target: string expected"; + if (message.verb != null && message.hasOwnProperty("verb")) + if (!$util.isString(message.verb)) + return "verb: string expected"; + if (message.statusMessage != null && message.hasOwnProperty("statusMessage")) + if (!$util.isString(message.statusMessage)) + return "statusMessage: string expected"; + if (message.requestedCancellation != null && message.hasOwnProperty("requestedCancellation")) + if (typeof message.requestedCancellation !== "boolean") + return "requestedCancellation: boolean expected"; + if (message.apiVersion != null && message.hasOwnProperty("apiVersion")) + if (!$util.isString(message.apiVersion)) + return "apiVersion: string expected"; + return null; + }; + + /** + * Creates an OperationMetadata message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.edgecontainer.v1.OperationMetadata + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.edgecontainer.v1.OperationMetadata} OperationMetadata + */ + OperationMetadata.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.edgecontainer.v1.OperationMetadata) + return object; + var message = new $root.google.cloud.edgecontainer.v1.OperationMetadata(); + if (object.createTime != null) { + if (typeof object.createTime !== "object") + throw TypeError(".google.cloud.edgecontainer.v1.OperationMetadata.createTime: object expected"); + message.createTime = $root.google.protobuf.Timestamp.fromObject(object.createTime); + } + if (object.endTime != null) { + if (typeof object.endTime !== "object") + throw TypeError(".google.cloud.edgecontainer.v1.OperationMetadata.endTime: object expected"); + message.endTime = $root.google.protobuf.Timestamp.fromObject(object.endTime); + } + if (object.target != null) + message.target = String(object.target); + if (object.verb != null) + message.verb = String(object.verb); + if (object.statusMessage != null) + message.statusMessage = String(object.statusMessage); + if (object.requestedCancellation != null) + message.requestedCancellation = Boolean(object.requestedCancellation); + if (object.apiVersion != null) + message.apiVersion = String(object.apiVersion); + return message; + }; + + /** + * Creates a plain object from an OperationMetadata message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.edgecontainer.v1.OperationMetadata + * @static + * @param {google.cloud.edgecontainer.v1.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.endTime = null; + object.target = ""; + object.verb = ""; + object.statusMessage = ""; + object.requestedCancellation = false; + object.apiVersion = ""; + } + if (message.createTime != null && message.hasOwnProperty("createTime")) + object.createTime = $root.google.protobuf.Timestamp.toObject(message.createTime, options); + if (message.endTime != null && message.hasOwnProperty("endTime")) + object.endTime = $root.google.protobuf.Timestamp.toObject(message.endTime, options); + if (message.target != null && message.hasOwnProperty("target")) + object.target = message.target; + if (message.verb != null && message.hasOwnProperty("verb")) + object.verb = message.verb; + if (message.statusMessage != null && message.hasOwnProperty("statusMessage")) + object.statusMessage = message.statusMessage; + if (message.requestedCancellation != null && message.hasOwnProperty("requestedCancellation")) + object.requestedCancellation = message.requestedCancellation; + if (message.apiVersion != null && message.hasOwnProperty("apiVersion")) + object.apiVersion = message.apiVersion; + return object; + }; + + /** + * Converts this OperationMetadata to JSON. + * @function toJSON + * @memberof google.cloud.edgecontainer.v1.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.edgecontainer.v1.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.edgecontainer.v1.OperationMetadata"; + }; + + return OperationMetadata; + })(); + + v1.ListClustersRequest = (function() { + + /** + * Properties of a ListClustersRequest. + * @memberof google.cloud.edgecontainer.v1 + * @interface IListClustersRequest + * @property {string|null} [parent] ListClustersRequest parent + * @property {number|null} [pageSize] ListClustersRequest pageSize + * @property {string|null} [pageToken] ListClustersRequest pageToken + * @property {string|null} [filter] ListClustersRequest filter + * @property {string|null} [orderBy] ListClustersRequest orderBy + */ + + /** + * Constructs a new ListClustersRequest. + * @memberof google.cloud.edgecontainer.v1 + * @classdesc Represents a ListClustersRequest. + * @implements IListClustersRequest + * @constructor + * @param {google.cloud.edgecontainer.v1.IListClustersRequest=} [properties] Properties to set + */ + function ListClustersRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListClustersRequest parent. + * @member {string} parent + * @memberof google.cloud.edgecontainer.v1.ListClustersRequest + * @instance + */ + ListClustersRequest.prototype.parent = ""; + + /** + * ListClustersRequest pageSize. + * @member {number} pageSize + * @memberof google.cloud.edgecontainer.v1.ListClustersRequest + * @instance + */ + ListClustersRequest.prototype.pageSize = 0; + + /** + * ListClustersRequest pageToken. + * @member {string} pageToken + * @memberof google.cloud.edgecontainer.v1.ListClustersRequest + * @instance + */ + ListClustersRequest.prototype.pageToken = ""; + + /** + * ListClustersRequest filter. + * @member {string} filter + * @memberof google.cloud.edgecontainer.v1.ListClustersRequest + * @instance + */ + ListClustersRequest.prototype.filter = ""; + + /** + * ListClustersRequest orderBy. + * @member {string} orderBy + * @memberof google.cloud.edgecontainer.v1.ListClustersRequest + * @instance + */ + ListClustersRequest.prototype.orderBy = ""; + + /** + * Creates a new ListClustersRequest instance using the specified properties. + * @function create + * @memberof google.cloud.edgecontainer.v1.ListClustersRequest + * @static + * @param {google.cloud.edgecontainer.v1.IListClustersRequest=} [properties] Properties to set + * @returns {google.cloud.edgecontainer.v1.ListClustersRequest} ListClustersRequest instance + */ + ListClustersRequest.create = function create(properties) { + return new ListClustersRequest(properties); + }; + + /** + * Encodes the specified ListClustersRequest message. Does not implicitly {@link google.cloud.edgecontainer.v1.ListClustersRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.edgecontainer.v1.ListClustersRequest + * @static + * @param {google.cloud.edgecontainer.v1.IListClustersRequest} message ListClustersRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListClustersRequest.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.filter != null && Object.hasOwnProperty.call(message, "filter")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.filter); + if (message.orderBy != null && Object.hasOwnProperty.call(message, "orderBy")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.orderBy); + return writer; + }; + + /** + * Encodes the specified ListClustersRequest message, length delimited. Does not implicitly {@link google.cloud.edgecontainer.v1.ListClustersRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.edgecontainer.v1.ListClustersRequest + * @static + * @param {google.cloud.edgecontainer.v1.IListClustersRequest} message ListClustersRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListClustersRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListClustersRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.edgecontainer.v1.ListClustersRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.edgecontainer.v1.ListClustersRequest} ListClustersRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListClustersRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.edgecontainer.v1.ListClustersRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + 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.filter = reader.string(); + break; + } + case 5: { + message.orderBy = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListClustersRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.edgecontainer.v1.ListClustersRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.edgecontainer.v1.ListClustersRequest} ListClustersRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListClustersRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListClustersRequest message. + * @function verify + * @memberof google.cloud.edgecontainer.v1.ListClustersRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListClustersRequest.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.filter != null && message.hasOwnProperty("filter")) + if (!$util.isString(message.filter)) + return "filter: string expected"; + if (message.orderBy != null && message.hasOwnProperty("orderBy")) + if (!$util.isString(message.orderBy)) + return "orderBy: string expected"; + return null; + }; + + /** + * Creates a ListClustersRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.edgecontainer.v1.ListClustersRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.edgecontainer.v1.ListClustersRequest} ListClustersRequest + */ + ListClustersRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.edgecontainer.v1.ListClustersRequest) + return object; + var message = new $root.google.cloud.edgecontainer.v1.ListClustersRequest(); + 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.filter != null) + message.filter = String(object.filter); + if (object.orderBy != null) + message.orderBy = String(object.orderBy); + return message; + }; + + /** + * Creates a plain object from a ListClustersRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.edgecontainer.v1.ListClustersRequest + * @static + * @param {google.cloud.edgecontainer.v1.ListClustersRequest} message ListClustersRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListClustersRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.pageSize = 0; + object.pageToken = ""; + object.filter = ""; + object.orderBy = ""; + } + 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.filter != null && message.hasOwnProperty("filter")) + object.filter = message.filter; + if (message.orderBy != null && message.hasOwnProperty("orderBy")) + object.orderBy = message.orderBy; + return object; + }; + + /** + * Converts this ListClustersRequest to JSON. + * @function toJSON + * @memberof google.cloud.edgecontainer.v1.ListClustersRequest + * @instance + * @returns {Object.} JSON object + */ + ListClustersRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListClustersRequest + * @function getTypeUrl + * @memberof google.cloud.edgecontainer.v1.ListClustersRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListClustersRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.edgecontainer.v1.ListClustersRequest"; + }; + + return ListClustersRequest; + })(); + + v1.ListClustersResponse = (function() { + + /** + * Properties of a ListClustersResponse. + * @memberof google.cloud.edgecontainer.v1 + * @interface IListClustersResponse + * @property {Array.|null} [clusters] ListClustersResponse clusters + * @property {string|null} [nextPageToken] ListClustersResponse nextPageToken + * @property {Array.|null} [unreachable] ListClustersResponse unreachable + */ + + /** + * Constructs a new ListClustersResponse. + * @memberof google.cloud.edgecontainer.v1 + * @classdesc Represents a ListClustersResponse. + * @implements IListClustersResponse + * @constructor + * @param {google.cloud.edgecontainer.v1.IListClustersResponse=} [properties] Properties to set + */ + function ListClustersResponse(properties) { + this.clusters = []; + this.unreachable = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListClustersResponse clusters. + * @member {Array.} clusters + * @memberof google.cloud.edgecontainer.v1.ListClustersResponse + * @instance + */ + ListClustersResponse.prototype.clusters = $util.emptyArray; + + /** + * ListClustersResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.cloud.edgecontainer.v1.ListClustersResponse + * @instance + */ + ListClustersResponse.prototype.nextPageToken = ""; + + /** + * ListClustersResponse unreachable. + * @member {Array.} unreachable + * @memberof google.cloud.edgecontainer.v1.ListClustersResponse + * @instance + */ + ListClustersResponse.prototype.unreachable = $util.emptyArray; + + /** + * Creates a new ListClustersResponse instance using the specified properties. + * @function create + * @memberof google.cloud.edgecontainer.v1.ListClustersResponse + * @static + * @param {google.cloud.edgecontainer.v1.IListClustersResponse=} [properties] Properties to set + * @returns {google.cloud.edgecontainer.v1.ListClustersResponse} ListClustersResponse instance + */ + ListClustersResponse.create = function create(properties) { + return new ListClustersResponse(properties); + }; + + /** + * Encodes the specified ListClustersResponse message. Does not implicitly {@link google.cloud.edgecontainer.v1.ListClustersResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.edgecontainer.v1.ListClustersResponse + * @static + * @param {google.cloud.edgecontainer.v1.IListClustersResponse} message ListClustersResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListClustersResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.clusters != null && message.clusters.length) + for (var i = 0; i < message.clusters.length; ++i) + $root.google.cloud.edgecontainer.v1.Cluster.encode(message.clusters[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); + if (message.unreachable != null && message.unreachable.length) + for (var i = 0; i < message.unreachable.length; ++i) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.unreachable[i]); + return writer; + }; + + /** + * Encodes the specified ListClustersResponse message, length delimited. Does not implicitly {@link google.cloud.edgecontainer.v1.ListClustersResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.edgecontainer.v1.ListClustersResponse + * @static + * @param {google.cloud.edgecontainer.v1.IListClustersResponse} message ListClustersResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListClustersResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListClustersResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.edgecontainer.v1.ListClustersResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.edgecontainer.v1.ListClustersResponse} ListClustersResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListClustersResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.edgecontainer.v1.ListClustersResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.clusters && message.clusters.length)) + message.clusters = []; + message.clusters.push($root.google.cloud.edgecontainer.v1.Cluster.decode(reader, reader.uint32())); + break; + } + case 2: { + message.nextPageToken = reader.string(); + break; + } + case 3: { + if (!(message.unreachable && message.unreachable.length)) + message.unreachable = []; + message.unreachable.push(reader.string()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListClustersResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.edgecontainer.v1.ListClustersResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.edgecontainer.v1.ListClustersResponse} ListClustersResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListClustersResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListClustersResponse message. + * @function verify + * @memberof google.cloud.edgecontainer.v1.ListClustersResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListClustersResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.clusters != null && message.hasOwnProperty("clusters")) { + if (!Array.isArray(message.clusters)) + return "clusters: array expected"; + for (var i = 0; i < message.clusters.length; ++i) { + var error = $root.google.cloud.edgecontainer.v1.Cluster.verify(message.clusters[i]); + if (error) + return "clusters." + error; + } + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + if (message.unreachable != null && message.hasOwnProperty("unreachable")) { + if (!Array.isArray(message.unreachable)) + return "unreachable: array expected"; + for (var i = 0; i < message.unreachable.length; ++i) + if (!$util.isString(message.unreachable[i])) + return "unreachable: string[] expected"; + } + return null; + }; + + /** + * Creates a ListClustersResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.edgecontainer.v1.ListClustersResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.edgecontainer.v1.ListClustersResponse} ListClustersResponse + */ + ListClustersResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.edgecontainer.v1.ListClustersResponse) + return object; + var message = new $root.google.cloud.edgecontainer.v1.ListClustersResponse(); + if (object.clusters) { + if (!Array.isArray(object.clusters)) + throw TypeError(".google.cloud.edgecontainer.v1.ListClustersResponse.clusters: array expected"); + message.clusters = []; + for (var i = 0; i < object.clusters.length; ++i) { + if (typeof object.clusters[i] !== "object") + throw TypeError(".google.cloud.edgecontainer.v1.ListClustersResponse.clusters: object expected"); + message.clusters[i] = $root.google.cloud.edgecontainer.v1.Cluster.fromObject(object.clusters[i]); + } + } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + if (object.unreachable) { + if (!Array.isArray(object.unreachable)) + throw TypeError(".google.cloud.edgecontainer.v1.ListClustersResponse.unreachable: array expected"); + message.unreachable = []; + for (var i = 0; i < object.unreachable.length; ++i) + message.unreachable[i] = String(object.unreachable[i]); + } + return message; + }; + + /** + * Creates a plain object from a ListClustersResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.edgecontainer.v1.ListClustersResponse + * @static + * @param {google.cloud.edgecontainer.v1.ListClustersResponse} message ListClustersResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListClustersResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.clusters = []; + object.unreachable = []; + } + if (options.defaults) + object.nextPageToken = ""; + if (message.clusters && message.clusters.length) { + object.clusters = []; + for (var j = 0; j < message.clusters.length; ++j) + object.clusters[j] = $root.google.cloud.edgecontainer.v1.Cluster.toObject(message.clusters[j], options); + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + object.nextPageToken = message.nextPageToken; + if (message.unreachable && message.unreachable.length) { + object.unreachable = []; + for (var j = 0; j < message.unreachable.length; ++j) + object.unreachable[j] = message.unreachable[j]; + } + return object; + }; + + /** + * Converts this ListClustersResponse to JSON. + * @function toJSON + * @memberof google.cloud.edgecontainer.v1.ListClustersResponse + * @instance + * @returns {Object.} JSON object + */ + ListClustersResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListClustersResponse + * @function getTypeUrl + * @memberof google.cloud.edgecontainer.v1.ListClustersResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListClustersResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.edgecontainer.v1.ListClustersResponse"; + }; + + return ListClustersResponse; + })(); + + v1.GetClusterRequest = (function() { + + /** + * Properties of a GetClusterRequest. + * @memberof google.cloud.edgecontainer.v1 + * @interface IGetClusterRequest + * @property {string|null} [name] GetClusterRequest name + */ + + /** + * Constructs a new GetClusterRequest. + * @memberof google.cloud.edgecontainer.v1 + * @classdesc Represents a GetClusterRequest. + * @implements IGetClusterRequest + * @constructor + * @param {google.cloud.edgecontainer.v1.IGetClusterRequest=} [properties] Properties to set + */ + function GetClusterRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetClusterRequest name. + * @member {string} name + * @memberof google.cloud.edgecontainer.v1.GetClusterRequest + * @instance + */ + GetClusterRequest.prototype.name = ""; + + /** + * Creates a new GetClusterRequest instance using the specified properties. + * @function create + * @memberof google.cloud.edgecontainer.v1.GetClusterRequest + * @static + * @param {google.cloud.edgecontainer.v1.IGetClusterRequest=} [properties] Properties to set + * @returns {google.cloud.edgecontainer.v1.GetClusterRequest} GetClusterRequest instance + */ + GetClusterRequest.create = function create(properties) { + return new GetClusterRequest(properties); + }; + + /** + * Encodes the specified GetClusterRequest message. Does not implicitly {@link google.cloud.edgecontainer.v1.GetClusterRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.edgecontainer.v1.GetClusterRequest + * @static + * @param {google.cloud.edgecontainer.v1.IGetClusterRequest} message GetClusterRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetClusterRequest.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 GetClusterRequest message, length delimited. Does not implicitly {@link google.cloud.edgecontainer.v1.GetClusterRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.edgecontainer.v1.GetClusterRequest + * @static + * @param {google.cloud.edgecontainer.v1.IGetClusterRequest} message GetClusterRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetClusterRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetClusterRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.edgecontainer.v1.GetClusterRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.edgecontainer.v1.GetClusterRequest} GetClusterRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetClusterRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.edgecontainer.v1.GetClusterRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetClusterRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.edgecontainer.v1.GetClusterRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.edgecontainer.v1.GetClusterRequest} GetClusterRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetClusterRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetClusterRequest message. + * @function verify + * @memberof google.cloud.edgecontainer.v1.GetClusterRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetClusterRequest.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 GetClusterRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.edgecontainer.v1.GetClusterRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.edgecontainer.v1.GetClusterRequest} GetClusterRequest + */ + GetClusterRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.edgecontainer.v1.GetClusterRequest) + return object; + var message = new $root.google.cloud.edgecontainer.v1.GetClusterRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a GetClusterRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.edgecontainer.v1.GetClusterRequest + * @static + * @param {google.cloud.edgecontainer.v1.GetClusterRequest} message GetClusterRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetClusterRequest.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 GetClusterRequest to JSON. + * @function toJSON + * @memberof google.cloud.edgecontainer.v1.GetClusterRequest + * @instance + * @returns {Object.} JSON object + */ + GetClusterRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GetClusterRequest + * @function getTypeUrl + * @memberof google.cloud.edgecontainer.v1.GetClusterRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GetClusterRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.edgecontainer.v1.GetClusterRequest"; + }; + + return GetClusterRequest; + })(); + + v1.CreateClusterRequest = (function() { + + /** + * Properties of a CreateClusterRequest. + * @memberof google.cloud.edgecontainer.v1 + * @interface ICreateClusterRequest + * @property {string|null} [parent] CreateClusterRequest parent + * @property {string|null} [clusterId] CreateClusterRequest clusterId + * @property {google.cloud.edgecontainer.v1.ICluster|null} [cluster] CreateClusterRequest cluster + * @property {string|null} [requestId] CreateClusterRequest requestId + */ + + /** + * Constructs a new CreateClusterRequest. + * @memberof google.cloud.edgecontainer.v1 + * @classdesc Represents a CreateClusterRequest. + * @implements ICreateClusterRequest + * @constructor + * @param {google.cloud.edgecontainer.v1.ICreateClusterRequest=} [properties] Properties to set + */ + function CreateClusterRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * CreateClusterRequest parent. + * @member {string} parent + * @memberof google.cloud.edgecontainer.v1.CreateClusterRequest + * @instance + */ + CreateClusterRequest.prototype.parent = ""; + + /** + * CreateClusterRequest clusterId. + * @member {string} clusterId + * @memberof google.cloud.edgecontainer.v1.CreateClusterRequest + * @instance + */ + CreateClusterRequest.prototype.clusterId = ""; + + /** + * CreateClusterRequest cluster. + * @member {google.cloud.edgecontainer.v1.ICluster|null|undefined} cluster + * @memberof google.cloud.edgecontainer.v1.CreateClusterRequest + * @instance + */ + CreateClusterRequest.prototype.cluster = null; + + /** + * CreateClusterRequest requestId. + * @member {string} requestId + * @memberof google.cloud.edgecontainer.v1.CreateClusterRequest + * @instance + */ + CreateClusterRequest.prototype.requestId = ""; + + /** + * Creates a new CreateClusterRequest instance using the specified properties. + * @function create + * @memberof google.cloud.edgecontainer.v1.CreateClusterRequest + * @static + * @param {google.cloud.edgecontainer.v1.ICreateClusterRequest=} [properties] Properties to set + * @returns {google.cloud.edgecontainer.v1.CreateClusterRequest} CreateClusterRequest instance + */ + CreateClusterRequest.create = function create(properties) { + return new CreateClusterRequest(properties); + }; + + /** + * Encodes the specified CreateClusterRequest message. Does not implicitly {@link google.cloud.edgecontainer.v1.CreateClusterRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.edgecontainer.v1.CreateClusterRequest + * @static + * @param {google.cloud.edgecontainer.v1.ICreateClusterRequest} message CreateClusterRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateClusterRequest.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.clusterId != null && Object.hasOwnProperty.call(message, "clusterId")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.clusterId); + if (message.cluster != null && Object.hasOwnProperty.call(message, "cluster")) + $root.google.cloud.edgecontainer.v1.Cluster.encode(message.cluster, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.requestId); + return writer; + }; + + /** + * Encodes the specified CreateClusterRequest message, length delimited. Does not implicitly {@link google.cloud.edgecontainer.v1.CreateClusterRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.edgecontainer.v1.CreateClusterRequest + * @static + * @param {google.cloud.edgecontainer.v1.ICreateClusterRequest} message CreateClusterRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateClusterRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CreateClusterRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.edgecontainer.v1.CreateClusterRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.edgecontainer.v1.CreateClusterRequest} CreateClusterRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateClusterRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.edgecontainer.v1.CreateClusterRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.clusterId = reader.string(); + break; + } + case 3: { + message.cluster = $root.google.cloud.edgecontainer.v1.Cluster.decode(reader, reader.uint32()); + break; + } + case 4: { + message.requestId = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CreateClusterRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.edgecontainer.v1.CreateClusterRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.edgecontainer.v1.CreateClusterRequest} CreateClusterRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateClusterRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CreateClusterRequest message. + * @function verify + * @memberof google.cloud.edgecontainer.v1.CreateClusterRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CreateClusterRequest.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.clusterId != null && message.hasOwnProperty("clusterId")) + if (!$util.isString(message.clusterId)) + return "clusterId: string expected"; + if (message.cluster != null && message.hasOwnProperty("cluster")) { + var error = $root.google.cloud.edgecontainer.v1.Cluster.verify(message.cluster); + if (error) + return "cluster." + error; + } + if (message.requestId != null && message.hasOwnProperty("requestId")) + if (!$util.isString(message.requestId)) + return "requestId: string expected"; + return null; + }; + + /** + * Creates a CreateClusterRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.edgecontainer.v1.CreateClusterRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.edgecontainer.v1.CreateClusterRequest} CreateClusterRequest + */ + CreateClusterRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.edgecontainer.v1.CreateClusterRequest) + return object; + var message = new $root.google.cloud.edgecontainer.v1.CreateClusterRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.clusterId != null) + message.clusterId = String(object.clusterId); + if (object.cluster != null) { + if (typeof object.cluster !== "object") + throw TypeError(".google.cloud.edgecontainer.v1.CreateClusterRequest.cluster: object expected"); + message.cluster = $root.google.cloud.edgecontainer.v1.Cluster.fromObject(object.cluster); + } + if (object.requestId != null) + message.requestId = String(object.requestId); + return message; + }; + + /** + * Creates a plain object from a CreateClusterRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.edgecontainer.v1.CreateClusterRequest + * @static + * @param {google.cloud.edgecontainer.v1.CreateClusterRequest} message CreateClusterRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CreateClusterRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.clusterId = ""; + object.cluster = null; + object.requestId = ""; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.clusterId != null && message.hasOwnProperty("clusterId")) + object.clusterId = message.clusterId; + if (message.cluster != null && message.hasOwnProperty("cluster")) + object.cluster = $root.google.cloud.edgecontainer.v1.Cluster.toObject(message.cluster, options); + if (message.requestId != null && message.hasOwnProperty("requestId")) + object.requestId = message.requestId; + return object; + }; + + /** + * Converts this CreateClusterRequest to JSON. + * @function toJSON + * @memberof google.cloud.edgecontainer.v1.CreateClusterRequest + * @instance + * @returns {Object.} JSON object + */ + CreateClusterRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CreateClusterRequest + * @function getTypeUrl + * @memberof google.cloud.edgecontainer.v1.CreateClusterRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CreateClusterRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.edgecontainer.v1.CreateClusterRequest"; + }; + + return CreateClusterRequest; + })(); + + v1.UpdateClusterRequest = (function() { + + /** + * Properties of an UpdateClusterRequest. + * @memberof google.cloud.edgecontainer.v1 + * @interface IUpdateClusterRequest + * @property {google.protobuf.IFieldMask|null} [updateMask] UpdateClusterRequest updateMask + * @property {google.cloud.edgecontainer.v1.ICluster|null} [cluster] UpdateClusterRequest cluster + * @property {string|null} [requestId] UpdateClusterRequest requestId + */ + + /** + * Constructs a new UpdateClusterRequest. + * @memberof google.cloud.edgecontainer.v1 + * @classdesc Represents an UpdateClusterRequest. + * @implements IUpdateClusterRequest + * @constructor + * @param {google.cloud.edgecontainer.v1.IUpdateClusterRequest=} [properties] Properties to set + */ + function UpdateClusterRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * UpdateClusterRequest updateMask. + * @member {google.protobuf.IFieldMask|null|undefined} updateMask + * @memberof google.cloud.edgecontainer.v1.UpdateClusterRequest + * @instance + */ + UpdateClusterRequest.prototype.updateMask = null; + + /** + * UpdateClusterRequest cluster. + * @member {google.cloud.edgecontainer.v1.ICluster|null|undefined} cluster + * @memberof google.cloud.edgecontainer.v1.UpdateClusterRequest + * @instance + */ + UpdateClusterRequest.prototype.cluster = null; + + /** + * UpdateClusterRequest requestId. + * @member {string} requestId + * @memberof google.cloud.edgecontainer.v1.UpdateClusterRequest + * @instance + */ + UpdateClusterRequest.prototype.requestId = ""; + + /** + * Creates a new UpdateClusterRequest instance using the specified properties. + * @function create + * @memberof google.cloud.edgecontainer.v1.UpdateClusterRequest + * @static + * @param {google.cloud.edgecontainer.v1.IUpdateClusterRequest=} [properties] Properties to set + * @returns {google.cloud.edgecontainer.v1.UpdateClusterRequest} UpdateClusterRequest instance + */ + UpdateClusterRequest.create = function create(properties) { + return new UpdateClusterRequest(properties); + }; + + /** + * Encodes the specified UpdateClusterRequest message. Does not implicitly {@link google.cloud.edgecontainer.v1.UpdateClusterRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.edgecontainer.v1.UpdateClusterRequest + * @static + * @param {google.cloud.edgecontainer.v1.IUpdateClusterRequest} message UpdateClusterRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateClusterRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.updateMask != null && Object.hasOwnProperty.call(message, "updateMask")) + $root.google.protobuf.FieldMask.encode(message.updateMask, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.cluster != null && Object.hasOwnProperty.call(message, "cluster")) + $root.google.cloud.edgecontainer.v1.Cluster.encode(message.cluster, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.requestId); + return writer; + }; + + /** + * Encodes the specified UpdateClusterRequest message, length delimited. Does not implicitly {@link google.cloud.edgecontainer.v1.UpdateClusterRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.edgecontainer.v1.UpdateClusterRequest + * @static + * @param {google.cloud.edgecontainer.v1.IUpdateClusterRequest} message UpdateClusterRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateClusterRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an UpdateClusterRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.edgecontainer.v1.UpdateClusterRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.edgecontainer.v1.UpdateClusterRequest} UpdateClusterRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateClusterRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.edgecontainer.v1.UpdateClusterRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.updateMask = $root.google.protobuf.FieldMask.decode(reader, reader.uint32()); + break; + } + case 2: { + message.cluster = $root.google.cloud.edgecontainer.v1.Cluster.decode(reader, reader.uint32()); + break; + } + case 3: { + message.requestId = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an UpdateClusterRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.edgecontainer.v1.UpdateClusterRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.edgecontainer.v1.UpdateClusterRequest} UpdateClusterRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateClusterRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an UpdateClusterRequest message. + * @function verify + * @memberof google.cloud.edgecontainer.v1.UpdateClusterRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + UpdateClusterRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.updateMask != null && message.hasOwnProperty("updateMask")) { + var error = $root.google.protobuf.FieldMask.verify(message.updateMask); + if (error) + return "updateMask." + error; + } + if (message.cluster != null && message.hasOwnProperty("cluster")) { + var error = $root.google.cloud.edgecontainer.v1.Cluster.verify(message.cluster); + if (error) + return "cluster." + error; + } + if (message.requestId != null && message.hasOwnProperty("requestId")) + if (!$util.isString(message.requestId)) + return "requestId: string expected"; + return null; + }; + + /** + * Creates an UpdateClusterRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.edgecontainer.v1.UpdateClusterRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.edgecontainer.v1.UpdateClusterRequest} UpdateClusterRequest + */ + UpdateClusterRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.edgecontainer.v1.UpdateClusterRequest) + return object; + var message = new $root.google.cloud.edgecontainer.v1.UpdateClusterRequest(); + if (object.updateMask != null) { + if (typeof object.updateMask !== "object") + throw TypeError(".google.cloud.edgecontainer.v1.UpdateClusterRequest.updateMask: object expected"); + message.updateMask = $root.google.protobuf.FieldMask.fromObject(object.updateMask); + } + if (object.cluster != null) { + if (typeof object.cluster !== "object") + throw TypeError(".google.cloud.edgecontainer.v1.UpdateClusterRequest.cluster: object expected"); + message.cluster = $root.google.cloud.edgecontainer.v1.Cluster.fromObject(object.cluster); + } + if (object.requestId != null) + message.requestId = String(object.requestId); + return message; + }; + + /** + * Creates a plain object from an UpdateClusterRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.edgecontainer.v1.UpdateClusterRequest + * @static + * @param {google.cloud.edgecontainer.v1.UpdateClusterRequest} message UpdateClusterRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + UpdateClusterRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.updateMask = null; + object.cluster = null; + object.requestId = ""; + } + if (message.updateMask != null && message.hasOwnProperty("updateMask")) + object.updateMask = $root.google.protobuf.FieldMask.toObject(message.updateMask, options); + if (message.cluster != null && message.hasOwnProperty("cluster")) + object.cluster = $root.google.cloud.edgecontainer.v1.Cluster.toObject(message.cluster, options); + if (message.requestId != null && message.hasOwnProperty("requestId")) + object.requestId = message.requestId; + return object; + }; + + /** + * Converts this UpdateClusterRequest to JSON. + * @function toJSON + * @memberof google.cloud.edgecontainer.v1.UpdateClusterRequest + * @instance + * @returns {Object.} JSON object + */ + UpdateClusterRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for UpdateClusterRequest + * @function getTypeUrl + * @memberof google.cloud.edgecontainer.v1.UpdateClusterRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + UpdateClusterRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.edgecontainer.v1.UpdateClusterRequest"; + }; + + return UpdateClusterRequest; + })(); + + v1.DeleteClusterRequest = (function() { + + /** + * Properties of a DeleteClusterRequest. + * @memberof google.cloud.edgecontainer.v1 + * @interface IDeleteClusterRequest + * @property {string|null} [name] DeleteClusterRequest name + * @property {string|null} [requestId] DeleteClusterRequest requestId + */ + + /** + * Constructs a new DeleteClusterRequest. + * @memberof google.cloud.edgecontainer.v1 + * @classdesc Represents a DeleteClusterRequest. + * @implements IDeleteClusterRequest + * @constructor + * @param {google.cloud.edgecontainer.v1.IDeleteClusterRequest=} [properties] Properties to set + */ + function DeleteClusterRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * DeleteClusterRequest name. + * @member {string} name + * @memberof google.cloud.edgecontainer.v1.DeleteClusterRequest + * @instance + */ + DeleteClusterRequest.prototype.name = ""; + + /** + * DeleteClusterRequest requestId. + * @member {string} requestId + * @memberof google.cloud.edgecontainer.v1.DeleteClusterRequest + * @instance + */ + DeleteClusterRequest.prototype.requestId = ""; + + /** + * Creates a new DeleteClusterRequest instance using the specified properties. + * @function create + * @memberof google.cloud.edgecontainer.v1.DeleteClusterRequest + * @static + * @param {google.cloud.edgecontainer.v1.IDeleteClusterRequest=} [properties] Properties to set + * @returns {google.cloud.edgecontainer.v1.DeleteClusterRequest} DeleteClusterRequest instance + */ + DeleteClusterRequest.create = function create(properties) { + return new DeleteClusterRequest(properties); + }; + + /** + * Encodes the specified DeleteClusterRequest message. Does not implicitly {@link google.cloud.edgecontainer.v1.DeleteClusterRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.edgecontainer.v1.DeleteClusterRequest + * @static + * @param {google.cloud.edgecontainer.v1.IDeleteClusterRequest} message DeleteClusterRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteClusterRequest.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.requestId != null && Object.hasOwnProperty.call(message, "requestId")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.requestId); + return writer; + }; + + /** + * Encodes the specified DeleteClusterRequest message, length delimited. Does not implicitly {@link google.cloud.edgecontainer.v1.DeleteClusterRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.edgecontainer.v1.DeleteClusterRequest + * @static + * @param {google.cloud.edgecontainer.v1.IDeleteClusterRequest} message DeleteClusterRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteClusterRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DeleteClusterRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.edgecontainer.v1.DeleteClusterRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.edgecontainer.v1.DeleteClusterRequest} DeleteClusterRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteClusterRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.edgecontainer.v1.DeleteClusterRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.requestId = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DeleteClusterRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.edgecontainer.v1.DeleteClusterRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.edgecontainer.v1.DeleteClusterRequest} DeleteClusterRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteClusterRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DeleteClusterRequest message. + * @function verify + * @memberof google.cloud.edgecontainer.v1.DeleteClusterRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DeleteClusterRequest.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.requestId != null && message.hasOwnProperty("requestId")) + if (!$util.isString(message.requestId)) + return "requestId: string expected"; + return null; + }; + + /** + * Creates a DeleteClusterRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.edgecontainer.v1.DeleteClusterRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.edgecontainer.v1.DeleteClusterRequest} DeleteClusterRequest + */ + DeleteClusterRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.edgecontainer.v1.DeleteClusterRequest) + return object; + var message = new $root.google.cloud.edgecontainer.v1.DeleteClusterRequest(); + if (object.name != null) + message.name = String(object.name); + if (object.requestId != null) + message.requestId = String(object.requestId); + return message; + }; + + /** + * Creates a plain object from a DeleteClusterRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.edgecontainer.v1.DeleteClusterRequest + * @static + * @param {google.cloud.edgecontainer.v1.DeleteClusterRequest} message DeleteClusterRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DeleteClusterRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.requestId = ""; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.requestId != null && message.hasOwnProperty("requestId")) + object.requestId = message.requestId; + return object; + }; + + /** + * Converts this DeleteClusterRequest to JSON. + * @function toJSON + * @memberof google.cloud.edgecontainer.v1.DeleteClusterRequest + * @instance + * @returns {Object.} JSON object + */ + DeleteClusterRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DeleteClusterRequest + * @function getTypeUrl + * @memberof google.cloud.edgecontainer.v1.DeleteClusterRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DeleteClusterRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.edgecontainer.v1.DeleteClusterRequest"; + }; + + return DeleteClusterRequest; + })(); + + v1.GenerateAccessTokenRequest = (function() { + + /** + * Properties of a GenerateAccessTokenRequest. + * @memberof google.cloud.edgecontainer.v1 + * @interface IGenerateAccessTokenRequest + * @property {string|null} [cluster] GenerateAccessTokenRequest cluster + */ + + /** + * Constructs a new GenerateAccessTokenRequest. + * @memberof google.cloud.edgecontainer.v1 + * @classdesc Represents a GenerateAccessTokenRequest. + * @implements IGenerateAccessTokenRequest + * @constructor + * @param {google.cloud.edgecontainer.v1.IGenerateAccessTokenRequest=} [properties] Properties to set + */ + function GenerateAccessTokenRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GenerateAccessTokenRequest cluster. + * @member {string} cluster + * @memberof google.cloud.edgecontainer.v1.GenerateAccessTokenRequest + * @instance + */ + GenerateAccessTokenRequest.prototype.cluster = ""; + + /** + * Creates a new GenerateAccessTokenRequest instance using the specified properties. + * @function create + * @memberof google.cloud.edgecontainer.v1.GenerateAccessTokenRequest + * @static + * @param {google.cloud.edgecontainer.v1.IGenerateAccessTokenRequest=} [properties] Properties to set + * @returns {google.cloud.edgecontainer.v1.GenerateAccessTokenRequest} GenerateAccessTokenRequest instance + */ + GenerateAccessTokenRequest.create = function create(properties) { + return new GenerateAccessTokenRequest(properties); + }; + + /** + * Encodes the specified GenerateAccessTokenRequest message. Does not implicitly {@link google.cloud.edgecontainer.v1.GenerateAccessTokenRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.edgecontainer.v1.GenerateAccessTokenRequest + * @static + * @param {google.cloud.edgecontainer.v1.IGenerateAccessTokenRequest} message GenerateAccessTokenRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GenerateAccessTokenRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.cluster != null && Object.hasOwnProperty.call(message, "cluster")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.cluster); + return writer; + }; + + /** + * Encodes the specified GenerateAccessTokenRequest message, length delimited. Does not implicitly {@link google.cloud.edgecontainer.v1.GenerateAccessTokenRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.edgecontainer.v1.GenerateAccessTokenRequest + * @static + * @param {google.cloud.edgecontainer.v1.IGenerateAccessTokenRequest} message GenerateAccessTokenRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GenerateAccessTokenRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GenerateAccessTokenRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.edgecontainer.v1.GenerateAccessTokenRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.edgecontainer.v1.GenerateAccessTokenRequest} GenerateAccessTokenRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GenerateAccessTokenRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.edgecontainer.v1.GenerateAccessTokenRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.cluster = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GenerateAccessTokenRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.edgecontainer.v1.GenerateAccessTokenRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.edgecontainer.v1.GenerateAccessTokenRequest} GenerateAccessTokenRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GenerateAccessTokenRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GenerateAccessTokenRequest message. + * @function verify + * @memberof google.cloud.edgecontainer.v1.GenerateAccessTokenRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GenerateAccessTokenRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.cluster != null && message.hasOwnProperty("cluster")) + if (!$util.isString(message.cluster)) + return "cluster: string expected"; + return null; + }; + + /** + * Creates a GenerateAccessTokenRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.edgecontainer.v1.GenerateAccessTokenRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.edgecontainer.v1.GenerateAccessTokenRequest} GenerateAccessTokenRequest + */ + GenerateAccessTokenRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.edgecontainer.v1.GenerateAccessTokenRequest) + return object; + var message = new $root.google.cloud.edgecontainer.v1.GenerateAccessTokenRequest(); + if (object.cluster != null) + message.cluster = String(object.cluster); + return message; + }; + + /** + * Creates a plain object from a GenerateAccessTokenRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.edgecontainer.v1.GenerateAccessTokenRequest + * @static + * @param {google.cloud.edgecontainer.v1.GenerateAccessTokenRequest} message GenerateAccessTokenRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GenerateAccessTokenRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.cluster = ""; + if (message.cluster != null && message.hasOwnProperty("cluster")) + object.cluster = message.cluster; + return object; + }; + + /** + * Converts this GenerateAccessTokenRequest to JSON. + * @function toJSON + * @memberof google.cloud.edgecontainer.v1.GenerateAccessTokenRequest + * @instance + * @returns {Object.} JSON object + */ + GenerateAccessTokenRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GenerateAccessTokenRequest + * @function getTypeUrl + * @memberof google.cloud.edgecontainer.v1.GenerateAccessTokenRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GenerateAccessTokenRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.edgecontainer.v1.GenerateAccessTokenRequest"; + }; + + return GenerateAccessTokenRequest; + })(); + + v1.GenerateAccessTokenResponse = (function() { + + /** + * Properties of a GenerateAccessTokenResponse. + * @memberof google.cloud.edgecontainer.v1 + * @interface IGenerateAccessTokenResponse + * @property {string|null} [accessToken] GenerateAccessTokenResponse accessToken + * @property {google.protobuf.ITimestamp|null} [expireTime] GenerateAccessTokenResponse expireTime + */ + + /** + * Constructs a new GenerateAccessTokenResponse. + * @memberof google.cloud.edgecontainer.v1 + * @classdesc Represents a GenerateAccessTokenResponse. + * @implements IGenerateAccessTokenResponse + * @constructor + * @param {google.cloud.edgecontainer.v1.IGenerateAccessTokenResponse=} [properties] Properties to set + */ + function GenerateAccessTokenResponse(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GenerateAccessTokenResponse accessToken. + * @member {string} accessToken + * @memberof google.cloud.edgecontainer.v1.GenerateAccessTokenResponse + * @instance + */ + GenerateAccessTokenResponse.prototype.accessToken = ""; + + /** + * GenerateAccessTokenResponse expireTime. + * @member {google.protobuf.ITimestamp|null|undefined} expireTime + * @memberof google.cloud.edgecontainer.v1.GenerateAccessTokenResponse + * @instance + */ + GenerateAccessTokenResponse.prototype.expireTime = null; + + /** + * Creates a new GenerateAccessTokenResponse instance using the specified properties. + * @function create + * @memberof google.cloud.edgecontainer.v1.GenerateAccessTokenResponse + * @static + * @param {google.cloud.edgecontainer.v1.IGenerateAccessTokenResponse=} [properties] Properties to set + * @returns {google.cloud.edgecontainer.v1.GenerateAccessTokenResponse} GenerateAccessTokenResponse instance + */ + GenerateAccessTokenResponse.create = function create(properties) { + return new GenerateAccessTokenResponse(properties); + }; + + /** + * Encodes the specified GenerateAccessTokenResponse message. Does not implicitly {@link google.cloud.edgecontainer.v1.GenerateAccessTokenResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.edgecontainer.v1.GenerateAccessTokenResponse + * @static + * @param {google.cloud.edgecontainer.v1.IGenerateAccessTokenResponse} message GenerateAccessTokenResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GenerateAccessTokenResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.accessToken != null && Object.hasOwnProperty.call(message, "accessToken")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.accessToken); + if (message.expireTime != null && Object.hasOwnProperty.call(message, "expireTime")) + $root.google.protobuf.Timestamp.encode(message.expireTime, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified GenerateAccessTokenResponse message, length delimited. Does not implicitly {@link google.cloud.edgecontainer.v1.GenerateAccessTokenResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.edgecontainer.v1.GenerateAccessTokenResponse + * @static + * @param {google.cloud.edgecontainer.v1.IGenerateAccessTokenResponse} message GenerateAccessTokenResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GenerateAccessTokenResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GenerateAccessTokenResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.edgecontainer.v1.GenerateAccessTokenResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.edgecontainer.v1.GenerateAccessTokenResponse} GenerateAccessTokenResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GenerateAccessTokenResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.edgecontainer.v1.GenerateAccessTokenResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.accessToken = reader.string(); + break; + } + case 2: { + message.expireTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GenerateAccessTokenResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.edgecontainer.v1.GenerateAccessTokenResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.edgecontainer.v1.GenerateAccessTokenResponse} GenerateAccessTokenResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GenerateAccessTokenResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GenerateAccessTokenResponse message. + * @function verify + * @memberof google.cloud.edgecontainer.v1.GenerateAccessTokenResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GenerateAccessTokenResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.accessToken != null && message.hasOwnProperty("accessToken")) + if (!$util.isString(message.accessToken)) + return "accessToken: string expected"; + if (message.expireTime != null && message.hasOwnProperty("expireTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.expireTime); + if (error) + return "expireTime." + error; + } + return null; + }; + + /** + * Creates a GenerateAccessTokenResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.edgecontainer.v1.GenerateAccessTokenResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.edgecontainer.v1.GenerateAccessTokenResponse} GenerateAccessTokenResponse + */ + GenerateAccessTokenResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.edgecontainer.v1.GenerateAccessTokenResponse) + return object; + var message = new $root.google.cloud.edgecontainer.v1.GenerateAccessTokenResponse(); + if (object.accessToken != null) + message.accessToken = String(object.accessToken); + if (object.expireTime != null) { + if (typeof object.expireTime !== "object") + throw TypeError(".google.cloud.edgecontainer.v1.GenerateAccessTokenResponse.expireTime: object expected"); + message.expireTime = $root.google.protobuf.Timestamp.fromObject(object.expireTime); + } + return message; + }; + + /** + * Creates a plain object from a GenerateAccessTokenResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.edgecontainer.v1.GenerateAccessTokenResponse + * @static + * @param {google.cloud.edgecontainer.v1.GenerateAccessTokenResponse} message GenerateAccessTokenResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GenerateAccessTokenResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.accessToken = ""; + object.expireTime = null; + } + if (message.accessToken != null && message.hasOwnProperty("accessToken")) + object.accessToken = message.accessToken; + if (message.expireTime != null && message.hasOwnProperty("expireTime")) + object.expireTime = $root.google.protobuf.Timestamp.toObject(message.expireTime, options); + return object; + }; + + /** + * Converts this GenerateAccessTokenResponse to JSON. + * @function toJSON + * @memberof google.cloud.edgecontainer.v1.GenerateAccessTokenResponse + * @instance + * @returns {Object.} JSON object + */ + GenerateAccessTokenResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GenerateAccessTokenResponse + * @function getTypeUrl + * @memberof google.cloud.edgecontainer.v1.GenerateAccessTokenResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GenerateAccessTokenResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.edgecontainer.v1.GenerateAccessTokenResponse"; + }; + + return GenerateAccessTokenResponse; + })(); + + v1.ListNodePoolsRequest = (function() { + + /** + * Properties of a ListNodePoolsRequest. + * @memberof google.cloud.edgecontainer.v1 + * @interface IListNodePoolsRequest + * @property {string|null} [parent] ListNodePoolsRequest parent + * @property {number|null} [pageSize] ListNodePoolsRequest pageSize + * @property {string|null} [pageToken] ListNodePoolsRequest pageToken + * @property {string|null} [filter] ListNodePoolsRequest filter + * @property {string|null} [orderBy] ListNodePoolsRequest orderBy + */ + + /** + * Constructs a new ListNodePoolsRequest. + * @memberof google.cloud.edgecontainer.v1 + * @classdesc Represents a ListNodePoolsRequest. + * @implements IListNodePoolsRequest + * @constructor + * @param {google.cloud.edgecontainer.v1.IListNodePoolsRequest=} [properties] Properties to set + */ + function ListNodePoolsRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListNodePoolsRequest parent. + * @member {string} parent + * @memberof google.cloud.edgecontainer.v1.ListNodePoolsRequest + * @instance + */ + ListNodePoolsRequest.prototype.parent = ""; + + /** + * ListNodePoolsRequest pageSize. + * @member {number} pageSize + * @memberof google.cloud.edgecontainer.v1.ListNodePoolsRequest + * @instance + */ + ListNodePoolsRequest.prototype.pageSize = 0; + + /** + * ListNodePoolsRequest pageToken. + * @member {string} pageToken + * @memberof google.cloud.edgecontainer.v1.ListNodePoolsRequest + * @instance + */ + ListNodePoolsRequest.prototype.pageToken = ""; + + /** + * ListNodePoolsRequest filter. + * @member {string} filter + * @memberof google.cloud.edgecontainer.v1.ListNodePoolsRequest + * @instance + */ + ListNodePoolsRequest.prototype.filter = ""; + + /** + * ListNodePoolsRequest orderBy. + * @member {string} orderBy + * @memberof google.cloud.edgecontainer.v1.ListNodePoolsRequest + * @instance + */ + ListNodePoolsRequest.prototype.orderBy = ""; + + /** + * Creates a new ListNodePoolsRequest instance using the specified properties. + * @function create + * @memberof google.cloud.edgecontainer.v1.ListNodePoolsRequest + * @static + * @param {google.cloud.edgecontainer.v1.IListNodePoolsRequest=} [properties] Properties to set + * @returns {google.cloud.edgecontainer.v1.ListNodePoolsRequest} ListNodePoolsRequest instance + */ + ListNodePoolsRequest.create = function create(properties) { + return new ListNodePoolsRequest(properties); + }; + + /** + * Encodes the specified ListNodePoolsRequest message. Does not implicitly {@link google.cloud.edgecontainer.v1.ListNodePoolsRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.edgecontainer.v1.ListNodePoolsRequest + * @static + * @param {google.cloud.edgecontainer.v1.IListNodePoolsRequest} message ListNodePoolsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListNodePoolsRequest.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.filter != null && Object.hasOwnProperty.call(message, "filter")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.filter); + if (message.orderBy != null && Object.hasOwnProperty.call(message, "orderBy")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.orderBy); + return writer; + }; + + /** + * Encodes the specified ListNodePoolsRequest message, length delimited. Does not implicitly {@link google.cloud.edgecontainer.v1.ListNodePoolsRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.edgecontainer.v1.ListNodePoolsRequest + * @static + * @param {google.cloud.edgecontainer.v1.IListNodePoolsRequest} message ListNodePoolsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListNodePoolsRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListNodePoolsRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.edgecontainer.v1.ListNodePoolsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.edgecontainer.v1.ListNodePoolsRequest} ListNodePoolsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListNodePoolsRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.edgecontainer.v1.ListNodePoolsRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + 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.filter = reader.string(); + break; + } + case 5: { + message.orderBy = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListNodePoolsRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.edgecontainer.v1.ListNodePoolsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.edgecontainer.v1.ListNodePoolsRequest} ListNodePoolsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListNodePoolsRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListNodePoolsRequest message. + * @function verify + * @memberof google.cloud.edgecontainer.v1.ListNodePoolsRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListNodePoolsRequest.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.filter != null && message.hasOwnProperty("filter")) + if (!$util.isString(message.filter)) + return "filter: string expected"; + if (message.orderBy != null && message.hasOwnProperty("orderBy")) + if (!$util.isString(message.orderBy)) + return "orderBy: string expected"; + return null; + }; + + /** + * Creates a ListNodePoolsRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.edgecontainer.v1.ListNodePoolsRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.edgecontainer.v1.ListNodePoolsRequest} ListNodePoolsRequest + */ + ListNodePoolsRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.edgecontainer.v1.ListNodePoolsRequest) + return object; + var message = new $root.google.cloud.edgecontainer.v1.ListNodePoolsRequest(); + 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.filter != null) + message.filter = String(object.filter); + if (object.orderBy != null) + message.orderBy = String(object.orderBy); + return message; + }; + + /** + * Creates a plain object from a ListNodePoolsRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.edgecontainer.v1.ListNodePoolsRequest + * @static + * @param {google.cloud.edgecontainer.v1.ListNodePoolsRequest} message ListNodePoolsRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListNodePoolsRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.pageSize = 0; + object.pageToken = ""; + object.filter = ""; + object.orderBy = ""; + } + 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.filter != null && message.hasOwnProperty("filter")) + object.filter = message.filter; + if (message.orderBy != null && message.hasOwnProperty("orderBy")) + object.orderBy = message.orderBy; + return object; + }; + + /** + * Converts this ListNodePoolsRequest to JSON. + * @function toJSON + * @memberof google.cloud.edgecontainer.v1.ListNodePoolsRequest + * @instance + * @returns {Object.} JSON object + */ + ListNodePoolsRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListNodePoolsRequest + * @function getTypeUrl + * @memberof google.cloud.edgecontainer.v1.ListNodePoolsRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListNodePoolsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.edgecontainer.v1.ListNodePoolsRequest"; + }; + + return ListNodePoolsRequest; + })(); + + v1.ListNodePoolsResponse = (function() { + + /** + * Properties of a ListNodePoolsResponse. + * @memberof google.cloud.edgecontainer.v1 + * @interface IListNodePoolsResponse + * @property {Array.|null} [nodePools] ListNodePoolsResponse nodePools + * @property {string|null} [nextPageToken] ListNodePoolsResponse nextPageToken + * @property {Array.|null} [unreachable] ListNodePoolsResponse unreachable + */ + + /** + * Constructs a new ListNodePoolsResponse. + * @memberof google.cloud.edgecontainer.v1 + * @classdesc Represents a ListNodePoolsResponse. + * @implements IListNodePoolsResponse + * @constructor + * @param {google.cloud.edgecontainer.v1.IListNodePoolsResponse=} [properties] Properties to set + */ + function ListNodePoolsResponse(properties) { + this.nodePools = []; + this.unreachable = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListNodePoolsResponse nodePools. + * @member {Array.} nodePools + * @memberof google.cloud.edgecontainer.v1.ListNodePoolsResponse + * @instance + */ + ListNodePoolsResponse.prototype.nodePools = $util.emptyArray; + + /** + * ListNodePoolsResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.cloud.edgecontainer.v1.ListNodePoolsResponse + * @instance + */ + ListNodePoolsResponse.prototype.nextPageToken = ""; + + /** + * ListNodePoolsResponse unreachable. + * @member {Array.} unreachable + * @memberof google.cloud.edgecontainer.v1.ListNodePoolsResponse + * @instance + */ + ListNodePoolsResponse.prototype.unreachable = $util.emptyArray; + + /** + * Creates a new ListNodePoolsResponse instance using the specified properties. + * @function create + * @memberof google.cloud.edgecontainer.v1.ListNodePoolsResponse + * @static + * @param {google.cloud.edgecontainer.v1.IListNodePoolsResponse=} [properties] Properties to set + * @returns {google.cloud.edgecontainer.v1.ListNodePoolsResponse} ListNodePoolsResponse instance + */ + ListNodePoolsResponse.create = function create(properties) { + return new ListNodePoolsResponse(properties); + }; + + /** + * Encodes the specified ListNodePoolsResponse message. Does not implicitly {@link google.cloud.edgecontainer.v1.ListNodePoolsResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.edgecontainer.v1.ListNodePoolsResponse + * @static + * @param {google.cloud.edgecontainer.v1.IListNodePoolsResponse} message ListNodePoolsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListNodePoolsResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.nodePools != null && message.nodePools.length) + for (var i = 0; i < message.nodePools.length; ++i) + $root.google.cloud.edgecontainer.v1.NodePool.encode(message.nodePools[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); + if (message.unreachable != null && message.unreachable.length) + for (var i = 0; i < message.unreachable.length; ++i) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.unreachable[i]); + return writer; + }; + + /** + * Encodes the specified ListNodePoolsResponse message, length delimited. Does not implicitly {@link google.cloud.edgecontainer.v1.ListNodePoolsResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.edgecontainer.v1.ListNodePoolsResponse + * @static + * @param {google.cloud.edgecontainer.v1.IListNodePoolsResponse} message ListNodePoolsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListNodePoolsResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListNodePoolsResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.edgecontainer.v1.ListNodePoolsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.edgecontainer.v1.ListNodePoolsResponse} ListNodePoolsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListNodePoolsResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.edgecontainer.v1.ListNodePoolsResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.nodePools && message.nodePools.length)) + message.nodePools = []; + message.nodePools.push($root.google.cloud.edgecontainer.v1.NodePool.decode(reader, reader.uint32())); + break; + } + case 2: { + message.nextPageToken = reader.string(); + break; + } + case 3: { + if (!(message.unreachable && message.unreachable.length)) + message.unreachable = []; + message.unreachable.push(reader.string()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListNodePoolsResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.edgecontainer.v1.ListNodePoolsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.edgecontainer.v1.ListNodePoolsResponse} ListNodePoolsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListNodePoolsResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListNodePoolsResponse message. + * @function verify + * @memberof google.cloud.edgecontainer.v1.ListNodePoolsResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListNodePoolsResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.nodePools != null && message.hasOwnProperty("nodePools")) { + if (!Array.isArray(message.nodePools)) + return "nodePools: array expected"; + for (var i = 0; i < message.nodePools.length; ++i) { + var error = $root.google.cloud.edgecontainer.v1.NodePool.verify(message.nodePools[i]); + if (error) + return "nodePools." + error; + } + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + if (message.unreachable != null && message.hasOwnProperty("unreachable")) { + if (!Array.isArray(message.unreachable)) + return "unreachable: array expected"; + for (var i = 0; i < message.unreachable.length; ++i) + if (!$util.isString(message.unreachable[i])) + return "unreachable: string[] expected"; + } + return null; + }; + + /** + * Creates a ListNodePoolsResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.edgecontainer.v1.ListNodePoolsResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.edgecontainer.v1.ListNodePoolsResponse} ListNodePoolsResponse + */ + ListNodePoolsResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.edgecontainer.v1.ListNodePoolsResponse) + return object; + var message = new $root.google.cloud.edgecontainer.v1.ListNodePoolsResponse(); + if (object.nodePools) { + if (!Array.isArray(object.nodePools)) + throw TypeError(".google.cloud.edgecontainer.v1.ListNodePoolsResponse.nodePools: array expected"); + message.nodePools = []; + for (var i = 0; i < object.nodePools.length; ++i) { + if (typeof object.nodePools[i] !== "object") + throw TypeError(".google.cloud.edgecontainer.v1.ListNodePoolsResponse.nodePools: object expected"); + message.nodePools[i] = $root.google.cloud.edgecontainer.v1.NodePool.fromObject(object.nodePools[i]); + } + } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + if (object.unreachable) { + if (!Array.isArray(object.unreachable)) + throw TypeError(".google.cloud.edgecontainer.v1.ListNodePoolsResponse.unreachable: array expected"); + message.unreachable = []; + for (var i = 0; i < object.unreachable.length; ++i) + message.unreachable[i] = String(object.unreachable[i]); + } + return message; + }; + + /** + * Creates a plain object from a ListNodePoolsResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.edgecontainer.v1.ListNodePoolsResponse + * @static + * @param {google.cloud.edgecontainer.v1.ListNodePoolsResponse} message ListNodePoolsResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListNodePoolsResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.nodePools = []; + object.unreachable = []; + } + if (options.defaults) + object.nextPageToken = ""; + if (message.nodePools && message.nodePools.length) { + object.nodePools = []; + for (var j = 0; j < message.nodePools.length; ++j) + object.nodePools[j] = $root.google.cloud.edgecontainer.v1.NodePool.toObject(message.nodePools[j], options); + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + object.nextPageToken = message.nextPageToken; + if (message.unreachable && message.unreachable.length) { + object.unreachable = []; + for (var j = 0; j < message.unreachable.length; ++j) + object.unreachable[j] = message.unreachable[j]; + } + return object; + }; + + /** + * Converts this ListNodePoolsResponse to JSON. + * @function toJSON + * @memberof google.cloud.edgecontainer.v1.ListNodePoolsResponse + * @instance + * @returns {Object.} JSON object + */ + ListNodePoolsResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListNodePoolsResponse + * @function getTypeUrl + * @memberof google.cloud.edgecontainer.v1.ListNodePoolsResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListNodePoolsResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.edgecontainer.v1.ListNodePoolsResponse"; + }; + + return ListNodePoolsResponse; + })(); + + v1.GetNodePoolRequest = (function() { + + /** + * Properties of a GetNodePoolRequest. + * @memberof google.cloud.edgecontainer.v1 + * @interface IGetNodePoolRequest + * @property {string|null} [name] GetNodePoolRequest name + */ + + /** + * Constructs a new GetNodePoolRequest. + * @memberof google.cloud.edgecontainer.v1 + * @classdesc Represents a GetNodePoolRequest. + * @implements IGetNodePoolRequest + * @constructor + * @param {google.cloud.edgecontainer.v1.IGetNodePoolRequest=} [properties] Properties to set + */ + function GetNodePoolRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetNodePoolRequest name. + * @member {string} name + * @memberof google.cloud.edgecontainer.v1.GetNodePoolRequest + * @instance + */ + GetNodePoolRequest.prototype.name = ""; + + /** + * Creates a new GetNodePoolRequest instance using the specified properties. + * @function create + * @memberof google.cloud.edgecontainer.v1.GetNodePoolRequest + * @static + * @param {google.cloud.edgecontainer.v1.IGetNodePoolRequest=} [properties] Properties to set + * @returns {google.cloud.edgecontainer.v1.GetNodePoolRequest} GetNodePoolRequest instance + */ + GetNodePoolRequest.create = function create(properties) { + return new GetNodePoolRequest(properties); + }; + + /** + * Encodes the specified GetNodePoolRequest message. Does not implicitly {@link google.cloud.edgecontainer.v1.GetNodePoolRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.edgecontainer.v1.GetNodePoolRequest + * @static + * @param {google.cloud.edgecontainer.v1.IGetNodePoolRequest} message GetNodePoolRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetNodePoolRequest.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 GetNodePoolRequest message, length delimited. Does not implicitly {@link google.cloud.edgecontainer.v1.GetNodePoolRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.edgecontainer.v1.GetNodePoolRequest + * @static + * @param {google.cloud.edgecontainer.v1.IGetNodePoolRequest} message GetNodePoolRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetNodePoolRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetNodePoolRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.edgecontainer.v1.GetNodePoolRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.edgecontainer.v1.GetNodePoolRequest} GetNodePoolRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetNodePoolRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.edgecontainer.v1.GetNodePoolRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetNodePoolRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.edgecontainer.v1.GetNodePoolRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.edgecontainer.v1.GetNodePoolRequest} GetNodePoolRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetNodePoolRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetNodePoolRequest message. + * @function verify + * @memberof google.cloud.edgecontainer.v1.GetNodePoolRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetNodePoolRequest.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 GetNodePoolRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.edgecontainer.v1.GetNodePoolRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.edgecontainer.v1.GetNodePoolRequest} GetNodePoolRequest + */ + GetNodePoolRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.edgecontainer.v1.GetNodePoolRequest) + return object; + var message = new $root.google.cloud.edgecontainer.v1.GetNodePoolRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a GetNodePoolRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.edgecontainer.v1.GetNodePoolRequest + * @static + * @param {google.cloud.edgecontainer.v1.GetNodePoolRequest} message GetNodePoolRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetNodePoolRequest.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 GetNodePoolRequest to JSON. + * @function toJSON + * @memberof google.cloud.edgecontainer.v1.GetNodePoolRequest + * @instance + * @returns {Object.} JSON object + */ + GetNodePoolRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GetNodePoolRequest + * @function getTypeUrl + * @memberof google.cloud.edgecontainer.v1.GetNodePoolRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GetNodePoolRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.edgecontainer.v1.GetNodePoolRequest"; + }; + + return GetNodePoolRequest; + })(); + + v1.CreateNodePoolRequest = (function() { + + /** + * Properties of a CreateNodePoolRequest. + * @memberof google.cloud.edgecontainer.v1 + * @interface ICreateNodePoolRequest + * @property {string|null} [parent] CreateNodePoolRequest parent + * @property {string|null} [nodePoolId] CreateNodePoolRequest nodePoolId + * @property {google.cloud.edgecontainer.v1.INodePool|null} [nodePool] CreateNodePoolRequest nodePool + * @property {string|null} [requestId] CreateNodePoolRequest requestId + */ + + /** + * Constructs a new CreateNodePoolRequest. + * @memberof google.cloud.edgecontainer.v1 + * @classdesc Represents a CreateNodePoolRequest. + * @implements ICreateNodePoolRequest + * @constructor + * @param {google.cloud.edgecontainer.v1.ICreateNodePoolRequest=} [properties] Properties to set + */ + function CreateNodePoolRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * CreateNodePoolRequest parent. + * @member {string} parent + * @memberof google.cloud.edgecontainer.v1.CreateNodePoolRequest + * @instance + */ + CreateNodePoolRequest.prototype.parent = ""; + + /** + * CreateNodePoolRequest nodePoolId. + * @member {string} nodePoolId + * @memberof google.cloud.edgecontainer.v1.CreateNodePoolRequest + * @instance + */ + CreateNodePoolRequest.prototype.nodePoolId = ""; + + /** + * CreateNodePoolRequest nodePool. + * @member {google.cloud.edgecontainer.v1.INodePool|null|undefined} nodePool + * @memberof google.cloud.edgecontainer.v1.CreateNodePoolRequest + * @instance + */ + CreateNodePoolRequest.prototype.nodePool = null; + + /** + * CreateNodePoolRequest requestId. + * @member {string} requestId + * @memberof google.cloud.edgecontainer.v1.CreateNodePoolRequest + * @instance + */ + CreateNodePoolRequest.prototype.requestId = ""; + + /** + * Creates a new CreateNodePoolRequest instance using the specified properties. + * @function create + * @memberof google.cloud.edgecontainer.v1.CreateNodePoolRequest + * @static + * @param {google.cloud.edgecontainer.v1.ICreateNodePoolRequest=} [properties] Properties to set + * @returns {google.cloud.edgecontainer.v1.CreateNodePoolRequest} CreateNodePoolRequest instance + */ + CreateNodePoolRequest.create = function create(properties) { + return new CreateNodePoolRequest(properties); + }; + + /** + * Encodes the specified CreateNodePoolRequest message. Does not implicitly {@link google.cloud.edgecontainer.v1.CreateNodePoolRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.edgecontainer.v1.CreateNodePoolRequest + * @static + * @param {google.cloud.edgecontainer.v1.ICreateNodePoolRequest} message CreateNodePoolRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateNodePoolRequest.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.nodePoolId != null && Object.hasOwnProperty.call(message, "nodePoolId")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.nodePoolId); + if (message.nodePool != null && Object.hasOwnProperty.call(message, "nodePool")) + $root.google.cloud.edgecontainer.v1.NodePool.encode(message.nodePool, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.requestId); + return writer; + }; + + /** + * Encodes the specified CreateNodePoolRequest message, length delimited. Does not implicitly {@link google.cloud.edgecontainer.v1.CreateNodePoolRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.edgecontainer.v1.CreateNodePoolRequest + * @static + * @param {google.cloud.edgecontainer.v1.ICreateNodePoolRequest} message CreateNodePoolRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateNodePoolRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CreateNodePoolRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.edgecontainer.v1.CreateNodePoolRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.edgecontainer.v1.CreateNodePoolRequest} CreateNodePoolRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateNodePoolRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.edgecontainer.v1.CreateNodePoolRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.nodePoolId = reader.string(); + break; + } + case 3: { + message.nodePool = $root.google.cloud.edgecontainer.v1.NodePool.decode(reader, reader.uint32()); + break; + } + case 4: { + message.requestId = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CreateNodePoolRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.edgecontainer.v1.CreateNodePoolRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.edgecontainer.v1.CreateNodePoolRequest} CreateNodePoolRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateNodePoolRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CreateNodePoolRequest message. + * @function verify + * @memberof google.cloud.edgecontainer.v1.CreateNodePoolRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CreateNodePoolRequest.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.nodePoolId != null && message.hasOwnProperty("nodePoolId")) + if (!$util.isString(message.nodePoolId)) + return "nodePoolId: string expected"; + if (message.nodePool != null && message.hasOwnProperty("nodePool")) { + var error = $root.google.cloud.edgecontainer.v1.NodePool.verify(message.nodePool); + if (error) + return "nodePool." + error; + } + if (message.requestId != null && message.hasOwnProperty("requestId")) + if (!$util.isString(message.requestId)) + return "requestId: string expected"; + return null; + }; + + /** + * Creates a CreateNodePoolRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.edgecontainer.v1.CreateNodePoolRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.edgecontainer.v1.CreateNodePoolRequest} CreateNodePoolRequest + */ + CreateNodePoolRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.edgecontainer.v1.CreateNodePoolRequest) + return object; + var message = new $root.google.cloud.edgecontainer.v1.CreateNodePoolRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.nodePoolId != null) + message.nodePoolId = String(object.nodePoolId); + if (object.nodePool != null) { + if (typeof object.nodePool !== "object") + throw TypeError(".google.cloud.edgecontainer.v1.CreateNodePoolRequest.nodePool: object expected"); + message.nodePool = $root.google.cloud.edgecontainer.v1.NodePool.fromObject(object.nodePool); + } + if (object.requestId != null) + message.requestId = String(object.requestId); + return message; + }; + + /** + * Creates a plain object from a CreateNodePoolRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.edgecontainer.v1.CreateNodePoolRequest + * @static + * @param {google.cloud.edgecontainer.v1.CreateNodePoolRequest} message CreateNodePoolRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CreateNodePoolRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.nodePoolId = ""; + object.nodePool = null; + object.requestId = ""; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.nodePoolId != null && message.hasOwnProperty("nodePoolId")) + object.nodePoolId = message.nodePoolId; + if (message.nodePool != null && message.hasOwnProperty("nodePool")) + object.nodePool = $root.google.cloud.edgecontainer.v1.NodePool.toObject(message.nodePool, options); + if (message.requestId != null && message.hasOwnProperty("requestId")) + object.requestId = message.requestId; + return object; + }; + + /** + * Converts this CreateNodePoolRequest to JSON. + * @function toJSON + * @memberof google.cloud.edgecontainer.v1.CreateNodePoolRequest + * @instance + * @returns {Object.} JSON object + */ + CreateNodePoolRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CreateNodePoolRequest + * @function getTypeUrl + * @memberof google.cloud.edgecontainer.v1.CreateNodePoolRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CreateNodePoolRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.edgecontainer.v1.CreateNodePoolRequest"; + }; + + return CreateNodePoolRequest; + })(); + + v1.UpdateNodePoolRequest = (function() { + + /** + * Properties of an UpdateNodePoolRequest. + * @memberof google.cloud.edgecontainer.v1 + * @interface IUpdateNodePoolRequest + * @property {google.protobuf.IFieldMask|null} [updateMask] UpdateNodePoolRequest updateMask + * @property {google.cloud.edgecontainer.v1.INodePool|null} [nodePool] UpdateNodePoolRequest nodePool + * @property {string|null} [requestId] UpdateNodePoolRequest requestId + */ + + /** + * Constructs a new UpdateNodePoolRequest. + * @memberof google.cloud.edgecontainer.v1 + * @classdesc Represents an UpdateNodePoolRequest. + * @implements IUpdateNodePoolRequest + * @constructor + * @param {google.cloud.edgecontainer.v1.IUpdateNodePoolRequest=} [properties] Properties to set + */ + function UpdateNodePoolRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * UpdateNodePoolRequest updateMask. + * @member {google.protobuf.IFieldMask|null|undefined} updateMask + * @memberof google.cloud.edgecontainer.v1.UpdateNodePoolRequest + * @instance + */ + UpdateNodePoolRequest.prototype.updateMask = null; + + /** + * UpdateNodePoolRequest nodePool. + * @member {google.cloud.edgecontainer.v1.INodePool|null|undefined} nodePool + * @memberof google.cloud.edgecontainer.v1.UpdateNodePoolRequest + * @instance + */ + UpdateNodePoolRequest.prototype.nodePool = null; + + /** + * UpdateNodePoolRequest requestId. + * @member {string} requestId + * @memberof google.cloud.edgecontainer.v1.UpdateNodePoolRequest + * @instance + */ + UpdateNodePoolRequest.prototype.requestId = ""; + + /** + * Creates a new UpdateNodePoolRequest instance using the specified properties. + * @function create + * @memberof google.cloud.edgecontainer.v1.UpdateNodePoolRequest + * @static + * @param {google.cloud.edgecontainer.v1.IUpdateNodePoolRequest=} [properties] Properties to set + * @returns {google.cloud.edgecontainer.v1.UpdateNodePoolRequest} UpdateNodePoolRequest instance + */ + UpdateNodePoolRequest.create = function create(properties) { + return new UpdateNodePoolRequest(properties); + }; + + /** + * Encodes the specified UpdateNodePoolRequest message. Does not implicitly {@link google.cloud.edgecontainer.v1.UpdateNodePoolRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.edgecontainer.v1.UpdateNodePoolRequest + * @static + * @param {google.cloud.edgecontainer.v1.IUpdateNodePoolRequest} message UpdateNodePoolRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateNodePoolRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.updateMask != null && Object.hasOwnProperty.call(message, "updateMask")) + $root.google.protobuf.FieldMask.encode(message.updateMask, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.nodePool != null && Object.hasOwnProperty.call(message, "nodePool")) + $root.google.cloud.edgecontainer.v1.NodePool.encode(message.nodePool, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.requestId); + return writer; + }; + + /** + * Encodes the specified UpdateNodePoolRequest message, length delimited. Does not implicitly {@link google.cloud.edgecontainer.v1.UpdateNodePoolRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.edgecontainer.v1.UpdateNodePoolRequest + * @static + * @param {google.cloud.edgecontainer.v1.IUpdateNodePoolRequest} message UpdateNodePoolRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateNodePoolRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an UpdateNodePoolRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.edgecontainer.v1.UpdateNodePoolRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.edgecontainer.v1.UpdateNodePoolRequest} UpdateNodePoolRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateNodePoolRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.edgecontainer.v1.UpdateNodePoolRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.updateMask = $root.google.protobuf.FieldMask.decode(reader, reader.uint32()); + break; + } + case 2: { + message.nodePool = $root.google.cloud.edgecontainer.v1.NodePool.decode(reader, reader.uint32()); + break; + } + case 3: { + message.requestId = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an UpdateNodePoolRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.edgecontainer.v1.UpdateNodePoolRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.edgecontainer.v1.UpdateNodePoolRequest} UpdateNodePoolRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateNodePoolRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an UpdateNodePoolRequest message. + * @function verify + * @memberof google.cloud.edgecontainer.v1.UpdateNodePoolRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + UpdateNodePoolRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.updateMask != null && message.hasOwnProperty("updateMask")) { + var error = $root.google.protobuf.FieldMask.verify(message.updateMask); + if (error) + return "updateMask." + error; + } + if (message.nodePool != null && message.hasOwnProperty("nodePool")) { + var error = $root.google.cloud.edgecontainer.v1.NodePool.verify(message.nodePool); + if (error) + return "nodePool." + error; + } + if (message.requestId != null && message.hasOwnProperty("requestId")) + if (!$util.isString(message.requestId)) + return "requestId: string expected"; + return null; + }; + + /** + * Creates an UpdateNodePoolRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.edgecontainer.v1.UpdateNodePoolRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.edgecontainer.v1.UpdateNodePoolRequest} UpdateNodePoolRequest + */ + UpdateNodePoolRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.edgecontainer.v1.UpdateNodePoolRequest) + return object; + var message = new $root.google.cloud.edgecontainer.v1.UpdateNodePoolRequest(); + if (object.updateMask != null) { + if (typeof object.updateMask !== "object") + throw TypeError(".google.cloud.edgecontainer.v1.UpdateNodePoolRequest.updateMask: object expected"); + message.updateMask = $root.google.protobuf.FieldMask.fromObject(object.updateMask); + } + if (object.nodePool != null) { + if (typeof object.nodePool !== "object") + throw TypeError(".google.cloud.edgecontainer.v1.UpdateNodePoolRequest.nodePool: object expected"); + message.nodePool = $root.google.cloud.edgecontainer.v1.NodePool.fromObject(object.nodePool); + } + if (object.requestId != null) + message.requestId = String(object.requestId); + return message; + }; + + /** + * Creates a plain object from an UpdateNodePoolRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.edgecontainer.v1.UpdateNodePoolRequest + * @static + * @param {google.cloud.edgecontainer.v1.UpdateNodePoolRequest} message UpdateNodePoolRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + UpdateNodePoolRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.updateMask = null; + object.nodePool = null; + object.requestId = ""; + } + if (message.updateMask != null && message.hasOwnProperty("updateMask")) + object.updateMask = $root.google.protobuf.FieldMask.toObject(message.updateMask, options); + if (message.nodePool != null && message.hasOwnProperty("nodePool")) + object.nodePool = $root.google.cloud.edgecontainer.v1.NodePool.toObject(message.nodePool, options); + if (message.requestId != null && message.hasOwnProperty("requestId")) + object.requestId = message.requestId; + return object; + }; + + /** + * Converts this UpdateNodePoolRequest to JSON. + * @function toJSON + * @memberof google.cloud.edgecontainer.v1.UpdateNodePoolRequest + * @instance + * @returns {Object.} JSON object + */ + UpdateNodePoolRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for UpdateNodePoolRequest + * @function getTypeUrl + * @memberof google.cloud.edgecontainer.v1.UpdateNodePoolRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + UpdateNodePoolRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.edgecontainer.v1.UpdateNodePoolRequest"; + }; + + return UpdateNodePoolRequest; + })(); + + v1.DeleteNodePoolRequest = (function() { + + /** + * Properties of a DeleteNodePoolRequest. + * @memberof google.cloud.edgecontainer.v1 + * @interface IDeleteNodePoolRequest + * @property {string|null} [name] DeleteNodePoolRequest name + * @property {string|null} [requestId] DeleteNodePoolRequest requestId + */ + + /** + * Constructs a new DeleteNodePoolRequest. + * @memberof google.cloud.edgecontainer.v1 + * @classdesc Represents a DeleteNodePoolRequest. + * @implements IDeleteNodePoolRequest + * @constructor + * @param {google.cloud.edgecontainer.v1.IDeleteNodePoolRequest=} [properties] Properties to set + */ + function DeleteNodePoolRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * DeleteNodePoolRequest name. + * @member {string} name + * @memberof google.cloud.edgecontainer.v1.DeleteNodePoolRequest + * @instance + */ + DeleteNodePoolRequest.prototype.name = ""; + + /** + * DeleteNodePoolRequest requestId. + * @member {string} requestId + * @memberof google.cloud.edgecontainer.v1.DeleteNodePoolRequest + * @instance + */ + DeleteNodePoolRequest.prototype.requestId = ""; + + /** + * Creates a new DeleteNodePoolRequest instance using the specified properties. + * @function create + * @memberof google.cloud.edgecontainer.v1.DeleteNodePoolRequest + * @static + * @param {google.cloud.edgecontainer.v1.IDeleteNodePoolRequest=} [properties] Properties to set + * @returns {google.cloud.edgecontainer.v1.DeleteNodePoolRequest} DeleteNodePoolRequest instance + */ + DeleteNodePoolRequest.create = function create(properties) { + return new DeleteNodePoolRequest(properties); + }; + + /** + * Encodes the specified DeleteNodePoolRequest message. Does not implicitly {@link google.cloud.edgecontainer.v1.DeleteNodePoolRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.edgecontainer.v1.DeleteNodePoolRequest + * @static + * @param {google.cloud.edgecontainer.v1.IDeleteNodePoolRequest} message DeleteNodePoolRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteNodePoolRequest.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.requestId != null && Object.hasOwnProperty.call(message, "requestId")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.requestId); + return writer; + }; + + /** + * Encodes the specified DeleteNodePoolRequest message, length delimited. Does not implicitly {@link google.cloud.edgecontainer.v1.DeleteNodePoolRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.edgecontainer.v1.DeleteNodePoolRequest + * @static + * @param {google.cloud.edgecontainer.v1.IDeleteNodePoolRequest} message DeleteNodePoolRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteNodePoolRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DeleteNodePoolRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.edgecontainer.v1.DeleteNodePoolRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.edgecontainer.v1.DeleteNodePoolRequest} DeleteNodePoolRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteNodePoolRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.edgecontainer.v1.DeleteNodePoolRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.requestId = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DeleteNodePoolRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.edgecontainer.v1.DeleteNodePoolRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.edgecontainer.v1.DeleteNodePoolRequest} DeleteNodePoolRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteNodePoolRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DeleteNodePoolRequest message. + * @function verify + * @memberof google.cloud.edgecontainer.v1.DeleteNodePoolRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DeleteNodePoolRequest.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.requestId != null && message.hasOwnProperty("requestId")) + if (!$util.isString(message.requestId)) + return "requestId: string expected"; + return null; + }; + + /** + * Creates a DeleteNodePoolRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.edgecontainer.v1.DeleteNodePoolRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.edgecontainer.v1.DeleteNodePoolRequest} DeleteNodePoolRequest + */ + DeleteNodePoolRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.edgecontainer.v1.DeleteNodePoolRequest) + return object; + var message = new $root.google.cloud.edgecontainer.v1.DeleteNodePoolRequest(); + if (object.name != null) + message.name = String(object.name); + if (object.requestId != null) + message.requestId = String(object.requestId); + return message; + }; + + /** + * Creates a plain object from a DeleteNodePoolRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.edgecontainer.v1.DeleteNodePoolRequest + * @static + * @param {google.cloud.edgecontainer.v1.DeleteNodePoolRequest} message DeleteNodePoolRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DeleteNodePoolRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.requestId = ""; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.requestId != null && message.hasOwnProperty("requestId")) + object.requestId = message.requestId; + return object; + }; + + /** + * Converts this DeleteNodePoolRequest to JSON. + * @function toJSON + * @memberof google.cloud.edgecontainer.v1.DeleteNodePoolRequest + * @instance + * @returns {Object.} JSON object + */ + DeleteNodePoolRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DeleteNodePoolRequest + * @function getTypeUrl + * @memberof google.cloud.edgecontainer.v1.DeleteNodePoolRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DeleteNodePoolRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.edgecontainer.v1.DeleteNodePoolRequest"; + }; + + return DeleteNodePoolRequest; + })(); + + v1.ListMachinesRequest = (function() { + + /** + * Properties of a ListMachinesRequest. + * @memberof google.cloud.edgecontainer.v1 + * @interface IListMachinesRequest + * @property {string|null} [parent] ListMachinesRequest parent + * @property {number|null} [pageSize] ListMachinesRequest pageSize + * @property {string|null} [pageToken] ListMachinesRequest pageToken + * @property {string|null} [filter] ListMachinesRequest filter + * @property {string|null} [orderBy] ListMachinesRequest orderBy + */ + + /** + * Constructs a new ListMachinesRequest. + * @memberof google.cloud.edgecontainer.v1 + * @classdesc Represents a ListMachinesRequest. + * @implements IListMachinesRequest + * @constructor + * @param {google.cloud.edgecontainer.v1.IListMachinesRequest=} [properties] Properties to set + */ + function ListMachinesRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListMachinesRequest parent. + * @member {string} parent + * @memberof google.cloud.edgecontainer.v1.ListMachinesRequest + * @instance + */ + ListMachinesRequest.prototype.parent = ""; + + /** + * ListMachinesRequest pageSize. + * @member {number} pageSize + * @memberof google.cloud.edgecontainer.v1.ListMachinesRequest + * @instance + */ + ListMachinesRequest.prototype.pageSize = 0; + + /** + * ListMachinesRequest pageToken. + * @member {string} pageToken + * @memberof google.cloud.edgecontainer.v1.ListMachinesRequest + * @instance + */ + ListMachinesRequest.prototype.pageToken = ""; + + /** + * ListMachinesRequest filter. + * @member {string} filter + * @memberof google.cloud.edgecontainer.v1.ListMachinesRequest + * @instance + */ + ListMachinesRequest.prototype.filter = ""; + + /** + * ListMachinesRequest orderBy. + * @member {string} orderBy + * @memberof google.cloud.edgecontainer.v1.ListMachinesRequest + * @instance + */ + ListMachinesRequest.prototype.orderBy = ""; + + /** + * Creates a new ListMachinesRequest instance using the specified properties. + * @function create + * @memberof google.cloud.edgecontainer.v1.ListMachinesRequest + * @static + * @param {google.cloud.edgecontainer.v1.IListMachinesRequest=} [properties] Properties to set + * @returns {google.cloud.edgecontainer.v1.ListMachinesRequest} ListMachinesRequest instance + */ + ListMachinesRequest.create = function create(properties) { + return new ListMachinesRequest(properties); + }; + + /** + * Encodes the specified ListMachinesRequest message. Does not implicitly {@link google.cloud.edgecontainer.v1.ListMachinesRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.edgecontainer.v1.ListMachinesRequest + * @static + * @param {google.cloud.edgecontainer.v1.IListMachinesRequest} message ListMachinesRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListMachinesRequest.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.filter != null && Object.hasOwnProperty.call(message, "filter")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.filter); + if (message.orderBy != null && Object.hasOwnProperty.call(message, "orderBy")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.orderBy); + return writer; + }; + + /** + * Encodes the specified ListMachinesRequest message, length delimited. Does not implicitly {@link google.cloud.edgecontainer.v1.ListMachinesRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.edgecontainer.v1.ListMachinesRequest + * @static + * @param {google.cloud.edgecontainer.v1.IListMachinesRequest} message ListMachinesRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListMachinesRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListMachinesRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.edgecontainer.v1.ListMachinesRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.edgecontainer.v1.ListMachinesRequest} ListMachinesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListMachinesRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.edgecontainer.v1.ListMachinesRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + 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.filter = reader.string(); + break; + } + case 5: { + message.orderBy = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListMachinesRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.edgecontainer.v1.ListMachinesRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.edgecontainer.v1.ListMachinesRequest} ListMachinesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListMachinesRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListMachinesRequest message. + * @function verify + * @memberof google.cloud.edgecontainer.v1.ListMachinesRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListMachinesRequest.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.filter != null && message.hasOwnProperty("filter")) + if (!$util.isString(message.filter)) + return "filter: string expected"; + if (message.orderBy != null && message.hasOwnProperty("orderBy")) + if (!$util.isString(message.orderBy)) + return "orderBy: string expected"; + return null; + }; + + /** + * Creates a ListMachinesRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.edgecontainer.v1.ListMachinesRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.edgecontainer.v1.ListMachinesRequest} ListMachinesRequest + */ + ListMachinesRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.edgecontainer.v1.ListMachinesRequest) + return object; + var message = new $root.google.cloud.edgecontainer.v1.ListMachinesRequest(); + 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.filter != null) + message.filter = String(object.filter); + if (object.orderBy != null) + message.orderBy = String(object.orderBy); + return message; + }; + + /** + * Creates a plain object from a ListMachinesRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.edgecontainer.v1.ListMachinesRequest + * @static + * @param {google.cloud.edgecontainer.v1.ListMachinesRequest} message ListMachinesRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListMachinesRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.pageSize = 0; + object.pageToken = ""; + object.filter = ""; + object.orderBy = ""; + } + 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.filter != null && message.hasOwnProperty("filter")) + object.filter = message.filter; + if (message.orderBy != null && message.hasOwnProperty("orderBy")) + object.orderBy = message.orderBy; + return object; + }; + + /** + * Converts this ListMachinesRequest to JSON. + * @function toJSON + * @memberof google.cloud.edgecontainer.v1.ListMachinesRequest + * @instance + * @returns {Object.} JSON object + */ + ListMachinesRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListMachinesRequest + * @function getTypeUrl + * @memberof google.cloud.edgecontainer.v1.ListMachinesRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListMachinesRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.edgecontainer.v1.ListMachinesRequest"; + }; + + return ListMachinesRequest; + })(); + + v1.ListMachinesResponse = (function() { + + /** + * Properties of a ListMachinesResponse. + * @memberof google.cloud.edgecontainer.v1 + * @interface IListMachinesResponse + * @property {Array.|null} [machines] ListMachinesResponse machines + * @property {string|null} [nextPageToken] ListMachinesResponse nextPageToken + * @property {Array.|null} [unreachable] ListMachinesResponse unreachable + */ + + /** + * Constructs a new ListMachinesResponse. + * @memberof google.cloud.edgecontainer.v1 + * @classdesc Represents a ListMachinesResponse. + * @implements IListMachinesResponse + * @constructor + * @param {google.cloud.edgecontainer.v1.IListMachinesResponse=} [properties] Properties to set + */ + function ListMachinesResponse(properties) { + this.machines = []; + this.unreachable = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListMachinesResponse machines. + * @member {Array.} machines + * @memberof google.cloud.edgecontainer.v1.ListMachinesResponse + * @instance + */ + ListMachinesResponse.prototype.machines = $util.emptyArray; + + /** + * ListMachinesResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.cloud.edgecontainer.v1.ListMachinesResponse + * @instance + */ + ListMachinesResponse.prototype.nextPageToken = ""; + + /** + * ListMachinesResponse unreachable. + * @member {Array.} unreachable + * @memberof google.cloud.edgecontainer.v1.ListMachinesResponse + * @instance + */ + ListMachinesResponse.prototype.unreachable = $util.emptyArray; + + /** + * Creates a new ListMachinesResponse instance using the specified properties. + * @function create + * @memberof google.cloud.edgecontainer.v1.ListMachinesResponse + * @static + * @param {google.cloud.edgecontainer.v1.IListMachinesResponse=} [properties] Properties to set + * @returns {google.cloud.edgecontainer.v1.ListMachinesResponse} ListMachinesResponse instance + */ + ListMachinesResponse.create = function create(properties) { + return new ListMachinesResponse(properties); + }; + + /** + * Encodes the specified ListMachinesResponse message. Does not implicitly {@link google.cloud.edgecontainer.v1.ListMachinesResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.edgecontainer.v1.ListMachinesResponse + * @static + * @param {google.cloud.edgecontainer.v1.IListMachinesResponse} message ListMachinesResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListMachinesResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.machines != null && message.machines.length) + for (var i = 0; i < message.machines.length; ++i) + $root.google.cloud.edgecontainer.v1.Machine.encode(message.machines[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); + if (message.unreachable != null && message.unreachable.length) + for (var i = 0; i < message.unreachable.length; ++i) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.unreachable[i]); + return writer; + }; + + /** + * Encodes the specified ListMachinesResponse message, length delimited. Does not implicitly {@link google.cloud.edgecontainer.v1.ListMachinesResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.edgecontainer.v1.ListMachinesResponse + * @static + * @param {google.cloud.edgecontainer.v1.IListMachinesResponse} message ListMachinesResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListMachinesResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListMachinesResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.edgecontainer.v1.ListMachinesResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.edgecontainer.v1.ListMachinesResponse} ListMachinesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListMachinesResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.edgecontainer.v1.ListMachinesResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.machines && message.machines.length)) + message.machines = []; + message.machines.push($root.google.cloud.edgecontainer.v1.Machine.decode(reader, reader.uint32())); + break; + } + case 2: { + message.nextPageToken = reader.string(); + break; + } + case 3: { + if (!(message.unreachable && message.unreachable.length)) + message.unreachable = []; + message.unreachable.push(reader.string()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListMachinesResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.edgecontainer.v1.ListMachinesResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.edgecontainer.v1.ListMachinesResponse} ListMachinesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListMachinesResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListMachinesResponse message. + * @function verify + * @memberof google.cloud.edgecontainer.v1.ListMachinesResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListMachinesResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.machines != null && message.hasOwnProperty("machines")) { + if (!Array.isArray(message.machines)) + return "machines: array expected"; + for (var i = 0; i < message.machines.length; ++i) { + var error = $root.google.cloud.edgecontainer.v1.Machine.verify(message.machines[i]); + if (error) + return "machines." + error; + } + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + if (message.unreachable != null && message.hasOwnProperty("unreachable")) { + if (!Array.isArray(message.unreachable)) + return "unreachable: array expected"; + for (var i = 0; i < message.unreachable.length; ++i) + if (!$util.isString(message.unreachable[i])) + return "unreachable: string[] expected"; + } + return null; + }; + + /** + * Creates a ListMachinesResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.edgecontainer.v1.ListMachinesResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.edgecontainer.v1.ListMachinesResponse} ListMachinesResponse + */ + ListMachinesResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.edgecontainer.v1.ListMachinesResponse) + return object; + var message = new $root.google.cloud.edgecontainer.v1.ListMachinesResponse(); + if (object.machines) { + if (!Array.isArray(object.machines)) + throw TypeError(".google.cloud.edgecontainer.v1.ListMachinesResponse.machines: array expected"); + message.machines = []; + for (var i = 0; i < object.machines.length; ++i) { + if (typeof object.machines[i] !== "object") + throw TypeError(".google.cloud.edgecontainer.v1.ListMachinesResponse.machines: object expected"); + message.machines[i] = $root.google.cloud.edgecontainer.v1.Machine.fromObject(object.machines[i]); + } + } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + if (object.unreachable) { + if (!Array.isArray(object.unreachable)) + throw TypeError(".google.cloud.edgecontainer.v1.ListMachinesResponse.unreachable: array expected"); + message.unreachable = []; + for (var i = 0; i < object.unreachable.length; ++i) + message.unreachable[i] = String(object.unreachable[i]); + } + return message; + }; + + /** + * Creates a plain object from a ListMachinesResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.edgecontainer.v1.ListMachinesResponse + * @static + * @param {google.cloud.edgecontainer.v1.ListMachinesResponse} message ListMachinesResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListMachinesResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.machines = []; + object.unreachable = []; + } + if (options.defaults) + object.nextPageToken = ""; + if (message.machines && message.machines.length) { + object.machines = []; + for (var j = 0; j < message.machines.length; ++j) + object.machines[j] = $root.google.cloud.edgecontainer.v1.Machine.toObject(message.machines[j], options); + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + object.nextPageToken = message.nextPageToken; + if (message.unreachable && message.unreachable.length) { + object.unreachable = []; + for (var j = 0; j < message.unreachable.length; ++j) + object.unreachable[j] = message.unreachable[j]; + } + return object; + }; + + /** + * Converts this ListMachinesResponse to JSON. + * @function toJSON + * @memberof google.cloud.edgecontainer.v1.ListMachinesResponse + * @instance + * @returns {Object.} JSON object + */ + ListMachinesResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListMachinesResponse + * @function getTypeUrl + * @memberof google.cloud.edgecontainer.v1.ListMachinesResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListMachinesResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.edgecontainer.v1.ListMachinesResponse"; + }; + + return ListMachinesResponse; + })(); + + v1.GetMachineRequest = (function() { + + /** + * Properties of a GetMachineRequest. + * @memberof google.cloud.edgecontainer.v1 + * @interface IGetMachineRequest + * @property {string|null} [name] GetMachineRequest name + */ + + /** + * Constructs a new GetMachineRequest. + * @memberof google.cloud.edgecontainer.v1 + * @classdesc Represents a GetMachineRequest. + * @implements IGetMachineRequest + * @constructor + * @param {google.cloud.edgecontainer.v1.IGetMachineRequest=} [properties] Properties to set + */ + function GetMachineRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetMachineRequest name. + * @member {string} name + * @memberof google.cloud.edgecontainer.v1.GetMachineRequest + * @instance + */ + GetMachineRequest.prototype.name = ""; + + /** + * Creates a new GetMachineRequest instance using the specified properties. + * @function create + * @memberof google.cloud.edgecontainer.v1.GetMachineRequest + * @static + * @param {google.cloud.edgecontainer.v1.IGetMachineRequest=} [properties] Properties to set + * @returns {google.cloud.edgecontainer.v1.GetMachineRequest} GetMachineRequest instance + */ + GetMachineRequest.create = function create(properties) { + return new GetMachineRequest(properties); + }; + + /** + * Encodes the specified GetMachineRequest message. Does not implicitly {@link google.cloud.edgecontainer.v1.GetMachineRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.edgecontainer.v1.GetMachineRequest + * @static + * @param {google.cloud.edgecontainer.v1.IGetMachineRequest} message GetMachineRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetMachineRequest.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 GetMachineRequest message, length delimited. Does not implicitly {@link google.cloud.edgecontainer.v1.GetMachineRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.edgecontainer.v1.GetMachineRequest + * @static + * @param {google.cloud.edgecontainer.v1.IGetMachineRequest} message GetMachineRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetMachineRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetMachineRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.edgecontainer.v1.GetMachineRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.edgecontainer.v1.GetMachineRequest} GetMachineRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetMachineRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.edgecontainer.v1.GetMachineRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetMachineRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.edgecontainer.v1.GetMachineRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.edgecontainer.v1.GetMachineRequest} GetMachineRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetMachineRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetMachineRequest message. + * @function verify + * @memberof google.cloud.edgecontainer.v1.GetMachineRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetMachineRequest.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 GetMachineRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.edgecontainer.v1.GetMachineRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.edgecontainer.v1.GetMachineRequest} GetMachineRequest + */ + GetMachineRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.edgecontainer.v1.GetMachineRequest) + return object; + var message = new $root.google.cloud.edgecontainer.v1.GetMachineRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a GetMachineRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.edgecontainer.v1.GetMachineRequest + * @static + * @param {google.cloud.edgecontainer.v1.GetMachineRequest} message GetMachineRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetMachineRequest.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 GetMachineRequest to JSON. + * @function toJSON + * @memberof google.cloud.edgecontainer.v1.GetMachineRequest + * @instance + * @returns {Object.} JSON object + */ + GetMachineRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GetMachineRequest + * @function getTypeUrl + * @memberof google.cloud.edgecontainer.v1.GetMachineRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GetMachineRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.edgecontainer.v1.GetMachineRequest"; + }; + + return GetMachineRequest; + })(); + + v1.ListVpnConnectionsRequest = (function() { + + /** + * Properties of a ListVpnConnectionsRequest. + * @memberof google.cloud.edgecontainer.v1 + * @interface IListVpnConnectionsRequest + * @property {string|null} [parent] ListVpnConnectionsRequest parent + * @property {number|null} [pageSize] ListVpnConnectionsRequest pageSize + * @property {string|null} [pageToken] ListVpnConnectionsRequest pageToken + * @property {string|null} [filter] ListVpnConnectionsRequest filter + * @property {string|null} [orderBy] ListVpnConnectionsRequest orderBy + */ + + /** + * Constructs a new ListVpnConnectionsRequest. + * @memberof google.cloud.edgecontainer.v1 + * @classdesc Represents a ListVpnConnectionsRequest. + * @implements IListVpnConnectionsRequest + * @constructor + * @param {google.cloud.edgecontainer.v1.IListVpnConnectionsRequest=} [properties] Properties to set + */ + function ListVpnConnectionsRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListVpnConnectionsRequest parent. + * @member {string} parent + * @memberof google.cloud.edgecontainer.v1.ListVpnConnectionsRequest + * @instance + */ + ListVpnConnectionsRequest.prototype.parent = ""; + + /** + * ListVpnConnectionsRequest pageSize. + * @member {number} pageSize + * @memberof google.cloud.edgecontainer.v1.ListVpnConnectionsRequest + * @instance + */ + ListVpnConnectionsRequest.prototype.pageSize = 0; + + /** + * ListVpnConnectionsRequest pageToken. + * @member {string} pageToken + * @memberof google.cloud.edgecontainer.v1.ListVpnConnectionsRequest + * @instance + */ + ListVpnConnectionsRequest.prototype.pageToken = ""; + + /** + * ListVpnConnectionsRequest filter. + * @member {string} filter + * @memberof google.cloud.edgecontainer.v1.ListVpnConnectionsRequest + * @instance + */ + ListVpnConnectionsRequest.prototype.filter = ""; + + /** + * ListVpnConnectionsRequest orderBy. + * @member {string} orderBy + * @memberof google.cloud.edgecontainer.v1.ListVpnConnectionsRequest + * @instance + */ + ListVpnConnectionsRequest.prototype.orderBy = ""; + + /** + * Creates a new ListVpnConnectionsRequest instance using the specified properties. + * @function create + * @memberof google.cloud.edgecontainer.v1.ListVpnConnectionsRequest + * @static + * @param {google.cloud.edgecontainer.v1.IListVpnConnectionsRequest=} [properties] Properties to set + * @returns {google.cloud.edgecontainer.v1.ListVpnConnectionsRequest} ListVpnConnectionsRequest instance + */ + ListVpnConnectionsRequest.create = function create(properties) { + return new ListVpnConnectionsRequest(properties); + }; + + /** + * Encodes the specified ListVpnConnectionsRequest message. Does not implicitly {@link google.cloud.edgecontainer.v1.ListVpnConnectionsRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.edgecontainer.v1.ListVpnConnectionsRequest + * @static + * @param {google.cloud.edgecontainer.v1.IListVpnConnectionsRequest} message ListVpnConnectionsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListVpnConnectionsRequest.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.filter != null && Object.hasOwnProperty.call(message, "filter")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.filter); + if (message.orderBy != null && Object.hasOwnProperty.call(message, "orderBy")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.orderBy); + return writer; + }; + + /** + * Encodes the specified ListVpnConnectionsRequest message, length delimited. Does not implicitly {@link google.cloud.edgecontainer.v1.ListVpnConnectionsRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.edgecontainer.v1.ListVpnConnectionsRequest + * @static + * @param {google.cloud.edgecontainer.v1.IListVpnConnectionsRequest} message ListVpnConnectionsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListVpnConnectionsRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListVpnConnectionsRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.edgecontainer.v1.ListVpnConnectionsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.edgecontainer.v1.ListVpnConnectionsRequest} ListVpnConnectionsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListVpnConnectionsRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.edgecontainer.v1.ListVpnConnectionsRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + 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.filter = reader.string(); + break; + } + case 5: { + message.orderBy = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListVpnConnectionsRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.edgecontainer.v1.ListVpnConnectionsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.edgecontainer.v1.ListVpnConnectionsRequest} ListVpnConnectionsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListVpnConnectionsRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListVpnConnectionsRequest message. + * @function verify + * @memberof google.cloud.edgecontainer.v1.ListVpnConnectionsRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListVpnConnectionsRequest.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.filter != null && message.hasOwnProperty("filter")) + if (!$util.isString(message.filter)) + return "filter: string expected"; + if (message.orderBy != null && message.hasOwnProperty("orderBy")) + if (!$util.isString(message.orderBy)) + return "orderBy: string expected"; + return null; + }; + + /** + * Creates a ListVpnConnectionsRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.edgecontainer.v1.ListVpnConnectionsRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.edgecontainer.v1.ListVpnConnectionsRequest} ListVpnConnectionsRequest + */ + ListVpnConnectionsRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.edgecontainer.v1.ListVpnConnectionsRequest) + return object; + var message = new $root.google.cloud.edgecontainer.v1.ListVpnConnectionsRequest(); + 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.filter != null) + message.filter = String(object.filter); + if (object.orderBy != null) + message.orderBy = String(object.orderBy); + return message; + }; + + /** + * Creates a plain object from a ListVpnConnectionsRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.edgecontainer.v1.ListVpnConnectionsRequest + * @static + * @param {google.cloud.edgecontainer.v1.ListVpnConnectionsRequest} message ListVpnConnectionsRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListVpnConnectionsRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.pageSize = 0; + object.pageToken = ""; + object.filter = ""; + object.orderBy = ""; + } + 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.filter != null && message.hasOwnProperty("filter")) + object.filter = message.filter; + if (message.orderBy != null && message.hasOwnProperty("orderBy")) + object.orderBy = message.orderBy; + return object; + }; + + /** + * Converts this ListVpnConnectionsRequest to JSON. + * @function toJSON + * @memberof google.cloud.edgecontainer.v1.ListVpnConnectionsRequest + * @instance + * @returns {Object.} JSON object + */ + ListVpnConnectionsRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListVpnConnectionsRequest + * @function getTypeUrl + * @memberof google.cloud.edgecontainer.v1.ListVpnConnectionsRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListVpnConnectionsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.edgecontainer.v1.ListVpnConnectionsRequest"; + }; + + return ListVpnConnectionsRequest; + })(); + + v1.ListVpnConnectionsResponse = (function() { + + /** + * Properties of a ListVpnConnectionsResponse. + * @memberof google.cloud.edgecontainer.v1 + * @interface IListVpnConnectionsResponse + * @property {Array.|null} [vpnConnections] ListVpnConnectionsResponse vpnConnections + * @property {string|null} [nextPageToken] ListVpnConnectionsResponse nextPageToken + * @property {Array.|null} [unreachable] ListVpnConnectionsResponse unreachable + */ + + /** + * Constructs a new ListVpnConnectionsResponse. + * @memberof google.cloud.edgecontainer.v1 + * @classdesc Represents a ListVpnConnectionsResponse. + * @implements IListVpnConnectionsResponse + * @constructor + * @param {google.cloud.edgecontainer.v1.IListVpnConnectionsResponse=} [properties] Properties to set + */ + function ListVpnConnectionsResponse(properties) { + this.vpnConnections = []; + this.unreachable = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListVpnConnectionsResponse vpnConnections. + * @member {Array.} vpnConnections + * @memberof google.cloud.edgecontainer.v1.ListVpnConnectionsResponse + * @instance + */ + ListVpnConnectionsResponse.prototype.vpnConnections = $util.emptyArray; + + /** + * ListVpnConnectionsResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.cloud.edgecontainer.v1.ListVpnConnectionsResponse + * @instance + */ + ListVpnConnectionsResponse.prototype.nextPageToken = ""; + + /** + * ListVpnConnectionsResponse unreachable. + * @member {Array.} unreachable + * @memberof google.cloud.edgecontainer.v1.ListVpnConnectionsResponse + * @instance + */ + ListVpnConnectionsResponse.prototype.unreachable = $util.emptyArray; + + /** + * Creates a new ListVpnConnectionsResponse instance using the specified properties. + * @function create + * @memberof google.cloud.edgecontainer.v1.ListVpnConnectionsResponse + * @static + * @param {google.cloud.edgecontainer.v1.IListVpnConnectionsResponse=} [properties] Properties to set + * @returns {google.cloud.edgecontainer.v1.ListVpnConnectionsResponse} ListVpnConnectionsResponse instance + */ + ListVpnConnectionsResponse.create = function create(properties) { + return new ListVpnConnectionsResponse(properties); + }; + + /** + * Encodes the specified ListVpnConnectionsResponse message. Does not implicitly {@link google.cloud.edgecontainer.v1.ListVpnConnectionsResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.edgecontainer.v1.ListVpnConnectionsResponse + * @static + * @param {google.cloud.edgecontainer.v1.IListVpnConnectionsResponse} message ListVpnConnectionsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListVpnConnectionsResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.vpnConnections != null && message.vpnConnections.length) + for (var i = 0; i < message.vpnConnections.length; ++i) + $root.google.cloud.edgecontainer.v1.VpnConnection.encode(message.vpnConnections[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); + if (message.unreachable != null && message.unreachable.length) + for (var i = 0; i < message.unreachable.length; ++i) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.unreachable[i]); + return writer; + }; + + /** + * Encodes the specified ListVpnConnectionsResponse message, length delimited. Does not implicitly {@link google.cloud.edgecontainer.v1.ListVpnConnectionsResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.edgecontainer.v1.ListVpnConnectionsResponse + * @static + * @param {google.cloud.edgecontainer.v1.IListVpnConnectionsResponse} message ListVpnConnectionsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListVpnConnectionsResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListVpnConnectionsResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.edgecontainer.v1.ListVpnConnectionsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.edgecontainer.v1.ListVpnConnectionsResponse} ListVpnConnectionsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListVpnConnectionsResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.edgecontainer.v1.ListVpnConnectionsResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.vpnConnections && message.vpnConnections.length)) + message.vpnConnections = []; + message.vpnConnections.push($root.google.cloud.edgecontainer.v1.VpnConnection.decode(reader, reader.uint32())); + break; + } + case 2: { + message.nextPageToken = reader.string(); + break; + } + case 3: { + if (!(message.unreachable && message.unreachable.length)) + message.unreachable = []; + message.unreachable.push(reader.string()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListVpnConnectionsResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.edgecontainer.v1.ListVpnConnectionsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.edgecontainer.v1.ListVpnConnectionsResponse} ListVpnConnectionsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListVpnConnectionsResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListVpnConnectionsResponse message. + * @function verify + * @memberof google.cloud.edgecontainer.v1.ListVpnConnectionsResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListVpnConnectionsResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.vpnConnections != null && message.hasOwnProperty("vpnConnections")) { + if (!Array.isArray(message.vpnConnections)) + return "vpnConnections: array expected"; + for (var i = 0; i < message.vpnConnections.length; ++i) { + var error = $root.google.cloud.edgecontainer.v1.VpnConnection.verify(message.vpnConnections[i]); + if (error) + return "vpnConnections." + error; + } + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + if (message.unreachable != null && message.hasOwnProperty("unreachable")) { + if (!Array.isArray(message.unreachable)) + return "unreachable: array expected"; + for (var i = 0; i < message.unreachable.length; ++i) + if (!$util.isString(message.unreachable[i])) + return "unreachable: string[] expected"; + } + return null; + }; + + /** + * Creates a ListVpnConnectionsResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.edgecontainer.v1.ListVpnConnectionsResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.edgecontainer.v1.ListVpnConnectionsResponse} ListVpnConnectionsResponse + */ + ListVpnConnectionsResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.edgecontainer.v1.ListVpnConnectionsResponse) + return object; + var message = new $root.google.cloud.edgecontainer.v1.ListVpnConnectionsResponse(); + if (object.vpnConnections) { + if (!Array.isArray(object.vpnConnections)) + throw TypeError(".google.cloud.edgecontainer.v1.ListVpnConnectionsResponse.vpnConnections: array expected"); + message.vpnConnections = []; + for (var i = 0; i < object.vpnConnections.length; ++i) { + if (typeof object.vpnConnections[i] !== "object") + throw TypeError(".google.cloud.edgecontainer.v1.ListVpnConnectionsResponse.vpnConnections: object expected"); + message.vpnConnections[i] = $root.google.cloud.edgecontainer.v1.VpnConnection.fromObject(object.vpnConnections[i]); + } + } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + if (object.unreachable) { + if (!Array.isArray(object.unreachable)) + throw TypeError(".google.cloud.edgecontainer.v1.ListVpnConnectionsResponse.unreachable: array expected"); + message.unreachable = []; + for (var i = 0; i < object.unreachable.length; ++i) + message.unreachable[i] = String(object.unreachable[i]); + } + return message; + }; + + /** + * Creates a plain object from a ListVpnConnectionsResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.edgecontainer.v1.ListVpnConnectionsResponse + * @static + * @param {google.cloud.edgecontainer.v1.ListVpnConnectionsResponse} message ListVpnConnectionsResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListVpnConnectionsResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.vpnConnections = []; + object.unreachable = []; + } + if (options.defaults) + object.nextPageToken = ""; + if (message.vpnConnections && message.vpnConnections.length) { + object.vpnConnections = []; + for (var j = 0; j < message.vpnConnections.length; ++j) + object.vpnConnections[j] = $root.google.cloud.edgecontainer.v1.VpnConnection.toObject(message.vpnConnections[j], options); + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + object.nextPageToken = message.nextPageToken; + if (message.unreachable && message.unreachable.length) { + object.unreachable = []; + for (var j = 0; j < message.unreachable.length; ++j) + object.unreachable[j] = message.unreachable[j]; + } + return object; + }; + + /** + * Converts this ListVpnConnectionsResponse to JSON. + * @function toJSON + * @memberof google.cloud.edgecontainer.v1.ListVpnConnectionsResponse + * @instance + * @returns {Object.} JSON object + */ + ListVpnConnectionsResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListVpnConnectionsResponse + * @function getTypeUrl + * @memberof google.cloud.edgecontainer.v1.ListVpnConnectionsResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListVpnConnectionsResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.edgecontainer.v1.ListVpnConnectionsResponse"; + }; + + return ListVpnConnectionsResponse; + })(); + + v1.GetVpnConnectionRequest = (function() { + + /** + * Properties of a GetVpnConnectionRequest. + * @memberof google.cloud.edgecontainer.v1 + * @interface IGetVpnConnectionRequest + * @property {string|null} [name] GetVpnConnectionRequest name + */ + + /** + * Constructs a new GetVpnConnectionRequest. + * @memberof google.cloud.edgecontainer.v1 + * @classdesc Represents a GetVpnConnectionRequest. + * @implements IGetVpnConnectionRequest + * @constructor + * @param {google.cloud.edgecontainer.v1.IGetVpnConnectionRequest=} [properties] Properties to set + */ + function GetVpnConnectionRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetVpnConnectionRequest name. + * @member {string} name + * @memberof google.cloud.edgecontainer.v1.GetVpnConnectionRequest + * @instance + */ + GetVpnConnectionRequest.prototype.name = ""; + + /** + * Creates a new GetVpnConnectionRequest instance using the specified properties. + * @function create + * @memberof google.cloud.edgecontainer.v1.GetVpnConnectionRequest + * @static + * @param {google.cloud.edgecontainer.v1.IGetVpnConnectionRequest=} [properties] Properties to set + * @returns {google.cloud.edgecontainer.v1.GetVpnConnectionRequest} GetVpnConnectionRequest instance + */ + GetVpnConnectionRequest.create = function create(properties) { + return new GetVpnConnectionRequest(properties); + }; + + /** + * Encodes the specified GetVpnConnectionRequest message. Does not implicitly {@link google.cloud.edgecontainer.v1.GetVpnConnectionRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.edgecontainer.v1.GetVpnConnectionRequest + * @static + * @param {google.cloud.edgecontainer.v1.IGetVpnConnectionRequest} message GetVpnConnectionRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetVpnConnectionRequest.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 GetVpnConnectionRequest message, length delimited. Does not implicitly {@link google.cloud.edgecontainer.v1.GetVpnConnectionRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.edgecontainer.v1.GetVpnConnectionRequest + * @static + * @param {google.cloud.edgecontainer.v1.IGetVpnConnectionRequest} message GetVpnConnectionRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetVpnConnectionRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetVpnConnectionRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.edgecontainer.v1.GetVpnConnectionRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.edgecontainer.v1.GetVpnConnectionRequest} GetVpnConnectionRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetVpnConnectionRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.edgecontainer.v1.GetVpnConnectionRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetVpnConnectionRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.edgecontainer.v1.GetVpnConnectionRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.edgecontainer.v1.GetVpnConnectionRequest} GetVpnConnectionRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetVpnConnectionRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetVpnConnectionRequest message. + * @function verify + * @memberof google.cloud.edgecontainer.v1.GetVpnConnectionRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetVpnConnectionRequest.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 GetVpnConnectionRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.edgecontainer.v1.GetVpnConnectionRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.edgecontainer.v1.GetVpnConnectionRequest} GetVpnConnectionRequest + */ + GetVpnConnectionRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.edgecontainer.v1.GetVpnConnectionRequest) + return object; + var message = new $root.google.cloud.edgecontainer.v1.GetVpnConnectionRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a GetVpnConnectionRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.edgecontainer.v1.GetVpnConnectionRequest + * @static + * @param {google.cloud.edgecontainer.v1.GetVpnConnectionRequest} message GetVpnConnectionRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetVpnConnectionRequest.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 GetVpnConnectionRequest to JSON. + * @function toJSON + * @memberof google.cloud.edgecontainer.v1.GetVpnConnectionRequest + * @instance + * @returns {Object.} JSON object + */ + GetVpnConnectionRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GetVpnConnectionRequest + * @function getTypeUrl + * @memberof google.cloud.edgecontainer.v1.GetVpnConnectionRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GetVpnConnectionRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.edgecontainer.v1.GetVpnConnectionRequest"; + }; + + return GetVpnConnectionRequest; + })(); + + v1.CreateVpnConnectionRequest = (function() { + + /** + * Properties of a CreateVpnConnectionRequest. + * @memberof google.cloud.edgecontainer.v1 + * @interface ICreateVpnConnectionRequest + * @property {string|null} [parent] CreateVpnConnectionRequest parent + * @property {string|null} [vpnConnectionId] CreateVpnConnectionRequest vpnConnectionId + * @property {google.cloud.edgecontainer.v1.IVpnConnection|null} [vpnConnection] CreateVpnConnectionRequest vpnConnection + * @property {string|null} [requestId] CreateVpnConnectionRequest requestId + */ + + /** + * Constructs a new CreateVpnConnectionRequest. + * @memberof google.cloud.edgecontainer.v1 + * @classdesc Represents a CreateVpnConnectionRequest. + * @implements ICreateVpnConnectionRequest + * @constructor + * @param {google.cloud.edgecontainer.v1.ICreateVpnConnectionRequest=} [properties] Properties to set + */ + function CreateVpnConnectionRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * CreateVpnConnectionRequest parent. + * @member {string} parent + * @memberof google.cloud.edgecontainer.v1.CreateVpnConnectionRequest + * @instance + */ + CreateVpnConnectionRequest.prototype.parent = ""; + + /** + * CreateVpnConnectionRequest vpnConnectionId. + * @member {string} vpnConnectionId + * @memberof google.cloud.edgecontainer.v1.CreateVpnConnectionRequest + * @instance + */ + CreateVpnConnectionRequest.prototype.vpnConnectionId = ""; + + /** + * CreateVpnConnectionRequest vpnConnection. + * @member {google.cloud.edgecontainer.v1.IVpnConnection|null|undefined} vpnConnection + * @memberof google.cloud.edgecontainer.v1.CreateVpnConnectionRequest + * @instance + */ + CreateVpnConnectionRequest.prototype.vpnConnection = null; + + /** + * CreateVpnConnectionRequest requestId. + * @member {string} requestId + * @memberof google.cloud.edgecontainer.v1.CreateVpnConnectionRequest + * @instance + */ + CreateVpnConnectionRequest.prototype.requestId = ""; + + /** + * Creates a new CreateVpnConnectionRequest instance using the specified properties. + * @function create + * @memberof google.cloud.edgecontainer.v1.CreateVpnConnectionRequest + * @static + * @param {google.cloud.edgecontainer.v1.ICreateVpnConnectionRequest=} [properties] Properties to set + * @returns {google.cloud.edgecontainer.v1.CreateVpnConnectionRequest} CreateVpnConnectionRequest instance + */ + CreateVpnConnectionRequest.create = function create(properties) { + return new CreateVpnConnectionRequest(properties); + }; + + /** + * Encodes the specified CreateVpnConnectionRequest message. Does not implicitly {@link google.cloud.edgecontainer.v1.CreateVpnConnectionRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.edgecontainer.v1.CreateVpnConnectionRequest + * @static + * @param {google.cloud.edgecontainer.v1.ICreateVpnConnectionRequest} message CreateVpnConnectionRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateVpnConnectionRequest.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.vpnConnectionId != null && Object.hasOwnProperty.call(message, "vpnConnectionId")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.vpnConnectionId); + if (message.vpnConnection != null && Object.hasOwnProperty.call(message, "vpnConnection")) + $root.google.cloud.edgecontainer.v1.VpnConnection.encode(message.vpnConnection, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.requestId); + return writer; + }; + + /** + * Encodes the specified CreateVpnConnectionRequest message, length delimited. Does not implicitly {@link google.cloud.edgecontainer.v1.CreateVpnConnectionRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.edgecontainer.v1.CreateVpnConnectionRequest + * @static + * @param {google.cloud.edgecontainer.v1.ICreateVpnConnectionRequest} message CreateVpnConnectionRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateVpnConnectionRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CreateVpnConnectionRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.edgecontainer.v1.CreateVpnConnectionRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.edgecontainer.v1.CreateVpnConnectionRequest} CreateVpnConnectionRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateVpnConnectionRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.edgecontainer.v1.CreateVpnConnectionRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.vpnConnectionId = reader.string(); + break; + } + case 3: { + message.vpnConnection = $root.google.cloud.edgecontainer.v1.VpnConnection.decode(reader, reader.uint32()); + break; + } + case 4: { + message.requestId = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CreateVpnConnectionRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.edgecontainer.v1.CreateVpnConnectionRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.edgecontainer.v1.CreateVpnConnectionRequest} CreateVpnConnectionRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateVpnConnectionRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CreateVpnConnectionRequest message. + * @function verify + * @memberof google.cloud.edgecontainer.v1.CreateVpnConnectionRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CreateVpnConnectionRequest.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.vpnConnectionId != null && message.hasOwnProperty("vpnConnectionId")) + if (!$util.isString(message.vpnConnectionId)) + return "vpnConnectionId: string expected"; + if (message.vpnConnection != null && message.hasOwnProperty("vpnConnection")) { + var error = $root.google.cloud.edgecontainer.v1.VpnConnection.verify(message.vpnConnection); + if (error) + return "vpnConnection." + error; + } + if (message.requestId != null && message.hasOwnProperty("requestId")) + if (!$util.isString(message.requestId)) + return "requestId: string expected"; + return null; + }; + + /** + * Creates a CreateVpnConnectionRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.edgecontainer.v1.CreateVpnConnectionRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.edgecontainer.v1.CreateVpnConnectionRequest} CreateVpnConnectionRequest + */ + CreateVpnConnectionRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.edgecontainer.v1.CreateVpnConnectionRequest) + return object; + var message = new $root.google.cloud.edgecontainer.v1.CreateVpnConnectionRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.vpnConnectionId != null) + message.vpnConnectionId = String(object.vpnConnectionId); + if (object.vpnConnection != null) { + if (typeof object.vpnConnection !== "object") + throw TypeError(".google.cloud.edgecontainer.v1.CreateVpnConnectionRequest.vpnConnection: object expected"); + message.vpnConnection = $root.google.cloud.edgecontainer.v1.VpnConnection.fromObject(object.vpnConnection); + } + if (object.requestId != null) + message.requestId = String(object.requestId); + return message; + }; + + /** + * Creates a plain object from a CreateVpnConnectionRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.edgecontainer.v1.CreateVpnConnectionRequest + * @static + * @param {google.cloud.edgecontainer.v1.CreateVpnConnectionRequest} message CreateVpnConnectionRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CreateVpnConnectionRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.vpnConnectionId = ""; + object.vpnConnection = null; + object.requestId = ""; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.vpnConnectionId != null && message.hasOwnProperty("vpnConnectionId")) + object.vpnConnectionId = message.vpnConnectionId; + if (message.vpnConnection != null && message.hasOwnProperty("vpnConnection")) + object.vpnConnection = $root.google.cloud.edgecontainer.v1.VpnConnection.toObject(message.vpnConnection, options); + if (message.requestId != null && message.hasOwnProperty("requestId")) + object.requestId = message.requestId; + return object; + }; + + /** + * Converts this CreateVpnConnectionRequest to JSON. + * @function toJSON + * @memberof google.cloud.edgecontainer.v1.CreateVpnConnectionRequest + * @instance + * @returns {Object.} JSON object + */ + CreateVpnConnectionRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CreateVpnConnectionRequest + * @function getTypeUrl + * @memberof google.cloud.edgecontainer.v1.CreateVpnConnectionRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CreateVpnConnectionRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.edgecontainer.v1.CreateVpnConnectionRequest"; + }; + + return CreateVpnConnectionRequest; + })(); + + v1.DeleteVpnConnectionRequest = (function() { + + /** + * Properties of a DeleteVpnConnectionRequest. + * @memberof google.cloud.edgecontainer.v1 + * @interface IDeleteVpnConnectionRequest + * @property {string|null} [name] DeleteVpnConnectionRequest name + * @property {string|null} [requestId] DeleteVpnConnectionRequest requestId + */ + + /** + * Constructs a new DeleteVpnConnectionRequest. + * @memberof google.cloud.edgecontainer.v1 + * @classdesc Represents a DeleteVpnConnectionRequest. + * @implements IDeleteVpnConnectionRequest + * @constructor + * @param {google.cloud.edgecontainer.v1.IDeleteVpnConnectionRequest=} [properties] Properties to set + */ + function DeleteVpnConnectionRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * DeleteVpnConnectionRequest name. + * @member {string} name + * @memberof google.cloud.edgecontainer.v1.DeleteVpnConnectionRequest + * @instance + */ + DeleteVpnConnectionRequest.prototype.name = ""; + + /** + * DeleteVpnConnectionRequest requestId. + * @member {string} requestId + * @memberof google.cloud.edgecontainer.v1.DeleteVpnConnectionRequest + * @instance + */ + DeleteVpnConnectionRequest.prototype.requestId = ""; + + /** + * Creates a new DeleteVpnConnectionRequest instance using the specified properties. + * @function create + * @memberof google.cloud.edgecontainer.v1.DeleteVpnConnectionRequest + * @static + * @param {google.cloud.edgecontainer.v1.IDeleteVpnConnectionRequest=} [properties] Properties to set + * @returns {google.cloud.edgecontainer.v1.DeleteVpnConnectionRequest} DeleteVpnConnectionRequest instance + */ + DeleteVpnConnectionRequest.create = function create(properties) { + return new DeleteVpnConnectionRequest(properties); + }; + + /** + * Encodes the specified DeleteVpnConnectionRequest message. Does not implicitly {@link google.cloud.edgecontainer.v1.DeleteVpnConnectionRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.edgecontainer.v1.DeleteVpnConnectionRequest + * @static + * @param {google.cloud.edgecontainer.v1.IDeleteVpnConnectionRequest} message DeleteVpnConnectionRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteVpnConnectionRequest.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.requestId != null && Object.hasOwnProperty.call(message, "requestId")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.requestId); + return writer; + }; + + /** + * Encodes the specified DeleteVpnConnectionRequest message, length delimited. Does not implicitly {@link google.cloud.edgecontainer.v1.DeleteVpnConnectionRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.edgecontainer.v1.DeleteVpnConnectionRequest + * @static + * @param {google.cloud.edgecontainer.v1.IDeleteVpnConnectionRequest} message DeleteVpnConnectionRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteVpnConnectionRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DeleteVpnConnectionRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.edgecontainer.v1.DeleteVpnConnectionRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.edgecontainer.v1.DeleteVpnConnectionRequest} DeleteVpnConnectionRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteVpnConnectionRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.edgecontainer.v1.DeleteVpnConnectionRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.requestId = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DeleteVpnConnectionRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.edgecontainer.v1.DeleteVpnConnectionRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.edgecontainer.v1.DeleteVpnConnectionRequest} DeleteVpnConnectionRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteVpnConnectionRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DeleteVpnConnectionRequest message. + * @function verify + * @memberof google.cloud.edgecontainer.v1.DeleteVpnConnectionRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DeleteVpnConnectionRequest.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.requestId != null && message.hasOwnProperty("requestId")) + if (!$util.isString(message.requestId)) + return "requestId: string expected"; + return null; + }; + + /** + * Creates a DeleteVpnConnectionRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.edgecontainer.v1.DeleteVpnConnectionRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.edgecontainer.v1.DeleteVpnConnectionRequest} DeleteVpnConnectionRequest + */ + DeleteVpnConnectionRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.edgecontainer.v1.DeleteVpnConnectionRequest) + return object; + var message = new $root.google.cloud.edgecontainer.v1.DeleteVpnConnectionRequest(); + if (object.name != null) + message.name = String(object.name); + if (object.requestId != null) + message.requestId = String(object.requestId); + return message; + }; + + /** + * Creates a plain object from a DeleteVpnConnectionRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.edgecontainer.v1.DeleteVpnConnectionRequest + * @static + * @param {google.cloud.edgecontainer.v1.DeleteVpnConnectionRequest} message DeleteVpnConnectionRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DeleteVpnConnectionRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.requestId = ""; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.requestId != null && message.hasOwnProperty("requestId")) + object.requestId = message.requestId; + return object; + }; + + /** + * Converts this DeleteVpnConnectionRequest to JSON. + * @function toJSON + * @memberof google.cloud.edgecontainer.v1.DeleteVpnConnectionRequest + * @instance + * @returns {Object.} JSON object + */ + DeleteVpnConnectionRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DeleteVpnConnectionRequest + * @function getTypeUrl + * @memberof google.cloud.edgecontainer.v1.DeleteVpnConnectionRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DeleteVpnConnectionRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.edgecontainer.v1.DeleteVpnConnectionRequest"; + }; + + return DeleteVpnConnectionRequest; + })(); + + return v1; + })(); + + return edgecontainer; + })(); + + return cloud; + })(); + + google.api = (function() { + + /** + * Namespace api. + * @memberof google + * @namespace + */ + var api = {}; + + /** + * 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 + */ + 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; + 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) { + 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(); + 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) { + 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(); + 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; + })(); + + 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) { + 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(); + 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) { + 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(); + 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) { + 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(); + 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) { + 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(); + 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) { + 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(); + 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 + */ + + /** + * 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; + + /** + * 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(); + 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) { + 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(); + 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; + } + 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: + 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; + } + } + 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; + } + 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]); + } + } + 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; + } + 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); + } + 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) { + 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(); + 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) { + 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(); + 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) { + 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(); + 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) { + 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(); + 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) { + 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(); + 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 + */ + + /** + * 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) { + if (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; + + /** + * 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(); + 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) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.DotnetSettings(); + while (reader.pos < end) { + var tag = reader.uint32(); + 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 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; + } + 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); + } + 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.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 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) { + 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(); + 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) { + 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(); + 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 + */ + + /** + * 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) { + if (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; + + /** + * 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(); + 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) { + 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(); + switch (tag >>> 3) { + case 1: { + message.selector = reader.string(); + break; + } + case 2: { + message.longRunning = $root.google.api.MethodSettings.LongRunning.decode(reader, reader.uint32()); + 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; + } + 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); + } + 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.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); + 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) { + 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(); + 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 + */ + 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; + 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; + })(); + + 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) { + 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(); + 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; + })(); + + 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 {string|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 {string} edition + * @memberof google.protobuf.FileDescriptorProto + * @instance + */ + FileDescriptorProto.prototype.edition = ""; + + /** + * 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 13, wireType 2 =*/106).string(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) { + 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(); + 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 13: { + message.edition = reader.string(); + 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")) + if (!$util.isString(message.edition)) + return "edition: string expected"; + 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); + if (object.edition != null) + message.edition = String(object.edition); + 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 = ""; + } + 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 = 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) { + 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(); + 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) { + 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(); + 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) { + 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(); + 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 + */ + + /** + * 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 = []; + if (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; + + /** + * 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.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) { + 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(); + 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; + } + 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; + } + } + 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]); + } + } + 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.uninterpretedOption = []; + 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"; + }; + + 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) { + 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(); + 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 2: + case 3: + 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_REQUIRED": + case 2: + message.label = 2; + break; + case "LABEL_REPEATED": + case 3: + message.label = 3; + 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_REQUIRED=2 LABEL_REQUIRED value + * @property {number} LABEL_REPEATED=3 LABEL_REPEATED value + */ + FieldDescriptorProto.Label = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[1] = "LABEL_OPTIONAL"] = 1; + values[valuesById[2] = "LABEL_REQUIRED"] = 2; + values[valuesById[3] = "LABEL_REPEATED"] = 3; + 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) { + 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(); + 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) { + 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(); + 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) { + 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(); + 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) { + 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(); + 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) { + 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(); + 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) { + 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(); + 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} [phpGenericServices] FileOptions phpGenericServices + * @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 {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 phpGenericServices. + * @member {boolean} phpGenericServices + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.phpGenericServices = 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 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.phpGenericServices != null && Object.hasOwnProperty.call(message, "phpGenericServices")) + writer.uint32(/* id 42, wireType 0 =*/336).bool(message.phpGenericServices); + 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.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) { + 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(); + 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 42: { + message.phpGenericServices = 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 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.phpGenericServices != null && message.hasOwnProperty("phpGenericServices")) + if (typeof message.phpGenericServices !== "boolean") + return "phpGenericServices: 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.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.phpGenericServices != null) + message.phpGenericServices = Boolean(object.phpGenericServices); + 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.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.phpGenericServices = false; + object.phpMetadataNamespace = ""; + object.rubyPackage = ""; + } + 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.phpGenericServices != null && message.hasOwnProperty("phpGenericServices")) + object.phpGenericServices = message.phpGenericServices; + if (message.phpMetadataNamespace != null && message.hasOwnProperty("phpMetadataNamespace")) + object.phpMetadataNamespace = message.phpMetadataNamespace; + if (message.rubyPackage != null && message.hasOwnProperty("rubyPackage")) + object.rubyPackage = message.rubyPackage; + 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 {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 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.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) { + 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(); + 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 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.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.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[".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.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 {google.protobuf.FieldOptions.OptionTargetType|null} [target] FieldOptions target + * @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.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 target. + * @member {google.protobuf.FieldOptions.OptionTargetType} target + * @memberof google.protobuf.FieldOptions + * @instance + */ + FieldOptions.prototype.target = 0; + + /** + * 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.target != null && Object.hasOwnProperty.call(message, "target")) + writer.uint32(/* id 18, wireType 0 =*/144).int32(message.target); + 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) { + writer.uint32(/* id 1052, wireType 2 =*/8418).fork(); + for (var i = 0; i < message[".google.api.fieldBehavior"].length; ++i) + writer.int32(message[".google.api.fieldBehavior"][i]); + writer.ldelim(); + } + 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) { + 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(); + 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 18: { + message.target = reader.int32(); + 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.target != null && message.hasOwnProperty("target")) + switch (message.target) { + default: + return "target: 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.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: + 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; + } + switch (object.target) { + default: + if (typeof object.target === "number") { + message.target = object.target; + break; + } + break; + case "TARGET_TYPE_UNKNOWN": + case 0: + message.target = 0; + break; + case "TARGET_TYPE_FILE": + case 1: + message.target = 1; + break; + case "TARGET_TYPE_EXTENSION_RANGE": + case 2: + message.target = 2; + break; + case "TARGET_TYPE_MESSAGE": + case 3: + message.target = 3; + break; + case "TARGET_TYPE_FIELD": + case 4: + message.target = 4; + break; + case "TARGET_TYPE_ONEOF": + case 5: + message.target = 5; + break; + case "TARGET_TYPE_ENUM": + case 6: + message.target = 6; + break; + case "TARGET_TYPE_ENUM_ENTRY": + case 7: + message.target = 7; + break; + case "TARGET_TYPE_SERVICE": + case 8: + message.target = 8; + break; + case "TARGET_TYPE_METHOD": + case 9: + message.target = 9; + break; + } + 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; + } + } + 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.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.target = options.enums === String ? "TARGET_TYPE_UNKNOWN" : 0; + 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.target != null && message.hasOwnProperty("target")) + object.target = options.enums === String ? $root.google.protobuf.FieldOptions.OptionTargetType[message.target] === undefined ? message.target : $root.google.protobuf.FieldOptions.OptionTargetType[message.target] : message.target; + 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; + })(); + + return FieldOptions; + })(); + + protobuf.OneofOptions = (function() { + + /** + * Properties of an OneofOptions. + * @memberof google.protobuf + * @interface IOneofOptions + * @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 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.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) { + 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(); + 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; + } + 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.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.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 (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 {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 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.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) { + 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(); + 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 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.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.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; + } + 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.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 {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 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.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) { + 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(); + switch (tag >>> 3) { + case 1: { + 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; + } + 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.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.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; + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + object.deprecated = message.deprecated; + 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 {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 + */ + + /** + * 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 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"] = ""; + + /** + * 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.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"]); + 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) { + 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(); + switch (tag >>> 3) { + 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; + } + 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.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"; + 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.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"]); + 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[".google.api.defaultHost"] = ""; + object[".google.api.oauthScopes"] = ""; + } + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + object.deprecated = message.deprecated; + 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"]; + 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 {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 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.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) { + 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(); + switch (tag >>> 3) { + case 33: { + message.deprecated = reader.bool(); + break; + } + case 34: { + message.idempotencyLevel = reader.int32(); + 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.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.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[".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.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) { + 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(); + 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) { + 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(); + 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.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) { + 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(); + 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) { + 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(); + 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) { + 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(); + 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) { + 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(); + 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.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) { + 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(); + 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) { + 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(); + 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.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) { + 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(); + 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.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) { + 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(); + 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) { + 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(); + 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.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) { + 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(); + 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; + })(); + + 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) { + 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(); + 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) { + 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(); + 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) { + 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(); + 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) { + 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(); + 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) { + 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(); + 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) { + 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(); + 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) { + 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(); + 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) { + 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(); + 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; + })(); + + return google; + })(); + + return $root; +}); diff --git a/packages/google-cloud-edgecontainer/protos/protos.json b/packages/google-cloud-edgecontainer/protos/protos.json new file mode 100644 index 00000000000..aa9cad10d29 --- /dev/null +++ b/packages/google-cloud-edgecontainer/protos/protos.json @@ -0,0 +1,3122 @@ +{ + "nested": { + "google": { + "nested": { + "cloud": { + "nested": { + "edgecontainer": { + "nested": { + "v1": { + "options": { + "go_package": "cloud.google.com/go/edgecontainer/apiv1/edgecontainerpb;edgecontainerpb", + "java_multiple_files": true, + "java_outer_classname": "ServiceProto", + "java_package": "com.google.cloud.edgecontainer.v1", + "(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": { + "KmsKeyState": { + "values": { + "KMS_KEY_STATE_UNSPECIFIED": 0, + "KMS_KEY_STATE_KEY_AVAILABLE": 1, + "KMS_KEY_STATE_KEY_UNAVAILABLE": 2 + } + }, + "Cluster": { + "options": { + "(google.api.resource).type": "edgecontainer.googleapis.com/Cluster", + "(google.api.resource).pattern": "projects/{project}/locations/{location}/clusters/{cluster}" + }, + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "edgecontainer.googleapis.com/Cluster" + } + }, + "createTime": { + "type": "google.protobuf.Timestamp", + "id": 2, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "updateTime": { + "type": "google.protobuf.Timestamp", + "id": 3, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "labels": { + "keyType": "string", + "type": "string", + "id": 4 + }, + "fleet": { + "type": "Fleet", + "id": 11, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "networking": { + "type": "ClusterNetworking", + "id": 7, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "authorization": { + "type": "Authorization", + "id": 9, + "options": { + "(google.api.field_behavior)": "IMMUTABLE" + } + }, + "defaultMaxPodsPerNode": { + "type": "int32", + "id": 8, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "endpoint": { + "type": "string", + "id": 6, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "clusterCaCertificate": { + "type": "string", + "id": 10, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "maintenancePolicy": { + "type": "MaintenancePolicy", + "id": 12, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "ClusterNetworking": { + "fields": { + "clusterIpv4CidrBlocks": { + "rule": "repeated", + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "servicesIpv4CidrBlocks": { + "rule": "repeated", + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "Fleet": { + "fields": { + "project": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "membership": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + } + } + }, + "ClusterUser": { + "fields": { + "username": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "Authorization": { + "fields": { + "adminUsers": { + "type": "ClusterUser", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "NodePool": { + "options": { + "(google.api.resource).type": "edgecontainer.googleapis.com/NodePool", + "(google.api.resource).pattern": "projects/{project}/locations/{location}/clusters/{cluster}/nodePools/{node_pool}" + }, + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "edgecontainer.googleapis.com/NodePool" + } + }, + "createTime": { + "type": "google.protobuf.Timestamp", + "id": 2, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "updateTime": { + "type": "google.protobuf.Timestamp", + "id": 3, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "labels": { + "keyType": "string", + "type": "string", + "id": 4 + }, + "nodeLocation": { + "type": "string", + "id": 8 + }, + "nodeCount": { + "type": "int32", + "id": 6, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "machineFilter": { + "type": "string", + "id": 7 + }, + "localDiskEncryption": { + "type": "LocalDiskEncryption", + "id": 9, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + }, + "nested": { + "LocalDiskEncryption": { + "fields": { + "kmsKey": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "IMMUTABLE", + "(google.api.resource_reference).type": "cloudkms.googleapis.com/CryptoKey" + } + }, + "kmsKeyActiveVersion": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY", + "(google.api.resource_reference).type": "cloudkms.googleapis.com/CryptoKeyVersion" + } + }, + "kmsKeyState": { + "type": "KmsKeyState", + "id": 3, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "kmsStatus": { + "type": "google.rpc.Status", + "id": 4, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + } + } + } + } + }, + "Machine": { + "options": { + "(google.api.resource).type": "edgecontainer.googleapis.com/Machine", + "(google.api.resource).pattern": "projects/{project}/locations/{location}/machines/{machine}" + }, + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "edgecontainer.googleapis.com/Machine" + } + }, + "createTime": { + "type": "google.protobuf.Timestamp", + "id": 2, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "updateTime": { + "type": "google.protobuf.Timestamp", + "id": 3, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "labels": { + "keyType": "string", + "type": "string", + "id": 4 + }, + "hostedNode": { + "type": "string", + "id": 5 + }, + "zone": { + "type": "string", + "id": 6 + }, + "disabled": { + "type": "bool", + "id": 8, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + } + } + }, + "VpnConnection": { + "options": { + "(google.api.resource).type": "edgecontainer.googleapis.com/VpnConnection", + "(google.api.resource).pattern": "projects/{project}/locations/{location}/vpnConnections/{vpn_connection}" + }, + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "edgecontainer.googleapis.com/VpnConnection" + } + }, + "createTime": { + "type": "google.protobuf.Timestamp", + "id": 2, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "updateTime": { + "type": "google.protobuf.Timestamp", + "id": 3, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "labels": { + "keyType": "string", + "type": "string", + "id": 4 + }, + "natGatewayIp": { + "type": "string", + "id": 5 + }, + "bgpRoutingMode": { + "type": "BgpRoutingMode", + "id": 6, + "options": { + "deprecated": true + } + }, + "cluster": { + "type": "string", + "id": 7, + "options": { + "(google.api.resource_reference).type": "edgecontainer.googleapis.com/Cluster" + } + }, + "vpc": { + "type": "string", + "id": 8 + }, + "vpcProject": { + "type": "VpcProject", + "id": 11, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "enableHighAvailability": { + "type": "bool", + "id": 9 + }, + "details": { + "type": "Details", + "id": 10, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + } + }, + "nested": { + "VpcProject": { + "fields": { + "projectId": { + "type": "string", + "id": 1 + }, + "serviceAccount": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "Details": { + "fields": { + "state": { + "type": "State", + "id": 1 + }, + "error": { + "type": "string", + "id": 2 + }, + "cloudRouter": { + "type": "CloudRouter", + "id": 3 + }, + "cloudVpns": { + "rule": "repeated", + "type": "CloudVpn", + "id": 4 + } + }, + "nested": { + "CloudRouter": { + "fields": { + "name": { + "type": "string", + "id": 1 + } + } + }, + "CloudVpn": { + "fields": { + "gateway": { + "type": "string", + "id": 1 + } + } + }, + "State": { + "values": { + "STATE_UNSPECIFIED": 0, + "STATE_CONNECTED": 1, + "STATE_CONNECTING": 2, + "STATE_ERROR": 3 + } + } + } + }, + "BgpRoutingMode": { + "values": { + "BGP_ROUTING_MODE_UNSPECIFIED": 0, + "REGIONAL": 1, + "GLOBAL": 2 + } + } + } + }, + "LocationMetadata": { + "fields": { + "availableZones": { + "keyType": "string", + "type": "ZoneMetadata", + "id": 1 + } + } + }, + "ZoneMetadata": { + "fields": { + "quota": { + "rule": "repeated", + "type": "Quota", + "id": 1 + } + } + }, + "Quota": { + "fields": { + "metric": { + "type": "string", + "id": 1 + }, + "limit": { + "type": "double", + "id": 2 + }, + "usage": { + "type": "double", + "id": 3 + } + } + }, + "MaintenancePolicy": { + "fields": { + "window": { + "type": "MaintenanceWindow", + "id": 1 + } + } + }, + "MaintenanceWindow": { + "fields": { + "recurringWindow": { + "type": "RecurringTimeWindow", + "id": 1 + } + } + }, + "RecurringTimeWindow": { + "fields": { + "window": { + "type": "TimeWindow", + "id": 1 + }, + "recurrence": { + "type": "string", + "id": 2 + } + } + }, + "TimeWindow": { + "fields": { + "startTime": { + "type": "google.protobuf.Timestamp", + "id": 1 + }, + "endTime": { + "type": "google.protobuf.Timestamp", + "id": 2 + } + } + }, + "EdgeContainer": { + "options": { + "(google.api.default_host)": "edgecontainer.googleapis.com", + "(google.api.oauth_scopes)": "https://www.googleapis.com/auth/cloud-platform" + }, + "methods": { + "ListClusters": { + "requestType": "ListClustersRequest", + "responseType": "ListClustersResponse", + "options": { + "(google.api.http).get": "/v1/{parent=projects/*/locations/*}/clusters", + "(google.api.method_signature)": "parent" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1/{parent=projects/*/locations/*}/clusters" + } + }, + { + "(google.api.method_signature)": "parent" + } + ] + }, + "GetCluster": { + "requestType": "GetClusterRequest", + "responseType": "Cluster", + "options": { + "(google.api.http).get": "/v1/{name=projects/*/locations/*/clusters/*}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1/{name=projects/*/locations/*/clusters/*}" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "CreateCluster": { + "requestType": "CreateClusterRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).post": "/v1/{parent=projects/*/locations/*}/clusters", + "(google.api.http).body": "cluster", + "(google.api.method_signature)": "parent,cluster,cluster_id", + "(google.longrunning.operation_info).response_type": "Cluster", + "(google.longrunning.operation_info).metadata_type": "OperationMetadata" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1/{parent=projects/*/locations/*}/clusters", + "body": "cluster" + } + }, + { + "(google.api.method_signature)": "parent,cluster,cluster_id" + }, + { + "(google.longrunning.operation_info)": { + "response_type": "Cluster", + "metadata_type": "OperationMetadata" + } + } + ] + }, + "UpdateCluster": { + "requestType": "UpdateClusterRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).patch": "/v1/{cluster.name=projects/*/locations/*/clusters/*}", + "(google.api.http).body": "cluster", + "(google.api.method_signature)": "cluster,update_mask", + "(google.longrunning.operation_info).response_type": "Cluster", + "(google.longrunning.operation_info).metadata_type": "OperationMetadata" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "patch": "/v1/{cluster.name=projects/*/locations/*/clusters/*}", + "body": "cluster" + } + }, + { + "(google.api.method_signature)": "cluster,update_mask" + }, + { + "(google.longrunning.operation_info)": { + "response_type": "Cluster", + "metadata_type": "OperationMetadata" + } + } + ] + }, + "DeleteCluster": { + "requestType": "DeleteClusterRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).delete": "/v1/{name=projects/*/locations/*/clusters/*}", + "(google.api.method_signature)": "name", + "(google.longrunning.operation_info).response_type": "google.protobuf.Empty", + "(google.longrunning.operation_info).metadata_type": "OperationMetadata" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "delete": "/v1/{name=projects/*/locations/*/clusters/*}" + } + }, + { + "(google.api.method_signature)": "name" + }, + { + "(google.longrunning.operation_info)": { + "response_type": "google.protobuf.Empty", + "metadata_type": "OperationMetadata" + } + } + ] + }, + "GenerateAccessToken": { + "requestType": "GenerateAccessTokenRequest", + "responseType": "GenerateAccessTokenResponse", + "options": { + "(google.api.http).get": "/v1/{cluster=projects/*/locations/*/clusters/*}:generateAccessToken", + "(google.api.method_signature)": "cluster" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1/{cluster=projects/*/locations/*/clusters/*}:generateAccessToken" + } + }, + { + "(google.api.method_signature)": "cluster" + } + ] + }, + "ListNodePools": { + "requestType": "ListNodePoolsRequest", + "responseType": "ListNodePoolsResponse", + "options": { + "(google.api.http).get": "/v1/{parent=projects/*/locations/*/clusters/*}/nodePools", + "(google.api.method_signature)": "parent" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1/{parent=projects/*/locations/*/clusters/*}/nodePools" + } + }, + { + "(google.api.method_signature)": "parent" + } + ] + }, + "GetNodePool": { + "requestType": "GetNodePoolRequest", + "responseType": "NodePool", + "options": { + "(google.api.http).get": "/v1/{name=projects/*/locations/*/clusters/*/nodePools/*}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1/{name=projects/*/locations/*/clusters/*/nodePools/*}" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "CreateNodePool": { + "requestType": "CreateNodePoolRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).post": "/v1/{parent=projects/*/locations/*/clusters/*}/nodePools", + "(google.api.http).body": "node_pool", + "(google.api.method_signature)": "parent,node_pool,node_pool_id", + "(google.longrunning.operation_info).response_type": "NodePool", + "(google.longrunning.operation_info).metadata_type": "OperationMetadata" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1/{parent=projects/*/locations/*/clusters/*}/nodePools", + "body": "node_pool" + } + }, + { + "(google.api.method_signature)": "parent,node_pool,node_pool_id" + }, + { + "(google.longrunning.operation_info)": { + "response_type": "NodePool", + "metadata_type": "OperationMetadata" + } + } + ] + }, + "UpdateNodePool": { + "requestType": "UpdateNodePoolRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).patch": "/v1/{node_pool.name=projects/*/locations/*/clusters/*/nodePools/*}", + "(google.api.http).body": "node_pool", + "(google.api.method_signature)": "node_pool,update_mask", + "(google.longrunning.operation_info).response_type": "NodePool", + "(google.longrunning.operation_info).metadata_type": "OperationMetadata" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "patch": "/v1/{node_pool.name=projects/*/locations/*/clusters/*/nodePools/*}", + "body": "node_pool" + } + }, + { + "(google.api.method_signature)": "node_pool,update_mask" + }, + { + "(google.longrunning.operation_info)": { + "response_type": "NodePool", + "metadata_type": "OperationMetadata" + } + } + ] + }, + "DeleteNodePool": { + "requestType": "DeleteNodePoolRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).delete": "/v1/{name=projects/*/locations/*/clusters/*/nodePools/*}", + "(google.api.method_signature)": "name", + "(google.longrunning.operation_info).response_type": "google.protobuf.Empty", + "(google.longrunning.operation_info).metadata_type": "OperationMetadata" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "delete": "/v1/{name=projects/*/locations/*/clusters/*/nodePools/*}" + } + }, + { + "(google.api.method_signature)": "name" + }, + { + "(google.longrunning.operation_info)": { + "response_type": "google.protobuf.Empty", + "metadata_type": "OperationMetadata" + } + } + ] + }, + "ListMachines": { + "requestType": "ListMachinesRequest", + "responseType": "ListMachinesResponse", + "options": { + "(google.api.http).get": "/v1/{parent=projects/*/locations/*}/machines", + "(google.api.method_signature)": "parent" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1/{parent=projects/*/locations/*}/machines" + } + }, + { + "(google.api.method_signature)": "parent" + } + ] + }, + "GetMachine": { + "requestType": "GetMachineRequest", + "responseType": "Machine", + "options": { + "(google.api.http).get": "/v1/{name=projects/*/locations/*/machines/*}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1/{name=projects/*/locations/*/machines/*}" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "ListVpnConnections": { + "requestType": "ListVpnConnectionsRequest", + "responseType": "ListVpnConnectionsResponse", + "options": { + "(google.api.http).get": "/v1/{parent=projects/*/locations/*}/vpnConnections", + "(google.api.method_signature)": "parent" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1/{parent=projects/*/locations/*}/vpnConnections" + } + }, + { + "(google.api.method_signature)": "parent" + } + ] + }, + "GetVpnConnection": { + "requestType": "GetVpnConnectionRequest", + "responseType": "VpnConnection", + "options": { + "(google.api.http).get": "/v1/{name=projects/*/locations/*/vpnConnections/*}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1/{name=projects/*/locations/*/vpnConnections/*}" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "CreateVpnConnection": { + "requestType": "CreateVpnConnectionRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).post": "/v1/{parent=projects/*/locations/*}/vpnConnections", + "(google.api.http).body": "vpn_connection", + "(google.api.method_signature)": "parent,vpn_connection,vpn_connection_id", + "(google.longrunning.operation_info).response_type": "VpnConnection", + "(google.longrunning.operation_info).metadata_type": "OperationMetadata" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1/{parent=projects/*/locations/*}/vpnConnections", + "body": "vpn_connection" + } + }, + { + "(google.api.method_signature)": "parent,vpn_connection,vpn_connection_id" + }, + { + "(google.longrunning.operation_info)": { + "response_type": "VpnConnection", + "metadata_type": "OperationMetadata" + } + } + ] + }, + "DeleteVpnConnection": { + "requestType": "DeleteVpnConnectionRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).delete": "/v1/{name=projects/*/locations/*/vpnConnections/*}", + "(google.api.method_signature)": "name", + "(google.longrunning.operation_info).response_type": "google.protobuf.Empty", + "(google.longrunning.operation_info).metadata_type": "OperationMetadata" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "delete": "/v1/{name=projects/*/locations/*/vpnConnections/*}" + } + }, + { + "(google.api.method_signature)": "name" + }, + { + "(google.longrunning.operation_info)": { + "response_type": "google.protobuf.Empty", + "metadata_type": "OperationMetadata" + } + } + ] + } + } + }, + "OperationMetadata": { + "fields": { + "createTime": { + "type": "google.protobuf.Timestamp", + "id": 1 + }, + "endTime": { + "type": "google.protobuf.Timestamp", + "id": 2 + }, + "target": { + "type": "string", + "id": 3 + }, + "verb": { + "type": "string", + "id": 4 + }, + "statusMessage": { + "type": "string", + "id": 5 + }, + "requestedCancellation": { + "type": "bool", + "id": 6 + }, + "apiVersion": { + "type": "string", + "id": 7 + } + } + }, + "ListClustersRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).child_type": "edgecontainer.googleapis.com/Cluster" + } + }, + "pageSize": { + "type": "int32", + "id": 2 + }, + "pageToken": { + "type": "string", + "id": 3 + }, + "filter": { + "type": "string", + "id": 4 + }, + "orderBy": { + "type": "string", + "id": 5 + } + } + }, + "ListClustersResponse": { + "fields": { + "clusters": { + "rule": "repeated", + "type": "Cluster", + "id": 1 + }, + "nextPageToken": { + "type": "string", + "id": 2 + }, + "unreachable": { + "rule": "repeated", + "type": "string", + "id": 3 + } + } + }, + "GetClusterRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "edgecontainer.googleapis.com/Cluster" + } + } + } + }, + "CreateClusterRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).child_type": "edgecontainer.googleapis.com/Cluster" + } + }, + "clusterId": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "cluster": { + "type": "Cluster", + "id": 3, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "requestId": { + "type": "string", + "id": 4 + } + } + }, + "UpdateClusterRequest": { + "fields": { + "updateMask": { + "type": "google.protobuf.FieldMask", + "id": 1 + }, + "cluster": { + "type": "Cluster", + "id": 2 + }, + "requestId": { + "type": "string", + "id": 3 + } + } + }, + "DeleteClusterRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "edgecontainer.googleapis.com/Cluster" + } + }, + "requestId": { + "type": "string", + "id": 2 + } + } + }, + "GenerateAccessTokenRequest": { + "fields": { + "cluster": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "edgecontainer.googleapis.com/Cluster" + } + } + } + }, + "GenerateAccessTokenResponse": { + "fields": { + "accessToken": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "expireTime": { + "type": "google.protobuf.Timestamp", + "id": 2, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + } + } + }, + "ListNodePoolsRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).child_type": "edgecontainer.googleapis.com/NodePool" + } + }, + "pageSize": { + "type": "int32", + "id": 2 + }, + "pageToken": { + "type": "string", + "id": 3 + }, + "filter": { + "type": "string", + "id": 4 + }, + "orderBy": { + "type": "string", + "id": 5 + } + } + }, + "ListNodePoolsResponse": { + "fields": { + "nodePools": { + "rule": "repeated", + "type": "NodePool", + "id": 1 + }, + "nextPageToken": { + "type": "string", + "id": 2 + }, + "unreachable": { + "rule": "repeated", + "type": "string", + "id": 3 + } + } + }, + "GetNodePoolRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "edgecontainer.googleapis.com/NodePool" + } + } + } + }, + "CreateNodePoolRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).child_type": "edgecontainer.googleapis.com/NodePool" + } + }, + "nodePoolId": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "nodePool": { + "type": "NodePool", + "id": 3, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "requestId": { + "type": "string", + "id": 4 + } + } + }, + "UpdateNodePoolRequest": { + "fields": { + "updateMask": { + "type": "google.protobuf.FieldMask", + "id": 1 + }, + "nodePool": { + "type": "NodePool", + "id": 2 + }, + "requestId": { + "type": "string", + "id": 3 + } + } + }, + "DeleteNodePoolRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "edgecontainer.googleapis.com/NodePool" + } + }, + "requestId": { + "type": "string", + "id": 2 + } + } + }, + "ListMachinesRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).child_type": "edgecontainer.googleapis.com/Machine" + } + }, + "pageSize": { + "type": "int32", + "id": 2 + }, + "pageToken": { + "type": "string", + "id": 3 + }, + "filter": { + "type": "string", + "id": 4 + }, + "orderBy": { + "type": "string", + "id": 5 + } + } + }, + "ListMachinesResponse": { + "fields": { + "machines": { + "rule": "repeated", + "type": "Machine", + "id": 1 + }, + "nextPageToken": { + "type": "string", + "id": 2 + }, + "unreachable": { + "rule": "repeated", + "type": "string", + "id": 3 + } + } + }, + "GetMachineRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "edgecontainer.googleapis.com/Machine" + } + } + } + }, + "ListVpnConnectionsRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).child_type": "edgecontainer.googleapis.com/VpnConnection" + } + }, + "pageSize": { + "type": "int32", + "id": 2 + }, + "pageToken": { + "type": "string", + "id": 3 + }, + "filter": { + "type": "string", + "id": 4 + }, + "orderBy": { + "type": "string", + "id": 5 + } + } + }, + "ListVpnConnectionsResponse": { + "fields": { + "vpnConnections": { + "rule": "repeated", + "type": "VpnConnection", + "id": 1 + }, + "nextPageToken": { + "type": "string", + "id": 2 + }, + "unreachable": { + "rule": "repeated", + "type": "string", + "id": 3 + } + } + }, + "GetVpnConnectionRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "edgecontainer.googleapis.com/VpnConnection" + } + } + } + }, + "CreateVpnConnectionRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).child_type": "edgecontainer.googleapis.com/VpnConnection" + } + }, + "vpnConnectionId": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "vpnConnection": { + "type": "VpnConnection", + "id": 3, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "requestId": { + "type": "string", + "id": 4 + } + } + }, + "DeleteVpnConnectionRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "edgecontainer.googleapis.com/VpnConnection" + } + }, + "requestId": { + "type": "string", + "id": 2 + } + } + } + } + } + } + } + } + }, + "api": { + "options": { + "go_package": "google.golang.org/genproto/googleapis/api;api", + "java_multiple_files": true, + "java_outer_classname": "LaunchStageProto", + "java_package": "com.google.api", + "objc_class_prefix": "GAPI", + "cc_enable_arenas": true + }, + "nested": { + "fieldBehavior": { + "rule": "repeated", + "type": "google.api.FieldBehavior", + "id": 1052, + "extend": "google.protobuf.FieldOptions" + }, + "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 + } + }, + "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 + } + } + }, + "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" + }, + "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 + } + } + }, + "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 + } + } + }, + "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 + } + }, + "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 + } + }, + "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 + } + } + } + }, + "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": { + "fields": { + "file": { + "rule": "repeated", + "type": "FileDescriptorProto", + "id": 1 + } + } + }, + "FileDescriptorProto": { + "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, + "options": { + "packed": false + } + }, + "weakDependency": { + "rule": "repeated", + "type": "int32", + "id": 11, + "options": { + "packed": false + } + }, + "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": "string", + "id": 13 + } + } + }, + "DescriptorProto": { + "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": { + "fields": { + "uninterpretedOption": { + "rule": "repeated", + "type": "UninterpretedOption", + "id": 999 + } + }, + "extensions": [ + [ + 1000, + 536870911 + ] + ] + }, + "FieldDescriptorProto": { + "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_REQUIRED": 2, + "LABEL_REPEATED": 3 + } + } + } + }, + "OneofDescriptorProto": { + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "options": { + "type": "OneofOptions", + "id": 2 + } + } + }, + "EnumDescriptorProto": { + "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": { + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "number": { + "type": "int32", + "id": 2 + }, + "options": { + "type": "EnumValueOptions", + "id": 3 + } + } + }, + "ServiceDescriptorProto": { + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "method": { + "rule": "repeated", + "type": "MethodDescriptorProto", + "id": 2 + }, + "options": { + "type": "ServiceOptions", + "id": 3 + } + } + }, + "MethodDescriptorProto": { + "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": { + "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 + } + }, + "phpGenericServices": { + "type": "bool", + "id": 42, + "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 + }, + "uninterpretedOption": { + "rule": "repeated", + "type": "UninterpretedOption", + "id": 999 + } + }, + "extensions": [ + [ + 1000, + 536870911 + ] + ], + "reserved": [ + [ + 38, + 38 + ] + ], + "nested": { + "OptimizeMode": { + "values": { + "SPEED": 1, + "CODE_SIZE": 2, + "LITE_RUNTIME": 3 + } + } + } + }, + "MessageOptions": { + "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 + } + }, + "uninterpretedOption": { + "rule": "repeated", + "type": "UninterpretedOption", + "id": 999 + } + }, + "extensions": [ + [ + 1000, + 536870911 + ] + ], + "reserved": [ + [ + 4, + 4 + ], + [ + 5, + 5 + ], + [ + 6, + 6 + ], + [ + 8, + 8 + ], + [ + 9, + 9 + ] + ] + }, + "FieldOptions": { + "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 + }, + "target": { + "type": "OptionTargetType", + "id": 18 + }, + "uninterpretedOption": { + "rule": "repeated", + "type": "UninterpretedOption", + "id": 999 + } + }, + "extensions": [ + [ + 1000, + 536870911 + ] + ], + "reserved": [ + [ + 4, + 4 + ] + ], + "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 + } + } + } + }, + "OneofOptions": { + "fields": { + "uninterpretedOption": { + "rule": "repeated", + "type": "UninterpretedOption", + "id": 999 + } + }, + "extensions": [ + [ + 1000, + 536870911 + ] + ] + }, + "EnumOptions": { + "fields": { + "allowAlias": { + "type": "bool", + "id": 2 + }, + "deprecated": { + "type": "bool", + "id": 3, + "options": { + "default": false + } + }, + "deprecatedLegacyJsonFieldConflicts": { + "type": "bool", + "id": 6, + "options": { + "deprecated": true + } + }, + "uninterpretedOption": { + "rule": "repeated", + "type": "UninterpretedOption", + "id": 999 + } + }, + "extensions": [ + [ + 1000, + 536870911 + ] + ], + "reserved": [ + [ + 5, + 5 + ] + ] + }, + "EnumValueOptions": { + "fields": { + "deprecated": { + "type": "bool", + "id": 1, + "options": { + "default": false + } + }, + "uninterpretedOption": { + "rule": "repeated", + "type": "UninterpretedOption", + "id": 999 + } + }, + "extensions": [ + [ + 1000, + 536870911 + ] + ] + }, + "ServiceOptions": { + "fields": { + "deprecated": { + "type": "bool", + "id": 33, + "options": { + "default": false + } + }, + "uninterpretedOption": { + "rule": "repeated", + "type": "UninterpretedOption", + "id": 999 + } + }, + "extensions": [ + [ + 1000, + 536870911 + ] + ] + }, + "MethodOptions": { + "fields": { + "deprecated": { + "type": "bool", + "id": 33, + "options": { + "default": false + } + }, + "idempotencyLevel": { + "type": "IdempotencyLevel", + "id": 34, + "options": { + "default": "IDEMPOTENCY_UNKNOWN" + } + }, + "uninterpretedOption": { + "rule": "repeated", + "type": "UninterpretedOption", + "id": 999 + } + }, + "extensions": [ + [ + 1000, + 536870911 + ] + ], + "nested": { + "IdempotencyLevel": { + "values": { + "IDEMPOTENCY_UNKNOWN": 0, + "NO_SIDE_EFFECTS": 1, + "IDEMPOTENT": 2 + } + } + } + }, + "UninterpretedOption": { + "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 + } + } + } + } + }, + "SourceCodeInfo": { + "fields": { + "location": { + "rule": "repeated", + "type": "Location", + "id": 1 + } + }, + "nested": { + "Location": { + "fields": { + "path": { + "rule": "repeated", + "type": "int32", + "id": 1 + }, + "span": { + "rule": "repeated", + "type": "int32", + "id": 2 + }, + "leadingComments": { + "type": "string", + "id": 3 + }, + "trailingComments": { + "type": "string", + "id": 4 + }, + "leadingDetachedComments": { + "rule": "repeated", + "type": "string", + "id": 6 + } + } + } + } + }, + "GeneratedCodeInfo": { + "fields": { + "annotation": { + "rule": "repeated", + "type": "Annotation", + "id": 1 + } + }, + "nested": { + "Annotation": { + "fields": { + "path": { + "rule": "repeated", + "type": "int32", + "id": 1 + }, + "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 + } + } + } + } + } + }, + "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 + } + } + }, + "Duration": { + "fields": { + "seconds": { + "type": "int64", + "id": 1 + }, + "nanos": { + "type": "int32", + "id": 2 + } + } + }, + "Empty": { + "fields": {} + }, + "FieldMask": { + "fields": { + "paths": { + "rule": "repeated", + "type": "string", + "id": 1 + } + } + } + } + }, + "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 + } + } + } + } + }, + "longrunning": { + "options": { + "cc_enable_arenas": true, + "csharp_namespace": "Google.LongRunning", + "go_package": "google.golang.org/genproto/googleapis/longrunning;longrunning", + "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 + } + } + } + } + } + } + } + } +} \ No newline at end of file diff --git a/packages/google-cloud-edgecontainer/samples/README.md b/packages/google-cloud-edgecontainer/samples/README.md new file mode 100644 index 00000000000..a32e3003ec2 --- /dev/null +++ b/packages/google-cloud-edgecontainer/samples/README.md @@ -0,0 +1,356 @@ +[//]: # "This README.md file is auto-generated, all changes to this file will be lost." +[//]: # "To regenerate it, use `python -m synthtool`." +Google Cloud Platform logo + +# [Distributed Cloud Edge Container API: Node.js Samples](https://github.com/googleapis/google-cloud-node) + +[![Open in Cloud Shell][shell_img]][shell_link] + + + +## Table of Contents + +* [Before you begin](#before-you-begin) +* [Samples](#samples) + * [Edge_container.create_cluster](#edge_container.create_cluster) + * [Edge_container.create_node_pool](#edge_container.create_node_pool) + * [Edge_container.create_vpn_connection](#edge_container.create_vpn_connection) + * [Edge_container.delete_cluster](#edge_container.delete_cluster) + * [Edge_container.delete_node_pool](#edge_container.delete_node_pool) + * [Edge_container.delete_vpn_connection](#edge_container.delete_vpn_connection) + * [Edge_container.generate_access_token](#edge_container.generate_access_token) + * [Edge_container.get_cluster](#edge_container.get_cluster) + * [Edge_container.get_machine](#edge_container.get_machine) + * [Edge_container.get_node_pool](#edge_container.get_node_pool) + * [Edge_container.get_vpn_connection](#edge_container.get_vpn_connection) + * [Edge_container.list_clusters](#edge_container.list_clusters) + * [Edge_container.list_machines](#edge_container.list_machines) + * [Edge_container.list_node_pools](#edge_container.list_node_pools) + * [Edge_container.list_vpn_connections](#edge_container.list_vpn_connections) + * [Edge_container.update_cluster](#edge_container.update_cluster) + * [Edge_container.update_node_pool](#edge_container.update_node_pool) + * [Quickstart](#quickstart) + +## Before you begin + +Before running the samples, make sure you've followed the steps outlined in +[Using the client library](https://github.com/googleapis/google-cloud-node#using-the-client-library). + +`cd samples` + +`npm install` + +`cd ..` + +## Samples + + + +### Edge_container.create_cluster + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-edgecontainer/samples/generated/v1/edge_container.create_cluster.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-cloud-edgecontainer/samples/generated/v1/edge_container.create_cluster.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-edgecontainer/samples/generated/v1/edge_container.create_cluster.js` + + +----- + + + + +### Edge_container.create_node_pool + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-edgecontainer/samples/generated/v1/edge_container.create_node_pool.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-cloud-edgecontainer/samples/generated/v1/edge_container.create_node_pool.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-edgecontainer/samples/generated/v1/edge_container.create_node_pool.js` + + +----- + + + + +### Edge_container.create_vpn_connection + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-edgecontainer/samples/generated/v1/edge_container.create_vpn_connection.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-cloud-edgecontainer/samples/generated/v1/edge_container.create_vpn_connection.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-edgecontainer/samples/generated/v1/edge_container.create_vpn_connection.js` + + +----- + + + + +### Edge_container.delete_cluster + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-edgecontainer/samples/generated/v1/edge_container.delete_cluster.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-cloud-edgecontainer/samples/generated/v1/edge_container.delete_cluster.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-edgecontainer/samples/generated/v1/edge_container.delete_cluster.js` + + +----- + + + + +### Edge_container.delete_node_pool + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-edgecontainer/samples/generated/v1/edge_container.delete_node_pool.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-cloud-edgecontainer/samples/generated/v1/edge_container.delete_node_pool.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-edgecontainer/samples/generated/v1/edge_container.delete_node_pool.js` + + +----- + + + + +### Edge_container.delete_vpn_connection + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-edgecontainer/samples/generated/v1/edge_container.delete_vpn_connection.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-cloud-edgecontainer/samples/generated/v1/edge_container.delete_vpn_connection.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-edgecontainer/samples/generated/v1/edge_container.delete_vpn_connection.js` + + +----- + + + + +### Edge_container.generate_access_token + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-edgecontainer/samples/generated/v1/edge_container.generate_access_token.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-cloud-edgecontainer/samples/generated/v1/edge_container.generate_access_token.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-edgecontainer/samples/generated/v1/edge_container.generate_access_token.js` + + +----- + + + + +### Edge_container.get_cluster + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-edgecontainer/samples/generated/v1/edge_container.get_cluster.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-cloud-edgecontainer/samples/generated/v1/edge_container.get_cluster.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-edgecontainer/samples/generated/v1/edge_container.get_cluster.js` + + +----- + + + + +### Edge_container.get_machine + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-edgecontainer/samples/generated/v1/edge_container.get_machine.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-cloud-edgecontainer/samples/generated/v1/edge_container.get_machine.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-edgecontainer/samples/generated/v1/edge_container.get_machine.js` + + +----- + + + + +### Edge_container.get_node_pool + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-edgecontainer/samples/generated/v1/edge_container.get_node_pool.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-cloud-edgecontainer/samples/generated/v1/edge_container.get_node_pool.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-edgecontainer/samples/generated/v1/edge_container.get_node_pool.js` + + +----- + + + + +### Edge_container.get_vpn_connection + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-edgecontainer/samples/generated/v1/edge_container.get_vpn_connection.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-cloud-edgecontainer/samples/generated/v1/edge_container.get_vpn_connection.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-edgecontainer/samples/generated/v1/edge_container.get_vpn_connection.js` + + +----- + + + + +### Edge_container.list_clusters + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-edgecontainer/samples/generated/v1/edge_container.list_clusters.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-cloud-edgecontainer/samples/generated/v1/edge_container.list_clusters.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-edgecontainer/samples/generated/v1/edge_container.list_clusters.js` + + +----- + + + + +### Edge_container.list_machines + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-edgecontainer/samples/generated/v1/edge_container.list_machines.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-cloud-edgecontainer/samples/generated/v1/edge_container.list_machines.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-edgecontainer/samples/generated/v1/edge_container.list_machines.js` + + +----- + + + + +### Edge_container.list_node_pools + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-edgecontainer/samples/generated/v1/edge_container.list_node_pools.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-cloud-edgecontainer/samples/generated/v1/edge_container.list_node_pools.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-edgecontainer/samples/generated/v1/edge_container.list_node_pools.js` + + +----- + + + + +### Edge_container.list_vpn_connections + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-edgecontainer/samples/generated/v1/edge_container.list_vpn_connections.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-cloud-edgecontainer/samples/generated/v1/edge_container.list_vpn_connections.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-edgecontainer/samples/generated/v1/edge_container.list_vpn_connections.js` + + +----- + + + + +### Edge_container.update_cluster + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-edgecontainer/samples/generated/v1/edge_container.update_cluster.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-cloud-edgecontainer/samples/generated/v1/edge_container.update_cluster.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-edgecontainer/samples/generated/v1/edge_container.update_cluster.js` + + +----- + + + + +### Edge_container.update_node_pool + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-edgecontainer/samples/generated/v1/edge_container.update_node_pool.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-cloud-edgecontainer/samples/generated/v1/edge_container.update_node_pool.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-edgecontainer/samples/generated/v1/edge_container.update_node_pool.js` + + +----- + + + + +### Quickstart + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-edgecontainer/samples/quickstart.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-cloud-edgecontainer/samples/quickstart.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-edgecontainer/samples/quickstart.js` + + + + + + +[shell_img]: https://gstatic.com/cloudssh/images/open-btn.png +[shell_link]: https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=samples/README.md +[product-docs]: diff --git a/packages/google-cloud-edgecontainer/samples/generated/v1/edge_container.create_cluster.js b/packages/google-cloud-edgecontainer/samples/generated/v1/edge_container.create_cluster.js new file mode 100644 index 00000000000..02bbc76fc2e --- /dev/null +++ b/packages/google-cloud-edgecontainer/samples/generated/v1/edge_container.create_cluster.js @@ -0,0 +1,78 @@ +// Copyright 2023 Google LLC +// +// Licensed under the Apache License, Version 2.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, clusterId, cluster) { + // [START edgecontainer_v1_generated_EdgeContainer_CreateCluster_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 location where this cluster will be created. + */ + // const parent = 'abc123' + /** + * Required. A client-specified unique identifier for the cluster. + */ + // const clusterId = 'abc123' + /** + * Required. The cluster to create. + */ + // const cluster = {} + /** + * A unique identifier for this request. Restricted to 36 ASCII characters. A + * random UUID is recommended. This request is only idempotent if + * `request_id` is provided. + */ + // const requestId = 'abc123' + + // Imports the Edgecontainer library + const {EdgeContainerClient} = require('@google-cloud/edgecontainer').v1; + + // Instantiates a client + const edgecontainerClient = new EdgeContainerClient(); + + async function callCreateCluster() { + // Construct request + const request = { + parent, + clusterId, + cluster, + }; + + // Run request + const [operation] = await edgecontainerClient.createCluster(request); + const [response] = await operation.promise(); + console.log(response); + } + + callCreateCluster(); + // [END edgecontainer_v1_generated_EdgeContainer_CreateCluster_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-edgecontainer/samples/generated/v1/edge_container.create_node_pool.js b/packages/google-cloud-edgecontainer/samples/generated/v1/edge_container.create_node_pool.js new file mode 100644 index 00000000000..a34081b3828 --- /dev/null +++ b/packages/google-cloud-edgecontainer/samples/generated/v1/edge_container.create_node_pool.js @@ -0,0 +1,78 @@ +// Copyright 2023 Google LLC +// +// Licensed under the Apache License, Version 2.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, nodePoolId, nodePool) { + // [START edgecontainer_v1_generated_EdgeContainer_CreateNodePool_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 cluster where this node pool will be created. + */ + // const parent = 'abc123' + /** + * Required. A client-specified unique identifier for the node pool. + */ + // const nodePoolId = 'abc123' + /** + * Required. The node pool to create. + */ + // const nodePool = {} + /** + * A unique identifier for this request. Restricted to 36 ASCII characters. A + * random UUID is recommended. This request is only idempotent if + * `request_id` is provided. + */ + // const requestId = 'abc123' + + // Imports the Edgecontainer library + const {EdgeContainerClient} = require('@google-cloud/edgecontainer').v1; + + // Instantiates a client + const edgecontainerClient = new EdgeContainerClient(); + + async function callCreateNodePool() { + // Construct request + const request = { + parent, + nodePoolId, + nodePool, + }; + + // Run request + const [operation] = await edgecontainerClient.createNodePool(request); + const [response] = await operation.promise(); + console.log(response); + } + + callCreateNodePool(); + // [END edgecontainer_v1_generated_EdgeContainer_CreateNodePool_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-edgecontainer/samples/generated/v1/edge_container.create_vpn_connection.js b/packages/google-cloud-edgecontainer/samples/generated/v1/edge_container.create_vpn_connection.js new file mode 100644 index 00000000000..51fba29850d --- /dev/null +++ b/packages/google-cloud-edgecontainer/samples/generated/v1/edge_container.create_vpn_connection.js @@ -0,0 +1,78 @@ +// Copyright 2023 Google LLC +// +// Licensed under the Apache License, Version 2.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, vpnConnectionId, vpnConnection) { + // [START edgecontainer_v1_generated_EdgeContainer_CreateVpnConnection_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 location where this vpn connection will be created. + */ + // const parent = 'abc123' + /** + * Required. The VPN connection identifier. + */ + // const vpnConnectionId = 'abc123' + /** + * Required. The VPN connection to create. + */ + // const vpnConnection = {} + /** + * A unique identifier for this request. Restricted to 36 ASCII characters. A + * random UUID is recommended. This request is only idempotent if + * `request_id` is provided. + */ + // const requestId = 'abc123' + + // Imports the Edgecontainer library + const {EdgeContainerClient} = require('@google-cloud/edgecontainer').v1; + + // Instantiates a client + const edgecontainerClient = new EdgeContainerClient(); + + async function callCreateVpnConnection() { + // Construct request + const request = { + parent, + vpnConnectionId, + vpnConnection, + }; + + // Run request + const [operation] = await edgecontainerClient.createVpnConnection(request); + const [response] = await operation.promise(); + console.log(response); + } + + callCreateVpnConnection(); + // [END edgecontainer_v1_generated_EdgeContainer_CreateVpnConnection_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-edgecontainer/samples/generated/v1/edge_container.delete_cluster.js b/packages/google-cloud-edgecontainer/samples/generated/v1/edge_container.delete_cluster.js new file mode 100644 index 00000000000..da6d892de2d --- /dev/null +++ b/packages/google-cloud-edgecontainer/samples/generated/v1/edge_container.delete_cluster.js @@ -0,0 +1,68 @@ +// Copyright 2023 Google LLC +// +// Licensed under the Apache License, Version 2.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 edgecontainer_v1_generated_EdgeContainer_DeleteCluster_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 resource name of the cluster. + */ + // const name = 'abc123' + /** + * A unique identifier for this request. Restricted to 36 ASCII characters. A + * random UUID is recommended. This request is only idempotent if + * `request_id` is provided. + */ + // const requestId = 'abc123' + + // Imports the Edgecontainer library + const {EdgeContainerClient} = require('@google-cloud/edgecontainer').v1; + + // Instantiates a client + const edgecontainerClient = new EdgeContainerClient(); + + async function callDeleteCluster() { + // Construct request + const request = { + name, + }; + + // Run request + const [operation] = await edgecontainerClient.deleteCluster(request); + const [response] = await operation.promise(); + console.log(response); + } + + callDeleteCluster(); + // [END edgecontainer_v1_generated_EdgeContainer_DeleteCluster_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-edgecontainer/samples/generated/v1/edge_container.delete_node_pool.js b/packages/google-cloud-edgecontainer/samples/generated/v1/edge_container.delete_node_pool.js new file mode 100644 index 00000000000..9914e1a43c2 --- /dev/null +++ b/packages/google-cloud-edgecontainer/samples/generated/v1/edge_container.delete_node_pool.js @@ -0,0 +1,68 @@ +// Copyright 2023 Google LLC +// +// Licensed under the Apache License, Version 2.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 edgecontainer_v1_generated_EdgeContainer_DeleteNodePool_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 resource name of the node pool. + */ + // const name = 'abc123' + /** + * A unique identifier for this request. Restricted to 36 ASCII characters. A + * random UUID is recommended. This request is only idempotent if + * `request_id` is provided. + */ + // const requestId = 'abc123' + + // Imports the Edgecontainer library + const {EdgeContainerClient} = require('@google-cloud/edgecontainer').v1; + + // Instantiates a client + const edgecontainerClient = new EdgeContainerClient(); + + async function callDeleteNodePool() { + // Construct request + const request = { + name, + }; + + // Run request + const [operation] = await edgecontainerClient.deleteNodePool(request); + const [response] = await operation.promise(); + console.log(response); + } + + callDeleteNodePool(); + // [END edgecontainer_v1_generated_EdgeContainer_DeleteNodePool_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-edgecontainer/samples/generated/v1/edge_container.delete_vpn_connection.js b/packages/google-cloud-edgecontainer/samples/generated/v1/edge_container.delete_vpn_connection.js new file mode 100644 index 00000000000..906730ea06f --- /dev/null +++ b/packages/google-cloud-edgecontainer/samples/generated/v1/edge_container.delete_vpn_connection.js @@ -0,0 +1,68 @@ +// Copyright 2023 Google LLC +// +// Licensed under the Apache License, Version 2.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 edgecontainer_v1_generated_EdgeContainer_DeleteVpnConnection_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 resource name of the vpn connection. + */ + // const name = 'abc123' + /** + * A unique identifier for this request. Restricted to 36 ASCII characters. A + * random UUID is recommended. This request is only idempotent if + * `request_id` is provided. + */ + // const requestId = 'abc123' + + // Imports the Edgecontainer library + const {EdgeContainerClient} = require('@google-cloud/edgecontainer').v1; + + // Instantiates a client + const edgecontainerClient = new EdgeContainerClient(); + + async function callDeleteVpnConnection() { + // Construct request + const request = { + name, + }; + + // Run request + const [operation] = await edgecontainerClient.deleteVpnConnection(request); + const [response] = await operation.promise(); + console.log(response); + } + + callDeleteVpnConnection(); + // [END edgecontainer_v1_generated_EdgeContainer_DeleteVpnConnection_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-edgecontainer/samples/generated/v1/edge_container.generate_access_token.js b/packages/google-cloud-edgecontainer/samples/generated/v1/edge_container.generate_access_token.js new file mode 100644 index 00000000000..f0165c4c0b2 --- /dev/null +++ b/packages/google-cloud-edgecontainer/samples/generated/v1/edge_container.generate_access_token.js @@ -0,0 +1,61 @@ +// Copyright 2023 Google LLC +// +// Licensed under the Apache License, Version 2.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(cluster) { + // [START edgecontainer_v1_generated_EdgeContainer_GenerateAccessToken_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 resource name of the cluster. + */ + // const cluster = 'abc123' + + // Imports the Edgecontainer library + const {EdgeContainerClient} = require('@google-cloud/edgecontainer').v1; + + // Instantiates a client + const edgecontainerClient = new EdgeContainerClient(); + + async function callGenerateAccessToken() { + // Construct request + const request = { + cluster, + }; + + // Run request + const response = await edgecontainerClient.generateAccessToken(request); + console.log(response); + } + + callGenerateAccessToken(); + // [END edgecontainer_v1_generated_EdgeContainer_GenerateAccessToken_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-edgecontainer/samples/generated/v1/edge_container.get_cluster.js b/packages/google-cloud-edgecontainer/samples/generated/v1/edge_container.get_cluster.js new file mode 100644 index 00000000000..b11da93321c --- /dev/null +++ b/packages/google-cloud-edgecontainer/samples/generated/v1/edge_container.get_cluster.js @@ -0,0 +1,61 @@ +// Copyright 2023 Google LLC +// +// Licensed under the Apache License, Version 2.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 edgecontainer_v1_generated_EdgeContainer_GetCluster_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 resource name of the cluster. + */ + // const name = 'abc123' + + // Imports the Edgecontainer library + const {EdgeContainerClient} = require('@google-cloud/edgecontainer').v1; + + // Instantiates a client + const edgecontainerClient = new EdgeContainerClient(); + + async function callGetCluster() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await edgecontainerClient.getCluster(request); + console.log(response); + } + + callGetCluster(); + // [END edgecontainer_v1_generated_EdgeContainer_GetCluster_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-edgecontainer/samples/generated/v1/edge_container.get_machine.js b/packages/google-cloud-edgecontainer/samples/generated/v1/edge_container.get_machine.js new file mode 100644 index 00000000000..9d5fe5e49f8 --- /dev/null +++ b/packages/google-cloud-edgecontainer/samples/generated/v1/edge_container.get_machine.js @@ -0,0 +1,61 @@ +// Copyright 2023 Google LLC +// +// Licensed under the Apache License, Version 2.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 edgecontainer_v1_generated_EdgeContainer_GetMachine_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 resource name of the machine. + */ + // const name = 'abc123' + + // Imports the Edgecontainer library + const {EdgeContainerClient} = require('@google-cloud/edgecontainer').v1; + + // Instantiates a client + const edgecontainerClient = new EdgeContainerClient(); + + async function callGetMachine() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await edgecontainerClient.getMachine(request); + console.log(response); + } + + callGetMachine(); + // [END edgecontainer_v1_generated_EdgeContainer_GetMachine_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-edgecontainer/samples/generated/v1/edge_container.get_node_pool.js b/packages/google-cloud-edgecontainer/samples/generated/v1/edge_container.get_node_pool.js new file mode 100644 index 00000000000..1cc057c10af --- /dev/null +++ b/packages/google-cloud-edgecontainer/samples/generated/v1/edge_container.get_node_pool.js @@ -0,0 +1,61 @@ +// Copyright 2023 Google LLC +// +// Licensed under the Apache License, Version 2.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 edgecontainer_v1_generated_EdgeContainer_GetNodePool_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 resource name of the node pool. + */ + // const name = 'abc123' + + // Imports the Edgecontainer library + const {EdgeContainerClient} = require('@google-cloud/edgecontainer').v1; + + // Instantiates a client + const edgecontainerClient = new EdgeContainerClient(); + + async function callGetNodePool() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await edgecontainerClient.getNodePool(request); + console.log(response); + } + + callGetNodePool(); + // [END edgecontainer_v1_generated_EdgeContainer_GetNodePool_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-edgecontainer/samples/generated/v1/edge_container.get_vpn_connection.js b/packages/google-cloud-edgecontainer/samples/generated/v1/edge_container.get_vpn_connection.js new file mode 100644 index 00000000000..1495b9d1ab5 --- /dev/null +++ b/packages/google-cloud-edgecontainer/samples/generated/v1/edge_container.get_vpn_connection.js @@ -0,0 +1,61 @@ +// Copyright 2023 Google LLC +// +// Licensed under the Apache License, Version 2.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 edgecontainer_v1_generated_EdgeContainer_GetVpnConnection_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 resource name of the vpn connection. + */ + // const name = 'abc123' + + // Imports the Edgecontainer library + const {EdgeContainerClient} = require('@google-cloud/edgecontainer').v1; + + // Instantiates a client + const edgecontainerClient = new EdgeContainerClient(); + + async function callGetVpnConnection() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await edgecontainerClient.getVpnConnection(request); + console.log(response); + } + + callGetVpnConnection(); + // [END edgecontainer_v1_generated_EdgeContainer_GetVpnConnection_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-edgecontainer/samples/generated/v1/edge_container.list_clusters.js b/packages/google-cloud-edgecontainer/samples/generated/v1/edge_container.list_clusters.js new file mode 100644 index 00000000000..47a3a98909e --- /dev/null +++ b/packages/google-cloud-edgecontainer/samples/generated/v1/edge_container.list_clusters.js @@ -0,0 +1,80 @@ +// Copyright 2023 Google LLC +// +// Licensed under the Apache License, Version 2.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 edgecontainer_v1_generated_EdgeContainer_ListClusters_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 location, which owns this collection of clusters. + */ + // const parent = 'abc123' + /** + * The maximum number of resources to list. + */ + // const pageSize = 1234 + /** + * A page token received from previous list request. + * A page token received from previous list request. + */ + // const pageToken = 'abc123' + /** + * Only resources matching this filter will be listed. + */ + // const filter = 'abc123' + /** + * Specifies the order in which resources will be listed. + */ + // const orderBy = 'abc123' + + // Imports the Edgecontainer library + const {EdgeContainerClient} = require('@google-cloud/edgecontainer').v1; + + // Instantiates a client + const edgecontainerClient = new EdgeContainerClient(); + + async function callListClusters() { + // Construct request + const request = { + parent, + }; + + // Run request + const iterable = await edgecontainerClient.listClustersAsync(request); + for await (const response of iterable) { + console.log(response); + } + } + + callListClusters(); + // [END edgecontainer_v1_generated_EdgeContainer_ListClusters_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-edgecontainer/samples/generated/v1/edge_container.list_machines.js b/packages/google-cloud-edgecontainer/samples/generated/v1/edge_container.list_machines.js new file mode 100644 index 00000000000..200606d2e15 --- /dev/null +++ b/packages/google-cloud-edgecontainer/samples/generated/v1/edge_container.list_machines.js @@ -0,0 +1,79 @@ +// Copyright 2023 Google LLC +// +// Licensed under the Apache License, Version 2.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 edgecontainer_v1_generated_EdgeContainer_ListMachines_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 site, which owns this collection of machines. + */ + // const parent = 'abc123' + /** + * The maximum number of resources to list. + */ + // const pageSize = 1234 + /** + * A page token received from previous list request. + */ + // const pageToken = 'abc123' + /** + * Only resources matching this filter will be listed. + */ + // const filter = 'abc123' + /** + * Specifies the order in which resources will be listed. + */ + // const orderBy = 'abc123' + + // Imports the Edgecontainer library + const {EdgeContainerClient} = require('@google-cloud/edgecontainer').v1; + + // Instantiates a client + const edgecontainerClient = new EdgeContainerClient(); + + async function callListMachines() { + // Construct request + const request = { + parent, + }; + + // Run request + const iterable = await edgecontainerClient.listMachinesAsync(request); + for await (const response of iterable) { + console.log(response); + } + } + + callListMachines(); + // [END edgecontainer_v1_generated_EdgeContainer_ListMachines_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-edgecontainer/samples/generated/v1/edge_container.list_node_pools.js b/packages/google-cloud-edgecontainer/samples/generated/v1/edge_container.list_node_pools.js new file mode 100644 index 00000000000..50f04f894d4 --- /dev/null +++ b/packages/google-cloud-edgecontainer/samples/generated/v1/edge_container.list_node_pools.js @@ -0,0 +1,79 @@ +// Copyright 2023 Google LLC +// +// Licensed under the Apache License, Version 2.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 edgecontainer_v1_generated_EdgeContainer_ListNodePools_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 cluster, which owns this collection of node pools. + */ + // const parent = 'abc123' + /** + * The maximum number of resources to list. + */ + // const pageSize = 1234 + /** + * A page token received from previous list request. + */ + // const pageToken = 'abc123' + /** + * Only resources matching this filter will be listed. + */ + // const filter = 'abc123' + /** + * Specifies the order in which resources will be listed. + */ + // const orderBy = 'abc123' + + // Imports the Edgecontainer library + const {EdgeContainerClient} = require('@google-cloud/edgecontainer').v1; + + // Instantiates a client + const edgecontainerClient = new EdgeContainerClient(); + + async function callListNodePools() { + // Construct request + const request = { + parent, + }; + + // Run request + const iterable = await edgecontainerClient.listNodePoolsAsync(request); + for await (const response of iterable) { + console.log(response); + } + } + + callListNodePools(); + // [END edgecontainer_v1_generated_EdgeContainer_ListNodePools_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-edgecontainer/samples/generated/v1/edge_container.list_vpn_connections.js b/packages/google-cloud-edgecontainer/samples/generated/v1/edge_container.list_vpn_connections.js new file mode 100644 index 00000000000..7f25575b88f --- /dev/null +++ b/packages/google-cloud-edgecontainer/samples/generated/v1/edge_container.list_vpn_connections.js @@ -0,0 +1,79 @@ +// Copyright 2023 Google LLC +// +// Licensed under the Apache License, Version 2.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 edgecontainer_v1_generated_EdgeContainer_ListVpnConnections_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 location, which owns this collection of VPN connections. + */ + // const parent = 'abc123' + /** + * The maximum number of resources to list. + */ + // const pageSize = 1234 + /** + * A page token received from previous list request. + */ + // const pageToken = 'abc123' + /** + * Only resources matching this filter will be listed. + */ + // const filter = 'abc123' + /** + * Specifies the order in which resources will be listed. + */ + // const orderBy = 'abc123' + + // Imports the Edgecontainer library + const {EdgeContainerClient} = require('@google-cloud/edgecontainer').v1; + + // Instantiates a client + const edgecontainerClient = new EdgeContainerClient(); + + async function callListVpnConnections() { + // Construct request + const request = { + parent, + }; + + // Run request + const iterable = await edgecontainerClient.listVpnConnectionsAsync(request); + for await (const response of iterable) { + console.log(response); + } + } + + callListVpnConnections(); + // [END edgecontainer_v1_generated_EdgeContainer_ListVpnConnections_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-edgecontainer/samples/generated/v1/edge_container.update_cluster.js b/packages/google-cloud-edgecontainer/samples/generated/v1/edge_container.update_cluster.js new file mode 100644 index 00000000000..c2ed546695d --- /dev/null +++ b/packages/google-cloud-edgecontainer/samples/generated/v1/edge_container.update_cluster.js @@ -0,0 +1,75 @@ +// Copyright 2023 Google LLC +// +// Licensed under the Apache License, Version 2.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 edgecontainer_v1_generated_EdgeContainer_UpdateCluster_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. + */ + /** + * Field mask is used to specify the fields to be overwritten in the + * Cluster resource by the update. + * The fields specified in the update_mask are relative to the resource, not + * the full request. A field will be overwritten if it is in the mask. If the + * user does not provide a mask then all fields will be overwritten. + */ + // const updateMask = {} + /** + * The updated cluster. + */ + // const cluster = {} + /** + * A unique identifier for this request. Restricted to 36 ASCII characters. + * A random UUID is recommended. + * This request is only idempotent if `request_id` is provided. + */ + // const requestId = 'abc123' + + // Imports the Edgecontainer library + const {EdgeContainerClient} = require('@google-cloud/edgecontainer').v1; + + // Instantiates a client + const edgecontainerClient = new EdgeContainerClient(); + + async function callUpdateCluster() { + // Construct request + const request = { + }; + + // Run request + const [operation] = await edgecontainerClient.updateCluster(request); + const [response] = await operation.promise(); + console.log(response); + } + + callUpdateCluster(); + // [END edgecontainer_v1_generated_EdgeContainer_UpdateCluster_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-edgecontainer/samples/generated/v1/edge_container.update_node_pool.js b/packages/google-cloud-edgecontainer/samples/generated/v1/edge_container.update_node_pool.js new file mode 100644 index 00000000000..518c5d35266 --- /dev/null +++ b/packages/google-cloud-edgecontainer/samples/generated/v1/edge_container.update_node_pool.js @@ -0,0 +1,75 @@ +// Copyright 2023 Google LLC +// +// Licensed under the Apache License, Version 2.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 edgecontainer_v1_generated_EdgeContainer_UpdateNodePool_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. + */ + /** + * Field mask is used to specify the fields to be overwritten in the + * NodePool resource by the update. + * The fields specified in the update_mask are relative to the resource, not + * the full request. A field will be overwritten if it is in the mask. If the + * user does not provide a mask then all fields will be overwritten. + */ + // const updateMask = {} + /** + * The updated node pool. + */ + // const nodePool = {} + /** + * A unique identifier for this request. Restricted to 36 ASCII characters. A + * random UUID is recommended. This request is only idempotent if + * `request_id` is provided. + */ + // const requestId = 'abc123' + + // Imports the Edgecontainer library + const {EdgeContainerClient} = require('@google-cloud/edgecontainer').v1; + + // Instantiates a client + const edgecontainerClient = new EdgeContainerClient(); + + async function callUpdateNodePool() { + // Construct request + const request = { + }; + + // Run request + const [operation] = await edgecontainerClient.updateNodePool(request); + const [response] = await operation.promise(); + console.log(response); + } + + callUpdateNodePool(); + // [END edgecontainer_v1_generated_EdgeContainer_UpdateNodePool_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-edgecontainer/samples/generated/v1/snippet_metadata_google.cloud.edgecontainer.v1.json b/packages/google-cloud-edgecontainer/samples/generated/v1/snippet_metadata_google.cloud.edgecontainer.v1.json new file mode 100644 index 00000000000..4603397f8fc --- /dev/null +++ b/packages/google-cloud-edgecontainer/samples/generated/v1/snippet_metadata_google.cloud.edgecontainer.v1.json @@ -0,0 +1,823 @@ +{ + "clientLibrary": { + "name": "nodejs-edgecontainer", + "version": "0.1.0", + "language": "TYPESCRIPT", + "apis": [ + { + "id": "google.cloud.edgecontainer.v1", + "version": "v1" + } + ] + }, + "snippets": [ + { + "regionTag": "edgecontainer_v1_generated_EdgeContainer_ListClusters_async", + "title": "EdgeContainer listClusters Sample", + "origin": "API_DEFINITION", + "description": " Lists Clusters in a given project and location.", + "canonical": true, + "file": "edge_container.list_clusters.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 72, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "ListClusters", + "fullName": "google.cloud.edgecontainer.v1.EdgeContainer.ListClusters", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "page_size", + "type": "TYPE_INT32" + }, + { + "name": "page_token", + "type": "TYPE_STRING" + }, + { + "name": "filter", + "type": "TYPE_STRING" + }, + { + "name": "order_by", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.edgecontainer.v1.ListClustersResponse", + "client": { + "shortName": "EdgeContainerClient", + "fullName": "google.cloud.edgecontainer.v1.EdgeContainerClient" + }, + "method": { + "shortName": "ListClusters", + "fullName": "google.cloud.edgecontainer.v1.EdgeContainer.ListClusters", + "service": { + "shortName": "EdgeContainer", + "fullName": "google.cloud.edgecontainer.v1.EdgeContainer" + } + } + } + }, + { + "regionTag": "edgecontainer_v1_generated_EdgeContainer_GetCluster_async", + "title": "EdgeContainer getCluster Sample", + "origin": "API_DEFINITION", + "description": " Gets details of a single Cluster.", + "canonical": true, + "file": "edge_container.get_cluster.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 53, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "GetCluster", + "fullName": "google.cloud.edgecontainer.v1.EdgeContainer.GetCluster", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.edgecontainer.v1.Cluster", + "client": { + "shortName": "EdgeContainerClient", + "fullName": "google.cloud.edgecontainer.v1.EdgeContainerClient" + }, + "method": { + "shortName": "GetCluster", + "fullName": "google.cloud.edgecontainer.v1.EdgeContainer.GetCluster", + "service": { + "shortName": "EdgeContainer", + "fullName": "google.cloud.edgecontainer.v1.EdgeContainer" + } + } + } + }, + { + "regionTag": "edgecontainer_v1_generated_EdgeContainer_CreateCluster_async", + "title": "EdgeContainer createCluster Sample", + "origin": "API_DEFINITION", + "description": " Creates a new Cluster in a given project and location.", + "canonical": true, + "file": "edge_container.create_cluster.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 70, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "CreateCluster", + "fullName": "google.cloud.edgecontainer.v1.EdgeContainer.CreateCluster", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "cluster_id", + "type": "TYPE_STRING" + }, + { + "name": "cluster", + "type": ".google.cloud.edgecontainer.v1.Cluster" + }, + { + "name": "request_id", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "EdgeContainerClient", + "fullName": "google.cloud.edgecontainer.v1.EdgeContainerClient" + }, + "method": { + "shortName": "CreateCluster", + "fullName": "google.cloud.edgecontainer.v1.EdgeContainer.CreateCluster", + "service": { + "shortName": "EdgeContainer", + "fullName": "google.cloud.edgecontainer.v1.EdgeContainer" + } + } + } + }, + { + "regionTag": "edgecontainer_v1_generated_EdgeContainer_UpdateCluster_async", + "title": "EdgeContainer updateCluster Sample", + "origin": "API_DEFINITION", + "description": " Updates the parameters of a single Cluster.", + "canonical": true, + "file": "edge_container.update_cluster.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 67, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "UpdateCluster", + "fullName": "google.cloud.edgecontainer.v1.EdgeContainer.UpdateCluster", + "async": true, + "parameters": [ + { + "name": "update_mask", + "type": ".google.protobuf.FieldMask" + }, + { + "name": "cluster", + "type": ".google.cloud.edgecontainer.v1.Cluster" + }, + { + "name": "request_id", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "EdgeContainerClient", + "fullName": "google.cloud.edgecontainer.v1.EdgeContainerClient" + }, + "method": { + "shortName": "UpdateCluster", + "fullName": "google.cloud.edgecontainer.v1.EdgeContainer.UpdateCluster", + "service": { + "shortName": "EdgeContainer", + "fullName": "google.cloud.edgecontainer.v1.EdgeContainer" + } + } + } + }, + { + "regionTag": "edgecontainer_v1_generated_EdgeContainer_DeleteCluster_async", + "title": "EdgeContainer deleteCluster Sample", + "origin": "API_DEFINITION", + "description": " Deletes a single Cluster.", + "canonical": true, + "file": "edge_container.delete_cluster.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 60, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "DeleteCluster", + "fullName": "google.cloud.edgecontainer.v1.EdgeContainer.DeleteCluster", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + }, + { + "name": "request_id", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "EdgeContainerClient", + "fullName": "google.cloud.edgecontainer.v1.EdgeContainerClient" + }, + "method": { + "shortName": "DeleteCluster", + "fullName": "google.cloud.edgecontainer.v1.EdgeContainer.DeleteCluster", + "service": { + "shortName": "EdgeContainer", + "fullName": "google.cloud.edgecontainer.v1.EdgeContainer" + } + } + } + }, + { + "regionTag": "edgecontainer_v1_generated_EdgeContainer_GenerateAccessToken_async", + "title": "EdgeContainer generateAccessToken Sample", + "origin": "API_DEFINITION", + "description": " Generates an access token for a Cluster.", + "canonical": true, + "file": "edge_container.generate_access_token.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 53, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "GenerateAccessToken", + "fullName": "google.cloud.edgecontainer.v1.EdgeContainer.GenerateAccessToken", + "async": true, + "parameters": [ + { + "name": "cluster", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.edgecontainer.v1.GenerateAccessTokenResponse", + "client": { + "shortName": "EdgeContainerClient", + "fullName": "google.cloud.edgecontainer.v1.EdgeContainerClient" + }, + "method": { + "shortName": "GenerateAccessToken", + "fullName": "google.cloud.edgecontainer.v1.EdgeContainer.GenerateAccessToken", + "service": { + "shortName": "EdgeContainer", + "fullName": "google.cloud.edgecontainer.v1.EdgeContainer" + } + } + } + }, + { + "regionTag": "edgecontainer_v1_generated_EdgeContainer_ListNodePools_async", + "title": "EdgeContainer listNodePools Sample", + "origin": "API_DEFINITION", + "description": " Lists NodePools in a given project and location.", + "canonical": true, + "file": "edge_container.list_node_pools.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 71, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "ListNodePools", + "fullName": "google.cloud.edgecontainer.v1.EdgeContainer.ListNodePools", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "page_size", + "type": "TYPE_INT32" + }, + { + "name": "page_token", + "type": "TYPE_STRING" + }, + { + "name": "filter", + "type": "TYPE_STRING" + }, + { + "name": "order_by", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.edgecontainer.v1.ListNodePoolsResponse", + "client": { + "shortName": "EdgeContainerClient", + "fullName": "google.cloud.edgecontainer.v1.EdgeContainerClient" + }, + "method": { + "shortName": "ListNodePools", + "fullName": "google.cloud.edgecontainer.v1.EdgeContainer.ListNodePools", + "service": { + "shortName": "EdgeContainer", + "fullName": "google.cloud.edgecontainer.v1.EdgeContainer" + } + } + } + }, + { + "regionTag": "edgecontainer_v1_generated_EdgeContainer_GetNodePool_async", + "title": "EdgeContainer getNodePool Sample", + "origin": "API_DEFINITION", + "description": " Gets details of a single NodePool.", + "canonical": true, + "file": "edge_container.get_node_pool.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 53, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "GetNodePool", + "fullName": "google.cloud.edgecontainer.v1.EdgeContainer.GetNodePool", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.edgecontainer.v1.NodePool", + "client": { + "shortName": "EdgeContainerClient", + "fullName": "google.cloud.edgecontainer.v1.EdgeContainerClient" + }, + "method": { + "shortName": "GetNodePool", + "fullName": "google.cloud.edgecontainer.v1.EdgeContainer.GetNodePool", + "service": { + "shortName": "EdgeContainer", + "fullName": "google.cloud.edgecontainer.v1.EdgeContainer" + } + } + } + }, + { + "regionTag": "edgecontainer_v1_generated_EdgeContainer_CreateNodePool_async", + "title": "EdgeContainer createNodePool Sample", + "origin": "API_DEFINITION", + "description": " Creates a new NodePool in a given project and location.", + "canonical": true, + "file": "edge_container.create_node_pool.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 70, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "CreateNodePool", + "fullName": "google.cloud.edgecontainer.v1.EdgeContainer.CreateNodePool", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "node_pool_id", + "type": "TYPE_STRING" + }, + { + "name": "node_pool", + "type": ".google.cloud.edgecontainer.v1.NodePool" + }, + { + "name": "request_id", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "EdgeContainerClient", + "fullName": "google.cloud.edgecontainer.v1.EdgeContainerClient" + }, + "method": { + "shortName": "CreateNodePool", + "fullName": "google.cloud.edgecontainer.v1.EdgeContainer.CreateNodePool", + "service": { + "shortName": "EdgeContainer", + "fullName": "google.cloud.edgecontainer.v1.EdgeContainer" + } + } + } + }, + { + "regionTag": "edgecontainer_v1_generated_EdgeContainer_UpdateNodePool_async", + "title": "EdgeContainer updateNodePool Sample", + "origin": "API_DEFINITION", + "description": " Updates the parameters of a single NodePool.", + "canonical": true, + "file": "edge_container.update_node_pool.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 67, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "UpdateNodePool", + "fullName": "google.cloud.edgecontainer.v1.EdgeContainer.UpdateNodePool", + "async": true, + "parameters": [ + { + "name": "update_mask", + "type": ".google.protobuf.FieldMask" + }, + { + "name": "node_pool", + "type": ".google.cloud.edgecontainer.v1.NodePool" + }, + { + "name": "request_id", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "EdgeContainerClient", + "fullName": "google.cloud.edgecontainer.v1.EdgeContainerClient" + }, + "method": { + "shortName": "UpdateNodePool", + "fullName": "google.cloud.edgecontainer.v1.EdgeContainer.UpdateNodePool", + "service": { + "shortName": "EdgeContainer", + "fullName": "google.cloud.edgecontainer.v1.EdgeContainer" + } + } + } + }, + { + "regionTag": "edgecontainer_v1_generated_EdgeContainer_DeleteNodePool_async", + "title": "EdgeContainer deleteNodePool Sample", + "origin": "API_DEFINITION", + "description": " Deletes a single NodePool.", + "canonical": true, + "file": "edge_container.delete_node_pool.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 60, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "DeleteNodePool", + "fullName": "google.cloud.edgecontainer.v1.EdgeContainer.DeleteNodePool", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + }, + { + "name": "request_id", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "EdgeContainerClient", + "fullName": "google.cloud.edgecontainer.v1.EdgeContainerClient" + }, + "method": { + "shortName": "DeleteNodePool", + "fullName": "google.cloud.edgecontainer.v1.EdgeContainer.DeleteNodePool", + "service": { + "shortName": "EdgeContainer", + "fullName": "google.cloud.edgecontainer.v1.EdgeContainer" + } + } + } + }, + { + "regionTag": "edgecontainer_v1_generated_EdgeContainer_ListMachines_async", + "title": "EdgeContainer listMachines Sample", + "origin": "API_DEFINITION", + "description": " Lists Machines in a given project and location.", + "canonical": true, + "file": "edge_container.list_machines.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 71, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "ListMachines", + "fullName": "google.cloud.edgecontainer.v1.EdgeContainer.ListMachines", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "page_size", + "type": "TYPE_INT32" + }, + { + "name": "page_token", + "type": "TYPE_STRING" + }, + { + "name": "filter", + "type": "TYPE_STRING" + }, + { + "name": "order_by", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.edgecontainer.v1.ListMachinesResponse", + "client": { + "shortName": "EdgeContainerClient", + "fullName": "google.cloud.edgecontainer.v1.EdgeContainerClient" + }, + "method": { + "shortName": "ListMachines", + "fullName": "google.cloud.edgecontainer.v1.EdgeContainer.ListMachines", + "service": { + "shortName": "EdgeContainer", + "fullName": "google.cloud.edgecontainer.v1.EdgeContainer" + } + } + } + }, + { + "regionTag": "edgecontainer_v1_generated_EdgeContainer_GetMachine_async", + "title": "EdgeContainer getMachine Sample", + "origin": "API_DEFINITION", + "description": " Gets details of a single Machine.", + "canonical": true, + "file": "edge_container.get_machine.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 53, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "GetMachine", + "fullName": "google.cloud.edgecontainer.v1.EdgeContainer.GetMachine", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.edgecontainer.v1.Machine", + "client": { + "shortName": "EdgeContainerClient", + "fullName": "google.cloud.edgecontainer.v1.EdgeContainerClient" + }, + "method": { + "shortName": "GetMachine", + "fullName": "google.cloud.edgecontainer.v1.EdgeContainer.GetMachine", + "service": { + "shortName": "EdgeContainer", + "fullName": "google.cloud.edgecontainer.v1.EdgeContainer" + } + } + } + }, + { + "regionTag": "edgecontainer_v1_generated_EdgeContainer_ListVpnConnections_async", + "title": "EdgeContainer listVpnConnections Sample", + "origin": "API_DEFINITION", + "description": " Lists VPN connections in a given project and location.", + "canonical": true, + "file": "edge_container.list_vpn_connections.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 71, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "ListVpnConnections", + "fullName": "google.cloud.edgecontainer.v1.EdgeContainer.ListVpnConnections", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "page_size", + "type": "TYPE_INT32" + }, + { + "name": "page_token", + "type": "TYPE_STRING" + }, + { + "name": "filter", + "type": "TYPE_STRING" + }, + { + "name": "order_by", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.edgecontainer.v1.ListVpnConnectionsResponse", + "client": { + "shortName": "EdgeContainerClient", + "fullName": "google.cloud.edgecontainer.v1.EdgeContainerClient" + }, + "method": { + "shortName": "ListVpnConnections", + "fullName": "google.cloud.edgecontainer.v1.EdgeContainer.ListVpnConnections", + "service": { + "shortName": "EdgeContainer", + "fullName": "google.cloud.edgecontainer.v1.EdgeContainer" + } + } + } + }, + { + "regionTag": "edgecontainer_v1_generated_EdgeContainer_GetVpnConnection_async", + "title": "EdgeContainer getVpnConnection Sample", + "origin": "API_DEFINITION", + "description": " Gets details of a single VPN connection.", + "canonical": true, + "file": "edge_container.get_vpn_connection.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 53, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "GetVpnConnection", + "fullName": "google.cloud.edgecontainer.v1.EdgeContainer.GetVpnConnection", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.edgecontainer.v1.VpnConnection", + "client": { + "shortName": "EdgeContainerClient", + "fullName": "google.cloud.edgecontainer.v1.EdgeContainerClient" + }, + "method": { + "shortName": "GetVpnConnection", + "fullName": "google.cloud.edgecontainer.v1.EdgeContainer.GetVpnConnection", + "service": { + "shortName": "EdgeContainer", + "fullName": "google.cloud.edgecontainer.v1.EdgeContainer" + } + } + } + }, + { + "regionTag": "edgecontainer_v1_generated_EdgeContainer_CreateVpnConnection_async", + "title": "EdgeContainer createVpnConnection Sample", + "origin": "API_DEFINITION", + "description": " Creates a new VPN connection in a given project and location.", + "canonical": true, + "file": "edge_container.create_vpn_connection.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 70, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "CreateVpnConnection", + "fullName": "google.cloud.edgecontainer.v1.EdgeContainer.CreateVpnConnection", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "vpn_connection_id", + "type": "TYPE_STRING" + }, + { + "name": "vpn_connection", + "type": ".google.cloud.edgecontainer.v1.VpnConnection" + }, + { + "name": "request_id", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "EdgeContainerClient", + "fullName": "google.cloud.edgecontainer.v1.EdgeContainerClient" + }, + "method": { + "shortName": "CreateVpnConnection", + "fullName": "google.cloud.edgecontainer.v1.EdgeContainer.CreateVpnConnection", + "service": { + "shortName": "EdgeContainer", + "fullName": "google.cloud.edgecontainer.v1.EdgeContainer" + } + } + } + }, + { + "regionTag": "edgecontainer_v1_generated_EdgeContainer_DeleteVpnConnection_async", + "title": "EdgeContainer deleteVpnConnection Sample", + "origin": "API_DEFINITION", + "description": " Deletes a single VPN connection.", + "canonical": true, + "file": "edge_container.delete_vpn_connection.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 60, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "DeleteVpnConnection", + "fullName": "google.cloud.edgecontainer.v1.EdgeContainer.DeleteVpnConnection", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + }, + { + "name": "request_id", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "EdgeContainerClient", + "fullName": "google.cloud.edgecontainer.v1.EdgeContainerClient" + }, + "method": { + "shortName": "DeleteVpnConnection", + "fullName": "google.cloud.edgecontainer.v1.EdgeContainer.DeleteVpnConnection", + "service": { + "shortName": "EdgeContainer", + "fullName": "google.cloud.edgecontainer.v1.EdgeContainer" + } + } + } + } + ] +} \ No newline at end of file diff --git a/packages/google-cloud-edgecontainer/samples/package.json b/packages/google-cloud-edgecontainer/samples/package.json new file mode 100644 index 00000000000..5f412f41071 --- /dev/null +++ b/packages/google-cloud-edgecontainer/samples/package.json @@ -0,0 +1,24 @@ +{ + "name": "edgecontainer-samples", + "private": true, + "license": "Apache-2.0", + "author": "Google LLC", + "engines": { + "node": ">=14.0.0" + }, + "files": [ + "*.js" + ], + "scripts": { + "test": "c8 mocha --timeout 600000 test/*.js", + "publish": "echo 'sample test; do not publish'" + }, + "dependencies": { + "@google-cloud/edgecontainer": "^0.1.0" + }, + "devDependencies": { + "c8": "^8.0.0", + "chai": "^4.2.0", + "mocha": "^8.0.0" + } +} diff --git a/packages/google-cloud-edgecontainer/samples/quickstart.js b/packages/google-cloud-edgecontainer/samples/quickstart.js new file mode 100644 index 00000000000..81550c9315c --- /dev/null +++ b/packages/google-cloud-edgecontainer/samples/quickstart.js @@ -0,0 +1,78 @@ +// Copyright 2023 Google LLC +// +// Licensed under the Apache License, Version 2.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 edgecontainer_quickstart] + /** + * 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 location, which owns this collection of clusters. + */ + // const parent = 'abc123' + /** + * The maximum number of resources to list. + */ + // const pageSize = 1234 + /** + * A page token received from previous list request. + * A page token received from previous list request. + */ + // const pageToken = 'abc123' + /** + * Only resources matching this filter will be listed. + */ + // const filter = 'abc123' + /** + * Specifies the order in which resources will be listed. + */ + // const orderBy = 'abc123' + + // Imports the Edgecontainer library + const {EdgeContainerClient} = require('@google-cloud/edgecontainer').v1; + + // Instantiates a client + const edgecontainerClient = new EdgeContainerClient(); + + async function callListClusters() { + // Construct request + const request = { + parent, + }; + + // Run request + const iterable = await edgecontainerClient.listClustersAsync(request); + for await (const response of iterable) { + console.log(response); + } + } + + callListClusters(); + // [END edgecontainer_quickstart] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-edgecontainer/samples/test/quickstart.js b/packages/google-cloud-edgecontainer/samples/test/quickstart.js new file mode 100644 index 00000000000..359a636fef1 --- /dev/null +++ b/packages/google-cloud-edgecontainer/samples/test/quickstart.js @@ -0,0 +1,42 @@ +// Copyright 2023 Google LLC +// +// Licensed under the Apache License, Version 2.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. + +'use strict'; + +const assert = require('assert'); +const path = require('path'); +const cp = require('child_process'); +const {describe, it, before} = require('mocha'); +const {EdgeContainerClient} = require('@google-cloud/edgecontainer').v1; +const edgecontainerClient = new EdgeContainerClient(); + +const execSync = cmd => cp.execSync(cmd, {encoding: 'utf-8'}); + +const cwd = path.join(__dirname, '..'); + +describe('Quickstart', () => { + let projectId; + + before(async () => { + projectId = await edgecontainerClient.getProjectId(); + }); + + it('should run quickstart', async () => { + const output = execSync( + `node ./quickstart.js projects/${projectId}/locations/us-central1`, + {cwd} + ); + assert(output !== null); + }); +}); diff --git a/packages/google-cloud-edgecontainer/src/index.ts b/packages/google-cloud-edgecontainer/src/index.ts new file mode 100644 index 00000000000..24beea5f476 --- /dev/null +++ b/packages/google-cloud-edgecontainer/src/index.ts @@ -0,0 +1,27 @@ +// Copyright 2023 Google LLC +// +// Licensed under the Apache License, Version 2.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. ** + +import * as v1 from './v1'; + +const EdgeContainerClient = v1.EdgeContainerClient; +type EdgeContainerClient = v1.EdgeContainerClient; + +export {v1, EdgeContainerClient}; +export default {v1, EdgeContainerClient}; +import * as protos from '../protos/protos'; +export {protos}; diff --git a/packages/google-cloud-edgecontainer/src/v1/edge_container_client.ts b/packages/google-cloud-edgecontainer/src/v1/edge_container_client.ts new file mode 100644 index 00000000000..54dcfb0a153 --- /dev/null +++ b/packages/google-cloud-edgecontainer/src/v1/edge_container_client.ts @@ -0,0 +1,3470 @@ +// Copyright 2023 Google LLC +// +// Licensed under the Apache License, Version 2.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} from 'stream'; +import * as protos from '../../protos/protos'; +import jsonProtos = require('../../protos/protos.json'); +/** + * Client JSON configuration object, loaded from + * `src/v1/edge_container_client_config.json`. + * This file defines retry strategy and timeouts for all API methods in this library. + */ +import * as gapicConfig from './edge_container_client_config.json'; +const version = require('../../../package.json').version; + +/** + * EdgeContainer API provides management of Kubernetes Clusters on Google Edge + * Cloud deployments. + * @class + * @memberof v1 + */ +export class EdgeContainerClient { + 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}; + 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; + edgeContainerStub?: Promise<{[name: string]: Function}>; + + /** + * Construct an instance of EdgeContainerClient. + * + * @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://developers.google.com/identity/protocols/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 EdgeContainerClient({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 EdgeContainerClient; + const servicePath = + opts?.servicePath || opts?.apiEndpoint || staticMembers.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 !== staticMembers.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 = staticMembers.servicePath; + + // Set the default scopes in auth client if needed. + if (servicePath === staticMembers.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 !== 'undefined' && '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 = { + clusterPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/clusters/{cluster}' + ), + locationPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}' + ), + machinePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/machines/{machine}' + ), + nodePoolPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/clusters/{cluster}/nodePools/{node_pool}' + ), + projectPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}' + ), + vpnConnectionPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/vpnConnections/{vpn_connection}' + ), + }; + + // 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 = { + listClusters: new this._gaxModule.PageDescriptor( + 'pageToken', + 'nextPageToken', + 'clusters' + ), + listNodePools: new this._gaxModule.PageDescriptor( + 'pageToken', + 'nextPageToken', + 'nodePools' + ), + listMachines: new this._gaxModule.PageDescriptor( + 'pageToken', + 'nextPageToken', + 'machines' + ), + listVpnConnections: new this._gaxModule.PageDescriptor( + 'pageToken', + 'nextPageToken', + 'vpnConnections' + ), + }; + + const protoFilesRoot = this._gaxModule.protobuf.Root.fromJSON(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: '/v1/{name=projects/*/locations/*}', + }, + { + selector: 'google.cloud.location.Locations.ListLocations', + get: '/v1/{name=projects/*}/locations', + }, + { + selector: 'google.longrunning.Operations.CancelOperation', + post: '/v1/{name=projects/*/locations/*/operations/*}:cancel', + body: '*', + }, + { + selector: 'google.longrunning.Operations.DeleteOperation', + delete: '/v1/{name=projects/*/locations/*/operations/*}', + }, + { + selector: 'google.longrunning.Operations.GetOperation', + get: '/v1/{name=projects/*/locations/*/operations/*}', + }, + { + selector: 'google.longrunning.Operations.ListOperations', + get: '/v1/{name=projects/*/locations/*}/operations', + }, + ]; + } + this.operationsClient = this._gaxModule + .lro(lroOptions) + .operationsClient(opts); + const createClusterResponse = protoFilesRoot.lookup( + '.google.cloud.edgecontainer.v1.Cluster' + ) as gax.protobuf.Type; + const createClusterMetadata = protoFilesRoot.lookup( + '.google.cloud.edgecontainer.v1.OperationMetadata' + ) as gax.protobuf.Type; + const updateClusterResponse = protoFilesRoot.lookup( + '.google.cloud.edgecontainer.v1.Cluster' + ) as gax.protobuf.Type; + const updateClusterMetadata = protoFilesRoot.lookup( + '.google.cloud.edgecontainer.v1.OperationMetadata' + ) as gax.protobuf.Type; + const deleteClusterResponse = protoFilesRoot.lookup( + '.google.protobuf.Empty' + ) as gax.protobuf.Type; + const deleteClusterMetadata = protoFilesRoot.lookup( + '.google.cloud.edgecontainer.v1.OperationMetadata' + ) as gax.protobuf.Type; + const createNodePoolResponse = protoFilesRoot.lookup( + '.google.cloud.edgecontainer.v1.NodePool' + ) as gax.protobuf.Type; + const createNodePoolMetadata = protoFilesRoot.lookup( + '.google.cloud.edgecontainer.v1.OperationMetadata' + ) as gax.protobuf.Type; + const updateNodePoolResponse = protoFilesRoot.lookup( + '.google.cloud.edgecontainer.v1.NodePool' + ) as gax.protobuf.Type; + const updateNodePoolMetadata = protoFilesRoot.lookup( + '.google.cloud.edgecontainer.v1.OperationMetadata' + ) as gax.protobuf.Type; + const deleteNodePoolResponse = protoFilesRoot.lookup( + '.google.protobuf.Empty' + ) as gax.protobuf.Type; + const deleteNodePoolMetadata = protoFilesRoot.lookup( + '.google.cloud.edgecontainer.v1.OperationMetadata' + ) as gax.protobuf.Type; + const createVpnConnectionResponse = protoFilesRoot.lookup( + '.google.cloud.edgecontainer.v1.VpnConnection' + ) as gax.protobuf.Type; + const createVpnConnectionMetadata = protoFilesRoot.lookup( + '.google.cloud.edgecontainer.v1.OperationMetadata' + ) as gax.protobuf.Type; + const deleteVpnConnectionResponse = protoFilesRoot.lookup( + '.google.protobuf.Empty' + ) as gax.protobuf.Type; + const deleteVpnConnectionMetadata = protoFilesRoot.lookup( + '.google.cloud.edgecontainer.v1.OperationMetadata' + ) as gax.protobuf.Type; + + this.descriptors.longrunning = { + createCluster: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + createClusterResponse.decode.bind(createClusterResponse), + createClusterMetadata.decode.bind(createClusterMetadata) + ), + updateCluster: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + updateClusterResponse.decode.bind(updateClusterResponse), + updateClusterMetadata.decode.bind(updateClusterMetadata) + ), + deleteCluster: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + deleteClusterResponse.decode.bind(deleteClusterResponse), + deleteClusterMetadata.decode.bind(deleteClusterMetadata) + ), + createNodePool: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + createNodePoolResponse.decode.bind(createNodePoolResponse), + createNodePoolMetadata.decode.bind(createNodePoolMetadata) + ), + updateNodePool: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + updateNodePoolResponse.decode.bind(updateNodePoolResponse), + updateNodePoolMetadata.decode.bind(updateNodePoolMetadata) + ), + deleteNodePool: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + deleteNodePoolResponse.decode.bind(deleteNodePoolResponse), + deleteNodePoolMetadata.decode.bind(deleteNodePoolMetadata) + ), + createVpnConnection: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + createVpnConnectionResponse.decode.bind(createVpnConnectionResponse), + createVpnConnectionMetadata.decode.bind(createVpnConnectionMetadata) + ), + deleteVpnConnection: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + deleteVpnConnectionResponse.decode.bind(deleteVpnConnectionResponse), + deleteVpnConnectionMetadata.decode.bind(deleteVpnConnectionMetadata) + ), + }; + + // Put together the default options sent with requests. + this._defaults = this._gaxGrpc.constructSettings( + 'google.cloud.edgecontainer.v1.EdgeContainer', + 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.edgeContainerStub) { + return this.edgeContainerStub; + } + + // Put together the "service stub" for + // google.cloud.edgecontainer.v1.EdgeContainer. + this.edgeContainerStub = this._gaxGrpc.createStub( + this._opts.fallback + ? (this._protos as protobuf.Root).lookupService( + 'google.cloud.edgecontainer.v1.EdgeContainer' + ) + : // eslint-disable-next-line @typescript-eslint/no-explicit-any + (this._protos as any).google.cloud.edgecontainer.v1.EdgeContainer, + 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 edgeContainerStubMethods = [ + 'listClusters', + 'getCluster', + 'createCluster', + 'updateCluster', + 'deleteCluster', + 'generateAccessToken', + 'listNodePools', + 'getNodePool', + 'createNodePool', + 'updateNodePool', + 'deleteNodePool', + 'listMachines', + 'getMachine', + 'listVpnConnections', + 'getVpnConnection', + 'createVpnConnection', + 'deleteVpnConnection', + ]; + for (const methodName of edgeContainerStubMethods) { + const callPromise = this.edgeContainerStub.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] || + this.descriptors.longrunning[methodName] || + undefined; + const apiCall = this._gaxModule.createApiCall( + callPromise, + this._defaults[methodName], + descriptor, + this._opts.fallback + ); + + this.innerApiCalls[methodName] = apiCall; + } + + return this.edgeContainerStub; + } + + /** + * The DNS address for this API service. + * @returns {string} The DNS address for this service. + */ + static get servicePath() { + return 'edgecontainer.googleapis.com'; + } + + /** + * The DNS address for this API service - same as servicePath(), + * exists for compatibility reasons. + * @returns {string} The DNS address for this service. + */ + static get apiEndpoint() { + return 'edgecontainer.googleapis.com'; + } + + /** + * 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 -- + // ------------------- + /** + * Gets details of a single Cluster. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The resource name of the cluster. + * @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.edgecontainer.v1.Cluster|Cluster}. + * 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/edge_container.get_cluster.js + * region_tag:edgecontainer_v1_generated_EdgeContainer_GetCluster_async + */ + getCluster( + request?: protos.google.cloud.edgecontainer.v1.IGetClusterRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.edgecontainer.v1.ICluster, + protos.google.cloud.edgecontainer.v1.IGetClusterRequest | undefined, + {} | undefined, + ] + >; + getCluster( + request: protos.google.cloud.edgecontainer.v1.IGetClusterRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.edgecontainer.v1.ICluster, + | protos.google.cloud.edgecontainer.v1.IGetClusterRequest + | null + | undefined, + {} | null | undefined + > + ): void; + getCluster( + request: protos.google.cloud.edgecontainer.v1.IGetClusterRequest, + callback: Callback< + protos.google.cloud.edgecontainer.v1.ICluster, + | protos.google.cloud.edgecontainer.v1.IGetClusterRequest + | null + | undefined, + {} | null | undefined + > + ): void; + getCluster( + request?: protos.google.cloud.edgecontainer.v1.IGetClusterRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.edgecontainer.v1.ICluster, + | protos.google.cloud.edgecontainer.v1.IGetClusterRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.edgecontainer.v1.ICluster, + | protos.google.cloud.edgecontainer.v1.IGetClusterRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.edgecontainer.v1.ICluster, + protos.google.cloud.edgecontainer.v1.IGetClusterRequest | 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(); + return this.innerApiCalls.getCluster(request, options, callback); + } + /** + * Generates an access token for a Cluster. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.cluster + * Required. The resource name of the cluster. + * @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.edgecontainer.v1.GenerateAccessTokenResponse|GenerateAccessTokenResponse}. + * 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/edge_container.generate_access_token.js + * region_tag:edgecontainer_v1_generated_EdgeContainer_GenerateAccessToken_async + */ + generateAccessToken( + request?: protos.google.cloud.edgecontainer.v1.IGenerateAccessTokenRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.edgecontainer.v1.IGenerateAccessTokenResponse, + ( + | protos.google.cloud.edgecontainer.v1.IGenerateAccessTokenRequest + | undefined + ), + {} | undefined, + ] + >; + generateAccessToken( + request: protos.google.cloud.edgecontainer.v1.IGenerateAccessTokenRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.edgecontainer.v1.IGenerateAccessTokenResponse, + | protos.google.cloud.edgecontainer.v1.IGenerateAccessTokenRequest + | null + | undefined, + {} | null | undefined + > + ): void; + generateAccessToken( + request: protos.google.cloud.edgecontainer.v1.IGenerateAccessTokenRequest, + callback: Callback< + protos.google.cloud.edgecontainer.v1.IGenerateAccessTokenResponse, + | protos.google.cloud.edgecontainer.v1.IGenerateAccessTokenRequest + | null + | undefined, + {} | null | undefined + > + ): void; + generateAccessToken( + request?: protos.google.cloud.edgecontainer.v1.IGenerateAccessTokenRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.edgecontainer.v1.IGenerateAccessTokenResponse, + | protos.google.cloud.edgecontainer.v1.IGenerateAccessTokenRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.edgecontainer.v1.IGenerateAccessTokenResponse, + | protos.google.cloud.edgecontainer.v1.IGenerateAccessTokenRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.edgecontainer.v1.IGenerateAccessTokenResponse, + ( + | protos.google.cloud.edgecontainer.v1.IGenerateAccessTokenRequest + | 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({ + cluster: request.cluster ?? '', + }); + this.initialize(); + return this.innerApiCalls.generateAccessToken(request, options, callback); + } + /** + * Gets details of a single NodePool. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The resource name of the node pool. + * @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.edgecontainer.v1.NodePool|NodePool}. + * 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/edge_container.get_node_pool.js + * region_tag:edgecontainer_v1_generated_EdgeContainer_GetNodePool_async + */ + getNodePool( + request?: protos.google.cloud.edgecontainer.v1.IGetNodePoolRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.edgecontainer.v1.INodePool, + protos.google.cloud.edgecontainer.v1.IGetNodePoolRequest | undefined, + {} | undefined, + ] + >; + getNodePool( + request: protos.google.cloud.edgecontainer.v1.IGetNodePoolRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.edgecontainer.v1.INodePool, + | protos.google.cloud.edgecontainer.v1.IGetNodePoolRequest + | null + | undefined, + {} | null | undefined + > + ): void; + getNodePool( + request: protos.google.cloud.edgecontainer.v1.IGetNodePoolRequest, + callback: Callback< + protos.google.cloud.edgecontainer.v1.INodePool, + | protos.google.cloud.edgecontainer.v1.IGetNodePoolRequest + | null + | undefined, + {} | null | undefined + > + ): void; + getNodePool( + request?: protos.google.cloud.edgecontainer.v1.IGetNodePoolRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.edgecontainer.v1.INodePool, + | protos.google.cloud.edgecontainer.v1.IGetNodePoolRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.edgecontainer.v1.INodePool, + | protos.google.cloud.edgecontainer.v1.IGetNodePoolRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.edgecontainer.v1.INodePool, + protos.google.cloud.edgecontainer.v1.IGetNodePoolRequest | 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(); + return this.innerApiCalls.getNodePool(request, options, callback); + } + /** + * Gets details of a single Machine. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The resource name of the machine. + * @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.edgecontainer.v1.Machine|Machine}. + * 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/edge_container.get_machine.js + * region_tag:edgecontainer_v1_generated_EdgeContainer_GetMachine_async + */ + getMachine( + request?: protos.google.cloud.edgecontainer.v1.IGetMachineRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.edgecontainer.v1.IMachine, + protos.google.cloud.edgecontainer.v1.IGetMachineRequest | undefined, + {} | undefined, + ] + >; + getMachine( + request: protos.google.cloud.edgecontainer.v1.IGetMachineRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.edgecontainer.v1.IMachine, + | protos.google.cloud.edgecontainer.v1.IGetMachineRequest + | null + | undefined, + {} | null | undefined + > + ): void; + getMachine( + request: protos.google.cloud.edgecontainer.v1.IGetMachineRequest, + callback: Callback< + protos.google.cloud.edgecontainer.v1.IMachine, + | protos.google.cloud.edgecontainer.v1.IGetMachineRequest + | null + | undefined, + {} | null | undefined + > + ): void; + getMachine( + request?: protos.google.cloud.edgecontainer.v1.IGetMachineRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.edgecontainer.v1.IMachine, + | protos.google.cloud.edgecontainer.v1.IGetMachineRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.edgecontainer.v1.IMachine, + | protos.google.cloud.edgecontainer.v1.IGetMachineRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.edgecontainer.v1.IMachine, + protos.google.cloud.edgecontainer.v1.IGetMachineRequest | 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(); + return this.innerApiCalls.getMachine(request, options, callback); + } + /** + * Gets details of a single VPN connection. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The resource name of the vpn connection. + * @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.edgecontainer.v1.VpnConnection|VpnConnection}. + * 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/edge_container.get_vpn_connection.js + * region_tag:edgecontainer_v1_generated_EdgeContainer_GetVpnConnection_async + */ + getVpnConnection( + request?: protos.google.cloud.edgecontainer.v1.IGetVpnConnectionRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.edgecontainer.v1.IVpnConnection, + protos.google.cloud.edgecontainer.v1.IGetVpnConnectionRequest | undefined, + {} | undefined, + ] + >; + getVpnConnection( + request: protos.google.cloud.edgecontainer.v1.IGetVpnConnectionRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.edgecontainer.v1.IVpnConnection, + | protos.google.cloud.edgecontainer.v1.IGetVpnConnectionRequest + | null + | undefined, + {} | null | undefined + > + ): void; + getVpnConnection( + request: protos.google.cloud.edgecontainer.v1.IGetVpnConnectionRequest, + callback: Callback< + protos.google.cloud.edgecontainer.v1.IVpnConnection, + | protos.google.cloud.edgecontainer.v1.IGetVpnConnectionRequest + | null + | undefined, + {} | null | undefined + > + ): void; + getVpnConnection( + request?: protos.google.cloud.edgecontainer.v1.IGetVpnConnectionRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.edgecontainer.v1.IVpnConnection, + | protos.google.cloud.edgecontainer.v1.IGetVpnConnectionRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.edgecontainer.v1.IVpnConnection, + | protos.google.cloud.edgecontainer.v1.IGetVpnConnectionRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.edgecontainer.v1.IVpnConnection, + protos.google.cloud.edgecontainer.v1.IGetVpnConnectionRequest | 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(); + return this.innerApiCalls.getVpnConnection(request, options, callback); + } + + /** + * Creates a new Cluster in a given project and location. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The parent location where this cluster will be created. + * @param {string} request.clusterId + * Required. A client-specified unique identifier for the cluster. + * @param {google.cloud.edgecontainer.v1.Cluster} request.cluster + * Required. The cluster to create. + * @param {string} request.requestId + * A unique identifier for this request. Restricted to 36 ASCII characters. A + * random UUID is recommended. This request is only idempotent if + * `request_id` is provided. + * @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/edge_container.create_cluster.js + * region_tag:edgecontainer_v1_generated_EdgeContainer_CreateCluster_async + */ + createCluster( + request?: protos.google.cloud.edgecontainer.v1.ICreateClusterRequest, + options?: CallOptions + ): Promise< + [ + LROperation< + protos.google.cloud.edgecontainer.v1.ICluster, + protos.google.cloud.edgecontainer.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined, + ] + >; + createCluster( + request: protos.google.cloud.edgecontainer.v1.ICreateClusterRequest, + options: CallOptions, + callback: Callback< + LROperation< + protos.google.cloud.edgecontainer.v1.ICluster, + protos.google.cloud.edgecontainer.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + createCluster( + request: protos.google.cloud.edgecontainer.v1.ICreateClusterRequest, + callback: Callback< + LROperation< + protos.google.cloud.edgecontainer.v1.ICluster, + protos.google.cloud.edgecontainer.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + createCluster( + request?: protos.google.cloud.edgecontainer.v1.ICreateClusterRequest, + optionsOrCallback?: + | CallOptions + | Callback< + LROperation< + protos.google.cloud.edgecontainer.v1.ICluster, + protos.google.cloud.edgecontainer.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + callback?: Callback< + LROperation< + protos.google.cloud.edgecontainer.v1.ICluster, + protos.google.cloud.edgecontainer.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): Promise< + [ + LROperation< + protos.google.cloud.edgecontainer.v1.ICluster, + protos.google.cloud.edgecontainer.v1.IOperationMetadata + >, + 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(); + return this.innerApiCalls.createCluster(request, options, callback); + } + /** + * Check the status of the long running operation returned by `createCluster()`. + * @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/edge_container.create_cluster.js + * region_tag:edgecontainer_v1_generated_EdgeContainer_CreateCluster_async + */ + async checkCreateClusterProgress( + name: string + ): Promise< + LROperation< + protos.google.cloud.edgecontainer.v1.Cluster, + protos.google.cloud.edgecontainer.v1.OperationMetadata + > + > { + 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.createCluster, + this._gaxModule.createDefaultBackoffSettings() + ); + return decodeOperation as LROperation< + protos.google.cloud.edgecontainer.v1.Cluster, + protos.google.cloud.edgecontainer.v1.OperationMetadata + >; + } + /** + * Updates the parameters of a single Cluster. + * + * @param {Object} request + * The request object that will be sent. + * @param {google.protobuf.FieldMask} request.updateMask + * Field mask is used to specify the fields to be overwritten in the + * Cluster resource by the update. + * The fields specified in the update_mask are relative to the resource, not + * the full request. A field will be overwritten if it is in the mask. If the + * user does not provide a mask then all fields will be overwritten. + * @param {google.cloud.edgecontainer.v1.Cluster} request.cluster + * The updated cluster. + * @param {string} request.requestId + * A unique identifier for this request. Restricted to 36 ASCII characters. + * A random UUID is recommended. + * This request is only idempotent if `request_id` is provided. + * @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/edge_container.update_cluster.js + * region_tag:edgecontainer_v1_generated_EdgeContainer_UpdateCluster_async + */ + updateCluster( + request?: protos.google.cloud.edgecontainer.v1.IUpdateClusterRequest, + options?: CallOptions + ): Promise< + [ + LROperation< + protos.google.cloud.edgecontainer.v1.ICluster, + protos.google.cloud.edgecontainer.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined, + ] + >; + updateCluster( + request: protos.google.cloud.edgecontainer.v1.IUpdateClusterRequest, + options: CallOptions, + callback: Callback< + LROperation< + protos.google.cloud.edgecontainer.v1.ICluster, + protos.google.cloud.edgecontainer.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + updateCluster( + request: protos.google.cloud.edgecontainer.v1.IUpdateClusterRequest, + callback: Callback< + LROperation< + protos.google.cloud.edgecontainer.v1.ICluster, + protos.google.cloud.edgecontainer.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + updateCluster( + request?: protos.google.cloud.edgecontainer.v1.IUpdateClusterRequest, + optionsOrCallback?: + | CallOptions + | Callback< + LROperation< + protos.google.cloud.edgecontainer.v1.ICluster, + protos.google.cloud.edgecontainer.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + callback?: Callback< + LROperation< + protos.google.cloud.edgecontainer.v1.ICluster, + protos.google.cloud.edgecontainer.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): Promise< + [ + LROperation< + protos.google.cloud.edgecontainer.v1.ICluster, + protos.google.cloud.edgecontainer.v1.IOperationMetadata + >, + 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({ + 'cluster.name': request.cluster!.name ?? '', + }); + this.initialize(); + return this.innerApiCalls.updateCluster(request, options, callback); + } + /** + * Check the status of the long running operation returned by `updateCluster()`. + * @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/edge_container.update_cluster.js + * region_tag:edgecontainer_v1_generated_EdgeContainer_UpdateCluster_async + */ + async checkUpdateClusterProgress( + name: string + ): Promise< + LROperation< + protos.google.cloud.edgecontainer.v1.Cluster, + protos.google.cloud.edgecontainer.v1.OperationMetadata + > + > { + 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.updateCluster, + this._gaxModule.createDefaultBackoffSettings() + ); + return decodeOperation as LROperation< + protos.google.cloud.edgecontainer.v1.Cluster, + protos.google.cloud.edgecontainer.v1.OperationMetadata + >; + } + /** + * Deletes a single Cluster. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The resource name of the cluster. + * @param {string} request.requestId + * A unique identifier for this request. Restricted to 36 ASCII characters. A + * random UUID is recommended. This request is only idempotent if + * `request_id` is provided. + * @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/edge_container.delete_cluster.js + * region_tag:edgecontainer_v1_generated_EdgeContainer_DeleteCluster_async + */ + deleteCluster( + request?: protos.google.cloud.edgecontainer.v1.IDeleteClusterRequest, + options?: CallOptions + ): Promise< + [ + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.edgecontainer.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined, + ] + >; + deleteCluster( + request: protos.google.cloud.edgecontainer.v1.IDeleteClusterRequest, + options: CallOptions, + callback: Callback< + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.edgecontainer.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + deleteCluster( + request: protos.google.cloud.edgecontainer.v1.IDeleteClusterRequest, + callback: Callback< + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.edgecontainer.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + deleteCluster( + request?: protos.google.cloud.edgecontainer.v1.IDeleteClusterRequest, + optionsOrCallback?: + | CallOptions + | Callback< + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.edgecontainer.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + callback?: Callback< + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.edgecontainer.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): Promise< + [ + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.edgecontainer.v1.IOperationMetadata + >, + 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(); + return this.innerApiCalls.deleteCluster(request, options, callback); + } + /** + * Check the status of the long running operation returned by `deleteCluster()`. + * @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/edge_container.delete_cluster.js + * region_tag:edgecontainer_v1_generated_EdgeContainer_DeleteCluster_async + */ + async checkDeleteClusterProgress( + name: string + ): Promise< + LROperation< + protos.google.protobuf.Empty, + protos.google.cloud.edgecontainer.v1.OperationMetadata + > + > { + 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.deleteCluster, + this._gaxModule.createDefaultBackoffSettings() + ); + return decodeOperation as LROperation< + protos.google.protobuf.Empty, + protos.google.cloud.edgecontainer.v1.OperationMetadata + >; + } + /** + * Creates a new NodePool in a given project and location. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The parent cluster where this node pool will be created. + * @param {string} request.nodePoolId + * Required. A client-specified unique identifier for the node pool. + * @param {google.cloud.edgecontainer.v1.NodePool} request.nodePool + * Required. The node pool to create. + * @param {string} request.requestId + * A unique identifier for this request. Restricted to 36 ASCII characters. A + * random UUID is recommended. This request is only idempotent if + * `request_id` is provided. + * @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/edge_container.create_node_pool.js + * region_tag:edgecontainer_v1_generated_EdgeContainer_CreateNodePool_async + */ + createNodePool( + request?: protos.google.cloud.edgecontainer.v1.ICreateNodePoolRequest, + options?: CallOptions + ): Promise< + [ + LROperation< + protos.google.cloud.edgecontainer.v1.INodePool, + protos.google.cloud.edgecontainer.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined, + ] + >; + createNodePool( + request: protos.google.cloud.edgecontainer.v1.ICreateNodePoolRequest, + options: CallOptions, + callback: Callback< + LROperation< + protos.google.cloud.edgecontainer.v1.INodePool, + protos.google.cloud.edgecontainer.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + createNodePool( + request: protos.google.cloud.edgecontainer.v1.ICreateNodePoolRequest, + callback: Callback< + LROperation< + protos.google.cloud.edgecontainer.v1.INodePool, + protos.google.cloud.edgecontainer.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + createNodePool( + request?: protos.google.cloud.edgecontainer.v1.ICreateNodePoolRequest, + optionsOrCallback?: + | CallOptions + | Callback< + LROperation< + protos.google.cloud.edgecontainer.v1.INodePool, + protos.google.cloud.edgecontainer.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + callback?: Callback< + LROperation< + protos.google.cloud.edgecontainer.v1.INodePool, + protos.google.cloud.edgecontainer.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): Promise< + [ + LROperation< + protos.google.cloud.edgecontainer.v1.INodePool, + protos.google.cloud.edgecontainer.v1.IOperationMetadata + >, + 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(); + return this.innerApiCalls.createNodePool(request, options, callback); + } + /** + * Check the status of the long running operation returned by `createNodePool()`. + * @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/edge_container.create_node_pool.js + * region_tag:edgecontainer_v1_generated_EdgeContainer_CreateNodePool_async + */ + async checkCreateNodePoolProgress( + name: string + ): Promise< + LROperation< + protos.google.cloud.edgecontainer.v1.NodePool, + protos.google.cloud.edgecontainer.v1.OperationMetadata + > + > { + 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.createNodePool, + this._gaxModule.createDefaultBackoffSettings() + ); + return decodeOperation as LROperation< + protos.google.cloud.edgecontainer.v1.NodePool, + protos.google.cloud.edgecontainer.v1.OperationMetadata + >; + } + /** + * Updates the parameters of a single NodePool. + * + * @param {Object} request + * The request object that will be sent. + * @param {google.protobuf.FieldMask} request.updateMask + * Field mask is used to specify the fields to be overwritten in the + * NodePool resource by the update. + * The fields specified in the update_mask are relative to the resource, not + * the full request. A field will be overwritten if it is in the mask. If the + * user does not provide a mask then all fields will be overwritten. + * @param {google.cloud.edgecontainer.v1.NodePool} request.nodePool + * The updated node pool. + * @param {string} request.requestId + * A unique identifier for this request. Restricted to 36 ASCII characters. A + * random UUID is recommended. This request is only idempotent if + * `request_id` is provided. + * @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/edge_container.update_node_pool.js + * region_tag:edgecontainer_v1_generated_EdgeContainer_UpdateNodePool_async + */ + updateNodePool( + request?: protos.google.cloud.edgecontainer.v1.IUpdateNodePoolRequest, + options?: CallOptions + ): Promise< + [ + LROperation< + protos.google.cloud.edgecontainer.v1.INodePool, + protos.google.cloud.edgecontainer.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined, + ] + >; + updateNodePool( + request: protos.google.cloud.edgecontainer.v1.IUpdateNodePoolRequest, + options: CallOptions, + callback: Callback< + LROperation< + protos.google.cloud.edgecontainer.v1.INodePool, + protos.google.cloud.edgecontainer.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + updateNodePool( + request: protos.google.cloud.edgecontainer.v1.IUpdateNodePoolRequest, + callback: Callback< + LROperation< + protos.google.cloud.edgecontainer.v1.INodePool, + protos.google.cloud.edgecontainer.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + updateNodePool( + request?: protos.google.cloud.edgecontainer.v1.IUpdateNodePoolRequest, + optionsOrCallback?: + | CallOptions + | Callback< + LROperation< + protos.google.cloud.edgecontainer.v1.INodePool, + protos.google.cloud.edgecontainer.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + callback?: Callback< + LROperation< + protos.google.cloud.edgecontainer.v1.INodePool, + protos.google.cloud.edgecontainer.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): Promise< + [ + LROperation< + protos.google.cloud.edgecontainer.v1.INodePool, + protos.google.cloud.edgecontainer.v1.IOperationMetadata + >, + 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({ + 'node_pool.name': request.nodePool!.name ?? '', + }); + this.initialize(); + return this.innerApiCalls.updateNodePool(request, options, callback); + } + /** + * Check the status of the long running operation returned by `updateNodePool()`. + * @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/edge_container.update_node_pool.js + * region_tag:edgecontainer_v1_generated_EdgeContainer_UpdateNodePool_async + */ + async checkUpdateNodePoolProgress( + name: string + ): Promise< + LROperation< + protos.google.cloud.edgecontainer.v1.NodePool, + protos.google.cloud.edgecontainer.v1.OperationMetadata + > + > { + 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.updateNodePool, + this._gaxModule.createDefaultBackoffSettings() + ); + return decodeOperation as LROperation< + protos.google.cloud.edgecontainer.v1.NodePool, + protos.google.cloud.edgecontainer.v1.OperationMetadata + >; + } + /** + * Deletes a single NodePool. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The resource name of the node pool. + * @param {string} request.requestId + * A unique identifier for this request. Restricted to 36 ASCII characters. A + * random UUID is recommended. This request is only idempotent if + * `request_id` is provided. + * @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/edge_container.delete_node_pool.js + * region_tag:edgecontainer_v1_generated_EdgeContainer_DeleteNodePool_async + */ + deleteNodePool( + request?: protos.google.cloud.edgecontainer.v1.IDeleteNodePoolRequest, + options?: CallOptions + ): Promise< + [ + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.edgecontainer.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined, + ] + >; + deleteNodePool( + request: protos.google.cloud.edgecontainer.v1.IDeleteNodePoolRequest, + options: CallOptions, + callback: Callback< + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.edgecontainer.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + deleteNodePool( + request: protos.google.cloud.edgecontainer.v1.IDeleteNodePoolRequest, + callback: Callback< + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.edgecontainer.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + deleteNodePool( + request?: protos.google.cloud.edgecontainer.v1.IDeleteNodePoolRequest, + optionsOrCallback?: + | CallOptions + | Callback< + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.edgecontainer.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + callback?: Callback< + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.edgecontainer.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): Promise< + [ + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.edgecontainer.v1.IOperationMetadata + >, + 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(); + return this.innerApiCalls.deleteNodePool(request, options, callback); + } + /** + * Check the status of the long running operation returned by `deleteNodePool()`. + * @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/edge_container.delete_node_pool.js + * region_tag:edgecontainer_v1_generated_EdgeContainer_DeleteNodePool_async + */ + async checkDeleteNodePoolProgress( + name: string + ): Promise< + LROperation< + protos.google.protobuf.Empty, + protos.google.cloud.edgecontainer.v1.OperationMetadata + > + > { + 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.deleteNodePool, + this._gaxModule.createDefaultBackoffSettings() + ); + return decodeOperation as LROperation< + protos.google.protobuf.Empty, + protos.google.cloud.edgecontainer.v1.OperationMetadata + >; + } + /** + * Creates a new VPN connection in a given project and location. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The parent location where this vpn connection will be created. + * @param {string} request.vpnConnectionId + * Required. The VPN connection identifier. + * @param {google.cloud.edgecontainer.v1.VpnConnection} request.vpnConnection + * Required. The VPN connection to create. + * @param {string} request.requestId + * A unique identifier for this request. Restricted to 36 ASCII characters. A + * random UUID is recommended. This request is only idempotent if + * `request_id` is provided. + * @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/edge_container.create_vpn_connection.js + * region_tag:edgecontainer_v1_generated_EdgeContainer_CreateVpnConnection_async + */ + createVpnConnection( + request?: protos.google.cloud.edgecontainer.v1.ICreateVpnConnectionRequest, + options?: CallOptions + ): Promise< + [ + LROperation< + protos.google.cloud.edgecontainer.v1.IVpnConnection, + protos.google.cloud.edgecontainer.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined, + ] + >; + createVpnConnection( + request: protos.google.cloud.edgecontainer.v1.ICreateVpnConnectionRequest, + options: CallOptions, + callback: Callback< + LROperation< + protos.google.cloud.edgecontainer.v1.IVpnConnection, + protos.google.cloud.edgecontainer.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + createVpnConnection( + request: protos.google.cloud.edgecontainer.v1.ICreateVpnConnectionRequest, + callback: Callback< + LROperation< + protos.google.cloud.edgecontainer.v1.IVpnConnection, + protos.google.cloud.edgecontainer.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + createVpnConnection( + request?: protos.google.cloud.edgecontainer.v1.ICreateVpnConnectionRequest, + optionsOrCallback?: + | CallOptions + | Callback< + LROperation< + protos.google.cloud.edgecontainer.v1.IVpnConnection, + protos.google.cloud.edgecontainer.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + callback?: Callback< + LROperation< + protos.google.cloud.edgecontainer.v1.IVpnConnection, + protos.google.cloud.edgecontainer.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): Promise< + [ + LROperation< + protos.google.cloud.edgecontainer.v1.IVpnConnection, + protos.google.cloud.edgecontainer.v1.IOperationMetadata + >, + 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(); + return this.innerApiCalls.createVpnConnection(request, options, callback); + } + /** + * Check the status of the long running operation returned by `createVpnConnection()`. + * @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/edge_container.create_vpn_connection.js + * region_tag:edgecontainer_v1_generated_EdgeContainer_CreateVpnConnection_async + */ + async checkCreateVpnConnectionProgress( + name: string + ): Promise< + LROperation< + protos.google.cloud.edgecontainer.v1.VpnConnection, + protos.google.cloud.edgecontainer.v1.OperationMetadata + > + > { + 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.createVpnConnection, + this._gaxModule.createDefaultBackoffSettings() + ); + return decodeOperation as LROperation< + protos.google.cloud.edgecontainer.v1.VpnConnection, + protos.google.cloud.edgecontainer.v1.OperationMetadata + >; + } + /** + * Deletes a single VPN connection. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The resource name of the vpn connection. + * @param {string} request.requestId + * A unique identifier for this request. Restricted to 36 ASCII characters. A + * random UUID is recommended. This request is only idempotent if + * `request_id` is provided. + * @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/edge_container.delete_vpn_connection.js + * region_tag:edgecontainer_v1_generated_EdgeContainer_DeleteVpnConnection_async + */ + deleteVpnConnection( + request?: protos.google.cloud.edgecontainer.v1.IDeleteVpnConnectionRequest, + options?: CallOptions + ): Promise< + [ + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.edgecontainer.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined, + ] + >; + deleteVpnConnection( + request: protos.google.cloud.edgecontainer.v1.IDeleteVpnConnectionRequest, + options: CallOptions, + callback: Callback< + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.edgecontainer.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + deleteVpnConnection( + request: protos.google.cloud.edgecontainer.v1.IDeleteVpnConnectionRequest, + callback: Callback< + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.edgecontainer.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + deleteVpnConnection( + request?: protos.google.cloud.edgecontainer.v1.IDeleteVpnConnectionRequest, + optionsOrCallback?: + | CallOptions + | Callback< + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.edgecontainer.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + callback?: Callback< + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.edgecontainer.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): Promise< + [ + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.edgecontainer.v1.IOperationMetadata + >, + 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(); + return this.innerApiCalls.deleteVpnConnection(request, options, callback); + } + /** + * Check the status of the long running operation returned by `deleteVpnConnection()`. + * @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/edge_container.delete_vpn_connection.js + * region_tag:edgecontainer_v1_generated_EdgeContainer_DeleteVpnConnection_async + */ + async checkDeleteVpnConnectionProgress( + name: string + ): Promise< + LROperation< + protos.google.protobuf.Empty, + protos.google.cloud.edgecontainer.v1.OperationMetadata + > + > { + 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.deleteVpnConnection, + this._gaxModule.createDefaultBackoffSettings() + ); + return decodeOperation as LROperation< + protos.google.protobuf.Empty, + protos.google.cloud.edgecontainer.v1.OperationMetadata + >; + } + /** + * Lists Clusters in a given project and location. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The parent location, which owns this collection of clusters. + * @param {number} request.pageSize + * The maximum number of resources to list. + * @param {string} request.pageToken + * A page token received from previous list request. + * A page token received from previous list request. + * @param {string} request.filter + * Only resources matching this filter will be listed. + * @param {string} request.orderBy + * Specifies the order in which resources will be listed. + * @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.edgecontainer.v1.Cluster|Cluster}. + * 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 `listClustersAsync()` + * 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. + */ + listClusters( + request?: protos.google.cloud.edgecontainer.v1.IListClustersRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.edgecontainer.v1.ICluster[], + protos.google.cloud.edgecontainer.v1.IListClustersRequest | null, + protos.google.cloud.edgecontainer.v1.IListClustersResponse, + ] + >; + listClusters( + request: protos.google.cloud.edgecontainer.v1.IListClustersRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.cloud.edgecontainer.v1.IListClustersRequest, + | protos.google.cloud.edgecontainer.v1.IListClustersResponse + | null + | undefined, + protos.google.cloud.edgecontainer.v1.ICluster + > + ): void; + listClusters( + request: protos.google.cloud.edgecontainer.v1.IListClustersRequest, + callback: PaginationCallback< + protos.google.cloud.edgecontainer.v1.IListClustersRequest, + | protos.google.cloud.edgecontainer.v1.IListClustersResponse + | null + | undefined, + protos.google.cloud.edgecontainer.v1.ICluster + > + ): void; + listClusters( + request?: protos.google.cloud.edgecontainer.v1.IListClustersRequest, + optionsOrCallback?: + | CallOptions + | PaginationCallback< + protos.google.cloud.edgecontainer.v1.IListClustersRequest, + | protos.google.cloud.edgecontainer.v1.IListClustersResponse + | null + | undefined, + protos.google.cloud.edgecontainer.v1.ICluster + >, + callback?: PaginationCallback< + protos.google.cloud.edgecontainer.v1.IListClustersRequest, + | protos.google.cloud.edgecontainer.v1.IListClustersResponse + | null + | undefined, + protos.google.cloud.edgecontainer.v1.ICluster + > + ): Promise< + [ + protos.google.cloud.edgecontainer.v1.ICluster[], + protos.google.cloud.edgecontainer.v1.IListClustersRequest | null, + protos.google.cloud.edgecontainer.v1.IListClustersResponse, + ] + > | 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(); + return this.innerApiCalls.listClusters(request, options, callback); + } + + /** + * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The parent location, which owns this collection of clusters. + * @param {number} request.pageSize + * The maximum number of resources to list. + * @param {string} request.pageToken + * A page token received from previous list request. + * A page token received from previous list request. + * @param {string} request.filter + * Only resources matching this filter will be listed. + * @param {string} request.orderBy + * Specifies the order in which resources will be listed. + * @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.edgecontainer.v1.Cluster|Cluster} 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 `listClustersAsync()` + * 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. + */ + listClustersStream( + request?: protos.google.cloud.edgecontainer.v1.IListClustersRequest, + 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['listClusters']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.listClusters.createStream( + this.innerApiCalls.listClusters as GaxCall, + request, + callSettings + ); + } + + /** + * Equivalent to `listClusters`, 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 location, which owns this collection of clusters. + * @param {number} request.pageSize + * The maximum number of resources to list. + * @param {string} request.pageToken + * A page token received from previous list request. + * A page token received from previous list request. + * @param {string} request.filter + * Only resources matching this filter will be listed. + * @param {string} request.orderBy + * Specifies the order in which resources will be listed. + * @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.edgecontainer.v1.Cluster|Cluster}. 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/edge_container.list_clusters.js + * region_tag:edgecontainer_v1_generated_EdgeContainer_ListClusters_async + */ + listClustersAsync( + request?: protos.google.cloud.edgecontainer.v1.IListClustersRequest, + 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['listClusters']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.listClusters.asyncIterate( + this.innerApiCalls['listClusters'] as GaxCall, + request as {}, + callSettings + ) as AsyncIterable; + } + /** + * Lists NodePools in a given project and location. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The parent cluster, which owns this collection of node pools. + * @param {number} request.pageSize + * The maximum number of resources to list. + * @param {string} request.pageToken + * A page token received from previous list request. + * @param {string} request.filter + * Only resources matching this filter will be listed. + * @param {string} request.orderBy + * Specifies the order in which resources will be listed. + * @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.edgecontainer.v1.NodePool|NodePool}. + * 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 `listNodePoolsAsync()` + * 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. + */ + listNodePools( + request?: protos.google.cloud.edgecontainer.v1.IListNodePoolsRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.edgecontainer.v1.INodePool[], + protos.google.cloud.edgecontainer.v1.IListNodePoolsRequest | null, + protos.google.cloud.edgecontainer.v1.IListNodePoolsResponse, + ] + >; + listNodePools( + request: protos.google.cloud.edgecontainer.v1.IListNodePoolsRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.cloud.edgecontainer.v1.IListNodePoolsRequest, + | protos.google.cloud.edgecontainer.v1.IListNodePoolsResponse + | null + | undefined, + protos.google.cloud.edgecontainer.v1.INodePool + > + ): void; + listNodePools( + request: protos.google.cloud.edgecontainer.v1.IListNodePoolsRequest, + callback: PaginationCallback< + protos.google.cloud.edgecontainer.v1.IListNodePoolsRequest, + | protos.google.cloud.edgecontainer.v1.IListNodePoolsResponse + | null + | undefined, + protos.google.cloud.edgecontainer.v1.INodePool + > + ): void; + listNodePools( + request?: protos.google.cloud.edgecontainer.v1.IListNodePoolsRequest, + optionsOrCallback?: + | CallOptions + | PaginationCallback< + protos.google.cloud.edgecontainer.v1.IListNodePoolsRequest, + | protos.google.cloud.edgecontainer.v1.IListNodePoolsResponse + | null + | undefined, + protos.google.cloud.edgecontainer.v1.INodePool + >, + callback?: PaginationCallback< + protos.google.cloud.edgecontainer.v1.IListNodePoolsRequest, + | protos.google.cloud.edgecontainer.v1.IListNodePoolsResponse + | null + | undefined, + protos.google.cloud.edgecontainer.v1.INodePool + > + ): Promise< + [ + protos.google.cloud.edgecontainer.v1.INodePool[], + protos.google.cloud.edgecontainer.v1.IListNodePoolsRequest | null, + protos.google.cloud.edgecontainer.v1.IListNodePoolsResponse, + ] + > | 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(); + return this.innerApiCalls.listNodePools(request, options, callback); + } + + /** + * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The parent cluster, which owns this collection of node pools. + * @param {number} request.pageSize + * The maximum number of resources to list. + * @param {string} request.pageToken + * A page token received from previous list request. + * @param {string} request.filter + * Only resources matching this filter will be listed. + * @param {string} request.orderBy + * Specifies the order in which resources will be listed. + * @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.edgecontainer.v1.NodePool|NodePool} 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 `listNodePoolsAsync()` + * 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. + */ + listNodePoolsStream( + request?: protos.google.cloud.edgecontainer.v1.IListNodePoolsRequest, + 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['listNodePools']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.listNodePools.createStream( + this.innerApiCalls.listNodePools as GaxCall, + request, + callSettings + ); + } + + /** + * Equivalent to `listNodePools`, 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 cluster, which owns this collection of node pools. + * @param {number} request.pageSize + * The maximum number of resources to list. + * @param {string} request.pageToken + * A page token received from previous list request. + * @param {string} request.filter + * Only resources matching this filter will be listed. + * @param {string} request.orderBy + * Specifies the order in which resources will be listed. + * @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.edgecontainer.v1.NodePool|NodePool}. 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/edge_container.list_node_pools.js + * region_tag:edgecontainer_v1_generated_EdgeContainer_ListNodePools_async + */ + listNodePoolsAsync( + request?: protos.google.cloud.edgecontainer.v1.IListNodePoolsRequest, + 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['listNodePools']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.listNodePools.asyncIterate( + this.innerApiCalls['listNodePools'] as GaxCall, + request as {}, + callSettings + ) as AsyncIterable; + } + /** + * Lists Machines in a given project and location. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The parent site, which owns this collection of machines. + * @param {number} request.pageSize + * The maximum number of resources to list. + * @param {string} request.pageToken + * A page token received from previous list request. + * @param {string} request.filter + * Only resources matching this filter will be listed. + * @param {string} request.orderBy + * Specifies the order in which resources will be listed. + * @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.edgecontainer.v1.Machine|Machine}. + * 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 `listMachinesAsync()` + * 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. + */ + listMachines( + request?: protos.google.cloud.edgecontainer.v1.IListMachinesRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.edgecontainer.v1.IMachine[], + protos.google.cloud.edgecontainer.v1.IListMachinesRequest | null, + protos.google.cloud.edgecontainer.v1.IListMachinesResponse, + ] + >; + listMachines( + request: protos.google.cloud.edgecontainer.v1.IListMachinesRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.cloud.edgecontainer.v1.IListMachinesRequest, + | protos.google.cloud.edgecontainer.v1.IListMachinesResponse + | null + | undefined, + protos.google.cloud.edgecontainer.v1.IMachine + > + ): void; + listMachines( + request: protos.google.cloud.edgecontainer.v1.IListMachinesRequest, + callback: PaginationCallback< + protos.google.cloud.edgecontainer.v1.IListMachinesRequest, + | protos.google.cloud.edgecontainer.v1.IListMachinesResponse + | null + | undefined, + protos.google.cloud.edgecontainer.v1.IMachine + > + ): void; + listMachines( + request?: protos.google.cloud.edgecontainer.v1.IListMachinesRequest, + optionsOrCallback?: + | CallOptions + | PaginationCallback< + protos.google.cloud.edgecontainer.v1.IListMachinesRequest, + | protos.google.cloud.edgecontainer.v1.IListMachinesResponse + | null + | undefined, + protos.google.cloud.edgecontainer.v1.IMachine + >, + callback?: PaginationCallback< + protos.google.cloud.edgecontainer.v1.IListMachinesRequest, + | protos.google.cloud.edgecontainer.v1.IListMachinesResponse + | null + | undefined, + protos.google.cloud.edgecontainer.v1.IMachine + > + ): Promise< + [ + protos.google.cloud.edgecontainer.v1.IMachine[], + protos.google.cloud.edgecontainer.v1.IListMachinesRequest | null, + protos.google.cloud.edgecontainer.v1.IListMachinesResponse, + ] + > | 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(); + return this.innerApiCalls.listMachines(request, options, callback); + } + + /** + * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The parent site, which owns this collection of machines. + * @param {number} request.pageSize + * The maximum number of resources to list. + * @param {string} request.pageToken + * A page token received from previous list request. + * @param {string} request.filter + * Only resources matching this filter will be listed. + * @param {string} request.orderBy + * Specifies the order in which resources will be listed. + * @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.edgecontainer.v1.Machine|Machine} 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 `listMachinesAsync()` + * 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. + */ + listMachinesStream( + request?: protos.google.cloud.edgecontainer.v1.IListMachinesRequest, + 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['listMachines']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.listMachines.createStream( + this.innerApiCalls.listMachines as GaxCall, + request, + callSettings + ); + } + + /** + * Equivalent to `listMachines`, 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 site, which owns this collection of machines. + * @param {number} request.pageSize + * The maximum number of resources to list. + * @param {string} request.pageToken + * A page token received from previous list request. + * @param {string} request.filter + * Only resources matching this filter will be listed. + * @param {string} request.orderBy + * Specifies the order in which resources will be listed. + * @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.edgecontainer.v1.Machine|Machine}. 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/edge_container.list_machines.js + * region_tag:edgecontainer_v1_generated_EdgeContainer_ListMachines_async + */ + listMachinesAsync( + request?: protos.google.cloud.edgecontainer.v1.IListMachinesRequest, + 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['listMachines']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.listMachines.asyncIterate( + this.innerApiCalls['listMachines'] as GaxCall, + request as {}, + callSettings + ) as AsyncIterable; + } + /** + * Lists VPN connections in a given project and location. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The parent location, which owns this collection of VPN connections. + * @param {number} request.pageSize + * The maximum number of resources to list. + * @param {string} request.pageToken + * A page token received from previous list request. + * @param {string} request.filter + * Only resources matching this filter will be listed. + * @param {string} request.orderBy + * Specifies the order in which resources will be listed. + * @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.edgecontainer.v1.VpnConnection|VpnConnection}. + * 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 `listVpnConnectionsAsync()` + * 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. + */ + listVpnConnections( + request?: protos.google.cloud.edgecontainer.v1.IListVpnConnectionsRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.edgecontainer.v1.IVpnConnection[], + protos.google.cloud.edgecontainer.v1.IListVpnConnectionsRequest | null, + protos.google.cloud.edgecontainer.v1.IListVpnConnectionsResponse, + ] + >; + listVpnConnections( + request: protos.google.cloud.edgecontainer.v1.IListVpnConnectionsRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.cloud.edgecontainer.v1.IListVpnConnectionsRequest, + | protos.google.cloud.edgecontainer.v1.IListVpnConnectionsResponse + | null + | undefined, + protos.google.cloud.edgecontainer.v1.IVpnConnection + > + ): void; + listVpnConnections( + request: protos.google.cloud.edgecontainer.v1.IListVpnConnectionsRequest, + callback: PaginationCallback< + protos.google.cloud.edgecontainer.v1.IListVpnConnectionsRequest, + | protos.google.cloud.edgecontainer.v1.IListVpnConnectionsResponse + | null + | undefined, + protos.google.cloud.edgecontainer.v1.IVpnConnection + > + ): void; + listVpnConnections( + request?: protos.google.cloud.edgecontainer.v1.IListVpnConnectionsRequest, + optionsOrCallback?: + | CallOptions + | PaginationCallback< + protos.google.cloud.edgecontainer.v1.IListVpnConnectionsRequest, + | protos.google.cloud.edgecontainer.v1.IListVpnConnectionsResponse + | null + | undefined, + protos.google.cloud.edgecontainer.v1.IVpnConnection + >, + callback?: PaginationCallback< + protos.google.cloud.edgecontainer.v1.IListVpnConnectionsRequest, + | protos.google.cloud.edgecontainer.v1.IListVpnConnectionsResponse + | null + | undefined, + protos.google.cloud.edgecontainer.v1.IVpnConnection + > + ): Promise< + [ + protos.google.cloud.edgecontainer.v1.IVpnConnection[], + protos.google.cloud.edgecontainer.v1.IListVpnConnectionsRequest | null, + protos.google.cloud.edgecontainer.v1.IListVpnConnectionsResponse, + ] + > | 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(); + return this.innerApiCalls.listVpnConnections(request, options, callback); + } + + /** + * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The parent location, which owns this collection of VPN connections. + * @param {number} request.pageSize + * The maximum number of resources to list. + * @param {string} request.pageToken + * A page token received from previous list request. + * @param {string} request.filter + * Only resources matching this filter will be listed. + * @param {string} request.orderBy + * Specifies the order in which resources will be listed. + * @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.edgecontainer.v1.VpnConnection|VpnConnection} 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 `listVpnConnectionsAsync()` + * 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. + */ + listVpnConnectionsStream( + request?: protos.google.cloud.edgecontainer.v1.IListVpnConnectionsRequest, + 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['listVpnConnections']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.listVpnConnections.createStream( + this.innerApiCalls.listVpnConnections as GaxCall, + request, + callSettings + ); + } + + /** + * Equivalent to `listVpnConnections`, 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 location, which owns this collection of VPN connections. + * @param {number} request.pageSize + * The maximum number of resources to list. + * @param {string} request.pageToken + * A page token received from previous list request. + * @param {string} request.filter + * Only resources matching this filter will be listed. + * @param {string} request.orderBy + * Specifies the order in which resources will be listed. + * @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.edgecontainer.v1.VpnConnection|VpnConnection}. 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/edge_container.list_vpn_connections.js + * region_tag:edgecontainer_v1_generated_EdgeContainer_ListVpnConnections_async + */ + listVpnConnectionsAsync( + request?: protos.google.cloud.edgecontainer.v1.IListVpnConnectionsRequest, + 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['listVpnConnections']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.listVpnConnections.asyncIterate( + this.innerApiCalls['listVpnConnections'] 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, + options?: + | 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]> { + 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 { + 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, + options?: + | gax.CallOptions + | Callback< + protos.google.protobuf.Empty, + protos.google.longrunning.CancelOperationRequest, + {} | undefined | null + >, + callback?: Callback< + protos.google.longrunning.CancelOperationRequest, + protos.google.protobuf.Empty, + {} | undefined | null + > + ): Promise { + 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, + options?: + | 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 { + return this.operationsClient.deleteOperation(request, options, callback); + } + + // -------------------- + // -- Path templates -- + // -------------------- + + /** + * Return a fully-qualified cluster resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} cluster + * @returns {string} Resource name string. + */ + clusterPath(project: string, location: string, cluster: string) { + return this.pathTemplates.clusterPathTemplate.render({ + project: project, + location: location, + cluster: cluster, + }); + } + + /** + * Parse the project from Cluster resource. + * + * @param {string} clusterName + * A fully-qualified path representing Cluster resource. + * @returns {string} A string representing the project. + */ + matchProjectFromClusterName(clusterName: string) { + return this.pathTemplates.clusterPathTemplate.match(clusterName).project; + } + + /** + * Parse the location from Cluster resource. + * + * @param {string} clusterName + * A fully-qualified path representing Cluster resource. + * @returns {string} A string representing the location. + */ + matchLocationFromClusterName(clusterName: string) { + return this.pathTemplates.clusterPathTemplate.match(clusterName).location; + } + + /** + * Parse the cluster from Cluster resource. + * + * @param {string} clusterName + * A fully-qualified path representing Cluster resource. + * @returns {string} A string representing the cluster. + */ + matchClusterFromClusterName(clusterName: string) { + return this.pathTemplates.clusterPathTemplate.match(clusterName).cluster; + } + + /** + * 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 machine resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} machine + * @returns {string} Resource name string. + */ + machinePath(project: string, location: string, machine: string) { + return this.pathTemplates.machinePathTemplate.render({ + project: project, + location: location, + machine: machine, + }); + } + + /** + * Parse the project from Machine resource. + * + * @param {string} machineName + * A fully-qualified path representing Machine resource. + * @returns {string} A string representing the project. + */ + matchProjectFromMachineName(machineName: string) { + return this.pathTemplates.machinePathTemplate.match(machineName).project; + } + + /** + * Parse the location from Machine resource. + * + * @param {string} machineName + * A fully-qualified path representing Machine resource. + * @returns {string} A string representing the location. + */ + matchLocationFromMachineName(machineName: string) { + return this.pathTemplates.machinePathTemplate.match(machineName).location; + } + + /** + * Parse the machine from Machine resource. + * + * @param {string} machineName + * A fully-qualified path representing Machine resource. + * @returns {string} A string representing the machine. + */ + matchMachineFromMachineName(machineName: string) { + return this.pathTemplates.machinePathTemplate.match(machineName).machine; + } + + /** + * Return a fully-qualified nodePool resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} cluster + * @param {string} node_pool + * @returns {string} Resource name string. + */ + nodePoolPath( + project: string, + location: string, + cluster: string, + nodePool: string + ) { + return this.pathTemplates.nodePoolPathTemplate.render({ + project: project, + location: location, + cluster: cluster, + node_pool: nodePool, + }); + } + + /** + * Parse the project from NodePool resource. + * + * @param {string} nodePoolName + * A fully-qualified path representing NodePool resource. + * @returns {string} A string representing the project. + */ + matchProjectFromNodePoolName(nodePoolName: string) { + return this.pathTemplates.nodePoolPathTemplate.match(nodePoolName).project; + } + + /** + * Parse the location from NodePool resource. + * + * @param {string} nodePoolName + * A fully-qualified path representing NodePool resource. + * @returns {string} A string representing the location. + */ + matchLocationFromNodePoolName(nodePoolName: string) { + return this.pathTemplates.nodePoolPathTemplate.match(nodePoolName).location; + } + + /** + * Parse the cluster from NodePool resource. + * + * @param {string} nodePoolName + * A fully-qualified path representing NodePool resource. + * @returns {string} A string representing the cluster. + */ + matchClusterFromNodePoolName(nodePoolName: string) { + return this.pathTemplates.nodePoolPathTemplate.match(nodePoolName).cluster; + } + + /** + * Parse the node_pool from NodePool resource. + * + * @param {string} nodePoolName + * A fully-qualified path representing NodePool resource. + * @returns {string} A string representing the node_pool. + */ + matchNodePoolFromNodePoolName(nodePoolName: string) { + return this.pathTemplates.nodePoolPathTemplate.match(nodePoolName) + .node_pool; + } + + /** + * 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 vpnConnection resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} vpn_connection + * @returns {string} Resource name string. + */ + vpnConnectionPath(project: string, location: string, vpnConnection: string) { + return this.pathTemplates.vpnConnectionPathTemplate.render({ + project: project, + location: location, + vpn_connection: vpnConnection, + }); + } + + /** + * Parse the project from VpnConnection resource. + * + * @param {string} vpnConnectionName + * A fully-qualified path representing VpnConnection resource. + * @returns {string} A string representing the project. + */ + matchProjectFromVpnConnectionName(vpnConnectionName: string) { + return this.pathTemplates.vpnConnectionPathTemplate.match(vpnConnectionName) + .project; + } + + /** + * Parse the location from VpnConnection resource. + * + * @param {string} vpnConnectionName + * A fully-qualified path representing VpnConnection resource. + * @returns {string} A string representing the location. + */ + matchLocationFromVpnConnectionName(vpnConnectionName: string) { + return this.pathTemplates.vpnConnectionPathTemplate.match(vpnConnectionName) + .location; + } + + /** + * Parse the vpn_connection from VpnConnection resource. + * + * @param {string} vpnConnectionName + * A fully-qualified path representing VpnConnection resource. + * @returns {string} A string representing the vpn_connection. + */ + matchVpnConnectionFromVpnConnectionName(vpnConnectionName: string) { + return this.pathTemplates.vpnConnectionPathTemplate.match(vpnConnectionName) + .vpn_connection; + } + + /** + * 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.edgeContainerStub && !this._terminated) { + return this.edgeContainerStub.then(stub => { + this._terminated = true; + stub.close(); + this.locationsClient.close(); + this.operationsClient.close(); + }); + } + return Promise.resolve(); + } +} diff --git a/packages/google-cloud-edgecontainer/src/v1/edge_container_client_config.json b/packages/google-cloud-edgecontainer/src/v1/edge_container_client_config.json new file mode 100644 index 00000000000..a1bf6b05bf4 --- /dev/null +++ b/packages/google-cloud-edgecontainer/src/v1/edge_container_client_config.json @@ -0,0 +1,123 @@ +{ + "interfaces": { + "google.cloud.edgecontainer.v1.EdgeContainer": { + "retry_codes": { + "non_idempotent": [], + "idempotent": [ + "DEADLINE_EXCEEDED", + "UNAVAILABLE" + ], + "unavailable": [ + "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 + }, + "ce5b960a6ed052e690863808e4f0deff3dc7d49f": { + "initial_retry_delay_millis": 1000, + "retry_delay_multiplier": 1.3, + "max_retry_delay_millis": 10000, + "initial_rpc_timeout_millis": 60000, + "rpc_timeout_multiplier": 1, + "max_rpc_timeout_millis": 60000, + "total_timeout_millis": 600000 + } + }, + "methods": { + "ListClusters": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "ce5b960a6ed052e690863808e4f0deff3dc7d49f" + }, + "GetCluster": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "ce5b960a6ed052e690863808e4f0deff3dc7d49f" + }, + "CreateCluster": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "UpdateCluster": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "DeleteCluster": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "GenerateAccessToken": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "ListNodePools": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "ce5b960a6ed052e690863808e4f0deff3dc7d49f" + }, + "GetNodePool": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "ce5b960a6ed052e690863808e4f0deff3dc7d49f" + }, + "CreateNodePool": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "UpdateNodePool": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "DeleteNodePool": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "ListMachines": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "ce5b960a6ed052e690863808e4f0deff3dc7d49f" + }, + "GetMachine": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "ce5b960a6ed052e690863808e4f0deff3dc7d49f" + }, + "ListVpnConnections": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "ce5b960a6ed052e690863808e4f0deff3dc7d49f" + }, + "GetVpnConnection": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "ce5b960a6ed052e690863808e4f0deff3dc7d49f" + }, + "CreateVpnConnection": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "DeleteVpnConnection": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + } + } + } + } +} diff --git a/packages/google-cloud-edgecontainer/src/v1/edge_container_proto_list.json b/packages/google-cloud-edgecontainer/src/v1/edge_container_proto_list.json new file mode 100644 index 00000000000..5426de080f4 --- /dev/null +++ b/packages/google-cloud-edgecontainer/src/v1/edge_container_proto_list.json @@ -0,0 +1,4 @@ +[ + "../../protos/google/cloud/edgecontainer/v1/resources.proto", + "../../protos/google/cloud/edgecontainer/v1/service.proto" +] diff --git a/packages/google-cloud-edgecontainer/src/v1/gapic_metadata.json b/packages/google-cloud-edgecontainer/src/v1/gapic_metadata.json new file mode 100644 index 00000000000..700ce66c432 --- /dev/null +++ b/packages/google-cloud-edgecontainer/src/v1/gapic_metadata.json @@ -0,0 +1,209 @@ +{ + "schema": "1.0", + "comment": "This file maps proto services/RPCs to the corresponding library clients/methods", + "language": "typescript", + "protoPackage": "google.cloud.edgecontainer.v1", + "libraryPackage": "@google-cloud/edgecontainer", + "services": { + "EdgeContainer": { + "clients": { + "grpc": { + "libraryClient": "EdgeContainerClient", + "rpcs": { + "GetCluster": { + "methods": [ + "getCluster" + ] + }, + "GenerateAccessToken": { + "methods": [ + "generateAccessToken" + ] + }, + "GetNodePool": { + "methods": [ + "getNodePool" + ] + }, + "GetMachine": { + "methods": [ + "getMachine" + ] + }, + "GetVpnConnection": { + "methods": [ + "getVpnConnection" + ] + }, + "CreateCluster": { + "methods": [ + "createCluster" + ] + }, + "UpdateCluster": { + "methods": [ + "updateCluster" + ] + }, + "DeleteCluster": { + "methods": [ + "deleteCluster" + ] + }, + "CreateNodePool": { + "methods": [ + "createNodePool" + ] + }, + "UpdateNodePool": { + "methods": [ + "updateNodePool" + ] + }, + "DeleteNodePool": { + "methods": [ + "deleteNodePool" + ] + }, + "CreateVpnConnection": { + "methods": [ + "createVpnConnection" + ] + }, + "DeleteVpnConnection": { + "methods": [ + "deleteVpnConnection" + ] + }, + "ListClusters": { + "methods": [ + "listClusters", + "listClustersStream", + "listClustersAsync" + ] + }, + "ListNodePools": { + "methods": [ + "listNodePools", + "listNodePoolsStream", + "listNodePoolsAsync" + ] + }, + "ListMachines": { + "methods": [ + "listMachines", + "listMachinesStream", + "listMachinesAsync" + ] + }, + "ListVpnConnections": { + "methods": [ + "listVpnConnections", + "listVpnConnectionsStream", + "listVpnConnectionsAsync" + ] + } + } + }, + "grpc-fallback": { + "libraryClient": "EdgeContainerClient", + "rpcs": { + "GetCluster": { + "methods": [ + "getCluster" + ] + }, + "GenerateAccessToken": { + "methods": [ + "generateAccessToken" + ] + }, + "GetNodePool": { + "methods": [ + "getNodePool" + ] + }, + "GetMachine": { + "methods": [ + "getMachine" + ] + }, + "GetVpnConnection": { + "methods": [ + "getVpnConnection" + ] + }, + "CreateCluster": { + "methods": [ + "createCluster" + ] + }, + "UpdateCluster": { + "methods": [ + "updateCluster" + ] + }, + "DeleteCluster": { + "methods": [ + "deleteCluster" + ] + }, + "CreateNodePool": { + "methods": [ + "createNodePool" + ] + }, + "UpdateNodePool": { + "methods": [ + "updateNodePool" + ] + }, + "DeleteNodePool": { + "methods": [ + "deleteNodePool" + ] + }, + "CreateVpnConnection": { + "methods": [ + "createVpnConnection" + ] + }, + "DeleteVpnConnection": { + "methods": [ + "deleteVpnConnection" + ] + }, + "ListClusters": { + "methods": [ + "listClusters", + "listClustersStream", + "listClustersAsync" + ] + }, + "ListNodePools": { + "methods": [ + "listNodePools", + "listNodePoolsStream", + "listNodePoolsAsync" + ] + }, + "ListMachines": { + "methods": [ + "listMachines", + "listMachinesStream", + "listMachinesAsync" + ] + }, + "ListVpnConnections": { + "methods": [ + "listVpnConnections", + "listVpnConnectionsStream", + "listVpnConnectionsAsync" + ] + } + } + } + } + } + } +} diff --git a/packages/google-cloud-edgecontainer/src/v1/index.ts b/packages/google-cloud-edgecontainer/src/v1/index.ts new file mode 100644 index 00000000000..ebc2d5b3c6c --- /dev/null +++ b/packages/google-cloud-edgecontainer/src/v1/index.ts @@ -0,0 +1,19 @@ +// Copyright 2023 Google LLC +// +// Licensed under the Apache License, Version 2.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 {EdgeContainerClient} from './edge_container_client'; diff --git a/packages/google-cloud-edgecontainer/system-test/fixtures/sample/src/index.js b/packages/google-cloud-edgecontainer/system-test/fixtures/sample/src/index.js new file mode 100644 index 00000000000..e3578d8c354 --- /dev/null +++ b/packages/google-cloud-edgecontainer/system-test/fixtures/sample/src/index.js @@ -0,0 +1,26 @@ +// Copyright 2023 Google LLC +// +// Licensed under the Apache License, Version 2.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 edgecontainer = require('@google-cloud/edgecontainer'); + +function main() { + const edgeContainerClient = new edgecontainer.EdgeContainerClient(); +} + +main(); diff --git a/packages/google-cloud-edgecontainer/system-test/fixtures/sample/src/index.ts b/packages/google-cloud-edgecontainer/system-test/fixtures/sample/src/index.ts new file mode 100644 index 00000000000..5ae5c8e3988 --- /dev/null +++ b/packages/google-cloud-edgecontainer/system-test/fixtures/sample/src/index.ts @@ -0,0 +1,32 @@ +// Copyright 2023 Google LLC +// +// Licensed under the Apache License, Version 2.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 {EdgeContainerClient} from '@google-cloud/edgecontainer'; + +// check that the client class type name can be used +function doStuffWithEdgeContainerClient(client: EdgeContainerClient) { + client.close(); +} + +function main() { + // check that the client instance can be created + const edgeContainerClient = new EdgeContainerClient(); + doStuffWithEdgeContainerClient(edgeContainerClient); +} + +main(); diff --git a/packages/google-cloud-edgecontainer/system-test/install.ts b/packages/google-cloud-edgecontainer/system-test/install.ts new file mode 100644 index 00000000000..f61fe236476 --- /dev/null +++ b/packages/google-cloud-edgecontainer/system-test/install.ts @@ -0,0 +1,51 @@ +// Copyright 2023 Google LLC +// +// Licensed under the Apache License, Version 2.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/google-cloud-edgecontainer/test/gapic_edge_container_v1.ts b/packages/google-cloud-edgecontainer/test/gapic_edge_container_v1.ts new file mode 100644 index 00000000000..1b9e151d79c --- /dev/null +++ b/packages/google-cloud-edgecontainer/test/gapic_edge_container_v1.ts @@ -0,0 +1,4648 @@ +// Copyright 2023 Google LLC +// +// Licensed under the Apache License, Version 2.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 edgecontainerModule 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 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('v1.EdgeContainerClient', () => { + describe('Common methods', () => { + it('has servicePath', () => { + const servicePath = + edgecontainerModule.v1.EdgeContainerClient.servicePath; + assert(servicePath); + }); + + it('has apiEndpoint', () => { + const apiEndpoint = + edgecontainerModule.v1.EdgeContainerClient.apiEndpoint; + assert(apiEndpoint); + }); + + it('has port', () => { + const port = edgecontainerModule.v1.EdgeContainerClient.port; + assert(port); + assert(typeof port === 'number'); + }); + + it('should create a client with no option', () => { + const client = new edgecontainerModule.v1.EdgeContainerClient(); + assert(client); + }); + + it('should create a client with gRPC fallback', () => { + const client = new edgecontainerModule.v1.EdgeContainerClient({ + fallback: true, + }); + assert(client); + }); + + it('has initialize method and supports deferred initialization', async () => { + const client = new edgecontainerModule.v1.EdgeContainerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + assert.strictEqual(client.edgeContainerStub, undefined); + await client.initialize(); + assert(client.edgeContainerStub); + }); + + it('has close method for the initialized client', done => { + const client = new edgecontainerModule.v1.EdgeContainerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + assert(client.edgeContainerStub); + client.close().then(() => { + done(); + }); + }); + + it('has close method for the non-initialized client', done => { + const client = new edgecontainerModule.v1.EdgeContainerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + assert.strictEqual(client.edgeContainerStub, undefined); + client.close().then(() => { + done(); + }); + }); + + it('has getProjectId method', async () => { + const fakeProjectId = 'fake-project-id'; + const client = new edgecontainerModule.v1.EdgeContainerClient({ + 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 edgecontainerModule.v1.EdgeContainerClient({ + 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('getCluster', () => { + it('invokes getCluster without error', async () => { + const client = new edgecontainerModule.v1.EdgeContainerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.edgecontainer.v1.GetClusterRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.edgecontainer.v1.GetClusterRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.edgecontainer.v1.Cluster() + ); + client.innerApiCalls.getCluster = stubSimpleCall(expectedResponse); + const [response] = await client.getCluster(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.getCluster as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getCluster as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getCluster without error using callback', async () => { + const client = new edgecontainerModule.v1.EdgeContainerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.edgecontainer.v1.GetClusterRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.edgecontainer.v1.GetClusterRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.edgecontainer.v1.Cluster() + ); + client.innerApiCalls.getCluster = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getCluster( + request, + ( + err?: Error | null, + result?: protos.google.cloud.edgecontainer.v1.ICluster | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.getCluster as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getCluster as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getCluster with error', async () => { + const client = new edgecontainerModule.v1.EdgeContainerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.edgecontainer.v1.GetClusterRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.edgecontainer.v1.GetClusterRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.getCluster = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.getCluster(request), expectedError); + const actualRequest = ( + client.innerApiCalls.getCluster as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getCluster as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getCluster with closed client', async () => { + const client = new edgecontainerModule.v1.EdgeContainerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.edgecontainer.v1.GetClusterRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.edgecontainer.v1.GetClusterRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.getCluster(request), expectedError); + }); + }); + + describe('generateAccessToken', () => { + it('invokes generateAccessToken without error', async () => { + const client = new edgecontainerModule.v1.EdgeContainerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.edgecontainer.v1.GenerateAccessTokenRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.edgecontainer.v1.GenerateAccessTokenRequest', + ['cluster'] + ); + request.cluster = defaultValue1; + const expectedHeaderRequestParams = `cluster=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.edgecontainer.v1.GenerateAccessTokenResponse() + ); + client.innerApiCalls.generateAccessToken = + stubSimpleCall(expectedResponse); + const [response] = await client.generateAccessToken(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.generateAccessToken as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.generateAccessToken as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes generateAccessToken without error using callback', async () => { + const client = new edgecontainerModule.v1.EdgeContainerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.edgecontainer.v1.GenerateAccessTokenRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.edgecontainer.v1.GenerateAccessTokenRequest', + ['cluster'] + ); + request.cluster = defaultValue1; + const expectedHeaderRequestParams = `cluster=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.edgecontainer.v1.GenerateAccessTokenResponse() + ); + client.innerApiCalls.generateAccessToken = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.generateAccessToken( + request, + ( + err?: Error | null, + result?: protos.google.cloud.edgecontainer.v1.IGenerateAccessTokenResponse | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.generateAccessToken as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.generateAccessToken as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes generateAccessToken with error', async () => { + const client = new edgecontainerModule.v1.EdgeContainerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.edgecontainer.v1.GenerateAccessTokenRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.edgecontainer.v1.GenerateAccessTokenRequest', + ['cluster'] + ); + request.cluster = defaultValue1; + const expectedHeaderRequestParams = `cluster=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.generateAccessToken = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.generateAccessToken(request), expectedError); + const actualRequest = ( + client.innerApiCalls.generateAccessToken as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.generateAccessToken as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes generateAccessToken with closed client', async () => { + const client = new edgecontainerModule.v1.EdgeContainerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.edgecontainer.v1.GenerateAccessTokenRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.edgecontainer.v1.GenerateAccessTokenRequest', + ['cluster'] + ); + request.cluster = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.generateAccessToken(request), expectedError); + }); + }); + + describe('getNodePool', () => { + it('invokes getNodePool without error', async () => { + const client = new edgecontainerModule.v1.EdgeContainerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.edgecontainer.v1.GetNodePoolRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.edgecontainer.v1.GetNodePoolRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.edgecontainer.v1.NodePool() + ); + client.innerApiCalls.getNodePool = stubSimpleCall(expectedResponse); + const [response] = await client.getNodePool(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.getNodePool as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getNodePool as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getNodePool without error using callback', async () => { + const client = new edgecontainerModule.v1.EdgeContainerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.edgecontainer.v1.GetNodePoolRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.edgecontainer.v1.GetNodePoolRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.edgecontainer.v1.NodePool() + ); + client.innerApiCalls.getNodePool = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getNodePool( + request, + ( + err?: Error | null, + result?: protos.google.cloud.edgecontainer.v1.INodePool | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.getNodePool as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getNodePool as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getNodePool with error', async () => { + const client = new edgecontainerModule.v1.EdgeContainerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.edgecontainer.v1.GetNodePoolRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.edgecontainer.v1.GetNodePoolRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.getNodePool = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.getNodePool(request), expectedError); + const actualRequest = ( + client.innerApiCalls.getNodePool as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getNodePool as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getNodePool with closed client', async () => { + const client = new edgecontainerModule.v1.EdgeContainerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.edgecontainer.v1.GetNodePoolRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.edgecontainer.v1.GetNodePoolRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.getNodePool(request), expectedError); + }); + }); + + describe('getMachine', () => { + it('invokes getMachine without error', async () => { + const client = new edgecontainerModule.v1.EdgeContainerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.edgecontainer.v1.GetMachineRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.edgecontainer.v1.GetMachineRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.edgecontainer.v1.Machine() + ); + client.innerApiCalls.getMachine = stubSimpleCall(expectedResponse); + const [response] = await client.getMachine(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.getMachine as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getMachine as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getMachine without error using callback', async () => { + const client = new edgecontainerModule.v1.EdgeContainerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.edgecontainer.v1.GetMachineRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.edgecontainer.v1.GetMachineRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.edgecontainer.v1.Machine() + ); + client.innerApiCalls.getMachine = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getMachine( + request, + ( + err?: Error | null, + result?: protos.google.cloud.edgecontainer.v1.IMachine | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.getMachine as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getMachine as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getMachine with error', async () => { + const client = new edgecontainerModule.v1.EdgeContainerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.edgecontainer.v1.GetMachineRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.edgecontainer.v1.GetMachineRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.getMachine = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.getMachine(request), expectedError); + const actualRequest = ( + client.innerApiCalls.getMachine as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getMachine as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getMachine with closed client', async () => { + const client = new edgecontainerModule.v1.EdgeContainerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.edgecontainer.v1.GetMachineRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.edgecontainer.v1.GetMachineRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.getMachine(request), expectedError); + }); + }); + + describe('getVpnConnection', () => { + it('invokes getVpnConnection without error', async () => { + const client = new edgecontainerModule.v1.EdgeContainerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.edgecontainer.v1.GetVpnConnectionRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.edgecontainer.v1.GetVpnConnectionRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.edgecontainer.v1.VpnConnection() + ); + client.innerApiCalls.getVpnConnection = stubSimpleCall(expectedResponse); + const [response] = await client.getVpnConnection(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.getVpnConnection as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getVpnConnection as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getVpnConnection without error using callback', async () => { + const client = new edgecontainerModule.v1.EdgeContainerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.edgecontainer.v1.GetVpnConnectionRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.edgecontainer.v1.GetVpnConnectionRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.edgecontainer.v1.VpnConnection() + ); + client.innerApiCalls.getVpnConnection = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getVpnConnection( + request, + ( + err?: Error | null, + result?: protos.google.cloud.edgecontainer.v1.IVpnConnection | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.getVpnConnection as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getVpnConnection as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getVpnConnection with error', async () => { + const client = new edgecontainerModule.v1.EdgeContainerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.edgecontainer.v1.GetVpnConnectionRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.edgecontainer.v1.GetVpnConnectionRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.getVpnConnection = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.getVpnConnection(request), expectedError); + const actualRequest = ( + client.innerApiCalls.getVpnConnection as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getVpnConnection as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getVpnConnection with closed client', async () => { + const client = new edgecontainerModule.v1.EdgeContainerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.edgecontainer.v1.GetVpnConnectionRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.edgecontainer.v1.GetVpnConnectionRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.getVpnConnection(request), expectedError); + }); + }); + + describe('createCluster', () => { + it('invokes createCluster without error', async () => { + const client = new edgecontainerModule.v1.EdgeContainerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.edgecontainer.v1.CreateClusterRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.edgecontainer.v1.CreateClusterRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.createCluster = + stubLongRunningCall(expectedResponse); + const [operation] = await client.createCluster(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.createCluster as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createCluster as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createCluster without error using callback', async () => { + const client = new edgecontainerModule.v1.EdgeContainerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.edgecontainer.v1.CreateClusterRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.edgecontainer.v1.CreateClusterRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.createCluster = + stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.createCluster( + request, + ( + err?: Error | null, + result?: LROperation< + protos.google.cloud.edgecontainer.v1.ICluster, + protos.google.cloud.edgecontainer.v1.IOperationMetadata + > | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const operation = (await promise) as LROperation< + protos.google.cloud.edgecontainer.v1.ICluster, + protos.google.cloud.edgecontainer.v1.IOperationMetadata + >; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.createCluster as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createCluster as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createCluster with call error', async () => { + const client = new edgecontainerModule.v1.EdgeContainerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.edgecontainer.v1.CreateClusterRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.edgecontainer.v1.CreateClusterRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.createCluster = stubLongRunningCall( + undefined, + expectedError + ); + await assert.rejects(client.createCluster(request), expectedError); + const actualRequest = ( + client.innerApiCalls.createCluster as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createCluster as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createCluster with LRO error', async () => { + const client = new edgecontainerModule.v1.EdgeContainerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.edgecontainer.v1.CreateClusterRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.edgecontainer.v1.CreateClusterRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.createCluster = stubLongRunningCall( + undefined, + undefined, + expectedError + ); + const [operation] = await client.createCluster(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = ( + client.innerApiCalls.createCluster as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createCluster as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkCreateClusterProgress without error', async () => { + const client = new edgecontainerModule.v1.EdgeContainerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + 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.checkCreateClusterProgress( + expectedResponse.name + ); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkCreateClusterProgress with error', async () => { + const client = new edgecontainerModule.v1.EdgeContainerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const expectedError = new Error('expected'); + + client.operationsClient.getOperation = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects( + client.checkCreateClusterProgress(''), + expectedError + ); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + }); + + describe('updateCluster', () => { + it('invokes updateCluster without error', async () => { + const client = new edgecontainerModule.v1.EdgeContainerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.edgecontainer.v1.UpdateClusterRequest() + ); + request.cluster ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.edgecontainer.v1.UpdateClusterRequest', + ['cluster', 'name'] + ); + request.cluster.name = defaultValue1; + const expectedHeaderRequestParams = `cluster.name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.updateCluster = + stubLongRunningCall(expectedResponse); + const [operation] = await client.updateCluster(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.updateCluster as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateCluster as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateCluster without error using callback', async () => { + const client = new edgecontainerModule.v1.EdgeContainerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.edgecontainer.v1.UpdateClusterRequest() + ); + request.cluster ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.edgecontainer.v1.UpdateClusterRequest', + ['cluster', 'name'] + ); + request.cluster.name = defaultValue1; + const expectedHeaderRequestParams = `cluster.name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.updateCluster = + stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.updateCluster( + request, + ( + err?: Error | null, + result?: LROperation< + protos.google.cloud.edgecontainer.v1.ICluster, + protos.google.cloud.edgecontainer.v1.IOperationMetadata + > | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const operation = (await promise) as LROperation< + protos.google.cloud.edgecontainer.v1.ICluster, + protos.google.cloud.edgecontainer.v1.IOperationMetadata + >; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.updateCluster as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateCluster as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateCluster with call error', async () => { + const client = new edgecontainerModule.v1.EdgeContainerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.edgecontainer.v1.UpdateClusterRequest() + ); + request.cluster ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.edgecontainer.v1.UpdateClusterRequest', + ['cluster', 'name'] + ); + request.cluster.name = defaultValue1; + const expectedHeaderRequestParams = `cluster.name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.updateCluster = stubLongRunningCall( + undefined, + expectedError + ); + await assert.rejects(client.updateCluster(request), expectedError); + const actualRequest = ( + client.innerApiCalls.updateCluster as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateCluster as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateCluster with LRO error', async () => { + const client = new edgecontainerModule.v1.EdgeContainerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.edgecontainer.v1.UpdateClusterRequest() + ); + request.cluster ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.edgecontainer.v1.UpdateClusterRequest', + ['cluster', 'name'] + ); + request.cluster.name = defaultValue1; + const expectedHeaderRequestParams = `cluster.name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.updateCluster = stubLongRunningCall( + undefined, + undefined, + expectedError + ); + const [operation] = await client.updateCluster(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = ( + client.innerApiCalls.updateCluster as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateCluster as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkUpdateClusterProgress without error', async () => { + const client = new edgecontainerModule.v1.EdgeContainerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + 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.checkUpdateClusterProgress( + expectedResponse.name + ); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkUpdateClusterProgress with error', async () => { + const client = new edgecontainerModule.v1.EdgeContainerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const expectedError = new Error('expected'); + + client.operationsClient.getOperation = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects( + client.checkUpdateClusterProgress(''), + expectedError + ); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + }); + + describe('deleteCluster', () => { + it('invokes deleteCluster without error', async () => { + const client = new edgecontainerModule.v1.EdgeContainerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.edgecontainer.v1.DeleteClusterRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.edgecontainer.v1.DeleteClusterRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.deleteCluster = + stubLongRunningCall(expectedResponse); + const [operation] = await client.deleteCluster(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.deleteCluster as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteCluster as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteCluster without error using callback', async () => { + const client = new edgecontainerModule.v1.EdgeContainerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.edgecontainer.v1.DeleteClusterRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.edgecontainer.v1.DeleteClusterRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.deleteCluster = + stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.deleteCluster( + request, + ( + err?: Error | null, + result?: LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.edgecontainer.v1.IOperationMetadata + > | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const operation = (await promise) as LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.edgecontainer.v1.IOperationMetadata + >; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.deleteCluster as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteCluster as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteCluster with call error', async () => { + const client = new edgecontainerModule.v1.EdgeContainerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.edgecontainer.v1.DeleteClusterRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.edgecontainer.v1.DeleteClusterRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteCluster = stubLongRunningCall( + undefined, + expectedError + ); + await assert.rejects(client.deleteCluster(request), expectedError); + const actualRequest = ( + client.innerApiCalls.deleteCluster as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteCluster as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteCluster with LRO error', async () => { + const client = new edgecontainerModule.v1.EdgeContainerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.edgecontainer.v1.DeleteClusterRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.edgecontainer.v1.DeleteClusterRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteCluster = stubLongRunningCall( + undefined, + undefined, + expectedError + ); + const [operation] = await client.deleteCluster(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = ( + client.innerApiCalls.deleteCluster as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteCluster as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkDeleteClusterProgress without error', async () => { + const client = new edgecontainerModule.v1.EdgeContainerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + 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.checkDeleteClusterProgress( + expectedResponse.name + ); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkDeleteClusterProgress with error', async () => { + const client = new edgecontainerModule.v1.EdgeContainerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const expectedError = new Error('expected'); + + client.operationsClient.getOperation = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects( + client.checkDeleteClusterProgress(''), + expectedError + ); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + }); + + describe('createNodePool', () => { + it('invokes createNodePool without error', async () => { + const client = new edgecontainerModule.v1.EdgeContainerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.edgecontainer.v1.CreateNodePoolRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.edgecontainer.v1.CreateNodePoolRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.createNodePool = + stubLongRunningCall(expectedResponse); + const [operation] = await client.createNodePool(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.createNodePool as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createNodePool as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createNodePool without error using callback', async () => { + const client = new edgecontainerModule.v1.EdgeContainerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.edgecontainer.v1.CreateNodePoolRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.edgecontainer.v1.CreateNodePoolRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.createNodePool = + stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.createNodePool( + request, + ( + err?: Error | null, + result?: LROperation< + protos.google.cloud.edgecontainer.v1.INodePool, + protos.google.cloud.edgecontainer.v1.IOperationMetadata + > | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const operation = (await promise) as LROperation< + protos.google.cloud.edgecontainer.v1.INodePool, + protos.google.cloud.edgecontainer.v1.IOperationMetadata + >; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.createNodePool as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createNodePool as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createNodePool with call error', async () => { + const client = new edgecontainerModule.v1.EdgeContainerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.edgecontainer.v1.CreateNodePoolRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.edgecontainer.v1.CreateNodePoolRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.createNodePool = stubLongRunningCall( + undefined, + expectedError + ); + await assert.rejects(client.createNodePool(request), expectedError); + const actualRequest = ( + client.innerApiCalls.createNodePool as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createNodePool as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createNodePool with LRO error', async () => { + const client = new edgecontainerModule.v1.EdgeContainerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.edgecontainer.v1.CreateNodePoolRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.edgecontainer.v1.CreateNodePoolRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.createNodePool = stubLongRunningCall( + undefined, + undefined, + expectedError + ); + const [operation] = await client.createNodePool(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = ( + client.innerApiCalls.createNodePool as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createNodePool as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkCreateNodePoolProgress without error', async () => { + const client = new edgecontainerModule.v1.EdgeContainerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + 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.checkCreateNodePoolProgress( + expectedResponse.name + ); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkCreateNodePoolProgress with error', async () => { + const client = new edgecontainerModule.v1.EdgeContainerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const expectedError = new Error('expected'); + + client.operationsClient.getOperation = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects( + client.checkCreateNodePoolProgress(''), + expectedError + ); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + }); + + describe('updateNodePool', () => { + it('invokes updateNodePool without error', async () => { + const client = new edgecontainerModule.v1.EdgeContainerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.edgecontainer.v1.UpdateNodePoolRequest() + ); + request.nodePool ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.edgecontainer.v1.UpdateNodePoolRequest', + ['nodePool', 'name'] + ); + request.nodePool.name = defaultValue1; + const expectedHeaderRequestParams = `node_pool.name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.updateNodePool = + stubLongRunningCall(expectedResponse); + const [operation] = await client.updateNodePool(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.updateNodePool as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateNodePool as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateNodePool without error using callback', async () => { + const client = new edgecontainerModule.v1.EdgeContainerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.edgecontainer.v1.UpdateNodePoolRequest() + ); + request.nodePool ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.edgecontainer.v1.UpdateNodePoolRequest', + ['nodePool', 'name'] + ); + request.nodePool.name = defaultValue1; + const expectedHeaderRequestParams = `node_pool.name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.updateNodePool = + stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.updateNodePool( + request, + ( + err?: Error | null, + result?: LROperation< + protos.google.cloud.edgecontainer.v1.INodePool, + protos.google.cloud.edgecontainer.v1.IOperationMetadata + > | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const operation = (await promise) as LROperation< + protos.google.cloud.edgecontainer.v1.INodePool, + protos.google.cloud.edgecontainer.v1.IOperationMetadata + >; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.updateNodePool as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateNodePool as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateNodePool with call error', async () => { + const client = new edgecontainerModule.v1.EdgeContainerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.edgecontainer.v1.UpdateNodePoolRequest() + ); + request.nodePool ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.edgecontainer.v1.UpdateNodePoolRequest', + ['nodePool', 'name'] + ); + request.nodePool.name = defaultValue1; + const expectedHeaderRequestParams = `node_pool.name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.updateNodePool = stubLongRunningCall( + undefined, + expectedError + ); + await assert.rejects(client.updateNodePool(request), expectedError); + const actualRequest = ( + client.innerApiCalls.updateNodePool as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateNodePool as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateNodePool with LRO error', async () => { + const client = new edgecontainerModule.v1.EdgeContainerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.edgecontainer.v1.UpdateNodePoolRequest() + ); + request.nodePool ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.edgecontainer.v1.UpdateNodePoolRequest', + ['nodePool', 'name'] + ); + request.nodePool.name = defaultValue1; + const expectedHeaderRequestParams = `node_pool.name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.updateNodePool = stubLongRunningCall( + undefined, + undefined, + expectedError + ); + const [operation] = await client.updateNodePool(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = ( + client.innerApiCalls.updateNodePool as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateNodePool as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkUpdateNodePoolProgress without error', async () => { + const client = new edgecontainerModule.v1.EdgeContainerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + 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.checkUpdateNodePoolProgress( + expectedResponse.name + ); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkUpdateNodePoolProgress with error', async () => { + const client = new edgecontainerModule.v1.EdgeContainerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const expectedError = new Error('expected'); + + client.operationsClient.getOperation = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects( + client.checkUpdateNodePoolProgress(''), + expectedError + ); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + }); + + describe('deleteNodePool', () => { + it('invokes deleteNodePool without error', async () => { + const client = new edgecontainerModule.v1.EdgeContainerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.edgecontainer.v1.DeleteNodePoolRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.edgecontainer.v1.DeleteNodePoolRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.deleteNodePool = + stubLongRunningCall(expectedResponse); + const [operation] = await client.deleteNodePool(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.deleteNodePool as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteNodePool as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteNodePool without error using callback', async () => { + const client = new edgecontainerModule.v1.EdgeContainerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.edgecontainer.v1.DeleteNodePoolRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.edgecontainer.v1.DeleteNodePoolRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.deleteNodePool = + stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.deleteNodePool( + request, + ( + err?: Error | null, + result?: LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.edgecontainer.v1.IOperationMetadata + > | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const operation = (await promise) as LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.edgecontainer.v1.IOperationMetadata + >; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.deleteNodePool as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteNodePool as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteNodePool with call error', async () => { + const client = new edgecontainerModule.v1.EdgeContainerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.edgecontainer.v1.DeleteNodePoolRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.edgecontainer.v1.DeleteNodePoolRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteNodePool = stubLongRunningCall( + undefined, + expectedError + ); + await assert.rejects(client.deleteNodePool(request), expectedError); + const actualRequest = ( + client.innerApiCalls.deleteNodePool as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteNodePool as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteNodePool with LRO error', async () => { + const client = new edgecontainerModule.v1.EdgeContainerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.edgecontainer.v1.DeleteNodePoolRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.edgecontainer.v1.DeleteNodePoolRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteNodePool = stubLongRunningCall( + undefined, + undefined, + expectedError + ); + const [operation] = await client.deleteNodePool(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = ( + client.innerApiCalls.deleteNodePool as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteNodePool as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkDeleteNodePoolProgress without error', async () => { + const client = new edgecontainerModule.v1.EdgeContainerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + 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.checkDeleteNodePoolProgress( + expectedResponse.name + ); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkDeleteNodePoolProgress with error', async () => { + const client = new edgecontainerModule.v1.EdgeContainerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const expectedError = new Error('expected'); + + client.operationsClient.getOperation = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects( + client.checkDeleteNodePoolProgress(''), + expectedError + ); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + }); + + describe('createVpnConnection', () => { + it('invokes createVpnConnection without error', async () => { + const client = new edgecontainerModule.v1.EdgeContainerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.edgecontainer.v1.CreateVpnConnectionRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.edgecontainer.v1.CreateVpnConnectionRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.createVpnConnection = + stubLongRunningCall(expectedResponse); + const [operation] = await client.createVpnConnection(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.createVpnConnection as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createVpnConnection as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createVpnConnection without error using callback', async () => { + const client = new edgecontainerModule.v1.EdgeContainerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.edgecontainer.v1.CreateVpnConnectionRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.edgecontainer.v1.CreateVpnConnectionRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.createVpnConnection = + stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.createVpnConnection( + request, + ( + err?: Error | null, + result?: LROperation< + protos.google.cloud.edgecontainer.v1.IVpnConnection, + protos.google.cloud.edgecontainer.v1.IOperationMetadata + > | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const operation = (await promise) as LROperation< + protos.google.cloud.edgecontainer.v1.IVpnConnection, + protos.google.cloud.edgecontainer.v1.IOperationMetadata + >; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.createVpnConnection as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createVpnConnection as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createVpnConnection with call error', async () => { + const client = new edgecontainerModule.v1.EdgeContainerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.edgecontainer.v1.CreateVpnConnectionRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.edgecontainer.v1.CreateVpnConnectionRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.createVpnConnection = stubLongRunningCall( + undefined, + expectedError + ); + await assert.rejects(client.createVpnConnection(request), expectedError); + const actualRequest = ( + client.innerApiCalls.createVpnConnection as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createVpnConnection as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createVpnConnection with LRO error', async () => { + const client = new edgecontainerModule.v1.EdgeContainerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.edgecontainer.v1.CreateVpnConnectionRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.edgecontainer.v1.CreateVpnConnectionRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.createVpnConnection = stubLongRunningCall( + undefined, + undefined, + expectedError + ); + const [operation] = await client.createVpnConnection(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = ( + client.innerApiCalls.createVpnConnection as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createVpnConnection as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkCreateVpnConnectionProgress without error', async () => { + const client = new edgecontainerModule.v1.EdgeContainerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + 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.checkCreateVpnConnectionProgress( + expectedResponse.name + ); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkCreateVpnConnectionProgress with error', async () => { + const client = new edgecontainerModule.v1.EdgeContainerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const expectedError = new Error('expected'); + + client.operationsClient.getOperation = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects( + client.checkCreateVpnConnectionProgress(''), + expectedError + ); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + }); + + describe('deleteVpnConnection', () => { + it('invokes deleteVpnConnection without error', async () => { + const client = new edgecontainerModule.v1.EdgeContainerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.edgecontainer.v1.DeleteVpnConnectionRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.edgecontainer.v1.DeleteVpnConnectionRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.deleteVpnConnection = + stubLongRunningCall(expectedResponse); + const [operation] = await client.deleteVpnConnection(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.deleteVpnConnection as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteVpnConnection as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteVpnConnection without error using callback', async () => { + const client = new edgecontainerModule.v1.EdgeContainerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.edgecontainer.v1.DeleteVpnConnectionRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.edgecontainer.v1.DeleteVpnConnectionRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.deleteVpnConnection = + stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.deleteVpnConnection( + request, + ( + err?: Error | null, + result?: LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.edgecontainer.v1.IOperationMetadata + > | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const operation = (await promise) as LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.edgecontainer.v1.IOperationMetadata + >; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.deleteVpnConnection as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteVpnConnection as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteVpnConnection with call error', async () => { + const client = new edgecontainerModule.v1.EdgeContainerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.edgecontainer.v1.DeleteVpnConnectionRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.edgecontainer.v1.DeleteVpnConnectionRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteVpnConnection = stubLongRunningCall( + undefined, + expectedError + ); + await assert.rejects(client.deleteVpnConnection(request), expectedError); + const actualRequest = ( + client.innerApiCalls.deleteVpnConnection as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteVpnConnection as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteVpnConnection with LRO error', async () => { + const client = new edgecontainerModule.v1.EdgeContainerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.edgecontainer.v1.DeleteVpnConnectionRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.edgecontainer.v1.DeleteVpnConnectionRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteVpnConnection = stubLongRunningCall( + undefined, + undefined, + expectedError + ); + const [operation] = await client.deleteVpnConnection(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = ( + client.innerApiCalls.deleteVpnConnection as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteVpnConnection as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkDeleteVpnConnectionProgress without error', async () => { + const client = new edgecontainerModule.v1.EdgeContainerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + 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.checkDeleteVpnConnectionProgress( + expectedResponse.name + ); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkDeleteVpnConnectionProgress with error', async () => { + const client = new edgecontainerModule.v1.EdgeContainerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const expectedError = new Error('expected'); + + client.operationsClient.getOperation = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects( + client.checkDeleteVpnConnectionProgress(''), + expectedError + ); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + }); + + describe('listClusters', () => { + it('invokes listClusters without error', async () => { + const client = new edgecontainerModule.v1.EdgeContainerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.edgecontainer.v1.ListClustersRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.edgecontainer.v1.ListClustersRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.edgecontainer.v1.Cluster() + ), + generateSampleMessage( + new protos.google.cloud.edgecontainer.v1.Cluster() + ), + generateSampleMessage( + new protos.google.cloud.edgecontainer.v1.Cluster() + ), + ]; + client.innerApiCalls.listClusters = stubSimpleCall(expectedResponse); + const [response] = await client.listClusters(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.listClusters as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listClusters as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listClusters without error using callback', async () => { + const client = new edgecontainerModule.v1.EdgeContainerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.edgecontainer.v1.ListClustersRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.edgecontainer.v1.ListClustersRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.edgecontainer.v1.Cluster() + ), + generateSampleMessage( + new protos.google.cloud.edgecontainer.v1.Cluster() + ), + generateSampleMessage( + new protos.google.cloud.edgecontainer.v1.Cluster() + ), + ]; + client.innerApiCalls.listClusters = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.listClusters( + request, + ( + err?: Error | null, + result?: protos.google.cloud.edgecontainer.v1.ICluster[] | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.listClusters as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listClusters as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listClusters with error', async () => { + const client = new edgecontainerModule.v1.EdgeContainerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.edgecontainer.v1.ListClustersRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.edgecontainer.v1.ListClustersRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.listClusters = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.listClusters(request), expectedError); + const actualRequest = ( + client.innerApiCalls.listClusters as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listClusters as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listClustersStream without error', async () => { + const client = new edgecontainerModule.v1.EdgeContainerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.edgecontainer.v1.ListClustersRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.edgecontainer.v1.ListClustersRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.edgecontainer.v1.Cluster() + ), + generateSampleMessage( + new protos.google.cloud.edgecontainer.v1.Cluster() + ), + generateSampleMessage( + new protos.google.cloud.edgecontainer.v1.Cluster() + ), + ]; + client.descriptors.page.listClusters.createStream = + stubPageStreamingCall(expectedResponse); + const stream = client.listClustersStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.edgecontainer.v1.Cluster[] = []; + stream.on( + 'data', + (response: protos.google.cloud.edgecontainer.v1.Cluster) => { + 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.listClusters.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.listClusters, request) + ); + assert( + (client.descriptors.page.listClusters.createStream as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('invokes listClustersStream with error', async () => { + const client = new edgecontainerModule.v1.EdgeContainerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.edgecontainer.v1.ListClustersRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.edgecontainer.v1.ListClustersRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.descriptors.page.listClusters.createStream = stubPageStreamingCall( + undefined, + expectedError + ); + const stream = client.listClustersStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.edgecontainer.v1.Cluster[] = []; + stream.on( + 'data', + (response: protos.google.cloud.edgecontainer.v1.Cluster) => { + responses.push(response); + } + ); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert( + (client.descriptors.page.listClusters.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.listClusters, request) + ); + assert( + (client.descriptors.page.listClusters.createStream as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listClusters without error', async () => { + const client = new edgecontainerModule.v1.EdgeContainerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.edgecontainer.v1.ListClustersRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.edgecontainer.v1.ListClustersRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.edgecontainer.v1.Cluster() + ), + generateSampleMessage( + new protos.google.cloud.edgecontainer.v1.Cluster() + ), + generateSampleMessage( + new protos.google.cloud.edgecontainer.v1.Cluster() + ), + ]; + client.descriptors.page.listClusters.asyncIterate = + stubAsyncIterationCall(expectedResponse); + const responses: protos.google.cloud.edgecontainer.v1.ICluster[] = []; + const iterable = client.listClustersAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + ( + client.descriptors.page.listClusters.asyncIterate as SinonStub + ).getCall(0).args[1], + request + ); + assert( + (client.descriptors.page.listClusters.asyncIterate as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listClusters with error', async () => { + const client = new edgecontainerModule.v1.EdgeContainerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.edgecontainer.v1.ListClustersRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.edgecontainer.v1.ListClustersRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.descriptors.page.listClusters.asyncIterate = + stubAsyncIterationCall(undefined, expectedError); + const iterable = client.listClustersAsync(request); + await assert.rejects(async () => { + const responses: protos.google.cloud.edgecontainer.v1.ICluster[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + ( + client.descriptors.page.listClusters.asyncIterate as SinonStub + ).getCall(0).args[1], + request + ); + assert( + (client.descriptors.page.listClusters.asyncIterate as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + }); + + describe('listNodePools', () => { + it('invokes listNodePools without error', async () => { + const client = new edgecontainerModule.v1.EdgeContainerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.edgecontainer.v1.ListNodePoolsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.edgecontainer.v1.ListNodePoolsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.edgecontainer.v1.NodePool() + ), + generateSampleMessage( + new protos.google.cloud.edgecontainer.v1.NodePool() + ), + generateSampleMessage( + new protos.google.cloud.edgecontainer.v1.NodePool() + ), + ]; + client.innerApiCalls.listNodePools = stubSimpleCall(expectedResponse); + const [response] = await client.listNodePools(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.listNodePools as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listNodePools as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listNodePools without error using callback', async () => { + const client = new edgecontainerModule.v1.EdgeContainerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.edgecontainer.v1.ListNodePoolsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.edgecontainer.v1.ListNodePoolsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.edgecontainer.v1.NodePool() + ), + generateSampleMessage( + new protos.google.cloud.edgecontainer.v1.NodePool() + ), + generateSampleMessage( + new protos.google.cloud.edgecontainer.v1.NodePool() + ), + ]; + client.innerApiCalls.listNodePools = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.listNodePools( + request, + ( + err?: Error | null, + result?: protos.google.cloud.edgecontainer.v1.INodePool[] | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.listNodePools as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listNodePools as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listNodePools with error', async () => { + const client = new edgecontainerModule.v1.EdgeContainerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.edgecontainer.v1.ListNodePoolsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.edgecontainer.v1.ListNodePoolsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.listNodePools = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.listNodePools(request), expectedError); + const actualRequest = ( + client.innerApiCalls.listNodePools as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listNodePools as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listNodePoolsStream without error', async () => { + const client = new edgecontainerModule.v1.EdgeContainerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.edgecontainer.v1.ListNodePoolsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.edgecontainer.v1.ListNodePoolsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.edgecontainer.v1.NodePool() + ), + generateSampleMessage( + new protos.google.cloud.edgecontainer.v1.NodePool() + ), + generateSampleMessage( + new protos.google.cloud.edgecontainer.v1.NodePool() + ), + ]; + client.descriptors.page.listNodePools.createStream = + stubPageStreamingCall(expectedResponse); + const stream = client.listNodePoolsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.edgecontainer.v1.NodePool[] = []; + stream.on( + 'data', + (response: protos.google.cloud.edgecontainer.v1.NodePool) => { + 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.listNodePools.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.listNodePools, request) + ); + assert( + (client.descriptors.page.listNodePools.createStream as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('invokes listNodePoolsStream with error', async () => { + const client = new edgecontainerModule.v1.EdgeContainerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.edgecontainer.v1.ListNodePoolsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.edgecontainer.v1.ListNodePoolsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.descriptors.page.listNodePools.createStream = + stubPageStreamingCall(undefined, expectedError); + const stream = client.listNodePoolsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.edgecontainer.v1.NodePool[] = []; + stream.on( + 'data', + (response: protos.google.cloud.edgecontainer.v1.NodePool) => { + responses.push(response); + } + ); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert( + (client.descriptors.page.listNodePools.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.listNodePools, request) + ); + assert( + (client.descriptors.page.listNodePools.createStream as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listNodePools without error', async () => { + const client = new edgecontainerModule.v1.EdgeContainerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.edgecontainer.v1.ListNodePoolsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.edgecontainer.v1.ListNodePoolsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.edgecontainer.v1.NodePool() + ), + generateSampleMessage( + new protos.google.cloud.edgecontainer.v1.NodePool() + ), + generateSampleMessage( + new protos.google.cloud.edgecontainer.v1.NodePool() + ), + ]; + client.descriptors.page.listNodePools.asyncIterate = + stubAsyncIterationCall(expectedResponse); + const responses: protos.google.cloud.edgecontainer.v1.INodePool[] = []; + const iterable = client.listNodePoolsAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + ( + client.descriptors.page.listNodePools.asyncIterate as SinonStub + ).getCall(0).args[1], + request + ); + assert( + (client.descriptors.page.listNodePools.asyncIterate as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listNodePools with error', async () => { + const client = new edgecontainerModule.v1.EdgeContainerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.edgecontainer.v1.ListNodePoolsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.edgecontainer.v1.ListNodePoolsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.descriptors.page.listNodePools.asyncIterate = + stubAsyncIterationCall(undefined, expectedError); + const iterable = client.listNodePoolsAsync(request); + await assert.rejects(async () => { + const responses: protos.google.cloud.edgecontainer.v1.INodePool[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + ( + client.descriptors.page.listNodePools.asyncIterate as SinonStub + ).getCall(0).args[1], + request + ); + assert( + (client.descriptors.page.listNodePools.asyncIterate as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + }); + + describe('listMachines', () => { + it('invokes listMachines without error', async () => { + const client = new edgecontainerModule.v1.EdgeContainerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.edgecontainer.v1.ListMachinesRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.edgecontainer.v1.ListMachinesRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.edgecontainer.v1.Machine() + ), + generateSampleMessage( + new protos.google.cloud.edgecontainer.v1.Machine() + ), + generateSampleMessage( + new protos.google.cloud.edgecontainer.v1.Machine() + ), + ]; + client.innerApiCalls.listMachines = stubSimpleCall(expectedResponse); + const [response] = await client.listMachines(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.listMachines as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listMachines as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listMachines without error using callback', async () => { + const client = new edgecontainerModule.v1.EdgeContainerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.edgecontainer.v1.ListMachinesRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.edgecontainer.v1.ListMachinesRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.edgecontainer.v1.Machine() + ), + generateSampleMessage( + new protos.google.cloud.edgecontainer.v1.Machine() + ), + generateSampleMessage( + new protos.google.cloud.edgecontainer.v1.Machine() + ), + ]; + client.innerApiCalls.listMachines = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.listMachines( + request, + ( + err?: Error | null, + result?: protos.google.cloud.edgecontainer.v1.IMachine[] | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.listMachines as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listMachines as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listMachines with error', async () => { + const client = new edgecontainerModule.v1.EdgeContainerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.edgecontainer.v1.ListMachinesRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.edgecontainer.v1.ListMachinesRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.listMachines = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.listMachines(request), expectedError); + const actualRequest = ( + client.innerApiCalls.listMachines as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listMachines as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listMachinesStream without error', async () => { + const client = new edgecontainerModule.v1.EdgeContainerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.edgecontainer.v1.ListMachinesRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.edgecontainer.v1.ListMachinesRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.edgecontainer.v1.Machine() + ), + generateSampleMessage( + new protos.google.cloud.edgecontainer.v1.Machine() + ), + generateSampleMessage( + new protos.google.cloud.edgecontainer.v1.Machine() + ), + ]; + client.descriptors.page.listMachines.createStream = + stubPageStreamingCall(expectedResponse); + const stream = client.listMachinesStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.edgecontainer.v1.Machine[] = []; + stream.on( + 'data', + (response: protos.google.cloud.edgecontainer.v1.Machine) => { + 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.listMachines.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.listMachines, request) + ); + assert( + (client.descriptors.page.listMachines.createStream as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('invokes listMachinesStream with error', async () => { + const client = new edgecontainerModule.v1.EdgeContainerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.edgecontainer.v1.ListMachinesRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.edgecontainer.v1.ListMachinesRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.descriptors.page.listMachines.createStream = stubPageStreamingCall( + undefined, + expectedError + ); + const stream = client.listMachinesStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.edgecontainer.v1.Machine[] = []; + stream.on( + 'data', + (response: protos.google.cloud.edgecontainer.v1.Machine) => { + responses.push(response); + } + ); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert( + (client.descriptors.page.listMachines.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.listMachines, request) + ); + assert( + (client.descriptors.page.listMachines.createStream as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listMachines without error', async () => { + const client = new edgecontainerModule.v1.EdgeContainerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.edgecontainer.v1.ListMachinesRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.edgecontainer.v1.ListMachinesRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.edgecontainer.v1.Machine() + ), + generateSampleMessage( + new protos.google.cloud.edgecontainer.v1.Machine() + ), + generateSampleMessage( + new protos.google.cloud.edgecontainer.v1.Machine() + ), + ]; + client.descriptors.page.listMachines.asyncIterate = + stubAsyncIterationCall(expectedResponse); + const responses: protos.google.cloud.edgecontainer.v1.IMachine[] = []; + const iterable = client.listMachinesAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + ( + client.descriptors.page.listMachines.asyncIterate as SinonStub + ).getCall(0).args[1], + request + ); + assert( + (client.descriptors.page.listMachines.asyncIterate as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listMachines with error', async () => { + const client = new edgecontainerModule.v1.EdgeContainerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.edgecontainer.v1.ListMachinesRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.edgecontainer.v1.ListMachinesRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.descriptors.page.listMachines.asyncIterate = + stubAsyncIterationCall(undefined, expectedError); + const iterable = client.listMachinesAsync(request); + await assert.rejects(async () => { + const responses: protos.google.cloud.edgecontainer.v1.IMachine[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + ( + client.descriptors.page.listMachines.asyncIterate as SinonStub + ).getCall(0).args[1], + request + ); + assert( + (client.descriptors.page.listMachines.asyncIterate as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + }); + + describe('listVpnConnections', () => { + it('invokes listVpnConnections without error', async () => { + const client = new edgecontainerModule.v1.EdgeContainerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.edgecontainer.v1.ListVpnConnectionsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.edgecontainer.v1.ListVpnConnectionsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.edgecontainer.v1.VpnConnection() + ), + generateSampleMessage( + new protos.google.cloud.edgecontainer.v1.VpnConnection() + ), + generateSampleMessage( + new protos.google.cloud.edgecontainer.v1.VpnConnection() + ), + ]; + client.innerApiCalls.listVpnConnections = + stubSimpleCall(expectedResponse); + const [response] = await client.listVpnConnections(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.listVpnConnections as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listVpnConnections as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listVpnConnections without error using callback', async () => { + const client = new edgecontainerModule.v1.EdgeContainerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.edgecontainer.v1.ListVpnConnectionsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.edgecontainer.v1.ListVpnConnectionsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.edgecontainer.v1.VpnConnection() + ), + generateSampleMessage( + new protos.google.cloud.edgecontainer.v1.VpnConnection() + ), + generateSampleMessage( + new protos.google.cloud.edgecontainer.v1.VpnConnection() + ), + ]; + client.innerApiCalls.listVpnConnections = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.listVpnConnections( + request, + ( + err?: Error | null, + result?: + | protos.google.cloud.edgecontainer.v1.IVpnConnection[] + | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.listVpnConnections as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listVpnConnections as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listVpnConnections with error', async () => { + const client = new edgecontainerModule.v1.EdgeContainerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.edgecontainer.v1.ListVpnConnectionsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.edgecontainer.v1.ListVpnConnectionsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.listVpnConnections = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.listVpnConnections(request), expectedError); + const actualRequest = ( + client.innerApiCalls.listVpnConnections as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listVpnConnections as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listVpnConnectionsStream without error', async () => { + const client = new edgecontainerModule.v1.EdgeContainerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.edgecontainer.v1.ListVpnConnectionsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.edgecontainer.v1.ListVpnConnectionsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.edgecontainer.v1.VpnConnection() + ), + generateSampleMessage( + new protos.google.cloud.edgecontainer.v1.VpnConnection() + ), + generateSampleMessage( + new protos.google.cloud.edgecontainer.v1.VpnConnection() + ), + ]; + client.descriptors.page.listVpnConnections.createStream = + stubPageStreamingCall(expectedResponse); + const stream = client.listVpnConnectionsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.edgecontainer.v1.VpnConnection[] = + []; + stream.on( + 'data', + (response: protos.google.cloud.edgecontainer.v1.VpnConnection) => { + 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.listVpnConnections.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.listVpnConnections, request) + ); + assert( + (client.descriptors.page.listVpnConnections.createStream as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('invokes listVpnConnectionsStream with error', async () => { + const client = new edgecontainerModule.v1.EdgeContainerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.edgecontainer.v1.ListVpnConnectionsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.edgecontainer.v1.ListVpnConnectionsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.descriptors.page.listVpnConnections.createStream = + stubPageStreamingCall(undefined, expectedError); + const stream = client.listVpnConnectionsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.edgecontainer.v1.VpnConnection[] = + []; + stream.on( + 'data', + (response: protos.google.cloud.edgecontainer.v1.VpnConnection) => { + responses.push(response); + } + ); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert( + (client.descriptors.page.listVpnConnections.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.listVpnConnections, request) + ); + assert( + (client.descriptors.page.listVpnConnections.createStream as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listVpnConnections without error', async () => { + const client = new edgecontainerModule.v1.EdgeContainerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.edgecontainer.v1.ListVpnConnectionsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.edgecontainer.v1.ListVpnConnectionsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.edgecontainer.v1.VpnConnection() + ), + generateSampleMessage( + new protos.google.cloud.edgecontainer.v1.VpnConnection() + ), + generateSampleMessage( + new protos.google.cloud.edgecontainer.v1.VpnConnection() + ), + ]; + client.descriptors.page.listVpnConnections.asyncIterate = + stubAsyncIterationCall(expectedResponse); + const responses: protos.google.cloud.edgecontainer.v1.IVpnConnection[] = + []; + const iterable = client.listVpnConnectionsAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + ( + client.descriptors.page.listVpnConnections.asyncIterate as SinonStub + ).getCall(0).args[1], + request + ); + assert( + (client.descriptors.page.listVpnConnections.asyncIterate as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listVpnConnections with error', async () => { + const client = new edgecontainerModule.v1.EdgeContainerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.edgecontainer.v1.ListVpnConnectionsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.edgecontainer.v1.ListVpnConnectionsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.descriptors.page.listVpnConnections.asyncIterate = + stubAsyncIterationCall(undefined, expectedError); + const iterable = client.listVpnConnectionsAsync(request); + await assert.rejects(async () => { + const responses: protos.google.cloud.edgecontainer.v1.IVpnConnection[] = + []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + ( + client.descriptors.page.listVpnConnections.asyncIterate as SinonStub + ).getCall(0).args[1], + request + ); + assert( + (client.descriptors.page.listVpnConnections.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 edgecontainerModule.v1.EdgeContainerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + 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 edgecontainerModule.v1.EdgeContainerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + 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 edgecontainerModule.v1.EdgeContainerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + 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 edgecontainerModule.v1.EdgeContainerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + 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 edgecontainerModule.v1.EdgeContainerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + 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 edgecontainerModule.v1.EdgeContainerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + 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 edgecontainerModule.v1.EdgeContainerClient({ + 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); + } + } + ); + }); + 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 edgecontainerModule.v1.EdgeContainerClient({ + 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 edgecontainerModule.v1.EdgeContainerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + 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 edgecontainerModule.v1.EdgeContainerClient({ + 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); + } + } + ); + }); + 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 edgecontainerModule.v1.EdgeContainerClient({ + 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 edgecontainerModule.v1.EdgeContainerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + 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 edgecontainerModule.v1.EdgeContainerClient({ + 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); + } + } + ); + }); + 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 edgecontainerModule.v1.EdgeContainerClient({ + 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 edgecontainerModule.v1.EdgeContainerClient({ + 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.ListOperationsResponse[] = + []; + 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 edgecontainerModule.v1.EdgeContainerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + 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.ListOperationsResponse[] = + []; + 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('cluster', () => { + const fakePath = '/rendered/path/cluster'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + cluster: 'clusterValue', + }; + const client = new edgecontainerModule.v1.EdgeContainerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.clusterPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.clusterPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('clusterPath', () => { + const result = client.clusterPath( + 'projectValue', + 'locationValue', + 'clusterValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.clusterPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromClusterName', () => { + const result = client.matchProjectFromClusterName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.clusterPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromClusterName', () => { + const result = client.matchLocationFromClusterName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.clusterPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchClusterFromClusterName', () => { + const result = client.matchClusterFromClusterName(fakePath); + assert.strictEqual(result, 'clusterValue'); + assert( + (client.pathTemplates.clusterPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('location', () => { + const fakePath = '/rendered/path/location'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + }; + const client = new edgecontainerModule.v1.EdgeContainerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + 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('machine', () => { + const fakePath = '/rendered/path/machine'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + machine: 'machineValue', + }; + const client = new edgecontainerModule.v1.EdgeContainerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.machinePathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.machinePathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('machinePath', () => { + const result = client.machinePath( + 'projectValue', + 'locationValue', + 'machineValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.machinePathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromMachineName', () => { + const result = client.matchProjectFromMachineName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.machinePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromMachineName', () => { + const result = client.matchLocationFromMachineName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.machinePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchMachineFromMachineName', () => { + const result = client.matchMachineFromMachineName(fakePath); + assert.strictEqual(result, 'machineValue'); + assert( + (client.pathTemplates.machinePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('nodePool', () => { + const fakePath = '/rendered/path/nodePool'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + cluster: 'clusterValue', + node_pool: 'nodePoolValue', + }; + const client = new edgecontainerModule.v1.EdgeContainerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.nodePoolPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.nodePoolPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('nodePoolPath', () => { + const result = client.nodePoolPath( + 'projectValue', + 'locationValue', + 'clusterValue', + 'nodePoolValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.nodePoolPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromNodePoolName', () => { + const result = client.matchProjectFromNodePoolName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.nodePoolPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromNodePoolName', () => { + const result = client.matchLocationFromNodePoolName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.nodePoolPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchClusterFromNodePoolName', () => { + const result = client.matchClusterFromNodePoolName(fakePath); + assert.strictEqual(result, 'clusterValue'); + assert( + (client.pathTemplates.nodePoolPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchNodePoolFromNodePoolName', () => { + const result = client.matchNodePoolFromNodePoolName(fakePath); + assert.strictEqual(result, 'nodePoolValue'); + assert( + (client.pathTemplates.nodePoolPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('project', () => { + const fakePath = '/rendered/path/project'; + const expectedParameters = { + project: 'projectValue', + }; + const client = new edgecontainerModule.v1.EdgeContainerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + 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('vpnConnection', () => { + const fakePath = '/rendered/path/vpnConnection'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + vpn_connection: 'vpnConnectionValue', + }; + const client = new edgecontainerModule.v1.EdgeContainerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.vpnConnectionPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.vpnConnectionPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('vpnConnectionPath', () => { + const result = client.vpnConnectionPath( + 'projectValue', + 'locationValue', + 'vpnConnectionValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.vpnConnectionPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromVpnConnectionName', () => { + const result = client.matchProjectFromVpnConnectionName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.vpnConnectionPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromVpnConnectionName', () => { + const result = client.matchLocationFromVpnConnectionName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.vpnConnectionPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchVpnConnectionFromVpnConnectionName', () => { + const result = client.matchVpnConnectionFromVpnConnectionName(fakePath); + assert.strictEqual(result, 'vpnConnectionValue'); + assert( + (client.pathTemplates.vpnConnectionPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + }); +}); diff --git a/packages/google-cloud-edgecontainer/tsconfig.json b/packages/google-cloud-edgecontainer/tsconfig.json new file mode 100644 index 00000000000..c78f1c884ef --- /dev/null +++ b/packages/google-cloud-edgecontainer/tsconfig.json @@ -0,0 +1,19 @@ +{ + "extends": "./node_modules/gts/tsconfig-google.json", + "compilerOptions": { + "rootDir": ".", + "outDir": "build", + "resolveJsonModule": true, + "lib": [ + "es2018", + "dom" + ] + }, + "include": [ + "src/*.ts", + "src/**/*.ts", + "test/*.ts", + "test/**/*.ts", + "system-test/*.ts" + ] +} diff --git a/packages/google-cloud-edgecontainer/webpack.config.js b/packages/google-cloud-edgecontainer/webpack.config.js new file mode 100644 index 00000000000..6c9e3fe76e7 --- /dev/null +++ b/packages/google-cloud-edgecontainer/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: 'EdgeContainer', + filename: './edge-container.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/google-cloud-iap/CHANGELOG.md b/packages/google-cloud-iap/CHANGELOG.md index 7dbde5fe011..d1f3a1f1eb7 100644 --- a/packages/google-cloud-iap/CHANGELOG.md +++ b/packages/google-cloud-iap/CHANGELOG.md @@ -1,5 +1,12 @@ # Changelog +## [3.1.0](https://github.com/googleapis/google-cloud-node/compare/iap-v3.0.1...iap-v3.1.0) (2023-09-19) + + +### Features + +* [iap] Adding programmatic_clients attribute to UpdateIapSettings API request ([#4668](https://github.com/googleapis/google-cloud-node/issues/4668)) ([53d2755](https://github.com/googleapis/google-cloud-node/commit/53d275509ced91ba753e7e66ac9c86ef264d82b6)) + ## [3.0.1](https://github.com/googleapis/google-cloud-node/compare/iap-v3.0.0...iap-v3.0.1) (2023-09-06) diff --git a/packages/google-cloud-iap/package.json b/packages/google-cloud-iap/package.json index 203a9ea18fe..4e3e698225e 100644 --- a/packages/google-cloud-iap/package.json +++ b/packages/google-cloud-iap/package.json @@ -1,6 +1,6 @@ { "name": "@google-cloud/iap", - "version": "3.0.1", + "version": "3.1.0", "description": "iap client for Node.js", "repository": { "type": "git", diff --git a/packages/google-cloud-iap/protos/google/cloud/iap/v1/service.proto b/packages/google-cloud-iap/protos/google/cloud/iap/v1/service.proto index dd14ced3422..40fbce1806d 100644 --- a/packages/google-cloud-iap/protos/google/cloud/iap/v1/service.proto +++ b/packages/google-cloud-iap/protos/google/cloud/iap/v1/service.proto @@ -444,6 +444,9 @@ message OAuthSettings { // Note: IAP does not verify that the id token's hd claim matches this value // since access behavior is managed by IAM policies. google.protobuf.StringValue login_hint = 2; + + // List of OAuth client IDs allowed to programmatically authenticate with IAP. + repeated string programmatic_clients = 5; } // Configuration for IAP reauthentication policies. diff --git a/packages/google-cloud-iap/protos/protos.d.ts b/packages/google-cloud-iap/protos/protos.d.ts index 4ee047d1039..fa223a63753 100644 --- a/packages/google-cloud-iap/protos/protos.d.ts +++ b/packages/google-cloud-iap/protos/protos.d.ts @@ -1814,6 +1814,9 @@ export namespace google { /** OAuthSettings loginHint */ loginHint?: (google.protobuf.IStringValue|null); + + /** OAuthSettings programmaticClients */ + programmaticClients?: (string[]|null); } /** Represents a OAuthSettings. */ @@ -1828,6 +1831,9 @@ export namespace google { /** OAuthSettings loginHint. */ public loginHint?: (google.protobuf.IStringValue|null); + /** OAuthSettings programmaticClients. */ + public programmaticClients: string[]; + /** * Creates a new OAuthSettings instance using the specified properties. * @param [properties] Properties to set diff --git a/packages/google-cloud-iap/protos/protos.js b/packages/google-cloud-iap/protos/protos.js index 2d783f07db2..757f2360c88 100644 --- a/packages/google-cloud-iap/protos/protos.js +++ b/packages/google-cloud-iap/protos/protos.js @@ -3893,6 +3893,7 @@ * @memberof google.cloud.iap.v1 * @interface IOAuthSettings * @property {google.protobuf.IStringValue|null} [loginHint] OAuthSettings loginHint + * @property {Array.|null} [programmaticClients] OAuthSettings programmaticClients */ /** @@ -3904,6 +3905,7 @@ * @param {google.cloud.iap.v1.IOAuthSettings=} [properties] Properties to set */ function OAuthSettings(properties) { + this.programmaticClients = []; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -3918,6 +3920,14 @@ */ OAuthSettings.prototype.loginHint = null; + /** + * OAuthSettings programmaticClients. + * @member {Array.} programmaticClients + * @memberof google.cloud.iap.v1.OAuthSettings + * @instance + */ + OAuthSettings.prototype.programmaticClients = $util.emptyArray; + /** * Creates a new OAuthSettings instance using the specified properties. * @function create @@ -3944,6 +3954,9 @@ writer = $Writer.create(); if (message.loginHint != null && Object.hasOwnProperty.call(message, "loginHint")) $root.google.protobuf.StringValue.encode(message.loginHint, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.programmaticClients != null && message.programmaticClients.length) + for (var i = 0; i < message.programmaticClients.length; ++i) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.programmaticClients[i]); return writer; }; @@ -3982,6 +3995,12 @@ message.loginHint = $root.google.protobuf.StringValue.decode(reader, reader.uint32()); break; } + case 5: { + if (!(message.programmaticClients && message.programmaticClients.length)) + message.programmaticClients = []; + message.programmaticClients.push(reader.string()); + break; + } default: reader.skipType(tag & 7); break; @@ -4022,6 +4041,13 @@ if (error) return "loginHint." + error; } + if (message.programmaticClients != null && message.hasOwnProperty("programmaticClients")) { + if (!Array.isArray(message.programmaticClients)) + return "programmaticClients: array expected"; + for (var i = 0; i < message.programmaticClients.length; ++i) + if (!$util.isString(message.programmaticClients[i])) + return "programmaticClients: string[] expected"; + } return null; }; @@ -4042,6 +4068,13 @@ throw TypeError(".google.cloud.iap.v1.OAuthSettings.loginHint: object expected"); message.loginHint = $root.google.protobuf.StringValue.fromObject(object.loginHint); } + if (object.programmaticClients) { + if (!Array.isArray(object.programmaticClients)) + throw TypeError(".google.cloud.iap.v1.OAuthSettings.programmaticClients: array expected"); + message.programmaticClients = []; + for (var i = 0; i < object.programmaticClients.length; ++i) + message.programmaticClients[i] = String(object.programmaticClients[i]); + } return message; }; @@ -4058,10 +4091,17 @@ if (!options) options = {}; var object = {}; + if (options.arrays || options.defaults) + object.programmaticClients = []; if (options.defaults) object.loginHint = null; if (message.loginHint != null && message.hasOwnProperty("loginHint")) object.loginHint = $root.google.protobuf.StringValue.toObject(message.loginHint, options); + if (message.programmaticClients && message.programmaticClients.length) { + object.programmaticClients = []; + for (var j = 0; j < message.programmaticClients.length; ++j) + object.programmaticClients[j] = message.programmaticClients[j]; + } return object; }; diff --git a/packages/google-cloud-iap/protos/protos.json b/packages/google-cloud-iap/protos/protos.json index 3772fcba995..5c409721065 100644 --- a/packages/google-cloud-iap/protos/protos.json +++ b/packages/google-cloud-iap/protos/protos.json @@ -548,6 +548,11 @@ "loginHint": { "type": "google.protobuf.StringValue", "id": 2 + }, + "programmaticClients": { + "rule": "repeated", + "type": "string", + "id": 5 } } }, diff --git a/packages/google-cloud-iap/samples/generated/v1/snippet_metadata.google.cloud.iap.v1.json b/packages/google-cloud-iap/samples/generated/v1/snippet_metadata.google.cloud.iap.v1.json index 801e6c4e8c6..0ad4d5067b3 100644 --- a/packages/google-cloud-iap/samples/generated/v1/snippet_metadata.google.cloud.iap.v1.json +++ b/packages/google-cloud-iap/samples/generated/v1/snippet_metadata.google.cloud.iap.v1.json @@ -1,7 +1,7 @@ { "clientLibrary": { "name": "nodejs-iap", - "version": "3.0.1", + "version": "3.1.0", "language": "TYPESCRIPT", "apis": [ { diff --git a/packages/google-cloud-iap/samples/generated/v1/snippet_metadata_google.cloud.iap.v1.json b/packages/google-cloud-iap/samples/generated/v1/snippet_metadata_google.cloud.iap.v1.json index 801e6c4e8c6..0ad4d5067b3 100644 --- a/packages/google-cloud-iap/samples/generated/v1/snippet_metadata_google.cloud.iap.v1.json +++ b/packages/google-cloud-iap/samples/generated/v1/snippet_metadata_google.cloud.iap.v1.json @@ -1,7 +1,7 @@ { "clientLibrary": { "name": "nodejs-iap", - "version": "3.0.1", + "version": "3.1.0", "language": "TYPESCRIPT", "apis": [ { diff --git a/packages/google-cloud-iap/samples/generated/v1beta1/snippet_metadata.google.cloud.iap.v1beta1.json b/packages/google-cloud-iap/samples/generated/v1beta1/snippet_metadata.google.cloud.iap.v1beta1.json index e8b30bd46ee..7499288c87b 100644 --- a/packages/google-cloud-iap/samples/generated/v1beta1/snippet_metadata.google.cloud.iap.v1beta1.json +++ b/packages/google-cloud-iap/samples/generated/v1beta1/snippet_metadata.google.cloud.iap.v1beta1.json @@ -1,7 +1,7 @@ { "clientLibrary": { "name": "nodejs-iap", - "version": "3.0.1", + "version": "3.1.0", "language": "TYPESCRIPT", "apis": [ { diff --git a/packages/google-cloud-iap/samples/generated/v1beta1/snippet_metadata_google.cloud.iap.v1beta1.json b/packages/google-cloud-iap/samples/generated/v1beta1/snippet_metadata_google.cloud.iap.v1beta1.json index e8b30bd46ee..7499288c87b 100644 --- a/packages/google-cloud-iap/samples/generated/v1beta1/snippet_metadata_google.cloud.iap.v1beta1.json +++ b/packages/google-cloud-iap/samples/generated/v1beta1/snippet_metadata_google.cloud.iap.v1beta1.json @@ -1,7 +1,7 @@ { "clientLibrary": { "name": "nodejs-iap", - "version": "3.0.1", + "version": "3.1.0", "language": "TYPESCRIPT", "apis": [ { diff --git a/packages/google-cloud-iap/samples/package.json b/packages/google-cloud-iap/samples/package.json index 92572d4dd01..2e0eaef3a8b 100644 --- a/packages/google-cloud-iap/samples/package.json +++ b/packages/google-cloud-iap/samples/package.json @@ -13,7 +13,7 @@ "test": "c8 mocha --timeout 600000 test/*.js" }, "dependencies": { - "@google-cloud/iap": "^3.0.1" + "@google-cloud/iap": "^3.1.0" }, "devDependencies": { "c8": "^7.1.0", diff --git a/packages/google-cloud-migrationcenter/CHANGELOG.md b/packages/google-cloud-migrationcenter/CHANGELOG.md index 4cd841e4794..8b56bd205d7 100644 --- a/packages/google-cloud-migrationcenter/CHANGELOG.md +++ b/packages/google-cloud-migrationcenter/CHANGELOG.md @@ -1,5 +1,12 @@ # Changelog +## [1.1.0](https://github.com/googleapis/google-cloud-node/compare/migrationcenter-v1.0.1...migrationcenter-v1.1.0) (2023-09-19) + + +### Features + +* [migrationcenter] added GenericInsight which exposes generic insights on assets ([#4670](https://github.com/googleapis/google-cloud-node/issues/4670)) ([89a2956](https://github.com/googleapis/google-cloud-node/commit/89a29560ab1d89e57aa72708101debff835f45c8)) + ## [1.0.1](https://github.com/googleapis/google-cloud-node/compare/migrationcenter-v1.0.0...migrationcenter-v1.0.1) (2023-09-06) diff --git a/packages/google-cloud-migrationcenter/package.json b/packages/google-cloud-migrationcenter/package.json index 946bff0aa7a..080cdf3e7bc 100644 --- a/packages/google-cloud-migrationcenter/package.json +++ b/packages/google-cloud-migrationcenter/package.json @@ -1,6 +1,6 @@ { "name": "@google-cloud/migrationcenter", - "version": "1.0.1", + "version": "1.1.0", "description": "Migration Center API client for Node.js", "repository": { "type": "git", diff --git a/packages/google-cloud-migrationcenter/protos/google/cloud/migrationcenter/v1/migrationcenter.proto b/packages/google-cloud-migrationcenter/protos/google/cloud/migrationcenter/v1/migrationcenter.proto index cc9df8da065..d1b1fb2e255 100644 --- a/packages/google-cloud-migrationcenter/protos/google/cloud/migrationcenter/v1/migrationcenter.proto +++ b/packages/google-cloud-migrationcenter/protos/google/cloud/migrationcenter/v1/migrationcenter.proto @@ -2382,6 +2382,7 @@ message AssetFrame { map attributes = 12; // Asset performance data samples. + // Samples that are from more than 40 days ago or after tomorrow are ignored. repeated PerformanceSample performance_samples = 13; // Optional. Trace token is optionally provided to assist with debugging and @@ -2505,7 +2506,8 @@ message MachineArchitectureDetails { // Details about the BIOS. message BiosDetails { // BIOS name. - string bios_name = 1; + // This fields is deprecated. Please use the `id` field instead. + string bios_name = 1 [deprecated = true]; // BIOS ID. string id = 2; @@ -3212,6 +3214,7 @@ message DiskUsageSample { // Performance data sample. message PerformanceSample { // Time the sample was collected. + // If omitted, the frame report time will be used. google.protobuf.Timestamp sample_time = 1; // Memory usage sample. @@ -3311,9 +3314,31 @@ message Insight { // Output only. An insight about potential migrations for an asset. MigrationInsight migration_insight = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. A generic insight about an asset + GenericInsight generic_insight = 2 + [(google.api.field_behavior) = OUTPUT_ONLY]; } } +// A generic insight about an asset. +message GenericInsight { + // Output only. Represents a globally unique message id for + // this insight, can be used for localization purposes, in case message_code + // is not yet known by the client use default_message instead. + int64 message_id = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. In case message_code is not yet known by the client + // default_message will be the message to be used instead. + string default_message = 2 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Additional information about the insight, each entry can be a + // logical entry and must make sense if it is displayed with line breaks + // between each entry. Text can contain md style links. + repeated string additional_information = 3 + [(google.api.field_behavior) = OUTPUT_ONLY]; +} + // An insight about potential migrations for an asset. message MigrationInsight { // Output only. Description of how well the asset this insight is associated @@ -3334,6 +3359,36 @@ message ComputeEngineMigrationTarget { ComputeEngineShapeDescriptor shape = 1; } +// Compute Engine target shape descriptor. +message ComputeEngineShapeDescriptor { + // Memory in mebibytes. + int32 memory_mb = 1; + + // Number of physical cores. + int32 physical_core_count = 2; + + // Number of logical cores. + int32 logical_core_count = 3; + + // Compute Engine machine series. + string series = 4; + + // Compute Engine machine type. + string machine_type = 5; + + // Compute Engine storage. Never empty. + repeated ComputeStorageDescriptor storage = 6; +} + +// Compute Engine storage option descriptor. +message ComputeStorageDescriptor { + // Disk type backing the storage. + PersistentDiskType type = 1; + + // Disk size in GiB. + int32 size_gb = 2; +} + // Describes the fit level of an asset for migration to a specific target. message FitDescriptor { // Fit level. @@ -3355,24 +3410,6 @@ message FitDescriptor { FitLevel fit_level = 1; } -// Compute Engine target shape descriptor. -message ComputeEngineShapeDescriptor { - // Memory in mebibytes. - int32 memory_mb = 1; - - // Number of physical cores. - int32 physical_core_count = 2; - - // Number of logical cores. - int32 logical_core_count = 3; - - // Compute Engine machine series. - string series = 4; - - // Compute Engine machine type. - string machine_type = 5; -} - // Message describing an aggregation. The message includes the aggregation type, // parameters, and the field on which to perform the aggregation. message Aggregation { @@ -3505,8 +3542,8 @@ message ExecutionReport { // Validation errors encountered during the execution of the import job. ValidationReport execution_errors = 2; - // Total number of rows in the import job. - int32 total_rows_count = 3; + // Output only. Total number of rows in the import job. + int32 total_rows_count = 3 [(google.api.field_behavior) = OUTPUT_ONLY]; } // A resource that reports the errors encountered while processing an @@ -3584,6 +3621,11 @@ message FrameViolationEntry { // machines. The set of preferences influence recommendations for migrating // virtual machine assets. message VirtualMachinePreferences { + // Target product for assets using this preference set. + // Specify either target product or business goal, but + // not both. + ComputeMigrationTargetProduct target_product = 2; + // Region preferences for assets using this preference set. // If you are unsure which value to set, the migration service API region is // often a good value to start with. @@ -3605,6 +3647,13 @@ message VirtualMachinePreferences { // Compute Engine preferences concern insights and recommendations for Compute // Engine target. ComputeEnginePreferences compute_engine_preferences = 6; + + // Preferences concerning insights and recommendations for + // Google Cloud VMware Engine. + VmwareEnginePreferences vmware_engine_preferences = 7; + + // Preferences concerning Sole Tenant nodes and virtual machines. + SoleTenancyPreferences sole_tenancy_preferences = 8; } // The user preferences relating to Compute Engine target platform. @@ -3635,6 +3684,111 @@ message MachineSeries { string code = 1; } +// The user preferences relating to Google Cloud VMware Engine target platform. +message VmwareEnginePreferences { + // Type of committed use discount. + enum CommitmentPlan { + // Unspecified commitment plan. + COMMITMENT_PLAN_UNSPECIFIED = 0; + + // No commitment plan (on-demand usage). + ON_DEMAND = 1; + + // 1 year commitment (monthly payments). + COMMITMENT_1_YEAR_MONTHLY_PAYMENTS = 2; + + // 3 year commitment (monthly payments). + COMMITMENT_3_YEAR_MONTHLY_PAYMENTS = 3; + + // 1 year commitment (upfront payment). + COMMITMENT_1_YEAR_UPFRONT_PAYMENT = 4; + + // 3 years commitment (upfront payment). + COMMITMENT_3_YEAR_UPFRONT_PAYMENT = 5; + } + + // CPU overcommit ratio. + // Acceptable values are between 1.0 and 8.0, with 0.1 increment. + double cpu_overcommit_ratio = 1; + + // Memory overcommit ratio. + // Acceptable values are 1.0, 1.25, 1.5, 1.75 and 2.0. + double memory_overcommit_ratio = 2; + + // The Deduplication and Compression ratio is based on the logical (Used + // Before) space required to store data before applying deduplication and + // compression, in relation to the physical (Used After) space required after + // applying deduplication and compression. Specifically, the ratio is the Used + // Before space divided by the Used After space. For example, if the Used + // Before space is 3 GB, but the physical Used After space is 1 GB, the + // deduplication and compression ratio is 3x. Acceptable values are + // between 1.0 and 4.0. + double storage_deduplication_compression_ratio = 3; + + // Commitment plan to consider when calculating costs for virtual machine + // insights and recommendations. + // If you are unsure which value to set, a 3 year commitment plan is often a + // good value to start with. + CommitmentPlan commitment_plan = 4; +} + +// Preferences concerning Sole Tenancy nodes and VMs. +message SoleTenancyPreferences { + // Sole Tenancy nodes maintenance policy. + enum HostMaintenancePolicy { + // Unspecified host maintenance policy. + HOST_MAINTENANCE_POLICY_UNSPECIFIED = 0; + + // Default host maintenance policy. + HOST_MAINTENANCE_POLICY_DEFAULT = 1; + + // Restart in place host maintenance policy. + HOST_MAINTENANCE_POLICY_RESTART_IN_PLACE = 2; + + // Migrate within node group host maintenance policy. + HOST_MAINTENANCE_POLICY_MIGRATE_WITHIN_NODE_GROUP = 3; + } + + // Type of committed use discount. + enum CommitmentPlan { + // Unspecified commitment plan. + COMMITMENT_PLAN_UNSPECIFIED = 0; + + // No commitment plan (on-demand usage). + ON_DEMAND = 1; + + // 1 year commitment. + COMMITMENT_1_YEAR = 2; + + // 3 years commitment. + COMMITMENT_3_YEAR = 3; + } + + // CPU overcommit ratio. + // Acceptable values are between 1.0 and 2.0 inclusive. + double cpu_overcommit_ratio = 1; + + // Sole Tenancy nodes maintenance policy. + HostMaintenancePolicy host_maintenance_policy = 2; + + // Commitment plan to consider when calculating costs for virtual machine + // insights and recommendations. + // If you are unsure which value to set, a 3 year commitment plan is often a + // good value to start with. + CommitmentPlan commitment_plan = 3; + + // A list of sole tenant node types. + // An empty list means that all possible node types will be considered. + repeated SoleTenantNodeType node_types = 4; +} + +// A Sole Tenant node type. +message SoleTenantNodeType { + // Name of the Sole Tenant node. Consult + // https://cloud.google.com/compute/docs/nodes/sole-tenant-nodes + string node_name = 1; +} + // The user preferences relating to target regions. message RegionPreferences { // A list of preferred regions, @@ -3775,6 +3929,62 @@ message ReportSummary { repeated PersistentDiskType allocated_disk_types = 4; } + // A set of findings that applies to assets destined for VMWare Engine. + message VmwareEngineFinding { + // Set of regions in which the assets were allocated + repeated string allocated_regions = 1; + + // Count of assets which are allocated + int64 allocated_asset_count = 2; + + // Set of per-nodetype allocation records + repeated VmwareNodeAllocation node_allocations = 3; + } + + // Represents assets allocated to a specific VMWare Node type. + message VmwareNodeAllocation { + // VMWare node type, e.g. "ve1-standard-72" + VmwareNode vmware_node = 1; + + // Count of this node type to be provisioned + int64 node_count = 2; + + // Count of assets allocated to these nodes + int64 allocated_asset_count = 3; + } + + // A VMWare Engine Node + message VmwareNode { + // Code to identify VMware Engine node series, e.g. "ve1-standard-72". Based + // on the displayName of + // cloud.google.com/vmware-engine/docs/reference/rest/v1/projects.locations.nodeTypes + string code = 1; + } + + // A set of findings that applies to assets destined for Sole-Tenant nodes. + message SoleTenantFinding { + // Set of regions in which the assets are allocated + repeated string allocated_regions = 1; + + // Count of assets which are allocated + int64 allocated_asset_count = 2; + + // Set of per-nodetype allocation records + repeated SoleTenantNodeAllocation node_allocations = 3; + } + + // Represents the assets allocated to a specific Sole-Tenant node type. + message SoleTenantNodeAllocation { + // Sole Tenant node type, e.g. "m3-node-128-3904" + SoleTenantNodeType node = 1; + + // Count of this node type to be provisioned + int64 node_count = 2; + + // Count of assets allocated to these nodes + int64 allocated_asset_count = 3; + } + // Summary Findings for a specific Group/PreferenceSet combination. message GroupPreferenceSetFinding { // Display Name of the Preference Set @@ -3806,6 +4016,12 @@ message ReportSummary { // A set of findings that applies to Compute Engine machines in the input. ComputeEngineFinding compute_engine_finding = 10; + + // A set of findings that applies to VMWare machines in the input. + VmwareEngineFinding vmware_engine_finding = 11; + + // A set of findings that applies to Sole-Tenant machines in the input. + SoleTenantFinding sole_tenant_finding = 12; } // Summary Findings for a specific Group. @@ -3819,9 +4035,8 @@ message ReportSummary { // Summary statistics for all the assets in this group. AssetAggregateStats asset_aggregate_stats = 3; - // Count of the number of assets in this group which are also included - // in another group within the same report. - int64 overlapping_asset_count = 4; + // This field is deprecated, do not rely on it having a value. + int64 overlapping_asset_count = 4 [deprecated = true]; // Findings for each of the PreferenceSets for this group. repeated GroupPreferenceSetFinding preference_set_findings = 5; @@ -3984,6 +4199,21 @@ enum CommitmentPlan { COMMITMENT_PLAN_THREE_YEARS = 3; } +// The preference for a specific Google Cloud product platform. +enum ComputeMigrationTargetProduct { + // Unspecified (default value). + COMPUTE_MIGRATION_TARGET_PRODUCT_UNSPECIFIED = 0; + + // Prefer to migrate to Google Cloud Compute Engine. + COMPUTE_MIGRATION_TARGET_PRODUCT_COMPUTE_ENGINE = 1; + + // Prefer to migrate to Google Cloud VMware Engine. + COMPUTE_MIGRATION_TARGET_PRODUCT_VMWARE_ENGINE = 2; + + // Prefer to migrate to Google Cloud Sole Tenant Nodes. + COMPUTE_MIGRATION_TARGET_PRODUCT_SOLE_TENANCY = 3; +} + // Specifies the types of views that provide complete or partial details // of a Report. enum ReportView { diff --git a/packages/google-cloud-migrationcenter/protos/protos.d.ts b/packages/google-cloud-migrationcenter/protos/protos.d.ts index 8ba9746e724..ee7bba5cecc 100644 --- a/packages/google-cloud-migrationcenter/protos/protos.d.ts +++ b/packages/google-cloud-migrationcenter/protos/protos.d.ts @@ -15345,6 +15345,9 @@ export namespace google { /** Insight migrationInsight */ migrationInsight?: (google.cloud.migrationcenter.v1.IMigrationInsight|null); + + /** Insight genericInsight */ + genericInsight?: (google.cloud.migrationcenter.v1.IGenericInsight|null); } /** Represents an Insight. */ @@ -15359,8 +15362,11 @@ export namespace google { /** Insight migrationInsight. */ public migrationInsight?: (google.cloud.migrationcenter.v1.IMigrationInsight|null); + /** Insight genericInsight. */ + public genericInsight?: (google.cloud.migrationcenter.v1.IGenericInsight|null); + /** Insight insight. */ - public insight?: "migrationInsight"; + public insight?: ("migrationInsight"|"genericInsight"); /** * Creates a new Insight instance using the specified properties. @@ -15440,6 +15446,115 @@ export namespace google { public static getTypeUrl(typeUrlPrefix?: string): string; } + /** Properties of a GenericInsight. */ + interface IGenericInsight { + + /** GenericInsight messageId */ + messageId?: (number|Long|string|null); + + /** GenericInsight defaultMessage */ + defaultMessage?: (string|null); + + /** GenericInsight additionalInformation */ + additionalInformation?: (string[]|null); + } + + /** Represents a GenericInsight. */ + class GenericInsight implements IGenericInsight { + + /** + * Constructs a new GenericInsight. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.migrationcenter.v1.IGenericInsight); + + /** GenericInsight messageId. */ + public messageId: (number|Long|string); + + /** GenericInsight defaultMessage. */ + public defaultMessage: string; + + /** GenericInsight additionalInformation. */ + public additionalInformation: string[]; + + /** + * Creates a new GenericInsight instance using the specified properties. + * @param [properties] Properties to set + * @returns GenericInsight instance + */ + public static create(properties?: google.cloud.migrationcenter.v1.IGenericInsight): google.cloud.migrationcenter.v1.GenericInsight; + + /** + * Encodes the specified GenericInsight message. Does not implicitly {@link google.cloud.migrationcenter.v1.GenericInsight.verify|verify} messages. + * @param message GenericInsight message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.migrationcenter.v1.IGenericInsight, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GenericInsight message, length delimited. Does not implicitly {@link google.cloud.migrationcenter.v1.GenericInsight.verify|verify} messages. + * @param message GenericInsight message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.migrationcenter.v1.IGenericInsight, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GenericInsight message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GenericInsight + * @throws {Error} If the payload is not 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.migrationcenter.v1.GenericInsight; + + /** + * Decodes a GenericInsight message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GenericInsight + * @throws {Error} If the payload 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.migrationcenter.v1.GenericInsight; + + /** + * Verifies a GenericInsight message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GenericInsight message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GenericInsight + */ + public static fromObject(object: { [k: string]: any }): google.cloud.migrationcenter.v1.GenericInsight; + + /** + * Creates a plain object from a GenericInsight message. Also converts values to other types if specified. + * @param message GenericInsight + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.migrationcenter.v1.GenericInsight, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GenericInsight to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GenericInsight + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + /** Properties of a MigrationInsight. */ interface IMigrationInsight { @@ -15643,114 +15758,6 @@ export namespace google { public static getTypeUrl(typeUrlPrefix?: string): string; } - /** Properties of a FitDescriptor. */ - interface IFitDescriptor { - - /** FitDescriptor fitLevel */ - fitLevel?: (google.cloud.migrationcenter.v1.FitDescriptor.FitLevel|keyof typeof google.cloud.migrationcenter.v1.FitDescriptor.FitLevel|null); - } - - /** Represents a FitDescriptor. */ - class FitDescriptor implements IFitDescriptor { - - /** - * Constructs a new FitDescriptor. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.migrationcenter.v1.IFitDescriptor); - - /** FitDescriptor fitLevel. */ - public fitLevel: (google.cloud.migrationcenter.v1.FitDescriptor.FitLevel|keyof typeof google.cloud.migrationcenter.v1.FitDescriptor.FitLevel); - - /** - * Creates a new FitDescriptor instance using the specified properties. - * @param [properties] Properties to set - * @returns FitDescriptor instance - */ - public static create(properties?: google.cloud.migrationcenter.v1.IFitDescriptor): google.cloud.migrationcenter.v1.FitDescriptor; - - /** - * Encodes the specified FitDescriptor message. Does not implicitly {@link google.cloud.migrationcenter.v1.FitDescriptor.verify|verify} messages. - * @param message FitDescriptor message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.migrationcenter.v1.IFitDescriptor, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified FitDescriptor message, length delimited. Does not implicitly {@link google.cloud.migrationcenter.v1.FitDescriptor.verify|verify} messages. - * @param message FitDescriptor message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.migrationcenter.v1.IFitDescriptor, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a FitDescriptor message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns FitDescriptor - * @throws {Error} If the payload is not 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.migrationcenter.v1.FitDescriptor; - - /** - * Decodes a FitDescriptor message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns FitDescriptor - * @throws {Error} If the payload 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.migrationcenter.v1.FitDescriptor; - - /** - * Verifies a FitDescriptor message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a FitDescriptor message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns FitDescriptor - */ - public static fromObject(object: { [k: string]: any }): google.cloud.migrationcenter.v1.FitDescriptor; - - /** - * Creates a plain object from a FitDescriptor message. Also converts values to other types if specified. - * @param message FitDescriptor - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.migrationcenter.v1.FitDescriptor, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this FitDescriptor to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for FitDescriptor - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - namespace FitDescriptor { - - /** FitLevel enum. */ - enum FitLevel { - FIT_LEVEL_UNSPECIFIED = 0, - FIT = 1, - NO_FIT = 2, - REQUIRES_EFFORT = 3 - } - } - /** Properties of a ComputeEngineShapeDescriptor. */ interface IComputeEngineShapeDescriptor { @@ -15768,6 +15775,9 @@ export namespace google { /** ComputeEngineShapeDescriptor machineType */ machineType?: (string|null); + + /** ComputeEngineShapeDescriptor storage */ + storage?: (google.cloud.migrationcenter.v1.IComputeStorageDescriptor[]|null); } /** Represents a ComputeEngineShapeDescriptor. */ @@ -15794,6 +15804,9 @@ export namespace google { /** ComputeEngineShapeDescriptor machineType. */ public machineType: string; + /** ComputeEngineShapeDescriptor storage. */ + public storage: google.cloud.migrationcenter.v1.IComputeStorageDescriptor[]; + /** * Creates a new ComputeEngineShapeDescriptor instance using the specified properties. * @param [properties] Properties to set @@ -15872,144 +15885,355 @@ export namespace google { public static getTypeUrl(typeUrlPrefix?: string): string; } - /** Properties of an Aggregation. */ - interface IAggregation { - - /** Aggregation field */ - field?: (string|null); - - /** Aggregation count */ - count?: (google.cloud.migrationcenter.v1.Aggregation.ICount|null); - - /** Aggregation sum */ - sum?: (google.cloud.migrationcenter.v1.Aggregation.ISum|null); + /** Properties of a ComputeStorageDescriptor. */ + interface IComputeStorageDescriptor { - /** Aggregation histogram */ - histogram?: (google.cloud.migrationcenter.v1.Aggregation.IHistogram|null); + /** ComputeStorageDescriptor type */ + type?: (google.cloud.migrationcenter.v1.PersistentDiskType|keyof typeof google.cloud.migrationcenter.v1.PersistentDiskType|null); - /** Aggregation frequency */ - frequency?: (google.cloud.migrationcenter.v1.Aggregation.IFrequency|null); + /** ComputeStorageDescriptor sizeGb */ + sizeGb?: (number|null); } - /** Represents an Aggregation. */ - class Aggregation implements IAggregation { + /** Represents a ComputeStorageDescriptor. */ + class ComputeStorageDescriptor implements IComputeStorageDescriptor { /** - * Constructs a new Aggregation. + * Constructs a new ComputeStorageDescriptor. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.migrationcenter.v1.IAggregation); - - /** Aggregation field. */ - public field: string; - - /** Aggregation count. */ - public count?: (google.cloud.migrationcenter.v1.Aggregation.ICount|null); - - /** Aggregation sum. */ - public sum?: (google.cloud.migrationcenter.v1.Aggregation.ISum|null); - - /** Aggregation histogram. */ - public histogram?: (google.cloud.migrationcenter.v1.Aggregation.IHistogram|null); + constructor(properties?: google.cloud.migrationcenter.v1.IComputeStorageDescriptor); - /** Aggregation frequency. */ - public frequency?: (google.cloud.migrationcenter.v1.Aggregation.IFrequency|null); + /** ComputeStorageDescriptor type. */ + public type: (google.cloud.migrationcenter.v1.PersistentDiskType|keyof typeof google.cloud.migrationcenter.v1.PersistentDiskType); - /** Aggregation aggregationFunction. */ - public aggregationFunction?: ("count"|"sum"|"histogram"|"frequency"); + /** ComputeStorageDescriptor sizeGb. */ + public sizeGb: number; /** - * Creates a new Aggregation instance using the specified properties. + * Creates a new ComputeStorageDescriptor instance using the specified properties. * @param [properties] Properties to set - * @returns Aggregation instance + * @returns ComputeStorageDescriptor instance */ - public static create(properties?: google.cloud.migrationcenter.v1.IAggregation): google.cloud.migrationcenter.v1.Aggregation; + public static create(properties?: google.cloud.migrationcenter.v1.IComputeStorageDescriptor): google.cloud.migrationcenter.v1.ComputeStorageDescriptor; /** - * Encodes the specified Aggregation message. Does not implicitly {@link google.cloud.migrationcenter.v1.Aggregation.verify|verify} messages. - * @param message Aggregation message or plain object to encode + * Encodes the specified ComputeStorageDescriptor message. Does not implicitly {@link google.cloud.migrationcenter.v1.ComputeStorageDescriptor.verify|verify} messages. + * @param message ComputeStorageDescriptor message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.migrationcenter.v1.IAggregation, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.migrationcenter.v1.IComputeStorageDescriptor, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified Aggregation message, length delimited. Does not implicitly {@link google.cloud.migrationcenter.v1.Aggregation.verify|verify} messages. - * @param message Aggregation message or plain object to encode + * Encodes the specified ComputeStorageDescriptor message, length delimited. Does not implicitly {@link google.cloud.migrationcenter.v1.ComputeStorageDescriptor.verify|verify} messages. + * @param message ComputeStorageDescriptor message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.migrationcenter.v1.IAggregation, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.migrationcenter.v1.IComputeStorageDescriptor, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes an Aggregation message from the specified reader or buffer. + * Decodes a ComputeStorageDescriptor message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns Aggregation + * @returns ComputeStorageDescriptor * @throws {Error} If the payload is not 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.migrationcenter.v1.Aggregation; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.migrationcenter.v1.ComputeStorageDescriptor; /** - * Decodes an Aggregation message from the specified reader or buffer, length delimited. + * Decodes a ComputeStorageDescriptor message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns Aggregation + * @returns ComputeStorageDescriptor * @throws {Error} If the payload 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.migrationcenter.v1.Aggregation; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.migrationcenter.v1.ComputeStorageDescriptor; /** - * Verifies an Aggregation message. + * Verifies a ComputeStorageDescriptor message. * @param message Plain 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 Aggregation message from a plain object. Also converts values to their respective internal types. + * Creates a ComputeStorageDescriptor message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns Aggregation + * @returns ComputeStorageDescriptor */ - public static fromObject(object: { [k: string]: any }): google.cloud.migrationcenter.v1.Aggregation; + public static fromObject(object: { [k: string]: any }): google.cloud.migrationcenter.v1.ComputeStorageDescriptor; /** - * Creates a plain object from an Aggregation message. Also converts values to other types if specified. - * @param message Aggregation + * Creates a plain object from a ComputeStorageDescriptor message. Also converts values to other types if specified. + * @param message ComputeStorageDescriptor * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.migrationcenter.v1.Aggregation, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.migrationcenter.v1.ComputeStorageDescriptor, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this Aggregation to JSON. + * Converts this ComputeStorageDescriptor to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; /** - * Gets the default type url for Aggregation + * Gets the default type url for ComputeStorageDescriptor * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns The default type url */ public static getTypeUrl(typeUrlPrefix?: string): string; } - namespace Aggregation { + /** Properties of a FitDescriptor. */ + interface IFitDescriptor { - /** Properties of a Count. */ - interface ICount { - } + /** FitDescriptor fitLevel */ + fitLevel?: (google.cloud.migrationcenter.v1.FitDescriptor.FitLevel|keyof typeof google.cloud.migrationcenter.v1.FitDescriptor.FitLevel|null); + } - /** Represents a Count. */ - class Count implements ICount { + /** Represents a FitDescriptor. */ + class FitDescriptor implements IFitDescriptor { - /** - * Constructs a new Count. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.migrationcenter.v1.Aggregation.ICount); + /** + * Constructs a new FitDescriptor. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.migrationcenter.v1.IFitDescriptor); + + /** FitDescriptor fitLevel. */ + public fitLevel: (google.cloud.migrationcenter.v1.FitDescriptor.FitLevel|keyof typeof google.cloud.migrationcenter.v1.FitDescriptor.FitLevel); + + /** + * Creates a new FitDescriptor instance using the specified properties. + * @param [properties] Properties to set + * @returns FitDescriptor instance + */ + public static create(properties?: google.cloud.migrationcenter.v1.IFitDescriptor): google.cloud.migrationcenter.v1.FitDescriptor; + + /** + * Encodes the specified FitDescriptor message. Does not implicitly {@link google.cloud.migrationcenter.v1.FitDescriptor.verify|verify} messages. + * @param message FitDescriptor message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.migrationcenter.v1.IFitDescriptor, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified FitDescriptor message, length delimited. Does not implicitly {@link google.cloud.migrationcenter.v1.FitDescriptor.verify|verify} messages. + * @param message FitDescriptor message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.migrationcenter.v1.IFitDescriptor, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FitDescriptor message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns FitDescriptor + * @throws {Error} If the payload is not 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.migrationcenter.v1.FitDescriptor; + + /** + * Decodes a FitDescriptor message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns FitDescriptor + * @throws {Error} If the payload 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.migrationcenter.v1.FitDescriptor; + + /** + * Verifies a FitDescriptor message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a FitDescriptor message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns FitDescriptor + */ + public static fromObject(object: { [k: string]: any }): google.cloud.migrationcenter.v1.FitDescriptor; + + /** + * Creates a plain object from a FitDescriptor message. Also converts values to other types if specified. + * @param message FitDescriptor + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.migrationcenter.v1.FitDescriptor, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this FitDescriptor to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for FitDescriptor + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace FitDescriptor { + + /** FitLevel enum. */ + enum FitLevel { + FIT_LEVEL_UNSPECIFIED = 0, + FIT = 1, + NO_FIT = 2, + REQUIRES_EFFORT = 3 + } + } + + /** Properties of an Aggregation. */ + interface IAggregation { + + /** Aggregation field */ + field?: (string|null); + + /** Aggregation count */ + count?: (google.cloud.migrationcenter.v1.Aggregation.ICount|null); + + /** Aggregation sum */ + sum?: (google.cloud.migrationcenter.v1.Aggregation.ISum|null); + + /** Aggregation histogram */ + histogram?: (google.cloud.migrationcenter.v1.Aggregation.IHistogram|null); + + /** Aggregation frequency */ + frequency?: (google.cloud.migrationcenter.v1.Aggregation.IFrequency|null); + } + + /** Represents an Aggregation. */ + class Aggregation implements IAggregation { + + /** + * Constructs a new Aggregation. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.migrationcenter.v1.IAggregation); + + /** Aggregation field. */ + public field: string; + + /** Aggregation count. */ + public count?: (google.cloud.migrationcenter.v1.Aggregation.ICount|null); + + /** Aggregation sum. */ + public sum?: (google.cloud.migrationcenter.v1.Aggregation.ISum|null); + + /** Aggregation histogram. */ + public histogram?: (google.cloud.migrationcenter.v1.Aggregation.IHistogram|null); + + /** Aggregation frequency. */ + public frequency?: (google.cloud.migrationcenter.v1.Aggregation.IFrequency|null); + + /** Aggregation aggregationFunction. */ + public aggregationFunction?: ("count"|"sum"|"histogram"|"frequency"); + + /** + * Creates a new Aggregation instance using the specified properties. + * @param [properties] Properties to set + * @returns Aggregation instance + */ + public static create(properties?: google.cloud.migrationcenter.v1.IAggregation): google.cloud.migrationcenter.v1.Aggregation; + + /** + * Encodes the specified Aggregation message. Does not implicitly {@link google.cloud.migrationcenter.v1.Aggregation.verify|verify} messages. + * @param message Aggregation message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.migrationcenter.v1.IAggregation, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Aggregation message, length delimited. Does not implicitly {@link google.cloud.migrationcenter.v1.Aggregation.verify|verify} messages. + * @param message Aggregation message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.migrationcenter.v1.IAggregation, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an Aggregation message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Aggregation + * @throws {Error} If the payload is not 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.migrationcenter.v1.Aggregation; + + /** + * Decodes an Aggregation message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Aggregation + * @throws {Error} If the payload 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.migrationcenter.v1.Aggregation; + + /** + * Verifies an Aggregation message. + * @param message Plain 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 Aggregation message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Aggregation + */ + public static fromObject(object: { [k: string]: any }): google.cloud.migrationcenter.v1.Aggregation; + + /** + * Creates a plain object from an Aggregation message. Also converts values to other types if specified. + * @param message Aggregation + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.migrationcenter.v1.Aggregation, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Aggregation to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Aggregation + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace Aggregation { + + /** Properties of a Count. */ + interface ICount { + } + + /** Represents a Count. */ + class Count implements ICount { + + /** + * Constructs a new Count. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.migrationcenter.v1.Aggregation.ICount); /** * Creates a new Count instance using the specified properties. @@ -17864,6 +18088,9 @@ export namespace google { /** Properties of a VirtualMachinePreferences. */ interface IVirtualMachinePreferences { + /** VirtualMachinePreferences targetProduct */ + targetProduct?: (google.cloud.migrationcenter.v1.ComputeMigrationTargetProduct|keyof typeof google.cloud.migrationcenter.v1.ComputeMigrationTargetProduct|null); + /** VirtualMachinePreferences regionPreferences */ regionPreferences?: (google.cloud.migrationcenter.v1.IRegionPreferences|null); @@ -17875,6 +18102,12 @@ export namespace google { /** VirtualMachinePreferences computeEnginePreferences */ computeEnginePreferences?: (google.cloud.migrationcenter.v1.IComputeEnginePreferences|null); + + /** VirtualMachinePreferences vmwareEnginePreferences */ + vmwareEnginePreferences?: (google.cloud.migrationcenter.v1.IVmwareEnginePreferences|null); + + /** VirtualMachinePreferences soleTenancyPreferences */ + soleTenancyPreferences?: (google.cloud.migrationcenter.v1.ISoleTenancyPreferences|null); } /** Represents a VirtualMachinePreferences. */ @@ -17886,6 +18119,9 @@ export namespace google { */ constructor(properties?: google.cloud.migrationcenter.v1.IVirtualMachinePreferences); + /** VirtualMachinePreferences targetProduct. */ + public targetProduct: (google.cloud.migrationcenter.v1.ComputeMigrationTargetProduct|keyof typeof google.cloud.migrationcenter.v1.ComputeMigrationTargetProduct); + /** VirtualMachinePreferences regionPreferences. */ public regionPreferences?: (google.cloud.migrationcenter.v1.IRegionPreferences|null); @@ -17898,6 +18134,12 @@ export namespace google { /** VirtualMachinePreferences computeEnginePreferences. */ public computeEnginePreferences?: (google.cloud.migrationcenter.v1.IComputeEnginePreferences|null); + /** VirtualMachinePreferences vmwareEnginePreferences. */ + public vmwareEnginePreferences?: (google.cloud.migrationcenter.v1.IVmwareEnginePreferences|null); + + /** VirtualMachinePreferences soleTenancyPreferences. */ + public soleTenancyPreferences?: (google.cloud.migrationcenter.v1.ISoleTenancyPreferences|null); + /** * Creates a new VirtualMachinePreferences instance using the specified properties. * @param [properties] Properties to set @@ -18273,26 +18515,385 @@ export namespace google { public static getTypeUrl(typeUrlPrefix?: string): string; } - /** Properties of a RegionPreferences. */ - interface IRegionPreferences { + /** Properties of a VmwareEnginePreferences. */ + interface IVmwareEnginePreferences { - /** RegionPreferences preferredRegions */ - preferredRegions?: (string[]|null); + /** VmwareEnginePreferences cpuOvercommitRatio */ + cpuOvercommitRatio?: (number|null); + + /** VmwareEnginePreferences memoryOvercommitRatio */ + memoryOvercommitRatio?: (number|null); + + /** VmwareEnginePreferences storageDeduplicationCompressionRatio */ + storageDeduplicationCompressionRatio?: (number|null); + + /** VmwareEnginePreferences commitmentPlan */ + commitmentPlan?: (google.cloud.migrationcenter.v1.VmwareEnginePreferences.CommitmentPlan|keyof typeof google.cloud.migrationcenter.v1.VmwareEnginePreferences.CommitmentPlan|null); } - /** Represents a RegionPreferences. */ - class RegionPreferences implements IRegionPreferences { + /** Represents a VmwareEnginePreferences. */ + class VmwareEnginePreferences implements IVmwareEnginePreferences { /** - * Constructs a new RegionPreferences. + * Constructs a new VmwareEnginePreferences. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.migrationcenter.v1.IRegionPreferences); + constructor(properties?: google.cloud.migrationcenter.v1.IVmwareEnginePreferences); - /** RegionPreferences preferredRegions. */ - public preferredRegions: string[]; + /** VmwareEnginePreferences cpuOvercommitRatio. */ + public cpuOvercommitRatio: number; - /** + /** VmwareEnginePreferences memoryOvercommitRatio. */ + public memoryOvercommitRatio: number; + + /** VmwareEnginePreferences storageDeduplicationCompressionRatio. */ + public storageDeduplicationCompressionRatio: number; + + /** VmwareEnginePreferences commitmentPlan. */ + public commitmentPlan: (google.cloud.migrationcenter.v1.VmwareEnginePreferences.CommitmentPlan|keyof typeof google.cloud.migrationcenter.v1.VmwareEnginePreferences.CommitmentPlan); + + /** + * Creates a new VmwareEnginePreferences instance using the specified properties. + * @param [properties] Properties to set + * @returns VmwareEnginePreferences instance + */ + public static create(properties?: google.cloud.migrationcenter.v1.IVmwareEnginePreferences): google.cloud.migrationcenter.v1.VmwareEnginePreferences; + + /** + * Encodes the specified VmwareEnginePreferences message. Does not implicitly {@link google.cloud.migrationcenter.v1.VmwareEnginePreferences.verify|verify} messages. + * @param message VmwareEnginePreferences message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.migrationcenter.v1.IVmwareEnginePreferences, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified VmwareEnginePreferences message, length delimited. Does not implicitly {@link google.cloud.migrationcenter.v1.VmwareEnginePreferences.verify|verify} messages. + * @param message VmwareEnginePreferences message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.migrationcenter.v1.IVmwareEnginePreferences, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a VmwareEnginePreferences message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns VmwareEnginePreferences + * @throws {Error} If the payload is not 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.migrationcenter.v1.VmwareEnginePreferences; + + /** + * Decodes a VmwareEnginePreferences message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns VmwareEnginePreferences + * @throws {Error} If the payload 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.migrationcenter.v1.VmwareEnginePreferences; + + /** + * Verifies a VmwareEnginePreferences message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a VmwareEnginePreferences message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns VmwareEnginePreferences + */ + public static fromObject(object: { [k: string]: any }): google.cloud.migrationcenter.v1.VmwareEnginePreferences; + + /** + * Creates a plain object from a VmwareEnginePreferences message. Also converts values to other types if specified. + * @param message VmwareEnginePreferences + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.migrationcenter.v1.VmwareEnginePreferences, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this VmwareEnginePreferences to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for VmwareEnginePreferences + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace VmwareEnginePreferences { + + /** CommitmentPlan enum. */ + enum CommitmentPlan { + COMMITMENT_PLAN_UNSPECIFIED = 0, + ON_DEMAND = 1, + COMMITMENT_1_YEAR_MONTHLY_PAYMENTS = 2, + COMMITMENT_3_YEAR_MONTHLY_PAYMENTS = 3, + COMMITMENT_1_YEAR_UPFRONT_PAYMENT = 4, + COMMITMENT_3_YEAR_UPFRONT_PAYMENT = 5 + } + } + + /** Properties of a SoleTenancyPreferences. */ + interface ISoleTenancyPreferences { + + /** SoleTenancyPreferences cpuOvercommitRatio */ + cpuOvercommitRatio?: (number|null); + + /** SoleTenancyPreferences hostMaintenancePolicy */ + hostMaintenancePolicy?: (google.cloud.migrationcenter.v1.SoleTenancyPreferences.HostMaintenancePolicy|keyof typeof google.cloud.migrationcenter.v1.SoleTenancyPreferences.HostMaintenancePolicy|null); + + /** SoleTenancyPreferences commitmentPlan */ + commitmentPlan?: (google.cloud.migrationcenter.v1.SoleTenancyPreferences.CommitmentPlan|keyof typeof google.cloud.migrationcenter.v1.SoleTenancyPreferences.CommitmentPlan|null); + + /** SoleTenancyPreferences nodeTypes */ + nodeTypes?: (google.cloud.migrationcenter.v1.ISoleTenantNodeType[]|null); + } + + /** Represents a SoleTenancyPreferences. */ + class SoleTenancyPreferences implements ISoleTenancyPreferences { + + /** + * Constructs a new SoleTenancyPreferences. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.migrationcenter.v1.ISoleTenancyPreferences); + + /** SoleTenancyPreferences cpuOvercommitRatio. */ + public cpuOvercommitRatio: number; + + /** SoleTenancyPreferences hostMaintenancePolicy. */ + public hostMaintenancePolicy: (google.cloud.migrationcenter.v1.SoleTenancyPreferences.HostMaintenancePolicy|keyof typeof google.cloud.migrationcenter.v1.SoleTenancyPreferences.HostMaintenancePolicy); + + /** SoleTenancyPreferences commitmentPlan. */ + public commitmentPlan: (google.cloud.migrationcenter.v1.SoleTenancyPreferences.CommitmentPlan|keyof typeof google.cloud.migrationcenter.v1.SoleTenancyPreferences.CommitmentPlan); + + /** SoleTenancyPreferences nodeTypes. */ + public nodeTypes: google.cloud.migrationcenter.v1.ISoleTenantNodeType[]; + + /** + * Creates a new SoleTenancyPreferences instance using the specified properties. + * @param [properties] Properties to set + * @returns SoleTenancyPreferences instance + */ + public static create(properties?: google.cloud.migrationcenter.v1.ISoleTenancyPreferences): google.cloud.migrationcenter.v1.SoleTenancyPreferences; + + /** + * Encodes the specified SoleTenancyPreferences message. Does not implicitly {@link google.cloud.migrationcenter.v1.SoleTenancyPreferences.verify|verify} messages. + * @param message SoleTenancyPreferences message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.migrationcenter.v1.ISoleTenancyPreferences, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified SoleTenancyPreferences message, length delimited. Does not implicitly {@link google.cloud.migrationcenter.v1.SoleTenancyPreferences.verify|verify} messages. + * @param message SoleTenancyPreferences message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.migrationcenter.v1.ISoleTenancyPreferences, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SoleTenancyPreferences message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns SoleTenancyPreferences + * @throws {Error} If the payload is not 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.migrationcenter.v1.SoleTenancyPreferences; + + /** + * Decodes a SoleTenancyPreferences message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns SoleTenancyPreferences + * @throws {Error} If the payload 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.migrationcenter.v1.SoleTenancyPreferences; + + /** + * Verifies a SoleTenancyPreferences message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a SoleTenancyPreferences message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns SoleTenancyPreferences + */ + public static fromObject(object: { [k: string]: any }): google.cloud.migrationcenter.v1.SoleTenancyPreferences; + + /** + * Creates a plain object from a SoleTenancyPreferences message. Also converts values to other types if specified. + * @param message SoleTenancyPreferences + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.migrationcenter.v1.SoleTenancyPreferences, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this SoleTenancyPreferences to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for SoleTenancyPreferences + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace SoleTenancyPreferences { + + /** HostMaintenancePolicy enum. */ + enum HostMaintenancePolicy { + HOST_MAINTENANCE_POLICY_UNSPECIFIED = 0, + HOST_MAINTENANCE_POLICY_DEFAULT = 1, + HOST_MAINTENANCE_POLICY_RESTART_IN_PLACE = 2, + HOST_MAINTENANCE_POLICY_MIGRATE_WITHIN_NODE_GROUP = 3 + } + + /** CommitmentPlan enum. */ + enum CommitmentPlan { + COMMITMENT_PLAN_UNSPECIFIED = 0, + ON_DEMAND = 1, + COMMITMENT_1_YEAR = 2, + COMMITMENT_3_YEAR = 3 + } + } + + /** Properties of a SoleTenantNodeType. */ + interface ISoleTenantNodeType { + + /** SoleTenantNodeType nodeName */ + nodeName?: (string|null); + } + + /** Represents a SoleTenantNodeType. */ + class SoleTenantNodeType implements ISoleTenantNodeType { + + /** + * Constructs a new SoleTenantNodeType. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.migrationcenter.v1.ISoleTenantNodeType); + + /** SoleTenantNodeType nodeName. */ + public nodeName: string; + + /** + * Creates a new SoleTenantNodeType instance using the specified properties. + * @param [properties] Properties to set + * @returns SoleTenantNodeType instance + */ + public static create(properties?: google.cloud.migrationcenter.v1.ISoleTenantNodeType): google.cloud.migrationcenter.v1.SoleTenantNodeType; + + /** + * Encodes the specified SoleTenantNodeType message. Does not implicitly {@link google.cloud.migrationcenter.v1.SoleTenantNodeType.verify|verify} messages. + * @param message SoleTenantNodeType message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.migrationcenter.v1.ISoleTenantNodeType, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified SoleTenantNodeType message, length delimited. Does not implicitly {@link google.cloud.migrationcenter.v1.SoleTenantNodeType.verify|verify} messages. + * @param message SoleTenantNodeType message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.migrationcenter.v1.ISoleTenantNodeType, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SoleTenantNodeType message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns SoleTenantNodeType + * @throws {Error} If the payload is not 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.migrationcenter.v1.SoleTenantNodeType; + + /** + * Decodes a SoleTenantNodeType message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns SoleTenantNodeType + * @throws {Error} If the payload 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.migrationcenter.v1.SoleTenantNodeType; + + /** + * Verifies a SoleTenantNodeType message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a SoleTenantNodeType message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns SoleTenantNodeType + */ + public static fromObject(object: { [k: string]: any }): google.cloud.migrationcenter.v1.SoleTenantNodeType; + + /** + * Creates a plain object from a SoleTenantNodeType message. Also converts values to other types if specified. + * @param message SoleTenantNodeType + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.migrationcenter.v1.SoleTenantNodeType, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this SoleTenantNodeType to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for SoleTenantNodeType + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a RegionPreferences. */ + interface IRegionPreferences { + + /** RegionPreferences preferredRegions */ + preferredRegions?: (string[]|null); + } + + /** Represents a RegionPreferences. */ + class RegionPreferences implements IRegionPreferences { + + /** + * Constructs a new RegionPreferences. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.migrationcenter.v1.IRegionPreferences); + + /** RegionPreferences preferredRegions. */ + public preferredRegions: string[]; + + /** * Creates a new RegionPreferences instance using the specified properties. * @param [properties] Properties to set * @returns RegionPreferences instance @@ -19070,392 +19671,925 @@ export namespace google { */ public static fromObject(object: { [k: string]: any }): google.cloud.migrationcenter.v1.ReportSummary.HistogramChartData.Bucket; - /** - * Creates a plain object from a Bucket message. Also converts values to other types if specified. - * @param message Bucket - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.migrationcenter.v1.ReportSummary.HistogramChartData.Bucket, options?: $protobuf.IConversionOptions): { [k: string]: any }; + /** + * Creates a plain object from a Bucket message. Also converts values to other types if specified. + * @param message Bucket + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.migrationcenter.v1.ReportSummary.HistogramChartData.Bucket, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Bucket to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Bucket + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Properties of an AssetAggregateStats. */ + interface IAssetAggregateStats { + + /** AssetAggregateStats totalMemoryBytes */ + totalMemoryBytes?: (number|Long|string|null); + + /** AssetAggregateStats totalStorageBytes */ + totalStorageBytes?: (number|Long|string|null); + + /** AssetAggregateStats totalCores */ + totalCores?: (number|Long|string|null); + + /** AssetAggregateStats totalAssets */ + totalAssets?: (number|Long|string|null); + + /** AssetAggregateStats memoryUtilizationChart */ + memoryUtilizationChart?: (google.cloud.migrationcenter.v1.ReportSummary.IUtilizationChartData|null); + + /** AssetAggregateStats storageUtilizationChart */ + storageUtilizationChart?: (google.cloud.migrationcenter.v1.ReportSummary.IUtilizationChartData|null); + + /** AssetAggregateStats operatingSystem */ + operatingSystem?: (google.cloud.migrationcenter.v1.ReportSummary.IChartData|null); + + /** AssetAggregateStats coreCountHistogram */ + coreCountHistogram?: (google.cloud.migrationcenter.v1.ReportSummary.IHistogramChartData|null); + + /** AssetAggregateStats memoryBytesHistogram */ + memoryBytesHistogram?: (google.cloud.migrationcenter.v1.ReportSummary.IHistogramChartData|null); + + /** AssetAggregateStats storageBytesHistogram */ + storageBytesHistogram?: (google.cloud.migrationcenter.v1.ReportSummary.IHistogramChartData|null); + } + + /** Represents an AssetAggregateStats. */ + class AssetAggregateStats implements IAssetAggregateStats { + + /** + * Constructs a new AssetAggregateStats. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.migrationcenter.v1.ReportSummary.IAssetAggregateStats); + + /** AssetAggregateStats totalMemoryBytes. */ + public totalMemoryBytes: (number|Long|string); + + /** AssetAggregateStats totalStorageBytes. */ + public totalStorageBytes: (number|Long|string); + + /** AssetAggregateStats totalCores. */ + public totalCores: (number|Long|string); + + /** AssetAggregateStats totalAssets. */ + public totalAssets: (number|Long|string); + + /** AssetAggregateStats memoryUtilizationChart. */ + public memoryUtilizationChart?: (google.cloud.migrationcenter.v1.ReportSummary.IUtilizationChartData|null); + + /** AssetAggregateStats storageUtilizationChart. */ + public storageUtilizationChart?: (google.cloud.migrationcenter.v1.ReportSummary.IUtilizationChartData|null); + + /** AssetAggregateStats operatingSystem. */ + public operatingSystem?: (google.cloud.migrationcenter.v1.ReportSummary.IChartData|null); + + /** AssetAggregateStats coreCountHistogram. */ + public coreCountHistogram?: (google.cloud.migrationcenter.v1.ReportSummary.IHistogramChartData|null); + + /** AssetAggregateStats memoryBytesHistogram. */ + public memoryBytesHistogram?: (google.cloud.migrationcenter.v1.ReportSummary.IHistogramChartData|null); + + /** AssetAggregateStats storageBytesHistogram. */ + public storageBytesHistogram?: (google.cloud.migrationcenter.v1.ReportSummary.IHistogramChartData|null); + + /** + * Creates a new AssetAggregateStats instance using the specified properties. + * @param [properties] Properties to set + * @returns AssetAggregateStats instance + */ + public static create(properties?: google.cloud.migrationcenter.v1.ReportSummary.IAssetAggregateStats): google.cloud.migrationcenter.v1.ReportSummary.AssetAggregateStats; + + /** + * Encodes the specified AssetAggregateStats message. Does not implicitly {@link google.cloud.migrationcenter.v1.ReportSummary.AssetAggregateStats.verify|verify} messages. + * @param message AssetAggregateStats message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.migrationcenter.v1.ReportSummary.IAssetAggregateStats, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified AssetAggregateStats message, length delimited. Does not implicitly {@link google.cloud.migrationcenter.v1.ReportSummary.AssetAggregateStats.verify|verify} messages. + * @param message AssetAggregateStats message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.migrationcenter.v1.ReportSummary.IAssetAggregateStats, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an AssetAggregateStats message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns AssetAggregateStats + * @throws {Error} If the payload is not 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.migrationcenter.v1.ReportSummary.AssetAggregateStats; + + /** + * Decodes an AssetAggregateStats message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns AssetAggregateStats + * @throws {Error} If the payload 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.migrationcenter.v1.ReportSummary.AssetAggregateStats; + + /** + * Verifies an AssetAggregateStats message. + * @param message Plain 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 AssetAggregateStats message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns AssetAggregateStats + */ + public static fromObject(object: { [k: string]: any }): google.cloud.migrationcenter.v1.ReportSummary.AssetAggregateStats; + + /** + * Creates a plain object from an AssetAggregateStats message. Also converts values to other types if specified. + * @param message AssetAggregateStats + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.migrationcenter.v1.ReportSummary.AssetAggregateStats, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this AssetAggregateStats to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for AssetAggregateStats + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a MachineSeriesAllocation. */ + interface IMachineSeriesAllocation { + + /** MachineSeriesAllocation machineSeries */ + machineSeries?: (google.cloud.migrationcenter.v1.IMachineSeries|null); + + /** MachineSeriesAllocation allocatedAssetCount */ + allocatedAssetCount?: (number|Long|string|null); + } + + /** Represents a MachineSeriesAllocation. */ + class MachineSeriesAllocation implements IMachineSeriesAllocation { + + /** + * Constructs a new MachineSeriesAllocation. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.migrationcenter.v1.ReportSummary.IMachineSeriesAllocation); + + /** MachineSeriesAllocation machineSeries. */ + public machineSeries?: (google.cloud.migrationcenter.v1.IMachineSeries|null); + + /** MachineSeriesAllocation allocatedAssetCount. */ + public allocatedAssetCount: (number|Long|string); + + /** + * Creates a new MachineSeriesAllocation instance using the specified properties. + * @param [properties] Properties to set + * @returns MachineSeriesAllocation instance + */ + public static create(properties?: google.cloud.migrationcenter.v1.ReportSummary.IMachineSeriesAllocation): google.cloud.migrationcenter.v1.ReportSummary.MachineSeriesAllocation; + + /** + * Encodes the specified MachineSeriesAllocation message. Does not implicitly {@link google.cloud.migrationcenter.v1.ReportSummary.MachineSeriesAllocation.verify|verify} messages. + * @param message MachineSeriesAllocation message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.migrationcenter.v1.ReportSummary.IMachineSeriesAllocation, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified MachineSeriesAllocation message, length delimited. Does not implicitly {@link google.cloud.migrationcenter.v1.ReportSummary.MachineSeriesAllocation.verify|verify} messages. + * @param message MachineSeriesAllocation message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.migrationcenter.v1.ReportSummary.IMachineSeriesAllocation, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a MachineSeriesAllocation message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns MachineSeriesAllocation + * @throws {Error} If the payload is not 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.migrationcenter.v1.ReportSummary.MachineSeriesAllocation; + + /** + * Decodes a MachineSeriesAllocation message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns MachineSeriesAllocation + * @throws {Error} If the payload 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.migrationcenter.v1.ReportSummary.MachineSeriesAllocation; + + /** + * Verifies a MachineSeriesAllocation message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a MachineSeriesAllocation message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns MachineSeriesAllocation + */ + public static fromObject(object: { [k: string]: any }): google.cloud.migrationcenter.v1.ReportSummary.MachineSeriesAllocation; + + /** + * Creates a plain object from a MachineSeriesAllocation message. Also converts values to other types if specified. + * @param message MachineSeriesAllocation + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.migrationcenter.v1.ReportSummary.MachineSeriesAllocation, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this MachineSeriesAllocation to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for MachineSeriesAllocation + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ComputeEngineFinding. */ + interface IComputeEngineFinding { + + /** ComputeEngineFinding allocatedRegions */ + allocatedRegions?: (string[]|null); + + /** ComputeEngineFinding allocatedAssetCount */ + allocatedAssetCount?: (number|Long|string|null); + + /** ComputeEngineFinding machineSeriesAllocations */ + machineSeriesAllocations?: (google.cloud.migrationcenter.v1.ReportSummary.IMachineSeriesAllocation[]|null); + + /** ComputeEngineFinding allocatedDiskTypes */ + allocatedDiskTypes?: (google.cloud.migrationcenter.v1.PersistentDiskType[]|null); + } + + /** Represents a ComputeEngineFinding. */ + class ComputeEngineFinding implements IComputeEngineFinding { + + /** + * Constructs a new ComputeEngineFinding. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.migrationcenter.v1.ReportSummary.IComputeEngineFinding); + + /** ComputeEngineFinding allocatedRegions. */ + public allocatedRegions: string[]; + + /** ComputeEngineFinding allocatedAssetCount. */ + public allocatedAssetCount: (number|Long|string); + + /** ComputeEngineFinding machineSeriesAllocations. */ + public machineSeriesAllocations: google.cloud.migrationcenter.v1.ReportSummary.IMachineSeriesAllocation[]; + + /** ComputeEngineFinding allocatedDiskTypes. */ + public allocatedDiskTypes: google.cloud.migrationcenter.v1.PersistentDiskType[]; + + /** + * Creates a new ComputeEngineFinding instance using the specified properties. + * @param [properties] Properties to set + * @returns ComputeEngineFinding instance + */ + public static create(properties?: google.cloud.migrationcenter.v1.ReportSummary.IComputeEngineFinding): google.cloud.migrationcenter.v1.ReportSummary.ComputeEngineFinding; + + /** + * Encodes the specified ComputeEngineFinding message. Does not implicitly {@link google.cloud.migrationcenter.v1.ReportSummary.ComputeEngineFinding.verify|verify} messages. + * @param message ComputeEngineFinding message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.migrationcenter.v1.ReportSummary.IComputeEngineFinding, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ComputeEngineFinding message, length delimited. Does not implicitly {@link google.cloud.migrationcenter.v1.ReportSummary.ComputeEngineFinding.verify|verify} messages. + * @param message ComputeEngineFinding message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.migrationcenter.v1.ReportSummary.IComputeEngineFinding, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ComputeEngineFinding message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ComputeEngineFinding + * @throws {Error} If the payload is not 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.migrationcenter.v1.ReportSummary.ComputeEngineFinding; + + /** + * Decodes a ComputeEngineFinding message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ComputeEngineFinding + * @throws {Error} If the payload 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.migrationcenter.v1.ReportSummary.ComputeEngineFinding; + + /** + * Verifies a ComputeEngineFinding message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ComputeEngineFinding message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ComputeEngineFinding + */ + public static fromObject(object: { [k: string]: any }): google.cloud.migrationcenter.v1.ReportSummary.ComputeEngineFinding; + + /** + * Creates a plain object from a ComputeEngineFinding message. Also converts values to other types if specified. + * @param message ComputeEngineFinding + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.migrationcenter.v1.ReportSummary.ComputeEngineFinding, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ComputeEngineFinding to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ComputeEngineFinding + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a VmwareEngineFinding. */ + interface IVmwareEngineFinding { + + /** VmwareEngineFinding allocatedRegions */ + allocatedRegions?: (string[]|null); + + /** VmwareEngineFinding allocatedAssetCount */ + allocatedAssetCount?: (number|Long|string|null); + + /** VmwareEngineFinding nodeAllocations */ + nodeAllocations?: (google.cloud.migrationcenter.v1.ReportSummary.IVmwareNodeAllocation[]|null); + } + + /** Represents a VmwareEngineFinding. */ + class VmwareEngineFinding implements IVmwareEngineFinding { + + /** + * Constructs a new VmwareEngineFinding. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.migrationcenter.v1.ReportSummary.IVmwareEngineFinding); + + /** VmwareEngineFinding allocatedRegions. */ + public allocatedRegions: string[]; + + /** VmwareEngineFinding allocatedAssetCount. */ + public allocatedAssetCount: (number|Long|string); + + /** VmwareEngineFinding nodeAllocations. */ + public nodeAllocations: google.cloud.migrationcenter.v1.ReportSummary.IVmwareNodeAllocation[]; + + /** + * Creates a new VmwareEngineFinding instance using the specified properties. + * @param [properties] Properties to set + * @returns VmwareEngineFinding instance + */ + public static create(properties?: google.cloud.migrationcenter.v1.ReportSummary.IVmwareEngineFinding): google.cloud.migrationcenter.v1.ReportSummary.VmwareEngineFinding; + + /** + * Encodes the specified VmwareEngineFinding message. Does not implicitly {@link google.cloud.migrationcenter.v1.ReportSummary.VmwareEngineFinding.verify|verify} messages. + * @param message VmwareEngineFinding message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.migrationcenter.v1.ReportSummary.IVmwareEngineFinding, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified VmwareEngineFinding message, length delimited. Does not implicitly {@link google.cloud.migrationcenter.v1.ReportSummary.VmwareEngineFinding.verify|verify} messages. + * @param message VmwareEngineFinding message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.migrationcenter.v1.ReportSummary.IVmwareEngineFinding, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a VmwareEngineFinding message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns VmwareEngineFinding + * @throws {Error} If the payload is not 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.migrationcenter.v1.ReportSummary.VmwareEngineFinding; + + /** + * Decodes a VmwareEngineFinding message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns VmwareEngineFinding + * @throws {Error} If the payload 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.migrationcenter.v1.ReportSummary.VmwareEngineFinding; + + /** + * Verifies a VmwareEngineFinding message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a VmwareEngineFinding message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns VmwareEngineFinding + */ + public static fromObject(object: { [k: string]: any }): google.cloud.migrationcenter.v1.ReportSummary.VmwareEngineFinding; + + /** + * Creates a plain object from a VmwareEngineFinding message. Also converts values to other types if specified. + * @param message VmwareEngineFinding + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.migrationcenter.v1.ReportSummary.VmwareEngineFinding, options?: $protobuf.IConversionOptions): { [k: string]: any }; - /** - * Converts this Bucket to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; + /** + * Converts this VmwareEngineFinding to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; - /** - * Gets the default type url for Bucket - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } + /** + * Gets the default type url for VmwareEngineFinding + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; } - /** Properties of an AssetAggregateStats. */ - interface IAssetAggregateStats { + /** Properties of a VmwareNodeAllocation. */ + interface IVmwareNodeAllocation { - /** AssetAggregateStats totalMemoryBytes */ - totalMemoryBytes?: (number|Long|string|null); + /** VmwareNodeAllocation vmwareNode */ + vmwareNode?: (google.cloud.migrationcenter.v1.ReportSummary.IVmwareNode|null); - /** AssetAggregateStats totalStorageBytes */ - totalStorageBytes?: (number|Long|string|null); + /** VmwareNodeAllocation nodeCount */ + nodeCount?: (number|Long|string|null); - /** AssetAggregateStats totalCores */ - totalCores?: (number|Long|string|null); + /** VmwareNodeAllocation allocatedAssetCount */ + allocatedAssetCount?: (number|Long|string|null); + } - /** AssetAggregateStats totalAssets */ - totalAssets?: (number|Long|string|null); + /** Represents a VmwareNodeAllocation. */ + class VmwareNodeAllocation implements IVmwareNodeAllocation { - /** AssetAggregateStats memoryUtilizationChart */ - memoryUtilizationChart?: (google.cloud.migrationcenter.v1.ReportSummary.IUtilizationChartData|null); + /** + * Constructs a new VmwareNodeAllocation. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.migrationcenter.v1.ReportSummary.IVmwareNodeAllocation); - /** AssetAggregateStats storageUtilizationChart */ - storageUtilizationChart?: (google.cloud.migrationcenter.v1.ReportSummary.IUtilizationChartData|null); + /** VmwareNodeAllocation vmwareNode. */ + public vmwareNode?: (google.cloud.migrationcenter.v1.ReportSummary.IVmwareNode|null); - /** AssetAggregateStats operatingSystem */ - operatingSystem?: (google.cloud.migrationcenter.v1.ReportSummary.IChartData|null); + /** VmwareNodeAllocation nodeCount. */ + public nodeCount: (number|Long|string); - /** AssetAggregateStats coreCountHistogram */ - coreCountHistogram?: (google.cloud.migrationcenter.v1.ReportSummary.IHistogramChartData|null); + /** VmwareNodeAllocation allocatedAssetCount. */ + public allocatedAssetCount: (number|Long|string); - /** AssetAggregateStats memoryBytesHistogram */ - memoryBytesHistogram?: (google.cloud.migrationcenter.v1.ReportSummary.IHistogramChartData|null); + /** + * Creates a new VmwareNodeAllocation instance using the specified properties. + * @param [properties] Properties to set + * @returns VmwareNodeAllocation instance + */ + public static create(properties?: google.cloud.migrationcenter.v1.ReportSummary.IVmwareNodeAllocation): google.cloud.migrationcenter.v1.ReportSummary.VmwareNodeAllocation; - /** AssetAggregateStats storageBytesHistogram */ - storageBytesHistogram?: (google.cloud.migrationcenter.v1.ReportSummary.IHistogramChartData|null); - } + /** + * Encodes the specified VmwareNodeAllocation message. Does not implicitly {@link google.cloud.migrationcenter.v1.ReportSummary.VmwareNodeAllocation.verify|verify} messages. + * @param message VmwareNodeAllocation message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.migrationcenter.v1.ReportSummary.IVmwareNodeAllocation, writer?: $protobuf.Writer): $protobuf.Writer; - /** Represents an AssetAggregateStats. */ - class AssetAggregateStats implements IAssetAggregateStats { + /** + * Encodes the specified VmwareNodeAllocation message, length delimited. Does not implicitly {@link google.cloud.migrationcenter.v1.ReportSummary.VmwareNodeAllocation.verify|verify} messages. + * @param message VmwareNodeAllocation message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.migrationcenter.v1.ReportSummary.IVmwareNodeAllocation, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Constructs a new AssetAggregateStats. - * @param [properties] Properties to set + * Decodes a VmwareNodeAllocation message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns VmwareNodeAllocation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - constructor(properties?: google.cloud.migrationcenter.v1.ReportSummary.IAssetAggregateStats); + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.migrationcenter.v1.ReportSummary.VmwareNodeAllocation; - /** AssetAggregateStats totalMemoryBytes. */ - public totalMemoryBytes: (number|Long|string); + /** + * Decodes a VmwareNodeAllocation message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns VmwareNodeAllocation + * @throws {Error} If the payload 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.migrationcenter.v1.ReportSummary.VmwareNodeAllocation; - /** AssetAggregateStats totalStorageBytes. */ - public totalStorageBytes: (number|Long|string); + /** + * Verifies a VmwareNodeAllocation message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); - /** AssetAggregateStats totalCores. */ - public totalCores: (number|Long|string); + /** + * Creates a VmwareNodeAllocation message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns VmwareNodeAllocation + */ + public static fromObject(object: { [k: string]: any }): google.cloud.migrationcenter.v1.ReportSummary.VmwareNodeAllocation; - /** AssetAggregateStats totalAssets. */ - public totalAssets: (number|Long|string); + /** + * Creates a plain object from a VmwareNodeAllocation message. Also converts values to other types if specified. + * @param message VmwareNodeAllocation + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.migrationcenter.v1.ReportSummary.VmwareNodeAllocation, options?: $protobuf.IConversionOptions): { [k: string]: any }; - /** AssetAggregateStats memoryUtilizationChart. */ - public memoryUtilizationChart?: (google.cloud.migrationcenter.v1.ReportSummary.IUtilizationChartData|null); + /** + * Converts this VmwareNodeAllocation to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; - /** AssetAggregateStats storageUtilizationChart. */ - public storageUtilizationChart?: (google.cloud.migrationcenter.v1.ReportSummary.IUtilizationChartData|null); + /** + * Gets the default type url for VmwareNodeAllocation + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } - /** AssetAggregateStats operatingSystem. */ - public operatingSystem?: (google.cloud.migrationcenter.v1.ReportSummary.IChartData|null); + /** Properties of a VmwareNode. */ + interface IVmwareNode { - /** AssetAggregateStats coreCountHistogram. */ - public coreCountHistogram?: (google.cloud.migrationcenter.v1.ReportSummary.IHistogramChartData|null); + /** VmwareNode code */ + code?: (string|null); + } - /** AssetAggregateStats memoryBytesHistogram. */ - public memoryBytesHistogram?: (google.cloud.migrationcenter.v1.ReportSummary.IHistogramChartData|null); + /** Represents a VmwareNode. */ + class VmwareNode implements IVmwareNode { - /** AssetAggregateStats storageBytesHistogram. */ - public storageBytesHistogram?: (google.cloud.migrationcenter.v1.ReportSummary.IHistogramChartData|null); + /** + * Constructs a new VmwareNode. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.migrationcenter.v1.ReportSummary.IVmwareNode); + + /** VmwareNode code. */ + public code: string; /** - * Creates a new AssetAggregateStats instance using the specified properties. + * Creates a new VmwareNode instance using the specified properties. * @param [properties] Properties to set - * @returns AssetAggregateStats instance + * @returns VmwareNode instance */ - public static create(properties?: google.cloud.migrationcenter.v1.ReportSummary.IAssetAggregateStats): google.cloud.migrationcenter.v1.ReportSummary.AssetAggregateStats; + public static create(properties?: google.cloud.migrationcenter.v1.ReportSummary.IVmwareNode): google.cloud.migrationcenter.v1.ReportSummary.VmwareNode; /** - * Encodes the specified AssetAggregateStats message. Does not implicitly {@link google.cloud.migrationcenter.v1.ReportSummary.AssetAggregateStats.verify|verify} messages. - * @param message AssetAggregateStats message or plain object to encode + * Encodes the specified VmwareNode message. Does not implicitly {@link google.cloud.migrationcenter.v1.ReportSummary.VmwareNode.verify|verify} messages. + * @param message VmwareNode message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.migrationcenter.v1.ReportSummary.IAssetAggregateStats, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.migrationcenter.v1.ReportSummary.IVmwareNode, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified AssetAggregateStats message, length delimited. Does not implicitly {@link google.cloud.migrationcenter.v1.ReportSummary.AssetAggregateStats.verify|verify} messages. - * @param message AssetAggregateStats message or plain object to encode + * Encodes the specified VmwareNode message, length delimited. Does not implicitly {@link google.cloud.migrationcenter.v1.ReportSummary.VmwareNode.verify|verify} messages. + * @param message VmwareNode message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.migrationcenter.v1.ReportSummary.IAssetAggregateStats, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.migrationcenter.v1.ReportSummary.IVmwareNode, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes an AssetAggregateStats message from the specified reader or buffer. + * Decodes a VmwareNode message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns AssetAggregateStats + * @returns VmwareNode * @throws {Error} If the payload is not 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.migrationcenter.v1.ReportSummary.AssetAggregateStats; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.migrationcenter.v1.ReportSummary.VmwareNode; /** - * Decodes an AssetAggregateStats message from the specified reader or buffer, length delimited. + * Decodes a VmwareNode message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns AssetAggregateStats + * @returns VmwareNode * @throws {Error} If the payload 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.migrationcenter.v1.ReportSummary.AssetAggregateStats; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.migrationcenter.v1.ReportSummary.VmwareNode; /** - * Verifies an AssetAggregateStats message. + * Verifies a VmwareNode message. * @param message Plain 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 AssetAggregateStats message from a plain object. Also converts values to their respective internal types. + * Creates a VmwareNode message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns AssetAggregateStats + * @returns VmwareNode */ - public static fromObject(object: { [k: string]: any }): google.cloud.migrationcenter.v1.ReportSummary.AssetAggregateStats; + public static fromObject(object: { [k: string]: any }): google.cloud.migrationcenter.v1.ReportSummary.VmwareNode; /** - * Creates a plain object from an AssetAggregateStats message. Also converts values to other types if specified. - * @param message AssetAggregateStats + * Creates a plain object from a VmwareNode message. Also converts values to other types if specified. + * @param message VmwareNode * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.migrationcenter.v1.ReportSummary.AssetAggregateStats, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.migrationcenter.v1.ReportSummary.VmwareNode, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this AssetAggregateStats to JSON. + * Converts this VmwareNode to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; /** - * Gets the default type url for AssetAggregateStats + * Gets the default type url for VmwareNode * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns The default type url */ public static getTypeUrl(typeUrlPrefix?: string): string; } - /** Properties of a MachineSeriesAllocation. */ - interface IMachineSeriesAllocation { + /** Properties of a SoleTenantFinding. */ + interface ISoleTenantFinding { - /** MachineSeriesAllocation machineSeries */ - machineSeries?: (google.cloud.migrationcenter.v1.IMachineSeries|null); + /** SoleTenantFinding allocatedRegions */ + allocatedRegions?: (string[]|null); - /** MachineSeriesAllocation allocatedAssetCount */ + /** SoleTenantFinding allocatedAssetCount */ allocatedAssetCount?: (number|Long|string|null); + + /** SoleTenantFinding nodeAllocations */ + nodeAllocations?: (google.cloud.migrationcenter.v1.ReportSummary.ISoleTenantNodeAllocation[]|null); } - /** Represents a MachineSeriesAllocation. */ - class MachineSeriesAllocation implements IMachineSeriesAllocation { + /** Represents a SoleTenantFinding. */ + class SoleTenantFinding implements ISoleTenantFinding { /** - * Constructs a new MachineSeriesAllocation. + * Constructs a new SoleTenantFinding. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.migrationcenter.v1.ReportSummary.IMachineSeriesAllocation); + constructor(properties?: google.cloud.migrationcenter.v1.ReportSummary.ISoleTenantFinding); - /** MachineSeriesAllocation machineSeries. */ - public machineSeries?: (google.cloud.migrationcenter.v1.IMachineSeries|null); + /** SoleTenantFinding allocatedRegions. */ + public allocatedRegions: string[]; - /** MachineSeriesAllocation allocatedAssetCount. */ + /** SoleTenantFinding allocatedAssetCount. */ public allocatedAssetCount: (number|Long|string); + /** SoleTenantFinding nodeAllocations. */ + public nodeAllocations: google.cloud.migrationcenter.v1.ReportSummary.ISoleTenantNodeAllocation[]; + /** - * Creates a new MachineSeriesAllocation instance using the specified properties. + * Creates a new SoleTenantFinding instance using the specified properties. * @param [properties] Properties to set - * @returns MachineSeriesAllocation instance + * @returns SoleTenantFinding instance */ - public static create(properties?: google.cloud.migrationcenter.v1.ReportSummary.IMachineSeriesAllocation): google.cloud.migrationcenter.v1.ReportSummary.MachineSeriesAllocation; + public static create(properties?: google.cloud.migrationcenter.v1.ReportSummary.ISoleTenantFinding): google.cloud.migrationcenter.v1.ReportSummary.SoleTenantFinding; /** - * Encodes the specified MachineSeriesAllocation message. Does not implicitly {@link google.cloud.migrationcenter.v1.ReportSummary.MachineSeriesAllocation.verify|verify} messages. - * @param message MachineSeriesAllocation message or plain object to encode + * Encodes the specified SoleTenantFinding message. Does not implicitly {@link google.cloud.migrationcenter.v1.ReportSummary.SoleTenantFinding.verify|verify} messages. + * @param message SoleTenantFinding message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.migrationcenter.v1.ReportSummary.IMachineSeriesAllocation, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.migrationcenter.v1.ReportSummary.ISoleTenantFinding, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified MachineSeriesAllocation message, length delimited. Does not implicitly {@link google.cloud.migrationcenter.v1.ReportSummary.MachineSeriesAllocation.verify|verify} messages. - * @param message MachineSeriesAllocation message or plain object to encode + * Encodes the specified SoleTenantFinding message, length delimited. Does not implicitly {@link google.cloud.migrationcenter.v1.ReportSummary.SoleTenantFinding.verify|verify} messages. + * @param message SoleTenantFinding message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.migrationcenter.v1.ReportSummary.IMachineSeriesAllocation, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.migrationcenter.v1.ReportSummary.ISoleTenantFinding, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a MachineSeriesAllocation message from the specified reader or buffer. + * Decodes a SoleTenantFinding message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns MachineSeriesAllocation + * @returns SoleTenantFinding * @throws {Error} If the payload is not 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.migrationcenter.v1.ReportSummary.MachineSeriesAllocation; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.migrationcenter.v1.ReportSummary.SoleTenantFinding; /** - * Decodes a MachineSeriesAllocation message from the specified reader or buffer, length delimited. + * Decodes a SoleTenantFinding message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns MachineSeriesAllocation + * @returns SoleTenantFinding * @throws {Error} If the payload 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.migrationcenter.v1.ReportSummary.MachineSeriesAllocation; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.migrationcenter.v1.ReportSummary.SoleTenantFinding; /** - * Verifies a MachineSeriesAllocation message. + * Verifies a SoleTenantFinding message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ public static verify(message: { [k: string]: any }): (string|null); /** - * Creates a MachineSeriesAllocation message from a plain object. Also converts values to their respective internal types. + * Creates a SoleTenantFinding message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns MachineSeriesAllocation + * @returns SoleTenantFinding */ - public static fromObject(object: { [k: string]: any }): google.cloud.migrationcenter.v1.ReportSummary.MachineSeriesAllocation; + public static fromObject(object: { [k: string]: any }): google.cloud.migrationcenter.v1.ReportSummary.SoleTenantFinding; /** - * Creates a plain object from a MachineSeriesAllocation message. Also converts values to other types if specified. - * @param message MachineSeriesAllocation + * Creates a plain object from a SoleTenantFinding message. Also converts values to other types if specified. + * @param message SoleTenantFinding * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.migrationcenter.v1.ReportSummary.MachineSeriesAllocation, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.migrationcenter.v1.ReportSummary.SoleTenantFinding, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this MachineSeriesAllocation to JSON. + * Converts this SoleTenantFinding to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; /** - * Gets the default type url for MachineSeriesAllocation + * Gets the default type url for SoleTenantFinding * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns The default type url */ public static getTypeUrl(typeUrlPrefix?: string): string; } - /** Properties of a ComputeEngineFinding. */ - interface IComputeEngineFinding { - - /** ComputeEngineFinding allocatedRegions */ - allocatedRegions?: (string[]|null); + /** Properties of a SoleTenantNodeAllocation. */ + interface ISoleTenantNodeAllocation { - /** ComputeEngineFinding allocatedAssetCount */ - allocatedAssetCount?: (number|Long|string|null); + /** SoleTenantNodeAllocation node */ + node?: (google.cloud.migrationcenter.v1.ISoleTenantNodeType|null); - /** ComputeEngineFinding machineSeriesAllocations */ - machineSeriesAllocations?: (google.cloud.migrationcenter.v1.ReportSummary.IMachineSeriesAllocation[]|null); + /** SoleTenantNodeAllocation nodeCount */ + nodeCount?: (number|Long|string|null); - /** ComputeEngineFinding allocatedDiskTypes */ - allocatedDiskTypes?: (google.cloud.migrationcenter.v1.PersistentDiskType[]|null); + /** SoleTenantNodeAllocation allocatedAssetCount */ + allocatedAssetCount?: (number|Long|string|null); } - /** Represents a ComputeEngineFinding. */ - class ComputeEngineFinding implements IComputeEngineFinding { + /** Represents a SoleTenantNodeAllocation. */ + class SoleTenantNodeAllocation implements ISoleTenantNodeAllocation { /** - * Constructs a new ComputeEngineFinding. + * Constructs a new SoleTenantNodeAllocation. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.migrationcenter.v1.ReportSummary.IComputeEngineFinding); + constructor(properties?: google.cloud.migrationcenter.v1.ReportSummary.ISoleTenantNodeAllocation); - /** ComputeEngineFinding allocatedRegions. */ - public allocatedRegions: string[]; - - /** ComputeEngineFinding allocatedAssetCount. */ - public allocatedAssetCount: (number|Long|string); + /** SoleTenantNodeAllocation node. */ + public node?: (google.cloud.migrationcenter.v1.ISoleTenantNodeType|null); - /** ComputeEngineFinding machineSeriesAllocations. */ - public machineSeriesAllocations: google.cloud.migrationcenter.v1.ReportSummary.IMachineSeriesAllocation[]; + /** SoleTenantNodeAllocation nodeCount. */ + public nodeCount: (number|Long|string); - /** ComputeEngineFinding allocatedDiskTypes. */ - public allocatedDiskTypes: google.cloud.migrationcenter.v1.PersistentDiskType[]; + /** SoleTenantNodeAllocation allocatedAssetCount. */ + public allocatedAssetCount: (number|Long|string); /** - * Creates a new ComputeEngineFinding instance using the specified properties. + * Creates a new SoleTenantNodeAllocation instance using the specified properties. * @param [properties] Properties to set - * @returns ComputeEngineFinding instance + * @returns SoleTenantNodeAllocation instance */ - public static create(properties?: google.cloud.migrationcenter.v1.ReportSummary.IComputeEngineFinding): google.cloud.migrationcenter.v1.ReportSummary.ComputeEngineFinding; + public static create(properties?: google.cloud.migrationcenter.v1.ReportSummary.ISoleTenantNodeAllocation): google.cloud.migrationcenter.v1.ReportSummary.SoleTenantNodeAllocation; /** - * Encodes the specified ComputeEngineFinding message. Does not implicitly {@link google.cloud.migrationcenter.v1.ReportSummary.ComputeEngineFinding.verify|verify} messages. - * @param message ComputeEngineFinding message or plain object to encode + * Encodes the specified SoleTenantNodeAllocation message. Does not implicitly {@link google.cloud.migrationcenter.v1.ReportSummary.SoleTenantNodeAllocation.verify|verify} messages. + * @param message SoleTenantNodeAllocation message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.migrationcenter.v1.ReportSummary.IComputeEngineFinding, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.migrationcenter.v1.ReportSummary.ISoleTenantNodeAllocation, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified ComputeEngineFinding message, length delimited. Does not implicitly {@link google.cloud.migrationcenter.v1.ReportSummary.ComputeEngineFinding.verify|verify} messages. - * @param message ComputeEngineFinding message or plain object to encode + * Encodes the specified SoleTenantNodeAllocation message, length delimited. Does not implicitly {@link google.cloud.migrationcenter.v1.ReportSummary.SoleTenantNodeAllocation.verify|verify} messages. + * @param message SoleTenantNodeAllocation message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.migrationcenter.v1.ReportSummary.IComputeEngineFinding, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.migrationcenter.v1.ReportSummary.ISoleTenantNodeAllocation, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a ComputeEngineFinding message from the specified reader or buffer. + * Decodes a SoleTenantNodeAllocation message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns ComputeEngineFinding + * @returns SoleTenantNodeAllocation * @throws {Error} If the payload is not 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.migrationcenter.v1.ReportSummary.ComputeEngineFinding; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.migrationcenter.v1.ReportSummary.SoleTenantNodeAllocation; /** - * Decodes a ComputeEngineFinding message from the specified reader or buffer, length delimited. + * Decodes a SoleTenantNodeAllocation message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns ComputeEngineFinding + * @returns SoleTenantNodeAllocation * @throws {Error} If the payload 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.migrationcenter.v1.ReportSummary.ComputeEngineFinding; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.migrationcenter.v1.ReportSummary.SoleTenantNodeAllocation; /** - * Verifies a ComputeEngineFinding message. + * Verifies a SoleTenantNodeAllocation message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ public static verify(message: { [k: string]: any }): (string|null); /** - * Creates a ComputeEngineFinding message from a plain object. Also converts values to their respective internal types. + * Creates a SoleTenantNodeAllocation message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns ComputeEngineFinding + * @returns SoleTenantNodeAllocation */ - public static fromObject(object: { [k: string]: any }): google.cloud.migrationcenter.v1.ReportSummary.ComputeEngineFinding; + public static fromObject(object: { [k: string]: any }): google.cloud.migrationcenter.v1.ReportSummary.SoleTenantNodeAllocation; /** - * Creates a plain object from a ComputeEngineFinding message. Also converts values to other types if specified. - * @param message ComputeEngineFinding + * Creates a plain object from a SoleTenantNodeAllocation message. Also converts values to other types if specified. + * @param message SoleTenantNodeAllocation * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.migrationcenter.v1.ReportSummary.ComputeEngineFinding, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.migrationcenter.v1.ReportSummary.SoleTenantNodeAllocation, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this ComputeEngineFinding to JSON. + * Converts this SoleTenantNodeAllocation to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; /** - * Gets the default type url for ComputeEngineFinding + * Gets the default type url for SoleTenantNodeAllocation * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns The default type url */ @@ -19494,6 +20628,12 @@ export namespace google { /** GroupPreferenceSetFinding computeEngineFinding */ computeEngineFinding?: (google.cloud.migrationcenter.v1.ReportSummary.IComputeEngineFinding|null); + + /** GroupPreferenceSetFinding vmwareEngineFinding */ + vmwareEngineFinding?: (google.cloud.migrationcenter.v1.ReportSummary.IVmwareEngineFinding|null); + + /** GroupPreferenceSetFinding soleTenantFinding */ + soleTenantFinding?: (google.cloud.migrationcenter.v1.ReportSummary.ISoleTenantFinding|null); } /** Represents a GroupPreferenceSetFinding. */ @@ -19535,6 +20675,12 @@ export namespace google { /** GroupPreferenceSetFinding computeEngineFinding. */ public computeEngineFinding?: (google.cloud.migrationcenter.v1.ReportSummary.IComputeEngineFinding|null); + /** GroupPreferenceSetFinding vmwareEngineFinding. */ + public vmwareEngineFinding?: (google.cloud.migrationcenter.v1.ReportSummary.IVmwareEngineFinding|null); + + /** GroupPreferenceSetFinding soleTenantFinding. */ + public soleTenantFinding?: (google.cloud.migrationcenter.v1.ReportSummary.ISoleTenantFinding|null); + /** * Creates a new GroupPreferenceSetFinding instance using the specified properties. * @param [properties] Properties to set @@ -19805,6 +20951,14 @@ export namespace google { COMMITMENT_PLAN_THREE_YEARS = 3 } + /** ComputeMigrationTargetProduct enum. */ + enum ComputeMigrationTargetProduct { + COMPUTE_MIGRATION_TARGET_PRODUCT_UNSPECIFIED = 0, + COMPUTE_MIGRATION_TARGET_PRODUCT_COMPUTE_ENGINE = 1, + COMPUTE_MIGRATION_TARGET_PRODUCT_VMWARE_ENGINE = 2, + COMPUTE_MIGRATION_TARGET_PRODUCT_SOLE_TENANCY = 3 + } + /** ReportView enum. */ enum ReportView { REPORT_VIEW_UNSPECIFIED = 0, diff --git a/packages/google-cloud-migrationcenter/protos/protos.js b/packages/google-cloud-migrationcenter/protos/protos.js index fc20de5de72..b06d7a5eac8 100644 --- a/packages/google-cloud-migrationcenter/protos/protos.js +++ b/packages/google-cloud-migrationcenter/protos/protos.js @@ -37560,6 +37560,7 @@ * @memberof google.cloud.migrationcenter.v1 * @interface IInsight * @property {google.cloud.migrationcenter.v1.IMigrationInsight|null} [migrationInsight] Insight migrationInsight + * @property {google.cloud.migrationcenter.v1.IGenericInsight|null} [genericInsight] Insight genericInsight */ /** @@ -37585,17 +37586,25 @@ */ Insight.prototype.migrationInsight = null; + /** + * Insight genericInsight. + * @member {google.cloud.migrationcenter.v1.IGenericInsight|null|undefined} genericInsight + * @memberof google.cloud.migrationcenter.v1.Insight + * @instance + */ + Insight.prototype.genericInsight = null; + // OneOf field names bound to virtual getters and setters var $oneOfFields; /** * Insight insight. - * @member {"migrationInsight"|undefined} insight + * @member {"migrationInsight"|"genericInsight"|undefined} insight * @memberof google.cloud.migrationcenter.v1.Insight * @instance */ Object.defineProperty(Insight.prototype, "insight", { - get: $util.oneOfGetter($oneOfFields = ["migrationInsight"]), + get: $util.oneOfGetter($oneOfFields = ["migrationInsight", "genericInsight"]), set: $util.oneOfSetter($oneOfFields) }); @@ -37625,6 +37634,8 @@ writer = $Writer.create(); if (message.migrationInsight != null && Object.hasOwnProperty.call(message, "migrationInsight")) $root.google.cloud.migrationcenter.v1.MigrationInsight.encode(message.migrationInsight, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.genericInsight != null && Object.hasOwnProperty.call(message, "genericInsight")) + $root.google.cloud.migrationcenter.v1.GenericInsight.encode(message.genericInsight, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); return writer; }; @@ -37663,6 +37674,10 @@ message.migrationInsight = $root.google.cloud.migrationcenter.v1.MigrationInsight.decode(reader, reader.uint32()); break; } + case 2: { + message.genericInsight = $root.google.cloud.migrationcenter.v1.GenericInsight.decode(reader, reader.uint32()); + break; + } default: reader.skipType(tag & 7); break; @@ -37707,6 +37722,16 @@ return "migrationInsight." + error; } } + if (message.genericInsight != null && message.hasOwnProperty("genericInsight")) { + if (properties.insight === 1) + return "insight: multiple values"; + properties.insight = 1; + { + var error = $root.google.cloud.migrationcenter.v1.GenericInsight.verify(message.genericInsight); + if (error) + return "genericInsight." + error; + } + } return null; }; @@ -37727,6 +37752,11 @@ throw TypeError(".google.cloud.migrationcenter.v1.Insight.migrationInsight: object expected"); message.migrationInsight = $root.google.cloud.migrationcenter.v1.MigrationInsight.fromObject(object.migrationInsight); } + if (object.genericInsight != null) { + if (typeof object.genericInsight !== "object") + throw TypeError(".google.cloud.migrationcenter.v1.Insight.genericInsight: object expected"); + message.genericInsight = $root.google.cloud.migrationcenter.v1.GenericInsight.fromObject(object.genericInsight); + } return message; }; @@ -37748,6 +37778,11 @@ if (options.oneofs) object.insight = "migrationInsight"; } + if (message.genericInsight != null && message.hasOwnProperty("genericInsight")) { + object.genericInsight = $root.google.cloud.migrationcenter.v1.GenericInsight.toObject(message.genericInsight, options); + if (options.oneofs) + object.insight = "genericInsight"; + } return object; }; @@ -37780,6 +37815,287 @@ return Insight; })(); + v1.GenericInsight = (function() { + + /** + * Properties of a GenericInsight. + * @memberof google.cloud.migrationcenter.v1 + * @interface IGenericInsight + * @property {number|Long|null} [messageId] GenericInsight messageId + * @property {string|null} [defaultMessage] GenericInsight defaultMessage + * @property {Array.|null} [additionalInformation] GenericInsight additionalInformation + */ + + /** + * Constructs a new GenericInsight. + * @memberof google.cloud.migrationcenter.v1 + * @classdesc Represents a GenericInsight. + * @implements IGenericInsight + * @constructor + * @param {google.cloud.migrationcenter.v1.IGenericInsight=} [properties] Properties to set + */ + function GenericInsight(properties) { + this.additionalInformation = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GenericInsight messageId. + * @member {number|Long} messageId + * @memberof google.cloud.migrationcenter.v1.GenericInsight + * @instance + */ + GenericInsight.prototype.messageId = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * GenericInsight defaultMessage. + * @member {string} defaultMessage + * @memberof google.cloud.migrationcenter.v1.GenericInsight + * @instance + */ + GenericInsight.prototype.defaultMessage = ""; + + /** + * GenericInsight additionalInformation. + * @member {Array.} additionalInformation + * @memberof google.cloud.migrationcenter.v1.GenericInsight + * @instance + */ + GenericInsight.prototype.additionalInformation = $util.emptyArray; + + /** + * Creates a new GenericInsight instance using the specified properties. + * @function create + * @memberof google.cloud.migrationcenter.v1.GenericInsight + * @static + * @param {google.cloud.migrationcenter.v1.IGenericInsight=} [properties] Properties to set + * @returns {google.cloud.migrationcenter.v1.GenericInsight} GenericInsight instance + */ + GenericInsight.create = function create(properties) { + return new GenericInsight(properties); + }; + + /** + * Encodes the specified GenericInsight message. Does not implicitly {@link google.cloud.migrationcenter.v1.GenericInsight.verify|verify} messages. + * @function encode + * @memberof google.cloud.migrationcenter.v1.GenericInsight + * @static + * @param {google.cloud.migrationcenter.v1.IGenericInsight} message GenericInsight message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GenericInsight.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.messageId != null && Object.hasOwnProperty.call(message, "messageId")) + writer.uint32(/* id 1, wireType 0 =*/8).int64(message.messageId); + if (message.defaultMessage != null && Object.hasOwnProperty.call(message, "defaultMessage")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.defaultMessage); + if (message.additionalInformation != null && message.additionalInformation.length) + for (var i = 0; i < message.additionalInformation.length; ++i) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.additionalInformation[i]); + return writer; + }; + + /** + * Encodes the specified GenericInsight message, length delimited. Does not implicitly {@link google.cloud.migrationcenter.v1.GenericInsight.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.migrationcenter.v1.GenericInsight + * @static + * @param {google.cloud.migrationcenter.v1.IGenericInsight} message GenericInsight message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GenericInsight.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GenericInsight message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.migrationcenter.v1.GenericInsight + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.migrationcenter.v1.GenericInsight} GenericInsight + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GenericInsight.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.migrationcenter.v1.GenericInsight(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.messageId = reader.int64(); + break; + } + case 2: { + message.defaultMessage = reader.string(); + break; + } + case 3: { + if (!(message.additionalInformation && message.additionalInformation.length)) + message.additionalInformation = []; + message.additionalInformation.push(reader.string()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GenericInsight message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.migrationcenter.v1.GenericInsight + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.migrationcenter.v1.GenericInsight} GenericInsight + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GenericInsight.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GenericInsight message. + * @function verify + * @memberof google.cloud.migrationcenter.v1.GenericInsight + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GenericInsight.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.messageId != null && message.hasOwnProperty("messageId")) + if (!$util.isInteger(message.messageId) && !(message.messageId && $util.isInteger(message.messageId.low) && $util.isInteger(message.messageId.high))) + return "messageId: integer|Long expected"; + if (message.defaultMessage != null && message.hasOwnProperty("defaultMessage")) + if (!$util.isString(message.defaultMessage)) + return "defaultMessage: string expected"; + if (message.additionalInformation != null && message.hasOwnProperty("additionalInformation")) { + if (!Array.isArray(message.additionalInformation)) + return "additionalInformation: array expected"; + for (var i = 0; i < message.additionalInformation.length; ++i) + if (!$util.isString(message.additionalInformation[i])) + return "additionalInformation: string[] expected"; + } + return null; + }; + + /** + * Creates a GenericInsight message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.migrationcenter.v1.GenericInsight + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.migrationcenter.v1.GenericInsight} GenericInsight + */ + GenericInsight.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.migrationcenter.v1.GenericInsight) + return object; + var message = new $root.google.cloud.migrationcenter.v1.GenericInsight(); + if (object.messageId != null) + if ($util.Long) + (message.messageId = $util.Long.fromValue(object.messageId)).unsigned = false; + else if (typeof object.messageId === "string") + message.messageId = parseInt(object.messageId, 10); + else if (typeof object.messageId === "number") + message.messageId = object.messageId; + else if (typeof object.messageId === "object") + message.messageId = new $util.LongBits(object.messageId.low >>> 0, object.messageId.high >>> 0).toNumber(); + if (object.defaultMessage != null) + message.defaultMessage = String(object.defaultMessage); + if (object.additionalInformation) { + if (!Array.isArray(object.additionalInformation)) + throw TypeError(".google.cloud.migrationcenter.v1.GenericInsight.additionalInformation: array expected"); + message.additionalInformation = []; + for (var i = 0; i < object.additionalInformation.length; ++i) + message.additionalInformation[i] = String(object.additionalInformation[i]); + } + return message; + }; + + /** + * Creates a plain object from a GenericInsight message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.migrationcenter.v1.GenericInsight + * @static + * @param {google.cloud.migrationcenter.v1.GenericInsight} message GenericInsight + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GenericInsight.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.additionalInformation = []; + if (options.defaults) { + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.messageId = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.messageId = options.longs === String ? "0" : 0; + object.defaultMessage = ""; + } + if (message.messageId != null && message.hasOwnProperty("messageId")) + if (typeof message.messageId === "number") + object.messageId = options.longs === String ? String(message.messageId) : message.messageId; + else + object.messageId = options.longs === String ? $util.Long.prototype.toString.call(message.messageId) : options.longs === Number ? new $util.LongBits(message.messageId.low >>> 0, message.messageId.high >>> 0).toNumber() : message.messageId; + if (message.defaultMessage != null && message.hasOwnProperty("defaultMessage")) + object.defaultMessage = message.defaultMessage; + if (message.additionalInformation && message.additionalInformation.length) { + object.additionalInformation = []; + for (var j = 0; j < message.additionalInformation.length; ++j) + object.additionalInformation[j] = message.additionalInformation[j]; + } + return object; + }; + + /** + * Converts this GenericInsight to JSON. + * @function toJSON + * @memberof google.cloud.migrationcenter.v1.GenericInsight + * @instance + * @returns {Object.} JSON object + */ + GenericInsight.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GenericInsight + * @function getTypeUrl + * @memberof google.cloud.migrationcenter.v1.GenericInsight + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GenericInsight.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.migrationcenter.v1.GenericInsight"; + }; + + return GenericInsight; + })(); + v1.MigrationInsight = (function() { /** @@ -38244,24 +38560,30 @@ return ComputeEngineMigrationTarget; })(); - v1.FitDescriptor = (function() { + v1.ComputeEngineShapeDescriptor = (function() { /** - * Properties of a FitDescriptor. + * Properties of a ComputeEngineShapeDescriptor. * @memberof google.cloud.migrationcenter.v1 - * @interface IFitDescriptor - * @property {google.cloud.migrationcenter.v1.FitDescriptor.FitLevel|null} [fitLevel] FitDescriptor fitLevel + * @interface IComputeEngineShapeDescriptor + * @property {number|null} [memoryMb] ComputeEngineShapeDescriptor memoryMb + * @property {number|null} [physicalCoreCount] ComputeEngineShapeDescriptor physicalCoreCount + * @property {number|null} [logicalCoreCount] ComputeEngineShapeDescriptor logicalCoreCount + * @property {string|null} [series] ComputeEngineShapeDescriptor series + * @property {string|null} [machineType] ComputeEngineShapeDescriptor machineType + * @property {Array.|null} [storage] ComputeEngineShapeDescriptor storage */ /** - * Constructs a new FitDescriptor. + * Constructs a new ComputeEngineShapeDescriptor. * @memberof google.cloud.migrationcenter.v1 - * @classdesc Represents a FitDescriptor. - * @implements IFitDescriptor + * @classdesc Represents a ComputeEngineShapeDescriptor. + * @implements IComputeEngineShapeDescriptor * @constructor - * @param {google.cloud.migrationcenter.v1.IFitDescriptor=} [properties] Properties to set + * @param {google.cloud.migrationcenter.v1.IComputeEngineShapeDescriptor=} [properties] Properties to set */ - function FitDescriptor(properties) { + function ComputeEngineShapeDescriptor(properties) { + this.storage = []; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -38269,298 +38591,52 @@ } /** - * FitDescriptor fitLevel. - * @member {google.cloud.migrationcenter.v1.FitDescriptor.FitLevel} fitLevel - * @memberof google.cloud.migrationcenter.v1.FitDescriptor + * ComputeEngineShapeDescriptor memoryMb. + * @member {number} memoryMb + * @memberof google.cloud.migrationcenter.v1.ComputeEngineShapeDescriptor * @instance */ - FitDescriptor.prototype.fitLevel = 0; + ComputeEngineShapeDescriptor.prototype.memoryMb = 0; /** - * Creates a new FitDescriptor instance using the specified properties. - * @function create - * @memberof google.cloud.migrationcenter.v1.FitDescriptor - * @static - * @param {google.cloud.migrationcenter.v1.IFitDescriptor=} [properties] Properties to set - * @returns {google.cloud.migrationcenter.v1.FitDescriptor} FitDescriptor instance + * ComputeEngineShapeDescriptor physicalCoreCount. + * @member {number} physicalCoreCount + * @memberof google.cloud.migrationcenter.v1.ComputeEngineShapeDescriptor + * @instance */ - FitDescriptor.create = function create(properties) { - return new FitDescriptor(properties); - }; + ComputeEngineShapeDescriptor.prototype.physicalCoreCount = 0; /** - * Encodes the specified FitDescriptor message. Does not implicitly {@link google.cloud.migrationcenter.v1.FitDescriptor.verify|verify} messages. - * @function encode - * @memberof google.cloud.migrationcenter.v1.FitDescriptor - * @static - * @param {google.cloud.migrationcenter.v1.IFitDescriptor} message FitDescriptor message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer + * ComputeEngineShapeDescriptor logicalCoreCount. + * @member {number} logicalCoreCount + * @memberof google.cloud.migrationcenter.v1.ComputeEngineShapeDescriptor + * @instance */ - FitDescriptor.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.fitLevel != null && Object.hasOwnProperty.call(message, "fitLevel")) - writer.uint32(/* id 1, wireType 0 =*/8).int32(message.fitLevel); - return writer; - }; + ComputeEngineShapeDescriptor.prototype.logicalCoreCount = 0; /** - * Encodes the specified FitDescriptor message, length delimited. Does not implicitly {@link google.cloud.migrationcenter.v1.FitDescriptor.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.migrationcenter.v1.FitDescriptor - * @static - * @param {google.cloud.migrationcenter.v1.IFitDescriptor} message FitDescriptor message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer + * ComputeEngineShapeDescriptor series. + * @member {string} series + * @memberof google.cloud.migrationcenter.v1.ComputeEngineShapeDescriptor + * @instance */ - FitDescriptor.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; + ComputeEngineShapeDescriptor.prototype.series = ""; /** - * Decodes a FitDescriptor message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.migrationcenter.v1.FitDescriptor - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.migrationcenter.v1.FitDescriptor} FitDescriptor - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - FitDescriptor.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.migrationcenter.v1.FitDescriptor(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - message.fitLevel = reader.int32(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a FitDescriptor message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.migrationcenter.v1.FitDescriptor - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.migrationcenter.v1.FitDescriptor} FitDescriptor - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - FitDescriptor.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a FitDescriptor message. - * @function verify - * @memberof google.cloud.migrationcenter.v1.FitDescriptor - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - FitDescriptor.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.fitLevel != null && message.hasOwnProperty("fitLevel")) - switch (message.fitLevel) { - default: - return "fitLevel: enum value expected"; - case 0: - case 1: - case 2: - case 3: - break; - } - return null; - }; - - /** - * Creates a FitDescriptor message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.migrationcenter.v1.FitDescriptor - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.migrationcenter.v1.FitDescriptor} FitDescriptor - */ - FitDescriptor.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.migrationcenter.v1.FitDescriptor) - return object; - var message = new $root.google.cloud.migrationcenter.v1.FitDescriptor(); - switch (object.fitLevel) { - default: - if (typeof object.fitLevel === "number") { - message.fitLevel = object.fitLevel; - break; - } - break; - case "FIT_LEVEL_UNSPECIFIED": - case 0: - message.fitLevel = 0; - break; - case "FIT": - case 1: - message.fitLevel = 1; - break; - case "NO_FIT": - case 2: - message.fitLevel = 2; - break; - case "REQUIRES_EFFORT": - case 3: - message.fitLevel = 3; - break; - } - return message; - }; - - /** - * Creates a plain object from a FitDescriptor message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.migrationcenter.v1.FitDescriptor - * @static - * @param {google.cloud.migrationcenter.v1.FitDescriptor} message FitDescriptor - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - FitDescriptor.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - object.fitLevel = options.enums === String ? "FIT_LEVEL_UNSPECIFIED" : 0; - if (message.fitLevel != null && message.hasOwnProperty("fitLevel")) - object.fitLevel = options.enums === String ? $root.google.cloud.migrationcenter.v1.FitDescriptor.FitLevel[message.fitLevel] === undefined ? message.fitLevel : $root.google.cloud.migrationcenter.v1.FitDescriptor.FitLevel[message.fitLevel] : message.fitLevel; - return object; - }; - - /** - * Converts this FitDescriptor to JSON. - * @function toJSON - * @memberof google.cloud.migrationcenter.v1.FitDescriptor - * @instance - * @returns {Object.} JSON object - */ - FitDescriptor.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for FitDescriptor - * @function getTypeUrl - * @memberof google.cloud.migrationcenter.v1.FitDescriptor - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - FitDescriptor.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.migrationcenter.v1.FitDescriptor"; - }; - - /** - * FitLevel enum. - * @name google.cloud.migrationcenter.v1.FitDescriptor.FitLevel - * @enum {number} - * @property {number} FIT_LEVEL_UNSPECIFIED=0 FIT_LEVEL_UNSPECIFIED value - * @property {number} FIT=1 FIT value - * @property {number} NO_FIT=2 NO_FIT value - * @property {number} REQUIRES_EFFORT=3 REQUIRES_EFFORT value - */ - FitDescriptor.FitLevel = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "FIT_LEVEL_UNSPECIFIED"] = 0; - values[valuesById[1] = "FIT"] = 1; - values[valuesById[2] = "NO_FIT"] = 2; - values[valuesById[3] = "REQUIRES_EFFORT"] = 3; - return values; - })(); - - return FitDescriptor; - })(); - - v1.ComputeEngineShapeDescriptor = (function() { - - /** - * Properties of a ComputeEngineShapeDescriptor. - * @memberof google.cloud.migrationcenter.v1 - * @interface IComputeEngineShapeDescriptor - * @property {number|null} [memoryMb] ComputeEngineShapeDescriptor memoryMb - * @property {number|null} [physicalCoreCount] ComputeEngineShapeDescriptor physicalCoreCount - * @property {number|null} [logicalCoreCount] ComputeEngineShapeDescriptor logicalCoreCount - * @property {string|null} [series] ComputeEngineShapeDescriptor series - * @property {string|null} [machineType] ComputeEngineShapeDescriptor machineType - */ - - /** - * Constructs a new ComputeEngineShapeDescriptor. - * @memberof google.cloud.migrationcenter.v1 - * @classdesc Represents a ComputeEngineShapeDescriptor. - * @implements IComputeEngineShapeDescriptor - * @constructor - * @param {google.cloud.migrationcenter.v1.IComputeEngineShapeDescriptor=} [properties] Properties to set - */ - function ComputeEngineShapeDescriptor(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * ComputeEngineShapeDescriptor memoryMb. - * @member {number} memoryMb - * @memberof google.cloud.migrationcenter.v1.ComputeEngineShapeDescriptor - * @instance - */ - ComputeEngineShapeDescriptor.prototype.memoryMb = 0; - - /** - * ComputeEngineShapeDescriptor physicalCoreCount. - * @member {number} physicalCoreCount - * @memberof google.cloud.migrationcenter.v1.ComputeEngineShapeDescriptor - * @instance - */ - ComputeEngineShapeDescriptor.prototype.physicalCoreCount = 0; - - /** - * ComputeEngineShapeDescriptor logicalCoreCount. - * @member {number} logicalCoreCount - * @memberof google.cloud.migrationcenter.v1.ComputeEngineShapeDescriptor - * @instance - */ - ComputeEngineShapeDescriptor.prototype.logicalCoreCount = 0; - - /** - * ComputeEngineShapeDescriptor series. - * @member {string} series + * ComputeEngineShapeDescriptor machineType. + * @member {string} machineType * @memberof google.cloud.migrationcenter.v1.ComputeEngineShapeDescriptor * @instance */ - ComputeEngineShapeDescriptor.prototype.series = ""; + ComputeEngineShapeDescriptor.prototype.machineType = ""; /** - * ComputeEngineShapeDescriptor machineType. - * @member {string} machineType + * ComputeEngineShapeDescriptor storage. + * @member {Array.} storage * @memberof google.cloud.migrationcenter.v1.ComputeEngineShapeDescriptor * @instance */ - ComputeEngineShapeDescriptor.prototype.machineType = ""; + ComputeEngineShapeDescriptor.prototype.storage = $util.emptyArray; /** * Creates a new ComputeEngineShapeDescriptor instance using the specified properties. @@ -38596,6 +38672,9 @@ writer.uint32(/* id 4, wireType 2 =*/34).string(message.series); if (message.machineType != null && Object.hasOwnProperty.call(message, "machineType")) writer.uint32(/* id 5, wireType 2 =*/42).string(message.machineType); + if (message.storage != null && message.storage.length) + for (var i = 0; i < message.storage.length; ++i) + $root.google.cloud.migrationcenter.v1.ComputeStorageDescriptor.encode(message.storage[i], writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); return writer; }; @@ -38650,6 +38729,12 @@ message.machineType = reader.string(); break; } + case 6: { + if (!(message.storage && message.storage.length)) + message.storage = []; + message.storage.push($root.google.cloud.migrationcenter.v1.ComputeStorageDescriptor.decode(reader, reader.uint32())); + break; + } default: reader.skipType(tag & 7); break; @@ -38700,6 +38785,15 @@ if (message.machineType != null && message.hasOwnProperty("machineType")) if (!$util.isString(message.machineType)) return "machineType: string expected"; + if (message.storage != null && message.hasOwnProperty("storage")) { + if (!Array.isArray(message.storage)) + return "storage: array expected"; + for (var i = 0; i < message.storage.length; ++i) { + var error = $root.google.cloud.migrationcenter.v1.ComputeStorageDescriptor.verify(message.storage[i]); + if (error) + return "storage." + error; + } + } return null; }; @@ -38725,6 +38819,16 @@ message.series = String(object.series); if (object.machineType != null) message.machineType = String(object.machineType); + if (object.storage) { + if (!Array.isArray(object.storage)) + throw TypeError(".google.cloud.migrationcenter.v1.ComputeEngineShapeDescriptor.storage: array expected"); + message.storage = []; + for (var i = 0; i < object.storage.length; ++i) { + if (typeof object.storage[i] !== "object") + throw TypeError(".google.cloud.migrationcenter.v1.ComputeEngineShapeDescriptor.storage: object expected"); + message.storage[i] = $root.google.cloud.migrationcenter.v1.ComputeStorageDescriptor.fromObject(object.storage[i]); + } + } return message; }; @@ -38741,6 +38845,8 @@ if (!options) options = {}; var object = {}; + if (options.arrays || options.defaults) + object.storage = []; if (options.defaults) { object.memoryMb = 0; object.physicalCoreCount = 0; @@ -38758,6 +38864,11 @@ object.series = message.series; if (message.machineType != null && message.hasOwnProperty("machineType")) object.machineType = message.machineType; + if (message.storage && message.storage.length) { + object.storage = []; + for (var j = 0; j < message.storage.length; ++j) + object.storage[j] = $root.google.cloud.migrationcenter.v1.ComputeStorageDescriptor.toObject(message.storage[j], options); + } return object; }; @@ -38790,28 +38901,25 @@ return ComputeEngineShapeDescriptor; })(); - v1.Aggregation = (function() { + v1.ComputeStorageDescriptor = (function() { /** - * Properties of an Aggregation. + * Properties of a ComputeStorageDescriptor. * @memberof google.cloud.migrationcenter.v1 - * @interface IAggregation - * @property {string|null} [field] Aggregation field - * @property {google.cloud.migrationcenter.v1.Aggregation.ICount|null} [count] Aggregation count - * @property {google.cloud.migrationcenter.v1.Aggregation.ISum|null} [sum] Aggregation sum - * @property {google.cloud.migrationcenter.v1.Aggregation.IHistogram|null} [histogram] Aggregation histogram - * @property {google.cloud.migrationcenter.v1.Aggregation.IFrequency|null} [frequency] Aggregation frequency + * @interface IComputeStorageDescriptor + * @property {google.cloud.migrationcenter.v1.PersistentDiskType|null} [type] ComputeStorageDescriptor type + * @property {number|null} [sizeGb] ComputeStorageDescriptor sizeGb */ /** - * Constructs a new Aggregation. + * Constructs a new ComputeStorageDescriptor. * @memberof google.cloud.migrationcenter.v1 - * @classdesc Represents an Aggregation. - * @implements IAggregation + * @classdesc Represents a ComputeStorageDescriptor. + * @implements IComputeStorageDescriptor * @constructor - * @param {google.cloud.migrationcenter.v1.IAggregation=} [properties] Properties to set + * @param {google.cloud.migrationcenter.v1.IComputeStorageDescriptor=} [properties] Properties to set */ - function Aggregation(properties) { + function ComputeStorageDescriptor(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -38819,145 +38927,89 @@ } /** - * Aggregation field. - * @member {string} field - * @memberof google.cloud.migrationcenter.v1.Aggregation - * @instance - */ - Aggregation.prototype.field = ""; - - /** - * Aggregation count. - * @member {google.cloud.migrationcenter.v1.Aggregation.ICount|null|undefined} count - * @memberof google.cloud.migrationcenter.v1.Aggregation - * @instance - */ - Aggregation.prototype.count = null; - - /** - * Aggregation sum. - * @member {google.cloud.migrationcenter.v1.Aggregation.ISum|null|undefined} sum - * @memberof google.cloud.migrationcenter.v1.Aggregation - * @instance - */ - Aggregation.prototype.sum = null; - - /** - * Aggregation histogram. - * @member {google.cloud.migrationcenter.v1.Aggregation.IHistogram|null|undefined} histogram - * @memberof google.cloud.migrationcenter.v1.Aggregation - * @instance - */ - Aggregation.prototype.histogram = null; - - /** - * Aggregation frequency. - * @member {google.cloud.migrationcenter.v1.Aggregation.IFrequency|null|undefined} frequency - * @memberof google.cloud.migrationcenter.v1.Aggregation + * ComputeStorageDescriptor type. + * @member {google.cloud.migrationcenter.v1.PersistentDiskType} type + * @memberof google.cloud.migrationcenter.v1.ComputeStorageDescriptor * @instance */ - Aggregation.prototype.frequency = null; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; + ComputeStorageDescriptor.prototype.type = 0; /** - * Aggregation aggregationFunction. - * @member {"count"|"sum"|"histogram"|"frequency"|undefined} aggregationFunction - * @memberof google.cloud.migrationcenter.v1.Aggregation + * ComputeStorageDescriptor sizeGb. + * @member {number} sizeGb + * @memberof google.cloud.migrationcenter.v1.ComputeStorageDescriptor * @instance */ - Object.defineProperty(Aggregation.prototype, "aggregationFunction", { - get: $util.oneOfGetter($oneOfFields = ["count", "sum", "histogram", "frequency"]), - set: $util.oneOfSetter($oneOfFields) - }); + ComputeStorageDescriptor.prototype.sizeGb = 0; /** - * Creates a new Aggregation instance using the specified properties. + * Creates a new ComputeStorageDescriptor instance using the specified properties. * @function create - * @memberof google.cloud.migrationcenter.v1.Aggregation + * @memberof google.cloud.migrationcenter.v1.ComputeStorageDescriptor * @static - * @param {google.cloud.migrationcenter.v1.IAggregation=} [properties] Properties to set - * @returns {google.cloud.migrationcenter.v1.Aggregation} Aggregation instance + * @param {google.cloud.migrationcenter.v1.IComputeStorageDescriptor=} [properties] Properties to set + * @returns {google.cloud.migrationcenter.v1.ComputeStorageDescriptor} ComputeStorageDescriptor instance */ - Aggregation.create = function create(properties) { - return new Aggregation(properties); + ComputeStorageDescriptor.create = function create(properties) { + return new ComputeStorageDescriptor(properties); }; /** - * Encodes the specified Aggregation message. Does not implicitly {@link google.cloud.migrationcenter.v1.Aggregation.verify|verify} messages. + * Encodes the specified ComputeStorageDescriptor message. Does not implicitly {@link google.cloud.migrationcenter.v1.ComputeStorageDescriptor.verify|verify} messages. * @function encode - * @memberof google.cloud.migrationcenter.v1.Aggregation + * @memberof google.cloud.migrationcenter.v1.ComputeStorageDescriptor * @static - * @param {google.cloud.migrationcenter.v1.IAggregation} message Aggregation message or plain object to encode + * @param {google.cloud.migrationcenter.v1.IComputeStorageDescriptor} message ComputeStorageDescriptor message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - Aggregation.encode = function encode(message, writer) { + ComputeStorageDescriptor.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.field != null && Object.hasOwnProperty.call(message, "field")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.field); - if (message.count != null && Object.hasOwnProperty.call(message, "count")) - $root.google.cloud.migrationcenter.v1.Aggregation.Count.encode(message.count, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.sum != null && Object.hasOwnProperty.call(message, "sum")) - $root.google.cloud.migrationcenter.v1.Aggregation.Sum.encode(message.sum, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - if (message.histogram != null && Object.hasOwnProperty.call(message, "histogram")) - $root.google.cloud.migrationcenter.v1.Aggregation.Histogram.encode(message.histogram, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); - if (message.frequency != null && Object.hasOwnProperty.call(message, "frequency")) - $root.google.cloud.migrationcenter.v1.Aggregation.Frequency.encode(message.frequency, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.type != null && Object.hasOwnProperty.call(message, "type")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.type); + if (message.sizeGb != null && Object.hasOwnProperty.call(message, "sizeGb")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.sizeGb); return writer; }; /** - * Encodes the specified Aggregation message, length delimited. Does not implicitly {@link google.cloud.migrationcenter.v1.Aggregation.verify|verify} messages. + * Encodes the specified ComputeStorageDescriptor message, length delimited. Does not implicitly {@link google.cloud.migrationcenter.v1.ComputeStorageDescriptor.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.migrationcenter.v1.Aggregation + * @memberof google.cloud.migrationcenter.v1.ComputeStorageDescriptor * @static - * @param {google.cloud.migrationcenter.v1.IAggregation} message Aggregation message or plain object to encode + * @param {google.cloud.migrationcenter.v1.IComputeStorageDescriptor} message ComputeStorageDescriptor message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - Aggregation.encodeDelimited = function encodeDelimited(message, writer) { + ComputeStorageDescriptor.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes an Aggregation message from the specified reader or buffer. + * Decodes a ComputeStorageDescriptor message from the specified reader or buffer. * @function decode - * @memberof google.cloud.migrationcenter.v1.Aggregation + * @memberof google.cloud.migrationcenter.v1.ComputeStorageDescriptor * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.migrationcenter.v1.Aggregation} Aggregation + * @returns {google.cloud.migrationcenter.v1.ComputeStorageDescriptor} ComputeStorageDescriptor * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - Aggregation.decode = function decode(reader, length) { + ComputeStorageDescriptor.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.migrationcenter.v1.Aggregation(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.migrationcenter.v1.ComputeStorageDescriptor(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: { - message.field = reader.string(); + message.type = reader.int32(); break; } case 2: { - message.count = $root.google.cloud.migrationcenter.v1.Aggregation.Count.decode(reader, reader.uint32()); - break; - } - case 3: { - message.sum = $root.google.cloud.migrationcenter.v1.Aggregation.Sum.decode(reader, reader.uint32()); - break; - } - case 4: { - message.histogram = $root.google.cloud.migrationcenter.v1.Aggregation.Histogram.decode(reader, reader.uint32()); - break; - } - case 5: { - message.frequency = $root.google.cloud.migrationcenter.v1.Aggregation.Frequency.decode(reader, reader.uint32()); + message.sizeGb = reader.int32(); break; } default: @@ -38969,835 +39021,823 @@ }; /** - * Decodes an Aggregation message from the specified reader or buffer, length delimited. + * Decodes a ComputeStorageDescriptor message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.migrationcenter.v1.Aggregation + * @memberof google.cloud.migrationcenter.v1.ComputeStorageDescriptor * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.migrationcenter.v1.Aggregation} Aggregation + * @returns {google.cloud.migrationcenter.v1.ComputeStorageDescriptor} ComputeStorageDescriptor * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - Aggregation.decodeDelimited = function decodeDelimited(reader) { + ComputeStorageDescriptor.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies an Aggregation message. + * Verifies a ComputeStorageDescriptor message. * @function verify - * @memberof google.cloud.migrationcenter.v1.Aggregation + * @memberof google.cloud.migrationcenter.v1.ComputeStorageDescriptor * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - Aggregation.verify = function verify(message) { + ComputeStorageDescriptor.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - var properties = {}; - if (message.field != null && message.hasOwnProperty("field")) - if (!$util.isString(message.field)) - return "field: string expected"; - if (message.count != null && message.hasOwnProperty("count")) { - properties.aggregationFunction = 1; - { - var error = $root.google.cloud.migrationcenter.v1.Aggregation.Count.verify(message.count); - if (error) - return "count." + error; - } - } - if (message.sum != null && message.hasOwnProperty("sum")) { - if (properties.aggregationFunction === 1) - return "aggregationFunction: multiple values"; - properties.aggregationFunction = 1; - { - var error = $root.google.cloud.migrationcenter.v1.Aggregation.Sum.verify(message.sum); - if (error) - return "sum." + error; - } - } - if (message.histogram != null && message.hasOwnProperty("histogram")) { - if (properties.aggregationFunction === 1) - return "aggregationFunction: multiple values"; - properties.aggregationFunction = 1; - { - var error = $root.google.cloud.migrationcenter.v1.Aggregation.Histogram.verify(message.histogram); - if (error) - return "histogram." + error; - } - } - if (message.frequency != null && message.hasOwnProperty("frequency")) { - if (properties.aggregationFunction === 1) - return "aggregationFunction: multiple values"; - properties.aggregationFunction = 1; - { - var error = $root.google.cloud.migrationcenter.v1.Aggregation.Frequency.verify(message.frequency); - if (error) - return "frequency." + error; + if (message.type != null && message.hasOwnProperty("type")) + switch (message.type) { + default: + return "type: enum value expected"; + case 0: + case 1: + case 2: + case 3: + break; } - } + if (message.sizeGb != null && message.hasOwnProperty("sizeGb")) + if (!$util.isInteger(message.sizeGb)) + return "sizeGb: integer expected"; return null; }; /** - * Creates an Aggregation message from a plain object. Also converts values to their respective internal types. + * Creates a ComputeStorageDescriptor message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.migrationcenter.v1.Aggregation + * @memberof google.cloud.migrationcenter.v1.ComputeStorageDescriptor * @static * @param {Object.} object Plain object - * @returns {google.cloud.migrationcenter.v1.Aggregation} Aggregation + * @returns {google.cloud.migrationcenter.v1.ComputeStorageDescriptor} ComputeStorageDescriptor */ - Aggregation.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.migrationcenter.v1.Aggregation) + ComputeStorageDescriptor.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.migrationcenter.v1.ComputeStorageDescriptor) return object; - var message = new $root.google.cloud.migrationcenter.v1.Aggregation(); - if (object.field != null) - message.field = String(object.field); - if (object.count != null) { - if (typeof object.count !== "object") - throw TypeError(".google.cloud.migrationcenter.v1.Aggregation.count: object expected"); - message.count = $root.google.cloud.migrationcenter.v1.Aggregation.Count.fromObject(object.count); - } - if (object.sum != null) { - if (typeof object.sum !== "object") - throw TypeError(".google.cloud.migrationcenter.v1.Aggregation.sum: object expected"); - message.sum = $root.google.cloud.migrationcenter.v1.Aggregation.Sum.fromObject(object.sum); - } - if (object.histogram != null) { - if (typeof object.histogram !== "object") - throw TypeError(".google.cloud.migrationcenter.v1.Aggregation.histogram: object expected"); - message.histogram = $root.google.cloud.migrationcenter.v1.Aggregation.Histogram.fromObject(object.histogram); - } - if (object.frequency != null) { - if (typeof object.frequency !== "object") - throw TypeError(".google.cloud.migrationcenter.v1.Aggregation.frequency: object expected"); - message.frequency = $root.google.cloud.migrationcenter.v1.Aggregation.Frequency.fromObject(object.frequency); + var message = new $root.google.cloud.migrationcenter.v1.ComputeStorageDescriptor(); + switch (object.type) { + default: + if (typeof object.type === "number") { + message.type = object.type; + break; + } + break; + case "PERSISTENT_DISK_TYPE_UNSPECIFIED": + case 0: + message.type = 0; + break; + case "PERSISTENT_DISK_TYPE_STANDARD": + case 1: + message.type = 1; + break; + case "PERSISTENT_DISK_TYPE_BALANCED": + case 2: + message.type = 2; + break; + case "PERSISTENT_DISK_TYPE_SSD": + case 3: + message.type = 3; + break; } + if (object.sizeGb != null) + message.sizeGb = object.sizeGb | 0; return message; }; /** - * Creates a plain object from an Aggregation message. Also converts values to other types if specified. + * Creates a plain object from a ComputeStorageDescriptor message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.migrationcenter.v1.Aggregation + * @memberof google.cloud.migrationcenter.v1.ComputeStorageDescriptor * @static - * @param {google.cloud.migrationcenter.v1.Aggregation} message Aggregation + * @param {google.cloud.migrationcenter.v1.ComputeStorageDescriptor} message ComputeStorageDescriptor * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - Aggregation.toObject = function toObject(message, options) { + ComputeStorageDescriptor.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.defaults) - object.field = ""; - if (message.field != null && message.hasOwnProperty("field")) - object.field = message.field; - if (message.count != null && message.hasOwnProperty("count")) { - object.count = $root.google.cloud.migrationcenter.v1.Aggregation.Count.toObject(message.count, options); - if (options.oneofs) - object.aggregationFunction = "count"; - } - if (message.sum != null && message.hasOwnProperty("sum")) { - object.sum = $root.google.cloud.migrationcenter.v1.Aggregation.Sum.toObject(message.sum, options); - if (options.oneofs) - object.aggregationFunction = "sum"; - } - if (message.histogram != null && message.hasOwnProperty("histogram")) { - object.histogram = $root.google.cloud.migrationcenter.v1.Aggregation.Histogram.toObject(message.histogram, options); - if (options.oneofs) - object.aggregationFunction = "histogram"; - } - if (message.frequency != null && message.hasOwnProperty("frequency")) { - object.frequency = $root.google.cloud.migrationcenter.v1.Aggregation.Frequency.toObject(message.frequency, options); - if (options.oneofs) - object.aggregationFunction = "frequency"; + if (options.defaults) { + object.type = options.enums === String ? "PERSISTENT_DISK_TYPE_UNSPECIFIED" : 0; + object.sizeGb = 0; } + if (message.type != null && message.hasOwnProperty("type")) + object.type = options.enums === String ? $root.google.cloud.migrationcenter.v1.PersistentDiskType[message.type] === undefined ? message.type : $root.google.cloud.migrationcenter.v1.PersistentDiskType[message.type] : message.type; + if (message.sizeGb != null && message.hasOwnProperty("sizeGb")) + object.sizeGb = message.sizeGb; return object; }; /** - * Converts this Aggregation to JSON. + * Converts this ComputeStorageDescriptor to JSON. * @function toJSON - * @memberof google.cloud.migrationcenter.v1.Aggregation + * @memberof google.cloud.migrationcenter.v1.ComputeStorageDescriptor * @instance * @returns {Object.} JSON object */ - Aggregation.prototype.toJSON = function toJSON() { + ComputeStorageDescriptor.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for Aggregation + * Gets the default type url for ComputeStorageDescriptor * @function getTypeUrl - * @memberof google.cloud.migrationcenter.v1.Aggregation + * @memberof google.cloud.migrationcenter.v1.ComputeStorageDescriptor * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - Aggregation.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + ComputeStorageDescriptor.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.cloud.migrationcenter.v1.Aggregation"; + return typeUrlPrefix + "/google.cloud.migrationcenter.v1.ComputeStorageDescriptor"; }; - Aggregation.Count = (function() { - - /** - * Properties of a Count. - * @memberof google.cloud.migrationcenter.v1.Aggregation - * @interface ICount - */ + return ComputeStorageDescriptor; + })(); - /** - * Constructs a new Count. - * @memberof google.cloud.migrationcenter.v1.Aggregation - * @classdesc Represents a Count. - * @implements ICount - * @constructor - * @param {google.cloud.migrationcenter.v1.Aggregation.ICount=} [properties] Properties to set - */ - function Count(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } + v1.FitDescriptor = (function() { - /** - * Creates a new Count instance using the specified properties. - * @function create - * @memberof google.cloud.migrationcenter.v1.Aggregation.Count - * @static - * @param {google.cloud.migrationcenter.v1.Aggregation.ICount=} [properties] Properties to set - * @returns {google.cloud.migrationcenter.v1.Aggregation.Count} Count instance - */ - Count.create = function create(properties) { - return new Count(properties); - }; - - /** - * Encodes the specified Count message. Does not implicitly {@link google.cloud.migrationcenter.v1.Aggregation.Count.verify|verify} messages. - * @function encode - * @memberof google.cloud.migrationcenter.v1.Aggregation.Count - * @static - * @param {google.cloud.migrationcenter.v1.Aggregation.ICount} message Count message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Count.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - return writer; - }; - - /** - * Encodes the specified Count message, length delimited. Does not implicitly {@link google.cloud.migrationcenter.v1.Aggregation.Count.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.migrationcenter.v1.Aggregation.Count - * @static - * @param {google.cloud.migrationcenter.v1.Aggregation.ICount} message Count message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Count.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a Count message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.migrationcenter.v1.Aggregation.Count - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.migrationcenter.v1.Aggregation.Count} Count - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Count.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.migrationcenter.v1.Aggregation.Count(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; + /** + * Properties of a FitDescriptor. + * @memberof google.cloud.migrationcenter.v1 + * @interface IFitDescriptor + * @property {google.cloud.migrationcenter.v1.FitDescriptor.FitLevel|null} [fitLevel] FitDescriptor fitLevel + */ - /** - * Decodes a Count message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.migrationcenter.v1.Aggregation.Count - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.migrationcenter.v1.Aggregation.Count} Count - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Count.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; + /** + * Constructs a new FitDescriptor. + * @memberof google.cloud.migrationcenter.v1 + * @classdesc Represents a FitDescriptor. + * @implements IFitDescriptor + * @constructor + * @param {google.cloud.migrationcenter.v1.IFitDescriptor=} [properties] Properties to set + */ + function FitDescriptor(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } - /** - * Verifies a Count message. - * @function verify - * @memberof google.cloud.migrationcenter.v1.Aggregation.Count - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Count.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - return null; - }; + /** + * FitDescriptor fitLevel. + * @member {google.cloud.migrationcenter.v1.FitDescriptor.FitLevel} fitLevel + * @memberof google.cloud.migrationcenter.v1.FitDescriptor + * @instance + */ + FitDescriptor.prototype.fitLevel = 0; - /** - * Creates a Count message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.migrationcenter.v1.Aggregation.Count - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.migrationcenter.v1.Aggregation.Count} Count - */ - Count.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.migrationcenter.v1.Aggregation.Count) - return object; - return new $root.google.cloud.migrationcenter.v1.Aggregation.Count(); - }; + /** + * Creates a new FitDescriptor instance using the specified properties. + * @function create + * @memberof google.cloud.migrationcenter.v1.FitDescriptor + * @static + * @param {google.cloud.migrationcenter.v1.IFitDescriptor=} [properties] Properties to set + * @returns {google.cloud.migrationcenter.v1.FitDescriptor} FitDescriptor instance + */ + FitDescriptor.create = function create(properties) { + return new FitDescriptor(properties); + }; - /** - * Creates a plain object from a Count message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.migrationcenter.v1.Aggregation.Count - * @static - * @param {google.cloud.migrationcenter.v1.Aggregation.Count} message Count - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Count.toObject = function toObject() { - return {}; - }; + /** + * Encodes the specified FitDescriptor message. Does not implicitly {@link google.cloud.migrationcenter.v1.FitDescriptor.verify|verify} messages. + * @function encode + * @memberof google.cloud.migrationcenter.v1.FitDescriptor + * @static + * @param {google.cloud.migrationcenter.v1.IFitDescriptor} message FitDescriptor message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FitDescriptor.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.fitLevel != null && Object.hasOwnProperty.call(message, "fitLevel")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.fitLevel); + return writer; + }; - /** - * Converts this Count to JSON. - * @function toJSON - * @memberof google.cloud.migrationcenter.v1.Aggregation.Count - * @instance - * @returns {Object.} JSON object - */ - Count.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; + /** + * Encodes the specified FitDescriptor message, length delimited. Does not implicitly {@link google.cloud.migrationcenter.v1.FitDescriptor.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.migrationcenter.v1.FitDescriptor + * @static + * @param {google.cloud.migrationcenter.v1.IFitDescriptor} message FitDescriptor message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FitDescriptor.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; - /** - * Gets the default type url for Count - * @function getTypeUrl - * @memberof google.cloud.migrationcenter.v1.Aggregation.Count - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - Count.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; + /** + * Decodes a FitDescriptor message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.migrationcenter.v1.FitDescriptor + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.migrationcenter.v1.FitDescriptor} FitDescriptor + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FitDescriptor.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.migrationcenter.v1.FitDescriptor(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.fitLevel = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; } - return typeUrlPrefix + "/google.cloud.migrationcenter.v1.Aggregation.Count"; - }; - - return Count; - })(); + } + return message; + }; - Aggregation.Sum = (function() { + /** + * Decodes a FitDescriptor message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.migrationcenter.v1.FitDescriptor + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.migrationcenter.v1.FitDescriptor} FitDescriptor + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FitDescriptor.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; - /** - * Properties of a Sum. - * @memberof google.cloud.migrationcenter.v1.Aggregation - * @interface ISum - */ + /** + * Verifies a FitDescriptor message. + * @function verify + * @memberof google.cloud.migrationcenter.v1.FitDescriptor + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + FitDescriptor.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.fitLevel != null && message.hasOwnProperty("fitLevel")) + switch (message.fitLevel) { + default: + return "fitLevel: enum value expected"; + case 0: + case 1: + case 2: + case 3: + break; + } + return null; + }; - /** - * Constructs a new Sum. - * @memberof google.cloud.migrationcenter.v1.Aggregation - * @classdesc Represents a Sum. - * @implements ISum - * @constructor - * @param {google.cloud.migrationcenter.v1.Aggregation.ISum=} [properties] Properties to set - */ - function Sum(properties) { - if (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 FitDescriptor message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.migrationcenter.v1.FitDescriptor + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.migrationcenter.v1.FitDescriptor} FitDescriptor + */ + FitDescriptor.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.migrationcenter.v1.FitDescriptor) + return object; + var message = new $root.google.cloud.migrationcenter.v1.FitDescriptor(); + switch (object.fitLevel) { + default: + if (typeof object.fitLevel === "number") { + message.fitLevel = object.fitLevel; + break; + } + break; + case "FIT_LEVEL_UNSPECIFIED": + case 0: + message.fitLevel = 0; + break; + case "FIT": + case 1: + message.fitLevel = 1; + break; + case "NO_FIT": + case 2: + message.fitLevel = 2; + break; + case "REQUIRES_EFFORT": + case 3: + message.fitLevel = 3; + break; } + return message; + }; - /** - * Creates a new Sum instance using the specified properties. - * @function create - * @memberof google.cloud.migrationcenter.v1.Aggregation.Sum - * @static - * @param {google.cloud.migrationcenter.v1.Aggregation.ISum=} [properties] Properties to set - * @returns {google.cloud.migrationcenter.v1.Aggregation.Sum} Sum instance - */ - Sum.create = function create(properties) { - return new Sum(properties); - }; + /** + * Creates a plain object from a FitDescriptor message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.migrationcenter.v1.FitDescriptor + * @static + * @param {google.cloud.migrationcenter.v1.FitDescriptor} message FitDescriptor + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + FitDescriptor.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.fitLevel = options.enums === String ? "FIT_LEVEL_UNSPECIFIED" : 0; + if (message.fitLevel != null && message.hasOwnProperty("fitLevel")) + object.fitLevel = options.enums === String ? $root.google.cloud.migrationcenter.v1.FitDescriptor.FitLevel[message.fitLevel] === undefined ? message.fitLevel : $root.google.cloud.migrationcenter.v1.FitDescriptor.FitLevel[message.fitLevel] : message.fitLevel; + return object; + }; - /** - * Encodes the specified Sum message. Does not implicitly {@link google.cloud.migrationcenter.v1.Aggregation.Sum.verify|verify} messages. - * @function encode - * @memberof google.cloud.migrationcenter.v1.Aggregation.Sum - * @static - * @param {google.cloud.migrationcenter.v1.Aggregation.ISum} message Sum message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Sum.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - return writer; - }; + /** + * Converts this FitDescriptor to JSON. + * @function toJSON + * @memberof google.cloud.migrationcenter.v1.FitDescriptor + * @instance + * @returns {Object.} JSON object + */ + FitDescriptor.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; - /** - * Encodes the specified Sum message, length delimited. Does not implicitly {@link google.cloud.migrationcenter.v1.Aggregation.Sum.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.migrationcenter.v1.Aggregation.Sum - * @static - * @param {google.cloud.migrationcenter.v1.Aggregation.ISum} message Sum message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Sum.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; + /** + * Gets the default type url for FitDescriptor + * @function getTypeUrl + * @memberof google.cloud.migrationcenter.v1.FitDescriptor + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FitDescriptor.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.migrationcenter.v1.FitDescriptor"; + }; - /** - * Decodes a Sum message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.migrationcenter.v1.Aggregation.Sum - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.migrationcenter.v1.Aggregation.Sum} Sum - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Sum.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.migrationcenter.v1.Aggregation.Sum(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; + /** + * FitLevel enum. + * @name google.cloud.migrationcenter.v1.FitDescriptor.FitLevel + * @enum {number} + * @property {number} FIT_LEVEL_UNSPECIFIED=0 FIT_LEVEL_UNSPECIFIED value + * @property {number} FIT=1 FIT value + * @property {number} NO_FIT=2 NO_FIT value + * @property {number} REQUIRES_EFFORT=3 REQUIRES_EFFORT value + */ + FitDescriptor.FitLevel = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "FIT_LEVEL_UNSPECIFIED"] = 0; + values[valuesById[1] = "FIT"] = 1; + values[valuesById[2] = "NO_FIT"] = 2; + values[valuesById[3] = "REQUIRES_EFFORT"] = 3; + return values; + })(); - /** - * Decodes a Sum message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.migrationcenter.v1.Aggregation.Sum - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.migrationcenter.v1.Aggregation.Sum} Sum - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Sum.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; + return FitDescriptor; + })(); - /** - * Verifies a Sum message. - * @function verify - * @memberof google.cloud.migrationcenter.v1.Aggregation.Sum - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Sum.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - return null; - }; + v1.Aggregation = (function() { - /** - * Creates a Sum message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.migrationcenter.v1.Aggregation.Sum - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.migrationcenter.v1.Aggregation.Sum} Sum - */ - Sum.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.migrationcenter.v1.Aggregation.Sum) - return object; - return new $root.google.cloud.migrationcenter.v1.Aggregation.Sum(); - }; + /** + * Properties of an Aggregation. + * @memberof google.cloud.migrationcenter.v1 + * @interface IAggregation + * @property {string|null} [field] Aggregation field + * @property {google.cloud.migrationcenter.v1.Aggregation.ICount|null} [count] Aggregation count + * @property {google.cloud.migrationcenter.v1.Aggregation.ISum|null} [sum] Aggregation sum + * @property {google.cloud.migrationcenter.v1.Aggregation.IHistogram|null} [histogram] Aggregation histogram + * @property {google.cloud.migrationcenter.v1.Aggregation.IFrequency|null} [frequency] Aggregation frequency + */ - /** - * Creates a plain object from a Sum message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.migrationcenter.v1.Aggregation.Sum - * @static - * @param {google.cloud.migrationcenter.v1.Aggregation.Sum} message Sum - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Sum.toObject = function toObject() { - return {}; - }; - - /** - * Converts this Sum to JSON. - * @function toJSON - * @memberof google.cloud.migrationcenter.v1.Aggregation.Sum - * @instance - * @returns {Object.} JSON object - */ - Sum.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; + /** + * Constructs a new Aggregation. + * @memberof google.cloud.migrationcenter.v1 + * @classdesc Represents an Aggregation. + * @implements IAggregation + * @constructor + * @param {google.cloud.migrationcenter.v1.IAggregation=} [properties] Properties to set + */ + function Aggregation(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } - /** - * Gets the default type url for Sum - * @function getTypeUrl - * @memberof google.cloud.migrationcenter.v1.Aggregation.Sum - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - Sum.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.migrationcenter.v1.Aggregation.Sum"; - }; + /** + * Aggregation field. + * @member {string} field + * @memberof google.cloud.migrationcenter.v1.Aggregation + * @instance + */ + Aggregation.prototype.field = ""; - return Sum; - })(); + /** + * Aggregation count. + * @member {google.cloud.migrationcenter.v1.Aggregation.ICount|null|undefined} count + * @memberof google.cloud.migrationcenter.v1.Aggregation + * @instance + */ + Aggregation.prototype.count = null; - Aggregation.Histogram = (function() { + /** + * Aggregation sum. + * @member {google.cloud.migrationcenter.v1.Aggregation.ISum|null|undefined} sum + * @memberof google.cloud.migrationcenter.v1.Aggregation + * @instance + */ + Aggregation.prototype.sum = null; - /** - * Properties of a Histogram. - * @memberof google.cloud.migrationcenter.v1.Aggregation - * @interface IHistogram - * @property {Array.|null} [lowerBounds] Histogram lowerBounds - */ + /** + * Aggregation histogram. + * @member {google.cloud.migrationcenter.v1.Aggregation.IHistogram|null|undefined} histogram + * @memberof google.cloud.migrationcenter.v1.Aggregation + * @instance + */ + Aggregation.prototype.histogram = null; - /** - * Constructs a new Histogram. - * @memberof google.cloud.migrationcenter.v1.Aggregation - * @classdesc Represents a Histogram. - * @implements IHistogram - * @constructor - * @param {google.cloud.migrationcenter.v1.Aggregation.IHistogram=} [properties] Properties to set - */ - function Histogram(properties) { - this.lowerBounds = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } + /** + * Aggregation frequency. + * @member {google.cloud.migrationcenter.v1.Aggregation.IFrequency|null|undefined} frequency + * @memberof google.cloud.migrationcenter.v1.Aggregation + * @instance + */ + Aggregation.prototype.frequency = null; - /** - * Histogram lowerBounds. - * @member {Array.} lowerBounds - * @memberof google.cloud.migrationcenter.v1.Aggregation.Histogram - * @instance - */ - Histogram.prototype.lowerBounds = $util.emptyArray; + // OneOf field names bound to virtual getters and setters + var $oneOfFields; - /** - * Creates a new Histogram instance using the specified properties. - * @function create - * @memberof google.cloud.migrationcenter.v1.Aggregation.Histogram - * @static - * @param {google.cloud.migrationcenter.v1.Aggregation.IHistogram=} [properties] Properties to set - * @returns {google.cloud.migrationcenter.v1.Aggregation.Histogram} Histogram instance - */ - Histogram.create = function create(properties) { - return new Histogram(properties); - }; + /** + * Aggregation aggregationFunction. + * @member {"count"|"sum"|"histogram"|"frequency"|undefined} aggregationFunction + * @memberof google.cloud.migrationcenter.v1.Aggregation + * @instance + */ + Object.defineProperty(Aggregation.prototype, "aggregationFunction", { + get: $util.oneOfGetter($oneOfFields = ["count", "sum", "histogram", "frequency"]), + set: $util.oneOfSetter($oneOfFields) + }); - /** - * Encodes the specified Histogram message. Does not implicitly {@link google.cloud.migrationcenter.v1.Aggregation.Histogram.verify|verify} messages. - * @function encode - * @memberof google.cloud.migrationcenter.v1.Aggregation.Histogram - * @static - * @param {google.cloud.migrationcenter.v1.Aggregation.IHistogram} message Histogram message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Histogram.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.lowerBounds != null && message.lowerBounds.length) { - writer.uint32(/* id 1, wireType 2 =*/10).fork(); - for (var i = 0; i < message.lowerBounds.length; ++i) - writer.double(message.lowerBounds[i]); - writer.ldelim(); - } - return writer; - }; + /** + * Creates a new Aggregation instance using the specified properties. + * @function create + * @memberof google.cloud.migrationcenter.v1.Aggregation + * @static + * @param {google.cloud.migrationcenter.v1.IAggregation=} [properties] Properties to set + * @returns {google.cloud.migrationcenter.v1.Aggregation} Aggregation instance + */ + Aggregation.create = function create(properties) { + return new Aggregation(properties); + }; - /** - * Encodes the specified Histogram message, length delimited. Does not implicitly {@link google.cloud.migrationcenter.v1.Aggregation.Histogram.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.migrationcenter.v1.Aggregation.Histogram - * @static - * @param {google.cloud.migrationcenter.v1.Aggregation.IHistogram} message Histogram message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Histogram.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; + /** + * Encodes the specified Aggregation message. Does not implicitly {@link google.cloud.migrationcenter.v1.Aggregation.verify|verify} messages. + * @function encode + * @memberof google.cloud.migrationcenter.v1.Aggregation + * @static + * @param {google.cloud.migrationcenter.v1.IAggregation} message Aggregation message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Aggregation.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.field != null && Object.hasOwnProperty.call(message, "field")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.field); + if (message.count != null && Object.hasOwnProperty.call(message, "count")) + $root.google.cloud.migrationcenter.v1.Aggregation.Count.encode(message.count, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.sum != null && Object.hasOwnProperty.call(message, "sum")) + $root.google.cloud.migrationcenter.v1.Aggregation.Sum.encode(message.sum, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.histogram != null && Object.hasOwnProperty.call(message, "histogram")) + $root.google.cloud.migrationcenter.v1.Aggregation.Histogram.encode(message.histogram, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.frequency != null && Object.hasOwnProperty.call(message, "frequency")) + $root.google.cloud.migrationcenter.v1.Aggregation.Frequency.encode(message.frequency, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + return writer; + }; - /** - * Decodes a Histogram message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.migrationcenter.v1.Aggregation.Histogram - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.migrationcenter.v1.Aggregation.Histogram} Histogram - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Histogram.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.migrationcenter.v1.Aggregation.Histogram(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - if (!(message.lowerBounds && message.lowerBounds.length)) - message.lowerBounds = []; - if ((tag & 7) === 2) { - var end2 = reader.uint32() + reader.pos; - while (reader.pos < end2) - message.lowerBounds.push(reader.double()); - } else - message.lowerBounds.push(reader.double()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; + /** + * Encodes the specified Aggregation message, length delimited. Does not implicitly {@link google.cloud.migrationcenter.v1.Aggregation.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.migrationcenter.v1.Aggregation + * @static + * @param {google.cloud.migrationcenter.v1.IAggregation} message Aggregation message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Aggregation.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; - /** - * Decodes a Histogram message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.migrationcenter.v1.Aggregation.Histogram - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.migrationcenter.v1.Aggregation.Histogram} Histogram - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Histogram.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a Histogram message. - * @function verify - * @memberof google.cloud.migrationcenter.v1.Aggregation.Histogram - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Histogram.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.lowerBounds != null && message.hasOwnProperty("lowerBounds")) { - if (!Array.isArray(message.lowerBounds)) - return "lowerBounds: array expected"; - for (var i = 0; i < message.lowerBounds.length; ++i) - if (typeof message.lowerBounds[i] !== "number") - return "lowerBounds: number[] expected"; + /** + * Decodes an Aggregation message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.migrationcenter.v1.Aggregation + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.migrationcenter.v1.Aggregation} Aggregation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Aggregation.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.migrationcenter.v1.Aggregation(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.field = reader.string(); + break; + } + case 2: { + message.count = $root.google.cloud.migrationcenter.v1.Aggregation.Count.decode(reader, reader.uint32()); + break; + } + case 3: { + message.sum = $root.google.cloud.migrationcenter.v1.Aggregation.Sum.decode(reader, reader.uint32()); + break; + } + case 4: { + message.histogram = $root.google.cloud.migrationcenter.v1.Aggregation.Histogram.decode(reader, reader.uint32()); + break; + } + case 5: { + message.frequency = $root.google.cloud.migrationcenter.v1.Aggregation.Frequency.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; } - return null; - }; + } + return message; + }; - /** - * Creates a Histogram message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.migrationcenter.v1.Aggregation.Histogram - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.migrationcenter.v1.Aggregation.Histogram} Histogram - */ - Histogram.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.migrationcenter.v1.Aggregation.Histogram) - return object; - var message = new $root.google.cloud.migrationcenter.v1.Aggregation.Histogram(); - if (object.lowerBounds) { - if (!Array.isArray(object.lowerBounds)) - throw TypeError(".google.cloud.migrationcenter.v1.Aggregation.Histogram.lowerBounds: array expected"); - message.lowerBounds = []; - for (var i = 0; i < object.lowerBounds.length; ++i) - message.lowerBounds[i] = Number(object.lowerBounds[i]); - } - return message; - }; + /** + * Decodes an Aggregation message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.migrationcenter.v1.Aggregation + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.migrationcenter.v1.Aggregation} Aggregation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Aggregation.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; - /** - * Creates a plain object from a Histogram message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.migrationcenter.v1.Aggregation.Histogram - * @static - * @param {google.cloud.migrationcenter.v1.Aggregation.Histogram} message Histogram - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Histogram.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.lowerBounds = []; - if (message.lowerBounds && message.lowerBounds.length) { - object.lowerBounds = []; - for (var j = 0; j < message.lowerBounds.length; ++j) - object.lowerBounds[j] = options.json && !isFinite(message.lowerBounds[j]) ? String(message.lowerBounds[j]) : message.lowerBounds[j]; + /** + * Verifies an Aggregation message. + * @function verify + * @memberof google.cloud.migrationcenter.v1.Aggregation + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Aggregation.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.field != null && message.hasOwnProperty("field")) + if (!$util.isString(message.field)) + return "field: string expected"; + if (message.count != null && message.hasOwnProperty("count")) { + properties.aggregationFunction = 1; + { + var error = $root.google.cloud.migrationcenter.v1.Aggregation.Count.verify(message.count); + if (error) + return "count." + error; } - return object; - }; - - /** - * Converts this Histogram to JSON. - * @function toJSON - * @memberof google.cloud.migrationcenter.v1.Aggregation.Histogram - * @instance - * @returns {Object.} JSON object - */ - Histogram.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for Histogram - * @function getTypeUrl - * @memberof google.cloud.migrationcenter.v1.Aggregation.Histogram - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - Histogram.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; + } + if (message.sum != null && message.hasOwnProperty("sum")) { + if (properties.aggregationFunction === 1) + return "aggregationFunction: multiple values"; + properties.aggregationFunction = 1; + { + var error = $root.google.cloud.migrationcenter.v1.Aggregation.Sum.verify(message.sum); + if (error) + return "sum." + error; } - return typeUrlPrefix + "/google.cloud.migrationcenter.v1.Aggregation.Histogram"; - }; - - return Histogram; - })(); - - Aggregation.Frequency = (function() { - - /** - * Properties of a Frequency. - * @memberof google.cloud.migrationcenter.v1.Aggregation - * @interface IFrequency - */ - - /** - * Constructs a new Frequency. - * @memberof google.cloud.migrationcenter.v1.Aggregation - * @classdesc Represents a Frequency. - * @implements IFrequency - * @constructor - * @param {google.cloud.migrationcenter.v1.Aggregation.IFrequency=} [properties] Properties to set - */ - function Frequency(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; } + if (message.histogram != null && message.hasOwnProperty("histogram")) { + if (properties.aggregationFunction === 1) + return "aggregationFunction: multiple values"; + properties.aggregationFunction = 1; + { + var error = $root.google.cloud.migrationcenter.v1.Aggregation.Histogram.verify(message.histogram); + if (error) + return "histogram." + error; + } + } + if (message.frequency != null && message.hasOwnProperty("frequency")) { + if (properties.aggregationFunction === 1) + return "aggregationFunction: multiple values"; + properties.aggregationFunction = 1; + { + var error = $root.google.cloud.migrationcenter.v1.Aggregation.Frequency.verify(message.frequency); + if (error) + return "frequency." + error; + } + } + return null; + }; - /** - * Creates a new Frequency instance using the specified properties. - * @function create - * @memberof google.cloud.migrationcenter.v1.Aggregation.Frequency - * @static - * @param {google.cloud.migrationcenter.v1.Aggregation.IFrequency=} [properties] Properties to set - * @returns {google.cloud.migrationcenter.v1.Aggregation.Frequency} Frequency instance - */ - Frequency.create = function create(properties) { - return new Frequency(properties); - }; - - /** - * Encodes the specified Frequency message. Does not implicitly {@link google.cloud.migrationcenter.v1.Aggregation.Frequency.verify|verify} messages. - * @function encode - * @memberof google.cloud.migrationcenter.v1.Aggregation.Frequency - * @static - * @param {google.cloud.migrationcenter.v1.Aggregation.IFrequency} message Frequency message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Frequency.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - return writer; + /** + * Creates an Aggregation message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.migrationcenter.v1.Aggregation + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.migrationcenter.v1.Aggregation} Aggregation + */ + Aggregation.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.migrationcenter.v1.Aggregation) + return object; + var message = new $root.google.cloud.migrationcenter.v1.Aggregation(); + if (object.field != null) + message.field = String(object.field); + if (object.count != null) { + if (typeof object.count !== "object") + throw TypeError(".google.cloud.migrationcenter.v1.Aggregation.count: object expected"); + message.count = $root.google.cloud.migrationcenter.v1.Aggregation.Count.fromObject(object.count); + } + if (object.sum != null) { + if (typeof object.sum !== "object") + throw TypeError(".google.cloud.migrationcenter.v1.Aggregation.sum: object expected"); + message.sum = $root.google.cloud.migrationcenter.v1.Aggregation.Sum.fromObject(object.sum); + } + if (object.histogram != null) { + if (typeof object.histogram !== "object") + throw TypeError(".google.cloud.migrationcenter.v1.Aggregation.histogram: object expected"); + message.histogram = $root.google.cloud.migrationcenter.v1.Aggregation.Histogram.fromObject(object.histogram); + } + if (object.frequency != null) { + if (typeof object.frequency !== "object") + throw TypeError(".google.cloud.migrationcenter.v1.Aggregation.frequency: object expected"); + message.frequency = $root.google.cloud.migrationcenter.v1.Aggregation.Frequency.fromObject(object.frequency); + } + return message; + }; + + /** + * Creates a plain object from an Aggregation message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.migrationcenter.v1.Aggregation + * @static + * @param {google.cloud.migrationcenter.v1.Aggregation} message Aggregation + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Aggregation.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.field = ""; + if (message.field != null && message.hasOwnProperty("field")) + object.field = message.field; + if (message.count != null && message.hasOwnProperty("count")) { + object.count = $root.google.cloud.migrationcenter.v1.Aggregation.Count.toObject(message.count, options); + if (options.oneofs) + object.aggregationFunction = "count"; + } + if (message.sum != null && message.hasOwnProperty("sum")) { + object.sum = $root.google.cloud.migrationcenter.v1.Aggregation.Sum.toObject(message.sum, options); + if (options.oneofs) + object.aggregationFunction = "sum"; + } + if (message.histogram != null && message.hasOwnProperty("histogram")) { + object.histogram = $root.google.cloud.migrationcenter.v1.Aggregation.Histogram.toObject(message.histogram, options); + if (options.oneofs) + object.aggregationFunction = "histogram"; + } + if (message.frequency != null && message.hasOwnProperty("frequency")) { + object.frequency = $root.google.cloud.migrationcenter.v1.Aggregation.Frequency.toObject(message.frequency, options); + if (options.oneofs) + object.aggregationFunction = "frequency"; + } + return object; + }; + + /** + * Converts this Aggregation to JSON. + * @function toJSON + * @memberof google.cloud.migrationcenter.v1.Aggregation + * @instance + * @returns {Object.} JSON object + */ + Aggregation.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Aggregation + * @function getTypeUrl + * @memberof google.cloud.migrationcenter.v1.Aggregation + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Aggregation.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.migrationcenter.v1.Aggregation"; + }; + + Aggregation.Count = (function() { + + /** + * Properties of a Count. + * @memberof google.cloud.migrationcenter.v1.Aggregation + * @interface ICount + */ + + /** + * Constructs a new Count. + * @memberof google.cloud.migrationcenter.v1.Aggregation + * @classdesc Represents a Count. + * @implements ICount + * @constructor + * @param {google.cloud.migrationcenter.v1.Aggregation.ICount=} [properties] Properties to set + */ + function Count(properties) { + if (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 Count instance using the specified properties. + * @function create + * @memberof google.cloud.migrationcenter.v1.Aggregation.Count + * @static + * @param {google.cloud.migrationcenter.v1.Aggregation.ICount=} [properties] Properties to set + * @returns {google.cloud.migrationcenter.v1.Aggregation.Count} Count instance + */ + Count.create = function create(properties) { + return new Count(properties); }; /** - * Encodes the specified Frequency message, length delimited. Does not implicitly {@link google.cloud.migrationcenter.v1.Aggregation.Frequency.verify|verify} messages. + * Encodes the specified Count message. Does not implicitly {@link google.cloud.migrationcenter.v1.Aggregation.Count.verify|verify} messages. + * @function encode + * @memberof google.cloud.migrationcenter.v1.Aggregation.Count + * @static + * @param {google.cloud.migrationcenter.v1.Aggregation.ICount} message Count message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Count.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + return writer; + }; + + /** + * Encodes the specified Count message, length delimited. Does not implicitly {@link google.cloud.migrationcenter.v1.Aggregation.Count.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.migrationcenter.v1.Aggregation.Frequency + * @memberof google.cloud.migrationcenter.v1.Aggregation.Count * @static - * @param {google.cloud.migrationcenter.v1.Aggregation.IFrequency} message Frequency message or plain object to encode + * @param {google.cloud.migrationcenter.v1.Aggregation.ICount} message Count message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - Frequency.encodeDelimited = function encodeDelimited(message, writer) { + Count.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a Frequency message from the specified reader or buffer. + * Decodes a Count message from the specified reader or buffer. * @function decode - * @memberof google.cloud.migrationcenter.v1.Aggregation.Frequency + * @memberof google.cloud.migrationcenter.v1.Aggregation.Count * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.migrationcenter.v1.Aggregation.Frequency} Frequency + * @returns {google.cloud.migrationcenter.v1.Aggregation.Count} Count * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - Frequency.decode = function decode(reader, length) { + Count.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.migrationcenter.v1.Aggregation.Frequency(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.migrationcenter.v1.Aggregation.Count(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { @@ -39810,465 +39850,285 @@ }; /** - * Decodes a Frequency message from the specified reader or buffer, length delimited. + * Decodes a Count message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.migrationcenter.v1.Aggregation.Frequency + * @memberof google.cloud.migrationcenter.v1.Aggregation.Count * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.migrationcenter.v1.Aggregation.Frequency} Frequency + * @returns {google.cloud.migrationcenter.v1.Aggregation.Count} Count * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - Frequency.decodeDelimited = function decodeDelimited(reader) { + Count.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a Frequency message. + * Verifies a Count message. * @function verify - * @memberof google.cloud.migrationcenter.v1.Aggregation.Frequency + * @memberof google.cloud.migrationcenter.v1.Aggregation.Count * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - Frequency.verify = function verify(message) { + Count.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; return null; }; /** - * Creates a Frequency message from a plain object. Also converts values to their respective internal types. + * Creates a Count message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.migrationcenter.v1.Aggregation.Frequency + * @memberof google.cloud.migrationcenter.v1.Aggregation.Count * @static * @param {Object.} object Plain object - * @returns {google.cloud.migrationcenter.v1.Aggregation.Frequency} Frequency + * @returns {google.cloud.migrationcenter.v1.Aggregation.Count} Count */ - Frequency.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.migrationcenter.v1.Aggregation.Frequency) + Count.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.migrationcenter.v1.Aggregation.Count) return object; - return new $root.google.cloud.migrationcenter.v1.Aggregation.Frequency(); + return new $root.google.cloud.migrationcenter.v1.Aggregation.Count(); }; /** - * Creates a plain object from a Frequency message. Also converts values to other types if specified. + * Creates a plain object from a Count message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.migrationcenter.v1.Aggregation.Frequency + * @memberof google.cloud.migrationcenter.v1.Aggregation.Count * @static - * @param {google.cloud.migrationcenter.v1.Aggregation.Frequency} message Frequency + * @param {google.cloud.migrationcenter.v1.Aggregation.Count} message Count * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - Frequency.toObject = function toObject() { + Count.toObject = function toObject() { return {}; }; /** - * Converts this Frequency to JSON. + * Converts this Count to JSON. * @function toJSON - * @memberof google.cloud.migrationcenter.v1.Aggregation.Frequency + * @memberof google.cloud.migrationcenter.v1.Aggregation.Count * @instance * @returns {Object.} JSON object */ - Frequency.prototype.toJSON = function toJSON() { + Count.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for Frequency + * Gets the default type url for Count * @function getTypeUrl - * @memberof google.cloud.migrationcenter.v1.Aggregation.Frequency + * @memberof google.cloud.migrationcenter.v1.Aggregation.Count * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - Frequency.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + Count.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.cloud.migrationcenter.v1.Aggregation.Frequency"; + return typeUrlPrefix + "/google.cloud.migrationcenter.v1.Aggregation.Count"; }; - return Frequency; + return Count; })(); - return Aggregation; - })(); + Aggregation.Sum = (function() { - v1.AggregationResult = (function() { + /** + * Properties of a Sum. + * @memberof google.cloud.migrationcenter.v1.Aggregation + * @interface ISum + */ - /** - * Properties of an AggregationResult. - * @memberof google.cloud.migrationcenter.v1 - * @interface IAggregationResult - * @property {string|null} [field] AggregationResult field - * @property {google.cloud.migrationcenter.v1.AggregationResult.ICount|null} [count] AggregationResult count - * @property {google.cloud.migrationcenter.v1.AggregationResult.ISum|null} [sum] AggregationResult sum - * @property {google.cloud.migrationcenter.v1.AggregationResult.IHistogram|null} [histogram] AggregationResult histogram - * @property {google.cloud.migrationcenter.v1.AggregationResult.IFrequency|null} [frequency] AggregationResult frequency - */ + /** + * Constructs a new Sum. + * @memberof google.cloud.migrationcenter.v1.Aggregation + * @classdesc Represents a Sum. + * @implements ISum + * @constructor + * @param {google.cloud.migrationcenter.v1.Aggregation.ISum=} [properties] Properties to set + */ + function Sum(properties) { + if (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 AggregationResult. - * @memberof google.cloud.migrationcenter.v1 - * @classdesc Represents an AggregationResult. - * @implements IAggregationResult - * @constructor - * @param {google.cloud.migrationcenter.v1.IAggregationResult=} [properties] Properties to set - */ - function AggregationResult(properties) { - if (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 Sum instance using the specified properties. + * @function create + * @memberof google.cloud.migrationcenter.v1.Aggregation.Sum + * @static + * @param {google.cloud.migrationcenter.v1.Aggregation.ISum=} [properties] Properties to set + * @returns {google.cloud.migrationcenter.v1.Aggregation.Sum} Sum instance + */ + Sum.create = function create(properties) { + return new Sum(properties); + }; - /** - * AggregationResult field. - * @member {string} field - * @memberof google.cloud.migrationcenter.v1.AggregationResult - * @instance - */ - AggregationResult.prototype.field = ""; + /** + * Encodes the specified Sum message. Does not implicitly {@link google.cloud.migrationcenter.v1.Aggregation.Sum.verify|verify} messages. + * @function encode + * @memberof google.cloud.migrationcenter.v1.Aggregation.Sum + * @static + * @param {google.cloud.migrationcenter.v1.Aggregation.ISum} message Sum message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Sum.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + return writer; + }; - /** - * AggregationResult count. - * @member {google.cloud.migrationcenter.v1.AggregationResult.ICount|null|undefined} count - * @memberof google.cloud.migrationcenter.v1.AggregationResult - * @instance - */ - AggregationResult.prototype.count = null; + /** + * Encodes the specified Sum message, length delimited. Does not implicitly {@link google.cloud.migrationcenter.v1.Aggregation.Sum.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.migrationcenter.v1.Aggregation.Sum + * @static + * @param {google.cloud.migrationcenter.v1.Aggregation.ISum} message Sum message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Sum.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; - /** - * AggregationResult sum. - * @member {google.cloud.migrationcenter.v1.AggregationResult.ISum|null|undefined} sum - * @memberof google.cloud.migrationcenter.v1.AggregationResult - * @instance - */ - AggregationResult.prototype.sum = null; + /** + * Decodes a Sum message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.migrationcenter.v1.Aggregation.Sum + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.migrationcenter.v1.Aggregation.Sum} Sum + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Sum.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.migrationcenter.v1.Aggregation.Sum(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; - /** - * AggregationResult histogram. - * @member {google.cloud.migrationcenter.v1.AggregationResult.IHistogram|null|undefined} histogram - * @memberof google.cloud.migrationcenter.v1.AggregationResult - * @instance - */ - AggregationResult.prototype.histogram = null; + /** + * Decodes a Sum message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.migrationcenter.v1.Aggregation.Sum + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.migrationcenter.v1.Aggregation.Sum} Sum + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Sum.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; - /** - * AggregationResult frequency. - * @member {google.cloud.migrationcenter.v1.AggregationResult.IFrequency|null|undefined} frequency - * @memberof google.cloud.migrationcenter.v1.AggregationResult - * @instance - */ - AggregationResult.prototype.frequency = null; + /** + * Verifies a Sum message. + * @function verify + * @memberof google.cloud.migrationcenter.v1.Aggregation.Sum + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Sum.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + return null; + }; - // OneOf field names bound to virtual getters and setters - var $oneOfFields; + /** + * Creates a Sum message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.migrationcenter.v1.Aggregation.Sum + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.migrationcenter.v1.Aggregation.Sum} Sum + */ + Sum.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.migrationcenter.v1.Aggregation.Sum) + return object; + return new $root.google.cloud.migrationcenter.v1.Aggregation.Sum(); + }; - /** - * AggregationResult result. - * @member {"count"|"sum"|"histogram"|"frequency"|undefined} result - * @memberof google.cloud.migrationcenter.v1.AggregationResult - * @instance - */ - Object.defineProperty(AggregationResult.prototype, "result", { - get: $util.oneOfGetter($oneOfFields = ["count", "sum", "histogram", "frequency"]), - set: $util.oneOfSetter($oneOfFields) - }); + /** + * Creates a plain object from a Sum message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.migrationcenter.v1.Aggregation.Sum + * @static + * @param {google.cloud.migrationcenter.v1.Aggregation.Sum} message Sum + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Sum.toObject = function toObject() { + return {}; + }; - /** - * Creates a new AggregationResult instance using the specified properties. - * @function create - * @memberof google.cloud.migrationcenter.v1.AggregationResult - * @static - * @param {google.cloud.migrationcenter.v1.IAggregationResult=} [properties] Properties to set - * @returns {google.cloud.migrationcenter.v1.AggregationResult} AggregationResult instance - */ - AggregationResult.create = function create(properties) { - return new AggregationResult(properties); - }; + /** + * Converts this Sum to JSON. + * @function toJSON + * @memberof google.cloud.migrationcenter.v1.Aggregation.Sum + * @instance + * @returns {Object.} JSON object + */ + Sum.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; - /** - * Encodes the specified AggregationResult message. Does not implicitly {@link google.cloud.migrationcenter.v1.AggregationResult.verify|verify} messages. - * @function encode - * @memberof google.cloud.migrationcenter.v1.AggregationResult - * @static - * @param {google.cloud.migrationcenter.v1.IAggregationResult} message AggregationResult message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - AggregationResult.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.field != null && Object.hasOwnProperty.call(message, "field")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.field); - if (message.count != null && Object.hasOwnProperty.call(message, "count")) - $root.google.cloud.migrationcenter.v1.AggregationResult.Count.encode(message.count, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.sum != null && Object.hasOwnProperty.call(message, "sum")) - $root.google.cloud.migrationcenter.v1.AggregationResult.Sum.encode(message.sum, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - if (message.histogram != null && Object.hasOwnProperty.call(message, "histogram")) - $root.google.cloud.migrationcenter.v1.AggregationResult.Histogram.encode(message.histogram, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); - if (message.frequency != null && Object.hasOwnProperty.call(message, "frequency")) - $root.google.cloud.migrationcenter.v1.AggregationResult.Frequency.encode(message.frequency, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); - return writer; - }; + /** + * Gets the default type url for Sum + * @function getTypeUrl + * @memberof google.cloud.migrationcenter.v1.Aggregation.Sum + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Sum.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.migrationcenter.v1.Aggregation.Sum"; + }; - /** - * Encodes the specified AggregationResult message, length delimited. Does not implicitly {@link google.cloud.migrationcenter.v1.AggregationResult.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.migrationcenter.v1.AggregationResult - * @static - * @param {google.cloud.migrationcenter.v1.IAggregationResult} message AggregationResult message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - AggregationResult.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; + return Sum; + })(); - /** - * Decodes an AggregationResult message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.migrationcenter.v1.AggregationResult - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.migrationcenter.v1.AggregationResult} AggregationResult - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - AggregationResult.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.migrationcenter.v1.AggregationResult(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - message.field = reader.string(); - break; - } - case 2: { - message.count = $root.google.cloud.migrationcenter.v1.AggregationResult.Count.decode(reader, reader.uint32()); - break; - } - case 3: { - message.sum = $root.google.cloud.migrationcenter.v1.AggregationResult.Sum.decode(reader, reader.uint32()); - break; - } - case 4: { - message.histogram = $root.google.cloud.migrationcenter.v1.AggregationResult.Histogram.decode(reader, reader.uint32()); - break; - } - case 5: { - message.frequency = $root.google.cloud.migrationcenter.v1.AggregationResult.Frequency.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an AggregationResult message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.migrationcenter.v1.AggregationResult - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.migrationcenter.v1.AggregationResult} AggregationResult - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - AggregationResult.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an AggregationResult message. - * @function verify - * @memberof google.cloud.migrationcenter.v1.AggregationResult - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - AggregationResult.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - var properties = {}; - if (message.field != null && message.hasOwnProperty("field")) - if (!$util.isString(message.field)) - return "field: string expected"; - if (message.count != null && message.hasOwnProperty("count")) { - properties.result = 1; - { - var error = $root.google.cloud.migrationcenter.v1.AggregationResult.Count.verify(message.count); - if (error) - return "count." + error; - } - } - if (message.sum != null && message.hasOwnProperty("sum")) { - if (properties.result === 1) - return "result: multiple values"; - properties.result = 1; - { - var error = $root.google.cloud.migrationcenter.v1.AggregationResult.Sum.verify(message.sum); - if (error) - return "sum." + error; - } - } - if (message.histogram != null && message.hasOwnProperty("histogram")) { - if (properties.result === 1) - return "result: multiple values"; - properties.result = 1; - { - var error = $root.google.cloud.migrationcenter.v1.AggregationResult.Histogram.verify(message.histogram); - if (error) - return "histogram." + error; - } - } - if (message.frequency != null && message.hasOwnProperty("frequency")) { - if (properties.result === 1) - return "result: multiple values"; - properties.result = 1; - { - var error = $root.google.cloud.migrationcenter.v1.AggregationResult.Frequency.verify(message.frequency); - if (error) - return "frequency." + error; - } - } - return null; - }; - - /** - * Creates an AggregationResult message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.migrationcenter.v1.AggregationResult - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.migrationcenter.v1.AggregationResult} AggregationResult - */ - AggregationResult.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.migrationcenter.v1.AggregationResult) - return object; - var message = new $root.google.cloud.migrationcenter.v1.AggregationResult(); - if (object.field != null) - message.field = String(object.field); - if (object.count != null) { - if (typeof object.count !== "object") - throw TypeError(".google.cloud.migrationcenter.v1.AggregationResult.count: object expected"); - message.count = $root.google.cloud.migrationcenter.v1.AggregationResult.Count.fromObject(object.count); - } - if (object.sum != null) { - if (typeof object.sum !== "object") - throw TypeError(".google.cloud.migrationcenter.v1.AggregationResult.sum: object expected"); - message.sum = $root.google.cloud.migrationcenter.v1.AggregationResult.Sum.fromObject(object.sum); - } - if (object.histogram != null) { - if (typeof object.histogram !== "object") - throw TypeError(".google.cloud.migrationcenter.v1.AggregationResult.histogram: object expected"); - message.histogram = $root.google.cloud.migrationcenter.v1.AggregationResult.Histogram.fromObject(object.histogram); - } - if (object.frequency != null) { - if (typeof object.frequency !== "object") - throw TypeError(".google.cloud.migrationcenter.v1.AggregationResult.frequency: object expected"); - message.frequency = $root.google.cloud.migrationcenter.v1.AggregationResult.Frequency.fromObject(object.frequency); - } - return message; - }; - - /** - * Creates a plain object from an AggregationResult message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.migrationcenter.v1.AggregationResult - * @static - * @param {google.cloud.migrationcenter.v1.AggregationResult} message AggregationResult - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - AggregationResult.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - object.field = ""; - if (message.field != null && message.hasOwnProperty("field")) - object.field = message.field; - if (message.count != null && message.hasOwnProperty("count")) { - object.count = $root.google.cloud.migrationcenter.v1.AggregationResult.Count.toObject(message.count, options); - if (options.oneofs) - object.result = "count"; - } - if (message.sum != null && message.hasOwnProperty("sum")) { - object.sum = $root.google.cloud.migrationcenter.v1.AggregationResult.Sum.toObject(message.sum, options); - if (options.oneofs) - object.result = "sum"; - } - if (message.histogram != null && message.hasOwnProperty("histogram")) { - object.histogram = $root.google.cloud.migrationcenter.v1.AggregationResult.Histogram.toObject(message.histogram, options); - if (options.oneofs) - object.result = "histogram"; - } - if (message.frequency != null && message.hasOwnProperty("frequency")) { - object.frequency = $root.google.cloud.migrationcenter.v1.AggregationResult.Frequency.toObject(message.frequency, options); - if (options.oneofs) - object.result = "frequency"; - } - return object; - }; - - /** - * Converts this AggregationResult to JSON. - * @function toJSON - * @memberof google.cloud.migrationcenter.v1.AggregationResult - * @instance - * @returns {Object.} JSON object - */ - AggregationResult.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for AggregationResult - * @function getTypeUrl - * @memberof google.cloud.migrationcenter.v1.AggregationResult - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - AggregationResult.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.migrationcenter.v1.AggregationResult"; - }; - - AggregationResult.Count = (function() { + Aggregation.Histogram = (function() { /** - * Properties of a Count. - * @memberof google.cloud.migrationcenter.v1.AggregationResult - * @interface ICount - * @property {number|Long|null} [value] Count value + * Properties of a Histogram. + * @memberof google.cloud.migrationcenter.v1.Aggregation + * @interface IHistogram + * @property {Array.|null} [lowerBounds] Histogram lowerBounds */ /** - * Constructs a new Count. - * @memberof google.cloud.migrationcenter.v1.AggregationResult - * @classdesc Represents a Count. - * @implements ICount + * Constructs a new Histogram. + * @memberof google.cloud.migrationcenter.v1.Aggregation + * @classdesc Represents a Histogram. + * @implements IHistogram * @constructor - * @param {google.cloud.migrationcenter.v1.AggregationResult.ICount=} [properties] Properties to set + * @param {google.cloud.migrationcenter.v1.Aggregation.IHistogram=} [properties] Properties to set */ - function Count(properties) { + function Histogram(properties) { + this.lowerBounds = []; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -40276,75 +40136,86 @@ } /** - * Count value. - * @member {number|Long} value - * @memberof google.cloud.migrationcenter.v1.AggregationResult.Count + * Histogram lowerBounds. + * @member {Array.} lowerBounds + * @memberof google.cloud.migrationcenter.v1.Aggregation.Histogram * @instance */ - Count.prototype.value = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + Histogram.prototype.lowerBounds = $util.emptyArray; /** - * Creates a new Count instance using the specified properties. + * Creates a new Histogram instance using the specified properties. * @function create - * @memberof google.cloud.migrationcenter.v1.AggregationResult.Count + * @memberof google.cloud.migrationcenter.v1.Aggregation.Histogram * @static - * @param {google.cloud.migrationcenter.v1.AggregationResult.ICount=} [properties] Properties to set - * @returns {google.cloud.migrationcenter.v1.AggregationResult.Count} Count instance + * @param {google.cloud.migrationcenter.v1.Aggregation.IHistogram=} [properties] Properties to set + * @returns {google.cloud.migrationcenter.v1.Aggregation.Histogram} Histogram instance */ - Count.create = function create(properties) { - return new Count(properties); + Histogram.create = function create(properties) { + return new Histogram(properties); }; /** - * Encodes the specified Count message. Does not implicitly {@link google.cloud.migrationcenter.v1.AggregationResult.Count.verify|verify} messages. + * Encodes the specified Histogram message. Does not implicitly {@link google.cloud.migrationcenter.v1.Aggregation.Histogram.verify|verify} messages. * @function encode - * @memberof google.cloud.migrationcenter.v1.AggregationResult.Count + * @memberof google.cloud.migrationcenter.v1.Aggregation.Histogram * @static - * @param {google.cloud.migrationcenter.v1.AggregationResult.ICount} message Count message or plain object to encode + * @param {google.cloud.migrationcenter.v1.Aggregation.IHistogram} message Histogram message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - Count.encode = function encode(message, writer) { + Histogram.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); + if (message.lowerBounds != null && message.lowerBounds.length) { + writer.uint32(/* id 1, wireType 2 =*/10).fork(); + for (var i = 0; i < message.lowerBounds.length; ++i) + writer.double(message.lowerBounds[i]); + writer.ldelim(); + } return writer; }; /** - * Encodes the specified Count message, length delimited. Does not implicitly {@link google.cloud.migrationcenter.v1.AggregationResult.Count.verify|verify} messages. + * Encodes the specified Histogram message, length delimited. Does not implicitly {@link google.cloud.migrationcenter.v1.Aggregation.Histogram.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.migrationcenter.v1.AggregationResult.Count + * @memberof google.cloud.migrationcenter.v1.Aggregation.Histogram * @static - * @param {google.cloud.migrationcenter.v1.AggregationResult.ICount} message Count message or plain object to encode + * @param {google.cloud.migrationcenter.v1.Aggregation.IHistogram} message Histogram message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - Count.encodeDelimited = function encodeDelimited(message, writer) { + Histogram.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a Count message from the specified reader or buffer. + * Decodes a Histogram message from the specified reader or buffer. * @function decode - * @memberof google.cloud.migrationcenter.v1.AggregationResult.Count + * @memberof google.cloud.migrationcenter.v1.Aggregation.Histogram * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.migrationcenter.v1.AggregationResult.Count} Count + * @returns {google.cloud.migrationcenter.v1.Aggregation.Histogram} Histogram * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - Count.decode = function decode(reader, length) { + Histogram.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.migrationcenter.v1.AggregationResult.Count(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.migrationcenter.v1.Aggregation.Histogram(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: { - message.value = reader.int64(); + if (!(message.lowerBounds && message.lowerBounds.length)) + message.lowerBounds = []; + if ((tag & 7) === 2) { + var end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) + message.lowerBounds.push(reader.double()); + } else + message.lowerBounds.push(reader.double()); break; } default: @@ -40356,136 +40227,133 @@ }; /** - * Decodes a Count message from the specified reader or buffer, length delimited. + * Decodes a Histogram message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.migrationcenter.v1.AggregationResult.Count + * @memberof google.cloud.migrationcenter.v1.Aggregation.Histogram * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.migrationcenter.v1.AggregationResult.Count} Count + * @returns {google.cloud.migrationcenter.v1.Aggregation.Histogram} Histogram * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - Count.decodeDelimited = function decodeDelimited(reader) { + Histogram.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a Count message. + * Verifies a Histogram message. * @function verify - * @memberof google.cloud.migrationcenter.v1.AggregationResult.Count + * @memberof google.cloud.migrationcenter.v1.Aggregation.Histogram * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - Count.verify = function verify(message) { + Histogram.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"; + if (message.lowerBounds != null && message.hasOwnProperty("lowerBounds")) { + if (!Array.isArray(message.lowerBounds)) + return "lowerBounds: array expected"; + for (var i = 0; i < message.lowerBounds.length; ++i) + if (typeof message.lowerBounds[i] !== "number") + return "lowerBounds: number[] expected"; + } return null; }; /** - * Creates a Count message from a plain object. Also converts values to their respective internal types. + * Creates a Histogram message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.migrationcenter.v1.AggregationResult.Count + * @memberof google.cloud.migrationcenter.v1.Aggregation.Histogram * @static * @param {Object.} object Plain object - * @returns {google.cloud.migrationcenter.v1.AggregationResult.Count} Count + * @returns {google.cloud.migrationcenter.v1.Aggregation.Histogram} Histogram */ - Count.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.migrationcenter.v1.AggregationResult.Count) + Histogram.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.migrationcenter.v1.Aggregation.Histogram) return object; - var message = new $root.google.cloud.migrationcenter.v1.AggregationResult.Count(); - 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(); + var message = new $root.google.cloud.migrationcenter.v1.Aggregation.Histogram(); + if (object.lowerBounds) { + if (!Array.isArray(object.lowerBounds)) + throw TypeError(".google.cloud.migrationcenter.v1.Aggregation.Histogram.lowerBounds: array expected"); + message.lowerBounds = []; + for (var i = 0; i < object.lowerBounds.length; ++i) + message.lowerBounds[i] = Number(object.lowerBounds[i]); + } return message; }; /** - * Creates a plain object from a Count message. Also converts values to other types if specified. + * Creates a plain object from a Histogram message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.migrationcenter.v1.AggregationResult.Count + * @memberof google.cloud.migrationcenter.v1.Aggregation.Histogram * @static - * @param {google.cloud.migrationcenter.v1.AggregationResult.Count} message Count + * @param {google.cloud.migrationcenter.v1.Aggregation.Histogram} message Histogram * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - Count.toObject = function toObject(message, options) { + Histogram.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; + if (options.arrays || options.defaults) + object.lowerBounds = []; + if (message.lowerBounds && message.lowerBounds.length) { + object.lowerBounds = []; + for (var j = 0; j < message.lowerBounds.length; ++j) + object.lowerBounds[j] = options.json && !isFinite(message.lowerBounds[j]) ? String(message.lowerBounds[j]) : message.lowerBounds[j]; + } return object; }; /** - * Converts this Count to JSON. + * Converts this Histogram to JSON. * @function toJSON - * @memberof google.cloud.migrationcenter.v1.AggregationResult.Count + * @memberof google.cloud.migrationcenter.v1.Aggregation.Histogram * @instance * @returns {Object.} JSON object */ - Count.prototype.toJSON = function toJSON() { + Histogram.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for Count + * Gets the default type url for Histogram * @function getTypeUrl - * @memberof google.cloud.migrationcenter.v1.AggregationResult.Count + * @memberof google.cloud.migrationcenter.v1.Aggregation.Histogram * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - Count.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + Histogram.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.cloud.migrationcenter.v1.AggregationResult.Count"; + return typeUrlPrefix + "/google.cloud.migrationcenter.v1.Aggregation.Histogram"; }; - return Count; + return Histogram; })(); - AggregationResult.Sum = (function() { + Aggregation.Frequency = (function() { /** - * Properties of a Sum. - * @memberof google.cloud.migrationcenter.v1.AggregationResult - * @interface ISum - * @property {number|null} [value] Sum value + * Properties of a Frequency. + * @memberof google.cloud.migrationcenter.v1.Aggregation + * @interface IFrequency */ /** - * Constructs a new Sum. - * @memberof google.cloud.migrationcenter.v1.AggregationResult - * @classdesc Represents a Sum. - * @implements ISum + * Constructs a new Frequency. + * @memberof google.cloud.migrationcenter.v1.Aggregation + * @classdesc Represents a Frequency. + * @implements IFrequency * @constructor - * @param {google.cloud.migrationcenter.v1.AggregationResult.ISum=} [properties] Properties to set + * @param {google.cloud.migrationcenter.v1.Aggregation.IFrequency=} [properties] Properties to set */ - function Sum(properties) { + function Frequency(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -40493,77 +40361,63 @@ } /** - * Sum value. - * @member {number} value - * @memberof google.cloud.migrationcenter.v1.AggregationResult.Sum - * @instance - */ - Sum.prototype.value = 0; - - /** - * Creates a new Sum instance using the specified properties. + * Creates a new Frequency instance using the specified properties. * @function create - * @memberof google.cloud.migrationcenter.v1.AggregationResult.Sum + * @memberof google.cloud.migrationcenter.v1.Aggregation.Frequency * @static - * @param {google.cloud.migrationcenter.v1.AggregationResult.ISum=} [properties] Properties to set - * @returns {google.cloud.migrationcenter.v1.AggregationResult.Sum} Sum instance + * @param {google.cloud.migrationcenter.v1.Aggregation.IFrequency=} [properties] Properties to set + * @returns {google.cloud.migrationcenter.v1.Aggregation.Frequency} Frequency instance */ - Sum.create = function create(properties) { - return new Sum(properties); + Frequency.create = function create(properties) { + return new Frequency(properties); }; /** - * Encodes the specified Sum message. Does not implicitly {@link google.cloud.migrationcenter.v1.AggregationResult.Sum.verify|verify} messages. + * Encodes the specified Frequency message. Does not implicitly {@link google.cloud.migrationcenter.v1.Aggregation.Frequency.verify|verify} messages. * @function encode - * @memberof google.cloud.migrationcenter.v1.AggregationResult.Sum + * @memberof google.cloud.migrationcenter.v1.Aggregation.Frequency * @static - * @param {google.cloud.migrationcenter.v1.AggregationResult.ISum} message Sum message or plain object to encode + * @param {google.cloud.migrationcenter.v1.Aggregation.IFrequency} message Frequency message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - Sum.encode = function encode(message, writer) { + Frequency.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 Sum message, length delimited. Does not implicitly {@link google.cloud.migrationcenter.v1.AggregationResult.Sum.verify|verify} messages. + * Encodes the specified Frequency message, length delimited. Does not implicitly {@link google.cloud.migrationcenter.v1.Aggregation.Frequency.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.migrationcenter.v1.AggregationResult.Sum + * @memberof google.cloud.migrationcenter.v1.Aggregation.Frequency * @static - * @param {google.cloud.migrationcenter.v1.AggregationResult.ISum} message Sum message or plain object to encode + * @param {google.cloud.migrationcenter.v1.Aggregation.IFrequency} message Frequency message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - Sum.encodeDelimited = function encodeDelimited(message, writer) { + Frequency.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a Sum message from the specified reader or buffer. + * Decodes a Frequency message from the specified reader or buffer. * @function decode - * @memberof google.cloud.migrationcenter.v1.AggregationResult.Sum + * @memberof google.cloud.migrationcenter.v1.Aggregation.Frequency * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.migrationcenter.v1.AggregationResult.Sum} Sum + * @returns {google.cloud.migrationcenter.v1.Aggregation.Frequency} Frequency * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - Sum.decode = function decode(reader, length) { + Frequency.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.migrationcenter.v1.AggregationResult.Sum(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.migrationcenter.v1.Aggregation.Frequency(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: { - message.value = reader.double(); - break; - } default: reader.skipType(tag & 7); break; @@ -40573,707 +40427,541 @@ }; /** - * Decodes a Sum message from the specified reader or buffer, length delimited. + * Decodes a Frequency message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.migrationcenter.v1.AggregationResult.Sum + * @memberof google.cloud.migrationcenter.v1.Aggregation.Frequency * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.migrationcenter.v1.AggregationResult.Sum} Sum + * @returns {google.cloud.migrationcenter.v1.Aggregation.Frequency} Frequency * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - Sum.decodeDelimited = function decodeDelimited(reader) { + Frequency.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a Sum message. + * Verifies a Frequency message. * @function verify - * @memberof google.cloud.migrationcenter.v1.AggregationResult.Sum + * @memberof google.cloud.migrationcenter.v1.Aggregation.Frequency * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - Sum.verify = function verify(message) { + Frequency.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 Sum message from a plain object. Also converts values to their respective internal types. + * Creates a Frequency message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.migrationcenter.v1.AggregationResult.Sum + * @memberof google.cloud.migrationcenter.v1.Aggregation.Frequency * @static * @param {Object.} object Plain object - * @returns {google.cloud.migrationcenter.v1.AggregationResult.Sum} Sum + * @returns {google.cloud.migrationcenter.v1.Aggregation.Frequency} Frequency */ - Sum.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.migrationcenter.v1.AggregationResult.Sum) + Frequency.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.migrationcenter.v1.Aggregation.Frequency) return object; - var message = new $root.google.cloud.migrationcenter.v1.AggregationResult.Sum(); - if (object.value != null) - message.value = Number(object.value); - return message; + return new $root.google.cloud.migrationcenter.v1.Aggregation.Frequency(); }; /** - * Creates a plain object from a Sum message. Also converts values to other types if specified. + * Creates a plain object from a Frequency message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.migrationcenter.v1.AggregationResult.Sum + * @memberof google.cloud.migrationcenter.v1.Aggregation.Frequency * @static - * @param {google.cloud.migrationcenter.v1.AggregationResult.Sum} message Sum + * @param {google.cloud.migrationcenter.v1.Aggregation.Frequency} message Frequency * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - Sum.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; + Frequency.toObject = function toObject() { + return {}; }; /** - * Converts this Sum to JSON. + * Converts this Frequency to JSON. * @function toJSON - * @memberof google.cloud.migrationcenter.v1.AggregationResult.Sum + * @memberof google.cloud.migrationcenter.v1.Aggregation.Frequency * @instance * @returns {Object.} JSON object */ - Sum.prototype.toJSON = function toJSON() { + Frequency.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for Sum + * Gets the default type url for Frequency * @function getTypeUrl - * @memberof google.cloud.migrationcenter.v1.AggregationResult.Sum + * @memberof google.cloud.migrationcenter.v1.Aggregation.Frequency * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - Sum.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + Frequency.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.cloud.migrationcenter.v1.AggregationResult.Sum"; + return typeUrlPrefix + "/google.cloud.migrationcenter.v1.Aggregation.Frequency"; }; - return Sum; + return Frequency; })(); - AggregationResult.Histogram = (function() { + return Aggregation; + })(); - /** - * Properties of a Histogram. - * @memberof google.cloud.migrationcenter.v1.AggregationResult - * @interface IHistogram - * @property {Array.|null} [buckets] Histogram buckets - */ + v1.AggregationResult = (function() { - /** - * Constructs a new Histogram. - * @memberof google.cloud.migrationcenter.v1.AggregationResult - * @classdesc Represents a Histogram. - * @implements IHistogram - * @constructor - * @param {google.cloud.migrationcenter.v1.AggregationResult.IHistogram=} [properties] Properties to set - */ - function Histogram(properties) { - this.buckets = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } + /** + * Properties of an AggregationResult. + * @memberof google.cloud.migrationcenter.v1 + * @interface IAggregationResult + * @property {string|null} [field] AggregationResult field + * @property {google.cloud.migrationcenter.v1.AggregationResult.ICount|null} [count] AggregationResult count + * @property {google.cloud.migrationcenter.v1.AggregationResult.ISum|null} [sum] AggregationResult sum + * @property {google.cloud.migrationcenter.v1.AggregationResult.IHistogram|null} [histogram] AggregationResult histogram + * @property {google.cloud.migrationcenter.v1.AggregationResult.IFrequency|null} [frequency] AggregationResult frequency + */ - /** - * Histogram buckets. - * @member {Array.} buckets - * @memberof google.cloud.migrationcenter.v1.AggregationResult.Histogram - * @instance - */ - Histogram.prototype.buckets = $util.emptyArray; + /** + * Constructs a new AggregationResult. + * @memberof google.cloud.migrationcenter.v1 + * @classdesc Represents an AggregationResult. + * @implements IAggregationResult + * @constructor + * @param {google.cloud.migrationcenter.v1.IAggregationResult=} [properties] Properties to set + */ + function AggregationResult(properties) { + if (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 Histogram instance using the specified properties. - * @function create - * @memberof google.cloud.migrationcenter.v1.AggregationResult.Histogram - * @static - * @param {google.cloud.migrationcenter.v1.AggregationResult.IHistogram=} [properties] Properties to set - * @returns {google.cloud.migrationcenter.v1.AggregationResult.Histogram} Histogram instance - */ - Histogram.create = function create(properties) { - return new Histogram(properties); - }; + /** + * AggregationResult field. + * @member {string} field + * @memberof google.cloud.migrationcenter.v1.AggregationResult + * @instance + */ + AggregationResult.prototype.field = ""; - /** - * Encodes the specified Histogram message. Does not implicitly {@link google.cloud.migrationcenter.v1.AggregationResult.Histogram.verify|verify} messages. - * @function encode - * @memberof google.cloud.migrationcenter.v1.AggregationResult.Histogram - * @static - * @param {google.cloud.migrationcenter.v1.AggregationResult.IHistogram} message Histogram message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Histogram.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.buckets != null && message.buckets.length) - for (var i = 0; i < message.buckets.length; ++i) - $root.google.cloud.migrationcenter.v1.AggregationResult.Histogram.Bucket.encode(message.buckets[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - return writer; - }; + /** + * AggregationResult count. + * @member {google.cloud.migrationcenter.v1.AggregationResult.ICount|null|undefined} count + * @memberof google.cloud.migrationcenter.v1.AggregationResult + * @instance + */ + AggregationResult.prototype.count = null; - /** - * Encodes the specified Histogram message, length delimited. Does not implicitly {@link google.cloud.migrationcenter.v1.AggregationResult.Histogram.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.migrationcenter.v1.AggregationResult.Histogram - * @static - * @param {google.cloud.migrationcenter.v1.AggregationResult.IHistogram} message Histogram message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Histogram.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; + /** + * AggregationResult sum. + * @member {google.cloud.migrationcenter.v1.AggregationResult.ISum|null|undefined} sum + * @memberof google.cloud.migrationcenter.v1.AggregationResult + * @instance + */ + AggregationResult.prototype.sum = null; - /** - * Decodes a Histogram message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.migrationcenter.v1.AggregationResult.Histogram - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.migrationcenter.v1.AggregationResult.Histogram} Histogram - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Histogram.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.migrationcenter.v1.AggregationResult.Histogram(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - if (!(message.buckets && message.buckets.length)) - message.buckets = []; - message.buckets.push($root.google.cloud.migrationcenter.v1.AggregationResult.Histogram.Bucket.decode(reader, reader.uint32())); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; + /** + * AggregationResult histogram. + * @member {google.cloud.migrationcenter.v1.AggregationResult.IHistogram|null|undefined} histogram + * @memberof google.cloud.migrationcenter.v1.AggregationResult + * @instance + */ + AggregationResult.prototype.histogram = null; - /** - * Decodes a Histogram message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.migrationcenter.v1.AggregationResult.Histogram - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.migrationcenter.v1.AggregationResult.Histogram} Histogram - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Histogram.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; + /** + * AggregationResult frequency. + * @member {google.cloud.migrationcenter.v1.AggregationResult.IFrequency|null|undefined} frequency + * @memberof google.cloud.migrationcenter.v1.AggregationResult + * @instance + */ + AggregationResult.prototype.frequency = null; - /** - * Verifies a Histogram message. - * @function verify - * @memberof google.cloud.migrationcenter.v1.AggregationResult.Histogram - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Histogram.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.buckets != null && message.hasOwnProperty("buckets")) { - if (!Array.isArray(message.buckets)) - return "buckets: array expected"; - for (var i = 0; i < message.buckets.length; ++i) { - var error = $root.google.cloud.migrationcenter.v1.AggregationResult.Histogram.Bucket.verify(message.buckets[i]); - if (error) - return "buckets." + error; - } - } - return null; - }; + // OneOf field names bound to virtual getters and setters + var $oneOfFields; - /** - * Creates a Histogram message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.migrationcenter.v1.AggregationResult.Histogram - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.migrationcenter.v1.AggregationResult.Histogram} Histogram - */ - Histogram.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.migrationcenter.v1.AggregationResult.Histogram) - return object; - var message = new $root.google.cloud.migrationcenter.v1.AggregationResult.Histogram(); - if (object.buckets) { - if (!Array.isArray(object.buckets)) - throw TypeError(".google.cloud.migrationcenter.v1.AggregationResult.Histogram.buckets: array expected"); - message.buckets = []; - for (var i = 0; i < object.buckets.length; ++i) { - if (typeof object.buckets[i] !== "object") - throw TypeError(".google.cloud.migrationcenter.v1.AggregationResult.Histogram.buckets: object expected"); - message.buckets[i] = $root.google.cloud.migrationcenter.v1.AggregationResult.Histogram.Bucket.fromObject(object.buckets[i]); - } - } - return message; - }; + /** + * AggregationResult result. + * @member {"count"|"sum"|"histogram"|"frequency"|undefined} result + * @memberof google.cloud.migrationcenter.v1.AggregationResult + * @instance + */ + Object.defineProperty(AggregationResult.prototype, "result", { + get: $util.oneOfGetter($oneOfFields = ["count", "sum", "histogram", "frequency"]), + set: $util.oneOfSetter($oneOfFields) + }); - /** - * Creates a plain object from a Histogram message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.migrationcenter.v1.AggregationResult.Histogram - * @static - * @param {google.cloud.migrationcenter.v1.AggregationResult.Histogram} message Histogram - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Histogram.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.buckets = []; - if (message.buckets && message.buckets.length) { - object.buckets = []; - for (var j = 0; j < message.buckets.length; ++j) - object.buckets[j] = $root.google.cloud.migrationcenter.v1.AggregationResult.Histogram.Bucket.toObject(message.buckets[j], options); - } - return object; - }; - - /** - * Converts this Histogram to JSON. - * @function toJSON - * @memberof google.cloud.migrationcenter.v1.AggregationResult.Histogram - * @instance - * @returns {Object.} JSON object - */ - Histogram.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for Histogram - * @function getTypeUrl - * @memberof google.cloud.migrationcenter.v1.AggregationResult.Histogram - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - Histogram.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.migrationcenter.v1.AggregationResult.Histogram"; - }; + /** + * Creates a new AggregationResult instance using the specified properties. + * @function create + * @memberof google.cloud.migrationcenter.v1.AggregationResult + * @static + * @param {google.cloud.migrationcenter.v1.IAggregationResult=} [properties] Properties to set + * @returns {google.cloud.migrationcenter.v1.AggregationResult} AggregationResult instance + */ + AggregationResult.create = function create(properties) { + return new AggregationResult(properties); + }; - Histogram.Bucket = (function() { + /** + * Encodes the specified AggregationResult message. Does not implicitly {@link google.cloud.migrationcenter.v1.AggregationResult.verify|verify} messages. + * @function encode + * @memberof google.cloud.migrationcenter.v1.AggregationResult + * @static + * @param {google.cloud.migrationcenter.v1.IAggregationResult} message AggregationResult message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AggregationResult.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.field != null && Object.hasOwnProperty.call(message, "field")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.field); + if (message.count != null && Object.hasOwnProperty.call(message, "count")) + $root.google.cloud.migrationcenter.v1.AggregationResult.Count.encode(message.count, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.sum != null && Object.hasOwnProperty.call(message, "sum")) + $root.google.cloud.migrationcenter.v1.AggregationResult.Sum.encode(message.sum, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.histogram != null && Object.hasOwnProperty.call(message, "histogram")) + $root.google.cloud.migrationcenter.v1.AggregationResult.Histogram.encode(message.histogram, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.frequency != null && Object.hasOwnProperty.call(message, "frequency")) + $root.google.cloud.migrationcenter.v1.AggregationResult.Frequency.encode(message.frequency, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + return writer; + }; - /** - * Properties of a Bucket. - * @memberof google.cloud.migrationcenter.v1.AggregationResult.Histogram - * @interface IBucket - * @property {number|null} [lowerBound] Bucket lowerBound - * @property {number|null} [upperBound] Bucket upperBound - * @property {number|Long|null} [count] Bucket count - */ + /** + * Encodes the specified AggregationResult message, length delimited. Does not implicitly {@link google.cloud.migrationcenter.v1.AggregationResult.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.migrationcenter.v1.AggregationResult + * @static + * @param {google.cloud.migrationcenter.v1.IAggregationResult} message AggregationResult message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AggregationResult.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; - /** - * Constructs a new Bucket. - * @memberof google.cloud.migrationcenter.v1.AggregationResult.Histogram - * @classdesc Represents a Bucket. - * @implements IBucket - * @constructor - * @param {google.cloud.migrationcenter.v1.AggregationResult.Histogram.IBucket=} [properties] Properties to set - */ - function Bucket(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; + /** + * Decodes an AggregationResult message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.migrationcenter.v1.AggregationResult + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.migrationcenter.v1.AggregationResult} AggregationResult + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AggregationResult.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.migrationcenter.v1.AggregationResult(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.field = reader.string(); + break; + } + case 2: { + message.count = $root.google.cloud.migrationcenter.v1.AggregationResult.Count.decode(reader, reader.uint32()); + break; + } + case 3: { + message.sum = $root.google.cloud.migrationcenter.v1.AggregationResult.Sum.decode(reader, reader.uint32()); + break; + } + case 4: { + message.histogram = $root.google.cloud.migrationcenter.v1.AggregationResult.Histogram.decode(reader, reader.uint32()); + break; + } + case 5: { + message.frequency = $root.google.cloud.migrationcenter.v1.AggregationResult.Frequency.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; } + } + return message; + }; - /** - * Bucket lowerBound. - * @member {number} lowerBound - * @memberof google.cloud.migrationcenter.v1.AggregationResult.Histogram.Bucket - * @instance - */ - Bucket.prototype.lowerBound = 0; - - /** - * Bucket upperBound. - * @member {number} upperBound - * @memberof google.cloud.migrationcenter.v1.AggregationResult.Histogram.Bucket - * @instance - */ - Bucket.prototype.upperBound = 0; + /** + * Decodes an AggregationResult message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.migrationcenter.v1.AggregationResult + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.migrationcenter.v1.AggregationResult} AggregationResult + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AggregationResult.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; - /** - * Bucket count. - * @member {number|Long} count - * @memberof google.cloud.migrationcenter.v1.AggregationResult.Histogram.Bucket - * @instance - */ - Bucket.prototype.count = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + /** + * Verifies an AggregationResult message. + * @function verify + * @memberof google.cloud.migrationcenter.v1.AggregationResult + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + AggregationResult.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.field != null && message.hasOwnProperty("field")) + if (!$util.isString(message.field)) + return "field: string expected"; + if (message.count != null && message.hasOwnProperty("count")) { + properties.result = 1; + { + var error = $root.google.cloud.migrationcenter.v1.AggregationResult.Count.verify(message.count); + if (error) + return "count." + error; + } + } + if (message.sum != null && message.hasOwnProperty("sum")) { + if (properties.result === 1) + return "result: multiple values"; + properties.result = 1; + { + var error = $root.google.cloud.migrationcenter.v1.AggregationResult.Sum.verify(message.sum); + if (error) + return "sum." + error; + } + } + if (message.histogram != null && message.hasOwnProperty("histogram")) { + if (properties.result === 1) + return "result: multiple values"; + properties.result = 1; + { + var error = $root.google.cloud.migrationcenter.v1.AggregationResult.Histogram.verify(message.histogram); + if (error) + return "histogram." + error; + } + } + if (message.frequency != null && message.hasOwnProperty("frequency")) { + if (properties.result === 1) + return "result: multiple values"; + properties.result = 1; + { + var error = $root.google.cloud.migrationcenter.v1.AggregationResult.Frequency.verify(message.frequency); + if (error) + return "frequency." + error; + } + } + return null; + }; - /** - * Creates a new Bucket instance using the specified properties. - * @function create - * @memberof google.cloud.migrationcenter.v1.AggregationResult.Histogram.Bucket - * @static - * @param {google.cloud.migrationcenter.v1.AggregationResult.Histogram.IBucket=} [properties] Properties to set - * @returns {google.cloud.migrationcenter.v1.AggregationResult.Histogram.Bucket} Bucket instance - */ - Bucket.create = function create(properties) { - return new Bucket(properties); - }; + /** + * Creates an AggregationResult message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.migrationcenter.v1.AggregationResult + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.migrationcenter.v1.AggregationResult} AggregationResult + */ + AggregationResult.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.migrationcenter.v1.AggregationResult) + return object; + var message = new $root.google.cloud.migrationcenter.v1.AggregationResult(); + if (object.field != null) + message.field = String(object.field); + if (object.count != null) { + if (typeof object.count !== "object") + throw TypeError(".google.cloud.migrationcenter.v1.AggregationResult.count: object expected"); + message.count = $root.google.cloud.migrationcenter.v1.AggregationResult.Count.fromObject(object.count); + } + if (object.sum != null) { + if (typeof object.sum !== "object") + throw TypeError(".google.cloud.migrationcenter.v1.AggregationResult.sum: object expected"); + message.sum = $root.google.cloud.migrationcenter.v1.AggregationResult.Sum.fromObject(object.sum); + } + if (object.histogram != null) { + if (typeof object.histogram !== "object") + throw TypeError(".google.cloud.migrationcenter.v1.AggregationResult.histogram: object expected"); + message.histogram = $root.google.cloud.migrationcenter.v1.AggregationResult.Histogram.fromObject(object.histogram); + } + if (object.frequency != null) { + if (typeof object.frequency !== "object") + throw TypeError(".google.cloud.migrationcenter.v1.AggregationResult.frequency: object expected"); + message.frequency = $root.google.cloud.migrationcenter.v1.AggregationResult.Frequency.fromObject(object.frequency); + } + return message; + }; - /** - * Encodes the specified Bucket message. Does not implicitly {@link google.cloud.migrationcenter.v1.AggregationResult.Histogram.Bucket.verify|verify} messages. - * @function encode - * @memberof google.cloud.migrationcenter.v1.AggregationResult.Histogram.Bucket - * @static - * @param {google.cloud.migrationcenter.v1.AggregationResult.Histogram.IBucket} message Bucket message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Bucket.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.lowerBound != null && Object.hasOwnProperty.call(message, "lowerBound")) - writer.uint32(/* id 1, wireType 1 =*/9).double(message.lowerBound); - if (message.upperBound != null && Object.hasOwnProperty.call(message, "upperBound")) - writer.uint32(/* id 2, wireType 1 =*/17).double(message.upperBound); - if (message.count != null && Object.hasOwnProperty.call(message, "count")) - writer.uint32(/* id 3, wireType 0 =*/24).int64(message.count); - return writer; - }; + /** + * Creates a plain object from an AggregationResult message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.migrationcenter.v1.AggregationResult + * @static + * @param {google.cloud.migrationcenter.v1.AggregationResult} message AggregationResult + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + AggregationResult.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.field = ""; + if (message.field != null && message.hasOwnProperty("field")) + object.field = message.field; + if (message.count != null && message.hasOwnProperty("count")) { + object.count = $root.google.cloud.migrationcenter.v1.AggregationResult.Count.toObject(message.count, options); + if (options.oneofs) + object.result = "count"; + } + if (message.sum != null && message.hasOwnProperty("sum")) { + object.sum = $root.google.cloud.migrationcenter.v1.AggregationResult.Sum.toObject(message.sum, options); + if (options.oneofs) + object.result = "sum"; + } + if (message.histogram != null && message.hasOwnProperty("histogram")) { + object.histogram = $root.google.cloud.migrationcenter.v1.AggregationResult.Histogram.toObject(message.histogram, options); + if (options.oneofs) + object.result = "histogram"; + } + if (message.frequency != null && message.hasOwnProperty("frequency")) { + object.frequency = $root.google.cloud.migrationcenter.v1.AggregationResult.Frequency.toObject(message.frequency, options); + if (options.oneofs) + object.result = "frequency"; + } + return object; + }; - /** - * Encodes the specified Bucket message, length delimited. Does not implicitly {@link google.cloud.migrationcenter.v1.AggregationResult.Histogram.Bucket.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.migrationcenter.v1.AggregationResult.Histogram.Bucket - * @static - * @param {google.cloud.migrationcenter.v1.AggregationResult.Histogram.IBucket} message Bucket message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Bucket.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; + /** + * Converts this AggregationResult to JSON. + * @function toJSON + * @memberof google.cloud.migrationcenter.v1.AggregationResult + * @instance + * @returns {Object.} JSON object + */ + AggregationResult.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; - /** - * Decodes a Bucket message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.migrationcenter.v1.AggregationResult.Histogram.Bucket - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.migrationcenter.v1.AggregationResult.Histogram.Bucket} Bucket - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Bucket.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.migrationcenter.v1.AggregationResult.Histogram.Bucket(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - message.lowerBound = reader.double(); - break; - } - case 2: { - message.upperBound = reader.double(); - break; - } - case 3: { - message.count = reader.int64(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; + /** + * Gets the default type url for AggregationResult + * @function getTypeUrl + * @memberof google.cloud.migrationcenter.v1.AggregationResult + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + AggregationResult.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.migrationcenter.v1.AggregationResult"; + }; - /** - * Decodes a Bucket message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.migrationcenter.v1.AggregationResult.Histogram.Bucket - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.migrationcenter.v1.AggregationResult.Histogram.Bucket} Bucket - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Bucket.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; + AggregationResult.Count = (function() { - /** - * Verifies a Bucket message. - * @function verify - * @memberof google.cloud.migrationcenter.v1.AggregationResult.Histogram.Bucket - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Bucket.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.lowerBound != null && message.hasOwnProperty("lowerBound")) - if (typeof message.lowerBound !== "number") - return "lowerBound: number expected"; - if (message.upperBound != null && message.hasOwnProperty("upperBound")) - if (typeof message.upperBound !== "number") - return "upperBound: number expected"; - if (message.count != null && message.hasOwnProperty("count")) - if (!$util.isInteger(message.count) && !(message.count && $util.isInteger(message.count.low) && $util.isInteger(message.count.high))) - return "count: integer|Long expected"; - return null; - }; + /** + * Properties of a Count. + * @memberof google.cloud.migrationcenter.v1.AggregationResult + * @interface ICount + * @property {number|Long|null} [value] Count value + */ - /** - * Creates a Bucket message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.migrationcenter.v1.AggregationResult.Histogram.Bucket - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.migrationcenter.v1.AggregationResult.Histogram.Bucket} Bucket - */ - Bucket.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.migrationcenter.v1.AggregationResult.Histogram.Bucket) - return object; - var message = new $root.google.cloud.migrationcenter.v1.AggregationResult.Histogram.Bucket(); - if (object.lowerBound != null) - message.lowerBound = Number(object.lowerBound); - if (object.upperBound != null) - message.upperBound = Number(object.upperBound); - if (object.count != null) - if ($util.Long) - (message.count = $util.Long.fromValue(object.count)).unsigned = false; - else if (typeof object.count === "string") - message.count = parseInt(object.count, 10); - else if (typeof object.count === "number") - message.count = object.count; - else if (typeof object.count === "object") - message.count = new $util.LongBits(object.count.low >>> 0, object.count.high >>> 0).toNumber(); - return message; - }; - - /** - * Creates a plain object from a Bucket message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.migrationcenter.v1.AggregationResult.Histogram.Bucket - * @static - * @param {google.cloud.migrationcenter.v1.AggregationResult.Histogram.Bucket} message Bucket - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Bucket.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.lowerBound = 0; - object.upperBound = 0; - if ($util.Long) { - var long = new $util.Long(0, 0, false); - object.count = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.count = options.longs === String ? "0" : 0; - } - if (message.lowerBound != null && message.hasOwnProperty("lowerBound")) - object.lowerBound = options.json && !isFinite(message.lowerBound) ? String(message.lowerBound) : message.lowerBound; - if (message.upperBound != null && message.hasOwnProperty("upperBound")) - object.upperBound = options.json && !isFinite(message.upperBound) ? String(message.upperBound) : message.upperBound; - if (message.count != null && message.hasOwnProperty("count")) - if (typeof message.count === "number") - object.count = options.longs === String ? String(message.count) : message.count; - else - object.count = options.longs === String ? $util.Long.prototype.toString.call(message.count) : options.longs === Number ? new $util.LongBits(message.count.low >>> 0, message.count.high >>> 0).toNumber() : message.count; - return object; - }; - - /** - * Converts this Bucket to JSON. - * @function toJSON - * @memberof google.cloud.migrationcenter.v1.AggregationResult.Histogram.Bucket - * @instance - * @returns {Object.} JSON object - */ - Bucket.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for Bucket - * @function getTypeUrl - * @memberof google.cloud.migrationcenter.v1.AggregationResult.Histogram.Bucket - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - Bucket.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.migrationcenter.v1.AggregationResult.Histogram.Bucket"; - }; - - return Bucket; - })(); - - return Histogram; - })(); - - AggregationResult.Frequency = (function() { - - /** - * Properties of a Frequency. - * @memberof google.cloud.migrationcenter.v1.AggregationResult - * @interface IFrequency - * @property {Object.|null} [values] Frequency values - */ - - /** - * Constructs a new Frequency. - * @memberof google.cloud.migrationcenter.v1.AggregationResult - * @classdesc Represents a Frequency. - * @implements IFrequency - * @constructor - * @param {google.cloud.migrationcenter.v1.AggregationResult.IFrequency=} [properties] Properties to set - */ - function Frequency(properties) { - this.values = {}; - if (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 Count. + * @memberof google.cloud.migrationcenter.v1.AggregationResult + * @classdesc Represents a Count. + * @implements ICount + * @constructor + * @param {google.cloud.migrationcenter.v1.AggregationResult.ICount=} [properties] Properties to set + */ + function Count(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } /** - * Frequency values. - * @member {Object.} values - * @memberof google.cloud.migrationcenter.v1.AggregationResult.Frequency + * Count value. + * @member {number|Long} value + * @memberof google.cloud.migrationcenter.v1.AggregationResult.Count * @instance */ - Frequency.prototype.values = $util.emptyObject; + Count.prototype.value = $util.Long ? $util.Long.fromBits(0,0,false) : 0; /** - * Creates a new Frequency instance using the specified properties. + * Creates a new Count instance using the specified properties. * @function create - * @memberof google.cloud.migrationcenter.v1.AggregationResult.Frequency + * @memberof google.cloud.migrationcenter.v1.AggregationResult.Count * @static - * @param {google.cloud.migrationcenter.v1.AggregationResult.IFrequency=} [properties] Properties to set - * @returns {google.cloud.migrationcenter.v1.AggregationResult.Frequency} Frequency instance + * @param {google.cloud.migrationcenter.v1.AggregationResult.ICount=} [properties] Properties to set + * @returns {google.cloud.migrationcenter.v1.AggregationResult.Count} Count instance */ - Frequency.create = function create(properties) { - return new Frequency(properties); + Count.create = function create(properties) { + return new Count(properties); }; /** - * Encodes the specified Frequency message. Does not implicitly {@link google.cloud.migrationcenter.v1.AggregationResult.Frequency.verify|verify} messages. + * Encodes the specified Count message. Does not implicitly {@link google.cloud.migrationcenter.v1.AggregationResult.Count.verify|verify} messages. * @function encode - * @memberof google.cloud.migrationcenter.v1.AggregationResult.Frequency + * @memberof google.cloud.migrationcenter.v1.AggregationResult.Count * @static - * @param {google.cloud.migrationcenter.v1.AggregationResult.IFrequency} message Frequency message or plain object to encode + * @param {google.cloud.migrationcenter.v1.AggregationResult.ICount} message Count message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - Frequency.encode = function encode(message, writer) { + Count.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.values != null && Object.hasOwnProperty.call(message, "values")) - for (var keys = Object.keys(message.values), i = 0; i < keys.length; ++i) - writer.uint32(/* id 1, wireType 2 =*/10).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 0 =*/16).int64(message.values[keys[i]]).ldelim(); + if (message.value != null && Object.hasOwnProperty.call(message, "value")) + writer.uint32(/* id 1, wireType 0 =*/8).int64(message.value); return writer; }; /** - * Encodes the specified Frequency message, length delimited. Does not implicitly {@link google.cloud.migrationcenter.v1.AggregationResult.Frequency.verify|verify} messages. + * Encodes the specified Count message, length delimited. Does not implicitly {@link google.cloud.migrationcenter.v1.AggregationResult.Count.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.migrationcenter.v1.AggregationResult.Frequency + * @memberof google.cloud.migrationcenter.v1.AggregationResult.Count * @static - * @param {google.cloud.migrationcenter.v1.AggregationResult.IFrequency} message Frequency message or plain object to encode + * @param {google.cloud.migrationcenter.v1.AggregationResult.ICount} message Count message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - Frequency.encodeDelimited = function encodeDelimited(message, writer) { + Count.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a Frequency message from the specified reader or buffer. + * Decodes a Count message from the specified reader or buffer. * @function decode - * @memberof google.cloud.migrationcenter.v1.AggregationResult.Frequency + * @memberof google.cloud.migrationcenter.v1.AggregationResult.Count * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.migrationcenter.v1.AggregationResult.Frequency} Frequency + * @returns {google.cloud.migrationcenter.v1.AggregationResult.Count} Count * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - Frequency.decode = function decode(reader, length) { + Count.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.migrationcenter.v1.AggregationResult.Frequency(), key, value; + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.migrationcenter.v1.AggregationResult.Count(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: { - if (message.values === $util.emptyObject) - message.values = {}; - var end2 = reader.uint32() + reader.pos; - key = ""; - value = 0; - while (reader.pos < end2) { - var tag2 = reader.uint32(); - switch (tag2 >>> 3) { - case 1: - key = reader.string(); - break; - case 2: - value = reader.int64(); - break; - default: - reader.skipType(tag2 & 7); - break; - } - } - message.values[key] = value; + message.value = reader.int64(); break; } default: @@ -41285,1268 +40973,1083 @@ }; /** - * Decodes a Frequency message from the specified reader or buffer, length delimited. + * Decodes a Count message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.migrationcenter.v1.AggregationResult.Frequency + * @memberof google.cloud.migrationcenter.v1.AggregationResult.Count * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.migrationcenter.v1.AggregationResult.Frequency} Frequency + * @returns {google.cloud.migrationcenter.v1.AggregationResult.Count} Count * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - Frequency.decodeDelimited = function decodeDelimited(reader) { + Count.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a Frequency message. + * Verifies a Count message. * @function verify - * @memberof google.cloud.migrationcenter.v1.AggregationResult.Frequency + * @memberof google.cloud.migrationcenter.v1.AggregationResult.Count * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - Frequency.verify = function verify(message) { + Count.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.values != null && message.hasOwnProperty("values")) { - if (!$util.isObject(message.values)) - return "values: object expected"; - var key = Object.keys(message.values); - for (var i = 0; i < key.length; ++i) - if (!$util.isInteger(message.values[key[i]]) && !(message.values[key[i]] && $util.isInteger(message.values[key[i]].low) && $util.isInteger(message.values[key[i]].high))) - return "values: integer|Long{k:string} 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 Frequency message from a plain object. Also converts values to their respective internal types. + * Creates a Count message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.migrationcenter.v1.AggregationResult.Frequency + * @memberof google.cloud.migrationcenter.v1.AggregationResult.Count * @static * @param {Object.} object Plain object - * @returns {google.cloud.migrationcenter.v1.AggregationResult.Frequency} Frequency + * @returns {google.cloud.migrationcenter.v1.AggregationResult.Count} Count */ - Frequency.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.migrationcenter.v1.AggregationResult.Frequency) + Count.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.migrationcenter.v1.AggregationResult.Count) return object; - var message = new $root.google.cloud.migrationcenter.v1.AggregationResult.Frequency(); - if (object.values) { - if (typeof object.values !== "object") - throw TypeError(".google.cloud.migrationcenter.v1.AggregationResult.Frequency.values: object expected"); - message.values = {}; - for (var keys = Object.keys(object.values), i = 0; i < keys.length; ++i) - if ($util.Long) - (message.values[keys[i]] = $util.Long.fromValue(object.values[keys[i]])).unsigned = false; - else if (typeof object.values[keys[i]] === "string") - message.values[keys[i]] = parseInt(object.values[keys[i]], 10); - else if (typeof object.values[keys[i]] === "number") - message.values[keys[i]] = object.values[keys[i]]; - else if (typeof object.values[keys[i]] === "object") - message.values[keys[i]] = new $util.LongBits(object.values[keys[i]].low >>> 0, object.values[keys[i]].high >>> 0).toNumber(); - } + var message = new $root.google.cloud.migrationcenter.v1.AggregationResult.Count(); + 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 a Frequency message. Also converts values to other types if specified. + * Creates a plain object from a Count message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.migrationcenter.v1.AggregationResult.Frequency + * @memberof google.cloud.migrationcenter.v1.AggregationResult.Count * @static - * @param {google.cloud.migrationcenter.v1.AggregationResult.Frequency} message Frequency + * @param {google.cloud.migrationcenter.v1.AggregationResult.Count} message Count * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - Frequency.toObject = function toObject(message, options) { + Count.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.objects || options.defaults) - object.values = {}; - var keys2; - if (message.values && (keys2 = Object.keys(message.values)).length) { - object.values = {}; - for (var j = 0; j < keys2.length; ++j) - if (typeof message.values[keys2[j]] === "number") - object.values[keys2[j]] = options.longs === String ? String(message.values[keys2[j]]) : message.values[keys2[j]]; - else - object.values[keys2[j]] = options.longs === String ? $util.Long.prototype.toString.call(message.values[keys2[j]]) : options.longs === Number ? new $util.LongBits(message.values[keys2[j]].low >>> 0, message.values[keys2[j]].high >>> 0).toNumber() : message.values[keys2[j]]; - } + 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 Frequency to JSON. + * Converts this Count to JSON. * @function toJSON - * @memberof google.cloud.migrationcenter.v1.AggregationResult.Frequency + * @memberof google.cloud.migrationcenter.v1.AggregationResult.Count * @instance * @returns {Object.} JSON object */ - Frequency.prototype.toJSON = function toJSON() { + Count.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for Frequency + * Gets the default type url for Count * @function getTypeUrl - * @memberof google.cloud.migrationcenter.v1.AggregationResult.Frequency + * @memberof google.cloud.migrationcenter.v1.AggregationResult.Count * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - Frequency.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + Count.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.cloud.migrationcenter.v1.AggregationResult.Frequency"; + return typeUrlPrefix + "/google.cloud.migrationcenter.v1.AggregationResult.Count"; }; - return Frequency; + return Count; })(); - return AggregationResult; - })(); - - v1.FileValidationReport = (function() { - - /** - * Properties of a FileValidationReport. - * @memberof google.cloud.migrationcenter.v1 - * @interface IFileValidationReport - * @property {string|null} [fileName] FileValidationReport fileName - * @property {Array.|null} [rowErrors] FileValidationReport rowErrors - * @property {boolean|null} [partialReport] FileValidationReport partialReport - * @property {Array.|null} [fileErrors] FileValidationReport fileErrors - */ - - /** - * Constructs a new FileValidationReport. - * @memberof google.cloud.migrationcenter.v1 - * @classdesc Represents a FileValidationReport. - * @implements IFileValidationReport - * @constructor - * @param {google.cloud.migrationcenter.v1.IFileValidationReport=} [properties] Properties to set - */ - function FileValidationReport(properties) { - this.rowErrors = []; - this.fileErrors = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * FileValidationReport fileName. - * @member {string} fileName - * @memberof google.cloud.migrationcenter.v1.FileValidationReport - * @instance - */ - FileValidationReport.prototype.fileName = ""; + AggregationResult.Sum = (function() { - /** - * FileValidationReport rowErrors. - * @member {Array.} rowErrors - * @memberof google.cloud.migrationcenter.v1.FileValidationReport - * @instance - */ - FileValidationReport.prototype.rowErrors = $util.emptyArray; + /** + * Properties of a Sum. + * @memberof google.cloud.migrationcenter.v1.AggregationResult + * @interface ISum + * @property {number|null} [value] Sum value + */ - /** - * FileValidationReport partialReport. - * @member {boolean} partialReport - * @memberof google.cloud.migrationcenter.v1.FileValidationReport - * @instance - */ - FileValidationReport.prototype.partialReport = false; + /** + * Constructs a new Sum. + * @memberof google.cloud.migrationcenter.v1.AggregationResult + * @classdesc Represents a Sum. + * @implements ISum + * @constructor + * @param {google.cloud.migrationcenter.v1.AggregationResult.ISum=} [properties] Properties to set + */ + function Sum(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } - /** - * FileValidationReport fileErrors. - * @member {Array.} fileErrors - * @memberof google.cloud.migrationcenter.v1.FileValidationReport - * @instance - */ - FileValidationReport.prototype.fileErrors = $util.emptyArray; + /** + * Sum value. + * @member {number} value + * @memberof google.cloud.migrationcenter.v1.AggregationResult.Sum + * @instance + */ + Sum.prototype.value = 0; - /** - * Creates a new FileValidationReport instance using the specified properties. - * @function create - * @memberof google.cloud.migrationcenter.v1.FileValidationReport - * @static - * @param {google.cloud.migrationcenter.v1.IFileValidationReport=} [properties] Properties to set - * @returns {google.cloud.migrationcenter.v1.FileValidationReport} FileValidationReport instance - */ - FileValidationReport.create = function create(properties) { - return new FileValidationReport(properties); - }; + /** + * Creates a new Sum instance using the specified properties. + * @function create + * @memberof google.cloud.migrationcenter.v1.AggregationResult.Sum + * @static + * @param {google.cloud.migrationcenter.v1.AggregationResult.ISum=} [properties] Properties to set + * @returns {google.cloud.migrationcenter.v1.AggregationResult.Sum} Sum instance + */ + Sum.create = function create(properties) { + return new Sum(properties); + }; - /** - * Encodes the specified FileValidationReport message. Does not implicitly {@link google.cloud.migrationcenter.v1.FileValidationReport.verify|verify} messages. - * @function encode - * @memberof google.cloud.migrationcenter.v1.FileValidationReport - * @static - * @param {google.cloud.migrationcenter.v1.IFileValidationReport} message FileValidationReport message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - FileValidationReport.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.fileName != null && Object.hasOwnProperty.call(message, "fileName")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.fileName); - if (message.rowErrors != null && message.rowErrors.length) - for (var i = 0; i < message.rowErrors.length; ++i) - $root.google.cloud.migrationcenter.v1.ImportRowError.encode(message.rowErrors[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.partialReport != null && Object.hasOwnProperty.call(message, "partialReport")) - writer.uint32(/* id 3, wireType 0 =*/24).bool(message.partialReport); - if (message.fileErrors != null && message.fileErrors.length) - for (var i = 0; i < message.fileErrors.length; ++i) - $root.google.cloud.migrationcenter.v1.ImportError.encode(message.fileErrors[i], writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); - return writer; - }; + /** + * Encodes the specified Sum message. Does not implicitly {@link google.cloud.migrationcenter.v1.AggregationResult.Sum.verify|verify} messages. + * @function encode + * @memberof google.cloud.migrationcenter.v1.AggregationResult.Sum + * @static + * @param {google.cloud.migrationcenter.v1.AggregationResult.ISum} message Sum message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Sum.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 FileValidationReport message, length delimited. Does not implicitly {@link google.cloud.migrationcenter.v1.FileValidationReport.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.migrationcenter.v1.FileValidationReport - * @static - * @param {google.cloud.migrationcenter.v1.IFileValidationReport} message FileValidationReport message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - FileValidationReport.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; + /** + * Encodes the specified Sum message, length delimited. Does not implicitly {@link google.cloud.migrationcenter.v1.AggregationResult.Sum.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.migrationcenter.v1.AggregationResult.Sum + * @static + * @param {google.cloud.migrationcenter.v1.AggregationResult.ISum} message Sum message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Sum.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; - /** - * Decodes a FileValidationReport message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.migrationcenter.v1.FileValidationReport - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.migrationcenter.v1.FileValidationReport} FileValidationReport - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - FileValidationReport.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.migrationcenter.v1.FileValidationReport(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - message.fileName = reader.string(); - break; - } - case 2: { - if (!(message.rowErrors && message.rowErrors.length)) - message.rowErrors = []; - message.rowErrors.push($root.google.cloud.migrationcenter.v1.ImportRowError.decode(reader, reader.uint32())); - break; - } - case 3: { - message.partialReport = reader.bool(); - break; - } - case 4: { - if (!(message.fileErrors && message.fileErrors.length)) - message.fileErrors = []; - message.fileErrors.push($root.google.cloud.migrationcenter.v1.ImportError.decode(reader, reader.uint32())); + /** + * Decodes a Sum message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.migrationcenter.v1.AggregationResult.Sum + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.migrationcenter.v1.AggregationResult.Sum} Sum + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Sum.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.migrationcenter.v1.AggregationResult.Sum(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.value = reader.double(); + break; + } + default: + reader.skipType(tag & 7); break; } - default: - reader.skipType(tag & 7); - break; } - } - return message; - }; + return message; + }; - /** - * Decodes a FileValidationReport message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.migrationcenter.v1.FileValidationReport - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.migrationcenter.v1.FileValidationReport} FileValidationReport - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - FileValidationReport.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; + /** + * Decodes a Sum message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.migrationcenter.v1.AggregationResult.Sum + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.migrationcenter.v1.AggregationResult.Sum} Sum + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Sum.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; - /** - * Verifies a FileValidationReport message. - * @function verify - * @memberof google.cloud.migrationcenter.v1.FileValidationReport - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - FileValidationReport.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.fileName != null && message.hasOwnProperty("fileName")) - if (!$util.isString(message.fileName)) - return "fileName: string expected"; - if (message.rowErrors != null && message.hasOwnProperty("rowErrors")) { - if (!Array.isArray(message.rowErrors)) - return "rowErrors: array expected"; - for (var i = 0; i < message.rowErrors.length; ++i) { - var error = $root.google.cloud.migrationcenter.v1.ImportRowError.verify(message.rowErrors[i]); - if (error) - return "rowErrors." + error; - } - } - if (message.partialReport != null && message.hasOwnProperty("partialReport")) - if (typeof message.partialReport !== "boolean") - return "partialReport: boolean expected"; - if (message.fileErrors != null && message.hasOwnProperty("fileErrors")) { - if (!Array.isArray(message.fileErrors)) - return "fileErrors: array expected"; - for (var i = 0; i < message.fileErrors.length; ++i) { - var error = $root.google.cloud.migrationcenter.v1.ImportError.verify(message.fileErrors[i]); - if (error) - return "fileErrors." + error; - } - } - return null; - }; + /** + * Verifies a Sum message. + * @function verify + * @memberof google.cloud.migrationcenter.v1.AggregationResult.Sum + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Sum.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 FileValidationReport message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.migrationcenter.v1.FileValidationReport - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.migrationcenter.v1.FileValidationReport} FileValidationReport - */ - FileValidationReport.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.migrationcenter.v1.FileValidationReport) + /** + * Creates a Sum message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.migrationcenter.v1.AggregationResult.Sum + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.migrationcenter.v1.AggregationResult.Sum} Sum + */ + Sum.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.migrationcenter.v1.AggregationResult.Sum) + return object; + var message = new $root.google.cloud.migrationcenter.v1.AggregationResult.Sum(); + if (object.value != null) + message.value = Number(object.value); + return message; + }; + + /** + * Creates a plain object from a Sum message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.migrationcenter.v1.AggregationResult.Sum + * @static + * @param {google.cloud.migrationcenter.v1.AggregationResult.Sum} message Sum + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Sum.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; - var message = new $root.google.cloud.migrationcenter.v1.FileValidationReport(); - if (object.fileName != null) - message.fileName = String(object.fileName); - if (object.rowErrors) { - if (!Array.isArray(object.rowErrors)) - throw TypeError(".google.cloud.migrationcenter.v1.FileValidationReport.rowErrors: array expected"); - message.rowErrors = []; - for (var i = 0; i < object.rowErrors.length; ++i) { - if (typeof object.rowErrors[i] !== "object") - throw TypeError(".google.cloud.migrationcenter.v1.FileValidationReport.rowErrors: object expected"); - message.rowErrors[i] = $root.google.cloud.migrationcenter.v1.ImportRowError.fromObject(object.rowErrors[i]); - } - } - if (object.partialReport != null) - message.partialReport = Boolean(object.partialReport); - if (object.fileErrors) { - if (!Array.isArray(object.fileErrors)) - throw TypeError(".google.cloud.migrationcenter.v1.FileValidationReport.fileErrors: array expected"); - message.fileErrors = []; - for (var i = 0; i < object.fileErrors.length; ++i) { - if (typeof object.fileErrors[i] !== "object") - throw TypeError(".google.cloud.migrationcenter.v1.FileValidationReport.fileErrors: object expected"); - message.fileErrors[i] = $root.google.cloud.migrationcenter.v1.ImportError.fromObject(object.fileErrors[i]); - } - } - return message; - }; + }; - /** - * Creates a plain object from a FileValidationReport message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.migrationcenter.v1.FileValidationReport - * @static - * @param {google.cloud.migrationcenter.v1.FileValidationReport} message FileValidationReport - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - FileValidationReport.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) { - object.rowErrors = []; - object.fileErrors = []; - } - if (options.defaults) { - object.fileName = ""; - object.partialReport = false; - } - if (message.fileName != null && message.hasOwnProperty("fileName")) - object.fileName = message.fileName; - if (message.rowErrors && message.rowErrors.length) { - object.rowErrors = []; - for (var j = 0; j < message.rowErrors.length; ++j) - object.rowErrors[j] = $root.google.cloud.migrationcenter.v1.ImportRowError.toObject(message.rowErrors[j], options); - } - if (message.partialReport != null && message.hasOwnProperty("partialReport")) - object.partialReport = message.partialReport; - if (message.fileErrors && message.fileErrors.length) { - object.fileErrors = []; - for (var j = 0; j < message.fileErrors.length; ++j) - object.fileErrors[j] = $root.google.cloud.migrationcenter.v1.ImportError.toObject(message.fileErrors[j], options); - } - return object; - }; + /** + * Converts this Sum to JSON. + * @function toJSON + * @memberof google.cloud.migrationcenter.v1.AggregationResult.Sum + * @instance + * @returns {Object.} JSON object + */ + Sum.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; - /** - * Converts this FileValidationReport to JSON. - * @function toJSON - * @memberof google.cloud.migrationcenter.v1.FileValidationReport - * @instance - * @returns {Object.} JSON object - */ - FileValidationReport.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; + /** + * Gets the default type url for Sum + * @function getTypeUrl + * @memberof google.cloud.migrationcenter.v1.AggregationResult.Sum + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Sum.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.migrationcenter.v1.AggregationResult.Sum"; + }; - /** - * Gets the default type url for FileValidationReport - * @function getTypeUrl - * @memberof google.cloud.migrationcenter.v1.FileValidationReport - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - FileValidationReport.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.migrationcenter.v1.FileValidationReport"; - }; + return Sum; + })(); - return FileValidationReport; - })(); + AggregationResult.Histogram = (function() { - v1.ValidationReport = (function() { + /** + * Properties of a Histogram. + * @memberof google.cloud.migrationcenter.v1.AggregationResult + * @interface IHistogram + * @property {Array.|null} [buckets] Histogram buckets + */ - /** - * Properties of a ValidationReport. - * @memberof google.cloud.migrationcenter.v1 - * @interface IValidationReport - * @property {Array.|null} [fileValidations] ValidationReport fileValidations - * @property {Array.|null} [jobErrors] ValidationReport jobErrors - */ - - /** - * Constructs a new ValidationReport. - * @memberof google.cloud.migrationcenter.v1 - * @classdesc Represents a ValidationReport. - * @implements IValidationReport - * @constructor - * @param {google.cloud.migrationcenter.v1.IValidationReport=} [properties] Properties to set - */ - function ValidationReport(properties) { - this.fileValidations = []; - this.jobErrors = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * ValidationReport fileValidations. - * @member {Array.} fileValidations - * @memberof google.cloud.migrationcenter.v1.ValidationReport - * @instance - */ - ValidationReport.prototype.fileValidations = $util.emptyArray; + /** + * Constructs a new Histogram. + * @memberof google.cloud.migrationcenter.v1.AggregationResult + * @classdesc Represents a Histogram. + * @implements IHistogram + * @constructor + * @param {google.cloud.migrationcenter.v1.AggregationResult.IHistogram=} [properties] Properties to set + */ + function Histogram(properties) { + this.buckets = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } - /** - * ValidationReport jobErrors. - * @member {Array.} jobErrors - * @memberof google.cloud.migrationcenter.v1.ValidationReport - * @instance - */ - ValidationReport.prototype.jobErrors = $util.emptyArray; + /** + * Histogram buckets. + * @member {Array.} buckets + * @memberof google.cloud.migrationcenter.v1.AggregationResult.Histogram + * @instance + */ + Histogram.prototype.buckets = $util.emptyArray; - /** - * Creates a new ValidationReport instance using the specified properties. - * @function create - * @memberof google.cloud.migrationcenter.v1.ValidationReport - * @static - * @param {google.cloud.migrationcenter.v1.IValidationReport=} [properties] Properties to set - * @returns {google.cloud.migrationcenter.v1.ValidationReport} ValidationReport instance - */ - ValidationReport.create = function create(properties) { - return new ValidationReport(properties); - }; + /** + * Creates a new Histogram instance using the specified properties. + * @function create + * @memberof google.cloud.migrationcenter.v1.AggregationResult.Histogram + * @static + * @param {google.cloud.migrationcenter.v1.AggregationResult.IHistogram=} [properties] Properties to set + * @returns {google.cloud.migrationcenter.v1.AggregationResult.Histogram} Histogram instance + */ + Histogram.create = function create(properties) { + return new Histogram(properties); + }; - /** - * Encodes the specified ValidationReport message. Does not implicitly {@link google.cloud.migrationcenter.v1.ValidationReport.verify|verify} messages. - * @function encode - * @memberof google.cloud.migrationcenter.v1.ValidationReport - * @static - * @param {google.cloud.migrationcenter.v1.IValidationReport} message ValidationReport message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ValidationReport.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.fileValidations != null && message.fileValidations.length) - for (var i = 0; i < message.fileValidations.length; ++i) - $root.google.cloud.migrationcenter.v1.FileValidationReport.encode(message.fileValidations[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.jobErrors != null && message.jobErrors.length) - for (var i = 0; i < message.jobErrors.length; ++i) - $root.google.cloud.migrationcenter.v1.ImportError.encode(message.jobErrors[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - return writer; - }; + /** + * Encodes the specified Histogram message. Does not implicitly {@link google.cloud.migrationcenter.v1.AggregationResult.Histogram.verify|verify} messages. + * @function encode + * @memberof google.cloud.migrationcenter.v1.AggregationResult.Histogram + * @static + * @param {google.cloud.migrationcenter.v1.AggregationResult.IHistogram} message Histogram message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Histogram.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.buckets != null && message.buckets.length) + for (var i = 0; i < message.buckets.length; ++i) + $root.google.cloud.migrationcenter.v1.AggregationResult.Histogram.Bucket.encode(message.buckets[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; - /** - * Encodes the specified ValidationReport message, length delimited. Does not implicitly {@link google.cloud.migrationcenter.v1.ValidationReport.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.migrationcenter.v1.ValidationReport - * @static - * @param {google.cloud.migrationcenter.v1.IValidationReport} message ValidationReport message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ValidationReport.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; + /** + * Encodes the specified Histogram message, length delimited. Does not implicitly {@link google.cloud.migrationcenter.v1.AggregationResult.Histogram.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.migrationcenter.v1.AggregationResult.Histogram + * @static + * @param {google.cloud.migrationcenter.v1.AggregationResult.IHistogram} message Histogram message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Histogram.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; - /** - * Decodes a ValidationReport message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.migrationcenter.v1.ValidationReport - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.migrationcenter.v1.ValidationReport} ValidationReport - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ValidationReport.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.migrationcenter.v1.ValidationReport(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - if (!(message.fileValidations && message.fileValidations.length)) - message.fileValidations = []; - message.fileValidations.push($root.google.cloud.migrationcenter.v1.FileValidationReport.decode(reader, reader.uint32())); - break; - } - case 2: { - if (!(message.jobErrors && message.jobErrors.length)) - message.jobErrors = []; - message.jobErrors.push($root.google.cloud.migrationcenter.v1.ImportError.decode(reader, reader.uint32())); + /** + * Decodes a Histogram message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.migrationcenter.v1.AggregationResult.Histogram + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.migrationcenter.v1.AggregationResult.Histogram} Histogram + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Histogram.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.migrationcenter.v1.AggregationResult.Histogram(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.buckets && message.buckets.length)) + message.buckets = []; + message.buckets.push($root.google.cloud.migrationcenter.v1.AggregationResult.Histogram.Bucket.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); break; } - default: - reader.skipType(tag & 7); - break; } - } - return message; - }; + return message; + }; - /** - * Decodes a ValidationReport message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.migrationcenter.v1.ValidationReport - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.migrationcenter.v1.ValidationReport} ValidationReport - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ValidationReport.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; + /** + * Decodes a Histogram message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.migrationcenter.v1.AggregationResult.Histogram + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.migrationcenter.v1.AggregationResult.Histogram} Histogram + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Histogram.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; - /** - * Verifies a ValidationReport message. - * @function verify - * @memberof google.cloud.migrationcenter.v1.ValidationReport - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ValidationReport.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.fileValidations != null && message.hasOwnProperty("fileValidations")) { - if (!Array.isArray(message.fileValidations)) - return "fileValidations: array expected"; - for (var i = 0; i < message.fileValidations.length; ++i) { - var error = $root.google.cloud.migrationcenter.v1.FileValidationReport.verify(message.fileValidations[i]); - if (error) - return "fileValidations." + error; - } - } - if (message.jobErrors != null && message.hasOwnProperty("jobErrors")) { - if (!Array.isArray(message.jobErrors)) - return "jobErrors: array expected"; - for (var i = 0; i < message.jobErrors.length; ++i) { - var error = $root.google.cloud.migrationcenter.v1.ImportError.verify(message.jobErrors[i]); - if (error) - return "jobErrors." + error; + /** + * Verifies a Histogram message. + * @function verify + * @memberof google.cloud.migrationcenter.v1.AggregationResult.Histogram + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Histogram.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.buckets != null && message.hasOwnProperty("buckets")) { + if (!Array.isArray(message.buckets)) + return "buckets: array expected"; + for (var i = 0; i < message.buckets.length; ++i) { + var error = $root.google.cloud.migrationcenter.v1.AggregationResult.Histogram.Bucket.verify(message.buckets[i]); + if (error) + return "buckets." + error; + } } - } - return null; - }; + return null; + }; - /** - * Creates a ValidationReport message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.migrationcenter.v1.ValidationReport - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.migrationcenter.v1.ValidationReport} ValidationReport - */ - ValidationReport.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.migrationcenter.v1.ValidationReport) - return object; - var message = new $root.google.cloud.migrationcenter.v1.ValidationReport(); - if (object.fileValidations) { - if (!Array.isArray(object.fileValidations)) - throw TypeError(".google.cloud.migrationcenter.v1.ValidationReport.fileValidations: array expected"); - message.fileValidations = []; - for (var i = 0; i < object.fileValidations.length; ++i) { - if (typeof object.fileValidations[i] !== "object") - throw TypeError(".google.cloud.migrationcenter.v1.ValidationReport.fileValidations: object expected"); - message.fileValidations[i] = $root.google.cloud.migrationcenter.v1.FileValidationReport.fromObject(object.fileValidations[i]); + /** + * Creates a Histogram message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.migrationcenter.v1.AggregationResult.Histogram + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.migrationcenter.v1.AggregationResult.Histogram} Histogram + */ + Histogram.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.migrationcenter.v1.AggregationResult.Histogram) + return object; + var message = new $root.google.cloud.migrationcenter.v1.AggregationResult.Histogram(); + if (object.buckets) { + if (!Array.isArray(object.buckets)) + throw TypeError(".google.cloud.migrationcenter.v1.AggregationResult.Histogram.buckets: array expected"); + message.buckets = []; + for (var i = 0; i < object.buckets.length; ++i) { + if (typeof object.buckets[i] !== "object") + throw TypeError(".google.cloud.migrationcenter.v1.AggregationResult.Histogram.buckets: object expected"); + message.buckets[i] = $root.google.cloud.migrationcenter.v1.AggregationResult.Histogram.Bucket.fromObject(object.buckets[i]); + } } - } - if (object.jobErrors) { - if (!Array.isArray(object.jobErrors)) - throw TypeError(".google.cloud.migrationcenter.v1.ValidationReport.jobErrors: array expected"); - message.jobErrors = []; - for (var i = 0; i < object.jobErrors.length; ++i) { - if (typeof object.jobErrors[i] !== "object") - throw TypeError(".google.cloud.migrationcenter.v1.ValidationReport.jobErrors: object expected"); - message.jobErrors[i] = $root.google.cloud.migrationcenter.v1.ImportError.fromObject(object.jobErrors[i]); + return message; + }; + + /** + * Creates a plain object from a Histogram message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.migrationcenter.v1.AggregationResult.Histogram + * @static + * @param {google.cloud.migrationcenter.v1.AggregationResult.Histogram} message Histogram + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Histogram.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.buckets = []; + if (message.buckets && message.buckets.length) { + object.buckets = []; + for (var j = 0; j < message.buckets.length; ++j) + object.buckets[j] = $root.google.cloud.migrationcenter.v1.AggregationResult.Histogram.Bucket.toObject(message.buckets[j], options); } - } - return message; - }; + return object; + }; - /** - * Creates a plain object from a ValidationReport message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.migrationcenter.v1.ValidationReport - * @static - * @param {google.cloud.migrationcenter.v1.ValidationReport} message ValidationReport - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ValidationReport.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) { - object.fileValidations = []; - object.jobErrors = []; - } - if (message.fileValidations && message.fileValidations.length) { - object.fileValidations = []; - for (var j = 0; j < message.fileValidations.length; ++j) - object.fileValidations[j] = $root.google.cloud.migrationcenter.v1.FileValidationReport.toObject(message.fileValidations[j], options); - } - if (message.jobErrors && message.jobErrors.length) { - object.jobErrors = []; - for (var j = 0; j < message.jobErrors.length; ++j) - object.jobErrors[j] = $root.google.cloud.migrationcenter.v1.ImportError.toObject(message.jobErrors[j], options); - } - return object; - }; + /** + * Converts this Histogram to JSON. + * @function toJSON + * @memberof google.cloud.migrationcenter.v1.AggregationResult.Histogram + * @instance + * @returns {Object.} JSON object + */ + Histogram.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; - /** - * Converts this ValidationReport to JSON. - * @function toJSON - * @memberof google.cloud.migrationcenter.v1.ValidationReport - * @instance - * @returns {Object.} JSON object - */ - ValidationReport.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; + /** + * Gets the default type url for Histogram + * @function getTypeUrl + * @memberof google.cloud.migrationcenter.v1.AggregationResult.Histogram + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Histogram.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.migrationcenter.v1.AggregationResult.Histogram"; + }; - /** - * Gets the default type url for ValidationReport - * @function getTypeUrl - * @memberof google.cloud.migrationcenter.v1.ValidationReport - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ValidationReport.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.migrationcenter.v1.ValidationReport"; - }; + Histogram.Bucket = (function() { - return ValidationReport; - })(); + /** + * Properties of a Bucket. + * @memberof google.cloud.migrationcenter.v1.AggregationResult.Histogram + * @interface IBucket + * @property {number|null} [lowerBound] Bucket lowerBound + * @property {number|null} [upperBound] Bucket upperBound + * @property {number|Long|null} [count] Bucket count + */ - v1.ExecutionReport = (function() { + /** + * Constructs a new Bucket. + * @memberof google.cloud.migrationcenter.v1.AggregationResult.Histogram + * @classdesc Represents a Bucket. + * @implements IBucket + * @constructor + * @param {google.cloud.migrationcenter.v1.AggregationResult.Histogram.IBucket=} [properties] Properties to set + */ + function Bucket(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } - /** - * Properties of an ExecutionReport. - * @memberof google.cloud.migrationcenter.v1 - * @interface IExecutionReport - * @property {number|null} [framesReported] ExecutionReport framesReported - * @property {google.cloud.migrationcenter.v1.IValidationReport|null} [executionErrors] ExecutionReport executionErrors - * @property {number|null} [totalRowsCount] ExecutionReport totalRowsCount - */ + /** + * Bucket lowerBound. + * @member {number} lowerBound + * @memberof google.cloud.migrationcenter.v1.AggregationResult.Histogram.Bucket + * @instance + */ + Bucket.prototype.lowerBound = 0; - /** - * Constructs a new ExecutionReport. - * @memberof google.cloud.migrationcenter.v1 - * @classdesc Represents an ExecutionReport. - * @implements IExecutionReport - * @constructor - * @param {google.cloud.migrationcenter.v1.IExecutionReport=} [properties] Properties to set - */ - function ExecutionReport(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } + /** + * Bucket upperBound. + * @member {number} upperBound + * @memberof google.cloud.migrationcenter.v1.AggregationResult.Histogram.Bucket + * @instance + */ + Bucket.prototype.upperBound = 0; - /** - * ExecutionReport framesReported. - * @member {number} framesReported - * @memberof google.cloud.migrationcenter.v1.ExecutionReport - * @instance - */ - ExecutionReport.prototype.framesReported = 0; + /** + * Bucket count. + * @member {number|Long} count + * @memberof google.cloud.migrationcenter.v1.AggregationResult.Histogram.Bucket + * @instance + */ + Bucket.prototype.count = $util.Long ? $util.Long.fromBits(0,0,false) : 0; - /** - * ExecutionReport executionErrors. - * @member {google.cloud.migrationcenter.v1.IValidationReport|null|undefined} executionErrors - * @memberof google.cloud.migrationcenter.v1.ExecutionReport - * @instance - */ - ExecutionReport.prototype.executionErrors = null; - - /** - * ExecutionReport totalRowsCount. - * @member {number} totalRowsCount - * @memberof google.cloud.migrationcenter.v1.ExecutionReport - * @instance - */ - ExecutionReport.prototype.totalRowsCount = 0; - - /** - * Creates a new ExecutionReport instance using the specified properties. - * @function create - * @memberof google.cloud.migrationcenter.v1.ExecutionReport - * @static - * @param {google.cloud.migrationcenter.v1.IExecutionReport=} [properties] Properties to set - * @returns {google.cloud.migrationcenter.v1.ExecutionReport} ExecutionReport instance - */ - ExecutionReport.create = function create(properties) { - return new ExecutionReport(properties); - }; + /** + * Creates a new Bucket instance using the specified properties. + * @function create + * @memberof google.cloud.migrationcenter.v1.AggregationResult.Histogram.Bucket + * @static + * @param {google.cloud.migrationcenter.v1.AggregationResult.Histogram.IBucket=} [properties] Properties to set + * @returns {google.cloud.migrationcenter.v1.AggregationResult.Histogram.Bucket} Bucket instance + */ + Bucket.create = function create(properties) { + return new Bucket(properties); + }; - /** - * Encodes the specified ExecutionReport message. Does not implicitly {@link google.cloud.migrationcenter.v1.ExecutionReport.verify|verify} messages. - * @function encode - * @memberof google.cloud.migrationcenter.v1.ExecutionReport - * @static - * @param {google.cloud.migrationcenter.v1.IExecutionReport} message ExecutionReport message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ExecutionReport.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.framesReported != null && Object.hasOwnProperty.call(message, "framesReported")) - writer.uint32(/* id 1, wireType 0 =*/8).int32(message.framesReported); - if (message.executionErrors != null && Object.hasOwnProperty.call(message, "executionErrors")) - $root.google.cloud.migrationcenter.v1.ValidationReport.encode(message.executionErrors, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.totalRowsCount != null && Object.hasOwnProperty.call(message, "totalRowsCount")) - writer.uint32(/* id 3, wireType 0 =*/24).int32(message.totalRowsCount); - return writer; - }; + /** + * Encodes the specified Bucket message. Does not implicitly {@link google.cloud.migrationcenter.v1.AggregationResult.Histogram.Bucket.verify|verify} messages. + * @function encode + * @memberof google.cloud.migrationcenter.v1.AggregationResult.Histogram.Bucket + * @static + * @param {google.cloud.migrationcenter.v1.AggregationResult.Histogram.IBucket} message Bucket message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Bucket.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.lowerBound != null && Object.hasOwnProperty.call(message, "lowerBound")) + writer.uint32(/* id 1, wireType 1 =*/9).double(message.lowerBound); + if (message.upperBound != null && Object.hasOwnProperty.call(message, "upperBound")) + writer.uint32(/* id 2, wireType 1 =*/17).double(message.upperBound); + if (message.count != null && Object.hasOwnProperty.call(message, "count")) + writer.uint32(/* id 3, wireType 0 =*/24).int64(message.count); + return writer; + }; - /** - * Encodes the specified ExecutionReport message, length delimited. Does not implicitly {@link google.cloud.migrationcenter.v1.ExecutionReport.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.migrationcenter.v1.ExecutionReport - * @static - * @param {google.cloud.migrationcenter.v1.IExecutionReport} message ExecutionReport message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ExecutionReport.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; + /** + * Encodes the specified Bucket message, length delimited. Does not implicitly {@link google.cloud.migrationcenter.v1.AggregationResult.Histogram.Bucket.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.migrationcenter.v1.AggregationResult.Histogram.Bucket + * @static + * @param {google.cloud.migrationcenter.v1.AggregationResult.Histogram.IBucket} message Bucket message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Bucket.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; - /** - * Decodes an ExecutionReport message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.migrationcenter.v1.ExecutionReport - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.migrationcenter.v1.ExecutionReport} ExecutionReport - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ExecutionReport.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.migrationcenter.v1.ExecutionReport(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - message.framesReported = reader.int32(); - break; - } - case 2: { - message.executionErrors = $root.google.cloud.migrationcenter.v1.ValidationReport.decode(reader, reader.uint32()); - break; - } - case 3: { - message.totalRowsCount = reader.int32(); - break; + /** + * Decodes a Bucket message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.migrationcenter.v1.AggregationResult.Histogram.Bucket + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.migrationcenter.v1.AggregationResult.Histogram.Bucket} Bucket + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Bucket.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.migrationcenter.v1.AggregationResult.Histogram.Bucket(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.lowerBound = reader.double(); + break; + } + case 2: { + message.upperBound = reader.double(); + break; + } + case 3: { + message.count = reader.int64(); + break; + } + default: + reader.skipType(tag & 7); + break; + } } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; + return message; + }; - /** - * Decodes an ExecutionReport message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.migrationcenter.v1.ExecutionReport - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.migrationcenter.v1.ExecutionReport} ExecutionReport - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ExecutionReport.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; + /** + * Decodes a Bucket message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.migrationcenter.v1.AggregationResult.Histogram.Bucket + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.migrationcenter.v1.AggregationResult.Histogram.Bucket} Bucket + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Bucket.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; - /** - * Verifies an ExecutionReport message. - * @function verify - * @memberof google.cloud.migrationcenter.v1.ExecutionReport - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ExecutionReport.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.framesReported != null && message.hasOwnProperty("framesReported")) - if (!$util.isInteger(message.framesReported)) - return "framesReported: integer expected"; - if (message.executionErrors != null && message.hasOwnProperty("executionErrors")) { - var error = $root.google.cloud.migrationcenter.v1.ValidationReport.verify(message.executionErrors); - if (error) - return "executionErrors." + error; - } - if (message.totalRowsCount != null && message.hasOwnProperty("totalRowsCount")) - if (!$util.isInteger(message.totalRowsCount)) - return "totalRowsCount: integer expected"; - return null; - }; + /** + * Verifies a Bucket message. + * @function verify + * @memberof google.cloud.migrationcenter.v1.AggregationResult.Histogram.Bucket + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Bucket.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.lowerBound != null && message.hasOwnProperty("lowerBound")) + if (typeof message.lowerBound !== "number") + return "lowerBound: number expected"; + if (message.upperBound != null && message.hasOwnProperty("upperBound")) + if (typeof message.upperBound !== "number") + return "upperBound: number expected"; + if (message.count != null && message.hasOwnProperty("count")) + if (!$util.isInteger(message.count) && !(message.count && $util.isInteger(message.count.low) && $util.isInteger(message.count.high))) + return "count: integer|Long expected"; + return null; + }; - /** - * Creates an ExecutionReport message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.migrationcenter.v1.ExecutionReport - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.migrationcenter.v1.ExecutionReport} ExecutionReport - */ - ExecutionReport.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.migrationcenter.v1.ExecutionReport) - return object; - var message = new $root.google.cloud.migrationcenter.v1.ExecutionReport(); - if (object.framesReported != null) - message.framesReported = object.framesReported | 0; - if (object.executionErrors != null) { - if (typeof object.executionErrors !== "object") - throw TypeError(".google.cloud.migrationcenter.v1.ExecutionReport.executionErrors: object expected"); - message.executionErrors = $root.google.cloud.migrationcenter.v1.ValidationReport.fromObject(object.executionErrors); - } - if (object.totalRowsCount != null) - message.totalRowsCount = object.totalRowsCount | 0; - return message; - }; + /** + * Creates a Bucket message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.migrationcenter.v1.AggregationResult.Histogram.Bucket + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.migrationcenter.v1.AggregationResult.Histogram.Bucket} Bucket + */ + Bucket.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.migrationcenter.v1.AggregationResult.Histogram.Bucket) + return object; + var message = new $root.google.cloud.migrationcenter.v1.AggregationResult.Histogram.Bucket(); + if (object.lowerBound != null) + message.lowerBound = Number(object.lowerBound); + if (object.upperBound != null) + message.upperBound = Number(object.upperBound); + if (object.count != null) + if ($util.Long) + (message.count = $util.Long.fromValue(object.count)).unsigned = false; + else if (typeof object.count === "string") + message.count = parseInt(object.count, 10); + else if (typeof object.count === "number") + message.count = object.count; + else if (typeof object.count === "object") + message.count = new $util.LongBits(object.count.low >>> 0, object.count.high >>> 0).toNumber(); + return message; + }; - /** - * Creates a plain object from an ExecutionReport message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.migrationcenter.v1.ExecutionReport - * @static - * @param {google.cloud.migrationcenter.v1.ExecutionReport} message ExecutionReport - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ExecutionReport.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.framesReported = 0; - object.executionErrors = null; - object.totalRowsCount = 0; - } - if (message.framesReported != null && message.hasOwnProperty("framesReported")) - object.framesReported = message.framesReported; - if (message.executionErrors != null && message.hasOwnProperty("executionErrors")) - object.executionErrors = $root.google.cloud.migrationcenter.v1.ValidationReport.toObject(message.executionErrors, options); - if (message.totalRowsCount != null && message.hasOwnProperty("totalRowsCount")) - object.totalRowsCount = message.totalRowsCount; - return object; - }; + /** + * Creates a plain object from a Bucket message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.migrationcenter.v1.AggregationResult.Histogram.Bucket + * @static + * @param {google.cloud.migrationcenter.v1.AggregationResult.Histogram.Bucket} message Bucket + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Bucket.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.lowerBound = 0; + object.upperBound = 0; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.count = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.count = options.longs === String ? "0" : 0; + } + if (message.lowerBound != null && message.hasOwnProperty("lowerBound")) + object.lowerBound = options.json && !isFinite(message.lowerBound) ? String(message.lowerBound) : message.lowerBound; + if (message.upperBound != null && message.hasOwnProperty("upperBound")) + object.upperBound = options.json && !isFinite(message.upperBound) ? String(message.upperBound) : message.upperBound; + if (message.count != null && message.hasOwnProperty("count")) + if (typeof message.count === "number") + object.count = options.longs === String ? String(message.count) : message.count; + else + object.count = options.longs === String ? $util.Long.prototype.toString.call(message.count) : options.longs === Number ? new $util.LongBits(message.count.low >>> 0, message.count.high >>> 0).toNumber() : message.count; + return object; + }; - /** - * Converts this ExecutionReport to JSON. - * @function toJSON - * @memberof google.cloud.migrationcenter.v1.ExecutionReport - * @instance - * @returns {Object.} JSON object - */ - ExecutionReport.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; + /** + * Converts this Bucket to JSON. + * @function toJSON + * @memberof google.cloud.migrationcenter.v1.AggregationResult.Histogram.Bucket + * @instance + * @returns {Object.} JSON object + */ + Bucket.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; - /** - * Gets the default type url for ExecutionReport - * @function getTypeUrl - * @memberof google.cloud.migrationcenter.v1.ExecutionReport - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ExecutionReport.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.migrationcenter.v1.ExecutionReport"; - }; + /** + * Gets the default type url for Bucket + * @function getTypeUrl + * @memberof google.cloud.migrationcenter.v1.AggregationResult.Histogram.Bucket + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Bucket.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.migrationcenter.v1.AggregationResult.Histogram.Bucket"; + }; - return ExecutionReport; - })(); + return Bucket; + })(); - v1.ImportError = (function() { + return Histogram; + })(); - /** - * Properties of an ImportError. - * @memberof google.cloud.migrationcenter.v1 - * @interface IImportError - * @property {string|null} [errorDetails] ImportError errorDetails - * @property {google.cloud.migrationcenter.v1.ImportError.Severity|null} [severity] ImportError severity - */ + AggregationResult.Frequency = (function() { - /** - * Constructs a new ImportError. - * @memberof google.cloud.migrationcenter.v1 - * @classdesc Represents an ImportError. - * @implements IImportError - * @constructor - * @param {google.cloud.migrationcenter.v1.IImportError=} [properties] Properties to set - */ - function ImportError(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } + /** + * Properties of a Frequency. + * @memberof google.cloud.migrationcenter.v1.AggregationResult + * @interface IFrequency + * @property {Object.|null} [values] Frequency values + */ - /** - * ImportError errorDetails. - * @member {string} errorDetails - * @memberof google.cloud.migrationcenter.v1.ImportError - * @instance - */ - ImportError.prototype.errorDetails = ""; + /** + * Constructs a new Frequency. + * @memberof google.cloud.migrationcenter.v1.AggregationResult + * @classdesc Represents a Frequency. + * @implements IFrequency + * @constructor + * @param {google.cloud.migrationcenter.v1.AggregationResult.IFrequency=} [properties] Properties to set + */ + function Frequency(properties) { + this.values = {}; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } - /** - * ImportError severity. - * @member {google.cloud.migrationcenter.v1.ImportError.Severity} severity - * @memberof google.cloud.migrationcenter.v1.ImportError - * @instance - */ - ImportError.prototype.severity = 0; + /** + * Frequency values. + * @member {Object.} values + * @memberof google.cloud.migrationcenter.v1.AggregationResult.Frequency + * @instance + */ + Frequency.prototype.values = $util.emptyObject; - /** - * Creates a new ImportError instance using the specified properties. - * @function create - * @memberof google.cloud.migrationcenter.v1.ImportError - * @static - * @param {google.cloud.migrationcenter.v1.IImportError=} [properties] Properties to set - * @returns {google.cloud.migrationcenter.v1.ImportError} ImportError instance - */ - ImportError.create = function create(properties) { - return new ImportError(properties); - }; + /** + * Creates a new Frequency instance using the specified properties. + * @function create + * @memberof google.cloud.migrationcenter.v1.AggregationResult.Frequency + * @static + * @param {google.cloud.migrationcenter.v1.AggregationResult.IFrequency=} [properties] Properties to set + * @returns {google.cloud.migrationcenter.v1.AggregationResult.Frequency} Frequency instance + */ + Frequency.create = function create(properties) { + return new Frequency(properties); + }; - /** - * Encodes the specified ImportError message. Does not implicitly {@link google.cloud.migrationcenter.v1.ImportError.verify|verify} messages. - * @function encode - * @memberof google.cloud.migrationcenter.v1.ImportError - * @static - * @param {google.cloud.migrationcenter.v1.IImportError} message ImportError message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ImportError.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.errorDetails != null && Object.hasOwnProperty.call(message, "errorDetails")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.errorDetails); - if (message.severity != null && Object.hasOwnProperty.call(message, "severity")) - writer.uint32(/* id 2, wireType 0 =*/16).int32(message.severity); - return writer; - }; + /** + * Encodes the specified Frequency message. Does not implicitly {@link google.cloud.migrationcenter.v1.AggregationResult.Frequency.verify|verify} messages. + * @function encode + * @memberof google.cloud.migrationcenter.v1.AggregationResult.Frequency + * @static + * @param {google.cloud.migrationcenter.v1.AggregationResult.IFrequency} message Frequency message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Frequency.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.values != null && Object.hasOwnProperty.call(message, "values")) + for (var keys = Object.keys(message.values), i = 0; i < keys.length; ++i) + writer.uint32(/* id 1, wireType 2 =*/10).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 0 =*/16).int64(message.values[keys[i]]).ldelim(); + return writer; + }; - /** - * Encodes the specified ImportError message, length delimited. Does not implicitly {@link google.cloud.migrationcenter.v1.ImportError.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.migrationcenter.v1.ImportError - * @static - * @param {google.cloud.migrationcenter.v1.IImportError} message ImportError message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ImportError.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; + /** + * Encodes the specified Frequency message, length delimited. Does not implicitly {@link google.cloud.migrationcenter.v1.AggregationResult.Frequency.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.migrationcenter.v1.AggregationResult.Frequency + * @static + * @param {google.cloud.migrationcenter.v1.AggregationResult.IFrequency} message Frequency message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Frequency.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; - /** - * Decodes an ImportError message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.migrationcenter.v1.ImportError - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.migrationcenter.v1.ImportError} ImportError - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ImportError.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.migrationcenter.v1.ImportError(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - message.errorDetails = reader.string(); - break; - } - case 2: { - message.severity = reader.int32(); + /** + * Decodes a Frequency message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.migrationcenter.v1.AggregationResult.Frequency + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.migrationcenter.v1.AggregationResult.Frequency} Frequency + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Frequency.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.migrationcenter.v1.AggregationResult.Frequency(), key, value; + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (message.values === $util.emptyObject) + message.values = {}; + var end2 = reader.uint32() + reader.pos; + key = ""; + value = 0; + while (reader.pos < end2) { + var tag2 = reader.uint32(); + switch (tag2 >>> 3) { + case 1: + key = reader.string(); + break; + case 2: + value = reader.int64(); + break; + default: + reader.skipType(tag2 & 7); + break; + } + } + message.values[key] = value; + break; + } + default: + reader.skipType(tag & 7); break; } - default: - reader.skipType(tag & 7); - break; } - } - return message; - }; + return message; + }; - /** - * Decodes an ImportError message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.migrationcenter.v1.ImportError - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.migrationcenter.v1.ImportError} ImportError - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ImportError.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; + /** + * Decodes a Frequency message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.migrationcenter.v1.AggregationResult.Frequency + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.migrationcenter.v1.AggregationResult.Frequency} Frequency + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Frequency.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; - /** - * Verifies an ImportError message. - * @function verify - * @memberof google.cloud.migrationcenter.v1.ImportError - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ImportError.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.errorDetails != null && message.hasOwnProperty("errorDetails")) - if (!$util.isString(message.errorDetails)) - return "errorDetails: string expected"; - if (message.severity != null && message.hasOwnProperty("severity")) - switch (message.severity) { - default: - return "severity: enum value expected"; - case 0: - case 1: - case 2: - case 3: - break; + /** + * Verifies a Frequency message. + * @function verify + * @memberof google.cloud.migrationcenter.v1.AggregationResult.Frequency + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Frequency.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.values != null && message.hasOwnProperty("values")) { + if (!$util.isObject(message.values)) + return "values: object expected"; + var key = Object.keys(message.values); + for (var i = 0; i < key.length; ++i) + if (!$util.isInteger(message.values[key[i]]) && !(message.values[key[i]] && $util.isInteger(message.values[key[i]].low) && $util.isInteger(message.values[key[i]].high))) + return "values: integer|Long{k:string} expected"; } - return null; - }; + return null; + }; - /** - * Creates an ImportError message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.migrationcenter.v1.ImportError - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.migrationcenter.v1.ImportError} ImportError - */ - ImportError.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.migrationcenter.v1.ImportError) - return object; - var message = new $root.google.cloud.migrationcenter.v1.ImportError(); - if (object.errorDetails != null) - message.errorDetails = String(object.errorDetails); - switch (object.severity) { - default: - if (typeof object.severity === "number") { - message.severity = object.severity; - break; + /** + * Creates a Frequency message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.migrationcenter.v1.AggregationResult.Frequency + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.migrationcenter.v1.AggregationResult.Frequency} Frequency + */ + Frequency.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.migrationcenter.v1.AggregationResult.Frequency) + return object; + var message = new $root.google.cloud.migrationcenter.v1.AggregationResult.Frequency(); + if (object.values) { + if (typeof object.values !== "object") + throw TypeError(".google.cloud.migrationcenter.v1.AggregationResult.Frequency.values: object expected"); + message.values = {}; + for (var keys = Object.keys(object.values), i = 0; i < keys.length; ++i) + if ($util.Long) + (message.values[keys[i]] = $util.Long.fromValue(object.values[keys[i]])).unsigned = false; + else if (typeof object.values[keys[i]] === "string") + message.values[keys[i]] = parseInt(object.values[keys[i]], 10); + else if (typeof object.values[keys[i]] === "number") + message.values[keys[i]] = object.values[keys[i]]; + else if (typeof object.values[keys[i]] === "object") + message.values[keys[i]] = new $util.LongBits(object.values[keys[i]].low >>> 0, object.values[keys[i]].high >>> 0).toNumber(); } - break; - case "SEVERITY_UNSPECIFIED": - case 0: - message.severity = 0; - break; - case "ERROR": - case 1: - message.severity = 1; - break; - case "WARNING": - case 2: - message.severity = 2; - break; - case "INFO": - case 3: - message.severity = 3; - break; - } - return message; - }; + return message; + }; - /** - * Creates a plain object from an ImportError message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.migrationcenter.v1.ImportError - * @static - * @param {google.cloud.migrationcenter.v1.ImportError} message ImportError - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ImportError.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.errorDetails = ""; - object.severity = options.enums === String ? "SEVERITY_UNSPECIFIED" : 0; - } - if (message.errorDetails != null && message.hasOwnProperty("errorDetails")) - object.errorDetails = message.errorDetails; - if (message.severity != null && message.hasOwnProperty("severity")) - object.severity = options.enums === String ? $root.google.cloud.migrationcenter.v1.ImportError.Severity[message.severity] === undefined ? message.severity : $root.google.cloud.migrationcenter.v1.ImportError.Severity[message.severity] : message.severity; - return object; - }; + /** + * Creates a plain object from a Frequency message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.migrationcenter.v1.AggregationResult.Frequency + * @static + * @param {google.cloud.migrationcenter.v1.AggregationResult.Frequency} message Frequency + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Frequency.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.objects || options.defaults) + object.values = {}; + var keys2; + if (message.values && (keys2 = Object.keys(message.values)).length) { + object.values = {}; + for (var j = 0; j < keys2.length; ++j) + if (typeof message.values[keys2[j]] === "number") + object.values[keys2[j]] = options.longs === String ? String(message.values[keys2[j]]) : message.values[keys2[j]]; + else + object.values[keys2[j]] = options.longs === String ? $util.Long.prototype.toString.call(message.values[keys2[j]]) : options.longs === Number ? new $util.LongBits(message.values[keys2[j]].low >>> 0, message.values[keys2[j]].high >>> 0).toNumber() : message.values[keys2[j]]; + } + return object; + }; - /** - * Converts this ImportError to JSON. - * @function toJSON - * @memberof google.cloud.migrationcenter.v1.ImportError - * @instance - * @returns {Object.} JSON object - */ - ImportError.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; + /** + * Converts this Frequency to JSON. + * @function toJSON + * @memberof google.cloud.migrationcenter.v1.AggregationResult.Frequency + * @instance + * @returns {Object.} JSON object + */ + Frequency.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; - /** - * Gets the default type url for ImportError - * @function getTypeUrl - * @memberof google.cloud.migrationcenter.v1.ImportError - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ImportError.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.migrationcenter.v1.ImportError"; - }; + /** + * Gets the default type url for Frequency + * @function getTypeUrl + * @memberof google.cloud.migrationcenter.v1.AggregationResult.Frequency + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Frequency.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.migrationcenter.v1.AggregationResult.Frequency"; + }; - /** - * Severity enum. - * @name google.cloud.migrationcenter.v1.ImportError.Severity - * @enum {number} - * @property {number} SEVERITY_UNSPECIFIED=0 SEVERITY_UNSPECIFIED value - * @property {number} ERROR=1 ERROR value - * @property {number} WARNING=2 WARNING value - * @property {number} INFO=3 INFO value - */ - ImportError.Severity = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "SEVERITY_UNSPECIFIED"] = 0; - values[valuesById[1] = "ERROR"] = 1; - values[valuesById[2] = "WARNING"] = 2; - values[valuesById[3] = "INFO"] = 3; - return values; + return Frequency; })(); - return ImportError; + return AggregationResult; })(); - v1.ImportRowError = (function() { + v1.FileValidationReport = (function() { /** - * Properties of an ImportRowError. + * Properties of a FileValidationReport. * @memberof google.cloud.migrationcenter.v1 - * @interface IImportRowError - * @property {number|null} [rowNumber] ImportRowError rowNumber - * @property {string|null} [vmName] ImportRowError vmName - * @property {string|null} [vmUuid] ImportRowError vmUuid - * @property {Array.|null} [errors] ImportRowError errors + * @interface IFileValidationReport + * @property {string|null} [fileName] FileValidationReport fileName + * @property {Array.|null} [rowErrors] FileValidationReport rowErrors + * @property {boolean|null} [partialReport] FileValidationReport partialReport + * @property {Array.|null} [fileErrors] FileValidationReport fileErrors */ /** - * Constructs a new ImportRowError. + * Constructs a new FileValidationReport. * @memberof google.cloud.migrationcenter.v1 - * @classdesc Represents an ImportRowError. - * @implements IImportRowError + * @classdesc Represents a FileValidationReport. + * @implements IFileValidationReport * @constructor - * @param {google.cloud.migrationcenter.v1.IImportRowError=} [properties] Properties to set + * @param {google.cloud.migrationcenter.v1.IFileValidationReport=} [properties] Properties to set */ - function ImportRowError(properties) { - this.errors = []; + function FileValidationReport(properties) { + this.rowErrors = []; + this.fileErrors = []; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -42554,120 +42057,123 @@ } /** - * ImportRowError rowNumber. - * @member {number} rowNumber - * @memberof google.cloud.migrationcenter.v1.ImportRowError + * FileValidationReport fileName. + * @member {string} fileName + * @memberof google.cloud.migrationcenter.v1.FileValidationReport * @instance */ - ImportRowError.prototype.rowNumber = 0; + FileValidationReport.prototype.fileName = ""; /** - * ImportRowError vmName. - * @member {string} vmName - * @memberof google.cloud.migrationcenter.v1.ImportRowError + * FileValidationReport rowErrors. + * @member {Array.} rowErrors + * @memberof google.cloud.migrationcenter.v1.FileValidationReport * @instance */ - ImportRowError.prototype.vmName = ""; + FileValidationReport.prototype.rowErrors = $util.emptyArray; /** - * ImportRowError vmUuid. - * @member {string} vmUuid - * @memberof google.cloud.migrationcenter.v1.ImportRowError + * FileValidationReport partialReport. + * @member {boolean} partialReport + * @memberof google.cloud.migrationcenter.v1.FileValidationReport * @instance */ - ImportRowError.prototype.vmUuid = ""; + FileValidationReport.prototype.partialReport = false; /** - * ImportRowError errors. - * @member {Array.} errors - * @memberof google.cloud.migrationcenter.v1.ImportRowError + * FileValidationReport fileErrors. + * @member {Array.} fileErrors + * @memberof google.cloud.migrationcenter.v1.FileValidationReport * @instance */ - ImportRowError.prototype.errors = $util.emptyArray; + FileValidationReport.prototype.fileErrors = $util.emptyArray; /** - * Creates a new ImportRowError instance using the specified properties. + * Creates a new FileValidationReport instance using the specified properties. * @function create - * @memberof google.cloud.migrationcenter.v1.ImportRowError + * @memberof google.cloud.migrationcenter.v1.FileValidationReport * @static - * @param {google.cloud.migrationcenter.v1.IImportRowError=} [properties] Properties to set - * @returns {google.cloud.migrationcenter.v1.ImportRowError} ImportRowError instance + * @param {google.cloud.migrationcenter.v1.IFileValidationReport=} [properties] Properties to set + * @returns {google.cloud.migrationcenter.v1.FileValidationReport} FileValidationReport instance */ - ImportRowError.create = function create(properties) { - return new ImportRowError(properties); + FileValidationReport.create = function create(properties) { + return new FileValidationReport(properties); }; /** - * Encodes the specified ImportRowError message. Does not implicitly {@link google.cloud.migrationcenter.v1.ImportRowError.verify|verify} messages. + * Encodes the specified FileValidationReport message. Does not implicitly {@link google.cloud.migrationcenter.v1.FileValidationReport.verify|verify} messages. * @function encode - * @memberof google.cloud.migrationcenter.v1.ImportRowError + * @memberof google.cloud.migrationcenter.v1.FileValidationReport * @static - * @param {google.cloud.migrationcenter.v1.IImportRowError} message ImportRowError message or plain object to encode + * @param {google.cloud.migrationcenter.v1.IFileValidationReport} message FileValidationReport message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ImportRowError.encode = function encode(message, writer) { + FileValidationReport.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.rowNumber != null && Object.hasOwnProperty.call(message, "rowNumber")) - writer.uint32(/* id 1, wireType 0 =*/8).int32(message.rowNumber); - if (message.vmName != null && Object.hasOwnProperty.call(message, "vmName")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.vmName); - if (message.vmUuid != null && Object.hasOwnProperty.call(message, "vmUuid")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.vmUuid); - if (message.errors != null && message.errors.length) - for (var i = 0; i < message.errors.length; ++i) - $root.google.cloud.migrationcenter.v1.ImportError.encode(message.errors[i], writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.fileName != null && Object.hasOwnProperty.call(message, "fileName")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.fileName); + if (message.rowErrors != null && message.rowErrors.length) + for (var i = 0; i < message.rowErrors.length; ++i) + $root.google.cloud.migrationcenter.v1.ImportRowError.encode(message.rowErrors[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.partialReport != null && Object.hasOwnProperty.call(message, "partialReport")) + writer.uint32(/* id 3, wireType 0 =*/24).bool(message.partialReport); + if (message.fileErrors != null && message.fileErrors.length) + for (var i = 0; i < message.fileErrors.length; ++i) + $root.google.cloud.migrationcenter.v1.ImportError.encode(message.fileErrors[i], writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); return writer; }; /** - * Encodes the specified ImportRowError message, length delimited. Does not implicitly {@link google.cloud.migrationcenter.v1.ImportRowError.verify|verify} messages. + * Encodes the specified FileValidationReport message, length delimited. Does not implicitly {@link google.cloud.migrationcenter.v1.FileValidationReport.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.migrationcenter.v1.ImportRowError + * @memberof google.cloud.migrationcenter.v1.FileValidationReport * @static - * @param {google.cloud.migrationcenter.v1.IImportRowError} message ImportRowError message or plain object to encode + * @param {google.cloud.migrationcenter.v1.IFileValidationReport} message FileValidationReport message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ImportRowError.encodeDelimited = function encodeDelimited(message, writer) { + FileValidationReport.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes an ImportRowError message from the specified reader or buffer. + * Decodes a FileValidationReport message from the specified reader or buffer. * @function decode - * @memberof google.cloud.migrationcenter.v1.ImportRowError + * @memberof google.cloud.migrationcenter.v1.FileValidationReport * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.migrationcenter.v1.ImportRowError} ImportRowError + * @returns {google.cloud.migrationcenter.v1.FileValidationReport} FileValidationReport * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - ImportRowError.decode = function decode(reader, length) { + FileValidationReport.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.migrationcenter.v1.ImportRowError(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.migrationcenter.v1.FileValidationReport(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: { - message.rowNumber = reader.int32(); + message.fileName = reader.string(); break; } case 2: { - message.vmName = reader.string(); + if (!(message.rowErrors && message.rowErrors.length)) + message.rowErrors = []; + message.rowErrors.push($root.google.cloud.migrationcenter.v1.ImportRowError.decode(reader, reader.uint32())); break; } case 3: { - message.vmUuid = reader.string(); + message.partialReport = reader.bool(); break; } case 4: { - if (!(message.errors && message.errors.length)) - message.errors = []; - message.errors.push($root.google.cloud.migrationcenter.v1.ImportError.decode(reader, reader.uint32())); + if (!(message.fileErrors && message.fileErrors.length)) + message.fileErrors = []; + message.fileErrors.push($root.google.cloud.migrationcenter.v1.ImportError.decode(reader, reader.uint32())); break; } default: @@ -42679,168 +42185,186 @@ }; /** - * Decodes an ImportRowError message from the specified reader or buffer, length delimited. + * Decodes a FileValidationReport message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.migrationcenter.v1.ImportRowError + * @memberof google.cloud.migrationcenter.v1.FileValidationReport * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.migrationcenter.v1.ImportRowError} ImportRowError + * @returns {google.cloud.migrationcenter.v1.FileValidationReport} FileValidationReport * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - ImportRowError.decodeDelimited = function decodeDelimited(reader) { + FileValidationReport.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies an ImportRowError message. + * Verifies a FileValidationReport message. * @function verify - * @memberof google.cloud.migrationcenter.v1.ImportRowError + * @memberof google.cloud.migrationcenter.v1.FileValidationReport * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - ImportRowError.verify = function verify(message) { + FileValidationReport.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.rowNumber != null && message.hasOwnProperty("rowNumber")) - if (!$util.isInteger(message.rowNumber)) - return "rowNumber: integer expected"; - if (message.vmName != null && message.hasOwnProperty("vmName")) - if (!$util.isString(message.vmName)) - return "vmName: string expected"; - if (message.vmUuid != null && message.hasOwnProperty("vmUuid")) - if (!$util.isString(message.vmUuid)) - return "vmUuid: string expected"; - if (message.errors != null && message.hasOwnProperty("errors")) { - if (!Array.isArray(message.errors)) - return "errors: array expected"; - for (var i = 0; i < message.errors.length; ++i) { - var error = $root.google.cloud.migrationcenter.v1.ImportError.verify(message.errors[i]); + if (message.fileName != null && message.hasOwnProperty("fileName")) + if (!$util.isString(message.fileName)) + return "fileName: string expected"; + if (message.rowErrors != null && message.hasOwnProperty("rowErrors")) { + if (!Array.isArray(message.rowErrors)) + return "rowErrors: array expected"; + for (var i = 0; i < message.rowErrors.length; ++i) { + var error = $root.google.cloud.migrationcenter.v1.ImportRowError.verify(message.rowErrors[i]); if (error) - return "errors." + error; + return "rowErrors." + error; + } + } + if (message.partialReport != null && message.hasOwnProperty("partialReport")) + if (typeof message.partialReport !== "boolean") + return "partialReport: boolean expected"; + if (message.fileErrors != null && message.hasOwnProperty("fileErrors")) { + if (!Array.isArray(message.fileErrors)) + return "fileErrors: array expected"; + for (var i = 0; i < message.fileErrors.length; ++i) { + var error = $root.google.cloud.migrationcenter.v1.ImportError.verify(message.fileErrors[i]); + if (error) + return "fileErrors." + error; } } return null; }; /** - * Creates an ImportRowError message from a plain object. Also converts values to their respective internal types. + * Creates a FileValidationReport message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.migrationcenter.v1.ImportRowError + * @memberof google.cloud.migrationcenter.v1.FileValidationReport * @static * @param {Object.} object Plain object - * @returns {google.cloud.migrationcenter.v1.ImportRowError} ImportRowError + * @returns {google.cloud.migrationcenter.v1.FileValidationReport} FileValidationReport */ - ImportRowError.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.migrationcenter.v1.ImportRowError) + FileValidationReport.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.migrationcenter.v1.FileValidationReport) return object; - var message = new $root.google.cloud.migrationcenter.v1.ImportRowError(); - if (object.rowNumber != null) - message.rowNumber = object.rowNumber | 0; - if (object.vmName != null) - message.vmName = String(object.vmName); - if (object.vmUuid != null) - message.vmUuid = String(object.vmUuid); - if (object.errors) { - if (!Array.isArray(object.errors)) - throw TypeError(".google.cloud.migrationcenter.v1.ImportRowError.errors: array expected"); - message.errors = []; - for (var i = 0; i < object.errors.length; ++i) { - if (typeof object.errors[i] !== "object") - throw TypeError(".google.cloud.migrationcenter.v1.ImportRowError.errors: object expected"); - message.errors[i] = $root.google.cloud.migrationcenter.v1.ImportError.fromObject(object.errors[i]); + var message = new $root.google.cloud.migrationcenter.v1.FileValidationReport(); + if (object.fileName != null) + message.fileName = String(object.fileName); + if (object.rowErrors) { + if (!Array.isArray(object.rowErrors)) + throw TypeError(".google.cloud.migrationcenter.v1.FileValidationReport.rowErrors: array expected"); + message.rowErrors = []; + for (var i = 0; i < object.rowErrors.length; ++i) { + if (typeof object.rowErrors[i] !== "object") + throw TypeError(".google.cloud.migrationcenter.v1.FileValidationReport.rowErrors: object expected"); + message.rowErrors[i] = $root.google.cloud.migrationcenter.v1.ImportRowError.fromObject(object.rowErrors[i]); + } + } + if (object.partialReport != null) + message.partialReport = Boolean(object.partialReport); + if (object.fileErrors) { + if (!Array.isArray(object.fileErrors)) + throw TypeError(".google.cloud.migrationcenter.v1.FileValidationReport.fileErrors: array expected"); + message.fileErrors = []; + for (var i = 0; i < object.fileErrors.length; ++i) { + if (typeof object.fileErrors[i] !== "object") + throw TypeError(".google.cloud.migrationcenter.v1.FileValidationReport.fileErrors: object expected"); + message.fileErrors[i] = $root.google.cloud.migrationcenter.v1.ImportError.fromObject(object.fileErrors[i]); } } return message; }; /** - * Creates a plain object from an ImportRowError message. Also converts values to other types if specified. + * Creates a plain object from a FileValidationReport message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.migrationcenter.v1.ImportRowError + * @memberof google.cloud.migrationcenter.v1.FileValidationReport * @static - * @param {google.cloud.migrationcenter.v1.ImportRowError} message ImportRowError + * @param {google.cloud.migrationcenter.v1.FileValidationReport} message FileValidationReport * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - ImportRowError.toObject = function toObject(message, options) { + FileValidationReport.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.arrays || options.defaults) - object.errors = []; + if (options.arrays || options.defaults) { + object.rowErrors = []; + object.fileErrors = []; + } if (options.defaults) { - object.rowNumber = 0; - object.vmName = ""; - object.vmUuid = ""; + object.fileName = ""; + object.partialReport = false; } - if (message.rowNumber != null && message.hasOwnProperty("rowNumber")) - object.rowNumber = message.rowNumber; - if (message.vmName != null && message.hasOwnProperty("vmName")) - object.vmName = message.vmName; - if (message.vmUuid != null && message.hasOwnProperty("vmUuid")) - object.vmUuid = message.vmUuid; - if (message.errors && message.errors.length) { - object.errors = []; - for (var j = 0; j < message.errors.length; ++j) - object.errors[j] = $root.google.cloud.migrationcenter.v1.ImportError.toObject(message.errors[j], options); + if (message.fileName != null && message.hasOwnProperty("fileName")) + object.fileName = message.fileName; + if (message.rowErrors && message.rowErrors.length) { + object.rowErrors = []; + for (var j = 0; j < message.rowErrors.length; ++j) + object.rowErrors[j] = $root.google.cloud.migrationcenter.v1.ImportRowError.toObject(message.rowErrors[j], options); + } + if (message.partialReport != null && message.hasOwnProperty("partialReport")) + object.partialReport = message.partialReport; + if (message.fileErrors && message.fileErrors.length) { + object.fileErrors = []; + for (var j = 0; j < message.fileErrors.length; ++j) + object.fileErrors[j] = $root.google.cloud.migrationcenter.v1.ImportError.toObject(message.fileErrors[j], options); } return object; }; /** - * Converts this ImportRowError to JSON. + * Converts this FileValidationReport to JSON. * @function toJSON - * @memberof google.cloud.migrationcenter.v1.ImportRowError + * @memberof google.cloud.migrationcenter.v1.FileValidationReport * @instance * @returns {Object.} JSON object */ - ImportRowError.prototype.toJSON = function toJSON() { + FileValidationReport.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for ImportRowError + * Gets the default type url for FileValidationReport * @function getTypeUrl - * @memberof google.cloud.migrationcenter.v1.ImportRowError + * @memberof google.cloud.migrationcenter.v1.FileValidationReport * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - ImportRowError.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + FileValidationReport.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.cloud.migrationcenter.v1.ImportRowError"; + return typeUrlPrefix + "/google.cloud.migrationcenter.v1.FileValidationReport"; }; - return ImportRowError; + return FileValidationReport; })(); - v1.UploadFileInfo = (function() { + v1.ValidationReport = (function() { /** - * Properties of an UploadFileInfo. + * Properties of a ValidationReport. * @memberof google.cloud.migrationcenter.v1 - * @interface IUploadFileInfo - * @property {string|null} [signedUri] UploadFileInfo signedUri - * @property {Object.|null} [headers] UploadFileInfo headers - * @property {google.protobuf.ITimestamp|null} [uriExpirationTime] UploadFileInfo uriExpirationTime + * @interface IValidationReport + * @property {Array.|null} [fileValidations] ValidationReport fileValidations + * @property {Array.|null} [jobErrors] ValidationReport jobErrors */ /** - * Constructs a new UploadFileInfo. + * Constructs a new ValidationReport. * @memberof google.cloud.migrationcenter.v1 - * @classdesc Represents an UploadFileInfo. - * @implements IUploadFileInfo + * @classdesc Represents a ValidationReport. + * @implements IValidationReport * @constructor - * @param {google.cloud.migrationcenter.v1.IUploadFileInfo=} [properties] Properties to set + * @param {google.cloud.migrationcenter.v1.IValidationReport=} [properties] Properties to set */ - function UploadFileInfo(properties) { - this.headers = {}; + function ValidationReport(properties) { + this.fileValidations = []; + this.jobErrors = []; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -42848,123 +42372,95 @@ } /** - * UploadFileInfo signedUri. - * @member {string} signedUri - * @memberof google.cloud.migrationcenter.v1.UploadFileInfo - * @instance - */ - UploadFileInfo.prototype.signedUri = ""; - - /** - * UploadFileInfo headers. - * @member {Object.} headers - * @memberof google.cloud.migrationcenter.v1.UploadFileInfo + * ValidationReport fileValidations. + * @member {Array.} fileValidations + * @memberof google.cloud.migrationcenter.v1.ValidationReport * @instance */ - UploadFileInfo.prototype.headers = $util.emptyObject; + ValidationReport.prototype.fileValidations = $util.emptyArray; /** - * UploadFileInfo uriExpirationTime. - * @member {google.protobuf.ITimestamp|null|undefined} uriExpirationTime - * @memberof google.cloud.migrationcenter.v1.UploadFileInfo + * ValidationReport jobErrors. + * @member {Array.} jobErrors + * @memberof google.cloud.migrationcenter.v1.ValidationReport * @instance */ - UploadFileInfo.prototype.uriExpirationTime = null; + ValidationReport.prototype.jobErrors = $util.emptyArray; /** - * Creates a new UploadFileInfo instance using the specified properties. + * Creates a new ValidationReport instance using the specified properties. * @function create - * @memberof google.cloud.migrationcenter.v1.UploadFileInfo + * @memberof google.cloud.migrationcenter.v1.ValidationReport * @static - * @param {google.cloud.migrationcenter.v1.IUploadFileInfo=} [properties] Properties to set - * @returns {google.cloud.migrationcenter.v1.UploadFileInfo} UploadFileInfo instance + * @param {google.cloud.migrationcenter.v1.IValidationReport=} [properties] Properties to set + * @returns {google.cloud.migrationcenter.v1.ValidationReport} ValidationReport instance */ - UploadFileInfo.create = function create(properties) { - return new UploadFileInfo(properties); + ValidationReport.create = function create(properties) { + return new ValidationReport(properties); }; /** - * Encodes the specified UploadFileInfo message. Does not implicitly {@link google.cloud.migrationcenter.v1.UploadFileInfo.verify|verify} messages. + * Encodes the specified ValidationReport message. Does not implicitly {@link google.cloud.migrationcenter.v1.ValidationReport.verify|verify} messages. * @function encode - * @memberof google.cloud.migrationcenter.v1.UploadFileInfo + * @memberof google.cloud.migrationcenter.v1.ValidationReport * @static - * @param {google.cloud.migrationcenter.v1.IUploadFileInfo} message UploadFileInfo message or plain object to encode + * @param {google.cloud.migrationcenter.v1.IValidationReport} message ValidationReport message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - UploadFileInfo.encode = function encode(message, writer) { + ValidationReport.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.signedUri != null && Object.hasOwnProperty.call(message, "signedUri")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.signedUri); - if (message.headers != null && Object.hasOwnProperty.call(message, "headers")) - for (var keys = Object.keys(message.headers), 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.headers[keys[i]]).ldelim(); - if (message.uriExpirationTime != null && Object.hasOwnProperty.call(message, "uriExpirationTime")) - $root.google.protobuf.Timestamp.encode(message.uriExpirationTime, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.fileValidations != null && message.fileValidations.length) + for (var i = 0; i < message.fileValidations.length; ++i) + $root.google.cloud.migrationcenter.v1.FileValidationReport.encode(message.fileValidations[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.jobErrors != null && message.jobErrors.length) + for (var i = 0; i < message.jobErrors.length; ++i) + $root.google.cloud.migrationcenter.v1.ImportError.encode(message.jobErrors[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); return writer; }; /** - * Encodes the specified UploadFileInfo message, length delimited. Does not implicitly {@link google.cloud.migrationcenter.v1.UploadFileInfo.verify|verify} messages. + * Encodes the specified ValidationReport message, length delimited. Does not implicitly {@link google.cloud.migrationcenter.v1.ValidationReport.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.migrationcenter.v1.UploadFileInfo + * @memberof google.cloud.migrationcenter.v1.ValidationReport * @static - * @param {google.cloud.migrationcenter.v1.IUploadFileInfo} message UploadFileInfo message or plain object to encode + * @param {google.cloud.migrationcenter.v1.IValidationReport} message ValidationReport message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - UploadFileInfo.encodeDelimited = function encodeDelimited(message, writer) { + ValidationReport.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes an UploadFileInfo message from the specified reader or buffer. + * Decodes a ValidationReport message from the specified reader or buffer. * @function decode - * @memberof google.cloud.migrationcenter.v1.UploadFileInfo + * @memberof google.cloud.migrationcenter.v1.ValidationReport * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.migrationcenter.v1.UploadFileInfo} UploadFileInfo + * @returns {google.cloud.migrationcenter.v1.ValidationReport} ValidationReport * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - UploadFileInfo.decode = function decode(reader, length) { + ValidationReport.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.migrationcenter.v1.UploadFileInfo(), key, value; + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.migrationcenter.v1.ValidationReport(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: { - message.signedUri = reader.string(); + if (!(message.fileValidations && message.fileValidations.length)) + message.fileValidations = []; + message.fileValidations.push($root.google.cloud.migrationcenter.v1.FileValidationReport.decode(reader, reader.uint32())); break; } case 2: { - if (message.headers === $util.emptyObject) - message.headers = {}; - 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.headers[key] = value; - break; - } - case 3: { - message.uriExpirationTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + if (!(message.jobErrors && message.jobErrors.length)) + message.jobErrors = []; + message.jobErrors.push($root.google.cloud.migrationcenter.v1.ImportError.decode(reader, reader.uint32())); break; } default: @@ -42976,160 +42472,167 @@ }; /** - * Decodes an UploadFileInfo message from the specified reader or buffer, length delimited. + * Decodes a ValidationReport message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.migrationcenter.v1.UploadFileInfo + * @memberof google.cloud.migrationcenter.v1.ValidationReport * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.migrationcenter.v1.UploadFileInfo} UploadFileInfo + * @returns {google.cloud.migrationcenter.v1.ValidationReport} ValidationReport * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - UploadFileInfo.decodeDelimited = function decodeDelimited(reader) { + ValidationReport.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies an UploadFileInfo message. + * Verifies a ValidationReport message. * @function verify - * @memberof google.cloud.migrationcenter.v1.UploadFileInfo + * @memberof google.cloud.migrationcenter.v1.ValidationReport * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - UploadFileInfo.verify = function verify(message) { + ValidationReport.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.signedUri != null && message.hasOwnProperty("signedUri")) - if (!$util.isString(message.signedUri)) - return "signedUri: string expected"; - if (message.headers != null && message.hasOwnProperty("headers")) { - if (!$util.isObject(message.headers)) - return "headers: object expected"; - var key = Object.keys(message.headers); - for (var i = 0; i < key.length; ++i) - if (!$util.isString(message.headers[key[i]])) - return "headers: string{k:string} expected"; + if (message.fileValidations != null && message.hasOwnProperty("fileValidations")) { + if (!Array.isArray(message.fileValidations)) + return "fileValidations: array expected"; + for (var i = 0; i < message.fileValidations.length; ++i) { + var error = $root.google.cloud.migrationcenter.v1.FileValidationReport.verify(message.fileValidations[i]); + if (error) + return "fileValidations." + error; + } } - if (message.uriExpirationTime != null && message.hasOwnProperty("uriExpirationTime")) { - var error = $root.google.protobuf.Timestamp.verify(message.uriExpirationTime); - if (error) - return "uriExpirationTime." + error; + if (message.jobErrors != null && message.hasOwnProperty("jobErrors")) { + if (!Array.isArray(message.jobErrors)) + return "jobErrors: array expected"; + for (var i = 0; i < message.jobErrors.length; ++i) { + var error = $root.google.cloud.migrationcenter.v1.ImportError.verify(message.jobErrors[i]); + if (error) + return "jobErrors." + error; + } } return null; }; /** - * Creates an UploadFileInfo message from a plain object. Also converts values to their respective internal types. + * Creates a ValidationReport message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.migrationcenter.v1.UploadFileInfo + * @memberof google.cloud.migrationcenter.v1.ValidationReport * @static * @param {Object.} object Plain object - * @returns {google.cloud.migrationcenter.v1.UploadFileInfo} UploadFileInfo + * @returns {google.cloud.migrationcenter.v1.ValidationReport} ValidationReport */ - UploadFileInfo.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.migrationcenter.v1.UploadFileInfo) + ValidationReport.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.migrationcenter.v1.ValidationReport) return object; - var message = new $root.google.cloud.migrationcenter.v1.UploadFileInfo(); - if (object.signedUri != null) - message.signedUri = String(object.signedUri); - if (object.headers) { - if (typeof object.headers !== "object") - throw TypeError(".google.cloud.migrationcenter.v1.UploadFileInfo.headers: object expected"); - message.headers = {}; - for (var keys = Object.keys(object.headers), i = 0; i < keys.length; ++i) - message.headers[keys[i]] = String(object.headers[keys[i]]); + var message = new $root.google.cloud.migrationcenter.v1.ValidationReport(); + if (object.fileValidations) { + if (!Array.isArray(object.fileValidations)) + throw TypeError(".google.cloud.migrationcenter.v1.ValidationReport.fileValidations: array expected"); + message.fileValidations = []; + for (var i = 0; i < object.fileValidations.length; ++i) { + if (typeof object.fileValidations[i] !== "object") + throw TypeError(".google.cloud.migrationcenter.v1.ValidationReport.fileValidations: object expected"); + message.fileValidations[i] = $root.google.cloud.migrationcenter.v1.FileValidationReport.fromObject(object.fileValidations[i]); + } } - if (object.uriExpirationTime != null) { - if (typeof object.uriExpirationTime !== "object") - throw TypeError(".google.cloud.migrationcenter.v1.UploadFileInfo.uriExpirationTime: object expected"); - message.uriExpirationTime = $root.google.protobuf.Timestamp.fromObject(object.uriExpirationTime); + if (object.jobErrors) { + if (!Array.isArray(object.jobErrors)) + throw TypeError(".google.cloud.migrationcenter.v1.ValidationReport.jobErrors: array expected"); + message.jobErrors = []; + for (var i = 0; i < object.jobErrors.length; ++i) { + if (typeof object.jobErrors[i] !== "object") + throw TypeError(".google.cloud.migrationcenter.v1.ValidationReport.jobErrors: object expected"); + message.jobErrors[i] = $root.google.cloud.migrationcenter.v1.ImportError.fromObject(object.jobErrors[i]); + } } return message; }; /** - * Creates a plain object from an UploadFileInfo message. Also converts values to other types if specified. + * Creates a plain object from a ValidationReport message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.migrationcenter.v1.UploadFileInfo + * @memberof google.cloud.migrationcenter.v1.ValidationReport * @static - * @param {google.cloud.migrationcenter.v1.UploadFileInfo} message UploadFileInfo + * @param {google.cloud.migrationcenter.v1.ValidationReport} message ValidationReport * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - UploadFileInfo.toObject = function toObject(message, options) { + ValidationReport.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.objects || options.defaults) - object.headers = {}; - if (options.defaults) { - object.signedUri = ""; - object.uriExpirationTime = null; + if (options.arrays || options.defaults) { + object.fileValidations = []; + object.jobErrors = []; } - if (message.signedUri != null && message.hasOwnProperty("signedUri")) - object.signedUri = message.signedUri; - var keys2; - if (message.headers && (keys2 = Object.keys(message.headers)).length) { - object.headers = {}; - for (var j = 0; j < keys2.length; ++j) - object.headers[keys2[j]] = message.headers[keys2[j]]; + if (message.fileValidations && message.fileValidations.length) { + object.fileValidations = []; + for (var j = 0; j < message.fileValidations.length; ++j) + object.fileValidations[j] = $root.google.cloud.migrationcenter.v1.FileValidationReport.toObject(message.fileValidations[j], options); + } + if (message.jobErrors && message.jobErrors.length) { + object.jobErrors = []; + for (var j = 0; j < message.jobErrors.length; ++j) + object.jobErrors[j] = $root.google.cloud.migrationcenter.v1.ImportError.toObject(message.jobErrors[j], options); } - if (message.uriExpirationTime != null && message.hasOwnProperty("uriExpirationTime")) - object.uriExpirationTime = $root.google.protobuf.Timestamp.toObject(message.uriExpirationTime, options); return object; }; /** - * Converts this UploadFileInfo to JSON. + * Converts this ValidationReport to JSON. * @function toJSON - * @memberof google.cloud.migrationcenter.v1.UploadFileInfo + * @memberof google.cloud.migrationcenter.v1.ValidationReport * @instance * @returns {Object.} JSON object */ - UploadFileInfo.prototype.toJSON = function toJSON() { + ValidationReport.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for UploadFileInfo + * Gets the default type url for ValidationReport * @function getTypeUrl - * @memberof google.cloud.migrationcenter.v1.UploadFileInfo + * @memberof google.cloud.migrationcenter.v1.ValidationReport * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - UploadFileInfo.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + ValidationReport.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.cloud.migrationcenter.v1.UploadFileInfo"; + return typeUrlPrefix + "/google.cloud.migrationcenter.v1.ValidationReport"; }; - return UploadFileInfo; + return ValidationReport; })(); - v1.AssetList = (function() { + v1.ExecutionReport = (function() { /** - * Properties of an AssetList. + * Properties of an ExecutionReport. * @memberof google.cloud.migrationcenter.v1 - * @interface IAssetList - * @property {Array.|null} [assetIds] AssetList assetIds + * @interface IExecutionReport + * @property {number|null} [framesReported] ExecutionReport framesReported + * @property {google.cloud.migrationcenter.v1.IValidationReport|null} [executionErrors] ExecutionReport executionErrors + * @property {number|null} [totalRowsCount] ExecutionReport totalRowsCount */ /** - * Constructs a new AssetList. + * Constructs a new ExecutionReport. * @memberof google.cloud.migrationcenter.v1 - * @classdesc Represents an AssetList. - * @implements IAssetList + * @classdesc Represents an ExecutionReport. + * @implements IExecutionReport * @constructor - * @param {google.cloud.migrationcenter.v1.IAssetList=} [properties] Properties to set + * @param {google.cloud.migrationcenter.v1.IExecutionReport=} [properties] Properties to set */ - function AssetList(properties) { - this.assetIds = []; + function ExecutionReport(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -43137,78 +42640,103 @@ } /** - * AssetList assetIds. - * @member {Array.} assetIds - * @memberof google.cloud.migrationcenter.v1.AssetList + * ExecutionReport framesReported. + * @member {number} framesReported + * @memberof google.cloud.migrationcenter.v1.ExecutionReport * @instance */ - AssetList.prototype.assetIds = $util.emptyArray; + ExecutionReport.prototype.framesReported = 0; /** - * Creates a new AssetList instance using the specified properties. + * ExecutionReport executionErrors. + * @member {google.cloud.migrationcenter.v1.IValidationReport|null|undefined} executionErrors + * @memberof google.cloud.migrationcenter.v1.ExecutionReport + * @instance + */ + ExecutionReport.prototype.executionErrors = null; + + /** + * ExecutionReport totalRowsCount. + * @member {number} totalRowsCount + * @memberof google.cloud.migrationcenter.v1.ExecutionReport + * @instance + */ + ExecutionReport.prototype.totalRowsCount = 0; + + /** + * Creates a new ExecutionReport instance using the specified properties. * @function create - * @memberof google.cloud.migrationcenter.v1.AssetList + * @memberof google.cloud.migrationcenter.v1.ExecutionReport * @static - * @param {google.cloud.migrationcenter.v1.IAssetList=} [properties] Properties to set - * @returns {google.cloud.migrationcenter.v1.AssetList} AssetList instance + * @param {google.cloud.migrationcenter.v1.IExecutionReport=} [properties] Properties to set + * @returns {google.cloud.migrationcenter.v1.ExecutionReport} ExecutionReport instance */ - AssetList.create = function create(properties) { - return new AssetList(properties); + ExecutionReport.create = function create(properties) { + return new ExecutionReport(properties); }; /** - * Encodes the specified AssetList message. Does not implicitly {@link google.cloud.migrationcenter.v1.AssetList.verify|verify} messages. + * Encodes the specified ExecutionReport message. Does not implicitly {@link google.cloud.migrationcenter.v1.ExecutionReport.verify|verify} messages. * @function encode - * @memberof google.cloud.migrationcenter.v1.AssetList + * @memberof google.cloud.migrationcenter.v1.ExecutionReport * @static - * @param {google.cloud.migrationcenter.v1.IAssetList} message AssetList message or plain object to encode + * @param {google.cloud.migrationcenter.v1.IExecutionReport} message ExecutionReport message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - AssetList.encode = function encode(message, writer) { + ExecutionReport.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.assetIds != null && message.assetIds.length) - for (var i = 0; i < message.assetIds.length; ++i) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.assetIds[i]); + if (message.framesReported != null && Object.hasOwnProperty.call(message, "framesReported")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.framesReported); + if (message.executionErrors != null && Object.hasOwnProperty.call(message, "executionErrors")) + $root.google.cloud.migrationcenter.v1.ValidationReport.encode(message.executionErrors, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.totalRowsCount != null && Object.hasOwnProperty.call(message, "totalRowsCount")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.totalRowsCount); return writer; }; /** - * Encodes the specified AssetList message, length delimited. Does not implicitly {@link google.cloud.migrationcenter.v1.AssetList.verify|verify} messages. + * Encodes the specified ExecutionReport message, length delimited. Does not implicitly {@link google.cloud.migrationcenter.v1.ExecutionReport.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.migrationcenter.v1.AssetList + * @memberof google.cloud.migrationcenter.v1.ExecutionReport * @static - * @param {google.cloud.migrationcenter.v1.IAssetList} message AssetList message or plain object to encode + * @param {google.cloud.migrationcenter.v1.IExecutionReport} message ExecutionReport message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - AssetList.encodeDelimited = function encodeDelimited(message, writer) { + ExecutionReport.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes an AssetList message from the specified reader or buffer. + * Decodes an ExecutionReport message from the specified reader or buffer. * @function decode - * @memberof google.cloud.migrationcenter.v1.AssetList + * @memberof google.cloud.migrationcenter.v1.ExecutionReport * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.migrationcenter.v1.AssetList} AssetList + * @returns {google.cloud.migrationcenter.v1.ExecutionReport} ExecutionReport * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - AssetList.decode = function decode(reader, length) { + ExecutionReport.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.migrationcenter.v1.AssetList(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.migrationcenter.v1.ExecutionReport(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: { - if (!(message.assetIds && message.assetIds.length)) - message.assetIds = []; - message.assetIds.push(reader.string()); + message.framesReported = reader.int32(); + break; + } + case 2: { + message.executionErrors = $root.google.cloud.migrationcenter.v1.ValidationReport.decode(reader, reader.uint32()); + break; + } + case 3: { + message.totalRowsCount = reader.int32(); break; } default: @@ -43220,135 +42748,145 @@ }; /** - * Decodes an AssetList message from the specified reader or buffer, length delimited. + * Decodes an ExecutionReport message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.migrationcenter.v1.AssetList + * @memberof google.cloud.migrationcenter.v1.ExecutionReport * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.migrationcenter.v1.AssetList} AssetList + * @returns {google.cloud.migrationcenter.v1.ExecutionReport} ExecutionReport * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - AssetList.decodeDelimited = function decodeDelimited(reader) { + ExecutionReport.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies an AssetList message. + * Verifies an ExecutionReport message. * @function verify - * @memberof google.cloud.migrationcenter.v1.AssetList + * @memberof google.cloud.migrationcenter.v1.ExecutionReport * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - AssetList.verify = function verify(message) { + ExecutionReport.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.assetIds != null && message.hasOwnProperty("assetIds")) { - if (!Array.isArray(message.assetIds)) - return "assetIds: array expected"; - for (var i = 0; i < message.assetIds.length; ++i) - if (!$util.isString(message.assetIds[i])) - return "assetIds: string[] expected"; + if (message.framesReported != null && message.hasOwnProperty("framesReported")) + if (!$util.isInteger(message.framesReported)) + return "framesReported: integer expected"; + if (message.executionErrors != null && message.hasOwnProperty("executionErrors")) { + var error = $root.google.cloud.migrationcenter.v1.ValidationReport.verify(message.executionErrors); + if (error) + return "executionErrors." + error; } + if (message.totalRowsCount != null && message.hasOwnProperty("totalRowsCount")) + if (!$util.isInteger(message.totalRowsCount)) + return "totalRowsCount: integer expected"; return null; }; /** - * Creates an AssetList message from a plain object. Also converts values to their respective internal types. + * Creates an ExecutionReport message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.migrationcenter.v1.AssetList + * @memberof google.cloud.migrationcenter.v1.ExecutionReport * @static * @param {Object.} object Plain object - * @returns {google.cloud.migrationcenter.v1.AssetList} AssetList + * @returns {google.cloud.migrationcenter.v1.ExecutionReport} ExecutionReport */ - AssetList.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.migrationcenter.v1.AssetList) + ExecutionReport.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.migrationcenter.v1.ExecutionReport) return object; - var message = new $root.google.cloud.migrationcenter.v1.AssetList(); - if (object.assetIds) { - if (!Array.isArray(object.assetIds)) - throw TypeError(".google.cloud.migrationcenter.v1.AssetList.assetIds: array expected"); - message.assetIds = []; - for (var i = 0; i < object.assetIds.length; ++i) - message.assetIds[i] = String(object.assetIds[i]); + var message = new $root.google.cloud.migrationcenter.v1.ExecutionReport(); + if (object.framesReported != null) + message.framesReported = object.framesReported | 0; + if (object.executionErrors != null) { + if (typeof object.executionErrors !== "object") + throw TypeError(".google.cloud.migrationcenter.v1.ExecutionReport.executionErrors: object expected"); + message.executionErrors = $root.google.cloud.migrationcenter.v1.ValidationReport.fromObject(object.executionErrors); } + if (object.totalRowsCount != null) + message.totalRowsCount = object.totalRowsCount | 0; return message; }; /** - * Creates a plain object from an AssetList message. Also converts values to other types if specified. + * Creates a plain object from an ExecutionReport message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.migrationcenter.v1.AssetList + * @memberof google.cloud.migrationcenter.v1.ExecutionReport * @static - * @param {google.cloud.migrationcenter.v1.AssetList} message AssetList + * @param {google.cloud.migrationcenter.v1.ExecutionReport} message ExecutionReport * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - AssetList.toObject = function toObject(message, options) { + ExecutionReport.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.arrays || options.defaults) - object.assetIds = []; - if (message.assetIds && message.assetIds.length) { - object.assetIds = []; - for (var j = 0; j < message.assetIds.length; ++j) - object.assetIds[j] = message.assetIds[j]; + if (options.defaults) { + object.framesReported = 0; + object.executionErrors = null; + object.totalRowsCount = 0; } + if (message.framesReported != null && message.hasOwnProperty("framesReported")) + object.framesReported = message.framesReported; + if (message.executionErrors != null && message.hasOwnProperty("executionErrors")) + object.executionErrors = $root.google.cloud.migrationcenter.v1.ValidationReport.toObject(message.executionErrors, options); + if (message.totalRowsCount != null && message.hasOwnProperty("totalRowsCount")) + object.totalRowsCount = message.totalRowsCount; return object; }; /** - * Converts this AssetList to JSON. + * Converts this ExecutionReport to JSON. * @function toJSON - * @memberof google.cloud.migrationcenter.v1.AssetList + * @memberof google.cloud.migrationcenter.v1.ExecutionReport * @instance * @returns {Object.} JSON object */ - AssetList.prototype.toJSON = function toJSON() { + ExecutionReport.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for AssetList + * Gets the default type url for ExecutionReport * @function getTypeUrl - * @memberof google.cloud.migrationcenter.v1.AssetList + * @memberof google.cloud.migrationcenter.v1.ExecutionReport * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - AssetList.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + ExecutionReport.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.cloud.migrationcenter.v1.AssetList"; + return typeUrlPrefix + "/google.cloud.migrationcenter.v1.ExecutionReport"; }; - return AssetList; + return ExecutionReport; })(); - v1.FrameViolationEntry = (function() { + v1.ImportError = (function() { /** - * Properties of a FrameViolationEntry. + * Properties of an ImportError. * @memberof google.cloud.migrationcenter.v1 - * @interface IFrameViolationEntry - * @property {string|null} [field] FrameViolationEntry field - * @property {string|null} [violation] FrameViolationEntry violation + * @interface IImportError + * @property {string|null} [errorDetails] ImportError errorDetails + * @property {google.cloud.migrationcenter.v1.ImportError.Severity|null} [severity] ImportError severity */ /** - * Constructs a new FrameViolationEntry. + * Constructs a new ImportError. * @memberof google.cloud.migrationcenter.v1 - * @classdesc Represents a FrameViolationEntry. - * @implements IFrameViolationEntry + * @classdesc Represents an ImportError. + * @implements IImportError * @constructor - * @param {google.cloud.migrationcenter.v1.IFrameViolationEntry=} [properties] Properties to set + * @param {google.cloud.migrationcenter.v1.IImportError=} [properties] Properties to set */ - function FrameViolationEntry(properties) { + function ImportError(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -43356,89 +42894,89 @@ } /** - * FrameViolationEntry field. - * @member {string} field - * @memberof google.cloud.migrationcenter.v1.FrameViolationEntry + * ImportError errorDetails. + * @member {string} errorDetails + * @memberof google.cloud.migrationcenter.v1.ImportError * @instance */ - FrameViolationEntry.prototype.field = ""; + ImportError.prototype.errorDetails = ""; /** - * FrameViolationEntry violation. - * @member {string} violation - * @memberof google.cloud.migrationcenter.v1.FrameViolationEntry + * ImportError severity. + * @member {google.cloud.migrationcenter.v1.ImportError.Severity} severity + * @memberof google.cloud.migrationcenter.v1.ImportError * @instance */ - FrameViolationEntry.prototype.violation = ""; + ImportError.prototype.severity = 0; /** - * Creates a new FrameViolationEntry instance using the specified properties. + * Creates a new ImportError instance using the specified properties. * @function create - * @memberof google.cloud.migrationcenter.v1.FrameViolationEntry + * @memberof google.cloud.migrationcenter.v1.ImportError * @static - * @param {google.cloud.migrationcenter.v1.IFrameViolationEntry=} [properties] Properties to set - * @returns {google.cloud.migrationcenter.v1.FrameViolationEntry} FrameViolationEntry instance + * @param {google.cloud.migrationcenter.v1.IImportError=} [properties] Properties to set + * @returns {google.cloud.migrationcenter.v1.ImportError} ImportError instance */ - FrameViolationEntry.create = function create(properties) { - return new FrameViolationEntry(properties); + ImportError.create = function create(properties) { + return new ImportError(properties); }; /** - * Encodes the specified FrameViolationEntry message. Does not implicitly {@link google.cloud.migrationcenter.v1.FrameViolationEntry.verify|verify} messages. + * Encodes the specified ImportError message. Does not implicitly {@link google.cloud.migrationcenter.v1.ImportError.verify|verify} messages. * @function encode - * @memberof google.cloud.migrationcenter.v1.FrameViolationEntry + * @memberof google.cloud.migrationcenter.v1.ImportError * @static - * @param {google.cloud.migrationcenter.v1.IFrameViolationEntry} message FrameViolationEntry message or plain object to encode + * @param {google.cloud.migrationcenter.v1.IImportError} message ImportError message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - FrameViolationEntry.encode = function encode(message, writer) { + ImportError.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.field != null && Object.hasOwnProperty.call(message, "field")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.field); - if (message.violation != null && Object.hasOwnProperty.call(message, "violation")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.violation); + if (message.errorDetails != null && Object.hasOwnProperty.call(message, "errorDetails")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.errorDetails); + if (message.severity != null && Object.hasOwnProperty.call(message, "severity")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.severity); return writer; }; /** - * Encodes the specified FrameViolationEntry message, length delimited. Does not implicitly {@link google.cloud.migrationcenter.v1.FrameViolationEntry.verify|verify} messages. + * Encodes the specified ImportError message, length delimited. Does not implicitly {@link google.cloud.migrationcenter.v1.ImportError.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.migrationcenter.v1.FrameViolationEntry + * @memberof google.cloud.migrationcenter.v1.ImportError * @static - * @param {google.cloud.migrationcenter.v1.IFrameViolationEntry} message FrameViolationEntry message or plain object to encode + * @param {google.cloud.migrationcenter.v1.IImportError} message ImportError message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - FrameViolationEntry.encodeDelimited = function encodeDelimited(message, writer) { + ImportError.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a FrameViolationEntry message from the specified reader or buffer. + * Decodes an ImportError message from the specified reader or buffer. * @function decode - * @memberof google.cloud.migrationcenter.v1.FrameViolationEntry + * @memberof google.cloud.migrationcenter.v1.ImportError * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.migrationcenter.v1.FrameViolationEntry} FrameViolationEntry + * @returns {google.cloud.migrationcenter.v1.ImportError} ImportError * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - FrameViolationEntry.decode = function decode(reader, length) { + ImportError.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.migrationcenter.v1.FrameViolationEntry(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.migrationcenter.v1.ImportError(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: { - message.field = reader.string(); + message.errorDetails = reader.string(); break; } case 2: { - message.violation = reader.string(); + message.severity = reader.int32(); break; } default: @@ -43450,134 +42988,182 @@ }; /** - * Decodes a FrameViolationEntry message from the specified reader or buffer, length delimited. + * Decodes an ImportError message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.migrationcenter.v1.FrameViolationEntry + * @memberof google.cloud.migrationcenter.v1.ImportError * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.migrationcenter.v1.FrameViolationEntry} FrameViolationEntry + * @returns {google.cloud.migrationcenter.v1.ImportError} ImportError * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - FrameViolationEntry.decodeDelimited = function decodeDelimited(reader) { + ImportError.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a FrameViolationEntry message. + * Verifies an ImportError message. * @function verify - * @memberof google.cloud.migrationcenter.v1.FrameViolationEntry + * @memberof google.cloud.migrationcenter.v1.ImportError * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - FrameViolationEntry.verify = function verify(message) { + ImportError.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.field != null && message.hasOwnProperty("field")) - if (!$util.isString(message.field)) - return "field: string expected"; - if (message.violation != null && message.hasOwnProperty("violation")) - if (!$util.isString(message.violation)) - return "violation: string expected"; + if (message.errorDetails != null && message.hasOwnProperty("errorDetails")) + if (!$util.isString(message.errorDetails)) + return "errorDetails: string expected"; + if (message.severity != null && message.hasOwnProperty("severity")) + switch (message.severity) { + default: + return "severity: enum value expected"; + case 0: + case 1: + case 2: + case 3: + break; + } return null; }; /** - * Creates a FrameViolationEntry message from a plain object. Also converts values to their respective internal types. + * Creates an ImportError message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.migrationcenter.v1.FrameViolationEntry + * @memberof google.cloud.migrationcenter.v1.ImportError * @static * @param {Object.} object Plain object - * @returns {google.cloud.migrationcenter.v1.FrameViolationEntry} FrameViolationEntry + * @returns {google.cloud.migrationcenter.v1.ImportError} ImportError */ - FrameViolationEntry.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.migrationcenter.v1.FrameViolationEntry) + ImportError.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.migrationcenter.v1.ImportError) return object; - var message = new $root.google.cloud.migrationcenter.v1.FrameViolationEntry(); - if (object.field != null) - message.field = String(object.field); - if (object.violation != null) - message.violation = String(object.violation); - return message; - }; - - /** - * Creates a plain object from a FrameViolationEntry message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.migrationcenter.v1.FrameViolationEntry - * @static - * @param {google.cloud.migrationcenter.v1.FrameViolationEntry} message FrameViolationEntry - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - FrameViolationEntry.toObject = function toObject(message, options) { - if (!options) - options = {}; + var message = new $root.google.cloud.migrationcenter.v1.ImportError(); + if (object.errorDetails != null) + message.errorDetails = String(object.errorDetails); + switch (object.severity) { + default: + if (typeof object.severity === "number") { + message.severity = object.severity; + break; + } + break; + case "SEVERITY_UNSPECIFIED": + case 0: + message.severity = 0; + break; + case "ERROR": + case 1: + message.severity = 1; + break; + case "WARNING": + case 2: + message.severity = 2; + break; + case "INFO": + case 3: + message.severity = 3; + break; + } + return message; + }; + + /** + * Creates a plain object from an ImportError message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.migrationcenter.v1.ImportError + * @static + * @param {google.cloud.migrationcenter.v1.ImportError} message ImportError + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ImportError.toObject = function toObject(message, options) { + if (!options) + options = {}; var object = {}; if (options.defaults) { - object.field = ""; - object.violation = ""; + object.errorDetails = ""; + object.severity = options.enums === String ? "SEVERITY_UNSPECIFIED" : 0; } - if (message.field != null && message.hasOwnProperty("field")) - object.field = message.field; - if (message.violation != null && message.hasOwnProperty("violation")) - object.violation = message.violation; + if (message.errorDetails != null && message.hasOwnProperty("errorDetails")) + object.errorDetails = message.errorDetails; + if (message.severity != null && message.hasOwnProperty("severity")) + object.severity = options.enums === String ? $root.google.cloud.migrationcenter.v1.ImportError.Severity[message.severity] === undefined ? message.severity : $root.google.cloud.migrationcenter.v1.ImportError.Severity[message.severity] : message.severity; return object; }; /** - * Converts this FrameViolationEntry to JSON. + * Converts this ImportError to JSON. * @function toJSON - * @memberof google.cloud.migrationcenter.v1.FrameViolationEntry + * @memberof google.cloud.migrationcenter.v1.ImportError * @instance * @returns {Object.} JSON object */ - FrameViolationEntry.prototype.toJSON = function toJSON() { + ImportError.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for FrameViolationEntry + * Gets the default type url for ImportError * @function getTypeUrl - * @memberof google.cloud.migrationcenter.v1.FrameViolationEntry + * @memberof google.cloud.migrationcenter.v1.ImportError * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - FrameViolationEntry.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + ImportError.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.cloud.migrationcenter.v1.FrameViolationEntry"; + return typeUrlPrefix + "/google.cloud.migrationcenter.v1.ImportError"; }; - return FrameViolationEntry; + /** + * Severity enum. + * @name google.cloud.migrationcenter.v1.ImportError.Severity + * @enum {number} + * @property {number} SEVERITY_UNSPECIFIED=0 SEVERITY_UNSPECIFIED value + * @property {number} ERROR=1 ERROR value + * @property {number} WARNING=2 WARNING value + * @property {number} INFO=3 INFO value + */ + ImportError.Severity = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "SEVERITY_UNSPECIFIED"] = 0; + values[valuesById[1] = "ERROR"] = 1; + values[valuesById[2] = "WARNING"] = 2; + values[valuesById[3] = "INFO"] = 3; + return values; + })(); + + return ImportError; })(); - v1.VirtualMachinePreferences = (function() { + v1.ImportRowError = (function() { /** - * Properties of a VirtualMachinePreferences. + * Properties of an ImportRowError. * @memberof google.cloud.migrationcenter.v1 - * @interface IVirtualMachinePreferences - * @property {google.cloud.migrationcenter.v1.IRegionPreferences|null} [regionPreferences] VirtualMachinePreferences regionPreferences - * @property {google.cloud.migrationcenter.v1.CommitmentPlan|null} [commitmentPlan] VirtualMachinePreferences commitmentPlan - * @property {google.cloud.migrationcenter.v1.SizingOptimizationStrategy|null} [sizingOptimizationStrategy] VirtualMachinePreferences sizingOptimizationStrategy - * @property {google.cloud.migrationcenter.v1.IComputeEnginePreferences|null} [computeEnginePreferences] VirtualMachinePreferences computeEnginePreferences + * @interface IImportRowError + * @property {number|null} [rowNumber] ImportRowError rowNumber + * @property {string|null} [vmName] ImportRowError vmName + * @property {string|null} [vmUuid] ImportRowError vmUuid + * @property {Array.|null} [errors] ImportRowError errors */ /** - * Constructs a new VirtualMachinePreferences. + * Constructs a new ImportRowError. * @memberof google.cloud.migrationcenter.v1 - * @classdesc Represents a VirtualMachinePreferences. - * @implements IVirtualMachinePreferences + * @classdesc Represents an ImportRowError. + * @implements IImportRowError * @constructor - * @param {google.cloud.migrationcenter.v1.IVirtualMachinePreferences=} [properties] Properties to set + * @param {google.cloud.migrationcenter.v1.IImportRowError=} [properties] Properties to set */ - function VirtualMachinePreferences(properties) { + function ImportRowError(properties) { + this.errors = []; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -43585,117 +43171,120 @@ } /** - * VirtualMachinePreferences regionPreferences. - * @member {google.cloud.migrationcenter.v1.IRegionPreferences|null|undefined} regionPreferences - * @memberof google.cloud.migrationcenter.v1.VirtualMachinePreferences + * ImportRowError rowNumber. + * @member {number} rowNumber + * @memberof google.cloud.migrationcenter.v1.ImportRowError * @instance */ - VirtualMachinePreferences.prototype.regionPreferences = null; + ImportRowError.prototype.rowNumber = 0; /** - * VirtualMachinePreferences commitmentPlan. - * @member {google.cloud.migrationcenter.v1.CommitmentPlan} commitmentPlan - * @memberof google.cloud.migrationcenter.v1.VirtualMachinePreferences + * ImportRowError vmName. + * @member {string} vmName + * @memberof google.cloud.migrationcenter.v1.ImportRowError * @instance */ - VirtualMachinePreferences.prototype.commitmentPlan = 0; + ImportRowError.prototype.vmName = ""; /** - * VirtualMachinePreferences sizingOptimizationStrategy. - * @member {google.cloud.migrationcenter.v1.SizingOptimizationStrategy} sizingOptimizationStrategy - * @memberof google.cloud.migrationcenter.v1.VirtualMachinePreferences + * ImportRowError vmUuid. + * @member {string} vmUuid + * @memberof google.cloud.migrationcenter.v1.ImportRowError * @instance */ - VirtualMachinePreferences.prototype.sizingOptimizationStrategy = 0; + ImportRowError.prototype.vmUuid = ""; /** - * VirtualMachinePreferences computeEnginePreferences. - * @member {google.cloud.migrationcenter.v1.IComputeEnginePreferences|null|undefined} computeEnginePreferences - * @memberof google.cloud.migrationcenter.v1.VirtualMachinePreferences + * ImportRowError errors. + * @member {Array.} errors + * @memberof google.cloud.migrationcenter.v1.ImportRowError * @instance */ - VirtualMachinePreferences.prototype.computeEnginePreferences = null; + ImportRowError.prototype.errors = $util.emptyArray; /** - * Creates a new VirtualMachinePreferences instance using the specified properties. + * Creates a new ImportRowError instance using the specified properties. * @function create - * @memberof google.cloud.migrationcenter.v1.VirtualMachinePreferences + * @memberof google.cloud.migrationcenter.v1.ImportRowError * @static - * @param {google.cloud.migrationcenter.v1.IVirtualMachinePreferences=} [properties] Properties to set - * @returns {google.cloud.migrationcenter.v1.VirtualMachinePreferences} VirtualMachinePreferences instance + * @param {google.cloud.migrationcenter.v1.IImportRowError=} [properties] Properties to set + * @returns {google.cloud.migrationcenter.v1.ImportRowError} ImportRowError instance */ - VirtualMachinePreferences.create = function create(properties) { - return new VirtualMachinePreferences(properties); + ImportRowError.create = function create(properties) { + return new ImportRowError(properties); }; /** - * Encodes the specified VirtualMachinePreferences message. Does not implicitly {@link google.cloud.migrationcenter.v1.VirtualMachinePreferences.verify|verify} messages. + * Encodes the specified ImportRowError message. Does not implicitly {@link google.cloud.migrationcenter.v1.ImportRowError.verify|verify} messages. * @function encode - * @memberof google.cloud.migrationcenter.v1.VirtualMachinePreferences + * @memberof google.cloud.migrationcenter.v1.ImportRowError * @static - * @param {google.cloud.migrationcenter.v1.IVirtualMachinePreferences} message VirtualMachinePreferences message or plain object to encode + * @param {google.cloud.migrationcenter.v1.IImportRowError} message ImportRowError message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - VirtualMachinePreferences.encode = function encode(message, writer) { + ImportRowError.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.regionPreferences != null && Object.hasOwnProperty.call(message, "regionPreferences")) - $root.google.cloud.migrationcenter.v1.RegionPreferences.encode(message.regionPreferences, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - if (message.commitmentPlan != null && Object.hasOwnProperty.call(message, "commitmentPlan")) - writer.uint32(/* id 4, wireType 0 =*/32).int32(message.commitmentPlan); - if (message.sizingOptimizationStrategy != null && Object.hasOwnProperty.call(message, "sizingOptimizationStrategy")) - writer.uint32(/* id 5, wireType 0 =*/40).int32(message.sizingOptimizationStrategy); - if (message.computeEnginePreferences != null && Object.hasOwnProperty.call(message, "computeEnginePreferences")) - $root.google.cloud.migrationcenter.v1.ComputeEnginePreferences.encode(message.computeEnginePreferences, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + if (message.rowNumber != null && Object.hasOwnProperty.call(message, "rowNumber")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.rowNumber); + if (message.vmName != null && Object.hasOwnProperty.call(message, "vmName")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.vmName); + if (message.vmUuid != null && Object.hasOwnProperty.call(message, "vmUuid")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.vmUuid); + if (message.errors != null && message.errors.length) + for (var i = 0; i < message.errors.length; ++i) + $root.google.cloud.migrationcenter.v1.ImportError.encode(message.errors[i], writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); return writer; }; /** - * Encodes the specified VirtualMachinePreferences message, length delimited. Does not implicitly {@link google.cloud.migrationcenter.v1.VirtualMachinePreferences.verify|verify} messages. + * Encodes the specified ImportRowError message, length delimited. Does not implicitly {@link google.cloud.migrationcenter.v1.ImportRowError.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.migrationcenter.v1.VirtualMachinePreferences + * @memberof google.cloud.migrationcenter.v1.ImportRowError * @static - * @param {google.cloud.migrationcenter.v1.IVirtualMachinePreferences} message VirtualMachinePreferences message or plain object to encode + * @param {google.cloud.migrationcenter.v1.IImportRowError} message ImportRowError message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - VirtualMachinePreferences.encodeDelimited = function encodeDelimited(message, writer) { + ImportRowError.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a VirtualMachinePreferences message from the specified reader or buffer. + * Decodes an ImportRowError message from the specified reader or buffer. * @function decode - * @memberof google.cloud.migrationcenter.v1.VirtualMachinePreferences + * @memberof google.cloud.migrationcenter.v1.ImportRowError * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.migrationcenter.v1.VirtualMachinePreferences} VirtualMachinePreferences + * @returns {google.cloud.migrationcenter.v1.ImportRowError} ImportRowError * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - VirtualMachinePreferences.decode = function decode(reader, length) { + ImportRowError.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.migrationcenter.v1.VirtualMachinePreferences(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.migrationcenter.v1.ImportRowError(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 3: { - message.regionPreferences = $root.google.cloud.migrationcenter.v1.RegionPreferences.decode(reader, reader.uint32()); + case 1: { + message.rowNumber = reader.int32(); break; } - case 4: { - message.commitmentPlan = reader.int32(); + case 2: { + message.vmName = reader.string(); break; } - case 5: { - message.sizingOptimizationStrategy = reader.int32(); + case 3: { + message.vmUuid = reader.string(); break; } - case 6: { - message.computeEnginePreferences = $root.google.cloud.migrationcenter.v1.ComputeEnginePreferences.decode(reader, reader.uint32()); + case 4: { + if (!(message.errors && message.errors.length)) + message.errors = []; + message.errors.push($root.google.cloud.migrationcenter.v1.ImportError.decode(reader, reader.uint32())); break; } default: @@ -43707,216 +43296,168 @@ }; /** - * Decodes a VirtualMachinePreferences message from the specified reader or buffer, length delimited. + * Decodes an ImportRowError message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.migrationcenter.v1.VirtualMachinePreferences + * @memberof google.cloud.migrationcenter.v1.ImportRowError * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.migrationcenter.v1.VirtualMachinePreferences} VirtualMachinePreferences + * @returns {google.cloud.migrationcenter.v1.ImportRowError} ImportRowError * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - VirtualMachinePreferences.decodeDelimited = function decodeDelimited(reader) { + ImportRowError.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a VirtualMachinePreferences message. + * Verifies an ImportRowError message. * @function verify - * @memberof google.cloud.migrationcenter.v1.VirtualMachinePreferences + * @memberof google.cloud.migrationcenter.v1.ImportRowError * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - VirtualMachinePreferences.verify = function verify(message) { + ImportRowError.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.regionPreferences != null && message.hasOwnProperty("regionPreferences")) { - var error = $root.google.cloud.migrationcenter.v1.RegionPreferences.verify(message.regionPreferences); - if (error) - return "regionPreferences." + error; - } - if (message.commitmentPlan != null && message.hasOwnProperty("commitmentPlan")) - switch (message.commitmentPlan) { - default: - return "commitmentPlan: enum value expected"; - case 0: - case 1: - case 2: - case 3: - break; - } - if (message.sizingOptimizationStrategy != null && message.hasOwnProperty("sizingOptimizationStrategy")) - switch (message.sizingOptimizationStrategy) { - default: - return "sizingOptimizationStrategy: enum value expected"; - case 0: - case 1: - case 2: - case 3: - break; - } - if (message.computeEnginePreferences != null && message.hasOwnProperty("computeEnginePreferences")) { - var error = $root.google.cloud.migrationcenter.v1.ComputeEnginePreferences.verify(message.computeEnginePreferences); - if (error) - return "computeEnginePreferences." + error; + if (message.rowNumber != null && message.hasOwnProperty("rowNumber")) + if (!$util.isInteger(message.rowNumber)) + return "rowNumber: integer expected"; + if (message.vmName != null && message.hasOwnProperty("vmName")) + if (!$util.isString(message.vmName)) + return "vmName: string expected"; + if (message.vmUuid != null && message.hasOwnProperty("vmUuid")) + if (!$util.isString(message.vmUuid)) + return "vmUuid: string expected"; + if (message.errors != null && message.hasOwnProperty("errors")) { + if (!Array.isArray(message.errors)) + return "errors: array expected"; + for (var i = 0; i < message.errors.length; ++i) { + var error = $root.google.cloud.migrationcenter.v1.ImportError.verify(message.errors[i]); + if (error) + return "errors." + error; + } } return null; }; /** - * Creates a VirtualMachinePreferences message from a plain object. Also converts values to their respective internal types. + * Creates an ImportRowError message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.migrationcenter.v1.VirtualMachinePreferences + * @memberof google.cloud.migrationcenter.v1.ImportRowError * @static * @param {Object.} object Plain object - * @returns {google.cloud.migrationcenter.v1.VirtualMachinePreferences} VirtualMachinePreferences + * @returns {google.cloud.migrationcenter.v1.ImportRowError} ImportRowError */ - VirtualMachinePreferences.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.migrationcenter.v1.VirtualMachinePreferences) + ImportRowError.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.migrationcenter.v1.ImportRowError) return object; - var message = new $root.google.cloud.migrationcenter.v1.VirtualMachinePreferences(); - if (object.regionPreferences != null) { - if (typeof object.regionPreferences !== "object") - throw TypeError(".google.cloud.migrationcenter.v1.VirtualMachinePreferences.regionPreferences: object expected"); - message.regionPreferences = $root.google.cloud.migrationcenter.v1.RegionPreferences.fromObject(object.regionPreferences); - } - switch (object.commitmentPlan) { - default: - if (typeof object.commitmentPlan === "number") { - message.commitmentPlan = object.commitmentPlan; - break; - } - break; - case "COMMITMENT_PLAN_UNSPECIFIED": - case 0: - message.commitmentPlan = 0; - break; - case "COMMITMENT_PLAN_NONE": - case 1: - message.commitmentPlan = 1; - break; - case "COMMITMENT_PLAN_ONE_YEAR": - case 2: - message.commitmentPlan = 2; - break; - case "COMMITMENT_PLAN_THREE_YEARS": - case 3: - message.commitmentPlan = 3; - break; - } - switch (object.sizingOptimizationStrategy) { - default: - if (typeof object.sizingOptimizationStrategy === "number") { - message.sizingOptimizationStrategy = object.sizingOptimizationStrategy; - break; + var message = new $root.google.cloud.migrationcenter.v1.ImportRowError(); + if (object.rowNumber != null) + message.rowNumber = object.rowNumber | 0; + if (object.vmName != null) + message.vmName = String(object.vmName); + if (object.vmUuid != null) + message.vmUuid = String(object.vmUuid); + if (object.errors) { + if (!Array.isArray(object.errors)) + throw TypeError(".google.cloud.migrationcenter.v1.ImportRowError.errors: array expected"); + message.errors = []; + for (var i = 0; i < object.errors.length; ++i) { + if (typeof object.errors[i] !== "object") + throw TypeError(".google.cloud.migrationcenter.v1.ImportRowError.errors: object expected"); + message.errors[i] = $root.google.cloud.migrationcenter.v1.ImportError.fromObject(object.errors[i]); } - break; - case "SIZING_OPTIMIZATION_STRATEGY_UNSPECIFIED": - case 0: - message.sizingOptimizationStrategy = 0; - break; - case "SIZING_OPTIMIZATION_STRATEGY_SAME_AS_SOURCE": - case 1: - message.sizingOptimizationStrategy = 1; - break; - case "SIZING_OPTIMIZATION_STRATEGY_MODERATE": - case 2: - message.sizingOptimizationStrategy = 2; - break; - case "SIZING_OPTIMIZATION_STRATEGY_AGGRESSIVE": - case 3: - message.sizingOptimizationStrategy = 3; - break; - } - if (object.computeEnginePreferences != null) { - if (typeof object.computeEnginePreferences !== "object") - throw TypeError(".google.cloud.migrationcenter.v1.VirtualMachinePreferences.computeEnginePreferences: object expected"); - message.computeEnginePreferences = $root.google.cloud.migrationcenter.v1.ComputeEnginePreferences.fromObject(object.computeEnginePreferences); } return message; }; /** - * Creates a plain object from a VirtualMachinePreferences message. Also converts values to other types if specified. + * Creates a plain object from an ImportRowError message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.migrationcenter.v1.VirtualMachinePreferences + * @memberof google.cloud.migrationcenter.v1.ImportRowError * @static - * @param {google.cloud.migrationcenter.v1.VirtualMachinePreferences} message VirtualMachinePreferences + * @param {google.cloud.migrationcenter.v1.ImportRowError} message ImportRowError * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - VirtualMachinePreferences.toObject = function toObject(message, options) { + ImportRowError.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; + if (options.arrays || options.defaults) + object.errors = []; if (options.defaults) { - object.regionPreferences = null; - object.commitmentPlan = options.enums === String ? "COMMITMENT_PLAN_UNSPECIFIED" : 0; - object.sizingOptimizationStrategy = options.enums === String ? "SIZING_OPTIMIZATION_STRATEGY_UNSPECIFIED" : 0; - object.computeEnginePreferences = null; + object.rowNumber = 0; + object.vmName = ""; + object.vmUuid = ""; + } + if (message.rowNumber != null && message.hasOwnProperty("rowNumber")) + object.rowNumber = message.rowNumber; + if (message.vmName != null && message.hasOwnProperty("vmName")) + object.vmName = message.vmName; + if (message.vmUuid != null && message.hasOwnProperty("vmUuid")) + object.vmUuid = message.vmUuid; + if (message.errors && message.errors.length) { + object.errors = []; + for (var j = 0; j < message.errors.length; ++j) + object.errors[j] = $root.google.cloud.migrationcenter.v1.ImportError.toObject(message.errors[j], options); } - if (message.regionPreferences != null && message.hasOwnProperty("regionPreferences")) - object.regionPreferences = $root.google.cloud.migrationcenter.v1.RegionPreferences.toObject(message.regionPreferences, options); - if (message.commitmentPlan != null && message.hasOwnProperty("commitmentPlan")) - object.commitmentPlan = options.enums === String ? $root.google.cloud.migrationcenter.v1.CommitmentPlan[message.commitmentPlan] === undefined ? message.commitmentPlan : $root.google.cloud.migrationcenter.v1.CommitmentPlan[message.commitmentPlan] : message.commitmentPlan; - if (message.sizingOptimizationStrategy != null && message.hasOwnProperty("sizingOptimizationStrategy")) - object.sizingOptimizationStrategy = options.enums === String ? $root.google.cloud.migrationcenter.v1.SizingOptimizationStrategy[message.sizingOptimizationStrategy] === undefined ? message.sizingOptimizationStrategy : $root.google.cloud.migrationcenter.v1.SizingOptimizationStrategy[message.sizingOptimizationStrategy] : message.sizingOptimizationStrategy; - if (message.computeEnginePreferences != null && message.hasOwnProperty("computeEnginePreferences")) - object.computeEnginePreferences = $root.google.cloud.migrationcenter.v1.ComputeEnginePreferences.toObject(message.computeEnginePreferences, options); return object; }; /** - * Converts this VirtualMachinePreferences to JSON. + * Converts this ImportRowError to JSON. * @function toJSON - * @memberof google.cloud.migrationcenter.v1.VirtualMachinePreferences + * @memberof google.cloud.migrationcenter.v1.ImportRowError * @instance * @returns {Object.} JSON object */ - VirtualMachinePreferences.prototype.toJSON = function toJSON() { + ImportRowError.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for VirtualMachinePreferences + * Gets the default type url for ImportRowError * @function getTypeUrl - * @memberof google.cloud.migrationcenter.v1.VirtualMachinePreferences + * @memberof google.cloud.migrationcenter.v1.ImportRowError * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - VirtualMachinePreferences.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + ImportRowError.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.cloud.migrationcenter.v1.VirtualMachinePreferences"; + return typeUrlPrefix + "/google.cloud.migrationcenter.v1.ImportRowError"; }; - return VirtualMachinePreferences; + return ImportRowError; })(); - v1.ComputeEnginePreferences = (function() { + v1.UploadFileInfo = (function() { /** - * Properties of a ComputeEnginePreferences. + * Properties of an UploadFileInfo. * @memberof google.cloud.migrationcenter.v1 - * @interface IComputeEnginePreferences - * @property {google.cloud.migrationcenter.v1.IMachinePreferences|null} [machinePreferences] ComputeEnginePreferences machinePreferences - * @property {google.cloud.migrationcenter.v1.LicenseType|null} [licenseType] ComputeEnginePreferences licenseType + * @interface IUploadFileInfo + * @property {string|null} [signedUri] UploadFileInfo signedUri + * @property {Object.|null} [headers] UploadFileInfo headers + * @property {google.protobuf.ITimestamp|null} [uriExpirationTime] UploadFileInfo uriExpirationTime */ /** - * Constructs a new ComputeEnginePreferences. + * Constructs a new UploadFileInfo. * @memberof google.cloud.migrationcenter.v1 - * @classdesc Represents a ComputeEnginePreferences. - * @implements IComputeEnginePreferences + * @classdesc Represents an UploadFileInfo. + * @implements IUploadFileInfo * @constructor - * @param {google.cloud.migrationcenter.v1.IComputeEnginePreferences=} [properties] Properties to set + * @param {google.cloud.migrationcenter.v1.IUploadFileInfo=} [properties] Properties to set */ - function ComputeEnginePreferences(properties) { + function UploadFileInfo(properties) { + this.headers = {}; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -43924,89 +43465,123 @@ } /** - * ComputeEnginePreferences machinePreferences. - * @member {google.cloud.migrationcenter.v1.IMachinePreferences|null|undefined} machinePreferences - * @memberof google.cloud.migrationcenter.v1.ComputeEnginePreferences + * UploadFileInfo signedUri. + * @member {string} signedUri + * @memberof google.cloud.migrationcenter.v1.UploadFileInfo * @instance */ - ComputeEnginePreferences.prototype.machinePreferences = null; + UploadFileInfo.prototype.signedUri = ""; /** - * ComputeEnginePreferences licenseType. - * @member {google.cloud.migrationcenter.v1.LicenseType} licenseType - * @memberof google.cloud.migrationcenter.v1.ComputeEnginePreferences + * UploadFileInfo headers. + * @member {Object.} headers + * @memberof google.cloud.migrationcenter.v1.UploadFileInfo * @instance */ - ComputeEnginePreferences.prototype.licenseType = 0; + UploadFileInfo.prototype.headers = $util.emptyObject; /** - * Creates a new ComputeEnginePreferences instance using the specified properties. + * UploadFileInfo uriExpirationTime. + * @member {google.protobuf.ITimestamp|null|undefined} uriExpirationTime + * @memberof google.cloud.migrationcenter.v1.UploadFileInfo + * @instance + */ + UploadFileInfo.prototype.uriExpirationTime = null; + + /** + * Creates a new UploadFileInfo instance using the specified properties. * @function create - * @memberof google.cloud.migrationcenter.v1.ComputeEnginePreferences + * @memberof google.cloud.migrationcenter.v1.UploadFileInfo * @static - * @param {google.cloud.migrationcenter.v1.IComputeEnginePreferences=} [properties] Properties to set - * @returns {google.cloud.migrationcenter.v1.ComputeEnginePreferences} ComputeEnginePreferences instance + * @param {google.cloud.migrationcenter.v1.IUploadFileInfo=} [properties] Properties to set + * @returns {google.cloud.migrationcenter.v1.UploadFileInfo} UploadFileInfo instance */ - ComputeEnginePreferences.create = function create(properties) { - return new ComputeEnginePreferences(properties); + UploadFileInfo.create = function create(properties) { + return new UploadFileInfo(properties); }; /** - * Encodes the specified ComputeEnginePreferences message. Does not implicitly {@link google.cloud.migrationcenter.v1.ComputeEnginePreferences.verify|verify} messages. + * Encodes the specified UploadFileInfo message. Does not implicitly {@link google.cloud.migrationcenter.v1.UploadFileInfo.verify|verify} messages. * @function encode - * @memberof google.cloud.migrationcenter.v1.ComputeEnginePreferences + * @memberof google.cloud.migrationcenter.v1.UploadFileInfo * @static - * @param {google.cloud.migrationcenter.v1.IComputeEnginePreferences} message ComputeEnginePreferences message or plain object to encode + * @param {google.cloud.migrationcenter.v1.IUploadFileInfo} message UploadFileInfo message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ComputeEnginePreferences.encode = function encode(message, writer) { + UploadFileInfo.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.machinePreferences != null && Object.hasOwnProperty.call(message, "machinePreferences")) - $root.google.cloud.migrationcenter.v1.MachinePreferences.encode(message.machinePreferences, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.licenseType != null && Object.hasOwnProperty.call(message, "licenseType")) - writer.uint32(/* id 3, wireType 0 =*/24).int32(message.licenseType); + if (message.signedUri != null && Object.hasOwnProperty.call(message, "signedUri")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.signedUri); + if (message.headers != null && Object.hasOwnProperty.call(message, "headers")) + for (var keys = Object.keys(message.headers), 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.headers[keys[i]]).ldelim(); + if (message.uriExpirationTime != null && Object.hasOwnProperty.call(message, "uriExpirationTime")) + $root.google.protobuf.Timestamp.encode(message.uriExpirationTime, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); return writer; }; /** - * Encodes the specified ComputeEnginePreferences message, length delimited. Does not implicitly {@link google.cloud.migrationcenter.v1.ComputeEnginePreferences.verify|verify} messages. + * Encodes the specified UploadFileInfo message, length delimited. Does not implicitly {@link google.cloud.migrationcenter.v1.UploadFileInfo.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.migrationcenter.v1.ComputeEnginePreferences + * @memberof google.cloud.migrationcenter.v1.UploadFileInfo * @static - * @param {google.cloud.migrationcenter.v1.IComputeEnginePreferences} message ComputeEnginePreferences message or plain object to encode + * @param {google.cloud.migrationcenter.v1.IUploadFileInfo} message UploadFileInfo message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ComputeEnginePreferences.encodeDelimited = function encodeDelimited(message, writer) { + UploadFileInfo.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a ComputeEnginePreferences message from the specified reader or buffer. + * Decodes an UploadFileInfo message from the specified reader or buffer. * @function decode - * @memberof google.cloud.migrationcenter.v1.ComputeEnginePreferences + * @memberof google.cloud.migrationcenter.v1.UploadFileInfo * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.migrationcenter.v1.ComputeEnginePreferences} ComputeEnginePreferences + * @returns {google.cloud.migrationcenter.v1.UploadFileInfo} UploadFileInfo * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - ComputeEnginePreferences.decode = function decode(reader, length) { + UploadFileInfo.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.migrationcenter.v1.ComputeEnginePreferences(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.migrationcenter.v1.UploadFileInfo(), key, value; while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 2: { - message.machinePreferences = $root.google.cloud.migrationcenter.v1.MachinePreferences.decode(reader, reader.uint32()); + case 1: { + message.signedUri = reader.string(); break; } - case 3: { - message.licenseType = reader.int32(); + case 2: { + if (message.headers === $util.emptyObject) + message.headers = {}; + 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.headers[key] = value; + break; + } + case 3: { + message.uriExpirationTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); break; } default: @@ -44018,161 +43593,160 @@ }; /** - * Decodes a ComputeEnginePreferences message from the specified reader or buffer, length delimited. + * Decodes an UploadFileInfo message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.migrationcenter.v1.ComputeEnginePreferences + * @memberof google.cloud.migrationcenter.v1.UploadFileInfo * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.migrationcenter.v1.ComputeEnginePreferences} ComputeEnginePreferences + * @returns {google.cloud.migrationcenter.v1.UploadFileInfo} UploadFileInfo * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - ComputeEnginePreferences.decodeDelimited = function decodeDelimited(reader) { + UploadFileInfo.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a ComputeEnginePreferences message. + * Verifies an UploadFileInfo message. * @function verify - * @memberof google.cloud.migrationcenter.v1.ComputeEnginePreferences + * @memberof google.cloud.migrationcenter.v1.UploadFileInfo * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - ComputeEnginePreferences.verify = function verify(message) { + UploadFileInfo.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.machinePreferences != null && message.hasOwnProperty("machinePreferences")) { - var error = $root.google.cloud.migrationcenter.v1.MachinePreferences.verify(message.machinePreferences); + if (message.signedUri != null && message.hasOwnProperty("signedUri")) + if (!$util.isString(message.signedUri)) + return "signedUri: string expected"; + if (message.headers != null && message.hasOwnProperty("headers")) { + if (!$util.isObject(message.headers)) + return "headers: object expected"; + var key = Object.keys(message.headers); + for (var i = 0; i < key.length; ++i) + if (!$util.isString(message.headers[key[i]])) + return "headers: string{k:string} expected"; + } + if (message.uriExpirationTime != null && message.hasOwnProperty("uriExpirationTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.uriExpirationTime); if (error) - return "machinePreferences." + error; + return "uriExpirationTime." + error; } - if (message.licenseType != null && message.hasOwnProperty("licenseType")) - switch (message.licenseType) { - default: - return "licenseType: enum value expected"; - case 0: - case 1: - case 2: - break; - } return null; }; /** - * Creates a ComputeEnginePreferences message from a plain object. Also converts values to their respective internal types. + * Creates an UploadFileInfo message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.migrationcenter.v1.ComputeEnginePreferences + * @memberof google.cloud.migrationcenter.v1.UploadFileInfo * @static * @param {Object.} object Plain object - * @returns {google.cloud.migrationcenter.v1.ComputeEnginePreferences} ComputeEnginePreferences + * @returns {google.cloud.migrationcenter.v1.UploadFileInfo} UploadFileInfo */ - ComputeEnginePreferences.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.migrationcenter.v1.ComputeEnginePreferences) + UploadFileInfo.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.migrationcenter.v1.UploadFileInfo) return object; - var message = new $root.google.cloud.migrationcenter.v1.ComputeEnginePreferences(); - if (object.machinePreferences != null) { - if (typeof object.machinePreferences !== "object") - throw TypeError(".google.cloud.migrationcenter.v1.ComputeEnginePreferences.machinePreferences: object expected"); - message.machinePreferences = $root.google.cloud.migrationcenter.v1.MachinePreferences.fromObject(object.machinePreferences); + var message = new $root.google.cloud.migrationcenter.v1.UploadFileInfo(); + if (object.signedUri != null) + message.signedUri = String(object.signedUri); + if (object.headers) { + if (typeof object.headers !== "object") + throw TypeError(".google.cloud.migrationcenter.v1.UploadFileInfo.headers: object expected"); + message.headers = {}; + for (var keys = Object.keys(object.headers), i = 0; i < keys.length; ++i) + message.headers[keys[i]] = String(object.headers[keys[i]]); } - switch (object.licenseType) { - default: - if (typeof object.licenseType === "number") { - message.licenseType = object.licenseType; - break; - } - break; - case "LICENSE_TYPE_UNSPECIFIED": - case 0: - message.licenseType = 0; - break; - case "LICENSE_TYPE_DEFAULT": - case 1: - message.licenseType = 1; - break; - case "LICENSE_TYPE_BRING_YOUR_OWN_LICENSE": - case 2: - message.licenseType = 2; - break; + if (object.uriExpirationTime != null) { + if (typeof object.uriExpirationTime !== "object") + throw TypeError(".google.cloud.migrationcenter.v1.UploadFileInfo.uriExpirationTime: object expected"); + message.uriExpirationTime = $root.google.protobuf.Timestamp.fromObject(object.uriExpirationTime); } return message; }; /** - * Creates a plain object from a ComputeEnginePreferences message. Also converts values to other types if specified. + * Creates a plain object from an UploadFileInfo message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.migrationcenter.v1.ComputeEnginePreferences + * @memberof google.cloud.migrationcenter.v1.UploadFileInfo * @static - * @param {google.cloud.migrationcenter.v1.ComputeEnginePreferences} message ComputeEnginePreferences + * @param {google.cloud.migrationcenter.v1.UploadFileInfo} message UploadFileInfo * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - ComputeEnginePreferences.toObject = function toObject(message, options) { + UploadFileInfo.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; + if (options.objects || options.defaults) + object.headers = {}; if (options.defaults) { - object.machinePreferences = null; - object.licenseType = options.enums === String ? "LICENSE_TYPE_UNSPECIFIED" : 0; + object.signedUri = ""; + object.uriExpirationTime = null; } - if (message.machinePreferences != null && message.hasOwnProperty("machinePreferences")) - object.machinePreferences = $root.google.cloud.migrationcenter.v1.MachinePreferences.toObject(message.machinePreferences, options); - if (message.licenseType != null && message.hasOwnProperty("licenseType")) - object.licenseType = options.enums === String ? $root.google.cloud.migrationcenter.v1.LicenseType[message.licenseType] === undefined ? message.licenseType : $root.google.cloud.migrationcenter.v1.LicenseType[message.licenseType] : message.licenseType; + if (message.signedUri != null && message.hasOwnProperty("signedUri")) + object.signedUri = message.signedUri; + var keys2; + if (message.headers && (keys2 = Object.keys(message.headers)).length) { + object.headers = {}; + for (var j = 0; j < keys2.length; ++j) + object.headers[keys2[j]] = message.headers[keys2[j]]; + } + if (message.uriExpirationTime != null && message.hasOwnProperty("uriExpirationTime")) + object.uriExpirationTime = $root.google.protobuf.Timestamp.toObject(message.uriExpirationTime, options); return object; }; /** - * Converts this ComputeEnginePreferences to JSON. + * Converts this UploadFileInfo to JSON. * @function toJSON - * @memberof google.cloud.migrationcenter.v1.ComputeEnginePreferences + * @memberof google.cloud.migrationcenter.v1.UploadFileInfo * @instance * @returns {Object.} JSON object */ - ComputeEnginePreferences.prototype.toJSON = function toJSON() { + UploadFileInfo.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for ComputeEnginePreferences + * Gets the default type url for UploadFileInfo * @function getTypeUrl - * @memberof google.cloud.migrationcenter.v1.ComputeEnginePreferences + * @memberof google.cloud.migrationcenter.v1.UploadFileInfo * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - ComputeEnginePreferences.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + UploadFileInfo.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.cloud.migrationcenter.v1.ComputeEnginePreferences"; + return typeUrlPrefix + "/google.cloud.migrationcenter.v1.UploadFileInfo"; }; - return ComputeEnginePreferences; + return UploadFileInfo; })(); - v1.MachinePreferences = (function() { + v1.AssetList = (function() { /** - * Properties of a MachinePreferences. + * Properties of an AssetList. * @memberof google.cloud.migrationcenter.v1 - * @interface IMachinePreferences - * @property {Array.|null} [allowedMachineSeries] MachinePreferences allowedMachineSeries + * @interface IAssetList + * @property {Array.|null} [assetIds] AssetList assetIds */ /** - * Constructs a new MachinePreferences. + * Constructs a new AssetList. * @memberof google.cloud.migrationcenter.v1 - * @classdesc Represents a MachinePreferences. - * @implements IMachinePreferences + * @classdesc Represents an AssetList. + * @implements IAssetList * @constructor - * @param {google.cloud.migrationcenter.v1.IMachinePreferences=} [properties] Properties to set + * @param {google.cloud.migrationcenter.v1.IAssetList=} [properties] Properties to set */ - function MachinePreferences(properties) { - this.allowedMachineSeries = []; + function AssetList(properties) { + this.assetIds = []; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -44180,78 +43754,78 @@ } /** - * MachinePreferences allowedMachineSeries. - * @member {Array.} allowedMachineSeries - * @memberof google.cloud.migrationcenter.v1.MachinePreferences + * AssetList assetIds. + * @member {Array.} assetIds + * @memberof google.cloud.migrationcenter.v1.AssetList * @instance */ - MachinePreferences.prototype.allowedMachineSeries = $util.emptyArray; + AssetList.prototype.assetIds = $util.emptyArray; /** - * Creates a new MachinePreferences instance using the specified properties. + * Creates a new AssetList instance using the specified properties. * @function create - * @memberof google.cloud.migrationcenter.v1.MachinePreferences + * @memberof google.cloud.migrationcenter.v1.AssetList * @static - * @param {google.cloud.migrationcenter.v1.IMachinePreferences=} [properties] Properties to set - * @returns {google.cloud.migrationcenter.v1.MachinePreferences} MachinePreferences instance + * @param {google.cloud.migrationcenter.v1.IAssetList=} [properties] Properties to set + * @returns {google.cloud.migrationcenter.v1.AssetList} AssetList instance */ - MachinePreferences.create = function create(properties) { - return new MachinePreferences(properties); + AssetList.create = function create(properties) { + return new AssetList(properties); }; /** - * Encodes the specified MachinePreferences message. Does not implicitly {@link google.cloud.migrationcenter.v1.MachinePreferences.verify|verify} messages. + * Encodes the specified AssetList message. Does not implicitly {@link google.cloud.migrationcenter.v1.AssetList.verify|verify} messages. * @function encode - * @memberof google.cloud.migrationcenter.v1.MachinePreferences + * @memberof google.cloud.migrationcenter.v1.AssetList * @static - * @param {google.cloud.migrationcenter.v1.IMachinePreferences} message MachinePreferences message or plain object to encode + * @param {google.cloud.migrationcenter.v1.IAssetList} message AssetList message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - MachinePreferences.encode = function encode(message, writer) { + AssetList.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.allowedMachineSeries != null && message.allowedMachineSeries.length) - for (var i = 0; i < message.allowedMachineSeries.length; ++i) - $root.google.cloud.migrationcenter.v1.MachineSeries.encode(message.allowedMachineSeries[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.assetIds != null && message.assetIds.length) + for (var i = 0; i < message.assetIds.length; ++i) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.assetIds[i]); return writer; }; /** - * Encodes the specified MachinePreferences message, length delimited. Does not implicitly {@link google.cloud.migrationcenter.v1.MachinePreferences.verify|verify} messages. + * Encodes the specified AssetList message, length delimited. Does not implicitly {@link google.cloud.migrationcenter.v1.AssetList.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.migrationcenter.v1.MachinePreferences + * @memberof google.cloud.migrationcenter.v1.AssetList * @static - * @param {google.cloud.migrationcenter.v1.IMachinePreferences} message MachinePreferences message or plain object to encode + * @param {google.cloud.migrationcenter.v1.IAssetList} message AssetList message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - MachinePreferences.encodeDelimited = function encodeDelimited(message, writer) { + AssetList.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a MachinePreferences message from the specified reader or buffer. + * Decodes an AssetList message from the specified reader or buffer. * @function decode - * @memberof google.cloud.migrationcenter.v1.MachinePreferences + * @memberof google.cloud.migrationcenter.v1.AssetList * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.migrationcenter.v1.MachinePreferences} MachinePreferences + * @returns {google.cloud.migrationcenter.v1.AssetList} AssetList * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - MachinePreferences.decode = function decode(reader, length) { + AssetList.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.migrationcenter.v1.MachinePreferences(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.migrationcenter.v1.AssetList(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: { - if (!(message.allowedMachineSeries && message.allowedMachineSeries.length)) - message.allowedMachineSeries = []; - message.allowedMachineSeries.push($root.google.cloud.migrationcenter.v1.MachineSeries.decode(reader, reader.uint32())); + if (!(message.assetIds && message.assetIds.length)) + message.assetIds = []; + message.assetIds.push(reader.string()); break; } default: @@ -44263,139 +43837,135 @@ }; /** - * Decodes a MachinePreferences message from the specified reader or buffer, length delimited. + * Decodes an AssetList message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.migrationcenter.v1.MachinePreferences + * @memberof google.cloud.migrationcenter.v1.AssetList * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.migrationcenter.v1.MachinePreferences} MachinePreferences + * @returns {google.cloud.migrationcenter.v1.AssetList} AssetList * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - MachinePreferences.decodeDelimited = function decodeDelimited(reader) { + AssetList.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a MachinePreferences message. + * Verifies an AssetList message. * @function verify - * @memberof google.cloud.migrationcenter.v1.MachinePreferences + * @memberof google.cloud.migrationcenter.v1.AssetList * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - MachinePreferences.verify = function verify(message) { + AssetList.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.allowedMachineSeries != null && message.hasOwnProperty("allowedMachineSeries")) { - if (!Array.isArray(message.allowedMachineSeries)) - return "allowedMachineSeries: array expected"; - for (var i = 0; i < message.allowedMachineSeries.length; ++i) { - var error = $root.google.cloud.migrationcenter.v1.MachineSeries.verify(message.allowedMachineSeries[i]); - if (error) - return "allowedMachineSeries." + error; - } + if (message.assetIds != null && message.hasOwnProperty("assetIds")) { + if (!Array.isArray(message.assetIds)) + return "assetIds: array expected"; + for (var i = 0; i < message.assetIds.length; ++i) + if (!$util.isString(message.assetIds[i])) + return "assetIds: string[] expected"; } return null; }; /** - * Creates a MachinePreferences message from a plain object. Also converts values to their respective internal types. + * Creates an AssetList message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.migrationcenter.v1.MachinePreferences + * @memberof google.cloud.migrationcenter.v1.AssetList * @static * @param {Object.} object Plain object - * @returns {google.cloud.migrationcenter.v1.MachinePreferences} MachinePreferences + * @returns {google.cloud.migrationcenter.v1.AssetList} AssetList */ - MachinePreferences.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.migrationcenter.v1.MachinePreferences) + AssetList.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.migrationcenter.v1.AssetList) return object; - var message = new $root.google.cloud.migrationcenter.v1.MachinePreferences(); - if (object.allowedMachineSeries) { - if (!Array.isArray(object.allowedMachineSeries)) - throw TypeError(".google.cloud.migrationcenter.v1.MachinePreferences.allowedMachineSeries: array expected"); - message.allowedMachineSeries = []; - for (var i = 0; i < object.allowedMachineSeries.length; ++i) { - if (typeof object.allowedMachineSeries[i] !== "object") - throw TypeError(".google.cloud.migrationcenter.v1.MachinePreferences.allowedMachineSeries: object expected"); - message.allowedMachineSeries[i] = $root.google.cloud.migrationcenter.v1.MachineSeries.fromObject(object.allowedMachineSeries[i]); - } + var message = new $root.google.cloud.migrationcenter.v1.AssetList(); + if (object.assetIds) { + if (!Array.isArray(object.assetIds)) + throw TypeError(".google.cloud.migrationcenter.v1.AssetList.assetIds: array expected"); + message.assetIds = []; + for (var i = 0; i < object.assetIds.length; ++i) + message.assetIds[i] = String(object.assetIds[i]); } return message; }; /** - * Creates a plain object from a MachinePreferences message. Also converts values to other types if specified. + * Creates a plain object from an AssetList message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.migrationcenter.v1.MachinePreferences + * @memberof google.cloud.migrationcenter.v1.AssetList * @static - * @param {google.cloud.migrationcenter.v1.MachinePreferences} message MachinePreferences + * @param {google.cloud.migrationcenter.v1.AssetList} message AssetList * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - MachinePreferences.toObject = function toObject(message, options) { + AssetList.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; if (options.arrays || options.defaults) - object.allowedMachineSeries = []; - if (message.allowedMachineSeries && message.allowedMachineSeries.length) { - object.allowedMachineSeries = []; - for (var j = 0; j < message.allowedMachineSeries.length; ++j) - object.allowedMachineSeries[j] = $root.google.cloud.migrationcenter.v1.MachineSeries.toObject(message.allowedMachineSeries[j], options); + object.assetIds = []; + if (message.assetIds && message.assetIds.length) { + object.assetIds = []; + for (var j = 0; j < message.assetIds.length; ++j) + object.assetIds[j] = message.assetIds[j]; } return object; }; /** - * Converts this MachinePreferences to JSON. + * Converts this AssetList to JSON. * @function toJSON - * @memberof google.cloud.migrationcenter.v1.MachinePreferences + * @memberof google.cloud.migrationcenter.v1.AssetList * @instance * @returns {Object.} JSON object */ - MachinePreferences.prototype.toJSON = function toJSON() { + AssetList.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for MachinePreferences + * Gets the default type url for AssetList * @function getTypeUrl - * @memberof google.cloud.migrationcenter.v1.MachinePreferences + * @memberof google.cloud.migrationcenter.v1.AssetList * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - MachinePreferences.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + AssetList.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.cloud.migrationcenter.v1.MachinePreferences"; + return typeUrlPrefix + "/google.cloud.migrationcenter.v1.AssetList"; }; - return MachinePreferences; + return AssetList; })(); - v1.MachineSeries = (function() { + v1.FrameViolationEntry = (function() { /** - * Properties of a MachineSeries. + * Properties of a FrameViolationEntry. * @memberof google.cloud.migrationcenter.v1 - * @interface IMachineSeries - * @property {string|null} [code] MachineSeries code + * @interface IFrameViolationEntry + * @property {string|null} [field] FrameViolationEntry field + * @property {string|null} [violation] FrameViolationEntry violation */ /** - * Constructs a new MachineSeries. + * Constructs a new FrameViolationEntry. * @memberof google.cloud.migrationcenter.v1 - * @classdesc Represents a MachineSeries. - * @implements IMachineSeries + * @classdesc Represents a FrameViolationEntry. + * @implements IFrameViolationEntry * @constructor - * @param {google.cloud.migrationcenter.v1.IMachineSeries=} [properties] Properties to set + * @param {google.cloud.migrationcenter.v1.IFrameViolationEntry=} [properties] Properties to set */ - function MachineSeries(properties) { + function FrameViolationEntry(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -44403,75 +43973,89 @@ } /** - * MachineSeries code. - * @member {string} code - * @memberof google.cloud.migrationcenter.v1.MachineSeries + * FrameViolationEntry field. + * @member {string} field + * @memberof google.cloud.migrationcenter.v1.FrameViolationEntry * @instance */ - MachineSeries.prototype.code = ""; + FrameViolationEntry.prototype.field = ""; /** - * Creates a new MachineSeries instance using the specified properties. + * FrameViolationEntry violation. + * @member {string} violation + * @memberof google.cloud.migrationcenter.v1.FrameViolationEntry + * @instance + */ + FrameViolationEntry.prototype.violation = ""; + + /** + * Creates a new FrameViolationEntry instance using the specified properties. * @function create - * @memberof google.cloud.migrationcenter.v1.MachineSeries + * @memberof google.cloud.migrationcenter.v1.FrameViolationEntry * @static - * @param {google.cloud.migrationcenter.v1.IMachineSeries=} [properties] Properties to set - * @returns {google.cloud.migrationcenter.v1.MachineSeries} MachineSeries instance + * @param {google.cloud.migrationcenter.v1.IFrameViolationEntry=} [properties] Properties to set + * @returns {google.cloud.migrationcenter.v1.FrameViolationEntry} FrameViolationEntry instance */ - MachineSeries.create = function create(properties) { - return new MachineSeries(properties); + FrameViolationEntry.create = function create(properties) { + return new FrameViolationEntry(properties); }; /** - * Encodes the specified MachineSeries message. Does not implicitly {@link google.cloud.migrationcenter.v1.MachineSeries.verify|verify} messages. + * Encodes the specified FrameViolationEntry message. Does not implicitly {@link google.cloud.migrationcenter.v1.FrameViolationEntry.verify|verify} messages. * @function encode - * @memberof google.cloud.migrationcenter.v1.MachineSeries + * @memberof google.cloud.migrationcenter.v1.FrameViolationEntry * @static - * @param {google.cloud.migrationcenter.v1.IMachineSeries} message MachineSeries message or plain object to encode + * @param {google.cloud.migrationcenter.v1.IFrameViolationEntry} message FrameViolationEntry message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - MachineSeries.encode = function encode(message, writer) { + FrameViolationEntry.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.code != null && Object.hasOwnProperty.call(message, "code")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.code); + if (message.field != null && Object.hasOwnProperty.call(message, "field")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.field); + if (message.violation != null && Object.hasOwnProperty.call(message, "violation")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.violation); return writer; }; /** - * Encodes the specified MachineSeries message, length delimited. Does not implicitly {@link google.cloud.migrationcenter.v1.MachineSeries.verify|verify} messages. + * Encodes the specified FrameViolationEntry message, length delimited. Does not implicitly {@link google.cloud.migrationcenter.v1.FrameViolationEntry.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.migrationcenter.v1.MachineSeries + * @memberof google.cloud.migrationcenter.v1.FrameViolationEntry * @static - * @param {google.cloud.migrationcenter.v1.IMachineSeries} message MachineSeries message or plain object to encode + * @param {google.cloud.migrationcenter.v1.IFrameViolationEntry} message FrameViolationEntry message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - MachineSeries.encodeDelimited = function encodeDelimited(message, writer) { + FrameViolationEntry.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a MachineSeries message from the specified reader or buffer. + * Decodes a FrameViolationEntry message from the specified reader or buffer. * @function decode - * @memberof google.cloud.migrationcenter.v1.MachineSeries + * @memberof google.cloud.migrationcenter.v1.FrameViolationEntry * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.migrationcenter.v1.MachineSeries} MachineSeries + * @returns {google.cloud.migrationcenter.v1.FrameViolationEntry} FrameViolationEntry * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - MachineSeries.decode = function decode(reader, length) { + FrameViolationEntry.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.migrationcenter.v1.MachineSeries(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.migrationcenter.v1.FrameViolationEntry(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: { - message.code = reader.string(); + message.field = reader.string(); + break; + } + case 2: { + message.violation = reader.string(); break; } default: @@ -44483,123 +44067,137 @@ }; /** - * Decodes a MachineSeries message from the specified reader or buffer, length delimited. + * Decodes a FrameViolationEntry message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.migrationcenter.v1.MachineSeries + * @memberof google.cloud.migrationcenter.v1.FrameViolationEntry * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.migrationcenter.v1.MachineSeries} MachineSeries + * @returns {google.cloud.migrationcenter.v1.FrameViolationEntry} FrameViolationEntry * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - MachineSeries.decodeDelimited = function decodeDelimited(reader) { + FrameViolationEntry.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a MachineSeries message. + * Verifies a FrameViolationEntry message. * @function verify - * @memberof google.cloud.migrationcenter.v1.MachineSeries + * @memberof google.cloud.migrationcenter.v1.FrameViolationEntry * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - MachineSeries.verify = function verify(message) { + FrameViolationEntry.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.code != null && message.hasOwnProperty("code")) - if (!$util.isString(message.code)) - return "code: string expected"; + if (message.field != null && message.hasOwnProperty("field")) + if (!$util.isString(message.field)) + return "field: string expected"; + if (message.violation != null && message.hasOwnProperty("violation")) + if (!$util.isString(message.violation)) + return "violation: string expected"; return null; }; /** - * Creates a MachineSeries message from a plain object. Also converts values to their respective internal types. + * Creates a FrameViolationEntry message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.migrationcenter.v1.MachineSeries + * @memberof google.cloud.migrationcenter.v1.FrameViolationEntry * @static * @param {Object.} object Plain object - * @returns {google.cloud.migrationcenter.v1.MachineSeries} MachineSeries + * @returns {google.cloud.migrationcenter.v1.FrameViolationEntry} FrameViolationEntry */ - MachineSeries.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.migrationcenter.v1.MachineSeries) + FrameViolationEntry.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.migrationcenter.v1.FrameViolationEntry) return object; - var message = new $root.google.cloud.migrationcenter.v1.MachineSeries(); - if (object.code != null) - message.code = String(object.code); + var message = new $root.google.cloud.migrationcenter.v1.FrameViolationEntry(); + if (object.field != null) + message.field = String(object.field); + if (object.violation != null) + message.violation = String(object.violation); return message; }; /** - * Creates a plain object from a MachineSeries message. Also converts values to other types if specified. + * Creates a plain object from a FrameViolationEntry message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.migrationcenter.v1.MachineSeries + * @memberof google.cloud.migrationcenter.v1.FrameViolationEntry * @static - * @param {google.cloud.migrationcenter.v1.MachineSeries} message MachineSeries + * @param {google.cloud.migrationcenter.v1.FrameViolationEntry} message FrameViolationEntry * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - MachineSeries.toObject = function toObject(message, options) { + FrameViolationEntry.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.defaults) - object.code = ""; - if (message.code != null && message.hasOwnProperty("code")) - object.code = message.code; + if (options.defaults) { + object.field = ""; + object.violation = ""; + } + if (message.field != null && message.hasOwnProperty("field")) + object.field = message.field; + if (message.violation != null && message.hasOwnProperty("violation")) + object.violation = message.violation; return object; }; /** - * Converts this MachineSeries to JSON. + * Converts this FrameViolationEntry to JSON. * @function toJSON - * @memberof google.cloud.migrationcenter.v1.MachineSeries + * @memberof google.cloud.migrationcenter.v1.FrameViolationEntry * @instance * @returns {Object.} JSON object */ - MachineSeries.prototype.toJSON = function toJSON() { + FrameViolationEntry.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for MachineSeries + * Gets the default type url for FrameViolationEntry * @function getTypeUrl - * @memberof google.cloud.migrationcenter.v1.MachineSeries + * @memberof google.cloud.migrationcenter.v1.FrameViolationEntry * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - MachineSeries.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + FrameViolationEntry.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.cloud.migrationcenter.v1.MachineSeries"; + return typeUrlPrefix + "/google.cloud.migrationcenter.v1.FrameViolationEntry"; }; - return MachineSeries; + return FrameViolationEntry; })(); - v1.RegionPreferences = (function() { + v1.VirtualMachinePreferences = (function() { /** - * Properties of a RegionPreferences. + * Properties of a VirtualMachinePreferences. * @memberof google.cloud.migrationcenter.v1 - * @interface IRegionPreferences - * @property {Array.|null} [preferredRegions] RegionPreferences preferredRegions + * @interface IVirtualMachinePreferences + * @property {google.cloud.migrationcenter.v1.ComputeMigrationTargetProduct|null} [targetProduct] VirtualMachinePreferences targetProduct + * @property {google.cloud.migrationcenter.v1.IRegionPreferences|null} [regionPreferences] VirtualMachinePreferences regionPreferences + * @property {google.cloud.migrationcenter.v1.CommitmentPlan|null} [commitmentPlan] VirtualMachinePreferences commitmentPlan + * @property {google.cloud.migrationcenter.v1.SizingOptimizationStrategy|null} [sizingOptimizationStrategy] VirtualMachinePreferences sizingOptimizationStrategy + * @property {google.cloud.migrationcenter.v1.IComputeEnginePreferences|null} [computeEnginePreferences] VirtualMachinePreferences computeEnginePreferences + * @property {google.cloud.migrationcenter.v1.IVmwareEnginePreferences|null} [vmwareEnginePreferences] VirtualMachinePreferences vmwareEnginePreferences + * @property {google.cloud.migrationcenter.v1.ISoleTenancyPreferences|null} [soleTenancyPreferences] VirtualMachinePreferences soleTenancyPreferences */ /** - * Constructs a new RegionPreferences. + * Constructs a new VirtualMachinePreferences. * @memberof google.cloud.migrationcenter.v1 - * @classdesc Represents a RegionPreferences. - * @implements IRegionPreferences + * @classdesc Represents a VirtualMachinePreferences. + * @implements IVirtualMachinePreferences * @constructor - * @param {google.cloud.migrationcenter.v1.IRegionPreferences=} [properties] Properties to set + * @param {google.cloud.migrationcenter.v1.IVirtualMachinePreferences=} [properties] Properties to set */ - function RegionPreferences(properties) { - this.preferredRegions = []; + function VirtualMachinePreferences(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -44607,78 +44205,159 @@ } /** - * RegionPreferences preferredRegions. - * @member {Array.} preferredRegions - * @memberof google.cloud.migrationcenter.v1.RegionPreferences + * VirtualMachinePreferences targetProduct. + * @member {google.cloud.migrationcenter.v1.ComputeMigrationTargetProduct} targetProduct + * @memberof google.cloud.migrationcenter.v1.VirtualMachinePreferences * @instance */ - RegionPreferences.prototype.preferredRegions = $util.emptyArray; + VirtualMachinePreferences.prototype.targetProduct = 0; /** - * Creates a new RegionPreferences instance using the specified properties. + * VirtualMachinePreferences regionPreferences. + * @member {google.cloud.migrationcenter.v1.IRegionPreferences|null|undefined} regionPreferences + * @memberof google.cloud.migrationcenter.v1.VirtualMachinePreferences + * @instance + */ + VirtualMachinePreferences.prototype.regionPreferences = null; + + /** + * VirtualMachinePreferences commitmentPlan. + * @member {google.cloud.migrationcenter.v1.CommitmentPlan} commitmentPlan + * @memberof google.cloud.migrationcenter.v1.VirtualMachinePreferences + * @instance + */ + VirtualMachinePreferences.prototype.commitmentPlan = 0; + + /** + * VirtualMachinePreferences sizingOptimizationStrategy. + * @member {google.cloud.migrationcenter.v1.SizingOptimizationStrategy} sizingOptimizationStrategy + * @memberof google.cloud.migrationcenter.v1.VirtualMachinePreferences + * @instance + */ + VirtualMachinePreferences.prototype.sizingOptimizationStrategy = 0; + + /** + * VirtualMachinePreferences computeEnginePreferences. + * @member {google.cloud.migrationcenter.v1.IComputeEnginePreferences|null|undefined} computeEnginePreferences + * @memberof google.cloud.migrationcenter.v1.VirtualMachinePreferences + * @instance + */ + VirtualMachinePreferences.prototype.computeEnginePreferences = null; + + /** + * VirtualMachinePreferences vmwareEnginePreferences. + * @member {google.cloud.migrationcenter.v1.IVmwareEnginePreferences|null|undefined} vmwareEnginePreferences + * @memberof google.cloud.migrationcenter.v1.VirtualMachinePreferences + * @instance + */ + VirtualMachinePreferences.prototype.vmwareEnginePreferences = null; + + /** + * VirtualMachinePreferences soleTenancyPreferences. + * @member {google.cloud.migrationcenter.v1.ISoleTenancyPreferences|null|undefined} soleTenancyPreferences + * @memberof google.cloud.migrationcenter.v1.VirtualMachinePreferences + * @instance + */ + VirtualMachinePreferences.prototype.soleTenancyPreferences = null; + + /** + * Creates a new VirtualMachinePreferences instance using the specified properties. * @function create - * @memberof google.cloud.migrationcenter.v1.RegionPreferences + * @memberof google.cloud.migrationcenter.v1.VirtualMachinePreferences * @static - * @param {google.cloud.migrationcenter.v1.IRegionPreferences=} [properties] Properties to set - * @returns {google.cloud.migrationcenter.v1.RegionPreferences} RegionPreferences instance + * @param {google.cloud.migrationcenter.v1.IVirtualMachinePreferences=} [properties] Properties to set + * @returns {google.cloud.migrationcenter.v1.VirtualMachinePreferences} VirtualMachinePreferences instance */ - RegionPreferences.create = function create(properties) { - return new RegionPreferences(properties); + VirtualMachinePreferences.create = function create(properties) { + return new VirtualMachinePreferences(properties); }; /** - * Encodes the specified RegionPreferences message. Does not implicitly {@link google.cloud.migrationcenter.v1.RegionPreferences.verify|verify} messages. + * Encodes the specified VirtualMachinePreferences message. Does not implicitly {@link google.cloud.migrationcenter.v1.VirtualMachinePreferences.verify|verify} messages. * @function encode - * @memberof google.cloud.migrationcenter.v1.RegionPreferences + * @memberof google.cloud.migrationcenter.v1.VirtualMachinePreferences * @static - * @param {google.cloud.migrationcenter.v1.IRegionPreferences} message RegionPreferences message or plain object to encode + * @param {google.cloud.migrationcenter.v1.IVirtualMachinePreferences} message VirtualMachinePreferences message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - RegionPreferences.encode = function encode(message, writer) { + VirtualMachinePreferences.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.preferredRegions != null && message.preferredRegions.length) - for (var i = 0; i < message.preferredRegions.length; ++i) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.preferredRegions[i]); + if (message.targetProduct != null && Object.hasOwnProperty.call(message, "targetProduct")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.targetProduct); + if (message.regionPreferences != null && Object.hasOwnProperty.call(message, "regionPreferences")) + $root.google.cloud.migrationcenter.v1.RegionPreferences.encode(message.regionPreferences, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.commitmentPlan != null && Object.hasOwnProperty.call(message, "commitmentPlan")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.commitmentPlan); + if (message.sizingOptimizationStrategy != null && Object.hasOwnProperty.call(message, "sizingOptimizationStrategy")) + writer.uint32(/* id 5, wireType 0 =*/40).int32(message.sizingOptimizationStrategy); + if (message.computeEnginePreferences != null && Object.hasOwnProperty.call(message, "computeEnginePreferences")) + $root.google.cloud.migrationcenter.v1.ComputeEnginePreferences.encode(message.computeEnginePreferences, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + if (message.vmwareEnginePreferences != null && Object.hasOwnProperty.call(message, "vmwareEnginePreferences")) + $root.google.cloud.migrationcenter.v1.VmwareEnginePreferences.encode(message.vmwareEnginePreferences, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + if (message.soleTenancyPreferences != null && Object.hasOwnProperty.call(message, "soleTenancyPreferences")) + $root.google.cloud.migrationcenter.v1.SoleTenancyPreferences.encode(message.soleTenancyPreferences, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); return writer; }; /** - * Encodes the specified RegionPreferences message, length delimited. Does not implicitly {@link google.cloud.migrationcenter.v1.RegionPreferences.verify|verify} messages. + * Encodes the specified VirtualMachinePreferences message, length delimited. Does not implicitly {@link google.cloud.migrationcenter.v1.VirtualMachinePreferences.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.migrationcenter.v1.RegionPreferences + * @memberof google.cloud.migrationcenter.v1.VirtualMachinePreferences * @static - * @param {google.cloud.migrationcenter.v1.IRegionPreferences} message RegionPreferences message or plain object to encode + * @param {google.cloud.migrationcenter.v1.IVirtualMachinePreferences} message VirtualMachinePreferences message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - RegionPreferences.encodeDelimited = function encodeDelimited(message, writer) { + VirtualMachinePreferences.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a RegionPreferences message from the specified reader or buffer. + * Decodes a VirtualMachinePreferences message from the specified reader or buffer. * @function decode - * @memberof google.cloud.migrationcenter.v1.RegionPreferences + * @memberof google.cloud.migrationcenter.v1.VirtualMachinePreferences * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.migrationcenter.v1.RegionPreferences} RegionPreferences + * @returns {google.cloud.migrationcenter.v1.VirtualMachinePreferences} VirtualMachinePreferences * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - RegionPreferences.decode = function decode(reader, length) { + VirtualMachinePreferences.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.migrationcenter.v1.RegionPreferences(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.migrationcenter.v1.VirtualMachinePreferences(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: { - if (!(message.preferredRegions && message.preferredRegions.length)) - message.preferredRegions = []; - message.preferredRegions.push(reader.string()); + case 2: { + message.targetProduct = reader.int32(); + break; + } + case 3: { + message.regionPreferences = $root.google.cloud.migrationcenter.v1.RegionPreferences.decode(reader, reader.uint32()); + break; + } + case 4: { + message.commitmentPlan = reader.int32(); + break; + } + case 5: { + message.sizingOptimizationStrategy = reader.int32(); + break; + } + case 6: { + message.computeEnginePreferences = $root.google.cloud.migrationcenter.v1.ComputeEnginePreferences.decode(reader, reader.uint32()); + break; + } + case 7: { + message.vmwareEnginePreferences = $root.google.cloud.migrationcenter.v1.VmwareEnginePreferences.decode(reader, reader.uint32()); + break; + } + case 8: { + message.soleTenancyPreferences = $root.google.cloud.migrationcenter.v1.SoleTenancyPreferences.decode(reader, reader.uint32()); break; } default: @@ -44690,135 +44369,279 @@ }; /** - * Decodes a RegionPreferences message from the specified reader or buffer, length delimited. + * Decodes a VirtualMachinePreferences message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.migrationcenter.v1.RegionPreferences + * @memberof google.cloud.migrationcenter.v1.VirtualMachinePreferences * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.migrationcenter.v1.RegionPreferences} RegionPreferences + * @returns {google.cloud.migrationcenter.v1.VirtualMachinePreferences} VirtualMachinePreferences * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - RegionPreferences.decodeDelimited = function decodeDelimited(reader) { + VirtualMachinePreferences.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a RegionPreferences message. + * Verifies a VirtualMachinePreferences message. * @function verify - * @memberof google.cloud.migrationcenter.v1.RegionPreferences + * @memberof google.cloud.migrationcenter.v1.VirtualMachinePreferences * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - RegionPreferences.verify = function verify(message) { + VirtualMachinePreferences.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.preferredRegions != null && message.hasOwnProperty("preferredRegions")) { - if (!Array.isArray(message.preferredRegions)) - return "preferredRegions: array expected"; - for (var i = 0; i < message.preferredRegions.length; ++i) - if (!$util.isString(message.preferredRegions[i])) - return "preferredRegions: string[] expected"; + if (message.targetProduct != null && message.hasOwnProperty("targetProduct")) + switch (message.targetProduct) { + default: + return "targetProduct: enum value expected"; + case 0: + case 1: + case 2: + case 3: + break; + } + if (message.regionPreferences != null && message.hasOwnProperty("regionPreferences")) { + var error = $root.google.cloud.migrationcenter.v1.RegionPreferences.verify(message.regionPreferences); + if (error) + return "regionPreferences." + error; + } + if (message.commitmentPlan != null && message.hasOwnProperty("commitmentPlan")) + switch (message.commitmentPlan) { + default: + return "commitmentPlan: enum value expected"; + case 0: + case 1: + case 2: + case 3: + break; + } + if (message.sizingOptimizationStrategy != null && message.hasOwnProperty("sizingOptimizationStrategy")) + switch (message.sizingOptimizationStrategy) { + default: + return "sizingOptimizationStrategy: enum value expected"; + case 0: + case 1: + case 2: + case 3: + break; + } + if (message.computeEnginePreferences != null && message.hasOwnProperty("computeEnginePreferences")) { + var error = $root.google.cloud.migrationcenter.v1.ComputeEnginePreferences.verify(message.computeEnginePreferences); + if (error) + return "computeEnginePreferences." + error; + } + if (message.vmwareEnginePreferences != null && message.hasOwnProperty("vmwareEnginePreferences")) { + var error = $root.google.cloud.migrationcenter.v1.VmwareEnginePreferences.verify(message.vmwareEnginePreferences); + if (error) + return "vmwareEnginePreferences." + error; + } + if (message.soleTenancyPreferences != null && message.hasOwnProperty("soleTenancyPreferences")) { + var error = $root.google.cloud.migrationcenter.v1.SoleTenancyPreferences.verify(message.soleTenancyPreferences); + if (error) + return "soleTenancyPreferences." + error; } return null; }; /** - * Creates a RegionPreferences message from a plain object. Also converts values to their respective internal types. + * Creates a VirtualMachinePreferences message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.migrationcenter.v1.RegionPreferences + * @memberof google.cloud.migrationcenter.v1.VirtualMachinePreferences * @static * @param {Object.} object Plain object - * @returns {google.cloud.migrationcenter.v1.RegionPreferences} RegionPreferences + * @returns {google.cloud.migrationcenter.v1.VirtualMachinePreferences} VirtualMachinePreferences */ - RegionPreferences.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.migrationcenter.v1.RegionPreferences) + VirtualMachinePreferences.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.migrationcenter.v1.VirtualMachinePreferences) return object; - var message = new $root.google.cloud.migrationcenter.v1.RegionPreferences(); - if (object.preferredRegions) { - if (!Array.isArray(object.preferredRegions)) - throw TypeError(".google.cloud.migrationcenter.v1.RegionPreferences.preferredRegions: array expected"); - message.preferredRegions = []; - for (var i = 0; i < object.preferredRegions.length; ++i) - message.preferredRegions[i] = String(object.preferredRegions[i]); + var message = new $root.google.cloud.migrationcenter.v1.VirtualMachinePreferences(); + switch (object.targetProduct) { + default: + if (typeof object.targetProduct === "number") { + message.targetProduct = object.targetProduct; + break; + } + break; + case "COMPUTE_MIGRATION_TARGET_PRODUCT_UNSPECIFIED": + case 0: + message.targetProduct = 0; + break; + case "COMPUTE_MIGRATION_TARGET_PRODUCT_COMPUTE_ENGINE": + case 1: + message.targetProduct = 1; + break; + case "COMPUTE_MIGRATION_TARGET_PRODUCT_VMWARE_ENGINE": + case 2: + message.targetProduct = 2; + break; + case "COMPUTE_MIGRATION_TARGET_PRODUCT_SOLE_TENANCY": + case 3: + message.targetProduct = 3; + break; } - return message; - }; - - /** - * Creates a plain object from a RegionPreferences message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.migrationcenter.v1.RegionPreferences - * @static - * @param {google.cloud.migrationcenter.v1.RegionPreferences} message RegionPreferences - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - RegionPreferences.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.preferredRegions = []; - if (message.preferredRegions && message.preferredRegions.length) { - object.preferredRegions = []; - for (var j = 0; j < message.preferredRegions.length; ++j) - object.preferredRegions[j] = message.preferredRegions[j]; + if (object.regionPreferences != null) { + if (typeof object.regionPreferences !== "object") + throw TypeError(".google.cloud.migrationcenter.v1.VirtualMachinePreferences.regionPreferences: object expected"); + message.regionPreferences = $root.google.cloud.migrationcenter.v1.RegionPreferences.fromObject(object.regionPreferences); } - return object; - }; - - /** - * Converts this RegionPreferences to JSON. - * @function toJSON - * @memberof google.cloud.migrationcenter.v1.RegionPreferences - * @instance - * @returns {Object.} JSON object - */ - RegionPreferences.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for RegionPreferences - * @function getTypeUrl - * @memberof google.cloud.migrationcenter.v1.RegionPreferences - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url + switch (object.commitmentPlan) { + default: + if (typeof object.commitmentPlan === "number") { + message.commitmentPlan = object.commitmentPlan; + break; + } + break; + case "COMMITMENT_PLAN_UNSPECIFIED": + case 0: + message.commitmentPlan = 0; + break; + case "COMMITMENT_PLAN_NONE": + case 1: + message.commitmentPlan = 1; + break; + case "COMMITMENT_PLAN_ONE_YEAR": + case 2: + message.commitmentPlan = 2; + break; + case "COMMITMENT_PLAN_THREE_YEARS": + case 3: + message.commitmentPlan = 3; + break; + } + switch (object.sizingOptimizationStrategy) { + default: + if (typeof object.sizingOptimizationStrategy === "number") { + message.sizingOptimizationStrategy = object.sizingOptimizationStrategy; + break; + } + break; + case "SIZING_OPTIMIZATION_STRATEGY_UNSPECIFIED": + case 0: + message.sizingOptimizationStrategy = 0; + break; + case "SIZING_OPTIMIZATION_STRATEGY_SAME_AS_SOURCE": + case 1: + message.sizingOptimizationStrategy = 1; + break; + case "SIZING_OPTIMIZATION_STRATEGY_MODERATE": + case 2: + message.sizingOptimizationStrategy = 2; + break; + case "SIZING_OPTIMIZATION_STRATEGY_AGGRESSIVE": + case 3: + message.sizingOptimizationStrategy = 3; + break; + } + if (object.computeEnginePreferences != null) { + if (typeof object.computeEnginePreferences !== "object") + throw TypeError(".google.cloud.migrationcenter.v1.VirtualMachinePreferences.computeEnginePreferences: object expected"); + message.computeEnginePreferences = $root.google.cloud.migrationcenter.v1.ComputeEnginePreferences.fromObject(object.computeEnginePreferences); + } + if (object.vmwareEnginePreferences != null) { + if (typeof object.vmwareEnginePreferences !== "object") + throw TypeError(".google.cloud.migrationcenter.v1.VirtualMachinePreferences.vmwareEnginePreferences: object expected"); + message.vmwareEnginePreferences = $root.google.cloud.migrationcenter.v1.VmwareEnginePreferences.fromObject(object.vmwareEnginePreferences); + } + if (object.soleTenancyPreferences != null) { + if (typeof object.soleTenancyPreferences !== "object") + throw TypeError(".google.cloud.migrationcenter.v1.VirtualMachinePreferences.soleTenancyPreferences: object expected"); + message.soleTenancyPreferences = $root.google.cloud.migrationcenter.v1.SoleTenancyPreferences.fromObject(object.soleTenancyPreferences); + } + return message; + }; + + /** + * Creates a plain object from a VirtualMachinePreferences message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.migrationcenter.v1.VirtualMachinePreferences + * @static + * @param {google.cloud.migrationcenter.v1.VirtualMachinePreferences} message VirtualMachinePreferences + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object */ - RegionPreferences.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + VirtualMachinePreferences.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.targetProduct = options.enums === String ? "COMPUTE_MIGRATION_TARGET_PRODUCT_UNSPECIFIED" : 0; + object.regionPreferences = null; + object.commitmentPlan = options.enums === String ? "COMMITMENT_PLAN_UNSPECIFIED" : 0; + object.sizingOptimizationStrategy = options.enums === String ? "SIZING_OPTIMIZATION_STRATEGY_UNSPECIFIED" : 0; + object.computeEnginePreferences = null; + object.vmwareEnginePreferences = null; + object.soleTenancyPreferences = null; + } + if (message.targetProduct != null && message.hasOwnProperty("targetProduct")) + object.targetProduct = options.enums === String ? $root.google.cloud.migrationcenter.v1.ComputeMigrationTargetProduct[message.targetProduct] === undefined ? message.targetProduct : $root.google.cloud.migrationcenter.v1.ComputeMigrationTargetProduct[message.targetProduct] : message.targetProduct; + if (message.regionPreferences != null && message.hasOwnProperty("regionPreferences")) + object.regionPreferences = $root.google.cloud.migrationcenter.v1.RegionPreferences.toObject(message.regionPreferences, options); + if (message.commitmentPlan != null && message.hasOwnProperty("commitmentPlan")) + object.commitmentPlan = options.enums === String ? $root.google.cloud.migrationcenter.v1.CommitmentPlan[message.commitmentPlan] === undefined ? message.commitmentPlan : $root.google.cloud.migrationcenter.v1.CommitmentPlan[message.commitmentPlan] : message.commitmentPlan; + if (message.sizingOptimizationStrategy != null && message.hasOwnProperty("sizingOptimizationStrategy")) + object.sizingOptimizationStrategy = options.enums === String ? $root.google.cloud.migrationcenter.v1.SizingOptimizationStrategy[message.sizingOptimizationStrategy] === undefined ? message.sizingOptimizationStrategy : $root.google.cloud.migrationcenter.v1.SizingOptimizationStrategy[message.sizingOptimizationStrategy] : message.sizingOptimizationStrategy; + if (message.computeEnginePreferences != null && message.hasOwnProperty("computeEnginePreferences")) + object.computeEnginePreferences = $root.google.cloud.migrationcenter.v1.ComputeEnginePreferences.toObject(message.computeEnginePreferences, options); + if (message.vmwareEnginePreferences != null && message.hasOwnProperty("vmwareEnginePreferences")) + object.vmwareEnginePreferences = $root.google.cloud.migrationcenter.v1.VmwareEnginePreferences.toObject(message.vmwareEnginePreferences, options); + if (message.soleTenancyPreferences != null && message.hasOwnProperty("soleTenancyPreferences")) + object.soleTenancyPreferences = $root.google.cloud.migrationcenter.v1.SoleTenancyPreferences.toObject(message.soleTenancyPreferences, options); + return object; + }; + + /** + * Converts this VirtualMachinePreferences to JSON. + * @function toJSON + * @memberof google.cloud.migrationcenter.v1.VirtualMachinePreferences + * @instance + * @returns {Object.} JSON object + */ + VirtualMachinePreferences.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for VirtualMachinePreferences + * @function getTypeUrl + * @memberof google.cloud.migrationcenter.v1.VirtualMachinePreferences + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + VirtualMachinePreferences.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.cloud.migrationcenter.v1.RegionPreferences"; + return typeUrlPrefix + "/google.cloud.migrationcenter.v1.VirtualMachinePreferences"; }; - return RegionPreferences; + return VirtualMachinePreferences; })(); - v1.Settings = (function() { + v1.ComputeEnginePreferences = (function() { /** - * Properties of a Settings. + * Properties of a ComputeEnginePreferences. * @memberof google.cloud.migrationcenter.v1 - * @interface ISettings - * @property {string|null} [name] Settings name - * @property {string|null} [preferenceSet] Settings preferenceSet + * @interface IComputeEnginePreferences + * @property {google.cloud.migrationcenter.v1.IMachinePreferences|null} [machinePreferences] ComputeEnginePreferences machinePreferences + * @property {google.cloud.migrationcenter.v1.LicenseType|null} [licenseType] ComputeEnginePreferences licenseType */ /** - * Constructs a new Settings. + * Constructs a new ComputeEnginePreferences. * @memberof google.cloud.migrationcenter.v1 - * @classdesc Represents a Settings. - * @implements ISettings + * @classdesc Represents a ComputeEnginePreferences. + * @implements IComputeEnginePreferences * @constructor - * @param {google.cloud.migrationcenter.v1.ISettings=} [properties] Properties to set + * @param {google.cloud.migrationcenter.v1.IComputeEnginePreferences=} [properties] Properties to set */ - function Settings(properties) { + function ComputeEnginePreferences(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -44826,89 +44649,89 @@ } /** - * Settings name. - * @member {string} name - * @memberof google.cloud.migrationcenter.v1.Settings + * ComputeEnginePreferences machinePreferences. + * @member {google.cloud.migrationcenter.v1.IMachinePreferences|null|undefined} machinePreferences + * @memberof google.cloud.migrationcenter.v1.ComputeEnginePreferences * @instance */ - Settings.prototype.name = ""; + ComputeEnginePreferences.prototype.machinePreferences = null; /** - * Settings preferenceSet. - * @member {string} preferenceSet - * @memberof google.cloud.migrationcenter.v1.Settings + * ComputeEnginePreferences licenseType. + * @member {google.cloud.migrationcenter.v1.LicenseType} licenseType + * @memberof google.cloud.migrationcenter.v1.ComputeEnginePreferences * @instance */ - Settings.prototype.preferenceSet = ""; + ComputeEnginePreferences.prototype.licenseType = 0; /** - * Creates a new Settings instance using the specified properties. + * Creates a new ComputeEnginePreferences instance using the specified properties. * @function create - * @memberof google.cloud.migrationcenter.v1.Settings + * @memberof google.cloud.migrationcenter.v1.ComputeEnginePreferences * @static - * @param {google.cloud.migrationcenter.v1.ISettings=} [properties] Properties to set - * @returns {google.cloud.migrationcenter.v1.Settings} Settings instance + * @param {google.cloud.migrationcenter.v1.IComputeEnginePreferences=} [properties] Properties to set + * @returns {google.cloud.migrationcenter.v1.ComputeEnginePreferences} ComputeEnginePreferences instance */ - Settings.create = function create(properties) { - return new Settings(properties); + ComputeEnginePreferences.create = function create(properties) { + return new ComputeEnginePreferences(properties); }; /** - * Encodes the specified Settings message. Does not implicitly {@link google.cloud.migrationcenter.v1.Settings.verify|verify} messages. + * Encodes the specified ComputeEnginePreferences message. Does not implicitly {@link google.cloud.migrationcenter.v1.ComputeEnginePreferences.verify|verify} messages. * @function encode - * @memberof google.cloud.migrationcenter.v1.Settings + * @memberof google.cloud.migrationcenter.v1.ComputeEnginePreferences * @static - * @param {google.cloud.migrationcenter.v1.ISettings} message Settings message or plain object to encode + * @param {google.cloud.migrationcenter.v1.IComputeEnginePreferences} message ComputeEnginePreferences message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - Settings.encode = function encode(message, writer) { + ComputeEnginePreferences.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.preferenceSet != null && Object.hasOwnProperty.call(message, "preferenceSet")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.preferenceSet); + if (message.machinePreferences != null && Object.hasOwnProperty.call(message, "machinePreferences")) + $root.google.cloud.migrationcenter.v1.MachinePreferences.encode(message.machinePreferences, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.licenseType != null && Object.hasOwnProperty.call(message, "licenseType")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.licenseType); return writer; }; /** - * Encodes the specified Settings message, length delimited. Does not implicitly {@link google.cloud.migrationcenter.v1.Settings.verify|verify} messages. + * Encodes the specified ComputeEnginePreferences message, length delimited. Does not implicitly {@link google.cloud.migrationcenter.v1.ComputeEnginePreferences.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.migrationcenter.v1.Settings + * @memberof google.cloud.migrationcenter.v1.ComputeEnginePreferences * @static - * @param {google.cloud.migrationcenter.v1.ISettings} message Settings message or plain object to encode + * @param {google.cloud.migrationcenter.v1.IComputeEnginePreferences} message ComputeEnginePreferences message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - Settings.encodeDelimited = function encodeDelimited(message, writer) { + ComputeEnginePreferences.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a Settings message from the specified reader or buffer. + * Decodes a ComputeEnginePreferences message from the specified reader or buffer. * @function decode - * @memberof google.cloud.migrationcenter.v1.Settings + * @memberof google.cloud.migrationcenter.v1.ComputeEnginePreferences * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.migrationcenter.v1.Settings} Settings + * @returns {google.cloud.migrationcenter.v1.ComputeEnginePreferences} ComputeEnginePreferences * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - Settings.decode = function decode(reader, length) { + ComputeEnginePreferences.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.migrationcenter.v1.Settings(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.migrationcenter.v1.ComputeEnginePreferences(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: { - message.name = reader.string(); + case 2: { + message.machinePreferences = $root.google.cloud.migrationcenter.v1.MachinePreferences.decode(reader, reader.uint32()); break; } - case 2: { - message.preferenceSet = reader.string(); + case 3: { + message.licenseType = reader.int32(); break; } default: @@ -44920,133 +44743,161 @@ }; /** - * Decodes a Settings message from the specified reader or buffer, length delimited. + * Decodes a ComputeEnginePreferences message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.migrationcenter.v1.Settings + * @memberof google.cloud.migrationcenter.v1.ComputeEnginePreferences * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.migrationcenter.v1.Settings} Settings + * @returns {google.cloud.migrationcenter.v1.ComputeEnginePreferences} ComputeEnginePreferences * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - Settings.decodeDelimited = function decodeDelimited(reader) { + ComputeEnginePreferences.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a Settings message. + * Verifies a ComputeEnginePreferences message. * @function verify - * @memberof google.cloud.migrationcenter.v1.Settings + * @memberof google.cloud.migrationcenter.v1.ComputeEnginePreferences * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - Settings.verify = function verify(message) { + ComputeEnginePreferences.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.preferenceSet != null && message.hasOwnProperty("preferenceSet")) - if (!$util.isString(message.preferenceSet)) - return "preferenceSet: string expected"; + if (message.machinePreferences != null && message.hasOwnProperty("machinePreferences")) { + var error = $root.google.cloud.migrationcenter.v1.MachinePreferences.verify(message.machinePreferences); + if (error) + return "machinePreferences." + error; + } + if (message.licenseType != null && message.hasOwnProperty("licenseType")) + switch (message.licenseType) { + default: + return "licenseType: enum value expected"; + case 0: + case 1: + case 2: + break; + } return null; }; /** - * Creates a Settings message from a plain object. Also converts values to their respective internal types. + * Creates a ComputeEnginePreferences message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.migrationcenter.v1.Settings + * @memberof google.cloud.migrationcenter.v1.ComputeEnginePreferences * @static * @param {Object.} object Plain object - * @returns {google.cloud.migrationcenter.v1.Settings} Settings + * @returns {google.cloud.migrationcenter.v1.ComputeEnginePreferences} ComputeEnginePreferences */ - Settings.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.migrationcenter.v1.Settings) + ComputeEnginePreferences.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.migrationcenter.v1.ComputeEnginePreferences) return object; - var message = new $root.google.cloud.migrationcenter.v1.Settings(); - if (object.name != null) - message.name = String(object.name); - if (object.preferenceSet != null) - message.preferenceSet = String(object.preferenceSet); - return message; - }; - - /** - * Creates a plain object from a Settings message. Also converts values to other types if specified. + var message = new $root.google.cloud.migrationcenter.v1.ComputeEnginePreferences(); + if (object.machinePreferences != null) { + if (typeof object.machinePreferences !== "object") + throw TypeError(".google.cloud.migrationcenter.v1.ComputeEnginePreferences.machinePreferences: object expected"); + message.machinePreferences = $root.google.cloud.migrationcenter.v1.MachinePreferences.fromObject(object.machinePreferences); + } + switch (object.licenseType) { + default: + if (typeof object.licenseType === "number") { + message.licenseType = object.licenseType; + break; + } + break; + case "LICENSE_TYPE_UNSPECIFIED": + case 0: + message.licenseType = 0; + break; + case "LICENSE_TYPE_DEFAULT": + case 1: + message.licenseType = 1; + break; + case "LICENSE_TYPE_BRING_YOUR_OWN_LICENSE": + case 2: + message.licenseType = 2; + break; + } + return message; + }; + + /** + * Creates a plain object from a ComputeEnginePreferences message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.migrationcenter.v1.Settings + * @memberof google.cloud.migrationcenter.v1.ComputeEnginePreferences * @static - * @param {google.cloud.migrationcenter.v1.Settings} message Settings + * @param {google.cloud.migrationcenter.v1.ComputeEnginePreferences} message ComputeEnginePreferences * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - Settings.toObject = function toObject(message, options) { + ComputeEnginePreferences.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; if (options.defaults) { - object.name = ""; - object.preferenceSet = ""; + object.machinePreferences = null; + object.licenseType = options.enums === String ? "LICENSE_TYPE_UNSPECIFIED" : 0; } - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - if (message.preferenceSet != null && message.hasOwnProperty("preferenceSet")) - object.preferenceSet = message.preferenceSet; + if (message.machinePreferences != null && message.hasOwnProperty("machinePreferences")) + object.machinePreferences = $root.google.cloud.migrationcenter.v1.MachinePreferences.toObject(message.machinePreferences, options); + if (message.licenseType != null && message.hasOwnProperty("licenseType")) + object.licenseType = options.enums === String ? $root.google.cloud.migrationcenter.v1.LicenseType[message.licenseType] === undefined ? message.licenseType : $root.google.cloud.migrationcenter.v1.LicenseType[message.licenseType] : message.licenseType; return object; }; /** - * Converts this Settings to JSON. + * Converts this ComputeEnginePreferences to JSON. * @function toJSON - * @memberof google.cloud.migrationcenter.v1.Settings + * @memberof google.cloud.migrationcenter.v1.ComputeEnginePreferences * @instance * @returns {Object.} JSON object */ - Settings.prototype.toJSON = function toJSON() { + ComputeEnginePreferences.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for Settings + * Gets the default type url for ComputeEnginePreferences * @function getTypeUrl - * @memberof google.cloud.migrationcenter.v1.Settings + * @memberof google.cloud.migrationcenter.v1.ComputeEnginePreferences * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - Settings.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + ComputeEnginePreferences.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.cloud.migrationcenter.v1.Settings"; + return typeUrlPrefix + "/google.cloud.migrationcenter.v1.ComputeEnginePreferences"; }; - return Settings; + return ComputeEnginePreferences; })(); - v1.ReportSummary = (function() { + v1.MachinePreferences = (function() { /** - * Properties of a ReportSummary. + * Properties of a MachinePreferences. * @memberof google.cloud.migrationcenter.v1 - * @interface IReportSummary - * @property {google.cloud.migrationcenter.v1.ReportSummary.IAssetAggregateStats|null} [allAssetsStats] ReportSummary allAssetsStats - * @property {Array.|null} [groupFindings] ReportSummary groupFindings + * @interface IMachinePreferences + * @property {Array.|null} [allowedMachineSeries] MachinePreferences allowedMachineSeries */ /** - * Constructs a new ReportSummary. + * Constructs a new MachinePreferences. * @memberof google.cloud.migrationcenter.v1 - * @classdesc Represents a ReportSummary. - * @implements IReportSummary + * @classdesc Represents a MachinePreferences. + * @implements IMachinePreferences * @constructor - * @param {google.cloud.migrationcenter.v1.IReportSummary=} [properties] Properties to set + * @param {google.cloud.migrationcenter.v1.IMachinePreferences=} [properties] Properties to set */ - function ReportSummary(properties) { - this.groupFindings = []; + function MachinePreferences(properties) { + this.allowedMachineSeries = []; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -45054,92 +44905,78 @@ } /** - * ReportSummary allAssetsStats. - * @member {google.cloud.migrationcenter.v1.ReportSummary.IAssetAggregateStats|null|undefined} allAssetsStats - * @memberof google.cloud.migrationcenter.v1.ReportSummary - * @instance - */ - ReportSummary.prototype.allAssetsStats = null; - - /** - * ReportSummary groupFindings. - * @member {Array.} groupFindings - * @memberof google.cloud.migrationcenter.v1.ReportSummary + * MachinePreferences allowedMachineSeries. + * @member {Array.} allowedMachineSeries + * @memberof google.cloud.migrationcenter.v1.MachinePreferences * @instance */ - ReportSummary.prototype.groupFindings = $util.emptyArray; + MachinePreferences.prototype.allowedMachineSeries = $util.emptyArray; /** - * Creates a new ReportSummary instance using the specified properties. + * Creates a new MachinePreferences instance using the specified properties. * @function create - * @memberof google.cloud.migrationcenter.v1.ReportSummary + * @memberof google.cloud.migrationcenter.v1.MachinePreferences * @static - * @param {google.cloud.migrationcenter.v1.IReportSummary=} [properties] Properties to set - * @returns {google.cloud.migrationcenter.v1.ReportSummary} ReportSummary instance + * @param {google.cloud.migrationcenter.v1.IMachinePreferences=} [properties] Properties to set + * @returns {google.cloud.migrationcenter.v1.MachinePreferences} MachinePreferences instance */ - ReportSummary.create = function create(properties) { - return new ReportSummary(properties); + MachinePreferences.create = function create(properties) { + return new MachinePreferences(properties); }; /** - * Encodes the specified ReportSummary message. Does not implicitly {@link google.cloud.migrationcenter.v1.ReportSummary.verify|verify} messages. + * Encodes the specified MachinePreferences message. Does not implicitly {@link google.cloud.migrationcenter.v1.MachinePreferences.verify|verify} messages. * @function encode - * @memberof google.cloud.migrationcenter.v1.ReportSummary + * @memberof google.cloud.migrationcenter.v1.MachinePreferences * @static - * @param {google.cloud.migrationcenter.v1.IReportSummary} message ReportSummary message or plain object to encode + * @param {google.cloud.migrationcenter.v1.IMachinePreferences} message MachinePreferences message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ReportSummary.encode = function encode(message, writer) { + MachinePreferences.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.allAssetsStats != null && Object.hasOwnProperty.call(message, "allAssetsStats")) - $root.google.cloud.migrationcenter.v1.ReportSummary.AssetAggregateStats.encode(message.allAssetsStats, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.groupFindings != null && message.groupFindings.length) - for (var i = 0; i < message.groupFindings.length; ++i) - $root.google.cloud.migrationcenter.v1.ReportSummary.GroupFinding.encode(message.groupFindings[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.allowedMachineSeries != null && message.allowedMachineSeries.length) + for (var i = 0; i < message.allowedMachineSeries.length; ++i) + $root.google.cloud.migrationcenter.v1.MachineSeries.encode(message.allowedMachineSeries[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); return writer; }; /** - * Encodes the specified ReportSummary message, length delimited. Does not implicitly {@link google.cloud.migrationcenter.v1.ReportSummary.verify|verify} messages. + * Encodes the specified MachinePreferences message, length delimited. Does not implicitly {@link google.cloud.migrationcenter.v1.MachinePreferences.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.migrationcenter.v1.ReportSummary + * @memberof google.cloud.migrationcenter.v1.MachinePreferences * @static - * @param {google.cloud.migrationcenter.v1.IReportSummary} message ReportSummary message or plain object to encode + * @param {google.cloud.migrationcenter.v1.IMachinePreferences} message MachinePreferences message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ReportSummary.encodeDelimited = function encodeDelimited(message, writer) { + MachinePreferences.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a ReportSummary message from the specified reader or buffer. + * Decodes a MachinePreferences message from the specified reader or buffer. * @function decode - * @memberof google.cloud.migrationcenter.v1.ReportSummary + * @memberof google.cloud.migrationcenter.v1.MachinePreferences * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.migrationcenter.v1.ReportSummary} ReportSummary + * @returns {google.cloud.migrationcenter.v1.MachinePreferences} MachinePreferences * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - ReportSummary.decode = function decode(reader, length) { + MachinePreferences.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.migrationcenter.v1.ReportSummary(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.migrationcenter.v1.MachinePreferences(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: { - message.allAssetsStats = $root.google.cloud.migrationcenter.v1.ReportSummary.AssetAggregateStats.decode(reader, reader.uint32()); - break; - } - case 2: { - if (!(message.groupFindings && message.groupFindings.length)) - message.groupFindings = []; - message.groupFindings.push($root.google.cloud.migrationcenter.v1.ReportSummary.GroupFinding.decode(reader, reader.uint32())); + if (!(message.allowedMachineSeries && message.allowedMachineSeries.length)) + message.allowedMachineSeries = []; + message.allowedMachineSeries.push($root.google.cloud.migrationcenter.v1.MachineSeries.decode(reader, reader.uint32())); break; } default: @@ -45151,151 +44988,3195 @@ }; /** - * Decodes a ReportSummary message from the specified reader or buffer, length delimited. + * Decodes a MachinePreferences message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.migrationcenter.v1.ReportSummary + * @memberof google.cloud.migrationcenter.v1.MachinePreferences * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.migrationcenter.v1.ReportSummary} ReportSummary + * @returns {google.cloud.migrationcenter.v1.MachinePreferences} MachinePreferences * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - ReportSummary.decodeDelimited = function decodeDelimited(reader) { + MachinePreferences.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a ReportSummary message. + * Verifies a MachinePreferences message. * @function verify - * @memberof google.cloud.migrationcenter.v1.ReportSummary + * @memberof google.cloud.migrationcenter.v1.MachinePreferences * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - ReportSummary.verify = function verify(message) { + MachinePreferences.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.allAssetsStats != null && message.hasOwnProperty("allAssetsStats")) { - var error = $root.google.cloud.migrationcenter.v1.ReportSummary.AssetAggregateStats.verify(message.allAssetsStats); - if (error) - return "allAssetsStats." + error; - } - if (message.groupFindings != null && message.hasOwnProperty("groupFindings")) { - if (!Array.isArray(message.groupFindings)) - return "groupFindings: array expected"; - for (var i = 0; i < message.groupFindings.length; ++i) { - var error = $root.google.cloud.migrationcenter.v1.ReportSummary.GroupFinding.verify(message.groupFindings[i]); + if (message.allowedMachineSeries != null && message.hasOwnProperty("allowedMachineSeries")) { + if (!Array.isArray(message.allowedMachineSeries)) + return "allowedMachineSeries: array expected"; + for (var i = 0; i < message.allowedMachineSeries.length; ++i) { + var error = $root.google.cloud.migrationcenter.v1.MachineSeries.verify(message.allowedMachineSeries[i]); if (error) - return "groupFindings." + error; + return "allowedMachineSeries." + error; } } return null; }; - /** - * Creates a ReportSummary message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.migrationcenter.v1.ReportSummary - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.migrationcenter.v1.ReportSummary} ReportSummary - */ - ReportSummary.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.migrationcenter.v1.ReportSummary) - return object; - var message = new $root.google.cloud.migrationcenter.v1.ReportSummary(); - if (object.allAssetsStats != null) { - if (typeof object.allAssetsStats !== "object") - throw TypeError(".google.cloud.migrationcenter.v1.ReportSummary.allAssetsStats: object expected"); - message.allAssetsStats = $root.google.cloud.migrationcenter.v1.ReportSummary.AssetAggregateStats.fromObject(object.allAssetsStats); - } - if (object.groupFindings) { - if (!Array.isArray(object.groupFindings)) - throw TypeError(".google.cloud.migrationcenter.v1.ReportSummary.groupFindings: array expected"); - message.groupFindings = []; - for (var i = 0; i < object.groupFindings.length; ++i) { - if (typeof object.groupFindings[i] !== "object") - throw TypeError(".google.cloud.migrationcenter.v1.ReportSummary.groupFindings: object expected"); - message.groupFindings[i] = $root.google.cloud.migrationcenter.v1.ReportSummary.GroupFinding.fromObject(object.groupFindings[i]); - } - } - return message; - }; + /** + * Creates a MachinePreferences message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.migrationcenter.v1.MachinePreferences + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.migrationcenter.v1.MachinePreferences} MachinePreferences + */ + MachinePreferences.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.migrationcenter.v1.MachinePreferences) + return object; + var message = new $root.google.cloud.migrationcenter.v1.MachinePreferences(); + if (object.allowedMachineSeries) { + if (!Array.isArray(object.allowedMachineSeries)) + throw TypeError(".google.cloud.migrationcenter.v1.MachinePreferences.allowedMachineSeries: array expected"); + message.allowedMachineSeries = []; + for (var i = 0; i < object.allowedMachineSeries.length; ++i) { + if (typeof object.allowedMachineSeries[i] !== "object") + throw TypeError(".google.cloud.migrationcenter.v1.MachinePreferences.allowedMachineSeries: object expected"); + message.allowedMachineSeries[i] = $root.google.cloud.migrationcenter.v1.MachineSeries.fromObject(object.allowedMachineSeries[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a MachinePreferences message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.migrationcenter.v1.MachinePreferences + * @static + * @param {google.cloud.migrationcenter.v1.MachinePreferences} message MachinePreferences + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + MachinePreferences.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.allowedMachineSeries = []; + if (message.allowedMachineSeries && message.allowedMachineSeries.length) { + object.allowedMachineSeries = []; + for (var j = 0; j < message.allowedMachineSeries.length; ++j) + object.allowedMachineSeries[j] = $root.google.cloud.migrationcenter.v1.MachineSeries.toObject(message.allowedMachineSeries[j], options); + } + return object; + }; + + /** + * Converts this MachinePreferences to JSON. + * @function toJSON + * @memberof google.cloud.migrationcenter.v1.MachinePreferences + * @instance + * @returns {Object.} JSON object + */ + MachinePreferences.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for MachinePreferences + * @function getTypeUrl + * @memberof google.cloud.migrationcenter.v1.MachinePreferences + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + MachinePreferences.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.migrationcenter.v1.MachinePreferences"; + }; + + return MachinePreferences; + })(); + + v1.MachineSeries = (function() { + + /** + * Properties of a MachineSeries. + * @memberof google.cloud.migrationcenter.v1 + * @interface IMachineSeries + * @property {string|null} [code] MachineSeries code + */ + + /** + * Constructs a new MachineSeries. + * @memberof google.cloud.migrationcenter.v1 + * @classdesc Represents a MachineSeries. + * @implements IMachineSeries + * @constructor + * @param {google.cloud.migrationcenter.v1.IMachineSeries=} [properties] Properties to set + */ + function MachineSeries(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * MachineSeries code. + * @member {string} code + * @memberof google.cloud.migrationcenter.v1.MachineSeries + * @instance + */ + MachineSeries.prototype.code = ""; + + /** + * Creates a new MachineSeries instance using the specified properties. + * @function create + * @memberof google.cloud.migrationcenter.v1.MachineSeries + * @static + * @param {google.cloud.migrationcenter.v1.IMachineSeries=} [properties] Properties to set + * @returns {google.cloud.migrationcenter.v1.MachineSeries} MachineSeries instance + */ + MachineSeries.create = function create(properties) { + return new MachineSeries(properties); + }; + + /** + * Encodes the specified MachineSeries message. Does not implicitly {@link google.cloud.migrationcenter.v1.MachineSeries.verify|verify} messages. + * @function encode + * @memberof google.cloud.migrationcenter.v1.MachineSeries + * @static + * @param {google.cloud.migrationcenter.v1.IMachineSeries} message MachineSeries message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MachineSeries.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.code != null && Object.hasOwnProperty.call(message, "code")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.code); + return writer; + }; + + /** + * Encodes the specified MachineSeries message, length delimited. Does not implicitly {@link google.cloud.migrationcenter.v1.MachineSeries.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.migrationcenter.v1.MachineSeries + * @static + * @param {google.cloud.migrationcenter.v1.IMachineSeries} message MachineSeries message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MachineSeries.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a MachineSeries message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.migrationcenter.v1.MachineSeries + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.migrationcenter.v1.MachineSeries} MachineSeries + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MachineSeries.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.migrationcenter.v1.MachineSeries(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.code = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a MachineSeries message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.migrationcenter.v1.MachineSeries + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.migrationcenter.v1.MachineSeries} MachineSeries + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MachineSeries.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a MachineSeries message. + * @function verify + * @memberof google.cloud.migrationcenter.v1.MachineSeries + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + MachineSeries.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.code != null && message.hasOwnProperty("code")) + if (!$util.isString(message.code)) + return "code: string expected"; + return null; + }; + + /** + * Creates a MachineSeries message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.migrationcenter.v1.MachineSeries + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.migrationcenter.v1.MachineSeries} MachineSeries + */ + MachineSeries.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.migrationcenter.v1.MachineSeries) + return object; + var message = new $root.google.cloud.migrationcenter.v1.MachineSeries(); + if (object.code != null) + message.code = String(object.code); + return message; + }; + + /** + * Creates a plain object from a MachineSeries message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.migrationcenter.v1.MachineSeries + * @static + * @param {google.cloud.migrationcenter.v1.MachineSeries} message MachineSeries + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + MachineSeries.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.code = ""; + if (message.code != null && message.hasOwnProperty("code")) + object.code = message.code; + return object; + }; + + /** + * Converts this MachineSeries to JSON. + * @function toJSON + * @memberof google.cloud.migrationcenter.v1.MachineSeries + * @instance + * @returns {Object.} JSON object + */ + MachineSeries.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for MachineSeries + * @function getTypeUrl + * @memberof google.cloud.migrationcenter.v1.MachineSeries + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + MachineSeries.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.migrationcenter.v1.MachineSeries"; + }; + + return MachineSeries; + })(); + + v1.VmwareEnginePreferences = (function() { + + /** + * Properties of a VmwareEnginePreferences. + * @memberof google.cloud.migrationcenter.v1 + * @interface IVmwareEnginePreferences + * @property {number|null} [cpuOvercommitRatio] VmwareEnginePreferences cpuOvercommitRatio + * @property {number|null} [memoryOvercommitRatio] VmwareEnginePreferences memoryOvercommitRatio + * @property {number|null} [storageDeduplicationCompressionRatio] VmwareEnginePreferences storageDeduplicationCompressionRatio + * @property {google.cloud.migrationcenter.v1.VmwareEnginePreferences.CommitmentPlan|null} [commitmentPlan] VmwareEnginePreferences commitmentPlan + */ + + /** + * Constructs a new VmwareEnginePreferences. + * @memberof google.cloud.migrationcenter.v1 + * @classdesc Represents a VmwareEnginePreferences. + * @implements IVmwareEnginePreferences + * @constructor + * @param {google.cloud.migrationcenter.v1.IVmwareEnginePreferences=} [properties] Properties to set + */ + function VmwareEnginePreferences(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * VmwareEnginePreferences cpuOvercommitRatio. + * @member {number} cpuOvercommitRatio + * @memberof google.cloud.migrationcenter.v1.VmwareEnginePreferences + * @instance + */ + VmwareEnginePreferences.prototype.cpuOvercommitRatio = 0; + + /** + * VmwareEnginePreferences memoryOvercommitRatio. + * @member {number} memoryOvercommitRatio + * @memberof google.cloud.migrationcenter.v1.VmwareEnginePreferences + * @instance + */ + VmwareEnginePreferences.prototype.memoryOvercommitRatio = 0; + + /** + * VmwareEnginePreferences storageDeduplicationCompressionRatio. + * @member {number} storageDeduplicationCompressionRatio + * @memberof google.cloud.migrationcenter.v1.VmwareEnginePreferences + * @instance + */ + VmwareEnginePreferences.prototype.storageDeduplicationCompressionRatio = 0; + + /** + * VmwareEnginePreferences commitmentPlan. + * @member {google.cloud.migrationcenter.v1.VmwareEnginePreferences.CommitmentPlan} commitmentPlan + * @memberof google.cloud.migrationcenter.v1.VmwareEnginePreferences + * @instance + */ + VmwareEnginePreferences.prototype.commitmentPlan = 0; + + /** + * Creates a new VmwareEnginePreferences instance using the specified properties. + * @function create + * @memberof google.cloud.migrationcenter.v1.VmwareEnginePreferences + * @static + * @param {google.cloud.migrationcenter.v1.IVmwareEnginePreferences=} [properties] Properties to set + * @returns {google.cloud.migrationcenter.v1.VmwareEnginePreferences} VmwareEnginePreferences instance + */ + VmwareEnginePreferences.create = function create(properties) { + return new VmwareEnginePreferences(properties); + }; + + /** + * Encodes the specified VmwareEnginePreferences message. Does not implicitly {@link google.cloud.migrationcenter.v1.VmwareEnginePreferences.verify|verify} messages. + * @function encode + * @memberof google.cloud.migrationcenter.v1.VmwareEnginePreferences + * @static + * @param {google.cloud.migrationcenter.v1.IVmwareEnginePreferences} message VmwareEnginePreferences message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + VmwareEnginePreferences.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.cpuOvercommitRatio != null && Object.hasOwnProperty.call(message, "cpuOvercommitRatio")) + writer.uint32(/* id 1, wireType 1 =*/9).double(message.cpuOvercommitRatio); + if (message.memoryOvercommitRatio != null && Object.hasOwnProperty.call(message, "memoryOvercommitRatio")) + writer.uint32(/* id 2, wireType 1 =*/17).double(message.memoryOvercommitRatio); + if (message.storageDeduplicationCompressionRatio != null && Object.hasOwnProperty.call(message, "storageDeduplicationCompressionRatio")) + writer.uint32(/* id 3, wireType 1 =*/25).double(message.storageDeduplicationCompressionRatio); + if (message.commitmentPlan != null && Object.hasOwnProperty.call(message, "commitmentPlan")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.commitmentPlan); + return writer; + }; + + /** + * Encodes the specified VmwareEnginePreferences message, length delimited. Does not implicitly {@link google.cloud.migrationcenter.v1.VmwareEnginePreferences.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.migrationcenter.v1.VmwareEnginePreferences + * @static + * @param {google.cloud.migrationcenter.v1.IVmwareEnginePreferences} message VmwareEnginePreferences message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + VmwareEnginePreferences.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a VmwareEnginePreferences message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.migrationcenter.v1.VmwareEnginePreferences + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.migrationcenter.v1.VmwareEnginePreferences} VmwareEnginePreferences + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + VmwareEnginePreferences.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.migrationcenter.v1.VmwareEnginePreferences(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.cpuOvercommitRatio = reader.double(); + break; + } + case 2: { + message.memoryOvercommitRatio = reader.double(); + break; + } + case 3: { + message.storageDeduplicationCompressionRatio = reader.double(); + break; + } + case 4: { + message.commitmentPlan = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a VmwareEnginePreferences message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.migrationcenter.v1.VmwareEnginePreferences + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.migrationcenter.v1.VmwareEnginePreferences} VmwareEnginePreferences + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + VmwareEnginePreferences.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a VmwareEnginePreferences message. + * @function verify + * @memberof google.cloud.migrationcenter.v1.VmwareEnginePreferences + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + VmwareEnginePreferences.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.cpuOvercommitRatio != null && message.hasOwnProperty("cpuOvercommitRatio")) + if (typeof message.cpuOvercommitRatio !== "number") + return "cpuOvercommitRatio: number expected"; + if (message.memoryOvercommitRatio != null && message.hasOwnProperty("memoryOvercommitRatio")) + if (typeof message.memoryOvercommitRatio !== "number") + return "memoryOvercommitRatio: number expected"; + if (message.storageDeduplicationCompressionRatio != null && message.hasOwnProperty("storageDeduplicationCompressionRatio")) + if (typeof message.storageDeduplicationCompressionRatio !== "number") + return "storageDeduplicationCompressionRatio: number expected"; + if (message.commitmentPlan != null && message.hasOwnProperty("commitmentPlan")) + switch (message.commitmentPlan) { + default: + return "commitmentPlan: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + case 5: + break; + } + return null; + }; + + /** + * Creates a VmwareEnginePreferences message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.migrationcenter.v1.VmwareEnginePreferences + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.migrationcenter.v1.VmwareEnginePreferences} VmwareEnginePreferences + */ + VmwareEnginePreferences.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.migrationcenter.v1.VmwareEnginePreferences) + return object; + var message = new $root.google.cloud.migrationcenter.v1.VmwareEnginePreferences(); + if (object.cpuOvercommitRatio != null) + message.cpuOvercommitRatio = Number(object.cpuOvercommitRatio); + if (object.memoryOvercommitRatio != null) + message.memoryOvercommitRatio = Number(object.memoryOvercommitRatio); + if (object.storageDeduplicationCompressionRatio != null) + message.storageDeduplicationCompressionRatio = Number(object.storageDeduplicationCompressionRatio); + switch (object.commitmentPlan) { + default: + if (typeof object.commitmentPlan === "number") { + message.commitmentPlan = object.commitmentPlan; + break; + } + break; + case "COMMITMENT_PLAN_UNSPECIFIED": + case 0: + message.commitmentPlan = 0; + break; + case "ON_DEMAND": + case 1: + message.commitmentPlan = 1; + break; + case "COMMITMENT_1_YEAR_MONTHLY_PAYMENTS": + case 2: + message.commitmentPlan = 2; + break; + case "COMMITMENT_3_YEAR_MONTHLY_PAYMENTS": + case 3: + message.commitmentPlan = 3; + break; + case "COMMITMENT_1_YEAR_UPFRONT_PAYMENT": + case 4: + message.commitmentPlan = 4; + break; + case "COMMITMENT_3_YEAR_UPFRONT_PAYMENT": + case 5: + message.commitmentPlan = 5; + break; + } + return message; + }; + + /** + * Creates a plain object from a VmwareEnginePreferences message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.migrationcenter.v1.VmwareEnginePreferences + * @static + * @param {google.cloud.migrationcenter.v1.VmwareEnginePreferences} message VmwareEnginePreferences + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + VmwareEnginePreferences.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.cpuOvercommitRatio = 0; + object.memoryOvercommitRatio = 0; + object.storageDeduplicationCompressionRatio = 0; + object.commitmentPlan = options.enums === String ? "COMMITMENT_PLAN_UNSPECIFIED" : 0; + } + if (message.cpuOvercommitRatio != null && message.hasOwnProperty("cpuOvercommitRatio")) + object.cpuOvercommitRatio = options.json && !isFinite(message.cpuOvercommitRatio) ? String(message.cpuOvercommitRatio) : message.cpuOvercommitRatio; + if (message.memoryOvercommitRatio != null && message.hasOwnProperty("memoryOvercommitRatio")) + object.memoryOvercommitRatio = options.json && !isFinite(message.memoryOvercommitRatio) ? String(message.memoryOvercommitRatio) : message.memoryOvercommitRatio; + if (message.storageDeduplicationCompressionRatio != null && message.hasOwnProperty("storageDeduplicationCompressionRatio")) + object.storageDeduplicationCompressionRatio = options.json && !isFinite(message.storageDeduplicationCompressionRatio) ? String(message.storageDeduplicationCompressionRatio) : message.storageDeduplicationCompressionRatio; + if (message.commitmentPlan != null && message.hasOwnProperty("commitmentPlan")) + object.commitmentPlan = options.enums === String ? $root.google.cloud.migrationcenter.v1.VmwareEnginePreferences.CommitmentPlan[message.commitmentPlan] === undefined ? message.commitmentPlan : $root.google.cloud.migrationcenter.v1.VmwareEnginePreferences.CommitmentPlan[message.commitmentPlan] : message.commitmentPlan; + return object; + }; + + /** + * Converts this VmwareEnginePreferences to JSON. + * @function toJSON + * @memberof google.cloud.migrationcenter.v1.VmwareEnginePreferences + * @instance + * @returns {Object.} JSON object + */ + VmwareEnginePreferences.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for VmwareEnginePreferences + * @function getTypeUrl + * @memberof google.cloud.migrationcenter.v1.VmwareEnginePreferences + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + VmwareEnginePreferences.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.migrationcenter.v1.VmwareEnginePreferences"; + }; + + /** + * CommitmentPlan enum. + * @name google.cloud.migrationcenter.v1.VmwareEnginePreferences.CommitmentPlan + * @enum {number} + * @property {number} COMMITMENT_PLAN_UNSPECIFIED=0 COMMITMENT_PLAN_UNSPECIFIED value + * @property {number} ON_DEMAND=1 ON_DEMAND value + * @property {number} COMMITMENT_1_YEAR_MONTHLY_PAYMENTS=2 COMMITMENT_1_YEAR_MONTHLY_PAYMENTS value + * @property {number} COMMITMENT_3_YEAR_MONTHLY_PAYMENTS=3 COMMITMENT_3_YEAR_MONTHLY_PAYMENTS value + * @property {number} COMMITMENT_1_YEAR_UPFRONT_PAYMENT=4 COMMITMENT_1_YEAR_UPFRONT_PAYMENT value + * @property {number} COMMITMENT_3_YEAR_UPFRONT_PAYMENT=5 COMMITMENT_3_YEAR_UPFRONT_PAYMENT value + */ + VmwareEnginePreferences.CommitmentPlan = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "COMMITMENT_PLAN_UNSPECIFIED"] = 0; + values[valuesById[1] = "ON_DEMAND"] = 1; + values[valuesById[2] = "COMMITMENT_1_YEAR_MONTHLY_PAYMENTS"] = 2; + values[valuesById[3] = "COMMITMENT_3_YEAR_MONTHLY_PAYMENTS"] = 3; + values[valuesById[4] = "COMMITMENT_1_YEAR_UPFRONT_PAYMENT"] = 4; + values[valuesById[5] = "COMMITMENT_3_YEAR_UPFRONT_PAYMENT"] = 5; + return values; + })(); + + return VmwareEnginePreferences; + })(); + + v1.SoleTenancyPreferences = (function() { + + /** + * Properties of a SoleTenancyPreferences. + * @memberof google.cloud.migrationcenter.v1 + * @interface ISoleTenancyPreferences + * @property {number|null} [cpuOvercommitRatio] SoleTenancyPreferences cpuOvercommitRatio + * @property {google.cloud.migrationcenter.v1.SoleTenancyPreferences.HostMaintenancePolicy|null} [hostMaintenancePolicy] SoleTenancyPreferences hostMaintenancePolicy + * @property {google.cloud.migrationcenter.v1.SoleTenancyPreferences.CommitmentPlan|null} [commitmentPlan] SoleTenancyPreferences commitmentPlan + * @property {Array.|null} [nodeTypes] SoleTenancyPreferences nodeTypes + */ + + /** + * Constructs a new SoleTenancyPreferences. + * @memberof google.cloud.migrationcenter.v1 + * @classdesc Represents a SoleTenancyPreferences. + * @implements ISoleTenancyPreferences + * @constructor + * @param {google.cloud.migrationcenter.v1.ISoleTenancyPreferences=} [properties] Properties to set + */ + function SoleTenancyPreferences(properties) { + this.nodeTypes = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * SoleTenancyPreferences cpuOvercommitRatio. + * @member {number} cpuOvercommitRatio + * @memberof google.cloud.migrationcenter.v1.SoleTenancyPreferences + * @instance + */ + SoleTenancyPreferences.prototype.cpuOvercommitRatio = 0; + + /** + * SoleTenancyPreferences hostMaintenancePolicy. + * @member {google.cloud.migrationcenter.v1.SoleTenancyPreferences.HostMaintenancePolicy} hostMaintenancePolicy + * @memberof google.cloud.migrationcenter.v1.SoleTenancyPreferences + * @instance + */ + SoleTenancyPreferences.prototype.hostMaintenancePolicy = 0; + + /** + * SoleTenancyPreferences commitmentPlan. + * @member {google.cloud.migrationcenter.v1.SoleTenancyPreferences.CommitmentPlan} commitmentPlan + * @memberof google.cloud.migrationcenter.v1.SoleTenancyPreferences + * @instance + */ + SoleTenancyPreferences.prototype.commitmentPlan = 0; + + /** + * SoleTenancyPreferences nodeTypes. + * @member {Array.} nodeTypes + * @memberof google.cloud.migrationcenter.v1.SoleTenancyPreferences + * @instance + */ + SoleTenancyPreferences.prototype.nodeTypes = $util.emptyArray; + + /** + * Creates a new SoleTenancyPreferences instance using the specified properties. + * @function create + * @memberof google.cloud.migrationcenter.v1.SoleTenancyPreferences + * @static + * @param {google.cloud.migrationcenter.v1.ISoleTenancyPreferences=} [properties] Properties to set + * @returns {google.cloud.migrationcenter.v1.SoleTenancyPreferences} SoleTenancyPreferences instance + */ + SoleTenancyPreferences.create = function create(properties) { + return new SoleTenancyPreferences(properties); + }; + + /** + * Encodes the specified SoleTenancyPreferences message. Does not implicitly {@link google.cloud.migrationcenter.v1.SoleTenancyPreferences.verify|verify} messages. + * @function encode + * @memberof google.cloud.migrationcenter.v1.SoleTenancyPreferences + * @static + * @param {google.cloud.migrationcenter.v1.ISoleTenancyPreferences} message SoleTenancyPreferences message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SoleTenancyPreferences.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.cpuOvercommitRatio != null && Object.hasOwnProperty.call(message, "cpuOvercommitRatio")) + writer.uint32(/* id 1, wireType 1 =*/9).double(message.cpuOvercommitRatio); + if (message.hostMaintenancePolicy != null && Object.hasOwnProperty.call(message, "hostMaintenancePolicy")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.hostMaintenancePolicy); + if (message.commitmentPlan != null && Object.hasOwnProperty.call(message, "commitmentPlan")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.commitmentPlan); + if (message.nodeTypes != null && message.nodeTypes.length) + for (var i = 0; i < message.nodeTypes.length; ++i) + $root.google.cloud.migrationcenter.v1.SoleTenantNodeType.encode(message.nodeTypes[i], writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified SoleTenancyPreferences message, length delimited. Does not implicitly {@link google.cloud.migrationcenter.v1.SoleTenancyPreferences.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.migrationcenter.v1.SoleTenancyPreferences + * @static + * @param {google.cloud.migrationcenter.v1.ISoleTenancyPreferences} message SoleTenancyPreferences message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SoleTenancyPreferences.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a SoleTenancyPreferences message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.migrationcenter.v1.SoleTenancyPreferences + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.migrationcenter.v1.SoleTenancyPreferences} SoleTenancyPreferences + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SoleTenancyPreferences.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.migrationcenter.v1.SoleTenancyPreferences(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.cpuOvercommitRatio = reader.double(); + break; + } + case 2: { + message.hostMaintenancePolicy = reader.int32(); + break; + } + case 3: { + message.commitmentPlan = reader.int32(); + break; + } + case 4: { + if (!(message.nodeTypes && message.nodeTypes.length)) + message.nodeTypes = []; + message.nodeTypes.push($root.google.cloud.migrationcenter.v1.SoleTenantNodeType.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a SoleTenancyPreferences message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.migrationcenter.v1.SoleTenancyPreferences + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.migrationcenter.v1.SoleTenancyPreferences} SoleTenancyPreferences + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SoleTenancyPreferences.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a SoleTenancyPreferences message. + * @function verify + * @memberof google.cloud.migrationcenter.v1.SoleTenancyPreferences + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + SoleTenancyPreferences.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.cpuOvercommitRatio != null && message.hasOwnProperty("cpuOvercommitRatio")) + if (typeof message.cpuOvercommitRatio !== "number") + return "cpuOvercommitRatio: number expected"; + if (message.hostMaintenancePolicy != null && message.hasOwnProperty("hostMaintenancePolicy")) + switch (message.hostMaintenancePolicy) { + default: + return "hostMaintenancePolicy: enum value expected"; + case 0: + case 1: + case 2: + case 3: + break; + } + if (message.commitmentPlan != null && message.hasOwnProperty("commitmentPlan")) + switch (message.commitmentPlan) { + default: + return "commitmentPlan: enum value expected"; + case 0: + case 1: + case 2: + case 3: + break; + } + if (message.nodeTypes != null && message.hasOwnProperty("nodeTypes")) { + if (!Array.isArray(message.nodeTypes)) + return "nodeTypes: array expected"; + for (var i = 0; i < message.nodeTypes.length; ++i) { + var error = $root.google.cloud.migrationcenter.v1.SoleTenantNodeType.verify(message.nodeTypes[i]); + if (error) + return "nodeTypes." + error; + } + } + return null; + }; + + /** + * Creates a SoleTenancyPreferences message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.migrationcenter.v1.SoleTenancyPreferences + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.migrationcenter.v1.SoleTenancyPreferences} SoleTenancyPreferences + */ + SoleTenancyPreferences.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.migrationcenter.v1.SoleTenancyPreferences) + return object; + var message = new $root.google.cloud.migrationcenter.v1.SoleTenancyPreferences(); + if (object.cpuOvercommitRatio != null) + message.cpuOvercommitRatio = Number(object.cpuOvercommitRatio); + switch (object.hostMaintenancePolicy) { + default: + if (typeof object.hostMaintenancePolicy === "number") { + message.hostMaintenancePolicy = object.hostMaintenancePolicy; + break; + } + break; + case "HOST_MAINTENANCE_POLICY_UNSPECIFIED": + case 0: + message.hostMaintenancePolicy = 0; + break; + case "HOST_MAINTENANCE_POLICY_DEFAULT": + case 1: + message.hostMaintenancePolicy = 1; + break; + case "HOST_MAINTENANCE_POLICY_RESTART_IN_PLACE": + case 2: + message.hostMaintenancePolicy = 2; + break; + case "HOST_MAINTENANCE_POLICY_MIGRATE_WITHIN_NODE_GROUP": + case 3: + message.hostMaintenancePolicy = 3; + break; + } + switch (object.commitmentPlan) { + default: + if (typeof object.commitmentPlan === "number") { + message.commitmentPlan = object.commitmentPlan; + break; + } + break; + case "COMMITMENT_PLAN_UNSPECIFIED": + case 0: + message.commitmentPlan = 0; + break; + case "ON_DEMAND": + case 1: + message.commitmentPlan = 1; + break; + case "COMMITMENT_1_YEAR": + case 2: + message.commitmentPlan = 2; + break; + case "COMMITMENT_3_YEAR": + case 3: + message.commitmentPlan = 3; + break; + } + if (object.nodeTypes) { + if (!Array.isArray(object.nodeTypes)) + throw TypeError(".google.cloud.migrationcenter.v1.SoleTenancyPreferences.nodeTypes: array expected"); + message.nodeTypes = []; + for (var i = 0; i < object.nodeTypes.length; ++i) { + if (typeof object.nodeTypes[i] !== "object") + throw TypeError(".google.cloud.migrationcenter.v1.SoleTenancyPreferences.nodeTypes: object expected"); + message.nodeTypes[i] = $root.google.cloud.migrationcenter.v1.SoleTenantNodeType.fromObject(object.nodeTypes[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a SoleTenancyPreferences message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.migrationcenter.v1.SoleTenancyPreferences + * @static + * @param {google.cloud.migrationcenter.v1.SoleTenancyPreferences} message SoleTenancyPreferences + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + SoleTenancyPreferences.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.nodeTypes = []; + if (options.defaults) { + object.cpuOvercommitRatio = 0; + object.hostMaintenancePolicy = options.enums === String ? "HOST_MAINTENANCE_POLICY_UNSPECIFIED" : 0; + object.commitmentPlan = options.enums === String ? "COMMITMENT_PLAN_UNSPECIFIED" : 0; + } + if (message.cpuOvercommitRatio != null && message.hasOwnProperty("cpuOvercommitRatio")) + object.cpuOvercommitRatio = options.json && !isFinite(message.cpuOvercommitRatio) ? String(message.cpuOvercommitRatio) : message.cpuOvercommitRatio; + if (message.hostMaintenancePolicy != null && message.hasOwnProperty("hostMaintenancePolicy")) + object.hostMaintenancePolicy = options.enums === String ? $root.google.cloud.migrationcenter.v1.SoleTenancyPreferences.HostMaintenancePolicy[message.hostMaintenancePolicy] === undefined ? message.hostMaintenancePolicy : $root.google.cloud.migrationcenter.v1.SoleTenancyPreferences.HostMaintenancePolicy[message.hostMaintenancePolicy] : message.hostMaintenancePolicy; + if (message.commitmentPlan != null && message.hasOwnProperty("commitmentPlan")) + object.commitmentPlan = options.enums === String ? $root.google.cloud.migrationcenter.v1.SoleTenancyPreferences.CommitmentPlan[message.commitmentPlan] === undefined ? message.commitmentPlan : $root.google.cloud.migrationcenter.v1.SoleTenancyPreferences.CommitmentPlan[message.commitmentPlan] : message.commitmentPlan; + if (message.nodeTypes && message.nodeTypes.length) { + object.nodeTypes = []; + for (var j = 0; j < message.nodeTypes.length; ++j) + object.nodeTypes[j] = $root.google.cloud.migrationcenter.v1.SoleTenantNodeType.toObject(message.nodeTypes[j], options); + } + return object; + }; + + /** + * Converts this SoleTenancyPreferences to JSON. + * @function toJSON + * @memberof google.cloud.migrationcenter.v1.SoleTenancyPreferences + * @instance + * @returns {Object.} JSON object + */ + SoleTenancyPreferences.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for SoleTenancyPreferences + * @function getTypeUrl + * @memberof google.cloud.migrationcenter.v1.SoleTenancyPreferences + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + SoleTenancyPreferences.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.migrationcenter.v1.SoleTenancyPreferences"; + }; + + /** + * HostMaintenancePolicy enum. + * @name google.cloud.migrationcenter.v1.SoleTenancyPreferences.HostMaintenancePolicy + * @enum {number} + * @property {number} HOST_MAINTENANCE_POLICY_UNSPECIFIED=0 HOST_MAINTENANCE_POLICY_UNSPECIFIED value + * @property {number} HOST_MAINTENANCE_POLICY_DEFAULT=1 HOST_MAINTENANCE_POLICY_DEFAULT value + * @property {number} HOST_MAINTENANCE_POLICY_RESTART_IN_PLACE=2 HOST_MAINTENANCE_POLICY_RESTART_IN_PLACE value + * @property {number} HOST_MAINTENANCE_POLICY_MIGRATE_WITHIN_NODE_GROUP=3 HOST_MAINTENANCE_POLICY_MIGRATE_WITHIN_NODE_GROUP value + */ + SoleTenancyPreferences.HostMaintenancePolicy = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "HOST_MAINTENANCE_POLICY_UNSPECIFIED"] = 0; + values[valuesById[1] = "HOST_MAINTENANCE_POLICY_DEFAULT"] = 1; + values[valuesById[2] = "HOST_MAINTENANCE_POLICY_RESTART_IN_PLACE"] = 2; + values[valuesById[3] = "HOST_MAINTENANCE_POLICY_MIGRATE_WITHIN_NODE_GROUP"] = 3; + return values; + })(); + + /** + * CommitmentPlan enum. + * @name google.cloud.migrationcenter.v1.SoleTenancyPreferences.CommitmentPlan + * @enum {number} + * @property {number} COMMITMENT_PLAN_UNSPECIFIED=0 COMMITMENT_PLAN_UNSPECIFIED value + * @property {number} ON_DEMAND=1 ON_DEMAND value + * @property {number} COMMITMENT_1_YEAR=2 COMMITMENT_1_YEAR value + * @property {number} COMMITMENT_3_YEAR=3 COMMITMENT_3_YEAR value + */ + SoleTenancyPreferences.CommitmentPlan = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "COMMITMENT_PLAN_UNSPECIFIED"] = 0; + values[valuesById[1] = "ON_DEMAND"] = 1; + values[valuesById[2] = "COMMITMENT_1_YEAR"] = 2; + values[valuesById[3] = "COMMITMENT_3_YEAR"] = 3; + return values; + })(); + + return SoleTenancyPreferences; + })(); + + v1.SoleTenantNodeType = (function() { + + /** + * Properties of a SoleTenantNodeType. + * @memberof google.cloud.migrationcenter.v1 + * @interface ISoleTenantNodeType + * @property {string|null} [nodeName] SoleTenantNodeType nodeName + */ + + /** + * Constructs a new SoleTenantNodeType. + * @memberof google.cloud.migrationcenter.v1 + * @classdesc Represents a SoleTenantNodeType. + * @implements ISoleTenantNodeType + * @constructor + * @param {google.cloud.migrationcenter.v1.ISoleTenantNodeType=} [properties] Properties to set + */ + function SoleTenantNodeType(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * SoleTenantNodeType nodeName. + * @member {string} nodeName + * @memberof google.cloud.migrationcenter.v1.SoleTenantNodeType + * @instance + */ + SoleTenantNodeType.prototype.nodeName = ""; + + /** + * Creates a new SoleTenantNodeType instance using the specified properties. + * @function create + * @memberof google.cloud.migrationcenter.v1.SoleTenantNodeType + * @static + * @param {google.cloud.migrationcenter.v1.ISoleTenantNodeType=} [properties] Properties to set + * @returns {google.cloud.migrationcenter.v1.SoleTenantNodeType} SoleTenantNodeType instance + */ + SoleTenantNodeType.create = function create(properties) { + return new SoleTenantNodeType(properties); + }; + + /** + * Encodes the specified SoleTenantNodeType message. Does not implicitly {@link google.cloud.migrationcenter.v1.SoleTenantNodeType.verify|verify} messages. + * @function encode + * @memberof google.cloud.migrationcenter.v1.SoleTenantNodeType + * @static + * @param {google.cloud.migrationcenter.v1.ISoleTenantNodeType} message SoleTenantNodeType message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SoleTenantNodeType.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.nodeName != null && Object.hasOwnProperty.call(message, "nodeName")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.nodeName); + return writer; + }; + + /** + * Encodes the specified SoleTenantNodeType message, length delimited. Does not implicitly {@link google.cloud.migrationcenter.v1.SoleTenantNodeType.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.migrationcenter.v1.SoleTenantNodeType + * @static + * @param {google.cloud.migrationcenter.v1.ISoleTenantNodeType} message SoleTenantNodeType message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SoleTenantNodeType.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a SoleTenantNodeType message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.migrationcenter.v1.SoleTenantNodeType + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.migrationcenter.v1.SoleTenantNodeType} SoleTenantNodeType + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SoleTenantNodeType.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.migrationcenter.v1.SoleTenantNodeType(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.nodeName = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a SoleTenantNodeType message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.migrationcenter.v1.SoleTenantNodeType + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.migrationcenter.v1.SoleTenantNodeType} SoleTenantNodeType + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SoleTenantNodeType.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a SoleTenantNodeType message. + * @function verify + * @memberof google.cloud.migrationcenter.v1.SoleTenantNodeType + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + SoleTenantNodeType.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.nodeName != null && message.hasOwnProperty("nodeName")) + if (!$util.isString(message.nodeName)) + return "nodeName: string expected"; + return null; + }; + + /** + * Creates a SoleTenantNodeType message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.migrationcenter.v1.SoleTenantNodeType + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.migrationcenter.v1.SoleTenantNodeType} SoleTenantNodeType + */ + SoleTenantNodeType.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.migrationcenter.v1.SoleTenantNodeType) + return object; + var message = new $root.google.cloud.migrationcenter.v1.SoleTenantNodeType(); + if (object.nodeName != null) + message.nodeName = String(object.nodeName); + return message; + }; + + /** + * Creates a plain object from a SoleTenantNodeType message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.migrationcenter.v1.SoleTenantNodeType + * @static + * @param {google.cloud.migrationcenter.v1.SoleTenantNodeType} message SoleTenantNodeType + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + SoleTenantNodeType.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.nodeName = ""; + if (message.nodeName != null && message.hasOwnProperty("nodeName")) + object.nodeName = message.nodeName; + return object; + }; + + /** + * Converts this SoleTenantNodeType to JSON. + * @function toJSON + * @memberof google.cloud.migrationcenter.v1.SoleTenantNodeType + * @instance + * @returns {Object.} JSON object + */ + SoleTenantNodeType.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for SoleTenantNodeType + * @function getTypeUrl + * @memberof google.cloud.migrationcenter.v1.SoleTenantNodeType + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + SoleTenantNodeType.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.migrationcenter.v1.SoleTenantNodeType"; + }; + + return SoleTenantNodeType; + })(); + + v1.RegionPreferences = (function() { + + /** + * Properties of a RegionPreferences. + * @memberof google.cloud.migrationcenter.v1 + * @interface IRegionPreferences + * @property {Array.|null} [preferredRegions] RegionPreferences preferredRegions + */ + + /** + * Constructs a new RegionPreferences. + * @memberof google.cloud.migrationcenter.v1 + * @classdesc Represents a RegionPreferences. + * @implements IRegionPreferences + * @constructor + * @param {google.cloud.migrationcenter.v1.IRegionPreferences=} [properties] Properties to set + */ + function RegionPreferences(properties) { + this.preferredRegions = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * RegionPreferences preferredRegions. + * @member {Array.} preferredRegions + * @memberof google.cloud.migrationcenter.v1.RegionPreferences + * @instance + */ + RegionPreferences.prototype.preferredRegions = $util.emptyArray; + + /** + * Creates a new RegionPreferences instance using the specified properties. + * @function create + * @memberof google.cloud.migrationcenter.v1.RegionPreferences + * @static + * @param {google.cloud.migrationcenter.v1.IRegionPreferences=} [properties] Properties to set + * @returns {google.cloud.migrationcenter.v1.RegionPreferences} RegionPreferences instance + */ + RegionPreferences.create = function create(properties) { + return new RegionPreferences(properties); + }; + + /** + * Encodes the specified RegionPreferences message. Does not implicitly {@link google.cloud.migrationcenter.v1.RegionPreferences.verify|verify} messages. + * @function encode + * @memberof google.cloud.migrationcenter.v1.RegionPreferences + * @static + * @param {google.cloud.migrationcenter.v1.IRegionPreferences} message RegionPreferences message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RegionPreferences.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.preferredRegions != null && message.preferredRegions.length) + for (var i = 0; i < message.preferredRegions.length; ++i) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.preferredRegions[i]); + return writer; + }; + + /** + * Encodes the specified RegionPreferences message, length delimited. Does not implicitly {@link google.cloud.migrationcenter.v1.RegionPreferences.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.migrationcenter.v1.RegionPreferences + * @static + * @param {google.cloud.migrationcenter.v1.IRegionPreferences} message RegionPreferences message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RegionPreferences.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a RegionPreferences message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.migrationcenter.v1.RegionPreferences + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.migrationcenter.v1.RegionPreferences} RegionPreferences + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RegionPreferences.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.migrationcenter.v1.RegionPreferences(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.preferredRegions && message.preferredRegions.length)) + message.preferredRegions = []; + message.preferredRegions.push(reader.string()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a RegionPreferences message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.migrationcenter.v1.RegionPreferences + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.migrationcenter.v1.RegionPreferences} RegionPreferences + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RegionPreferences.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a RegionPreferences message. + * @function verify + * @memberof google.cloud.migrationcenter.v1.RegionPreferences + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + RegionPreferences.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.preferredRegions != null && message.hasOwnProperty("preferredRegions")) { + if (!Array.isArray(message.preferredRegions)) + return "preferredRegions: array expected"; + for (var i = 0; i < message.preferredRegions.length; ++i) + if (!$util.isString(message.preferredRegions[i])) + return "preferredRegions: string[] expected"; + } + return null; + }; + + /** + * Creates a RegionPreferences message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.migrationcenter.v1.RegionPreferences + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.migrationcenter.v1.RegionPreferences} RegionPreferences + */ + RegionPreferences.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.migrationcenter.v1.RegionPreferences) + return object; + var message = new $root.google.cloud.migrationcenter.v1.RegionPreferences(); + if (object.preferredRegions) { + if (!Array.isArray(object.preferredRegions)) + throw TypeError(".google.cloud.migrationcenter.v1.RegionPreferences.preferredRegions: array expected"); + message.preferredRegions = []; + for (var i = 0; i < object.preferredRegions.length; ++i) + message.preferredRegions[i] = String(object.preferredRegions[i]); + } + return message; + }; + + /** + * Creates a plain object from a RegionPreferences message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.migrationcenter.v1.RegionPreferences + * @static + * @param {google.cloud.migrationcenter.v1.RegionPreferences} message RegionPreferences + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + RegionPreferences.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.preferredRegions = []; + if (message.preferredRegions && message.preferredRegions.length) { + object.preferredRegions = []; + for (var j = 0; j < message.preferredRegions.length; ++j) + object.preferredRegions[j] = message.preferredRegions[j]; + } + return object; + }; + + /** + * Converts this RegionPreferences to JSON. + * @function toJSON + * @memberof google.cloud.migrationcenter.v1.RegionPreferences + * @instance + * @returns {Object.} JSON object + */ + RegionPreferences.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for RegionPreferences + * @function getTypeUrl + * @memberof google.cloud.migrationcenter.v1.RegionPreferences + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + RegionPreferences.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.migrationcenter.v1.RegionPreferences"; + }; + + return RegionPreferences; + })(); + + v1.Settings = (function() { + + /** + * Properties of a Settings. + * @memberof google.cloud.migrationcenter.v1 + * @interface ISettings + * @property {string|null} [name] Settings name + * @property {string|null} [preferenceSet] Settings preferenceSet + */ + + /** + * Constructs a new Settings. + * @memberof google.cloud.migrationcenter.v1 + * @classdesc Represents a Settings. + * @implements ISettings + * @constructor + * @param {google.cloud.migrationcenter.v1.ISettings=} [properties] Properties to set + */ + function Settings(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Settings name. + * @member {string} name + * @memberof google.cloud.migrationcenter.v1.Settings + * @instance + */ + Settings.prototype.name = ""; + + /** + * Settings preferenceSet. + * @member {string} preferenceSet + * @memberof google.cloud.migrationcenter.v1.Settings + * @instance + */ + Settings.prototype.preferenceSet = ""; + + /** + * Creates a new Settings instance using the specified properties. + * @function create + * @memberof google.cloud.migrationcenter.v1.Settings + * @static + * @param {google.cloud.migrationcenter.v1.ISettings=} [properties] Properties to set + * @returns {google.cloud.migrationcenter.v1.Settings} Settings instance + */ + Settings.create = function create(properties) { + return new Settings(properties); + }; + + /** + * Encodes the specified Settings message. Does not implicitly {@link google.cloud.migrationcenter.v1.Settings.verify|verify} messages. + * @function encode + * @memberof google.cloud.migrationcenter.v1.Settings + * @static + * @param {google.cloud.migrationcenter.v1.ISettings} message Settings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Settings.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.preferenceSet != null && Object.hasOwnProperty.call(message, "preferenceSet")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.preferenceSet); + return writer; + }; + + /** + * Encodes the specified Settings message, length delimited. Does not implicitly {@link google.cloud.migrationcenter.v1.Settings.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.migrationcenter.v1.Settings + * @static + * @param {google.cloud.migrationcenter.v1.ISettings} message Settings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Settings.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Settings message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.migrationcenter.v1.Settings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.migrationcenter.v1.Settings} Settings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Settings.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.migrationcenter.v1.Settings(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.preferenceSet = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Settings message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.migrationcenter.v1.Settings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.migrationcenter.v1.Settings} Settings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Settings.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Settings message. + * @function verify + * @memberof google.cloud.migrationcenter.v1.Settings + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Settings.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.preferenceSet != null && message.hasOwnProperty("preferenceSet")) + if (!$util.isString(message.preferenceSet)) + return "preferenceSet: string expected"; + return null; + }; + + /** + * Creates a Settings message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.migrationcenter.v1.Settings + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.migrationcenter.v1.Settings} Settings + */ + Settings.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.migrationcenter.v1.Settings) + return object; + var message = new $root.google.cloud.migrationcenter.v1.Settings(); + if (object.name != null) + message.name = String(object.name); + if (object.preferenceSet != null) + message.preferenceSet = String(object.preferenceSet); + return message; + }; + + /** + * Creates a plain object from a Settings message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.migrationcenter.v1.Settings + * @static + * @param {google.cloud.migrationcenter.v1.Settings} message Settings + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Settings.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.preferenceSet = ""; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.preferenceSet != null && message.hasOwnProperty("preferenceSet")) + object.preferenceSet = message.preferenceSet; + return object; + }; + + /** + * Converts this Settings to JSON. + * @function toJSON + * @memberof google.cloud.migrationcenter.v1.Settings + * @instance + * @returns {Object.} JSON object + */ + Settings.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Settings + * @function getTypeUrl + * @memberof google.cloud.migrationcenter.v1.Settings + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Settings.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.migrationcenter.v1.Settings"; + }; + + return Settings; + })(); + + v1.ReportSummary = (function() { + + /** + * Properties of a ReportSummary. + * @memberof google.cloud.migrationcenter.v1 + * @interface IReportSummary + * @property {google.cloud.migrationcenter.v1.ReportSummary.IAssetAggregateStats|null} [allAssetsStats] ReportSummary allAssetsStats + * @property {Array.|null} [groupFindings] ReportSummary groupFindings + */ + + /** + * Constructs a new ReportSummary. + * @memberof google.cloud.migrationcenter.v1 + * @classdesc Represents a ReportSummary. + * @implements IReportSummary + * @constructor + * @param {google.cloud.migrationcenter.v1.IReportSummary=} [properties] Properties to set + */ + function ReportSummary(properties) { + this.groupFindings = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ReportSummary allAssetsStats. + * @member {google.cloud.migrationcenter.v1.ReportSummary.IAssetAggregateStats|null|undefined} allAssetsStats + * @memberof google.cloud.migrationcenter.v1.ReportSummary + * @instance + */ + ReportSummary.prototype.allAssetsStats = null; + + /** + * ReportSummary groupFindings. + * @member {Array.} groupFindings + * @memberof google.cloud.migrationcenter.v1.ReportSummary + * @instance + */ + ReportSummary.prototype.groupFindings = $util.emptyArray; + + /** + * Creates a new ReportSummary instance using the specified properties. + * @function create + * @memberof google.cloud.migrationcenter.v1.ReportSummary + * @static + * @param {google.cloud.migrationcenter.v1.IReportSummary=} [properties] Properties to set + * @returns {google.cloud.migrationcenter.v1.ReportSummary} ReportSummary instance + */ + ReportSummary.create = function create(properties) { + return new ReportSummary(properties); + }; + + /** + * Encodes the specified ReportSummary message. Does not implicitly {@link google.cloud.migrationcenter.v1.ReportSummary.verify|verify} messages. + * @function encode + * @memberof google.cloud.migrationcenter.v1.ReportSummary + * @static + * @param {google.cloud.migrationcenter.v1.IReportSummary} message ReportSummary message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ReportSummary.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.allAssetsStats != null && Object.hasOwnProperty.call(message, "allAssetsStats")) + $root.google.cloud.migrationcenter.v1.ReportSummary.AssetAggregateStats.encode(message.allAssetsStats, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.groupFindings != null && message.groupFindings.length) + for (var i = 0; i < message.groupFindings.length; ++i) + $root.google.cloud.migrationcenter.v1.ReportSummary.GroupFinding.encode(message.groupFindings[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified ReportSummary message, length delimited. Does not implicitly {@link google.cloud.migrationcenter.v1.ReportSummary.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.migrationcenter.v1.ReportSummary + * @static + * @param {google.cloud.migrationcenter.v1.IReportSummary} message ReportSummary message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ReportSummary.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ReportSummary message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.migrationcenter.v1.ReportSummary + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.migrationcenter.v1.ReportSummary} ReportSummary + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ReportSummary.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.migrationcenter.v1.ReportSummary(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.allAssetsStats = $root.google.cloud.migrationcenter.v1.ReportSummary.AssetAggregateStats.decode(reader, reader.uint32()); + break; + } + case 2: { + if (!(message.groupFindings && message.groupFindings.length)) + message.groupFindings = []; + message.groupFindings.push($root.google.cloud.migrationcenter.v1.ReportSummary.GroupFinding.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ReportSummary message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.migrationcenter.v1.ReportSummary + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.migrationcenter.v1.ReportSummary} ReportSummary + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ReportSummary.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ReportSummary message. + * @function verify + * @memberof google.cloud.migrationcenter.v1.ReportSummary + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ReportSummary.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.allAssetsStats != null && message.hasOwnProperty("allAssetsStats")) { + var error = $root.google.cloud.migrationcenter.v1.ReportSummary.AssetAggregateStats.verify(message.allAssetsStats); + if (error) + return "allAssetsStats." + error; + } + if (message.groupFindings != null && message.hasOwnProperty("groupFindings")) { + if (!Array.isArray(message.groupFindings)) + return "groupFindings: array expected"; + for (var i = 0; i < message.groupFindings.length; ++i) { + var error = $root.google.cloud.migrationcenter.v1.ReportSummary.GroupFinding.verify(message.groupFindings[i]); + if (error) + return "groupFindings." + error; + } + } + return null; + }; + + /** + * Creates a ReportSummary message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.migrationcenter.v1.ReportSummary + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.migrationcenter.v1.ReportSummary} ReportSummary + */ + ReportSummary.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.migrationcenter.v1.ReportSummary) + return object; + var message = new $root.google.cloud.migrationcenter.v1.ReportSummary(); + if (object.allAssetsStats != null) { + if (typeof object.allAssetsStats !== "object") + throw TypeError(".google.cloud.migrationcenter.v1.ReportSummary.allAssetsStats: object expected"); + message.allAssetsStats = $root.google.cloud.migrationcenter.v1.ReportSummary.AssetAggregateStats.fromObject(object.allAssetsStats); + } + if (object.groupFindings) { + if (!Array.isArray(object.groupFindings)) + throw TypeError(".google.cloud.migrationcenter.v1.ReportSummary.groupFindings: array expected"); + message.groupFindings = []; + for (var i = 0; i < object.groupFindings.length; ++i) { + if (typeof object.groupFindings[i] !== "object") + throw TypeError(".google.cloud.migrationcenter.v1.ReportSummary.groupFindings: object expected"); + message.groupFindings[i] = $root.google.cloud.migrationcenter.v1.ReportSummary.GroupFinding.fromObject(object.groupFindings[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a ReportSummary message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.migrationcenter.v1.ReportSummary + * @static + * @param {google.cloud.migrationcenter.v1.ReportSummary} message ReportSummary + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ReportSummary.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.groupFindings = []; + if (options.defaults) + object.allAssetsStats = null; + if (message.allAssetsStats != null && message.hasOwnProperty("allAssetsStats")) + object.allAssetsStats = $root.google.cloud.migrationcenter.v1.ReportSummary.AssetAggregateStats.toObject(message.allAssetsStats, options); + if (message.groupFindings && message.groupFindings.length) { + object.groupFindings = []; + for (var j = 0; j < message.groupFindings.length; ++j) + object.groupFindings[j] = $root.google.cloud.migrationcenter.v1.ReportSummary.GroupFinding.toObject(message.groupFindings[j], options); + } + return object; + }; + + /** + * Converts this ReportSummary to JSON. + * @function toJSON + * @memberof google.cloud.migrationcenter.v1.ReportSummary + * @instance + * @returns {Object.} JSON object + */ + ReportSummary.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ReportSummary + * @function getTypeUrl + * @memberof google.cloud.migrationcenter.v1.ReportSummary + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ReportSummary.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.migrationcenter.v1.ReportSummary"; + }; + + ReportSummary.ChartData = (function() { + + /** + * Properties of a ChartData. + * @memberof google.cloud.migrationcenter.v1.ReportSummary + * @interface IChartData + * @property {Array.|null} [dataPoints] ChartData dataPoints + */ + + /** + * Constructs a new ChartData. + * @memberof google.cloud.migrationcenter.v1.ReportSummary + * @classdesc Represents a ChartData. + * @implements IChartData + * @constructor + * @param {google.cloud.migrationcenter.v1.ReportSummary.IChartData=} [properties] Properties to set + */ + function ChartData(properties) { + this.dataPoints = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ChartData dataPoints. + * @member {Array.} dataPoints + * @memberof google.cloud.migrationcenter.v1.ReportSummary.ChartData + * @instance + */ + ChartData.prototype.dataPoints = $util.emptyArray; + + /** + * Creates a new ChartData instance using the specified properties. + * @function create + * @memberof google.cloud.migrationcenter.v1.ReportSummary.ChartData + * @static + * @param {google.cloud.migrationcenter.v1.ReportSummary.IChartData=} [properties] Properties to set + * @returns {google.cloud.migrationcenter.v1.ReportSummary.ChartData} ChartData instance + */ + ChartData.create = function create(properties) { + return new ChartData(properties); + }; + + /** + * Encodes the specified ChartData message. Does not implicitly {@link google.cloud.migrationcenter.v1.ReportSummary.ChartData.verify|verify} messages. + * @function encode + * @memberof google.cloud.migrationcenter.v1.ReportSummary.ChartData + * @static + * @param {google.cloud.migrationcenter.v1.ReportSummary.IChartData} message ChartData message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ChartData.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.dataPoints != null && message.dataPoints.length) + for (var i = 0; i < message.dataPoints.length; ++i) + $root.google.cloud.migrationcenter.v1.ReportSummary.ChartData.DataPoint.encode(message.dataPoints[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified ChartData message, length delimited. Does not implicitly {@link google.cloud.migrationcenter.v1.ReportSummary.ChartData.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.migrationcenter.v1.ReportSummary.ChartData + * @static + * @param {google.cloud.migrationcenter.v1.ReportSummary.IChartData} message ChartData message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ChartData.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ChartData message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.migrationcenter.v1.ReportSummary.ChartData + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.migrationcenter.v1.ReportSummary.ChartData} ChartData + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ChartData.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.migrationcenter.v1.ReportSummary.ChartData(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.dataPoints && message.dataPoints.length)) + message.dataPoints = []; + message.dataPoints.push($root.google.cloud.migrationcenter.v1.ReportSummary.ChartData.DataPoint.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ChartData message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.migrationcenter.v1.ReportSummary.ChartData + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.migrationcenter.v1.ReportSummary.ChartData} ChartData + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ChartData.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ChartData message. + * @function verify + * @memberof google.cloud.migrationcenter.v1.ReportSummary.ChartData + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ChartData.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.dataPoints != null && message.hasOwnProperty("dataPoints")) { + if (!Array.isArray(message.dataPoints)) + return "dataPoints: array expected"; + for (var i = 0; i < message.dataPoints.length; ++i) { + var error = $root.google.cloud.migrationcenter.v1.ReportSummary.ChartData.DataPoint.verify(message.dataPoints[i]); + if (error) + return "dataPoints." + error; + } + } + return null; + }; + + /** + * Creates a ChartData message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.migrationcenter.v1.ReportSummary.ChartData + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.migrationcenter.v1.ReportSummary.ChartData} ChartData + */ + ChartData.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.migrationcenter.v1.ReportSummary.ChartData) + return object; + var message = new $root.google.cloud.migrationcenter.v1.ReportSummary.ChartData(); + if (object.dataPoints) { + if (!Array.isArray(object.dataPoints)) + throw TypeError(".google.cloud.migrationcenter.v1.ReportSummary.ChartData.dataPoints: array expected"); + message.dataPoints = []; + for (var i = 0; i < object.dataPoints.length; ++i) { + if (typeof object.dataPoints[i] !== "object") + throw TypeError(".google.cloud.migrationcenter.v1.ReportSummary.ChartData.dataPoints: object expected"); + message.dataPoints[i] = $root.google.cloud.migrationcenter.v1.ReportSummary.ChartData.DataPoint.fromObject(object.dataPoints[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a ChartData message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.migrationcenter.v1.ReportSummary.ChartData + * @static + * @param {google.cloud.migrationcenter.v1.ReportSummary.ChartData} message ChartData + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ChartData.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.dataPoints = []; + if (message.dataPoints && message.dataPoints.length) { + object.dataPoints = []; + for (var j = 0; j < message.dataPoints.length; ++j) + object.dataPoints[j] = $root.google.cloud.migrationcenter.v1.ReportSummary.ChartData.DataPoint.toObject(message.dataPoints[j], options); + } + return object; + }; + + /** + * Converts this ChartData to JSON. + * @function toJSON + * @memberof google.cloud.migrationcenter.v1.ReportSummary.ChartData + * @instance + * @returns {Object.} JSON object + */ + ChartData.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ChartData + * @function getTypeUrl + * @memberof google.cloud.migrationcenter.v1.ReportSummary.ChartData + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ChartData.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.migrationcenter.v1.ReportSummary.ChartData"; + }; + + ChartData.DataPoint = (function() { + + /** + * Properties of a DataPoint. + * @memberof google.cloud.migrationcenter.v1.ReportSummary.ChartData + * @interface IDataPoint + * @property {string|null} [label] DataPoint label + * @property {number|null} [value] DataPoint value + */ + + /** + * Constructs a new DataPoint. + * @memberof google.cloud.migrationcenter.v1.ReportSummary.ChartData + * @classdesc Represents a DataPoint. + * @implements IDataPoint + * @constructor + * @param {google.cloud.migrationcenter.v1.ReportSummary.ChartData.IDataPoint=} [properties] Properties to set + */ + function DataPoint(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * DataPoint label. + * @member {string} label + * @memberof google.cloud.migrationcenter.v1.ReportSummary.ChartData.DataPoint + * @instance + */ + DataPoint.prototype.label = ""; + + /** + * DataPoint value. + * @member {number} value + * @memberof google.cloud.migrationcenter.v1.ReportSummary.ChartData.DataPoint + * @instance + */ + DataPoint.prototype.value = 0; + + /** + * Creates a new DataPoint instance using the specified properties. + * @function create + * @memberof google.cloud.migrationcenter.v1.ReportSummary.ChartData.DataPoint + * @static + * @param {google.cloud.migrationcenter.v1.ReportSummary.ChartData.IDataPoint=} [properties] Properties to set + * @returns {google.cloud.migrationcenter.v1.ReportSummary.ChartData.DataPoint} DataPoint instance + */ + DataPoint.create = function create(properties) { + return new DataPoint(properties); + }; + + /** + * Encodes the specified DataPoint message. Does not implicitly {@link google.cloud.migrationcenter.v1.ReportSummary.ChartData.DataPoint.verify|verify} messages. + * @function encode + * @memberof google.cloud.migrationcenter.v1.ReportSummary.ChartData.DataPoint + * @static + * @param {google.cloud.migrationcenter.v1.ReportSummary.ChartData.IDataPoint} message DataPoint message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DataPoint.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.label != null && Object.hasOwnProperty.call(message, "label")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.label); + if (message.value != null && Object.hasOwnProperty.call(message, "value")) + writer.uint32(/* id 2, wireType 1 =*/17).double(message.value); + return writer; + }; + + /** + * Encodes the specified DataPoint message, length delimited. Does not implicitly {@link google.cloud.migrationcenter.v1.ReportSummary.ChartData.DataPoint.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.migrationcenter.v1.ReportSummary.ChartData.DataPoint + * @static + * @param {google.cloud.migrationcenter.v1.ReportSummary.ChartData.IDataPoint} message DataPoint message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DataPoint.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DataPoint message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.migrationcenter.v1.ReportSummary.ChartData.DataPoint + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.migrationcenter.v1.ReportSummary.ChartData.DataPoint} DataPoint + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DataPoint.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.migrationcenter.v1.ReportSummary.ChartData.DataPoint(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.label = reader.string(); + break; + } + case 2: { + message.value = reader.double(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DataPoint message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.migrationcenter.v1.ReportSummary.ChartData.DataPoint + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.migrationcenter.v1.ReportSummary.ChartData.DataPoint} DataPoint + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DataPoint.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DataPoint message. + * @function verify + * @memberof google.cloud.migrationcenter.v1.ReportSummary.ChartData.DataPoint + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DataPoint.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.label != null && message.hasOwnProperty("label")) + if (!$util.isString(message.label)) + return "label: string expected"; + if (message.value != null && message.hasOwnProperty("value")) + if (typeof message.value !== "number") + return "value: number expected"; + return null; + }; + + /** + * Creates a DataPoint message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.migrationcenter.v1.ReportSummary.ChartData.DataPoint + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.migrationcenter.v1.ReportSummary.ChartData.DataPoint} DataPoint + */ + DataPoint.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.migrationcenter.v1.ReportSummary.ChartData.DataPoint) + return object; + var message = new $root.google.cloud.migrationcenter.v1.ReportSummary.ChartData.DataPoint(); + if (object.label != null) + message.label = String(object.label); + if (object.value != null) + message.value = Number(object.value); + return message; + }; + + /** + * Creates a plain object from a DataPoint message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.migrationcenter.v1.ReportSummary.ChartData.DataPoint + * @static + * @param {google.cloud.migrationcenter.v1.ReportSummary.ChartData.DataPoint} message DataPoint + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DataPoint.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.label = ""; + object.value = 0; + } + if (message.label != null && message.hasOwnProperty("label")) + object.label = message.label; + if (message.value != null && message.hasOwnProperty("value")) + object.value = options.json && !isFinite(message.value) ? String(message.value) : message.value; + return object; + }; + + /** + * Converts this DataPoint to JSON. + * @function toJSON + * @memberof google.cloud.migrationcenter.v1.ReportSummary.ChartData.DataPoint + * @instance + * @returns {Object.} JSON object + */ + DataPoint.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DataPoint + * @function getTypeUrl + * @memberof google.cloud.migrationcenter.v1.ReportSummary.ChartData.DataPoint + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DataPoint.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.migrationcenter.v1.ReportSummary.ChartData.DataPoint"; + }; + + return DataPoint; + })(); + + return ChartData; + })(); + + ReportSummary.UtilizationChartData = (function() { + + /** + * Properties of an UtilizationChartData. + * @memberof google.cloud.migrationcenter.v1.ReportSummary + * @interface IUtilizationChartData + * @property {number|Long|null} [used] UtilizationChartData used + * @property {number|Long|null} [free] UtilizationChartData free + */ + + /** + * Constructs a new UtilizationChartData. + * @memberof google.cloud.migrationcenter.v1.ReportSummary + * @classdesc Represents an UtilizationChartData. + * @implements IUtilizationChartData + * @constructor + * @param {google.cloud.migrationcenter.v1.ReportSummary.IUtilizationChartData=} [properties] Properties to set + */ + function UtilizationChartData(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * UtilizationChartData used. + * @member {number|Long} used + * @memberof google.cloud.migrationcenter.v1.ReportSummary.UtilizationChartData + * @instance + */ + UtilizationChartData.prototype.used = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * UtilizationChartData free. + * @member {number|Long} free + * @memberof google.cloud.migrationcenter.v1.ReportSummary.UtilizationChartData + * @instance + */ + UtilizationChartData.prototype.free = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new UtilizationChartData instance using the specified properties. + * @function create + * @memberof google.cloud.migrationcenter.v1.ReportSummary.UtilizationChartData + * @static + * @param {google.cloud.migrationcenter.v1.ReportSummary.IUtilizationChartData=} [properties] Properties to set + * @returns {google.cloud.migrationcenter.v1.ReportSummary.UtilizationChartData} UtilizationChartData instance + */ + UtilizationChartData.create = function create(properties) { + return new UtilizationChartData(properties); + }; + + /** + * Encodes the specified UtilizationChartData message. Does not implicitly {@link google.cloud.migrationcenter.v1.ReportSummary.UtilizationChartData.verify|verify} messages. + * @function encode + * @memberof google.cloud.migrationcenter.v1.ReportSummary.UtilizationChartData + * @static + * @param {google.cloud.migrationcenter.v1.ReportSummary.IUtilizationChartData} message UtilizationChartData message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UtilizationChartData.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.used != null && Object.hasOwnProperty.call(message, "used")) + writer.uint32(/* id 1, wireType 0 =*/8).int64(message.used); + if (message.free != null && Object.hasOwnProperty.call(message, "free")) + writer.uint32(/* id 2, wireType 0 =*/16).int64(message.free); + return writer; + }; + + /** + * Encodes the specified UtilizationChartData message, length delimited. Does not implicitly {@link google.cloud.migrationcenter.v1.ReportSummary.UtilizationChartData.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.migrationcenter.v1.ReportSummary.UtilizationChartData + * @static + * @param {google.cloud.migrationcenter.v1.ReportSummary.IUtilizationChartData} message UtilizationChartData message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UtilizationChartData.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an UtilizationChartData message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.migrationcenter.v1.ReportSummary.UtilizationChartData + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.migrationcenter.v1.ReportSummary.UtilizationChartData} UtilizationChartData + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UtilizationChartData.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.migrationcenter.v1.ReportSummary.UtilizationChartData(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.used = reader.int64(); + break; + } + case 2: { + message.free = reader.int64(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an UtilizationChartData message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.migrationcenter.v1.ReportSummary.UtilizationChartData + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.migrationcenter.v1.ReportSummary.UtilizationChartData} UtilizationChartData + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UtilizationChartData.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an UtilizationChartData message. + * @function verify + * @memberof google.cloud.migrationcenter.v1.ReportSummary.UtilizationChartData + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + UtilizationChartData.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.used != null && message.hasOwnProperty("used")) + if (!$util.isInteger(message.used) && !(message.used && $util.isInteger(message.used.low) && $util.isInteger(message.used.high))) + return "used: integer|Long expected"; + if (message.free != null && message.hasOwnProperty("free")) + if (!$util.isInteger(message.free) && !(message.free && $util.isInteger(message.free.low) && $util.isInteger(message.free.high))) + return "free: integer|Long expected"; + return null; + }; + + /** + * Creates an UtilizationChartData message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.migrationcenter.v1.ReportSummary.UtilizationChartData + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.migrationcenter.v1.ReportSummary.UtilizationChartData} UtilizationChartData + */ + UtilizationChartData.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.migrationcenter.v1.ReportSummary.UtilizationChartData) + return object; + var message = new $root.google.cloud.migrationcenter.v1.ReportSummary.UtilizationChartData(); + if (object.used != null) + if ($util.Long) + (message.used = $util.Long.fromValue(object.used)).unsigned = false; + else if (typeof object.used === "string") + message.used = parseInt(object.used, 10); + else if (typeof object.used === "number") + message.used = object.used; + else if (typeof object.used === "object") + message.used = new $util.LongBits(object.used.low >>> 0, object.used.high >>> 0).toNumber(); + if (object.free != null) + if ($util.Long) + (message.free = $util.Long.fromValue(object.free)).unsigned = false; + else if (typeof object.free === "string") + message.free = parseInt(object.free, 10); + else if (typeof object.free === "number") + message.free = object.free; + else if (typeof object.free === "object") + message.free = new $util.LongBits(object.free.low >>> 0, object.free.high >>> 0).toNumber(); + return message; + }; + + /** + * Creates a plain object from an UtilizationChartData message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.migrationcenter.v1.ReportSummary.UtilizationChartData + * @static + * @param {google.cloud.migrationcenter.v1.ReportSummary.UtilizationChartData} message UtilizationChartData + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + UtilizationChartData.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.used = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.used = options.longs === String ? "0" : 0; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.free = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.free = options.longs === String ? "0" : 0; + } + if (message.used != null && message.hasOwnProperty("used")) + if (typeof message.used === "number") + object.used = options.longs === String ? String(message.used) : message.used; + else + object.used = options.longs === String ? $util.Long.prototype.toString.call(message.used) : options.longs === Number ? new $util.LongBits(message.used.low >>> 0, message.used.high >>> 0).toNumber() : message.used; + if (message.free != null && message.hasOwnProperty("free")) + if (typeof message.free === "number") + object.free = options.longs === String ? String(message.free) : message.free; + else + object.free = options.longs === String ? $util.Long.prototype.toString.call(message.free) : options.longs === Number ? new $util.LongBits(message.free.low >>> 0, message.free.high >>> 0).toNumber() : message.free; + return object; + }; + + /** + * Converts this UtilizationChartData to JSON. + * @function toJSON + * @memberof google.cloud.migrationcenter.v1.ReportSummary.UtilizationChartData + * @instance + * @returns {Object.} JSON object + */ + UtilizationChartData.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for UtilizationChartData + * @function getTypeUrl + * @memberof google.cloud.migrationcenter.v1.ReportSummary.UtilizationChartData + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + UtilizationChartData.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.migrationcenter.v1.ReportSummary.UtilizationChartData"; + }; + + return UtilizationChartData; + })(); + + ReportSummary.HistogramChartData = (function() { + + /** + * Properties of a HistogramChartData. + * @memberof google.cloud.migrationcenter.v1.ReportSummary + * @interface IHistogramChartData + * @property {Array.|null} [buckets] HistogramChartData buckets + */ + + /** + * Constructs a new HistogramChartData. + * @memberof google.cloud.migrationcenter.v1.ReportSummary + * @classdesc Represents a HistogramChartData. + * @implements IHistogramChartData + * @constructor + * @param {google.cloud.migrationcenter.v1.ReportSummary.IHistogramChartData=} [properties] Properties to set + */ + function HistogramChartData(properties) { + this.buckets = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * HistogramChartData buckets. + * @member {Array.} buckets + * @memberof google.cloud.migrationcenter.v1.ReportSummary.HistogramChartData + * @instance + */ + HistogramChartData.prototype.buckets = $util.emptyArray; + + /** + * Creates a new HistogramChartData instance using the specified properties. + * @function create + * @memberof google.cloud.migrationcenter.v1.ReportSummary.HistogramChartData + * @static + * @param {google.cloud.migrationcenter.v1.ReportSummary.IHistogramChartData=} [properties] Properties to set + * @returns {google.cloud.migrationcenter.v1.ReportSummary.HistogramChartData} HistogramChartData instance + */ + HistogramChartData.create = function create(properties) { + return new HistogramChartData(properties); + }; + + /** + * Encodes the specified HistogramChartData message. Does not implicitly {@link google.cloud.migrationcenter.v1.ReportSummary.HistogramChartData.verify|verify} messages. + * @function encode + * @memberof google.cloud.migrationcenter.v1.ReportSummary.HistogramChartData + * @static + * @param {google.cloud.migrationcenter.v1.ReportSummary.IHistogramChartData} message HistogramChartData message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + HistogramChartData.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.buckets != null && message.buckets.length) + for (var i = 0; i < message.buckets.length; ++i) + $root.google.cloud.migrationcenter.v1.ReportSummary.HistogramChartData.Bucket.encode(message.buckets[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified HistogramChartData message, length delimited. Does not implicitly {@link google.cloud.migrationcenter.v1.ReportSummary.HistogramChartData.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.migrationcenter.v1.ReportSummary.HistogramChartData + * @static + * @param {google.cloud.migrationcenter.v1.ReportSummary.IHistogramChartData} message HistogramChartData message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + HistogramChartData.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a HistogramChartData message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.migrationcenter.v1.ReportSummary.HistogramChartData + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.migrationcenter.v1.ReportSummary.HistogramChartData} HistogramChartData + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + HistogramChartData.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.migrationcenter.v1.ReportSummary.HistogramChartData(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.buckets && message.buckets.length)) + message.buckets = []; + message.buckets.push($root.google.cloud.migrationcenter.v1.ReportSummary.HistogramChartData.Bucket.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a HistogramChartData message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.migrationcenter.v1.ReportSummary.HistogramChartData + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.migrationcenter.v1.ReportSummary.HistogramChartData} HistogramChartData + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + HistogramChartData.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a HistogramChartData message. + * @function verify + * @memberof google.cloud.migrationcenter.v1.ReportSummary.HistogramChartData + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + HistogramChartData.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.buckets != null && message.hasOwnProperty("buckets")) { + if (!Array.isArray(message.buckets)) + return "buckets: array expected"; + for (var i = 0; i < message.buckets.length; ++i) { + var error = $root.google.cloud.migrationcenter.v1.ReportSummary.HistogramChartData.Bucket.verify(message.buckets[i]); + if (error) + return "buckets." + error; + } + } + return null; + }; + + /** + * Creates a HistogramChartData message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.migrationcenter.v1.ReportSummary.HistogramChartData + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.migrationcenter.v1.ReportSummary.HistogramChartData} HistogramChartData + */ + HistogramChartData.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.migrationcenter.v1.ReportSummary.HistogramChartData) + return object; + var message = new $root.google.cloud.migrationcenter.v1.ReportSummary.HistogramChartData(); + if (object.buckets) { + if (!Array.isArray(object.buckets)) + throw TypeError(".google.cloud.migrationcenter.v1.ReportSummary.HistogramChartData.buckets: array expected"); + message.buckets = []; + for (var i = 0; i < object.buckets.length; ++i) { + if (typeof object.buckets[i] !== "object") + throw TypeError(".google.cloud.migrationcenter.v1.ReportSummary.HistogramChartData.buckets: object expected"); + message.buckets[i] = $root.google.cloud.migrationcenter.v1.ReportSummary.HistogramChartData.Bucket.fromObject(object.buckets[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a HistogramChartData message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.migrationcenter.v1.ReportSummary.HistogramChartData + * @static + * @param {google.cloud.migrationcenter.v1.ReportSummary.HistogramChartData} message HistogramChartData + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + HistogramChartData.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.buckets = []; + if (message.buckets && message.buckets.length) { + object.buckets = []; + for (var j = 0; j < message.buckets.length; ++j) + object.buckets[j] = $root.google.cloud.migrationcenter.v1.ReportSummary.HistogramChartData.Bucket.toObject(message.buckets[j], options); + } + return object; + }; + + /** + * Converts this HistogramChartData to JSON. + * @function toJSON + * @memberof google.cloud.migrationcenter.v1.ReportSummary.HistogramChartData + * @instance + * @returns {Object.} JSON object + */ + HistogramChartData.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for HistogramChartData + * @function getTypeUrl + * @memberof google.cloud.migrationcenter.v1.ReportSummary.HistogramChartData + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + HistogramChartData.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.migrationcenter.v1.ReportSummary.HistogramChartData"; + }; + + HistogramChartData.Bucket = (function() { + + /** + * Properties of a Bucket. + * @memberof google.cloud.migrationcenter.v1.ReportSummary.HistogramChartData + * @interface IBucket + * @property {number|Long|null} [lowerBound] Bucket lowerBound + * @property {number|Long|null} [upperBound] Bucket upperBound + * @property {number|Long|null} [count] Bucket count + */ + + /** + * Constructs a new Bucket. + * @memberof google.cloud.migrationcenter.v1.ReportSummary.HistogramChartData + * @classdesc Represents a Bucket. + * @implements IBucket + * @constructor + * @param {google.cloud.migrationcenter.v1.ReportSummary.HistogramChartData.IBucket=} [properties] Properties to set + */ + function Bucket(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Bucket lowerBound. + * @member {number|Long} lowerBound + * @memberof google.cloud.migrationcenter.v1.ReportSummary.HistogramChartData.Bucket + * @instance + */ + Bucket.prototype.lowerBound = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Bucket upperBound. + * @member {number|Long} upperBound + * @memberof google.cloud.migrationcenter.v1.ReportSummary.HistogramChartData.Bucket + * @instance + */ + Bucket.prototype.upperBound = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Bucket count. + * @member {number|Long} count + * @memberof google.cloud.migrationcenter.v1.ReportSummary.HistogramChartData.Bucket + * @instance + */ + Bucket.prototype.count = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new Bucket instance using the specified properties. + * @function create + * @memberof google.cloud.migrationcenter.v1.ReportSummary.HistogramChartData.Bucket + * @static + * @param {google.cloud.migrationcenter.v1.ReportSummary.HistogramChartData.IBucket=} [properties] Properties to set + * @returns {google.cloud.migrationcenter.v1.ReportSummary.HistogramChartData.Bucket} Bucket instance + */ + Bucket.create = function create(properties) { + return new Bucket(properties); + }; + + /** + * Encodes the specified Bucket message. Does not implicitly {@link google.cloud.migrationcenter.v1.ReportSummary.HistogramChartData.Bucket.verify|verify} messages. + * @function encode + * @memberof google.cloud.migrationcenter.v1.ReportSummary.HistogramChartData.Bucket + * @static + * @param {google.cloud.migrationcenter.v1.ReportSummary.HistogramChartData.IBucket} message Bucket message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Bucket.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.lowerBound != null && Object.hasOwnProperty.call(message, "lowerBound")) + writer.uint32(/* id 1, wireType 0 =*/8).int64(message.lowerBound); + if (message.upperBound != null && Object.hasOwnProperty.call(message, "upperBound")) + writer.uint32(/* id 2, wireType 0 =*/16).int64(message.upperBound); + if (message.count != null && Object.hasOwnProperty.call(message, "count")) + writer.uint32(/* id 3, wireType 0 =*/24).int64(message.count); + return writer; + }; + + /** + * Encodes the specified Bucket message, length delimited. Does not implicitly {@link google.cloud.migrationcenter.v1.ReportSummary.HistogramChartData.Bucket.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.migrationcenter.v1.ReportSummary.HistogramChartData.Bucket + * @static + * @param {google.cloud.migrationcenter.v1.ReportSummary.HistogramChartData.IBucket} message Bucket message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Bucket.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Bucket message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.migrationcenter.v1.ReportSummary.HistogramChartData.Bucket + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.migrationcenter.v1.ReportSummary.HistogramChartData.Bucket} Bucket + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Bucket.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.migrationcenter.v1.ReportSummary.HistogramChartData.Bucket(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.lowerBound = reader.int64(); + break; + } + case 2: { + message.upperBound = reader.int64(); + break; + } + case 3: { + message.count = reader.int64(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Bucket message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.migrationcenter.v1.ReportSummary.HistogramChartData.Bucket + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.migrationcenter.v1.ReportSummary.HistogramChartData.Bucket} Bucket + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Bucket.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Bucket message. + * @function verify + * @memberof google.cloud.migrationcenter.v1.ReportSummary.HistogramChartData.Bucket + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Bucket.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.lowerBound != null && message.hasOwnProperty("lowerBound")) + if (!$util.isInteger(message.lowerBound) && !(message.lowerBound && $util.isInteger(message.lowerBound.low) && $util.isInteger(message.lowerBound.high))) + return "lowerBound: integer|Long expected"; + if (message.upperBound != null && message.hasOwnProperty("upperBound")) + if (!$util.isInteger(message.upperBound) && !(message.upperBound && $util.isInteger(message.upperBound.low) && $util.isInteger(message.upperBound.high))) + return "upperBound: integer|Long expected"; + if (message.count != null && message.hasOwnProperty("count")) + if (!$util.isInteger(message.count) && !(message.count && $util.isInteger(message.count.low) && $util.isInteger(message.count.high))) + return "count: integer|Long expected"; + return null; + }; + + /** + * Creates a Bucket message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.migrationcenter.v1.ReportSummary.HistogramChartData.Bucket + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.migrationcenter.v1.ReportSummary.HistogramChartData.Bucket} Bucket + */ + Bucket.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.migrationcenter.v1.ReportSummary.HistogramChartData.Bucket) + return object; + var message = new $root.google.cloud.migrationcenter.v1.ReportSummary.HistogramChartData.Bucket(); + if (object.lowerBound != null) + if ($util.Long) + (message.lowerBound = $util.Long.fromValue(object.lowerBound)).unsigned = false; + else if (typeof object.lowerBound === "string") + message.lowerBound = parseInt(object.lowerBound, 10); + else if (typeof object.lowerBound === "number") + message.lowerBound = object.lowerBound; + else if (typeof object.lowerBound === "object") + message.lowerBound = new $util.LongBits(object.lowerBound.low >>> 0, object.lowerBound.high >>> 0).toNumber(); + if (object.upperBound != null) + if ($util.Long) + (message.upperBound = $util.Long.fromValue(object.upperBound)).unsigned = false; + else if (typeof object.upperBound === "string") + message.upperBound = parseInt(object.upperBound, 10); + else if (typeof object.upperBound === "number") + message.upperBound = object.upperBound; + else if (typeof object.upperBound === "object") + message.upperBound = new $util.LongBits(object.upperBound.low >>> 0, object.upperBound.high >>> 0).toNumber(); + if (object.count != null) + if ($util.Long) + (message.count = $util.Long.fromValue(object.count)).unsigned = false; + else if (typeof object.count === "string") + message.count = parseInt(object.count, 10); + else if (typeof object.count === "number") + message.count = object.count; + else if (typeof object.count === "object") + message.count = new $util.LongBits(object.count.low >>> 0, object.count.high >>> 0).toNumber(); + return message; + }; + + /** + * Creates a plain object from a Bucket message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.migrationcenter.v1.ReportSummary.HistogramChartData.Bucket + * @static + * @param {google.cloud.migrationcenter.v1.ReportSummary.HistogramChartData.Bucket} message Bucket + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Bucket.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.lowerBound = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.lowerBound = options.longs === String ? "0" : 0; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.upperBound = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.upperBound = options.longs === String ? "0" : 0; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.count = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.count = options.longs === String ? "0" : 0; + } + if (message.lowerBound != null && message.hasOwnProperty("lowerBound")) + if (typeof message.lowerBound === "number") + object.lowerBound = options.longs === String ? String(message.lowerBound) : message.lowerBound; + else + object.lowerBound = options.longs === String ? $util.Long.prototype.toString.call(message.lowerBound) : options.longs === Number ? new $util.LongBits(message.lowerBound.low >>> 0, message.lowerBound.high >>> 0).toNumber() : message.lowerBound; + if (message.upperBound != null && message.hasOwnProperty("upperBound")) + if (typeof message.upperBound === "number") + object.upperBound = options.longs === String ? String(message.upperBound) : message.upperBound; + else + object.upperBound = options.longs === String ? $util.Long.prototype.toString.call(message.upperBound) : options.longs === Number ? new $util.LongBits(message.upperBound.low >>> 0, message.upperBound.high >>> 0).toNumber() : message.upperBound; + if (message.count != null && message.hasOwnProperty("count")) + if (typeof message.count === "number") + object.count = options.longs === String ? String(message.count) : message.count; + else + object.count = options.longs === String ? $util.Long.prototype.toString.call(message.count) : options.longs === Number ? new $util.LongBits(message.count.low >>> 0, message.count.high >>> 0).toNumber() : message.count; + return object; + }; + + /** + * Converts this Bucket to JSON. + * @function toJSON + * @memberof google.cloud.migrationcenter.v1.ReportSummary.HistogramChartData.Bucket + * @instance + * @returns {Object.} JSON object + */ + Bucket.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; - /** - * Creates a plain object from a ReportSummary message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.migrationcenter.v1.ReportSummary - * @static - * @param {google.cloud.migrationcenter.v1.ReportSummary} message ReportSummary - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ReportSummary.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.groupFindings = []; - if (options.defaults) - object.allAssetsStats = null; - if (message.allAssetsStats != null && message.hasOwnProperty("allAssetsStats")) - object.allAssetsStats = $root.google.cloud.migrationcenter.v1.ReportSummary.AssetAggregateStats.toObject(message.allAssetsStats, options); - if (message.groupFindings && message.groupFindings.length) { - object.groupFindings = []; - for (var j = 0; j < message.groupFindings.length; ++j) - object.groupFindings[j] = $root.google.cloud.migrationcenter.v1.ReportSummary.GroupFinding.toObject(message.groupFindings[j], options); - } - return object; - }; + /** + * Gets the default type url for Bucket + * @function getTypeUrl + * @memberof google.cloud.migrationcenter.v1.ReportSummary.HistogramChartData.Bucket + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Bucket.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.migrationcenter.v1.ReportSummary.HistogramChartData.Bucket"; + }; - /** - * Converts this ReportSummary to JSON. - * @function toJSON - * @memberof google.cloud.migrationcenter.v1.ReportSummary - * @instance - * @returns {Object.} JSON object - */ - ReportSummary.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; + return Bucket; + })(); - /** - * Gets the default type url for ReportSummary - * @function getTypeUrl - * @memberof google.cloud.migrationcenter.v1.ReportSummary - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ReportSummary.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.migrationcenter.v1.ReportSummary"; - }; + return HistogramChartData; + })(); - ReportSummary.ChartData = (function() { + ReportSummary.AssetAggregateStats = (function() { /** - * Properties of a ChartData. + * Properties of an AssetAggregateStats. * @memberof google.cloud.migrationcenter.v1.ReportSummary - * @interface IChartData - * @property {Array.|null} [dataPoints] ChartData dataPoints + * @interface IAssetAggregateStats + * @property {number|Long|null} [totalMemoryBytes] AssetAggregateStats totalMemoryBytes + * @property {number|Long|null} [totalStorageBytes] AssetAggregateStats totalStorageBytes + * @property {number|Long|null} [totalCores] AssetAggregateStats totalCores + * @property {number|Long|null} [totalAssets] AssetAggregateStats totalAssets + * @property {google.cloud.migrationcenter.v1.ReportSummary.IUtilizationChartData|null} [memoryUtilizationChart] AssetAggregateStats memoryUtilizationChart + * @property {google.cloud.migrationcenter.v1.ReportSummary.IUtilizationChartData|null} [storageUtilizationChart] AssetAggregateStats storageUtilizationChart + * @property {google.cloud.migrationcenter.v1.ReportSummary.IChartData|null} [operatingSystem] AssetAggregateStats operatingSystem + * @property {google.cloud.migrationcenter.v1.ReportSummary.IHistogramChartData|null} [coreCountHistogram] AssetAggregateStats coreCountHistogram + * @property {google.cloud.migrationcenter.v1.ReportSummary.IHistogramChartData|null} [memoryBytesHistogram] AssetAggregateStats memoryBytesHistogram + * @property {google.cloud.migrationcenter.v1.ReportSummary.IHistogramChartData|null} [storageBytesHistogram] AssetAggregateStats storageBytesHistogram */ /** - * Constructs a new ChartData. + * Constructs a new AssetAggregateStats. * @memberof google.cloud.migrationcenter.v1.ReportSummary - * @classdesc Represents a ChartData. - * @implements IChartData + * @classdesc Represents an AssetAggregateStats. + * @implements IAssetAggregateStats * @constructor - * @param {google.cloud.migrationcenter.v1.ReportSummary.IChartData=} [properties] Properties to set + * @param {google.cloud.migrationcenter.v1.ReportSummary.IAssetAggregateStats=} [properties] Properties to set */ - function ChartData(properties) { - this.dataPoints = []; + function AssetAggregateStats(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -45303,450 +48184,488 @@ } /** - * ChartData dataPoints. - * @member {Array.} dataPoints - * @memberof google.cloud.migrationcenter.v1.ReportSummary.ChartData + * AssetAggregateStats totalMemoryBytes. + * @member {number|Long} totalMemoryBytes + * @memberof google.cloud.migrationcenter.v1.ReportSummary.AssetAggregateStats * @instance */ - ChartData.prototype.dataPoints = $util.emptyArray; + AssetAggregateStats.prototype.totalMemoryBytes = $util.Long ? $util.Long.fromBits(0,0,false) : 0; /** - * Creates a new ChartData instance using the specified properties. - * @function create - * @memberof google.cloud.migrationcenter.v1.ReportSummary.ChartData - * @static - * @param {google.cloud.migrationcenter.v1.ReportSummary.IChartData=} [properties] Properties to set - * @returns {google.cloud.migrationcenter.v1.ReportSummary.ChartData} ChartData instance + * AssetAggregateStats totalStorageBytes. + * @member {number|Long} totalStorageBytes + * @memberof google.cloud.migrationcenter.v1.ReportSummary.AssetAggregateStats + * @instance */ - ChartData.create = function create(properties) { - return new ChartData(properties); - }; + AssetAggregateStats.prototype.totalStorageBytes = $util.Long ? $util.Long.fromBits(0,0,false) : 0; /** - * Encodes the specified ChartData message. Does not implicitly {@link google.cloud.migrationcenter.v1.ReportSummary.ChartData.verify|verify} messages. - * @function encode - * @memberof google.cloud.migrationcenter.v1.ReportSummary.ChartData - * @static - * @param {google.cloud.migrationcenter.v1.ReportSummary.IChartData} message ChartData message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer + * AssetAggregateStats totalCores. + * @member {number|Long} totalCores + * @memberof google.cloud.migrationcenter.v1.ReportSummary.AssetAggregateStats + * @instance */ - ChartData.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.dataPoints != null && message.dataPoints.length) - for (var i = 0; i < message.dataPoints.length; ++i) - $root.google.cloud.migrationcenter.v1.ReportSummary.ChartData.DataPoint.encode(message.dataPoints[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - return writer; - }; + AssetAggregateStats.prototype.totalCores = $util.Long ? $util.Long.fromBits(0,0,false) : 0; /** - * Encodes the specified ChartData message, length delimited. Does not implicitly {@link google.cloud.migrationcenter.v1.ReportSummary.ChartData.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.migrationcenter.v1.ReportSummary.ChartData - * @static - * @param {google.cloud.migrationcenter.v1.ReportSummary.IChartData} message ChartData message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer + * AssetAggregateStats totalAssets. + * @member {number|Long} totalAssets + * @memberof google.cloud.migrationcenter.v1.ReportSummary.AssetAggregateStats + * @instance */ - ChartData.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; + AssetAggregateStats.prototype.totalAssets = $util.Long ? $util.Long.fromBits(0,0,false) : 0; /** - * Decodes a ChartData message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.migrationcenter.v1.ReportSummary.ChartData - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.migrationcenter.v1.ReportSummary.ChartData} ChartData - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing + * AssetAggregateStats memoryUtilizationChart. + * @member {google.cloud.migrationcenter.v1.ReportSummary.IUtilizationChartData|null|undefined} memoryUtilizationChart + * @memberof google.cloud.migrationcenter.v1.ReportSummary.AssetAggregateStats + * @instance */ - ChartData.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.migrationcenter.v1.ReportSummary.ChartData(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - if (!(message.dataPoints && message.dataPoints.length)) - message.dataPoints = []; - message.dataPoints.push($root.google.cloud.migrationcenter.v1.ReportSummary.ChartData.DataPoint.decode(reader, reader.uint32())); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; + AssetAggregateStats.prototype.memoryUtilizationChart = null; - /** - * Decodes a ChartData message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.migrationcenter.v1.ReportSummary.ChartData - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.migrationcenter.v1.ReportSummary.ChartData} ChartData - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing + /** + * AssetAggregateStats storageUtilizationChart. + * @member {google.cloud.migrationcenter.v1.ReportSummary.IUtilizationChartData|null|undefined} storageUtilizationChart + * @memberof google.cloud.migrationcenter.v1.ReportSummary.AssetAggregateStats + * @instance */ - ChartData.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; + AssetAggregateStats.prototype.storageUtilizationChart = null; /** - * Verifies a ChartData message. - * @function verify - * @memberof google.cloud.migrationcenter.v1.ReportSummary.ChartData - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not + * AssetAggregateStats operatingSystem. + * @member {google.cloud.migrationcenter.v1.ReportSummary.IChartData|null|undefined} operatingSystem + * @memberof google.cloud.migrationcenter.v1.ReportSummary.AssetAggregateStats + * @instance */ - ChartData.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.dataPoints != null && message.hasOwnProperty("dataPoints")) { - if (!Array.isArray(message.dataPoints)) - return "dataPoints: array expected"; - for (var i = 0; i < message.dataPoints.length; ++i) { - var error = $root.google.cloud.migrationcenter.v1.ReportSummary.ChartData.DataPoint.verify(message.dataPoints[i]); - if (error) - return "dataPoints." + error; - } - } - return null; - }; + AssetAggregateStats.prototype.operatingSystem = null; /** - * Creates a ChartData message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.migrationcenter.v1.ReportSummary.ChartData - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.migrationcenter.v1.ReportSummary.ChartData} ChartData + * AssetAggregateStats coreCountHistogram. + * @member {google.cloud.migrationcenter.v1.ReportSummary.IHistogramChartData|null|undefined} coreCountHistogram + * @memberof google.cloud.migrationcenter.v1.ReportSummary.AssetAggregateStats + * @instance */ - ChartData.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.migrationcenter.v1.ReportSummary.ChartData) - return object; - var message = new $root.google.cloud.migrationcenter.v1.ReportSummary.ChartData(); - if (object.dataPoints) { - if (!Array.isArray(object.dataPoints)) - throw TypeError(".google.cloud.migrationcenter.v1.ReportSummary.ChartData.dataPoints: array expected"); - message.dataPoints = []; - for (var i = 0; i < object.dataPoints.length; ++i) { - if (typeof object.dataPoints[i] !== "object") - throw TypeError(".google.cloud.migrationcenter.v1.ReportSummary.ChartData.dataPoints: object expected"); - message.dataPoints[i] = $root.google.cloud.migrationcenter.v1.ReportSummary.ChartData.DataPoint.fromObject(object.dataPoints[i]); - } - } - return message; - }; + AssetAggregateStats.prototype.coreCountHistogram = null; /** - * Creates a plain object from a ChartData message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.migrationcenter.v1.ReportSummary.ChartData - * @static - * @param {google.cloud.migrationcenter.v1.ReportSummary.ChartData} message ChartData - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object + * AssetAggregateStats memoryBytesHistogram. + * @member {google.cloud.migrationcenter.v1.ReportSummary.IHistogramChartData|null|undefined} memoryBytesHistogram + * @memberof google.cloud.migrationcenter.v1.ReportSummary.AssetAggregateStats + * @instance */ - ChartData.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.dataPoints = []; - if (message.dataPoints && message.dataPoints.length) { - object.dataPoints = []; - for (var j = 0; j < message.dataPoints.length; ++j) - object.dataPoints[j] = $root.google.cloud.migrationcenter.v1.ReportSummary.ChartData.DataPoint.toObject(message.dataPoints[j], options); - } - return object; - }; + AssetAggregateStats.prototype.memoryBytesHistogram = null; /** - * Converts this ChartData to JSON. - * @function toJSON - * @memberof google.cloud.migrationcenter.v1.ReportSummary.ChartData + * AssetAggregateStats storageBytesHistogram. + * @member {google.cloud.migrationcenter.v1.ReportSummary.IHistogramChartData|null|undefined} storageBytesHistogram + * @memberof google.cloud.migrationcenter.v1.ReportSummary.AssetAggregateStats * @instance - * @returns {Object.} JSON object */ - ChartData.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; + AssetAggregateStats.prototype.storageBytesHistogram = null; /** - * Gets the default type url for ChartData - * @function getTypeUrl - * @memberof google.cloud.migrationcenter.v1.ReportSummary.ChartData + * Creates a new AssetAggregateStats instance using the specified properties. + * @function create + * @memberof google.cloud.migrationcenter.v1.ReportSummary.AssetAggregateStats * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url + * @param {google.cloud.migrationcenter.v1.ReportSummary.IAssetAggregateStats=} [properties] Properties to set + * @returns {google.cloud.migrationcenter.v1.ReportSummary.AssetAggregateStats} AssetAggregateStats instance */ - ChartData.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.migrationcenter.v1.ReportSummary.ChartData"; + AssetAggregateStats.create = function create(properties) { + return new AssetAggregateStats(properties); }; - ChartData.DataPoint = (function() { - - /** - * Properties of a DataPoint. - * @memberof google.cloud.migrationcenter.v1.ReportSummary.ChartData - * @interface IDataPoint - * @property {string|null} [label] DataPoint label - * @property {number|null} [value] DataPoint value - */ - - /** - * Constructs a new DataPoint. - * @memberof google.cloud.migrationcenter.v1.ReportSummary.ChartData - * @classdesc Represents a DataPoint. - * @implements IDataPoint - * @constructor - * @param {google.cloud.migrationcenter.v1.ReportSummary.ChartData.IDataPoint=} [properties] Properties to set - */ - function DataPoint(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * DataPoint label. - * @member {string} label - * @memberof google.cloud.migrationcenter.v1.ReportSummary.ChartData.DataPoint - * @instance - */ - DataPoint.prototype.label = ""; - - /** - * DataPoint value. - * @member {number} value - * @memberof google.cloud.migrationcenter.v1.ReportSummary.ChartData.DataPoint - * @instance - */ - DataPoint.prototype.value = 0; - - /** - * Creates a new DataPoint instance using the specified properties. - * @function create - * @memberof google.cloud.migrationcenter.v1.ReportSummary.ChartData.DataPoint - * @static - * @param {google.cloud.migrationcenter.v1.ReportSummary.ChartData.IDataPoint=} [properties] Properties to set - * @returns {google.cloud.migrationcenter.v1.ReportSummary.ChartData.DataPoint} DataPoint instance - */ - DataPoint.create = function create(properties) { - return new DataPoint(properties); - }; - - /** - * Encodes the specified DataPoint message. Does not implicitly {@link google.cloud.migrationcenter.v1.ReportSummary.ChartData.DataPoint.verify|verify} messages. - * @function encode - * @memberof google.cloud.migrationcenter.v1.ReportSummary.ChartData.DataPoint - * @static - * @param {google.cloud.migrationcenter.v1.ReportSummary.ChartData.IDataPoint} message DataPoint message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - DataPoint.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.label != null && Object.hasOwnProperty.call(message, "label")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.label); - if (message.value != null && Object.hasOwnProperty.call(message, "value")) - writer.uint32(/* id 2, wireType 1 =*/17).double(message.value); - return writer; - }; - - /** - * Encodes the specified DataPoint message, length delimited. Does not implicitly {@link google.cloud.migrationcenter.v1.ReportSummary.ChartData.DataPoint.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.migrationcenter.v1.ReportSummary.ChartData.DataPoint - * @static - * @param {google.cloud.migrationcenter.v1.ReportSummary.ChartData.IDataPoint} message DataPoint message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - DataPoint.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a DataPoint message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.migrationcenter.v1.ReportSummary.ChartData.DataPoint - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.migrationcenter.v1.ReportSummary.ChartData.DataPoint} DataPoint - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - DataPoint.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.migrationcenter.v1.ReportSummary.ChartData.DataPoint(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - message.label = reader.string(); - break; - } - case 2: { - message.value = reader.double(); - break; - } - default: - reader.skipType(tag & 7); + /** + * Encodes the specified AssetAggregateStats message. Does not implicitly {@link google.cloud.migrationcenter.v1.ReportSummary.AssetAggregateStats.verify|verify} messages. + * @function encode + * @memberof google.cloud.migrationcenter.v1.ReportSummary.AssetAggregateStats + * @static + * @param {google.cloud.migrationcenter.v1.ReportSummary.IAssetAggregateStats} message AssetAggregateStats message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AssetAggregateStats.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.totalMemoryBytes != null && Object.hasOwnProperty.call(message, "totalMemoryBytes")) + writer.uint32(/* id 1, wireType 0 =*/8).int64(message.totalMemoryBytes); + if (message.totalStorageBytes != null && Object.hasOwnProperty.call(message, "totalStorageBytes")) + writer.uint32(/* id 2, wireType 0 =*/16).int64(message.totalStorageBytes); + if (message.totalCores != null && Object.hasOwnProperty.call(message, "totalCores")) + writer.uint32(/* id 3, wireType 0 =*/24).int64(message.totalCores); + if (message.totalAssets != null && Object.hasOwnProperty.call(message, "totalAssets")) + writer.uint32(/* id 4, wireType 0 =*/32).int64(message.totalAssets); + if (message.memoryUtilizationChart != null && Object.hasOwnProperty.call(message, "memoryUtilizationChart")) + $root.google.cloud.migrationcenter.v1.ReportSummary.UtilizationChartData.encode(message.memoryUtilizationChart, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.storageUtilizationChart != null && Object.hasOwnProperty.call(message, "storageUtilizationChart")) + $root.google.cloud.migrationcenter.v1.ReportSummary.UtilizationChartData.encode(message.storageUtilizationChart, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + if (message.operatingSystem != null && Object.hasOwnProperty.call(message, "operatingSystem")) + $root.google.cloud.migrationcenter.v1.ReportSummary.ChartData.encode(message.operatingSystem, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + if (message.coreCountHistogram != null && Object.hasOwnProperty.call(message, "coreCountHistogram")) + $root.google.cloud.migrationcenter.v1.ReportSummary.HistogramChartData.encode(message.coreCountHistogram, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); + if (message.memoryBytesHistogram != null && Object.hasOwnProperty.call(message, "memoryBytesHistogram")) + $root.google.cloud.migrationcenter.v1.ReportSummary.HistogramChartData.encode(message.memoryBytesHistogram, writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim(); + if (message.storageBytesHistogram != null && Object.hasOwnProperty.call(message, "storageBytesHistogram")) + $root.google.cloud.migrationcenter.v1.ReportSummary.HistogramChartData.encode(message.storageBytesHistogram, writer.uint32(/* id 10, wireType 2 =*/82).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified AssetAggregateStats message, length delimited. Does not implicitly {@link google.cloud.migrationcenter.v1.ReportSummary.AssetAggregateStats.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.migrationcenter.v1.ReportSummary.AssetAggregateStats + * @static + * @param {google.cloud.migrationcenter.v1.ReportSummary.IAssetAggregateStats} message AssetAggregateStats message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AssetAggregateStats.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an AssetAggregateStats message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.migrationcenter.v1.ReportSummary.AssetAggregateStats + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.migrationcenter.v1.ReportSummary.AssetAggregateStats} AssetAggregateStats + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AssetAggregateStats.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.migrationcenter.v1.ReportSummary.AssetAggregateStats(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.totalMemoryBytes = reader.int64(); + break; + } + case 2: { + message.totalStorageBytes = reader.int64(); + break; + } + case 3: { + message.totalCores = reader.int64(); + break; + } + case 4: { + message.totalAssets = reader.int64(); + break; + } + case 5: { + message.memoryUtilizationChart = $root.google.cloud.migrationcenter.v1.ReportSummary.UtilizationChartData.decode(reader, reader.uint32()); + break; + } + case 6: { + message.storageUtilizationChart = $root.google.cloud.migrationcenter.v1.ReportSummary.UtilizationChartData.decode(reader, reader.uint32()); + break; + } + case 7: { + message.operatingSystem = $root.google.cloud.migrationcenter.v1.ReportSummary.ChartData.decode(reader, reader.uint32()); + break; + } + case 8: { + message.coreCountHistogram = $root.google.cloud.migrationcenter.v1.ReportSummary.HistogramChartData.decode(reader, reader.uint32()); + break; + } + case 9: { + message.memoryBytesHistogram = $root.google.cloud.migrationcenter.v1.ReportSummary.HistogramChartData.decode(reader, reader.uint32()); + break; + } + case 10: { + message.storageBytesHistogram = $root.google.cloud.migrationcenter.v1.ReportSummary.HistogramChartData.decode(reader, reader.uint32()); break; } + default: + reader.skipType(tag & 7); + break; } - return message; - }; - - /** - * Decodes a DataPoint message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.migrationcenter.v1.ReportSummary.ChartData.DataPoint - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.migrationcenter.v1.ReportSummary.ChartData.DataPoint} DataPoint - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - DataPoint.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; + } + return message; + }; - /** - * Verifies a DataPoint message. - * @function verify - * @memberof google.cloud.migrationcenter.v1.ReportSummary.ChartData.DataPoint - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - DataPoint.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.label != null && message.hasOwnProperty("label")) - if (!$util.isString(message.label)) - return "label: string expected"; - if (message.value != null && message.hasOwnProperty("value")) - if (typeof message.value !== "number") - return "value: number expected"; - return null; - }; + /** + * Decodes an AssetAggregateStats message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.migrationcenter.v1.ReportSummary.AssetAggregateStats + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.migrationcenter.v1.ReportSummary.AssetAggregateStats} AssetAggregateStats + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AssetAggregateStats.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; - /** - * Creates a DataPoint message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.migrationcenter.v1.ReportSummary.ChartData.DataPoint - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.migrationcenter.v1.ReportSummary.ChartData.DataPoint} DataPoint - */ - DataPoint.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.migrationcenter.v1.ReportSummary.ChartData.DataPoint) - return object; - var message = new $root.google.cloud.migrationcenter.v1.ReportSummary.ChartData.DataPoint(); - if (object.label != null) - message.label = String(object.label); - if (object.value != null) - message.value = Number(object.value); - return message; - }; + /** + * Verifies an AssetAggregateStats message. + * @function verify + * @memberof google.cloud.migrationcenter.v1.ReportSummary.AssetAggregateStats + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + AssetAggregateStats.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.totalMemoryBytes != null && message.hasOwnProperty("totalMemoryBytes")) + if (!$util.isInteger(message.totalMemoryBytes) && !(message.totalMemoryBytes && $util.isInteger(message.totalMemoryBytes.low) && $util.isInteger(message.totalMemoryBytes.high))) + return "totalMemoryBytes: integer|Long expected"; + if (message.totalStorageBytes != null && message.hasOwnProperty("totalStorageBytes")) + if (!$util.isInteger(message.totalStorageBytes) && !(message.totalStorageBytes && $util.isInteger(message.totalStorageBytes.low) && $util.isInteger(message.totalStorageBytes.high))) + return "totalStorageBytes: integer|Long expected"; + if (message.totalCores != null && message.hasOwnProperty("totalCores")) + if (!$util.isInteger(message.totalCores) && !(message.totalCores && $util.isInteger(message.totalCores.low) && $util.isInteger(message.totalCores.high))) + return "totalCores: integer|Long expected"; + if (message.totalAssets != null && message.hasOwnProperty("totalAssets")) + if (!$util.isInteger(message.totalAssets) && !(message.totalAssets && $util.isInteger(message.totalAssets.low) && $util.isInteger(message.totalAssets.high))) + return "totalAssets: integer|Long expected"; + if (message.memoryUtilizationChart != null && message.hasOwnProperty("memoryUtilizationChart")) { + var error = $root.google.cloud.migrationcenter.v1.ReportSummary.UtilizationChartData.verify(message.memoryUtilizationChart); + if (error) + return "memoryUtilizationChart." + error; + } + if (message.storageUtilizationChart != null && message.hasOwnProperty("storageUtilizationChart")) { + var error = $root.google.cloud.migrationcenter.v1.ReportSummary.UtilizationChartData.verify(message.storageUtilizationChart); + if (error) + return "storageUtilizationChart." + error; + } + if (message.operatingSystem != null && message.hasOwnProperty("operatingSystem")) { + var error = $root.google.cloud.migrationcenter.v1.ReportSummary.ChartData.verify(message.operatingSystem); + if (error) + return "operatingSystem." + error; + } + if (message.coreCountHistogram != null && message.hasOwnProperty("coreCountHistogram")) { + var error = $root.google.cloud.migrationcenter.v1.ReportSummary.HistogramChartData.verify(message.coreCountHistogram); + if (error) + return "coreCountHistogram." + error; + } + if (message.memoryBytesHistogram != null && message.hasOwnProperty("memoryBytesHistogram")) { + var error = $root.google.cloud.migrationcenter.v1.ReportSummary.HistogramChartData.verify(message.memoryBytesHistogram); + if (error) + return "memoryBytesHistogram." + error; + } + if (message.storageBytesHistogram != null && message.hasOwnProperty("storageBytesHistogram")) { + var error = $root.google.cloud.migrationcenter.v1.ReportSummary.HistogramChartData.verify(message.storageBytesHistogram); + if (error) + return "storageBytesHistogram." + error; + } + return null; + }; - /** - * Creates a plain object from a DataPoint message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.migrationcenter.v1.ReportSummary.ChartData.DataPoint - * @static - * @param {google.cloud.migrationcenter.v1.ReportSummary.ChartData.DataPoint} message DataPoint - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - DataPoint.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.label = ""; - object.value = 0; - } - if (message.label != null && message.hasOwnProperty("label")) - object.label = message.label; - if (message.value != null && message.hasOwnProperty("value")) - object.value = options.json && !isFinite(message.value) ? String(message.value) : message.value; + /** + * Creates an AssetAggregateStats message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.migrationcenter.v1.ReportSummary.AssetAggregateStats + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.migrationcenter.v1.ReportSummary.AssetAggregateStats} AssetAggregateStats + */ + AssetAggregateStats.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.migrationcenter.v1.ReportSummary.AssetAggregateStats) return object; - }; + var message = new $root.google.cloud.migrationcenter.v1.ReportSummary.AssetAggregateStats(); + if (object.totalMemoryBytes != null) + if ($util.Long) + (message.totalMemoryBytes = $util.Long.fromValue(object.totalMemoryBytes)).unsigned = false; + else if (typeof object.totalMemoryBytes === "string") + message.totalMemoryBytes = parseInt(object.totalMemoryBytes, 10); + else if (typeof object.totalMemoryBytes === "number") + message.totalMemoryBytes = object.totalMemoryBytes; + else if (typeof object.totalMemoryBytes === "object") + message.totalMemoryBytes = new $util.LongBits(object.totalMemoryBytes.low >>> 0, object.totalMemoryBytes.high >>> 0).toNumber(); + if (object.totalStorageBytes != null) + if ($util.Long) + (message.totalStorageBytes = $util.Long.fromValue(object.totalStorageBytes)).unsigned = false; + else if (typeof object.totalStorageBytes === "string") + message.totalStorageBytes = parseInt(object.totalStorageBytes, 10); + else if (typeof object.totalStorageBytes === "number") + message.totalStorageBytes = object.totalStorageBytes; + else if (typeof object.totalStorageBytes === "object") + message.totalStorageBytes = new $util.LongBits(object.totalStorageBytes.low >>> 0, object.totalStorageBytes.high >>> 0).toNumber(); + if (object.totalCores != null) + if ($util.Long) + (message.totalCores = $util.Long.fromValue(object.totalCores)).unsigned = false; + else if (typeof object.totalCores === "string") + message.totalCores = parseInt(object.totalCores, 10); + else if (typeof object.totalCores === "number") + message.totalCores = object.totalCores; + else if (typeof object.totalCores === "object") + message.totalCores = new $util.LongBits(object.totalCores.low >>> 0, object.totalCores.high >>> 0).toNumber(); + if (object.totalAssets != null) + if ($util.Long) + (message.totalAssets = $util.Long.fromValue(object.totalAssets)).unsigned = false; + else if (typeof object.totalAssets === "string") + message.totalAssets = parseInt(object.totalAssets, 10); + else if (typeof object.totalAssets === "number") + message.totalAssets = object.totalAssets; + else if (typeof object.totalAssets === "object") + message.totalAssets = new $util.LongBits(object.totalAssets.low >>> 0, object.totalAssets.high >>> 0).toNumber(); + if (object.memoryUtilizationChart != null) { + if (typeof object.memoryUtilizationChart !== "object") + throw TypeError(".google.cloud.migrationcenter.v1.ReportSummary.AssetAggregateStats.memoryUtilizationChart: object expected"); + message.memoryUtilizationChart = $root.google.cloud.migrationcenter.v1.ReportSummary.UtilizationChartData.fromObject(object.memoryUtilizationChart); + } + if (object.storageUtilizationChart != null) { + if (typeof object.storageUtilizationChart !== "object") + throw TypeError(".google.cloud.migrationcenter.v1.ReportSummary.AssetAggregateStats.storageUtilizationChart: object expected"); + message.storageUtilizationChart = $root.google.cloud.migrationcenter.v1.ReportSummary.UtilizationChartData.fromObject(object.storageUtilizationChart); + } + if (object.operatingSystem != null) { + if (typeof object.operatingSystem !== "object") + throw TypeError(".google.cloud.migrationcenter.v1.ReportSummary.AssetAggregateStats.operatingSystem: object expected"); + message.operatingSystem = $root.google.cloud.migrationcenter.v1.ReportSummary.ChartData.fromObject(object.operatingSystem); + } + if (object.coreCountHistogram != null) { + if (typeof object.coreCountHistogram !== "object") + throw TypeError(".google.cloud.migrationcenter.v1.ReportSummary.AssetAggregateStats.coreCountHistogram: object expected"); + message.coreCountHistogram = $root.google.cloud.migrationcenter.v1.ReportSummary.HistogramChartData.fromObject(object.coreCountHistogram); + } + if (object.memoryBytesHistogram != null) { + if (typeof object.memoryBytesHistogram !== "object") + throw TypeError(".google.cloud.migrationcenter.v1.ReportSummary.AssetAggregateStats.memoryBytesHistogram: object expected"); + message.memoryBytesHistogram = $root.google.cloud.migrationcenter.v1.ReportSummary.HistogramChartData.fromObject(object.memoryBytesHistogram); + } + if (object.storageBytesHistogram != null) { + if (typeof object.storageBytesHistogram !== "object") + throw TypeError(".google.cloud.migrationcenter.v1.ReportSummary.AssetAggregateStats.storageBytesHistogram: object expected"); + message.storageBytesHistogram = $root.google.cloud.migrationcenter.v1.ReportSummary.HistogramChartData.fromObject(object.storageBytesHistogram); + } + return message; + }; - /** - * Converts this DataPoint to JSON. - * @function toJSON - * @memberof google.cloud.migrationcenter.v1.ReportSummary.ChartData.DataPoint - * @instance - * @returns {Object.} JSON object - */ - DataPoint.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; + /** + * Creates a plain object from an AssetAggregateStats message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.migrationcenter.v1.ReportSummary.AssetAggregateStats + * @static + * @param {google.cloud.migrationcenter.v1.ReportSummary.AssetAggregateStats} message AssetAggregateStats + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + AssetAggregateStats.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.totalMemoryBytes = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.totalMemoryBytes = options.longs === String ? "0" : 0; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.totalStorageBytes = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.totalStorageBytes = options.longs === String ? "0" : 0; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.totalCores = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.totalCores = options.longs === String ? "0" : 0; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.totalAssets = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.totalAssets = options.longs === String ? "0" : 0; + object.memoryUtilizationChart = null; + object.storageUtilizationChart = null; + object.operatingSystem = null; + object.coreCountHistogram = null; + object.memoryBytesHistogram = null; + object.storageBytesHistogram = null; + } + if (message.totalMemoryBytes != null && message.hasOwnProperty("totalMemoryBytes")) + if (typeof message.totalMemoryBytes === "number") + object.totalMemoryBytes = options.longs === String ? String(message.totalMemoryBytes) : message.totalMemoryBytes; + else + object.totalMemoryBytes = options.longs === String ? $util.Long.prototype.toString.call(message.totalMemoryBytes) : options.longs === Number ? new $util.LongBits(message.totalMemoryBytes.low >>> 0, message.totalMemoryBytes.high >>> 0).toNumber() : message.totalMemoryBytes; + if (message.totalStorageBytes != null && message.hasOwnProperty("totalStorageBytes")) + if (typeof message.totalStorageBytes === "number") + object.totalStorageBytes = options.longs === String ? String(message.totalStorageBytes) : message.totalStorageBytes; + else + object.totalStorageBytes = options.longs === String ? $util.Long.prototype.toString.call(message.totalStorageBytes) : options.longs === Number ? new $util.LongBits(message.totalStorageBytes.low >>> 0, message.totalStorageBytes.high >>> 0).toNumber() : message.totalStorageBytes; + if (message.totalCores != null && message.hasOwnProperty("totalCores")) + if (typeof message.totalCores === "number") + object.totalCores = options.longs === String ? String(message.totalCores) : message.totalCores; + else + object.totalCores = options.longs === String ? $util.Long.prototype.toString.call(message.totalCores) : options.longs === Number ? new $util.LongBits(message.totalCores.low >>> 0, message.totalCores.high >>> 0).toNumber() : message.totalCores; + if (message.totalAssets != null && message.hasOwnProperty("totalAssets")) + if (typeof message.totalAssets === "number") + object.totalAssets = options.longs === String ? String(message.totalAssets) : message.totalAssets; + else + object.totalAssets = options.longs === String ? $util.Long.prototype.toString.call(message.totalAssets) : options.longs === Number ? new $util.LongBits(message.totalAssets.low >>> 0, message.totalAssets.high >>> 0).toNumber() : message.totalAssets; + if (message.memoryUtilizationChart != null && message.hasOwnProperty("memoryUtilizationChart")) + object.memoryUtilizationChart = $root.google.cloud.migrationcenter.v1.ReportSummary.UtilizationChartData.toObject(message.memoryUtilizationChart, options); + if (message.storageUtilizationChart != null && message.hasOwnProperty("storageUtilizationChart")) + object.storageUtilizationChart = $root.google.cloud.migrationcenter.v1.ReportSummary.UtilizationChartData.toObject(message.storageUtilizationChart, options); + if (message.operatingSystem != null && message.hasOwnProperty("operatingSystem")) + object.operatingSystem = $root.google.cloud.migrationcenter.v1.ReportSummary.ChartData.toObject(message.operatingSystem, options); + if (message.coreCountHistogram != null && message.hasOwnProperty("coreCountHistogram")) + object.coreCountHistogram = $root.google.cloud.migrationcenter.v1.ReportSummary.HistogramChartData.toObject(message.coreCountHistogram, options); + if (message.memoryBytesHistogram != null && message.hasOwnProperty("memoryBytesHistogram")) + object.memoryBytesHistogram = $root.google.cloud.migrationcenter.v1.ReportSummary.HistogramChartData.toObject(message.memoryBytesHistogram, options); + if (message.storageBytesHistogram != null && message.hasOwnProperty("storageBytesHistogram")) + object.storageBytesHistogram = $root.google.cloud.migrationcenter.v1.ReportSummary.HistogramChartData.toObject(message.storageBytesHistogram, options); + return object; + }; - /** - * Gets the default type url for DataPoint - * @function getTypeUrl - * @memberof google.cloud.migrationcenter.v1.ReportSummary.ChartData.DataPoint - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - DataPoint.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.migrationcenter.v1.ReportSummary.ChartData.DataPoint"; - }; + /** + * Converts this AssetAggregateStats to JSON. + * @function toJSON + * @memberof google.cloud.migrationcenter.v1.ReportSummary.AssetAggregateStats + * @instance + * @returns {Object.} JSON object + */ + AssetAggregateStats.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; - return DataPoint; - })(); + /** + * Gets the default type url for AssetAggregateStats + * @function getTypeUrl + * @memberof google.cloud.migrationcenter.v1.ReportSummary.AssetAggregateStats + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + AssetAggregateStats.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.migrationcenter.v1.ReportSummary.AssetAggregateStats"; + }; - return ChartData; + return AssetAggregateStats; })(); - ReportSummary.UtilizationChartData = (function() { + ReportSummary.MachineSeriesAllocation = (function() { /** - * Properties of an UtilizationChartData. + * Properties of a MachineSeriesAllocation. * @memberof google.cloud.migrationcenter.v1.ReportSummary - * @interface IUtilizationChartData - * @property {number|Long|null} [used] UtilizationChartData used - * @property {number|Long|null} [free] UtilizationChartData free + * @interface IMachineSeriesAllocation + * @property {google.cloud.migrationcenter.v1.IMachineSeries|null} [machineSeries] MachineSeriesAllocation machineSeries + * @property {number|Long|null} [allocatedAssetCount] MachineSeriesAllocation allocatedAssetCount */ /** - * Constructs a new UtilizationChartData. + * Constructs a new MachineSeriesAllocation. * @memberof google.cloud.migrationcenter.v1.ReportSummary - * @classdesc Represents an UtilizationChartData. - * @implements IUtilizationChartData + * @classdesc Represents a MachineSeriesAllocation. + * @implements IMachineSeriesAllocation * @constructor - * @param {google.cloud.migrationcenter.v1.ReportSummary.IUtilizationChartData=} [properties] Properties to set + * @param {google.cloud.migrationcenter.v1.ReportSummary.IMachineSeriesAllocation=} [properties] Properties to set */ - function UtilizationChartData(properties) { + function MachineSeriesAllocation(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -45754,89 +48673,89 @@ } /** - * UtilizationChartData used. - * @member {number|Long} used - * @memberof google.cloud.migrationcenter.v1.ReportSummary.UtilizationChartData + * MachineSeriesAllocation machineSeries. + * @member {google.cloud.migrationcenter.v1.IMachineSeries|null|undefined} machineSeries + * @memberof google.cloud.migrationcenter.v1.ReportSummary.MachineSeriesAllocation * @instance */ - UtilizationChartData.prototype.used = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + MachineSeriesAllocation.prototype.machineSeries = null; /** - * UtilizationChartData free. - * @member {number|Long} free - * @memberof google.cloud.migrationcenter.v1.ReportSummary.UtilizationChartData + * MachineSeriesAllocation allocatedAssetCount. + * @member {number|Long} allocatedAssetCount + * @memberof google.cloud.migrationcenter.v1.ReportSummary.MachineSeriesAllocation * @instance */ - UtilizationChartData.prototype.free = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + MachineSeriesAllocation.prototype.allocatedAssetCount = $util.Long ? $util.Long.fromBits(0,0,false) : 0; /** - * Creates a new UtilizationChartData instance using the specified properties. + * Creates a new MachineSeriesAllocation instance using the specified properties. * @function create - * @memberof google.cloud.migrationcenter.v1.ReportSummary.UtilizationChartData + * @memberof google.cloud.migrationcenter.v1.ReportSummary.MachineSeriesAllocation * @static - * @param {google.cloud.migrationcenter.v1.ReportSummary.IUtilizationChartData=} [properties] Properties to set - * @returns {google.cloud.migrationcenter.v1.ReportSummary.UtilizationChartData} UtilizationChartData instance + * @param {google.cloud.migrationcenter.v1.ReportSummary.IMachineSeriesAllocation=} [properties] Properties to set + * @returns {google.cloud.migrationcenter.v1.ReportSummary.MachineSeriesAllocation} MachineSeriesAllocation instance */ - UtilizationChartData.create = function create(properties) { - return new UtilizationChartData(properties); + MachineSeriesAllocation.create = function create(properties) { + return new MachineSeriesAllocation(properties); }; /** - * Encodes the specified UtilizationChartData message. Does not implicitly {@link google.cloud.migrationcenter.v1.ReportSummary.UtilizationChartData.verify|verify} messages. + * Encodes the specified MachineSeriesAllocation message. Does not implicitly {@link google.cloud.migrationcenter.v1.ReportSummary.MachineSeriesAllocation.verify|verify} messages. * @function encode - * @memberof google.cloud.migrationcenter.v1.ReportSummary.UtilizationChartData + * @memberof google.cloud.migrationcenter.v1.ReportSummary.MachineSeriesAllocation * @static - * @param {google.cloud.migrationcenter.v1.ReportSummary.IUtilizationChartData} message UtilizationChartData message or plain object to encode + * @param {google.cloud.migrationcenter.v1.ReportSummary.IMachineSeriesAllocation} message MachineSeriesAllocation message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - UtilizationChartData.encode = function encode(message, writer) { + MachineSeriesAllocation.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.used != null && Object.hasOwnProperty.call(message, "used")) - writer.uint32(/* id 1, wireType 0 =*/8).int64(message.used); - if (message.free != null && Object.hasOwnProperty.call(message, "free")) - writer.uint32(/* id 2, wireType 0 =*/16).int64(message.free); + if (message.machineSeries != null && Object.hasOwnProperty.call(message, "machineSeries")) + $root.google.cloud.migrationcenter.v1.MachineSeries.encode(message.machineSeries, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.allocatedAssetCount != null && Object.hasOwnProperty.call(message, "allocatedAssetCount")) + writer.uint32(/* id 2, wireType 0 =*/16).int64(message.allocatedAssetCount); return writer; }; /** - * Encodes the specified UtilizationChartData message, length delimited. Does not implicitly {@link google.cloud.migrationcenter.v1.ReportSummary.UtilizationChartData.verify|verify} messages. + * Encodes the specified MachineSeriesAllocation message, length delimited. Does not implicitly {@link google.cloud.migrationcenter.v1.ReportSummary.MachineSeriesAllocation.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.migrationcenter.v1.ReportSummary.UtilizationChartData + * @memberof google.cloud.migrationcenter.v1.ReportSummary.MachineSeriesAllocation * @static - * @param {google.cloud.migrationcenter.v1.ReportSummary.IUtilizationChartData} message UtilizationChartData message or plain object to encode + * @param {google.cloud.migrationcenter.v1.ReportSummary.IMachineSeriesAllocation} message MachineSeriesAllocation message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - UtilizationChartData.encodeDelimited = function encodeDelimited(message, writer) { + MachineSeriesAllocation.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes an UtilizationChartData message from the specified reader or buffer. + * Decodes a MachineSeriesAllocation message from the specified reader or buffer. * @function decode - * @memberof google.cloud.migrationcenter.v1.ReportSummary.UtilizationChartData + * @memberof google.cloud.migrationcenter.v1.ReportSummary.MachineSeriesAllocation * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.migrationcenter.v1.ReportSummary.UtilizationChartData} UtilizationChartData + * @returns {google.cloud.migrationcenter.v1.ReportSummary.MachineSeriesAllocation} MachineSeriesAllocation * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - UtilizationChartData.decode = function decode(reader, length) { + MachineSeriesAllocation.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.migrationcenter.v1.ReportSummary.UtilizationChartData(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.migrationcenter.v1.ReportSummary.MachineSeriesAllocation(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: { - message.used = reader.int64(); + message.machineSeries = $root.google.cloud.migrationcenter.v1.MachineSeries.decode(reader, reader.uint32()); break; } case 2: { - message.free = reader.int64(); + message.allocatedAssetCount = reader.int64(); break; } default: @@ -45848,160 +48767,156 @@ }; /** - * Decodes an UtilizationChartData message from the specified reader or buffer, length delimited. + * Decodes a MachineSeriesAllocation message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.migrationcenter.v1.ReportSummary.UtilizationChartData + * @memberof google.cloud.migrationcenter.v1.ReportSummary.MachineSeriesAllocation * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.migrationcenter.v1.ReportSummary.UtilizationChartData} UtilizationChartData + * @returns {google.cloud.migrationcenter.v1.ReportSummary.MachineSeriesAllocation} MachineSeriesAllocation * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - UtilizationChartData.decodeDelimited = function decodeDelimited(reader) { + MachineSeriesAllocation.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies an UtilizationChartData message. + * Verifies a MachineSeriesAllocation message. * @function verify - * @memberof google.cloud.migrationcenter.v1.ReportSummary.UtilizationChartData + * @memberof google.cloud.migrationcenter.v1.ReportSummary.MachineSeriesAllocation * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - UtilizationChartData.verify = function verify(message) { + MachineSeriesAllocation.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.used != null && message.hasOwnProperty("used")) - if (!$util.isInteger(message.used) && !(message.used && $util.isInteger(message.used.low) && $util.isInteger(message.used.high))) - return "used: integer|Long expected"; - if (message.free != null && message.hasOwnProperty("free")) - if (!$util.isInteger(message.free) && !(message.free && $util.isInteger(message.free.low) && $util.isInteger(message.free.high))) - return "free: integer|Long expected"; + if (message.machineSeries != null && message.hasOwnProperty("machineSeries")) { + var error = $root.google.cloud.migrationcenter.v1.MachineSeries.verify(message.machineSeries); + if (error) + return "machineSeries." + error; + } + if (message.allocatedAssetCount != null && message.hasOwnProperty("allocatedAssetCount")) + if (!$util.isInteger(message.allocatedAssetCount) && !(message.allocatedAssetCount && $util.isInteger(message.allocatedAssetCount.low) && $util.isInteger(message.allocatedAssetCount.high))) + return "allocatedAssetCount: integer|Long expected"; return null; }; /** - * Creates an UtilizationChartData message from a plain object. Also converts values to their respective internal types. + * Creates a MachineSeriesAllocation message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.migrationcenter.v1.ReportSummary.UtilizationChartData + * @memberof google.cloud.migrationcenter.v1.ReportSummary.MachineSeriesAllocation * @static * @param {Object.} object Plain object - * @returns {google.cloud.migrationcenter.v1.ReportSummary.UtilizationChartData} UtilizationChartData + * @returns {google.cloud.migrationcenter.v1.ReportSummary.MachineSeriesAllocation} MachineSeriesAllocation */ - UtilizationChartData.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.migrationcenter.v1.ReportSummary.UtilizationChartData) + MachineSeriesAllocation.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.migrationcenter.v1.ReportSummary.MachineSeriesAllocation) return object; - var message = new $root.google.cloud.migrationcenter.v1.ReportSummary.UtilizationChartData(); - if (object.used != null) - if ($util.Long) - (message.used = $util.Long.fromValue(object.used)).unsigned = false; - else if (typeof object.used === "string") - message.used = parseInt(object.used, 10); - else if (typeof object.used === "number") - message.used = object.used; - else if (typeof object.used === "object") - message.used = new $util.LongBits(object.used.low >>> 0, object.used.high >>> 0).toNumber(); - if (object.free != null) + var message = new $root.google.cloud.migrationcenter.v1.ReportSummary.MachineSeriesAllocation(); + if (object.machineSeries != null) { + if (typeof object.machineSeries !== "object") + throw TypeError(".google.cloud.migrationcenter.v1.ReportSummary.MachineSeriesAllocation.machineSeries: object expected"); + message.machineSeries = $root.google.cloud.migrationcenter.v1.MachineSeries.fromObject(object.machineSeries); + } + if (object.allocatedAssetCount != null) if ($util.Long) - (message.free = $util.Long.fromValue(object.free)).unsigned = false; - else if (typeof object.free === "string") - message.free = parseInt(object.free, 10); - else if (typeof object.free === "number") - message.free = object.free; - else if (typeof object.free === "object") - message.free = new $util.LongBits(object.free.low >>> 0, object.free.high >>> 0).toNumber(); + (message.allocatedAssetCount = $util.Long.fromValue(object.allocatedAssetCount)).unsigned = false; + else if (typeof object.allocatedAssetCount === "string") + message.allocatedAssetCount = parseInt(object.allocatedAssetCount, 10); + else if (typeof object.allocatedAssetCount === "number") + message.allocatedAssetCount = object.allocatedAssetCount; + else if (typeof object.allocatedAssetCount === "object") + message.allocatedAssetCount = new $util.LongBits(object.allocatedAssetCount.low >>> 0, object.allocatedAssetCount.high >>> 0).toNumber(); return message; }; /** - * Creates a plain object from an UtilizationChartData message. Also converts values to other types if specified. + * Creates a plain object from a MachineSeriesAllocation message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.migrationcenter.v1.ReportSummary.UtilizationChartData + * @memberof google.cloud.migrationcenter.v1.ReportSummary.MachineSeriesAllocation * @static - * @param {google.cloud.migrationcenter.v1.ReportSummary.UtilizationChartData} message UtilizationChartData + * @param {google.cloud.migrationcenter.v1.ReportSummary.MachineSeriesAllocation} message MachineSeriesAllocation * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - UtilizationChartData.toObject = function toObject(message, options) { + MachineSeriesAllocation.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; if (options.defaults) { + object.machineSeries = null; if ($util.Long) { var long = new $util.Long(0, 0, false); - object.used = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.used = options.longs === String ? "0" : 0; - if ($util.Long) { - var long = new $util.Long(0, 0, false); - object.free = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + object.allocatedAssetCount = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; } else - object.free = options.longs === String ? "0" : 0; + object.allocatedAssetCount = options.longs === String ? "0" : 0; } - if (message.used != null && message.hasOwnProperty("used")) - if (typeof message.used === "number") - object.used = options.longs === String ? String(message.used) : message.used; - else - object.used = options.longs === String ? $util.Long.prototype.toString.call(message.used) : options.longs === Number ? new $util.LongBits(message.used.low >>> 0, message.used.high >>> 0).toNumber() : message.used; - if (message.free != null && message.hasOwnProperty("free")) - if (typeof message.free === "number") - object.free = options.longs === String ? String(message.free) : message.free; + if (message.machineSeries != null && message.hasOwnProperty("machineSeries")) + object.machineSeries = $root.google.cloud.migrationcenter.v1.MachineSeries.toObject(message.machineSeries, options); + if (message.allocatedAssetCount != null && message.hasOwnProperty("allocatedAssetCount")) + if (typeof message.allocatedAssetCount === "number") + object.allocatedAssetCount = options.longs === String ? String(message.allocatedAssetCount) : message.allocatedAssetCount; else - object.free = options.longs === String ? $util.Long.prototype.toString.call(message.free) : options.longs === Number ? new $util.LongBits(message.free.low >>> 0, message.free.high >>> 0).toNumber() : message.free; + object.allocatedAssetCount = options.longs === String ? $util.Long.prototype.toString.call(message.allocatedAssetCount) : options.longs === Number ? new $util.LongBits(message.allocatedAssetCount.low >>> 0, message.allocatedAssetCount.high >>> 0).toNumber() : message.allocatedAssetCount; return object; }; /** - * Converts this UtilizationChartData to JSON. + * Converts this MachineSeriesAllocation to JSON. * @function toJSON - * @memberof google.cloud.migrationcenter.v1.ReportSummary.UtilizationChartData + * @memberof google.cloud.migrationcenter.v1.ReportSummary.MachineSeriesAllocation * @instance * @returns {Object.} JSON object */ - UtilizationChartData.prototype.toJSON = function toJSON() { + MachineSeriesAllocation.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for UtilizationChartData + * Gets the default type url for MachineSeriesAllocation * @function getTypeUrl - * @memberof google.cloud.migrationcenter.v1.ReportSummary.UtilizationChartData + * @memberof google.cloud.migrationcenter.v1.ReportSummary.MachineSeriesAllocation * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - UtilizationChartData.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + MachineSeriesAllocation.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.cloud.migrationcenter.v1.ReportSummary.UtilizationChartData"; + return typeUrlPrefix + "/google.cloud.migrationcenter.v1.ReportSummary.MachineSeriesAllocation"; }; - return UtilizationChartData; + return MachineSeriesAllocation; })(); - ReportSummary.HistogramChartData = (function() { + ReportSummary.ComputeEngineFinding = (function() { /** - * Properties of a HistogramChartData. + * Properties of a ComputeEngineFinding. * @memberof google.cloud.migrationcenter.v1.ReportSummary - * @interface IHistogramChartData - * @property {Array.|null} [buckets] HistogramChartData buckets + * @interface IComputeEngineFinding + * @property {Array.|null} [allocatedRegions] ComputeEngineFinding allocatedRegions + * @property {number|Long|null} [allocatedAssetCount] ComputeEngineFinding allocatedAssetCount + * @property {Array.|null} [machineSeriesAllocations] ComputeEngineFinding machineSeriesAllocations + * @property {Array.|null} [allocatedDiskTypes] ComputeEngineFinding allocatedDiskTypes */ /** - * Constructs a new HistogramChartData. + * Constructs a new ComputeEngineFinding. * @memberof google.cloud.migrationcenter.v1.ReportSummary - * @classdesc Represents a HistogramChartData. - * @implements IHistogramChartData + * @classdesc Represents a ComputeEngineFinding. + * @implements IComputeEngineFinding * @constructor - * @param {google.cloud.migrationcenter.v1.ReportSummary.IHistogramChartData=} [properties] Properties to set + * @param {google.cloud.migrationcenter.v1.ReportSummary.IComputeEngineFinding=} [properties] Properties to set */ - function HistogramChartData(properties) { - this.buckets = []; + function ComputeEngineFinding(properties) { + this.allocatedRegions = []; + this.machineSeriesAllocations = []; + this.allocatedDiskTypes = []; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -46009,78 +48924,134 @@ } /** - * HistogramChartData buckets. - * @member {Array.} buckets - * @memberof google.cloud.migrationcenter.v1.ReportSummary.HistogramChartData + * ComputeEngineFinding allocatedRegions. + * @member {Array.} allocatedRegions + * @memberof google.cloud.migrationcenter.v1.ReportSummary.ComputeEngineFinding * @instance */ - HistogramChartData.prototype.buckets = $util.emptyArray; + ComputeEngineFinding.prototype.allocatedRegions = $util.emptyArray; /** - * Creates a new HistogramChartData instance using the specified properties. + * ComputeEngineFinding allocatedAssetCount. + * @member {number|Long} allocatedAssetCount + * @memberof google.cloud.migrationcenter.v1.ReportSummary.ComputeEngineFinding + * @instance + */ + ComputeEngineFinding.prototype.allocatedAssetCount = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * ComputeEngineFinding machineSeriesAllocations. + * @member {Array.} machineSeriesAllocations + * @memberof google.cloud.migrationcenter.v1.ReportSummary.ComputeEngineFinding + * @instance + */ + ComputeEngineFinding.prototype.machineSeriesAllocations = $util.emptyArray; + + /** + * ComputeEngineFinding allocatedDiskTypes. + * @member {Array.} allocatedDiskTypes + * @memberof google.cloud.migrationcenter.v1.ReportSummary.ComputeEngineFinding + * @instance + */ + ComputeEngineFinding.prototype.allocatedDiskTypes = $util.emptyArray; + + /** + * Creates a new ComputeEngineFinding instance using the specified properties. * @function create - * @memberof google.cloud.migrationcenter.v1.ReportSummary.HistogramChartData + * @memberof google.cloud.migrationcenter.v1.ReportSummary.ComputeEngineFinding * @static - * @param {google.cloud.migrationcenter.v1.ReportSummary.IHistogramChartData=} [properties] Properties to set - * @returns {google.cloud.migrationcenter.v1.ReportSummary.HistogramChartData} HistogramChartData instance + * @param {google.cloud.migrationcenter.v1.ReportSummary.IComputeEngineFinding=} [properties] Properties to set + * @returns {google.cloud.migrationcenter.v1.ReportSummary.ComputeEngineFinding} ComputeEngineFinding instance */ - HistogramChartData.create = function create(properties) { - return new HistogramChartData(properties); + ComputeEngineFinding.create = function create(properties) { + return new ComputeEngineFinding(properties); }; /** - * Encodes the specified HistogramChartData message. Does not implicitly {@link google.cloud.migrationcenter.v1.ReportSummary.HistogramChartData.verify|verify} messages. + * Encodes the specified ComputeEngineFinding message. Does not implicitly {@link google.cloud.migrationcenter.v1.ReportSummary.ComputeEngineFinding.verify|verify} messages. * @function encode - * @memberof google.cloud.migrationcenter.v1.ReportSummary.HistogramChartData + * @memberof google.cloud.migrationcenter.v1.ReportSummary.ComputeEngineFinding * @static - * @param {google.cloud.migrationcenter.v1.ReportSummary.IHistogramChartData} message HistogramChartData message or plain object to encode + * @param {google.cloud.migrationcenter.v1.ReportSummary.IComputeEngineFinding} message ComputeEngineFinding message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - HistogramChartData.encode = function encode(message, writer) { + ComputeEngineFinding.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.buckets != null && message.buckets.length) - for (var i = 0; i < message.buckets.length; ++i) - $root.google.cloud.migrationcenter.v1.ReportSummary.HistogramChartData.Bucket.encode(message.buckets[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.allocatedRegions != null && message.allocatedRegions.length) + for (var i = 0; i < message.allocatedRegions.length; ++i) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.allocatedRegions[i]); + if (message.allocatedAssetCount != null && Object.hasOwnProperty.call(message, "allocatedAssetCount")) + writer.uint32(/* id 2, wireType 0 =*/16).int64(message.allocatedAssetCount); + if (message.machineSeriesAllocations != null && message.machineSeriesAllocations.length) + for (var i = 0; i < message.machineSeriesAllocations.length; ++i) + $root.google.cloud.migrationcenter.v1.ReportSummary.MachineSeriesAllocation.encode(message.machineSeriesAllocations[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.allocatedDiskTypes != null && message.allocatedDiskTypes.length) { + writer.uint32(/* id 4, wireType 2 =*/34).fork(); + for (var i = 0; i < message.allocatedDiskTypes.length; ++i) + writer.int32(message.allocatedDiskTypes[i]); + writer.ldelim(); + } return writer; }; /** - * Encodes the specified HistogramChartData message, length delimited. Does not implicitly {@link google.cloud.migrationcenter.v1.ReportSummary.HistogramChartData.verify|verify} messages. + * Encodes the specified ComputeEngineFinding message, length delimited. Does not implicitly {@link google.cloud.migrationcenter.v1.ReportSummary.ComputeEngineFinding.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.migrationcenter.v1.ReportSummary.HistogramChartData + * @memberof google.cloud.migrationcenter.v1.ReportSummary.ComputeEngineFinding * @static - * @param {google.cloud.migrationcenter.v1.ReportSummary.IHistogramChartData} message HistogramChartData message or plain object to encode + * @param {google.cloud.migrationcenter.v1.ReportSummary.IComputeEngineFinding} message ComputeEngineFinding message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - HistogramChartData.encodeDelimited = function encodeDelimited(message, writer) { + ComputeEngineFinding.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a HistogramChartData message from the specified reader or buffer. + * Decodes a ComputeEngineFinding message from the specified reader or buffer. * @function decode - * @memberof google.cloud.migrationcenter.v1.ReportSummary.HistogramChartData + * @memberof google.cloud.migrationcenter.v1.ReportSummary.ComputeEngineFinding * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.migrationcenter.v1.ReportSummary.HistogramChartData} HistogramChartData + * @returns {google.cloud.migrationcenter.v1.ReportSummary.ComputeEngineFinding} ComputeEngineFinding * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - HistogramChartData.decode = function decode(reader, length) { + ComputeEngineFinding.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.migrationcenter.v1.ReportSummary.HistogramChartData(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.migrationcenter.v1.ReportSummary.ComputeEngineFinding(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: { - if (!(message.buckets && message.buckets.length)) - message.buckets = []; - message.buckets.push($root.google.cloud.migrationcenter.v1.ReportSummary.HistogramChartData.Bucket.decode(reader, reader.uint32())); + if (!(message.allocatedRegions && message.allocatedRegions.length)) + message.allocatedRegions = []; + message.allocatedRegions.push(reader.string()); + break; + } + case 2: { + message.allocatedAssetCount = reader.int64(); + break; + } + case 3: { + if (!(message.machineSeriesAllocations && message.machineSeriesAllocations.length)) + message.machineSeriesAllocations = []; + message.machineSeriesAllocations.push($root.google.cloud.migrationcenter.v1.ReportSummary.MachineSeriesAllocation.decode(reader, reader.uint32())); + break; + } + case 4: { + if (!(message.allocatedDiskTypes && message.allocatedDiskTypes.length)) + message.allocatedDiskTypes = []; + if ((tag & 7) === 2) { + var end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) + message.allocatedDiskTypes.push(reader.int32()); + } else + message.allocatedDiskTypes.push(reader.int32()); break; } default: @@ -46092,440 +49063,536 @@ }; /** - * Decodes a HistogramChartData message from the specified reader or buffer, length delimited. + * Decodes a ComputeEngineFinding message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.migrationcenter.v1.ReportSummary.HistogramChartData + * @memberof google.cloud.migrationcenter.v1.ReportSummary.ComputeEngineFinding * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.migrationcenter.v1.ReportSummary.HistogramChartData} HistogramChartData + * @returns {google.cloud.migrationcenter.v1.ReportSummary.ComputeEngineFinding} ComputeEngineFinding * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - HistogramChartData.decodeDelimited = function decodeDelimited(reader) { + ComputeEngineFinding.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a HistogramChartData message. + * Verifies a ComputeEngineFinding message. * @function verify - * @memberof google.cloud.migrationcenter.v1.ReportSummary.HistogramChartData + * @memberof google.cloud.migrationcenter.v1.ReportSummary.ComputeEngineFinding * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - HistogramChartData.verify = function verify(message) { + ComputeEngineFinding.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.buckets != null && message.hasOwnProperty("buckets")) { - if (!Array.isArray(message.buckets)) - return "buckets: array expected"; - for (var i = 0; i < message.buckets.length; ++i) { - var error = $root.google.cloud.migrationcenter.v1.ReportSummary.HistogramChartData.Bucket.verify(message.buckets[i]); + if (message.allocatedRegions != null && message.hasOwnProperty("allocatedRegions")) { + if (!Array.isArray(message.allocatedRegions)) + return "allocatedRegions: array expected"; + for (var i = 0; i < message.allocatedRegions.length; ++i) + if (!$util.isString(message.allocatedRegions[i])) + return "allocatedRegions: string[] expected"; + } + if (message.allocatedAssetCount != null && message.hasOwnProperty("allocatedAssetCount")) + if (!$util.isInteger(message.allocatedAssetCount) && !(message.allocatedAssetCount && $util.isInteger(message.allocatedAssetCount.low) && $util.isInteger(message.allocatedAssetCount.high))) + return "allocatedAssetCount: integer|Long expected"; + if (message.machineSeriesAllocations != null && message.hasOwnProperty("machineSeriesAllocations")) { + if (!Array.isArray(message.machineSeriesAllocations)) + return "machineSeriesAllocations: array expected"; + for (var i = 0; i < message.machineSeriesAllocations.length; ++i) { + var error = $root.google.cloud.migrationcenter.v1.ReportSummary.MachineSeriesAllocation.verify(message.machineSeriesAllocations[i]); if (error) - return "buckets." + error; + return "machineSeriesAllocations." + error; } } + if (message.allocatedDiskTypes != null && message.hasOwnProperty("allocatedDiskTypes")) { + if (!Array.isArray(message.allocatedDiskTypes)) + return "allocatedDiskTypes: array expected"; + for (var i = 0; i < message.allocatedDiskTypes.length; ++i) + switch (message.allocatedDiskTypes[i]) { + default: + return "allocatedDiskTypes: enum value[] expected"; + case 0: + case 1: + case 2: + case 3: + break; + } + } return null; }; /** - * Creates a HistogramChartData message from a plain object. Also converts values to their respective internal types. + * Creates a ComputeEngineFinding message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.migrationcenter.v1.ReportSummary.HistogramChartData + * @memberof google.cloud.migrationcenter.v1.ReportSummary.ComputeEngineFinding * @static * @param {Object.} object Plain object - * @returns {google.cloud.migrationcenter.v1.ReportSummary.HistogramChartData} HistogramChartData + * @returns {google.cloud.migrationcenter.v1.ReportSummary.ComputeEngineFinding} ComputeEngineFinding */ - HistogramChartData.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.migrationcenter.v1.ReportSummary.HistogramChartData) + ComputeEngineFinding.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.migrationcenter.v1.ReportSummary.ComputeEngineFinding) return object; - var message = new $root.google.cloud.migrationcenter.v1.ReportSummary.HistogramChartData(); - if (object.buckets) { - if (!Array.isArray(object.buckets)) - throw TypeError(".google.cloud.migrationcenter.v1.ReportSummary.HistogramChartData.buckets: array expected"); - message.buckets = []; - for (var i = 0; i < object.buckets.length; ++i) { - if (typeof object.buckets[i] !== "object") - throw TypeError(".google.cloud.migrationcenter.v1.ReportSummary.HistogramChartData.buckets: object expected"); - message.buckets[i] = $root.google.cloud.migrationcenter.v1.ReportSummary.HistogramChartData.Bucket.fromObject(object.buckets[i]); + var message = new $root.google.cloud.migrationcenter.v1.ReportSummary.ComputeEngineFinding(); + if (object.allocatedRegions) { + if (!Array.isArray(object.allocatedRegions)) + throw TypeError(".google.cloud.migrationcenter.v1.ReportSummary.ComputeEngineFinding.allocatedRegions: array expected"); + message.allocatedRegions = []; + for (var i = 0; i < object.allocatedRegions.length; ++i) + message.allocatedRegions[i] = String(object.allocatedRegions[i]); + } + if (object.allocatedAssetCount != null) + if ($util.Long) + (message.allocatedAssetCount = $util.Long.fromValue(object.allocatedAssetCount)).unsigned = false; + else if (typeof object.allocatedAssetCount === "string") + message.allocatedAssetCount = parseInt(object.allocatedAssetCount, 10); + else if (typeof object.allocatedAssetCount === "number") + message.allocatedAssetCount = object.allocatedAssetCount; + else if (typeof object.allocatedAssetCount === "object") + message.allocatedAssetCount = new $util.LongBits(object.allocatedAssetCount.low >>> 0, object.allocatedAssetCount.high >>> 0).toNumber(); + if (object.machineSeriesAllocations) { + if (!Array.isArray(object.machineSeriesAllocations)) + throw TypeError(".google.cloud.migrationcenter.v1.ReportSummary.ComputeEngineFinding.machineSeriesAllocations: array expected"); + message.machineSeriesAllocations = []; + for (var i = 0; i < object.machineSeriesAllocations.length; ++i) { + if (typeof object.machineSeriesAllocations[i] !== "object") + throw TypeError(".google.cloud.migrationcenter.v1.ReportSummary.ComputeEngineFinding.machineSeriesAllocations: object expected"); + message.machineSeriesAllocations[i] = $root.google.cloud.migrationcenter.v1.ReportSummary.MachineSeriesAllocation.fromObject(object.machineSeriesAllocations[i]); } } + if (object.allocatedDiskTypes) { + if (!Array.isArray(object.allocatedDiskTypes)) + throw TypeError(".google.cloud.migrationcenter.v1.ReportSummary.ComputeEngineFinding.allocatedDiskTypes: array expected"); + message.allocatedDiskTypes = []; + for (var i = 0; i < object.allocatedDiskTypes.length; ++i) + switch (object.allocatedDiskTypes[i]) { + default: + if (typeof object.allocatedDiskTypes[i] === "number") { + message.allocatedDiskTypes[i] = object.allocatedDiskTypes[i]; + break; + } + case "PERSISTENT_DISK_TYPE_UNSPECIFIED": + case 0: + message.allocatedDiskTypes[i] = 0; + break; + case "PERSISTENT_DISK_TYPE_STANDARD": + case 1: + message.allocatedDiskTypes[i] = 1; + break; + case "PERSISTENT_DISK_TYPE_BALANCED": + case 2: + message.allocatedDiskTypes[i] = 2; + break; + case "PERSISTENT_DISK_TYPE_SSD": + case 3: + message.allocatedDiskTypes[i] = 3; + break; + } + } return message; }; /** - * Creates a plain object from a HistogramChartData message. Also converts values to other types if specified. + * Creates a plain object from a ComputeEngineFinding message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.migrationcenter.v1.ReportSummary.HistogramChartData + * @memberof google.cloud.migrationcenter.v1.ReportSummary.ComputeEngineFinding * @static - * @param {google.cloud.migrationcenter.v1.ReportSummary.HistogramChartData} message HistogramChartData + * @param {google.cloud.migrationcenter.v1.ReportSummary.ComputeEngineFinding} message ComputeEngineFinding * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - HistogramChartData.toObject = function toObject(message, options) { + ComputeEngineFinding.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.arrays || options.defaults) - object.buckets = []; - if (message.buckets && message.buckets.length) { - object.buckets = []; - for (var j = 0; j < message.buckets.length; ++j) - object.buckets[j] = $root.google.cloud.migrationcenter.v1.ReportSummary.HistogramChartData.Bucket.toObject(message.buckets[j], options); + if (options.arrays || options.defaults) { + object.allocatedRegions = []; + object.machineSeriesAllocations = []; + object.allocatedDiskTypes = []; + } + if (options.defaults) + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.allocatedAssetCount = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.allocatedAssetCount = options.longs === String ? "0" : 0; + if (message.allocatedRegions && message.allocatedRegions.length) { + object.allocatedRegions = []; + for (var j = 0; j < message.allocatedRegions.length; ++j) + object.allocatedRegions[j] = message.allocatedRegions[j]; + } + if (message.allocatedAssetCount != null && message.hasOwnProperty("allocatedAssetCount")) + if (typeof message.allocatedAssetCount === "number") + object.allocatedAssetCount = options.longs === String ? String(message.allocatedAssetCount) : message.allocatedAssetCount; + else + object.allocatedAssetCount = options.longs === String ? $util.Long.prototype.toString.call(message.allocatedAssetCount) : options.longs === Number ? new $util.LongBits(message.allocatedAssetCount.low >>> 0, message.allocatedAssetCount.high >>> 0).toNumber() : message.allocatedAssetCount; + if (message.machineSeriesAllocations && message.machineSeriesAllocations.length) { + object.machineSeriesAllocations = []; + for (var j = 0; j < message.machineSeriesAllocations.length; ++j) + object.machineSeriesAllocations[j] = $root.google.cloud.migrationcenter.v1.ReportSummary.MachineSeriesAllocation.toObject(message.machineSeriesAllocations[j], options); + } + if (message.allocatedDiskTypes && message.allocatedDiskTypes.length) { + object.allocatedDiskTypes = []; + for (var j = 0; j < message.allocatedDiskTypes.length; ++j) + object.allocatedDiskTypes[j] = options.enums === String ? $root.google.cloud.migrationcenter.v1.PersistentDiskType[message.allocatedDiskTypes[j]] === undefined ? message.allocatedDiskTypes[j] : $root.google.cloud.migrationcenter.v1.PersistentDiskType[message.allocatedDiskTypes[j]] : message.allocatedDiskTypes[j]; } return object; }; /** - * Converts this HistogramChartData to JSON. + * Converts this ComputeEngineFinding to JSON. * @function toJSON - * @memberof google.cloud.migrationcenter.v1.ReportSummary.HistogramChartData + * @memberof google.cloud.migrationcenter.v1.ReportSummary.ComputeEngineFinding * @instance * @returns {Object.} JSON object */ - HistogramChartData.prototype.toJSON = function toJSON() { + ComputeEngineFinding.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for HistogramChartData + * Gets the default type url for ComputeEngineFinding * @function getTypeUrl - * @memberof google.cloud.migrationcenter.v1.ReportSummary.HistogramChartData + * @memberof google.cloud.migrationcenter.v1.ReportSummary.ComputeEngineFinding * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - HistogramChartData.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + ComputeEngineFinding.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.cloud.migrationcenter.v1.ReportSummary.HistogramChartData"; + return typeUrlPrefix + "/google.cloud.migrationcenter.v1.ReportSummary.ComputeEngineFinding"; }; - HistogramChartData.Bucket = (function() { - - /** - * Properties of a Bucket. - * @memberof google.cloud.migrationcenter.v1.ReportSummary.HistogramChartData - * @interface IBucket - * @property {number|Long|null} [lowerBound] Bucket lowerBound - * @property {number|Long|null} [upperBound] Bucket upperBound - * @property {number|Long|null} [count] Bucket count - */ - - /** - * Constructs a new Bucket. - * @memberof google.cloud.migrationcenter.v1.ReportSummary.HistogramChartData - * @classdesc Represents a Bucket. - * @implements IBucket - * @constructor - * @param {google.cloud.migrationcenter.v1.ReportSummary.HistogramChartData.IBucket=} [properties] Properties to set - */ - function Bucket(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * Bucket lowerBound. - * @member {number|Long} lowerBound - * @memberof google.cloud.migrationcenter.v1.ReportSummary.HistogramChartData.Bucket - * @instance - */ - Bucket.prototype.lowerBound = $util.Long ? $util.Long.fromBits(0,0,false) : 0; - - /** - * Bucket upperBound. - * @member {number|Long} upperBound - * @memberof google.cloud.migrationcenter.v1.ReportSummary.HistogramChartData.Bucket - * @instance - */ - Bucket.prototype.upperBound = $util.Long ? $util.Long.fromBits(0,0,false) : 0; - - /** - * Bucket count. - * @member {number|Long} count - * @memberof google.cloud.migrationcenter.v1.ReportSummary.HistogramChartData.Bucket - * @instance - */ - Bucket.prototype.count = $util.Long ? $util.Long.fromBits(0,0,false) : 0; - - /** - * Creates a new Bucket instance using the specified properties. - * @function create - * @memberof google.cloud.migrationcenter.v1.ReportSummary.HistogramChartData.Bucket - * @static - * @param {google.cloud.migrationcenter.v1.ReportSummary.HistogramChartData.IBucket=} [properties] Properties to set - * @returns {google.cloud.migrationcenter.v1.ReportSummary.HistogramChartData.Bucket} Bucket instance - */ - Bucket.create = function create(properties) { - return new Bucket(properties); - }; + return ComputeEngineFinding; + })(); - /** - * Encodes the specified Bucket message. Does not implicitly {@link google.cloud.migrationcenter.v1.ReportSummary.HistogramChartData.Bucket.verify|verify} messages. - * @function encode - * @memberof google.cloud.migrationcenter.v1.ReportSummary.HistogramChartData.Bucket - * @static - * @param {google.cloud.migrationcenter.v1.ReportSummary.HistogramChartData.IBucket} message Bucket message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Bucket.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.lowerBound != null && Object.hasOwnProperty.call(message, "lowerBound")) - writer.uint32(/* id 1, wireType 0 =*/8).int64(message.lowerBound); - if (message.upperBound != null && Object.hasOwnProperty.call(message, "upperBound")) - writer.uint32(/* id 2, wireType 0 =*/16).int64(message.upperBound); - if (message.count != null && Object.hasOwnProperty.call(message, "count")) - writer.uint32(/* id 3, wireType 0 =*/24).int64(message.count); - return writer; - }; + ReportSummary.VmwareEngineFinding = (function() { - /** - * Encodes the specified Bucket message, length delimited. Does not implicitly {@link google.cloud.migrationcenter.v1.ReportSummary.HistogramChartData.Bucket.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.migrationcenter.v1.ReportSummary.HistogramChartData.Bucket - * @static - * @param {google.cloud.migrationcenter.v1.ReportSummary.HistogramChartData.IBucket} message Bucket message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Bucket.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; + /** + * Properties of a VmwareEngineFinding. + * @memberof google.cloud.migrationcenter.v1.ReportSummary + * @interface IVmwareEngineFinding + * @property {Array.|null} [allocatedRegions] VmwareEngineFinding allocatedRegions + * @property {number|Long|null} [allocatedAssetCount] VmwareEngineFinding allocatedAssetCount + * @property {Array.|null} [nodeAllocations] VmwareEngineFinding nodeAllocations + */ - /** - * Decodes a Bucket message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.migrationcenter.v1.ReportSummary.HistogramChartData.Bucket - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.migrationcenter.v1.ReportSummary.HistogramChartData.Bucket} Bucket - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Bucket.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.migrationcenter.v1.ReportSummary.HistogramChartData.Bucket(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - message.lowerBound = reader.int64(); - break; - } - case 2: { - message.upperBound = reader.int64(); - break; - } - case 3: { - message.count = reader.int64(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; + /** + * Constructs a new VmwareEngineFinding. + * @memberof google.cloud.migrationcenter.v1.ReportSummary + * @classdesc Represents a VmwareEngineFinding. + * @implements IVmwareEngineFinding + * @constructor + * @param {google.cloud.migrationcenter.v1.ReportSummary.IVmwareEngineFinding=} [properties] Properties to set + */ + function VmwareEngineFinding(properties) { + this.allocatedRegions = []; + this.nodeAllocations = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } - /** - * Decodes a Bucket message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.migrationcenter.v1.ReportSummary.HistogramChartData.Bucket - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.migrationcenter.v1.ReportSummary.HistogramChartData.Bucket} Bucket - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Bucket.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; + /** + * VmwareEngineFinding allocatedRegions. + * @member {Array.} allocatedRegions + * @memberof google.cloud.migrationcenter.v1.ReportSummary.VmwareEngineFinding + * @instance + */ + VmwareEngineFinding.prototype.allocatedRegions = $util.emptyArray; - /** - * Verifies a Bucket message. - * @function verify - * @memberof google.cloud.migrationcenter.v1.ReportSummary.HistogramChartData.Bucket - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Bucket.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.lowerBound != null && message.hasOwnProperty("lowerBound")) - if (!$util.isInteger(message.lowerBound) && !(message.lowerBound && $util.isInteger(message.lowerBound.low) && $util.isInteger(message.lowerBound.high))) - return "lowerBound: integer|Long expected"; - if (message.upperBound != null && message.hasOwnProperty("upperBound")) - if (!$util.isInteger(message.upperBound) && !(message.upperBound && $util.isInteger(message.upperBound.low) && $util.isInteger(message.upperBound.high))) - return "upperBound: integer|Long expected"; - if (message.count != null && message.hasOwnProperty("count")) - if (!$util.isInteger(message.count) && !(message.count && $util.isInteger(message.count.low) && $util.isInteger(message.count.high))) - return "count: integer|Long expected"; - return null; - }; + /** + * VmwareEngineFinding allocatedAssetCount. + * @member {number|Long} allocatedAssetCount + * @memberof google.cloud.migrationcenter.v1.ReportSummary.VmwareEngineFinding + * @instance + */ + VmwareEngineFinding.prototype.allocatedAssetCount = $util.Long ? $util.Long.fromBits(0,0,false) : 0; - /** - * Creates a Bucket message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.migrationcenter.v1.ReportSummary.HistogramChartData.Bucket - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.migrationcenter.v1.ReportSummary.HistogramChartData.Bucket} Bucket - */ - Bucket.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.migrationcenter.v1.ReportSummary.HistogramChartData.Bucket) - return object; - var message = new $root.google.cloud.migrationcenter.v1.ReportSummary.HistogramChartData.Bucket(); - if (object.lowerBound != null) - if ($util.Long) - (message.lowerBound = $util.Long.fromValue(object.lowerBound)).unsigned = false; - else if (typeof object.lowerBound === "string") - message.lowerBound = parseInt(object.lowerBound, 10); - else if (typeof object.lowerBound === "number") - message.lowerBound = object.lowerBound; - else if (typeof object.lowerBound === "object") - message.lowerBound = new $util.LongBits(object.lowerBound.low >>> 0, object.lowerBound.high >>> 0).toNumber(); - if (object.upperBound != null) - if ($util.Long) - (message.upperBound = $util.Long.fromValue(object.upperBound)).unsigned = false; - else if (typeof object.upperBound === "string") - message.upperBound = parseInt(object.upperBound, 10); - else if (typeof object.upperBound === "number") - message.upperBound = object.upperBound; - else if (typeof object.upperBound === "object") - message.upperBound = new $util.LongBits(object.upperBound.low >>> 0, object.upperBound.high >>> 0).toNumber(); - if (object.count != null) - if ($util.Long) - (message.count = $util.Long.fromValue(object.count)).unsigned = false; - else if (typeof object.count === "string") - message.count = parseInt(object.count, 10); - else if (typeof object.count === "number") - message.count = object.count; - else if (typeof object.count === "object") - message.count = new $util.LongBits(object.count.low >>> 0, object.count.high >>> 0).toNumber(); - return message; - }; + /** + * VmwareEngineFinding nodeAllocations. + * @member {Array.} nodeAllocations + * @memberof google.cloud.migrationcenter.v1.ReportSummary.VmwareEngineFinding + * @instance + */ + VmwareEngineFinding.prototype.nodeAllocations = $util.emptyArray; - /** - * Creates a plain object from a Bucket message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.migrationcenter.v1.ReportSummary.HistogramChartData.Bucket - * @static - * @param {google.cloud.migrationcenter.v1.ReportSummary.HistogramChartData.Bucket} message Bucket - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Bucket.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.lowerBound = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.lowerBound = options.longs === String ? "0" : 0; - if ($util.Long) { - var long = new $util.Long(0, 0, false); - object.upperBound = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.upperBound = options.longs === String ? "0" : 0; - if ($util.Long) { - var long = new $util.Long(0, 0, false); - object.count = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.count = options.longs === String ? "0" : 0; + /** + * Creates a new VmwareEngineFinding instance using the specified properties. + * @function create + * @memberof google.cloud.migrationcenter.v1.ReportSummary.VmwareEngineFinding + * @static + * @param {google.cloud.migrationcenter.v1.ReportSummary.IVmwareEngineFinding=} [properties] Properties to set + * @returns {google.cloud.migrationcenter.v1.ReportSummary.VmwareEngineFinding} VmwareEngineFinding instance + */ + VmwareEngineFinding.create = function create(properties) { + return new VmwareEngineFinding(properties); + }; + + /** + * Encodes the specified VmwareEngineFinding message. Does not implicitly {@link google.cloud.migrationcenter.v1.ReportSummary.VmwareEngineFinding.verify|verify} messages. + * @function encode + * @memberof google.cloud.migrationcenter.v1.ReportSummary.VmwareEngineFinding + * @static + * @param {google.cloud.migrationcenter.v1.ReportSummary.IVmwareEngineFinding} message VmwareEngineFinding message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + VmwareEngineFinding.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.allocatedRegions != null && message.allocatedRegions.length) + for (var i = 0; i < message.allocatedRegions.length; ++i) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.allocatedRegions[i]); + if (message.allocatedAssetCount != null && Object.hasOwnProperty.call(message, "allocatedAssetCount")) + writer.uint32(/* id 2, wireType 0 =*/16).int64(message.allocatedAssetCount); + if (message.nodeAllocations != null && message.nodeAllocations.length) + for (var i = 0; i < message.nodeAllocations.length; ++i) + $root.google.cloud.migrationcenter.v1.ReportSummary.VmwareNodeAllocation.encode(message.nodeAllocations[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified VmwareEngineFinding message, length delimited. Does not implicitly {@link google.cloud.migrationcenter.v1.ReportSummary.VmwareEngineFinding.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.migrationcenter.v1.ReportSummary.VmwareEngineFinding + * @static + * @param {google.cloud.migrationcenter.v1.ReportSummary.IVmwareEngineFinding} message VmwareEngineFinding message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + VmwareEngineFinding.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a VmwareEngineFinding message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.migrationcenter.v1.ReportSummary.VmwareEngineFinding + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.migrationcenter.v1.ReportSummary.VmwareEngineFinding} VmwareEngineFinding + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + VmwareEngineFinding.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.migrationcenter.v1.ReportSummary.VmwareEngineFinding(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.allocatedRegions && message.allocatedRegions.length)) + message.allocatedRegions = []; + message.allocatedRegions.push(reader.string()); + break; + } + case 2: { + message.allocatedAssetCount = reader.int64(); + break; + } + case 3: { + if (!(message.nodeAllocations && message.nodeAllocations.length)) + message.nodeAllocations = []; + message.nodeAllocations.push($root.google.cloud.migrationcenter.v1.ReportSummary.VmwareNodeAllocation.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; } - if (message.lowerBound != null && message.hasOwnProperty("lowerBound")) - if (typeof message.lowerBound === "number") - object.lowerBound = options.longs === String ? String(message.lowerBound) : message.lowerBound; - else - object.lowerBound = options.longs === String ? $util.Long.prototype.toString.call(message.lowerBound) : options.longs === Number ? new $util.LongBits(message.lowerBound.low >>> 0, message.lowerBound.high >>> 0).toNumber() : message.lowerBound; - if (message.upperBound != null && message.hasOwnProperty("upperBound")) - if (typeof message.upperBound === "number") - object.upperBound = options.longs === String ? String(message.upperBound) : message.upperBound; - else - object.upperBound = options.longs === String ? $util.Long.prototype.toString.call(message.upperBound) : options.longs === Number ? new $util.LongBits(message.upperBound.low >>> 0, message.upperBound.high >>> 0).toNumber() : message.upperBound; - if (message.count != null && message.hasOwnProperty("count")) - if (typeof message.count === "number") - object.count = options.longs === String ? String(message.count) : message.count; - else - object.count = options.longs === String ? $util.Long.prototype.toString.call(message.count) : options.longs === Number ? new $util.LongBits(message.count.low >>> 0, message.count.high >>> 0).toNumber() : message.count; - return object; - }; + } + return message; + }; - /** - * Converts this Bucket to JSON. - * @function toJSON - * @memberof google.cloud.migrationcenter.v1.ReportSummary.HistogramChartData.Bucket - * @instance - * @returns {Object.} JSON object - */ - Bucket.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; + /** + * Decodes a VmwareEngineFinding message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.migrationcenter.v1.ReportSummary.VmwareEngineFinding + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.migrationcenter.v1.ReportSummary.VmwareEngineFinding} VmwareEngineFinding + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + VmwareEngineFinding.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; - /** - * Gets the default type url for Bucket - * @function getTypeUrl - * @memberof google.cloud.migrationcenter.v1.ReportSummary.HistogramChartData.Bucket - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - Bucket.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; + /** + * Verifies a VmwareEngineFinding message. + * @function verify + * @memberof google.cloud.migrationcenter.v1.ReportSummary.VmwareEngineFinding + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + VmwareEngineFinding.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.allocatedRegions != null && message.hasOwnProperty("allocatedRegions")) { + if (!Array.isArray(message.allocatedRegions)) + return "allocatedRegions: array expected"; + for (var i = 0; i < message.allocatedRegions.length; ++i) + if (!$util.isString(message.allocatedRegions[i])) + return "allocatedRegions: string[] expected"; + } + if (message.allocatedAssetCount != null && message.hasOwnProperty("allocatedAssetCount")) + if (!$util.isInteger(message.allocatedAssetCount) && !(message.allocatedAssetCount && $util.isInteger(message.allocatedAssetCount.low) && $util.isInteger(message.allocatedAssetCount.high))) + return "allocatedAssetCount: integer|Long expected"; + if (message.nodeAllocations != null && message.hasOwnProperty("nodeAllocations")) { + if (!Array.isArray(message.nodeAllocations)) + return "nodeAllocations: array expected"; + for (var i = 0; i < message.nodeAllocations.length; ++i) { + var error = $root.google.cloud.migrationcenter.v1.ReportSummary.VmwareNodeAllocation.verify(message.nodeAllocations[i]); + if (error) + return "nodeAllocations." + error; } - return typeUrlPrefix + "/google.cloud.migrationcenter.v1.ReportSummary.HistogramChartData.Bucket"; - }; + } + return null; + }; - return Bucket; - })(); + /** + * Creates a VmwareEngineFinding message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.migrationcenter.v1.ReportSummary.VmwareEngineFinding + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.migrationcenter.v1.ReportSummary.VmwareEngineFinding} VmwareEngineFinding + */ + VmwareEngineFinding.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.migrationcenter.v1.ReportSummary.VmwareEngineFinding) + return object; + var message = new $root.google.cloud.migrationcenter.v1.ReportSummary.VmwareEngineFinding(); + if (object.allocatedRegions) { + if (!Array.isArray(object.allocatedRegions)) + throw TypeError(".google.cloud.migrationcenter.v1.ReportSummary.VmwareEngineFinding.allocatedRegions: array expected"); + message.allocatedRegions = []; + for (var i = 0; i < object.allocatedRegions.length; ++i) + message.allocatedRegions[i] = String(object.allocatedRegions[i]); + } + if (object.allocatedAssetCount != null) + if ($util.Long) + (message.allocatedAssetCount = $util.Long.fromValue(object.allocatedAssetCount)).unsigned = false; + else if (typeof object.allocatedAssetCount === "string") + message.allocatedAssetCount = parseInt(object.allocatedAssetCount, 10); + else if (typeof object.allocatedAssetCount === "number") + message.allocatedAssetCount = object.allocatedAssetCount; + else if (typeof object.allocatedAssetCount === "object") + message.allocatedAssetCount = new $util.LongBits(object.allocatedAssetCount.low >>> 0, object.allocatedAssetCount.high >>> 0).toNumber(); + if (object.nodeAllocations) { + if (!Array.isArray(object.nodeAllocations)) + throw TypeError(".google.cloud.migrationcenter.v1.ReportSummary.VmwareEngineFinding.nodeAllocations: array expected"); + message.nodeAllocations = []; + for (var i = 0; i < object.nodeAllocations.length; ++i) { + if (typeof object.nodeAllocations[i] !== "object") + throw TypeError(".google.cloud.migrationcenter.v1.ReportSummary.VmwareEngineFinding.nodeAllocations: object expected"); + message.nodeAllocations[i] = $root.google.cloud.migrationcenter.v1.ReportSummary.VmwareNodeAllocation.fromObject(object.nodeAllocations[i]); + } + } + return message; + }; - return HistogramChartData; + /** + * Creates a plain object from a VmwareEngineFinding message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.migrationcenter.v1.ReportSummary.VmwareEngineFinding + * @static + * @param {google.cloud.migrationcenter.v1.ReportSummary.VmwareEngineFinding} message VmwareEngineFinding + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + VmwareEngineFinding.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.allocatedRegions = []; + object.nodeAllocations = []; + } + if (options.defaults) + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.allocatedAssetCount = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.allocatedAssetCount = options.longs === String ? "0" : 0; + if (message.allocatedRegions && message.allocatedRegions.length) { + object.allocatedRegions = []; + for (var j = 0; j < message.allocatedRegions.length; ++j) + object.allocatedRegions[j] = message.allocatedRegions[j]; + } + if (message.allocatedAssetCount != null && message.hasOwnProperty("allocatedAssetCount")) + if (typeof message.allocatedAssetCount === "number") + object.allocatedAssetCount = options.longs === String ? String(message.allocatedAssetCount) : message.allocatedAssetCount; + else + object.allocatedAssetCount = options.longs === String ? $util.Long.prototype.toString.call(message.allocatedAssetCount) : options.longs === Number ? new $util.LongBits(message.allocatedAssetCount.low >>> 0, message.allocatedAssetCount.high >>> 0).toNumber() : message.allocatedAssetCount; + if (message.nodeAllocations && message.nodeAllocations.length) { + object.nodeAllocations = []; + for (var j = 0; j < message.nodeAllocations.length; ++j) + object.nodeAllocations[j] = $root.google.cloud.migrationcenter.v1.ReportSummary.VmwareNodeAllocation.toObject(message.nodeAllocations[j], options); + } + return object; + }; + + /** + * Converts this VmwareEngineFinding to JSON. + * @function toJSON + * @memberof google.cloud.migrationcenter.v1.ReportSummary.VmwareEngineFinding + * @instance + * @returns {Object.} JSON object + */ + VmwareEngineFinding.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for VmwareEngineFinding + * @function getTypeUrl + * @memberof google.cloud.migrationcenter.v1.ReportSummary.VmwareEngineFinding + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + VmwareEngineFinding.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.migrationcenter.v1.ReportSummary.VmwareEngineFinding"; + }; + + return VmwareEngineFinding; })(); - ReportSummary.AssetAggregateStats = (function() { + ReportSummary.VmwareNodeAllocation = (function() { /** - * Properties of an AssetAggregateStats. + * Properties of a VmwareNodeAllocation. * @memberof google.cloud.migrationcenter.v1.ReportSummary - * @interface IAssetAggregateStats - * @property {number|Long|null} [totalMemoryBytes] AssetAggregateStats totalMemoryBytes - * @property {number|Long|null} [totalStorageBytes] AssetAggregateStats totalStorageBytes - * @property {number|Long|null} [totalCores] AssetAggregateStats totalCores - * @property {number|Long|null} [totalAssets] AssetAggregateStats totalAssets - * @property {google.cloud.migrationcenter.v1.ReportSummary.IUtilizationChartData|null} [memoryUtilizationChart] AssetAggregateStats memoryUtilizationChart - * @property {google.cloud.migrationcenter.v1.ReportSummary.IUtilizationChartData|null} [storageUtilizationChart] AssetAggregateStats storageUtilizationChart - * @property {google.cloud.migrationcenter.v1.ReportSummary.IChartData|null} [operatingSystem] AssetAggregateStats operatingSystem - * @property {google.cloud.migrationcenter.v1.ReportSummary.IHistogramChartData|null} [coreCountHistogram] AssetAggregateStats coreCountHistogram - * @property {google.cloud.migrationcenter.v1.ReportSummary.IHistogramChartData|null} [memoryBytesHistogram] AssetAggregateStats memoryBytesHistogram - * @property {google.cloud.migrationcenter.v1.ReportSummary.IHistogramChartData|null} [storageBytesHistogram] AssetAggregateStats storageBytesHistogram + * @interface IVmwareNodeAllocation + * @property {google.cloud.migrationcenter.v1.ReportSummary.IVmwareNode|null} [vmwareNode] VmwareNodeAllocation vmwareNode + * @property {number|Long|null} [nodeCount] VmwareNodeAllocation nodeCount + * @property {number|Long|null} [allocatedAssetCount] VmwareNodeAllocation allocatedAssetCount */ /** - * Constructs a new AssetAggregateStats. + * Constructs a new VmwareNodeAllocation. * @memberof google.cloud.migrationcenter.v1.ReportSummary - * @classdesc Represents an AssetAggregateStats. - * @implements IAssetAggregateStats + * @classdesc Represents a VmwareNodeAllocation. + * @implements IVmwareNodeAllocation * @constructor - * @param {google.cloud.migrationcenter.v1.ReportSummary.IAssetAggregateStats=} [properties] Properties to set + * @param {google.cloud.migrationcenter.v1.ReportSummary.IVmwareNodeAllocation=} [properties] Properties to set */ - function AssetAggregateStats(properties) { + function VmwareNodeAllocation(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -46533,201 +49600,356 @@ } /** - * AssetAggregateStats totalMemoryBytes. - * @member {number|Long} totalMemoryBytes - * @memberof google.cloud.migrationcenter.v1.ReportSummary.AssetAggregateStats + * VmwareNodeAllocation vmwareNode. + * @member {google.cloud.migrationcenter.v1.ReportSummary.IVmwareNode|null|undefined} vmwareNode + * @memberof google.cloud.migrationcenter.v1.ReportSummary.VmwareNodeAllocation * @instance */ - AssetAggregateStats.prototype.totalMemoryBytes = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + VmwareNodeAllocation.prototype.vmwareNode = null; /** - * AssetAggregateStats totalStorageBytes. - * @member {number|Long} totalStorageBytes - * @memberof google.cloud.migrationcenter.v1.ReportSummary.AssetAggregateStats + * VmwareNodeAllocation nodeCount. + * @member {number|Long} nodeCount + * @memberof google.cloud.migrationcenter.v1.ReportSummary.VmwareNodeAllocation * @instance */ - AssetAggregateStats.prototype.totalStorageBytes = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + VmwareNodeAllocation.prototype.nodeCount = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * VmwareNodeAllocation allocatedAssetCount. + * @member {number|Long} allocatedAssetCount + * @memberof google.cloud.migrationcenter.v1.ReportSummary.VmwareNodeAllocation + * @instance + */ + VmwareNodeAllocation.prototype.allocatedAssetCount = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new VmwareNodeAllocation instance using the specified properties. + * @function create + * @memberof google.cloud.migrationcenter.v1.ReportSummary.VmwareNodeAllocation + * @static + * @param {google.cloud.migrationcenter.v1.ReportSummary.IVmwareNodeAllocation=} [properties] Properties to set + * @returns {google.cloud.migrationcenter.v1.ReportSummary.VmwareNodeAllocation} VmwareNodeAllocation instance + */ + VmwareNodeAllocation.create = function create(properties) { + return new VmwareNodeAllocation(properties); + }; + + /** + * Encodes the specified VmwareNodeAllocation message. Does not implicitly {@link google.cloud.migrationcenter.v1.ReportSummary.VmwareNodeAllocation.verify|verify} messages. + * @function encode + * @memberof google.cloud.migrationcenter.v1.ReportSummary.VmwareNodeAllocation + * @static + * @param {google.cloud.migrationcenter.v1.ReportSummary.IVmwareNodeAllocation} message VmwareNodeAllocation message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + VmwareNodeAllocation.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.vmwareNode != null && Object.hasOwnProperty.call(message, "vmwareNode")) + $root.google.cloud.migrationcenter.v1.ReportSummary.VmwareNode.encode(message.vmwareNode, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.nodeCount != null && Object.hasOwnProperty.call(message, "nodeCount")) + writer.uint32(/* id 2, wireType 0 =*/16).int64(message.nodeCount); + if (message.allocatedAssetCount != null && Object.hasOwnProperty.call(message, "allocatedAssetCount")) + writer.uint32(/* id 3, wireType 0 =*/24).int64(message.allocatedAssetCount); + return writer; + }; + + /** + * Encodes the specified VmwareNodeAllocation message, length delimited. Does not implicitly {@link google.cloud.migrationcenter.v1.ReportSummary.VmwareNodeAllocation.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.migrationcenter.v1.ReportSummary.VmwareNodeAllocation + * @static + * @param {google.cloud.migrationcenter.v1.ReportSummary.IVmwareNodeAllocation} message VmwareNodeAllocation message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + VmwareNodeAllocation.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a VmwareNodeAllocation message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.migrationcenter.v1.ReportSummary.VmwareNodeAllocation + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.migrationcenter.v1.ReportSummary.VmwareNodeAllocation} VmwareNodeAllocation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + VmwareNodeAllocation.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.migrationcenter.v1.ReportSummary.VmwareNodeAllocation(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.vmwareNode = $root.google.cloud.migrationcenter.v1.ReportSummary.VmwareNode.decode(reader, reader.uint32()); + break; + } + case 2: { + message.nodeCount = reader.int64(); + break; + } + case 3: { + message.allocatedAssetCount = reader.int64(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a VmwareNodeAllocation message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.migrationcenter.v1.ReportSummary.VmwareNodeAllocation + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.migrationcenter.v1.ReportSummary.VmwareNodeAllocation} VmwareNodeAllocation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + VmwareNodeAllocation.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; /** - * AssetAggregateStats totalCores. - * @member {number|Long} totalCores - * @memberof google.cloud.migrationcenter.v1.ReportSummary.AssetAggregateStats - * @instance + * Verifies a VmwareNodeAllocation message. + * @function verify + * @memberof google.cloud.migrationcenter.v1.ReportSummary.VmwareNodeAllocation + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - AssetAggregateStats.prototype.totalCores = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + VmwareNodeAllocation.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.vmwareNode != null && message.hasOwnProperty("vmwareNode")) { + var error = $root.google.cloud.migrationcenter.v1.ReportSummary.VmwareNode.verify(message.vmwareNode); + if (error) + return "vmwareNode." + error; + } + if (message.nodeCount != null && message.hasOwnProperty("nodeCount")) + if (!$util.isInteger(message.nodeCount) && !(message.nodeCount && $util.isInteger(message.nodeCount.low) && $util.isInteger(message.nodeCount.high))) + return "nodeCount: integer|Long expected"; + if (message.allocatedAssetCount != null && message.hasOwnProperty("allocatedAssetCount")) + if (!$util.isInteger(message.allocatedAssetCount) && !(message.allocatedAssetCount && $util.isInteger(message.allocatedAssetCount.low) && $util.isInteger(message.allocatedAssetCount.high))) + return "allocatedAssetCount: integer|Long expected"; + return null; + }; /** - * AssetAggregateStats totalAssets. - * @member {number|Long} totalAssets - * @memberof google.cloud.migrationcenter.v1.ReportSummary.AssetAggregateStats - * @instance + * Creates a VmwareNodeAllocation message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.migrationcenter.v1.ReportSummary.VmwareNodeAllocation + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.migrationcenter.v1.ReportSummary.VmwareNodeAllocation} VmwareNodeAllocation */ - AssetAggregateStats.prototype.totalAssets = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + VmwareNodeAllocation.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.migrationcenter.v1.ReportSummary.VmwareNodeAllocation) + return object; + var message = new $root.google.cloud.migrationcenter.v1.ReportSummary.VmwareNodeAllocation(); + if (object.vmwareNode != null) { + if (typeof object.vmwareNode !== "object") + throw TypeError(".google.cloud.migrationcenter.v1.ReportSummary.VmwareNodeAllocation.vmwareNode: object expected"); + message.vmwareNode = $root.google.cloud.migrationcenter.v1.ReportSummary.VmwareNode.fromObject(object.vmwareNode); + } + if (object.nodeCount != null) + if ($util.Long) + (message.nodeCount = $util.Long.fromValue(object.nodeCount)).unsigned = false; + else if (typeof object.nodeCount === "string") + message.nodeCount = parseInt(object.nodeCount, 10); + else if (typeof object.nodeCount === "number") + message.nodeCount = object.nodeCount; + else if (typeof object.nodeCount === "object") + message.nodeCount = new $util.LongBits(object.nodeCount.low >>> 0, object.nodeCount.high >>> 0).toNumber(); + if (object.allocatedAssetCount != null) + if ($util.Long) + (message.allocatedAssetCount = $util.Long.fromValue(object.allocatedAssetCount)).unsigned = false; + else if (typeof object.allocatedAssetCount === "string") + message.allocatedAssetCount = parseInt(object.allocatedAssetCount, 10); + else if (typeof object.allocatedAssetCount === "number") + message.allocatedAssetCount = object.allocatedAssetCount; + else if (typeof object.allocatedAssetCount === "object") + message.allocatedAssetCount = new $util.LongBits(object.allocatedAssetCount.low >>> 0, object.allocatedAssetCount.high >>> 0).toNumber(); + return message; + }; /** - * AssetAggregateStats memoryUtilizationChart. - * @member {google.cloud.migrationcenter.v1.ReportSummary.IUtilizationChartData|null|undefined} memoryUtilizationChart - * @memberof google.cloud.migrationcenter.v1.ReportSummary.AssetAggregateStats - * @instance + * Creates a plain object from a VmwareNodeAllocation message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.migrationcenter.v1.ReportSummary.VmwareNodeAllocation + * @static + * @param {google.cloud.migrationcenter.v1.ReportSummary.VmwareNodeAllocation} message VmwareNodeAllocation + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object */ - AssetAggregateStats.prototype.memoryUtilizationChart = null; + VmwareNodeAllocation.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.vmwareNode = null; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.nodeCount = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.nodeCount = options.longs === String ? "0" : 0; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.allocatedAssetCount = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.allocatedAssetCount = options.longs === String ? "0" : 0; + } + if (message.vmwareNode != null && message.hasOwnProperty("vmwareNode")) + object.vmwareNode = $root.google.cloud.migrationcenter.v1.ReportSummary.VmwareNode.toObject(message.vmwareNode, options); + if (message.nodeCount != null && message.hasOwnProperty("nodeCount")) + if (typeof message.nodeCount === "number") + object.nodeCount = options.longs === String ? String(message.nodeCount) : message.nodeCount; + else + object.nodeCount = options.longs === String ? $util.Long.prototype.toString.call(message.nodeCount) : options.longs === Number ? new $util.LongBits(message.nodeCount.low >>> 0, message.nodeCount.high >>> 0).toNumber() : message.nodeCount; + if (message.allocatedAssetCount != null && message.hasOwnProperty("allocatedAssetCount")) + if (typeof message.allocatedAssetCount === "number") + object.allocatedAssetCount = options.longs === String ? String(message.allocatedAssetCount) : message.allocatedAssetCount; + else + object.allocatedAssetCount = options.longs === String ? $util.Long.prototype.toString.call(message.allocatedAssetCount) : options.longs === Number ? new $util.LongBits(message.allocatedAssetCount.low >>> 0, message.allocatedAssetCount.high >>> 0).toNumber() : message.allocatedAssetCount; + return object; + }; /** - * AssetAggregateStats storageUtilizationChart. - * @member {google.cloud.migrationcenter.v1.ReportSummary.IUtilizationChartData|null|undefined} storageUtilizationChart - * @memberof google.cloud.migrationcenter.v1.ReportSummary.AssetAggregateStats + * Converts this VmwareNodeAllocation to JSON. + * @function toJSON + * @memberof google.cloud.migrationcenter.v1.ReportSummary.VmwareNodeAllocation * @instance + * @returns {Object.} JSON object */ - AssetAggregateStats.prototype.storageUtilizationChart = null; + VmwareNodeAllocation.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; /** - * AssetAggregateStats operatingSystem. - * @member {google.cloud.migrationcenter.v1.ReportSummary.IChartData|null|undefined} operatingSystem - * @memberof google.cloud.migrationcenter.v1.ReportSummary.AssetAggregateStats - * @instance + * Gets the default type url for VmwareNodeAllocation + * @function getTypeUrl + * @memberof google.cloud.migrationcenter.v1.ReportSummary.VmwareNodeAllocation + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url */ - AssetAggregateStats.prototype.operatingSystem = null; + VmwareNodeAllocation.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.migrationcenter.v1.ReportSummary.VmwareNodeAllocation"; + }; + + return VmwareNodeAllocation; + })(); + + ReportSummary.VmwareNode = (function() { /** - * AssetAggregateStats coreCountHistogram. - * @member {google.cloud.migrationcenter.v1.ReportSummary.IHistogramChartData|null|undefined} coreCountHistogram - * @memberof google.cloud.migrationcenter.v1.ReportSummary.AssetAggregateStats - * @instance + * Properties of a VmwareNode. + * @memberof google.cloud.migrationcenter.v1.ReportSummary + * @interface IVmwareNode + * @property {string|null} [code] VmwareNode code */ - AssetAggregateStats.prototype.coreCountHistogram = null; /** - * AssetAggregateStats memoryBytesHistogram. - * @member {google.cloud.migrationcenter.v1.ReportSummary.IHistogramChartData|null|undefined} memoryBytesHistogram - * @memberof google.cloud.migrationcenter.v1.ReportSummary.AssetAggregateStats - * @instance + * Constructs a new VmwareNode. + * @memberof google.cloud.migrationcenter.v1.ReportSummary + * @classdesc Represents a VmwareNode. + * @implements IVmwareNode + * @constructor + * @param {google.cloud.migrationcenter.v1.ReportSummary.IVmwareNode=} [properties] Properties to set */ - AssetAggregateStats.prototype.memoryBytesHistogram = null; + function VmwareNode(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } /** - * AssetAggregateStats storageBytesHistogram. - * @member {google.cloud.migrationcenter.v1.ReportSummary.IHistogramChartData|null|undefined} storageBytesHistogram - * @memberof google.cloud.migrationcenter.v1.ReportSummary.AssetAggregateStats + * VmwareNode code. + * @member {string} code + * @memberof google.cloud.migrationcenter.v1.ReportSummary.VmwareNode * @instance */ - AssetAggregateStats.prototype.storageBytesHistogram = null; + VmwareNode.prototype.code = ""; /** - * Creates a new AssetAggregateStats instance using the specified properties. + * Creates a new VmwareNode instance using the specified properties. * @function create - * @memberof google.cloud.migrationcenter.v1.ReportSummary.AssetAggregateStats + * @memberof google.cloud.migrationcenter.v1.ReportSummary.VmwareNode * @static - * @param {google.cloud.migrationcenter.v1.ReportSummary.IAssetAggregateStats=} [properties] Properties to set - * @returns {google.cloud.migrationcenter.v1.ReportSummary.AssetAggregateStats} AssetAggregateStats instance + * @param {google.cloud.migrationcenter.v1.ReportSummary.IVmwareNode=} [properties] Properties to set + * @returns {google.cloud.migrationcenter.v1.ReportSummary.VmwareNode} VmwareNode instance */ - AssetAggregateStats.create = function create(properties) { - return new AssetAggregateStats(properties); + VmwareNode.create = function create(properties) { + return new VmwareNode(properties); }; /** - * Encodes the specified AssetAggregateStats message. Does not implicitly {@link google.cloud.migrationcenter.v1.ReportSummary.AssetAggregateStats.verify|verify} messages. + * Encodes the specified VmwareNode message. Does not implicitly {@link google.cloud.migrationcenter.v1.ReportSummary.VmwareNode.verify|verify} messages. * @function encode - * @memberof google.cloud.migrationcenter.v1.ReportSummary.AssetAggregateStats + * @memberof google.cloud.migrationcenter.v1.ReportSummary.VmwareNode * @static - * @param {google.cloud.migrationcenter.v1.ReportSummary.IAssetAggregateStats} message AssetAggregateStats message or plain object to encode + * @param {google.cloud.migrationcenter.v1.ReportSummary.IVmwareNode} message VmwareNode message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - AssetAggregateStats.encode = function encode(message, writer) { + VmwareNode.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.totalMemoryBytes != null && Object.hasOwnProperty.call(message, "totalMemoryBytes")) - writer.uint32(/* id 1, wireType 0 =*/8).int64(message.totalMemoryBytes); - if (message.totalStorageBytes != null && Object.hasOwnProperty.call(message, "totalStorageBytes")) - writer.uint32(/* id 2, wireType 0 =*/16).int64(message.totalStorageBytes); - if (message.totalCores != null && Object.hasOwnProperty.call(message, "totalCores")) - writer.uint32(/* id 3, wireType 0 =*/24).int64(message.totalCores); - if (message.totalAssets != null && Object.hasOwnProperty.call(message, "totalAssets")) - writer.uint32(/* id 4, wireType 0 =*/32).int64(message.totalAssets); - if (message.memoryUtilizationChart != null && Object.hasOwnProperty.call(message, "memoryUtilizationChart")) - $root.google.cloud.migrationcenter.v1.ReportSummary.UtilizationChartData.encode(message.memoryUtilizationChart, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); - if (message.storageUtilizationChart != null && Object.hasOwnProperty.call(message, "storageUtilizationChart")) - $root.google.cloud.migrationcenter.v1.ReportSummary.UtilizationChartData.encode(message.storageUtilizationChart, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); - if (message.operatingSystem != null && Object.hasOwnProperty.call(message, "operatingSystem")) - $root.google.cloud.migrationcenter.v1.ReportSummary.ChartData.encode(message.operatingSystem, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); - if (message.coreCountHistogram != null && Object.hasOwnProperty.call(message, "coreCountHistogram")) - $root.google.cloud.migrationcenter.v1.ReportSummary.HistogramChartData.encode(message.coreCountHistogram, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); - if (message.memoryBytesHistogram != null && Object.hasOwnProperty.call(message, "memoryBytesHistogram")) - $root.google.cloud.migrationcenter.v1.ReportSummary.HistogramChartData.encode(message.memoryBytesHistogram, writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim(); - if (message.storageBytesHistogram != null && Object.hasOwnProperty.call(message, "storageBytesHistogram")) - $root.google.cloud.migrationcenter.v1.ReportSummary.HistogramChartData.encode(message.storageBytesHistogram, writer.uint32(/* id 10, wireType 2 =*/82).fork()).ldelim(); + if (message.code != null && Object.hasOwnProperty.call(message, "code")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.code); return writer; }; /** - * Encodes the specified AssetAggregateStats message, length delimited. Does not implicitly {@link google.cloud.migrationcenter.v1.ReportSummary.AssetAggregateStats.verify|verify} messages. + * Encodes the specified VmwareNode message, length delimited. Does not implicitly {@link google.cloud.migrationcenter.v1.ReportSummary.VmwareNode.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.migrationcenter.v1.ReportSummary.AssetAggregateStats + * @memberof google.cloud.migrationcenter.v1.ReportSummary.VmwareNode * @static - * @param {google.cloud.migrationcenter.v1.ReportSummary.IAssetAggregateStats} message AssetAggregateStats message or plain object to encode + * @param {google.cloud.migrationcenter.v1.ReportSummary.IVmwareNode} message VmwareNode message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - AssetAggregateStats.encodeDelimited = function encodeDelimited(message, writer) { + VmwareNode.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes an AssetAggregateStats message from the specified reader or buffer. + * Decodes a VmwareNode message from the specified reader or buffer. * @function decode - * @memberof google.cloud.migrationcenter.v1.ReportSummary.AssetAggregateStats + * @memberof google.cloud.migrationcenter.v1.ReportSummary.VmwareNode * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.migrationcenter.v1.ReportSummary.AssetAggregateStats} AssetAggregateStats + * @returns {google.cloud.migrationcenter.v1.ReportSummary.VmwareNode} VmwareNode * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - AssetAggregateStats.decode = function decode(reader, length) { + VmwareNode.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.migrationcenter.v1.ReportSummary.AssetAggregateStats(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.migrationcenter.v1.ReportSummary.VmwareNode(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: { - message.totalMemoryBytes = reader.int64(); - break; - } - case 2: { - message.totalStorageBytes = reader.int64(); - break; - } - case 3: { - message.totalCores = reader.int64(); - break; - } - case 4: { - message.totalAssets = reader.int64(); - break; - } - case 5: { - message.memoryUtilizationChart = $root.google.cloud.migrationcenter.v1.ReportSummary.UtilizationChartData.decode(reader, reader.uint32()); - break; - } - case 6: { - message.storageUtilizationChart = $root.google.cloud.migrationcenter.v1.ReportSummary.UtilizationChartData.decode(reader, reader.uint32()); - break; - } - case 7: { - message.operatingSystem = $root.google.cloud.migrationcenter.v1.ReportSummary.ChartData.decode(reader, reader.uint32()); - break; - } - case 8: { - message.coreCountHistogram = $root.google.cloud.migrationcenter.v1.ReportSummary.HistogramChartData.decode(reader, reader.uint32()); - break; - } - case 9: { - message.memoryBytesHistogram = $root.google.cloud.migrationcenter.v1.ReportSummary.HistogramChartData.decode(reader, reader.uint32()); - break; - } - case 10: { - message.storageBytesHistogram = $root.google.cloud.migrationcenter.v1.ReportSummary.HistogramChartData.decode(reader, reader.uint32()); + message.code = reader.string(); break; } default: @@ -46739,282 +49961,126 @@ }; /** - * Decodes an AssetAggregateStats message from the specified reader or buffer, length delimited. + * Decodes a VmwareNode message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.migrationcenter.v1.ReportSummary.AssetAggregateStats + * @memberof google.cloud.migrationcenter.v1.ReportSummary.VmwareNode * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.migrationcenter.v1.ReportSummary.AssetAggregateStats} AssetAggregateStats + * @returns {google.cloud.migrationcenter.v1.ReportSummary.VmwareNode} VmwareNode * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - AssetAggregateStats.decodeDelimited = function decodeDelimited(reader) { + VmwareNode.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an AssetAggregateStats message. - * @function verify - * @memberof google.cloud.migrationcenter.v1.ReportSummary.AssetAggregateStats - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - AssetAggregateStats.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.totalMemoryBytes != null && message.hasOwnProperty("totalMemoryBytes")) - if (!$util.isInteger(message.totalMemoryBytes) && !(message.totalMemoryBytes && $util.isInteger(message.totalMemoryBytes.low) && $util.isInteger(message.totalMemoryBytes.high))) - return "totalMemoryBytes: integer|Long expected"; - if (message.totalStorageBytes != null && message.hasOwnProperty("totalStorageBytes")) - if (!$util.isInteger(message.totalStorageBytes) && !(message.totalStorageBytes && $util.isInteger(message.totalStorageBytes.low) && $util.isInteger(message.totalStorageBytes.high))) - return "totalStorageBytes: integer|Long expected"; - if (message.totalCores != null && message.hasOwnProperty("totalCores")) - if (!$util.isInteger(message.totalCores) && !(message.totalCores && $util.isInteger(message.totalCores.low) && $util.isInteger(message.totalCores.high))) - return "totalCores: integer|Long expected"; - if (message.totalAssets != null && message.hasOwnProperty("totalAssets")) - if (!$util.isInteger(message.totalAssets) && !(message.totalAssets && $util.isInteger(message.totalAssets.low) && $util.isInteger(message.totalAssets.high))) - return "totalAssets: integer|Long expected"; - if (message.memoryUtilizationChart != null && message.hasOwnProperty("memoryUtilizationChart")) { - var error = $root.google.cloud.migrationcenter.v1.ReportSummary.UtilizationChartData.verify(message.memoryUtilizationChart); - if (error) - return "memoryUtilizationChart." + error; - } - if (message.storageUtilizationChart != null && message.hasOwnProperty("storageUtilizationChart")) { - var error = $root.google.cloud.migrationcenter.v1.ReportSummary.UtilizationChartData.verify(message.storageUtilizationChart); - if (error) - return "storageUtilizationChart." + error; - } - if (message.operatingSystem != null && message.hasOwnProperty("operatingSystem")) { - var error = $root.google.cloud.migrationcenter.v1.ReportSummary.ChartData.verify(message.operatingSystem); - if (error) - return "operatingSystem." + error; - } - if (message.coreCountHistogram != null && message.hasOwnProperty("coreCountHistogram")) { - var error = $root.google.cloud.migrationcenter.v1.ReportSummary.HistogramChartData.verify(message.coreCountHistogram); - if (error) - return "coreCountHistogram." + error; - } - if (message.memoryBytesHistogram != null && message.hasOwnProperty("memoryBytesHistogram")) { - var error = $root.google.cloud.migrationcenter.v1.ReportSummary.HistogramChartData.verify(message.memoryBytesHistogram); - if (error) - return "memoryBytesHistogram." + error; - } - if (message.storageBytesHistogram != null && message.hasOwnProperty("storageBytesHistogram")) { - var error = $root.google.cloud.migrationcenter.v1.ReportSummary.HistogramChartData.verify(message.storageBytesHistogram); - if (error) - return "storageBytesHistogram." + error; - } + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a VmwareNode message. + * @function verify + * @memberof google.cloud.migrationcenter.v1.ReportSummary.VmwareNode + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + VmwareNode.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.code != null && message.hasOwnProperty("code")) + if (!$util.isString(message.code)) + return "code: string expected"; return null; }; /** - * Creates an AssetAggregateStats message from a plain object. Also converts values to their respective internal types. + * Creates a VmwareNode message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.migrationcenter.v1.ReportSummary.AssetAggregateStats + * @memberof google.cloud.migrationcenter.v1.ReportSummary.VmwareNode * @static * @param {Object.} object Plain object - * @returns {google.cloud.migrationcenter.v1.ReportSummary.AssetAggregateStats} AssetAggregateStats + * @returns {google.cloud.migrationcenter.v1.ReportSummary.VmwareNode} VmwareNode */ - AssetAggregateStats.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.migrationcenter.v1.ReportSummary.AssetAggregateStats) + VmwareNode.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.migrationcenter.v1.ReportSummary.VmwareNode) return object; - var message = new $root.google.cloud.migrationcenter.v1.ReportSummary.AssetAggregateStats(); - if (object.totalMemoryBytes != null) - if ($util.Long) - (message.totalMemoryBytes = $util.Long.fromValue(object.totalMemoryBytes)).unsigned = false; - else if (typeof object.totalMemoryBytes === "string") - message.totalMemoryBytes = parseInt(object.totalMemoryBytes, 10); - else if (typeof object.totalMemoryBytes === "number") - message.totalMemoryBytes = object.totalMemoryBytes; - else if (typeof object.totalMemoryBytes === "object") - message.totalMemoryBytes = new $util.LongBits(object.totalMemoryBytes.low >>> 0, object.totalMemoryBytes.high >>> 0).toNumber(); - if (object.totalStorageBytes != null) - if ($util.Long) - (message.totalStorageBytes = $util.Long.fromValue(object.totalStorageBytes)).unsigned = false; - else if (typeof object.totalStorageBytes === "string") - message.totalStorageBytes = parseInt(object.totalStorageBytes, 10); - else if (typeof object.totalStorageBytes === "number") - message.totalStorageBytes = object.totalStorageBytes; - else if (typeof object.totalStorageBytes === "object") - message.totalStorageBytes = new $util.LongBits(object.totalStorageBytes.low >>> 0, object.totalStorageBytes.high >>> 0).toNumber(); - if (object.totalCores != null) - if ($util.Long) - (message.totalCores = $util.Long.fromValue(object.totalCores)).unsigned = false; - else if (typeof object.totalCores === "string") - message.totalCores = parseInt(object.totalCores, 10); - else if (typeof object.totalCores === "number") - message.totalCores = object.totalCores; - else if (typeof object.totalCores === "object") - message.totalCores = new $util.LongBits(object.totalCores.low >>> 0, object.totalCores.high >>> 0).toNumber(); - if (object.totalAssets != null) - if ($util.Long) - (message.totalAssets = $util.Long.fromValue(object.totalAssets)).unsigned = false; - else if (typeof object.totalAssets === "string") - message.totalAssets = parseInt(object.totalAssets, 10); - else if (typeof object.totalAssets === "number") - message.totalAssets = object.totalAssets; - else if (typeof object.totalAssets === "object") - message.totalAssets = new $util.LongBits(object.totalAssets.low >>> 0, object.totalAssets.high >>> 0).toNumber(); - if (object.memoryUtilizationChart != null) { - if (typeof object.memoryUtilizationChart !== "object") - throw TypeError(".google.cloud.migrationcenter.v1.ReportSummary.AssetAggregateStats.memoryUtilizationChart: object expected"); - message.memoryUtilizationChart = $root.google.cloud.migrationcenter.v1.ReportSummary.UtilizationChartData.fromObject(object.memoryUtilizationChart); - } - if (object.storageUtilizationChart != null) { - if (typeof object.storageUtilizationChart !== "object") - throw TypeError(".google.cloud.migrationcenter.v1.ReportSummary.AssetAggregateStats.storageUtilizationChart: object expected"); - message.storageUtilizationChart = $root.google.cloud.migrationcenter.v1.ReportSummary.UtilizationChartData.fromObject(object.storageUtilizationChart); - } - if (object.operatingSystem != null) { - if (typeof object.operatingSystem !== "object") - throw TypeError(".google.cloud.migrationcenter.v1.ReportSummary.AssetAggregateStats.operatingSystem: object expected"); - message.operatingSystem = $root.google.cloud.migrationcenter.v1.ReportSummary.ChartData.fromObject(object.operatingSystem); - } - if (object.coreCountHistogram != null) { - if (typeof object.coreCountHistogram !== "object") - throw TypeError(".google.cloud.migrationcenter.v1.ReportSummary.AssetAggregateStats.coreCountHistogram: object expected"); - message.coreCountHistogram = $root.google.cloud.migrationcenter.v1.ReportSummary.HistogramChartData.fromObject(object.coreCountHistogram); - } - if (object.memoryBytesHistogram != null) { - if (typeof object.memoryBytesHistogram !== "object") - throw TypeError(".google.cloud.migrationcenter.v1.ReportSummary.AssetAggregateStats.memoryBytesHistogram: object expected"); - message.memoryBytesHistogram = $root.google.cloud.migrationcenter.v1.ReportSummary.HistogramChartData.fromObject(object.memoryBytesHistogram); - } - if (object.storageBytesHistogram != null) { - if (typeof object.storageBytesHistogram !== "object") - throw TypeError(".google.cloud.migrationcenter.v1.ReportSummary.AssetAggregateStats.storageBytesHistogram: object expected"); - message.storageBytesHistogram = $root.google.cloud.migrationcenter.v1.ReportSummary.HistogramChartData.fromObject(object.storageBytesHistogram); - } + var message = new $root.google.cloud.migrationcenter.v1.ReportSummary.VmwareNode(); + if (object.code != null) + message.code = String(object.code); return message; }; /** - * Creates a plain object from an AssetAggregateStats message. Also converts values to other types if specified. + * Creates a plain object from a VmwareNode message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.migrationcenter.v1.ReportSummary.AssetAggregateStats + * @memberof google.cloud.migrationcenter.v1.ReportSummary.VmwareNode * @static - * @param {google.cloud.migrationcenter.v1.ReportSummary.AssetAggregateStats} message AssetAggregateStats + * @param {google.cloud.migrationcenter.v1.ReportSummary.VmwareNode} message VmwareNode * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - AssetAggregateStats.toObject = function toObject(message, options) { + VmwareNode.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.totalMemoryBytes = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.totalMemoryBytes = options.longs === String ? "0" : 0; - if ($util.Long) { - var long = new $util.Long(0, 0, false); - object.totalStorageBytes = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.totalStorageBytes = options.longs === String ? "0" : 0; - if ($util.Long) { - var long = new $util.Long(0, 0, false); - object.totalCores = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.totalCores = options.longs === String ? "0" : 0; - if ($util.Long) { - var long = new $util.Long(0, 0, false); - object.totalAssets = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.totalAssets = options.longs === String ? "0" : 0; - object.memoryUtilizationChart = null; - object.storageUtilizationChart = null; - object.operatingSystem = null; - object.coreCountHistogram = null; - object.memoryBytesHistogram = null; - object.storageBytesHistogram = null; - } - if (message.totalMemoryBytes != null && message.hasOwnProperty("totalMemoryBytes")) - if (typeof message.totalMemoryBytes === "number") - object.totalMemoryBytes = options.longs === String ? String(message.totalMemoryBytes) : message.totalMemoryBytes; - else - object.totalMemoryBytes = options.longs === String ? $util.Long.prototype.toString.call(message.totalMemoryBytes) : options.longs === Number ? new $util.LongBits(message.totalMemoryBytes.low >>> 0, message.totalMemoryBytes.high >>> 0).toNumber() : message.totalMemoryBytes; - if (message.totalStorageBytes != null && message.hasOwnProperty("totalStorageBytes")) - if (typeof message.totalStorageBytes === "number") - object.totalStorageBytes = options.longs === String ? String(message.totalStorageBytes) : message.totalStorageBytes; - else - object.totalStorageBytes = options.longs === String ? $util.Long.prototype.toString.call(message.totalStorageBytes) : options.longs === Number ? new $util.LongBits(message.totalStorageBytes.low >>> 0, message.totalStorageBytes.high >>> 0).toNumber() : message.totalStorageBytes; - if (message.totalCores != null && message.hasOwnProperty("totalCores")) - if (typeof message.totalCores === "number") - object.totalCores = options.longs === String ? String(message.totalCores) : message.totalCores; - else - object.totalCores = options.longs === String ? $util.Long.prototype.toString.call(message.totalCores) : options.longs === Number ? new $util.LongBits(message.totalCores.low >>> 0, message.totalCores.high >>> 0).toNumber() : message.totalCores; - if (message.totalAssets != null && message.hasOwnProperty("totalAssets")) - if (typeof message.totalAssets === "number") - object.totalAssets = options.longs === String ? String(message.totalAssets) : message.totalAssets; - else - object.totalAssets = options.longs === String ? $util.Long.prototype.toString.call(message.totalAssets) : options.longs === Number ? new $util.LongBits(message.totalAssets.low >>> 0, message.totalAssets.high >>> 0).toNumber() : message.totalAssets; - if (message.memoryUtilizationChart != null && message.hasOwnProperty("memoryUtilizationChart")) - object.memoryUtilizationChart = $root.google.cloud.migrationcenter.v1.ReportSummary.UtilizationChartData.toObject(message.memoryUtilizationChart, options); - if (message.storageUtilizationChart != null && message.hasOwnProperty("storageUtilizationChart")) - object.storageUtilizationChart = $root.google.cloud.migrationcenter.v1.ReportSummary.UtilizationChartData.toObject(message.storageUtilizationChart, options); - if (message.operatingSystem != null && message.hasOwnProperty("operatingSystem")) - object.operatingSystem = $root.google.cloud.migrationcenter.v1.ReportSummary.ChartData.toObject(message.operatingSystem, options); - if (message.coreCountHistogram != null && message.hasOwnProperty("coreCountHistogram")) - object.coreCountHistogram = $root.google.cloud.migrationcenter.v1.ReportSummary.HistogramChartData.toObject(message.coreCountHistogram, options); - if (message.memoryBytesHistogram != null && message.hasOwnProperty("memoryBytesHistogram")) - object.memoryBytesHistogram = $root.google.cloud.migrationcenter.v1.ReportSummary.HistogramChartData.toObject(message.memoryBytesHistogram, options); - if (message.storageBytesHistogram != null && message.hasOwnProperty("storageBytesHistogram")) - object.storageBytesHistogram = $root.google.cloud.migrationcenter.v1.ReportSummary.HistogramChartData.toObject(message.storageBytesHistogram, options); + if (options.defaults) + object.code = ""; + if (message.code != null && message.hasOwnProperty("code")) + object.code = message.code; return object; }; /** - * Converts this AssetAggregateStats to JSON. + * Converts this VmwareNode to JSON. * @function toJSON - * @memberof google.cloud.migrationcenter.v1.ReportSummary.AssetAggregateStats + * @memberof google.cloud.migrationcenter.v1.ReportSummary.VmwareNode * @instance * @returns {Object.} JSON object */ - AssetAggregateStats.prototype.toJSON = function toJSON() { + VmwareNode.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for AssetAggregateStats + * Gets the default type url for VmwareNode * @function getTypeUrl - * @memberof google.cloud.migrationcenter.v1.ReportSummary.AssetAggregateStats + * @memberof google.cloud.migrationcenter.v1.ReportSummary.VmwareNode * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - AssetAggregateStats.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + VmwareNode.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.cloud.migrationcenter.v1.ReportSummary.AssetAggregateStats"; + return typeUrlPrefix + "/google.cloud.migrationcenter.v1.ReportSummary.VmwareNode"; }; - return AssetAggregateStats; + return VmwareNode; })(); - ReportSummary.MachineSeriesAllocation = (function() { + ReportSummary.SoleTenantFinding = (function() { /** - * Properties of a MachineSeriesAllocation. + * Properties of a SoleTenantFinding. * @memberof google.cloud.migrationcenter.v1.ReportSummary - * @interface IMachineSeriesAllocation - * @property {google.cloud.migrationcenter.v1.IMachineSeries|null} [machineSeries] MachineSeriesAllocation machineSeries - * @property {number|Long|null} [allocatedAssetCount] MachineSeriesAllocation allocatedAssetCount + * @interface ISoleTenantFinding + * @property {Array.|null} [allocatedRegions] SoleTenantFinding allocatedRegions + * @property {number|Long|null} [allocatedAssetCount] SoleTenantFinding allocatedAssetCount + * @property {Array.|null} [nodeAllocations] SoleTenantFinding nodeAllocations */ /** - * Constructs a new MachineSeriesAllocation. + * Constructs a new SoleTenantFinding. * @memberof google.cloud.migrationcenter.v1.ReportSummary - * @classdesc Represents a MachineSeriesAllocation. - * @implements IMachineSeriesAllocation + * @classdesc Represents a SoleTenantFinding. + * @implements ISoleTenantFinding * @constructor - * @param {google.cloud.migrationcenter.v1.ReportSummary.IMachineSeriesAllocation=} [properties] Properties to set + * @param {google.cloud.migrationcenter.v1.ReportSummary.ISoleTenantFinding=} [properties] Properties to set */ - function MachineSeriesAllocation(properties) { + function SoleTenantFinding(properties) { + this.allocatedRegions = []; + this.nodeAllocations = []; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -47022,91 +50088,111 @@ } /** - * MachineSeriesAllocation machineSeries. - * @member {google.cloud.migrationcenter.v1.IMachineSeries|null|undefined} machineSeries - * @memberof google.cloud.migrationcenter.v1.ReportSummary.MachineSeriesAllocation + * SoleTenantFinding allocatedRegions. + * @member {Array.} allocatedRegions + * @memberof google.cloud.migrationcenter.v1.ReportSummary.SoleTenantFinding * @instance */ - MachineSeriesAllocation.prototype.machineSeries = null; + SoleTenantFinding.prototype.allocatedRegions = $util.emptyArray; /** - * MachineSeriesAllocation allocatedAssetCount. + * SoleTenantFinding allocatedAssetCount. * @member {number|Long} allocatedAssetCount - * @memberof google.cloud.migrationcenter.v1.ReportSummary.MachineSeriesAllocation + * @memberof google.cloud.migrationcenter.v1.ReportSummary.SoleTenantFinding * @instance */ - MachineSeriesAllocation.prototype.allocatedAssetCount = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + SoleTenantFinding.prototype.allocatedAssetCount = $util.Long ? $util.Long.fromBits(0,0,false) : 0; /** - * Creates a new MachineSeriesAllocation instance using the specified properties. + * SoleTenantFinding nodeAllocations. + * @member {Array.} nodeAllocations + * @memberof google.cloud.migrationcenter.v1.ReportSummary.SoleTenantFinding + * @instance + */ + SoleTenantFinding.prototype.nodeAllocations = $util.emptyArray; + + /** + * Creates a new SoleTenantFinding instance using the specified properties. * @function create - * @memberof google.cloud.migrationcenter.v1.ReportSummary.MachineSeriesAllocation + * @memberof google.cloud.migrationcenter.v1.ReportSummary.SoleTenantFinding * @static - * @param {google.cloud.migrationcenter.v1.ReportSummary.IMachineSeriesAllocation=} [properties] Properties to set - * @returns {google.cloud.migrationcenter.v1.ReportSummary.MachineSeriesAllocation} MachineSeriesAllocation instance + * @param {google.cloud.migrationcenter.v1.ReportSummary.ISoleTenantFinding=} [properties] Properties to set + * @returns {google.cloud.migrationcenter.v1.ReportSummary.SoleTenantFinding} SoleTenantFinding instance */ - MachineSeriesAllocation.create = function create(properties) { - return new MachineSeriesAllocation(properties); + SoleTenantFinding.create = function create(properties) { + return new SoleTenantFinding(properties); }; /** - * Encodes the specified MachineSeriesAllocation message. Does not implicitly {@link google.cloud.migrationcenter.v1.ReportSummary.MachineSeriesAllocation.verify|verify} messages. + * Encodes the specified SoleTenantFinding message. Does not implicitly {@link google.cloud.migrationcenter.v1.ReportSummary.SoleTenantFinding.verify|verify} messages. * @function encode - * @memberof google.cloud.migrationcenter.v1.ReportSummary.MachineSeriesAllocation + * @memberof google.cloud.migrationcenter.v1.ReportSummary.SoleTenantFinding * @static - * @param {google.cloud.migrationcenter.v1.ReportSummary.IMachineSeriesAllocation} message MachineSeriesAllocation message or plain object to encode + * @param {google.cloud.migrationcenter.v1.ReportSummary.ISoleTenantFinding} message SoleTenantFinding message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - MachineSeriesAllocation.encode = function encode(message, writer) { + SoleTenantFinding.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.machineSeries != null && Object.hasOwnProperty.call(message, "machineSeries")) - $root.google.cloud.migrationcenter.v1.MachineSeries.encode(message.machineSeries, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.allocatedRegions != null && message.allocatedRegions.length) + for (var i = 0; i < message.allocatedRegions.length; ++i) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.allocatedRegions[i]); if (message.allocatedAssetCount != null && Object.hasOwnProperty.call(message, "allocatedAssetCount")) writer.uint32(/* id 2, wireType 0 =*/16).int64(message.allocatedAssetCount); + if (message.nodeAllocations != null && message.nodeAllocations.length) + for (var i = 0; i < message.nodeAllocations.length; ++i) + $root.google.cloud.migrationcenter.v1.ReportSummary.SoleTenantNodeAllocation.encode(message.nodeAllocations[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); return writer; }; /** - * Encodes the specified MachineSeriesAllocation message, length delimited. Does not implicitly {@link google.cloud.migrationcenter.v1.ReportSummary.MachineSeriesAllocation.verify|verify} messages. + * Encodes the specified SoleTenantFinding message, length delimited. Does not implicitly {@link google.cloud.migrationcenter.v1.ReportSummary.SoleTenantFinding.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.migrationcenter.v1.ReportSummary.MachineSeriesAllocation + * @memberof google.cloud.migrationcenter.v1.ReportSummary.SoleTenantFinding * @static - * @param {google.cloud.migrationcenter.v1.ReportSummary.IMachineSeriesAllocation} message MachineSeriesAllocation message or plain object to encode + * @param {google.cloud.migrationcenter.v1.ReportSummary.ISoleTenantFinding} message SoleTenantFinding message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - MachineSeriesAllocation.encodeDelimited = function encodeDelimited(message, writer) { + SoleTenantFinding.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a MachineSeriesAllocation message from the specified reader or buffer. + * Decodes a SoleTenantFinding message from the specified reader or buffer. * @function decode - * @memberof google.cloud.migrationcenter.v1.ReportSummary.MachineSeriesAllocation + * @memberof google.cloud.migrationcenter.v1.ReportSummary.SoleTenantFinding * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.migrationcenter.v1.ReportSummary.MachineSeriesAllocation} MachineSeriesAllocation + * @returns {google.cloud.migrationcenter.v1.ReportSummary.SoleTenantFinding} SoleTenantFinding * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - MachineSeriesAllocation.decode = function decode(reader, length) { + SoleTenantFinding.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.migrationcenter.v1.ReportSummary.MachineSeriesAllocation(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.migrationcenter.v1.ReportSummary.SoleTenantFinding(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: { - message.machineSeries = $root.google.cloud.migrationcenter.v1.MachineSeries.decode(reader, reader.uint32()); + if (!(message.allocatedRegions && message.allocatedRegions.length)) + message.allocatedRegions = []; + message.allocatedRegions.push(reader.string()); break; } case 2: { message.allocatedAssetCount = reader.int64(); break; } + case 3: { + if (!(message.nodeAllocations && message.nodeAllocations.length)) + message.nodeAllocations = []; + message.nodeAllocations.push($root.google.cloud.migrationcenter.v1.ReportSummary.SoleTenantNodeAllocation.decode(reader, reader.uint32())); + break; + } default: reader.skipType(tag & 7); break; @@ -47116,59 +50202,72 @@ }; /** - * Decodes a MachineSeriesAllocation message from the specified reader or buffer, length delimited. + * Decodes a SoleTenantFinding message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.migrationcenter.v1.ReportSummary.MachineSeriesAllocation + * @memberof google.cloud.migrationcenter.v1.ReportSummary.SoleTenantFinding * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.migrationcenter.v1.ReportSummary.MachineSeriesAllocation} MachineSeriesAllocation + * @returns {google.cloud.migrationcenter.v1.ReportSummary.SoleTenantFinding} SoleTenantFinding * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - MachineSeriesAllocation.decodeDelimited = function decodeDelimited(reader) { + SoleTenantFinding.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a MachineSeriesAllocation message. + * Verifies a SoleTenantFinding message. * @function verify - * @memberof google.cloud.migrationcenter.v1.ReportSummary.MachineSeriesAllocation + * @memberof google.cloud.migrationcenter.v1.ReportSummary.SoleTenantFinding * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - MachineSeriesAllocation.verify = function verify(message) { + SoleTenantFinding.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.machineSeries != null && message.hasOwnProperty("machineSeries")) { - var error = $root.google.cloud.migrationcenter.v1.MachineSeries.verify(message.machineSeries); - if (error) - return "machineSeries." + error; + if (message.allocatedRegions != null && message.hasOwnProperty("allocatedRegions")) { + if (!Array.isArray(message.allocatedRegions)) + return "allocatedRegions: array expected"; + for (var i = 0; i < message.allocatedRegions.length; ++i) + if (!$util.isString(message.allocatedRegions[i])) + return "allocatedRegions: string[] expected"; } if (message.allocatedAssetCount != null && message.hasOwnProperty("allocatedAssetCount")) if (!$util.isInteger(message.allocatedAssetCount) && !(message.allocatedAssetCount && $util.isInteger(message.allocatedAssetCount.low) && $util.isInteger(message.allocatedAssetCount.high))) return "allocatedAssetCount: integer|Long expected"; + if (message.nodeAllocations != null && message.hasOwnProperty("nodeAllocations")) { + if (!Array.isArray(message.nodeAllocations)) + return "nodeAllocations: array expected"; + for (var i = 0; i < message.nodeAllocations.length; ++i) { + var error = $root.google.cloud.migrationcenter.v1.ReportSummary.SoleTenantNodeAllocation.verify(message.nodeAllocations[i]); + if (error) + return "nodeAllocations." + error; + } + } return null; }; /** - * Creates a MachineSeriesAllocation message from a plain object. Also converts values to their respective internal types. + * Creates a SoleTenantFinding message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.migrationcenter.v1.ReportSummary.MachineSeriesAllocation + * @memberof google.cloud.migrationcenter.v1.ReportSummary.SoleTenantFinding * @static * @param {Object.} object Plain object - * @returns {google.cloud.migrationcenter.v1.ReportSummary.MachineSeriesAllocation} MachineSeriesAllocation + * @returns {google.cloud.migrationcenter.v1.ReportSummary.SoleTenantFinding} SoleTenantFinding */ - MachineSeriesAllocation.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.migrationcenter.v1.ReportSummary.MachineSeriesAllocation) + SoleTenantFinding.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.migrationcenter.v1.ReportSummary.SoleTenantFinding) return object; - var message = new $root.google.cloud.migrationcenter.v1.ReportSummary.MachineSeriesAllocation(); - if (object.machineSeries != null) { - if (typeof object.machineSeries !== "object") - throw TypeError(".google.cloud.migrationcenter.v1.ReportSummary.MachineSeriesAllocation.machineSeries: object expected"); - message.machineSeries = $root.google.cloud.migrationcenter.v1.MachineSeries.fromObject(object.machineSeries); + var message = new $root.google.cloud.migrationcenter.v1.ReportSummary.SoleTenantFinding(); + if (object.allocatedRegions) { + if (!Array.isArray(object.allocatedRegions)) + throw TypeError(".google.cloud.migrationcenter.v1.ReportSummary.SoleTenantFinding.allocatedRegions: array expected"); + message.allocatedRegions = []; + for (var i = 0; i < object.allocatedRegions.length; ++i) + message.allocatedRegions[i] = String(object.allocatedRegions[i]); } if (object.allocatedAssetCount != null) if ($util.Long) @@ -47179,93 +50278,109 @@ message.allocatedAssetCount = object.allocatedAssetCount; else if (typeof object.allocatedAssetCount === "object") message.allocatedAssetCount = new $util.LongBits(object.allocatedAssetCount.low >>> 0, object.allocatedAssetCount.high >>> 0).toNumber(); + if (object.nodeAllocations) { + if (!Array.isArray(object.nodeAllocations)) + throw TypeError(".google.cloud.migrationcenter.v1.ReportSummary.SoleTenantFinding.nodeAllocations: array expected"); + message.nodeAllocations = []; + for (var i = 0; i < object.nodeAllocations.length; ++i) { + if (typeof object.nodeAllocations[i] !== "object") + throw TypeError(".google.cloud.migrationcenter.v1.ReportSummary.SoleTenantFinding.nodeAllocations: object expected"); + message.nodeAllocations[i] = $root.google.cloud.migrationcenter.v1.ReportSummary.SoleTenantNodeAllocation.fromObject(object.nodeAllocations[i]); + } + } return message; }; /** - * Creates a plain object from a MachineSeriesAllocation message. Also converts values to other types if specified. + * Creates a plain object from a SoleTenantFinding message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.migrationcenter.v1.ReportSummary.MachineSeriesAllocation + * @memberof google.cloud.migrationcenter.v1.ReportSummary.SoleTenantFinding * @static - * @param {google.cloud.migrationcenter.v1.ReportSummary.MachineSeriesAllocation} message MachineSeriesAllocation + * @param {google.cloud.migrationcenter.v1.ReportSummary.SoleTenantFinding} message SoleTenantFinding * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - MachineSeriesAllocation.toObject = function toObject(message, options) { + SoleTenantFinding.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.defaults) { - object.machineSeries = null; + if (options.arrays || options.defaults) { + object.allocatedRegions = []; + object.nodeAllocations = []; + } + if (options.defaults) if ($util.Long) { var long = new $util.Long(0, 0, false); object.allocatedAssetCount = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; } else object.allocatedAssetCount = options.longs === String ? "0" : 0; + if (message.allocatedRegions && message.allocatedRegions.length) { + object.allocatedRegions = []; + for (var j = 0; j < message.allocatedRegions.length; ++j) + object.allocatedRegions[j] = message.allocatedRegions[j]; } - if (message.machineSeries != null && message.hasOwnProperty("machineSeries")) - object.machineSeries = $root.google.cloud.migrationcenter.v1.MachineSeries.toObject(message.machineSeries, options); if (message.allocatedAssetCount != null && message.hasOwnProperty("allocatedAssetCount")) if (typeof message.allocatedAssetCount === "number") object.allocatedAssetCount = options.longs === String ? String(message.allocatedAssetCount) : message.allocatedAssetCount; else object.allocatedAssetCount = options.longs === String ? $util.Long.prototype.toString.call(message.allocatedAssetCount) : options.longs === Number ? new $util.LongBits(message.allocatedAssetCount.low >>> 0, message.allocatedAssetCount.high >>> 0).toNumber() : message.allocatedAssetCount; + if (message.nodeAllocations && message.nodeAllocations.length) { + object.nodeAllocations = []; + for (var j = 0; j < message.nodeAllocations.length; ++j) + object.nodeAllocations[j] = $root.google.cloud.migrationcenter.v1.ReportSummary.SoleTenantNodeAllocation.toObject(message.nodeAllocations[j], options); + } return object; }; /** - * Converts this MachineSeriesAllocation to JSON. + * Converts this SoleTenantFinding to JSON. * @function toJSON - * @memberof google.cloud.migrationcenter.v1.ReportSummary.MachineSeriesAllocation + * @memberof google.cloud.migrationcenter.v1.ReportSummary.SoleTenantFinding * @instance * @returns {Object.} JSON object */ - MachineSeriesAllocation.prototype.toJSON = function toJSON() { + SoleTenantFinding.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for MachineSeriesAllocation + * Gets the default type url for SoleTenantFinding * @function getTypeUrl - * @memberof google.cloud.migrationcenter.v1.ReportSummary.MachineSeriesAllocation + * @memberof google.cloud.migrationcenter.v1.ReportSummary.SoleTenantFinding * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - MachineSeriesAllocation.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + SoleTenantFinding.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.cloud.migrationcenter.v1.ReportSummary.MachineSeriesAllocation"; + return typeUrlPrefix + "/google.cloud.migrationcenter.v1.ReportSummary.SoleTenantFinding"; }; - return MachineSeriesAllocation; + return SoleTenantFinding; })(); - ReportSummary.ComputeEngineFinding = (function() { + ReportSummary.SoleTenantNodeAllocation = (function() { /** - * Properties of a ComputeEngineFinding. + * Properties of a SoleTenantNodeAllocation. * @memberof google.cloud.migrationcenter.v1.ReportSummary - * @interface IComputeEngineFinding - * @property {Array.|null} [allocatedRegions] ComputeEngineFinding allocatedRegions - * @property {number|Long|null} [allocatedAssetCount] ComputeEngineFinding allocatedAssetCount - * @property {Array.|null} [machineSeriesAllocations] ComputeEngineFinding machineSeriesAllocations - * @property {Array.|null} [allocatedDiskTypes] ComputeEngineFinding allocatedDiskTypes + * @interface ISoleTenantNodeAllocation + * @property {google.cloud.migrationcenter.v1.ISoleTenantNodeType|null} [node] SoleTenantNodeAllocation node + * @property {number|Long|null} [nodeCount] SoleTenantNodeAllocation nodeCount + * @property {number|Long|null} [allocatedAssetCount] SoleTenantNodeAllocation allocatedAssetCount */ /** - * Constructs a new ComputeEngineFinding. + * Constructs a new SoleTenantNodeAllocation. * @memberof google.cloud.migrationcenter.v1.ReportSummary - * @classdesc Represents a ComputeEngineFinding. - * @implements IComputeEngineFinding + * @classdesc Represents a SoleTenantNodeAllocation. + * @implements ISoleTenantNodeAllocation * @constructor - * @param {google.cloud.migrationcenter.v1.ReportSummary.IComputeEngineFinding=} [properties] Properties to set + * @param {google.cloud.migrationcenter.v1.ReportSummary.ISoleTenantNodeAllocation=} [properties] Properties to set */ - function ComputeEngineFinding(properties) { - this.allocatedRegions = []; - this.machineSeriesAllocations = []; - this.allocatedDiskTypes = []; + function SoleTenantNodeAllocation(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -47273,134 +50388,103 @@ } /** - * ComputeEngineFinding allocatedRegions. - * @member {Array.} allocatedRegions - * @memberof google.cloud.migrationcenter.v1.ReportSummary.ComputeEngineFinding - * @instance - */ - ComputeEngineFinding.prototype.allocatedRegions = $util.emptyArray; - - /** - * ComputeEngineFinding allocatedAssetCount. - * @member {number|Long} allocatedAssetCount - * @memberof google.cloud.migrationcenter.v1.ReportSummary.ComputeEngineFinding + * SoleTenantNodeAllocation node. + * @member {google.cloud.migrationcenter.v1.ISoleTenantNodeType|null|undefined} node + * @memberof google.cloud.migrationcenter.v1.ReportSummary.SoleTenantNodeAllocation * @instance */ - ComputeEngineFinding.prototype.allocatedAssetCount = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + SoleTenantNodeAllocation.prototype.node = null; /** - * ComputeEngineFinding machineSeriesAllocations. - * @member {Array.} machineSeriesAllocations - * @memberof google.cloud.migrationcenter.v1.ReportSummary.ComputeEngineFinding + * SoleTenantNodeAllocation nodeCount. + * @member {number|Long} nodeCount + * @memberof google.cloud.migrationcenter.v1.ReportSummary.SoleTenantNodeAllocation * @instance */ - ComputeEngineFinding.prototype.machineSeriesAllocations = $util.emptyArray; + SoleTenantNodeAllocation.prototype.nodeCount = $util.Long ? $util.Long.fromBits(0,0,false) : 0; /** - * ComputeEngineFinding allocatedDiskTypes. - * @member {Array.} allocatedDiskTypes - * @memberof google.cloud.migrationcenter.v1.ReportSummary.ComputeEngineFinding + * SoleTenantNodeAllocation allocatedAssetCount. + * @member {number|Long} allocatedAssetCount + * @memberof google.cloud.migrationcenter.v1.ReportSummary.SoleTenantNodeAllocation * @instance */ - ComputeEngineFinding.prototype.allocatedDiskTypes = $util.emptyArray; + SoleTenantNodeAllocation.prototype.allocatedAssetCount = $util.Long ? $util.Long.fromBits(0,0,false) : 0; /** - * Creates a new ComputeEngineFinding instance using the specified properties. + * Creates a new SoleTenantNodeAllocation instance using the specified properties. * @function create - * @memberof google.cloud.migrationcenter.v1.ReportSummary.ComputeEngineFinding + * @memberof google.cloud.migrationcenter.v1.ReportSummary.SoleTenantNodeAllocation * @static - * @param {google.cloud.migrationcenter.v1.ReportSummary.IComputeEngineFinding=} [properties] Properties to set - * @returns {google.cloud.migrationcenter.v1.ReportSummary.ComputeEngineFinding} ComputeEngineFinding instance + * @param {google.cloud.migrationcenter.v1.ReportSummary.ISoleTenantNodeAllocation=} [properties] Properties to set + * @returns {google.cloud.migrationcenter.v1.ReportSummary.SoleTenantNodeAllocation} SoleTenantNodeAllocation instance */ - ComputeEngineFinding.create = function create(properties) { - return new ComputeEngineFinding(properties); + SoleTenantNodeAllocation.create = function create(properties) { + return new SoleTenantNodeAllocation(properties); }; /** - * Encodes the specified ComputeEngineFinding message. Does not implicitly {@link google.cloud.migrationcenter.v1.ReportSummary.ComputeEngineFinding.verify|verify} messages. + * Encodes the specified SoleTenantNodeAllocation message. Does not implicitly {@link google.cloud.migrationcenter.v1.ReportSummary.SoleTenantNodeAllocation.verify|verify} messages. * @function encode - * @memberof google.cloud.migrationcenter.v1.ReportSummary.ComputeEngineFinding + * @memberof google.cloud.migrationcenter.v1.ReportSummary.SoleTenantNodeAllocation * @static - * @param {google.cloud.migrationcenter.v1.ReportSummary.IComputeEngineFinding} message ComputeEngineFinding message or plain object to encode + * @param {google.cloud.migrationcenter.v1.ReportSummary.ISoleTenantNodeAllocation} message SoleTenantNodeAllocation message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ComputeEngineFinding.encode = function encode(message, writer) { + SoleTenantNodeAllocation.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.allocatedRegions != null && message.allocatedRegions.length) - for (var i = 0; i < message.allocatedRegions.length; ++i) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.allocatedRegions[i]); + if (message.node != null && Object.hasOwnProperty.call(message, "node")) + $root.google.cloud.migrationcenter.v1.SoleTenantNodeType.encode(message.node, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.nodeCount != null && Object.hasOwnProperty.call(message, "nodeCount")) + writer.uint32(/* id 2, wireType 0 =*/16).int64(message.nodeCount); if (message.allocatedAssetCount != null && Object.hasOwnProperty.call(message, "allocatedAssetCount")) - writer.uint32(/* id 2, wireType 0 =*/16).int64(message.allocatedAssetCount); - if (message.machineSeriesAllocations != null && message.machineSeriesAllocations.length) - for (var i = 0; i < message.machineSeriesAllocations.length; ++i) - $root.google.cloud.migrationcenter.v1.ReportSummary.MachineSeriesAllocation.encode(message.machineSeriesAllocations[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - if (message.allocatedDiskTypes != null && message.allocatedDiskTypes.length) { - writer.uint32(/* id 4, wireType 2 =*/34).fork(); - for (var i = 0; i < message.allocatedDiskTypes.length; ++i) - writer.int32(message.allocatedDiskTypes[i]); - writer.ldelim(); - } + writer.uint32(/* id 3, wireType 0 =*/24).int64(message.allocatedAssetCount); return writer; }; /** - * Encodes the specified ComputeEngineFinding message, length delimited. Does not implicitly {@link google.cloud.migrationcenter.v1.ReportSummary.ComputeEngineFinding.verify|verify} messages. + * Encodes the specified SoleTenantNodeAllocation message, length delimited. Does not implicitly {@link google.cloud.migrationcenter.v1.ReportSummary.SoleTenantNodeAllocation.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.migrationcenter.v1.ReportSummary.ComputeEngineFinding + * @memberof google.cloud.migrationcenter.v1.ReportSummary.SoleTenantNodeAllocation * @static - * @param {google.cloud.migrationcenter.v1.ReportSummary.IComputeEngineFinding} message ComputeEngineFinding message or plain object to encode + * @param {google.cloud.migrationcenter.v1.ReportSummary.ISoleTenantNodeAllocation} message SoleTenantNodeAllocation message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ComputeEngineFinding.encodeDelimited = function encodeDelimited(message, writer) { + SoleTenantNodeAllocation.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a ComputeEngineFinding message from the specified reader or buffer. + * Decodes a SoleTenantNodeAllocation message from the specified reader or buffer. * @function decode - * @memberof google.cloud.migrationcenter.v1.ReportSummary.ComputeEngineFinding + * @memberof google.cloud.migrationcenter.v1.ReportSummary.SoleTenantNodeAllocation * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.migrationcenter.v1.ReportSummary.ComputeEngineFinding} ComputeEngineFinding + * @returns {google.cloud.migrationcenter.v1.ReportSummary.SoleTenantNodeAllocation} SoleTenantNodeAllocation * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - ComputeEngineFinding.decode = function decode(reader, length) { + SoleTenantNodeAllocation.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.migrationcenter.v1.ReportSummary.ComputeEngineFinding(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.migrationcenter.v1.ReportSummary.SoleTenantNodeAllocation(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: { - if (!(message.allocatedRegions && message.allocatedRegions.length)) - message.allocatedRegions = []; - message.allocatedRegions.push(reader.string()); + message.node = $root.google.cloud.migrationcenter.v1.SoleTenantNodeType.decode(reader, reader.uint32()); break; } case 2: { - message.allocatedAssetCount = reader.int64(); + message.nodeCount = reader.int64(); break; } case 3: { - if (!(message.machineSeriesAllocations && message.machineSeriesAllocations.length)) - message.machineSeriesAllocations = []; - message.machineSeriesAllocations.push($root.google.cloud.migrationcenter.v1.ReportSummary.MachineSeriesAllocation.decode(reader, reader.uint32())); - break; - } - case 4: { - if (!(message.allocatedDiskTypes && message.allocatedDiskTypes.length)) - message.allocatedDiskTypes = []; - if ((tag & 7) === 2) { - var end2 = reader.uint32() + reader.pos; - while (reader.pos < end2) - message.allocatedDiskTypes.push(reader.int32()); - } else - message.allocatedDiskTypes.push(reader.int32()); + message.allocatedAssetCount = reader.int64(); break; } default: @@ -47412,87 +50496,72 @@ }; /** - * Decodes a ComputeEngineFinding message from the specified reader or buffer, length delimited. + * Decodes a SoleTenantNodeAllocation message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.migrationcenter.v1.ReportSummary.ComputeEngineFinding + * @memberof google.cloud.migrationcenter.v1.ReportSummary.SoleTenantNodeAllocation * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.migrationcenter.v1.ReportSummary.ComputeEngineFinding} ComputeEngineFinding + * @returns {google.cloud.migrationcenter.v1.ReportSummary.SoleTenantNodeAllocation} SoleTenantNodeAllocation * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - ComputeEngineFinding.decodeDelimited = function decodeDelimited(reader) { + SoleTenantNodeAllocation.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a ComputeEngineFinding message. + * Verifies a SoleTenantNodeAllocation message. * @function verify - * @memberof google.cloud.migrationcenter.v1.ReportSummary.ComputeEngineFinding + * @memberof google.cloud.migrationcenter.v1.ReportSummary.SoleTenantNodeAllocation * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - ComputeEngineFinding.verify = function verify(message) { + SoleTenantNodeAllocation.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.allocatedRegions != null && message.hasOwnProperty("allocatedRegions")) { - if (!Array.isArray(message.allocatedRegions)) - return "allocatedRegions: array expected"; - for (var i = 0; i < message.allocatedRegions.length; ++i) - if (!$util.isString(message.allocatedRegions[i])) - return "allocatedRegions: string[] expected"; + if (message.node != null && message.hasOwnProperty("node")) { + var error = $root.google.cloud.migrationcenter.v1.SoleTenantNodeType.verify(message.node); + if (error) + return "node." + error; } + if (message.nodeCount != null && message.hasOwnProperty("nodeCount")) + if (!$util.isInteger(message.nodeCount) && !(message.nodeCount && $util.isInteger(message.nodeCount.low) && $util.isInteger(message.nodeCount.high))) + return "nodeCount: integer|Long expected"; if (message.allocatedAssetCount != null && message.hasOwnProperty("allocatedAssetCount")) if (!$util.isInteger(message.allocatedAssetCount) && !(message.allocatedAssetCount && $util.isInteger(message.allocatedAssetCount.low) && $util.isInteger(message.allocatedAssetCount.high))) return "allocatedAssetCount: integer|Long expected"; - if (message.machineSeriesAllocations != null && message.hasOwnProperty("machineSeriesAllocations")) { - if (!Array.isArray(message.machineSeriesAllocations)) - return "machineSeriesAllocations: array expected"; - for (var i = 0; i < message.machineSeriesAllocations.length; ++i) { - var error = $root.google.cloud.migrationcenter.v1.ReportSummary.MachineSeriesAllocation.verify(message.machineSeriesAllocations[i]); - if (error) - return "machineSeriesAllocations." + error; - } - } - if (message.allocatedDiskTypes != null && message.hasOwnProperty("allocatedDiskTypes")) { - if (!Array.isArray(message.allocatedDiskTypes)) - return "allocatedDiskTypes: array expected"; - for (var i = 0; i < message.allocatedDiskTypes.length; ++i) - switch (message.allocatedDiskTypes[i]) { - default: - return "allocatedDiskTypes: enum value[] expected"; - case 0: - case 1: - case 2: - case 3: - break; - } - } return null; }; /** - * Creates a ComputeEngineFinding message from a plain object. Also converts values to their respective internal types. + * Creates a SoleTenantNodeAllocation message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.migrationcenter.v1.ReportSummary.ComputeEngineFinding + * @memberof google.cloud.migrationcenter.v1.ReportSummary.SoleTenantNodeAllocation * @static * @param {Object.} object Plain object - * @returns {google.cloud.migrationcenter.v1.ReportSummary.ComputeEngineFinding} ComputeEngineFinding + * @returns {google.cloud.migrationcenter.v1.ReportSummary.SoleTenantNodeAllocation} SoleTenantNodeAllocation */ - ComputeEngineFinding.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.migrationcenter.v1.ReportSummary.ComputeEngineFinding) + SoleTenantNodeAllocation.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.migrationcenter.v1.ReportSummary.SoleTenantNodeAllocation) return object; - var message = new $root.google.cloud.migrationcenter.v1.ReportSummary.ComputeEngineFinding(); - if (object.allocatedRegions) { - if (!Array.isArray(object.allocatedRegions)) - throw TypeError(".google.cloud.migrationcenter.v1.ReportSummary.ComputeEngineFinding.allocatedRegions: array expected"); - message.allocatedRegions = []; - for (var i = 0; i < object.allocatedRegions.length; ++i) - message.allocatedRegions[i] = String(object.allocatedRegions[i]); + var message = new $root.google.cloud.migrationcenter.v1.ReportSummary.SoleTenantNodeAllocation(); + if (object.node != null) { + if (typeof object.node !== "object") + throw TypeError(".google.cloud.migrationcenter.v1.ReportSummary.SoleTenantNodeAllocation.node: object expected"); + message.node = $root.google.cloud.migrationcenter.v1.SoleTenantNodeType.fromObject(object.node); } + if (object.nodeCount != null) + if ($util.Long) + (message.nodeCount = $util.Long.fromValue(object.nodeCount)).unsigned = false; + else if (typeof object.nodeCount === "string") + message.nodeCount = parseInt(object.nodeCount, 10); + else if (typeof object.nodeCount === "number") + message.nodeCount = object.nodeCount; + else if (typeof object.nodeCount === "object") + message.nodeCount = new $util.LongBits(object.nodeCount.low >>> 0, object.nodeCount.high >>> 0).toNumber(); if (object.allocatedAssetCount != null) if ($util.Long) (message.allocatedAssetCount = $util.Long.fromValue(object.allocatedAssetCount)).unsigned = false; @@ -47502,122 +50571,77 @@ message.allocatedAssetCount = object.allocatedAssetCount; else if (typeof object.allocatedAssetCount === "object") message.allocatedAssetCount = new $util.LongBits(object.allocatedAssetCount.low >>> 0, object.allocatedAssetCount.high >>> 0).toNumber(); - if (object.machineSeriesAllocations) { - if (!Array.isArray(object.machineSeriesAllocations)) - throw TypeError(".google.cloud.migrationcenter.v1.ReportSummary.ComputeEngineFinding.machineSeriesAllocations: array expected"); - message.machineSeriesAllocations = []; - for (var i = 0; i < object.machineSeriesAllocations.length; ++i) { - if (typeof object.machineSeriesAllocations[i] !== "object") - throw TypeError(".google.cloud.migrationcenter.v1.ReportSummary.ComputeEngineFinding.machineSeriesAllocations: object expected"); - message.machineSeriesAllocations[i] = $root.google.cloud.migrationcenter.v1.ReportSummary.MachineSeriesAllocation.fromObject(object.machineSeriesAllocations[i]); - } - } - if (object.allocatedDiskTypes) { - if (!Array.isArray(object.allocatedDiskTypes)) - throw TypeError(".google.cloud.migrationcenter.v1.ReportSummary.ComputeEngineFinding.allocatedDiskTypes: array expected"); - message.allocatedDiskTypes = []; - for (var i = 0; i < object.allocatedDiskTypes.length; ++i) - switch (object.allocatedDiskTypes[i]) { - default: - if (typeof object.allocatedDiskTypes[i] === "number") { - message.allocatedDiskTypes[i] = object.allocatedDiskTypes[i]; - break; - } - case "PERSISTENT_DISK_TYPE_UNSPECIFIED": - case 0: - message.allocatedDiskTypes[i] = 0; - break; - case "PERSISTENT_DISK_TYPE_STANDARD": - case 1: - message.allocatedDiskTypes[i] = 1; - break; - case "PERSISTENT_DISK_TYPE_BALANCED": - case 2: - message.allocatedDiskTypes[i] = 2; - break; - case "PERSISTENT_DISK_TYPE_SSD": - case 3: - message.allocatedDiskTypes[i] = 3; - break; - } - } return message; }; /** - * Creates a plain object from a ComputeEngineFinding message. Also converts values to other types if specified. + * Creates a plain object from a SoleTenantNodeAllocation message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.migrationcenter.v1.ReportSummary.ComputeEngineFinding + * @memberof google.cloud.migrationcenter.v1.ReportSummary.SoleTenantNodeAllocation * @static - * @param {google.cloud.migrationcenter.v1.ReportSummary.ComputeEngineFinding} message ComputeEngineFinding + * @param {google.cloud.migrationcenter.v1.ReportSummary.SoleTenantNodeAllocation} message SoleTenantNodeAllocation * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - ComputeEngineFinding.toObject = function toObject(message, options) { + SoleTenantNodeAllocation.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.arrays || options.defaults) { - object.allocatedRegions = []; - object.machineSeriesAllocations = []; - object.allocatedDiskTypes = []; - } - if (options.defaults) + if (options.defaults) { + object.node = null; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.nodeCount = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.nodeCount = options.longs === String ? "0" : 0; if ($util.Long) { var long = new $util.Long(0, 0, false); object.allocatedAssetCount = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; } else object.allocatedAssetCount = options.longs === String ? "0" : 0; - if (message.allocatedRegions && message.allocatedRegions.length) { - object.allocatedRegions = []; - for (var j = 0; j < message.allocatedRegions.length; ++j) - object.allocatedRegions[j] = message.allocatedRegions[j]; } + if (message.node != null && message.hasOwnProperty("node")) + object.node = $root.google.cloud.migrationcenter.v1.SoleTenantNodeType.toObject(message.node, options); + if (message.nodeCount != null && message.hasOwnProperty("nodeCount")) + if (typeof message.nodeCount === "number") + object.nodeCount = options.longs === String ? String(message.nodeCount) : message.nodeCount; + else + object.nodeCount = options.longs === String ? $util.Long.prototype.toString.call(message.nodeCount) : options.longs === Number ? new $util.LongBits(message.nodeCount.low >>> 0, message.nodeCount.high >>> 0).toNumber() : message.nodeCount; if (message.allocatedAssetCount != null && message.hasOwnProperty("allocatedAssetCount")) if (typeof message.allocatedAssetCount === "number") object.allocatedAssetCount = options.longs === String ? String(message.allocatedAssetCount) : message.allocatedAssetCount; else object.allocatedAssetCount = options.longs === String ? $util.Long.prototype.toString.call(message.allocatedAssetCount) : options.longs === Number ? new $util.LongBits(message.allocatedAssetCount.low >>> 0, message.allocatedAssetCount.high >>> 0).toNumber() : message.allocatedAssetCount; - if (message.machineSeriesAllocations && message.machineSeriesAllocations.length) { - object.machineSeriesAllocations = []; - for (var j = 0; j < message.machineSeriesAllocations.length; ++j) - object.machineSeriesAllocations[j] = $root.google.cloud.migrationcenter.v1.ReportSummary.MachineSeriesAllocation.toObject(message.machineSeriesAllocations[j], options); - } - if (message.allocatedDiskTypes && message.allocatedDiskTypes.length) { - object.allocatedDiskTypes = []; - for (var j = 0; j < message.allocatedDiskTypes.length; ++j) - object.allocatedDiskTypes[j] = options.enums === String ? $root.google.cloud.migrationcenter.v1.PersistentDiskType[message.allocatedDiskTypes[j]] === undefined ? message.allocatedDiskTypes[j] : $root.google.cloud.migrationcenter.v1.PersistentDiskType[message.allocatedDiskTypes[j]] : message.allocatedDiskTypes[j]; - } return object; }; /** - * Converts this ComputeEngineFinding to JSON. + * Converts this SoleTenantNodeAllocation to JSON. * @function toJSON - * @memberof google.cloud.migrationcenter.v1.ReportSummary.ComputeEngineFinding + * @memberof google.cloud.migrationcenter.v1.ReportSummary.SoleTenantNodeAllocation * @instance * @returns {Object.} JSON object */ - ComputeEngineFinding.prototype.toJSON = function toJSON() { + SoleTenantNodeAllocation.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for ComputeEngineFinding + * Gets the default type url for SoleTenantNodeAllocation * @function getTypeUrl - * @memberof google.cloud.migrationcenter.v1.ReportSummary.ComputeEngineFinding + * @memberof google.cloud.migrationcenter.v1.ReportSummary.SoleTenantNodeAllocation * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - ComputeEngineFinding.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + SoleTenantNodeAllocation.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.cloud.migrationcenter.v1.ReportSummary.ComputeEngineFinding"; + return typeUrlPrefix + "/google.cloud.migrationcenter.v1.ReportSummary.SoleTenantNodeAllocation"; }; - return ComputeEngineFinding; + return SoleTenantNodeAllocation; })(); ReportSummary.GroupPreferenceSetFinding = (function() { @@ -47636,6 +50660,8 @@ * @property {google.type.IMoney|null} [monthlyCostStorage] GroupPreferenceSetFinding monthlyCostStorage * @property {google.type.IMoney|null} [monthlyCostOther] GroupPreferenceSetFinding monthlyCostOther * @property {google.cloud.migrationcenter.v1.ReportSummary.IComputeEngineFinding|null} [computeEngineFinding] GroupPreferenceSetFinding computeEngineFinding + * @property {google.cloud.migrationcenter.v1.ReportSummary.IVmwareEngineFinding|null} [vmwareEngineFinding] GroupPreferenceSetFinding vmwareEngineFinding + * @property {google.cloud.migrationcenter.v1.ReportSummary.ISoleTenantFinding|null} [soleTenantFinding] GroupPreferenceSetFinding soleTenantFinding */ /** @@ -47733,6 +50759,22 @@ */ GroupPreferenceSetFinding.prototype.computeEngineFinding = null; + /** + * GroupPreferenceSetFinding vmwareEngineFinding. + * @member {google.cloud.migrationcenter.v1.ReportSummary.IVmwareEngineFinding|null|undefined} vmwareEngineFinding + * @memberof google.cloud.migrationcenter.v1.ReportSummary.GroupPreferenceSetFinding + * @instance + */ + GroupPreferenceSetFinding.prototype.vmwareEngineFinding = null; + + /** + * GroupPreferenceSetFinding soleTenantFinding. + * @member {google.cloud.migrationcenter.v1.ReportSummary.ISoleTenantFinding|null|undefined} soleTenantFinding + * @memberof google.cloud.migrationcenter.v1.ReportSummary.GroupPreferenceSetFinding + * @instance + */ + GroupPreferenceSetFinding.prototype.soleTenantFinding = null; + /** * Creates a new GroupPreferenceSetFinding instance using the specified properties. * @function create @@ -47777,6 +50819,10 @@ $root.google.type.Money.encode(message.monthlyCostOther, writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim(); if (message.computeEngineFinding != null && Object.hasOwnProperty.call(message, "computeEngineFinding")) $root.google.cloud.migrationcenter.v1.ReportSummary.ComputeEngineFinding.encode(message.computeEngineFinding, writer.uint32(/* id 10, wireType 2 =*/82).fork()).ldelim(); + if (message.vmwareEngineFinding != null && Object.hasOwnProperty.call(message, "vmwareEngineFinding")) + $root.google.cloud.migrationcenter.v1.ReportSummary.VmwareEngineFinding.encode(message.vmwareEngineFinding, writer.uint32(/* id 11, wireType 2 =*/90).fork()).ldelim(); + if (message.soleTenantFinding != null && Object.hasOwnProperty.call(message, "soleTenantFinding")) + $root.google.cloud.migrationcenter.v1.ReportSummary.SoleTenantFinding.encode(message.soleTenantFinding, writer.uint32(/* id 12, wireType 2 =*/98).fork()).ldelim(); return writer; }; @@ -47851,6 +50897,14 @@ message.computeEngineFinding = $root.google.cloud.migrationcenter.v1.ReportSummary.ComputeEngineFinding.decode(reader, reader.uint32()); break; } + case 11: { + message.vmwareEngineFinding = $root.google.cloud.migrationcenter.v1.ReportSummary.VmwareEngineFinding.decode(reader, reader.uint32()); + break; + } + case 12: { + message.soleTenantFinding = $root.google.cloud.migrationcenter.v1.ReportSummary.SoleTenantFinding.decode(reader, reader.uint32()); + break; + } default: reader.skipType(tag & 7); break; @@ -47932,6 +50986,16 @@ if (error) return "computeEngineFinding." + error; } + if (message.vmwareEngineFinding != null && message.hasOwnProperty("vmwareEngineFinding")) { + var error = $root.google.cloud.migrationcenter.v1.ReportSummary.VmwareEngineFinding.verify(message.vmwareEngineFinding); + if (error) + return "vmwareEngineFinding." + error; + } + if (message.soleTenantFinding != null && message.hasOwnProperty("soleTenantFinding")) { + var error = $root.google.cloud.migrationcenter.v1.ReportSummary.SoleTenantFinding.verify(message.soleTenantFinding); + if (error) + return "soleTenantFinding." + error; + } return null; }; @@ -47991,6 +51055,16 @@ throw TypeError(".google.cloud.migrationcenter.v1.ReportSummary.GroupPreferenceSetFinding.computeEngineFinding: object expected"); message.computeEngineFinding = $root.google.cloud.migrationcenter.v1.ReportSummary.ComputeEngineFinding.fromObject(object.computeEngineFinding); } + if (object.vmwareEngineFinding != null) { + if (typeof object.vmwareEngineFinding !== "object") + throw TypeError(".google.cloud.migrationcenter.v1.ReportSummary.GroupPreferenceSetFinding.vmwareEngineFinding: object expected"); + message.vmwareEngineFinding = $root.google.cloud.migrationcenter.v1.ReportSummary.VmwareEngineFinding.fromObject(object.vmwareEngineFinding); + } + if (object.soleTenantFinding != null) { + if (typeof object.soleTenantFinding !== "object") + throw TypeError(".google.cloud.migrationcenter.v1.ReportSummary.GroupPreferenceSetFinding.soleTenantFinding: object expected"); + message.soleTenantFinding = $root.google.cloud.migrationcenter.v1.ReportSummary.SoleTenantFinding.fromObject(object.soleTenantFinding); + } return message; }; @@ -48018,6 +51092,8 @@ object.monthlyCostStorage = null; object.monthlyCostOther = null; object.computeEngineFinding = null; + object.vmwareEngineFinding = null; + object.soleTenantFinding = null; } if (message.displayName != null && message.hasOwnProperty("displayName")) object.displayName = message.displayName; @@ -48039,6 +51115,10 @@ object.monthlyCostOther = $root.google.type.Money.toObject(message.monthlyCostOther, options); if (message.computeEngineFinding != null && message.hasOwnProperty("computeEngineFinding")) object.computeEngineFinding = $root.google.cloud.migrationcenter.v1.ReportSummary.ComputeEngineFinding.toObject(message.computeEngineFinding, options); + if (message.vmwareEngineFinding != null && message.hasOwnProperty("vmwareEngineFinding")) + object.vmwareEngineFinding = $root.google.cloud.migrationcenter.v1.ReportSummary.VmwareEngineFinding.toObject(message.vmwareEngineFinding, options); + if (message.soleTenantFinding != null && message.hasOwnProperty("soleTenantFinding")) + object.soleTenantFinding = $root.google.cloud.migrationcenter.v1.ReportSummary.SoleTenantFinding.toObject(message.soleTenantFinding, options); return object; }; @@ -48569,6 +51649,24 @@ return values; })(); + /** + * ComputeMigrationTargetProduct enum. + * @name google.cloud.migrationcenter.v1.ComputeMigrationTargetProduct + * @enum {number} + * @property {number} COMPUTE_MIGRATION_TARGET_PRODUCT_UNSPECIFIED=0 COMPUTE_MIGRATION_TARGET_PRODUCT_UNSPECIFIED value + * @property {number} COMPUTE_MIGRATION_TARGET_PRODUCT_COMPUTE_ENGINE=1 COMPUTE_MIGRATION_TARGET_PRODUCT_COMPUTE_ENGINE value + * @property {number} COMPUTE_MIGRATION_TARGET_PRODUCT_VMWARE_ENGINE=2 COMPUTE_MIGRATION_TARGET_PRODUCT_VMWARE_ENGINE value + * @property {number} COMPUTE_MIGRATION_TARGET_PRODUCT_SOLE_TENANCY=3 COMPUTE_MIGRATION_TARGET_PRODUCT_SOLE_TENANCY value + */ + v1.ComputeMigrationTargetProduct = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "COMPUTE_MIGRATION_TARGET_PRODUCT_UNSPECIFIED"] = 0; + values[valuesById[1] = "COMPUTE_MIGRATION_TARGET_PRODUCT_COMPUTE_ENGINE"] = 1; + values[valuesById[2] = "COMPUTE_MIGRATION_TARGET_PRODUCT_VMWARE_ENGINE"] = 2; + values[valuesById[3] = "COMPUTE_MIGRATION_TARGET_PRODUCT_SOLE_TENANCY"] = 3; + return values; + })(); + /** * ReportView enum. * @name google.cloud.migrationcenter.v1.ReportView diff --git a/packages/google-cloud-migrationcenter/protos/protos.json b/packages/google-cloud-migrationcenter/protos/protos.json index e259a6bac7f..4fdcc6e7e98 100644 --- a/packages/google-cloud-migrationcenter/protos/protos.json +++ b/packages/google-cloud-migrationcenter/protos/protos.json @@ -3241,7 +3241,10 @@ "fields": { "biosName": { "type": "string", - "id": 1 + "id": 1, + "options": { + "deprecated": true + } }, "id": { "type": "string", @@ -4203,7 +4206,8 @@ "oneofs": { "insight": { "oneof": [ - "migrationInsight" + "migrationInsight", + "genericInsight" ] } }, @@ -4214,6 +4218,39 @@ "options": { "(google.api.field_behavior)": "OUTPUT_ONLY" } + }, + "genericInsight": { + "type": "GenericInsight", + "id": 2, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + } + } + }, + "GenericInsight": { + "fields": { + "messageId": { + "type": "int64", + "id": 1, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "defaultMessage": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "additionalInformation": { + "rule": "repeated", + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } } } }, @@ -4250,24 +4287,6 @@ } } }, - "FitDescriptor": { - "fields": { - "fitLevel": { - "type": "FitLevel", - "id": 1 - } - }, - "nested": { - "FitLevel": { - "values": { - "FIT_LEVEL_UNSPECIFIED": 0, - "FIT": 1, - "NO_FIT": 2, - "REQUIRES_EFFORT": 3 - } - } - } - }, "ComputeEngineShapeDescriptor": { "fields": { "memoryMb": { @@ -4289,6 +4308,41 @@ "machineType": { "type": "string", "id": 5 + }, + "storage": { + "rule": "repeated", + "type": "ComputeStorageDescriptor", + "id": 6 + } + } + }, + "ComputeStorageDescriptor": { + "fields": { + "type": { + "type": "PersistentDiskType", + "id": 1 + }, + "sizeGb": { + "type": "int32", + "id": 2 + } + } + }, + "FitDescriptor": { + "fields": { + "fitLevel": { + "type": "FitLevel", + "id": 1 + } + }, + "nested": { + "FitLevel": { + "values": { + "FIT_LEVEL_UNSPECIFIED": 0, + "FIT": 1, + "NO_FIT": 2, + "REQUIRES_EFFORT": 3 + } } } }, @@ -4482,7 +4536,10 @@ }, "totalRowsCount": { "type": "int32", - "id": 3 + "id": 3, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } } } }, @@ -4585,6 +4642,10 @@ }, "VirtualMachinePreferences": { "fields": { + "targetProduct": { + "type": "ComputeMigrationTargetProduct", + "id": 2 + }, "regionPreferences": { "type": "RegionPreferences", "id": 3 @@ -4600,6 +4661,14 @@ "computeEnginePreferences": { "type": "ComputeEnginePreferences", "id": 6 + }, + "vmwareEnginePreferences": { + "type": "VmwareEnginePreferences", + "id": 7 + }, + "soleTenancyPreferences": { + "type": "SoleTenancyPreferences", + "id": 8 } } }, @@ -4632,6 +4701,85 @@ } } }, + "VmwareEnginePreferences": { + "fields": { + "cpuOvercommitRatio": { + "type": "double", + "id": 1 + }, + "memoryOvercommitRatio": { + "type": "double", + "id": 2 + }, + "storageDeduplicationCompressionRatio": { + "type": "double", + "id": 3 + }, + "commitmentPlan": { + "type": "CommitmentPlan", + "id": 4 + } + }, + "nested": { + "CommitmentPlan": { + "values": { + "COMMITMENT_PLAN_UNSPECIFIED": 0, + "ON_DEMAND": 1, + "COMMITMENT_1_YEAR_MONTHLY_PAYMENTS": 2, + "COMMITMENT_3_YEAR_MONTHLY_PAYMENTS": 3, + "COMMITMENT_1_YEAR_UPFRONT_PAYMENT": 4, + "COMMITMENT_3_YEAR_UPFRONT_PAYMENT": 5 + } + } + } + }, + "SoleTenancyPreferences": { + "fields": { + "cpuOvercommitRatio": { + "type": "double", + "id": 1 + }, + "hostMaintenancePolicy": { + "type": "HostMaintenancePolicy", + "id": 2 + }, + "commitmentPlan": { + "type": "CommitmentPlan", + "id": 3 + }, + "nodeTypes": { + "rule": "repeated", + "type": "SoleTenantNodeType", + "id": 4 + } + }, + "nested": { + "HostMaintenancePolicy": { + "values": { + "HOST_MAINTENANCE_POLICY_UNSPECIFIED": 0, + "HOST_MAINTENANCE_POLICY_DEFAULT": 1, + "HOST_MAINTENANCE_POLICY_RESTART_IN_PLACE": 2, + "HOST_MAINTENANCE_POLICY_MIGRATE_WITHIN_NODE_GROUP": 3 + } + }, + "CommitmentPlan": { + "values": { + "COMMITMENT_PLAN_UNSPECIFIED": 0, + "ON_DEMAND": 1, + "COMMITMENT_1_YEAR": 2, + "COMMITMENT_3_YEAR": 3 + } + } + } + }, + "SoleTenantNodeType": { + "fields": { + "nodeName": { + "type": "string", + "id": 1 + } + } + }, "RegionPreferences": { "fields": { "preferredRegions": { @@ -4817,6 +4965,82 @@ } } }, + "VmwareEngineFinding": { + "fields": { + "allocatedRegions": { + "rule": "repeated", + "type": "string", + "id": 1 + }, + "allocatedAssetCount": { + "type": "int64", + "id": 2 + }, + "nodeAllocations": { + "rule": "repeated", + "type": "VmwareNodeAllocation", + "id": 3 + } + } + }, + "VmwareNodeAllocation": { + "fields": { + "vmwareNode": { + "type": "VmwareNode", + "id": 1 + }, + "nodeCount": { + "type": "int64", + "id": 2 + }, + "allocatedAssetCount": { + "type": "int64", + "id": 3 + } + } + }, + "VmwareNode": { + "fields": { + "code": { + "type": "string", + "id": 1 + } + } + }, + "SoleTenantFinding": { + "fields": { + "allocatedRegions": { + "rule": "repeated", + "type": "string", + "id": 1 + }, + "allocatedAssetCount": { + "type": "int64", + "id": 2 + }, + "nodeAllocations": { + "rule": "repeated", + "type": "SoleTenantNodeAllocation", + "id": 3 + } + } + }, + "SoleTenantNodeAllocation": { + "fields": { + "node": { + "type": "SoleTenantNodeType", + "id": 1 + }, + "nodeCount": { + "type": "int64", + "id": 2 + }, + "allocatedAssetCount": { + "type": "int64", + "id": 3 + } + } + }, "GroupPreferenceSetFinding": { "fields": { "displayName": { @@ -4858,6 +5082,14 @@ "computeEngineFinding": { "type": "ComputeEngineFinding", "id": 10 + }, + "vmwareEngineFinding": { + "type": "VmwareEngineFinding", + "id": 11 + }, + "soleTenantFinding": { + "type": "SoleTenantFinding", + "id": 12 } } }, @@ -4877,7 +5109,10 @@ }, "overlappingAssetCount": { "type": "int64", - "id": 4 + "id": 4, + "options": { + "deprecated": true + } }, "preferenceSetFindings": { "rule": "repeated", @@ -4958,6 +5193,14 @@ "COMMITMENT_PLAN_THREE_YEARS": 3 } }, + "ComputeMigrationTargetProduct": { + "values": { + "COMPUTE_MIGRATION_TARGET_PRODUCT_UNSPECIFIED": 0, + "COMPUTE_MIGRATION_TARGET_PRODUCT_COMPUTE_ENGINE": 1, + "COMPUTE_MIGRATION_TARGET_PRODUCT_VMWARE_ENGINE": 2, + "COMPUTE_MIGRATION_TARGET_PRODUCT_SOLE_TENANCY": 3 + } + }, "ReportView": { "values": { "REPORT_VIEW_UNSPECIFIED": 0, diff --git a/packages/google-cloud-migrationcenter/samples/generated/v1/snippet_metadata.google.cloud.migrationcenter.v1.json b/packages/google-cloud-migrationcenter/samples/generated/v1/snippet_metadata.google.cloud.migrationcenter.v1.json index 10b475133a8..494b7503e71 100644 --- a/packages/google-cloud-migrationcenter/samples/generated/v1/snippet_metadata.google.cloud.migrationcenter.v1.json +++ b/packages/google-cloud-migrationcenter/samples/generated/v1/snippet_metadata.google.cloud.migrationcenter.v1.json @@ -1,7 +1,7 @@ { "clientLibrary": { "name": "nodejs-migrationcenter", - "version": "1.0.1", + "version": "1.1.0", "language": "TYPESCRIPT", "apis": [ { diff --git a/packages/google-cloud-migrationcenter/samples/generated/v1/snippet_metadata_google.cloud.migrationcenter.v1.json b/packages/google-cloud-migrationcenter/samples/generated/v1/snippet_metadata_google.cloud.migrationcenter.v1.json index 10b475133a8..494b7503e71 100644 --- a/packages/google-cloud-migrationcenter/samples/generated/v1/snippet_metadata_google.cloud.migrationcenter.v1.json +++ b/packages/google-cloud-migrationcenter/samples/generated/v1/snippet_metadata_google.cloud.migrationcenter.v1.json @@ -1,7 +1,7 @@ { "clientLibrary": { "name": "nodejs-migrationcenter", - "version": "1.0.1", + "version": "1.1.0", "language": "TYPESCRIPT", "apis": [ { diff --git a/packages/google-cloud-migrationcenter/samples/package.json b/packages/google-cloud-migrationcenter/samples/package.json index 24019e5cfd8..c75174ad8db 100644 --- a/packages/google-cloud-migrationcenter/samples/package.json +++ b/packages/google-cloud-migrationcenter/samples/package.json @@ -14,7 +14,7 @@ "publish": "echo 'sample test; do not publish'" }, "dependencies": { - "@google-cloud/migrationcenter": "^1.0.1" + "@google-cloud/migrationcenter": "^1.1.0" }, "devDependencies": { "c8": "^7.1.0", diff --git a/packages/google-cloud-networkconnectivity/CHANGELOG.md b/packages/google-cloud-networkconnectivity/CHANGELOG.md index 899dbc77c00..4ee86b466c4 100644 --- a/packages/google-cloud-networkconnectivity/CHANGELOG.md +++ b/packages/google-cloud-networkconnectivity/CHANGELOG.md @@ -1,5 +1,12 @@ # Changelog +## [3.1.0](https://github.com/googleapis/google-cloud-node/compare/network-connectivity-v3.0.1...network-connectivity-v3.1.0) (2023-09-14) + + +### Features + +* [networkconnectivity] add PolicyBasedRouting APIs ([#4636](https://github.com/googleapis/google-cloud-node/issues/4636)) ([7f6f625](https://github.com/googleapis/google-cloud-node/commit/7f6f62557446160c96677b72185deb9f2794d4cf)) + ## [3.0.1](https://github.com/googleapis/google-cloud-node/compare/network-connectivity-v3.0.0...network-connectivity-v3.0.1) (2023-09-06) diff --git a/packages/google-cloud-networkconnectivity/package.json b/packages/google-cloud-networkconnectivity/package.json index 3633e54d273..bb5162f9800 100644 --- a/packages/google-cloud-networkconnectivity/package.json +++ b/packages/google-cloud-networkconnectivity/package.json @@ -1,6 +1,6 @@ { "name": "@google-cloud/network-connectivity", - "version": "3.0.1", + "version": "3.1.0", "description": "Networkconnectivity client for Node.js", "repository": { "type": "git", diff --git a/packages/google-cloud-networkconnectivity/protos/google/cloud/networkconnectivity/v1/policy_based_routing.proto b/packages/google-cloud-networkconnectivity/protos/google/cloud/networkconnectivity/v1/policy_based_routing.proto index 74c24bd3971..ae5c057f662 100644 --- a/packages/google-cloud-networkconnectivity/protos/google/cloud/networkconnectivity/v1/policy_based_routing.proto +++ b/packages/google-cloud-networkconnectivity/protos/google/cloud/networkconnectivity/v1/policy_based_routing.proto @@ -1,4 +1,4 @@ -// Copyright 2022 Google LLC +// Copyright 2023 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -20,11 +20,13 @@ import "google/api/annotations.proto"; import "google/api/client.proto"; import "google/api/field_behavior.proto"; import "google/api/resource.proto"; +import "google/cloud/networkconnectivity/v1/common.proto"; import "google/longrunning/operations.proto"; +import "google/protobuf/empty.proto"; import "google/protobuf/timestamp.proto"; option csharp_namespace = "Google.Cloud.NetworkConnectivity.V1"; -option go_package = "google.golang.org/genproto/googleapis/cloud/networkconnectivity/v1;networkconnectivity"; +option go_package = "cloud.google.com/go/networkconnectivity/apiv1/networkconnectivitypb;networkconnectivitypb"; option java_multiple_files = true; option java_outer_classname = "PolicyBasedRoutingProto"; option java_package = "com.google.cloud.networkconnectivity.v1"; @@ -35,10 +37,12 @@ option ruby_package = "Google::Cloud::NetworkConnectivity::V1"; // policies for Layer 4 traffic traversing through the connected service. service PolicyBasedRoutingService { option (google.api.default_host) = "networkconnectivity.googleapis.com"; - option (google.api.oauth_scopes) = "https://www.googleapis.com/auth/cloud-platform"; + option (google.api.oauth_scopes) = + "https://www.googleapis.com/auth/cloud-platform"; // Lists PolicyBasedRoutes in a given project and location. - rpc ListPolicyBasedRoutes(ListPolicyBasedRoutesRequest) returns (ListPolicyBasedRoutesResponse) { + rpc ListPolicyBasedRoutes(ListPolicyBasedRoutesRequest) + returns (ListPolicyBasedRoutesResponse) { option (google.api.http) = { get: "/v1/{parent=projects/*/locations/global}/policyBasedRoutes" }; @@ -46,7 +50,8 @@ service PolicyBasedRoutingService { } // Gets details of a single PolicyBasedRoute. - rpc GetPolicyBasedRoute(GetPolicyBasedRouteRequest) returns (PolicyBasedRoute) { + rpc GetPolicyBasedRoute(GetPolicyBasedRouteRequest) + returns (PolicyBasedRoute) { option (google.api.http) = { get: "/v1/{name=projects/*/locations/global/policyBasedRoutes/*}" }; @@ -54,12 +59,14 @@ service PolicyBasedRoutingService { } // Creates a new PolicyBasedRoute in a given project and location. - rpc CreatePolicyBasedRoute(CreatePolicyBasedRouteRequest) returns (google.longrunning.Operation) { + rpc CreatePolicyBasedRoute(CreatePolicyBasedRouteRequest) + returns (google.longrunning.Operation) { option (google.api.http) = { post: "/v1/{parent=projects/*/locations/global}/policyBasedRoutes" body: "policy_based_route" }; - option (google.api.method_signature) = "parent,policy_based_route,policy_based_route_id"; + option (google.api.method_signature) = + "parent,policy_based_route,policy_based_route_id"; option (google.longrunning.operation_info) = { response_type: "PolicyBasedRoute" metadata_type: "OperationMetadata" @@ -67,7 +74,8 @@ service PolicyBasedRoutingService { } // Deletes a single PolicyBasedRoute. - rpc DeletePolicyBasedRoute(DeletePolicyBasedRouteRequest) returns (google.longrunning.Operation) { + rpc DeletePolicyBasedRoute(DeletePolicyBasedRouteRequest) + returns (google.longrunning.Operation) { option (google.api.http) = { delete: "/v1/{name=projects/*/locations/global/policyBasedRoutes/*}" }; @@ -83,18 +91,18 @@ service PolicyBasedRoutingService { // to route their L4 network traffic based on not just destination IP, but also // source IP, protocol and more. A PBR always take precedence when it conflicts // with other types of routes. -// Next id: 19 +// Next id: 22 message PolicyBasedRoute { option (google.api.resource) = { type: "networkconnectivity.googleapis.com/PolicyBasedRoute" - pattern: "projects/{project}/{location}/global/PolicyBasedRoutes/{policy_based_route}" + pattern: "projects/{project}/locations/global/PolicyBasedRoutes/{policy_based_route}" }; // VM instances to which this policy based route applies to. message VirtualMachine { - // Optional. A list of VM instance tags to which this policy based route applies to. - // VM instances that have ANY of tags specified here will install this - // PBR. + // Optional. A list of VM instance tags to which this policy based route + // applies to. VM instances that have ANY of tags specified here will + // install this PBR. repeated string tags = 1 [(google.api.field_behavior) = OPTIONAL]; } @@ -116,21 +124,23 @@ message PolicyBasedRoute { IPV4 = 1; } - // Optional. The IP protocol that this policy based route applies to. Valid values are - // 'TCP', 'UDP', and 'ALL'. Default is 'ALL'. + // Optional. The IP protocol that this policy based route applies to. Valid + // values are 'TCP', 'UDP', and 'ALL'. Default is 'ALL'. string ip_protocol = 1 [(google.api.field_behavior) = OPTIONAL]; - // Optional. The source IP range of outgoing packets that this policy based route - // applies to. Default is "0.0.0.0/0" if protocol version is IPv4. + // Optional. The source IP range of outgoing packets that this policy based + // route applies to. Default is "0.0.0.0/0" if protocol version is IPv4. string src_range = 2 [(google.api.field_behavior) = OPTIONAL]; - // Optional. The destination IP range of outgoing packets that this policy based route - // applies to. Default is "0.0.0.0/0" if protocol version is IPv4. + // Optional. The destination IP range of outgoing packets that this policy + // based route applies to. Default is "0.0.0.0/0" if protocol version is + // IPv4. string dest_range = 3 [(google.api.field_behavior) = OPTIONAL]; - // Required. Internet protocol versions this policy based route applies to. For this - // version, only IPV4 is supported. - ProtocolVersion protocol_version = 6 [(google.api.field_behavior) = REQUIRED]; + // Required. Internet protocol versions this policy based route applies to. + // For this version, only IPV4 is supported. + ProtocolVersion protocol_version = 6 + [(google.api.field_behavior) = REQUIRED]; } // Informational warning message. @@ -154,34 +164,53 @@ message PolicyBasedRoute { // Output only. A warning code, if applicable. Code code = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; - // Output only. Metadata about this warning in key: value format. The key should provides - // more detail on the warning being returned. For example, for warnings - // where there are no results in a list request for a particular zone, this - // key might be scope and the key value might be the zone name. Other - // examples might be a key indicating a deprecated resource and a suggested - // replacement. + // Output only. Metadata about this warning in key: value format. The key + // should provides more detail on the warning being returned. For example, + // for warnings where there are no results in a list request for a + // particular zone, this key might be scope and the key value might be the + // zone name. Other examples might be a key indicating a deprecated resource + // and a suggested replacement. map data = 2 [(google.api.field_behavior) = OUTPUT_ONLY]; // Output only. A human-readable description of the warning code. string warning_message = 3 [(google.api.field_behavior) = OUTPUT_ONLY]; } + // The other routing cases. + enum OtherRoutes { + // Default value. + OTHER_ROUTES_UNSPECIFIED = 0; + + // Use the routes from the default routing tables (system-generated routes, + // custom routes, peering route) to determine the next hop. This will + // effectively exclude matching packets being applied on other PBRs with a + // lower priority. + DEFAULT_ROUTING = 1; + } + // Target specifies network endpoints to which this policy based route applies // to. If none of the target is specified, the PBR will be installed on all // network endpoints (e.g. VMs, VPNs, and Interconnects) in the VPC. oneof target { // Optional. VM instances to which this policy based route applies to. - VirtualMachine virtual_machine = 18 [(google.api.field_behavior) = OPTIONAL]; + VirtualMachine virtual_machine = 18 + [(google.api.field_behavior) = OPTIONAL]; // Optional. The interconnect attachments to which this route applies to. - InterconnectAttachment interconnect_attachment = 9 [(google.api.field_behavior) = OPTIONAL]; + InterconnectAttachment interconnect_attachment = 9 + [(google.api.field_behavior) = OPTIONAL]; } oneof next_hop { - // Optional. The IP of a global access enabled L4 ILB that should be the next hop to - // handle matching packets. For this version, only next_hop_ilb_ip is - // supported. + // Optional. The IP of a global access enabled L4 ILB that should be the + // next hop to handle matching packets. For this version, only + // next_hop_ilb_ip is supported. string next_hop_ilb_ip = 12 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Other routes that will be referenced to determine the next hop + // of the packet. + OtherRoutes next_hop_other_routes = 21 + [(google.api.field_behavior) = OPTIONAL]; } // Immutable. A unique name of the resource in the form of @@ -189,35 +218,35 @@ message PolicyBasedRoute { string name = 1 [(google.api.field_behavior) = IMMUTABLE]; // Output only. Time when the PolicyBasedRoute was created. - google.protobuf.Timestamp create_time = 2 [(google.api.field_behavior) = OUTPUT_ONLY]; + google.protobuf.Timestamp create_time = 2 + [(google.api.field_behavior) = OUTPUT_ONLY]; // Output only. Time when the PolicyBasedRoute was updated. - google.protobuf.Timestamp update_time = 3 [(google.api.field_behavior) = OUTPUT_ONLY]; + google.protobuf.Timestamp update_time = 3 + [(google.api.field_behavior) = OUTPUT_ONLY]; // User-defined labels. map labels = 4; - // Optional. An optional description of this resource. Provide this field when you - // create the resource. + // Optional. An optional description of this resource. Provide this field when + // you create the resource. string description = 5 [(google.api.field_behavior) = OPTIONAL]; - // Required. Fully-qualified URL of the network that this route applies to. e.g. - // projects/my-project/global/networks/my-network. + // Required. Fully-qualified URL of the network that this route applies to. + // e.g. projects/my-project/global/networks/my-network. string network = 6 [ (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "compute.googleapis.com/Network" - } + (google.api.resource_reference) = { type: "compute.googleapis.com/Network" } ]; // Required. The filter to match L4 traffic. Filter filter = 10 [(google.api.field_behavior) = REQUIRED]; - // Optional. The priority of this policy based route. Priority is used to break ties in - // cases where there are more than one matching policy based routes found. In - // cases where multiple policy based routes are matched, the one with the - // lowest-numbered priority value wins. The default value is 1000. The - // priority value must be from 1 to 65535, inclusive. + // Optional. The priority of this policy based route. Priority is used to + // break ties in cases where there are more than one matching policy based + // routes found. In cases where multiple policy based routes are matched, the + // one with the lowest-numbered priority value wins. The default value is + // 1000. The priority value must be from 1 to 65535, inclusive. int32 priority = 11 [(google.api.field_behavior) = OPTIONAL]; // Output only. If potential misconfigurations are detected for this route, @@ -227,8 +256,8 @@ message PolicyBasedRoute { // Output only. Server-defined fully-qualified URL for this resource. string self_link = 15 [(google.api.field_behavior) = OUTPUT_ONLY]; - // Output only. Type of this resource. Always networkconnectivity#policyBasedRoute for - // Policy Based Route resources. + // Output only. Type of this resource. Always + // networkconnectivity#policyBasedRoute for Policy Based Route resources. string kind = 16 [(google.api.field_behavior) = OUTPUT_ONLY]; } @@ -289,19 +318,20 @@ message CreatePolicyBasedRouteRequest { } ]; - // Optional. Unique id for the Policy Based Route to create. - string policy_based_route_id = 2 [(google.api.field_behavior) = OPTIONAL]; + // Required. Unique id for the Policy Based Route to create. + string policy_based_route_id = 2 [(google.api.field_behavior) = REQUIRED]; // Required. Initial values for a new Policy Based Route. - PolicyBasedRoute policy_based_route = 3 [(google.api.field_behavior) = REQUIRED]; + PolicyBasedRoute policy_based_route = 3 + [(google.api.field_behavior) = REQUIRED]; - // Optional. An optional request ID to identify requests. Specify a unique request ID - // so that if you must retry your request, the server will know to ignore - // the request if it has already been completed. The server will guarantee - // that for at least 60 minutes since the first request. + // Optional. An optional request ID to identify requests. Specify a unique + // request ID so that if you must retry your request, the server will know to + // ignore the request if it has already been completed. The server will + // guarantee that for at least 60 minutes since the first request. // - // For example, consider a situation where you make an initial request and t - // he request times out. If you make the request again with the same request + // For example, consider a situation where you make an initial request and + // the request times out. If you make the request again with the same request // ID, the server can check if original operation with the same request ID // was received, and if so, will ignore the second request. This prevents // clients from accidentally creating duplicate commitments. @@ -321,13 +351,13 @@ message DeletePolicyBasedRouteRequest { } ]; - // Optional. An optional request ID to identify requests. Specify a unique request ID - // so that if you must retry your request, the server will know to ignore - // the request if it has already been completed. The server will guarantee - // that for at least 60 minutes after the first request. + // Optional. An optional request ID to identify requests. Specify a unique + // request ID so that if you must retry your request, the server will know to + // ignore the request if it has already been completed. The server will + // guarantee that for at least 60 minutes after the first request. // - // For example, consider a situation where you make an initial request and t - // he request times out. If you make the request again with the same request + // For example, consider a situation where you make an initial request and + // the request times out. If you make the request again with the same request // ID, the server can check if original operation with the same request ID // was received, and if so, will ignore the second request. This prevents // clients from accidentally creating duplicate commitments. diff --git a/packages/google-cloud-networkconnectivity/protos/protos.d.ts b/packages/google-cloud-networkconnectivity/protos/protos.d.ts index 97ae16b66d1..bef79583038 100644 --- a/packages/google-cloud-networkconnectivity/protos/protos.d.ts +++ b/packages/google-cloud-networkconnectivity/protos/protos.d.ts @@ -2642,6 +2642,1292 @@ export namespace google { */ public static getTypeUrl(typeUrlPrefix?: string): string; } + + /** Represents a PolicyBasedRoutingService */ + class PolicyBasedRoutingService extends $protobuf.rpc.Service { + + /** + * Constructs a new PolicyBasedRoutingService 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 PolicyBasedRoutingService 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): PolicyBasedRoutingService; + + /** + * Calls ListPolicyBasedRoutes. + * @param request ListPolicyBasedRoutesRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ListPolicyBasedRoutesResponse + */ + public listPolicyBasedRoutes(request: google.cloud.networkconnectivity.v1.IListPolicyBasedRoutesRequest, callback: google.cloud.networkconnectivity.v1.PolicyBasedRoutingService.ListPolicyBasedRoutesCallback): void; + + /** + * Calls ListPolicyBasedRoutes. + * @param request ListPolicyBasedRoutesRequest message or plain object + * @returns Promise + */ + public listPolicyBasedRoutes(request: google.cloud.networkconnectivity.v1.IListPolicyBasedRoutesRequest): Promise; + + /** + * Calls GetPolicyBasedRoute. + * @param request GetPolicyBasedRouteRequest message or plain object + * @param callback Node-style callback called with the error, if any, and PolicyBasedRoute + */ + public getPolicyBasedRoute(request: google.cloud.networkconnectivity.v1.IGetPolicyBasedRouteRequest, callback: google.cloud.networkconnectivity.v1.PolicyBasedRoutingService.GetPolicyBasedRouteCallback): void; + + /** + * Calls GetPolicyBasedRoute. + * @param request GetPolicyBasedRouteRequest message or plain object + * @returns Promise + */ + public getPolicyBasedRoute(request: google.cloud.networkconnectivity.v1.IGetPolicyBasedRouteRequest): Promise; + + /** + * Calls CreatePolicyBasedRoute. + * @param request CreatePolicyBasedRouteRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public createPolicyBasedRoute(request: google.cloud.networkconnectivity.v1.ICreatePolicyBasedRouteRequest, callback: google.cloud.networkconnectivity.v1.PolicyBasedRoutingService.CreatePolicyBasedRouteCallback): void; + + /** + * Calls CreatePolicyBasedRoute. + * @param request CreatePolicyBasedRouteRequest message or plain object + * @returns Promise + */ + public createPolicyBasedRoute(request: google.cloud.networkconnectivity.v1.ICreatePolicyBasedRouteRequest): Promise; + + /** + * Calls DeletePolicyBasedRoute. + * @param request DeletePolicyBasedRouteRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public deletePolicyBasedRoute(request: google.cloud.networkconnectivity.v1.IDeletePolicyBasedRouteRequest, callback: google.cloud.networkconnectivity.v1.PolicyBasedRoutingService.DeletePolicyBasedRouteCallback): void; + + /** + * Calls DeletePolicyBasedRoute. + * @param request DeletePolicyBasedRouteRequest message or plain object + * @returns Promise + */ + public deletePolicyBasedRoute(request: google.cloud.networkconnectivity.v1.IDeletePolicyBasedRouteRequest): Promise; + } + + namespace PolicyBasedRoutingService { + + /** + * Callback as used by {@link google.cloud.networkconnectivity.v1.PolicyBasedRoutingService|listPolicyBasedRoutes}. + * @param error Error, if any + * @param [response] ListPolicyBasedRoutesResponse + */ + type ListPolicyBasedRoutesCallback = (error: (Error|null), response?: google.cloud.networkconnectivity.v1.ListPolicyBasedRoutesResponse) => void; + + /** + * Callback as used by {@link google.cloud.networkconnectivity.v1.PolicyBasedRoutingService|getPolicyBasedRoute}. + * @param error Error, if any + * @param [response] PolicyBasedRoute + */ + type GetPolicyBasedRouteCallback = (error: (Error|null), response?: google.cloud.networkconnectivity.v1.PolicyBasedRoute) => void; + + /** + * Callback as used by {@link google.cloud.networkconnectivity.v1.PolicyBasedRoutingService|createPolicyBasedRoute}. + * @param error Error, if any + * @param [response] Operation + */ + type CreatePolicyBasedRouteCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.cloud.networkconnectivity.v1.PolicyBasedRoutingService|deletePolicyBasedRoute}. + * @param error Error, if any + * @param [response] Operation + */ + type DeletePolicyBasedRouteCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + } + + /** Properties of a PolicyBasedRoute. */ + interface IPolicyBasedRoute { + + /** PolicyBasedRoute virtualMachine */ + virtualMachine?: (google.cloud.networkconnectivity.v1.PolicyBasedRoute.IVirtualMachine|null); + + /** PolicyBasedRoute interconnectAttachment */ + interconnectAttachment?: (google.cloud.networkconnectivity.v1.PolicyBasedRoute.IInterconnectAttachment|null); + + /** PolicyBasedRoute nextHopIlbIp */ + nextHopIlbIp?: (string|null); + + /** PolicyBasedRoute nextHopOtherRoutes */ + nextHopOtherRoutes?: (google.cloud.networkconnectivity.v1.PolicyBasedRoute.OtherRoutes|keyof typeof google.cloud.networkconnectivity.v1.PolicyBasedRoute.OtherRoutes|null); + + /** PolicyBasedRoute name */ + name?: (string|null); + + /** PolicyBasedRoute createTime */ + createTime?: (google.protobuf.ITimestamp|null); + + /** PolicyBasedRoute updateTime */ + updateTime?: (google.protobuf.ITimestamp|null); + + /** PolicyBasedRoute labels */ + labels?: ({ [k: string]: string }|null); + + /** PolicyBasedRoute description */ + description?: (string|null); + + /** PolicyBasedRoute network */ + network?: (string|null); + + /** PolicyBasedRoute filter */ + filter?: (google.cloud.networkconnectivity.v1.PolicyBasedRoute.IFilter|null); + + /** PolicyBasedRoute priority */ + priority?: (number|null); + + /** PolicyBasedRoute warnings */ + warnings?: (google.cloud.networkconnectivity.v1.PolicyBasedRoute.IWarnings[]|null); + + /** PolicyBasedRoute selfLink */ + selfLink?: (string|null); + + /** PolicyBasedRoute kind */ + kind?: (string|null); + } + + /** Represents a PolicyBasedRoute. */ + class PolicyBasedRoute implements IPolicyBasedRoute { + + /** + * Constructs a new PolicyBasedRoute. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.networkconnectivity.v1.IPolicyBasedRoute); + + /** PolicyBasedRoute virtualMachine. */ + public virtualMachine?: (google.cloud.networkconnectivity.v1.PolicyBasedRoute.IVirtualMachine|null); + + /** PolicyBasedRoute interconnectAttachment. */ + public interconnectAttachment?: (google.cloud.networkconnectivity.v1.PolicyBasedRoute.IInterconnectAttachment|null); + + /** PolicyBasedRoute nextHopIlbIp. */ + public nextHopIlbIp?: (string|null); + + /** PolicyBasedRoute nextHopOtherRoutes. */ + public nextHopOtherRoutes?: (google.cloud.networkconnectivity.v1.PolicyBasedRoute.OtherRoutes|keyof typeof google.cloud.networkconnectivity.v1.PolicyBasedRoute.OtherRoutes|null); + + /** PolicyBasedRoute name. */ + public name: string; + + /** PolicyBasedRoute createTime. */ + public createTime?: (google.protobuf.ITimestamp|null); + + /** PolicyBasedRoute updateTime. */ + public updateTime?: (google.protobuf.ITimestamp|null); + + /** PolicyBasedRoute labels. */ + public labels: { [k: string]: string }; + + /** PolicyBasedRoute description. */ + public description: string; + + /** PolicyBasedRoute network. */ + public network: string; + + /** PolicyBasedRoute filter. */ + public filter?: (google.cloud.networkconnectivity.v1.PolicyBasedRoute.IFilter|null); + + /** PolicyBasedRoute priority. */ + public priority: number; + + /** PolicyBasedRoute warnings. */ + public warnings: google.cloud.networkconnectivity.v1.PolicyBasedRoute.IWarnings[]; + + /** PolicyBasedRoute selfLink. */ + public selfLink: string; + + /** PolicyBasedRoute kind. */ + public kind: string; + + /** PolicyBasedRoute target. */ + public target?: ("virtualMachine"|"interconnectAttachment"); + + /** PolicyBasedRoute nextHop. */ + public nextHop?: ("nextHopIlbIp"|"nextHopOtherRoutes"); + + /** + * Creates a new PolicyBasedRoute instance using the specified properties. + * @param [properties] Properties to set + * @returns PolicyBasedRoute instance + */ + public static create(properties?: google.cloud.networkconnectivity.v1.IPolicyBasedRoute): google.cloud.networkconnectivity.v1.PolicyBasedRoute; + + /** + * Encodes the specified PolicyBasedRoute message. Does not implicitly {@link google.cloud.networkconnectivity.v1.PolicyBasedRoute.verify|verify} messages. + * @param message PolicyBasedRoute message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.networkconnectivity.v1.IPolicyBasedRoute, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified PolicyBasedRoute message, length delimited. Does not implicitly {@link google.cloud.networkconnectivity.v1.PolicyBasedRoute.verify|verify} messages. + * @param message PolicyBasedRoute message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.networkconnectivity.v1.IPolicyBasedRoute, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a PolicyBasedRoute message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns PolicyBasedRoute + * @throws {Error} If the payload is not 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.networkconnectivity.v1.PolicyBasedRoute; + + /** + * Decodes a PolicyBasedRoute message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns PolicyBasedRoute + * @throws {Error} If the payload 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.networkconnectivity.v1.PolicyBasedRoute; + + /** + * Verifies a PolicyBasedRoute message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a PolicyBasedRoute message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns PolicyBasedRoute + */ + public static fromObject(object: { [k: string]: any }): google.cloud.networkconnectivity.v1.PolicyBasedRoute; + + /** + * Creates a plain object from a PolicyBasedRoute message. Also converts values to other types if specified. + * @param message PolicyBasedRoute + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.networkconnectivity.v1.PolicyBasedRoute, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this PolicyBasedRoute to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for PolicyBasedRoute + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace PolicyBasedRoute { + + /** Properties of a VirtualMachine. */ + interface IVirtualMachine { + + /** VirtualMachine tags */ + tags?: (string[]|null); + } + + /** Represents a VirtualMachine. */ + class VirtualMachine implements IVirtualMachine { + + /** + * Constructs a new VirtualMachine. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.networkconnectivity.v1.PolicyBasedRoute.IVirtualMachine); + + /** VirtualMachine tags. */ + public tags: string[]; + + /** + * Creates a new VirtualMachine instance using the specified properties. + * @param [properties] Properties to set + * @returns VirtualMachine instance + */ + public static create(properties?: google.cloud.networkconnectivity.v1.PolicyBasedRoute.IVirtualMachine): google.cloud.networkconnectivity.v1.PolicyBasedRoute.VirtualMachine; + + /** + * Encodes the specified VirtualMachine message. Does not implicitly {@link google.cloud.networkconnectivity.v1.PolicyBasedRoute.VirtualMachine.verify|verify} messages. + * @param message VirtualMachine message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.networkconnectivity.v1.PolicyBasedRoute.IVirtualMachine, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified VirtualMachine message, length delimited. Does not implicitly {@link google.cloud.networkconnectivity.v1.PolicyBasedRoute.VirtualMachine.verify|verify} messages. + * @param message VirtualMachine message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.networkconnectivity.v1.PolicyBasedRoute.IVirtualMachine, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a VirtualMachine message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns VirtualMachine + * @throws {Error} If the payload is not 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.networkconnectivity.v1.PolicyBasedRoute.VirtualMachine; + + /** + * Decodes a VirtualMachine message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns VirtualMachine + * @throws {Error} If the payload 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.networkconnectivity.v1.PolicyBasedRoute.VirtualMachine; + + /** + * Verifies a VirtualMachine message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a VirtualMachine message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns VirtualMachine + */ + public static fromObject(object: { [k: string]: any }): google.cloud.networkconnectivity.v1.PolicyBasedRoute.VirtualMachine; + + /** + * Creates a plain object from a VirtualMachine message. Also converts values to other types if specified. + * @param message VirtualMachine + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.networkconnectivity.v1.PolicyBasedRoute.VirtualMachine, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this VirtualMachine to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for VirtualMachine + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an InterconnectAttachment. */ + interface IInterconnectAttachment { + + /** InterconnectAttachment region */ + region?: (string|null); + } + + /** Represents an InterconnectAttachment. */ + class InterconnectAttachment implements IInterconnectAttachment { + + /** + * Constructs a new InterconnectAttachment. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.networkconnectivity.v1.PolicyBasedRoute.IInterconnectAttachment); + + /** InterconnectAttachment region. */ + public region: string; + + /** + * Creates a new InterconnectAttachment instance using the specified properties. + * @param [properties] Properties to set + * @returns InterconnectAttachment instance + */ + public static create(properties?: google.cloud.networkconnectivity.v1.PolicyBasedRoute.IInterconnectAttachment): google.cloud.networkconnectivity.v1.PolicyBasedRoute.InterconnectAttachment; + + /** + * Encodes the specified InterconnectAttachment message. Does not implicitly {@link google.cloud.networkconnectivity.v1.PolicyBasedRoute.InterconnectAttachment.verify|verify} messages. + * @param message InterconnectAttachment message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.networkconnectivity.v1.PolicyBasedRoute.IInterconnectAttachment, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified InterconnectAttachment message, length delimited. Does not implicitly {@link google.cloud.networkconnectivity.v1.PolicyBasedRoute.InterconnectAttachment.verify|verify} messages. + * @param message InterconnectAttachment message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.networkconnectivity.v1.PolicyBasedRoute.IInterconnectAttachment, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an InterconnectAttachment message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns InterconnectAttachment + * @throws {Error} If the payload is not 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.networkconnectivity.v1.PolicyBasedRoute.InterconnectAttachment; + + /** + * Decodes an InterconnectAttachment message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns InterconnectAttachment + * @throws {Error} If the payload 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.networkconnectivity.v1.PolicyBasedRoute.InterconnectAttachment; + + /** + * Verifies an InterconnectAttachment message. + * @param message Plain 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 InterconnectAttachment message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns InterconnectAttachment + */ + public static fromObject(object: { [k: string]: any }): google.cloud.networkconnectivity.v1.PolicyBasedRoute.InterconnectAttachment; + + /** + * Creates a plain object from an InterconnectAttachment message. Also converts values to other types if specified. + * @param message InterconnectAttachment + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.networkconnectivity.v1.PolicyBasedRoute.InterconnectAttachment, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this InterconnectAttachment to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for InterconnectAttachment + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Filter. */ + interface IFilter { + + /** Filter ipProtocol */ + ipProtocol?: (string|null); + + /** Filter srcRange */ + srcRange?: (string|null); + + /** Filter destRange */ + destRange?: (string|null); + + /** Filter protocolVersion */ + protocolVersion?: (google.cloud.networkconnectivity.v1.PolicyBasedRoute.Filter.ProtocolVersion|keyof typeof google.cloud.networkconnectivity.v1.PolicyBasedRoute.Filter.ProtocolVersion|null); + } + + /** Represents a Filter. */ + class Filter implements IFilter { + + /** + * Constructs a new Filter. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.networkconnectivity.v1.PolicyBasedRoute.IFilter); + + /** Filter ipProtocol. */ + public ipProtocol: string; + + /** Filter srcRange. */ + public srcRange: string; + + /** Filter destRange. */ + public destRange: string; + + /** Filter protocolVersion. */ + public protocolVersion: (google.cloud.networkconnectivity.v1.PolicyBasedRoute.Filter.ProtocolVersion|keyof typeof google.cloud.networkconnectivity.v1.PolicyBasedRoute.Filter.ProtocolVersion); + + /** + * Creates a new Filter instance using the specified properties. + * @param [properties] Properties to set + * @returns Filter instance + */ + public static create(properties?: google.cloud.networkconnectivity.v1.PolicyBasedRoute.IFilter): google.cloud.networkconnectivity.v1.PolicyBasedRoute.Filter; + + /** + * Encodes the specified Filter message. Does not implicitly {@link google.cloud.networkconnectivity.v1.PolicyBasedRoute.Filter.verify|verify} messages. + * @param message Filter message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.networkconnectivity.v1.PolicyBasedRoute.IFilter, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Filter message, length delimited. Does not implicitly {@link google.cloud.networkconnectivity.v1.PolicyBasedRoute.Filter.verify|verify} messages. + * @param message Filter message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.networkconnectivity.v1.PolicyBasedRoute.IFilter, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Filter message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Filter + * @throws {Error} If the payload is not 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.networkconnectivity.v1.PolicyBasedRoute.Filter; + + /** + * Decodes a Filter message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Filter + * @throws {Error} If the payload 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.networkconnectivity.v1.PolicyBasedRoute.Filter; + + /** + * Verifies a Filter message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Filter message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Filter + */ + public static fromObject(object: { [k: string]: any }): google.cloud.networkconnectivity.v1.PolicyBasedRoute.Filter; + + /** + * Creates a plain object from a Filter message. Also converts values to other types if specified. + * @param message Filter + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.networkconnectivity.v1.PolicyBasedRoute.Filter, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Filter to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Filter + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace Filter { + + /** ProtocolVersion enum. */ + enum ProtocolVersion { + PROTOCOL_VERSION_UNSPECIFIED = 0, + IPV4 = 1 + } + } + + /** Properties of a Warnings. */ + interface IWarnings { + + /** Warnings code */ + code?: (google.cloud.networkconnectivity.v1.PolicyBasedRoute.Warnings.Code|keyof typeof google.cloud.networkconnectivity.v1.PolicyBasedRoute.Warnings.Code|null); + + /** Warnings data */ + data?: ({ [k: string]: string }|null); + + /** Warnings warningMessage */ + warningMessage?: (string|null); + } + + /** Represents a Warnings. */ + class Warnings implements IWarnings { + + /** + * Constructs a new Warnings. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.networkconnectivity.v1.PolicyBasedRoute.IWarnings); + + /** Warnings code. */ + public code: (google.cloud.networkconnectivity.v1.PolicyBasedRoute.Warnings.Code|keyof typeof google.cloud.networkconnectivity.v1.PolicyBasedRoute.Warnings.Code); + + /** Warnings data. */ + public data: { [k: string]: string }; + + /** Warnings warningMessage. */ + public warningMessage: string; + + /** + * Creates a new Warnings instance using the specified properties. + * @param [properties] Properties to set + * @returns Warnings instance + */ + public static create(properties?: google.cloud.networkconnectivity.v1.PolicyBasedRoute.IWarnings): google.cloud.networkconnectivity.v1.PolicyBasedRoute.Warnings; + + /** + * Encodes the specified Warnings message. Does not implicitly {@link google.cloud.networkconnectivity.v1.PolicyBasedRoute.Warnings.verify|verify} messages. + * @param message Warnings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.networkconnectivity.v1.PolicyBasedRoute.IWarnings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Warnings message, length delimited. Does not implicitly {@link google.cloud.networkconnectivity.v1.PolicyBasedRoute.Warnings.verify|verify} messages. + * @param message Warnings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.networkconnectivity.v1.PolicyBasedRoute.IWarnings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Warnings message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Warnings + * @throws {Error} If the payload is not 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.networkconnectivity.v1.PolicyBasedRoute.Warnings; + + /** + * Decodes a Warnings message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Warnings + * @throws {Error} If the payload 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.networkconnectivity.v1.PolicyBasedRoute.Warnings; + + /** + * Verifies a Warnings message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Warnings message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Warnings + */ + public static fromObject(object: { [k: string]: any }): google.cloud.networkconnectivity.v1.PolicyBasedRoute.Warnings; + + /** + * Creates a plain object from a Warnings message. Also converts values to other types if specified. + * @param message Warnings + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.networkconnectivity.v1.PolicyBasedRoute.Warnings, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Warnings to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Warnings + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace Warnings { + + /** Code enum. */ + enum Code { + WARNING_UNSPECIFIED = 0, + RESOURCE_NOT_ACTIVE = 1, + RESOURCE_BEING_MODIFIED = 2 + } + } + + /** OtherRoutes enum. */ + enum OtherRoutes { + OTHER_ROUTES_UNSPECIFIED = 0, + DEFAULT_ROUTING = 1 + } + } + + /** Properties of a ListPolicyBasedRoutesRequest. */ + interface IListPolicyBasedRoutesRequest { + + /** ListPolicyBasedRoutesRequest parent */ + parent?: (string|null); + + /** ListPolicyBasedRoutesRequest pageSize */ + pageSize?: (number|null); + + /** ListPolicyBasedRoutesRequest pageToken */ + pageToken?: (string|null); + + /** ListPolicyBasedRoutesRequest filter */ + filter?: (string|null); + + /** ListPolicyBasedRoutesRequest orderBy */ + orderBy?: (string|null); + } + + /** Represents a ListPolicyBasedRoutesRequest. */ + class ListPolicyBasedRoutesRequest implements IListPolicyBasedRoutesRequest { + + /** + * Constructs a new ListPolicyBasedRoutesRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.networkconnectivity.v1.IListPolicyBasedRoutesRequest); + + /** ListPolicyBasedRoutesRequest parent. */ + public parent: string; + + /** ListPolicyBasedRoutesRequest pageSize. */ + public pageSize: number; + + /** ListPolicyBasedRoutesRequest pageToken. */ + public pageToken: string; + + /** ListPolicyBasedRoutesRequest filter. */ + public filter: string; + + /** ListPolicyBasedRoutesRequest orderBy. */ + public orderBy: string; + + /** + * Creates a new ListPolicyBasedRoutesRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ListPolicyBasedRoutesRequest instance + */ + public static create(properties?: google.cloud.networkconnectivity.v1.IListPolicyBasedRoutesRequest): google.cloud.networkconnectivity.v1.ListPolicyBasedRoutesRequest; + + /** + * Encodes the specified ListPolicyBasedRoutesRequest message. Does not implicitly {@link google.cloud.networkconnectivity.v1.ListPolicyBasedRoutesRequest.verify|verify} messages. + * @param message ListPolicyBasedRoutesRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.networkconnectivity.v1.IListPolicyBasedRoutesRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListPolicyBasedRoutesRequest message, length delimited. Does not implicitly {@link google.cloud.networkconnectivity.v1.ListPolicyBasedRoutesRequest.verify|verify} messages. + * @param message ListPolicyBasedRoutesRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.networkconnectivity.v1.IListPolicyBasedRoutesRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListPolicyBasedRoutesRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListPolicyBasedRoutesRequest + * @throws {Error} If the payload is not 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.networkconnectivity.v1.ListPolicyBasedRoutesRequest; + + /** + * Decodes a ListPolicyBasedRoutesRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListPolicyBasedRoutesRequest + * @throws {Error} If the payload 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.networkconnectivity.v1.ListPolicyBasedRoutesRequest; + + /** + * Verifies a ListPolicyBasedRoutesRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListPolicyBasedRoutesRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListPolicyBasedRoutesRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.networkconnectivity.v1.ListPolicyBasedRoutesRequest; + + /** + * Creates a plain object from a ListPolicyBasedRoutesRequest message. Also converts values to other types if specified. + * @param message ListPolicyBasedRoutesRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.networkconnectivity.v1.ListPolicyBasedRoutesRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListPolicyBasedRoutesRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListPolicyBasedRoutesRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListPolicyBasedRoutesResponse. */ + interface IListPolicyBasedRoutesResponse { + + /** ListPolicyBasedRoutesResponse policyBasedRoutes */ + policyBasedRoutes?: (google.cloud.networkconnectivity.v1.IPolicyBasedRoute[]|null); + + /** ListPolicyBasedRoutesResponse nextPageToken */ + nextPageToken?: (string|null); + + /** ListPolicyBasedRoutesResponse unreachable */ + unreachable?: (string[]|null); + } + + /** Represents a ListPolicyBasedRoutesResponse. */ + class ListPolicyBasedRoutesResponse implements IListPolicyBasedRoutesResponse { + + /** + * Constructs a new ListPolicyBasedRoutesResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.networkconnectivity.v1.IListPolicyBasedRoutesResponse); + + /** ListPolicyBasedRoutesResponse policyBasedRoutes. */ + public policyBasedRoutes: google.cloud.networkconnectivity.v1.IPolicyBasedRoute[]; + + /** ListPolicyBasedRoutesResponse nextPageToken. */ + public nextPageToken: string; + + /** ListPolicyBasedRoutesResponse unreachable. */ + public unreachable: string[]; + + /** + * Creates a new ListPolicyBasedRoutesResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ListPolicyBasedRoutesResponse instance + */ + public static create(properties?: google.cloud.networkconnectivity.v1.IListPolicyBasedRoutesResponse): google.cloud.networkconnectivity.v1.ListPolicyBasedRoutesResponse; + + /** + * Encodes the specified ListPolicyBasedRoutesResponse message. Does not implicitly {@link google.cloud.networkconnectivity.v1.ListPolicyBasedRoutesResponse.verify|verify} messages. + * @param message ListPolicyBasedRoutesResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.networkconnectivity.v1.IListPolicyBasedRoutesResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListPolicyBasedRoutesResponse message, length delimited. Does not implicitly {@link google.cloud.networkconnectivity.v1.ListPolicyBasedRoutesResponse.verify|verify} messages. + * @param message ListPolicyBasedRoutesResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.networkconnectivity.v1.IListPolicyBasedRoutesResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListPolicyBasedRoutesResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListPolicyBasedRoutesResponse + * @throws {Error} If the payload is not 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.networkconnectivity.v1.ListPolicyBasedRoutesResponse; + + /** + * Decodes a ListPolicyBasedRoutesResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListPolicyBasedRoutesResponse + * @throws {Error} If the payload 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.networkconnectivity.v1.ListPolicyBasedRoutesResponse; + + /** + * Verifies a ListPolicyBasedRoutesResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListPolicyBasedRoutesResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListPolicyBasedRoutesResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.networkconnectivity.v1.ListPolicyBasedRoutesResponse; + + /** + * Creates a plain object from a ListPolicyBasedRoutesResponse message. Also converts values to other types if specified. + * @param message ListPolicyBasedRoutesResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.networkconnectivity.v1.ListPolicyBasedRoutesResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListPolicyBasedRoutesResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListPolicyBasedRoutesResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a GetPolicyBasedRouteRequest. */ + interface IGetPolicyBasedRouteRequest { + + /** GetPolicyBasedRouteRequest name */ + name?: (string|null); + } + + /** Represents a GetPolicyBasedRouteRequest. */ + class GetPolicyBasedRouteRequest implements IGetPolicyBasedRouteRequest { + + /** + * Constructs a new GetPolicyBasedRouteRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.networkconnectivity.v1.IGetPolicyBasedRouteRequest); + + /** GetPolicyBasedRouteRequest name. */ + public name: string; + + /** + * Creates a new GetPolicyBasedRouteRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GetPolicyBasedRouteRequest instance + */ + public static create(properties?: google.cloud.networkconnectivity.v1.IGetPolicyBasedRouteRequest): google.cloud.networkconnectivity.v1.GetPolicyBasedRouteRequest; + + /** + * Encodes the specified GetPolicyBasedRouteRequest message. Does not implicitly {@link google.cloud.networkconnectivity.v1.GetPolicyBasedRouteRequest.verify|verify} messages. + * @param message GetPolicyBasedRouteRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.networkconnectivity.v1.IGetPolicyBasedRouteRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GetPolicyBasedRouteRequest message, length delimited. Does not implicitly {@link google.cloud.networkconnectivity.v1.GetPolicyBasedRouteRequest.verify|verify} messages. + * @param message GetPolicyBasedRouteRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.networkconnectivity.v1.IGetPolicyBasedRouteRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GetPolicyBasedRouteRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GetPolicyBasedRouteRequest + * @throws {Error} If the payload is not 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.networkconnectivity.v1.GetPolicyBasedRouteRequest; + + /** + * Decodes a GetPolicyBasedRouteRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GetPolicyBasedRouteRequest + * @throws {Error} If the payload 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.networkconnectivity.v1.GetPolicyBasedRouteRequest; + + /** + * Verifies a GetPolicyBasedRouteRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GetPolicyBasedRouteRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GetPolicyBasedRouteRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.networkconnectivity.v1.GetPolicyBasedRouteRequest; + + /** + * Creates a plain object from a GetPolicyBasedRouteRequest message. Also converts values to other types if specified. + * @param message GetPolicyBasedRouteRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.networkconnectivity.v1.GetPolicyBasedRouteRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GetPolicyBasedRouteRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GetPolicyBasedRouteRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a CreatePolicyBasedRouteRequest. */ + interface ICreatePolicyBasedRouteRequest { + + /** CreatePolicyBasedRouteRequest parent */ + parent?: (string|null); + + /** CreatePolicyBasedRouteRequest policyBasedRouteId */ + policyBasedRouteId?: (string|null); + + /** CreatePolicyBasedRouteRequest policyBasedRoute */ + policyBasedRoute?: (google.cloud.networkconnectivity.v1.IPolicyBasedRoute|null); + + /** CreatePolicyBasedRouteRequest requestId */ + requestId?: (string|null); + } + + /** Represents a CreatePolicyBasedRouteRequest. */ + class CreatePolicyBasedRouteRequest implements ICreatePolicyBasedRouteRequest { + + /** + * Constructs a new CreatePolicyBasedRouteRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.networkconnectivity.v1.ICreatePolicyBasedRouteRequest); + + /** CreatePolicyBasedRouteRequest parent. */ + public parent: string; + + /** CreatePolicyBasedRouteRequest policyBasedRouteId. */ + public policyBasedRouteId: string; + + /** CreatePolicyBasedRouteRequest policyBasedRoute. */ + public policyBasedRoute?: (google.cloud.networkconnectivity.v1.IPolicyBasedRoute|null); + + /** CreatePolicyBasedRouteRequest requestId. */ + public requestId: string; + + /** + * Creates a new CreatePolicyBasedRouteRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns CreatePolicyBasedRouteRequest instance + */ + public static create(properties?: google.cloud.networkconnectivity.v1.ICreatePolicyBasedRouteRequest): google.cloud.networkconnectivity.v1.CreatePolicyBasedRouteRequest; + + /** + * Encodes the specified CreatePolicyBasedRouteRequest message. Does not implicitly {@link google.cloud.networkconnectivity.v1.CreatePolicyBasedRouteRequest.verify|verify} messages. + * @param message CreatePolicyBasedRouteRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.networkconnectivity.v1.ICreatePolicyBasedRouteRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CreatePolicyBasedRouteRequest message, length delimited. Does not implicitly {@link google.cloud.networkconnectivity.v1.CreatePolicyBasedRouteRequest.verify|verify} messages. + * @param message CreatePolicyBasedRouteRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.networkconnectivity.v1.ICreatePolicyBasedRouteRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CreatePolicyBasedRouteRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CreatePolicyBasedRouteRequest + * @throws {Error} If the payload is not 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.networkconnectivity.v1.CreatePolicyBasedRouteRequest; + + /** + * Decodes a CreatePolicyBasedRouteRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CreatePolicyBasedRouteRequest + * @throws {Error} If the payload 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.networkconnectivity.v1.CreatePolicyBasedRouteRequest; + + /** + * Verifies a CreatePolicyBasedRouteRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CreatePolicyBasedRouteRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CreatePolicyBasedRouteRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.networkconnectivity.v1.CreatePolicyBasedRouteRequest; + + /** + * Creates a plain object from a CreatePolicyBasedRouteRequest message. Also converts values to other types if specified. + * @param message CreatePolicyBasedRouteRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.networkconnectivity.v1.CreatePolicyBasedRouteRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CreatePolicyBasedRouteRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CreatePolicyBasedRouteRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a DeletePolicyBasedRouteRequest. */ + interface IDeletePolicyBasedRouteRequest { + + /** DeletePolicyBasedRouteRequest name */ + name?: (string|null); + + /** DeletePolicyBasedRouteRequest requestId */ + requestId?: (string|null); + } + + /** Represents a DeletePolicyBasedRouteRequest. */ + class DeletePolicyBasedRouteRequest implements IDeletePolicyBasedRouteRequest { + + /** + * Constructs a new DeletePolicyBasedRouteRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.networkconnectivity.v1.IDeletePolicyBasedRouteRequest); + + /** DeletePolicyBasedRouteRequest name. */ + public name: string; + + /** DeletePolicyBasedRouteRequest requestId. */ + public requestId: string; + + /** + * Creates a new DeletePolicyBasedRouteRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns DeletePolicyBasedRouteRequest instance + */ + public static create(properties?: google.cloud.networkconnectivity.v1.IDeletePolicyBasedRouteRequest): google.cloud.networkconnectivity.v1.DeletePolicyBasedRouteRequest; + + /** + * Encodes the specified DeletePolicyBasedRouteRequest message. Does not implicitly {@link google.cloud.networkconnectivity.v1.DeletePolicyBasedRouteRequest.verify|verify} messages. + * @param message DeletePolicyBasedRouteRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.networkconnectivity.v1.IDeletePolicyBasedRouteRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DeletePolicyBasedRouteRequest message, length delimited. Does not implicitly {@link google.cloud.networkconnectivity.v1.DeletePolicyBasedRouteRequest.verify|verify} messages. + * @param message DeletePolicyBasedRouteRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.networkconnectivity.v1.IDeletePolicyBasedRouteRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DeletePolicyBasedRouteRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DeletePolicyBasedRouteRequest + * @throws {Error} If the payload is not 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.networkconnectivity.v1.DeletePolicyBasedRouteRequest; + + /** + * Decodes a DeletePolicyBasedRouteRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DeletePolicyBasedRouteRequest + * @throws {Error} If the payload 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.networkconnectivity.v1.DeletePolicyBasedRouteRequest; + + /** + * Verifies a DeletePolicyBasedRouteRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DeletePolicyBasedRouteRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DeletePolicyBasedRouteRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.networkconnectivity.v1.DeletePolicyBasedRouteRequest; + + /** + * Creates a plain object from a DeletePolicyBasedRouteRequest message. Also converts values to other types if specified. + * @param message DeletePolicyBasedRouteRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.networkconnectivity.v1.DeletePolicyBasedRouteRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DeletePolicyBasedRouteRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DeletePolicyBasedRouteRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } } /** Namespace v1alpha1. */ diff --git a/packages/google-cloud-networkconnectivity/protos/protos.js b/packages/google-cloud-networkconnectivity/protos/protos.js index f38b0afac1f..797396aa842 100644 --- a/packages/google-cloud-networkconnectivity/protos/protos.js +++ b/packages/google-cloud-networkconnectivity/protos/protos.js @@ -6430,6 +6430,3209 @@ return LocationMetadata; })(); + v1.PolicyBasedRoutingService = (function() { + + /** + * Constructs a new PolicyBasedRoutingService service. + * @memberof google.cloud.networkconnectivity.v1 + * @classdesc Represents a PolicyBasedRoutingService + * @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 PolicyBasedRoutingService(rpcImpl, requestDelimited, responseDelimited) { + $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); + } + + (PolicyBasedRoutingService.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = PolicyBasedRoutingService; + + /** + * Creates new PolicyBasedRoutingService service using the specified rpc implementation. + * @function create + * @memberof google.cloud.networkconnectivity.v1.PolicyBasedRoutingService + * @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 {PolicyBasedRoutingService} RPC service. Useful where requests and/or responses are streamed. + */ + PolicyBasedRoutingService.create = function create(rpcImpl, requestDelimited, responseDelimited) { + return new this(rpcImpl, requestDelimited, responseDelimited); + }; + + /** + * Callback as used by {@link google.cloud.networkconnectivity.v1.PolicyBasedRoutingService|listPolicyBasedRoutes}. + * @memberof google.cloud.networkconnectivity.v1.PolicyBasedRoutingService + * @typedef ListPolicyBasedRoutesCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.networkconnectivity.v1.ListPolicyBasedRoutesResponse} [response] ListPolicyBasedRoutesResponse + */ + + /** + * Calls ListPolicyBasedRoutes. + * @function listPolicyBasedRoutes + * @memberof google.cloud.networkconnectivity.v1.PolicyBasedRoutingService + * @instance + * @param {google.cloud.networkconnectivity.v1.IListPolicyBasedRoutesRequest} request ListPolicyBasedRoutesRequest message or plain object + * @param {google.cloud.networkconnectivity.v1.PolicyBasedRoutingService.ListPolicyBasedRoutesCallback} callback Node-style callback called with the error, if any, and ListPolicyBasedRoutesResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(PolicyBasedRoutingService.prototype.listPolicyBasedRoutes = function listPolicyBasedRoutes(request, callback) { + return this.rpcCall(listPolicyBasedRoutes, $root.google.cloud.networkconnectivity.v1.ListPolicyBasedRoutesRequest, $root.google.cloud.networkconnectivity.v1.ListPolicyBasedRoutesResponse, request, callback); + }, "name", { value: "ListPolicyBasedRoutes" }); + + /** + * Calls ListPolicyBasedRoutes. + * @function listPolicyBasedRoutes + * @memberof google.cloud.networkconnectivity.v1.PolicyBasedRoutingService + * @instance + * @param {google.cloud.networkconnectivity.v1.IListPolicyBasedRoutesRequest} request ListPolicyBasedRoutesRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.networkconnectivity.v1.PolicyBasedRoutingService|getPolicyBasedRoute}. + * @memberof google.cloud.networkconnectivity.v1.PolicyBasedRoutingService + * @typedef GetPolicyBasedRouteCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.networkconnectivity.v1.PolicyBasedRoute} [response] PolicyBasedRoute + */ + + /** + * Calls GetPolicyBasedRoute. + * @function getPolicyBasedRoute + * @memberof google.cloud.networkconnectivity.v1.PolicyBasedRoutingService + * @instance + * @param {google.cloud.networkconnectivity.v1.IGetPolicyBasedRouteRequest} request GetPolicyBasedRouteRequest message or plain object + * @param {google.cloud.networkconnectivity.v1.PolicyBasedRoutingService.GetPolicyBasedRouteCallback} callback Node-style callback called with the error, if any, and PolicyBasedRoute + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(PolicyBasedRoutingService.prototype.getPolicyBasedRoute = function getPolicyBasedRoute(request, callback) { + return this.rpcCall(getPolicyBasedRoute, $root.google.cloud.networkconnectivity.v1.GetPolicyBasedRouteRequest, $root.google.cloud.networkconnectivity.v1.PolicyBasedRoute, request, callback); + }, "name", { value: "GetPolicyBasedRoute" }); + + /** + * Calls GetPolicyBasedRoute. + * @function getPolicyBasedRoute + * @memberof google.cloud.networkconnectivity.v1.PolicyBasedRoutingService + * @instance + * @param {google.cloud.networkconnectivity.v1.IGetPolicyBasedRouteRequest} request GetPolicyBasedRouteRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.networkconnectivity.v1.PolicyBasedRoutingService|createPolicyBasedRoute}. + * @memberof google.cloud.networkconnectivity.v1.PolicyBasedRoutingService + * @typedef CreatePolicyBasedRouteCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls CreatePolicyBasedRoute. + * @function createPolicyBasedRoute + * @memberof google.cloud.networkconnectivity.v1.PolicyBasedRoutingService + * @instance + * @param {google.cloud.networkconnectivity.v1.ICreatePolicyBasedRouteRequest} request CreatePolicyBasedRouteRequest message or plain object + * @param {google.cloud.networkconnectivity.v1.PolicyBasedRoutingService.CreatePolicyBasedRouteCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(PolicyBasedRoutingService.prototype.createPolicyBasedRoute = function createPolicyBasedRoute(request, callback) { + return this.rpcCall(createPolicyBasedRoute, $root.google.cloud.networkconnectivity.v1.CreatePolicyBasedRouteRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "CreatePolicyBasedRoute" }); + + /** + * Calls CreatePolicyBasedRoute. + * @function createPolicyBasedRoute + * @memberof google.cloud.networkconnectivity.v1.PolicyBasedRoutingService + * @instance + * @param {google.cloud.networkconnectivity.v1.ICreatePolicyBasedRouteRequest} request CreatePolicyBasedRouteRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.networkconnectivity.v1.PolicyBasedRoutingService|deletePolicyBasedRoute}. + * @memberof google.cloud.networkconnectivity.v1.PolicyBasedRoutingService + * @typedef DeletePolicyBasedRouteCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls DeletePolicyBasedRoute. + * @function deletePolicyBasedRoute + * @memberof google.cloud.networkconnectivity.v1.PolicyBasedRoutingService + * @instance + * @param {google.cloud.networkconnectivity.v1.IDeletePolicyBasedRouteRequest} request DeletePolicyBasedRouteRequest message or plain object + * @param {google.cloud.networkconnectivity.v1.PolicyBasedRoutingService.DeletePolicyBasedRouteCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(PolicyBasedRoutingService.prototype.deletePolicyBasedRoute = function deletePolicyBasedRoute(request, callback) { + return this.rpcCall(deletePolicyBasedRoute, $root.google.cloud.networkconnectivity.v1.DeletePolicyBasedRouteRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "DeletePolicyBasedRoute" }); + + /** + * Calls DeletePolicyBasedRoute. + * @function deletePolicyBasedRoute + * @memberof google.cloud.networkconnectivity.v1.PolicyBasedRoutingService + * @instance + * @param {google.cloud.networkconnectivity.v1.IDeletePolicyBasedRouteRequest} request DeletePolicyBasedRouteRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + return PolicyBasedRoutingService; + })(); + + v1.PolicyBasedRoute = (function() { + + /** + * Properties of a PolicyBasedRoute. + * @memberof google.cloud.networkconnectivity.v1 + * @interface IPolicyBasedRoute + * @property {google.cloud.networkconnectivity.v1.PolicyBasedRoute.IVirtualMachine|null} [virtualMachine] PolicyBasedRoute virtualMachine + * @property {google.cloud.networkconnectivity.v1.PolicyBasedRoute.IInterconnectAttachment|null} [interconnectAttachment] PolicyBasedRoute interconnectAttachment + * @property {string|null} [nextHopIlbIp] PolicyBasedRoute nextHopIlbIp + * @property {google.cloud.networkconnectivity.v1.PolicyBasedRoute.OtherRoutes|null} [nextHopOtherRoutes] PolicyBasedRoute nextHopOtherRoutes + * @property {string|null} [name] PolicyBasedRoute name + * @property {google.protobuf.ITimestamp|null} [createTime] PolicyBasedRoute createTime + * @property {google.protobuf.ITimestamp|null} [updateTime] PolicyBasedRoute updateTime + * @property {Object.|null} [labels] PolicyBasedRoute labels + * @property {string|null} [description] PolicyBasedRoute description + * @property {string|null} [network] PolicyBasedRoute network + * @property {google.cloud.networkconnectivity.v1.PolicyBasedRoute.IFilter|null} [filter] PolicyBasedRoute filter + * @property {number|null} [priority] PolicyBasedRoute priority + * @property {Array.|null} [warnings] PolicyBasedRoute warnings + * @property {string|null} [selfLink] PolicyBasedRoute selfLink + * @property {string|null} [kind] PolicyBasedRoute kind + */ + + /** + * Constructs a new PolicyBasedRoute. + * @memberof google.cloud.networkconnectivity.v1 + * @classdesc Represents a PolicyBasedRoute. + * @implements IPolicyBasedRoute + * @constructor + * @param {google.cloud.networkconnectivity.v1.IPolicyBasedRoute=} [properties] Properties to set + */ + function PolicyBasedRoute(properties) { + this.labels = {}; + this.warnings = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * PolicyBasedRoute virtualMachine. + * @member {google.cloud.networkconnectivity.v1.PolicyBasedRoute.IVirtualMachine|null|undefined} virtualMachine + * @memberof google.cloud.networkconnectivity.v1.PolicyBasedRoute + * @instance + */ + PolicyBasedRoute.prototype.virtualMachine = null; + + /** + * PolicyBasedRoute interconnectAttachment. + * @member {google.cloud.networkconnectivity.v1.PolicyBasedRoute.IInterconnectAttachment|null|undefined} interconnectAttachment + * @memberof google.cloud.networkconnectivity.v1.PolicyBasedRoute + * @instance + */ + PolicyBasedRoute.prototype.interconnectAttachment = null; + + /** + * PolicyBasedRoute nextHopIlbIp. + * @member {string|null|undefined} nextHopIlbIp + * @memberof google.cloud.networkconnectivity.v1.PolicyBasedRoute + * @instance + */ + PolicyBasedRoute.prototype.nextHopIlbIp = null; + + /** + * PolicyBasedRoute nextHopOtherRoutes. + * @member {google.cloud.networkconnectivity.v1.PolicyBasedRoute.OtherRoutes|null|undefined} nextHopOtherRoutes + * @memberof google.cloud.networkconnectivity.v1.PolicyBasedRoute + * @instance + */ + PolicyBasedRoute.prototype.nextHopOtherRoutes = null; + + /** + * PolicyBasedRoute name. + * @member {string} name + * @memberof google.cloud.networkconnectivity.v1.PolicyBasedRoute + * @instance + */ + PolicyBasedRoute.prototype.name = ""; + + /** + * PolicyBasedRoute createTime. + * @member {google.protobuf.ITimestamp|null|undefined} createTime + * @memberof google.cloud.networkconnectivity.v1.PolicyBasedRoute + * @instance + */ + PolicyBasedRoute.prototype.createTime = null; + + /** + * PolicyBasedRoute updateTime. + * @member {google.protobuf.ITimestamp|null|undefined} updateTime + * @memberof google.cloud.networkconnectivity.v1.PolicyBasedRoute + * @instance + */ + PolicyBasedRoute.prototype.updateTime = null; + + /** + * PolicyBasedRoute labels. + * @member {Object.} labels + * @memberof google.cloud.networkconnectivity.v1.PolicyBasedRoute + * @instance + */ + PolicyBasedRoute.prototype.labels = $util.emptyObject; + + /** + * PolicyBasedRoute description. + * @member {string} description + * @memberof google.cloud.networkconnectivity.v1.PolicyBasedRoute + * @instance + */ + PolicyBasedRoute.prototype.description = ""; + + /** + * PolicyBasedRoute network. + * @member {string} network + * @memberof google.cloud.networkconnectivity.v1.PolicyBasedRoute + * @instance + */ + PolicyBasedRoute.prototype.network = ""; + + /** + * PolicyBasedRoute filter. + * @member {google.cloud.networkconnectivity.v1.PolicyBasedRoute.IFilter|null|undefined} filter + * @memberof google.cloud.networkconnectivity.v1.PolicyBasedRoute + * @instance + */ + PolicyBasedRoute.prototype.filter = null; + + /** + * PolicyBasedRoute priority. + * @member {number} priority + * @memberof google.cloud.networkconnectivity.v1.PolicyBasedRoute + * @instance + */ + PolicyBasedRoute.prototype.priority = 0; + + /** + * PolicyBasedRoute warnings. + * @member {Array.} warnings + * @memberof google.cloud.networkconnectivity.v1.PolicyBasedRoute + * @instance + */ + PolicyBasedRoute.prototype.warnings = $util.emptyArray; + + /** + * PolicyBasedRoute selfLink. + * @member {string} selfLink + * @memberof google.cloud.networkconnectivity.v1.PolicyBasedRoute + * @instance + */ + PolicyBasedRoute.prototype.selfLink = ""; + + /** + * PolicyBasedRoute kind. + * @member {string} kind + * @memberof google.cloud.networkconnectivity.v1.PolicyBasedRoute + * @instance + */ + PolicyBasedRoute.prototype.kind = ""; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * PolicyBasedRoute target. + * @member {"virtualMachine"|"interconnectAttachment"|undefined} target + * @memberof google.cloud.networkconnectivity.v1.PolicyBasedRoute + * @instance + */ + Object.defineProperty(PolicyBasedRoute.prototype, "target", { + get: $util.oneOfGetter($oneOfFields = ["virtualMachine", "interconnectAttachment"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * PolicyBasedRoute nextHop. + * @member {"nextHopIlbIp"|"nextHopOtherRoutes"|undefined} nextHop + * @memberof google.cloud.networkconnectivity.v1.PolicyBasedRoute + * @instance + */ + Object.defineProperty(PolicyBasedRoute.prototype, "nextHop", { + get: $util.oneOfGetter($oneOfFields = ["nextHopIlbIp", "nextHopOtherRoutes"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new PolicyBasedRoute instance using the specified properties. + * @function create + * @memberof google.cloud.networkconnectivity.v1.PolicyBasedRoute + * @static + * @param {google.cloud.networkconnectivity.v1.IPolicyBasedRoute=} [properties] Properties to set + * @returns {google.cloud.networkconnectivity.v1.PolicyBasedRoute} PolicyBasedRoute instance + */ + PolicyBasedRoute.create = function create(properties) { + return new PolicyBasedRoute(properties); + }; + + /** + * Encodes the specified PolicyBasedRoute message. Does not implicitly {@link google.cloud.networkconnectivity.v1.PolicyBasedRoute.verify|verify} messages. + * @function encode + * @memberof google.cloud.networkconnectivity.v1.PolicyBasedRoute + * @static + * @param {google.cloud.networkconnectivity.v1.IPolicyBasedRoute} message PolicyBasedRoute message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PolicyBasedRoute.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.createTime != null && Object.hasOwnProperty.call(message, "createTime")) + $root.google.protobuf.Timestamp.encode(message.createTime, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + 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(); + if (message.labels != null && Object.hasOwnProperty.call(message, "labels")) + for (var keys = Object.keys(message.labels), i = 0; i < keys.length; ++i) + writer.uint32(/* id 4, wireType 2 =*/34).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.labels[keys[i]]).ldelim(); + if (message.description != null && Object.hasOwnProperty.call(message, "description")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.description); + if (message.network != null && Object.hasOwnProperty.call(message, "network")) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.network); + if (message.interconnectAttachment != null && Object.hasOwnProperty.call(message, "interconnectAttachment")) + $root.google.cloud.networkconnectivity.v1.PolicyBasedRoute.InterconnectAttachment.encode(message.interconnectAttachment, writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim(); + if (message.filter != null && Object.hasOwnProperty.call(message, "filter")) + $root.google.cloud.networkconnectivity.v1.PolicyBasedRoute.Filter.encode(message.filter, writer.uint32(/* id 10, wireType 2 =*/82).fork()).ldelim(); + if (message.priority != null && Object.hasOwnProperty.call(message, "priority")) + writer.uint32(/* id 11, wireType 0 =*/88).int32(message.priority); + if (message.nextHopIlbIp != null && Object.hasOwnProperty.call(message, "nextHopIlbIp")) + writer.uint32(/* id 12, wireType 2 =*/98).string(message.nextHopIlbIp); + if (message.warnings != null && message.warnings.length) + for (var i = 0; i < message.warnings.length; ++i) + $root.google.cloud.networkconnectivity.v1.PolicyBasedRoute.Warnings.encode(message.warnings[i], writer.uint32(/* id 14, wireType 2 =*/114).fork()).ldelim(); + if (message.selfLink != null && Object.hasOwnProperty.call(message, "selfLink")) + writer.uint32(/* id 15, wireType 2 =*/122).string(message.selfLink); + if (message.kind != null && Object.hasOwnProperty.call(message, "kind")) + writer.uint32(/* id 16, wireType 2 =*/130).string(message.kind); + if (message.virtualMachine != null && Object.hasOwnProperty.call(message, "virtualMachine")) + $root.google.cloud.networkconnectivity.v1.PolicyBasedRoute.VirtualMachine.encode(message.virtualMachine, writer.uint32(/* id 18, wireType 2 =*/146).fork()).ldelim(); + if (message.nextHopOtherRoutes != null && Object.hasOwnProperty.call(message, "nextHopOtherRoutes")) + writer.uint32(/* id 21, wireType 0 =*/168).int32(message.nextHopOtherRoutes); + return writer; + }; + + /** + * Encodes the specified PolicyBasedRoute message, length delimited. Does not implicitly {@link google.cloud.networkconnectivity.v1.PolicyBasedRoute.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.networkconnectivity.v1.PolicyBasedRoute + * @static + * @param {google.cloud.networkconnectivity.v1.IPolicyBasedRoute} message PolicyBasedRoute message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PolicyBasedRoute.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a PolicyBasedRoute message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.networkconnectivity.v1.PolicyBasedRoute + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.networkconnectivity.v1.PolicyBasedRoute} PolicyBasedRoute + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PolicyBasedRoute.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.networkconnectivity.v1.PolicyBasedRoute(), key, value; + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 18: { + message.virtualMachine = $root.google.cloud.networkconnectivity.v1.PolicyBasedRoute.VirtualMachine.decode(reader, reader.uint32()); + break; + } + case 9: { + message.interconnectAttachment = $root.google.cloud.networkconnectivity.v1.PolicyBasedRoute.InterconnectAttachment.decode(reader, reader.uint32()); + break; + } + case 12: { + message.nextHopIlbIp = reader.string(); + break; + } + case 21: { + message.nextHopOtherRoutes = reader.int32(); + break; + } + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.createTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 3: { + message.updateTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 4: { + if (message.labels === $util.emptyObject) + message.labels = {}; + 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.labels[key] = value; + break; + } + case 5: { + message.description = reader.string(); + break; + } + case 6: { + message.network = reader.string(); + break; + } + case 10: { + message.filter = $root.google.cloud.networkconnectivity.v1.PolicyBasedRoute.Filter.decode(reader, reader.uint32()); + break; + } + case 11: { + message.priority = reader.int32(); + break; + } + case 14: { + if (!(message.warnings && message.warnings.length)) + message.warnings = []; + message.warnings.push($root.google.cloud.networkconnectivity.v1.PolicyBasedRoute.Warnings.decode(reader, reader.uint32())); + break; + } + case 15: { + message.selfLink = reader.string(); + break; + } + case 16: { + message.kind = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a PolicyBasedRoute message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.networkconnectivity.v1.PolicyBasedRoute + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.networkconnectivity.v1.PolicyBasedRoute} PolicyBasedRoute + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PolicyBasedRoute.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a PolicyBasedRoute message. + * @function verify + * @memberof google.cloud.networkconnectivity.v1.PolicyBasedRoute + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + PolicyBasedRoute.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.virtualMachine != null && message.hasOwnProperty("virtualMachine")) { + properties.target = 1; + { + var error = $root.google.cloud.networkconnectivity.v1.PolicyBasedRoute.VirtualMachine.verify(message.virtualMachine); + if (error) + return "virtualMachine." + error; + } + } + if (message.interconnectAttachment != null && message.hasOwnProperty("interconnectAttachment")) { + if (properties.target === 1) + return "target: multiple values"; + properties.target = 1; + { + var error = $root.google.cloud.networkconnectivity.v1.PolicyBasedRoute.InterconnectAttachment.verify(message.interconnectAttachment); + if (error) + return "interconnectAttachment." + error; + } + } + if (message.nextHopIlbIp != null && message.hasOwnProperty("nextHopIlbIp")) { + properties.nextHop = 1; + if (!$util.isString(message.nextHopIlbIp)) + return "nextHopIlbIp: string expected"; + } + if (message.nextHopOtherRoutes != null && message.hasOwnProperty("nextHopOtherRoutes")) { + if (properties.nextHop === 1) + return "nextHop: multiple values"; + properties.nextHop = 1; + switch (message.nextHopOtherRoutes) { + default: + return "nextHopOtherRoutes: enum value expected"; + case 0: + case 1: + break; + } + } + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + 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.labels != null && message.hasOwnProperty("labels")) { + if (!$util.isObject(message.labels)) + return "labels: object expected"; + var key = Object.keys(message.labels); + for (var i = 0; i < key.length; ++i) + if (!$util.isString(message.labels[key[i]])) + return "labels: string{k:string} expected"; + } + if (message.description != null && message.hasOwnProperty("description")) + if (!$util.isString(message.description)) + return "description: string expected"; + if (message.network != null && message.hasOwnProperty("network")) + if (!$util.isString(message.network)) + return "network: string expected"; + if (message.filter != null && message.hasOwnProperty("filter")) { + var error = $root.google.cloud.networkconnectivity.v1.PolicyBasedRoute.Filter.verify(message.filter); + if (error) + return "filter." + error; + } + if (message.priority != null && message.hasOwnProperty("priority")) + if (!$util.isInteger(message.priority)) + return "priority: integer expected"; + if (message.warnings != null && message.hasOwnProperty("warnings")) { + if (!Array.isArray(message.warnings)) + return "warnings: array expected"; + for (var i = 0; i < message.warnings.length; ++i) { + var error = $root.google.cloud.networkconnectivity.v1.PolicyBasedRoute.Warnings.verify(message.warnings[i]); + if (error) + return "warnings." + error; + } + } + if (message.selfLink != null && message.hasOwnProperty("selfLink")) + if (!$util.isString(message.selfLink)) + return "selfLink: string expected"; + if (message.kind != null && message.hasOwnProperty("kind")) + if (!$util.isString(message.kind)) + return "kind: string expected"; + return null; + }; + + /** + * Creates a PolicyBasedRoute message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.networkconnectivity.v1.PolicyBasedRoute + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.networkconnectivity.v1.PolicyBasedRoute} PolicyBasedRoute + */ + PolicyBasedRoute.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.networkconnectivity.v1.PolicyBasedRoute) + return object; + var message = new $root.google.cloud.networkconnectivity.v1.PolicyBasedRoute(); + if (object.virtualMachine != null) { + if (typeof object.virtualMachine !== "object") + throw TypeError(".google.cloud.networkconnectivity.v1.PolicyBasedRoute.virtualMachine: object expected"); + message.virtualMachine = $root.google.cloud.networkconnectivity.v1.PolicyBasedRoute.VirtualMachine.fromObject(object.virtualMachine); + } + if (object.interconnectAttachment != null) { + if (typeof object.interconnectAttachment !== "object") + throw TypeError(".google.cloud.networkconnectivity.v1.PolicyBasedRoute.interconnectAttachment: object expected"); + message.interconnectAttachment = $root.google.cloud.networkconnectivity.v1.PolicyBasedRoute.InterconnectAttachment.fromObject(object.interconnectAttachment); + } + if (object.nextHopIlbIp != null) + message.nextHopIlbIp = String(object.nextHopIlbIp); + switch (object.nextHopOtherRoutes) { + default: + if (typeof object.nextHopOtherRoutes === "number") { + message.nextHopOtherRoutes = object.nextHopOtherRoutes; + break; + } + break; + case "OTHER_ROUTES_UNSPECIFIED": + case 0: + message.nextHopOtherRoutes = 0; + break; + case "DEFAULT_ROUTING": + case 1: + message.nextHopOtherRoutes = 1; + break; + } + if (object.name != null) + message.name = String(object.name); + if (object.createTime != null) { + if (typeof object.createTime !== "object") + throw TypeError(".google.cloud.networkconnectivity.v1.PolicyBasedRoute.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.networkconnectivity.v1.PolicyBasedRoute.updateTime: object expected"); + message.updateTime = $root.google.protobuf.Timestamp.fromObject(object.updateTime); + } + if (object.labels) { + if (typeof object.labels !== "object") + throw TypeError(".google.cloud.networkconnectivity.v1.PolicyBasedRoute.labels: object expected"); + message.labels = {}; + for (var keys = Object.keys(object.labels), i = 0; i < keys.length; ++i) + message.labels[keys[i]] = String(object.labels[keys[i]]); + } + if (object.description != null) + message.description = String(object.description); + if (object.network != null) + message.network = String(object.network); + if (object.filter != null) { + if (typeof object.filter !== "object") + throw TypeError(".google.cloud.networkconnectivity.v1.PolicyBasedRoute.filter: object expected"); + message.filter = $root.google.cloud.networkconnectivity.v1.PolicyBasedRoute.Filter.fromObject(object.filter); + } + if (object.priority != null) + message.priority = object.priority | 0; + if (object.warnings) { + if (!Array.isArray(object.warnings)) + throw TypeError(".google.cloud.networkconnectivity.v1.PolicyBasedRoute.warnings: array expected"); + message.warnings = []; + for (var i = 0; i < object.warnings.length; ++i) { + if (typeof object.warnings[i] !== "object") + throw TypeError(".google.cloud.networkconnectivity.v1.PolicyBasedRoute.warnings: object expected"); + message.warnings[i] = $root.google.cloud.networkconnectivity.v1.PolicyBasedRoute.Warnings.fromObject(object.warnings[i]); + } + } + if (object.selfLink != null) + message.selfLink = String(object.selfLink); + if (object.kind != null) + message.kind = String(object.kind); + return message; + }; + + /** + * Creates a plain object from a PolicyBasedRoute message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.networkconnectivity.v1.PolicyBasedRoute + * @static + * @param {google.cloud.networkconnectivity.v1.PolicyBasedRoute} message PolicyBasedRoute + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + PolicyBasedRoute.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.warnings = []; + if (options.objects || options.defaults) + object.labels = {}; + if (options.defaults) { + object.name = ""; + object.createTime = null; + object.updateTime = null; + object.description = ""; + object.network = ""; + object.filter = null; + object.priority = 0; + object.selfLink = ""; + object.kind = ""; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + 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); + var keys2; + if (message.labels && (keys2 = Object.keys(message.labels)).length) { + object.labels = {}; + for (var j = 0; j < keys2.length; ++j) + object.labels[keys2[j]] = message.labels[keys2[j]]; + } + if (message.description != null && message.hasOwnProperty("description")) + object.description = message.description; + if (message.network != null && message.hasOwnProperty("network")) + object.network = message.network; + if (message.interconnectAttachment != null && message.hasOwnProperty("interconnectAttachment")) { + object.interconnectAttachment = $root.google.cloud.networkconnectivity.v1.PolicyBasedRoute.InterconnectAttachment.toObject(message.interconnectAttachment, options); + if (options.oneofs) + object.target = "interconnectAttachment"; + } + if (message.filter != null && message.hasOwnProperty("filter")) + object.filter = $root.google.cloud.networkconnectivity.v1.PolicyBasedRoute.Filter.toObject(message.filter, options); + if (message.priority != null && message.hasOwnProperty("priority")) + object.priority = message.priority; + if (message.nextHopIlbIp != null && message.hasOwnProperty("nextHopIlbIp")) { + object.nextHopIlbIp = message.nextHopIlbIp; + if (options.oneofs) + object.nextHop = "nextHopIlbIp"; + } + if (message.warnings && message.warnings.length) { + object.warnings = []; + for (var j = 0; j < message.warnings.length; ++j) + object.warnings[j] = $root.google.cloud.networkconnectivity.v1.PolicyBasedRoute.Warnings.toObject(message.warnings[j], options); + } + if (message.selfLink != null && message.hasOwnProperty("selfLink")) + object.selfLink = message.selfLink; + if (message.kind != null && message.hasOwnProperty("kind")) + object.kind = message.kind; + if (message.virtualMachine != null && message.hasOwnProperty("virtualMachine")) { + object.virtualMachine = $root.google.cloud.networkconnectivity.v1.PolicyBasedRoute.VirtualMachine.toObject(message.virtualMachine, options); + if (options.oneofs) + object.target = "virtualMachine"; + } + if (message.nextHopOtherRoutes != null && message.hasOwnProperty("nextHopOtherRoutes")) { + object.nextHopOtherRoutes = options.enums === String ? $root.google.cloud.networkconnectivity.v1.PolicyBasedRoute.OtherRoutes[message.nextHopOtherRoutes] === undefined ? message.nextHopOtherRoutes : $root.google.cloud.networkconnectivity.v1.PolicyBasedRoute.OtherRoutes[message.nextHopOtherRoutes] : message.nextHopOtherRoutes; + if (options.oneofs) + object.nextHop = "nextHopOtherRoutes"; + } + return object; + }; + + /** + * Converts this PolicyBasedRoute to JSON. + * @function toJSON + * @memberof google.cloud.networkconnectivity.v1.PolicyBasedRoute + * @instance + * @returns {Object.} JSON object + */ + PolicyBasedRoute.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for PolicyBasedRoute + * @function getTypeUrl + * @memberof google.cloud.networkconnectivity.v1.PolicyBasedRoute + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + PolicyBasedRoute.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.networkconnectivity.v1.PolicyBasedRoute"; + }; + + PolicyBasedRoute.VirtualMachine = (function() { + + /** + * Properties of a VirtualMachine. + * @memberof google.cloud.networkconnectivity.v1.PolicyBasedRoute + * @interface IVirtualMachine + * @property {Array.|null} [tags] VirtualMachine tags + */ + + /** + * Constructs a new VirtualMachine. + * @memberof google.cloud.networkconnectivity.v1.PolicyBasedRoute + * @classdesc Represents a VirtualMachine. + * @implements IVirtualMachine + * @constructor + * @param {google.cloud.networkconnectivity.v1.PolicyBasedRoute.IVirtualMachine=} [properties] Properties to set + */ + function VirtualMachine(properties) { + this.tags = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * VirtualMachine tags. + * @member {Array.} tags + * @memberof google.cloud.networkconnectivity.v1.PolicyBasedRoute.VirtualMachine + * @instance + */ + VirtualMachine.prototype.tags = $util.emptyArray; + + /** + * Creates a new VirtualMachine instance using the specified properties. + * @function create + * @memberof google.cloud.networkconnectivity.v1.PolicyBasedRoute.VirtualMachine + * @static + * @param {google.cloud.networkconnectivity.v1.PolicyBasedRoute.IVirtualMachine=} [properties] Properties to set + * @returns {google.cloud.networkconnectivity.v1.PolicyBasedRoute.VirtualMachine} VirtualMachine instance + */ + VirtualMachine.create = function create(properties) { + return new VirtualMachine(properties); + }; + + /** + * Encodes the specified VirtualMachine message. Does not implicitly {@link google.cloud.networkconnectivity.v1.PolicyBasedRoute.VirtualMachine.verify|verify} messages. + * @function encode + * @memberof google.cloud.networkconnectivity.v1.PolicyBasedRoute.VirtualMachine + * @static + * @param {google.cloud.networkconnectivity.v1.PolicyBasedRoute.IVirtualMachine} message VirtualMachine message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + VirtualMachine.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.tags != null && message.tags.length) + for (var i = 0; i < message.tags.length; ++i) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.tags[i]); + return writer; + }; + + /** + * Encodes the specified VirtualMachine message, length delimited. Does not implicitly {@link google.cloud.networkconnectivity.v1.PolicyBasedRoute.VirtualMachine.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.networkconnectivity.v1.PolicyBasedRoute.VirtualMachine + * @static + * @param {google.cloud.networkconnectivity.v1.PolicyBasedRoute.IVirtualMachine} message VirtualMachine message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + VirtualMachine.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a VirtualMachine message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.networkconnectivity.v1.PolicyBasedRoute.VirtualMachine + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.networkconnectivity.v1.PolicyBasedRoute.VirtualMachine} VirtualMachine + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + VirtualMachine.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.networkconnectivity.v1.PolicyBasedRoute.VirtualMachine(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.tags && message.tags.length)) + message.tags = []; + message.tags.push(reader.string()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a VirtualMachine message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.networkconnectivity.v1.PolicyBasedRoute.VirtualMachine + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.networkconnectivity.v1.PolicyBasedRoute.VirtualMachine} VirtualMachine + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + VirtualMachine.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a VirtualMachine message. + * @function verify + * @memberof google.cloud.networkconnectivity.v1.PolicyBasedRoute.VirtualMachine + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + VirtualMachine.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.tags != null && message.hasOwnProperty("tags")) { + if (!Array.isArray(message.tags)) + return "tags: array expected"; + for (var i = 0; i < message.tags.length; ++i) + if (!$util.isString(message.tags[i])) + return "tags: string[] expected"; + } + return null; + }; + + /** + * Creates a VirtualMachine message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.networkconnectivity.v1.PolicyBasedRoute.VirtualMachine + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.networkconnectivity.v1.PolicyBasedRoute.VirtualMachine} VirtualMachine + */ + VirtualMachine.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.networkconnectivity.v1.PolicyBasedRoute.VirtualMachine) + return object; + var message = new $root.google.cloud.networkconnectivity.v1.PolicyBasedRoute.VirtualMachine(); + if (object.tags) { + if (!Array.isArray(object.tags)) + throw TypeError(".google.cloud.networkconnectivity.v1.PolicyBasedRoute.VirtualMachine.tags: array expected"); + message.tags = []; + for (var i = 0; i < object.tags.length; ++i) + message.tags[i] = String(object.tags[i]); + } + return message; + }; + + /** + * Creates a plain object from a VirtualMachine message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.networkconnectivity.v1.PolicyBasedRoute.VirtualMachine + * @static + * @param {google.cloud.networkconnectivity.v1.PolicyBasedRoute.VirtualMachine} message VirtualMachine + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + VirtualMachine.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.tags = []; + if (message.tags && message.tags.length) { + object.tags = []; + for (var j = 0; j < message.tags.length; ++j) + object.tags[j] = message.tags[j]; + } + return object; + }; + + /** + * Converts this VirtualMachine to JSON. + * @function toJSON + * @memberof google.cloud.networkconnectivity.v1.PolicyBasedRoute.VirtualMachine + * @instance + * @returns {Object.} JSON object + */ + VirtualMachine.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for VirtualMachine + * @function getTypeUrl + * @memberof google.cloud.networkconnectivity.v1.PolicyBasedRoute.VirtualMachine + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + VirtualMachine.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.networkconnectivity.v1.PolicyBasedRoute.VirtualMachine"; + }; + + return VirtualMachine; + })(); + + PolicyBasedRoute.InterconnectAttachment = (function() { + + /** + * Properties of an InterconnectAttachment. + * @memberof google.cloud.networkconnectivity.v1.PolicyBasedRoute + * @interface IInterconnectAttachment + * @property {string|null} [region] InterconnectAttachment region + */ + + /** + * Constructs a new InterconnectAttachment. + * @memberof google.cloud.networkconnectivity.v1.PolicyBasedRoute + * @classdesc Represents an InterconnectAttachment. + * @implements IInterconnectAttachment + * @constructor + * @param {google.cloud.networkconnectivity.v1.PolicyBasedRoute.IInterconnectAttachment=} [properties] Properties to set + */ + function InterconnectAttachment(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * InterconnectAttachment region. + * @member {string} region + * @memberof google.cloud.networkconnectivity.v1.PolicyBasedRoute.InterconnectAttachment + * @instance + */ + InterconnectAttachment.prototype.region = ""; + + /** + * Creates a new InterconnectAttachment instance using the specified properties. + * @function create + * @memberof google.cloud.networkconnectivity.v1.PolicyBasedRoute.InterconnectAttachment + * @static + * @param {google.cloud.networkconnectivity.v1.PolicyBasedRoute.IInterconnectAttachment=} [properties] Properties to set + * @returns {google.cloud.networkconnectivity.v1.PolicyBasedRoute.InterconnectAttachment} InterconnectAttachment instance + */ + InterconnectAttachment.create = function create(properties) { + return new InterconnectAttachment(properties); + }; + + /** + * Encodes the specified InterconnectAttachment message. Does not implicitly {@link google.cloud.networkconnectivity.v1.PolicyBasedRoute.InterconnectAttachment.verify|verify} messages. + * @function encode + * @memberof google.cloud.networkconnectivity.v1.PolicyBasedRoute.InterconnectAttachment + * @static + * @param {google.cloud.networkconnectivity.v1.PolicyBasedRoute.IInterconnectAttachment} message InterconnectAttachment message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + InterconnectAttachment.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.region != null && Object.hasOwnProperty.call(message, "region")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.region); + return writer; + }; + + /** + * Encodes the specified InterconnectAttachment message, length delimited. Does not implicitly {@link google.cloud.networkconnectivity.v1.PolicyBasedRoute.InterconnectAttachment.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.networkconnectivity.v1.PolicyBasedRoute.InterconnectAttachment + * @static + * @param {google.cloud.networkconnectivity.v1.PolicyBasedRoute.IInterconnectAttachment} message InterconnectAttachment message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + InterconnectAttachment.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an InterconnectAttachment message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.networkconnectivity.v1.PolicyBasedRoute.InterconnectAttachment + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.networkconnectivity.v1.PolicyBasedRoute.InterconnectAttachment} InterconnectAttachment + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + InterconnectAttachment.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.networkconnectivity.v1.PolicyBasedRoute.InterconnectAttachment(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.region = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an InterconnectAttachment message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.networkconnectivity.v1.PolicyBasedRoute.InterconnectAttachment + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.networkconnectivity.v1.PolicyBasedRoute.InterconnectAttachment} InterconnectAttachment + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + InterconnectAttachment.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an InterconnectAttachment message. + * @function verify + * @memberof google.cloud.networkconnectivity.v1.PolicyBasedRoute.InterconnectAttachment + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + InterconnectAttachment.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.region != null && message.hasOwnProperty("region")) + if (!$util.isString(message.region)) + return "region: string expected"; + return null; + }; + + /** + * Creates an InterconnectAttachment message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.networkconnectivity.v1.PolicyBasedRoute.InterconnectAttachment + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.networkconnectivity.v1.PolicyBasedRoute.InterconnectAttachment} InterconnectAttachment + */ + InterconnectAttachment.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.networkconnectivity.v1.PolicyBasedRoute.InterconnectAttachment) + return object; + var message = new $root.google.cloud.networkconnectivity.v1.PolicyBasedRoute.InterconnectAttachment(); + if (object.region != null) + message.region = String(object.region); + return message; + }; + + /** + * Creates a plain object from an InterconnectAttachment message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.networkconnectivity.v1.PolicyBasedRoute.InterconnectAttachment + * @static + * @param {google.cloud.networkconnectivity.v1.PolicyBasedRoute.InterconnectAttachment} message InterconnectAttachment + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + InterconnectAttachment.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.region = ""; + if (message.region != null && message.hasOwnProperty("region")) + object.region = message.region; + return object; + }; + + /** + * Converts this InterconnectAttachment to JSON. + * @function toJSON + * @memberof google.cloud.networkconnectivity.v1.PolicyBasedRoute.InterconnectAttachment + * @instance + * @returns {Object.} JSON object + */ + InterconnectAttachment.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for InterconnectAttachment + * @function getTypeUrl + * @memberof google.cloud.networkconnectivity.v1.PolicyBasedRoute.InterconnectAttachment + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + InterconnectAttachment.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.networkconnectivity.v1.PolicyBasedRoute.InterconnectAttachment"; + }; + + return InterconnectAttachment; + })(); + + PolicyBasedRoute.Filter = (function() { + + /** + * Properties of a Filter. + * @memberof google.cloud.networkconnectivity.v1.PolicyBasedRoute + * @interface IFilter + * @property {string|null} [ipProtocol] Filter ipProtocol + * @property {string|null} [srcRange] Filter srcRange + * @property {string|null} [destRange] Filter destRange + * @property {google.cloud.networkconnectivity.v1.PolicyBasedRoute.Filter.ProtocolVersion|null} [protocolVersion] Filter protocolVersion + */ + + /** + * Constructs a new Filter. + * @memberof google.cloud.networkconnectivity.v1.PolicyBasedRoute + * @classdesc Represents a Filter. + * @implements IFilter + * @constructor + * @param {google.cloud.networkconnectivity.v1.PolicyBasedRoute.IFilter=} [properties] Properties to set + */ + function Filter(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Filter ipProtocol. + * @member {string} ipProtocol + * @memberof google.cloud.networkconnectivity.v1.PolicyBasedRoute.Filter + * @instance + */ + Filter.prototype.ipProtocol = ""; + + /** + * Filter srcRange. + * @member {string} srcRange + * @memberof google.cloud.networkconnectivity.v1.PolicyBasedRoute.Filter + * @instance + */ + Filter.prototype.srcRange = ""; + + /** + * Filter destRange. + * @member {string} destRange + * @memberof google.cloud.networkconnectivity.v1.PolicyBasedRoute.Filter + * @instance + */ + Filter.prototype.destRange = ""; + + /** + * Filter protocolVersion. + * @member {google.cloud.networkconnectivity.v1.PolicyBasedRoute.Filter.ProtocolVersion} protocolVersion + * @memberof google.cloud.networkconnectivity.v1.PolicyBasedRoute.Filter + * @instance + */ + Filter.prototype.protocolVersion = 0; + + /** + * Creates a new Filter instance using the specified properties. + * @function create + * @memberof google.cloud.networkconnectivity.v1.PolicyBasedRoute.Filter + * @static + * @param {google.cloud.networkconnectivity.v1.PolicyBasedRoute.IFilter=} [properties] Properties to set + * @returns {google.cloud.networkconnectivity.v1.PolicyBasedRoute.Filter} Filter instance + */ + Filter.create = function create(properties) { + return new Filter(properties); + }; + + /** + * Encodes the specified Filter message. Does not implicitly {@link google.cloud.networkconnectivity.v1.PolicyBasedRoute.Filter.verify|verify} messages. + * @function encode + * @memberof google.cloud.networkconnectivity.v1.PolicyBasedRoute.Filter + * @static + * @param {google.cloud.networkconnectivity.v1.PolicyBasedRoute.IFilter} message Filter message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Filter.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.ipProtocol != null && Object.hasOwnProperty.call(message, "ipProtocol")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.ipProtocol); + if (message.srcRange != null && Object.hasOwnProperty.call(message, "srcRange")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.srcRange); + if (message.destRange != null && Object.hasOwnProperty.call(message, "destRange")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.destRange); + if (message.protocolVersion != null && Object.hasOwnProperty.call(message, "protocolVersion")) + writer.uint32(/* id 6, wireType 0 =*/48).int32(message.protocolVersion); + return writer; + }; + + /** + * Encodes the specified Filter message, length delimited. Does not implicitly {@link google.cloud.networkconnectivity.v1.PolicyBasedRoute.Filter.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.networkconnectivity.v1.PolicyBasedRoute.Filter + * @static + * @param {google.cloud.networkconnectivity.v1.PolicyBasedRoute.IFilter} message Filter message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Filter.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Filter message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.networkconnectivity.v1.PolicyBasedRoute.Filter + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.networkconnectivity.v1.PolicyBasedRoute.Filter} Filter + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Filter.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.networkconnectivity.v1.PolicyBasedRoute.Filter(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.ipProtocol = reader.string(); + break; + } + case 2: { + message.srcRange = reader.string(); + break; + } + case 3: { + message.destRange = reader.string(); + break; + } + case 6: { + message.protocolVersion = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Filter message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.networkconnectivity.v1.PolicyBasedRoute.Filter + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.networkconnectivity.v1.PolicyBasedRoute.Filter} Filter + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Filter.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Filter message. + * @function verify + * @memberof google.cloud.networkconnectivity.v1.PolicyBasedRoute.Filter + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Filter.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.ipProtocol != null && message.hasOwnProperty("ipProtocol")) + if (!$util.isString(message.ipProtocol)) + return "ipProtocol: string expected"; + if (message.srcRange != null && message.hasOwnProperty("srcRange")) + if (!$util.isString(message.srcRange)) + return "srcRange: string expected"; + if (message.destRange != null && message.hasOwnProperty("destRange")) + if (!$util.isString(message.destRange)) + return "destRange: string expected"; + if (message.protocolVersion != null && message.hasOwnProperty("protocolVersion")) + switch (message.protocolVersion) { + default: + return "protocolVersion: enum value expected"; + case 0: + case 1: + break; + } + return null; + }; + + /** + * Creates a Filter message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.networkconnectivity.v1.PolicyBasedRoute.Filter + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.networkconnectivity.v1.PolicyBasedRoute.Filter} Filter + */ + Filter.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.networkconnectivity.v1.PolicyBasedRoute.Filter) + return object; + var message = new $root.google.cloud.networkconnectivity.v1.PolicyBasedRoute.Filter(); + if (object.ipProtocol != null) + message.ipProtocol = String(object.ipProtocol); + if (object.srcRange != null) + message.srcRange = String(object.srcRange); + if (object.destRange != null) + message.destRange = String(object.destRange); + switch (object.protocolVersion) { + default: + if (typeof object.protocolVersion === "number") { + message.protocolVersion = object.protocolVersion; + break; + } + break; + case "PROTOCOL_VERSION_UNSPECIFIED": + case 0: + message.protocolVersion = 0; + break; + case "IPV4": + case 1: + message.protocolVersion = 1; + break; + } + return message; + }; + + /** + * Creates a plain object from a Filter message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.networkconnectivity.v1.PolicyBasedRoute.Filter + * @static + * @param {google.cloud.networkconnectivity.v1.PolicyBasedRoute.Filter} message Filter + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Filter.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.ipProtocol = ""; + object.srcRange = ""; + object.destRange = ""; + object.protocolVersion = options.enums === String ? "PROTOCOL_VERSION_UNSPECIFIED" : 0; + } + if (message.ipProtocol != null && message.hasOwnProperty("ipProtocol")) + object.ipProtocol = message.ipProtocol; + if (message.srcRange != null && message.hasOwnProperty("srcRange")) + object.srcRange = message.srcRange; + if (message.destRange != null && message.hasOwnProperty("destRange")) + object.destRange = message.destRange; + if (message.protocolVersion != null && message.hasOwnProperty("protocolVersion")) + object.protocolVersion = options.enums === String ? $root.google.cloud.networkconnectivity.v1.PolicyBasedRoute.Filter.ProtocolVersion[message.protocolVersion] === undefined ? message.protocolVersion : $root.google.cloud.networkconnectivity.v1.PolicyBasedRoute.Filter.ProtocolVersion[message.protocolVersion] : message.protocolVersion; + return object; + }; + + /** + * Converts this Filter to JSON. + * @function toJSON + * @memberof google.cloud.networkconnectivity.v1.PolicyBasedRoute.Filter + * @instance + * @returns {Object.} JSON object + */ + Filter.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Filter + * @function getTypeUrl + * @memberof google.cloud.networkconnectivity.v1.PolicyBasedRoute.Filter + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Filter.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.networkconnectivity.v1.PolicyBasedRoute.Filter"; + }; + + /** + * ProtocolVersion enum. + * @name google.cloud.networkconnectivity.v1.PolicyBasedRoute.Filter.ProtocolVersion + * @enum {number} + * @property {number} PROTOCOL_VERSION_UNSPECIFIED=0 PROTOCOL_VERSION_UNSPECIFIED value + * @property {number} IPV4=1 IPV4 value + */ + Filter.ProtocolVersion = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "PROTOCOL_VERSION_UNSPECIFIED"] = 0; + values[valuesById[1] = "IPV4"] = 1; + return values; + })(); + + return Filter; + })(); + + PolicyBasedRoute.Warnings = (function() { + + /** + * Properties of a Warnings. + * @memberof google.cloud.networkconnectivity.v1.PolicyBasedRoute + * @interface IWarnings + * @property {google.cloud.networkconnectivity.v1.PolicyBasedRoute.Warnings.Code|null} [code] Warnings code + * @property {Object.|null} [data] Warnings data + * @property {string|null} [warningMessage] Warnings warningMessage + */ + + /** + * Constructs a new Warnings. + * @memberof google.cloud.networkconnectivity.v1.PolicyBasedRoute + * @classdesc Represents a Warnings. + * @implements IWarnings + * @constructor + * @param {google.cloud.networkconnectivity.v1.PolicyBasedRoute.IWarnings=} [properties] Properties to set + */ + function Warnings(properties) { + this.data = {}; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Warnings code. + * @member {google.cloud.networkconnectivity.v1.PolicyBasedRoute.Warnings.Code} code + * @memberof google.cloud.networkconnectivity.v1.PolicyBasedRoute.Warnings + * @instance + */ + Warnings.prototype.code = 0; + + /** + * Warnings data. + * @member {Object.} data + * @memberof google.cloud.networkconnectivity.v1.PolicyBasedRoute.Warnings + * @instance + */ + Warnings.prototype.data = $util.emptyObject; + + /** + * Warnings warningMessage. + * @member {string} warningMessage + * @memberof google.cloud.networkconnectivity.v1.PolicyBasedRoute.Warnings + * @instance + */ + Warnings.prototype.warningMessage = ""; + + /** + * Creates a new Warnings instance using the specified properties. + * @function create + * @memberof google.cloud.networkconnectivity.v1.PolicyBasedRoute.Warnings + * @static + * @param {google.cloud.networkconnectivity.v1.PolicyBasedRoute.IWarnings=} [properties] Properties to set + * @returns {google.cloud.networkconnectivity.v1.PolicyBasedRoute.Warnings} Warnings instance + */ + Warnings.create = function create(properties) { + return new Warnings(properties); + }; + + /** + * Encodes the specified Warnings message. Does not implicitly {@link google.cloud.networkconnectivity.v1.PolicyBasedRoute.Warnings.verify|verify} messages. + * @function encode + * @memberof google.cloud.networkconnectivity.v1.PolicyBasedRoute.Warnings + * @static + * @param {google.cloud.networkconnectivity.v1.PolicyBasedRoute.IWarnings} message Warnings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Warnings.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.data != null && Object.hasOwnProperty.call(message, "data")) + for (var keys = Object.keys(message.data), 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.data[keys[i]]).ldelim(); + if (message.warningMessage != null && Object.hasOwnProperty.call(message, "warningMessage")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.warningMessage); + return writer; + }; + + /** + * Encodes the specified Warnings message, length delimited. Does not implicitly {@link google.cloud.networkconnectivity.v1.PolicyBasedRoute.Warnings.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.networkconnectivity.v1.PolicyBasedRoute.Warnings + * @static + * @param {google.cloud.networkconnectivity.v1.PolicyBasedRoute.IWarnings} message Warnings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Warnings.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Warnings message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.networkconnectivity.v1.PolicyBasedRoute.Warnings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.networkconnectivity.v1.PolicyBasedRoute.Warnings} Warnings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Warnings.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.networkconnectivity.v1.PolicyBasedRoute.Warnings(), key, value; + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.code = reader.int32(); + break; + } + case 2: { + if (message.data === $util.emptyObject) + message.data = {}; + 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.data[key] = value; + break; + } + case 3: { + message.warningMessage = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Warnings message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.networkconnectivity.v1.PolicyBasedRoute.Warnings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.networkconnectivity.v1.PolicyBasedRoute.Warnings} Warnings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Warnings.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Warnings message. + * @function verify + * @memberof google.cloud.networkconnectivity.v1.PolicyBasedRoute.Warnings + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Warnings.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.code != null && message.hasOwnProperty("code")) + switch (message.code) { + default: + return "code: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.data != null && message.hasOwnProperty("data")) { + if (!$util.isObject(message.data)) + return "data: object expected"; + var key = Object.keys(message.data); + for (var i = 0; i < key.length; ++i) + if (!$util.isString(message.data[key[i]])) + return "data: string{k:string} expected"; + } + if (message.warningMessage != null && message.hasOwnProperty("warningMessage")) + if (!$util.isString(message.warningMessage)) + return "warningMessage: string expected"; + return null; + }; + + /** + * Creates a Warnings message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.networkconnectivity.v1.PolicyBasedRoute.Warnings + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.networkconnectivity.v1.PolicyBasedRoute.Warnings} Warnings + */ + Warnings.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.networkconnectivity.v1.PolicyBasedRoute.Warnings) + return object; + var message = new $root.google.cloud.networkconnectivity.v1.PolicyBasedRoute.Warnings(); + switch (object.code) { + default: + if (typeof object.code === "number") { + message.code = object.code; + break; + } + break; + case "WARNING_UNSPECIFIED": + case 0: + message.code = 0; + break; + case "RESOURCE_NOT_ACTIVE": + case 1: + message.code = 1; + break; + case "RESOURCE_BEING_MODIFIED": + case 2: + message.code = 2; + break; + } + if (object.data) { + if (typeof object.data !== "object") + throw TypeError(".google.cloud.networkconnectivity.v1.PolicyBasedRoute.Warnings.data: object expected"); + message.data = {}; + for (var keys = Object.keys(object.data), i = 0; i < keys.length; ++i) + message.data[keys[i]] = String(object.data[keys[i]]); + } + if (object.warningMessage != null) + message.warningMessage = String(object.warningMessage); + return message; + }; + + /** + * Creates a plain object from a Warnings message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.networkconnectivity.v1.PolicyBasedRoute.Warnings + * @static + * @param {google.cloud.networkconnectivity.v1.PolicyBasedRoute.Warnings} message Warnings + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Warnings.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.objects || options.defaults) + object.data = {}; + if (options.defaults) { + object.code = options.enums === String ? "WARNING_UNSPECIFIED" : 0; + object.warningMessage = ""; + } + if (message.code != null && message.hasOwnProperty("code")) + object.code = options.enums === String ? $root.google.cloud.networkconnectivity.v1.PolicyBasedRoute.Warnings.Code[message.code] === undefined ? message.code : $root.google.cloud.networkconnectivity.v1.PolicyBasedRoute.Warnings.Code[message.code] : message.code; + var keys2; + if (message.data && (keys2 = Object.keys(message.data)).length) { + object.data = {}; + for (var j = 0; j < keys2.length; ++j) + object.data[keys2[j]] = message.data[keys2[j]]; + } + if (message.warningMessage != null && message.hasOwnProperty("warningMessage")) + object.warningMessage = message.warningMessage; + return object; + }; + + /** + * Converts this Warnings to JSON. + * @function toJSON + * @memberof google.cloud.networkconnectivity.v1.PolicyBasedRoute.Warnings + * @instance + * @returns {Object.} JSON object + */ + Warnings.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Warnings + * @function getTypeUrl + * @memberof google.cloud.networkconnectivity.v1.PolicyBasedRoute.Warnings + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Warnings.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.networkconnectivity.v1.PolicyBasedRoute.Warnings"; + }; + + /** + * Code enum. + * @name google.cloud.networkconnectivity.v1.PolicyBasedRoute.Warnings.Code + * @enum {number} + * @property {number} WARNING_UNSPECIFIED=0 WARNING_UNSPECIFIED value + * @property {number} RESOURCE_NOT_ACTIVE=1 RESOURCE_NOT_ACTIVE value + * @property {number} RESOURCE_BEING_MODIFIED=2 RESOURCE_BEING_MODIFIED value + */ + Warnings.Code = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "WARNING_UNSPECIFIED"] = 0; + values[valuesById[1] = "RESOURCE_NOT_ACTIVE"] = 1; + values[valuesById[2] = "RESOURCE_BEING_MODIFIED"] = 2; + return values; + })(); + + return Warnings; + })(); + + /** + * OtherRoutes enum. + * @name google.cloud.networkconnectivity.v1.PolicyBasedRoute.OtherRoutes + * @enum {number} + * @property {number} OTHER_ROUTES_UNSPECIFIED=0 OTHER_ROUTES_UNSPECIFIED value + * @property {number} DEFAULT_ROUTING=1 DEFAULT_ROUTING value + */ + PolicyBasedRoute.OtherRoutes = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "OTHER_ROUTES_UNSPECIFIED"] = 0; + values[valuesById[1] = "DEFAULT_ROUTING"] = 1; + return values; + })(); + + return PolicyBasedRoute; + })(); + + v1.ListPolicyBasedRoutesRequest = (function() { + + /** + * Properties of a ListPolicyBasedRoutesRequest. + * @memberof google.cloud.networkconnectivity.v1 + * @interface IListPolicyBasedRoutesRequest + * @property {string|null} [parent] ListPolicyBasedRoutesRequest parent + * @property {number|null} [pageSize] ListPolicyBasedRoutesRequest pageSize + * @property {string|null} [pageToken] ListPolicyBasedRoutesRequest pageToken + * @property {string|null} [filter] ListPolicyBasedRoutesRequest filter + * @property {string|null} [orderBy] ListPolicyBasedRoutesRequest orderBy + */ + + /** + * Constructs a new ListPolicyBasedRoutesRequest. + * @memberof google.cloud.networkconnectivity.v1 + * @classdesc Represents a ListPolicyBasedRoutesRequest. + * @implements IListPolicyBasedRoutesRequest + * @constructor + * @param {google.cloud.networkconnectivity.v1.IListPolicyBasedRoutesRequest=} [properties] Properties to set + */ + function ListPolicyBasedRoutesRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListPolicyBasedRoutesRequest parent. + * @member {string} parent + * @memberof google.cloud.networkconnectivity.v1.ListPolicyBasedRoutesRequest + * @instance + */ + ListPolicyBasedRoutesRequest.prototype.parent = ""; + + /** + * ListPolicyBasedRoutesRequest pageSize. + * @member {number} pageSize + * @memberof google.cloud.networkconnectivity.v1.ListPolicyBasedRoutesRequest + * @instance + */ + ListPolicyBasedRoutesRequest.prototype.pageSize = 0; + + /** + * ListPolicyBasedRoutesRequest pageToken. + * @member {string} pageToken + * @memberof google.cloud.networkconnectivity.v1.ListPolicyBasedRoutesRequest + * @instance + */ + ListPolicyBasedRoutesRequest.prototype.pageToken = ""; + + /** + * ListPolicyBasedRoutesRequest filter. + * @member {string} filter + * @memberof google.cloud.networkconnectivity.v1.ListPolicyBasedRoutesRequest + * @instance + */ + ListPolicyBasedRoutesRequest.prototype.filter = ""; + + /** + * ListPolicyBasedRoutesRequest orderBy. + * @member {string} orderBy + * @memberof google.cloud.networkconnectivity.v1.ListPolicyBasedRoutesRequest + * @instance + */ + ListPolicyBasedRoutesRequest.prototype.orderBy = ""; + + /** + * Creates a new ListPolicyBasedRoutesRequest instance using the specified properties. + * @function create + * @memberof google.cloud.networkconnectivity.v1.ListPolicyBasedRoutesRequest + * @static + * @param {google.cloud.networkconnectivity.v1.IListPolicyBasedRoutesRequest=} [properties] Properties to set + * @returns {google.cloud.networkconnectivity.v1.ListPolicyBasedRoutesRequest} ListPolicyBasedRoutesRequest instance + */ + ListPolicyBasedRoutesRequest.create = function create(properties) { + return new ListPolicyBasedRoutesRequest(properties); + }; + + /** + * Encodes the specified ListPolicyBasedRoutesRequest message. Does not implicitly {@link google.cloud.networkconnectivity.v1.ListPolicyBasedRoutesRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.networkconnectivity.v1.ListPolicyBasedRoutesRequest + * @static + * @param {google.cloud.networkconnectivity.v1.IListPolicyBasedRoutesRequest} message ListPolicyBasedRoutesRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListPolicyBasedRoutesRequest.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.filter != null && Object.hasOwnProperty.call(message, "filter")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.filter); + if (message.orderBy != null && Object.hasOwnProperty.call(message, "orderBy")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.orderBy); + return writer; + }; + + /** + * Encodes the specified ListPolicyBasedRoutesRequest message, length delimited. Does not implicitly {@link google.cloud.networkconnectivity.v1.ListPolicyBasedRoutesRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.networkconnectivity.v1.ListPolicyBasedRoutesRequest + * @static + * @param {google.cloud.networkconnectivity.v1.IListPolicyBasedRoutesRequest} message ListPolicyBasedRoutesRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListPolicyBasedRoutesRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListPolicyBasedRoutesRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.networkconnectivity.v1.ListPolicyBasedRoutesRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.networkconnectivity.v1.ListPolicyBasedRoutesRequest} ListPolicyBasedRoutesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListPolicyBasedRoutesRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.networkconnectivity.v1.ListPolicyBasedRoutesRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + 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.filter = reader.string(); + break; + } + case 5: { + message.orderBy = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListPolicyBasedRoutesRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.networkconnectivity.v1.ListPolicyBasedRoutesRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.networkconnectivity.v1.ListPolicyBasedRoutesRequest} ListPolicyBasedRoutesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListPolicyBasedRoutesRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListPolicyBasedRoutesRequest message. + * @function verify + * @memberof google.cloud.networkconnectivity.v1.ListPolicyBasedRoutesRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListPolicyBasedRoutesRequest.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.filter != null && message.hasOwnProperty("filter")) + if (!$util.isString(message.filter)) + return "filter: string expected"; + if (message.orderBy != null && message.hasOwnProperty("orderBy")) + if (!$util.isString(message.orderBy)) + return "orderBy: string expected"; + return null; + }; + + /** + * Creates a ListPolicyBasedRoutesRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.networkconnectivity.v1.ListPolicyBasedRoutesRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.networkconnectivity.v1.ListPolicyBasedRoutesRequest} ListPolicyBasedRoutesRequest + */ + ListPolicyBasedRoutesRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.networkconnectivity.v1.ListPolicyBasedRoutesRequest) + return object; + var message = new $root.google.cloud.networkconnectivity.v1.ListPolicyBasedRoutesRequest(); + 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.filter != null) + message.filter = String(object.filter); + if (object.orderBy != null) + message.orderBy = String(object.orderBy); + return message; + }; + + /** + * Creates a plain object from a ListPolicyBasedRoutesRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.networkconnectivity.v1.ListPolicyBasedRoutesRequest + * @static + * @param {google.cloud.networkconnectivity.v1.ListPolicyBasedRoutesRequest} message ListPolicyBasedRoutesRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListPolicyBasedRoutesRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.pageSize = 0; + object.pageToken = ""; + object.filter = ""; + object.orderBy = ""; + } + 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.filter != null && message.hasOwnProperty("filter")) + object.filter = message.filter; + if (message.orderBy != null && message.hasOwnProperty("orderBy")) + object.orderBy = message.orderBy; + return object; + }; + + /** + * Converts this ListPolicyBasedRoutesRequest to JSON. + * @function toJSON + * @memberof google.cloud.networkconnectivity.v1.ListPolicyBasedRoutesRequest + * @instance + * @returns {Object.} JSON object + */ + ListPolicyBasedRoutesRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListPolicyBasedRoutesRequest + * @function getTypeUrl + * @memberof google.cloud.networkconnectivity.v1.ListPolicyBasedRoutesRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListPolicyBasedRoutesRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.networkconnectivity.v1.ListPolicyBasedRoutesRequest"; + }; + + return ListPolicyBasedRoutesRequest; + })(); + + v1.ListPolicyBasedRoutesResponse = (function() { + + /** + * Properties of a ListPolicyBasedRoutesResponse. + * @memberof google.cloud.networkconnectivity.v1 + * @interface IListPolicyBasedRoutesResponse + * @property {Array.|null} [policyBasedRoutes] ListPolicyBasedRoutesResponse policyBasedRoutes + * @property {string|null} [nextPageToken] ListPolicyBasedRoutesResponse nextPageToken + * @property {Array.|null} [unreachable] ListPolicyBasedRoutesResponse unreachable + */ + + /** + * Constructs a new ListPolicyBasedRoutesResponse. + * @memberof google.cloud.networkconnectivity.v1 + * @classdesc Represents a ListPolicyBasedRoutesResponse. + * @implements IListPolicyBasedRoutesResponse + * @constructor + * @param {google.cloud.networkconnectivity.v1.IListPolicyBasedRoutesResponse=} [properties] Properties to set + */ + function ListPolicyBasedRoutesResponse(properties) { + this.policyBasedRoutes = []; + this.unreachable = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListPolicyBasedRoutesResponse policyBasedRoutes. + * @member {Array.} policyBasedRoutes + * @memberof google.cloud.networkconnectivity.v1.ListPolicyBasedRoutesResponse + * @instance + */ + ListPolicyBasedRoutesResponse.prototype.policyBasedRoutes = $util.emptyArray; + + /** + * ListPolicyBasedRoutesResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.cloud.networkconnectivity.v1.ListPolicyBasedRoutesResponse + * @instance + */ + ListPolicyBasedRoutesResponse.prototype.nextPageToken = ""; + + /** + * ListPolicyBasedRoutesResponse unreachable. + * @member {Array.} unreachable + * @memberof google.cloud.networkconnectivity.v1.ListPolicyBasedRoutesResponse + * @instance + */ + ListPolicyBasedRoutesResponse.prototype.unreachable = $util.emptyArray; + + /** + * Creates a new ListPolicyBasedRoutesResponse instance using the specified properties. + * @function create + * @memberof google.cloud.networkconnectivity.v1.ListPolicyBasedRoutesResponse + * @static + * @param {google.cloud.networkconnectivity.v1.IListPolicyBasedRoutesResponse=} [properties] Properties to set + * @returns {google.cloud.networkconnectivity.v1.ListPolicyBasedRoutesResponse} ListPolicyBasedRoutesResponse instance + */ + ListPolicyBasedRoutesResponse.create = function create(properties) { + return new ListPolicyBasedRoutesResponse(properties); + }; + + /** + * Encodes the specified ListPolicyBasedRoutesResponse message. Does not implicitly {@link google.cloud.networkconnectivity.v1.ListPolicyBasedRoutesResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.networkconnectivity.v1.ListPolicyBasedRoutesResponse + * @static + * @param {google.cloud.networkconnectivity.v1.IListPolicyBasedRoutesResponse} message ListPolicyBasedRoutesResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListPolicyBasedRoutesResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.policyBasedRoutes != null && message.policyBasedRoutes.length) + for (var i = 0; i < message.policyBasedRoutes.length; ++i) + $root.google.cloud.networkconnectivity.v1.PolicyBasedRoute.encode(message.policyBasedRoutes[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); + if (message.unreachable != null && message.unreachable.length) + for (var i = 0; i < message.unreachable.length; ++i) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.unreachable[i]); + return writer; + }; + + /** + * Encodes the specified ListPolicyBasedRoutesResponse message, length delimited. Does not implicitly {@link google.cloud.networkconnectivity.v1.ListPolicyBasedRoutesResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.networkconnectivity.v1.ListPolicyBasedRoutesResponse + * @static + * @param {google.cloud.networkconnectivity.v1.IListPolicyBasedRoutesResponse} message ListPolicyBasedRoutesResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListPolicyBasedRoutesResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListPolicyBasedRoutesResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.networkconnectivity.v1.ListPolicyBasedRoutesResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.networkconnectivity.v1.ListPolicyBasedRoutesResponse} ListPolicyBasedRoutesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListPolicyBasedRoutesResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.networkconnectivity.v1.ListPolicyBasedRoutesResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.policyBasedRoutes && message.policyBasedRoutes.length)) + message.policyBasedRoutes = []; + message.policyBasedRoutes.push($root.google.cloud.networkconnectivity.v1.PolicyBasedRoute.decode(reader, reader.uint32())); + break; + } + case 2: { + message.nextPageToken = reader.string(); + break; + } + case 3: { + if (!(message.unreachable && message.unreachable.length)) + message.unreachable = []; + message.unreachable.push(reader.string()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListPolicyBasedRoutesResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.networkconnectivity.v1.ListPolicyBasedRoutesResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.networkconnectivity.v1.ListPolicyBasedRoutesResponse} ListPolicyBasedRoutesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListPolicyBasedRoutesResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListPolicyBasedRoutesResponse message. + * @function verify + * @memberof google.cloud.networkconnectivity.v1.ListPolicyBasedRoutesResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListPolicyBasedRoutesResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.policyBasedRoutes != null && message.hasOwnProperty("policyBasedRoutes")) { + if (!Array.isArray(message.policyBasedRoutes)) + return "policyBasedRoutes: array expected"; + for (var i = 0; i < message.policyBasedRoutes.length; ++i) { + var error = $root.google.cloud.networkconnectivity.v1.PolicyBasedRoute.verify(message.policyBasedRoutes[i]); + if (error) + return "policyBasedRoutes." + error; + } + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + if (message.unreachable != null && message.hasOwnProperty("unreachable")) { + if (!Array.isArray(message.unreachable)) + return "unreachable: array expected"; + for (var i = 0; i < message.unreachable.length; ++i) + if (!$util.isString(message.unreachable[i])) + return "unreachable: string[] expected"; + } + return null; + }; + + /** + * Creates a ListPolicyBasedRoutesResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.networkconnectivity.v1.ListPolicyBasedRoutesResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.networkconnectivity.v1.ListPolicyBasedRoutesResponse} ListPolicyBasedRoutesResponse + */ + ListPolicyBasedRoutesResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.networkconnectivity.v1.ListPolicyBasedRoutesResponse) + return object; + var message = new $root.google.cloud.networkconnectivity.v1.ListPolicyBasedRoutesResponse(); + if (object.policyBasedRoutes) { + if (!Array.isArray(object.policyBasedRoutes)) + throw TypeError(".google.cloud.networkconnectivity.v1.ListPolicyBasedRoutesResponse.policyBasedRoutes: array expected"); + message.policyBasedRoutes = []; + for (var i = 0; i < object.policyBasedRoutes.length; ++i) { + if (typeof object.policyBasedRoutes[i] !== "object") + throw TypeError(".google.cloud.networkconnectivity.v1.ListPolicyBasedRoutesResponse.policyBasedRoutes: object expected"); + message.policyBasedRoutes[i] = $root.google.cloud.networkconnectivity.v1.PolicyBasedRoute.fromObject(object.policyBasedRoutes[i]); + } + } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + if (object.unreachable) { + if (!Array.isArray(object.unreachable)) + throw TypeError(".google.cloud.networkconnectivity.v1.ListPolicyBasedRoutesResponse.unreachable: array expected"); + message.unreachable = []; + for (var i = 0; i < object.unreachable.length; ++i) + message.unreachable[i] = String(object.unreachable[i]); + } + return message; + }; + + /** + * Creates a plain object from a ListPolicyBasedRoutesResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.networkconnectivity.v1.ListPolicyBasedRoutesResponse + * @static + * @param {google.cloud.networkconnectivity.v1.ListPolicyBasedRoutesResponse} message ListPolicyBasedRoutesResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListPolicyBasedRoutesResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.policyBasedRoutes = []; + object.unreachable = []; + } + if (options.defaults) + object.nextPageToken = ""; + if (message.policyBasedRoutes && message.policyBasedRoutes.length) { + object.policyBasedRoutes = []; + for (var j = 0; j < message.policyBasedRoutes.length; ++j) + object.policyBasedRoutes[j] = $root.google.cloud.networkconnectivity.v1.PolicyBasedRoute.toObject(message.policyBasedRoutes[j], options); + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + object.nextPageToken = message.nextPageToken; + if (message.unreachable && message.unreachable.length) { + object.unreachable = []; + for (var j = 0; j < message.unreachable.length; ++j) + object.unreachable[j] = message.unreachable[j]; + } + return object; + }; + + /** + * Converts this ListPolicyBasedRoutesResponse to JSON. + * @function toJSON + * @memberof google.cloud.networkconnectivity.v1.ListPolicyBasedRoutesResponse + * @instance + * @returns {Object.} JSON object + */ + ListPolicyBasedRoutesResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListPolicyBasedRoutesResponse + * @function getTypeUrl + * @memberof google.cloud.networkconnectivity.v1.ListPolicyBasedRoutesResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListPolicyBasedRoutesResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.networkconnectivity.v1.ListPolicyBasedRoutesResponse"; + }; + + return ListPolicyBasedRoutesResponse; + })(); + + v1.GetPolicyBasedRouteRequest = (function() { + + /** + * Properties of a GetPolicyBasedRouteRequest. + * @memberof google.cloud.networkconnectivity.v1 + * @interface IGetPolicyBasedRouteRequest + * @property {string|null} [name] GetPolicyBasedRouteRequest name + */ + + /** + * Constructs a new GetPolicyBasedRouteRequest. + * @memberof google.cloud.networkconnectivity.v1 + * @classdesc Represents a GetPolicyBasedRouteRequest. + * @implements IGetPolicyBasedRouteRequest + * @constructor + * @param {google.cloud.networkconnectivity.v1.IGetPolicyBasedRouteRequest=} [properties] Properties to set + */ + function GetPolicyBasedRouteRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetPolicyBasedRouteRequest name. + * @member {string} name + * @memberof google.cloud.networkconnectivity.v1.GetPolicyBasedRouteRequest + * @instance + */ + GetPolicyBasedRouteRequest.prototype.name = ""; + + /** + * Creates a new GetPolicyBasedRouteRequest instance using the specified properties. + * @function create + * @memberof google.cloud.networkconnectivity.v1.GetPolicyBasedRouteRequest + * @static + * @param {google.cloud.networkconnectivity.v1.IGetPolicyBasedRouteRequest=} [properties] Properties to set + * @returns {google.cloud.networkconnectivity.v1.GetPolicyBasedRouteRequest} GetPolicyBasedRouteRequest instance + */ + GetPolicyBasedRouteRequest.create = function create(properties) { + return new GetPolicyBasedRouteRequest(properties); + }; + + /** + * Encodes the specified GetPolicyBasedRouteRequest message. Does not implicitly {@link google.cloud.networkconnectivity.v1.GetPolicyBasedRouteRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.networkconnectivity.v1.GetPolicyBasedRouteRequest + * @static + * @param {google.cloud.networkconnectivity.v1.IGetPolicyBasedRouteRequest} message GetPolicyBasedRouteRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetPolicyBasedRouteRequest.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 GetPolicyBasedRouteRequest message, length delimited. Does not implicitly {@link google.cloud.networkconnectivity.v1.GetPolicyBasedRouteRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.networkconnectivity.v1.GetPolicyBasedRouteRequest + * @static + * @param {google.cloud.networkconnectivity.v1.IGetPolicyBasedRouteRequest} message GetPolicyBasedRouteRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetPolicyBasedRouteRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetPolicyBasedRouteRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.networkconnectivity.v1.GetPolicyBasedRouteRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.networkconnectivity.v1.GetPolicyBasedRouteRequest} GetPolicyBasedRouteRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetPolicyBasedRouteRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.networkconnectivity.v1.GetPolicyBasedRouteRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetPolicyBasedRouteRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.networkconnectivity.v1.GetPolicyBasedRouteRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.networkconnectivity.v1.GetPolicyBasedRouteRequest} GetPolicyBasedRouteRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetPolicyBasedRouteRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetPolicyBasedRouteRequest message. + * @function verify + * @memberof google.cloud.networkconnectivity.v1.GetPolicyBasedRouteRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetPolicyBasedRouteRequest.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 GetPolicyBasedRouteRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.networkconnectivity.v1.GetPolicyBasedRouteRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.networkconnectivity.v1.GetPolicyBasedRouteRequest} GetPolicyBasedRouteRequest + */ + GetPolicyBasedRouteRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.networkconnectivity.v1.GetPolicyBasedRouteRequest) + return object; + var message = new $root.google.cloud.networkconnectivity.v1.GetPolicyBasedRouteRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a GetPolicyBasedRouteRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.networkconnectivity.v1.GetPolicyBasedRouteRequest + * @static + * @param {google.cloud.networkconnectivity.v1.GetPolicyBasedRouteRequest} message GetPolicyBasedRouteRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetPolicyBasedRouteRequest.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 GetPolicyBasedRouteRequest to JSON. + * @function toJSON + * @memberof google.cloud.networkconnectivity.v1.GetPolicyBasedRouteRequest + * @instance + * @returns {Object.} JSON object + */ + GetPolicyBasedRouteRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GetPolicyBasedRouteRequest + * @function getTypeUrl + * @memberof google.cloud.networkconnectivity.v1.GetPolicyBasedRouteRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GetPolicyBasedRouteRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.networkconnectivity.v1.GetPolicyBasedRouteRequest"; + }; + + return GetPolicyBasedRouteRequest; + })(); + + v1.CreatePolicyBasedRouteRequest = (function() { + + /** + * Properties of a CreatePolicyBasedRouteRequest. + * @memberof google.cloud.networkconnectivity.v1 + * @interface ICreatePolicyBasedRouteRequest + * @property {string|null} [parent] CreatePolicyBasedRouteRequest parent + * @property {string|null} [policyBasedRouteId] CreatePolicyBasedRouteRequest policyBasedRouteId + * @property {google.cloud.networkconnectivity.v1.IPolicyBasedRoute|null} [policyBasedRoute] CreatePolicyBasedRouteRequest policyBasedRoute + * @property {string|null} [requestId] CreatePolicyBasedRouteRequest requestId + */ + + /** + * Constructs a new CreatePolicyBasedRouteRequest. + * @memberof google.cloud.networkconnectivity.v1 + * @classdesc Represents a CreatePolicyBasedRouteRequest. + * @implements ICreatePolicyBasedRouteRequest + * @constructor + * @param {google.cloud.networkconnectivity.v1.ICreatePolicyBasedRouteRequest=} [properties] Properties to set + */ + function CreatePolicyBasedRouteRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * CreatePolicyBasedRouteRequest parent. + * @member {string} parent + * @memberof google.cloud.networkconnectivity.v1.CreatePolicyBasedRouteRequest + * @instance + */ + CreatePolicyBasedRouteRequest.prototype.parent = ""; + + /** + * CreatePolicyBasedRouteRequest policyBasedRouteId. + * @member {string} policyBasedRouteId + * @memberof google.cloud.networkconnectivity.v1.CreatePolicyBasedRouteRequest + * @instance + */ + CreatePolicyBasedRouteRequest.prototype.policyBasedRouteId = ""; + + /** + * CreatePolicyBasedRouteRequest policyBasedRoute. + * @member {google.cloud.networkconnectivity.v1.IPolicyBasedRoute|null|undefined} policyBasedRoute + * @memberof google.cloud.networkconnectivity.v1.CreatePolicyBasedRouteRequest + * @instance + */ + CreatePolicyBasedRouteRequest.prototype.policyBasedRoute = null; + + /** + * CreatePolicyBasedRouteRequest requestId. + * @member {string} requestId + * @memberof google.cloud.networkconnectivity.v1.CreatePolicyBasedRouteRequest + * @instance + */ + CreatePolicyBasedRouteRequest.prototype.requestId = ""; + + /** + * Creates a new CreatePolicyBasedRouteRequest instance using the specified properties. + * @function create + * @memberof google.cloud.networkconnectivity.v1.CreatePolicyBasedRouteRequest + * @static + * @param {google.cloud.networkconnectivity.v1.ICreatePolicyBasedRouteRequest=} [properties] Properties to set + * @returns {google.cloud.networkconnectivity.v1.CreatePolicyBasedRouteRequest} CreatePolicyBasedRouteRequest instance + */ + CreatePolicyBasedRouteRequest.create = function create(properties) { + return new CreatePolicyBasedRouteRequest(properties); + }; + + /** + * Encodes the specified CreatePolicyBasedRouteRequest message. Does not implicitly {@link google.cloud.networkconnectivity.v1.CreatePolicyBasedRouteRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.networkconnectivity.v1.CreatePolicyBasedRouteRequest + * @static + * @param {google.cloud.networkconnectivity.v1.ICreatePolicyBasedRouteRequest} message CreatePolicyBasedRouteRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreatePolicyBasedRouteRequest.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.policyBasedRouteId != null && Object.hasOwnProperty.call(message, "policyBasedRouteId")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.policyBasedRouteId); + if (message.policyBasedRoute != null && Object.hasOwnProperty.call(message, "policyBasedRoute")) + $root.google.cloud.networkconnectivity.v1.PolicyBasedRoute.encode(message.policyBasedRoute, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.requestId); + return writer; + }; + + /** + * Encodes the specified CreatePolicyBasedRouteRequest message, length delimited. Does not implicitly {@link google.cloud.networkconnectivity.v1.CreatePolicyBasedRouteRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.networkconnectivity.v1.CreatePolicyBasedRouteRequest + * @static + * @param {google.cloud.networkconnectivity.v1.ICreatePolicyBasedRouteRequest} message CreatePolicyBasedRouteRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreatePolicyBasedRouteRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CreatePolicyBasedRouteRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.networkconnectivity.v1.CreatePolicyBasedRouteRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.networkconnectivity.v1.CreatePolicyBasedRouteRequest} CreatePolicyBasedRouteRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreatePolicyBasedRouteRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.networkconnectivity.v1.CreatePolicyBasedRouteRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.policyBasedRouteId = reader.string(); + break; + } + case 3: { + message.policyBasedRoute = $root.google.cloud.networkconnectivity.v1.PolicyBasedRoute.decode(reader, reader.uint32()); + break; + } + case 4: { + message.requestId = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CreatePolicyBasedRouteRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.networkconnectivity.v1.CreatePolicyBasedRouteRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.networkconnectivity.v1.CreatePolicyBasedRouteRequest} CreatePolicyBasedRouteRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreatePolicyBasedRouteRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CreatePolicyBasedRouteRequest message. + * @function verify + * @memberof google.cloud.networkconnectivity.v1.CreatePolicyBasedRouteRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CreatePolicyBasedRouteRequest.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.policyBasedRouteId != null && message.hasOwnProperty("policyBasedRouteId")) + if (!$util.isString(message.policyBasedRouteId)) + return "policyBasedRouteId: string expected"; + if (message.policyBasedRoute != null && message.hasOwnProperty("policyBasedRoute")) { + var error = $root.google.cloud.networkconnectivity.v1.PolicyBasedRoute.verify(message.policyBasedRoute); + if (error) + return "policyBasedRoute." + error; + } + if (message.requestId != null && message.hasOwnProperty("requestId")) + if (!$util.isString(message.requestId)) + return "requestId: string expected"; + return null; + }; + + /** + * Creates a CreatePolicyBasedRouteRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.networkconnectivity.v1.CreatePolicyBasedRouteRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.networkconnectivity.v1.CreatePolicyBasedRouteRequest} CreatePolicyBasedRouteRequest + */ + CreatePolicyBasedRouteRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.networkconnectivity.v1.CreatePolicyBasedRouteRequest) + return object; + var message = new $root.google.cloud.networkconnectivity.v1.CreatePolicyBasedRouteRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.policyBasedRouteId != null) + message.policyBasedRouteId = String(object.policyBasedRouteId); + if (object.policyBasedRoute != null) { + if (typeof object.policyBasedRoute !== "object") + throw TypeError(".google.cloud.networkconnectivity.v1.CreatePolicyBasedRouteRequest.policyBasedRoute: object expected"); + message.policyBasedRoute = $root.google.cloud.networkconnectivity.v1.PolicyBasedRoute.fromObject(object.policyBasedRoute); + } + if (object.requestId != null) + message.requestId = String(object.requestId); + return message; + }; + + /** + * Creates a plain object from a CreatePolicyBasedRouteRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.networkconnectivity.v1.CreatePolicyBasedRouteRequest + * @static + * @param {google.cloud.networkconnectivity.v1.CreatePolicyBasedRouteRequest} message CreatePolicyBasedRouteRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CreatePolicyBasedRouteRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.policyBasedRouteId = ""; + object.policyBasedRoute = null; + object.requestId = ""; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.policyBasedRouteId != null && message.hasOwnProperty("policyBasedRouteId")) + object.policyBasedRouteId = message.policyBasedRouteId; + if (message.policyBasedRoute != null && message.hasOwnProperty("policyBasedRoute")) + object.policyBasedRoute = $root.google.cloud.networkconnectivity.v1.PolicyBasedRoute.toObject(message.policyBasedRoute, options); + if (message.requestId != null && message.hasOwnProperty("requestId")) + object.requestId = message.requestId; + return object; + }; + + /** + * Converts this CreatePolicyBasedRouteRequest to JSON. + * @function toJSON + * @memberof google.cloud.networkconnectivity.v1.CreatePolicyBasedRouteRequest + * @instance + * @returns {Object.} JSON object + */ + CreatePolicyBasedRouteRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CreatePolicyBasedRouteRequest + * @function getTypeUrl + * @memberof google.cloud.networkconnectivity.v1.CreatePolicyBasedRouteRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CreatePolicyBasedRouteRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.networkconnectivity.v1.CreatePolicyBasedRouteRequest"; + }; + + return CreatePolicyBasedRouteRequest; + })(); + + v1.DeletePolicyBasedRouteRequest = (function() { + + /** + * Properties of a DeletePolicyBasedRouteRequest. + * @memberof google.cloud.networkconnectivity.v1 + * @interface IDeletePolicyBasedRouteRequest + * @property {string|null} [name] DeletePolicyBasedRouteRequest name + * @property {string|null} [requestId] DeletePolicyBasedRouteRequest requestId + */ + + /** + * Constructs a new DeletePolicyBasedRouteRequest. + * @memberof google.cloud.networkconnectivity.v1 + * @classdesc Represents a DeletePolicyBasedRouteRequest. + * @implements IDeletePolicyBasedRouteRequest + * @constructor + * @param {google.cloud.networkconnectivity.v1.IDeletePolicyBasedRouteRequest=} [properties] Properties to set + */ + function DeletePolicyBasedRouteRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * DeletePolicyBasedRouteRequest name. + * @member {string} name + * @memberof google.cloud.networkconnectivity.v1.DeletePolicyBasedRouteRequest + * @instance + */ + DeletePolicyBasedRouteRequest.prototype.name = ""; + + /** + * DeletePolicyBasedRouteRequest requestId. + * @member {string} requestId + * @memberof google.cloud.networkconnectivity.v1.DeletePolicyBasedRouteRequest + * @instance + */ + DeletePolicyBasedRouteRequest.prototype.requestId = ""; + + /** + * Creates a new DeletePolicyBasedRouteRequest instance using the specified properties. + * @function create + * @memberof google.cloud.networkconnectivity.v1.DeletePolicyBasedRouteRequest + * @static + * @param {google.cloud.networkconnectivity.v1.IDeletePolicyBasedRouteRequest=} [properties] Properties to set + * @returns {google.cloud.networkconnectivity.v1.DeletePolicyBasedRouteRequest} DeletePolicyBasedRouteRequest instance + */ + DeletePolicyBasedRouteRequest.create = function create(properties) { + return new DeletePolicyBasedRouteRequest(properties); + }; + + /** + * Encodes the specified DeletePolicyBasedRouteRequest message. Does not implicitly {@link google.cloud.networkconnectivity.v1.DeletePolicyBasedRouteRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.networkconnectivity.v1.DeletePolicyBasedRouteRequest + * @static + * @param {google.cloud.networkconnectivity.v1.IDeletePolicyBasedRouteRequest} message DeletePolicyBasedRouteRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeletePolicyBasedRouteRequest.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.requestId != null && Object.hasOwnProperty.call(message, "requestId")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.requestId); + return writer; + }; + + /** + * Encodes the specified DeletePolicyBasedRouteRequest message, length delimited. Does not implicitly {@link google.cloud.networkconnectivity.v1.DeletePolicyBasedRouteRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.networkconnectivity.v1.DeletePolicyBasedRouteRequest + * @static + * @param {google.cloud.networkconnectivity.v1.IDeletePolicyBasedRouteRequest} message DeletePolicyBasedRouteRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeletePolicyBasedRouteRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DeletePolicyBasedRouteRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.networkconnectivity.v1.DeletePolicyBasedRouteRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.networkconnectivity.v1.DeletePolicyBasedRouteRequest} DeletePolicyBasedRouteRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeletePolicyBasedRouteRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.networkconnectivity.v1.DeletePolicyBasedRouteRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.requestId = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DeletePolicyBasedRouteRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.networkconnectivity.v1.DeletePolicyBasedRouteRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.networkconnectivity.v1.DeletePolicyBasedRouteRequest} DeletePolicyBasedRouteRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeletePolicyBasedRouteRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DeletePolicyBasedRouteRequest message. + * @function verify + * @memberof google.cloud.networkconnectivity.v1.DeletePolicyBasedRouteRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DeletePolicyBasedRouteRequest.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.requestId != null && message.hasOwnProperty("requestId")) + if (!$util.isString(message.requestId)) + return "requestId: string expected"; + return null; + }; + + /** + * Creates a DeletePolicyBasedRouteRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.networkconnectivity.v1.DeletePolicyBasedRouteRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.networkconnectivity.v1.DeletePolicyBasedRouteRequest} DeletePolicyBasedRouteRequest + */ + DeletePolicyBasedRouteRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.networkconnectivity.v1.DeletePolicyBasedRouteRequest) + return object; + var message = new $root.google.cloud.networkconnectivity.v1.DeletePolicyBasedRouteRequest(); + if (object.name != null) + message.name = String(object.name); + if (object.requestId != null) + message.requestId = String(object.requestId); + return message; + }; + + /** + * Creates a plain object from a DeletePolicyBasedRouteRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.networkconnectivity.v1.DeletePolicyBasedRouteRequest + * @static + * @param {google.cloud.networkconnectivity.v1.DeletePolicyBasedRouteRequest} message DeletePolicyBasedRouteRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DeletePolicyBasedRouteRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.requestId = ""; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.requestId != null && message.hasOwnProperty("requestId")) + object.requestId = message.requestId; + return object; + }; + + /** + * Converts this DeletePolicyBasedRouteRequest to JSON. + * @function toJSON + * @memberof google.cloud.networkconnectivity.v1.DeletePolicyBasedRouteRequest + * @instance + * @returns {Object.} JSON object + */ + DeletePolicyBasedRouteRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DeletePolicyBasedRouteRequest + * @function getTypeUrl + * @memberof google.cloud.networkconnectivity.v1.DeletePolicyBasedRouteRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DeletePolicyBasedRouteRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.networkconnectivity.v1.DeletePolicyBasedRouteRequest"; + }; + + return DeletePolicyBasedRouteRequest; + })(); + return v1; })(); diff --git a/packages/google-cloud-networkconnectivity/protos/protos.json b/packages/google-cloud-networkconnectivity/protos/protos.json index a11f3aa481c..5191edcf1e6 100644 --- a/packages/google-cloud-networkconnectivity/protos/protos.json +++ b/packages/google-cloud-networkconnectivity/protos/protos.json @@ -11,7 +11,7 @@ "csharp_namespace": "Google.Cloud.NetworkConnectivity.V1", "go_package": "cloud.google.com/go/networkconnectivity/apiv1/networkconnectivitypb;networkconnectivitypb", "java_multiple_files": true, - "java_outer_classname": "HubProto", + "java_outer_classname": "PolicyBasedRoutingProto", "java_package": "com.google.cloud.networkconnectivity.v1", "php_namespace": "Google\\Cloud\\NetworkConnectivity\\V1", "ruby_package": "Google::Cloud::NetworkConnectivity::V1", @@ -841,6 +841,447 @@ "id": 1 } } + }, + "PolicyBasedRoutingService": { + "options": { + "(google.api.default_host)": "networkconnectivity.googleapis.com", + "(google.api.oauth_scopes)": "https://www.googleapis.com/auth/cloud-platform" + }, + "methods": { + "ListPolicyBasedRoutes": { + "requestType": "ListPolicyBasedRoutesRequest", + "responseType": "ListPolicyBasedRoutesResponse", + "options": { + "(google.api.http).get": "/v1/{parent=projects/*/locations/global}/policyBasedRoutes", + "(google.api.method_signature)": "parent" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1/{parent=projects/*/locations/global}/policyBasedRoutes" + } + }, + { + "(google.api.method_signature)": "parent" + } + ] + }, + "GetPolicyBasedRoute": { + "requestType": "GetPolicyBasedRouteRequest", + "responseType": "PolicyBasedRoute", + "options": { + "(google.api.http).get": "/v1/{name=projects/*/locations/global/policyBasedRoutes/*}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1/{name=projects/*/locations/global/policyBasedRoutes/*}" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "CreatePolicyBasedRoute": { + "requestType": "CreatePolicyBasedRouteRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).post": "/v1/{parent=projects/*/locations/global}/policyBasedRoutes", + "(google.api.http).body": "policy_based_route", + "(google.api.method_signature)": "parent,policy_based_route,policy_based_route_id", + "(google.longrunning.operation_info).response_type": "PolicyBasedRoute", + "(google.longrunning.operation_info).metadata_type": "OperationMetadata" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1/{parent=projects/*/locations/global}/policyBasedRoutes", + "body": "policy_based_route" + } + }, + { + "(google.api.method_signature)": "parent,policy_based_route,policy_based_route_id" + }, + { + "(google.longrunning.operation_info)": { + "response_type": "PolicyBasedRoute", + "metadata_type": "OperationMetadata" + } + } + ] + }, + "DeletePolicyBasedRoute": { + "requestType": "DeletePolicyBasedRouteRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).delete": "/v1/{name=projects/*/locations/global/policyBasedRoutes/*}", + "(google.api.method_signature)": "name", + "(google.longrunning.operation_info).response_type": "google.protobuf.Empty", + "(google.longrunning.operation_info).metadata_type": "OperationMetadata" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "delete": "/v1/{name=projects/*/locations/global/policyBasedRoutes/*}" + } + }, + { + "(google.api.method_signature)": "name" + }, + { + "(google.longrunning.operation_info)": { + "response_type": "google.protobuf.Empty", + "metadata_type": "OperationMetadata" + } + } + ] + } + } + }, + "PolicyBasedRoute": { + "options": { + "(google.api.resource).type": "networkconnectivity.googleapis.com/PolicyBasedRoute", + "(google.api.resource).pattern": "projects/{project}/locations/global/PolicyBasedRoutes/{policy_based_route}" + }, + "oneofs": { + "target": { + "oneof": [ + "virtualMachine", + "interconnectAttachment" + ] + }, + "nextHop": { + "oneof": [ + "nextHopIlbIp", + "nextHopOtherRoutes" + ] + } + }, + "fields": { + "virtualMachine": { + "type": "VirtualMachine", + "id": 18, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "interconnectAttachment": { + "type": "InterconnectAttachment", + "id": 9, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "nextHopIlbIp": { + "type": "string", + "id": 12, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "nextHopOtherRoutes": { + "type": "OtherRoutes", + "id": 21, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "IMMUTABLE" + } + }, + "createTime": { + "type": "google.protobuf.Timestamp", + "id": 2, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "updateTime": { + "type": "google.protobuf.Timestamp", + "id": 3, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "labels": { + "keyType": "string", + "type": "string", + "id": 4 + }, + "description": { + "type": "string", + "id": 5, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "network": { + "type": "string", + "id": 6, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "compute.googleapis.com/Network" + } + }, + "filter": { + "type": "Filter", + "id": 10, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "priority": { + "type": "int32", + "id": 11, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "warnings": { + "rule": "repeated", + "type": "Warnings", + "id": 14, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "selfLink": { + "type": "string", + "id": 15, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "kind": { + "type": "string", + "id": 16, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + } + }, + "nested": { + "VirtualMachine": { + "fields": { + "tags": { + "rule": "repeated", + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "InterconnectAttachment": { + "fields": { + "region": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "Filter": { + "fields": { + "ipProtocol": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "srcRange": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "destRange": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "protocolVersion": { + "type": "ProtocolVersion", + "id": 6, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + }, + "nested": { + "ProtocolVersion": { + "values": { + "PROTOCOL_VERSION_UNSPECIFIED": 0, + "IPV4": 1 + } + } + } + }, + "Warnings": { + "fields": { + "code": { + "type": "Code", + "id": 1, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "data": { + "keyType": "string", + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "warningMessage": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + } + }, + "nested": { + "Code": { + "values": { + "WARNING_UNSPECIFIED": 0, + "RESOURCE_NOT_ACTIVE": 1, + "RESOURCE_BEING_MODIFIED": 2 + } + } + } + }, + "OtherRoutes": { + "values": { + "OTHER_ROUTES_UNSPECIFIED": 0, + "DEFAULT_ROUTING": 1 + } + } + } + }, + "ListPolicyBasedRoutesRequest": { + "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 + }, + "filter": { + "type": "string", + "id": 4 + }, + "orderBy": { + "type": "string", + "id": 5 + } + } + }, + "ListPolicyBasedRoutesResponse": { + "fields": { + "policyBasedRoutes": { + "rule": "repeated", + "type": "PolicyBasedRoute", + "id": 1 + }, + "nextPageToken": { + "type": "string", + "id": 2 + }, + "unreachable": { + "rule": "repeated", + "type": "string", + "id": 3 + } + } + }, + "GetPolicyBasedRouteRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "networkconnectivity.googleapis.com/PolicyBasedRoute" + } + } + } + }, + "CreatePolicyBasedRouteRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "locations.googleapis.com/Location" + } + }, + "policyBasedRouteId": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "policyBasedRoute": { + "type": "PolicyBasedRoute", + "id": 3, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "requestId": { + "type": "string", + "id": 4, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "DeletePolicyBasedRouteRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "networkconnectivity.googleapis.com/PolicyBasedRoute" + } + }, + "requestId": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } } } }, diff --git a/packages/google-cloud-networkconnectivity/samples/generated/v1/policy_based_routing_service.create_policy_based_route.js b/packages/google-cloud-networkconnectivity/samples/generated/v1/policy_based_routing_service.create_policy_based_route.js index 15dc9a03892..276793fa8cd 100644 --- a/packages/google-cloud-networkconnectivity/samples/generated/v1/policy_based_routing_service.create_policy_based_route.js +++ b/packages/google-cloud-networkconnectivity/samples/generated/v1/policy_based_routing_service.create_policy_based_route.js @@ -20,7 +20,7 @@ 'use strict'; -function main(parent, policyBasedRoute) { +function main(parent, policyBasedRouteId, policyBasedRoute) { // [START networkconnectivity_v1_generated_PolicyBasedRoutingService_CreatePolicyBasedRoute_async] /** * This snippet has been automatically generated and should be regarded as a code template only. @@ -33,7 +33,7 @@ function main(parent, policyBasedRoute) { */ // const parent = 'abc123' /** - * Optional. Unique id for the Policy Based Route to create. + * Required. Unique id for the Policy Based Route to create. */ // const policyBasedRouteId = 'abc123' /** @@ -41,12 +41,12 @@ function main(parent, policyBasedRoute) { */ // const policyBasedRoute = {} /** - * Optional. An optional request ID to identify requests. Specify a unique request ID - * so that if you must retry your request, the server will know to ignore - * the request if it has already been completed. The server will guarantee - * that for at least 60 minutes since the first request. - * For example, consider a situation where you make an initial request and t - * he request times out. If you make the request again with the same request + * Optional. An optional request ID to identify requests. Specify a unique + * request ID so that if you must retry your request, the server will know to + * ignore the request if it has already been completed. The server will + * guarantee that for at least 60 minutes since the first request. + * For example, consider a situation where you make an initial request and + * the request times out. If you make the request again with the same request * ID, the server can check if original operation with the same request ID * was received, and if so, will ignore the second request. This prevents * clients from accidentally creating duplicate commitments. @@ -65,6 +65,7 @@ function main(parent, policyBasedRoute) { // Construct request const request = { parent, + policyBasedRouteId, policyBasedRoute, }; diff --git a/packages/google-cloud-networkconnectivity/samples/generated/v1/policy_based_routing_service.delete_policy_based_route.js b/packages/google-cloud-networkconnectivity/samples/generated/v1/policy_based_routing_service.delete_policy_based_route.js index 95f42bc89e2..2fa048059c1 100644 --- a/packages/google-cloud-networkconnectivity/samples/generated/v1/policy_based_routing_service.delete_policy_based_route.js +++ b/packages/google-cloud-networkconnectivity/samples/generated/v1/policy_based_routing_service.delete_policy_based_route.js @@ -33,12 +33,12 @@ function main(name) { */ // const name = 'abc123' /** - * Optional. An optional request ID to identify requests. Specify a unique request ID - * so that if you must retry your request, the server will know to ignore - * the request if it has already been completed. The server will guarantee - * that for at least 60 minutes after the first request. - * For example, consider a situation where you make an initial request and t - * he request times out. If you make the request again with the same request + * Optional. An optional request ID to identify requests. Specify a unique + * request ID so that if you must retry your request, the server will know to + * ignore the request if it has already been completed. The server will + * guarantee that for at least 60 minutes after the first request. + * For example, consider a situation where you make an initial request and + * the request times out. If you make the request again with the same request * ID, the server can check if original operation with the same request ID * was received, and if so, will ignore the second request. This prevents * clients from accidentally creating duplicate commitments. diff --git a/packages/google-cloud-networkconnectivity/samples/generated/v1/snippet_metadata.google.cloud.networkconnectivity.v1.json b/packages/google-cloud-networkconnectivity/samples/generated/v1/snippet_metadata.google.cloud.networkconnectivity.v1.json index 8184060e57e..5d267c7fec6 100644 --- a/packages/google-cloud-networkconnectivity/samples/generated/v1/snippet_metadata.google.cloud.networkconnectivity.v1.json +++ b/packages/google-cloud-networkconnectivity/samples/generated/v1/snippet_metadata.google.cloud.networkconnectivity.v1.json @@ -1,7 +1,7 @@ { "clientLibrary": { "name": "nodejs-networkconnectivity", - "version": "3.0.1", + "version": "3.1.0", "language": "TYPESCRIPT", "apis": [ { diff --git a/packages/google-cloud-networkconnectivity/samples/generated/v1/snippet_metadata_google.cloud.networkconnectivity.v1.json b/packages/google-cloud-networkconnectivity/samples/generated/v1/snippet_metadata_google.cloud.networkconnectivity.v1.json index 8184060e57e..939d7a6dc70 100644 --- a/packages/google-cloud-networkconnectivity/samples/generated/v1/snippet_metadata_google.cloud.networkconnectivity.v1.json +++ b/packages/google-cloud-networkconnectivity/samples/generated/v1/snippet_metadata_google.cloud.networkconnectivity.v1.json @@ -1,7 +1,7 @@ { "clientLibrary": { "name": "nodejs-networkconnectivity", - "version": "3.0.1", + "version": "3.1.0", "language": "TYPESCRIPT", "apis": [ { @@ -490,6 +490,198 @@ } } } + }, + { + "regionTag": "networkconnectivity_v1_generated_PolicyBasedRoutingService_ListPolicyBasedRoutes_async", + "title": "HubService listPolicyBasedRoutes Sample", + "origin": "API_DEFINITION", + "description": " Lists PolicyBasedRoutes in a given project and location.", + "canonical": true, + "file": "policy_based_routing_service.list_policy_based_routes.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 71, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "ListPolicyBasedRoutes", + "fullName": "google.cloud.networkconnectivity.v1.PolicyBasedRoutingService.ListPolicyBasedRoutes", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "page_size", + "type": "TYPE_INT32" + }, + { + "name": "page_token", + "type": "TYPE_STRING" + }, + { + "name": "filter", + "type": "TYPE_STRING" + }, + { + "name": "order_by", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.networkconnectivity.v1.ListPolicyBasedRoutesResponse", + "client": { + "shortName": "PolicyBasedRoutingServiceClient", + "fullName": "google.cloud.networkconnectivity.v1.PolicyBasedRoutingServiceClient" + }, + "method": { + "shortName": "ListPolicyBasedRoutes", + "fullName": "google.cloud.networkconnectivity.v1.PolicyBasedRoutingService.ListPolicyBasedRoutes", + "service": { + "shortName": "PolicyBasedRoutingService", + "fullName": "google.cloud.networkconnectivity.v1.PolicyBasedRoutingService" + } + } + } + }, + { + "regionTag": "networkconnectivity_v1_generated_PolicyBasedRoutingService_GetPolicyBasedRoute_async", + "title": "HubService getPolicyBasedRoute Sample", + "origin": "API_DEFINITION", + "description": " Gets details of a single PolicyBasedRoute.", + "canonical": true, + "file": "policy_based_routing_service.get_policy_based_route.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 53, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "GetPolicyBasedRoute", + "fullName": "google.cloud.networkconnectivity.v1.PolicyBasedRoutingService.GetPolicyBasedRoute", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.networkconnectivity.v1.PolicyBasedRoute", + "client": { + "shortName": "PolicyBasedRoutingServiceClient", + "fullName": "google.cloud.networkconnectivity.v1.PolicyBasedRoutingServiceClient" + }, + "method": { + "shortName": "GetPolicyBasedRoute", + "fullName": "google.cloud.networkconnectivity.v1.PolicyBasedRoutingService.GetPolicyBasedRoute", + "service": { + "shortName": "PolicyBasedRoutingService", + "fullName": "google.cloud.networkconnectivity.v1.PolicyBasedRoutingService" + } + } + } + }, + { + "regionTag": "networkconnectivity_v1_generated_PolicyBasedRoutingService_CreatePolicyBasedRoute_async", + "title": "HubService createPolicyBasedRoute Sample", + "origin": "API_DEFINITION", + "description": " Creates a new PolicyBasedRoute in a given project and location.", + "canonical": true, + "file": "policy_based_routing_service.create_policy_based_route.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 78, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "CreatePolicyBasedRoute", + "fullName": "google.cloud.networkconnectivity.v1.PolicyBasedRoutingService.CreatePolicyBasedRoute", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "policy_based_route_id", + "type": "TYPE_STRING" + }, + { + "name": "policy_based_route", + "type": ".google.cloud.networkconnectivity.v1.PolicyBasedRoute" + }, + { + "name": "request_id", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "PolicyBasedRoutingServiceClient", + "fullName": "google.cloud.networkconnectivity.v1.PolicyBasedRoutingServiceClient" + }, + "method": { + "shortName": "CreatePolicyBasedRoute", + "fullName": "google.cloud.networkconnectivity.v1.PolicyBasedRoutingService.CreatePolicyBasedRoute", + "service": { + "shortName": "PolicyBasedRoutingService", + "fullName": "google.cloud.networkconnectivity.v1.PolicyBasedRoutingService" + } + } + } + }, + { + "regionTag": "networkconnectivity_v1_generated_PolicyBasedRoutingService_DeletePolicyBasedRoute_async", + "title": "HubService deletePolicyBasedRoute Sample", + "origin": "API_DEFINITION", + "description": " Deletes a single PolicyBasedRoute.", + "canonical": true, + "file": "policy_based_routing_service.delete_policy_based_route.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 68, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "DeletePolicyBasedRoute", + "fullName": "google.cloud.networkconnectivity.v1.PolicyBasedRoutingService.DeletePolicyBasedRoute", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + }, + { + "name": "request_id", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "PolicyBasedRoutingServiceClient", + "fullName": "google.cloud.networkconnectivity.v1.PolicyBasedRoutingServiceClient" + }, + "method": { + "shortName": "DeletePolicyBasedRoute", + "fullName": "google.cloud.networkconnectivity.v1.PolicyBasedRoutingService.DeletePolicyBasedRoute", + "service": { + "shortName": "PolicyBasedRoutingService", + "fullName": "google.cloud.networkconnectivity.v1.PolicyBasedRoutingService" + } + } + } } ] } \ No newline at end of file diff --git a/packages/google-cloud-networkconnectivity/samples/generated/v1alpha1/snippet_metadata.google.cloud.networkconnectivity.v1alpha1.json b/packages/google-cloud-networkconnectivity/samples/generated/v1alpha1/snippet_metadata.google.cloud.networkconnectivity.v1alpha1.json index 98484f56e70..668ff5ebeed 100644 --- a/packages/google-cloud-networkconnectivity/samples/generated/v1alpha1/snippet_metadata.google.cloud.networkconnectivity.v1alpha1.json +++ b/packages/google-cloud-networkconnectivity/samples/generated/v1alpha1/snippet_metadata.google.cloud.networkconnectivity.v1alpha1.json @@ -1,7 +1,7 @@ { "clientLibrary": { "name": "nodejs-networkconnectivity", - "version": "3.0.1", + "version": "3.1.0", "language": "TYPESCRIPT", "apis": [ { diff --git a/packages/google-cloud-networkconnectivity/samples/generated/v1alpha1/snippet_metadata_google.cloud.networkconnectivity.v1alpha1.json b/packages/google-cloud-networkconnectivity/samples/generated/v1alpha1/snippet_metadata_google.cloud.networkconnectivity.v1alpha1.json index 98484f56e70..668ff5ebeed 100644 --- a/packages/google-cloud-networkconnectivity/samples/generated/v1alpha1/snippet_metadata_google.cloud.networkconnectivity.v1alpha1.json +++ b/packages/google-cloud-networkconnectivity/samples/generated/v1alpha1/snippet_metadata_google.cloud.networkconnectivity.v1alpha1.json @@ -1,7 +1,7 @@ { "clientLibrary": { "name": "nodejs-networkconnectivity", - "version": "3.0.1", + "version": "3.1.0", "language": "TYPESCRIPT", "apis": [ { diff --git a/packages/google-cloud-networkconnectivity/samples/package.json b/packages/google-cloud-networkconnectivity/samples/package.json index ef2da139308..b5836a186b8 100644 --- a/packages/google-cloud-networkconnectivity/samples/package.json +++ b/packages/google-cloud-networkconnectivity/samples/package.json @@ -13,7 +13,7 @@ "test": "c8 mocha --timeout 600000 test/*.js" }, "dependencies": { - "@google-cloud/network-connectivity": "^3.0.1" + "@google-cloud/network-connectivity": "^3.1.0" }, "devDependencies": { "c8": "^7.1.0", diff --git a/packages/google-cloud-networkconnectivity/src/index.ts b/packages/google-cloud-networkconnectivity/src/index.ts index 993391871ee..d27aa0cb93d 100644 --- a/packages/google-cloud-networkconnectivity/src/index.ts +++ b/packages/google-cloud-networkconnectivity/src/index.ts @@ -21,8 +21,15 @@ import * as v1alpha1 from './v1alpha1'; const HubServiceClient = v1.HubServiceClient; type HubServiceClient = v1.HubServiceClient; +const PolicyBasedRoutingServiceClient = v1.PolicyBasedRoutingServiceClient; +type PolicyBasedRoutingServiceClient = v1.PolicyBasedRoutingServiceClient; -export {v1, v1alpha1, HubServiceClient}; -export default {v1, v1alpha1, HubServiceClient}; +export {v1, v1alpha1, HubServiceClient, PolicyBasedRoutingServiceClient}; +export default { + v1, + v1alpha1, + HubServiceClient, + PolicyBasedRoutingServiceClient, +}; import * as protos from '../protos/protos'; export {protos}; diff --git a/packages/google-cloud-networkconnectivity/src/v1/gapic_metadata.json b/packages/google-cloud-networkconnectivity/src/v1/gapic_metadata.json index 3e4f0fedf40..f327f4e8b54 100644 --- a/packages/google-cloud-networkconnectivity/src/v1/gapic_metadata.json +++ b/packages/google-cloud-networkconnectivity/src/v1/gapic_metadata.json @@ -126,6 +126,64 @@ } } } + }, + "PolicyBasedRoutingService": { + "clients": { + "grpc": { + "libraryClient": "PolicyBasedRoutingServiceClient", + "rpcs": { + "GetPolicyBasedRoute": { + "methods": [ + "getPolicyBasedRoute" + ] + }, + "CreatePolicyBasedRoute": { + "methods": [ + "createPolicyBasedRoute" + ] + }, + "DeletePolicyBasedRoute": { + "methods": [ + "deletePolicyBasedRoute" + ] + }, + "ListPolicyBasedRoutes": { + "methods": [ + "listPolicyBasedRoutes", + "listPolicyBasedRoutesStream", + "listPolicyBasedRoutesAsync" + ] + } + } + }, + "grpc-fallback": { + "libraryClient": "PolicyBasedRoutingServiceClient", + "rpcs": { + "GetPolicyBasedRoute": { + "methods": [ + "getPolicyBasedRoute" + ] + }, + "CreatePolicyBasedRoute": { + "methods": [ + "createPolicyBasedRoute" + ] + }, + "DeletePolicyBasedRoute": { + "methods": [ + "deletePolicyBasedRoute" + ] + }, + "ListPolicyBasedRoutes": { + "methods": [ + "listPolicyBasedRoutes", + "listPolicyBasedRoutesStream", + "listPolicyBasedRoutesAsync" + ] + } + } + } + } } } } diff --git a/packages/google-cloud-networkconnectivity/src/v1/hub_service_client.ts b/packages/google-cloud-networkconnectivity/src/v1/hub_service_client.ts index 984af7e1e8b..26c02a16f5b 100644 --- a/packages/google-cloud-networkconnectivity/src/v1/hub_service_client.ts +++ b/packages/google-cloud-networkconnectivity/src/v1/hub_service_client.ts @@ -209,6 +209,9 @@ export class HubServiceClient { networkPathTemplate: new this._gaxModule.PathTemplate( 'projects/{project}/global/networks/{resource_id}' ), + policyBasedRoutePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/global/PolicyBasedRoutes/{policy_based_route}' + ), spokePathTemplate: new this._gaxModule.PathTemplate( 'projects/{project}/locations/{location}/spokes/{spoke}' ), @@ -2655,6 +2658,46 @@ export class HubServiceClient { .resource_id; } + /** + * Return a fully-qualified policyBasedRoute resource name string. + * + * @param {string} project + * @param {string} policy_based_route + * @returns {string} Resource name string. + */ + policyBasedRoutePath(project: string, policyBasedRoute: string) { + return this.pathTemplates.policyBasedRoutePathTemplate.render({ + project: project, + policy_based_route: policyBasedRoute, + }); + } + + /** + * Parse the project from PolicyBasedRoute resource. + * + * @param {string} policyBasedRouteName + * A fully-qualified path representing PolicyBasedRoute resource. + * @returns {string} A string representing the project. + */ + matchProjectFromPolicyBasedRouteName(policyBasedRouteName: string) { + return this.pathTemplates.policyBasedRoutePathTemplate.match( + policyBasedRouteName + ).project; + } + + /** + * Parse the policy_based_route from PolicyBasedRoute resource. + * + * @param {string} policyBasedRouteName + * A fully-qualified path representing PolicyBasedRoute resource. + * @returns {string} A string representing the policy_based_route. + */ + matchPolicyBasedRouteFromPolicyBasedRouteName(policyBasedRouteName: string) { + return this.pathTemplates.policyBasedRoutePathTemplate.match( + policyBasedRouteName + ).policy_based_route; + } + /** * Return a fully-qualified spoke resource name string. * diff --git a/packages/google-cloud-networkconnectivity/src/v1/hub_service_proto_list.json b/packages/google-cloud-networkconnectivity/src/v1/hub_service_proto_list.json index ebe50faf7cb..d076e60ee41 100644 --- a/packages/google-cloud-networkconnectivity/src/v1/hub_service_proto_list.json +++ b/packages/google-cloud-networkconnectivity/src/v1/hub_service_proto_list.json @@ -1,4 +1,5 @@ [ "../../protos/google/cloud/networkconnectivity/v1/common.proto", - "../../protos/google/cloud/networkconnectivity/v1/hub.proto" + "../../protos/google/cloud/networkconnectivity/v1/hub.proto", + "../../protos/google/cloud/networkconnectivity/v1/policy_based_routing.proto" ] diff --git a/packages/google-cloud-networkconnectivity/src/v1/index.ts b/packages/google-cloud-networkconnectivity/src/v1/index.ts index 937a411a485..54add94f8e7 100644 --- a/packages/google-cloud-networkconnectivity/src/v1/index.ts +++ b/packages/google-cloud-networkconnectivity/src/v1/index.ts @@ -17,3 +17,4 @@ // ** All changes to this file may be overwritten. ** export {HubServiceClient} from './hub_service_client'; +export {PolicyBasedRoutingServiceClient} from './policy_based_routing_service_client'; diff --git a/packages/google-cloud-networkconnectivity/src/v1/policy_based_routing_service_client.ts b/packages/google-cloud-networkconnectivity/src/v1/policy_based_routing_service_client.ts new file mode 100644 index 00000000000..adee43d09d9 --- /dev/null +++ b/packages/google-cloud-networkconnectivity/src/v1/policy_based_routing_service_client.ts @@ -0,0 +1,1701 @@ +// Copyright 2023 Google LLC +// +// Licensed under the Apache License, Version 2.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, + IamClient, + IamProtos, + LocationsClient, + LocationProtos, +} from 'google-gax'; +import {Transform} from 'stream'; +import * as protos from '../../protos/protos'; +import jsonProtos = require('../../protos/protos.json'); +/** + * Client JSON configuration object, loaded from + * `src/v1/policy_based_routing_service_client_config.json`. + * This file defines retry strategy and timeouts for all API methods in this library. + */ +import * as gapicConfig from './policy_based_routing_service_client_config.json'; +const version = require('../../../package.json').version; + +/** + * Policy-Based Routing allows GCP customers to specify flexibile routing + * policies for Layer 4 traffic traversing through the connected service. + * @class + * @memberof v1 + */ +export class PolicyBasedRoutingServiceClient { + 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}; + auth: gax.GoogleAuth; + descriptors: Descriptors = { + page: {}, + stream: {}, + longrunning: {}, + batching: {}, + }; + warn: (code: string, message: string, warnType?: string) => void; + innerApiCalls: {[name: string]: Function}; + iamClient: IamClient; + locationsClient: LocationsClient; + pathTemplates: {[name: string]: gax.PathTemplate}; + operationsClient: gax.OperationsClient; + policyBasedRoutingServiceStub?: Promise<{[name: string]: Function}>; + + /** + * Construct an instance of PolicyBasedRoutingServiceClient. + * + * @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://developers.google.com/identity/protocols/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 PolicyBasedRoutingServiceClient({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 PolicyBasedRoutingServiceClient; + const servicePath = + opts?.servicePath || opts?.apiEndpoint || staticMembers.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 !== staticMembers.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 = staticMembers.servicePath; + + // Set the default scopes in auth client if needed. + if (servicePath === staticMembers.servicePath) { + this.auth.defaultScopes = staticMembers.scopes; + } + this.iamClient = new this._gaxModule.IamClient(this._gaxGrpc, opts); + + 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 !== 'undefined' && '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 = { + hubPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/global/hubs/{hub}' + ), + locationPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}' + ), + networkPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/global/networks/{resource_id}' + ), + policyBasedRoutePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/global/PolicyBasedRoutes/{policy_based_route}' + ), + spokePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/spokes/{spoke}' + ), + }; + + // 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 = { + listPolicyBasedRoutes: new this._gaxModule.PageDescriptor( + 'pageToken', + 'nextPageToken', + 'policyBasedRoutes' + ), + }; + + const protoFilesRoot = this._gaxModule.protobuf.Root.fromJSON(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: '/v1/{name=projects/*/locations/*}', + }, + { + selector: 'google.cloud.location.Locations.ListLocations', + get: '/v1/{name=projects/*}/locations', + }, + { + selector: 'google.iam.v1.IAMPolicy.GetIamPolicy', + get: '/v1/{resource=projects/*/locations/global/hubs/*}:getIamPolicy', + additional_bindings: [ + { + get: '/v1/{resource=projects/*/locations/*/spokes/*}:getIamPolicy', + }, + { + get: '/v1/{resource=projects/*/locations/global/policyBasedRoutes/*}:getIamPolicy', + }, + ], + }, + { + selector: 'google.iam.v1.IAMPolicy.SetIamPolicy', + post: '/v1/{resource=projects/*/locations/global/hubs/*}:setIamPolicy', + body: '*', + additional_bindings: [ + { + post: '/v1/{resource=projects/*/locations/*/spokes/*}:setIamPolicy', + body: '*', + }, + { + post: '/v1/{resource=projects/*/locations/global/policyBasedRoutes/*}:setIamPolicy', + body: '*', + }, + ], + }, + { + selector: 'google.iam.v1.IAMPolicy.TestIamPermissions', + post: '/v1/{resource=projects/*/locations/global/hubs/*}:testIamPermissions', + body: '*', + additional_bindings: [ + { + post: '/v1/{resource=projects/*/locations/*/spokes/*}:testIamPermissions', + body: '*', + }, + { + post: '/v1/{resource=projects/*/locations/global/policyBasedRoutes/*}:testIamPermissions', + body: '*', + }, + ], + }, + { + selector: 'google.longrunning.Operations.CancelOperation', + post: '/v1/{name=projects/*/locations/*/operations/*}:cancel', + body: '*', + }, + { + selector: 'google.longrunning.Operations.DeleteOperation', + delete: '/v1/{name=projects/*/locations/*/operations/*}', + }, + { + selector: 'google.longrunning.Operations.GetOperation', + get: '/v1/{name=projects/*/locations/*/operations/*}', + }, + { + selector: 'google.longrunning.Operations.ListOperations', + get: '/v1/{name=projects/*/locations/*}/operations', + }, + ]; + } + this.operationsClient = this._gaxModule + .lro(lroOptions) + .operationsClient(opts); + const createPolicyBasedRouteResponse = protoFilesRoot.lookup( + '.google.cloud.networkconnectivity.v1.PolicyBasedRoute' + ) as gax.protobuf.Type; + const createPolicyBasedRouteMetadata = protoFilesRoot.lookup( + '.google.cloud.networkconnectivity.v1.OperationMetadata' + ) as gax.protobuf.Type; + const deletePolicyBasedRouteResponse = protoFilesRoot.lookup( + '.google.protobuf.Empty' + ) as gax.protobuf.Type; + const deletePolicyBasedRouteMetadata = protoFilesRoot.lookup( + '.google.cloud.networkconnectivity.v1.OperationMetadata' + ) as gax.protobuf.Type; + + this.descriptors.longrunning = { + createPolicyBasedRoute: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + createPolicyBasedRouteResponse.decode.bind( + createPolicyBasedRouteResponse + ), + createPolicyBasedRouteMetadata.decode.bind( + createPolicyBasedRouteMetadata + ) + ), + deletePolicyBasedRoute: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + deletePolicyBasedRouteResponse.decode.bind( + deletePolicyBasedRouteResponse + ), + deletePolicyBasedRouteMetadata.decode.bind( + deletePolicyBasedRouteMetadata + ) + ), + }; + + // Put together the default options sent with requests. + this._defaults = this._gaxGrpc.constructSettings( + 'google.cloud.networkconnectivity.v1.PolicyBasedRoutingService', + 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.policyBasedRoutingServiceStub) { + return this.policyBasedRoutingServiceStub; + } + + // Put together the "service stub" for + // google.cloud.networkconnectivity.v1.PolicyBasedRoutingService. + this.policyBasedRoutingServiceStub = this._gaxGrpc.createStub( + this._opts.fallback + ? (this._protos as protobuf.Root).lookupService( + 'google.cloud.networkconnectivity.v1.PolicyBasedRoutingService' + ) + : // eslint-disable-next-line @typescript-eslint/no-explicit-any + (this._protos as any).google.cloud.networkconnectivity.v1 + .PolicyBasedRoutingService, + 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 policyBasedRoutingServiceStubMethods = [ + 'listPolicyBasedRoutes', + 'getPolicyBasedRoute', + 'createPolicyBasedRoute', + 'deletePolicyBasedRoute', + ]; + for (const methodName of policyBasedRoutingServiceStubMethods) { + const callPromise = this.policyBasedRoutingServiceStub.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] || + this.descriptors.longrunning[methodName] || + undefined; + const apiCall = this._gaxModule.createApiCall( + callPromise, + this._defaults[methodName], + descriptor, + this._opts.fallback + ); + + this.innerApiCalls[methodName] = apiCall; + } + + return this.policyBasedRoutingServiceStub; + } + + /** + * The DNS address for this API service. + * @returns {string} The DNS address for this service. + */ + static get servicePath() { + return 'networkconnectivity.googleapis.com'; + } + + /** + * The DNS address for this API service - same as servicePath(), + * exists for compatibility reasons. + * @returns {string} The DNS address for this service. + */ + static get apiEndpoint() { + return 'networkconnectivity.googleapis.com'; + } + + /** + * 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 -- + // ------------------- + /** + * Gets details of a single PolicyBasedRoute. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. Name of the PolicyBasedRoute resource to get. + * @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.networkconnectivity.v1.PolicyBasedRoute|PolicyBasedRoute}. + * 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/policy_based_routing_service.get_policy_based_route.js + * region_tag:networkconnectivity_v1_generated_PolicyBasedRoutingService_GetPolicyBasedRoute_async + */ + getPolicyBasedRoute( + request?: protos.google.cloud.networkconnectivity.v1.IGetPolicyBasedRouteRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.networkconnectivity.v1.IPolicyBasedRoute, + ( + | protos.google.cloud.networkconnectivity.v1.IGetPolicyBasedRouteRequest + | undefined + ), + {} | undefined, + ] + >; + getPolicyBasedRoute( + request: protos.google.cloud.networkconnectivity.v1.IGetPolicyBasedRouteRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.networkconnectivity.v1.IPolicyBasedRoute, + | protos.google.cloud.networkconnectivity.v1.IGetPolicyBasedRouteRequest + | null + | undefined, + {} | null | undefined + > + ): void; + getPolicyBasedRoute( + request: protos.google.cloud.networkconnectivity.v1.IGetPolicyBasedRouteRequest, + callback: Callback< + protos.google.cloud.networkconnectivity.v1.IPolicyBasedRoute, + | protos.google.cloud.networkconnectivity.v1.IGetPolicyBasedRouteRequest + | null + | undefined, + {} | null | undefined + > + ): void; + getPolicyBasedRoute( + request?: protos.google.cloud.networkconnectivity.v1.IGetPolicyBasedRouteRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.networkconnectivity.v1.IPolicyBasedRoute, + | protos.google.cloud.networkconnectivity.v1.IGetPolicyBasedRouteRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.networkconnectivity.v1.IPolicyBasedRoute, + | protos.google.cloud.networkconnectivity.v1.IGetPolicyBasedRouteRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.networkconnectivity.v1.IPolicyBasedRoute, + ( + | protos.google.cloud.networkconnectivity.v1.IGetPolicyBasedRouteRequest + | 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(); + return this.innerApiCalls.getPolicyBasedRoute(request, options, callback); + } + + /** + * Creates a new PolicyBasedRoute in a given project and location. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The parent resource's name of the PolicyBasedRoute. + * @param {string} request.policyBasedRouteId + * Required. Unique id for the Policy Based Route to create. + * @param {google.cloud.networkconnectivity.v1.PolicyBasedRoute} request.policyBasedRoute + * Required. Initial values for a new Policy Based Route. + * @param {string} [request.requestId] + * Optional. An optional request ID to identify requests. Specify a unique + * request ID so that if you must retry your request, the server will know to + * ignore the request if it has already been completed. The server will + * guarantee that for at least 60 minutes since the first request. + * + * For example, consider a situation where you make an initial request and + * the request times out. If you make the request again with the same request + * ID, the server can check if original operation with the same request ID + * was received, and if so, will ignore the second request. This prevents + * clients from accidentally creating duplicate commitments. + * + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported (00000000-0000-0000-0000-000000000000). + * @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/policy_based_routing_service.create_policy_based_route.js + * region_tag:networkconnectivity_v1_generated_PolicyBasedRoutingService_CreatePolicyBasedRoute_async + */ + createPolicyBasedRoute( + request?: protos.google.cloud.networkconnectivity.v1.ICreatePolicyBasedRouteRequest, + options?: CallOptions + ): Promise< + [ + LROperation< + protos.google.cloud.networkconnectivity.v1.IPolicyBasedRoute, + protos.google.cloud.networkconnectivity.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined, + ] + >; + createPolicyBasedRoute( + request: protos.google.cloud.networkconnectivity.v1.ICreatePolicyBasedRouteRequest, + options: CallOptions, + callback: Callback< + LROperation< + protos.google.cloud.networkconnectivity.v1.IPolicyBasedRoute, + protos.google.cloud.networkconnectivity.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + createPolicyBasedRoute( + request: protos.google.cloud.networkconnectivity.v1.ICreatePolicyBasedRouteRequest, + callback: Callback< + LROperation< + protos.google.cloud.networkconnectivity.v1.IPolicyBasedRoute, + protos.google.cloud.networkconnectivity.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + createPolicyBasedRoute( + request?: protos.google.cloud.networkconnectivity.v1.ICreatePolicyBasedRouteRequest, + optionsOrCallback?: + | CallOptions + | Callback< + LROperation< + protos.google.cloud.networkconnectivity.v1.IPolicyBasedRoute, + protos.google.cloud.networkconnectivity.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + callback?: Callback< + LROperation< + protos.google.cloud.networkconnectivity.v1.IPolicyBasedRoute, + protos.google.cloud.networkconnectivity.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): Promise< + [ + LROperation< + protos.google.cloud.networkconnectivity.v1.IPolicyBasedRoute, + protos.google.cloud.networkconnectivity.v1.IOperationMetadata + >, + 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(); + return this.innerApiCalls.createPolicyBasedRoute( + request, + options, + callback + ); + } + /** + * Check the status of the long running operation returned by `createPolicyBasedRoute()`. + * @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/policy_based_routing_service.create_policy_based_route.js + * region_tag:networkconnectivity_v1_generated_PolicyBasedRoutingService_CreatePolicyBasedRoute_async + */ + async checkCreatePolicyBasedRouteProgress( + name: string + ): Promise< + LROperation< + protos.google.cloud.networkconnectivity.v1.PolicyBasedRoute, + protos.google.cloud.networkconnectivity.v1.OperationMetadata + > + > { + 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.createPolicyBasedRoute, + this._gaxModule.createDefaultBackoffSettings() + ); + return decodeOperation as LROperation< + protos.google.cloud.networkconnectivity.v1.PolicyBasedRoute, + protos.google.cloud.networkconnectivity.v1.OperationMetadata + >; + } + /** + * Deletes a single PolicyBasedRoute. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. Name of the PolicyBasedRoute resource to delete. + * @param {string} [request.requestId] + * Optional. An optional request ID to identify requests. Specify a unique + * request ID so that if you must retry your request, the server will know to + * ignore the request if it has already been completed. The server will + * guarantee that for at least 60 minutes after the first request. + * + * For example, consider a situation where you make an initial request and + * the request times out. If you make the request again with the same request + * ID, the server can check if original operation with the same request ID + * was received, and if so, will ignore the second request. This prevents + * clients from accidentally creating duplicate commitments. + * + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported (00000000-0000-0000-0000-000000000000). + * @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/policy_based_routing_service.delete_policy_based_route.js + * region_tag:networkconnectivity_v1_generated_PolicyBasedRoutingService_DeletePolicyBasedRoute_async + */ + deletePolicyBasedRoute( + request?: protos.google.cloud.networkconnectivity.v1.IDeletePolicyBasedRouteRequest, + options?: CallOptions + ): Promise< + [ + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.networkconnectivity.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined, + ] + >; + deletePolicyBasedRoute( + request: protos.google.cloud.networkconnectivity.v1.IDeletePolicyBasedRouteRequest, + options: CallOptions, + callback: Callback< + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.networkconnectivity.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + deletePolicyBasedRoute( + request: protos.google.cloud.networkconnectivity.v1.IDeletePolicyBasedRouteRequest, + callback: Callback< + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.networkconnectivity.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + deletePolicyBasedRoute( + request?: protos.google.cloud.networkconnectivity.v1.IDeletePolicyBasedRouteRequest, + optionsOrCallback?: + | CallOptions + | Callback< + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.networkconnectivity.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + callback?: Callback< + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.networkconnectivity.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): Promise< + [ + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.networkconnectivity.v1.IOperationMetadata + >, + 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(); + return this.innerApiCalls.deletePolicyBasedRoute( + request, + options, + callback + ); + } + /** + * Check the status of the long running operation returned by `deletePolicyBasedRoute()`. + * @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/policy_based_routing_service.delete_policy_based_route.js + * region_tag:networkconnectivity_v1_generated_PolicyBasedRoutingService_DeletePolicyBasedRoute_async + */ + async checkDeletePolicyBasedRouteProgress( + name: string + ): Promise< + LROperation< + protos.google.protobuf.Empty, + protos.google.cloud.networkconnectivity.v1.OperationMetadata + > + > { + 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.deletePolicyBasedRoute, + this._gaxModule.createDefaultBackoffSettings() + ); + return decodeOperation as LROperation< + protos.google.protobuf.Empty, + protos.google.cloud.networkconnectivity.v1.OperationMetadata + >; + } + /** + * Lists PolicyBasedRoutes in a given project and location. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The parent resource's name. + * @param {number} request.pageSize + * The maximum number of results per page that should be returned. + * @param {string} request.pageToken + * The page token. + * @param {string} request.filter + * A filter expression that filters the results listed in the response. + * @param {string} request.orderBy + * Sort the results by a certain order. + * @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.networkconnectivity.v1.PolicyBasedRoute|PolicyBasedRoute}. + * 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 `listPolicyBasedRoutesAsync()` + * 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. + */ + listPolicyBasedRoutes( + request?: protos.google.cloud.networkconnectivity.v1.IListPolicyBasedRoutesRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.networkconnectivity.v1.IPolicyBasedRoute[], + protos.google.cloud.networkconnectivity.v1.IListPolicyBasedRoutesRequest | null, + protos.google.cloud.networkconnectivity.v1.IListPolicyBasedRoutesResponse, + ] + >; + listPolicyBasedRoutes( + request: protos.google.cloud.networkconnectivity.v1.IListPolicyBasedRoutesRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.cloud.networkconnectivity.v1.IListPolicyBasedRoutesRequest, + | protos.google.cloud.networkconnectivity.v1.IListPolicyBasedRoutesResponse + | null + | undefined, + protos.google.cloud.networkconnectivity.v1.IPolicyBasedRoute + > + ): void; + listPolicyBasedRoutes( + request: protos.google.cloud.networkconnectivity.v1.IListPolicyBasedRoutesRequest, + callback: PaginationCallback< + protos.google.cloud.networkconnectivity.v1.IListPolicyBasedRoutesRequest, + | protos.google.cloud.networkconnectivity.v1.IListPolicyBasedRoutesResponse + | null + | undefined, + protos.google.cloud.networkconnectivity.v1.IPolicyBasedRoute + > + ): void; + listPolicyBasedRoutes( + request?: protos.google.cloud.networkconnectivity.v1.IListPolicyBasedRoutesRequest, + optionsOrCallback?: + | CallOptions + | PaginationCallback< + protos.google.cloud.networkconnectivity.v1.IListPolicyBasedRoutesRequest, + | protos.google.cloud.networkconnectivity.v1.IListPolicyBasedRoutesResponse + | null + | undefined, + protos.google.cloud.networkconnectivity.v1.IPolicyBasedRoute + >, + callback?: PaginationCallback< + protos.google.cloud.networkconnectivity.v1.IListPolicyBasedRoutesRequest, + | protos.google.cloud.networkconnectivity.v1.IListPolicyBasedRoutesResponse + | null + | undefined, + protos.google.cloud.networkconnectivity.v1.IPolicyBasedRoute + > + ): Promise< + [ + protos.google.cloud.networkconnectivity.v1.IPolicyBasedRoute[], + protos.google.cloud.networkconnectivity.v1.IListPolicyBasedRoutesRequest | null, + protos.google.cloud.networkconnectivity.v1.IListPolicyBasedRoutesResponse, + ] + > | 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(); + return this.innerApiCalls.listPolicyBasedRoutes(request, options, callback); + } + + /** + * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The parent resource's name. + * @param {number} request.pageSize + * The maximum number of results per page that should be returned. + * @param {string} request.pageToken + * The page token. + * @param {string} request.filter + * A filter expression that filters the results listed in the response. + * @param {string} request.orderBy + * Sort the results by a certain order. + * @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.networkconnectivity.v1.PolicyBasedRoute|PolicyBasedRoute} 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 `listPolicyBasedRoutesAsync()` + * 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. + */ + listPolicyBasedRoutesStream( + request?: protos.google.cloud.networkconnectivity.v1.IListPolicyBasedRoutesRequest, + 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['listPolicyBasedRoutes']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.listPolicyBasedRoutes.createStream( + this.innerApiCalls.listPolicyBasedRoutes as GaxCall, + request, + callSettings + ); + } + + /** + * Equivalent to `listPolicyBasedRoutes`, 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 resource's name. + * @param {number} request.pageSize + * The maximum number of results per page that should be returned. + * @param {string} request.pageToken + * The page token. + * @param {string} request.filter + * A filter expression that filters the results listed in the response. + * @param {string} request.orderBy + * Sort the results by a certain order. + * @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.networkconnectivity.v1.PolicyBasedRoute|PolicyBasedRoute}. 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/policy_based_routing_service.list_policy_based_routes.js + * region_tag:networkconnectivity_v1_generated_PolicyBasedRoutingService_ListPolicyBasedRoutes_async + */ + listPolicyBasedRoutesAsync( + request?: protos.google.cloud.networkconnectivity.v1.IListPolicyBasedRoutesRequest, + 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['listPolicyBasedRoutes']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.listPolicyBasedRoutes.asyncIterate( + this.innerApiCalls['listPolicyBasedRoutes'] as GaxCall, + request as {}, + callSettings + ) as AsyncIterable; + } + /** + * Gets the access control policy for a resource. Returns an empty policy + * if the resource exists and does not have a policy set. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.resource + * REQUIRED: The resource for which the policy is being requested. + * See the operation documentation for the appropriate value for this field. + * @param {Object} [request.options] + * OPTIONAL: A `GetPolicyOptions` object for specifying options to + * `GetIamPolicy`. This field is only used by Cloud IAM. + * + * This object should have the same structure as {@link google.iam.v1.GetPolicyOptions | GetPolicyOptions}. + * @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/interfaces/CallOptions.html | 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.iam.v1.Policy | Policy}. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link google.iam.v1.Policy | Policy}. + * The promise has a method named "cancel" which cancels the ongoing API call. + */ + getIamPolicy( + request: IamProtos.google.iam.v1.GetIamPolicyRequest, + options?: + | gax.CallOptions + | Callback< + IamProtos.google.iam.v1.Policy, + IamProtos.google.iam.v1.GetIamPolicyRequest | null | undefined, + {} | null | undefined + >, + callback?: Callback< + IamProtos.google.iam.v1.Policy, + IamProtos.google.iam.v1.GetIamPolicyRequest | null | undefined, + {} | null | undefined + > + ): Promise<[IamProtos.google.iam.v1.Policy]> { + return this.iamClient.getIamPolicy(request, options, callback); + } + + /** + * Returns permissions that a caller has on the specified resource. If the + * resource does not exist, this will return an empty set of + * permissions, not a NOT_FOUND error. + * + * Note: This operation is designed to be used for building + * permission-aware UIs and command-line tools, not for authorization + * checking. This operation may "fail open" without warning. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.resource + * REQUIRED: The resource for which the policy detail is being requested. + * See the operation documentation for the appropriate value for this field. + * @param {string[]} request.permissions + * The set of permissions to check for the `resource`. Permissions with + * wildcards (such as '*' or 'storage.*') are not allowed. For more + * information see {@link https://cloud.google.com/iam/docs/overview#permissions | IAM Overview }. + * @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/interfaces/CallOptions.html | 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.iam.v1.TestIamPermissionsResponse | TestIamPermissionsResponse}. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link google.iam.v1.TestIamPermissionsResponse | TestIamPermissionsResponse}. + * The promise has a method named "cancel" which cancels the ongoing API call. + */ + setIamPolicy( + request: IamProtos.google.iam.v1.SetIamPolicyRequest, + options?: + | gax.CallOptions + | Callback< + IamProtos.google.iam.v1.Policy, + IamProtos.google.iam.v1.SetIamPolicyRequest | null | undefined, + {} | null | undefined + >, + callback?: Callback< + IamProtos.google.iam.v1.Policy, + IamProtos.google.iam.v1.SetIamPolicyRequest | null | undefined, + {} | null | undefined + > + ): Promise<[IamProtos.google.iam.v1.Policy]> { + return this.iamClient.setIamPolicy(request, options, callback); + } + + /** + * Returns permissions that a caller has on the specified resource. If the + * resource does not exist, this will return an empty set of + * permissions, not a NOT_FOUND error. + * + * Note: This operation is designed to be used for building + * permission-aware UIs and command-line tools, not for authorization + * checking. This operation may "fail open" without warning. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.resource + * REQUIRED: The resource for which the policy detail is being requested. + * See the operation documentation for the appropriate value for this field. + * @param {string[]} request.permissions + * The set of permissions to check for the `resource`. Permissions with + * wildcards (such as '*' or 'storage.*') are not allowed. For more + * information see {@link https://cloud.google.com/iam/docs/overview#permissions | IAM Overview }. + * @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/interfaces/CallOptions.html | 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.iam.v1.TestIamPermissionsResponse | TestIamPermissionsResponse}. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link google.iam.v1.TestIamPermissionsResponse | TestIamPermissionsResponse}. + * The promise has a method named "cancel" which cancels the ongoing API call. + * + */ + testIamPermissions( + request: IamProtos.google.iam.v1.TestIamPermissionsRequest, + options?: + | gax.CallOptions + | Callback< + IamProtos.google.iam.v1.TestIamPermissionsResponse, + IamProtos.google.iam.v1.TestIamPermissionsRequest | null | undefined, + {} | null | undefined + >, + callback?: Callback< + IamProtos.google.iam.v1.TestIamPermissionsResponse, + IamProtos.google.iam.v1.TestIamPermissionsRequest | null | undefined, + {} | null | undefined + > + ): Promise<[IamProtos.google.iam.v1.TestIamPermissionsResponse]> { + return this.iamClient.testIamPermissions(request, options, callback); + } + + /** + * 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, + options?: + | 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]> { + 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 { + 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, + options?: + | gax.CallOptions + | Callback< + protos.google.protobuf.Empty, + protos.google.longrunning.CancelOperationRequest, + {} | undefined | null + >, + callback?: Callback< + protos.google.longrunning.CancelOperationRequest, + protos.google.protobuf.Empty, + {} | undefined | null + > + ): Promise { + 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, + options?: + | 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 { + return this.operationsClient.deleteOperation(request, options, callback); + } + + // -------------------- + // -- Path templates -- + // -------------------- + + /** + * Return a fully-qualified hub resource name string. + * + * @param {string} project + * @param {string} hub + * @returns {string} Resource name string. + */ + hubPath(project: string, hub: string) { + return this.pathTemplates.hubPathTemplate.render({ + project: project, + hub: hub, + }); + } + + /** + * Parse the project from Hub resource. + * + * @param {string} hubName + * A fully-qualified path representing Hub resource. + * @returns {string} A string representing the project. + */ + matchProjectFromHubName(hubName: string) { + return this.pathTemplates.hubPathTemplate.match(hubName).project; + } + + /** + * Parse the hub from Hub resource. + * + * @param {string} hubName + * A fully-qualified path representing Hub resource. + * @returns {string} A string representing the hub. + */ + matchHubFromHubName(hubName: string) { + return this.pathTemplates.hubPathTemplate.match(hubName).hub; + } + + /** + * 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 network resource name string. + * + * @param {string} project + * @param {string} resource_id + * @returns {string} Resource name string. + */ + networkPath(project: string, resourceId: string) { + return this.pathTemplates.networkPathTemplate.render({ + project: project, + resource_id: resourceId, + }); + } + + /** + * Parse the project from Network resource. + * + * @param {string} networkName + * A fully-qualified path representing Network resource. + * @returns {string} A string representing the project. + */ + matchProjectFromNetworkName(networkName: string) { + return this.pathTemplates.networkPathTemplate.match(networkName).project; + } + + /** + * Parse the resource_id from Network resource. + * + * @param {string} networkName + * A fully-qualified path representing Network resource. + * @returns {string} A string representing the resource_id. + */ + matchResourceIdFromNetworkName(networkName: string) { + return this.pathTemplates.networkPathTemplate.match(networkName) + .resource_id; + } + + /** + * Return a fully-qualified policyBasedRoute resource name string. + * + * @param {string} project + * @param {string} policy_based_route + * @returns {string} Resource name string. + */ + policyBasedRoutePath(project: string, policyBasedRoute: string) { + return this.pathTemplates.policyBasedRoutePathTemplate.render({ + project: project, + policy_based_route: policyBasedRoute, + }); + } + + /** + * Parse the project from PolicyBasedRoute resource. + * + * @param {string} policyBasedRouteName + * A fully-qualified path representing PolicyBasedRoute resource. + * @returns {string} A string representing the project. + */ + matchProjectFromPolicyBasedRouteName(policyBasedRouteName: string) { + return this.pathTemplates.policyBasedRoutePathTemplate.match( + policyBasedRouteName + ).project; + } + + /** + * Parse the policy_based_route from PolicyBasedRoute resource. + * + * @param {string} policyBasedRouteName + * A fully-qualified path representing PolicyBasedRoute resource. + * @returns {string} A string representing the policy_based_route. + */ + matchPolicyBasedRouteFromPolicyBasedRouteName(policyBasedRouteName: string) { + return this.pathTemplates.policyBasedRoutePathTemplate.match( + policyBasedRouteName + ).policy_based_route; + } + + /** + * Return a fully-qualified spoke resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} spoke + * @returns {string} Resource name string. + */ + spokePath(project: string, location: string, spoke: string) { + return this.pathTemplates.spokePathTemplate.render({ + project: project, + location: location, + spoke: spoke, + }); + } + + /** + * Parse the project from Spoke resource. + * + * @param {string} spokeName + * A fully-qualified path representing Spoke resource. + * @returns {string} A string representing the project. + */ + matchProjectFromSpokeName(spokeName: string) { + return this.pathTemplates.spokePathTemplate.match(spokeName).project; + } + + /** + * Parse the location from Spoke resource. + * + * @param {string} spokeName + * A fully-qualified path representing Spoke resource. + * @returns {string} A string representing the location. + */ + matchLocationFromSpokeName(spokeName: string) { + return this.pathTemplates.spokePathTemplate.match(spokeName).location; + } + + /** + * Parse the spoke from Spoke resource. + * + * @param {string} spokeName + * A fully-qualified path representing Spoke resource. + * @returns {string} A string representing the spoke. + */ + matchSpokeFromSpokeName(spokeName: string) { + return this.pathTemplates.spokePathTemplate.match(spokeName).spoke; + } + + /** + * 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.policyBasedRoutingServiceStub && !this._terminated) { + return this.policyBasedRoutingServiceStub.then(stub => { + this._terminated = true; + stub.close(); + this.iamClient.close(); + this.locationsClient.close(); + this.operationsClient.close(); + }); + } + return Promise.resolve(); + } +} diff --git a/packages/google-cloud-networkconnectivity/src/v1/policy_based_routing_service_client_config.json b/packages/google-cloud-networkconnectivity/src/v1/policy_based_routing_service_client_config.json new file mode 100644 index 00000000000..d204ef942c8 --- /dev/null +++ b/packages/google-cloud-networkconnectivity/src/v1/policy_based_routing_service_client_config.json @@ -0,0 +1,58 @@ +{ + "interfaces": { + "google.cloud.networkconnectivity.v1.PolicyBasedRoutingService": { + "retry_codes": { + "non_idempotent": [], + "idempotent": [ + "DEADLINE_EXCEEDED", + "UNAVAILABLE" + ], + "unavailable": [ + "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 + }, + "ce5b960a6ed052e690863808e4f0deff3dc7d49f": { + "initial_retry_delay_millis": 1000, + "retry_delay_multiplier": 1.3, + "max_retry_delay_millis": 10000, + "initial_rpc_timeout_millis": 60000, + "rpc_timeout_multiplier": 1, + "max_rpc_timeout_millis": 60000, + "total_timeout_millis": 600000 + } + }, + "methods": { + "ListPolicyBasedRoutes": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "ce5b960a6ed052e690863808e4f0deff3dc7d49f" + }, + "GetPolicyBasedRoute": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "ce5b960a6ed052e690863808e4f0deff3dc7d49f" + }, + "CreatePolicyBasedRoute": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "DeletePolicyBasedRoute": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + } + } + } + } +} diff --git a/packages/google-cloud-networkconnectivity/src/v1/policy_based_routing_service_proto_list.json b/packages/google-cloud-networkconnectivity/src/v1/policy_based_routing_service_proto_list.json new file mode 100644 index 00000000000..d076e60ee41 --- /dev/null +++ b/packages/google-cloud-networkconnectivity/src/v1/policy_based_routing_service_proto_list.json @@ -0,0 +1,5 @@ +[ + "../../protos/google/cloud/networkconnectivity/v1/common.proto", + "../../protos/google/cloud/networkconnectivity/v1/hub.proto", + "../../protos/google/cloud/networkconnectivity/v1/policy_based_routing.proto" +] diff --git a/packages/google-cloud-networkconnectivity/system-test/fixtures/sample/src/index.js b/packages/google-cloud-networkconnectivity/system-test/fixtures/sample/src/index.js index 7f6ba4c79f7..27c8430d34d 100644 --- a/packages/google-cloud-networkconnectivity/system-test/fixtures/sample/src/index.js +++ b/packages/google-cloud-networkconnectivity/system-test/fixtures/sample/src/index.js @@ -21,6 +21,8 @@ const networkconnectivity = require('@google-cloud/network-connectivity'); function main() { const hubServiceClient = new networkconnectivity.HubServiceClient(); + const policyBasedRoutingServiceClient = + new networkconnectivity.PolicyBasedRoutingServiceClient(); } main(); diff --git a/packages/google-cloud-networkconnectivity/system-test/fixtures/sample/src/index.ts b/packages/google-cloud-networkconnectivity/system-test/fixtures/sample/src/index.ts index ae4d979ece8..f2dc2964b5f 100644 --- a/packages/google-cloud-networkconnectivity/system-test/fixtures/sample/src/index.ts +++ b/packages/google-cloud-networkconnectivity/system-test/fixtures/sample/src/index.ts @@ -16,17 +16,28 @@ // ** https://github.com/googleapis/gapic-generator-typescript ** // ** All changes to this file may be overwritten. ** -import {HubServiceClient} from '@google-cloud/network-connectivity'; +import { + HubServiceClient, + PolicyBasedRoutingServiceClient, +} from '@google-cloud/network-connectivity'; // check that the client class type name can be used function doStuffWithHubServiceClient(client: HubServiceClient) { client.close(); } +function doStuffWithPolicyBasedRoutingServiceClient( + client: PolicyBasedRoutingServiceClient +) { + client.close(); +} function main() { // check that the client instance can be created const hubServiceClient = new HubServiceClient(); doStuffWithHubServiceClient(hubServiceClient); + // check that the client instance can be created + const policyBasedRoutingServiceClient = new PolicyBasedRoutingServiceClient(); + doStuffWithPolicyBasedRoutingServiceClient(policyBasedRoutingServiceClient); } main(); diff --git a/packages/google-cloud-networkconnectivity/test/gapic_hub_service_v1.ts b/packages/google-cloud-networkconnectivity/test/gapic_hub_service_v1.ts index 18ff187f527..b6c5a65bae8 100644 --- a/packages/google-cloud-networkconnectivity/test/gapic_hub_service_v1.ts +++ b/packages/google-cloud-networkconnectivity/test/gapic_hub_service_v1.ts @@ -3439,6 +3439,62 @@ describe('v1.HubServiceClient', () => { }); }); + describe('policyBasedRoute', () => { + const fakePath = '/rendered/path/policyBasedRoute'; + const expectedParameters = { + project: 'projectValue', + policy_based_route: 'policyBasedRouteValue', + }; + const client = new hubserviceModule.v1.HubServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.policyBasedRoutePathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.policyBasedRoutePathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('policyBasedRoutePath', () => { + const result = client.policyBasedRoutePath( + 'projectValue', + 'policyBasedRouteValue' + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates.policyBasedRoutePathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromPolicyBasedRouteName', () => { + const result = client.matchProjectFromPolicyBasedRouteName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.policyBasedRoutePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchPolicyBasedRouteFromPolicyBasedRouteName', () => { + const result = + client.matchPolicyBasedRouteFromPolicyBasedRouteName(fakePath); + assert.strictEqual(result, 'policyBasedRouteValue'); + assert( + (client.pathTemplates.policyBasedRoutePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + describe('spoke', () => { const fakePath = '/rendered/path/spoke'; const expectedParameters = { diff --git a/packages/google-cloud-networkconnectivity/test/gapic_policy_based_routing_service_v1.ts b/packages/google-cloud-networkconnectivity/test/gapic_policy_based_routing_service_v1.ts new file mode 100644 index 00000000000..8d15c21b5e3 --- /dev/null +++ b/packages/google-cloud-networkconnectivity/test/gapic_policy_based_routing_service_v1.ts @@ -0,0 +1,2310 @@ +// Copyright 2023 Google LLC +// +// Licensed under the Apache License, Version 2.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 policybasedroutingserviceModule from '../src'; + +import {PassThrough} from 'stream'; + +import { + protobuf, + LROperation, + operationsProtos, + IamProtos, + 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 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('v1.PolicyBasedRoutingServiceClient', () => { + describe('Common methods', () => { + it('has servicePath', () => { + const servicePath = + policybasedroutingserviceModule.v1.PolicyBasedRoutingServiceClient + .servicePath; + assert(servicePath); + }); + + it('has apiEndpoint', () => { + const apiEndpoint = + policybasedroutingserviceModule.v1.PolicyBasedRoutingServiceClient + .apiEndpoint; + assert(apiEndpoint); + }); + + it('has port', () => { + const port = + policybasedroutingserviceModule.v1.PolicyBasedRoutingServiceClient.port; + assert(port); + assert(typeof port === 'number'); + }); + + it('should create a client with no option', () => { + const client = + new policybasedroutingserviceModule.v1.PolicyBasedRoutingServiceClient(); + assert(client); + }); + + it('should create a client with gRPC fallback', () => { + const client = + new policybasedroutingserviceModule.v1.PolicyBasedRoutingServiceClient({ + fallback: true, + }); + assert(client); + }); + + it('has initialize method and supports deferred initialization', async () => { + const client = + new policybasedroutingserviceModule.v1.PolicyBasedRoutingServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + assert.strictEqual(client.policyBasedRoutingServiceStub, undefined); + await client.initialize(); + assert(client.policyBasedRoutingServiceStub); + }); + + it('has close method for the initialized client', done => { + const client = + new policybasedroutingserviceModule.v1.PolicyBasedRoutingServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + assert(client.policyBasedRoutingServiceStub); + client.close().then(() => { + done(); + }); + }); + + it('has close method for the non-initialized client', done => { + const client = + new policybasedroutingserviceModule.v1.PolicyBasedRoutingServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + assert.strictEqual(client.policyBasedRoutingServiceStub, undefined); + client.close().then(() => { + done(); + }); + }); + + it('has getProjectId method', async () => { + const fakeProjectId = 'fake-project-id'; + const client = + new policybasedroutingserviceModule.v1.PolicyBasedRoutingServiceClient({ + 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 policybasedroutingserviceModule.v1.PolicyBasedRoutingServiceClient({ + 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('getPolicyBasedRoute', () => { + it('invokes getPolicyBasedRoute without error', async () => { + const client = + new policybasedroutingserviceModule.v1.PolicyBasedRoutingServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.networkconnectivity.v1.GetPolicyBasedRouteRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.networkconnectivity.v1.GetPolicyBasedRouteRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.networkconnectivity.v1.PolicyBasedRoute() + ); + client.innerApiCalls.getPolicyBasedRoute = + stubSimpleCall(expectedResponse); + const [response] = await client.getPolicyBasedRoute(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.getPolicyBasedRoute as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getPolicyBasedRoute as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getPolicyBasedRoute without error using callback', async () => { + const client = + new policybasedroutingserviceModule.v1.PolicyBasedRoutingServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.networkconnectivity.v1.GetPolicyBasedRouteRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.networkconnectivity.v1.GetPolicyBasedRouteRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.networkconnectivity.v1.PolicyBasedRoute() + ); + client.innerApiCalls.getPolicyBasedRoute = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getPolicyBasedRoute( + request, + ( + err?: Error | null, + result?: protos.google.cloud.networkconnectivity.v1.IPolicyBasedRoute | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.getPolicyBasedRoute as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getPolicyBasedRoute as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getPolicyBasedRoute with error', async () => { + const client = + new policybasedroutingserviceModule.v1.PolicyBasedRoutingServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.networkconnectivity.v1.GetPolicyBasedRouteRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.networkconnectivity.v1.GetPolicyBasedRouteRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.getPolicyBasedRoute = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.getPolicyBasedRoute(request), expectedError); + const actualRequest = ( + client.innerApiCalls.getPolicyBasedRoute as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getPolicyBasedRoute as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getPolicyBasedRoute with closed client', async () => { + const client = + new policybasedroutingserviceModule.v1.PolicyBasedRoutingServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.networkconnectivity.v1.GetPolicyBasedRouteRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.networkconnectivity.v1.GetPolicyBasedRouteRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.getPolicyBasedRoute(request), expectedError); + }); + }); + + describe('createPolicyBasedRoute', () => { + it('invokes createPolicyBasedRoute without error', async () => { + const client = + new policybasedroutingserviceModule.v1.PolicyBasedRoutingServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.networkconnectivity.v1.CreatePolicyBasedRouteRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.networkconnectivity.v1.CreatePolicyBasedRouteRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.createPolicyBasedRoute = + stubLongRunningCall(expectedResponse); + const [operation] = await client.createPolicyBasedRoute(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.createPolicyBasedRoute as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createPolicyBasedRoute as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createPolicyBasedRoute without error using callback', async () => { + const client = + new policybasedroutingserviceModule.v1.PolicyBasedRoutingServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.networkconnectivity.v1.CreatePolicyBasedRouteRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.networkconnectivity.v1.CreatePolicyBasedRouteRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.createPolicyBasedRoute = + stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.createPolicyBasedRoute( + request, + ( + err?: Error | null, + result?: LROperation< + protos.google.cloud.networkconnectivity.v1.IPolicyBasedRoute, + protos.google.cloud.networkconnectivity.v1.IOperationMetadata + > | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const operation = (await promise) as LROperation< + protos.google.cloud.networkconnectivity.v1.IPolicyBasedRoute, + protos.google.cloud.networkconnectivity.v1.IOperationMetadata + >; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.createPolicyBasedRoute as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createPolicyBasedRoute as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createPolicyBasedRoute with call error', async () => { + const client = + new policybasedroutingserviceModule.v1.PolicyBasedRoutingServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.networkconnectivity.v1.CreatePolicyBasedRouteRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.networkconnectivity.v1.CreatePolicyBasedRouteRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.createPolicyBasedRoute = stubLongRunningCall( + undefined, + expectedError + ); + await assert.rejects( + client.createPolicyBasedRoute(request), + expectedError + ); + const actualRequest = ( + client.innerApiCalls.createPolicyBasedRoute as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createPolicyBasedRoute as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createPolicyBasedRoute with LRO error', async () => { + const client = + new policybasedroutingserviceModule.v1.PolicyBasedRoutingServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.networkconnectivity.v1.CreatePolicyBasedRouteRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.networkconnectivity.v1.CreatePolicyBasedRouteRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.createPolicyBasedRoute = stubLongRunningCall( + undefined, + undefined, + expectedError + ); + const [operation] = await client.createPolicyBasedRoute(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = ( + client.innerApiCalls.createPolicyBasedRoute as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createPolicyBasedRoute as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkCreatePolicyBasedRouteProgress without error', async () => { + const client = + new policybasedroutingserviceModule.v1.PolicyBasedRoutingServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + 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.checkCreatePolicyBasedRouteProgress( + expectedResponse.name + ); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkCreatePolicyBasedRouteProgress with error', async () => { + const client = + new policybasedroutingserviceModule.v1.PolicyBasedRoutingServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const expectedError = new Error('expected'); + + client.operationsClient.getOperation = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects( + client.checkCreatePolicyBasedRouteProgress(''), + expectedError + ); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + }); + + describe('deletePolicyBasedRoute', () => { + it('invokes deletePolicyBasedRoute without error', async () => { + const client = + new policybasedroutingserviceModule.v1.PolicyBasedRoutingServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.networkconnectivity.v1.DeletePolicyBasedRouteRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.networkconnectivity.v1.DeletePolicyBasedRouteRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.deletePolicyBasedRoute = + stubLongRunningCall(expectedResponse); + const [operation] = await client.deletePolicyBasedRoute(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.deletePolicyBasedRoute as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deletePolicyBasedRoute as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deletePolicyBasedRoute without error using callback', async () => { + const client = + new policybasedroutingserviceModule.v1.PolicyBasedRoutingServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.networkconnectivity.v1.DeletePolicyBasedRouteRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.networkconnectivity.v1.DeletePolicyBasedRouteRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.deletePolicyBasedRoute = + stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.deletePolicyBasedRoute( + request, + ( + err?: Error | null, + result?: LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.networkconnectivity.v1.IOperationMetadata + > | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const operation = (await promise) as LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.networkconnectivity.v1.IOperationMetadata + >; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.deletePolicyBasedRoute as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deletePolicyBasedRoute as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deletePolicyBasedRoute with call error', async () => { + const client = + new policybasedroutingserviceModule.v1.PolicyBasedRoutingServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.networkconnectivity.v1.DeletePolicyBasedRouteRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.networkconnectivity.v1.DeletePolicyBasedRouteRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.deletePolicyBasedRoute = stubLongRunningCall( + undefined, + expectedError + ); + await assert.rejects( + client.deletePolicyBasedRoute(request), + expectedError + ); + const actualRequest = ( + client.innerApiCalls.deletePolicyBasedRoute as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deletePolicyBasedRoute as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deletePolicyBasedRoute with LRO error', async () => { + const client = + new policybasedroutingserviceModule.v1.PolicyBasedRoutingServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.networkconnectivity.v1.DeletePolicyBasedRouteRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.networkconnectivity.v1.DeletePolicyBasedRouteRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.deletePolicyBasedRoute = stubLongRunningCall( + undefined, + undefined, + expectedError + ); + const [operation] = await client.deletePolicyBasedRoute(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = ( + client.innerApiCalls.deletePolicyBasedRoute as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deletePolicyBasedRoute as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkDeletePolicyBasedRouteProgress without error', async () => { + const client = + new policybasedroutingserviceModule.v1.PolicyBasedRoutingServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + 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.checkDeletePolicyBasedRouteProgress( + expectedResponse.name + ); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkDeletePolicyBasedRouteProgress with error', async () => { + const client = + new policybasedroutingserviceModule.v1.PolicyBasedRoutingServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const expectedError = new Error('expected'); + + client.operationsClient.getOperation = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects( + client.checkDeletePolicyBasedRouteProgress(''), + expectedError + ); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + }); + + describe('listPolicyBasedRoutes', () => { + it('invokes listPolicyBasedRoutes without error', async () => { + const client = + new policybasedroutingserviceModule.v1.PolicyBasedRoutingServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.networkconnectivity.v1.ListPolicyBasedRoutesRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.networkconnectivity.v1.ListPolicyBasedRoutesRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.networkconnectivity.v1.PolicyBasedRoute() + ), + generateSampleMessage( + new protos.google.cloud.networkconnectivity.v1.PolicyBasedRoute() + ), + generateSampleMessage( + new protos.google.cloud.networkconnectivity.v1.PolicyBasedRoute() + ), + ]; + client.innerApiCalls.listPolicyBasedRoutes = + stubSimpleCall(expectedResponse); + const [response] = await client.listPolicyBasedRoutes(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.listPolicyBasedRoutes as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listPolicyBasedRoutes as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listPolicyBasedRoutes without error using callback', async () => { + const client = + new policybasedroutingserviceModule.v1.PolicyBasedRoutingServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.networkconnectivity.v1.ListPolicyBasedRoutesRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.networkconnectivity.v1.ListPolicyBasedRoutesRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.networkconnectivity.v1.PolicyBasedRoute() + ), + generateSampleMessage( + new protos.google.cloud.networkconnectivity.v1.PolicyBasedRoute() + ), + generateSampleMessage( + new protos.google.cloud.networkconnectivity.v1.PolicyBasedRoute() + ), + ]; + client.innerApiCalls.listPolicyBasedRoutes = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.listPolicyBasedRoutes( + request, + ( + err?: Error | null, + result?: + | protos.google.cloud.networkconnectivity.v1.IPolicyBasedRoute[] + | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.listPolicyBasedRoutes as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listPolicyBasedRoutes as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listPolicyBasedRoutes with error', async () => { + const client = + new policybasedroutingserviceModule.v1.PolicyBasedRoutingServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.networkconnectivity.v1.ListPolicyBasedRoutesRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.networkconnectivity.v1.ListPolicyBasedRoutesRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.listPolicyBasedRoutes = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects( + client.listPolicyBasedRoutes(request), + expectedError + ); + const actualRequest = ( + client.innerApiCalls.listPolicyBasedRoutes as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listPolicyBasedRoutes as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listPolicyBasedRoutesStream without error', async () => { + const client = + new policybasedroutingserviceModule.v1.PolicyBasedRoutingServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.networkconnectivity.v1.ListPolicyBasedRoutesRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.networkconnectivity.v1.ListPolicyBasedRoutesRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.networkconnectivity.v1.PolicyBasedRoute() + ), + generateSampleMessage( + new protos.google.cloud.networkconnectivity.v1.PolicyBasedRoute() + ), + generateSampleMessage( + new protos.google.cloud.networkconnectivity.v1.PolicyBasedRoute() + ), + ]; + client.descriptors.page.listPolicyBasedRoutes.createStream = + stubPageStreamingCall(expectedResponse); + const stream = client.listPolicyBasedRoutesStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.networkconnectivity.v1.PolicyBasedRoute[] = + []; + stream.on( + 'data', + ( + response: protos.google.cloud.networkconnectivity.v1.PolicyBasedRoute + ) => { + 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.listPolicyBasedRoutes + .createStream as SinonStub + ) + .getCall(0) + .calledWith(client.innerApiCalls.listPolicyBasedRoutes, request) + ); + assert( + ( + client.descriptors.page.listPolicyBasedRoutes + .createStream as SinonStub + ) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('invokes listPolicyBasedRoutesStream with error', async () => { + const client = + new policybasedroutingserviceModule.v1.PolicyBasedRoutingServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.networkconnectivity.v1.ListPolicyBasedRoutesRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.networkconnectivity.v1.ListPolicyBasedRoutesRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.descriptors.page.listPolicyBasedRoutes.createStream = + stubPageStreamingCall(undefined, expectedError); + const stream = client.listPolicyBasedRoutesStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.networkconnectivity.v1.PolicyBasedRoute[] = + []; + stream.on( + 'data', + ( + response: protos.google.cloud.networkconnectivity.v1.PolicyBasedRoute + ) => { + responses.push(response); + } + ); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert( + ( + client.descriptors.page.listPolicyBasedRoutes + .createStream as SinonStub + ) + .getCall(0) + .calledWith(client.innerApiCalls.listPolicyBasedRoutes, request) + ); + assert( + ( + client.descriptors.page.listPolicyBasedRoutes + .createStream as SinonStub + ) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listPolicyBasedRoutes without error', async () => { + const client = + new policybasedroutingserviceModule.v1.PolicyBasedRoutingServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.networkconnectivity.v1.ListPolicyBasedRoutesRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.networkconnectivity.v1.ListPolicyBasedRoutesRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.networkconnectivity.v1.PolicyBasedRoute() + ), + generateSampleMessage( + new protos.google.cloud.networkconnectivity.v1.PolicyBasedRoute() + ), + generateSampleMessage( + new protos.google.cloud.networkconnectivity.v1.PolicyBasedRoute() + ), + ]; + client.descriptors.page.listPolicyBasedRoutes.asyncIterate = + stubAsyncIterationCall(expectedResponse); + const responses: protos.google.cloud.networkconnectivity.v1.IPolicyBasedRoute[] = + []; + const iterable = client.listPolicyBasedRoutesAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + ( + client.descriptors.page.listPolicyBasedRoutes + .asyncIterate as SinonStub + ).getCall(0).args[1], + request + ); + assert( + ( + client.descriptors.page.listPolicyBasedRoutes + .asyncIterate as SinonStub + ) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listPolicyBasedRoutes with error', async () => { + const client = + new policybasedroutingserviceModule.v1.PolicyBasedRoutingServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.networkconnectivity.v1.ListPolicyBasedRoutesRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.networkconnectivity.v1.ListPolicyBasedRoutesRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.descriptors.page.listPolicyBasedRoutes.asyncIterate = + stubAsyncIterationCall(undefined, expectedError); + const iterable = client.listPolicyBasedRoutesAsync(request); + await assert.rejects(async () => { + const responses: protos.google.cloud.networkconnectivity.v1.IPolicyBasedRoute[] = + []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + ( + client.descriptors.page.listPolicyBasedRoutes + .asyncIterate as SinonStub + ).getCall(0).args[1], + request + ); + assert( + ( + client.descriptors.page.listPolicyBasedRoutes + .asyncIterate as SinonStub + ) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + }); + describe('getIamPolicy', () => { + it('invokes getIamPolicy without error', async () => { + const client = + new policybasedroutingserviceModule.v1.PolicyBasedRoutingServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new IamProtos.google.iam.v1.GetIamPolicyRequest() + ); + request.resource = ''; + const expectedHeaderRequestParams = 'resource='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new IamProtos.google.iam.v1.Policy() + ); + client.iamClient.getIamPolicy = stubSimpleCall(expectedResponse); + const response = await client.getIamPolicy(request, expectedOptions); + assert.deepStrictEqual(response, [expectedResponse]); + assert( + (client.iamClient.getIamPolicy as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + it('invokes getIamPolicy without error using callback', async () => { + const client = + new policybasedroutingserviceModule.v1.PolicyBasedRoutingServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new IamProtos.google.iam.v1.GetIamPolicyRequest() + ); + request.resource = ''; + const expectedHeaderRequestParams = 'resource='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new IamProtos.google.iam.v1.Policy() + ); + client.iamClient.getIamPolicy = sinon + .stub() + .callsArgWith(2, null, expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getIamPolicy( + request, + expectedOptions, + ( + err?: Error | null, + result?: IamProtos.google.iam.v1.Policy | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.iamClient.getIamPolicy as SinonStub).getCall(0)); + }); + it('invokes getIamPolicy with error', async () => { + const client = + new policybasedroutingserviceModule.v1.PolicyBasedRoutingServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new IamProtos.google.iam.v1.GetIamPolicyRequest() + ); + request.resource = ''; + const expectedHeaderRequestParams = 'resource='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.iamClient.getIamPolicy = stubSimpleCall(undefined, expectedError); + await assert.rejects( + client.getIamPolicy(request, expectedOptions), + expectedError + ); + assert( + (client.iamClient.getIamPolicy as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + }); + describe('setIamPolicy', () => { + it('invokes setIamPolicy without error', async () => { + const client = + new policybasedroutingserviceModule.v1.PolicyBasedRoutingServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new IamProtos.google.iam.v1.SetIamPolicyRequest() + ); + request.resource = ''; + const expectedHeaderRequestParams = 'resource='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new IamProtos.google.iam.v1.Policy() + ); + client.iamClient.setIamPolicy = stubSimpleCall(expectedResponse); + const response = await client.setIamPolicy(request, expectedOptions); + assert.deepStrictEqual(response, [expectedResponse]); + assert( + (client.iamClient.setIamPolicy as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + it('invokes setIamPolicy without error using callback', async () => { + const client = + new policybasedroutingserviceModule.v1.PolicyBasedRoutingServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new IamProtos.google.iam.v1.SetIamPolicyRequest() + ); + request.resource = ''; + const expectedHeaderRequestParams = 'resource='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new IamProtos.google.iam.v1.Policy() + ); + client.iamClient.setIamPolicy = sinon + .stub() + .callsArgWith(2, null, expectedResponse); + const promise = new Promise((resolve, reject) => { + client.setIamPolicy( + request, + expectedOptions, + ( + err?: Error | null, + result?: IamProtos.google.iam.v1.Policy | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.iamClient.setIamPolicy as SinonStub).getCall(0)); + }); + it('invokes setIamPolicy with error', async () => { + const client = + new policybasedroutingserviceModule.v1.PolicyBasedRoutingServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new IamProtos.google.iam.v1.SetIamPolicyRequest() + ); + request.resource = ''; + const expectedHeaderRequestParams = 'resource='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.iamClient.setIamPolicy = stubSimpleCall(undefined, expectedError); + await assert.rejects( + client.setIamPolicy(request, expectedOptions), + expectedError + ); + assert( + (client.iamClient.setIamPolicy as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + }); + describe('testIamPermissions', () => { + it('invokes testIamPermissions without error', async () => { + const client = + new policybasedroutingserviceModule.v1.PolicyBasedRoutingServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new IamProtos.google.iam.v1.TestIamPermissionsRequest() + ); + request.resource = ''; + const expectedHeaderRequestParams = 'resource='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new IamProtos.google.iam.v1.TestIamPermissionsResponse() + ); + client.iamClient.testIamPermissions = stubSimpleCall(expectedResponse); + const response = await client.testIamPermissions( + request, + expectedOptions + ); + assert.deepStrictEqual(response, [expectedResponse]); + assert( + (client.iamClient.testIamPermissions as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + it('invokes testIamPermissions without error using callback', async () => { + const client = + new policybasedroutingserviceModule.v1.PolicyBasedRoutingServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new IamProtos.google.iam.v1.TestIamPermissionsRequest() + ); + request.resource = ''; + const expectedHeaderRequestParams = 'resource='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new IamProtos.google.iam.v1.TestIamPermissionsResponse() + ); + client.iamClient.testIamPermissions = sinon + .stub() + .callsArgWith(2, null, expectedResponse); + const promise = new Promise((resolve, reject) => { + client.testIamPermissions( + request, + expectedOptions, + ( + err?: Error | null, + result?: IamProtos.google.iam.v1.TestIamPermissionsResponse | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.iamClient.testIamPermissions as SinonStub).getCall(0)); + }); + it('invokes testIamPermissions with error', async () => { + const client = + new policybasedroutingserviceModule.v1.PolicyBasedRoutingServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new IamProtos.google.iam.v1.TestIamPermissionsRequest() + ); + request.resource = ''; + const expectedHeaderRequestParams = 'resource='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.iamClient.testIamPermissions = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects( + client.testIamPermissions(request, expectedOptions), + expectedError + ); + assert( + (client.iamClient.testIamPermissions as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + }); + describe('getLocation', () => { + it('invokes getLocation without error', async () => { + const client = + new policybasedroutingserviceModule.v1.PolicyBasedRoutingServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + 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 policybasedroutingserviceModule.v1.PolicyBasedRoutingServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + 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 policybasedroutingserviceModule.v1.PolicyBasedRoutingServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + 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 policybasedroutingserviceModule.v1.PolicyBasedRoutingServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + 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 policybasedroutingserviceModule.v1.PolicyBasedRoutingServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + 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 policybasedroutingserviceModule.v1.PolicyBasedRoutingServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + 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 policybasedroutingserviceModule.v1.PolicyBasedRoutingServiceClient({ + 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); + } + } + ); + }); + 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 policybasedroutingserviceModule.v1.PolicyBasedRoutingServiceClient({ + 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 policybasedroutingserviceModule.v1.PolicyBasedRoutingServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + 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 policybasedroutingserviceModule.v1.PolicyBasedRoutingServiceClient({ + 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); + } + } + ); + }); + 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 policybasedroutingserviceModule.v1.PolicyBasedRoutingServiceClient({ + 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 policybasedroutingserviceModule.v1.PolicyBasedRoutingServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + 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 policybasedroutingserviceModule.v1.PolicyBasedRoutingServiceClient({ + 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); + } + } + ); + }); + 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 policybasedroutingserviceModule.v1.PolicyBasedRoutingServiceClient({ + 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 policybasedroutingserviceModule.v1.PolicyBasedRoutingServiceClient({ + 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.ListOperationsResponse[] = + []; + 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 policybasedroutingserviceModule.v1.PolicyBasedRoutingServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + 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.ListOperationsResponse[] = + []; + 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('hub', () => { + const fakePath = '/rendered/path/hub'; + const expectedParameters = { + project: 'projectValue', + hub: 'hubValue', + }; + const client = + new policybasedroutingserviceModule.v1.PolicyBasedRoutingServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.hubPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.hubPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('hubPath', () => { + const result = client.hubPath('projectValue', 'hubValue'); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.hubPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromHubName', () => { + const result = client.matchProjectFromHubName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.hubPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchHubFromHubName', () => { + const result = client.matchHubFromHubName(fakePath); + assert.strictEqual(result, 'hubValue'); + assert( + (client.pathTemplates.hubPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('location', () => { + const fakePath = '/rendered/path/location'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + }; + const client = + new policybasedroutingserviceModule.v1.PolicyBasedRoutingServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + 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('network', () => { + const fakePath = '/rendered/path/network'; + const expectedParameters = { + project: 'projectValue', + resource_id: 'resourceIdValue', + }; + const client = + new policybasedroutingserviceModule.v1.PolicyBasedRoutingServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.networkPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.networkPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('networkPath', () => { + const result = client.networkPath('projectValue', 'resourceIdValue'); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.networkPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromNetworkName', () => { + const result = client.matchProjectFromNetworkName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.networkPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchResourceIdFromNetworkName', () => { + const result = client.matchResourceIdFromNetworkName(fakePath); + assert.strictEqual(result, 'resourceIdValue'); + assert( + (client.pathTemplates.networkPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('policyBasedRoute', () => { + const fakePath = '/rendered/path/policyBasedRoute'; + const expectedParameters = { + project: 'projectValue', + policy_based_route: 'policyBasedRouteValue', + }; + const client = + new policybasedroutingserviceModule.v1.PolicyBasedRoutingServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.policyBasedRoutePathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.policyBasedRoutePathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('policyBasedRoutePath', () => { + const result = client.policyBasedRoutePath( + 'projectValue', + 'policyBasedRouteValue' + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates.policyBasedRoutePathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromPolicyBasedRouteName', () => { + const result = client.matchProjectFromPolicyBasedRouteName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.policyBasedRoutePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchPolicyBasedRouteFromPolicyBasedRouteName', () => { + const result = + client.matchPolicyBasedRouteFromPolicyBasedRouteName(fakePath); + assert.strictEqual(result, 'policyBasedRouteValue'); + assert( + (client.pathTemplates.policyBasedRoutePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('spoke', () => { + const fakePath = '/rendered/path/spoke'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + spoke: 'spokeValue', + }; + const client = + new policybasedroutingserviceModule.v1.PolicyBasedRoutingServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.spokePathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.spokePathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('spokePath', () => { + const result = client.spokePath( + 'projectValue', + 'locationValue', + 'spokeValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.spokePathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromSpokeName', () => { + const result = client.matchProjectFromSpokeName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.spokePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromSpokeName', () => { + const result = client.matchLocationFromSpokeName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.spokePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchSpokeFromSpokeName', () => { + const result = client.matchSpokeFromSpokeName(fakePath); + assert.strictEqual(result, 'spokeValue'); + assert( + (client.pathTemplates.spokePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + }); +}); diff --git a/packages/google-cloud-networkservices/.OwlBot.yaml b/packages/google-cloud-networkservices/.OwlBot.yaml new file mode 100644 index 00000000000..8d185bd57c9 --- /dev/null +++ b/packages/google-cloud-networkservices/.OwlBot.yaml @@ -0,0 +1,19 @@ +# 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. + +deep-copy-regex: + - source: /google/cloud/networkservices/(.*)/.*-nodejs + dest: /owl-bot-staging/google-cloud-networkservices/$1 + +api-name: networkservices \ No newline at end of file diff --git a/packages/google-cloud-networkservices/.eslintignore b/packages/google-cloud-networkservices/.eslintignore new file mode 100644 index 00000000000..ea5b04aebe6 --- /dev/null +++ b/packages/google-cloud-networkservices/.eslintignore @@ -0,0 +1,7 @@ +**/node_modules +**/coverage +test/fixtures +build/ +docs/ +protos/ +samples/generated/ diff --git a/packages/google-cloud-networkservices/.eslintrc.json b/packages/google-cloud-networkservices/.eslintrc.json new file mode 100644 index 00000000000..78215349546 --- /dev/null +++ b/packages/google-cloud-networkservices/.eslintrc.json @@ -0,0 +1,3 @@ +{ + "extends": "./node_modules/gts" +} diff --git a/packages/google-cloud-networkservices/.gitattributes b/packages/google-cloud-networkservices/.gitattributes new file mode 100644 index 00000000000..33739cb74e4 --- /dev/null +++ b/packages/google-cloud-networkservices/.gitattributes @@ -0,0 +1,4 @@ +*.ts text eol=lf +*.js text eol=lf +protos/* linguist-generated +**/api-extractor.json linguist-language=JSON-with-Comments diff --git a/packages/google-cloud-networkservices/.gitignore b/packages/google-cloud-networkservices/.gitignore new file mode 100644 index 00000000000..d4f03a0df2e --- /dev/null +++ b/packages/google-cloud-networkservices/.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/google-cloud-networkservices/.jsdoc.js b/packages/google-cloud-networkservices/.jsdoc.js new file mode 100644 index 00000000000..8949cec8bec --- /dev/null +++ b/packages/google-cloud-networkservices/.jsdoc.js @@ -0,0 +1,55 @@ +// Copyright 2023 Google LLC +// +// Licensed under the Apache License, Version 2.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 2023 Google LLC', + includeDate: false, + sourceFiles: false, + systemName: '@google-cloud/networkservices', + theme: 'lumen', + default: { + outputSourceFiles: false + } + }, + markdown: { + idInHeadings: true + } +}; diff --git a/packages/google-cloud-networkservices/.mocharc.js b/packages/google-cloud-networkservices/.mocharc.js new file mode 100644 index 00000000000..49e7e228701 --- /dev/null +++ b/packages/google-cloud-networkservices/.mocharc.js @@ -0,0 +1,29 @@ +// Copyright 2023 Google LLC +// +// Licensed under the Apache License, Version 2.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. +const config = { + "enable-source-maps": true, + "throw-deprecation": true, + "timeout": 10000, + "recursive": true +} +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/google-cloud-networkservices/.nycrc b/packages/google-cloud-networkservices/.nycrc new file mode 100644 index 00000000000..b18d5472b62 --- /dev/null +++ b/packages/google-cloud-networkservices/.nycrc @@ -0,0 +1,24 @@ +{ + "report-dir": "./.coverage", + "reporter": ["text", "lcov"], + "exclude": [ + "**/*-test", + "**/.coverage", + "**/apis", + "**/benchmark", + "**/conformance", + "**/docs", + "**/samples", + "**/scripts", + "**/protos", + "**/test", + "**/*.d.ts", + ".jsdoc.js", + "**/.jsdoc.js", + "karma.conf.js", + "webpack-tests.config.js", + "webpack.config.js" + ], + "exclude-after-remap": false, + "all": true +} diff --git a/packages/google-cloud-networkservices/.prettierignore b/packages/google-cloud-networkservices/.prettierignore new file mode 100644 index 00000000000..9340ad9b86d --- /dev/null +++ b/packages/google-cloud-networkservices/.prettierignore @@ -0,0 +1,6 @@ +**/node_modules +**/coverage +test/fixtures +build/ +docs/ +protos/ diff --git a/packages/google-cloud-networkservices/.prettierrc.js b/packages/google-cloud-networkservices/.prettierrc.js new file mode 100644 index 00000000000..1e6cec783e4 --- /dev/null +++ b/packages/google-cloud-networkservices/.prettierrc.js @@ -0,0 +1,17 @@ +// Copyright 2023 Google LLC +// +// Licensed under the Apache License, Version 2.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. + +module.exports = { + ...require('gts/.prettierrc.json') +} diff --git a/packages/google-cloud-networkservices/.repo-metadata.json b/packages/google-cloud-networkservices/.repo-metadata.json new file mode 100644 index 00000000000..360187a7ce8 --- /dev/null +++ b/packages/google-cloud-networkservices/.repo-metadata.json @@ -0,0 +1,17 @@ +{ + "name": "networkservices", + "name_pretty": "Network Services API", + "product_documentation": "cloud.google.com/media-cdn/", + "client_documentation": "https://cloud.google.com/nodejs/docs/reference/networkservices/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/networkservices", + "api_id": "networkservices.googleapis.com", + "default_version": "v1", + "requires_billing": true, + "library_type": "GAPIC_AUTO", + "api_shortname": "networkservices" +} + diff --git a/packages/google-cloud-networkservices/CHANGELOG.md b/packages/google-cloud-networkservices/CHANGELOG.md new file mode 100644 index 00000000000..7f1199d9873 --- /dev/null +++ b/packages/google-cloud-networkservices/CHANGELOG.md @@ -0,0 +1,8 @@ +# Changelog + +## 0.1.0 (2023-09-14) + + +### Features + +* Add initial files for google.cloud.networkservices.v1 ([#4638](https://github.com/googleapis/google-cloud-node/issues/4638)) ([c01dd83](https://github.com/googleapis/google-cloud-node/commit/c01dd83a6b89c069eb16ffcb79d21b2b8e684278)) diff --git a/packages/google-cloud-networkservices/CODE_OF_CONDUCT.md b/packages/google-cloud-networkservices/CODE_OF_CONDUCT.md new file mode 100644 index 00000000000..2add2547a81 --- /dev/null +++ b/packages/google-cloud-networkservices/CODE_OF_CONDUCT.md @@ -0,0 +1,94 @@ + +# Code of Conduct + +## Our Pledge + +In the interest of fostering an open and welcoming environment, we as +contributors and maintainers pledge to making participation in our project and +our community a harassment-free experience for everyone, regardless of age, body +size, disability, ethnicity, gender identity and expression, level of +experience, education, socio-economic status, nationality, personal appearance, +race, religion, or sexual identity and orientation. + +## Our Standards + +Examples of behavior that contributes to creating a positive environment +include: + +* Using welcoming and inclusive language +* Being respectful of differing viewpoints and experiences +* Gracefully accepting constructive criticism +* Focusing on what is best for the community +* Showing empathy towards other community members + +Examples of unacceptable behavior by participants include: + +* The use of sexualized language or imagery and unwelcome sexual attention or + advances +* Trolling, insulting/derogatory comments, and personal or political attacks +* Public or private harassment +* Publishing others' private information, such as a physical or electronic + address, without explicit permission +* Other conduct which could reasonably be considered inappropriate in a + professional setting + +## Our Responsibilities + +Project maintainers are responsible for clarifying the standards of acceptable +behavior and are expected to take appropriate and fair corrective action in +response to any instances of unacceptable behavior. + +Project maintainers have the right and responsibility to remove, edit, or reject +comments, commits, code, wiki edits, issues, and other contributions that are +not aligned to this Code of Conduct, or to ban temporarily or permanently any +contributor for other behaviors that they deem inappropriate, threatening, +offensive, or harmful. + +## Scope + +This Code of Conduct applies both within project spaces and in public spaces +when an individual is representing the project or its community. Examples of +representing a project or community include using an official project e-mail +address, posting via an official social media account, or acting as an appointed +representative at an online or offline event. Representation of a project may be +further defined and clarified by project maintainers. + +This Code of Conduct also applies outside the project spaces when the Project +Steward has a reasonable belief that an individual's behavior may have a +negative impact on the project or its community. + +## Conflict Resolution + +We do not believe that all conflict is bad; healthy debate and disagreement +often yield positive results. However, it is never okay to be disrespectful or +to engage in behavior that violates the project’s code of conduct. + +If you see someone violating the code of conduct, you are encouraged to address +the behavior directly with those involved. Many issues can be resolved quickly +and easily, and this gives people more control over the outcome of their +dispute. If you are unable to resolve the matter for any reason, or if the +behavior is threatening or harassing, report it. We are dedicated to providing +an environment where participants feel welcome and safe. + +Reports should be directed to *googleapis-stewards@google.com*, the +Project Steward(s) for *Google Cloud Client Libraries*. It is the Project Steward’s duty to +receive and address reported violations of the code of conduct. They will then +work with a committee consisting of representatives from the Open Source +Programs Office and the Google Open Source Strategy team. If for any reason you +are uncomfortable reaching out to the Project Steward, please email +opensource@google.com. + +We will investigate every complaint, but you may not receive a direct response. +We will use our discretion in determining when and how to follow up on reported +incidents, which may range from not taking action to permanent expulsion from +the project and project-sponsored spaces. We will notify the accused of the +report and provide them an opportunity to discuss it before any action is taken. +The identity of the reporter will be omitted from the details of the report +supplied to the accused. In potentially harmful situations, such as ongoing +harassment or threats to anyone's safety, we may take action without notice. + +## Attribution + +This Code of Conduct is adapted from the Contributor Covenant, version 1.4, +available at +https://www.contributor-covenant.org/version/1/4/code-of-conduct.html \ No newline at end of file diff --git a/packages/google-cloud-networkservices/CONTRIBUTING.md b/packages/google-cloud-networkservices/CONTRIBUTING.md new file mode 100644 index 00000000000..f20d773844c --- /dev/null +++ b/packages/google-cloud-networkservices/CONTRIBUTING.md @@ -0,0 +1,76 @@ +# How to become a contributor and submit your own code + +**Table of contents** + +* [Contributor License Agreements](#contributor-license-agreements) +* [Contributing a patch](#contributing-a-patch) +* [Running the tests](#running-the-tests) +* [Releasing the library](#releasing-the-library) + +## Contributor License Agreements + +We'd love to accept your sample apps and patches! Before we can take them, we +have to jump a couple of legal hurdles. + +Please fill out either the individual or corporate Contributor License Agreement +(CLA). + + * If you are an individual writing original source code and you're sure you + own the intellectual property, then you'll need to sign an [individual CLA](https://developers.google.com/open-source/cla/individual). + * If you work for a company that wants to allow you to contribute your work, + then you'll need to sign a [corporate CLA](https://developers.google.com/open-source/cla/corporate). + +Follow either of the two links above to access the appropriate CLA and +instructions for how to sign and return it. Once we receive it, we'll be able to +accept your pull requests. + +## Contributing A Patch + +1. Submit an issue describing your proposed change to the repo in question. +1. The repo owner will respond to your issue promptly. +1. If your proposed change is accepted, and you haven't already done so, sign a + Contributor License Agreement (see details above). +1. Fork the desired repo, develop and test your code changes. +1. Ensure that your code adheres to the existing style in the code to which + you are contributing. +1. Ensure that your code has an appropriate set of tests which all pass. +1. Title your pull request following [Conventional Commits](https://www.conventionalcommits.org/) styling. +1. Submit a pull request. + +### Before you begin + +1. [Select or create a Cloud Platform project][projects]. +1. [Enable billing for your project][billing]. +1. [Enable the Network Services API API][enable_api]. +1. [Set up authentication with a service account][auth] so you can access the + API from your local workstation. + + +## Running the tests + +1. [Prepare your environment for Node.js setup][setup]. + +1. Install dependencies: + + npm install + +1. Run the tests: + + # Run unit tests. + npm test + + # Run sample integration tests. + npm run samples-test + + # Run all system tests. + npm run system-test + +1. Lint (and maybe fix) any changes: + + npm run fix + +[setup]: https://cloud.google.com/nodejs/docs/setup +[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=networkservices.googleapis.com +[auth]: https://cloud.google.com/docs/authentication/getting-started \ No newline at end of file diff --git a/packages/google-cloud-networkservices/LICENSE b/packages/google-cloud-networkservices/LICENSE new file mode 100644 index 00000000000..d6456956733 --- /dev/null +++ b/packages/google-cloud-networkservices/LICENSE @@ -0,0 +1,202 @@ + + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright [yyyy] [name of copyright owner] + + Licensed under the Apache License, Version 2.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. diff --git a/packages/google-cloud-networkservices/README.md b/packages/google-cloud-networkservices/README.md new file mode 100644 index 00000000000..5485beba2b0 --- /dev/null +++ b/packages/google-cloud-networkservices/README.md @@ -0,0 +1,230 @@ +[//]: # "This README.md file is auto-generated, all changes to this file will be lost." +[//]: # "To regenerate it, use `python -m synthtool`." +Google Cloud Platform logo + +# [Network Services API: Node.js Client](https://github.com/googleapis/google-cloud-node/tree/main/packages/google-cloud-networkservices) + +[![release level](https://img.shields.io/badge/release%20level-preview-yellow.svg?style=flat)](https://cloud.google.com/terms/launch-stages) +[![npm version](https://img.shields.io/npm/v/@google-cloud/networkservices.svg)](https://www.npmjs.org/package/@google-cloud/networkservices) + + + + +Network Services API client for Node.js + + +A comprehensive list of changes in each version may be found in +[the CHANGELOG](https://github.com/googleapis/google-cloud-node/tree/main/packages/google-cloud-networkservices/CHANGELOG.md). + +* [Network Services API Node.js Client API Reference][client-docs] +* [Network Services API Documentation][product-docs] +* [github.com/googleapis/google-cloud-node/packages/google-cloud-networkservices](https://github.com/googleapis/google-cloud-node/tree/main/packages/google-cloud-networkservices) + +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) + * [Using the client library](#using-the-client-library) +* [Samples](#samples) +* [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 Network Services API API][enable_api]. +1. [Set up authentication with a service account][auth] so you can access the + API from your local workstation. + +### Installing the client library + +```bash +npm install @google-cloud/networkservices +``` + + +### Using the client library + +```javascript +/** + * 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 from which the EndpointPolicies should be + * listed, specified in the format `projects/* /locations/global`. + */ +// const parent = 'abc123' +/** + * Maximum number of EndpointPolicies to return per call. + */ +// const pageSize = 1234 +/** + * The value returned by the last `ListEndpointPoliciesResponse` + * Indicates that this is a continuation of a prior + * `ListEndpointPolicies` call, and that the system should return the + * next page of data. + */ +// const pageToken = 'abc123' + +// Imports the Networkservices library +const {NetworkServicesClient} = + require('@google-cloud/networkservices').v1beta1; + +// Instantiates a client +const networkservicesClient = new NetworkServicesClient(); + +async function callListEndpointPolicies() { + // Construct request + const request = { + parent, + }; + + // Run request + const iterable = await networkservicesClient.listEndpointPoliciesAsync( + request + ); + for await (const response of iterable) { + console.log(response); + } +} + +callListEndpointPolicies(); + +``` + + + +## Samples + +Samples are in the [`samples/`](https://github.com/googleapis/google-cloud-node/tree/main/packages/google-cloud-networkservices/samples) directory. Each sample's `README.md` has instructions for running its sample. + +| Sample | Source Code | Try it | +| --------------------------- | --------------------------------- | ------ | +| Network_services.create_endpoint_policy | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-networkservices/samples/generated/v1/network_services.create_endpoint_policy.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-cloud-networkservices/samples/generated/v1/network_services.create_endpoint_policy.js,packages/google-cloud-networkservices/samples/README.md) | +| Network_services.create_gateway | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-networkservices/samples/generated/v1/network_services.create_gateway.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-cloud-networkservices/samples/generated/v1/network_services.create_gateway.js,packages/google-cloud-networkservices/samples/README.md) | +| Network_services.create_grpc_route | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-networkservices/samples/generated/v1/network_services.create_grpc_route.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-cloud-networkservices/samples/generated/v1/network_services.create_grpc_route.js,packages/google-cloud-networkservices/samples/README.md) | +| Network_services.create_http_route | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-networkservices/samples/generated/v1/network_services.create_http_route.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-cloud-networkservices/samples/generated/v1/network_services.create_http_route.js,packages/google-cloud-networkservices/samples/README.md) | +| Network_services.create_mesh | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-networkservices/samples/generated/v1/network_services.create_mesh.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-cloud-networkservices/samples/generated/v1/network_services.create_mesh.js,packages/google-cloud-networkservices/samples/README.md) | +| Network_services.create_service_binding | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-networkservices/samples/generated/v1/network_services.create_service_binding.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-cloud-networkservices/samples/generated/v1/network_services.create_service_binding.js,packages/google-cloud-networkservices/samples/README.md) | +| Network_services.create_tcp_route | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-networkservices/samples/generated/v1/network_services.create_tcp_route.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-cloud-networkservices/samples/generated/v1/network_services.create_tcp_route.js,packages/google-cloud-networkservices/samples/README.md) | +| Network_services.create_tls_route | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-networkservices/samples/generated/v1/network_services.create_tls_route.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-cloud-networkservices/samples/generated/v1/network_services.create_tls_route.js,packages/google-cloud-networkservices/samples/README.md) | +| Network_services.delete_endpoint_policy | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-networkservices/samples/generated/v1/network_services.delete_endpoint_policy.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-cloud-networkservices/samples/generated/v1/network_services.delete_endpoint_policy.js,packages/google-cloud-networkservices/samples/README.md) | +| Network_services.delete_gateway | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-networkservices/samples/generated/v1/network_services.delete_gateway.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-cloud-networkservices/samples/generated/v1/network_services.delete_gateway.js,packages/google-cloud-networkservices/samples/README.md) | +| Network_services.delete_grpc_route | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-networkservices/samples/generated/v1/network_services.delete_grpc_route.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-cloud-networkservices/samples/generated/v1/network_services.delete_grpc_route.js,packages/google-cloud-networkservices/samples/README.md) | +| Network_services.delete_http_route | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-networkservices/samples/generated/v1/network_services.delete_http_route.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-cloud-networkservices/samples/generated/v1/network_services.delete_http_route.js,packages/google-cloud-networkservices/samples/README.md) | +| Network_services.delete_mesh | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-networkservices/samples/generated/v1/network_services.delete_mesh.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-cloud-networkservices/samples/generated/v1/network_services.delete_mesh.js,packages/google-cloud-networkservices/samples/README.md) | +| Network_services.delete_service_binding | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-networkservices/samples/generated/v1/network_services.delete_service_binding.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-cloud-networkservices/samples/generated/v1/network_services.delete_service_binding.js,packages/google-cloud-networkservices/samples/README.md) | +| Network_services.delete_tcp_route | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-networkservices/samples/generated/v1/network_services.delete_tcp_route.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-cloud-networkservices/samples/generated/v1/network_services.delete_tcp_route.js,packages/google-cloud-networkservices/samples/README.md) | +| Network_services.delete_tls_route | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-networkservices/samples/generated/v1/network_services.delete_tls_route.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-cloud-networkservices/samples/generated/v1/network_services.delete_tls_route.js,packages/google-cloud-networkservices/samples/README.md) | +| Network_services.get_endpoint_policy | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-networkservices/samples/generated/v1/network_services.get_endpoint_policy.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-cloud-networkservices/samples/generated/v1/network_services.get_endpoint_policy.js,packages/google-cloud-networkservices/samples/README.md) | +| Network_services.get_gateway | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-networkservices/samples/generated/v1/network_services.get_gateway.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-cloud-networkservices/samples/generated/v1/network_services.get_gateway.js,packages/google-cloud-networkservices/samples/README.md) | +| Network_services.get_grpc_route | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-networkservices/samples/generated/v1/network_services.get_grpc_route.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-cloud-networkservices/samples/generated/v1/network_services.get_grpc_route.js,packages/google-cloud-networkservices/samples/README.md) | +| Network_services.get_http_route | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-networkservices/samples/generated/v1/network_services.get_http_route.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-cloud-networkservices/samples/generated/v1/network_services.get_http_route.js,packages/google-cloud-networkservices/samples/README.md) | +| Network_services.get_mesh | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-networkservices/samples/generated/v1/network_services.get_mesh.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-cloud-networkservices/samples/generated/v1/network_services.get_mesh.js,packages/google-cloud-networkservices/samples/README.md) | +| Network_services.get_service_binding | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-networkservices/samples/generated/v1/network_services.get_service_binding.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-cloud-networkservices/samples/generated/v1/network_services.get_service_binding.js,packages/google-cloud-networkservices/samples/README.md) | +| Network_services.get_tcp_route | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-networkservices/samples/generated/v1/network_services.get_tcp_route.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-cloud-networkservices/samples/generated/v1/network_services.get_tcp_route.js,packages/google-cloud-networkservices/samples/README.md) | +| Network_services.get_tls_route | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-networkservices/samples/generated/v1/network_services.get_tls_route.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-cloud-networkservices/samples/generated/v1/network_services.get_tls_route.js,packages/google-cloud-networkservices/samples/README.md) | +| Network_services.list_endpoint_policies | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-networkservices/samples/generated/v1/network_services.list_endpoint_policies.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-cloud-networkservices/samples/generated/v1/network_services.list_endpoint_policies.js,packages/google-cloud-networkservices/samples/README.md) | +| Network_services.list_gateways | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-networkservices/samples/generated/v1/network_services.list_gateways.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-cloud-networkservices/samples/generated/v1/network_services.list_gateways.js,packages/google-cloud-networkservices/samples/README.md) | +| Network_services.list_grpc_routes | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-networkservices/samples/generated/v1/network_services.list_grpc_routes.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-cloud-networkservices/samples/generated/v1/network_services.list_grpc_routes.js,packages/google-cloud-networkservices/samples/README.md) | +| Network_services.list_http_routes | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-networkservices/samples/generated/v1/network_services.list_http_routes.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-cloud-networkservices/samples/generated/v1/network_services.list_http_routes.js,packages/google-cloud-networkservices/samples/README.md) | +| Network_services.list_meshes | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-networkservices/samples/generated/v1/network_services.list_meshes.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-cloud-networkservices/samples/generated/v1/network_services.list_meshes.js,packages/google-cloud-networkservices/samples/README.md) | +| Network_services.list_service_bindings | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-networkservices/samples/generated/v1/network_services.list_service_bindings.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-cloud-networkservices/samples/generated/v1/network_services.list_service_bindings.js,packages/google-cloud-networkservices/samples/README.md) | +| Network_services.list_tcp_routes | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-networkservices/samples/generated/v1/network_services.list_tcp_routes.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-cloud-networkservices/samples/generated/v1/network_services.list_tcp_routes.js,packages/google-cloud-networkservices/samples/README.md) | +| Network_services.list_tls_routes | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-networkservices/samples/generated/v1/network_services.list_tls_routes.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-cloud-networkservices/samples/generated/v1/network_services.list_tls_routes.js,packages/google-cloud-networkservices/samples/README.md) | +| Network_services.update_endpoint_policy | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-networkservices/samples/generated/v1/network_services.update_endpoint_policy.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-cloud-networkservices/samples/generated/v1/network_services.update_endpoint_policy.js,packages/google-cloud-networkservices/samples/README.md) | +| Network_services.update_gateway | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-networkservices/samples/generated/v1/network_services.update_gateway.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-cloud-networkservices/samples/generated/v1/network_services.update_gateway.js,packages/google-cloud-networkservices/samples/README.md) | +| Network_services.update_grpc_route | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-networkservices/samples/generated/v1/network_services.update_grpc_route.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-cloud-networkservices/samples/generated/v1/network_services.update_grpc_route.js,packages/google-cloud-networkservices/samples/README.md) | +| Network_services.update_http_route | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-networkservices/samples/generated/v1/network_services.update_http_route.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-cloud-networkservices/samples/generated/v1/network_services.update_http_route.js,packages/google-cloud-networkservices/samples/README.md) | +| Network_services.update_mesh | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-networkservices/samples/generated/v1/network_services.update_mesh.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-cloud-networkservices/samples/generated/v1/network_services.update_mesh.js,packages/google-cloud-networkservices/samples/README.md) | +| Network_services.update_tcp_route | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-networkservices/samples/generated/v1/network_services.update_tcp_route.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-cloud-networkservices/samples/generated/v1/network_services.update_tcp_route.js,packages/google-cloud-networkservices/samples/README.md) | +| Network_services.update_tls_route | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-networkservices/samples/generated/v1/network_services.update_tls_route.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-cloud-networkservices/samples/generated/v1/network_services.update_tls_route.js,packages/google-cloud-networkservices/samples/README.md) | +| Network_services.create_endpoint_policy | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-networkservices/samples/generated/v1beta1/network_services.create_endpoint_policy.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-cloud-networkservices/samples/generated/v1beta1/network_services.create_endpoint_policy.js,packages/google-cloud-networkservices/samples/README.md) | +| Network_services.delete_endpoint_policy | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-networkservices/samples/generated/v1beta1/network_services.delete_endpoint_policy.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-cloud-networkservices/samples/generated/v1beta1/network_services.delete_endpoint_policy.js,packages/google-cloud-networkservices/samples/README.md) | +| Network_services.get_endpoint_policy | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-networkservices/samples/generated/v1beta1/network_services.get_endpoint_policy.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-cloud-networkservices/samples/generated/v1beta1/network_services.get_endpoint_policy.js,packages/google-cloud-networkservices/samples/README.md) | +| Network_services.list_endpoint_policies | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-networkservices/samples/generated/v1beta1/network_services.list_endpoint_policies.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-cloud-networkservices/samples/generated/v1beta1/network_services.list_endpoint_policies.js,packages/google-cloud-networkservices/samples/README.md) | +| Network_services.update_endpoint_policy | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-networkservices/samples/generated/v1beta1/network_services.update_endpoint_policy.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-cloud-networkservices/samples/generated/v1beta1/network_services.update_endpoint_policy.js,packages/google-cloud-networkservices/samples/README.md) | +| Quickstart | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-networkservices/samples/quickstart.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-cloud-networkservices/samples/quickstart.js,packages/google-cloud-networkservices/samples/README.md) | + + + +The [Network Services API Node.js Client API Reference][client-docs] documentation +also contains 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/networkservices@legacy-8` installs client libraries +for versions compatible with Node.js 8. + +## Versioning + +This library follows [Semantic Versioning](http://semver.org/). + + + + + + + +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. + + +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](https://github.com/googleapis/google-cloud-node/blob/main/CONTRIBUTING.md). + +Please note that this `README.md`, the `samples/README.md`, +and a variety of configuration files in this repository (including `.nycrc` and `tsconfig.json`) +are generated from a central template. To edit one of these files, make an edit +to its templates in +[directory](https://github.com/googleapis/synthtool). + +## License + +Apache Version 2.0 + +See [LICENSE](https://github.com/googleapis/google-cloud-node/blob/main/LICENSE) + +[client-docs]: https://cloud.google.com/nodejs/docs/reference/networkservices/latest +[product-docs]: cloud.google.com/media-cdn/ +[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=networkservices.googleapis.com +[auth]: https://cloud.google.com/docs/authentication/getting-started diff --git a/packages/google-cloud-networkservices/package.json b/packages/google-cloud-networkservices/package.json new file mode 100644 index 00000000000..802582a3076 --- /dev/null +++ b/packages/google-cloud-networkservices/package.json @@ -0,0 +1,70 @@ +{ + "name": "@google-cloud/networkservices", + "version": "0.1.0", + "description": "Network Services API client for Node.js", + "repository": { + "type": "git", + "url": "https://github.com/googleapis/google-cloud-node.git", + "directory": "packages/google-cloud-networkservices" + }, + "license": "Apache-2.0", + "author": "Google LLC", + "main": "build/src/index.js", + "files": [ + "build/src", + "build/protos" + ], + "homepage": "https://github.com/googleapis/google-cloud-node/tree/main/packages/google-cloud-networkservices", + "keywords": [ + "google apis client", + "google api client", + "google apis", + "google api", + "google", + "google cloud platform", + "google cloud", + "cloud", + "google networkservices", + "networkservices", + "Network Services API" + ], + "scripts": { + "clean": "gts clean", + "compile": "tsc -p . && cp -r protos build/", + "compile-protos": "compileProtos src", + "docs": "jsdoc -c .jsdoc.js", + "predocs-test": "npm run docs", + "docs-test": "linkinator docs", + "fix": "gts fix", + "lint": "gts check", + "postpack": "minifyProtoJson", + "prepare": "npm run compile-protos && npm run compile", + "system-test": "c8 mocha build/system-test", + "test": "c8 mocha build/test", + "samples-test": "cd samples/ && npm link ../ && npm i && npm test", + "prelint": "cd samples; npm link ../; npm i" + }, + "dependencies": { + "google-gax": "^4.0.3" + }, + "devDependencies": { + "@types/mocha": "^9.0.0", + "@types/node": "^20.4.5", + "@types/sinon": "^10.0.0", + "c8": "^8.0.1", + "gapic-tools": "^0.1.8", + "gts": "^5.0.0", + "jsdoc": "^4.0.0", + "jsdoc-fresh": "^3.0.0", + "jsdoc-region-tag": "^3.0.0", + "linkinator": "4.1.2", + "long": "^5.2.3", + "mocha": "^9.2.2", + "pack-n-play": "^1.0.0-2", + "sinon": "^15.0.0", + "typescript": "^5.1.6" + }, + "engines": { + "node": ">=14.0.0" + } +} diff --git a/packages/google-cloud-networkservices/protos/google/cloud/networkservices/v1/common.proto b/packages/google-cloud-networkservices/protos/google/cloud/networkservices/v1/common.proto new file mode 100644 index 00000000000..599a35d3676 --- /dev/null +++ b/packages/google-cloud-networkservices/protos/google/cloud/networkservices/v1/common.proto @@ -0,0 +1,139 @@ +// Copyright 2023 Google LLC +// +// Licensed under the Apache License, Version 2.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.networkservices.v1; + +import "google/api/field_behavior.proto"; +import "google/protobuf/timestamp.proto"; + +option csharp_namespace = "Google.Cloud.NetworkServices.V1"; +option go_package = "cloud.google.com/go/networkservices/apiv1/networkservicespb;networkservicespb"; +option java_multiple_files = true; +option java_outer_classname = "CommonProto"; +option java_package = "com.google.cloud.networkservices.v1"; +option php_namespace = "Google\\Cloud\\NetworkServices\\V1"; +option ruby_package = "Google::Cloud::NetworkServices::V1"; + +// Represents the metadata of the long-running operation. +message OperationMetadata { + // Output only. The time the operation was created. + google.protobuf.Timestamp create_time = 1 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The time the operation finished running. + google.protobuf.Timestamp end_time = 2 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Server-defined resource path for the target of the operation. + string target = 3 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Name of the verb executed by the operation. + string verb = 4 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Human-readable status of the operation, if any. + string status_message = 5 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Identifies whether the user has requested cancellation + // of the operation. Operations that have successfully been cancelled + // have [Operation.error][] value with a + // [google.rpc.Status.code][google.rpc.Status.code] of 1, corresponding to + // `Code.CANCELLED`. + bool requested_cancellation = 6 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. API version used to start the operation. + string api_version = 7 [(google.api.field_behavior) = OUTPUT_ONLY]; +} + +// Specification of a port-based selector. +message TrafficPortSelector { + // Optional. A list of ports. Can be port numbers or port range + // (example, [80-90] specifies all ports from 80 to 90, including + // 80 and 90) or named ports or * to specify all ports. If the + // list is empty, all ports are selected. + repeated string ports = 1 [(google.api.field_behavior) = OPTIONAL]; +} + +// A definition of a matcher that selects endpoints to which the policies +// should be applied. +message EndpointMatcher { + // The matcher that is based on node metadata presented by xDS clients. + message MetadataLabelMatcher { + // Defines a name-pair value for a single label. + message MetadataLabels { + // Required. Label name presented as key in xDS Node Metadata. + string label_name = 1 [(google.api.field_behavior) = REQUIRED]; + + // Required. Label value presented as value corresponding to the above + // key, in xDS Node Metadata. + string label_value = 2 [(google.api.field_behavior) = REQUIRED]; + } + + // Possible criteria values that define logic of how matching is made. + enum MetadataLabelMatchCriteria { + // Default value. Should not be used. + METADATA_LABEL_MATCH_CRITERIA_UNSPECIFIED = 0; + + // At least one of the Labels specified in the matcher should match the + // metadata presented by xDS client. + MATCH_ANY = 1; + + // The metadata presented by the xDS client should contain all of the + // labels specified here. + MATCH_ALL = 2; + } + + // Specifies how matching should be done. + // + // Supported values are: + // MATCH_ANY: At least one of the Labels specified in the + // matcher should match the metadata presented by xDS client. + // MATCH_ALL: The metadata presented by the xDS client should + // contain all of the labels specified here. + // + // The selection is determined based on the best match. For + // example, suppose there are three EndpointPolicy + // resources P1, P2 and P3 and if P1 has a the matcher as + // MATCH_ANY , P2 has MATCH_ALL , and P3 has + // MATCH_ALL . + // + // If a client with label connects, the config from P1 + // will be selected. + // + // If a client with label connects, the config from P2 + // will be selected. + // + // If a client with label connects, the config + // from P3 will be selected. + // + // If there is more than one best match, (for example, if a + // config P4 with selector exists and if a client with + // label connects), an error will be thrown. + MetadataLabelMatchCriteria metadata_label_match_criteria = 1; + + // The list of label value pairs that must match labels in the + // provided metadata based on filterMatchCriteria This list can + // have at most 64 entries. The list can be empty if the match + // criteria is MATCH_ANY, to specify a wildcard match (i.e this + // matches any client). + repeated MetadataLabels metadata_labels = 2; + } + + // Specifies type of the matcher used for this endpoint matcher. + oneof matcher_type { + // The matcher is based on node metadata presented by xDS clients. + MetadataLabelMatcher metadata_label_matcher = 1; + } +} diff --git a/packages/google-cloud-networkservices/protos/google/cloud/networkservices/v1/endpoint_policy.proto b/packages/google-cloud-networkservices/protos/google/cloud/networkservices/v1/endpoint_policy.proto new file mode 100644 index 00000000000..889a575dde4 --- /dev/null +++ b/packages/google-cloud-networkservices/protos/google/cloud/networkservices/v1/endpoint_policy.proto @@ -0,0 +1,225 @@ +// Copyright 2023 Google LLC +// +// Licensed under the Apache License, Version 2.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.networkservices.v1; + +import "google/api/field_behavior.proto"; +import "google/api/resource.proto"; +import "google/cloud/networkservices/v1/common.proto"; +import "google/protobuf/field_mask.proto"; +import "google/protobuf/timestamp.proto"; + +option csharp_namespace = "Google.Cloud.NetworkServices.V1"; +option go_package = "cloud.google.com/go/networkservices/apiv1/networkservicespb;networkservicespb"; +option java_multiple_files = true; +option java_outer_classname = "EndpointPolicyProto"; +option java_package = "com.google.cloud.networkservices.v1"; +option php_namespace = "Google\\Cloud\\NetworkServices\\V1"; +option ruby_package = "Google::Cloud::NetworkServices::V1"; +option (google.api.resource_definition) = { + type: "networksecurity.googleapis.com/AuthorizationPolicy" + pattern: "projects/{project}/locations/{location}/authorizationPolicies/{authorization_policy}" +}; +option (google.api.resource_definition) = { + type: "networksecurity.googleapis.com/ServerTlsPolicy" + pattern: "projects/{project}/locations/{location}/serverTlsPolicies/{server_tls_policy}" +}; +option (google.api.resource_definition) = { + type: "networksecurity.googleapis.com/ClientTlsPolicy" + pattern: "projects/{project}/locations/{location}/clientTlsPolicies/{client_tls_policy}" +}; + +// EndpointPolicy is a resource that helps apply desired configuration +// on the endpoints that match specific criteria. +// For example, this resource can be used to apply "authentication config" +// an all endpoints that serve on port 8080. +message EndpointPolicy { + option (google.api.resource) = { + type: "networkservices.googleapis.com/EndpointPolicy" + pattern: "projects/{project}/locations/{location}/endpointPolicies/{endpoint_policy}" + }; + + // The type of endpoint policy. + enum EndpointPolicyType { + // Default value. Must not be used. + ENDPOINT_POLICY_TYPE_UNSPECIFIED = 0; + + // Represents a proxy deployed as a sidecar. + SIDECAR_PROXY = 1; + + // Represents a proxyless gRPC backend. + GRPC_SERVER = 2; + } + + // Required. Name of the EndpointPolicy resource. It matches pattern + // `projects/{project}/locations/global/endpointPolicies/{endpoint_policy}`. + string name = 1 [(google.api.field_behavior) = REQUIRED]; + + // Output only. The timestamp when the resource was created. + google.protobuf.Timestamp create_time = 2 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The timestamp when the resource was updated. + google.protobuf.Timestamp update_time = 3 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Optional. Set of label tags associated with the EndpointPolicy resource. + map labels = 4 [(google.api.field_behavior) = OPTIONAL]; + + // Required. The type of endpoint policy. This is primarily used to validate + // the configuration. + EndpointPolicyType type = 5 [(google.api.field_behavior) = REQUIRED]; + + // Optional. This field specifies the URL of AuthorizationPolicy resource that + // applies authorization policies to the inbound traffic at the + // matched endpoints. Refer to Authorization. If this field is not + // specified, authorization is disabled(no authz checks) for this + // endpoint. + string authorization_policy = 7 [ + (google.api.field_behavior) = OPTIONAL, + (google.api.resource_reference) = { + type: "networksecurity.googleapis.com/AuthorizationPolicy" + } + ]; + + // Required. A matcher that selects endpoints to which the policies should be + // applied. + EndpointMatcher endpoint_matcher = 9 [(google.api.field_behavior) = REQUIRED]; + + // Optional. Port selector for the (matched) endpoints. If no port selector is + // provided, the matched config is applied to all ports. + TrafficPortSelector traffic_port_selector = 10 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. A free-text description of the resource. Max length 1024 + // characters. + string description = 11 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. A URL referring to ServerTlsPolicy resource. ServerTlsPolicy is + // used to determine the authentication policy to be applied to terminate the + // inbound traffic at the identified backends. If this field is not set, + // authentication is disabled(open) for this endpoint. + string server_tls_policy = 12 [ + (google.api.field_behavior) = OPTIONAL, + (google.api.resource_reference) = { + type: "networksecurity.googleapis.com/ServerTlsPolicy" + } + ]; + + // Optional. A URL referring to a ClientTlsPolicy resource. ClientTlsPolicy + // can be set to specify the authentication for traffic from the proxy to the + // actual endpoints. More specifically, it is applied to the outgoing traffic + // from the proxy to the endpoint. This is typically used for sidecar model + // where the proxy identifies itself as endpoint to the control plane, with + // the connection between sidecar and endpoint requiring authentication. If + // this field is not set, authentication is disabled(open). Applicable only + // when EndpointPolicyType is SIDECAR_PROXY. + string client_tls_policy = 13 [ + (google.api.field_behavior) = OPTIONAL, + (google.api.resource_reference) = { + type: "networksecurity.googleapis.com/ClientTlsPolicy" + } + ]; +} + +// Request used with the ListEndpointPolicies method. +message ListEndpointPoliciesRequest { + // Required. The project and location from which the EndpointPolicies should + // be listed, specified in the format `projects/*/locations/global`. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "networkservices.googleapis.com/EndpointPolicy" + } + ]; + + // Maximum number of EndpointPolicies to return per call. + int32 page_size = 2; + + // The value returned by the last `ListEndpointPoliciesResponse` + // Indicates that this is a continuation of a prior + // `ListEndpointPolicies` call, and that the system should return the + // next page of data. + string page_token = 3; +} + +// Response returned by the ListEndpointPolicies method. +message ListEndpointPoliciesResponse { + // List of EndpointPolicy resources. + repeated EndpointPolicy endpoint_policies = 1; + + // If there might be more results than those appearing in this response, then + // `next_page_token` is included. To get the next set of results, call this + // method again using the value of `next_page_token` as `page_token`. + string next_page_token = 2; +} + +// Request used with the GetEndpointPolicy method. +message GetEndpointPolicyRequest { + // Required. A name of the EndpointPolicy to get. Must be in the format + // `projects/*/locations/global/endpointPolicies/*`. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "networkservices.googleapis.com/EndpointPolicy" + } + ]; +} + +// Request used with the CreateEndpointPolicy method. +message CreateEndpointPolicyRequest { + // Required. The parent resource of the EndpointPolicy. Must be in the + // format `projects/*/locations/global`. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "networkservices.googleapis.com/EndpointPolicy" + } + ]; + + // Required. Short name of the EndpointPolicy resource to be created. + // E.g. "CustomECS". + string endpoint_policy_id = 2 [(google.api.field_behavior) = REQUIRED]; + + // Required. EndpointPolicy resource to be created. + EndpointPolicy endpoint_policy = 3 [(google.api.field_behavior) = REQUIRED]; +} + +// Request used with the UpdateEndpointPolicy method. +message UpdateEndpointPolicyRequest { + // Optional. Field mask is used to specify the fields to be overwritten in the + // EndpointPolicy resource by the update. + // The fields specified in the update_mask are relative to the resource, not + // the full request. A field will be overwritten if it is in the mask. If the + // user does not provide a mask then all fields will be overwritten. + google.protobuf.FieldMask update_mask = 1 + [(google.api.field_behavior) = OPTIONAL]; + + // Required. Updated EndpointPolicy resource. + EndpointPolicy endpoint_policy = 2 [(google.api.field_behavior) = REQUIRED]; +} + +// Request used with the DeleteEndpointPolicy method. +message DeleteEndpointPolicyRequest { + // Required. A name of the EndpointPolicy to delete. Must be in the format + // `projects/*/locations/global/endpointPolicies/*`. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "networkservices.googleapis.com/EndpointPolicy" + } + ]; +} diff --git a/packages/google-cloud-networkservices/protos/google/cloud/networkservices/v1/gateway.proto b/packages/google-cloud-networkservices/protos/google/cloud/networkservices/v1/gateway.proto new file mode 100644 index 00000000000..07ae67323a3 --- /dev/null +++ b/packages/google-cloud-networkservices/protos/google/cloud/networkservices/v1/gateway.proto @@ -0,0 +1,192 @@ +// Copyright 2023 Google LLC +// +// Licensed under the Apache License, Version 2.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.networkservices.v1; + +import "google/api/field_behavior.proto"; +import "google/api/resource.proto"; +import "google/protobuf/field_mask.proto"; +import "google/protobuf/timestamp.proto"; + +option csharp_namespace = "Google.Cloud.NetworkServices.V1"; +option go_package = "cloud.google.com/go/networkservices/apiv1/networkservicespb;networkservicespb"; +option java_multiple_files = true; +option java_outer_classname = "GatewayProto"; +option java_package = "com.google.cloud.networkservices.v1"; +option php_namespace = "Google\\Cloud\\NetworkServices\\V1"; +option ruby_package = "Google::Cloud::NetworkServices::V1"; + +// Gateway represents the configuration for a proxy, typically a load balancer. +// It captures the ip:port over which the services are exposed by the proxy, +// along with any policy configurations. Routes have reference to to Gateways to +// dictate how requests should be routed by this Gateway. +message Gateway { + option (google.api.resource) = { + type: "networkservices.googleapis.com/Gateway" + pattern: "projects/{project}/locations/{location}/gateways/{gateway}" + }; + + // The type of the customer-managed gateway. + // Possible values are: + // * OPEN_MESH + // * SECURE_WEB_GATEWAY + enum Type { + // The type of the customer managed gateway is unspecified. + TYPE_UNSPECIFIED = 0; + + // The type of the customer managed gateway is TrafficDirector Open + // Mesh. + OPEN_MESH = 1; + + // The type of the customer managed gateway is SecureWebGateway (SWG). + SECURE_WEB_GATEWAY = 2; + } + + // Required. Name of the Gateway resource. It matches pattern + // `projects/*/locations/*/gateways/`. + string name = 1 [(google.api.field_behavior) = REQUIRED]; + + // Output only. Server-defined URL of this resource + string self_link = 13 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The timestamp when the resource was created. + google.protobuf.Timestamp create_time = 2 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The timestamp when the resource was updated. + google.protobuf.Timestamp update_time = 3 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Optional. Set of label tags associated with the Gateway resource. + map labels = 4 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. A free-text description of the resource. Max length 1024 + // characters. + string description = 5 [(google.api.field_behavior) = OPTIONAL]; + + // Immutable. The type of the customer managed gateway. + // This field is required. If unspecified, an error is returned. + Type type = 6 [(google.api.field_behavior) = IMMUTABLE]; + + // Required. One or more ports that the Gateway must receive traffic on. The + // proxy binds to the ports specified. Gateway listen on 0.0.0.0 on the ports + // specified below. + repeated int32 ports = 11 [(google.api.field_behavior) = REQUIRED]; + + // Required. Immutable. Scope determines how configuration across multiple + // Gateway instances are merged. The configuration for multiple Gateway + // instances with the same scope will be merged as presented as a single + // coniguration to the proxy/load balancer. + // + // Max length 64 characters. + // Scope should start with a letter and can only have letters, numbers, + // hyphens. + string scope = 8 [ + (google.api.field_behavior) = REQUIRED, + (google.api.field_behavior) = IMMUTABLE + ]; + + // Optional. A fully-qualified ServerTLSPolicy URL reference. Specifies how + // TLS traffic is terminated. If empty, TLS termination is disabled. + string server_tls_policy = 9 [(google.api.field_behavior) = OPTIONAL]; +} + +// Request used with the ListGateways method. +message ListGatewaysRequest { + // Required. The project and location from which the Gateways should be + // listed, specified in the format `projects/*/locations/*`. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "networkservices.googleapis.com/Gateway" + } + ]; + + // Maximum number of Gateways to return per call. + int32 page_size = 2; + + // The value returned by the last `ListGatewaysResponse` + // Indicates that this is a continuation of a prior `ListGateways` call, + // and that the system should return the next page of data. + string page_token = 3; +} + +// Response returned by the ListGateways method. +message ListGatewaysResponse { + // List of Gateway resources. + repeated Gateway gateways = 1; + + // If there might be more results than those appearing in this response, then + // `next_page_token` is included. To get the next set of results, call this + // method again using the value of `next_page_token` as `page_token`. + string next_page_token = 2; +} + +// Request used by the GetGateway method. +message GetGatewayRequest { + // Required. A name of the Gateway to get. Must be in the format + // `projects/*/locations/*/gateways/*`. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "networkservices.googleapis.com/Gateway" + } + ]; +} + +// Request used by the CreateGateway method. +message CreateGatewayRequest { + // Required. The parent resource of the Gateway. Must be in the + // format `projects/*/locations/*`. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "networkservices.googleapis.com/Gateway" + } + ]; + + // Required. Short name of the Gateway resource to be created. + string gateway_id = 2 [(google.api.field_behavior) = REQUIRED]; + + // Required. Gateway resource to be created. + Gateway gateway = 3 [(google.api.field_behavior) = REQUIRED]; +} + +// Request used by the UpdateGateway method. +message UpdateGatewayRequest { + // Optional. Field mask is used to specify the fields to be overwritten in the + // Gateway resource by the update. + // The fields specified in the update_mask are relative to the resource, not + // the full request. A field will be overwritten if it is in the mask. If the + // user does not provide a mask then all fields will be overwritten. + google.protobuf.FieldMask update_mask = 1 + [(google.api.field_behavior) = OPTIONAL]; + + // Required. Updated Gateway resource. + Gateway gateway = 2 [(google.api.field_behavior) = REQUIRED]; +} + +// Request used by the DeleteGateway method. +message DeleteGatewayRequest { + // Required. A name of the Gateway to delete. Must be in the format + // `projects/*/locations/*/gateways/*`. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "networkservices.googleapis.com/Gateway" + } + ]; +} diff --git a/packages/google-cloud-networkservices/protos/google/cloud/networkservices/v1/grpc_route.proto b/packages/google-cloud-networkservices/protos/google/cloud/networkservices/v1/grpc_route.proto new file mode 100644 index 00000000000..48894fe2977 --- /dev/null +++ b/packages/google-cloud-networkservices/protos/google/cloud/networkservices/v1/grpc_route.proto @@ -0,0 +1,424 @@ +// Copyright 2023 Google LLC +// +// Licensed under the Apache License, Version 2.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.networkservices.v1; + +import "google/api/field_behavior.proto"; +import "google/api/resource.proto"; +import "google/protobuf/duration.proto"; +import "google/protobuf/field_mask.proto"; +import "google/protobuf/timestamp.proto"; + +option csharp_namespace = "Google.Cloud.NetworkServices.V1"; +option go_package = "cloud.google.com/go/networkservices/apiv1/networkservicespb;networkservicespb"; +option java_multiple_files = true; +option java_outer_classname = "GrpcRouteProto"; +option java_package = "com.google.cloud.networkservices.v1"; +option php_namespace = "Google\\Cloud\\NetworkServices\\V1"; +option ruby_package = "Google::Cloud::NetworkServices::V1"; + +// GrpcRoute is the resource defining how gRPC traffic routed by a Mesh +// or Gateway resource is routed. +message GrpcRoute { + option (google.api.resource) = { + type: "networkservices.googleapis.com/GrpcRoute" + pattern: "projects/{project}/locations/{location}/grpcRoutes/{grpc_route}" + }; + + // Specifies a match against a method. + message MethodMatch { + // The type of the match. + enum Type { + // Unspecified. + TYPE_UNSPECIFIED = 0; + + // Will only match the exact name provided. + EXACT = 1; + + // Will interpret grpc_method and grpc_service as regexes. RE2 syntax is + // supported. + REGULAR_EXPRESSION = 2; + } + + // Optional. Specifies how to match against the name. If not specified, a + // default value of "EXACT" is used. + Type type = 1 [(google.api.field_behavior) = OPTIONAL]; + + // Required. Name of the service to match against. If unspecified, will + // match all services. + string grpc_service = 2 [(google.api.field_behavior) = REQUIRED]; + + // Required. Name of the method to match against. If unspecified, will match + // all methods. + string grpc_method = 3 [(google.api.field_behavior) = REQUIRED]; + + // Optional. Specifies that matches are case sensitive. The default value + // is true. case_sensitive must not be used with a type of + // REGULAR_EXPRESSION. + optional bool case_sensitive = 4 [(google.api.field_behavior) = OPTIONAL]; + } + + // A match against a collection of headers. + message HeaderMatch { + // The type of match. + enum Type { + // Unspecified. + TYPE_UNSPECIFIED = 0; + + // Will only match the exact value provided. + EXACT = 1; + + // Will match paths conforming to the prefix specified by value. RE2 + // syntax is supported. + REGULAR_EXPRESSION = 2; + } + + // Optional. Specifies how to match against the value of the header. If not + // specified, a default value of EXACT is used. + Type type = 1 [(google.api.field_behavior) = OPTIONAL]; + + // Required. The key of the header. + string key = 2 [(google.api.field_behavior) = REQUIRED]; + + // Required. The value of the header. + string value = 3 [(google.api.field_behavior) = REQUIRED]; + } + + // Criteria for matching traffic. A RouteMatch will be considered to match + // when all supplied fields match. + message RouteMatch { + // Optional. A gRPC method to match against. If this field is empty or + // omitted, will match all methods. + optional MethodMatch method = 1 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Specifies a collection of headers to match. + repeated HeaderMatch headers = 2 [(google.api.field_behavior) = OPTIONAL]; + } + + // The destination to which traffic will be routed. + message Destination { + // Specifies the kind of destination to which traffic will be routed. + oneof destination_type { + // Required. The URL of a destination service to which to route traffic. + // Must refer to either a BackendService or ServiceDirectoryService. + string service_name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "compute.googleapis.com/BackendService" + } + ]; + } + + // Optional. Specifies the proportion of requests forwarded to the backend + // referenced by the serviceName field. This is computed as: + // - weight/Sum(weights in this destination list). + // For non-zero values, there may be some epsilon from the exact proportion + // defined here depending on the precision an implementation supports. + // + // If only one serviceName is specified and it has a weight greater than 0, + // 100% of the traffic is forwarded to that backend. + // + // If weights are specified for any one service name, they need to be + // specified for all of them. + // + // If weights are unspecified for all services, then, traffic is distributed + // in equal proportions to all of them. + optional int32 weight = 2 [(google.api.field_behavior) = OPTIONAL]; + } + + // The specification for fault injection introduced into traffic to test the + // resiliency of clients to destination service failure. As part of fault + // injection, when clients send requests to a destination, delays can be + // introduced on a percentage of requests before sending those requests to the + // destination service. Similarly requests from clients can be aborted by for + // a percentage of requests. + message FaultInjectionPolicy { + // Specification of how client requests are delayed as part of fault + // injection before being sent to a destination. + message Delay { + // Specify a fixed delay before forwarding the request. + optional google.protobuf.Duration fixed_delay = 1; + + // The percentage of traffic on which delay will be injected. + // + // The value must be between [0, 100] + optional int32 percentage = 2; + } + + // Specification of how client requests are aborted as part of fault + // injection before being sent to a destination. + message Abort { + // The HTTP status code used to abort the request. + // + // The value must be between 200 and 599 inclusive. + optional int32 http_status = 1; + + // The percentage of traffic which will be aborted. + // + // The value must be between [0, 100] + optional int32 percentage = 2; + } + + // The specification for injecting delay to client requests. + optional Delay delay = 1; + + // The specification for aborting to client requests. + optional Abort abort = 2; + } + + // The specifications for retries. + message RetryPolicy { + // - connect-failure: Router will retry on failures connecting to Backend + // Services, for example due to connection timeouts. + // - refused-stream: Router will retry if the backend service resets the + // stream + // with a REFUSED_STREAM error code. This reset type indicates that it is + // safe to retry. + // - cancelled: Router will retry if the gRPC status code in the response + // header + // is set to cancelled + // - deadline-exceeded: Router will retry if the gRPC status code in the + // response + // header is set to deadline-exceeded + // - resource-exhausted: Router will retry if the gRPC status code in the + // response header is set to resource-exhausted + // - unavailable: Router will retry if the gRPC status code in the response + // header is set to unavailable + repeated string retry_conditions = 1; + + // Specifies the allowed number of retries. This number must be > 0. If not + // specified, default to 1. + uint32 num_retries = 2; + } + + // Specifies how to route matched traffic. + message RouteAction { + // Optional. The destination services to which traffic should be forwarded. + // If multiple destinations are specified, traffic will be split between + // Backend Service(s) according to the weight field of these destinations. + repeated Destination destinations = 1 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The specification for fault injection introduced into traffic to test the + // resiliency of clients to destination service failure. As part of fault + // injection, when clients send requests to a destination, delays can be + // introduced on a percentage of requests before sending those requests to + // the destination service. Similarly requests from clients can be aborted + // by for a percentage of requests. + // + // timeout and retry_policy will be ignored by clients that are configured + // with a fault_injection_policy + FaultInjectionPolicy fault_injection_policy = 3 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Specifies the timeout for selected route. Timeout is computed + // from the time the request has been fully processed (i.e. end of stream) + // up until the response has been completely processed. Timeout includes all + // retries. + google.protobuf.Duration timeout = 7 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Specifies the retry policy associated with this route. + RetryPolicy retry_policy = 8 [(google.api.field_behavior) = OPTIONAL]; + } + + // Describes how to route traffic. + message RouteRule { + // Optional. Matches define conditions used for matching the rule against + // incoming gRPC requests. Each match is independent, i.e. this rule will be + // matched if ANY one of the matches is satisfied. If no matches field is + // specified, this rule will unconditionally match traffic. + repeated RouteMatch matches = 1 [(google.api.field_behavior) = OPTIONAL]; + + // Required. A detailed rule defining how to route traffic. This field is + // required. + RouteAction action = 2 [(google.api.field_behavior) = REQUIRED]; + } + + // Required. Name of the GrpcRoute resource. It matches pattern + // `projects/*/locations/global/grpcRoutes/` + string name = 1 [(google.api.field_behavior) = REQUIRED]; + + // Output only. Server-defined URL of this resource + string self_link = 12 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The timestamp when the resource was created. + google.protobuf.Timestamp create_time = 2 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The timestamp when the resource was updated. + google.protobuf.Timestamp update_time = 3 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Optional. Set of label tags associated with the GrpcRoute resource. + map labels = 4 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. A free-text description of the resource. Max length 1024 + // characters. + string description = 5 [(google.api.field_behavior) = OPTIONAL]; + + // Required. Service hostnames with an optional port for which this route + // describes traffic. + // + // Format: [:] + // + // Hostname is the fully qualified domain name of a network host. This matches + // the RFC 1123 definition of a hostname with 2 notable exceptions: + // - IPs are not allowed. + // - A hostname may be prefixed with a wildcard label (`*.`). The wildcard + // label must appear by itself as the first label. + // + // Hostname can be "precise" which is a domain name without the terminating + // dot of a network host (e.g. `foo.example.com`) or "wildcard", which is a + // domain name prefixed with a single wildcard label (e.g. `*.example.com`). + // + // Note that as per RFC1035 and RFC1123, a label must consist of lower case + // alphanumeric characters or '-', and must start and end with an alphanumeric + // character. No other punctuation is allowed. + // + // The routes associated with a Mesh or Gateway must have unique hostnames. If + // you attempt to attach multiple routes with conflicting hostnames, the + // configuration will be rejected. + // + // For example, while it is acceptable for routes for the hostnames + // `*.foo.bar.com` and `*.bar.com` to be associated with the same route, it is + // not possible to associate two routes both with `*.bar.com` or both with + // `bar.com`. + // + // If a port is specified, then gRPC clients must use the channel URI with the + // port to match this rule (i.e. "xds:///service:123"), otherwise they must + // supply the URI without a port (i.e. "xds:///service"). + repeated string hostnames = 6 [(google.api.field_behavior) = REQUIRED]; + + // Optional. Meshes defines a list of meshes this GrpcRoute is attached to, as + // one of the routing rules to route the requests served by the mesh. + // + // Each mesh reference should match the pattern: + // `projects/*/locations/global/meshes/` + repeated string meshes = 9 [ + (google.api.field_behavior) = OPTIONAL, + (google.api.resource_reference) = { + type: "networkservices.googleapis.com/Mesh" + } + ]; + + // Optional. Gateways defines a list of gateways this GrpcRoute is attached + // to, as one of the routing rules to route the requests served by the + // gateway. + // + // Each gateway reference should match the pattern: + // `projects/*/locations/global/gateways/` + repeated string gateways = 10 [ + (google.api.field_behavior) = OPTIONAL, + (google.api.resource_reference) = { + type: "networkservices.googleapis.com/Gateway" + } + ]; + + // Required. A list of detailed rules defining how to route traffic. + // + // Within a single GrpcRoute, the GrpcRoute.RouteAction associated with the + // first matching GrpcRoute.RouteRule will be executed. At least one rule + // must be supplied. + repeated RouteRule rules = 7 [(google.api.field_behavior) = REQUIRED]; +} + +// Request used with the ListGrpcRoutes method. +message ListGrpcRoutesRequest { + // Required. The project and location from which the GrpcRoutes should be + // listed, specified in the format `projects/*/locations/global`. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "networkservices.googleapis.com/GrpcRoute" + } + ]; + + // Maximum number of GrpcRoutes to return per call. + int32 page_size = 2; + + // The value returned by the last `ListGrpcRoutesResponse` + // Indicates that this is a continuation of a prior `ListGrpcRoutes` call, + // and that the system should return the next page of data. + string page_token = 3; +} + +// Response returned by the ListGrpcRoutes method. +message ListGrpcRoutesResponse { + // List of GrpcRoute resources. + repeated GrpcRoute grpc_routes = 1; + + // If there might be more results than those appearing in this response, then + // `next_page_token` is included. To get the next set of results, call this + // method again using the value of `next_page_token` as `page_token`. + string next_page_token = 2; +} + +// Request used by the GetGrpcRoute method. +message GetGrpcRouteRequest { + // Required. A name of the GrpcRoute to get. Must be in the format + // `projects/*/locations/global/grpcRoutes/*`. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "networkservices.googleapis.com/GrpcRoute" + } + ]; +} + +// Request used by the CreateGrpcRoute method. +message CreateGrpcRouteRequest { + // Required. The parent resource of the GrpcRoute. Must be in the + // format `projects/*/locations/global`. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "networkservices.googleapis.com/GrpcRoute" + } + ]; + + // Required. Short name of the GrpcRoute resource to be created. + string grpc_route_id = 2 [(google.api.field_behavior) = REQUIRED]; + + // Required. GrpcRoute resource to be created. + GrpcRoute grpc_route = 3 [(google.api.field_behavior) = REQUIRED]; +} + +// Request used by the UpdateGrpcRoute method. +message UpdateGrpcRouteRequest { + // Optional. Field mask is used to specify the fields to be overwritten in the + // GrpcRoute resource by the update. + // The fields specified in the update_mask are relative to the resource, not + // the full request. A field will be overwritten if it is in the mask. If the + // user does not provide a mask then all fields will be overwritten. + google.protobuf.FieldMask update_mask = 1 + [(google.api.field_behavior) = OPTIONAL]; + + // Required. Updated GrpcRoute resource. + GrpcRoute grpc_route = 2 [(google.api.field_behavior) = REQUIRED]; +} + +// Request used by the DeleteGrpcRoute method. +message DeleteGrpcRouteRequest { + // Required. A name of the GrpcRoute to delete. Must be in the format + // `projects/*/locations/global/grpcRoutes/*`. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "networkservices.googleapis.com/GrpcRoute" + } + ]; +} diff --git a/packages/google-cloud-networkservices/protos/google/cloud/networkservices/v1/http_route.proto b/packages/google-cloud-networkservices/protos/google/cloud/networkservices/v1/http_route.proto new file mode 100644 index 00000000000..bbbae60ae32 --- /dev/null +++ b/packages/google-cloud-networkservices/protos/google/cloud/networkservices/v1/http_route.proto @@ -0,0 +1,625 @@ +// Copyright 2023 Google LLC +// +// Licensed under the Apache License, Version 2.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.networkservices.v1; + +import "google/api/field_behavior.proto"; +import "google/api/resource.proto"; +import "google/protobuf/duration.proto"; +import "google/protobuf/field_mask.proto"; +import "google/protobuf/timestamp.proto"; + +option csharp_namespace = "Google.Cloud.NetworkServices.V1"; +option go_package = "cloud.google.com/go/networkservices/apiv1/networkservicespb;networkservicespb"; +option java_multiple_files = true; +option java_outer_classname = "HttpRouteProto"; +option java_package = "com.google.cloud.networkservices.v1"; +option php_namespace = "Google\\Cloud\\NetworkServices\\V1"; +option ruby_package = "Google::Cloud::NetworkServices::V1"; + +// HttpRoute is the resource defining how HTTP traffic should be routed by a +// Mesh or Gateway resource. +message HttpRoute { + option (google.api.resource) = { + type: "networkservices.googleapis.com/HttpRoute" + pattern: "projects/{project}/locations/{location}/httpRoutes/{http_route}" + }; + + // Specifies how to select a route rule based on HTTP request headers. + message HeaderMatch { + // Represents an integer value range. + message IntegerRange { + // Start of the range (inclusive) + int32 start = 1; + + // End of the range (exclusive) + int32 end = 2; + } + + oneof MatchType { + // The value of the header should match exactly the content of + // exact_match. + string exact_match = 2; + + // The value of the header must match the regular expression specified in + // regex_match. For regular expression grammar, please see: + // https://github.com/google/re2/wiki/Syntax + string regex_match = 3; + + // The value of the header must start with the contents of prefix_match. + string prefix_match = 4; + + // A header with header_name must exist. The match takes place whether or + // not the header has a value. + bool present_match = 5; + + // The value of the header must end with the contents of suffix_match. + string suffix_match = 6; + + // If specified, the rule will match if the request header value is within + // the range. + IntegerRange range_match = 7; + } + + // The name of the HTTP header to match against. + string header = 1; + + // If specified, the match result will be inverted before checking. Default + // value is set to false. + bool invert_match = 8; + } + + // Specifications to match a query parameter in the request. + message QueryParameterMatch { + oneof MatchType { + // The value of the query parameter must exactly match the contents of + // exact_match. + // + // Only one of exact_match, regex_match, or present_match must be set. + string exact_match = 2; + + // The value of the query parameter must match the regular expression + // specified by regex_match. For regular expression grammar, please see + // https://github.com/google/re2/wiki/Syntax + // + // Only one of exact_match, regex_match, or present_match must be set. + string regex_match = 3; + + // Specifies that the QueryParameterMatcher matches if request contains + // query parameter, irrespective of whether the parameter has a value or + // not. + // + // Only one of exact_match, regex_match, or present_match must be set. + bool present_match = 4; + } + + // The name of the query parameter to match. + string query_parameter = 1; + } + + // RouteMatch defines specifications used to match requests. If multiple match + // types are set, this RouteMatch will match if ALL type of matches are + // matched. + message RouteMatch { + oneof PathMatch { + // The HTTP request path value should exactly match this value. + // + // Only one of full_path_match, prefix_match, or regex_match should be + // used. + string full_path_match = 1; + + // The HTTP request path value must begin with specified prefix_match. + // prefix_match must begin with a /. + // + // Only one of full_path_match, prefix_match, or regex_match should be + // used. + string prefix_match = 2; + + // The HTTP request path value must satisfy the regular expression + // specified by regex_match after removing any query parameters and anchor + // supplied with the original URL. For regular expression grammar, please + // see https://github.com/google/re2/wiki/Syntax + // + // Only one of full_path_match, prefix_match, or regex_match should be + // used. + string regex_match = 3; + } + + // Specifies if prefix_match and full_path_match matches are case sensitive. + // The default value is false. + bool ignore_case = 4; + + // Specifies a list of HTTP request headers to match against. ALL of the + // supplied headers must be matched. + repeated HeaderMatch headers = 5; + + // Specifies a list of query parameters to match against. ALL of the query + // parameters must be matched. + repeated QueryParameterMatch query_parameters = 6; + } + + // Specifications of a destination to which the request should be routed to. + message Destination { + // The URL of a BackendService to route traffic to. + string service_name = 1 [(google.api.resource_reference) = { + type: "compute.googleapis.com/BackendService" + }]; + + // Specifies the proportion of requests forwarded to the backend referenced + // by the serviceName field. This is computed as: + // - weight/Sum(weights in this destination list). + // For non-zero values, there may be some epsilon from the exact proportion + // defined here depending on the precision an implementation supports. + // + // If only one serviceName is specified and it has a weight greater than 0, + // 100% of the traffic is forwarded to that backend. + // + // If weights are specified for any one service name, they need to be + // specified for all of them. + // + // If weights are unspecified for all services, then, traffic is distributed + // in equal proportions to all of them. + int32 weight = 2; + } + + // The specification for redirecting traffic. + message Redirect { + // Supported HTTP response code. + enum ResponseCode { + // Default value + RESPONSE_CODE_UNSPECIFIED = 0; + + // Corresponds to 301. + MOVED_PERMANENTLY_DEFAULT = 1; + + // Corresponds to 302. + FOUND = 2; + + // Corresponds to 303. + SEE_OTHER = 3; + + // Corresponds to 307. In this case, the request method will be retained. + TEMPORARY_REDIRECT = 4; + + // Corresponds to 308. In this case, the request method will be retained. + PERMANENT_REDIRECT = 5; + } + + // The host that will be used in the redirect response instead of the one + // that was supplied in the request. + string host_redirect = 1; + + // The path that will be used in the redirect response instead of the one + // that was supplied in the request. + // path_redirect can not be supplied together with prefix_redirect. Supply + // one alone or neither. If neither is supplied, the path of the original + // request will be used for the redirect. + string path_redirect = 2; + + // Indicates that during redirection, the matched prefix (or path) should be + // swapped with this value. This option allows URLs be dynamically created + // based on the request. + string prefix_rewrite = 3; + + // The HTTP Status code to use for the redirect. + ResponseCode response_code = 4; + + // If set to true, the URL scheme in the redirected request is set to https. + // If set to false, the URL scheme of the redirected request will remain the + // same as that of the request. + // + // The default is set to false. + bool https_redirect = 5; + + // if set to true, any accompanying query portion of the original URL is + // removed prior to redirecting the request. If set to false, the query + // portion of the original URL is retained. + // + // The default is set to false. + bool strip_query = 6; + + // The port that will be used in the redirected request instead of the one + // that was supplied in the request. + int32 port_redirect = 7; + } + + // The specification for fault injection introduced into traffic to test the + // resiliency of clients to destination service failure. As part of fault + // injection, when clients send requests to a destination, delays can be + // introduced by client proxy on a percentage of requests before sending those + // requests to the destination service. Similarly requests can be aborted by + // client proxy for a percentage of requests. + message FaultInjectionPolicy { + // Specification of how client requests are delayed as part of fault + // injection before being sent to a destination. + message Delay { + // Specify a fixed delay before forwarding the request. + google.protobuf.Duration fixed_delay = 1; + + // The percentage of traffic on which delay will be injected. + // + // The value must be between [0, 100] + int32 percentage = 2; + } + + // Specification of how client requests are aborted as part of fault + // injection before being sent to a destination. + message Abort { + // The HTTP status code used to abort the request. + // + // The value must be between 200 and 599 inclusive. + int32 http_status = 1; + + // The percentage of traffic which will be aborted. + // + // The value must be between [0, 100] + int32 percentage = 2; + } + + // The specification for injecting delay to client requests. + Delay delay = 1; + + // The specification for aborting to client requests. + Abort abort = 2; + } + + // The specification for modifying HTTP header in HTTP request and HTTP + // response. + message HeaderModifier { + // Completely overwrite/replace the headers with given map where key is the + // name of the header, value is the value of the header. + map set = 1; + + // Add the headers with given map where key is the name of the header, value + // is the value of the header. + map add = 2; + + // Remove headers (matching by header names) specified in the list. + repeated string remove = 3; + } + + // The specification for modifying the URL of the request, prior to forwarding + // the request to the destination. + message URLRewrite { + // Prior to forwarding the request to the selected destination, the matching + // portion of the requests path is replaced by this value. + string path_prefix_rewrite = 1; + + // Prior to forwarding the request to the selected destination, the requests + // host header is replaced by this value. + string host_rewrite = 2; + } + + // The specifications for retries. + message RetryPolicy { + // Specifies one or more conditions when this retry policy applies. Valid + // values are: + // 5xx: Proxy will attempt a retry if the destination service responds + // with any 5xx response code, of if the destination service does not + // respond at all, example: disconnect, reset, read timeout, connection + // failure and refused streams. + // + // gateway-error: Similar to 5xx, but only applies to response codes 502, + // 503, 504. + // + // reset: Proxy will attempt a retry if the destination service does not + // respond at all (disconnect/reset/read timeout) + // + // connect-failure: Proxy will retry on failures connecting to destination + // for example due to connection timeouts. + // + // retriable-4xx: Proxy will retry fro retriable 4xx response codes. + // Currently the only retriable error supported is 409. + // + // refused-stream: Proxy will retry if the destination resets the stream + // with a REFUSED_STREAM error code. This reset type indicates that it + // is safe to retry. + repeated string retry_conditions = 1; + + // Specifies the allowed number of retries. This number must be > 0. If not + // specified, default to 1. + int32 num_retries = 2; + + // Specifies a non-zero timeout per retry attempt. + google.protobuf.Duration per_try_timeout = 3; + } + + // Specifies the policy on how requests are shadowed to a separate mirrored + // destination service. The proxy does not wait for responses from the + // shadow service. Prior to sending traffic to the shadow service, the + // host/authority header is suffixed with -shadow. + message RequestMirrorPolicy { + // The destination the requests will be mirrored to. The weight of the + // destination will be ignored. + Destination destination = 1; + } + + // The Specification for allowing client side cross-origin requests. + message CorsPolicy { + // Specifies the list of origins that will be allowed to do CORS requests. + // An origin is allowed if it matches either an item in allow_origins or + // an item in allow_origin_regexes. + repeated string allow_origins = 1; + + // Specifies the regular expression patterns that match allowed origins. For + // regular expression grammar, please see + // https://github.com/google/re2/wiki/Syntax. + repeated string allow_origin_regexes = 2; + + // Specifies the content for Access-Control-Allow-Methods header. + repeated string allow_methods = 3; + + // Specifies the content for Access-Control-Allow-Headers header. + repeated string allow_headers = 4; + + // Specifies the content for Access-Control-Expose-Headers header. + repeated string expose_headers = 5; + + // Specifies how long result of a preflight request can be cached in + // seconds. This translates to the Access-Control-Max-Age header. + string max_age = 6; + + // In response to a preflight request, setting this to true indicates that + // the actual request can include user credentials. This translates to the + // Access-Control-Allow-Credentials header. + // + // Default value is false. + bool allow_credentials = 7; + + // If true, the CORS policy is disabled. The default value is false, which + // indicates that the CORS policy is in effect. + bool disabled = 8; + } + + // The specifications for routing traffic and applying associated policies. + message RouteAction { + // The destination to which traffic should be forwarded. + repeated Destination destinations = 1; + + // If set, the request is directed as configured by this field. + Redirect redirect = 2; + + // The specification for fault injection introduced into traffic to test the + // resiliency of clients to backend service failure. As part of fault + // injection, when clients send requests to a backend service, delays can be + // introduced on a percentage of requests before sending those requests to + // the backend service. Similarly requests from clients can be aborted for a + // percentage of requests. + // + // timeout and retry_policy will be ignored by clients that are configured + // with a fault_injection_policy + FaultInjectionPolicy fault_injection_policy = 4; + + // The specification for modifying the headers of a matching request prior + // to delivery of the request to the destination. If HeaderModifiers are set + // on both the Destination and the RouteAction, they will be merged. + // Conflicts between the two will not be resolved on the configuration. + HeaderModifier request_header_modifier = 5; + + // The specification for modifying the headers of a response prior to + // sending the response back to the client. If HeaderModifiers are set + // on both the Destination and the RouteAction, they will be merged. + // Conflicts between the two will not be resolved on the configuration. + HeaderModifier response_header_modifier = 6; + + // The specification for rewrite URL before forwarding requests to the + // destination. + URLRewrite url_rewrite = 7; + + // Specifies the timeout for selected route. Timeout is computed from the + // time the request has been fully processed (i.e. end of stream) up until + // the response has been completely processed. Timeout includes all retries. + google.protobuf.Duration timeout = 8; + + // Specifies the retry policy associated with this route. + RetryPolicy retry_policy = 9; + + // Specifies the policy on how requests intended for the routes destination + // are shadowed to a separate mirrored destination. Proxy will not wait for + // the shadow destination to respond before returning the response. Prior to + // sending traffic to the shadow service, the host/authority header is + // suffixed with -shadow. + RequestMirrorPolicy request_mirror_policy = 10; + + // The specification for allowing client side cross-origin requests. + CorsPolicy cors_policy = 11; + } + + // Specifies how to match traffic and how to route traffic when traffic is + // matched. + message RouteRule { + // A list of matches define conditions used for matching the rule against + // incoming HTTP requests. Each match is independent, i.e. this rule will be + // matched if ANY one of the matches is satisfied. + // + // If no matches field is specified, this rule will unconditionally match + // traffic. + // + // If a default rule is desired to be configured, add a rule with no matches + // specified to the end of the rules list. + repeated RouteMatch matches = 1; + + // The detailed rule defining how to route matched traffic. + RouteAction action = 2; + } + + // Required. Name of the HttpRoute resource. It matches pattern + // `projects/*/locations/global/httpRoutes/http_route_name>`. + string name = 1 [(google.api.field_behavior) = REQUIRED]; + + // Output only. Server-defined URL of this resource + string self_link = 11 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Optional. A free-text description of the resource. Max length 1024 + // characters. + string description = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Output only. The timestamp when the resource was created. + google.protobuf.Timestamp create_time = 3 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The timestamp when the resource was updated. + google.protobuf.Timestamp update_time = 4 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Required. Hostnames define a set of hosts that should match against the + // HTTP host header to select a HttpRoute to process the request. Hostname is + // the fully qualified domain name of a network host, as defined by RFC 1123 + // with the exception that: + // - IPs are not allowed. + // - A hostname may be prefixed with a wildcard label (`*.`). The wildcard + // label must appear by itself as the first label. + // + // Hostname can be "precise" which is a domain name without the terminating + // dot of a network host (e.g. `foo.example.com`) or "wildcard", which is a + // domain name prefixed with a single wildcard label (e.g. `*.example.com`). + // + // Note that as per RFC1035 and RFC1123, a label must consist of lower case + // alphanumeric characters or '-', and must start and end with an alphanumeric + // character. No other punctuation is allowed. + // + // The routes associated with a Mesh or Gateways must have unique hostnames. + // If you attempt to attach multiple routes with conflicting hostnames, + // the configuration will be rejected. + // + // For example, while it is acceptable for routes for the hostnames + // `*.foo.bar.com` and `*.bar.com` to be associated with the same Mesh (or + // Gateways under the same scope), it is not possible to associate two routes + // both with `*.bar.com` or both with `bar.com`. + repeated string hostnames = 5 [(google.api.field_behavior) = REQUIRED]; + + // Optional. Meshes defines a list of meshes this HttpRoute is attached to, as + // one of the routing rules to route the requests served by the mesh. + // + // Each mesh reference should match the pattern: + // `projects/*/locations/global/meshes/` + // + // The attached Mesh should be of a type SIDECAR + repeated string meshes = 8 [ + (google.api.field_behavior) = OPTIONAL, + (google.api.resource_reference) = { + type: "networkservices.googleapis.com/Mesh" + } + ]; + + // Optional. Gateways defines a list of gateways this HttpRoute is attached + // to, as one of the routing rules to route the requests served by the + // gateway. + // + // Each gateway reference should match the pattern: + // `projects/*/locations/global/gateways/` + repeated string gateways = 9 [ + (google.api.field_behavior) = OPTIONAL, + (google.api.resource_reference) = { + type: "networkservices.googleapis.com/Gateway" + } + ]; + + // Optional. Set of label tags associated with the HttpRoute resource. + map labels = 10 [(google.api.field_behavior) = OPTIONAL]; + + // Required. Rules that define how traffic is routed and handled. + // Rules will be matched sequentially based on the RouteMatch specified for + // the rule. + repeated RouteRule rules = 6 [(google.api.field_behavior) = REQUIRED]; +} + +// Request used with the ListHttpRoutes method. +message ListHttpRoutesRequest { + // Required. The project and location from which the HttpRoutes should be + // listed, specified in the format `projects/*/locations/global`. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "networkservices.googleapis.com/HttpRoute" + } + ]; + + // Maximum number of HttpRoutes to return per call. + int32 page_size = 2; + + // The value returned by the last `ListHttpRoutesResponse` + // Indicates that this is a continuation of a prior `ListHttpRoutes` call, + // and that the system should return the next page of data. + string page_token = 3; +} + +// Response returned by the ListHttpRoutes method. +message ListHttpRoutesResponse { + // List of HttpRoute resources. + repeated HttpRoute http_routes = 1; + + // If there might be more results than those appearing in this response, then + // `next_page_token` is included. To get the next set of results, call this + // method again using the value of `next_page_token` as `page_token`. + string next_page_token = 2; +} + +// Request used by the GetHttpRoute method. +message GetHttpRouteRequest { + // Required. A name of the HttpRoute to get. Must be in the format + // `projects/*/locations/global/httpRoutes/*`. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "networkservices.googleapis.com/HttpRoute" + } + ]; +} + +// Request used by the HttpRoute method. +message CreateHttpRouteRequest { + // Required. The parent resource of the HttpRoute. Must be in the + // format `projects/*/locations/global`. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "networkservices.googleapis.com/HttpRoute" + } + ]; + + // Required. Short name of the HttpRoute resource to be created. + string http_route_id = 2 [(google.api.field_behavior) = REQUIRED]; + + // Required. HttpRoute resource to be created. + HttpRoute http_route = 3 [(google.api.field_behavior) = REQUIRED]; +} + +// Request used by the UpdateHttpRoute method. +message UpdateHttpRouteRequest { + // Optional. Field mask is used to specify the fields to be overwritten in the + // HttpRoute resource by the update. + // The fields specified in the update_mask are relative to the resource, not + // the full request. A field will be overwritten if it is in the mask. If the + // user does not provide a mask then all fields will be overwritten. + google.protobuf.FieldMask update_mask = 1 + [(google.api.field_behavior) = OPTIONAL]; + + // Required. Updated HttpRoute resource. + HttpRoute http_route = 2 [(google.api.field_behavior) = REQUIRED]; +} + +// Request used by the DeleteHttpRoute method. +message DeleteHttpRouteRequest { + // Required. A name of the HttpRoute to delete. Must be in the format + // `projects/*/locations/global/httpRoutes/*`. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "networkservices.googleapis.com/HttpRoute" + } + ]; +} diff --git a/packages/google-cloud-networkservices/protos/google/cloud/networkservices/v1/mesh.proto b/packages/google-cloud-networkservices/protos/google/cloud/networkservices/v1/mesh.proto new file mode 100644 index 00000000000..ffa2c0b20ea --- /dev/null +++ b/packages/google-cloud-networkservices/protos/google/cloud/networkservices/v1/mesh.proto @@ -0,0 +1,157 @@ +// Copyright 2023 Google LLC +// +// Licensed under the Apache License, Version 2.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.networkservices.v1; + +import "google/api/field_behavior.proto"; +import "google/api/resource.proto"; +import "google/protobuf/field_mask.proto"; +import "google/protobuf/timestamp.proto"; + +option csharp_namespace = "Google.Cloud.NetworkServices.V1"; +option go_package = "cloud.google.com/go/networkservices/apiv1/networkservicespb;networkservicespb"; +option java_multiple_files = true; +option java_outer_classname = "MeshProto"; +option java_package = "com.google.cloud.networkservices.v1"; +option php_namespace = "Google\\Cloud\\NetworkServices\\V1"; +option ruby_package = "Google::Cloud::NetworkServices::V1"; + +// Mesh represents a logical configuration grouping for workload to workload +// communication within a service mesh. Routes that point to mesh dictate how +// requests are routed within this logical mesh boundary. +message Mesh { + option (google.api.resource) = { + type: "networkservices.googleapis.com/Mesh" + pattern: "projects/{project}/locations/{location}/meshes/{mesh}" + }; + + // Required. Name of the Mesh resource. It matches pattern + // `projects/*/locations/global/meshes/`. + string name = 1 [(google.api.field_behavior) = REQUIRED]; + + // Output only. Server-defined URL of this resource + string self_link = 9 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The timestamp when the resource was created. + google.protobuf.Timestamp create_time = 2 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The timestamp when the resource was updated. + google.protobuf.Timestamp update_time = 3 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Optional. Set of label tags associated with the Mesh resource. + map labels = 4 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. A free-text description of the resource. Max length 1024 + // characters. + string description = 5 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. If set to a valid TCP port (1-65535), instructs the SIDECAR proxy + // to listen on the specified port of localhost (127.0.0.1) address. The + // SIDECAR proxy will expect all traffic to be redirected to this port + // regardless of its actual ip:port destination. If unset, a port '15001' is + // used as the interception port. This is applicable only for sidecar proxy + // deployments. + int32 interception_port = 8 [(google.api.field_behavior) = OPTIONAL]; +} + +// Request used with the ListMeshes method. +message ListMeshesRequest { + // Required. The project and location from which the Meshes should be + // listed, specified in the format `projects/*/locations/global`. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "networkservices.googleapis.com/Mesh" + } + ]; + + // Maximum number of Meshes to return per call. + int32 page_size = 2; + + // The value returned by the last `ListMeshesResponse` + // Indicates that this is a continuation of a prior `ListMeshes` call, + // and that the system should return the next page of data. + string page_token = 3; +} + +// Response returned by the ListMeshes method. +message ListMeshesResponse { + // List of Mesh resources. + repeated Mesh meshes = 1; + + // If there might be more results than those appearing in this response, then + // `next_page_token` is included. To get the next set of results, call this + // method again using the value of `next_page_token` as `page_token`. + string next_page_token = 2; +} + +// Request used by the GetMesh method. +message GetMeshRequest { + // Required. A name of the Mesh to get. Must be in the format + // `projects/*/locations/global/meshes/*`. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "networkservices.googleapis.com/Mesh" + } + ]; +} + +// Request used by the CreateMesh method. +message CreateMeshRequest { + // Required. The parent resource of the Mesh. Must be in the + // format `projects/*/locations/global`. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "networkservices.googleapis.com/Mesh" + } + ]; + + // Required. Short name of the Mesh resource to be created. + string mesh_id = 2 [(google.api.field_behavior) = REQUIRED]; + + // Required. Mesh resource to be created. + Mesh mesh = 3 [(google.api.field_behavior) = REQUIRED]; +} + +// Request used by the UpdateMesh method. +message UpdateMeshRequest { + // Optional. Field mask is used to specify the fields to be overwritten in the + // Mesh resource by the update. + // The fields specified in the update_mask are relative to the resource, not + // the full request. A field will be overwritten if it is in the mask. If the + // user does not provide a mask then all fields will be overwritten. + google.protobuf.FieldMask update_mask = 1 + [(google.api.field_behavior) = OPTIONAL]; + + // Required. Updated Mesh resource. + Mesh mesh = 2 [(google.api.field_behavior) = REQUIRED]; +} + +// Request used by the DeleteMesh method. +message DeleteMeshRequest { + // Required. A name of the Mesh to delete. Must be in the format + // `projects/*/locations/global/meshes/*`. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "networkservices.googleapis.com/Mesh" + } + ]; +} diff --git a/packages/google-cloud-networkservices/protos/google/cloud/networkservices/v1/network_services.proto b/packages/google-cloud-networkservices/protos/google/cloud/networkservices/v1/network_services.proto new file mode 100644 index 00000000000..09f10fdbe5a --- /dev/null +++ b/packages/google-cloud-networkservices/protos/google/cloud/networkservices/v1/network_services.proto @@ -0,0 +1,485 @@ +// Copyright 2023 Google LLC +// +// Licensed under the Apache License, Version 2.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.networkservices.v1; + +import "google/api/annotations.proto"; +import "google/api/client.proto"; +import "google/cloud/networkservices/v1/endpoint_policy.proto"; +import "google/cloud/networkservices/v1/gateway.proto"; +import "google/cloud/networkservices/v1/grpc_route.proto"; +import "google/cloud/networkservices/v1/http_route.proto"; +import "google/cloud/networkservices/v1/mesh.proto"; +import "google/cloud/networkservices/v1/service_binding.proto"; +import "google/cloud/networkservices/v1/tcp_route.proto"; +import "google/cloud/networkservices/v1/tls_route.proto"; +import "google/longrunning/operations.proto"; + +option csharp_namespace = "Google.Cloud.NetworkServices.V1"; +option go_package = "cloud.google.com/go/networkservices/apiv1/networkservicespb;networkservicespb"; +option java_multiple_files = true; +option java_package = "com.google.cloud.networkservices.v1"; +option php_namespace = "Google\\Cloud\\NetworkServices\\V1"; +option ruby_package = "Google::Cloud::NetworkServices::V1"; + +service NetworkServices { + option (google.api.default_host) = "networkservices.googleapis.com"; + option (google.api.oauth_scopes) = + "https://www.googleapis.com/auth/cloud-platform"; + + // Lists EndpointPolicies in a given project and location. + rpc ListEndpointPolicies(ListEndpointPoliciesRequest) + returns (ListEndpointPoliciesResponse) { + option (google.api.http) = { + get: "/v1/{parent=projects/*/locations/*}/endpointPolicies" + }; + option (google.api.method_signature) = "parent"; + } + + // Gets details of a single EndpointPolicy. + rpc GetEndpointPolicy(GetEndpointPolicyRequest) returns (EndpointPolicy) { + option (google.api.http) = { + get: "/v1/{name=projects/*/locations/*/endpointPolicies/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Creates a new EndpointPolicy in a given project and location. + rpc CreateEndpointPolicy(CreateEndpointPolicyRequest) + returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v1/{parent=projects/*/locations/*}/endpointPolicies" + body: "endpoint_policy" + }; + option (google.api.method_signature) = + "parent,endpoint_policy,endpoint_policy_id"; + option (google.longrunning.operation_info) = { + response_type: "EndpointPolicy" + metadata_type: "google.cloud.networkservices.v1.OperationMetadata" + }; + } + + // Updates the parameters of a single EndpointPolicy. + rpc UpdateEndpointPolicy(UpdateEndpointPolicyRequest) + returns (google.longrunning.Operation) { + option (google.api.http) = { + patch: "/v1/{endpoint_policy.name=projects/*/locations/*/endpointPolicies/*}" + body: "endpoint_policy" + }; + option (google.api.method_signature) = "endpoint_policy,update_mask"; + option (google.longrunning.operation_info) = { + response_type: "EndpointPolicy" + metadata_type: "google.cloud.networkservices.v1.OperationMetadata" + }; + } + + // Deletes a single EndpointPolicy. + rpc DeleteEndpointPolicy(DeleteEndpointPolicyRequest) + returns (google.longrunning.Operation) { + option (google.api.http) = { + delete: "/v1/{name=projects/*/locations/*/endpointPolicies/*}" + }; + option (google.api.method_signature) = "name"; + option (google.longrunning.operation_info) = { + response_type: "google.protobuf.Empty" + metadata_type: "google.cloud.networkservices.v1.OperationMetadata" + }; + } + + // Lists Gateways in a given project and location. + rpc ListGateways(ListGatewaysRequest) returns (ListGatewaysResponse) { + option (google.api.http) = { + get: "/v1/{parent=projects/*/locations/*}/gateways" + }; + option (google.api.method_signature) = "parent"; + } + + // Gets details of a single Gateway. + rpc GetGateway(GetGatewayRequest) returns (Gateway) { + option (google.api.http) = { + get: "/v1/{name=projects/*/locations/*/gateways/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Creates a new Gateway in a given project and location. + rpc CreateGateway(CreateGatewayRequest) + returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v1/{parent=projects/*/locations/*}/gateways" + body: "gateway" + }; + option (google.api.method_signature) = "parent,gateway,gateway_id"; + option (google.longrunning.operation_info) = { + response_type: "Gateway" + metadata_type: "google.cloud.networkservices.v1.OperationMetadata" + }; + } + + // Updates the parameters of a single Gateway. + rpc UpdateGateway(UpdateGatewayRequest) + returns (google.longrunning.Operation) { + option (google.api.http) = { + patch: "/v1/{gateway.name=projects/*/locations/*/gateways/*}" + body: "gateway" + }; + option (google.api.method_signature) = "gateway,update_mask"; + option (google.longrunning.operation_info) = { + response_type: "Gateway" + metadata_type: "google.cloud.networkservices.v1.OperationMetadata" + }; + } + + // Deletes a single Gateway. + rpc DeleteGateway(DeleteGatewayRequest) + returns (google.longrunning.Operation) { + option (google.api.http) = { + delete: "/v1/{name=projects/*/locations/*/gateways/*}" + }; + option (google.api.method_signature) = "name"; + option (google.longrunning.operation_info) = { + response_type: "google.protobuf.Empty" + metadata_type: "google.cloud.networkservices.v1.OperationMetadata" + }; + } + + // Lists GrpcRoutes in a given project and location. + rpc ListGrpcRoutes(ListGrpcRoutesRequest) returns (ListGrpcRoutesResponse) { + option (google.api.http) = { + get: "/v1/{parent=projects/*/locations/*}/grpcRoutes" + }; + option (google.api.method_signature) = "parent"; + } + + // Gets details of a single GrpcRoute. + rpc GetGrpcRoute(GetGrpcRouteRequest) returns (GrpcRoute) { + option (google.api.http) = { + get: "/v1/{name=projects/*/locations/*/grpcRoutes/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Creates a new GrpcRoute in a given project and location. + rpc CreateGrpcRoute(CreateGrpcRouteRequest) + returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v1/{parent=projects/*/locations/*}/grpcRoutes" + body: "grpc_route" + }; + option (google.api.method_signature) = "parent,grpc_route,grpc_route_id"; + option (google.longrunning.operation_info) = { + response_type: "GrpcRoute" + metadata_type: "google.cloud.networkservices.v1.OperationMetadata" + }; + } + + // Updates the parameters of a single GrpcRoute. + rpc UpdateGrpcRoute(UpdateGrpcRouteRequest) + returns (google.longrunning.Operation) { + option (google.api.http) = { + patch: "/v1/{grpc_route.name=projects/*/locations/*/grpcRoutes/*}" + body: "grpc_route" + }; + option (google.api.method_signature) = "grpc_route,update_mask"; + option (google.longrunning.operation_info) = { + response_type: "GrpcRoute" + metadata_type: "google.cloud.networkservices.v1.OperationMetadata" + }; + } + + // Deletes a single GrpcRoute. + rpc DeleteGrpcRoute(DeleteGrpcRouteRequest) + returns (google.longrunning.Operation) { + option (google.api.http) = { + delete: "/v1/{name=projects/*/locations/*/grpcRoutes/*}" + }; + option (google.api.method_signature) = "name"; + option (google.longrunning.operation_info) = { + response_type: "google.protobuf.Empty" + metadata_type: "google.cloud.networkservices.v1.OperationMetadata" + }; + } + + // Lists HttpRoute in a given project and location. + rpc ListHttpRoutes(ListHttpRoutesRequest) returns (ListHttpRoutesResponse) { + option (google.api.http) = { + get: "/v1/{parent=projects/*/locations/*}/httpRoutes" + }; + option (google.api.method_signature) = "parent"; + } + + // Gets details of a single HttpRoute. + rpc GetHttpRoute(GetHttpRouteRequest) returns (HttpRoute) { + option (google.api.http) = { + get: "/v1/{name=projects/*/locations/*/httpRoutes/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Creates a new HttpRoute in a given project and location. + rpc CreateHttpRoute(CreateHttpRouteRequest) + returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v1/{parent=projects/*/locations/*}/httpRoutes" + body: "http_route" + }; + option (google.api.method_signature) = "parent,http_route,http_route_id"; + option (google.longrunning.operation_info) = { + response_type: "HttpRoute" + metadata_type: "google.cloud.networkservices.v1.OperationMetadata" + }; + } + + // Updates the parameters of a single HttpRoute. + rpc UpdateHttpRoute(UpdateHttpRouteRequest) + returns (google.longrunning.Operation) { + option (google.api.http) = { + patch: "/v1/{http_route.name=projects/*/locations/*/httpRoutes/*}" + body: "http_route" + }; + option (google.api.method_signature) = "http_route,update_mask"; + option (google.longrunning.operation_info) = { + response_type: "HttpRoute" + metadata_type: "google.cloud.networkservices.v1.OperationMetadata" + }; + } + + // Deletes a single HttpRoute. + rpc DeleteHttpRoute(DeleteHttpRouteRequest) + returns (google.longrunning.Operation) { + option (google.api.http) = { + delete: "/v1/{name=projects/*/locations/*/httpRoutes/*}" + }; + option (google.api.method_signature) = "name"; + option (google.longrunning.operation_info) = { + response_type: "google.protobuf.Empty" + metadata_type: "google.cloud.networkservices.v1.OperationMetadata" + }; + } + + // Lists TcpRoute in a given project and location. + rpc ListTcpRoutes(ListTcpRoutesRequest) returns (ListTcpRoutesResponse) { + option (google.api.http) = { + get: "/v1/{parent=projects/*/locations/*}/tcpRoutes" + }; + option (google.api.method_signature) = "parent"; + } + + // Gets details of a single TcpRoute. + rpc GetTcpRoute(GetTcpRouteRequest) returns (TcpRoute) { + option (google.api.http) = { + get: "/v1/{name=projects/*/locations/*/tcpRoutes/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Creates a new TcpRoute in a given project and location. + rpc CreateTcpRoute(CreateTcpRouteRequest) + returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v1/{parent=projects/*/locations/*}/tcpRoutes" + body: "tcp_route" + }; + option (google.api.method_signature) = "parent,tcp_route,tcp_route_id"; + option (google.longrunning.operation_info) = { + response_type: "TcpRoute" + metadata_type: "google.cloud.networkservices.v1.OperationMetadata" + }; + } + + // Updates the parameters of a single TcpRoute. + rpc UpdateTcpRoute(UpdateTcpRouteRequest) + returns (google.longrunning.Operation) { + option (google.api.http) = { + patch: "/v1/{tcp_route.name=projects/*/locations/*/tcpRoutes/*}" + body: "tcp_route" + }; + option (google.api.method_signature) = "tcp_route,update_mask"; + option (google.longrunning.operation_info) = { + response_type: "TcpRoute" + metadata_type: "google.cloud.networkservices.v1.OperationMetadata" + }; + } + + // Deletes a single TcpRoute. + rpc DeleteTcpRoute(DeleteTcpRouteRequest) + returns (google.longrunning.Operation) { + option (google.api.http) = { + delete: "/v1/{name=projects/*/locations/*/tcpRoutes/*}" + }; + option (google.api.method_signature) = "name"; + option (google.longrunning.operation_info) = { + response_type: "google.protobuf.Empty" + metadata_type: "google.cloud.networkservices.v1.OperationMetadata" + }; + } + + // Lists TlsRoute in a given project and location. + rpc ListTlsRoutes(ListTlsRoutesRequest) returns (ListTlsRoutesResponse) { + option (google.api.http) = { + get: "/v1/{parent=projects/*/locations/*}/tlsRoutes" + }; + option (google.api.method_signature) = "parent"; + } + + // Gets details of a single TlsRoute. + rpc GetTlsRoute(GetTlsRouteRequest) returns (TlsRoute) { + option (google.api.http) = { + get: "/v1/{name=projects/*/locations/*/tlsRoutes/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Creates a new TlsRoute in a given project and location. + rpc CreateTlsRoute(CreateTlsRouteRequest) + returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v1/{parent=projects/*/locations/*}/tlsRoutes" + body: "tls_route" + }; + option (google.api.method_signature) = "parent,tls_route,tls_route_id"; + option (google.longrunning.operation_info) = { + response_type: "TlsRoute" + metadata_type: "google.cloud.networkservices.v1.OperationMetadata" + }; + } + + // Updates the parameters of a single TlsRoute. + rpc UpdateTlsRoute(UpdateTlsRouteRequest) + returns (google.longrunning.Operation) { + option (google.api.http) = { + patch: "/v1/{tls_route.name=projects/*/locations/*/tlsRoutes/*}" + body: "tls_route" + }; + option (google.api.method_signature) = "tls_route,update_mask"; + option (google.longrunning.operation_info) = { + response_type: "TlsRoute" + metadata_type: "google.cloud.networkservices.v1.OperationMetadata" + }; + } + + // Deletes a single TlsRoute. + rpc DeleteTlsRoute(DeleteTlsRouteRequest) + returns (google.longrunning.Operation) { + option (google.api.http) = { + delete: "/v1/{name=projects/*/locations/*/tlsRoutes/*}" + }; + option (google.api.method_signature) = "name"; + option (google.longrunning.operation_info) = { + response_type: "google.protobuf.Empty" + metadata_type: "google.cloud.networkservices.v1.OperationMetadata" + }; + } + + // Lists ServiceBinding in a given project and location. + rpc ListServiceBindings(ListServiceBindingsRequest) + returns (ListServiceBindingsResponse) { + option (google.api.http) = { + get: "/v1/{parent=projects/*/locations/*}/serviceBindings" + }; + option (google.api.method_signature) = "parent"; + } + + // Gets details of a single ServiceBinding. + rpc GetServiceBinding(GetServiceBindingRequest) returns (ServiceBinding) { + option (google.api.http) = { + get: "/v1/{name=projects/*/locations/*/serviceBindings/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Creates a new ServiceBinding in a given project and location. + rpc CreateServiceBinding(CreateServiceBindingRequest) + returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v1/{parent=projects/*/locations/*}/serviceBindings" + body: "service_binding" + }; + option (google.api.method_signature) = + "parent,service_binding,service_binding_id"; + option (google.longrunning.operation_info) = { + response_type: "ServiceBinding" + metadata_type: "google.cloud.networkservices.v1.OperationMetadata" + }; + } + + // Deletes a single ServiceBinding. + rpc DeleteServiceBinding(DeleteServiceBindingRequest) + returns (google.longrunning.Operation) { + option (google.api.http) = { + delete: "/v1/{name=projects/*/locations/*/serviceBindings/*}" + }; + option (google.api.method_signature) = "name"; + option (google.longrunning.operation_info) = { + response_type: "google.protobuf.Empty" + metadata_type: "google.cloud.networkservices.v1.OperationMetadata" + }; + } + + // Lists Meshes in a given project and location. + rpc ListMeshes(ListMeshesRequest) returns (ListMeshesResponse) { + option (google.api.http) = { + get: "/v1/{parent=projects/*/locations/*}/meshes" + }; + option (google.api.method_signature) = "parent"; + } + + // Gets details of a single Mesh. + rpc GetMesh(GetMeshRequest) returns (Mesh) { + option (google.api.http) = { + get: "/v1/{name=projects/*/locations/*/meshes/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Creates a new Mesh in a given project and location. + rpc CreateMesh(CreateMeshRequest) returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v1/{parent=projects/*/locations/*}/meshes" + body: "mesh" + }; + option (google.api.method_signature) = "parent,mesh,mesh_id"; + option (google.longrunning.operation_info) = { + response_type: "Mesh" + metadata_type: "google.cloud.networkservices.v1.OperationMetadata" + }; + } + + // Updates the parameters of a single Mesh. + rpc UpdateMesh(UpdateMeshRequest) returns (google.longrunning.Operation) { + option (google.api.http) = { + patch: "/v1/{mesh.name=projects/*/locations/*/meshes/*}" + body: "mesh" + }; + option (google.api.method_signature) = "mesh,update_mask"; + option (google.longrunning.operation_info) = { + response_type: "Mesh" + metadata_type: "google.cloud.networkservices.v1.OperationMetadata" + }; + } + + // Deletes a single Mesh. + rpc DeleteMesh(DeleteMeshRequest) returns (google.longrunning.Operation) { + option (google.api.http) = { + delete: "/v1/{name=projects/*/locations/*/meshes/*}" + }; + option (google.api.method_signature) = "name"; + option (google.longrunning.operation_info) = { + response_type: "google.protobuf.Empty" + metadata_type: "google.cloud.networkservices.v1.OperationMetadata" + }; + } +} diff --git a/packages/google-cloud-networkservices/protos/google/cloud/networkservices/v1/service_binding.proto b/packages/google-cloud-networkservices/protos/google/cloud/networkservices/v1/service_binding.proto new file mode 100644 index 00000000000..ebec29df022 --- /dev/null +++ b/packages/google-cloud-networkservices/protos/google/cloud/networkservices/v1/service_binding.proto @@ -0,0 +1,134 @@ +// Copyright 2023 Google LLC +// +// Licensed under the Apache License, Version 2.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.networkservices.v1; + +import "google/api/field_behavior.proto"; +import "google/api/resource.proto"; +import "google/protobuf/timestamp.proto"; + +option csharp_namespace = "Google.Cloud.NetworkServices.V1"; +option go_package = "cloud.google.com/go/networkservices/apiv1/networkservicespb;networkservicespb"; +option java_multiple_files = true; +option java_outer_classname = "ServiceBindingProto"; +option java_package = "com.google.cloud.networkservices.v1"; +option php_namespace = "Google\\Cloud\\NetworkServices\\V1"; +option ruby_package = "Google::Cloud::NetworkServices::V1"; + +// ServiceBinding is the resource that defines a Service Directory Service to +// be used in a BackendService resource. +message ServiceBinding { + option (google.api.resource) = { + type: "networkservices.googleapis.com/ServiceBinding" + pattern: "projects/{project}/locations/{location}/serviceBindings/{service_binding}" + }; + + // Required. Name of the ServiceBinding resource. It matches pattern + // `projects/*/locations/global/serviceBindings/service_binding_name`. + string name = 1 [(google.api.field_behavior) = REQUIRED]; + + // Optional. A free-text description of the resource. Max length 1024 + // characters. + string description = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Output only. The timestamp when the resource was created. + google.protobuf.Timestamp create_time = 3 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The timestamp when the resource was updated. + google.protobuf.Timestamp update_time = 4 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Required. The full service directory service name of the format + // /projects/*/locations/*/namespaces/*/services/* + string service = 5 [(google.api.field_behavior) = REQUIRED]; + + // Optional. Set of label tags associated with the ServiceBinding resource. + map labels = 7 [(google.api.field_behavior) = OPTIONAL]; +} + +// Request used with the ListServiceBindings method. +message ListServiceBindingsRequest { + // Required. The project and location from which the ServiceBindings should be + // listed, specified in the format `projects/*/locations/global`. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "networkservices.googleapis.com/ServiceBinding" + } + ]; + + // Maximum number of ServiceBindings to return per call. + int32 page_size = 2; + + // The value returned by the last `ListServiceBindingsResponse` + // Indicates that this is a continuation of a prior `ListRouters` call, + // and that the system should return the next page of data. + string page_token = 3; +} + +// Response returned by the ListServiceBindings method. +message ListServiceBindingsResponse { + // List of ServiceBinding resources. + repeated ServiceBinding service_bindings = 1; + + // If there might be more results than those appearing in this response, then + // `next_page_token` is included. To get the next set of results, call this + // method again using the value of `next_page_token` as `page_token`. + string next_page_token = 2; +} + +// Request used by the GetServiceBinding method. +message GetServiceBindingRequest { + // Required. A name of the ServiceBinding to get. Must be in the format + // `projects/*/locations/global/serviceBindings/*`. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "networkservices.googleapis.com/ServiceBinding" + } + ]; +} + +// Request used by the ServiceBinding method. +message CreateServiceBindingRequest { + // Required. The parent resource of the ServiceBinding. Must be in the + // format `projects/*/locations/global`. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "networkservices.googleapis.com/ServiceBinding" + } + ]; + + // Required. Short name of the ServiceBinding resource to be created. + string service_binding_id = 2 [(google.api.field_behavior) = REQUIRED]; + + // Required. ServiceBinding resource to be created. + ServiceBinding service_binding = 3 [(google.api.field_behavior) = REQUIRED]; +} + +// Request used by the DeleteServiceBinding method. +message DeleteServiceBindingRequest { + // Required. A name of the ServiceBinding to delete. Must be in the format + // `projects/*/locations/global/serviceBindings/*`. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "networkservices.googleapis.com/ServiceBinding" + } + ]; +} diff --git a/packages/google-cloud-networkservices/protos/google/cloud/networkservices/v1/tcp_route.proto b/packages/google-cloud-networkservices/protos/google/cloud/networkservices/v1/tcp_route.proto new file mode 100644 index 00000000000..0060a289965 --- /dev/null +++ b/packages/google-cloud-networkservices/protos/google/cloud/networkservices/v1/tcp_route.proto @@ -0,0 +1,257 @@ +// Copyright 2023 Google LLC +// +// Licensed under the Apache License, Version 2.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.networkservices.v1; + +import "google/api/field_behavior.proto"; +import "google/api/resource.proto"; +import "google/protobuf/field_mask.proto"; +import "google/protobuf/timestamp.proto"; + +option csharp_namespace = "Google.Cloud.NetworkServices.V1"; +option go_package = "cloud.google.com/go/networkservices/apiv1/networkservicespb;networkservicespb"; +option java_multiple_files = true; +option java_outer_classname = "TcpRouteProto"; +option java_package = "com.google.cloud.networkservices.v1"; +option php_namespace = "Google\\Cloud\\NetworkServices\\V1"; +option ruby_package = "Google::Cloud::NetworkServices::V1"; +option (google.api.resource_definition) = { + type: "compute.googleapis.com/BackendService" + pattern: "projects/{project}/locations/{location}/backendServices/{backend_service}" +}; + +// TcpRoute is the resource defining how TCP traffic should be routed by a +// Mesh/Gateway resource. +message TcpRoute { + option (google.api.resource) = { + type: "networkservices.googleapis.com/TcpRoute" + pattern: "projects/{project}/locations/{location}/tcpRoutes/{tcp_route}" + }; + + // Specifies how to match traffic and how to route traffic when traffic is + // matched. + message RouteRule { + // Optional. RouteMatch defines the predicate used to match requests to a + // given action. Multiple match types are "OR"ed for evaluation. If no + // routeMatch field is specified, this rule will unconditionally match + // traffic. + repeated RouteMatch matches = 1 [(google.api.field_behavior) = OPTIONAL]; + + // Required. The detailed rule defining how to route matched traffic. + RouteAction action = 2 [(google.api.field_behavior) = REQUIRED]; + } + + // RouteMatch defines the predicate used to match requests to a given action. + // Multiple match types are "OR"ed for evaluation. + // If no routeMatch field is specified, this rule will unconditionally match + // traffic. + message RouteMatch { + // Required. Must be specified in the CIDR range format. A CIDR range + // consists of an IP Address and a prefix length to construct the subnet + // mask. By default, the prefix length is 32 (i.e. matches a single IP + // address). Only IPV4 addresses are supported. + // Examples: + // "10.0.0.1" - matches against this exact IP address. + // "10.0.0.0/8" - matches against any IP address within the 10.0.0.0 subnet + // and 255.255.255.0 mask. + // "0.0.0.0/0" - matches against any IP address'. + string address = 1 [(google.api.field_behavior) = REQUIRED]; + + // Required. Specifies the destination port to match against. + string port = 2 [(google.api.field_behavior) = REQUIRED]; + } + + // The specifications for routing traffic and applying associated policies. + message RouteAction { + // Optional. The destination services to which traffic should be forwarded. + // At least one destination service is required. Only one of route + // destination or original destination can be set. + repeated RouteDestination destinations = 1 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. If true, Router will use the destination IP and port of the + // original connection as the destination of the request. Default is false. + // Only one of route destinations or original destination can be set. + bool original_destination = 3 [(google.api.field_behavior) = OPTIONAL]; + } + + // Describe the destination for traffic to be routed to. + message RouteDestination { + // Required. The URL of a BackendService to route traffic to. + string service_name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "compute.googleapis.com/BackendService" + } + ]; + + // Optional. Specifies the proportion of requests forwarded to the backend + // referenced by the serviceName field. This is computed as: + // - weight/Sum(weights in this destination list). + // For non-zero values, there may be some epsilon from the exact proportion + // defined here depending on the precision an implementation supports. + // + // If only one serviceName is specified and it has a weight greater than 0, + // 100% of the traffic is forwarded to that backend. + // + // If weights are specified for any one service name, they need to be + // specified for all of them. + // + // If weights are unspecified for all services, then, traffic is distributed + // in equal proportions to all of them. + int32 weight = 2 [(google.api.field_behavior) = OPTIONAL]; + } + + // Required. Name of the TcpRoute resource. It matches pattern + // `projects/*/locations/global/tcpRoutes/tcp_route_name>`. + string name = 1 [(google.api.field_behavior) = REQUIRED]; + + // Output only. Server-defined URL of this resource + string self_link = 11 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The timestamp when the resource was created. + google.protobuf.Timestamp create_time = 2 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The timestamp when the resource was updated. + google.protobuf.Timestamp update_time = 3 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Optional. A free-text description of the resource. Max length 1024 + // characters. + string description = 4 [(google.api.field_behavior) = OPTIONAL]; + + // Required. Rules that define how traffic is routed and handled. At least one + // RouteRule must be supplied. If there are multiple rules then the action + // taken will be the first rule to match. + repeated RouteRule rules = 5 [(google.api.field_behavior) = REQUIRED]; + + // Optional. Meshes defines a list of meshes this TcpRoute is attached to, as + // one of the routing rules to route the requests served by the mesh. + // + // Each mesh reference should match the pattern: + // `projects/*/locations/global/meshes/` + // + // The attached Mesh should be of a type SIDECAR + repeated string meshes = 8 [ + (google.api.field_behavior) = OPTIONAL, + (google.api.resource_reference) = { + type: "networkservices.googleapis.com/Mesh" + } + ]; + + // Optional. Gateways defines a list of gateways this TcpRoute is attached to, + // as one of the routing rules to route the requests served by the gateway. + // + // Each gateway reference should match the pattern: + // `projects/*/locations/global/gateways/` + repeated string gateways = 9 [ + (google.api.field_behavior) = OPTIONAL, + (google.api.resource_reference) = { + type: "networkservices.googleapis.com/Gateway" + } + ]; + + // Optional. Set of label tags associated with the TcpRoute resource. + map labels = 10 [(google.api.field_behavior) = OPTIONAL]; +} + +// Request used with the ListTcpRoutes method. +message ListTcpRoutesRequest { + // Required. The project and location from which the TcpRoutes should be + // listed, specified in the format `projects/*/locations/global`. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "networkservices.googleapis.com/TcpRoute" + } + ]; + + // Maximum number of TcpRoutes to return per call. + int32 page_size = 2; + + // The value returned by the last `ListTcpRoutesResponse` + // Indicates that this is a continuation of a prior `ListTcpRoutes` call, + // and that the system should return the next page of data. + string page_token = 3; +} + +// Response returned by the ListTcpRoutes method. +message ListTcpRoutesResponse { + // List of TcpRoute resources. + repeated TcpRoute tcp_routes = 1; + + // If there might be more results than those appearing in this response, then + // `next_page_token` is included. To get the next set of results, call this + // method again using the value of `next_page_token` as `page_token`. + string next_page_token = 2; +} + +// Request used by the GetTcpRoute method. +message GetTcpRouteRequest { + // Required. A name of the TcpRoute to get. Must be in the format + // `projects/*/locations/global/tcpRoutes/*`. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "networkservices.googleapis.com/TcpRoute" + } + ]; +} + +// Request used by the TcpRoute method. +message CreateTcpRouteRequest { + // Required. The parent resource of the TcpRoute. Must be in the + // format `projects/*/locations/global`. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "networkservices.googleapis.com/TcpRoute" + } + ]; + + // Required. Short name of the TcpRoute resource to be created. + string tcp_route_id = 2 [(google.api.field_behavior) = REQUIRED]; + + // Required. TcpRoute resource to be created. + TcpRoute tcp_route = 3 [(google.api.field_behavior) = REQUIRED]; +} + +// Request used by the UpdateTcpRoute method. +message UpdateTcpRouteRequest { + // Optional. Field mask is used to specify the fields to be overwritten in the + // TcpRoute resource by the update. + // The fields specified in the update_mask are relative to the resource, not + // the full request. A field will be overwritten if it is in the mask. If the + // user does not provide a mask then all fields will be overwritten. + google.protobuf.FieldMask update_mask = 1 + [(google.api.field_behavior) = OPTIONAL]; + + // Required. Updated TcpRoute resource. + TcpRoute tcp_route = 2 [(google.api.field_behavior) = REQUIRED]; +} + +// Request used by the DeleteTcpRoute method. +message DeleteTcpRouteRequest { + // Required. A name of the TcpRoute to delete. Must be in the format + // `projects/*/locations/global/tcpRoutes/*`. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "networkservices.googleapis.com/TcpRoute" + } + ]; +} diff --git a/packages/google-cloud-networkservices/protos/google/cloud/networkservices/v1/tls_route.proto b/packages/google-cloud-networkservices/protos/google/cloud/networkservices/v1/tls_route.proto new file mode 100644 index 00000000000..7117192b529 --- /dev/null +++ b/packages/google-cloud-networkservices/protos/google/cloud/networkservices/v1/tls_route.proto @@ -0,0 +1,234 @@ +// Copyright 2023 Google LLC +// +// Licensed under the Apache License, Version 2.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.networkservices.v1; + +import "google/api/field_behavior.proto"; +import "google/api/resource.proto"; +import "google/protobuf/field_mask.proto"; +import "google/protobuf/timestamp.proto"; + +option csharp_namespace = "Google.Cloud.NetworkServices.V1"; +option go_package = "cloud.google.com/go/networkservices/apiv1/networkservicespb;networkservicespb"; +option java_multiple_files = true; +option java_outer_classname = "TlsRouteProto"; +option java_package = "com.google.cloud.networkservices.v1"; +option php_namespace = "Google\\Cloud\\NetworkServices\\V1"; +option ruby_package = "Google::Cloud::NetworkServices::V1"; + +// TlsRoute defines how traffic should be routed based on SNI and other matching +// L3 attributes. +message TlsRoute { + option (google.api.resource) = { + type: "networkservices.googleapis.com/TlsRoute" + pattern: "projects/{project}/locations/{location}/tlsRoutes/{tls_route}" + }; + + // Specifies how to match traffic and how to route traffic when traffic is + // matched. + message RouteRule { + // Required. RouteMatch defines the predicate used to match requests to a + // given action. Multiple match types are "OR"ed for evaluation. + repeated RouteMatch matches = 1 [(google.api.field_behavior) = REQUIRED]; + + // Required. The detailed rule defining how to route matched traffic. + RouteAction action = 2 [(google.api.field_behavior) = REQUIRED]; + } + + // RouteMatch defines the predicate used to match requests to a given action. + // Multiple match types are "AND"ed for evaluation. + // If no routeMatch field is specified, this rule will unconditionally match + // traffic. + message RouteMatch { + // Optional. SNI (server name indicator) to match against. + // SNI will be matched against all wildcard domains, i.e. `www.example.com` + // will be first matched against `www.example.com`, then `*.example.com`, + // then `*.com.` + // Partial wildcards are not supported, and values like *w.example.com are + // invalid. + // At least one of sni_host and alpn is required. + // Up to 5 sni hosts across all matches can be set. + repeated string sni_host = 1 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. ALPN (Application-Layer Protocol Negotiation) to match against. + // Examples: "http/1.1", "h2". + // At least one of sni_host and alpn is required. + // Up to 5 alpns across all matches can be set. + repeated string alpn = 2 [(google.api.field_behavior) = OPTIONAL]; + } + + // The specifications for routing traffic and applying associated policies. + message RouteAction { + // Required. The destination services to which traffic should be forwarded. + // At least one destination service is required. + repeated RouteDestination destinations = 1 + [(google.api.field_behavior) = REQUIRED]; + } + + // Describe the destination for traffic to be routed to. + message RouteDestination { + // Required. The URL of a BackendService to route traffic to. + string service_name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "compute.googleapis.com/BackendService" + } + ]; + + // Optional. Specifies the proportion of requests forwareded to the backend + // referenced by the service_name field. This is computed as: + // - weight/Sum(weights in destinations) + // Weights in all destinations does not need to sum up to 100. + int32 weight = 2 [(google.api.field_behavior) = OPTIONAL]; + } + + // Required. Name of the TlsRoute resource. It matches pattern + // `projects/*/locations/global/tlsRoutes/tls_route_name>`. + string name = 1 [(google.api.field_behavior) = REQUIRED]; + + // Output only. Server-defined URL of this resource + string self_link = 8 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The timestamp when the resource was created. + google.protobuf.Timestamp create_time = 2 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The timestamp when the resource was updated. + google.protobuf.Timestamp update_time = 3 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Optional. A free-text description of the resource. Max length 1024 + // characters. + string description = 4 [(google.api.field_behavior) = OPTIONAL]; + + // Required. Rules that define how traffic is routed and handled. At least one + // RouteRule must be supplied. If there are multiple rules then the action + // taken will be the first rule to match. + repeated RouteRule rules = 5 [(google.api.field_behavior) = REQUIRED]; + + // Optional. Meshes defines a list of meshes this TlsRoute is attached to, as + // one of the routing rules to route the requests served by the mesh. + // + // Each mesh reference should match the pattern: + // `projects/*/locations/global/meshes/` + // + // The attached Mesh should be of a type SIDECAR + repeated string meshes = 6 [ + (google.api.field_behavior) = OPTIONAL, + (google.api.resource_reference) = { + type: "networkservices.googleapis.com/Mesh" + } + ]; + + // Optional. Gateways defines a list of gateways this TlsRoute is attached to, + // as one of the routing rules to route the requests served by the gateway. + // + // Each gateway reference should match the pattern: + // `projects/*/locations/global/gateways/` + repeated string gateways = 7 [ + (google.api.field_behavior) = OPTIONAL, + (google.api.resource_reference) = { + type: "networkservices.googleapis.com/Gateway" + } + ]; +} + +// Request used with the ListTlsRoutes method. +message ListTlsRoutesRequest { + // Required. The project and location from which the TlsRoutes should be + // listed, specified in the format `projects/*/locations/global`. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "networkservices.googleapis.com/TlsRoute" + } + ]; + + // Maximum number of TlsRoutes to return per call. + int32 page_size = 2; + + // The value returned by the last `ListTlsRoutesResponse` + // Indicates that this is a continuation of a prior `ListTlsRoutes` call, + // and that the system should return the next page of data. + string page_token = 3; +} + +// Response returned by the ListTlsRoutes method. +message ListTlsRoutesResponse { + // List of TlsRoute resources. + repeated TlsRoute tls_routes = 1; + + // If there might be more results than those appearing in this response, then + // `next_page_token` is included. To get the next set of results, call this + // method again using the value of `next_page_token` as `page_token`. + string next_page_token = 2; +} + +// Request used by the GetTlsRoute method. +message GetTlsRouteRequest { + // Required. A name of the TlsRoute to get. Must be in the format + // `projects/*/locations/global/tlsRoutes/*`. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "networkservices.googleapis.com/TlsRoute" + } + ]; +} + +// Request used by the TlsRoute method. +message CreateTlsRouteRequest { + // Required. The parent resource of the TlsRoute. Must be in the + // format `projects/*/locations/global`. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "networkservices.googleapis.com/TlsRoute" + } + ]; + + // Required. Short name of the TlsRoute resource to be created. + string tls_route_id = 2 [(google.api.field_behavior) = REQUIRED]; + + // Required. TlsRoute resource to be created. + TlsRoute tls_route = 3 [(google.api.field_behavior) = REQUIRED]; +} + +// Request used by the UpdateTlsRoute method. +message UpdateTlsRouteRequest { + // Optional. Field mask is used to specify the fields to be overwritten in the + // TlsRoute resource by the update. + // The fields specified in the update_mask are relative to the resource, not + // the full request. A field will be overwritten if it is in the mask. If the + // user does not provide a mask then all fields will be overwritten. + google.protobuf.FieldMask update_mask = 1 + [(google.api.field_behavior) = OPTIONAL]; + + // Required. Updated TlsRoute resource. + TlsRoute tls_route = 2 [(google.api.field_behavior) = REQUIRED]; +} + +// Request used by the DeleteTlsRoute method. +message DeleteTlsRouteRequest { + // Required. A name of the TlsRoute to delete. Must be in the format + // `projects/*/locations/global/tlsRoutes/*`. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "networkservices.googleapis.com/TlsRoute" + } + ]; +} diff --git a/packages/google-cloud-networkservices/protos/google/cloud/networkservices/v1beta1/common.proto b/packages/google-cloud-networkservices/protos/google/cloud/networkservices/v1beta1/common.proto new file mode 100644 index 00000000000..c60e129af47 --- /dev/null +++ b/packages/google-cloud-networkservices/protos/google/cloud/networkservices/v1beta1/common.proto @@ -0,0 +1,136 @@ +// 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 +// +// 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.networkservices.v1beta1; + +import "google/api/field_behavior.proto"; +import "google/protobuf/timestamp.proto"; + +option csharp_namespace = "Google.Cloud.NetworkServices.V1Beta1"; +option go_package = "cloud.google.com/go/networkservices/apiv1beta1/networkservicespb;networkservicespb"; +option java_multiple_files = true; +option java_outer_classname = "CommonProto"; +option java_package = "com.google.cloud.networkservices.v1beta1"; +option php_namespace = "Google\\Cloud\\NetworkServices\\V1beta1"; +option ruby_package = "Google::Cloud::NetworkServices::V1beta1"; + +// Represents the metadata of the long-running operation. +message OperationMetadata { + // Output only. The time the operation was created. + google.protobuf.Timestamp create_time = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The time the operation finished running. + google.protobuf.Timestamp end_time = 2 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Server-defined resource path for the target of the operation. + string target = 3 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Name of the verb executed by the operation. + string verb = 4 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Human-readable status of the operation, if any. + string status_message = 5 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Identifies whether the user has requested cancellation + // of the operation. Operations that have successfully been cancelled + // have [Operation.error][] value with a [google.rpc.Status.code][google.rpc.Status.code] of 1, + // corresponding to `Code.CANCELLED`. + bool requested_cancellation = 6 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. API version used to start the operation. + string api_version = 7 [(google.api.field_behavior) = OUTPUT_ONLY]; +} + +// Specification of a port-based selector. +message TrafficPortSelector { + // Optional. A list of ports. Can be port numbers or port range + // (example, [80-90] specifies all ports from 80 to 90, including + // 80 and 90) or named ports or * to specify all ports. If the + // list is empty, all ports are selected. + repeated string ports = 1 [(google.api.field_behavior) = OPTIONAL]; +} + +// A definition of a matcher that selects endpoints to which the policies +// should be applied. +message EndpointMatcher { + // The matcher that is based on node metadata presented by xDS clients. + message MetadataLabelMatcher { + // Defines a name-pair value for a single label. + message MetadataLabels { + // Required. Label name presented as key in xDS Node Metadata. + string label_name = 1 [(google.api.field_behavior) = REQUIRED]; + + // Required. Label value presented as value corresponding to the above + // key, in xDS Node Metadata. + string label_value = 2 [(google.api.field_behavior) = REQUIRED]; + } + + // Possible criteria values that define logic of how matching is made. + enum MetadataLabelMatchCriteria { + // Default value. Should not be used. + METADATA_LABEL_MATCH_CRITERIA_UNSPECIFIED = 0; + + // At least one of the Labels specified in the matcher should match the + // metadata presented by xDS client. + MATCH_ANY = 1; + + // The metadata presented by the xDS client should contain all of the + // labels specified here. + MATCH_ALL = 2; + } + + // Specifies how matching should be done. + // + // Supported values are: + // MATCH_ANY: At least one of the Labels specified in the + // matcher should match the metadata presented by xDS client. + // MATCH_ALL: The metadata presented by the xDS client should + // contain all of the labels specified here. + // + // The selection is determined based on the best match. For + // example, suppose there are three EndpointPolicy + // resources P1, P2 and P3 and if P1 has a the matcher as + // MATCH_ANY , P2 has MATCH_ALL , and P3 has + // MATCH_ALL . + // + // If a client with label connects, the config from P1 + // will be selected. + // + // If a client with label connects, the config from P2 + // will be selected. + // + // If a client with label connects, the config + // from P3 will be selected. + // + // If there is more than one best match, (for example, if a + // config P4 with selector exists and if a client with + // label connects), an error will be thrown. + MetadataLabelMatchCriteria metadata_label_match_criteria = 1; + + // The list of label value pairs that must match labels in the + // provided metadata based on filterMatchCriteria This list can + // have at most 64 entries. The list can be empty if the match + // criteria is MATCH_ANY, to specify a wildcard match (i.e this + // matches any client). + repeated MetadataLabels metadata_labels = 2; + } + + // Specifies type of the matcher used for this endpoint matcher. + oneof matcher_type { + // The matcher is based on node metadata presented by xDS clients. + MetadataLabelMatcher metadata_label_matcher = 1; + } +} diff --git a/packages/google-cloud-networkservices/protos/google/cloud/networkservices/v1beta1/endpoint_policy.proto b/packages/google-cloud-networkservices/protos/google/cloud/networkservices/v1beta1/endpoint_policy.proto new file mode 100644 index 00000000000..be5ca01a953 --- /dev/null +++ b/packages/google-cloud-networkservices/protos/google/cloud/networkservices/v1beta1/endpoint_policy.proto @@ -0,0 +1,220 @@ +// 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 +// +// 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.networkservices.v1beta1; + +import "google/api/field_behavior.proto"; +import "google/api/resource.proto"; +import "google/cloud/networkservices/v1beta1/common.proto"; +import "google/protobuf/field_mask.proto"; +import "google/protobuf/timestamp.proto"; + +option csharp_namespace = "Google.Cloud.NetworkServices.V1Beta1"; +option go_package = "cloud.google.com/go/networkservices/apiv1beta1/networkservicespb;networkservicespb"; +option java_multiple_files = true; +option java_outer_classname = "EndpointPolicyProto"; +option java_package = "com.google.cloud.networkservices.v1beta1"; +option php_namespace = "Google\\Cloud\\NetworkServices\\V1beta1"; +option ruby_package = "Google::Cloud::NetworkServices::V1beta1"; +option (google.api.resource_definition) = { + type: "networksecurity.googleapis.com/AuthorizationPolicy" + pattern: "projects/{project}/locations/{location}/authorizationPolicies/{authorization_policy}" +}; +option (google.api.resource_definition) = { + type: "networksecurity.googleapis.com/ServerTlsPolicy" + pattern: "projects/{project}/locations/{location}/serverTlsPolicies/{server_tls_policy}" +}; +option (google.api.resource_definition) = { + type: "networksecurity.googleapis.com/ClientTlsPolicy" + pattern: "projects/{project}/locations/{location}/clientTlsPolicies/{client_tls_policy}" +}; + +// EndpointPolicy is a resource that helps apply desired configuration +// on the endpoints that match specific criteria. +// For example, this resource can be used to apply "authentication config" +// an all endpoints that serve on port 8080. +message EndpointPolicy { + option (google.api.resource) = { + type: "networkservices.googleapis.com/EndpointPolicy" + pattern: "projects/{project}/locations/{location}/endpointPolicies/{endpoint_policy}" + }; + + // The type of endpoint policy. + enum EndpointPolicyType { + // Default value. Must not be used. + ENDPOINT_POLICY_TYPE_UNSPECIFIED = 0; + + // Represents a proxy deployed as a sidecar. + SIDECAR_PROXY = 1; + + // Represents a proxyless gRPC backend. + GRPC_SERVER = 2; + } + + // Required. Name of the EndpointPolicy resource. It matches pattern + // `projects/{project}/locations/global/endpointPolicies/{endpoint_policy}`. + string name = 1 [(google.api.field_behavior) = REQUIRED]; + + // Output only. The timestamp when the resource was created. + google.protobuf.Timestamp create_time = 2 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The timestamp when the resource was updated. + google.protobuf.Timestamp update_time = 3 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Optional. Set of label tags associated with the EndpointPolicy resource. + map labels = 4 [(google.api.field_behavior) = OPTIONAL]; + + // Required. The type of endpoint policy. This is primarily used to validate + // the configuration. + EndpointPolicyType type = 5 [(google.api.field_behavior) = REQUIRED]; + + // Optional. This field specifies the URL of AuthorizationPolicy resource that + // applies authorization policies to the inbound traffic at the + // matched endpoints. Refer to Authorization. If this field is not + // specified, authorization is disabled(no authz checks) for this + // endpoint. Applicable only when EndpointPolicyType is + // SIDECAR_PROXY. + string authorization_policy = 7 [ + (google.api.field_behavior) = OPTIONAL, + (google.api.resource_reference) = { + type: "networksecurity.googleapis.com/AuthorizationPolicy" + } + ]; + + // Required. A matcher that selects endpoints to which the policies should be applied. + EndpointMatcher endpoint_matcher = 9 [(google.api.field_behavior) = REQUIRED]; + + // Optional. Port selector for the (matched) endpoints. If no port selector is + // provided, the matched config is applied to all ports. + TrafficPortSelector traffic_port_selector = 10 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. A free-text description of the resource. Max length 1024 characters. + string description = 11 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. A URL referring to ServerTlsPolicy resource. ServerTlsPolicy is used to + // determine the authentication policy to be applied to terminate the inbound + // traffic at the identified backends. If this field is not set, + // authentication is disabled(open) for this endpoint. + string server_tls_policy = 12 [ + (google.api.field_behavior) = OPTIONAL, + (google.api.resource_reference) = { + type: "networksecurity.googleapis.com/ServerTlsPolicy" + } + ]; + + // Optional. A URL referring to a ClientTlsPolicy resource. ClientTlsPolicy can be set + // to specify the authentication for traffic from the proxy to the actual + // endpoints. More specifically, it is applied to the outgoing traffic from + // the proxy to the endpoint. This is typically used for sidecar model where + // the proxy identifies itself as endpoint to the control plane, with the + // connection between sidecar and endpoint requiring authentication. If this + // field is not set, authentication is disabled(open). Applicable only when + // EndpointPolicyType is SIDECAR_PROXY. + string client_tls_policy = 13 [ + (google.api.field_behavior) = OPTIONAL, + (google.api.resource_reference) = { + type: "networksecurity.googleapis.com/ClientTlsPolicy" + } + ]; +} + +// Request used with the ListEndpointPolicies method. +message ListEndpointPoliciesRequest { + // Required. The project and location from which the EndpointPolicies should be + // listed, specified in the format `projects/*/locations/global`. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "networkservices.googleapis.com/EndpointPolicy" + } + ]; + + // Maximum number of EndpointPolicies to return per call. + int32 page_size = 2; + + // The value returned by the last `ListEndpointPoliciesResponse` + // Indicates that this is a continuation of a prior + // `ListEndpointPolicies` call, and that the system should return the + // next page of data. + string page_token = 3; +} + +// Response returned by the ListEndpointPolicies method. +message ListEndpointPoliciesResponse { + // List of EndpointPolicy resources. + repeated EndpointPolicy endpoint_policies = 1; + + // If there might be more results than those appearing in this response, then + // `next_page_token` is included. To get the next set of results, call this + // method again using the value of `next_page_token` as `page_token`. + string next_page_token = 2; +} + +// Request used with the GetEndpointPolicy method. +message GetEndpointPolicyRequest { + // Required. A name of the EndpointPolicy to get. Must be in the format + // `projects/*/locations/global/endpointPolicies/*`. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "networkservices.googleapis.com/EndpointPolicy" + } + ]; +} + +// Request used with the CreateEndpointPolicy method. +message CreateEndpointPolicyRequest { + // Required. The parent resource of the EndpointPolicy. Must be in the + // format `projects/*/locations/global`. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "networkservices.googleapis.com/EndpointPolicy" + } + ]; + + // Required. Short name of the EndpointPolicy resource to be created. + // E.g. "CustomECS". + string endpoint_policy_id = 2 [(google.api.field_behavior) = REQUIRED]; + + // Required. EndpointPolicy resource to be created. + EndpointPolicy endpoint_policy = 3 [(google.api.field_behavior) = REQUIRED]; +} + +// Request used with the UpdateEndpointPolicy method. +message UpdateEndpointPolicyRequest { + // Optional. Field mask is used to specify the fields to be overwritten in the + // EndpointPolicy resource by the update. + // The fields specified in the update_mask are relative to the resource, not + // the full request. A field will be overwritten if it is in the mask. If the + // user does not provide a mask then all fields will be overwritten. + google.protobuf.FieldMask update_mask = 1 [(google.api.field_behavior) = OPTIONAL]; + + // Required. Updated EndpointPolicy resource. + EndpointPolicy endpoint_policy = 2 [(google.api.field_behavior) = REQUIRED]; +} + +// Request used with the DeleteEndpointPolicy method. +message DeleteEndpointPolicyRequest { + // Required. A name of the EndpointPolicy to delete. Must be in the format + // `projects/*/locations/global/endpointPolicies/*`. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "networkservices.googleapis.com/EndpointPolicy" + } + ]; +} diff --git a/packages/google-cloud-networkservices/protos/google/cloud/networkservices/v1beta1/network_services.proto b/packages/google-cloud-networkservices/protos/google/cloud/networkservices/v1beta1/network_services.proto new file mode 100644 index 00000000000..e9f4c001082 --- /dev/null +++ b/packages/google-cloud-networkservices/protos/google/cloud/networkservices/v1beta1/network_services.proto @@ -0,0 +1,88 @@ +// 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 +// +// 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.networkservices.v1beta1; + +import "google/api/annotations.proto"; +import "google/api/client.proto"; +import "google/cloud/networkservices/v1beta1/endpoint_policy.proto"; +import "google/longrunning/operations.proto"; + +option csharp_namespace = "Google.Cloud.NetworkServices.V1Beta1"; +option go_package = "cloud.google.com/go/networkservices/apiv1beta1/networkservicespb;networkservicespb"; +option java_multiple_files = true; +option java_package = "com.google.cloud.networkservices.v1beta1"; +option php_namespace = "Google\\Cloud\\NetworkServices\\V1beta1"; +option ruby_package = "Google::Cloud::NetworkServices::V1beta1"; + +service NetworkServices { + option (google.api.default_host) = "networkservices.googleapis.com"; + option (google.api.oauth_scopes) = "https://www.googleapis.com/auth/cloud-platform"; + + // Lists EndpointPolicies in a given project and location. + rpc ListEndpointPolicies(ListEndpointPoliciesRequest) returns (ListEndpointPoliciesResponse) { + option (google.api.http) = { + get: "/v1beta1/{parent=projects/*/locations/*}/endpointPolicies" + }; + option (google.api.method_signature) = "parent"; + } + + // Gets details of a single EndpointPolicy. + rpc GetEndpointPolicy(GetEndpointPolicyRequest) returns (EndpointPolicy) { + option (google.api.http) = { + get: "/v1beta1/{name=projects/*/locations/*/endpointPolicies/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Creates a new EndpointPolicy in a given project and location. + rpc CreateEndpointPolicy(CreateEndpointPolicyRequest) returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v1beta1/{parent=projects/*/locations/*}/endpointPolicies" + body: "endpoint_policy" + }; + option (google.api.method_signature) = "parent,endpoint_policy,endpoint_policy_id"; + option (google.longrunning.operation_info) = { + response_type: "EndpointPolicy" + metadata_type: "google.cloud.networkservices.v1beta1.OperationMetadata" + }; + } + + // Updates the parameters of a single EndpointPolicy. + rpc UpdateEndpointPolicy(UpdateEndpointPolicyRequest) returns (google.longrunning.Operation) { + option (google.api.http) = { + patch: "/v1beta1/{endpoint_policy.name=projects/*/locations/*/endpointPolicies/*}" + body: "endpoint_policy" + }; + option (google.api.method_signature) = "endpoint_policy,update_mask"; + option (google.longrunning.operation_info) = { + response_type: "EndpointPolicy" + metadata_type: "google.cloud.networkservices.v1beta1.OperationMetadata" + }; + } + + // Deletes a single EndpointPolicy. + rpc DeleteEndpointPolicy(DeleteEndpointPolicyRequest) returns (google.longrunning.Operation) { + option (google.api.http) = { + delete: "/v1beta1/{name=projects/*/locations/*/endpointPolicies/*}" + }; + option (google.api.method_signature) = "name"; + option (google.longrunning.operation_info) = { + response_type: "google.protobuf.Empty" + metadata_type: "google.cloud.networkservices.v1beta1.OperationMetadata" + }; + } +} diff --git a/packages/google-cloud-networkservices/protos/protos.d.ts b/packages/google-cloud-networkservices/protos/protos.d.ts new file mode 100644 index 00000000000..a5cc8a9fcc0 --- /dev/null +++ b/packages/google-cloud-networkservices/protos/protos.d.ts @@ -0,0 +1,19769 @@ +// Copyright 2023 Google LLC +// +// Licensed under the Apache License, Version 2.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 networkservices. */ + namespace networkservices { + + /** Namespace v1. */ + namespace v1 { + + /** Properties of an OperationMetadata. */ + interface IOperationMetadata { + + /** OperationMetadata createTime */ + createTime?: (google.protobuf.ITimestamp|null); + + /** OperationMetadata endTime */ + endTime?: (google.protobuf.ITimestamp|null); + + /** OperationMetadata target */ + target?: (string|null); + + /** OperationMetadata verb */ + verb?: (string|null); + + /** OperationMetadata statusMessage */ + statusMessage?: (string|null); + + /** OperationMetadata requestedCancellation */ + requestedCancellation?: (boolean|null); + + /** OperationMetadata apiVersion */ + apiVersion?: (string|null); + } + + /** Represents an OperationMetadata. */ + class OperationMetadata implements IOperationMetadata { + + /** + * Constructs a new OperationMetadata. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.networkservices.v1.IOperationMetadata); + + /** OperationMetadata createTime. */ + public createTime?: (google.protobuf.ITimestamp|null); + + /** OperationMetadata endTime. */ + public endTime?: (google.protobuf.ITimestamp|null); + + /** OperationMetadata target. */ + public target: string; + + /** OperationMetadata verb. */ + public verb: string; + + /** OperationMetadata statusMessage. */ + public statusMessage: string; + + /** OperationMetadata requestedCancellation. */ + public requestedCancellation: boolean; + + /** OperationMetadata apiVersion. */ + public apiVersion: string; + + /** + * Creates a new OperationMetadata instance using the specified properties. + * @param [properties] Properties to set + * @returns OperationMetadata instance + */ + public static create(properties?: google.cloud.networkservices.v1.IOperationMetadata): google.cloud.networkservices.v1.OperationMetadata; + + /** + * Encodes the specified OperationMetadata message. Does not implicitly {@link google.cloud.networkservices.v1.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.networkservices.v1.IOperationMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified OperationMetadata message, length delimited. Does not implicitly {@link google.cloud.networkservices.v1.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.networkservices.v1.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.networkservices.v1.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.networkservices.v1.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.networkservices.v1.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.networkservices.v1.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 TrafficPortSelector. */ + interface ITrafficPortSelector { + + /** TrafficPortSelector ports */ + ports?: (string[]|null); + } + + /** Represents a TrafficPortSelector. */ + class TrafficPortSelector implements ITrafficPortSelector { + + /** + * Constructs a new TrafficPortSelector. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.networkservices.v1.ITrafficPortSelector); + + /** TrafficPortSelector ports. */ + public ports: string[]; + + /** + * Creates a new TrafficPortSelector instance using the specified properties. + * @param [properties] Properties to set + * @returns TrafficPortSelector instance + */ + public static create(properties?: google.cloud.networkservices.v1.ITrafficPortSelector): google.cloud.networkservices.v1.TrafficPortSelector; + + /** + * Encodes the specified TrafficPortSelector message. Does not implicitly {@link google.cloud.networkservices.v1.TrafficPortSelector.verify|verify} messages. + * @param message TrafficPortSelector message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.networkservices.v1.ITrafficPortSelector, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified TrafficPortSelector message, length delimited. Does not implicitly {@link google.cloud.networkservices.v1.TrafficPortSelector.verify|verify} messages. + * @param message TrafficPortSelector message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.networkservices.v1.ITrafficPortSelector, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TrafficPortSelector message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns TrafficPortSelector + * @throws {Error} If the payload is not 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.networkservices.v1.TrafficPortSelector; + + /** + * Decodes a TrafficPortSelector message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns TrafficPortSelector + * @throws {Error} If the payload 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.networkservices.v1.TrafficPortSelector; + + /** + * Verifies a TrafficPortSelector message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a TrafficPortSelector message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns TrafficPortSelector + */ + public static fromObject(object: { [k: string]: any }): google.cloud.networkservices.v1.TrafficPortSelector; + + /** + * Creates a plain object from a TrafficPortSelector message. Also converts values to other types if specified. + * @param message TrafficPortSelector + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.networkservices.v1.TrafficPortSelector, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this TrafficPortSelector to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for TrafficPortSelector + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an EndpointMatcher. */ + interface IEndpointMatcher { + + /** EndpointMatcher metadataLabelMatcher */ + metadataLabelMatcher?: (google.cloud.networkservices.v1.EndpointMatcher.IMetadataLabelMatcher|null); + } + + /** Represents an EndpointMatcher. */ + class EndpointMatcher implements IEndpointMatcher { + + /** + * Constructs a new EndpointMatcher. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.networkservices.v1.IEndpointMatcher); + + /** EndpointMatcher metadataLabelMatcher. */ + public metadataLabelMatcher?: (google.cloud.networkservices.v1.EndpointMatcher.IMetadataLabelMatcher|null); + + /** EndpointMatcher matcherType. */ + public matcherType?: "metadataLabelMatcher"; + + /** + * Creates a new EndpointMatcher instance using the specified properties. + * @param [properties] Properties to set + * @returns EndpointMatcher instance + */ + public static create(properties?: google.cloud.networkservices.v1.IEndpointMatcher): google.cloud.networkservices.v1.EndpointMatcher; + + /** + * Encodes the specified EndpointMatcher message. Does not implicitly {@link google.cloud.networkservices.v1.EndpointMatcher.verify|verify} messages. + * @param message EndpointMatcher message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.networkservices.v1.IEndpointMatcher, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified EndpointMatcher message, length delimited. Does not implicitly {@link google.cloud.networkservices.v1.EndpointMatcher.verify|verify} messages. + * @param message EndpointMatcher message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.networkservices.v1.IEndpointMatcher, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an EndpointMatcher message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns EndpointMatcher + * @throws {Error} If the payload is not 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.networkservices.v1.EndpointMatcher; + + /** + * Decodes an EndpointMatcher message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns EndpointMatcher + * @throws {Error} If the payload 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.networkservices.v1.EndpointMatcher; + + /** + * Verifies an EndpointMatcher message. + * @param message Plain 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 EndpointMatcher message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns EndpointMatcher + */ + public static fromObject(object: { [k: string]: any }): google.cloud.networkservices.v1.EndpointMatcher; + + /** + * Creates a plain object from an EndpointMatcher message. Also converts values to other types if specified. + * @param message EndpointMatcher + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.networkservices.v1.EndpointMatcher, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this EndpointMatcher to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for EndpointMatcher + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace EndpointMatcher { + + /** Properties of a MetadataLabelMatcher. */ + interface IMetadataLabelMatcher { + + /** MetadataLabelMatcher metadataLabelMatchCriteria */ + metadataLabelMatchCriteria?: (google.cloud.networkservices.v1.EndpointMatcher.MetadataLabelMatcher.MetadataLabelMatchCriteria|keyof typeof google.cloud.networkservices.v1.EndpointMatcher.MetadataLabelMatcher.MetadataLabelMatchCriteria|null); + + /** MetadataLabelMatcher metadataLabels */ + metadataLabels?: (google.cloud.networkservices.v1.EndpointMatcher.MetadataLabelMatcher.IMetadataLabels[]|null); + } + + /** Represents a MetadataLabelMatcher. */ + class MetadataLabelMatcher implements IMetadataLabelMatcher { + + /** + * Constructs a new MetadataLabelMatcher. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.networkservices.v1.EndpointMatcher.IMetadataLabelMatcher); + + /** MetadataLabelMatcher metadataLabelMatchCriteria. */ + public metadataLabelMatchCriteria: (google.cloud.networkservices.v1.EndpointMatcher.MetadataLabelMatcher.MetadataLabelMatchCriteria|keyof typeof google.cloud.networkservices.v1.EndpointMatcher.MetadataLabelMatcher.MetadataLabelMatchCriteria); + + /** MetadataLabelMatcher metadataLabels. */ + public metadataLabels: google.cloud.networkservices.v1.EndpointMatcher.MetadataLabelMatcher.IMetadataLabels[]; + + /** + * Creates a new MetadataLabelMatcher instance using the specified properties. + * @param [properties] Properties to set + * @returns MetadataLabelMatcher instance + */ + public static create(properties?: google.cloud.networkservices.v1.EndpointMatcher.IMetadataLabelMatcher): google.cloud.networkservices.v1.EndpointMatcher.MetadataLabelMatcher; + + /** + * Encodes the specified MetadataLabelMatcher message. Does not implicitly {@link google.cloud.networkservices.v1.EndpointMatcher.MetadataLabelMatcher.verify|verify} messages. + * @param message MetadataLabelMatcher message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.networkservices.v1.EndpointMatcher.IMetadataLabelMatcher, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified MetadataLabelMatcher message, length delimited. Does not implicitly {@link google.cloud.networkservices.v1.EndpointMatcher.MetadataLabelMatcher.verify|verify} messages. + * @param message MetadataLabelMatcher message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.networkservices.v1.EndpointMatcher.IMetadataLabelMatcher, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a MetadataLabelMatcher message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns MetadataLabelMatcher + * @throws {Error} If the payload is not 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.networkservices.v1.EndpointMatcher.MetadataLabelMatcher; + + /** + * Decodes a MetadataLabelMatcher message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns MetadataLabelMatcher + * @throws {Error} If the payload 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.networkservices.v1.EndpointMatcher.MetadataLabelMatcher; + + /** + * Verifies a MetadataLabelMatcher message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a MetadataLabelMatcher message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns MetadataLabelMatcher + */ + public static fromObject(object: { [k: string]: any }): google.cloud.networkservices.v1.EndpointMatcher.MetadataLabelMatcher; + + /** + * Creates a plain object from a MetadataLabelMatcher message. Also converts values to other types if specified. + * @param message MetadataLabelMatcher + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.networkservices.v1.EndpointMatcher.MetadataLabelMatcher, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this MetadataLabelMatcher to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for MetadataLabelMatcher + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace MetadataLabelMatcher { + + /** Properties of a MetadataLabels. */ + interface IMetadataLabels { + + /** MetadataLabels labelName */ + labelName?: (string|null); + + /** MetadataLabels labelValue */ + labelValue?: (string|null); + } + + /** Represents a MetadataLabels. */ + class MetadataLabels implements IMetadataLabels { + + /** + * Constructs a new MetadataLabels. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.networkservices.v1.EndpointMatcher.MetadataLabelMatcher.IMetadataLabels); + + /** MetadataLabels labelName. */ + public labelName: string; + + /** MetadataLabels labelValue. */ + public labelValue: string; + + /** + * Creates a new MetadataLabels instance using the specified properties. + * @param [properties] Properties to set + * @returns MetadataLabels instance + */ + public static create(properties?: google.cloud.networkservices.v1.EndpointMatcher.MetadataLabelMatcher.IMetadataLabels): google.cloud.networkservices.v1.EndpointMatcher.MetadataLabelMatcher.MetadataLabels; + + /** + * Encodes the specified MetadataLabels message. Does not implicitly {@link google.cloud.networkservices.v1.EndpointMatcher.MetadataLabelMatcher.MetadataLabels.verify|verify} messages. + * @param message MetadataLabels message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.networkservices.v1.EndpointMatcher.MetadataLabelMatcher.IMetadataLabels, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified MetadataLabels message, length delimited. Does not implicitly {@link google.cloud.networkservices.v1.EndpointMatcher.MetadataLabelMatcher.MetadataLabels.verify|verify} messages. + * @param message MetadataLabels message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.networkservices.v1.EndpointMatcher.MetadataLabelMatcher.IMetadataLabels, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a MetadataLabels message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns MetadataLabels + * @throws {Error} If the payload is not 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.networkservices.v1.EndpointMatcher.MetadataLabelMatcher.MetadataLabels; + + /** + * Decodes a MetadataLabels message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns MetadataLabels + * @throws {Error} If the payload 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.networkservices.v1.EndpointMatcher.MetadataLabelMatcher.MetadataLabels; + + /** + * Verifies a MetadataLabels message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a MetadataLabels message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns MetadataLabels + */ + public static fromObject(object: { [k: string]: any }): google.cloud.networkservices.v1.EndpointMatcher.MetadataLabelMatcher.MetadataLabels; + + /** + * Creates a plain object from a MetadataLabels message. Also converts values to other types if specified. + * @param message MetadataLabels + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.networkservices.v1.EndpointMatcher.MetadataLabelMatcher.MetadataLabels, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this MetadataLabels to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for MetadataLabels + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** MetadataLabelMatchCriteria enum. */ + enum MetadataLabelMatchCriteria { + METADATA_LABEL_MATCH_CRITERIA_UNSPECIFIED = 0, + MATCH_ANY = 1, + MATCH_ALL = 2 + } + } + } + + /** Properties of an EndpointPolicy. */ + interface IEndpointPolicy { + + /** EndpointPolicy name */ + name?: (string|null); + + /** EndpointPolicy createTime */ + createTime?: (google.protobuf.ITimestamp|null); + + /** EndpointPolicy updateTime */ + updateTime?: (google.protobuf.ITimestamp|null); + + /** EndpointPolicy labels */ + labels?: ({ [k: string]: string }|null); + + /** EndpointPolicy type */ + type?: (google.cloud.networkservices.v1.EndpointPolicy.EndpointPolicyType|keyof typeof google.cloud.networkservices.v1.EndpointPolicy.EndpointPolicyType|null); + + /** EndpointPolicy authorizationPolicy */ + authorizationPolicy?: (string|null); + + /** EndpointPolicy endpointMatcher */ + endpointMatcher?: (google.cloud.networkservices.v1.IEndpointMatcher|null); + + /** EndpointPolicy trafficPortSelector */ + trafficPortSelector?: (google.cloud.networkservices.v1.ITrafficPortSelector|null); + + /** EndpointPolicy description */ + description?: (string|null); + + /** EndpointPolicy serverTlsPolicy */ + serverTlsPolicy?: (string|null); + + /** EndpointPolicy clientTlsPolicy */ + clientTlsPolicy?: (string|null); + } + + /** Represents an EndpointPolicy. */ + class EndpointPolicy implements IEndpointPolicy { + + /** + * Constructs a new EndpointPolicy. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.networkservices.v1.IEndpointPolicy); + + /** EndpointPolicy name. */ + public name: string; + + /** EndpointPolicy createTime. */ + public createTime?: (google.protobuf.ITimestamp|null); + + /** EndpointPolicy updateTime. */ + public updateTime?: (google.protobuf.ITimestamp|null); + + /** EndpointPolicy labels. */ + public labels: { [k: string]: string }; + + /** EndpointPolicy type. */ + public type: (google.cloud.networkservices.v1.EndpointPolicy.EndpointPolicyType|keyof typeof google.cloud.networkservices.v1.EndpointPolicy.EndpointPolicyType); + + /** EndpointPolicy authorizationPolicy. */ + public authorizationPolicy: string; + + /** EndpointPolicy endpointMatcher. */ + public endpointMatcher?: (google.cloud.networkservices.v1.IEndpointMatcher|null); + + /** EndpointPolicy trafficPortSelector. */ + public trafficPortSelector?: (google.cloud.networkservices.v1.ITrafficPortSelector|null); + + /** EndpointPolicy description. */ + public description: string; + + /** EndpointPolicy serverTlsPolicy. */ + public serverTlsPolicy: string; + + /** EndpointPolicy clientTlsPolicy. */ + public clientTlsPolicy: string; + + /** + * Creates a new EndpointPolicy instance using the specified properties. + * @param [properties] Properties to set + * @returns EndpointPolicy instance + */ + public static create(properties?: google.cloud.networkservices.v1.IEndpointPolicy): google.cloud.networkservices.v1.EndpointPolicy; + + /** + * Encodes the specified EndpointPolicy message. Does not implicitly {@link google.cloud.networkservices.v1.EndpointPolicy.verify|verify} messages. + * @param message EndpointPolicy message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.networkservices.v1.IEndpointPolicy, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified EndpointPolicy message, length delimited. Does not implicitly {@link google.cloud.networkservices.v1.EndpointPolicy.verify|verify} messages. + * @param message EndpointPolicy message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.networkservices.v1.IEndpointPolicy, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an EndpointPolicy message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns EndpointPolicy + * @throws {Error} If the payload is not 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.networkservices.v1.EndpointPolicy; + + /** + * Decodes an EndpointPolicy message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns EndpointPolicy + * @throws {Error} If the payload 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.networkservices.v1.EndpointPolicy; + + /** + * Verifies an EndpointPolicy message. + * @param message Plain 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 EndpointPolicy message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns EndpointPolicy + */ + public static fromObject(object: { [k: string]: any }): google.cloud.networkservices.v1.EndpointPolicy; + + /** + * Creates a plain object from an EndpointPolicy message. Also converts values to other types if specified. + * @param message EndpointPolicy + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.networkservices.v1.EndpointPolicy, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this EndpointPolicy to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for EndpointPolicy + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace EndpointPolicy { + + /** EndpointPolicyType enum. */ + enum EndpointPolicyType { + ENDPOINT_POLICY_TYPE_UNSPECIFIED = 0, + SIDECAR_PROXY = 1, + GRPC_SERVER = 2 + } + } + + /** Properties of a ListEndpointPoliciesRequest. */ + interface IListEndpointPoliciesRequest { + + /** ListEndpointPoliciesRequest parent */ + parent?: (string|null); + + /** ListEndpointPoliciesRequest pageSize */ + pageSize?: (number|null); + + /** ListEndpointPoliciesRequest pageToken */ + pageToken?: (string|null); + } + + /** Represents a ListEndpointPoliciesRequest. */ + class ListEndpointPoliciesRequest implements IListEndpointPoliciesRequest { + + /** + * Constructs a new ListEndpointPoliciesRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.networkservices.v1.IListEndpointPoliciesRequest); + + /** ListEndpointPoliciesRequest parent. */ + public parent: string; + + /** ListEndpointPoliciesRequest pageSize. */ + public pageSize: number; + + /** ListEndpointPoliciesRequest pageToken. */ + public pageToken: string; + + /** + * Creates a new ListEndpointPoliciesRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ListEndpointPoliciesRequest instance + */ + public static create(properties?: google.cloud.networkservices.v1.IListEndpointPoliciesRequest): google.cloud.networkservices.v1.ListEndpointPoliciesRequest; + + /** + * Encodes the specified ListEndpointPoliciesRequest message. Does not implicitly {@link google.cloud.networkservices.v1.ListEndpointPoliciesRequest.verify|verify} messages. + * @param message ListEndpointPoliciesRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.networkservices.v1.IListEndpointPoliciesRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListEndpointPoliciesRequest message, length delimited. Does not implicitly {@link google.cloud.networkservices.v1.ListEndpointPoliciesRequest.verify|verify} messages. + * @param message ListEndpointPoliciesRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.networkservices.v1.IListEndpointPoliciesRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListEndpointPoliciesRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListEndpointPoliciesRequest + * @throws {Error} If the payload is not 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.networkservices.v1.ListEndpointPoliciesRequest; + + /** + * Decodes a ListEndpointPoliciesRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListEndpointPoliciesRequest + * @throws {Error} If the payload 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.networkservices.v1.ListEndpointPoliciesRequest; + + /** + * Verifies a ListEndpointPoliciesRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListEndpointPoliciesRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListEndpointPoliciesRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.networkservices.v1.ListEndpointPoliciesRequest; + + /** + * Creates a plain object from a ListEndpointPoliciesRequest message. Also converts values to other types if specified. + * @param message ListEndpointPoliciesRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.networkservices.v1.ListEndpointPoliciesRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListEndpointPoliciesRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListEndpointPoliciesRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListEndpointPoliciesResponse. */ + interface IListEndpointPoliciesResponse { + + /** ListEndpointPoliciesResponse endpointPolicies */ + endpointPolicies?: (google.cloud.networkservices.v1.IEndpointPolicy[]|null); + + /** ListEndpointPoliciesResponse nextPageToken */ + nextPageToken?: (string|null); + } + + /** Represents a ListEndpointPoliciesResponse. */ + class ListEndpointPoliciesResponse implements IListEndpointPoliciesResponse { + + /** + * Constructs a new ListEndpointPoliciesResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.networkservices.v1.IListEndpointPoliciesResponse); + + /** ListEndpointPoliciesResponse endpointPolicies. */ + public endpointPolicies: google.cloud.networkservices.v1.IEndpointPolicy[]; + + /** ListEndpointPoliciesResponse nextPageToken. */ + public nextPageToken: string; + + /** + * Creates a new ListEndpointPoliciesResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ListEndpointPoliciesResponse instance + */ + public static create(properties?: google.cloud.networkservices.v1.IListEndpointPoliciesResponse): google.cloud.networkservices.v1.ListEndpointPoliciesResponse; + + /** + * Encodes the specified ListEndpointPoliciesResponse message. Does not implicitly {@link google.cloud.networkservices.v1.ListEndpointPoliciesResponse.verify|verify} messages. + * @param message ListEndpointPoliciesResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.networkservices.v1.IListEndpointPoliciesResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListEndpointPoliciesResponse message, length delimited. Does not implicitly {@link google.cloud.networkservices.v1.ListEndpointPoliciesResponse.verify|verify} messages. + * @param message ListEndpointPoliciesResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.networkservices.v1.IListEndpointPoliciesResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListEndpointPoliciesResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListEndpointPoliciesResponse + * @throws {Error} If the payload is not 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.networkservices.v1.ListEndpointPoliciesResponse; + + /** + * Decodes a ListEndpointPoliciesResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListEndpointPoliciesResponse + * @throws {Error} If the payload 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.networkservices.v1.ListEndpointPoliciesResponse; + + /** + * Verifies a ListEndpointPoliciesResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListEndpointPoliciesResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListEndpointPoliciesResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.networkservices.v1.ListEndpointPoliciesResponse; + + /** + * Creates a plain object from a ListEndpointPoliciesResponse message. Also converts values to other types if specified. + * @param message ListEndpointPoliciesResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.networkservices.v1.ListEndpointPoliciesResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListEndpointPoliciesResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListEndpointPoliciesResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a GetEndpointPolicyRequest. */ + interface IGetEndpointPolicyRequest { + + /** GetEndpointPolicyRequest name */ + name?: (string|null); + } + + /** Represents a GetEndpointPolicyRequest. */ + class GetEndpointPolicyRequest implements IGetEndpointPolicyRequest { + + /** + * Constructs a new GetEndpointPolicyRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.networkservices.v1.IGetEndpointPolicyRequest); + + /** GetEndpointPolicyRequest name. */ + public name: string; + + /** + * Creates a new GetEndpointPolicyRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GetEndpointPolicyRequest instance + */ + public static create(properties?: google.cloud.networkservices.v1.IGetEndpointPolicyRequest): google.cloud.networkservices.v1.GetEndpointPolicyRequest; + + /** + * Encodes the specified GetEndpointPolicyRequest message. Does not implicitly {@link google.cloud.networkservices.v1.GetEndpointPolicyRequest.verify|verify} messages. + * @param message GetEndpointPolicyRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.networkservices.v1.IGetEndpointPolicyRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GetEndpointPolicyRequest message, length delimited. Does not implicitly {@link google.cloud.networkservices.v1.GetEndpointPolicyRequest.verify|verify} messages. + * @param message GetEndpointPolicyRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.networkservices.v1.IGetEndpointPolicyRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GetEndpointPolicyRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GetEndpointPolicyRequest + * @throws {Error} If the payload is not 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.networkservices.v1.GetEndpointPolicyRequest; + + /** + * Decodes a GetEndpointPolicyRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GetEndpointPolicyRequest + * @throws {Error} If the payload 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.networkservices.v1.GetEndpointPolicyRequest; + + /** + * Verifies a GetEndpointPolicyRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GetEndpointPolicyRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GetEndpointPolicyRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.networkservices.v1.GetEndpointPolicyRequest; + + /** + * Creates a plain object from a GetEndpointPolicyRequest message. Also converts values to other types if specified. + * @param message GetEndpointPolicyRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.networkservices.v1.GetEndpointPolicyRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GetEndpointPolicyRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GetEndpointPolicyRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a CreateEndpointPolicyRequest. */ + interface ICreateEndpointPolicyRequest { + + /** CreateEndpointPolicyRequest parent */ + parent?: (string|null); + + /** CreateEndpointPolicyRequest endpointPolicyId */ + endpointPolicyId?: (string|null); + + /** CreateEndpointPolicyRequest endpointPolicy */ + endpointPolicy?: (google.cloud.networkservices.v1.IEndpointPolicy|null); + } + + /** Represents a CreateEndpointPolicyRequest. */ + class CreateEndpointPolicyRequest implements ICreateEndpointPolicyRequest { + + /** + * Constructs a new CreateEndpointPolicyRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.networkservices.v1.ICreateEndpointPolicyRequest); + + /** CreateEndpointPolicyRequest parent. */ + public parent: string; + + /** CreateEndpointPolicyRequest endpointPolicyId. */ + public endpointPolicyId: string; + + /** CreateEndpointPolicyRequest endpointPolicy. */ + public endpointPolicy?: (google.cloud.networkservices.v1.IEndpointPolicy|null); + + /** + * Creates a new CreateEndpointPolicyRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns CreateEndpointPolicyRequest instance + */ + public static create(properties?: google.cloud.networkservices.v1.ICreateEndpointPolicyRequest): google.cloud.networkservices.v1.CreateEndpointPolicyRequest; + + /** + * Encodes the specified CreateEndpointPolicyRequest message. Does not implicitly {@link google.cloud.networkservices.v1.CreateEndpointPolicyRequest.verify|verify} messages. + * @param message CreateEndpointPolicyRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.networkservices.v1.ICreateEndpointPolicyRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CreateEndpointPolicyRequest message, length delimited. Does not implicitly {@link google.cloud.networkservices.v1.CreateEndpointPolicyRequest.verify|verify} messages. + * @param message CreateEndpointPolicyRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.networkservices.v1.ICreateEndpointPolicyRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CreateEndpointPolicyRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CreateEndpointPolicyRequest + * @throws {Error} If the payload is not 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.networkservices.v1.CreateEndpointPolicyRequest; + + /** + * Decodes a CreateEndpointPolicyRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CreateEndpointPolicyRequest + * @throws {Error} If the payload 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.networkservices.v1.CreateEndpointPolicyRequest; + + /** + * Verifies a CreateEndpointPolicyRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CreateEndpointPolicyRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CreateEndpointPolicyRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.networkservices.v1.CreateEndpointPolicyRequest; + + /** + * Creates a plain object from a CreateEndpointPolicyRequest message. Also converts values to other types if specified. + * @param message CreateEndpointPolicyRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.networkservices.v1.CreateEndpointPolicyRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CreateEndpointPolicyRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CreateEndpointPolicyRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an UpdateEndpointPolicyRequest. */ + interface IUpdateEndpointPolicyRequest { + + /** UpdateEndpointPolicyRequest updateMask */ + updateMask?: (google.protobuf.IFieldMask|null); + + /** UpdateEndpointPolicyRequest endpointPolicy */ + endpointPolicy?: (google.cloud.networkservices.v1.IEndpointPolicy|null); + } + + /** Represents an UpdateEndpointPolicyRequest. */ + class UpdateEndpointPolicyRequest implements IUpdateEndpointPolicyRequest { + + /** + * Constructs a new UpdateEndpointPolicyRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.networkservices.v1.IUpdateEndpointPolicyRequest); + + /** UpdateEndpointPolicyRequest updateMask. */ + public updateMask?: (google.protobuf.IFieldMask|null); + + /** UpdateEndpointPolicyRequest endpointPolicy. */ + public endpointPolicy?: (google.cloud.networkservices.v1.IEndpointPolicy|null); + + /** + * Creates a new UpdateEndpointPolicyRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns UpdateEndpointPolicyRequest instance + */ + public static create(properties?: google.cloud.networkservices.v1.IUpdateEndpointPolicyRequest): google.cloud.networkservices.v1.UpdateEndpointPolicyRequest; + + /** + * Encodes the specified UpdateEndpointPolicyRequest message. Does not implicitly {@link google.cloud.networkservices.v1.UpdateEndpointPolicyRequest.verify|verify} messages. + * @param message UpdateEndpointPolicyRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.networkservices.v1.IUpdateEndpointPolicyRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified UpdateEndpointPolicyRequest message, length delimited. Does not implicitly {@link google.cloud.networkservices.v1.UpdateEndpointPolicyRequest.verify|verify} messages. + * @param message UpdateEndpointPolicyRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.networkservices.v1.IUpdateEndpointPolicyRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an UpdateEndpointPolicyRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns UpdateEndpointPolicyRequest + * @throws {Error} If the payload is not 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.networkservices.v1.UpdateEndpointPolicyRequest; + + /** + * Decodes an UpdateEndpointPolicyRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns UpdateEndpointPolicyRequest + * @throws {Error} If the payload 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.networkservices.v1.UpdateEndpointPolicyRequest; + + /** + * Verifies an UpdateEndpointPolicyRequest message. + * @param message Plain 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 UpdateEndpointPolicyRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns UpdateEndpointPolicyRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.networkservices.v1.UpdateEndpointPolicyRequest; + + /** + * Creates a plain object from an UpdateEndpointPolicyRequest message. Also converts values to other types if specified. + * @param message UpdateEndpointPolicyRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.networkservices.v1.UpdateEndpointPolicyRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this UpdateEndpointPolicyRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for UpdateEndpointPolicyRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a DeleteEndpointPolicyRequest. */ + interface IDeleteEndpointPolicyRequest { + + /** DeleteEndpointPolicyRequest name */ + name?: (string|null); + } + + /** Represents a DeleteEndpointPolicyRequest. */ + class DeleteEndpointPolicyRequest implements IDeleteEndpointPolicyRequest { + + /** + * Constructs a new DeleteEndpointPolicyRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.networkservices.v1.IDeleteEndpointPolicyRequest); + + /** DeleteEndpointPolicyRequest name. */ + public name: string; + + /** + * Creates a new DeleteEndpointPolicyRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns DeleteEndpointPolicyRequest instance + */ + public static create(properties?: google.cloud.networkservices.v1.IDeleteEndpointPolicyRequest): google.cloud.networkservices.v1.DeleteEndpointPolicyRequest; + + /** + * Encodes the specified DeleteEndpointPolicyRequest message. Does not implicitly {@link google.cloud.networkservices.v1.DeleteEndpointPolicyRequest.verify|verify} messages. + * @param message DeleteEndpointPolicyRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.networkservices.v1.IDeleteEndpointPolicyRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DeleteEndpointPolicyRequest message, length delimited. Does not implicitly {@link google.cloud.networkservices.v1.DeleteEndpointPolicyRequest.verify|verify} messages. + * @param message DeleteEndpointPolicyRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.networkservices.v1.IDeleteEndpointPolicyRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DeleteEndpointPolicyRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DeleteEndpointPolicyRequest + * @throws {Error} If the payload is not 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.networkservices.v1.DeleteEndpointPolicyRequest; + + /** + * Decodes a DeleteEndpointPolicyRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DeleteEndpointPolicyRequest + * @throws {Error} If the payload 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.networkservices.v1.DeleteEndpointPolicyRequest; + + /** + * Verifies a DeleteEndpointPolicyRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DeleteEndpointPolicyRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DeleteEndpointPolicyRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.networkservices.v1.DeleteEndpointPolicyRequest; + + /** + * Creates a plain object from a DeleteEndpointPolicyRequest message. Also converts values to other types if specified. + * @param message DeleteEndpointPolicyRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.networkservices.v1.DeleteEndpointPolicyRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DeleteEndpointPolicyRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DeleteEndpointPolicyRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Gateway. */ + interface IGateway { + + /** Gateway name */ + name?: (string|null); + + /** Gateway selfLink */ + selfLink?: (string|null); + + /** Gateway createTime */ + createTime?: (google.protobuf.ITimestamp|null); + + /** Gateway updateTime */ + updateTime?: (google.protobuf.ITimestamp|null); + + /** Gateway labels */ + labels?: ({ [k: string]: string }|null); + + /** Gateway description */ + description?: (string|null); + + /** Gateway type */ + type?: (google.cloud.networkservices.v1.Gateway.Type|keyof typeof google.cloud.networkservices.v1.Gateway.Type|null); + + /** Gateway ports */ + ports?: (number[]|null); + + /** Gateway scope */ + scope?: (string|null); + + /** Gateway serverTlsPolicy */ + serverTlsPolicy?: (string|null); + } + + /** Represents a Gateway. */ + class Gateway implements IGateway { + + /** + * Constructs a new Gateway. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.networkservices.v1.IGateway); + + /** Gateway name. */ + public name: string; + + /** Gateway selfLink. */ + public selfLink: string; + + /** Gateway createTime. */ + public createTime?: (google.protobuf.ITimestamp|null); + + /** Gateway updateTime. */ + public updateTime?: (google.protobuf.ITimestamp|null); + + /** Gateway labels. */ + public labels: { [k: string]: string }; + + /** Gateway description. */ + public description: string; + + /** Gateway type. */ + public type: (google.cloud.networkservices.v1.Gateway.Type|keyof typeof google.cloud.networkservices.v1.Gateway.Type); + + /** Gateway ports. */ + public ports: number[]; + + /** Gateway scope. */ + public scope: string; + + /** Gateway serverTlsPolicy. */ + public serverTlsPolicy: string; + + /** + * Creates a new Gateway instance using the specified properties. + * @param [properties] Properties to set + * @returns Gateway instance + */ + public static create(properties?: google.cloud.networkservices.v1.IGateway): google.cloud.networkservices.v1.Gateway; + + /** + * Encodes the specified Gateway message. Does not implicitly {@link google.cloud.networkservices.v1.Gateway.verify|verify} messages. + * @param message Gateway message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.networkservices.v1.IGateway, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Gateway message, length delimited. Does not implicitly {@link google.cloud.networkservices.v1.Gateway.verify|verify} messages. + * @param message Gateway message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.networkservices.v1.IGateway, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Gateway message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Gateway + * @throws {Error} If the payload is not 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.networkservices.v1.Gateway; + + /** + * Decodes a Gateway message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Gateway + * @throws {Error} If the payload 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.networkservices.v1.Gateway; + + /** + * Verifies a Gateway message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Gateway message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Gateway + */ + public static fromObject(object: { [k: string]: any }): google.cloud.networkservices.v1.Gateway; + + /** + * Creates a plain object from a Gateway message. Also converts values to other types if specified. + * @param message Gateway + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.networkservices.v1.Gateway, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Gateway to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Gateway + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace Gateway { + + /** Type enum. */ + enum Type { + TYPE_UNSPECIFIED = 0, + OPEN_MESH = 1, + SECURE_WEB_GATEWAY = 2 + } + } + + /** Properties of a ListGatewaysRequest. */ + interface IListGatewaysRequest { + + /** ListGatewaysRequest parent */ + parent?: (string|null); + + /** ListGatewaysRequest pageSize */ + pageSize?: (number|null); + + /** ListGatewaysRequest pageToken */ + pageToken?: (string|null); + } + + /** Represents a ListGatewaysRequest. */ + class ListGatewaysRequest implements IListGatewaysRequest { + + /** + * Constructs a new ListGatewaysRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.networkservices.v1.IListGatewaysRequest); + + /** ListGatewaysRequest parent. */ + public parent: string; + + /** ListGatewaysRequest pageSize. */ + public pageSize: number; + + /** ListGatewaysRequest pageToken. */ + public pageToken: string; + + /** + * Creates a new ListGatewaysRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ListGatewaysRequest instance + */ + public static create(properties?: google.cloud.networkservices.v1.IListGatewaysRequest): google.cloud.networkservices.v1.ListGatewaysRequest; + + /** + * Encodes the specified ListGatewaysRequest message. Does not implicitly {@link google.cloud.networkservices.v1.ListGatewaysRequest.verify|verify} messages. + * @param message ListGatewaysRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.networkservices.v1.IListGatewaysRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListGatewaysRequest message, length delimited. Does not implicitly {@link google.cloud.networkservices.v1.ListGatewaysRequest.verify|verify} messages. + * @param message ListGatewaysRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.networkservices.v1.IListGatewaysRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListGatewaysRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListGatewaysRequest + * @throws {Error} If the payload is not 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.networkservices.v1.ListGatewaysRequest; + + /** + * Decodes a ListGatewaysRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListGatewaysRequest + * @throws {Error} If the payload 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.networkservices.v1.ListGatewaysRequest; + + /** + * Verifies a ListGatewaysRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListGatewaysRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListGatewaysRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.networkservices.v1.ListGatewaysRequest; + + /** + * Creates a plain object from a ListGatewaysRequest message. Also converts values to other types if specified. + * @param message ListGatewaysRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.networkservices.v1.ListGatewaysRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListGatewaysRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListGatewaysRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListGatewaysResponse. */ + interface IListGatewaysResponse { + + /** ListGatewaysResponse gateways */ + gateways?: (google.cloud.networkservices.v1.IGateway[]|null); + + /** ListGatewaysResponse nextPageToken */ + nextPageToken?: (string|null); + } + + /** Represents a ListGatewaysResponse. */ + class ListGatewaysResponse implements IListGatewaysResponse { + + /** + * Constructs a new ListGatewaysResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.networkservices.v1.IListGatewaysResponse); + + /** ListGatewaysResponse gateways. */ + public gateways: google.cloud.networkservices.v1.IGateway[]; + + /** ListGatewaysResponse nextPageToken. */ + public nextPageToken: string; + + /** + * Creates a new ListGatewaysResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ListGatewaysResponse instance + */ + public static create(properties?: google.cloud.networkservices.v1.IListGatewaysResponse): google.cloud.networkservices.v1.ListGatewaysResponse; + + /** + * Encodes the specified ListGatewaysResponse message. Does not implicitly {@link google.cloud.networkservices.v1.ListGatewaysResponse.verify|verify} messages. + * @param message ListGatewaysResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.networkservices.v1.IListGatewaysResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListGatewaysResponse message, length delimited. Does not implicitly {@link google.cloud.networkservices.v1.ListGatewaysResponse.verify|verify} messages. + * @param message ListGatewaysResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.networkservices.v1.IListGatewaysResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListGatewaysResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListGatewaysResponse + * @throws {Error} If the payload is not 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.networkservices.v1.ListGatewaysResponse; + + /** + * Decodes a ListGatewaysResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListGatewaysResponse + * @throws {Error} If the payload 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.networkservices.v1.ListGatewaysResponse; + + /** + * Verifies a ListGatewaysResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListGatewaysResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListGatewaysResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.networkservices.v1.ListGatewaysResponse; + + /** + * Creates a plain object from a ListGatewaysResponse message. Also converts values to other types if specified. + * @param message ListGatewaysResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.networkservices.v1.ListGatewaysResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListGatewaysResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListGatewaysResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a GetGatewayRequest. */ + interface IGetGatewayRequest { + + /** GetGatewayRequest name */ + name?: (string|null); + } + + /** Represents a GetGatewayRequest. */ + class GetGatewayRequest implements IGetGatewayRequest { + + /** + * Constructs a new GetGatewayRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.networkservices.v1.IGetGatewayRequest); + + /** GetGatewayRequest name. */ + public name: string; + + /** + * Creates a new GetGatewayRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GetGatewayRequest instance + */ + public static create(properties?: google.cloud.networkservices.v1.IGetGatewayRequest): google.cloud.networkservices.v1.GetGatewayRequest; + + /** + * Encodes the specified GetGatewayRequest message. Does not implicitly {@link google.cloud.networkservices.v1.GetGatewayRequest.verify|verify} messages. + * @param message GetGatewayRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.networkservices.v1.IGetGatewayRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GetGatewayRequest message, length delimited. Does not implicitly {@link google.cloud.networkservices.v1.GetGatewayRequest.verify|verify} messages. + * @param message GetGatewayRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.networkservices.v1.IGetGatewayRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GetGatewayRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GetGatewayRequest + * @throws {Error} If the payload is not 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.networkservices.v1.GetGatewayRequest; + + /** + * Decodes a GetGatewayRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GetGatewayRequest + * @throws {Error} If the payload 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.networkservices.v1.GetGatewayRequest; + + /** + * Verifies a GetGatewayRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GetGatewayRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GetGatewayRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.networkservices.v1.GetGatewayRequest; + + /** + * Creates a plain object from a GetGatewayRequest message. Also converts values to other types if specified. + * @param message GetGatewayRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.networkservices.v1.GetGatewayRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GetGatewayRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GetGatewayRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a CreateGatewayRequest. */ + interface ICreateGatewayRequest { + + /** CreateGatewayRequest parent */ + parent?: (string|null); + + /** CreateGatewayRequest gatewayId */ + gatewayId?: (string|null); + + /** CreateGatewayRequest gateway */ + gateway?: (google.cloud.networkservices.v1.IGateway|null); + } + + /** Represents a CreateGatewayRequest. */ + class CreateGatewayRequest implements ICreateGatewayRequest { + + /** + * Constructs a new CreateGatewayRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.networkservices.v1.ICreateGatewayRequest); + + /** CreateGatewayRequest parent. */ + public parent: string; + + /** CreateGatewayRequest gatewayId. */ + public gatewayId: string; + + /** CreateGatewayRequest gateway. */ + public gateway?: (google.cloud.networkservices.v1.IGateway|null); + + /** + * Creates a new CreateGatewayRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns CreateGatewayRequest instance + */ + public static create(properties?: google.cloud.networkservices.v1.ICreateGatewayRequest): google.cloud.networkservices.v1.CreateGatewayRequest; + + /** + * Encodes the specified CreateGatewayRequest message. Does not implicitly {@link google.cloud.networkservices.v1.CreateGatewayRequest.verify|verify} messages. + * @param message CreateGatewayRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.networkservices.v1.ICreateGatewayRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CreateGatewayRequest message, length delimited. Does not implicitly {@link google.cloud.networkservices.v1.CreateGatewayRequest.verify|verify} messages. + * @param message CreateGatewayRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.networkservices.v1.ICreateGatewayRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CreateGatewayRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CreateGatewayRequest + * @throws {Error} If the payload is not 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.networkservices.v1.CreateGatewayRequest; + + /** + * Decodes a CreateGatewayRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CreateGatewayRequest + * @throws {Error} If the payload 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.networkservices.v1.CreateGatewayRequest; + + /** + * Verifies a CreateGatewayRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CreateGatewayRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CreateGatewayRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.networkservices.v1.CreateGatewayRequest; + + /** + * Creates a plain object from a CreateGatewayRequest message. Also converts values to other types if specified. + * @param message CreateGatewayRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.networkservices.v1.CreateGatewayRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CreateGatewayRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CreateGatewayRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an UpdateGatewayRequest. */ + interface IUpdateGatewayRequest { + + /** UpdateGatewayRequest updateMask */ + updateMask?: (google.protobuf.IFieldMask|null); + + /** UpdateGatewayRequest gateway */ + gateway?: (google.cloud.networkservices.v1.IGateway|null); + } + + /** Represents an UpdateGatewayRequest. */ + class UpdateGatewayRequest implements IUpdateGatewayRequest { + + /** + * Constructs a new UpdateGatewayRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.networkservices.v1.IUpdateGatewayRequest); + + /** UpdateGatewayRequest updateMask. */ + public updateMask?: (google.protobuf.IFieldMask|null); + + /** UpdateGatewayRequest gateway. */ + public gateway?: (google.cloud.networkservices.v1.IGateway|null); + + /** + * Creates a new UpdateGatewayRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns UpdateGatewayRequest instance + */ + public static create(properties?: google.cloud.networkservices.v1.IUpdateGatewayRequest): google.cloud.networkservices.v1.UpdateGatewayRequest; + + /** + * Encodes the specified UpdateGatewayRequest message. Does not implicitly {@link google.cloud.networkservices.v1.UpdateGatewayRequest.verify|verify} messages. + * @param message UpdateGatewayRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.networkservices.v1.IUpdateGatewayRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified UpdateGatewayRequest message, length delimited. Does not implicitly {@link google.cloud.networkservices.v1.UpdateGatewayRequest.verify|verify} messages. + * @param message UpdateGatewayRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.networkservices.v1.IUpdateGatewayRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an UpdateGatewayRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns UpdateGatewayRequest + * @throws {Error} If the payload is not 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.networkservices.v1.UpdateGatewayRequest; + + /** + * Decodes an UpdateGatewayRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns UpdateGatewayRequest + * @throws {Error} If the payload 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.networkservices.v1.UpdateGatewayRequest; + + /** + * Verifies an UpdateGatewayRequest message. + * @param message Plain 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 UpdateGatewayRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns UpdateGatewayRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.networkservices.v1.UpdateGatewayRequest; + + /** + * Creates a plain object from an UpdateGatewayRequest message. Also converts values to other types if specified. + * @param message UpdateGatewayRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.networkservices.v1.UpdateGatewayRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this UpdateGatewayRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for UpdateGatewayRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a DeleteGatewayRequest. */ + interface IDeleteGatewayRequest { + + /** DeleteGatewayRequest name */ + name?: (string|null); + } + + /** Represents a DeleteGatewayRequest. */ + class DeleteGatewayRequest implements IDeleteGatewayRequest { + + /** + * Constructs a new DeleteGatewayRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.networkservices.v1.IDeleteGatewayRequest); + + /** DeleteGatewayRequest name. */ + public name: string; + + /** + * Creates a new DeleteGatewayRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns DeleteGatewayRequest instance + */ + public static create(properties?: google.cloud.networkservices.v1.IDeleteGatewayRequest): google.cloud.networkservices.v1.DeleteGatewayRequest; + + /** + * Encodes the specified DeleteGatewayRequest message. Does not implicitly {@link google.cloud.networkservices.v1.DeleteGatewayRequest.verify|verify} messages. + * @param message DeleteGatewayRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.networkservices.v1.IDeleteGatewayRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DeleteGatewayRequest message, length delimited. Does not implicitly {@link google.cloud.networkservices.v1.DeleteGatewayRequest.verify|verify} messages. + * @param message DeleteGatewayRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.networkservices.v1.IDeleteGatewayRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DeleteGatewayRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DeleteGatewayRequest + * @throws {Error} If the payload is not 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.networkservices.v1.DeleteGatewayRequest; + + /** + * Decodes a DeleteGatewayRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DeleteGatewayRequest + * @throws {Error} If the payload 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.networkservices.v1.DeleteGatewayRequest; + + /** + * Verifies a DeleteGatewayRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DeleteGatewayRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DeleteGatewayRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.networkservices.v1.DeleteGatewayRequest; + + /** + * Creates a plain object from a DeleteGatewayRequest message. Also converts values to other types if specified. + * @param message DeleteGatewayRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.networkservices.v1.DeleteGatewayRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DeleteGatewayRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DeleteGatewayRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a GrpcRoute. */ + interface IGrpcRoute { + + /** GrpcRoute name */ + name?: (string|null); + + /** GrpcRoute selfLink */ + selfLink?: (string|null); + + /** GrpcRoute createTime */ + createTime?: (google.protobuf.ITimestamp|null); + + /** GrpcRoute updateTime */ + updateTime?: (google.protobuf.ITimestamp|null); + + /** GrpcRoute labels */ + labels?: ({ [k: string]: string }|null); + + /** GrpcRoute description */ + description?: (string|null); + + /** GrpcRoute hostnames */ + hostnames?: (string[]|null); + + /** GrpcRoute meshes */ + meshes?: (string[]|null); + + /** GrpcRoute gateways */ + gateways?: (string[]|null); + + /** GrpcRoute rules */ + rules?: (google.cloud.networkservices.v1.GrpcRoute.IRouteRule[]|null); + } + + /** Represents a GrpcRoute. */ + class GrpcRoute implements IGrpcRoute { + + /** + * Constructs a new GrpcRoute. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.networkservices.v1.IGrpcRoute); + + /** GrpcRoute name. */ + public name: string; + + /** GrpcRoute selfLink. */ + public selfLink: string; + + /** GrpcRoute createTime. */ + public createTime?: (google.protobuf.ITimestamp|null); + + /** GrpcRoute updateTime. */ + public updateTime?: (google.protobuf.ITimestamp|null); + + /** GrpcRoute labels. */ + public labels: { [k: string]: string }; + + /** GrpcRoute description. */ + public description: string; + + /** GrpcRoute hostnames. */ + public hostnames: string[]; + + /** GrpcRoute meshes. */ + public meshes: string[]; + + /** GrpcRoute gateways. */ + public gateways: string[]; + + /** GrpcRoute rules. */ + public rules: google.cloud.networkservices.v1.GrpcRoute.IRouteRule[]; + + /** + * Creates a new GrpcRoute instance using the specified properties. + * @param [properties] Properties to set + * @returns GrpcRoute instance + */ + public static create(properties?: google.cloud.networkservices.v1.IGrpcRoute): google.cloud.networkservices.v1.GrpcRoute; + + /** + * Encodes the specified GrpcRoute message. Does not implicitly {@link google.cloud.networkservices.v1.GrpcRoute.verify|verify} messages. + * @param message GrpcRoute message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.networkservices.v1.IGrpcRoute, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GrpcRoute message, length delimited. Does not implicitly {@link google.cloud.networkservices.v1.GrpcRoute.verify|verify} messages. + * @param message GrpcRoute message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.networkservices.v1.IGrpcRoute, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GrpcRoute message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GrpcRoute + * @throws {Error} If the payload is not 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.networkservices.v1.GrpcRoute; + + /** + * Decodes a GrpcRoute message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GrpcRoute + * @throws {Error} If the payload 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.networkservices.v1.GrpcRoute; + + /** + * Verifies a GrpcRoute message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GrpcRoute message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GrpcRoute + */ + public static fromObject(object: { [k: string]: any }): google.cloud.networkservices.v1.GrpcRoute; + + /** + * Creates a plain object from a GrpcRoute message. Also converts values to other types if specified. + * @param message GrpcRoute + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.networkservices.v1.GrpcRoute, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GrpcRoute to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GrpcRoute + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace GrpcRoute { + + /** Properties of a MethodMatch. */ + interface IMethodMatch { + + /** MethodMatch type */ + type?: (google.cloud.networkservices.v1.GrpcRoute.MethodMatch.Type|keyof typeof google.cloud.networkservices.v1.GrpcRoute.MethodMatch.Type|null); + + /** MethodMatch grpcService */ + grpcService?: (string|null); + + /** MethodMatch grpcMethod */ + grpcMethod?: (string|null); + + /** MethodMatch caseSensitive */ + caseSensitive?: (boolean|null); + } + + /** Represents a MethodMatch. */ + class MethodMatch implements IMethodMatch { + + /** + * Constructs a new MethodMatch. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.networkservices.v1.GrpcRoute.IMethodMatch); + + /** MethodMatch type. */ + public type: (google.cloud.networkservices.v1.GrpcRoute.MethodMatch.Type|keyof typeof google.cloud.networkservices.v1.GrpcRoute.MethodMatch.Type); + + /** MethodMatch grpcService. */ + public grpcService: string; + + /** MethodMatch grpcMethod. */ + public grpcMethod: string; + + /** MethodMatch caseSensitive. */ + public caseSensitive?: (boolean|null); + + /** MethodMatch _caseSensitive. */ + public _caseSensitive?: "caseSensitive"; + + /** + * Creates a new MethodMatch instance using the specified properties. + * @param [properties] Properties to set + * @returns MethodMatch instance + */ + public static create(properties?: google.cloud.networkservices.v1.GrpcRoute.IMethodMatch): google.cloud.networkservices.v1.GrpcRoute.MethodMatch; + + /** + * Encodes the specified MethodMatch message. Does not implicitly {@link google.cloud.networkservices.v1.GrpcRoute.MethodMatch.verify|verify} messages. + * @param message MethodMatch message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.networkservices.v1.GrpcRoute.IMethodMatch, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified MethodMatch message, length delimited. Does not implicitly {@link google.cloud.networkservices.v1.GrpcRoute.MethodMatch.verify|verify} messages. + * @param message MethodMatch message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.networkservices.v1.GrpcRoute.IMethodMatch, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a MethodMatch message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns MethodMatch + * @throws {Error} If the payload is not 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.networkservices.v1.GrpcRoute.MethodMatch; + + /** + * Decodes a MethodMatch message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns MethodMatch + * @throws {Error} If the payload 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.networkservices.v1.GrpcRoute.MethodMatch; + + /** + * Verifies a MethodMatch message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a MethodMatch message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns MethodMatch + */ + public static fromObject(object: { [k: string]: any }): google.cloud.networkservices.v1.GrpcRoute.MethodMatch; + + /** + * Creates a plain object from a MethodMatch message. Also converts values to other types if specified. + * @param message MethodMatch + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.networkservices.v1.GrpcRoute.MethodMatch, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this MethodMatch to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for MethodMatch + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace MethodMatch { + + /** Type enum. */ + enum Type { + TYPE_UNSPECIFIED = 0, + EXACT = 1, + REGULAR_EXPRESSION = 2 + } + } + + /** Properties of a HeaderMatch. */ + interface IHeaderMatch { + + /** HeaderMatch type */ + type?: (google.cloud.networkservices.v1.GrpcRoute.HeaderMatch.Type|keyof typeof google.cloud.networkservices.v1.GrpcRoute.HeaderMatch.Type|null); + + /** HeaderMatch key */ + key?: (string|null); + + /** HeaderMatch value */ + value?: (string|null); + } + + /** Represents a HeaderMatch. */ + class HeaderMatch implements IHeaderMatch { + + /** + * Constructs a new HeaderMatch. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.networkservices.v1.GrpcRoute.IHeaderMatch); + + /** HeaderMatch type. */ + public type: (google.cloud.networkservices.v1.GrpcRoute.HeaderMatch.Type|keyof typeof google.cloud.networkservices.v1.GrpcRoute.HeaderMatch.Type); + + /** HeaderMatch key. */ + public key: string; + + /** HeaderMatch value. */ + public value: string; + + /** + * Creates a new HeaderMatch instance using the specified properties. + * @param [properties] Properties to set + * @returns HeaderMatch instance + */ + public static create(properties?: google.cloud.networkservices.v1.GrpcRoute.IHeaderMatch): google.cloud.networkservices.v1.GrpcRoute.HeaderMatch; + + /** + * Encodes the specified HeaderMatch message. Does not implicitly {@link google.cloud.networkservices.v1.GrpcRoute.HeaderMatch.verify|verify} messages. + * @param message HeaderMatch message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.networkservices.v1.GrpcRoute.IHeaderMatch, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified HeaderMatch message, length delimited. Does not implicitly {@link google.cloud.networkservices.v1.GrpcRoute.HeaderMatch.verify|verify} messages. + * @param message HeaderMatch message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.networkservices.v1.GrpcRoute.IHeaderMatch, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a HeaderMatch message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns HeaderMatch + * @throws {Error} If the payload is not 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.networkservices.v1.GrpcRoute.HeaderMatch; + + /** + * Decodes a HeaderMatch message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns HeaderMatch + * @throws {Error} If the payload 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.networkservices.v1.GrpcRoute.HeaderMatch; + + /** + * Verifies a HeaderMatch message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a HeaderMatch message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns HeaderMatch + */ + public static fromObject(object: { [k: string]: any }): google.cloud.networkservices.v1.GrpcRoute.HeaderMatch; + + /** + * Creates a plain object from a HeaderMatch message. Also converts values to other types if specified. + * @param message HeaderMatch + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.networkservices.v1.GrpcRoute.HeaderMatch, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this HeaderMatch to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for HeaderMatch + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace HeaderMatch { + + /** Type enum. */ + enum Type { + TYPE_UNSPECIFIED = 0, + EXACT = 1, + REGULAR_EXPRESSION = 2 + } + } + + /** Properties of a RouteMatch. */ + interface IRouteMatch { + + /** RouteMatch method */ + method?: (google.cloud.networkservices.v1.GrpcRoute.IMethodMatch|null); + + /** RouteMatch headers */ + headers?: (google.cloud.networkservices.v1.GrpcRoute.IHeaderMatch[]|null); + } + + /** Represents a RouteMatch. */ + class RouteMatch implements IRouteMatch { + + /** + * Constructs a new RouteMatch. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.networkservices.v1.GrpcRoute.IRouteMatch); + + /** RouteMatch method. */ + public method?: (google.cloud.networkservices.v1.GrpcRoute.IMethodMatch|null); + + /** RouteMatch headers. */ + public headers: google.cloud.networkservices.v1.GrpcRoute.IHeaderMatch[]; + + /** RouteMatch _method. */ + public _method?: "method"; + + /** + * Creates a new RouteMatch instance using the specified properties. + * @param [properties] Properties to set + * @returns RouteMatch instance + */ + public static create(properties?: google.cloud.networkservices.v1.GrpcRoute.IRouteMatch): google.cloud.networkservices.v1.GrpcRoute.RouteMatch; + + /** + * Encodes the specified RouteMatch message. Does not implicitly {@link google.cloud.networkservices.v1.GrpcRoute.RouteMatch.verify|verify} messages. + * @param message RouteMatch message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.networkservices.v1.GrpcRoute.IRouteMatch, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified RouteMatch message, length delimited. Does not implicitly {@link google.cloud.networkservices.v1.GrpcRoute.RouteMatch.verify|verify} messages. + * @param message RouteMatch message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.networkservices.v1.GrpcRoute.IRouteMatch, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a RouteMatch message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns RouteMatch + * @throws {Error} If the payload is not 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.networkservices.v1.GrpcRoute.RouteMatch; + + /** + * Decodes a RouteMatch message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns RouteMatch + * @throws {Error} If the payload 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.networkservices.v1.GrpcRoute.RouteMatch; + + /** + * Verifies a RouteMatch message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a RouteMatch message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns RouteMatch + */ + public static fromObject(object: { [k: string]: any }): google.cloud.networkservices.v1.GrpcRoute.RouteMatch; + + /** + * Creates a plain object from a RouteMatch message. Also converts values to other types if specified. + * @param message RouteMatch + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.networkservices.v1.GrpcRoute.RouteMatch, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this RouteMatch to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for RouteMatch + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Destination. */ + interface IDestination { + + /** Destination serviceName */ + serviceName?: (string|null); + + /** Destination weight */ + weight?: (number|null); + } + + /** Represents a Destination. */ + class Destination implements IDestination { + + /** + * Constructs a new Destination. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.networkservices.v1.GrpcRoute.IDestination); + + /** Destination serviceName. */ + public serviceName?: (string|null); + + /** Destination weight. */ + public weight?: (number|null); + + /** Destination destinationType. */ + public destinationType?: "serviceName"; + + /** Destination _weight. */ + public _weight?: "weight"; + + /** + * Creates a new Destination instance using the specified properties. + * @param [properties] Properties to set + * @returns Destination instance + */ + public static create(properties?: google.cloud.networkservices.v1.GrpcRoute.IDestination): google.cloud.networkservices.v1.GrpcRoute.Destination; + + /** + * Encodes the specified Destination message. Does not implicitly {@link google.cloud.networkservices.v1.GrpcRoute.Destination.verify|verify} messages. + * @param message Destination message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.networkservices.v1.GrpcRoute.IDestination, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Destination message, length delimited. Does not implicitly {@link google.cloud.networkservices.v1.GrpcRoute.Destination.verify|verify} messages. + * @param message Destination message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.networkservices.v1.GrpcRoute.IDestination, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Destination message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Destination + * @throws {Error} If the payload is not 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.networkservices.v1.GrpcRoute.Destination; + + /** + * Decodes a Destination message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Destination + * @throws {Error} If the payload 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.networkservices.v1.GrpcRoute.Destination; + + /** + * Verifies a Destination message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Destination message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Destination + */ + public static fromObject(object: { [k: string]: any }): google.cloud.networkservices.v1.GrpcRoute.Destination; + + /** + * Creates a plain object from a Destination message. Also converts values to other types if specified. + * @param message Destination + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.networkservices.v1.GrpcRoute.Destination, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Destination to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Destination + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a FaultInjectionPolicy. */ + interface IFaultInjectionPolicy { + + /** FaultInjectionPolicy delay */ + delay?: (google.cloud.networkservices.v1.GrpcRoute.FaultInjectionPolicy.IDelay|null); + + /** FaultInjectionPolicy abort */ + abort?: (google.cloud.networkservices.v1.GrpcRoute.FaultInjectionPolicy.IAbort|null); + } + + /** Represents a FaultInjectionPolicy. */ + class FaultInjectionPolicy implements IFaultInjectionPolicy { + + /** + * Constructs a new FaultInjectionPolicy. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.networkservices.v1.GrpcRoute.IFaultInjectionPolicy); + + /** FaultInjectionPolicy delay. */ + public delay?: (google.cloud.networkservices.v1.GrpcRoute.FaultInjectionPolicy.IDelay|null); + + /** FaultInjectionPolicy abort. */ + public abort?: (google.cloud.networkservices.v1.GrpcRoute.FaultInjectionPolicy.IAbort|null); + + /** FaultInjectionPolicy _delay. */ + public _delay?: "delay"; + + /** FaultInjectionPolicy _abort. */ + public _abort?: "abort"; + + /** + * Creates a new FaultInjectionPolicy instance using the specified properties. + * @param [properties] Properties to set + * @returns FaultInjectionPolicy instance + */ + public static create(properties?: google.cloud.networkservices.v1.GrpcRoute.IFaultInjectionPolicy): google.cloud.networkservices.v1.GrpcRoute.FaultInjectionPolicy; + + /** + * Encodes the specified FaultInjectionPolicy message. Does not implicitly {@link google.cloud.networkservices.v1.GrpcRoute.FaultInjectionPolicy.verify|verify} messages. + * @param message FaultInjectionPolicy message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.networkservices.v1.GrpcRoute.IFaultInjectionPolicy, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified FaultInjectionPolicy message, length delimited. Does not implicitly {@link google.cloud.networkservices.v1.GrpcRoute.FaultInjectionPolicy.verify|verify} messages. + * @param message FaultInjectionPolicy message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.networkservices.v1.GrpcRoute.IFaultInjectionPolicy, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FaultInjectionPolicy message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns FaultInjectionPolicy + * @throws {Error} If the payload is not 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.networkservices.v1.GrpcRoute.FaultInjectionPolicy; + + /** + * Decodes a FaultInjectionPolicy message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns FaultInjectionPolicy + * @throws {Error} If the payload 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.networkservices.v1.GrpcRoute.FaultInjectionPolicy; + + /** + * Verifies a FaultInjectionPolicy message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a FaultInjectionPolicy message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns FaultInjectionPolicy + */ + public static fromObject(object: { [k: string]: any }): google.cloud.networkservices.v1.GrpcRoute.FaultInjectionPolicy; + + /** + * Creates a plain object from a FaultInjectionPolicy message. Also converts values to other types if specified. + * @param message FaultInjectionPolicy + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.networkservices.v1.GrpcRoute.FaultInjectionPolicy, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this FaultInjectionPolicy to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for FaultInjectionPolicy + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace FaultInjectionPolicy { + + /** Properties of a Delay. */ + interface IDelay { + + /** Delay fixedDelay */ + fixedDelay?: (google.protobuf.IDuration|null); + + /** Delay percentage */ + percentage?: (number|null); + } + + /** Represents a Delay. */ + class Delay implements IDelay { + + /** + * Constructs a new Delay. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.networkservices.v1.GrpcRoute.FaultInjectionPolicy.IDelay); + + /** Delay fixedDelay. */ + public fixedDelay?: (google.protobuf.IDuration|null); + + /** Delay percentage. */ + public percentage?: (number|null); + + /** Delay _fixedDelay. */ + public _fixedDelay?: "fixedDelay"; + + /** Delay _percentage. */ + public _percentage?: "percentage"; + + /** + * Creates a new Delay instance using the specified properties. + * @param [properties] Properties to set + * @returns Delay instance + */ + public static create(properties?: google.cloud.networkservices.v1.GrpcRoute.FaultInjectionPolicy.IDelay): google.cloud.networkservices.v1.GrpcRoute.FaultInjectionPolicy.Delay; + + /** + * Encodes the specified Delay message. Does not implicitly {@link google.cloud.networkservices.v1.GrpcRoute.FaultInjectionPolicy.Delay.verify|verify} messages. + * @param message Delay message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.networkservices.v1.GrpcRoute.FaultInjectionPolicy.IDelay, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Delay message, length delimited. Does not implicitly {@link google.cloud.networkservices.v1.GrpcRoute.FaultInjectionPolicy.Delay.verify|verify} messages. + * @param message Delay message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.networkservices.v1.GrpcRoute.FaultInjectionPolicy.IDelay, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Delay message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Delay + * @throws {Error} If the payload is not 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.networkservices.v1.GrpcRoute.FaultInjectionPolicy.Delay; + + /** + * Decodes a Delay message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Delay + * @throws {Error} If the payload 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.networkservices.v1.GrpcRoute.FaultInjectionPolicy.Delay; + + /** + * Verifies a Delay message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Delay message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Delay + */ + public static fromObject(object: { [k: string]: any }): google.cloud.networkservices.v1.GrpcRoute.FaultInjectionPolicy.Delay; + + /** + * Creates a plain object from a Delay message. Also converts values to other types if specified. + * @param message Delay + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.networkservices.v1.GrpcRoute.FaultInjectionPolicy.Delay, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Delay to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Delay + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an Abort. */ + interface IAbort { + + /** Abort httpStatus */ + httpStatus?: (number|null); + + /** Abort percentage */ + percentage?: (number|null); + } + + /** Represents an Abort. */ + class Abort implements IAbort { + + /** + * Constructs a new Abort. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.networkservices.v1.GrpcRoute.FaultInjectionPolicy.IAbort); + + /** Abort httpStatus. */ + public httpStatus?: (number|null); + + /** Abort percentage. */ + public percentage?: (number|null); + + /** Abort _httpStatus. */ + public _httpStatus?: "httpStatus"; + + /** Abort _percentage. */ + public _percentage?: "percentage"; + + /** + * Creates a new Abort instance using the specified properties. + * @param [properties] Properties to set + * @returns Abort instance + */ + public static create(properties?: google.cloud.networkservices.v1.GrpcRoute.FaultInjectionPolicy.IAbort): google.cloud.networkservices.v1.GrpcRoute.FaultInjectionPolicy.Abort; + + /** + * Encodes the specified Abort message. Does not implicitly {@link google.cloud.networkservices.v1.GrpcRoute.FaultInjectionPolicy.Abort.verify|verify} messages. + * @param message Abort message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.networkservices.v1.GrpcRoute.FaultInjectionPolicy.IAbort, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Abort message, length delimited. Does not implicitly {@link google.cloud.networkservices.v1.GrpcRoute.FaultInjectionPolicy.Abort.verify|verify} messages. + * @param message Abort message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.networkservices.v1.GrpcRoute.FaultInjectionPolicy.IAbort, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an Abort message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Abort + * @throws {Error} If the payload is not 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.networkservices.v1.GrpcRoute.FaultInjectionPolicy.Abort; + + /** + * Decodes an Abort message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Abort + * @throws {Error} If the payload 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.networkservices.v1.GrpcRoute.FaultInjectionPolicy.Abort; + + /** + * Verifies an Abort message. + * @param message Plain 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 Abort message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Abort + */ + public static fromObject(object: { [k: string]: any }): google.cloud.networkservices.v1.GrpcRoute.FaultInjectionPolicy.Abort; + + /** + * Creates a plain object from an Abort message. Also converts values to other types if specified. + * @param message Abort + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.networkservices.v1.GrpcRoute.FaultInjectionPolicy.Abort, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Abort to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Abort + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Properties of a RetryPolicy. */ + interface IRetryPolicy { + + /** RetryPolicy retryConditions */ + retryConditions?: (string[]|null); + + /** RetryPolicy numRetries */ + numRetries?: (number|null); + } + + /** Represents a RetryPolicy. */ + class RetryPolicy implements IRetryPolicy { + + /** + * Constructs a new RetryPolicy. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.networkservices.v1.GrpcRoute.IRetryPolicy); + + /** RetryPolicy retryConditions. */ + public retryConditions: string[]; + + /** RetryPolicy numRetries. */ + public numRetries: number; + + /** + * Creates a new RetryPolicy instance using the specified properties. + * @param [properties] Properties to set + * @returns RetryPolicy instance + */ + public static create(properties?: google.cloud.networkservices.v1.GrpcRoute.IRetryPolicy): google.cloud.networkservices.v1.GrpcRoute.RetryPolicy; + + /** + * Encodes the specified RetryPolicy message. Does not implicitly {@link google.cloud.networkservices.v1.GrpcRoute.RetryPolicy.verify|verify} messages. + * @param message RetryPolicy message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.networkservices.v1.GrpcRoute.IRetryPolicy, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified RetryPolicy message, length delimited. Does not implicitly {@link google.cloud.networkservices.v1.GrpcRoute.RetryPolicy.verify|verify} messages. + * @param message RetryPolicy message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.networkservices.v1.GrpcRoute.IRetryPolicy, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a RetryPolicy message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns RetryPolicy + * @throws {Error} If the payload is not 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.networkservices.v1.GrpcRoute.RetryPolicy; + + /** + * Decodes a RetryPolicy message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns RetryPolicy + * @throws {Error} If the payload 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.networkservices.v1.GrpcRoute.RetryPolicy; + + /** + * Verifies a RetryPolicy message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a RetryPolicy message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns RetryPolicy + */ + public static fromObject(object: { [k: string]: any }): google.cloud.networkservices.v1.GrpcRoute.RetryPolicy; + + /** + * Creates a plain object from a RetryPolicy message. Also converts values to other types if specified. + * @param message RetryPolicy + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.networkservices.v1.GrpcRoute.RetryPolicy, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this RetryPolicy to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for RetryPolicy + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a RouteAction. */ + interface IRouteAction { + + /** RouteAction destinations */ + destinations?: (google.cloud.networkservices.v1.GrpcRoute.IDestination[]|null); + + /** RouteAction faultInjectionPolicy */ + faultInjectionPolicy?: (google.cloud.networkservices.v1.GrpcRoute.IFaultInjectionPolicy|null); + + /** RouteAction timeout */ + timeout?: (google.protobuf.IDuration|null); + + /** RouteAction retryPolicy */ + retryPolicy?: (google.cloud.networkservices.v1.GrpcRoute.IRetryPolicy|null); + } + + /** Represents a RouteAction. */ + class RouteAction implements IRouteAction { + + /** + * Constructs a new RouteAction. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.networkservices.v1.GrpcRoute.IRouteAction); + + /** RouteAction destinations. */ + public destinations: google.cloud.networkservices.v1.GrpcRoute.IDestination[]; + + /** RouteAction faultInjectionPolicy. */ + public faultInjectionPolicy?: (google.cloud.networkservices.v1.GrpcRoute.IFaultInjectionPolicy|null); + + /** RouteAction timeout. */ + public timeout?: (google.protobuf.IDuration|null); + + /** RouteAction retryPolicy. */ + public retryPolicy?: (google.cloud.networkservices.v1.GrpcRoute.IRetryPolicy|null); + + /** + * Creates a new RouteAction instance using the specified properties. + * @param [properties] Properties to set + * @returns RouteAction instance + */ + public static create(properties?: google.cloud.networkservices.v1.GrpcRoute.IRouteAction): google.cloud.networkservices.v1.GrpcRoute.RouteAction; + + /** + * Encodes the specified RouteAction message. Does not implicitly {@link google.cloud.networkservices.v1.GrpcRoute.RouteAction.verify|verify} messages. + * @param message RouteAction message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.networkservices.v1.GrpcRoute.IRouteAction, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified RouteAction message, length delimited. Does not implicitly {@link google.cloud.networkservices.v1.GrpcRoute.RouteAction.verify|verify} messages. + * @param message RouteAction message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.networkservices.v1.GrpcRoute.IRouteAction, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a RouteAction message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns RouteAction + * @throws {Error} If the payload is not 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.networkservices.v1.GrpcRoute.RouteAction; + + /** + * Decodes a RouteAction message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns RouteAction + * @throws {Error} If the payload 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.networkservices.v1.GrpcRoute.RouteAction; + + /** + * Verifies a RouteAction message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a RouteAction message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns RouteAction + */ + public static fromObject(object: { [k: string]: any }): google.cloud.networkservices.v1.GrpcRoute.RouteAction; + + /** + * Creates a plain object from a RouteAction message. Also converts values to other types if specified. + * @param message RouteAction + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.networkservices.v1.GrpcRoute.RouteAction, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this RouteAction to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for RouteAction + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a RouteRule. */ + interface IRouteRule { + + /** RouteRule matches */ + matches?: (google.cloud.networkservices.v1.GrpcRoute.IRouteMatch[]|null); + + /** RouteRule action */ + action?: (google.cloud.networkservices.v1.GrpcRoute.IRouteAction|null); + } + + /** Represents a RouteRule. */ + class RouteRule implements IRouteRule { + + /** + * Constructs a new RouteRule. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.networkservices.v1.GrpcRoute.IRouteRule); + + /** RouteRule matches. */ + public matches: google.cloud.networkservices.v1.GrpcRoute.IRouteMatch[]; + + /** RouteRule action. */ + public action?: (google.cloud.networkservices.v1.GrpcRoute.IRouteAction|null); + + /** + * Creates a new RouteRule instance using the specified properties. + * @param [properties] Properties to set + * @returns RouteRule instance + */ + public static create(properties?: google.cloud.networkservices.v1.GrpcRoute.IRouteRule): google.cloud.networkservices.v1.GrpcRoute.RouteRule; + + /** + * Encodes the specified RouteRule message. Does not implicitly {@link google.cloud.networkservices.v1.GrpcRoute.RouteRule.verify|verify} messages. + * @param message RouteRule message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.networkservices.v1.GrpcRoute.IRouteRule, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified RouteRule message, length delimited. Does not implicitly {@link google.cloud.networkservices.v1.GrpcRoute.RouteRule.verify|verify} messages. + * @param message RouteRule message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.networkservices.v1.GrpcRoute.IRouteRule, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a RouteRule message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns RouteRule + * @throws {Error} If the payload is not 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.networkservices.v1.GrpcRoute.RouteRule; + + /** + * Decodes a RouteRule message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns RouteRule + * @throws {Error} If the payload 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.networkservices.v1.GrpcRoute.RouteRule; + + /** + * Verifies a RouteRule message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a RouteRule message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns RouteRule + */ + public static fromObject(object: { [k: string]: any }): google.cloud.networkservices.v1.GrpcRoute.RouteRule; + + /** + * Creates a plain object from a RouteRule message. Also converts values to other types if specified. + * @param message RouteRule + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.networkservices.v1.GrpcRoute.RouteRule, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this RouteRule to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for RouteRule + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Properties of a ListGrpcRoutesRequest. */ + interface IListGrpcRoutesRequest { + + /** ListGrpcRoutesRequest parent */ + parent?: (string|null); + + /** ListGrpcRoutesRequest pageSize */ + pageSize?: (number|null); + + /** ListGrpcRoutesRequest pageToken */ + pageToken?: (string|null); + } + + /** Represents a ListGrpcRoutesRequest. */ + class ListGrpcRoutesRequest implements IListGrpcRoutesRequest { + + /** + * Constructs a new ListGrpcRoutesRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.networkservices.v1.IListGrpcRoutesRequest); + + /** ListGrpcRoutesRequest parent. */ + public parent: string; + + /** ListGrpcRoutesRequest pageSize. */ + public pageSize: number; + + /** ListGrpcRoutesRequest pageToken. */ + public pageToken: string; + + /** + * Creates a new ListGrpcRoutesRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ListGrpcRoutesRequest instance + */ + public static create(properties?: google.cloud.networkservices.v1.IListGrpcRoutesRequest): google.cloud.networkservices.v1.ListGrpcRoutesRequest; + + /** + * Encodes the specified ListGrpcRoutesRequest message. Does not implicitly {@link google.cloud.networkservices.v1.ListGrpcRoutesRequest.verify|verify} messages. + * @param message ListGrpcRoutesRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.networkservices.v1.IListGrpcRoutesRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListGrpcRoutesRequest message, length delimited. Does not implicitly {@link google.cloud.networkservices.v1.ListGrpcRoutesRequest.verify|verify} messages. + * @param message ListGrpcRoutesRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.networkservices.v1.IListGrpcRoutesRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListGrpcRoutesRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListGrpcRoutesRequest + * @throws {Error} If the payload is not 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.networkservices.v1.ListGrpcRoutesRequest; + + /** + * Decodes a ListGrpcRoutesRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListGrpcRoutesRequest + * @throws {Error} If the payload 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.networkservices.v1.ListGrpcRoutesRequest; + + /** + * Verifies a ListGrpcRoutesRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListGrpcRoutesRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListGrpcRoutesRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.networkservices.v1.ListGrpcRoutesRequest; + + /** + * Creates a plain object from a ListGrpcRoutesRequest message. Also converts values to other types if specified. + * @param message ListGrpcRoutesRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.networkservices.v1.ListGrpcRoutesRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListGrpcRoutesRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListGrpcRoutesRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListGrpcRoutesResponse. */ + interface IListGrpcRoutesResponse { + + /** ListGrpcRoutesResponse grpcRoutes */ + grpcRoutes?: (google.cloud.networkservices.v1.IGrpcRoute[]|null); + + /** ListGrpcRoutesResponse nextPageToken */ + nextPageToken?: (string|null); + } + + /** Represents a ListGrpcRoutesResponse. */ + class ListGrpcRoutesResponse implements IListGrpcRoutesResponse { + + /** + * Constructs a new ListGrpcRoutesResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.networkservices.v1.IListGrpcRoutesResponse); + + /** ListGrpcRoutesResponse grpcRoutes. */ + public grpcRoutes: google.cloud.networkservices.v1.IGrpcRoute[]; + + /** ListGrpcRoutesResponse nextPageToken. */ + public nextPageToken: string; + + /** + * Creates a new ListGrpcRoutesResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ListGrpcRoutesResponse instance + */ + public static create(properties?: google.cloud.networkservices.v1.IListGrpcRoutesResponse): google.cloud.networkservices.v1.ListGrpcRoutesResponse; + + /** + * Encodes the specified ListGrpcRoutesResponse message. Does not implicitly {@link google.cloud.networkservices.v1.ListGrpcRoutesResponse.verify|verify} messages. + * @param message ListGrpcRoutesResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.networkservices.v1.IListGrpcRoutesResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListGrpcRoutesResponse message, length delimited. Does not implicitly {@link google.cloud.networkservices.v1.ListGrpcRoutesResponse.verify|verify} messages. + * @param message ListGrpcRoutesResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.networkservices.v1.IListGrpcRoutesResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListGrpcRoutesResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListGrpcRoutesResponse + * @throws {Error} If the payload is not 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.networkservices.v1.ListGrpcRoutesResponse; + + /** + * Decodes a ListGrpcRoutesResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListGrpcRoutesResponse + * @throws {Error} If the payload 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.networkservices.v1.ListGrpcRoutesResponse; + + /** + * Verifies a ListGrpcRoutesResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListGrpcRoutesResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListGrpcRoutesResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.networkservices.v1.ListGrpcRoutesResponse; + + /** + * Creates a plain object from a ListGrpcRoutesResponse message. Also converts values to other types if specified. + * @param message ListGrpcRoutesResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.networkservices.v1.ListGrpcRoutesResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListGrpcRoutesResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListGrpcRoutesResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a GetGrpcRouteRequest. */ + interface IGetGrpcRouteRequest { + + /** GetGrpcRouteRequest name */ + name?: (string|null); + } + + /** Represents a GetGrpcRouteRequest. */ + class GetGrpcRouteRequest implements IGetGrpcRouteRequest { + + /** + * Constructs a new GetGrpcRouteRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.networkservices.v1.IGetGrpcRouteRequest); + + /** GetGrpcRouteRequest name. */ + public name: string; + + /** + * Creates a new GetGrpcRouteRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GetGrpcRouteRequest instance + */ + public static create(properties?: google.cloud.networkservices.v1.IGetGrpcRouteRequest): google.cloud.networkservices.v1.GetGrpcRouteRequest; + + /** + * Encodes the specified GetGrpcRouteRequest message. Does not implicitly {@link google.cloud.networkservices.v1.GetGrpcRouteRequest.verify|verify} messages. + * @param message GetGrpcRouteRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.networkservices.v1.IGetGrpcRouteRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GetGrpcRouteRequest message, length delimited. Does not implicitly {@link google.cloud.networkservices.v1.GetGrpcRouteRequest.verify|verify} messages. + * @param message GetGrpcRouteRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.networkservices.v1.IGetGrpcRouteRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GetGrpcRouteRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GetGrpcRouteRequest + * @throws {Error} If the payload is not 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.networkservices.v1.GetGrpcRouteRequest; + + /** + * Decodes a GetGrpcRouteRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GetGrpcRouteRequest + * @throws {Error} If the payload 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.networkservices.v1.GetGrpcRouteRequest; + + /** + * Verifies a GetGrpcRouteRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GetGrpcRouteRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GetGrpcRouteRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.networkservices.v1.GetGrpcRouteRequest; + + /** + * Creates a plain object from a GetGrpcRouteRequest message. Also converts values to other types if specified. + * @param message GetGrpcRouteRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.networkservices.v1.GetGrpcRouteRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GetGrpcRouteRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GetGrpcRouteRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a CreateGrpcRouteRequest. */ + interface ICreateGrpcRouteRequest { + + /** CreateGrpcRouteRequest parent */ + parent?: (string|null); + + /** CreateGrpcRouteRequest grpcRouteId */ + grpcRouteId?: (string|null); + + /** CreateGrpcRouteRequest grpcRoute */ + grpcRoute?: (google.cloud.networkservices.v1.IGrpcRoute|null); + } + + /** Represents a CreateGrpcRouteRequest. */ + class CreateGrpcRouteRequest implements ICreateGrpcRouteRequest { + + /** + * Constructs a new CreateGrpcRouteRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.networkservices.v1.ICreateGrpcRouteRequest); + + /** CreateGrpcRouteRequest parent. */ + public parent: string; + + /** CreateGrpcRouteRequest grpcRouteId. */ + public grpcRouteId: string; + + /** CreateGrpcRouteRequest grpcRoute. */ + public grpcRoute?: (google.cloud.networkservices.v1.IGrpcRoute|null); + + /** + * Creates a new CreateGrpcRouteRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns CreateGrpcRouteRequest instance + */ + public static create(properties?: google.cloud.networkservices.v1.ICreateGrpcRouteRequest): google.cloud.networkservices.v1.CreateGrpcRouteRequest; + + /** + * Encodes the specified CreateGrpcRouteRequest message. Does not implicitly {@link google.cloud.networkservices.v1.CreateGrpcRouteRequest.verify|verify} messages. + * @param message CreateGrpcRouteRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.networkservices.v1.ICreateGrpcRouteRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CreateGrpcRouteRequest message, length delimited. Does not implicitly {@link google.cloud.networkservices.v1.CreateGrpcRouteRequest.verify|verify} messages. + * @param message CreateGrpcRouteRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.networkservices.v1.ICreateGrpcRouteRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CreateGrpcRouteRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CreateGrpcRouteRequest + * @throws {Error} If the payload is not 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.networkservices.v1.CreateGrpcRouteRequest; + + /** + * Decodes a CreateGrpcRouteRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CreateGrpcRouteRequest + * @throws {Error} If the payload 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.networkservices.v1.CreateGrpcRouteRequest; + + /** + * Verifies a CreateGrpcRouteRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CreateGrpcRouteRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CreateGrpcRouteRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.networkservices.v1.CreateGrpcRouteRequest; + + /** + * Creates a plain object from a CreateGrpcRouteRequest message. Also converts values to other types if specified. + * @param message CreateGrpcRouteRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.networkservices.v1.CreateGrpcRouteRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CreateGrpcRouteRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CreateGrpcRouteRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an UpdateGrpcRouteRequest. */ + interface IUpdateGrpcRouteRequest { + + /** UpdateGrpcRouteRequest updateMask */ + updateMask?: (google.protobuf.IFieldMask|null); + + /** UpdateGrpcRouteRequest grpcRoute */ + grpcRoute?: (google.cloud.networkservices.v1.IGrpcRoute|null); + } + + /** Represents an UpdateGrpcRouteRequest. */ + class UpdateGrpcRouteRequest implements IUpdateGrpcRouteRequest { + + /** + * Constructs a new UpdateGrpcRouteRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.networkservices.v1.IUpdateGrpcRouteRequest); + + /** UpdateGrpcRouteRequest updateMask. */ + public updateMask?: (google.protobuf.IFieldMask|null); + + /** UpdateGrpcRouteRequest grpcRoute. */ + public grpcRoute?: (google.cloud.networkservices.v1.IGrpcRoute|null); + + /** + * Creates a new UpdateGrpcRouteRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns UpdateGrpcRouteRequest instance + */ + public static create(properties?: google.cloud.networkservices.v1.IUpdateGrpcRouteRequest): google.cloud.networkservices.v1.UpdateGrpcRouteRequest; + + /** + * Encodes the specified UpdateGrpcRouteRequest message. Does not implicitly {@link google.cloud.networkservices.v1.UpdateGrpcRouteRequest.verify|verify} messages. + * @param message UpdateGrpcRouteRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.networkservices.v1.IUpdateGrpcRouteRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified UpdateGrpcRouteRequest message, length delimited. Does not implicitly {@link google.cloud.networkservices.v1.UpdateGrpcRouteRequest.verify|verify} messages. + * @param message UpdateGrpcRouteRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.networkservices.v1.IUpdateGrpcRouteRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an UpdateGrpcRouteRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns UpdateGrpcRouteRequest + * @throws {Error} If the payload is not 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.networkservices.v1.UpdateGrpcRouteRequest; + + /** + * Decodes an UpdateGrpcRouteRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns UpdateGrpcRouteRequest + * @throws {Error} If the payload 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.networkservices.v1.UpdateGrpcRouteRequest; + + /** + * Verifies an UpdateGrpcRouteRequest message. + * @param message Plain 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 UpdateGrpcRouteRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns UpdateGrpcRouteRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.networkservices.v1.UpdateGrpcRouteRequest; + + /** + * Creates a plain object from an UpdateGrpcRouteRequest message. Also converts values to other types if specified. + * @param message UpdateGrpcRouteRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.networkservices.v1.UpdateGrpcRouteRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this UpdateGrpcRouteRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for UpdateGrpcRouteRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a DeleteGrpcRouteRequest. */ + interface IDeleteGrpcRouteRequest { + + /** DeleteGrpcRouteRequest name */ + name?: (string|null); + } + + /** Represents a DeleteGrpcRouteRequest. */ + class DeleteGrpcRouteRequest implements IDeleteGrpcRouteRequest { + + /** + * Constructs a new DeleteGrpcRouteRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.networkservices.v1.IDeleteGrpcRouteRequest); + + /** DeleteGrpcRouteRequest name. */ + public name: string; + + /** + * Creates a new DeleteGrpcRouteRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns DeleteGrpcRouteRequest instance + */ + public static create(properties?: google.cloud.networkservices.v1.IDeleteGrpcRouteRequest): google.cloud.networkservices.v1.DeleteGrpcRouteRequest; + + /** + * Encodes the specified DeleteGrpcRouteRequest message. Does not implicitly {@link google.cloud.networkservices.v1.DeleteGrpcRouteRequest.verify|verify} messages. + * @param message DeleteGrpcRouteRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.networkservices.v1.IDeleteGrpcRouteRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DeleteGrpcRouteRequest message, length delimited. Does not implicitly {@link google.cloud.networkservices.v1.DeleteGrpcRouteRequest.verify|verify} messages. + * @param message DeleteGrpcRouteRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.networkservices.v1.IDeleteGrpcRouteRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DeleteGrpcRouteRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DeleteGrpcRouteRequest + * @throws {Error} If the payload is not 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.networkservices.v1.DeleteGrpcRouteRequest; + + /** + * Decodes a DeleteGrpcRouteRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DeleteGrpcRouteRequest + * @throws {Error} If the payload 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.networkservices.v1.DeleteGrpcRouteRequest; + + /** + * Verifies a DeleteGrpcRouteRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DeleteGrpcRouteRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DeleteGrpcRouteRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.networkservices.v1.DeleteGrpcRouteRequest; + + /** + * Creates a plain object from a DeleteGrpcRouteRequest message. Also converts values to other types if specified. + * @param message DeleteGrpcRouteRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.networkservices.v1.DeleteGrpcRouteRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DeleteGrpcRouteRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DeleteGrpcRouteRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a HttpRoute. */ + interface IHttpRoute { + + /** HttpRoute name */ + name?: (string|null); + + /** HttpRoute selfLink */ + selfLink?: (string|null); + + /** HttpRoute description */ + description?: (string|null); + + /** HttpRoute createTime */ + createTime?: (google.protobuf.ITimestamp|null); + + /** HttpRoute updateTime */ + updateTime?: (google.protobuf.ITimestamp|null); + + /** HttpRoute hostnames */ + hostnames?: (string[]|null); + + /** HttpRoute meshes */ + meshes?: (string[]|null); + + /** HttpRoute gateways */ + gateways?: (string[]|null); + + /** HttpRoute labels */ + labels?: ({ [k: string]: string }|null); + + /** HttpRoute rules */ + rules?: (google.cloud.networkservices.v1.HttpRoute.IRouteRule[]|null); + } + + /** Represents a HttpRoute. */ + class HttpRoute implements IHttpRoute { + + /** + * Constructs a new HttpRoute. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.networkservices.v1.IHttpRoute); + + /** HttpRoute name. */ + public name: string; + + /** HttpRoute selfLink. */ + public selfLink: string; + + /** HttpRoute description. */ + public description: string; + + /** HttpRoute createTime. */ + public createTime?: (google.protobuf.ITimestamp|null); + + /** HttpRoute updateTime. */ + public updateTime?: (google.protobuf.ITimestamp|null); + + /** HttpRoute hostnames. */ + public hostnames: string[]; + + /** HttpRoute meshes. */ + public meshes: string[]; + + /** HttpRoute gateways. */ + public gateways: string[]; + + /** HttpRoute labels. */ + public labels: { [k: string]: string }; + + /** HttpRoute rules. */ + public rules: google.cloud.networkservices.v1.HttpRoute.IRouteRule[]; + + /** + * Creates a new HttpRoute instance using the specified properties. + * @param [properties] Properties to set + * @returns HttpRoute instance + */ + public static create(properties?: google.cloud.networkservices.v1.IHttpRoute): google.cloud.networkservices.v1.HttpRoute; + + /** + * Encodes the specified HttpRoute message. Does not implicitly {@link google.cloud.networkservices.v1.HttpRoute.verify|verify} messages. + * @param message HttpRoute message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.networkservices.v1.IHttpRoute, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified HttpRoute message, length delimited. Does not implicitly {@link google.cloud.networkservices.v1.HttpRoute.verify|verify} messages. + * @param message HttpRoute message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.networkservices.v1.IHttpRoute, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a HttpRoute message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns HttpRoute + * @throws {Error} If the payload is not 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.networkservices.v1.HttpRoute; + + /** + * Decodes a HttpRoute message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns HttpRoute + * @throws {Error} If the payload 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.networkservices.v1.HttpRoute; + + /** + * Verifies a HttpRoute message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a HttpRoute message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns HttpRoute + */ + public static fromObject(object: { [k: string]: any }): google.cloud.networkservices.v1.HttpRoute; + + /** + * Creates a plain object from a HttpRoute message. Also converts values to other types if specified. + * @param message HttpRoute + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.networkservices.v1.HttpRoute, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this HttpRoute to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for HttpRoute + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace HttpRoute { + + /** Properties of a HeaderMatch. */ + interface IHeaderMatch { + + /** HeaderMatch exactMatch */ + exactMatch?: (string|null); + + /** HeaderMatch regexMatch */ + regexMatch?: (string|null); + + /** HeaderMatch prefixMatch */ + prefixMatch?: (string|null); + + /** HeaderMatch presentMatch */ + presentMatch?: (boolean|null); + + /** HeaderMatch suffixMatch */ + suffixMatch?: (string|null); + + /** HeaderMatch rangeMatch */ + rangeMatch?: (google.cloud.networkservices.v1.HttpRoute.HeaderMatch.IIntegerRange|null); + + /** HeaderMatch header */ + header?: (string|null); + + /** HeaderMatch invertMatch */ + invertMatch?: (boolean|null); + } + + /** Represents a HeaderMatch. */ + class HeaderMatch implements IHeaderMatch { + + /** + * Constructs a new HeaderMatch. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.networkservices.v1.HttpRoute.IHeaderMatch); + + /** HeaderMatch exactMatch. */ + public exactMatch?: (string|null); + + /** HeaderMatch regexMatch. */ + public regexMatch?: (string|null); + + /** HeaderMatch prefixMatch. */ + public prefixMatch?: (string|null); + + /** HeaderMatch presentMatch. */ + public presentMatch?: (boolean|null); + + /** HeaderMatch suffixMatch. */ + public suffixMatch?: (string|null); + + /** HeaderMatch rangeMatch. */ + public rangeMatch?: (google.cloud.networkservices.v1.HttpRoute.HeaderMatch.IIntegerRange|null); + + /** HeaderMatch header. */ + public header: string; + + /** HeaderMatch invertMatch. */ + public invertMatch: boolean; + + /** HeaderMatch MatchType. */ + public MatchType?: ("exactMatch"|"regexMatch"|"prefixMatch"|"presentMatch"|"suffixMatch"|"rangeMatch"); + + /** + * Creates a new HeaderMatch instance using the specified properties. + * @param [properties] Properties to set + * @returns HeaderMatch instance + */ + public static create(properties?: google.cloud.networkservices.v1.HttpRoute.IHeaderMatch): google.cloud.networkservices.v1.HttpRoute.HeaderMatch; + + /** + * Encodes the specified HeaderMatch message. Does not implicitly {@link google.cloud.networkservices.v1.HttpRoute.HeaderMatch.verify|verify} messages. + * @param message HeaderMatch message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.networkservices.v1.HttpRoute.IHeaderMatch, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified HeaderMatch message, length delimited. Does not implicitly {@link google.cloud.networkservices.v1.HttpRoute.HeaderMatch.verify|verify} messages. + * @param message HeaderMatch message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.networkservices.v1.HttpRoute.IHeaderMatch, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a HeaderMatch message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns HeaderMatch + * @throws {Error} If the payload is not 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.networkservices.v1.HttpRoute.HeaderMatch; + + /** + * Decodes a HeaderMatch message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns HeaderMatch + * @throws {Error} If the payload 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.networkservices.v1.HttpRoute.HeaderMatch; + + /** + * Verifies a HeaderMatch message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a HeaderMatch message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns HeaderMatch + */ + public static fromObject(object: { [k: string]: any }): google.cloud.networkservices.v1.HttpRoute.HeaderMatch; + + /** + * Creates a plain object from a HeaderMatch message. Also converts values to other types if specified. + * @param message HeaderMatch + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.networkservices.v1.HttpRoute.HeaderMatch, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this HeaderMatch to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for HeaderMatch + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace HeaderMatch { + + /** Properties of an IntegerRange. */ + interface IIntegerRange { + + /** IntegerRange start */ + start?: (number|null); + + /** IntegerRange end */ + end?: (number|null); + } + + /** Represents an IntegerRange. */ + class IntegerRange implements IIntegerRange { + + /** + * Constructs a new IntegerRange. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.networkservices.v1.HttpRoute.HeaderMatch.IIntegerRange); + + /** IntegerRange start. */ + public start: number; + + /** IntegerRange end. */ + public end: number; + + /** + * Creates a new IntegerRange instance using the specified properties. + * @param [properties] Properties to set + * @returns IntegerRange instance + */ + public static create(properties?: google.cloud.networkservices.v1.HttpRoute.HeaderMatch.IIntegerRange): google.cloud.networkservices.v1.HttpRoute.HeaderMatch.IntegerRange; + + /** + * Encodes the specified IntegerRange message. Does not implicitly {@link google.cloud.networkservices.v1.HttpRoute.HeaderMatch.IntegerRange.verify|verify} messages. + * @param message IntegerRange message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.networkservices.v1.HttpRoute.HeaderMatch.IIntegerRange, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified IntegerRange message, length delimited. Does not implicitly {@link google.cloud.networkservices.v1.HttpRoute.HeaderMatch.IntegerRange.verify|verify} messages. + * @param message IntegerRange message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.networkservices.v1.HttpRoute.HeaderMatch.IIntegerRange, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an IntegerRange message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns IntegerRange + * @throws {Error} If the payload is not 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.networkservices.v1.HttpRoute.HeaderMatch.IntegerRange; + + /** + * Decodes an IntegerRange message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns IntegerRange + * @throws {Error} If the payload 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.networkservices.v1.HttpRoute.HeaderMatch.IntegerRange; + + /** + * Verifies an IntegerRange message. + * @param message Plain 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 IntegerRange message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns IntegerRange + */ + public static fromObject(object: { [k: string]: any }): google.cloud.networkservices.v1.HttpRoute.HeaderMatch.IntegerRange; + + /** + * Creates a plain object from an IntegerRange message. Also converts values to other types if specified. + * @param message IntegerRange + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.networkservices.v1.HttpRoute.HeaderMatch.IntegerRange, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this IntegerRange to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for IntegerRange + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Properties of a QueryParameterMatch. */ + interface IQueryParameterMatch { + + /** QueryParameterMatch exactMatch */ + exactMatch?: (string|null); + + /** QueryParameterMatch regexMatch */ + regexMatch?: (string|null); + + /** QueryParameterMatch presentMatch */ + presentMatch?: (boolean|null); + + /** QueryParameterMatch queryParameter */ + queryParameter?: (string|null); + } + + /** Represents a QueryParameterMatch. */ + class QueryParameterMatch implements IQueryParameterMatch { + + /** + * Constructs a new QueryParameterMatch. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.networkservices.v1.HttpRoute.IQueryParameterMatch); + + /** QueryParameterMatch exactMatch. */ + public exactMatch?: (string|null); + + /** QueryParameterMatch regexMatch. */ + public regexMatch?: (string|null); + + /** QueryParameterMatch presentMatch. */ + public presentMatch?: (boolean|null); + + /** QueryParameterMatch queryParameter. */ + public queryParameter: string; + + /** QueryParameterMatch MatchType. */ + public MatchType?: ("exactMatch"|"regexMatch"|"presentMatch"); + + /** + * Creates a new QueryParameterMatch instance using the specified properties. + * @param [properties] Properties to set + * @returns QueryParameterMatch instance + */ + public static create(properties?: google.cloud.networkservices.v1.HttpRoute.IQueryParameterMatch): google.cloud.networkservices.v1.HttpRoute.QueryParameterMatch; + + /** + * Encodes the specified QueryParameterMatch message. Does not implicitly {@link google.cloud.networkservices.v1.HttpRoute.QueryParameterMatch.verify|verify} messages. + * @param message QueryParameterMatch message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.networkservices.v1.HttpRoute.IQueryParameterMatch, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified QueryParameterMatch message, length delimited. Does not implicitly {@link google.cloud.networkservices.v1.HttpRoute.QueryParameterMatch.verify|verify} messages. + * @param message QueryParameterMatch message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.networkservices.v1.HttpRoute.IQueryParameterMatch, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a QueryParameterMatch message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns QueryParameterMatch + * @throws {Error} If the payload is not 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.networkservices.v1.HttpRoute.QueryParameterMatch; + + /** + * Decodes a QueryParameterMatch message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns QueryParameterMatch + * @throws {Error} If the payload 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.networkservices.v1.HttpRoute.QueryParameterMatch; + + /** + * Verifies a QueryParameterMatch message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a QueryParameterMatch message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns QueryParameterMatch + */ + public static fromObject(object: { [k: string]: any }): google.cloud.networkservices.v1.HttpRoute.QueryParameterMatch; + + /** + * Creates a plain object from a QueryParameterMatch message. Also converts values to other types if specified. + * @param message QueryParameterMatch + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.networkservices.v1.HttpRoute.QueryParameterMatch, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this QueryParameterMatch to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for QueryParameterMatch + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a RouteMatch. */ + interface IRouteMatch { + + /** RouteMatch fullPathMatch */ + fullPathMatch?: (string|null); + + /** RouteMatch prefixMatch */ + prefixMatch?: (string|null); + + /** RouteMatch regexMatch */ + regexMatch?: (string|null); + + /** RouteMatch ignoreCase */ + ignoreCase?: (boolean|null); + + /** RouteMatch headers */ + headers?: (google.cloud.networkservices.v1.HttpRoute.IHeaderMatch[]|null); + + /** RouteMatch queryParameters */ + queryParameters?: (google.cloud.networkservices.v1.HttpRoute.IQueryParameterMatch[]|null); + } + + /** Represents a RouteMatch. */ + class RouteMatch implements IRouteMatch { + + /** + * Constructs a new RouteMatch. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.networkservices.v1.HttpRoute.IRouteMatch); + + /** RouteMatch fullPathMatch. */ + public fullPathMatch?: (string|null); + + /** RouteMatch prefixMatch. */ + public prefixMatch?: (string|null); + + /** RouteMatch regexMatch. */ + public regexMatch?: (string|null); + + /** RouteMatch ignoreCase. */ + public ignoreCase: boolean; + + /** RouteMatch headers. */ + public headers: google.cloud.networkservices.v1.HttpRoute.IHeaderMatch[]; + + /** RouteMatch queryParameters. */ + public queryParameters: google.cloud.networkservices.v1.HttpRoute.IQueryParameterMatch[]; + + /** RouteMatch PathMatch. */ + public PathMatch?: ("fullPathMatch"|"prefixMatch"|"regexMatch"); + + /** + * Creates a new RouteMatch instance using the specified properties. + * @param [properties] Properties to set + * @returns RouteMatch instance + */ + public static create(properties?: google.cloud.networkservices.v1.HttpRoute.IRouteMatch): google.cloud.networkservices.v1.HttpRoute.RouteMatch; + + /** + * Encodes the specified RouteMatch message. Does not implicitly {@link google.cloud.networkservices.v1.HttpRoute.RouteMatch.verify|verify} messages. + * @param message RouteMatch message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.networkservices.v1.HttpRoute.IRouteMatch, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified RouteMatch message, length delimited. Does not implicitly {@link google.cloud.networkservices.v1.HttpRoute.RouteMatch.verify|verify} messages. + * @param message RouteMatch message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.networkservices.v1.HttpRoute.IRouteMatch, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a RouteMatch message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns RouteMatch + * @throws {Error} If the payload is not 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.networkservices.v1.HttpRoute.RouteMatch; + + /** + * Decodes a RouteMatch message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns RouteMatch + * @throws {Error} If the payload 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.networkservices.v1.HttpRoute.RouteMatch; + + /** + * Verifies a RouteMatch message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a RouteMatch message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns RouteMatch + */ + public static fromObject(object: { [k: string]: any }): google.cloud.networkservices.v1.HttpRoute.RouteMatch; + + /** + * Creates a plain object from a RouteMatch message. Also converts values to other types if specified. + * @param message RouteMatch + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.networkservices.v1.HttpRoute.RouteMatch, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this RouteMatch to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for RouteMatch + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Destination. */ + interface IDestination { + + /** Destination serviceName */ + serviceName?: (string|null); + + /** Destination weight */ + weight?: (number|null); + } + + /** Represents a Destination. */ + class Destination implements IDestination { + + /** + * Constructs a new Destination. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.networkservices.v1.HttpRoute.IDestination); + + /** Destination serviceName. */ + public serviceName: string; + + /** Destination weight. */ + public weight: number; + + /** + * Creates a new Destination instance using the specified properties. + * @param [properties] Properties to set + * @returns Destination instance + */ + public static create(properties?: google.cloud.networkservices.v1.HttpRoute.IDestination): google.cloud.networkservices.v1.HttpRoute.Destination; + + /** + * Encodes the specified Destination message. Does not implicitly {@link google.cloud.networkservices.v1.HttpRoute.Destination.verify|verify} messages. + * @param message Destination message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.networkservices.v1.HttpRoute.IDestination, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Destination message, length delimited. Does not implicitly {@link google.cloud.networkservices.v1.HttpRoute.Destination.verify|verify} messages. + * @param message Destination message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.networkservices.v1.HttpRoute.IDestination, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Destination message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Destination + * @throws {Error} If the payload is not 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.networkservices.v1.HttpRoute.Destination; + + /** + * Decodes a Destination message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Destination + * @throws {Error} If the payload 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.networkservices.v1.HttpRoute.Destination; + + /** + * Verifies a Destination message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Destination message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Destination + */ + public static fromObject(object: { [k: string]: any }): google.cloud.networkservices.v1.HttpRoute.Destination; + + /** + * Creates a plain object from a Destination message. Also converts values to other types if specified. + * @param message Destination + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.networkservices.v1.HttpRoute.Destination, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Destination to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Destination + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Redirect. */ + interface IRedirect { + + /** Redirect hostRedirect */ + hostRedirect?: (string|null); + + /** Redirect pathRedirect */ + pathRedirect?: (string|null); + + /** Redirect prefixRewrite */ + prefixRewrite?: (string|null); + + /** Redirect responseCode */ + responseCode?: (google.cloud.networkservices.v1.HttpRoute.Redirect.ResponseCode|keyof typeof google.cloud.networkservices.v1.HttpRoute.Redirect.ResponseCode|null); + + /** Redirect httpsRedirect */ + httpsRedirect?: (boolean|null); + + /** Redirect stripQuery */ + stripQuery?: (boolean|null); + + /** Redirect portRedirect */ + portRedirect?: (number|null); + } + + /** Represents a Redirect. */ + class Redirect implements IRedirect { + + /** + * Constructs a new Redirect. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.networkservices.v1.HttpRoute.IRedirect); + + /** Redirect hostRedirect. */ + public hostRedirect: string; + + /** Redirect pathRedirect. */ + public pathRedirect: string; + + /** Redirect prefixRewrite. */ + public prefixRewrite: string; + + /** Redirect responseCode. */ + public responseCode: (google.cloud.networkservices.v1.HttpRoute.Redirect.ResponseCode|keyof typeof google.cloud.networkservices.v1.HttpRoute.Redirect.ResponseCode); + + /** Redirect httpsRedirect. */ + public httpsRedirect: boolean; + + /** Redirect stripQuery. */ + public stripQuery: boolean; + + /** Redirect portRedirect. */ + public portRedirect: number; + + /** + * Creates a new Redirect instance using the specified properties. + * @param [properties] Properties to set + * @returns Redirect instance + */ + public static create(properties?: google.cloud.networkservices.v1.HttpRoute.IRedirect): google.cloud.networkservices.v1.HttpRoute.Redirect; + + /** + * Encodes the specified Redirect message. Does not implicitly {@link google.cloud.networkservices.v1.HttpRoute.Redirect.verify|verify} messages. + * @param message Redirect message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.networkservices.v1.HttpRoute.IRedirect, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Redirect message, length delimited. Does not implicitly {@link google.cloud.networkservices.v1.HttpRoute.Redirect.verify|verify} messages. + * @param message Redirect message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.networkservices.v1.HttpRoute.IRedirect, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Redirect message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Redirect + * @throws {Error} If the payload is not 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.networkservices.v1.HttpRoute.Redirect; + + /** + * Decodes a Redirect message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Redirect + * @throws {Error} If the payload 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.networkservices.v1.HttpRoute.Redirect; + + /** + * Verifies a Redirect message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Redirect message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Redirect + */ + public static fromObject(object: { [k: string]: any }): google.cloud.networkservices.v1.HttpRoute.Redirect; + + /** + * Creates a plain object from a Redirect message. Also converts values to other types if specified. + * @param message Redirect + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.networkservices.v1.HttpRoute.Redirect, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Redirect to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Redirect + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace Redirect { + + /** ResponseCode enum. */ + enum ResponseCode { + RESPONSE_CODE_UNSPECIFIED = 0, + MOVED_PERMANENTLY_DEFAULT = 1, + FOUND = 2, + SEE_OTHER = 3, + TEMPORARY_REDIRECT = 4, + PERMANENT_REDIRECT = 5 + } + } + + /** Properties of a FaultInjectionPolicy. */ + interface IFaultInjectionPolicy { + + /** FaultInjectionPolicy delay */ + delay?: (google.cloud.networkservices.v1.HttpRoute.FaultInjectionPolicy.IDelay|null); + + /** FaultInjectionPolicy abort */ + abort?: (google.cloud.networkservices.v1.HttpRoute.FaultInjectionPolicy.IAbort|null); + } + + /** Represents a FaultInjectionPolicy. */ + class FaultInjectionPolicy implements IFaultInjectionPolicy { + + /** + * Constructs a new FaultInjectionPolicy. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.networkservices.v1.HttpRoute.IFaultInjectionPolicy); + + /** FaultInjectionPolicy delay. */ + public delay?: (google.cloud.networkservices.v1.HttpRoute.FaultInjectionPolicy.IDelay|null); + + /** FaultInjectionPolicy abort. */ + public abort?: (google.cloud.networkservices.v1.HttpRoute.FaultInjectionPolicy.IAbort|null); + + /** + * Creates a new FaultInjectionPolicy instance using the specified properties. + * @param [properties] Properties to set + * @returns FaultInjectionPolicy instance + */ + public static create(properties?: google.cloud.networkservices.v1.HttpRoute.IFaultInjectionPolicy): google.cloud.networkservices.v1.HttpRoute.FaultInjectionPolicy; + + /** + * Encodes the specified FaultInjectionPolicy message. Does not implicitly {@link google.cloud.networkservices.v1.HttpRoute.FaultInjectionPolicy.verify|verify} messages. + * @param message FaultInjectionPolicy message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.networkservices.v1.HttpRoute.IFaultInjectionPolicy, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified FaultInjectionPolicy message, length delimited. Does not implicitly {@link google.cloud.networkservices.v1.HttpRoute.FaultInjectionPolicy.verify|verify} messages. + * @param message FaultInjectionPolicy message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.networkservices.v1.HttpRoute.IFaultInjectionPolicy, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FaultInjectionPolicy message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns FaultInjectionPolicy + * @throws {Error} If the payload is not 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.networkservices.v1.HttpRoute.FaultInjectionPolicy; + + /** + * Decodes a FaultInjectionPolicy message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns FaultInjectionPolicy + * @throws {Error} If the payload 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.networkservices.v1.HttpRoute.FaultInjectionPolicy; + + /** + * Verifies a FaultInjectionPolicy message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a FaultInjectionPolicy message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns FaultInjectionPolicy + */ + public static fromObject(object: { [k: string]: any }): google.cloud.networkservices.v1.HttpRoute.FaultInjectionPolicy; + + /** + * Creates a plain object from a FaultInjectionPolicy message. Also converts values to other types if specified. + * @param message FaultInjectionPolicy + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.networkservices.v1.HttpRoute.FaultInjectionPolicy, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this FaultInjectionPolicy to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for FaultInjectionPolicy + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace FaultInjectionPolicy { + + /** Properties of a Delay. */ + interface IDelay { + + /** Delay fixedDelay */ + fixedDelay?: (google.protobuf.IDuration|null); + + /** Delay percentage */ + percentage?: (number|null); + } + + /** Represents a Delay. */ + class Delay implements IDelay { + + /** + * Constructs a new Delay. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.networkservices.v1.HttpRoute.FaultInjectionPolicy.IDelay); + + /** Delay fixedDelay. */ + public fixedDelay?: (google.protobuf.IDuration|null); + + /** Delay percentage. */ + public percentage: number; + + /** + * Creates a new Delay instance using the specified properties. + * @param [properties] Properties to set + * @returns Delay instance + */ + public static create(properties?: google.cloud.networkservices.v1.HttpRoute.FaultInjectionPolicy.IDelay): google.cloud.networkservices.v1.HttpRoute.FaultInjectionPolicy.Delay; + + /** + * Encodes the specified Delay message. Does not implicitly {@link google.cloud.networkservices.v1.HttpRoute.FaultInjectionPolicy.Delay.verify|verify} messages. + * @param message Delay message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.networkservices.v1.HttpRoute.FaultInjectionPolicy.IDelay, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Delay message, length delimited. Does not implicitly {@link google.cloud.networkservices.v1.HttpRoute.FaultInjectionPolicy.Delay.verify|verify} messages. + * @param message Delay message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.networkservices.v1.HttpRoute.FaultInjectionPolicy.IDelay, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Delay message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Delay + * @throws {Error} If the payload is not 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.networkservices.v1.HttpRoute.FaultInjectionPolicy.Delay; + + /** + * Decodes a Delay message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Delay + * @throws {Error} If the payload 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.networkservices.v1.HttpRoute.FaultInjectionPolicy.Delay; + + /** + * Verifies a Delay message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Delay message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Delay + */ + public static fromObject(object: { [k: string]: any }): google.cloud.networkservices.v1.HttpRoute.FaultInjectionPolicy.Delay; + + /** + * Creates a plain object from a Delay message. Also converts values to other types if specified. + * @param message Delay + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.networkservices.v1.HttpRoute.FaultInjectionPolicy.Delay, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Delay to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Delay + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an Abort. */ + interface IAbort { + + /** Abort httpStatus */ + httpStatus?: (number|null); + + /** Abort percentage */ + percentage?: (number|null); + } + + /** Represents an Abort. */ + class Abort implements IAbort { + + /** + * Constructs a new Abort. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.networkservices.v1.HttpRoute.FaultInjectionPolicy.IAbort); + + /** Abort httpStatus. */ + public httpStatus: number; + + /** Abort percentage. */ + public percentage: number; + + /** + * Creates a new Abort instance using the specified properties. + * @param [properties] Properties to set + * @returns Abort instance + */ + public static create(properties?: google.cloud.networkservices.v1.HttpRoute.FaultInjectionPolicy.IAbort): google.cloud.networkservices.v1.HttpRoute.FaultInjectionPolicy.Abort; + + /** + * Encodes the specified Abort message. Does not implicitly {@link google.cloud.networkservices.v1.HttpRoute.FaultInjectionPolicy.Abort.verify|verify} messages. + * @param message Abort message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.networkservices.v1.HttpRoute.FaultInjectionPolicy.IAbort, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Abort message, length delimited. Does not implicitly {@link google.cloud.networkservices.v1.HttpRoute.FaultInjectionPolicy.Abort.verify|verify} messages. + * @param message Abort message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.networkservices.v1.HttpRoute.FaultInjectionPolicy.IAbort, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an Abort message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Abort + * @throws {Error} If the payload is not 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.networkservices.v1.HttpRoute.FaultInjectionPolicy.Abort; + + /** + * Decodes an Abort message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Abort + * @throws {Error} If the payload 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.networkservices.v1.HttpRoute.FaultInjectionPolicy.Abort; + + /** + * Verifies an Abort message. + * @param message Plain 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 Abort message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Abort + */ + public static fromObject(object: { [k: string]: any }): google.cloud.networkservices.v1.HttpRoute.FaultInjectionPolicy.Abort; + + /** + * Creates a plain object from an Abort message. Also converts values to other types if specified. + * @param message Abort + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.networkservices.v1.HttpRoute.FaultInjectionPolicy.Abort, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Abort to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Abort + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Properties of a HeaderModifier. */ + interface IHeaderModifier { + + /** HeaderModifier set */ + set?: ({ [k: string]: string }|null); + + /** HeaderModifier add */ + add?: ({ [k: string]: string }|null); + + /** HeaderModifier remove */ + remove?: (string[]|null); + } + + /** Represents a HeaderModifier. */ + class HeaderModifier implements IHeaderModifier { + + /** + * Constructs a new HeaderModifier. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.networkservices.v1.HttpRoute.IHeaderModifier); + + /** HeaderModifier set. */ + public set: { [k: string]: string }; + + /** HeaderModifier add. */ + public add: { [k: string]: string }; + + /** HeaderModifier remove. */ + public remove: string[]; + + /** + * Creates a new HeaderModifier instance using the specified properties. + * @param [properties] Properties to set + * @returns HeaderModifier instance + */ + public static create(properties?: google.cloud.networkservices.v1.HttpRoute.IHeaderModifier): google.cloud.networkservices.v1.HttpRoute.HeaderModifier; + + /** + * Encodes the specified HeaderModifier message. Does not implicitly {@link google.cloud.networkservices.v1.HttpRoute.HeaderModifier.verify|verify} messages. + * @param message HeaderModifier message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.networkservices.v1.HttpRoute.IHeaderModifier, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified HeaderModifier message, length delimited. Does not implicitly {@link google.cloud.networkservices.v1.HttpRoute.HeaderModifier.verify|verify} messages. + * @param message HeaderModifier message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.networkservices.v1.HttpRoute.IHeaderModifier, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a HeaderModifier message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns HeaderModifier + * @throws {Error} If the payload is not 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.networkservices.v1.HttpRoute.HeaderModifier; + + /** + * Decodes a HeaderModifier message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns HeaderModifier + * @throws {Error} If the payload 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.networkservices.v1.HttpRoute.HeaderModifier; + + /** + * Verifies a HeaderModifier message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a HeaderModifier message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns HeaderModifier + */ + public static fromObject(object: { [k: string]: any }): google.cloud.networkservices.v1.HttpRoute.HeaderModifier; + + /** + * Creates a plain object from a HeaderModifier message. Also converts values to other types if specified. + * @param message HeaderModifier + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.networkservices.v1.HttpRoute.HeaderModifier, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this HeaderModifier to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for HeaderModifier + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a URLRewrite. */ + interface IURLRewrite { + + /** URLRewrite pathPrefixRewrite */ + pathPrefixRewrite?: (string|null); + + /** URLRewrite hostRewrite */ + hostRewrite?: (string|null); + } + + /** Represents a URLRewrite. */ + class URLRewrite implements IURLRewrite { + + /** + * Constructs a new URLRewrite. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.networkservices.v1.HttpRoute.IURLRewrite); + + /** URLRewrite pathPrefixRewrite. */ + public pathPrefixRewrite: string; + + /** URLRewrite hostRewrite. */ + public hostRewrite: string; + + /** + * Creates a new URLRewrite instance using the specified properties. + * @param [properties] Properties to set + * @returns URLRewrite instance + */ + public static create(properties?: google.cloud.networkservices.v1.HttpRoute.IURLRewrite): google.cloud.networkservices.v1.HttpRoute.URLRewrite; + + /** + * Encodes the specified URLRewrite message. Does not implicitly {@link google.cloud.networkservices.v1.HttpRoute.URLRewrite.verify|verify} messages. + * @param message URLRewrite message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.networkservices.v1.HttpRoute.IURLRewrite, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified URLRewrite message, length delimited. Does not implicitly {@link google.cloud.networkservices.v1.HttpRoute.URLRewrite.verify|verify} messages. + * @param message URLRewrite message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.networkservices.v1.HttpRoute.IURLRewrite, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a URLRewrite message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns URLRewrite + * @throws {Error} If the payload is not 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.networkservices.v1.HttpRoute.URLRewrite; + + /** + * Decodes a URLRewrite message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns URLRewrite + * @throws {Error} If the payload 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.networkservices.v1.HttpRoute.URLRewrite; + + /** + * Verifies a URLRewrite message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a URLRewrite message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns URLRewrite + */ + public static fromObject(object: { [k: string]: any }): google.cloud.networkservices.v1.HttpRoute.URLRewrite; + + /** + * Creates a plain object from a URLRewrite message. Also converts values to other types if specified. + * @param message URLRewrite + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.networkservices.v1.HttpRoute.URLRewrite, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this URLRewrite to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for URLRewrite + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a RetryPolicy. */ + interface IRetryPolicy { + + /** RetryPolicy retryConditions */ + retryConditions?: (string[]|null); + + /** RetryPolicy numRetries */ + numRetries?: (number|null); + + /** RetryPolicy perTryTimeout */ + perTryTimeout?: (google.protobuf.IDuration|null); + } + + /** Represents a RetryPolicy. */ + class RetryPolicy implements IRetryPolicy { + + /** + * Constructs a new RetryPolicy. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.networkservices.v1.HttpRoute.IRetryPolicy); + + /** RetryPolicy retryConditions. */ + public retryConditions: string[]; + + /** RetryPolicy numRetries. */ + public numRetries: number; + + /** RetryPolicy perTryTimeout. */ + public perTryTimeout?: (google.protobuf.IDuration|null); + + /** + * Creates a new RetryPolicy instance using the specified properties. + * @param [properties] Properties to set + * @returns RetryPolicy instance + */ + public static create(properties?: google.cloud.networkservices.v1.HttpRoute.IRetryPolicy): google.cloud.networkservices.v1.HttpRoute.RetryPolicy; + + /** + * Encodes the specified RetryPolicy message. Does not implicitly {@link google.cloud.networkservices.v1.HttpRoute.RetryPolicy.verify|verify} messages. + * @param message RetryPolicy message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.networkservices.v1.HttpRoute.IRetryPolicy, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified RetryPolicy message, length delimited. Does not implicitly {@link google.cloud.networkservices.v1.HttpRoute.RetryPolicy.verify|verify} messages. + * @param message RetryPolicy message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.networkservices.v1.HttpRoute.IRetryPolicy, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a RetryPolicy message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns RetryPolicy + * @throws {Error} If the payload is not 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.networkservices.v1.HttpRoute.RetryPolicy; + + /** + * Decodes a RetryPolicy message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns RetryPolicy + * @throws {Error} If the payload 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.networkservices.v1.HttpRoute.RetryPolicy; + + /** + * Verifies a RetryPolicy message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a RetryPolicy message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns RetryPolicy + */ + public static fromObject(object: { [k: string]: any }): google.cloud.networkservices.v1.HttpRoute.RetryPolicy; + + /** + * Creates a plain object from a RetryPolicy message. Also converts values to other types if specified. + * @param message RetryPolicy + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.networkservices.v1.HttpRoute.RetryPolicy, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this RetryPolicy to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for RetryPolicy + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a RequestMirrorPolicy. */ + interface IRequestMirrorPolicy { + + /** RequestMirrorPolicy destination */ + destination?: (google.cloud.networkservices.v1.HttpRoute.IDestination|null); + } + + /** Represents a RequestMirrorPolicy. */ + class RequestMirrorPolicy implements IRequestMirrorPolicy { + + /** + * Constructs a new RequestMirrorPolicy. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.networkservices.v1.HttpRoute.IRequestMirrorPolicy); + + /** RequestMirrorPolicy destination. */ + public destination?: (google.cloud.networkservices.v1.HttpRoute.IDestination|null); + + /** + * Creates a new RequestMirrorPolicy instance using the specified properties. + * @param [properties] Properties to set + * @returns RequestMirrorPolicy instance + */ + public static create(properties?: google.cloud.networkservices.v1.HttpRoute.IRequestMirrorPolicy): google.cloud.networkservices.v1.HttpRoute.RequestMirrorPolicy; + + /** + * Encodes the specified RequestMirrorPolicy message. Does not implicitly {@link google.cloud.networkservices.v1.HttpRoute.RequestMirrorPolicy.verify|verify} messages. + * @param message RequestMirrorPolicy message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.networkservices.v1.HttpRoute.IRequestMirrorPolicy, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified RequestMirrorPolicy message, length delimited. Does not implicitly {@link google.cloud.networkservices.v1.HttpRoute.RequestMirrorPolicy.verify|verify} messages. + * @param message RequestMirrorPolicy message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.networkservices.v1.HttpRoute.IRequestMirrorPolicy, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a RequestMirrorPolicy message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns RequestMirrorPolicy + * @throws {Error} If the payload is not 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.networkservices.v1.HttpRoute.RequestMirrorPolicy; + + /** + * Decodes a RequestMirrorPolicy message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns RequestMirrorPolicy + * @throws {Error} If the payload 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.networkservices.v1.HttpRoute.RequestMirrorPolicy; + + /** + * Verifies a RequestMirrorPolicy message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a RequestMirrorPolicy message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns RequestMirrorPolicy + */ + public static fromObject(object: { [k: string]: any }): google.cloud.networkservices.v1.HttpRoute.RequestMirrorPolicy; + + /** + * Creates a plain object from a RequestMirrorPolicy message. Also converts values to other types if specified. + * @param message RequestMirrorPolicy + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.networkservices.v1.HttpRoute.RequestMirrorPolicy, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this RequestMirrorPolicy to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for RequestMirrorPolicy + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a CorsPolicy. */ + interface ICorsPolicy { + + /** CorsPolicy allowOrigins */ + allowOrigins?: (string[]|null); + + /** CorsPolicy allowOriginRegexes */ + allowOriginRegexes?: (string[]|null); + + /** CorsPolicy allowMethods */ + allowMethods?: (string[]|null); + + /** CorsPolicy allowHeaders */ + allowHeaders?: (string[]|null); + + /** CorsPolicy exposeHeaders */ + exposeHeaders?: (string[]|null); + + /** CorsPolicy maxAge */ + maxAge?: (string|null); + + /** CorsPolicy allowCredentials */ + allowCredentials?: (boolean|null); + + /** CorsPolicy disabled */ + disabled?: (boolean|null); + } + + /** Represents a CorsPolicy. */ + class CorsPolicy implements ICorsPolicy { + + /** + * Constructs a new CorsPolicy. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.networkservices.v1.HttpRoute.ICorsPolicy); + + /** CorsPolicy allowOrigins. */ + public allowOrigins: string[]; + + /** CorsPolicy allowOriginRegexes. */ + public allowOriginRegexes: string[]; + + /** CorsPolicy allowMethods. */ + public allowMethods: string[]; + + /** CorsPolicy allowHeaders. */ + public allowHeaders: string[]; + + /** CorsPolicy exposeHeaders. */ + public exposeHeaders: string[]; + + /** CorsPolicy maxAge. */ + public maxAge: string; + + /** CorsPolicy allowCredentials. */ + public allowCredentials: boolean; + + /** CorsPolicy disabled. */ + public disabled: boolean; + + /** + * Creates a new CorsPolicy instance using the specified properties. + * @param [properties] Properties to set + * @returns CorsPolicy instance + */ + public static create(properties?: google.cloud.networkservices.v1.HttpRoute.ICorsPolicy): google.cloud.networkservices.v1.HttpRoute.CorsPolicy; + + /** + * Encodes the specified CorsPolicy message. Does not implicitly {@link google.cloud.networkservices.v1.HttpRoute.CorsPolicy.verify|verify} messages. + * @param message CorsPolicy message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.networkservices.v1.HttpRoute.ICorsPolicy, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CorsPolicy message, length delimited. Does not implicitly {@link google.cloud.networkservices.v1.HttpRoute.CorsPolicy.verify|verify} messages. + * @param message CorsPolicy message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.networkservices.v1.HttpRoute.ICorsPolicy, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CorsPolicy message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CorsPolicy + * @throws {Error} If the payload is not 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.networkservices.v1.HttpRoute.CorsPolicy; + + /** + * Decodes a CorsPolicy message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CorsPolicy + * @throws {Error} If the payload 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.networkservices.v1.HttpRoute.CorsPolicy; + + /** + * Verifies a CorsPolicy message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CorsPolicy message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CorsPolicy + */ + public static fromObject(object: { [k: string]: any }): google.cloud.networkservices.v1.HttpRoute.CorsPolicy; + + /** + * Creates a plain object from a CorsPolicy message. Also converts values to other types if specified. + * @param message CorsPolicy + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.networkservices.v1.HttpRoute.CorsPolicy, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CorsPolicy to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CorsPolicy + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a RouteAction. */ + interface IRouteAction { + + /** RouteAction destinations */ + destinations?: (google.cloud.networkservices.v1.HttpRoute.IDestination[]|null); + + /** RouteAction redirect */ + redirect?: (google.cloud.networkservices.v1.HttpRoute.IRedirect|null); + + /** RouteAction faultInjectionPolicy */ + faultInjectionPolicy?: (google.cloud.networkservices.v1.HttpRoute.IFaultInjectionPolicy|null); + + /** RouteAction requestHeaderModifier */ + requestHeaderModifier?: (google.cloud.networkservices.v1.HttpRoute.IHeaderModifier|null); + + /** RouteAction responseHeaderModifier */ + responseHeaderModifier?: (google.cloud.networkservices.v1.HttpRoute.IHeaderModifier|null); + + /** RouteAction urlRewrite */ + urlRewrite?: (google.cloud.networkservices.v1.HttpRoute.IURLRewrite|null); + + /** RouteAction timeout */ + timeout?: (google.protobuf.IDuration|null); + + /** RouteAction retryPolicy */ + retryPolicy?: (google.cloud.networkservices.v1.HttpRoute.IRetryPolicy|null); + + /** RouteAction requestMirrorPolicy */ + requestMirrorPolicy?: (google.cloud.networkservices.v1.HttpRoute.IRequestMirrorPolicy|null); + + /** RouteAction corsPolicy */ + corsPolicy?: (google.cloud.networkservices.v1.HttpRoute.ICorsPolicy|null); + } + + /** Represents a RouteAction. */ + class RouteAction implements IRouteAction { + + /** + * Constructs a new RouteAction. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.networkservices.v1.HttpRoute.IRouteAction); + + /** RouteAction destinations. */ + public destinations: google.cloud.networkservices.v1.HttpRoute.IDestination[]; + + /** RouteAction redirect. */ + public redirect?: (google.cloud.networkservices.v1.HttpRoute.IRedirect|null); + + /** RouteAction faultInjectionPolicy. */ + public faultInjectionPolicy?: (google.cloud.networkservices.v1.HttpRoute.IFaultInjectionPolicy|null); + + /** RouteAction requestHeaderModifier. */ + public requestHeaderModifier?: (google.cloud.networkservices.v1.HttpRoute.IHeaderModifier|null); + + /** RouteAction responseHeaderModifier. */ + public responseHeaderModifier?: (google.cloud.networkservices.v1.HttpRoute.IHeaderModifier|null); + + /** RouteAction urlRewrite. */ + public urlRewrite?: (google.cloud.networkservices.v1.HttpRoute.IURLRewrite|null); + + /** RouteAction timeout. */ + public timeout?: (google.protobuf.IDuration|null); + + /** RouteAction retryPolicy. */ + public retryPolicy?: (google.cloud.networkservices.v1.HttpRoute.IRetryPolicy|null); + + /** RouteAction requestMirrorPolicy. */ + public requestMirrorPolicy?: (google.cloud.networkservices.v1.HttpRoute.IRequestMirrorPolicy|null); + + /** RouteAction corsPolicy. */ + public corsPolicy?: (google.cloud.networkservices.v1.HttpRoute.ICorsPolicy|null); + + /** + * Creates a new RouteAction instance using the specified properties. + * @param [properties] Properties to set + * @returns RouteAction instance + */ + public static create(properties?: google.cloud.networkservices.v1.HttpRoute.IRouteAction): google.cloud.networkservices.v1.HttpRoute.RouteAction; + + /** + * Encodes the specified RouteAction message. Does not implicitly {@link google.cloud.networkservices.v1.HttpRoute.RouteAction.verify|verify} messages. + * @param message RouteAction message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.networkservices.v1.HttpRoute.IRouteAction, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified RouteAction message, length delimited. Does not implicitly {@link google.cloud.networkservices.v1.HttpRoute.RouteAction.verify|verify} messages. + * @param message RouteAction message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.networkservices.v1.HttpRoute.IRouteAction, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a RouteAction message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns RouteAction + * @throws {Error} If the payload is not 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.networkservices.v1.HttpRoute.RouteAction; + + /** + * Decodes a RouteAction message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns RouteAction + * @throws {Error} If the payload 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.networkservices.v1.HttpRoute.RouteAction; + + /** + * Verifies a RouteAction message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a RouteAction message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns RouteAction + */ + public static fromObject(object: { [k: string]: any }): google.cloud.networkservices.v1.HttpRoute.RouteAction; + + /** + * Creates a plain object from a RouteAction message. Also converts values to other types if specified. + * @param message RouteAction + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.networkservices.v1.HttpRoute.RouteAction, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this RouteAction to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for RouteAction + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a RouteRule. */ + interface IRouteRule { + + /** RouteRule matches */ + matches?: (google.cloud.networkservices.v1.HttpRoute.IRouteMatch[]|null); + + /** RouteRule action */ + action?: (google.cloud.networkservices.v1.HttpRoute.IRouteAction|null); + } + + /** Represents a RouteRule. */ + class RouteRule implements IRouteRule { + + /** + * Constructs a new RouteRule. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.networkservices.v1.HttpRoute.IRouteRule); + + /** RouteRule matches. */ + public matches: google.cloud.networkservices.v1.HttpRoute.IRouteMatch[]; + + /** RouteRule action. */ + public action?: (google.cloud.networkservices.v1.HttpRoute.IRouteAction|null); + + /** + * Creates a new RouteRule instance using the specified properties. + * @param [properties] Properties to set + * @returns RouteRule instance + */ + public static create(properties?: google.cloud.networkservices.v1.HttpRoute.IRouteRule): google.cloud.networkservices.v1.HttpRoute.RouteRule; + + /** + * Encodes the specified RouteRule message. Does not implicitly {@link google.cloud.networkservices.v1.HttpRoute.RouteRule.verify|verify} messages. + * @param message RouteRule message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.networkservices.v1.HttpRoute.IRouteRule, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified RouteRule message, length delimited. Does not implicitly {@link google.cloud.networkservices.v1.HttpRoute.RouteRule.verify|verify} messages. + * @param message RouteRule message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.networkservices.v1.HttpRoute.IRouteRule, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a RouteRule message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns RouteRule + * @throws {Error} If the payload is not 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.networkservices.v1.HttpRoute.RouteRule; + + /** + * Decodes a RouteRule message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns RouteRule + * @throws {Error} If the payload 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.networkservices.v1.HttpRoute.RouteRule; + + /** + * Verifies a RouteRule message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a RouteRule message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns RouteRule + */ + public static fromObject(object: { [k: string]: any }): google.cloud.networkservices.v1.HttpRoute.RouteRule; + + /** + * Creates a plain object from a RouteRule message. Also converts values to other types if specified. + * @param message RouteRule + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.networkservices.v1.HttpRoute.RouteRule, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this RouteRule to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for RouteRule + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Properties of a ListHttpRoutesRequest. */ + interface IListHttpRoutesRequest { + + /** ListHttpRoutesRequest parent */ + parent?: (string|null); + + /** ListHttpRoutesRequest pageSize */ + pageSize?: (number|null); + + /** ListHttpRoutesRequest pageToken */ + pageToken?: (string|null); + } + + /** Represents a ListHttpRoutesRequest. */ + class ListHttpRoutesRequest implements IListHttpRoutesRequest { + + /** + * Constructs a new ListHttpRoutesRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.networkservices.v1.IListHttpRoutesRequest); + + /** ListHttpRoutesRequest parent. */ + public parent: string; + + /** ListHttpRoutesRequest pageSize. */ + public pageSize: number; + + /** ListHttpRoutesRequest pageToken. */ + public pageToken: string; + + /** + * Creates a new ListHttpRoutesRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ListHttpRoutesRequest instance + */ + public static create(properties?: google.cloud.networkservices.v1.IListHttpRoutesRequest): google.cloud.networkservices.v1.ListHttpRoutesRequest; + + /** + * Encodes the specified ListHttpRoutesRequest message. Does not implicitly {@link google.cloud.networkservices.v1.ListHttpRoutesRequest.verify|verify} messages. + * @param message ListHttpRoutesRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.networkservices.v1.IListHttpRoutesRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListHttpRoutesRequest message, length delimited. Does not implicitly {@link google.cloud.networkservices.v1.ListHttpRoutesRequest.verify|verify} messages. + * @param message ListHttpRoutesRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.networkservices.v1.IListHttpRoutesRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListHttpRoutesRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListHttpRoutesRequest + * @throws {Error} If the payload is not 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.networkservices.v1.ListHttpRoutesRequest; + + /** + * Decodes a ListHttpRoutesRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListHttpRoutesRequest + * @throws {Error} If the payload 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.networkservices.v1.ListHttpRoutesRequest; + + /** + * Verifies a ListHttpRoutesRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListHttpRoutesRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListHttpRoutesRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.networkservices.v1.ListHttpRoutesRequest; + + /** + * Creates a plain object from a ListHttpRoutesRequest message. Also converts values to other types if specified. + * @param message ListHttpRoutesRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.networkservices.v1.ListHttpRoutesRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListHttpRoutesRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListHttpRoutesRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListHttpRoutesResponse. */ + interface IListHttpRoutesResponse { + + /** ListHttpRoutesResponse httpRoutes */ + httpRoutes?: (google.cloud.networkservices.v1.IHttpRoute[]|null); + + /** ListHttpRoutesResponse nextPageToken */ + nextPageToken?: (string|null); + } + + /** Represents a ListHttpRoutesResponse. */ + class ListHttpRoutesResponse implements IListHttpRoutesResponse { + + /** + * Constructs a new ListHttpRoutesResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.networkservices.v1.IListHttpRoutesResponse); + + /** ListHttpRoutesResponse httpRoutes. */ + public httpRoutes: google.cloud.networkservices.v1.IHttpRoute[]; + + /** ListHttpRoutesResponse nextPageToken. */ + public nextPageToken: string; + + /** + * Creates a new ListHttpRoutesResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ListHttpRoutesResponse instance + */ + public static create(properties?: google.cloud.networkservices.v1.IListHttpRoutesResponse): google.cloud.networkservices.v1.ListHttpRoutesResponse; + + /** + * Encodes the specified ListHttpRoutesResponse message. Does not implicitly {@link google.cloud.networkservices.v1.ListHttpRoutesResponse.verify|verify} messages. + * @param message ListHttpRoutesResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.networkservices.v1.IListHttpRoutesResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListHttpRoutesResponse message, length delimited. Does not implicitly {@link google.cloud.networkservices.v1.ListHttpRoutesResponse.verify|verify} messages. + * @param message ListHttpRoutesResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.networkservices.v1.IListHttpRoutesResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListHttpRoutesResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListHttpRoutesResponse + * @throws {Error} If the payload is not 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.networkservices.v1.ListHttpRoutesResponse; + + /** + * Decodes a ListHttpRoutesResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListHttpRoutesResponse + * @throws {Error} If the payload 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.networkservices.v1.ListHttpRoutesResponse; + + /** + * Verifies a ListHttpRoutesResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListHttpRoutesResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListHttpRoutesResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.networkservices.v1.ListHttpRoutesResponse; + + /** + * Creates a plain object from a ListHttpRoutesResponse message. Also converts values to other types if specified. + * @param message ListHttpRoutesResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.networkservices.v1.ListHttpRoutesResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListHttpRoutesResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListHttpRoutesResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a GetHttpRouteRequest. */ + interface IGetHttpRouteRequest { + + /** GetHttpRouteRequest name */ + name?: (string|null); + } + + /** Represents a GetHttpRouteRequest. */ + class GetHttpRouteRequest implements IGetHttpRouteRequest { + + /** + * Constructs a new GetHttpRouteRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.networkservices.v1.IGetHttpRouteRequest); + + /** GetHttpRouteRequest name. */ + public name: string; + + /** + * Creates a new GetHttpRouteRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GetHttpRouteRequest instance + */ + public static create(properties?: google.cloud.networkservices.v1.IGetHttpRouteRequest): google.cloud.networkservices.v1.GetHttpRouteRequest; + + /** + * Encodes the specified GetHttpRouteRequest message. Does not implicitly {@link google.cloud.networkservices.v1.GetHttpRouteRequest.verify|verify} messages. + * @param message GetHttpRouteRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.networkservices.v1.IGetHttpRouteRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GetHttpRouteRequest message, length delimited. Does not implicitly {@link google.cloud.networkservices.v1.GetHttpRouteRequest.verify|verify} messages. + * @param message GetHttpRouteRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.networkservices.v1.IGetHttpRouteRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GetHttpRouteRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GetHttpRouteRequest + * @throws {Error} If the payload is not 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.networkservices.v1.GetHttpRouteRequest; + + /** + * Decodes a GetHttpRouteRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GetHttpRouteRequest + * @throws {Error} If the payload 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.networkservices.v1.GetHttpRouteRequest; + + /** + * Verifies a GetHttpRouteRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GetHttpRouteRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GetHttpRouteRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.networkservices.v1.GetHttpRouteRequest; + + /** + * Creates a plain object from a GetHttpRouteRequest message. Also converts values to other types if specified. + * @param message GetHttpRouteRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.networkservices.v1.GetHttpRouteRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GetHttpRouteRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GetHttpRouteRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a CreateHttpRouteRequest. */ + interface ICreateHttpRouteRequest { + + /** CreateHttpRouteRequest parent */ + parent?: (string|null); + + /** CreateHttpRouteRequest httpRouteId */ + httpRouteId?: (string|null); + + /** CreateHttpRouteRequest httpRoute */ + httpRoute?: (google.cloud.networkservices.v1.IHttpRoute|null); + } + + /** Represents a CreateHttpRouteRequest. */ + class CreateHttpRouteRequest implements ICreateHttpRouteRequest { + + /** + * Constructs a new CreateHttpRouteRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.networkservices.v1.ICreateHttpRouteRequest); + + /** CreateHttpRouteRequest parent. */ + public parent: string; + + /** CreateHttpRouteRequest httpRouteId. */ + public httpRouteId: string; + + /** CreateHttpRouteRequest httpRoute. */ + public httpRoute?: (google.cloud.networkservices.v1.IHttpRoute|null); + + /** + * Creates a new CreateHttpRouteRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns CreateHttpRouteRequest instance + */ + public static create(properties?: google.cloud.networkservices.v1.ICreateHttpRouteRequest): google.cloud.networkservices.v1.CreateHttpRouteRequest; + + /** + * Encodes the specified CreateHttpRouteRequest message. Does not implicitly {@link google.cloud.networkservices.v1.CreateHttpRouteRequest.verify|verify} messages. + * @param message CreateHttpRouteRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.networkservices.v1.ICreateHttpRouteRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CreateHttpRouteRequest message, length delimited. Does not implicitly {@link google.cloud.networkservices.v1.CreateHttpRouteRequest.verify|verify} messages. + * @param message CreateHttpRouteRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.networkservices.v1.ICreateHttpRouteRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CreateHttpRouteRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CreateHttpRouteRequest + * @throws {Error} If the payload is not 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.networkservices.v1.CreateHttpRouteRequest; + + /** + * Decodes a CreateHttpRouteRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CreateHttpRouteRequest + * @throws {Error} If the payload 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.networkservices.v1.CreateHttpRouteRequest; + + /** + * Verifies a CreateHttpRouteRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CreateHttpRouteRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CreateHttpRouteRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.networkservices.v1.CreateHttpRouteRequest; + + /** + * Creates a plain object from a CreateHttpRouteRequest message. Also converts values to other types if specified. + * @param message CreateHttpRouteRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.networkservices.v1.CreateHttpRouteRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CreateHttpRouteRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CreateHttpRouteRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an UpdateHttpRouteRequest. */ + interface IUpdateHttpRouteRequest { + + /** UpdateHttpRouteRequest updateMask */ + updateMask?: (google.protobuf.IFieldMask|null); + + /** UpdateHttpRouteRequest httpRoute */ + httpRoute?: (google.cloud.networkservices.v1.IHttpRoute|null); + } + + /** Represents an UpdateHttpRouteRequest. */ + class UpdateHttpRouteRequest implements IUpdateHttpRouteRequest { + + /** + * Constructs a new UpdateHttpRouteRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.networkservices.v1.IUpdateHttpRouteRequest); + + /** UpdateHttpRouteRequest updateMask. */ + public updateMask?: (google.protobuf.IFieldMask|null); + + /** UpdateHttpRouteRequest httpRoute. */ + public httpRoute?: (google.cloud.networkservices.v1.IHttpRoute|null); + + /** + * Creates a new UpdateHttpRouteRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns UpdateHttpRouteRequest instance + */ + public static create(properties?: google.cloud.networkservices.v1.IUpdateHttpRouteRequest): google.cloud.networkservices.v1.UpdateHttpRouteRequest; + + /** + * Encodes the specified UpdateHttpRouteRequest message. Does not implicitly {@link google.cloud.networkservices.v1.UpdateHttpRouteRequest.verify|verify} messages. + * @param message UpdateHttpRouteRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.networkservices.v1.IUpdateHttpRouteRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified UpdateHttpRouteRequest message, length delimited. Does not implicitly {@link google.cloud.networkservices.v1.UpdateHttpRouteRequest.verify|verify} messages. + * @param message UpdateHttpRouteRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.networkservices.v1.IUpdateHttpRouteRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an UpdateHttpRouteRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns UpdateHttpRouteRequest + * @throws {Error} If the payload is not 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.networkservices.v1.UpdateHttpRouteRequest; + + /** + * Decodes an UpdateHttpRouteRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns UpdateHttpRouteRequest + * @throws {Error} If the payload 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.networkservices.v1.UpdateHttpRouteRequest; + + /** + * Verifies an UpdateHttpRouteRequest message. + * @param message Plain 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 UpdateHttpRouteRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns UpdateHttpRouteRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.networkservices.v1.UpdateHttpRouteRequest; + + /** + * Creates a plain object from an UpdateHttpRouteRequest message. Also converts values to other types if specified. + * @param message UpdateHttpRouteRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.networkservices.v1.UpdateHttpRouteRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this UpdateHttpRouteRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for UpdateHttpRouteRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a DeleteHttpRouteRequest. */ + interface IDeleteHttpRouteRequest { + + /** DeleteHttpRouteRequest name */ + name?: (string|null); + } + + /** Represents a DeleteHttpRouteRequest. */ + class DeleteHttpRouteRequest implements IDeleteHttpRouteRequest { + + /** + * Constructs a new DeleteHttpRouteRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.networkservices.v1.IDeleteHttpRouteRequest); + + /** DeleteHttpRouteRequest name. */ + public name: string; + + /** + * Creates a new DeleteHttpRouteRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns DeleteHttpRouteRequest instance + */ + public static create(properties?: google.cloud.networkservices.v1.IDeleteHttpRouteRequest): google.cloud.networkservices.v1.DeleteHttpRouteRequest; + + /** + * Encodes the specified DeleteHttpRouteRequest message. Does not implicitly {@link google.cloud.networkservices.v1.DeleteHttpRouteRequest.verify|verify} messages. + * @param message DeleteHttpRouteRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.networkservices.v1.IDeleteHttpRouteRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DeleteHttpRouteRequest message, length delimited. Does not implicitly {@link google.cloud.networkservices.v1.DeleteHttpRouteRequest.verify|verify} messages. + * @param message DeleteHttpRouteRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.networkservices.v1.IDeleteHttpRouteRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DeleteHttpRouteRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DeleteHttpRouteRequest + * @throws {Error} If the payload is not 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.networkservices.v1.DeleteHttpRouteRequest; + + /** + * Decodes a DeleteHttpRouteRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DeleteHttpRouteRequest + * @throws {Error} If the payload 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.networkservices.v1.DeleteHttpRouteRequest; + + /** + * Verifies a DeleteHttpRouteRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DeleteHttpRouteRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DeleteHttpRouteRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.networkservices.v1.DeleteHttpRouteRequest; + + /** + * Creates a plain object from a DeleteHttpRouteRequest message. Also converts values to other types if specified. + * @param message DeleteHttpRouteRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.networkservices.v1.DeleteHttpRouteRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DeleteHttpRouteRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DeleteHttpRouteRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Mesh. */ + interface IMesh { + + /** Mesh name */ + name?: (string|null); + + /** Mesh selfLink */ + selfLink?: (string|null); + + /** Mesh createTime */ + createTime?: (google.protobuf.ITimestamp|null); + + /** Mesh updateTime */ + updateTime?: (google.protobuf.ITimestamp|null); + + /** Mesh labels */ + labels?: ({ [k: string]: string }|null); + + /** Mesh description */ + description?: (string|null); + + /** Mesh interceptionPort */ + interceptionPort?: (number|null); + } + + /** Represents a Mesh. */ + class Mesh implements IMesh { + + /** + * Constructs a new Mesh. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.networkservices.v1.IMesh); + + /** Mesh name. */ + public name: string; + + /** Mesh selfLink. */ + public selfLink: string; + + /** Mesh createTime. */ + public createTime?: (google.protobuf.ITimestamp|null); + + /** Mesh updateTime. */ + public updateTime?: (google.protobuf.ITimestamp|null); + + /** Mesh labels. */ + public labels: { [k: string]: string }; + + /** Mesh description. */ + public description: string; + + /** Mesh interceptionPort. */ + public interceptionPort: number; + + /** + * Creates a new Mesh instance using the specified properties. + * @param [properties] Properties to set + * @returns Mesh instance + */ + public static create(properties?: google.cloud.networkservices.v1.IMesh): google.cloud.networkservices.v1.Mesh; + + /** + * Encodes the specified Mesh message. Does not implicitly {@link google.cloud.networkservices.v1.Mesh.verify|verify} messages. + * @param message Mesh message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.networkservices.v1.IMesh, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Mesh message, length delimited. Does not implicitly {@link google.cloud.networkservices.v1.Mesh.verify|verify} messages. + * @param message Mesh message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.networkservices.v1.IMesh, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Mesh message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Mesh + * @throws {Error} If the payload is not 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.networkservices.v1.Mesh; + + /** + * Decodes a Mesh message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Mesh + * @throws {Error} If the payload 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.networkservices.v1.Mesh; + + /** + * Verifies a Mesh message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Mesh message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Mesh + */ + public static fromObject(object: { [k: string]: any }): google.cloud.networkservices.v1.Mesh; + + /** + * Creates a plain object from a Mesh message. Also converts values to other types if specified. + * @param message Mesh + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.networkservices.v1.Mesh, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Mesh to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Mesh + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListMeshesRequest. */ + interface IListMeshesRequest { + + /** ListMeshesRequest parent */ + parent?: (string|null); + + /** ListMeshesRequest pageSize */ + pageSize?: (number|null); + + /** ListMeshesRequest pageToken */ + pageToken?: (string|null); + } + + /** Represents a ListMeshesRequest. */ + class ListMeshesRequest implements IListMeshesRequest { + + /** + * Constructs a new ListMeshesRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.networkservices.v1.IListMeshesRequest); + + /** ListMeshesRequest parent. */ + public parent: string; + + /** ListMeshesRequest pageSize. */ + public pageSize: number; + + /** ListMeshesRequest pageToken. */ + public pageToken: string; + + /** + * Creates a new ListMeshesRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ListMeshesRequest instance + */ + public static create(properties?: google.cloud.networkservices.v1.IListMeshesRequest): google.cloud.networkservices.v1.ListMeshesRequest; + + /** + * Encodes the specified ListMeshesRequest message. Does not implicitly {@link google.cloud.networkservices.v1.ListMeshesRequest.verify|verify} messages. + * @param message ListMeshesRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.networkservices.v1.IListMeshesRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListMeshesRequest message, length delimited. Does not implicitly {@link google.cloud.networkservices.v1.ListMeshesRequest.verify|verify} messages. + * @param message ListMeshesRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.networkservices.v1.IListMeshesRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListMeshesRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListMeshesRequest + * @throws {Error} If the payload is not 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.networkservices.v1.ListMeshesRequest; + + /** + * Decodes a ListMeshesRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListMeshesRequest + * @throws {Error} If the payload 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.networkservices.v1.ListMeshesRequest; + + /** + * Verifies a ListMeshesRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListMeshesRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListMeshesRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.networkservices.v1.ListMeshesRequest; + + /** + * Creates a plain object from a ListMeshesRequest message. Also converts values to other types if specified. + * @param message ListMeshesRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.networkservices.v1.ListMeshesRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListMeshesRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListMeshesRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListMeshesResponse. */ + interface IListMeshesResponse { + + /** ListMeshesResponse meshes */ + meshes?: (google.cloud.networkservices.v1.IMesh[]|null); + + /** ListMeshesResponse nextPageToken */ + nextPageToken?: (string|null); + } + + /** Represents a ListMeshesResponse. */ + class ListMeshesResponse implements IListMeshesResponse { + + /** + * Constructs a new ListMeshesResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.networkservices.v1.IListMeshesResponse); + + /** ListMeshesResponse meshes. */ + public meshes: google.cloud.networkservices.v1.IMesh[]; + + /** ListMeshesResponse nextPageToken. */ + public nextPageToken: string; + + /** + * Creates a new ListMeshesResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ListMeshesResponse instance + */ + public static create(properties?: google.cloud.networkservices.v1.IListMeshesResponse): google.cloud.networkservices.v1.ListMeshesResponse; + + /** + * Encodes the specified ListMeshesResponse message. Does not implicitly {@link google.cloud.networkservices.v1.ListMeshesResponse.verify|verify} messages. + * @param message ListMeshesResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.networkservices.v1.IListMeshesResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListMeshesResponse message, length delimited. Does not implicitly {@link google.cloud.networkservices.v1.ListMeshesResponse.verify|verify} messages. + * @param message ListMeshesResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.networkservices.v1.IListMeshesResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListMeshesResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListMeshesResponse + * @throws {Error} If the payload is not 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.networkservices.v1.ListMeshesResponse; + + /** + * Decodes a ListMeshesResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListMeshesResponse + * @throws {Error} If the payload 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.networkservices.v1.ListMeshesResponse; + + /** + * Verifies a ListMeshesResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListMeshesResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListMeshesResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.networkservices.v1.ListMeshesResponse; + + /** + * Creates a plain object from a ListMeshesResponse message. Also converts values to other types if specified. + * @param message ListMeshesResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.networkservices.v1.ListMeshesResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListMeshesResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListMeshesResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a GetMeshRequest. */ + interface IGetMeshRequest { + + /** GetMeshRequest name */ + name?: (string|null); + } + + /** Represents a GetMeshRequest. */ + class GetMeshRequest implements IGetMeshRequest { + + /** + * Constructs a new GetMeshRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.networkservices.v1.IGetMeshRequest); + + /** GetMeshRequest name. */ + public name: string; + + /** + * Creates a new GetMeshRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GetMeshRequest instance + */ + public static create(properties?: google.cloud.networkservices.v1.IGetMeshRequest): google.cloud.networkservices.v1.GetMeshRequest; + + /** + * Encodes the specified GetMeshRequest message. Does not implicitly {@link google.cloud.networkservices.v1.GetMeshRequest.verify|verify} messages. + * @param message GetMeshRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.networkservices.v1.IGetMeshRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GetMeshRequest message, length delimited. Does not implicitly {@link google.cloud.networkservices.v1.GetMeshRequest.verify|verify} messages. + * @param message GetMeshRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.networkservices.v1.IGetMeshRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GetMeshRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GetMeshRequest + * @throws {Error} If the payload is not 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.networkservices.v1.GetMeshRequest; + + /** + * Decodes a GetMeshRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GetMeshRequest + * @throws {Error} If the payload 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.networkservices.v1.GetMeshRequest; + + /** + * Verifies a GetMeshRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GetMeshRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GetMeshRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.networkservices.v1.GetMeshRequest; + + /** + * Creates a plain object from a GetMeshRequest message. Also converts values to other types if specified. + * @param message GetMeshRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.networkservices.v1.GetMeshRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GetMeshRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GetMeshRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a CreateMeshRequest. */ + interface ICreateMeshRequest { + + /** CreateMeshRequest parent */ + parent?: (string|null); + + /** CreateMeshRequest meshId */ + meshId?: (string|null); + + /** CreateMeshRequest mesh */ + mesh?: (google.cloud.networkservices.v1.IMesh|null); + } + + /** Represents a CreateMeshRequest. */ + class CreateMeshRequest implements ICreateMeshRequest { + + /** + * Constructs a new CreateMeshRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.networkservices.v1.ICreateMeshRequest); + + /** CreateMeshRequest parent. */ + public parent: string; + + /** CreateMeshRequest meshId. */ + public meshId: string; + + /** CreateMeshRequest mesh. */ + public mesh?: (google.cloud.networkservices.v1.IMesh|null); + + /** + * Creates a new CreateMeshRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns CreateMeshRequest instance + */ + public static create(properties?: google.cloud.networkservices.v1.ICreateMeshRequest): google.cloud.networkservices.v1.CreateMeshRequest; + + /** + * Encodes the specified CreateMeshRequest message. Does not implicitly {@link google.cloud.networkservices.v1.CreateMeshRequest.verify|verify} messages. + * @param message CreateMeshRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.networkservices.v1.ICreateMeshRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CreateMeshRequest message, length delimited. Does not implicitly {@link google.cloud.networkservices.v1.CreateMeshRequest.verify|verify} messages. + * @param message CreateMeshRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.networkservices.v1.ICreateMeshRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CreateMeshRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CreateMeshRequest + * @throws {Error} If the payload is not 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.networkservices.v1.CreateMeshRequest; + + /** + * Decodes a CreateMeshRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CreateMeshRequest + * @throws {Error} If the payload 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.networkservices.v1.CreateMeshRequest; + + /** + * Verifies a CreateMeshRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CreateMeshRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CreateMeshRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.networkservices.v1.CreateMeshRequest; + + /** + * Creates a plain object from a CreateMeshRequest message. Also converts values to other types if specified. + * @param message CreateMeshRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.networkservices.v1.CreateMeshRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CreateMeshRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CreateMeshRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an UpdateMeshRequest. */ + interface IUpdateMeshRequest { + + /** UpdateMeshRequest updateMask */ + updateMask?: (google.protobuf.IFieldMask|null); + + /** UpdateMeshRequest mesh */ + mesh?: (google.cloud.networkservices.v1.IMesh|null); + } + + /** Represents an UpdateMeshRequest. */ + class UpdateMeshRequest implements IUpdateMeshRequest { + + /** + * Constructs a new UpdateMeshRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.networkservices.v1.IUpdateMeshRequest); + + /** UpdateMeshRequest updateMask. */ + public updateMask?: (google.protobuf.IFieldMask|null); + + /** UpdateMeshRequest mesh. */ + public mesh?: (google.cloud.networkservices.v1.IMesh|null); + + /** + * Creates a new UpdateMeshRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns UpdateMeshRequest instance + */ + public static create(properties?: google.cloud.networkservices.v1.IUpdateMeshRequest): google.cloud.networkservices.v1.UpdateMeshRequest; + + /** + * Encodes the specified UpdateMeshRequest message. Does not implicitly {@link google.cloud.networkservices.v1.UpdateMeshRequest.verify|verify} messages. + * @param message UpdateMeshRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.networkservices.v1.IUpdateMeshRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified UpdateMeshRequest message, length delimited. Does not implicitly {@link google.cloud.networkservices.v1.UpdateMeshRequest.verify|verify} messages. + * @param message UpdateMeshRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.networkservices.v1.IUpdateMeshRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an UpdateMeshRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns UpdateMeshRequest + * @throws {Error} If the payload is not 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.networkservices.v1.UpdateMeshRequest; + + /** + * Decodes an UpdateMeshRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns UpdateMeshRequest + * @throws {Error} If the payload 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.networkservices.v1.UpdateMeshRequest; + + /** + * Verifies an UpdateMeshRequest message. + * @param message Plain 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 UpdateMeshRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns UpdateMeshRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.networkservices.v1.UpdateMeshRequest; + + /** + * Creates a plain object from an UpdateMeshRequest message. Also converts values to other types if specified. + * @param message UpdateMeshRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.networkservices.v1.UpdateMeshRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this UpdateMeshRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for UpdateMeshRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a DeleteMeshRequest. */ + interface IDeleteMeshRequest { + + /** DeleteMeshRequest name */ + name?: (string|null); + } + + /** Represents a DeleteMeshRequest. */ + class DeleteMeshRequest implements IDeleteMeshRequest { + + /** + * Constructs a new DeleteMeshRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.networkservices.v1.IDeleteMeshRequest); + + /** DeleteMeshRequest name. */ + public name: string; + + /** + * Creates a new DeleteMeshRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns DeleteMeshRequest instance + */ + public static create(properties?: google.cloud.networkservices.v1.IDeleteMeshRequest): google.cloud.networkservices.v1.DeleteMeshRequest; + + /** + * Encodes the specified DeleteMeshRequest message. Does not implicitly {@link google.cloud.networkservices.v1.DeleteMeshRequest.verify|verify} messages. + * @param message DeleteMeshRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.networkservices.v1.IDeleteMeshRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DeleteMeshRequest message, length delimited. Does not implicitly {@link google.cloud.networkservices.v1.DeleteMeshRequest.verify|verify} messages. + * @param message DeleteMeshRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.networkservices.v1.IDeleteMeshRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DeleteMeshRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DeleteMeshRequest + * @throws {Error} If the payload is not 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.networkservices.v1.DeleteMeshRequest; + + /** + * Decodes a DeleteMeshRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DeleteMeshRequest + * @throws {Error} If the payload 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.networkservices.v1.DeleteMeshRequest; + + /** + * Verifies a DeleteMeshRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DeleteMeshRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DeleteMeshRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.networkservices.v1.DeleteMeshRequest; + + /** + * Creates a plain object from a DeleteMeshRequest message. Also converts values to other types if specified. + * @param message DeleteMeshRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.networkservices.v1.DeleteMeshRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DeleteMeshRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DeleteMeshRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Represents a NetworkServices */ + class NetworkServices extends $protobuf.rpc.Service { + + /** + * Constructs a new NetworkServices 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 NetworkServices 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): NetworkServices; + + /** + * Calls ListEndpointPolicies. + * @param request ListEndpointPoliciesRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ListEndpointPoliciesResponse + */ + public listEndpointPolicies(request: google.cloud.networkservices.v1.IListEndpointPoliciesRequest, callback: google.cloud.networkservices.v1.NetworkServices.ListEndpointPoliciesCallback): void; + + /** + * Calls ListEndpointPolicies. + * @param request ListEndpointPoliciesRequest message or plain object + * @returns Promise + */ + public listEndpointPolicies(request: google.cloud.networkservices.v1.IListEndpointPoliciesRequest): Promise; + + /** + * Calls GetEndpointPolicy. + * @param request GetEndpointPolicyRequest message or plain object + * @param callback Node-style callback called with the error, if any, and EndpointPolicy + */ + public getEndpointPolicy(request: google.cloud.networkservices.v1.IGetEndpointPolicyRequest, callback: google.cloud.networkservices.v1.NetworkServices.GetEndpointPolicyCallback): void; + + /** + * Calls GetEndpointPolicy. + * @param request GetEndpointPolicyRequest message or plain object + * @returns Promise + */ + public getEndpointPolicy(request: google.cloud.networkservices.v1.IGetEndpointPolicyRequest): Promise; + + /** + * Calls CreateEndpointPolicy. + * @param request CreateEndpointPolicyRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public createEndpointPolicy(request: google.cloud.networkservices.v1.ICreateEndpointPolicyRequest, callback: google.cloud.networkservices.v1.NetworkServices.CreateEndpointPolicyCallback): void; + + /** + * Calls CreateEndpointPolicy. + * @param request CreateEndpointPolicyRequest message or plain object + * @returns Promise + */ + public createEndpointPolicy(request: google.cloud.networkservices.v1.ICreateEndpointPolicyRequest): Promise; + + /** + * Calls UpdateEndpointPolicy. + * @param request UpdateEndpointPolicyRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public updateEndpointPolicy(request: google.cloud.networkservices.v1.IUpdateEndpointPolicyRequest, callback: google.cloud.networkservices.v1.NetworkServices.UpdateEndpointPolicyCallback): void; + + /** + * Calls UpdateEndpointPolicy. + * @param request UpdateEndpointPolicyRequest message or plain object + * @returns Promise + */ + public updateEndpointPolicy(request: google.cloud.networkservices.v1.IUpdateEndpointPolicyRequest): Promise; + + /** + * Calls DeleteEndpointPolicy. + * @param request DeleteEndpointPolicyRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public deleteEndpointPolicy(request: google.cloud.networkservices.v1.IDeleteEndpointPolicyRequest, callback: google.cloud.networkservices.v1.NetworkServices.DeleteEndpointPolicyCallback): void; + + /** + * Calls DeleteEndpointPolicy. + * @param request DeleteEndpointPolicyRequest message or plain object + * @returns Promise + */ + public deleteEndpointPolicy(request: google.cloud.networkservices.v1.IDeleteEndpointPolicyRequest): Promise; + + /** + * Calls ListGateways. + * @param request ListGatewaysRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ListGatewaysResponse + */ + public listGateways(request: google.cloud.networkservices.v1.IListGatewaysRequest, callback: google.cloud.networkservices.v1.NetworkServices.ListGatewaysCallback): void; + + /** + * Calls ListGateways. + * @param request ListGatewaysRequest message or plain object + * @returns Promise + */ + public listGateways(request: google.cloud.networkservices.v1.IListGatewaysRequest): Promise; + + /** + * Calls GetGateway. + * @param request GetGatewayRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Gateway + */ + public getGateway(request: google.cloud.networkservices.v1.IGetGatewayRequest, callback: google.cloud.networkservices.v1.NetworkServices.GetGatewayCallback): void; + + /** + * Calls GetGateway. + * @param request GetGatewayRequest message or plain object + * @returns Promise + */ + public getGateway(request: google.cloud.networkservices.v1.IGetGatewayRequest): Promise; + + /** + * Calls CreateGateway. + * @param request CreateGatewayRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public createGateway(request: google.cloud.networkservices.v1.ICreateGatewayRequest, callback: google.cloud.networkservices.v1.NetworkServices.CreateGatewayCallback): void; + + /** + * Calls CreateGateway. + * @param request CreateGatewayRequest message or plain object + * @returns Promise + */ + public createGateway(request: google.cloud.networkservices.v1.ICreateGatewayRequest): Promise; + + /** + * Calls UpdateGateway. + * @param request UpdateGatewayRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public updateGateway(request: google.cloud.networkservices.v1.IUpdateGatewayRequest, callback: google.cloud.networkservices.v1.NetworkServices.UpdateGatewayCallback): void; + + /** + * Calls UpdateGateway. + * @param request UpdateGatewayRequest message or plain object + * @returns Promise + */ + public updateGateway(request: google.cloud.networkservices.v1.IUpdateGatewayRequest): Promise; + + /** + * Calls DeleteGateway. + * @param request DeleteGatewayRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public deleteGateway(request: google.cloud.networkservices.v1.IDeleteGatewayRequest, callback: google.cloud.networkservices.v1.NetworkServices.DeleteGatewayCallback): void; + + /** + * Calls DeleteGateway. + * @param request DeleteGatewayRequest message or plain object + * @returns Promise + */ + public deleteGateway(request: google.cloud.networkservices.v1.IDeleteGatewayRequest): Promise; + + /** + * Calls ListGrpcRoutes. + * @param request ListGrpcRoutesRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ListGrpcRoutesResponse + */ + public listGrpcRoutes(request: google.cloud.networkservices.v1.IListGrpcRoutesRequest, callback: google.cloud.networkservices.v1.NetworkServices.ListGrpcRoutesCallback): void; + + /** + * Calls ListGrpcRoutes. + * @param request ListGrpcRoutesRequest message or plain object + * @returns Promise + */ + public listGrpcRoutes(request: google.cloud.networkservices.v1.IListGrpcRoutesRequest): Promise; + + /** + * Calls GetGrpcRoute. + * @param request GetGrpcRouteRequest message or plain object + * @param callback Node-style callback called with the error, if any, and GrpcRoute + */ + public getGrpcRoute(request: google.cloud.networkservices.v1.IGetGrpcRouteRequest, callback: google.cloud.networkservices.v1.NetworkServices.GetGrpcRouteCallback): void; + + /** + * Calls GetGrpcRoute. + * @param request GetGrpcRouteRequest message or plain object + * @returns Promise + */ + public getGrpcRoute(request: google.cloud.networkservices.v1.IGetGrpcRouteRequest): Promise; + + /** + * Calls CreateGrpcRoute. + * @param request CreateGrpcRouteRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public createGrpcRoute(request: google.cloud.networkservices.v1.ICreateGrpcRouteRequest, callback: google.cloud.networkservices.v1.NetworkServices.CreateGrpcRouteCallback): void; + + /** + * Calls CreateGrpcRoute. + * @param request CreateGrpcRouteRequest message or plain object + * @returns Promise + */ + public createGrpcRoute(request: google.cloud.networkservices.v1.ICreateGrpcRouteRequest): Promise; + + /** + * Calls UpdateGrpcRoute. + * @param request UpdateGrpcRouteRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public updateGrpcRoute(request: google.cloud.networkservices.v1.IUpdateGrpcRouteRequest, callback: google.cloud.networkservices.v1.NetworkServices.UpdateGrpcRouteCallback): void; + + /** + * Calls UpdateGrpcRoute. + * @param request UpdateGrpcRouteRequest message or plain object + * @returns Promise + */ + public updateGrpcRoute(request: google.cloud.networkservices.v1.IUpdateGrpcRouteRequest): Promise; + + /** + * Calls DeleteGrpcRoute. + * @param request DeleteGrpcRouteRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public deleteGrpcRoute(request: google.cloud.networkservices.v1.IDeleteGrpcRouteRequest, callback: google.cloud.networkservices.v1.NetworkServices.DeleteGrpcRouteCallback): void; + + /** + * Calls DeleteGrpcRoute. + * @param request DeleteGrpcRouteRequest message or plain object + * @returns Promise + */ + public deleteGrpcRoute(request: google.cloud.networkservices.v1.IDeleteGrpcRouteRequest): Promise; + + /** + * Calls ListHttpRoutes. + * @param request ListHttpRoutesRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ListHttpRoutesResponse + */ + public listHttpRoutes(request: google.cloud.networkservices.v1.IListHttpRoutesRequest, callback: google.cloud.networkservices.v1.NetworkServices.ListHttpRoutesCallback): void; + + /** + * Calls ListHttpRoutes. + * @param request ListHttpRoutesRequest message or plain object + * @returns Promise + */ + public listHttpRoutes(request: google.cloud.networkservices.v1.IListHttpRoutesRequest): Promise; + + /** + * Calls GetHttpRoute. + * @param request GetHttpRouteRequest message or plain object + * @param callback Node-style callback called with the error, if any, and HttpRoute + */ + public getHttpRoute(request: google.cloud.networkservices.v1.IGetHttpRouteRequest, callback: google.cloud.networkservices.v1.NetworkServices.GetHttpRouteCallback): void; + + /** + * Calls GetHttpRoute. + * @param request GetHttpRouteRequest message or plain object + * @returns Promise + */ + public getHttpRoute(request: google.cloud.networkservices.v1.IGetHttpRouteRequest): Promise; + + /** + * Calls CreateHttpRoute. + * @param request CreateHttpRouteRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public createHttpRoute(request: google.cloud.networkservices.v1.ICreateHttpRouteRequest, callback: google.cloud.networkservices.v1.NetworkServices.CreateHttpRouteCallback): void; + + /** + * Calls CreateHttpRoute. + * @param request CreateHttpRouteRequest message or plain object + * @returns Promise + */ + public createHttpRoute(request: google.cloud.networkservices.v1.ICreateHttpRouteRequest): Promise; + + /** + * Calls UpdateHttpRoute. + * @param request UpdateHttpRouteRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public updateHttpRoute(request: google.cloud.networkservices.v1.IUpdateHttpRouteRequest, callback: google.cloud.networkservices.v1.NetworkServices.UpdateHttpRouteCallback): void; + + /** + * Calls UpdateHttpRoute. + * @param request UpdateHttpRouteRequest message or plain object + * @returns Promise + */ + public updateHttpRoute(request: google.cloud.networkservices.v1.IUpdateHttpRouteRequest): Promise; + + /** + * Calls DeleteHttpRoute. + * @param request DeleteHttpRouteRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public deleteHttpRoute(request: google.cloud.networkservices.v1.IDeleteHttpRouteRequest, callback: google.cloud.networkservices.v1.NetworkServices.DeleteHttpRouteCallback): void; + + /** + * Calls DeleteHttpRoute. + * @param request DeleteHttpRouteRequest message or plain object + * @returns Promise + */ + public deleteHttpRoute(request: google.cloud.networkservices.v1.IDeleteHttpRouteRequest): Promise; + + /** + * Calls ListTcpRoutes. + * @param request ListTcpRoutesRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ListTcpRoutesResponse + */ + public listTcpRoutes(request: google.cloud.networkservices.v1.IListTcpRoutesRequest, callback: google.cloud.networkservices.v1.NetworkServices.ListTcpRoutesCallback): void; + + /** + * Calls ListTcpRoutes. + * @param request ListTcpRoutesRequest message or plain object + * @returns Promise + */ + public listTcpRoutes(request: google.cloud.networkservices.v1.IListTcpRoutesRequest): Promise; + + /** + * Calls GetTcpRoute. + * @param request GetTcpRouteRequest message or plain object + * @param callback Node-style callback called with the error, if any, and TcpRoute + */ + public getTcpRoute(request: google.cloud.networkservices.v1.IGetTcpRouteRequest, callback: google.cloud.networkservices.v1.NetworkServices.GetTcpRouteCallback): void; + + /** + * Calls GetTcpRoute. + * @param request GetTcpRouteRequest message or plain object + * @returns Promise + */ + public getTcpRoute(request: google.cloud.networkservices.v1.IGetTcpRouteRequest): Promise; + + /** + * Calls CreateTcpRoute. + * @param request CreateTcpRouteRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public createTcpRoute(request: google.cloud.networkservices.v1.ICreateTcpRouteRequest, callback: google.cloud.networkservices.v1.NetworkServices.CreateTcpRouteCallback): void; + + /** + * Calls CreateTcpRoute. + * @param request CreateTcpRouteRequest message or plain object + * @returns Promise + */ + public createTcpRoute(request: google.cloud.networkservices.v1.ICreateTcpRouteRequest): Promise; + + /** + * Calls UpdateTcpRoute. + * @param request UpdateTcpRouteRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public updateTcpRoute(request: google.cloud.networkservices.v1.IUpdateTcpRouteRequest, callback: google.cloud.networkservices.v1.NetworkServices.UpdateTcpRouteCallback): void; + + /** + * Calls UpdateTcpRoute. + * @param request UpdateTcpRouteRequest message or plain object + * @returns Promise + */ + public updateTcpRoute(request: google.cloud.networkservices.v1.IUpdateTcpRouteRequest): Promise; + + /** + * Calls DeleteTcpRoute. + * @param request DeleteTcpRouteRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public deleteTcpRoute(request: google.cloud.networkservices.v1.IDeleteTcpRouteRequest, callback: google.cloud.networkservices.v1.NetworkServices.DeleteTcpRouteCallback): void; + + /** + * Calls DeleteTcpRoute. + * @param request DeleteTcpRouteRequest message or plain object + * @returns Promise + */ + public deleteTcpRoute(request: google.cloud.networkservices.v1.IDeleteTcpRouteRequest): Promise; + + /** + * Calls ListTlsRoutes. + * @param request ListTlsRoutesRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ListTlsRoutesResponse + */ + public listTlsRoutes(request: google.cloud.networkservices.v1.IListTlsRoutesRequest, callback: google.cloud.networkservices.v1.NetworkServices.ListTlsRoutesCallback): void; + + /** + * Calls ListTlsRoutes. + * @param request ListTlsRoutesRequest message or plain object + * @returns Promise + */ + public listTlsRoutes(request: google.cloud.networkservices.v1.IListTlsRoutesRequest): Promise; + + /** + * Calls GetTlsRoute. + * @param request GetTlsRouteRequest message or plain object + * @param callback Node-style callback called with the error, if any, and TlsRoute + */ + public getTlsRoute(request: google.cloud.networkservices.v1.IGetTlsRouteRequest, callback: google.cloud.networkservices.v1.NetworkServices.GetTlsRouteCallback): void; + + /** + * Calls GetTlsRoute. + * @param request GetTlsRouteRequest message or plain object + * @returns Promise + */ + public getTlsRoute(request: google.cloud.networkservices.v1.IGetTlsRouteRequest): Promise; + + /** + * Calls CreateTlsRoute. + * @param request CreateTlsRouteRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public createTlsRoute(request: google.cloud.networkservices.v1.ICreateTlsRouteRequest, callback: google.cloud.networkservices.v1.NetworkServices.CreateTlsRouteCallback): void; + + /** + * Calls CreateTlsRoute. + * @param request CreateTlsRouteRequest message or plain object + * @returns Promise + */ + public createTlsRoute(request: google.cloud.networkservices.v1.ICreateTlsRouteRequest): Promise; + + /** + * Calls UpdateTlsRoute. + * @param request UpdateTlsRouteRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public updateTlsRoute(request: google.cloud.networkservices.v1.IUpdateTlsRouteRequest, callback: google.cloud.networkservices.v1.NetworkServices.UpdateTlsRouteCallback): void; + + /** + * Calls UpdateTlsRoute. + * @param request UpdateTlsRouteRequest message or plain object + * @returns Promise + */ + public updateTlsRoute(request: google.cloud.networkservices.v1.IUpdateTlsRouteRequest): Promise; + + /** + * Calls DeleteTlsRoute. + * @param request DeleteTlsRouteRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public deleteTlsRoute(request: google.cloud.networkservices.v1.IDeleteTlsRouteRequest, callback: google.cloud.networkservices.v1.NetworkServices.DeleteTlsRouteCallback): void; + + /** + * Calls DeleteTlsRoute. + * @param request DeleteTlsRouteRequest message or plain object + * @returns Promise + */ + public deleteTlsRoute(request: google.cloud.networkservices.v1.IDeleteTlsRouteRequest): Promise; + + /** + * Calls ListServiceBindings. + * @param request ListServiceBindingsRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ListServiceBindingsResponse + */ + public listServiceBindings(request: google.cloud.networkservices.v1.IListServiceBindingsRequest, callback: google.cloud.networkservices.v1.NetworkServices.ListServiceBindingsCallback): void; + + /** + * Calls ListServiceBindings. + * @param request ListServiceBindingsRequest message or plain object + * @returns Promise + */ + public listServiceBindings(request: google.cloud.networkservices.v1.IListServiceBindingsRequest): Promise; + + /** + * Calls GetServiceBinding. + * @param request GetServiceBindingRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ServiceBinding + */ + public getServiceBinding(request: google.cloud.networkservices.v1.IGetServiceBindingRequest, callback: google.cloud.networkservices.v1.NetworkServices.GetServiceBindingCallback): void; + + /** + * Calls GetServiceBinding. + * @param request GetServiceBindingRequest message or plain object + * @returns Promise + */ + public getServiceBinding(request: google.cloud.networkservices.v1.IGetServiceBindingRequest): Promise; + + /** + * Calls CreateServiceBinding. + * @param request CreateServiceBindingRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public createServiceBinding(request: google.cloud.networkservices.v1.ICreateServiceBindingRequest, callback: google.cloud.networkservices.v1.NetworkServices.CreateServiceBindingCallback): void; + + /** + * Calls CreateServiceBinding. + * @param request CreateServiceBindingRequest message or plain object + * @returns Promise + */ + public createServiceBinding(request: google.cloud.networkservices.v1.ICreateServiceBindingRequest): Promise; + + /** + * Calls DeleteServiceBinding. + * @param request DeleteServiceBindingRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public deleteServiceBinding(request: google.cloud.networkservices.v1.IDeleteServiceBindingRequest, callback: google.cloud.networkservices.v1.NetworkServices.DeleteServiceBindingCallback): void; + + /** + * Calls DeleteServiceBinding. + * @param request DeleteServiceBindingRequest message or plain object + * @returns Promise + */ + public deleteServiceBinding(request: google.cloud.networkservices.v1.IDeleteServiceBindingRequest): Promise; + + /** + * Calls ListMeshes. + * @param request ListMeshesRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ListMeshesResponse + */ + public listMeshes(request: google.cloud.networkservices.v1.IListMeshesRequest, callback: google.cloud.networkservices.v1.NetworkServices.ListMeshesCallback): void; + + /** + * Calls ListMeshes. + * @param request ListMeshesRequest message or plain object + * @returns Promise + */ + public listMeshes(request: google.cloud.networkservices.v1.IListMeshesRequest): Promise; + + /** + * Calls GetMesh. + * @param request GetMeshRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Mesh + */ + public getMesh(request: google.cloud.networkservices.v1.IGetMeshRequest, callback: google.cloud.networkservices.v1.NetworkServices.GetMeshCallback): void; + + /** + * Calls GetMesh. + * @param request GetMeshRequest message or plain object + * @returns Promise + */ + public getMesh(request: google.cloud.networkservices.v1.IGetMeshRequest): Promise; + + /** + * Calls CreateMesh. + * @param request CreateMeshRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public createMesh(request: google.cloud.networkservices.v1.ICreateMeshRequest, callback: google.cloud.networkservices.v1.NetworkServices.CreateMeshCallback): void; + + /** + * Calls CreateMesh. + * @param request CreateMeshRequest message or plain object + * @returns Promise + */ + public createMesh(request: google.cloud.networkservices.v1.ICreateMeshRequest): Promise; + + /** + * Calls UpdateMesh. + * @param request UpdateMeshRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public updateMesh(request: google.cloud.networkservices.v1.IUpdateMeshRequest, callback: google.cloud.networkservices.v1.NetworkServices.UpdateMeshCallback): void; + + /** + * Calls UpdateMesh. + * @param request UpdateMeshRequest message or plain object + * @returns Promise + */ + public updateMesh(request: google.cloud.networkservices.v1.IUpdateMeshRequest): Promise; + + /** + * Calls DeleteMesh. + * @param request DeleteMeshRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public deleteMesh(request: google.cloud.networkservices.v1.IDeleteMeshRequest, callback: google.cloud.networkservices.v1.NetworkServices.DeleteMeshCallback): void; + + /** + * Calls DeleteMesh. + * @param request DeleteMeshRequest message or plain object + * @returns Promise + */ + public deleteMesh(request: google.cloud.networkservices.v1.IDeleteMeshRequest): Promise; + } + + namespace NetworkServices { + + /** + * Callback as used by {@link google.cloud.networkservices.v1.NetworkServices|listEndpointPolicies}. + * @param error Error, if any + * @param [response] ListEndpointPoliciesResponse + */ + type ListEndpointPoliciesCallback = (error: (Error|null), response?: google.cloud.networkservices.v1.ListEndpointPoliciesResponse) => void; + + /** + * Callback as used by {@link google.cloud.networkservices.v1.NetworkServices|getEndpointPolicy}. + * @param error Error, if any + * @param [response] EndpointPolicy + */ + type GetEndpointPolicyCallback = (error: (Error|null), response?: google.cloud.networkservices.v1.EndpointPolicy) => void; + + /** + * Callback as used by {@link google.cloud.networkservices.v1.NetworkServices|createEndpointPolicy}. + * @param error Error, if any + * @param [response] Operation + */ + type CreateEndpointPolicyCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.cloud.networkservices.v1.NetworkServices|updateEndpointPolicy}. + * @param error Error, if any + * @param [response] Operation + */ + type UpdateEndpointPolicyCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.cloud.networkservices.v1.NetworkServices|deleteEndpointPolicy}. + * @param error Error, if any + * @param [response] Operation + */ + type DeleteEndpointPolicyCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.cloud.networkservices.v1.NetworkServices|listGateways}. + * @param error Error, if any + * @param [response] ListGatewaysResponse + */ + type ListGatewaysCallback = (error: (Error|null), response?: google.cloud.networkservices.v1.ListGatewaysResponse) => void; + + /** + * Callback as used by {@link google.cloud.networkservices.v1.NetworkServices|getGateway}. + * @param error Error, if any + * @param [response] Gateway + */ + type GetGatewayCallback = (error: (Error|null), response?: google.cloud.networkservices.v1.Gateway) => void; + + /** + * Callback as used by {@link google.cloud.networkservices.v1.NetworkServices|createGateway}. + * @param error Error, if any + * @param [response] Operation + */ + type CreateGatewayCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.cloud.networkservices.v1.NetworkServices|updateGateway}. + * @param error Error, if any + * @param [response] Operation + */ + type UpdateGatewayCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.cloud.networkservices.v1.NetworkServices|deleteGateway}. + * @param error Error, if any + * @param [response] Operation + */ + type DeleteGatewayCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.cloud.networkservices.v1.NetworkServices|listGrpcRoutes}. + * @param error Error, if any + * @param [response] ListGrpcRoutesResponse + */ + type ListGrpcRoutesCallback = (error: (Error|null), response?: google.cloud.networkservices.v1.ListGrpcRoutesResponse) => void; + + /** + * Callback as used by {@link google.cloud.networkservices.v1.NetworkServices|getGrpcRoute}. + * @param error Error, if any + * @param [response] GrpcRoute + */ + type GetGrpcRouteCallback = (error: (Error|null), response?: google.cloud.networkservices.v1.GrpcRoute) => void; + + /** + * Callback as used by {@link google.cloud.networkservices.v1.NetworkServices|createGrpcRoute}. + * @param error Error, if any + * @param [response] Operation + */ + type CreateGrpcRouteCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.cloud.networkservices.v1.NetworkServices|updateGrpcRoute}. + * @param error Error, if any + * @param [response] Operation + */ + type UpdateGrpcRouteCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.cloud.networkservices.v1.NetworkServices|deleteGrpcRoute}. + * @param error Error, if any + * @param [response] Operation + */ + type DeleteGrpcRouteCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.cloud.networkservices.v1.NetworkServices|listHttpRoutes}. + * @param error Error, if any + * @param [response] ListHttpRoutesResponse + */ + type ListHttpRoutesCallback = (error: (Error|null), response?: google.cloud.networkservices.v1.ListHttpRoutesResponse) => void; + + /** + * Callback as used by {@link google.cloud.networkservices.v1.NetworkServices|getHttpRoute}. + * @param error Error, if any + * @param [response] HttpRoute + */ + type GetHttpRouteCallback = (error: (Error|null), response?: google.cloud.networkservices.v1.HttpRoute) => void; + + /** + * Callback as used by {@link google.cloud.networkservices.v1.NetworkServices|createHttpRoute}. + * @param error Error, if any + * @param [response] Operation + */ + type CreateHttpRouteCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.cloud.networkservices.v1.NetworkServices|updateHttpRoute}. + * @param error Error, if any + * @param [response] Operation + */ + type UpdateHttpRouteCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.cloud.networkservices.v1.NetworkServices|deleteHttpRoute}. + * @param error Error, if any + * @param [response] Operation + */ + type DeleteHttpRouteCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.cloud.networkservices.v1.NetworkServices|listTcpRoutes}. + * @param error Error, if any + * @param [response] ListTcpRoutesResponse + */ + type ListTcpRoutesCallback = (error: (Error|null), response?: google.cloud.networkservices.v1.ListTcpRoutesResponse) => void; + + /** + * Callback as used by {@link google.cloud.networkservices.v1.NetworkServices|getTcpRoute}. + * @param error Error, if any + * @param [response] TcpRoute + */ + type GetTcpRouteCallback = (error: (Error|null), response?: google.cloud.networkservices.v1.TcpRoute) => void; + + /** + * Callback as used by {@link google.cloud.networkservices.v1.NetworkServices|createTcpRoute}. + * @param error Error, if any + * @param [response] Operation + */ + type CreateTcpRouteCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.cloud.networkservices.v1.NetworkServices|updateTcpRoute}. + * @param error Error, if any + * @param [response] Operation + */ + type UpdateTcpRouteCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.cloud.networkservices.v1.NetworkServices|deleteTcpRoute}. + * @param error Error, if any + * @param [response] Operation + */ + type DeleteTcpRouteCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.cloud.networkservices.v1.NetworkServices|listTlsRoutes}. + * @param error Error, if any + * @param [response] ListTlsRoutesResponse + */ + type ListTlsRoutesCallback = (error: (Error|null), response?: google.cloud.networkservices.v1.ListTlsRoutesResponse) => void; + + /** + * Callback as used by {@link google.cloud.networkservices.v1.NetworkServices|getTlsRoute}. + * @param error Error, if any + * @param [response] TlsRoute + */ + type GetTlsRouteCallback = (error: (Error|null), response?: google.cloud.networkservices.v1.TlsRoute) => void; + + /** + * Callback as used by {@link google.cloud.networkservices.v1.NetworkServices|createTlsRoute}. + * @param error Error, if any + * @param [response] Operation + */ + type CreateTlsRouteCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.cloud.networkservices.v1.NetworkServices|updateTlsRoute}. + * @param error Error, if any + * @param [response] Operation + */ + type UpdateTlsRouteCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.cloud.networkservices.v1.NetworkServices|deleteTlsRoute}. + * @param error Error, if any + * @param [response] Operation + */ + type DeleteTlsRouteCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.cloud.networkservices.v1.NetworkServices|listServiceBindings}. + * @param error Error, if any + * @param [response] ListServiceBindingsResponse + */ + type ListServiceBindingsCallback = (error: (Error|null), response?: google.cloud.networkservices.v1.ListServiceBindingsResponse) => void; + + /** + * Callback as used by {@link google.cloud.networkservices.v1.NetworkServices|getServiceBinding}. + * @param error Error, if any + * @param [response] ServiceBinding + */ + type GetServiceBindingCallback = (error: (Error|null), response?: google.cloud.networkservices.v1.ServiceBinding) => void; + + /** + * Callback as used by {@link google.cloud.networkservices.v1.NetworkServices|createServiceBinding}. + * @param error Error, if any + * @param [response] Operation + */ + type CreateServiceBindingCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.cloud.networkservices.v1.NetworkServices|deleteServiceBinding}. + * @param error Error, if any + * @param [response] Operation + */ + type DeleteServiceBindingCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.cloud.networkservices.v1.NetworkServices|listMeshes}. + * @param error Error, if any + * @param [response] ListMeshesResponse + */ + type ListMeshesCallback = (error: (Error|null), response?: google.cloud.networkservices.v1.ListMeshesResponse) => void; + + /** + * Callback as used by {@link google.cloud.networkservices.v1.NetworkServices|getMesh}. + * @param error Error, if any + * @param [response] Mesh + */ + type GetMeshCallback = (error: (Error|null), response?: google.cloud.networkservices.v1.Mesh) => void; + + /** + * Callback as used by {@link google.cloud.networkservices.v1.NetworkServices|createMesh}. + * @param error Error, if any + * @param [response] Operation + */ + type CreateMeshCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.cloud.networkservices.v1.NetworkServices|updateMesh}. + * @param error Error, if any + * @param [response] Operation + */ + type UpdateMeshCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.cloud.networkservices.v1.NetworkServices|deleteMesh}. + * @param error Error, if any + * @param [response] Operation + */ + type DeleteMeshCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + } + + /** Properties of a ServiceBinding. */ + interface IServiceBinding { + + /** ServiceBinding name */ + name?: (string|null); + + /** ServiceBinding description */ + description?: (string|null); + + /** ServiceBinding createTime */ + createTime?: (google.protobuf.ITimestamp|null); + + /** ServiceBinding updateTime */ + updateTime?: (google.protobuf.ITimestamp|null); + + /** ServiceBinding service */ + service?: (string|null); + + /** ServiceBinding labels */ + labels?: ({ [k: string]: string }|null); + } + + /** Represents a ServiceBinding. */ + class ServiceBinding implements IServiceBinding { + + /** + * Constructs a new ServiceBinding. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.networkservices.v1.IServiceBinding); + + /** ServiceBinding name. */ + public name: string; + + /** ServiceBinding description. */ + public description: string; + + /** ServiceBinding createTime. */ + public createTime?: (google.protobuf.ITimestamp|null); + + /** ServiceBinding updateTime. */ + public updateTime?: (google.protobuf.ITimestamp|null); + + /** ServiceBinding service. */ + public service: string; + + /** ServiceBinding labels. */ + public labels: { [k: string]: string }; + + /** + * Creates a new ServiceBinding instance using the specified properties. + * @param [properties] Properties to set + * @returns ServiceBinding instance + */ + public static create(properties?: google.cloud.networkservices.v1.IServiceBinding): google.cloud.networkservices.v1.ServiceBinding; + + /** + * Encodes the specified ServiceBinding message. Does not implicitly {@link google.cloud.networkservices.v1.ServiceBinding.verify|verify} messages. + * @param message ServiceBinding message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.networkservices.v1.IServiceBinding, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ServiceBinding message, length delimited. Does not implicitly {@link google.cloud.networkservices.v1.ServiceBinding.verify|verify} messages. + * @param message ServiceBinding message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.networkservices.v1.IServiceBinding, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ServiceBinding message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ServiceBinding + * @throws {Error} If the payload is not 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.networkservices.v1.ServiceBinding; + + /** + * Decodes a ServiceBinding message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ServiceBinding + * @throws {Error} If the payload 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.networkservices.v1.ServiceBinding; + + /** + * Verifies a ServiceBinding message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ServiceBinding message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ServiceBinding + */ + public static fromObject(object: { [k: string]: any }): google.cloud.networkservices.v1.ServiceBinding; + + /** + * Creates a plain object from a ServiceBinding message. Also converts values to other types if specified. + * @param message ServiceBinding + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.networkservices.v1.ServiceBinding, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ServiceBinding to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ServiceBinding + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListServiceBindingsRequest. */ + interface IListServiceBindingsRequest { + + /** ListServiceBindingsRequest parent */ + parent?: (string|null); + + /** ListServiceBindingsRequest pageSize */ + pageSize?: (number|null); + + /** ListServiceBindingsRequest pageToken */ + pageToken?: (string|null); + } + + /** Represents a ListServiceBindingsRequest. */ + class ListServiceBindingsRequest implements IListServiceBindingsRequest { + + /** + * Constructs a new ListServiceBindingsRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.networkservices.v1.IListServiceBindingsRequest); + + /** ListServiceBindingsRequest parent. */ + public parent: string; + + /** ListServiceBindingsRequest pageSize. */ + public pageSize: number; + + /** ListServiceBindingsRequest pageToken. */ + public pageToken: string; + + /** + * Creates a new ListServiceBindingsRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ListServiceBindingsRequest instance + */ + public static create(properties?: google.cloud.networkservices.v1.IListServiceBindingsRequest): google.cloud.networkservices.v1.ListServiceBindingsRequest; + + /** + * Encodes the specified ListServiceBindingsRequest message. Does not implicitly {@link google.cloud.networkservices.v1.ListServiceBindingsRequest.verify|verify} messages. + * @param message ListServiceBindingsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.networkservices.v1.IListServiceBindingsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListServiceBindingsRequest message, length delimited. Does not implicitly {@link google.cloud.networkservices.v1.ListServiceBindingsRequest.verify|verify} messages. + * @param message ListServiceBindingsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.networkservices.v1.IListServiceBindingsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListServiceBindingsRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListServiceBindingsRequest + * @throws {Error} If the payload is not 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.networkservices.v1.ListServiceBindingsRequest; + + /** + * Decodes a ListServiceBindingsRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListServiceBindingsRequest + * @throws {Error} If the payload 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.networkservices.v1.ListServiceBindingsRequest; + + /** + * Verifies a ListServiceBindingsRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListServiceBindingsRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListServiceBindingsRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.networkservices.v1.ListServiceBindingsRequest; + + /** + * Creates a plain object from a ListServiceBindingsRequest message. Also converts values to other types if specified. + * @param message ListServiceBindingsRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.networkservices.v1.ListServiceBindingsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListServiceBindingsRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListServiceBindingsRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListServiceBindingsResponse. */ + interface IListServiceBindingsResponse { + + /** ListServiceBindingsResponse serviceBindings */ + serviceBindings?: (google.cloud.networkservices.v1.IServiceBinding[]|null); + + /** ListServiceBindingsResponse nextPageToken */ + nextPageToken?: (string|null); + } + + /** Represents a ListServiceBindingsResponse. */ + class ListServiceBindingsResponse implements IListServiceBindingsResponse { + + /** + * Constructs a new ListServiceBindingsResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.networkservices.v1.IListServiceBindingsResponse); + + /** ListServiceBindingsResponse serviceBindings. */ + public serviceBindings: google.cloud.networkservices.v1.IServiceBinding[]; + + /** ListServiceBindingsResponse nextPageToken. */ + public nextPageToken: string; + + /** + * Creates a new ListServiceBindingsResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ListServiceBindingsResponse instance + */ + public static create(properties?: google.cloud.networkservices.v1.IListServiceBindingsResponse): google.cloud.networkservices.v1.ListServiceBindingsResponse; + + /** + * Encodes the specified ListServiceBindingsResponse message. Does not implicitly {@link google.cloud.networkservices.v1.ListServiceBindingsResponse.verify|verify} messages. + * @param message ListServiceBindingsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.networkservices.v1.IListServiceBindingsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListServiceBindingsResponse message, length delimited. Does not implicitly {@link google.cloud.networkservices.v1.ListServiceBindingsResponse.verify|verify} messages. + * @param message ListServiceBindingsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.networkservices.v1.IListServiceBindingsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListServiceBindingsResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListServiceBindingsResponse + * @throws {Error} If the payload is not 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.networkservices.v1.ListServiceBindingsResponse; + + /** + * Decodes a ListServiceBindingsResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListServiceBindingsResponse + * @throws {Error} If the payload 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.networkservices.v1.ListServiceBindingsResponse; + + /** + * Verifies a ListServiceBindingsResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListServiceBindingsResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListServiceBindingsResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.networkservices.v1.ListServiceBindingsResponse; + + /** + * Creates a plain object from a ListServiceBindingsResponse message. Also converts values to other types if specified. + * @param message ListServiceBindingsResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.networkservices.v1.ListServiceBindingsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListServiceBindingsResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListServiceBindingsResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a GetServiceBindingRequest. */ + interface IGetServiceBindingRequest { + + /** GetServiceBindingRequest name */ + name?: (string|null); + } + + /** Represents a GetServiceBindingRequest. */ + class GetServiceBindingRequest implements IGetServiceBindingRequest { + + /** + * Constructs a new GetServiceBindingRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.networkservices.v1.IGetServiceBindingRequest); + + /** GetServiceBindingRequest name. */ + public name: string; + + /** + * Creates a new GetServiceBindingRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GetServiceBindingRequest instance + */ + public static create(properties?: google.cloud.networkservices.v1.IGetServiceBindingRequest): google.cloud.networkservices.v1.GetServiceBindingRequest; + + /** + * Encodes the specified GetServiceBindingRequest message. Does not implicitly {@link google.cloud.networkservices.v1.GetServiceBindingRequest.verify|verify} messages. + * @param message GetServiceBindingRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.networkservices.v1.IGetServiceBindingRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GetServiceBindingRequest message, length delimited. Does not implicitly {@link google.cloud.networkservices.v1.GetServiceBindingRequest.verify|verify} messages. + * @param message GetServiceBindingRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.networkservices.v1.IGetServiceBindingRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GetServiceBindingRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GetServiceBindingRequest + * @throws {Error} If the payload is not 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.networkservices.v1.GetServiceBindingRequest; + + /** + * Decodes a GetServiceBindingRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GetServiceBindingRequest + * @throws {Error} If the payload 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.networkservices.v1.GetServiceBindingRequest; + + /** + * Verifies a GetServiceBindingRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GetServiceBindingRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GetServiceBindingRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.networkservices.v1.GetServiceBindingRequest; + + /** + * Creates a plain object from a GetServiceBindingRequest message. Also converts values to other types if specified. + * @param message GetServiceBindingRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.networkservices.v1.GetServiceBindingRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GetServiceBindingRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GetServiceBindingRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a CreateServiceBindingRequest. */ + interface ICreateServiceBindingRequest { + + /** CreateServiceBindingRequest parent */ + parent?: (string|null); + + /** CreateServiceBindingRequest serviceBindingId */ + serviceBindingId?: (string|null); + + /** CreateServiceBindingRequest serviceBinding */ + serviceBinding?: (google.cloud.networkservices.v1.IServiceBinding|null); + } + + /** Represents a CreateServiceBindingRequest. */ + class CreateServiceBindingRequest implements ICreateServiceBindingRequest { + + /** + * Constructs a new CreateServiceBindingRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.networkservices.v1.ICreateServiceBindingRequest); + + /** CreateServiceBindingRequest parent. */ + public parent: string; + + /** CreateServiceBindingRequest serviceBindingId. */ + public serviceBindingId: string; + + /** CreateServiceBindingRequest serviceBinding. */ + public serviceBinding?: (google.cloud.networkservices.v1.IServiceBinding|null); + + /** + * Creates a new CreateServiceBindingRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns CreateServiceBindingRequest instance + */ + public static create(properties?: google.cloud.networkservices.v1.ICreateServiceBindingRequest): google.cloud.networkservices.v1.CreateServiceBindingRequest; + + /** + * Encodes the specified CreateServiceBindingRequest message. Does not implicitly {@link google.cloud.networkservices.v1.CreateServiceBindingRequest.verify|verify} messages. + * @param message CreateServiceBindingRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.networkservices.v1.ICreateServiceBindingRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CreateServiceBindingRequest message, length delimited. Does not implicitly {@link google.cloud.networkservices.v1.CreateServiceBindingRequest.verify|verify} messages. + * @param message CreateServiceBindingRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.networkservices.v1.ICreateServiceBindingRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CreateServiceBindingRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CreateServiceBindingRequest + * @throws {Error} If the payload is not 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.networkservices.v1.CreateServiceBindingRequest; + + /** + * Decodes a CreateServiceBindingRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CreateServiceBindingRequest + * @throws {Error} If the payload 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.networkservices.v1.CreateServiceBindingRequest; + + /** + * Verifies a CreateServiceBindingRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CreateServiceBindingRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CreateServiceBindingRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.networkservices.v1.CreateServiceBindingRequest; + + /** + * Creates a plain object from a CreateServiceBindingRequest message. Also converts values to other types if specified. + * @param message CreateServiceBindingRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.networkservices.v1.CreateServiceBindingRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CreateServiceBindingRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CreateServiceBindingRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a DeleteServiceBindingRequest. */ + interface IDeleteServiceBindingRequest { + + /** DeleteServiceBindingRequest name */ + name?: (string|null); + } + + /** Represents a DeleteServiceBindingRequest. */ + class DeleteServiceBindingRequest implements IDeleteServiceBindingRequest { + + /** + * Constructs a new DeleteServiceBindingRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.networkservices.v1.IDeleteServiceBindingRequest); + + /** DeleteServiceBindingRequest name. */ + public name: string; + + /** + * Creates a new DeleteServiceBindingRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns DeleteServiceBindingRequest instance + */ + public static create(properties?: google.cloud.networkservices.v1.IDeleteServiceBindingRequest): google.cloud.networkservices.v1.DeleteServiceBindingRequest; + + /** + * Encodes the specified DeleteServiceBindingRequest message. Does not implicitly {@link google.cloud.networkservices.v1.DeleteServiceBindingRequest.verify|verify} messages. + * @param message DeleteServiceBindingRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.networkservices.v1.IDeleteServiceBindingRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DeleteServiceBindingRequest message, length delimited. Does not implicitly {@link google.cloud.networkservices.v1.DeleteServiceBindingRequest.verify|verify} messages. + * @param message DeleteServiceBindingRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.networkservices.v1.IDeleteServiceBindingRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DeleteServiceBindingRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DeleteServiceBindingRequest + * @throws {Error} If the payload is not 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.networkservices.v1.DeleteServiceBindingRequest; + + /** + * Decodes a DeleteServiceBindingRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DeleteServiceBindingRequest + * @throws {Error} If the payload 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.networkservices.v1.DeleteServiceBindingRequest; + + /** + * Verifies a DeleteServiceBindingRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DeleteServiceBindingRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DeleteServiceBindingRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.networkservices.v1.DeleteServiceBindingRequest; + + /** + * Creates a plain object from a DeleteServiceBindingRequest message. Also converts values to other types if specified. + * @param message DeleteServiceBindingRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.networkservices.v1.DeleteServiceBindingRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DeleteServiceBindingRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DeleteServiceBindingRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TcpRoute. */ + interface ITcpRoute { + + /** TcpRoute name */ + name?: (string|null); + + /** TcpRoute selfLink */ + selfLink?: (string|null); + + /** TcpRoute createTime */ + createTime?: (google.protobuf.ITimestamp|null); + + /** TcpRoute updateTime */ + updateTime?: (google.protobuf.ITimestamp|null); + + /** TcpRoute description */ + description?: (string|null); + + /** TcpRoute rules */ + rules?: (google.cloud.networkservices.v1.TcpRoute.IRouteRule[]|null); + + /** TcpRoute meshes */ + meshes?: (string[]|null); + + /** TcpRoute gateways */ + gateways?: (string[]|null); + + /** TcpRoute labels */ + labels?: ({ [k: string]: string }|null); + } + + /** Represents a TcpRoute. */ + class TcpRoute implements ITcpRoute { + + /** + * Constructs a new TcpRoute. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.networkservices.v1.ITcpRoute); + + /** TcpRoute name. */ + public name: string; + + /** TcpRoute selfLink. */ + public selfLink: string; + + /** TcpRoute createTime. */ + public createTime?: (google.protobuf.ITimestamp|null); + + /** TcpRoute updateTime. */ + public updateTime?: (google.protobuf.ITimestamp|null); + + /** TcpRoute description. */ + public description: string; + + /** TcpRoute rules. */ + public rules: google.cloud.networkservices.v1.TcpRoute.IRouteRule[]; + + /** TcpRoute meshes. */ + public meshes: string[]; + + /** TcpRoute gateways. */ + public gateways: string[]; + + /** TcpRoute labels. */ + public labels: { [k: string]: string }; + + /** + * Creates a new TcpRoute instance using the specified properties. + * @param [properties] Properties to set + * @returns TcpRoute instance + */ + public static create(properties?: google.cloud.networkservices.v1.ITcpRoute): google.cloud.networkservices.v1.TcpRoute; + + /** + * Encodes the specified TcpRoute message. Does not implicitly {@link google.cloud.networkservices.v1.TcpRoute.verify|verify} messages. + * @param message TcpRoute message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.networkservices.v1.ITcpRoute, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified TcpRoute message, length delimited. Does not implicitly {@link google.cloud.networkservices.v1.TcpRoute.verify|verify} messages. + * @param message TcpRoute message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.networkservices.v1.ITcpRoute, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TcpRoute message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns TcpRoute + * @throws {Error} If the payload is not 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.networkservices.v1.TcpRoute; + + /** + * Decodes a TcpRoute message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns TcpRoute + * @throws {Error} If the payload 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.networkservices.v1.TcpRoute; + + /** + * Verifies a TcpRoute message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a TcpRoute message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns TcpRoute + */ + public static fromObject(object: { [k: string]: any }): google.cloud.networkservices.v1.TcpRoute; + + /** + * Creates a plain object from a TcpRoute message. Also converts values to other types if specified. + * @param message TcpRoute + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.networkservices.v1.TcpRoute, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this TcpRoute to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for TcpRoute + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace TcpRoute { + + /** Properties of a RouteRule. */ + interface IRouteRule { + + /** RouteRule matches */ + matches?: (google.cloud.networkservices.v1.TcpRoute.IRouteMatch[]|null); + + /** RouteRule action */ + action?: (google.cloud.networkservices.v1.TcpRoute.IRouteAction|null); + } + + /** Represents a RouteRule. */ + class RouteRule implements IRouteRule { + + /** + * Constructs a new RouteRule. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.networkservices.v1.TcpRoute.IRouteRule); + + /** RouteRule matches. */ + public matches: google.cloud.networkservices.v1.TcpRoute.IRouteMatch[]; + + /** RouteRule action. */ + public action?: (google.cloud.networkservices.v1.TcpRoute.IRouteAction|null); + + /** + * Creates a new RouteRule instance using the specified properties. + * @param [properties] Properties to set + * @returns RouteRule instance + */ + public static create(properties?: google.cloud.networkservices.v1.TcpRoute.IRouteRule): google.cloud.networkservices.v1.TcpRoute.RouteRule; + + /** + * Encodes the specified RouteRule message. Does not implicitly {@link google.cloud.networkservices.v1.TcpRoute.RouteRule.verify|verify} messages. + * @param message RouteRule message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.networkservices.v1.TcpRoute.IRouteRule, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified RouteRule message, length delimited. Does not implicitly {@link google.cloud.networkservices.v1.TcpRoute.RouteRule.verify|verify} messages. + * @param message RouteRule message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.networkservices.v1.TcpRoute.IRouteRule, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a RouteRule message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns RouteRule + * @throws {Error} If the payload is not 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.networkservices.v1.TcpRoute.RouteRule; + + /** + * Decodes a RouteRule message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns RouteRule + * @throws {Error} If the payload 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.networkservices.v1.TcpRoute.RouteRule; + + /** + * Verifies a RouteRule message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a RouteRule message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns RouteRule + */ + public static fromObject(object: { [k: string]: any }): google.cloud.networkservices.v1.TcpRoute.RouteRule; + + /** + * Creates a plain object from a RouteRule message. Also converts values to other types if specified. + * @param message RouteRule + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.networkservices.v1.TcpRoute.RouteRule, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this RouteRule to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for RouteRule + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a RouteMatch. */ + interface IRouteMatch { + + /** RouteMatch address */ + address?: (string|null); + + /** RouteMatch port */ + port?: (string|null); + } + + /** Represents a RouteMatch. */ + class RouteMatch implements IRouteMatch { + + /** + * Constructs a new RouteMatch. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.networkservices.v1.TcpRoute.IRouteMatch); + + /** RouteMatch address. */ + public address: string; + + /** RouteMatch port. */ + public port: string; + + /** + * Creates a new RouteMatch instance using the specified properties. + * @param [properties] Properties to set + * @returns RouteMatch instance + */ + public static create(properties?: google.cloud.networkservices.v1.TcpRoute.IRouteMatch): google.cloud.networkservices.v1.TcpRoute.RouteMatch; + + /** + * Encodes the specified RouteMatch message. Does not implicitly {@link google.cloud.networkservices.v1.TcpRoute.RouteMatch.verify|verify} messages. + * @param message RouteMatch message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.networkservices.v1.TcpRoute.IRouteMatch, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified RouteMatch message, length delimited. Does not implicitly {@link google.cloud.networkservices.v1.TcpRoute.RouteMatch.verify|verify} messages. + * @param message RouteMatch message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.networkservices.v1.TcpRoute.IRouteMatch, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a RouteMatch message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns RouteMatch + * @throws {Error} If the payload is not 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.networkservices.v1.TcpRoute.RouteMatch; + + /** + * Decodes a RouteMatch message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns RouteMatch + * @throws {Error} If the payload 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.networkservices.v1.TcpRoute.RouteMatch; + + /** + * Verifies a RouteMatch message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a RouteMatch message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns RouteMatch + */ + public static fromObject(object: { [k: string]: any }): google.cloud.networkservices.v1.TcpRoute.RouteMatch; + + /** + * Creates a plain object from a RouteMatch message. Also converts values to other types if specified. + * @param message RouteMatch + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.networkservices.v1.TcpRoute.RouteMatch, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this RouteMatch to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for RouteMatch + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a RouteAction. */ + interface IRouteAction { + + /** RouteAction destinations */ + destinations?: (google.cloud.networkservices.v1.TcpRoute.IRouteDestination[]|null); + + /** RouteAction originalDestination */ + originalDestination?: (boolean|null); + } + + /** Represents a RouteAction. */ + class RouteAction implements IRouteAction { + + /** + * Constructs a new RouteAction. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.networkservices.v1.TcpRoute.IRouteAction); + + /** RouteAction destinations. */ + public destinations: google.cloud.networkservices.v1.TcpRoute.IRouteDestination[]; + + /** RouteAction originalDestination. */ + public originalDestination: boolean; + + /** + * Creates a new RouteAction instance using the specified properties. + * @param [properties] Properties to set + * @returns RouteAction instance + */ + public static create(properties?: google.cloud.networkservices.v1.TcpRoute.IRouteAction): google.cloud.networkservices.v1.TcpRoute.RouteAction; + + /** + * Encodes the specified RouteAction message. Does not implicitly {@link google.cloud.networkservices.v1.TcpRoute.RouteAction.verify|verify} messages. + * @param message RouteAction message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.networkservices.v1.TcpRoute.IRouteAction, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified RouteAction message, length delimited. Does not implicitly {@link google.cloud.networkservices.v1.TcpRoute.RouteAction.verify|verify} messages. + * @param message RouteAction message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.networkservices.v1.TcpRoute.IRouteAction, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a RouteAction message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns RouteAction + * @throws {Error} If the payload is not 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.networkservices.v1.TcpRoute.RouteAction; + + /** + * Decodes a RouteAction message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns RouteAction + * @throws {Error} If the payload 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.networkservices.v1.TcpRoute.RouteAction; + + /** + * Verifies a RouteAction message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a RouteAction message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns RouteAction + */ + public static fromObject(object: { [k: string]: any }): google.cloud.networkservices.v1.TcpRoute.RouteAction; + + /** + * Creates a plain object from a RouteAction message. Also converts values to other types if specified. + * @param message RouteAction + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.networkservices.v1.TcpRoute.RouteAction, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this RouteAction to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for RouteAction + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a RouteDestination. */ + interface IRouteDestination { + + /** RouteDestination serviceName */ + serviceName?: (string|null); + + /** RouteDestination weight */ + weight?: (number|null); + } + + /** Represents a RouteDestination. */ + class RouteDestination implements IRouteDestination { + + /** + * Constructs a new RouteDestination. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.networkservices.v1.TcpRoute.IRouteDestination); + + /** RouteDestination serviceName. */ + public serviceName: string; + + /** RouteDestination weight. */ + public weight: number; + + /** + * Creates a new RouteDestination instance using the specified properties. + * @param [properties] Properties to set + * @returns RouteDestination instance + */ + public static create(properties?: google.cloud.networkservices.v1.TcpRoute.IRouteDestination): google.cloud.networkservices.v1.TcpRoute.RouteDestination; + + /** + * Encodes the specified RouteDestination message. Does not implicitly {@link google.cloud.networkservices.v1.TcpRoute.RouteDestination.verify|verify} messages. + * @param message RouteDestination message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.networkservices.v1.TcpRoute.IRouteDestination, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified RouteDestination message, length delimited. Does not implicitly {@link google.cloud.networkservices.v1.TcpRoute.RouteDestination.verify|verify} messages. + * @param message RouteDestination message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.networkservices.v1.TcpRoute.IRouteDestination, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a RouteDestination message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns RouteDestination + * @throws {Error} If the payload is not 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.networkservices.v1.TcpRoute.RouteDestination; + + /** + * Decodes a RouteDestination message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns RouteDestination + * @throws {Error} If the payload 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.networkservices.v1.TcpRoute.RouteDestination; + + /** + * Verifies a RouteDestination message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a RouteDestination message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns RouteDestination + */ + public static fromObject(object: { [k: string]: any }): google.cloud.networkservices.v1.TcpRoute.RouteDestination; + + /** + * Creates a plain object from a RouteDestination message. Also converts values to other types if specified. + * @param message RouteDestination + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.networkservices.v1.TcpRoute.RouteDestination, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this RouteDestination to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for RouteDestination + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Properties of a ListTcpRoutesRequest. */ + interface IListTcpRoutesRequest { + + /** ListTcpRoutesRequest parent */ + parent?: (string|null); + + /** ListTcpRoutesRequest pageSize */ + pageSize?: (number|null); + + /** ListTcpRoutesRequest pageToken */ + pageToken?: (string|null); + } + + /** Represents a ListTcpRoutesRequest. */ + class ListTcpRoutesRequest implements IListTcpRoutesRequest { + + /** + * Constructs a new ListTcpRoutesRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.networkservices.v1.IListTcpRoutesRequest); + + /** ListTcpRoutesRequest parent. */ + public parent: string; + + /** ListTcpRoutesRequest pageSize. */ + public pageSize: number; + + /** ListTcpRoutesRequest pageToken. */ + public pageToken: string; + + /** + * Creates a new ListTcpRoutesRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ListTcpRoutesRequest instance + */ + public static create(properties?: google.cloud.networkservices.v1.IListTcpRoutesRequest): google.cloud.networkservices.v1.ListTcpRoutesRequest; + + /** + * Encodes the specified ListTcpRoutesRequest message. Does not implicitly {@link google.cloud.networkservices.v1.ListTcpRoutesRequest.verify|verify} messages. + * @param message ListTcpRoutesRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.networkservices.v1.IListTcpRoutesRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListTcpRoutesRequest message, length delimited. Does not implicitly {@link google.cloud.networkservices.v1.ListTcpRoutesRequest.verify|verify} messages. + * @param message ListTcpRoutesRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.networkservices.v1.IListTcpRoutesRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListTcpRoutesRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListTcpRoutesRequest + * @throws {Error} If the payload is not 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.networkservices.v1.ListTcpRoutesRequest; + + /** + * Decodes a ListTcpRoutesRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListTcpRoutesRequest + * @throws {Error} If the payload 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.networkservices.v1.ListTcpRoutesRequest; + + /** + * Verifies a ListTcpRoutesRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListTcpRoutesRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListTcpRoutesRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.networkservices.v1.ListTcpRoutesRequest; + + /** + * Creates a plain object from a ListTcpRoutesRequest message. Also converts values to other types if specified. + * @param message ListTcpRoutesRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.networkservices.v1.ListTcpRoutesRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListTcpRoutesRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListTcpRoutesRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListTcpRoutesResponse. */ + interface IListTcpRoutesResponse { + + /** ListTcpRoutesResponse tcpRoutes */ + tcpRoutes?: (google.cloud.networkservices.v1.ITcpRoute[]|null); + + /** ListTcpRoutesResponse nextPageToken */ + nextPageToken?: (string|null); + } + + /** Represents a ListTcpRoutesResponse. */ + class ListTcpRoutesResponse implements IListTcpRoutesResponse { + + /** + * Constructs a new ListTcpRoutesResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.networkservices.v1.IListTcpRoutesResponse); + + /** ListTcpRoutesResponse tcpRoutes. */ + public tcpRoutes: google.cloud.networkservices.v1.ITcpRoute[]; + + /** ListTcpRoutesResponse nextPageToken. */ + public nextPageToken: string; + + /** + * Creates a new ListTcpRoutesResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ListTcpRoutesResponse instance + */ + public static create(properties?: google.cloud.networkservices.v1.IListTcpRoutesResponse): google.cloud.networkservices.v1.ListTcpRoutesResponse; + + /** + * Encodes the specified ListTcpRoutesResponse message. Does not implicitly {@link google.cloud.networkservices.v1.ListTcpRoutesResponse.verify|verify} messages. + * @param message ListTcpRoutesResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.networkservices.v1.IListTcpRoutesResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListTcpRoutesResponse message, length delimited. Does not implicitly {@link google.cloud.networkservices.v1.ListTcpRoutesResponse.verify|verify} messages. + * @param message ListTcpRoutesResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.networkservices.v1.IListTcpRoutesResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListTcpRoutesResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListTcpRoutesResponse + * @throws {Error} If the payload is not 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.networkservices.v1.ListTcpRoutesResponse; + + /** + * Decodes a ListTcpRoutesResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListTcpRoutesResponse + * @throws {Error} If the payload 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.networkservices.v1.ListTcpRoutesResponse; + + /** + * Verifies a ListTcpRoutesResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListTcpRoutesResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListTcpRoutesResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.networkservices.v1.ListTcpRoutesResponse; + + /** + * Creates a plain object from a ListTcpRoutesResponse message. Also converts values to other types if specified. + * @param message ListTcpRoutesResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.networkservices.v1.ListTcpRoutesResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListTcpRoutesResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListTcpRoutesResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a GetTcpRouteRequest. */ + interface IGetTcpRouteRequest { + + /** GetTcpRouteRequest name */ + name?: (string|null); + } + + /** Represents a GetTcpRouteRequest. */ + class GetTcpRouteRequest implements IGetTcpRouteRequest { + + /** + * Constructs a new GetTcpRouteRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.networkservices.v1.IGetTcpRouteRequest); + + /** GetTcpRouteRequest name. */ + public name: string; + + /** + * Creates a new GetTcpRouteRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GetTcpRouteRequest instance + */ + public static create(properties?: google.cloud.networkservices.v1.IGetTcpRouteRequest): google.cloud.networkservices.v1.GetTcpRouteRequest; + + /** + * Encodes the specified GetTcpRouteRequest message. Does not implicitly {@link google.cloud.networkservices.v1.GetTcpRouteRequest.verify|verify} messages. + * @param message GetTcpRouteRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.networkservices.v1.IGetTcpRouteRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GetTcpRouteRequest message, length delimited. Does not implicitly {@link google.cloud.networkservices.v1.GetTcpRouteRequest.verify|verify} messages. + * @param message GetTcpRouteRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.networkservices.v1.IGetTcpRouteRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GetTcpRouteRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GetTcpRouteRequest + * @throws {Error} If the payload is not 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.networkservices.v1.GetTcpRouteRequest; + + /** + * Decodes a GetTcpRouteRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GetTcpRouteRequest + * @throws {Error} If the payload 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.networkservices.v1.GetTcpRouteRequest; + + /** + * Verifies a GetTcpRouteRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GetTcpRouteRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GetTcpRouteRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.networkservices.v1.GetTcpRouteRequest; + + /** + * Creates a plain object from a GetTcpRouteRequest message. Also converts values to other types if specified. + * @param message GetTcpRouteRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.networkservices.v1.GetTcpRouteRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GetTcpRouteRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GetTcpRouteRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a CreateTcpRouteRequest. */ + interface ICreateTcpRouteRequest { + + /** CreateTcpRouteRequest parent */ + parent?: (string|null); + + /** CreateTcpRouteRequest tcpRouteId */ + tcpRouteId?: (string|null); + + /** CreateTcpRouteRequest tcpRoute */ + tcpRoute?: (google.cloud.networkservices.v1.ITcpRoute|null); + } + + /** Represents a CreateTcpRouteRequest. */ + class CreateTcpRouteRequest implements ICreateTcpRouteRequest { + + /** + * Constructs a new CreateTcpRouteRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.networkservices.v1.ICreateTcpRouteRequest); + + /** CreateTcpRouteRequest parent. */ + public parent: string; + + /** CreateTcpRouteRequest tcpRouteId. */ + public tcpRouteId: string; + + /** CreateTcpRouteRequest tcpRoute. */ + public tcpRoute?: (google.cloud.networkservices.v1.ITcpRoute|null); + + /** + * Creates a new CreateTcpRouteRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns CreateTcpRouteRequest instance + */ + public static create(properties?: google.cloud.networkservices.v1.ICreateTcpRouteRequest): google.cloud.networkservices.v1.CreateTcpRouteRequest; + + /** + * Encodes the specified CreateTcpRouteRequest message. Does not implicitly {@link google.cloud.networkservices.v1.CreateTcpRouteRequest.verify|verify} messages. + * @param message CreateTcpRouteRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.networkservices.v1.ICreateTcpRouteRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CreateTcpRouteRequest message, length delimited. Does not implicitly {@link google.cloud.networkservices.v1.CreateTcpRouteRequest.verify|verify} messages. + * @param message CreateTcpRouteRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.networkservices.v1.ICreateTcpRouteRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CreateTcpRouteRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CreateTcpRouteRequest + * @throws {Error} If the payload is not 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.networkservices.v1.CreateTcpRouteRequest; + + /** + * Decodes a CreateTcpRouteRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CreateTcpRouteRequest + * @throws {Error} If the payload 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.networkservices.v1.CreateTcpRouteRequest; + + /** + * Verifies a CreateTcpRouteRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CreateTcpRouteRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CreateTcpRouteRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.networkservices.v1.CreateTcpRouteRequest; + + /** + * Creates a plain object from a CreateTcpRouteRequest message. Also converts values to other types if specified. + * @param message CreateTcpRouteRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.networkservices.v1.CreateTcpRouteRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CreateTcpRouteRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CreateTcpRouteRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an UpdateTcpRouteRequest. */ + interface IUpdateTcpRouteRequest { + + /** UpdateTcpRouteRequest updateMask */ + updateMask?: (google.protobuf.IFieldMask|null); + + /** UpdateTcpRouteRequest tcpRoute */ + tcpRoute?: (google.cloud.networkservices.v1.ITcpRoute|null); + } + + /** Represents an UpdateTcpRouteRequest. */ + class UpdateTcpRouteRequest implements IUpdateTcpRouteRequest { + + /** + * Constructs a new UpdateTcpRouteRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.networkservices.v1.IUpdateTcpRouteRequest); + + /** UpdateTcpRouteRequest updateMask. */ + public updateMask?: (google.protobuf.IFieldMask|null); + + /** UpdateTcpRouteRequest tcpRoute. */ + public tcpRoute?: (google.cloud.networkservices.v1.ITcpRoute|null); + + /** + * Creates a new UpdateTcpRouteRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns UpdateTcpRouteRequest instance + */ + public static create(properties?: google.cloud.networkservices.v1.IUpdateTcpRouteRequest): google.cloud.networkservices.v1.UpdateTcpRouteRequest; + + /** + * Encodes the specified UpdateTcpRouteRequest message. Does not implicitly {@link google.cloud.networkservices.v1.UpdateTcpRouteRequest.verify|verify} messages. + * @param message UpdateTcpRouteRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.networkservices.v1.IUpdateTcpRouteRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified UpdateTcpRouteRequest message, length delimited. Does not implicitly {@link google.cloud.networkservices.v1.UpdateTcpRouteRequest.verify|verify} messages. + * @param message UpdateTcpRouteRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.networkservices.v1.IUpdateTcpRouteRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an UpdateTcpRouteRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns UpdateTcpRouteRequest + * @throws {Error} If the payload is not 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.networkservices.v1.UpdateTcpRouteRequest; + + /** + * Decodes an UpdateTcpRouteRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns UpdateTcpRouteRequest + * @throws {Error} If the payload 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.networkservices.v1.UpdateTcpRouteRequest; + + /** + * Verifies an UpdateTcpRouteRequest message. + * @param message Plain 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 UpdateTcpRouteRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns UpdateTcpRouteRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.networkservices.v1.UpdateTcpRouteRequest; + + /** + * Creates a plain object from an UpdateTcpRouteRequest message. Also converts values to other types if specified. + * @param message UpdateTcpRouteRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.networkservices.v1.UpdateTcpRouteRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this UpdateTcpRouteRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for UpdateTcpRouteRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a DeleteTcpRouteRequest. */ + interface IDeleteTcpRouteRequest { + + /** DeleteTcpRouteRequest name */ + name?: (string|null); + } + + /** Represents a DeleteTcpRouteRequest. */ + class DeleteTcpRouteRequest implements IDeleteTcpRouteRequest { + + /** + * Constructs a new DeleteTcpRouteRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.networkservices.v1.IDeleteTcpRouteRequest); + + /** DeleteTcpRouteRequest name. */ + public name: string; + + /** + * Creates a new DeleteTcpRouteRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns DeleteTcpRouteRequest instance + */ + public static create(properties?: google.cloud.networkservices.v1.IDeleteTcpRouteRequest): google.cloud.networkservices.v1.DeleteTcpRouteRequest; + + /** + * Encodes the specified DeleteTcpRouteRequest message. Does not implicitly {@link google.cloud.networkservices.v1.DeleteTcpRouteRequest.verify|verify} messages. + * @param message DeleteTcpRouteRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.networkservices.v1.IDeleteTcpRouteRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DeleteTcpRouteRequest message, length delimited. Does not implicitly {@link google.cloud.networkservices.v1.DeleteTcpRouteRequest.verify|verify} messages. + * @param message DeleteTcpRouteRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.networkservices.v1.IDeleteTcpRouteRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DeleteTcpRouteRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DeleteTcpRouteRequest + * @throws {Error} If the payload is not 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.networkservices.v1.DeleteTcpRouteRequest; + + /** + * Decodes a DeleteTcpRouteRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DeleteTcpRouteRequest + * @throws {Error} If the payload 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.networkservices.v1.DeleteTcpRouteRequest; + + /** + * Verifies a DeleteTcpRouteRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DeleteTcpRouteRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DeleteTcpRouteRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.networkservices.v1.DeleteTcpRouteRequest; + + /** + * Creates a plain object from a DeleteTcpRouteRequest message. Also converts values to other types if specified. + * @param message DeleteTcpRouteRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.networkservices.v1.DeleteTcpRouteRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DeleteTcpRouteRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DeleteTcpRouteRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TlsRoute. */ + interface ITlsRoute { + + /** TlsRoute name */ + name?: (string|null); + + /** TlsRoute selfLink */ + selfLink?: (string|null); + + /** TlsRoute createTime */ + createTime?: (google.protobuf.ITimestamp|null); + + /** TlsRoute updateTime */ + updateTime?: (google.protobuf.ITimestamp|null); + + /** TlsRoute description */ + description?: (string|null); + + /** TlsRoute rules */ + rules?: (google.cloud.networkservices.v1.TlsRoute.IRouteRule[]|null); + + /** TlsRoute meshes */ + meshes?: (string[]|null); + + /** TlsRoute gateways */ + gateways?: (string[]|null); + } + + /** Represents a TlsRoute. */ + class TlsRoute implements ITlsRoute { + + /** + * Constructs a new TlsRoute. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.networkservices.v1.ITlsRoute); + + /** TlsRoute name. */ + public name: string; + + /** TlsRoute selfLink. */ + public selfLink: string; + + /** TlsRoute createTime. */ + public createTime?: (google.protobuf.ITimestamp|null); + + /** TlsRoute updateTime. */ + public updateTime?: (google.protobuf.ITimestamp|null); + + /** TlsRoute description. */ + public description: string; + + /** TlsRoute rules. */ + public rules: google.cloud.networkservices.v1.TlsRoute.IRouteRule[]; + + /** TlsRoute meshes. */ + public meshes: string[]; + + /** TlsRoute gateways. */ + public gateways: string[]; + + /** + * Creates a new TlsRoute instance using the specified properties. + * @param [properties] Properties to set + * @returns TlsRoute instance + */ + public static create(properties?: google.cloud.networkservices.v1.ITlsRoute): google.cloud.networkservices.v1.TlsRoute; + + /** + * Encodes the specified TlsRoute message. Does not implicitly {@link google.cloud.networkservices.v1.TlsRoute.verify|verify} messages. + * @param message TlsRoute message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.networkservices.v1.ITlsRoute, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified TlsRoute message, length delimited. Does not implicitly {@link google.cloud.networkservices.v1.TlsRoute.verify|verify} messages. + * @param message TlsRoute message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.networkservices.v1.ITlsRoute, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TlsRoute message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns TlsRoute + * @throws {Error} If the payload is not 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.networkservices.v1.TlsRoute; + + /** + * Decodes a TlsRoute message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns TlsRoute + * @throws {Error} If the payload 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.networkservices.v1.TlsRoute; + + /** + * Verifies a TlsRoute message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a TlsRoute message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns TlsRoute + */ + public static fromObject(object: { [k: string]: any }): google.cloud.networkservices.v1.TlsRoute; + + /** + * Creates a plain object from a TlsRoute message. Also converts values to other types if specified. + * @param message TlsRoute + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.networkservices.v1.TlsRoute, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this TlsRoute to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for TlsRoute + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace TlsRoute { + + /** Properties of a RouteRule. */ + interface IRouteRule { + + /** RouteRule matches */ + matches?: (google.cloud.networkservices.v1.TlsRoute.IRouteMatch[]|null); + + /** RouteRule action */ + action?: (google.cloud.networkservices.v1.TlsRoute.IRouteAction|null); + } + + /** Represents a RouteRule. */ + class RouteRule implements IRouteRule { + + /** + * Constructs a new RouteRule. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.networkservices.v1.TlsRoute.IRouteRule); + + /** RouteRule matches. */ + public matches: google.cloud.networkservices.v1.TlsRoute.IRouteMatch[]; + + /** RouteRule action. */ + public action?: (google.cloud.networkservices.v1.TlsRoute.IRouteAction|null); + + /** + * Creates a new RouteRule instance using the specified properties. + * @param [properties] Properties to set + * @returns RouteRule instance + */ + public static create(properties?: google.cloud.networkservices.v1.TlsRoute.IRouteRule): google.cloud.networkservices.v1.TlsRoute.RouteRule; + + /** + * Encodes the specified RouteRule message. Does not implicitly {@link google.cloud.networkservices.v1.TlsRoute.RouteRule.verify|verify} messages. + * @param message RouteRule message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.networkservices.v1.TlsRoute.IRouteRule, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified RouteRule message, length delimited. Does not implicitly {@link google.cloud.networkservices.v1.TlsRoute.RouteRule.verify|verify} messages. + * @param message RouteRule message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.networkservices.v1.TlsRoute.IRouteRule, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a RouteRule message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns RouteRule + * @throws {Error} If the payload is not 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.networkservices.v1.TlsRoute.RouteRule; + + /** + * Decodes a RouteRule message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns RouteRule + * @throws {Error} If the payload 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.networkservices.v1.TlsRoute.RouteRule; + + /** + * Verifies a RouteRule message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a RouteRule message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns RouteRule + */ + public static fromObject(object: { [k: string]: any }): google.cloud.networkservices.v1.TlsRoute.RouteRule; + + /** + * Creates a plain object from a RouteRule message. Also converts values to other types if specified. + * @param message RouteRule + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.networkservices.v1.TlsRoute.RouteRule, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this RouteRule to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for RouteRule + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a RouteMatch. */ + interface IRouteMatch { + + /** RouteMatch sniHost */ + sniHost?: (string[]|null); + + /** RouteMatch alpn */ + alpn?: (string[]|null); + } + + /** Represents a RouteMatch. */ + class RouteMatch implements IRouteMatch { + + /** + * Constructs a new RouteMatch. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.networkservices.v1.TlsRoute.IRouteMatch); + + /** RouteMatch sniHost. */ + public sniHost: string[]; + + /** RouteMatch alpn. */ + public alpn: string[]; + + /** + * Creates a new RouteMatch instance using the specified properties. + * @param [properties] Properties to set + * @returns RouteMatch instance + */ + public static create(properties?: google.cloud.networkservices.v1.TlsRoute.IRouteMatch): google.cloud.networkservices.v1.TlsRoute.RouteMatch; + + /** + * Encodes the specified RouteMatch message. Does not implicitly {@link google.cloud.networkservices.v1.TlsRoute.RouteMatch.verify|verify} messages. + * @param message RouteMatch message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.networkservices.v1.TlsRoute.IRouteMatch, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified RouteMatch message, length delimited. Does not implicitly {@link google.cloud.networkservices.v1.TlsRoute.RouteMatch.verify|verify} messages. + * @param message RouteMatch message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.networkservices.v1.TlsRoute.IRouteMatch, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a RouteMatch message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns RouteMatch + * @throws {Error} If the payload is not 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.networkservices.v1.TlsRoute.RouteMatch; + + /** + * Decodes a RouteMatch message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns RouteMatch + * @throws {Error} If the payload 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.networkservices.v1.TlsRoute.RouteMatch; + + /** + * Verifies a RouteMatch message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a RouteMatch message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns RouteMatch + */ + public static fromObject(object: { [k: string]: any }): google.cloud.networkservices.v1.TlsRoute.RouteMatch; + + /** + * Creates a plain object from a RouteMatch message. Also converts values to other types if specified. + * @param message RouteMatch + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.networkservices.v1.TlsRoute.RouteMatch, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this RouteMatch to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for RouteMatch + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a RouteAction. */ + interface IRouteAction { + + /** RouteAction destinations */ + destinations?: (google.cloud.networkservices.v1.TlsRoute.IRouteDestination[]|null); + } + + /** Represents a RouteAction. */ + class RouteAction implements IRouteAction { + + /** + * Constructs a new RouteAction. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.networkservices.v1.TlsRoute.IRouteAction); + + /** RouteAction destinations. */ + public destinations: google.cloud.networkservices.v1.TlsRoute.IRouteDestination[]; + + /** + * Creates a new RouteAction instance using the specified properties. + * @param [properties] Properties to set + * @returns RouteAction instance + */ + public static create(properties?: google.cloud.networkservices.v1.TlsRoute.IRouteAction): google.cloud.networkservices.v1.TlsRoute.RouteAction; + + /** + * Encodes the specified RouteAction message. Does not implicitly {@link google.cloud.networkservices.v1.TlsRoute.RouteAction.verify|verify} messages. + * @param message RouteAction message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.networkservices.v1.TlsRoute.IRouteAction, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified RouteAction message, length delimited. Does not implicitly {@link google.cloud.networkservices.v1.TlsRoute.RouteAction.verify|verify} messages. + * @param message RouteAction message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.networkservices.v1.TlsRoute.IRouteAction, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a RouteAction message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns RouteAction + * @throws {Error} If the payload is not 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.networkservices.v1.TlsRoute.RouteAction; + + /** + * Decodes a RouteAction message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns RouteAction + * @throws {Error} If the payload 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.networkservices.v1.TlsRoute.RouteAction; + + /** + * Verifies a RouteAction message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a RouteAction message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns RouteAction + */ + public static fromObject(object: { [k: string]: any }): google.cloud.networkservices.v1.TlsRoute.RouteAction; + + /** + * Creates a plain object from a RouteAction message. Also converts values to other types if specified. + * @param message RouteAction + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.networkservices.v1.TlsRoute.RouteAction, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this RouteAction to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for RouteAction + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a RouteDestination. */ + interface IRouteDestination { + + /** RouteDestination serviceName */ + serviceName?: (string|null); + + /** RouteDestination weight */ + weight?: (number|null); + } + + /** Represents a RouteDestination. */ + class RouteDestination implements IRouteDestination { + + /** + * Constructs a new RouteDestination. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.networkservices.v1.TlsRoute.IRouteDestination); + + /** RouteDestination serviceName. */ + public serviceName: string; + + /** RouteDestination weight. */ + public weight: number; + + /** + * Creates a new RouteDestination instance using the specified properties. + * @param [properties] Properties to set + * @returns RouteDestination instance + */ + public static create(properties?: google.cloud.networkservices.v1.TlsRoute.IRouteDestination): google.cloud.networkservices.v1.TlsRoute.RouteDestination; + + /** + * Encodes the specified RouteDestination message. Does not implicitly {@link google.cloud.networkservices.v1.TlsRoute.RouteDestination.verify|verify} messages. + * @param message RouteDestination message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.networkservices.v1.TlsRoute.IRouteDestination, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified RouteDestination message, length delimited. Does not implicitly {@link google.cloud.networkservices.v1.TlsRoute.RouteDestination.verify|verify} messages. + * @param message RouteDestination message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.networkservices.v1.TlsRoute.IRouteDestination, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a RouteDestination message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns RouteDestination + * @throws {Error} If the payload is not 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.networkservices.v1.TlsRoute.RouteDestination; + + /** + * Decodes a RouteDestination message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns RouteDestination + * @throws {Error} If the payload 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.networkservices.v1.TlsRoute.RouteDestination; + + /** + * Verifies a RouteDestination message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a RouteDestination message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns RouteDestination + */ + public static fromObject(object: { [k: string]: any }): google.cloud.networkservices.v1.TlsRoute.RouteDestination; + + /** + * Creates a plain object from a RouteDestination message. Also converts values to other types if specified. + * @param message RouteDestination + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.networkservices.v1.TlsRoute.RouteDestination, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this RouteDestination to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for RouteDestination + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Properties of a ListTlsRoutesRequest. */ + interface IListTlsRoutesRequest { + + /** ListTlsRoutesRequest parent */ + parent?: (string|null); + + /** ListTlsRoutesRequest pageSize */ + pageSize?: (number|null); + + /** ListTlsRoutesRequest pageToken */ + pageToken?: (string|null); + } + + /** Represents a ListTlsRoutesRequest. */ + class ListTlsRoutesRequest implements IListTlsRoutesRequest { + + /** + * Constructs a new ListTlsRoutesRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.networkservices.v1.IListTlsRoutesRequest); + + /** ListTlsRoutesRequest parent. */ + public parent: string; + + /** ListTlsRoutesRequest pageSize. */ + public pageSize: number; + + /** ListTlsRoutesRequest pageToken. */ + public pageToken: string; + + /** + * Creates a new ListTlsRoutesRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ListTlsRoutesRequest instance + */ + public static create(properties?: google.cloud.networkservices.v1.IListTlsRoutesRequest): google.cloud.networkservices.v1.ListTlsRoutesRequest; + + /** + * Encodes the specified ListTlsRoutesRequest message. Does not implicitly {@link google.cloud.networkservices.v1.ListTlsRoutesRequest.verify|verify} messages. + * @param message ListTlsRoutesRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.networkservices.v1.IListTlsRoutesRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListTlsRoutesRequest message, length delimited. Does not implicitly {@link google.cloud.networkservices.v1.ListTlsRoutesRequest.verify|verify} messages. + * @param message ListTlsRoutesRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.networkservices.v1.IListTlsRoutesRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListTlsRoutesRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListTlsRoutesRequest + * @throws {Error} If the payload is not 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.networkservices.v1.ListTlsRoutesRequest; + + /** + * Decodes a ListTlsRoutesRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListTlsRoutesRequest + * @throws {Error} If the payload 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.networkservices.v1.ListTlsRoutesRequest; + + /** + * Verifies a ListTlsRoutesRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListTlsRoutesRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListTlsRoutesRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.networkservices.v1.ListTlsRoutesRequest; + + /** + * Creates a plain object from a ListTlsRoutesRequest message. Also converts values to other types if specified. + * @param message ListTlsRoutesRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.networkservices.v1.ListTlsRoutesRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListTlsRoutesRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListTlsRoutesRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListTlsRoutesResponse. */ + interface IListTlsRoutesResponse { + + /** ListTlsRoutesResponse tlsRoutes */ + tlsRoutes?: (google.cloud.networkservices.v1.ITlsRoute[]|null); + + /** ListTlsRoutesResponse nextPageToken */ + nextPageToken?: (string|null); + } + + /** Represents a ListTlsRoutesResponse. */ + class ListTlsRoutesResponse implements IListTlsRoutesResponse { + + /** + * Constructs a new ListTlsRoutesResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.networkservices.v1.IListTlsRoutesResponse); + + /** ListTlsRoutesResponse tlsRoutes. */ + public tlsRoutes: google.cloud.networkservices.v1.ITlsRoute[]; + + /** ListTlsRoutesResponse nextPageToken. */ + public nextPageToken: string; + + /** + * Creates a new ListTlsRoutesResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ListTlsRoutesResponse instance + */ + public static create(properties?: google.cloud.networkservices.v1.IListTlsRoutesResponse): google.cloud.networkservices.v1.ListTlsRoutesResponse; + + /** + * Encodes the specified ListTlsRoutesResponse message. Does not implicitly {@link google.cloud.networkservices.v1.ListTlsRoutesResponse.verify|verify} messages. + * @param message ListTlsRoutesResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.networkservices.v1.IListTlsRoutesResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListTlsRoutesResponse message, length delimited. Does not implicitly {@link google.cloud.networkservices.v1.ListTlsRoutesResponse.verify|verify} messages. + * @param message ListTlsRoutesResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.networkservices.v1.IListTlsRoutesResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListTlsRoutesResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListTlsRoutesResponse + * @throws {Error} If the payload is not 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.networkservices.v1.ListTlsRoutesResponse; + + /** + * Decodes a ListTlsRoutesResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListTlsRoutesResponse + * @throws {Error} If the payload 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.networkservices.v1.ListTlsRoutesResponse; + + /** + * Verifies a ListTlsRoutesResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListTlsRoutesResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListTlsRoutesResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.networkservices.v1.ListTlsRoutesResponse; + + /** + * Creates a plain object from a ListTlsRoutesResponse message. Also converts values to other types if specified. + * @param message ListTlsRoutesResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.networkservices.v1.ListTlsRoutesResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListTlsRoutesResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListTlsRoutesResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a GetTlsRouteRequest. */ + interface IGetTlsRouteRequest { + + /** GetTlsRouteRequest name */ + name?: (string|null); + } + + /** Represents a GetTlsRouteRequest. */ + class GetTlsRouteRequest implements IGetTlsRouteRequest { + + /** + * Constructs a new GetTlsRouteRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.networkservices.v1.IGetTlsRouteRequest); + + /** GetTlsRouteRequest name. */ + public name: string; + + /** + * Creates a new GetTlsRouteRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GetTlsRouteRequest instance + */ + public static create(properties?: google.cloud.networkservices.v1.IGetTlsRouteRequest): google.cloud.networkservices.v1.GetTlsRouteRequest; + + /** + * Encodes the specified GetTlsRouteRequest message. Does not implicitly {@link google.cloud.networkservices.v1.GetTlsRouteRequest.verify|verify} messages. + * @param message GetTlsRouteRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.networkservices.v1.IGetTlsRouteRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GetTlsRouteRequest message, length delimited. Does not implicitly {@link google.cloud.networkservices.v1.GetTlsRouteRequest.verify|verify} messages. + * @param message GetTlsRouteRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.networkservices.v1.IGetTlsRouteRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GetTlsRouteRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GetTlsRouteRequest + * @throws {Error} If the payload is not 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.networkservices.v1.GetTlsRouteRequest; + + /** + * Decodes a GetTlsRouteRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GetTlsRouteRequest + * @throws {Error} If the payload 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.networkservices.v1.GetTlsRouteRequest; + + /** + * Verifies a GetTlsRouteRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GetTlsRouteRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GetTlsRouteRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.networkservices.v1.GetTlsRouteRequest; + + /** + * Creates a plain object from a GetTlsRouteRequest message. Also converts values to other types if specified. + * @param message GetTlsRouteRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.networkservices.v1.GetTlsRouteRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GetTlsRouteRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GetTlsRouteRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a CreateTlsRouteRequest. */ + interface ICreateTlsRouteRequest { + + /** CreateTlsRouteRequest parent */ + parent?: (string|null); + + /** CreateTlsRouteRequest tlsRouteId */ + tlsRouteId?: (string|null); + + /** CreateTlsRouteRequest tlsRoute */ + tlsRoute?: (google.cloud.networkservices.v1.ITlsRoute|null); + } + + /** Represents a CreateTlsRouteRequest. */ + class CreateTlsRouteRequest implements ICreateTlsRouteRequest { + + /** + * Constructs a new CreateTlsRouteRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.networkservices.v1.ICreateTlsRouteRequest); + + /** CreateTlsRouteRequest parent. */ + public parent: string; + + /** CreateTlsRouteRequest tlsRouteId. */ + public tlsRouteId: string; + + /** CreateTlsRouteRequest tlsRoute. */ + public tlsRoute?: (google.cloud.networkservices.v1.ITlsRoute|null); + + /** + * Creates a new CreateTlsRouteRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns CreateTlsRouteRequest instance + */ + public static create(properties?: google.cloud.networkservices.v1.ICreateTlsRouteRequest): google.cloud.networkservices.v1.CreateTlsRouteRequest; + + /** + * Encodes the specified CreateTlsRouteRequest message. Does not implicitly {@link google.cloud.networkservices.v1.CreateTlsRouteRequest.verify|verify} messages. + * @param message CreateTlsRouteRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.networkservices.v1.ICreateTlsRouteRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CreateTlsRouteRequest message, length delimited. Does not implicitly {@link google.cloud.networkservices.v1.CreateTlsRouteRequest.verify|verify} messages. + * @param message CreateTlsRouteRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.networkservices.v1.ICreateTlsRouteRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CreateTlsRouteRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CreateTlsRouteRequest + * @throws {Error} If the payload is not 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.networkservices.v1.CreateTlsRouteRequest; + + /** + * Decodes a CreateTlsRouteRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CreateTlsRouteRequest + * @throws {Error} If the payload 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.networkservices.v1.CreateTlsRouteRequest; + + /** + * Verifies a CreateTlsRouteRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CreateTlsRouteRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CreateTlsRouteRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.networkservices.v1.CreateTlsRouteRequest; + + /** + * Creates a plain object from a CreateTlsRouteRequest message. Also converts values to other types if specified. + * @param message CreateTlsRouteRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.networkservices.v1.CreateTlsRouteRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CreateTlsRouteRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CreateTlsRouteRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an UpdateTlsRouteRequest. */ + interface IUpdateTlsRouteRequest { + + /** UpdateTlsRouteRequest updateMask */ + updateMask?: (google.protobuf.IFieldMask|null); + + /** UpdateTlsRouteRequest tlsRoute */ + tlsRoute?: (google.cloud.networkservices.v1.ITlsRoute|null); + } + + /** Represents an UpdateTlsRouteRequest. */ + class UpdateTlsRouteRequest implements IUpdateTlsRouteRequest { + + /** + * Constructs a new UpdateTlsRouteRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.networkservices.v1.IUpdateTlsRouteRequest); + + /** UpdateTlsRouteRequest updateMask. */ + public updateMask?: (google.protobuf.IFieldMask|null); + + /** UpdateTlsRouteRequest tlsRoute. */ + public tlsRoute?: (google.cloud.networkservices.v1.ITlsRoute|null); + + /** + * Creates a new UpdateTlsRouteRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns UpdateTlsRouteRequest instance + */ + public static create(properties?: google.cloud.networkservices.v1.IUpdateTlsRouteRequest): google.cloud.networkservices.v1.UpdateTlsRouteRequest; + + /** + * Encodes the specified UpdateTlsRouteRequest message. Does not implicitly {@link google.cloud.networkservices.v1.UpdateTlsRouteRequest.verify|verify} messages. + * @param message UpdateTlsRouteRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.networkservices.v1.IUpdateTlsRouteRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified UpdateTlsRouteRequest message, length delimited. Does not implicitly {@link google.cloud.networkservices.v1.UpdateTlsRouteRequest.verify|verify} messages. + * @param message UpdateTlsRouteRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.networkservices.v1.IUpdateTlsRouteRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an UpdateTlsRouteRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns UpdateTlsRouteRequest + * @throws {Error} If the payload is not 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.networkservices.v1.UpdateTlsRouteRequest; + + /** + * Decodes an UpdateTlsRouteRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns UpdateTlsRouteRequest + * @throws {Error} If the payload 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.networkservices.v1.UpdateTlsRouteRequest; + + /** + * Verifies an UpdateTlsRouteRequest message. + * @param message Plain 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 UpdateTlsRouteRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns UpdateTlsRouteRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.networkservices.v1.UpdateTlsRouteRequest; + + /** + * Creates a plain object from an UpdateTlsRouteRequest message. Also converts values to other types if specified. + * @param message UpdateTlsRouteRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.networkservices.v1.UpdateTlsRouteRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this UpdateTlsRouteRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for UpdateTlsRouteRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a DeleteTlsRouteRequest. */ + interface IDeleteTlsRouteRequest { + + /** DeleteTlsRouteRequest name */ + name?: (string|null); + } + + /** Represents a DeleteTlsRouteRequest. */ + class DeleteTlsRouteRequest implements IDeleteTlsRouteRequest { + + /** + * Constructs a new DeleteTlsRouteRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.networkservices.v1.IDeleteTlsRouteRequest); + + /** DeleteTlsRouteRequest name. */ + public name: string; + + /** + * Creates a new DeleteTlsRouteRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns DeleteTlsRouteRequest instance + */ + public static create(properties?: google.cloud.networkservices.v1.IDeleteTlsRouteRequest): google.cloud.networkservices.v1.DeleteTlsRouteRequest; + + /** + * Encodes the specified DeleteTlsRouteRequest message. Does not implicitly {@link google.cloud.networkservices.v1.DeleteTlsRouteRequest.verify|verify} messages. + * @param message DeleteTlsRouteRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.networkservices.v1.IDeleteTlsRouteRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DeleteTlsRouteRequest message, length delimited. Does not implicitly {@link google.cloud.networkservices.v1.DeleteTlsRouteRequest.verify|verify} messages. + * @param message DeleteTlsRouteRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.networkservices.v1.IDeleteTlsRouteRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DeleteTlsRouteRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DeleteTlsRouteRequest + * @throws {Error} If the payload is not 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.networkservices.v1.DeleteTlsRouteRequest; + + /** + * Decodes a DeleteTlsRouteRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DeleteTlsRouteRequest + * @throws {Error} If the payload 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.networkservices.v1.DeleteTlsRouteRequest; + + /** + * Verifies a DeleteTlsRouteRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DeleteTlsRouteRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DeleteTlsRouteRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.networkservices.v1.DeleteTlsRouteRequest; + + /** + * Creates a plain object from a DeleteTlsRouteRequest message. Also converts values to other types if specified. + * @param message DeleteTlsRouteRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.networkservices.v1.DeleteTlsRouteRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DeleteTlsRouteRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DeleteTlsRouteRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Namespace v1beta1. */ + namespace v1beta1 { + + /** Properties of an OperationMetadata. */ + interface IOperationMetadata { + + /** OperationMetadata createTime */ + createTime?: (google.protobuf.ITimestamp|null); + + /** OperationMetadata endTime */ + endTime?: (google.protobuf.ITimestamp|null); + + /** OperationMetadata target */ + target?: (string|null); + + /** OperationMetadata verb */ + verb?: (string|null); + + /** OperationMetadata statusMessage */ + statusMessage?: (string|null); + + /** OperationMetadata requestedCancellation */ + requestedCancellation?: (boolean|null); + + /** OperationMetadata apiVersion */ + apiVersion?: (string|null); + } + + /** Represents an OperationMetadata. */ + class OperationMetadata implements IOperationMetadata { + + /** + * Constructs a new OperationMetadata. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.networkservices.v1beta1.IOperationMetadata); + + /** OperationMetadata createTime. */ + public createTime?: (google.protobuf.ITimestamp|null); + + /** OperationMetadata endTime. */ + public endTime?: (google.protobuf.ITimestamp|null); + + /** OperationMetadata target. */ + public target: string; + + /** OperationMetadata verb. */ + public verb: string; + + /** OperationMetadata statusMessage. */ + public statusMessage: string; + + /** OperationMetadata requestedCancellation. */ + public requestedCancellation: boolean; + + /** OperationMetadata apiVersion. */ + public apiVersion: string; + + /** + * Creates a new OperationMetadata instance using the specified properties. + * @param [properties] Properties to set + * @returns OperationMetadata instance + */ + public static create(properties?: google.cloud.networkservices.v1beta1.IOperationMetadata): google.cloud.networkservices.v1beta1.OperationMetadata; + + /** + * Encodes the specified OperationMetadata message. Does not implicitly {@link google.cloud.networkservices.v1beta1.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.networkservices.v1beta1.IOperationMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified OperationMetadata message, length delimited. Does not implicitly {@link google.cloud.networkservices.v1beta1.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.networkservices.v1beta1.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.networkservices.v1beta1.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.networkservices.v1beta1.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.networkservices.v1beta1.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.networkservices.v1beta1.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 TrafficPortSelector. */ + interface ITrafficPortSelector { + + /** TrafficPortSelector ports */ + ports?: (string[]|null); + } + + /** Represents a TrafficPortSelector. */ + class TrafficPortSelector implements ITrafficPortSelector { + + /** + * Constructs a new TrafficPortSelector. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.networkservices.v1beta1.ITrafficPortSelector); + + /** TrafficPortSelector ports. */ + public ports: string[]; + + /** + * Creates a new TrafficPortSelector instance using the specified properties. + * @param [properties] Properties to set + * @returns TrafficPortSelector instance + */ + public static create(properties?: google.cloud.networkservices.v1beta1.ITrafficPortSelector): google.cloud.networkservices.v1beta1.TrafficPortSelector; + + /** + * Encodes the specified TrafficPortSelector message. Does not implicitly {@link google.cloud.networkservices.v1beta1.TrafficPortSelector.verify|verify} messages. + * @param message TrafficPortSelector message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.networkservices.v1beta1.ITrafficPortSelector, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified TrafficPortSelector message, length delimited. Does not implicitly {@link google.cloud.networkservices.v1beta1.TrafficPortSelector.verify|verify} messages. + * @param message TrafficPortSelector message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.networkservices.v1beta1.ITrafficPortSelector, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TrafficPortSelector message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns TrafficPortSelector + * @throws {Error} If the payload is not 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.networkservices.v1beta1.TrafficPortSelector; + + /** + * Decodes a TrafficPortSelector message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns TrafficPortSelector + * @throws {Error} If the payload 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.networkservices.v1beta1.TrafficPortSelector; + + /** + * Verifies a TrafficPortSelector message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a TrafficPortSelector message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns TrafficPortSelector + */ + public static fromObject(object: { [k: string]: any }): google.cloud.networkservices.v1beta1.TrafficPortSelector; + + /** + * Creates a plain object from a TrafficPortSelector message. Also converts values to other types if specified. + * @param message TrafficPortSelector + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.networkservices.v1beta1.TrafficPortSelector, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this TrafficPortSelector to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for TrafficPortSelector + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an EndpointMatcher. */ + interface IEndpointMatcher { + + /** EndpointMatcher metadataLabelMatcher */ + metadataLabelMatcher?: (google.cloud.networkservices.v1beta1.EndpointMatcher.IMetadataLabelMatcher|null); + } + + /** Represents an EndpointMatcher. */ + class EndpointMatcher implements IEndpointMatcher { + + /** + * Constructs a new EndpointMatcher. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.networkservices.v1beta1.IEndpointMatcher); + + /** EndpointMatcher metadataLabelMatcher. */ + public metadataLabelMatcher?: (google.cloud.networkservices.v1beta1.EndpointMatcher.IMetadataLabelMatcher|null); + + /** EndpointMatcher matcherType. */ + public matcherType?: "metadataLabelMatcher"; + + /** + * Creates a new EndpointMatcher instance using the specified properties. + * @param [properties] Properties to set + * @returns EndpointMatcher instance + */ + public static create(properties?: google.cloud.networkservices.v1beta1.IEndpointMatcher): google.cloud.networkservices.v1beta1.EndpointMatcher; + + /** + * Encodes the specified EndpointMatcher message. Does not implicitly {@link google.cloud.networkservices.v1beta1.EndpointMatcher.verify|verify} messages. + * @param message EndpointMatcher message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.networkservices.v1beta1.IEndpointMatcher, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified EndpointMatcher message, length delimited. Does not implicitly {@link google.cloud.networkservices.v1beta1.EndpointMatcher.verify|verify} messages. + * @param message EndpointMatcher message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.networkservices.v1beta1.IEndpointMatcher, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an EndpointMatcher message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns EndpointMatcher + * @throws {Error} If the payload is not 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.networkservices.v1beta1.EndpointMatcher; + + /** + * Decodes an EndpointMatcher message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns EndpointMatcher + * @throws {Error} If the payload 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.networkservices.v1beta1.EndpointMatcher; + + /** + * Verifies an EndpointMatcher message. + * @param message Plain 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 EndpointMatcher message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns EndpointMatcher + */ + public static fromObject(object: { [k: string]: any }): google.cloud.networkservices.v1beta1.EndpointMatcher; + + /** + * Creates a plain object from an EndpointMatcher message. Also converts values to other types if specified. + * @param message EndpointMatcher + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.networkservices.v1beta1.EndpointMatcher, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this EndpointMatcher to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for EndpointMatcher + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace EndpointMatcher { + + /** Properties of a MetadataLabelMatcher. */ + interface IMetadataLabelMatcher { + + /** MetadataLabelMatcher metadataLabelMatchCriteria */ + metadataLabelMatchCriteria?: (google.cloud.networkservices.v1beta1.EndpointMatcher.MetadataLabelMatcher.MetadataLabelMatchCriteria|keyof typeof google.cloud.networkservices.v1beta1.EndpointMatcher.MetadataLabelMatcher.MetadataLabelMatchCriteria|null); + + /** MetadataLabelMatcher metadataLabels */ + metadataLabels?: (google.cloud.networkservices.v1beta1.EndpointMatcher.MetadataLabelMatcher.IMetadataLabels[]|null); + } + + /** Represents a MetadataLabelMatcher. */ + class MetadataLabelMatcher implements IMetadataLabelMatcher { + + /** + * Constructs a new MetadataLabelMatcher. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.networkservices.v1beta1.EndpointMatcher.IMetadataLabelMatcher); + + /** MetadataLabelMatcher metadataLabelMatchCriteria. */ + public metadataLabelMatchCriteria: (google.cloud.networkservices.v1beta1.EndpointMatcher.MetadataLabelMatcher.MetadataLabelMatchCriteria|keyof typeof google.cloud.networkservices.v1beta1.EndpointMatcher.MetadataLabelMatcher.MetadataLabelMatchCriteria); + + /** MetadataLabelMatcher metadataLabels. */ + public metadataLabels: google.cloud.networkservices.v1beta1.EndpointMatcher.MetadataLabelMatcher.IMetadataLabels[]; + + /** + * Creates a new MetadataLabelMatcher instance using the specified properties. + * @param [properties] Properties to set + * @returns MetadataLabelMatcher instance + */ + public static create(properties?: google.cloud.networkservices.v1beta1.EndpointMatcher.IMetadataLabelMatcher): google.cloud.networkservices.v1beta1.EndpointMatcher.MetadataLabelMatcher; + + /** + * Encodes the specified MetadataLabelMatcher message. Does not implicitly {@link google.cloud.networkservices.v1beta1.EndpointMatcher.MetadataLabelMatcher.verify|verify} messages. + * @param message MetadataLabelMatcher message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.networkservices.v1beta1.EndpointMatcher.IMetadataLabelMatcher, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified MetadataLabelMatcher message, length delimited. Does not implicitly {@link google.cloud.networkservices.v1beta1.EndpointMatcher.MetadataLabelMatcher.verify|verify} messages. + * @param message MetadataLabelMatcher message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.networkservices.v1beta1.EndpointMatcher.IMetadataLabelMatcher, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a MetadataLabelMatcher message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns MetadataLabelMatcher + * @throws {Error} If the payload is not 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.networkservices.v1beta1.EndpointMatcher.MetadataLabelMatcher; + + /** + * Decodes a MetadataLabelMatcher message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns MetadataLabelMatcher + * @throws {Error} If the payload 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.networkservices.v1beta1.EndpointMatcher.MetadataLabelMatcher; + + /** + * Verifies a MetadataLabelMatcher message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a MetadataLabelMatcher message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns MetadataLabelMatcher + */ + public static fromObject(object: { [k: string]: any }): google.cloud.networkservices.v1beta1.EndpointMatcher.MetadataLabelMatcher; + + /** + * Creates a plain object from a MetadataLabelMatcher message. Also converts values to other types if specified. + * @param message MetadataLabelMatcher + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.networkservices.v1beta1.EndpointMatcher.MetadataLabelMatcher, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this MetadataLabelMatcher to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for MetadataLabelMatcher + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace MetadataLabelMatcher { + + /** Properties of a MetadataLabels. */ + interface IMetadataLabels { + + /** MetadataLabels labelName */ + labelName?: (string|null); + + /** MetadataLabels labelValue */ + labelValue?: (string|null); + } + + /** Represents a MetadataLabels. */ + class MetadataLabels implements IMetadataLabels { + + /** + * Constructs a new MetadataLabels. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.networkservices.v1beta1.EndpointMatcher.MetadataLabelMatcher.IMetadataLabels); + + /** MetadataLabels labelName. */ + public labelName: string; + + /** MetadataLabels labelValue. */ + public labelValue: string; + + /** + * Creates a new MetadataLabels instance using the specified properties. + * @param [properties] Properties to set + * @returns MetadataLabels instance + */ + public static create(properties?: google.cloud.networkservices.v1beta1.EndpointMatcher.MetadataLabelMatcher.IMetadataLabels): google.cloud.networkservices.v1beta1.EndpointMatcher.MetadataLabelMatcher.MetadataLabels; + + /** + * Encodes the specified MetadataLabels message. Does not implicitly {@link google.cloud.networkservices.v1beta1.EndpointMatcher.MetadataLabelMatcher.MetadataLabels.verify|verify} messages. + * @param message MetadataLabels message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.networkservices.v1beta1.EndpointMatcher.MetadataLabelMatcher.IMetadataLabels, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified MetadataLabels message, length delimited. Does not implicitly {@link google.cloud.networkservices.v1beta1.EndpointMatcher.MetadataLabelMatcher.MetadataLabels.verify|verify} messages. + * @param message MetadataLabels message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.networkservices.v1beta1.EndpointMatcher.MetadataLabelMatcher.IMetadataLabels, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a MetadataLabels message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns MetadataLabels + * @throws {Error} If the payload is not 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.networkservices.v1beta1.EndpointMatcher.MetadataLabelMatcher.MetadataLabels; + + /** + * Decodes a MetadataLabels message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns MetadataLabels + * @throws {Error} If the payload 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.networkservices.v1beta1.EndpointMatcher.MetadataLabelMatcher.MetadataLabels; + + /** + * Verifies a MetadataLabels message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a MetadataLabels message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns MetadataLabels + */ + public static fromObject(object: { [k: string]: any }): google.cloud.networkservices.v1beta1.EndpointMatcher.MetadataLabelMatcher.MetadataLabels; + + /** + * Creates a plain object from a MetadataLabels message. Also converts values to other types if specified. + * @param message MetadataLabels + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.networkservices.v1beta1.EndpointMatcher.MetadataLabelMatcher.MetadataLabels, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this MetadataLabels to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for MetadataLabels + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** MetadataLabelMatchCriteria enum. */ + enum MetadataLabelMatchCriteria { + METADATA_LABEL_MATCH_CRITERIA_UNSPECIFIED = 0, + MATCH_ANY = 1, + MATCH_ALL = 2 + } + } + } + + /** Properties of an EndpointPolicy. */ + interface IEndpointPolicy { + + /** EndpointPolicy name */ + name?: (string|null); + + /** EndpointPolicy createTime */ + createTime?: (google.protobuf.ITimestamp|null); + + /** EndpointPolicy updateTime */ + updateTime?: (google.protobuf.ITimestamp|null); + + /** EndpointPolicy labels */ + labels?: ({ [k: string]: string }|null); + + /** EndpointPolicy type */ + type?: (google.cloud.networkservices.v1beta1.EndpointPolicy.EndpointPolicyType|keyof typeof google.cloud.networkservices.v1beta1.EndpointPolicy.EndpointPolicyType|null); + + /** EndpointPolicy authorizationPolicy */ + authorizationPolicy?: (string|null); + + /** EndpointPolicy endpointMatcher */ + endpointMatcher?: (google.cloud.networkservices.v1beta1.IEndpointMatcher|null); + + /** EndpointPolicy trafficPortSelector */ + trafficPortSelector?: (google.cloud.networkservices.v1beta1.ITrafficPortSelector|null); + + /** EndpointPolicy description */ + description?: (string|null); + + /** EndpointPolicy serverTlsPolicy */ + serverTlsPolicy?: (string|null); + + /** EndpointPolicy clientTlsPolicy */ + clientTlsPolicy?: (string|null); + } + + /** Represents an EndpointPolicy. */ + class EndpointPolicy implements IEndpointPolicy { + + /** + * Constructs a new EndpointPolicy. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.networkservices.v1beta1.IEndpointPolicy); + + /** EndpointPolicy name. */ + public name: string; + + /** EndpointPolicy createTime. */ + public createTime?: (google.protobuf.ITimestamp|null); + + /** EndpointPolicy updateTime. */ + public updateTime?: (google.protobuf.ITimestamp|null); + + /** EndpointPolicy labels. */ + public labels: { [k: string]: string }; + + /** EndpointPolicy type. */ + public type: (google.cloud.networkservices.v1beta1.EndpointPolicy.EndpointPolicyType|keyof typeof google.cloud.networkservices.v1beta1.EndpointPolicy.EndpointPolicyType); + + /** EndpointPolicy authorizationPolicy. */ + public authorizationPolicy: string; + + /** EndpointPolicy endpointMatcher. */ + public endpointMatcher?: (google.cloud.networkservices.v1beta1.IEndpointMatcher|null); + + /** EndpointPolicy trafficPortSelector. */ + public trafficPortSelector?: (google.cloud.networkservices.v1beta1.ITrafficPortSelector|null); + + /** EndpointPolicy description. */ + public description: string; + + /** EndpointPolicy serverTlsPolicy. */ + public serverTlsPolicy: string; + + /** EndpointPolicy clientTlsPolicy. */ + public clientTlsPolicy: string; + + /** + * Creates a new EndpointPolicy instance using the specified properties. + * @param [properties] Properties to set + * @returns EndpointPolicy instance + */ + public static create(properties?: google.cloud.networkservices.v1beta1.IEndpointPolicy): google.cloud.networkservices.v1beta1.EndpointPolicy; + + /** + * Encodes the specified EndpointPolicy message. Does not implicitly {@link google.cloud.networkservices.v1beta1.EndpointPolicy.verify|verify} messages. + * @param message EndpointPolicy message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.networkservices.v1beta1.IEndpointPolicy, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified EndpointPolicy message, length delimited. Does not implicitly {@link google.cloud.networkservices.v1beta1.EndpointPolicy.verify|verify} messages. + * @param message EndpointPolicy message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.networkservices.v1beta1.IEndpointPolicy, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an EndpointPolicy message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns EndpointPolicy + * @throws {Error} If the payload is not 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.networkservices.v1beta1.EndpointPolicy; + + /** + * Decodes an EndpointPolicy message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns EndpointPolicy + * @throws {Error} If the payload 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.networkservices.v1beta1.EndpointPolicy; + + /** + * Verifies an EndpointPolicy message. + * @param message Plain 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 EndpointPolicy message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns EndpointPolicy + */ + public static fromObject(object: { [k: string]: any }): google.cloud.networkservices.v1beta1.EndpointPolicy; + + /** + * Creates a plain object from an EndpointPolicy message. Also converts values to other types if specified. + * @param message EndpointPolicy + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.networkservices.v1beta1.EndpointPolicy, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this EndpointPolicy to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for EndpointPolicy + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace EndpointPolicy { + + /** EndpointPolicyType enum. */ + enum EndpointPolicyType { + ENDPOINT_POLICY_TYPE_UNSPECIFIED = 0, + SIDECAR_PROXY = 1, + GRPC_SERVER = 2 + } + } + + /** Properties of a ListEndpointPoliciesRequest. */ + interface IListEndpointPoliciesRequest { + + /** ListEndpointPoliciesRequest parent */ + parent?: (string|null); + + /** ListEndpointPoliciesRequest pageSize */ + pageSize?: (number|null); + + /** ListEndpointPoliciesRequest pageToken */ + pageToken?: (string|null); + } + + /** Represents a ListEndpointPoliciesRequest. */ + class ListEndpointPoliciesRequest implements IListEndpointPoliciesRequest { + + /** + * Constructs a new ListEndpointPoliciesRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.networkservices.v1beta1.IListEndpointPoliciesRequest); + + /** ListEndpointPoliciesRequest parent. */ + public parent: string; + + /** ListEndpointPoliciesRequest pageSize. */ + public pageSize: number; + + /** ListEndpointPoliciesRequest pageToken. */ + public pageToken: string; + + /** + * Creates a new ListEndpointPoliciesRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ListEndpointPoliciesRequest instance + */ + public static create(properties?: google.cloud.networkservices.v1beta1.IListEndpointPoliciesRequest): google.cloud.networkservices.v1beta1.ListEndpointPoliciesRequest; + + /** + * Encodes the specified ListEndpointPoliciesRequest message. Does not implicitly {@link google.cloud.networkservices.v1beta1.ListEndpointPoliciesRequest.verify|verify} messages. + * @param message ListEndpointPoliciesRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.networkservices.v1beta1.IListEndpointPoliciesRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListEndpointPoliciesRequest message, length delimited. Does not implicitly {@link google.cloud.networkservices.v1beta1.ListEndpointPoliciesRequest.verify|verify} messages. + * @param message ListEndpointPoliciesRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.networkservices.v1beta1.IListEndpointPoliciesRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListEndpointPoliciesRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListEndpointPoliciesRequest + * @throws {Error} If the payload is not 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.networkservices.v1beta1.ListEndpointPoliciesRequest; + + /** + * Decodes a ListEndpointPoliciesRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListEndpointPoliciesRequest + * @throws {Error} If the payload 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.networkservices.v1beta1.ListEndpointPoliciesRequest; + + /** + * Verifies a ListEndpointPoliciesRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListEndpointPoliciesRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListEndpointPoliciesRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.networkservices.v1beta1.ListEndpointPoliciesRequest; + + /** + * Creates a plain object from a ListEndpointPoliciesRequest message. Also converts values to other types if specified. + * @param message ListEndpointPoliciesRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.networkservices.v1beta1.ListEndpointPoliciesRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListEndpointPoliciesRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListEndpointPoliciesRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListEndpointPoliciesResponse. */ + interface IListEndpointPoliciesResponse { + + /** ListEndpointPoliciesResponse endpointPolicies */ + endpointPolicies?: (google.cloud.networkservices.v1beta1.IEndpointPolicy[]|null); + + /** ListEndpointPoliciesResponse nextPageToken */ + nextPageToken?: (string|null); + } + + /** Represents a ListEndpointPoliciesResponse. */ + class ListEndpointPoliciesResponse implements IListEndpointPoliciesResponse { + + /** + * Constructs a new ListEndpointPoliciesResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.networkservices.v1beta1.IListEndpointPoliciesResponse); + + /** ListEndpointPoliciesResponse endpointPolicies. */ + public endpointPolicies: google.cloud.networkservices.v1beta1.IEndpointPolicy[]; + + /** ListEndpointPoliciesResponse nextPageToken. */ + public nextPageToken: string; + + /** + * Creates a new ListEndpointPoliciesResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ListEndpointPoliciesResponse instance + */ + public static create(properties?: google.cloud.networkservices.v1beta1.IListEndpointPoliciesResponse): google.cloud.networkservices.v1beta1.ListEndpointPoliciesResponse; + + /** + * Encodes the specified ListEndpointPoliciesResponse message. Does not implicitly {@link google.cloud.networkservices.v1beta1.ListEndpointPoliciesResponse.verify|verify} messages. + * @param message ListEndpointPoliciesResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.networkservices.v1beta1.IListEndpointPoliciesResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListEndpointPoliciesResponse message, length delimited. Does not implicitly {@link google.cloud.networkservices.v1beta1.ListEndpointPoliciesResponse.verify|verify} messages. + * @param message ListEndpointPoliciesResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.networkservices.v1beta1.IListEndpointPoliciesResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListEndpointPoliciesResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListEndpointPoliciesResponse + * @throws {Error} If the payload is not 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.networkservices.v1beta1.ListEndpointPoliciesResponse; + + /** + * Decodes a ListEndpointPoliciesResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListEndpointPoliciesResponse + * @throws {Error} If the payload 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.networkservices.v1beta1.ListEndpointPoliciesResponse; + + /** + * Verifies a ListEndpointPoliciesResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListEndpointPoliciesResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListEndpointPoliciesResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.networkservices.v1beta1.ListEndpointPoliciesResponse; + + /** + * Creates a plain object from a ListEndpointPoliciesResponse message. Also converts values to other types if specified. + * @param message ListEndpointPoliciesResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.networkservices.v1beta1.ListEndpointPoliciesResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListEndpointPoliciesResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListEndpointPoliciesResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a GetEndpointPolicyRequest. */ + interface IGetEndpointPolicyRequest { + + /** GetEndpointPolicyRequest name */ + name?: (string|null); + } + + /** Represents a GetEndpointPolicyRequest. */ + class GetEndpointPolicyRequest implements IGetEndpointPolicyRequest { + + /** + * Constructs a new GetEndpointPolicyRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.networkservices.v1beta1.IGetEndpointPolicyRequest); + + /** GetEndpointPolicyRequest name. */ + public name: string; + + /** + * Creates a new GetEndpointPolicyRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GetEndpointPolicyRequest instance + */ + public static create(properties?: google.cloud.networkservices.v1beta1.IGetEndpointPolicyRequest): google.cloud.networkservices.v1beta1.GetEndpointPolicyRequest; + + /** + * Encodes the specified GetEndpointPolicyRequest message. Does not implicitly {@link google.cloud.networkservices.v1beta1.GetEndpointPolicyRequest.verify|verify} messages. + * @param message GetEndpointPolicyRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.networkservices.v1beta1.IGetEndpointPolicyRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GetEndpointPolicyRequest message, length delimited. Does not implicitly {@link google.cloud.networkservices.v1beta1.GetEndpointPolicyRequest.verify|verify} messages. + * @param message GetEndpointPolicyRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.networkservices.v1beta1.IGetEndpointPolicyRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GetEndpointPolicyRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GetEndpointPolicyRequest + * @throws {Error} If the payload is not 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.networkservices.v1beta1.GetEndpointPolicyRequest; + + /** + * Decodes a GetEndpointPolicyRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GetEndpointPolicyRequest + * @throws {Error} If the payload 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.networkservices.v1beta1.GetEndpointPolicyRequest; + + /** + * Verifies a GetEndpointPolicyRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GetEndpointPolicyRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GetEndpointPolicyRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.networkservices.v1beta1.GetEndpointPolicyRequest; + + /** + * Creates a plain object from a GetEndpointPolicyRequest message. Also converts values to other types if specified. + * @param message GetEndpointPolicyRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.networkservices.v1beta1.GetEndpointPolicyRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GetEndpointPolicyRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GetEndpointPolicyRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a CreateEndpointPolicyRequest. */ + interface ICreateEndpointPolicyRequest { + + /** CreateEndpointPolicyRequest parent */ + parent?: (string|null); + + /** CreateEndpointPolicyRequest endpointPolicyId */ + endpointPolicyId?: (string|null); + + /** CreateEndpointPolicyRequest endpointPolicy */ + endpointPolicy?: (google.cloud.networkservices.v1beta1.IEndpointPolicy|null); + } + + /** Represents a CreateEndpointPolicyRequest. */ + class CreateEndpointPolicyRequest implements ICreateEndpointPolicyRequest { + + /** + * Constructs a new CreateEndpointPolicyRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.networkservices.v1beta1.ICreateEndpointPolicyRequest); + + /** CreateEndpointPolicyRequest parent. */ + public parent: string; + + /** CreateEndpointPolicyRequest endpointPolicyId. */ + public endpointPolicyId: string; + + /** CreateEndpointPolicyRequest endpointPolicy. */ + public endpointPolicy?: (google.cloud.networkservices.v1beta1.IEndpointPolicy|null); + + /** + * Creates a new CreateEndpointPolicyRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns CreateEndpointPolicyRequest instance + */ + public static create(properties?: google.cloud.networkservices.v1beta1.ICreateEndpointPolicyRequest): google.cloud.networkservices.v1beta1.CreateEndpointPolicyRequest; + + /** + * Encodes the specified CreateEndpointPolicyRequest message. Does not implicitly {@link google.cloud.networkservices.v1beta1.CreateEndpointPolicyRequest.verify|verify} messages. + * @param message CreateEndpointPolicyRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.networkservices.v1beta1.ICreateEndpointPolicyRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CreateEndpointPolicyRequest message, length delimited. Does not implicitly {@link google.cloud.networkservices.v1beta1.CreateEndpointPolicyRequest.verify|verify} messages. + * @param message CreateEndpointPolicyRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.networkservices.v1beta1.ICreateEndpointPolicyRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CreateEndpointPolicyRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CreateEndpointPolicyRequest + * @throws {Error} If the payload is not 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.networkservices.v1beta1.CreateEndpointPolicyRequest; + + /** + * Decodes a CreateEndpointPolicyRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CreateEndpointPolicyRequest + * @throws {Error} If the payload 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.networkservices.v1beta1.CreateEndpointPolicyRequest; + + /** + * Verifies a CreateEndpointPolicyRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CreateEndpointPolicyRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CreateEndpointPolicyRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.networkservices.v1beta1.CreateEndpointPolicyRequest; + + /** + * Creates a plain object from a CreateEndpointPolicyRequest message. Also converts values to other types if specified. + * @param message CreateEndpointPolicyRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.networkservices.v1beta1.CreateEndpointPolicyRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CreateEndpointPolicyRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CreateEndpointPolicyRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an UpdateEndpointPolicyRequest. */ + interface IUpdateEndpointPolicyRequest { + + /** UpdateEndpointPolicyRequest updateMask */ + updateMask?: (google.protobuf.IFieldMask|null); + + /** UpdateEndpointPolicyRequest endpointPolicy */ + endpointPolicy?: (google.cloud.networkservices.v1beta1.IEndpointPolicy|null); + } + + /** Represents an UpdateEndpointPolicyRequest. */ + class UpdateEndpointPolicyRequest implements IUpdateEndpointPolicyRequest { + + /** + * Constructs a new UpdateEndpointPolicyRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.networkservices.v1beta1.IUpdateEndpointPolicyRequest); + + /** UpdateEndpointPolicyRequest updateMask. */ + public updateMask?: (google.protobuf.IFieldMask|null); + + /** UpdateEndpointPolicyRequest endpointPolicy. */ + public endpointPolicy?: (google.cloud.networkservices.v1beta1.IEndpointPolicy|null); + + /** + * Creates a new UpdateEndpointPolicyRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns UpdateEndpointPolicyRequest instance + */ + public static create(properties?: google.cloud.networkservices.v1beta1.IUpdateEndpointPolicyRequest): google.cloud.networkservices.v1beta1.UpdateEndpointPolicyRequest; + + /** + * Encodes the specified UpdateEndpointPolicyRequest message. Does not implicitly {@link google.cloud.networkservices.v1beta1.UpdateEndpointPolicyRequest.verify|verify} messages. + * @param message UpdateEndpointPolicyRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.networkservices.v1beta1.IUpdateEndpointPolicyRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified UpdateEndpointPolicyRequest message, length delimited. Does not implicitly {@link google.cloud.networkservices.v1beta1.UpdateEndpointPolicyRequest.verify|verify} messages. + * @param message UpdateEndpointPolicyRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.networkservices.v1beta1.IUpdateEndpointPolicyRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an UpdateEndpointPolicyRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns UpdateEndpointPolicyRequest + * @throws {Error} If the payload is not 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.networkservices.v1beta1.UpdateEndpointPolicyRequest; + + /** + * Decodes an UpdateEndpointPolicyRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns UpdateEndpointPolicyRequest + * @throws {Error} If the payload 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.networkservices.v1beta1.UpdateEndpointPolicyRequest; + + /** + * Verifies an UpdateEndpointPolicyRequest message. + * @param message Plain 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 UpdateEndpointPolicyRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns UpdateEndpointPolicyRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.networkservices.v1beta1.UpdateEndpointPolicyRequest; + + /** + * Creates a plain object from an UpdateEndpointPolicyRequest message. Also converts values to other types if specified. + * @param message UpdateEndpointPolicyRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.networkservices.v1beta1.UpdateEndpointPolicyRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this UpdateEndpointPolicyRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for UpdateEndpointPolicyRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a DeleteEndpointPolicyRequest. */ + interface IDeleteEndpointPolicyRequest { + + /** DeleteEndpointPolicyRequest name */ + name?: (string|null); + } + + /** Represents a DeleteEndpointPolicyRequest. */ + class DeleteEndpointPolicyRequest implements IDeleteEndpointPolicyRequest { + + /** + * Constructs a new DeleteEndpointPolicyRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.networkservices.v1beta1.IDeleteEndpointPolicyRequest); + + /** DeleteEndpointPolicyRequest name. */ + public name: string; + + /** + * Creates a new DeleteEndpointPolicyRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns DeleteEndpointPolicyRequest instance + */ + public static create(properties?: google.cloud.networkservices.v1beta1.IDeleteEndpointPolicyRequest): google.cloud.networkservices.v1beta1.DeleteEndpointPolicyRequest; + + /** + * Encodes the specified DeleteEndpointPolicyRequest message. Does not implicitly {@link google.cloud.networkservices.v1beta1.DeleteEndpointPolicyRequest.verify|verify} messages. + * @param message DeleteEndpointPolicyRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.networkservices.v1beta1.IDeleteEndpointPolicyRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DeleteEndpointPolicyRequest message, length delimited. Does not implicitly {@link google.cloud.networkservices.v1beta1.DeleteEndpointPolicyRequest.verify|verify} messages. + * @param message DeleteEndpointPolicyRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.networkservices.v1beta1.IDeleteEndpointPolicyRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DeleteEndpointPolicyRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DeleteEndpointPolicyRequest + * @throws {Error} If the payload is not 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.networkservices.v1beta1.DeleteEndpointPolicyRequest; + + /** + * Decodes a DeleteEndpointPolicyRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DeleteEndpointPolicyRequest + * @throws {Error} If the payload 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.networkservices.v1beta1.DeleteEndpointPolicyRequest; + + /** + * Verifies a DeleteEndpointPolicyRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DeleteEndpointPolicyRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DeleteEndpointPolicyRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.networkservices.v1beta1.DeleteEndpointPolicyRequest; + + /** + * Creates a plain object from a DeleteEndpointPolicyRequest message. Also converts values to other types if specified. + * @param message DeleteEndpointPolicyRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.networkservices.v1beta1.DeleteEndpointPolicyRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DeleteEndpointPolicyRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DeleteEndpointPolicyRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Represents a NetworkServices */ + class NetworkServices extends $protobuf.rpc.Service { + + /** + * Constructs a new NetworkServices 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 NetworkServices 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): NetworkServices; + + /** + * Calls ListEndpointPolicies. + * @param request ListEndpointPoliciesRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ListEndpointPoliciesResponse + */ + public listEndpointPolicies(request: google.cloud.networkservices.v1beta1.IListEndpointPoliciesRequest, callback: google.cloud.networkservices.v1beta1.NetworkServices.ListEndpointPoliciesCallback): void; + + /** + * Calls ListEndpointPolicies. + * @param request ListEndpointPoliciesRequest message or plain object + * @returns Promise + */ + public listEndpointPolicies(request: google.cloud.networkservices.v1beta1.IListEndpointPoliciesRequest): Promise; + + /** + * Calls GetEndpointPolicy. + * @param request GetEndpointPolicyRequest message or plain object + * @param callback Node-style callback called with the error, if any, and EndpointPolicy + */ + public getEndpointPolicy(request: google.cloud.networkservices.v1beta1.IGetEndpointPolicyRequest, callback: google.cloud.networkservices.v1beta1.NetworkServices.GetEndpointPolicyCallback): void; + + /** + * Calls GetEndpointPolicy. + * @param request GetEndpointPolicyRequest message or plain object + * @returns Promise + */ + public getEndpointPolicy(request: google.cloud.networkservices.v1beta1.IGetEndpointPolicyRequest): Promise; + + /** + * Calls CreateEndpointPolicy. + * @param request CreateEndpointPolicyRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public createEndpointPolicy(request: google.cloud.networkservices.v1beta1.ICreateEndpointPolicyRequest, callback: google.cloud.networkservices.v1beta1.NetworkServices.CreateEndpointPolicyCallback): void; + + /** + * Calls CreateEndpointPolicy. + * @param request CreateEndpointPolicyRequest message or plain object + * @returns Promise + */ + public createEndpointPolicy(request: google.cloud.networkservices.v1beta1.ICreateEndpointPolicyRequest): Promise; + + /** + * Calls UpdateEndpointPolicy. + * @param request UpdateEndpointPolicyRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public updateEndpointPolicy(request: google.cloud.networkservices.v1beta1.IUpdateEndpointPolicyRequest, callback: google.cloud.networkservices.v1beta1.NetworkServices.UpdateEndpointPolicyCallback): void; + + /** + * Calls UpdateEndpointPolicy. + * @param request UpdateEndpointPolicyRequest message or plain object + * @returns Promise + */ + public updateEndpointPolicy(request: google.cloud.networkservices.v1beta1.IUpdateEndpointPolicyRequest): Promise; + + /** + * Calls DeleteEndpointPolicy. + * @param request DeleteEndpointPolicyRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public deleteEndpointPolicy(request: google.cloud.networkservices.v1beta1.IDeleteEndpointPolicyRequest, callback: google.cloud.networkservices.v1beta1.NetworkServices.DeleteEndpointPolicyCallback): void; + + /** + * Calls DeleteEndpointPolicy. + * @param request DeleteEndpointPolicyRequest message or plain object + * @returns Promise + */ + public deleteEndpointPolicy(request: google.cloud.networkservices.v1beta1.IDeleteEndpointPolicyRequest): Promise; + } + + namespace NetworkServices { + + /** + * Callback as used by {@link google.cloud.networkservices.v1beta1.NetworkServices|listEndpointPolicies}. + * @param error Error, if any + * @param [response] ListEndpointPoliciesResponse + */ + type ListEndpointPoliciesCallback = (error: (Error|null), response?: google.cloud.networkservices.v1beta1.ListEndpointPoliciesResponse) => void; + + /** + * Callback as used by {@link google.cloud.networkservices.v1beta1.NetworkServices|getEndpointPolicy}. + * @param error Error, if any + * @param [response] EndpointPolicy + */ + type GetEndpointPolicyCallback = (error: (Error|null), response?: google.cloud.networkservices.v1beta1.EndpointPolicy) => void; + + /** + * Callback as used by {@link google.cloud.networkservices.v1beta1.NetworkServices|createEndpointPolicy}. + * @param error Error, if any + * @param [response] Operation + */ + type CreateEndpointPolicyCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.cloud.networkservices.v1beta1.NetworkServices|updateEndpointPolicy}. + * @param error Error, if any + * @param [response] Operation + */ + type UpdateEndpointPolicyCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.cloud.networkservices.v1beta1.NetworkServices|deleteEndpointPolicy}. + * @param error Error, if any + * @param [response] Operation + */ + type DeleteEndpointPolicyCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + } + } + } + } + + /** 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 + } + + /** 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; + } + + /** 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); + } + + /** 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[]; + + /** + * 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); + } + + /** 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); + + /** + * 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); + } + + /** 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); + + /** + * 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 + } + + /** 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 + } + } + + /** 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; + } + + /** 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?: (string|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: string; + + /** + * 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); + } + + /** 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[]; + + /** + * 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; + } + + /** 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_REQUIRED = 2, + LABEL_REPEATED = 3 + } + } + + /** 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 phpGenericServices */ + phpGenericServices?: (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 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 phpGenericServices. */ + public phpGenericServices: 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 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 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 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 target */ + target?: (google.protobuf.FieldOptions.OptionTargetType|keyof typeof google.protobuf.FieldOptions.OptionTargetType|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 target. */ + public target: (google.protobuf.FieldOptions.OptionTargetType|keyof typeof google.protobuf.FieldOptions.OptionTargetType); + + /** 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 OneofOptions. */ + interface IOneofOptions { + + /** 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 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 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 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 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 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 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); + } + + /** Represents a ServiceOptions. */ + class ServiceOptions implements IServiceOptions { + + /** + * Constructs a new ServiceOptions. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IServiceOptions); + + /** 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 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 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|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|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 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 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 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 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|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|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; + } + } + + /** 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/google-cloud-networkservices/protos/protos.js b/packages/google-cloud-networkservices/protos/protos.js new file mode 100644 index 00000000000..b0785b85f70 --- /dev/null +++ b/packages/google-cloud-networkservices/protos/protos.js @@ -0,0 +1,48926 @@ +// Copyright 2023 Google LLC +// +// Licensed under the Apache License, Version 2.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_networkservices_protos || ($protobuf.roots._google_cloud_networkservices_protos = {}); + + $root.google = (function() { + + /** + * Namespace google. + * @exports google + * @namespace + */ + var google = {}; + + google.cloud = (function() { + + /** + * Namespace cloud. + * @memberof google + * @namespace + */ + var cloud = {}; + + cloud.networkservices = (function() { + + /** + * Namespace networkservices. + * @memberof google.cloud + * @namespace + */ + var networkservices = {}; + + networkservices.v1 = (function() { + + /** + * Namespace v1. + * @memberof google.cloud.networkservices + * @namespace + */ + var v1 = {}; + + v1.OperationMetadata = (function() { + + /** + * Properties of an OperationMetadata. + * @memberof google.cloud.networkservices.v1 + * @interface IOperationMetadata + * @property {google.protobuf.ITimestamp|null} [createTime] OperationMetadata createTime + * @property {google.protobuf.ITimestamp|null} [endTime] OperationMetadata endTime + * @property {string|null} [target] OperationMetadata target + * @property {string|null} [verb] OperationMetadata verb + * @property {string|null} [statusMessage] OperationMetadata statusMessage + * @property {boolean|null} [requestedCancellation] OperationMetadata requestedCancellation + * @property {string|null} [apiVersion] OperationMetadata apiVersion + */ + + /** + * Constructs a new OperationMetadata. + * @memberof google.cloud.networkservices.v1 + * @classdesc Represents an OperationMetadata. + * @implements IOperationMetadata + * @constructor + * @param {google.cloud.networkservices.v1.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.networkservices.v1.OperationMetadata + * @instance + */ + OperationMetadata.prototype.createTime = null; + + /** + * OperationMetadata endTime. + * @member {google.protobuf.ITimestamp|null|undefined} endTime + * @memberof google.cloud.networkservices.v1.OperationMetadata + * @instance + */ + OperationMetadata.prototype.endTime = null; + + /** + * OperationMetadata target. + * @member {string} target + * @memberof google.cloud.networkservices.v1.OperationMetadata + * @instance + */ + OperationMetadata.prototype.target = ""; + + /** + * OperationMetadata verb. + * @member {string} verb + * @memberof google.cloud.networkservices.v1.OperationMetadata + * @instance + */ + OperationMetadata.prototype.verb = ""; + + /** + * OperationMetadata statusMessage. + * @member {string} statusMessage + * @memberof google.cloud.networkservices.v1.OperationMetadata + * @instance + */ + OperationMetadata.prototype.statusMessage = ""; + + /** + * OperationMetadata requestedCancellation. + * @member {boolean} requestedCancellation + * @memberof google.cloud.networkservices.v1.OperationMetadata + * @instance + */ + OperationMetadata.prototype.requestedCancellation = false; + + /** + * OperationMetadata apiVersion. + * @member {string} apiVersion + * @memberof google.cloud.networkservices.v1.OperationMetadata + * @instance + */ + OperationMetadata.prototype.apiVersion = ""; + + /** + * Creates a new OperationMetadata instance using the specified properties. + * @function create + * @memberof google.cloud.networkservices.v1.OperationMetadata + * @static + * @param {google.cloud.networkservices.v1.IOperationMetadata=} [properties] Properties to set + * @returns {google.cloud.networkservices.v1.OperationMetadata} OperationMetadata instance + */ + OperationMetadata.create = function create(properties) { + return new OperationMetadata(properties); + }; + + /** + * Encodes the specified OperationMetadata message. Does not implicitly {@link google.cloud.networkservices.v1.OperationMetadata.verify|verify} messages. + * @function encode + * @memberof google.cloud.networkservices.v1.OperationMetadata + * @static + * @param {google.cloud.networkservices.v1.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.endTime != null && Object.hasOwnProperty.call(message, "endTime")) + $root.google.protobuf.Timestamp.encode(message.endTime, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.target != null && Object.hasOwnProperty.call(message, "target")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.target); + if (message.verb != null && Object.hasOwnProperty.call(message, "verb")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.verb); + if (message.statusMessage != null && Object.hasOwnProperty.call(message, "statusMessage")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.statusMessage); + if (message.requestedCancellation != null && Object.hasOwnProperty.call(message, "requestedCancellation")) + writer.uint32(/* id 6, wireType 0 =*/48).bool(message.requestedCancellation); + if (message.apiVersion != null && Object.hasOwnProperty.call(message, "apiVersion")) + writer.uint32(/* id 7, wireType 2 =*/58).string(message.apiVersion); + return writer; + }; + + /** + * Encodes the specified OperationMetadata message, length delimited. Does not implicitly {@link google.cloud.networkservices.v1.OperationMetadata.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.networkservices.v1.OperationMetadata + * @static + * @param {google.cloud.networkservices.v1.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.networkservices.v1.OperationMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.networkservices.v1.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) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.networkservices.v1.OperationMetadata(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.createTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 2: { + message.endTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 3: { + message.target = reader.string(); + break; + } + case 4: { + message.verb = reader.string(); + break; + } + case 5: { + message.statusMessage = reader.string(); + break; + } + case 6: { + message.requestedCancellation = reader.bool(); + break; + } + case 7: { + message.apiVersion = reader.string(); + 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.networkservices.v1.OperationMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.networkservices.v1.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.networkservices.v1.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"; + if (message.createTime != null && message.hasOwnProperty("createTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.createTime); + if (error) + return "createTime." + error; + } + if (message.endTime != null && message.hasOwnProperty("endTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.endTime); + if (error) + return "endTime." + error; + } + if (message.target != null && message.hasOwnProperty("target")) + if (!$util.isString(message.target)) + return "target: string expected"; + if (message.verb != null && message.hasOwnProperty("verb")) + if (!$util.isString(message.verb)) + return "verb: string expected"; + if (message.statusMessage != null && message.hasOwnProperty("statusMessage")) + if (!$util.isString(message.statusMessage)) + return "statusMessage: string expected"; + if (message.requestedCancellation != null && message.hasOwnProperty("requestedCancellation")) + if (typeof message.requestedCancellation !== "boolean") + return "requestedCancellation: boolean expected"; + if (message.apiVersion != null && message.hasOwnProperty("apiVersion")) + if (!$util.isString(message.apiVersion)) + return "apiVersion: string expected"; + return null; + }; + + /** + * Creates an OperationMetadata message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.networkservices.v1.OperationMetadata + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.networkservices.v1.OperationMetadata} OperationMetadata + */ + OperationMetadata.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.networkservices.v1.OperationMetadata) + return object; + var message = new $root.google.cloud.networkservices.v1.OperationMetadata(); + if (object.createTime != null) { + if (typeof object.createTime !== "object") + throw TypeError(".google.cloud.networkservices.v1.OperationMetadata.createTime: object expected"); + message.createTime = $root.google.protobuf.Timestamp.fromObject(object.createTime); + } + if (object.endTime != null) { + if (typeof object.endTime !== "object") + throw TypeError(".google.cloud.networkservices.v1.OperationMetadata.endTime: object expected"); + message.endTime = $root.google.protobuf.Timestamp.fromObject(object.endTime); + } + if (object.target != null) + message.target = String(object.target); + if (object.verb != null) + message.verb = String(object.verb); + if (object.statusMessage != null) + message.statusMessage = String(object.statusMessage); + if (object.requestedCancellation != null) + message.requestedCancellation = Boolean(object.requestedCancellation); + if (object.apiVersion != null) + message.apiVersion = String(object.apiVersion); + return message; + }; + + /** + * Creates a plain object from an OperationMetadata message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.networkservices.v1.OperationMetadata + * @static + * @param {google.cloud.networkservices.v1.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.endTime = null; + object.target = ""; + object.verb = ""; + object.statusMessage = ""; + object.requestedCancellation = false; + object.apiVersion = ""; + } + if (message.createTime != null && message.hasOwnProperty("createTime")) + object.createTime = $root.google.protobuf.Timestamp.toObject(message.createTime, options); + if (message.endTime != null && message.hasOwnProperty("endTime")) + object.endTime = $root.google.protobuf.Timestamp.toObject(message.endTime, options); + if (message.target != null && message.hasOwnProperty("target")) + object.target = message.target; + if (message.verb != null && message.hasOwnProperty("verb")) + object.verb = message.verb; + if (message.statusMessage != null && message.hasOwnProperty("statusMessage")) + object.statusMessage = message.statusMessage; + if (message.requestedCancellation != null && message.hasOwnProperty("requestedCancellation")) + object.requestedCancellation = message.requestedCancellation; + if (message.apiVersion != null && message.hasOwnProperty("apiVersion")) + object.apiVersion = message.apiVersion; + return object; + }; + + /** + * Converts this OperationMetadata to JSON. + * @function toJSON + * @memberof google.cloud.networkservices.v1.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.networkservices.v1.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.networkservices.v1.OperationMetadata"; + }; + + return OperationMetadata; + })(); + + v1.TrafficPortSelector = (function() { + + /** + * Properties of a TrafficPortSelector. + * @memberof google.cloud.networkservices.v1 + * @interface ITrafficPortSelector + * @property {Array.|null} [ports] TrafficPortSelector ports + */ + + /** + * Constructs a new TrafficPortSelector. + * @memberof google.cloud.networkservices.v1 + * @classdesc Represents a TrafficPortSelector. + * @implements ITrafficPortSelector + * @constructor + * @param {google.cloud.networkservices.v1.ITrafficPortSelector=} [properties] Properties to set + */ + function TrafficPortSelector(properties) { + this.ports = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * TrafficPortSelector ports. + * @member {Array.} ports + * @memberof google.cloud.networkservices.v1.TrafficPortSelector + * @instance + */ + TrafficPortSelector.prototype.ports = $util.emptyArray; + + /** + * Creates a new TrafficPortSelector instance using the specified properties. + * @function create + * @memberof google.cloud.networkservices.v1.TrafficPortSelector + * @static + * @param {google.cloud.networkservices.v1.ITrafficPortSelector=} [properties] Properties to set + * @returns {google.cloud.networkservices.v1.TrafficPortSelector} TrafficPortSelector instance + */ + TrafficPortSelector.create = function create(properties) { + return new TrafficPortSelector(properties); + }; + + /** + * Encodes the specified TrafficPortSelector message. Does not implicitly {@link google.cloud.networkservices.v1.TrafficPortSelector.verify|verify} messages. + * @function encode + * @memberof google.cloud.networkservices.v1.TrafficPortSelector + * @static + * @param {google.cloud.networkservices.v1.ITrafficPortSelector} message TrafficPortSelector message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TrafficPortSelector.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.ports != null && message.ports.length) + for (var i = 0; i < message.ports.length; ++i) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.ports[i]); + return writer; + }; + + /** + * Encodes the specified TrafficPortSelector message, length delimited. Does not implicitly {@link google.cloud.networkservices.v1.TrafficPortSelector.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.networkservices.v1.TrafficPortSelector + * @static + * @param {google.cloud.networkservices.v1.ITrafficPortSelector} message TrafficPortSelector message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TrafficPortSelector.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a TrafficPortSelector message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.networkservices.v1.TrafficPortSelector + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.networkservices.v1.TrafficPortSelector} TrafficPortSelector + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TrafficPortSelector.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.networkservices.v1.TrafficPortSelector(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.ports && message.ports.length)) + message.ports = []; + message.ports.push(reader.string()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a TrafficPortSelector message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.networkservices.v1.TrafficPortSelector + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.networkservices.v1.TrafficPortSelector} TrafficPortSelector + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TrafficPortSelector.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a TrafficPortSelector message. + * @function verify + * @memberof google.cloud.networkservices.v1.TrafficPortSelector + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + TrafficPortSelector.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.ports != null && message.hasOwnProperty("ports")) { + if (!Array.isArray(message.ports)) + return "ports: array expected"; + for (var i = 0; i < message.ports.length; ++i) + if (!$util.isString(message.ports[i])) + return "ports: string[] expected"; + } + return null; + }; + + /** + * Creates a TrafficPortSelector message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.networkservices.v1.TrafficPortSelector + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.networkservices.v1.TrafficPortSelector} TrafficPortSelector + */ + TrafficPortSelector.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.networkservices.v1.TrafficPortSelector) + return object; + var message = new $root.google.cloud.networkservices.v1.TrafficPortSelector(); + if (object.ports) { + if (!Array.isArray(object.ports)) + throw TypeError(".google.cloud.networkservices.v1.TrafficPortSelector.ports: array expected"); + message.ports = []; + for (var i = 0; i < object.ports.length; ++i) + message.ports[i] = String(object.ports[i]); + } + return message; + }; + + /** + * Creates a plain object from a TrafficPortSelector message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.networkservices.v1.TrafficPortSelector + * @static + * @param {google.cloud.networkservices.v1.TrafficPortSelector} message TrafficPortSelector + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + TrafficPortSelector.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.ports = []; + if (message.ports && message.ports.length) { + object.ports = []; + for (var j = 0; j < message.ports.length; ++j) + object.ports[j] = message.ports[j]; + } + return object; + }; + + /** + * Converts this TrafficPortSelector to JSON. + * @function toJSON + * @memberof google.cloud.networkservices.v1.TrafficPortSelector + * @instance + * @returns {Object.} JSON object + */ + TrafficPortSelector.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for TrafficPortSelector + * @function getTypeUrl + * @memberof google.cloud.networkservices.v1.TrafficPortSelector + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TrafficPortSelector.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.networkservices.v1.TrafficPortSelector"; + }; + + return TrafficPortSelector; + })(); + + v1.EndpointMatcher = (function() { + + /** + * Properties of an EndpointMatcher. + * @memberof google.cloud.networkservices.v1 + * @interface IEndpointMatcher + * @property {google.cloud.networkservices.v1.EndpointMatcher.IMetadataLabelMatcher|null} [metadataLabelMatcher] EndpointMatcher metadataLabelMatcher + */ + + /** + * Constructs a new EndpointMatcher. + * @memberof google.cloud.networkservices.v1 + * @classdesc Represents an EndpointMatcher. + * @implements IEndpointMatcher + * @constructor + * @param {google.cloud.networkservices.v1.IEndpointMatcher=} [properties] Properties to set + */ + function EndpointMatcher(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * EndpointMatcher metadataLabelMatcher. + * @member {google.cloud.networkservices.v1.EndpointMatcher.IMetadataLabelMatcher|null|undefined} metadataLabelMatcher + * @memberof google.cloud.networkservices.v1.EndpointMatcher + * @instance + */ + EndpointMatcher.prototype.metadataLabelMatcher = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * EndpointMatcher matcherType. + * @member {"metadataLabelMatcher"|undefined} matcherType + * @memberof google.cloud.networkservices.v1.EndpointMatcher + * @instance + */ + Object.defineProperty(EndpointMatcher.prototype, "matcherType", { + get: $util.oneOfGetter($oneOfFields = ["metadataLabelMatcher"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new EndpointMatcher instance using the specified properties. + * @function create + * @memberof google.cloud.networkservices.v1.EndpointMatcher + * @static + * @param {google.cloud.networkservices.v1.IEndpointMatcher=} [properties] Properties to set + * @returns {google.cloud.networkservices.v1.EndpointMatcher} EndpointMatcher instance + */ + EndpointMatcher.create = function create(properties) { + return new EndpointMatcher(properties); + }; + + /** + * Encodes the specified EndpointMatcher message. Does not implicitly {@link google.cloud.networkservices.v1.EndpointMatcher.verify|verify} messages. + * @function encode + * @memberof google.cloud.networkservices.v1.EndpointMatcher + * @static + * @param {google.cloud.networkservices.v1.IEndpointMatcher} message EndpointMatcher message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EndpointMatcher.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.metadataLabelMatcher != null && Object.hasOwnProperty.call(message, "metadataLabelMatcher")) + $root.google.cloud.networkservices.v1.EndpointMatcher.MetadataLabelMatcher.encode(message.metadataLabelMatcher, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified EndpointMatcher message, length delimited. Does not implicitly {@link google.cloud.networkservices.v1.EndpointMatcher.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.networkservices.v1.EndpointMatcher + * @static + * @param {google.cloud.networkservices.v1.IEndpointMatcher} message EndpointMatcher message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EndpointMatcher.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an EndpointMatcher message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.networkservices.v1.EndpointMatcher + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.networkservices.v1.EndpointMatcher} EndpointMatcher + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EndpointMatcher.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.networkservices.v1.EndpointMatcher(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.metadataLabelMatcher = $root.google.cloud.networkservices.v1.EndpointMatcher.MetadataLabelMatcher.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an EndpointMatcher message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.networkservices.v1.EndpointMatcher + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.networkservices.v1.EndpointMatcher} EndpointMatcher + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EndpointMatcher.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an EndpointMatcher message. + * @function verify + * @memberof google.cloud.networkservices.v1.EndpointMatcher + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + EndpointMatcher.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.metadataLabelMatcher != null && message.hasOwnProperty("metadataLabelMatcher")) { + properties.matcherType = 1; + { + var error = $root.google.cloud.networkservices.v1.EndpointMatcher.MetadataLabelMatcher.verify(message.metadataLabelMatcher); + if (error) + return "metadataLabelMatcher." + error; + } + } + return null; + }; + + /** + * Creates an EndpointMatcher message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.networkservices.v1.EndpointMatcher + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.networkservices.v1.EndpointMatcher} EndpointMatcher + */ + EndpointMatcher.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.networkservices.v1.EndpointMatcher) + return object; + var message = new $root.google.cloud.networkservices.v1.EndpointMatcher(); + if (object.metadataLabelMatcher != null) { + if (typeof object.metadataLabelMatcher !== "object") + throw TypeError(".google.cloud.networkservices.v1.EndpointMatcher.metadataLabelMatcher: object expected"); + message.metadataLabelMatcher = $root.google.cloud.networkservices.v1.EndpointMatcher.MetadataLabelMatcher.fromObject(object.metadataLabelMatcher); + } + return message; + }; + + /** + * Creates a plain object from an EndpointMatcher message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.networkservices.v1.EndpointMatcher + * @static + * @param {google.cloud.networkservices.v1.EndpointMatcher} message EndpointMatcher + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + EndpointMatcher.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.metadataLabelMatcher != null && message.hasOwnProperty("metadataLabelMatcher")) { + object.metadataLabelMatcher = $root.google.cloud.networkservices.v1.EndpointMatcher.MetadataLabelMatcher.toObject(message.metadataLabelMatcher, options); + if (options.oneofs) + object.matcherType = "metadataLabelMatcher"; + } + return object; + }; + + /** + * Converts this EndpointMatcher to JSON. + * @function toJSON + * @memberof google.cloud.networkservices.v1.EndpointMatcher + * @instance + * @returns {Object.} JSON object + */ + EndpointMatcher.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for EndpointMatcher + * @function getTypeUrl + * @memberof google.cloud.networkservices.v1.EndpointMatcher + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + EndpointMatcher.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.networkservices.v1.EndpointMatcher"; + }; + + EndpointMatcher.MetadataLabelMatcher = (function() { + + /** + * Properties of a MetadataLabelMatcher. + * @memberof google.cloud.networkservices.v1.EndpointMatcher + * @interface IMetadataLabelMatcher + * @property {google.cloud.networkservices.v1.EndpointMatcher.MetadataLabelMatcher.MetadataLabelMatchCriteria|null} [metadataLabelMatchCriteria] MetadataLabelMatcher metadataLabelMatchCriteria + * @property {Array.|null} [metadataLabels] MetadataLabelMatcher metadataLabels + */ + + /** + * Constructs a new MetadataLabelMatcher. + * @memberof google.cloud.networkservices.v1.EndpointMatcher + * @classdesc Represents a MetadataLabelMatcher. + * @implements IMetadataLabelMatcher + * @constructor + * @param {google.cloud.networkservices.v1.EndpointMatcher.IMetadataLabelMatcher=} [properties] Properties to set + */ + function MetadataLabelMatcher(properties) { + this.metadataLabels = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * MetadataLabelMatcher metadataLabelMatchCriteria. + * @member {google.cloud.networkservices.v1.EndpointMatcher.MetadataLabelMatcher.MetadataLabelMatchCriteria} metadataLabelMatchCriteria + * @memberof google.cloud.networkservices.v1.EndpointMatcher.MetadataLabelMatcher + * @instance + */ + MetadataLabelMatcher.prototype.metadataLabelMatchCriteria = 0; + + /** + * MetadataLabelMatcher metadataLabels. + * @member {Array.} metadataLabels + * @memberof google.cloud.networkservices.v1.EndpointMatcher.MetadataLabelMatcher + * @instance + */ + MetadataLabelMatcher.prototype.metadataLabels = $util.emptyArray; + + /** + * Creates a new MetadataLabelMatcher instance using the specified properties. + * @function create + * @memberof google.cloud.networkservices.v1.EndpointMatcher.MetadataLabelMatcher + * @static + * @param {google.cloud.networkservices.v1.EndpointMatcher.IMetadataLabelMatcher=} [properties] Properties to set + * @returns {google.cloud.networkservices.v1.EndpointMatcher.MetadataLabelMatcher} MetadataLabelMatcher instance + */ + MetadataLabelMatcher.create = function create(properties) { + return new MetadataLabelMatcher(properties); + }; + + /** + * Encodes the specified MetadataLabelMatcher message. Does not implicitly {@link google.cloud.networkservices.v1.EndpointMatcher.MetadataLabelMatcher.verify|verify} messages. + * @function encode + * @memberof google.cloud.networkservices.v1.EndpointMatcher.MetadataLabelMatcher + * @static + * @param {google.cloud.networkservices.v1.EndpointMatcher.IMetadataLabelMatcher} message MetadataLabelMatcher message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MetadataLabelMatcher.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.metadataLabelMatchCriteria != null && Object.hasOwnProperty.call(message, "metadataLabelMatchCriteria")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.metadataLabelMatchCriteria); + if (message.metadataLabels != null && message.metadataLabels.length) + for (var i = 0; i < message.metadataLabels.length; ++i) + $root.google.cloud.networkservices.v1.EndpointMatcher.MetadataLabelMatcher.MetadataLabels.encode(message.metadataLabels[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified MetadataLabelMatcher message, length delimited. Does not implicitly {@link google.cloud.networkservices.v1.EndpointMatcher.MetadataLabelMatcher.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.networkservices.v1.EndpointMatcher.MetadataLabelMatcher + * @static + * @param {google.cloud.networkservices.v1.EndpointMatcher.IMetadataLabelMatcher} message MetadataLabelMatcher message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MetadataLabelMatcher.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a MetadataLabelMatcher message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.networkservices.v1.EndpointMatcher.MetadataLabelMatcher + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.networkservices.v1.EndpointMatcher.MetadataLabelMatcher} MetadataLabelMatcher + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MetadataLabelMatcher.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.networkservices.v1.EndpointMatcher.MetadataLabelMatcher(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.metadataLabelMatchCriteria = reader.int32(); + break; + } + case 2: { + if (!(message.metadataLabels && message.metadataLabels.length)) + message.metadataLabels = []; + message.metadataLabels.push($root.google.cloud.networkservices.v1.EndpointMatcher.MetadataLabelMatcher.MetadataLabels.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a MetadataLabelMatcher message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.networkservices.v1.EndpointMatcher.MetadataLabelMatcher + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.networkservices.v1.EndpointMatcher.MetadataLabelMatcher} MetadataLabelMatcher + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MetadataLabelMatcher.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a MetadataLabelMatcher message. + * @function verify + * @memberof google.cloud.networkservices.v1.EndpointMatcher.MetadataLabelMatcher + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + MetadataLabelMatcher.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.metadataLabelMatchCriteria != null && message.hasOwnProperty("metadataLabelMatchCriteria")) + switch (message.metadataLabelMatchCriteria) { + default: + return "metadataLabelMatchCriteria: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.metadataLabels != null && message.hasOwnProperty("metadataLabels")) { + if (!Array.isArray(message.metadataLabels)) + return "metadataLabels: array expected"; + for (var i = 0; i < message.metadataLabels.length; ++i) { + var error = $root.google.cloud.networkservices.v1.EndpointMatcher.MetadataLabelMatcher.MetadataLabels.verify(message.metadataLabels[i]); + if (error) + return "metadataLabels." + error; + } + } + return null; + }; + + /** + * Creates a MetadataLabelMatcher message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.networkservices.v1.EndpointMatcher.MetadataLabelMatcher + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.networkservices.v1.EndpointMatcher.MetadataLabelMatcher} MetadataLabelMatcher + */ + MetadataLabelMatcher.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.networkservices.v1.EndpointMatcher.MetadataLabelMatcher) + return object; + var message = new $root.google.cloud.networkservices.v1.EndpointMatcher.MetadataLabelMatcher(); + switch (object.metadataLabelMatchCriteria) { + default: + if (typeof object.metadataLabelMatchCriteria === "number") { + message.metadataLabelMatchCriteria = object.metadataLabelMatchCriteria; + break; + } + break; + case "METADATA_LABEL_MATCH_CRITERIA_UNSPECIFIED": + case 0: + message.metadataLabelMatchCriteria = 0; + break; + case "MATCH_ANY": + case 1: + message.metadataLabelMatchCriteria = 1; + break; + case "MATCH_ALL": + case 2: + message.metadataLabelMatchCriteria = 2; + break; + } + if (object.metadataLabels) { + if (!Array.isArray(object.metadataLabels)) + throw TypeError(".google.cloud.networkservices.v1.EndpointMatcher.MetadataLabelMatcher.metadataLabels: array expected"); + message.metadataLabels = []; + for (var i = 0; i < object.metadataLabels.length; ++i) { + if (typeof object.metadataLabels[i] !== "object") + throw TypeError(".google.cloud.networkservices.v1.EndpointMatcher.MetadataLabelMatcher.metadataLabels: object expected"); + message.metadataLabels[i] = $root.google.cloud.networkservices.v1.EndpointMatcher.MetadataLabelMatcher.MetadataLabels.fromObject(object.metadataLabels[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a MetadataLabelMatcher message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.networkservices.v1.EndpointMatcher.MetadataLabelMatcher + * @static + * @param {google.cloud.networkservices.v1.EndpointMatcher.MetadataLabelMatcher} message MetadataLabelMatcher + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + MetadataLabelMatcher.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.metadataLabels = []; + if (options.defaults) + object.metadataLabelMatchCriteria = options.enums === String ? "METADATA_LABEL_MATCH_CRITERIA_UNSPECIFIED" : 0; + if (message.metadataLabelMatchCriteria != null && message.hasOwnProperty("metadataLabelMatchCriteria")) + object.metadataLabelMatchCriteria = options.enums === String ? $root.google.cloud.networkservices.v1.EndpointMatcher.MetadataLabelMatcher.MetadataLabelMatchCriteria[message.metadataLabelMatchCriteria] === undefined ? message.metadataLabelMatchCriteria : $root.google.cloud.networkservices.v1.EndpointMatcher.MetadataLabelMatcher.MetadataLabelMatchCriteria[message.metadataLabelMatchCriteria] : message.metadataLabelMatchCriteria; + if (message.metadataLabels && message.metadataLabels.length) { + object.metadataLabels = []; + for (var j = 0; j < message.metadataLabels.length; ++j) + object.metadataLabels[j] = $root.google.cloud.networkservices.v1.EndpointMatcher.MetadataLabelMatcher.MetadataLabels.toObject(message.metadataLabels[j], options); + } + return object; + }; + + /** + * Converts this MetadataLabelMatcher to JSON. + * @function toJSON + * @memberof google.cloud.networkservices.v1.EndpointMatcher.MetadataLabelMatcher + * @instance + * @returns {Object.} JSON object + */ + MetadataLabelMatcher.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for MetadataLabelMatcher + * @function getTypeUrl + * @memberof google.cloud.networkservices.v1.EndpointMatcher.MetadataLabelMatcher + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + MetadataLabelMatcher.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.networkservices.v1.EndpointMatcher.MetadataLabelMatcher"; + }; + + MetadataLabelMatcher.MetadataLabels = (function() { + + /** + * Properties of a MetadataLabels. + * @memberof google.cloud.networkservices.v1.EndpointMatcher.MetadataLabelMatcher + * @interface IMetadataLabels + * @property {string|null} [labelName] MetadataLabels labelName + * @property {string|null} [labelValue] MetadataLabels labelValue + */ + + /** + * Constructs a new MetadataLabels. + * @memberof google.cloud.networkservices.v1.EndpointMatcher.MetadataLabelMatcher + * @classdesc Represents a MetadataLabels. + * @implements IMetadataLabels + * @constructor + * @param {google.cloud.networkservices.v1.EndpointMatcher.MetadataLabelMatcher.IMetadataLabels=} [properties] Properties to set + */ + function MetadataLabels(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * MetadataLabels labelName. + * @member {string} labelName + * @memberof google.cloud.networkservices.v1.EndpointMatcher.MetadataLabelMatcher.MetadataLabels + * @instance + */ + MetadataLabels.prototype.labelName = ""; + + /** + * MetadataLabels labelValue. + * @member {string} labelValue + * @memberof google.cloud.networkservices.v1.EndpointMatcher.MetadataLabelMatcher.MetadataLabels + * @instance + */ + MetadataLabels.prototype.labelValue = ""; + + /** + * Creates a new MetadataLabels instance using the specified properties. + * @function create + * @memberof google.cloud.networkservices.v1.EndpointMatcher.MetadataLabelMatcher.MetadataLabels + * @static + * @param {google.cloud.networkservices.v1.EndpointMatcher.MetadataLabelMatcher.IMetadataLabels=} [properties] Properties to set + * @returns {google.cloud.networkservices.v1.EndpointMatcher.MetadataLabelMatcher.MetadataLabels} MetadataLabels instance + */ + MetadataLabels.create = function create(properties) { + return new MetadataLabels(properties); + }; + + /** + * Encodes the specified MetadataLabels message. Does not implicitly {@link google.cloud.networkservices.v1.EndpointMatcher.MetadataLabelMatcher.MetadataLabels.verify|verify} messages. + * @function encode + * @memberof google.cloud.networkservices.v1.EndpointMatcher.MetadataLabelMatcher.MetadataLabels + * @static + * @param {google.cloud.networkservices.v1.EndpointMatcher.MetadataLabelMatcher.IMetadataLabels} message MetadataLabels message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MetadataLabels.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.labelName != null && Object.hasOwnProperty.call(message, "labelName")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.labelName); + if (message.labelValue != null && Object.hasOwnProperty.call(message, "labelValue")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.labelValue); + return writer; + }; + + /** + * Encodes the specified MetadataLabels message, length delimited. Does not implicitly {@link google.cloud.networkservices.v1.EndpointMatcher.MetadataLabelMatcher.MetadataLabels.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.networkservices.v1.EndpointMatcher.MetadataLabelMatcher.MetadataLabels + * @static + * @param {google.cloud.networkservices.v1.EndpointMatcher.MetadataLabelMatcher.IMetadataLabels} message MetadataLabels message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MetadataLabels.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a MetadataLabels message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.networkservices.v1.EndpointMatcher.MetadataLabelMatcher.MetadataLabels + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.networkservices.v1.EndpointMatcher.MetadataLabelMatcher.MetadataLabels} MetadataLabels + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MetadataLabels.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.networkservices.v1.EndpointMatcher.MetadataLabelMatcher.MetadataLabels(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.labelName = reader.string(); + break; + } + case 2: { + message.labelValue = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a MetadataLabels message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.networkservices.v1.EndpointMatcher.MetadataLabelMatcher.MetadataLabels + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.networkservices.v1.EndpointMatcher.MetadataLabelMatcher.MetadataLabels} MetadataLabels + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MetadataLabels.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a MetadataLabels message. + * @function verify + * @memberof google.cloud.networkservices.v1.EndpointMatcher.MetadataLabelMatcher.MetadataLabels + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + MetadataLabels.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.labelName != null && message.hasOwnProperty("labelName")) + if (!$util.isString(message.labelName)) + return "labelName: string expected"; + if (message.labelValue != null && message.hasOwnProperty("labelValue")) + if (!$util.isString(message.labelValue)) + return "labelValue: string expected"; + return null; + }; + + /** + * Creates a MetadataLabels message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.networkservices.v1.EndpointMatcher.MetadataLabelMatcher.MetadataLabels + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.networkservices.v1.EndpointMatcher.MetadataLabelMatcher.MetadataLabels} MetadataLabels + */ + MetadataLabels.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.networkservices.v1.EndpointMatcher.MetadataLabelMatcher.MetadataLabels) + return object; + var message = new $root.google.cloud.networkservices.v1.EndpointMatcher.MetadataLabelMatcher.MetadataLabels(); + if (object.labelName != null) + message.labelName = String(object.labelName); + if (object.labelValue != null) + message.labelValue = String(object.labelValue); + return message; + }; + + /** + * Creates a plain object from a MetadataLabels message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.networkservices.v1.EndpointMatcher.MetadataLabelMatcher.MetadataLabels + * @static + * @param {google.cloud.networkservices.v1.EndpointMatcher.MetadataLabelMatcher.MetadataLabels} message MetadataLabels + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + MetadataLabels.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.labelName = ""; + object.labelValue = ""; + } + if (message.labelName != null && message.hasOwnProperty("labelName")) + object.labelName = message.labelName; + if (message.labelValue != null && message.hasOwnProperty("labelValue")) + object.labelValue = message.labelValue; + return object; + }; + + /** + * Converts this MetadataLabels to JSON. + * @function toJSON + * @memberof google.cloud.networkservices.v1.EndpointMatcher.MetadataLabelMatcher.MetadataLabels + * @instance + * @returns {Object.} JSON object + */ + MetadataLabels.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for MetadataLabels + * @function getTypeUrl + * @memberof google.cloud.networkservices.v1.EndpointMatcher.MetadataLabelMatcher.MetadataLabels + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + MetadataLabels.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.networkservices.v1.EndpointMatcher.MetadataLabelMatcher.MetadataLabels"; + }; + + return MetadataLabels; + })(); + + /** + * MetadataLabelMatchCriteria enum. + * @name google.cloud.networkservices.v1.EndpointMatcher.MetadataLabelMatcher.MetadataLabelMatchCriteria + * @enum {number} + * @property {number} METADATA_LABEL_MATCH_CRITERIA_UNSPECIFIED=0 METADATA_LABEL_MATCH_CRITERIA_UNSPECIFIED value + * @property {number} MATCH_ANY=1 MATCH_ANY value + * @property {number} MATCH_ALL=2 MATCH_ALL value + */ + MetadataLabelMatcher.MetadataLabelMatchCriteria = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "METADATA_LABEL_MATCH_CRITERIA_UNSPECIFIED"] = 0; + values[valuesById[1] = "MATCH_ANY"] = 1; + values[valuesById[2] = "MATCH_ALL"] = 2; + return values; + })(); + + return MetadataLabelMatcher; + })(); + + return EndpointMatcher; + })(); + + v1.EndpointPolicy = (function() { + + /** + * Properties of an EndpointPolicy. + * @memberof google.cloud.networkservices.v1 + * @interface IEndpointPolicy + * @property {string|null} [name] EndpointPolicy name + * @property {google.protobuf.ITimestamp|null} [createTime] EndpointPolicy createTime + * @property {google.protobuf.ITimestamp|null} [updateTime] EndpointPolicy updateTime + * @property {Object.|null} [labels] EndpointPolicy labels + * @property {google.cloud.networkservices.v1.EndpointPolicy.EndpointPolicyType|null} [type] EndpointPolicy type + * @property {string|null} [authorizationPolicy] EndpointPolicy authorizationPolicy + * @property {google.cloud.networkservices.v1.IEndpointMatcher|null} [endpointMatcher] EndpointPolicy endpointMatcher + * @property {google.cloud.networkservices.v1.ITrafficPortSelector|null} [trafficPortSelector] EndpointPolicy trafficPortSelector + * @property {string|null} [description] EndpointPolicy description + * @property {string|null} [serverTlsPolicy] EndpointPolicy serverTlsPolicy + * @property {string|null} [clientTlsPolicy] EndpointPolicy clientTlsPolicy + */ + + /** + * Constructs a new EndpointPolicy. + * @memberof google.cloud.networkservices.v1 + * @classdesc Represents an EndpointPolicy. + * @implements IEndpointPolicy + * @constructor + * @param {google.cloud.networkservices.v1.IEndpointPolicy=} [properties] Properties to set + */ + function EndpointPolicy(properties) { + this.labels = {}; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * EndpointPolicy name. + * @member {string} name + * @memberof google.cloud.networkservices.v1.EndpointPolicy + * @instance + */ + EndpointPolicy.prototype.name = ""; + + /** + * EndpointPolicy createTime. + * @member {google.protobuf.ITimestamp|null|undefined} createTime + * @memberof google.cloud.networkservices.v1.EndpointPolicy + * @instance + */ + EndpointPolicy.prototype.createTime = null; + + /** + * EndpointPolicy updateTime. + * @member {google.protobuf.ITimestamp|null|undefined} updateTime + * @memberof google.cloud.networkservices.v1.EndpointPolicy + * @instance + */ + EndpointPolicy.prototype.updateTime = null; + + /** + * EndpointPolicy labels. + * @member {Object.} labels + * @memberof google.cloud.networkservices.v1.EndpointPolicy + * @instance + */ + EndpointPolicy.prototype.labels = $util.emptyObject; + + /** + * EndpointPolicy type. + * @member {google.cloud.networkservices.v1.EndpointPolicy.EndpointPolicyType} type + * @memberof google.cloud.networkservices.v1.EndpointPolicy + * @instance + */ + EndpointPolicy.prototype.type = 0; + + /** + * EndpointPolicy authorizationPolicy. + * @member {string} authorizationPolicy + * @memberof google.cloud.networkservices.v1.EndpointPolicy + * @instance + */ + EndpointPolicy.prototype.authorizationPolicy = ""; + + /** + * EndpointPolicy endpointMatcher. + * @member {google.cloud.networkservices.v1.IEndpointMatcher|null|undefined} endpointMatcher + * @memberof google.cloud.networkservices.v1.EndpointPolicy + * @instance + */ + EndpointPolicy.prototype.endpointMatcher = null; + + /** + * EndpointPolicy trafficPortSelector. + * @member {google.cloud.networkservices.v1.ITrafficPortSelector|null|undefined} trafficPortSelector + * @memberof google.cloud.networkservices.v1.EndpointPolicy + * @instance + */ + EndpointPolicy.prototype.trafficPortSelector = null; + + /** + * EndpointPolicy description. + * @member {string} description + * @memberof google.cloud.networkservices.v1.EndpointPolicy + * @instance + */ + EndpointPolicy.prototype.description = ""; + + /** + * EndpointPolicy serverTlsPolicy. + * @member {string} serverTlsPolicy + * @memberof google.cloud.networkservices.v1.EndpointPolicy + * @instance + */ + EndpointPolicy.prototype.serverTlsPolicy = ""; + + /** + * EndpointPolicy clientTlsPolicy. + * @member {string} clientTlsPolicy + * @memberof google.cloud.networkservices.v1.EndpointPolicy + * @instance + */ + EndpointPolicy.prototype.clientTlsPolicy = ""; + + /** + * Creates a new EndpointPolicy instance using the specified properties. + * @function create + * @memberof google.cloud.networkservices.v1.EndpointPolicy + * @static + * @param {google.cloud.networkservices.v1.IEndpointPolicy=} [properties] Properties to set + * @returns {google.cloud.networkservices.v1.EndpointPolicy} EndpointPolicy instance + */ + EndpointPolicy.create = function create(properties) { + return new EndpointPolicy(properties); + }; + + /** + * Encodes the specified EndpointPolicy message. Does not implicitly {@link google.cloud.networkservices.v1.EndpointPolicy.verify|verify} messages. + * @function encode + * @memberof google.cloud.networkservices.v1.EndpointPolicy + * @static + * @param {google.cloud.networkservices.v1.IEndpointPolicy} message EndpointPolicy message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EndpointPolicy.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.createTime != null && Object.hasOwnProperty.call(message, "createTime")) + $root.google.protobuf.Timestamp.encode(message.createTime, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + 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(); + if (message.labels != null && Object.hasOwnProperty.call(message, "labels")) + for (var keys = Object.keys(message.labels), i = 0; i < keys.length; ++i) + writer.uint32(/* id 4, wireType 2 =*/34).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.labels[keys[i]]).ldelim(); + if (message.type != null && Object.hasOwnProperty.call(message, "type")) + writer.uint32(/* id 5, wireType 0 =*/40).int32(message.type); + if (message.authorizationPolicy != null && Object.hasOwnProperty.call(message, "authorizationPolicy")) + writer.uint32(/* id 7, wireType 2 =*/58).string(message.authorizationPolicy); + if (message.endpointMatcher != null && Object.hasOwnProperty.call(message, "endpointMatcher")) + $root.google.cloud.networkservices.v1.EndpointMatcher.encode(message.endpointMatcher, writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim(); + if (message.trafficPortSelector != null && Object.hasOwnProperty.call(message, "trafficPortSelector")) + $root.google.cloud.networkservices.v1.TrafficPortSelector.encode(message.trafficPortSelector, writer.uint32(/* id 10, wireType 2 =*/82).fork()).ldelim(); + if (message.description != null && Object.hasOwnProperty.call(message, "description")) + writer.uint32(/* id 11, wireType 2 =*/90).string(message.description); + if (message.serverTlsPolicy != null && Object.hasOwnProperty.call(message, "serverTlsPolicy")) + writer.uint32(/* id 12, wireType 2 =*/98).string(message.serverTlsPolicy); + if (message.clientTlsPolicy != null && Object.hasOwnProperty.call(message, "clientTlsPolicy")) + writer.uint32(/* id 13, wireType 2 =*/106).string(message.clientTlsPolicy); + return writer; + }; + + /** + * Encodes the specified EndpointPolicy message, length delimited. Does not implicitly {@link google.cloud.networkservices.v1.EndpointPolicy.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.networkservices.v1.EndpointPolicy + * @static + * @param {google.cloud.networkservices.v1.IEndpointPolicy} message EndpointPolicy message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EndpointPolicy.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an EndpointPolicy message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.networkservices.v1.EndpointPolicy + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.networkservices.v1.EndpointPolicy} EndpointPolicy + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EndpointPolicy.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.networkservices.v1.EndpointPolicy(), key, value; + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.createTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 3: { + message.updateTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 4: { + if (message.labels === $util.emptyObject) + message.labels = {}; + 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.labels[key] = value; + break; + } + case 5: { + message.type = reader.int32(); + break; + } + case 7: { + message.authorizationPolicy = reader.string(); + break; + } + case 9: { + message.endpointMatcher = $root.google.cloud.networkservices.v1.EndpointMatcher.decode(reader, reader.uint32()); + break; + } + case 10: { + message.trafficPortSelector = $root.google.cloud.networkservices.v1.TrafficPortSelector.decode(reader, reader.uint32()); + break; + } + case 11: { + message.description = reader.string(); + break; + } + case 12: { + message.serverTlsPolicy = reader.string(); + break; + } + case 13: { + message.clientTlsPolicy = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an EndpointPolicy message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.networkservices.v1.EndpointPolicy + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.networkservices.v1.EndpointPolicy} EndpointPolicy + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EndpointPolicy.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an EndpointPolicy message. + * @function verify + * @memberof google.cloud.networkservices.v1.EndpointPolicy + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + EndpointPolicy.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.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.labels != null && message.hasOwnProperty("labels")) { + if (!$util.isObject(message.labels)) + return "labels: object expected"; + var key = Object.keys(message.labels); + for (var i = 0; i < key.length; ++i) + if (!$util.isString(message.labels[key[i]])) + return "labels: string{k:string} expected"; + } + if (message.type != null && message.hasOwnProperty("type")) + switch (message.type) { + default: + return "type: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.authorizationPolicy != null && message.hasOwnProperty("authorizationPolicy")) + if (!$util.isString(message.authorizationPolicy)) + return "authorizationPolicy: string expected"; + if (message.endpointMatcher != null && message.hasOwnProperty("endpointMatcher")) { + var error = $root.google.cloud.networkservices.v1.EndpointMatcher.verify(message.endpointMatcher); + if (error) + return "endpointMatcher." + error; + } + if (message.trafficPortSelector != null && message.hasOwnProperty("trafficPortSelector")) { + var error = $root.google.cloud.networkservices.v1.TrafficPortSelector.verify(message.trafficPortSelector); + if (error) + return "trafficPortSelector." + error; + } + if (message.description != null && message.hasOwnProperty("description")) + if (!$util.isString(message.description)) + return "description: string expected"; + if (message.serverTlsPolicy != null && message.hasOwnProperty("serverTlsPolicy")) + if (!$util.isString(message.serverTlsPolicy)) + return "serverTlsPolicy: string expected"; + if (message.clientTlsPolicy != null && message.hasOwnProperty("clientTlsPolicy")) + if (!$util.isString(message.clientTlsPolicy)) + return "clientTlsPolicy: string expected"; + return null; + }; + + /** + * Creates an EndpointPolicy message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.networkservices.v1.EndpointPolicy + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.networkservices.v1.EndpointPolicy} EndpointPolicy + */ + EndpointPolicy.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.networkservices.v1.EndpointPolicy) + return object; + var message = new $root.google.cloud.networkservices.v1.EndpointPolicy(); + if (object.name != null) + message.name = String(object.name); + if (object.createTime != null) { + if (typeof object.createTime !== "object") + throw TypeError(".google.cloud.networkservices.v1.EndpointPolicy.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.networkservices.v1.EndpointPolicy.updateTime: object expected"); + message.updateTime = $root.google.protobuf.Timestamp.fromObject(object.updateTime); + } + if (object.labels) { + if (typeof object.labels !== "object") + throw TypeError(".google.cloud.networkservices.v1.EndpointPolicy.labels: object expected"); + message.labels = {}; + for (var keys = Object.keys(object.labels), i = 0; i < keys.length; ++i) + message.labels[keys[i]] = String(object.labels[keys[i]]); + } + switch (object.type) { + default: + if (typeof object.type === "number") { + message.type = object.type; + break; + } + break; + case "ENDPOINT_POLICY_TYPE_UNSPECIFIED": + case 0: + message.type = 0; + break; + case "SIDECAR_PROXY": + case 1: + message.type = 1; + break; + case "GRPC_SERVER": + case 2: + message.type = 2; + break; + } + if (object.authorizationPolicy != null) + message.authorizationPolicy = String(object.authorizationPolicy); + if (object.endpointMatcher != null) { + if (typeof object.endpointMatcher !== "object") + throw TypeError(".google.cloud.networkservices.v1.EndpointPolicy.endpointMatcher: object expected"); + message.endpointMatcher = $root.google.cloud.networkservices.v1.EndpointMatcher.fromObject(object.endpointMatcher); + } + if (object.trafficPortSelector != null) { + if (typeof object.trafficPortSelector !== "object") + throw TypeError(".google.cloud.networkservices.v1.EndpointPolicy.trafficPortSelector: object expected"); + message.trafficPortSelector = $root.google.cloud.networkservices.v1.TrafficPortSelector.fromObject(object.trafficPortSelector); + } + if (object.description != null) + message.description = String(object.description); + if (object.serverTlsPolicy != null) + message.serverTlsPolicy = String(object.serverTlsPolicy); + if (object.clientTlsPolicy != null) + message.clientTlsPolicy = String(object.clientTlsPolicy); + return message; + }; + + /** + * Creates a plain object from an EndpointPolicy message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.networkservices.v1.EndpointPolicy + * @static + * @param {google.cloud.networkservices.v1.EndpointPolicy} message EndpointPolicy + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + EndpointPolicy.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.objects || options.defaults) + object.labels = {}; + if (options.defaults) { + object.name = ""; + object.createTime = null; + object.updateTime = null; + object.type = options.enums === String ? "ENDPOINT_POLICY_TYPE_UNSPECIFIED" : 0; + object.authorizationPolicy = ""; + object.endpointMatcher = null; + object.trafficPortSelector = null; + object.description = ""; + object.serverTlsPolicy = ""; + object.clientTlsPolicy = ""; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + 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); + var keys2; + if (message.labels && (keys2 = Object.keys(message.labels)).length) { + object.labels = {}; + for (var j = 0; j < keys2.length; ++j) + object.labels[keys2[j]] = message.labels[keys2[j]]; + } + if (message.type != null && message.hasOwnProperty("type")) + object.type = options.enums === String ? $root.google.cloud.networkservices.v1.EndpointPolicy.EndpointPolicyType[message.type] === undefined ? message.type : $root.google.cloud.networkservices.v1.EndpointPolicy.EndpointPolicyType[message.type] : message.type; + if (message.authorizationPolicy != null && message.hasOwnProperty("authorizationPolicy")) + object.authorizationPolicy = message.authorizationPolicy; + if (message.endpointMatcher != null && message.hasOwnProperty("endpointMatcher")) + object.endpointMatcher = $root.google.cloud.networkservices.v1.EndpointMatcher.toObject(message.endpointMatcher, options); + if (message.trafficPortSelector != null && message.hasOwnProperty("trafficPortSelector")) + object.trafficPortSelector = $root.google.cloud.networkservices.v1.TrafficPortSelector.toObject(message.trafficPortSelector, options); + if (message.description != null && message.hasOwnProperty("description")) + object.description = message.description; + if (message.serverTlsPolicy != null && message.hasOwnProperty("serverTlsPolicy")) + object.serverTlsPolicy = message.serverTlsPolicy; + if (message.clientTlsPolicy != null && message.hasOwnProperty("clientTlsPolicy")) + object.clientTlsPolicy = message.clientTlsPolicy; + return object; + }; + + /** + * Converts this EndpointPolicy to JSON. + * @function toJSON + * @memberof google.cloud.networkservices.v1.EndpointPolicy + * @instance + * @returns {Object.} JSON object + */ + EndpointPolicy.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for EndpointPolicy + * @function getTypeUrl + * @memberof google.cloud.networkservices.v1.EndpointPolicy + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + EndpointPolicy.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.networkservices.v1.EndpointPolicy"; + }; + + /** + * EndpointPolicyType enum. + * @name google.cloud.networkservices.v1.EndpointPolicy.EndpointPolicyType + * @enum {number} + * @property {number} ENDPOINT_POLICY_TYPE_UNSPECIFIED=0 ENDPOINT_POLICY_TYPE_UNSPECIFIED value + * @property {number} SIDECAR_PROXY=1 SIDECAR_PROXY value + * @property {number} GRPC_SERVER=2 GRPC_SERVER value + */ + EndpointPolicy.EndpointPolicyType = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "ENDPOINT_POLICY_TYPE_UNSPECIFIED"] = 0; + values[valuesById[1] = "SIDECAR_PROXY"] = 1; + values[valuesById[2] = "GRPC_SERVER"] = 2; + return values; + })(); + + return EndpointPolicy; + })(); + + v1.ListEndpointPoliciesRequest = (function() { + + /** + * Properties of a ListEndpointPoliciesRequest. + * @memberof google.cloud.networkservices.v1 + * @interface IListEndpointPoliciesRequest + * @property {string|null} [parent] ListEndpointPoliciesRequest parent + * @property {number|null} [pageSize] ListEndpointPoliciesRequest pageSize + * @property {string|null} [pageToken] ListEndpointPoliciesRequest pageToken + */ + + /** + * Constructs a new ListEndpointPoliciesRequest. + * @memberof google.cloud.networkservices.v1 + * @classdesc Represents a ListEndpointPoliciesRequest. + * @implements IListEndpointPoliciesRequest + * @constructor + * @param {google.cloud.networkservices.v1.IListEndpointPoliciesRequest=} [properties] Properties to set + */ + function ListEndpointPoliciesRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListEndpointPoliciesRequest parent. + * @member {string} parent + * @memberof google.cloud.networkservices.v1.ListEndpointPoliciesRequest + * @instance + */ + ListEndpointPoliciesRequest.prototype.parent = ""; + + /** + * ListEndpointPoliciesRequest pageSize. + * @member {number} pageSize + * @memberof google.cloud.networkservices.v1.ListEndpointPoliciesRequest + * @instance + */ + ListEndpointPoliciesRequest.prototype.pageSize = 0; + + /** + * ListEndpointPoliciesRequest pageToken. + * @member {string} pageToken + * @memberof google.cloud.networkservices.v1.ListEndpointPoliciesRequest + * @instance + */ + ListEndpointPoliciesRequest.prototype.pageToken = ""; + + /** + * Creates a new ListEndpointPoliciesRequest instance using the specified properties. + * @function create + * @memberof google.cloud.networkservices.v1.ListEndpointPoliciesRequest + * @static + * @param {google.cloud.networkservices.v1.IListEndpointPoliciesRequest=} [properties] Properties to set + * @returns {google.cloud.networkservices.v1.ListEndpointPoliciesRequest} ListEndpointPoliciesRequest instance + */ + ListEndpointPoliciesRequest.create = function create(properties) { + return new ListEndpointPoliciesRequest(properties); + }; + + /** + * Encodes the specified ListEndpointPoliciesRequest message. Does not implicitly {@link google.cloud.networkservices.v1.ListEndpointPoliciesRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.networkservices.v1.ListEndpointPoliciesRequest + * @static + * @param {google.cloud.networkservices.v1.IListEndpointPoliciesRequest} message ListEndpointPoliciesRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListEndpointPoliciesRequest.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 ListEndpointPoliciesRequest message, length delimited. Does not implicitly {@link google.cloud.networkservices.v1.ListEndpointPoliciesRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.networkservices.v1.ListEndpointPoliciesRequest + * @static + * @param {google.cloud.networkservices.v1.IListEndpointPoliciesRequest} message ListEndpointPoliciesRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListEndpointPoliciesRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListEndpointPoliciesRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.networkservices.v1.ListEndpointPoliciesRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.networkservices.v1.ListEndpointPoliciesRequest} ListEndpointPoliciesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListEndpointPoliciesRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.networkservices.v1.ListEndpointPoliciesRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + 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 ListEndpointPoliciesRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.networkservices.v1.ListEndpointPoliciesRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.networkservices.v1.ListEndpointPoliciesRequest} ListEndpointPoliciesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListEndpointPoliciesRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListEndpointPoliciesRequest message. + * @function verify + * @memberof google.cloud.networkservices.v1.ListEndpointPoliciesRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListEndpointPoliciesRequest.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 ListEndpointPoliciesRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.networkservices.v1.ListEndpointPoliciesRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.networkservices.v1.ListEndpointPoliciesRequest} ListEndpointPoliciesRequest + */ + ListEndpointPoliciesRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.networkservices.v1.ListEndpointPoliciesRequest) + return object; + var message = new $root.google.cloud.networkservices.v1.ListEndpointPoliciesRequest(); + 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 ListEndpointPoliciesRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.networkservices.v1.ListEndpointPoliciesRequest + * @static + * @param {google.cloud.networkservices.v1.ListEndpointPoliciesRequest} message ListEndpointPoliciesRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListEndpointPoliciesRequest.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 ListEndpointPoliciesRequest to JSON. + * @function toJSON + * @memberof google.cloud.networkservices.v1.ListEndpointPoliciesRequest + * @instance + * @returns {Object.} JSON object + */ + ListEndpointPoliciesRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListEndpointPoliciesRequest + * @function getTypeUrl + * @memberof google.cloud.networkservices.v1.ListEndpointPoliciesRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListEndpointPoliciesRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.networkservices.v1.ListEndpointPoliciesRequest"; + }; + + return ListEndpointPoliciesRequest; + })(); + + v1.ListEndpointPoliciesResponse = (function() { + + /** + * Properties of a ListEndpointPoliciesResponse. + * @memberof google.cloud.networkservices.v1 + * @interface IListEndpointPoliciesResponse + * @property {Array.|null} [endpointPolicies] ListEndpointPoliciesResponse endpointPolicies + * @property {string|null} [nextPageToken] ListEndpointPoliciesResponse nextPageToken + */ + + /** + * Constructs a new ListEndpointPoliciesResponse. + * @memberof google.cloud.networkservices.v1 + * @classdesc Represents a ListEndpointPoliciesResponse. + * @implements IListEndpointPoliciesResponse + * @constructor + * @param {google.cloud.networkservices.v1.IListEndpointPoliciesResponse=} [properties] Properties to set + */ + function ListEndpointPoliciesResponse(properties) { + this.endpointPolicies = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListEndpointPoliciesResponse endpointPolicies. + * @member {Array.} endpointPolicies + * @memberof google.cloud.networkservices.v1.ListEndpointPoliciesResponse + * @instance + */ + ListEndpointPoliciesResponse.prototype.endpointPolicies = $util.emptyArray; + + /** + * ListEndpointPoliciesResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.cloud.networkservices.v1.ListEndpointPoliciesResponse + * @instance + */ + ListEndpointPoliciesResponse.prototype.nextPageToken = ""; + + /** + * Creates a new ListEndpointPoliciesResponse instance using the specified properties. + * @function create + * @memberof google.cloud.networkservices.v1.ListEndpointPoliciesResponse + * @static + * @param {google.cloud.networkservices.v1.IListEndpointPoliciesResponse=} [properties] Properties to set + * @returns {google.cloud.networkservices.v1.ListEndpointPoliciesResponse} ListEndpointPoliciesResponse instance + */ + ListEndpointPoliciesResponse.create = function create(properties) { + return new ListEndpointPoliciesResponse(properties); + }; + + /** + * Encodes the specified ListEndpointPoliciesResponse message. Does not implicitly {@link google.cloud.networkservices.v1.ListEndpointPoliciesResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.networkservices.v1.ListEndpointPoliciesResponse + * @static + * @param {google.cloud.networkservices.v1.IListEndpointPoliciesResponse} message ListEndpointPoliciesResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListEndpointPoliciesResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.endpointPolicies != null && message.endpointPolicies.length) + for (var i = 0; i < message.endpointPolicies.length; ++i) + $root.google.cloud.networkservices.v1.EndpointPolicy.encode(message.endpointPolicies[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 ListEndpointPoliciesResponse message, length delimited. Does not implicitly {@link google.cloud.networkservices.v1.ListEndpointPoliciesResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.networkservices.v1.ListEndpointPoliciesResponse + * @static + * @param {google.cloud.networkservices.v1.IListEndpointPoliciesResponse} message ListEndpointPoliciesResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListEndpointPoliciesResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListEndpointPoliciesResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.networkservices.v1.ListEndpointPoliciesResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.networkservices.v1.ListEndpointPoliciesResponse} ListEndpointPoliciesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListEndpointPoliciesResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.networkservices.v1.ListEndpointPoliciesResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.endpointPolicies && message.endpointPolicies.length)) + message.endpointPolicies = []; + message.endpointPolicies.push($root.google.cloud.networkservices.v1.EndpointPolicy.decode(reader, reader.uint32())); + break; + } + case 2: { + message.nextPageToken = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListEndpointPoliciesResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.networkservices.v1.ListEndpointPoliciesResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.networkservices.v1.ListEndpointPoliciesResponse} ListEndpointPoliciesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListEndpointPoliciesResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListEndpointPoliciesResponse message. + * @function verify + * @memberof google.cloud.networkservices.v1.ListEndpointPoliciesResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListEndpointPoliciesResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.endpointPolicies != null && message.hasOwnProperty("endpointPolicies")) { + if (!Array.isArray(message.endpointPolicies)) + return "endpointPolicies: array expected"; + for (var i = 0; i < message.endpointPolicies.length; ++i) { + var error = $root.google.cloud.networkservices.v1.EndpointPolicy.verify(message.endpointPolicies[i]); + if (error) + return "endpointPolicies." + error; + } + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + return null; + }; + + /** + * Creates a ListEndpointPoliciesResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.networkservices.v1.ListEndpointPoliciesResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.networkservices.v1.ListEndpointPoliciesResponse} ListEndpointPoliciesResponse + */ + ListEndpointPoliciesResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.networkservices.v1.ListEndpointPoliciesResponse) + return object; + var message = new $root.google.cloud.networkservices.v1.ListEndpointPoliciesResponse(); + if (object.endpointPolicies) { + if (!Array.isArray(object.endpointPolicies)) + throw TypeError(".google.cloud.networkservices.v1.ListEndpointPoliciesResponse.endpointPolicies: array expected"); + message.endpointPolicies = []; + for (var i = 0; i < object.endpointPolicies.length; ++i) { + if (typeof object.endpointPolicies[i] !== "object") + throw TypeError(".google.cloud.networkservices.v1.ListEndpointPoliciesResponse.endpointPolicies: object expected"); + message.endpointPolicies[i] = $root.google.cloud.networkservices.v1.EndpointPolicy.fromObject(object.endpointPolicies[i]); + } + } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + return message; + }; + + /** + * Creates a plain object from a ListEndpointPoliciesResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.networkservices.v1.ListEndpointPoliciesResponse + * @static + * @param {google.cloud.networkservices.v1.ListEndpointPoliciesResponse} message ListEndpointPoliciesResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListEndpointPoliciesResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.endpointPolicies = []; + if (options.defaults) + object.nextPageToken = ""; + if (message.endpointPolicies && message.endpointPolicies.length) { + object.endpointPolicies = []; + for (var j = 0; j < message.endpointPolicies.length; ++j) + object.endpointPolicies[j] = $root.google.cloud.networkservices.v1.EndpointPolicy.toObject(message.endpointPolicies[j], options); + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + object.nextPageToken = message.nextPageToken; + return object; + }; + + /** + * Converts this ListEndpointPoliciesResponse to JSON. + * @function toJSON + * @memberof google.cloud.networkservices.v1.ListEndpointPoliciesResponse + * @instance + * @returns {Object.} JSON object + */ + ListEndpointPoliciesResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListEndpointPoliciesResponse + * @function getTypeUrl + * @memberof google.cloud.networkservices.v1.ListEndpointPoliciesResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListEndpointPoliciesResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.networkservices.v1.ListEndpointPoliciesResponse"; + }; + + return ListEndpointPoliciesResponse; + })(); + + v1.GetEndpointPolicyRequest = (function() { + + /** + * Properties of a GetEndpointPolicyRequest. + * @memberof google.cloud.networkservices.v1 + * @interface IGetEndpointPolicyRequest + * @property {string|null} [name] GetEndpointPolicyRequest name + */ + + /** + * Constructs a new GetEndpointPolicyRequest. + * @memberof google.cloud.networkservices.v1 + * @classdesc Represents a GetEndpointPolicyRequest. + * @implements IGetEndpointPolicyRequest + * @constructor + * @param {google.cloud.networkservices.v1.IGetEndpointPolicyRequest=} [properties] Properties to set + */ + function GetEndpointPolicyRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetEndpointPolicyRequest name. + * @member {string} name + * @memberof google.cloud.networkservices.v1.GetEndpointPolicyRequest + * @instance + */ + GetEndpointPolicyRequest.prototype.name = ""; + + /** + * Creates a new GetEndpointPolicyRequest instance using the specified properties. + * @function create + * @memberof google.cloud.networkservices.v1.GetEndpointPolicyRequest + * @static + * @param {google.cloud.networkservices.v1.IGetEndpointPolicyRequest=} [properties] Properties to set + * @returns {google.cloud.networkservices.v1.GetEndpointPolicyRequest} GetEndpointPolicyRequest instance + */ + GetEndpointPolicyRequest.create = function create(properties) { + return new GetEndpointPolicyRequest(properties); + }; + + /** + * Encodes the specified GetEndpointPolicyRequest message. Does not implicitly {@link google.cloud.networkservices.v1.GetEndpointPolicyRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.networkservices.v1.GetEndpointPolicyRequest + * @static + * @param {google.cloud.networkservices.v1.IGetEndpointPolicyRequest} message GetEndpointPolicyRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetEndpointPolicyRequest.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 GetEndpointPolicyRequest message, length delimited. Does not implicitly {@link google.cloud.networkservices.v1.GetEndpointPolicyRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.networkservices.v1.GetEndpointPolicyRequest + * @static + * @param {google.cloud.networkservices.v1.IGetEndpointPolicyRequest} message GetEndpointPolicyRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetEndpointPolicyRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetEndpointPolicyRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.networkservices.v1.GetEndpointPolicyRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.networkservices.v1.GetEndpointPolicyRequest} GetEndpointPolicyRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetEndpointPolicyRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.networkservices.v1.GetEndpointPolicyRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetEndpointPolicyRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.networkservices.v1.GetEndpointPolicyRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.networkservices.v1.GetEndpointPolicyRequest} GetEndpointPolicyRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetEndpointPolicyRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetEndpointPolicyRequest message. + * @function verify + * @memberof google.cloud.networkservices.v1.GetEndpointPolicyRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetEndpointPolicyRequest.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 GetEndpointPolicyRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.networkservices.v1.GetEndpointPolicyRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.networkservices.v1.GetEndpointPolicyRequest} GetEndpointPolicyRequest + */ + GetEndpointPolicyRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.networkservices.v1.GetEndpointPolicyRequest) + return object; + var message = new $root.google.cloud.networkservices.v1.GetEndpointPolicyRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a GetEndpointPolicyRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.networkservices.v1.GetEndpointPolicyRequest + * @static + * @param {google.cloud.networkservices.v1.GetEndpointPolicyRequest} message GetEndpointPolicyRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetEndpointPolicyRequest.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 GetEndpointPolicyRequest to JSON. + * @function toJSON + * @memberof google.cloud.networkservices.v1.GetEndpointPolicyRequest + * @instance + * @returns {Object.} JSON object + */ + GetEndpointPolicyRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GetEndpointPolicyRequest + * @function getTypeUrl + * @memberof google.cloud.networkservices.v1.GetEndpointPolicyRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GetEndpointPolicyRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.networkservices.v1.GetEndpointPolicyRequest"; + }; + + return GetEndpointPolicyRequest; + })(); + + v1.CreateEndpointPolicyRequest = (function() { + + /** + * Properties of a CreateEndpointPolicyRequest. + * @memberof google.cloud.networkservices.v1 + * @interface ICreateEndpointPolicyRequest + * @property {string|null} [parent] CreateEndpointPolicyRequest parent + * @property {string|null} [endpointPolicyId] CreateEndpointPolicyRequest endpointPolicyId + * @property {google.cloud.networkservices.v1.IEndpointPolicy|null} [endpointPolicy] CreateEndpointPolicyRequest endpointPolicy + */ + + /** + * Constructs a new CreateEndpointPolicyRequest. + * @memberof google.cloud.networkservices.v1 + * @classdesc Represents a CreateEndpointPolicyRequest. + * @implements ICreateEndpointPolicyRequest + * @constructor + * @param {google.cloud.networkservices.v1.ICreateEndpointPolicyRequest=} [properties] Properties to set + */ + function CreateEndpointPolicyRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * CreateEndpointPolicyRequest parent. + * @member {string} parent + * @memberof google.cloud.networkservices.v1.CreateEndpointPolicyRequest + * @instance + */ + CreateEndpointPolicyRequest.prototype.parent = ""; + + /** + * CreateEndpointPolicyRequest endpointPolicyId. + * @member {string} endpointPolicyId + * @memberof google.cloud.networkservices.v1.CreateEndpointPolicyRequest + * @instance + */ + CreateEndpointPolicyRequest.prototype.endpointPolicyId = ""; + + /** + * CreateEndpointPolicyRequest endpointPolicy. + * @member {google.cloud.networkservices.v1.IEndpointPolicy|null|undefined} endpointPolicy + * @memberof google.cloud.networkservices.v1.CreateEndpointPolicyRequest + * @instance + */ + CreateEndpointPolicyRequest.prototype.endpointPolicy = null; + + /** + * Creates a new CreateEndpointPolicyRequest instance using the specified properties. + * @function create + * @memberof google.cloud.networkservices.v1.CreateEndpointPolicyRequest + * @static + * @param {google.cloud.networkservices.v1.ICreateEndpointPolicyRequest=} [properties] Properties to set + * @returns {google.cloud.networkservices.v1.CreateEndpointPolicyRequest} CreateEndpointPolicyRequest instance + */ + CreateEndpointPolicyRequest.create = function create(properties) { + return new CreateEndpointPolicyRequest(properties); + }; + + /** + * Encodes the specified CreateEndpointPolicyRequest message. Does not implicitly {@link google.cloud.networkservices.v1.CreateEndpointPolicyRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.networkservices.v1.CreateEndpointPolicyRequest + * @static + * @param {google.cloud.networkservices.v1.ICreateEndpointPolicyRequest} message CreateEndpointPolicyRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateEndpointPolicyRequest.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.endpointPolicyId != null && Object.hasOwnProperty.call(message, "endpointPolicyId")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.endpointPolicyId); + if (message.endpointPolicy != null && Object.hasOwnProperty.call(message, "endpointPolicy")) + $root.google.cloud.networkservices.v1.EndpointPolicy.encode(message.endpointPolicy, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified CreateEndpointPolicyRequest message, length delimited. Does not implicitly {@link google.cloud.networkservices.v1.CreateEndpointPolicyRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.networkservices.v1.CreateEndpointPolicyRequest + * @static + * @param {google.cloud.networkservices.v1.ICreateEndpointPolicyRequest} message CreateEndpointPolicyRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateEndpointPolicyRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CreateEndpointPolicyRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.networkservices.v1.CreateEndpointPolicyRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.networkservices.v1.CreateEndpointPolicyRequest} CreateEndpointPolicyRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateEndpointPolicyRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.networkservices.v1.CreateEndpointPolicyRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.endpointPolicyId = reader.string(); + break; + } + case 3: { + message.endpointPolicy = $root.google.cloud.networkservices.v1.EndpointPolicy.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CreateEndpointPolicyRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.networkservices.v1.CreateEndpointPolicyRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.networkservices.v1.CreateEndpointPolicyRequest} CreateEndpointPolicyRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateEndpointPolicyRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CreateEndpointPolicyRequest message. + * @function verify + * @memberof google.cloud.networkservices.v1.CreateEndpointPolicyRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CreateEndpointPolicyRequest.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.endpointPolicyId != null && message.hasOwnProperty("endpointPolicyId")) + if (!$util.isString(message.endpointPolicyId)) + return "endpointPolicyId: string expected"; + if (message.endpointPolicy != null && message.hasOwnProperty("endpointPolicy")) { + var error = $root.google.cloud.networkservices.v1.EndpointPolicy.verify(message.endpointPolicy); + if (error) + return "endpointPolicy." + error; + } + return null; + }; + + /** + * Creates a CreateEndpointPolicyRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.networkservices.v1.CreateEndpointPolicyRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.networkservices.v1.CreateEndpointPolicyRequest} CreateEndpointPolicyRequest + */ + CreateEndpointPolicyRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.networkservices.v1.CreateEndpointPolicyRequest) + return object; + var message = new $root.google.cloud.networkservices.v1.CreateEndpointPolicyRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.endpointPolicyId != null) + message.endpointPolicyId = String(object.endpointPolicyId); + if (object.endpointPolicy != null) { + if (typeof object.endpointPolicy !== "object") + throw TypeError(".google.cloud.networkservices.v1.CreateEndpointPolicyRequest.endpointPolicy: object expected"); + message.endpointPolicy = $root.google.cloud.networkservices.v1.EndpointPolicy.fromObject(object.endpointPolicy); + } + return message; + }; + + /** + * Creates a plain object from a CreateEndpointPolicyRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.networkservices.v1.CreateEndpointPolicyRequest + * @static + * @param {google.cloud.networkservices.v1.CreateEndpointPolicyRequest} message CreateEndpointPolicyRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CreateEndpointPolicyRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.endpointPolicyId = ""; + object.endpointPolicy = null; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.endpointPolicyId != null && message.hasOwnProperty("endpointPolicyId")) + object.endpointPolicyId = message.endpointPolicyId; + if (message.endpointPolicy != null && message.hasOwnProperty("endpointPolicy")) + object.endpointPolicy = $root.google.cloud.networkservices.v1.EndpointPolicy.toObject(message.endpointPolicy, options); + return object; + }; + + /** + * Converts this CreateEndpointPolicyRequest to JSON. + * @function toJSON + * @memberof google.cloud.networkservices.v1.CreateEndpointPolicyRequest + * @instance + * @returns {Object.} JSON object + */ + CreateEndpointPolicyRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CreateEndpointPolicyRequest + * @function getTypeUrl + * @memberof google.cloud.networkservices.v1.CreateEndpointPolicyRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CreateEndpointPolicyRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.networkservices.v1.CreateEndpointPolicyRequest"; + }; + + return CreateEndpointPolicyRequest; + })(); + + v1.UpdateEndpointPolicyRequest = (function() { + + /** + * Properties of an UpdateEndpointPolicyRequest. + * @memberof google.cloud.networkservices.v1 + * @interface IUpdateEndpointPolicyRequest + * @property {google.protobuf.IFieldMask|null} [updateMask] UpdateEndpointPolicyRequest updateMask + * @property {google.cloud.networkservices.v1.IEndpointPolicy|null} [endpointPolicy] UpdateEndpointPolicyRequest endpointPolicy + */ + + /** + * Constructs a new UpdateEndpointPolicyRequest. + * @memberof google.cloud.networkservices.v1 + * @classdesc Represents an UpdateEndpointPolicyRequest. + * @implements IUpdateEndpointPolicyRequest + * @constructor + * @param {google.cloud.networkservices.v1.IUpdateEndpointPolicyRequest=} [properties] Properties to set + */ + function UpdateEndpointPolicyRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * UpdateEndpointPolicyRequest updateMask. + * @member {google.protobuf.IFieldMask|null|undefined} updateMask + * @memberof google.cloud.networkservices.v1.UpdateEndpointPolicyRequest + * @instance + */ + UpdateEndpointPolicyRequest.prototype.updateMask = null; + + /** + * UpdateEndpointPolicyRequest endpointPolicy. + * @member {google.cloud.networkservices.v1.IEndpointPolicy|null|undefined} endpointPolicy + * @memberof google.cloud.networkservices.v1.UpdateEndpointPolicyRequest + * @instance + */ + UpdateEndpointPolicyRequest.prototype.endpointPolicy = null; + + /** + * Creates a new UpdateEndpointPolicyRequest instance using the specified properties. + * @function create + * @memberof google.cloud.networkservices.v1.UpdateEndpointPolicyRequest + * @static + * @param {google.cloud.networkservices.v1.IUpdateEndpointPolicyRequest=} [properties] Properties to set + * @returns {google.cloud.networkservices.v1.UpdateEndpointPolicyRequest} UpdateEndpointPolicyRequest instance + */ + UpdateEndpointPolicyRequest.create = function create(properties) { + return new UpdateEndpointPolicyRequest(properties); + }; + + /** + * Encodes the specified UpdateEndpointPolicyRequest message. Does not implicitly {@link google.cloud.networkservices.v1.UpdateEndpointPolicyRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.networkservices.v1.UpdateEndpointPolicyRequest + * @static + * @param {google.cloud.networkservices.v1.IUpdateEndpointPolicyRequest} message UpdateEndpointPolicyRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateEndpointPolicyRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.updateMask != null && Object.hasOwnProperty.call(message, "updateMask")) + $root.google.protobuf.FieldMask.encode(message.updateMask, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.endpointPolicy != null && Object.hasOwnProperty.call(message, "endpointPolicy")) + $root.google.cloud.networkservices.v1.EndpointPolicy.encode(message.endpointPolicy, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified UpdateEndpointPolicyRequest message, length delimited. Does not implicitly {@link google.cloud.networkservices.v1.UpdateEndpointPolicyRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.networkservices.v1.UpdateEndpointPolicyRequest + * @static + * @param {google.cloud.networkservices.v1.IUpdateEndpointPolicyRequest} message UpdateEndpointPolicyRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateEndpointPolicyRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an UpdateEndpointPolicyRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.networkservices.v1.UpdateEndpointPolicyRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.networkservices.v1.UpdateEndpointPolicyRequest} UpdateEndpointPolicyRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateEndpointPolicyRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.networkservices.v1.UpdateEndpointPolicyRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.updateMask = $root.google.protobuf.FieldMask.decode(reader, reader.uint32()); + break; + } + case 2: { + message.endpointPolicy = $root.google.cloud.networkservices.v1.EndpointPolicy.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an UpdateEndpointPolicyRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.networkservices.v1.UpdateEndpointPolicyRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.networkservices.v1.UpdateEndpointPolicyRequest} UpdateEndpointPolicyRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateEndpointPolicyRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an UpdateEndpointPolicyRequest message. + * @function verify + * @memberof google.cloud.networkservices.v1.UpdateEndpointPolicyRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + UpdateEndpointPolicyRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.updateMask != null && message.hasOwnProperty("updateMask")) { + var error = $root.google.protobuf.FieldMask.verify(message.updateMask); + if (error) + return "updateMask." + error; + } + if (message.endpointPolicy != null && message.hasOwnProperty("endpointPolicy")) { + var error = $root.google.cloud.networkservices.v1.EndpointPolicy.verify(message.endpointPolicy); + if (error) + return "endpointPolicy." + error; + } + return null; + }; + + /** + * Creates an UpdateEndpointPolicyRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.networkservices.v1.UpdateEndpointPolicyRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.networkservices.v1.UpdateEndpointPolicyRequest} UpdateEndpointPolicyRequest + */ + UpdateEndpointPolicyRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.networkservices.v1.UpdateEndpointPolicyRequest) + return object; + var message = new $root.google.cloud.networkservices.v1.UpdateEndpointPolicyRequest(); + if (object.updateMask != null) { + if (typeof object.updateMask !== "object") + throw TypeError(".google.cloud.networkservices.v1.UpdateEndpointPolicyRequest.updateMask: object expected"); + message.updateMask = $root.google.protobuf.FieldMask.fromObject(object.updateMask); + } + if (object.endpointPolicy != null) { + if (typeof object.endpointPolicy !== "object") + throw TypeError(".google.cloud.networkservices.v1.UpdateEndpointPolicyRequest.endpointPolicy: object expected"); + message.endpointPolicy = $root.google.cloud.networkservices.v1.EndpointPolicy.fromObject(object.endpointPolicy); + } + return message; + }; + + /** + * Creates a plain object from an UpdateEndpointPolicyRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.networkservices.v1.UpdateEndpointPolicyRequest + * @static + * @param {google.cloud.networkservices.v1.UpdateEndpointPolicyRequest} message UpdateEndpointPolicyRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + UpdateEndpointPolicyRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.updateMask = null; + object.endpointPolicy = null; + } + if (message.updateMask != null && message.hasOwnProperty("updateMask")) + object.updateMask = $root.google.protobuf.FieldMask.toObject(message.updateMask, options); + if (message.endpointPolicy != null && message.hasOwnProperty("endpointPolicy")) + object.endpointPolicy = $root.google.cloud.networkservices.v1.EndpointPolicy.toObject(message.endpointPolicy, options); + return object; + }; + + /** + * Converts this UpdateEndpointPolicyRequest to JSON. + * @function toJSON + * @memberof google.cloud.networkservices.v1.UpdateEndpointPolicyRequest + * @instance + * @returns {Object.} JSON object + */ + UpdateEndpointPolicyRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for UpdateEndpointPolicyRequest + * @function getTypeUrl + * @memberof google.cloud.networkservices.v1.UpdateEndpointPolicyRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + UpdateEndpointPolicyRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.networkservices.v1.UpdateEndpointPolicyRequest"; + }; + + return UpdateEndpointPolicyRequest; + })(); + + v1.DeleteEndpointPolicyRequest = (function() { + + /** + * Properties of a DeleteEndpointPolicyRequest. + * @memberof google.cloud.networkservices.v1 + * @interface IDeleteEndpointPolicyRequest + * @property {string|null} [name] DeleteEndpointPolicyRequest name + */ + + /** + * Constructs a new DeleteEndpointPolicyRequest. + * @memberof google.cloud.networkservices.v1 + * @classdesc Represents a DeleteEndpointPolicyRequest. + * @implements IDeleteEndpointPolicyRequest + * @constructor + * @param {google.cloud.networkservices.v1.IDeleteEndpointPolicyRequest=} [properties] Properties to set + */ + function DeleteEndpointPolicyRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * DeleteEndpointPolicyRequest name. + * @member {string} name + * @memberof google.cloud.networkservices.v1.DeleteEndpointPolicyRequest + * @instance + */ + DeleteEndpointPolicyRequest.prototype.name = ""; + + /** + * Creates a new DeleteEndpointPolicyRequest instance using the specified properties. + * @function create + * @memberof google.cloud.networkservices.v1.DeleteEndpointPolicyRequest + * @static + * @param {google.cloud.networkservices.v1.IDeleteEndpointPolicyRequest=} [properties] Properties to set + * @returns {google.cloud.networkservices.v1.DeleteEndpointPolicyRequest} DeleteEndpointPolicyRequest instance + */ + DeleteEndpointPolicyRequest.create = function create(properties) { + return new DeleteEndpointPolicyRequest(properties); + }; + + /** + * Encodes the specified DeleteEndpointPolicyRequest message. Does not implicitly {@link google.cloud.networkservices.v1.DeleteEndpointPolicyRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.networkservices.v1.DeleteEndpointPolicyRequest + * @static + * @param {google.cloud.networkservices.v1.IDeleteEndpointPolicyRequest} message DeleteEndpointPolicyRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteEndpointPolicyRequest.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 DeleteEndpointPolicyRequest message, length delimited. Does not implicitly {@link google.cloud.networkservices.v1.DeleteEndpointPolicyRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.networkservices.v1.DeleteEndpointPolicyRequest + * @static + * @param {google.cloud.networkservices.v1.IDeleteEndpointPolicyRequest} message DeleteEndpointPolicyRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteEndpointPolicyRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DeleteEndpointPolicyRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.networkservices.v1.DeleteEndpointPolicyRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.networkservices.v1.DeleteEndpointPolicyRequest} DeleteEndpointPolicyRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteEndpointPolicyRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.networkservices.v1.DeleteEndpointPolicyRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DeleteEndpointPolicyRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.networkservices.v1.DeleteEndpointPolicyRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.networkservices.v1.DeleteEndpointPolicyRequest} DeleteEndpointPolicyRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteEndpointPolicyRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DeleteEndpointPolicyRequest message. + * @function verify + * @memberof google.cloud.networkservices.v1.DeleteEndpointPolicyRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DeleteEndpointPolicyRequest.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 DeleteEndpointPolicyRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.networkservices.v1.DeleteEndpointPolicyRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.networkservices.v1.DeleteEndpointPolicyRequest} DeleteEndpointPolicyRequest + */ + DeleteEndpointPolicyRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.networkservices.v1.DeleteEndpointPolicyRequest) + return object; + var message = new $root.google.cloud.networkservices.v1.DeleteEndpointPolicyRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a DeleteEndpointPolicyRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.networkservices.v1.DeleteEndpointPolicyRequest + * @static + * @param {google.cloud.networkservices.v1.DeleteEndpointPolicyRequest} message DeleteEndpointPolicyRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DeleteEndpointPolicyRequest.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 DeleteEndpointPolicyRequest to JSON. + * @function toJSON + * @memberof google.cloud.networkservices.v1.DeleteEndpointPolicyRequest + * @instance + * @returns {Object.} JSON object + */ + DeleteEndpointPolicyRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DeleteEndpointPolicyRequest + * @function getTypeUrl + * @memberof google.cloud.networkservices.v1.DeleteEndpointPolicyRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DeleteEndpointPolicyRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.networkservices.v1.DeleteEndpointPolicyRequest"; + }; + + return DeleteEndpointPolicyRequest; + })(); + + v1.Gateway = (function() { + + /** + * Properties of a Gateway. + * @memberof google.cloud.networkservices.v1 + * @interface IGateway + * @property {string|null} [name] Gateway name + * @property {string|null} [selfLink] Gateway selfLink + * @property {google.protobuf.ITimestamp|null} [createTime] Gateway createTime + * @property {google.protobuf.ITimestamp|null} [updateTime] Gateway updateTime + * @property {Object.|null} [labels] Gateway labels + * @property {string|null} [description] Gateway description + * @property {google.cloud.networkservices.v1.Gateway.Type|null} [type] Gateway type + * @property {Array.|null} [ports] Gateway ports + * @property {string|null} [scope] Gateway scope + * @property {string|null} [serverTlsPolicy] Gateway serverTlsPolicy + */ + + /** + * Constructs a new Gateway. + * @memberof google.cloud.networkservices.v1 + * @classdesc Represents a Gateway. + * @implements IGateway + * @constructor + * @param {google.cloud.networkservices.v1.IGateway=} [properties] Properties to set + */ + function Gateway(properties) { + this.labels = {}; + this.ports = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Gateway name. + * @member {string} name + * @memberof google.cloud.networkservices.v1.Gateway + * @instance + */ + Gateway.prototype.name = ""; + + /** + * Gateway selfLink. + * @member {string} selfLink + * @memberof google.cloud.networkservices.v1.Gateway + * @instance + */ + Gateway.prototype.selfLink = ""; + + /** + * Gateway createTime. + * @member {google.protobuf.ITimestamp|null|undefined} createTime + * @memberof google.cloud.networkservices.v1.Gateway + * @instance + */ + Gateway.prototype.createTime = null; + + /** + * Gateway updateTime. + * @member {google.protobuf.ITimestamp|null|undefined} updateTime + * @memberof google.cloud.networkservices.v1.Gateway + * @instance + */ + Gateway.prototype.updateTime = null; + + /** + * Gateway labels. + * @member {Object.} labels + * @memberof google.cloud.networkservices.v1.Gateway + * @instance + */ + Gateway.prototype.labels = $util.emptyObject; + + /** + * Gateway description. + * @member {string} description + * @memberof google.cloud.networkservices.v1.Gateway + * @instance + */ + Gateway.prototype.description = ""; + + /** + * Gateway type. + * @member {google.cloud.networkservices.v1.Gateway.Type} type + * @memberof google.cloud.networkservices.v1.Gateway + * @instance + */ + Gateway.prototype.type = 0; + + /** + * Gateway ports. + * @member {Array.} ports + * @memberof google.cloud.networkservices.v1.Gateway + * @instance + */ + Gateway.prototype.ports = $util.emptyArray; + + /** + * Gateway scope. + * @member {string} scope + * @memberof google.cloud.networkservices.v1.Gateway + * @instance + */ + Gateway.prototype.scope = ""; + + /** + * Gateway serverTlsPolicy. + * @member {string} serverTlsPolicy + * @memberof google.cloud.networkservices.v1.Gateway + * @instance + */ + Gateway.prototype.serverTlsPolicy = ""; + + /** + * Creates a new Gateway instance using the specified properties. + * @function create + * @memberof google.cloud.networkservices.v1.Gateway + * @static + * @param {google.cloud.networkservices.v1.IGateway=} [properties] Properties to set + * @returns {google.cloud.networkservices.v1.Gateway} Gateway instance + */ + Gateway.create = function create(properties) { + return new Gateway(properties); + }; + + /** + * Encodes the specified Gateway message. Does not implicitly {@link google.cloud.networkservices.v1.Gateway.verify|verify} messages. + * @function encode + * @memberof google.cloud.networkservices.v1.Gateway + * @static + * @param {google.cloud.networkservices.v1.IGateway} message Gateway message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Gateway.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.createTime != null && Object.hasOwnProperty.call(message, "createTime")) + $root.google.protobuf.Timestamp.encode(message.createTime, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + 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(); + if (message.labels != null && Object.hasOwnProperty.call(message, "labels")) + for (var keys = Object.keys(message.labels), i = 0; i < keys.length; ++i) + writer.uint32(/* id 4, wireType 2 =*/34).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.labels[keys[i]]).ldelim(); + if (message.description != null && Object.hasOwnProperty.call(message, "description")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.description); + if (message.type != null && Object.hasOwnProperty.call(message, "type")) + writer.uint32(/* id 6, wireType 0 =*/48).int32(message.type); + if (message.scope != null && Object.hasOwnProperty.call(message, "scope")) + writer.uint32(/* id 8, wireType 2 =*/66).string(message.scope); + if (message.serverTlsPolicy != null && Object.hasOwnProperty.call(message, "serverTlsPolicy")) + writer.uint32(/* id 9, wireType 2 =*/74).string(message.serverTlsPolicy); + if (message.ports != null && message.ports.length) { + writer.uint32(/* id 11, wireType 2 =*/90).fork(); + for (var i = 0; i < message.ports.length; ++i) + writer.int32(message.ports[i]); + writer.ldelim(); + } + if (message.selfLink != null && Object.hasOwnProperty.call(message, "selfLink")) + writer.uint32(/* id 13, wireType 2 =*/106).string(message.selfLink); + return writer; + }; + + /** + * Encodes the specified Gateway message, length delimited. Does not implicitly {@link google.cloud.networkservices.v1.Gateway.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.networkservices.v1.Gateway + * @static + * @param {google.cloud.networkservices.v1.IGateway} message Gateway message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Gateway.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Gateway message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.networkservices.v1.Gateway + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.networkservices.v1.Gateway} Gateway + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Gateway.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.networkservices.v1.Gateway(), key, value; + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 13: { + message.selfLink = reader.string(); + break; + } + case 2: { + message.createTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 3: { + message.updateTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 4: { + if (message.labels === $util.emptyObject) + message.labels = {}; + 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.labels[key] = value; + break; + } + case 5: { + message.description = reader.string(); + break; + } + case 6: { + message.type = reader.int32(); + break; + } + case 11: { + if (!(message.ports && message.ports.length)) + message.ports = []; + if ((tag & 7) === 2) { + var end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) + message.ports.push(reader.int32()); + } else + message.ports.push(reader.int32()); + break; + } + case 8: { + message.scope = reader.string(); + break; + } + case 9: { + message.serverTlsPolicy = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Gateway message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.networkservices.v1.Gateway + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.networkservices.v1.Gateway} Gateway + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Gateway.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Gateway message. + * @function verify + * @memberof google.cloud.networkservices.v1.Gateway + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Gateway.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.selfLink != null && message.hasOwnProperty("selfLink")) + if (!$util.isString(message.selfLink)) + return "selfLink: string expected"; + 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.labels != null && message.hasOwnProperty("labels")) { + if (!$util.isObject(message.labels)) + return "labels: object expected"; + var key = Object.keys(message.labels); + for (var i = 0; i < key.length; ++i) + if (!$util.isString(message.labels[key[i]])) + return "labels: string{k:string} expected"; + } + if (message.description != null && message.hasOwnProperty("description")) + if (!$util.isString(message.description)) + return "description: string expected"; + if (message.type != null && message.hasOwnProperty("type")) + switch (message.type) { + default: + return "type: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.ports != null && message.hasOwnProperty("ports")) { + if (!Array.isArray(message.ports)) + return "ports: array expected"; + for (var i = 0; i < message.ports.length; ++i) + if (!$util.isInteger(message.ports[i])) + return "ports: integer[] expected"; + } + if (message.scope != null && message.hasOwnProperty("scope")) + if (!$util.isString(message.scope)) + return "scope: string expected"; + if (message.serverTlsPolicy != null && message.hasOwnProperty("serverTlsPolicy")) + if (!$util.isString(message.serverTlsPolicy)) + return "serverTlsPolicy: string expected"; + return null; + }; + + /** + * Creates a Gateway message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.networkservices.v1.Gateway + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.networkservices.v1.Gateway} Gateway + */ + Gateway.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.networkservices.v1.Gateway) + return object; + var message = new $root.google.cloud.networkservices.v1.Gateway(); + if (object.name != null) + message.name = String(object.name); + if (object.selfLink != null) + message.selfLink = String(object.selfLink); + if (object.createTime != null) { + if (typeof object.createTime !== "object") + throw TypeError(".google.cloud.networkservices.v1.Gateway.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.networkservices.v1.Gateway.updateTime: object expected"); + message.updateTime = $root.google.protobuf.Timestamp.fromObject(object.updateTime); + } + if (object.labels) { + if (typeof object.labels !== "object") + throw TypeError(".google.cloud.networkservices.v1.Gateway.labels: object expected"); + message.labels = {}; + for (var keys = Object.keys(object.labels), i = 0; i < keys.length; ++i) + message.labels[keys[i]] = String(object.labels[keys[i]]); + } + if (object.description != null) + message.description = String(object.description); + switch (object.type) { + default: + if (typeof object.type === "number") { + message.type = object.type; + break; + } + break; + case "TYPE_UNSPECIFIED": + case 0: + message.type = 0; + break; + case "OPEN_MESH": + case 1: + message.type = 1; + break; + case "SECURE_WEB_GATEWAY": + case 2: + message.type = 2; + break; + } + if (object.ports) { + if (!Array.isArray(object.ports)) + throw TypeError(".google.cloud.networkservices.v1.Gateway.ports: array expected"); + message.ports = []; + for (var i = 0; i < object.ports.length; ++i) + message.ports[i] = object.ports[i] | 0; + } + if (object.scope != null) + message.scope = String(object.scope); + if (object.serverTlsPolicy != null) + message.serverTlsPolicy = String(object.serverTlsPolicy); + return message; + }; + + /** + * Creates a plain object from a Gateway message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.networkservices.v1.Gateway + * @static + * @param {google.cloud.networkservices.v1.Gateway} message Gateway + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Gateway.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.ports = []; + if (options.objects || options.defaults) + object.labels = {}; + if (options.defaults) { + object.name = ""; + object.createTime = null; + object.updateTime = null; + object.description = ""; + object.type = options.enums === String ? "TYPE_UNSPECIFIED" : 0; + object.scope = ""; + object.serverTlsPolicy = ""; + object.selfLink = ""; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + 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); + var keys2; + if (message.labels && (keys2 = Object.keys(message.labels)).length) { + object.labels = {}; + for (var j = 0; j < keys2.length; ++j) + object.labels[keys2[j]] = message.labels[keys2[j]]; + } + if (message.description != null && message.hasOwnProperty("description")) + object.description = message.description; + if (message.type != null && message.hasOwnProperty("type")) + object.type = options.enums === String ? $root.google.cloud.networkservices.v1.Gateway.Type[message.type] === undefined ? message.type : $root.google.cloud.networkservices.v1.Gateway.Type[message.type] : message.type; + if (message.scope != null && message.hasOwnProperty("scope")) + object.scope = message.scope; + if (message.serverTlsPolicy != null && message.hasOwnProperty("serverTlsPolicy")) + object.serverTlsPolicy = message.serverTlsPolicy; + if (message.ports && message.ports.length) { + object.ports = []; + for (var j = 0; j < message.ports.length; ++j) + object.ports[j] = message.ports[j]; + } + if (message.selfLink != null && message.hasOwnProperty("selfLink")) + object.selfLink = message.selfLink; + return object; + }; + + /** + * Converts this Gateway to JSON. + * @function toJSON + * @memberof google.cloud.networkservices.v1.Gateway + * @instance + * @returns {Object.} JSON object + */ + Gateway.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Gateway + * @function getTypeUrl + * @memberof google.cloud.networkservices.v1.Gateway + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Gateway.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.networkservices.v1.Gateway"; + }; + + /** + * Type enum. + * @name google.cloud.networkservices.v1.Gateway.Type + * @enum {number} + * @property {number} TYPE_UNSPECIFIED=0 TYPE_UNSPECIFIED value + * @property {number} OPEN_MESH=1 OPEN_MESH value + * @property {number} SECURE_WEB_GATEWAY=2 SECURE_WEB_GATEWAY value + */ + Gateway.Type = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "TYPE_UNSPECIFIED"] = 0; + values[valuesById[1] = "OPEN_MESH"] = 1; + values[valuesById[2] = "SECURE_WEB_GATEWAY"] = 2; + return values; + })(); + + return Gateway; + })(); + + v1.ListGatewaysRequest = (function() { + + /** + * Properties of a ListGatewaysRequest. + * @memberof google.cloud.networkservices.v1 + * @interface IListGatewaysRequest + * @property {string|null} [parent] ListGatewaysRequest parent + * @property {number|null} [pageSize] ListGatewaysRequest pageSize + * @property {string|null} [pageToken] ListGatewaysRequest pageToken + */ + + /** + * Constructs a new ListGatewaysRequest. + * @memberof google.cloud.networkservices.v1 + * @classdesc Represents a ListGatewaysRequest. + * @implements IListGatewaysRequest + * @constructor + * @param {google.cloud.networkservices.v1.IListGatewaysRequest=} [properties] Properties to set + */ + function ListGatewaysRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListGatewaysRequest parent. + * @member {string} parent + * @memberof google.cloud.networkservices.v1.ListGatewaysRequest + * @instance + */ + ListGatewaysRequest.prototype.parent = ""; + + /** + * ListGatewaysRequest pageSize. + * @member {number} pageSize + * @memberof google.cloud.networkservices.v1.ListGatewaysRequest + * @instance + */ + ListGatewaysRequest.prototype.pageSize = 0; + + /** + * ListGatewaysRequest pageToken. + * @member {string} pageToken + * @memberof google.cloud.networkservices.v1.ListGatewaysRequest + * @instance + */ + ListGatewaysRequest.prototype.pageToken = ""; + + /** + * Creates a new ListGatewaysRequest instance using the specified properties. + * @function create + * @memberof google.cloud.networkservices.v1.ListGatewaysRequest + * @static + * @param {google.cloud.networkservices.v1.IListGatewaysRequest=} [properties] Properties to set + * @returns {google.cloud.networkservices.v1.ListGatewaysRequest} ListGatewaysRequest instance + */ + ListGatewaysRequest.create = function create(properties) { + return new ListGatewaysRequest(properties); + }; + + /** + * Encodes the specified ListGatewaysRequest message. Does not implicitly {@link google.cloud.networkservices.v1.ListGatewaysRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.networkservices.v1.ListGatewaysRequest + * @static + * @param {google.cloud.networkservices.v1.IListGatewaysRequest} message ListGatewaysRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListGatewaysRequest.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 ListGatewaysRequest message, length delimited. Does not implicitly {@link google.cloud.networkservices.v1.ListGatewaysRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.networkservices.v1.ListGatewaysRequest + * @static + * @param {google.cloud.networkservices.v1.IListGatewaysRequest} message ListGatewaysRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListGatewaysRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListGatewaysRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.networkservices.v1.ListGatewaysRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.networkservices.v1.ListGatewaysRequest} ListGatewaysRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListGatewaysRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.networkservices.v1.ListGatewaysRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + 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 ListGatewaysRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.networkservices.v1.ListGatewaysRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.networkservices.v1.ListGatewaysRequest} ListGatewaysRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListGatewaysRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListGatewaysRequest message. + * @function verify + * @memberof google.cloud.networkservices.v1.ListGatewaysRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListGatewaysRequest.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 ListGatewaysRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.networkservices.v1.ListGatewaysRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.networkservices.v1.ListGatewaysRequest} ListGatewaysRequest + */ + ListGatewaysRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.networkservices.v1.ListGatewaysRequest) + return object; + var message = new $root.google.cloud.networkservices.v1.ListGatewaysRequest(); + 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 ListGatewaysRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.networkservices.v1.ListGatewaysRequest + * @static + * @param {google.cloud.networkservices.v1.ListGatewaysRequest} message ListGatewaysRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListGatewaysRequest.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 ListGatewaysRequest to JSON. + * @function toJSON + * @memberof google.cloud.networkservices.v1.ListGatewaysRequest + * @instance + * @returns {Object.} JSON object + */ + ListGatewaysRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListGatewaysRequest + * @function getTypeUrl + * @memberof google.cloud.networkservices.v1.ListGatewaysRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListGatewaysRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.networkservices.v1.ListGatewaysRequest"; + }; + + return ListGatewaysRequest; + })(); + + v1.ListGatewaysResponse = (function() { + + /** + * Properties of a ListGatewaysResponse. + * @memberof google.cloud.networkservices.v1 + * @interface IListGatewaysResponse + * @property {Array.|null} [gateways] ListGatewaysResponse gateways + * @property {string|null} [nextPageToken] ListGatewaysResponse nextPageToken + */ + + /** + * Constructs a new ListGatewaysResponse. + * @memberof google.cloud.networkservices.v1 + * @classdesc Represents a ListGatewaysResponse. + * @implements IListGatewaysResponse + * @constructor + * @param {google.cloud.networkservices.v1.IListGatewaysResponse=} [properties] Properties to set + */ + function ListGatewaysResponse(properties) { + this.gateways = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListGatewaysResponse gateways. + * @member {Array.} gateways + * @memberof google.cloud.networkservices.v1.ListGatewaysResponse + * @instance + */ + ListGatewaysResponse.prototype.gateways = $util.emptyArray; + + /** + * ListGatewaysResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.cloud.networkservices.v1.ListGatewaysResponse + * @instance + */ + ListGatewaysResponse.prototype.nextPageToken = ""; + + /** + * Creates a new ListGatewaysResponse instance using the specified properties. + * @function create + * @memberof google.cloud.networkservices.v1.ListGatewaysResponse + * @static + * @param {google.cloud.networkservices.v1.IListGatewaysResponse=} [properties] Properties to set + * @returns {google.cloud.networkservices.v1.ListGatewaysResponse} ListGatewaysResponse instance + */ + ListGatewaysResponse.create = function create(properties) { + return new ListGatewaysResponse(properties); + }; + + /** + * Encodes the specified ListGatewaysResponse message. Does not implicitly {@link google.cloud.networkservices.v1.ListGatewaysResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.networkservices.v1.ListGatewaysResponse + * @static + * @param {google.cloud.networkservices.v1.IListGatewaysResponse} message ListGatewaysResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListGatewaysResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.gateways != null && message.gateways.length) + for (var i = 0; i < message.gateways.length; ++i) + $root.google.cloud.networkservices.v1.Gateway.encode(message.gateways[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 ListGatewaysResponse message, length delimited. Does not implicitly {@link google.cloud.networkservices.v1.ListGatewaysResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.networkservices.v1.ListGatewaysResponse + * @static + * @param {google.cloud.networkservices.v1.IListGatewaysResponse} message ListGatewaysResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListGatewaysResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListGatewaysResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.networkservices.v1.ListGatewaysResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.networkservices.v1.ListGatewaysResponse} ListGatewaysResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListGatewaysResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.networkservices.v1.ListGatewaysResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.gateways && message.gateways.length)) + message.gateways = []; + message.gateways.push($root.google.cloud.networkservices.v1.Gateway.decode(reader, reader.uint32())); + break; + } + case 2: { + message.nextPageToken = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListGatewaysResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.networkservices.v1.ListGatewaysResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.networkservices.v1.ListGatewaysResponse} ListGatewaysResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListGatewaysResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListGatewaysResponse message. + * @function verify + * @memberof google.cloud.networkservices.v1.ListGatewaysResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListGatewaysResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.gateways != null && message.hasOwnProperty("gateways")) { + if (!Array.isArray(message.gateways)) + return "gateways: array expected"; + for (var i = 0; i < message.gateways.length; ++i) { + var error = $root.google.cloud.networkservices.v1.Gateway.verify(message.gateways[i]); + if (error) + return "gateways." + error; + } + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + return null; + }; + + /** + * Creates a ListGatewaysResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.networkservices.v1.ListGatewaysResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.networkservices.v1.ListGatewaysResponse} ListGatewaysResponse + */ + ListGatewaysResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.networkservices.v1.ListGatewaysResponse) + return object; + var message = new $root.google.cloud.networkservices.v1.ListGatewaysResponse(); + if (object.gateways) { + if (!Array.isArray(object.gateways)) + throw TypeError(".google.cloud.networkservices.v1.ListGatewaysResponse.gateways: array expected"); + message.gateways = []; + for (var i = 0; i < object.gateways.length; ++i) { + if (typeof object.gateways[i] !== "object") + throw TypeError(".google.cloud.networkservices.v1.ListGatewaysResponse.gateways: object expected"); + message.gateways[i] = $root.google.cloud.networkservices.v1.Gateway.fromObject(object.gateways[i]); + } + } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + return message; + }; + + /** + * Creates a plain object from a ListGatewaysResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.networkservices.v1.ListGatewaysResponse + * @static + * @param {google.cloud.networkservices.v1.ListGatewaysResponse} message ListGatewaysResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListGatewaysResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.gateways = []; + if (options.defaults) + object.nextPageToken = ""; + if (message.gateways && message.gateways.length) { + object.gateways = []; + for (var j = 0; j < message.gateways.length; ++j) + object.gateways[j] = $root.google.cloud.networkservices.v1.Gateway.toObject(message.gateways[j], options); + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + object.nextPageToken = message.nextPageToken; + return object; + }; + + /** + * Converts this ListGatewaysResponse to JSON. + * @function toJSON + * @memberof google.cloud.networkservices.v1.ListGatewaysResponse + * @instance + * @returns {Object.} JSON object + */ + ListGatewaysResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListGatewaysResponse + * @function getTypeUrl + * @memberof google.cloud.networkservices.v1.ListGatewaysResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListGatewaysResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.networkservices.v1.ListGatewaysResponse"; + }; + + return ListGatewaysResponse; + })(); + + v1.GetGatewayRequest = (function() { + + /** + * Properties of a GetGatewayRequest. + * @memberof google.cloud.networkservices.v1 + * @interface IGetGatewayRequest + * @property {string|null} [name] GetGatewayRequest name + */ + + /** + * Constructs a new GetGatewayRequest. + * @memberof google.cloud.networkservices.v1 + * @classdesc Represents a GetGatewayRequest. + * @implements IGetGatewayRequest + * @constructor + * @param {google.cloud.networkservices.v1.IGetGatewayRequest=} [properties] Properties to set + */ + function GetGatewayRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetGatewayRequest name. + * @member {string} name + * @memberof google.cloud.networkservices.v1.GetGatewayRequest + * @instance + */ + GetGatewayRequest.prototype.name = ""; + + /** + * Creates a new GetGatewayRequest instance using the specified properties. + * @function create + * @memberof google.cloud.networkservices.v1.GetGatewayRequest + * @static + * @param {google.cloud.networkservices.v1.IGetGatewayRequest=} [properties] Properties to set + * @returns {google.cloud.networkservices.v1.GetGatewayRequest} GetGatewayRequest instance + */ + GetGatewayRequest.create = function create(properties) { + return new GetGatewayRequest(properties); + }; + + /** + * Encodes the specified GetGatewayRequest message. Does not implicitly {@link google.cloud.networkservices.v1.GetGatewayRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.networkservices.v1.GetGatewayRequest + * @static + * @param {google.cloud.networkservices.v1.IGetGatewayRequest} message GetGatewayRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetGatewayRequest.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 GetGatewayRequest message, length delimited. Does not implicitly {@link google.cloud.networkservices.v1.GetGatewayRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.networkservices.v1.GetGatewayRequest + * @static + * @param {google.cloud.networkservices.v1.IGetGatewayRequest} message GetGatewayRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetGatewayRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetGatewayRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.networkservices.v1.GetGatewayRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.networkservices.v1.GetGatewayRequest} GetGatewayRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetGatewayRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.networkservices.v1.GetGatewayRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetGatewayRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.networkservices.v1.GetGatewayRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.networkservices.v1.GetGatewayRequest} GetGatewayRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetGatewayRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetGatewayRequest message. + * @function verify + * @memberof google.cloud.networkservices.v1.GetGatewayRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetGatewayRequest.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 GetGatewayRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.networkservices.v1.GetGatewayRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.networkservices.v1.GetGatewayRequest} GetGatewayRequest + */ + GetGatewayRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.networkservices.v1.GetGatewayRequest) + return object; + var message = new $root.google.cloud.networkservices.v1.GetGatewayRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a GetGatewayRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.networkservices.v1.GetGatewayRequest + * @static + * @param {google.cloud.networkservices.v1.GetGatewayRequest} message GetGatewayRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetGatewayRequest.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 GetGatewayRequest to JSON. + * @function toJSON + * @memberof google.cloud.networkservices.v1.GetGatewayRequest + * @instance + * @returns {Object.} JSON object + */ + GetGatewayRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GetGatewayRequest + * @function getTypeUrl + * @memberof google.cloud.networkservices.v1.GetGatewayRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GetGatewayRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.networkservices.v1.GetGatewayRequest"; + }; + + return GetGatewayRequest; + })(); + + v1.CreateGatewayRequest = (function() { + + /** + * Properties of a CreateGatewayRequest. + * @memberof google.cloud.networkservices.v1 + * @interface ICreateGatewayRequest + * @property {string|null} [parent] CreateGatewayRequest parent + * @property {string|null} [gatewayId] CreateGatewayRequest gatewayId + * @property {google.cloud.networkservices.v1.IGateway|null} [gateway] CreateGatewayRequest gateway + */ + + /** + * Constructs a new CreateGatewayRequest. + * @memberof google.cloud.networkservices.v1 + * @classdesc Represents a CreateGatewayRequest. + * @implements ICreateGatewayRequest + * @constructor + * @param {google.cloud.networkservices.v1.ICreateGatewayRequest=} [properties] Properties to set + */ + function CreateGatewayRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * CreateGatewayRequest parent. + * @member {string} parent + * @memberof google.cloud.networkservices.v1.CreateGatewayRequest + * @instance + */ + CreateGatewayRequest.prototype.parent = ""; + + /** + * CreateGatewayRequest gatewayId. + * @member {string} gatewayId + * @memberof google.cloud.networkservices.v1.CreateGatewayRequest + * @instance + */ + CreateGatewayRequest.prototype.gatewayId = ""; + + /** + * CreateGatewayRequest gateway. + * @member {google.cloud.networkservices.v1.IGateway|null|undefined} gateway + * @memberof google.cloud.networkservices.v1.CreateGatewayRequest + * @instance + */ + CreateGatewayRequest.prototype.gateway = null; + + /** + * Creates a new CreateGatewayRequest instance using the specified properties. + * @function create + * @memberof google.cloud.networkservices.v1.CreateGatewayRequest + * @static + * @param {google.cloud.networkservices.v1.ICreateGatewayRequest=} [properties] Properties to set + * @returns {google.cloud.networkservices.v1.CreateGatewayRequest} CreateGatewayRequest instance + */ + CreateGatewayRequest.create = function create(properties) { + return new CreateGatewayRequest(properties); + }; + + /** + * Encodes the specified CreateGatewayRequest message. Does not implicitly {@link google.cloud.networkservices.v1.CreateGatewayRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.networkservices.v1.CreateGatewayRequest + * @static + * @param {google.cloud.networkservices.v1.ICreateGatewayRequest} message CreateGatewayRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateGatewayRequest.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.gatewayId != null && Object.hasOwnProperty.call(message, "gatewayId")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.gatewayId); + if (message.gateway != null && Object.hasOwnProperty.call(message, "gateway")) + $root.google.cloud.networkservices.v1.Gateway.encode(message.gateway, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified CreateGatewayRequest message, length delimited. Does not implicitly {@link google.cloud.networkservices.v1.CreateGatewayRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.networkservices.v1.CreateGatewayRequest + * @static + * @param {google.cloud.networkservices.v1.ICreateGatewayRequest} message CreateGatewayRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateGatewayRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CreateGatewayRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.networkservices.v1.CreateGatewayRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.networkservices.v1.CreateGatewayRequest} CreateGatewayRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateGatewayRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.networkservices.v1.CreateGatewayRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.gatewayId = reader.string(); + break; + } + case 3: { + message.gateway = $root.google.cloud.networkservices.v1.Gateway.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CreateGatewayRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.networkservices.v1.CreateGatewayRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.networkservices.v1.CreateGatewayRequest} CreateGatewayRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateGatewayRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CreateGatewayRequest message. + * @function verify + * @memberof google.cloud.networkservices.v1.CreateGatewayRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CreateGatewayRequest.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.gatewayId != null && message.hasOwnProperty("gatewayId")) + if (!$util.isString(message.gatewayId)) + return "gatewayId: string expected"; + if (message.gateway != null && message.hasOwnProperty("gateway")) { + var error = $root.google.cloud.networkservices.v1.Gateway.verify(message.gateway); + if (error) + return "gateway." + error; + } + return null; + }; + + /** + * Creates a CreateGatewayRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.networkservices.v1.CreateGatewayRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.networkservices.v1.CreateGatewayRequest} CreateGatewayRequest + */ + CreateGatewayRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.networkservices.v1.CreateGatewayRequest) + return object; + var message = new $root.google.cloud.networkservices.v1.CreateGatewayRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.gatewayId != null) + message.gatewayId = String(object.gatewayId); + if (object.gateway != null) { + if (typeof object.gateway !== "object") + throw TypeError(".google.cloud.networkservices.v1.CreateGatewayRequest.gateway: object expected"); + message.gateway = $root.google.cloud.networkservices.v1.Gateway.fromObject(object.gateway); + } + return message; + }; + + /** + * Creates a plain object from a CreateGatewayRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.networkservices.v1.CreateGatewayRequest + * @static + * @param {google.cloud.networkservices.v1.CreateGatewayRequest} message CreateGatewayRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CreateGatewayRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.gatewayId = ""; + object.gateway = null; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.gatewayId != null && message.hasOwnProperty("gatewayId")) + object.gatewayId = message.gatewayId; + if (message.gateway != null && message.hasOwnProperty("gateway")) + object.gateway = $root.google.cloud.networkservices.v1.Gateway.toObject(message.gateway, options); + return object; + }; + + /** + * Converts this CreateGatewayRequest to JSON. + * @function toJSON + * @memberof google.cloud.networkservices.v1.CreateGatewayRequest + * @instance + * @returns {Object.} JSON object + */ + CreateGatewayRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CreateGatewayRequest + * @function getTypeUrl + * @memberof google.cloud.networkservices.v1.CreateGatewayRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CreateGatewayRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.networkservices.v1.CreateGatewayRequest"; + }; + + return CreateGatewayRequest; + })(); + + v1.UpdateGatewayRequest = (function() { + + /** + * Properties of an UpdateGatewayRequest. + * @memberof google.cloud.networkservices.v1 + * @interface IUpdateGatewayRequest + * @property {google.protobuf.IFieldMask|null} [updateMask] UpdateGatewayRequest updateMask + * @property {google.cloud.networkservices.v1.IGateway|null} [gateway] UpdateGatewayRequest gateway + */ + + /** + * Constructs a new UpdateGatewayRequest. + * @memberof google.cloud.networkservices.v1 + * @classdesc Represents an UpdateGatewayRequest. + * @implements IUpdateGatewayRequest + * @constructor + * @param {google.cloud.networkservices.v1.IUpdateGatewayRequest=} [properties] Properties to set + */ + function UpdateGatewayRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * UpdateGatewayRequest updateMask. + * @member {google.protobuf.IFieldMask|null|undefined} updateMask + * @memberof google.cloud.networkservices.v1.UpdateGatewayRequest + * @instance + */ + UpdateGatewayRequest.prototype.updateMask = null; + + /** + * UpdateGatewayRequest gateway. + * @member {google.cloud.networkservices.v1.IGateway|null|undefined} gateway + * @memberof google.cloud.networkservices.v1.UpdateGatewayRequest + * @instance + */ + UpdateGatewayRequest.prototype.gateway = null; + + /** + * Creates a new UpdateGatewayRequest instance using the specified properties. + * @function create + * @memberof google.cloud.networkservices.v1.UpdateGatewayRequest + * @static + * @param {google.cloud.networkservices.v1.IUpdateGatewayRequest=} [properties] Properties to set + * @returns {google.cloud.networkservices.v1.UpdateGatewayRequest} UpdateGatewayRequest instance + */ + UpdateGatewayRequest.create = function create(properties) { + return new UpdateGatewayRequest(properties); + }; + + /** + * Encodes the specified UpdateGatewayRequest message. Does not implicitly {@link google.cloud.networkservices.v1.UpdateGatewayRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.networkservices.v1.UpdateGatewayRequest + * @static + * @param {google.cloud.networkservices.v1.IUpdateGatewayRequest} message UpdateGatewayRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateGatewayRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.updateMask != null && Object.hasOwnProperty.call(message, "updateMask")) + $root.google.protobuf.FieldMask.encode(message.updateMask, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.gateway != null && Object.hasOwnProperty.call(message, "gateway")) + $root.google.cloud.networkservices.v1.Gateway.encode(message.gateway, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified UpdateGatewayRequest message, length delimited. Does not implicitly {@link google.cloud.networkservices.v1.UpdateGatewayRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.networkservices.v1.UpdateGatewayRequest + * @static + * @param {google.cloud.networkservices.v1.IUpdateGatewayRequest} message UpdateGatewayRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateGatewayRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an UpdateGatewayRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.networkservices.v1.UpdateGatewayRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.networkservices.v1.UpdateGatewayRequest} UpdateGatewayRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateGatewayRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.networkservices.v1.UpdateGatewayRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.updateMask = $root.google.protobuf.FieldMask.decode(reader, reader.uint32()); + break; + } + case 2: { + message.gateway = $root.google.cloud.networkservices.v1.Gateway.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an UpdateGatewayRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.networkservices.v1.UpdateGatewayRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.networkservices.v1.UpdateGatewayRequest} UpdateGatewayRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateGatewayRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an UpdateGatewayRequest message. + * @function verify + * @memberof google.cloud.networkservices.v1.UpdateGatewayRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + UpdateGatewayRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.updateMask != null && message.hasOwnProperty("updateMask")) { + var error = $root.google.protobuf.FieldMask.verify(message.updateMask); + if (error) + return "updateMask." + error; + } + if (message.gateway != null && message.hasOwnProperty("gateway")) { + var error = $root.google.cloud.networkservices.v1.Gateway.verify(message.gateway); + if (error) + return "gateway." + error; + } + return null; + }; + + /** + * Creates an UpdateGatewayRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.networkservices.v1.UpdateGatewayRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.networkservices.v1.UpdateGatewayRequest} UpdateGatewayRequest + */ + UpdateGatewayRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.networkservices.v1.UpdateGatewayRequest) + return object; + var message = new $root.google.cloud.networkservices.v1.UpdateGatewayRequest(); + if (object.updateMask != null) { + if (typeof object.updateMask !== "object") + throw TypeError(".google.cloud.networkservices.v1.UpdateGatewayRequest.updateMask: object expected"); + message.updateMask = $root.google.protobuf.FieldMask.fromObject(object.updateMask); + } + if (object.gateway != null) { + if (typeof object.gateway !== "object") + throw TypeError(".google.cloud.networkservices.v1.UpdateGatewayRequest.gateway: object expected"); + message.gateway = $root.google.cloud.networkservices.v1.Gateway.fromObject(object.gateway); + } + return message; + }; + + /** + * Creates a plain object from an UpdateGatewayRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.networkservices.v1.UpdateGatewayRequest + * @static + * @param {google.cloud.networkservices.v1.UpdateGatewayRequest} message UpdateGatewayRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + UpdateGatewayRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.updateMask = null; + object.gateway = null; + } + if (message.updateMask != null && message.hasOwnProperty("updateMask")) + object.updateMask = $root.google.protobuf.FieldMask.toObject(message.updateMask, options); + if (message.gateway != null && message.hasOwnProperty("gateway")) + object.gateway = $root.google.cloud.networkservices.v1.Gateway.toObject(message.gateway, options); + return object; + }; + + /** + * Converts this UpdateGatewayRequest to JSON. + * @function toJSON + * @memberof google.cloud.networkservices.v1.UpdateGatewayRequest + * @instance + * @returns {Object.} JSON object + */ + UpdateGatewayRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for UpdateGatewayRequest + * @function getTypeUrl + * @memberof google.cloud.networkservices.v1.UpdateGatewayRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + UpdateGatewayRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.networkservices.v1.UpdateGatewayRequest"; + }; + + return UpdateGatewayRequest; + })(); + + v1.DeleteGatewayRequest = (function() { + + /** + * Properties of a DeleteGatewayRequest. + * @memberof google.cloud.networkservices.v1 + * @interface IDeleteGatewayRequest + * @property {string|null} [name] DeleteGatewayRequest name + */ + + /** + * Constructs a new DeleteGatewayRequest. + * @memberof google.cloud.networkservices.v1 + * @classdesc Represents a DeleteGatewayRequest. + * @implements IDeleteGatewayRequest + * @constructor + * @param {google.cloud.networkservices.v1.IDeleteGatewayRequest=} [properties] Properties to set + */ + function DeleteGatewayRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * DeleteGatewayRequest name. + * @member {string} name + * @memberof google.cloud.networkservices.v1.DeleteGatewayRequest + * @instance + */ + DeleteGatewayRequest.prototype.name = ""; + + /** + * Creates a new DeleteGatewayRequest instance using the specified properties. + * @function create + * @memberof google.cloud.networkservices.v1.DeleteGatewayRequest + * @static + * @param {google.cloud.networkservices.v1.IDeleteGatewayRequest=} [properties] Properties to set + * @returns {google.cloud.networkservices.v1.DeleteGatewayRequest} DeleteGatewayRequest instance + */ + DeleteGatewayRequest.create = function create(properties) { + return new DeleteGatewayRequest(properties); + }; + + /** + * Encodes the specified DeleteGatewayRequest message. Does not implicitly {@link google.cloud.networkservices.v1.DeleteGatewayRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.networkservices.v1.DeleteGatewayRequest + * @static + * @param {google.cloud.networkservices.v1.IDeleteGatewayRequest} message DeleteGatewayRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteGatewayRequest.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 DeleteGatewayRequest message, length delimited. Does not implicitly {@link google.cloud.networkservices.v1.DeleteGatewayRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.networkservices.v1.DeleteGatewayRequest + * @static + * @param {google.cloud.networkservices.v1.IDeleteGatewayRequest} message DeleteGatewayRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteGatewayRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DeleteGatewayRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.networkservices.v1.DeleteGatewayRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.networkservices.v1.DeleteGatewayRequest} DeleteGatewayRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteGatewayRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.networkservices.v1.DeleteGatewayRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DeleteGatewayRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.networkservices.v1.DeleteGatewayRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.networkservices.v1.DeleteGatewayRequest} DeleteGatewayRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteGatewayRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DeleteGatewayRequest message. + * @function verify + * @memberof google.cloud.networkservices.v1.DeleteGatewayRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DeleteGatewayRequest.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 DeleteGatewayRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.networkservices.v1.DeleteGatewayRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.networkservices.v1.DeleteGatewayRequest} DeleteGatewayRequest + */ + DeleteGatewayRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.networkservices.v1.DeleteGatewayRequest) + return object; + var message = new $root.google.cloud.networkservices.v1.DeleteGatewayRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a DeleteGatewayRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.networkservices.v1.DeleteGatewayRequest + * @static + * @param {google.cloud.networkservices.v1.DeleteGatewayRequest} message DeleteGatewayRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DeleteGatewayRequest.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 DeleteGatewayRequest to JSON. + * @function toJSON + * @memberof google.cloud.networkservices.v1.DeleteGatewayRequest + * @instance + * @returns {Object.} JSON object + */ + DeleteGatewayRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DeleteGatewayRequest + * @function getTypeUrl + * @memberof google.cloud.networkservices.v1.DeleteGatewayRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DeleteGatewayRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.networkservices.v1.DeleteGatewayRequest"; + }; + + return DeleteGatewayRequest; + })(); + + v1.GrpcRoute = (function() { + + /** + * Properties of a GrpcRoute. + * @memberof google.cloud.networkservices.v1 + * @interface IGrpcRoute + * @property {string|null} [name] GrpcRoute name + * @property {string|null} [selfLink] GrpcRoute selfLink + * @property {google.protobuf.ITimestamp|null} [createTime] GrpcRoute createTime + * @property {google.protobuf.ITimestamp|null} [updateTime] GrpcRoute updateTime + * @property {Object.|null} [labels] GrpcRoute labels + * @property {string|null} [description] GrpcRoute description + * @property {Array.|null} [hostnames] GrpcRoute hostnames + * @property {Array.|null} [meshes] GrpcRoute meshes + * @property {Array.|null} [gateways] GrpcRoute gateways + * @property {Array.|null} [rules] GrpcRoute rules + */ + + /** + * Constructs a new GrpcRoute. + * @memberof google.cloud.networkservices.v1 + * @classdesc Represents a GrpcRoute. + * @implements IGrpcRoute + * @constructor + * @param {google.cloud.networkservices.v1.IGrpcRoute=} [properties] Properties to set + */ + function GrpcRoute(properties) { + this.labels = {}; + this.hostnames = []; + this.meshes = []; + this.gateways = []; + 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]]; + } + + /** + * GrpcRoute name. + * @member {string} name + * @memberof google.cloud.networkservices.v1.GrpcRoute + * @instance + */ + GrpcRoute.prototype.name = ""; + + /** + * GrpcRoute selfLink. + * @member {string} selfLink + * @memberof google.cloud.networkservices.v1.GrpcRoute + * @instance + */ + GrpcRoute.prototype.selfLink = ""; + + /** + * GrpcRoute createTime. + * @member {google.protobuf.ITimestamp|null|undefined} createTime + * @memberof google.cloud.networkservices.v1.GrpcRoute + * @instance + */ + GrpcRoute.prototype.createTime = null; + + /** + * GrpcRoute updateTime. + * @member {google.protobuf.ITimestamp|null|undefined} updateTime + * @memberof google.cloud.networkservices.v1.GrpcRoute + * @instance + */ + GrpcRoute.prototype.updateTime = null; + + /** + * GrpcRoute labels. + * @member {Object.} labels + * @memberof google.cloud.networkservices.v1.GrpcRoute + * @instance + */ + GrpcRoute.prototype.labels = $util.emptyObject; + + /** + * GrpcRoute description. + * @member {string} description + * @memberof google.cloud.networkservices.v1.GrpcRoute + * @instance + */ + GrpcRoute.prototype.description = ""; + + /** + * GrpcRoute hostnames. + * @member {Array.} hostnames + * @memberof google.cloud.networkservices.v1.GrpcRoute + * @instance + */ + GrpcRoute.prototype.hostnames = $util.emptyArray; + + /** + * GrpcRoute meshes. + * @member {Array.} meshes + * @memberof google.cloud.networkservices.v1.GrpcRoute + * @instance + */ + GrpcRoute.prototype.meshes = $util.emptyArray; + + /** + * GrpcRoute gateways. + * @member {Array.} gateways + * @memberof google.cloud.networkservices.v1.GrpcRoute + * @instance + */ + GrpcRoute.prototype.gateways = $util.emptyArray; + + /** + * GrpcRoute rules. + * @member {Array.} rules + * @memberof google.cloud.networkservices.v1.GrpcRoute + * @instance + */ + GrpcRoute.prototype.rules = $util.emptyArray; + + /** + * Creates a new GrpcRoute instance using the specified properties. + * @function create + * @memberof google.cloud.networkservices.v1.GrpcRoute + * @static + * @param {google.cloud.networkservices.v1.IGrpcRoute=} [properties] Properties to set + * @returns {google.cloud.networkservices.v1.GrpcRoute} GrpcRoute instance + */ + GrpcRoute.create = function create(properties) { + return new GrpcRoute(properties); + }; + + /** + * Encodes the specified GrpcRoute message. Does not implicitly {@link google.cloud.networkservices.v1.GrpcRoute.verify|verify} messages. + * @function encode + * @memberof google.cloud.networkservices.v1.GrpcRoute + * @static + * @param {google.cloud.networkservices.v1.IGrpcRoute} message GrpcRoute message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GrpcRoute.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.createTime != null && Object.hasOwnProperty.call(message, "createTime")) + $root.google.protobuf.Timestamp.encode(message.createTime, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + 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(); + if (message.labels != null && Object.hasOwnProperty.call(message, "labels")) + for (var keys = Object.keys(message.labels), i = 0; i < keys.length; ++i) + writer.uint32(/* id 4, wireType 2 =*/34).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.labels[keys[i]]).ldelim(); + if (message.description != null && Object.hasOwnProperty.call(message, "description")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.description); + if (message.hostnames != null && message.hostnames.length) + for (var i = 0; i < message.hostnames.length; ++i) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.hostnames[i]); + if (message.rules != null && message.rules.length) + for (var i = 0; i < message.rules.length; ++i) + $root.google.cloud.networkservices.v1.GrpcRoute.RouteRule.encode(message.rules[i], writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + if (message.meshes != null && message.meshes.length) + for (var i = 0; i < message.meshes.length; ++i) + writer.uint32(/* id 9, wireType 2 =*/74).string(message.meshes[i]); + if (message.gateways != null && message.gateways.length) + for (var i = 0; i < message.gateways.length; ++i) + writer.uint32(/* id 10, wireType 2 =*/82).string(message.gateways[i]); + if (message.selfLink != null && Object.hasOwnProperty.call(message, "selfLink")) + writer.uint32(/* id 12, wireType 2 =*/98).string(message.selfLink); + return writer; + }; + + /** + * Encodes the specified GrpcRoute message, length delimited. Does not implicitly {@link google.cloud.networkservices.v1.GrpcRoute.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.networkservices.v1.GrpcRoute + * @static + * @param {google.cloud.networkservices.v1.IGrpcRoute} message GrpcRoute message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GrpcRoute.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GrpcRoute message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.networkservices.v1.GrpcRoute + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.networkservices.v1.GrpcRoute} GrpcRoute + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GrpcRoute.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.networkservices.v1.GrpcRoute(), key, value; + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 12: { + message.selfLink = reader.string(); + break; + } + case 2: { + message.createTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 3: { + message.updateTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 4: { + if (message.labels === $util.emptyObject) + message.labels = {}; + 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.labels[key] = value; + break; + } + case 5: { + message.description = reader.string(); + break; + } + case 6: { + if (!(message.hostnames && message.hostnames.length)) + message.hostnames = []; + message.hostnames.push(reader.string()); + break; + } + case 9: { + if (!(message.meshes && message.meshes.length)) + message.meshes = []; + message.meshes.push(reader.string()); + break; + } + case 10: { + if (!(message.gateways && message.gateways.length)) + message.gateways = []; + message.gateways.push(reader.string()); + break; + } + case 7: { + if (!(message.rules && message.rules.length)) + message.rules = []; + message.rules.push($root.google.cloud.networkservices.v1.GrpcRoute.RouteRule.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GrpcRoute message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.networkservices.v1.GrpcRoute + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.networkservices.v1.GrpcRoute} GrpcRoute + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GrpcRoute.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GrpcRoute message. + * @function verify + * @memberof google.cloud.networkservices.v1.GrpcRoute + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GrpcRoute.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.selfLink != null && message.hasOwnProperty("selfLink")) + if (!$util.isString(message.selfLink)) + return "selfLink: string expected"; + 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.labels != null && message.hasOwnProperty("labels")) { + if (!$util.isObject(message.labels)) + return "labels: object expected"; + var key = Object.keys(message.labels); + for (var i = 0; i < key.length; ++i) + if (!$util.isString(message.labels[key[i]])) + return "labels: string{k:string} expected"; + } + if (message.description != null && message.hasOwnProperty("description")) + if (!$util.isString(message.description)) + return "description: string expected"; + if (message.hostnames != null && message.hasOwnProperty("hostnames")) { + if (!Array.isArray(message.hostnames)) + return "hostnames: array expected"; + for (var i = 0; i < message.hostnames.length; ++i) + if (!$util.isString(message.hostnames[i])) + return "hostnames: string[] expected"; + } + if (message.meshes != null && message.hasOwnProperty("meshes")) { + if (!Array.isArray(message.meshes)) + return "meshes: array expected"; + for (var i = 0; i < message.meshes.length; ++i) + if (!$util.isString(message.meshes[i])) + return "meshes: string[] expected"; + } + if (message.gateways != null && message.hasOwnProperty("gateways")) { + if (!Array.isArray(message.gateways)) + return "gateways: array expected"; + for (var i = 0; i < message.gateways.length; ++i) + if (!$util.isString(message.gateways[i])) + return "gateways: string[] 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.cloud.networkservices.v1.GrpcRoute.RouteRule.verify(message.rules[i]); + if (error) + return "rules." + error; + } + } + return null; + }; + + /** + * Creates a GrpcRoute message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.networkservices.v1.GrpcRoute + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.networkservices.v1.GrpcRoute} GrpcRoute + */ + GrpcRoute.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.networkservices.v1.GrpcRoute) + return object; + var message = new $root.google.cloud.networkservices.v1.GrpcRoute(); + if (object.name != null) + message.name = String(object.name); + if (object.selfLink != null) + message.selfLink = String(object.selfLink); + if (object.createTime != null) { + if (typeof object.createTime !== "object") + throw TypeError(".google.cloud.networkservices.v1.GrpcRoute.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.networkservices.v1.GrpcRoute.updateTime: object expected"); + message.updateTime = $root.google.protobuf.Timestamp.fromObject(object.updateTime); + } + if (object.labels) { + if (typeof object.labels !== "object") + throw TypeError(".google.cloud.networkservices.v1.GrpcRoute.labels: object expected"); + message.labels = {}; + for (var keys = Object.keys(object.labels), i = 0; i < keys.length; ++i) + message.labels[keys[i]] = String(object.labels[keys[i]]); + } + if (object.description != null) + message.description = String(object.description); + if (object.hostnames) { + if (!Array.isArray(object.hostnames)) + throw TypeError(".google.cloud.networkservices.v1.GrpcRoute.hostnames: array expected"); + message.hostnames = []; + for (var i = 0; i < object.hostnames.length; ++i) + message.hostnames[i] = String(object.hostnames[i]); + } + if (object.meshes) { + if (!Array.isArray(object.meshes)) + throw TypeError(".google.cloud.networkservices.v1.GrpcRoute.meshes: array expected"); + message.meshes = []; + for (var i = 0; i < object.meshes.length; ++i) + message.meshes[i] = String(object.meshes[i]); + } + if (object.gateways) { + if (!Array.isArray(object.gateways)) + throw TypeError(".google.cloud.networkservices.v1.GrpcRoute.gateways: array expected"); + message.gateways = []; + for (var i = 0; i < object.gateways.length; ++i) + message.gateways[i] = String(object.gateways[i]); + } + if (object.rules) { + if (!Array.isArray(object.rules)) + throw TypeError(".google.cloud.networkservices.v1.GrpcRoute.rules: array expected"); + message.rules = []; + for (var i = 0; i < object.rules.length; ++i) { + if (typeof object.rules[i] !== "object") + throw TypeError(".google.cloud.networkservices.v1.GrpcRoute.rules: object expected"); + message.rules[i] = $root.google.cloud.networkservices.v1.GrpcRoute.RouteRule.fromObject(object.rules[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a GrpcRoute message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.networkservices.v1.GrpcRoute + * @static + * @param {google.cloud.networkservices.v1.GrpcRoute} message GrpcRoute + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GrpcRoute.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.hostnames = []; + object.rules = []; + object.meshes = []; + object.gateways = []; + } + if (options.objects || options.defaults) + object.labels = {}; + if (options.defaults) { + object.name = ""; + object.createTime = null; + object.updateTime = null; + object.description = ""; + object.selfLink = ""; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + 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); + var keys2; + if (message.labels && (keys2 = Object.keys(message.labels)).length) { + object.labels = {}; + for (var j = 0; j < keys2.length; ++j) + object.labels[keys2[j]] = message.labels[keys2[j]]; + } + if (message.description != null && message.hasOwnProperty("description")) + object.description = message.description; + if (message.hostnames && message.hostnames.length) { + object.hostnames = []; + for (var j = 0; j < message.hostnames.length; ++j) + object.hostnames[j] = message.hostnames[j]; + } + if (message.rules && message.rules.length) { + object.rules = []; + for (var j = 0; j < message.rules.length; ++j) + object.rules[j] = $root.google.cloud.networkservices.v1.GrpcRoute.RouteRule.toObject(message.rules[j], options); + } + if (message.meshes && message.meshes.length) { + object.meshes = []; + for (var j = 0; j < message.meshes.length; ++j) + object.meshes[j] = message.meshes[j]; + } + if (message.gateways && message.gateways.length) { + object.gateways = []; + for (var j = 0; j < message.gateways.length; ++j) + object.gateways[j] = message.gateways[j]; + } + if (message.selfLink != null && message.hasOwnProperty("selfLink")) + object.selfLink = message.selfLink; + return object; + }; + + /** + * Converts this GrpcRoute to JSON. + * @function toJSON + * @memberof google.cloud.networkservices.v1.GrpcRoute + * @instance + * @returns {Object.} JSON object + */ + GrpcRoute.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GrpcRoute + * @function getTypeUrl + * @memberof google.cloud.networkservices.v1.GrpcRoute + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GrpcRoute.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.networkservices.v1.GrpcRoute"; + }; + + GrpcRoute.MethodMatch = (function() { + + /** + * Properties of a MethodMatch. + * @memberof google.cloud.networkservices.v1.GrpcRoute + * @interface IMethodMatch + * @property {google.cloud.networkservices.v1.GrpcRoute.MethodMatch.Type|null} [type] MethodMatch type + * @property {string|null} [grpcService] MethodMatch grpcService + * @property {string|null} [grpcMethod] MethodMatch grpcMethod + * @property {boolean|null} [caseSensitive] MethodMatch caseSensitive + */ + + /** + * Constructs a new MethodMatch. + * @memberof google.cloud.networkservices.v1.GrpcRoute + * @classdesc Represents a MethodMatch. + * @implements IMethodMatch + * @constructor + * @param {google.cloud.networkservices.v1.GrpcRoute.IMethodMatch=} [properties] Properties to set + */ + function MethodMatch(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * MethodMatch type. + * @member {google.cloud.networkservices.v1.GrpcRoute.MethodMatch.Type} type + * @memberof google.cloud.networkservices.v1.GrpcRoute.MethodMatch + * @instance + */ + MethodMatch.prototype.type = 0; + + /** + * MethodMatch grpcService. + * @member {string} grpcService + * @memberof google.cloud.networkservices.v1.GrpcRoute.MethodMatch + * @instance + */ + MethodMatch.prototype.grpcService = ""; + + /** + * MethodMatch grpcMethod. + * @member {string} grpcMethod + * @memberof google.cloud.networkservices.v1.GrpcRoute.MethodMatch + * @instance + */ + MethodMatch.prototype.grpcMethod = ""; + + /** + * MethodMatch caseSensitive. + * @member {boolean|null|undefined} caseSensitive + * @memberof google.cloud.networkservices.v1.GrpcRoute.MethodMatch + * @instance + */ + MethodMatch.prototype.caseSensitive = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * MethodMatch _caseSensitive. + * @member {"caseSensitive"|undefined} _caseSensitive + * @memberof google.cloud.networkservices.v1.GrpcRoute.MethodMatch + * @instance + */ + Object.defineProperty(MethodMatch.prototype, "_caseSensitive", { + get: $util.oneOfGetter($oneOfFields = ["caseSensitive"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new MethodMatch instance using the specified properties. + * @function create + * @memberof google.cloud.networkservices.v1.GrpcRoute.MethodMatch + * @static + * @param {google.cloud.networkservices.v1.GrpcRoute.IMethodMatch=} [properties] Properties to set + * @returns {google.cloud.networkservices.v1.GrpcRoute.MethodMatch} MethodMatch instance + */ + MethodMatch.create = function create(properties) { + return new MethodMatch(properties); + }; + + /** + * Encodes the specified MethodMatch message. Does not implicitly {@link google.cloud.networkservices.v1.GrpcRoute.MethodMatch.verify|verify} messages. + * @function encode + * @memberof google.cloud.networkservices.v1.GrpcRoute.MethodMatch + * @static + * @param {google.cloud.networkservices.v1.GrpcRoute.IMethodMatch} message MethodMatch message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MethodMatch.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.type != null && Object.hasOwnProperty.call(message, "type")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.type); + if (message.grpcService != null && Object.hasOwnProperty.call(message, "grpcService")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.grpcService); + if (message.grpcMethod != null && Object.hasOwnProperty.call(message, "grpcMethod")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.grpcMethod); + if (message.caseSensitive != null && Object.hasOwnProperty.call(message, "caseSensitive")) + writer.uint32(/* id 4, wireType 0 =*/32).bool(message.caseSensitive); + return writer; + }; + + /** + * Encodes the specified MethodMatch message, length delimited. Does not implicitly {@link google.cloud.networkservices.v1.GrpcRoute.MethodMatch.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.networkservices.v1.GrpcRoute.MethodMatch + * @static + * @param {google.cloud.networkservices.v1.GrpcRoute.IMethodMatch} message MethodMatch message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MethodMatch.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a MethodMatch message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.networkservices.v1.GrpcRoute.MethodMatch + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.networkservices.v1.GrpcRoute.MethodMatch} MethodMatch + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MethodMatch.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.networkservices.v1.GrpcRoute.MethodMatch(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.type = reader.int32(); + break; + } + case 2: { + message.grpcService = reader.string(); + break; + } + case 3: { + message.grpcMethod = reader.string(); + break; + } + case 4: { + message.caseSensitive = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a MethodMatch message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.networkservices.v1.GrpcRoute.MethodMatch + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.networkservices.v1.GrpcRoute.MethodMatch} MethodMatch + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MethodMatch.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a MethodMatch message. + * @function verify + * @memberof google.cloud.networkservices.v1.GrpcRoute.MethodMatch + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + MethodMatch.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.type != null && message.hasOwnProperty("type")) + switch (message.type) { + default: + return "type: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.grpcService != null && message.hasOwnProperty("grpcService")) + if (!$util.isString(message.grpcService)) + return "grpcService: string expected"; + if (message.grpcMethod != null && message.hasOwnProperty("grpcMethod")) + if (!$util.isString(message.grpcMethod)) + return "grpcMethod: string expected"; + if (message.caseSensitive != null && message.hasOwnProperty("caseSensitive")) { + properties._caseSensitive = 1; + if (typeof message.caseSensitive !== "boolean") + return "caseSensitive: boolean expected"; + } + return null; + }; + + /** + * Creates a MethodMatch message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.networkservices.v1.GrpcRoute.MethodMatch + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.networkservices.v1.GrpcRoute.MethodMatch} MethodMatch + */ + MethodMatch.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.networkservices.v1.GrpcRoute.MethodMatch) + return object; + var message = new $root.google.cloud.networkservices.v1.GrpcRoute.MethodMatch(); + switch (object.type) { + default: + if (typeof object.type === "number") { + message.type = object.type; + break; + } + break; + case "TYPE_UNSPECIFIED": + case 0: + message.type = 0; + break; + case "EXACT": + case 1: + message.type = 1; + break; + case "REGULAR_EXPRESSION": + case 2: + message.type = 2; + break; + } + if (object.grpcService != null) + message.grpcService = String(object.grpcService); + if (object.grpcMethod != null) + message.grpcMethod = String(object.grpcMethod); + if (object.caseSensitive != null) + message.caseSensitive = Boolean(object.caseSensitive); + return message; + }; + + /** + * Creates a plain object from a MethodMatch message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.networkservices.v1.GrpcRoute.MethodMatch + * @static + * @param {google.cloud.networkservices.v1.GrpcRoute.MethodMatch} message MethodMatch + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + MethodMatch.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.type = options.enums === String ? "TYPE_UNSPECIFIED" : 0; + object.grpcService = ""; + object.grpcMethod = ""; + } + if (message.type != null && message.hasOwnProperty("type")) + object.type = options.enums === String ? $root.google.cloud.networkservices.v1.GrpcRoute.MethodMatch.Type[message.type] === undefined ? message.type : $root.google.cloud.networkservices.v1.GrpcRoute.MethodMatch.Type[message.type] : message.type; + if (message.grpcService != null && message.hasOwnProperty("grpcService")) + object.grpcService = message.grpcService; + if (message.grpcMethod != null && message.hasOwnProperty("grpcMethod")) + object.grpcMethod = message.grpcMethod; + if (message.caseSensitive != null && message.hasOwnProperty("caseSensitive")) { + object.caseSensitive = message.caseSensitive; + if (options.oneofs) + object._caseSensitive = "caseSensitive"; + } + return object; + }; + + /** + * Converts this MethodMatch to JSON. + * @function toJSON + * @memberof google.cloud.networkservices.v1.GrpcRoute.MethodMatch + * @instance + * @returns {Object.} JSON object + */ + MethodMatch.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for MethodMatch + * @function getTypeUrl + * @memberof google.cloud.networkservices.v1.GrpcRoute.MethodMatch + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + MethodMatch.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.networkservices.v1.GrpcRoute.MethodMatch"; + }; + + /** + * Type enum. + * @name google.cloud.networkservices.v1.GrpcRoute.MethodMatch.Type + * @enum {number} + * @property {number} TYPE_UNSPECIFIED=0 TYPE_UNSPECIFIED value + * @property {number} EXACT=1 EXACT value + * @property {number} REGULAR_EXPRESSION=2 REGULAR_EXPRESSION value + */ + MethodMatch.Type = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "TYPE_UNSPECIFIED"] = 0; + values[valuesById[1] = "EXACT"] = 1; + values[valuesById[2] = "REGULAR_EXPRESSION"] = 2; + return values; + })(); + + return MethodMatch; + })(); + + GrpcRoute.HeaderMatch = (function() { + + /** + * Properties of a HeaderMatch. + * @memberof google.cloud.networkservices.v1.GrpcRoute + * @interface IHeaderMatch + * @property {google.cloud.networkservices.v1.GrpcRoute.HeaderMatch.Type|null} [type] HeaderMatch type + * @property {string|null} [key] HeaderMatch key + * @property {string|null} [value] HeaderMatch value + */ + + /** + * Constructs a new HeaderMatch. + * @memberof google.cloud.networkservices.v1.GrpcRoute + * @classdesc Represents a HeaderMatch. + * @implements IHeaderMatch + * @constructor + * @param {google.cloud.networkservices.v1.GrpcRoute.IHeaderMatch=} [properties] Properties to set + */ + function HeaderMatch(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * HeaderMatch type. + * @member {google.cloud.networkservices.v1.GrpcRoute.HeaderMatch.Type} type + * @memberof google.cloud.networkservices.v1.GrpcRoute.HeaderMatch + * @instance + */ + HeaderMatch.prototype.type = 0; + + /** + * HeaderMatch key. + * @member {string} key + * @memberof google.cloud.networkservices.v1.GrpcRoute.HeaderMatch + * @instance + */ + HeaderMatch.prototype.key = ""; + + /** + * HeaderMatch value. + * @member {string} value + * @memberof google.cloud.networkservices.v1.GrpcRoute.HeaderMatch + * @instance + */ + HeaderMatch.prototype.value = ""; + + /** + * Creates a new HeaderMatch instance using the specified properties. + * @function create + * @memberof google.cloud.networkservices.v1.GrpcRoute.HeaderMatch + * @static + * @param {google.cloud.networkservices.v1.GrpcRoute.IHeaderMatch=} [properties] Properties to set + * @returns {google.cloud.networkservices.v1.GrpcRoute.HeaderMatch} HeaderMatch instance + */ + HeaderMatch.create = function create(properties) { + return new HeaderMatch(properties); + }; + + /** + * Encodes the specified HeaderMatch message. Does not implicitly {@link google.cloud.networkservices.v1.GrpcRoute.HeaderMatch.verify|verify} messages. + * @function encode + * @memberof google.cloud.networkservices.v1.GrpcRoute.HeaderMatch + * @static + * @param {google.cloud.networkservices.v1.GrpcRoute.IHeaderMatch} message HeaderMatch message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + HeaderMatch.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.type != null && Object.hasOwnProperty.call(message, "type")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.type); + if (message.key != null && Object.hasOwnProperty.call(message, "key")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.key); + if (message.value != null && Object.hasOwnProperty.call(message, "value")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.value); + return writer; + }; + + /** + * Encodes the specified HeaderMatch message, length delimited. Does not implicitly {@link google.cloud.networkservices.v1.GrpcRoute.HeaderMatch.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.networkservices.v1.GrpcRoute.HeaderMatch + * @static + * @param {google.cloud.networkservices.v1.GrpcRoute.IHeaderMatch} message HeaderMatch message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + HeaderMatch.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a HeaderMatch message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.networkservices.v1.GrpcRoute.HeaderMatch + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.networkservices.v1.GrpcRoute.HeaderMatch} HeaderMatch + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + HeaderMatch.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.networkservices.v1.GrpcRoute.HeaderMatch(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.type = reader.int32(); + break; + } + case 2: { + message.key = reader.string(); + break; + } + case 3: { + message.value = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a HeaderMatch message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.networkservices.v1.GrpcRoute.HeaderMatch + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.networkservices.v1.GrpcRoute.HeaderMatch} HeaderMatch + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + HeaderMatch.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a HeaderMatch message. + * @function verify + * @memberof google.cloud.networkservices.v1.GrpcRoute.HeaderMatch + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + HeaderMatch.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.type != null && message.hasOwnProperty("type")) + switch (message.type) { + default: + return "type: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.key != null && message.hasOwnProperty("key")) + if (!$util.isString(message.key)) + return "key: string expected"; + if (message.value != null && message.hasOwnProperty("value")) + if (!$util.isString(message.value)) + return "value: string expected"; + return null; + }; + + /** + * Creates a HeaderMatch message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.networkservices.v1.GrpcRoute.HeaderMatch + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.networkservices.v1.GrpcRoute.HeaderMatch} HeaderMatch + */ + HeaderMatch.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.networkservices.v1.GrpcRoute.HeaderMatch) + return object; + var message = new $root.google.cloud.networkservices.v1.GrpcRoute.HeaderMatch(); + switch (object.type) { + default: + if (typeof object.type === "number") { + message.type = object.type; + break; + } + break; + case "TYPE_UNSPECIFIED": + case 0: + message.type = 0; + break; + case "EXACT": + case 1: + message.type = 1; + break; + case "REGULAR_EXPRESSION": + case 2: + message.type = 2; + break; + } + if (object.key != null) + message.key = String(object.key); + if (object.value != null) + message.value = String(object.value); + return message; + }; + + /** + * Creates a plain object from a HeaderMatch message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.networkservices.v1.GrpcRoute.HeaderMatch + * @static + * @param {google.cloud.networkservices.v1.GrpcRoute.HeaderMatch} message HeaderMatch + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + HeaderMatch.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.type = options.enums === String ? "TYPE_UNSPECIFIED" : 0; + object.key = ""; + object.value = ""; + } + if (message.type != null && message.hasOwnProperty("type")) + object.type = options.enums === String ? $root.google.cloud.networkservices.v1.GrpcRoute.HeaderMatch.Type[message.type] === undefined ? message.type : $root.google.cloud.networkservices.v1.GrpcRoute.HeaderMatch.Type[message.type] : message.type; + if (message.key != null && message.hasOwnProperty("key")) + object.key = message.key; + if (message.value != null && message.hasOwnProperty("value")) + object.value = message.value; + return object; + }; + + /** + * Converts this HeaderMatch to JSON. + * @function toJSON + * @memberof google.cloud.networkservices.v1.GrpcRoute.HeaderMatch + * @instance + * @returns {Object.} JSON object + */ + HeaderMatch.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for HeaderMatch + * @function getTypeUrl + * @memberof google.cloud.networkservices.v1.GrpcRoute.HeaderMatch + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + HeaderMatch.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.networkservices.v1.GrpcRoute.HeaderMatch"; + }; + + /** + * Type enum. + * @name google.cloud.networkservices.v1.GrpcRoute.HeaderMatch.Type + * @enum {number} + * @property {number} TYPE_UNSPECIFIED=0 TYPE_UNSPECIFIED value + * @property {number} EXACT=1 EXACT value + * @property {number} REGULAR_EXPRESSION=2 REGULAR_EXPRESSION value + */ + HeaderMatch.Type = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "TYPE_UNSPECIFIED"] = 0; + values[valuesById[1] = "EXACT"] = 1; + values[valuesById[2] = "REGULAR_EXPRESSION"] = 2; + return values; + })(); + + return HeaderMatch; + })(); + + GrpcRoute.RouteMatch = (function() { + + /** + * Properties of a RouteMatch. + * @memberof google.cloud.networkservices.v1.GrpcRoute + * @interface IRouteMatch + * @property {google.cloud.networkservices.v1.GrpcRoute.IMethodMatch|null} [method] RouteMatch method + * @property {Array.|null} [headers] RouteMatch headers + */ + + /** + * Constructs a new RouteMatch. + * @memberof google.cloud.networkservices.v1.GrpcRoute + * @classdesc Represents a RouteMatch. + * @implements IRouteMatch + * @constructor + * @param {google.cloud.networkservices.v1.GrpcRoute.IRouteMatch=} [properties] Properties to set + */ + function RouteMatch(properties) { + this.headers = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * RouteMatch method. + * @member {google.cloud.networkservices.v1.GrpcRoute.IMethodMatch|null|undefined} method + * @memberof google.cloud.networkservices.v1.GrpcRoute.RouteMatch + * @instance + */ + RouteMatch.prototype.method = null; + + /** + * RouteMatch headers. + * @member {Array.} headers + * @memberof google.cloud.networkservices.v1.GrpcRoute.RouteMatch + * @instance + */ + RouteMatch.prototype.headers = $util.emptyArray; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * RouteMatch _method. + * @member {"method"|undefined} _method + * @memberof google.cloud.networkservices.v1.GrpcRoute.RouteMatch + * @instance + */ + Object.defineProperty(RouteMatch.prototype, "_method", { + get: $util.oneOfGetter($oneOfFields = ["method"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new RouteMatch instance using the specified properties. + * @function create + * @memberof google.cloud.networkservices.v1.GrpcRoute.RouteMatch + * @static + * @param {google.cloud.networkservices.v1.GrpcRoute.IRouteMatch=} [properties] Properties to set + * @returns {google.cloud.networkservices.v1.GrpcRoute.RouteMatch} RouteMatch instance + */ + RouteMatch.create = function create(properties) { + return new RouteMatch(properties); + }; + + /** + * Encodes the specified RouteMatch message. Does not implicitly {@link google.cloud.networkservices.v1.GrpcRoute.RouteMatch.verify|verify} messages. + * @function encode + * @memberof google.cloud.networkservices.v1.GrpcRoute.RouteMatch + * @static + * @param {google.cloud.networkservices.v1.GrpcRoute.IRouteMatch} message RouteMatch message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RouteMatch.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.method != null && Object.hasOwnProperty.call(message, "method")) + $root.google.cloud.networkservices.v1.GrpcRoute.MethodMatch.encode(message.method, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.headers != null && message.headers.length) + for (var i = 0; i < message.headers.length; ++i) + $root.google.cloud.networkservices.v1.GrpcRoute.HeaderMatch.encode(message.headers[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified RouteMatch message, length delimited. Does not implicitly {@link google.cloud.networkservices.v1.GrpcRoute.RouteMatch.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.networkservices.v1.GrpcRoute.RouteMatch + * @static + * @param {google.cloud.networkservices.v1.GrpcRoute.IRouteMatch} message RouteMatch message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RouteMatch.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a RouteMatch message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.networkservices.v1.GrpcRoute.RouteMatch + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.networkservices.v1.GrpcRoute.RouteMatch} RouteMatch + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RouteMatch.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.networkservices.v1.GrpcRoute.RouteMatch(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.method = $root.google.cloud.networkservices.v1.GrpcRoute.MethodMatch.decode(reader, reader.uint32()); + break; + } + case 2: { + if (!(message.headers && message.headers.length)) + message.headers = []; + message.headers.push($root.google.cloud.networkservices.v1.GrpcRoute.HeaderMatch.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a RouteMatch message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.networkservices.v1.GrpcRoute.RouteMatch + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.networkservices.v1.GrpcRoute.RouteMatch} RouteMatch + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RouteMatch.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a RouteMatch message. + * @function verify + * @memberof google.cloud.networkservices.v1.GrpcRoute.RouteMatch + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + RouteMatch.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.method != null && message.hasOwnProperty("method")) { + properties._method = 1; + { + var error = $root.google.cloud.networkservices.v1.GrpcRoute.MethodMatch.verify(message.method); + if (error) + return "method." + error; + } + } + if (message.headers != null && message.hasOwnProperty("headers")) { + if (!Array.isArray(message.headers)) + return "headers: array expected"; + for (var i = 0; i < message.headers.length; ++i) { + var error = $root.google.cloud.networkservices.v1.GrpcRoute.HeaderMatch.verify(message.headers[i]); + if (error) + return "headers." + error; + } + } + return null; + }; + + /** + * Creates a RouteMatch message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.networkservices.v1.GrpcRoute.RouteMatch + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.networkservices.v1.GrpcRoute.RouteMatch} RouteMatch + */ + RouteMatch.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.networkservices.v1.GrpcRoute.RouteMatch) + return object; + var message = new $root.google.cloud.networkservices.v1.GrpcRoute.RouteMatch(); + if (object.method != null) { + if (typeof object.method !== "object") + throw TypeError(".google.cloud.networkservices.v1.GrpcRoute.RouteMatch.method: object expected"); + message.method = $root.google.cloud.networkservices.v1.GrpcRoute.MethodMatch.fromObject(object.method); + } + if (object.headers) { + if (!Array.isArray(object.headers)) + throw TypeError(".google.cloud.networkservices.v1.GrpcRoute.RouteMatch.headers: array expected"); + message.headers = []; + for (var i = 0; i < object.headers.length; ++i) { + if (typeof object.headers[i] !== "object") + throw TypeError(".google.cloud.networkservices.v1.GrpcRoute.RouteMatch.headers: object expected"); + message.headers[i] = $root.google.cloud.networkservices.v1.GrpcRoute.HeaderMatch.fromObject(object.headers[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a RouteMatch message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.networkservices.v1.GrpcRoute.RouteMatch + * @static + * @param {google.cloud.networkservices.v1.GrpcRoute.RouteMatch} message RouteMatch + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + RouteMatch.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.headers = []; + if (message.method != null && message.hasOwnProperty("method")) { + object.method = $root.google.cloud.networkservices.v1.GrpcRoute.MethodMatch.toObject(message.method, options); + if (options.oneofs) + object._method = "method"; + } + if (message.headers && message.headers.length) { + object.headers = []; + for (var j = 0; j < message.headers.length; ++j) + object.headers[j] = $root.google.cloud.networkservices.v1.GrpcRoute.HeaderMatch.toObject(message.headers[j], options); + } + return object; + }; + + /** + * Converts this RouteMatch to JSON. + * @function toJSON + * @memberof google.cloud.networkservices.v1.GrpcRoute.RouteMatch + * @instance + * @returns {Object.} JSON object + */ + RouteMatch.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for RouteMatch + * @function getTypeUrl + * @memberof google.cloud.networkservices.v1.GrpcRoute.RouteMatch + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + RouteMatch.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.networkservices.v1.GrpcRoute.RouteMatch"; + }; + + return RouteMatch; + })(); + + GrpcRoute.Destination = (function() { + + /** + * Properties of a Destination. + * @memberof google.cloud.networkservices.v1.GrpcRoute + * @interface IDestination + * @property {string|null} [serviceName] Destination serviceName + * @property {number|null} [weight] Destination weight + */ + + /** + * Constructs a new Destination. + * @memberof google.cloud.networkservices.v1.GrpcRoute + * @classdesc Represents a Destination. + * @implements IDestination + * @constructor + * @param {google.cloud.networkservices.v1.GrpcRoute.IDestination=} [properties] Properties to set + */ + function Destination(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Destination serviceName. + * @member {string|null|undefined} serviceName + * @memberof google.cloud.networkservices.v1.GrpcRoute.Destination + * @instance + */ + Destination.prototype.serviceName = null; + + /** + * Destination weight. + * @member {number|null|undefined} weight + * @memberof google.cloud.networkservices.v1.GrpcRoute.Destination + * @instance + */ + Destination.prototype.weight = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * Destination destinationType. + * @member {"serviceName"|undefined} destinationType + * @memberof google.cloud.networkservices.v1.GrpcRoute.Destination + * @instance + */ + Object.defineProperty(Destination.prototype, "destinationType", { + get: $util.oneOfGetter($oneOfFields = ["serviceName"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Destination _weight. + * @member {"weight"|undefined} _weight + * @memberof google.cloud.networkservices.v1.GrpcRoute.Destination + * @instance + */ + Object.defineProperty(Destination.prototype, "_weight", { + get: $util.oneOfGetter($oneOfFields = ["weight"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new Destination instance using the specified properties. + * @function create + * @memberof google.cloud.networkservices.v1.GrpcRoute.Destination + * @static + * @param {google.cloud.networkservices.v1.GrpcRoute.IDestination=} [properties] Properties to set + * @returns {google.cloud.networkservices.v1.GrpcRoute.Destination} Destination instance + */ + Destination.create = function create(properties) { + return new Destination(properties); + }; + + /** + * Encodes the specified Destination message. Does not implicitly {@link google.cloud.networkservices.v1.GrpcRoute.Destination.verify|verify} messages. + * @function encode + * @memberof google.cloud.networkservices.v1.GrpcRoute.Destination + * @static + * @param {google.cloud.networkservices.v1.GrpcRoute.IDestination} message Destination message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Destination.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.serviceName != null && Object.hasOwnProperty.call(message, "serviceName")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.serviceName); + if (message.weight != null && Object.hasOwnProperty.call(message, "weight")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.weight); + return writer; + }; + + /** + * Encodes the specified Destination message, length delimited. Does not implicitly {@link google.cloud.networkservices.v1.GrpcRoute.Destination.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.networkservices.v1.GrpcRoute.Destination + * @static + * @param {google.cloud.networkservices.v1.GrpcRoute.IDestination} message Destination message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Destination.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Destination message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.networkservices.v1.GrpcRoute.Destination + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.networkservices.v1.GrpcRoute.Destination} Destination + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Destination.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.networkservices.v1.GrpcRoute.Destination(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.serviceName = reader.string(); + break; + } + case 2: { + message.weight = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Destination message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.networkservices.v1.GrpcRoute.Destination + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.networkservices.v1.GrpcRoute.Destination} Destination + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Destination.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Destination message. + * @function verify + * @memberof google.cloud.networkservices.v1.GrpcRoute.Destination + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Destination.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.serviceName != null && message.hasOwnProperty("serviceName")) { + properties.destinationType = 1; + if (!$util.isString(message.serviceName)) + return "serviceName: string expected"; + } + if (message.weight != null && message.hasOwnProperty("weight")) { + properties._weight = 1; + if (!$util.isInteger(message.weight)) + return "weight: integer expected"; + } + return null; + }; + + /** + * Creates a Destination message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.networkservices.v1.GrpcRoute.Destination + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.networkservices.v1.GrpcRoute.Destination} Destination + */ + Destination.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.networkservices.v1.GrpcRoute.Destination) + return object; + var message = new $root.google.cloud.networkservices.v1.GrpcRoute.Destination(); + if (object.serviceName != null) + message.serviceName = String(object.serviceName); + if (object.weight != null) + message.weight = object.weight | 0; + return message; + }; + + /** + * Creates a plain object from a Destination message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.networkservices.v1.GrpcRoute.Destination + * @static + * @param {google.cloud.networkservices.v1.GrpcRoute.Destination} message Destination + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Destination.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.serviceName != null && message.hasOwnProperty("serviceName")) { + object.serviceName = message.serviceName; + if (options.oneofs) + object.destinationType = "serviceName"; + } + if (message.weight != null && message.hasOwnProperty("weight")) { + object.weight = message.weight; + if (options.oneofs) + object._weight = "weight"; + } + return object; + }; + + /** + * Converts this Destination to JSON. + * @function toJSON + * @memberof google.cloud.networkservices.v1.GrpcRoute.Destination + * @instance + * @returns {Object.} JSON object + */ + Destination.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Destination + * @function getTypeUrl + * @memberof google.cloud.networkservices.v1.GrpcRoute.Destination + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Destination.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.networkservices.v1.GrpcRoute.Destination"; + }; + + return Destination; + })(); + + GrpcRoute.FaultInjectionPolicy = (function() { + + /** + * Properties of a FaultInjectionPolicy. + * @memberof google.cloud.networkservices.v1.GrpcRoute + * @interface IFaultInjectionPolicy + * @property {google.cloud.networkservices.v1.GrpcRoute.FaultInjectionPolicy.IDelay|null} [delay] FaultInjectionPolicy delay + * @property {google.cloud.networkservices.v1.GrpcRoute.FaultInjectionPolicy.IAbort|null} [abort] FaultInjectionPolicy abort + */ + + /** + * Constructs a new FaultInjectionPolicy. + * @memberof google.cloud.networkservices.v1.GrpcRoute + * @classdesc Represents a FaultInjectionPolicy. + * @implements IFaultInjectionPolicy + * @constructor + * @param {google.cloud.networkservices.v1.GrpcRoute.IFaultInjectionPolicy=} [properties] Properties to set + */ + function FaultInjectionPolicy(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * FaultInjectionPolicy delay. + * @member {google.cloud.networkservices.v1.GrpcRoute.FaultInjectionPolicy.IDelay|null|undefined} delay + * @memberof google.cloud.networkservices.v1.GrpcRoute.FaultInjectionPolicy + * @instance + */ + FaultInjectionPolicy.prototype.delay = null; + + /** + * FaultInjectionPolicy abort. + * @member {google.cloud.networkservices.v1.GrpcRoute.FaultInjectionPolicy.IAbort|null|undefined} abort + * @memberof google.cloud.networkservices.v1.GrpcRoute.FaultInjectionPolicy + * @instance + */ + FaultInjectionPolicy.prototype.abort = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * FaultInjectionPolicy _delay. + * @member {"delay"|undefined} _delay + * @memberof google.cloud.networkservices.v1.GrpcRoute.FaultInjectionPolicy + * @instance + */ + Object.defineProperty(FaultInjectionPolicy.prototype, "_delay", { + get: $util.oneOfGetter($oneOfFields = ["delay"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * FaultInjectionPolicy _abort. + * @member {"abort"|undefined} _abort + * @memberof google.cloud.networkservices.v1.GrpcRoute.FaultInjectionPolicy + * @instance + */ + Object.defineProperty(FaultInjectionPolicy.prototype, "_abort", { + get: $util.oneOfGetter($oneOfFields = ["abort"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new FaultInjectionPolicy instance using the specified properties. + * @function create + * @memberof google.cloud.networkservices.v1.GrpcRoute.FaultInjectionPolicy + * @static + * @param {google.cloud.networkservices.v1.GrpcRoute.IFaultInjectionPolicy=} [properties] Properties to set + * @returns {google.cloud.networkservices.v1.GrpcRoute.FaultInjectionPolicy} FaultInjectionPolicy instance + */ + FaultInjectionPolicy.create = function create(properties) { + return new FaultInjectionPolicy(properties); + }; + + /** + * Encodes the specified FaultInjectionPolicy message. Does not implicitly {@link google.cloud.networkservices.v1.GrpcRoute.FaultInjectionPolicy.verify|verify} messages. + * @function encode + * @memberof google.cloud.networkservices.v1.GrpcRoute.FaultInjectionPolicy + * @static + * @param {google.cloud.networkservices.v1.GrpcRoute.IFaultInjectionPolicy} message FaultInjectionPolicy message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FaultInjectionPolicy.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.delay != null && Object.hasOwnProperty.call(message, "delay")) + $root.google.cloud.networkservices.v1.GrpcRoute.FaultInjectionPolicy.Delay.encode(message.delay, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.abort != null && Object.hasOwnProperty.call(message, "abort")) + $root.google.cloud.networkservices.v1.GrpcRoute.FaultInjectionPolicy.Abort.encode(message.abort, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified FaultInjectionPolicy message, length delimited. Does not implicitly {@link google.cloud.networkservices.v1.GrpcRoute.FaultInjectionPolicy.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.networkservices.v1.GrpcRoute.FaultInjectionPolicy + * @static + * @param {google.cloud.networkservices.v1.GrpcRoute.IFaultInjectionPolicy} message FaultInjectionPolicy message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FaultInjectionPolicy.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a FaultInjectionPolicy message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.networkservices.v1.GrpcRoute.FaultInjectionPolicy + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.networkservices.v1.GrpcRoute.FaultInjectionPolicy} FaultInjectionPolicy + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FaultInjectionPolicy.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.networkservices.v1.GrpcRoute.FaultInjectionPolicy(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.delay = $root.google.cloud.networkservices.v1.GrpcRoute.FaultInjectionPolicy.Delay.decode(reader, reader.uint32()); + break; + } + case 2: { + message.abort = $root.google.cloud.networkservices.v1.GrpcRoute.FaultInjectionPolicy.Abort.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a FaultInjectionPolicy message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.networkservices.v1.GrpcRoute.FaultInjectionPolicy + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.networkservices.v1.GrpcRoute.FaultInjectionPolicy} FaultInjectionPolicy + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FaultInjectionPolicy.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a FaultInjectionPolicy message. + * @function verify + * @memberof google.cloud.networkservices.v1.GrpcRoute.FaultInjectionPolicy + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + FaultInjectionPolicy.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.delay != null && message.hasOwnProperty("delay")) { + properties._delay = 1; + { + var error = $root.google.cloud.networkservices.v1.GrpcRoute.FaultInjectionPolicy.Delay.verify(message.delay); + if (error) + return "delay." + error; + } + } + if (message.abort != null && message.hasOwnProperty("abort")) { + properties._abort = 1; + { + var error = $root.google.cloud.networkservices.v1.GrpcRoute.FaultInjectionPolicy.Abort.verify(message.abort); + if (error) + return "abort." + error; + } + } + return null; + }; + + /** + * Creates a FaultInjectionPolicy message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.networkservices.v1.GrpcRoute.FaultInjectionPolicy + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.networkservices.v1.GrpcRoute.FaultInjectionPolicy} FaultInjectionPolicy + */ + FaultInjectionPolicy.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.networkservices.v1.GrpcRoute.FaultInjectionPolicy) + return object; + var message = new $root.google.cloud.networkservices.v1.GrpcRoute.FaultInjectionPolicy(); + if (object.delay != null) { + if (typeof object.delay !== "object") + throw TypeError(".google.cloud.networkservices.v1.GrpcRoute.FaultInjectionPolicy.delay: object expected"); + message.delay = $root.google.cloud.networkservices.v1.GrpcRoute.FaultInjectionPolicy.Delay.fromObject(object.delay); + } + if (object.abort != null) { + if (typeof object.abort !== "object") + throw TypeError(".google.cloud.networkservices.v1.GrpcRoute.FaultInjectionPolicy.abort: object expected"); + message.abort = $root.google.cloud.networkservices.v1.GrpcRoute.FaultInjectionPolicy.Abort.fromObject(object.abort); + } + return message; + }; + + /** + * Creates a plain object from a FaultInjectionPolicy message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.networkservices.v1.GrpcRoute.FaultInjectionPolicy + * @static + * @param {google.cloud.networkservices.v1.GrpcRoute.FaultInjectionPolicy} message FaultInjectionPolicy + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + FaultInjectionPolicy.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.delay != null && message.hasOwnProperty("delay")) { + object.delay = $root.google.cloud.networkservices.v1.GrpcRoute.FaultInjectionPolicy.Delay.toObject(message.delay, options); + if (options.oneofs) + object._delay = "delay"; + } + if (message.abort != null && message.hasOwnProperty("abort")) { + object.abort = $root.google.cloud.networkservices.v1.GrpcRoute.FaultInjectionPolicy.Abort.toObject(message.abort, options); + if (options.oneofs) + object._abort = "abort"; + } + return object; + }; + + /** + * Converts this FaultInjectionPolicy to JSON. + * @function toJSON + * @memberof google.cloud.networkservices.v1.GrpcRoute.FaultInjectionPolicy + * @instance + * @returns {Object.} JSON object + */ + FaultInjectionPolicy.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for FaultInjectionPolicy + * @function getTypeUrl + * @memberof google.cloud.networkservices.v1.GrpcRoute.FaultInjectionPolicy + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FaultInjectionPolicy.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.networkservices.v1.GrpcRoute.FaultInjectionPolicy"; + }; + + FaultInjectionPolicy.Delay = (function() { + + /** + * Properties of a Delay. + * @memberof google.cloud.networkservices.v1.GrpcRoute.FaultInjectionPolicy + * @interface IDelay + * @property {google.protobuf.IDuration|null} [fixedDelay] Delay fixedDelay + * @property {number|null} [percentage] Delay percentage + */ + + /** + * Constructs a new Delay. + * @memberof google.cloud.networkservices.v1.GrpcRoute.FaultInjectionPolicy + * @classdesc Represents a Delay. + * @implements IDelay + * @constructor + * @param {google.cloud.networkservices.v1.GrpcRoute.FaultInjectionPolicy.IDelay=} [properties] Properties to set + */ + function Delay(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Delay fixedDelay. + * @member {google.protobuf.IDuration|null|undefined} fixedDelay + * @memberof google.cloud.networkservices.v1.GrpcRoute.FaultInjectionPolicy.Delay + * @instance + */ + Delay.prototype.fixedDelay = null; + + /** + * Delay percentage. + * @member {number|null|undefined} percentage + * @memberof google.cloud.networkservices.v1.GrpcRoute.FaultInjectionPolicy.Delay + * @instance + */ + Delay.prototype.percentage = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * Delay _fixedDelay. + * @member {"fixedDelay"|undefined} _fixedDelay + * @memberof google.cloud.networkservices.v1.GrpcRoute.FaultInjectionPolicy.Delay + * @instance + */ + Object.defineProperty(Delay.prototype, "_fixedDelay", { + get: $util.oneOfGetter($oneOfFields = ["fixedDelay"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Delay _percentage. + * @member {"percentage"|undefined} _percentage + * @memberof google.cloud.networkservices.v1.GrpcRoute.FaultInjectionPolicy.Delay + * @instance + */ + Object.defineProperty(Delay.prototype, "_percentage", { + get: $util.oneOfGetter($oneOfFields = ["percentage"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new Delay instance using the specified properties. + * @function create + * @memberof google.cloud.networkservices.v1.GrpcRoute.FaultInjectionPolicy.Delay + * @static + * @param {google.cloud.networkservices.v1.GrpcRoute.FaultInjectionPolicy.IDelay=} [properties] Properties to set + * @returns {google.cloud.networkservices.v1.GrpcRoute.FaultInjectionPolicy.Delay} Delay instance + */ + Delay.create = function create(properties) { + return new Delay(properties); + }; + + /** + * Encodes the specified Delay message. Does not implicitly {@link google.cloud.networkservices.v1.GrpcRoute.FaultInjectionPolicy.Delay.verify|verify} messages. + * @function encode + * @memberof google.cloud.networkservices.v1.GrpcRoute.FaultInjectionPolicy.Delay + * @static + * @param {google.cloud.networkservices.v1.GrpcRoute.FaultInjectionPolicy.IDelay} message Delay message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Delay.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.fixedDelay != null && Object.hasOwnProperty.call(message, "fixedDelay")) + $root.google.protobuf.Duration.encode(message.fixedDelay, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.percentage != null && Object.hasOwnProperty.call(message, "percentage")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.percentage); + return writer; + }; + + /** + * Encodes the specified Delay message, length delimited. Does not implicitly {@link google.cloud.networkservices.v1.GrpcRoute.FaultInjectionPolicy.Delay.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.networkservices.v1.GrpcRoute.FaultInjectionPolicy.Delay + * @static + * @param {google.cloud.networkservices.v1.GrpcRoute.FaultInjectionPolicy.IDelay} message Delay message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Delay.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Delay message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.networkservices.v1.GrpcRoute.FaultInjectionPolicy.Delay + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.networkservices.v1.GrpcRoute.FaultInjectionPolicy.Delay} Delay + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Delay.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.networkservices.v1.GrpcRoute.FaultInjectionPolicy.Delay(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.fixedDelay = $root.google.protobuf.Duration.decode(reader, reader.uint32()); + break; + } + case 2: { + message.percentage = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Delay message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.networkservices.v1.GrpcRoute.FaultInjectionPolicy.Delay + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.networkservices.v1.GrpcRoute.FaultInjectionPolicy.Delay} Delay + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Delay.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Delay message. + * @function verify + * @memberof google.cloud.networkservices.v1.GrpcRoute.FaultInjectionPolicy.Delay + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Delay.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.fixedDelay != null && message.hasOwnProperty("fixedDelay")) { + properties._fixedDelay = 1; + { + var error = $root.google.protobuf.Duration.verify(message.fixedDelay); + if (error) + return "fixedDelay." + error; + } + } + if (message.percentage != null && message.hasOwnProperty("percentage")) { + properties._percentage = 1; + if (!$util.isInteger(message.percentage)) + return "percentage: integer expected"; + } + return null; + }; + + /** + * Creates a Delay message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.networkservices.v1.GrpcRoute.FaultInjectionPolicy.Delay + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.networkservices.v1.GrpcRoute.FaultInjectionPolicy.Delay} Delay + */ + Delay.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.networkservices.v1.GrpcRoute.FaultInjectionPolicy.Delay) + return object; + var message = new $root.google.cloud.networkservices.v1.GrpcRoute.FaultInjectionPolicy.Delay(); + if (object.fixedDelay != null) { + if (typeof object.fixedDelay !== "object") + throw TypeError(".google.cloud.networkservices.v1.GrpcRoute.FaultInjectionPolicy.Delay.fixedDelay: object expected"); + message.fixedDelay = $root.google.protobuf.Duration.fromObject(object.fixedDelay); + } + if (object.percentage != null) + message.percentage = object.percentage | 0; + return message; + }; + + /** + * Creates a plain object from a Delay message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.networkservices.v1.GrpcRoute.FaultInjectionPolicy.Delay + * @static + * @param {google.cloud.networkservices.v1.GrpcRoute.FaultInjectionPolicy.Delay} message Delay + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Delay.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.fixedDelay != null && message.hasOwnProperty("fixedDelay")) { + object.fixedDelay = $root.google.protobuf.Duration.toObject(message.fixedDelay, options); + if (options.oneofs) + object._fixedDelay = "fixedDelay"; + } + if (message.percentage != null && message.hasOwnProperty("percentage")) { + object.percentage = message.percentage; + if (options.oneofs) + object._percentage = "percentage"; + } + return object; + }; + + /** + * Converts this Delay to JSON. + * @function toJSON + * @memberof google.cloud.networkservices.v1.GrpcRoute.FaultInjectionPolicy.Delay + * @instance + * @returns {Object.} JSON object + */ + Delay.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Delay + * @function getTypeUrl + * @memberof google.cloud.networkservices.v1.GrpcRoute.FaultInjectionPolicy.Delay + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Delay.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.networkservices.v1.GrpcRoute.FaultInjectionPolicy.Delay"; + }; + + return Delay; + })(); + + FaultInjectionPolicy.Abort = (function() { + + /** + * Properties of an Abort. + * @memberof google.cloud.networkservices.v1.GrpcRoute.FaultInjectionPolicy + * @interface IAbort + * @property {number|null} [httpStatus] Abort httpStatus + * @property {number|null} [percentage] Abort percentage + */ + + /** + * Constructs a new Abort. + * @memberof google.cloud.networkservices.v1.GrpcRoute.FaultInjectionPolicy + * @classdesc Represents an Abort. + * @implements IAbort + * @constructor + * @param {google.cloud.networkservices.v1.GrpcRoute.FaultInjectionPolicy.IAbort=} [properties] Properties to set + */ + function Abort(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Abort httpStatus. + * @member {number|null|undefined} httpStatus + * @memberof google.cloud.networkservices.v1.GrpcRoute.FaultInjectionPolicy.Abort + * @instance + */ + Abort.prototype.httpStatus = null; + + /** + * Abort percentage. + * @member {number|null|undefined} percentage + * @memberof google.cloud.networkservices.v1.GrpcRoute.FaultInjectionPolicy.Abort + * @instance + */ + Abort.prototype.percentage = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * Abort _httpStatus. + * @member {"httpStatus"|undefined} _httpStatus + * @memberof google.cloud.networkservices.v1.GrpcRoute.FaultInjectionPolicy.Abort + * @instance + */ + Object.defineProperty(Abort.prototype, "_httpStatus", { + get: $util.oneOfGetter($oneOfFields = ["httpStatus"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Abort _percentage. + * @member {"percentage"|undefined} _percentage + * @memberof google.cloud.networkservices.v1.GrpcRoute.FaultInjectionPolicy.Abort + * @instance + */ + Object.defineProperty(Abort.prototype, "_percentage", { + get: $util.oneOfGetter($oneOfFields = ["percentage"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new Abort instance using the specified properties. + * @function create + * @memberof google.cloud.networkservices.v1.GrpcRoute.FaultInjectionPolicy.Abort + * @static + * @param {google.cloud.networkservices.v1.GrpcRoute.FaultInjectionPolicy.IAbort=} [properties] Properties to set + * @returns {google.cloud.networkservices.v1.GrpcRoute.FaultInjectionPolicy.Abort} Abort instance + */ + Abort.create = function create(properties) { + return new Abort(properties); + }; + + /** + * Encodes the specified Abort message. Does not implicitly {@link google.cloud.networkservices.v1.GrpcRoute.FaultInjectionPolicy.Abort.verify|verify} messages. + * @function encode + * @memberof google.cloud.networkservices.v1.GrpcRoute.FaultInjectionPolicy.Abort + * @static + * @param {google.cloud.networkservices.v1.GrpcRoute.FaultInjectionPolicy.IAbort} message Abort message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Abort.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.httpStatus != null && Object.hasOwnProperty.call(message, "httpStatus")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.httpStatus); + if (message.percentage != null && Object.hasOwnProperty.call(message, "percentage")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.percentage); + return writer; + }; + + /** + * Encodes the specified Abort message, length delimited. Does not implicitly {@link google.cloud.networkservices.v1.GrpcRoute.FaultInjectionPolicy.Abort.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.networkservices.v1.GrpcRoute.FaultInjectionPolicy.Abort + * @static + * @param {google.cloud.networkservices.v1.GrpcRoute.FaultInjectionPolicy.IAbort} message Abort message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Abort.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an Abort message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.networkservices.v1.GrpcRoute.FaultInjectionPolicy.Abort + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.networkservices.v1.GrpcRoute.FaultInjectionPolicy.Abort} Abort + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Abort.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.networkservices.v1.GrpcRoute.FaultInjectionPolicy.Abort(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.httpStatus = reader.int32(); + break; + } + case 2: { + message.percentage = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an Abort message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.networkservices.v1.GrpcRoute.FaultInjectionPolicy.Abort + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.networkservices.v1.GrpcRoute.FaultInjectionPolicy.Abort} Abort + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Abort.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an Abort message. + * @function verify + * @memberof google.cloud.networkservices.v1.GrpcRoute.FaultInjectionPolicy.Abort + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Abort.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.httpStatus != null && message.hasOwnProperty("httpStatus")) { + properties._httpStatus = 1; + if (!$util.isInteger(message.httpStatus)) + return "httpStatus: integer expected"; + } + if (message.percentage != null && message.hasOwnProperty("percentage")) { + properties._percentage = 1; + if (!$util.isInteger(message.percentage)) + return "percentage: integer expected"; + } + return null; + }; + + /** + * Creates an Abort message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.networkservices.v1.GrpcRoute.FaultInjectionPolicy.Abort + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.networkservices.v1.GrpcRoute.FaultInjectionPolicy.Abort} Abort + */ + Abort.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.networkservices.v1.GrpcRoute.FaultInjectionPolicy.Abort) + return object; + var message = new $root.google.cloud.networkservices.v1.GrpcRoute.FaultInjectionPolicy.Abort(); + if (object.httpStatus != null) + message.httpStatus = object.httpStatus | 0; + if (object.percentage != null) + message.percentage = object.percentage | 0; + return message; + }; + + /** + * Creates a plain object from an Abort message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.networkservices.v1.GrpcRoute.FaultInjectionPolicy.Abort + * @static + * @param {google.cloud.networkservices.v1.GrpcRoute.FaultInjectionPolicy.Abort} message Abort + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Abort.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.httpStatus != null && message.hasOwnProperty("httpStatus")) { + object.httpStatus = message.httpStatus; + if (options.oneofs) + object._httpStatus = "httpStatus"; + } + if (message.percentage != null && message.hasOwnProperty("percentage")) { + object.percentage = message.percentage; + if (options.oneofs) + object._percentage = "percentage"; + } + return object; + }; + + /** + * Converts this Abort to JSON. + * @function toJSON + * @memberof google.cloud.networkservices.v1.GrpcRoute.FaultInjectionPolicy.Abort + * @instance + * @returns {Object.} JSON object + */ + Abort.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Abort + * @function getTypeUrl + * @memberof google.cloud.networkservices.v1.GrpcRoute.FaultInjectionPolicy.Abort + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Abort.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.networkservices.v1.GrpcRoute.FaultInjectionPolicy.Abort"; + }; + + return Abort; + })(); + + return FaultInjectionPolicy; + })(); + + GrpcRoute.RetryPolicy = (function() { + + /** + * Properties of a RetryPolicy. + * @memberof google.cloud.networkservices.v1.GrpcRoute + * @interface IRetryPolicy + * @property {Array.|null} [retryConditions] RetryPolicy retryConditions + * @property {number|null} [numRetries] RetryPolicy numRetries + */ + + /** + * Constructs a new RetryPolicy. + * @memberof google.cloud.networkservices.v1.GrpcRoute + * @classdesc Represents a RetryPolicy. + * @implements IRetryPolicy + * @constructor + * @param {google.cloud.networkservices.v1.GrpcRoute.IRetryPolicy=} [properties] Properties to set + */ + function RetryPolicy(properties) { + this.retryConditions = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * RetryPolicy retryConditions. + * @member {Array.} retryConditions + * @memberof google.cloud.networkservices.v1.GrpcRoute.RetryPolicy + * @instance + */ + RetryPolicy.prototype.retryConditions = $util.emptyArray; + + /** + * RetryPolicy numRetries. + * @member {number} numRetries + * @memberof google.cloud.networkservices.v1.GrpcRoute.RetryPolicy + * @instance + */ + RetryPolicy.prototype.numRetries = 0; + + /** + * Creates a new RetryPolicy instance using the specified properties. + * @function create + * @memberof google.cloud.networkservices.v1.GrpcRoute.RetryPolicy + * @static + * @param {google.cloud.networkservices.v1.GrpcRoute.IRetryPolicy=} [properties] Properties to set + * @returns {google.cloud.networkservices.v1.GrpcRoute.RetryPolicy} RetryPolicy instance + */ + RetryPolicy.create = function create(properties) { + return new RetryPolicy(properties); + }; + + /** + * Encodes the specified RetryPolicy message. Does not implicitly {@link google.cloud.networkservices.v1.GrpcRoute.RetryPolicy.verify|verify} messages. + * @function encode + * @memberof google.cloud.networkservices.v1.GrpcRoute.RetryPolicy + * @static + * @param {google.cloud.networkservices.v1.GrpcRoute.IRetryPolicy} message RetryPolicy message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RetryPolicy.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.retryConditions != null && message.retryConditions.length) + for (var i = 0; i < message.retryConditions.length; ++i) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.retryConditions[i]); + if (message.numRetries != null && Object.hasOwnProperty.call(message, "numRetries")) + writer.uint32(/* id 2, wireType 0 =*/16).uint32(message.numRetries); + return writer; + }; + + /** + * Encodes the specified RetryPolicy message, length delimited. Does not implicitly {@link google.cloud.networkservices.v1.GrpcRoute.RetryPolicy.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.networkservices.v1.GrpcRoute.RetryPolicy + * @static + * @param {google.cloud.networkservices.v1.GrpcRoute.IRetryPolicy} message RetryPolicy message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RetryPolicy.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a RetryPolicy message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.networkservices.v1.GrpcRoute.RetryPolicy + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.networkservices.v1.GrpcRoute.RetryPolicy} RetryPolicy + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RetryPolicy.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.networkservices.v1.GrpcRoute.RetryPolicy(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.retryConditions && message.retryConditions.length)) + message.retryConditions = []; + message.retryConditions.push(reader.string()); + break; + } + case 2: { + message.numRetries = reader.uint32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a RetryPolicy message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.networkservices.v1.GrpcRoute.RetryPolicy + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.networkservices.v1.GrpcRoute.RetryPolicy} RetryPolicy + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RetryPolicy.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a RetryPolicy message. + * @function verify + * @memberof google.cloud.networkservices.v1.GrpcRoute.RetryPolicy + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + RetryPolicy.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.retryConditions != null && message.hasOwnProperty("retryConditions")) { + if (!Array.isArray(message.retryConditions)) + return "retryConditions: array expected"; + for (var i = 0; i < message.retryConditions.length; ++i) + if (!$util.isString(message.retryConditions[i])) + return "retryConditions: string[] expected"; + } + if (message.numRetries != null && message.hasOwnProperty("numRetries")) + if (!$util.isInteger(message.numRetries)) + return "numRetries: integer expected"; + return null; + }; + + /** + * Creates a RetryPolicy message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.networkservices.v1.GrpcRoute.RetryPolicy + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.networkservices.v1.GrpcRoute.RetryPolicy} RetryPolicy + */ + RetryPolicy.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.networkservices.v1.GrpcRoute.RetryPolicy) + return object; + var message = new $root.google.cloud.networkservices.v1.GrpcRoute.RetryPolicy(); + if (object.retryConditions) { + if (!Array.isArray(object.retryConditions)) + throw TypeError(".google.cloud.networkservices.v1.GrpcRoute.RetryPolicy.retryConditions: array expected"); + message.retryConditions = []; + for (var i = 0; i < object.retryConditions.length; ++i) + message.retryConditions[i] = String(object.retryConditions[i]); + } + if (object.numRetries != null) + message.numRetries = object.numRetries >>> 0; + return message; + }; + + /** + * Creates a plain object from a RetryPolicy message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.networkservices.v1.GrpcRoute.RetryPolicy + * @static + * @param {google.cloud.networkservices.v1.GrpcRoute.RetryPolicy} message RetryPolicy + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + RetryPolicy.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.retryConditions = []; + if (options.defaults) + object.numRetries = 0; + if (message.retryConditions && message.retryConditions.length) { + object.retryConditions = []; + for (var j = 0; j < message.retryConditions.length; ++j) + object.retryConditions[j] = message.retryConditions[j]; + } + if (message.numRetries != null && message.hasOwnProperty("numRetries")) + object.numRetries = message.numRetries; + return object; + }; + + /** + * Converts this RetryPolicy to JSON. + * @function toJSON + * @memberof google.cloud.networkservices.v1.GrpcRoute.RetryPolicy + * @instance + * @returns {Object.} JSON object + */ + RetryPolicy.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for RetryPolicy + * @function getTypeUrl + * @memberof google.cloud.networkservices.v1.GrpcRoute.RetryPolicy + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + RetryPolicy.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.networkservices.v1.GrpcRoute.RetryPolicy"; + }; + + return RetryPolicy; + })(); + + GrpcRoute.RouteAction = (function() { + + /** + * Properties of a RouteAction. + * @memberof google.cloud.networkservices.v1.GrpcRoute + * @interface IRouteAction + * @property {Array.|null} [destinations] RouteAction destinations + * @property {google.cloud.networkservices.v1.GrpcRoute.IFaultInjectionPolicy|null} [faultInjectionPolicy] RouteAction faultInjectionPolicy + * @property {google.protobuf.IDuration|null} [timeout] RouteAction timeout + * @property {google.cloud.networkservices.v1.GrpcRoute.IRetryPolicy|null} [retryPolicy] RouteAction retryPolicy + */ + + /** + * Constructs a new RouteAction. + * @memberof google.cloud.networkservices.v1.GrpcRoute + * @classdesc Represents a RouteAction. + * @implements IRouteAction + * @constructor + * @param {google.cloud.networkservices.v1.GrpcRoute.IRouteAction=} [properties] Properties to set + */ + function RouteAction(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]]; + } + + /** + * RouteAction destinations. + * @member {Array.} destinations + * @memberof google.cloud.networkservices.v1.GrpcRoute.RouteAction + * @instance + */ + RouteAction.prototype.destinations = $util.emptyArray; + + /** + * RouteAction faultInjectionPolicy. + * @member {google.cloud.networkservices.v1.GrpcRoute.IFaultInjectionPolicy|null|undefined} faultInjectionPolicy + * @memberof google.cloud.networkservices.v1.GrpcRoute.RouteAction + * @instance + */ + RouteAction.prototype.faultInjectionPolicy = null; + + /** + * RouteAction timeout. + * @member {google.protobuf.IDuration|null|undefined} timeout + * @memberof google.cloud.networkservices.v1.GrpcRoute.RouteAction + * @instance + */ + RouteAction.prototype.timeout = null; + + /** + * RouteAction retryPolicy. + * @member {google.cloud.networkservices.v1.GrpcRoute.IRetryPolicy|null|undefined} retryPolicy + * @memberof google.cloud.networkservices.v1.GrpcRoute.RouteAction + * @instance + */ + RouteAction.prototype.retryPolicy = null; + + /** + * Creates a new RouteAction instance using the specified properties. + * @function create + * @memberof google.cloud.networkservices.v1.GrpcRoute.RouteAction + * @static + * @param {google.cloud.networkservices.v1.GrpcRoute.IRouteAction=} [properties] Properties to set + * @returns {google.cloud.networkservices.v1.GrpcRoute.RouteAction} RouteAction instance + */ + RouteAction.create = function create(properties) { + return new RouteAction(properties); + }; + + /** + * Encodes the specified RouteAction message. Does not implicitly {@link google.cloud.networkservices.v1.GrpcRoute.RouteAction.verify|verify} messages. + * @function encode + * @memberof google.cloud.networkservices.v1.GrpcRoute.RouteAction + * @static + * @param {google.cloud.networkservices.v1.GrpcRoute.IRouteAction} message RouteAction message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RouteAction.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.destinations != null && message.destinations.length) + for (var i = 0; i < message.destinations.length; ++i) + $root.google.cloud.networkservices.v1.GrpcRoute.Destination.encode(message.destinations[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.faultInjectionPolicy != null && Object.hasOwnProperty.call(message, "faultInjectionPolicy")) + $root.google.cloud.networkservices.v1.GrpcRoute.FaultInjectionPolicy.encode(message.faultInjectionPolicy, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.timeout != null && Object.hasOwnProperty.call(message, "timeout")) + $root.google.protobuf.Duration.encode(message.timeout, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + if (message.retryPolicy != null && Object.hasOwnProperty.call(message, "retryPolicy")) + $root.google.cloud.networkservices.v1.GrpcRoute.RetryPolicy.encode(message.retryPolicy, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified RouteAction message, length delimited. Does not implicitly {@link google.cloud.networkservices.v1.GrpcRoute.RouteAction.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.networkservices.v1.GrpcRoute.RouteAction + * @static + * @param {google.cloud.networkservices.v1.GrpcRoute.IRouteAction} message RouteAction message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RouteAction.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a RouteAction message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.networkservices.v1.GrpcRoute.RouteAction + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.networkservices.v1.GrpcRoute.RouteAction} RouteAction + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RouteAction.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.networkservices.v1.GrpcRoute.RouteAction(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.destinations && message.destinations.length)) + message.destinations = []; + message.destinations.push($root.google.cloud.networkservices.v1.GrpcRoute.Destination.decode(reader, reader.uint32())); + break; + } + case 3: { + message.faultInjectionPolicy = $root.google.cloud.networkservices.v1.GrpcRoute.FaultInjectionPolicy.decode(reader, reader.uint32()); + break; + } + case 7: { + message.timeout = $root.google.protobuf.Duration.decode(reader, reader.uint32()); + break; + } + case 8: { + message.retryPolicy = $root.google.cloud.networkservices.v1.GrpcRoute.RetryPolicy.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a RouteAction message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.networkservices.v1.GrpcRoute.RouteAction + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.networkservices.v1.GrpcRoute.RouteAction} RouteAction + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RouteAction.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a RouteAction message. + * @function verify + * @memberof google.cloud.networkservices.v1.GrpcRoute.RouteAction + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + RouteAction.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object 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) { + var error = $root.google.cloud.networkservices.v1.GrpcRoute.Destination.verify(message.destinations[i]); + if (error) + return "destinations." + error; + } + } + if (message.faultInjectionPolicy != null && message.hasOwnProperty("faultInjectionPolicy")) { + var error = $root.google.cloud.networkservices.v1.GrpcRoute.FaultInjectionPolicy.verify(message.faultInjectionPolicy); + if (error) + return "faultInjectionPolicy." + error; + } + if (message.timeout != null && message.hasOwnProperty("timeout")) { + var error = $root.google.protobuf.Duration.verify(message.timeout); + if (error) + return "timeout." + error; + } + if (message.retryPolicy != null && message.hasOwnProperty("retryPolicy")) { + var error = $root.google.cloud.networkservices.v1.GrpcRoute.RetryPolicy.verify(message.retryPolicy); + if (error) + return "retryPolicy." + error; + } + return null; + }; + + /** + * Creates a RouteAction message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.networkservices.v1.GrpcRoute.RouteAction + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.networkservices.v1.GrpcRoute.RouteAction} RouteAction + */ + RouteAction.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.networkservices.v1.GrpcRoute.RouteAction) + return object; + var message = new $root.google.cloud.networkservices.v1.GrpcRoute.RouteAction(); + if (object.destinations) { + if (!Array.isArray(object.destinations)) + throw TypeError(".google.cloud.networkservices.v1.GrpcRoute.RouteAction.destinations: array expected"); + message.destinations = []; + for (var i = 0; i < object.destinations.length; ++i) { + if (typeof object.destinations[i] !== "object") + throw TypeError(".google.cloud.networkservices.v1.GrpcRoute.RouteAction.destinations: object expected"); + message.destinations[i] = $root.google.cloud.networkservices.v1.GrpcRoute.Destination.fromObject(object.destinations[i]); + } + } + if (object.faultInjectionPolicy != null) { + if (typeof object.faultInjectionPolicy !== "object") + throw TypeError(".google.cloud.networkservices.v1.GrpcRoute.RouteAction.faultInjectionPolicy: object expected"); + message.faultInjectionPolicy = $root.google.cloud.networkservices.v1.GrpcRoute.FaultInjectionPolicy.fromObject(object.faultInjectionPolicy); + } + if (object.timeout != null) { + if (typeof object.timeout !== "object") + throw TypeError(".google.cloud.networkservices.v1.GrpcRoute.RouteAction.timeout: object expected"); + message.timeout = $root.google.protobuf.Duration.fromObject(object.timeout); + } + if (object.retryPolicy != null) { + if (typeof object.retryPolicy !== "object") + throw TypeError(".google.cloud.networkservices.v1.GrpcRoute.RouteAction.retryPolicy: object expected"); + message.retryPolicy = $root.google.cloud.networkservices.v1.GrpcRoute.RetryPolicy.fromObject(object.retryPolicy); + } + return message; + }; + + /** + * Creates a plain object from a RouteAction message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.networkservices.v1.GrpcRoute.RouteAction + * @static + * @param {google.cloud.networkservices.v1.GrpcRoute.RouteAction} message RouteAction + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + RouteAction.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.destinations = []; + if (options.defaults) { + object.faultInjectionPolicy = null; + object.timeout = null; + object.retryPolicy = null; + } + if (message.destinations && message.destinations.length) { + object.destinations = []; + for (var j = 0; j < message.destinations.length; ++j) + object.destinations[j] = $root.google.cloud.networkservices.v1.GrpcRoute.Destination.toObject(message.destinations[j], options); + } + if (message.faultInjectionPolicy != null && message.hasOwnProperty("faultInjectionPolicy")) + object.faultInjectionPolicy = $root.google.cloud.networkservices.v1.GrpcRoute.FaultInjectionPolicy.toObject(message.faultInjectionPolicy, options); + if (message.timeout != null && message.hasOwnProperty("timeout")) + object.timeout = $root.google.protobuf.Duration.toObject(message.timeout, options); + if (message.retryPolicy != null && message.hasOwnProperty("retryPolicy")) + object.retryPolicy = $root.google.cloud.networkservices.v1.GrpcRoute.RetryPolicy.toObject(message.retryPolicy, options); + return object; + }; + + /** + * Converts this RouteAction to JSON. + * @function toJSON + * @memberof google.cloud.networkservices.v1.GrpcRoute.RouteAction + * @instance + * @returns {Object.} JSON object + */ + RouteAction.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for RouteAction + * @function getTypeUrl + * @memberof google.cloud.networkservices.v1.GrpcRoute.RouteAction + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + RouteAction.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.networkservices.v1.GrpcRoute.RouteAction"; + }; + + return RouteAction; + })(); + + GrpcRoute.RouteRule = (function() { + + /** + * Properties of a RouteRule. + * @memberof google.cloud.networkservices.v1.GrpcRoute + * @interface IRouteRule + * @property {Array.|null} [matches] RouteRule matches + * @property {google.cloud.networkservices.v1.GrpcRoute.IRouteAction|null} [action] RouteRule action + */ + + /** + * Constructs a new RouteRule. + * @memberof google.cloud.networkservices.v1.GrpcRoute + * @classdesc Represents a RouteRule. + * @implements IRouteRule + * @constructor + * @param {google.cloud.networkservices.v1.GrpcRoute.IRouteRule=} [properties] Properties to set + */ + function RouteRule(properties) { + this.matches = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * RouteRule matches. + * @member {Array.} matches + * @memberof google.cloud.networkservices.v1.GrpcRoute.RouteRule + * @instance + */ + RouteRule.prototype.matches = $util.emptyArray; + + /** + * RouteRule action. + * @member {google.cloud.networkservices.v1.GrpcRoute.IRouteAction|null|undefined} action + * @memberof google.cloud.networkservices.v1.GrpcRoute.RouteRule + * @instance + */ + RouteRule.prototype.action = null; + + /** + * Creates a new RouteRule instance using the specified properties. + * @function create + * @memberof google.cloud.networkservices.v1.GrpcRoute.RouteRule + * @static + * @param {google.cloud.networkservices.v1.GrpcRoute.IRouteRule=} [properties] Properties to set + * @returns {google.cloud.networkservices.v1.GrpcRoute.RouteRule} RouteRule instance + */ + RouteRule.create = function create(properties) { + return new RouteRule(properties); + }; + + /** + * Encodes the specified RouteRule message. Does not implicitly {@link google.cloud.networkservices.v1.GrpcRoute.RouteRule.verify|verify} messages. + * @function encode + * @memberof google.cloud.networkservices.v1.GrpcRoute.RouteRule + * @static + * @param {google.cloud.networkservices.v1.GrpcRoute.IRouteRule} message RouteRule message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RouteRule.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.matches != null && message.matches.length) + for (var i = 0; i < message.matches.length; ++i) + $root.google.cloud.networkservices.v1.GrpcRoute.RouteMatch.encode(message.matches[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.action != null && Object.hasOwnProperty.call(message, "action")) + $root.google.cloud.networkservices.v1.GrpcRoute.RouteAction.encode(message.action, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified RouteRule message, length delimited. Does not implicitly {@link google.cloud.networkservices.v1.GrpcRoute.RouteRule.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.networkservices.v1.GrpcRoute.RouteRule + * @static + * @param {google.cloud.networkservices.v1.GrpcRoute.IRouteRule} message RouteRule message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RouteRule.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a RouteRule message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.networkservices.v1.GrpcRoute.RouteRule + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.networkservices.v1.GrpcRoute.RouteRule} RouteRule + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RouteRule.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.networkservices.v1.GrpcRoute.RouteRule(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.matches && message.matches.length)) + message.matches = []; + message.matches.push($root.google.cloud.networkservices.v1.GrpcRoute.RouteMatch.decode(reader, reader.uint32())); + break; + } + case 2: { + message.action = $root.google.cloud.networkservices.v1.GrpcRoute.RouteAction.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a RouteRule message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.networkservices.v1.GrpcRoute.RouteRule + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.networkservices.v1.GrpcRoute.RouteRule} RouteRule + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RouteRule.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a RouteRule message. + * @function verify + * @memberof google.cloud.networkservices.v1.GrpcRoute.RouteRule + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + RouteRule.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.matches != null && message.hasOwnProperty("matches")) { + if (!Array.isArray(message.matches)) + return "matches: array expected"; + for (var i = 0; i < message.matches.length; ++i) { + var error = $root.google.cloud.networkservices.v1.GrpcRoute.RouteMatch.verify(message.matches[i]); + if (error) + return "matches." + error; + } + } + if (message.action != null && message.hasOwnProperty("action")) { + var error = $root.google.cloud.networkservices.v1.GrpcRoute.RouteAction.verify(message.action); + if (error) + return "action." + error; + } + return null; + }; + + /** + * Creates a RouteRule message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.networkservices.v1.GrpcRoute.RouteRule + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.networkservices.v1.GrpcRoute.RouteRule} RouteRule + */ + RouteRule.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.networkservices.v1.GrpcRoute.RouteRule) + return object; + var message = new $root.google.cloud.networkservices.v1.GrpcRoute.RouteRule(); + if (object.matches) { + if (!Array.isArray(object.matches)) + throw TypeError(".google.cloud.networkservices.v1.GrpcRoute.RouteRule.matches: array expected"); + message.matches = []; + for (var i = 0; i < object.matches.length; ++i) { + if (typeof object.matches[i] !== "object") + throw TypeError(".google.cloud.networkservices.v1.GrpcRoute.RouteRule.matches: object expected"); + message.matches[i] = $root.google.cloud.networkservices.v1.GrpcRoute.RouteMatch.fromObject(object.matches[i]); + } + } + if (object.action != null) { + if (typeof object.action !== "object") + throw TypeError(".google.cloud.networkservices.v1.GrpcRoute.RouteRule.action: object expected"); + message.action = $root.google.cloud.networkservices.v1.GrpcRoute.RouteAction.fromObject(object.action); + } + return message; + }; + + /** + * Creates a plain object from a RouteRule message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.networkservices.v1.GrpcRoute.RouteRule + * @static + * @param {google.cloud.networkservices.v1.GrpcRoute.RouteRule} message RouteRule + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + RouteRule.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.matches = []; + if (options.defaults) + object.action = null; + if (message.matches && message.matches.length) { + object.matches = []; + for (var j = 0; j < message.matches.length; ++j) + object.matches[j] = $root.google.cloud.networkservices.v1.GrpcRoute.RouteMatch.toObject(message.matches[j], options); + } + if (message.action != null && message.hasOwnProperty("action")) + object.action = $root.google.cloud.networkservices.v1.GrpcRoute.RouteAction.toObject(message.action, options); + return object; + }; + + /** + * Converts this RouteRule to JSON. + * @function toJSON + * @memberof google.cloud.networkservices.v1.GrpcRoute.RouteRule + * @instance + * @returns {Object.} JSON object + */ + RouteRule.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for RouteRule + * @function getTypeUrl + * @memberof google.cloud.networkservices.v1.GrpcRoute.RouteRule + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + RouteRule.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.networkservices.v1.GrpcRoute.RouteRule"; + }; + + return RouteRule; + })(); + + return GrpcRoute; + })(); + + v1.ListGrpcRoutesRequest = (function() { + + /** + * Properties of a ListGrpcRoutesRequest. + * @memberof google.cloud.networkservices.v1 + * @interface IListGrpcRoutesRequest + * @property {string|null} [parent] ListGrpcRoutesRequest parent + * @property {number|null} [pageSize] ListGrpcRoutesRequest pageSize + * @property {string|null} [pageToken] ListGrpcRoutesRequest pageToken + */ + + /** + * Constructs a new ListGrpcRoutesRequest. + * @memberof google.cloud.networkservices.v1 + * @classdesc Represents a ListGrpcRoutesRequest. + * @implements IListGrpcRoutesRequest + * @constructor + * @param {google.cloud.networkservices.v1.IListGrpcRoutesRequest=} [properties] Properties to set + */ + function ListGrpcRoutesRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListGrpcRoutesRequest parent. + * @member {string} parent + * @memberof google.cloud.networkservices.v1.ListGrpcRoutesRequest + * @instance + */ + ListGrpcRoutesRequest.prototype.parent = ""; + + /** + * ListGrpcRoutesRequest pageSize. + * @member {number} pageSize + * @memberof google.cloud.networkservices.v1.ListGrpcRoutesRequest + * @instance + */ + ListGrpcRoutesRequest.prototype.pageSize = 0; + + /** + * ListGrpcRoutesRequest pageToken. + * @member {string} pageToken + * @memberof google.cloud.networkservices.v1.ListGrpcRoutesRequest + * @instance + */ + ListGrpcRoutesRequest.prototype.pageToken = ""; + + /** + * Creates a new ListGrpcRoutesRequest instance using the specified properties. + * @function create + * @memberof google.cloud.networkservices.v1.ListGrpcRoutesRequest + * @static + * @param {google.cloud.networkservices.v1.IListGrpcRoutesRequest=} [properties] Properties to set + * @returns {google.cloud.networkservices.v1.ListGrpcRoutesRequest} ListGrpcRoutesRequest instance + */ + ListGrpcRoutesRequest.create = function create(properties) { + return new ListGrpcRoutesRequest(properties); + }; + + /** + * Encodes the specified ListGrpcRoutesRequest message. Does not implicitly {@link google.cloud.networkservices.v1.ListGrpcRoutesRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.networkservices.v1.ListGrpcRoutesRequest + * @static + * @param {google.cloud.networkservices.v1.IListGrpcRoutesRequest} message ListGrpcRoutesRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListGrpcRoutesRequest.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 ListGrpcRoutesRequest message, length delimited. Does not implicitly {@link google.cloud.networkservices.v1.ListGrpcRoutesRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.networkservices.v1.ListGrpcRoutesRequest + * @static + * @param {google.cloud.networkservices.v1.IListGrpcRoutesRequest} message ListGrpcRoutesRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListGrpcRoutesRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListGrpcRoutesRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.networkservices.v1.ListGrpcRoutesRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.networkservices.v1.ListGrpcRoutesRequest} ListGrpcRoutesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListGrpcRoutesRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.networkservices.v1.ListGrpcRoutesRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + 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 ListGrpcRoutesRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.networkservices.v1.ListGrpcRoutesRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.networkservices.v1.ListGrpcRoutesRequest} ListGrpcRoutesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListGrpcRoutesRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListGrpcRoutesRequest message. + * @function verify + * @memberof google.cloud.networkservices.v1.ListGrpcRoutesRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListGrpcRoutesRequest.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 ListGrpcRoutesRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.networkservices.v1.ListGrpcRoutesRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.networkservices.v1.ListGrpcRoutesRequest} ListGrpcRoutesRequest + */ + ListGrpcRoutesRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.networkservices.v1.ListGrpcRoutesRequest) + return object; + var message = new $root.google.cloud.networkservices.v1.ListGrpcRoutesRequest(); + 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 ListGrpcRoutesRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.networkservices.v1.ListGrpcRoutesRequest + * @static + * @param {google.cloud.networkservices.v1.ListGrpcRoutesRequest} message ListGrpcRoutesRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListGrpcRoutesRequest.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 ListGrpcRoutesRequest to JSON. + * @function toJSON + * @memberof google.cloud.networkservices.v1.ListGrpcRoutesRequest + * @instance + * @returns {Object.} JSON object + */ + ListGrpcRoutesRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListGrpcRoutesRequest + * @function getTypeUrl + * @memberof google.cloud.networkservices.v1.ListGrpcRoutesRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListGrpcRoutesRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.networkservices.v1.ListGrpcRoutesRequest"; + }; + + return ListGrpcRoutesRequest; + })(); + + v1.ListGrpcRoutesResponse = (function() { + + /** + * Properties of a ListGrpcRoutesResponse. + * @memberof google.cloud.networkservices.v1 + * @interface IListGrpcRoutesResponse + * @property {Array.|null} [grpcRoutes] ListGrpcRoutesResponse grpcRoutes + * @property {string|null} [nextPageToken] ListGrpcRoutesResponse nextPageToken + */ + + /** + * Constructs a new ListGrpcRoutesResponse. + * @memberof google.cloud.networkservices.v1 + * @classdesc Represents a ListGrpcRoutesResponse. + * @implements IListGrpcRoutesResponse + * @constructor + * @param {google.cloud.networkservices.v1.IListGrpcRoutesResponse=} [properties] Properties to set + */ + function ListGrpcRoutesResponse(properties) { + this.grpcRoutes = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListGrpcRoutesResponse grpcRoutes. + * @member {Array.} grpcRoutes + * @memberof google.cloud.networkservices.v1.ListGrpcRoutesResponse + * @instance + */ + ListGrpcRoutesResponse.prototype.grpcRoutes = $util.emptyArray; + + /** + * ListGrpcRoutesResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.cloud.networkservices.v1.ListGrpcRoutesResponse + * @instance + */ + ListGrpcRoutesResponse.prototype.nextPageToken = ""; + + /** + * Creates a new ListGrpcRoutesResponse instance using the specified properties. + * @function create + * @memberof google.cloud.networkservices.v1.ListGrpcRoutesResponse + * @static + * @param {google.cloud.networkservices.v1.IListGrpcRoutesResponse=} [properties] Properties to set + * @returns {google.cloud.networkservices.v1.ListGrpcRoutesResponse} ListGrpcRoutesResponse instance + */ + ListGrpcRoutesResponse.create = function create(properties) { + return new ListGrpcRoutesResponse(properties); + }; + + /** + * Encodes the specified ListGrpcRoutesResponse message. Does not implicitly {@link google.cloud.networkservices.v1.ListGrpcRoutesResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.networkservices.v1.ListGrpcRoutesResponse + * @static + * @param {google.cloud.networkservices.v1.IListGrpcRoutesResponse} message ListGrpcRoutesResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListGrpcRoutesResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.grpcRoutes != null && message.grpcRoutes.length) + for (var i = 0; i < message.grpcRoutes.length; ++i) + $root.google.cloud.networkservices.v1.GrpcRoute.encode(message.grpcRoutes[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 ListGrpcRoutesResponse message, length delimited. Does not implicitly {@link google.cloud.networkservices.v1.ListGrpcRoutesResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.networkservices.v1.ListGrpcRoutesResponse + * @static + * @param {google.cloud.networkservices.v1.IListGrpcRoutesResponse} message ListGrpcRoutesResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListGrpcRoutesResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListGrpcRoutesResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.networkservices.v1.ListGrpcRoutesResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.networkservices.v1.ListGrpcRoutesResponse} ListGrpcRoutesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListGrpcRoutesResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.networkservices.v1.ListGrpcRoutesResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.grpcRoutes && message.grpcRoutes.length)) + message.grpcRoutes = []; + message.grpcRoutes.push($root.google.cloud.networkservices.v1.GrpcRoute.decode(reader, reader.uint32())); + break; + } + case 2: { + message.nextPageToken = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListGrpcRoutesResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.networkservices.v1.ListGrpcRoutesResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.networkservices.v1.ListGrpcRoutesResponse} ListGrpcRoutesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListGrpcRoutesResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListGrpcRoutesResponse message. + * @function verify + * @memberof google.cloud.networkservices.v1.ListGrpcRoutesResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListGrpcRoutesResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.grpcRoutes != null && message.hasOwnProperty("grpcRoutes")) { + if (!Array.isArray(message.grpcRoutes)) + return "grpcRoutes: array expected"; + for (var i = 0; i < message.grpcRoutes.length; ++i) { + var error = $root.google.cloud.networkservices.v1.GrpcRoute.verify(message.grpcRoutes[i]); + if (error) + return "grpcRoutes." + error; + } + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + return null; + }; + + /** + * Creates a ListGrpcRoutesResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.networkservices.v1.ListGrpcRoutesResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.networkservices.v1.ListGrpcRoutesResponse} ListGrpcRoutesResponse + */ + ListGrpcRoutesResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.networkservices.v1.ListGrpcRoutesResponse) + return object; + var message = new $root.google.cloud.networkservices.v1.ListGrpcRoutesResponse(); + if (object.grpcRoutes) { + if (!Array.isArray(object.grpcRoutes)) + throw TypeError(".google.cloud.networkservices.v1.ListGrpcRoutesResponse.grpcRoutes: array expected"); + message.grpcRoutes = []; + for (var i = 0; i < object.grpcRoutes.length; ++i) { + if (typeof object.grpcRoutes[i] !== "object") + throw TypeError(".google.cloud.networkservices.v1.ListGrpcRoutesResponse.grpcRoutes: object expected"); + message.grpcRoutes[i] = $root.google.cloud.networkservices.v1.GrpcRoute.fromObject(object.grpcRoutes[i]); + } + } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + return message; + }; + + /** + * Creates a plain object from a ListGrpcRoutesResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.networkservices.v1.ListGrpcRoutesResponse + * @static + * @param {google.cloud.networkservices.v1.ListGrpcRoutesResponse} message ListGrpcRoutesResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListGrpcRoutesResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.grpcRoutes = []; + if (options.defaults) + object.nextPageToken = ""; + if (message.grpcRoutes && message.grpcRoutes.length) { + object.grpcRoutes = []; + for (var j = 0; j < message.grpcRoutes.length; ++j) + object.grpcRoutes[j] = $root.google.cloud.networkservices.v1.GrpcRoute.toObject(message.grpcRoutes[j], options); + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + object.nextPageToken = message.nextPageToken; + return object; + }; + + /** + * Converts this ListGrpcRoutesResponse to JSON. + * @function toJSON + * @memberof google.cloud.networkservices.v1.ListGrpcRoutesResponse + * @instance + * @returns {Object.} JSON object + */ + ListGrpcRoutesResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListGrpcRoutesResponse + * @function getTypeUrl + * @memberof google.cloud.networkservices.v1.ListGrpcRoutesResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListGrpcRoutesResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.networkservices.v1.ListGrpcRoutesResponse"; + }; + + return ListGrpcRoutesResponse; + })(); + + v1.GetGrpcRouteRequest = (function() { + + /** + * Properties of a GetGrpcRouteRequest. + * @memberof google.cloud.networkservices.v1 + * @interface IGetGrpcRouteRequest + * @property {string|null} [name] GetGrpcRouteRequest name + */ + + /** + * Constructs a new GetGrpcRouteRequest. + * @memberof google.cloud.networkservices.v1 + * @classdesc Represents a GetGrpcRouteRequest. + * @implements IGetGrpcRouteRequest + * @constructor + * @param {google.cloud.networkservices.v1.IGetGrpcRouteRequest=} [properties] Properties to set + */ + function GetGrpcRouteRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetGrpcRouteRequest name. + * @member {string} name + * @memberof google.cloud.networkservices.v1.GetGrpcRouteRequest + * @instance + */ + GetGrpcRouteRequest.prototype.name = ""; + + /** + * Creates a new GetGrpcRouteRequest instance using the specified properties. + * @function create + * @memberof google.cloud.networkservices.v1.GetGrpcRouteRequest + * @static + * @param {google.cloud.networkservices.v1.IGetGrpcRouteRequest=} [properties] Properties to set + * @returns {google.cloud.networkservices.v1.GetGrpcRouteRequest} GetGrpcRouteRequest instance + */ + GetGrpcRouteRequest.create = function create(properties) { + return new GetGrpcRouteRequest(properties); + }; + + /** + * Encodes the specified GetGrpcRouteRequest message. Does not implicitly {@link google.cloud.networkservices.v1.GetGrpcRouteRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.networkservices.v1.GetGrpcRouteRequest + * @static + * @param {google.cloud.networkservices.v1.IGetGrpcRouteRequest} message GetGrpcRouteRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetGrpcRouteRequest.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 GetGrpcRouteRequest message, length delimited. Does not implicitly {@link google.cloud.networkservices.v1.GetGrpcRouteRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.networkservices.v1.GetGrpcRouteRequest + * @static + * @param {google.cloud.networkservices.v1.IGetGrpcRouteRequest} message GetGrpcRouteRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetGrpcRouteRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetGrpcRouteRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.networkservices.v1.GetGrpcRouteRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.networkservices.v1.GetGrpcRouteRequest} GetGrpcRouteRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetGrpcRouteRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.networkservices.v1.GetGrpcRouteRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetGrpcRouteRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.networkservices.v1.GetGrpcRouteRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.networkservices.v1.GetGrpcRouteRequest} GetGrpcRouteRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetGrpcRouteRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetGrpcRouteRequest message. + * @function verify + * @memberof google.cloud.networkservices.v1.GetGrpcRouteRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetGrpcRouteRequest.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 GetGrpcRouteRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.networkservices.v1.GetGrpcRouteRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.networkservices.v1.GetGrpcRouteRequest} GetGrpcRouteRequest + */ + GetGrpcRouteRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.networkservices.v1.GetGrpcRouteRequest) + return object; + var message = new $root.google.cloud.networkservices.v1.GetGrpcRouteRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a GetGrpcRouteRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.networkservices.v1.GetGrpcRouteRequest + * @static + * @param {google.cloud.networkservices.v1.GetGrpcRouteRequest} message GetGrpcRouteRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetGrpcRouteRequest.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 GetGrpcRouteRequest to JSON. + * @function toJSON + * @memberof google.cloud.networkservices.v1.GetGrpcRouteRequest + * @instance + * @returns {Object.} JSON object + */ + GetGrpcRouteRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GetGrpcRouteRequest + * @function getTypeUrl + * @memberof google.cloud.networkservices.v1.GetGrpcRouteRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GetGrpcRouteRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.networkservices.v1.GetGrpcRouteRequest"; + }; + + return GetGrpcRouteRequest; + })(); + + v1.CreateGrpcRouteRequest = (function() { + + /** + * Properties of a CreateGrpcRouteRequest. + * @memberof google.cloud.networkservices.v1 + * @interface ICreateGrpcRouteRequest + * @property {string|null} [parent] CreateGrpcRouteRequest parent + * @property {string|null} [grpcRouteId] CreateGrpcRouteRequest grpcRouteId + * @property {google.cloud.networkservices.v1.IGrpcRoute|null} [grpcRoute] CreateGrpcRouteRequest grpcRoute + */ + + /** + * Constructs a new CreateGrpcRouteRequest. + * @memberof google.cloud.networkservices.v1 + * @classdesc Represents a CreateGrpcRouteRequest. + * @implements ICreateGrpcRouteRequest + * @constructor + * @param {google.cloud.networkservices.v1.ICreateGrpcRouteRequest=} [properties] Properties to set + */ + function CreateGrpcRouteRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * CreateGrpcRouteRequest parent. + * @member {string} parent + * @memberof google.cloud.networkservices.v1.CreateGrpcRouteRequest + * @instance + */ + CreateGrpcRouteRequest.prototype.parent = ""; + + /** + * CreateGrpcRouteRequest grpcRouteId. + * @member {string} grpcRouteId + * @memberof google.cloud.networkservices.v1.CreateGrpcRouteRequest + * @instance + */ + CreateGrpcRouteRequest.prototype.grpcRouteId = ""; + + /** + * CreateGrpcRouteRequest grpcRoute. + * @member {google.cloud.networkservices.v1.IGrpcRoute|null|undefined} grpcRoute + * @memberof google.cloud.networkservices.v1.CreateGrpcRouteRequest + * @instance + */ + CreateGrpcRouteRequest.prototype.grpcRoute = null; + + /** + * Creates a new CreateGrpcRouteRequest instance using the specified properties. + * @function create + * @memberof google.cloud.networkservices.v1.CreateGrpcRouteRequest + * @static + * @param {google.cloud.networkservices.v1.ICreateGrpcRouteRequest=} [properties] Properties to set + * @returns {google.cloud.networkservices.v1.CreateGrpcRouteRequest} CreateGrpcRouteRequest instance + */ + CreateGrpcRouteRequest.create = function create(properties) { + return new CreateGrpcRouteRequest(properties); + }; + + /** + * Encodes the specified CreateGrpcRouteRequest message. Does not implicitly {@link google.cloud.networkservices.v1.CreateGrpcRouteRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.networkservices.v1.CreateGrpcRouteRequest + * @static + * @param {google.cloud.networkservices.v1.ICreateGrpcRouteRequest} message CreateGrpcRouteRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateGrpcRouteRequest.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.grpcRouteId != null && Object.hasOwnProperty.call(message, "grpcRouteId")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.grpcRouteId); + if (message.grpcRoute != null && Object.hasOwnProperty.call(message, "grpcRoute")) + $root.google.cloud.networkservices.v1.GrpcRoute.encode(message.grpcRoute, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified CreateGrpcRouteRequest message, length delimited. Does not implicitly {@link google.cloud.networkservices.v1.CreateGrpcRouteRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.networkservices.v1.CreateGrpcRouteRequest + * @static + * @param {google.cloud.networkservices.v1.ICreateGrpcRouteRequest} message CreateGrpcRouteRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateGrpcRouteRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CreateGrpcRouteRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.networkservices.v1.CreateGrpcRouteRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.networkservices.v1.CreateGrpcRouteRequest} CreateGrpcRouteRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateGrpcRouteRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.networkservices.v1.CreateGrpcRouteRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.grpcRouteId = reader.string(); + break; + } + case 3: { + message.grpcRoute = $root.google.cloud.networkservices.v1.GrpcRoute.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CreateGrpcRouteRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.networkservices.v1.CreateGrpcRouteRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.networkservices.v1.CreateGrpcRouteRequest} CreateGrpcRouteRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateGrpcRouteRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CreateGrpcRouteRequest message. + * @function verify + * @memberof google.cloud.networkservices.v1.CreateGrpcRouteRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CreateGrpcRouteRequest.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.grpcRouteId != null && message.hasOwnProperty("grpcRouteId")) + if (!$util.isString(message.grpcRouteId)) + return "grpcRouteId: string expected"; + if (message.grpcRoute != null && message.hasOwnProperty("grpcRoute")) { + var error = $root.google.cloud.networkservices.v1.GrpcRoute.verify(message.grpcRoute); + if (error) + return "grpcRoute." + error; + } + return null; + }; + + /** + * Creates a CreateGrpcRouteRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.networkservices.v1.CreateGrpcRouteRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.networkservices.v1.CreateGrpcRouteRequest} CreateGrpcRouteRequest + */ + CreateGrpcRouteRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.networkservices.v1.CreateGrpcRouteRequest) + return object; + var message = new $root.google.cloud.networkservices.v1.CreateGrpcRouteRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.grpcRouteId != null) + message.grpcRouteId = String(object.grpcRouteId); + if (object.grpcRoute != null) { + if (typeof object.grpcRoute !== "object") + throw TypeError(".google.cloud.networkservices.v1.CreateGrpcRouteRequest.grpcRoute: object expected"); + message.grpcRoute = $root.google.cloud.networkservices.v1.GrpcRoute.fromObject(object.grpcRoute); + } + return message; + }; + + /** + * Creates a plain object from a CreateGrpcRouteRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.networkservices.v1.CreateGrpcRouteRequest + * @static + * @param {google.cloud.networkservices.v1.CreateGrpcRouteRequest} message CreateGrpcRouteRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CreateGrpcRouteRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.grpcRouteId = ""; + object.grpcRoute = null; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.grpcRouteId != null && message.hasOwnProperty("grpcRouteId")) + object.grpcRouteId = message.grpcRouteId; + if (message.grpcRoute != null && message.hasOwnProperty("grpcRoute")) + object.grpcRoute = $root.google.cloud.networkservices.v1.GrpcRoute.toObject(message.grpcRoute, options); + return object; + }; + + /** + * Converts this CreateGrpcRouteRequest to JSON. + * @function toJSON + * @memberof google.cloud.networkservices.v1.CreateGrpcRouteRequest + * @instance + * @returns {Object.} JSON object + */ + CreateGrpcRouteRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CreateGrpcRouteRequest + * @function getTypeUrl + * @memberof google.cloud.networkservices.v1.CreateGrpcRouteRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CreateGrpcRouteRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.networkservices.v1.CreateGrpcRouteRequest"; + }; + + return CreateGrpcRouteRequest; + })(); + + v1.UpdateGrpcRouteRequest = (function() { + + /** + * Properties of an UpdateGrpcRouteRequest. + * @memberof google.cloud.networkservices.v1 + * @interface IUpdateGrpcRouteRequest + * @property {google.protobuf.IFieldMask|null} [updateMask] UpdateGrpcRouteRequest updateMask + * @property {google.cloud.networkservices.v1.IGrpcRoute|null} [grpcRoute] UpdateGrpcRouteRequest grpcRoute + */ + + /** + * Constructs a new UpdateGrpcRouteRequest. + * @memberof google.cloud.networkservices.v1 + * @classdesc Represents an UpdateGrpcRouteRequest. + * @implements IUpdateGrpcRouteRequest + * @constructor + * @param {google.cloud.networkservices.v1.IUpdateGrpcRouteRequest=} [properties] Properties to set + */ + function UpdateGrpcRouteRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * UpdateGrpcRouteRequest updateMask. + * @member {google.protobuf.IFieldMask|null|undefined} updateMask + * @memberof google.cloud.networkservices.v1.UpdateGrpcRouteRequest + * @instance + */ + UpdateGrpcRouteRequest.prototype.updateMask = null; + + /** + * UpdateGrpcRouteRequest grpcRoute. + * @member {google.cloud.networkservices.v1.IGrpcRoute|null|undefined} grpcRoute + * @memberof google.cloud.networkservices.v1.UpdateGrpcRouteRequest + * @instance + */ + UpdateGrpcRouteRequest.prototype.grpcRoute = null; + + /** + * Creates a new UpdateGrpcRouteRequest instance using the specified properties. + * @function create + * @memberof google.cloud.networkservices.v1.UpdateGrpcRouteRequest + * @static + * @param {google.cloud.networkservices.v1.IUpdateGrpcRouteRequest=} [properties] Properties to set + * @returns {google.cloud.networkservices.v1.UpdateGrpcRouteRequest} UpdateGrpcRouteRequest instance + */ + UpdateGrpcRouteRequest.create = function create(properties) { + return new UpdateGrpcRouteRequest(properties); + }; + + /** + * Encodes the specified UpdateGrpcRouteRequest message. Does not implicitly {@link google.cloud.networkservices.v1.UpdateGrpcRouteRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.networkservices.v1.UpdateGrpcRouteRequest + * @static + * @param {google.cloud.networkservices.v1.IUpdateGrpcRouteRequest} message UpdateGrpcRouteRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateGrpcRouteRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.updateMask != null && Object.hasOwnProperty.call(message, "updateMask")) + $root.google.protobuf.FieldMask.encode(message.updateMask, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.grpcRoute != null && Object.hasOwnProperty.call(message, "grpcRoute")) + $root.google.cloud.networkservices.v1.GrpcRoute.encode(message.grpcRoute, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified UpdateGrpcRouteRequest message, length delimited. Does not implicitly {@link google.cloud.networkservices.v1.UpdateGrpcRouteRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.networkservices.v1.UpdateGrpcRouteRequest + * @static + * @param {google.cloud.networkservices.v1.IUpdateGrpcRouteRequest} message UpdateGrpcRouteRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateGrpcRouteRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an UpdateGrpcRouteRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.networkservices.v1.UpdateGrpcRouteRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.networkservices.v1.UpdateGrpcRouteRequest} UpdateGrpcRouteRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateGrpcRouteRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.networkservices.v1.UpdateGrpcRouteRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.updateMask = $root.google.protobuf.FieldMask.decode(reader, reader.uint32()); + break; + } + case 2: { + message.grpcRoute = $root.google.cloud.networkservices.v1.GrpcRoute.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an UpdateGrpcRouteRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.networkservices.v1.UpdateGrpcRouteRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.networkservices.v1.UpdateGrpcRouteRequest} UpdateGrpcRouteRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateGrpcRouteRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an UpdateGrpcRouteRequest message. + * @function verify + * @memberof google.cloud.networkservices.v1.UpdateGrpcRouteRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + UpdateGrpcRouteRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.updateMask != null && message.hasOwnProperty("updateMask")) { + var error = $root.google.protobuf.FieldMask.verify(message.updateMask); + if (error) + return "updateMask." + error; + } + if (message.grpcRoute != null && message.hasOwnProperty("grpcRoute")) { + var error = $root.google.cloud.networkservices.v1.GrpcRoute.verify(message.grpcRoute); + if (error) + return "grpcRoute." + error; + } + return null; + }; + + /** + * Creates an UpdateGrpcRouteRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.networkservices.v1.UpdateGrpcRouteRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.networkservices.v1.UpdateGrpcRouteRequest} UpdateGrpcRouteRequest + */ + UpdateGrpcRouteRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.networkservices.v1.UpdateGrpcRouteRequest) + return object; + var message = new $root.google.cloud.networkservices.v1.UpdateGrpcRouteRequest(); + if (object.updateMask != null) { + if (typeof object.updateMask !== "object") + throw TypeError(".google.cloud.networkservices.v1.UpdateGrpcRouteRequest.updateMask: object expected"); + message.updateMask = $root.google.protobuf.FieldMask.fromObject(object.updateMask); + } + if (object.grpcRoute != null) { + if (typeof object.grpcRoute !== "object") + throw TypeError(".google.cloud.networkservices.v1.UpdateGrpcRouteRequest.grpcRoute: object expected"); + message.grpcRoute = $root.google.cloud.networkservices.v1.GrpcRoute.fromObject(object.grpcRoute); + } + return message; + }; + + /** + * Creates a plain object from an UpdateGrpcRouteRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.networkservices.v1.UpdateGrpcRouteRequest + * @static + * @param {google.cloud.networkservices.v1.UpdateGrpcRouteRequest} message UpdateGrpcRouteRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + UpdateGrpcRouteRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.updateMask = null; + object.grpcRoute = null; + } + if (message.updateMask != null && message.hasOwnProperty("updateMask")) + object.updateMask = $root.google.protobuf.FieldMask.toObject(message.updateMask, options); + if (message.grpcRoute != null && message.hasOwnProperty("grpcRoute")) + object.grpcRoute = $root.google.cloud.networkservices.v1.GrpcRoute.toObject(message.grpcRoute, options); + return object; + }; + + /** + * Converts this UpdateGrpcRouteRequest to JSON. + * @function toJSON + * @memberof google.cloud.networkservices.v1.UpdateGrpcRouteRequest + * @instance + * @returns {Object.} JSON object + */ + UpdateGrpcRouteRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for UpdateGrpcRouteRequest + * @function getTypeUrl + * @memberof google.cloud.networkservices.v1.UpdateGrpcRouteRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + UpdateGrpcRouteRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.networkservices.v1.UpdateGrpcRouteRequest"; + }; + + return UpdateGrpcRouteRequest; + })(); + + v1.DeleteGrpcRouteRequest = (function() { + + /** + * Properties of a DeleteGrpcRouteRequest. + * @memberof google.cloud.networkservices.v1 + * @interface IDeleteGrpcRouteRequest + * @property {string|null} [name] DeleteGrpcRouteRequest name + */ + + /** + * Constructs a new DeleteGrpcRouteRequest. + * @memberof google.cloud.networkservices.v1 + * @classdesc Represents a DeleteGrpcRouteRequest. + * @implements IDeleteGrpcRouteRequest + * @constructor + * @param {google.cloud.networkservices.v1.IDeleteGrpcRouteRequest=} [properties] Properties to set + */ + function DeleteGrpcRouteRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * DeleteGrpcRouteRequest name. + * @member {string} name + * @memberof google.cloud.networkservices.v1.DeleteGrpcRouteRequest + * @instance + */ + DeleteGrpcRouteRequest.prototype.name = ""; + + /** + * Creates a new DeleteGrpcRouteRequest instance using the specified properties. + * @function create + * @memberof google.cloud.networkservices.v1.DeleteGrpcRouteRequest + * @static + * @param {google.cloud.networkservices.v1.IDeleteGrpcRouteRequest=} [properties] Properties to set + * @returns {google.cloud.networkservices.v1.DeleteGrpcRouteRequest} DeleteGrpcRouteRequest instance + */ + DeleteGrpcRouteRequest.create = function create(properties) { + return new DeleteGrpcRouteRequest(properties); + }; + + /** + * Encodes the specified DeleteGrpcRouteRequest message. Does not implicitly {@link google.cloud.networkservices.v1.DeleteGrpcRouteRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.networkservices.v1.DeleteGrpcRouteRequest + * @static + * @param {google.cloud.networkservices.v1.IDeleteGrpcRouteRequest} message DeleteGrpcRouteRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteGrpcRouteRequest.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 DeleteGrpcRouteRequest message, length delimited. Does not implicitly {@link google.cloud.networkservices.v1.DeleteGrpcRouteRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.networkservices.v1.DeleteGrpcRouteRequest + * @static + * @param {google.cloud.networkservices.v1.IDeleteGrpcRouteRequest} message DeleteGrpcRouteRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteGrpcRouteRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DeleteGrpcRouteRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.networkservices.v1.DeleteGrpcRouteRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.networkservices.v1.DeleteGrpcRouteRequest} DeleteGrpcRouteRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteGrpcRouteRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.networkservices.v1.DeleteGrpcRouteRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DeleteGrpcRouteRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.networkservices.v1.DeleteGrpcRouteRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.networkservices.v1.DeleteGrpcRouteRequest} DeleteGrpcRouteRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteGrpcRouteRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DeleteGrpcRouteRequest message. + * @function verify + * @memberof google.cloud.networkservices.v1.DeleteGrpcRouteRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DeleteGrpcRouteRequest.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 DeleteGrpcRouteRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.networkservices.v1.DeleteGrpcRouteRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.networkservices.v1.DeleteGrpcRouteRequest} DeleteGrpcRouteRequest + */ + DeleteGrpcRouteRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.networkservices.v1.DeleteGrpcRouteRequest) + return object; + var message = new $root.google.cloud.networkservices.v1.DeleteGrpcRouteRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a DeleteGrpcRouteRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.networkservices.v1.DeleteGrpcRouteRequest + * @static + * @param {google.cloud.networkservices.v1.DeleteGrpcRouteRequest} message DeleteGrpcRouteRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DeleteGrpcRouteRequest.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 DeleteGrpcRouteRequest to JSON. + * @function toJSON + * @memberof google.cloud.networkservices.v1.DeleteGrpcRouteRequest + * @instance + * @returns {Object.} JSON object + */ + DeleteGrpcRouteRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DeleteGrpcRouteRequest + * @function getTypeUrl + * @memberof google.cloud.networkservices.v1.DeleteGrpcRouteRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DeleteGrpcRouteRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.networkservices.v1.DeleteGrpcRouteRequest"; + }; + + return DeleteGrpcRouteRequest; + })(); + + v1.HttpRoute = (function() { + + /** + * Properties of a HttpRoute. + * @memberof google.cloud.networkservices.v1 + * @interface IHttpRoute + * @property {string|null} [name] HttpRoute name + * @property {string|null} [selfLink] HttpRoute selfLink + * @property {string|null} [description] HttpRoute description + * @property {google.protobuf.ITimestamp|null} [createTime] HttpRoute createTime + * @property {google.protobuf.ITimestamp|null} [updateTime] HttpRoute updateTime + * @property {Array.|null} [hostnames] HttpRoute hostnames + * @property {Array.|null} [meshes] HttpRoute meshes + * @property {Array.|null} [gateways] HttpRoute gateways + * @property {Object.|null} [labels] HttpRoute labels + * @property {Array.|null} [rules] HttpRoute rules + */ + + /** + * Constructs a new HttpRoute. + * @memberof google.cloud.networkservices.v1 + * @classdesc Represents a HttpRoute. + * @implements IHttpRoute + * @constructor + * @param {google.cloud.networkservices.v1.IHttpRoute=} [properties] Properties to set + */ + function HttpRoute(properties) { + this.hostnames = []; + this.meshes = []; + this.gateways = []; + this.labels = {}; + 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]]; + } + + /** + * HttpRoute name. + * @member {string} name + * @memberof google.cloud.networkservices.v1.HttpRoute + * @instance + */ + HttpRoute.prototype.name = ""; + + /** + * HttpRoute selfLink. + * @member {string} selfLink + * @memberof google.cloud.networkservices.v1.HttpRoute + * @instance + */ + HttpRoute.prototype.selfLink = ""; + + /** + * HttpRoute description. + * @member {string} description + * @memberof google.cloud.networkservices.v1.HttpRoute + * @instance + */ + HttpRoute.prototype.description = ""; + + /** + * HttpRoute createTime. + * @member {google.protobuf.ITimestamp|null|undefined} createTime + * @memberof google.cloud.networkservices.v1.HttpRoute + * @instance + */ + HttpRoute.prototype.createTime = null; + + /** + * HttpRoute updateTime. + * @member {google.protobuf.ITimestamp|null|undefined} updateTime + * @memberof google.cloud.networkservices.v1.HttpRoute + * @instance + */ + HttpRoute.prototype.updateTime = null; + + /** + * HttpRoute hostnames. + * @member {Array.} hostnames + * @memberof google.cloud.networkservices.v1.HttpRoute + * @instance + */ + HttpRoute.prototype.hostnames = $util.emptyArray; + + /** + * HttpRoute meshes. + * @member {Array.} meshes + * @memberof google.cloud.networkservices.v1.HttpRoute + * @instance + */ + HttpRoute.prototype.meshes = $util.emptyArray; + + /** + * HttpRoute gateways. + * @member {Array.} gateways + * @memberof google.cloud.networkservices.v1.HttpRoute + * @instance + */ + HttpRoute.prototype.gateways = $util.emptyArray; + + /** + * HttpRoute labels. + * @member {Object.} labels + * @memberof google.cloud.networkservices.v1.HttpRoute + * @instance + */ + HttpRoute.prototype.labels = $util.emptyObject; + + /** + * HttpRoute rules. + * @member {Array.} rules + * @memberof google.cloud.networkservices.v1.HttpRoute + * @instance + */ + HttpRoute.prototype.rules = $util.emptyArray; + + /** + * Creates a new HttpRoute instance using the specified properties. + * @function create + * @memberof google.cloud.networkservices.v1.HttpRoute + * @static + * @param {google.cloud.networkservices.v1.IHttpRoute=} [properties] Properties to set + * @returns {google.cloud.networkservices.v1.HttpRoute} HttpRoute instance + */ + HttpRoute.create = function create(properties) { + return new HttpRoute(properties); + }; + + /** + * Encodes the specified HttpRoute message. Does not implicitly {@link google.cloud.networkservices.v1.HttpRoute.verify|verify} messages. + * @function encode + * @memberof google.cloud.networkservices.v1.HttpRoute + * @static + * @param {google.cloud.networkservices.v1.IHttpRoute} message HttpRoute message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + HttpRoute.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.description != null && Object.hasOwnProperty.call(message, "description")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.description); + if (message.createTime != null && Object.hasOwnProperty.call(message, "createTime")) + $root.google.protobuf.Timestamp.encode(message.createTime, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.updateTime != null && Object.hasOwnProperty.call(message, "updateTime")) + $root.google.protobuf.Timestamp.encode(message.updateTime, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.hostnames != null && message.hostnames.length) + for (var i = 0; i < message.hostnames.length; ++i) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.hostnames[i]); + if (message.rules != null && message.rules.length) + for (var i = 0; i < message.rules.length; ++i) + $root.google.cloud.networkservices.v1.HttpRoute.RouteRule.encode(message.rules[i], writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + if (message.meshes != null && message.meshes.length) + for (var i = 0; i < message.meshes.length; ++i) + writer.uint32(/* id 8, wireType 2 =*/66).string(message.meshes[i]); + if (message.gateways != null && message.gateways.length) + for (var i = 0; i < message.gateways.length; ++i) + writer.uint32(/* id 9, wireType 2 =*/74).string(message.gateways[i]); + if (message.labels != null && Object.hasOwnProperty.call(message, "labels")) + for (var keys = Object.keys(message.labels), 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.labels[keys[i]]).ldelim(); + if (message.selfLink != null && Object.hasOwnProperty.call(message, "selfLink")) + writer.uint32(/* id 11, wireType 2 =*/90).string(message.selfLink); + return writer; + }; + + /** + * Encodes the specified HttpRoute message, length delimited. Does not implicitly {@link google.cloud.networkservices.v1.HttpRoute.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.networkservices.v1.HttpRoute + * @static + * @param {google.cloud.networkservices.v1.IHttpRoute} message HttpRoute message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + HttpRoute.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a HttpRoute message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.networkservices.v1.HttpRoute + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.networkservices.v1.HttpRoute} HttpRoute + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + HttpRoute.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.networkservices.v1.HttpRoute(), key, value; + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 11: { + message.selfLink = reader.string(); + break; + } + case 2: { + message.description = reader.string(); + break; + } + case 3: { + message.createTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 4: { + message.updateTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 5: { + if (!(message.hostnames && message.hostnames.length)) + message.hostnames = []; + message.hostnames.push(reader.string()); + break; + } + case 8: { + if (!(message.meshes && message.meshes.length)) + message.meshes = []; + message.meshes.push(reader.string()); + break; + } + case 9: { + if (!(message.gateways && message.gateways.length)) + message.gateways = []; + message.gateways.push(reader.string()); + break; + } + case 10: { + if (message.labels === $util.emptyObject) + message.labels = {}; + 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.labels[key] = value; + break; + } + case 6: { + if (!(message.rules && message.rules.length)) + message.rules = []; + message.rules.push($root.google.cloud.networkservices.v1.HttpRoute.RouteRule.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a HttpRoute message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.networkservices.v1.HttpRoute + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.networkservices.v1.HttpRoute} HttpRoute + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + HttpRoute.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a HttpRoute message. + * @function verify + * @memberof google.cloud.networkservices.v1.HttpRoute + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + HttpRoute.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.selfLink != null && message.hasOwnProperty("selfLink")) + if (!$util.isString(message.selfLink)) + return "selfLink: string expected"; + if (message.description != null && message.hasOwnProperty("description")) + if (!$util.isString(message.description)) + return "description: string expected"; + 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.hostnames != null && message.hasOwnProperty("hostnames")) { + if (!Array.isArray(message.hostnames)) + return "hostnames: array expected"; + for (var i = 0; i < message.hostnames.length; ++i) + if (!$util.isString(message.hostnames[i])) + return "hostnames: string[] expected"; + } + if (message.meshes != null && message.hasOwnProperty("meshes")) { + if (!Array.isArray(message.meshes)) + return "meshes: array expected"; + for (var i = 0; i < message.meshes.length; ++i) + if (!$util.isString(message.meshes[i])) + return "meshes: string[] expected"; + } + if (message.gateways != null && message.hasOwnProperty("gateways")) { + if (!Array.isArray(message.gateways)) + return "gateways: array expected"; + for (var i = 0; i < message.gateways.length; ++i) + if (!$util.isString(message.gateways[i])) + return "gateways: string[] expected"; + } + if (message.labels != null && message.hasOwnProperty("labels")) { + if (!$util.isObject(message.labels)) + return "labels: object expected"; + var key = Object.keys(message.labels); + for (var i = 0; i < key.length; ++i) + if (!$util.isString(message.labels[key[i]])) + return "labels: string{k:string} 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.cloud.networkservices.v1.HttpRoute.RouteRule.verify(message.rules[i]); + if (error) + return "rules." + error; + } + } + return null; + }; + + /** + * Creates a HttpRoute message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.networkservices.v1.HttpRoute + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.networkservices.v1.HttpRoute} HttpRoute + */ + HttpRoute.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.networkservices.v1.HttpRoute) + return object; + var message = new $root.google.cloud.networkservices.v1.HttpRoute(); + if (object.name != null) + message.name = String(object.name); + if (object.selfLink != null) + message.selfLink = String(object.selfLink); + if (object.description != null) + message.description = String(object.description); + if (object.createTime != null) { + if (typeof object.createTime !== "object") + throw TypeError(".google.cloud.networkservices.v1.HttpRoute.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.networkservices.v1.HttpRoute.updateTime: object expected"); + message.updateTime = $root.google.protobuf.Timestamp.fromObject(object.updateTime); + } + if (object.hostnames) { + if (!Array.isArray(object.hostnames)) + throw TypeError(".google.cloud.networkservices.v1.HttpRoute.hostnames: array expected"); + message.hostnames = []; + for (var i = 0; i < object.hostnames.length; ++i) + message.hostnames[i] = String(object.hostnames[i]); + } + if (object.meshes) { + if (!Array.isArray(object.meshes)) + throw TypeError(".google.cloud.networkservices.v1.HttpRoute.meshes: array expected"); + message.meshes = []; + for (var i = 0; i < object.meshes.length; ++i) + message.meshes[i] = String(object.meshes[i]); + } + if (object.gateways) { + if (!Array.isArray(object.gateways)) + throw TypeError(".google.cloud.networkservices.v1.HttpRoute.gateways: array expected"); + message.gateways = []; + for (var i = 0; i < object.gateways.length; ++i) + message.gateways[i] = String(object.gateways[i]); + } + if (object.labels) { + if (typeof object.labels !== "object") + throw TypeError(".google.cloud.networkservices.v1.HttpRoute.labels: object expected"); + message.labels = {}; + for (var keys = Object.keys(object.labels), i = 0; i < keys.length; ++i) + message.labels[keys[i]] = String(object.labels[keys[i]]); + } + if (object.rules) { + if (!Array.isArray(object.rules)) + throw TypeError(".google.cloud.networkservices.v1.HttpRoute.rules: array expected"); + message.rules = []; + for (var i = 0; i < object.rules.length; ++i) { + if (typeof object.rules[i] !== "object") + throw TypeError(".google.cloud.networkservices.v1.HttpRoute.rules: object expected"); + message.rules[i] = $root.google.cloud.networkservices.v1.HttpRoute.RouteRule.fromObject(object.rules[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a HttpRoute message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.networkservices.v1.HttpRoute + * @static + * @param {google.cloud.networkservices.v1.HttpRoute} message HttpRoute + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + HttpRoute.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.hostnames = []; + object.rules = []; + object.meshes = []; + object.gateways = []; + } + if (options.objects || options.defaults) + object.labels = {}; + if (options.defaults) { + object.name = ""; + object.description = ""; + object.createTime = null; + object.updateTime = null; + object.selfLink = ""; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.description != null && message.hasOwnProperty("description")) + object.description = message.description; + 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.hostnames && message.hostnames.length) { + object.hostnames = []; + for (var j = 0; j < message.hostnames.length; ++j) + object.hostnames[j] = message.hostnames[j]; + } + if (message.rules && message.rules.length) { + object.rules = []; + for (var j = 0; j < message.rules.length; ++j) + object.rules[j] = $root.google.cloud.networkservices.v1.HttpRoute.RouteRule.toObject(message.rules[j], options); + } + if (message.meshes && message.meshes.length) { + object.meshes = []; + for (var j = 0; j < message.meshes.length; ++j) + object.meshes[j] = message.meshes[j]; + } + if (message.gateways && message.gateways.length) { + object.gateways = []; + for (var j = 0; j < message.gateways.length; ++j) + object.gateways[j] = message.gateways[j]; + } + var keys2; + if (message.labels && (keys2 = Object.keys(message.labels)).length) { + object.labels = {}; + for (var j = 0; j < keys2.length; ++j) + object.labels[keys2[j]] = message.labels[keys2[j]]; + } + if (message.selfLink != null && message.hasOwnProperty("selfLink")) + object.selfLink = message.selfLink; + return object; + }; + + /** + * Converts this HttpRoute to JSON. + * @function toJSON + * @memberof google.cloud.networkservices.v1.HttpRoute + * @instance + * @returns {Object.} JSON object + */ + HttpRoute.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for HttpRoute + * @function getTypeUrl + * @memberof google.cloud.networkservices.v1.HttpRoute + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + HttpRoute.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.networkservices.v1.HttpRoute"; + }; + + HttpRoute.HeaderMatch = (function() { + + /** + * Properties of a HeaderMatch. + * @memberof google.cloud.networkservices.v1.HttpRoute + * @interface IHeaderMatch + * @property {string|null} [exactMatch] HeaderMatch exactMatch + * @property {string|null} [regexMatch] HeaderMatch regexMatch + * @property {string|null} [prefixMatch] HeaderMatch prefixMatch + * @property {boolean|null} [presentMatch] HeaderMatch presentMatch + * @property {string|null} [suffixMatch] HeaderMatch suffixMatch + * @property {google.cloud.networkservices.v1.HttpRoute.HeaderMatch.IIntegerRange|null} [rangeMatch] HeaderMatch rangeMatch + * @property {string|null} [header] HeaderMatch header + * @property {boolean|null} [invertMatch] HeaderMatch invertMatch + */ + + /** + * Constructs a new HeaderMatch. + * @memberof google.cloud.networkservices.v1.HttpRoute + * @classdesc Represents a HeaderMatch. + * @implements IHeaderMatch + * @constructor + * @param {google.cloud.networkservices.v1.HttpRoute.IHeaderMatch=} [properties] Properties to set + */ + function HeaderMatch(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * HeaderMatch exactMatch. + * @member {string|null|undefined} exactMatch + * @memberof google.cloud.networkservices.v1.HttpRoute.HeaderMatch + * @instance + */ + HeaderMatch.prototype.exactMatch = null; + + /** + * HeaderMatch regexMatch. + * @member {string|null|undefined} regexMatch + * @memberof google.cloud.networkservices.v1.HttpRoute.HeaderMatch + * @instance + */ + HeaderMatch.prototype.regexMatch = null; + + /** + * HeaderMatch prefixMatch. + * @member {string|null|undefined} prefixMatch + * @memberof google.cloud.networkservices.v1.HttpRoute.HeaderMatch + * @instance + */ + HeaderMatch.prototype.prefixMatch = null; + + /** + * HeaderMatch presentMatch. + * @member {boolean|null|undefined} presentMatch + * @memberof google.cloud.networkservices.v1.HttpRoute.HeaderMatch + * @instance + */ + HeaderMatch.prototype.presentMatch = null; + + /** + * HeaderMatch suffixMatch. + * @member {string|null|undefined} suffixMatch + * @memberof google.cloud.networkservices.v1.HttpRoute.HeaderMatch + * @instance + */ + HeaderMatch.prototype.suffixMatch = null; + + /** + * HeaderMatch rangeMatch. + * @member {google.cloud.networkservices.v1.HttpRoute.HeaderMatch.IIntegerRange|null|undefined} rangeMatch + * @memberof google.cloud.networkservices.v1.HttpRoute.HeaderMatch + * @instance + */ + HeaderMatch.prototype.rangeMatch = null; + + /** + * HeaderMatch header. + * @member {string} header + * @memberof google.cloud.networkservices.v1.HttpRoute.HeaderMatch + * @instance + */ + HeaderMatch.prototype.header = ""; + + /** + * HeaderMatch invertMatch. + * @member {boolean} invertMatch + * @memberof google.cloud.networkservices.v1.HttpRoute.HeaderMatch + * @instance + */ + HeaderMatch.prototype.invertMatch = false; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * HeaderMatch MatchType. + * @member {"exactMatch"|"regexMatch"|"prefixMatch"|"presentMatch"|"suffixMatch"|"rangeMatch"|undefined} MatchType + * @memberof google.cloud.networkservices.v1.HttpRoute.HeaderMatch + * @instance + */ + Object.defineProperty(HeaderMatch.prototype, "MatchType", { + get: $util.oneOfGetter($oneOfFields = ["exactMatch", "regexMatch", "prefixMatch", "presentMatch", "suffixMatch", "rangeMatch"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new HeaderMatch instance using the specified properties. + * @function create + * @memberof google.cloud.networkservices.v1.HttpRoute.HeaderMatch + * @static + * @param {google.cloud.networkservices.v1.HttpRoute.IHeaderMatch=} [properties] Properties to set + * @returns {google.cloud.networkservices.v1.HttpRoute.HeaderMatch} HeaderMatch instance + */ + HeaderMatch.create = function create(properties) { + return new HeaderMatch(properties); + }; + + /** + * Encodes the specified HeaderMatch message. Does not implicitly {@link google.cloud.networkservices.v1.HttpRoute.HeaderMatch.verify|verify} messages. + * @function encode + * @memberof google.cloud.networkservices.v1.HttpRoute.HeaderMatch + * @static + * @param {google.cloud.networkservices.v1.HttpRoute.IHeaderMatch} message HeaderMatch message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + HeaderMatch.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.header != null && Object.hasOwnProperty.call(message, "header")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.header); + if (message.exactMatch != null && Object.hasOwnProperty.call(message, "exactMatch")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.exactMatch); + if (message.regexMatch != null && Object.hasOwnProperty.call(message, "regexMatch")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.regexMatch); + if (message.prefixMatch != null && Object.hasOwnProperty.call(message, "prefixMatch")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.prefixMatch); + if (message.presentMatch != null && Object.hasOwnProperty.call(message, "presentMatch")) + writer.uint32(/* id 5, wireType 0 =*/40).bool(message.presentMatch); + if (message.suffixMatch != null && Object.hasOwnProperty.call(message, "suffixMatch")) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.suffixMatch); + if (message.rangeMatch != null && Object.hasOwnProperty.call(message, "rangeMatch")) + $root.google.cloud.networkservices.v1.HttpRoute.HeaderMatch.IntegerRange.encode(message.rangeMatch, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + if (message.invertMatch != null && Object.hasOwnProperty.call(message, "invertMatch")) + writer.uint32(/* id 8, wireType 0 =*/64).bool(message.invertMatch); + return writer; + }; + + /** + * Encodes the specified HeaderMatch message, length delimited. Does not implicitly {@link google.cloud.networkservices.v1.HttpRoute.HeaderMatch.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.networkservices.v1.HttpRoute.HeaderMatch + * @static + * @param {google.cloud.networkservices.v1.HttpRoute.IHeaderMatch} message HeaderMatch message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + HeaderMatch.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a HeaderMatch message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.networkservices.v1.HttpRoute.HeaderMatch + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.networkservices.v1.HttpRoute.HeaderMatch} HeaderMatch + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + HeaderMatch.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.networkservices.v1.HttpRoute.HeaderMatch(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 2: { + message.exactMatch = reader.string(); + break; + } + case 3: { + message.regexMatch = reader.string(); + break; + } + case 4: { + message.prefixMatch = reader.string(); + break; + } + case 5: { + message.presentMatch = reader.bool(); + break; + } + case 6: { + message.suffixMatch = reader.string(); + break; + } + case 7: { + message.rangeMatch = $root.google.cloud.networkservices.v1.HttpRoute.HeaderMatch.IntegerRange.decode(reader, reader.uint32()); + break; + } + case 1: { + message.header = reader.string(); + break; + } + case 8: { + message.invertMatch = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a HeaderMatch message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.networkservices.v1.HttpRoute.HeaderMatch + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.networkservices.v1.HttpRoute.HeaderMatch} HeaderMatch + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + HeaderMatch.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a HeaderMatch message. + * @function verify + * @memberof google.cloud.networkservices.v1.HttpRoute.HeaderMatch + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + HeaderMatch.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.exactMatch != null && message.hasOwnProperty("exactMatch")) { + properties.MatchType = 1; + if (!$util.isString(message.exactMatch)) + return "exactMatch: string expected"; + } + if (message.regexMatch != null && message.hasOwnProperty("regexMatch")) { + if (properties.MatchType === 1) + return "MatchType: multiple values"; + properties.MatchType = 1; + if (!$util.isString(message.regexMatch)) + return "regexMatch: string expected"; + } + if (message.prefixMatch != null && message.hasOwnProperty("prefixMatch")) { + if (properties.MatchType === 1) + return "MatchType: multiple values"; + properties.MatchType = 1; + if (!$util.isString(message.prefixMatch)) + return "prefixMatch: string expected"; + } + if (message.presentMatch != null && message.hasOwnProperty("presentMatch")) { + if (properties.MatchType === 1) + return "MatchType: multiple values"; + properties.MatchType = 1; + if (typeof message.presentMatch !== "boolean") + return "presentMatch: boolean expected"; + } + if (message.suffixMatch != null && message.hasOwnProperty("suffixMatch")) { + if (properties.MatchType === 1) + return "MatchType: multiple values"; + properties.MatchType = 1; + if (!$util.isString(message.suffixMatch)) + return "suffixMatch: string expected"; + } + if (message.rangeMatch != null && message.hasOwnProperty("rangeMatch")) { + if (properties.MatchType === 1) + return "MatchType: multiple values"; + properties.MatchType = 1; + { + var error = $root.google.cloud.networkservices.v1.HttpRoute.HeaderMatch.IntegerRange.verify(message.rangeMatch); + if (error) + return "rangeMatch." + error; + } + } + if (message.header != null && message.hasOwnProperty("header")) + if (!$util.isString(message.header)) + return "header: string expected"; + if (message.invertMatch != null && message.hasOwnProperty("invertMatch")) + if (typeof message.invertMatch !== "boolean") + return "invertMatch: boolean expected"; + return null; + }; + + /** + * Creates a HeaderMatch message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.networkservices.v1.HttpRoute.HeaderMatch + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.networkservices.v1.HttpRoute.HeaderMatch} HeaderMatch + */ + HeaderMatch.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.networkservices.v1.HttpRoute.HeaderMatch) + return object; + var message = new $root.google.cloud.networkservices.v1.HttpRoute.HeaderMatch(); + if (object.exactMatch != null) + message.exactMatch = String(object.exactMatch); + if (object.regexMatch != null) + message.regexMatch = String(object.regexMatch); + if (object.prefixMatch != null) + message.prefixMatch = String(object.prefixMatch); + if (object.presentMatch != null) + message.presentMatch = Boolean(object.presentMatch); + if (object.suffixMatch != null) + message.suffixMatch = String(object.suffixMatch); + if (object.rangeMatch != null) { + if (typeof object.rangeMatch !== "object") + throw TypeError(".google.cloud.networkservices.v1.HttpRoute.HeaderMatch.rangeMatch: object expected"); + message.rangeMatch = $root.google.cloud.networkservices.v1.HttpRoute.HeaderMatch.IntegerRange.fromObject(object.rangeMatch); + } + if (object.header != null) + message.header = String(object.header); + if (object.invertMatch != null) + message.invertMatch = Boolean(object.invertMatch); + return message; + }; + + /** + * Creates a plain object from a HeaderMatch message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.networkservices.v1.HttpRoute.HeaderMatch + * @static + * @param {google.cloud.networkservices.v1.HttpRoute.HeaderMatch} message HeaderMatch + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + HeaderMatch.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.header = ""; + object.invertMatch = false; + } + if (message.header != null && message.hasOwnProperty("header")) + object.header = message.header; + if (message.exactMatch != null && message.hasOwnProperty("exactMatch")) { + object.exactMatch = message.exactMatch; + if (options.oneofs) + object.MatchType = "exactMatch"; + } + if (message.regexMatch != null && message.hasOwnProperty("regexMatch")) { + object.regexMatch = message.regexMatch; + if (options.oneofs) + object.MatchType = "regexMatch"; + } + if (message.prefixMatch != null && message.hasOwnProperty("prefixMatch")) { + object.prefixMatch = message.prefixMatch; + if (options.oneofs) + object.MatchType = "prefixMatch"; + } + if (message.presentMatch != null && message.hasOwnProperty("presentMatch")) { + object.presentMatch = message.presentMatch; + if (options.oneofs) + object.MatchType = "presentMatch"; + } + if (message.suffixMatch != null && message.hasOwnProperty("suffixMatch")) { + object.suffixMatch = message.suffixMatch; + if (options.oneofs) + object.MatchType = "suffixMatch"; + } + if (message.rangeMatch != null && message.hasOwnProperty("rangeMatch")) { + object.rangeMatch = $root.google.cloud.networkservices.v1.HttpRoute.HeaderMatch.IntegerRange.toObject(message.rangeMatch, options); + if (options.oneofs) + object.MatchType = "rangeMatch"; + } + if (message.invertMatch != null && message.hasOwnProperty("invertMatch")) + object.invertMatch = message.invertMatch; + return object; + }; + + /** + * Converts this HeaderMatch to JSON. + * @function toJSON + * @memberof google.cloud.networkservices.v1.HttpRoute.HeaderMatch + * @instance + * @returns {Object.} JSON object + */ + HeaderMatch.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for HeaderMatch + * @function getTypeUrl + * @memberof google.cloud.networkservices.v1.HttpRoute.HeaderMatch + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + HeaderMatch.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.networkservices.v1.HttpRoute.HeaderMatch"; + }; + + HeaderMatch.IntegerRange = (function() { + + /** + * Properties of an IntegerRange. + * @memberof google.cloud.networkservices.v1.HttpRoute.HeaderMatch + * @interface IIntegerRange + * @property {number|null} [start] IntegerRange start + * @property {number|null} [end] IntegerRange end + */ + + /** + * Constructs a new IntegerRange. + * @memberof google.cloud.networkservices.v1.HttpRoute.HeaderMatch + * @classdesc Represents an IntegerRange. + * @implements IIntegerRange + * @constructor + * @param {google.cloud.networkservices.v1.HttpRoute.HeaderMatch.IIntegerRange=} [properties] Properties to set + */ + function IntegerRange(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * IntegerRange start. + * @member {number} start + * @memberof google.cloud.networkservices.v1.HttpRoute.HeaderMatch.IntegerRange + * @instance + */ + IntegerRange.prototype.start = 0; + + /** + * IntegerRange end. + * @member {number} end + * @memberof google.cloud.networkservices.v1.HttpRoute.HeaderMatch.IntegerRange + * @instance + */ + IntegerRange.prototype.end = 0; + + /** + * Creates a new IntegerRange instance using the specified properties. + * @function create + * @memberof google.cloud.networkservices.v1.HttpRoute.HeaderMatch.IntegerRange + * @static + * @param {google.cloud.networkservices.v1.HttpRoute.HeaderMatch.IIntegerRange=} [properties] Properties to set + * @returns {google.cloud.networkservices.v1.HttpRoute.HeaderMatch.IntegerRange} IntegerRange instance + */ + IntegerRange.create = function create(properties) { + return new IntegerRange(properties); + }; + + /** + * Encodes the specified IntegerRange message. Does not implicitly {@link google.cloud.networkservices.v1.HttpRoute.HeaderMatch.IntegerRange.verify|verify} messages. + * @function encode + * @memberof google.cloud.networkservices.v1.HttpRoute.HeaderMatch.IntegerRange + * @static + * @param {google.cloud.networkservices.v1.HttpRoute.HeaderMatch.IIntegerRange} message IntegerRange message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + IntegerRange.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 IntegerRange message, length delimited. Does not implicitly {@link google.cloud.networkservices.v1.HttpRoute.HeaderMatch.IntegerRange.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.networkservices.v1.HttpRoute.HeaderMatch.IntegerRange + * @static + * @param {google.cloud.networkservices.v1.HttpRoute.HeaderMatch.IIntegerRange} message IntegerRange message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + IntegerRange.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an IntegerRange message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.networkservices.v1.HttpRoute.HeaderMatch.IntegerRange + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.networkservices.v1.HttpRoute.HeaderMatch.IntegerRange} IntegerRange + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + IntegerRange.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.networkservices.v1.HttpRoute.HeaderMatch.IntegerRange(); + while (reader.pos < end) { + var tag = reader.uint32(); + 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 IntegerRange message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.networkservices.v1.HttpRoute.HeaderMatch.IntegerRange + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.networkservices.v1.HttpRoute.HeaderMatch.IntegerRange} IntegerRange + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + IntegerRange.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an IntegerRange message. + * @function verify + * @memberof google.cloud.networkservices.v1.HttpRoute.HeaderMatch.IntegerRange + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + IntegerRange.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 IntegerRange message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.networkservices.v1.HttpRoute.HeaderMatch.IntegerRange + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.networkservices.v1.HttpRoute.HeaderMatch.IntegerRange} IntegerRange + */ + IntegerRange.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.networkservices.v1.HttpRoute.HeaderMatch.IntegerRange) + return object; + var message = new $root.google.cloud.networkservices.v1.HttpRoute.HeaderMatch.IntegerRange(); + 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 IntegerRange message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.networkservices.v1.HttpRoute.HeaderMatch.IntegerRange + * @static + * @param {google.cloud.networkservices.v1.HttpRoute.HeaderMatch.IntegerRange} message IntegerRange + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + IntegerRange.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 IntegerRange to JSON. + * @function toJSON + * @memberof google.cloud.networkservices.v1.HttpRoute.HeaderMatch.IntegerRange + * @instance + * @returns {Object.} JSON object + */ + IntegerRange.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for IntegerRange + * @function getTypeUrl + * @memberof google.cloud.networkservices.v1.HttpRoute.HeaderMatch.IntegerRange + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + IntegerRange.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.networkservices.v1.HttpRoute.HeaderMatch.IntegerRange"; + }; + + return IntegerRange; + })(); + + return HeaderMatch; + })(); + + HttpRoute.QueryParameterMatch = (function() { + + /** + * Properties of a QueryParameterMatch. + * @memberof google.cloud.networkservices.v1.HttpRoute + * @interface IQueryParameterMatch + * @property {string|null} [exactMatch] QueryParameterMatch exactMatch + * @property {string|null} [regexMatch] QueryParameterMatch regexMatch + * @property {boolean|null} [presentMatch] QueryParameterMatch presentMatch + * @property {string|null} [queryParameter] QueryParameterMatch queryParameter + */ + + /** + * Constructs a new QueryParameterMatch. + * @memberof google.cloud.networkservices.v1.HttpRoute + * @classdesc Represents a QueryParameterMatch. + * @implements IQueryParameterMatch + * @constructor + * @param {google.cloud.networkservices.v1.HttpRoute.IQueryParameterMatch=} [properties] Properties to set + */ + function QueryParameterMatch(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * QueryParameterMatch exactMatch. + * @member {string|null|undefined} exactMatch + * @memberof google.cloud.networkservices.v1.HttpRoute.QueryParameterMatch + * @instance + */ + QueryParameterMatch.prototype.exactMatch = null; + + /** + * QueryParameterMatch regexMatch. + * @member {string|null|undefined} regexMatch + * @memberof google.cloud.networkservices.v1.HttpRoute.QueryParameterMatch + * @instance + */ + QueryParameterMatch.prototype.regexMatch = null; + + /** + * QueryParameterMatch presentMatch. + * @member {boolean|null|undefined} presentMatch + * @memberof google.cloud.networkservices.v1.HttpRoute.QueryParameterMatch + * @instance + */ + QueryParameterMatch.prototype.presentMatch = null; + + /** + * QueryParameterMatch queryParameter. + * @member {string} queryParameter + * @memberof google.cloud.networkservices.v1.HttpRoute.QueryParameterMatch + * @instance + */ + QueryParameterMatch.prototype.queryParameter = ""; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * QueryParameterMatch MatchType. + * @member {"exactMatch"|"regexMatch"|"presentMatch"|undefined} MatchType + * @memberof google.cloud.networkservices.v1.HttpRoute.QueryParameterMatch + * @instance + */ + Object.defineProperty(QueryParameterMatch.prototype, "MatchType", { + get: $util.oneOfGetter($oneOfFields = ["exactMatch", "regexMatch", "presentMatch"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new QueryParameterMatch instance using the specified properties. + * @function create + * @memberof google.cloud.networkservices.v1.HttpRoute.QueryParameterMatch + * @static + * @param {google.cloud.networkservices.v1.HttpRoute.IQueryParameterMatch=} [properties] Properties to set + * @returns {google.cloud.networkservices.v1.HttpRoute.QueryParameterMatch} QueryParameterMatch instance + */ + QueryParameterMatch.create = function create(properties) { + return new QueryParameterMatch(properties); + }; + + /** + * Encodes the specified QueryParameterMatch message. Does not implicitly {@link google.cloud.networkservices.v1.HttpRoute.QueryParameterMatch.verify|verify} messages. + * @function encode + * @memberof google.cloud.networkservices.v1.HttpRoute.QueryParameterMatch + * @static + * @param {google.cloud.networkservices.v1.HttpRoute.IQueryParameterMatch} message QueryParameterMatch message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + QueryParameterMatch.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.queryParameter != null && Object.hasOwnProperty.call(message, "queryParameter")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.queryParameter); + if (message.exactMatch != null && Object.hasOwnProperty.call(message, "exactMatch")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.exactMatch); + if (message.regexMatch != null && Object.hasOwnProperty.call(message, "regexMatch")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.regexMatch); + if (message.presentMatch != null && Object.hasOwnProperty.call(message, "presentMatch")) + writer.uint32(/* id 4, wireType 0 =*/32).bool(message.presentMatch); + return writer; + }; + + /** + * Encodes the specified QueryParameterMatch message, length delimited. Does not implicitly {@link google.cloud.networkservices.v1.HttpRoute.QueryParameterMatch.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.networkservices.v1.HttpRoute.QueryParameterMatch + * @static + * @param {google.cloud.networkservices.v1.HttpRoute.IQueryParameterMatch} message QueryParameterMatch message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + QueryParameterMatch.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a QueryParameterMatch message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.networkservices.v1.HttpRoute.QueryParameterMatch + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.networkservices.v1.HttpRoute.QueryParameterMatch} QueryParameterMatch + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + QueryParameterMatch.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.networkservices.v1.HttpRoute.QueryParameterMatch(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 2: { + message.exactMatch = reader.string(); + break; + } + case 3: { + message.regexMatch = reader.string(); + break; + } + case 4: { + message.presentMatch = reader.bool(); + break; + } + case 1: { + message.queryParameter = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a QueryParameterMatch message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.networkservices.v1.HttpRoute.QueryParameterMatch + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.networkservices.v1.HttpRoute.QueryParameterMatch} QueryParameterMatch + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + QueryParameterMatch.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a QueryParameterMatch message. + * @function verify + * @memberof google.cloud.networkservices.v1.HttpRoute.QueryParameterMatch + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + QueryParameterMatch.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.exactMatch != null && message.hasOwnProperty("exactMatch")) { + properties.MatchType = 1; + if (!$util.isString(message.exactMatch)) + return "exactMatch: string expected"; + } + if (message.regexMatch != null && message.hasOwnProperty("regexMatch")) { + if (properties.MatchType === 1) + return "MatchType: multiple values"; + properties.MatchType = 1; + if (!$util.isString(message.regexMatch)) + return "regexMatch: string expected"; + } + if (message.presentMatch != null && message.hasOwnProperty("presentMatch")) { + if (properties.MatchType === 1) + return "MatchType: multiple values"; + properties.MatchType = 1; + if (typeof message.presentMatch !== "boolean") + return "presentMatch: boolean expected"; + } + if (message.queryParameter != null && message.hasOwnProperty("queryParameter")) + if (!$util.isString(message.queryParameter)) + return "queryParameter: string expected"; + return null; + }; + + /** + * Creates a QueryParameterMatch message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.networkservices.v1.HttpRoute.QueryParameterMatch + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.networkservices.v1.HttpRoute.QueryParameterMatch} QueryParameterMatch + */ + QueryParameterMatch.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.networkservices.v1.HttpRoute.QueryParameterMatch) + return object; + var message = new $root.google.cloud.networkservices.v1.HttpRoute.QueryParameterMatch(); + if (object.exactMatch != null) + message.exactMatch = String(object.exactMatch); + if (object.regexMatch != null) + message.regexMatch = String(object.regexMatch); + if (object.presentMatch != null) + message.presentMatch = Boolean(object.presentMatch); + if (object.queryParameter != null) + message.queryParameter = String(object.queryParameter); + return message; + }; + + /** + * Creates a plain object from a QueryParameterMatch message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.networkservices.v1.HttpRoute.QueryParameterMatch + * @static + * @param {google.cloud.networkservices.v1.HttpRoute.QueryParameterMatch} message QueryParameterMatch + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + QueryParameterMatch.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.queryParameter = ""; + if (message.queryParameter != null && message.hasOwnProperty("queryParameter")) + object.queryParameter = message.queryParameter; + if (message.exactMatch != null && message.hasOwnProperty("exactMatch")) { + object.exactMatch = message.exactMatch; + if (options.oneofs) + object.MatchType = "exactMatch"; + } + if (message.regexMatch != null && message.hasOwnProperty("regexMatch")) { + object.regexMatch = message.regexMatch; + if (options.oneofs) + object.MatchType = "regexMatch"; + } + if (message.presentMatch != null && message.hasOwnProperty("presentMatch")) { + object.presentMatch = message.presentMatch; + if (options.oneofs) + object.MatchType = "presentMatch"; + } + return object; + }; + + /** + * Converts this QueryParameterMatch to JSON. + * @function toJSON + * @memberof google.cloud.networkservices.v1.HttpRoute.QueryParameterMatch + * @instance + * @returns {Object.} JSON object + */ + QueryParameterMatch.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for QueryParameterMatch + * @function getTypeUrl + * @memberof google.cloud.networkservices.v1.HttpRoute.QueryParameterMatch + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + QueryParameterMatch.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.networkservices.v1.HttpRoute.QueryParameterMatch"; + }; + + return QueryParameterMatch; + })(); + + HttpRoute.RouteMatch = (function() { + + /** + * Properties of a RouteMatch. + * @memberof google.cloud.networkservices.v1.HttpRoute + * @interface IRouteMatch + * @property {string|null} [fullPathMatch] RouteMatch fullPathMatch + * @property {string|null} [prefixMatch] RouteMatch prefixMatch + * @property {string|null} [regexMatch] RouteMatch regexMatch + * @property {boolean|null} [ignoreCase] RouteMatch ignoreCase + * @property {Array.|null} [headers] RouteMatch headers + * @property {Array.|null} [queryParameters] RouteMatch queryParameters + */ + + /** + * Constructs a new RouteMatch. + * @memberof google.cloud.networkservices.v1.HttpRoute + * @classdesc Represents a RouteMatch. + * @implements IRouteMatch + * @constructor + * @param {google.cloud.networkservices.v1.HttpRoute.IRouteMatch=} [properties] Properties to set + */ + function RouteMatch(properties) { + this.headers = []; + this.queryParameters = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * RouteMatch fullPathMatch. + * @member {string|null|undefined} fullPathMatch + * @memberof google.cloud.networkservices.v1.HttpRoute.RouteMatch + * @instance + */ + RouteMatch.prototype.fullPathMatch = null; + + /** + * RouteMatch prefixMatch. + * @member {string|null|undefined} prefixMatch + * @memberof google.cloud.networkservices.v1.HttpRoute.RouteMatch + * @instance + */ + RouteMatch.prototype.prefixMatch = null; + + /** + * RouteMatch regexMatch. + * @member {string|null|undefined} regexMatch + * @memberof google.cloud.networkservices.v1.HttpRoute.RouteMatch + * @instance + */ + RouteMatch.prototype.regexMatch = null; + + /** + * RouteMatch ignoreCase. + * @member {boolean} ignoreCase + * @memberof google.cloud.networkservices.v1.HttpRoute.RouteMatch + * @instance + */ + RouteMatch.prototype.ignoreCase = false; + + /** + * RouteMatch headers. + * @member {Array.} headers + * @memberof google.cloud.networkservices.v1.HttpRoute.RouteMatch + * @instance + */ + RouteMatch.prototype.headers = $util.emptyArray; + + /** + * RouteMatch queryParameters. + * @member {Array.} queryParameters + * @memberof google.cloud.networkservices.v1.HttpRoute.RouteMatch + * @instance + */ + RouteMatch.prototype.queryParameters = $util.emptyArray; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * RouteMatch PathMatch. + * @member {"fullPathMatch"|"prefixMatch"|"regexMatch"|undefined} PathMatch + * @memberof google.cloud.networkservices.v1.HttpRoute.RouteMatch + * @instance + */ + Object.defineProperty(RouteMatch.prototype, "PathMatch", { + get: $util.oneOfGetter($oneOfFields = ["fullPathMatch", "prefixMatch", "regexMatch"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new RouteMatch instance using the specified properties. + * @function create + * @memberof google.cloud.networkservices.v1.HttpRoute.RouteMatch + * @static + * @param {google.cloud.networkservices.v1.HttpRoute.IRouteMatch=} [properties] Properties to set + * @returns {google.cloud.networkservices.v1.HttpRoute.RouteMatch} RouteMatch instance + */ + RouteMatch.create = function create(properties) { + return new RouteMatch(properties); + }; + + /** + * Encodes the specified RouteMatch message. Does not implicitly {@link google.cloud.networkservices.v1.HttpRoute.RouteMatch.verify|verify} messages. + * @function encode + * @memberof google.cloud.networkservices.v1.HttpRoute.RouteMatch + * @static + * @param {google.cloud.networkservices.v1.HttpRoute.IRouteMatch} message RouteMatch message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RouteMatch.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.fullPathMatch != null && Object.hasOwnProperty.call(message, "fullPathMatch")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.fullPathMatch); + if (message.prefixMatch != null && Object.hasOwnProperty.call(message, "prefixMatch")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.prefixMatch); + if (message.regexMatch != null && Object.hasOwnProperty.call(message, "regexMatch")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.regexMatch); + if (message.ignoreCase != null && Object.hasOwnProperty.call(message, "ignoreCase")) + writer.uint32(/* id 4, wireType 0 =*/32).bool(message.ignoreCase); + if (message.headers != null && message.headers.length) + for (var i = 0; i < message.headers.length; ++i) + $root.google.cloud.networkservices.v1.HttpRoute.HeaderMatch.encode(message.headers[i], writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.queryParameters != null && message.queryParameters.length) + for (var i = 0; i < message.queryParameters.length; ++i) + $root.google.cloud.networkservices.v1.HttpRoute.QueryParameterMatch.encode(message.queryParameters[i], writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified RouteMatch message, length delimited. Does not implicitly {@link google.cloud.networkservices.v1.HttpRoute.RouteMatch.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.networkservices.v1.HttpRoute.RouteMatch + * @static + * @param {google.cloud.networkservices.v1.HttpRoute.IRouteMatch} message RouteMatch message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RouteMatch.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a RouteMatch message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.networkservices.v1.HttpRoute.RouteMatch + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.networkservices.v1.HttpRoute.RouteMatch} RouteMatch + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RouteMatch.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.networkservices.v1.HttpRoute.RouteMatch(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.fullPathMatch = reader.string(); + break; + } + case 2: { + message.prefixMatch = reader.string(); + break; + } + case 3: { + message.regexMatch = reader.string(); + break; + } + case 4: { + message.ignoreCase = reader.bool(); + break; + } + case 5: { + if (!(message.headers && message.headers.length)) + message.headers = []; + message.headers.push($root.google.cloud.networkservices.v1.HttpRoute.HeaderMatch.decode(reader, reader.uint32())); + break; + } + case 6: { + if (!(message.queryParameters && message.queryParameters.length)) + message.queryParameters = []; + message.queryParameters.push($root.google.cloud.networkservices.v1.HttpRoute.QueryParameterMatch.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a RouteMatch message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.networkservices.v1.HttpRoute.RouteMatch + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.networkservices.v1.HttpRoute.RouteMatch} RouteMatch + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RouteMatch.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a RouteMatch message. + * @function verify + * @memberof google.cloud.networkservices.v1.HttpRoute.RouteMatch + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + RouteMatch.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.fullPathMatch != null && message.hasOwnProperty("fullPathMatch")) { + properties.PathMatch = 1; + if (!$util.isString(message.fullPathMatch)) + return "fullPathMatch: string expected"; + } + if (message.prefixMatch != null && message.hasOwnProperty("prefixMatch")) { + if (properties.PathMatch === 1) + return "PathMatch: multiple values"; + properties.PathMatch = 1; + if (!$util.isString(message.prefixMatch)) + return "prefixMatch: string expected"; + } + if (message.regexMatch != null && message.hasOwnProperty("regexMatch")) { + if (properties.PathMatch === 1) + return "PathMatch: multiple values"; + properties.PathMatch = 1; + if (!$util.isString(message.regexMatch)) + return "regexMatch: string expected"; + } + if (message.ignoreCase != null && message.hasOwnProperty("ignoreCase")) + if (typeof message.ignoreCase !== "boolean") + return "ignoreCase: boolean expected"; + if (message.headers != null && message.hasOwnProperty("headers")) { + if (!Array.isArray(message.headers)) + return "headers: array expected"; + for (var i = 0; i < message.headers.length; ++i) { + var error = $root.google.cloud.networkservices.v1.HttpRoute.HeaderMatch.verify(message.headers[i]); + if (error) + return "headers." + error; + } + } + if (message.queryParameters != null && message.hasOwnProperty("queryParameters")) { + if (!Array.isArray(message.queryParameters)) + return "queryParameters: array expected"; + for (var i = 0; i < message.queryParameters.length; ++i) { + var error = $root.google.cloud.networkservices.v1.HttpRoute.QueryParameterMatch.verify(message.queryParameters[i]); + if (error) + return "queryParameters." + error; + } + } + return null; + }; + + /** + * Creates a RouteMatch message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.networkservices.v1.HttpRoute.RouteMatch + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.networkservices.v1.HttpRoute.RouteMatch} RouteMatch + */ + RouteMatch.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.networkservices.v1.HttpRoute.RouteMatch) + return object; + var message = new $root.google.cloud.networkservices.v1.HttpRoute.RouteMatch(); + if (object.fullPathMatch != null) + message.fullPathMatch = String(object.fullPathMatch); + if (object.prefixMatch != null) + message.prefixMatch = String(object.prefixMatch); + if (object.regexMatch != null) + message.regexMatch = String(object.regexMatch); + if (object.ignoreCase != null) + message.ignoreCase = Boolean(object.ignoreCase); + if (object.headers) { + if (!Array.isArray(object.headers)) + throw TypeError(".google.cloud.networkservices.v1.HttpRoute.RouteMatch.headers: array expected"); + message.headers = []; + for (var i = 0; i < object.headers.length; ++i) { + if (typeof object.headers[i] !== "object") + throw TypeError(".google.cloud.networkservices.v1.HttpRoute.RouteMatch.headers: object expected"); + message.headers[i] = $root.google.cloud.networkservices.v1.HttpRoute.HeaderMatch.fromObject(object.headers[i]); + } + } + if (object.queryParameters) { + if (!Array.isArray(object.queryParameters)) + throw TypeError(".google.cloud.networkservices.v1.HttpRoute.RouteMatch.queryParameters: array expected"); + message.queryParameters = []; + for (var i = 0; i < object.queryParameters.length; ++i) { + if (typeof object.queryParameters[i] !== "object") + throw TypeError(".google.cloud.networkservices.v1.HttpRoute.RouteMatch.queryParameters: object expected"); + message.queryParameters[i] = $root.google.cloud.networkservices.v1.HttpRoute.QueryParameterMatch.fromObject(object.queryParameters[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a RouteMatch message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.networkservices.v1.HttpRoute.RouteMatch + * @static + * @param {google.cloud.networkservices.v1.HttpRoute.RouteMatch} message RouteMatch + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + RouteMatch.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.headers = []; + object.queryParameters = []; + } + if (options.defaults) + object.ignoreCase = false; + if (message.fullPathMatch != null && message.hasOwnProperty("fullPathMatch")) { + object.fullPathMatch = message.fullPathMatch; + if (options.oneofs) + object.PathMatch = "fullPathMatch"; + } + if (message.prefixMatch != null && message.hasOwnProperty("prefixMatch")) { + object.prefixMatch = message.prefixMatch; + if (options.oneofs) + object.PathMatch = "prefixMatch"; + } + if (message.regexMatch != null && message.hasOwnProperty("regexMatch")) { + object.regexMatch = message.regexMatch; + if (options.oneofs) + object.PathMatch = "regexMatch"; + } + if (message.ignoreCase != null && message.hasOwnProperty("ignoreCase")) + object.ignoreCase = message.ignoreCase; + if (message.headers && message.headers.length) { + object.headers = []; + for (var j = 0; j < message.headers.length; ++j) + object.headers[j] = $root.google.cloud.networkservices.v1.HttpRoute.HeaderMatch.toObject(message.headers[j], options); + } + if (message.queryParameters && message.queryParameters.length) { + object.queryParameters = []; + for (var j = 0; j < message.queryParameters.length; ++j) + object.queryParameters[j] = $root.google.cloud.networkservices.v1.HttpRoute.QueryParameterMatch.toObject(message.queryParameters[j], options); + } + return object; + }; + + /** + * Converts this RouteMatch to JSON. + * @function toJSON + * @memberof google.cloud.networkservices.v1.HttpRoute.RouteMatch + * @instance + * @returns {Object.} JSON object + */ + RouteMatch.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for RouteMatch + * @function getTypeUrl + * @memberof google.cloud.networkservices.v1.HttpRoute.RouteMatch + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + RouteMatch.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.networkservices.v1.HttpRoute.RouteMatch"; + }; + + return RouteMatch; + })(); + + HttpRoute.Destination = (function() { + + /** + * Properties of a Destination. + * @memberof google.cloud.networkservices.v1.HttpRoute + * @interface IDestination + * @property {string|null} [serviceName] Destination serviceName + * @property {number|null} [weight] Destination weight + */ + + /** + * Constructs a new Destination. + * @memberof google.cloud.networkservices.v1.HttpRoute + * @classdesc Represents a Destination. + * @implements IDestination + * @constructor + * @param {google.cloud.networkservices.v1.HttpRoute.IDestination=} [properties] Properties to set + */ + function Destination(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Destination serviceName. + * @member {string} serviceName + * @memberof google.cloud.networkservices.v1.HttpRoute.Destination + * @instance + */ + Destination.prototype.serviceName = ""; + + /** + * Destination weight. + * @member {number} weight + * @memberof google.cloud.networkservices.v1.HttpRoute.Destination + * @instance + */ + Destination.prototype.weight = 0; + + /** + * Creates a new Destination instance using the specified properties. + * @function create + * @memberof google.cloud.networkservices.v1.HttpRoute.Destination + * @static + * @param {google.cloud.networkservices.v1.HttpRoute.IDestination=} [properties] Properties to set + * @returns {google.cloud.networkservices.v1.HttpRoute.Destination} Destination instance + */ + Destination.create = function create(properties) { + return new Destination(properties); + }; + + /** + * Encodes the specified Destination message. Does not implicitly {@link google.cloud.networkservices.v1.HttpRoute.Destination.verify|verify} messages. + * @function encode + * @memberof google.cloud.networkservices.v1.HttpRoute.Destination + * @static + * @param {google.cloud.networkservices.v1.HttpRoute.IDestination} message Destination message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Destination.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.serviceName != null && Object.hasOwnProperty.call(message, "serviceName")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.serviceName); + if (message.weight != null && Object.hasOwnProperty.call(message, "weight")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.weight); + return writer; + }; + + /** + * Encodes the specified Destination message, length delimited. Does not implicitly {@link google.cloud.networkservices.v1.HttpRoute.Destination.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.networkservices.v1.HttpRoute.Destination + * @static + * @param {google.cloud.networkservices.v1.HttpRoute.IDestination} message Destination message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Destination.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Destination message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.networkservices.v1.HttpRoute.Destination + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.networkservices.v1.HttpRoute.Destination} Destination + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Destination.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.networkservices.v1.HttpRoute.Destination(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.serviceName = reader.string(); + break; + } + case 2: { + message.weight = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Destination message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.networkservices.v1.HttpRoute.Destination + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.networkservices.v1.HttpRoute.Destination} Destination + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Destination.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Destination message. + * @function verify + * @memberof google.cloud.networkservices.v1.HttpRoute.Destination + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Destination.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.serviceName != null && message.hasOwnProperty("serviceName")) + if (!$util.isString(message.serviceName)) + return "serviceName: string expected"; + if (message.weight != null && message.hasOwnProperty("weight")) + if (!$util.isInteger(message.weight)) + return "weight: integer expected"; + return null; + }; + + /** + * Creates a Destination message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.networkservices.v1.HttpRoute.Destination + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.networkservices.v1.HttpRoute.Destination} Destination + */ + Destination.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.networkservices.v1.HttpRoute.Destination) + return object; + var message = new $root.google.cloud.networkservices.v1.HttpRoute.Destination(); + if (object.serviceName != null) + message.serviceName = String(object.serviceName); + if (object.weight != null) + message.weight = object.weight | 0; + return message; + }; + + /** + * Creates a plain object from a Destination message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.networkservices.v1.HttpRoute.Destination + * @static + * @param {google.cloud.networkservices.v1.HttpRoute.Destination} message Destination + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Destination.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.serviceName = ""; + object.weight = 0; + } + if (message.serviceName != null && message.hasOwnProperty("serviceName")) + object.serviceName = message.serviceName; + if (message.weight != null && message.hasOwnProperty("weight")) + object.weight = message.weight; + return object; + }; + + /** + * Converts this Destination to JSON. + * @function toJSON + * @memberof google.cloud.networkservices.v1.HttpRoute.Destination + * @instance + * @returns {Object.} JSON object + */ + Destination.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Destination + * @function getTypeUrl + * @memberof google.cloud.networkservices.v1.HttpRoute.Destination + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Destination.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.networkservices.v1.HttpRoute.Destination"; + }; + + return Destination; + })(); + + HttpRoute.Redirect = (function() { + + /** + * Properties of a Redirect. + * @memberof google.cloud.networkservices.v1.HttpRoute + * @interface IRedirect + * @property {string|null} [hostRedirect] Redirect hostRedirect + * @property {string|null} [pathRedirect] Redirect pathRedirect + * @property {string|null} [prefixRewrite] Redirect prefixRewrite + * @property {google.cloud.networkservices.v1.HttpRoute.Redirect.ResponseCode|null} [responseCode] Redirect responseCode + * @property {boolean|null} [httpsRedirect] Redirect httpsRedirect + * @property {boolean|null} [stripQuery] Redirect stripQuery + * @property {number|null} [portRedirect] Redirect portRedirect + */ + + /** + * Constructs a new Redirect. + * @memberof google.cloud.networkservices.v1.HttpRoute + * @classdesc Represents a Redirect. + * @implements IRedirect + * @constructor + * @param {google.cloud.networkservices.v1.HttpRoute.IRedirect=} [properties] Properties to set + */ + function Redirect(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Redirect hostRedirect. + * @member {string} hostRedirect + * @memberof google.cloud.networkservices.v1.HttpRoute.Redirect + * @instance + */ + Redirect.prototype.hostRedirect = ""; + + /** + * Redirect pathRedirect. + * @member {string} pathRedirect + * @memberof google.cloud.networkservices.v1.HttpRoute.Redirect + * @instance + */ + Redirect.prototype.pathRedirect = ""; + + /** + * Redirect prefixRewrite. + * @member {string} prefixRewrite + * @memberof google.cloud.networkservices.v1.HttpRoute.Redirect + * @instance + */ + Redirect.prototype.prefixRewrite = ""; + + /** + * Redirect responseCode. + * @member {google.cloud.networkservices.v1.HttpRoute.Redirect.ResponseCode} responseCode + * @memberof google.cloud.networkservices.v1.HttpRoute.Redirect + * @instance + */ + Redirect.prototype.responseCode = 0; + + /** + * Redirect httpsRedirect. + * @member {boolean} httpsRedirect + * @memberof google.cloud.networkservices.v1.HttpRoute.Redirect + * @instance + */ + Redirect.prototype.httpsRedirect = false; + + /** + * Redirect stripQuery. + * @member {boolean} stripQuery + * @memberof google.cloud.networkservices.v1.HttpRoute.Redirect + * @instance + */ + Redirect.prototype.stripQuery = false; + + /** + * Redirect portRedirect. + * @member {number} portRedirect + * @memberof google.cloud.networkservices.v1.HttpRoute.Redirect + * @instance + */ + Redirect.prototype.portRedirect = 0; + + /** + * Creates a new Redirect instance using the specified properties. + * @function create + * @memberof google.cloud.networkservices.v1.HttpRoute.Redirect + * @static + * @param {google.cloud.networkservices.v1.HttpRoute.IRedirect=} [properties] Properties to set + * @returns {google.cloud.networkservices.v1.HttpRoute.Redirect} Redirect instance + */ + Redirect.create = function create(properties) { + return new Redirect(properties); + }; + + /** + * Encodes the specified Redirect message. Does not implicitly {@link google.cloud.networkservices.v1.HttpRoute.Redirect.verify|verify} messages. + * @function encode + * @memberof google.cloud.networkservices.v1.HttpRoute.Redirect + * @static + * @param {google.cloud.networkservices.v1.HttpRoute.IRedirect} message Redirect message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Redirect.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.hostRedirect != null && Object.hasOwnProperty.call(message, "hostRedirect")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.hostRedirect); + if (message.pathRedirect != null && Object.hasOwnProperty.call(message, "pathRedirect")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.pathRedirect); + if (message.prefixRewrite != null && Object.hasOwnProperty.call(message, "prefixRewrite")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.prefixRewrite); + if (message.responseCode != null && Object.hasOwnProperty.call(message, "responseCode")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.responseCode); + if (message.httpsRedirect != null && Object.hasOwnProperty.call(message, "httpsRedirect")) + writer.uint32(/* id 5, wireType 0 =*/40).bool(message.httpsRedirect); + if (message.stripQuery != null && Object.hasOwnProperty.call(message, "stripQuery")) + writer.uint32(/* id 6, wireType 0 =*/48).bool(message.stripQuery); + if (message.portRedirect != null && Object.hasOwnProperty.call(message, "portRedirect")) + writer.uint32(/* id 7, wireType 0 =*/56).int32(message.portRedirect); + return writer; + }; + + /** + * Encodes the specified Redirect message, length delimited. Does not implicitly {@link google.cloud.networkservices.v1.HttpRoute.Redirect.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.networkservices.v1.HttpRoute.Redirect + * @static + * @param {google.cloud.networkservices.v1.HttpRoute.IRedirect} message Redirect message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Redirect.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Redirect message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.networkservices.v1.HttpRoute.Redirect + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.networkservices.v1.HttpRoute.Redirect} Redirect + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Redirect.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.networkservices.v1.HttpRoute.Redirect(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.hostRedirect = reader.string(); + break; + } + case 2: { + message.pathRedirect = reader.string(); + break; + } + case 3: { + message.prefixRewrite = reader.string(); + break; + } + case 4: { + message.responseCode = reader.int32(); + break; + } + case 5: { + message.httpsRedirect = reader.bool(); + break; + } + case 6: { + message.stripQuery = reader.bool(); + break; + } + case 7: { + message.portRedirect = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Redirect message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.networkservices.v1.HttpRoute.Redirect + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.networkservices.v1.HttpRoute.Redirect} Redirect + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Redirect.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Redirect message. + * @function verify + * @memberof google.cloud.networkservices.v1.HttpRoute.Redirect + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Redirect.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.hostRedirect != null && message.hasOwnProperty("hostRedirect")) + if (!$util.isString(message.hostRedirect)) + return "hostRedirect: string expected"; + if (message.pathRedirect != null && message.hasOwnProperty("pathRedirect")) + if (!$util.isString(message.pathRedirect)) + return "pathRedirect: string expected"; + if (message.prefixRewrite != null && message.hasOwnProperty("prefixRewrite")) + if (!$util.isString(message.prefixRewrite)) + return "prefixRewrite: string expected"; + if (message.responseCode != null && message.hasOwnProperty("responseCode")) + switch (message.responseCode) { + default: + return "responseCode: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + case 5: + break; + } + if (message.httpsRedirect != null && message.hasOwnProperty("httpsRedirect")) + if (typeof message.httpsRedirect !== "boolean") + return "httpsRedirect: boolean expected"; + if (message.stripQuery != null && message.hasOwnProperty("stripQuery")) + if (typeof message.stripQuery !== "boolean") + return "stripQuery: boolean expected"; + if (message.portRedirect != null && message.hasOwnProperty("portRedirect")) + if (!$util.isInteger(message.portRedirect)) + return "portRedirect: integer expected"; + return null; + }; + + /** + * Creates a Redirect message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.networkservices.v1.HttpRoute.Redirect + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.networkservices.v1.HttpRoute.Redirect} Redirect + */ + Redirect.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.networkservices.v1.HttpRoute.Redirect) + return object; + var message = new $root.google.cloud.networkservices.v1.HttpRoute.Redirect(); + if (object.hostRedirect != null) + message.hostRedirect = String(object.hostRedirect); + if (object.pathRedirect != null) + message.pathRedirect = String(object.pathRedirect); + if (object.prefixRewrite != null) + message.prefixRewrite = String(object.prefixRewrite); + switch (object.responseCode) { + default: + if (typeof object.responseCode === "number") { + message.responseCode = object.responseCode; + break; + } + break; + case "RESPONSE_CODE_UNSPECIFIED": + case 0: + message.responseCode = 0; + break; + case "MOVED_PERMANENTLY_DEFAULT": + case 1: + message.responseCode = 1; + break; + case "FOUND": + case 2: + message.responseCode = 2; + break; + case "SEE_OTHER": + case 3: + message.responseCode = 3; + break; + case "TEMPORARY_REDIRECT": + case 4: + message.responseCode = 4; + break; + case "PERMANENT_REDIRECT": + case 5: + message.responseCode = 5; + break; + } + if (object.httpsRedirect != null) + message.httpsRedirect = Boolean(object.httpsRedirect); + if (object.stripQuery != null) + message.stripQuery = Boolean(object.stripQuery); + if (object.portRedirect != null) + message.portRedirect = object.portRedirect | 0; + return message; + }; + + /** + * Creates a plain object from a Redirect message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.networkservices.v1.HttpRoute.Redirect + * @static + * @param {google.cloud.networkservices.v1.HttpRoute.Redirect} message Redirect + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Redirect.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.hostRedirect = ""; + object.pathRedirect = ""; + object.prefixRewrite = ""; + object.responseCode = options.enums === String ? "RESPONSE_CODE_UNSPECIFIED" : 0; + object.httpsRedirect = false; + object.stripQuery = false; + object.portRedirect = 0; + } + if (message.hostRedirect != null && message.hasOwnProperty("hostRedirect")) + object.hostRedirect = message.hostRedirect; + if (message.pathRedirect != null && message.hasOwnProperty("pathRedirect")) + object.pathRedirect = message.pathRedirect; + if (message.prefixRewrite != null && message.hasOwnProperty("prefixRewrite")) + object.prefixRewrite = message.prefixRewrite; + if (message.responseCode != null && message.hasOwnProperty("responseCode")) + object.responseCode = options.enums === String ? $root.google.cloud.networkservices.v1.HttpRoute.Redirect.ResponseCode[message.responseCode] === undefined ? message.responseCode : $root.google.cloud.networkservices.v1.HttpRoute.Redirect.ResponseCode[message.responseCode] : message.responseCode; + if (message.httpsRedirect != null && message.hasOwnProperty("httpsRedirect")) + object.httpsRedirect = message.httpsRedirect; + if (message.stripQuery != null && message.hasOwnProperty("stripQuery")) + object.stripQuery = message.stripQuery; + if (message.portRedirect != null && message.hasOwnProperty("portRedirect")) + object.portRedirect = message.portRedirect; + return object; + }; + + /** + * Converts this Redirect to JSON. + * @function toJSON + * @memberof google.cloud.networkservices.v1.HttpRoute.Redirect + * @instance + * @returns {Object.} JSON object + */ + Redirect.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Redirect + * @function getTypeUrl + * @memberof google.cloud.networkservices.v1.HttpRoute.Redirect + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Redirect.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.networkservices.v1.HttpRoute.Redirect"; + }; + + /** + * ResponseCode enum. + * @name google.cloud.networkservices.v1.HttpRoute.Redirect.ResponseCode + * @enum {number} + * @property {number} RESPONSE_CODE_UNSPECIFIED=0 RESPONSE_CODE_UNSPECIFIED value + * @property {number} MOVED_PERMANENTLY_DEFAULT=1 MOVED_PERMANENTLY_DEFAULT value + * @property {number} FOUND=2 FOUND value + * @property {number} SEE_OTHER=3 SEE_OTHER value + * @property {number} TEMPORARY_REDIRECT=4 TEMPORARY_REDIRECT value + * @property {number} PERMANENT_REDIRECT=5 PERMANENT_REDIRECT value + */ + Redirect.ResponseCode = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "RESPONSE_CODE_UNSPECIFIED"] = 0; + values[valuesById[1] = "MOVED_PERMANENTLY_DEFAULT"] = 1; + values[valuesById[2] = "FOUND"] = 2; + values[valuesById[3] = "SEE_OTHER"] = 3; + values[valuesById[4] = "TEMPORARY_REDIRECT"] = 4; + values[valuesById[5] = "PERMANENT_REDIRECT"] = 5; + return values; + })(); + + return Redirect; + })(); + + HttpRoute.FaultInjectionPolicy = (function() { + + /** + * Properties of a FaultInjectionPolicy. + * @memberof google.cloud.networkservices.v1.HttpRoute + * @interface IFaultInjectionPolicy + * @property {google.cloud.networkservices.v1.HttpRoute.FaultInjectionPolicy.IDelay|null} [delay] FaultInjectionPolicy delay + * @property {google.cloud.networkservices.v1.HttpRoute.FaultInjectionPolicy.IAbort|null} [abort] FaultInjectionPolicy abort + */ + + /** + * Constructs a new FaultInjectionPolicy. + * @memberof google.cloud.networkservices.v1.HttpRoute + * @classdesc Represents a FaultInjectionPolicy. + * @implements IFaultInjectionPolicy + * @constructor + * @param {google.cloud.networkservices.v1.HttpRoute.IFaultInjectionPolicy=} [properties] Properties to set + */ + function FaultInjectionPolicy(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * FaultInjectionPolicy delay. + * @member {google.cloud.networkservices.v1.HttpRoute.FaultInjectionPolicy.IDelay|null|undefined} delay + * @memberof google.cloud.networkservices.v1.HttpRoute.FaultInjectionPolicy + * @instance + */ + FaultInjectionPolicy.prototype.delay = null; + + /** + * FaultInjectionPolicy abort. + * @member {google.cloud.networkservices.v1.HttpRoute.FaultInjectionPolicy.IAbort|null|undefined} abort + * @memberof google.cloud.networkservices.v1.HttpRoute.FaultInjectionPolicy + * @instance + */ + FaultInjectionPolicy.prototype.abort = null; + + /** + * Creates a new FaultInjectionPolicy instance using the specified properties. + * @function create + * @memberof google.cloud.networkservices.v1.HttpRoute.FaultInjectionPolicy + * @static + * @param {google.cloud.networkservices.v1.HttpRoute.IFaultInjectionPolicy=} [properties] Properties to set + * @returns {google.cloud.networkservices.v1.HttpRoute.FaultInjectionPolicy} FaultInjectionPolicy instance + */ + FaultInjectionPolicy.create = function create(properties) { + return new FaultInjectionPolicy(properties); + }; + + /** + * Encodes the specified FaultInjectionPolicy message. Does not implicitly {@link google.cloud.networkservices.v1.HttpRoute.FaultInjectionPolicy.verify|verify} messages. + * @function encode + * @memberof google.cloud.networkservices.v1.HttpRoute.FaultInjectionPolicy + * @static + * @param {google.cloud.networkservices.v1.HttpRoute.IFaultInjectionPolicy} message FaultInjectionPolicy message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FaultInjectionPolicy.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.delay != null && Object.hasOwnProperty.call(message, "delay")) + $root.google.cloud.networkservices.v1.HttpRoute.FaultInjectionPolicy.Delay.encode(message.delay, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.abort != null && Object.hasOwnProperty.call(message, "abort")) + $root.google.cloud.networkservices.v1.HttpRoute.FaultInjectionPolicy.Abort.encode(message.abort, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified FaultInjectionPolicy message, length delimited. Does not implicitly {@link google.cloud.networkservices.v1.HttpRoute.FaultInjectionPolicy.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.networkservices.v1.HttpRoute.FaultInjectionPolicy + * @static + * @param {google.cloud.networkservices.v1.HttpRoute.IFaultInjectionPolicy} message FaultInjectionPolicy message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FaultInjectionPolicy.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a FaultInjectionPolicy message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.networkservices.v1.HttpRoute.FaultInjectionPolicy + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.networkservices.v1.HttpRoute.FaultInjectionPolicy} FaultInjectionPolicy + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FaultInjectionPolicy.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.networkservices.v1.HttpRoute.FaultInjectionPolicy(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.delay = $root.google.cloud.networkservices.v1.HttpRoute.FaultInjectionPolicy.Delay.decode(reader, reader.uint32()); + break; + } + case 2: { + message.abort = $root.google.cloud.networkservices.v1.HttpRoute.FaultInjectionPolicy.Abort.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a FaultInjectionPolicy message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.networkservices.v1.HttpRoute.FaultInjectionPolicy + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.networkservices.v1.HttpRoute.FaultInjectionPolicy} FaultInjectionPolicy + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FaultInjectionPolicy.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a FaultInjectionPolicy message. + * @function verify + * @memberof google.cloud.networkservices.v1.HttpRoute.FaultInjectionPolicy + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + FaultInjectionPolicy.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.delay != null && message.hasOwnProperty("delay")) { + var error = $root.google.cloud.networkservices.v1.HttpRoute.FaultInjectionPolicy.Delay.verify(message.delay); + if (error) + return "delay." + error; + } + if (message.abort != null && message.hasOwnProperty("abort")) { + var error = $root.google.cloud.networkservices.v1.HttpRoute.FaultInjectionPolicy.Abort.verify(message.abort); + if (error) + return "abort." + error; + } + return null; + }; + + /** + * Creates a FaultInjectionPolicy message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.networkservices.v1.HttpRoute.FaultInjectionPolicy + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.networkservices.v1.HttpRoute.FaultInjectionPolicy} FaultInjectionPolicy + */ + FaultInjectionPolicy.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.networkservices.v1.HttpRoute.FaultInjectionPolicy) + return object; + var message = new $root.google.cloud.networkservices.v1.HttpRoute.FaultInjectionPolicy(); + if (object.delay != null) { + if (typeof object.delay !== "object") + throw TypeError(".google.cloud.networkservices.v1.HttpRoute.FaultInjectionPolicy.delay: object expected"); + message.delay = $root.google.cloud.networkservices.v1.HttpRoute.FaultInjectionPolicy.Delay.fromObject(object.delay); + } + if (object.abort != null) { + if (typeof object.abort !== "object") + throw TypeError(".google.cloud.networkservices.v1.HttpRoute.FaultInjectionPolicy.abort: object expected"); + message.abort = $root.google.cloud.networkservices.v1.HttpRoute.FaultInjectionPolicy.Abort.fromObject(object.abort); + } + return message; + }; + + /** + * Creates a plain object from a FaultInjectionPolicy message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.networkservices.v1.HttpRoute.FaultInjectionPolicy + * @static + * @param {google.cloud.networkservices.v1.HttpRoute.FaultInjectionPolicy} message FaultInjectionPolicy + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + FaultInjectionPolicy.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.delay = null; + object.abort = null; + } + if (message.delay != null && message.hasOwnProperty("delay")) + object.delay = $root.google.cloud.networkservices.v1.HttpRoute.FaultInjectionPolicy.Delay.toObject(message.delay, options); + if (message.abort != null && message.hasOwnProperty("abort")) + object.abort = $root.google.cloud.networkservices.v1.HttpRoute.FaultInjectionPolicy.Abort.toObject(message.abort, options); + return object; + }; + + /** + * Converts this FaultInjectionPolicy to JSON. + * @function toJSON + * @memberof google.cloud.networkservices.v1.HttpRoute.FaultInjectionPolicy + * @instance + * @returns {Object.} JSON object + */ + FaultInjectionPolicy.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for FaultInjectionPolicy + * @function getTypeUrl + * @memberof google.cloud.networkservices.v1.HttpRoute.FaultInjectionPolicy + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FaultInjectionPolicy.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.networkservices.v1.HttpRoute.FaultInjectionPolicy"; + }; + + FaultInjectionPolicy.Delay = (function() { + + /** + * Properties of a Delay. + * @memberof google.cloud.networkservices.v1.HttpRoute.FaultInjectionPolicy + * @interface IDelay + * @property {google.protobuf.IDuration|null} [fixedDelay] Delay fixedDelay + * @property {number|null} [percentage] Delay percentage + */ + + /** + * Constructs a new Delay. + * @memberof google.cloud.networkservices.v1.HttpRoute.FaultInjectionPolicy + * @classdesc Represents a Delay. + * @implements IDelay + * @constructor + * @param {google.cloud.networkservices.v1.HttpRoute.FaultInjectionPolicy.IDelay=} [properties] Properties to set + */ + function Delay(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Delay fixedDelay. + * @member {google.protobuf.IDuration|null|undefined} fixedDelay + * @memberof google.cloud.networkservices.v1.HttpRoute.FaultInjectionPolicy.Delay + * @instance + */ + Delay.prototype.fixedDelay = null; + + /** + * Delay percentage. + * @member {number} percentage + * @memberof google.cloud.networkservices.v1.HttpRoute.FaultInjectionPolicy.Delay + * @instance + */ + Delay.prototype.percentage = 0; + + /** + * Creates a new Delay instance using the specified properties. + * @function create + * @memberof google.cloud.networkservices.v1.HttpRoute.FaultInjectionPolicy.Delay + * @static + * @param {google.cloud.networkservices.v1.HttpRoute.FaultInjectionPolicy.IDelay=} [properties] Properties to set + * @returns {google.cloud.networkservices.v1.HttpRoute.FaultInjectionPolicy.Delay} Delay instance + */ + Delay.create = function create(properties) { + return new Delay(properties); + }; + + /** + * Encodes the specified Delay message. Does not implicitly {@link google.cloud.networkservices.v1.HttpRoute.FaultInjectionPolicy.Delay.verify|verify} messages. + * @function encode + * @memberof google.cloud.networkservices.v1.HttpRoute.FaultInjectionPolicy.Delay + * @static + * @param {google.cloud.networkservices.v1.HttpRoute.FaultInjectionPolicy.IDelay} message Delay message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Delay.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.fixedDelay != null && Object.hasOwnProperty.call(message, "fixedDelay")) + $root.google.protobuf.Duration.encode(message.fixedDelay, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.percentage != null && Object.hasOwnProperty.call(message, "percentage")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.percentage); + return writer; + }; + + /** + * Encodes the specified Delay message, length delimited. Does not implicitly {@link google.cloud.networkservices.v1.HttpRoute.FaultInjectionPolicy.Delay.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.networkservices.v1.HttpRoute.FaultInjectionPolicy.Delay + * @static + * @param {google.cloud.networkservices.v1.HttpRoute.FaultInjectionPolicy.IDelay} message Delay message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Delay.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Delay message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.networkservices.v1.HttpRoute.FaultInjectionPolicy.Delay + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.networkservices.v1.HttpRoute.FaultInjectionPolicy.Delay} Delay + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Delay.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.networkservices.v1.HttpRoute.FaultInjectionPolicy.Delay(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.fixedDelay = $root.google.protobuf.Duration.decode(reader, reader.uint32()); + break; + } + case 2: { + message.percentage = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Delay message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.networkservices.v1.HttpRoute.FaultInjectionPolicy.Delay + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.networkservices.v1.HttpRoute.FaultInjectionPolicy.Delay} Delay + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Delay.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Delay message. + * @function verify + * @memberof google.cloud.networkservices.v1.HttpRoute.FaultInjectionPolicy.Delay + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Delay.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.fixedDelay != null && message.hasOwnProperty("fixedDelay")) { + var error = $root.google.protobuf.Duration.verify(message.fixedDelay); + if (error) + return "fixedDelay." + error; + } + if (message.percentage != null && message.hasOwnProperty("percentage")) + if (!$util.isInteger(message.percentage)) + return "percentage: integer expected"; + return null; + }; + + /** + * Creates a Delay message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.networkservices.v1.HttpRoute.FaultInjectionPolicy.Delay + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.networkservices.v1.HttpRoute.FaultInjectionPolicy.Delay} Delay + */ + Delay.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.networkservices.v1.HttpRoute.FaultInjectionPolicy.Delay) + return object; + var message = new $root.google.cloud.networkservices.v1.HttpRoute.FaultInjectionPolicy.Delay(); + if (object.fixedDelay != null) { + if (typeof object.fixedDelay !== "object") + throw TypeError(".google.cloud.networkservices.v1.HttpRoute.FaultInjectionPolicy.Delay.fixedDelay: object expected"); + message.fixedDelay = $root.google.protobuf.Duration.fromObject(object.fixedDelay); + } + if (object.percentage != null) + message.percentage = object.percentage | 0; + return message; + }; + + /** + * Creates a plain object from a Delay message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.networkservices.v1.HttpRoute.FaultInjectionPolicy.Delay + * @static + * @param {google.cloud.networkservices.v1.HttpRoute.FaultInjectionPolicy.Delay} message Delay + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Delay.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.fixedDelay = null; + object.percentage = 0; + } + if (message.fixedDelay != null && message.hasOwnProperty("fixedDelay")) + object.fixedDelay = $root.google.protobuf.Duration.toObject(message.fixedDelay, options); + if (message.percentage != null && message.hasOwnProperty("percentage")) + object.percentage = message.percentage; + return object; + }; + + /** + * Converts this Delay to JSON. + * @function toJSON + * @memberof google.cloud.networkservices.v1.HttpRoute.FaultInjectionPolicy.Delay + * @instance + * @returns {Object.} JSON object + */ + Delay.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Delay + * @function getTypeUrl + * @memberof google.cloud.networkservices.v1.HttpRoute.FaultInjectionPolicy.Delay + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Delay.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.networkservices.v1.HttpRoute.FaultInjectionPolicy.Delay"; + }; + + return Delay; + })(); + + FaultInjectionPolicy.Abort = (function() { + + /** + * Properties of an Abort. + * @memberof google.cloud.networkservices.v1.HttpRoute.FaultInjectionPolicy + * @interface IAbort + * @property {number|null} [httpStatus] Abort httpStatus + * @property {number|null} [percentage] Abort percentage + */ + + /** + * Constructs a new Abort. + * @memberof google.cloud.networkservices.v1.HttpRoute.FaultInjectionPolicy + * @classdesc Represents an Abort. + * @implements IAbort + * @constructor + * @param {google.cloud.networkservices.v1.HttpRoute.FaultInjectionPolicy.IAbort=} [properties] Properties to set + */ + function Abort(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Abort httpStatus. + * @member {number} httpStatus + * @memberof google.cloud.networkservices.v1.HttpRoute.FaultInjectionPolicy.Abort + * @instance + */ + Abort.prototype.httpStatus = 0; + + /** + * Abort percentage. + * @member {number} percentage + * @memberof google.cloud.networkservices.v1.HttpRoute.FaultInjectionPolicy.Abort + * @instance + */ + Abort.prototype.percentage = 0; + + /** + * Creates a new Abort instance using the specified properties. + * @function create + * @memberof google.cloud.networkservices.v1.HttpRoute.FaultInjectionPolicy.Abort + * @static + * @param {google.cloud.networkservices.v1.HttpRoute.FaultInjectionPolicy.IAbort=} [properties] Properties to set + * @returns {google.cloud.networkservices.v1.HttpRoute.FaultInjectionPolicy.Abort} Abort instance + */ + Abort.create = function create(properties) { + return new Abort(properties); + }; + + /** + * Encodes the specified Abort message. Does not implicitly {@link google.cloud.networkservices.v1.HttpRoute.FaultInjectionPolicy.Abort.verify|verify} messages. + * @function encode + * @memberof google.cloud.networkservices.v1.HttpRoute.FaultInjectionPolicy.Abort + * @static + * @param {google.cloud.networkservices.v1.HttpRoute.FaultInjectionPolicy.IAbort} message Abort message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Abort.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.httpStatus != null && Object.hasOwnProperty.call(message, "httpStatus")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.httpStatus); + if (message.percentage != null && Object.hasOwnProperty.call(message, "percentage")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.percentage); + return writer; + }; + + /** + * Encodes the specified Abort message, length delimited. Does not implicitly {@link google.cloud.networkservices.v1.HttpRoute.FaultInjectionPolicy.Abort.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.networkservices.v1.HttpRoute.FaultInjectionPolicy.Abort + * @static + * @param {google.cloud.networkservices.v1.HttpRoute.FaultInjectionPolicy.IAbort} message Abort message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Abort.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an Abort message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.networkservices.v1.HttpRoute.FaultInjectionPolicy.Abort + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.networkservices.v1.HttpRoute.FaultInjectionPolicy.Abort} Abort + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Abort.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.networkservices.v1.HttpRoute.FaultInjectionPolicy.Abort(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.httpStatus = reader.int32(); + break; + } + case 2: { + message.percentage = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an Abort message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.networkservices.v1.HttpRoute.FaultInjectionPolicy.Abort + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.networkservices.v1.HttpRoute.FaultInjectionPolicy.Abort} Abort + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Abort.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an Abort message. + * @function verify + * @memberof google.cloud.networkservices.v1.HttpRoute.FaultInjectionPolicy.Abort + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Abort.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.httpStatus != null && message.hasOwnProperty("httpStatus")) + if (!$util.isInteger(message.httpStatus)) + return "httpStatus: integer expected"; + if (message.percentage != null && message.hasOwnProperty("percentage")) + if (!$util.isInteger(message.percentage)) + return "percentage: integer expected"; + return null; + }; + + /** + * Creates an Abort message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.networkservices.v1.HttpRoute.FaultInjectionPolicy.Abort + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.networkservices.v1.HttpRoute.FaultInjectionPolicy.Abort} Abort + */ + Abort.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.networkservices.v1.HttpRoute.FaultInjectionPolicy.Abort) + return object; + var message = new $root.google.cloud.networkservices.v1.HttpRoute.FaultInjectionPolicy.Abort(); + if (object.httpStatus != null) + message.httpStatus = object.httpStatus | 0; + if (object.percentage != null) + message.percentage = object.percentage | 0; + return message; + }; + + /** + * Creates a plain object from an Abort message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.networkservices.v1.HttpRoute.FaultInjectionPolicy.Abort + * @static + * @param {google.cloud.networkservices.v1.HttpRoute.FaultInjectionPolicy.Abort} message Abort + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Abort.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.httpStatus = 0; + object.percentage = 0; + } + if (message.httpStatus != null && message.hasOwnProperty("httpStatus")) + object.httpStatus = message.httpStatus; + if (message.percentage != null && message.hasOwnProperty("percentage")) + object.percentage = message.percentage; + return object; + }; + + /** + * Converts this Abort to JSON. + * @function toJSON + * @memberof google.cloud.networkservices.v1.HttpRoute.FaultInjectionPolicy.Abort + * @instance + * @returns {Object.} JSON object + */ + Abort.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Abort + * @function getTypeUrl + * @memberof google.cloud.networkservices.v1.HttpRoute.FaultInjectionPolicy.Abort + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Abort.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.networkservices.v1.HttpRoute.FaultInjectionPolicy.Abort"; + }; + + return Abort; + })(); + + return FaultInjectionPolicy; + })(); + + HttpRoute.HeaderModifier = (function() { + + /** + * Properties of a HeaderModifier. + * @memberof google.cloud.networkservices.v1.HttpRoute + * @interface IHeaderModifier + * @property {Object.|null} [set] HeaderModifier set + * @property {Object.|null} [add] HeaderModifier add + * @property {Array.|null} [remove] HeaderModifier remove + */ + + /** + * Constructs a new HeaderModifier. + * @memberof google.cloud.networkservices.v1.HttpRoute + * @classdesc Represents a HeaderModifier. + * @implements IHeaderModifier + * @constructor + * @param {google.cloud.networkservices.v1.HttpRoute.IHeaderModifier=} [properties] Properties to set + */ + function HeaderModifier(properties) { + this.set = {}; + this.add = {}; + this.remove = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * HeaderModifier set. + * @member {Object.} set + * @memberof google.cloud.networkservices.v1.HttpRoute.HeaderModifier + * @instance + */ + HeaderModifier.prototype.set = $util.emptyObject; + + /** + * HeaderModifier add. + * @member {Object.} add + * @memberof google.cloud.networkservices.v1.HttpRoute.HeaderModifier + * @instance + */ + HeaderModifier.prototype.add = $util.emptyObject; + + /** + * HeaderModifier remove. + * @member {Array.} remove + * @memberof google.cloud.networkservices.v1.HttpRoute.HeaderModifier + * @instance + */ + HeaderModifier.prototype.remove = $util.emptyArray; + + /** + * Creates a new HeaderModifier instance using the specified properties. + * @function create + * @memberof google.cloud.networkservices.v1.HttpRoute.HeaderModifier + * @static + * @param {google.cloud.networkservices.v1.HttpRoute.IHeaderModifier=} [properties] Properties to set + * @returns {google.cloud.networkservices.v1.HttpRoute.HeaderModifier} HeaderModifier instance + */ + HeaderModifier.create = function create(properties) { + return new HeaderModifier(properties); + }; + + /** + * Encodes the specified HeaderModifier message. Does not implicitly {@link google.cloud.networkservices.v1.HttpRoute.HeaderModifier.verify|verify} messages. + * @function encode + * @memberof google.cloud.networkservices.v1.HttpRoute.HeaderModifier + * @static + * @param {google.cloud.networkservices.v1.HttpRoute.IHeaderModifier} message HeaderModifier message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + HeaderModifier.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.set != null && Object.hasOwnProperty.call(message, "set")) + for (var keys = Object.keys(message.set), i = 0; i < keys.length; ++i) + writer.uint32(/* id 1, wireType 2 =*/10).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.set[keys[i]]).ldelim(); + if (message.add != null && Object.hasOwnProperty.call(message, "add")) + for (var keys = Object.keys(message.add), 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.add[keys[i]]).ldelim(); + if (message.remove != null && message.remove.length) + for (var i = 0; i < message.remove.length; ++i) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.remove[i]); + return writer; + }; + + /** + * Encodes the specified HeaderModifier message, length delimited. Does not implicitly {@link google.cloud.networkservices.v1.HttpRoute.HeaderModifier.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.networkservices.v1.HttpRoute.HeaderModifier + * @static + * @param {google.cloud.networkservices.v1.HttpRoute.IHeaderModifier} message HeaderModifier message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + HeaderModifier.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a HeaderModifier message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.networkservices.v1.HttpRoute.HeaderModifier + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.networkservices.v1.HttpRoute.HeaderModifier} HeaderModifier + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + HeaderModifier.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.networkservices.v1.HttpRoute.HeaderModifier(), key, value; + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (message.set === $util.emptyObject) + message.set = {}; + 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.set[key] = value; + break; + } + case 2: { + if (message.add === $util.emptyObject) + message.add = {}; + 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.add[key] = value; + break; + } + case 3: { + if (!(message.remove && message.remove.length)) + message.remove = []; + message.remove.push(reader.string()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a HeaderModifier message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.networkservices.v1.HttpRoute.HeaderModifier + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.networkservices.v1.HttpRoute.HeaderModifier} HeaderModifier + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + HeaderModifier.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a HeaderModifier message. + * @function verify + * @memberof google.cloud.networkservices.v1.HttpRoute.HeaderModifier + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + HeaderModifier.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.set != null && message.hasOwnProperty("set")) { + if (!$util.isObject(message.set)) + return "set: object expected"; + var key = Object.keys(message.set); + for (var i = 0; i < key.length; ++i) + if (!$util.isString(message.set[key[i]])) + return "set: string{k:string} expected"; + } + if (message.add != null && message.hasOwnProperty("add")) { + if (!$util.isObject(message.add)) + return "add: object expected"; + var key = Object.keys(message.add); + for (var i = 0; i < key.length; ++i) + if (!$util.isString(message.add[key[i]])) + return "add: string{k:string} expected"; + } + if (message.remove != null && message.hasOwnProperty("remove")) { + if (!Array.isArray(message.remove)) + return "remove: array expected"; + for (var i = 0; i < message.remove.length; ++i) + if (!$util.isString(message.remove[i])) + return "remove: string[] expected"; + } + return null; + }; + + /** + * Creates a HeaderModifier message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.networkservices.v1.HttpRoute.HeaderModifier + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.networkservices.v1.HttpRoute.HeaderModifier} HeaderModifier + */ + HeaderModifier.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.networkservices.v1.HttpRoute.HeaderModifier) + return object; + var message = new $root.google.cloud.networkservices.v1.HttpRoute.HeaderModifier(); + if (object.set) { + if (typeof object.set !== "object") + throw TypeError(".google.cloud.networkservices.v1.HttpRoute.HeaderModifier.set: object expected"); + message.set = {}; + for (var keys = Object.keys(object.set), i = 0; i < keys.length; ++i) + message.set[keys[i]] = String(object.set[keys[i]]); + } + if (object.add) { + if (typeof object.add !== "object") + throw TypeError(".google.cloud.networkservices.v1.HttpRoute.HeaderModifier.add: object expected"); + message.add = {}; + for (var keys = Object.keys(object.add), i = 0; i < keys.length; ++i) + message.add[keys[i]] = String(object.add[keys[i]]); + } + if (object.remove) { + if (!Array.isArray(object.remove)) + throw TypeError(".google.cloud.networkservices.v1.HttpRoute.HeaderModifier.remove: array expected"); + message.remove = []; + for (var i = 0; i < object.remove.length; ++i) + message.remove[i] = String(object.remove[i]); + } + return message; + }; + + /** + * Creates a plain object from a HeaderModifier message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.networkservices.v1.HttpRoute.HeaderModifier + * @static + * @param {google.cloud.networkservices.v1.HttpRoute.HeaderModifier} message HeaderModifier + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + HeaderModifier.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.remove = []; + if (options.objects || options.defaults) { + object.set = {}; + object.add = {}; + } + var keys2; + if (message.set && (keys2 = Object.keys(message.set)).length) { + object.set = {}; + for (var j = 0; j < keys2.length; ++j) + object.set[keys2[j]] = message.set[keys2[j]]; + } + if (message.add && (keys2 = Object.keys(message.add)).length) { + object.add = {}; + for (var j = 0; j < keys2.length; ++j) + object.add[keys2[j]] = message.add[keys2[j]]; + } + if (message.remove && message.remove.length) { + object.remove = []; + for (var j = 0; j < message.remove.length; ++j) + object.remove[j] = message.remove[j]; + } + return object; + }; + + /** + * Converts this HeaderModifier to JSON. + * @function toJSON + * @memberof google.cloud.networkservices.v1.HttpRoute.HeaderModifier + * @instance + * @returns {Object.} JSON object + */ + HeaderModifier.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for HeaderModifier + * @function getTypeUrl + * @memberof google.cloud.networkservices.v1.HttpRoute.HeaderModifier + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + HeaderModifier.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.networkservices.v1.HttpRoute.HeaderModifier"; + }; + + return HeaderModifier; + })(); + + HttpRoute.URLRewrite = (function() { + + /** + * Properties of a URLRewrite. + * @memberof google.cloud.networkservices.v1.HttpRoute + * @interface IURLRewrite + * @property {string|null} [pathPrefixRewrite] URLRewrite pathPrefixRewrite + * @property {string|null} [hostRewrite] URLRewrite hostRewrite + */ + + /** + * Constructs a new URLRewrite. + * @memberof google.cloud.networkservices.v1.HttpRoute + * @classdesc Represents a URLRewrite. + * @implements IURLRewrite + * @constructor + * @param {google.cloud.networkservices.v1.HttpRoute.IURLRewrite=} [properties] Properties to set + */ + function URLRewrite(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * URLRewrite pathPrefixRewrite. + * @member {string} pathPrefixRewrite + * @memberof google.cloud.networkservices.v1.HttpRoute.URLRewrite + * @instance + */ + URLRewrite.prototype.pathPrefixRewrite = ""; + + /** + * URLRewrite hostRewrite. + * @member {string} hostRewrite + * @memberof google.cloud.networkservices.v1.HttpRoute.URLRewrite + * @instance + */ + URLRewrite.prototype.hostRewrite = ""; + + /** + * Creates a new URLRewrite instance using the specified properties. + * @function create + * @memberof google.cloud.networkservices.v1.HttpRoute.URLRewrite + * @static + * @param {google.cloud.networkservices.v1.HttpRoute.IURLRewrite=} [properties] Properties to set + * @returns {google.cloud.networkservices.v1.HttpRoute.URLRewrite} URLRewrite instance + */ + URLRewrite.create = function create(properties) { + return new URLRewrite(properties); + }; + + /** + * Encodes the specified URLRewrite message. Does not implicitly {@link google.cloud.networkservices.v1.HttpRoute.URLRewrite.verify|verify} messages. + * @function encode + * @memberof google.cloud.networkservices.v1.HttpRoute.URLRewrite + * @static + * @param {google.cloud.networkservices.v1.HttpRoute.IURLRewrite} message URLRewrite message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + URLRewrite.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.pathPrefixRewrite != null && Object.hasOwnProperty.call(message, "pathPrefixRewrite")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.pathPrefixRewrite); + if (message.hostRewrite != null && Object.hasOwnProperty.call(message, "hostRewrite")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.hostRewrite); + return writer; + }; + + /** + * Encodes the specified URLRewrite message, length delimited. Does not implicitly {@link google.cloud.networkservices.v1.HttpRoute.URLRewrite.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.networkservices.v1.HttpRoute.URLRewrite + * @static + * @param {google.cloud.networkservices.v1.HttpRoute.IURLRewrite} message URLRewrite message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + URLRewrite.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a URLRewrite message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.networkservices.v1.HttpRoute.URLRewrite + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.networkservices.v1.HttpRoute.URLRewrite} URLRewrite + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + URLRewrite.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.networkservices.v1.HttpRoute.URLRewrite(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.pathPrefixRewrite = reader.string(); + break; + } + case 2: { + message.hostRewrite = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a URLRewrite message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.networkservices.v1.HttpRoute.URLRewrite + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.networkservices.v1.HttpRoute.URLRewrite} URLRewrite + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + URLRewrite.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a URLRewrite message. + * @function verify + * @memberof google.cloud.networkservices.v1.HttpRoute.URLRewrite + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + URLRewrite.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.pathPrefixRewrite != null && message.hasOwnProperty("pathPrefixRewrite")) + if (!$util.isString(message.pathPrefixRewrite)) + return "pathPrefixRewrite: string expected"; + if (message.hostRewrite != null && message.hasOwnProperty("hostRewrite")) + if (!$util.isString(message.hostRewrite)) + return "hostRewrite: string expected"; + return null; + }; + + /** + * Creates a URLRewrite message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.networkservices.v1.HttpRoute.URLRewrite + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.networkservices.v1.HttpRoute.URLRewrite} URLRewrite + */ + URLRewrite.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.networkservices.v1.HttpRoute.URLRewrite) + return object; + var message = new $root.google.cloud.networkservices.v1.HttpRoute.URLRewrite(); + if (object.pathPrefixRewrite != null) + message.pathPrefixRewrite = String(object.pathPrefixRewrite); + if (object.hostRewrite != null) + message.hostRewrite = String(object.hostRewrite); + return message; + }; + + /** + * Creates a plain object from a URLRewrite message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.networkservices.v1.HttpRoute.URLRewrite + * @static + * @param {google.cloud.networkservices.v1.HttpRoute.URLRewrite} message URLRewrite + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + URLRewrite.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.pathPrefixRewrite = ""; + object.hostRewrite = ""; + } + if (message.pathPrefixRewrite != null && message.hasOwnProperty("pathPrefixRewrite")) + object.pathPrefixRewrite = message.pathPrefixRewrite; + if (message.hostRewrite != null && message.hasOwnProperty("hostRewrite")) + object.hostRewrite = message.hostRewrite; + return object; + }; + + /** + * Converts this URLRewrite to JSON. + * @function toJSON + * @memberof google.cloud.networkservices.v1.HttpRoute.URLRewrite + * @instance + * @returns {Object.} JSON object + */ + URLRewrite.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for URLRewrite + * @function getTypeUrl + * @memberof google.cloud.networkservices.v1.HttpRoute.URLRewrite + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + URLRewrite.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.networkservices.v1.HttpRoute.URLRewrite"; + }; + + return URLRewrite; + })(); + + HttpRoute.RetryPolicy = (function() { + + /** + * Properties of a RetryPolicy. + * @memberof google.cloud.networkservices.v1.HttpRoute + * @interface IRetryPolicy + * @property {Array.|null} [retryConditions] RetryPolicy retryConditions + * @property {number|null} [numRetries] RetryPolicy numRetries + * @property {google.protobuf.IDuration|null} [perTryTimeout] RetryPolicy perTryTimeout + */ + + /** + * Constructs a new RetryPolicy. + * @memberof google.cloud.networkservices.v1.HttpRoute + * @classdesc Represents a RetryPolicy. + * @implements IRetryPolicy + * @constructor + * @param {google.cloud.networkservices.v1.HttpRoute.IRetryPolicy=} [properties] Properties to set + */ + function RetryPolicy(properties) { + this.retryConditions = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * RetryPolicy retryConditions. + * @member {Array.} retryConditions + * @memberof google.cloud.networkservices.v1.HttpRoute.RetryPolicy + * @instance + */ + RetryPolicy.prototype.retryConditions = $util.emptyArray; + + /** + * RetryPolicy numRetries. + * @member {number} numRetries + * @memberof google.cloud.networkservices.v1.HttpRoute.RetryPolicy + * @instance + */ + RetryPolicy.prototype.numRetries = 0; + + /** + * RetryPolicy perTryTimeout. + * @member {google.protobuf.IDuration|null|undefined} perTryTimeout + * @memberof google.cloud.networkservices.v1.HttpRoute.RetryPolicy + * @instance + */ + RetryPolicy.prototype.perTryTimeout = null; + + /** + * Creates a new RetryPolicy instance using the specified properties. + * @function create + * @memberof google.cloud.networkservices.v1.HttpRoute.RetryPolicy + * @static + * @param {google.cloud.networkservices.v1.HttpRoute.IRetryPolicy=} [properties] Properties to set + * @returns {google.cloud.networkservices.v1.HttpRoute.RetryPolicy} RetryPolicy instance + */ + RetryPolicy.create = function create(properties) { + return new RetryPolicy(properties); + }; + + /** + * Encodes the specified RetryPolicy message. Does not implicitly {@link google.cloud.networkservices.v1.HttpRoute.RetryPolicy.verify|verify} messages. + * @function encode + * @memberof google.cloud.networkservices.v1.HttpRoute.RetryPolicy + * @static + * @param {google.cloud.networkservices.v1.HttpRoute.IRetryPolicy} message RetryPolicy message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RetryPolicy.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.retryConditions != null && message.retryConditions.length) + for (var i = 0; i < message.retryConditions.length; ++i) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.retryConditions[i]); + if (message.numRetries != null && Object.hasOwnProperty.call(message, "numRetries")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.numRetries); + if (message.perTryTimeout != null && Object.hasOwnProperty.call(message, "perTryTimeout")) + $root.google.protobuf.Duration.encode(message.perTryTimeout, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified RetryPolicy message, length delimited. Does not implicitly {@link google.cloud.networkservices.v1.HttpRoute.RetryPolicy.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.networkservices.v1.HttpRoute.RetryPolicy + * @static + * @param {google.cloud.networkservices.v1.HttpRoute.IRetryPolicy} message RetryPolicy message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RetryPolicy.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a RetryPolicy message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.networkservices.v1.HttpRoute.RetryPolicy + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.networkservices.v1.HttpRoute.RetryPolicy} RetryPolicy + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RetryPolicy.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.networkservices.v1.HttpRoute.RetryPolicy(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.retryConditions && message.retryConditions.length)) + message.retryConditions = []; + message.retryConditions.push(reader.string()); + break; + } + case 2: { + message.numRetries = reader.int32(); + break; + } + case 3: { + message.perTryTimeout = $root.google.protobuf.Duration.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a RetryPolicy message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.networkservices.v1.HttpRoute.RetryPolicy + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.networkservices.v1.HttpRoute.RetryPolicy} RetryPolicy + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RetryPolicy.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a RetryPolicy message. + * @function verify + * @memberof google.cloud.networkservices.v1.HttpRoute.RetryPolicy + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + RetryPolicy.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.retryConditions != null && message.hasOwnProperty("retryConditions")) { + if (!Array.isArray(message.retryConditions)) + return "retryConditions: array expected"; + for (var i = 0; i < message.retryConditions.length; ++i) + if (!$util.isString(message.retryConditions[i])) + return "retryConditions: string[] expected"; + } + if (message.numRetries != null && message.hasOwnProperty("numRetries")) + if (!$util.isInteger(message.numRetries)) + return "numRetries: integer expected"; + if (message.perTryTimeout != null && message.hasOwnProperty("perTryTimeout")) { + var error = $root.google.protobuf.Duration.verify(message.perTryTimeout); + if (error) + return "perTryTimeout." + error; + } + return null; + }; + + /** + * Creates a RetryPolicy message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.networkservices.v1.HttpRoute.RetryPolicy + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.networkservices.v1.HttpRoute.RetryPolicy} RetryPolicy + */ + RetryPolicy.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.networkservices.v1.HttpRoute.RetryPolicy) + return object; + var message = new $root.google.cloud.networkservices.v1.HttpRoute.RetryPolicy(); + if (object.retryConditions) { + if (!Array.isArray(object.retryConditions)) + throw TypeError(".google.cloud.networkservices.v1.HttpRoute.RetryPolicy.retryConditions: array expected"); + message.retryConditions = []; + for (var i = 0; i < object.retryConditions.length; ++i) + message.retryConditions[i] = String(object.retryConditions[i]); + } + if (object.numRetries != null) + message.numRetries = object.numRetries | 0; + if (object.perTryTimeout != null) { + if (typeof object.perTryTimeout !== "object") + throw TypeError(".google.cloud.networkservices.v1.HttpRoute.RetryPolicy.perTryTimeout: object expected"); + message.perTryTimeout = $root.google.protobuf.Duration.fromObject(object.perTryTimeout); + } + return message; + }; + + /** + * Creates a plain object from a RetryPolicy message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.networkservices.v1.HttpRoute.RetryPolicy + * @static + * @param {google.cloud.networkservices.v1.HttpRoute.RetryPolicy} message RetryPolicy + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + RetryPolicy.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.retryConditions = []; + if (options.defaults) { + object.numRetries = 0; + object.perTryTimeout = null; + } + if (message.retryConditions && message.retryConditions.length) { + object.retryConditions = []; + for (var j = 0; j < message.retryConditions.length; ++j) + object.retryConditions[j] = message.retryConditions[j]; + } + if (message.numRetries != null && message.hasOwnProperty("numRetries")) + object.numRetries = message.numRetries; + if (message.perTryTimeout != null && message.hasOwnProperty("perTryTimeout")) + object.perTryTimeout = $root.google.protobuf.Duration.toObject(message.perTryTimeout, options); + return object; + }; + + /** + * Converts this RetryPolicy to JSON. + * @function toJSON + * @memberof google.cloud.networkservices.v1.HttpRoute.RetryPolicy + * @instance + * @returns {Object.} JSON object + */ + RetryPolicy.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for RetryPolicy + * @function getTypeUrl + * @memberof google.cloud.networkservices.v1.HttpRoute.RetryPolicy + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + RetryPolicy.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.networkservices.v1.HttpRoute.RetryPolicy"; + }; + + return RetryPolicy; + })(); + + HttpRoute.RequestMirrorPolicy = (function() { + + /** + * Properties of a RequestMirrorPolicy. + * @memberof google.cloud.networkservices.v1.HttpRoute + * @interface IRequestMirrorPolicy + * @property {google.cloud.networkservices.v1.HttpRoute.IDestination|null} [destination] RequestMirrorPolicy destination + */ + + /** + * Constructs a new RequestMirrorPolicy. + * @memberof google.cloud.networkservices.v1.HttpRoute + * @classdesc Represents a RequestMirrorPolicy. + * @implements IRequestMirrorPolicy + * @constructor + * @param {google.cloud.networkservices.v1.HttpRoute.IRequestMirrorPolicy=} [properties] Properties to set + */ + function RequestMirrorPolicy(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * RequestMirrorPolicy destination. + * @member {google.cloud.networkservices.v1.HttpRoute.IDestination|null|undefined} destination + * @memberof google.cloud.networkservices.v1.HttpRoute.RequestMirrorPolicy + * @instance + */ + RequestMirrorPolicy.prototype.destination = null; + + /** + * Creates a new RequestMirrorPolicy instance using the specified properties. + * @function create + * @memberof google.cloud.networkservices.v1.HttpRoute.RequestMirrorPolicy + * @static + * @param {google.cloud.networkservices.v1.HttpRoute.IRequestMirrorPolicy=} [properties] Properties to set + * @returns {google.cloud.networkservices.v1.HttpRoute.RequestMirrorPolicy} RequestMirrorPolicy instance + */ + RequestMirrorPolicy.create = function create(properties) { + return new RequestMirrorPolicy(properties); + }; + + /** + * Encodes the specified RequestMirrorPolicy message. Does not implicitly {@link google.cloud.networkservices.v1.HttpRoute.RequestMirrorPolicy.verify|verify} messages. + * @function encode + * @memberof google.cloud.networkservices.v1.HttpRoute.RequestMirrorPolicy + * @static + * @param {google.cloud.networkservices.v1.HttpRoute.IRequestMirrorPolicy} message RequestMirrorPolicy message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RequestMirrorPolicy.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.destination != null && Object.hasOwnProperty.call(message, "destination")) + $root.google.cloud.networkservices.v1.HttpRoute.Destination.encode(message.destination, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified RequestMirrorPolicy message, length delimited. Does not implicitly {@link google.cloud.networkservices.v1.HttpRoute.RequestMirrorPolicy.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.networkservices.v1.HttpRoute.RequestMirrorPolicy + * @static + * @param {google.cloud.networkservices.v1.HttpRoute.IRequestMirrorPolicy} message RequestMirrorPolicy message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RequestMirrorPolicy.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a RequestMirrorPolicy message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.networkservices.v1.HttpRoute.RequestMirrorPolicy + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.networkservices.v1.HttpRoute.RequestMirrorPolicy} RequestMirrorPolicy + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RequestMirrorPolicy.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.networkservices.v1.HttpRoute.RequestMirrorPolicy(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.destination = $root.google.cloud.networkservices.v1.HttpRoute.Destination.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a RequestMirrorPolicy message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.networkservices.v1.HttpRoute.RequestMirrorPolicy + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.networkservices.v1.HttpRoute.RequestMirrorPolicy} RequestMirrorPolicy + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RequestMirrorPolicy.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a RequestMirrorPolicy message. + * @function verify + * @memberof google.cloud.networkservices.v1.HttpRoute.RequestMirrorPolicy + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + RequestMirrorPolicy.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.destination != null && message.hasOwnProperty("destination")) { + var error = $root.google.cloud.networkservices.v1.HttpRoute.Destination.verify(message.destination); + if (error) + return "destination." + error; + } + return null; + }; + + /** + * Creates a RequestMirrorPolicy message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.networkservices.v1.HttpRoute.RequestMirrorPolicy + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.networkservices.v1.HttpRoute.RequestMirrorPolicy} RequestMirrorPolicy + */ + RequestMirrorPolicy.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.networkservices.v1.HttpRoute.RequestMirrorPolicy) + return object; + var message = new $root.google.cloud.networkservices.v1.HttpRoute.RequestMirrorPolicy(); + if (object.destination != null) { + if (typeof object.destination !== "object") + throw TypeError(".google.cloud.networkservices.v1.HttpRoute.RequestMirrorPolicy.destination: object expected"); + message.destination = $root.google.cloud.networkservices.v1.HttpRoute.Destination.fromObject(object.destination); + } + return message; + }; + + /** + * Creates a plain object from a RequestMirrorPolicy message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.networkservices.v1.HttpRoute.RequestMirrorPolicy + * @static + * @param {google.cloud.networkservices.v1.HttpRoute.RequestMirrorPolicy} message RequestMirrorPolicy + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + RequestMirrorPolicy.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.destination = null; + if (message.destination != null && message.hasOwnProperty("destination")) + object.destination = $root.google.cloud.networkservices.v1.HttpRoute.Destination.toObject(message.destination, options); + return object; + }; + + /** + * Converts this RequestMirrorPolicy to JSON. + * @function toJSON + * @memberof google.cloud.networkservices.v1.HttpRoute.RequestMirrorPolicy + * @instance + * @returns {Object.} JSON object + */ + RequestMirrorPolicy.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for RequestMirrorPolicy + * @function getTypeUrl + * @memberof google.cloud.networkservices.v1.HttpRoute.RequestMirrorPolicy + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + RequestMirrorPolicy.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.networkservices.v1.HttpRoute.RequestMirrorPolicy"; + }; + + return RequestMirrorPolicy; + })(); + + HttpRoute.CorsPolicy = (function() { + + /** + * Properties of a CorsPolicy. + * @memberof google.cloud.networkservices.v1.HttpRoute + * @interface ICorsPolicy + * @property {Array.|null} [allowOrigins] CorsPolicy allowOrigins + * @property {Array.|null} [allowOriginRegexes] CorsPolicy allowOriginRegexes + * @property {Array.|null} [allowMethods] CorsPolicy allowMethods + * @property {Array.|null} [allowHeaders] CorsPolicy allowHeaders + * @property {Array.|null} [exposeHeaders] CorsPolicy exposeHeaders + * @property {string|null} [maxAge] CorsPolicy maxAge + * @property {boolean|null} [allowCredentials] CorsPolicy allowCredentials + * @property {boolean|null} [disabled] CorsPolicy disabled + */ + + /** + * Constructs a new CorsPolicy. + * @memberof google.cloud.networkservices.v1.HttpRoute + * @classdesc Represents a CorsPolicy. + * @implements ICorsPolicy + * @constructor + * @param {google.cloud.networkservices.v1.HttpRoute.ICorsPolicy=} [properties] Properties to set + */ + function CorsPolicy(properties) { + this.allowOrigins = []; + this.allowOriginRegexes = []; + this.allowMethods = []; + this.allowHeaders = []; + this.exposeHeaders = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * CorsPolicy allowOrigins. + * @member {Array.} allowOrigins + * @memberof google.cloud.networkservices.v1.HttpRoute.CorsPolicy + * @instance + */ + CorsPolicy.prototype.allowOrigins = $util.emptyArray; + + /** + * CorsPolicy allowOriginRegexes. + * @member {Array.} allowOriginRegexes + * @memberof google.cloud.networkservices.v1.HttpRoute.CorsPolicy + * @instance + */ + CorsPolicy.prototype.allowOriginRegexes = $util.emptyArray; + + /** + * CorsPolicy allowMethods. + * @member {Array.} allowMethods + * @memberof google.cloud.networkservices.v1.HttpRoute.CorsPolicy + * @instance + */ + CorsPolicy.prototype.allowMethods = $util.emptyArray; + + /** + * CorsPolicy allowHeaders. + * @member {Array.} allowHeaders + * @memberof google.cloud.networkservices.v1.HttpRoute.CorsPolicy + * @instance + */ + CorsPolicy.prototype.allowHeaders = $util.emptyArray; + + /** + * CorsPolicy exposeHeaders. + * @member {Array.} exposeHeaders + * @memberof google.cloud.networkservices.v1.HttpRoute.CorsPolicy + * @instance + */ + CorsPolicy.prototype.exposeHeaders = $util.emptyArray; + + /** + * CorsPolicy maxAge. + * @member {string} maxAge + * @memberof google.cloud.networkservices.v1.HttpRoute.CorsPolicy + * @instance + */ + CorsPolicy.prototype.maxAge = ""; + + /** + * CorsPolicy allowCredentials. + * @member {boolean} allowCredentials + * @memberof google.cloud.networkservices.v1.HttpRoute.CorsPolicy + * @instance + */ + CorsPolicy.prototype.allowCredentials = false; + + /** + * CorsPolicy disabled. + * @member {boolean} disabled + * @memberof google.cloud.networkservices.v1.HttpRoute.CorsPolicy + * @instance + */ + CorsPolicy.prototype.disabled = false; + + /** + * Creates a new CorsPolicy instance using the specified properties. + * @function create + * @memberof google.cloud.networkservices.v1.HttpRoute.CorsPolicy + * @static + * @param {google.cloud.networkservices.v1.HttpRoute.ICorsPolicy=} [properties] Properties to set + * @returns {google.cloud.networkservices.v1.HttpRoute.CorsPolicy} CorsPolicy instance + */ + CorsPolicy.create = function create(properties) { + return new CorsPolicy(properties); + }; + + /** + * Encodes the specified CorsPolicy message. Does not implicitly {@link google.cloud.networkservices.v1.HttpRoute.CorsPolicy.verify|verify} messages. + * @function encode + * @memberof google.cloud.networkservices.v1.HttpRoute.CorsPolicy + * @static + * @param {google.cloud.networkservices.v1.HttpRoute.ICorsPolicy} message CorsPolicy message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CorsPolicy.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.allowOrigins != null && message.allowOrigins.length) + for (var i = 0; i < message.allowOrigins.length; ++i) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.allowOrigins[i]); + if (message.allowOriginRegexes != null && message.allowOriginRegexes.length) + for (var i = 0; i < message.allowOriginRegexes.length; ++i) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.allowOriginRegexes[i]); + if (message.allowMethods != null && message.allowMethods.length) + for (var i = 0; i < message.allowMethods.length; ++i) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.allowMethods[i]); + if (message.allowHeaders != null && message.allowHeaders.length) + for (var i = 0; i < message.allowHeaders.length; ++i) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.allowHeaders[i]); + if (message.exposeHeaders != null && message.exposeHeaders.length) + for (var i = 0; i < message.exposeHeaders.length; ++i) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.exposeHeaders[i]); + if (message.maxAge != null && Object.hasOwnProperty.call(message, "maxAge")) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.maxAge); + if (message.allowCredentials != null && Object.hasOwnProperty.call(message, "allowCredentials")) + writer.uint32(/* id 7, wireType 0 =*/56).bool(message.allowCredentials); + if (message.disabled != null && Object.hasOwnProperty.call(message, "disabled")) + writer.uint32(/* id 8, wireType 0 =*/64).bool(message.disabled); + return writer; + }; + + /** + * Encodes the specified CorsPolicy message, length delimited. Does not implicitly {@link google.cloud.networkservices.v1.HttpRoute.CorsPolicy.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.networkservices.v1.HttpRoute.CorsPolicy + * @static + * @param {google.cloud.networkservices.v1.HttpRoute.ICorsPolicy} message CorsPolicy message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CorsPolicy.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CorsPolicy message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.networkservices.v1.HttpRoute.CorsPolicy + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.networkservices.v1.HttpRoute.CorsPolicy} CorsPolicy + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CorsPolicy.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.networkservices.v1.HttpRoute.CorsPolicy(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.allowOrigins && message.allowOrigins.length)) + message.allowOrigins = []; + message.allowOrigins.push(reader.string()); + break; + } + case 2: { + if (!(message.allowOriginRegexes && message.allowOriginRegexes.length)) + message.allowOriginRegexes = []; + message.allowOriginRegexes.push(reader.string()); + break; + } + case 3: { + if (!(message.allowMethods && message.allowMethods.length)) + message.allowMethods = []; + message.allowMethods.push(reader.string()); + break; + } + case 4: { + if (!(message.allowHeaders && message.allowHeaders.length)) + message.allowHeaders = []; + message.allowHeaders.push(reader.string()); + break; + } + case 5: { + if (!(message.exposeHeaders && message.exposeHeaders.length)) + message.exposeHeaders = []; + message.exposeHeaders.push(reader.string()); + break; + } + case 6: { + message.maxAge = reader.string(); + break; + } + case 7: { + message.allowCredentials = reader.bool(); + break; + } + case 8: { + message.disabled = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CorsPolicy message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.networkservices.v1.HttpRoute.CorsPolicy + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.networkservices.v1.HttpRoute.CorsPolicy} CorsPolicy + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CorsPolicy.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CorsPolicy message. + * @function verify + * @memberof google.cloud.networkservices.v1.HttpRoute.CorsPolicy + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CorsPolicy.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.allowOrigins != null && message.hasOwnProperty("allowOrigins")) { + if (!Array.isArray(message.allowOrigins)) + return "allowOrigins: array expected"; + for (var i = 0; i < message.allowOrigins.length; ++i) + if (!$util.isString(message.allowOrigins[i])) + return "allowOrigins: string[] expected"; + } + if (message.allowOriginRegexes != null && message.hasOwnProperty("allowOriginRegexes")) { + if (!Array.isArray(message.allowOriginRegexes)) + return "allowOriginRegexes: array expected"; + for (var i = 0; i < message.allowOriginRegexes.length; ++i) + if (!$util.isString(message.allowOriginRegexes[i])) + return "allowOriginRegexes: string[] expected"; + } + if (message.allowMethods != null && message.hasOwnProperty("allowMethods")) { + if (!Array.isArray(message.allowMethods)) + return "allowMethods: array expected"; + for (var i = 0; i < message.allowMethods.length; ++i) + if (!$util.isString(message.allowMethods[i])) + return "allowMethods: string[] expected"; + } + if (message.allowHeaders != null && message.hasOwnProperty("allowHeaders")) { + if (!Array.isArray(message.allowHeaders)) + return "allowHeaders: array expected"; + for (var i = 0; i < message.allowHeaders.length; ++i) + if (!$util.isString(message.allowHeaders[i])) + return "allowHeaders: string[] expected"; + } + if (message.exposeHeaders != null && message.hasOwnProperty("exposeHeaders")) { + if (!Array.isArray(message.exposeHeaders)) + return "exposeHeaders: array expected"; + for (var i = 0; i < message.exposeHeaders.length; ++i) + if (!$util.isString(message.exposeHeaders[i])) + return "exposeHeaders: string[] expected"; + } + if (message.maxAge != null && message.hasOwnProperty("maxAge")) + if (!$util.isString(message.maxAge)) + return "maxAge: string expected"; + if (message.allowCredentials != null && message.hasOwnProperty("allowCredentials")) + if (typeof message.allowCredentials !== "boolean") + return "allowCredentials: boolean expected"; + if (message.disabled != null && message.hasOwnProperty("disabled")) + if (typeof message.disabled !== "boolean") + return "disabled: boolean expected"; + return null; + }; + + /** + * Creates a CorsPolicy message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.networkservices.v1.HttpRoute.CorsPolicy + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.networkservices.v1.HttpRoute.CorsPolicy} CorsPolicy + */ + CorsPolicy.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.networkservices.v1.HttpRoute.CorsPolicy) + return object; + var message = new $root.google.cloud.networkservices.v1.HttpRoute.CorsPolicy(); + if (object.allowOrigins) { + if (!Array.isArray(object.allowOrigins)) + throw TypeError(".google.cloud.networkservices.v1.HttpRoute.CorsPolicy.allowOrigins: array expected"); + message.allowOrigins = []; + for (var i = 0; i < object.allowOrigins.length; ++i) + message.allowOrigins[i] = String(object.allowOrigins[i]); + } + if (object.allowOriginRegexes) { + if (!Array.isArray(object.allowOriginRegexes)) + throw TypeError(".google.cloud.networkservices.v1.HttpRoute.CorsPolicy.allowOriginRegexes: array expected"); + message.allowOriginRegexes = []; + for (var i = 0; i < object.allowOriginRegexes.length; ++i) + message.allowOriginRegexes[i] = String(object.allowOriginRegexes[i]); + } + if (object.allowMethods) { + if (!Array.isArray(object.allowMethods)) + throw TypeError(".google.cloud.networkservices.v1.HttpRoute.CorsPolicy.allowMethods: array expected"); + message.allowMethods = []; + for (var i = 0; i < object.allowMethods.length; ++i) + message.allowMethods[i] = String(object.allowMethods[i]); + } + if (object.allowHeaders) { + if (!Array.isArray(object.allowHeaders)) + throw TypeError(".google.cloud.networkservices.v1.HttpRoute.CorsPolicy.allowHeaders: array expected"); + message.allowHeaders = []; + for (var i = 0; i < object.allowHeaders.length; ++i) + message.allowHeaders[i] = String(object.allowHeaders[i]); + } + if (object.exposeHeaders) { + if (!Array.isArray(object.exposeHeaders)) + throw TypeError(".google.cloud.networkservices.v1.HttpRoute.CorsPolicy.exposeHeaders: array expected"); + message.exposeHeaders = []; + for (var i = 0; i < object.exposeHeaders.length; ++i) + message.exposeHeaders[i] = String(object.exposeHeaders[i]); + } + if (object.maxAge != null) + message.maxAge = String(object.maxAge); + if (object.allowCredentials != null) + message.allowCredentials = Boolean(object.allowCredentials); + if (object.disabled != null) + message.disabled = Boolean(object.disabled); + return message; + }; + + /** + * Creates a plain object from a CorsPolicy message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.networkservices.v1.HttpRoute.CorsPolicy + * @static + * @param {google.cloud.networkservices.v1.HttpRoute.CorsPolicy} message CorsPolicy + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CorsPolicy.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.allowOrigins = []; + object.allowOriginRegexes = []; + object.allowMethods = []; + object.allowHeaders = []; + object.exposeHeaders = []; + } + if (options.defaults) { + object.maxAge = ""; + object.allowCredentials = false; + object.disabled = false; + } + if (message.allowOrigins && message.allowOrigins.length) { + object.allowOrigins = []; + for (var j = 0; j < message.allowOrigins.length; ++j) + object.allowOrigins[j] = message.allowOrigins[j]; + } + if (message.allowOriginRegexes && message.allowOriginRegexes.length) { + object.allowOriginRegexes = []; + for (var j = 0; j < message.allowOriginRegexes.length; ++j) + object.allowOriginRegexes[j] = message.allowOriginRegexes[j]; + } + if (message.allowMethods && message.allowMethods.length) { + object.allowMethods = []; + for (var j = 0; j < message.allowMethods.length; ++j) + object.allowMethods[j] = message.allowMethods[j]; + } + if (message.allowHeaders && message.allowHeaders.length) { + object.allowHeaders = []; + for (var j = 0; j < message.allowHeaders.length; ++j) + object.allowHeaders[j] = message.allowHeaders[j]; + } + if (message.exposeHeaders && message.exposeHeaders.length) { + object.exposeHeaders = []; + for (var j = 0; j < message.exposeHeaders.length; ++j) + object.exposeHeaders[j] = message.exposeHeaders[j]; + } + if (message.maxAge != null && message.hasOwnProperty("maxAge")) + object.maxAge = message.maxAge; + if (message.allowCredentials != null && message.hasOwnProperty("allowCredentials")) + object.allowCredentials = message.allowCredentials; + if (message.disabled != null && message.hasOwnProperty("disabled")) + object.disabled = message.disabled; + return object; + }; + + /** + * Converts this CorsPolicy to JSON. + * @function toJSON + * @memberof google.cloud.networkservices.v1.HttpRoute.CorsPolicy + * @instance + * @returns {Object.} JSON object + */ + CorsPolicy.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CorsPolicy + * @function getTypeUrl + * @memberof google.cloud.networkservices.v1.HttpRoute.CorsPolicy + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CorsPolicy.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.networkservices.v1.HttpRoute.CorsPolicy"; + }; + + return CorsPolicy; + })(); + + HttpRoute.RouteAction = (function() { + + /** + * Properties of a RouteAction. + * @memberof google.cloud.networkservices.v1.HttpRoute + * @interface IRouteAction + * @property {Array.|null} [destinations] RouteAction destinations + * @property {google.cloud.networkservices.v1.HttpRoute.IRedirect|null} [redirect] RouteAction redirect + * @property {google.cloud.networkservices.v1.HttpRoute.IFaultInjectionPolicy|null} [faultInjectionPolicy] RouteAction faultInjectionPolicy + * @property {google.cloud.networkservices.v1.HttpRoute.IHeaderModifier|null} [requestHeaderModifier] RouteAction requestHeaderModifier + * @property {google.cloud.networkservices.v1.HttpRoute.IHeaderModifier|null} [responseHeaderModifier] RouteAction responseHeaderModifier + * @property {google.cloud.networkservices.v1.HttpRoute.IURLRewrite|null} [urlRewrite] RouteAction urlRewrite + * @property {google.protobuf.IDuration|null} [timeout] RouteAction timeout + * @property {google.cloud.networkservices.v1.HttpRoute.IRetryPolicy|null} [retryPolicy] RouteAction retryPolicy + * @property {google.cloud.networkservices.v1.HttpRoute.IRequestMirrorPolicy|null} [requestMirrorPolicy] RouteAction requestMirrorPolicy + * @property {google.cloud.networkservices.v1.HttpRoute.ICorsPolicy|null} [corsPolicy] RouteAction corsPolicy + */ + + /** + * Constructs a new RouteAction. + * @memberof google.cloud.networkservices.v1.HttpRoute + * @classdesc Represents a RouteAction. + * @implements IRouteAction + * @constructor + * @param {google.cloud.networkservices.v1.HttpRoute.IRouteAction=} [properties] Properties to set + */ + function RouteAction(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]]; + } + + /** + * RouteAction destinations. + * @member {Array.} destinations + * @memberof google.cloud.networkservices.v1.HttpRoute.RouteAction + * @instance + */ + RouteAction.prototype.destinations = $util.emptyArray; + + /** + * RouteAction redirect. + * @member {google.cloud.networkservices.v1.HttpRoute.IRedirect|null|undefined} redirect + * @memberof google.cloud.networkservices.v1.HttpRoute.RouteAction + * @instance + */ + RouteAction.prototype.redirect = null; + + /** + * RouteAction faultInjectionPolicy. + * @member {google.cloud.networkservices.v1.HttpRoute.IFaultInjectionPolicy|null|undefined} faultInjectionPolicy + * @memberof google.cloud.networkservices.v1.HttpRoute.RouteAction + * @instance + */ + RouteAction.prototype.faultInjectionPolicy = null; + + /** + * RouteAction requestHeaderModifier. + * @member {google.cloud.networkservices.v1.HttpRoute.IHeaderModifier|null|undefined} requestHeaderModifier + * @memberof google.cloud.networkservices.v1.HttpRoute.RouteAction + * @instance + */ + RouteAction.prototype.requestHeaderModifier = null; + + /** + * RouteAction responseHeaderModifier. + * @member {google.cloud.networkservices.v1.HttpRoute.IHeaderModifier|null|undefined} responseHeaderModifier + * @memberof google.cloud.networkservices.v1.HttpRoute.RouteAction + * @instance + */ + RouteAction.prototype.responseHeaderModifier = null; + + /** + * RouteAction urlRewrite. + * @member {google.cloud.networkservices.v1.HttpRoute.IURLRewrite|null|undefined} urlRewrite + * @memberof google.cloud.networkservices.v1.HttpRoute.RouteAction + * @instance + */ + RouteAction.prototype.urlRewrite = null; + + /** + * RouteAction timeout. + * @member {google.protobuf.IDuration|null|undefined} timeout + * @memberof google.cloud.networkservices.v1.HttpRoute.RouteAction + * @instance + */ + RouteAction.prototype.timeout = null; + + /** + * RouteAction retryPolicy. + * @member {google.cloud.networkservices.v1.HttpRoute.IRetryPolicy|null|undefined} retryPolicy + * @memberof google.cloud.networkservices.v1.HttpRoute.RouteAction + * @instance + */ + RouteAction.prototype.retryPolicy = null; + + /** + * RouteAction requestMirrorPolicy. + * @member {google.cloud.networkservices.v1.HttpRoute.IRequestMirrorPolicy|null|undefined} requestMirrorPolicy + * @memberof google.cloud.networkservices.v1.HttpRoute.RouteAction + * @instance + */ + RouteAction.prototype.requestMirrorPolicy = null; + + /** + * RouteAction corsPolicy. + * @member {google.cloud.networkservices.v1.HttpRoute.ICorsPolicy|null|undefined} corsPolicy + * @memberof google.cloud.networkservices.v1.HttpRoute.RouteAction + * @instance + */ + RouteAction.prototype.corsPolicy = null; + + /** + * Creates a new RouteAction instance using the specified properties. + * @function create + * @memberof google.cloud.networkservices.v1.HttpRoute.RouteAction + * @static + * @param {google.cloud.networkservices.v1.HttpRoute.IRouteAction=} [properties] Properties to set + * @returns {google.cloud.networkservices.v1.HttpRoute.RouteAction} RouteAction instance + */ + RouteAction.create = function create(properties) { + return new RouteAction(properties); + }; + + /** + * Encodes the specified RouteAction message. Does not implicitly {@link google.cloud.networkservices.v1.HttpRoute.RouteAction.verify|verify} messages. + * @function encode + * @memberof google.cloud.networkservices.v1.HttpRoute.RouteAction + * @static + * @param {google.cloud.networkservices.v1.HttpRoute.IRouteAction} message RouteAction message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RouteAction.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.destinations != null && message.destinations.length) + for (var i = 0; i < message.destinations.length; ++i) + $root.google.cloud.networkservices.v1.HttpRoute.Destination.encode(message.destinations[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.redirect != null && Object.hasOwnProperty.call(message, "redirect")) + $root.google.cloud.networkservices.v1.HttpRoute.Redirect.encode(message.redirect, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.faultInjectionPolicy != null && Object.hasOwnProperty.call(message, "faultInjectionPolicy")) + $root.google.cloud.networkservices.v1.HttpRoute.FaultInjectionPolicy.encode(message.faultInjectionPolicy, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.requestHeaderModifier != null && Object.hasOwnProperty.call(message, "requestHeaderModifier")) + $root.google.cloud.networkservices.v1.HttpRoute.HeaderModifier.encode(message.requestHeaderModifier, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.responseHeaderModifier != null && Object.hasOwnProperty.call(message, "responseHeaderModifier")) + $root.google.cloud.networkservices.v1.HttpRoute.HeaderModifier.encode(message.responseHeaderModifier, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + if (message.urlRewrite != null && Object.hasOwnProperty.call(message, "urlRewrite")) + $root.google.cloud.networkservices.v1.HttpRoute.URLRewrite.encode(message.urlRewrite, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + if (message.timeout != null && Object.hasOwnProperty.call(message, "timeout")) + $root.google.protobuf.Duration.encode(message.timeout, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); + if (message.retryPolicy != null && Object.hasOwnProperty.call(message, "retryPolicy")) + $root.google.cloud.networkservices.v1.HttpRoute.RetryPolicy.encode(message.retryPolicy, writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim(); + if (message.requestMirrorPolicy != null && Object.hasOwnProperty.call(message, "requestMirrorPolicy")) + $root.google.cloud.networkservices.v1.HttpRoute.RequestMirrorPolicy.encode(message.requestMirrorPolicy, writer.uint32(/* id 10, wireType 2 =*/82).fork()).ldelim(); + if (message.corsPolicy != null && Object.hasOwnProperty.call(message, "corsPolicy")) + $root.google.cloud.networkservices.v1.HttpRoute.CorsPolicy.encode(message.corsPolicy, writer.uint32(/* id 11, wireType 2 =*/90).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified RouteAction message, length delimited. Does not implicitly {@link google.cloud.networkservices.v1.HttpRoute.RouteAction.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.networkservices.v1.HttpRoute.RouteAction + * @static + * @param {google.cloud.networkservices.v1.HttpRoute.IRouteAction} message RouteAction message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RouteAction.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a RouteAction message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.networkservices.v1.HttpRoute.RouteAction + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.networkservices.v1.HttpRoute.RouteAction} RouteAction + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RouteAction.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.networkservices.v1.HttpRoute.RouteAction(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.destinations && message.destinations.length)) + message.destinations = []; + message.destinations.push($root.google.cloud.networkservices.v1.HttpRoute.Destination.decode(reader, reader.uint32())); + break; + } + case 2: { + message.redirect = $root.google.cloud.networkservices.v1.HttpRoute.Redirect.decode(reader, reader.uint32()); + break; + } + case 4: { + message.faultInjectionPolicy = $root.google.cloud.networkservices.v1.HttpRoute.FaultInjectionPolicy.decode(reader, reader.uint32()); + break; + } + case 5: { + message.requestHeaderModifier = $root.google.cloud.networkservices.v1.HttpRoute.HeaderModifier.decode(reader, reader.uint32()); + break; + } + case 6: { + message.responseHeaderModifier = $root.google.cloud.networkservices.v1.HttpRoute.HeaderModifier.decode(reader, reader.uint32()); + break; + } + case 7: { + message.urlRewrite = $root.google.cloud.networkservices.v1.HttpRoute.URLRewrite.decode(reader, reader.uint32()); + break; + } + case 8: { + message.timeout = $root.google.protobuf.Duration.decode(reader, reader.uint32()); + break; + } + case 9: { + message.retryPolicy = $root.google.cloud.networkservices.v1.HttpRoute.RetryPolicy.decode(reader, reader.uint32()); + break; + } + case 10: { + message.requestMirrorPolicy = $root.google.cloud.networkservices.v1.HttpRoute.RequestMirrorPolicy.decode(reader, reader.uint32()); + break; + } + case 11: { + message.corsPolicy = $root.google.cloud.networkservices.v1.HttpRoute.CorsPolicy.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a RouteAction message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.networkservices.v1.HttpRoute.RouteAction + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.networkservices.v1.HttpRoute.RouteAction} RouteAction + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RouteAction.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a RouteAction message. + * @function verify + * @memberof google.cloud.networkservices.v1.HttpRoute.RouteAction + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + RouteAction.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object 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) { + var error = $root.google.cloud.networkservices.v1.HttpRoute.Destination.verify(message.destinations[i]); + if (error) + return "destinations." + error; + } + } + if (message.redirect != null && message.hasOwnProperty("redirect")) { + var error = $root.google.cloud.networkservices.v1.HttpRoute.Redirect.verify(message.redirect); + if (error) + return "redirect." + error; + } + if (message.faultInjectionPolicy != null && message.hasOwnProperty("faultInjectionPolicy")) { + var error = $root.google.cloud.networkservices.v1.HttpRoute.FaultInjectionPolicy.verify(message.faultInjectionPolicy); + if (error) + return "faultInjectionPolicy." + error; + } + if (message.requestHeaderModifier != null && message.hasOwnProperty("requestHeaderModifier")) { + var error = $root.google.cloud.networkservices.v1.HttpRoute.HeaderModifier.verify(message.requestHeaderModifier); + if (error) + return "requestHeaderModifier." + error; + } + if (message.responseHeaderModifier != null && message.hasOwnProperty("responseHeaderModifier")) { + var error = $root.google.cloud.networkservices.v1.HttpRoute.HeaderModifier.verify(message.responseHeaderModifier); + if (error) + return "responseHeaderModifier." + error; + } + if (message.urlRewrite != null && message.hasOwnProperty("urlRewrite")) { + var error = $root.google.cloud.networkservices.v1.HttpRoute.URLRewrite.verify(message.urlRewrite); + if (error) + return "urlRewrite." + error; + } + if (message.timeout != null && message.hasOwnProperty("timeout")) { + var error = $root.google.protobuf.Duration.verify(message.timeout); + if (error) + return "timeout." + error; + } + if (message.retryPolicy != null && message.hasOwnProperty("retryPolicy")) { + var error = $root.google.cloud.networkservices.v1.HttpRoute.RetryPolicy.verify(message.retryPolicy); + if (error) + return "retryPolicy." + error; + } + if (message.requestMirrorPolicy != null && message.hasOwnProperty("requestMirrorPolicy")) { + var error = $root.google.cloud.networkservices.v1.HttpRoute.RequestMirrorPolicy.verify(message.requestMirrorPolicy); + if (error) + return "requestMirrorPolicy." + error; + } + if (message.corsPolicy != null && message.hasOwnProperty("corsPolicy")) { + var error = $root.google.cloud.networkservices.v1.HttpRoute.CorsPolicy.verify(message.corsPolicy); + if (error) + return "corsPolicy." + error; + } + return null; + }; + + /** + * Creates a RouteAction message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.networkservices.v1.HttpRoute.RouteAction + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.networkservices.v1.HttpRoute.RouteAction} RouteAction + */ + RouteAction.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.networkservices.v1.HttpRoute.RouteAction) + return object; + var message = new $root.google.cloud.networkservices.v1.HttpRoute.RouteAction(); + if (object.destinations) { + if (!Array.isArray(object.destinations)) + throw TypeError(".google.cloud.networkservices.v1.HttpRoute.RouteAction.destinations: array expected"); + message.destinations = []; + for (var i = 0; i < object.destinations.length; ++i) { + if (typeof object.destinations[i] !== "object") + throw TypeError(".google.cloud.networkservices.v1.HttpRoute.RouteAction.destinations: object expected"); + message.destinations[i] = $root.google.cloud.networkservices.v1.HttpRoute.Destination.fromObject(object.destinations[i]); + } + } + if (object.redirect != null) { + if (typeof object.redirect !== "object") + throw TypeError(".google.cloud.networkservices.v1.HttpRoute.RouteAction.redirect: object expected"); + message.redirect = $root.google.cloud.networkservices.v1.HttpRoute.Redirect.fromObject(object.redirect); + } + if (object.faultInjectionPolicy != null) { + if (typeof object.faultInjectionPolicy !== "object") + throw TypeError(".google.cloud.networkservices.v1.HttpRoute.RouteAction.faultInjectionPolicy: object expected"); + message.faultInjectionPolicy = $root.google.cloud.networkservices.v1.HttpRoute.FaultInjectionPolicy.fromObject(object.faultInjectionPolicy); + } + if (object.requestHeaderModifier != null) { + if (typeof object.requestHeaderModifier !== "object") + throw TypeError(".google.cloud.networkservices.v1.HttpRoute.RouteAction.requestHeaderModifier: object expected"); + message.requestHeaderModifier = $root.google.cloud.networkservices.v1.HttpRoute.HeaderModifier.fromObject(object.requestHeaderModifier); + } + if (object.responseHeaderModifier != null) { + if (typeof object.responseHeaderModifier !== "object") + throw TypeError(".google.cloud.networkservices.v1.HttpRoute.RouteAction.responseHeaderModifier: object expected"); + message.responseHeaderModifier = $root.google.cloud.networkservices.v1.HttpRoute.HeaderModifier.fromObject(object.responseHeaderModifier); + } + if (object.urlRewrite != null) { + if (typeof object.urlRewrite !== "object") + throw TypeError(".google.cloud.networkservices.v1.HttpRoute.RouteAction.urlRewrite: object expected"); + message.urlRewrite = $root.google.cloud.networkservices.v1.HttpRoute.URLRewrite.fromObject(object.urlRewrite); + } + if (object.timeout != null) { + if (typeof object.timeout !== "object") + throw TypeError(".google.cloud.networkservices.v1.HttpRoute.RouteAction.timeout: object expected"); + message.timeout = $root.google.protobuf.Duration.fromObject(object.timeout); + } + if (object.retryPolicy != null) { + if (typeof object.retryPolicy !== "object") + throw TypeError(".google.cloud.networkservices.v1.HttpRoute.RouteAction.retryPolicy: object expected"); + message.retryPolicy = $root.google.cloud.networkservices.v1.HttpRoute.RetryPolicy.fromObject(object.retryPolicy); + } + if (object.requestMirrorPolicy != null) { + if (typeof object.requestMirrorPolicy !== "object") + throw TypeError(".google.cloud.networkservices.v1.HttpRoute.RouteAction.requestMirrorPolicy: object expected"); + message.requestMirrorPolicy = $root.google.cloud.networkservices.v1.HttpRoute.RequestMirrorPolicy.fromObject(object.requestMirrorPolicy); + } + if (object.corsPolicy != null) { + if (typeof object.corsPolicy !== "object") + throw TypeError(".google.cloud.networkservices.v1.HttpRoute.RouteAction.corsPolicy: object expected"); + message.corsPolicy = $root.google.cloud.networkservices.v1.HttpRoute.CorsPolicy.fromObject(object.corsPolicy); + } + return message; + }; + + /** + * Creates a plain object from a RouteAction message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.networkservices.v1.HttpRoute.RouteAction + * @static + * @param {google.cloud.networkservices.v1.HttpRoute.RouteAction} message RouteAction + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + RouteAction.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.destinations = []; + if (options.defaults) { + object.redirect = null; + object.faultInjectionPolicy = null; + object.requestHeaderModifier = null; + object.responseHeaderModifier = null; + object.urlRewrite = null; + object.timeout = null; + object.retryPolicy = null; + object.requestMirrorPolicy = null; + object.corsPolicy = null; + } + if (message.destinations && message.destinations.length) { + object.destinations = []; + for (var j = 0; j < message.destinations.length; ++j) + object.destinations[j] = $root.google.cloud.networkservices.v1.HttpRoute.Destination.toObject(message.destinations[j], options); + } + if (message.redirect != null && message.hasOwnProperty("redirect")) + object.redirect = $root.google.cloud.networkservices.v1.HttpRoute.Redirect.toObject(message.redirect, options); + if (message.faultInjectionPolicy != null && message.hasOwnProperty("faultInjectionPolicy")) + object.faultInjectionPolicy = $root.google.cloud.networkservices.v1.HttpRoute.FaultInjectionPolicy.toObject(message.faultInjectionPolicy, options); + if (message.requestHeaderModifier != null && message.hasOwnProperty("requestHeaderModifier")) + object.requestHeaderModifier = $root.google.cloud.networkservices.v1.HttpRoute.HeaderModifier.toObject(message.requestHeaderModifier, options); + if (message.responseHeaderModifier != null && message.hasOwnProperty("responseHeaderModifier")) + object.responseHeaderModifier = $root.google.cloud.networkservices.v1.HttpRoute.HeaderModifier.toObject(message.responseHeaderModifier, options); + if (message.urlRewrite != null && message.hasOwnProperty("urlRewrite")) + object.urlRewrite = $root.google.cloud.networkservices.v1.HttpRoute.URLRewrite.toObject(message.urlRewrite, options); + if (message.timeout != null && message.hasOwnProperty("timeout")) + object.timeout = $root.google.protobuf.Duration.toObject(message.timeout, options); + if (message.retryPolicy != null && message.hasOwnProperty("retryPolicy")) + object.retryPolicy = $root.google.cloud.networkservices.v1.HttpRoute.RetryPolicy.toObject(message.retryPolicy, options); + if (message.requestMirrorPolicy != null && message.hasOwnProperty("requestMirrorPolicy")) + object.requestMirrorPolicy = $root.google.cloud.networkservices.v1.HttpRoute.RequestMirrorPolicy.toObject(message.requestMirrorPolicy, options); + if (message.corsPolicy != null && message.hasOwnProperty("corsPolicy")) + object.corsPolicy = $root.google.cloud.networkservices.v1.HttpRoute.CorsPolicy.toObject(message.corsPolicy, options); + return object; + }; + + /** + * Converts this RouteAction to JSON. + * @function toJSON + * @memberof google.cloud.networkservices.v1.HttpRoute.RouteAction + * @instance + * @returns {Object.} JSON object + */ + RouteAction.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for RouteAction + * @function getTypeUrl + * @memberof google.cloud.networkservices.v1.HttpRoute.RouteAction + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + RouteAction.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.networkservices.v1.HttpRoute.RouteAction"; + }; + + return RouteAction; + })(); + + HttpRoute.RouteRule = (function() { + + /** + * Properties of a RouteRule. + * @memberof google.cloud.networkservices.v1.HttpRoute + * @interface IRouteRule + * @property {Array.|null} [matches] RouteRule matches + * @property {google.cloud.networkservices.v1.HttpRoute.IRouteAction|null} [action] RouteRule action + */ + + /** + * Constructs a new RouteRule. + * @memberof google.cloud.networkservices.v1.HttpRoute + * @classdesc Represents a RouteRule. + * @implements IRouteRule + * @constructor + * @param {google.cloud.networkservices.v1.HttpRoute.IRouteRule=} [properties] Properties to set + */ + function RouteRule(properties) { + this.matches = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * RouteRule matches. + * @member {Array.} matches + * @memberof google.cloud.networkservices.v1.HttpRoute.RouteRule + * @instance + */ + RouteRule.prototype.matches = $util.emptyArray; + + /** + * RouteRule action. + * @member {google.cloud.networkservices.v1.HttpRoute.IRouteAction|null|undefined} action + * @memberof google.cloud.networkservices.v1.HttpRoute.RouteRule + * @instance + */ + RouteRule.prototype.action = null; + + /** + * Creates a new RouteRule instance using the specified properties. + * @function create + * @memberof google.cloud.networkservices.v1.HttpRoute.RouteRule + * @static + * @param {google.cloud.networkservices.v1.HttpRoute.IRouteRule=} [properties] Properties to set + * @returns {google.cloud.networkservices.v1.HttpRoute.RouteRule} RouteRule instance + */ + RouteRule.create = function create(properties) { + return new RouteRule(properties); + }; + + /** + * Encodes the specified RouteRule message. Does not implicitly {@link google.cloud.networkservices.v1.HttpRoute.RouteRule.verify|verify} messages. + * @function encode + * @memberof google.cloud.networkservices.v1.HttpRoute.RouteRule + * @static + * @param {google.cloud.networkservices.v1.HttpRoute.IRouteRule} message RouteRule message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RouteRule.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.matches != null && message.matches.length) + for (var i = 0; i < message.matches.length; ++i) + $root.google.cloud.networkservices.v1.HttpRoute.RouteMatch.encode(message.matches[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.action != null && Object.hasOwnProperty.call(message, "action")) + $root.google.cloud.networkservices.v1.HttpRoute.RouteAction.encode(message.action, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified RouteRule message, length delimited. Does not implicitly {@link google.cloud.networkservices.v1.HttpRoute.RouteRule.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.networkservices.v1.HttpRoute.RouteRule + * @static + * @param {google.cloud.networkservices.v1.HttpRoute.IRouteRule} message RouteRule message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RouteRule.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a RouteRule message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.networkservices.v1.HttpRoute.RouteRule + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.networkservices.v1.HttpRoute.RouteRule} RouteRule + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RouteRule.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.networkservices.v1.HttpRoute.RouteRule(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.matches && message.matches.length)) + message.matches = []; + message.matches.push($root.google.cloud.networkservices.v1.HttpRoute.RouteMatch.decode(reader, reader.uint32())); + break; + } + case 2: { + message.action = $root.google.cloud.networkservices.v1.HttpRoute.RouteAction.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a RouteRule message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.networkservices.v1.HttpRoute.RouteRule + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.networkservices.v1.HttpRoute.RouteRule} RouteRule + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RouteRule.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a RouteRule message. + * @function verify + * @memberof google.cloud.networkservices.v1.HttpRoute.RouteRule + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + RouteRule.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.matches != null && message.hasOwnProperty("matches")) { + if (!Array.isArray(message.matches)) + return "matches: array expected"; + for (var i = 0; i < message.matches.length; ++i) { + var error = $root.google.cloud.networkservices.v1.HttpRoute.RouteMatch.verify(message.matches[i]); + if (error) + return "matches." + error; + } + } + if (message.action != null && message.hasOwnProperty("action")) { + var error = $root.google.cloud.networkservices.v1.HttpRoute.RouteAction.verify(message.action); + if (error) + return "action." + error; + } + return null; + }; + + /** + * Creates a RouteRule message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.networkservices.v1.HttpRoute.RouteRule + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.networkservices.v1.HttpRoute.RouteRule} RouteRule + */ + RouteRule.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.networkservices.v1.HttpRoute.RouteRule) + return object; + var message = new $root.google.cloud.networkservices.v1.HttpRoute.RouteRule(); + if (object.matches) { + if (!Array.isArray(object.matches)) + throw TypeError(".google.cloud.networkservices.v1.HttpRoute.RouteRule.matches: array expected"); + message.matches = []; + for (var i = 0; i < object.matches.length; ++i) { + if (typeof object.matches[i] !== "object") + throw TypeError(".google.cloud.networkservices.v1.HttpRoute.RouteRule.matches: object expected"); + message.matches[i] = $root.google.cloud.networkservices.v1.HttpRoute.RouteMatch.fromObject(object.matches[i]); + } + } + if (object.action != null) { + if (typeof object.action !== "object") + throw TypeError(".google.cloud.networkservices.v1.HttpRoute.RouteRule.action: object expected"); + message.action = $root.google.cloud.networkservices.v1.HttpRoute.RouteAction.fromObject(object.action); + } + return message; + }; + + /** + * Creates a plain object from a RouteRule message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.networkservices.v1.HttpRoute.RouteRule + * @static + * @param {google.cloud.networkservices.v1.HttpRoute.RouteRule} message RouteRule + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + RouteRule.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.matches = []; + if (options.defaults) + object.action = null; + if (message.matches && message.matches.length) { + object.matches = []; + for (var j = 0; j < message.matches.length; ++j) + object.matches[j] = $root.google.cloud.networkservices.v1.HttpRoute.RouteMatch.toObject(message.matches[j], options); + } + if (message.action != null && message.hasOwnProperty("action")) + object.action = $root.google.cloud.networkservices.v1.HttpRoute.RouteAction.toObject(message.action, options); + return object; + }; + + /** + * Converts this RouteRule to JSON. + * @function toJSON + * @memberof google.cloud.networkservices.v1.HttpRoute.RouteRule + * @instance + * @returns {Object.} JSON object + */ + RouteRule.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for RouteRule + * @function getTypeUrl + * @memberof google.cloud.networkservices.v1.HttpRoute.RouteRule + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + RouteRule.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.networkservices.v1.HttpRoute.RouteRule"; + }; + + return RouteRule; + })(); + + return HttpRoute; + })(); + + v1.ListHttpRoutesRequest = (function() { + + /** + * Properties of a ListHttpRoutesRequest. + * @memberof google.cloud.networkservices.v1 + * @interface IListHttpRoutesRequest + * @property {string|null} [parent] ListHttpRoutesRequest parent + * @property {number|null} [pageSize] ListHttpRoutesRequest pageSize + * @property {string|null} [pageToken] ListHttpRoutesRequest pageToken + */ + + /** + * Constructs a new ListHttpRoutesRequest. + * @memberof google.cloud.networkservices.v1 + * @classdesc Represents a ListHttpRoutesRequest. + * @implements IListHttpRoutesRequest + * @constructor + * @param {google.cloud.networkservices.v1.IListHttpRoutesRequest=} [properties] Properties to set + */ + function ListHttpRoutesRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListHttpRoutesRequest parent. + * @member {string} parent + * @memberof google.cloud.networkservices.v1.ListHttpRoutesRequest + * @instance + */ + ListHttpRoutesRequest.prototype.parent = ""; + + /** + * ListHttpRoutesRequest pageSize. + * @member {number} pageSize + * @memberof google.cloud.networkservices.v1.ListHttpRoutesRequest + * @instance + */ + ListHttpRoutesRequest.prototype.pageSize = 0; + + /** + * ListHttpRoutesRequest pageToken. + * @member {string} pageToken + * @memberof google.cloud.networkservices.v1.ListHttpRoutesRequest + * @instance + */ + ListHttpRoutesRequest.prototype.pageToken = ""; + + /** + * Creates a new ListHttpRoutesRequest instance using the specified properties. + * @function create + * @memberof google.cloud.networkservices.v1.ListHttpRoutesRequest + * @static + * @param {google.cloud.networkservices.v1.IListHttpRoutesRequest=} [properties] Properties to set + * @returns {google.cloud.networkservices.v1.ListHttpRoutesRequest} ListHttpRoutesRequest instance + */ + ListHttpRoutesRequest.create = function create(properties) { + return new ListHttpRoutesRequest(properties); + }; + + /** + * Encodes the specified ListHttpRoutesRequest message. Does not implicitly {@link google.cloud.networkservices.v1.ListHttpRoutesRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.networkservices.v1.ListHttpRoutesRequest + * @static + * @param {google.cloud.networkservices.v1.IListHttpRoutesRequest} message ListHttpRoutesRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListHttpRoutesRequest.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 ListHttpRoutesRequest message, length delimited. Does not implicitly {@link google.cloud.networkservices.v1.ListHttpRoutesRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.networkservices.v1.ListHttpRoutesRequest + * @static + * @param {google.cloud.networkservices.v1.IListHttpRoutesRequest} message ListHttpRoutesRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListHttpRoutesRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListHttpRoutesRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.networkservices.v1.ListHttpRoutesRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.networkservices.v1.ListHttpRoutesRequest} ListHttpRoutesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListHttpRoutesRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.networkservices.v1.ListHttpRoutesRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + 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 ListHttpRoutesRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.networkservices.v1.ListHttpRoutesRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.networkservices.v1.ListHttpRoutesRequest} ListHttpRoutesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListHttpRoutesRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListHttpRoutesRequest message. + * @function verify + * @memberof google.cloud.networkservices.v1.ListHttpRoutesRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListHttpRoutesRequest.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 ListHttpRoutesRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.networkservices.v1.ListHttpRoutesRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.networkservices.v1.ListHttpRoutesRequest} ListHttpRoutesRequest + */ + ListHttpRoutesRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.networkservices.v1.ListHttpRoutesRequest) + return object; + var message = new $root.google.cloud.networkservices.v1.ListHttpRoutesRequest(); + 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 ListHttpRoutesRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.networkservices.v1.ListHttpRoutesRequest + * @static + * @param {google.cloud.networkservices.v1.ListHttpRoutesRequest} message ListHttpRoutesRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListHttpRoutesRequest.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 ListHttpRoutesRequest to JSON. + * @function toJSON + * @memberof google.cloud.networkservices.v1.ListHttpRoutesRequest + * @instance + * @returns {Object.} JSON object + */ + ListHttpRoutesRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListHttpRoutesRequest + * @function getTypeUrl + * @memberof google.cloud.networkservices.v1.ListHttpRoutesRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListHttpRoutesRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.networkservices.v1.ListHttpRoutesRequest"; + }; + + return ListHttpRoutesRequest; + })(); + + v1.ListHttpRoutesResponse = (function() { + + /** + * Properties of a ListHttpRoutesResponse. + * @memberof google.cloud.networkservices.v1 + * @interface IListHttpRoutesResponse + * @property {Array.|null} [httpRoutes] ListHttpRoutesResponse httpRoutes + * @property {string|null} [nextPageToken] ListHttpRoutesResponse nextPageToken + */ + + /** + * Constructs a new ListHttpRoutesResponse. + * @memberof google.cloud.networkservices.v1 + * @classdesc Represents a ListHttpRoutesResponse. + * @implements IListHttpRoutesResponse + * @constructor + * @param {google.cloud.networkservices.v1.IListHttpRoutesResponse=} [properties] Properties to set + */ + function ListHttpRoutesResponse(properties) { + this.httpRoutes = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListHttpRoutesResponse httpRoutes. + * @member {Array.} httpRoutes + * @memberof google.cloud.networkservices.v1.ListHttpRoutesResponse + * @instance + */ + ListHttpRoutesResponse.prototype.httpRoutes = $util.emptyArray; + + /** + * ListHttpRoutesResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.cloud.networkservices.v1.ListHttpRoutesResponse + * @instance + */ + ListHttpRoutesResponse.prototype.nextPageToken = ""; + + /** + * Creates a new ListHttpRoutesResponse instance using the specified properties. + * @function create + * @memberof google.cloud.networkservices.v1.ListHttpRoutesResponse + * @static + * @param {google.cloud.networkservices.v1.IListHttpRoutesResponse=} [properties] Properties to set + * @returns {google.cloud.networkservices.v1.ListHttpRoutesResponse} ListHttpRoutesResponse instance + */ + ListHttpRoutesResponse.create = function create(properties) { + return new ListHttpRoutesResponse(properties); + }; + + /** + * Encodes the specified ListHttpRoutesResponse message. Does not implicitly {@link google.cloud.networkservices.v1.ListHttpRoutesResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.networkservices.v1.ListHttpRoutesResponse + * @static + * @param {google.cloud.networkservices.v1.IListHttpRoutesResponse} message ListHttpRoutesResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListHttpRoutesResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.httpRoutes != null && message.httpRoutes.length) + for (var i = 0; i < message.httpRoutes.length; ++i) + $root.google.cloud.networkservices.v1.HttpRoute.encode(message.httpRoutes[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 ListHttpRoutesResponse message, length delimited. Does not implicitly {@link google.cloud.networkservices.v1.ListHttpRoutesResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.networkservices.v1.ListHttpRoutesResponse + * @static + * @param {google.cloud.networkservices.v1.IListHttpRoutesResponse} message ListHttpRoutesResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListHttpRoutesResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListHttpRoutesResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.networkservices.v1.ListHttpRoutesResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.networkservices.v1.ListHttpRoutesResponse} ListHttpRoutesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListHttpRoutesResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.networkservices.v1.ListHttpRoutesResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.httpRoutes && message.httpRoutes.length)) + message.httpRoutes = []; + message.httpRoutes.push($root.google.cloud.networkservices.v1.HttpRoute.decode(reader, reader.uint32())); + break; + } + case 2: { + message.nextPageToken = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListHttpRoutesResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.networkservices.v1.ListHttpRoutesResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.networkservices.v1.ListHttpRoutesResponse} ListHttpRoutesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListHttpRoutesResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListHttpRoutesResponse message. + * @function verify + * @memberof google.cloud.networkservices.v1.ListHttpRoutesResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListHttpRoutesResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.httpRoutes != null && message.hasOwnProperty("httpRoutes")) { + if (!Array.isArray(message.httpRoutes)) + return "httpRoutes: array expected"; + for (var i = 0; i < message.httpRoutes.length; ++i) { + var error = $root.google.cloud.networkservices.v1.HttpRoute.verify(message.httpRoutes[i]); + if (error) + return "httpRoutes." + error; + } + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + return null; + }; + + /** + * Creates a ListHttpRoutesResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.networkservices.v1.ListHttpRoutesResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.networkservices.v1.ListHttpRoutesResponse} ListHttpRoutesResponse + */ + ListHttpRoutesResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.networkservices.v1.ListHttpRoutesResponse) + return object; + var message = new $root.google.cloud.networkservices.v1.ListHttpRoutesResponse(); + if (object.httpRoutes) { + if (!Array.isArray(object.httpRoutes)) + throw TypeError(".google.cloud.networkservices.v1.ListHttpRoutesResponse.httpRoutes: array expected"); + message.httpRoutes = []; + for (var i = 0; i < object.httpRoutes.length; ++i) { + if (typeof object.httpRoutes[i] !== "object") + throw TypeError(".google.cloud.networkservices.v1.ListHttpRoutesResponse.httpRoutes: object expected"); + message.httpRoutes[i] = $root.google.cloud.networkservices.v1.HttpRoute.fromObject(object.httpRoutes[i]); + } + } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + return message; + }; + + /** + * Creates a plain object from a ListHttpRoutesResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.networkservices.v1.ListHttpRoutesResponse + * @static + * @param {google.cloud.networkservices.v1.ListHttpRoutesResponse} message ListHttpRoutesResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListHttpRoutesResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.httpRoutes = []; + if (options.defaults) + object.nextPageToken = ""; + if (message.httpRoutes && message.httpRoutes.length) { + object.httpRoutes = []; + for (var j = 0; j < message.httpRoutes.length; ++j) + object.httpRoutes[j] = $root.google.cloud.networkservices.v1.HttpRoute.toObject(message.httpRoutes[j], options); + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + object.nextPageToken = message.nextPageToken; + return object; + }; + + /** + * Converts this ListHttpRoutesResponse to JSON. + * @function toJSON + * @memberof google.cloud.networkservices.v1.ListHttpRoutesResponse + * @instance + * @returns {Object.} JSON object + */ + ListHttpRoutesResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListHttpRoutesResponse + * @function getTypeUrl + * @memberof google.cloud.networkservices.v1.ListHttpRoutesResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListHttpRoutesResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.networkservices.v1.ListHttpRoutesResponse"; + }; + + return ListHttpRoutesResponse; + })(); + + v1.GetHttpRouteRequest = (function() { + + /** + * Properties of a GetHttpRouteRequest. + * @memberof google.cloud.networkservices.v1 + * @interface IGetHttpRouteRequest + * @property {string|null} [name] GetHttpRouteRequest name + */ + + /** + * Constructs a new GetHttpRouteRequest. + * @memberof google.cloud.networkservices.v1 + * @classdesc Represents a GetHttpRouteRequest. + * @implements IGetHttpRouteRequest + * @constructor + * @param {google.cloud.networkservices.v1.IGetHttpRouteRequest=} [properties] Properties to set + */ + function GetHttpRouteRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetHttpRouteRequest name. + * @member {string} name + * @memberof google.cloud.networkservices.v1.GetHttpRouteRequest + * @instance + */ + GetHttpRouteRequest.prototype.name = ""; + + /** + * Creates a new GetHttpRouteRequest instance using the specified properties. + * @function create + * @memberof google.cloud.networkservices.v1.GetHttpRouteRequest + * @static + * @param {google.cloud.networkservices.v1.IGetHttpRouteRequest=} [properties] Properties to set + * @returns {google.cloud.networkservices.v1.GetHttpRouteRequest} GetHttpRouteRequest instance + */ + GetHttpRouteRequest.create = function create(properties) { + return new GetHttpRouteRequest(properties); + }; + + /** + * Encodes the specified GetHttpRouteRequest message. Does not implicitly {@link google.cloud.networkservices.v1.GetHttpRouteRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.networkservices.v1.GetHttpRouteRequest + * @static + * @param {google.cloud.networkservices.v1.IGetHttpRouteRequest} message GetHttpRouteRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetHttpRouteRequest.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 GetHttpRouteRequest message, length delimited. Does not implicitly {@link google.cloud.networkservices.v1.GetHttpRouteRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.networkservices.v1.GetHttpRouteRequest + * @static + * @param {google.cloud.networkservices.v1.IGetHttpRouteRequest} message GetHttpRouteRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetHttpRouteRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetHttpRouteRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.networkservices.v1.GetHttpRouteRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.networkservices.v1.GetHttpRouteRequest} GetHttpRouteRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetHttpRouteRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.networkservices.v1.GetHttpRouteRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetHttpRouteRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.networkservices.v1.GetHttpRouteRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.networkservices.v1.GetHttpRouteRequest} GetHttpRouteRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetHttpRouteRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetHttpRouteRequest message. + * @function verify + * @memberof google.cloud.networkservices.v1.GetHttpRouteRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetHttpRouteRequest.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 GetHttpRouteRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.networkservices.v1.GetHttpRouteRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.networkservices.v1.GetHttpRouteRequest} GetHttpRouteRequest + */ + GetHttpRouteRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.networkservices.v1.GetHttpRouteRequest) + return object; + var message = new $root.google.cloud.networkservices.v1.GetHttpRouteRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a GetHttpRouteRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.networkservices.v1.GetHttpRouteRequest + * @static + * @param {google.cloud.networkservices.v1.GetHttpRouteRequest} message GetHttpRouteRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetHttpRouteRequest.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 GetHttpRouteRequest to JSON. + * @function toJSON + * @memberof google.cloud.networkservices.v1.GetHttpRouteRequest + * @instance + * @returns {Object.} JSON object + */ + GetHttpRouteRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GetHttpRouteRequest + * @function getTypeUrl + * @memberof google.cloud.networkservices.v1.GetHttpRouteRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GetHttpRouteRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.networkservices.v1.GetHttpRouteRequest"; + }; + + return GetHttpRouteRequest; + })(); + + v1.CreateHttpRouteRequest = (function() { + + /** + * Properties of a CreateHttpRouteRequest. + * @memberof google.cloud.networkservices.v1 + * @interface ICreateHttpRouteRequest + * @property {string|null} [parent] CreateHttpRouteRequest parent + * @property {string|null} [httpRouteId] CreateHttpRouteRequest httpRouteId + * @property {google.cloud.networkservices.v1.IHttpRoute|null} [httpRoute] CreateHttpRouteRequest httpRoute + */ + + /** + * Constructs a new CreateHttpRouteRequest. + * @memberof google.cloud.networkservices.v1 + * @classdesc Represents a CreateHttpRouteRequest. + * @implements ICreateHttpRouteRequest + * @constructor + * @param {google.cloud.networkservices.v1.ICreateHttpRouteRequest=} [properties] Properties to set + */ + function CreateHttpRouteRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * CreateHttpRouteRequest parent. + * @member {string} parent + * @memberof google.cloud.networkservices.v1.CreateHttpRouteRequest + * @instance + */ + CreateHttpRouteRequest.prototype.parent = ""; + + /** + * CreateHttpRouteRequest httpRouteId. + * @member {string} httpRouteId + * @memberof google.cloud.networkservices.v1.CreateHttpRouteRequest + * @instance + */ + CreateHttpRouteRequest.prototype.httpRouteId = ""; + + /** + * CreateHttpRouteRequest httpRoute. + * @member {google.cloud.networkservices.v1.IHttpRoute|null|undefined} httpRoute + * @memberof google.cloud.networkservices.v1.CreateHttpRouteRequest + * @instance + */ + CreateHttpRouteRequest.prototype.httpRoute = null; + + /** + * Creates a new CreateHttpRouteRequest instance using the specified properties. + * @function create + * @memberof google.cloud.networkservices.v1.CreateHttpRouteRequest + * @static + * @param {google.cloud.networkservices.v1.ICreateHttpRouteRequest=} [properties] Properties to set + * @returns {google.cloud.networkservices.v1.CreateHttpRouteRequest} CreateHttpRouteRequest instance + */ + CreateHttpRouteRequest.create = function create(properties) { + return new CreateHttpRouteRequest(properties); + }; + + /** + * Encodes the specified CreateHttpRouteRequest message. Does not implicitly {@link google.cloud.networkservices.v1.CreateHttpRouteRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.networkservices.v1.CreateHttpRouteRequest + * @static + * @param {google.cloud.networkservices.v1.ICreateHttpRouteRequest} message CreateHttpRouteRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateHttpRouteRequest.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.httpRouteId != null && Object.hasOwnProperty.call(message, "httpRouteId")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.httpRouteId); + if (message.httpRoute != null && Object.hasOwnProperty.call(message, "httpRoute")) + $root.google.cloud.networkservices.v1.HttpRoute.encode(message.httpRoute, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified CreateHttpRouteRequest message, length delimited. Does not implicitly {@link google.cloud.networkservices.v1.CreateHttpRouteRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.networkservices.v1.CreateHttpRouteRequest + * @static + * @param {google.cloud.networkservices.v1.ICreateHttpRouteRequest} message CreateHttpRouteRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateHttpRouteRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CreateHttpRouteRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.networkservices.v1.CreateHttpRouteRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.networkservices.v1.CreateHttpRouteRequest} CreateHttpRouteRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateHttpRouteRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.networkservices.v1.CreateHttpRouteRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.httpRouteId = reader.string(); + break; + } + case 3: { + message.httpRoute = $root.google.cloud.networkservices.v1.HttpRoute.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CreateHttpRouteRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.networkservices.v1.CreateHttpRouteRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.networkservices.v1.CreateHttpRouteRequest} CreateHttpRouteRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateHttpRouteRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CreateHttpRouteRequest message. + * @function verify + * @memberof google.cloud.networkservices.v1.CreateHttpRouteRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CreateHttpRouteRequest.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.httpRouteId != null && message.hasOwnProperty("httpRouteId")) + if (!$util.isString(message.httpRouteId)) + return "httpRouteId: string expected"; + if (message.httpRoute != null && message.hasOwnProperty("httpRoute")) { + var error = $root.google.cloud.networkservices.v1.HttpRoute.verify(message.httpRoute); + if (error) + return "httpRoute." + error; + } + return null; + }; + + /** + * Creates a CreateHttpRouteRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.networkservices.v1.CreateHttpRouteRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.networkservices.v1.CreateHttpRouteRequest} CreateHttpRouteRequest + */ + CreateHttpRouteRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.networkservices.v1.CreateHttpRouteRequest) + return object; + var message = new $root.google.cloud.networkservices.v1.CreateHttpRouteRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.httpRouteId != null) + message.httpRouteId = String(object.httpRouteId); + if (object.httpRoute != null) { + if (typeof object.httpRoute !== "object") + throw TypeError(".google.cloud.networkservices.v1.CreateHttpRouteRequest.httpRoute: object expected"); + message.httpRoute = $root.google.cloud.networkservices.v1.HttpRoute.fromObject(object.httpRoute); + } + return message; + }; + + /** + * Creates a plain object from a CreateHttpRouteRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.networkservices.v1.CreateHttpRouteRequest + * @static + * @param {google.cloud.networkservices.v1.CreateHttpRouteRequest} message CreateHttpRouteRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CreateHttpRouteRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.httpRouteId = ""; + object.httpRoute = null; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.httpRouteId != null && message.hasOwnProperty("httpRouteId")) + object.httpRouteId = message.httpRouteId; + if (message.httpRoute != null && message.hasOwnProperty("httpRoute")) + object.httpRoute = $root.google.cloud.networkservices.v1.HttpRoute.toObject(message.httpRoute, options); + return object; + }; + + /** + * Converts this CreateHttpRouteRequest to JSON. + * @function toJSON + * @memberof google.cloud.networkservices.v1.CreateHttpRouteRequest + * @instance + * @returns {Object.} JSON object + */ + CreateHttpRouteRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CreateHttpRouteRequest + * @function getTypeUrl + * @memberof google.cloud.networkservices.v1.CreateHttpRouteRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CreateHttpRouteRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.networkservices.v1.CreateHttpRouteRequest"; + }; + + return CreateHttpRouteRequest; + })(); + + v1.UpdateHttpRouteRequest = (function() { + + /** + * Properties of an UpdateHttpRouteRequest. + * @memberof google.cloud.networkservices.v1 + * @interface IUpdateHttpRouteRequest + * @property {google.protobuf.IFieldMask|null} [updateMask] UpdateHttpRouteRequest updateMask + * @property {google.cloud.networkservices.v1.IHttpRoute|null} [httpRoute] UpdateHttpRouteRequest httpRoute + */ + + /** + * Constructs a new UpdateHttpRouteRequest. + * @memberof google.cloud.networkservices.v1 + * @classdesc Represents an UpdateHttpRouteRequest. + * @implements IUpdateHttpRouteRequest + * @constructor + * @param {google.cloud.networkservices.v1.IUpdateHttpRouteRequest=} [properties] Properties to set + */ + function UpdateHttpRouteRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * UpdateHttpRouteRequest updateMask. + * @member {google.protobuf.IFieldMask|null|undefined} updateMask + * @memberof google.cloud.networkservices.v1.UpdateHttpRouteRequest + * @instance + */ + UpdateHttpRouteRequest.prototype.updateMask = null; + + /** + * UpdateHttpRouteRequest httpRoute. + * @member {google.cloud.networkservices.v1.IHttpRoute|null|undefined} httpRoute + * @memberof google.cloud.networkservices.v1.UpdateHttpRouteRequest + * @instance + */ + UpdateHttpRouteRequest.prototype.httpRoute = null; + + /** + * Creates a new UpdateHttpRouteRequest instance using the specified properties. + * @function create + * @memberof google.cloud.networkservices.v1.UpdateHttpRouteRequest + * @static + * @param {google.cloud.networkservices.v1.IUpdateHttpRouteRequest=} [properties] Properties to set + * @returns {google.cloud.networkservices.v1.UpdateHttpRouteRequest} UpdateHttpRouteRequest instance + */ + UpdateHttpRouteRequest.create = function create(properties) { + return new UpdateHttpRouteRequest(properties); + }; + + /** + * Encodes the specified UpdateHttpRouteRequest message. Does not implicitly {@link google.cloud.networkservices.v1.UpdateHttpRouteRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.networkservices.v1.UpdateHttpRouteRequest + * @static + * @param {google.cloud.networkservices.v1.IUpdateHttpRouteRequest} message UpdateHttpRouteRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateHttpRouteRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.updateMask != null && Object.hasOwnProperty.call(message, "updateMask")) + $root.google.protobuf.FieldMask.encode(message.updateMask, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.httpRoute != null && Object.hasOwnProperty.call(message, "httpRoute")) + $root.google.cloud.networkservices.v1.HttpRoute.encode(message.httpRoute, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified UpdateHttpRouteRequest message, length delimited. Does not implicitly {@link google.cloud.networkservices.v1.UpdateHttpRouteRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.networkservices.v1.UpdateHttpRouteRequest + * @static + * @param {google.cloud.networkservices.v1.IUpdateHttpRouteRequest} message UpdateHttpRouteRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateHttpRouteRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an UpdateHttpRouteRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.networkservices.v1.UpdateHttpRouteRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.networkservices.v1.UpdateHttpRouteRequest} UpdateHttpRouteRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateHttpRouteRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.networkservices.v1.UpdateHttpRouteRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.updateMask = $root.google.protobuf.FieldMask.decode(reader, reader.uint32()); + break; + } + case 2: { + message.httpRoute = $root.google.cloud.networkservices.v1.HttpRoute.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an UpdateHttpRouteRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.networkservices.v1.UpdateHttpRouteRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.networkservices.v1.UpdateHttpRouteRequest} UpdateHttpRouteRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateHttpRouteRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an UpdateHttpRouteRequest message. + * @function verify + * @memberof google.cloud.networkservices.v1.UpdateHttpRouteRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + UpdateHttpRouteRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.updateMask != null && message.hasOwnProperty("updateMask")) { + var error = $root.google.protobuf.FieldMask.verify(message.updateMask); + if (error) + return "updateMask." + error; + } + if (message.httpRoute != null && message.hasOwnProperty("httpRoute")) { + var error = $root.google.cloud.networkservices.v1.HttpRoute.verify(message.httpRoute); + if (error) + return "httpRoute." + error; + } + return null; + }; + + /** + * Creates an UpdateHttpRouteRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.networkservices.v1.UpdateHttpRouteRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.networkservices.v1.UpdateHttpRouteRequest} UpdateHttpRouteRequest + */ + UpdateHttpRouteRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.networkservices.v1.UpdateHttpRouteRequest) + return object; + var message = new $root.google.cloud.networkservices.v1.UpdateHttpRouteRequest(); + if (object.updateMask != null) { + if (typeof object.updateMask !== "object") + throw TypeError(".google.cloud.networkservices.v1.UpdateHttpRouteRequest.updateMask: object expected"); + message.updateMask = $root.google.protobuf.FieldMask.fromObject(object.updateMask); + } + if (object.httpRoute != null) { + if (typeof object.httpRoute !== "object") + throw TypeError(".google.cloud.networkservices.v1.UpdateHttpRouteRequest.httpRoute: object expected"); + message.httpRoute = $root.google.cloud.networkservices.v1.HttpRoute.fromObject(object.httpRoute); + } + return message; + }; + + /** + * Creates a plain object from an UpdateHttpRouteRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.networkservices.v1.UpdateHttpRouteRequest + * @static + * @param {google.cloud.networkservices.v1.UpdateHttpRouteRequest} message UpdateHttpRouteRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + UpdateHttpRouteRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.updateMask = null; + object.httpRoute = null; + } + if (message.updateMask != null && message.hasOwnProperty("updateMask")) + object.updateMask = $root.google.protobuf.FieldMask.toObject(message.updateMask, options); + if (message.httpRoute != null && message.hasOwnProperty("httpRoute")) + object.httpRoute = $root.google.cloud.networkservices.v1.HttpRoute.toObject(message.httpRoute, options); + return object; + }; + + /** + * Converts this UpdateHttpRouteRequest to JSON. + * @function toJSON + * @memberof google.cloud.networkservices.v1.UpdateHttpRouteRequest + * @instance + * @returns {Object.} JSON object + */ + UpdateHttpRouteRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for UpdateHttpRouteRequest + * @function getTypeUrl + * @memberof google.cloud.networkservices.v1.UpdateHttpRouteRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + UpdateHttpRouteRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.networkservices.v1.UpdateHttpRouteRequest"; + }; + + return UpdateHttpRouteRequest; + })(); + + v1.DeleteHttpRouteRequest = (function() { + + /** + * Properties of a DeleteHttpRouteRequest. + * @memberof google.cloud.networkservices.v1 + * @interface IDeleteHttpRouteRequest + * @property {string|null} [name] DeleteHttpRouteRequest name + */ + + /** + * Constructs a new DeleteHttpRouteRequest. + * @memberof google.cloud.networkservices.v1 + * @classdesc Represents a DeleteHttpRouteRequest. + * @implements IDeleteHttpRouteRequest + * @constructor + * @param {google.cloud.networkservices.v1.IDeleteHttpRouteRequest=} [properties] Properties to set + */ + function DeleteHttpRouteRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * DeleteHttpRouteRequest name. + * @member {string} name + * @memberof google.cloud.networkservices.v1.DeleteHttpRouteRequest + * @instance + */ + DeleteHttpRouteRequest.prototype.name = ""; + + /** + * Creates a new DeleteHttpRouteRequest instance using the specified properties. + * @function create + * @memberof google.cloud.networkservices.v1.DeleteHttpRouteRequest + * @static + * @param {google.cloud.networkservices.v1.IDeleteHttpRouteRequest=} [properties] Properties to set + * @returns {google.cloud.networkservices.v1.DeleteHttpRouteRequest} DeleteHttpRouteRequest instance + */ + DeleteHttpRouteRequest.create = function create(properties) { + return new DeleteHttpRouteRequest(properties); + }; + + /** + * Encodes the specified DeleteHttpRouteRequest message. Does not implicitly {@link google.cloud.networkservices.v1.DeleteHttpRouteRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.networkservices.v1.DeleteHttpRouteRequest + * @static + * @param {google.cloud.networkservices.v1.IDeleteHttpRouteRequest} message DeleteHttpRouteRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteHttpRouteRequest.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 DeleteHttpRouteRequest message, length delimited. Does not implicitly {@link google.cloud.networkservices.v1.DeleteHttpRouteRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.networkservices.v1.DeleteHttpRouteRequest + * @static + * @param {google.cloud.networkservices.v1.IDeleteHttpRouteRequest} message DeleteHttpRouteRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteHttpRouteRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DeleteHttpRouteRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.networkservices.v1.DeleteHttpRouteRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.networkservices.v1.DeleteHttpRouteRequest} DeleteHttpRouteRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteHttpRouteRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.networkservices.v1.DeleteHttpRouteRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DeleteHttpRouteRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.networkservices.v1.DeleteHttpRouteRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.networkservices.v1.DeleteHttpRouteRequest} DeleteHttpRouteRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteHttpRouteRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DeleteHttpRouteRequest message. + * @function verify + * @memberof google.cloud.networkservices.v1.DeleteHttpRouteRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DeleteHttpRouteRequest.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 DeleteHttpRouteRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.networkservices.v1.DeleteHttpRouteRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.networkservices.v1.DeleteHttpRouteRequest} DeleteHttpRouteRequest + */ + DeleteHttpRouteRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.networkservices.v1.DeleteHttpRouteRequest) + return object; + var message = new $root.google.cloud.networkservices.v1.DeleteHttpRouteRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a DeleteHttpRouteRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.networkservices.v1.DeleteHttpRouteRequest + * @static + * @param {google.cloud.networkservices.v1.DeleteHttpRouteRequest} message DeleteHttpRouteRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DeleteHttpRouteRequest.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 DeleteHttpRouteRequest to JSON. + * @function toJSON + * @memberof google.cloud.networkservices.v1.DeleteHttpRouteRequest + * @instance + * @returns {Object.} JSON object + */ + DeleteHttpRouteRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DeleteHttpRouteRequest + * @function getTypeUrl + * @memberof google.cloud.networkservices.v1.DeleteHttpRouteRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DeleteHttpRouteRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.networkservices.v1.DeleteHttpRouteRequest"; + }; + + return DeleteHttpRouteRequest; + })(); + + v1.Mesh = (function() { + + /** + * Properties of a Mesh. + * @memberof google.cloud.networkservices.v1 + * @interface IMesh + * @property {string|null} [name] Mesh name + * @property {string|null} [selfLink] Mesh selfLink + * @property {google.protobuf.ITimestamp|null} [createTime] Mesh createTime + * @property {google.protobuf.ITimestamp|null} [updateTime] Mesh updateTime + * @property {Object.|null} [labels] Mesh labels + * @property {string|null} [description] Mesh description + * @property {number|null} [interceptionPort] Mesh interceptionPort + */ + + /** + * Constructs a new Mesh. + * @memberof google.cloud.networkservices.v1 + * @classdesc Represents a Mesh. + * @implements IMesh + * @constructor + * @param {google.cloud.networkservices.v1.IMesh=} [properties] Properties to set + */ + function Mesh(properties) { + this.labels = {}; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Mesh name. + * @member {string} name + * @memberof google.cloud.networkservices.v1.Mesh + * @instance + */ + Mesh.prototype.name = ""; + + /** + * Mesh selfLink. + * @member {string} selfLink + * @memberof google.cloud.networkservices.v1.Mesh + * @instance + */ + Mesh.prototype.selfLink = ""; + + /** + * Mesh createTime. + * @member {google.protobuf.ITimestamp|null|undefined} createTime + * @memberof google.cloud.networkservices.v1.Mesh + * @instance + */ + Mesh.prototype.createTime = null; + + /** + * Mesh updateTime. + * @member {google.protobuf.ITimestamp|null|undefined} updateTime + * @memberof google.cloud.networkservices.v1.Mesh + * @instance + */ + Mesh.prototype.updateTime = null; + + /** + * Mesh labels. + * @member {Object.} labels + * @memberof google.cloud.networkservices.v1.Mesh + * @instance + */ + Mesh.prototype.labels = $util.emptyObject; + + /** + * Mesh description. + * @member {string} description + * @memberof google.cloud.networkservices.v1.Mesh + * @instance + */ + Mesh.prototype.description = ""; + + /** + * Mesh interceptionPort. + * @member {number} interceptionPort + * @memberof google.cloud.networkservices.v1.Mesh + * @instance + */ + Mesh.prototype.interceptionPort = 0; + + /** + * Creates a new Mesh instance using the specified properties. + * @function create + * @memberof google.cloud.networkservices.v1.Mesh + * @static + * @param {google.cloud.networkservices.v1.IMesh=} [properties] Properties to set + * @returns {google.cloud.networkservices.v1.Mesh} Mesh instance + */ + Mesh.create = function create(properties) { + return new Mesh(properties); + }; + + /** + * Encodes the specified Mesh message. Does not implicitly {@link google.cloud.networkservices.v1.Mesh.verify|verify} messages. + * @function encode + * @memberof google.cloud.networkservices.v1.Mesh + * @static + * @param {google.cloud.networkservices.v1.IMesh} message Mesh message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Mesh.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.createTime != null && Object.hasOwnProperty.call(message, "createTime")) + $root.google.protobuf.Timestamp.encode(message.createTime, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + 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(); + if (message.labels != null && Object.hasOwnProperty.call(message, "labels")) + for (var keys = Object.keys(message.labels), i = 0; i < keys.length; ++i) + writer.uint32(/* id 4, wireType 2 =*/34).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.labels[keys[i]]).ldelim(); + if (message.description != null && Object.hasOwnProperty.call(message, "description")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.description); + if (message.interceptionPort != null && Object.hasOwnProperty.call(message, "interceptionPort")) + writer.uint32(/* id 8, wireType 0 =*/64).int32(message.interceptionPort); + if (message.selfLink != null && Object.hasOwnProperty.call(message, "selfLink")) + writer.uint32(/* id 9, wireType 2 =*/74).string(message.selfLink); + return writer; + }; + + /** + * Encodes the specified Mesh message, length delimited. Does not implicitly {@link google.cloud.networkservices.v1.Mesh.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.networkservices.v1.Mesh + * @static + * @param {google.cloud.networkservices.v1.IMesh} message Mesh message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Mesh.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Mesh message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.networkservices.v1.Mesh + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.networkservices.v1.Mesh} Mesh + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Mesh.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.networkservices.v1.Mesh(), key, value; + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 9: { + message.selfLink = reader.string(); + break; + } + case 2: { + message.createTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 3: { + message.updateTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 4: { + if (message.labels === $util.emptyObject) + message.labels = {}; + 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.labels[key] = value; + break; + } + case 5: { + message.description = reader.string(); + break; + } + case 8: { + message.interceptionPort = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Mesh message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.networkservices.v1.Mesh + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.networkservices.v1.Mesh} Mesh + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Mesh.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Mesh message. + * @function verify + * @memberof google.cloud.networkservices.v1.Mesh + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Mesh.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.selfLink != null && message.hasOwnProperty("selfLink")) + if (!$util.isString(message.selfLink)) + return "selfLink: string expected"; + 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.labels != null && message.hasOwnProperty("labels")) { + if (!$util.isObject(message.labels)) + return "labels: object expected"; + var key = Object.keys(message.labels); + for (var i = 0; i < key.length; ++i) + if (!$util.isString(message.labels[key[i]])) + return "labels: string{k:string} expected"; + } + if (message.description != null && message.hasOwnProperty("description")) + if (!$util.isString(message.description)) + return "description: string expected"; + if (message.interceptionPort != null && message.hasOwnProperty("interceptionPort")) + if (!$util.isInteger(message.interceptionPort)) + return "interceptionPort: integer expected"; + return null; + }; + + /** + * Creates a Mesh message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.networkservices.v1.Mesh + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.networkservices.v1.Mesh} Mesh + */ + Mesh.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.networkservices.v1.Mesh) + return object; + var message = new $root.google.cloud.networkservices.v1.Mesh(); + if (object.name != null) + message.name = String(object.name); + if (object.selfLink != null) + message.selfLink = String(object.selfLink); + if (object.createTime != null) { + if (typeof object.createTime !== "object") + throw TypeError(".google.cloud.networkservices.v1.Mesh.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.networkservices.v1.Mesh.updateTime: object expected"); + message.updateTime = $root.google.protobuf.Timestamp.fromObject(object.updateTime); + } + if (object.labels) { + if (typeof object.labels !== "object") + throw TypeError(".google.cloud.networkservices.v1.Mesh.labels: object expected"); + message.labels = {}; + for (var keys = Object.keys(object.labels), i = 0; i < keys.length; ++i) + message.labels[keys[i]] = String(object.labels[keys[i]]); + } + if (object.description != null) + message.description = String(object.description); + if (object.interceptionPort != null) + message.interceptionPort = object.interceptionPort | 0; + return message; + }; + + /** + * Creates a plain object from a Mesh message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.networkservices.v1.Mesh + * @static + * @param {google.cloud.networkservices.v1.Mesh} message Mesh + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Mesh.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.objects || options.defaults) + object.labels = {}; + if (options.defaults) { + object.name = ""; + object.createTime = null; + object.updateTime = null; + object.description = ""; + object.interceptionPort = 0; + object.selfLink = ""; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + 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); + var keys2; + if (message.labels && (keys2 = Object.keys(message.labels)).length) { + object.labels = {}; + for (var j = 0; j < keys2.length; ++j) + object.labels[keys2[j]] = message.labels[keys2[j]]; + } + if (message.description != null && message.hasOwnProperty("description")) + object.description = message.description; + if (message.interceptionPort != null && message.hasOwnProperty("interceptionPort")) + object.interceptionPort = message.interceptionPort; + if (message.selfLink != null && message.hasOwnProperty("selfLink")) + object.selfLink = message.selfLink; + return object; + }; + + /** + * Converts this Mesh to JSON. + * @function toJSON + * @memberof google.cloud.networkservices.v1.Mesh + * @instance + * @returns {Object.} JSON object + */ + Mesh.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Mesh + * @function getTypeUrl + * @memberof google.cloud.networkservices.v1.Mesh + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Mesh.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.networkservices.v1.Mesh"; + }; + + return Mesh; + })(); + + v1.ListMeshesRequest = (function() { + + /** + * Properties of a ListMeshesRequest. + * @memberof google.cloud.networkservices.v1 + * @interface IListMeshesRequest + * @property {string|null} [parent] ListMeshesRequest parent + * @property {number|null} [pageSize] ListMeshesRequest pageSize + * @property {string|null} [pageToken] ListMeshesRequest pageToken + */ + + /** + * Constructs a new ListMeshesRequest. + * @memberof google.cloud.networkservices.v1 + * @classdesc Represents a ListMeshesRequest. + * @implements IListMeshesRequest + * @constructor + * @param {google.cloud.networkservices.v1.IListMeshesRequest=} [properties] Properties to set + */ + function ListMeshesRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListMeshesRequest parent. + * @member {string} parent + * @memberof google.cloud.networkservices.v1.ListMeshesRequest + * @instance + */ + ListMeshesRequest.prototype.parent = ""; + + /** + * ListMeshesRequest pageSize. + * @member {number} pageSize + * @memberof google.cloud.networkservices.v1.ListMeshesRequest + * @instance + */ + ListMeshesRequest.prototype.pageSize = 0; + + /** + * ListMeshesRequest pageToken. + * @member {string} pageToken + * @memberof google.cloud.networkservices.v1.ListMeshesRequest + * @instance + */ + ListMeshesRequest.prototype.pageToken = ""; + + /** + * Creates a new ListMeshesRequest instance using the specified properties. + * @function create + * @memberof google.cloud.networkservices.v1.ListMeshesRequest + * @static + * @param {google.cloud.networkservices.v1.IListMeshesRequest=} [properties] Properties to set + * @returns {google.cloud.networkservices.v1.ListMeshesRequest} ListMeshesRequest instance + */ + ListMeshesRequest.create = function create(properties) { + return new ListMeshesRequest(properties); + }; + + /** + * Encodes the specified ListMeshesRequest message. Does not implicitly {@link google.cloud.networkservices.v1.ListMeshesRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.networkservices.v1.ListMeshesRequest + * @static + * @param {google.cloud.networkservices.v1.IListMeshesRequest} message ListMeshesRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListMeshesRequest.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 ListMeshesRequest message, length delimited. Does not implicitly {@link google.cloud.networkservices.v1.ListMeshesRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.networkservices.v1.ListMeshesRequest + * @static + * @param {google.cloud.networkservices.v1.IListMeshesRequest} message ListMeshesRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListMeshesRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListMeshesRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.networkservices.v1.ListMeshesRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.networkservices.v1.ListMeshesRequest} ListMeshesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListMeshesRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.networkservices.v1.ListMeshesRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + 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 ListMeshesRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.networkservices.v1.ListMeshesRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.networkservices.v1.ListMeshesRequest} ListMeshesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListMeshesRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListMeshesRequest message. + * @function verify + * @memberof google.cloud.networkservices.v1.ListMeshesRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListMeshesRequest.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 ListMeshesRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.networkservices.v1.ListMeshesRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.networkservices.v1.ListMeshesRequest} ListMeshesRequest + */ + ListMeshesRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.networkservices.v1.ListMeshesRequest) + return object; + var message = new $root.google.cloud.networkservices.v1.ListMeshesRequest(); + 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 ListMeshesRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.networkservices.v1.ListMeshesRequest + * @static + * @param {google.cloud.networkservices.v1.ListMeshesRequest} message ListMeshesRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListMeshesRequest.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 ListMeshesRequest to JSON. + * @function toJSON + * @memberof google.cloud.networkservices.v1.ListMeshesRequest + * @instance + * @returns {Object.} JSON object + */ + ListMeshesRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListMeshesRequest + * @function getTypeUrl + * @memberof google.cloud.networkservices.v1.ListMeshesRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListMeshesRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.networkservices.v1.ListMeshesRequest"; + }; + + return ListMeshesRequest; + })(); + + v1.ListMeshesResponse = (function() { + + /** + * Properties of a ListMeshesResponse. + * @memberof google.cloud.networkservices.v1 + * @interface IListMeshesResponse + * @property {Array.|null} [meshes] ListMeshesResponse meshes + * @property {string|null} [nextPageToken] ListMeshesResponse nextPageToken + */ + + /** + * Constructs a new ListMeshesResponse. + * @memberof google.cloud.networkservices.v1 + * @classdesc Represents a ListMeshesResponse. + * @implements IListMeshesResponse + * @constructor + * @param {google.cloud.networkservices.v1.IListMeshesResponse=} [properties] Properties to set + */ + function ListMeshesResponse(properties) { + this.meshes = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListMeshesResponse meshes. + * @member {Array.} meshes + * @memberof google.cloud.networkservices.v1.ListMeshesResponse + * @instance + */ + ListMeshesResponse.prototype.meshes = $util.emptyArray; + + /** + * ListMeshesResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.cloud.networkservices.v1.ListMeshesResponse + * @instance + */ + ListMeshesResponse.prototype.nextPageToken = ""; + + /** + * Creates a new ListMeshesResponse instance using the specified properties. + * @function create + * @memberof google.cloud.networkservices.v1.ListMeshesResponse + * @static + * @param {google.cloud.networkservices.v1.IListMeshesResponse=} [properties] Properties to set + * @returns {google.cloud.networkservices.v1.ListMeshesResponse} ListMeshesResponse instance + */ + ListMeshesResponse.create = function create(properties) { + return new ListMeshesResponse(properties); + }; + + /** + * Encodes the specified ListMeshesResponse message. Does not implicitly {@link google.cloud.networkservices.v1.ListMeshesResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.networkservices.v1.ListMeshesResponse + * @static + * @param {google.cloud.networkservices.v1.IListMeshesResponse} message ListMeshesResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListMeshesResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.meshes != null && message.meshes.length) + for (var i = 0; i < message.meshes.length; ++i) + $root.google.cloud.networkservices.v1.Mesh.encode(message.meshes[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 ListMeshesResponse message, length delimited. Does not implicitly {@link google.cloud.networkservices.v1.ListMeshesResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.networkservices.v1.ListMeshesResponse + * @static + * @param {google.cloud.networkservices.v1.IListMeshesResponse} message ListMeshesResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListMeshesResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListMeshesResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.networkservices.v1.ListMeshesResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.networkservices.v1.ListMeshesResponse} ListMeshesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListMeshesResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.networkservices.v1.ListMeshesResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.meshes && message.meshes.length)) + message.meshes = []; + message.meshes.push($root.google.cloud.networkservices.v1.Mesh.decode(reader, reader.uint32())); + break; + } + case 2: { + message.nextPageToken = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListMeshesResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.networkservices.v1.ListMeshesResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.networkservices.v1.ListMeshesResponse} ListMeshesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListMeshesResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListMeshesResponse message. + * @function verify + * @memberof google.cloud.networkservices.v1.ListMeshesResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListMeshesResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.meshes != null && message.hasOwnProperty("meshes")) { + if (!Array.isArray(message.meshes)) + return "meshes: array expected"; + for (var i = 0; i < message.meshes.length; ++i) { + var error = $root.google.cloud.networkservices.v1.Mesh.verify(message.meshes[i]); + if (error) + return "meshes." + error; + } + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + return null; + }; + + /** + * Creates a ListMeshesResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.networkservices.v1.ListMeshesResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.networkservices.v1.ListMeshesResponse} ListMeshesResponse + */ + ListMeshesResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.networkservices.v1.ListMeshesResponse) + return object; + var message = new $root.google.cloud.networkservices.v1.ListMeshesResponse(); + if (object.meshes) { + if (!Array.isArray(object.meshes)) + throw TypeError(".google.cloud.networkservices.v1.ListMeshesResponse.meshes: array expected"); + message.meshes = []; + for (var i = 0; i < object.meshes.length; ++i) { + if (typeof object.meshes[i] !== "object") + throw TypeError(".google.cloud.networkservices.v1.ListMeshesResponse.meshes: object expected"); + message.meshes[i] = $root.google.cloud.networkservices.v1.Mesh.fromObject(object.meshes[i]); + } + } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + return message; + }; + + /** + * Creates a plain object from a ListMeshesResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.networkservices.v1.ListMeshesResponse + * @static + * @param {google.cloud.networkservices.v1.ListMeshesResponse} message ListMeshesResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListMeshesResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.meshes = []; + if (options.defaults) + object.nextPageToken = ""; + if (message.meshes && message.meshes.length) { + object.meshes = []; + for (var j = 0; j < message.meshes.length; ++j) + object.meshes[j] = $root.google.cloud.networkservices.v1.Mesh.toObject(message.meshes[j], options); + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + object.nextPageToken = message.nextPageToken; + return object; + }; + + /** + * Converts this ListMeshesResponse to JSON. + * @function toJSON + * @memberof google.cloud.networkservices.v1.ListMeshesResponse + * @instance + * @returns {Object.} JSON object + */ + ListMeshesResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListMeshesResponse + * @function getTypeUrl + * @memberof google.cloud.networkservices.v1.ListMeshesResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListMeshesResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.networkservices.v1.ListMeshesResponse"; + }; + + return ListMeshesResponse; + })(); + + v1.GetMeshRequest = (function() { + + /** + * Properties of a GetMeshRequest. + * @memberof google.cloud.networkservices.v1 + * @interface IGetMeshRequest + * @property {string|null} [name] GetMeshRequest name + */ + + /** + * Constructs a new GetMeshRequest. + * @memberof google.cloud.networkservices.v1 + * @classdesc Represents a GetMeshRequest. + * @implements IGetMeshRequest + * @constructor + * @param {google.cloud.networkservices.v1.IGetMeshRequest=} [properties] Properties to set + */ + function GetMeshRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetMeshRequest name. + * @member {string} name + * @memberof google.cloud.networkservices.v1.GetMeshRequest + * @instance + */ + GetMeshRequest.prototype.name = ""; + + /** + * Creates a new GetMeshRequest instance using the specified properties. + * @function create + * @memberof google.cloud.networkservices.v1.GetMeshRequest + * @static + * @param {google.cloud.networkservices.v1.IGetMeshRequest=} [properties] Properties to set + * @returns {google.cloud.networkservices.v1.GetMeshRequest} GetMeshRequest instance + */ + GetMeshRequest.create = function create(properties) { + return new GetMeshRequest(properties); + }; + + /** + * Encodes the specified GetMeshRequest message. Does not implicitly {@link google.cloud.networkservices.v1.GetMeshRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.networkservices.v1.GetMeshRequest + * @static + * @param {google.cloud.networkservices.v1.IGetMeshRequest} message GetMeshRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetMeshRequest.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 GetMeshRequest message, length delimited. Does not implicitly {@link google.cloud.networkservices.v1.GetMeshRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.networkservices.v1.GetMeshRequest + * @static + * @param {google.cloud.networkservices.v1.IGetMeshRequest} message GetMeshRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetMeshRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetMeshRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.networkservices.v1.GetMeshRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.networkservices.v1.GetMeshRequest} GetMeshRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetMeshRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.networkservices.v1.GetMeshRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetMeshRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.networkservices.v1.GetMeshRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.networkservices.v1.GetMeshRequest} GetMeshRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetMeshRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetMeshRequest message. + * @function verify + * @memberof google.cloud.networkservices.v1.GetMeshRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetMeshRequest.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 GetMeshRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.networkservices.v1.GetMeshRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.networkservices.v1.GetMeshRequest} GetMeshRequest + */ + GetMeshRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.networkservices.v1.GetMeshRequest) + return object; + var message = new $root.google.cloud.networkservices.v1.GetMeshRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a GetMeshRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.networkservices.v1.GetMeshRequest + * @static + * @param {google.cloud.networkservices.v1.GetMeshRequest} message GetMeshRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetMeshRequest.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 GetMeshRequest to JSON. + * @function toJSON + * @memberof google.cloud.networkservices.v1.GetMeshRequest + * @instance + * @returns {Object.} JSON object + */ + GetMeshRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GetMeshRequest + * @function getTypeUrl + * @memberof google.cloud.networkservices.v1.GetMeshRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GetMeshRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.networkservices.v1.GetMeshRequest"; + }; + + return GetMeshRequest; + })(); + + v1.CreateMeshRequest = (function() { + + /** + * Properties of a CreateMeshRequest. + * @memberof google.cloud.networkservices.v1 + * @interface ICreateMeshRequest + * @property {string|null} [parent] CreateMeshRequest parent + * @property {string|null} [meshId] CreateMeshRequest meshId + * @property {google.cloud.networkservices.v1.IMesh|null} [mesh] CreateMeshRequest mesh + */ + + /** + * Constructs a new CreateMeshRequest. + * @memberof google.cloud.networkservices.v1 + * @classdesc Represents a CreateMeshRequest. + * @implements ICreateMeshRequest + * @constructor + * @param {google.cloud.networkservices.v1.ICreateMeshRequest=} [properties] Properties to set + */ + function CreateMeshRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * CreateMeshRequest parent. + * @member {string} parent + * @memberof google.cloud.networkservices.v1.CreateMeshRequest + * @instance + */ + CreateMeshRequest.prototype.parent = ""; + + /** + * CreateMeshRequest meshId. + * @member {string} meshId + * @memberof google.cloud.networkservices.v1.CreateMeshRequest + * @instance + */ + CreateMeshRequest.prototype.meshId = ""; + + /** + * CreateMeshRequest mesh. + * @member {google.cloud.networkservices.v1.IMesh|null|undefined} mesh + * @memberof google.cloud.networkservices.v1.CreateMeshRequest + * @instance + */ + CreateMeshRequest.prototype.mesh = null; + + /** + * Creates a new CreateMeshRequest instance using the specified properties. + * @function create + * @memberof google.cloud.networkservices.v1.CreateMeshRequest + * @static + * @param {google.cloud.networkservices.v1.ICreateMeshRequest=} [properties] Properties to set + * @returns {google.cloud.networkservices.v1.CreateMeshRequest} CreateMeshRequest instance + */ + CreateMeshRequest.create = function create(properties) { + return new CreateMeshRequest(properties); + }; + + /** + * Encodes the specified CreateMeshRequest message. Does not implicitly {@link google.cloud.networkservices.v1.CreateMeshRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.networkservices.v1.CreateMeshRequest + * @static + * @param {google.cloud.networkservices.v1.ICreateMeshRequest} message CreateMeshRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateMeshRequest.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.meshId != null && Object.hasOwnProperty.call(message, "meshId")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.meshId); + if (message.mesh != null && Object.hasOwnProperty.call(message, "mesh")) + $root.google.cloud.networkservices.v1.Mesh.encode(message.mesh, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified CreateMeshRequest message, length delimited. Does not implicitly {@link google.cloud.networkservices.v1.CreateMeshRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.networkservices.v1.CreateMeshRequest + * @static + * @param {google.cloud.networkservices.v1.ICreateMeshRequest} message CreateMeshRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateMeshRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CreateMeshRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.networkservices.v1.CreateMeshRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.networkservices.v1.CreateMeshRequest} CreateMeshRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateMeshRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.networkservices.v1.CreateMeshRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.meshId = reader.string(); + break; + } + case 3: { + message.mesh = $root.google.cloud.networkservices.v1.Mesh.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CreateMeshRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.networkservices.v1.CreateMeshRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.networkservices.v1.CreateMeshRequest} CreateMeshRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateMeshRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CreateMeshRequest message. + * @function verify + * @memberof google.cloud.networkservices.v1.CreateMeshRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CreateMeshRequest.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.meshId != null && message.hasOwnProperty("meshId")) + if (!$util.isString(message.meshId)) + return "meshId: string expected"; + if (message.mesh != null && message.hasOwnProperty("mesh")) { + var error = $root.google.cloud.networkservices.v1.Mesh.verify(message.mesh); + if (error) + return "mesh." + error; + } + return null; + }; + + /** + * Creates a CreateMeshRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.networkservices.v1.CreateMeshRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.networkservices.v1.CreateMeshRequest} CreateMeshRequest + */ + CreateMeshRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.networkservices.v1.CreateMeshRequest) + return object; + var message = new $root.google.cloud.networkservices.v1.CreateMeshRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.meshId != null) + message.meshId = String(object.meshId); + if (object.mesh != null) { + if (typeof object.mesh !== "object") + throw TypeError(".google.cloud.networkservices.v1.CreateMeshRequest.mesh: object expected"); + message.mesh = $root.google.cloud.networkservices.v1.Mesh.fromObject(object.mesh); + } + return message; + }; + + /** + * Creates a plain object from a CreateMeshRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.networkservices.v1.CreateMeshRequest + * @static + * @param {google.cloud.networkservices.v1.CreateMeshRequest} message CreateMeshRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CreateMeshRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.meshId = ""; + object.mesh = null; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.meshId != null && message.hasOwnProperty("meshId")) + object.meshId = message.meshId; + if (message.mesh != null && message.hasOwnProperty("mesh")) + object.mesh = $root.google.cloud.networkservices.v1.Mesh.toObject(message.mesh, options); + return object; + }; + + /** + * Converts this CreateMeshRequest to JSON. + * @function toJSON + * @memberof google.cloud.networkservices.v1.CreateMeshRequest + * @instance + * @returns {Object.} JSON object + */ + CreateMeshRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CreateMeshRequest + * @function getTypeUrl + * @memberof google.cloud.networkservices.v1.CreateMeshRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CreateMeshRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.networkservices.v1.CreateMeshRequest"; + }; + + return CreateMeshRequest; + })(); + + v1.UpdateMeshRequest = (function() { + + /** + * Properties of an UpdateMeshRequest. + * @memberof google.cloud.networkservices.v1 + * @interface IUpdateMeshRequest + * @property {google.protobuf.IFieldMask|null} [updateMask] UpdateMeshRequest updateMask + * @property {google.cloud.networkservices.v1.IMesh|null} [mesh] UpdateMeshRequest mesh + */ + + /** + * Constructs a new UpdateMeshRequest. + * @memberof google.cloud.networkservices.v1 + * @classdesc Represents an UpdateMeshRequest. + * @implements IUpdateMeshRequest + * @constructor + * @param {google.cloud.networkservices.v1.IUpdateMeshRequest=} [properties] Properties to set + */ + function UpdateMeshRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * UpdateMeshRequest updateMask. + * @member {google.protobuf.IFieldMask|null|undefined} updateMask + * @memberof google.cloud.networkservices.v1.UpdateMeshRequest + * @instance + */ + UpdateMeshRequest.prototype.updateMask = null; + + /** + * UpdateMeshRequest mesh. + * @member {google.cloud.networkservices.v1.IMesh|null|undefined} mesh + * @memberof google.cloud.networkservices.v1.UpdateMeshRequest + * @instance + */ + UpdateMeshRequest.prototype.mesh = null; + + /** + * Creates a new UpdateMeshRequest instance using the specified properties. + * @function create + * @memberof google.cloud.networkservices.v1.UpdateMeshRequest + * @static + * @param {google.cloud.networkservices.v1.IUpdateMeshRequest=} [properties] Properties to set + * @returns {google.cloud.networkservices.v1.UpdateMeshRequest} UpdateMeshRequest instance + */ + UpdateMeshRequest.create = function create(properties) { + return new UpdateMeshRequest(properties); + }; + + /** + * Encodes the specified UpdateMeshRequest message. Does not implicitly {@link google.cloud.networkservices.v1.UpdateMeshRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.networkservices.v1.UpdateMeshRequest + * @static + * @param {google.cloud.networkservices.v1.IUpdateMeshRequest} message UpdateMeshRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateMeshRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.updateMask != null && Object.hasOwnProperty.call(message, "updateMask")) + $root.google.protobuf.FieldMask.encode(message.updateMask, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.mesh != null && Object.hasOwnProperty.call(message, "mesh")) + $root.google.cloud.networkservices.v1.Mesh.encode(message.mesh, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified UpdateMeshRequest message, length delimited. Does not implicitly {@link google.cloud.networkservices.v1.UpdateMeshRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.networkservices.v1.UpdateMeshRequest + * @static + * @param {google.cloud.networkservices.v1.IUpdateMeshRequest} message UpdateMeshRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateMeshRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an UpdateMeshRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.networkservices.v1.UpdateMeshRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.networkservices.v1.UpdateMeshRequest} UpdateMeshRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateMeshRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.networkservices.v1.UpdateMeshRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.updateMask = $root.google.protobuf.FieldMask.decode(reader, reader.uint32()); + break; + } + case 2: { + message.mesh = $root.google.cloud.networkservices.v1.Mesh.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an UpdateMeshRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.networkservices.v1.UpdateMeshRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.networkservices.v1.UpdateMeshRequest} UpdateMeshRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateMeshRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an UpdateMeshRequest message. + * @function verify + * @memberof google.cloud.networkservices.v1.UpdateMeshRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + UpdateMeshRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.updateMask != null && message.hasOwnProperty("updateMask")) { + var error = $root.google.protobuf.FieldMask.verify(message.updateMask); + if (error) + return "updateMask." + error; + } + if (message.mesh != null && message.hasOwnProperty("mesh")) { + var error = $root.google.cloud.networkservices.v1.Mesh.verify(message.mesh); + if (error) + return "mesh." + error; + } + return null; + }; + + /** + * Creates an UpdateMeshRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.networkservices.v1.UpdateMeshRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.networkservices.v1.UpdateMeshRequest} UpdateMeshRequest + */ + UpdateMeshRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.networkservices.v1.UpdateMeshRequest) + return object; + var message = new $root.google.cloud.networkservices.v1.UpdateMeshRequest(); + if (object.updateMask != null) { + if (typeof object.updateMask !== "object") + throw TypeError(".google.cloud.networkservices.v1.UpdateMeshRequest.updateMask: object expected"); + message.updateMask = $root.google.protobuf.FieldMask.fromObject(object.updateMask); + } + if (object.mesh != null) { + if (typeof object.mesh !== "object") + throw TypeError(".google.cloud.networkservices.v1.UpdateMeshRequest.mesh: object expected"); + message.mesh = $root.google.cloud.networkservices.v1.Mesh.fromObject(object.mesh); + } + return message; + }; + + /** + * Creates a plain object from an UpdateMeshRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.networkservices.v1.UpdateMeshRequest + * @static + * @param {google.cloud.networkservices.v1.UpdateMeshRequest} message UpdateMeshRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + UpdateMeshRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.updateMask = null; + object.mesh = null; + } + if (message.updateMask != null && message.hasOwnProperty("updateMask")) + object.updateMask = $root.google.protobuf.FieldMask.toObject(message.updateMask, options); + if (message.mesh != null && message.hasOwnProperty("mesh")) + object.mesh = $root.google.cloud.networkservices.v1.Mesh.toObject(message.mesh, options); + return object; + }; + + /** + * Converts this UpdateMeshRequest to JSON. + * @function toJSON + * @memberof google.cloud.networkservices.v1.UpdateMeshRequest + * @instance + * @returns {Object.} JSON object + */ + UpdateMeshRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for UpdateMeshRequest + * @function getTypeUrl + * @memberof google.cloud.networkservices.v1.UpdateMeshRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + UpdateMeshRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.networkservices.v1.UpdateMeshRequest"; + }; + + return UpdateMeshRequest; + })(); + + v1.DeleteMeshRequest = (function() { + + /** + * Properties of a DeleteMeshRequest. + * @memberof google.cloud.networkservices.v1 + * @interface IDeleteMeshRequest + * @property {string|null} [name] DeleteMeshRequest name + */ + + /** + * Constructs a new DeleteMeshRequest. + * @memberof google.cloud.networkservices.v1 + * @classdesc Represents a DeleteMeshRequest. + * @implements IDeleteMeshRequest + * @constructor + * @param {google.cloud.networkservices.v1.IDeleteMeshRequest=} [properties] Properties to set + */ + function DeleteMeshRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * DeleteMeshRequest name. + * @member {string} name + * @memberof google.cloud.networkservices.v1.DeleteMeshRequest + * @instance + */ + DeleteMeshRequest.prototype.name = ""; + + /** + * Creates a new DeleteMeshRequest instance using the specified properties. + * @function create + * @memberof google.cloud.networkservices.v1.DeleteMeshRequest + * @static + * @param {google.cloud.networkservices.v1.IDeleteMeshRequest=} [properties] Properties to set + * @returns {google.cloud.networkservices.v1.DeleteMeshRequest} DeleteMeshRequest instance + */ + DeleteMeshRequest.create = function create(properties) { + return new DeleteMeshRequest(properties); + }; + + /** + * Encodes the specified DeleteMeshRequest message. Does not implicitly {@link google.cloud.networkservices.v1.DeleteMeshRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.networkservices.v1.DeleteMeshRequest + * @static + * @param {google.cloud.networkservices.v1.IDeleteMeshRequest} message DeleteMeshRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteMeshRequest.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 DeleteMeshRequest message, length delimited. Does not implicitly {@link google.cloud.networkservices.v1.DeleteMeshRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.networkservices.v1.DeleteMeshRequest + * @static + * @param {google.cloud.networkservices.v1.IDeleteMeshRequest} message DeleteMeshRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteMeshRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DeleteMeshRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.networkservices.v1.DeleteMeshRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.networkservices.v1.DeleteMeshRequest} DeleteMeshRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteMeshRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.networkservices.v1.DeleteMeshRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DeleteMeshRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.networkservices.v1.DeleteMeshRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.networkservices.v1.DeleteMeshRequest} DeleteMeshRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteMeshRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DeleteMeshRequest message. + * @function verify + * @memberof google.cloud.networkservices.v1.DeleteMeshRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DeleteMeshRequest.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 DeleteMeshRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.networkservices.v1.DeleteMeshRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.networkservices.v1.DeleteMeshRequest} DeleteMeshRequest + */ + DeleteMeshRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.networkservices.v1.DeleteMeshRequest) + return object; + var message = new $root.google.cloud.networkservices.v1.DeleteMeshRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a DeleteMeshRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.networkservices.v1.DeleteMeshRequest + * @static + * @param {google.cloud.networkservices.v1.DeleteMeshRequest} message DeleteMeshRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DeleteMeshRequest.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 DeleteMeshRequest to JSON. + * @function toJSON + * @memberof google.cloud.networkservices.v1.DeleteMeshRequest + * @instance + * @returns {Object.} JSON object + */ + DeleteMeshRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DeleteMeshRequest + * @function getTypeUrl + * @memberof google.cloud.networkservices.v1.DeleteMeshRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DeleteMeshRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.networkservices.v1.DeleteMeshRequest"; + }; + + return DeleteMeshRequest; + })(); + + v1.NetworkServices = (function() { + + /** + * Constructs a new NetworkServices service. + * @memberof google.cloud.networkservices.v1 + * @classdesc Represents a NetworkServices + * @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 NetworkServices(rpcImpl, requestDelimited, responseDelimited) { + $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); + } + + (NetworkServices.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = NetworkServices; + + /** + * Creates new NetworkServices service using the specified rpc implementation. + * @function create + * @memberof google.cloud.networkservices.v1.NetworkServices + * @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 {NetworkServices} RPC service. Useful where requests and/or responses are streamed. + */ + NetworkServices.create = function create(rpcImpl, requestDelimited, responseDelimited) { + return new this(rpcImpl, requestDelimited, responseDelimited); + }; + + /** + * Callback as used by {@link google.cloud.networkservices.v1.NetworkServices|listEndpointPolicies}. + * @memberof google.cloud.networkservices.v1.NetworkServices + * @typedef ListEndpointPoliciesCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.networkservices.v1.ListEndpointPoliciesResponse} [response] ListEndpointPoliciesResponse + */ + + /** + * Calls ListEndpointPolicies. + * @function listEndpointPolicies + * @memberof google.cloud.networkservices.v1.NetworkServices + * @instance + * @param {google.cloud.networkservices.v1.IListEndpointPoliciesRequest} request ListEndpointPoliciesRequest message or plain object + * @param {google.cloud.networkservices.v1.NetworkServices.ListEndpointPoliciesCallback} callback Node-style callback called with the error, if any, and ListEndpointPoliciesResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(NetworkServices.prototype.listEndpointPolicies = function listEndpointPolicies(request, callback) { + return this.rpcCall(listEndpointPolicies, $root.google.cloud.networkservices.v1.ListEndpointPoliciesRequest, $root.google.cloud.networkservices.v1.ListEndpointPoliciesResponse, request, callback); + }, "name", { value: "ListEndpointPolicies" }); + + /** + * Calls ListEndpointPolicies. + * @function listEndpointPolicies + * @memberof google.cloud.networkservices.v1.NetworkServices + * @instance + * @param {google.cloud.networkservices.v1.IListEndpointPoliciesRequest} request ListEndpointPoliciesRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.networkservices.v1.NetworkServices|getEndpointPolicy}. + * @memberof google.cloud.networkservices.v1.NetworkServices + * @typedef GetEndpointPolicyCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.networkservices.v1.EndpointPolicy} [response] EndpointPolicy + */ + + /** + * Calls GetEndpointPolicy. + * @function getEndpointPolicy + * @memberof google.cloud.networkservices.v1.NetworkServices + * @instance + * @param {google.cloud.networkservices.v1.IGetEndpointPolicyRequest} request GetEndpointPolicyRequest message or plain object + * @param {google.cloud.networkservices.v1.NetworkServices.GetEndpointPolicyCallback} callback Node-style callback called with the error, if any, and EndpointPolicy + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(NetworkServices.prototype.getEndpointPolicy = function getEndpointPolicy(request, callback) { + return this.rpcCall(getEndpointPolicy, $root.google.cloud.networkservices.v1.GetEndpointPolicyRequest, $root.google.cloud.networkservices.v1.EndpointPolicy, request, callback); + }, "name", { value: "GetEndpointPolicy" }); + + /** + * Calls GetEndpointPolicy. + * @function getEndpointPolicy + * @memberof google.cloud.networkservices.v1.NetworkServices + * @instance + * @param {google.cloud.networkservices.v1.IGetEndpointPolicyRequest} request GetEndpointPolicyRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.networkservices.v1.NetworkServices|createEndpointPolicy}. + * @memberof google.cloud.networkservices.v1.NetworkServices + * @typedef CreateEndpointPolicyCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls CreateEndpointPolicy. + * @function createEndpointPolicy + * @memberof google.cloud.networkservices.v1.NetworkServices + * @instance + * @param {google.cloud.networkservices.v1.ICreateEndpointPolicyRequest} request CreateEndpointPolicyRequest message or plain object + * @param {google.cloud.networkservices.v1.NetworkServices.CreateEndpointPolicyCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(NetworkServices.prototype.createEndpointPolicy = function createEndpointPolicy(request, callback) { + return this.rpcCall(createEndpointPolicy, $root.google.cloud.networkservices.v1.CreateEndpointPolicyRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "CreateEndpointPolicy" }); + + /** + * Calls CreateEndpointPolicy. + * @function createEndpointPolicy + * @memberof google.cloud.networkservices.v1.NetworkServices + * @instance + * @param {google.cloud.networkservices.v1.ICreateEndpointPolicyRequest} request CreateEndpointPolicyRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.networkservices.v1.NetworkServices|updateEndpointPolicy}. + * @memberof google.cloud.networkservices.v1.NetworkServices + * @typedef UpdateEndpointPolicyCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls UpdateEndpointPolicy. + * @function updateEndpointPolicy + * @memberof google.cloud.networkservices.v1.NetworkServices + * @instance + * @param {google.cloud.networkservices.v1.IUpdateEndpointPolicyRequest} request UpdateEndpointPolicyRequest message or plain object + * @param {google.cloud.networkservices.v1.NetworkServices.UpdateEndpointPolicyCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(NetworkServices.prototype.updateEndpointPolicy = function updateEndpointPolicy(request, callback) { + return this.rpcCall(updateEndpointPolicy, $root.google.cloud.networkservices.v1.UpdateEndpointPolicyRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "UpdateEndpointPolicy" }); + + /** + * Calls UpdateEndpointPolicy. + * @function updateEndpointPolicy + * @memberof google.cloud.networkservices.v1.NetworkServices + * @instance + * @param {google.cloud.networkservices.v1.IUpdateEndpointPolicyRequest} request UpdateEndpointPolicyRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.networkservices.v1.NetworkServices|deleteEndpointPolicy}. + * @memberof google.cloud.networkservices.v1.NetworkServices + * @typedef DeleteEndpointPolicyCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls DeleteEndpointPolicy. + * @function deleteEndpointPolicy + * @memberof google.cloud.networkservices.v1.NetworkServices + * @instance + * @param {google.cloud.networkservices.v1.IDeleteEndpointPolicyRequest} request DeleteEndpointPolicyRequest message or plain object + * @param {google.cloud.networkservices.v1.NetworkServices.DeleteEndpointPolicyCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(NetworkServices.prototype.deleteEndpointPolicy = function deleteEndpointPolicy(request, callback) { + return this.rpcCall(deleteEndpointPolicy, $root.google.cloud.networkservices.v1.DeleteEndpointPolicyRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "DeleteEndpointPolicy" }); + + /** + * Calls DeleteEndpointPolicy. + * @function deleteEndpointPolicy + * @memberof google.cloud.networkservices.v1.NetworkServices + * @instance + * @param {google.cloud.networkservices.v1.IDeleteEndpointPolicyRequest} request DeleteEndpointPolicyRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.networkservices.v1.NetworkServices|listGateways}. + * @memberof google.cloud.networkservices.v1.NetworkServices + * @typedef ListGatewaysCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.networkservices.v1.ListGatewaysResponse} [response] ListGatewaysResponse + */ + + /** + * Calls ListGateways. + * @function listGateways + * @memberof google.cloud.networkservices.v1.NetworkServices + * @instance + * @param {google.cloud.networkservices.v1.IListGatewaysRequest} request ListGatewaysRequest message or plain object + * @param {google.cloud.networkservices.v1.NetworkServices.ListGatewaysCallback} callback Node-style callback called with the error, if any, and ListGatewaysResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(NetworkServices.prototype.listGateways = function listGateways(request, callback) { + return this.rpcCall(listGateways, $root.google.cloud.networkservices.v1.ListGatewaysRequest, $root.google.cloud.networkservices.v1.ListGatewaysResponse, request, callback); + }, "name", { value: "ListGateways" }); + + /** + * Calls ListGateways. + * @function listGateways + * @memberof google.cloud.networkservices.v1.NetworkServices + * @instance + * @param {google.cloud.networkservices.v1.IListGatewaysRequest} request ListGatewaysRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.networkservices.v1.NetworkServices|getGateway}. + * @memberof google.cloud.networkservices.v1.NetworkServices + * @typedef GetGatewayCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.networkservices.v1.Gateway} [response] Gateway + */ + + /** + * Calls GetGateway. + * @function getGateway + * @memberof google.cloud.networkservices.v1.NetworkServices + * @instance + * @param {google.cloud.networkservices.v1.IGetGatewayRequest} request GetGatewayRequest message or plain object + * @param {google.cloud.networkservices.v1.NetworkServices.GetGatewayCallback} callback Node-style callback called with the error, if any, and Gateway + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(NetworkServices.prototype.getGateway = function getGateway(request, callback) { + return this.rpcCall(getGateway, $root.google.cloud.networkservices.v1.GetGatewayRequest, $root.google.cloud.networkservices.v1.Gateway, request, callback); + }, "name", { value: "GetGateway" }); + + /** + * Calls GetGateway. + * @function getGateway + * @memberof google.cloud.networkservices.v1.NetworkServices + * @instance + * @param {google.cloud.networkservices.v1.IGetGatewayRequest} request GetGatewayRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.networkservices.v1.NetworkServices|createGateway}. + * @memberof google.cloud.networkservices.v1.NetworkServices + * @typedef CreateGatewayCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls CreateGateway. + * @function createGateway + * @memberof google.cloud.networkservices.v1.NetworkServices + * @instance + * @param {google.cloud.networkservices.v1.ICreateGatewayRequest} request CreateGatewayRequest message or plain object + * @param {google.cloud.networkservices.v1.NetworkServices.CreateGatewayCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(NetworkServices.prototype.createGateway = function createGateway(request, callback) { + return this.rpcCall(createGateway, $root.google.cloud.networkservices.v1.CreateGatewayRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "CreateGateway" }); + + /** + * Calls CreateGateway. + * @function createGateway + * @memberof google.cloud.networkservices.v1.NetworkServices + * @instance + * @param {google.cloud.networkservices.v1.ICreateGatewayRequest} request CreateGatewayRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.networkservices.v1.NetworkServices|updateGateway}. + * @memberof google.cloud.networkservices.v1.NetworkServices + * @typedef UpdateGatewayCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls UpdateGateway. + * @function updateGateway + * @memberof google.cloud.networkservices.v1.NetworkServices + * @instance + * @param {google.cloud.networkservices.v1.IUpdateGatewayRequest} request UpdateGatewayRequest message or plain object + * @param {google.cloud.networkservices.v1.NetworkServices.UpdateGatewayCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(NetworkServices.prototype.updateGateway = function updateGateway(request, callback) { + return this.rpcCall(updateGateway, $root.google.cloud.networkservices.v1.UpdateGatewayRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "UpdateGateway" }); + + /** + * Calls UpdateGateway. + * @function updateGateway + * @memberof google.cloud.networkservices.v1.NetworkServices + * @instance + * @param {google.cloud.networkservices.v1.IUpdateGatewayRequest} request UpdateGatewayRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.networkservices.v1.NetworkServices|deleteGateway}. + * @memberof google.cloud.networkservices.v1.NetworkServices + * @typedef DeleteGatewayCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls DeleteGateway. + * @function deleteGateway + * @memberof google.cloud.networkservices.v1.NetworkServices + * @instance + * @param {google.cloud.networkservices.v1.IDeleteGatewayRequest} request DeleteGatewayRequest message or plain object + * @param {google.cloud.networkservices.v1.NetworkServices.DeleteGatewayCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(NetworkServices.prototype.deleteGateway = function deleteGateway(request, callback) { + return this.rpcCall(deleteGateway, $root.google.cloud.networkservices.v1.DeleteGatewayRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "DeleteGateway" }); + + /** + * Calls DeleteGateway. + * @function deleteGateway + * @memberof google.cloud.networkservices.v1.NetworkServices + * @instance + * @param {google.cloud.networkservices.v1.IDeleteGatewayRequest} request DeleteGatewayRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.networkservices.v1.NetworkServices|listGrpcRoutes}. + * @memberof google.cloud.networkservices.v1.NetworkServices + * @typedef ListGrpcRoutesCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.networkservices.v1.ListGrpcRoutesResponse} [response] ListGrpcRoutesResponse + */ + + /** + * Calls ListGrpcRoutes. + * @function listGrpcRoutes + * @memberof google.cloud.networkservices.v1.NetworkServices + * @instance + * @param {google.cloud.networkservices.v1.IListGrpcRoutesRequest} request ListGrpcRoutesRequest message or plain object + * @param {google.cloud.networkservices.v1.NetworkServices.ListGrpcRoutesCallback} callback Node-style callback called with the error, if any, and ListGrpcRoutesResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(NetworkServices.prototype.listGrpcRoutes = function listGrpcRoutes(request, callback) { + return this.rpcCall(listGrpcRoutes, $root.google.cloud.networkservices.v1.ListGrpcRoutesRequest, $root.google.cloud.networkservices.v1.ListGrpcRoutesResponse, request, callback); + }, "name", { value: "ListGrpcRoutes" }); + + /** + * Calls ListGrpcRoutes. + * @function listGrpcRoutes + * @memberof google.cloud.networkservices.v1.NetworkServices + * @instance + * @param {google.cloud.networkservices.v1.IListGrpcRoutesRequest} request ListGrpcRoutesRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.networkservices.v1.NetworkServices|getGrpcRoute}. + * @memberof google.cloud.networkservices.v1.NetworkServices + * @typedef GetGrpcRouteCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.networkservices.v1.GrpcRoute} [response] GrpcRoute + */ + + /** + * Calls GetGrpcRoute. + * @function getGrpcRoute + * @memberof google.cloud.networkservices.v1.NetworkServices + * @instance + * @param {google.cloud.networkservices.v1.IGetGrpcRouteRequest} request GetGrpcRouteRequest message or plain object + * @param {google.cloud.networkservices.v1.NetworkServices.GetGrpcRouteCallback} callback Node-style callback called with the error, if any, and GrpcRoute + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(NetworkServices.prototype.getGrpcRoute = function getGrpcRoute(request, callback) { + return this.rpcCall(getGrpcRoute, $root.google.cloud.networkservices.v1.GetGrpcRouteRequest, $root.google.cloud.networkservices.v1.GrpcRoute, request, callback); + }, "name", { value: "GetGrpcRoute" }); + + /** + * Calls GetGrpcRoute. + * @function getGrpcRoute + * @memberof google.cloud.networkservices.v1.NetworkServices + * @instance + * @param {google.cloud.networkservices.v1.IGetGrpcRouteRequest} request GetGrpcRouteRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.networkservices.v1.NetworkServices|createGrpcRoute}. + * @memberof google.cloud.networkservices.v1.NetworkServices + * @typedef CreateGrpcRouteCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls CreateGrpcRoute. + * @function createGrpcRoute + * @memberof google.cloud.networkservices.v1.NetworkServices + * @instance + * @param {google.cloud.networkservices.v1.ICreateGrpcRouteRequest} request CreateGrpcRouteRequest message or plain object + * @param {google.cloud.networkservices.v1.NetworkServices.CreateGrpcRouteCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(NetworkServices.prototype.createGrpcRoute = function createGrpcRoute(request, callback) { + return this.rpcCall(createGrpcRoute, $root.google.cloud.networkservices.v1.CreateGrpcRouteRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "CreateGrpcRoute" }); + + /** + * Calls CreateGrpcRoute. + * @function createGrpcRoute + * @memberof google.cloud.networkservices.v1.NetworkServices + * @instance + * @param {google.cloud.networkservices.v1.ICreateGrpcRouteRequest} request CreateGrpcRouteRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.networkservices.v1.NetworkServices|updateGrpcRoute}. + * @memberof google.cloud.networkservices.v1.NetworkServices + * @typedef UpdateGrpcRouteCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls UpdateGrpcRoute. + * @function updateGrpcRoute + * @memberof google.cloud.networkservices.v1.NetworkServices + * @instance + * @param {google.cloud.networkservices.v1.IUpdateGrpcRouteRequest} request UpdateGrpcRouteRequest message or plain object + * @param {google.cloud.networkservices.v1.NetworkServices.UpdateGrpcRouteCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(NetworkServices.prototype.updateGrpcRoute = function updateGrpcRoute(request, callback) { + return this.rpcCall(updateGrpcRoute, $root.google.cloud.networkservices.v1.UpdateGrpcRouteRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "UpdateGrpcRoute" }); + + /** + * Calls UpdateGrpcRoute. + * @function updateGrpcRoute + * @memberof google.cloud.networkservices.v1.NetworkServices + * @instance + * @param {google.cloud.networkservices.v1.IUpdateGrpcRouteRequest} request UpdateGrpcRouteRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.networkservices.v1.NetworkServices|deleteGrpcRoute}. + * @memberof google.cloud.networkservices.v1.NetworkServices + * @typedef DeleteGrpcRouteCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls DeleteGrpcRoute. + * @function deleteGrpcRoute + * @memberof google.cloud.networkservices.v1.NetworkServices + * @instance + * @param {google.cloud.networkservices.v1.IDeleteGrpcRouteRequest} request DeleteGrpcRouteRequest message or plain object + * @param {google.cloud.networkservices.v1.NetworkServices.DeleteGrpcRouteCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(NetworkServices.prototype.deleteGrpcRoute = function deleteGrpcRoute(request, callback) { + return this.rpcCall(deleteGrpcRoute, $root.google.cloud.networkservices.v1.DeleteGrpcRouteRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "DeleteGrpcRoute" }); + + /** + * Calls DeleteGrpcRoute. + * @function deleteGrpcRoute + * @memberof google.cloud.networkservices.v1.NetworkServices + * @instance + * @param {google.cloud.networkservices.v1.IDeleteGrpcRouteRequest} request DeleteGrpcRouteRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.networkservices.v1.NetworkServices|listHttpRoutes}. + * @memberof google.cloud.networkservices.v1.NetworkServices + * @typedef ListHttpRoutesCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.networkservices.v1.ListHttpRoutesResponse} [response] ListHttpRoutesResponse + */ + + /** + * Calls ListHttpRoutes. + * @function listHttpRoutes + * @memberof google.cloud.networkservices.v1.NetworkServices + * @instance + * @param {google.cloud.networkservices.v1.IListHttpRoutesRequest} request ListHttpRoutesRequest message or plain object + * @param {google.cloud.networkservices.v1.NetworkServices.ListHttpRoutesCallback} callback Node-style callback called with the error, if any, and ListHttpRoutesResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(NetworkServices.prototype.listHttpRoutes = function listHttpRoutes(request, callback) { + return this.rpcCall(listHttpRoutes, $root.google.cloud.networkservices.v1.ListHttpRoutesRequest, $root.google.cloud.networkservices.v1.ListHttpRoutesResponse, request, callback); + }, "name", { value: "ListHttpRoutes" }); + + /** + * Calls ListHttpRoutes. + * @function listHttpRoutes + * @memberof google.cloud.networkservices.v1.NetworkServices + * @instance + * @param {google.cloud.networkservices.v1.IListHttpRoutesRequest} request ListHttpRoutesRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.networkservices.v1.NetworkServices|getHttpRoute}. + * @memberof google.cloud.networkservices.v1.NetworkServices + * @typedef GetHttpRouteCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.networkservices.v1.HttpRoute} [response] HttpRoute + */ + + /** + * Calls GetHttpRoute. + * @function getHttpRoute + * @memberof google.cloud.networkservices.v1.NetworkServices + * @instance + * @param {google.cloud.networkservices.v1.IGetHttpRouteRequest} request GetHttpRouteRequest message or plain object + * @param {google.cloud.networkservices.v1.NetworkServices.GetHttpRouteCallback} callback Node-style callback called with the error, if any, and HttpRoute + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(NetworkServices.prototype.getHttpRoute = function getHttpRoute(request, callback) { + return this.rpcCall(getHttpRoute, $root.google.cloud.networkservices.v1.GetHttpRouteRequest, $root.google.cloud.networkservices.v1.HttpRoute, request, callback); + }, "name", { value: "GetHttpRoute" }); + + /** + * Calls GetHttpRoute. + * @function getHttpRoute + * @memberof google.cloud.networkservices.v1.NetworkServices + * @instance + * @param {google.cloud.networkservices.v1.IGetHttpRouteRequest} request GetHttpRouteRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.networkservices.v1.NetworkServices|createHttpRoute}. + * @memberof google.cloud.networkservices.v1.NetworkServices + * @typedef CreateHttpRouteCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls CreateHttpRoute. + * @function createHttpRoute + * @memberof google.cloud.networkservices.v1.NetworkServices + * @instance + * @param {google.cloud.networkservices.v1.ICreateHttpRouteRequest} request CreateHttpRouteRequest message or plain object + * @param {google.cloud.networkservices.v1.NetworkServices.CreateHttpRouteCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(NetworkServices.prototype.createHttpRoute = function createHttpRoute(request, callback) { + return this.rpcCall(createHttpRoute, $root.google.cloud.networkservices.v1.CreateHttpRouteRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "CreateHttpRoute" }); + + /** + * Calls CreateHttpRoute. + * @function createHttpRoute + * @memberof google.cloud.networkservices.v1.NetworkServices + * @instance + * @param {google.cloud.networkservices.v1.ICreateHttpRouteRequest} request CreateHttpRouteRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.networkservices.v1.NetworkServices|updateHttpRoute}. + * @memberof google.cloud.networkservices.v1.NetworkServices + * @typedef UpdateHttpRouteCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls UpdateHttpRoute. + * @function updateHttpRoute + * @memberof google.cloud.networkservices.v1.NetworkServices + * @instance + * @param {google.cloud.networkservices.v1.IUpdateHttpRouteRequest} request UpdateHttpRouteRequest message or plain object + * @param {google.cloud.networkservices.v1.NetworkServices.UpdateHttpRouteCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(NetworkServices.prototype.updateHttpRoute = function updateHttpRoute(request, callback) { + return this.rpcCall(updateHttpRoute, $root.google.cloud.networkservices.v1.UpdateHttpRouteRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "UpdateHttpRoute" }); + + /** + * Calls UpdateHttpRoute. + * @function updateHttpRoute + * @memberof google.cloud.networkservices.v1.NetworkServices + * @instance + * @param {google.cloud.networkservices.v1.IUpdateHttpRouteRequest} request UpdateHttpRouteRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.networkservices.v1.NetworkServices|deleteHttpRoute}. + * @memberof google.cloud.networkservices.v1.NetworkServices + * @typedef DeleteHttpRouteCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls DeleteHttpRoute. + * @function deleteHttpRoute + * @memberof google.cloud.networkservices.v1.NetworkServices + * @instance + * @param {google.cloud.networkservices.v1.IDeleteHttpRouteRequest} request DeleteHttpRouteRequest message or plain object + * @param {google.cloud.networkservices.v1.NetworkServices.DeleteHttpRouteCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(NetworkServices.prototype.deleteHttpRoute = function deleteHttpRoute(request, callback) { + return this.rpcCall(deleteHttpRoute, $root.google.cloud.networkservices.v1.DeleteHttpRouteRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "DeleteHttpRoute" }); + + /** + * Calls DeleteHttpRoute. + * @function deleteHttpRoute + * @memberof google.cloud.networkservices.v1.NetworkServices + * @instance + * @param {google.cloud.networkservices.v1.IDeleteHttpRouteRequest} request DeleteHttpRouteRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.networkservices.v1.NetworkServices|listTcpRoutes}. + * @memberof google.cloud.networkservices.v1.NetworkServices + * @typedef ListTcpRoutesCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.networkservices.v1.ListTcpRoutesResponse} [response] ListTcpRoutesResponse + */ + + /** + * Calls ListTcpRoutes. + * @function listTcpRoutes + * @memberof google.cloud.networkservices.v1.NetworkServices + * @instance + * @param {google.cloud.networkservices.v1.IListTcpRoutesRequest} request ListTcpRoutesRequest message or plain object + * @param {google.cloud.networkservices.v1.NetworkServices.ListTcpRoutesCallback} callback Node-style callback called with the error, if any, and ListTcpRoutesResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(NetworkServices.prototype.listTcpRoutes = function listTcpRoutes(request, callback) { + return this.rpcCall(listTcpRoutes, $root.google.cloud.networkservices.v1.ListTcpRoutesRequest, $root.google.cloud.networkservices.v1.ListTcpRoutesResponse, request, callback); + }, "name", { value: "ListTcpRoutes" }); + + /** + * Calls ListTcpRoutes. + * @function listTcpRoutes + * @memberof google.cloud.networkservices.v1.NetworkServices + * @instance + * @param {google.cloud.networkservices.v1.IListTcpRoutesRequest} request ListTcpRoutesRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.networkservices.v1.NetworkServices|getTcpRoute}. + * @memberof google.cloud.networkservices.v1.NetworkServices + * @typedef GetTcpRouteCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.networkservices.v1.TcpRoute} [response] TcpRoute + */ + + /** + * Calls GetTcpRoute. + * @function getTcpRoute + * @memberof google.cloud.networkservices.v1.NetworkServices + * @instance + * @param {google.cloud.networkservices.v1.IGetTcpRouteRequest} request GetTcpRouteRequest message or plain object + * @param {google.cloud.networkservices.v1.NetworkServices.GetTcpRouteCallback} callback Node-style callback called with the error, if any, and TcpRoute + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(NetworkServices.prototype.getTcpRoute = function getTcpRoute(request, callback) { + return this.rpcCall(getTcpRoute, $root.google.cloud.networkservices.v1.GetTcpRouteRequest, $root.google.cloud.networkservices.v1.TcpRoute, request, callback); + }, "name", { value: "GetTcpRoute" }); + + /** + * Calls GetTcpRoute. + * @function getTcpRoute + * @memberof google.cloud.networkservices.v1.NetworkServices + * @instance + * @param {google.cloud.networkservices.v1.IGetTcpRouteRequest} request GetTcpRouteRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.networkservices.v1.NetworkServices|createTcpRoute}. + * @memberof google.cloud.networkservices.v1.NetworkServices + * @typedef CreateTcpRouteCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls CreateTcpRoute. + * @function createTcpRoute + * @memberof google.cloud.networkservices.v1.NetworkServices + * @instance + * @param {google.cloud.networkservices.v1.ICreateTcpRouteRequest} request CreateTcpRouteRequest message or plain object + * @param {google.cloud.networkservices.v1.NetworkServices.CreateTcpRouteCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(NetworkServices.prototype.createTcpRoute = function createTcpRoute(request, callback) { + return this.rpcCall(createTcpRoute, $root.google.cloud.networkservices.v1.CreateTcpRouteRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "CreateTcpRoute" }); + + /** + * Calls CreateTcpRoute. + * @function createTcpRoute + * @memberof google.cloud.networkservices.v1.NetworkServices + * @instance + * @param {google.cloud.networkservices.v1.ICreateTcpRouteRequest} request CreateTcpRouteRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.networkservices.v1.NetworkServices|updateTcpRoute}. + * @memberof google.cloud.networkservices.v1.NetworkServices + * @typedef UpdateTcpRouteCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls UpdateTcpRoute. + * @function updateTcpRoute + * @memberof google.cloud.networkservices.v1.NetworkServices + * @instance + * @param {google.cloud.networkservices.v1.IUpdateTcpRouteRequest} request UpdateTcpRouteRequest message or plain object + * @param {google.cloud.networkservices.v1.NetworkServices.UpdateTcpRouteCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(NetworkServices.prototype.updateTcpRoute = function updateTcpRoute(request, callback) { + return this.rpcCall(updateTcpRoute, $root.google.cloud.networkservices.v1.UpdateTcpRouteRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "UpdateTcpRoute" }); + + /** + * Calls UpdateTcpRoute. + * @function updateTcpRoute + * @memberof google.cloud.networkservices.v1.NetworkServices + * @instance + * @param {google.cloud.networkservices.v1.IUpdateTcpRouteRequest} request UpdateTcpRouteRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.networkservices.v1.NetworkServices|deleteTcpRoute}. + * @memberof google.cloud.networkservices.v1.NetworkServices + * @typedef DeleteTcpRouteCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls DeleteTcpRoute. + * @function deleteTcpRoute + * @memberof google.cloud.networkservices.v1.NetworkServices + * @instance + * @param {google.cloud.networkservices.v1.IDeleteTcpRouteRequest} request DeleteTcpRouteRequest message or plain object + * @param {google.cloud.networkservices.v1.NetworkServices.DeleteTcpRouteCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(NetworkServices.prototype.deleteTcpRoute = function deleteTcpRoute(request, callback) { + return this.rpcCall(deleteTcpRoute, $root.google.cloud.networkservices.v1.DeleteTcpRouteRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "DeleteTcpRoute" }); + + /** + * Calls DeleteTcpRoute. + * @function deleteTcpRoute + * @memberof google.cloud.networkservices.v1.NetworkServices + * @instance + * @param {google.cloud.networkservices.v1.IDeleteTcpRouteRequest} request DeleteTcpRouteRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.networkservices.v1.NetworkServices|listTlsRoutes}. + * @memberof google.cloud.networkservices.v1.NetworkServices + * @typedef ListTlsRoutesCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.networkservices.v1.ListTlsRoutesResponse} [response] ListTlsRoutesResponse + */ + + /** + * Calls ListTlsRoutes. + * @function listTlsRoutes + * @memberof google.cloud.networkservices.v1.NetworkServices + * @instance + * @param {google.cloud.networkservices.v1.IListTlsRoutesRequest} request ListTlsRoutesRequest message or plain object + * @param {google.cloud.networkservices.v1.NetworkServices.ListTlsRoutesCallback} callback Node-style callback called with the error, if any, and ListTlsRoutesResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(NetworkServices.prototype.listTlsRoutes = function listTlsRoutes(request, callback) { + return this.rpcCall(listTlsRoutes, $root.google.cloud.networkservices.v1.ListTlsRoutesRequest, $root.google.cloud.networkservices.v1.ListTlsRoutesResponse, request, callback); + }, "name", { value: "ListTlsRoutes" }); + + /** + * Calls ListTlsRoutes. + * @function listTlsRoutes + * @memberof google.cloud.networkservices.v1.NetworkServices + * @instance + * @param {google.cloud.networkservices.v1.IListTlsRoutesRequest} request ListTlsRoutesRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.networkservices.v1.NetworkServices|getTlsRoute}. + * @memberof google.cloud.networkservices.v1.NetworkServices + * @typedef GetTlsRouteCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.networkservices.v1.TlsRoute} [response] TlsRoute + */ + + /** + * Calls GetTlsRoute. + * @function getTlsRoute + * @memberof google.cloud.networkservices.v1.NetworkServices + * @instance + * @param {google.cloud.networkservices.v1.IGetTlsRouteRequest} request GetTlsRouteRequest message or plain object + * @param {google.cloud.networkservices.v1.NetworkServices.GetTlsRouteCallback} callback Node-style callback called with the error, if any, and TlsRoute + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(NetworkServices.prototype.getTlsRoute = function getTlsRoute(request, callback) { + return this.rpcCall(getTlsRoute, $root.google.cloud.networkservices.v1.GetTlsRouteRequest, $root.google.cloud.networkservices.v1.TlsRoute, request, callback); + }, "name", { value: "GetTlsRoute" }); + + /** + * Calls GetTlsRoute. + * @function getTlsRoute + * @memberof google.cloud.networkservices.v1.NetworkServices + * @instance + * @param {google.cloud.networkservices.v1.IGetTlsRouteRequest} request GetTlsRouteRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.networkservices.v1.NetworkServices|createTlsRoute}. + * @memberof google.cloud.networkservices.v1.NetworkServices + * @typedef CreateTlsRouteCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls CreateTlsRoute. + * @function createTlsRoute + * @memberof google.cloud.networkservices.v1.NetworkServices + * @instance + * @param {google.cloud.networkservices.v1.ICreateTlsRouteRequest} request CreateTlsRouteRequest message or plain object + * @param {google.cloud.networkservices.v1.NetworkServices.CreateTlsRouteCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(NetworkServices.prototype.createTlsRoute = function createTlsRoute(request, callback) { + return this.rpcCall(createTlsRoute, $root.google.cloud.networkservices.v1.CreateTlsRouteRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "CreateTlsRoute" }); + + /** + * Calls CreateTlsRoute. + * @function createTlsRoute + * @memberof google.cloud.networkservices.v1.NetworkServices + * @instance + * @param {google.cloud.networkservices.v1.ICreateTlsRouteRequest} request CreateTlsRouteRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.networkservices.v1.NetworkServices|updateTlsRoute}. + * @memberof google.cloud.networkservices.v1.NetworkServices + * @typedef UpdateTlsRouteCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls UpdateTlsRoute. + * @function updateTlsRoute + * @memberof google.cloud.networkservices.v1.NetworkServices + * @instance + * @param {google.cloud.networkservices.v1.IUpdateTlsRouteRequest} request UpdateTlsRouteRequest message or plain object + * @param {google.cloud.networkservices.v1.NetworkServices.UpdateTlsRouteCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(NetworkServices.prototype.updateTlsRoute = function updateTlsRoute(request, callback) { + return this.rpcCall(updateTlsRoute, $root.google.cloud.networkservices.v1.UpdateTlsRouteRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "UpdateTlsRoute" }); + + /** + * Calls UpdateTlsRoute. + * @function updateTlsRoute + * @memberof google.cloud.networkservices.v1.NetworkServices + * @instance + * @param {google.cloud.networkservices.v1.IUpdateTlsRouteRequest} request UpdateTlsRouteRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.networkservices.v1.NetworkServices|deleteTlsRoute}. + * @memberof google.cloud.networkservices.v1.NetworkServices + * @typedef DeleteTlsRouteCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls DeleteTlsRoute. + * @function deleteTlsRoute + * @memberof google.cloud.networkservices.v1.NetworkServices + * @instance + * @param {google.cloud.networkservices.v1.IDeleteTlsRouteRequest} request DeleteTlsRouteRequest message or plain object + * @param {google.cloud.networkservices.v1.NetworkServices.DeleteTlsRouteCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(NetworkServices.prototype.deleteTlsRoute = function deleteTlsRoute(request, callback) { + return this.rpcCall(deleteTlsRoute, $root.google.cloud.networkservices.v1.DeleteTlsRouteRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "DeleteTlsRoute" }); + + /** + * Calls DeleteTlsRoute. + * @function deleteTlsRoute + * @memberof google.cloud.networkservices.v1.NetworkServices + * @instance + * @param {google.cloud.networkservices.v1.IDeleteTlsRouteRequest} request DeleteTlsRouteRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.networkservices.v1.NetworkServices|listServiceBindings}. + * @memberof google.cloud.networkservices.v1.NetworkServices + * @typedef ListServiceBindingsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.networkservices.v1.ListServiceBindingsResponse} [response] ListServiceBindingsResponse + */ + + /** + * Calls ListServiceBindings. + * @function listServiceBindings + * @memberof google.cloud.networkservices.v1.NetworkServices + * @instance + * @param {google.cloud.networkservices.v1.IListServiceBindingsRequest} request ListServiceBindingsRequest message or plain object + * @param {google.cloud.networkservices.v1.NetworkServices.ListServiceBindingsCallback} callback Node-style callback called with the error, if any, and ListServiceBindingsResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(NetworkServices.prototype.listServiceBindings = function listServiceBindings(request, callback) { + return this.rpcCall(listServiceBindings, $root.google.cloud.networkservices.v1.ListServiceBindingsRequest, $root.google.cloud.networkservices.v1.ListServiceBindingsResponse, request, callback); + }, "name", { value: "ListServiceBindings" }); + + /** + * Calls ListServiceBindings. + * @function listServiceBindings + * @memberof google.cloud.networkservices.v1.NetworkServices + * @instance + * @param {google.cloud.networkservices.v1.IListServiceBindingsRequest} request ListServiceBindingsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.networkservices.v1.NetworkServices|getServiceBinding}. + * @memberof google.cloud.networkservices.v1.NetworkServices + * @typedef GetServiceBindingCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.networkservices.v1.ServiceBinding} [response] ServiceBinding + */ + + /** + * Calls GetServiceBinding. + * @function getServiceBinding + * @memberof google.cloud.networkservices.v1.NetworkServices + * @instance + * @param {google.cloud.networkservices.v1.IGetServiceBindingRequest} request GetServiceBindingRequest message or plain object + * @param {google.cloud.networkservices.v1.NetworkServices.GetServiceBindingCallback} callback Node-style callback called with the error, if any, and ServiceBinding + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(NetworkServices.prototype.getServiceBinding = function getServiceBinding(request, callback) { + return this.rpcCall(getServiceBinding, $root.google.cloud.networkservices.v1.GetServiceBindingRequest, $root.google.cloud.networkservices.v1.ServiceBinding, request, callback); + }, "name", { value: "GetServiceBinding" }); + + /** + * Calls GetServiceBinding. + * @function getServiceBinding + * @memberof google.cloud.networkservices.v1.NetworkServices + * @instance + * @param {google.cloud.networkservices.v1.IGetServiceBindingRequest} request GetServiceBindingRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.networkservices.v1.NetworkServices|createServiceBinding}. + * @memberof google.cloud.networkservices.v1.NetworkServices + * @typedef CreateServiceBindingCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls CreateServiceBinding. + * @function createServiceBinding + * @memberof google.cloud.networkservices.v1.NetworkServices + * @instance + * @param {google.cloud.networkservices.v1.ICreateServiceBindingRequest} request CreateServiceBindingRequest message or plain object + * @param {google.cloud.networkservices.v1.NetworkServices.CreateServiceBindingCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(NetworkServices.prototype.createServiceBinding = function createServiceBinding(request, callback) { + return this.rpcCall(createServiceBinding, $root.google.cloud.networkservices.v1.CreateServiceBindingRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "CreateServiceBinding" }); + + /** + * Calls CreateServiceBinding. + * @function createServiceBinding + * @memberof google.cloud.networkservices.v1.NetworkServices + * @instance + * @param {google.cloud.networkservices.v1.ICreateServiceBindingRequest} request CreateServiceBindingRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.networkservices.v1.NetworkServices|deleteServiceBinding}. + * @memberof google.cloud.networkservices.v1.NetworkServices + * @typedef DeleteServiceBindingCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls DeleteServiceBinding. + * @function deleteServiceBinding + * @memberof google.cloud.networkservices.v1.NetworkServices + * @instance + * @param {google.cloud.networkservices.v1.IDeleteServiceBindingRequest} request DeleteServiceBindingRequest message or plain object + * @param {google.cloud.networkservices.v1.NetworkServices.DeleteServiceBindingCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(NetworkServices.prototype.deleteServiceBinding = function deleteServiceBinding(request, callback) { + return this.rpcCall(deleteServiceBinding, $root.google.cloud.networkservices.v1.DeleteServiceBindingRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "DeleteServiceBinding" }); + + /** + * Calls DeleteServiceBinding. + * @function deleteServiceBinding + * @memberof google.cloud.networkservices.v1.NetworkServices + * @instance + * @param {google.cloud.networkservices.v1.IDeleteServiceBindingRequest} request DeleteServiceBindingRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.networkservices.v1.NetworkServices|listMeshes}. + * @memberof google.cloud.networkservices.v1.NetworkServices + * @typedef ListMeshesCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.networkservices.v1.ListMeshesResponse} [response] ListMeshesResponse + */ + + /** + * Calls ListMeshes. + * @function listMeshes + * @memberof google.cloud.networkservices.v1.NetworkServices + * @instance + * @param {google.cloud.networkservices.v1.IListMeshesRequest} request ListMeshesRequest message or plain object + * @param {google.cloud.networkservices.v1.NetworkServices.ListMeshesCallback} callback Node-style callback called with the error, if any, and ListMeshesResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(NetworkServices.prototype.listMeshes = function listMeshes(request, callback) { + return this.rpcCall(listMeshes, $root.google.cloud.networkservices.v1.ListMeshesRequest, $root.google.cloud.networkservices.v1.ListMeshesResponse, request, callback); + }, "name", { value: "ListMeshes" }); + + /** + * Calls ListMeshes. + * @function listMeshes + * @memberof google.cloud.networkservices.v1.NetworkServices + * @instance + * @param {google.cloud.networkservices.v1.IListMeshesRequest} request ListMeshesRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.networkservices.v1.NetworkServices|getMesh}. + * @memberof google.cloud.networkservices.v1.NetworkServices + * @typedef GetMeshCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.networkservices.v1.Mesh} [response] Mesh + */ + + /** + * Calls GetMesh. + * @function getMesh + * @memberof google.cloud.networkservices.v1.NetworkServices + * @instance + * @param {google.cloud.networkservices.v1.IGetMeshRequest} request GetMeshRequest message or plain object + * @param {google.cloud.networkservices.v1.NetworkServices.GetMeshCallback} callback Node-style callback called with the error, if any, and Mesh + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(NetworkServices.prototype.getMesh = function getMesh(request, callback) { + return this.rpcCall(getMesh, $root.google.cloud.networkservices.v1.GetMeshRequest, $root.google.cloud.networkservices.v1.Mesh, request, callback); + }, "name", { value: "GetMesh" }); + + /** + * Calls GetMesh. + * @function getMesh + * @memberof google.cloud.networkservices.v1.NetworkServices + * @instance + * @param {google.cloud.networkservices.v1.IGetMeshRequest} request GetMeshRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.networkservices.v1.NetworkServices|createMesh}. + * @memberof google.cloud.networkservices.v1.NetworkServices + * @typedef CreateMeshCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls CreateMesh. + * @function createMesh + * @memberof google.cloud.networkservices.v1.NetworkServices + * @instance + * @param {google.cloud.networkservices.v1.ICreateMeshRequest} request CreateMeshRequest message or plain object + * @param {google.cloud.networkservices.v1.NetworkServices.CreateMeshCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(NetworkServices.prototype.createMesh = function createMesh(request, callback) { + return this.rpcCall(createMesh, $root.google.cloud.networkservices.v1.CreateMeshRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "CreateMesh" }); + + /** + * Calls CreateMesh. + * @function createMesh + * @memberof google.cloud.networkservices.v1.NetworkServices + * @instance + * @param {google.cloud.networkservices.v1.ICreateMeshRequest} request CreateMeshRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.networkservices.v1.NetworkServices|updateMesh}. + * @memberof google.cloud.networkservices.v1.NetworkServices + * @typedef UpdateMeshCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls UpdateMesh. + * @function updateMesh + * @memberof google.cloud.networkservices.v1.NetworkServices + * @instance + * @param {google.cloud.networkservices.v1.IUpdateMeshRequest} request UpdateMeshRequest message or plain object + * @param {google.cloud.networkservices.v1.NetworkServices.UpdateMeshCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(NetworkServices.prototype.updateMesh = function updateMesh(request, callback) { + return this.rpcCall(updateMesh, $root.google.cloud.networkservices.v1.UpdateMeshRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "UpdateMesh" }); + + /** + * Calls UpdateMesh. + * @function updateMesh + * @memberof google.cloud.networkservices.v1.NetworkServices + * @instance + * @param {google.cloud.networkservices.v1.IUpdateMeshRequest} request UpdateMeshRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.networkservices.v1.NetworkServices|deleteMesh}. + * @memberof google.cloud.networkservices.v1.NetworkServices + * @typedef DeleteMeshCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls DeleteMesh. + * @function deleteMesh + * @memberof google.cloud.networkservices.v1.NetworkServices + * @instance + * @param {google.cloud.networkservices.v1.IDeleteMeshRequest} request DeleteMeshRequest message or plain object + * @param {google.cloud.networkservices.v1.NetworkServices.DeleteMeshCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(NetworkServices.prototype.deleteMesh = function deleteMesh(request, callback) { + return this.rpcCall(deleteMesh, $root.google.cloud.networkservices.v1.DeleteMeshRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "DeleteMesh" }); + + /** + * Calls DeleteMesh. + * @function deleteMesh + * @memberof google.cloud.networkservices.v1.NetworkServices + * @instance + * @param {google.cloud.networkservices.v1.IDeleteMeshRequest} request DeleteMeshRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + return NetworkServices; + })(); + + v1.ServiceBinding = (function() { + + /** + * Properties of a ServiceBinding. + * @memberof google.cloud.networkservices.v1 + * @interface IServiceBinding + * @property {string|null} [name] ServiceBinding name + * @property {string|null} [description] ServiceBinding description + * @property {google.protobuf.ITimestamp|null} [createTime] ServiceBinding createTime + * @property {google.protobuf.ITimestamp|null} [updateTime] ServiceBinding updateTime + * @property {string|null} [service] ServiceBinding service + * @property {Object.|null} [labels] ServiceBinding labels + */ + + /** + * Constructs a new ServiceBinding. + * @memberof google.cloud.networkservices.v1 + * @classdesc Represents a ServiceBinding. + * @implements IServiceBinding + * @constructor + * @param {google.cloud.networkservices.v1.IServiceBinding=} [properties] Properties to set + */ + function ServiceBinding(properties) { + this.labels = {}; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ServiceBinding name. + * @member {string} name + * @memberof google.cloud.networkservices.v1.ServiceBinding + * @instance + */ + ServiceBinding.prototype.name = ""; + + /** + * ServiceBinding description. + * @member {string} description + * @memberof google.cloud.networkservices.v1.ServiceBinding + * @instance + */ + ServiceBinding.prototype.description = ""; + + /** + * ServiceBinding createTime. + * @member {google.protobuf.ITimestamp|null|undefined} createTime + * @memberof google.cloud.networkservices.v1.ServiceBinding + * @instance + */ + ServiceBinding.prototype.createTime = null; + + /** + * ServiceBinding updateTime. + * @member {google.protobuf.ITimestamp|null|undefined} updateTime + * @memberof google.cloud.networkservices.v1.ServiceBinding + * @instance + */ + ServiceBinding.prototype.updateTime = null; + + /** + * ServiceBinding service. + * @member {string} service + * @memberof google.cloud.networkservices.v1.ServiceBinding + * @instance + */ + ServiceBinding.prototype.service = ""; + + /** + * ServiceBinding labels. + * @member {Object.} labels + * @memberof google.cloud.networkservices.v1.ServiceBinding + * @instance + */ + ServiceBinding.prototype.labels = $util.emptyObject; + + /** + * Creates a new ServiceBinding instance using the specified properties. + * @function create + * @memberof google.cloud.networkservices.v1.ServiceBinding + * @static + * @param {google.cloud.networkservices.v1.IServiceBinding=} [properties] Properties to set + * @returns {google.cloud.networkservices.v1.ServiceBinding} ServiceBinding instance + */ + ServiceBinding.create = function create(properties) { + return new ServiceBinding(properties); + }; + + /** + * Encodes the specified ServiceBinding message. Does not implicitly {@link google.cloud.networkservices.v1.ServiceBinding.verify|verify} messages. + * @function encode + * @memberof google.cloud.networkservices.v1.ServiceBinding + * @static + * @param {google.cloud.networkservices.v1.IServiceBinding} message ServiceBinding message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ServiceBinding.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.description != null && Object.hasOwnProperty.call(message, "description")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.description); + if (message.createTime != null && Object.hasOwnProperty.call(message, "createTime")) + $root.google.protobuf.Timestamp.encode(message.createTime, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.updateTime != null && Object.hasOwnProperty.call(message, "updateTime")) + $root.google.protobuf.Timestamp.encode(message.updateTime, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.service != null && Object.hasOwnProperty.call(message, "service")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.service); + if (message.labels != null && Object.hasOwnProperty.call(message, "labels")) + for (var keys = Object.keys(message.labels), 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.labels[keys[i]]).ldelim(); + return writer; + }; + + /** + * Encodes the specified ServiceBinding message, length delimited. Does not implicitly {@link google.cloud.networkservices.v1.ServiceBinding.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.networkservices.v1.ServiceBinding + * @static + * @param {google.cloud.networkservices.v1.IServiceBinding} message ServiceBinding message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ServiceBinding.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ServiceBinding message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.networkservices.v1.ServiceBinding + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.networkservices.v1.ServiceBinding} ServiceBinding + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ServiceBinding.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.networkservices.v1.ServiceBinding(), key, value; + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.description = reader.string(); + break; + } + case 3: { + message.createTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 4: { + message.updateTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 5: { + message.service = reader.string(); + break; + } + case 7: { + if (message.labels === $util.emptyObject) + message.labels = {}; + 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.labels[key] = value; + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ServiceBinding message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.networkservices.v1.ServiceBinding + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.networkservices.v1.ServiceBinding} ServiceBinding + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ServiceBinding.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ServiceBinding message. + * @function verify + * @memberof google.cloud.networkservices.v1.ServiceBinding + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ServiceBinding.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.description != null && message.hasOwnProperty("description")) + if (!$util.isString(message.description)) + return "description: string expected"; + 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.service != null && message.hasOwnProperty("service")) + if (!$util.isString(message.service)) + return "service: string expected"; + if (message.labels != null && message.hasOwnProperty("labels")) { + if (!$util.isObject(message.labels)) + return "labels: object expected"; + var key = Object.keys(message.labels); + for (var i = 0; i < key.length; ++i) + if (!$util.isString(message.labels[key[i]])) + return "labels: string{k:string} expected"; + } + return null; + }; + + /** + * Creates a ServiceBinding message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.networkservices.v1.ServiceBinding + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.networkservices.v1.ServiceBinding} ServiceBinding + */ + ServiceBinding.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.networkservices.v1.ServiceBinding) + return object; + var message = new $root.google.cloud.networkservices.v1.ServiceBinding(); + if (object.name != null) + message.name = String(object.name); + if (object.description != null) + message.description = String(object.description); + if (object.createTime != null) { + if (typeof object.createTime !== "object") + throw TypeError(".google.cloud.networkservices.v1.ServiceBinding.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.networkservices.v1.ServiceBinding.updateTime: object expected"); + message.updateTime = $root.google.protobuf.Timestamp.fromObject(object.updateTime); + } + if (object.service != null) + message.service = String(object.service); + if (object.labels) { + if (typeof object.labels !== "object") + throw TypeError(".google.cloud.networkservices.v1.ServiceBinding.labels: object expected"); + message.labels = {}; + for (var keys = Object.keys(object.labels), i = 0; i < keys.length; ++i) + message.labels[keys[i]] = String(object.labels[keys[i]]); + } + return message; + }; + + /** + * Creates a plain object from a ServiceBinding message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.networkservices.v1.ServiceBinding + * @static + * @param {google.cloud.networkservices.v1.ServiceBinding} message ServiceBinding + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ServiceBinding.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.objects || options.defaults) + object.labels = {}; + if (options.defaults) { + object.name = ""; + object.description = ""; + object.createTime = null; + object.updateTime = null; + object.service = ""; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.description != null && message.hasOwnProperty("description")) + object.description = message.description; + 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.service != null && message.hasOwnProperty("service")) + object.service = message.service; + var keys2; + if (message.labels && (keys2 = Object.keys(message.labels)).length) { + object.labels = {}; + for (var j = 0; j < keys2.length; ++j) + object.labels[keys2[j]] = message.labels[keys2[j]]; + } + return object; + }; + + /** + * Converts this ServiceBinding to JSON. + * @function toJSON + * @memberof google.cloud.networkservices.v1.ServiceBinding + * @instance + * @returns {Object.} JSON object + */ + ServiceBinding.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ServiceBinding + * @function getTypeUrl + * @memberof google.cloud.networkservices.v1.ServiceBinding + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ServiceBinding.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.networkservices.v1.ServiceBinding"; + }; + + return ServiceBinding; + })(); + + v1.ListServiceBindingsRequest = (function() { + + /** + * Properties of a ListServiceBindingsRequest. + * @memberof google.cloud.networkservices.v1 + * @interface IListServiceBindingsRequest + * @property {string|null} [parent] ListServiceBindingsRequest parent + * @property {number|null} [pageSize] ListServiceBindingsRequest pageSize + * @property {string|null} [pageToken] ListServiceBindingsRequest pageToken + */ + + /** + * Constructs a new ListServiceBindingsRequest. + * @memberof google.cloud.networkservices.v1 + * @classdesc Represents a ListServiceBindingsRequest. + * @implements IListServiceBindingsRequest + * @constructor + * @param {google.cloud.networkservices.v1.IListServiceBindingsRequest=} [properties] Properties to set + */ + function ListServiceBindingsRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListServiceBindingsRequest parent. + * @member {string} parent + * @memberof google.cloud.networkservices.v1.ListServiceBindingsRequest + * @instance + */ + ListServiceBindingsRequest.prototype.parent = ""; + + /** + * ListServiceBindingsRequest pageSize. + * @member {number} pageSize + * @memberof google.cloud.networkservices.v1.ListServiceBindingsRequest + * @instance + */ + ListServiceBindingsRequest.prototype.pageSize = 0; + + /** + * ListServiceBindingsRequest pageToken. + * @member {string} pageToken + * @memberof google.cloud.networkservices.v1.ListServiceBindingsRequest + * @instance + */ + ListServiceBindingsRequest.prototype.pageToken = ""; + + /** + * Creates a new ListServiceBindingsRequest instance using the specified properties. + * @function create + * @memberof google.cloud.networkservices.v1.ListServiceBindingsRequest + * @static + * @param {google.cloud.networkservices.v1.IListServiceBindingsRequest=} [properties] Properties to set + * @returns {google.cloud.networkservices.v1.ListServiceBindingsRequest} ListServiceBindingsRequest instance + */ + ListServiceBindingsRequest.create = function create(properties) { + return new ListServiceBindingsRequest(properties); + }; + + /** + * Encodes the specified ListServiceBindingsRequest message. Does not implicitly {@link google.cloud.networkservices.v1.ListServiceBindingsRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.networkservices.v1.ListServiceBindingsRequest + * @static + * @param {google.cloud.networkservices.v1.IListServiceBindingsRequest} message ListServiceBindingsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListServiceBindingsRequest.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 ListServiceBindingsRequest message, length delimited. Does not implicitly {@link google.cloud.networkservices.v1.ListServiceBindingsRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.networkservices.v1.ListServiceBindingsRequest + * @static + * @param {google.cloud.networkservices.v1.IListServiceBindingsRequest} message ListServiceBindingsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListServiceBindingsRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListServiceBindingsRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.networkservices.v1.ListServiceBindingsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.networkservices.v1.ListServiceBindingsRequest} ListServiceBindingsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListServiceBindingsRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.networkservices.v1.ListServiceBindingsRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + 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 ListServiceBindingsRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.networkservices.v1.ListServiceBindingsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.networkservices.v1.ListServiceBindingsRequest} ListServiceBindingsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListServiceBindingsRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListServiceBindingsRequest message. + * @function verify + * @memberof google.cloud.networkservices.v1.ListServiceBindingsRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListServiceBindingsRequest.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 ListServiceBindingsRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.networkservices.v1.ListServiceBindingsRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.networkservices.v1.ListServiceBindingsRequest} ListServiceBindingsRequest + */ + ListServiceBindingsRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.networkservices.v1.ListServiceBindingsRequest) + return object; + var message = new $root.google.cloud.networkservices.v1.ListServiceBindingsRequest(); + 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 ListServiceBindingsRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.networkservices.v1.ListServiceBindingsRequest + * @static + * @param {google.cloud.networkservices.v1.ListServiceBindingsRequest} message ListServiceBindingsRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListServiceBindingsRequest.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 ListServiceBindingsRequest to JSON. + * @function toJSON + * @memberof google.cloud.networkservices.v1.ListServiceBindingsRequest + * @instance + * @returns {Object.} JSON object + */ + ListServiceBindingsRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListServiceBindingsRequest + * @function getTypeUrl + * @memberof google.cloud.networkservices.v1.ListServiceBindingsRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListServiceBindingsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.networkservices.v1.ListServiceBindingsRequest"; + }; + + return ListServiceBindingsRequest; + })(); + + v1.ListServiceBindingsResponse = (function() { + + /** + * Properties of a ListServiceBindingsResponse. + * @memberof google.cloud.networkservices.v1 + * @interface IListServiceBindingsResponse + * @property {Array.|null} [serviceBindings] ListServiceBindingsResponse serviceBindings + * @property {string|null} [nextPageToken] ListServiceBindingsResponse nextPageToken + */ + + /** + * Constructs a new ListServiceBindingsResponse. + * @memberof google.cloud.networkservices.v1 + * @classdesc Represents a ListServiceBindingsResponse. + * @implements IListServiceBindingsResponse + * @constructor + * @param {google.cloud.networkservices.v1.IListServiceBindingsResponse=} [properties] Properties to set + */ + function ListServiceBindingsResponse(properties) { + this.serviceBindings = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListServiceBindingsResponse serviceBindings. + * @member {Array.} serviceBindings + * @memberof google.cloud.networkservices.v1.ListServiceBindingsResponse + * @instance + */ + ListServiceBindingsResponse.prototype.serviceBindings = $util.emptyArray; + + /** + * ListServiceBindingsResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.cloud.networkservices.v1.ListServiceBindingsResponse + * @instance + */ + ListServiceBindingsResponse.prototype.nextPageToken = ""; + + /** + * Creates a new ListServiceBindingsResponse instance using the specified properties. + * @function create + * @memberof google.cloud.networkservices.v1.ListServiceBindingsResponse + * @static + * @param {google.cloud.networkservices.v1.IListServiceBindingsResponse=} [properties] Properties to set + * @returns {google.cloud.networkservices.v1.ListServiceBindingsResponse} ListServiceBindingsResponse instance + */ + ListServiceBindingsResponse.create = function create(properties) { + return new ListServiceBindingsResponse(properties); + }; + + /** + * Encodes the specified ListServiceBindingsResponse message. Does not implicitly {@link google.cloud.networkservices.v1.ListServiceBindingsResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.networkservices.v1.ListServiceBindingsResponse + * @static + * @param {google.cloud.networkservices.v1.IListServiceBindingsResponse} message ListServiceBindingsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListServiceBindingsResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.serviceBindings != null && message.serviceBindings.length) + for (var i = 0; i < message.serviceBindings.length; ++i) + $root.google.cloud.networkservices.v1.ServiceBinding.encode(message.serviceBindings[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 ListServiceBindingsResponse message, length delimited. Does not implicitly {@link google.cloud.networkservices.v1.ListServiceBindingsResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.networkservices.v1.ListServiceBindingsResponse + * @static + * @param {google.cloud.networkservices.v1.IListServiceBindingsResponse} message ListServiceBindingsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListServiceBindingsResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListServiceBindingsResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.networkservices.v1.ListServiceBindingsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.networkservices.v1.ListServiceBindingsResponse} ListServiceBindingsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListServiceBindingsResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.networkservices.v1.ListServiceBindingsResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.serviceBindings && message.serviceBindings.length)) + message.serviceBindings = []; + message.serviceBindings.push($root.google.cloud.networkservices.v1.ServiceBinding.decode(reader, reader.uint32())); + break; + } + case 2: { + message.nextPageToken = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListServiceBindingsResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.networkservices.v1.ListServiceBindingsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.networkservices.v1.ListServiceBindingsResponse} ListServiceBindingsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListServiceBindingsResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListServiceBindingsResponse message. + * @function verify + * @memberof google.cloud.networkservices.v1.ListServiceBindingsResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListServiceBindingsResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.serviceBindings != null && message.hasOwnProperty("serviceBindings")) { + if (!Array.isArray(message.serviceBindings)) + return "serviceBindings: array expected"; + for (var i = 0; i < message.serviceBindings.length; ++i) { + var error = $root.google.cloud.networkservices.v1.ServiceBinding.verify(message.serviceBindings[i]); + if (error) + return "serviceBindings." + error; + } + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + return null; + }; + + /** + * Creates a ListServiceBindingsResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.networkservices.v1.ListServiceBindingsResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.networkservices.v1.ListServiceBindingsResponse} ListServiceBindingsResponse + */ + ListServiceBindingsResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.networkservices.v1.ListServiceBindingsResponse) + return object; + var message = new $root.google.cloud.networkservices.v1.ListServiceBindingsResponse(); + if (object.serviceBindings) { + if (!Array.isArray(object.serviceBindings)) + throw TypeError(".google.cloud.networkservices.v1.ListServiceBindingsResponse.serviceBindings: array expected"); + message.serviceBindings = []; + for (var i = 0; i < object.serviceBindings.length; ++i) { + if (typeof object.serviceBindings[i] !== "object") + throw TypeError(".google.cloud.networkservices.v1.ListServiceBindingsResponse.serviceBindings: object expected"); + message.serviceBindings[i] = $root.google.cloud.networkservices.v1.ServiceBinding.fromObject(object.serviceBindings[i]); + } + } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + return message; + }; + + /** + * Creates a plain object from a ListServiceBindingsResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.networkservices.v1.ListServiceBindingsResponse + * @static + * @param {google.cloud.networkservices.v1.ListServiceBindingsResponse} message ListServiceBindingsResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListServiceBindingsResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.serviceBindings = []; + if (options.defaults) + object.nextPageToken = ""; + if (message.serviceBindings && message.serviceBindings.length) { + object.serviceBindings = []; + for (var j = 0; j < message.serviceBindings.length; ++j) + object.serviceBindings[j] = $root.google.cloud.networkservices.v1.ServiceBinding.toObject(message.serviceBindings[j], options); + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + object.nextPageToken = message.nextPageToken; + return object; + }; + + /** + * Converts this ListServiceBindingsResponse to JSON. + * @function toJSON + * @memberof google.cloud.networkservices.v1.ListServiceBindingsResponse + * @instance + * @returns {Object.} JSON object + */ + ListServiceBindingsResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListServiceBindingsResponse + * @function getTypeUrl + * @memberof google.cloud.networkservices.v1.ListServiceBindingsResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListServiceBindingsResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.networkservices.v1.ListServiceBindingsResponse"; + }; + + return ListServiceBindingsResponse; + })(); + + v1.GetServiceBindingRequest = (function() { + + /** + * Properties of a GetServiceBindingRequest. + * @memberof google.cloud.networkservices.v1 + * @interface IGetServiceBindingRequest + * @property {string|null} [name] GetServiceBindingRequest name + */ + + /** + * Constructs a new GetServiceBindingRequest. + * @memberof google.cloud.networkservices.v1 + * @classdesc Represents a GetServiceBindingRequest. + * @implements IGetServiceBindingRequest + * @constructor + * @param {google.cloud.networkservices.v1.IGetServiceBindingRequest=} [properties] Properties to set + */ + function GetServiceBindingRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetServiceBindingRequest name. + * @member {string} name + * @memberof google.cloud.networkservices.v1.GetServiceBindingRequest + * @instance + */ + GetServiceBindingRequest.prototype.name = ""; + + /** + * Creates a new GetServiceBindingRequest instance using the specified properties. + * @function create + * @memberof google.cloud.networkservices.v1.GetServiceBindingRequest + * @static + * @param {google.cloud.networkservices.v1.IGetServiceBindingRequest=} [properties] Properties to set + * @returns {google.cloud.networkservices.v1.GetServiceBindingRequest} GetServiceBindingRequest instance + */ + GetServiceBindingRequest.create = function create(properties) { + return new GetServiceBindingRequest(properties); + }; + + /** + * Encodes the specified GetServiceBindingRequest message. Does not implicitly {@link google.cloud.networkservices.v1.GetServiceBindingRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.networkservices.v1.GetServiceBindingRequest + * @static + * @param {google.cloud.networkservices.v1.IGetServiceBindingRequest} message GetServiceBindingRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetServiceBindingRequest.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 GetServiceBindingRequest message, length delimited. Does not implicitly {@link google.cloud.networkservices.v1.GetServiceBindingRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.networkservices.v1.GetServiceBindingRequest + * @static + * @param {google.cloud.networkservices.v1.IGetServiceBindingRequest} message GetServiceBindingRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetServiceBindingRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetServiceBindingRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.networkservices.v1.GetServiceBindingRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.networkservices.v1.GetServiceBindingRequest} GetServiceBindingRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetServiceBindingRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.networkservices.v1.GetServiceBindingRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetServiceBindingRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.networkservices.v1.GetServiceBindingRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.networkservices.v1.GetServiceBindingRequest} GetServiceBindingRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetServiceBindingRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetServiceBindingRequest message. + * @function verify + * @memberof google.cloud.networkservices.v1.GetServiceBindingRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetServiceBindingRequest.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 GetServiceBindingRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.networkservices.v1.GetServiceBindingRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.networkservices.v1.GetServiceBindingRequest} GetServiceBindingRequest + */ + GetServiceBindingRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.networkservices.v1.GetServiceBindingRequest) + return object; + var message = new $root.google.cloud.networkservices.v1.GetServiceBindingRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a GetServiceBindingRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.networkservices.v1.GetServiceBindingRequest + * @static + * @param {google.cloud.networkservices.v1.GetServiceBindingRequest} message GetServiceBindingRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetServiceBindingRequest.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 GetServiceBindingRequest to JSON. + * @function toJSON + * @memberof google.cloud.networkservices.v1.GetServiceBindingRequest + * @instance + * @returns {Object.} JSON object + */ + GetServiceBindingRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GetServiceBindingRequest + * @function getTypeUrl + * @memberof google.cloud.networkservices.v1.GetServiceBindingRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GetServiceBindingRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.networkservices.v1.GetServiceBindingRequest"; + }; + + return GetServiceBindingRequest; + })(); + + v1.CreateServiceBindingRequest = (function() { + + /** + * Properties of a CreateServiceBindingRequest. + * @memberof google.cloud.networkservices.v1 + * @interface ICreateServiceBindingRequest + * @property {string|null} [parent] CreateServiceBindingRequest parent + * @property {string|null} [serviceBindingId] CreateServiceBindingRequest serviceBindingId + * @property {google.cloud.networkservices.v1.IServiceBinding|null} [serviceBinding] CreateServiceBindingRequest serviceBinding + */ + + /** + * Constructs a new CreateServiceBindingRequest. + * @memberof google.cloud.networkservices.v1 + * @classdesc Represents a CreateServiceBindingRequest. + * @implements ICreateServiceBindingRequest + * @constructor + * @param {google.cloud.networkservices.v1.ICreateServiceBindingRequest=} [properties] Properties to set + */ + function CreateServiceBindingRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * CreateServiceBindingRequest parent. + * @member {string} parent + * @memberof google.cloud.networkservices.v1.CreateServiceBindingRequest + * @instance + */ + CreateServiceBindingRequest.prototype.parent = ""; + + /** + * CreateServiceBindingRequest serviceBindingId. + * @member {string} serviceBindingId + * @memberof google.cloud.networkservices.v1.CreateServiceBindingRequest + * @instance + */ + CreateServiceBindingRequest.prototype.serviceBindingId = ""; + + /** + * CreateServiceBindingRequest serviceBinding. + * @member {google.cloud.networkservices.v1.IServiceBinding|null|undefined} serviceBinding + * @memberof google.cloud.networkservices.v1.CreateServiceBindingRequest + * @instance + */ + CreateServiceBindingRequest.prototype.serviceBinding = null; + + /** + * Creates a new CreateServiceBindingRequest instance using the specified properties. + * @function create + * @memberof google.cloud.networkservices.v1.CreateServiceBindingRequest + * @static + * @param {google.cloud.networkservices.v1.ICreateServiceBindingRequest=} [properties] Properties to set + * @returns {google.cloud.networkservices.v1.CreateServiceBindingRequest} CreateServiceBindingRequest instance + */ + CreateServiceBindingRequest.create = function create(properties) { + return new CreateServiceBindingRequest(properties); + }; + + /** + * Encodes the specified CreateServiceBindingRequest message. Does not implicitly {@link google.cloud.networkservices.v1.CreateServiceBindingRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.networkservices.v1.CreateServiceBindingRequest + * @static + * @param {google.cloud.networkservices.v1.ICreateServiceBindingRequest} message CreateServiceBindingRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateServiceBindingRequest.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.serviceBindingId != null && Object.hasOwnProperty.call(message, "serviceBindingId")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.serviceBindingId); + if (message.serviceBinding != null && Object.hasOwnProperty.call(message, "serviceBinding")) + $root.google.cloud.networkservices.v1.ServiceBinding.encode(message.serviceBinding, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified CreateServiceBindingRequest message, length delimited. Does not implicitly {@link google.cloud.networkservices.v1.CreateServiceBindingRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.networkservices.v1.CreateServiceBindingRequest + * @static + * @param {google.cloud.networkservices.v1.ICreateServiceBindingRequest} message CreateServiceBindingRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateServiceBindingRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CreateServiceBindingRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.networkservices.v1.CreateServiceBindingRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.networkservices.v1.CreateServiceBindingRequest} CreateServiceBindingRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateServiceBindingRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.networkservices.v1.CreateServiceBindingRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.serviceBindingId = reader.string(); + break; + } + case 3: { + message.serviceBinding = $root.google.cloud.networkservices.v1.ServiceBinding.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CreateServiceBindingRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.networkservices.v1.CreateServiceBindingRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.networkservices.v1.CreateServiceBindingRequest} CreateServiceBindingRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateServiceBindingRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CreateServiceBindingRequest message. + * @function verify + * @memberof google.cloud.networkservices.v1.CreateServiceBindingRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CreateServiceBindingRequest.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.serviceBindingId != null && message.hasOwnProperty("serviceBindingId")) + if (!$util.isString(message.serviceBindingId)) + return "serviceBindingId: string expected"; + if (message.serviceBinding != null && message.hasOwnProperty("serviceBinding")) { + var error = $root.google.cloud.networkservices.v1.ServiceBinding.verify(message.serviceBinding); + if (error) + return "serviceBinding." + error; + } + return null; + }; + + /** + * Creates a CreateServiceBindingRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.networkservices.v1.CreateServiceBindingRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.networkservices.v1.CreateServiceBindingRequest} CreateServiceBindingRequest + */ + CreateServiceBindingRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.networkservices.v1.CreateServiceBindingRequest) + return object; + var message = new $root.google.cloud.networkservices.v1.CreateServiceBindingRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.serviceBindingId != null) + message.serviceBindingId = String(object.serviceBindingId); + if (object.serviceBinding != null) { + if (typeof object.serviceBinding !== "object") + throw TypeError(".google.cloud.networkservices.v1.CreateServiceBindingRequest.serviceBinding: object expected"); + message.serviceBinding = $root.google.cloud.networkservices.v1.ServiceBinding.fromObject(object.serviceBinding); + } + return message; + }; + + /** + * Creates a plain object from a CreateServiceBindingRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.networkservices.v1.CreateServiceBindingRequest + * @static + * @param {google.cloud.networkservices.v1.CreateServiceBindingRequest} message CreateServiceBindingRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CreateServiceBindingRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.serviceBindingId = ""; + object.serviceBinding = null; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.serviceBindingId != null && message.hasOwnProperty("serviceBindingId")) + object.serviceBindingId = message.serviceBindingId; + if (message.serviceBinding != null && message.hasOwnProperty("serviceBinding")) + object.serviceBinding = $root.google.cloud.networkservices.v1.ServiceBinding.toObject(message.serviceBinding, options); + return object; + }; + + /** + * Converts this CreateServiceBindingRequest to JSON. + * @function toJSON + * @memberof google.cloud.networkservices.v1.CreateServiceBindingRequest + * @instance + * @returns {Object.} JSON object + */ + CreateServiceBindingRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CreateServiceBindingRequest + * @function getTypeUrl + * @memberof google.cloud.networkservices.v1.CreateServiceBindingRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CreateServiceBindingRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.networkservices.v1.CreateServiceBindingRequest"; + }; + + return CreateServiceBindingRequest; + })(); + + v1.DeleteServiceBindingRequest = (function() { + + /** + * Properties of a DeleteServiceBindingRequest. + * @memberof google.cloud.networkservices.v1 + * @interface IDeleteServiceBindingRequest + * @property {string|null} [name] DeleteServiceBindingRequest name + */ + + /** + * Constructs a new DeleteServiceBindingRequest. + * @memberof google.cloud.networkservices.v1 + * @classdesc Represents a DeleteServiceBindingRequest. + * @implements IDeleteServiceBindingRequest + * @constructor + * @param {google.cloud.networkservices.v1.IDeleteServiceBindingRequest=} [properties] Properties to set + */ + function DeleteServiceBindingRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * DeleteServiceBindingRequest name. + * @member {string} name + * @memberof google.cloud.networkservices.v1.DeleteServiceBindingRequest + * @instance + */ + DeleteServiceBindingRequest.prototype.name = ""; + + /** + * Creates a new DeleteServiceBindingRequest instance using the specified properties. + * @function create + * @memberof google.cloud.networkservices.v1.DeleteServiceBindingRequest + * @static + * @param {google.cloud.networkservices.v1.IDeleteServiceBindingRequest=} [properties] Properties to set + * @returns {google.cloud.networkservices.v1.DeleteServiceBindingRequest} DeleteServiceBindingRequest instance + */ + DeleteServiceBindingRequest.create = function create(properties) { + return new DeleteServiceBindingRequest(properties); + }; + + /** + * Encodes the specified DeleteServiceBindingRequest message. Does not implicitly {@link google.cloud.networkservices.v1.DeleteServiceBindingRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.networkservices.v1.DeleteServiceBindingRequest + * @static + * @param {google.cloud.networkservices.v1.IDeleteServiceBindingRequest} message DeleteServiceBindingRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteServiceBindingRequest.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 DeleteServiceBindingRequest message, length delimited. Does not implicitly {@link google.cloud.networkservices.v1.DeleteServiceBindingRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.networkservices.v1.DeleteServiceBindingRequest + * @static + * @param {google.cloud.networkservices.v1.IDeleteServiceBindingRequest} message DeleteServiceBindingRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteServiceBindingRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DeleteServiceBindingRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.networkservices.v1.DeleteServiceBindingRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.networkservices.v1.DeleteServiceBindingRequest} DeleteServiceBindingRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteServiceBindingRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.networkservices.v1.DeleteServiceBindingRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DeleteServiceBindingRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.networkservices.v1.DeleteServiceBindingRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.networkservices.v1.DeleteServiceBindingRequest} DeleteServiceBindingRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteServiceBindingRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DeleteServiceBindingRequest message. + * @function verify + * @memberof google.cloud.networkservices.v1.DeleteServiceBindingRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DeleteServiceBindingRequest.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 DeleteServiceBindingRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.networkservices.v1.DeleteServiceBindingRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.networkservices.v1.DeleteServiceBindingRequest} DeleteServiceBindingRequest + */ + DeleteServiceBindingRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.networkservices.v1.DeleteServiceBindingRequest) + return object; + var message = new $root.google.cloud.networkservices.v1.DeleteServiceBindingRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a DeleteServiceBindingRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.networkservices.v1.DeleteServiceBindingRequest + * @static + * @param {google.cloud.networkservices.v1.DeleteServiceBindingRequest} message DeleteServiceBindingRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DeleteServiceBindingRequest.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 DeleteServiceBindingRequest to JSON. + * @function toJSON + * @memberof google.cloud.networkservices.v1.DeleteServiceBindingRequest + * @instance + * @returns {Object.} JSON object + */ + DeleteServiceBindingRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DeleteServiceBindingRequest + * @function getTypeUrl + * @memberof google.cloud.networkservices.v1.DeleteServiceBindingRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DeleteServiceBindingRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.networkservices.v1.DeleteServiceBindingRequest"; + }; + + return DeleteServiceBindingRequest; + })(); + + v1.TcpRoute = (function() { + + /** + * Properties of a TcpRoute. + * @memberof google.cloud.networkservices.v1 + * @interface ITcpRoute + * @property {string|null} [name] TcpRoute name + * @property {string|null} [selfLink] TcpRoute selfLink + * @property {google.protobuf.ITimestamp|null} [createTime] TcpRoute createTime + * @property {google.protobuf.ITimestamp|null} [updateTime] TcpRoute updateTime + * @property {string|null} [description] TcpRoute description + * @property {Array.|null} [rules] TcpRoute rules + * @property {Array.|null} [meshes] TcpRoute meshes + * @property {Array.|null} [gateways] TcpRoute gateways + * @property {Object.|null} [labels] TcpRoute labels + */ + + /** + * Constructs a new TcpRoute. + * @memberof google.cloud.networkservices.v1 + * @classdesc Represents a TcpRoute. + * @implements ITcpRoute + * @constructor + * @param {google.cloud.networkservices.v1.ITcpRoute=} [properties] Properties to set + */ + function TcpRoute(properties) { + this.rules = []; + this.meshes = []; + this.gateways = []; + this.labels = {}; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * TcpRoute name. + * @member {string} name + * @memberof google.cloud.networkservices.v1.TcpRoute + * @instance + */ + TcpRoute.prototype.name = ""; + + /** + * TcpRoute selfLink. + * @member {string} selfLink + * @memberof google.cloud.networkservices.v1.TcpRoute + * @instance + */ + TcpRoute.prototype.selfLink = ""; + + /** + * TcpRoute createTime. + * @member {google.protobuf.ITimestamp|null|undefined} createTime + * @memberof google.cloud.networkservices.v1.TcpRoute + * @instance + */ + TcpRoute.prototype.createTime = null; + + /** + * TcpRoute updateTime. + * @member {google.protobuf.ITimestamp|null|undefined} updateTime + * @memberof google.cloud.networkservices.v1.TcpRoute + * @instance + */ + TcpRoute.prototype.updateTime = null; + + /** + * TcpRoute description. + * @member {string} description + * @memberof google.cloud.networkservices.v1.TcpRoute + * @instance + */ + TcpRoute.prototype.description = ""; + + /** + * TcpRoute rules. + * @member {Array.} rules + * @memberof google.cloud.networkservices.v1.TcpRoute + * @instance + */ + TcpRoute.prototype.rules = $util.emptyArray; + + /** + * TcpRoute meshes. + * @member {Array.} meshes + * @memberof google.cloud.networkservices.v1.TcpRoute + * @instance + */ + TcpRoute.prototype.meshes = $util.emptyArray; + + /** + * TcpRoute gateways. + * @member {Array.} gateways + * @memberof google.cloud.networkservices.v1.TcpRoute + * @instance + */ + TcpRoute.prototype.gateways = $util.emptyArray; + + /** + * TcpRoute labels. + * @member {Object.} labels + * @memberof google.cloud.networkservices.v1.TcpRoute + * @instance + */ + TcpRoute.prototype.labels = $util.emptyObject; + + /** + * Creates a new TcpRoute instance using the specified properties. + * @function create + * @memberof google.cloud.networkservices.v1.TcpRoute + * @static + * @param {google.cloud.networkservices.v1.ITcpRoute=} [properties] Properties to set + * @returns {google.cloud.networkservices.v1.TcpRoute} TcpRoute instance + */ + TcpRoute.create = function create(properties) { + return new TcpRoute(properties); + }; + + /** + * Encodes the specified TcpRoute message. Does not implicitly {@link google.cloud.networkservices.v1.TcpRoute.verify|verify} messages. + * @function encode + * @memberof google.cloud.networkservices.v1.TcpRoute + * @static + * @param {google.cloud.networkservices.v1.ITcpRoute} message TcpRoute message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TcpRoute.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.createTime != null && Object.hasOwnProperty.call(message, "createTime")) + $root.google.protobuf.Timestamp.encode(message.createTime, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + 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(); + if (message.description != null && Object.hasOwnProperty.call(message, "description")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.description); + if (message.rules != null && message.rules.length) + for (var i = 0; i < message.rules.length; ++i) + $root.google.cloud.networkservices.v1.TcpRoute.RouteRule.encode(message.rules[i], writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.meshes != null && message.meshes.length) + for (var i = 0; i < message.meshes.length; ++i) + writer.uint32(/* id 8, wireType 2 =*/66).string(message.meshes[i]); + if (message.gateways != null && message.gateways.length) + for (var i = 0; i < message.gateways.length; ++i) + writer.uint32(/* id 9, wireType 2 =*/74).string(message.gateways[i]); + if (message.labels != null && Object.hasOwnProperty.call(message, "labels")) + for (var keys = Object.keys(message.labels), 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.labels[keys[i]]).ldelim(); + if (message.selfLink != null && Object.hasOwnProperty.call(message, "selfLink")) + writer.uint32(/* id 11, wireType 2 =*/90).string(message.selfLink); + return writer; + }; + + /** + * Encodes the specified TcpRoute message, length delimited. Does not implicitly {@link google.cloud.networkservices.v1.TcpRoute.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.networkservices.v1.TcpRoute + * @static + * @param {google.cloud.networkservices.v1.ITcpRoute} message TcpRoute message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TcpRoute.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a TcpRoute message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.networkservices.v1.TcpRoute + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.networkservices.v1.TcpRoute} TcpRoute + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TcpRoute.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.networkservices.v1.TcpRoute(), key, value; + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 11: { + message.selfLink = reader.string(); + break; + } + case 2: { + message.createTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 3: { + message.updateTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 4: { + message.description = reader.string(); + break; + } + case 5: { + if (!(message.rules && message.rules.length)) + message.rules = []; + message.rules.push($root.google.cloud.networkservices.v1.TcpRoute.RouteRule.decode(reader, reader.uint32())); + break; + } + case 8: { + if (!(message.meshes && message.meshes.length)) + message.meshes = []; + message.meshes.push(reader.string()); + break; + } + case 9: { + if (!(message.gateways && message.gateways.length)) + message.gateways = []; + message.gateways.push(reader.string()); + break; + } + case 10: { + if (message.labels === $util.emptyObject) + message.labels = {}; + 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.labels[key] = value; + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a TcpRoute message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.networkservices.v1.TcpRoute + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.networkservices.v1.TcpRoute} TcpRoute + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TcpRoute.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a TcpRoute message. + * @function verify + * @memberof google.cloud.networkservices.v1.TcpRoute + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + TcpRoute.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.selfLink != null && message.hasOwnProperty("selfLink")) + if (!$util.isString(message.selfLink)) + return "selfLink: string expected"; + 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.description != null && message.hasOwnProperty("description")) + if (!$util.isString(message.description)) + return "description: string 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.cloud.networkservices.v1.TcpRoute.RouteRule.verify(message.rules[i]); + if (error) + return "rules." + error; + } + } + if (message.meshes != null && message.hasOwnProperty("meshes")) { + if (!Array.isArray(message.meshes)) + return "meshes: array expected"; + for (var i = 0; i < message.meshes.length; ++i) + if (!$util.isString(message.meshes[i])) + return "meshes: string[] expected"; + } + if (message.gateways != null && message.hasOwnProperty("gateways")) { + if (!Array.isArray(message.gateways)) + return "gateways: array expected"; + for (var i = 0; i < message.gateways.length; ++i) + if (!$util.isString(message.gateways[i])) + return "gateways: string[] expected"; + } + if (message.labels != null && message.hasOwnProperty("labels")) { + if (!$util.isObject(message.labels)) + return "labels: object expected"; + var key = Object.keys(message.labels); + for (var i = 0; i < key.length; ++i) + if (!$util.isString(message.labels[key[i]])) + return "labels: string{k:string} expected"; + } + return null; + }; + + /** + * Creates a TcpRoute message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.networkservices.v1.TcpRoute + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.networkservices.v1.TcpRoute} TcpRoute + */ + TcpRoute.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.networkservices.v1.TcpRoute) + return object; + var message = new $root.google.cloud.networkservices.v1.TcpRoute(); + if (object.name != null) + message.name = String(object.name); + if (object.selfLink != null) + message.selfLink = String(object.selfLink); + if (object.createTime != null) { + if (typeof object.createTime !== "object") + throw TypeError(".google.cloud.networkservices.v1.TcpRoute.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.networkservices.v1.TcpRoute.updateTime: object expected"); + message.updateTime = $root.google.protobuf.Timestamp.fromObject(object.updateTime); + } + if (object.description != null) + message.description = String(object.description); + if (object.rules) { + if (!Array.isArray(object.rules)) + throw TypeError(".google.cloud.networkservices.v1.TcpRoute.rules: array expected"); + message.rules = []; + for (var i = 0; i < object.rules.length; ++i) { + if (typeof object.rules[i] !== "object") + throw TypeError(".google.cloud.networkservices.v1.TcpRoute.rules: object expected"); + message.rules[i] = $root.google.cloud.networkservices.v1.TcpRoute.RouteRule.fromObject(object.rules[i]); + } + } + if (object.meshes) { + if (!Array.isArray(object.meshes)) + throw TypeError(".google.cloud.networkservices.v1.TcpRoute.meshes: array expected"); + message.meshes = []; + for (var i = 0; i < object.meshes.length; ++i) + message.meshes[i] = String(object.meshes[i]); + } + if (object.gateways) { + if (!Array.isArray(object.gateways)) + throw TypeError(".google.cloud.networkservices.v1.TcpRoute.gateways: array expected"); + message.gateways = []; + for (var i = 0; i < object.gateways.length; ++i) + message.gateways[i] = String(object.gateways[i]); + } + if (object.labels) { + if (typeof object.labels !== "object") + throw TypeError(".google.cloud.networkservices.v1.TcpRoute.labels: object expected"); + message.labels = {}; + for (var keys = Object.keys(object.labels), i = 0; i < keys.length; ++i) + message.labels[keys[i]] = String(object.labels[keys[i]]); + } + return message; + }; + + /** + * Creates a plain object from a TcpRoute message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.networkservices.v1.TcpRoute + * @static + * @param {google.cloud.networkservices.v1.TcpRoute} message TcpRoute + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + TcpRoute.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.rules = []; + object.meshes = []; + object.gateways = []; + } + if (options.objects || options.defaults) + object.labels = {}; + if (options.defaults) { + object.name = ""; + object.createTime = null; + object.updateTime = null; + object.description = ""; + object.selfLink = ""; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + 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.description != null && message.hasOwnProperty("description")) + object.description = message.description; + if (message.rules && message.rules.length) { + object.rules = []; + for (var j = 0; j < message.rules.length; ++j) + object.rules[j] = $root.google.cloud.networkservices.v1.TcpRoute.RouteRule.toObject(message.rules[j], options); + } + if (message.meshes && message.meshes.length) { + object.meshes = []; + for (var j = 0; j < message.meshes.length; ++j) + object.meshes[j] = message.meshes[j]; + } + if (message.gateways && message.gateways.length) { + object.gateways = []; + for (var j = 0; j < message.gateways.length; ++j) + object.gateways[j] = message.gateways[j]; + } + var keys2; + if (message.labels && (keys2 = Object.keys(message.labels)).length) { + object.labels = {}; + for (var j = 0; j < keys2.length; ++j) + object.labels[keys2[j]] = message.labels[keys2[j]]; + } + if (message.selfLink != null && message.hasOwnProperty("selfLink")) + object.selfLink = message.selfLink; + return object; + }; + + /** + * Converts this TcpRoute to JSON. + * @function toJSON + * @memberof google.cloud.networkservices.v1.TcpRoute + * @instance + * @returns {Object.} JSON object + */ + TcpRoute.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for TcpRoute + * @function getTypeUrl + * @memberof google.cloud.networkservices.v1.TcpRoute + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TcpRoute.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.networkservices.v1.TcpRoute"; + }; + + TcpRoute.RouteRule = (function() { + + /** + * Properties of a RouteRule. + * @memberof google.cloud.networkservices.v1.TcpRoute + * @interface IRouteRule + * @property {Array.|null} [matches] RouteRule matches + * @property {google.cloud.networkservices.v1.TcpRoute.IRouteAction|null} [action] RouteRule action + */ + + /** + * Constructs a new RouteRule. + * @memberof google.cloud.networkservices.v1.TcpRoute + * @classdesc Represents a RouteRule. + * @implements IRouteRule + * @constructor + * @param {google.cloud.networkservices.v1.TcpRoute.IRouteRule=} [properties] Properties to set + */ + function RouteRule(properties) { + this.matches = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * RouteRule matches. + * @member {Array.} matches + * @memberof google.cloud.networkservices.v1.TcpRoute.RouteRule + * @instance + */ + RouteRule.prototype.matches = $util.emptyArray; + + /** + * RouteRule action. + * @member {google.cloud.networkservices.v1.TcpRoute.IRouteAction|null|undefined} action + * @memberof google.cloud.networkservices.v1.TcpRoute.RouteRule + * @instance + */ + RouteRule.prototype.action = null; + + /** + * Creates a new RouteRule instance using the specified properties. + * @function create + * @memberof google.cloud.networkservices.v1.TcpRoute.RouteRule + * @static + * @param {google.cloud.networkservices.v1.TcpRoute.IRouteRule=} [properties] Properties to set + * @returns {google.cloud.networkservices.v1.TcpRoute.RouteRule} RouteRule instance + */ + RouteRule.create = function create(properties) { + return new RouteRule(properties); + }; + + /** + * Encodes the specified RouteRule message. Does not implicitly {@link google.cloud.networkservices.v1.TcpRoute.RouteRule.verify|verify} messages. + * @function encode + * @memberof google.cloud.networkservices.v1.TcpRoute.RouteRule + * @static + * @param {google.cloud.networkservices.v1.TcpRoute.IRouteRule} message RouteRule message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RouteRule.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.matches != null && message.matches.length) + for (var i = 0; i < message.matches.length; ++i) + $root.google.cloud.networkservices.v1.TcpRoute.RouteMatch.encode(message.matches[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.action != null && Object.hasOwnProperty.call(message, "action")) + $root.google.cloud.networkservices.v1.TcpRoute.RouteAction.encode(message.action, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified RouteRule message, length delimited. Does not implicitly {@link google.cloud.networkservices.v1.TcpRoute.RouteRule.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.networkservices.v1.TcpRoute.RouteRule + * @static + * @param {google.cloud.networkservices.v1.TcpRoute.IRouteRule} message RouteRule message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RouteRule.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a RouteRule message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.networkservices.v1.TcpRoute.RouteRule + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.networkservices.v1.TcpRoute.RouteRule} RouteRule + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RouteRule.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.networkservices.v1.TcpRoute.RouteRule(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.matches && message.matches.length)) + message.matches = []; + message.matches.push($root.google.cloud.networkservices.v1.TcpRoute.RouteMatch.decode(reader, reader.uint32())); + break; + } + case 2: { + message.action = $root.google.cloud.networkservices.v1.TcpRoute.RouteAction.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a RouteRule message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.networkservices.v1.TcpRoute.RouteRule + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.networkservices.v1.TcpRoute.RouteRule} RouteRule + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RouteRule.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a RouteRule message. + * @function verify + * @memberof google.cloud.networkservices.v1.TcpRoute.RouteRule + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + RouteRule.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.matches != null && message.hasOwnProperty("matches")) { + if (!Array.isArray(message.matches)) + return "matches: array expected"; + for (var i = 0; i < message.matches.length; ++i) { + var error = $root.google.cloud.networkservices.v1.TcpRoute.RouteMatch.verify(message.matches[i]); + if (error) + return "matches." + error; + } + } + if (message.action != null && message.hasOwnProperty("action")) { + var error = $root.google.cloud.networkservices.v1.TcpRoute.RouteAction.verify(message.action); + if (error) + return "action." + error; + } + return null; + }; + + /** + * Creates a RouteRule message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.networkservices.v1.TcpRoute.RouteRule + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.networkservices.v1.TcpRoute.RouteRule} RouteRule + */ + RouteRule.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.networkservices.v1.TcpRoute.RouteRule) + return object; + var message = new $root.google.cloud.networkservices.v1.TcpRoute.RouteRule(); + if (object.matches) { + if (!Array.isArray(object.matches)) + throw TypeError(".google.cloud.networkservices.v1.TcpRoute.RouteRule.matches: array expected"); + message.matches = []; + for (var i = 0; i < object.matches.length; ++i) { + if (typeof object.matches[i] !== "object") + throw TypeError(".google.cloud.networkservices.v1.TcpRoute.RouteRule.matches: object expected"); + message.matches[i] = $root.google.cloud.networkservices.v1.TcpRoute.RouteMatch.fromObject(object.matches[i]); + } + } + if (object.action != null) { + if (typeof object.action !== "object") + throw TypeError(".google.cloud.networkservices.v1.TcpRoute.RouteRule.action: object expected"); + message.action = $root.google.cloud.networkservices.v1.TcpRoute.RouteAction.fromObject(object.action); + } + return message; + }; + + /** + * Creates a plain object from a RouteRule message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.networkservices.v1.TcpRoute.RouteRule + * @static + * @param {google.cloud.networkservices.v1.TcpRoute.RouteRule} message RouteRule + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + RouteRule.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.matches = []; + if (options.defaults) + object.action = null; + if (message.matches && message.matches.length) { + object.matches = []; + for (var j = 0; j < message.matches.length; ++j) + object.matches[j] = $root.google.cloud.networkservices.v1.TcpRoute.RouteMatch.toObject(message.matches[j], options); + } + if (message.action != null && message.hasOwnProperty("action")) + object.action = $root.google.cloud.networkservices.v1.TcpRoute.RouteAction.toObject(message.action, options); + return object; + }; + + /** + * Converts this RouteRule to JSON. + * @function toJSON + * @memberof google.cloud.networkservices.v1.TcpRoute.RouteRule + * @instance + * @returns {Object.} JSON object + */ + RouteRule.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for RouteRule + * @function getTypeUrl + * @memberof google.cloud.networkservices.v1.TcpRoute.RouteRule + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + RouteRule.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.networkservices.v1.TcpRoute.RouteRule"; + }; + + return RouteRule; + })(); + + TcpRoute.RouteMatch = (function() { + + /** + * Properties of a RouteMatch. + * @memberof google.cloud.networkservices.v1.TcpRoute + * @interface IRouteMatch + * @property {string|null} [address] RouteMatch address + * @property {string|null} [port] RouteMatch port + */ + + /** + * Constructs a new RouteMatch. + * @memberof google.cloud.networkservices.v1.TcpRoute + * @classdesc Represents a RouteMatch. + * @implements IRouteMatch + * @constructor + * @param {google.cloud.networkservices.v1.TcpRoute.IRouteMatch=} [properties] Properties to set + */ + function RouteMatch(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * RouteMatch address. + * @member {string} address + * @memberof google.cloud.networkservices.v1.TcpRoute.RouteMatch + * @instance + */ + RouteMatch.prototype.address = ""; + + /** + * RouteMatch port. + * @member {string} port + * @memberof google.cloud.networkservices.v1.TcpRoute.RouteMatch + * @instance + */ + RouteMatch.prototype.port = ""; + + /** + * Creates a new RouteMatch instance using the specified properties. + * @function create + * @memberof google.cloud.networkservices.v1.TcpRoute.RouteMatch + * @static + * @param {google.cloud.networkservices.v1.TcpRoute.IRouteMatch=} [properties] Properties to set + * @returns {google.cloud.networkservices.v1.TcpRoute.RouteMatch} RouteMatch instance + */ + RouteMatch.create = function create(properties) { + return new RouteMatch(properties); + }; + + /** + * Encodes the specified RouteMatch message. Does not implicitly {@link google.cloud.networkservices.v1.TcpRoute.RouteMatch.verify|verify} messages. + * @function encode + * @memberof google.cloud.networkservices.v1.TcpRoute.RouteMatch + * @static + * @param {google.cloud.networkservices.v1.TcpRoute.IRouteMatch} message RouteMatch message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RouteMatch.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.address != null && Object.hasOwnProperty.call(message, "address")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.address); + if (message.port != null && Object.hasOwnProperty.call(message, "port")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.port); + return writer; + }; + + /** + * Encodes the specified RouteMatch message, length delimited. Does not implicitly {@link google.cloud.networkservices.v1.TcpRoute.RouteMatch.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.networkservices.v1.TcpRoute.RouteMatch + * @static + * @param {google.cloud.networkservices.v1.TcpRoute.IRouteMatch} message RouteMatch message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RouteMatch.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a RouteMatch message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.networkservices.v1.TcpRoute.RouteMatch + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.networkservices.v1.TcpRoute.RouteMatch} RouteMatch + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RouteMatch.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.networkservices.v1.TcpRoute.RouteMatch(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.address = reader.string(); + break; + } + case 2: { + message.port = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a RouteMatch message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.networkservices.v1.TcpRoute.RouteMatch + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.networkservices.v1.TcpRoute.RouteMatch} RouteMatch + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RouteMatch.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a RouteMatch message. + * @function verify + * @memberof google.cloud.networkservices.v1.TcpRoute.RouteMatch + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + RouteMatch.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.address != null && message.hasOwnProperty("address")) + if (!$util.isString(message.address)) + return "address: string expected"; + if (message.port != null && message.hasOwnProperty("port")) + if (!$util.isString(message.port)) + return "port: string expected"; + return null; + }; + + /** + * Creates a RouteMatch message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.networkservices.v1.TcpRoute.RouteMatch + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.networkservices.v1.TcpRoute.RouteMatch} RouteMatch + */ + RouteMatch.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.networkservices.v1.TcpRoute.RouteMatch) + return object; + var message = new $root.google.cloud.networkservices.v1.TcpRoute.RouteMatch(); + if (object.address != null) + message.address = String(object.address); + if (object.port != null) + message.port = String(object.port); + return message; + }; + + /** + * Creates a plain object from a RouteMatch message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.networkservices.v1.TcpRoute.RouteMatch + * @static + * @param {google.cloud.networkservices.v1.TcpRoute.RouteMatch} message RouteMatch + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + RouteMatch.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.address = ""; + object.port = ""; + } + if (message.address != null && message.hasOwnProperty("address")) + object.address = message.address; + if (message.port != null && message.hasOwnProperty("port")) + object.port = message.port; + return object; + }; + + /** + * Converts this RouteMatch to JSON. + * @function toJSON + * @memberof google.cloud.networkservices.v1.TcpRoute.RouteMatch + * @instance + * @returns {Object.} JSON object + */ + RouteMatch.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for RouteMatch + * @function getTypeUrl + * @memberof google.cloud.networkservices.v1.TcpRoute.RouteMatch + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + RouteMatch.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.networkservices.v1.TcpRoute.RouteMatch"; + }; + + return RouteMatch; + })(); + + TcpRoute.RouteAction = (function() { + + /** + * Properties of a RouteAction. + * @memberof google.cloud.networkservices.v1.TcpRoute + * @interface IRouteAction + * @property {Array.|null} [destinations] RouteAction destinations + * @property {boolean|null} [originalDestination] RouteAction originalDestination + */ + + /** + * Constructs a new RouteAction. + * @memberof google.cloud.networkservices.v1.TcpRoute + * @classdesc Represents a RouteAction. + * @implements IRouteAction + * @constructor + * @param {google.cloud.networkservices.v1.TcpRoute.IRouteAction=} [properties] Properties to set + */ + function RouteAction(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]]; + } + + /** + * RouteAction destinations. + * @member {Array.} destinations + * @memberof google.cloud.networkservices.v1.TcpRoute.RouteAction + * @instance + */ + RouteAction.prototype.destinations = $util.emptyArray; + + /** + * RouteAction originalDestination. + * @member {boolean} originalDestination + * @memberof google.cloud.networkservices.v1.TcpRoute.RouteAction + * @instance + */ + RouteAction.prototype.originalDestination = false; + + /** + * Creates a new RouteAction instance using the specified properties. + * @function create + * @memberof google.cloud.networkservices.v1.TcpRoute.RouteAction + * @static + * @param {google.cloud.networkservices.v1.TcpRoute.IRouteAction=} [properties] Properties to set + * @returns {google.cloud.networkservices.v1.TcpRoute.RouteAction} RouteAction instance + */ + RouteAction.create = function create(properties) { + return new RouteAction(properties); + }; + + /** + * Encodes the specified RouteAction message. Does not implicitly {@link google.cloud.networkservices.v1.TcpRoute.RouteAction.verify|verify} messages. + * @function encode + * @memberof google.cloud.networkservices.v1.TcpRoute.RouteAction + * @static + * @param {google.cloud.networkservices.v1.TcpRoute.IRouteAction} message RouteAction message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RouteAction.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.destinations != null && message.destinations.length) + for (var i = 0; i < message.destinations.length; ++i) + $root.google.cloud.networkservices.v1.TcpRoute.RouteDestination.encode(message.destinations[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.originalDestination != null && Object.hasOwnProperty.call(message, "originalDestination")) + writer.uint32(/* id 3, wireType 0 =*/24).bool(message.originalDestination); + return writer; + }; + + /** + * Encodes the specified RouteAction message, length delimited. Does not implicitly {@link google.cloud.networkservices.v1.TcpRoute.RouteAction.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.networkservices.v1.TcpRoute.RouteAction + * @static + * @param {google.cloud.networkservices.v1.TcpRoute.IRouteAction} message RouteAction message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RouteAction.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a RouteAction message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.networkservices.v1.TcpRoute.RouteAction + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.networkservices.v1.TcpRoute.RouteAction} RouteAction + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RouteAction.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.networkservices.v1.TcpRoute.RouteAction(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.destinations && message.destinations.length)) + message.destinations = []; + message.destinations.push($root.google.cloud.networkservices.v1.TcpRoute.RouteDestination.decode(reader, reader.uint32())); + break; + } + case 3: { + message.originalDestination = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a RouteAction message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.networkservices.v1.TcpRoute.RouteAction + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.networkservices.v1.TcpRoute.RouteAction} RouteAction + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RouteAction.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a RouteAction message. + * @function verify + * @memberof google.cloud.networkservices.v1.TcpRoute.RouteAction + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + RouteAction.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object 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) { + var error = $root.google.cloud.networkservices.v1.TcpRoute.RouteDestination.verify(message.destinations[i]); + if (error) + return "destinations." + error; + } + } + if (message.originalDestination != null && message.hasOwnProperty("originalDestination")) + if (typeof message.originalDestination !== "boolean") + return "originalDestination: boolean expected"; + return null; + }; + + /** + * Creates a RouteAction message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.networkservices.v1.TcpRoute.RouteAction + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.networkservices.v1.TcpRoute.RouteAction} RouteAction + */ + RouteAction.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.networkservices.v1.TcpRoute.RouteAction) + return object; + var message = new $root.google.cloud.networkservices.v1.TcpRoute.RouteAction(); + if (object.destinations) { + if (!Array.isArray(object.destinations)) + throw TypeError(".google.cloud.networkservices.v1.TcpRoute.RouteAction.destinations: array expected"); + message.destinations = []; + for (var i = 0; i < object.destinations.length; ++i) { + if (typeof object.destinations[i] !== "object") + throw TypeError(".google.cloud.networkservices.v1.TcpRoute.RouteAction.destinations: object expected"); + message.destinations[i] = $root.google.cloud.networkservices.v1.TcpRoute.RouteDestination.fromObject(object.destinations[i]); + } + } + if (object.originalDestination != null) + message.originalDestination = Boolean(object.originalDestination); + return message; + }; + + /** + * Creates a plain object from a RouteAction message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.networkservices.v1.TcpRoute.RouteAction + * @static + * @param {google.cloud.networkservices.v1.TcpRoute.RouteAction} message RouteAction + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + RouteAction.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.destinations = []; + if (options.defaults) + object.originalDestination = false; + if (message.destinations && message.destinations.length) { + object.destinations = []; + for (var j = 0; j < message.destinations.length; ++j) + object.destinations[j] = $root.google.cloud.networkservices.v1.TcpRoute.RouteDestination.toObject(message.destinations[j], options); + } + if (message.originalDestination != null && message.hasOwnProperty("originalDestination")) + object.originalDestination = message.originalDestination; + return object; + }; + + /** + * Converts this RouteAction to JSON. + * @function toJSON + * @memberof google.cloud.networkservices.v1.TcpRoute.RouteAction + * @instance + * @returns {Object.} JSON object + */ + RouteAction.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for RouteAction + * @function getTypeUrl + * @memberof google.cloud.networkservices.v1.TcpRoute.RouteAction + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + RouteAction.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.networkservices.v1.TcpRoute.RouteAction"; + }; + + return RouteAction; + })(); + + TcpRoute.RouteDestination = (function() { + + /** + * Properties of a RouteDestination. + * @memberof google.cloud.networkservices.v1.TcpRoute + * @interface IRouteDestination + * @property {string|null} [serviceName] RouteDestination serviceName + * @property {number|null} [weight] RouteDestination weight + */ + + /** + * Constructs a new RouteDestination. + * @memberof google.cloud.networkservices.v1.TcpRoute + * @classdesc Represents a RouteDestination. + * @implements IRouteDestination + * @constructor + * @param {google.cloud.networkservices.v1.TcpRoute.IRouteDestination=} [properties] Properties to set + */ + function RouteDestination(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * RouteDestination serviceName. + * @member {string} serviceName + * @memberof google.cloud.networkservices.v1.TcpRoute.RouteDestination + * @instance + */ + RouteDestination.prototype.serviceName = ""; + + /** + * RouteDestination weight. + * @member {number} weight + * @memberof google.cloud.networkservices.v1.TcpRoute.RouteDestination + * @instance + */ + RouteDestination.prototype.weight = 0; + + /** + * Creates a new RouteDestination instance using the specified properties. + * @function create + * @memberof google.cloud.networkservices.v1.TcpRoute.RouteDestination + * @static + * @param {google.cloud.networkservices.v1.TcpRoute.IRouteDestination=} [properties] Properties to set + * @returns {google.cloud.networkservices.v1.TcpRoute.RouteDestination} RouteDestination instance + */ + RouteDestination.create = function create(properties) { + return new RouteDestination(properties); + }; + + /** + * Encodes the specified RouteDestination message. Does not implicitly {@link google.cloud.networkservices.v1.TcpRoute.RouteDestination.verify|verify} messages. + * @function encode + * @memberof google.cloud.networkservices.v1.TcpRoute.RouteDestination + * @static + * @param {google.cloud.networkservices.v1.TcpRoute.IRouteDestination} message RouteDestination message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RouteDestination.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.serviceName != null && Object.hasOwnProperty.call(message, "serviceName")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.serviceName); + if (message.weight != null && Object.hasOwnProperty.call(message, "weight")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.weight); + return writer; + }; + + /** + * Encodes the specified RouteDestination message, length delimited. Does not implicitly {@link google.cloud.networkservices.v1.TcpRoute.RouteDestination.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.networkservices.v1.TcpRoute.RouteDestination + * @static + * @param {google.cloud.networkservices.v1.TcpRoute.IRouteDestination} message RouteDestination message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RouteDestination.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a RouteDestination message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.networkservices.v1.TcpRoute.RouteDestination + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.networkservices.v1.TcpRoute.RouteDestination} RouteDestination + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RouteDestination.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.networkservices.v1.TcpRoute.RouteDestination(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.serviceName = reader.string(); + break; + } + case 2: { + message.weight = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a RouteDestination message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.networkservices.v1.TcpRoute.RouteDestination + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.networkservices.v1.TcpRoute.RouteDestination} RouteDestination + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RouteDestination.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a RouteDestination message. + * @function verify + * @memberof google.cloud.networkservices.v1.TcpRoute.RouteDestination + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + RouteDestination.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.serviceName != null && message.hasOwnProperty("serviceName")) + if (!$util.isString(message.serviceName)) + return "serviceName: string expected"; + if (message.weight != null && message.hasOwnProperty("weight")) + if (!$util.isInteger(message.weight)) + return "weight: integer expected"; + return null; + }; + + /** + * Creates a RouteDestination message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.networkservices.v1.TcpRoute.RouteDestination + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.networkservices.v1.TcpRoute.RouteDestination} RouteDestination + */ + RouteDestination.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.networkservices.v1.TcpRoute.RouteDestination) + return object; + var message = new $root.google.cloud.networkservices.v1.TcpRoute.RouteDestination(); + if (object.serviceName != null) + message.serviceName = String(object.serviceName); + if (object.weight != null) + message.weight = object.weight | 0; + return message; + }; + + /** + * Creates a plain object from a RouteDestination message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.networkservices.v1.TcpRoute.RouteDestination + * @static + * @param {google.cloud.networkservices.v1.TcpRoute.RouteDestination} message RouteDestination + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + RouteDestination.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.serviceName = ""; + object.weight = 0; + } + if (message.serviceName != null && message.hasOwnProperty("serviceName")) + object.serviceName = message.serviceName; + if (message.weight != null && message.hasOwnProperty("weight")) + object.weight = message.weight; + return object; + }; + + /** + * Converts this RouteDestination to JSON. + * @function toJSON + * @memberof google.cloud.networkservices.v1.TcpRoute.RouteDestination + * @instance + * @returns {Object.} JSON object + */ + RouteDestination.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for RouteDestination + * @function getTypeUrl + * @memberof google.cloud.networkservices.v1.TcpRoute.RouteDestination + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + RouteDestination.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.networkservices.v1.TcpRoute.RouteDestination"; + }; + + return RouteDestination; + })(); + + return TcpRoute; + })(); + + v1.ListTcpRoutesRequest = (function() { + + /** + * Properties of a ListTcpRoutesRequest. + * @memberof google.cloud.networkservices.v1 + * @interface IListTcpRoutesRequest + * @property {string|null} [parent] ListTcpRoutesRequest parent + * @property {number|null} [pageSize] ListTcpRoutesRequest pageSize + * @property {string|null} [pageToken] ListTcpRoutesRequest pageToken + */ + + /** + * Constructs a new ListTcpRoutesRequest. + * @memberof google.cloud.networkservices.v1 + * @classdesc Represents a ListTcpRoutesRequest. + * @implements IListTcpRoutesRequest + * @constructor + * @param {google.cloud.networkservices.v1.IListTcpRoutesRequest=} [properties] Properties to set + */ + function ListTcpRoutesRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListTcpRoutesRequest parent. + * @member {string} parent + * @memberof google.cloud.networkservices.v1.ListTcpRoutesRequest + * @instance + */ + ListTcpRoutesRequest.prototype.parent = ""; + + /** + * ListTcpRoutesRequest pageSize. + * @member {number} pageSize + * @memberof google.cloud.networkservices.v1.ListTcpRoutesRequest + * @instance + */ + ListTcpRoutesRequest.prototype.pageSize = 0; + + /** + * ListTcpRoutesRequest pageToken. + * @member {string} pageToken + * @memberof google.cloud.networkservices.v1.ListTcpRoutesRequest + * @instance + */ + ListTcpRoutesRequest.prototype.pageToken = ""; + + /** + * Creates a new ListTcpRoutesRequest instance using the specified properties. + * @function create + * @memberof google.cloud.networkservices.v1.ListTcpRoutesRequest + * @static + * @param {google.cloud.networkservices.v1.IListTcpRoutesRequest=} [properties] Properties to set + * @returns {google.cloud.networkservices.v1.ListTcpRoutesRequest} ListTcpRoutesRequest instance + */ + ListTcpRoutesRequest.create = function create(properties) { + return new ListTcpRoutesRequest(properties); + }; + + /** + * Encodes the specified ListTcpRoutesRequest message. Does not implicitly {@link google.cloud.networkservices.v1.ListTcpRoutesRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.networkservices.v1.ListTcpRoutesRequest + * @static + * @param {google.cloud.networkservices.v1.IListTcpRoutesRequest} message ListTcpRoutesRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListTcpRoutesRequest.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 ListTcpRoutesRequest message, length delimited. Does not implicitly {@link google.cloud.networkservices.v1.ListTcpRoutesRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.networkservices.v1.ListTcpRoutesRequest + * @static + * @param {google.cloud.networkservices.v1.IListTcpRoutesRequest} message ListTcpRoutesRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListTcpRoutesRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListTcpRoutesRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.networkservices.v1.ListTcpRoutesRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.networkservices.v1.ListTcpRoutesRequest} ListTcpRoutesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListTcpRoutesRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.networkservices.v1.ListTcpRoutesRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + 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 ListTcpRoutesRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.networkservices.v1.ListTcpRoutesRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.networkservices.v1.ListTcpRoutesRequest} ListTcpRoutesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListTcpRoutesRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListTcpRoutesRequest message. + * @function verify + * @memberof google.cloud.networkservices.v1.ListTcpRoutesRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListTcpRoutesRequest.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 ListTcpRoutesRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.networkservices.v1.ListTcpRoutesRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.networkservices.v1.ListTcpRoutesRequest} ListTcpRoutesRequest + */ + ListTcpRoutesRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.networkservices.v1.ListTcpRoutesRequest) + return object; + var message = new $root.google.cloud.networkservices.v1.ListTcpRoutesRequest(); + 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 ListTcpRoutesRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.networkservices.v1.ListTcpRoutesRequest + * @static + * @param {google.cloud.networkservices.v1.ListTcpRoutesRequest} message ListTcpRoutesRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListTcpRoutesRequest.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 ListTcpRoutesRequest to JSON. + * @function toJSON + * @memberof google.cloud.networkservices.v1.ListTcpRoutesRequest + * @instance + * @returns {Object.} JSON object + */ + ListTcpRoutesRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListTcpRoutesRequest + * @function getTypeUrl + * @memberof google.cloud.networkservices.v1.ListTcpRoutesRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListTcpRoutesRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.networkservices.v1.ListTcpRoutesRequest"; + }; + + return ListTcpRoutesRequest; + })(); + + v1.ListTcpRoutesResponse = (function() { + + /** + * Properties of a ListTcpRoutesResponse. + * @memberof google.cloud.networkservices.v1 + * @interface IListTcpRoutesResponse + * @property {Array.|null} [tcpRoutes] ListTcpRoutesResponse tcpRoutes + * @property {string|null} [nextPageToken] ListTcpRoutesResponse nextPageToken + */ + + /** + * Constructs a new ListTcpRoutesResponse. + * @memberof google.cloud.networkservices.v1 + * @classdesc Represents a ListTcpRoutesResponse. + * @implements IListTcpRoutesResponse + * @constructor + * @param {google.cloud.networkservices.v1.IListTcpRoutesResponse=} [properties] Properties to set + */ + function ListTcpRoutesResponse(properties) { + this.tcpRoutes = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListTcpRoutesResponse tcpRoutes. + * @member {Array.} tcpRoutes + * @memberof google.cloud.networkservices.v1.ListTcpRoutesResponse + * @instance + */ + ListTcpRoutesResponse.prototype.tcpRoutes = $util.emptyArray; + + /** + * ListTcpRoutesResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.cloud.networkservices.v1.ListTcpRoutesResponse + * @instance + */ + ListTcpRoutesResponse.prototype.nextPageToken = ""; + + /** + * Creates a new ListTcpRoutesResponse instance using the specified properties. + * @function create + * @memberof google.cloud.networkservices.v1.ListTcpRoutesResponse + * @static + * @param {google.cloud.networkservices.v1.IListTcpRoutesResponse=} [properties] Properties to set + * @returns {google.cloud.networkservices.v1.ListTcpRoutesResponse} ListTcpRoutesResponse instance + */ + ListTcpRoutesResponse.create = function create(properties) { + return new ListTcpRoutesResponse(properties); + }; + + /** + * Encodes the specified ListTcpRoutesResponse message. Does not implicitly {@link google.cloud.networkservices.v1.ListTcpRoutesResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.networkservices.v1.ListTcpRoutesResponse + * @static + * @param {google.cloud.networkservices.v1.IListTcpRoutesResponse} message ListTcpRoutesResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListTcpRoutesResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.tcpRoutes != null && message.tcpRoutes.length) + for (var i = 0; i < message.tcpRoutes.length; ++i) + $root.google.cloud.networkservices.v1.TcpRoute.encode(message.tcpRoutes[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 ListTcpRoutesResponse message, length delimited. Does not implicitly {@link google.cloud.networkservices.v1.ListTcpRoutesResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.networkservices.v1.ListTcpRoutesResponse + * @static + * @param {google.cloud.networkservices.v1.IListTcpRoutesResponse} message ListTcpRoutesResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListTcpRoutesResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListTcpRoutesResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.networkservices.v1.ListTcpRoutesResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.networkservices.v1.ListTcpRoutesResponse} ListTcpRoutesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListTcpRoutesResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.networkservices.v1.ListTcpRoutesResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.tcpRoutes && message.tcpRoutes.length)) + message.tcpRoutes = []; + message.tcpRoutes.push($root.google.cloud.networkservices.v1.TcpRoute.decode(reader, reader.uint32())); + break; + } + case 2: { + message.nextPageToken = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListTcpRoutesResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.networkservices.v1.ListTcpRoutesResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.networkservices.v1.ListTcpRoutesResponse} ListTcpRoutesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListTcpRoutesResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListTcpRoutesResponse message. + * @function verify + * @memberof google.cloud.networkservices.v1.ListTcpRoutesResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListTcpRoutesResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.tcpRoutes != null && message.hasOwnProperty("tcpRoutes")) { + if (!Array.isArray(message.tcpRoutes)) + return "tcpRoutes: array expected"; + for (var i = 0; i < message.tcpRoutes.length; ++i) { + var error = $root.google.cloud.networkservices.v1.TcpRoute.verify(message.tcpRoutes[i]); + if (error) + return "tcpRoutes." + error; + } + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + return null; + }; + + /** + * Creates a ListTcpRoutesResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.networkservices.v1.ListTcpRoutesResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.networkservices.v1.ListTcpRoutesResponse} ListTcpRoutesResponse + */ + ListTcpRoutesResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.networkservices.v1.ListTcpRoutesResponse) + return object; + var message = new $root.google.cloud.networkservices.v1.ListTcpRoutesResponse(); + if (object.tcpRoutes) { + if (!Array.isArray(object.tcpRoutes)) + throw TypeError(".google.cloud.networkservices.v1.ListTcpRoutesResponse.tcpRoutes: array expected"); + message.tcpRoutes = []; + for (var i = 0; i < object.tcpRoutes.length; ++i) { + if (typeof object.tcpRoutes[i] !== "object") + throw TypeError(".google.cloud.networkservices.v1.ListTcpRoutesResponse.tcpRoutes: object expected"); + message.tcpRoutes[i] = $root.google.cloud.networkservices.v1.TcpRoute.fromObject(object.tcpRoutes[i]); + } + } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + return message; + }; + + /** + * Creates a plain object from a ListTcpRoutesResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.networkservices.v1.ListTcpRoutesResponse + * @static + * @param {google.cloud.networkservices.v1.ListTcpRoutesResponse} message ListTcpRoutesResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListTcpRoutesResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.tcpRoutes = []; + if (options.defaults) + object.nextPageToken = ""; + if (message.tcpRoutes && message.tcpRoutes.length) { + object.tcpRoutes = []; + for (var j = 0; j < message.tcpRoutes.length; ++j) + object.tcpRoutes[j] = $root.google.cloud.networkservices.v1.TcpRoute.toObject(message.tcpRoutes[j], options); + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + object.nextPageToken = message.nextPageToken; + return object; + }; + + /** + * Converts this ListTcpRoutesResponse to JSON. + * @function toJSON + * @memberof google.cloud.networkservices.v1.ListTcpRoutesResponse + * @instance + * @returns {Object.} JSON object + */ + ListTcpRoutesResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListTcpRoutesResponse + * @function getTypeUrl + * @memberof google.cloud.networkservices.v1.ListTcpRoutesResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListTcpRoutesResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.networkservices.v1.ListTcpRoutesResponse"; + }; + + return ListTcpRoutesResponse; + })(); + + v1.GetTcpRouteRequest = (function() { + + /** + * Properties of a GetTcpRouteRequest. + * @memberof google.cloud.networkservices.v1 + * @interface IGetTcpRouteRequest + * @property {string|null} [name] GetTcpRouteRequest name + */ + + /** + * Constructs a new GetTcpRouteRequest. + * @memberof google.cloud.networkservices.v1 + * @classdesc Represents a GetTcpRouteRequest. + * @implements IGetTcpRouteRequest + * @constructor + * @param {google.cloud.networkservices.v1.IGetTcpRouteRequest=} [properties] Properties to set + */ + function GetTcpRouteRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetTcpRouteRequest name. + * @member {string} name + * @memberof google.cloud.networkservices.v1.GetTcpRouteRequest + * @instance + */ + GetTcpRouteRequest.prototype.name = ""; + + /** + * Creates a new GetTcpRouteRequest instance using the specified properties. + * @function create + * @memberof google.cloud.networkservices.v1.GetTcpRouteRequest + * @static + * @param {google.cloud.networkservices.v1.IGetTcpRouteRequest=} [properties] Properties to set + * @returns {google.cloud.networkservices.v1.GetTcpRouteRequest} GetTcpRouteRequest instance + */ + GetTcpRouteRequest.create = function create(properties) { + return new GetTcpRouteRequest(properties); + }; + + /** + * Encodes the specified GetTcpRouteRequest message. Does not implicitly {@link google.cloud.networkservices.v1.GetTcpRouteRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.networkservices.v1.GetTcpRouteRequest + * @static + * @param {google.cloud.networkservices.v1.IGetTcpRouteRequest} message GetTcpRouteRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetTcpRouteRequest.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 GetTcpRouteRequest message, length delimited. Does not implicitly {@link google.cloud.networkservices.v1.GetTcpRouteRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.networkservices.v1.GetTcpRouteRequest + * @static + * @param {google.cloud.networkservices.v1.IGetTcpRouteRequest} message GetTcpRouteRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetTcpRouteRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetTcpRouteRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.networkservices.v1.GetTcpRouteRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.networkservices.v1.GetTcpRouteRequest} GetTcpRouteRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetTcpRouteRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.networkservices.v1.GetTcpRouteRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetTcpRouteRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.networkservices.v1.GetTcpRouteRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.networkservices.v1.GetTcpRouteRequest} GetTcpRouteRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetTcpRouteRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetTcpRouteRequest message. + * @function verify + * @memberof google.cloud.networkservices.v1.GetTcpRouteRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetTcpRouteRequest.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 GetTcpRouteRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.networkservices.v1.GetTcpRouteRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.networkservices.v1.GetTcpRouteRequest} GetTcpRouteRequest + */ + GetTcpRouteRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.networkservices.v1.GetTcpRouteRequest) + return object; + var message = new $root.google.cloud.networkservices.v1.GetTcpRouteRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a GetTcpRouteRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.networkservices.v1.GetTcpRouteRequest + * @static + * @param {google.cloud.networkservices.v1.GetTcpRouteRequest} message GetTcpRouteRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetTcpRouteRequest.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 GetTcpRouteRequest to JSON. + * @function toJSON + * @memberof google.cloud.networkservices.v1.GetTcpRouteRequest + * @instance + * @returns {Object.} JSON object + */ + GetTcpRouteRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GetTcpRouteRequest + * @function getTypeUrl + * @memberof google.cloud.networkservices.v1.GetTcpRouteRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GetTcpRouteRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.networkservices.v1.GetTcpRouteRequest"; + }; + + return GetTcpRouteRequest; + })(); + + v1.CreateTcpRouteRequest = (function() { + + /** + * Properties of a CreateTcpRouteRequest. + * @memberof google.cloud.networkservices.v1 + * @interface ICreateTcpRouteRequest + * @property {string|null} [parent] CreateTcpRouteRequest parent + * @property {string|null} [tcpRouteId] CreateTcpRouteRequest tcpRouteId + * @property {google.cloud.networkservices.v1.ITcpRoute|null} [tcpRoute] CreateTcpRouteRequest tcpRoute + */ + + /** + * Constructs a new CreateTcpRouteRequest. + * @memberof google.cloud.networkservices.v1 + * @classdesc Represents a CreateTcpRouteRequest. + * @implements ICreateTcpRouteRequest + * @constructor + * @param {google.cloud.networkservices.v1.ICreateTcpRouteRequest=} [properties] Properties to set + */ + function CreateTcpRouteRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * CreateTcpRouteRequest parent. + * @member {string} parent + * @memberof google.cloud.networkservices.v1.CreateTcpRouteRequest + * @instance + */ + CreateTcpRouteRequest.prototype.parent = ""; + + /** + * CreateTcpRouteRequest tcpRouteId. + * @member {string} tcpRouteId + * @memberof google.cloud.networkservices.v1.CreateTcpRouteRequest + * @instance + */ + CreateTcpRouteRequest.prototype.tcpRouteId = ""; + + /** + * CreateTcpRouteRequest tcpRoute. + * @member {google.cloud.networkservices.v1.ITcpRoute|null|undefined} tcpRoute + * @memberof google.cloud.networkservices.v1.CreateTcpRouteRequest + * @instance + */ + CreateTcpRouteRequest.prototype.tcpRoute = null; + + /** + * Creates a new CreateTcpRouteRequest instance using the specified properties. + * @function create + * @memberof google.cloud.networkservices.v1.CreateTcpRouteRequest + * @static + * @param {google.cloud.networkservices.v1.ICreateTcpRouteRequest=} [properties] Properties to set + * @returns {google.cloud.networkservices.v1.CreateTcpRouteRequest} CreateTcpRouteRequest instance + */ + CreateTcpRouteRequest.create = function create(properties) { + return new CreateTcpRouteRequest(properties); + }; + + /** + * Encodes the specified CreateTcpRouteRequest message. Does not implicitly {@link google.cloud.networkservices.v1.CreateTcpRouteRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.networkservices.v1.CreateTcpRouteRequest + * @static + * @param {google.cloud.networkservices.v1.ICreateTcpRouteRequest} message CreateTcpRouteRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateTcpRouteRequest.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.tcpRouteId != null && Object.hasOwnProperty.call(message, "tcpRouteId")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.tcpRouteId); + if (message.tcpRoute != null && Object.hasOwnProperty.call(message, "tcpRoute")) + $root.google.cloud.networkservices.v1.TcpRoute.encode(message.tcpRoute, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified CreateTcpRouteRequest message, length delimited. Does not implicitly {@link google.cloud.networkservices.v1.CreateTcpRouteRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.networkservices.v1.CreateTcpRouteRequest + * @static + * @param {google.cloud.networkservices.v1.ICreateTcpRouteRequest} message CreateTcpRouteRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateTcpRouteRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CreateTcpRouteRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.networkservices.v1.CreateTcpRouteRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.networkservices.v1.CreateTcpRouteRequest} CreateTcpRouteRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateTcpRouteRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.networkservices.v1.CreateTcpRouteRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.tcpRouteId = reader.string(); + break; + } + case 3: { + message.tcpRoute = $root.google.cloud.networkservices.v1.TcpRoute.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CreateTcpRouteRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.networkservices.v1.CreateTcpRouteRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.networkservices.v1.CreateTcpRouteRequest} CreateTcpRouteRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateTcpRouteRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CreateTcpRouteRequest message. + * @function verify + * @memberof google.cloud.networkservices.v1.CreateTcpRouteRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CreateTcpRouteRequest.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.tcpRouteId != null && message.hasOwnProperty("tcpRouteId")) + if (!$util.isString(message.tcpRouteId)) + return "tcpRouteId: string expected"; + if (message.tcpRoute != null && message.hasOwnProperty("tcpRoute")) { + var error = $root.google.cloud.networkservices.v1.TcpRoute.verify(message.tcpRoute); + if (error) + return "tcpRoute." + error; + } + return null; + }; + + /** + * Creates a CreateTcpRouteRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.networkservices.v1.CreateTcpRouteRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.networkservices.v1.CreateTcpRouteRequest} CreateTcpRouteRequest + */ + CreateTcpRouteRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.networkservices.v1.CreateTcpRouteRequest) + return object; + var message = new $root.google.cloud.networkservices.v1.CreateTcpRouteRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.tcpRouteId != null) + message.tcpRouteId = String(object.tcpRouteId); + if (object.tcpRoute != null) { + if (typeof object.tcpRoute !== "object") + throw TypeError(".google.cloud.networkservices.v1.CreateTcpRouteRequest.tcpRoute: object expected"); + message.tcpRoute = $root.google.cloud.networkservices.v1.TcpRoute.fromObject(object.tcpRoute); + } + return message; + }; + + /** + * Creates a plain object from a CreateTcpRouteRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.networkservices.v1.CreateTcpRouteRequest + * @static + * @param {google.cloud.networkservices.v1.CreateTcpRouteRequest} message CreateTcpRouteRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CreateTcpRouteRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.tcpRouteId = ""; + object.tcpRoute = null; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.tcpRouteId != null && message.hasOwnProperty("tcpRouteId")) + object.tcpRouteId = message.tcpRouteId; + if (message.tcpRoute != null && message.hasOwnProperty("tcpRoute")) + object.tcpRoute = $root.google.cloud.networkservices.v1.TcpRoute.toObject(message.tcpRoute, options); + return object; + }; + + /** + * Converts this CreateTcpRouteRequest to JSON. + * @function toJSON + * @memberof google.cloud.networkservices.v1.CreateTcpRouteRequest + * @instance + * @returns {Object.} JSON object + */ + CreateTcpRouteRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CreateTcpRouteRequest + * @function getTypeUrl + * @memberof google.cloud.networkservices.v1.CreateTcpRouteRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CreateTcpRouteRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.networkservices.v1.CreateTcpRouteRequest"; + }; + + return CreateTcpRouteRequest; + })(); + + v1.UpdateTcpRouteRequest = (function() { + + /** + * Properties of an UpdateTcpRouteRequest. + * @memberof google.cloud.networkservices.v1 + * @interface IUpdateTcpRouteRequest + * @property {google.protobuf.IFieldMask|null} [updateMask] UpdateTcpRouteRequest updateMask + * @property {google.cloud.networkservices.v1.ITcpRoute|null} [tcpRoute] UpdateTcpRouteRequest tcpRoute + */ + + /** + * Constructs a new UpdateTcpRouteRequest. + * @memberof google.cloud.networkservices.v1 + * @classdesc Represents an UpdateTcpRouteRequest. + * @implements IUpdateTcpRouteRequest + * @constructor + * @param {google.cloud.networkservices.v1.IUpdateTcpRouteRequest=} [properties] Properties to set + */ + function UpdateTcpRouteRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * UpdateTcpRouteRequest updateMask. + * @member {google.protobuf.IFieldMask|null|undefined} updateMask + * @memberof google.cloud.networkservices.v1.UpdateTcpRouteRequest + * @instance + */ + UpdateTcpRouteRequest.prototype.updateMask = null; + + /** + * UpdateTcpRouteRequest tcpRoute. + * @member {google.cloud.networkservices.v1.ITcpRoute|null|undefined} tcpRoute + * @memberof google.cloud.networkservices.v1.UpdateTcpRouteRequest + * @instance + */ + UpdateTcpRouteRequest.prototype.tcpRoute = null; + + /** + * Creates a new UpdateTcpRouteRequest instance using the specified properties. + * @function create + * @memberof google.cloud.networkservices.v1.UpdateTcpRouteRequest + * @static + * @param {google.cloud.networkservices.v1.IUpdateTcpRouteRequest=} [properties] Properties to set + * @returns {google.cloud.networkservices.v1.UpdateTcpRouteRequest} UpdateTcpRouteRequest instance + */ + UpdateTcpRouteRequest.create = function create(properties) { + return new UpdateTcpRouteRequest(properties); + }; + + /** + * Encodes the specified UpdateTcpRouteRequest message. Does not implicitly {@link google.cloud.networkservices.v1.UpdateTcpRouteRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.networkservices.v1.UpdateTcpRouteRequest + * @static + * @param {google.cloud.networkservices.v1.IUpdateTcpRouteRequest} message UpdateTcpRouteRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateTcpRouteRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.updateMask != null && Object.hasOwnProperty.call(message, "updateMask")) + $root.google.protobuf.FieldMask.encode(message.updateMask, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.tcpRoute != null && Object.hasOwnProperty.call(message, "tcpRoute")) + $root.google.cloud.networkservices.v1.TcpRoute.encode(message.tcpRoute, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified UpdateTcpRouteRequest message, length delimited. Does not implicitly {@link google.cloud.networkservices.v1.UpdateTcpRouteRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.networkservices.v1.UpdateTcpRouteRequest + * @static + * @param {google.cloud.networkservices.v1.IUpdateTcpRouteRequest} message UpdateTcpRouteRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateTcpRouteRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an UpdateTcpRouteRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.networkservices.v1.UpdateTcpRouteRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.networkservices.v1.UpdateTcpRouteRequest} UpdateTcpRouteRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateTcpRouteRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.networkservices.v1.UpdateTcpRouteRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.updateMask = $root.google.protobuf.FieldMask.decode(reader, reader.uint32()); + break; + } + case 2: { + message.tcpRoute = $root.google.cloud.networkservices.v1.TcpRoute.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an UpdateTcpRouteRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.networkservices.v1.UpdateTcpRouteRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.networkservices.v1.UpdateTcpRouteRequest} UpdateTcpRouteRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateTcpRouteRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an UpdateTcpRouteRequest message. + * @function verify + * @memberof google.cloud.networkservices.v1.UpdateTcpRouteRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + UpdateTcpRouteRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.updateMask != null && message.hasOwnProperty("updateMask")) { + var error = $root.google.protobuf.FieldMask.verify(message.updateMask); + if (error) + return "updateMask." + error; + } + if (message.tcpRoute != null && message.hasOwnProperty("tcpRoute")) { + var error = $root.google.cloud.networkservices.v1.TcpRoute.verify(message.tcpRoute); + if (error) + return "tcpRoute." + error; + } + return null; + }; + + /** + * Creates an UpdateTcpRouteRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.networkservices.v1.UpdateTcpRouteRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.networkservices.v1.UpdateTcpRouteRequest} UpdateTcpRouteRequest + */ + UpdateTcpRouteRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.networkservices.v1.UpdateTcpRouteRequest) + return object; + var message = new $root.google.cloud.networkservices.v1.UpdateTcpRouteRequest(); + if (object.updateMask != null) { + if (typeof object.updateMask !== "object") + throw TypeError(".google.cloud.networkservices.v1.UpdateTcpRouteRequest.updateMask: object expected"); + message.updateMask = $root.google.protobuf.FieldMask.fromObject(object.updateMask); + } + if (object.tcpRoute != null) { + if (typeof object.tcpRoute !== "object") + throw TypeError(".google.cloud.networkservices.v1.UpdateTcpRouteRequest.tcpRoute: object expected"); + message.tcpRoute = $root.google.cloud.networkservices.v1.TcpRoute.fromObject(object.tcpRoute); + } + return message; + }; + + /** + * Creates a plain object from an UpdateTcpRouteRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.networkservices.v1.UpdateTcpRouteRequest + * @static + * @param {google.cloud.networkservices.v1.UpdateTcpRouteRequest} message UpdateTcpRouteRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + UpdateTcpRouteRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.updateMask = null; + object.tcpRoute = null; + } + if (message.updateMask != null && message.hasOwnProperty("updateMask")) + object.updateMask = $root.google.protobuf.FieldMask.toObject(message.updateMask, options); + if (message.tcpRoute != null && message.hasOwnProperty("tcpRoute")) + object.tcpRoute = $root.google.cloud.networkservices.v1.TcpRoute.toObject(message.tcpRoute, options); + return object; + }; + + /** + * Converts this UpdateTcpRouteRequest to JSON. + * @function toJSON + * @memberof google.cloud.networkservices.v1.UpdateTcpRouteRequest + * @instance + * @returns {Object.} JSON object + */ + UpdateTcpRouteRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for UpdateTcpRouteRequest + * @function getTypeUrl + * @memberof google.cloud.networkservices.v1.UpdateTcpRouteRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + UpdateTcpRouteRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.networkservices.v1.UpdateTcpRouteRequest"; + }; + + return UpdateTcpRouteRequest; + })(); + + v1.DeleteTcpRouteRequest = (function() { + + /** + * Properties of a DeleteTcpRouteRequest. + * @memberof google.cloud.networkservices.v1 + * @interface IDeleteTcpRouteRequest + * @property {string|null} [name] DeleteTcpRouteRequest name + */ + + /** + * Constructs a new DeleteTcpRouteRequest. + * @memberof google.cloud.networkservices.v1 + * @classdesc Represents a DeleteTcpRouteRequest. + * @implements IDeleteTcpRouteRequest + * @constructor + * @param {google.cloud.networkservices.v1.IDeleteTcpRouteRequest=} [properties] Properties to set + */ + function DeleteTcpRouteRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * DeleteTcpRouteRequest name. + * @member {string} name + * @memberof google.cloud.networkservices.v1.DeleteTcpRouteRequest + * @instance + */ + DeleteTcpRouteRequest.prototype.name = ""; + + /** + * Creates a new DeleteTcpRouteRequest instance using the specified properties. + * @function create + * @memberof google.cloud.networkservices.v1.DeleteTcpRouteRequest + * @static + * @param {google.cloud.networkservices.v1.IDeleteTcpRouteRequest=} [properties] Properties to set + * @returns {google.cloud.networkservices.v1.DeleteTcpRouteRequest} DeleteTcpRouteRequest instance + */ + DeleteTcpRouteRequest.create = function create(properties) { + return new DeleteTcpRouteRequest(properties); + }; + + /** + * Encodes the specified DeleteTcpRouteRequest message. Does not implicitly {@link google.cloud.networkservices.v1.DeleteTcpRouteRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.networkservices.v1.DeleteTcpRouteRequest + * @static + * @param {google.cloud.networkservices.v1.IDeleteTcpRouteRequest} message DeleteTcpRouteRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteTcpRouteRequest.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 DeleteTcpRouteRequest message, length delimited. Does not implicitly {@link google.cloud.networkservices.v1.DeleteTcpRouteRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.networkservices.v1.DeleteTcpRouteRequest + * @static + * @param {google.cloud.networkservices.v1.IDeleteTcpRouteRequest} message DeleteTcpRouteRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteTcpRouteRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DeleteTcpRouteRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.networkservices.v1.DeleteTcpRouteRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.networkservices.v1.DeleteTcpRouteRequest} DeleteTcpRouteRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteTcpRouteRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.networkservices.v1.DeleteTcpRouteRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DeleteTcpRouteRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.networkservices.v1.DeleteTcpRouteRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.networkservices.v1.DeleteTcpRouteRequest} DeleteTcpRouteRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteTcpRouteRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DeleteTcpRouteRequest message. + * @function verify + * @memberof google.cloud.networkservices.v1.DeleteTcpRouteRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DeleteTcpRouteRequest.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 DeleteTcpRouteRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.networkservices.v1.DeleteTcpRouteRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.networkservices.v1.DeleteTcpRouteRequest} DeleteTcpRouteRequest + */ + DeleteTcpRouteRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.networkservices.v1.DeleteTcpRouteRequest) + return object; + var message = new $root.google.cloud.networkservices.v1.DeleteTcpRouteRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a DeleteTcpRouteRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.networkservices.v1.DeleteTcpRouteRequest + * @static + * @param {google.cloud.networkservices.v1.DeleteTcpRouteRequest} message DeleteTcpRouteRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DeleteTcpRouteRequest.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 DeleteTcpRouteRequest to JSON. + * @function toJSON + * @memberof google.cloud.networkservices.v1.DeleteTcpRouteRequest + * @instance + * @returns {Object.} JSON object + */ + DeleteTcpRouteRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DeleteTcpRouteRequest + * @function getTypeUrl + * @memberof google.cloud.networkservices.v1.DeleteTcpRouteRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DeleteTcpRouteRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.networkservices.v1.DeleteTcpRouteRequest"; + }; + + return DeleteTcpRouteRequest; + })(); + + v1.TlsRoute = (function() { + + /** + * Properties of a TlsRoute. + * @memberof google.cloud.networkservices.v1 + * @interface ITlsRoute + * @property {string|null} [name] TlsRoute name + * @property {string|null} [selfLink] TlsRoute selfLink + * @property {google.protobuf.ITimestamp|null} [createTime] TlsRoute createTime + * @property {google.protobuf.ITimestamp|null} [updateTime] TlsRoute updateTime + * @property {string|null} [description] TlsRoute description + * @property {Array.|null} [rules] TlsRoute rules + * @property {Array.|null} [meshes] TlsRoute meshes + * @property {Array.|null} [gateways] TlsRoute gateways + */ + + /** + * Constructs a new TlsRoute. + * @memberof google.cloud.networkservices.v1 + * @classdesc Represents a TlsRoute. + * @implements ITlsRoute + * @constructor + * @param {google.cloud.networkservices.v1.ITlsRoute=} [properties] Properties to set + */ + function TlsRoute(properties) { + this.rules = []; + this.meshes = []; + this.gateways = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * TlsRoute name. + * @member {string} name + * @memberof google.cloud.networkservices.v1.TlsRoute + * @instance + */ + TlsRoute.prototype.name = ""; + + /** + * TlsRoute selfLink. + * @member {string} selfLink + * @memberof google.cloud.networkservices.v1.TlsRoute + * @instance + */ + TlsRoute.prototype.selfLink = ""; + + /** + * TlsRoute createTime. + * @member {google.protobuf.ITimestamp|null|undefined} createTime + * @memberof google.cloud.networkservices.v1.TlsRoute + * @instance + */ + TlsRoute.prototype.createTime = null; + + /** + * TlsRoute updateTime. + * @member {google.protobuf.ITimestamp|null|undefined} updateTime + * @memberof google.cloud.networkservices.v1.TlsRoute + * @instance + */ + TlsRoute.prototype.updateTime = null; + + /** + * TlsRoute description. + * @member {string} description + * @memberof google.cloud.networkservices.v1.TlsRoute + * @instance + */ + TlsRoute.prototype.description = ""; + + /** + * TlsRoute rules. + * @member {Array.} rules + * @memberof google.cloud.networkservices.v1.TlsRoute + * @instance + */ + TlsRoute.prototype.rules = $util.emptyArray; + + /** + * TlsRoute meshes. + * @member {Array.} meshes + * @memberof google.cloud.networkservices.v1.TlsRoute + * @instance + */ + TlsRoute.prototype.meshes = $util.emptyArray; + + /** + * TlsRoute gateways. + * @member {Array.} gateways + * @memberof google.cloud.networkservices.v1.TlsRoute + * @instance + */ + TlsRoute.prototype.gateways = $util.emptyArray; + + /** + * Creates a new TlsRoute instance using the specified properties. + * @function create + * @memberof google.cloud.networkservices.v1.TlsRoute + * @static + * @param {google.cloud.networkservices.v1.ITlsRoute=} [properties] Properties to set + * @returns {google.cloud.networkservices.v1.TlsRoute} TlsRoute instance + */ + TlsRoute.create = function create(properties) { + return new TlsRoute(properties); + }; + + /** + * Encodes the specified TlsRoute message. Does not implicitly {@link google.cloud.networkservices.v1.TlsRoute.verify|verify} messages. + * @function encode + * @memberof google.cloud.networkservices.v1.TlsRoute + * @static + * @param {google.cloud.networkservices.v1.ITlsRoute} message TlsRoute message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TlsRoute.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.createTime != null && Object.hasOwnProperty.call(message, "createTime")) + $root.google.protobuf.Timestamp.encode(message.createTime, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + 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(); + if (message.description != null && Object.hasOwnProperty.call(message, "description")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.description); + if (message.rules != null && message.rules.length) + for (var i = 0; i < message.rules.length; ++i) + $root.google.cloud.networkservices.v1.TlsRoute.RouteRule.encode(message.rules[i], writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.meshes != null && message.meshes.length) + for (var i = 0; i < message.meshes.length; ++i) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.meshes[i]); + if (message.gateways != null && message.gateways.length) + for (var i = 0; i < message.gateways.length; ++i) + writer.uint32(/* id 7, wireType 2 =*/58).string(message.gateways[i]); + if (message.selfLink != null && Object.hasOwnProperty.call(message, "selfLink")) + writer.uint32(/* id 8, wireType 2 =*/66).string(message.selfLink); + return writer; + }; + + /** + * Encodes the specified TlsRoute message, length delimited. Does not implicitly {@link google.cloud.networkservices.v1.TlsRoute.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.networkservices.v1.TlsRoute + * @static + * @param {google.cloud.networkservices.v1.ITlsRoute} message TlsRoute message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TlsRoute.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a TlsRoute message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.networkservices.v1.TlsRoute + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.networkservices.v1.TlsRoute} TlsRoute + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TlsRoute.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.networkservices.v1.TlsRoute(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 8: { + message.selfLink = reader.string(); + break; + } + case 2: { + message.createTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 3: { + message.updateTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 4: { + message.description = reader.string(); + break; + } + case 5: { + if (!(message.rules && message.rules.length)) + message.rules = []; + message.rules.push($root.google.cloud.networkservices.v1.TlsRoute.RouteRule.decode(reader, reader.uint32())); + break; + } + case 6: { + if (!(message.meshes && message.meshes.length)) + message.meshes = []; + message.meshes.push(reader.string()); + break; + } + case 7: { + if (!(message.gateways && message.gateways.length)) + message.gateways = []; + message.gateways.push(reader.string()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a TlsRoute message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.networkservices.v1.TlsRoute + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.networkservices.v1.TlsRoute} TlsRoute + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TlsRoute.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a TlsRoute message. + * @function verify + * @memberof google.cloud.networkservices.v1.TlsRoute + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + TlsRoute.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.selfLink != null && message.hasOwnProperty("selfLink")) + if (!$util.isString(message.selfLink)) + return "selfLink: string expected"; + 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.description != null && message.hasOwnProperty("description")) + if (!$util.isString(message.description)) + return "description: string 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.cloud.networkservices.v1.TlsRoute.RouteRule.verify(message.rules[i]); + if (error) + return "rules." + error; + } + } + if (message.meshes != null && message.hasOwnProperty("meshes")) { + if (!Array.isArray(message.meshes)) + return "meshes: array expected"; + for (var i = 0; i < message.meshes.length; ++i) + if (!$util.isString(message.meshes[i])) + return "meshes: string[] expected"; + } + if (message.gateways != null && message.hasOwnProperty("gateways")) { + if (!Array.isArray(message.gateways)) + return "gateways: array expected"; + for (var i = 0; i < message.gateways.length; ++i) + if (!$util.isString(message.gateways[i])) + return "gateways: string[] expected"; + } + return null; + }; + + /** + * Creates a TlsRoute message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.networkservices.v1.TlsRoute + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.networkservices.v1.TlsRoute} TlsRoute + */ + TlsRoute.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.networkservices.v1.TlsRoute) + return object; + var message = new $root.google.cloud.networkservices.v1.TlsRoute(); + if (object.name != null) + message.name = String(object.name); + if (object.selfLink != null) + message.selfLink = String(object.selfLink); + if (object.createTime != null) { + if (typeof object.createTime !== "object") + throw TypeError(".google.cloud.networkservices.v1.TlsRoute.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.networkservices.v1.TlsRoute.updateTime: object expected"); + message.updateTime = $root.google.protobuf.Timestamp.fromObject(object.updateTime); + } + if (object.description != null) + message.description = String(object.description); + if (object.rules) { + if (!Array.isArray(object.rules)) + throw TypeError(".google.cloud.networkservices.v1.TlsRoute.rules: array expected"); + message.rules = []; + for (var i = 0; i < object.rules.length; ++i) { + if (typeof object.rules[i] !== "object") + throw TypeError(".google.cloud.networkservices.v1.TlsRoute.rules: object expected"); + message.rules[i] = $root.google.cloud.networkservices.v1.TlsRoute.RouteRule.fromObject(object.rules[i]); + } + } + if (object.meshes) { + if (!Array.isArray(object.meshes)) + throw TypeError(".google.cloud.networkservices.v1.TlsRoute.meshes: array expected"); + message.meshes = []; + for (var i = 0; i < object.meshes.length; ++i) + message.meshes[i] = String(object.meshes[i]); + } + if (object.gateways) { + if (!Array.isArray(object.gateways)) + throw TypeError(".google.cloud.networkservices.v1.TlsRoute.gateways: array expected"); + message.gateways = []; + for (var i = 0; i < object.gateways.length; ++i) + message.gateways[i] = String(object.gateways[i]); + } + return message; + }; + + /** + * Creates a plain object from a TlsRoute message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.networkservices.v1.TlsRoute + * @static + * @param {google.cloud.networkservices.v1.TlsRoute} message TlsRoute + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + TlsRoute.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.rules = []; + object.meshes = []; + object.gateways = []; + } + if (options.defaults) { + object.name = ""; + object.createTime = null; + object.updateTime = null; + object.description = ""; + object.selfLink = ""; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + 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.description != null && message.hasOwnProperty("description")) + object.description = message.description; + if (message.rules && message.rules.length) { + object.rules = []; + for (var j = 0; j < message.rules.length; ++j) + object.rules[j] = $root.google.cloud.networkservices.v1.TlsRoute.RouteRule.toObject(message.rules[j], options); + } + if (message.meshes && message.meshes.length) { + object.meshes = []; + for (var j = 0; j < message.meshes.length; ++j) + object.meshes[j] = message.meshes[j]; + } + if (message.gateways && message.gateways.length) { + object.gateways = []; + for (var j = 0; j < message.gateways.length; ++j) + object.gateways[j] = message.gateways[j]; + } + if (message.selfLink != null && message.hasOwnProperty("selfLink")) + object.selfLink = message.selfLink; + return object; + }; + + /** + * Converts this TlsRoute to JSON. + * @function toJSON + * @memberof google.cloud.networkservices.v1.TlsRoute + * @instance + * @returns {Object.} JSON object + */ + TlsRoute.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for TlsRoute + * @function getTypeUrl + * @memberof google.cloud.networkservices.v1.TlsRoute + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TlsRoute.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.networkservices.v1.TlsRoute"; + }; + + TlsRoute.RouteRule = (function() { + + /** + * Properties of a RouteRule. + * @memberof google.cloud.networkservices.v1.TlsRoute + * @interface IRouteRule + * @property {Array.|null} [matches] RouteRule matches + * @property {google.cloud.networkservices.v1.TlsRoute.IRouteAction|null} [action] RouteRule action + */ + + /** + * Constructs a new RouteRule. + * @memberof google.cloud.networkservices.v1.TlsRoute + * @classdesc Represents a RouteRule. + * @implements IRouteRule + * @constructor + * @param {google.cloud.networkservices.v1.TlsRoute.IRouteRule=} [properties] Properties to set + */ + function RouteRule(properties) { + this.matches = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * RouteRule matches. + * @member {Array.} matches + * @memberof google.cloud.networkservices.v1.TlsRoute.RouteRule + * @instance + */ + RouteRule.prototype.matches = $util.emptyArray; + + /** + * RouteRule action. + * @member {google.cloud.networkservices.v1.TlsRoute.IRouteAction|null|undefined} action + * @memberof google.cloud.networkservices.v1.TlsRoute.RouteRule + * @instance + */ + RouteRule.prototype.action = null; + + /** + * Creates a new RouteRule instance using the specified properties. + * @function create + * @memberof google.cloud.networkservices.v1.TlsRoute.RouteRule + * @static + * @param {google.cloud.networkservices.v1.TlsRoute.IRouteRule=} [properties] Properties to set + * @returns {google.cloud.networkservices.v1.TlsRoute.RouteRule} RouteRule instance + */ + RouteRule.create = function create(properties) { + return new RouteRule(properties); + }; + + /** + * Encodes the specified RouteRule message. Does not implicitly {@link google.cloud.networkservices.v1.TlsRoute.RouteRule.verify|verify} messages. + * @function encode + * @memberof google.cloud.networkservices.v1.TlsRoute.RouteRule + * @static + * @param {google.cloud.networkservices.v1.TlsRoute.IRouteRule} message RouteRule message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RouteRule.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.matches != null && message.matches.length) + for (var i = 0; i < message.matches.length; ++i) + $root.google.cloud.networkservices.v1.TlsRoute.RouteMatch.encode(message.matches[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.action != null && Object.hasOwnProperty.call(message, "action")) + $root.google.cloud.networkservices.v1.TlsRoute.RouteAction.encode(message.action, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified RouteRule message, length delimited. Does not implicitly {@link google.cloud.networkservices.v1.TlsRoute.RouteRule.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.networkservices.v1.TlsRoute.RouteRule + * @static + * @param {google.cloud.networkservices.v1.TlsRoute.IRouteRule} message RouteRule message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RouteRule.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a RouteRule message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.networkservices.v1.TlsRoute.RouteRule + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.networkservices.v1.TlsRoute.RouteRule} RouteRule + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RouteRule.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.networkservices.v1.TlsRoute.RouteRule(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.matches && message.matches.length)) + message.matches = []; + message.matches.push($root.google.cloud.networkservices.v1.TlsRoute.RouteMatch.decode(reader, reader.uint32())); + break; + } + case 2: { + message.action = $root.google.cloud.networkservices.v1.TlsRoute.RouteAction.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a RouteRule message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.networkservices.v1.TlsRoute.RouteRule + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.networkservices.v1.TlsRoute.RouteRule} RouteRule + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RouteRule.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a RouteRule message. + * @function verify + * @memberof google.cloud.networkservices.v1.TlsRoute.RouteRule + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + RouteRule.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.matches != null && message.hasOwnProperty("matches")) { + if (!Array.isArray(message.matches)) + return "matches: array expected"; + for (var i = 0; i < message.matches.length; ++i) { + var error = $root.google.cloud.networkservices.v1.TlsRoute.RouteMatch.verify(message.matches[i]); + if (error) + return "matches." + error; + } + } + if (message.action != null && message.hasOwnProperty("action")) { + var error = $root.google.cloud.networkservices.v1.TlsRoute.RouteAction.verify(message.action); + if (error) + return "action." + error; + } + return null; + }; + + /** + * Creates a RouteRule message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.networkservices.v1.TlsRoute.RouteRule + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.networkservices.v1.TlsRoute.RouteRule} RouteRule + */ + RouteRule.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.networkservices.v1.TlsRoute.RouteRule) + return object; + var message = new $root.google.cloud.networkservices.v1.TlsRoute.RouteRule(); + if (object.matches) { + if (!Array.isArray(object.matches)) + throw TypeError(".google.cloud.networkservices.v1.TlsRoute.RouteRule.matches: array expected"); + message.matches = []; + for (var i = 0; i < object.matches.length; ++i) { + if (typeof object.matches[i] !== "object") + throw TypeError(".google.cloud.networkservices.v1.TlsRoute.RouteRule.matches: object expected"); + message.matches[i] = $root.google.cloud.networkservices.v1.TlsRoute.RouteMatch.fromObject(object.matches[i]); + } + } + if (object.action != null) { + if (typeof object.action !== "object") + throw TypeError(".google.cloud.networkservices.v1.TlsRoute.RouteRule.action: object expected"); + message.action = $root.google.cloud.networkservices.v1.TlsRoute.RouteAction.fromObject(object.action); + } + return message; + }; + + /** + * Creates a plain object from a RouteRule message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.networkservices.v1.TlsRoute.RouteRule + * @static + * @param {google.cloud.networkservices.v1.TlsRoute.RouteRule} message RouteRule + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + RouteRule.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.matches = []; + if (options.defaults) + object.action = null; + if (message.matches && message.matches.length) { + object.matches = []; + for (var j = 0; j < message.matches.length; ++j) + object.matches[j] = $root.google.cloud.networkservices.v1.TlsRoute.RouteMatch.toObject(message.matches[j], options); + } + if (message.action != null && message.hasOwnProperty("action")) + object.action = $root.google.cloud.networkservices.v1.TlsRoute.RouteAction.toObject(message.action, options); + return object; + }; + + /** + * Converts this RouteRule to JSON. + * @function toJSON + * @memberof google.cloud.networkservices.v1.TlsRoute.RouteRule + * @instance + * @returns {Object.} JSON object + */ + RouteRule.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for RouteRule + * @function getTypeUrl + * @memberof google.cloud.networkservices.v1.TlsRoute.RouteRule + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + RouteRule.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.networkservices.v1.TlsRoute.RouteRule"; + }; + + return RouteRule; + })(); + + TlsRoute.RouteMatch = (function() { + + /** + * Properties of a RouteMatch. + * @memberof google.cloud.networkservices.v1.TlsRoute + * @interface IRouteMatch + * @property {Array.|null} [sniHost] RouteMatch sniHost + * @property {Array.|null} [alpn] RouteMatch alpn + */ + + /** + * Constructs a new RouteMatch. + * @memberof google.cloud.networkservices.v1.TlsRoute + * @classdesc Represents a RouteMatch. + * @implements IRouteMatch + * @constructor + * @param {google.cloud.networkservices.v1.TlsRoute.IRouteMatch=} [properties] Properties to set + */ + function RouteMatch(properties) { + this.sniHost = []; + this.alpn = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * RouteMatch sniHost. + * @member {Array.} sniHost + * @memberof google.cloud.networkservices.v1.TlsRoute.RouteMatch + * @instance + */ + RouteMatch.prototype.sniHost = $util.emptyArray; + + /** + * RouteMatch alpn. + * @member {Array.} alpn + * @memberof google.cloud.networkservices.v1.TlsRoute.RouteMatch + * @instance + */ + RouteMatch.prototype.alpn = $util.emptyArray; + + /** + * Creates a new RouteMatch instance using the specified properties. + * @function create + * @memberof google.cloud.networkservices.v1.TlsRoute.RouteMatch + * @static + * @param {google.cloud.networkservices.v1.TlsRoute.IRouteMatch=} [properties] Properties to set + * @returns {google.cloud.networkservices.v1.TlsRoute.RouteMatch} RouteMatch instance + */ + RouteMatch.create = function create(properties) { + return new RouteMatch(properties); + }; + + /** + * Encodes the specified RouteMatch message. Does not implicitly {@link google.cloud.networkservices.v1.TlsRoute.RouteMatch.verify|verify} messages. + * @function encode + * @memberof google.cloud.networkservices.v1.TlsRoute.RouteMatch + * @static + * @param {google.cloud.networkservices.v1.TlsRoute.IRouteMatch} message RouteMatch message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RouteMatch.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.sniHost != null && message.sniHost.length) + for (var i = 0; i < message.sniHost.length; ++i) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.sniHost[i]); + if (message.alpn != null && message.alpn.length) + for (var i = 0; i < message.alpn.length; ++i) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.alpn[i]); + return writer; + }; + + /** + * Encodes the specified RouteMatch message, length delimited. Does not implicitly {@link google.cloud.networkservices.v1.TlsRoute.RouteMatch.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.networkservices.v1.TlsRoute.RouteMatch + * @static + * @param {google.cloud.networkservices.v1.TlsRoute.IRouteMatch} message RouteMatch message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RouteMatch.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a RouteMatch message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.networkservices.v1.TlsRoute.RouteMatch + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.networkservices.v1.TlsRoute.RouteMatch} RouteMatch + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RouteMatch.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.networkservices.v1.TlsRoute.RouteMatch(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.sniHost && message.sniHost.length)) + message.sniHost = []; + message.sniHost.push(reader.string()); + break; + } + case 2: { + if (!(message.alpn && message.alpn.length)) + message.alpn = []; + message.alpn.push(reader.string()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a RouteMatch message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.networkservices.v1.TlsRoute.RouteMatch + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.networkservices.v1.TlsRoute.RouteMatch} RouteMatch + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RouteMatch.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a RouteMatch message. + * @function verify + * @memberof google.cloud.networkservices.v1.TlsRoute.RouteMatch + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + RouteMatch.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.sniHost != null && message.hasOwnProperty("sniHost")) { + if (!Array.isArray(message.sniHost)) + return "sniHost: array expected"; + for (var i = 0; i < message.sniHost.length; ++i) + if (!$util.isString(message.sniHost[i])) + return "sniHost: string[] expected"; + } + if (message.alpn != null && message.hasOwnProperty("alpn")) { + if (!Array.isArray(message.alpn)) + return "alpn: array expected"; + for (var i = 0; i < message.alpn.length; ++i) + if (!$util.isString(message.alpn[i])) + return "alpn: string[] expected"; + } + return null; + }; + + /** + * Creates a RouteMatch message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.networkservices.v1.TlsRoute.RouteMatch + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.networkservices.v1.TlsRoute.RouteMatch} RouteMatch + */ + RouteMatch.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.networkservices.v1.TlsRoute.RouteMatch) + return object; + var message = new $root.google.cloud.networkservices.v1.TlsRoute.RouteMatch(); + if (object.sniHost) { + if (!Array.isArray(object.sniHost)) + throw TypeError(".google.cloud.networkservices.v1.TlsRoute.RouteMatch.sniHost: array expected"); + message.sniHost = []; + for (var i = 0; i < object.sniHost.length; ++i) + message.sniHost[i] = String(object.sniHost[i]); + } + if (object.alpn) { + if (!Array.isArray(object.alpn)) + throw TypeError(".google.cloud.networkservices.v1.TlsRoute.RouteMatch.alpn: array expected"); + message.alpn = []; + for (var i = 0; i < object.alpn.length; ++i) + message.alpn[i] = String(object.alpn[i]); + } + return message; + }; + + /** + * Creates a plain object from a RouteMatch message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.networkservices.v1.TlsRoute.RouteMatch + * @static + * @param {google.cloud.networkservices.v1.TlsRoute.RouteMatch} message RouteMatch + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + RouteMatch.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.sniHost = []; + object.alpn = []; + } + if (message.sniHost && message.sniHost.length) { + object.sniHost = []; + for (var j = 0; j < message.sniHost.length; ++j) + object.sniHost[j] = message.sniHost[j]; + } + if (message.alpn && message.alpn.length) { + object.alpn = []; + for (var j = 0; j < message.alpn.length; ++j) + object.alpn[j] = message.alpn[j]; + } + return object; + }; + + /** + * Converts this RouteMatch to JSON. + * @function toJSON + * @memberof google.cloud.networkservices.v1.TlsRoute.RouteMatch + * @instance + * @returns {Object.} JSON object + */ + RouteMatch.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for RouteMatch + * @function getTypeUrl + * @memberof google.cloud.networkservices.v1.TlsRoute.RouteMatch + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + RouteMatch.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.networkservices.v1.TlsRoute.RouteMatch"; + }; + + return RouteMatch; + })(); + + TlsRoute.RouteAction = (function() { + + /** + * Properties of a RouteAction. + * @memberof google.cloud.networkservices.v1.TlsRoute + * @interface IRouteAction + * @property {Array.|null} [destinations] RouteAction destinations + */ + + /** + * Constructs a new RouteAction. + * @memberof google.cloud.networkservices.v1.TlsRoute + * @classdesc Represents a RouteAction. + * @implements IRouteAction + * @constructor + * @param {google.cloud.networkservices.v1.TlsRoute.IRouteAction=} [properties] Properties to set + */ + function RouteAction(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]]; + } + + /** + * RouteAction destinations. + * @member {Array.} destinations + * @memberof google.cloud.networkservices.v1.TlsRoute.RouteAction + * @instance + */ + RouteAction.prototype.destinations = $util.emptyArray; + + /** + * Creates a new RouteAction instance using the specified properties. + * @function create + * @memberof google.cloud.networkservices.v1.TlsRoute.RouteAction + * @static + * @param {google.cloud.networkservices.v1.TlsRoute.IRouteAction=} [properties] Properties to set + * @returns {google.cloud.networkservices.v1.TlsRoute.RouteAction} RouteAction instance + */ + RouteAction.create = function create(properties) { + return new RouteAction(properties); + }; + + /** + * Encodes the specified RouteAction message. Does not implicitly {@link google.cloud.networkservices.v1.TlsRoute.RouteAction.verify|verify} messages. + * @function encode + * @memberof google.cloud.networkservices.v1.TlsRoute.RouteAction + * @static + * @param {google.cloud.networkservices.v1.TlsRoute.IRouteAction} message RouteAction message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RouteAction.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.destinations != null && message.destinations.length) + for (var i = 0; i < message.destinations.length; ++i) + $root.google.cloud.networkservices.v1.TlsRoute.RouteDestination.encode(message.destinations[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified RouteAction message, length delimited. Does not implicitly {@link google.cloud.networkservices.v1.TlsRoute.RouteAction.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.networkservices.v1.TlsRoute.RouteAction + * @static + * @param {google.cloud.networkservices.v1.TlsRoute.IRouteAction} message RouteAction message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RouteAction.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a RouteAction message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.networkservices.v1.TlsRoute.RouteAction + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.networkservices.v1.TlsRoute.RouteAction} RouteAction + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RouteAction.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.networkservices.v1.TlsRoute.RouteAction(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.destinations && message.destinations.length)) + message.destinations = []; + message.destinations.push($root.google.cloud.networkservices.v1.TlsRoute.RouteDestination.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a RouteAction message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.networkservices.v1.TlsRoute.RouteAction + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.networkservices.v1.TlsRoute.RouteAction} RouteAction + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RouteAction.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a RouteAction message. + * @function verify + * @memberof google.cloud.networkservices.v1.TlsRoute.RouteAction + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + RouteAction.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object 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) { + var error = $root.google.cloud.networkservices.v1.TlsRoute.RouteDestination.verify(message.destinations[i]); + if (error) + return "destinations." + error; + } + } + return null; + }; + + /** + * Creates a RouteAction message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.networkservices.v1.TlsRoute.RouteAction + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.networkservices.v1.TlsRoute.RouteAction} RouteAction + */ + RouteAction.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.networkservices.v1.TlsRoute.RouteAction) + return object; + var message = new $root.google.cloud.networkservices.v1.TlsRoute.RouteAction(); + if (object.destinations) { + if (!Array.isArray(object.destinations)) + throw TypeError(".google.cloud.networkservices.v1.TlsRoute.RouteAction.destinations: array expected"); + message.destinations = []; + for (var i = 0; i < object.destinations.length; ++i) { + if (typeof object.destinations[i] !== "object") + throw TypeError(".google.cloud.networkservices.v1.TlsRoute.RouteAction.destinations: object expected"); + message.destinations[i] = $root.google.cloud.networkservices.v1.TlsRoute.RouteDestination.fromObject(object.destinations[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a RouteAction message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.networkservices.v1.TlsRoute.RouteAction + * @static + * @param {google.cloud.networkservices.v1.TlsRoute.RouteAction} message RouteAction + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + RouteAction.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.destinations = []; + if (message.destinations && message.destinations.length) { + object.destinations = []; + for (var j = 0; j < message.destinations.length; ++j) + object.destinations[j] = $root.google.cloud.networkservices.v1.TlsRoute.RouteDestination.toObject(message.destinations[j], options); + } + return object; + }; + + /** + * Converts this RouteAction to JSON. + * @function toJSON + * @memberof google.cloud.networkservices.v1.TlsRoute.RouteAction + * @instance + * @returns {Object.} JSON object + */ + RouteAction.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for RouteAction + * @function getTypeUrl + * @memberof google.cloud.networkservices.v1.TlsRoute.RouteAction + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + RouteAction.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.networkservices.v1.TlsRoute.RouteAction"; + }; + + return RouteAction; + })(); + + TlsRoute.RouteDestination = (function() { + + /** + * Properties of a RouteDestination. + * @memberof google.cloud.networkservices.v1.TlsRoute + * @interface IRouteDestination + * @property {string|null} [serviceName] RouteDestination serviceName + * @property {number|null} [weight] RouteDestination weight + */ + + /** + * Constructs a new RouteDestination. + * @memberof google.cloud.networkservices.v1.TlsRoute + * @classdesc Represents a RouteDestination. + * @implements IRouteDestination + * @constructor + * @param {google.cloud.networkservices.v1.TlsRoute.IRouteDestination=} [properties] Properties to set + */ + function RouteDestination(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * RouteDestination serviceName. + * @member {string} serviceName + * @memberof google.cloud.networkservices.v1.TlsRoute.RouteDestination + * @instance + */ + RouteDestination.prototype.serviceName = ""; + + /** + * RouteDestination weight. + * @member {number} weight + * @memberof google.cloud.networkservices.v1.TlsRoute.RouteDestination + * @instance + */ + RouteDestination.prototype.weight = 0; + + /** + * Creates a new RouteDestination instance using the specified properties. + * @function create + * @memberof google.cloud.networkservices.v1.TlsRoute.RouteDestination + * @static + * @param {google.cloud.networkservices.v1.TlsRoute.IRouteDestination=} [properties] Properties to set + * @returns {google.cloud.networkservices.v1.TlsRoute.RouteDestination} RouteDestination instance + */ + RouteDestination.create = function create(properties) { + return new RouteDestination(properties); + }; + + /** + * Encodes the specified RouteDestination message. Does not implicitly {@link google.cloud.networkservices.v1.TlsRoute.RouteDestination.verify|verify} messages. + * @function encode + * @memberof google.cloud.networkservices.v1.TlsRoute.RouteDestination + * @static + * @param {google.cloud.networkservices.v1.TlsRoute.IRouteDestination} message RouteDestination message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RouteDestination.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.serviceName != null && Object.hasOwnProperty.call(message, "serviceName")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.serviceName); + if (message.weight != null && Object.hasOwnProperty.call(message, "weight")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.weight); + return writer; + }; + + /** + * Encodes the specified RouteDestination message, length delimited. Does not implicitly {@link google.cloud.networkservices.v1.TlsRoute.RouteDestination.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.networkservices.v1.TlsRoute.RouteDestination + * @static + * @param {google.cloud.networkservices.v1.TlsRoute.IRouteDestination} message RouteDestination message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RouteDestination.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a RouteDestination message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.networkservices.v1.TlsRoute.RouteDestination + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.networkservices.v1.TlsRoute.RouteDestination} RouteDestination + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RouteDestination.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.networkservices.v1.TlsRoute.RouteDestination(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.serviceName = reader.string(); + break; + } + case 2: { + message.weight = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a RouteDestination message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.networkservices.v1.TlsRoute.RouteDestination + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.networkservices.v1.TlsRoute.RouteDestination} RouteDestination + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RouteDestination.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a RouteDestination message. + * @function verify + * @memberof google.cloud.networkservices.v1.TlsRoute.RouteDestination + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + RouteDestination.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.serviceName != null && message.hasOwnProperty("serviceName")) + if (!$util.isString(message.serviceName)) + return "serviceName: string expected"; + if (message.weight != null && message.hasOwnProperty("weight")) + if (!$util.isInteger(message.weight)) + return "weight: integer expected"; + return null; + }; + + /** + * Creates a RouteDestination message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.networkservices.v1.TlsRoute.RouteDestination + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.networkservices.v1.TlsRoute.RouteDestination} RouteDestination + */ + RouteDestination.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.networkservices.v1.TlsRoute.RouteDestination) + return object; + var message = new $root.google.cloud.networkservices.v1.TlsRoute.RouteDestination(); + if (object.serviceName != null) + message.serviceName = String(object.serviceName); + if (object.weight != null) + message.weight = object.weight | 0; + return message; + }; + + /** + * Creates a plain object from a RouteDestination message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.networkservices.v1.TlsRoute.RouteDestination + * @static + * @param {google.cloud.networkservices.v1.TlsRoute.RouteDestination} message RouteDestination + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + RouteDestination.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.serviceName = ""; + object.weight = 0; + } + if (message.serviceName != null && message.hasOwnProperty("serviceName")) + object.serviceName = message.serviceName; + if (message.weight != null && message.hasOwnProperty("weight")) + object.weight = message.weight; + return object; + }; + + /** + * Converts this RouteDestination to JSON. + * @function toJSON + * @memberof google.cloud.networkservices.v1.TlsRoute.RouteDestination + * @instance + * @returns {Object.} JSON object + */ + RouteDestination.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for RouteDestination + * @function getTypeUrl + * @memberof google.cloud.networkservices.v1.TlsRoute.RouteDestination + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + RouteDestination.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.networkservices.v1.TlsRoute.RouteDestination"; + }; + + return RouteDestination; + })(); + + return TlsRoute; + })(); + + v1.ListTlsRoutesRequest = (function() { + + /** + * Properties of a ListTlsRoutesRequest. + * @memberof google.cloud.networkservices.v1 + * @interface IListTlsRoutesRequest + * @property {string|null} [parent] ListTlsRoutesRequest parent + * @property {number|null} [pageSize] ListTlsRoutesRequest pageSize + * @property {string|null} [pageToken] ListTlsRoutesRequest pageToken + */ + + /** + * Constructs a new ListTlsRoutesRequest. + * @memberof google.cloud.networkservices.v1 + * @classdesc Represents a ListTlsRoutesRequest. + * @implements IListTlsRoutesRequest + * @constructor + * @param {google.cloud.networkservices.v1.IListTlsRoutesRequest=} [properties] Properties to set + */ + function ListTlsRoutesRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListTlsRoutesRequest parent. + * @member {string} parent + * @memberof google.cloud.networkservices.v1.ListTlsRoutesRequest + * @instance + */ + ListTlsRoutesRequest.prototype.parent = ""; + + /** + * ListTlsRoutesRequest pageSize. + * @member {number} pageSize + * @memberof google.cloud.networkservices.v1.ListTlsRoutesRequest + * @instance + */ + ListTlsRoutesRequest.prototype.pageSize = 0; + + /** + * ListTlsRoutesRequest pageToken. + * @member {string} pageToken + * @memberof google.cloud.networkservices.v1.ListTlsRoutesRequest + * @instance + */ + ListTlsRoutesRequest.prototype.pageToken = ""; + + /** + * Creates a new ListTlsRoutesRequest instance using the specified properties. + * @function create + * @memberof google.cloud.networkservices.v1.ListTlsRoutesRequest + * @static + * @param {google.cloud.networkservices.v1.IListTlsRoutesRequest=} [properties] Properties to set + * @returns {google.cloud.networkservices.v1.ListTlsRoutesRequest} ListTlsRoutesRequest instance + */ + ListTlsRoutesRequest.create = function create(properties) { + return new ListTlsRoutesRequest(properties); + }; + + /** + * Encodes the specified ListTlsRoutesRequest message. Does not implicitly {@link google.cloud.networkservices.v1.ListTlsRoutesRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.networkservices.v1.ListTlsRoutesRequest + * @static + * @param {google.cloud.networkservices.v1.IListTlsRoutesRequest} message ListTlsRoutesRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListTlsRoutesRequest.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 ListTlsRoutesRequest message, length delimited. Does not implicitly {@link google.cloud.networkservices.v1.ListTlsRoutesRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.networkservices.v1.ListTlsRoutesRequest + * @static + * @param {google.cloud.networkservices.v1.IListTlsRoutesRequest} message ListTlsRoutesRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListTlsRoutesRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListTlsRoutesRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.networkservices.v1.ListTlsRoutesRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.networkservices.v1.ListTlsRoutesRequest} ListTlsRoutesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListTlsRoutesRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.networkservices.v1.ListTlsRoutesRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + 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 ListTlsRoutesRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.networkservices.v1.ListTlsRoutesRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.networkservices.v1.ListTlsRoutesRequest} ListTlsRoutesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListTlsRoutesRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListTlsRoutesRequest message. + * @function verify + * @memberof google.cloud.networkservices.v1.ListTlsRoutesRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListTlsRoutesRequest.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 ListTlsRoutesRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.networkservices.v1.ListTlsRoutesRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.networkservices.v1.ListTlsRoutesRequest} ListTlsRoutesRequest + */ + ListTlsRoutesRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.networkservices.v1.ListTlsRoutesRequest) + return object; + var message = new $root.google.cloud.networkservices.v1.ListTlsRoutesRequest(); + 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 ListTlsRoutesRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.networkservices.v1.ListTlsRoutesRequest + * @static + * @param {google.cloud.networkservices.v1.ListTlsRoutesRequest} message ListTlsRoutesRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListTlsRoutesRequest.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 ListTlsRoutesRequest to JSON. + * @function toJSON + * @memberof google.cloud.networkservices.v1.ListTlsRoutesRequest + * @instance + * @returns {Object.} JSON object + */ + ListTlsRoutesRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListTlsRoutesRequest + * @function getTypeUrl + * @memberof google.cloud.networkservices.v1.ListTlsRoutesRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListTlsRoutesRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.networkservices.v1.ListTlsRoutesRequest"; + }; + + return ListTlsRoutesRequest; + })(); + + v1.ListTlsRoutesResponse = (function() { + + /** + * Properties of a ListTlsRoutesResponse. + * @memberof google.cloud.networkservices.v1 + * @interface IListTlsRoutesResponse + * @property {Array.|null} [tlsRoutes] ListTlsRoutesResponse tlsRoutes + * @property {string|null} [nextPageToken] ListTlsRoutesResponse nextPageToken + */ + + /** + * Constructs a new ListTlsRoutesResponse. + * @memberof google.cloud.networkservices.v1 + * @classdesc Represents a ListTlsRoutesResponse. + * @implements IListTlsRoutesResponse + * @constructor + * @param {google.cloud.networkservices.v1.IListTlsRoutesResponse=} [properties] Properties to set + */ + function ListTlsRoutesResponse(properties) { + this.tlsRoutes = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListTlsRoutesResponse tlsRoutes. + * @member {Array.} tlsRoutes + * @memberof google.cloud.networkservices.v1.ListTlsRoutesResponse + * @instance + */ + ListTlsRoutesResponse.prototype.tlsRoutes = $util.emptyArray; + + /** + * ListTlsRoutesResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.cloud.networkservices.v1.ListTlsRoutesResponse + * @instance + */ + ListTlsRoutesResponse.prototype.nextPageToken = ""; + + /** + * Creates a new ListTlsRoutesResponse instance using the specified properties. + * @function create + * @memberof google.cloud.networkservices.v1.ListTlsRoutesResponse + * @static + * @param {google.cloud.networkservices.v1.IListTlsRoutesResponse=} [properties] Properties to set + * @returns {google.cloud.networkservices.v1.ListTlsRoutesResponse} ListTlsRoutesResponse instance + */ + ListTlsRoutesResponse.create = function create(properties) { + return new ListTlsRoutesResponse(properties); + }; + + /** + * Encodes the specified ListTlsRoutesResponse message. Does not implicitly {@link google.cloud.networkservices.v1.ListTlsRoutesResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.networkservices.v1.ListTlsRoutesResponse + * @static + * @param {google.cloud.networkservices.v1.IListTlsRoutesResponse} message ListTlsRoutesResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListTlsRoutesResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.tlsRoutes != null && message.tlsRoutes.length) + for (var i = 0; i < message.tlsRoutes.length; ++i) + $root.google.cloud.networkservices.v1.TlsRoute.encode(message.tlsRoutes[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 ListTlsRoutesResponse message, length delimited. Does not implicitly {@link google.cloud.networkservices.v1.ListTlsRoutesResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.networkservices.v1.ListTlsRoutesResponse + * @static + * @param {google.cloud.networkservices.v1.IListTlsRoutesResponse} message ListTlsRoutesResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListTlsRoutesResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListTlsRoutesResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.networkservices.v1.ListTlsRoutesResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.networkservices.v1.ListTlsRoutesResponse} ListTlsRoutesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListTlsRoutesResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.networkservices.v1.ListTlsRoutesResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.tlsRoutes && message.tlsRoutes.length)) + message.tlsRoutes = []; + message.tlsRoutes.push($root.google.cloud.networkservices.v1.TlsRoute.decode(reader, reader.uint32())); + break; + } + case 2: { + message.nextPageToken = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListTlsRoutesResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.networkservices.v1.ListTlsRoutesResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.networkservices.v1.ListTlsRoutesResponse} ListTlsRoutesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListTlsRoutesResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListTlsRoutesResponse message. + * @function verify + * @memberof google.cloud.networkservices.v1.ListTlsRoutesResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListTlsRoutesResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.tlsRoutes != null && message.hasOwnProperty("tlsRoutes")) { + if (!Array.isArray(message.tlsRoutes)) + return "tlsRoutes: array expected"; + for (var i = 0; i < message.tlsRoutes.length; ++i) { + var error = $root.google.cloud.networkservices.v1.TlsRoute.verify(message.tlsRoutes[i]); + if (error) + return "tlsRoutes." + error; + } + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + return null; + }; + + /** + * Creates a ListTlsRoutesResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.networkservices.v1.ListTlsRoutesResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.networkservices.v1.ListTlsRoutesResponse} ListTlsRoutesResponse + */ + ListTlsRoutesResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.networkservices.v1.ListTlsRoutesResponse) + return object; + var message = new $root.google.cloud.networkservices.v1.ListTlsRoutesResponse(); + if (object.tlsRoutes) { + if (!Array.isArray(object.tlsRoutes)) + throw TypeError(".google.cloud.networkservices.v1.ListTlsRoutesResponse.tlsRoutes: array expected"); + message.tlsRoutes = []; + for (var i = 0; i < object.tlsRoutes.length; ++i) { + if (typeof object.tlsRoutes[i] !== "object") + throw TypeError(".google.cloud.networkservices.v1.ListTlsRoutesResponse.tlsRoutes: object expected"); + message.tlsRoutes[i] = $root.google.cloud.networkservices.v1.TlsRoute.fromObject(object.tlsRoutes[i]); + } + } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + return message; + }; + + /** + * Creates a plain object from a ListTlsRoutesResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.networkservices.v1.ListTlsRoutesResponse + * @static + * @param {google.cloud.networkservices.v1.ListTlsRoutesResponse} message ListTlsRoutesResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListTlsRoutesResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.tlsRoutes = []; + if (options.defaults) + object.nextPageToken = ""; + if (message.tlsRoutes && message.tlsRoutes.length) { + object.tlsRoutes = []; + for (var j = 0; j < message.tlsRoutes.length; ++j) + object.tlsRoutes[j] = $root.google.cloud.networkservices.v1.TlsRoute.toObject(message.tlsRoutes[j], options); + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + object.nextPageToken = message.nextPageToken; + return object; + }; + + /** + * Converts this ListTlsRoutesResponse to JSON. + * @function toJSON + * @memberof google.cloud.networkservices.v1.ListTlsRoutesResponse + * @instance + * @returns {Object.} JSON object + */ + ListTlsRoutesResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListTlsRoutesResponse + * @function getTypeUrl + * @memberof google.cloud.networkservices.v1.ListTlsRoutesResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListTlsRoutesResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.networkservices.v1.ListTlsRoutesResponse"; + }; + + return ListTlsRoutesResponse; + })(); + + v1.GetTlsRouteRequest = (function() { + + /** + * Properties of a GetTlsRouteRequest. + * @memberof google.cloud.networkservices.v1 + * @interface IGetTlsRouteRequest + * @property {string|null} [name] GetTlsRouteRequest name + */ + + /** + * Constructs a new GetTlsRouteRequest. + * @memberof google.cloud.networkservices.v1 + * @classdesc Represents a GetTlsRouteRequest. + * @implements IGetTlsRouteRequest + * @constructor + * @param {google.cloud.networkservices.v1.IGetTlsRouteRequest=} [properties] Properties to set + */ + function GetTlsRouteRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetTlsRouteRequest name. + * @member {string} name + * @memberof google.cloud.networkservices.v1.GetTlsRouteRequest + * @instance + */ + GetTlsRouteRequest.prototype.name = ""; + + /** + * Creates a new GetTlsRouteRequest instance using the specified properties. + * @function create + * @memberof google.cloud.networkservices.v1.GetTlsRouteRequest + * @static + * @param {google.cloud.networkservices.v1.IGetTlsRouteRequest=} [properties] Properties to set + * @returns {google.cloud.networkservices.v1.GetTlsRouteRequest} GetTlsRouteRequest instance + */ + GetTlsRouteRequest.create = function create(properties) { + return new GetTlsRouteRequest(properties); + }; + + /** + * Encodes the specified GetTlsRouteRequest message. Does not implicitly {@link google.cloud.networkservices.v1.GetTlsRouteRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.networkservices.v1.GetTlsRouteRequest + * @static + * @param {google.cloud.networkservices.v1.IGetTlsRouteRequest} message GetTlsRouteRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetTlsRouteRequest.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 GetTlsRouteRequest message, length delimited. Does not implicitly {@link google.cloud.networkservices.v1.GetTlsRouteRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.networkservices.v1.GetTlsRouteRequest + * @static + * @param {google.cloud.networkservices.v1.IGetTlsRouteRequest} message GetTlsRouteRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetTlsRouteRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetTlsRouteRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.networkservices.v1.GetTlsRouteRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.networkservices.v1.GetTlsRouteRequest} GetTlsRouteRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetTlsRouteRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.networkservices.v1.GetTlsRouteRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetTlsRouteRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.networkservices.v1.GetTlsRouteRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.networkservices.v1.GetTlsRouteRequest} GetTlsRouteRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetTlsRouteRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetTlsRouteRequest message. + * @function verify + * @memberof google.cloud.networkservices.v1.GetTlsRouteRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetTlsRouteRequest.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 GetTlsRouteRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.networkservices.v1.GetTlsRouteRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.networkservices.v1.GetTlsRouteRequest} GetTlsRouteRequest + */ + GetTlsRouteRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.networkservices.v1.GetTlsRouteRequest) + return object; + var message = new $root.google.cloud.networkservices.v1.GetTlsRouteRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a GetTlsRouteRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.networkservices.v1.GetTlsRouteRequest + * @static + * @param {google.cloud.networkservices.v1.GetTlsRouteRequest} message GetTlsRouteRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetTlsRouteRequest.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 GetTlsRouteRequest to JSON. + * @function toJSON + * @memberof google.cloud.networkservices.v1.GetTlsRouteRequest + * @instance + * @returns {Object.} JSON object + */ + GetTlsRouteRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GetTlsRouteRequest + * @function getTypeUrl + * @memberof google.cloud.networkservices.v1.GetTlsRouteRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GetTlsRouteRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.networkservices.v1.GetTlsRouteRequest"; + }; + + return GetTlsRouteRequest; + })(); + + v1.CreateTlsRouteRequest = (function() { + + /** + * Properties of a CreateTlsRouteRequest. + * @memberof google.cloud.networkservices.v1 + * @interface ICreateTlsRouteRequest + * @property {string|null} [parent] CreateTlsRouteRequest parent + * @property {string|null} [tlsRouteId] CreateTlsRouteRequest tlsRouteId + * @property {google.cloud.networkservices.v1.ITlsRoute|null} [tlsRoute] CreateTlsRouteRequest tlsRoute + */ + + /** + * Constructs a new CreateTlsRouteRequest. + * @memberof google.cloud.networkservices.v1 + * @classdesc Represents a CreateTlsRouteRequest. + * @implements ICreateTlsRouteRequest + * @constructor + * @param {google.cloud.networkservices.v1.ICreateTlsRouteRequest=} [properties] Properties to set + */ + function CreateTlsRouteRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * CreateTlsRouteRequest parent. + * @member {string} parent + * @memberof google.cloud.networkservices.v1.CreateTlsRouteRequest + * @instance + */ + CreateTlsRouteRequest.prototype.parent = ""; + + /** + * CreateTlsRouteRequest tlsRouteId. + * @member {string} tlsRouteId + * @memberof google.cloud.networkservices.v1.CreateTlsRouteRequest + * @instance + */ + CreateTlsRouteRequest.prototype.tlsRouteId = ""; + + /** + * CreateTlsRouteRequest tlsRoute. + * @member {google.cloud.networkservices.v1.ITlsRoute|null|undefined} tlsRoute + * @memberof google.cloud.networkservices.v1.CreateTlsRouteRequest + * @instance + */ + CreateTlsRouteRequest.prototype.tlsRoute = null; + + /** + * Creates a new CreateTlsRouteRequest instance using the specified properties. + * @function create + * @memberof google.cloud.networkservices.v1.CreateTlsRouteRequest + * @static + * @param {google.cloud.networkservices.v1.ICreateTlsRouteRequest=} [properties] Properties to set + * @returns {google.cloud.networkservices.v1.CreateTlsRouteRequest} CreateTlsRouteRequest instance + */ + CreateTlsRouteRequest.create = function create(properties) { + return new CreateTlsRouteRequest(properties); + }; + + /** + * Encodes the specified CreateTlsRouteRequest message. Does not implicitly {@link google.cloud.networkservices.v1.CreateTlsRouteRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.networkservices.v1.CreateTlsRouteRequest + * @static + * @param {google.cloud.networkservices.v1.ICreateTlsRouteRequest} message CreateTlsRouteRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateTlsRouteRequest.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.tlsRouteId != null && Object.hasOwnProperty.call(message, "tlsRouteId")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.tlsRouteId); + if (message.tlsRoute != null && Object.hasOwnProperty.call(message, "tlsRoute")) + $root.google.cloud.networkservices.v1.TlsRoute.encode(message.tlsRoute, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified CreateTlsRouteRequest message, length delimited. Does not implicitly {@link google.cloud.networkservices.v1.CreateTlsRouteRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.networkservices.v1.CreateTlsRouteRequest + * @static + * @param {google.cloud.networkservices.v1.ICreateTlsRouteRequest} message CreateTlsRouteRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateTlsRouteRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CreateTlsRouteRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.networkservices.v1.CreateTlsRouteRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.networkservices.v1.CreateTlsRouteRequest} CreateTlsRouteRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateTlsRouteRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.networkservices.v1.CreateTlsRouteRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.tlsRouteId = reader.string(); + break; + } + case 3: { + message.tlsRoute = $root.google.cloud.networkservices.v1.TlsRoute.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CreateTlsRouteRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.networkservices.v1.CreateTlsRouteRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.networkservices.v1.CreateTlsRouteRequest} CreateTlsRouteRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateTlsRouteRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CreateTlsRouteRequest message. + * @function verify + * @memberof google.cloud.networkservices.v1.CreateTlsRouteRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CreateTlsRouteRequest.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.tlsRouteId != null && message.hasOwnProperty("tlsRouteId")) + if (!$util.isString(message.tlsRouteId)) + return "tlsRouteId: string expected"; + if (message.tlsRoute != null && message.hasOwnProperty("tlsRoute")) { + var error = $root.google.cloud.networkservices.v1.TlsRoute.verify(message.tlsRoute); + if (error) + return "tlsRoute." + error; + } + return null; + }; + + /** + * Creates a CreateTlsRouteRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.networkservices.v1.CreateTlsRouteRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.networkservices.v1.CreateTlsRouteRequest} CreateTlsRouteRequest + */ + CreateTlsRouteRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.networkservices.v1.CreateTlsRouteRequest) + return object; + var message = new $root.google.cloud.networkservices.v1.CreateTlsRouteRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.tlsRouteId != null) + message.tlsRouteId = String(object.tlsRouteId); + if (object.tlsRoute != null) { + if (typeof object.tlsRoute !== "object") + throw TypeError(".google.cloud.networkservices.v1.CreateTlsRouteRequest.tlsRoute: object expected"); + message.tlsRoute = $root.google.cloud.networkservices.v1.TlsRoute.fromObject(object.tlsRoute); + } + return message; + }; + + /** + * Creates a plain object from a CreateTlsRouteRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.networkservices.v1.CreateTlsRouteRequest + * @static + * @param {google.cloud.networkservices.v1.CreateTlsRouteRequest} message CreateTlsRouteRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CreateTlsRouteRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.tlsRouteId = ""; + object.tlsRoute = null; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.tlsRouteId != null && message.hasOwnProperty("tlsRouteId")) + object.tlsRouteId = message.tlsRouteId; + if (message.tlsRoute != null && message.hasOwnProperty("tlsRoute")) + object.tlsRoute = $root.google.cloud.networkservices.v1.TlsRoute.toObject(message.tlsRoute, options); + return object; + }; + + /** + * Converts this CreateTlsRouteRequest to JSON. + * @function toJSON + * @memberof google.cloud.networkservices.v1.CreateTlsRouteRequest + * @instance + * @returns {Object.} JSON object + */ + CreateTlsRouteRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CreateTlsRouteRequest + * @function getTypeUrl + * @memberof google.cloud.networkservices.v1.CreateTlsRouteRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CreateTlsRouteRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.networkservices.v1.CreateTlsRouteRequest"; + }; + + return CreateTlsRouteRequest; + })(); + + v1.UpdateTlsRouteRequest = (function() { + + /** + * Properties of an UpdateTlsRouteRequest. + * @memberof google.cloud.networkservices.v1 + * @interface IUpdateTlsRouteRequest + * @property {google.protobuf.IFieldMask|null} [updateMask] UpdateTlsRouteRequest updateMask + * @property {google.cloud.networkservices.v1.ITlsRoute|null} [tlsRoute] UpdateTlsRouteRequest tlsRoute + */ + + /** + * Constructs a new UpdateTlsRouteRequest. + * @memberof google.cloud.networkservices.v1 + * @classdesc Represents an UpdateTlsRouteRequest. + * @implements IUpdateTlsRouteRequest + * @constructor + * @param {google.cloud.networkservices.v1.IUpdateTlsRouteRequest=} [properties] Properties to set + */ + function UpdateTlsRouteRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * UpdateTlsRouteRequest updateMask. + * @member {google.protobuf.IFieldMask|null|undefined} updateMask + * @memberof google.cloud.networkservices.v1.UpdateTlsRouteRequest + * @instance + */ + UpdateTlsRouteRequest.prototype.updateMask = null; + + /** + * UpdateTlsRouteRequest tlsRoute. + * @member {google.cloud.networkservices.v1.ITlsRoute|null|undefined} tlsRoute + * @memberof google.cloud.networkservices.v1.UpdateTlsRouteRequest + * @instance + */ + UpdateTlsRouteRequest.prototype.tlsRoute = null; + + /** + * Creates a new UpdateTlsRouteRequest instance using the specified properties. + * @function create + * @memberof google.cloud.networkservices.v1.UpdateTlsRouteRequest + * @static + * @param {google.cloud.networkservices.v1.IUpdateTlsRouteRequest=} [properties] Properties to set + * @returns {google.cloud.networkservices.v1.UpdateTlsRouteRequest} UpdateTlsRouteRequest instance + */ + UpdateTlsRouteRequest.create = function create(properties) { + return new UpdateTlsRouteRequest(properties); + }; + + /** + * Encodes the specified UpdateTlsRouteRequest message. Does not implicitly {@link google.cloud.networkservices.v1.UpdateTlsRouteRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.networkservices.v1.UpdateTlsRouteRequest + * @static + * @param {google.cloud.networkservices.v1.IUpdateTlsRouteRequest} message UpdateTlsRouteRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateTlsRouteRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.updateMask != null && Object.hasOwnProperty.call(message, "updateMask")) + $root.google.protobuf.FieldMask.encode(message.updateMask, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.tlsRoute != null && Object.hasOwnProperty.call(message, "tlsRoute")) + $root.google.cloud.networkservices.v1.TlsRoute.encode(message.tlsRoute, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified UpdateTlsRouteRequest message, length delimited. Does not implicitly {@link google.cloud.networkservices.v1.UpdateTlsRouteRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.networkservices.v1.UpdateTlsRouteRequest + * @static + * @param {google.cloud.networkservices.v1.IUpdateTlsRouteRequest} message UpdateTlsRouteRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateTlsRouteRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an UpdateTlsRouteRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.networkservices.v1.UpdateTlsRouteRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.networkservices.v1.UpdateTlsRouteRequest} UpdateTlsRouteRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateTlsRouteRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.networkservices.v1.UpdateTlsRouteRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.updateMask = $root.google.protobuf.FieldMask.decode(reader, reader.uint32()); + break; + } + case 2: { + message.tlsRoute = $root.google.cloud.networkservices.v1.TlsRoute.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an UpdateTlsRouteRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.networkservices.v1.UpdateTlsRouteRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.networkservices.v1.UpdateTlsRouteRequest} UpdateTlsRouteRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateTlsRouteRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an UpdateTlsRouteRequest message. + * @function verify + * @memberof google.cloud.networkservices.v1.UpdateTlsRouteRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + UpdateTlsRouteRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.updateMask != null && message.hasOwnProperty("updateMask")) { + var error = $root.google.protobuf.FieldMask.verify(message.updateMask); + if (error) + return "updateMask." + error; + } + if (message.tlsRoute != null && message.hasOwnProperty("tlsRoute")) { + var error = $root.google.cloud.networkservices.v1.TlsRoute.verify(message.tlsRoute); + if (error) + return "tlsRoute." + error; + } + return null; + }; + + /** + * Creates an UpdateTlsRouteRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.networkservices.v1.UpdateTlsRouteRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.networkservices.v1.UpdateTlsRouteRequest} UpdateTlsRouteRequest + */ + UpdateTlsRouteRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.networkservices.v1.UpdateTlsRouteRequest) + return object; + var message = new $root.google.cloud.networkservices.v1.UpdateTlsRouteRequest(); + if (object.updateMask != null) { + if (typeof object.updateMask !== "object") + throw TypeError(".google.cloud.networkservices.v1.UpdateTlsRouteRequest.updateMask: object expected"); + message.updateMask = $root.google.protobuf.FieldMask.fromObject(object.updateMask); + } + if (object.tlsRoute != null) { + if (typeof object.tlsRoute !== "object") + throw TypeError(".google.cloud.networkservices.v1.UpdateTlsRouteRequest.tlsRoute: object expected"); + message.tlsRoute = $root.google.cloud.networkservices.v1.TlsRoute.fromObject(object.tlsRoute); + } + return message; + }; + + /** + * Creates a plain object from an UpdateTlsRouteRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.networkservices.v1.UpdateTlsRouteRequest + * @static + * @param {google.cloud.networkservices.v1.UpdateTlsRouteRequest} message UpdateTlsRouteRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + UpdateTlsRouteRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.updateMask = null; + object.tlsRoute = null; + } + if (message.updateMask != null && message.hasOwnProperty("updateMask")) + object.updateMask = $root.google.protobuf.FieldMask.toObject(message.updateMask, options); + if (message.tlsRoute != null && message.hasOwnProperty("tlsRoute")) + object.tlsRoute = $root.google.cloud.networkservices.v1.TlsRoute.toObject(message.tlsRoute, options); + return object; + }; + + /** + * Converts this UpdateTlsRouteRequest to JSON. + * @function toJSON + * @memberof google.cloud.networkservices.v1.UpdateTlsRouteRequest + * @instance + * @returns {Object.} JSON object + */ + UpdateTlsRouteRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for UpdateTlsRouteRequest + * @function getTypeUrl + * @memberof google.cloud.networkservices.v1.UpdateTlsRouteRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + UpdateTlsRouteRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.networkservices.v1.UpdateTlsRouteRequest"; + }; + + return UpdateTlsRouteRequest; + })(); + + v1.DeleteTlsRouteRequest = (function() { + + /** + * Properties of a DeleteTlsRouteRequest. + * @memberof google.cloud.networkservices.v1 + * @interface IDeleteTlsRouteRequest + * @property {string|null} [name] DeleteTlsRouteRequest name + */ + + /** + * Constructs a new DeleteTlsRouteRequest. + * @memberof google.cloud.networkservices.v1 + * @classdesc Represents a DeleteTlsRouteRequest. + * @implements IDeleteTlsRouteRequest + * @constructor + * @param {google.cloud.networkservices.v1.IDeleteTlsRouteRequest=} [properties] Properties to set + */ + function DeleteTlsRouteRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * DeleteTlsRouteRequest name. + * @member {string} name + * @memberof google.cloud.networkservices.v1.DeleteTlsRouteRequest + * @instance + */ + DeleteTlsRouteRequest.prototype.name = ""; + + /** + * Creates a new DeleteTlsRouteRequest instance using the specified properties. + * @function create + * @memberof google.cloud.networkservices.v1.DeleteTlsRouteRequest + * @static + * @param {google.cloud.networkservices.v1.IDeleteTlsRouteRequest=} [properties] Properties to set + * @returns {google.cloud.networkservices.v1.DeleteTlsRouteRequest} DeleteTlsRouteRequest instance + */ + DeleteTlsRouteRequest.create = function create(properties) { + return new DeleteTlsRouteRequest(properties); + }; + + /** + * Encodes the specified DeleteTlsRouteRequest message. Does not implicitly {@link google.cloud.networkservices.v1.DeleteTlsRouteRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.networkservices.v1.DeleteTlsRouteRequest + * @static + * @param {google.cloud.networkservices.v1.IDeleteTlsRouteRequest} message DeleteTlsRouteRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteTlsRouteRequest.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 DeleteTlsRouteRequest message, length delimited. Does not implicitly {@link google.cloud.networkservices.v1.DeleteTlsRouteRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.networkservices.v1.DeleteTlsRouteRequest + * @static + * @param {google.cloud.networkservices.v1.IDeleteTlsRouteRequest} message DeleteTlsRouteRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteTlsRouteRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DeleteTlsRouteRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.networkservices.v1.DeleteTlsRouteRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.networkservices.v1.DeleteTlsRouteRequest} DeleteTlsRouteRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteTlsRouteRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.networkservices.v1.DeleteTlsRouteRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DeleteTlsRouteRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.networkservices.v1.DeleteTlsRouteRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.networkservices.v1.DeleteTlsRouteRequest} DeleteTlsRouteRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteTlsRouteRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DeleteTlsRouteRequest message. + * @function verify + * @memberof google.cloud.networkservices.v1.DeleteTlsRouteRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DeleteTlsRouteRequest.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 DeleteTlsRouteRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.networkservices.v1.DeleteTlsRouteRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.networkservices.v1.DeleteTlsRouteRequest} DeleteTlsRouteRequest + */ + DeleteTlsRouteRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.networkservices.v1.DeleteTlsRouteRequest) + return object; + var message = new $root.google.cloud.networkservices.v1.DeleteTlsRouteRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a DeleteTlsRouteRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.networkservices.v1.DeleteTlsRouteRequest + * @static + * @param {google.cloud.networkservices.v1.DeleteTlsRouteRequest} message DeleteTlsRouteRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DeleteTlsRouteRequest.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 DeleteTlsRouteRequest to JSON. + * @function toJSON + * @memberof google.cloud.networkservices.v1.DeleteTlsRouteRequest + * @instance + * @returns {Object.} JSON object + */ + DeleteTlsRouteRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DeleteTlsRouteRequest + * @function getTypeUrl + * @memberof google.cloud.networkservices.v1.DeleteTlsRouteRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DeleteTlsRouteRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.networkservices.v1.DeleteTlsRouteRequest"; + }; + + return DeleteTlsRouteRequest; + })(); + + return v1; + })(); + + networkservices.v1beta1 = (function() { + + /** + * Namespace v1beta1. + * @memberof google.cloud.networkservices + * @namespace + */ + var v1beta1 = {}; + + v1beta1.OperationMetadata = (function() { + + /** + * Properties of an OperationMetadata. + * @memberof google.cloud.networkservices.v1beta1 + * @interface IOperationMetadata + * @property {google.protobuf.ITimestamp|null} [createTime] OperationMetadata createTime + * @property {google.protobuf.ITimestamp|null} [endTime] OperationMetadata endTime + * @property {string|null} [target] OperationMetadata target + * @property {string|null} [verb] OperationMetadata verb + * @property {string|null} [statusMessage] OperationMetadata statusMessage + * @property {boolean|null} [requestedCancellation] OperationMetadata requestedCancellation + * @property {string|null} [apiVersion] OperationMetadata apiVersion + */ + + /** + * Constructs a new OperationMetadata. + * @memberof google.cloud.networkservices.v1beta1 + * @classdesc Represents an OperationMetadata. + * @implements IOperationMetadata + * @constructor + * @param {google.cloud.networkservices.v1beta1.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.networkservices.v1beta1.OperationMetadata + * @instance + */ + OperationMetadata.prototype.createTime = null; + + /** + * OperationMetadata endTime. + * @member {google.protobuf.ITimestamp|null|undefined} endTime + * @memberof google.cloud.networkservices.v1beta1.OperationMetadata + * @instance + */ + OperationMetadata.prototype.endTime = null; + + /** + * OperationMetadata target. + * @member {string} target + * @memberof google.cloud.networkservices.v1beta1.OperationMetadata + * @instance + */ + OperationMetadata.prototype.target = ""; + + /** + * OperationMetadata verb. + * @member {string} verb + * @memberof google.cloud.networkservices.v1beta1.OperationMetadata + * @instance + */ + OperationMetadata.prototype.verb = ""; + + /** + * OperationMetadata statusMessage. + * @member {string} statusMessage + * @memberof google.cloud.networkservices.v1beta1.OperationMetadata + * @instance + */ + OperationMetadata.prototype.statusMessage = ""; + + /** + * OperationMetadata requestedCancellation. + * @member {boolean} requestedCancellation + * @memberof google.cloud.networkservices.v1beta1.OperationMetadata + * @instance + */ + OperationMetadata.prototype.requestedCancellation = false; + + /** + * OperationMetadata apiVersion. + * @member {string} apiVersion + * @memberof google.cloud.networkservices.v1beta1.OperationMetadata + * @instance + */ + OperationMetadata.prototype.apiVersion = ""; + + /** + * Creates a new OperationMetadata instance using the specified properties. + * @function create + * @memberof google.cloud.networkservices.v1beta1.OperationMetadata + * @static + * @param {google.cloud.networkservices.v1beta1.IOperationMetadata=} [properties] Properties to set + * @returns {google.cloud.networkservices.v1beta1.OperationMetadata} OperationMetadata instance + */ + OperationMetadata.create = function create(properties) { + return new OperationMetadata(properties); + }; + + /** + * Encodes the specified OperationMetadata message. Does not implicitly {@link google.cloud.networkservices.v1beta1.OperationMetadata.verify|verify} messages. + * @function encode + * @memberof google.cloud.networkservices.v1beta1.OperationMetadata + * @static + * @param {google.cloud.networkservices.v1beta1.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.endTime != null && Object.hasOwnProperty.call(message, "endTime")) + $root.google.protobuf.Timestamp.encode(message.endTime, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.target != null && Object.hasOwnProperty.call(message, "target")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.target); + if (message.verb != null && Object.hasOwnProperty.call(message, "verb")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.verb); + if (message.statusMessage != null && Object.hasOwnProperty.call(message, "statusMessage")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.statusMessage); + if (message.requestedCancellation != null && Object.hasOwnProperty.call(message, "requestedCancellation")) + writer.uint32(/* id 6, wireType 0 =*/48).bool(message.requestedCancellation); + if (message.apiVersion != null && Object.hasOwnProperty.call(message, "apiVersion")) + writer.uint32(/* id 7, wireType 2 =*/58).string(message.apiVersion); + return writer; + }; + + /** + * Encodes the specified OperationMetadata message, length delimited. Does not implicitly {@link google.cloud.networkservices.v1beta1.OperationMetadata.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.networkservices.v1beta1.OperationMetadata + * @static + * @param {google.cloud.networkservices.v1beta1.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.networkservices.v1beta1.OperationMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.networkservices.v1beta1.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) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.networkservices.v1beta1.OperationMetadata(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.createTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 2: { + message.endTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 3: { + message.target = reader.string(); + break; + } + case 4: { + message.verb = reader.string(); + break; + } + case 5: { + message.statusMessage = reader.string(); + break; + } + case 6: { + message.requestedCancellation = reader.bool(); + break; + } + case 7: { + message.apiVersion = reader.string(); + 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.networkservices.v1beta1.OperationMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.networkservices.v1beta1.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.networkservices.v1beta1.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"; + if (message.createTime != null && message.hasOwnProperty("createTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.createTime); + if (error) + return "createTime." + error; + } + if (message.endTime != null && message.hasOwnProperty("endTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.endTime); + if (error) + return "endTime." + error; + } + if (message.target != null && message.hasOwnProperty("target")) + if (!$util.isString(message.target)) + return "target: string expected"; + if (message.verb != null && message.hasOwnProperty("verb")) + if (!$util.isString(message.verb)) + return "verb: string expected"; + if (message.statusMessage != null && message.hasOwnProperty("statusMessage")) + if (!$util.isString(message.statusMessage)) + return "statusMessage: string expected"; + if (message.requestedCancellation != null && message.hasOwnProperty("requestedCancellation")) + if (typeof message.requestedCancellation !== "boolean") + return "requestedCancellation: boolean expected"; + if (message.apiVersion != null && message.hasOwnProperty("apiVersion")) + if (!$util.isString(message.apiVersion)) + return "apiVersion: string expected"; + return null; + }; + + /** + * Creates an OperationMetadata message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.networkservices.v1beta1.OperationMetadata + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.networkservices.v1beta1.OperationMetadata} OperationMetadata + */ + OperationMetadata.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.networkservices.v1beta1.OperationMetadata) + return object; + var message = new $root.google.cloud.networkservices.v1beta1.OperationMetadata(); + if (object.createTime != null) { + if (typeof object.createTime !== "object") + throw TypeError(".google.cloud.networkservices.v1beta1.OperationMetadata.createTime: object expected"); + message.createTime = $root.google.protobuf.Timestamp.fromObject(object.createTime); + } + if (object.endTime != null) { + if (typeof object.endTime !== "object") + throw TypeError(".google.cloud.networkservices.v1beta1.OperationMetadata.endTime: object expected"); + message.endTime = $root.google.protobuf.Timestamp.fromObject(object.endTime); + } + if (object.target != null) + message.target = String(object.target); + if (object.verb != null) + message.verb = String(object.verb); + if (object.statusMessage != null) + message.statusMessage = String(object.statusMessage); + if (object.requestedCancellation != null) + message.requestedCancellation = Boolean(object.requestedCancellation); + if (object.apiVersion != null) + message.apiVersion = String(object.apiVersion); + return message; + }; + + /** + * Creates a plain object from an OperationMetadata message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.networkservices.v1beta1.OperationMetadata + * @static + * @param {google.cloud.networkservices.v1beta1.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.endTime = null; + object.target = ""; + object.verb = ""; + object.statusMessage = ""; + object.requestedCancellation = false; + object.apiVersion = ""; + } + if (message.createTime != null && message.hasOwnProperty("createTime")) + object.createTime = $root.google.protobuf.Timestamp.toObject(message.createTime, options); + if (message.endTime != null && message.hasOwnProperty("endTime")) + object.endTime = $root.google.protobuf.Timestamp.toObject(message.endTime, options); + if (message.target != null && message.hasOwnProperty("target")) + object.target = message.target; + if (message.verb != null && message.hasOwnProperty("verb")) + object.verb = message.verb; + if (message.statusMessage != null && message.hasOwnProperty("statusMessage")) + object.statusMessage = message.statusMessage; + if (message.requestedCancellation != null && message.hasOwnProperty("requestedCancellation")) + object.requestedCancellation = message.requestedCancellation; + if (message.apiVersion != null && message.hasOwnProperty("apiVersion")) + object.apiVersion = message.apiVersion; + return object; + }; + + /** + * Converts this OperationMetadata to JSON. + * @function toJSON + * @memberof google.cloud.networkservices.v1beta1.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.networkservices.v1beta1.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.networkservices.v1beta1.OperationMetadata"; + }; + + return OperationMetadata; + })(); + + v1beta1.TrafficPortSelector = (function() { + + /** + * Properties of a TrafficPortSelector. + * @memberof google.cloud.networkservices.v1beta1 + * @interface ITrafficPortSelector + * @property {Array.|null} [ports] TrafficPortSelector ports + */ + + /** + * Constructs a new TrafficPortSelector. + * @memberof google.cloud.networkservices.v1beta1 + * @classdesc Represents a TrafficPortSelector. + * @implements ITrafficPortSelector + * @constructor + * @param {google.cloud.networkservices.v1beta1.ITrafficPortSelector=} [properties] Properties to set + */ + function TrafficPortSelector(properties) { + this.ports = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * TrafficPortSelector ports. + * @member {Array.} ports + * @memberof google.cloud.networkservices.v1beta1.TrafficPortSelector + * @instance + */ + TrafficPortSelector.prototype.ports = $util.emptyArray; + + /** + * Creates a new TrafficPortSelector instance using the specified properties. + * @function create + * @memberof google.cloud.networkservices.v1beta1.TrafficPortSelector + * @static + * @param {google.cloud.networkservices.v1beta1.ITrafficPortSelector=} [properties] Properties to set + * @returns {google.cloud.networkservices.v1beta1.TrafficPortSelector} TrafficPortSelector instance + */ + TrafficPortSelector.create = function create(properties) { + return new TrafficPortSelector(properties); + }; + + /** + * Encodes the specified TrafficPortSelector message. Does not implicitly {@link google.cloud.networkservices.v1beta1.TrafficPortSelector.verify|verify} messages. + * @function encode + * @memberof google.cloud.networkservices.v1beta1.TrafficPortSelector + * @static + * @param {google.cloud.networkservices.v1beta1.ITrafficPortSelector} message TrafficPortSelector message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TrafficPortSelector.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.ports != null && message.ports.length) + for (var i = 0; i < message.ports.length; ++i) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.ports[i]); + return writer; + }; + + /** + * Encodes the specified TrafficPortSelector message, length delimited. Does not implicitly {@link google.cloud.networkservices.v1beta1.TrafficPortSelector.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.networkservices.v1beta1.TrafficPortSelector + * @static + * @param {google.cloud.networkservices.v1beta1.ITrafficPortSelector} message TrafficPortSelector message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TrafficPortSelector.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a TrafficPortSelector message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.networkservices.v1beta1.TrafficPortSelector + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.networkservices.v1beta1.TrafficPortSelector} TrafficPortSelector + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TrafficPortSelector.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.networkservices.v1beta1.TrafficPortSelector(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.ports && message.ports.length)) + message.ports = []; + message.ports.push(reader.string()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a TrafficPortSelector message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.networkservices.v1beta1.TrafficPortSelector + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.networkservices.v1beta1.TrafficPortSelector} TrafficPortSelector + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TrafficPortSelector.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a TrafficPortSelector message. + * @function verify + * @memberof google.cloud.networkservices.v1beta1.TrafficPortSelector + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + TrafficPortSelector.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.ports != null && message.hasOwnProperty("ports")) { + if (!Array.isArray(message.ports)) + return "ports: array expected"; + for (var i = 0; i < message.ports.length; ++i) + if (!$util.isString(message.ports[i])) + return "ports: string[] expected"; + } + return null; + }; + + /** + * Creates a TrafficPortSelector message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.networkservices.v1beta1.TrafficPortSelector + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.networkservices.v1beta1.TrafficPortSelector} TrafficPortSelector + */ + TrafficPortSelector.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.networkservices.v1beta1.TrafficPortSelector) + return object; + var message = new $root.google.cloud.networkservices.v1beta1.TrafficPortSelector(); + if (object.ports) { + if (!Array.isArray(object.ports)) + throw TypeError(".google.cloud.networkservices.v1beta1.TrafficPortSelector.ports: array expected"); + message.ports = []; + for (var i = 0; i < object.ports.length; ++i) + message.ports[i] = String(object.ports[i]); + } + return message; + }; + + /** + * Creates a plain object from a TrafficPortSelector message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.networkservices.v1beta1.TrafficPortSelector + * @static + * @param {google.cloud.networkservices.v1beta1.TrafficPortSelector} message TrafficPortSelector + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + TrafficPortSelector.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.ports = []; + if (message.ports && message.ports.length) { + object.ports = []; + for (var j = 0; j < message.ports.length; ++j) + object.ports[j] = message.ports[j]; + } + return object; + }; + + /** + * Converts this TrafficPortSelector to JSON. + * @function toJSON + * @memberof google.cloud.networkservices.v1beta1.TrafficPortSelector + * @instance + * @returns {Object.} JSON object + */ + TrafficPortSelector.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for TrafficPortSelector + * @function getTypeUrl + * @memberof google.cloud.networkservices.v1beta1.TrafficPortSelector + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TrafficPortSelector.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.networkservices.v1beta1.TrafficPortSelector"; + }; + + return TrafficPortSelector; + })(); + + v1beta1.EndpointMatcher = (function() { + + /** + * Properties of an EndpointMatcher. + * @memberof google.cloud.networkservices.v1beta1 + * @interface IEndpointMatcher + * @property {google.cloud.networkservices.v1beta1.EndpointMatcher.IMetadataLabelMatcher|null} [metadataLabelMatcher] EndpointMatcher metadataLabelMatcher + */ + + /** + * Constructs a new EndpointMatcher. + * @memberof google.cloud.networkservices.v1beta1 + * @classdesc Represents an EndpointMatcher. + * @implements IEndpointMatcher + * @constructor + * @param {google.cloud.networkservices.v1beta1.IEndpointMatcher=} [properties] Properties to set + */ + function EndpointMatcher(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * EndpointMatcher metadataLabelMatcher. + * @member {google.cloud.networkservices.v1beta1.EndpointMatcher.IMetadataLabelMatcher|null|undefined} metadataLabelMatcher + * @memberof google.cloud.networkservices.v1beta1.EndpointMatcher + * @instance + */ + EndpointMatcher.prototype.metadataLabelMatcher = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * EndpointMatcher matcherType. + * @member {"metadataLabelMatcher"|undefined} matcherType + * @memberof google.cloud.networkservices.v1beta1.EndpointMatcher + * @instance + */ + Object.defineProperty(EndpointMatcher.prototype, "matcherType", { + get: $util.oneOfGetter($oneOfFields = ["metadataLabelMatcher"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new EndpointMatcher instance using the specified properties. + * @function create + * @memberof google.cloud.networkservices.v1beta1.EndpointMatcher + * @static + * @param {google.cloud.networkservices.v1beta1.IEndpointMatcher=} [properties] Properties to set + * @returns {google.cloud.networkservices.v1beta1.EndpointMatcher} EndpointMatcher instance + */ + EndpointMatcher.create = function create(properties) { + return new EndpointMatcher(properties); + }; + + /** + * Encodes the specified EndpointMatcher message. Does not implicitly {@link google.cloud.networkservices.v1beta1.EndpointMatcher.verify|verify} messages. + * @function encode + * @memberof google.cloud.networkservices.v1beta1.EndpointMatcher + * @static + * @param {google.cloud.networkservices.v1beta1.IEndpointMatcher} message EndpointMatcher message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EndpointMatcher.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.metadataLabelMatcher != null && Object.hasOwnProperty.call(message, "metadataLabelMatcher")) + $root.google.cloud.networkservices.v1beta1.EndpointMatcher.MetadataLabelMatcher.encode(message.metadataLabelMatcher, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified EndpointMatcher message, length delimited. Does not implicitly {@link google.cloud.networkservices.v1beta1.EndpointMatcher.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.networkservices.v1beta1.EndpointMatcher + * @static + * @param {google.cloud.networkservices.v1beta1.IEndpointMatcher} message EndpointMatcher message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EndpointMatcher.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an EndpointMatcher message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.networkservices.v1beta1.EndpointMatcher + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.networkservices.v1beta1.EndpointMatcher} EndpointMatcher + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EndpointMatcher.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.networkservices.v1beta1.EndpointMatcher(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.metadataLabelMatcher = $root.google.cloud.networkservices.v1beta1.EndpointMatcher.MetadataLabelMatcher.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an EndpointMatcher message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.networkservices.v1beta1.EndpointMatcher + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.networkservices.v1beta1.EndpointMatcher} EndpointMatcher + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EndpointMatcher.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an EndpointMatcher message. + * @function verify + * @memberof google.cloud.networkservices.v1beta1.EndpointMatcher + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + EndpointMatcher.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.metadataLabelMatcher != null && message.hasOwnProperty("metadataLabelMatcher")) { + properties.matcherType = 1; + { + var error = $root.google.cloud.networkservices.v1beta1.EndpointMatcher.MetadataLabelMatcher.verify(message.metadataLabelMatcher); + if (error) + return "metadataLabelMatcher." + error; + } + } + return null; + }; + + /** + * Creates an EndpointMatcher message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.networkservices.v1beta1.EndpointMatcher + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.networkservices.v1beta1.EndpointMatcher} EndpointMatcher + */ + EndpointMatcher.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.networkservices.v1beta1.EndpointMatcher) + return object; + var message = new $root.google.cloud.networkservices.v1beta1.EndpointMatcher(); + if (object.metadataLabelMatcher != null) { + if (typeof object.metadataLabelMatcher !== "object") + throw TypeError(".google.cloud.networkservices.v1beta1.EndpointMatcher.metadataLabelMatcher: object expected"); + message.metadataLabelMatcher = $root.google.cloud.networkservices.v1beta1.EndpointMatcher.MetadataLabelMatcher.fromObject(object.metadataLabelMatcher); + } + return message; + }; + + /** + * Creates a plain object from an EndpointMatcher message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.networkservices.v1beta1.EndpointMatcher + * @static + * @param {google.cloud.networkservices.v1beta1.EndpointMatcher} message EndpointMatcher + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + EndpointMatcher.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.metadataLabelMatcher != null && message.hasOwnProperty("metadataLabelMatcher")) { + object.metadataLabelMatcher = $root.google.cloud.networkservices.v1beta1.EndpointMatcher.MetadataLabelMatcher.toObject(message.metadataLabelMatcher, options); + if (options.oneofs) + object.matcherType = "metadataLabelMatcher"; + } + return object; + }; + + /** + * Converts this EndpointMatcher to JSON. + * @function toJSON + * @memberof google.cloud.networkservices.v1beta1.EndpointMatcher + * @instance + * @returns {Object.} JSON object + */ + EndpointMatcher.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for EndpointMatcher + * @function getTypeUrl + * @memberof google.cloud.networkservices.v1beta1.EndpointMatcher + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + EndpointMatcher.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.networkservices.v1beta1.EndpointMatcher"; + }; + + EndpointMatcher.MetadataLabelMatcher = (function() { + + /** + * Properties of a MetadataLabelMatcher. + * @memberof google.cloud.networkservices.v1beta1.EndpointMatcher + * @interface IMetadataLabelMatcher + * @property {google.cloud.networkservices.v1beta1.EndpointMatcher.MetadataLabelMatcher.MetadataLabelMatchCriteria|null} [metadataLabelMatchCriteria] MetadataLabelMatcher metadataLabelMatchCriteria + * @property {Array.|null} [metadataLabels] MetadataLabelMatcher metadataLabels + */ + + /** + * Constructs a new MetadataLabelMatcher. + * @memberof google.cloud.networkservices.v1beta1.EndpointMatcher + * @classdesc Represents a MetadataLabelMatcher. + * @implements IMetadataLabelMatcher + * @constructor + * @param {google.cloud.networkservices.v1beta1.EndpointMatcher.IMetadataLabelMatcher=} [properties] Properties to set + */ + function MetadataLabelMatcher(properties) { + this.metadataLabels = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * MetadataLabelMatcher metadataLabelMatchCriteria. + * @member {google.cloud.networkservices.v1beta1.EndpointMatcher.MetadataLabelMatcher.MetadataLabelMatchCriteria} metadataLabelMatchCriteria + * @memberof google.cloud.networkservices.v1beta1.EndpointMatcher.MetadataLabelMatcher + * @instance + */ + MetadataLabelMatcher.prototype.metadataLabelMatchCriteria = 0; + + /** + * MetadataLabelMatcher metadataLabels. + * @member {Array.} metadataLabels + * @memberof google.cloud.networkservices.v1beta1.EndpointMatcher.MetadataLabelMatcher + * @instance + */ + MetadataLabelMatcher.prototype.metadataLabels = $util.emptyArray; + + /** + * Creates a new MetadataLabelMatcher instance using the specified properties. + * @function create + * @memberof google.cloud.networkservices.v1beta1.EndpointMatcher.MetadataLabelMatcher + * @static + * @param {google.cloud.networkservices.v1beta1.EndpointMatcher.IMetadataLabelMatcher=} [properties] Properties to set + * @returns {google.cloud.networkservices.v1beta1.EndpointMatcher.MetadataLabelMatcher} MetadataLabelMatcher instance + */ + MetadataLabelMatcher.create = function create(properties) { + return new MetadataLabelMatcher(properties); + }; + + /** + * Encodes the specified MetadataLabelMatcher message. Does not implicitly {@link google.cloud.networkservices.v1beta1.EndpointMatcher.MetadataLabelMatcher.verify|verify} messages. + * @function encode + * @memberof google.cloud.networkservices.v1beta1.EndpointMatcher.MetadataLabelMatcher + * @static + * @param {google.cloud.networkservices.v1beta1.EndpointMatcher.IMetadataLabelMatcher} message MetadataLabelMatcher message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MetadataLabelMatcher.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.metadataLabelMatchCriteria != null && Object.hasOwnProperty.call(message, "metadataLabelMatchCriteria")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.metadataLabelMatchCriteria); + if (message.metadataLabels != null && message.metadataLabels.length) + for (var i = 0; i < message.metadataLabels.length; ++i) + $root.google.cloud.networkservices.v1beta1.EndpointMatcher.MetadataLabelMatcher.MetadataLabels.encode(message.metadataLabels[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified MetadataLabelMatcher message, length delimited. Does not implicitly {@link google.cloud.networkservices.v1beta1.EndpointMatcher.MetadataLabelMatcher.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.networkservices.v1beta1.EndpointMatcher.MetadataLabelMatcher + * @static + * @param {google.cloud.networkservices.v1beta1.EndpointMatcher.IMetadataLabelMatcher} message MetadataLabelMatcher message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MetadataLabelMatcher.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a MetadataLabelMatcher message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.networkservices.v1beta1.EndpointMatcher.MetadataLabelMatcher + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.networkservices.v1beta1.EndpointMatcher.MetadataLabelMatcher} MetadataLabelMatcher + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MetadataLabelMatcher.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.networkservices.v1beta1.EndpointMatcher.MetadataLabelMatcher(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.metadataLabelMatchCriteria = reader.int32(); + break; + } + case 2: { + if (!(message.metadataLabels && message.metadataLabels.length)) + message.metadataLabels = []; + message.metadataLabels.push($root.google.cloud.networkservices.v1beta1.EndpointMatcher.MetadataLabelMatcher.MetadataLabels.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a MetadataLabelMatcher message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.networkservices.v1beta1.EndpointMatcher.MetadataLabelMatcher + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.networkservices.v1beta1.EndpointMatcher.MetadataLabelMatcher} MetadataLabelMatcher + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MetadataLabelMatcher.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a MetadataLabelMatcher message. + * @function verify + * @memberof google.cloud.networkservices.v1beta1.EndpointMatcher.MetadataLabelMatcher + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + MetadataLabelMatcher.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.metadataLabelMatchCriteria != null && message.hasOwnProperty("metadataLabelMatchCriteria")) + switch (message.metadataLabelMatchCriteria) { + default: + return "metadataLabelMatchCriteria: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.metadataLabels != null && message.hasOwnProperty("metadataLabels")) { + if (!Array.isArray(message.metadataLabels)) + return "metadataLabels: array expected"; + for (var i = 0; i < message.metadataLabels.length; ++i) { + var error = $root.google.cloud.networkservices.v1beta1.EndpointMatcher.MetadataLabelMatcher.MetadataLabels.verify(message.metadataLabels[i]); + if (error) + return "metadataLabels." + error; + } + } + return null; + }; + + /** + * Creates a MetadataLabelMatcher message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.networkservices.v1beta1.EndpointMatcher.MetadataLabelMatcher + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.networkservices.v1beta1.EndpointMatcher.MetadataLabelMatcher} MetadataLabelMatcher + */ + MetadataLabelMatcher.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.networkservices.v1beta1.EndpointMatcher.MetadataLabelMatcher) + return object; + var message = new $root.google.cloud.networkservices.v1beta1.EndpointMatcher.MetadataLabelMatcher(); + switch (object.metadataLabelMatchCriteria) { + default: + if (typeof object.metadataLabelMatchCriteria === "number") { + message.metadataLabelMatchCriteria = object.metadataLabelMatchCriteria; + break; + } + break; + case "METADATA_LABEL_MATCH_CRITERIA_UNSPECIFIED": + case 0: + message.metadataLabelMatchCriteria = 0; + break; + case "MATCH_ANY": + case 1: + message.metadataLabelMatchCriteria = 1; + break; + case "MATCH_ALL": + case 2: + message.metadataLabelMatchCriteria = 2; + break; + } + if (object.metadataLabels) { + if (!Array.isArray(object.metadataLabels)) + throw TypeError(".google.cloud.networkservices.v1beta1.EndpointMatcher.MetadataLabelMatcher.metadataLabels: array expected"); + message.metadataLabels = []; + for (var i = 0; i < object.metadataLabels.length; ++i) { + if (typeof object.metadataLabels[i] !== "object") + throw TypeError(".google.cloud.networkservices.v1beta1.EndpointMatcher.MetadataLabelMatcher.metadataLabels: object expected"); + message.metadataLabels[i] = $root.google.cloud.networkservices.v1beta1.EndpointMatcher.MetadataLabelMatcher.MetadataLabels.fromObject(object.metadataLabels[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a MetadataLabelMatcher message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.networkservices.v1beta1.EndpointMatcher.MetadataLabelMatcher + * @static + * @param {google.cloud.networkservices.v1beta1.EndpointMatcher.MetadataLabelMatcher} message MetadataLabelMatcher + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + MetadataLabelMatcher.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.metadataLabels = []; + if (options.defaults) + object.metadataLabelMatchCriteria = options.enums === String ? "METADATA_LABEL_MATCH_CRITERIA_UNSPECIFIED" : 0; + if (message.metadataLabelMatchCriteria != null && message.hasOwnProperty("metadataLabelMatchCriteria")) + object.metadataLabelMatchCriteria = options.enums === String ? $root.google.cloud.networkservices.v1beta1.EndpointMatcher.MetadataLabelMatcher.MetadataLabelMatchCriteria[message.metadataLabelMatchCriteria] === undefined ? message.metadataLabelMatchCriteria : $root.google.cloud.networkservices.v1beta1.EndpointMatcher.MetadataLabelMatcher.MetadataLabelMatchCriteria[message.metadataLabelMatchCriteria] : message.metadataLabelMatchCriteria; + if (message.metadataLabels && message.metadataLabels.length) { + object.metadataLabels = []; + for (var j = 0; j < message.metadataLabels.length; ++j) + object.metadataLabels[j] = $root.google.cloud.networkservices.v1beta1.EndpointMatcher.MetadataLabelMatcher.MetadataLabels.toObject(message.metadataLabels[j], options); + } + return object; + }; + + /** + * Converts this MetadataLabelMatcher to JSON. + * @function toJSON + * @memberof google.cloud.networkservices.v1beta1.EndpointMatcher.MetadataLabelMatcher + * @instance + * @returns {Object.} JSON object + */ + MetadataLabelMatcher.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for MetadataLabelMatcher + * @function getTypeUrl + * @memberof google.cloud.networkservices.v1beta1.EndpointMatcher.MetadataLabelMatcher + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + MetadataLabelMatcher.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.networkservices.v1beta1.EndpointMatcher.MetadataLabelMatcher"; + }; + + MetadataLabelMatcher.MetadataLabels = (function() { + + /** + * Properties of a MetadataLabels. + * @memberof google.cloud.networkservices.v1beta1.EndpointMatcher.MetadataLabelMatcher + * @interface IMetadataLabels + * @property {string|null} [labelName] MetadataLabels labelName + * @property {string|null} [labelValue] MetadataLabels labelValue + */ + + /** + * Constructs a new MetadataLabels. + * @memberof google.cloud.networkservices.v1beta1.EndpointMatcher.MetadataLabelMatcher + * @classdesc Represents a MetadataLabels. + * @implements IMetadataLabels + * @constructor + * @param {google.cloud.networkservices.v1beta1.EndpointMatcher.MetadataLabelMatcher.IMetadataLabels=} [properties] Properties to set + */ + function MetadataLabels(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * MetadataLabels labelName. + * @member {string} labelName + * @memberof google.cloud.networkservices.v1beta1.EndpointMatcher.MetadataLabelMatcher.MetadataLabels + * @instance + */ + MetadataLabels.prototype.labelName = ""; + + /** + * MetadataLabels labelValue. + * @member {string} labelValue + * @memberof google.cloud.networkservices.v1beta1.EndpointMatcher.MetadataLabelMatcher.MetadataLabels + * @instance + */ + MetadataLabels.prototype.labelValue = ""; + + /** + * Creates a new MetadataLabels instance using the specified properties. + * @function create + * @memberof google.cloud.networkservices.v1beta1.EndpointMatcher.MetadataLabelMatcher.MetadataLabels + * @static + * @param {google.cloud.networkservices.v1beta1.EndpointMatcher.MetadataLabelMatcher.IMetadataLabels=} [properties] Properties to set + * @returns {google.cloud.networkservices.v1beta1.EndpointMatcher.MetadataLabelMatcher.MetadataLabels} MetadataLabels instance + */ + MetadataLabels.create = function create(properties) { + return new MetadataLabels(properties); + }; + + /** + * Encodes the specified MetadataLabels message. Does not implicitly {@link google.cloud.networkservices.v1beta1.EndpointMatcher.MetadataLabelMatcher.MetadataLabels.verify|verify} messages. + * @function encode + * @memberof google.cloud.networkservices.v1beta1.EndpointMatcher.MetadataLabelMatcher.MetadataLabels + * @static + * @param {google.cloud.networkservices.v1beta1.EndpointMatcher.MetadataLabelMatcher.IMetadataLabels} message MetadataLabels message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MetadataLabels.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.labelName != null && Object.hasOwnProperty.call(message, "labelName")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.labelName); + if (message.labelValue != null && Object.hasOwnProperty.call(message, "labelValue")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.labelValue); + return writer; + }; + + /** + * Encodes the specified MetadataLabels message, length delimited. Does not implicitly {@link google.cloud.networkservices.v1beta1.EndpointMatcher.MetadataLabelMatcher.MetadataLabels.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.networkservices.v1beta1.EndpointMatcher.MetadataLabelMatcher.MetadataLabels + * @static + * @param {google.cloud.networkservices.v1beta1.EndpointMatcher.MetadataLabelMatcher.IMetadataLabels} message MetadataLabels message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MetadataLabels.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a MetadataLabels message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.networkservices.v1beta1.EndpointMatcher.MetadataLabelMatcher.MetadataLabels + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.networkservices.v1beta1.EndpointMatcher.MetadataLabelMatcher.MetadataLabels} MetadataLabels + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MetadataLabels.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.networkservices.v1beta1.EndpointMatcher.MetadataLabelMatcher.MetadataLabels(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.labelName = reader.string(); + break; + } + case 2: { + message.labelValue = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a MetadataLabels message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.networkservices.v1beta1.EndpointMatcher.MetadataLabelMatcher.MetadataLabels + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.networkservices.v1beta1.EndpointMatcher.MetadataLabelMatcher.MetadataLabels} MetadataLabels + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MetadataLabels.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a MetadataLabels message. + * @function verify + * @memberof google.cloud.networkservices.v1beta1.EndpointMatcher.MetadataLabelMatcher.MetadataLabels + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + MetadataLabels.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.labelName != null && message.hasOwnProperty("labelName")) + if (!$util.isString(message.labelName)) + return "labelName: string expected"; + if (message.labelValue != null && message.hasOwnProperty("labelValue")) + if (!$util.isString(message.labelValue)) + return "labelValue: string expected"; + return null; + }; + + /** + * Creates a MetadataLabels message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.networkservices.v1beta1.EndpointMatcher.MetadataLabelMatcher.MetadataLabels + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.networkservices.v1beta1.EndpointMatcher.MetadataLabelMatcher.MetadataLabels} MetadataLabels + */ + MetadataLabels.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.networkservices.v1beta1.EndpointMatcher.MetadataLabelMatcher.MetadataLabels) + return object; + var message = new $root.google.cloud.networkservices.v1beta1.EndpointMatcher.MetadataLabelMatcher.MetadataLabels(); + if (object.labelName != null) + message.labelName = String(object.labelName); + if (object.labelValue != null) + message.labelValue = String(object.labelValue); + return message; + }; + + /** + * Creates a plain object from a MetadataLabels message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.networkservices.v1beta1.EndpointMatcher.MetadataLabelMatcher.MetadataLabels + * @static + * @param {google.cloud.networkservices.v1beta1.EndpointMatcher.MetadataLabelMatcher.MetadataLabels} message MetadataLabels + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + MetadataLabels.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.labelName = ""; + object.labelValue = ""; + } + if (message.labelName != null && message.hasOwnProperty("labelName")) + object.labelName = message.labelName; + if (message.labelValue != null && message.hasOwnProperty("labelValue")) + object.labelValue = message.labelValue; + return object; + }; + + /** + * Converts this MetadataLabels to JSON. + * @function toJSON + * @memberof google.cloud.networkservices.v1beta1.EndpointMatcher.MetadataLabelMatcher.MetadataLabels + * @instance + * @returns {Object.} JSON object + */ + MetadataLabels.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for MetadataLabels + * @function getTypeUrl + * @memberof google.cloud.networkservices.v1beta1.EndpointMatcher.MetadataLabelMatcher.MetadataLabels + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + MetadataLabels.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.networkservices.v1beta1.EndpointMatcher.MetadataLabelMatcher.MetadataLabels"; + }; + + return MetadataLabels; + })(); + + /** + * MetadataLabelMatchCriteria enum. + * @name google.cloud.networkservices.v1beta1.EndpointMatcher.MetadataLabelMatcher.MetadataLabelMatchCriteria + * @enum {number} + * @property {number} METADATA_LABEL_MATCH_CRITERIA_UNSPECIFIED=0 METADATA_LABEL_MATCH_CRITERIA_UNSPECIFIED value + * @property {number} MATCH_ANY=1 MATCH_ANY value + * @property {number} MATCH_ALL=2 MATCH_ALL value + */ + MetadataLabelMatcher.MetadataLabelMatchCriteria = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "METADATA_LABEL_MATCH_CRITERIA_UNSPECIFIED"] = 0; + values[valuesById[1] = "MATCH_ANY"] = 1; + values[valuesById[2] = "MATCH_ALL"] = 2; + return values; + })(); + + return MetadataLabelMatcher; + })(); + + return EndpointMatcher; + })(); + + v1beta1.EndpointPolicy = (function() { + + /** + * Properties of an EndpointPolicy. + * @memberof google.cloud.networkservices.v1beta1 + * @interface IEndpointPolicy + * @property {string|null} [name] EndpointPolicy name + * @property {google.protobuf.ITimestamp|null} [createTime] EndpointPolicy createTime + * @property {google.protobuf.ITimestamp|null} [updateTime] EndpointPolicy updateTime + * @property {Object.|null} [labels] EndpointPolicy labels + * @property {google.cloud.networkservices.v1beta1.EndpointPolicy.EndpointPolicyType|null} [type] EndpointPolicy type + * @property {string|null} [authorizationPolicy] EndpointPolicy authorizationPolicy + * @property {google.cloud.networkservices.v1beta1.IEndpointMatcher|null} [endpointMatcher] EndpointPolicy endpointMatcher + * @property {google.cloud.networkservices.v1beta1.ITrafficPortSelector|null} [trafficPortSelector] EndpointPolicy trafficPortSelector + * @property {string|null} [description] EndpointPolicy description + * @property {string|null} [serverTlsPolicy] EndpointPolicy serverTlsPolicy + * @property {string|null} [clientTlsPolicy] EndpointPolicy clientTlsPolicy + */ + + /** + * Constructs a new EndpointPolicy. + * @memberof google.cloud.networkservices.v1beta1 + * @classdesc Represents an EndpointPolicy. + * @implements IEndpointPolicy + * @constructor + * @param {google.cloud.networkservices.v1beta1.IEndpointPolicy=} [properties] Properties to set + */ + function EndpointPolicy(properties) { + this.labels = {}; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * EndpointPolicy name. + * @member {string} name + * @memberof google.cloud.networkservices.v1beta1.EndpointPolicy + * @instance + */ + EndpointPolicy.prototype.name = ""; + + /** + * EndpointPolicy createTime. + * @member {google.protobuf.ITimestamp|null|undefined} createTime + * @memberof google.cloud.networkservices.v1beta1.EndpointPolicy + * @instance + */ + EndpointPolicy.prototype.createTime = null; + + /** + * EndpointPolicy updateTime. + * @member {google.protobuf.ITimestamp|null|undefined} updateTime + * @memberof google.cloud.networkservices.v1beta1.EndpointPolicy + * @instance + */ + EndpointPolicy.prototype.updateTime = null; + + /** + * EndpointPolicy labels. + * @member {Object.} labels + * @memberof google.cloud.networkservices.v1beta1.EndpointPolicy + * @instance + */ + EndpointPolicy.prototype.labels = $util.emptyObject; + + /** + * EndpointPolicy type. + * @member {google.cloud.networkservices.v1beta1.EndpointPolicy.EndpointPolicyType} type + * @memberof google.cloud.networkservices.v1beta1.EndpointPolicy + * @instance + */ + EndpointPolicy.prototype.type = 0; + + /** + * EndpointPolicy authorizationPolicy. + * @member {string} authorizationPolicy + * @memberof google.cloud.networkservices.v1beta1.EndpointPolicy + * @instance + */ + EndpointPolicy.prototype.authorizationPolicy = ""; + + /** + * EndpointPolicy endpointMatcher. + * @member {google.cloud.networkservices.v1beta1.IEndpointMatcher|null|undefined} endpointMatcher + * @memberof google.cloud.networkservices.v1beta1.EndpointPolicy + * @instance + */ + EndpointPolicy.prototype.endpointMatcher = null; + + /** + * EndpointPolicy trafficPortSelector. + * @member {google.cloud.networkservices.v1beta1.ITrafficPortSelector|null|undefined} trafficPortSelector + * @memberof google.cloud.networkservices.v1beta1.EndpointPolicy + * @instance + */ + EndpointPolicy.prototype.trafficPortSelector = null; + + /** + * EndpointPolicy description. + * @member {string} description + * @memberof google.cloud.networkservices.v1beta1.EndpointPolicy + * @instance + */ + EndpointPolicy.prototype.description = ""; + + /** + * EndpointPolicy serverTlsPolicy. + * @member {string} serverTlsPolicy + * @memberof google.cloud.networkservices.v1beta1.EndpointPolicy + * @instance + */ + EndpointPolicy.prototype.serverTlsPolicy = ""; + + /** + * EndpointPolicy clientTlsPolicy. + * @member {string} clientTlsPolicy + * @memberof google.cloud.networkservices.v1beta1.EndpointPolicy + * @instance + */ + EndpointPolicy.prototype.clientTlsPolicy = ""; + + /** + * Creates a new EndpointPolicy instance using the specified properties. + * @function create + * @memberof google.cloud.networkservices.v1beta1.EndpointPolicy + * @static + * @param {google.cloud.networkservices.v1beta1.IEndpointPolicy=} [properties] Properties to set + * @returns {google.cloud.networkservices.v1beta1.EndpointPolicy} EndpointPolicy instance + */ + EndpointPolicy.create = function create(properties) { + return new EndpointPolicy(properties); + }; + + /** + * Encodes the specified EndpointPolicy message. Does not implicitly {@link google.cloud.networkservices.v1beta1.EndpointPolicy.verify|verify} messages. + * @function encode + * @memberof google.cloud.networkservices.v1beta1.EndpointPolicy + * @static + * @param {google.cloud.networkservices.v1beta1.IEndpointPolicy} message EndpointPolicy message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EndpointPolicy.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.createTime != null && Object.hasOwnProperty.call(message, "createTime")) + $root.google.protobuf.Timestamp.encode(message.createTime, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + 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(); + if (message.labels != null && Object.hasOwnProperty.call(message, "labels")) + for (var keys = Object.keys(message.labels), i = 0; i < keys.length; ++i) + writer.uint32(/* id 4, wireType 2 =*/34).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.labels[keys[i]]).ldelim(); + if (message.type != null && Object.hasOwnProperty.call(message, "type")) + writer.uint32(/* id 5, wireType 0 =*/40).int32(message.type); + if (message.authorizationPolicy != null && Object.hasOwnProperty.call(message, "authorizationPolicy")) + writer.uint32(/* id 7, wireType 2 =*/58).string(message.authorizationPolicy); + if (message.endpointMatcher != null && Object.hasOwnProperty.call(message, "endpointMatcher")) + $root.google.cloud.networkservices.v1beta1.EndpointMatcher.encode(message.endpointMatcher, writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim(); + if (message.trafficPortSelector != null && Object.hasOwnProperty.call(message, "trafficPortSelector")) + $root.google.cloud.networkservices.v1beta1.TrafficPortSelector.encode(message.trafficPortSelector, writer.uint32(/* id 10, wireType 2 =*/82).fork()).ldelim(); + if (message.description != null && Object.hasOwnProperty.call(message, "description")) + writer.uint32(/* id 11, wireType 2 =*/90).string(message.description); + if (message.serverTlsPolicy != null && Object.hasOwnProperty.call(message, "serverTlsPolicy")) + writer.uint32(/* id 12, wireType 2 =*/98).string(message.serverTlsPolicy); + if (message.clientTlsPolicy != null && Object.hasOwnProperty.call(message, "clientTlsPolicy")) + writer.uint32(/* id 13, wireType 2 =*/106).string(message.clientTlsPolicy); + return writer; + }; + + /** + * Encodes the specified EndpointPolicy message, length delimited. Does not implicitly {@link google.cloud.networkservices.v1beta1.EndpointPolicy.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.networkservices.v1beta1.EndpointPolicy + * @static + * @param {google.cloud.networkservices.v1beta1.IEndpointPolicy} message EndpointPolicy message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EndpointPolicy.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an EndpointPolicy message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.networkservices.v1beta1.EndpointPolicy + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.networkservices.v1beta1.EndpointPolicy} EndpointPolicy + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EndpointPolicy.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.networkservices.v1beta1.EndpointPolicy(), key, value; + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.createTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 3: { + message.updateTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 4: { + if (message.labels === $util.emptyObject) + message.labels = {}; + 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.labels[key] = value; + break; + } + case 5: { + message.type = reader.int32(); + break; + } + case 7: { + message.authorizationPolicy = reader.string(); + break; + } + case 9: { + message.endpointMatcher = $root.google.cloud.networkservices.v1beta1.EndpointMatcher.decode(reader, reader.uint32()); + break; + } + case 10: { + message.trafficPortSelector = $root.google.cloud.networkservices.v1beta1.TrafficPortSelector.decode(reader, reader.uint32()); + break; + } + case 11: { + message.description = reader.string(); + break; + } + case 12: { + message.serverTlsPolicy = reader.string(); + break; + } + case 13: { + message.clientTlsPolicy = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an EndpointPolicy message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.networkservices.v1beta1.EndpointPolicy + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.networkservices.v1beta1.EndpointPolicy} EndpointPolicy + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EndpointPolicy.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an EndpointPolicy message. + * @function verify + * @memberof google.cloud.networkservices.v1beta1.EndpointPolicy + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + EndpointPolicy.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.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.labels != null && message.hasOwnProperty("labels")) { + if (!$util.isObject(message.labels)) + return "labels: object expected"; + var key = Object.keys(message.labels); + for (var i = 0; i < key.length; ++i) + if (!$util.isString(message.labels[key[i]])) + return "labels: string{k:string} expected"; + } + if (message.type != null && message.hasOwnProperty("type")) + switch (message.type) { + default: + return "type: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.authorizationPolicy != null && message.hasOwnProperty("authorizationPolicy")) + if (!$util.isString(message.authorizationPolicy)) + return "authorizationPolicy: string expected"; + if (message.endpointMatcher != null && message.hasOwnProperty("endpointMatcher")) { + var error = $root.google.cloud.networkservices.v1beta1.EndpointMatcher.verify(message.endpointMatcher); + if (error) + return "endpointMatcher." + error; + } + if (message.trafficPortSelector != null && message.hasOwnProperty("trafficPortSelector")) { + var error = $root.google.cloud.networkservices.v1beta1.TrafficPortSelector.verify(message.trafficPortSelector); + if (error) + return "trafficPortSelector." + error; + } + if (message.description != null && message.hasOwnProperty("description")) + if (!$util.isString(message.description)) + return "description: string expected"; + if (message.serverTlsPolicy != null && message.hasOwnProperty("serverTlsPolicy")) + if (!$util.isString(message.serverTlsPolicy)) + return "serverTlsPolicy: string expected"; + if (message.clientTlsPolicy != null && message.hasOwnProperty("clientTlsPolicy")) + if (!$util.isString(message.clientTlsPolicy)) + return "clientTlsPolicy: string expected"; + return null; + }; + + /** + * Creates an EndpointPolicy message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.networkservices.v1beta1.EndpointPolicy + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.networkservices.v1beta1.EndpointPolicy} EndpointPolicy + */ + EndpointPolicy.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.networkservices.v1beta1.EndpointPolicy) + return object; + var message = new $root.google.cloud.networkservices.v1beta1.EndpointPolicy(); + if (object.name != null) + message.name = String(object.name); + if (object.createTime != null) { + if (typeof object.createTime !== "object") + throw TypeError(".google.cloud.networkservices.v1beta1.EndpointPolicy.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.networkservices.v1beta1.EndpointPolicy.updateTime: object expected"); + message.updateTime = $root.google.protobuf.Timestamp.fromObject(object.updateTime); + } + if (object.labels) { + if (typeof object.labels !== "object") + throw TypeError(".google.cloud.networkservices.v1beta1.EndpointPolicy.labels: object expected"); + message.labels = {}; + for (var keys = Object.keys(object.labels), i = 0; i < keys.length; ++i) + message.labels[keys[i]] = String(object.labels[keys[i]]); + } + switch (object.type) { + default: + if (typeof object.type === "number") { + message.type = object.type; + break; + } + break; + case "ENDPOINT_POLICY_TYPE_UNSPECIFIED": + case 0: + message.type = 0; + break; + case "SIDECAR_PROXY": + case 1: + message.type = 1; + break; + case "GRPC_SERVER": + case 2: + message.type = 2; + break; + } + if (object.authorizationPolicy != null) + message.authorizationPolicy = String(object.authorizationPolicy); + if (object.endpointMatcher != null) { + if (typeof object.endpointMatcher !== "object") + throw TypeError(".google.cloud.networkservices.v1beta1.EndpointPolicy.endpointMatcher: object expected"); + message.endpointMatcher = $root.google.cloud.networkservices.v1beta1.EndpointMatcher.fromObject(object.endpointMatcher); + } + if (object.trafficPortSelector != null) { + if (typeof object.trafficPortSelector !== "object") + throw TypeError(".google.cloud.networkservices.v1beta1.EndpointPolicy.trafficPortSelector: object expected"); + message.trafficPortSelector = $root.google.cloud.networkservices.v1beta1.TrafficPortSelector.fromObject(object.trafficPortSelector); + } + if (object.description != null) + message.description = String(object.description); + if (object.serverTlsPolicy != null) + message.serverTlsPolicy = String(object.serverTlsPolicy); + if (object.clientTlsPolicy != null) + message.clientTlsPolicy = String(object.clientTlsPolicy); + return message; + }; + + /** + * Creates a plain object from an EndpointPolicy message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.networkservices.v1beta1.EndpointPolicy + * @static + * @param {google.cloud.networkservices.v1beta1.EndpointPolicy} message EndpointPolicy + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + EndpointPolicy.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.objects || options.defaults) + object.labels = {}; + if (options.defaults) { + object.name = ""; + object.createTime = null; + object.updateTime = null; + object.type = options.enums === String ? "ENDPOINT_POLICY_TYPE_UNSPECIFIED" : 0; + object.authorizationPolicy = ""; + object.endpointMatcher = null; + object.trafficPortSelector = null; + object.description = ""; + object.serverTlsPolicy = ""; + object.clientTlsPolicy = ""; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + 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); + var keys2; + if (message.labels && (keys2 = Object.keys(message.labels)).length) { + object.labels = {}; + for (var j = 0; j < keys2.length; ++j) + object.labels[keys2[j]] = message.labels[keys2[j]]; + } + if (message.type != null && message.hasOwnProperty("type")) + object.type = options.enums === String ? $root.google.cloud.networkservices.v1beta1.EndpointPolicy.EndpointPolicyType[message.type] === undefined ? message.type : $root.google.cloud.networkservices.v1beta1.EndpointPolicy.EndpointPolicyType[message.type] : message.type; + if (message.authorizationPolicy != null && message.hasOwnProperty("authorizationPolicy")) + object.authorizationPolicy = message.authorizationPolicy; + if (message.endpointMatcher != null && message.hasOwnProperty("endpointMatcher")) + object.endpointMatcher = $root.google.cloud.networkservices.v1beta1.EndpointMatcher.toObject(message.endpointMatcher, options); + if (message.trafficPortSelector != null && message.hasOwnProperty("trafficPortSelector")) + object.trafficPortSelector = $root.google.cloud.networkservices.v1beta1.TrafficPortSelector.toObject(message.trafficPortSelector, options); + if (message.description != null && message.hasOwnProperty("description")) + object.description = message.description; + if (message.serverTlsPolicy != null && message.hasOwnProperty("serverTlsPolicy")) + object.serverTlsPolicy = message.serverTlsPolicy; + if (message.clientTlsPolicy != null && message.hasOwnProperty("clientTlsPolicy")) + object.clientTlsPolicy = message.clientTlsPolicy; + return object; + }; + + /** + * Converts this EndpointPolicy to JSON. + * @function toJSON + * @memberof google.cloud.networkservices.v1beta1.EndpointPolicy + * @instance + * @returns {Object.} JSON object + */ + EndpointPolicy.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for EndpointPolicy + * @function getTypeUrl + * @memberof google.cloud.networkservices.v1beta1.EndpointPolicy + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + EndpointPolicy.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.networkservices.v1beta1.EndpointPolicy"; + }; + + /** + * EndpointPolicyType enum. + * @name google.cloud.networkservices.v1beta1.EndpointPolicy.EndpointPolicyType + * @enum {number} + * @property {number} ENDPOINT_POLICY_TYPE_UNSPECIFIED=0 ENDPOINT_POLICY_TYPE_UNSPECIFIED value + * @property {number} SIDECAR_PROXY=1 SIDECAR_PROXY value + * @property {number} GRPC_SERVER=2 GRPC_SERVER value + */ + EndpointPolicy.EndpointPolicyType = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "ENDPOINT_POLICY_TYPE_UNSPECIFIED"] = 0; + values[valuesById[1] = "SIDECAR_PROXY"] = 1; + values[valuesById[2] = "GRPC_SERVER"] = 2; + return values; + })(); + + return EndpointPolicy; + })(); + + v1beta1.ListEndpointPoliciesRequest = (function() { + + /** + * Properties of a ListEndpointPoliciesRequest. + * @memberof google.cloud.networkservices.v1beta1 + * @interface IListEndpointPoliciesRequest + * @property {string|null} [parent] ListEndpointPoliciesRequest parent + * @property {number|null} [pageSize] ListEndpointPoliciesRequest pageSize + * @property {string|null} [pageToken] ListEndpointPoliciesRequest pageToken + */ + + /** + * Constructs a new ListEndpointPoliciesRequest. + * @memberof google.cloud.networkservices.v1beta1 + * @classdesc Represents a ListEndpointPoliciesRequest. + * @implements IListEndpointPoliciesRequest + * @constructor + * @param {google.cloud.networkservices.v1beta1.IListEndpointPoliciesRequest=} [properties] Properties to set + */ + function ListEndpointPoliciesRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListEndpointPoliciesRequest parent. + * @member {string} parent + * @memberof google.cloud.networkservices.v1beta1.ListEndpointPoliciesRequest + * @instance + */ + ListEndpointPoliciesRequest.prototype.parent = ""; + + /** + * ListEndpointPoliciesRequest pageSize. + * @member {number} pageSize + * @memberof google.cloud.networkservices.v1beta1.ListEndpointPoliciesRequest + * @instance + */ + ListEndpointPoliciesRequest.prototype.pageSize = 0; + + /** + * ListEndpointPoliciesRequest pageToken. + * @member {string} pageToken + * @memberof google.cloud.networkservices.v1beta1.ListEndpointPoliciesRequest + * @instance + */ + ListEndpointPoliciesRequest.prototype.pageToken = ""; + + /** + * Creates a new ListEndpointPoliciesRequest instance using the specified properties. + * @function create + * @memberof google.cloud.networkservices.v1beta1.ListEndpointPoliciesRequest + * @static + * @param {google.cloud.networkservices.v1beta1.IListEndpointPoliciesRequest=} [properties] Properties to set + * @returns {google.cloud.networkservices.v1beta1.ListEndpointPoliciesRequest} ListEndpointPoliciesRequest instance + */ + ListEndpointPoliciesRequest.create = function create(properties) { + return new ListEndpointPoliciesRequest(properties); + }; + + /** + * Encodes the specified ListEndpointPoliciesRequest message. Does not implicitly {@link google.cloud.networkservices.v1beta1.ListEndpointPoliciesRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.networkservices.v1beta1.ListEndpointPoliciesRequest + * @static + * @param {google.cloud.networkservices.v1beta1.IListEndpointPoliciesRequest} message ListEndpointPoliciesRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListEndpointPoliciesRequest.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 ListEndpointPoliciesRequest message, length delimited. Does not implicitly {@link google.cloud.networkservices.v1beta1.ListEndpointPoliciesRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.networkservices.v1beta1.ListEndpointPoliciesRequest + * @static + * @param {google.cloud.networkservices.v1beta1.IListEndpointPoliciesRequest} message ListEndpointPoliciesRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListEndpointPoliciesRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListEndpointPoliciesRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.networkservices.v1beta1.ListEndpointPoliciesRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.networkservices.v1beta1.ListEndpointPoliciesRequest} ListEndpointPoliciesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListEndpointPoliciesRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.networkservices.v1beta1.ListEndpointPoliciesRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + 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 ListEndpointPoliciesRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.networkservices.v1beta1.ListEndpointPoliciesRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.networkservices.v1beta1.ListEndpointPoliciesRequest} ListEndpointPoliciesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListEndpointPoliciesRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListEndpointPoliciesRequest message. + * @function verify + * @memberof google.cloud.networkservices.v1beta1.ListEndpointPoliciesRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListEndpointPoliciesRequest.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 ListEndpointPoliciesRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.networkservices.v1beta1.ListEndpointPoliciesRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.networkservices.v1beta1.ListEndpointPoliciesRequest} ListEndpointPoliciesRequest + */ + ListEndpointPoliciesRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.networkservices.v1beta1.ListEndpointPoliciesRequest) + return object; + var message = new $root.google.cloud.networkservices.v1beta1.ListEndpointPoliciesRequest(); + 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 ListEndpointPoliciesRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.networkservices.v1beta1.ListEndpointPoliciesRequest + * @static + * @param {google.cloud.networkservices.v1beta1.ListEndpointPoliciesRequest} message ListEndpointPoliciesRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListEndpointPoliciesRequest.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 ListEndpointPoliciesRequest to JSON. + * @function toJSON + * @memberof google.cloud.networkservices.v1beta1.ListEndpointPoliciesRequest + * @instance + * @returns {Object.} JSON object + */ + ListEndpointPoliciesRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListEndpointPoliciesRequest + * @function getTypeUrl + * @memberof google.cloud.networkservices.v1beta1.ListEndpointPoliciesRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListEndpointPoliciesRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.networkservices.v1beta1.ListEndpointPoliciesRequest"; + }; + + return ListEndpointPoliciesRequest; + })(); + + v1beta1.ListEndpointPoliciesResponse = (function() { + + /** + * Properties of a ListEndpointPoliciesResponse. + * @memberof google.cloud.networkservices.v1beta1 + * @interface IListEndpointPoliciesResponse + * @property {Array.|null} [endpointPolicies] ListEndpointPoliciesResponse endpointPolicies + * @property {string|null} [nextPageToken] ListEndpointPoliciesResponse nextPageToken + */ + + /** + * Constructs a new ListEndpointPoliciesResponse. + * @memberof google.cloud.networkservices.v1beta1 + * @classdesc Represents a ListEndpointPoliciesResponse. + * @implements IListEndpointPoliciesResponse + * @constructor + * @param {google.cloud.networkservices.v1beta1.IListEndpointPoliciesResponse=} [properties] Properties to set + */ + function ListEndpointPoliciesResponse(properties) { + this.endpointPolicies = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListEndpointPoliciesResponse endpointPolicies. + * @member {Array.} endpointPolicies + * @memberof google.cloud.networkservices.v1beta1.ListEndpointPoliciesResponse + * @instance + */ + ListEndpointPoliciesResponse.prototype.endpointPolicies = $util.emptyArray; + + /** + * ListEndpointPoliciesResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.cloud.networkservices.v1beta1.ListEndpointPoliciesResponse + * @instance + */ + ListEndpointPoliciesResponse.prototype.nextPageToken = ""; + + /** + * Creates a new ListEndpointPoliciesResponse instance using the specified properties. + * @function create + * @memberof google.cloud.networkservices.v1beta1.ListEndpointPoliciesResponse + * @static + * @param {google.cloud.networkservices.v1beta1.IListEndpointPoliciesResponse=} [properties] Properties to set + * @returns {google.cloud.networkservices.v1beta1.ListEndpointPoliciesResponse} ListEndpointPoliciesResponse instance + */ + ListEndpointPoliciesResponse.create = function create(properties) { + return new ListEndpointPoliciesResponse(properties); + }; + + /** + * Encodes the specified ListEndpointPoliciesResponse message. Does not implicitly {@link google.cloud.networkservices.v1beta1.ListEndpointPoliciesResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.networkservices.v1beta1.ListEndpointPoliciesResponse + * @static + * @param {google.cloud.networkservices.v1beta1.IListEndpointPoliciesResponse} message ListEndpointPoliciesResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListEndpointPoliciesResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.endpointPolicies != null && message.endpointPolicies.length) + for (var i = 0; i < message.endpointPolicies.length; ++i) + $root.google.cloud.networkservices.v1beta1.EndpointPolicy.encode(message.endpointPolicies[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 ListEndpointPoliciesResponse message, length delimited. Does not implicitly {@link google.cloud.networkservices.v1beta1.ListEndpointPoliciesResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.networkservices.v1beta1.ListEndpointPoliciesResponse + * @static + * @param {google.cloud.networkservices.v1beta1.IListEndpointPoliciesResponse} message ListEndpointPoliciesResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListEndpointPoliciesResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListEndpointPoliciesResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.networkservices.v1beta1.ListEndpointPoliciesResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.networkservices.v1beta1.ListEndpointPoliciesResponse} ListEndpointPoliciesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListEndpointPoliciesResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.networkservices.v1beta1.ListEndpointPoliciesResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.endpointPolicies && message.endpointPolicies.length)) + message.endpointPolicies = []; + message.endpointPolicies.push($root.google.cloud.networkservices.v1beta1.EndpointPolicy.decode(reader, reader.uint32())); + break; + } + case 2: { + message.nextPageToken = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListEndpointPoliciesResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.networkservices.v1beta1.ListEndpointPoliciesResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.networkservices.v1beta1.ListEndpointPoliciesResponse} ListEndpointPoliciesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListEndpointPoliciesResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListEndpointPoliciesResponse message. + * @function verify + * @memberof google.cloud.networkservices.v1beta1.ListEndpointPoliciesResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListEndpointPoliciesResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.endpointPolicies != null && message.hasOwnProperty("endpointPolicies")) { + if (!Array.isArray(message.endpointPolicies)) + return "endpointPolicies: array expected"; + for (var i = 0; i < message.endpointPolicies.length; ++i) { + var error = $root.google.cloud.networkservices.v1beta1.EndpointPolicy.verify(message.endpointPolicies[i]); + if (error) + return "endpointPolicies." + error; + } + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + return null; + }; + + /** + * Creates a ListEndpointPoliciesResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.networkservices.v1beta1.ListEndpointPoliciesResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.networkservices.v1beta1.ListEndpointPoliciesResponse} ListEndpointPoliciesResponse + */ + ListEndpointPoliciesResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.networkservices.v1beta1.ListEndpointPoliciesResponse) + return object; + var message = new $root.google.cloud.networkservices.v1beta1.ListEndpointPoliciesResponse(); + if (object.endpointPolicies) { + if (!Array.isArray(object.endpointPolicies)) + throw TypeError(".google.cloud.networkservices.v1beta1.ListEndpointPoliciesResponse.endpointPolicies: array expected"); + message.endpointPolicies = []; + for (var i = 0; i < object.endpointPolicies.length; ++i) { + if (typeof object.endpointPolicies[i] !== "object") + throw TypeError(".google.cloud.networkservices.v1beta1.ListEndpointPoliciesResponse.endpointPolicies: object expected"); + message.endpointPolicies[i] = $root.google.cloud.networkservices.v1beta1.EndpointPolicy.fromObject(object.endpointPolicies[i]); + } + } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + return message; + }; + + /** + * Creates a plain object from a ListEndpointPoliciesResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.networkservices.v1beta1.ListEndpointPoliciesResponse + * @static + * @param {google.cloud.networkservices.v1beta1.ListEndpointPoliciesResponse} message ListEndpointPoliciesResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListEndpointPoliciesResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.endpointPolicies = []; + if (options.defaults) + object.nextPageToken = ""; + if (message.endpointPolicies && message.endpointPolicies.length) { + object.endpointPolicies = []; + for (var j = 0; j < message.endpointPolicies.length; ++j) + object.endpointPolicies[j] = $root.google.cloud.networkservices.v1beta1.EndpointPolicy.toObject(message.endpointPolicies[j], options); + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + object.nextPageToken = message.nextPageToken; + return object; + }; + + /** + * Converts this ListEndpointPoliciesResponse to JSON. + * @function toJSON + * @memberof google.cloud.networkservices.v1beta1.ListEndpointPoliciesResponse + * @instance + * @returns {Object.} JSON object + */ + ListEndpointPoliciesResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListEndpointPoliciesResponse + * @function getTypeUrl + * @memberof google.cloud.networkservices.v1beta1.ListEndpointPoliciesResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListEndpointPoliciesResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.networkservices.v1beta1.ListEndpointPoliciesResponse"; + }; + + return ListEndpointPoliciesResponse; + })(); + + v1beta1.GetEndpointPolicyRequest = (function() { + + /** + * Properties of a GetEndpointPolicyRequest. + * @memberof google.cloud.networkservices.v1beta1 + * @interface IGetEndpointPolicyRequest + * @property {string|null} [name] GetEndpointPolicyRequest name + */ + + /** + * Constructs a new GetEndpointPolicyRequest. + * @memberof google.cloud.networkservices.v1beta1 + * @classdesc Represents a GetEndpointPolicyRequest. + * @implements IGetEndpointPolicyRequest + * @constructor + * @param {google.cloud.networkservices.v1beta1.IGetEndpointPolicyRequest=} [properties] Properties to set + */ + function GetEndpointPolicyRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetEndpointPolicyRequest name. + * @member {string} name + * @memberof google.cloud.networkservices.v1beta1.GetEndpointPolicyRequest + * @instance + */ + GetEndpointPolicyRequest.prototype.name = ""; + + /** + * Creates a new GetEndpointPolicyRequest instance using the specified properties. + * @function create + * @memberof google.cloud.networkservices.v1beta1.GetEndpointPolicyRequest + * @static + * @param {google.cloud.networkservices.v1beta1.IGetEndpointPolicyRequest=} [properties] Properties to set + * @returns {google.cloud.networkservices.v1beta1.GetEndpointPolicyRequest} GetEndpointPolicyRequest instance + */ + GetEndpointPolicyRequest.create = function create(properties) { + return new GetEndpointPolicyRequest(properties); + }; + + /** + * Encodes the specified GetEndpointPolicyRequest message. Does not implicitly {@link google.cloud.networkservices.v1beta1.GetEndpointPolicyRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.networkservices.v1beta1.GetEndpointPolicyRequest + * @static + * @param {google.cloud.networkservices.v1beta1.IGetEndpointPolicyRequest} message GetEndpointPolicyRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetEndpointPolicyRequest.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 GetEndpointPolicyRequest message, length delimited. Does not implicitly {@link google.cloud.networkservices.v1beta1.GetEndpointPolicyRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.networkservices.v1beta1.GetEndpointPolicyRequest + * @static + * @param {google.cloud.networkservices.v1beta1.IGetEndpointPolicyRequest} message GetEndpointPolicyRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetEndpointPolicyRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetEndpointPolicyRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.networkservices.v1beta1.GetEndpointPolicyRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.networkservices.v1beta1.GetEndpointPolicyRequest} GetEndpointPolicyRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetEndpointPolicyRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.networkservices.v1beta1.GetEndpointPolicyRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetEndpointPolicyRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.networkservices.v1beta1.GetEndpointPolicyRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.networkservices.v1beta1.GetEndpointPolicyRequest} GetEndpointPolicyRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetEndpointPolicyRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetEndpointPolicyRequest message. + * @function verify + * @memberof google.cloud.networkservices.v1beta1.GetEndpointPolicyRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetEndpointPolicyRequest.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 GetEndpointPolicyRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.networkservices.v1beta1.GetEndpointPolicyRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.networkservices.v1beta1.GetEndpointPolicyRequest} GetEndpointPolicyRequest + */ + GetEndpointPolicyRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.networkservices.v1beta1.GetEndpointPolicyRequest) + return object; + var message = new $root.google.cloud.networkservices.v1beta1.GetEndpointPolicyRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a GetEndpointPolicyRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.networkservices.v1beta1.GetEndpointPolicyRequest + * @static + * @param {google.cloud.networkservices.v1beta1.GetEndpointPolicyRequest} message GetEndpointPolicyRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetEndpointPolicyRequest.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 GetEndpointPolicyRequest to JSON. + * @function toJSON + * @memberof google.cloud.networkservices.v1beta1.GetEndpointPolicyRequest + * @instance + * @returns {Object.} JSON object + */ + GetEndpointPolicyRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GetEndpointPolicyRequest + * @function getTypeUrl + * @memberof google.cloud.networkservices.v1beta1.GetEndpointPolicyRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GetEndpointPolicyRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.networkservices.v1beta1.GetEndpointPolicyRequest"; + }; + + return GetEndpointPolicyRequest; + })(); + + v1beta1.CreateEndpointPolicyRequest = (function() { + + /** + * Properties of a CreateEndpointPolicyRequest. + * @memberof google.cloud.networkservices.v1beta1 + * @interface ICreateEndpointPolicyRequest + * @property {string|null} [parent] CreateEndpointPolicyRequest parent + * @property {string|null} [endpointPolicyId] CreateEndpointPolicyRequest endpointPolicyId + * @property {google.cloud.networkservices.v1beta1.IEndpointPolicy|null} [endpointPolicy] CreateEndpointPolicyRequest endpointPolicy + */ + + /** + * Constructs a new CreateEndpointPolicyRequest. + * @memberof google.cloud.networkservices.v1beta1 + * @classdesc Represents a CreateEndpointPolicyRequest. + * @implements ICreateEndpointPolicyRequest + * @constructor + * @param {google.cloud.networkservices.v1beta1.ICreateEndpointPolicyRequest=} [properties] Properties to set + */ + function CreateEndpointPolicyRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * CreateEndpointPolicyRequest parent. + * @member {string} parent + * @memberof google.cloud.networkservices.v1beta1.CreateEndpointPolicyRequest + * @instance + */ + CreateEndpointPolicyRequest.prototype.parent = ""; + + /** + * CreateEndpointPolicyRequest endpointPolicyId. + * @member {string} endpointPolicyId + * @memberof google.cloud.networkservices.v1beta1.CreateEndpointPolicyRequest + * @instance + */ + CreateEndpointPolicyRequest.prototype.endpointPolicyId = ""; + + /** + * CreateEndpointPolicyRequest endpointPolicy. + * @member {google.cloud.networkservices.v1beta1.IEndpointPolicy|null|undefined} endpointPolicy + * @memberof google.cloud.networkservices.v1beta1.CreateEndpointPolicyRequest + * @instance + */ + CreateEndpointPolicyRequest.prototype.endpointPolicy = null; + + /** + * Creates a new CreateEndpointPolicyRequest instance using the specified properties. + * @function create + * @memberof google.cloud.networkservices.v1beta1.CreateEndpointPolicyRequest + * @static + * @param {google.cloud.networkservices.v1beta1.ICreateEndpointPolicyRequest=} [properties] Properties to set + * @returns {google.cloud.networkservices.v1beta1.CreateEndpointPolicyRequest} CreateEndpointPolicyRequest instance + */ + CreateEndpointPolicyRequest.create = function create(properties) { + return new CreateEndpointPolicyRequest(properties); + }; + + /** + * Encodes the specified CreateEndpointPolicyRequest message. Does not implicitly {@link google.cloud.networkservices.v1beta1.CreateEndpointPolicyRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.networkservices.v1beta1.CreateEndpointPolicyRequest + * @static + * @param {google.cloud.networkservices.v1beta1.ICreateEndpointPolicyRequest} message CreateEndpointPolicyRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateEndpointPolicyRequest.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.endpointPolicyId != null && Object.hasOwnProperty.call(message, "endpointPolicyId")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.endpointPolicyId); + if (message.endpointPolicy != null && Object.hasOwnProperty.call(message, "endpointPolicy")) + $root.google.cloud.networkservices.v1beta1.EndpointPolicy.encode(message.endpointPolicy, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified CreateEndpointPolicyRequest message, length delimited. Does not implicitly {@link google.cloud.networkservices.v1beta1.CreateEndpointPolicyRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.networkservices.v1beta1.CreateEndpointPolicyRequest + * @static + * @param {google.cloud.networkservices.v1beta1.ICreateEndpointPolicyRequest} message CreateEndpointPolicyRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateEndpointPolicyRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CreateEndpointPolicyRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.networkservices.v1beta1.CreateEndpointPolicyRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.networkservices.v1beta1.CreateEndpointPolicyRequest} CreateEndpointPolicyRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateEndpointPolicyRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.networkservices.v1beta1.CreateEndpointPolicyRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.endpointPolicyId = reader.string(); + break; + } + case 3: { + message.endpointPolicy = $root.google.cloud.networkservices.v1beta1.EndpointPolicy.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CreateEndpointPolicyRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.networkservices.v1beta1.CreateEndpointPolicyRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.networkservices.v1beta1.CreateEndpointPolicyRequest} CreateEndpointPolicyRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateEndpointPolicyRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CreateEndpointPolicyRequest message. + * @function verify + * @memberof google.cloud.networkservices.v1beta1.CreateEndpointPolicyRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CreateEndpointPolicyRequest.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.endpointPolicyId != null && message.hasOwnProperty("endpointPolicyId")) + if (!$util.isString(message.endpointPolicyId)) + return "endpointPolicyId: string expected"; + if (message.endpointPolicy != null && message.hasOwnProperty("endpointPolicy")) { + var error = $root.google.cloud.networkservices.v1beta1.EndpointPolicy.verify(message.endpointPolicy); + if (error) + return "endpointPolicy." + error; + } + return null; + }; + + /** + * Creates a CreateEndpointPolicyRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.networkservices.v1beta1.CreateEndpointPolicyRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.networkservices.v1beta1.CreateEndpointPolicyRequest} CreateEndpointPolicyRequest + */ + CreateEndpointPolicyRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.networkservices.v1beta1.CreateEndpointPolicyRequest) + return object; + var message = new $root.google.cloud.networkservices.v1beta1.CreateEndpointPolicyRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.endpointPolicyId != null) + message.endpointPolicyId = String(object.endpointPolicyId); + if (object.endpointPolicy != null) { + if (typeof object.endpointPolicy !== "object") + throw TypeError(".google.cloud.networkservices.v1beta1.CreateEndpointPolicyRequest.endpointPolicy: object expected"); + message.endpointPolicy = $root.google.cloud.networkservices.v1beta1.EndpointPolicy.fromObject(object.endpointPolicy); + } + return message; + }; + + /** + * Creates a plain object from a CreateEndpointPolicyRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.networkservices.v1beta1.CreateEndpointPolicyRequest + * @static + * @param {google.cloud.networkservices.v1beta1.CreateEndpointPolicyRequest} message CreateEndpointPolicyRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CreateEndpointPolicyRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.endpointPolicyId = ""; + object.endpointPolicy = null; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.endpointPolicyId != null && message.hasOwnProperty("endpointPolicyId")) + object.endpointPolicyId = message.endpointPolicyId; + if (message.endpointPolicy != null && message.hasOwnProperty("endpointPolicy")) + object.endpointPolicy = $root.google.cloud.networkservices.v1beta1.EndpointPolicy.toObject(message.endpointPolicy, options); + return object; + }; + + /** + * Converts this CreateEndpointPolicyRequest to JSON. + * @function toJSON + * @memberof google.cloud.networkservices.v1beta1.CreateEndpointPolicyRequest + * @instance + * @returns {Object.} JSON object + */ + CreateEndpointPolicyRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CreateEndpointPolicyRequest + * @function getTypeUrl + * @memberof google.cloud.networkservices.v1beta1.CreateEndpointPolicyRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CreateEndpointPolicyRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.networkservices.v1beta1.CreateEndpointPolicyRequest"; + }; + + return CreateEndpointPolicyRequest; + })(); + + v1beta1.UpdateEndpointPolicyRequest = (function() { + + /** + * Properties of an UpdateEndpointPolicyRequest. + * @memberof google.cloud.networkservices.v1beta1 + * @interface IUpdateEndpointPolicyRequest + * @property {google.protobuf.IFieldMask|null} [updateMask] UpdateEndpointPolicyRequest updateMask + * @property {google.cloud.networkservices.v1beta1.IEndpointPolicy|null} [endpointPolicy] UpdateEndpointPolicyRequest endpointPolicy + */ + + /** + * Constructs a new UpdateEndpointPolicyRequest. + * @memberof google.cloud.networkservices.v1beta1 + * @classdesc Represents an UpdateEndpointPolicyRequest. + * @implements IUpdateEndpointPolicyRequest + * @constructor + * @param {google.cloud.networkservices.v1beta1.IUpdateEndpointPolicyRequest=} [properties] Properties to set + */ + function UpdateEndpointPolicyRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * UpdateEndpointPolicyRequest updateMask. + * @member {google.protobuf.IFieldMask|null|undefined} updateMask + * @memberof google.cloud.networkservices.v1beta1.UpdateEndpointPolicyRequest + * @instance + */ + UpdateEndpointPolicyRequest.prototype.updateMask = null; + + /** + * UpdateEndpointPolicyRequest endpointPolicy. + * @member {google.cloud.networkservices.v1beta1.IEndpointPolicy|null|undefined} endpointPolicy + * @memberof google.cloud.networkservices.v1beta1.UpdateEndpointPolicyRequest + * @instance + */ + UpdateEndpointPolicyRequest.prototype.endpointPolicy = null; + + /** + * Creates a new UpdateEndpointPolicyRequest instance using the specified properties. + * @function create + * @memberof google.cloud.networkservices.v1beta1.UpdateEndpointPolicyRequest + * @static + * @param {google.cloud.networkservices.v1beta1.IUpdateEndpointPolicyRequest=} [properties] Properties to set + * @returns {google.cloud.networkservices.v1beta1.UpdateEndpointPolicyRequest} UpdateEndpointPolicyRequest instance + */ + UpdateEndpointPolicyRequest.create = function create(properties) { + return new UpdateEndpointPolicyRequest(properties); + }; + + /** + * Encodes the specified UpdateEndpointPolicyRequest message. Does not implicitly {@link google.cloud.networkservices.v1beta1.UpdateEndpointPolicyRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.networkservices.v1beta1.UpdateEndpointPolicyRequest + * @static + * @param {google.cloud.networkservices.v1beta1.IUpdateEndpointPolicyRequest} message UpdateEndpointPolicyRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateEndpointPolicyRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.updateMask != null && Object.hasOwnProperty.call(message, "updateMask")) + $root.google.protobuf.FieldMask.encode(message.updateMask, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.endpointPolicy != null && Object.hasOwnProperty.call(message, "endpointPolicy")) + $root.google.cloud.networkservices.v1beta1.EndpointPolicy.encode(message.endpointPolicy, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified UpdateEndpointPolicyRequest message, length delimited. Does not implicitly {@link google.cloud.networkservices.v1beta1.UpdateEndpointPolicyRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.networkservices.v1beta1.UpdateEndpointPolicyRequest + * @static + * @param {google.cloud.networkservices.v1beta1.IUpdateEndpointPolicyRequest} message UpdateEndpointPolicyRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateEndpointPolicyRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an UpdateEndpointPolicyRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.networkservices.v1beta1.UpdateEndpointPolicyRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.networkservices.v1beta1.UpdateEndpointPolicyRequest} UpdateEndpointPolicyRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateEndpointPolicyRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.networkservices.v1beta1.UpdateEndpointPolicyRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.updateMask = $root.google.protobuf.FieldMask.decode(reader, reader.uint32()); + break; + } + case 2: { + message.endpointPolicy = $root.google.cloud.networkservices.v1beta1.EndpointPolicy.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an UpdateEndpointPolicyRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.networkservices.v1beta1.UpdateEndpointPolicyRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.networkservices.v1beta1.UpdateEndpointPolicyRequest} UpdateEndpointPolicyRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateEndpointPolicyRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an UpdateEndpointPolicyRequest message. + * @function verify + * @memberof google.cloud.networkservices.v1beta1.UpdateEndpointPolicyRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + UpdateEndpointPolicyRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.updateMask != null && message.hasOwnProperty("updateMask")) { + var error = $root.google.protobuf.FieldMask.verify(message.updateMask); + if (error) + return "updateMask." + error; + } + if (message.endpointPolicy != null && message.hasOwnProperty("endpointPolicy")) { + var error = $root.google.cloud.networkservices.v1beta1.EndpointPolicy.verify(message.endpointPolicy); + if (error) + return "endpointPolicy." + error; + } + return null; + }; + + /** + * Creates an UpdateEndpointPolicyRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.networkservices.v1beta1.UpdateEndpointPolicyRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.networkservices.v1beta1.UpdateEndpointPolicyRequest} UpdateEndpointPolicyRequest + */ + UpdateEndpointPolicyRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.networkservices.v1beta1.UpdateEndpointPolicyRequest) + return object; + var message = new $root.google.cloud.networkservices.v1beta1.UpdateEndpointPolicyRequest(); + if (object.updateMask != null) { + if (typeof object.updateMask !== "object") + throw TypeError(".google.cloud.networkservices.v1beta1.UpdateEndpointPolicyRequest.updateMask: object expected"); + message.updateMask = $root.google.protobuf.FieldMask.fromObject(object.updateMask); + } + if (object.endpointPolicy != null) { + if (typeof object.endpointPolicy !== "object") + throw TypeError(".google.cloud.networkservices.v1beta1.UpdateEndpointPolicyRequest.endpointPolicy: object expected"); + message.endpointPolicy = $root.google.cloud.networkservices.v1beta1.EndpointPolicy.fromObject(object.endpointPolicy); + } + return message; + }; + + /** + * Creates a plain object from an UpdateEndpointPolicyRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.networkservices.v1beta1.UpdateEndpointPolicyRequest + * @static + * @param {google.cloud.networkservices.v1beta1.UpdateEndpointPolicyRequest} message UpdateEndpointPolicyRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + UpdateEndpointPolicyRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.updateMask = null; + object.endpointPolicy = null; + } + if (message.updateMask != null && message.hasOwnProperty("updateMask")) + object.updateMask = $root.google.protobuf.FieldMask.toObject(message.updateMask, options); + if (message.endpointPolicy != null && message.hasOwnProperty("endpointPolicy")) + object.endpointPolicy = $root.google.cloud.networkservices.v1beta1.EndpointPolicy.toObject(message.endpointPolicy, options); + return object; + }; + + /** + * Converts this UpdateEndpointPolicyRequest to JSON. + * @function toJSON + * @memberof google.cloud.networkservices.v1beta1.UpdateEndpointPolicyRequest + * @instance + * @returns {Object.} JSON object + */ + UpdateEndpointPolicyRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for UpdateEndpointPolicyRequest + * @function getTypeUrl + * @memberof google.cloud.networkservices.v1beta1.UpdateEndpointPolicyRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + UpdateEndpointPolicyRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.networkservices.v1beta1.UpdateEndpointPolicyRequest"; + }; + + return UpdateEndpointPolicyRequest; + })(); + + v1beta1.DeleteEndpointPolicyRequest = (function() { + + /** + * Properties of a DeleteEndpointPolicyRequest. + * @memberof google.cloud.networkservices.v1beta1 + * @interface IDeleteEndpointPolicyRequest + * @property {string|null} [name] DeleteEndpointPolicyRequest name + */ + + /** + * Constructs a new DeleteEndpointPolicyRequest. + * @memberof google.cloud.networkservices.v1beta1 + * @classdesc Represents a DeleteEndpointPolicyRequest. + * @implements IDeleteEndpointPolicyRequest + * @constructor + * @param {google.cloud.networkservices.v1beta1.IDeleteEndpointPolicyRequest=} [properties] Properties to set + */ + function DeleteEndpointPolicyRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * DeleteEndpointPolicyRequest name. + * @member {string} name + * @memberof google.cloud.networkservices.v1beta1.DeleteEndpointPolicyRequest + * @instance + */ + DeleteEndpointPolicyRequest.prototype.name = ""; + + /** + * Creates a new DeleteEndpointPolicyRequest instance using the specified properties. + * @function create + * @memberof google.cloud.networkservices.v1beta1.DeleteEndpointPolicyRequest + * @static + * @param {google.cloud.networkservices.v1beta1.IDeleteEndpointPolicyRequest=} [properties] Properties to set + * @returns {google.cloud.networkservices.v1beta1.DeleteEndpointPolicyRequest} DeleteEndpointPolicyRequest instance + */ + DeleteEndpointPolicyRequest.create = function create(properties) { + return new DeleteEndpointPolicyRequest(properties); + }; + + /** + * Encodes the specified DeleteEndpointPolicyRequest message. Does not implicitly {@link google.cloud.networkservices.v1beta1.DeleteEndpointPolicyRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.networkservices.v1beta1.DeleteEndpointPolicyRequest + * @static + * @param {google.cloud.networkservices.v1beta1.IDeleteEndpointPolicyRequest} message DeleteEndpointPolicyRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteEndpointPolicyRequest.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 DeleteEndpointPolicyRequest message, length delimited. Does not implicitly {@link google.cloud.networkservices.v1beta1.DeleteEndpointPolicyRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.networkservices.v1beta1.DeleteEndpointPolicyRequest + * @static + * @param {google.cloud.networkservices.v1beta1.IDeleteEndpointPolicyRequest} message DeleteEndpointPolicyRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteEndpointPolicyRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DeleteEndpointPolicyRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.networkservices.v1beta1.DeleteEndpointPolicyRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.networkservices.v1beta1.DeleteEndpointPolicyRequest} DeleteEndpointPolicyRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteEndpointPolicyRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.networkservices.v1beta1.DeleteEndpointPolicyRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DeleteEndpointPolicyRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.networkservices.v1beta1.DeleteEndpointPolicyRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.networkservices.v1beta1.DeleteEndpointPolicyRequest} DeleteEndpointPolicyRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteEndpointPolicyRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DeleteEndpointPolicyRequest message. + * @function verify + * @memberof google.cloud.networkservices.v1beta1.DeleteEndpointPolicyRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DeleteEndpointPolicyRequest.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 DeleteEndpointPolicyRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.networkservices.v1beta1.DeleteEndpointPolicyRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.networkservices.v1beta1.DeleteEndpointPolicyRequest} DeleteEndpointPolicyRequest + */ + DeleteEndpointPolicyRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.networkservices.v1beta1.DeleteEndpointPolicyRequest) + return object; + var message = new $root.google.cloud.networkservices.v1beta1.DeleteEndpointPolicyRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a DeleteEndpointPolicyRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.networkservices.v1beta1.DeleteEndpointPolicyRequest + * @static + * @param {google.cloud.networkservices.v1beta1.DeleteEndpointPolicyRequest} message DeleteEndpointPolicyRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DeleteEndpointPolicyRequest.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 DeleteEndpointPolicyRequest to JSON. + * @function toJSON + * @memberof google.cloud.networkservices.v1beta1.DeleteEndpointPolicyRequest + * @instance + * @returns {Object.} JSON object + */ + DeleteEndpointPolicyRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DeleteEndpointPolicyRequest + * @function getTypeUrl + * @memberof google.cloud.networkservices.v1beta1.DeleteEndpointPolicyRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DeleteEndpointPolicyRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.networkservices.v1beta1.DeleteEndpointPolicyRequest"; + }; + + return DeleteEndpointPolicyRequest; + })(); + + v1beta1.NetworkServices = (function() { + + /** + * Constructs a new NetworkServices service. + * @memberof google.cloud.networkservices.v1beta1 + * @classdesc Represents a NetworkServices + * @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 NetworkServices(rpcImpl, requestDelimited, responseDelimited) { + $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); + } + + (NetworkServices.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = NetworkServices; + + /** + * Creates new NetworkServices service using the specified rpc implementation. + * @function create + * @memberof google.cloud.networkservices.v1beta1.NetworkServices + * @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 {NetworkServices} RPC service. Useful where requests and/or responses are streamed. + */ + NetworkServices.create = function create(rpcImpl, requestDelimited, responseDelimited) { + return new this(rpcImpl, requestDelimited, responseDelimited); + }; + + /** + * Callback as used by {@link google.cloud.networkservices.v1beta1.NetworkServices|listEndpointPolicies}. + * @memberof google.cloud.networkservices.v1beta1.NetworkServices + * @typedef ListEndpointPoliciesCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.networkservices.v1beta1.ListEndpointPoliciesResponse} [response] ListEndpointPoliciesResponse + */ + + /** + * Calls ListEndpointPolicies. + * @function listEndpointPolicies + * @memberof google.cloud.networkservices.v1beta1.NetworkServices + * @instance + * @param {google.cloud.networkservices.v1beta1.IListEndpointPoliciesRequest} request ListEndpointPoliciesRequest message or plain object + * @param {google.cloud.networkservices.v1beta1.NetworkServices.ListEndpointPoliciesCallback} callback Node-style callback called with the error, if any, and ListEndpointPoliciesResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(NetworkServices.prototype.listEndpointPolicies = function listEndpointPolicies(request, callback) { + return this.rpcCall(listEndpointPolicies, $root.google.cloud.networkservices.v1beta1.ListEndpointPoliciesRequest, $root.google.cloud.networkservices.v1beta1.ListEndpointPoliciesResponse, request, callback); + }, "name", { value: "ListEndpointPolicies" }); + + /** + * Calls ListEndpointPolicies. + * @function listEndpointPolicies + * @memberof google.cloud.networkservices.v1beta1.NetworkServices + * @instance + * @param {google.cloud.networkservices.v1beta1.IListEndpointPoliciesRequest} request ListEndpointPoliciesRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.networkservices.v1beta1.NetworkServices|getEndpointPolicy}. + * @memberof google.cloud.networkservices.v1beta1.NetworkServices + * @typedef GetEndpointPolicyCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.networkservices.v1beta1.EndpointPolicy} [response] EndpointPolicy + */ + + /** + * Calls GetEndpointPolicy. + * @function getEndpointPolicy + * @memberof google.cloud.networkservices.v1beta1.NetworkServices + * @instance + * @param {google.cloud.networkservices.v1beta1.IGetEndpointPolicyRequest} request GetEndpointPolicyRequest message or plain object + * @param {google.cloud.networkservices.v1beta1.NetworkServices.GetEndpointPolicyCallback} callback Node-style callback called with the error, if any, and EndpointPolicy + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(NetworkServices.prototype.getEndpointPolicy = function getEndpointPolicy(request, callback) { + return this.rpcCall(getEndpointPolicy, $root.google.cloud.networkservices.v1beta1.GetEndpointPolicyRequest, $root.google.cloud.networkservices.v1beta1.EndpointPolicy, request, callback); + }, "name", { value: "GetEndpointPolicy" }); + + /** + * Calls GetEndpointPolicy. + * @function getEndpointPolicy + * @memberof google.cloud.networkservices.v1beta1.NetworkServices + * @instance + * @param {google.cloud.networkservices.v1beta1.IGetEndpointPolicyRequest} request GetEndpointPolicyRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.networkservices.v1beta1.NetworkServices|createEndpointPolicy}. + * @memberof google.cloud.networkservices.v1beta1.NetworkServices + * @typedef CreateEndpointPolicyCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls CreateEndpointPolicy. + * @function createEndpointPolicy + * @memberof google.cloud.networkservices.v1beta1.NetworkServices + * @instance + * @param {google.cloud.networkservices.v1beta1.ICreateEndpointPolicyRequest} request CreateEndpointPolicyRequest message or plain object + * @param {google.cloud.networkservices.v1beta1.NetworkServices.CreateEndpointPolicyCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(NetworkServices.prototype.createEndpointPolicy = function createEndpointPolicy(request, callback) { + return this.rpcCall(createEndpointPolicy, $root.google.cloud.networkservices.v1beta1.CreateEndpointPolicyRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "CreateEndpointPolicy" }); + + /** + * Calls CreateEndpointPolicy. + * @function createEndpointPolicy + * @memberof google.cloud.networkservices.v1beta1.NetworkServices + * @instance + * @param {google.cloud.networkservices.v1beta1.ICreateEndpointPolicyRequest} request CreateEndpointPolicyRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.networkservices.v1beta1.NetworkServices|updateEndpointPolicy}. + * @memberof google.cloud.networkservices.v1beta1.NetworkServices + * @typedef UpdateEndpointPolicyCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls UpdateEndpointPolicy. + * @function updateEndpointPolicy + * @memberof google.cloud.networkservices.v1beta1.NetworkServices + * @instance + * @param {google.cloud.networkservices.v1beta1.IUpdateEndpointPolicyRequest} request UpdateEndpointPolicyRequest message or plain object + * @param {google.cloud.networkservices.v1beta1.NetworkServices.UpdateEndpointPolicyCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(NetworkServices.prototype.updateEndpointPolicy = function updateEndpointPolicy(request, callback) { + return this.rpcCall(updateEndpointPolicy, $root.google.cloud.networkservices.v1beta1.UpdateEndpointPolicyRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "UpdateEndpointPolicy" }); + + /** + * Calls UpdateEndpointPolicy. + * @function updateEndpointPolicy + * @memberof google.cloud.networkservices.v1beta1.NetworkServices + * @instance + * @param {google.cloud.networkservices.v1beta1.IUpdateEndpointPolicyRequest} request UpdateEndpointPolicyRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.networkservices.v1beta1.NetworkServices|deleteEndpointPolicy}. + * @memberof google.cloud.networkservices.v1beta1.NetworkServices + * @typedef DeleteEndpointPolicyCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls DeleteEndpointPolicy. + * @function deleteEndpointPolicy + * @memberof google.cloud.networkservices.v1beta1.NetworkServices + * @instance + * @param {google.cloud.networkservices.v1beta1.IDeleteEndpointPolicyRequest} request DeleteEndpointPolicyRequest message or plain object + * @param {google.cloud.networkservices.v1beta1.NetworkServices.DeleteEndpointPolicyCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(NetworkServices.prototype.deleteEndpointPolicy = function deleteEndpointPolicy(request, callback) { + return this.rpcCall(deleteEndpointPolicy, $root.google.cloud.networkservices.v1beta1.DeleteEndpointPolicyRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "DeleteEndpointPolicy" }); + + /** + * Calls DeleteEndpointPolicy. + * @function deleteEndpointPolicy + * @memberof google.cloud.networkservices.v1beta1.NetworkServices + * @instance + * @param {google.cloud.networkservices.v1beta1.IDeleteEndpointPolicyRequest} request DeleteEndpointPolicyRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + return NetworkServices; + })(); + + return v1beta1; + })(); + + return networkservices; + })(); + + return cloud; + })(); + + google.api = (function() { + + /** + * Namespace api. + * @memberof google + * @namespace + */ + var api = {}; + + /** + * 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 + */ + 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; + 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) { + 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(); + 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) { + 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(); + 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; + })(); + + 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) { + 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(); + 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) { + 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(); + 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) { + 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(); + 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) { + 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(); + 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) { + 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(); + 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 + */ + + /** + * 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; + + /** + * 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(); + 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) { + 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(); + 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; + } + 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: + 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; + } + } + 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; + } + 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]); + } + } + 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; + } + 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); + } + 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) { + 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(); + 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) { + 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(); + 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) { + 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(); + 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) { + 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(); + 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) { + 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(); + 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 + */ + + /** + * 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) { + if (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; + + /** + * 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(); + 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) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.DotnetSettings(); + while (reader.pos < end) { + var tag = reader.uint32(); + 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 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; + } + 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); + } + 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.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 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) { + 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(); + 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) { + 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(); + 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 + */ + + /** + * 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) { + if (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; + + /** + * 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(); + 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) { + 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(); + switch (tag >>> 3) { + case 1: { + message.selector = reader.string(); + break; + } + case 2: { + message.longRunning = $root.google.api.MethodSettings.LongRunning.decode(reader, reader.uint32()); + 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; + } + 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); + } + 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.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); + 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) { + 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(); + 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 + */ + 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; + 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; + })(); + + 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) { + 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(); + 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; + })(); + + 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 {string|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 {string} edition + * @memberof google.protobuf.FileDescriptorProto + * @instance + */ + FileDescriptorProto.prototype.edition = ""; + + /** + * 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 13, wireType 2 =*/106).string(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) { + 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(); + 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 13: { + message.edition = reader.string(); + 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")) + if (!$util.isString(message.edition)) + return "edition: string expected"; + 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); + if (object.edition != null) + message.edition = String(object.edition); + 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 = ""; + } + 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 = 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) { + 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(); + 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) { + 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(); + 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) { + 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(); + 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 + */ + + /** + * 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 = []; + if (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; + + /** + * 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.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) { + 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(); + 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; + } + 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; + } + } + 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]); + } + } + 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.uninterpretedOption = []; + 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"; + }; + + 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) { + 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(); + 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 2: + case 3: + 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_REQUIRED": + case 2: + message.label = 2; + break; + case "LABEL_REPEATED": + case 3: + message.label = 3; + 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_REQUIRED=2 LABEL_REQUIRED value + * @property {number} LABEL_REPEATED=3 LABEL_REPEATED value + */ + FieldDescriptorProto.Label = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[1] = "LABEL_OPTIONAL"] = 1; + values[valuesById[2] = "LABEL_REQUIRED"] = 2; + values[valuesById[3] = "LABEL_REPEATED"] = 3; + 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) { + 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(); + 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) { + 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(); + 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) { + 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(); + 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) { + 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(); + 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) { + 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(); + 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) { + 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(); + 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} [phpGenericServices] FileOptions phpGenericServices + * @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 {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 phpGenericServices. + * @member {boolean} phpGenericServices + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.phpGenericServices = 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 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.phpGenericServices != null && Object.hasOwnProperty.call(message, "phpGenericServices")) + writer.uint32(/* id 42, wireType 0 =*/336).bool(message.phpGenericServices); + 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.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) { + 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(); + 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 42: { + message.phpGenericServices = 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 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.phpGenericServices != null && message.hasOwnProperty("phpGenericServices")) + if (typeof message.phpGenericServices !== "boolean") + return "phpGenericServices: 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.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.phpGenericServices != null) + message.phpGenericServices = Boolean(object.phpGenericServices); + 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.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.phpGenericServices = false; + object.phpMetadataNamespace = ""; + object.rubyPackage = ""; + } + 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.phpGenericServices != null && message.hasOwnProperty("phpGenericServices")) + object.phpGenericServices = message.phpGenericServices; + if (message.phpMetadataNamespace != null && message.hasOwnProperty("phpMetadataNamespace")) + object.phpMetadataNamespace = message.phpMetadataNamespace; + if (message.rubyPackage != null && message.hasOwnProperty("rubyPackage")) + object.rubyPackage = message.rubyPackage; + 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 {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 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.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) { + 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(); + 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 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.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.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[".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.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 {google.protobuf.FieldOptions.OptionTargetType|null} [target] FieldOptions target + * @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.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 target. + * @member {google.protobuf.FieldOptions.OptionTargetType} target + * @memberof google.protobuf.FieldOptions + * @instance + */ + FieldOptions.prototype.target = 0; + + /** + * 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.target != null && Object.hasOwnProperty.call(message, "target")) + writer.uint32(/* id 18, wireType 0 =*/144).int32(message.target); + 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) { + writer.uint32(/* id 1052, wireType 2 =*/8418).fork(); + for (var i = 0; i < message[".google.api.fieldBehavior"].length; ++i) + writer.int32(message[".google.api.fieldBehavior"][i]); + writer.ldelim(); + } + 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) { + 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(); + 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 18: { + message.target = reader.int32(); + 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.target != null && message.hasOwnProperty("target")) + switch (message.target) { + default: + return "target: 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.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: + 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; + } + switch (object.target) { + default: + if (typeof object.target === "number") { + message.target = object.target; + break; + } + break; + case "TARGET_TYPE_UNKNOWN": + case 0: + message.target = 0; + break; + case "TARGET_TYPE_FILE": + case 1: + message.target = 1; + break; + case "TARGET_TYPE_EXTENSION_RANGE": + case 2: + message.target = 2; + break; + case "TARGET_TYPE_MESSAGE": + case 3: + message.target = 3; + break; + case "TARGET_TYPE_FIELD": + case 4: + message.target = 4; + break; + case "TARGET_TYPE_ONEOF": + case 5: + message.target = 5; + break; + case "TARGET_TYPE_ENUM": + case 6: + message.target = 6; + break; + case "TARGET_TYPE_ENUM_ENTRY": + case 7: + message.target = 7; + break; + case "TARGET_TYPE_SERVICE": + case 8: + message.target = 8; + break; + case "TARGET_TYPE_METHOD": + case 9: + message.target = 9; + break; + } + 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; + } + } + 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.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.target = options.enums === String ? "TARGET_TYPE_UNKNOWN" : 0; + 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.target != null && message.hasOwnProperty("target")) + object.target = options.enums === String ? $root.google.protobuf.FieldOptions.OptionTargetType[message.target] === undefined ? message.target : $root.google.protobuf.FieldOptions.OptionTargetType[message.target] : message.target; + 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; + })(); + + return FieldOptions; + })(); + + protobuf.OneofOptions = (function() { + + /** + * Properties of an OneofOptions. + * @memberof google.protobuf + * @interface IOneofOptions + * @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 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.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) { + 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(); + 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; + } + 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.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.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 (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 {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 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.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) { + 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(); + 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 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.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.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; + } + 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.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 {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 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.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) { + 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(); + switch (tag >>> 3) { + case 1: { + 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; + } + 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.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.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; + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + object.deprecated = message.deprecated; + 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 {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 + */ + + /** + * 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 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"] = ""; + + /** + * 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.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"]); + 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) { + 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(); + switch (tag >>> 3) { + 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; + } + 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.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"; + 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.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"]); + 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[".google.api.defaultHost"] = ""; + object[".google.api.oauthScopes"] = ""; + } + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + object.deprecated = message.deprecated; + 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"]; + 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 {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 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.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) { + 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(); + switch (tag >>> 3) { + case 33: { + message.deprecated = reader.bool(); + break; + } + case 34: { + message.idempotencyLevel = reader.int32(); + 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.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.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[".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.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) { + 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(); + 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) { + 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(); + 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.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) { + 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(); + 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) { + 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(); + 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) { + 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(); + 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) { + 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(); + 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.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) { + 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(); + 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.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) { + 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(); + 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.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) { + 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(); + 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) { + 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(); + 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) { + 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(); + 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; + })(); + + 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) { + 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(); + 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) { + 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(); + 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) { + 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(); + 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) { + 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(); + 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) { + 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(); + 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) { + 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(); + 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) { + 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(); + 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) { + 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(); + 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) { + 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(); + 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/google-cloud-networkservices/protos/protos.json b/packages/google-cloud-networkservices/protos/protos.json new file mode 100644 index 00000000000..74280191ca1 --- /dev/null +++ b/packages/google-cloud-networkservices/protos/protos.json @@ -0,0 +1,5503 @@ +{ + "nested": { + "google": { + "nested": { + "cloud": { + "nested": { + "networkservices": { + "nested": { + "v1": { + "options": { + "csharp_namespace": "Google.Cloud.NetworkServices.V1", + "go_package": "cloud.google.com/go/networkservices/apiv1/networkservicespb;networkservicespb", + "java_multiple_files": true, + "java_outer_classname": "TlsRouteProto", + "java_package": "com.google.cloud.networkservices.v1", + "php_namespace": "Google\\Cloud\\NetworkServices\\V1", + "ruby_package": "Google::Cloud::NetworkServices::V1", + "(google.api.resource_definition).type": "compute.googleapis.com/BackendService", + "(google.api.resource_definition).pattern": "projects/{project}/locations/{location}/backendServices/{backend_service}" + }, + "nested": { + "OperationMetadata": { + "fields": { + "createTime": { + "type": "google.protobuf.Timestamp", + "id": 1, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "endTime": { + "type": "google.protobuf.Timestamp", + "id": 2, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "target": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "verb": { + "type": "string", + "id": 4, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "statusMessage": { + "type": "string", + "id": 5, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "requestedCancellation": { + "type": "bool", + "id": 6, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "apiVersion": { + "type": "string", + "id": 7, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + } + } + }, + "TrafficPortSelector": { + "fields": { + "ports": { + "rule": "repeated", + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "EndpointMatcher": { + "oneofs": { + "matcherType": { + "oneof": [ + "metadataLabelMatcher" + ] + } + }, + "fields": { + "metadataLabelMatcher": { + "type": "MetadataLabelMatcher", + "id": 1 + } + }, + "nested": { + "MetadataLabelMatcher": { + "fields": { + "metadataLabelMatchCriteria": { + "type": "MetadataLabelMatchCriteria", + "id": 1 + }, + "metadataLabels": { + "rule": "repeated", + "type": "MetadataLabels", + "id": 2 + } + }, + "nested": { + "MetadataLabels": { + "fields": { + "labelName": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "labelValue": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "MetadataLabelMatchCriteria": { + "values": { + "METADATA_LABEL_MATCH_CRITERIA_UNSPECIFIED": 0, + "MATCH_ANY": 1, + "MATCH_ALL": 2 + } + } + } + } + } + }, + "EndpointPolicy": { + "options": { + "(google.api.resource).type": "networkservices.googleapis.com/EndpointPolicy", + "(google.api.resource).pattern": "projects/{project}/locations/{location}/endpointPolicies/{endpoint_policy}" + }, + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "createTime": { + "type": "google.protobuf.Timestamp", + "id": 2, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "updateTime": { + "type": "google.protobuf.Timestamp", + "id": 3, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "labels": { + "keyType": "string", + "type": "string", + "id": 4, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "type": { + "type": "EndpointPolicyType", + "id": 5, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "authorizationPolicy": { + "type": "string", + "id": 7, + "options": { + "(google.api.field_behavior)": "OPTIONAL", + "(google.api.resource_reference).type": "networksecurity.googleapis.com/AuthorizationPolicy" + } + }, + "endpointMatcher": { + "type": "EndpointMatcher", + "id": 9, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "trafficPortSelector": { + "type": "TrafficPortSelector", + "id": 10, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "description": { + "type": "string", + "id": 11, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "serverTlsPolicy": { + "type": "string", + "id": 12, + "options": { + "(google.api.field_behavior)": "OPTIONAL", + "(google.api.resource_reference).type": "networksecurity.googleapis.com/ServerTlsPolicy" + } + }, + "clientTlsPolicy": { + "type": "string", + "id": 13, + "options": { + "(google.api.field_behavior)": "OPTIONAL", + "(google.api.resource_reference).type": "networksecurity.googleapis.com/ClientTlsPolicy" + } + } + }, + "nested": { + "EndpointPolicyType": { + "values": { + "ENDPOINT_POLICY_TYPE_UNSPECIFIED": 0, + "SIDECAR_PROXY": 1, + "GRPC_SERVER": 2 + } + } + } + }, + "ListEndpointPoliciesRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).child_type": "networkservices.googleapis.com/EndpointPolicy" + } + }, + "pageSize": { + "type": "int32", + "id": 2 + }, + "pageToken": { + "type": "string", + "id": 3 + } + } + }, + "ListEndpointPoliciesResponse": { + "fields": { + "endpointPolicies": { + "rule": "repeated", + "type": "EndpointPolicy", + "id": 1 + }, + "nextPageToken": { + "type": "string", + "id": 2 + } + } + }, + "GetEndpointPolicyRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "networkservices.googleapis.com/EndpointPolicy" + } + } + } + }, + "CreateEndpointPolicyRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).child_type": "networkservices.googleapis.com/EndpointPolicy" + } + }, + "endpointPolicyId": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "endpointPolicy": { + "type": "EndpointPolicy", + "id": 3, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "UpdateEndpointPolicyRequest": { + "fields": { + "updateMask": { + "type": "google.protobuf.FieldMask", + "id": 1, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "endpointPolicy": { + "type": "EndpointPolicy", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "DeleteEndpointPolicyRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "networkservices.googleapis.com/EndpointPolicy" + } + } + } + }, + "Gateway": { + "options": { + "(google.api.resource).type": "networkservices.googleapis.com/Gateway", + "(google.api.resource).pattern": "projects/{project}/locations/{location}/gateways/{gateway}" + }, + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "selfLink": { + "type": "string", + "id": 13, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "createTime": { + "type": "google.protobuf.Timestamp", + "id": 2, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "updateTime": { + "type": "google.protobuf.Timestamp", + "id": 3, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "labels": { + "keyType": "string", + "type": "string", + "id": 4, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "description": { + "type": "string", + "id": 5, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "type": { + "type": "Type", + "id": 6, + "options": { + "(google.api.field_behavior)": "IMMUTABLE" + } + }, + "ports": { + "rule": "repeated", + "type": "int32", + "id": 11, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "scope": { + "type": "string", + "id": 8, + "options": { + "(google.api.field_behavior)": "IMMUTABLE" + } + }, + "serverTlsPolicy": { + "type": "string", + "id": 9, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + }, + "nested": { + "Type": { + "values": { + "TYPE_UNSPECIFIED": 0, + "OPEN_MESH": 1, + "SECURE_WEB_GATEWAY": 2 + } + } + } + }, + "ListGatewaysRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).child_type": "networkservices.googleapis.com/Gateway" + } + }, + "pageSize": { + "type": "int32", + "id": 2 + }, + "pageToken": { + "type": "string", + "id": 3 + } + } + }, + "ListGatewaysResponse": { + "fields": { + "gateways": { + "rule": "repeated", + "type": "Gateway", + "id": 1 + }, + "nextPageToken": { + "type": "string", + "id": 2 + } + } + }, + "GetGatewayRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "networkservices.googleapis.com/Gateway" + } + } + } + }, + "CreateGatewayRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).child_type": "networkservices.googleapis.com/Gateway" + } + }, + "gatewayId": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "gateway": { + "type": "Gateway", + "id": 3, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "UpdateGatewayRequest": { + "fields": { + "updateMask": { + "type": "google.protobuf.FieldMask", + "id": 1, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "gateway": { + "type": "Gateway", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "DeleteGatewayRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "networkservices.googleapis.com/Gateway" + } + } + } + }, + "GrpcRoute": { + "options": { + "(google.api.resource).type": "networkservices.googleapis.com/GrpcRoute", + "(google.api.resource).pattern": "projects/{project}/locations/{location}/grpcRoutes/{grpc_route}" + }, + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "selfLink": { + "type": "string", + "id": 12, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "createTime": { + "type": "google.protobuf.Timestamp", + "id": 2, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "updateTime": { + "type": "google.protobuf.Timestamp", + "id": 3, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "labels": { + "keyType": "string", + "type": "string", + "id": 4, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "description": { + "type": "string", + "id": 5, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "hostnames": { + "rule": "repeated", + "type": "string", + "id": 6, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "meshes": { + "rule": "repeated", + "type": "string", + "id": 9, + "options": { + "(google.api.field_behavior)": "OPTIONAL", + "(google.api.resource_reference).type": "networkservices.googleapis.com/Mesh" + } + }, + "gateways": { + "rule": "repeated", + "type": "string", + "id": 10, + "options": { + "(google.api.field_behavior)": "OPTIONAL", + "(google.api.resource_reference).type": "networkservices.googleapis.com/Gateway" + } + }, + "rules": { + "rule": "repeated", + "type": "RouteRule", + "id": 7, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + }, + "nested": { + "MethodMatch": { + "oneofs": { + "_caseSensitive": { + "oneof": [ + "caseSensitive" + ] + } + }, + "fields": { + "type": { + "type": "Type", + "id": 1, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "grpcService": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "grpcMethod": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "caseSensitive": { + "type": "bool", + "id": 4, + "options": { + "(google.api.field_behavior)": "OPTIONAL", + "proto3_optional": true + } + } + }, + "nested": { + "Type": { + "values": { + "TYPE_UNSPECIFIED": 0, + "EXACT": 1, + "REGULAR_EXPRESSION": 2 + } + } + } + }, + "HeaderMatch": { + "fields": { + "type": { + "type": "Type", + "id": 1, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "key": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "value": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + }, + "nested": { + "Type": { + "values": { + "TYPE_UNSPECIFIED": 0, + "EXACT": 1, + "REGULAR_EXPRESSION": 2 + } + } + } + }, + "RouteMatch": { + "oneofs": { + "_method": { + "oneof": [ + "method" + ] + } + }, + "fields": { + "method": { + "type": "MethodMatch", + "id": 1, + "options": { + "(google.api.field_behavior)": "OPTIONAL", + "proto3_optional": true + } + }, + "headers": { + "rule": "repeated", + "type": "HeaderMatch", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "Destination": { + "oneofs": { + "destinationType": { + "oneof": [ + "serviceName" + ] + }, + "_weight": { + "oneof": [ + "weight" + ] + } + }, + "fields": { + "serviceName": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "compute.googleapis.com/BackendService" + } + }, + "weight": { + "type": "int32", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL", + "proto3_optional": true + } + } + } + }, + "FaultInjectionPolicy": { + "oneofs": { + "_delay": { + "oneof": [ + "delay" + ] + }, + "_abort": { + "oneof": [ + "abort" + ] + } + }, + "fields": { + "delay": { + "type": "Delay", + "id": 1, + "options": { + "proto3_optional": true + } + }, + "abort": { + "type": "Abort", + "id": 2, + "options": { + "proto3_optional": true + } + } + }, + "nested": { + "Delay": { + "oneofs": { + "_fixedDelay": { + "oneof": [ + "fixedDelay" + ] + }, + "_percentage": { + "oneof": [ + "percentage" + ] + } + }, + "fields": { + "fixedDelay": { + "type": "google.protobuf.Duration", + "id": 1, + "options": { + "proto3_optional": true + } + }, + "percentage": { + "type": "int32", + "id": 2, + "options": { + "proto3_optional": true + } + } + } + }, + "Abort": { + "oneofs": { + "_httpStatus": { + "oneof": [ + "httpStatus" + ] + }, + "_percentage": { + "oneof": [ + "percentage" + ] + } + }, + "fields": { + "httpStatus": { + "type": "int32", + "id": 1, + "options": { + "proto3_optional": true + } + }, + "percentage": { + "type": "int32", + "id": 2, + "options": { + "proto3_optional": true + } + } + } + } + } + }, + "RetryPolicy": { + "fields": { + "retryConditions": { + "rule": "repeated", + "type": "string", + "id": 1 + }, + "numRetries": { + "type": "uint32", + "id": 2 + } + } + }, + "RouteAction": { + "fields": { + "destinations": { + "rule": "repeated", + "type": "Destination", + "id": 1, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "faultInjectionPolicy": { + "type": "FaultInjectionPolicy", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "timeout": { + "type": "google.protobuf.Duration", + "id": 7, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "retryPolicy": { + "type": "RetryPolicy", + "id": 8, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "RouteRule": { + "fields": { + "matches": { + "rule": "repeated", + "type": "RouteMatch", + "id": 1, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "action": { + "type": "RouteAction", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + } + } + }, + "ListGrpcRoutesRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).child_type": "networkservices.googleapis.com/GrpcRoute" + } + }, + "pageSize": { + "type": "int32", + "id": 2 + }, + "pageToken": { + "type": "string", + "id": 3 + } + } + }, + "ListGrpcRoutesResponse": { + "fields": { + "grpcRoutes": { + "rule": "repeated", + "type": "GrpcRoute", + "id": 1 + }, + "nextPageToken": { + "type": "string", + "id": 2 + } + } + }, + "GetGrpcRouteRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "networkservices.googleapis.com/GrpcRoute" + } + } + } + }, + "CreateGrpcRouteRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).child_type": "networkservices.googleapis.com/GrpcRoute" + } + }, + "grpcRouteId": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "grpcRoute": { + "type": "GrpcRoute", + "id": 3, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "UpdateGrpcRouteRequest": { + "fields": { + "updateMask": { + "type": "google.protobuf.FieldMask", + "id": 1, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "grpcRoute": { + "type": "GrpcRoute", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "DeleteGrpcRouteRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "networkservices.googleapis.com/GrpcRoute" + } + } + } + }, + "HttpRoute": { + "options": { + "(google.api.resource).type": "networkservices.googleapis.com/HttpRoute", + "(google.api.resource).pattern": "projects/{project}/locations/{location}/httpRoutes/{http_route}" + }, + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "selfLink": { + "type": "string", + "id": 11, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "description": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "createTime": { + "type": "google.protobuf.Timestamp", + "id": 3, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "updateTime": { + "type": "google.protobuf.Timestamp", + "id": 4, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "hostnames": { + "rule": "repeated", + "type": "string", + "id": 5, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "meshes": { + "rule": "repeated", + "type": "string", + "id": 8, + "options": { + "(google.api.field_behavior)": "OPTIONAL", + "(google.api.resource_reference).type": "networkservices.googleapis.com/Mesh" + } + }, + "gateways": { + "rule": "repeated", + "type": "string", + "id": 9, + "options": { + "(google.api.field_behavior)": "OPTIONAL", + "(google.api.resource_reference).type": "networkservices.googleapis.com/Gateway" + } + }, + "labels": { + "keyType": "string", + "type": "string", + "id": 10, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "rules": { + "rule": "repeated", + "type": "RouteRule", + "id": 6, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + }, + "nested": { + "HeaderMatch": { + "oneofs": { + "MatchType": { + "oneof": [ + "exactMatch", + "regexMatch", + "prefixMatch", + "presentMatch", + "suffixMatch", + "rangeMatch" + ] + } + }, + "fields": { + "exactMatch": { + "type": "string", + "id": 2 + }, + "regexMatch": { + "type": "string", + "id": 3 + }, + "prefixMatch": { + "type": "string", + "id": 4 + }, + "presentMatch": { + "type": "bool", + "id": 5 + }, + "suffixMatch": { + "type": "string", + "id": 6 + }, + "rangeMatch": { + "type": "IntegerRange", + "id": 7 + }, + "header": { + "type": "string", + "id": 1 + }, + "invertMatch": { + "type": "bool", + "id": 8 + } + }, + "nested": { + "IntegerRange": { + "fields": { + "start": { + "type": "int32", + "id": 1 + }, + "end": { + "type": "int32", + "id": 2 + } + } + } + } + }, + "QueryParameterMatch": { + "oneofs": { + "MatchType": { + "oneof": [ + "exactMatch", + "regexMatch", + "presentMatch" + ] + } + }, + "fields": { + "exactMatch": { + "type": "string", + "id": 2 + }, + "regexMatch": { + "type": "string", + "id": 3 + }, + "presentMatch": { + "type": "bool", + "id": 4 + }, + "queryParameter": { + "type": "string", + "id": 1 + } + } + }, + "RouteMatch": { + "oneofs": { + "PathMatch": { + "oneof": [ + "fullPathMatch", + "prefixMatch", + "regexMatch" + ] + } + }, + "fields": { + "fullPathMatch": { + "type": "string", + "id": 1 + }, + "prefixMatch": { + "type": "string", + "id": 2 + }, + "regexMatch": { + "type": "string", + "id": 3 + }, + "ignoreCase": { + "type": "bool", + "id": 4 + }, + "headers": { + "rule": "repeated", + "type": "HeaderMatch", + "id": 5 + }, + "queryParameters": { + "rule": "repeated", + "type": "QueryParameterMatch", + "id": 6 + } + } + }, + "Destination": { + "fields": { + "serviceName": { + "type": "string", + "id": 1, + "options": { + "(google.api.resource_reference).type": "compute.googleapis.com/BackendService" + } + }, + "weight": { + "type": "int32", + "id": 2 + } + } + }, + "Redirect": { + "fields": { + "hostRedirect": { + "type": "string", + "id": 1 + }, + "pathRedirect": { + "type": "string", + "id": 2 + }, + "prefixRewrite": { + "type": "string", + "id": 3 + }, + "responseCode": { + "type": "ResponseCode", + "id": 4 + }, + "httpsRedirect": { + "type": "bool", + "id": 5 + }, + "stripQuery": { + "type": "bool", + "id": 6 + }, + "portRedirect": { + "type": "int32", + "id": 7 + } + }, + "nested": { + "ResponseCode": { + "values": { + "RESPONSE_CODE_UNSPECIFIED": 0, + "MOVED_PERMANENTLY_DEFAULT": 1, + "FOUND": 2, + "SEE_OTHER": 3, + "TEMPORARY_REDIRECT": 4, + "PERMANENT_REDIRECT": 5 + } + } + } + }, + "FaultInjectionPolicy": { + "fields": { + "delay": { + "type": "Delay", + "id": 1 + }, + "abort": { + "type": "Abort", + "id": 2 + } + }, + "nested": { + "Delay": { + "fields": { + "fixedDelay": { + "type": "google.protobuf.Duration", + "id": 1 + }, + "percentage": { + "type": "int32", + "id": 2 + } + } + }, + "Abort": { + "fields": { + "httpStatus": { + "type": "int32", + "id": 1 + }, + "percentage": { + "type": "int32", + "id": 2 + } + } + } + } + }, + "HeaderModifier": { + "fields": { + "set": { + "keyType": "string", + "type": "string", + "id": 1 + }, + "add": { + "keyType": "string", + "type": "string", + "id": 2 + }, + "remove": { + "rule": "repeated", + "type": "string", + "id": 3 + } + } + }, + "URLRewrite": { + "fields": { + "pathPrefixRewrite": { + "type": "string", + "id": 1 + }, + "hostRewrite": { + "type": "string", + "id": 2 + } + } + }, + "RetryPolicy": { + "fields": { + "retryConditions": { + "rule": "repeated", + "type": "string", + "id": 1 + }, + "numRetries": { + "type": "int32", + "id": 2 + }, + "perTryTimeout": { + "type": "google.protobuf.Duration", + "id": 3 + } + } + }, + "RequestMirrorPolicy": { + "fields": { + "destination": { + "type": "Destination", + "id": 1 + } + } + }, + "CorsPolicy": { + "fields": { + "allowOrigins": { + "rule": "repeated", + "type": "string", + "id": 1 + }, + "allowOriginRegexes": { + "rule": "repeated", + "type": "string", + "id": 2 + }, + "allowMethods": { + "rule": "repeated", + "type": "string", + "id": 3 + }, + "allowHeaders": { + "rule": "repeated", + "type": "string", + "id": 4 + }, + "exposeHeaders": { + "rule": "repeated", + "type": "string", + "id": 5 + }, + "maxAge": { + "type": "string", + "id": 6 + }, + "allowCredentials": { + "type": "bool", + "id": 7 + }, + "disabled": { + "type": "bool", + "id": 8 + } + } + }, + "RouteAction": { + "fields": { + "destinations": { + "rule": "repeated", + "type": "Destination", + "id": 1 + }, + "redirect": { + "type": "Redirect", + "id": 2 + }, + "faultInjectionPolicy": { + "type": "FaultInjectionPolicy", + "id": 4 + }, + "requestHeaderModifier": { + "type": "HeaderModifier", + "id": 5 + }, + "responseHeaderModifier": { + "type": "HeaderModifier", + "id": 6 + }, + "urlRewrite": { + "type": "URLRewrite", + "id": 7 + }, + "timeout": { + "type": "google.protobuf.Duration", + "id": 8 + }, + "retryPolicy": { + "type": "RetryPolicy", + "id": 9 + }, + "requestMirrorPolicy": { + "type": "RequestMirrorPolicy", + "id": 10 + }, + "corsPolicy": { + "type": "CorsPolicy", + "id": 11 + } + } + }, + "RouteRule": { + "fields": { + "matches": { + "rule": "repeated", + "type": "RouteMatch", + "id": 1 + }, + "action": { + "type": "RouteAction", + "id": 2 + } + } + } + } + }, + "ListHttpRoutesRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).child_type": "networkservices.googleapis.com/HttpRoute" + } + }, + "pageSize": { + "type": "int32", + "id": 2 + }, + "pageToken": { + "type": "string", + "id": 3 + } + } + }, + "ListHttpRoutesResponse": { + "fields": { + "httpRoutes": { + "rule": "repeated", + "type": "HttpRoute", + "id": 1 + }, + "nextPageToken": { + "type": "string", + "id": 2 + } + } + }, + "GetHttpRouteRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "networkservices.googleapis.com/HttpRoute" + } + } + } + }, + "CreateHttpRouteRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).child_type": "networkservices.googleapis.com/HttpRoute" + } + }, + "httpRouteId": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "httpRoute": { + "type": "HttpRoute", + "id": 3, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "UpdateHttpRouteRequest": { + "fields": { + "updateMask": { + "type": "google.protobuf.FieldMask", + "id": 1, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "httpRoute": { + "type": "HttpRoute", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "DeleteHttpRouteRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "networkservices.googleapis.com/HttpRoute" + } + } + } + }, + "Mesh": { + "options": { + "(google.api.resource).type": "networkservices.googleapis.com/Mesh", + "(google.api.resource).pattern": "projects/{project}/locations/{location}/meshes/{mesh}" + }, + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "selfLink": { + "type": "string", + "id": 9, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "createTime": { + "type": "google.protobuf.Timestamp", + "id": 2, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "updateTime": { + "type": "google.protobuf.Timestamp", + "id": 3, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "labels": { + "keyType": "string", + "type": "string", + "id": 4, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "description": { + "type": "string", + "id": 5, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "interceptionPort": { + "type": "int32", + "id": 8, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "ListMeshesRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).child_type": "networkservices.googleapis.com/Mesh" + } + }, + "pageSize": { + "type": "int32", + "id": 2 + }, + "pageToken": { + "type": "string", + "id": 3 + } + } + }, + "ListMeshesResponse": { + "fields": { + "meshes": { + "rule": "repeated", + "type": "Mesh", + "id": 1 + }, + "nextPageToken": { + "type": "string", + "id": 2 + } + } + }, + "GetMeshRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "networkservices.googleapis.com/Mesh" + } + } + } + }, + "CreateMeshRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).child_type": "networkservices.googleapis.com/Mesh" + } + }, + "meshId": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "mesh": { + "type": "Mesh", + "id": 3, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "UpdateMeshRequest": { + "fields": { + "updateMask": { + "type": "google.protobuf.FieldMask", + "id": 1, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "mesh": { + "type": "Mesh", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "DeleteMeshRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "networkservices.googleapis.com/Mesh" + } + } + } + }, + "NetworkServices": { + "options": { + "(google.api.default_host)": "networkservices.googleapis.com", + "(google.api.oauth_scopes)": "https://www.googleapis.com/auth/cloud-platform" + }, + "methods": { + "ListEndpointPolicies": { + "requestType": "ListEndpointPoliciesRequest", + "responseType": "ListEndpointPoliciesResponse", + "options": { + "(google.api.http).get": "/v1/{parent=projects/*/locations/*}/endpointPolicies", + "(google.api.method_signature)": "parent" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1/{parent=projects/*/locations/*}/endpointPolicies" + } + }, + { + "(google.api.method_signature)": "parent" + } + ] + }, + "GetEndpointPolicy": { + "requestType": "GetEndpointPolicyRequest", + "responseType": "EndpointPolicy", + "options": { + "(google.api.http).get": "/v1/{name=projects/*/locations/*/endpointPolicies/*}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1/{name=projects/*/locations/*/endpointPolicies/*}" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "CreateEndpointPolicy": { + "requestType": "CreateEndpointPolicyRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).post": "/v1/{parent=projects/*/locations/*}/endpointPolicies", + "(google.api.http).body": "endpoint_policy", + "(google.api.method_signature)": "parent,endpoint_policy,endpoint_policy_id", + "(google.longrunning.operation_info).response_type": "EndpointPolicy", + "(google.longrunning.operation_info).metadata_type": "google.cloud.networkservices.v1.OperationMetadata" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1/{parent=projects/*/locations/*}/endpointPolicies", + "body": "endpoint_policy" + } + }, + { + "(google.api.method_signature)": "parent,endpoint_policy,endpoint_policy_id" + }, + { + "(google.longrunning.operation_info)": { + "response_type": "EndpointPolicy", + "metadata_type": "google.cloud.networkservices.v1.OperationMetadata" + } + } + ] + }, + "UpdateEndpointPolicy": { + "requestType": "UpdateEndpointPolicyRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).patch": "/v1/{endpoint_policy.name=projects/*/locations/*/endpointPolicies/*}", + "(google.api.http).body": "endpoint_policy", + "(google.api.method_signature)": "endpoint_policy,update_mask", + "(google.longrunning.operation_info).response_type": "EndpointPolicy", + "(google.longrunning.operation_info).metadata_type": "google.cloud.networkservices.v1.OperationMetadata" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "patch": "/v1/{endpoint_policy.name=projects/*/locations/*/endpointPolicies/*}", + "body": "endpoint_policy" + } + }, + { + "(google.api.method_signature)": "endpoint_policy,update_mask" + }, + { + "(google.longrunning.operation_info)": { + "response_type": "EndpointPolicy", + "metadata_type": "google.cloud.networkservices.v1.OperationMetadata" + } + } + ] + }, + "DeleteEndpointPolicy": { + "requestType": "DeleteEndpointPolicyRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).delete": "/v1/{name=projects/*/locations/*/endpointPolicies/*}", + "(google.api.method_signature)": "name", + "(google.longrunning.operation_info).response_type": "google.protobuf.Empty", + "(google.longrunning.operation_info).metadata_type": "google.cloud.networkservices.v1.OperationMetadata" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "delete": "/v1/{name=projects/*/locations/*/endpointPolicies/*}" + } + }, + { + "(google.api.method_signature)": "name" + }, + { + "(google.longrunning.operation_info)": { + "response_type": "google.protobuf.Empty", + "metadata_type": "google.cloud.networkservices.v1.OperationMetadata" + } + } + ] + }, + "ListGateways": { + "requestType": "ListGatewaysRequest", + "responseType": "ListGatewaysResponse", + "options": { + "(google.api.http).get": "/v1/{parent=projects/*/locations/*}/gateways", + "(google.api.method_signature)": "parent" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1/{parent=projects/*/locations/*}/gateways" + } + }, + { + "(google.api.method_signature)": "parent" + } + ] + }, + "GetGateway": { + "requestType": "GetGatewayRequest", + "responseType": "Gateway", + "options": { + "(google.api.http).get": "/v1/{name=projects/*/locations/*/gateways/*}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1/{name=projects/*/locations/*/gateways/*}" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "CreateGateway": { + "requestType": "CreateGatewayRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).post": "/v1/{parent=projects/*/locations/*}/gateways", + "(google.api.http).body": "gateway", + "(google.api.method_signature)": "parent,gateway,gateway_id", + "(google.longrunning.operation_info).response_type": "Gateway", + "(google.longrunning.operation_info).metadata_type": "google.cloud.networkservices.v1.OperationMetadata" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1/{parent=projects/*/locations/*}/gateways", + "body": "gateway" + } + }, + { + "(google.api.method_signature)": "parent,gateway,gateway_id" + }, + { + "(google.longrunning.operation_info)": { + "response_type": "Gateway", + "metadata_type": "google.cloud.networkservices.v1.OperationMetadata" + } + } + ] + }, + "UpdateGateway": { + "requestType": "UpdateGatewayRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).patch": "/v1/{gateway.name=projects/*/locations/*/gateways/*}", + "(google.api.http).body": "gateway", + "(google.api.method_signature)": "gateway,update_mask", + "(google.longrunning.operation_info).response_type": "Gateway", + "(google.longrunning.operation_info).metadata_type": "google.cloud.networkservices.v1.OperationMetadata" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "patch": "/v1/{gateway.name=projects/*/locations/*/gateways/*}", + "body": "gateway" + } + }, + { + "(google.api.method_signature)": "gateway,update_mask" + }, + { + "(google.longrunning.operation_info)": { + "response_type": "Gateway", + "metadata_type": "google.cloud.networkservices.v1.OperationMetadata" + } + } + ] + }, + "DeleteGateway": { + "requestType": "DeleteGatewayRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).delete": "/v1/{name=projects/*/locations/*/gateways/*}", + "(google.api.method_signature)": "name", + "(google.longrunning.operation_info).response_type": "google.protobuf.Empty", + "(google.longrunning.operation_info).metadata_type": "google.cloud.networkservices.v1.OperationMetadata" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "delete": "/v1/{name=projects/*/locations/*/gateways/*}" + } + }, + { + "(google.api.method_signature)": "name" + }, + { + "(google.longrunning.operation_info)": { + "response_type": "google.protobuf.Empty", + "metadata_type": "google.cloud.networkservices.v1.OperationMetadata" + } + } + ] + }, + "ListGrpcRoutes": { + "requestType": "ListGrpcRoutesRequest", + "responseType": "ListGrpcRoutesResponse", + "options": { + "(google.api.http).get": "/v1/{parent=projects/*/locations/*}/grpcRoutes", + "(google.api.method_signature)": "parent" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1/{parent=projects/*/locations/*}/grpcRoutes" + } + }, + { + "(google.api.method_signature)": "parent" + } + ] + }, + "GetGrpcRoute": { + "requestType": "GetGrpcRouteRequest", + "responseType": "GrpcRoute", + "options": { + "(google.api.http).get": "/v1/{name=projects/*/locations/*/grpcRoutes/*}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1/{name=projects/*/locations/*/grpcRoutes/*}" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "CreateGrpcRoute": { + "requestType": "CreateGrpcRouteRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).post": "/v1/{parent=projects/*/locations/*}/grpcRoutes", + "(google.api.http).body": "grpc_route", + "(google.api.method_signature)": "parent,grpc_route,grpc_route_id", + "(google.longrunning.operation_info).response_type": "GrpcRoute", + "(google.longrunning.operation_info).metadata_type": "google.cloud.networkservices.v1.OperationMetadata" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1/{parent=projects/*/locations/*}/grpcRoutes", + "body": "grpc_route" + } + }, + { + "(google.api.method_signature)": "parent,grpc_route,grpc_route_id" + }, + { + "(google.longrunning.operation_info)": { + "response_type": "GrpcRoute", + "metadata_type": "google.cloud.networkservices.v1.OperationMetadata" + } + } + ] + }, + "UpdateGrpcRoute": { + "requestType": "UpdateGrpcRouteRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).patch": "/v1/{grpc_route.name=projects/*/locations/*/grpcRoutes/*}", + "(google.api.http).body": "grpc_route", + "(google.api.method_signature)": "grpc_route,update_mask", + "(google.longrunning.operation_info).response_type": "GrpcRoute", + "(google.longrunning.operation_info).metadata_type": "google.cloud.networkservices.v1.OperationMetadata" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "patch": "/v1/{grpc_route.name=projects/*/locations/*/grpcRoutes/*}", + "body": "grpc_route" + } + }, + { + "(google.api.method_signature)": "grpc_route,update_mask" + }, + { + "(google.longrunning.operation_info)": { + "response_type": "GrpcRoute", + "metadata_type": "google.cloud.networkservices.v1.OperationMetadata" + } + } + ] + }, + "DeleteGrpcRoute": { + "requestType": "DeleteGrpcRouteRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).delete": "/v1/{name=projects/*/locations/*/grpcRoutes/*}", + "(google.api.method_signature)": "name", + "(google.longrunning.operation_info).response_type": "google.protobuf.Empty", + "(google.longrunning.operation_info).metadata_type": "google.cloud.networkservices.v1.OperationMetadata" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "delete": "/v1/{name=projects/*/locations/*/grpcRoutes/*}" + } + }, + { + "(google.api.method_signature)": "name" + }, + { + "(google.longrunning.operation_info)": { + "response_type": "google.protobuf.Empty", + "metadata_type": "google.cloud.networkservices.v1.OperationMetadata" + } + } + ] + }, + "ListHttpRoutes": { + "requestType": "ListHttpRoutesRequest", + "responseType": "ListHttpRoutesResponse", + "options": { + "(google.api.http).get": "/v1/{parent=projects/*/locations/*}/httpRoutes", + "(google.api.method_signature)": "parent" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1/{parent=projects/*/locations/*}/httpRoutes" + } + }, + { + "(google.api.method_signature)": "parent" + } + ] + }, + "GetHttpRoute": { + "requestType": "GetHttpRouteRequest", + "responseType": "HttpRoute", + "options": { + "(google.api.http).get": "/v1/{name=projects/*/locations/*/httpRoutes/*}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1/{name=projects/*/locations/*/httpRoutes/*}" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "CreateHttpRoute": { + "requestType": "CreateHttpRouteRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).post": "/v1/{parent=projects/*/locations/*}/httpRoutes", + "(google.api.http).body": "http_route", + "(google.api.method_signature)": "parent,http_route,http_route_id", + "(google.longrunning.operation_info).response_type": "HttpRoute", + "(google.longrunning.operation_info).metadata_type": "google.cloud.networkservices.v1.OperationMetadata" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1/{parent=projects/*/locations/*}/httpRoutes", + "body": "http_route" + } + }, + { + "(google.api.method_signature)": "parent,http_route,http_route_id" + }, + { + "(google.longrunning.operation_info)": { + "response_type": "HttpRoute", + "metadata_type": "google.cloud.networkservices.v1.OperationMetadata" + } + } + ] + }, + "UpdateHttpRoute": { + "requestType": "UpdateHttpRouteRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).patch": "/v1/{http_route.name=projects/*/locations/*/httpRoutes/*}", + "(google.api.http).body": "http_route", + "(google.api.method_signature)": "http_route,update_mask", + "(google.longrunning.operation_info).response_type": "HttpRoute", + "(google.longrunning.operation_info).metadata_type": "google.cloud.networkservices.v1.OperationMetadata" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "patch": "/v1/{http_route.name=projects/*/locations/*/httpRoutes/*}", + "body": "http_route" + } + }, + { + "(google.api.method_signature)": "http_route,update_mask" + }, + { + "(google.longrunning.operation_info)": { + "response_type": "HttpRoute", + "metadata_type": "google.cloud.networkservices.v1.OperationMetadata" + } + } + ] + }, + "DeleteHttpRoute": { + "requestType": "DeleteHttpRouteRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).delete": "/v1/{name=projects/*/locations/*/httpRoutes/*}", + "(google.api.method_signature)": "name", + "(google.longrunning.operation_info).response_type": "google.protobuf.Empty", + "(google.longrunning.operation_info).metadata_type": "google.cloud.networkservices.v1.OperationMetadata" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "delete": "/v1/{name=projects/*/locations/*/httpRoutes/*}" + } + }, + { + "(google.api.method_signature)": "name" + }, + { + "(google.longrunning.operation_info)": { + "response_type": "google.protobuf.Empty", + "metadata_type": "google.cloud.networkservices.v1.OperationMetadata" + } + } + ] + }, + "ListTcpRoutes": { + "requestType": "ListTcpRoutesRequest", + "responseType": "ListTcpRoutesResponse", + "options": { + "(google.api.http).get": "/v1/{parent=projects/*/locations/*}/tcpRoutes", + "(google.api.method_signature)": "parent" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1/{parent=projects/*/locations/*}/tcpRoutes" + } + }, + { + "(google.api.method_signature)": "parent" + } + ] + }, + "GetTcpRoute": { + "requestType": "GetTcpRouteRequest", + "responseType": "TcpRoute", + "options": { + "(google.api.http).get": "/v1/{name=projects/*/locations/*/tcpRoutes/*}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1/{name=projects/*/locations/*/tcpRoutes/*}" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "CreateTcpRoute": { + "requestType": "CreateTcpRouteRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).post": "/v1/{parent=projects/*/locations/*}/tcpRoutes", + "(google.api.http).body": "tcp_route", + "(google.api.method_signature)": "parent,tcp_route,tcp_route_id", + "(google.longrunning.operation_info).response_type": "TcpRoute", + "(google.longrunning.operation_info).metadata_type": "google.cloud.networkservices.v1.OperationMetadata" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1/{parent=projects/*/locations/*}/tcpRoutes", + "body": "tcp_route" + } + }, + { + "(google.api.method_signature)": "parent,tcp_route,tcp_route_id" + }, + { + "(google.longrunning.operation_info)": { + "response_type": "TcpRoute", + "metadata_type": "google.cloud.networkservices.v1.OperationMetadata" + } + } + ] + }, + "UpdateTcpRoute": { + "requestType": "UpdateTcpRouteRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).patch": "/v1/{tcp_route.name=projects/*/locations/*/tcpRoutes/*}", + "(google.api.http).body": "tcp_route", + "(google.api.method_signature)": "tcp_route,update_mask", + "(google.longrunning.operation_info).response_type": "TcpRoute", + "(google.longrunning.operation_info).metadata_type": "google.cloud.networkservices.v1.OperationMetadata" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "patch": "/v1/{tcp_route.name=projects/*/locations/*/tcpRoutes/*}", + "body": "tcp_route" + } + }, + { + "(google.api.method_signature)": "tcp_route,update_mask" + }, + { + "(google.longrunning.operation_info)": { + "response_type": "TcpRoute", + "metadata_type": "google.cloud.networkservices.v1.OperationMetadata" + } + } + ] + }, + "DeleteTcpRoute": { + "requestType": "DeleteTcpRouteRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).delete": "/v1/{name=projects/*/locations/*/tcpRoutes/*}", + "(google.api.method_signature)": "name", + "(google.longrunning.operation_info).response_type": "google.protobuf.Empty", + "(google.longrunning.operation_info).metadata_type": "google.cloud.networkservices.v1.OperationMetadata" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "delete": "/v1/{name=projects/*/locations/*/tcpRoutes/*}" + } + }, + { + "(google.api.method_signature)": "name" + }, + { + "(google.longrunning.operation_info)": { + "response_type": "google.protobuf.Empty", + "metadata_type": "google.cloud.networkservices.v1.OperationMetadata" + } + } + ] + }, + "ListTlsRoutes": { + "requestType": "ListTlsRoutesRequest", + "responseType": "ListTlsRoutesResponse", + "options": { + "(google.api.http).get": "/v1/{parent=projects/*/locations/*}/tlsRoutes", + "(google.api.method_signature)": "parent" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1/{parent=projects/*/locations/*}/tlsRoutes" + } + }, + { + "(google.api.method_signature)": "parent" + } + ] + }, + "GetTlsRoute": { + "requestType": "GetTlsRouteRequest", + "responseType": "TlsRoute", + "options": { + "(google.api.http).get": "/v1/{name=projects/*/locations/*/tlsRoutes/*}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1/{name=projects/*/locations/*/tlsRoutes/*}" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "CreateTlsRoute": { + "requestType": "CreateTlsRouteRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).post": "/v1/{parent=projects/*/locations/*}/tlsRoutes", + "(google.api.http).body": "tls_route", + "(google.api.method_signature)": "parent,tls_route,tls_route_id", + "(google.longrunning.operation_info).response_type": "TlsRoute", + "(google.longrunning.operation_info).metadata_type": "google.cloud.networkservices.v1.OperationMetadata" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1/{parent=projects/*/locations/*}/tlsRoutes", + "body": "tls_route" + } + }, + { + "(google.api.method_signature)": "parent,tls_route,tls_route_id" + }, + { + "(google.longrunning.operation_info)": { + "response_type": "TlsRoute", + "metadata_type": "google.cloud.networkservices.v1.OperationMetadata" + } + } + ] + }, + "UpdateTlsRoute": { + "requestType": "UpdateTlsRouteRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).patch": "/v1/{tls_route.name=projects/*/locations/*/tlsRoutes/*}", + "(google.api.http).body": "tls_route", + "(google.api.method_signature)": "tls_route,update_mask", + "(google.longrunning.operation_info).response_type": "TlsRoute", + "(google.longrunning.operation_info).metadata_type": "google.cloud.networkservices.v1.OperationMetadata" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "patch": "/v1/{tls_route.name=projects/*/locations/*/tlsRoutes/*}", + "body": "tls_route" + } + }, + { + "(google.api.method_signature)": "tls_route,update_mask" + }, + { + "(google.longrunning.operation_info)": { + "response_type": "TlsRoute", + "metadata_type": "google.cloud.networkservices.v1.OperationMetadata" + } + } + ] + }, + "DeleteTlsRoute": { + "requestType": "DeleteTlsRouteRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).delete": "/v1/{name=projects/*/locations/*/tlsRoutes/*}", + "(google.api.method_signature)": "name", + "(google.longrunning.operation_info).response_type": "google.protobuf.Empty", + "(google.longrunning.operation_info).metadata_type": "google.cloud.networkservices.v1.OperationMetadata" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "delete": "/v1/{name=projects/*/locations/*/tlsRoutes/*}" + } + }, + { + "(google.api.method_signature)": "name" + }, + { + "(google.longrunning.operation_info)": { + "response_type": "google.protobuf.Empty", + "metadata_type": "google.cloud.networkservices.v1.OperationMetadata" + } + } + ] + }, + "ListServiceBindings": { + "requestType": "ListServiceBindingsRequest", + "responseType": "ListServiceBindingsResponse", + "options": { + "(google.api.http).get": "/v1/{parent=projects/*/locations/*}/serviceBindings", + "(google.api.method_signature)": "parent" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1/{parent=projects/*/locations/*}/serviceBindings" + } + }, + { + "(google.api.method_signature)": "parent" + } + ] + }, + "GetServiceBinding": { + "requestType": "GetServiceBindingRequest", + "responseType": "ServiceBinding", + "options": { + "(google.api.http).get": "/v1/{name=projects/*/locations/*/serviceBindings/*}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1/{name=projects/*/locations/*/serviceBindings/*}" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "CreateServiceBinding": { + "requestType": "CreateServiceBindingRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).post": "/v1/{parent=projects/*/locations/*}/serviceBindings", + "(google.api.http).body": "service_binding", + "(google.api.method_signature)": "parent,service_binding,service_binding_id", + "(google.longrunning.operation_info).response_type": "ServiceBinding", + "(google.longrunning.operation_info).metadata_type": "google.cloud.networkservices.v1.OperationMetadata" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1/{parent=projects/*/locations/*}/serviceBindings", + "body": "service_binding" + } + }, + { + "(google.api.method_signature)": "parent,service_binding,service_binding_id" + }, + { + "(google.longrunning.operation_info)": { + "response_type": "ServiceBinding", + "metadata_type": "google.cloud.networkservices.v1.OperationMetadata" + } + } + ] + }, + "DeleteServiceBinding": { + "requestType": "DeleteServiceBindingRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).delete": "/v1/{name=projects/*/locations/*/serviceBindings/*}", + "(google.api.method_signature)": "name", + "(google.longrunning.operation_info).response_type": "google.protobuf.Empty", + "(google.longrunning.operation_info).metadata_type": "google.cloud.networkservices.v1.OperationMetadata" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "delete": "/v1/{name=projects/*/locations/*/serviceBindings/*}" + } + }, + { + "(google.api.method_signature)": "name" + }, + { + "(google.longrunning.operation_info)": { + "response_type": "google.protobuf.Empty", + "metadata_type": "google.cloud.networkservices.v1.OperationMetadata" + } + } + ] + }, + "ListMeshes": { + "requestType": "ListMeshesRequest", + "responseType": "ListMeshesResponse", + "options": { + "(google.api.http).get": "/v1/{parent=projects/*/locations/*}/meshes", + "(google.api.method_signature)": "parent" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1/{parent=projects/*/locations/*}/meshes" + } + }, + { + "(google.api.method_signature)": "parent" + } + ] + }, + "GetMesh": { + "requestType": "GetMeshRequest", + "responseType": "Mesh", + "options": { + "(google.api.http).get": "/v1/{name=projects/*/locations/*/meshes/*}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1/{name=projects/*/locations/*/meshes/*}" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "CreateMesh": { + "requestType": "CreateMeshRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).post": "/v1/{parent=projects/*/locations/*}/meshes", + "(google.api.http).body": "mesh", + "(google.api.method_signature)": "parent,mesh,mesh_id", + "(google.longrunning.operation_info).response_type": "Mesh", + "(google.longrunning.operation_info).metadata_type": "google.cloud.networkservices.v1.OperationMetadata" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1/{parent=projects/*/locations/*}/meshes", + "body": "mesh" + } + }, + { + "(google.api.method_signature)": "parent,mesh,mesh_id" + }, + { + "(google.longrunning.operation_info)": { + "response_type": "Mesh", + "metadata_type": "google.cloud.networkservices.v1.OperationMetadata" + } + } + ] + }, + "UpdateMesh": { + "requestType": "UpdateMeshRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).patch": "/v1/{mesh.name=projects/*/locations/*/meshes/*}", + "(google.api.http).body": "mesh", + "(google.api.method_signature)": "mesh,update_mask", + "(google.longrunning.operation_info).response_type": "Mesh", + "(google.longrunning.operation_info).metadata_type": "google.cloud.networkservices.v1.OperationMetadata" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "patch": "/v1/{mesh.name=projects/*/locations/*/meshes/*}", + "body": "mesh" + } + }, + { + "(google.api.method_signature)": "mesh,update_mask" + }, + { + "(google.longrunning.operation_info)": { + "response_type": "Mesh", + "metadata_type": "google.cloud.networkservices.v1.OperationMetadata" + } + } + ] + }, + "DeleteMesh": { + "requestType": "DeleteMeshRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).delete": "/v1/{name=projects/*/locations/*/meshes/*}", + "(google.api.method_signature)": "name", + "(google.longrunning.operation_info).response_type": "google.protobuf.Empty", + "(google.longrunning.operation_info).metadata_type": "google.cloud.networkservices.v1.OperationMetadata" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "delete": "/v1/{name=projects/*/locations/*/meshes/*}" + } + }, + { + "(google.api.method_signature)": "name" + }, + { + "(google.longrunning.operation_info)": { + "response_type": "google.protobuf.Empty", + "metadata_type": "google.cloud.networkservices.v1.OperationMetadata" + } + } + ] + } + } + }, + "ServiceBinding": { + "options": { + "(google.api.resource).type": "networkservices.googleapis.com/ServiceBinding", + "(google.api.resource).pattern": "projects/{project}/locations/{location}/serviceBindings/{service_binding}" + }, + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "description": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "createTime": { + "type": "google.protobuf.Timestamp", + "id": 3, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "updateTime": { + "type": "google.protobuf.Timestamp", + "id": 4, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "service": { + "type": "string", + "id": 5, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "labels": { + "keyType": "string", + "type": "string", + "id": 7, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "ListServiceBindingsRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).child_type": "networkservices.googleapis.com/ServiceBinding" + } + }, + "pageSize": { + "type": "int32", + "id": 2 + }, + "pageToken": { + "type": "string", + "id": 3 + } + } + }, + "ListServiceBindingsResponse": { + "fields": { + "serviceBindings": { + "rule": "repeated", + "type": "ServiceBinding", + "id": 1 + }, + "nextPageToken": { + "type": "string", + "id": 2 + } + } + }, + "GetServiceBindingRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "networkservices.googleapis.com/ServiceBinding" + } + } + } + }, + "CreateServiceBindingRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).child_type": "networkservices.googleapis.com/ServiceBinding" + } + }, + "serviceBindingId": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "serviceBinding": { + "type": "ServiceBinding", + "id": 3, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "DeleteServiceBindingRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "networkservices.googleapis.com/ServiceBinding" + } + } + } + }, + "TcpRoute": { + "options": { + "(google.api.resource).type": "networkservices.googleapis.com/TcpRoute", + "(google.api.resource).pattern": "projects/{project}/locations/{location}/tcpRoutes/{tcp_route}" + }, + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "selfLink": { + "type": "string", + "id": 11, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "createTime": { + "type": "google.protobuf.Timestamp", + "id": 2, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "updateTime": { + "type": "google.protobuf.Timestamp", + "id": 3, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "description": { + "type": "string", + "id": 4, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "rules": { + "rule": "repeated", + "type": "RouteRule", + "id": 5, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "meshes": { + "rule": "repeated", + "type": "string", + "id": 8, + "options": { + "(google.api.field_behavior)": "OPTIONAL", + "(google.api.resource_reference).type": "networkservices.googleapis.com/Mesh" + } + }, + "gateways": { + "rule": "repeated", + "type": "string", + "id": 9, + "options": { + "(google.api.field_behavior)": "OPTIONAL", + "(google.api.resource_reference).type": "networkservices.googleapis.com/Gateway" + } + }, + "labels": { + "keyType": "string", + "type": "string", + "id": 10, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + }, + "nested": { + "RouteRule": { + "fields": { + "matches": { + "rule": "repeated", + "type": "RouteMatch", + "id": 1, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "action": { + "type": "RouteAction", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "RouteMatch": { + "fields": { + "address": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "port": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "RouteAction": { + "fields": { + "destinations": { + "rule": "repeated", + "type": "RouteDestination", + "id": 1, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "originalDestination": { + "type": "bool", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "RouteDestination": { + "fields": { + "serviceName": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "compute.googleapis.com/BackendService" + } + }, + "weight": { + "type": "int32", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + } + } + }, + "ListTcpRoutesRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).child_type": "networkservices.googleapis.com/TcpRoute" + } + }, + "pageSize": { + "type": "int32", + "id": 2 + }, + "pageToken": { + "type": "string", + "id": 3 + } + } + }, + "ListTcpRoutesResponse": { + "fields": { + "tcpRoutes": { + "rule": "repeated", + "type": "TcpRoute", + "id": 1 + }, + "nextPageToken": { + "type": "string", + "id": 2 + } + } + }, + "GetTcpRouteRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "networkservices.googleapis.com/TcpRoute" + } + } + } + }, + "CreateTcpRouteRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).child_type": "networkservices.googleapis.com/TcpRoute" + } + }, + "tcpRouteId": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "tcpRoute": { + "type": "TcpRoute", + "id": 3, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "UpdateTcpRouteRequest": { + "fields": { + "updateMask": { + "type": "google.protobuf.FieldMask", + "id": 1, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "tcpRoute": { + "type": "TcpRoute", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "DeleteTcpRouteRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "networkservices.googleapis.com/TcpRoute" + } + } + } + }, + "TlsRoute": { + "options": { + "(google.api.resource).type": "networkservices.googleapis.com/TlsRoute", + "(google.api.resource).pattern": "projects/{project}/locations/{location}/tlsRoutes/{tls_route}" + }, + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "selfLink": { + "type": "string", + "id": 8, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "createTime": { + "type": "google.protobuf.Timestamp", + "id": 2, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "updateTime": { + "type": "google.protobuf.Timestamp", + "id": 3, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "description": { + "type": "string", + "id": 4, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "rules": { + "rule": "repeated", + "type": "RouteRule", + "id": 5, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "meshes": { + "rule": "repeated", + "type": "string", + "id": 6, + "options": { + "(google.api.field_behavior)": "OPTIONAL", + "(google.api.resource_reference).type": "networkservices.googleapis.com/Mesh" + } + }, + "gateways": { + "rule": "repeated", + "type": "string", + "id": 7, + "options": { + "(google.api.field_behavior)": "OPTIONAL", + "(google.api.resource_reference).type": "networkservices.googleapis.com/Gateway" + } + } + }, + "nested": { + "RouteRule": { + "fields": { + "matches": { + "rule": "repeated", + "type": "RouteMatch", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "action": { + "type": "RouteAction", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "RouteMatch": { + "fields": { + "sniHost": { + "rule": "repeated", + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "alpn": { + "rule": "repeated", + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "RouteAction": { + "fields": { + "destinations": { + "rule": "repeated", + "type": "RouteDestination", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "RouteDestination": { + "fields": { + "serviceName": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "compute.googleapis.com/BackendService" + } + }, + "weight": { + "type": "int32", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + } + } + }, + "ListTlsRoutesRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).child_type": "networkservices.googleapis.com/TlsRoute" + } + }, + "pageSize": { + "type": "int32", + "id": 2 + }, + "pageToken": { + "type": "string", + "id": 3 + } + } + }, + "ListTlsRoutesResponse": { + "fields": { + "tlsRoutes": { + "rule": "repeated", + "type": "TlsRoute", + "id": 1 + }, + "nextPageToken": { + "type": "string", + "id": 2 + } + } + }, + "GetTlsRouteRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "networkservices.googleapis.com/TlsRoute" + } + } + } + }, + "CreateTlsRouteRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).child_type": "networkservices.googleapis.com/TlsRoute" + } + }, + "tlsRouteId": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "tlsRoute": { + "type": "TlsRoute", + "id": 3, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "UpdateTlsRouteRequest": { + "fields": { + "updateMask": { + "type": "google.protobuf.FieldMask", + "id": 1, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "tlsRoute": { + "type": "TlsRoute", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "DeleteTlsRouteRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "networkservices.googleapis.com/TlsRoute" + } + } + } + } + } + }, + "v1beta1": { + "options": { + "csharp_namespace": "Google.Cloud.NetworkServices.V1Beta1", + "go_package": "cloud.google.com/go/networkservices/apiv1beta1/networkservicespb;networkservicespb", + "java_multiple_files": true, + "java_outer_classname": "EndpointPolicyProto", + "java_package": "com.google.cloud.networkservices.v1beta1", + "php_namespace": "Google\\Cloud\\NetworkServices\\V1beta1", + "ruby_package": "Google::Cloud::NetworkServices::V1beta1", + "(google.api.resource_definition).type": "networksecurity.googleapis.com/ClientTlsPolicy", + "(google.api.resource_definition).pattern": "projects/{project}/locations/{location}/clientTlsPolicies/{client_tls_policy}" + }, + "nested": { + "OperationMetadata": { + "fields": { + "createTime": { + "type": "google.protobuf.Timestamp", + "id": 1, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "endTime": { + "type": "google.protobuf.Timestamp", + "id": 2, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "target": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "verb": { + "type": "string", + "id": 4, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "statusMessage": { + "type": "string", + "id": 5, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "requestedCancellation": { + "type": "bool", + "id": 6, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "apiVersion": { + "type": "string", + "id": 7, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + } + } + }, + "TrafficPortSelector": { + "fields": { + "ports": { + "rule": "repeated", + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "EndpointMatcher": { + "oneofs": { + "matcherType": { + "oneof": [ + "metadataLabelMatcher" + ] + } + }, + "fields": { + "metadataLabelMatcher": { + "type": "MetadataLabelMatcher", + "id": 1 + } + }, + "nested": { + "MetadataLabelMatcher": { + "fields": { + "metadataLabelMatchCriteria": { + "type": "MetadataLabelMatchCriteria", + "id": 1 + }, + "metadataLabels": { + "rule": "repeated", + "type": "MetadataLabels", + "id": 2 + } + }, + "nested": { + "MetadataLabels": { + "fields": { + "labelName": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "labelValue": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "MetadataLabelMatchCriteria": { + "values": { + "METADATA_LABEL_MATCH_CRITERIA_UNSPECIFIED": 0, + "MATCH_ANY": 1, + "MATCH_ALL": 2 + } + } + } + } + } + }, + "EndpointPolicy": { + "options": { + "(google.api.resource).type": "networkservices.googleapis.com/EndpointPolicy", + "(google.api.resource).pattern": "projects/{project}/locations/{location}/endpointPolicies/{endpoint_policy}" + }, + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "createTime": { + "type": "google.protobuf.Timestamp", + "id": 2, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "updateTime": { + "type": "google.protobuf.Timestamp", + "id": 3, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "labels": { + "keyType": "string", + "type": "string", + "id": 4, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "type": { + "type": "EndpointPolicyType", + "id": 5, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "authorizationPolicy": { + "type": "string", + "id": 7, + "options": { + "(google.api.field_behavior)": "OPTIONAL", + "(google.api.resource_reference).type": "networksecurity.googleapis.com/AuthorizationPolicy" + } + }, + "endpointMatcher": { + "type": "EndpointMatcher", + "id": 9, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "trafficPortSelector": { + "type": "TrafficPortSelector", + "id": 10, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "description": { + "type": "string", + "id": 11, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "serverTlsPolicy": { + "type": "string", + "id": 12, + "options": { + "(google.api.field_behavior)": "OPTIONAL", + "(google.api.resource_reference).type": "networksecurity.googleapis.com/ServerTlsPolicy" + } + }, + "clientTlsPolicy": { + "type": "string", + "id": 13, + "options": { + "(google.api.field_behavior)": "OPTIONAL", + "(google.api.resource_reference).type": "networksecurity.googleapis.com/ClientTlsPolicy" + } + } + }, + "nested": { + "EndpointPolicyType": { + "values": { + "ENDPOINT_POLICY_TYPE_UNSPECIFIED": 0, + "SIDECAR_PROXY": 1, + "GRPC_SERVER": 2 + } + } + } + }, + "ListEndpointPoliciesRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).child_type": "networkservices.googleapis.com/EndpointPolicy" + } + }, + "pageSize": { + "type": "int32", + "id": 2 + }, + "pageToken": { + "type": "string", + "id": 3 + } + } + }, + "ListEndpointPoliciesResponse": { + "fields": { + "endpointPolicies": { + "rule": "repeated", + "type": "EndpointPolicy", + "id": 1 + }, + "nextPageToken": { + "type": "string", + "id": 2 + } + } + }, + "GetEndpointPolicyRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "networkservices.googleapis.com/EndpointPolicy" + } + } + } + }, + "CreateEndpointPolicyRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).child_type": "networkservices.googleapis.com/EndpointPolicy" + } + }, + "endpointPolicyId": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "endpointPolicy": { + "type": "EndpointPolicy", + "id": 3, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "UpdateEndpointPolicyRequest": { + "fields": { + "updateMask": { + "type": "google.protobuf.FieldMask", + "id": 1, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "endpointPolicy": { + "type": "EndpointPolicy", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "DeleteEndpointPolicyRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "networkservices.googleapis.com/EndpointPolicy" + } + } + } + }, + "NetworkServices": { + "options": { + "(google.api.default_host)": "networkservices.googleapis.com", + "(google.api.oauth_scopes)": "https://www.googleapis.com/auth/cloud-platform" + }, + "methods": { + "ListEndpointPolicies": { + "requestType": "ListEndpointPoliciesRequest", + "responseType": "ListEndpointPoliciesResponse", + "options": { + "(google.api.http).get": "/v1beta1/{parent=projects/*/locations/*}/endpointPolicies", + "(google.api.method_signature)": "parent" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1beta1/{parent=projects/*/locations/*}/endpointPolicies" + } + }, + { + "(google.api.method_signature)": "parent" + } + ] + }, + "GetEndpointPolicy": { + "requestType": "GetEndpointPolicyRequest", + "responseType": "EndpointPolicy", + "options": { + "(google.api.http).get": "/v1beta1/{name=projects/*/locations/*/endpointPolicies/*}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1beta1/{name=projects/*/locations/*/endpointPolicies/*}" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "CreateEndpointPolicy": { + "requestType": "CreateEndpointPolicyRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).post": "/v1beta1/{parent=projects/*/locations/*}/endpointPolicies", + "(google.api.http).body": "endpoint_policy", + "(google.api.method_signature)": "parent,endpoint_policy,endpoint_policy_id", + "(google.longrunning.operation_info).response_type": "EndpointPolicy", + "(google.longrunning.operation_info).metadata_type": "google.cloud.networkservices.v1beta1.OperationMetadata" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1beta1/{parent=projects/*/locations/*}/endpointPolicies", + "body": "endpoint_policy" + } + }, + { + "(google.api.method_signature)": "parent,endpoint_policy,endpoint_policy_id" + }, + { + "(google.longrunning.operation_info)": { + "response_type": "EndpointPolicy", + "metadata_type": "google.cloud.networkservices.v1beta1.OperationMetadata" + } + } + ] + }, + "UpdateEndpointPolicy": { + "requestType": "UpdateEndpointPolicyRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).patch": "/v1beta1/{endpoint_policy.name=projects/*/locations/*/endpointPolicies/*}", + "(google.api.http).body": "endpoint_policy", + "(google.api.method_signature)": "endpoint_policy,update_mask", + "(google.longrunning.operation_info).response_type": "EndpointPolicy", + "(google.longrunning.operation_info).metadata_type": "google.cloud.networkservices.v1beta1.OperationMetadata" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "patch": "/v1beta1/{endpoint_policy.name=projects/*/locations/*/endpointPolicies/*}", + "body": "endpoint_policy" + } + }, + { + "(google.api.method_signature)": "endpoint_policy,update_mask" + }, + { + "(google.longrunning.operation_info)": { + "response_type": "EndpointPolicy", + "metadata_type": "google.cloud.networkservices.v1beta1.OperationMetadata" + } + } + ] + }, + "DeleteEndpointPolicy": { + "requestType": "DeleteEndpointPolicyRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).delete": "/v1beta1/{name=projects/*/locations/*/endpointPolicies/*}", + "(google.api.method_signature)": "name", + "(google.longrunning.operation_info).response_type": "google.protobuf.Empty", + "(google.longrunning.operation_info).metadata_type": "google.cloud.networkservices.v1beta1.OperationMetadata" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "delete": "/v1beta1/{name=projects/*/locations/*/endpointPolicies/*}" + } + }, + { + "(google.api.method_signature)": "name" + }, + { + "(google.longrunning.operation_info)": { + "response_type": "google.protobuf.Empty", + "metadata_type": "google.cloud.networkservices.v1beta1.OperationMetadata" + } + } + ] + } + } + } + } + } + } + } + } + }, + "api": { + "options": { + "go_package": "google.golang.org/genproto/googleapis/api;api", + "java_multiple_files": true, + "java_outer_classname": "LaunchStageProto", + "java_package": "com.google.api", + "objc_class_prefix": "GAPI", + "cc_enable_arenas": true + }, + "nested": { + "fieldBehavior": { + "rule": "repeated", + "type": "google.api.FieldBehavior", + "id": 1052, + "extend": "google.protobuf.FieldOptions" + }, + "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 + } + }, + "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 + } + } + }, + "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" + }, + "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 + } + } + }, + "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 + } + } + }, + "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 + } + }, + "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 + } + }, + "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 + } + } + } + }, + "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": { + "fields": { + "file": { + "rule": "repeated", + "type": "FileDescriptorProto", + "id": 1 + } + } + }, + "FileDescriptorProto": { + "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, + "options": { + "packed": false + } + }, + "weakDependency": { + "rule": "repeated", + "type": "int32", + "id": 11, + "options": { + "packed": false + } + }, + "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": "string", + "id": 13 + } + } + }, + "DescriptorProto": { + "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": { + "fields": { + "uninterpretedOption": { + "rule": "repeated", + "type": "UninterpretedOption", + "id": 999 + } + }, + "extensions": [ + [ + 1000, + 536870911 + ] + ] + }, + "FieldDescriptorProto": { + "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_REQUIRED": 2, + "LABEL_REPEATED": 3 + } + } + } + }, + "OneofDescriptorProto": { + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "options": { + "type": "OneofOptions", + "id": 2 + } + } + }, + "EnumDescriptorProto": { + "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": { + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "number": { + "type": "int32", + "id": 2 + }, + "options": { + "type": "EnumValueOptions", + "id": 3 + } + } + }, + "ServiceDescriptorProto": { + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "method": { + "rule": "repeated", + "type": "MethodDescriptorProto", + "id": 2 + }, + "options": { + "type": "ServiceOptions", + "id": 3 + } + } + }, + "MethodDescriptorProto": { + "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": { + "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 + } + }, + "phpGenericServices": { + "type": "bool", + "id": 42, + "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 + }, + "uninterpretedOption": { + "rule": "repeated", + "type": "UninterpretedOption", + "id": 999 + } + }, + "extensions": [ + [ + 1000, + 536870911 + ] + ], + "reserved": [ + [ + 38, + 38 + ] + ], + "nested": { + "OptimizeMode": { + "values": { + "SPEED": 1, + "CODE_SIZE": 2, + "LITE_RUNTIME": 3 + } + } + } + }, + "MessageOptions": { + "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 + } + }, + "uninterpretedOption": { + "rule": "repeated", + "type": "UninterpretedOption", + "id": 999 + } + }, + "extensions": [ + [ + 1000, + 536870911 + ] + ], + "reserved": [ + [ + 4, + 4 + ], + [ + 5, + 5 + ], + [ + 6, + 6 + ], + [ + 8, + 8 + ], + [ + 9, + 9 + ] + ] + }, + "FieldOptions": { + "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 + }, + "target": { + "type": "OptionTargetType", + "id": 18 + }, + "uninterpretedOption": { + "rule": "repeated", + "type": "UninterpretedOption", + "id": 999 + } + }, + "extensions": [ + [ + 1000, + 536870911 + ] + ], + "reserved": [ + [ + 4, + 4 + ] + ], + "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 + } + } + } + }, + "OneofOptions": { + "fields": { + "uninterpretedOption": { + "rule": "repeated", + "type": "UninterpretedOption", + "id": 999 + } + }, + "extensions": [ + [ + 1000, + 536870911 + ] + ] + }, + "EnumOptions": { + "fields": { + "allowAlias": { + "type": "bool", + "id": 2 + }, + "deprecated": { + "type": "bool", + "id": 3, + "options": { + "default": false + } + }, + "deprecatedLegacyJsonFieldConflicts": { + "type": "bool", + "id": 6, + "options": { + "deprecated": true + } + }, + "uninterpretedOption": { + "rule": "repeated", + "type": "UninterpretedOption", + "id": 999 + } + }, + "extensions": [ + [ + 1000, + 536870911 + ] + ], + "reserved": [ + [ + 5, + 5 + ] + ] + }, + "EnumValueOptions": { + "fields": { + "deprecated": { + "type": "bool", + "id": 1, + "options": { + "default": false + } + }, + "uninterpretedOption": { + "rule": "repeated", + "type": "UninterpretedOption", + "id": 999 + } + }, + "extensions": [ + [ + 1000, + 536870911 + ] + ] + }, + "ServiceOptions": { + "fields": { + "deprecated": { + "type": "bool", + "id": 33, + "options": { + "default": false + } + }, + "uninterpretedOption": { + "rule": "repeated", + "type": "UninterpretedOption", + "id": 999 + } + }, + "extensions": [ + [ + 1000, + 536870911 + ] + ] + }, + "MethodOptions": { + "fields": { + "deprecated": { + "type": "bool", + "id": 33, + "options": { + "default": false + } + }, + "idempotencyLevel": { + "type": "IdempotencyLevel", + "id": 34, + "options": { + "default": "IDEMPOTENCY_UNKNOWN" + } + }, + "uninterpretedOption": { + "rule": "repeated", + "type": "UninterpretedOption", + "id": 999 + } + }, + "extensions": [ + [ + 1000, + 536870911 + ] + ], + "nested": { + "IdempotencyLevel": { + "values": { + "IDEMPOTENCY_UNKNOWN": 0, + "NO_SIDE_EFFECTS": 1, + "IDEMPOTENT": 2 + } + } + } + }, + "UninterpretedOption": { + "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 + } + } + } + } + }, + "SourceCodeInfo": { + "fields": { + "location": { + "rule": "repeated", + "type": "Location", + "id": 1 + } + }, + "nested": { + "Location": { + "fields": { + "path": { + "rule": "repeated", + "type": "int32", + "id": 1 + }, + "span": { + "rule": "repeated", + "type": "int32", + "id": 2 + }, + "leadingComments": { + "type": "string", + "id": 3 + }, + "trailingComments": { + "type": "string", + "id": 4 + }, + "leadingDetachedComments": { + "rule": "repeated", + "type": "string", + "id": 6 + } + } + } + } + }, + "GeneratedCodeInfo": { + "fields": { + "annotation": { + "rule": "repeated", + "type": "Annotation", + "id": 1 + } + }, + "nested": { + "Annotation": { + "fields": { + "path": { + "rule": "repeated", + "type": "int32", + "id": 1 + }, + "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 + } + } + } + } + } + }, + "Timestamp": { + "fields": { + "seconds": { + "type": "int64", + "id": 1 + }, + "nanos": { + "type": "int32", + "id": 2 + } + } + }, + "FieldMask": { + "fields": { + "paths": { + "rule": "repeated", + "type": "string", + "id": 1 + } + } + }, + "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": {} + } + } + }, + "longrunning": { + "options": { + "cc_enable_arenas": true, + "csharp_namespace": "Google.LongRunning", + "go_package": "google.golang.org/genproto/googleapis/longrunning;longrunning", + "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/google-cloud-networkservices/samples/README.md b/packages/google-cloud-networkservices/samples/README.md new file mode 100644 index 00000000000..273f5bf91a3 --- /dev/null +++ b/packages/google-cloud-networkservices/samples/README.md @@ -0,0 +1,842 @@ +[//]: # "This README.md file is auto-generated, all changes to this file will be lost." +[//]: # "To regenerate it, use `python -m synthtool`." +Google Cloud Platform logo + +# [Network Services API: Node.js Samples](https://github.com/googleapis/google-cloud-node) + +[![Open in Cloud Shell][shell_img]][shell_link] + + + +## Table of Contents + +* [Before you begin](#before-you-begin) +* [Samples](#samples) + * [Network_services.create_endpoint_policy](#network_services.create_endpoint_policy) + * [Network_services.create_gateway](#network_services.create_gateway) + * [Network_services.create_grpc_route](#network_services.create_grpc_route) + * [Network_services.create_http_route](#network_services.create_http_route) + * [Network_services.create_mesh](#network_services.create_mesh) + * [Network_services.create_service_binding](#network_services.create_service_binding) + * [Network_services.create_tcp_route](#network_services.create_tcp_route) + * [Network_services.create_tls_route](#network_services.create_tls_route) + * [Network_services.delete_endpoint_policy](#network_services.delete_endpoint_policy) + * [Network_services.delete_gateway](#network_services.delete_gateway) + * [Network_services.delete_grpc_route](#network_services.delete_grpc_route) + * [Network_services.delete_http_route](#network_services.delete_http_route) + * [Network_services.delete_mesh](#network_services.delete_mesh) + * [Network_services.delete_service_binding](#network_services.delete_service_binding) + * [Network_services.delete_tcp_route](#network_services.delete_tcp_route) + * [Network_services.delete_tls_route](#network_services.delete_tls_route) + * [Network_services.get_endpoint_policy](#network_services.get_endpoint_policy) + * [Network_services.get_gateway](#network_services.get_gateway) + * [Network_services.get_grpc_route](#network_services.get_grpc_route) + * [Network_services.get_http_route](#network_services.get_http_route) + * [Network_services.get_mesh](#network_services.get_mesh) + * [Network_services.get_service_binding](#network_services.get_service_binding) + * [Network_services.get_tcp_route](#network_services.get_tcp_route) + * [Network_services.get_tls_route](#network_services.get_tls_route) + * [Network_services.list_endpoint_policies](#network_services.list_endpoint_policies) + * [Network_services.list_gateways](#network_services.list_gateways) + * [Network_services.list_grpc_routes](#network_services.list_grpc_routes) + * [Network_services.list_http_routes](#network_services.list_http_routes) + * [Network_services.list_meshes](#network_services.list_meshes) + * [Network_services.list_service_bindings](#network_services.list_service_bindings) + * [Network_services.list_tcp_routes](#network_services.list_tcp_routes) + * [Network_services.list_tls_routes](#network_services.list_tls_routes) + * [Network_services.update_endpoint_policy](#network_services.update_endpoint_policy) + * [Network_services.update_gateway](#network_services.update_gateway) + * [Network_services.update_grpc_route](#network_services.update_grpc_route) + * [Network_services.update_http_route](#network_services.update_http_route) + * [Network_services.update_mesh](#network_services.update_mesh) + * [Network_services.update_tcp_route](#network_services.update_tcp_route) + * [Network_services.update_tls_route](#network_services.update_tls_route) + * [Network_services.create_endpoint_policy](#network_services.create_endpoint_policy) + * [Network_services.delete_endpoint_policy](#network_services.delete_endpoint_policy) + * [Network_services.get_endpoint_policy](#network_services.get_endpoint_policy) + * [Network_services.list_endpoint_policies](#network_services.list_endpoint_policies) + * [Network_services.update_endpoint_policy](#network_services.update_endpoint_policy) + * [Quickstart](#quickstart) + +## Before you begin + +Before running the samples, make sure you've followed the steps outlined in +[Using the client library](https://github.com/googleapis/google-cloud-node#using-the-client-library). + +`cd samples` + +`npm install` + +`cd ..` + +## Samples + + + +### Network_services.create_endpoint_policy + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-networkservices/samples/generated/v1/network_services.create_endpoint_policy.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-cloud-networkservices/samples/generated/v1/network_services.create_endpoint_policy.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-networkservices/samples/generated/v1/network_services.create_endpoint_policy.js` + + +----- + + + + +### Network_services.create_gateway + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-networkservices/samples/generated/v1/network_services.create_gateway.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-cloud-networkservices/samples/generated/v1/network_services.create_gateway.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-networkservices/samples/generated/v1/network_services.create_gateway.js` + + +----- + + + + +### Network_services.create_grpc_route + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-networkservices/samples/generated/v1/network_services.create_grpc_route.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-cloud-networkservices/samples/generated/v1/network_services.create_grpc_route.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-networkservices/samples/generated/v1/network_services.create_grpc_route.js` + + +----- + + + + +### Network_services.create_http_route + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-networkservices/samples/generated/v1/network_services.create_http_route.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-cloud-networkservices/samples/generated/v1/network_services.create_http_route.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-networkservices/samples/generated/v1/network_services.create_http_route.js` + + +----- + + + + +### Network_services.create_mesh + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-networkservices/samples/generated/v1/network_services.create_mesh.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-cloud-networkservices/samples/generated/v1/network_services.create_mesh.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-networkservices/samples/generated/v1/network_services.create_mesh.js` + + +----- + + + + +### Network_services.create_service_binding + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-networkservices/samples/generated/v1/network_services.create_service_binding.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-cloud-networkservices/samples/generated/v1/network_services.create_service_binding.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-networkservices/samples/generated/v1/network_services.create_service_binding.js` + + +----- + + + + +### Network_services.create_tcp_route + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-networkservices/samples/generated/v1/network_services.create_tcp_route.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-cloud-networkservices/samples/generated/v1/network_services.create_tcp_route.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-networkservices/samples/generated/v1/network_services.create_tcp_route.js` + + +----- + + + + +### Network_services.create_tls_route + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-networkservices/samples/generated/v1/network_services.create_tls_route.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-cloud-networkservices/samples/generated/v1/network_services.create_tls_route.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-networkservices/samples/generated/v1/network_services.create_tls_route.js` + + +----- + + + + +### Network_services.delete_endpoint_policy + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-networkservices/samples/generated/v1/network_services.delete_endpoint_policy.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-cloud-networkservices/samples/generated/v1/network_services.delete_endpoint_policy.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-networkservices/samples/generated/v1/network_services.delete_endpoint_policy.js` + + +----- + + + + +### Network_services.delete_gateway + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-networkservices/samples/generated/v1/network_services.delete_gateway.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-cloud-networkservices/samples/generated/v1/network_services.delete_gateway.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-networkservices/samples/generated/v1/network_services.delete_gateway.js` + + +----- + + + + +### Network_services.delete_grpc_route + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-networkservices/samples/generated/v1/network_services.delete_grpc_route.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-cloud-networkservices/samples/generated/v1/network_services.delete_grpc_route.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-networkservices/samples/generated/v1/network_services.delete_grpc_route.js` + + +----- + + + + +### Network_services.delete_http_route + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-networkservices/samples/generated/v1/network_services.delete_http_route.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-cloud-networkservices/samples/generated/v1/network_services.delete_http_route.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-networkservices/samples/generated/v1/network_services.delete_http_route.js` + + +----- + + + + +### Network_services.delete_mesh + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-networkservices/samples/generated/v1/network_services.delete_mesh.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-cloud-networkservices/samples/generated/v1/network_services.delete_mesh.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-networkservices/samples/generated/v1/network_services.delete_mesh.js` + + +----- + + + + +### Network_services.delete_service_binding + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-networkservices/samples/generated/v1/network_services.delete_service_binding.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-cloud-networkservices/samples/generated/v1/network_services.delete_service_binding.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-networkservices/samples/generated/v1/network_services.delete_service_binding.js` + + +----- + + + + +### Network_services.delete_tcp_route + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-networkservices/samples/generated/v1/network_services.delete_tcp_route.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-cloud-networkservices/samples/generated/v1/network_services.delete_tcp_route.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-networkservices/samples/generated/v1/network_services.delete_tcp_route.js` + + +----- + + + + +### Network_services.delete_tls_route + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-networkservices/samples/generated/v1/network_services.delete_tls_route.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-cloud-networkservices/samples/generated/v1/network_services.delete_tls_route.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-networkservices/samples/generated/v1/network_services.delete_tls_route.js` + + +----- + + + + +### Network_services.get_endpoint_policy + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-networkservices/samples/generated/v1/network_services.get_endpoint_policy.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-cloud-networkservices/samples/generated/v1/network_services.get_endpoint_policy.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-networkservices/samples/generated/v1/network_services.get_endpoint_policy.js` + + +----- + + + + +### Network_services.get_gateway + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-networkservices/samples/generated/v1/network_services.get_gateway.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-cloud-networkservices/samples/generated/v1/network_services.get_gateway.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-networkservices/samples/generated/v1/network_services.get_gateway.js` + + +----- + + + + +### Network_services.get_grpc_route + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-networkservices/samples/generated/v1/network_services.get_grpc_route.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-cloud-networkservices/samples/generated/v1/network_services.get_grpc_route.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-networkservices/samples/generated/v1/network_services.get_grpc_route.js` + + +----- + + + + +### Network_services.get_http_route + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-networkservices/samples/generated/v1/network_services.get_http_route.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-cloud-networkservices/samples/generated/v1/network_services.get_http_route.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-networkservices/samples/generated/v1/network_services.get_http_route.js` + + +----- + + + + +### Network_services.get_mesh + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-networkservices/samples/generated/v1/network_services.get_mesh.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-cloud-networkservices/samples/generated/v1/network_services.get_mesh.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-networkservices/samples/generated/v1/network_services.get_mesh.js` + + +----- + + + + +### Network_services.get_service_binding + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-networkservices/samples/generated/v1/network_services.get_service_binding.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-cloud-networkservices/samples/generated/v1/network_services.get_service_binding.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-networkservices/samples/generated/v1/network_services.get_service_binding.js` + + +----- + + + + +### Network_services.get_tcp_route + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-networkservices/samples/generated/v1/network_services.get_tcp_route.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-cloud-networkservices/samples/generated/v1/network_services.get_tcp_route.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-networkservices/samples/generated/v1/network_services.get_tcp_route.js` + + +----- + + + + +### Network_services.get_tls_route + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-networkservices/samples/generated/v1/network_services.get_tls_route.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-cloud-networkservices/samples/generated/v1/network_services.get_tls_route.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-networkservices/samples/generated/v1/network_services.get_tls_route.js` + + +----- + + + + +### Network_services.list_endpoint_policies + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-networkservices/samples/generated/v1/network_services.list_endpoint_policies.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-cloud-networkservices/samples/generated/v1/network_services.list_endpoint_policies.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-networkservices/samples/generated/v1/network_services.list_endpoint_policies.js` + + +----- + + + + +### Network_services.list_gateways + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-networkservices/samples/generated/v1/network_services.list_gateways.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-cloud-networkservices/samples/generated/v1/network_services.list_gateways.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-networkservices/samples/generated/v1/network_services.list_gateways.js` + + +----- + + + + +### Network_services.list_grpc_routes + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-networkservices/samples/generated/v1/network_services.list_grpc_routes.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-cloud-networkservices/samples/generated/v1/network_services.list_grpc_routes.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-networkservices/samples/generated/v1/network_services.list_grpc_routes.js` + + +----- + + + + +### Network_services.list_http_routes + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-networkservices/samples/generated/v1/network_services.list_http_routes.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-cloud-networkservices/samples/generated/v1/network_services.list_http_routes.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-networkservices/samples/generated/v1/network_services.list_http_routes.js` + + +----- + + + + +### Network_services.list_meshes + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-networkservices/samples/generated/v1/network_services.list_meshes.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-cloud-networkservices/samples/generated/v1/network_services.list_meshes.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-networkservices/samples/generated/v1/network_services.list_meshes.js` + + +----- + + + + +### Network_services.list_service_bindings + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-networkservices/samples/generated/v1/network_services.list_service_bindings.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-cloud-networkservices/samples/generated/v1/network_services.list_service_bindings.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-networkservices/samples/generated/v1/network_services.list_service_bindings.js` + + +----- + + + + +### Network_services.list_tcp_routes + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-networkservices/samples/generated/v1/network_services.list_tcp_routes.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-cloud-networkservices/samples/generated/v1/network_services.list_tcp_routes.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-networkservices/samples/generated/v1/network_services.list_tcp_routes.js` + + +----- + + + + +### Network_services.list_tls_routes + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-networkservices/samples/generated/v1/network_services.list_tls_routes.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-cloud-networkservices/samples/generated/v1/network_services.list_tls_routes.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-networkservices/samples/generated/v1/network_services.list_tls_routes.js` + + +----- + + + + +### Network_services.update_endpoint_policy + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-networkservices/samples/generated/v1/network_services.update_endpoint_policy.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-cloud-networkservices/samples/generated/v1/network_services.update_endpoint_policy.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-networkservices/samples/generated/v1/network_services.update_endpoint_policy.js` + + +----- + + + + +### Network_services.update_gateway + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-networkservices/samples/generated/v1/network_services.update_gateway.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-cloud-networkservices/samples/generated/v1/network_services.update_gateway.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-networkservices/samples/generated/v1/network_services.update_gateway.js` + + +----- + + + + +### Network_services.update_grpc_route + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-networkservices/samples/generated/v1/network_services.update_grpc_route.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-cloud-networkservices/samples/generated/v1/network_services.update_grpc_route.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-networkservices/samples/generated/v1/network_services.update_grpc_route.js` + + +----- + + + + +### Network_services.update_http_route + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-networkservices/samples/generated/v1/network_services.update_http_route.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-cloud-networkservices/samples/generated/v1/network_services.update_http_route.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-networkservices/samples/generated/v1/network_services.update_http_route.js` + + +----- + + + + +### Network_services.update_mesh + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-networkservices/samples/generated/v1/network_services.update_mesh.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-cloud-networkservices/samples/generated/v1/network_services.update_mesh.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-networkservices/samples/generated/v1/network_services.update_mesh.js` + + +----- + + + + +### Network_services.update_tcp_route + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-networkservices/samples/generated/v1/network_services.update_tcp_route.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-cloud-networkservices/samples/generated/v1/network_services.update_tcp_route.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-networkservices/samples/generated/v1/network_services.update_tcp_route.js` + + +----- + + + + +### Network_services.update_tls_route + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-networkservices/samples/generated/v1/network_services.update_tls_route.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-cloud-networkservices/samples/generated/v1/network_services.update_tls_route.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-networkservices/samples/generated/v1/network_services.update_tls_route.js` + + +----- + + + + +### Network_services.create_endpoint_policy + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-networkservices/samples/generated/v1beta1/network_services.create_endpoint_policy.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-cloud-networkservices/samples/generated/v1beta1/network_services.create_endpoint_policy.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-networkservices/samples/generated/v1beta1/network_services.create_endpoint_policy.js` + + +----- + + + + +### Network_services.delete_endpoint_policy + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-networkservices/samples/generated/v1beta1/network_services.delete_endpoint_policy.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-cloud-networkservices/samples/generated/v1beta1/network_services.delete_endpoint_policy.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-networkservices/samples/generated/v1beta1/network_services.delete_endpoint_policy.js` + + +----- + + + + +### Network_services.get_endpoint_policy + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-networkservices/samples/generated/v1beta1/network_services.get_endpoint_policy.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-cloud-networkservices/samples/generated/v1beta1/network_services.get_endpoint_policy.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-networkservices/samples/generated/v1beta1/network_services.get_endpoint_policy.js` + + +----- + + + + +### Network_services.list_endpoint_policies + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-networkservices/samples/generated/v1beta1/network_services.list_endpoint_policies.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-cloud-networkservices/samples/generated/v1beta1/network_services.list_endpoint_policies.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-networkservices/samples/generated/v1beta1/network_services.list_endpoint_policies.js` + + +----- + + + + +### Network_services.update_endpoint_policy + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-networkservices/samples/generated/v1beta1/network_services.update_endpoint_policy.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-cloud-networkservices/samples/generated/v1beta1/network_services.update_endpoint_policy.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-networkservices/samples/generated/v1beta1/network_services.update_endpoint_policy.js` + + +----- + + + + +### Quickstart + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-networkservices/samples/quickstart.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-cloud-networkservices/samples/quickstart.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-networkservices/samples/quickstart.js` + + + + + + +[shell_img]: https://gstatic.com/cloudssh/images/open-btn.png +[shell_link]: https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=samples/README.md +[product-docs]: cloud.google.com/media-cdn/ diff --git a/packages/google-cloud-networkservices/samples/generated/v1/network_services.create_endpoint_policy.js b/packages/google-cloud-networkservices/samples/generated/v1/network_services.create_endpoint_policy.js new file mode 100644 index 00000000000..48d9dae95ab --- /dev/null +++ b/packages/google-cloud-networkservices/samples/generated/v1/network_services.create_endpoint_policy.js @@ -0,0 +1,74 @@ +// Copyright 2023 Google LLC +// +// Licensed under the Apache License, Version 2.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, endpointPolicyId, endpointPolicy) { + // [START networkservices_v1_generated_NetworkServices_CreateEndpointPolicy_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 of the EndpointPolicy. Must be in the + * format `projects/* /locations/global`. + */ + // const parent = 'abc123' + /** + * Required. Short name of the EndpointPolicy resource to be created. + * E.g. "CustomECS". + */ + // const endpointPolicyId = 'abc123' + /** + * Required. EndpointPolicy resource to be created. + */ + // const endpointPolicy = {} + + // Imports the Networkservices library + const {NetworkServicesClient} = require('@google-cloud/networkservices').v1; + + // Instantiates a client + const networkservicesClient = new NetworkServicesClient(); + + async function callCreateEndpointPolicy() { + // Construct request + const request = { + parent, + endpointPolicyId, + endpointPolicy, + }; + + // Run request + const [operation] = await networkservicesClient.createEndpointPolicy(request); + const [response] = await operation.promise(); + console.log(response); + } + + callCreateEndpointPolicy(); + // [END networkservices_v1_generated_NetworkServices_CreateEndpointPolicy_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-networkservices/samples/generated/v1/network_services.create_gateway.js b/packages/google-cloud-networkservices/samples/generated/v1/network_services.create_gateway.js new file mode 100644 index 00000000000..0039dd6530d --- /dev/null +++ b/packages/google-cloud-networkservices/samples/generated/v1/network_services.create_gateway.js @@ -0,0 +1,73 @@ +// Copyright 2023 Google LLC +// +// Licensed under the Apache License, Version 2.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, gatewayId, gateway) { + // [START networkservices_v1_generated_NetworkServices_CreateGateway_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 of the Gateway. Must be in the + * format `projects/* /locations/*`. + */ + // const parent = 'abc123' + /** + * Required. Short name of the Gateway resource to be created. + */ + // const gatewayId = 'abc123' + /** + * Required. Gateway resource to be created. + */ + // const gateway = {} + + // Imports the Networkservices library + const {NetworkServicesClient} = require('@google-cloud/networkservices').v1; + + // Instantiates a client + const networkservicesClient = new NetworkServicesClient(); + + async function callCreateGateway() { + // Construct request + const request = { + parent, + gatewayId, + gateway, + }; + + // Run request + const [operation] = await networkservicesClient.createGateway(request); + const [response] = await operation.promise(); + console.log(response); + } + + callCreateGateway(); + // [END networkservices_v1_generated_NetworkServices_CreateGateway_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-networkservices/samples/generated/v1/network_services.create_grpc_route.js b/packages/google-cloud-networkservices/samples/generated/v1/network_services.create_grpc_route.js new file mode 100644 index 00000000000..bbfc3295142 --- /dev/null +++ b/packages/google-cloud-networkservices/samples/generated/v1/network_services.create_grpc_route.js @@ -0,0 +1,73 @@ +// Copyright 2023 Google LLC +// +// Licensed under the Apache License, Version 2.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, grpcRouteId, grpcRoute) { + // [START networkservices_v1_generated_NetworkServices_CreateGrpcRoute_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 of the GrpcRoute. Must be in the + * format `projects/* /locations/global`. + */ + // const parent = 'abc123' + /** + * Required. Short name of the GrpcRoute resource to be created. + */ + // const grpcRouteId = 'abc123' + /** + * Required. GrpcRoute resource to be created. + */ + // const grpcRoute = {} + + // Imports the Networkservices library + const {NetworkServicesClient} = require('@google-cloud/networkservices').v1; + + // Instantiates a client + const networkservicesClient = new NetworkServicesClient(); + + async function callCreateGrpcRoute() { + // Construct request + const request = { + parent, + grpcRouteId, + grpcRoute, + }; + + // Run request + const [operation] = await networkservicesClient.createGrpcRoute(request); + const [response] = await operation.promise(); + console.log(response); + } + + callCreateGrpcRoute(); + // [END networkservices_v1_generated_NetworkServices_CreateGrpcRoute_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-networkservices/samples/generated/v1/network_services.create_http_route.js b/packages/google-cloud-networkservices/samples/generated/v1/network_services.create_http_route.js new file mode 100644 index 00000000000..cd3ba5f388f --- /dev/null +++ b/packages/google-cloud-networkservices/samples/generated/v1/network_services.create_http_route.js @@ -0,0 +1,73 @@ +// Copyright 2023 Google LLC +// +// Licensed under the Apache License, Version 2.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, httpRouteId, httpRoute) { + // [START networkservices_v1_generated_NetworkServices_CreateHttpRoute_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 of the HttpRoute. Must be in the + * format `projects/* /locations/global`. + */ + // const parent = 'abc123' + /** + * Required. Short name of the HttpRoute resource to be created. + */ + // const httpRouteId = 'abc123' + /** + * Required. HttpRoute resource to be created. + */ + // const httpRoute = {} + + // Imports the Networkservices library + const {NetworkServicesClient} = require('@google-cloud/networkservices').v1; + + // Instantiates a client + const networkservicesClient = new NetworkServicesClient(); + + async function callCreateHttpRoute() { + // Construct request + const request = { + parent, + httpRouteId, + httpRoute, + }; + + // Run request + const [operation] = await networkservicesClient.createHttpRoute(request); + const [response] = await operation.promise(); + console.log(response); + } + + callCreateHttpRoute(); + // [END networkservices_v1_generated_NetworkServices_CreateHttpRoute_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-networkservices/samples/generated/v1/network_services.create_mesh.js b/packages/google-cloud-networkservices/samples/generated/v1/network_services.create_mesh.js new file mode 100644 index 00000000000..0ea0bfd9087 --- /dev/null +++ b/packages/google-cloud-networkservices/samples/generated/v1/network_services.create_mesh.js @@ -0,0 +1,73 @@ +// Copyright 2023 Google LLC +// +// Licensed under the Apache License, Version 2.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, meshId, mesh) { + // [START networkservices_v1_generated_NetworkServices_CreateMesh_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 of the Mesh. Must be in the + * format `projects/* /locations/global`. + */ + // const parent = 'abc123' + /** + * Required. Short name of the Mesh resource to be created. + */ + // const meshId = 'abc123' + /** + * Required. Mesh resource to be created. + */ + // const mesh = {} + + // Imports the Networkservices library + const {NetworkServicesClient} = require('@google-cloud/networkservices').v1; + + // Instantiates a client + const networkservicesClient = new NetworkServicesClient(); + + async function callCreateMesh() { + // Construct request + const request = { + parent, + meshId, + mesh, + }; + + // Run request + const [operation] = await networkservicesClient.createMesh(request); + const [response] = await operation.promise(); + console.log(response); + } + + callCreateMesh(); + // [END networkservices_v1_generated_NetworkServices_CreateMesh_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-networkservices/samples/generated/v1/network_services.create_service_binding.js b/packages/google-cloud-networkservices/samples/generated/v1/network_services.create_service_binding.js new file mode 100644 index 00000000000..7fbd42fb846 --- /dev/null +++ b/packages/google-cloud-networkservices/samples/generated/v1/network_services.create_service_binding.js @@ -0,0 +1,73 @@ +// Copyright 2023 Google LLC +// +// Licensed under the Apache License, Version 2.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, serviceBindingId, serviceBinding) { + // [START networkservices_v1_generated_NetworkServices_CreateServiceBinding_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 of the ServiceBinding. Must be in the + * format `projects/* /locations/global`. + */ + // const parent = 'abc123' + /** + * Required. Short name of the ServiceBinding resource to be created. + */ + // const serviceBindingId = 'abc123' + /** + * Required. ServiceBinding resource to be created. + */ + // const serviceBinding = {} + + // Imports the Networkservices library + const {NetworkServicesClient} = require('@google-cloud/networkservices').v1; + + // Instantiates a client + const networkservicesClient = new NetworkServicesClient(); + + async function callCreateServiceBinding() { + // Construct request + const request = { + parent, + serviceBindingId, + serviceBinding, + }; + + // Run request + const [operation] = await networkservicesClient.createServiceBinding(request); + const [response] = await operation.promise(); + console.log(response); + } + + callCreateServiceBinding(); + // [END networkservices_v1_generated_NetworkServices_CreateServiceBinding_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-networkservices/samples/generated/v1/network_services.create_tcp_route.js b/packages/google-cloud-networkservices/samples/generated/v1/network_services.create_tcp_route.js new file mode 100644 index 00000000000..5b606075cbf --- /dev/null +++ b/packages/google-cloud-networkservices/samples/generated/v1/network_services.create_tcp_route.js @@ -0,0 +1,73 @@ +// Copyright 2023 Google LLC +// +// Licensed under the Apache License, Version 2.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, tcpRouteId, tcpRoute) { + // [START networkservices_v1_generated_NetworkServices_CreateTcpRoute_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 of the TcpRoute. Must be in the + * format `projects/* /locations/global`. + */ + // const parent = 'abc123' + /** + * Required. Short name of the TcpRoute resource to be created. + */ + // const tcpRouteId = 'abc123' + /** + * Required. TcpRoute resource to be created. + */ + // const tcpRoute = {} + + // Imports the Networkservices library + const {NetworkServicesClient} = require('@google-cloud/networkservices').v1; + + // Instantiates a client + const networkservicesClient = new NetworkServicesClient(); + + async function callCreateTcpRoute() { + // Construct request + const request = { + parent, + tcpRouteId, + tcpRoute, + }; + + // Run request + const [operation] = await networkservicesClient.createTcpRoute(request); + const [response] = await operation.promise(); + console.log(response); + } + + callCreateTcpRoute(); + // [END networkservices_v1_generated_NetworkServices_CreateTcpRoute_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-networkservices/samples/generated/v1/network_services.create_tls_route.js b/packages/google-cloud-networkservices/samples/generated/v1/network_services.create_tls_route.js new file mode 100644 index 00000000000..6d54f8e05aa --- /dev/null +++ b/packages/google-cloud-networkservices/samples/generated/v1/network_services.create_tls_route.js @@ -0,0 +1,73 @@ +// Copyright 2023 Google LLC +// +// Licensed under the Apache License, Version 2.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, tlsRouteId, tlsRoute) { + // [START networkservices_v1_generated_NetworkServices_CreateTlsRoute_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 of the TlsRoute. Must be in the + * format `projects/* /locations/global`. + */ + // const parent = 'abc123' + /** + * Required. Short name of the TlsRoute resource to be created. + */ + // const tlsRouteId = 'abc123' + /** + * Required. TlsRoute resource to be created. + */ + // const tlsRoute = {} + + // Imports the Networkservices library + const {NetworkServicesClient} = require('@google-cloud/networkservices').v1; + + // Instantiates a client + const networkservicesClient = new NetworkServicesClient(); + + async function callCreateTlsRoute() { + // Construct request + const request = { + parent, + tlsRouteId, + tlsRoute, + }; + + // Run request + const [operation] = await networkservicesClient.createTlsRoute(request); + const [response] = await operation.promise(); + console.log(response); + } + + callCreateTlsRoute(); + // [END networkservices_v1_generated_NetworkServices_CreateTlsRoute_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-networkservices/samples/generated/v1/network_services.delete_endpoint_policy.js b/packages/google-cloud-networkservices/samples/generated/v1/network_services.delete_endpoint_policy.js new file mode 100644 index 00000000000..7b932d346f0 --- /dev/null +++ b/packages/google-cloud-networkservices/samples/generated/v1/network_services.delete_endpoint_policy.js @@ -0,0 +1,63 @@ +// Copyright 2023 Google LLC +// +// Licensed under the Apache License, Version 2.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 networkservices_v1_generated_NetworkServices_DeleteEndpointPolicy_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. A name of the EndpointPolicy to delete. Must be in the format + * `projects/* /locations/global/endpointPolicies/*`. + */ + // const name = 'abc123' + + // Imports the Networkservices library + const {NetworkServicesClient} = require('@google-cloud/networkservices').v1; + + // Instantiates a client + const networkservicesClient = new NetworkServicesClient(); + + async function callDeleteEndpointPolicy() { + // Construct request + const request = { + name, + }; + + // Run request + const [operation] = await networkservicesClient.deleteEndpointPolicy(request); + const [response] = await operation.promise(); + console.log(response); + } + + callDeleteEndpointPolicy(); + // [END networkservices_v1_generated_NetworkServices_DeleteEndpointPolicy_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-networkservices/samples/generated/v1/network_services.delete_gateway.js b/packages/google-cloud-networkservices/samples/generated/v1/network_services.delete_gateway.js new file mode 100644 index 00000000000..0ce59d4b023 --- /dev/null +++ b/packages/google-cloud-networkservices/samples/generated/v1/network_services.delete_gateway.js @@ -0,0 +1,63 @@ +// Copyright 2023 Google LLC +// +// Licensed under the Apache License, Version 2.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 networkservices_v1_generated_NetworkServices_DeleteGateway_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. A name of the Gateway to delete. Must be in the format + * `projects/* /locations/* /gateways/*`. + */ + // const name = 'abc123' + + // Imports the Networkservices library + const {NetworkServicesClient} = require('@google-cloud/networkservices').v1; + + // Instantiates a client + const networkservicesClient = new NetworkServicesClient(); + + async function callDeleteGateway() { + // Construct request + const request = { + name, + }; + + // Run request + const [operation] = await networkservicesClient.deleteGateway(request); + const [response] = await operation.promise(); + console.log(response); + } + + callDeleteGateway(); + // [END networkservices_v1_generated_NetworkServices_DeleteGateway_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-networkservices/samples/generated/v1/network_services.delete_grpc_route.js b/packages/google-cloud-networkservices/samples/generated/v1/network_services.delete_grpc_route.js new file mode 100644 index 00000000000..fb28b0ee306 --- /dev/null +++ b/packages/google-cloud-networkservices/samples/generated/v1/network_services.delete_grpc_route.js @@ -0,0 +1,63 @@ +// Copyright 2023 Google LLC +// +// Licensed under the Apache License, Version 2.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 networkservices_v1_generated_NetworkServices_DeleteGrpcRoute_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. A name of the GrpcRoute to delete. Must be in the format + * `projects/* /locations/global/grpcRoutes/*`. + */ + // const name = 'abc123' + + // Imports the Networkservices library + const {NetworkServicesClient} = require('@google-cloud/networkservices').v1; + + // Instantiates a client + const networkservicesClient = new NetworkServicesClient(); + + async function callDeleteGrpcRoute() { + // Construct request + const request = { + name, + }; + + // Run request + const [operation] = await networkservicesClient.deleteGrpcRoute(request); + const [response] = await operation.promise(); + console.log(response); + } + + callDeleteGrpcRoute(); + // [END networkservices_v1_generated_NetworkServices_DeleteGrpcRoute_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-networkservices/samples/generated/v1/network_services.delete_http_route.js b/packages/google-cloud-networkservices/samples/generated/v1/network_services.delete_http_route.js new file mode 100644 index 00000000000..232be37fe6b --- /dev/null +++ b/packages/google-cloud-networkservices/samples/generated/v1/network_services.delete_http_route.js @@ -0,0 +1,63 @@ +// Copyright 2023 Google LLC +// +// Licensed under the Apache License, Version 2.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 networkservices_v1_generated_NetworkServices_DeleteHttpRoute_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. A name of the HttpRoute to delete. Must be in the format + * `projects/* /locations/global/httpRoutes/*`. + */ + // const name = 'abc123' + + // Imports the Networkservices library + const {NetworkServicesClient} = require('@google-cloud/networkservices').v1; + + // Instantiates a client + const networkservicesClient = new NetworkServicesClient(); + + async function callDeleteHttpRoute() { + // Construct request + const request = { + name, + }; + + // Run request + const [operation] = await networkservicesClient.deleteHttpRoute(request); + const [response] = await operation.promise(); + console.log(response); + } + + callDeleteHttpRoute(); + // [END networkservices_v1_generated_NetworkServices_DeleteHttpRoute_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-networkservices/samples/generated/v1/network_services.delete_mesh.js b/packages/google-cloud-networkservices/samples/generated/v1/network_services.delete_mesh.js new file mode 100644 index 00000000000..11d3f6053a3 --- /dev/null +++ b/packages/google-cloud-networkservices/samples/generated/v1/network_services.delete_mesh.js @@ -0,0 +1,63 @@ +// Copyright 2023 Google LLC +// +// Licensed under the Apache License, Version 2.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 networkservices_v1_generated_NetworkServices_DeleteMesh_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. A name of the Mesh to delete. Must be in the format + * `projects/* /locations/global/meshes/*`. + */ + // const name = 'abc123' + + // Imports the Networkservices library + const {NetworkServicesClient} = require('@google-cloud/networkservices').v1; + + // Instantiates a client + const networkservicesClient = new NetworkServicesClient(); + + async function callDeleteMesh() { + // Construct request + const request = { + name, + }; + + // Run request + const [operation] = await networkservicesClient.deleteMesh(request); + const [response] = await operation.promise(); + console.log(response); + } + + callDeleteMesh(); + // [END networkservices_v1_generated_NetworkServices_DeleteMesh_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-networkservices/samples/generated/v1/network_services.delete_service_binding.js b/packages/google-cloud-networkservices/samples/generated/v1/network_services.delete_service_binding.js new file mode 100644 index 00000000000..523b014d2d6 --- /dev/null +++ b/packages/google-cloud-networkservices/samples/generated/v1/network_services.delete_service_binding.js @@ -0,0 +1,63 @@ +// Copyright 2023 Google LLC +// +// Licensed under the Apache License, Version 2.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 networkservices_v1_generated_NetworkServices_DeleteServiceBinding_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. A name of the ServiceBinding to delete. Must be in the format + * `projects/* /locations/global/serviceBindings/*`. + */ + // const name = 'abc123' + + // Imports the Networkservices library + const {NetworkServicesClient} = require('@google-cloud/networkservices').v1; + + // Instantiates a client + const networkservicesClient = new NetworkServicesClient(); + + async function callDeleteServiceBinding() { + // Construct request + const request = { + name, + }; + + // Run request + const [operation] = await networkservicesClient.deleteServiceBinding(request); + const [response] = await operation.promise(); + console.log(response); + } + + callDeleteServiceBinding(); + // [END networkservices_v1_generated_NetworkServices_DeleteServiceBinding_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-networkservices/samples/generated/v1/network_services.delete_tcp_route.js b/packages/google-cloud-networkservices/samples/generated/v1/network_services.delete_tcp_route.js new file mode 100644 index 00000000000..17b077b07bf --- /dev/null +++ b/packages/google-cloud-networkservices/samples/generated/v1/network_services.delete_tcp_route.js @@ -0,0 +1,63 @@ +// Copyright 2023 Google LLC +// +// Licensed under the Apache License, Version 2.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 networkservices_v1_generated_NetworkServices_DeleteTcpRoute_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. A name of the TcpRoute to delete. Must be in the format + * `projects/* /locations/global/tcpRoutes/*`. + */ + // const name = 'abc123' + + // Imports the Networkservices library + const {NetworkServicesClient} = require('@google-cloud/networkservices').v1; + + // Instantiates a client + const networkservicesClient = new NetworkServicesClient(); + + async function callDeleteTcpRoute() { + // Construct request + const request = { + name, + }; + + // Run request + const [operation] = await networkservicesClient.deleteTcpRoute(request); + const [response] = await operation.promise(); + console.log(response); + } + + callDeleteTcpRoute(); + // [END networkservices_v1_generated_NetworkServices_DeleteTcpRoute_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-networkservices/samples/generated/v1/network_services.delete_tls_route.js b/packages/google-cloud-networkservices/samples/generated/v1/network_services.delete_tls_route.js new file mode 100644 index 00000000000..ee6486df939 --- /dev/null +++ b/packages/google-cloud-networkservices/samples/generated/v1/network_services.delete_tls_route.js @@ -0,0 +1,63 @@ +// Copyright 2023 Google LLC +// +// Licensed under the Apache License, Version 2.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 networkservices_v1_generated_NetworkServices_DeleteTlsRoute_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. A name of the TlsRoute to delete. Must be in the format + * `projects/* /locations/global/tlsRoutes/*`. + */ + // const name = 'abc123' + + // Imports the Networkservices library + const {NetworkServicesClient} = require('@google-cloud/networkservices').v1; + + // Instantiates a client + const networkservicesClient = new NetworkServicesClient(); + + async function callDeleteTlsRoute() { + // Construct request + const request = { + name, + }; + + // Run request + const [operation] = await networkservicesClient.deleteTlsRoute(request); + const [response] = await operation.promise(); + console.log(response); + } + + callDeleteTlsRoute(); + // [END networkservices_v1_generated_NetworkServices_DeleteTlsRoute_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-networkservices/samples/generated/v1/network_services.get_endpoint_policy.js b/packages/google-cloud-networkservices/samples/generated/v1/network_services.get_endpoint_policy.js new file mode 100644 index 00000000000..b327b8435e1 --- /dev/null +++ b/packages/google-cloud-networkservices/samples/generated/v1/network_services.get_endpoint_policy.js @@ -0,0 +1,62 @@ +// Copyright 2023 Google LLC +// +// Licensed under the Apache License, Version 2.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 networkservices_v1_generated_NetworkServices_GetEndpointPolicy_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. A name of the EndpointPolicy to get. Must be in the format + * `projects/* /locations/global/endpointPolicies/*`. + */ + // const name = 'abc123' + + // Imports the Networkservices library + const {NetworkServicesClient} = require('@google-cloud/networkservices').v1; + + // Instantiates a client + const networkservicesClient = new NetworkServicesClient(); + + async function callGetEndpointPolicy() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await networkservicesClient.getEndpointPolicy(request); + console.log(response); + } + + callGetEndpointPolicy(); + // [END networkservices_v1_generated_NetworkServices_GetEndpointPolicy_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-networkservices/samples/generated/v1/network_services.get_gateway.js b/packages/google-cloud-networkservices/samples/generated/v1/network_services.get_gateway.js new file mode 100644 index 00000000000..ef28293d654 --- /dev/null +++ b/packages/google-cloud-networkservices/samples/generated/v1/network_services.get_gateway.js @@ -0,0 +1,62 @@ +// Copyright 2023 Google LLC +// +// Licensed under the Apache License, Version 2.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 networkservices_v1_generated_NetworkServices_GetGateway_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. A name of the Gateway to get. Must be in the format + * `projects/* /locations/* /gateways/*`. + */ + // const name = 'abc123' + + // Imports the Networkservices library + const {NetworkServicesClient} = require('@google-cloud/networkservices').v1; + + // Instantiates a client + const networkservicesClient = new NetworkServicesClient(); + + async function callGetGateway() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await networkservicesClient.getGateway(request); + console.log(response); + } + + callGetGateway(); + // [END networkservices_v1_generated_NetworkServices_GetGateway_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-networkservices/samples/generated/v1/network_services.get_grpc_route.js b/packages/google-cloud-networkservices/samples/generated/v1/network_services.get_grpc_route.js new file mode 100644 index 00000000000..190fc2a07f1 --- /dev/null +++ b/packages/google-cloud-networkservices/samples/generated/v1/network_services.get_grpc_route.js @@ -0,0 +1,62 @@ +// Copyright 2023 Google LLC +// +// Licensed under the Apache License, Version 2.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 networkservices_v1_generated_NetworkServices_GetGrpcRoute_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. A name of the GrpcRoute to get. Must be in the format + * `projects/* /locations/global/grpcRoutes/*`. + */ + // const name = 'abc123' + + // Imports the Networkservices library + const {NetworkServicesClient} = require('@google-cloud/networkservices').v1; + + // Instantiates a client + const networkservicesClient = new NetworkServicesClient(); + + async function callGetGrpcRoute() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await networkservicesClient.getGrpcRoute(request); + console.log(response); + } + + callGetGrpcRoute(); + // [END networkservices_v1_generated_NetworkServices_GetGrpcRoute_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-networkservices/samples/generated/v1/network_services.get_http_route.js b/packages/google-cloud-networkservices/samples/generated/v1/network_services.get_http_route.js new file mode 100644 index 00000000000..e29c3005fac --- /dev/null +++ b/packages/google-cloud-networkservices/samples/generated/v1/network_services.get_http_route.js @@ -0,0 +1,62 @@ +// Copyright 2023 Google LLC +// +// Licensed under the Apache License, Version 2.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 networkservices_v1_generated_NetworkServices_GetHttpRoute_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. A name of the HttpRoute to get. Must be in the format + * `projects/* /locations/global/httpRoutes/*`. + */ + // const name = 'abc123' + + // Imports the Networkservices library + const {NetworkServicesClient} = require('@google-cloud/networkservices').v1; + + // Instantiates a client + const networkservicesClient = new NetworkServicesClient(); + + async function callGetHttpRoute() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await networkservicesClient.getHttpRoute(request); + console.log(response); + } + + callGetHttpRoute(); + // [END networkservices_v1_generated_NetworkServices_GetHttpRoute_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-networkservices/samples/generated/v1/network_services.get_mesh.js b/packages/google-cloud-networkservices/samples/generated/v1/network_services.get_mesh.js new file mode 100644 index 00000000000..dd660685c60 --- /dev/null +++ b/packages/google-cloud-networkservices/samples/generated/v1/network_services.get_mesh.js @@ -0,0 +1,62 @@ +// Copyright 2023 Google LLC +// +// Licensed under the Apache License, Version 2.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 networkservices_v1_generated_NetworkServices_GetMesh_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. A name of the Mesh to get. Must be in the format + * `projects/* /locations/global/meshes/*`. + */ + // const name = 'abc123' + + // Imports the Networkservices library + const {NetworkServicesClient} = require('@google-cloud/networkservices').v1; + + // Instantiates a client + const networkservicesClient = new NetworkServicesClient(); + + async function callGetMesh() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await networkservicesClient.getMesh(request); + console.log(response); + } + + callGetMesh(); + // [END networkservices_v1_generated_NetworkServices_GetMesh_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-networkservices/samples/generated/v1/network_services.get_service_binding.js b/packages/google-cloud-networkservices/samples/generated/v1/network_services.get_service_binding.js new file mode 100644 index 00000000000..35eb750cc38 --- /dev/null +++ b/packages/google-cloud-networkservices/samples/generated/v1/network_services.get_service_binding.js @@ -0,0 +1,62 @@ +// Copyright 2023 Google LLC +// +// Licensed under the Apache License, Version 2.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 networkservices_v1_generated_NetworkServices_GetServiceBinding_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. A name of the ServiceBinding to get. Must be in the format + * `projects/* /locations/global/serviceBindings/*`. + */ + // const name = 'abc123' + + // Imports the Networkservices library + const {NetworkServicesClient} = require('@google-cloud/networkservices').v1; + + // Instantiates a client + const networkservicesClient = new NetworkServicesClient(); + + async function callGetServiceBinding() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await networkservicesClient.getServiceBinding(request); + console.log(response); + } + + callGetServiceBinding(); + // [END networkservices_v1_generated_NetworkServices_GetServiceBinding_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-networkservices/samples/generated/v1/network_services.get_tcp_route.js b/packages/google-cloud-networkservices/samples/generated/v1/network_services.get_tcp_route.js new file mode 100644 index 00000000000..32136e40ad5 --- /dev/null +++ b/packages/google-cloud-networkservices/samples/generated/v1/network_services.get_tcp_route.js @@ -0,0 +1,62 @@ +// Copyright 2023 Google LLC +// +// Licensed under the Apache License, Version 2.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 networkservices_v1_generated_NetworkServices_GetTcpRoute_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. A name of the TcpRoute to get. Must be in the format + * `projects/* /locations/global/tcpRoutes/*`. + */ + // const name = 'abc123' + + // Imports the Networkservices library + const {NetworkServicesClient} = require('@google-cloud/networkservices').v1; + + // Instantiates a client + const networkservicesClient = new NetworkServicesClient(); + + async function callGetTcpRoute() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await networkservicesClient.getTcpRoute(request); + console.log(response); + } + + callGetTcpRoute(); + // [END networkservices_v1_generated_NetworkServices_GetTcpRoute_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-networkservices/samples/generated/v1/network_services.get_tls_route.js b/packages/google-cloud-networkservices/samples/generated/v1/network_services.get_tls_route.js new file mode 100644 index 00000000000..adebd940156 --- /dev/null +++ b/packages/google-cloud-networkservices/samples/generated/v1/network_services.get_tls_route.js @@ -0,0 +1,62 @@ +// Copyright 2023 Google LLC +// +// Licensed under the Apache License, Version 2.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 networkservices_v1_generated_NetworkServices_GetTlsRoute_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. A name of the TlsRoute to get. Must be in the format + * `projects/* /locations/global/tlsRoutes/*`. + */ + // const name = 'abc123' + + // Imports the Networkservices library + const {NetworkServicesClient} = require('@google-cloud/networkservices').v1; + + // Instantiates a client + const networkservicesClient = new NetworkServicesClient(); + + async function callGetTlsRoute() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await networkservicesClient.getTlsRoute(request); + console.log(response); + } + + callGetTlsRoute(); + // [END networkservices_v1_generated_NetworkServices_GetTlsRoute_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-networkservices/samples/generated/v1/network_services.list_endpoint_policies.js b/packages/google-cloud-networkservices/samples/generated/v1/network_services.list_endpoint_policies.js new file mode 100644 index 00000000000..36d6a942a68 --- /dev/null +++ b/packages/google-cloud-networkservices/samples/generated/v1/network_services.list_endpoint_policies.js @@ -0,0 +1,75 @@ +// Copyright 2023 Google LLC +// +// Licensed under the Apache License, Version 2.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 networkservices_v1_generated_NetworkServices_ListEndpointPolicies_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 from which the EndpointPolicies should + * be listed, specified in the format `projects/* /locations/global`. + */ + // const parent = 'abc123' + /** + * Maximum number of EndpointPolicies to return per call. + */ + // const pageSize = 1234 + /** + * The value returned by the last `ListEndpointPoliciesResponse` + * Indicates that this is a continuation of a prior + * `ListEndpointPolicies` call, and that the system should return the + * next page of data. + */ + // const pageToken = 'abc123' + + // Imports the Networkservices library + const {NetworkServicesClient} = require('@google-cloud/networkservices').v1; + + // Instantiates a client + const networkservicesClient = new NetworkServicesClient(); + + async function callListEndpointPolicies() { + // Construct request + const request = { + parent, + }; + + // Run request + const iterable = await networkservicesClient.listEndpointPoliciesAsync(request); + for await (const response of iterable) { + console.log(response); + } + } + + callListEndpointPolicies(); + // [END networkservices_v1_generated_NetworkServices_ListEndpointPolicies_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-networkservices/samples/generated/v1/network_services.list_gateways.js b/packages/google-cloud-networkservices/samples/generated/v1/network_services.list_gateways.js new file mode 100644 index 00000000000..4a96f91caa4 --- /dev/null +++ b/packages/google-cloud-networkservices/samples/generated/v1/network_services.list_gateways.js @@ -0,0 +1,74 @@ +// Copyright 2023 Google LLC +// +// Licensed under the Apache License, Version 2.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 networkservices_v1_generated_NetworkServices_ListGateways_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 from which the Gateways should be + * listed, specified in the format `projects/* /locations/*`. + */ + // const parent = 'abc123' + /** + * Maximum number of Gateways to return per call. + */ + // const pageSize = 1234 + /** + * The value returned by the last `ListGatewaysResponse` + * Indicates that this is a continuation of a prior `ListGateways` call, + * and that the system should return the next page of data. + */ + // const pageToken = 'abc123' + + // Imports the Networkservices library + const {NetworkServicesClient} = require('@google-cloud/networkservices').v1; + + // Instantiates a client + const networkservicesClient = new NetworkServicesClient(); + + async function callListGateways() { + // Construct request + const request = { + parent, + }; + + // Run request + const iterable = await networkservicesClient.listGatewaysAsync(request); + for await (const response of iterable) { + console.log(response); + } + } + + callListGateways(); + // [END networkservices_v1_generated_NetworkServices_ListGateways_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-networkservices/samples/generated/v1/network_services.list_grpc_routes.js b/packages/google-cloud-networkservices/samples/generated/v1/network_services.list_grpc_routes.js new file mode 100644 index 00000000000..711a554fa87 --- /dev/null +++ b/packages/google-cloud-networkservices/samples/generated/v1/network_services.list_grpc_routes.js @@ -0,0 +1,74 @@ +// Copyright 2023 Google LLC +// +// Licensed under the Apache License, Version 2.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 networkservices_v1_generated_NetworkServices_ListGrpcRoutes_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 from which the GrpcRoutes should be + * listed, specified in the format `projects/* /locations/global`. + */ + // const parent = 'abc123' + /** + * Maximum number of GrpcRoutes to return per call. + */ + // const pageSize = 1234 + /** + * The value returned by the last `ListGrpcRoutesResponse` + * Indicates that this is a continuation of a prior `ListGrpcRoutes` call, + * and that the system should return the next page of data. + */ + // const pageToken = 'abc123' + + // Imports the Networkservices library + const {NetworkServicesClient} = require('@google-cloud/networkservices').v1; + + // Instantiates a client + const networkservicesClient = new NetworkServicesClient(); + + async function callListGrpcRoutes() { + // Construct request + const request = { + parent, + }; + + // Run request + const iterable = await networkservicesClient.listGrpcRoutesAsync(request); + for await (const response of iterable) { + console.log(response); + } + } + + callListGrpcRoutes(); + // [END networkservices_v1_generated_NetworkServices_ListGrpcRoutes_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-networkservices/samples/generated/v1/network_services.list_http_routes.js b/packages/google-cloud-networkservices/samples/generated/v1/network_services.list_http_routes.js new file mode 100644 index 00000000000..fe8589d1e06 --- /dev/null +++ b/packages/google-cloud-networkservices/samples/generated/v1/network_services.list_http_routes.js @@ -0,0 +1,74 @@ +// Copyright 2023 Google LLC +// +// Licensed under the Apache License, Version 2.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 networkservices_v1_generated_NetworkServices_ListHttpRoutes_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 from which the HttpRoutes should be + * listed, specified in the format `projects/* /locations/global`. + */ + // const parent = 'abc123' + /** + * Maximum number of HttpRoutes to return per call. + */ + // const pageSize = 1234 + /** + * The value returned by the last `ListHttpRoutesResponse` + * Indicates that this is a continuation of a prior `ListHttpRoutes` call, + * and that the system should return the next page of data. + */ + // const pageToken = 'abc123' + + // Imports the Networkservices library + const {NetworkServicesClient} = require('@google-cloud/networkservices').v1; + + // Instantiates a client + const networkservicesClient = new NetworkServicesClient(); + + async function callListHttpRoutes() { + // Construct request + const request = { + parent, + }; + + // Run request + const iterable = await networkservicesClient.listHttpRoutesAsync(request); + for await (const response of iterable) { + console.log(response); + } + } + + callListHttpRoutes(); + // [END networkservices_v1_generated_NetworkServices_ListHttpRoutes_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-networkservices/samples/generated/v1/network_services.list_meshes.js b/packages/google-cloud-networkservices/samples/generated/v1/network_services.list_meshes.js new file mode 100644 index 00000000000..6de9f19d86a --- /dev/null +++ b/packages/google-cloud-networkservices/samples/generated/v1/network_services.list_meshes.js @@ -0,0 +1,74 @@ +// Copyright 2023 Google LLC +// +// Licensed under the Apache License, Version 2.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 networkservices_v1_generated_NetworkServices_ListMeshes_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 from which the Meshes should be + * listed, specified in the format `projects/* /locations/global`. + */ + // const parent = 'abc123' + /** + * Maximum number of Meshes to return per call. + */ + // const pageSize = 1234 + /** + * The value returned by the last `ListMeshesResponse` + * Indicates that this is a continuation of a prior `ListMeshes` call, + * and that the system should return the next page of data. + */ + // const pageToken = 'abc123' + + // Imports the Networkservices library + const {NetworkServicesClient} = require('@google-cloud/networkservices').v1; + + // Instantiates a client + const networkservicesClient = new NetworkServicesClient(); + + async function callListMeshes() { + // Construct request + const request = { + parent, + }; + + // Run request + const iterable = await networkservicesClient.listMeshesAsync(request); + for await (const response of iterable) { + console.log(response); + } + } + + callListMeshes(); + // [END networkservices_v1_generated_NetworkServices_ListMeshes_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-networkservices/samples/generated/v1/network_services.list_service_bindings.js b/packages/google-cloud-networkservices/samples/generated/v1/network_services.list_service_bindings.js new file mode 100644 index 00000000000..75a6aa29484 --- /dev/null +++ b/packages/google-cloud-networkservices/samples/generated/v1/network_services.list_service_bindings.js @@ -0,0 +1,74 @@ +// Copyright 2023 Google LLC +// +// Licensed under the Apache License, Version 2.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 networkservices_v1_generated_NetworkServices_ListServiceBindings_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 from which the ServiceBindings should be + * listed, specified in the format `projects/* /locations/global`. + */ + // const parent = 'abc123' + /** + * Maximum number of ServiceBindings to return per call. + */ + // const pageSize = 1234 + /** + * The value returned by the last `ListServiceBindingsResponse` + * Indicates that this is a continuation of a prior `ListRouters` call, + * and that the system should return the next page of data. + */ + // const pageToken = 'abc123' + + // Imports the Networkservices library + const {NetworkServicesClient} = require('@google-cloud/networkservices').v1; + + // Instantiates a client + const networkservicesClient = new NetworkServicesClient(); + + async function callListServiceBindings() { + // Construct request + const request = { + parent, + }; + + // Run request + const iterable = await networkservicesClient.listServiceBindingsAsync(request); + for await (const response of iterable) { + console.log(response); + } + } + + callListServiceBindings(); + // [END networkservices_v1_generated_NetworkServices_ListServiceBindings_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-networkservices/samples/generated/v1/network_services.list_tcp_routes.js b/packages/google-cloud-networkservices/samples/generated/v1/network_services.list_tcp_routes.js new file mode 100644 index 00000000000..c3cd9e11d97 --- /dev/null +++ b/packages/google-cloud-networkservices/samples/generated/v1/network_services.list_tcp_routes.js @@ -0,0 +1,74 @@ +// Copyright 2023 Google LLC +// +// Licensed under the Apache License, Version 2.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 networkservices_v1_generated_NetworkServices_ListTcpRoutes_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 from which the TcpRoutes should be + * listed, specified in the format `projects/* /locations/global`. + */ + // const parent = 'abc123' + /** + * Maximum number of TcpRoutes to return per call. + */ + // const pageSize = 1234 + /** + * The value returned by the last `ListTcpRoutesResponse` + * Indicates that this is a continuation of a prior `ListTcpRoutes` call, + * and that the system should return the next page of data. + */ + // const pageToken = 'abc123' + + // Imports the Networkservices library + const {NetworkServicesClient} = require('@google-cloud/networkservices').v1; + + // Instantiates a client + const networkservicesClient = new NetworkServicesClient(); + + async function callListTcpRoutes() { + // Construct request + const request = { + parent, + }; + + // Run request + const iterable = await networkservicesClient.listTcpRoutesAsync(request); + for await (const response of iterable) { + console.log(response); + } + } + + callListTcpRoutes(); + // [END networkservices_v1_generated_NetworkServices_ListTcpRoutes_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-networkservices/samples/generated/v1/network_services.list_tls_routes.js b/packages/google-cloud-networkservices/samples/generated/v1/network_services.list_tls_routes.js new file mode 100644 index 00000000000..74a5df9a5d7 --- /dev/null +++ b/packages/google-cloud-networkservices/samples/generated/v1/network_services.list_tls_routes.js @@ -0,0 +1,74 @@ +// Copyright 2023 Google LLC +// +// Licensed under the Apache License, Version 2.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 networkservices_v1_generated_NetworkServices_ListTlsRoutes_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 from which the TlsRoutes should be + * listed, specified in the format `projects/* /locations/global`. + */ + // const parent = 'abc123' + /** + * Maximum number of TlsRoutes to return per call. + */ + // const pageSize = 1234 + /** + * The value returned by the last `ListTlsRoutesResponse` + * Indicates that this is a continuation of a prior `ListTlsRoutes` call, + * and that the system should return the next page of data. + */ + // const pageToken = 'abc123' + + // Imports the Networkservices library + const {NetworkServicesClient} = require('@google-cloud/networkservices').v1; + + // Instantiates a client + const networkservicesClient = new NetworkServicesClient(); + + async function callListTlsRoutes() { + // Construct request + const request = { + parent, + }; + + // Run request + const iterable = await networkservicesClient.listTlsRoutesAsync(request); + for await (const response of iterable) { + console.log(response); + } + } + + callListTlsRoutes(); + // [END networkservices_v1_generated_NetworkServices_ListTlsRoutes_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-networkservices/samples/generated/v1/network_services.update_endpoint_policy.js b/packages/google-cloud-networkservices/samples/generated/v1/network_services.update_endpoint_policy.js new file mode 100644 index 00000000000..b68060a02d9 --- /dev/null +++ b/packages/google-cloud-networkservices/samples/generated/v1/network_services.update_endpoint_policy.js @@ -0,0 +1,70 @@ +// Copyright 2023 Google LLC +// +// Licensed under the Apache License, Version 2.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(endpointPolicy) { + // [START networkservices_v1_generated_NetworkServices_UpdateEndpointPolicy_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. + */ + /** + * Optional. Field mask is used to specify the fields to be overwritten in the + * EndpointPolicy resource by the update. + * The fields specified in the update_mask are relative to the resource, not + * the full request. A field will be overwritten if it is in the mask. If the + * user does not provide a mask then all fields will be overwritten. + */ + // const updateMask = {} + /** + * Required. Updated EndpointPolicy resource. + */ + // const endpointPolicy = {} + + // Imports the Networkservices library + const {NetworkServicesClient} = require('@google-cloud/networkservices').v1; + + // Instantiates a client + const networkservicesClient = new NetworkServicesClient(); + + async function callUpdateEndpointPolicy() { + // Construct request + const request = { + endpointPolicy, + }; + + // Run request + const [operation] = await networkservicesClient.updateEndpointPolicy(request); + const [response] = await operation.promise(); + console.log(response); + } + + callUpdateEndpointPolicy(); + // [END networkservices_v1_generated_NetworkServices_UpdateEndpointPolicy_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-networkservices/samples/generated/v1/network_services.update_gateway.js b/packages/google-cloud-networkservices/samples/generated/v1/network_services.update_gateway.js new file mode 100644 index 00000000000..926c5f14d4a --- /dev/null +++ b/packages/google-cloud-networkservices/samples/generated/v1/network_services.update_gateway.js @@ -0,0 +1,70 @@ +// Copyright 2023 Google LLC +// +// Licensed under the Apache License, Version 2.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(gateway) { + // [START networkservices_v1_generated_NetworkServices_UpdateGateway_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. + */ + /** + * Optional. Field mask is used to specify the fields to be overwritten in the + * Gateway resource by the update. + * The fields specified in the update_mask are relative to the resource, not + * the full request. A field will be overwritten if it is in the mask. If the + * user does not provide a mask then all fields will be overwritten. + */ + // const updateMask = {} + /** + * Required. Updated Gateway resource. + */ + // const gateway = {} + + // Imports the Networkservices library + const {NetworkServicesClient} = require('@google-cloud/networkservices').v1; + + // Instantiates a client + const networkservicesClient = new NetworkServicesClient(); + + async function callUpdateGateway() { + // Construct request + const request = { + gateway, + }; + + // Run request + const [operation] = await networkservicesClient.updateGateway(request); + const [response] = await operation.promise(); + console.log(response); + } + + callUpdateGateway(); + // [END networkservices_v1_generated_NetworkServices_UpdateGateway_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-networkservices/samples/generated/v1/network_services.update_grpc_route.js b/packages/google-cloud-networkservices/samples/generated/v1/network_services.update_grpc_route.js new file mode 100644 index 00000000000..024b271dadd --- /dev/null +++ b/packages/google-cloud-networkservices/samples/generated/v1/network_services.update_grpc_route.js @@ -0,0 +1,70 @@ +// Copyright 2023 Google LLC +// +// Licensed under the Apache License, Version 2.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(grpcRoute) { + // [START networkservices_v1_generated_NetworkServices_UpdateGrpcRoute_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. + */ + /** + * Optional. Field mask is used to specify the fields to be overwritten in the + * GrpcRoute resource by the update. + * The fields specified in the update_mask are relative to the resource, not + * the full request. A field will be overwritten if it is in the mask. If the + * user does not provide a mask then all fields will be overwritten. + */ + // const updateMask = {} + /** + * Required. Updated GrpcRoute resource. + */ + // const grpcRoute = {} + + // Imports the Networkservices library + const {NetworkServicesClient} = require('@google-cloud/networkservices').v1; + + // Instantiates a client + const networkservicesClient = new NetworkServicesClient(); + + async function callUpdateGrpcRoute() { + // Construct request + const request = { + grpcRoute, + }; + + // Run request + const [operation] = await networkservicesClient.updateGrpcRoute(request); + const [response] = await operation.promise(); + console.log(response); + } + + callUpdateGrpcRoute(); + // [END networkservices_v1_generated_NetworkServices_UpdateGrpcRoute_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-networkservices/samples/generated/v1/network_services.update_http_route.js b/packages/google-cloud-networkservices/samples/generated/v1/network_services.update_http_route.js new file mode 100644 index 00000000000..7c255727266 --- /dev/null +++ b/packages/google-cloud-networkservices/samples/generated/v1/network_services.update_http_route.js @@ -0,0 +1,70 @@ +// Copyright 2023 Google LLC +// +// Licensed under the Apache License, Version 2.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(httpRoute) { + // [START networkservices_v1_generated_NetworkServices_UpdateHttpRoute_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. + */ + /** + * Optional. Field mask is used to specify the fields to be overwritten in the + * HttpRoute resource by the update. + * The fields specified in the update_mask are relative to the resource, not + * the full request. A field will be overwritten if it is in the mask. If the + * user does not provide a mask then all fields will be overwritten. + */ + // const updateMask = {} + /** + * Required. Updated HttpRoute resource. + */ + // const httpRoute = {} + + // Imports the Networkservices library + const {NetworkServicesClient} = require('@google-cloud/networkservices').v1; + + // Instantiates a client + const networkservicesClient = new NetworkServicesClient(); + + async function callUpdateHttpRoute() { + // Construct request + const request = { + httpRoute, + }; + + // Run request + const [operation] = await networkservicesClient.updateHttpRoute(request); + const [response] = await operation.promise(); + console.log(response); + } + + callUpdateHttpRoute(); + // [END networkservices_v1_generated_NetworkServices_UpdateHttpRoute_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-networkservices/samples/generated/v1/network_services.update_mesh.js b/packages/google-cloud-networkservices/samples/generated/v1/network_services.update_mesh.js new file mode 100644 index 00000000000..ad84111acd7 --- /dev/null +++ b/packages/google-cloud-networkservices/samples/generated/v1/network_services.update_mesh.js @@ -0,0 +1,70 @@ +// Copyright 2023 Google LLC +// +// Licensed under the Apache License, Version 2.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(mesh) { + // [START networkservices_v1_generated_NetworkServices_UpdateMesh_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. + */ + /** + * Optional. Field mask is used to specify the fields to be overwritten in the + * Mesh resource by the update. + * The fields specified in the update_mask are relative to the resource, not + * the full request. A field will be overwritten if it is in the mask. If the + * user does not provide a mask then all fields will be overwritten. + */ + // const updateMask = {} + /** + * Required. Updated Mesh resource. + */ + // const mesh = {} + + // Imports the Networkservices library + const {NetworkServicesClient} = require('@google-cloud/networkservices').v1; + + // Instantiates a client + const networkservicesClient = new NetworkServicesClient(); + + async function callUpdateMesh() { + // Construct request + const request = { + mesh, + }; + + // Run request + const [operation] = await networkservicesClient.updateMesh(request); + const [response] = await operation.promise(); + console.log(response); + } + + callUpdateMesh(); + // [END networkservices_v1_generated_NetworkServices_UpdateMesh_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-networkservices/samples/generated/v1/network_services.update_tcp_route.js b/packages/google-cloud-networkservices/samples/generated/v1/network_services.update_tcp_route.js new file mode 100644 index 00000000000..210be2a06de --- /dev/null +++ b/packages/google-cloud-networkservices/samples/generated/v1/network_services.update_tcp_route.js @@ -0,0 +1,70 @@ +// Copyright 2023 Google LLC +// +// Licensed under the Apache License, Version 2.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(tcpRoute) { + // [START networkservices_v1_generated_NetworkServices_UpdateTcpRoute_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. + */ + /** + * Optional. Field mask is used to specify the fields to be overwritten in the + * TcpRoute resource by the update. + * The fields specified in the update_mask are relative to the resource, not + * the full request. A field will be overwritten if it is in the mask. If the + * user does not provide a mask then all fields will be overwritten. + */ + // const updateMask = {} + /** + * Required. Updated TcpRoute resource. + */ + // const tcpRoute = {} + + // Imports the Networkservices library + const {NetworkServicesClient} = require('@google-cloud/networkservices').v1; + + // Instantiates a client + const networkservicesClient = new NetworkServicesClient(); + + async function callUpdateTcpRoute() { + // Construct request + const request = { + tcpRoute, + }; + + // Run request + const [operation] = await networkservicesClient.updateTcpRoute(request); + const [response] = await operation.promise(); + console.log(response); + } + + callUpdateTcpRoute(); + // [END networkservices_v1_generated_NetworkServices_UpdateTcpRoute_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-networkservices/samples/generated/v1/network_services.update_tls_route.js b/packages/google-cloud-networkservices/samples/generated/v1/network_services.update_tls_route.js new file mode 100644 index 00000000000..908d87c3583 --- /dev/null +++ b/packages/google-cloud-networkservices/samples/generated/v1/network_services.update_tls_route.js @@ -0,0 +1,70 @@ +// Copyright 2023 Google LLC +// +// Licensed under the Apache License, Version 2.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(tlsRoute) { + // [START networkservices_v1_generated_NetworkServices_UpdateTlsRoute_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. + */ + /** + * Optional. Field mask is used to specify the fields to be overwritten in the + * TlsRoute resource by the update. + * The fields specified in the update_mask are relative to the resource, not + * the full request. A field will be overwritten if it is in the mask. If the + * user does not provide a mask then all fields will be overwritten. + */ + // const updateMask = {} + /** + * Required. Updated TlsRoute resource. + */ + // const tlsRoute = {} + + // Imports the Networkservices library + const {NetworkServicesClient} = require('@google-cloud/networkservices').v1; + + // Instantiates a client + const networkservicesClient = new NetworkServicesClient(); + + async function callUpdateTlsRoute() { + // Construct request + const request = { + tlsRoute, + }; + + // Run request + const [operation] = await networkservicesClient.updateTlsRoute(request); + const [response] = await operation.promise(); + console.log(response); + } + + callUpdateTlsRoute(); + // [END networkservices_v1_generated_NetworkServices_UpdateTlsRoute_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-networkservices/samples/generated/v1/snippet_metadata_google.cloud.networkservices.v1.json b/packages/google-cloud-networkservices/samples/generated/v1/snippet_metadata_google.cloud.networkservices.v1.json new file mode 100644 index 00000000000..c50811ae60c --- /dev/null +++ b/packages/google-cloud-networkservices/samples/generated/v1/snippet_metadata_google.cloud.networkservices.v1.json @@ -0,0 +1,1731 @@ +{ + "clientLibrary": { + "name": "nodejs-networkservices", + "version": "0.1.0", + "language": "TYPESCRIPT", + "apis": [ + { + "id": "google.cloud.networkservices.v1", + "version": "v1" + } + ] + }, + "snippets": [ + { + "regionTag": "networkservices_v1_generated_NetworkServices_ListEndpointPolicies_async", + "title": "NetworkServices listEndpointPolicies Sample", + "origin": "API_DEFINITION", + "description": " Lists EndpointPolicies in a given project and location.", + "canonical": true, + "file": "network_services.list_endpoint_policies.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 67, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "ListEndpointPolicies", + "fullName": "google.cloud.networkservices.v1.NetworkServices.ListEndpointPolicies", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "page_size", + "type": "TYPE_INT32" + }, + { + "name": "page_token", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.networkservices.v1.ListEndpointPoliciesResponse", + "client": { + "shortName": "NetworkServicesClient", + "fullName": "google.cloud.networkservices.v1.NetworkServicesClient" + }, + "method": { + "shortName": "ListEndpointPolicies", + "fullName": "google.cloud.networkservices.v1.NetworkServices.ListEndpointPolicies", + "service": { + "shortName": "NetworkServices", + "fullName": "google.cloud.networkservices.v1.NetworkServices" + } + } + } + }, + { + "regionTag": "networkservices_v1_generated_NetworkServices_GetEndpointPolicy_async", + "title": "NetworkServices getEndpointPolicy Sample", + "origin": "API_DEFINITION", + "description": " Gets details of a single EndpointPolicy.", + "canonical": true, + "file": "network_services.get_endpoint_policy.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 54, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "GetEndpointPolicy", + "fullName": "google.cloud.networkservices.v1.NetworkServices.GetEndpointPolicy", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.networkservices.v1.EndpointPolicy", + "client": { + "shortName": "NetworkServicesClient", + "fullName": "google.cloud.networkservices.v1.NetworkServicesClient" + }, + "method": { + "shortName": "GetEndpointPolicy", + "fullName": "google.cloud.networkservices.v1.NetworkServices.GetEndpointPolicy", + "service": { + "shortName": "NetworkServices", + "fullName": "google.cloud.networkservices.v1.NetworkServices" + } + } + } + }, + { + "regionTag": "networkservices_v1_generated_NetworkServices_CreateEndpointPolicy_async", + "title": "NetworkServices createEndpointPolicy Sample", + "origin": "API_DEFINITION", + "description": " Creates a new EndpointPolicy in a given project and location.", + "canonical": true, + "file": "network_services.create_endpoint_policy.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 66, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "CreateEndpointPolicy", + "fullName": "google.cloud.networkservices.v1.NetworkServices.CreateEndpointPolicy", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "endpoint_policy_id", + "type": "TYPE_STRING" + }, + { + "name": "endpoint_policy", + "type": ".google.cloud.networkservices.v1.EndpointPolicy" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "NetworkServicesClient", + "fullName": "google.cloud.networkservices.v1.NetworkServicesClient" + }, + "method": { + "shortName": "CreateEndpointPolicy", + "fullName": "google.cloud.networkservices.v1.NetworkServices.CreateEndpointPolicy", + "service": { + "shortName": "NetworkServices", + "fullName": "google.cloud.networkservices.v1.NetworkServices" + } + } + } + }, + { + "regionTag": "networkservices_v1_generated_NetworkServices_UpdateEndpointPolicy_async", + "title": "NetworkServices updateEndpointPolicy Sample", + "origin": "API_DEFINITION", + "description": " Updates the parameters of a single EndpointPolicy.", + "canonical": true, + "file": "network_services.update_endpoint_policy.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 62, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "UpdateEndpointPolicy", + "fullName": "google.cloud.networkservices.v1.NetworkServices.UpdateEndpointPolicy", + "async": true, + "parameters": [ + { + "name": "update_mask", + "type": ".google.protobuf.FieldMask" + }, + { + "name": "endpoint_policy", + "type": ".google.cloud.networkservices.v1.EndpointPolicy" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "NetworkServicesClient", + "fullName": "google.cloud.networkservices.v1.NetworkServicesClient" + }, + "method": { + "shortName": "UpdateEndpointPolicy", + "fullName": "google.cloud.networkservices.v1.NetworkServices.UpdateEndpointPolicy", + "service": { + "shortName": "NetworkServices", + "fullName": "google.cloud.networkservices.v1.NetworkServices" + } + } + } + }, + { + "regionTag": "networkservices_v1_generated_NetworkServices_DeleteEndpointPolicy_async", + "title": "NetworkServices deleteEndpointPolicy Sample", + "origin": "API_DEFINITION", + "description": " Deletes a single EndpointPolicy.", + "canonical": true, + "file": "network_services.delete_endpoint_policy.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 55, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "DeleteEndpointPolicy", + "fullName": "google.cloud.networkservices.v1.NetworkServices.DeleteEndpointPolicy", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "NetworkServicesClient", + "fullName": "google.cloud.networkservices.v1.NetworkServicesClient" + }, + "method": { + "shortName": "DeleteEndpointPolicy", + "fullName": "google.cloud.networkservices.v1.NetworkServices.DeleteEndpointPolicy", + "service": { + "shortName": "NetworkServices", + "fullName": "google.cloud.networkservices.v1.NetworkServices" + } + } + } + }, + { + "regionTag": "networkservices_v1_generated_NetworkServices_ListGateways_async", + "title": "NetworkServices listGateways Sample", + "origin": "API_DEFINITION", + "description": " Lists Gateways in a given project and location.", + "canonical": true, + "file": "network_services.list_gateways.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 66, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "ListGateways", + "fullName": "google.cloud.networkservices.v1.NetworkServices.ListGateways", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "page_size", + "type": "TYPE_INT32" + }, + { + "name": "page_token", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.networkservices.v1.ListGatewaysResponse", + "client": { + "shortName": "NetworkServicesClient", + "fullName": "google.cloud.networkservices.v1.NetworkServicesClient" + }, + "method": { + "shortName": "ListGateways", + "fullName": "google.cloud.networkservices.v1.NetworkServices.ListGateways", + "service": { + "shortName": "NetworkServices", + "fullName": "google.cloud.networkservices.v1.NetworkServices" + } + } + } + }, + { + "regionTag": "networkservices_v1_generated_NetworkServices_GetGateway_async", + "title": "NetworkServices getGateway Sample", + "origin": "API_DEFINITION", + "description": " Gets details of a single Gateway.", + "canonical": true, + "file": "network_services.get_gateway.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 54, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "GetGateway", + "fullName": "google.cloud.networkservices.v1.NetworkServices.GetGateway", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.networkservices.v1.Gateway", + "client": { + "shortName": "NetworkServicesClient", + "fullName": "google.cloud.networkservices.v1.NetworkServicesClient" + }, + "method": { + "shortName": "GetGateway", + "fullName": "google.cloud.networkservices.v1.NetworkServices.GetGateway", + "service": { + "shortName": "NetworkServices", + "fullName": "google.cloud.networkservices.v1.NetworkServices" + } + } + } + }, + { + "regionTag": "networkservices_v1_generated_NetworkServices_CreateGateway_async", + "title": "NetworkServices createGateway Sample", + "origin": "API_DEFINITION", + "description": " Creates a new Gateway in a given project and location.", + "canonical": true, + "file": "network_services.create_gateway.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 65, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "CreateGateway", + "fullName": "google.cloud.networkservices.v1.NetworkServices.CreateGateway", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "gateway_id", + "type": "TYPE_STRING" + }, + { + "name": "gateway", + "type": ".google.cloud.networkservices.v1.Gateway" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "NetworkServicesClient", + "fullName": "google.cloud.networkservices.v1.NetworkServicesClient" + }, + "method": { + "shortName": "CreateGateway", + "fullName": "google.cloud.networkservices.v1.NetworkServices.CreateGateway", + "service": { + "shortName": "NetworkServices", + "fullName": "google.cloud.networkservices.v1.NetworkServices" + } + } + } + }, + { + "regionTag": "networkservices_v1_generated_NetworkServices_UpdateGateway_async", + "title": "NetworkServices updateGateway Sample", + "origin": "API_DEFINITION", + "description": " Updates the parameters of a single Gateway.", + "canonical": true, + "file": "network_services.update_gateway.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 62, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "UpdateGateway", + "fullName": "google.cloud.networkservices.v1.NetworkServices.UpdateGateway", + "async": true, + "parameters": [ + { + "name": "update_mask", + "type": ".google.protobuf.FieldMask" + }, + { + "name": "gateway", + "type": ".google.cloud.networkservices.v1.Gateway" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "NetworkServicesClient", + "fullName": "google.cloud.networkservices.v1.NetworkServicesClient" + }, + "method": { + "shortName": "UpdateGateway", + "fullName": "google.cloud.networkservices.v1.NetworkServices.UpdateGateway", + "service": { + "shortName": "NetworkServices", + "fullName": "google.cloud.networkservices.v1.NetworkServices" + } + } + } + }, + { + "regionTag": "networkservices_v1_generated_NetworkServices_DeleteGateway_async", + "title": "NetworkServices deleteGateway Sample", + "origin": "API_DEFINITION", + "description": " Deletes a single Gateway.", + "canonical": true, + "file": "network_services.delete_gateway.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 55, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "DeleteGateway", + "fullName": "google.cloud.networkservices.v1.NetworkServices.DeleteGateway", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "NetworkServicesClient", + "fullName": "google.cloud.networkservices.v1.NetworkServicesClient" + }, + "method": { + "shortName": "DeleteGateway", + "fullName": "google.cloud.networkservices.v1.NetworkServices.DeleteGateway", + "service": { + "shortName": "NetworkServices", + "fullName": "google.cloud.networkservices.v1.NetworkServices" + } + } + } + }, + { + "regionTag": "networkservices_v1_generated_NetworkServices_ListGrpcRoutes_async", + "title": "NetworkServices listGrpcRoutes Sample", + "origin": "API_DEFINITION", + "description": " Lists GrpcRoutes in a given project and location.", + "canonical": true, + "file": "network_services.list_grpc_routes.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 66, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "ListGrpcRoutes", + "fullName": "google.cloud.networkservices.v1.NetworkServices.ListGrpcRoutes", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "page_size", + "type": "TYPE_INT32" + }, + { + "name": "page_token", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.networkservices.v1.ListGrpcRoutesResponse", + "client": { + "shortName": "NetworkServicesClient", + "fullName": "google.cloud.networkservices.v1.NetworkServicesClient" + }, + "method": { + "shortName": "ListGrpcRoutes", + "fullName": "google.cloud.networkservices.v1.NetworkServices.ListGrpcRoutes", + "service": { + "shortName": "NetworkServices", + "fullName": "google.cloud.networkservices.v1.NetworkServices" + } + } + } + }, + { + "regionTag": "networkservices_v1_generated_NetworkServices_GetGrpcRoute_async", + "title": "NetworkServices getGrpcRoute Sample", + "origin": "API_DEFINITION", + "description": " Gets details of a single GrpcRoute.", + "canonical": true, + "file": "network_services.get_grpc_route.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 54, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "GetGrpcRoute", + "fullName": "google.cloud.networkservices.v1.NetworkServices.GetGrpcRoute", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.networkservices.v1.GrpcRoute", + "client": { + "shortName": "NetworkServicesClient", + "fullName": "google.cloud.networkservices.v1.NetworkServicesClient" + }, + "method": { + "shortName": "GetGrpcRoute", + "fullName": "google.cloud.networkservices.v1.NetworkServices.GetGrpcRoute", + "service": { + "shortName": "NetworkServices", + "fullName": "google.cloud.networkservices.v1.NetworkServices" + } + } + } + }, + { + "regionTag": "networkservices_v1_generated_NetworkServices_CreateGrpcRoute_async", + "title": "NetworkServices createGrpcRoute Sample", + "origin": "API_DEFINITION", + "description": " Creates a new GrpcRoute in a given project and location.", + "canonical": true, + "file": "network_services.create_grpc_route.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 65, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "CreateGrpcRoute", + "fullName": "google.cloud.networkservices.v1.NetworkServices.CreateGrpcRoute", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "grpc_route_id", + "type": "TYPE_STRING" + }, + { + "name": "grpc_route", + "type": ".google.cloud.networkservices.v1.GrpcRoute" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "NetworkServicesClient", + "fullName": "google.cloud.networkservices.v1.NetworkServicesClient" + }, + "method": { + "shortName": "CreateGrpcRoute", + "fullName": "google.cloud.networkservices.v1.NetworkServices.CreateGrpcRoute", + "service": { + "shortName": "NetworkServices", + "fullName": "google.cloud.networkservices.v1.NetworkServices" + } + } + } + }, + { + "regionTag": "networkservices_v1_generated_NetworkServices_UpdateGrpcRoute_async", + "title": "NetworkServices updateGrpcRoute Sample", + "origin": "API_DEFINITION", + "description": " Updates the parameters of a single GrpcRoute.", + "canonical": true, + "file": "network_services.update_grpc_route.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 62, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "UpdateGrpcRoute", + "fullName": "google.cloud.networkservices.v1.NetworkServices.UpdateGrpcRoute", + "async": true, + "parameters": [ + { + "name": "update_mask", + "type": ".google.protobuf.FieldMask" + }, + { + "name": "grpc_route", + "type": ".google.cloud.networkservices.v1.GrpcRoute" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "NetworkServicesClient", + "fullName": "google.cloud.networkservices.v1.NetworkServicesClient" + }, + "method": { + "shortName": "UpdateGrpcRoute", + "fullName": "google.cloud.networkservices.v1.NetworkServices.UpdateGrpcRoute", + "service": { + "shortName": "NetworkServices", + "fullName": "google.cloud.networkservices.v1.NetworkServices" + } + } + } + }, + { + "regionTag": "networkservices_v1_generated_NetworkServices_DeleteGrpcRoute_async", + "title": "NetworkServices deleteGrpcRoute Sample", + "origin": "API_DEFINITION", + "description": " Deletes a single GrpcRoute.", + "canonical": true, + "file": "network_services.delete_grpc_route.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 55, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "DeleteGrpcRoute", + "fullName": "google.cloud.networkservices.v1.NetworkServices.DeleteGrpcRoute", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "NetworkServicesClient", + "fullName": "google.cloud.networkservices.v1.NetworkServicesClient" + }, + "method": { + "shortName": "DeleteGrpcRoute", + "fullName": "google.cloud.networkservices.v1.NetworkServices.DeleteGrpcRoute", + "service": { + "shortName": "NetworkServices", + "fullName": "google.cloud.networkservices.v1.NetworkServices" + } + } + } + }, + { + "regionTag": "networkservices_v1_generated_NetworkServices_ListHttpRoutes_async", + "title": "NetworkServices listHttpRoutes Sample", + "origin": "API_DEFINITION", + "description": " Lists HttpRoute in a given project and location.", + "canonical": true, + "file": "network_services.list_http_routes.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 66, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "ListHttpRoutes", + "fullName": "google.cloud.networkservices.v1.NetworkServices.ListHttpRoutes", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "page_size", + "type": "TYPE_INT32" + }, + { + "name": "page_token", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.networkservices.v1.ListHttpRoutesResponse", + "client": { + "shortName": "NetworkServicesClient", + "fullName": "google.cloud.networkservices.v1.NetworkServicesClient" + }, + "method": { + "shortName": "ListHttpRoutes", + "fullName": "google.cloud.networkservices.v1.NetworkServices.ListHttpRoutes", + "service": { + "shortName": "NetworkServices", + "fullName": "google.cloud.networkservices.v1.NetworkServices" + } + } + } + }, + { + "regionTag": "networkservices_v1_generated_NetworkServices_GetHttpRoute_async", + "title": "NetworkServices getHttpRoute Sample", + "origin": "API_DEFINITION", + "description": " Gets details of a single HttpRoute.", + "canonical": true, + "file": "network_services.get_http_route.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 54, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "GetHttpRoute", + "fullName": "google.cloud.networkservices.v1.NetworkServices.GetHttpRoute", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.networkservices.v1.HttpRoute", + "client": { + "shortName": "NetworkServicesClient", + "fullName": "google.cloud.networkservices.v1.NetworkServicesClient" + }, + "method": { + "shortName": "GetHttpRoute", + "fullName": "google.cloud.networkservices.v1.NetworkServices.GetHttpRoute", + "service": { + "shortName": "NetworkServices", + "fullName": "google.cloud.networkservices.v1.NetworkServices" + } + } + } + }, + { + "regionTag": "networkservices_v1_generated_NetworkServices_CreateHttpRoute_async", + "title": "NetworkServices createHttpRoute Sample", + "origin": "API_DEFINITION", + "description": " Creates a new HttpRoute in a given project and location.", + "canonical": true, + "file": "network_services.create_http_route.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 65, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "CreateHttpRoute", + "fullName": "google.cloud.networkservices.v1.NetworkServices.CreateHttpRoute", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "http_route_id", + "type": "TYPE_STRING" + }, + { + "name": "http_route", + "type": ".google.cloud.networkservices.v1.HttpRoute" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "NetworkServicesClient", + "fullName": "google.cloud.networkservices.v1.NetworkServicesClient" + }, + "method": { + "shortName": "CreateHttpRoute", + "fullName": "google.cloud.networkservices.v1.NetworkServices.CreateHttpRoute", + "service": { + "shortName": "NetworkServices", + "fullName": "google.cloud.networkservices.v1.NetworkServices" + } + } + } + }, + { + "regionTag": "networkservices_v1_generated_NetworkServices_UpdateHttpRoute_async", + "title": "NetworkServices updateHttpRoute Sample", + "origin": "API_DEFINITION", + "description": " Updates the parameters of a single HttpRoute.", + "canonical": true, + "file": "network_services.update_http_route.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 62, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "UpdateHttpRoute", + "fullName": "google.cloud.networkservices.v1.NetworkServices.UpdateHttpRoute", + "async": true, + "parameters": [ + { + "name": "update_mask", + "type": ".google.protobuf.FieldMask" + }, + { + "name": "http_route", + "type": ".google.cloud.networkservices.v1.HttpRoute" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "NetworkServicesClient", + "fullName": "google.cloud.networkservices.v1.NetworkServicesClient" + }, + "method": { + "shortName": "UpdateHttpRoute", + "fullName": "google.cloud.networkservices.v1.NetworkServices.UpdateHttpRoute", + "service": { + "shortName": "NetworkServices", + "fullName": "google.cloud.networkservices.v1.NetworkServices" + } + } + } + }, + { + "regionTag": "networkservices_v1_generated_NetworkServices_DeleteHttpRoute_async", + "title": "NetworkServices deleteHttpRoute Sample", + "origin": "API_DEFINITION", + "description": " Deletes a single HttpRoute.", + "canonical": true, + "file": "network_services.delete_http_route.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 55, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "DeleteHttpRoute", + "fullName": "google.cloud.networkservices.v1.NetworkServices.DeleteHttpRoute", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "NetworkServicesClient", + "fullName": "google.cloud.networkservices.v1.NetworkServicesClient" + }, + "method": { + "shortName": "DeleteHttpRoute", + "fullName": "google.cloud.networkservices.v1.NetworkServices.DeleteHttpRoute", + "service": { + "shortName": "NetworkServices", + "fullName": "google.cloud.networkservices.v1.NetworkServices" + } + } + } + }, + { + "regionTag": "networkservices_v1_generated_NetworkServices_ListTcpRoutes_async", + "title": "NetworkServices listTcpRoutes Sample", + "origin": "API_DEFINITION", + "description": " Lists TcpRoute in a given project and location.", + "canonical": true, + "file": "network_services.list_tcp_routes.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 66, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "ListTcpRoutes", + "fullName": "google.cloud.networkservices.v1.NetworkServices.ListTcpRoutes", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "page_size", + "type": "TYPE_INT32" + }, + { + "name": "page_token", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.networkservices.v1.ListTcpRoutesResponse", + "client": { + "shortName": "NetworkServicesClient", + "fullName": "google.cloud.networkservices.v1.NetworkServicesClient" + }, + "method": { + "shortName": "ListTcpRoutes", + "fullName": "google.cloud.networkservices.v1.NetworkServices.ListTcpRoutes", + "service": { + "shortName": "NetworkServices", + "fullName": "google.cloud.networkservices.v1.NetworkServices" + } + } + } + }, + { + "regionTag": "networkservices_v1_generated_NetworkServices_GetTcpRoute_async", + "title": "NetworkServices getTcpRoute Sample", + "origin": "API_DEFINITION", + "description": " Gets details of a single TcpRoute.", + "canonical": true, + "file": "network_services.get_tcp_route.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 54, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "GetTcpRoute", + "fullName": "google.cloud.networkservices.v1.NetworkServices.GetTcpRoute", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.networkservices.v1.TcpRoute", + "client": { + "shortName": "NetworkServicesClient", + "fullName": "google.cloud.networkservices.v1.NetworkServicesClient" + }, + "method": { + "shortName": "GetTcpRoute", + "fullName": "google.cloud.networkservices.v1.NetworkServices.GetTcpRoute", + "service": { + "shortName": "NetworkServices", + "fullName": "google.cloud.networkservices.v1.NetworkServices" + } + } + } + }, + { + "regionTag": "networkservices_v1_generated_NetworkServices_CreateTcpRoute_async", + "title": "NetworkServices createTcpRoute Sample", + "origin": "API_DEFINITION", + "description": " Creates a new TcpRoute in a given project and location.", + "canonical": true, + "file": "network_services.create_tcp_route.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 65, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "CreateTcpRoute", + "fullName": "google.cloud.networkservices.v1.NetworkServices.CreateTcpRoute", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "tcp_route_id", + "type": "TYPE_STRING" + }, + { + "name": "tcp_route", + "type": ".google.cloud.networkservices.v1.TcpRoute" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "NetworkServicesClient", + "fullName": "google.cloud.networkservices.v1.NetworkServicesClient" + }, + "method": { + "shortName": "CreateTcpRoute", + "fullName": "google.cloud.networkservices.v1.NetworkServices.CreateTcpRoute", + "service": { + "shortName": "NetworkServices", + "fullName": "google.cloud.networkservices.v1.NetworkServices" + } + } + } + }, + { + "regionTag": "networkservices_v1_generated_NetworkServices_UpdateTcpRoute_async", + "title": "NetworkServices updateTcpRoute Sample", + "origin": "API_DEFINITION", + "description": " Updates the parameters of a single TcpRoute.", + "canonical": true, + "file": "network_services.update_tcp_route.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 62, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "UpdateTcpRoute", + "fullName": "google.cloud.networkservices.v1.NetworkServices.UpdateTcpRoute", + "async": true, + "parameters": [ + { + "name": "update_mask", + "type": ".google.protobuf.FieldMask" + }, + { + "name": "tcp_route", + "type": ".google.cloud.networkservices.v1.TcpRoute" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "NetworkServicesClient", + "fullName": "google.cloud.networkservices.v1.NetworkServicesClient" + }, + "method": { + "shortName": "UpdateTcpRoute", + "fullName": "google.cloud.networkservices.v1.NetworkServices.UpdateTcpRoute", + "service": { + "shortName": "NetworkServices", + "fullName": "google.cloud.networkservices.v1.NetworkServices" + } + } + } + }, + { + "regionTag": "networkservices_v1_generated_NetworkServices_DeleteTcpRoute_async", + "title": "NetworkServices deleteTcpRoute Sample", + "origin": "API_DEFINITION", + "description": " Deletes a single TcpRoute.", + "canonical": true, + "file": "network_services.delete_tcp_route.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 55, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "DeleteTcpRoute", + "fullName": "google.cloud.networkservices.v1.NetworkServices.DeleteTcpRoute", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "NetworkServicesClient", + "fullName": "google.cloud.networkservices.v1.NetworkServicesClient" + }, + "method": { + "shortName": "DeleteTcpRoute", + "fullName": "google.cloud.networkservices.v1.NetworkServices.DeleteTcpRoute", + "service": { + "shortName": "NetworkServices", + "fullName": "google.cloud.networkservices.v1.NetworkServices" + } + } + } + }, + { + "regionTag": "networkservices_v1_generated_NetworkServices_ListTlsRoutes_async", + "title": "NetworkServices listTlsRoutes Sample", + "origin": "API_DEFINITION", + "description": " Lists TlsRoute in a given project and location.", + "canonical": true, + "file": "network_services.list_tls_routes.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 66, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "ListTlsRoutes", + "fullName": "google.cloud.networkservices.v1.NetworkServices.ListTlsRoutes", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "page_size", + "type": "TYPE_INT32" + }, + { + "name": "page_token", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.networkservices.v1.ListTlsRoutesResponse", + "client": { + "shortName": "NetworkServicesClient", + "fullName": "google.cloud.networkservices.v1.NetworkServicesClient" + }, + "method": { + "shortName": "ListTlsRoutes", + "fullName": "google.cloud.networkservices.v1.NetworkServices.ListTlsRoutes", + "service": { + "shortName": "NetworkServices", + "fullName": "google.cloud.networkservices.v1.NetworkServices" + } + } + } + }, + { + "regionTag": "networkservices_v1_generated_NetworkServices_GetTlsRoute_async", + "title": "NetworkServices getTlsRoute Sample", + "origin": "API_DEFINITION", + "description": " Gets details of a single TlsRoute.", + "canonical": true, + "file": "network_services.get_tls_route.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 54, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "GetTlsRoute", + "fullName": "google.cloud.networkservices.v1.NetworkServices.GetTlsRoute", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.networkservices.v1.TlsRoute", + "client": { + "shortName": "NetworkServicesClient", + "fullName": "google.cloud.networkservices.v1.NetworkServicesClient" + }, + "method": { + "shortName": "GetTlsRoute", + "fullName": "google.cloud.networkservices.v1.NetworkServices.GetTlsRoute", + "service": { + "shortName": "NetworkServices", + "fullName": "google.cloud.networkservices.v1.NetworkServices" + } + } + } + }, + { + "regionTag": "networkservices_v1_generated_NetworkServices_CreateTlsRoute_async", + "title": "NetworkServices createTlsRoute Sample", + "origin": "API_DEFINITION", + "description": " Creates a new TlsRoute in a given project and location.", + "canonical": true, + "file": "network_services.create_tls_route.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 65, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "CreateTlsRoute", + "fullName": "google.cloud.networkservices.v1.NetworkServices.CreateTlsRoute", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "tls_route_id", + "type": "TYPE_STRING" + }, + { + "name": "tls_route", + "type": ".google.cloud.networkservices.v1.TlsRoute" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "NetworkServicesClient", + "fullName": "google.cloud.networkservices.v1.NetworkServicesClient" + }, + "method": { + "shortName": "CreateTlsRoute", + "fullName": "google.cloud.networkservices.v1.NetworkServices.CreateTlsRoute", + "service": { + "shortName": "NetworkServices", + "fullName": "google.cloud.networkservices.v1.NetworkServices" + } + } + } + }, + { + "regionTag": "networkservices_v1_generated_NetworkServices_UpdateTlsRoute_async", + "title": "NetworkServices updateTlsRoute Sample", + "origin": "API_DEFINITION", + "description": " Updates the parameters of a single TlsRoute.", + "canonical": true, + "file": "network_services.update_tls_route.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 62, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "UpdateTlsRoute", + "fullName": "google.cloud.networkservices.v1.NetworkServices.UpdateTlsRoute", + "async": true, + "parameters": [ + { + "name": "update_mask", + "type": ".google.protobuf.FieldMask" + }, + { + "name": "tls_route", + "type": ".google.cloud.networkservices.v1.TlsRoute" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "NetworkServicesClient", + "fullName": "google.cloud.networkservices.v1.NetworkServicesClient" + }, + "method": { + "shortName": "UpdateTlsRoute", + "fullName": "google.cloud.networkservices.v1.NetworkServices.UpdateTlsRoute", + "service": { + "shortName": "NetworkServices", + "fullName": "google.cloud.networkservices.v1.NetworkServices" + } + } + } + }, + { + "regionTag": "networkservices_v1_generated_NetworkServices_DeleteTlsRoute_async", + "title": "NetworkServices deleteTlsRoute Sample", + "origin": "API_DEFINITION", + "description": " Deletes a single TlsRoute.", + "canonical": true, + "file": "network_services.delete_tls_route.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 55, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "DeleteTlsRoute", + "fullName": "google.cloud.networkservices.v1.NetworkServices.DeleteTlsRoute", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "NetworkServicesClient", + "fullName": "google.cloud.networkservices.v1.NetworkServicesClient" + }, + "method": { + "shortName": "DeleteTlsRoute", + "fullName": "google.cloud.networkservices.v1.NetworkServices.DeleteTlsRoute", + "service": { + "shortName": "NetworkServices", + "fullName": "google.cloud.networkservices.v1.NetworkServices" + } + } + } + }, + { + "regionTag": "networkservices_v1_generated_NetworkServices_ListServiceBindings_async", + "title": "NetworkServices listServiceBindings Sample", + "origin": "API_DEFINITION", + "description": " Lists ServiceBinding in a given project and location.", + "canonical": true, + "file": "network_services.list_service_bindings.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 66, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "ListServiceBindings", + "fullName": "google.cloud.networkservices.v1.NetworkServices.ListServiceBindings", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "page_size", + "type": "TYPE_INT32" + }, + { + "name": "page_token", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.networkservices.v1.ListServiceBindingsResponse", + "client": { + "shortName": "NetworkServicesClient", + "fullName": "google.cloud.networkservices.v1.NetworkServicesClient" + }, + "method": { + "shortName": "ListServiceBindings", + "fullName": "google.cloud.networkservices.v1.NetworkServices.ListServiceBindings", + "service": { + "shortName": "NetworkServices", + "fullName": "google.cloud.networkservices.v1.NetworkServices" + } + } + } + }, + { + "regionTag": "networkservices_v1_generated_NetworkServices_GetServiceBinding_async", + "title": "NetworkServices getServiceBinding Sample", + "origin": "API_DEFINITION", + "description": " Gets details of a single ServiceBinding.", + "canonical": true, + "file": "network_services.get_service_binding.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 54, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "GetServiceBinding", + "fullName": "google.cloud.networkservices.v1.NetworkServices.GetServiceBinding", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.networkservices.v1.ServiceBinding", + "client": { + "shortName": "NetworkServicesClient", + "fullName": "google.cloud.networkservices.v1.NetworkServicesClient" + }, + "method": { + "shortName": "GetServiceBinding", + "fullName": "google.cloud.networkservices.v1.NetworkServices.GetServiceBinding", + "service": { + "shortName": "NetworkServices", + "fullName": "google.cloud.networkservices.v1.NetworkServices" + } + } + } + }, + { + "regionTag": "networkservices_v1_generated_NetworkServices_CreateServiceBinding_async", + "title": "NetworkServices createServiceBinding Sample", + "origin": "API_DEFINITION", + "description": " Creates a new ServiceBinding in a given project and location.", + "canonical": true, + "file": "network_services.create_service_binding.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 65, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "CreateServiceBinding", + "fullName": "google.cloud.networkservices.v1.NetworkServices.CreateServiceBinding", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "service_binding_id", + "type": "TYPE_STRING" + }, + { + "name": "service_binding", + "type": ".google.cloud.networkservices.v1.ServiceBinding" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "NetworkServicesClient", + "fullName": "google.cloud.networkservices.v1.NetworkServicesClient" + }, + "method": { + "shortName": "CreateServiceBinding", + "fullName": "google.cloud.networkservices.v1.NetworkServices.CreateServiceBinding", + "service": { + "shortName": "NetworkServices", + "fullName": "google.cloud.networkservices.v1.NetworkServices" + } + } + } + }, + { + "regionTag": "networkservices_v1_generated_NetworkServices_DeleteServiceBinding_async", + "title": "NetworkServices deleteServiceBinding Sample", + "origin": "API_DEFINITION", + "description": " Deletes a single ServiceBinding.", + "canonical": true, + "file": "network_services.delete_service_binding.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 55, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "DeleteServiceBinding", + "fullName": "google.cloud.networkservices.v1.NetworkServices.DeleteServiceBinding", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "NetworkServicesClient", + "fullName": "google.cloud.networkservices.v1.NetworkServicesClient" + }, + "method": { + "shortName": "DeleteServiceBinding", + "fullName": "google.cloud.networkservices.v1.NetworkServices.DeleteServiceBinding", + "service": { + "shortName": "NetworkServices", + "fullName": "google.cloud.networkservices.v1.NetworkServices" + } + } + } + }, + { + "regionTag": "networkservices_v1_generated_NetworkServices_ListMeshes_async", + "title": "NetworkServices listMeshes Sample", + "origin": "API_DEFINITION", + "description": " Lists Meshes in a given project and location.", + "canonical": true, + "file": "network_services.list_meshes.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 66, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "ListMeshes", + "fullName": "google.cloud.networkservices.v1.NetworkServices.ListMeshes", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "page_size", + "type": "TYPE_INT32" + }, + { + "name": "page_token", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.networkservices.v1.ListMeshesResponse", + "client": { + "shortName": "NetworkServicesClient", + "fullName": "google.cloud.networkservices.v1.NetworkServicesClient" + }, + "method": { + "shortName": "ListMeshes", + "fullName": "google.cloud.networkservices.v1.NetworkServices.ListMeshes", + "service": { + "shortName": "NetworkServices", + "fullName": "google.cloud.networkservices.v1.NetworkServices" + } + } + } + }, + { + "regionTag": "networkservices_v1_generated_NetworkServices_GetMesh_async", + "title": "NetworkServices getMesh Sample", + "origin": "API_DEFINITION", + "description": " Gets details of a single Mesh.", + "canonical": true, + "file": "network_services.get_mesh.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 54, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "GetMesh", + "fullName": "google.cloud.networkservices.v1.NetworkServices.GetMesh", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.networkservices.v1.Mesh", + "client": { + "shortName": "NetworkServicesClient", + "fullName": "google.cloud.networkservices.v1.NetworkServicesClient" + }, + "method": { + "shortName": "GetMesh", + "fullName": "google.cloud.networkservices.v1.NetworkServices.GetMesh", + "service": { + "shortName": "NetworkServices", + "fullName": "google.cloud.networkservices.v1.NetworkServices" + } + } + } + }, + { + "regionTag": "networkservices_v1_generated_NetworkServices_CreateMesh_async", + "title": "NetworkServices createMesh Sample", + "origin": "API_DEFINITION", + "description": " Creates a new Mesh in a given project and location.", + "canonical": true, + "file": "network_services.create_mesh.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 65, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "CreateMesh", + "fullName": "google.cloud.networkservices.v1.NetworkServices.CreateMesh", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "mesh_id", + "type": "TYPE_STRING" + }, + { + "name": "mesh", + "type": ".google.cloud.networkservices.v1.Mesh" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "NetworkServicesClient", + "fullName": "google.cloud.networkservices.v1.NetworkServicesClient" + }, + "method": { + "shortName": "CreateMesh", + "fullName": "google.cloud.networkservices.v1.NetworkServices.CreateMesh", + "service": { + "shortName": "NetworkServices", + "fullName": "google.cloud.networkservices.v1.NetworkServices" + } + } + } + }, + { + "regionTag": "networkservices_v1_generated_NetworkServices_UpdateMesh_async", + "title": "NetworkServices updateMesh Sample", + "origin": "API_DEFINITION", + "description": " Updates the parameters of a single Mesh.", + "canonical": true, + "file": "network_services.update_mesh.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 62, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "UpdateMesh", + "fullName": "google.cloud.networkservices.v1.NetworkServices.UpdateMesh", + "async": true, + "parameters": [ + { + "name": "update_mask", + "type": ".google.protobuf.FieldMask" + }, + { + "name": "mesh", + "type": ".google.cloud.networkservices.v1.Mesh" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "NetworkServicesClient", + "fullName": "google.cloud.networkservices.v1.NetworkServicesClient" + }, + "method": { + "shortName": "UpdateMesh", + "fullName": "google.cloud.networkservices.v1.NetworkServices.UpdateMesh", + "service": { + "shortName": "NetworkServices", + "fullName": "google.cloud.networkservices.v1.NetworkServices" + } + } + } + }, + { + "regionTag": "networkservices_v1_generated_NetworkServices_DeleteMesh_async", + "title": "NetworkServices deleteMesh Sample", + "origin": "API_DEFINITION", + "description": " Deletes a single Mesh.", + "canonical": true, + "file": "network_services.delete_mesh.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 55, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "DeleteMesh", + "fullName": "google.cloud.networkservices.v1.NetworkServices.DeleteMesh", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "NetworkServicesClient", + "fullName": "google.cloud.networkservices.v1.NetworkServicesClient" + }, + "method": { + "shortName": "DeleteMesh", + "fullName": "google.cloud.networkservices.v1.NetworkServices.DeleteMesh", + "service": { + "shortName": "NetworkServices", + "fullName": "google.cloud.networkservices.v1.NetworkServices" + } + } + } + } + ] +} \ No newline at end of file diff --git a/packages/google-cloud-networkservices/samples/generated/v1beta1/network_services.create_endpoint_policy.js b/packages/google-cloud-networkservices/samples/generated/v1beta1/network_services.create_endpoint_policy.js new file mode 100644 index 00000000000..5a89b5cf629 --- /dev/null +++ b/packages/google-cloud-networkservices/samples/generated/v1beta1/network_services.create_endpoint_policy.js @@ -0,0 +1,74 @@ +// Copyright 2023 Google LLC +// +// Licensed under the Apache License, Version 2.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, endpointPolicyId, endpointPolicy) { + // [START networkservices_v1beta1_generated_NetworkServices_CreateEndpointPolicy_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 of the EndpointPolicy. Must be in the + * format `projects/* /locations/global`. + */ + // const parent = 'abc123' + /** + * Required. Short name of the EndpointPolicy resource to be created. + * E.g. "CustomECS". + */ + // const endpointPolicyId = 'abc123' + /** + * Required. EndpointPolicy resource to be created. + */ + // const endpointPolicy = {} + + // Imports the Networkservices library + const {NetworkServicesClient} = require('@google-cloud/networkservices').v1beta1; + + // Instantiates a client + const networkservicesClient = new NetworkServicesClient(); + + async function callCreateEndpointPolicy() { + // Construct request + const request = { + parent, + endpointPolicyId, + endpointPolicy, + }; + + // Run request + const [operation] = await networkservicesClient.createEndpointPolicy(request); + const [response] = await operation.promise(); + console.log(response); + } + + callCreateEndpointPolicy(); + // [END networkservices_v1beta1_generated_NetworkServices_CreateEndpointPolicy_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-networkservices/samples/generated/v1beta1/network_services.delete_endpoint_policy.js b/packages/google-cloud-networkservices/samples/generated/v1beta1/network_services.delete_endpoint_policy.js new file mode 100644 index 00000000000..ac3ad9991d5 --- /dev/null +++ b/packages/google-cloud-networkservices/samples/generated/v1beta1/network_services.delete_endpoint_policy.js @@ -0,0 +1,63 @@ +// Copyright 2023 Google LLC +// +// Licensed under the Apache License, Version 2.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 networkservices_v1beta1_generated_NetworkServices_DeleteEndpointPolicy_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. A name of the EndpointPolicy to delete. Must be in the format + * `projects/* /locations/global/endpointPolicies/*`. + */ + // const name = 'abc123' + + // Imports the Networkservices library + const {NetworkServicesClient} = require('@google-cloud/networkservices').v1beta1; + + // Instantiates a client + const networkservicesClient = new NetworkServicesClient(); + + async function callDeleteEndpointPolicy() { + // Construct request + const request = { + name, + }; + + // Run request + const [operation] = await networkservicesClient.deleteEndpointPolicy(request); + const [response] = await operation.promise(); + console.log(response); + } + + callDeleteEndpointPolicy(); + // [END networkservices_v1beta1_generated_NetworkServices_DeleteEndpointPolicy_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-networkservices/samples/generated/v1beta1/network_services.get_endpoint_policy.js b/packages/google-cloud-networkservices/samples/generated/v1beta1/network_services.get_endpoint_policy.js new file mode 100644 index 00000000000..ad93ce7a37a --- /dev/null +++ b/packages/google-cloud-networkservices/samples/generated/v1beta1/network_services.get_endpoint_policy.js @@ -0,0 +1,62 @@ +// Copyright 2023 Google LLC +// +// Licensed under the Apache License, Version 2.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 networkservices_v1beta1_generated_NetworkServices_GetEndpointPolicy_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. A name of the EndpointPolicy to get. Must be in the format + * `projects/* /locations/global/endpointPolicies/*`. + */ + // const name = 'abc123' + + // Imports the Networkservices library + const {NetworkServicesClient} = require('@google-cloud/networkservices').v1beta1; + + // Instantiates a client + const networkservicesClient = new NetworkServicesClient(); + + async function callGetEndpointPolicy() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await networkservicesClient.getEndpointPolicy(request); + console.log(response); + } + + callGetEndpointPolicy(); + // [END networkservices_v1beta1_generated_NetworkServices_GetEndpointPolicy_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-networkservices/samples/generated/v1beta1/network_services.list_endpoint_policies.js b/packages/google-cloud-networkservices/samples/generated/v1beta1/network_services.list_endpoint_policies.js new file mode 100644 index 00000000000..6ad462d6489 --- /dev/null +++ b/packages/google-cloud-networkservices/samples/generated/v1beta1/network_services.list_endpoint_policies.js @@ -0,0 +1,75 @@ +// Copyright 2023 Google LLC +// +// Licensed under the Apache License, Version 2.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 networkservices_v1beta1_generated_NetworkServices_ListEndpointPolicies_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 from which the EndpointPolicies should be + * listed, specified in the format `projects/* /locations/global`. + */ + // const parent = 'abc123' + /** + * Maximum number of EndpointPolicies to return per call. + */ + // const pageSize = 1234 + /** + * The value returned by the last `ListEndpointPoliciesResponse` + * Indicates that this is a continuation of a prior + * `ListEndpointPolicies` call, and that the system should return the + * next page of data. + */ + // const pageToken = 'abc123' + + // Imports the Networkservices library + const {NetworkServicesClient} = require('@google-cloud/networkservices').v1beta1; + + // Instantiates a client + const networkservicesClient = new NetworkServicesClient(); + + async function callListEndpointPolicies() { + // Construct request + const request = { + parent, + }; + + // Run request + const iterable = await networkservicesClient.listEndpointPoliciesAsync(request); + for await (const response of iterable) { + console.log(response); + } + } + + callListEndpointPolicies(); + // [END networkservices_v1beta1_generated_NetworkServices_ListEndpointPolicies_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-networkservices/samples/generated/v1beta1/network_services.update_endpoint_policy.js b/packages/google-cloud-networkservices/samples/generated/v1beta1/network_services.update_endpoint_policy.js new file mode 100644 index 00000000000..b7c1cfeb929 --- /dev/null +++ b/packages/google-cloud-networkservices/samples/generated/v1beta1/network_services.update_endpoint_policy.js @@ -0,0 +1,70 @@ +// Copyright 2023 Google LLC +// +// Licensed under the Apache License, Version 2.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(endpointPolicy) { + // [START networkservices_v1beta1_generated_NetworkServices_UpdateEndpointPolicy_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. + */ + /** + * Optional. Field mask is used to specify the fields to be overwritten in the + * EndpointPolicy resource by the update. + * The fields specified in the update_mask are relative to the resource, not + * the full request. A field will be overwritten if it is in the mask. If the + * user does not provide a mask then all fields will be overwritten. + */ + // const updateMask = {} + /** + * Required. Updated EndpointPolicy resource. + */ + // const endpointPolicy = {} + + // Imports the Networkservices library + const {NetworkServicesClient} = require('@google-cloud/networkservices').v1beta1; + + // Instantiates a client + const networkservicesClient = new NetworkServicesClient(); + + async function callUpdateEndpointPolicy() { + // Construct request + const request = { + endpointPolicy, + }; + + // Run request + const [operation] = await networkservicesClient.updateEndpointPolicy(request); + const [response] = await operation.promise(); + console.log(response); + } + + callUpdateEndpointPolicy(); + // [END networkservices_v1beta1_generated_NetworkServices_UpdateEndpointPolicy_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-networkservices/samples/generated/v1beta1/snippet_metadata_google.cloud.networkservices.v1beta1.json b/packages/google-cloud-networkservices/samples/generated/v1beta1/snippet_metadata_google.cloud.networkservices.v1beta1.json new file mode 100644 index 00000000000..56f26f7d7ba --- /dev/null +++ b/packages/google-cloud-networkservices/samples/generated/v1beta1/snippet_metadata_google.cloud.networkservices.v1beta1.json @@ -0,0 +1,235 @@ +{ + "clientLibrary": { + "name": "nodejs-networkservices", + "version": "0.1.0", + "language": "TYPESCRIPT", + "apis": [ + { + "id": "google.cloud.networkservices.v1beta1", + "version": "v1beta1" + } + ] + }, + "snippets": [ + { + "regionTag": "networkservices_v1beta1_generated_NetworkServices_ListEndpointPolicies_async", + "title": "NetworkServices listEndpointPolicies Sample", + "origin": "API_DEFINITION", + "description": " Lists EndpointPolicies in a given project and location.", + "canonical": true, + "file": "network_services.list_endpoint_policies.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 67, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "ListEndpointPolicies", + "fullName": "google.cloud.networkservices.v1beta1.NetworkServices.ListEndpointPolicies", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "page_size", + "type": "TYPE_INT32" + }, + { + "name": "page_token", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.networkservices.v1beta1.ListEndpointPoliciesResponse", + "client": { + "shortName": "NetworkServicesClient", + "fullName": "google.cloud.networkservices.v1beta1.NetworkServicesClient" + }, + "method": { + "shortName": "ListEndpointPolicies", + "fullName": "google.cloud.networkservices.v1beta1.NetworkServices.ListEndpointPolicies", + "service": { + "shortName": "NetworkServices", + "fullName": "google.cloud.networkservices.v1beta1.NetworkServices" + } + } + } + }, + { + "regionTag": "networkservices_v1beta1_generated_NetworkServices_GetEndpointPolicy_async", + "title": "NetworkServices getEndpointPolicy Sample", + "origin": "API_DEFINITION", + "description": " Gets details of a single EndpointPolicy.", + "canonical": true, + "file": "network_services.get_endpoint_policy.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 54, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "GetEndpointPolicy", + "fullName": "google.cloud.networkservices.v1beta1.NetworkServices.GetEndpointPolicy", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.networkservices.v1beta1.EndpointPolicy", + "client": { + "shortName": "NetworkServicesClient", + "fullName": "google.cloud.networkservices.v1beta1.NetworkServicesClient" + }, + "method": { + "shortName": "GetEndpointPolicy", + "fullName": "google.cloud.networkservices.v1beta1.NetworkServices.GetEndpointPolicy", + "service": { + "shortName": "NetworkServices", + "fullName": "google.cloud.networkservices.v1beta1.NetworkServices" + } + } + } + }, + { + "regionTag": "networkservices_v1beta1_generated_NetworkServices_CreateEndpointPolicy_async", + "title": "NetworkServices createEndpointPolicy Sample", + "origin": "API_DEFINITION", + "description": " Creates a new EndpointPolicy in a given project and location.", + "canonical": true, + "file": "network_services.create_endpoint_policy.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 66, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "CreateEndpointPolicy", + "fullName": "google.cloud.networkservices.v1beta1.NetworkServices.CreateEndpointPolicy", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "endpoint_policy_id", + "type": "TYPE_STRING" + }, + { + "name": "endpoint_policy", + "type": ".google.cloud.networkservices.v1beta1.EndpointPolicy" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "NetworkServicesClient", + "fullName": "google.cloud.networkservices.v1beta1.NetworkServicesClient" + }, + "method": { + "shortName": "CreateEndpointPolicy", + "fullName": "google.cloud.networkservices.v1beta1.NetworkServices.CreateEndpointPolicy", + "service": { + "shortName": "NetworkServices", + "fullName": "google.cloud.networkservices.v1beta1.NetworkServices" + } + } + } + }, + { + "regionTag": "networkservices_v1beta1_generated_NetworkServices_UpdateEndpointPolicy_async", + "title": "NetworkServices updateEndpointPolicy Sample", + "origin": "API_DEFINITION", + "description": " Updates the parameters of a single EndpointPolicy.", + "canonical": true, + "file": "network_services.update_endpoint_policy.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 62, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "UpdateEndpointPolicy", + "fullName": "google.cloud.networkservices.v1beta1.NetworkServices.UpdateEndpointPolicy", + "async": true, + "parameters": [ + { + "name": "update_mask", + "type": ".google.protobuf.FieldMask" + }, + { + "name": "endpoint_policy", + "type": ".google.cloud.networkservices.v1beta1.EndpointPolicy" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "NetworkServicesClient", + "fullName": "google.cloud.networkservices.v1beta1.NetworkServicesClient" + }, + "method": { + "shortName": "UpdateEndpointPolicy", + "fullName": "google.cloud.networkservices.v1beta1.NetworkServices.UpdateEndpointPolicy", + "service": { + "shortName": "NetworkServices", + "fullName": "google.cloud.networkservices.v1beta1.NetworkServices" + } + } + } + }, + { + "regionTag": "networkservices_v1beta1_generated_NetworkServices_DeleteEndpointPolicy_async", + "title": "NetworkServices deleteEndpointPolicy Sample", + "origin": "API_DEFINITION", + "description": " Deletes a single EndpointPolicy.", + "canonical": true, + "file": "network_services.delete_endpoint_policy.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 55, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "DeleteEndpointPolicy", + "fullName": "google.cloud.networkservices.v1beta1.NetworkServices.DeleteEndpointPolicy", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "NetworkServicesClient", + "fullName": "google.cloud.networkservices.v1beta1.NetworkServicesClient" + }, + "method": { + "shortName": "DeleteEndpointPolicy", + "fullName": "google.cloud.networkservices.v1beta1.NetworkServices.DeleteEndpointPolicy", + "service": { + "shortName": "NetworkServices", + "fullName": "google.cloud.networkservices.v1beta1.NetworkServices" + } + } + } + } + ] +} \ No newline at end of file diff --git a/packages/google-cloud-networkservices/samples/package.json b/packages/google-cloud-networkservices/samples/package.json new file mode 100644 index 00000000000..33357f436e3 --- /dev/null +++ b/packages/google-cloud-networkservices/samples/package.json @@ -0,0 +1,24 @@ +{ + "name": "networkservices-samples", + "private": true, + "license": "Apache-2.0", + "author": "Google LLC", + "engines": { + "node": ">=14.0.0" + }, + "files": [ + "*.js" + ], + "scripts": { + "test": "c8 mocha --timeout 600000 test/*.js", + "publish": "echo 'sample test; do not publish'" + }, + "dependencies": { + "@google-cloud/networkservices": "^0.1.0" + }, + "devDependencies": { + "c8": "^8.0.0", + "chai": "^4.2.0", + "mocha": "^8.0.0" + } +} diff --git a/packages/google-cloud-networkservices/samples/quickstart.js b/packages/google-cloud-networkservices/samples/quickstart.js new file mode 100644 index 00000000000..3a3f01992ed --- /dev/null +++ b/packages/google-cloud-networkservices/samples/quickstart.js @@ -0,0 +1,76 @@ +// Copyright 2023 Google LLC +// +// Licensed under the Apache License, Version 2.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 networkservices_quickstart] + /** + * 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 from which the EndpointPolicies should be + * listed, specified in the format `projects/* /locations/global`. + */ + // const parent = 'abc123' + /** + * Maximum number of EndpointPolicies to return per call. + */ + // const pageSize = 1234 + /** + * The value returned by the last `ListEndpointPoliciesResponse` + * Indicates that this is a continuation of a prior + * `ListEndpointPolicies` call, and that the system should return the + * next page of data. + */ + // const pageToken = 'abc123' + + // Imports the Networkservices library + const {NetworkServicesClient} = + require('@google-cloud/networkservices').v1beta1; + + // Instantiates a client + const networkservicesClient = new NetworkServicesClient(); + + async function callListEndpointPolicies() { + // Construct request + const request = { + parent, + }; + + // Run request + const iterable = await networkservicesClient.listEndpointPoliciesAsync( + request + ); + for await (const response of iterable) { + console.log(response); + } + } + + callListEndpointPolicies(); + // [END networkservices_quickstart] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-networkservices/samples/test/quickstart.js b/packages/google-cloud-networkservices/samples/test/quickstart.js new file mode 100644 index 00000000000..8e3d4b387b3 --- /dev/null +++ b/packages/google-cloud-networkservices/samples/test/quickstart.js @@ -0,0 +1,42 @@ +// Copyright 2023 Google LLC +// +// Licensed under the Apache License, Version 2.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. + +'use strict'; + +const assert = require('assert'); +const path = require('path'); +const cp = require('child_process'); +const {describe, it, before} = require('mocha'); +const {NetworkServicesClient} = require('@google-cloud/networkservices').v1; +const networkservicesClient = new NetworkServicesClient(); + +const execSync = cmd => cp.execSync(cmd, {encoding: 'utf-8'}); + +const cwd = path.join(__dirname, '..'); + +describe('Quickstart', () => { + let projectId; + + before(async () => { + projectId = await networkservicesClient.getProjectId(); + }); + + it('should run quickstart', async () => { + const output = execSync( + `node ./quickstart.js projects/${projectId}/locations/global`, + {cwd} + ); + assert(output !== null); + }); +}); diff --git a/packages/google-cloud-networkservices/src/index.ts b/packages/google-cloud-networkservices/src/index.ts new file mode 100644 index 00000000000..efc0224f013 --- /dev/null +++ b/packages/google-cloud-networkservices/src/index.ts @@ -0,0 +1,28 @@ +// Copyright 2023 Google LLC +// +// Licensed under the Apache License, Version 2.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. ** + +import * as v1 from './v1'; +import * as v1beta1 from './v1beta1'; + +const NetworkServicesClient = v1.NetworkServicesClient; +type NetworkServicesClient = v1.NetworkServicesClient; + +export {v1, v1beta1, NetworkServicesClient}; +export default {v1, v1beta1, NetworkServicesClient}; +import * as protos from '../protos/protos'; +export {protos}; diff --git a/packages/google-cloud-networkservices/src/v1/gapic_metadata.json b/packages/google-cloud-networkservices/src/v1/gapic_metadata.json new file mode 100644 index 00000000000..08366055051 --- /dev/null +++ b/packages/google-cloud-networkservices/src/v1/gapic_metadata.json @@ -0,0 +1,445 @@ +{ + "schema": "1.0", + "comment": "This file maps proto services/RPCs to the corresponding library clients/methods", + "language": "typescript", + "protoPackage": "google.cloud.networkservices.v1", + "libraryPackage": "@google-cloud/networkservices", + "services": { + "NetworkServices": { + "clients": { + "grpc": { + "libraryClient": "NetworkServicesClient", + "rpcs": { + "GetEndpointPolicy": { + "methods": [ + "getEndpointPolicy" + ] + }, + "GetGateway": { + "methods": [ + "getGateway" + ] + }, + "GetGrpcRoute": { + "methods": [ + "getGrpcRoute" + ] + }, + "GetHttpRoute": { + "methods": [ + "getHttpRoute" + ] + }, + "GetTcpRoute": { + "methods": [ + "getTcpRoute" + ] + }, + "GetTlsRoute": { + "methods": [ + "getTlsRoute" + ] + }, + "GetServiceBinding": { + "methods": [ + "getServiceBinding" + ] + }, + "GetMesh": { + "methods": [ + "getMesh" + ] + }, + "CreateEndpointPolicy": { + "methods": [ + "createEndpointPolicy" + ] + }, + "UpdateEndpointPolicy": { + "methods": [ + "updateEndpointPolicy" + ] + }, + "DeleteEndpointPolicy": { + "methods": [ + "deleteEndpointPolicy" + ] + }, + "CreateGateway": { + "methods": [ + "createGateway" + ] + }, + "UpdateGateway": { + "methods": [ + "updateGateway" + ] + }, + "DeleteGateway": { + "methods": [ + "deleteGateway" + ] + }, + "CreateGrpcRoute": { + "methods": [ + "createGrpcRoute" + ] + }, + "UpdateGrpcRoute": { + "methods": [ + "updateGrpcRoute" + ] + }, + "DeleteGrpcRoute": { + "methods": [ + "deleteGrpcRoute" + ] + }, + "CreateHttpRoute": { + "methods": [ + "createHttpRoute" + ] + }, + "UpdateHttpRoute": { + "methods": [ + "updateHttpRoute" + ] + }, + "DeleteHttpRoute": { + "methods": [ + "deleteHttpRoute" + ] + }, + "CreateTcpRoute": { + "methods": [ + "createTcpRoute" + ] + }, + "UpdateTcpRoute": { + "methods": [ + "updateTcpRoute" + ] + }, + "DeleteTcpRoute": { + "methods": [ + "deleteTcpRoute" + ] + }, + "CreateTlsRoute": { + "methods": [ + "createTlsRoute" + ] + }, + "UpdateTlsRoute": { + "methods": [ + "updateTlsRoute" + ] + }, + "DeleteTlsRoute": { + "methods": [ + "deleteTlsRoute" + ] + }, + "CreateServiceBinding": { + "methods": [ + "createServiceBinding" + ] + }, + "DeleteServiceBinding": { + "methods": [ + "deleteServiceBinding" + ] + }, + "CreateMesh": { + "methods": [ + "createMesh" + ] + }, + "UpdateMesh": { + "methods": [ + "updateMesh" + ] + }, + "DeleteMesh": { + "methods": [ + "deleteMesh" + ] + }, + "ListEndpointPolicies": { + "methods": [ + "listEndpointPolicies", + "listEndpointPoliciesStream", + "listEndpointPoliciesAsync" + ] + }, + "ListGateways": { + "methods": [ + "listGateways", + "listGatewaysStream", + "listGatewaysAsync" + ] + }, + "ListGrpcRoutes": { + "methods": [ + "listGrpcRoutes", + "listGrpcRoutesStream", + "listGrpcRoutesAsync" + ] + }, + "ListHttpRoutes": { + "methods": [ + "listHttpRoutes", + "listHttpRoutesStream", + "listHttpRoutesAsync" + ] + }, + "ListTcpRoutes": { + "methods": [ + "listTcpRoutes", + "listTcpRoutesStream", + "listTcpRoutesAsync" + ] + }, + "ListTlsRoutes": { + "methods": [ + "listTlsRoutes", + "listTlsRoutesStream", + "listTlsRoutesAsync" + ] + }, + "ListServiceBindings": { + "methods": [ + "listServiceBindings", + "listServiceBindingsStream", + "listServiceBindingsAsync" + ] + }, + "ListMeshes": { + "methods": [ + "listMeshes", + "listMeshesStream", + "listMeshesAsync" + ] + } + } + }, + "grpc-fallback": { + "libraryClient": "NetworkServicesClient", + "rpcs": { + "GetEndpointPolicy": { + "methods": [ + "getEndpointPolicy" + ] + }, + "GetGateway": { + "methods": [ + "getGateway" + ] + }, + "GetGrpcRoute": { + "methods": [ + "getGrpcRoute" + ] + }, + "GetHttpRoute": { + "methods": [ + "getHttpRoute" + ] + }, + "GetTcpRoute": { + "methods": [ + "getTcpRoute" + ] + }, + "GetTlsRoute": { + "methods": [ + "getTlsRoute" + ] + }, + "GetServiceBinding": { + "methods": [ + "getServiceBinding" + ] + }, + "GetMesh": { + "methods": [ + "getMesh" + ] + }, + "CreateEndpointPolicy": { + "methods": [ + "createEndpointPolicy" + ] + }, + "UpdateEndpointPolicy": { + "methods": [ + "updateEndpointPolicy" + ] + }, + "DeleteEndpointPolicy": { + "methods": [ + "deleteEndpointPolicy" + ] + }, + "CreateGateway": { + "methods": [ + "createGateway" + ] + }, + "UpdateGateway": { + "methods": [ + "updateGateway" + ] + }, + "DeleteGateway": { + "methods": [ + "deleteGateway" + ] + }, + "CreateGrpcRoute": { + "methods": [ + "createGrpcRoute" + ] + }, + "UpdateGrpcRoute": { + "methods": [ + "updateGrpcRoute" + ] + }, + "DeleteGrpcRoute": { + "methods": [ + "deleteGrpcRoute" + ] + }, + "CreateHttpRoute": { + "methods": [ + "createHttpRoute" + ] + }, + "UpdateHttpRoute": { + "methods": [ + "updateHttpRoute" + ] + }, + "DeleteHttpRoute": { + "methods": [ + "deleteHttpRoute" + ] + }, + "CreateTcpRoute": { + "methods": [ + "createTcpRoute" + ] + }, + "UpdateTcpRoute": { + "methods": [ + "updateTcpRoute" + ] + }, + "DeleteTcpRoute": { + "methods": [ + "deleteTcpRoute" + ] + }, + "CreateTlsRoute": { + "methods": [ + "createTlsRoute" + ] + }, + "UpdateTlsRoute": { + "methods": [ + "updateTlsRoute" + ] + }, + "DeleteTlsRoute": { + "methods": [ + "deleteTlsRoute" + ] + }, + "CreateServiceBinding": { + "methods": [ + "createServiceBinding" + ] + }, + "DeleteServiceBinding": { + "methods": [ + "deleteServiceBinding" + ] + }, + "CreateMesh": { + "methods": [ + "createMesh" + ] + }, + "UpdateMesh": { + "methods": [ + "updateMesh" + ] + }, + "DeleteMesh": { + "methods": [ + "deleteMesh" + ] + }, + "ListEndpointPolicies": { + "methods": [ + "listEndpointPolicies", + "listEndpointPoliciesStream", + "listEndpointPoliciesAsync" + ] + }, + "ListGateways": { + "methods": [ + "listGateways", + "listGatewaysStream", + "listGatewaysAsync" + ] + }, + "ListGrpcRoutes": { + "methods": [ + "listGrpcRoutes", + "listGrpcRoutesStream", + "listGrpcRoutesAsync" + ] + }, + "ListHttpRoutes": { + "methods": [ + "listHttpRoutes", + "listHttpRoutesStream", + "listHttpRoutesAsync" + ] + }, + "ListTcpRoutes": { + "methods": [ + "listTcpRoutes", + "listTcpRoutesStream", + "listTcpRoutesAsync" + ] + }, + "ListTlsRoutes": { + "methods": [ + "listTlsRoutes", + "listTlsRoutesStream", + "listTlsRoutesAsync" + ] + }, + "ListServiceBindings": { + "methods": [ + "listServiceBindings", + "listServiceBindingsStream", + "listServiceBindingsAsync" + ] + }, + "ListMeshes": { + "methods": [ + "listMeshes", + "listMeshesStream", + "listMeshesAsync" + ] + } + } + } + } + } + } +} diff --git a/packages/google-cloud-networkservices/src/v1/index.ts b/packages/google-cloud-networkservices/src/v1/index.ts new file mode 100644 index 00000000000..fe730d7e88e --- /dev/null +++ b/packages/google-cloud-networkservices/src/v1/index.ts @@ -0,0 +1,19 @@ +// Copyright 2023 Google LLC +// +// Licensed under the Apache License, Version 2.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 {NetworkServicesClient} from './network_services_client'; diff --git a/packages/google-cloud-networkservices/src/v1/network_services_client.ts b/packages/google-cloud-networkservices/src/v1/network_services_client.ts new file mode 100644 index 00000000000..da509b461ff --- /dev/null +++ b/packages/google-cloud-networkservices/src/v1/network_services_client.ts @@ -0,0 +1,7175 @@ +// Copyright 2023 Google LLC +// +// Licensed under the Apache License, Version 2.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, + IamClient, + IamProtos, + LocationsClient, + LocationProtos, +} from 'google-gax'; +import {Transform} from 'stream'; +import * as protos from '../../protos/protos'; +import jsonProtos = require('../../protos/protos.json'); +/** + * Client JSON configuration object, loaded from + * `src/v1/network_services_client_config.json`. + * This file defines retry strategy and timeouts for all API methods in this library. + */ +import * as gapicConfig from './network_services_client_config.json'; +const version = require('../../../package.json').version; + +/** + * @class + * @memberof v1 + */ +export class NetworkServicesClient { + 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}; + auth: gax.GoogleAuth; + descriptors: Descriptors = { + page: {}, + stream: {}, + longrunning: {}, + batching: {}, + }; + warn: (code: string, message: string, warnType?: string) => void; + innerApiCalls: {[name: string]: Function}; + iamClient: IamClient; + locationsClient: LocationsClient; + pathTemplates: {[name: string]: gax.PathTemplate}; + operationsClient: gax.OperationsClient; + networkServicesStub?: Promise<{[name: string]: Function}>; + + /** + * Construct an instance of NetworkServicesClient. + * + * @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://developers.google.com/identity/protocols/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 NetworkServicesClient({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 NetworkServicesClient; + const servicePath = + opts?.servicePath || opts?.apiEndpoint || staticMembers.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 !== staticMembers.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 = staticMembers.servicePath; + + // Set the default scopes in auth client if needed. + if (servicePath === staticMembers.servicePath) { + this.auth.defaultScopes = staticMembers.scopes; + } + this.iamClient = new this._gaxModule.IamClient(this._gaxGrpc, opts); + + 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 !== 'undefined' && '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 = { + endpointPolicyPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/endpointPolicies/{endpoint_policy}' + ), + gatewayPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/gateways/{gateway}' + ), + grpcRoutePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/grpcRoutes/{grpc_route}' + ), + httpRoutePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/httpRoutes/{http_route}' + ), + meshPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/meshes/{mesh}' + ), + serviceBindingPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/serviceBindings/{service_binding}' + ), + tcpRoutePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/tcpRoutes/{tcp_route}' + ), + tlsRoutePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/tlsRoutes/{tls_route}' + ), + }; + + // 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 = { + listEndpointPolicies: new this._gaxModule.PageDescriptor( + 'pageToken', + 'nextPageToken', + 'endpointPolicies' + ), + listGateways: new this._gaxModule.PageDescriptor( + 'pageToken', + 'nextPageToken', + 'gateways' + ), + listGrpcRoutes: new this._gaxModule.PageDescriptor( + 'pageToken', + 'nextPageToken', + 'grpcRoutes' + ), + listHttpRoutes: new this._gaxModule.PageDescriptor( + 'pageToken', + 'nextPageToken', + 'httpRoutes' + ), + listTcpRoutes: new this._gaxModule.PageDescriptor( + 'pageToken', + 'nextPageToken', + 'tcpRoutes' + ), + listTlsRoutes: new this._gaxModule.PageDescriptor( + 'pageToken', + 'nextPageToken', + 'tlsRoutes' + ), + listServiceBindings: new this._gaxModule.PageDescriptor( + 'pageToken', + 'nextPageToken', + 'serviceBindings' + ), + listMeshes: new this._gaxModule.PageDescriptor( + 'pageToken', + 'nextPageToken', + 'meshes' + ), + }; + + const protoFilesRoot = this._gaxModule.protobuf.Root.fromJSON(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: '/v1/{name=projects/*/locations/*}', + }, + { + selector: 'google.cloud.location.Locations.ListLocations', + get: '/v1/{name=projects/*}/locations', + }, + { + selector: 'google.iam.v1.IAMPolicy.GetIamPolicy', + get: '/v1/{resource=projects/*/locations/*/edgeCacheKeysets/*}:getIamPolicy', + additional_bindings: [ + { + get: '/v1/{resource=projects/*/locations/*/edgeCacheOrigins/*}:getIamPolicy', + }, + { + get: '/v1/{resource=projects/*/locations/*/edgeCacheServices/*}:getIamPolicy', + }, + { + get: '/v1/{resource=projects/*/locations/*/endpointPolicies/*}:getIamPolicy', + }, + { + get: '/v1/{resource=projects/*/locations/*/serviceBindings/*}:getIamPolicy', + }, + { + get: '/v1/{resource=projects/*/locations/*/meshes/*}:getIamPolicy', + }, + { + get: '/v1/{resource=projects/*/locations/*/gateways/*}:getIamPolicy', + }, + ], + }, + { + selector: 'google.iam.v1.IAMPolicy.SetIamPolicy', + post: '/v1/{resource=projects/*/locations/*/edgeCacheKeysets/*}:setIamPolicy', + body: '*', + additional_bindings: [ + { + post: '/v1/{resource=projects/*/locations/*/edgeCacheOrigins/*}:setIamPolicy', + body: '*', + }, + { + post: '/v1/{resource=projects/*/locations/*/edgeCacheServices/*}:setIamPolicy', + body: '*', + }, + { + post: '/v1/{resource=projects/*/locations/*/endpointPolicies/*}:setIamPolicy', + body: '*', + }, + { + post: '/v1/{resource=projects/*/locations/*/serviceBindings/*}:setIamPolicy', + body: '*', + }, + { + post: '/v1/{resource=projects/*/locations/*/meshes/*}:setIamPolicy', + body: '*', + }, + { + post: '/v1/{resource=projects/*/locations/*/gateways/*}:setIamPolicy', + body: '*', + }, + ], + }, + { + selector: 'google.iam.v1.IAMPolicy.TestIamPermissions', + post: '/v1/{resource=projects/*/locations/*/edgeCacheKeysets/*}:testIamPermissions', + body: '*', + additional_bindings: [ + { + post: '/v1/{resource=projects/*/locations/*/edgeCacheOrigins/*}:testIamPermissions', + body: '*', + }, + { + post: '/v1/{resource=projects/*/locations/*/edgeCacheServices/*}:testIamPermissions', + body: '*', + }, + { + post: '/v1/{resource=projects/*/locations/*/endpointPolicies/*}:testIamPermissions', + body: '*', + }, + { + post: '/v1/{resource=projects/*/locations/*/serviceBindings/*}:testIamPermissions', + body: '*', + }, + { + post: '/v1/{resource=projects/*/locations/*/meshes/*}:testIamPermissions', + body: '*', + }, + { + post: '/v1/{resource=projects/*/locations/*/gateways/*}:testIamPermissions', + body: '*', + }, + ], + }, + { + selector: 'google.longrunning.Operations.CancelOperation', + post: '/v1/{name=projects/*/locations/*/operations/*}:cancel', + body: '*', + }, + { + selector: 'google.longrunning.Operations.DeleteOperation', + delete: '/v1/{name=projects/*/locations/*/operations/*}', + }, + { + selector: 'google.longrunning.Operations.GetOperation', + get: '/v1/{name=projects/*/locations/*/operations/*}', + }, + { + selector: 'google.longrunning.Operations.ListOperations', + get: '/v1/{name=projects/*/locations/*}/operations', + }, + ]; + } + this.operationsClient = this._gaxModule + .lro(lroOptions) + .operationsClient(opts); + const createEndpointPolicyResponse = protoFilesRoot.lookup( + '.google.cloud.networkservices.v1.EndpointPolicy' + ) as gax.protobuf.Type; + const createEndpointPolicyMetadata = protoFilesRoot.lookup( + '.google.cloud.networkservices.v1.OperationMetadata' + ) as gax.protobuf.Type; + const updateEndpointPolicyResponse = protoFilesRoot.lookup( + '.google.cloud.networkservices.v1.EndpointPolicy' + ) as gax.protobuf.Type; + const updateEndpointPolicyMetadata = protoFilesRoot.lookup( + '.google.cloud.networkservices.v1.OperationMetadata' + ) as gax.protobuf.Type; + const deleteEndpointPolicyResponse = protoFilesRoot.lookup( + '.google.protobuf.Empty' + ) as gax.protobuf.Type; + const deleteEndpointPolicyMetadata = protoFilesRoot.lookup( + '.google.cloud.networkservices.v1.OperationMetadata' + ) as gax.protobuf.Type; + const createGatewayResponse = protoFilesRoot.lookup( + '.google.cloud.networkservices.v1.Gateway' + ) as gax.protobuf.Type; + const createGatewayMetadata = protoFilesRoot.lookup( + '.google.cloud.networkservices.v1.OperationMetadata' + ) as gax.protobuf.Type; + const updateGatewayResponse = protoFilesRoot.lookup( + '.google.cloud.networkservices.v1.Gateway' + ) as gax.protobuf.Type; + const updateGatewayMetadata = protoFilesRoot.lookup( + '.google.cloud.networkservices.v1.OperationMetadata' + ) as gax.protobuf.Type; + const deleteGatewayResponse = protoFilesRoot.lookup( + '.google.protobuf.Empty' + ) as gax.protobuf.Type; + const deleteGatewayMetadata = protoFilesRoot.lookup( + '.google.cloud.networkservices.v1.OperationMetadata' + ) as gax.protobuf.Type; + const createGrpcRouteResponse = protoFilesRoot.lookup( + '.google.cloud.networkservices.v1.GrpcRoute' + ) as gax.protobuf.Type; + const createGrpcRouteMetadata = protoFilesRoot.lookup( + '.google.cloud.networkservices.v1.OperationMetadata' + ) as gax.protobuf.Type; + const updateGrpcRouteResponse = protoFilesRoot.lookup( + '.google.cloud.networkservices.v1.GrpcRoute' + ) as gax.protobuf.Type; + const updateGrpcRouteMetadata = protoFilesRoot.lookup( + '.google.cloud.networkservices.v1.OperationMetadata' + ) as gax.protobuf.Type; + const deleteGrpcRouteResponse = protoFilesRoot.lookup( + '.google.protobuf.Empty' + ) as gax.protobuf.Type; + const deleteGrpcRouteMetadata = protoFilesRoot.lookup( + '.google.cloud.networkservices.v1.OperationMetadata' + ) as gax.protobuf.Type; + const createHttpRouteResponse = protoFilesRoot.lookup( + '.google.cloud.networkservices.v1.HttpRoute' + ) as gax.protobuf.Type; + const createHttpRouteMetadata = protoFilesRoot.lookup( + '.google.cloud.networkservices.v1.OperationMetadata' + ) as gax.protobuf.Type; + const updateHttpRouteResponse = protoFilesRoot.lookup( + '.google.cloud.networkservices.v1.HttpRoute' + ) as gax.protobuf.Type; + const updateHttpRouteMetadata = protoFilesRoot.lookup( + '.google.cloud.networkservices.v1.OperationMetadata' + ) as gax.protobuf.Type; + const deleteHttpRouteResponse = protoFilesRoot.lookup( + '.google.protobuf.Empty' + ) as gax.protobuf.Type; + const deleteHttpRouteMetadata = protoFilesRoot.lookup( + '.google.cloud.networkservices.v1.OperationMetadata' + ) as gax.protobuf.Type; + const createTcpRouteResponse = protoFilesRoot.lookup( + '.google.cloud.networkservices.v1.TcpRoute' + ) as gax.protobuf.Type; + const createTcpRouteMetadata = protoFilesRoot.lookup( + '.google.cloud.networkservices.v1.OperationMetadata' + ) as gax.protobuf.Type; + const updateTcpRouteResponse = protoFilesRoot.lookup( + '.google.cloud.networkservices.v1.TcpRoute' + ) as gax.protobuf.Type; + const updateTcpRouteMetadata = protoFilesRoot.lookup( + '.google.cloud.networkservices.v1.OperationMetadata' + ) as gax.protobuf.Type; + const deleteTcpRouteResponse = protoFilesRoot.lookup( + '.google.protobuf.Empty' + ) as gax.protobuf.Type; + const deleteTcpRouteMetadata = protoFilesRoot.lookup( + '.google.cloud.networkservices.v1.OperationMetadata' + ) as gax.protobuf.Type; + const createTlsRouteResponse = protoFilesRoot.lookup( + '.google.cloud.networkservices.v1.TlsRoute' + ) as gax.protobuf.Type; + const createTlsRouteMetadata = protoFilesRoot.lookup( + '.google.cloud.networkservices.v1.OperationMetadata' + ) as gax.protobuf.Type; + const updateTlsRouteResponse = protoFilesRoot.lookup( + '.google.cloud.networkservices.v1.TlsRoute' + ) as gax.protobuf.Type; + const updateTlsRouteMetadata = protoFilesRoot.lookup( + '.google.cloud.networkservices.v1.OperationMetadata' + ) as gax.protobuf.Type; + const deleteTlsRouteResponse = protoFilesRoot.lookup( + '.google.protobuf.Empty' + ) as gax.protobuf.Type; + const deleteTlsRouteMetadata = protoFilesRoot.lookup( + '.google.cloud.networkservices.v1.OperationMetadata' + ) as gax.protobuf.Type; + const createServiceBindingResponse = protoFilesRoot.lookup( + '.google.cloud.networkservices.v1.ServiceBinding' + ) as gax.protobuf.Type; + const createServiceBindingMetadata = protoFilesRoot.lookup( + '.google.cloud.networkservices.v1.OperationMetadata' + ) as gax.protobuf.Type; + const deleteServiceBindingResponse = protoFilesRoot.lookup( + '.google.protobuf.Empty' + ) as gax.protobuf.Type; + const deleteServiceBindingMetadata = protoFilesRoot.lookup( + '.google.cloud.networkservices.v1.OperationMetadata' + ) as gax.protobuf.Type; + const createMeshResponse = protoFilesRoot.lookup( + '.google.cloud.networkservices.v1.Mesh' + ) as gax.protobuf.Type; + const createMeshMetadata = protoFilesRoot.lookup( + '.google.cloud.networkservices.v1.OperationMetadata' + ) as gax.protobuf.Type; + const updateMeshResponse = protoFilesRoot.lookup( + '.google.cloud.networkservices.v1.Mesh' + ) as gax.protobuf.Type; + const updateMeshMetadata = protoFilesRoot.lookup( + '.google.cloud.networkservices.v1.OperationMetadata' + ) as gax.protobuf.Type; + const deleteMeshResponse = protoFilesRoot.lookup( + '.google.protobuf.Empty' + ) as gax.protobuf.Type; + const deleteMeshMetadata = protoFilesRoot.lookup( + '.google.cloud.networkservices.v1.OperationMetadata' + ) as gax.protobuf.Type; + + this.descriptors.longrunning = { + createEndpointPolicy: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + createEndpointPolicyResponse.decode.bind(createEndpointPolicyResponse), + createEndpointPolicyMetadata.decode.bind(createEndpointPolicyMetadata) + ), + updateEndpointPolicy: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + updateEndpointPolicyResponse.decode.bind(updateEndpointPolicyResponse), + updateEndpointPolicyMetadata.decode.bind(updateEndpointPolicyMetadata) + ), + deleteEndpointPolicy: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + deleteEndpointPolicyResponse.decode.bind(deleteEndpointPolicyResponse), + deleteEndpointPolicyMetadata.decode.bind(deleteEndpointPolicyMetadata) + ), + createGateway: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + createGatewayResponse.decode.bind(createGatewayResponse), + createGatewayMetadata.decode.bind(createGatewayMetadata) + ), + updateGateway: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + updateGatewayResponse.decode.bind(updateGatewayResponse), + updateGatewayMetadata.decode.bind(updateGatewayMetadata) + ), + deleteGateway: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + deleteGatewayResponse.decode.bind(deleteGatewayResponse), + deleteGatewayMetadata.decode.bind(deleteGatewayMetadata) + ), + createGrpcRoute: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + createGrpcRouteResponse.decode.bind(createGrpcRouteResponse), + createGrpcRouteMetadata.decode.bind(createGrpcRouteMetadata) + ), + updateGrpcRoute: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + updateGrpcRouteResponse.decode.bind(updateGrpcRouteResponse), + updateGrpcRouteMetadata.decode.bind(updateGrpcRouteMetadata) + ), + deleteGrpcRoute: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + deleteGrpcRouteResponse.decode.bind(deleteGrpcRouteResponse), + deleteGrpcRouteMetadata.decode.bind(deleteGrpcRouteMetadata) + ), + createHttpRoute: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + createHttpRouteResponse.decode.bind(createHttpRouteResponse), + createHttpRouteMetadata.decode.bind(createHttpRouteMetadata) + ), + updateHttpRoute: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + updateHttpRouteResponse.decode.bind(updateHttpRouteResponse), + updateHttpRouteMetadata.decode.bind(updateHttpRouteMetadata) + ), + deleteHttpRoute: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + deleteHttpRouteResponse.decode.bind(deleteHttpRouteResponse), + deleteHttpRouteMetadata.decode.bind(deleteHttpRouteMetadata) + ), + createTcpRoute: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + createTcpRouteResponse.decode.bind(createTcpRouteResponse), + createTcpRouteMetadata.decode.bind(createTcpRouteMetadata) + ), + updateTcpRoute: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + updateTcpRouteResponse.decode.bind(updateTcpRouteResponse), + updateTcpRouteMetadata.decode.bind(updateTcpRouteMetadata) + ), + deleteTcpRoute: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + deleteTcpRouteResponse.decode.bind(deleteTcpRouteResponse), + deleteTcpRouteMetadata.decode.bind(deleteTcpRouteMetadata) + ), + createTlsRoute: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + createTlsRouteResponse.decode.bind(createTlsRouteResponse), + createTlsRouteMetadata.decode.bind(createTlsRouteMetadata) + ), + updateTlsRoute: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + updateTlsRouteResponse.decode.bind(updateTlsRouteResponse), + updateTlsRouteMetadata.decode.bind(updateTlsRouteMetadata) + ), + deleteTlsRoute: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + deleteTlsRouteResponse.decode.bind(deleteTlsRouteResponse), + deleteTlsRouteMetadata.decode.bind(deleteTlsRouteMetadata) + ), + createServiceBinding: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + createServiceBindingResponse.decode.bind(createServiceBindingResponse), + createServiceBindingMetadata.decode.bind(createServiceBindingMetadata) + ), + deleteServiceBinding: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + deleteServiceBindingResponse.decode.bind(deleteServiceBindingResponse), + deleteServiceBindingMetadata.decode.bind(deleteServiceBindingMetadata) + ), + createMesh: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + createMeshResponse.decode.bind(createMeshResponse), + createMeshMetadata.decode.bind(createMeshMetadata) + ), + updateMesh: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + updateMeshResponse.decode.bind(updateMeshResponse), + updateMeshMetadata.decode.bind(updateMeshMetadata) + ), + deleteMesh: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + deleteMeshResponse.decode.bind(deleteMeshResponse), + deleteMeshMetadata.decode.bind(deleteMeshMetadata) + ), + }; + + // Put together the default options sent with requests. + this._defaults = this._gaxGrpc.constructSettings( + 'google.cloud.networkservices.v1.NetworkServices', + 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.networkServicesStub) { + return this.networkServicesStub; + } + + // Put together the "service stub" for + // google.cloud.networkservices.v1.NetworkServices. + this.networkServicesStub = this._gaxGrpc.createStub( + this._opts.fallback + ? (this._protos as protobuf.Root).lookupService( + 'google.cloud.networkservices.v1.NetworkServices' + ) + : // eslint-disable-next-line @typescript-eslint/no-explicit-any + (this._protos as any).google.cloud.networkservices.v1.NetworkServices, + 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 networkServicesStubMethods = [ + 'listEndpointPolicies', + 'getEndpointPolicy', + 'createEndpointPolicy', + 'updateEndpointPolicy', + 'deleteEndpointPolicy', + 'listGateways', + 'getGateway', + 'createGateway', + 'updateGateway', + 'deleteGateway', + 'listGrpcRoutes', + 'getGrpcRoute', + 'createGrpcRoute', + 'updateGrpcRoute', + 'deleteGrpcRoute', + 'listHttpRoutes', + 'getHttpRoute', + 'createHttpRoute', + 'updateHttpRoute', + 'deleteHttpRoute', + 'listTcpRoutes', + 'getTcpRoute', + 'createTcpRoute', + 'updateTcpRoute', + 'deleteTcpRoute', + 'listTlsRoutes', + 'getTlsRoute', + 'createTlsRoute', + 'updateTlsRoute', + 'deleteTlsRoute', + 'listServiceBindings', + 'getServiceBinding', + 'createServiceBinding', + 'deleteServiceBinding', + 'listMeshes', + 'getMesh', + 'createMesh', + 'updateMesh', + 'deleteMesh', + ]; + for (const methodName of networkServicesStubMethods) { + const callPromise = this.networkServicesStub.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] || + this.descriptors.longrunning[methodName] || + undefined; + const apiCall = this._gaxModule.createApiCall( + callPromise, + this._defaults[methodName], + descriptor, + this._opts.fallback + ); + + this.innerApiCalls[methodName] = apiCall; + } + + return this.networkServicesStub; + } + + /** + * The DNS address for this API service. + * @returns {string} The DNS address for this service. + */ + static get servicePath() { + return 'networkservices.googleapis.com'; + } + + /** + * The DNS address for this API service - same as servicePath(), + * exists for compatibility reasons. + * @returns {string} The DNS address for this service. + */ + static get apiEndpoint() { + return 'networkservices.googleapis.com'; + } + + /** + * 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 -- + // ------------------- + /** + * Gets details of a single EndpointPolicy. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. A name of the EndpointPolicy to get. Must be in the format + * `projects/* /locations/global/endpointPolicies/*`. + * @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.networkservices.v1.EndpointPolicy|EndpointPolicy}. + * 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/network_services.get_endpoint_policy.js + * region_tag:networkservices_v1_generated_NetworkServices_GetEndpointPolicy_async + */ + getEndpointPolicy( + request?: protos.google.cloud.networkservices.v1.IGetEndpointPolicyRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.networkservices.v1.IEndpointPolicy, + ( + | protos.google.cloud.networkservices.v1.IGetEndpointPolicyRequest + | undefined + ), + {} | undefined, + ] + >; + getEndpointPolicy( + request: protos.google.cloud.networkservices.v1.IGetEndpointPolicyRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.networkservices.v1.IEndpointPolicy, + | protos.google.cloud.networkservices.v1.IGetEndpointPolicyRequest + | null + | undefined, + {} | null | undefined + > + ): void; + getEndpointPolicy( + request: protos.google.cloud.networkservices.v1.IGetEndpointPolicyRequest, + callback: Callback< + protos.google.cloud.networkservices.v1.IEndpointPolicy, + | protos.google.cloud.networkservices.v1.IGetEndpointPolicyRequest + | null + | undefined, + {} | null | undefined + > + ): void; + getEndpointPolicy( + request?: protos.google.cloud.networkservices.v1.IGetEndpointPolicyRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.networkservices.v1.IEndpointPolicy, + | protos.google.cloud.networkservices.v1.IGetEndpointPolicyRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.networkservices.v1.IEndpointPolicy, + | protos.google.cloud.networkservices.v1.IGetEndpointPolicyRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.networkservices.v1.IEndpointPolicy, + ( + | protos.google.cloud.networkservices.v1.IGetEndpointPolicyRequest + | 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(); + return this.innerApiCalls.getEndpointPolicy(request, options, callback); + } + /** + * Gets details of a single Gateway. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. A name of the Gateway to get. Must be in the format + * `projects/* /locations/* /gateways/*`. + * @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.networkservices.v1.Gateway|Gateway}. + * 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/network_services.get_gateway.js + * region_tag:networkservices_v1_generated_NetworkServices_GetGateway_async + */ + getGateway( + request?: protos.google.cloud.networkservices.v1.IGetGatewayRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.networkservices.v1.IGateway, + protos.google.cloud.networkservices.v1.IGetGatewayRequest | undefined, + {} | undefined, + ] + >; + getGateway( + request: protos.google.cloud.networkservices.v1.IGetGatewayRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.networkservices.v1.IGateway, + | protos.google.cloud.networkservices.v1.IGetGatewayRequest + | null + | undefined, + {} | null | undefined + > + ): void; + getGateway( + request: protos.google.cloud.networkservices.v1.IGetGatewayRequest, + callback: Callback< + protos.google.cloud.networkservices.v1.IGateway, + | protos.google.cloud.networkservices.v1.IGetGatewayRequest + | null + | undefined, + {} | null | undefined + > + ): void; + getGateway( + request?: protos.google.cloud.networkservices.v1.IGetGatewayRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.networkservices.v1.IGateway, + | protos.google.cloud.networkservices.v1.IGetGatewayRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.networkservices.v1.IGateway, + | protos.google.cloud.networkservices.v1.IGetGatewayRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.networkservices.v1.IGateway, + protos.google.cloud.networkservices.v1.IGetGatewayRequest | 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(); + return this.innerApiCalls.getGateway(request, options, callback); + } + /** + * Gets details of a single GrpcRoute. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. A name of the GrpcRoute to get. Must be in the format + * `projects/* /locations/global/grpcRoutes/*`. + * @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.networkservices.v1.GrpcRoute|GrpcRoute}. + * 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/network_services.get_grpc_route.js + * region_tag:networkservices_v1_generated_NetworkServices_GetGrpcRoute_async + */ + getGrpcRoute( + request?: protos.google.cloud.networkservices.v1.IGetGrpcRouteRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.networkservices.v1.IGrpcRoute, + protos.google.cloud.networkservices.v1.IGetGrpcRouteRequest | undefined, + {} | undefined, + ] + >; + getGrpcRoute( + request: protos.google.cloud.networkservices.v1.IGetGrpcRouteRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.networkservices.v1.IGrpcRoute, + | protos.google.cloud.networkservices.v1.IGetGrpcRouteRequest + | null + | undefined, + {} | null | undefined + > + ): void; + getGrpcRoute( + request: protos.google.cloud.networkservices.v1.IGetGrpcRouteRequest, + callback: Callback< + protos.google.cloud.networkservices.v1.IGrpcRoute, + | protos.google.cloud.networkservices.v1.IGetGrpcRouteRequest + | null + | undefined, + {} | null | undefined + > + ): void; + getGrpcRoute( + request?: protos.google.cloud.networkservices.v1.IGetGrpcRouteRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.networkservices.v1.IGrpcRoute, + | protos.google.cloud.networkservices.v1.IGetGrpcRouteRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.networkservices.v1.IGrpcRoute, + | protos.google.cloud.networkservices.v1.IGetGrpcRouteRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.networkservices.v1.IGrpcRoute, + protos.google.cloud.networkservices.v1.IGetGrpcRouteRequest | 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(); + return this.innerApiCalls.getGrpcRoute(request, options, callback); + } + /** + * Gets details of a single HttpRoute. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. A name of the HttpRoute to get. Must be in the format + * `projects/* /locations/global/httpRoutes/*`. + * @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.networkservices.v1.HttpRoute|HttpRoute}. + * 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/network_services.get_http_route.js + * region_tag:networkservices_v1_generated_NetworkServices_GetHttpRoute_async + */ + getHttpRoute( + request?: protos.google.cloud.networkservices.v1.IGetHttpRouteRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.networkservices.v1.IHttpRoute, + protos.google.cloud.networkservices.v1.IGetHttpRouteRequest | undefined, + {} | undefined, + ] + >; + getHttpRoute( + request: protos.google.cloud.networkservices.v1.IGetHttpRouteRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.networkservices.v1.IHttpRoute, + | protos.google.cloud.networkservices.v1.IGetHttpRouteRequest + | null + | undefined, + {} | null | undefined + > + ): void; + getHttpRoute( + request: protos.google.cloud.networkservices.v1.IGetHttpRouteRequest, + callback: Callback< + protos.google.cloud.networkservices.v1.IHttpRoute, + | protos.google.cloud.networkservices.v1.IGetHttpRouteRequest + | null + | undefined, + {} | null | undefined + > + ): void; + getHttpRoute( + request?: protos.google.cloud.networkservices.v1.IGetHttpRouteRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.networkservices.v1.IHttpRoute, + | protos.google.cloud.networkservices.v1.IGetHttpRouteRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.networkservices.v1.IHttpRoute, + | protos.google.cloud.networkservices.v1.IGetHttpRouteRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.networkservices.v1.IHttpRoute, + protos.google.cloud.networkservices.v1.IGetHttpRouteRequest | 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(); + return this.innerApiCalls.getHttpRoute(request, options, callback); + } + /** + * Gets details of a single TcpRoute. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. A name of the TcpRoute to get. Must be in the format + * `projects/* /locations/global/tcpRoutes/*`. + * @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.networkservices.v1.TcpRoute|TcpRoute}. + * 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/network_services.get_tcp_route.js + * region_tag:networkservices_v1_generated_NetworkServices_GetTcpRoute_async + */ + getTcpRoute( + request?: protos.google.cloud.networkservices.v1.IGetTcpRouteRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.networkservices.v1.ITcpRoute, + protos.google.cloud.networkservices.v1.IGetTcpRouteRequest | undefined, + {} | undefined, + ] + >; + getTcpRoute( + request: protos.google.cloud.networkservices.v1.IGetTcpRouteRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.networkservices.v1.ITcpRoute, + | protos.google.cloud.networkservices.v1.IGetTcpRouteRequest + | null + | undefined, + {} | null | undefined + > + ): void; + getTcpRoute( + request: protos.google.cloud.networkservices.v1.IGetTcpRouteRequest, + callback: Callback< + protos.google.cloud.networkservices.v1.ITcpRoute, + | protos.google.cloud.networkservices.v1.IGetTcpRouteRequest + | null + | undefined, + {} | null | undefined + > + ): void; + getTcpRoute( + request?: protos.google.cloud.networkservices.v1.IGetTcpRouteRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.networkservices.v1.ITcpRoute, + | protos.google.cloud.networkservices.v1.IGetTcpRouteRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.networkservices.v1.ITcpRoute, + | protos.google.cloud.networkservices.v1.IGetTcpRouteRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.networkservices.v1.ITcpRoute, + protos.google.cloud.networkservices.v1.IGetTcpRouteRequest | 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(); + return this.innerApiCalls.getTcpRoute(request, options, callback); + } + /** + * Gets details of a single TlsRoute. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. A name of the TlsRoute to get. Must be in the format + * `projects/* /locations/global/tlsRoutes/*`. + * @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.networkservices.v1.TlsRoute|TlsRoute}. + * 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/network_services.get_tls_route.js + * region_tag:networkservices_v1_generated_NetworkServices_GetTlsRoute_async + */ + getTlsRoute( + request?: protos.google.cloud.networkservices.v1.IGetTlsRouteRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.networkservices.v1.ITlsRoute, + protos.google.cloud.networkservices.v1.IGetTlsRouteRequest | undefined, + {} | undefined, + ] + >; + getTlsRoute( + request: protos.google.cloud.networkservices.v1.IGetTlsRouteRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.networkservices.v1.ITlsRoute, + | protos.google.cloud.networkservices.v1.IGetTlsRouteRequest + | null + | undefined, + {} | null | undefined + > + ): void; + getTlsRoute( + request: protos.google.cloud.networkservices.v1.IGetTlsRouteRequest, + callback: Callback< + protos.google.cloud.networkservices.v1.ITlsRoute, + | protos.google.cloud.networkservices.v1.IGetTlsRouteRequest + | null + | undefined, + {} | null | undefined + > + ): void; + getTlsRoute( + request?: protos.google.cloud.networkservices.v1.IGetTlsRouteRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.networkservices.v1.ITlsRoute, + | protos.google.cloud.networkservices.v1.IGetTlsRouteRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.networkservices.v1.ITlsRoute, + | protos.google.cloud.networkservices.v1.IGetTlsRouteRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.networkservices.v1.ITlsRoute, + protos.google.cloud.networkservices.v1.IGetTlsRouteRequest | 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(); + return this.innerApiCalls.getTlsRoute(request, options, callback); + } + /** + * Gets details of a single ServiceBinding. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. A name of the ServiceBinding to get. Must be in the format + * `projects/* /locations/global/serviceBindings/*`. + * @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.networkservices.v1.ServiceBinding|ServiceBinding}. + * 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/network_services.get_service_binding.js + * region_tag:networkservices_v1_generated_NetworkServices_GetServiceBinding_async + */ + getServiceBinding( + request?: protos.google.cloud.networkservices.v1.IGetServiceBindingRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.networkservices.v1.IServiceBinding, + ( + | protos.google.cloud.networkservices.v1.IGetServiceBindingRequest + | undefined + ), + {} | undefined, + ] + >; + getServiceBinding( + request: protos.google.cloud.networkservices.v1.IGetServiceBindingRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.networkservices.v1.IServiceBinding, + | protos.google.cloud.networkservices.v1.IGetServiceBindingRequest + | null + | undefined, + {} | null | undefined + > + ): void; + getServiceBinding( + request: protos.google.cloud.networkservices.v1.IGetServiceBindingRequest, + callback: Callback< + protos.google.cloud.networkservices.v1.IServiceBinding, + | protos.google.cloud.networkservices.v1.IGetServiceBindingRequest + | null + | undefined, + {} | null | undefined + > + ): void; + getServiceBinding( + request?: protos.google.cloud.networkservices.v1.IGetServiceBindingRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.networkservices.v1.IServiceBinding, + | protos.google.cloud.networkservices.v1.IGetServiceBindingRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.networkservices.v1.IServiceBinding, + | protos.google.cloud.networkservices.v1.IGetServiceBindingRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.networkservices.v1.IServiceBinding, + ( + | protos.google.cloud.networkservices.v1.IGetServiceBindingRequest + | 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(); + return this.innerApiCalls.getServiceBinding(request, options, callback); + } + /** + * Gets details of a single Mesh. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. A name of the Mesh to get. Must be in the format + * `projects/* /locations/global/meshes/*`. + * @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.networkservices.v1.Mesh|Mesh}. + * 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/network_services.get_mesh.js + * region_tag:networkservices_v1_generated_NetworkServices_GetMesh_async + */ + getMesh( + request?: protos.google.cloud.networkservices.v1.IGetMeshRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.networkservices.v1.IMesh, + protos.google.cloud.networkservices.v1.IGetMeshRequest | undefined, + {} | undefined, + ] + >; + getMesh( + request: protos.google.cloud.networkservices.v1.IGetMeshRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.networkservices.v1.IMesh, + protos.google.cloud.networkservices.v1.IGetMeshRequest | null | undefined, + {} | null | undefined + > + ): void; + getMesh( + request: protos.google.cloud.networkservices.v1.IGetMeshRequest, + callback: Callback< + protos.google.cloud.networkservices.v1.IMesh, + protos.google.cloud.networkservices.v1.IGetMeshRequest | null | undefined, + {} | null | undefined + > + ): void; + getMesh( + request?: protos.google.cloud.networkservices.v1.IGetMeshRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.networkservices.v1.IMesh, + | protos.google.cloud.networkservices.v1.IGetMeshRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.networkservices.v1.IMesh, + protos.google.cloud.networkservices.v1.IGetMeshRequest | null | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.networkservices.v1.IMesh, + protos.google.cloud.networkservices.v1.IGetMeshRequest | 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(); + return this.innerApiCalls.getMesh(request, options, callback); + } + + /** + * Creates a new EndpointPolicy in a given project and location. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The parent resource of the EndpointPolicy. Must be in the + * format `projects/* /locations/global`. + * @param {string} request.endpointPolicyId + * Required. Short name of the EndpointPolicy resource to be created. + * E.g. "CustomECS". + * @param {google.cloud.networkservices.v1.EndpointPolicy} request.endpointPolicy + * Required. EndpointPolicy resource to be created. + * @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/network_services.create_endpoint_policy.js + * region_tag:networkservices_v1_generated_NetworkServices_CreateEndpointPolicy_async + */ + createEndpointPolicy( + request?: protos.google.cloud.networkservices.v1.ICreateEndpointPolicyRequest, + options?: CallOptions + ): Promise< + [ + LROperation< + protos.google.cloud.networkservices.v1.IEndpointPolicy, + protos.google.cloud.networkservices.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined, + ] + >; + createEndpointPolicy( + request: protos.google.cloud.networkservices.v1.ICreateEndpointPolicyRequest, + options: CallOptions, + callback: Callback< + LROperation< + protos.google.cloud.networkservices.v1.IEndpointPolicy, + protos.google.cloud.networkservices.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + createEndpointPolicy( + request: protos.google.cloud.networkservices.v1.ICreateEndpointPolicyRequest, + callback: Callback< + LROperation< + protos.google.cloud.networkservices.v1.IEndpointPolicy, + protos.google.cloud.networkservices.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + createEndpointPolicy( + request?: protos.google.cloud.networkservices.v1.ICreateEndpointPolicyRequest, + optionsOrCallback?: + | CallOptions + | Callback< + LROperation< + protos.google.cloud.networkservices.v1.IEndpointPolicy, + protos.google.cloud.networkservices.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + callback?: Callback< + LROperation< + protos.google.cloud.networkservices.v1.IEndpointPolicy, + protos.google.cloud.networkservices.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): Promise< + [ + LROperation< + protos.google.cloud.networkservices.v1.IEndpointPolicy, + protos.google.cloud.networkservices.v1.IOperationMetadata + >, + 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(); + return this.innerApiCalls.createEndpointPolicy(request, options, callback); + } + /** + * Check the status of the long running operation returned by `createEndpointPolicy()`. + * @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/network_services.create_endpoint_policy.js + * region_tag:networkservices_v1_generated_NetworkServices_CreateEndpointPolicy_async + */ + async checkCreateEndpointPolicyProgress( + name: string + ): Promise< + LROperation< + protos.google.cloud.networkservices.v1.EndpointPolicy, + protos.google.cloud.networkservices.v1.OperationMetadata + > + > { + 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.createEndpointPolicy, + this._gaxModule.createDefaultBackoffSettings() + ); + return decodeOperation as LROperation< + protos.google.cloud.networkservices.v1.EndpointPolicy, + protos.google.cloud.networkservices.v1.OperationMetadata + >; + } + /** + * Updates the parameters of a single EndpointPolicy. + * + * @param {Object} request + * The request object that will be sent. + * @param {google.protobuf.FieldMask} [request.updateMask] + * Optional. Field mask is used to specify the fields to be overwritten in the + * EndpointPolicy resource by the update. + * The fields specified in the update_mask are relative to the resource, not + * the full request. A field will be overwritten if it is in the mask. If the + * user does not provide a mask then all fields will be overwritten. + * @param {google.cloud.networkservices.v1.EndpointPolicy} request.endpointPolicy + * Required. Updated EndpointPolicy resource. + * @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/network_services.update_endpoint_policy.js + * region_tag:networkservices_v1_generated_NetworkServices_UpdateEndpointPolicy_async + */ + updateEndpointPolicy( + request?: protos.google.cloud.networkservices.v1.IUpdateEndpointPolicyRequest, + options?: CallOptions + ): Promise< + [ + LROperation< + protos.google.cloud.networkservices.v1.IEndpointPolicy, + protos.google.cloud.networkservices.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined, + ] + >; + updateEndpointPolicy( + request: protos.google.cloud.networkservices.v1.IUpdateEndpointPolicyRequest, + options: CallOptions, + callback: Callback< + LROperation< + protos.google.cloud.networkservices.v1.IEndpointPolicy, + protos.google.cloud.networkservices.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + updateEndpointPolicy( + request: protos.google.cloud.networkservices.v1.IUpdateEndpointPolicyRequest, + callback: Callback< + LROperation< + protos.google.cloud.networkservices.v1.IEndpointPolicy, + protos.google.cloud.networkservices.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + updateEndpointPolicy( + request?: protos.google.cloud.networkservices.v1.IUpdateEndpointPolicyRequest, + optionsOrCallback?: + | CallOptions + | Callback< + LROperation< + protos.google.cloud.networkservices.v1.IEndpointPolicy, + protos.google.cloud.networkservices.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + callback?: Callback< + LROperation< + protos.google.cloud.networkservices.v1.IEndpointPolicy, + protos.google.cloud.networkservices.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): Promise< + [ + LROperation< + protos.google.cloud.networkservices.v1.IEndpointPolicy, + protos.google.cloud.networkservices.v1.IOperationMetadata + >, + 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({ + 'endpoint_policy.name': request.endpointPolicy!.name ?? '', + }); + this.initialize(); + return this.innerApiCalls.updateEndpointPolicy(request, options, callback); + } + /** + * Check the status of the long running operation returned by `updateEndpointPolicy()`. + * @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/network_services.update_endpoint_policy.js + * region_tag:networkservices_v1_generated_NetworkServices_UpdateEndpointPolicy_async + */ + async checkUpdateEndpointPolicyProgress( + name: string + ): Promise< + LROperation< + protos.google.cloud.networkservices.v1.EndpointPolicy, + protos.google.cloud.networkservices.v1.OperationMetadata + > + > { + 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.updateEndpointPolicy, + this._gaxModule.createDefaultBackoffSettings() + ); + return decodeOperation as LROperation< + protos.google.cloud.networkservices.v1.EndpointPolicy, + protos.google.cloud.networkservices.v1.OperationMetadata + >; + } + /** + * Deletes a single EndpointPolicy. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. A name of the EndpointPolicy to delete. Must be in the format + * `projects/* /locations/global/endpointPolicies/*`. + * @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/network_services.delete_endpoint_policy.js + * region_tag:networkservices_v1_generated_NetworkServices_DeleteEndpointPolicy_async + */ + deleteEndpointPolicy( + request?: protos.google.cloud.networkservices.v1.IDeleteEndpointPolicyRequest, + options?: CallOptions + ): Promise< + [ + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.networkservices.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined, + ] + >; + deleteEndpointPolicy( + request: protos.google.cloud.networkservices.v1.IDeleteEndpointPolicyRequest, + options: CallOptions, + callback: Callback< + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.networkservices.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + deleteEndpointPolicy( + request: protos.google.cloud.networkservices.v1.IDeleteEndpointPolicyRequest, + callback: Callback< + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.networkservices.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + deleteEndpointPolicy( + request?: protos.google.cloud.networkservices.v1.IDeleteEndpointPolicyRequest, + optionsOrCallback?: + | CallOptions + | Callback< + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.networkservices.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + callback?: Callback< + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.networkservices.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): Promise< + [ + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.networkservices.v1.IOperationMetadata + >, + 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(); + return this.innerApiCalls.deleteEndpointPolicy(request, options, callback); + } + /** + * Check the status of the long running operation returned by `deleteEndpointPolicy()`. + * @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/network_services.delete_endpoint_policy.js + * region_tag:networkservices_v1_generated_NetworkServices_DeleteEndpointPolicy_async + */ + async checkDeleteEndpointPolicyProgress( + name: string + ): Promise< + LROperation< + protos.google.protobuf.Empty, + protos.google.cloud.networkservices.v1.OperationMetadata + > + > { + 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.deleteEndpointPolicy, + this._gaxModule.createDefaultBackoffSettings() + ); + return decodeOperation as LROperation< + protos.google.protobuf.Empty, + protos.google.cloud.networkservices.v1.OperationMetadata + >; + } + /** + * Creates a new Gateway in a given project and location. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The parent resource of the Gateway. Must be in the + * format `projects/* /locations/*`. + * @param {string} request.gatewayId + * Required. Short name of the Gateway resource to be created. + * @param {google.cloud.networkservices.v1.Gateway} request.gateway + * Required. Gateway resource to be created. + * @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/network_services.create_gateway.js + * region_tag:networkservices_v1_generated_NetworkServices_CreateGateway_async + */ + createGateway( + request?: protos.google.cloud.networkservices.v1.ICreateGatewayRequest, + options?: CallOptions + ): Promise< + [ + LROperation< + protos.google.cloud.networkservices.v1.IGateway, + protos.google.cloud.networkservices.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined, + ] + >; + createGateway( + request: protos.google.cloud.networkservices.v1.ICreateGatewayRequest, + options: CallOptions, + callback: Callback< + LROperation< + protos.google.cloud.networkservices.v1.IGateway, + protos.google.cloud.networkservices.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + createGateway( + request: protos.google.cloud.networkservices.v1.ICreateGatewayRequest, + callback: Callback< + LROperation< + protos.google.cloud.networkservices.v1.IGateway, + protos.google.cloud.networkservices.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + createGateway( + request?: protos.google.cloud.networkservices.v1.ICreateGatewayRequest, + optionsOrCallback?: + | CallOptions + | Callback< + LROperation< + protos.google.cloud.networkservices.v1.IGateway, + protos.google.cloud.networkservices.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + callback?: Callback< + LROperation< + protos.google.cloud.networkservices.v1.IGateway, + protos.google.cloud.networkservices.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): Promise< + [ + LROperation< + protos.google.cloud.networkservices.v1.IGateway, + protos.google.cloud.networkservices.v1.IOperationMetadata + >, + 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(); + return this.innerApiCalls.createGateway(request, options, callback); + } + /** + * Check the status of the long running operation returned by `createGateway()`. + * @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/network_services.create_gateway.js + * region_tag:networkservices_v1_generated_NetworkServices_CreateGateway_async + */ + async checkCreateGatewayProgress( + name: string + ): Promise< + LROperation< + protos.google.cloud.networkservices.v1.Gateway, + protos.google.cloud.networkservices.v1.OperationMetadata + > + > { + 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.createGateway, + this._gaxModule.createDefaultBackoffSettings() + ); + return decodeOperation as LROperation< + protos.google.cloud.networkservices.v1.Gateway, + protos.google.cloud.networkservices.v1.OperationMetadata + >; + } + /** + * Updates the parameters of a single Gateway. + * + * @param {Object} request + * The request object that will be sent. + * @param {google.protobuf.FieldMask} [request.updateMask] + * Optional. Field mask is used to specify the fields to be overwritten in the + * Gateway resource by the update. + * The fields specified in the update_mask are relative to the resource, not + * the full request. A field will be overwritten if it is in the mask. If the + * user does not provide a mask then all fields will be overwritten. + * @param {google.cloud.networkservices.v1.Gateway} request.gateway + * Required. Updated Gateway resource. + * @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/network_services.update_gateway.js + * region_tag:networkservices_v1_generated_NetworkServices_UpdateGateway_async + */ + updateGateway( + request?: protos.google.cloud.networkservices.v1.IUpdateGatewayRequest, + options?: CallOptions + ): Promise< + [ + LROperation< + protos.google.cloud.networkservices.v1.IGateway, + protos.google.cloud.networkservices.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined, + ] + >; + updateGateway( + request: protos.google.cloud.networkservices.v1.IUpdateGatewayRequest, + options: CallOptions, + callback: Callback< + LROperation< + protos.google.cloud.networkservices.v1.IGateway, + protos.google.cloud.networkservices.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + updateGateway( + request: protos.google.cloud.networkservices.v1.IUpdateGatewayRequest, + callback: Callback< + LROperation< + protos.google.cloud.networkservices.v1.IGateway, + protos.google.cloud.networkservices.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + updateGateway( + request?: protos.google.cloud.networkservices.v1.IUpdateGatewayRequest, + optionsOrCallback?: + | CallOptions + | Callback< + LROperation< + protos.google.cloud.networkservices.v1.IGateway, + protos.google.cloud.networkservices.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + callback?: Callback< + LROperation< + protos.google.cloud.networkservices.v1.IGateway, + protos.google.cloud.networkservices.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): Promise< + [ + LROperation< + protos.google.cloud.networkservices.v1.IGateway, + protos.google.cloud.networkservices.v1.IOperationMetadata + >, + 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({ + 'gateway.name': request.gateway!.name ?? '', + }); + this.initialize(); + return this.innerApiCalls.updateGateway(request, options, callback); + } + /** + * Check the status of the long running operation returned by `updateGateway()`. + * @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/network_services.update_gateway.js + * region_tag:networkservices_v1_generated_NetworkServices_UpdateGateway_async + */ + async checkUpdateGatewayProgress( + name: string + ): Promise< + LROperation< + protos.google.cloud.networkservices.v1.Gateway, + protos.google.cloud.networkservices.v1.OperationMetadata + > + > { + 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.updateGateway, + this._gaxModule.createDefaultBackoffSettings() + ); + return decodeOperation as LROperation< + protos.google.cloud.networkservices.v1.Gateway, + protos.google.cloud.networkservices.v1.OperationMetadata + >; + } + /** + * Deletes a single Gateway. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. A name of the Gateway to delete. Must be in the format + * `projects/* /locations/* /gateways/*`. + * @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/network_services.delete_gateway.js + * region_tag:networkservices_v1_generated_NetworkServices_DeleteGateway_async + */ + deleteGateway( + request?: protos.google.cloud.networkservices.v1.IDeleteGatewayRequest, + options?: CallOptions + ): Promise< + [ + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.networkservices.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined, + ] + >; + deleteGateway( + request: protos.google.cloud.networkservices.v1.IDeleteGatewayRequest, + options: CallOptions, + callback: Callback< + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.networkservices.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + deleteGateway( + request: protos.google.cloud.networkservices.v1.IDeleteGatewayRequest, + callback: Callback< + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.networkservices.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + deleteGateway( + request?: protos.google.cloud.networkservices.v1.IDeleteGatewayRequest, + optionsOrCallback?: + | CallOptions + | Callback< + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.networkservices.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + callback?: Callback< + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.networkservices.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): Promise< + [ + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.networkservices.v1.IOperationMetadata + >, + 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(); + return this.innerApiCalls.deleteGateway(request, options, callback); + } + /** + * Check the status of the long running operation returned by `deleteGateway()`. + * @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/network_services.delete_gateway.js + * region_tag:networkservices_v1_generated_NetworkServices_DeleteGateway_async + */ + async checkDeleteGatewayProgress( + name: string + ): Promise< + LROperation< + protos.google.protobuf.Empty, + protos.google.cloud.networkservices.v1.OperationMetadata + > + > { + 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.deleteGateway, + this._gaxModule.createDefaultBackoffSettings() + ); + return decodeOperation as LROperation< + protos.google.protobuf.Empty, + protos.google.cloud.networkservices.v1.OperationMetadata + >; + } + /** + * Creates a new GrpcRoute in a given project and location. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The parent resource of the GrpcRoute. Must be in the + * format `projects/* /locations/global`. + * @param {string} request.grpcRouteId + * Required. Short name of the GrpcRoute resource to be created. + * @param {google.cloud.networkservices.v1.GrpcRoute} request.grpcRoute + * Required. GrpcRoute resource to be created. + * @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/network_services.create_grpc_route.js + * region_tag:networkservices_v1_generated_NetworkServices_CreateGrpcRoute_async + */ + createGrpcRoute( + request?: protos.google.cloud.networkservices.v1.ICreateGrpcRouteRequest, + options?: CallOptions + ): Promise< + [ + LROperation< + protos.google.cloud.networkservices.v1.IGrpcRoute, + protos.google.cloud.networkservices.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined, + ] + >; + createGrpcRoute( + request: protos.google.cloud.networkservices.v1.ICreateGrpcRouteRequest, + options: CallOptions, + callback: Callback< + LROperation< + protos.google.cloud.networkservices.v1.IGrpcRoute, + protos.google.cloud.networkservices.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + createGrpcRoute( + request: protos.google.cloud.networkservices.v1.ICreateGrpcRouteRequest, + callback: Callback< + LROperation< + protos.google.cloud.networkservices.v1.IGrpcRoute, + protos.google.cloud.networkservices.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + createGrpcRoute( + request?: protos.google.cloud.networkservices.v1.ICreateGrpcRouteRequest, + optionsOrCallback?: + | CallOptions + | Callback< + LROperation< + protos.google.cloud.networkservices.v1.IGrpcRoute, + protos.google.cloud.networkservices.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + callback?: Callback< + LROperation< + protos.google.cloud.networkservices.v1.IGrpcRoute, + protos.google.cloud.networkservices.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): Promise< + [ + LROperation< + protos.google.cloud.networkservices.v1.IGrpcRoute, + protos.google.cloud.networkservices.v1.IOperationMetadata + >, + 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(); + return this.innerApiCalls.createGrpcRoute(request, options, callback); + } + /** + * Check the status of the long running operation returned by `createGrpcRoute()`. + * @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/network_services.create_grpc_route.js + * region_tag:networkservices_v1_generated_NetworkServices_CreateGrpcRoute_async + */ + async checkCreateGrpcRouteProgress( + name: string + ): Promise< + LROperation< + protos.google.cloud.networkservices.v1.GrpcRoute, + protos.google.cloud.networkservices.v1.OperationMetadata + > + > { + 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.createGrpcRoute, + this._gaxModule.createDefaultBackoffSettings() + ); + return decodeOperation as LROperation< + protos.google.cloud.networkservices.v1.GrpcRoute, + protos.google.cloud.networkservices.v1.OperationMetadata + >; + } + /** + * Updates the parameters of a single GrpcRoute. + * + * @param {Object} request + * The request object that will be sent. + * @param {google.protobuf.FieldMask} [request.updateMask] + * Optional. Field mask is used to specify the fields to be overwritten in the + * GrpcRoute resource by the update. + * The fields specified in the update_mask are relative to the resource, not + * the full request. A field will be overwritten if it is in the mask. If the + * user does not provide a mask then all fields will be overwritten. + * @param {google.cloud.networkservices.v1.GrpcRoute} request.grpcRoute + * Required. Updated GrpcRoute resource. + * @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/network_services.update_grpc_route.js + * region_tag:networkservices_v1_generated_NetworkServices_UpdateGrpcRoute_async + */ + updateGrpcRoute( + request?: protos.google.cloud.networkservices.v1.IUpdateGrpcRouteRequest, + options?: CallOptions + ): Promise< + [ + LROperation< + protos.google.cloud.networkservices.v1.IGrpcRoute, + protos.google.cloud.networkservices.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined, + ] + >; + updateGrpcRoute( + request: protos.google.cloud.networkservices.v1.IUpdateGrpcRouteRequest, + options: CallOptions, + callback: Callback< + LROperation< + protos.google.cloud.networkservices.v1.IGrpcRoute, + protos.google.cloud.networkservices.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + updateGrpcRoute( + request: protos.google.cloud.networkservices.v1.IUpdateGrpcRouteRequest, + callback: Callback< + LROperation< + protos.google.cloud.networkservices.v1.IGrpcRoute, + protos.google.cloud.networkservices.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + updateGrpcRoute( + request?: protos.google.cloud.networkservices.v1.IUpdateGrpcRouteRequest, + optionsOrCallback?: + | CallOptions + | Callback< + LROperation< + protos.google.cloud.networkservices.v1.IGrpcRoute, + protos.google.cloud.networkservices.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + callback?: Callback< + LROperation< + protos.google.cloud.networkservices.v1.IGrpcRoute, + protos.google.cloud.networkservices.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): Promise< + [ + LROperation< + protos.google.cloud.networkservices.v1.IGrpcRoute, + protos.google.cloud.networkservices.v1.IOperationMetadata + >, + 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({ + 'grpc_route.name': request.grpcRoute!.name ?? '', + }); + this.initialize(); + return this.innerApiCalls.updateGrpcRoute(request, options, callback); + } + /** + * Check the status of the long running operation returned by `updateGrpcRoute()`. + * @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/network_services.update_grpc_route.js + * region_tag:networkservices_v1_generated_NetworkServices_UpdateGrpcRoute_async + */ + async checkUpdateGrpcRouteProgress( + name: string + ): Promise< + LROperation< + protos.google.cloud.networkservices.v1.GrpcRoute, + protos.google.cloud.networkservices.v1.OperationMetadata + > + > { + 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.updateGrpcRoute, + this._gaxModule.createDefaultBackoffSettings() + ); + return decodeOperation as LROperation< + protos.google.cloud.networkservices.v1.GrpcRoute, + protos.google.cloud.networkservices.v1.OperationMetadata + >; + } + /** + * Deletes a single GrpcRoute. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. A name of the GrpcRoute to delete. Must be in the format + * `projects/* /locations/global/grpcRoutes/*`. + * @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/network_services.delete_grpc_route.js + * region_tag:networkservices_v1_generated_NetworkServices_DeleteGrpcRoute_async + */ + deleteGrpcRoute( + request?: protos.google.cloud.networkservices.v1.IDeleteGrpcRouteRequest, + options?: CallOptions + ): Promise< + [ + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.networkservices.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined, + ] + >; + deleteGrpcRoute( + request: protos.google.cloud.networkservices.v1.IDeleteGrpcRouteRequest, + options: CallOptions, + callback: Callback< + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.networkservices.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + deleteGrpcRoute( + request: protos.google.cloud.networkservices.v1.IDeleteGrpcRouteRequest, + callback: Callback< + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.networkservices.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + deleteGrpcRoute( + request?: protos.google.cloud.networkservices.v1.IDeleteGrpcRouteRequest, + optionsOrCallback?: + | CallOptions + | Callback< + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.networkservices.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + callback?: Callback< + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.networkservices.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): Promise< + [ + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.networkservices.v1.IOperationMetadata + >, + 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(); + return this.innerApiCalls.deleteGrpcRoute(request, options, callback); + } + /** + * Check the status of the long running operation returned by `deleteGrpcRoute()`. + * @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/network_services.delete_grpc_route.js + * region_tag:networkservices_v1_generated_NetworkServices_DeleteGrpcRoute_async + */ + async checkDeleteGrpcRouteProgress( + name: string + ): Promise< + LROperation< + protos.google.protobuf.Empty, + protos.google.cloud.networkservices.v1.OperationMetadata + > + > { + 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.deleteGrpcRoute, + this._gaxModule.createDefaultBackoffSettings() + ); + return decodeOperation as LROperation< + protos.google.protobuf.Empty, + protos.google.cloud.networkservices.v1.OperationMetadata + >; + } + /** + * Creates a new HttpRoute in a given project and location. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The parent resource of the HttpRoute. Must be in the + * format `projects/* /locations/global`. + * @param {string} request.httpRouteId + * Required. Short name of the HttpRoute resource to be created. + * @param {google.cloud.networkservices.v1.HttpRoute} request.httpRoute + * Required. HttpRoute resource to be created. + * @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/network_services.create_http_route.js + * region_tag:networkservices_v1_generated_NetworkServices_CreateHttpRoute_async + */ + createHttpRoute( + request?: protos.google.cloud.networkservices.v1.ICreateHttpRouteRequest, + options?: CallOptions + ): Promise< + [ + LROperation< + protos.google.cloud.networkservices.v1.IHttpRoute, + protos.google.cloud.networkservices.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined, + ] + >; + createHttpRoute( + request: protos.google.cloud.networkservices.v1.ICreateHttpRouteRequest, + options: CallOptions, + callback: Callback< + LROperation< + protos.google.cloud.networkservices.v1.IHttpRoute, + protos.google.cloud.networkservices.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + createHttpRoute( + request: protos.google.cloud.networkservices.v1.ICreateHttpRouteRequest, + callback: Callback< + LROperation< + protos.google.cloud.networkservices.v1.IHttpRoute, + protos.google.cloud.networkservices.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + createHttpRoute( + request?: protos.google.cloud.networkservices.v1.ICreateHttpRouteRequest, + optionsOrCallback?: + | CallOptions + | Callback< + LROperation< + protos.google.cloud.networkservices.v1.IHttpRoute, + protos.google.cloud.networkservices.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + callback?: Callback< + LROperation< + protos.google.cloud.networkservices.v1.IHttpRoute, + protos.google.cloud.networkservices.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): Promise< + [ + LROperation< + protos.google.cloud.networkservices.v1.IHttpRoute, + protos.google.cloud.networkservices.v1.IOperationMetadata + >, + 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(); + return this.innerApiCalls.createHttpRoute(request, options, callback); + } + /** + * Check the status of the long running operation returned by `createHttpRoute()`. + * @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/network_services.create_http_route.js + * region_tag:networkservices_v1_generated_NetworkServices_CreateHttpRoute_async + */ + async checkCreateHttpRouteProgress( + name: string + ): Promise< + LROperation< + protos.google.cloud.networkservices.v1.HttpRoute, + protos.google.cloud.networkservices.v1.OperationMetadata + > + > { + 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.createHttpRoute, + this._gaxModule.createDefaultBackoffSettings() + ); + return decodeOperation as LROperation< + protos.google.cloud.networkservices.v1.HttpRoute, + protos.google.cloud.networkservices.v1.OperationMetadata + >; + } + /** + * Updates the parameters of a single HttpRoute. + * + * @param {Object} request + * The request object that will be sent. + * @param {google.protobuf.FieldMask} [request.updateMask] + * Optional. Field mask is used to specify the fields to be overwritten in the + * HttpRoute resource by the update. + * The fields specified in the update_mask are relative to the resource, not + * the full request. A field will be overwritten if it is in the mask. If the + * user does not provide a mask then all fields will be overwritten. + * @param {google.cloud.networkservices.v1.HttpRoute} request.httpRoute + * Required. Updated HttpRoute resource. + * @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/network_services.update_http_route.js + * region_tag:networkservices_v1_generated_NetworkServices_UpdateHttpRoute_async + */ + updateHttpRoute( + request?: protos.google.cloud.networkservices.v1.IUpdateHttpRouteRequest, + options?: CallOptions + ): Promise< + [ + LROperation< + protos.google.cloud.networkservices.v1.IHttpRoute, + protos.google.cloud.networkservices.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined, + ] + >; + updateHttpRoute( + request: protos.google.cloud.networkservices.v1.IUpdateHttpRouteRequest, + options: CallOptions, + callback: Callback< + LROperation< + protos.google.cloud.networkservices.v1.IHttpRoute, + protos.google.cloud.networkservices.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + updateHttpRoute( + request: protos.google.cloud.networkservices.v1.IUpdateHttpRouteRequest, + callback: Callback< + LROperation< + protos.google.cloud.networkservices.v1.IHttpRoute, + protos.google.cloud.networkservices.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + updateHttpRoute( + request?: protos.google.cloud.networkservices.v1.IUpdateHttpRouteRequest, + optionsOrCallback?: + | CallOptions + | Callback< + LROperation< + protos.google.cloud.networkservices.v1.IHttpRoute, + protos.google.cloud.networkservices.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + callback?: Callback< + LROperation< + protos.google.cloud.networkservices.v1.IHttpRoute, + protos.google.cloud.networkservices.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): Promise< + [ + LROperation< + protos.google.cloud.networkservices.v1.IHttpRoute, + protos.google.cloud.networkservices.v1.IOperationMetadata + >, + 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({ + 'http_route.name': request.httpRoute!.name ?? '', + }); + this.initialize(); + return this.innerApiCalls.updateHttpRoute(request, options, callback); + } + /** + * Check the status of the long running operation returned by `updateHttpRoute()`. + * @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/network_services.update_http_route.js + * region_tag:networkservices_v1_generated_NetworkServices_UpdateHttpRoute_async + */ + async checkUpdateHttpRouteProgress( + name: string + ): Promise< + LROperation< + protos.google.cloud.networkservices.v1.HttpRoute, + protos.google.cloud.networkservices.v1.OperationMetadata + > + > { + 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.updateHttpRoute, + this._gaxModule.createDefaultBackoffSettings() + ); + return decodeOperation as LROperation< + protos.google.cloud.networkservices.v1.HttpRoute, + protos.google.cloud.networkservices.v1.OperationMetadata + >; + } + /** + * Deletes a single HttpRoute. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. A name of the HttpRoute to delete. Must be in the format + * `projects/* /locations/global/httpRoutes/*`. + * @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/network_services.delete_http_route.js + * region_tag:networkservices_v1_generated_NetworkServices_DeleteHttpRoute_async + */ + deleteHttpRoute( + request?: protos.google.cloud.networkservices.v1.IDeleteHttpRouteRequest, + options?: CallOptions + ): Promise< + [ + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.networkservices.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined, + ] + >; + deleteHttpRoute( + request: protos.google.cloud.networkservices.v1.IDeleteHttpRouteRequest, + options: CallOptions, + callback: Callback< + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.networkservices.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + deleteHttpRoute( + request: protos.google.cloud.networkservices.v1.IDeleteHttpRouteRequest, + callback: Callback< + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.networkservices.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + deleteHttpRoute( + request?: protos.google.cloud.networkservices.v1.IDeleteHttpRouteRequest, + optionsOrCallback?: + | CallOptions + | Callback< + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.networkservices.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + callback?: Callback< + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.networkservices.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): Promise< + [ + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.networkservices.v1.IOperationMetadata + >, + 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(); + return this.innerApiCalls.deleteHttpRoute(request, options, callback); + } + /** + * Check the status of the long running operation returned by `deleteHttpRoute()`. + * @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/network_services.delete_http_route.js + * region_tag:networkservices_v1_generated_NetworkServices_DeleteHttpRoute_async + */ + async checkDeleteHttpRouteProgress( + name: string + ): Promise< + LROperation< + protos.google.protobuf.Empty, + protos.google.cloud.networkservices.v1.OperationMetadata + > + > { + 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.deleteHttpRoute, + this._gaxModule.createDefaultBackoffSettings() + ); + return decodeOperation as LROperation< + protos.google.protobuf.Empty, + protos.google.cloud.networkservices.v1.OperationMetadata + >; + } + /** + * Creates a new TcpRoute in a given project and location. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The parent resource of the TcpRoute. Must be in the + * format `projects/* /locations/global`. + * @param {string} request.tcpRouteId + * Required. Short name of the TcpRoute resource to be created. + * @param {google.cloud.networkservices.v1.TcpRoute} request.tcpRoute + * Required. TcpRoute resource to be created. + * @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/network_services.create_tcp_route.js + * region_tag:networkservices_v1_generated_NetworkServices_CreateTcpRoute_async + */ + createTcpRoute( + request?: protos.google.cloud.networkservices.v1.ICreateTcpRouteRequest, + options?: CallOptions + ): Promise< + [ + LROperation< + protos.google.cloud.networkservices.v1.ITcpRoute, + protos.google.cloud.networkservices.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined, + ] + >; + createTcpRoute( + request: protos.google.cloud.networkservices.v1.ICreateTcpRouteRequest, + options: CallOptions, + callback: Callback< + LROperation< + protos.google.cloud.networkservices.v1.ITcpRoute, + protos.google.cloud.networkservices.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + createTcpRoute( + request: protos.google.cloud.networkservices.v1.ICreateTcpRouteRequest, + callback: Callback< + LROperation< + protos.google.cloud.networkservices.v1.ITcpRoute, + protos.google.cloud.networkservices.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + createTcpRoute( + request?: protos.google.cloud.networkservices.v1.ICreateTcpRouteRequest, + optionsOrCallback?: + | CallOptions + | Callback< + LROperation< + protos.google.cloud.networkservices.v1.ITcpRoute, + protos.google.cloud.networkservices.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + callback?: Callback< + LROperation< + protos.google.cloud.networkservices.v1.ITcpRoute, + protos.google.cloud.networkservices.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): Promise< + [ + LROperation< + protos.google.cloud.networkservices.v1.ITcpRoute, + protos.google.cloud.networkservices.v1.IOperationMetadata + >, + 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(); + return this.innerApiCalls.createTcpRoute(request, options, callback); + } + /** + * Check the status of the long running operation returned by `createTcpRoute()`. + * @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/network_services.create_tcp_route.js + * region_tag:networkservices_v1_generated_NetworkServices_CreateTcpRoute_async + */ + async checkCreateTcpRouteProgress( + name: string + ): Promise< + LROperation< + protos.google.cloud.networkservices.v1.TcpRoute, + protos.google.cloud.networkservices.v1.OperationMetadata + > + > { + 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.createTcpRoute, + this._gaxModule.createDefaultBackoffSettings() + ); + return decodeOperation as LROperation< + protos.google.cloud.networkservices.v1.TcpRoute, + protos.google.cloud.networkservices.v1.OperationMetadata + >; + } + /** + * Updates the parameters of a single TcpRoute. + * + * @param {Object} request + * The request object that will be sent. + * @param {google.protobuf.FieldMask} [request.updateMask] + * Optional. Field mask is used to specify the fields to be overwritten in the + * TcpRoute resource by the update. + * The fields specified in the update_mask are relative to the resource, not + * the full request. A field will be overwritten if it is in the mask. If the + * user does not provide a mask then all fields will be overwritten. + * @param {google.cloud.networkservices.v1.TcpRoute} request.tcpRoute + * Required. Updated TcpRoute resource. + * @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/network_services.update_tcp_route.js + * region_tag:networkservices_v1_generated_NetworkServices_UpdateTcpRoute_async + */ + updateTcpRoute( + request?: protos.google.cloud.networkservices.v1.IUpdateTcpRouteRequest, + options?: CallOptions + ): Promise< + [ + LROperation< + protos.google.cloud.networkservices.v1.ITcpRoute, + protos.google.cloud.networkservices.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined, + ] + >; + updateTcpRoute( + request: protos.google.cloud.networkservices.v1.IUpdateTcpRouteRequest, + options: CallOptions, + callback: Callback< + LROperation< + protos.google.cloud.networkservices.v1.ITcpRoute, + protos.google.cloud.networkservices.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + updateTcpRoute( + request: protos.google.cloud.networkservices.v1.IUpdateTcpRouteRequest, + callback: Callback< + LROperation< + protos.google.cloud.networkservices.v1.ITcpRoute, + protos.google.cloud.networkservices.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + updateTcpRoute( + request?: protos.google.cloud.networkservices.v1.IUpdateTcpRouteRequest, + optionsOrCallback?: + | CallOptions + | Callback< + LROperation< + protos.google.cloud.networkservices.v1.ITcpRoute, + protos.google.cloud.networkservices.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + callback?: Callback< + LROperation< + protos.google.cloud.networkservices.v1.ITcpRoute, + protos.google.cloud.networkservices.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): Promise< + [ + LROperation< + protos.google.cloud.networkservices.v1.ITcpRoute, + protos.google.cloud.networkservices.v1.IOperationMetadata + >, + 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({ + 'tcp_route.name': request.tcpRoute!.name ?? '', + }); + this.initialize(); + return this.innerApiCalls.updateTcpRoute(request, options, callback); + } + /** + * Check the status of the long running operation returned by `updateTcpRoute()`. + * @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/network_services.update_tcp_route.js + * region_tag:networkservices_v1_generated_NetworkServices_UpdateTcpRoute_async + */ + async checkUpdateTcpRouteProgress( + name: string + ): Promise< + LROperation< + protos.google.cloud.networkservices.v1.TcpRoute, + protos.google.cloud.networkservices.v1.OperationMetadata + > + > { + 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.updateTcpRoute, + this._gaxModule.createDefaultBackoffSettings() + ); + return decodeOperation as LROperation< + protos.google.cloud.networkservices.v1.TcpRoute, + protos.google.cloud.networkservices.v1.OperationMetadata + >; + } + /** + * Deletes a single TcpRoute. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. A name of the TcpRoute to delete. Must be in the format + * `projects/* /locations/global/tcpRoutes/*`. + * @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/network_services.delete_tcp_route.js + * region_tag:networkservices_v1_generated_NetworkServices_DeleteTcpRoute_async + */ + deleteTcpRoute( + request?: protos.google.cloud.networkservices.v1.IDeleteTcpRouteRequest, + options?: CallOptions + ): Promise< + [ + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.networkservices.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined, + ] + >; + deleteTcpRoute( + request: protos.google.cloud.networkservices.v1.IDeleteTcpRouteRequest, + options: CallOptions, + callback: Callback< + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.networkservices.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + deleteTcpRoute( + request: protos.google.cloud.networkservices.v1.IDeleteTcpRouteRequest, + callback: Callback< + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.networkservices.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + deleteTcpRoute( + request?: protos.google.cloud.networkservices.v1.IDeleteTcpRouteRequest, + optionsOrCallback?: + | CallOptions + | Callback< + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.networkservices.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + callback?: Callback< + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.networkservices.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): Promise< + [ + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.networkservices.v1.IOperationMetadata + >, + 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(); + return this.innerApiCalls.deleteTcpRoute(request, options, callback); + } + /** + * Check the status of the long running operation returned by `deleteTcpRoute()`. + * @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/network_services.delete_tcp_route.js + * region_tag:networkservices_v1_generated_NetworkServices_DeleteTcpRoute_async + */ + async checkDeleteTcpRouteProgress( + name: string + ): Promise< + LROperation< + protos.google.protobuf.Empty, + protos.google.cloud.networkservices.v1.OperationMetadata + > + > { + 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.deleteTcpRoute, + this._gaxModule.createDefaultBackoffSettings() + ); + return decodeOperation as LROperation< + protos.google.protobuf.Empty, + protos.google.cloud.networkservices.v1.OperationMetadata + >; + } + /** + * Creates a new TlsRoute in a given project and location. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The parent resource of the TlsRoute. Must be in the + * format `projects/* /locations/global`. + * @param {string} request.tlsRouteId + * Required. Short name of the TlsRoute resource to be created. + * @param {google.cloud.networkservices.v1.TlsRoute} request.tlsRoute + * Required. TlsRoute resource to be created. + * @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/network_services.create_tls_route.js + * region_tag:networkservices_v1_generated_NetworkServices_CreateTlsRoute_async + */ + createTlsRoute( + request?: protos.google.cloud.networkservices.v1.ICreateTlsRouteRequest, + options?: CallOptions + ): Promise< + [ + LROperation< + protos.google.cloud.networkservices.v1.ITlsRoute, + protos.google.cloud.networkservices.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined, + ] + >; + createTlsRoute( + request: protos.google.cloud.networkservices.v1.ICreateTlsRouteRequest, + options: CallOptions, + callback: Callback< + LROperation< + protos.google.cloud.networkservices.v1.ITlsRoute, + protos.google.cloud.networkservices.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + createTlsRoute( + request: protos.google.cloud.networkservices.v1.ICreateTlsRouteRequest, + callback: Callback< + LROperation< + protos.google.cloud.networkservices.v1.ITlsRoute, + protos.google.cloud.networkservices.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + createTlsRoute( + request?: protos.google.cloud.networkservices.v1.ICreateTlsRouteRequest, + optionsOrCallback?: + | CallOptions + | Callback< + LROperation< + protos.google.cloud.networkservices.v1.ITlsRoute, + protos.google.cloud.networkservices.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + callback?: Callback< + LROperation< + protos.google.cloud.networkservices.v1.ITlsRoute, + protos.google.cloud.networkservices.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): Promise< + [ + LROperation< + protos.google.cloud.networkservices.v1.ITlsRoute, + protos.google.cloud.networkservices.v1.IOperationMetadata + >, + 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(); + return this.innerApiCalls.createTlsRoute(request, options, callback); + } + /** + * Check the status of the long running operation returned by `createTlsRoute()`. + * @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/network_services.create_tls_route.js + * region_tag:networkservices_v1_generated_NetworkServices_CreateTlsRoute_async + */ + async checkCreateTlsRouteProgress( + name: string + ): Promise< + LROperation< + protos.google.cloud.networkservices.v1.TlsRoute, + protos.google.cloud.networkservices.v1.OperationMetadata + > + > { + 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.createTlsRoute, + this._gaxModule.createDefaultBackoffSettings() + ); + return decodeOperation as LROperation< + protos.google.cloud.networkservices.v1.TlsRoute, + protos.google.cloud.networkservices.v1.OperationMetadata + >; + } + /** + * Updates the parameters of a single TlsRoute. + * + * @param {Object} request + * The request object that will be sent. + * @param {google.protobuf.FieldMask} [request.updateMask] + * Optional. Field mask is used to specify the fields to be overwritten in the + * TlsRoute resource by the update. + * The fields specified in the update_mask are relative to the resource, not + * the full request. A field will be overwritten if it is in the mask. If the + * user does not provide a mask then all fields will be overwritten. + * @param {google.cloud.networkservices.v1.TlsRoute} request.tlsRoute + * Required. Updated TlsRoute resource. + * @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/network_services.update_tls_route.js + * region_tag:networkservices_v1_generated_NetworkServices_UpdateTlsRoute_async + */ + updateTlsRoute( + request?: protos.google.cloud.networkservices.v1.IUpdateTlsRouteRequest, + options?: CallOptions + ): Promise< + [ + LROperation< + protos.google.cloud.networkservices.v1.ITlsRoute, + protos.google.cloud.networkservices.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined, + ] + >; + updateTlsRoute( + request: protos.google.cloud.networkservices.v1.IUpdateTlsRouteRequest, + options: CallOptions, + callback: Callback< + LROperation< + protos.google.cloud.networkservices.v1.ITlsRoute, + protos.google.cloud.networkservices.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + updateTlsRoute( + request: protos.google.cloud.networkservices.v1.IUpdateTlsRouteRequest, + callback: Callback< + LROperation< + protos.google.cloud.networkservices.v1.ITlsRoute, + protos.google.cloud.networkservices.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + updateTlsRoute( + request?: protos.google.cloud.networkservices.v1.IUpdateTlsRouteRequest, + optionsOrCallback?: + | CallOptions + | Callback< + LROperation< + protos.google.cloud.networkservices.v1.ITlsRoute, + protos.google.cloud.networkservices.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + callback?: Callback< + LROperation< + protos.google.cloud.networkservices.v1.ITlsRoute, + protos.google.cloud.networkservices.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): Promise< + [ + LROperation< + protos.google.cloud.networkservices.v1.ITlsRoute, + protos.google.cloud.networkservices.v1.IOperationMetadata + >, + 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({ + 'tls_route.name': request.tlsRoute!.name ?? '', + }); + this.initialize(); + return this.innerApiCalls.updateTlsRoute(request, options, callback); + } + /** + * Check the status of the long running operation returned by `updateTlsRoute()`. + * @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/network_services.update_tls_route.js + * region_tag:networkservices_v1_generated_NetworkServices_UpdateTlsRoute_async + */ + async checkUpdateTlsRouteProgress( + name: string + ): Promise< + LROperation< + protos.google.cloud.networkservices.v1.TlsRoute, + protos.google.cloud.networkservices.v1.OperationMetadata + > + > { + 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.updateTlsRoute, + this._gaxModule.createDefaultBackoffSettings() + ); + return decodeOperation as LROperation< + protos.google.cloud.networkservices.v1.TlsRoute, + protos.google.cloud.networkservices.v1.OperationMetadata + >; + } + /** + * Deletes a single TlsRoute. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. A name of the TlsRoute to delete. Must be in the format + * `projects/* /locations/global/tlsRoutes/*`. + * @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/network_services.delete_tls_route.js + * region_tag:networkservices_v1_generated_NetworkServices_DeleteTlsRoute_async + */ + deleteTlsRoute( + request?: protos.google.cloud.networkservices.v1.IDeleteTlsRouteRequest, + options?: CallOptions + ): Promise< + [ + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.networkservices.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined, + ] + >; + deleteTlsRoute( + request: protos.google.cloud.networkservices.v1.IDeleteTlsRouteRequest, + options: CallOptions, + callback: Callback< + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.networkservices.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + deleteTlsRoute( + request: protos.google.cloud.networkservices.v1.IDeleteTlsRouteRequest, + callback: Callback< + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.networkservices.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + deleteTlsRoute( + request?: protos.google.cloud.networkservices.v1.IDeleteTlsRouteRequest, + optionsOrCallback?: + | CallOptions + | Callback< + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.networkservices.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + callback?: Callback< + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.networkservices.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): Promise< + [ + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.networkservices.v1.IOperationMetadata + >, + 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(); + return this.innerApiCalls.deleteTlsRoute(request, options, callback); + } + /** + * Check the status of the long running operation returned by `deleteTlsRoute()`. + * @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/network_services.delete_tls_route.js + * region_tag:networkservices_v1_generated_NetworkServices_DeleteTlsRoute_async + */ + async checkDeleteTlsRouteProgress( + name: string + ): Promise< + LROperation< + protos.google.protobuf.Empty, + protos.google.cloud.networkservices.v1.OperationMetadata + > + > { + 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.deleteTlsRoute, + this._gaxModule.createDefaultBackoffSettings() + ); + return decodeOperation as LROperation< + protos.google.protobuf.Empty, + protos.google.cloud.networkservices.v1.OperationMetadata + >; + } + /** + * Creates a new ServiceBinding in a given project and location. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The parent resource of the ServiceBinding. Must be in the + * format `projects/* /locations/global`. + * @param {string} request.serviceBindingId + * Required. Short name of the ServiceBinding resource to be created. + * @param {google.cloud.networkservices.v1.ServiceBinding} request.serviceBinding + * Required. ServiceBinding resource to be created. + * @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/network_services.create_service_binding.js + * region_tag:networkservices_v1_generated_NetworkServices_CreateServiceBinding_async + */ + createServiceBinding( + request?: protos.google.cloud.networkservices.v1.ICreateServiceBindingRequest, + options?: CallOptions + ): Promise< + [ + LROperation< + protos.google.cloud.networkservices.v1.IServiceBinding, + protos.google.cloud.networkservices.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined, + ] + >; + createServiceBinding( + request: protos.google.cloud.networkservices.v1.ICreateServiceBindingRequest, + options: CallOptions, + callback: Callback< + LROperation< + protos.google.cloud.networkservices.v1.IServiceBinding, + protos.google.cloud.networkservices.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + createServiceBinding( + request: protos.google.cloud.networkservices.v1.ICreateServiceBindingRequest, + callback: Callback< + LROperation< + protos.google.cloud.networkservices.v1.IServiceBinding, + protos.google.cloud.networkservices.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + createServiceBinding( + request?: protos.google.cloud.networkservices.v1.ICreateServiceBindingRequest, + optionsOrCallback?: + | CallOptions + | Callback< + LROperation< + protos.google.cloud.networkservices.v1.IServiceBinding, + protos.google.cloud.networkservices.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + callback?: Callback< + LROperation< + protos.google.cloud.networkservices.v1.IServiceBinding, + protos.google.cloud.networkservices.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): Promise< + [ + LROperation< + protos.google.cloud.networkservices.v1.IServiceBinding, + protos.google.cloud.networkservices.v1.IOperationMetadata + >, + 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(); + return this.innerApiCalls.createServiceBinding(request, options, callback); + } + /** + * Check the status of the long running operation returned by `createServiceBinding()`. + * @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/network_services.create_service_binding.js + * region_tag:networkservices_v1_generated_NetworkServices_CreateServiceBinding_async + */ + async checkCreateServiceBindingProgress( + name: string + ): Promise< + LROperation< + protos.google.cloud.networkservices.v1.ServiceBinding, + protos.google.cloud.networkservices.v1.OperationMetadata + > + > { + 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.createServiceBinding, + this._gaxModule.createDefaultBackoffSettings() + ); + return decodeOperation as LROperation< + protos.google.cloud.networkservices.v1.ServiceBinding, + protos.google.cloud.networkservices.v1.OperationMetadata + >; + } + /** + * Deletes a single ServiceBinding. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. A name of the ServiceBinding to delete. Must be in the format + * `projects/* /locations/global/serviceBindings/*`. + * @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/network_services.delete_service_binding.js + * region_tag:networkservices_v1_generated_NetworkServices_DeleteServiceBinding_async + */ + deleteServiceBinding( + request?: protos.google.cloud.networkservices.v1.IDeleteServiceBindingRequest, + options?: CallOptions + ): Promise< + [ + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.networkservices.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined, + ] + >; + deleteServiceBinding( + request: protos.google.cloud.networkservices.v1.IDeleteServiceBindingRequest, + options: CallOptions, + callback: Callback< + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.networkservices.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + deleteServiceBinding( + request: protos.google.cloud.networkservices.v1.IDeleteServiceBindingRequest, + callback: Callback< + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.networkservices.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + deleteServiceBinding( + request?: protos.google.cloud.networkservices.v1.IDeleteServiceBindingRequest, + optionsOrCallback?: + | CallOptions + | Callback< + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.networkservices.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + callback?: Callback< + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.networkservices.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): Promise< + [ + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.networkservices.v1.IOperationMetadata + >, + 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(); + return this.innerApiCalls.deleteServiceBinding(request, options, callback); + } + /** + * Check the status of the long running operation returned by `deleteServiceBinding()`. + * @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/network_services.delete_service_binding.js + * region_tag:networkservices_v1_generated_NetworkServices_DeleteServiceBinding_async + */ + async checkDeleteServiceBindingProgress( + name: string + ): Promise< + LROperation< + protos.google.protobuf.Empty, + protos.google.cloud.networkservices.v1.OperationMetadata + > + > { + 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.deleteServiceBinding, + this._gaxModule.createDefaultBackoffSettings() + ); + return decodeOperation as LROperation< + protos.google.protobuf.Empty, + protos.google.cloud.networkservices.v1.OperationMetadata + >; + } + /** + * Creates a new Mesh in a given project and location. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The parent resource of the Mesh. Must be in the + * format `projects/* /locations/global`. + * @param {string} request.meshId + * Required. Short name of the Mesh resource to be created. + * @param {google.cloud.networkservices.v1.Mesh} request.mesh + * Required. Mesh resource to be created. + * @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/network_services.create_mesh.js + * region_tag:networkservices_v1_generated_NetworkServices_CreateMesh_async + */ + createMesh( + request?: protos.google.cloud.networkservices.v1.ICreateMeshRequest, + options?: CallOptions + ): Promise< + [ + LROperation< + protos.google.cloud.networkservices.v1.IMesh, + protos.google.cloud.networkservices.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined, + ] + >; + createMesh( + request: protos.google.cloud.networkservices.v1.ICreateMeshRequest, + options: CallOptions, + callback: Callback< + LROperation< + protos.google.cloud.networkservices.v1.IMesh, + protos.google.cloud.networkservices.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + createMesh( + request: protos.google.cloud.networkservices.v1.ICreateMeshRequest, + callback: Callback< + LROperation< + protos.google.cloud.networkservices.v1.IMesh, + protos.google.cloud.networkservices.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + createMesh( + request?: protos.google.cloud.networkservices.v1.ICreateMeshRequest, + optionsOrCallback?: + | CallOptions + | Callback< + LROperation< + protos.google.cloud.networkservices.v1.IMesh, + protos.google.cloud.networkservices.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + callback?: Callback< + LROperation< + protos.google.cloud.networkservices.v1.IMesh, + protos.google.cloud.networkservices.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): Promise< + [ + LROperation< + protos.google.cloud.networkservices.v1.IMesh, + protos.google.cloud.networkservices.v1.IOperationMetadata + >, + 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(); + return this.innerApiCalls.createMesh(request, options, callback); + } + /** + * Check the status of the long running operation returned by `createMesh()`. + * @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/network_services.create_mesh.js + * region_tag:networkservices_v1_generated_NetworkServices_CreateMesh_async + */ + async checkCreateMeshProgress( + name: string + ): Promise< + LROperation< + protos.google.cloud.networkservices.v1.Mesh, + protos.google.cloud.networkservices.v1.OperationMetadata + > + > { + 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.createMesh, + this._gaxModule.createDefaultBackoffSettings() + ); + return decodeOperation as LROperation< + protos.google.cloud.networkservices.v1.Mesh, + protos.google.cloud.networkservices.v1.OperationMetadata + >; + } + /** + * Updates the parameters of a single Mesh. + * + * @param {Object} request + * The request object that will be sent. + * @param {google.protobuf.FieldMask} [request.updateMask] + * Optional. Field mask is used to specify the fields to be overwritten in the + * Mesh resource by the update. + * The fields specified in the update_mask are relative to the resource, not + * the full request. A field will be overwritten if it is in the mask. If the + * user does not provide a mask then all fields will be overwritten. + * @param {google.cloud.networkservices.v1.Mesh} request.mesh + * Required. Updated Mesh resource. + * @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/network_services.update_mesh.js + * region_tag:networkservices_v1_generated_NetworkServices_UpdateMesh_async + */ + updateMesh( + request?: protos.google.cloud.networkservices.v1.IUpdateMeshRequest, + options?: CallOptions + ): Promise< + [ + LROperation< + protos.google.cloud.networkservices.v1.IMesh, + protos.google.cloud.networkservices.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined, + ] + >; + updateMesh( + request: protos.google.cloud.networkservices.v1.IUpdateMeshRequest, + options: CallOptions, + callback: Callback< + LROperation< + protos.google.cloud.networkservices.v1.IMesh, + protos.google.cloud.networkservices.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + updateMesh( + request: protos.google.cloud.networkservices.v1.IUpdateMeshRequest, + callback: Callback< + LROperation< + protos.google.cloud.networkservices.v1.IMesh, + protos.google.cloud.networkservices.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + updateMesh( + request?: protos.google.cloud.networkservices.v1.IUpdateMeshRequest, + optionsOrCallback?: + | CallOptions + | Callback< + LROperation< + protos.google.cloud.networkservices.v1.IMesh, + protos.google.cloud.networkservices.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + callback?: Callback< + LROperation< + protos.google.cloud.networkservices.v1.IMesh, + protos.google.cloud.networkservices.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): Promise< + [ + LROperation< + protos.google.cloud.networkservices.v1.IMesh, + protos.google.cloud.networkservices.v1.IOperationMetadata + >, + 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({ + 'mesh.name': request.mesh!.name ?? '', + }); + this.initialize(); + return this.innerApiCalls.updateMesh(request, options, callback); + } + /** + * Check the status of the long running operation returned by `updateMesh()`. + * @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/network_services.update_mesh.js + * region_tag:networkservices_v1_generated_NetworkServices_UpdateMesh_async + */ + async checkUpdateMeshProgress( + name: string + ): Promise< + LROperation< + protos.google.cloud.networkservices.v1.Mesh, + protos.google.cloud.networkservices.v1.OperationMetadata + > + > { + 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.updateMesh, + this._gaxModule.createDefaultBackoffSettings() + ); + return decodeOperation as LROperation< + protos.google.cloud.networkservices.v1.Mesh, + protos.google.cloud.networkservices.v1.OperationMetadata + >; + } + /** + * Deletes a single Mesh. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. A name of the Mesh to delete. Must be in the format + * `projects/* /locations/global/meshes/*`. + * @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/network_services.delete_mesh.js + * region_tag:networkservices_v1_generated_NetworkServices_DeleteMesh_async + */ + deleteMesh( + request?: protos.google.cloud.networkservices.v1.IDeleteMeshRequest, + options?: CallOptions + ): Promise< + [ + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.networkservices.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined, + ] + >; + deleteMesh( + request: protos.google.cloud.networkservices.v1.IDeleteMeshRequest, + options: CallOptions, + callback: Callback< + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.networkservices.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + deleteMesh( + request: protos.google.cloud.networkservices.v1.IDeleteMeshRequest, + callback: Callback< + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.networkservices.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + deleteMesh( + request?: protos.google.cloud.networkservices.v1.IDeleteMeshRequest, + optionsOrCallback?: + | CallOptions + | Callback< + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.networkservices.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + callback?: Callback< + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.networkservices.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): Promise< + [ + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.networkservices.v1.IOperationMetadata + >, + 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(); + return this.innerApiCalls.deleteMesh(request, options, callback); + } + /** + * Check the status of the long running operation returned by `deleteMesh()`. + * @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/network_services.delete_mesh.js + * region_tag:networkservices_v1_generated_NetworkServices_DeleteMesh_async + */ + async checkDeleteMeshProgress( + name: string + ): Promise< + LROperation< + protos.google.protobuf.Empty, + protos.google.cloud.networkservices.v1.OperationMetadata + > + > { + 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.deleteMesh, + this._gaxModule.createDefaultBackoffSettings() + ); + return decodeOperation as LROperation< + protos.google.protobuf.Empty, + protos.google.cloud.networkservices.v1.OperationMetadata + >; + } + /** + * Lists EndpointPolicies in a given project and location. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The project and location from which the EndpointPolicies should + * be listed, specified in the format `projects/* /locations/global`. + * @param {number} request.pageSize + * Maximum number of EndpointPolicies to return per call. + * @param {string} request.pageToken + * The value returned by the last `ListEndpointPoliciesResponse` + * Indicates that this is a continuation of a prior + * `ListEndpointPolicies` call, and that the system should return the + * next page of data. + * @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.networkservices.v1.EndpointPolicy|EndpointPolicy}. + * 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 `listEndpointPoliciesAsync()` + * 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. + */ + listEndpointPolicies( + request?: protos.google.cloud.networkservices.v1.IListEndpointPoliciesRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.networkservices.v1.IEndpointPolicy[], + protos.google.cloud.networkservices.v1.IListEndpointPoliciesRequest | null, + protos.google.cloud.networkservices.v1.IListEndpointPoliciesResponse, + ] + >; + listEndpointPolicies( + request: protos.google.cloud.networkservices.v1.IListEndpointPoliciesRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.cloud.networkservices.v1.IListEndpointPoliciesRequest, + | protos.google.cloud.networkservices.v1.IListEndpointPoliciesResponse + | null + | undefined, + protos.google.cloud.networkservices.v1.IEndpointPolicy + > + ): void; + listEndpointPolicies( + request: protos.google.cloud.networkservices.v1.IListEndpointPoliciesRequest, + callback: PaginationCallback< + protos.google.cloud.networkservices.v1.IListEndpointPoliciesRequest, + | protos.google.cloud.networkservices.v1.IListEndpointPoliciesResponse + | null + | undefined, + protos.google.cloud.networkservices.v1.IEndpointPolicy + > + ): void; + listEndpointPolicies( + request?: protos.google.cloud.networkservices.v1.IListEndpointPoliciesRequest, + optionsOrCallback?: + | CallOptions + | PaginationCallback< + protos.google.cloud.networkservices.v1.IListEndpointPoliciesRequest, + | protos.google.cloud.networkservices.v1.IListEndpointPoliciesResponse + | null + | undefined, + protos.google.cloud.networkservices.v1.IEndpointPolicy + >, + callback?: PaginationCallback< + protos.google.cloud.networkservices.v1.IListEndpointPoliciesRequest, + | protos.google.cloud.networkservices.v1.IListEndpointPoliciesResponse + | null + | undefined, + protos.google.cloud.networkservices.v1.IEndpointPolicy + > + ): Promise< + [ + protos.google.cloud.networkservices.v1.IEndpointPolicy[], + protos.google.cloud.networkservices.v1.IListEndpointPoliciesRequest | null, + protos.google.cloud.networkservices.v1.IListEndpointPoliciesResponse, + ] + > | 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(); + return this.innerApiCalls.listEndpointPolicies(request, options, callback); + } + + /** + * Equivalent to `method.name.toCamelCase()`, 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 from which the EndpointPolicies should + * be listed, specified in the format `projects/* /locations/global`. + * @param {number} request.pageSize + * Maximum number of EndpointPolicies to return per call. + * @param {string} request.pageToken + * The value returned by the last `ListEndpointPoliciesResponse` + * Indicates that this is a continuation of a prior + * `ListEndpointPolicies` call, and that the system should return the + * next page of data. + * @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.networkservices.v1.EndpointPolicy|EndpointPolicy} 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 `listEndpointPoliciesAsync()` + * 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. + */ + listEndpointPoliciesStream( + request?: protos.google.cloud.networkservices.v1.IListEndpointPoliciesRequest, + 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['listEndpointPolicies']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.listEndpointPolicies.createStream( + this.innerApiCalls.listEndpointPolicies as GaxCall, + request, + callSettings + ); + } + + /** + * Equivalent to `listEndpointPolicies`, 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 from which the EndpointPolicies should + * be listed, specified in the format `projects/* /locations/global`. + * @param {number} request.pageSize + * Maximum number of EndpointPolicies to return per call. + * @param {string} request.pageToken + * The value returned by the last `ListEndpointPoliciesResponse` + * Indicates that this is a continuation of a prior + * `ListEndpointPolicies` call, and that the system should return the + * next page of data. + * @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.networkservices.v1.EndpointPolicy|EndpointPolicy}. 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/network_services.list_endpoint_policies.js + * region_tag:networkservices_v1_generated_NetworkServices_ListEndpointPolicies_async + */ + listEndpointPoliciesAsync( + request?: protos.google.cloud.networkservices.v1.IListEndpointPoliciesRequest, + 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['listEndpointPolicies']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.listEndpointPolicies.asyncIterate( + this.innerApiCalls['listEndpointPolicies'] as GaxCall, + request as {}, + callSettings + ) as AsyncIterable; + } + /** + * Lists Gateways in a given project and location. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The project and location from which the Gateways should be + * listed, specified in the format `projects/* /locations/*`. + * @param {number} request.pageSize + * Maximum number of Gateways to return per call. + * @param {string} request.pageToken + * The value returned by the last `ListGatewaysResponse` + * Indicates that this is a continuation of a prior `ListGateways` call, + * and that the system should return the next page of data. + * @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.networkservices.v1.Gateway|Gateway}. + * 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 `listGatewaysAsync()` + * 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. + */ + listGateways( + request?: protos.google.cloud.networkservices.v1.IListGatewaysRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.networkservices.v1.IGateway[], + protos.google.cloud.networkservices.v1.IListGatewaysRequest | null, + protos.google.cloud.networkservices.v1.IListGatewaysResponse, + ] + >; + listGateways( + request: protos.google.cloud.networkservices.v1.IListGatewaysRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.cloud.networkservices.v1.IListGatewaysRequest, + | protos.google.cloud.networkservices.v1.IListGatewaysResponse + | null + | undefined, + protos.google.cloud.networkservices.v1.IGateway + > + ): void; + listGateways( + request: protos.google.cloud.networkservices.v1.IListGatewaysRequest, + callback: PaginationCallback< + protos.google.cloud.networkservices.v1.IListGatewaysRequest, + | protos.google.cloud.networkservices.v1.IListGatewaysResponse + | null + | undefined, + protos.google.cloud.networkservices.v1.IGateway + > + ): void; + listGateways( + request?: protos.google.cloud.networkservices.v1.IListGatewaysRequest, + optionsOrCallback?: + | CallOptions + | PaginationCallback< + protos.google.cloud.networkservices.v1.IListGatewaysRequest, + | protos.google.cloud.networkservices.v1.IListGatewaysResponse + | null + | undefined, + protos.google.cloud.networkservices.v1.IGateway + >, + callback?: PaginationCallback< + protos.google.cloud.networkservices.v1.IListGatewaysRequest, + | protos.google.cloud.networkservices.v1.IListGatewaysResponse + | null + | undefined, + protos.google.cloud.networkservices.v1.IGateway + > + ): Promise< + [ + protos.google.cloud.networkservices.v1.IGateway[], + protos.google.cloud.networkservices.v1.IListGatewaysRequest | null, + protos.google.cloud.networkservices.v1.IListGatewaysResponse, + ] + > | 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(); + return this.innerApiCalls.listGateways(request, options, callback); + } + + /** + * Equivalent to `method.name.toCamelCase()`, 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 from which the Gateways should be + * listed, specified in the format `projects/* /locations/*`. + * @param {number} request.pageSize + * Maximum number of Gateways to return per call. + * @param {string} request.pageToken + * The value returned by the last `ListGatewaysResponse` + * Indicates that this is a continuation of a prior `ListGateways` call, + * and that the system should return the next page of data. + * @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.networkservices.v1.Gateway|Gateway} 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 `listGatewaysAsync()` + * 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. + */ + listGatewaysStream( + request?: protos.google.cloud.networkservices.v1.IListGatewaysRequest, + 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['listGateways']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.listGateways.createStream( + this.innerApiCalls.listGateways as GaxCall, + request, + callSettings + ); + } + + /** + * Equivalent to `listGateways`, 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 from which the Gateways should be + * listed, specified in the format `projects/* /locations/*`. + * @param {number} request.pageSize + * Maximum number of Gateways to return per call. + * @param {string} request.pageToken + * The value returned by the last `ListGatewaysResponse` + * Indicates that this is a continuation of a prior `ListGateways` call, + * and that the system should return the next page of data. + * @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.networkservices.v1.Gateway|Gateway}. 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/network_services.list_gateways.js + * region_tag:networkservices_v1_generated_NetworkServices_ListGateways_async + */ + listGatewaysAsync( + request?: protos.google.cloud.networkservices.v1.IListGatewaysRequest, + 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['listGateways']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.listGateways.asyncIterate( + this.innerApiCalls['listGateways'] as GaxCall, + request as {}, + callSettings + ) as AsyncIterable; + } + /** + * Lists GrpcRoutes in a given project and location. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The project and location from which the GrpcRoutes should be + * listed, specified in the format `projects/* /locations/global`. + * @param {number} request.pageSize + * Maximum number of GrpcRoutes to return per call. + * @param {string} request.pageToken + * The value returned by the last `ListGrpcRoutesResponse` + * Indicates that this is a continuation of a prior `ListGrpcRoutes` call, + * and that the system should return the next page of data. + * @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.networkservices.v1.GrpcRoute|GrpcRoute}. + * 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 `listGrpcRoutesAsync()` + * 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. + */ + listGrpcRoutes( + request?: protos.google.cloud.networkservices.v1.IListGrpcRoutesRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.networkservices.v1.IGrpcRoute[], + protos.google.cloud.networkservices.v1.IListGrpcRoutesRequest | null, + protos.google.cloud.networkservices.v1.IListGrpcRoutesResponse, + ] + >; + listGrpcRoutes( + request: protos.google.cloud.networkservices.v1.IListGrpcRoutesRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.cloud.networkservices.v1.IListGrpcRoutesRequest, + | protos.google.cloud.networkservices.v1.IListGrpcRoutesResponse + | null + | undefined, + protos.google.cloud.networkservices.v1.IGrpcRoute + > + ): void; + listGrpcRoutes( + request: protos.google.cloud.networkservices.v1.IListGrpcRoutesRequest, + callback: PaginationCallback< + protos.google.cloud.networkservices.v1.IListGrpcRoutesRequest, + | protos.google.cloud.networkservices.v1.IListGrpcRoutesResponse + | null + | undefined, + protos.google.cloud.networkservices.v1.IGrpcRoute + > + ): void; + listGrpcRoutes( + request?: protos.google.cloud.networkservices.v1.IListGrpcRoutesRequest, + optionsOrCallback?: + | CallOptions + | PaginationCallback< + protos.google.cloud.networkservices.v1.IListGrpcRoutesRequest, + | protos.google.cloud.networkservices.v1.IListGrpcRoutesResponse + | null + | undefined, + protos.google.cloud.networkservices.v1.IGrpcRoute + >, + callback?: PaginationCallback< + protos.google.cloud.networkservices.v1.IListGrpcRoutesRequest, + | protos.google.cloud.networkservices.v1.IListGrpcRoutesResponse + | null + | undefined, + protos.google.cloud.networkservices.v1.IGrpcRoute + > + ): Promise< + [ + protos.google.cloud.networkservices.v1.IGrpcRoute[], + protos.google.cloud.networkservices.v1.IListGrpcRoutesRequest | null, + protos.google.cloud.networkservices.v1.IListGrpcRoutesResponse, + ] + > | 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(); + return this.innerApiCalls.listGrpcRoutes(request, options, callback); + } + + /** + * Equivalent to `method.name.toCamelCase()`, 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 from which the GrpcRoutes should be + * listed, specified in the format `projects/* /locations/global`. + * @param {number} request.pageSize + * Maximum number of GrpcRoutes to return per call. + * @param {string} request.pageToken + * The value returned by the last `ListGrpcRoutesResponse` + * Indicates that this is a continuation of a prior `ListGrpcRoutes` call, + * and that the system should return the next page of data. + * @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.networkservices.v1.GrpcRoute|GrpcRoute} 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 `listGrpcRoutesAsync()` + * 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. + */ + listGrpcRoutesStream( + request?: protos.google.cloud.networkservices.v1.IListGrpcRoutesRequest, + 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['listGrpcRoutes']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.listGrpcRoutes.createStream( + this.innerApiCalls.listGrpcRoutes as GaxCall, + request, + callSettings + ); + } + + /** + * Equivalent to `listGrpcRoutes`, 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 from which the GrpcRoutes should be + * listed, specified in the format `projects/* /locations/global`. + * @param {number} request.pageSize + * Maximum number of GrpcRoutes to return per call. + * @param {string} request.pageToken + * The value returned by the last `ListGrpcRoutesResponse` + * Indicates that this is a continuation of a prior `ListGrpcRoutes` call, + * and that the system should return the next page of data. + * @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.networkservices.v1.GrpcRoute|GrpcRoute}. 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/network_services.list_grpc_routes.js + * region_tag:networkservices_v1_generated_NetworkServices_ListGrpcRoutes_async + */ + listGrpcRoutesAsync( + request?: protos.google.cloud.networkservices.v1.IListGrpcRoutesRequest, + 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['listGrpcRoutes']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.listGrpcRoutes.asyncIterate( + this.innerApiCalls['listGrpcRoutes'] as GaxCall, + request as {}, + callSettings + ) as AsyncIterable; + } + /** + * Lists HttpRoute in a given project and location. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The project and location from which the HttpRoutes should be + * listed, specified in the format `projects/* /locations/global`. + * @param {number} request.pageSize + * Maximum number of HttpRoutes to return per call. + * @param {string} request.pageToken + * The value returned by the last `ListHttpRoutesResponse` + * Indicates that this is a continuation of a prior `ListHttpRoutes` call, + * and that the system should return the next page of data. + * @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.networkservices.v1.HttpRoute|HttpRoute}. + * 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 `listHttpRoutesAsync()` + * 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. + */ + listHttpRoutes( + request?: protos.google.cloud.networkservices.v1.IListHttpRoutesRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.networkservices.v1.IHttpRoute[], + protos.google.cloud.networkservices.v1.IListHttpRoutesRequest | null, + protos.google.cloud.networkservices.v1.IListHttpRoutesResponse, + ] + >; + listHttpRoutes( + request: protos.google.cloud.networkservices.v1.IListHttpRoutesRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.cloud.networkservices.v1.IListHttpRoutesRequest, + | protos.google.cloud.networkservices.v1.IListHttpRoutesResponse + | null + | undefined, + protos.google.cloud.networkservices.v1.IHttpRoute + > + ): void; + listHttpRoutes( + request: protos.google.cloud.networkservices.v1.IListHttpRoutesRequest, + callback: PaginationCallback< + protos.google.cloud.networkservices.v1.IListHttpRoutesRequest, + | protos.google.cloud.networkservices.v1.IListHttpRoutesResponse + | null + | undefined, + protos.google.cloud.networkservices.v1.IHttpRoute + > + ): void; + listHttpRoutes( + request?: protos.google.cloud.networkservices.v1.IListHttpRoutesRequest, + optionsOrCallback?: + | CallOptions + | PaginationCallback< + protos.google.cloud.networkservices.v1.IListHttpRoutesRequest, + | protos.google.cloud.networkservices.v1.IListHttpRoutesResponse + | null + | undefined, + protos.google.cloud.networkservices.v1.IHttpRoute + >, + callback?: PaginationCallback< + protos.google.cloud.networkservices.v1.IListHttpRoutesRequest, + | protos.google.cloud.networkservices.v1.IListHttpRoutesResponse + | null + | undefined, + protos.google.cloud.networkservices.v1.IHttpRoute + > + ): Promise< + [ + protos.google.cloud.networkservices.v1.IHttpRoute[], + protos.google.cloud.networkservices.v1.IListHttpRoutesRequest | null, + protos.google.cloud.networkservices.v1.IListHttpRoutesResponse, + ] + > | 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(); + return this.innerApiCalls.listHttpRoutes(request, options, callback); + } + + /** + * Equivalent to `method.name.toCamelCase()`, 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 from which the HttpRoutes should be + * listed, specified in the format `projects/* /locations/global`. + * @param {number} request.pageSize + * Maximum number of HttpRoutes to return per call. + * @param {string} request.pageToken + * The value returned by the last `ListHttpRoutesResponse` + * Indicates that this is a continuation of a prior `ListHttpRoutes` call, + * and that the system should return the next page of data. + * @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.networkservices.v1.HttpRoute|HttpRoute} 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 `listHttpRoutesAsync()` + * 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. + */ + listHttpRoutesStream( + request?: protos.google.cloud.networkservices.v1.IListHttpRoutesRequest, + 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['listHttpRoutes']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.listHttpRoutes.createStream( + this.innerApiCalls.listHttpRoutes as GaxCall, + request, + callSettings + ); + } + + /** + * Equivalent to `listHttpRoutes`, 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 from which the HttpRoutes should be + * listed, specified in the format `projects/* /locations/global`. + * @param {number} request.pageSize + * Maximum number of HttpRoutes to return per call. + * @param {string} request.pageToken + * The value returned by the last `ListHttpRoutesResponse` + * Indicates that this is a continuation of a prior `ListHttpRoutes` call, + * and that the system should return the next page of data. + * @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.networkservices.v1.HttpRoute|HttpRoute}. 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/network_services.list_http_routes.js + * region_tag:networkservices_v1_generated_NetworkServices_ListHttpRoutes_async + */ + listHttpRoutesAsync( + request?: protos.google.cloud.networkservices.v1.IListHttpRoutesRequest, + 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['listHttpRoutes']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.listHttpRoutes.asyncIterate( + this.innerApiCalls['listHttpRoutes'] as GaxCall, + request as {}, + callSettings + ) as AsyncIterable; + } + /** + * Lists TcpRoute in a given project and location. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The project and location from which the TcpRoutes should be + * listed, specified in the format `projects/* /locations/global`. + * @param {number} request.pageSize + * Maximum number of TcpRoutes to return per call. + * @param {string} request.pageToken + * The value returned by the last `ListTcpRoutesResponse` + * Indicates that this is a continuation of a prior `ListTcpRoutes` call, + * and that the system should return the next page of data. + * @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.networkservices.v1.TcpRoute|TcpRoute}. + * 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 `listTcpRoutesAsync()` + * 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. + */ + listTcpRoutes( + request?: protos.google.cloud.networkservices.v1.IListTcpRoutesRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.networkservices.v1.ITcpRoute[], + protos.google.cloud.networkservices.v1.IListTcpRoutesRequest | null, + protos.google.cloud.networkservices.v1.IListTcpRoutesResponse, + ] + >; + listTcpRoutes( + request: protos.google.cloud.networkservices.v1.IListTcpRoutesRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.cloud.networkservices.v1.IListTcpRoutesRequest, + | protos.google.cloud.networkservices.v1.IListTcpRoutesResponse + | null + | undefined, + protos.google.cloud.networkservices.v1.ITcpRoute + > + ): void; + listTcpRoutes( + request: protos.google.cloud.networkservices.v1.IListTcpRoutesRequest, + callback: PaginationCallback< + protos.google.cloud.networkservices.v1.IListTcpRoutesRequest, + | protos.google.cloud.networkservices.v1.IListTcpRoutesResponse + | null + | undefined, + protos.google.cloud.networkservices.v1.ITcpRoute + > + ): void; + listTcpRoutes( + request?: protos.google.cloud.networkservices.v1.IListTcpRoutesRequest, + optionsOrCallback?: + | CallOptions + | PaginationCallback< + protos.google.cloud.networkservices.v1.IListTcpRoutesRequest, + | protos.google.cloud.networkservices.v1.IListTcpRoutesResponse + | null + | undefined, + protos.google.cloud.networkservices.v1.ITcpRoute + >, + callback?: PaginationCallback< + protos.google.cloud.networkservices.v1.IListTcpRoutesRequest, + | protos.google.cloud.networkservices.v1.IListTcpRoutesResponse + | null + | undefined, + protos.google.cloud.networkservices.v1.ITcpRoute + > + ): Promise< + [ + protos.google.cloud.networkservices.v1.ITcpRoute[], + protos.google.cloud.networkservices.v1.IListTcpRoutesRequest | null, + protos.google.cloud.networkservices.v1.IListTcpRoutesResponse, + ] + > | 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(); + return this.innerApiCalls.listTcpRoutes(request, options, callback); + } + + /** + * Equivalent to `method.name.toCamelCase()`, 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 from which the TcpRoutes should be + * listed, specified in the format `projects/* /locations/global`. + * @param {number} request.pageSize + * Maximum number of TcpRoutes to return per call. + * @param {string} request.pageToken + * The value returned by the last `ListTcpRoutesResponse` + * Indicates that this is a continuation of a prior `ListTcpRoutes` call, + * and that the system should return the next page of data. + * @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.networkservices.v1.TcpRoute|TcpRoute} 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 `listTcpRoutesAsync()` + * 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. + */ + listTcpRoutesStream( + request?: protos.google.cloud.networkservices.v1.IListTcpRoutesRequest, + 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['listTcpRoutes']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.listTcpRoutes.createStream( + this.innerApiCalls.listTcpRoutes as GaxCall, + request, + callSettings + ); + } + + /** + * Equivalent to `listTcpRoutes`, 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 from which the TcpRoutes should be + * listed, specified in the format `projects/* /locations/global`. + * @param {number} request.pageSize + * Maximum number of TcpRoutes to return per call. + * @param {string} request.pageToken + * The value returned by the last `ListTcpRoutesResponse` + * Indicates that this is a continuation of a prior `ListTcpRoutes` call, + * and that the system should return the next page of data. + * @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.networkservices.v1.TcpRoute|TcpRoute}. 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/network_services.list_tcp_routes.js + * region_tag:networkservices_v1_generated_NetworkServices_ListTcpRoutes_async + */ + listTcpRoutesAsync( + request?: protos.google.cloud.networkservices.v1.IListTcpRoutesRequest, + 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['listTcpRoutes']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.listTcpRoutes.asyncIterate( + this.innerApiCalls['listTcpRoutes'] as GaxCall, + request as {}, + callSettings + ) as AsyncIterable; + } + /** + * Lists TlsRoute in a given project and location. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The project and location from which the TlsRoutes should be + * listed, specified in the format `projects/* /locations/global`. + * @param {number} request.pageSize + * Maximum number of TlsRoutes to return per call. + * @param {string} request.pageToken + * The value returned by the last `ListTlsRoutesResponse` + * Indicates that this is a continuation of a prior `ListTlsRoutes` call, + * and that the system should return the next page of data. + * @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.networkservices.v1.TlsRoute|TlsRoute}. + * 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 `listTlsRoutesAsync()` + * 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. + */ + listTlsRoutes( + request?: protos.google.cloud.networkservices.v1.IListTlsRoutesRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.networkservices.v1.ITlsRoute[], + protos.google.cloud.networkservices.v1.IListTlsRoutesRequest | null, + protos.google.cloud.networkservices.v1.IListTlsRoutesResponse, + ] + >; + listTlsRoutes( + request: protos.google.cloud.networkservices.v1.IListTlsRoutesRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.cloud.networkservices.v1.IListTlsRoutesRequest, + | protos.google.cloud.networkservices.v1.IListTlsRoutesResponse + | null + | undefined, + protos.google.cloud.networkservices.v1.ITlsRoute + > + ): void; + listTlsRoutes( + request: protos.google.cloud.networkservices.v1.IListTlsRoutesRequest, + callback: PaginationCallback< + protos.google.cloud.networkservices.v1.IListTlsRoutesRequest, + | protos.google.cloud.networkservices.v1.IListTlsRoutesResponse + | null + | undefined, + protos.google.cloud.networkservices.v1.ITlsRoute + > + ): void; + listTlsRoutes( + request?: protos.google.cloud.networkservices.v1.IListTlsRoutesRequest, + optionsOrCallback?: + | CallOptions + | PaginationCallback< + protos.google.cloud.networkservices.v1.IListTlsRoutesRequest, + | protos.google.cloud.networkservices.v1.IListTlsRoutesResponse + | null + | undefined, + protos.google.cloud.networkservices.v1.ITlsRoute + >, + callback?: PaginationCallback< + protos.google.cloud.networkservices.v1.IListTlsRoutesRequest, + | protos.google.cloud.networkservices.v1.IListTlsRoutesResponse + | null + | undefined, + protos.google.cloud.networkservices.v1.ITlsRoute + > + ): Promise< + [ + protos.google.cloud.networkservices.v1.ITlsRoute[], + protos.google.cloud.networkservices.v1.IListTlsRoutesRequest | null, + protos.google.cloud.networkservices.v1.IListTlsRoutesResponse, + ] + > | 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(); + return this.innerApiCalls.listTlsRoutes(request, options, callback); + } + + /** + * Equivalent to `method.name.toCamelCase()`, 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 from which the TlsRoutes should be + * listed, specified in the format `projects/* /locations/global`. + * @param {number} request.pageSize + * Maximum number of TlsRoutes to return per call. + * @param {string} request.pageToken + * The value returned by the last `ListTlsRoutesResponse` + * Indicates that this is a continuation of a prior `ListTlsRoutes` call, + * and that the system should return the next page of data. + * @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.networkservices.v1.TlsRoute|TlsRoute} 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 `listTlsRoutesAsync()` + * 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. + */ + listTlsRoutesStream( + request?: protos.google.cloud.networkservices.v1.IListTlsRoutesRequest, + 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['listTlsRoutes']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.listTlsRoutes.createStream( + this.innerApiCalls.listTlsRoutes as GaxCall, + request, + callSettings + ); + } + + /** + * Equivalent to `listTlsRoutes`, 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 from which the TlsRoutes should be + * listed, specified in the format `projects/* /locations/global`. + * @param {number} request.pageSize + * Maximum number of TlsRoutes to return per call. + * @param {string} request.pageToken + * The value returned by the last `ListTlsRoutesResponse` + * Indicates that this is a continuation of a prior `ListTlsRoutes` call, + * and that the system should return the next page of data. + * @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.networkservices.v1.TlsRoute|TlsRoute}. 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/network_services.list_tls_routes.js + * region_tag:networkservices_v1_generated_NetworkServices_ListTlsRoutes_async + */ + listTlsRoutesAsync( + request?: protos.google.cloud.networkservices.v1.IListTlsRoutesRequest, + 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['listTlsRoutes']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.listTlsRoutes.asyncIterate( + this.innerApiCalls['listTlsRoutes'] as GaxCall, + request as {}, + callSettings + ) as AsyncIterable; + } + /** + * Lists ServiceBinding in a given project and location. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The project and location from which the ServiceBindings should be + * listed, specified in the format `projects/* /locations/global`. + * @param {number} request.pageSize + * Maximum number of ServiceBindings to return per call. + * @param {string} request.pageToken + * The value returned by the last `ListServiceBindingsResponse` + * Indicates that this is a continuation of a prior `ListRouters` call, + * and that the system should return the next page of data. + * @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.networkservices.v1.ServiceBinding|ServiceBinding}. + * 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 `listServiceBindingsAsync()` + * 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. + */ + listServiceBindings( + request?: protos.google.cloud.networkservices.v1.IListServiceBindingsRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.networkservices.v1.IServiceBinding[], + protos.google.cloud.networkservices.v1.IListServiceBindingsRequest | null, + protos.google.cloud.networkservices.v1.IListServiceBindingsResponse, + ] + >; + listServiceBindings( + request: protos.google.cloud.networkservices.v1.IListServiceBindingsRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.cloud.networkservices.v1.IListServiceBindingsRequest, + | protos.google.cloud.networkservices.v1.IListServiceBindingsResponse + | null + | undefined, + protos.google.cloud.networkservices.v1.IServiceBinding + > + ): void; + listServiceBindings( + request: protos.google.cloud.networkservices.v1.IListServiceBindingsRequest, + callback: PaginationCallback< + protos.google.cloud.networkservices.v1.IListServiceBindingsRequest, + | protos.google.cloud.networkservices.v1.IListServiceBindingsResponse + | null + | undefined, + protos.google.cloud.networkservices.v1.IServiceBinding + > + ): void; + listServiceBindings( + request?: protos.google.cloud.networkservices.v1.IListServiceBindingsRequest, + optionsOrCallback?: + | CallOptions + | PaginationCallback< + protos.google.cloud.networkservices.v1.IListServiceBindingsRequest, + | protos.google.cloud.networkservices.v1.IListServiceBindingsResponse + | null + | undefined, + protos.google.cloud.networkservices.v1.IServiceBinding + >, + callback?: PaginationCallback< + protos.google.cloud.networkservices.v1.IListServiceBindingsRequest, + | protos.google.cloud.networkservices.v1.IListServiceBindingsResponse + | null + | undefined, + protos.google.cloud.networkservices.v1.IServiceBinding + > + ): Promise< + [ + protos.google.cloud.networkservices.v1.IServiceBinding[], + protos.google.cloud.networkservices.v1.IListServiceBindingsRequest | null, + protos.google.cloud.networkservices.v1.IListServiceBindingsResponse, + ] + > | 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(); + return this.innerApiCalls.listServiceBindings(request, options, callback); + } + + /** + * Equivalent to `method.name.toCamelCase()`, 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 from which the ServiceBindings should be + * listed, specified in the format `projects/* /locations/global`. + * @param {number} request.pageSize + * Maximum number of ServiceBindings to return per call. + * @param {string} request.pageToken + * The value returned by the last `ListServiceBindingsResponse` + * Indicates that this is a continuation of a prior `ListRouters` call, + * and that the system should return the next page of data. + * @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.networkservices.v1.ServiceBinding|ServiceBinding} 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 `listServiceBindingsAsync()` + * 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. + */ + listServiceBindingsStream( + request?: protos.google.cloud.networkservices.v1.IListServiceBindingsRequest, + 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['listServiceBindings']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.listServiceBindings.createStream( + this.innerApiCalls.listServiceBindings as GaxCall, + request, + callSettings + ); + } + + /** + * Equivalent to `listServiceBindings`, 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 from which the ServiceBindings should be + * listed, specified in the format `projects/* /locations/global`. + * @param {number} request.pageSize + * Maximum number of ServiceBindings to return per call. + * @param {string} request.pageToken + * The value returned by the last `ListServiceBindingsResponse` + * Indicates that this is a continuation of a prior `ListRouters` call, + * and that the system should return the next page of data. + * @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.networkservices.v1.ServiceBinding|ServiceBinding}. 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/network_services.list_service_bindings.js + * region_tag:networkservices_v1_generated_NetworkServices_ListServiceBindings_async + */ + listServiceBindingsAsync( + request?: protos.google.cloud.networkservices.v1.IListServiceBindingsRequest, + 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['listServiceBindings']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.listServiceBindings.asyncIterate( + this.innerApiCalls['listServiceBindings'] as GaxCall, + request as {}, + callSettings + ) as AsyncIterable; + } + /** + * Lists Meshes in a given project and location. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The project and location from which the Meshes should be + * listed, specified in the format `projects/* /locations/global`. + * @param {number} request.pageSize + * Maximum number of Meshes to return per call. + * @param {string} request.pageToken + * The value returned by the last `ListMeshesResponse` + * Indicates that this is a continuation of a prior `ListMeshes` call, + * and that the system should return the next page of data. + * @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.networkservices.v1.Mesh|Mesh}. + * 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 `listMeshesAsync()` + * 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. + */ + listMeshes( + request?: protos.google.cloud.networkservices.v1.IListMeshesRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.networkservices.v1.IMesh[], + protos.google.cloud.networkservices.v1.IListMeshesRequest | null, + protos.google.cloud.networkservices.v1.IListMeshesResponse, + ] + >; + listMeshes( + request: protos.google.cloud.networkservices.v1.IListMeshesRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.cloud.networkservices.v1.IListMeshesRequest, + | protos.google.cloud.networkservices.v1.IListMeshesResponse + | null + | undefined, + protos.google.cloud.networkservices.v1.IMesh + > + ): void; + listMeshes( + request: protos.google.cloud.networkservices.v1.IListMeshesRequest, + callback: PaginationCallback< + protos.google.cloud.networkservices.v1.IListMeshesRequest, + | protos.google.cloud.networkservices.v1.IListMeshesResponse + | null + | undefined, + protos.google.cloud.networkservices.v1.IMesh + > + ): void; + listMeshes( + request?: protos.google.cloud.networkservices.v1.IListMeshesRequest, + optionsOrCallback?: + | CallOptions + | PaginationCallback< + protos.google.cloud.networkservices.v1.IListMeshesRequest, + | protos.google.cloud.networkservices.v1.IListMeshesResponse + | null + | undefined, + protos.google.cloud.networkservices.v1.IMesh + >, + callback?: PaginationCallback< + protos.google.cloud.networkservices.v1.IListMeshesRequest, + | protos.google.cloud.networkservices.v1.IListMeshesResponse + | null + | undefined, + protos.google.cloud.networkservices.v1.IMesh + > + ): Promise< + [ + protos.google.cloud.networkservices.v1.IMesh[], + protos.google.cloud.networkservices.v1.IListMeshesRequest | null, + protos.google.cloud.networkservices.v1.IListMeshesResponse, + ] + > | 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(); + return this.innerApiCalls.listMeshes(request, options, callback); + } + + /** + * Equivalent to `method.name.toCamelCase()`, 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 from which the Meshes should be + * listed, specified in the format `projects/* /locations/global`. + * @param {number} request.pageSize + * Maximum number of Meshes to return per call. + * @param {string} request.pageToken + * The value returned by the last `ListMeshesResponse` + * Indicates that this is a continuation of a prior `ListMeshes` call, + * and that the system should return the next page of data. + * @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.networkservices.v1.Mesh|Mesh} 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 `listMeshesAsync()` + * 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. + */ + listMeshesStream( + request?: protos.google.cloud.networkservices.v1.IListMeshesRequest, + 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['listMeshes']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.listMeshes.createStream( + this.innerApiCalls.listMeshes as GaxCall, + request, + callSettings + ); + } + + /** + * Equivalent to `listMeshes`, 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 from which the Meshes should be + * listed, specified in the format `projects/* /locations/global`. + * @param {number} request.pageSize + * Maximum number of Meshes to return per call. + * @param {string} request.pageToken + * The value returned by the last `ListMeshesResponse` + * Indicates that this is a continuation of a prior `ListMeshes` call, + * and that the system should return the next page of data. + * @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.networkservices.v1.Mesh|Mesh}. 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/network_services.list_meshes.js + * region_tag:networkservices_v1_generated_NetworkServices_ListMeshes_async + */ + listMeshesAsync( + request?: protos.google.cloud.networkservices.v1.IListMeshesRequest, + 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['listMeshes']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.listMeshes.asyncIterate( + this.innerApiCalls['listMeshes'] as GaxCall, + request as {}, + callSettings + ) as AsyncIterable; + } + /** + * Gets the access control policy for a resource. Returns an empty policy + * if the resource exists and does not have a policy set. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.resource + * REQUIRED: The resource for which the policy is being requested. + * See the operation documentation for the appropriate value for this field. + * @param {Object} [request.options] + * OPTIONAL: A `GetPolicyOptions` object for specifying options to + * `GetIamPolicy`. This field is only used by Cloud IAM. + * + * This object should have the same structure as {@link google.iam.v1.GetPolicyOptions | GetPolicyOptions}. + * @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/interfaces/CallOptions.html | 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.iam.v1.Policy | Policy}. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link google.iam.v1.Policy | Policy}. + * The promise has a method named "cancel" which cancels the ongoing API call. + */ + getIamPolicy( + request: IamProtos.google.iam.v1.GetIamPolicyRequest, + options?: + | gax.CallOptions + | Callback< + IamProtos.google.iam.v1.Policy, + IamProtos.google.iam.v1.GetIamPolicyRequest | null | undefined, + {} | null | undefined + >, + callback?: Callback< + IamProtos.google.iam.v1.Policy, + IamProtos.google.iam.v1.GetIamPolicyRequest | null | undefined, + {} | null | undefined + > + ): Promise<[IamProtos.google.iam.v1.Policy]> { + return this.iamClient.getIamPolicy(request, options, callback); + } + + /** + * Returns permissions that a caller has on the specified resource. If the + * resource does not exist, this will return an empty set of + * permissions, not a NOT_FOUND error. + * + * Note: This operation is designed to be used for building + * permission-aware UIs and command-line tools, not for authorization + * checking. This operation may "fail open" without warning. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.resource + * REQUIRED: The resource for which the policy detail is being requested. + * See the operation documentation for the appropriate value for this field. + * @param {string[]} request.permissions + * The set of permissions to check for the `resource`. Permissions with + * wildcards (such as '*' or 'storage.*') are not allowed. For more + * information see {@link https://cloud.google.com/iam/docs/overview#permissions | IAM Overview }. + * @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/interfaces/CallOptions.html | 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.iam.v1.TestIamPermissionsResponse | TestIamPermissionsResponse}. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link google.iam.v1.TestIamPermissionsResponse | TestIamPermissionsResponse}. + * The promise has a method named "cancel" which cancels the ongoing API call. + */ + setIamPolicy( + request: IamProtos.google.iam.v1.SetIamPolicyRequest, + options?: + | gax.CallOptions + | Callback< + IamProtos.google.iam.v1.Policy, + IamProtos.google.iam.v1.SetIamPolicyRequest | null | undefined, + {} | null | undefined + >, + callback?: Callback< + IamProtos.google.iam.v1.Policy, + IamProtos.google.iam.v1.SetIamPolicyRequest | null | undefined, + {} | null | undefined + > + ): Promise<[IamProtos.google.iam.v1.Policy]> { + return this.iamClient.setIamPolicy(request, options, callback); + } + + /** + * Returns permissions that a caller has on the specified resource. If the + * resource does not exist, this will return an empty set of + * permissions, not a NOT_FOUND error. + * + * Note: This operation is designed to be used for building + * permission-aware UIs and command-line tools, not for authorization + * checking. This operation may "fail open" without warning. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.resource + * REQUIRED: The resource for which the policy detail is being requested. + * See the operation documentation for the appropriate value for this field. + * @param {string[]} request.permissions + * The set of permissions to check for the `resource`. Permissions with + * wildcards (such as '*' or 'storage.*') are not allowed. For more + * information see {@link https://cloud.google.com/iam/docs/overview#permissions | IAM Overview }. + * @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/interfaces/CallOptions.html | 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.iam.v1.TestIamPermissionsResponse | TestIamPermissionsResponse}. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link google.iam.v1.TestIamPermissionsResponse | TestIamPermissionsResponse}. + * The promise has a method named "cancel" which cancels the ongoing API call. + * + */ + testIamPermissions( + request: IamProtos.google.iam.v1.TestIamPermissionsRequest, + options?: + | gax.CallOptions + | Callback< + IamProtos.google.iam.v1.TestIamPermissionsResponse, + IamProtos.google.iam.v1.TestIamPermissionsRequest | null | undefined, + {} | null | undefined + >, + callback?: Callback< + IamProtos.google.iam.v1.TestIamPermissionsResponse, + IamProtos.google.iam.v1.TestIamPermissionsRequest | null | undefined, + {} | null | undefined + > + ): Promise<[IamProtos.google.iam.v1.TestIamPermissionsResponse]> { + return this.iamClient.testIamPermissions(request, options, callback); + } + + /** + * 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, + options?: + | 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]> { + 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 { + 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, + options?: + | gax.CallOptions + | Callback< + protos.google.protobuf.Empty, + protos.google.longrunning.CancelOperationRequest, + {} | undefined | null + >, + callback?: Callback< + protos.google.longrunning.CancelOperationRequest, + protos.google.protobuf.Empty, + {} | undefined | null + > + ): Promise { + 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, + options?: + | 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 { + return this.operationsClient.deleteOperation(request, options, callback); + } + + // -------------------- + // -- Path templates -- + // -------------------- + + /** + * Return a fully-qualified endpointPolicy resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} endpoint_policy + * @returns {string} Resource name string. + */ + endpointPolicyPath( + project: string, + location: string, + endpointPolicy: string + ) { + return this.pathTemplates.endpointPolicyPathTemplate.render({ + project: project, + location: location, + endpoint_policy: endpointPolicy, + }); + } + + /** + * Parse the project from EndpointPolicy resource. + * + * @param {string} endpointPolicyName + * A fully-qualified path representing EndpointPolicy resource. + * @returns {string} A string representing the project. + */ + matchProjectFromEndpointPolicyName(endpointPolicyName: string) { + return this.pathTemplates.endpointPolicyPathTemplate.match( + endpointPolicyName + ).project; + } + + /** + * Parse the location from EndpointPolicy resource. + * + * @param {string} endpointPolicyName + * A fully-qualified path representing EndpointPolicy resource. + * @returns {string} A string representing the location. + */ + matchLocationFromEndpointPolicyName(endpointPolicyName: string) { + return this.pathTemplates.endpointPolicyPathTemplate.match( + endpointPolicyName + ).location; + } + + /** + * Parse the endpoint_policy from EndpointPolicy resource. + * + * @param {string} endpointPolicyName + * A fully-qualified path representing EndpointPolicy resource. + * @returns {string} A string representing the endpoint_policy. + */ + matchEndpointPolicyFromEndpointPolicyName(endpointPolicyName: string) { + return this.pathTemplates.endpointPolicyPathTemplate.match( + endpointPolicyName + ).endpoint_policy; + } + + /** + * Return a fully-qualified gateway resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} gateway + * @returns {string} Resource name string. + */ + gatewayPath(project: string, location: string, gateway: string) { + return this.pathTemplates.gatewayPathTemplate.render({ + project: project, + location: location, + gateway: gateway, + }); + } + + /** + * Parse the project from Gateway resource. + * + * @param {string} gatewayName + * A fully-qualified path representing Gateway resource. + * @returns {string} A string representing the project. + */ + matchProjectFromGatewayName(gatewayName: string) { + return this.pathTemplates.gatewayPathTemplate.match(gatewayName).project; + } + + /** + * Parse the location from Gateway resource. + * + * @param {string} gatewayName + * A fully-qualified path representing Gateway resource. + * @returns {string} A string representing the location. + */ + matchLocationFromGatewayName(gatewayName: string) { + return this.pathTemplates.gatewayPathTemplate.match(gatewayName).location; + } + + /** + * Parse the gateway from Gateway resource. + * + * @param {string} gatewayName + * A fully-qualified path representing Gateway resource. + * @returns {string} A string representing the gateway. + */ + matchGatewayFromGatewayName(gatewayName: string) { + return this.pathTemplates.gatewayPathTemplate.match(gatewayName).gateway; + } + + /** + * Return a fully-qualified grpcRoute resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} grpc_route + * @returns {string} Resource name string. + */ + grpcRoutePath(project: string, location: string, grpcRoute: string) { + return this.pathTemplates.grpcRoutePathTemplate.render({ + project: project, + location: location, + grpc_route: grpcRoute, + }); + } + + /** + * Parse the project from GrpcRoute resource. + * + * @param {string} grpcRouteName + * A fully-qualified path representing GrpcRoute resource. + * @returns {string} A string representing the project. + */ + matchProjectFromGrpcRouteName(grpcRouteName: string) { + return this.pathTemplates.grpcRoutePathTemplate.match(grpcRouteName) + .project; + } + + /** + * Parse the location from GrpcRoute resource. + * + * @param {string} grpcRouteName + * A fully-qualified path representing GrpcRoute resource. + * @returns {string} A string representing the location. + */ + matchLocationFromGrpcRouteName(grpcRouteName: string) { + return this.pathTemplates.grpcRoutePathTemplate.match(grpcRouteName) + .location; + } + + /** + * Parse the grpc_route from GrpcRoute resource. + * + * @param {string} grpcRouteName + * A fully-qualified path representing GrpcRoute resource. + * @returns {string} A string representing the grpc_route. + */ + matchGrpcRouteFromGrpcRouteName(grpcRouteName: string) { + return this.pathTemplates.grpcRoutePathTemplate.match(grpcRouteName) + .grpc_route; + } + + /** + * Return a fully-qualified httpRoute resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} http_route + * @returns {string} Resource name string. + */ + httpRoutePath(project: string, location: string, httpRoute: string) { + return this.pathTemplates.httpRoutePathTemplate.render({ + project: project, + location: location, + http_route: httpRoute, + }); + } + + /** + * Parse the project from HttpRoute resource. + * + * @param {string} httpRouteName + * A fully-qualified path representing HttpRoute resource. + * @returns {string} A string representing the project. + */ + matchProjectFromHttpRouteName(httpRouteName: string) { + return this.pathTemplates.httpRoutePathTemplate.match(httpRouteName) + .project; + } + + /** + * Parse the location from HttpRoute resource. + * + * @param {string} httpRouteName + * A fully-qualified path representing HttpRoute resource. + * @returns {string} A string representing the location. + */ + matchLocationFromHttpRouteName(httpRouteName: string) { + return this.pathTemplates.httpRoutePathTemplate.match(httpRouteName) + .location; + } + + /** + * Parse the http_route from HttpRoute resource. + * + * @param {string} httpRouteName + * A fully-qualified path representing HttpRoute resource. + * @returns {string} A string representing the http_route. + */ + matchHttpRouteFromHttpRouteName(httpRouteName: string) { + return this.pathTemplates.httpRoutePathTemplate.match(httpRouteName) + .http_route; + } + + /** + * Return a fully-qualified mesh resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} mesh + * @returns {string} Resource name string. + */ + meshPath(project: string, location: string, mesh: string) { + return this.pathTemplates.meshPathTemplate.render({ + project: project, + location: location, + mesh: mesh, + }); + } + + /** + * Parse the project from Mesh resource. + * + * @param {string} meshName + * A fully-qualified path representing Mesh resource. + * @returns {string} A string representing the project. + */ + matchProjectFromMeshName(meshName: string) { + return this.pathTemplates.meshPathTemplate.match(meshName).project; + } + + /** + * Parse the location from Mesh resource. + * + * @param {string} meshName + * A fully-qualified path representing Mesh resource. + * @returns {string} A string representing the location. + */ + matchLocationFromMeshName(meshName: string) { + return this.pathTemplates.meshPathTemplate.match(meshName).location; + } + + /** + * Parse the mesh from Mesh resource. + * + * @param {string} meshName + * A fully-qualified path representing Mesh resource. + * @returns {string} A string representing the mesh. + */ + matchMeshFromMeshName(meshName: string) { + return this.pathTemplates.meshPathTemplate.match(meshName).mesh; + } + + /** + * Return a fully-qualified serviceBinding resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} service_binding + * @returns {string} Resource name string. + */ + serviceBindingPath( + project: string, + location: string, + serviceBinding: string + ) { + return this.pathTemplates.serviceBindingPathTemplate.render({ + project: project, + location: location, + service_binding: serviceBinding, + }); + } + + /** + * Parse the project from ServiceBinding resource. + * + * @param {string} serviceBindingName + * A fully-qualified path representing ServiceBinding resource. + * @returns {string} A string representing the project. + */ + matchProjectFromServiceBindingName(serviceBindingName: string) { + return this.pathTemplates.serviceBindingPathTemplate.match( + serviceBindingName + ).project; + } + + /** + * Parse the location from ServiceBinding resource. + * + * @param {string} serviceBindingName + * A fully-qualified path representing ServiceBinding resource. + * @returns {string} A string representing the location. + */ + matchLocationFromServiceBindingName(serviceBindingName: string) { + return this.pathTemplates.serviceBindingPathTemplate.match( + serviceBindingName + ).location; + } + + /** + * Parse the service_binding from ServiceBinding resource. + * + * @param {string} serviceBindingName + * A fully-qualified path representing ServiceBinding resource. + * @returns {string} A string representing the service_binding. + */ + matchServiceBindingFromServiceBindingName(serviceBindingName: string) { + return this.pathTemplates.serviceBindingPathTemplate.match( + serviceBindingName + ).service_binding; + } + + /** + * Return a fully-qualified tcpRoute resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} tcp_route + * @returns {string} Resource name string. + */ + tcpRoutePath(project: string, location: string, tcpRoute: string) { + return this.pathTemplates.tcpRoutePathTemplate.render({ + project: project, + location: location, + tcp_route: tcpRoute, + }); + } + + /** + * Parse the project from TcpRoute resource. + * + * @param {string} tcpRouteName + * A fully-qualified path representing TcpRoute resource. + * @returns {string} A string representing the project. + */ + matchProjectFromTcpRouteName(tcpRouteName: string) { + return this.pathTemplates.tcpRoutePathTemplate.match(tcpRouteName).project; + } + + /** + * Parse the location from TcpRoute resource. + * + * @param {string} tcpRouteName + * A fully-qualified path representing TcpRoute resource. + * @returns {string} A string representing the location. + */ + matchLocationFromTcpRouteName(tcpRouteName: string) { + return this.pathTemplates.tcpRoutePathTemplate.match(tcpRouteName).location; + } + + /** + * Parse the tcp_route from TcpRoute resource. + * + * @param {string} tcpRouteName + * A fully-qualified path representing TcpRoute resource. + * @returns {string} A string representing the tcp_route. + */ + matchTcpRouteFromTcpRouteName(tcpRouteName: string) { + return this.pathTemplates.tcpRoutePathTemplate.match(tcpRouteName) + .tcp_route; + } + + /** + * Return a fully-qualified tlsRoute resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} tls_route + * @returns {string} Resource name string. + */ + tlsRoutePath(project: string, location: string, tlsRoute: string) { + return this.pathTemplates.tlsRoutePathTemplate.render({ + project: project, + location: location, + tls_route: tlsRoute, + }); + } + + /** + * Parse the project from TlsRoute resource. + * + * @param {string} tlsRouteName + * A fully-qualified path representing TlsRoute resource. + * @returns {string} A string representing the project. + */ + matchProjectFromTlsRouteName(tlsRouteName: string) { + return this.pathTemplates.tlsRoutePathTemplate.match(tlsRouteName).project; + } + + /** + * Parse the location from TlsRoute resource. + * + * @param {string} tlsRouteName + * A fully-qualified path representing TlsRoute resource. + * @returns {string} A string representing the location. + */ + matchLocationFromTlsRouteName(tlsRouteName: string) { + return this.pathTemplates.tlsRoutePathTemplate.match(tlsRouteName).location; + } + + /** + * Parse the tls_route from TlsRoute resource. + * + * @param {string} tlsRouteName + * A fully-qualified path representing TlsRoute resource. + * @returns {string} A string representing the tls_route. + */ + matchTlsRouteFromTlsRouteName(tlsRouteName: string) { + return this.pathTemplates.tlsRoutePathTemplate.match(tlsRouteName) + .tls_route; + } + + /** + * 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.networkServicesStub && !this._terminated) { + return this.networkServicesStub.then(stub => { + this._terminated = true; + stub.close(); + this.iamClient.close(); + this.locationsClient.close(); + this.operationsClient.close(); + }); + } + return Promise.resolve(); + } +} diff --git a/packages/google-cloud-networkservices/src/v1/network_services_client_config.json b/packages/google-cloud-networkservices/src/v1/network_services_client_config.json new file mode 100644 index 00000000000..1304b7a5a95 --- /dev/null +++ b/packages/google-cloud-networkservices/src/v1/network_services_client_config.json @@ -0,0 +1,221 @@ +{ + "interfaces": { + "google.cloud.networkservices.v1.NetworkServices": { + "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": { + "ListEndpointPolicies": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "GetEndpointPolicy": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "CreateEndpointPolicy": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "UpdateEndpointPolicy": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "DeleteEndpointPolicy": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "ListGateways": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "GetGateway": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "CreateGateway": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "UpdateGateway": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "DeleteGateway": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "ListGrpcRoutes": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "GetGrpcRoute": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "CreateGrpcRoute": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "UpdateGrpcRoute": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "DeleteGrpcRoute": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "ListHttpRoutes": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "GetHttpRoute": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "CreateHttpRoute": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "UpdateHttpRoute": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "DeleteHttpRoute": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "ListTcpRoutes": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "GetTcpRoute": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "CreateTcpRoute": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "UpdateTcpRoute": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "DeleteTcpRoute": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "ListTlsRoutes": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "GetTlsRoute": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "CreateTlsRoute": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "UpdateTlsRoute": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "DeleteTlsRoute": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "ListServiceBindings": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "GetServiceBinding": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "CreateServiceBinding": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "DeleteServiceBinding": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "ListMeshes": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "GetMesh": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "CreateMesh": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "UpdateMesh": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "DeleteMesh": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + } + } + } + } +} diff --git a/packages/google-cloud-networkservices/src/v1/network_services_proto_list.json b/packages/google-cloud-networkservices/src/v1/network_services_proto_list.json new file mode 100644 index 00000000000..89827544b7c --- /dev/null +++ b/packages/google-cloud-networkservices/src/v1/network_services_proto_list.json @@ -0,0 +1,12 @@ +[ + "../../protos/google/cloud/networkservices/v1/common.proto", + "../../protos/google/cloud/networkservices/v1/endpoint_policy.proto", + "../../protos/google/cloud/networkservices/v1/gateway.proto", + "../../protos/google/cloud/networkservices/v1/grpc_route.proto", + "../../protos/google/cloud/networkservices/v1/http_route.proto", + "../../protos/google/cloud/networkservices/v1/mesh.proto", + "../../protos/google/cloud/networkservices/v1/network_services.proto", + "../../protos/google/cloud/networkservices/v1/service_binding.proto", + "../../protos/google/cloud/networkservices/v1/tcp_route.proto", + "../../protos/google/cloud/networkservices/v1/tls_route.proto" +] diff --git a/packages/google-cloud-networkservices/src/v1beta1/gapic_metadata.json b/packages/google-cloud-networkservices/src/v1beta1/gapic_metadata.json new file mode 100644 index 00000000000..3e42b4d1c2f --- /dev/null +++ b/packages/google-cloud-networkservices/src/v1beta1/gapic_metadata.json @@ -0,0 +1,77 @@ +{ + "schema": "1.0", + "comment": "This file maps proto services/RPCs to the corresponding library clients/methods", + "language": "typescript", + "protoPackage": "google.cloud.networkservices.v1beta1", + "libraryPackage": "@google-cloud/networkservices", + "services": { + "NetworkServices": { + "clients": { + "grpc": { + "libraryClient": "NetworkServicesClient", + "rpcs": { + "GetEndpointPolicy": { + "methods": [ + "getEndpointPolicy" + ] + }, + "CreateEndpointPolicy": { + "methods": [ + "createEndpointPolicy" + ] + }, + "UpdateEndpointPolicy": { + "methods": [ + "updateEndpointPolicy" + ] + }, + "DeleteEndpointPolicy": { + "methods": [ + "deleteEndpointPolicy" + ] + }, + "ListEndpointPolicies": { + "methods": [ + "listEndpointPolicies", + "listEndpointPoliciesStream", + "listEndpointPoliciesAsync" + ] + } + } + }, + "grpc-fallback": { + "libraryClient": "NetworkServicesClient", + "rpcs": { + "GetEndpointPolicy": { + "methods": [ + "getEndpointPolicy" + ] + }, + "CreateEndpointPolicy": { + "methods": [ + "createEndpointPolicy" + ] + }, + "UpdateEndpointPolicy": { + "methods": [ + "updateEndpointPolicy" + ] + }, + "DeleteEndpointPolicy": { + "methods": [ + "deleteEndpointPolicy" + ] + }, + "ListEndpointPolicies": { + "methods": [ + "listEndpointPolicies", + "listEndpointPoliciesStream", + "listEndpointPoliciesAsync" + ] + } + } + } + } + } + } +} diff --git a/packages/google-cloud-networkservices/src/v1beta1/index.ts b/packages/google-cloud-networkservices/src/v1beta1/index.ts new file mode 100644 index 00000000000..fe730d7e88e --- /dev/null +++ b/packages/google-cloud-networkservices/src/v1beta1/index.ts @@ -0,0 +1,19 @@ +// Copyright 2023 Google LLC +// +// Licensed under the Apache License, Version 2.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 {NetworkServicesClient} from './network_services_client'; diff --git a/packages/google-cloud-networkservices/src/v1beta1/network_services_client.ts b/packages/google-cloud-networkservices/src/v1beta1/network_services_client.ts new file mode 100644 index 00000000000..5644fda0323 --- /dev/null +++ b/packages/google-cloud-networkservices/src/v1beta1/network_services_client.ts @@ -0,0 +1,1228 @@ +// Copyright 2023 Google LLC +// +// Licensed under the Apache License, Version 2.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, +} from 'google-gax'; +import {Transform} from 'stream'; +import * as protos from '../../protos/protos'; +import jsonProtos = require('../../protos/protos.json'); +/** + * Client JSON configuration object, loaded from + * `src/v1beta1/network_services_client_config.json`. + * This file defines retry strategy and timeouts for all API methods in this library. + */ +import * as gapicConfig from './network_services_client_config.json'; +const version = require('../../../package.json').version; + +/** + * @class + * @memberof v1beta1 + */ +export class NetworkServicesClient { + 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}; + 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; + networkServicesStub?: Promise<{[name: string]: Function}>; + + /** + * Construct an instance of NetworkServicesClient. + * + * @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://developers.google.com/identity/protocols/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 NetworkServicesClient({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 NetworkServicesClient; + const servicePath = + opts?.servicePath || opts?.apiEndpoint || staticMembers.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 !== staticMembers.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 = staticMembers.servicePath; + + // Set the default scopes in auth client if needed. + if (servicePath === staticMembers.servicePath) { + this.auth.defaultScopes = staticMembers.scopes; + } + + // Determine the client header string. + const clientHeader = [`gax/${this._gaxModule.version}`, `gapic/${version}`]; + if (typeof process !== 'undefined' && '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 = { + endpointPolicyPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/endpointPolicies/{endpoint_policy}' + ), + }; + + // 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 = { + listEndpointPolicies: new this._gaxModule.PageDescriptor( + 'pageToken', + 'nextPageToken', + 'endpointPolicies' + ), + }; + + const protoFilesRoot = this._gaxModule.protobuf.Root.fromJSON(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: '/v1beta1/{name=projects/*/locations/*}', + }, + { + selector: 'google.cloud.location.Locations.ListLocations', + get: '/v1beta1/{name=projects/*}/locations', + }, + { + selector: 'google.iam.v1.IAMPolicy.GetIamPolicy', + get: '/v1beta1/{resource=projects/*/locations/*/endpointPolicies/*}:getIamPolicy', + }, + { + selector: 'google.iam.v1.IAMPolicy.SetIamPolicy', + post: '/v1beta1/{resource=projects/*/locations/*/endpointPolicies/*}:setIamPolicy', + body: '*', + }, + { + selector: 'google.iam.v1.IAMPolicy.TestIamPermissions', + post: '/v1beta1/{resource=projects/*/locations/*/endpointPolicies/*}:testIamPermissions', + body: '*', + }, + { + selector: 'google.longrunning.Operations.CancelOperation', + post: '/v1beta1/{name=projects/*/locations/*/operations/*}:cancel', + body: '*', + }, + { + selector: 'google.longrunning.Operations.DeleteOperation', + delete: '/v1beta1/{name=projects/*/locations/*/operations/*}', + }, + { + selector: 'google.longrunning.Operations.GetOperation', + get: '/v1beta1/{name=projects/*/locations/*/operations/*}', + }, + { + selector: 'google.longrunning.Operations.ListOperations', + get: '/v1beta1/{name=projects/*/locations/*}/operations', + }, + ]; + } + this.operationsClient = this._gaxModule + .lro(lroOptions) + .operationsClient(opts); + const createEndpointPolicyResponse = protoFilesRoot.lookup( + '.google.cloud.networkservices.v1beta1.EndpointPolicy' + ) as gax.protobuf.Type; + const createEndpointPolicyMetadata = protoFilesRoot.lookup( + '.google.cloud.networkservices.v1beta1.OperationMetadata' + ) as gax.protobuf.Type; + const updateEndpointPolicyResponse = protoFilesRoot.lookup( + '.google.cloud.networkservices.v1beta1.EndpointPolicy' + ) as gax.protobuf.Type; + const updateEndpointPolicyMetadata = protoFilesRoot.lookup( + '.google.cloud.networkservices.v1beta1.OperationMetadata' + ) as gax.protobuf.Type; + const deleteEndpointPolicyResponse = protoFilesRoot.lookup( + '.google.protobuf.Empty' + ) as gax.protobuf.Type; + const deleteEndpointPolicyMetadata = protoFilesRoot.lookup( + '.google.cloud.networkservices.v1beta1.OperationMetadata' + ) as gax.protobuf.Type; + + this.descriptors.longrunning = { + createEndpointPolicy: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + createEndpointPolicyResponse.decode.bind(createEndpointPolicyResponse), + createEndpointPolicyMetadata.decode.bind(createEndpointPolicyMetadata) + ), + updateEndpointPolicy: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + updateEndpointPolicyResponse.decode.bind(updateEndpointPolicyResponse), + updateEndpointPolicyMetadata.decode.bind(updateEndpointPolicyMetadata) + ), + deleteEndpointPolicy: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + deleteEndpointPolicyResponse.decode.bind(deleteEndpointPolicyResponse), + deleteEndpointPolicyMetadata.decode.bind(deleteEndpointPolicyMetadata) + ), + }; + + // Put together the default options sent with requests. + this._defaults = this._gaxGrpc.constructSettings( + 'google.cloud.networkservices.v1beta1.NetworkServices', + 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.networkServicesStub) { + return this.networkServicesStub; + } + + // Put together the "service stub" for + // google.cloud.networkservices.v1beta1.NetworkServices. + this.networkServicesStub = this._gaxGrpc.createStub( + this._opts.fallback + ? (this._protos as protobuf.Root).lookupService( + 'google.cloud.networkservices.v1beta1.NetworkServices' + ) + : // eslint-disable-next-line @typescript-eslint/no-explicit-any + (this._protos as any).google.cloud.networkservices.v1beta1 + .NetworkServices, + 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 networkServicesStubMethods = [ + 'listEndpointPolicies', + 'getEndpointPolicy', + 'createEndpointPolicy', + 'updateEndpointPolicy', + 'deleteEndpointPolicy', + ]; + for (const methodName of networkServicesStubMethods) { + const callPromise = this.networkServicesStub.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] || + this.descriptors.longrunning[methodName] || + undefined; + const apiCall = this._gaxModule.createApiCall( + callPromise, + this._defaults[methodName], + descriptor, + this._opts.fallback + ); + + this.innerApiCalls[methodName] = apiCall; + } + + return this.networkServicesStub; + } + + /** + * The DNS address for this API service. + * @returns {string} The DNS address for this service. + */ + static get servicePath() { + return 'networkservices.googleapis.com'; + } + + /** + * The DNS address for this API service - same as servicePath(), + * exists for compatibility reasons. + * @returns {string} The DNS address for this service. + */ + static get apiEndpoint() { + return 'networkservices.googleapis.com'; + } + + /** + * 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 -- + // ------------------- + /** + * Gets details of a single EndpointPolicy. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. A name of the EndpointPolicy to get. Must be in the format + * `projects/* /locations/global/endpointPolicies/*`. + * @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.networkservices.v1beta1.EndpointPolicy|EndpointPolicy}. + * 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/v1beta1/network_services.get_endpoint_policy.js + * region_tag:networkservices_v1beta1_generated_NetworkServices_GetEndpointPolicy_async + */ + getEndpointPolicy( + request?: protos.google.cloud.networkservices.v1beta1.IGetEndpointPolicyRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.networkservices.v1beta1.IEndpointPolicy, + ( + | protos.google.cloud.networkservices.v1beta1.IGetEndpointPolicyRequest + | undefined + ), + {} | undefined, + ] + >; + getEndpointPolicy( + request: protos.google.cloud.networkservices.v1beta1.IGetEndpointPolicyRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.networkservices.v1beta1.IEndpointPolicy, + | protos.google.cloud.networkservices.v1beta1.IGetEndpointPolicyRequest + | null + | undefined, + {} | null | undefined + > + ): void; + getEndpointPolicy( + request: protos.google.cloud.networkservices.v1beta1.IGetEndpointPolicyRequest, + callback: Callback< + protos.google.cloud.networkservices.v1beta1.IEndpointPolicy, + | protos.google.cloud.networkservices.v1beta1.IGetEndpointPolicyRequest + | null + | undefined, + {} | null | undefined + > + ): void; + getEndpointPolicy( + request?: protos.google.cloud.networkservices.v1beta1.IGetEndpointPolicyRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.networkservices.v1beta1.IEndpointPolicy, + | protos.google.cloud.networkservices.v1beta1.IGetEndpointPolicyRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.networkservices.v1beta1.IEndpointPolicy, + | protos.google.cloud.networkservices.v1beta1.IGetEndpointPolicyRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.networkservices.v1beta1.IEndpointPolicy, + ( + | protos.google.cloud.networkservices.v1beta1.IGetEndpointPolicyRequest + | 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(); + return this.innerApiCalls.getEndpointPolicy(request, options, callback); + } + + /** + * Creates a new EndpointPolicy in a given project and location. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The parent resource of the EndpointPolicy. Must be in the + * format `projects/* /locations/global`. + * @param {string} request.endpointPolicyId + * Required. Short name of the EndpointPolicy resource to be created. + * E.g. "CustomECS". + * @param {google.cloud.networkservices.v1beta1.EndpointPolicy} request.endpointPolicy + * Required. EndpointPolicy resource to be created. + * @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/v1beta1/network_services.create_endpoint_policy.js + * region_tag:networkservices_v1beta1_generated_NetworkServices_CreateEndpointPolicy_async + */ + createEndpointPolicy( + request?: protos.google.cloud.networkservices.v1beta1.ICreateEndpointPolicyRequest, + options?: CallOptions + ): Promise< + [ + LROperation< + protos.google.cloud.networkservices.v1beta1.IEndpointPolicy, + protos.google.cloud.networkservices.v1beta1.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined, + ] + >; + createEndpointPolicy( + request: protos.google.cloud.networkservices.v1beta1.ICreateEndpointPolicyRequest, + options: CallOptions, + callback: Callback< + LROperation< + protos.google.cloud.networkservices.v1beta1.IEndpointPolicy, + protos.google.cloud.networkservices.v1beta1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + createEndpointPolicy( + request: protos.google.cloud.networkservices.v1beta1.ICreateEndpointPolicyRequest, + callback: Callback< + LROperation< + protos.google.cloud.networkservices.v1beta1.IEndpointPolicy, + protos.google.cloud.networkservices.v1beta1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + createEndpointPolicy( + request?: protos.google.cloud.networkservices.v1beta1.ICreateEndpointPolicyRequest, + optionsOrCallback?: + | CallOptions + | Callback< + LROperation< + protos.google.cloud.networkservices.v1beta1.IEndpointPolicy, + protos.google.cloud.networkservices.v1beta1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + callback?: Callback< + LROperation< + protos.google.cloud.networkservices.v1beta1.IEndpointPolicy, + protos.google.cloud.networkservices.v1beta1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): Promise< + [ + LROperation< + protos.google.cloud.networkservices.v1beta1.IEndpointPolicy, + protos.google.cloud.networkservices.v1beta1.IOperationMetadata + >, + 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(); + return this.innerApiCalls.createEndpointPolicy(request, options, callback); + } + /** + * Check the status of the long running operation returned by `createEndpointPolicy()`. + * @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/v1beta1/network_services.create_endpoint_policy.js + * region_tag:networkservices_v1beta1_generated_NetworkServices_CreateEndpointPolicy_async + */ + async checkCreateEndpointPolicyProgress( + name: string + ): Promise< + LROperation< + protos.google.cloud.networkservices.v1beta1.EndpointPolicy, + protos.google.cloud.networkservices.v1beta1.OperationMetadata + > + > { + 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.createEndpointPolicy, + this._gaxModule.createDefaultBackoffSettings() + ); + return decodeOperation as LROperation< + protos.google.cloud.networkservices.v1beta1.EndpointPolicy, + protos.google.cloud.networkservices.v1beta1.OperationMetadata + >; + } + /** + * Updates the parameters of a single EndpointPolicy. + * + * @param {Object} request + * The request object that will be sent. + * @param {google.protobuf.FieldMask} [request.updateMask] + * Optional. Field mask is used to specify the fields to be overwritten in the + * EndpointPolicy resource by the update. + * The fields specified in the update_mask are relative to the resource, not + * the full request. A field will be overwritten if it is in the mask. If the + * user does not provide a mask then all fields will be overwritten. + * @param {google.cloud.networkservices.v1beta1.EndpointPolicy} request.endpointPolicy + * Required. Updated EndpointPolicy resource. + * @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/v1beta1/network_services.update_endpoint_policy.js + * region_tag:networkservices_v1beta1_generated_NetworkServices_UpdateEndpointPolicy_async + */ + updateEndpointPolicy( + request?: protos.google.cloud.networkservices.v1beta1.IUpdateEndpointPolicyRequest, + options?: CallOptions + ): Promise< + [ + LROperation< + protos.google.cloud.networkservices.v1beta1.IEndpointPolicy, + protos.google.cloud.networkservices.v1beta1.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined, + ] + >; + updateEndpointPolicy( + request: protos.google.cloud.networkservices.v1beta1.IUpdateEndpointPolicyRequest, + options: CallOptions, + callback: Callback< + LROperation< + protos.google.cloud.networkservices.v1beta1.IEndpointPolicy, + protos.google.cloud.networkservices.v1beta1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + updateEndpointPolicy( + request: protos.google.cloud.networkservices.v1beta1.IUpdateEndpointPolicyRequest, + callback: Callback< + LROperation< + protos.google.cloud.networkservices.v1beta1.IEndpointPolicy, + protos.google.cloud.networkservices.v1beta1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + updateEndpointPolicy( + request?: protos.google.cloud.networkservices.v1beta1.IUpdateEndpointPolicyRequest, + optionsOrCallback?: + | CallOptions + | Callback< + LROperation< + protos.google.cloud.networkservices.v1beta1.IEndpointPolicy, + protos.google.cloud.networkservices.v1beta1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + callback?: Callback< + LROperation< + protos.google.cloud.networkservices.v1beta1.IEndpointPolicy, + protos.google.cloud.networkservices.v1beta1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): Promise< + [ + LROperation< + protos.google.cloud.networkservices.v1beta1.IEndpointPolicy, + protos.google.cloud.networkservices.v1beta1.IOperationMetadata + >, + 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({ + 'endpoint_policy.name': request.endpointPolicy!.name ?? '', + }); + this.initialize(); + return this.innerApiCalls.updateEndpointPolicy(request, options, callback); + } + /** + * Check the status of the long running operation returned by `updateEndpointPolicy()`. + * @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/v1beta1/network_services.update_endpoint_policy.js + * region_tag:networkservices_v1beta1_generated_NetworkServices_UpdateEndpointPolicy_async + */ + async checkUpdateEndpointPolicyProgress( + name: string + ): Promise< + LROperation< + protos.google.cloud.networkservices.v1beta1.EndpointPolicy, + protos.google.cloud.networkservices.v1beta1.OperationMetadata + > + > { + 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.updateEndpointPolicy, + this._gaxModule.createDefaultBackoffSettings() + ); + return decodeOperation as LROperation< + protos.google.cloud.networkservices.v1beta1.EndpointPolicy, + protos.google.cloud.networkservices.v1beta1.OperationMetadata + >; + } + /** + * Deletes a single EndpointPolicy. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. A name of the EndpointPolicy to delete. Must be in the format + * `projects/* /locations/global/endpointPolicies/*`. + * @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/v1beta1/network_services.delete_endpoint_policy.js + * region_tag:networkservices_v1beta1_generated_NetworkServices_DeleteEndpointPolicy_async + */ + deleteEndpointPolicy( + request?: protos.google.cloud.networkservices.v1beta1.IDeleteEndpointPolicyRequest, + options?: CallOptions + ): Promise< + [ + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.networkservices.v1beta1.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined, + ] + >; + deleteEndpointPolicy( + request: protos.google.cloud.networkservices.v1beta1.IDeleteEndpointPolicyRequest, + options: CallOptions, + callback: Callback< + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.networkservices.v1beta1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + deleteEndpointPolicy( + request: protos.google.cloud.networkservices.v1beta1.IDeleteEndpointPolicyRequest, + callback: Callback< + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.networkservices.v1beta1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + deleteEndpointPolicy( + request?: protos.google.cloud.networkservices.v1beta1.IDeleteEndpointPolicyRequest, + optionsOrCallback?: + | CallOptions + | Callback< + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.networkservices.v1beta1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + callback?: Callback< + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.networkservices.v1beta1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): Promise< + [ + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.networkservices.v1beta1.IOperationMetadata + >, + 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(); + return this.innerApiCalls.deleteEndpointPolicy(request, options, callback); + } + /** + * Check the status of the long running operation returned by `deleteEndpointPolicy()`. + * @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/v1beta1/network_services.delete_endpoint_policy.js + * region_tag:networkservices_v1beta1_generated_NetworkServices_DeleteEndpointPolicy_async + */ + async checkDeleteEndpointPolicyProgress( + name: string + ): Promise< + LROperation< + protos.google.protobuf.Empty, + protos.google.cloud.networkservices.v1beta1.OperationMetadata + > + > { + 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.deleteEndpointPolicy, + this._gaxModule.createDefaultBackoffSettings() + ); + return decodeOperation as LROperation< + protos.google.protobuf.Empty, + protos.google.cloud.networkservices.v1beta1.OperationMetadata + >; + } + /** + * Lists EndpointPolicies in a given project and location. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The project and location from which the EndpointPolicies should be + * listed, specified in the format `projects/* /locations/global`. + * @param {number} request.pageSize + * Maximum number of EndpointPolicies to return per call. + * @param {string} request.pageToken + * The value returned by the last `ListEndpointPoliciesResponse` + * Indicates that this is a continuation of a prior + * `ListEndpointPolicies` call, and that the system should return the + * next page of data. + * @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.networkservices.v1beta1.EndpointPolicy|EndpointPolicy}. + * 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 `listEndpointPoliciesAsync()` + * 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. + */ + listEndpointPolicies( + request?: protos.google.cloud.networkservices.v1beta1.IListEndpointPoliciesRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.networkservices.v1beta1.IEndpointPolicy[], + protos.google.cloud.networkservices.v1beta1.IListEndpointPoliciesRequest | null, + protos.google.cloud.networkservices.v1beta1.IListEndpointPoliciesResponse, + ] + >; + listEndpointPolicies( + request: protos.google.cloud.networkservices.v1beta1.IListEndpointPoliciesRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.cloud.networkservices.v1beta1.IListEndpointPoliciesRequest, + | protos.google.cloud.networkservices.v1beta1.IListEndpointPoliciesResponse + | null + | undefined, + protos.google.cloud.networkservices.v1beta1.IEndpointPolicy + > + ): void; + listEndpointPolicies( + request: protos.google.cloud.networkservices.v1beta1.IListEndpointPoliciesRequest, + callback: PaginationCallback< + protos.google.cloud.networkservices.v1beta1.IListEndpointPoliciesRequest, + | protos.google.cloud.networkservices.v1beta1.IListEndpointPoliciesResponse + | null + | undefined, + protos.google.cloud.networkservices.v1beta1.IEndpointPolicy + > + ): void; + listEndpointPolicies( + request?: protos.google.cloud.networkservices.v1beta1.IListEndpointPoliciesRequest, + optionsOrCallback?: + | CallOptions + | PaginationCallback< + protos.google.cloud.networkservices.v1beta1.IListEndpointPoliciesRequest, + | protos.google.cloud.networkservices.v1beta1.IListEndpointPoliciesResponse + | null + | undefined, + protos.google.cloud.networkservices.v1beta1.IEndpointPolicy + >, + callback?: PaginationCallback< + protos.google.cloud.networkservices.v1beta1.IListEndpointPoliciesRequest, + | protos.google.cloud.networkservices.v1beta1.IListEndpointPoliciesResponse + | null + | undefined, + protos.google.cloud.networkservices.v1beta1.IEndpointPolicy + > + ): Promise< + [ + protos.google.cloud.networkservices.v1beta1.IEndpointPolicy[], + protos.google.cloud.networkservices.v1beta1.IListEndpointPoliciesRequest | null, + protos.google.cloud.networkservices.v1beta1.IListEndpointPoliciesResponse, + ] + > | 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(); + return this.innerApiCalls.listEndpointPolicies(request, options, callback); + } + + /** + * Equivalent to `method.name.toCamelCase()`, 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 from which the EndpointPolicies should be + * listed, specified in the format `projects/* /locations/global`. + * @param {number} request.pageSize + * Maximum number of EndpointPolicies to return per call. + * @param {string} request.pageToken + * The value returned by the last `ListEndpointPoliciesResponse` + * Indicates that this is a continuation of a prior + * `ListEndpointPolicies` call, and that the system should return the + * next page of data. + * @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.networkservices.v1beta1.EndpointPolicy|EndpointPolicy} 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 `listEndpointPoliciesAsync()` + * 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. + */ + listEndpointPoliciesStream( + request?: protos.google.cloud.networkservices.v1beta1.IListEndpointPoliciesRequest, + 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['listEndpointPolicies']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.listEndpointPolicies.createStream( + this.innerApiCalls.listEndpointPolicies as GaxCall, + request, + callSettings + ); + } + + /** + * Equivalent to `listEndpointPolicies`, 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 from which the EndpointPolicies should be + * listed, specified in the format `projects/* /locations/global`. + * @param {number} request.pageSize + * Maximum number of EndpointPolicies to return per call. + * @param {string} request.pageToken + * The value returned by the last `ListEndpointPoliciesResponse` + * Indicates that this is a continuation of a prior + * `ListEndpointPolicies` call, and that the system should return the + * next page of data. + * @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.networkservices.v1beta1.EndpointPolicy|EndpointPolicy}. 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/v1beta1/network_services.list_endpoint_policies.js + * region_tag:networkservices_v1beta1_generated_NetworkServices_ListEndpointPolicies_async + */ + listEndpointPoliciesAsync( + request?: protos.google.cloud.networkservices.v1beta1.IListEndpointPoliciesRequest, + 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['listEndpointPolicies']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.listEndpointPolicies.asyncIterate( + this.innerApiCalls['listEndpointPolicies'] as GaxCall, + request as {}, + callSettings + ) as AsyncIterable; + } + // -------------------- + // -- Path templates -- + // -------------------- + + /** + * Return a fully-qualified endpointPolicy resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} endpoint_policy + * @returns {string} Resource name string. + */ + endpointPolicyPath( + project: string, + location: string, + endpointPolicy: string + ) { + return this.pathTemplates.endpointPolicyPathTemplate.render({ + project: project, + location: location, + endpoint_policy: endpointPolicy, + }); + } + + /** + * Parse the project from EndpointPolicy resource. + * + * @param {string} endpointPolicyName + * A fully-qualified path representing EndpointPolicy resource. + * @returns {string} A string representing the project. + */ + matchProjectFromEndpointPolicyName(endpointPolicyName: string) { + return this.pathTemplates.endpointPolicyPathTemplate.match( + endpointPolicyName + ).project; + } + + /** + * Parse the location from EndpointPolicy resource. + * + * @param {string} endpointPolicyName + * A fully-qualified path representing EndpointPolicy resource. + * @returns {string} A string representing the location. + */ + matchLocationFromEndpointPolicyName(endpointPolicyName: string) { + return this.pathTemplates.endpointPolicyPathTemplate.match( + endpointPolicyName + ).location; + } + + /** + * Parse the endpoint_policy from EndpointPolicy resource. + * + * @param {string} endpointPolicyName + * A fully-qualified path representing EndpointPolicy resource. + * @returns {string} A string representing the endpoint_policy. + */ + matchEndpointPolicyFromEndpointPolicyName(endpointPolicyName: string) { + return this.pathTemplates.endpointPolicyPathTemplate.match( + endpointPolicyName + ).endpoint_policy; + } + + /** + * 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.networkServicesStub && !this._terminated) { + return this.networkServicesStub.then(stub => { + this._terminated = true; + stub.close(); + this.operationsClient.close(); + }); + } + return Promise.resolve(); + } +} diff --git a/packages/google-cloud-networkservices/src/v1beta1/network_services_client_config.json b/packages/google-cloud-networkservices/src/v1beta1/network_services_client_config.json new file mode 100644 index 00000000000..219ccc6e1ff --- /dev/null +++ b/packages/google-cloud-networkservices/src/v1beta1/network_services_client_config.json @@ -0,0 +1,51 @@ +{ + "interfaces": { + "google.cloud.networkservices.v1beta1.NetworkServices": { + "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": { + "ListEndpointPolicies": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "GetEndpointPolicy": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "CreateEndpointPolicy": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "UpdateEndpointPolicy": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "DeleteEndpointPolicy": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + } + } + } + } +} diff --git a/packages/google-cloud-networkservices/src/v1beta1/network_services_proto_list.json b/packages/google-cloud-networkservices/src/v1beta1/network_services_proto_list.json new file mode 100644 index 00000000000..efa0499574c --- /dev/null +++ b/packages/google-cloud-networkservices/src/v1beta1/network_services_proto_list.json @@ -0,0 +1,5 @@ +[ + "../../protos/google/cloud/networkservices/v1beta1/common.proto", + "../../protos/google/cloud/networkservices/v1beta1/endpoint_policy.proto", + "../../protos/google/cloud/networkservices/v1beta1/network_services.proto" +] diff --git a/packages/google-cloud-networkservices/system-test/fixtures/sample/src/index.js b/packages/google-cloud-networkservices/system-test/fixtures/sample/src/index.js new file mode 100644 index 00000000000..9f0176c280c --- /dev/null +++ b/packages/google-cloud-networkservices/system-test/fixtures/sample/src/index.js @@ -0,0 +1,26 @@ +// Copyright 2023 Google LLC +// +// Licensed under the Apache License, Version 2.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 networkservices = require('@google-cloud/networkservices'); + +function main() { + const networkServicesClient = new networkservices.NetworkServicesClient(); +} + +main(); diff --git a/packages/google-cloud-networkservices/system-test/fixtures/sample/src/index.ts b/packages/google-cloud-networkservices/system-test/fixtures/sample/src/index.ts new file mode 100644 index 00000000000..b9b667ab15b --- /dev/null +++ b/packages/google-cloud-networkservices/system-test/fixtures/sample/src/index.ts @@ -0,0 +1,32 @@ +// Copyright 2023 Google LLC +// +// Licensed under the Apache License, Version 2.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 {NetworkServicesClient} from '@google-cloud/networkservices'; + +// check that the client class type name can be used +function doStuffWithNetworkServicesClient(client: NetworkServicesClient) { + client.close(); +} + +function main() { + // check that the client instance can be created + const networkServicesClient = new NetworkServicesClient(); + doStuffWithNetworkServicesClient(networkServicesClient); +} + +main(); diff --git a/packages/google-cloud-networkservices/system-test/install.ts b/packages/google-cloud-networkservices/system-test/install.ts new file mode 100644 index 00000000000..f61fe236476 --- /dev/null +++ b/packages/google-cloud-networkservices/system-test/install.ts @@ -0,0 +1,51 @@ +// Copyright 2023 Google LLC +// +// Licensed under the Apache License, Version 2.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/google-cloud-networkservices/test/gapic_network_services_v1.ts b/packages/google-cloud-networkservices/test/gapic_network_services_v1.ts new file mode 100644 index 00000000000..226ca1eab65 --- /dev/null +++ b/packages/google-cloud-networkservices/test/gapic_network_services_v1.ts @@ -0,0 +1,9753 @@ +// Copyright 2023 Google LLC +// +// Licensed under the Apache License, Version 2.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 networkservicesModule from '../src'; + +import {PassThrough} from 'stream'; + +import { + protobuf, + LROperation, + operationsProtos, + IamProtos, + 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 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('v1.NetworkServicesClient', () => { + describe('Common methods', () => { + it('has servicePath', () => { + const servicePath = + networkservicesModule.v1.NetworkServicesClient.servicePath; + assert(servicePath); + }); + + it('has apiEndpoint', () => { + const apiEndpoint = + networkservicesModule.v1.NetworkServicesClient.apiEndpoint; + assert(apiEndpoint); + }); + + it('has port', () => { + const port = networkservicesModule.v1.NetworkServicesClient.port; + assert(port); + assert(typeof port === 'number'); + }); + + it('should create a client with no option', () => { + const client = new networkservicesModule.v1.NetworkServicesClient(); + assert(client); + }); + + it('should create a client with gRPC fallback', () => { + const client = new networkservicesModule.v1.NetworkServicesClient({ + fallback: true, + }); + assert(client); + }); + + it('has initialize method and supports deferred initialization', async () => { + const client = new networkservicesModule.v1.NetworkServicesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + assert.strictEqual(client.networkServicesStub, undefined); + await client.initialize(); + assert(client.networkServicesStub); + }); + + it('has close method for the initialized client', done => { + const client = new networkservicesModule.v1.NetworkServicesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + assert(client.networkServicesStub); + client.close().then(() => { + done(); + }); + }); + + it('has close method for the non-initialized client', done => { + const client = new networkservicesModule.v1.NetworkServicesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + assert.strictEqual(client.networkServicesStub, undefined); + client.close().then(() => { + done(); + }); + }); + + it('has getProjectId method', async () => { + const fakeProjectId = 'fake-project-id'; + const client = new networkservicesModule.v1.NetworkServicesClient({ + 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 networkservicesModule.v1.NetworkServicesClient({ + 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('getEndpointPolicy', () => { + it('invokes getEndpointPolicy without error', async () => { + const client = new networkservicesModule.v1.NetworkServicesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.networkservices.v1.GetEndpointPolicyRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.networkservices.v1.GetEndpointPolicyRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.networkservices.v1.EndpointPolicy() + ); + client.innerApiCalls.getEndpointPolicy = stubSimpleCall(expectedResponse); + const [response] = await client.getEndpointPolicy(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.getEndpointPolicy as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getEndpointPolicy as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getEndpointPolicy without error using callback', async () => { + const client = new networkservicesModule.v1.NetworkServicesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.networkservices.v1.GetEndpointPolicyRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.networkservices.v1.GetEndpointPolicyRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.networkservices.v1.EndpointPolicy() + ); + client.innerApiCalls.getEndpointPolicy = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getEndpointPolicy( + request, + ( + err?: Error | null, + result?: protos.google.cloud.networkservices.v1.IEndpointPolicy | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.getEndpointPolicy as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getEndpointPolicy as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getEndpointPolicy with error', async () => { + const client = new networkservicesModule.v1.NetworkServicesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.networkservices.v1.GetEndpointPolicyRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.networkservices.v1.GetEndpointPolicyRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.getEndpointPolicy = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.getEndpointPolicy(request), expectedError); + const actualRequest = ( + client.innerApiCalls.getEndpointPolicy as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getEndpointPolicy as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getEndpointPolicy with closed client', async () => { + const client = new networkservicesModule.v1.NetworkServicesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.networkservices.v1.GetEndpointPolicyRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.networkservices.v1.GetEndpointPolicyRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.getEndpointPolicy(request), expectedError); + }); + }); + + describe('getGateway', () => { + it('invokes getGateway without error', async () => { + const client = new networkservicesModule.v1.NetworkServicesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.networkservices.v1.GetGatewayRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.networkservices.v1.GetGatewayRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.networkservices.v1.Gateway() + ); + client.innerApiCalls.getGateway = stubSimpleCall(expectedResponse); + const [response] = await client.getGateway(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.getGateway as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getGateway as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getGateway without error using callback', async () => { + const client = new networkservicesModule.v1.NetworkServicesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.networkservices.v1.GetGatewayRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.networkservices.v1.GetGatewayRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.networkservices.v1.Gateway() + ); + client.innerApiCalls.getGateway = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getGateway( + request, + ( + err?: Error | null, + result?: protos.google.cloud.networkservices.v1.IGateway | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.getGateway as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getGateway as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getGateway with error', async () => { + const client = new networkservicesModule.v1.NetworkServicesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.networkservices.v1.GetGatewayRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.networkservices.v1.GetGatewayRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.getGateway = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.getGateway(request), expectedError); + const actualRequest = ( + client.innerApiCalls.getGateway as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getGateway as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getGateway with closed client', async () => { + const client = new networkservicesModule.v1.NetworkServicesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.networkservices.v1.GetGatewayRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.networkservices.v1.GetGatewayRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.getGateway(request), expectedError); + }); + }); + + describe('getGrpcRoute', () => { + it('invokes getGrpcRoute without error', async () => { + const client = new networkservicesModule.v1.NetworkServicesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.networkservices.v1.GetGrpcRouteRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.networkservices.v1.GetGrpcRouteRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.networkservices.v1.GrpcRoute() + ); + client.innerApiCalls.getGrpcRoute = stubSimpleCall(expectedResponse); + const [response] = await client.getGrpcRoute(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.getGrpcRoute as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getGrpcRoute as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getGrpcRoute without error using callback', async () => { + const client = new networkservicesModule.v1.NetworkServicesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.networkservices.v1.GetGrpcRouteRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.networkservices.v1.GetGrpcRouteRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.networkservices.v1.GrpcRoute() + ); + client.innerApiCalls.getGrpcRoute = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getGrpcRoute( + request, + ( + err?: Error | null, + result?: protos.google.cloud.networkservices.v1.IGrpcRoute | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.getGrpcRoute as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getGrpcRoute as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getGrpcRoute with error', async () => { + const client = new networkservicesModule.v1.NetworkServicesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.networkservices.v1.GetGrpcRouteRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.networkservices.v1.GetGrpcRouteRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.getGrpcRoute = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.getGrpcRoute(request), expectedError); + const actualRequest = ( + client.innerApiCalls.getGrpcRoute as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getGrpcRoute as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getGrpcRoute with closed client', async () => { + const client = new networkservicesModule.v1.NetworkServicesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.networkservices.v1.GetGrpcRouteRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.networkservices.v1.GetGrpcRouteRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.getGrpcRoute(request), expectedError); + }); + }); + + describe('getHttpRoute', () => { + it('invokes getHttpRoute without error', async () => { + const client = new networkservicesModule.v1.NetworkServicesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.networkservices.v1.GetHttpRouteRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.networkservices.v1.GetHttpRouteRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.networkservices.v1.HttpRoute() + ); + client.innerApiCalls.getHttpRoute = stubSimpleCall(expectedResponse); + const [response] = await client.getHttpRoute(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.getHttpRoute as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getHttpRoute as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getHttpRoute without error using callback', async () => { + const client = new networkservicesModule.v1.NetworkServicesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.networkservices.v1.GetHttpRouteRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.networkservices.v1.GetHttpRouteRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.networkservices.v1.HttpRoute() + ); + client.innerApiCalls.getHttpRoute = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getHttpRoute( + request, + ( + err?: Error | null, + result?: protos.google.cloud.networkservices.v1.IHttpRoute | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.getHttpRoute as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getHttpRoute as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getHttpRoute with error', async () => { + const client = new networkservicesModule.v1.NetworkServicesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.networkservices.v1.GetHttpRouteRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.networkservices.v1.GetHttpRouteRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.getHttpRoute = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.getHttpRoute(request), expectedError); + const actualRequest = ( + client.innerApiCalls.getHttpRoute as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getHttpRoute as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getHttpRoute with closed client', async () => { + const client = new networkservicesModule.v1.NetworkServicesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.networkservices.v1.GetHttpRouteRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.networkservices.v1.GetHttpRouteRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.getHttpRoute(request), expectedError); + }); + }); + + describe('getTcpRoute', () => { + it('invokes getTcpRoute without error', async () => { + const client = new networkservicesModule.v1.NetworkServicesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.networkservices.v1.GetTcpRouteRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.networkservices.v1.GetTcpRouteRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.networkservices.v1.TcpRoute() + ); + client.innerApiCalls.getTcpRoute = stubSimpleCall(expectedResponse); + const [response] = await client.getTcpRoute(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.getTcpRoute as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getTcpRoute as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getTcpRoute without error using callback', async () => { + const client = new networkservicesModule.v1.NetworkServicesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.networkservices.v1.GetTcpRouteRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.networkservices.v1.GetTcpRouteRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.networkservices.v1.TcpRoute() + ); + client.innerApiCalls.getTcpRoute = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getTcpRoute( + request, + ( + err?: Error | null, + result?: protos.google.cloud.networkservices.v1.ITcpRoute | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.getTcpRoute as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getTcpRoute as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getTcpRoute with error', async () => { + const client = new networkservicesModule.v1.NetworkServicesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.networkservices.v1.GetTcpRouteRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.networkservices.v1.GetTcpRouteRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.getTcpRoute = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.getTcpRoute(request), expectedError); + const actualRequest = ( + client.innerApiCalls.getTcpRoute as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getTcpRoute as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getTcpRoute with closed client', async () => { + const client = new networkservicesModule.v1.NetworkServicesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.networkservices.v1.GetTcpRouteRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.networkservices.v1.GetTcpRouteRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.getTcpRoute(request), expectedError); + }); + }); + + describe('getTlsRoute', () => { + it('invokes getTlsRoute without error', async () => { + const client = new networkservicesModule.v1.NetworkServicesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.networkservices.v1.GetTlsRouteRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.networkservices.v1.GetTlsRouteRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.networkservices.v1.TlsRoute() + ); + client.innerApiCalls.getTlsRoute = stubSimpleCall(expectedResponse); + const [response] = await client.getTlsRoute(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.getTlsRoute as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getTlsRoute as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getTlsRoute without error using callback', async () => { + const client = new networkservicesModule.v1.NetworkServicesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.networkservices.v1.GetTlsRouteRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.networkservices.v1.GetTlsRouteRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.networkservices.v1.TlsRoute() + ); + client.innerApiCalls.getTlsRoute = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getTlsRoute( + request, + ( + err?: Error | null, + result?: protos.google.cloud.networkservices.v1.ITlsRoute | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.getTlsRoute as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getTlsRoute as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getTlsRoute with error', async () => { + const client = new networkservicesModule.v1.NetworkServicesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.networkservices.v1.GetTlsRouteRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.networkservices.v1.GetTlsRouteRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.getTlsRoute = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.getTlsRoute(request), expectedError); + const actualRequest = ( + client.innerApiCalls.getTlsRoute as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getTlsRoute as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getTlsRoute with closed client', async () => { + const client = new networkservicesModule.v1.NetworkServicesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.networkservices.v1.GetTlsRouteRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.networkservices.v1.GetTlsRouteRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.getTlsRoute(request), expectedError); + }); + }); + + describe('getServiceBinding', () => { + it('invokes getServiceBinding without error', async () => { + const client = new networkservicesModule.v1.NetworkServicesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.networkservices.v1.GetServiceBindingRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.networkservices.v1.GetServiceBindingRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.networkservices.v1.ServiceBinding() + ); + client.innerApiCalls.getServiceBinding = stubSimpleCall(expectedResponse); + const [response] = await client.getServiceBinding(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.getServiceBinding as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getServiceBinding as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getServiceBinding without error using callback', async () => { + const client = new networkservicesModule.v1.NetworkServicesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.networkservices.v1.GetServiceBindingRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.networkservices.v1.GetServiceBindingRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.networkservices.v1.ServiceBinding() + ); + client.innerApiCalls.getServiceBinding = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getServiceBinding( + request, + ( + err?: Error | null, + result?: protos.google.cloud.networkservices.v1.IServiceBinding | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.getServiceBinding as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getServiceBinding as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getServiceBinding with error', async () => { + const client = new networkservicesModule.v1.NetworkServicesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.networkservices.v1.GetServiceBindingRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.networkservices.v1.GetServiceBindingRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.getServiceBinding = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.getServiceBinding(request), expectedError); + const actualRequest = ( + client.innerApiCalls.getServiceBinding as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getServiceBinding as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getServiceBinding with closed client', async () => { + const client = new networkservicesModule.v1.NetworkServicesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.networkservices.v1.GetServiceBindingRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.networkservices.v1.GetServiceBindingRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.getServiceBinding(request), expectedError); + }); + }); + + describe('getMesh', () => { + it('invokes getMesh without error', async () => { + const client = new networkservicesModule.v1.NetworkServicesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.networkservices.v1.GetMeshRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.networkservices.v1.GetMeshRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.networkservices.v1.Mesh() + ); + client.innerApiCalls.getMesh = stubSimpleCall(expectedResponse); + const [response] = await client.getMesh(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.getMesh as SinonStub).getCall( + 0 + ).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getMesh as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getMesh without error using callback', async () => { + const client = new networkservicesModule.v1.NetworkServicesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.networkservices.v1.GetMeshRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.networkservices.v1.GetMeshRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.networkservices.v1.Mesh() + ); + client.innerApiCalls.getMesh = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getMesh( + request, + ( + err?: Error | null, + result?: protos.google.cloud.networkservices.v1.IMesh | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.getMesh as SinonStub).getCall( + 0 + ).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getMesh as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getMesh with error', async () => { + const client = new networkservicesModule.v1.NetworkServicesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.networkservices.v1.GetMeshRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.networkservices.v1.GetMeshRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.getMesh = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.getMesh(request), expectedError); + const actualRequest = (client.innerApiCalls.getMesh as SinonStub).getCall( + 0 + ).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getMesh as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getMesh with closed client', async () => { + const client = new networkservicesModule.v1.NetworkServicesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.networkservices.v1.GetMeshRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.networkservices.v1.GetMeshRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.getMesh(request), expectedError); + }); + }); + + describe('createEndpointPolicy', () => { + it('invokes createEndpointPolicy without error', async () => { + const client = new networkservicesModule.v1.NetworkServicesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.networkservices.v1.CreateEndpointPolicyRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.networkservices.v1.CreateEndpointPolicyRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.createEndpointPolicy = + stubLongRunningCall(expectedResponse); + const [operation] = await client.createEndpointPolicy(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.createEndpointPolicy as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createEndpointPolicy as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createEndpointPolicy without error using callback', async () => { + const client = new networkservicesModule.v1.NetworkServicesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.networkservices.v1.CreateEndpointPolicyRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.networkservices.v1.CreateEndpointPolicyRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.createEndpointPolicy = + stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.createEndpointPolicy( + request, + ( + err?: Error | null, + result?: LROperation< + protos.google.cloud.networkservices.v1.IEndpointPolicy, + protos.google.cloud.networkservices.v1.IOperationMetadata + > | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const operation = (await promise) as LROperation< + protos.google.cloud.networkservices.v1.IEndpointPolicy, + protos.google.cloud.networkservices.v1.IOperationMetadata + >; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.createEndpointPolicy as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createEndpointPolicy as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createEndpointPolicy with call error', async () => { + const client = new networkservicesModule.v1.NetworkServicesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.networkservices.v1.CreateEndpointPolicyRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.networkservices.v1.CreateEndpointPolicyRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.createEndpointPolicy = stubLongRunningCall( + undefined, + expectedError + ); + await assert.rejects(client.createEndpointPolicy(request), expectedError); + const actualRequest = ( + client.innerApiCalls.createEndpointPolicy as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createEndpointPolicy as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createEndpointPolicy with LRO error', async () => { + const client = new networkservicesModule.v1.NetworkServicesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.networkservices.v1.CreateEndpointPolicyRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.networkservices.v1.CreateEndpointPolicyRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.createEndpointPolicy = stubLongRunningCall( + undefined, + undefined, + expectedError + ); + const [operation] = await client.createEndpointPolicy(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = ( + client.innerApiCalls.createEndpointPolicy as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createEndpointPolicy as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkCreateEndpointPolicyProgress without error', async () => { + const client = new networkservicesModule.v1.NetworkServicesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + 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.checkCreateEndpointPolicyProgress( + expectedResponse.name + ); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkCreateEndpointPolicyProgress with error', async () => { + const client = new networkservicesModule.v1.NetworkServicesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const expectedError = new Error('expected'); + + client.operationsClient.getOperation = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects( + client.checkCreateEndpointPolicyProgress(''), + expectedError + ); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + }); + + describe('updateEndpointPolicy', () => { + it('invokes updateEndpointPolicy without error', async () => { + const client = new networkservicesModule.v1.NetworkServicesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.networkservices.v1.UpdateEndpointPolicyRequest() + ); + request.endpointPolicy ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.networkservices.v1.UpdateEndpointPolicyRequest', + ['endpointPolicy', 'name'] + ); + request.endpointPolicy.name = defaultValue1; + const expectedHeaderRequestParams = `endpoint_policy.name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.updateEndpointPolicy = + stubLongRunningCall(expectedResponse); + const [operation] = await client.updateEndpointPolicy(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.updateEndpointPolicy as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateEndpointPolicy as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateEndpointPolicy without error using callback', async () => { + const client = new networkservicesModule.v1.NetworkServicesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.networkservices.v1.UpdateEndpointPolicyRequest() + ); + request.endpointPolicy ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.networkservices.v1.UpdateEndpointPolicyRequest', + ['endpointPolicy', 'name'] + ); + request.endpointPolicy.name = defaultValue1; + const expectedHeaderRequestParams = `endpoint_policy.name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.updateEndpointPolicy = + stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.updateEndpointPolicy( + request, + ( + err?: Error | null, + result?: LROperation< + protos.google.cloud.networkservices.v1.IEndpointPolicy, + protos.google.cloud.networkservices.v1.IOperationMetadata + > | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const operation = (await promise) as LROperation< + protos.google.cloud.networkservices.v1.IEndpointPolicy, + protos.google.cloud.networkservices.v1.IOperationMetadata + >; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.updateEndpointPolicy as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateEndpointPolicy as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateEndpointPolicy with call error', async () => { + const client = new networkservicesModule.v1.NetworkServicesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.networkservices.v1.UpdateEndpointPolicyRequest() + ); + request.endpointPolicy ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.networkservices.v1.UpdateEndpointPolicyRequest', + ['endpointPolicy', 'name'] + ); + request.endpointPolicy.name = defaultValue1; + const expectedHeaderRequestParams = `endpoint_policy.name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.updateEndpointPolicy = stubLongRunningCall( + undefined, + expectedError + ); + await assert.rejects(client.updateEndpointPolicy(request), expectedError); + const actualRequest = ( + client.innerApiCalls.updateEndpointPolicy as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateEndpointPolicy as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateEndpointPolicy with LRO error', async () => { + const client = new networkservicesModule.v1.NetworkServicesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.networkservices.v1.UpdateEndpointPolicyRequest() + ); + request.endpointPolicy ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.networkservices.v1.UpdateEndpointPolicyRequest', + ['endpointPolicy', 'name'] + ); + request.endpointPolicy.name = defaultValue1; + const expectedHeaderRequestParams = `endpoint_policy.name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.updateEndpointPolicy = stubLongRunningCall( + undefined, + undefined, + expectedError + ); + const [operation] = await client.updateEndpointPolicy(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = ( + client.innerApiCalls.updateEndpointPolicy as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateEndpointPolicy as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkUpdateEndpointPolicyProgress without error', async () => { + const client = new networkservicesModule.v1.NetworkServicesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + 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.checkUpdateEndpointPolicyProgress( + expectedResponse.name + ); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkUpdateEndpointPolicyProgress with error', async () => { + const client = new networkservicesModule.v1.NetworkServicesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const expectedError = new Error('expected'); + + client.operationsClient.getOperation = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects( + client.checkUpdateEndpointPolicyProgress(''), + expectedError + ); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + }); + + describe('deleteEndpointPolicy', () => { + it('invokes deleteEndpointPolicy without error', async () => { + const client = new networkservicesModule.v1.NetworkServicesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.networkservices.v1.DeleteEndpointPolicyRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.networkservices.v1.DeleteEndpointPolicyRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.deleteEndpointPolicy = + stubLongRunningCall(expectedResponse); + const [operation] = await client.deleteEndpointPolicy(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.deleteEndpointPolicy as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteEndpointPolicy as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteEndpointPolicy without error using callback', async () => { + const client = new networkservicesModule.v1.NetworkServicesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.networkservices.v1.DeleteEndpointPolicyRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.networkservices.v1.DeleteEndpointPolicyRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.deleteEndpointPolicy = + stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.deleteEndpointPolicy( + request, + ( + err?: Error | null, + result?: LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.networkservices.v1.IOperationMetadata + > | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const operation = (await promise) as LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.networkservices.v1.IOperationMetadata + >; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.deleteEndpointPolicy as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteEndpointPolicy as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteEndpointPolicy with call error', async () => { + const client = new networkservicesModule.v1.NetworkServicesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.networkservices.v1.DeleteEndpointPolicyRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.networkservices.v1.DeleteEndpointPolicyRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteEndpointPolicy = stubLongRunningCall( + undefined, + expectedError + ); + await assert.rejects(client.deleteEndpointPolicy(request), expectedError); + const actualRequest = ( + client.innerApiCalls.deleteEndpointPolicy as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteEndpointPolicy as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteEndpointPolicy with LRO error', async () => { + const client = new networkservicesModule.v1.NetworkServicesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.networkservices.v1.DeleteEndpointPolicyRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.networkservices.v1.DeleteEndpointPolicyRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteEndpointPolicy = stubLongRunningCall( + undefined, + undefined, + expectedError + ); + const [operation] = await client.deleteEndpointPolicy(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = ( + client.innerApiCalls.deleteEndpointPolicy as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteEndpointPolicy as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkDeleteEndpointPolicyProgress without error', async () => { + const client = new networkservicesModule.v1.NetworkServicesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + 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.checkDeleteEndpointPolicyProgress( + expectedResponse.name + ); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkDeleteEndpointPolicyProgress with error', async () => { + const client = new networkservicesModule.v1.NetworkServicesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const expectedError = new Error('expected'); + + client.operationsClient.getOperation = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects( + client.checkDeleteEndpointPolicyProgress(''), + expectedError + ); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + }); + + describe('createGateway', () => { + it('invokes createGateway without error', async () => { + const client = new networkservicesModule.v1.NetworkServicesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.networkservices.v1.CreateGatewayRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.networkservices.v1.CreateGatewayRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.createGateway = + stubLongRunningCall(expectedResponse); + const [operation] = await client.createGateway(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.createGateway as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createGateway as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createGateway without error using callback', async () => { + const client = new networkservicesModule.v1.NetworkServicesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.networkservices.v1.CreateGatewayRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.networkservices.v1.CreateGatewayRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.createGateway = + stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.createGateway( + request, + ( + err?: Error | null, + result?: LROperation< + protos.google.cloud.networkservices.v1.IGateway, + protos.google.cloud.networkservices.v1.IOperationMetadata + > | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const operation = (await promise) as LROperation< + protos.google.cloud.networkservices.v1.IGateway, + protos.google.cloud.networkservices.v1.IOperationMetadata + >; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.createGateway as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createGateway as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createGateway with call error', async () => { + const client = new networkservicesModule.v1.NetworkServicesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.networkservices.v1.CreateGatewayRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.networkservices.v1.CreateGatewayRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.createGateway = stubLongRunningCall( + undefined, + expectedError + ); + await assert.rejects(client.createGateway(request), expectedError); + const actualRequest = ( + client.innerApiCalls.createGateway as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createGateway as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createGateway with LRO error', async () => { + const client = new networkservicesModule.v1.NetworkServicesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.networkservices.v1.CreateGatewayRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.networkservices.v1.CreateGatewayRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.createGateway = stubLongRunningCall( + undefined, + undefined, + expectedError + ); + const [operation] = await client.createGateway(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = ( + client.innerApiCalls.createGateway as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createGateway as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkCreateGatewayProgress without error', async () => { + const client = new networkservicesModule.v1.NetworkServicesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + 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.checkCreateGatewayProgress( + expectedResponse.name + ); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkCreateGatewayProgress with error', async () => { + const client = new networkservicesModule.v1.NetworkServicesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const expectedError = new Error('expected'); + + client.operationsClient.getOperation = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects( + client.checkCreateGatewayProgress(''), + expectedError + ); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + }); + + describe('updateGateway', () => { + it('invokes updateGateway without error', async () => { + const client = new networkservicesModule.v1.NetworkServicesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.networkservices.v1.UpdateGatewayRequest() + ); + request.gateway ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.networkservices.v1.UpdateGatewayRequest', + ['gateway', 'name'] + ); + request.gateway.name = defaultValue1; + const expectedHeaderRequestParams = `gateway.name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.updateGateway = + stubLongRunningCall(expectedResponse); + const [operation] = await client.updateGateway(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.updateGateway as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateGateway as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateGateway without error using callback', async () => { + const client = new networkservicesModule.v1.NetworkServicesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.networkservices.v1.UpdateGatewayRequest() + ); + request.gateway ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.networkservices.v1.UpdateGatewayRequest', + ['gateway', 'name'] + ); + request.gateway.name = defaultValue1; + const expectedHeaderRequestParams = `gateway.name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.updateGateway = + stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.updateGateway( + request, + ( + err?: Error | null, + result?: LROperation< + protos.google.cloud.networkservices.v1.IGateway, + protos.google.cloud.networkservices.v1.IOperationMetadata + > | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const operation = (await promise) as LROperation< + protos.google.cloud.networkservices.v1.IGateway, + protos.google.cloud.networkservices.v1.IOperationMetadata + >; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.updateGateway as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateGateway as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateGateway with call error', async () => { + const client = new networkservicesModule.v1.NetworkServicesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.networkservices.v1.UpdateGatewayRequest() + ); + request.gateway ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.networkservices.v1.UpdateGatewayRequest', + ['gateway', 'name'] + ); + request.gateway.name = defaultValue1; + const expectedHeaderRequestParams = `gateway.name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.updateGateway = stubLongRunningCall( + undefined, + expectedError + ); + await assert.rejects(client.updateGateway(request), expectedError); + const actualRequest = ( + client.innerApiCalls.updateGateway as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateGateway as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateGateway with LRO error', async () => { + const client = new networkservicesModule.v1.NetworkServicesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.networkservices.v1.UpdateGatewayRequest() + ); + request.gateway ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.networkservices.v1.UpdateGatewayRequest', + ['gateway', 'name'] + ); + request.gateway.name = defaultValue1; + const expectedHeaderRequestParams = `gateway.name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.updateGateway = stubLongRunningCall( + undefined, + undefined, + expectedError + ); + const [operation] = await client.updateGateway(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = ( + client.innerApiCalls.updateGateway as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateGateway as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkUpdateGatewayProgress without error', async () => { + const client = new networkservicesModule.v1.NetworkServicesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + 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.checkUpdateGatewayProgress( + expectedResponse.name + ); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkUpdateGatewayProgress with error', async () => { + const client = new networkservicesModule.v1.NetworkServicesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const expectedError = new Error('expected'); + + client.operationsClient.getOperation = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects( + client.checkUpdateGatewayProgress(''), + expectedError + ); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + }); + + describe('deleteGateway', () => { + it('invokes deleteGateway without error', async () => { + const client = new networkservicesModule.v1.NetworkServicesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.networkservices.v1.DeleteGatewayRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.networkservices.v1.DeleteGatewayRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.deleteGateway = + stubLongRunningCall(expectedResponse); + const [operation] = await client.deleteGateway(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.deleteGateway as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteGateway as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteGateway without error using callback', async () => { + const client = new networkservicesModule.v1.NetworkServicesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.networkservices.v1.DeleteGatewayRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.networkservices.v1.DeleteGatewayRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.deleteGateway = + stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.deleteGateway( + request, + ( + err?: Error | null, + result?: LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.networkservices.v1.IOperationMetadata + > | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const operation = (await promise) as LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.networkservices.v1.IOperationMetadata + >; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.deleteGateway as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteGateway as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteGateway with call error', async () => { + const client = new networkservicesModule.v1.NetworkServicesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.networkservices.v1.DeleteGatewayRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.networkservices.v1.DeleteGatewayRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteGateway = stubLongRunningCall( + undefined, + expectedError + ); + await assert.rejects(client.deleteGateway(request), expectedError); + const actualRequest = ( + client.innerApiCalls.deleteGateway as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteGateway as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteGateway with LRO error', async () => { + const client = new networkservicesModule.v1.NetworkServicesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.networkservices.v1.DeleteGatewayRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.networkservices.v1.DeleteGatewayRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteGateway = stubLongRunningCall( + undefined, + undefined, + expectedError + ); + const [operation] = await client.deleteGateway(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = ( + client.innerApiCalls.deleteGateway as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteGateway as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkDeleteGatewayProgress without error', async () => { + const client = new networkservicesModule.v1.NetworkServicesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + 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.checkDeleteGatewayProgress( + expectedResponse.name + ); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkDeleteGatewayProgress with error', async () => { + const client = new networkservicesModule.v1.NetworkServicesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const expectedError = new Error('expected'); + + client.operationsClient.getOperation = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects( + client.checkDeleteGatewayProgress(''), + expectedError + ); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + }); + + describe('createGrpcRoute', () => { + it('invokes createGrpcRoute without error', async () => { + const client = new networkservicesModule.v1.NetworkServicesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.networkservices.v1.CreateGrpcRouteRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.networkservices.v1.CreateGrpcRouteRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.createGrpcRoute = + stubLongRunningCall(expectedResponse); + const [operation] = await client.createGrpcRoute(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.createGrpcRoute as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createGrpcRoute as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createGrpcRoute without error using callback', async () => { + const client = new networkservicesModule.v1.NetworkServicesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.networkservices.v1.CreateGrpcRouteRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.networkservices.v1.CreateGrpcRouteRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.createGrpcRoute = + stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.createGrpcRoute( + request, + ( + err?: Error | null, + result?: LROperation< + protos.google.cloud.networkservices.v1.IGrpcRoute, + protos.google.cloud.networkservices.v1.IOperationMetadata + > | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const operation = (await promise) as LROperation< + protos.google.cloud.networkservices.v1.IGrpcRoute, + protos.google.cloud.networkservices.v1.IOperationMetadata + >; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.createGrpcRoute as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createGrpcRoute as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createGrpcRoute with call error', async () => { + const client = new networkservicesModule.v1.NetworkServicesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.networkservices.v1.CreateGrpcRouteRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.networkservices.v1.CreateGrpcRouteRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.createGrpcRoute = stubLongRunningCall( + undefined, + expectedError + ); + await assert.rejects(client.createGrpcRoute(request), expectedError); + const actualRequest = ( + client.innerApiCalls.createGrpcRoute as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createGrpcRoute as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createGrpcRoute with LRO error', async () => { + const client = new networkservicesModule.v1.NetworkServicesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.networkservices.v1.CreateGrpcRouteRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.networkservices.v1.CreateGrpcRouteRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.createGrpcRoute = stubLongRunningCall( + undefined, + undefined, + expectedError + ); + const [operation] = await client.createGrpcRoute(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = ( + client.innerApiCalls.createGrpcRoute as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createGrpcRoute as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkCreateGrpcRouteProgress without error', async () => { + const client = new networkservicesModule.v1.NetworkServicesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + 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.checkCreateGrpcRouteProgress( + expectedResponse.name + ); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkCreateGrpcRouteProgress with error', async () => { + const client = new networkservicesModule.v1.NetworkServicesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const expectedError = new Error('expected'); + + client.operationsClient.getOperation = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects( + client.checkCreateGrpcRouteProgress(''), + expectedError + ); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + }); + + describe('updateGrpcRoute', () => { + it('invokes updateGrpcRoute without error', async () => { + const client = new networkservicesModule.v1.NetworkServicesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.networkservices.v1.UpdateGrpcRouteRequest() + ); + request.grpcRoute ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.networkservices.v1.UpdateGrpcRouteRequest', + ['grpcRoute', 'name'] + ); + request.grpcRoute.name = defaultValue1; + const expectedHeaderRequestParams = `grpc_route.name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.updateGrpcRoute = + stubLongRunningCall(expectedResponse); + const [operation] = await client.updateGrpcRoute(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.updateGrpcRoute as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateGrpcRoute as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateGrpcRoute without error using callback', async () => { + const client = new networkservicesModule.v1.NetworkServicesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.networkservices.v1.UpdateGrpcRouteRequest() + ); + request.grpcRoute ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.networkservices.v1.UpdateGrpcRouteRequest', + ['grpcRoute', 'name'] + ); + request.grpcRoute.name = defaultValue1; + const expectedHeaderRequestParams = `grpc_route.name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.updateGrpcRoute = + stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.updateGrpcRoute( + request, + ( + err?: Error | null, + result?: LROperation< + protos.google.cloud.networkservices.v1.IGrpcRoute, + protos.google.cloud.networkservices.v1.IOperationMetadata + > | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const operation = (await promise) as LROperation< + protos.google.cloud.networkservices.v1.IGrpcRoute, + protos.google.cloud.networkservices.v1.IOperationMetadata + >; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.updateGrpcRoute as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateGrpcRoute as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateGrpcRoute with call error', async () => { + const client = new networkservicesModule.v1.NetworkServicesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.networkservices.v1.UpdateGrpcRouteRequest() + ); + request.grpcRoute ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.networkservices.v1.UpdateGrpcRouteRequest', + ['grpcRoute', 'name'] + ); + request.grpcRoute.name = defaultValue1; + const expectedHeaderRequestParams = `grpc_route.name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.updateGrpcRoute = stubLongRunningCall( + undefined, + expectedError + ); + await assert.rejects(client.updateGrpcRoute(request), expectedError); + const actualRequest = ( + client.innerApiCalls.updateGrpcRoute as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateGrpcRoute as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateGrpcRoute with LRO error', async () => { + const client = new networkservicesModule.v1.NetworkServicesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.networkservices.v1.UpdateGrpcRouteRequest() + ); + request.grpcRoute ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.networkservices.v1.UpdateGrpcRouteRequest', + ['grpcRoute', 'name'] + ); + request.grpcRoute.name = defaultValue1; + const expectedHeaderRequestParams = `grpc_route.name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.updateGrpcRoute = stubLongRunningCall( + undefined, + undefined, + expectedError + ); + const [operation] = await client.updateGrpcRoute(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = ( + client.innerApiCalls.updateGrpcRoute as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateGrpcRoute as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkUpdateGrpcRouteProgress without error', async () => { + const client = new networkservicesModule.v1.NetworkServicesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + 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.checkUpdateGrpcRouteProgress( + expectedResponse.name + ); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkUpdateGrpcRouteProgress with error', async () => { + const client = new networkservicesModule.v1.NetworkServicesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const expectedError = new Error('expected'); + + client.operationsClient.getOperation = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects( + client.checkUpdateGrpcRouteProgress(''), + expectedError + ); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + }); + + describe('deleteGrpcRoute', () => { + it('invokes deleteGrpcRoute without error', async () => { + const client = new networkservicesModule.v1.NetworkServicesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.networkservices.v1.DeleteGrpcRouteRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.networkservices.v1.DeleteGrpcRouteRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.deleteGrpcRoute = + stubLongRunningCall(expectedResponse); + const [operation] = await client.deleteGrpcRoute(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.deleteGrpcRoute as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteGrpcRoute as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteGrpcRoute without error using callback', async () => { + const client = new networkservicesModule.v1.NetworkServicesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.networkservices.v1.DeleteGrpcRouteRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.networkservices.v1.DeleteGrpcRouteRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.deleteGrpcRoute = + stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.deleteGrpcRoute( + request, + ( + err?: Error | null, + result?: LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.networkservices.v1.IOperationMetadata + > | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const operation = (await promise) as LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.networkservices.v1.IOperationMetadata + >; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.deleteGrpcRoute as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteGrpcRoute as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteGrpcRoute with call error', async () => { + const client = new networkservicesModule.v1.NetworkServicesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.networkservices.v1.DeleteGrpcRouteRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.networkservices.v1.DeleteGrpcRouteRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteGrpcRoute = stubLongRunningCall( + undefined, + expectedError + ); + await assert.rejects(client.deleteGrpcRoute(request), expectedError); + const actualRequest = ( + client.innerApiCalls.deleteGrpcRoute as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteGrpcRoute as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteGrpcRoute with LRO error', async () => { + const client = new networkservicesModule.v1.NetworkServicesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.networkservices.v1.DeleteGrpcRouteRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.networkservices.v1.DeleteGrpcRouteRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteGrpcRoute = stubLongRunningCall( + undefined, + undefined, + expectedError + ); + const [operation] = await client.deleteGrpcRoute(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = ( + client.innerApiCalls.deleteGrpcRoute as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteGrpcRoute as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkDeleteGrpcRouteProgress without error', async () => { + const client = new networkservicesModule.v1.NetworkServicesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + 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.checkDeleteGrpcRouteProgress( + expectedResponse.name + ); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkDeleteGrpcRouteProgress with error', async () => { + const client = new networkservicesModule.v1.NetworkServicesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const expectedError = new Error('expected'); + + client.operationsClient.getOperation = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects( + client.checkDeleteGrpcRouteProgress(''), + expectedError + ); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + }); + + describe('createHttpRoute', () => { + it('invokes createHttpRoute without error', async () => { + const client = new networkservicesModule.v1.NetworkServicesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.networkservices.v1.CreateHttpRouteRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.networkservices.v1.CreateHttpRouteRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.createHttpRoute = + stubLongRunningCall(expectedResponse); + const [operation] = await client.createHttpRoute(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.createHttpRoute as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createHttpRoute as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createHttpRoute without error using callback', async () => { + const client = new networkservicesModule.v1.NetworkServicesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.networkservices.v1.CreateHttpRouteRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.networkservices.v1.CreateHttpRouteRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.createHttpRoute = + stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.createHttpRoute( + request, + ( + err?: Error | null, + result?: LROperation< + protos.google.cloud.networkservices.v1.IHttpRoute, + protos.google.cloud.networkservices.v1.IOperationMetadata + > | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const operation = (await promise) as LROperation< + protos.google.cloud.networkservices.v1.IHttpRoute, + protos.google.cloud.networkservices.v1.IOperationMetadata + >; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.createHttpRoute as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createHttpRoute as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createHttpRoute with call error', async () => { + const client = new networkservicesModule.v1.NetworkServicesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.networkservices.v1.CreateHttpRouteRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.networkservices.v1.CreateHttpRouteRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.createHttpRoute = stubLongRunningCall( + undefined, + expectedError + ); + await assert.rejects(client.createHttpRoute(request), expectedError); + const actualRequest = ( + client.innerApiCalls.createHttpRoute as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createHttpRoute as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createHttpRoute with LRO error', async () => { + const client = new networkservicesModule.v1.NetworkServicesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.networkservices.v1.CreateHttpRouteRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.networkservices.v1.CreateHttpRouteRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.createHttpRoute = stubLongRunningCall( + undefined, + undefined, + expectedError + ); + const [operation] = await client.createHttpRoute(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = ( + client.innerApiCalls.createHttpRoute as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createHttpRoute as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkCreateHttpRouteProgress without error', async () => { + const client = new networkservicesModule.v1.NetworkServicesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + 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.checkCreateHttpRouteProgress( + expectedResponse.name + ); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkCreateHttpRouteProgress with error', async () => { + const client = new networkservicesModule.v1.NetworkServicesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const expectedError = new Error('expected'); + + client.operationsClient.getOperation = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects( + client.checkCreateHttpRouteProgress(''), + expectedError + ); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + }); + + describe('updateHttpRoute', () => { + it('invokes updateHttpRoute without error', async () => { + const client = new networkservicesModule.v1.NetworkServicesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.networkservices.v1.UpdateHttpRouteRequest() + ); + request.httpRoute ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.networkservices.v1.UpdateHttpRouteRequest', + ['httpRoute', 'name'] + ); + request.httpRoute.name = defaultValue1; + const expectedHeaderRequestParams = `http_route.name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.updateHttpRoute = + stubLongRunningCall(expectedResponse); + const [operation] = await client.updateHttpRoute(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.updateHttpRoute as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateHttpRoute as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateHttpRoute without error using callback', async () => { + const client = new networkservicesModule.v1.NetworkServicesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.networkservices.v1.UpdateHttpRouteRequest() + ); + request.httpRoute ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.networkservices.v1.UpdateHttpRouteRequest', + ['httpRoute', 'name'] + ); + request.httpRoute.name = defaultValue1; + const expectedHeaderRequestParams = `http_route.name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.updateHttpRoute = + stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.updateHttpRoute( + request, + ( + err?: Error | null, + result?: LROperation< + protos.google.cloud.networkservices.v1.IHttpRoute, + protos.google.cloud.networkservices.v1.IOperationMetadata + > | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const operation = (await promise) as LROperation< + protos.google.cloud.networkservices.v1.IHttpRoute, + protos.google.cloud.networkservices.v1.IOperationMetadata + >; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.updateHttpRoute as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateHttpRoute as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateHttpRoute with call error', async () => { + const client = new networkservicesModule.v1.NetworkServicesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.networkservices.v1.UpdateHttpRouteRequest() + ); + request.httpRoute ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.networkservices.v1.UpdateHttpRouteRequest', + ['httpRoute', 'name'] + ); + request.httpRoute.name = defaultValue1; + const expectedHeaderRequestParams = `http_route.name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.updateHttpRoute = stubLongRunningCall( + undefined, + expectedError + ); + await assert.rejects(client.updateHttpRoute(request), expectedError); + const actualRequest = ( + client.innerApiCalls.updateHttpRoute as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateHttpRoute as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateHttpRoute with LRO error', async () => { + const client = new networkservicesModule.v1.NetworkServicesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.networkservices.v1.UpdateHttpRouteRequest() + ); + request.httpRoute ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.networkservices.v1.UpdateHttpRouteRequest', + ['httpRoute', 'name'] + ); + request.httpRoute.name = defaultValue1; + const expectedHeaderRequestParams = `http_route.name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.updateHttpRoute = stubLongRunningCall( + undefined, + undefined, + expectedError + ); + const [operation] = await client.updateHttpRoute(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = ( + client.innerApiCalls.updateHttpRoute as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateHttpRoute as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkUpdateHttpRouteProgress without error', async () => { + const client = new networkservicesModule.v1.NetworkServicesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + 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.checkUpdateHttpRouteProgress( + expectedResponse.name + ); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkUpdateHttpRouteProgress with error', async () => { + const client = new networkservicesModule.v1.NetworkServicesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const expectedError = new Error('expected'); + + client.operationsClient.getOperation = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects( + client.checkUpdateHttpRouteProgress(''), + expectedError + ); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + }); + + describe('deleteHttpRoute', () => { + it('invokes deleteHttpRoute without error', async () => { + const client = new networkservicesModule.v1.NetworkServicesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.networkservices.v1.DeleteHttpRouteRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.networkservices.v1.DeleteHttpRouteRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.deleteHttpRoute = + stubLongRunningCall(expectedResponse); + const [operation] = await client.deleteHttpRoute(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.deleteHttpRoute as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteHttpRoute as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteHttpRoute without error using callback', async () => { + const client = new networkservicesModule.v1.NetworkServicesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.networkservices.v1.DeleteHttpRouteRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.networkservices.v1.DeleteHttpRouteRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.deleteHttpRoute = + stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.deleteHttpRoute( + request, + ( + err?: Error | null, + result?: LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.networkservices.v1.IOperationMetadata + > | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const operation = (await promise) as LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.networkservices.v1.IOperationMetadata + >; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.deleteHttpRoute as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteHttpRoute as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteHttpRoute with call error', async () => { + const client = new networkservicesModule.v1.NetworkServicesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.networkservices.v1.DeleteHttpRouteRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.networkservices.v1.DeleteHttpRouteRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteHttpRoute = stubLongRunningCall( + undefined, + expectedError + ); + await assert.rejects(client.deleteHttpRoute(request), expectedError); + const actualRequest = ( + client.innerApiCalls.deleteHttpRoute as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteHttpRoute as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteHttpRoute with LRO error', async () => { + const client = new networkservicesModule.v1.NetworkServicesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.networkservices.v1.DeleteHttpRouteRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.networkservices.v1.DeleteHttpRouteRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteHttpRoute = stubLongRunningCall( + undefined, + undefined, + expectedError + ); + const [operation] = await client.deleteHttpRoute(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = ( + client.innerApiCalls.deleteHttpRoute as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteHttpRoute as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkDeleteHttpRouteProgress without error', async () => { + const client = new networkservicesModule.v1.NetworkServicesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + 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.checkDeleteHttpRouteProgress( + expectedResponse.name + ); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkDeleteHttpRouteProgress with error', async () => { + const client = new networkservicesModule.v1.NetworkServicesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const expectedError = new Error('expected'); + + client.operationsClient.getOperation = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects( + client.checkDeleteHttpRouteProgress(''), + expectedError + ); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + }); + + describe('createTcpRoute', () => { + it('invokes createTcpRoute without error', async () => { + const client = new networkservicesModule.v1.NetworkServicesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.networkservices.v1.CreateTcpRouteRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.networkservices.v1.CreateTcpRouteRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.createTcpRoute = + stubLongRunningCall(expectedResponse); + const [operation] = await client.createTcpRoute(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.createTcpRoute as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createTcpRoute as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createTcpRoute without error using callback', async () => { + const client = new networkservicesModule.v1.NetworkServicesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.networkservices.v1.CreateTcpRouteRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.networkservices.v1.CreateTcpRouteRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.createTcpRoute = + stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.createTcpRoute( + request, + ( + err?: Error | null, + result?: LROperation< + protos.google.cloud.networkservices.v1.ITcpRoute, + protos.google.cloud.networkservices.v1.IOperationMetadata + > | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const operation = (await promise) as LROperation< + protos.google.cloud.networkservices.v1.ITcpRoute, + protos.google.cloud.networkservices.v1.IOperationMetadata + >; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.createTcpRoute as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createTcpRoute as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createTcpRoute with call error', async () => { + const client = new networkservicesModule.v1.NetworkServicesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.networkservices.v1.CreateTcpRouteRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.networkservices.v1.CreateTcpRouteRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.createTcpRoute = stubLongRunningCall( + undefined, + expectedError + ); + await assert.rejects(client.createTcpRoute(request), expectedError); + const actualRequest = ( + client.innerApiCalls.createTcpRoute as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createTcpRoute as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createTcpRoute with LRO error', async () => { + const client = new networkservicesModule.v1.NetworkServicesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.networkservices.v1.CreateTcpRouteRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.networkservices.v1.CreateTcpRouteRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.createTcpRoute = stubLongRunningCall( + undefined, + undefined, + expectedError + ); + const [operation] = await client.createTcpRoute(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = ( + client.innerApiCalls.createTcpRoute as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createTcpRoute as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkCreateTcpRouteProgress without error', async () => { + const client = new networkservicesModule.v1.NetworkServicesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + 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.checkCreateTcpRouteProgress( + expectedResponse.name + ); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkCreateTcpRouteProgress with error', async () => { + const client = new networkservicesModule.v1.NetworkServicesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const expectedError = new Error('expected'); + + client.operationsClient.getOperation = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects( + client.checkCreateTcpRouteProgress(''), + expectedError + ); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + }); + + describe('updateTcpRoute', () => { + it('invokes updateTcpRoute without error', async () => { + const client = new networkservicesModule.v1.NetworkServicesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.networkservices.v1.UpdateTcpRouteRequest() + ); + request.tcpRoute ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.networkservices.v1.UpdateTcpRouteRequest', + ['tcpRoute', 'name'] + ); + request.tcpRoute.name = defaultValue1; + const expectedHeaderRequestParams = `tcp_route.name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.updateTcpRoute = + stubLongRunningCall(expectedResponse); + const [operation] = await client.updateTcpRoute(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.updateTcpRoute as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateTcpRoute as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateTcpRoute without error using callback', async () => { + const client = new networkservicesModule.v1.NetworkServicesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.networkservices.v1.UpdateTcpRouteRequest() + ); + request.tcpRoute ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.networkservices.v1.UpdateTcpRouteRequest', + ['tcpRoute', 'name'] + ); + request.tcpRoute.name = defaultValue1; + const expectedHeaderRequestParams = `tcp_route.name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.updateTcpRoute = + stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.updateTcpRoute( + request, + ( + err?: Error | null, + result?: LROperation< + protos.google.cloud.networkservices.v1.ITcpRoute, + protos.google.cloud.networkservices.v1.IOperationMetadata + > | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const operation = (await promise) as LROperation< + protos.google.cloud.networkservices.v1.ITcpRoute, + protos.google.cloud.networkservices.v1.IOperationMetadata + >; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.updateTcpRoute as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateTcpRoute as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateTcpRoute with call error', async () => { + const client = new networkservicesModule.v1.NetworkServicesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.networkservices.v1.UpdateTcpRouteRequest() + ); + request.tcpRoute ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.networkservices.v1.UpdateTcpRouteRequest', + ['tcpRoute', 'name'] + ); + request.tcpRoute.name = defaultValue1; + const expectedHeaderRequestParams = `tcp_route.name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.updateTcpRoute = stubLongRunningCall( + undefined, + expectedError + ); + await assert.rejects(client.updateTcpRoute(request), expectedError); + const actualRequest = ( + client.innerApiCalls.updateTcpRoute as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateTcpRoute as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateTcpRoute with LRO error', async () => { + const client = new networkservicesModule.v1.NetworkServicesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.networkservices.v1.UpdateTcpRouteRequest() + ); + request.tcpRoute ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.networkservices.v1.UpdateTcpRouteRequest', + ['tcpRoute', 'name'] + ); + request.tcpRoute.name = defaultValue1; + const expectedHeaderRequestParams = `tcp_route.name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.updateTcpRoute = stubLongRunningCall( + undefined, + undefined, + expectedError + ); + const [operation] = await client.updateTcpRoute(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = ( + client.innerApiCalls.updateTcpRoute as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateTcpRoute as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkUpdateTcpRouteProgress without error', async () => { + const client = new networkservicesModule.v1.NetworkServicesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + 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.checkUpdateTcpRouteProgress( + expectedResponse.name + ); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkUpdateTcpRouteProgress with error', async () => { + const client = new networkservicesModule.v1.NetworkServicesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const expectedError = new Error('expected'); + + client.operationsClient.getOperation = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects( + client.checkUpdateTcpRouteProgress(''), + expectedError + ); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + }); + + describe('deleteTcpRoute', () => { + it('invokes deleteTcpRoute without error', async () => { + const client = new networkservicesModule.v1.NetworkServicesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.networkservices.v1.DeleteTcpRouteRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.networkservices.v1.DeleteTcpRouteRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.deleteTcpRoute = + stubLongRunningCall(expectedResponse); + const [operation] = await client.deleteTcpRoute(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.deleteTcpRoute as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteTcpRoute as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteTcpRoute without error using callback', async () => { + const client = new networkservicesModule.v1.NetworkServicesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.networkservices.v1.DeleteTcpRouteRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.networkservices.v1.DeleteTcpRouteRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.deleteTcpRoute = + stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.deleteTcpRoute( + request, + ( + err?: Error | null, + result?: LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.networkservices.v1.IOperationMetadata + > | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const operation = (await promise) as LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.networkservices.v1.IOperationMetadata + >; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.deleteTcpRoute as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteTcpRoute as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteTcpRoute with call error', async () => { + const client = new networkservicesModule.v1.NetworkServicesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.networkservices.v1.DeleteTcpRouteRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.networkservices.v1.DeleteTcpRouteRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteTcpRoute = stubLongRunningCall( + undefined, + expectedError + ); + await assert.rejects(client.deleteTcpRoute(request), expectedError); + const actualRequest = ( + client.innerApiCalls.deleteTcpRoute as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteTcpRoute as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteTcpRoute with LRO error', async () => { + const client = new networkservicesModule.v1.NetworkServicesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.networkservices.v1.DeleteTcpRouteRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.networkservices.v1.DeleteTcpRouteRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteTcpRoute = stubLongRunningCall( + undefined, + undefined, + expectedError + ); + const [operation] = await client.deleteTcpRoute(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = ( + client.innerApiCalls.deleteTcpRoute as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteTcpRoute as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkDeleteTcpRouteProgress without error', async () => { + const client = new networkservicesModule.v1.NetworkServicesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + 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.checkDeleteTcpRouteProgress( + expectedResponse.name + ); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkDeleteTcpRouteProgress with error', async () => { + const client = new networkservicesModule.v1.NetworkServicesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const expectedError = new Error('expected'); + + client.operationsClient.getOperation = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects( + client.checkDeleteTcpRouteProgress(''), + expectedError + ); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + }); + + describe('createTlsRoute', () => { + it('invokes createTlsRoute without error', async () => { + const client = new networkservicesModule.v1.NetworkServicesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.networkservices.v1.CreateTlsRouteRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.networkservices.v1.CreateTlsRouteRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.createTlsRoute = + stubLongRunningCall(expectedResponse); + const [operation] = await client.createTlsRoute(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.createTlsRoute as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createTlsRoute as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createTlsRoute without error using callback', async () => { + const client = new networkservicesModule.v1.NetworkServicesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.networkservices.v1.CreateTlsRouteRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.networkservices.v1.CreateTlsRouteRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.createTlsRoute = + stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.createTlsRoute( + request, + ( + err?: Error | null, + result?: LROperation< + protos.google.cloud.networkservices.v1.ITlsRoute, + protos.google.cloud.networkservices.v1.IOperationMetadata + > | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const operation = (await promise) as LROperation< + protos.google.cloud.networkservices.v1.ITlsRoute, + protos.google.cloud.networkservices.v1.IOperationMetadata + >; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.createTlsRoute as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createTlsRoute as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createTlsRoute with call error', async () => { + const client = new networkservicesModule.v1.NetworkServicesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.networkservices.v1.CreateTlsRouteRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.networkservices.v1.CreateTlsRouteRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.createTlsRoute = stubLongRunningCall( + undefined, + expectedError + ); + await assert.rejects(client.createTlsRoute(request), expectedError); + const actualRequest = ( + client.innerApiCalls.createTlsRoute as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createTlsRoute as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createTlsRoute with LRO error', async () => { + const client = new networkservicesModule.v1.NetworkServicesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.networkservices.v1.CreateTlsRouteRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.networkservices.v1.CreateTlsRouteRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.createTlsRoute = stubLongRunningCall( + undefined, + undefined, + expectedError + ); + const [operation] = await client.createTlsRoute(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = ( + client.innerApiCalls.createTlsRoute as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createTlsRoute as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkCreateTlsRouteProgress without error', async () => { + const client = new networkservicesModule.v1.NetworkServicesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + 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.checkCreateTlsRouteProgress( + expectedResponse.name + ); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkCreateTlsRouteProgress with error', async () => { + const client = new networkservicesModule.v1.NetworkServicesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const expectedError = new Error('expected'); + + client.operationsClient.getOperation = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects( + client.checkCreateTlsRouteProgress(''), + expectedError + ); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + }); + + describe('updateTlsRoute', () => { + it('invokes updateTlsRoute without error', async () => { + const client = new networkservicesModule.v1.NetworkServicesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.networkservices.v1.UpdateTlsRouteRequest() + ); + request.tlsRoute ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.networkservices.v1.UpdateTlsRouteRequest', + ['tlsRoute', 'name'] + ); + request.tlsRoute.name = defaultValue1; + const expectedHeaderRequestParams = `tls_route.name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.updateTlsRoute = + stubLongRunningCall(expectedResponse); + const [operation] = await client.updateTlsRoute(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.updateTlsRoute as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateTlsRoute as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateTlsRoute without error using callback', async () => { + const client = new networkservicesModule.v1.NetworkServicesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.networkservices.v1.UpdateTlsRouteRequest() + ); + request.tlsRoute ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.networkservices.v1.UpdateTlsRouteRequest', + ['tlsRoute', 'name'] + ); + request.tlsRoute.name = defaultValue1; + const expectedHeaderRequestParams = `tls_route.name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.updateTlsRoute = + stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.updateTlsRoute( + request, + ( + err?: Error | null, + result?: LROperation< + protos.google.cloud.networkservices.v1.ITlsRoute, + protos.google.cloud.networkservices.v1.IOperationMetadata + > | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const operation = (await promise) as LROperation< + protos.google.cloud.networkservices.v1.ITlsRoute, + protos.google.cloud.networkservices.v1.IOperationMetadata + >; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.updateTlsRoute as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateTlsRoute as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateTlsRoute with call error', async () => { + const client = new networkservicesModule.v1.NetworkServicesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.networkservices.v1.UpdateTlsRouteRequest() + ); + request.tlsRoute ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.networkservices.v1.UpdateTlsRouteRequest', + ['tlsRoute', 'name'] + ); + request.tlsRoute.name = defaultValue1; + const expectedHeaderRequestParams = `tls_route.name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.updateTlsRoute = stubLongRunningCall( + undefined, + expectedError + ); + await assert.rejects(client.updateTlsRoute(request), expectedError); + const actualRequest = ( + client.innerApiCalls.updateTlsRoute as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateTlsRoute as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateTlsRoute with LRO error', async () => { + const client = new networkservicesModule.v1.NetworkServicesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.networkservices.v1.UpdateTlsRouteRequest() + ); + request.tlsRoute ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.networkservices.v1.UpdateTlsRouteRequest', + ['tlsRoute', 'name'] + ); + request.tlsRoute.name = defaultValue1; + const expectedHeaderRequestParams = `tls_route.name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.updateTlsRoute = stubLongRunningCall( + undefined, + undefined, + expectedError + ); + const [operation] = await client.updateTlsRoute(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = ( + client.innerApiCalls.updateTlsRoute as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateTlsRoute as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkUpdateTlsRouteProgress without error', async () => { + const client = new networkservicesModule.v1.NetworkServicesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + 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.checkUpdateTlsRouteProgress( + expectedResponse.name + ); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkUpdateTlsRouteProgress with error', async () => { + const client = new networkservicesModule.v1.NetworkServicesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const expectedError = new Error('expected'); + + client.operationsClient.getOperation = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects( + client.checkUpdateTlsRouteProgress(''), + expectedError + ); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + }); + + describe('deleteTlsRoute', () => { + it('invokes deleteTlsRoute without error', async () => { + const client = new networkservicesModule.v1.NetworkServicesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.networkservices.v1.DeleteTlsRouteRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.networkservices.v1.DeleteTlsRouteRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.deleteTlsRoute = + stubLongRunningCall(expectedResponse); + const [operation] = await client.deleteTlsRoute(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.deleteTlsRoute as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteTlsRoute as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteTlsRoute without error using callback', async () => { + const client = new networkservicesModule.v1.NetworkServicesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.networkservices.v1.DeleteTlsRouteRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.networkservices.v1.DeleteTlsRouteRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.deleteTlsRoute = + stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.deleteTlsRoute( + request, + ( + err?: Error | null, + result?: LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.networkservices.v1.IOperationMetadata + > | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const operation = (await promise) as LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.networkservices.v1.IOperationMetadata + >; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.deleteTlsRoute as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteTlsRoute as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteTlsRoute with call error', async () => { + const client = new networkservicesModule.v1.NetworkServicesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.networkservices.v1.DeleteTlsRouteRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.networkservices.v1.DeleteTlsRouteRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteTlsRoute = stubLongRunningCall( + undefined, + expectedError + ); + await assert.rejects(client.deleteTlsRoute(request), expectedError); + const actualRequest = ( + client.innerApiCalls.deleteTlsRoute as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteTlsRoute as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteTlsRoute with LRO error', async () => { + const client = new networkservicesModule.v1.NetworkServicesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.networkservices.v1.DeleteTlsRouteRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.networkservices.v1.DeleteTlsRouteRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteTlsRoute = stubLongRunningCall( + undefined, + undefined, + expectedError + ); + const [operation] = await client.deleteTlsRoute(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = ( + client.innerApiCalls.deleteTlsRoute as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteTlsRoute as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkDeleteTlsRouteProgress without error', async () => { + const client = new networkservicesModule.v1.NetworkServicesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + 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.checkDeleteTlsRouteProgress( + expectedResponse.name + ); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkDeleteTlsRouteProgress with error', async () => { + const client = new networkservicesModule.v1.NetworkServicesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const expectedError = new Error('expected'); + + client.operationsClient.getOperation = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects( + client.checkDeleteTlsRouteProgress(''), + expectedError + ); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + }); + + describe('createServiceBinding', () => { + it('invokes createServiceBinding without error', async () => { + const client = new networkservicesModule.v1.NetworkServicesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.networkservices.v1.CreateServiceBindingRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.networkservices.v1.CreateServiceBindingRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.createServiceBinding = + stubLongRunningCall(expectedResponse); + const [operation] = await client.createServiceBinding(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.createServiceBinding as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createServiceBinding as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createServiceBinding without error using callback', async () => { + const client = new networkservicesModule.v1.NetworkServicesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.networkservices.v1.CreateServiceBindingRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.networkservices.v1.CreateServiceBindingRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.createServiceBinding = + stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.createServiceBinding( + request, + ( + err?: Error | null, + result?: LROperation< + protos.google.cloud.networkservices.v1.IServiceBinding, + protos.google.cloud.networkservices.v1.IOperationMetadata + > | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const operation = (await promise) as LROperation< + protos.google.cloud.networkservices.v1.IServiceBinding, + protos.google.cloud.networkservices.v1.IOperationMetadata + >; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.createServiceBinding as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createServiceBinding as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createServiceBinding with call error', async () => { + const client = new networkservicesModule.v1.NetworkServicesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.networkservices.v1.CreateServiceBindingRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.networkservices.v1.CreateServiceBindingRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.createServiceBinding = stubLongRunningCall( + undefined, + expectedError + ); + await assert.rejects(client.createServiceBinding(request), expectedError); + const actualRequest = ( + client.innerApiCalls.createServiceBinding as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createServiceBinding as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createServiceBinding with LRO error', async () => { + const client = new networkservicesModule.v1.NetworkServicesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.networkservices.v1.CreateServiceBindingRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.networkservices.v1.CreateServiceBindingRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.createServiceBinding = stubLongRunningCall( + undefined, + undefined, + expectedError + ); + const [operation] = await client.createServiceBinding(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = ( + client.innerApiCalls.createServiceBinding as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createServiceBinding as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkCreateServiceBindingProgress without error', async () => { + const client = new networkservicesModule.v1.NetworkServicesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + 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.checkCreateServiceBindingProgress( + expectedResponse.name + ); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkCreateServiceBindingProgress with error', async () => { + const client = new networkservicesModule.v1.NetworkServicesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const expectedError = new Error('expected'); + + client.operationsClient.getOperation = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects( + client.checkCreateServiceBindingProgress(''), + expectedError + ); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + }); + + describe('deleteServiceBinding', () => { + it('invokes deleteServiceBinding without error', async () => { + const client = new networkservicesModule.v1.NetworkServicesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.networkservices.v1.DeleteServiceBindingRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.networkservices.v1.DeleteServiceBindingRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.deleteServiceBinding = + stubLongRunningCall(expectedResponse); + const [operation] = await client.deleteServiceBinding(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.deleteServiceBinding as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteServiceBinding as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteServiceBinding without error using callback', async () => { + const client = new networkservicesModule.v1.NetworkServicesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.networkservices.v1.DeleteServiceBindingRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.networkservices.v1.DeleteServiceBindingRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.deleteServiceBinding = + stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.deleteServiceBinding( + request, + ( + err?: Error | null, + result?: LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.networkservices.v1.IOperationMetadata + > | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const operation = (await promise) as LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.networkservices.v1.IOperationMetadata + >; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.deleteServiceBinding as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteServiceBinding as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteServiceBinding with call error', async () => { + const client = new networkservicesModule.v1.NetworkServicesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.networkservices.v1.DeleteServiceBindingRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.networkservices.v1.DeleteServiceBindingRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteServiceBinding = stubLongRunningCall( + undefined, + expectedError + ); + await assert.rejects(client.deleteServiceBinding(request), expectedError); + const actualRequest = ( + client.innerApiCalls.deleteServiceBinding as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteServiceBinding as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteServiceBinding with LRO error', async () => { + const client = new networkservicesModule.v1.NetworkServicesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.networkservices.v1.DeleteServiceBindingRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.networkservices.v1.DeleteServiceBindingRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteServiceBinding = stubLongRunningCall( + undefined, + undefined, + expectedError + ); + const [operation] = await client.deleteServiceBinding(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = ( + client.innerApiCalls.deleteServiceBinding as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteServiceBinding as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkDeleteServiceBindingProgress without error', async () => { + const client = new networkservicesModule.v1.NetworkServicesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + 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.checkDeleteServiceBindingProgress( + expectedResponse.name + ); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkDeleteServiceBindingProgress with error', async () => { + const client = new networkservicesModule.v1.NetworkServicesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const expectedError = new Error('expected'); + + client.operationsClient.getOperation = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects( + client.checkDeleteServiceBindingProgress(''), + expectedError + ); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + }); + + describe('createMesh', () => { + it('invokes createMesh without error', async () => { + const client = new networkservicesModule.v1.NetworkServicesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.networkservices.v1.CreateMeshRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.networkservices.v1.CreateMeshRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.createMesh = stubLongRunningCall(expectedResponse); + const [operation] = await client.createMesh(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.createMesh as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createMesh as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createMesh without error using callback', async () => { + const client = new networkservicesModule.v1.NetworkServicesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.networkservices.v1.CreateMeshRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.networkservices.v1.CreateMeshRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.createMesh = + stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.createMesh( + request, + ( + err?: Error | null, + result?: LROperation< + protos.google.cloud.networkservices.v1.IMesh, + protos.google.cloud.networkservices.v1.IOperationMetadata + > | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const operation = (await promise) as LROperation< + protos.google.cloud.networkservices.v1.IMesh, + protos.google.cloud.networkservices.v1.IOperationMetadata + >; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.createMesh as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createMesh as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createMesh with call error', async () => { + const client = new networkservicesModule.v1.NetworkServicesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.networkservices.v1.CreateMeshRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.networkservices.v1.CreateMeshRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.createMesh = stubLongRunningCall( + undefined, + expectedError + ); + await assert.rejects(client.createMesh(request), expectedError); + const actualRequest = ( + client.innerApiCalls.createMesh as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createMesh as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createMesh with LRO error', async () => { + const client = new networkservicesModule.v1.NetworkServicesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.networkservices.v1.CreateMeshRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.networkservices.v1.CreateMeshRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.createMesh = stubLongRunningCall( + undefined, + undefined, + expectedError + ); + const [operation] = await client.createMesh(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = ( + client.innerApiCalls.createMesh as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createMesh as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkCreateMeshProgress without error', async () => { + const client = new networkservicesModule.v1.NetworkServicesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + 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.checkCreateMeshProgress( + expectedResponse.name + ); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkCreateMeshProgress with error', async () => { + const client = new networkservicesModule.v1.NetworkServicesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const expectedError = new Error('expected'); + + client.operationsClient.getOperation = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.checkCreateMeshProgress(''), expectedError); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + }); + + describe('updateMesh', () => { + it('invokes updateMesh without error', async () => { + const client = new networkservicesModule.v1.NetworkServicesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.networkservices.v1.UpdateMeshRequest() + ); + request.mesh ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.networkservices.v1.UpdateMeshRequest', + ['mesh', 'name'] + ); + request.mesh.name = defaultValue1; + const expectedHeaderRequestParams = `mesh.name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.updateMesh = stubLongRunningCall(expectedResponse); + const [operation] = await client.updateMesh(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.updateMesh as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateMesh as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateMesh without error using callback', async () => { + const client = new networkservicesModule.v1.NetworkServicesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.networkservices.v1.UpdateMeshRequest() + ); + request.mesh ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.networkservices.v1.UpdateMeshRequest', + ['mesh', 'name'] + ); + request.mesh.name = defaultValue1; + const expectedHeaderRequestParams = `mesh.name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.updateMesh = + stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.updateMesh( + request, + ( + err?: Error | null, + result?: LROperation< + protos.google.cloud.networkservices.v1.IMesh, + protos.google.cloud.networkservices.v1.IOperationMetadata + > | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const operation = (await promise) as LROperation< + protos.google.cloud.networkservices.v1.IMesh, + protos.google.cloud.networkservices.v1.IOperationMetadata + >; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.updateMesh as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateMesh as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateMesh with call error', async () => { + const client = new networkservicesModule.v1.NetworkServicesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.networkservices.v1.UpdateMeshRequest() + ); + request.mesh ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.networkservices.v1.UpdateMeshRequest', + ['mesh', 'name'] + ); + request.mesh.name = defaultValue1; + const expectedHeaderRequestParams = `mesh.name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.updateMesh = stubLongRunningCall( + undefined, + expectedError + ); + await assert.rejects(client.updateMesh(request), expectedError); + const actualRequest = ( + client.innerApiCalls.updateMesh as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateMesh as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateMesh with LRO error', async () => { + const client = new networkservicesModule.v1.NetworkServicesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.networkservices.v1.UpdateMeshRequest() + ); + request.mesh ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.networkservices.v1.UpdateMeshRequest', + ['mesh', 'name'] + ); + request.mesh.name = defaultValue1; + const expectedHeaderRequestParams = `mesh.name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.updateMesh = stubLongRunningCall( + undefined, + undefined, + expectedError + ); + const [operation] = await client.updateMesh(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = ( + client.innerApiCalls.updateMesh as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateMesh as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkUpdateMeshProgress without error', async () => { + const client = new networkservicesModule.v1.NetworkServicesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + 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.checkUpdateMeshProgress( + expectedResponse.name + ); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkUpdateMeshProgress with error', async () => { + const client = new networkservicesModule.v1.NetworkServicesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const expectedError = new Error('expected'); + + client.operationsClient.getOperation = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.checkUpdateMeshProgress(''), expectedError); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + }); + + describe('deleteMesh', () => { + it('invokes deleteMesh without error', async () => { + const client = new networkservicesModule.v1.NetworkServicesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.networkservices.v1.DeleteMeshRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.networkservices.v1.DeleteMeshRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.deleteMesh = stubLongRunningCall(expectedResponse); + const [operation] = await client.deleteMesh(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.deleteMesh as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteMesh as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteMesh without error using callback', async () => { + const client = new networkservicesModule.v1.NetworkServicesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.networkservices.v1.DeleteMeshRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.networkservices.v1.DeleteMeshRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.deleteMesh = + stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.deleteMesh( + request, + ( + err?: Error | null, + result?: LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.networkservices.v1.IOperationMetadata + > | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const operation = (await promise) as LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.networkservices.v1.IOperationMetadata + >; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.deleteMesh as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteMesh as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteMesh with call error', async () => { + const client = new networkservicesModule.v1.NetworkServicesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.networkservices.v1.DeleteMeshRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.networkservices.v1.DeleteMeshRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteMesh = stubLongRunningCall( + undefined, + expectedError + ); + await assert.rejects(client.deleteMesh(request), expectedError); + const actualRequest = ( + client.innerApiCalls.deleteMesh as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteMesh as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteMesh with LRO error', async () => { + const client = new networkservicesModule.v1.NetworkServicesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.networkservices.v1.DeleteMeshRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.networkservices.v1.DeleteMeshRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteMesh = stubLongRunningCall( + undefined, + undefined, + expectedError + ); + const [operation] = await client.deleteMesh(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = ( + client.innerApiCalls.deleteMesh as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteMesh as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkDeleteMeshProgress without error', async () => { + const client = new networkservicesModule.v1.NetworkServicesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + 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.checkDeleteMeshProgress( + expectedResponse.name + ); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkDeleteMeshProgress with error', async () => { + const client = new networkservicesModule.v1.NetworkServicesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const expectedError = new Error('expected'); + + client.operationsClient.getOperation = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.checkDeleteMeshProgress(''), expectedError); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + }); + + describe('listEndpointPolicies', () => { + it('invokes listEndpointPolicies without error', async () => { + const client = new networkservicesModule.v1.NetworkServicesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.networkservices.v1.ListEndpointPoliciesRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.networkservices.v1.ListEndpointPoliciesRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.networkservices.v1.EndpointPolicy() + ), + generateSampleMessage( + new protos.google.cloud.networkservices.v1.EndpointPolicy() + ), + generateSampleMessage( + new protos.google.cloud.networkservices.v1.EndpointPolicy() + ), + ]; + client.innerApiCalls.listEndpointPolicies = + stubSimpleCall(expectedResponse); + const [response] = await client.listEndpointPolicies(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.listEndpointPolicies as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listEndpointPolicies as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listEndpointPolicies without error using callback', async () => { + const client = new networkservicesModule.v1.NetworkServicesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.networkservices.v1.ListEndpointPoliciesRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.networkservices.v1.ListEndpointPoliciesRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.networkservices.v1.EndpointPolicy() + ), + generateSampleMessage( + new protos.google.cloud.networkservices.v1.EndpointPolicy() + ), + generateSampleMessage( + new protos.google.cloud.networkservices.v1.EndpointPolicy() + ), + ]; + client.innerApiCalls.listEndpointPolicies = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.listEndpointPolicies( + request, + ( + err?: Error | null, + result?: + | protos.google.cloud.networkservices.v1.IEndpointPolicy[] + | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.listEndpointPolicies as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listEndpointPolicies as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listEndpointPolicies with error', async () => { + const client = new networkservicesModule.v1.NetworkServicesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.networkservices.v1.ListEndpointPoliciesRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.networkservices.v1.ListEndpointPoliciesRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.listEndpointPolicies = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.listEndpointPolicies(request), expectedError); + const actualRequest = ( + client.innerApiCalls.listEndpointPolicies as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listEndpointPolicies as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listEndpointPoliciesStream without error', async () => { + const client = new networkservicesModule.v1.NetworkServicesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.networkservices.v1.ListEndpointPoliciesRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.networkservices.v1.ListEndpointPoliciesRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.networkservices.v1.EndpointPolicy() + ), + generateSampleMessage( + new protos.google.cloud.networkservices.v1.EndpointPolicy() + ), + generateSampleMessage( + new protos.google.cloud.networkservices.v1.EndpointPolicy() + ), + ]; + client.descriptors.page.listEndpointPolicies.createStream = + stubPageStreamingCall(expectedResponse); + const stream = client.listEndpointPoliciesStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.networkservices.v1.EndpointPolicy[] = + []; + stream.on( + 'data', + (response: protos.google.cloud.networkservices.v1.EndpointPolicy) => { + 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.listEndpointPolicies.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.listEndpointPolicies, request) + ); + assert( + (client.descriptors.page.listEndpointPolicies.createStream as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('invokes listEndpointPoliciesStream with error', async () => { + const client = new networkservicesModule.v1.NetworkServicesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.networkservices.v1.ListEndpointPoliciesRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.networkservices.v1.ListEndpointPoliciesRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.descriptors.page.listEndpointPolicies.createStream = + stubPageStreamingCall(undefined, expectedError); + const stream = client.listEndpointPoliciesStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.networkservices.v1.EndpointPolicy[] = + []; + stream.on( + 'data', + (response: protos.google.cloud.networkservices.v1.EndpointPolicy) => { + responses.push(response); + } + ); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert( + (client.descriptors.page.listEndpointPolicies.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.listEndpointPolicies, request) + ); + assert( + (client.descriptors.page.listEndpointPolicies.createStream as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listEndpointPolicies without error', async () => { + const client = new networkservicesModule.v1.NetworkServicesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.networkservices.v1.ListEndpointPoliciesRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.networkservices.v1.ListEndpointPoliciesRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.networkservices.v1.EndpointPolicy() + ), + generateSampleMessage( + new protos.google.cloud.networkservices.v1.EndpointPolicy() + ), + generateSampleMessage( + new protos.google.cloud.networkservices.v1.EndpointPolicy() + ), + ]; + client.descriptors.page.listEndpointPolicies.asyncIterate = + stubAsyncIterationCall(expectedResponse); + const responses: protos.google.cloud.networkservices.v1.IEndpointPolicy[] = + []; + const iterable = client.listEndpointPoliciesAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + ( + client.descriptors.page.listEndpointPolicies.asyncIterate as SinonStub + ).getCall(0).args[1], + request + ); + assert( + (client.descriptors.page.listEndpointPolicies.asyncIterate as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listEndpointPolicies with error', async () => { + const client = new networkservicesModule.v1.NetworkServicesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.networkservices.v1.ListEndpointPoliciesRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.networkservices.v1.ListEndpointPoliciesRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.descriptors.page.listEndpointPolicies.asyncIterate = + stubAsyncIterationCall(undefined, expectedError); + const iterable = client.listEndpointPoliciesAsync(request); + await assert.rejects(async () => { + const responses: protos.google.cloud.networkservices.v1.IEndpointPolicy[] = + []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + ( + client.descriptors.page.listEndpointPolicies.asyncIterate as SinonStub + ).getCall(0).args[1], + request + ); + assert( + (client.descriptors.page.listEndpointPolicies.asyncIterate as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + }); + + describe('listGateways', () => { + it('invokes listGateways without error', async () => { + const client = new networkservicesModule.v1.NetworkServicesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.networkservices.v1.ListGatewaysRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.networkservices.v1.ListGatewaysRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.networkservices.v1.Gateway() + ), + generateSampleMessage( + new protos.google.cloud.networkservices.v1.Gateway() + ), + generateSampleMessage( + new protos.google.cloud.networkservices.v1.Gateway() + ), + ]; + client.innerApiCalls.listGateways = stubSimpleCall(expectedResponse); + const [response] = await client.listGateways(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.listGateways as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listGateways as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listGateways without error using callback', async () => { + const client = new networkservicesModule.v1.NetworkServicesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.networkservices.v1.ListGatewaysRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.networkservices.v1.ListGatewaysRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.networkservices.v1.Gateway() + ), + generateSampleMessage( + new protos.google.cloud.networkservices.v1.Gateway() + ), + generateSampleMessage( + new protos.google.cloud.networkservices.v1.Gateway() + ), + ]; + client.innerApiCalls.listGateways = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.listGateways( + request, + ( + err?: Error | null, + result?: protos.google.cloud.networkservices.v1.IGateway[] | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.listGateways as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listGateways as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listGateways with error', async () => { + const client = new networkservicesModule.v1.NetworkServicesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.networkservices.v1.ListGatewaysRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.networkservices.v1.ListGatewaysRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.listGateways = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.listGateways(request), expectedError); + const actualRequest = ( + client.innerApiCalls.listGateways as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listGateways as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listGatewaysStream without error', async () => { + const client = new networkservicesModule.v1.NetworkServicesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.networkservices.v1.ListGatewaysRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.networkservices.v1.ListGatewaysRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.networkservices.v1.Gateway() + ), + generateSampleMessage( + new protos.google.cloud.networkservices.v1.Gateway() + ), + generateSampleMessage( + new protos.google.cloud.networkservices.v1.Gateway() + ), + ]; + client.descriptors.page.listGateways.createStream = + stubPageStreamingCall(expectedResponse); + const stream = client.listGatewaysStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.networkservices.v1.Gateway[] = []; + stream.on( + 'data', + (response: protos.google.cloud.networkservices.v1.Gateway) => { + 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.listGateways.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.listGateways, request) + ); + assert( + (client.descriptors.page.listGateways.createStream as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('invokes listGatewaysStream with error', async () => { + const client = new networkservicesModule.v1.NetworkServicesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.networkservices.v1.ListGatewaysRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.networkservices.v1.ListGatewaysRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.descriptors.page.listGateways.createStream = stubPageStreamingCall( + undefined, + expectedError + ); + const stream = client.listGatewaysStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.networkservices.v1.Gateway[] = []; + stream.on( + 'data', + (response: protos.google.cloud.networkservices.v1.Gateway) => { + responses.push(response); + } + ); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert( + (client.descriptors.page.listGateways.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.listGateways, request) + ); + assert( + (client.descriptors.page.listGateways.createStream as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listGateways without error', async () => { + const client = new networkservicesModule.v1.NetworkServicesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.networkservices.v1.ListGatewaysRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.networkservices.v1.ListGatewaysRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.networkservices.v1.Gateway() + ), + generateSampleMessage( + new protos.google.cloud.networkservices.v1.Gateway() + ), + generateSampleMessage( + new protos.google.cloud.networkservices.v1.Gateway() + ), + ]; + client.descriptors.page.listGateways.asyncIterate = + stubAsyncIterationCall(expectedResponse); + const responses: protos.google.cloud.networkservices.v1.IGateway[] = []; + const iterable = client.listGatewaysAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + ( + client.descriptors.page.listGateways.asyncIterate as SinonStub + ).getCall(0).args[1], + request + ); + assert( + (client.descriptors.page.listGateways.asyncIterate as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listGateways with error', async () => { + const client = new networkservicesModule.v1.NetworkServicesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.networkservices.v1.ListGatewaysRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.networkservices.v1.ListGatewaysRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.descriptors.page.listGateways.asyncIterate = + stubAsyncIterationCall(undefined, expectedError); + const iterable = client.listGatewaysAsync(request); + await assert.rejects(async () => { + const responses: protos.google.cloud.networkservices.v1.IGateway[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + ( + client.descriptors.page.listGateways.asyncIterate as SinonStub + ).getCall(0).args[1], + request + ); + assert( + (client.descriptors.page.listGateways.asyncIterate as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + }); + + describe('listGrpcRoutes', () => { + it('invokes listGrpcRoutes without error', async () => { + const client = new networkservicesModule.v1.NetworkServicesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.networkservices.v1.ListGrpcRoutesRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.networkservices.v1.ListGrpcRoutesRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.networkservices.v1.GrpcRoute() + ), + generateSampleMessage( + new protos.google.cloud.networkservices.v1.GrpcRoute() + ), + generateSampleMessage( + new protos.google.cloud.networkservices.v1.GrpcRoute() + ), + ]; + client.innerApiCalls.listGrpcRoutes = stubSimpleCall(expectedResponse); + const [response] = await client.listGrpcRoutes(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.listGrpcRoutes as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listGrpcRoutes as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listGrpcRoutes without error using callback', async () => { + const client = new networkservicesModule.v1.NetworkServicesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.networkservices.v1.ListGrpcRoutesRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.networkservices.v1.ListGrpcRoutesRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.networkservices.v1.GrpcRoute() + ), + generateSampleMessage( + new protos.google.cloud.networkservices.v1.GrpcRoute() + ), + generateSampleMessage( + new protos.google.cloud.networkservices.v1.GrpcRoute() + ), + ]; + client.innerApiCalls.listGrpcRoutes = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.listGrpcRoutes( + request, + ( + err?: Error | null, + result?: protos.google.cloud.networkservices.v1.IGrpcRoute[] | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.listGrpcRoutes as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listGrpcRoutes as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listGrpcRoutes with error', async () => { + const client = new networkservicesModule.v1.NetworkServicesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.networkservices.v1.ListGrpcRoutesRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.networkservices.v1.ListGrpcRoutesRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.listGrpcRoutes = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.listGrpcRoutes(request), expectedError); + const actualRequest = ( + client.innerApiCalls.listGrpcRoutes as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listGrpcRoutes as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listGrpcRoutesStream without error', async () => { + const client = new networkservicesModule.v1.NetworkServicesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.networkservices.v1.ListGrpcRoutesRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.networkservices.v1.ListGrpcRoutesRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.networkservices.v1.GrpcRoute() + ), + generateSampleMessage( + new protos.google.cloud.networkservices.v1.GrpcRoute() + ), + generateSampleMessage( + new protos.google.cloud.networkservices.v1.GrpcRoute() + ), + ]; + client.descriptors.page.listGrpcRoutes.createStream = + stubPageStreamingCall(expectedResponse); + const stream = client.listGrpcRoutesStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.networkservices.v1.GrpcRoute[] = + []; + stream.on( + 'data', + (response: protos.google.cloud.networkservices.v1.GrpcRoute) => { + 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.listGrpcRoutes.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.listGrpcRoutes, request) + ); + assert( + (client.descriptors.page.listGrpcRoutes.createStream as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('invokes listGrpcRoutesStream with error', async () => { + const client = new networkservicesModule.v1.NetworkServicesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.networkservices.v1.ListGrpcRoutesRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.networkservices.v1.ListGrpcRoutesRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.descriptors.page.listGrpcRoutes.createStream = + stubPageStreamingCall(undefined, expectedError); + const stream = client.listGrpcRoutesStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.networkservices.v1.GrpcRoute[] = + []; + stream.on( + 'data', + (response: protos.google.cloud.networkservices.v1.GrpcRoute) => { + responses.push(response); + } + ); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert( + (client.descriptors.page.listGrpcRoutes.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.listGrpcRoutes, request) + ); + assert( + (client.descriptors.page.listGrpcRoutes.createStream as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listGrpcRoutes without error', async () => { + const client = new networkservicesModule.v1.NetworkServicesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.networkservices.v1.ListGrpcRoutesRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.networkservices.v1.ListGrpcRoutesRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.networkservices.v1.GrpcRoute() + ), + generateSampleMessage( + new protos.google.cloud.networkservices.v1.GrpcRoute() + ), + generateSampleMessage( + new protos.google.cloud.networkservices.v1.GrpcRoute() + ), + ]; + client.descriptors.page.listGrpcRoutes.asyncIterate = + stubAsyncIterationCall(expectedResponse); + const responses: protos.google.cloud.networkservices.v1.IGrpcRoute[] = []; + const iterable = client.listGrpcRoutesAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + ( + client.descriptors.page.listGrpcRoutes.asyncIterate as SinonStub + ).getCall(0).args[1], + request + ); + assert( + (client.descriptors.page.listGrpcRoutes.asyncIterate as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listGrpcRoutes with error', async () => { + const client = new networkservicesModule.v1.NetworkServicesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.networkservices.v1.ListGrpcRoutesRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.networkservices.v1.ListGrpcRoutesRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.descriptors.page.listGrpcRoutes.asyncIterate = + stubAsyncIterationCall(undefined, expectedError); + const iterable = client.listGrpcRoutesAsync(request); + await assert.rejects(async () => { + const responses: protos.google.cloud.networkservices.v1.IGrpcRoute[] = + []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + ( + client.descriptors.page.listGrpcRoutes.asyncIterate as SinonStub + ).getCall(0).args[1], + request + ); + assert( + (client.descriptors.page.listGrpcRoutes.asyncIterate as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + }); + + describe('listHttpRoutes', () => { + it('invokes listHttpRoutes without error', async () => { + const client = new networkservicesModule.v1.NetworkServicesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.networkservices.v1.ListHttpRoutesRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.networkservices.v1.ListHttpRoutesRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.networkservices.v1.HttpRoute() + ), + generateSampleMessage( + new protos.google.cloud.networkservices.v1.HttpRoute() + ), + generateSampleMessage( + new protos.google.cloud.networkservices.v1.HttpRoute() + ), + ]; + client.innerApiCalls.listHttpRoutes = stubSimpleCall(expectedResponse); + const [response] = await client.listHttpRoutes(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.listHttpRoutes as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listHttpRoutes as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listHttpRoutes without error using callback', async () => { + const client = new networkservicesModule.v1.NetworkServicesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.networkservices.v1.ListHttpRoutesRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.networkservices.v1.ListHttpRoutesRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.networkservices.v1.HttpRoute() + ), + generateSampleMessage( + new protos.google.cloud.networkservices.v1.HttpRoute() + ), + generateSampleMessage( + new protos.google.cloud.networkservices.v1.HttpRoute() + ), + ]; + client.innerApiCalls.listHttpRoutes = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.listHttpRoutes( + request, + ( + err?: Error | null, + result?: protos.google.cloud.networkservices.v1.IHttpRoute[] | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.listHttpRoutes as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listHttpRoutes as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listHttpRoutes with error', async () => { + const client = new networkservicesModule.v1.NetworkServicesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.networkservices.v1.ListHttpRoutesRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.networkservices.v1.ListHttpRoutesRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.listHttpRoutes = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.listHttpRoutes(request), expectedError); + const actualRequest = ( + client.innerApiCalls.listHttpRoutes as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listHttpRoutes as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listHttpRoutesStream without error', async () => { + const client = new networkservicesModule.v1.NetworkServicesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.networkservices.v1.ListHttpRoutesRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.networkservices.v1.ListHttpRoutesRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.networkservices.v1.HttpRoute() + ), + generateSampleMessage( + new protos.google.cloud.networkservices.v1.HttpRoute() + ), + generateSampleMessage( + new protos.google.cloud.networkservices.v1.HttpRoute() + ), + ]; + client.descriptors.page.listHttpRoutes.createStream = + stubPageStreamingCall(expectedResponse); + const stream = client.listHttpRoutesStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.networkservices.v1.HttpRoute[] = + []; + stream.on( + 'data', + (response: protos.google.cloud.networkservices.v1.HttpRoute) => { + 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.listHttpRoutes.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.listHttpRoutes, request) + ); + assert( + (client.descriptors.page.listHttpRoutes.createStream as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('invokes listHttpRoutesStream with error', async () => { + const client = new networkservicesModule.v1.NetworkServicesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.networkservices.v1.ListHttpRoutesRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.networkservices.v1.ListHttpRoutesRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.descriptors.page.listHttpRoutes.createStream = + stubPageStreamingCall(undefined, expectedError); + const stream = client.listHttpRoutesStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.networkservices.v1.HttpRoute[] = + []; + stream.on( + 'data', + (response: protos.google.cloud.networkservices.v1.HttpRoute) => { + responses.push(response); + } + ); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert( + (client.descriptors.page.listHttpRoutes.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.listHttpRoutes, request) + ); + assert( + (client.descriptors.page.listHttpRoutes.createStream as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listHttpRoutes without error', async () => { + const client = new networkservicesModule.v1.NetworkServicesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.networkservices.v1.ListHttpRoutesRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.networkservices.v1.ListHttpRoutesRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.networkservices.v1.HttpRoute() + ), + generateSampleMessage( + new protos.google.cloud.networkservices.v1.HttpRoute() + ), + generateSampleMessage( + new protos.google.cloud.networkservices.v1.HttpRoute() + ), + ]; + client.descriptors.page.listHttpRoutes.asyncIterate = + stubAsyncIterationCall(expectedResponse); + const responses: protos.google.cloud.networkservices.v1.IHttpRoute[] = []; + const iterable = client.listHttpRoutesAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + ( + client.descriptors.page.listHttpRoutes.asyncIterate as SinonStub + ).getCall(0).args[1], + request + ); + assert( + (client.descriptors.page.listHttpRoutes.asyncIterate as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listHttpRoutes with error', async () => { + const client = new networkservicesModule.v1.NetworkServicesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.networkservices.v1.ListHttpRoutesRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.networkservices.v1.ListHttpRoutesRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.descriptors.page.listHttpRoutes.asyncIterate = + stubAsyncIterationCall(undefined, expectedError); + const iterable = client.listHttpRoutesAsync(request); + await assert.rejects(async () => { + const responses: protos.google.cloud.networkservices.v1.IHttpRoute[] = + []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + ( + client.descriptors.page.listHttpRoutes.asyncIterate as SinonStub + ).getCall(0).args[1], + request + ); + assert( + (client.descriptors.page.listHttpRoutes.asyncIterate as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + }); + + describe('listTcpRoutes', () => { + it('invokes listTcpRoutes without error', async () => { + const client = new networkservicesModule.v1.NetworkServicesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.networkservices.v1.ListTcpRoutesRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.networkservices.v1.ListTcpRoutesRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.networkservices.v1.TcpRoute() + ), + generateSampleMessage( + new protos.google.cloud.networkservices.v1.TcpRoute() + ), + generateSampleMessage( + new protos.google.cloud.networkservices.v1.TcpRoute() + ), + ]; + client.innerApiCalls.listTcpRoutes = stubSimpleCall(expectedResponse); + const [response] = await client.listTcpRoutes(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.listTcpRoutes as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listTcpRoutes as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listTcpRoutes without error using callback', async () => { + const client = new networkservicesModule.v1.NetworkServicesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.networkservices.v1.ListTcpRoutesRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.networkservices.v1.ListTcpRoutesRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.networkservices.v1.TcpRoute() + ), + generateSampleMessage( + new protos.google.cloud.networkservices.v1.TcpRoute() + ), + generateSampleMessage( + new protos.google.cloud.networkservices.v1.TcpRoute() + ), + ]; + client.innerApiCalls.listTcpRoutes = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.listTcpRoutes( + request, + ( + err?: Error | null, + result?: protos.google.cloud.networkservices.v1.ITcpRoute[] | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.listTcpRoutes as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listTcpRoutes as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listTcpRoutes with error', async () => { + const client = new networkservicesModule.v1.NetworkServicesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.networkservices.v1.ListTcpRoutesRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.networkservices.v1.ListTcpRoutesRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.listTcpRoutes = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.listTcpRoutes(request), expectedError); + const actualRequest = ( + client.innerApiCalls.listTcpRoutes as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listTcpRoutes as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listTcpRoutesStream without error', async () => { + const client = new networkservicesModule.v1.NetworkServicesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.networkservices.v1.ListTcpRoutesRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.networkservices.v1.ListTcpRoutesRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.networkservices.v1.TcpRoute() + ), + generateSampleMessage( + new protos.google.cloud.networkservices.v1.TcpRoute() + ), + generateSampleMessage( + new protos.google.cloud.networkservices.v1.TcpRoute() + ), + ]; + client.descriptors.page.listTcpRoutes.createStream = + stubPageStreamingCall(expectedResponse); + const stream = client.listTcpRoutesStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.networkservices.v1.TcpRoute[] = []; + stream.on( + 'data', + (response: protos.google.cloud.networkservices.v1.TcpRoute) => { + 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.listTcpRoutes.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.listTcpRoutes, request) + ); + assert( + (client.descriptors.page.listTcpRoutes.createStream as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('invokes listTcpRoutesStream with error', async () => { + const client = new networkservicesModule.v1.NetworkServicesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.networkservices.v1.ListTcpRoutesRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.networkservices.v1.ListTcpRoutesRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.descriptors.page.listTcpRoutes.createStream = + stubPageStreamingCall(undefined, expectedError); + const stream = client.listTcpRoutesStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.networkservices.v1.TcpRoute[] = []; + stream.on( + 'data', + (response: protos.google.cloud.networkservices.v1.TcpRoute) => { + responses.push(response); + } + ); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert( + (client.descriptors.page.listTcpRoutes.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.listTcpRoutes, request) + ); + assert( + (client.descriptors.page.listTcpRoutes.createStream as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listTcpRoutes without error', async () => { + const client = new networkservicesModule.v1.NetworkServicesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.networkservices.v1.ListTcpRoutesRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.networkservices.v1.ListTcpRoutesRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.networkservices.v1.TcpRoute() + ), + generateSampleMessage( + new protos.google.cloud.networkservices.v1.TcpRoute() + ), + generateSampleMessage( + new protos.google.cloud.networkservices.v1.TcpRoute() + ), + ]; + client.descriptors.page.listTcpRoutes.asyncIterate = + stubAsyncIterationCall(expectedResponse); + const responses: protos.google.cloud.networkservices.v1.ITcpRoute[] = []; + const iterable = client.listTcpRoutesAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + ( + client.descriptors.page.listTcpRoutes.asyncIterate as SinonStub + ).getCall(0).args[1], + request + ); + assert( + (client.descriptors.page.listTcpRoutes.asyncIterate as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listTcpRoutes with error', async () => { + const client = new networkservicesModule.v1.NetworkServicesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.networkservices.v1.ListTcpRoutesRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.networkservices.v1.ListTcpRoutesRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.descriptors.page.listTcpRoutes.asyncIterate = + stubAsyncIterationCall(undefined, expectedError); + const iterable = client.listTcpRoutesAsync(request); + await assert.rejects(async () => { + const responses: protos.google.cloud.networkservices.v1.ITcpRoute[] = + []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + ( + client.descriptors.page.listTcpRoutes.asyncIterate as SinonStub + ).getCall(0).args[1], + request + ); + assert( + (client.descriptors.page.listTcpRoutes.asyncIterate as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + }); + + describe('listTlsRoutes', () => { + it('invokes listTlsRoutes without error', async () => { + const client = new networkservicesModule.v1.NetworkServicesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.networkservices.v1.ListTlsRoutesRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.networkservices.v1.ListTlsRoutesRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.networkservices.v1.TlsRoute() + ), + generateSampleMessage( + new protos.google.cloud.networkservices.v1.TlsRoute() + ), + generateSampleMessage( + new protos.google.cloud.networkservices.v1.TlsRoute() + ), + ]; + client.innerApiCalls.listTlsRoutes = stubSimpleCall(expectedResponse); + const [response] = await client.listTlsRoutes(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.listTlsRoutes as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listTlsRoutes as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listTlsRoutes without error using callback', async () => { + const client = new networkservicesModule.v1.NetworkServicesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.networkservices.v1.ListTlsRoutesRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.networkservices.v1.ListTlsRoutesRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.networkservices.v1.TlsRoute() + ), + generateSampleMessage( + new protos.google.cloud.networkservices.v1.TlsRoute() + ), + generateSampleMessage( + new protos.google.cloud.networkservices.v1.TlsRoute() + ), + ]; + client.innerApiCalls.listTlsRoutes = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.listTlsRoutes( + request, + ( + err?: Error | null, + result?: protos.google.cloud.networkservices.v1.ITlsRoute[] | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.listTlsRoutes as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listTlsRoutes as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listTlsRoutes with error', async () => { + const client = new networkservicesModule.v1.NetworkServicesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.networkservices.v1.ListTlsRoutesRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.networkservices.v1.ListTlsRoutesRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.listTlsRoutes = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.listTlsRoutes(request), expectedError); + const actualRequest = ( + client.innerApiCalls.listTlsRoutes as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listTlsRoutes as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listTlsRoutesStream without error', async () => { + const client = new networkservicesModule.v1.NetworkServicesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.networkservices.v1.ListTlsRoutesRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.networkservices.v1.ListTlsRoutesRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.networkservices.v1.TlsRoute() + ), + generateSampleMessage( + new protos.google.cloud.networkservices.v1.TlsRoute() + ), + generateSampleMessage( + new protos.google.cloud.networkservices.v1.TlsRoute() + ), + ]; + client.descriptors.page.listTlsRoutes.createStream = + stubPageStreamingCall(expectedResponse); + const stream = client.listTlsRoutesStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.networkservices.v1.TlsRoute[] = []; + stream.on( + 'data', + (response: protos.google.cloud.networkservices.v1.TlsRoute) => { + 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.listTlsRoutes.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.listTlsRoutes, request) + ); + assert( + (client.descriptors.page.listTlsRoutes.createStream as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('invokes listTlsRoutesStream with error', async () => { + const client = new networkservicesModule.v1.NetworkServicesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.networkservices.v1.ListTlsRoutesRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.networkservices.v1.ListTlsRoutesRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.descriptors.page.listTlsRoutes.createStream = + stubPageStreamingCall(undefined, expectedError); + const stream = client.listTlsRoutesStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.networkservices.v1.TlsRoute[] = []; + stream.on( + 'data', + (response: protos.google.cloud.networkservices.v1.TlsRoute) => { + responses.push(response); + } + ); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert( + (client.descriptors.page.listTlsRoutes.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.listTlsRoutes, request) + ); + assert( + (client.descriptors.page.listTlsRoutes.createStream as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listTlsRoutes without error', async () => { + const client = new networkservicesModule.v1.NetworkServicesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.networkservices.v1.ListTlsRoutesRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.networkservices.v1.ListTlsRoutesRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.networkservices.v1.TlsRoute() + ), + generateSampleMessage( + new protos.google.cloud.networkservices.v1.TlsRoute() + ), + generateSampleMessage( + new protos.google.cloud.networkservices.v1.TlsRoute() + ), + ]; + client.descriptors.page.listTlsRoutes.asyncIterate = + stubAsyncIterationCall(expectedResponse); + const responses: protos.google.cloud.networkservices.v1.ITlsRoute[] = []; + const iterable = client.listTlsRoutesAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + ( + client.descriptors.page.listTlsRoutes.asyncIterate as SinonStub + ).getCall(0).args[1], + request + ); + assert( + (client.descriptors.page.listTlsRoutes.asyncIterate as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listTlsRoutes with error', async () => { + const client = new networkservicesModule.v1.NetworkServicesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.networkservices.v1.ListTlsRoutesRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.networkservices.v1.ListTlsRoutesRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.descriptors.page.listTlsRoutes.asyncIterate = + stubAsyncIterationCall(undefined, expectedError); + const iterable = client.listTlsRoutesAsync(request); + await assert.rejects(async () => { + const responses: protos.google.cloud.networkservices.v1.ITlsRoute[] = + []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + ( + client.descriptors.page.listTlsRoutes.asyncIterate as SinonStub + ).getCall(0).args[1], + request + ); + assert( + (client.descriptors.page.listTlsRoutes.asyncIterate as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + }); + + describe('listServiceBindings', () => { + it('invokes listServiceBindings without error', async () => { + const client = new networkservicesModule.v1.NetworkServicesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.networkservices.v1.ListServiceBindingsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.networkservices.v1.ListServiceBindingsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.networkservices.v1.ServiceBinding() + ), + generateSampleMessage( + new protos.google.cloud.networkservices.v1.ServiceBinding() + ), + generateSampleMessage( + new protos.google.cloud.networkservices.v1.ServiceBinding() + ), + ]; + client.innerApiCalls.listServiceBindings = + stubSimpleCall(expectedResponse); + const [response] = await client.listServiceBindings(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.listServiceBindings as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listServiceBindings as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listServiceBindings without error using callback', async () => { + const client = new networkservicesModule.v1.NetworkServicesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.networkservices.v1.ListServiceBindingsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.networkservices.v1.ListServiceBindingsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.networkservices.v1.ServiceBinding() + ), + generateSampleMessage( + new protos.google.cloud.networkservices.v1.ServiceBinding() + ), + generateSampleMessage( + new protos.google.cloud.networkservices.v1.ServiceBinding() + ), + ]; + client.innerApiCalls.listServiceBindings = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.listServiceBindings( + request, + ( + err?: Error | null, + result?: + | protos.google.cloud.networkservices.v1.IServiceBinding[] + | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.listServiceBindings as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listServiceBindings as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listServiceBindings with error', async () => { + const client = new networkservicesModule.v1.NetworkServicesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.networkservices.v1.ListServiceBindingsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.networkservices.v1.ListServiceBindingsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.listServiceBindings = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.listServiceBindings(request), expectedError); + const actualRequest = ( + client.innerApiCalls.listServiceBindings as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listServiceBindings as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listServiceBindingsStream without error', async () => { + const client = new networkservicesModule.v1.NetworkServicesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.networkservices.v1.ListServiceBindingsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.networkservices.v1.ListServiceBindingsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.networkservices.v1.ServiceBinding() + ), + generateSampleMessage( + new protos.google.cloud.networkservices.v1.ServiceBinding() + ), + generateSampleMessage( + new protos.google.cloud.networkservices.v1.ServiceBinding() + ), + ]; + client.descriptors.page.listServiceBindings.createStream = + stubPageStreamingCall(expectedResponse); + const stream = client.listServiceBindingsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.networkservices.v1.ServiceBinding[] = + []; + stream.on( + 'data', + (response: protos.google.cloud.networkservices.v1.ServiceBinding) => { + 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.listServiceBindings.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.listServiceBindings, request) + ); + assert( + (client.descriptors.page.listServiceBindings.createStream as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('invokes listServiceBindingsStream with error', async () => { + const client = new networkservicesModule.v1.NetworkServicesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.networkservices.v1.ListServiceBindingsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.networkservices.v1.ListServiceBindingsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.descriptors.page.listServiceBindings.createStream = + stubPageStreamingCall(undefined, expectedError); + const stream = client.listServiceBindingsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.networkservices.v1.ServiceBinding[] = + []; + stream.on( + 'data', + (response: protos.google.cloud.networkservices.v1.ServiceBinding) => { + responses.push(response); + } + ); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert( + (client.descriptors.page.listServiceBindings.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.listServiceBindings, request) + ); + assert( + (client.descriptors.page.listServiceBindings.createStream as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listServiceBindings without error', async () => { + const client = new networkservicesModule.v1.NetworkServicesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.networkservices.v1.ListServiceBindingsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.networkservices.v1.ListServiceBindingsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.networkservices.v1.ServiceBinding() + ), + generateSampleMessage( + new protos.google.cloud.networkservices.v1.ServiceBinding() + ), + generateSampleMessage( + new protos.google.cloud.networkservices.v1.ServiceBinding() + ), + ]; + client.descriptors.page.listServiceBindings.asyncIterate = + stubAsyncIterationCall(expectedResponse); + const responses: protos.google.cloud.networkservices.v1.IServiceBinding[] = + []; + const iterable = client.listServiceBindingsAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + ( + client.descriptors.page.listServiceBindings.asyncIterate as SinonStub + ).getCall(0).args[1], + request + ); + assert( + (client.descriptors.page.listServiceBindings.asyncIterate as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listServiceBindings with error', async () => { + const client = new networkservicesModule.v1.NetworkServicesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.networkservices.v1.ListServiceBindingsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.networkservices.v1.ListServiceBindingsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.descriptors.page.listServiceBindings.asyncIterate = + stubAsyncIterationCall(undefined, expectedError); + const iterable = client.listServiceBindingsAsync(request); + await assert.rejects(async () => { + const responses: protos.google.cloud.networkservices.v1.IServiceBinding[] = + []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + ( + client.descriptors.page.listServiceBindings.asyncIterate as SinonStub + ).getCall(0).args[1], + request + ); + assert( + (client.descriptors.page.listServiceBindings.asyncIterate as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + }); + + describe('listMeshes', () => { + it('invokes listMeshes without error', async () => { + const client = new networkservicesModule.v1.NetworkServicesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.networkservices.v1.ListMeshesRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.networkservices.v1.ListMeshesRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.networkservices.v1.Mesh() + ), + generateSampleMessage( + new protos.google.cloud.networkservices.v1.Mesh() + ), + generateSampleMessage( + new protos.google.cloud.networkservices.v1.Mesh() + ), + ]; + client.innerApiCalls.listMeshes = stubSimpleCall(expectedResponse); + const [response] = await client.listMeshes(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.listMeshes as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listMeshes as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listMeshes without error using callback', async () => { + const client = new networkservicesModule.v1.NetworkServicesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.networkservices.v1.ListMeshesRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.networkservices.v1.ListMeshesRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.networkservices.v1.Mesh() + ), + generateSampleMessage( + new protos.google.cloud.networkservices.v1.Mesh() + ), + generateSampleMessage( + new protos.google.cloud.networkservices.v1.Mesh() + ), + ]; + client.innerApiCalls.listMeshes = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.listMeshes( + request, + ( + err?: Error | null, + result?: protos.google.cloud.networkservices.v1.IMesh[] | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.listMeshes as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listMeshes as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listMeshes with error', async () => { + const client = new networkservicesModule.v1.NetworkServicesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.networkservices.v1.ListMeshesRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.networkservices.v1.ListMeshesRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.listMeshes = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.listMeshes(request), expectedError); + const actualRequest = ( + client.innerApiCalls.listMeshes as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listMeshes as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listMeshesStream without error', async () => { + const client = new networkservicesModule.v1.NetworkServicesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.networkservices.v1.ListMeshesRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.networkservices.v1.ListMeshesRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.networkservices.v1.Mesh() + ), + generateSampleMessage( + new protos.google.cloud.networkservices.v1.Mesh() + ), + generateSampleMessage( + new protos.google.cloud.networkservices.v1.Mesh() + ), + ]; + client.descriptors.page.listMeshes.createStream = + stubPageStreamingCall(expectedResponse); + const stream = client.listMeshesStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.networkservices.v1.Mesh[] = []; + stream.on( + 'data', + (response: protos.google.cloud.networkservices.v1.Mesh) => { + 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.listMeshes.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.listMeshes, request) + ); + assert( + (client.descriptors.page.listMeshes.createStream as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('invokes listMeshesStream with error', async () => { + const client = new networkservicesModule.v1.NetworkServicesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.networkservices.v1.ListMeshesRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.networkservices.v1.ListMeshesRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.descriptors.page.listMeshes.createStream = stubPageStreamingCall( + undefined, + expectedError + ); + const stream = client.listMeshesStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.networkservices.v1.Mesh[] = []; + stream.on( + 'data', + (response: protos.google.cloud.networkservices.v1.Mesh) => { + responses.push(response); + } + ); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert( + (client.descriptors.page.listMeshes.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.listMeshes, request) + ); + assert( + (client.descriptors.page.listMeshes.createStream as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listMeshes without error', async () => { + const client = new networkservicesModule.v1.NetworkServicesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.networkservices.v1.ListMeshesRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.networkservices.v1.ListMeshesRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.networkservices.v1.Mesh() + ), + generateSampleMessage( + new protos.google.cloud.networkservices.v1.Mesh() + ), + generateSampleMessage( + new protos.google.cloud.networkservices.v1.Mesh() + ), + ]; + client.descriptors.page.listMeshes.asyncIterate = + stubAsyncIterationCall(expectedResponse); + const responses: protos.google.cloud.networkservices.v1.IMesh[] = []; + const iterable = client.listMeshesAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + (client.descriptors.page.listMeshes.asyncIterate as SinonStub).getCall( + 0 + ).args[1], + request + ); + assert( + (client.descriptors.page.listMeshes.asyncIterate as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listMeshes with error', async () => { + const client = new networkservicesModule.v1.NetworkServicesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.networkservices.v1.ListMeshesRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.networkservices.v1.ListMeshesRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.descriptors.page.listMeshes.asyncIterate = stubAsyncIterationCall( + undefined, + expectedError + ); + const iterable = client.listMeshesAsync(request); + await assert.rejects(async () => { + const responses: protos.google.cloud.networkservices.v1.IMesh[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + (client.descriptors.page.listMeshes.asyncIterate as SinonStub).getCall( + 0 + ).args[1], + request + ); + assert( + (client.descriptors.page.listMeshes.asyncIterate as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + }); + describe('getIamPolicy', () => { + it('invokes getIamPolicy without error', async () => { + const client = new networkservicesModule.v1.NetworkServicesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new IamProtos.google.iam.v1.GetIamPolicyRequest() + ); + request.resource = ''; + const expectedHeaderRequestParams = 'resource='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new IamProtos.google.iam.v1.Policy() + ); + client.iamClient.getIamPolicy = stubSimpleCall(expectedResponse); + const response = await client.getIamPolicy(request, expectedOptions); + assert.deepStrictEqual(response, [expectedResponse]); + assert( + (client.iamClient.getIamPolicy as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + it('invokes getIamPolicy without error using callback', async () => { + const client = new networkservicesModule.v1.NetworkServicesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new IamProtos.google.iam.v1.GetIamPolicyRequest() + ); + request.resource = ''; + const expectedHeaderRequestParams = 'resource='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new IamProtos.google.iam.v1.Policy() + ); + client.iamClient.getIamPolicy = sinon + .stub() + .callsArgWith(2, null, expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getIamPolicy( + request, + expectedOptions, + ( + err?: Error | null, + result?: IamProtos.google.iam.v1.Policy | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.iamClient.getIamPolicy as SinonStub).getCall(0)); + }); + it('invokes getIamPolicy with error', async () => { + const client = new networkservicesModule.v1.NetworkServicesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new IamProtos.google.iam.v1.GetIamPolicyRequest() + ); + request.resource = ''; + const expectedHeaderRequestParams = 'resource='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.iamClient.getIamPolicy = stubSimpleCall(undefined, expectedError); + await assert.rejects( + client.getIamPolicy(request, expectedOptions), + expectedError + ); + assert( + (client.iamClient.getIamPolicy as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + }); + describe('setIamPolicy', () => { + it('invokes setIamPolicy without error', async () => { + const client = new networkservicesModule.v1.NetworkServicesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new IamProtos.google.iam.v1.SetIamPolicyRequest() + ); + request.resource = ''; + const expectedHeaderRequestParams = 'resource='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new IamProtos.google.iam.v1.Policy() + ); + client.iamClient.setIamPolicy = stubSimpleCall(expectedResponse); + const response = await client.setIamPolicy(request, expectedOptions); + assert.deepStrictEqual(response, [expectedResponse]); + assert( + (client.iamClient.setIamPolicy as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + it('invokes setIamPolicy without error using callback', async () => { + const client = new networkservicesModule.v1.NetworkServicesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new IamProtos.google.iam.v1.SetIamPolicyRequest() + ); + request.resource = ''; + const expectedHeaderRequestParams = 'resource='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new IamProtos.google.iam.v1.Policy() + ); + client.iamClient.setIamPolicy = sinon + .stub() + .callsArgWith(2, null, expectedResponse); + const promise = new Promise((resolve, reject) => { + client.setIamPolicy( + request, + expectedOptions, + ( + err?: Error | null, + result?: IamProtos.google.iam.v1.Policy | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.iamClient.setIamPolicy as SinonStub).getCall(0)); + }); + it('invokes setIamPolicy with error', async () => { + const client = new networkservicesModule.v1.NetworkServicesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new IamProtos.google.iam.v1.SetIamPolicyRequest() + ); + request.resource = ''; + const expectedHeaderRequestParams = 'resource='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.iamClient.setIamPolicy = stubSimpleCall(undefined, expectedError); + await assert.rejects( + client.setIamPolicy(request, expectedOptions), + expectedError + ); + assert( + (client.iamClient.setIamPolicy as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + }); + describe('testIamPermissions', () => { + it('invokes testIamPermissions without error', async () => { + const client = new networkservicesModule.v1.NetworkServicesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new IamProtos.google.iam.v1.TestIamPermissionsRequest() + ); + request.resource = ''; + const expectedHeaderRequestParams = 'resource='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new IamProtos.google.iam.v1.TestIamPermissionsResponse() + ); + client.iamClient.testIamPermissions = stubSimpleCall(expectedResponse); + const response = await client.testIamPermissions( + request, + expectedOptions + ); + assert.deepStrictEqual(response, [expectedResponse]); + assert( + (client.iamClient.testIamPermissions as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + it('invokes testIamPermissions without error using callback', async () => { + const client = new networkservicesModule.v1.NetworkServicesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new IamProtos.google.iam.v1.TestIamPermissionsRequest() + ); + request.resource = ''; + const expectedHeaderRequestParams = 'resource='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new IamProtos.google.iam.v1.TestIamPermissionsResponse() + ); + client.iamClient.testIamPermissions = sinon + .stub() + .callsArgWith(2, null, expectedResponse); + const promise = new Promise((resolve, reject) => { + client.testIamPermissions( + request, + expectedOptions, + ( + err?: Error | null, + result?: IamProtos.google.iam.v1.TestIamPermissionsResponse | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.iamClient.testIamPermissions as SinonStub).getCall(0)); + }); + it('invokes testIamPermissions with error', async () => { + const client = new networkservicesModule.v1.NetworkServicesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new IamProtos.google.iam.v1.TestIamPermissionsRequest() + ); + request.resource = ''; + const expectedHeaderRequestParams = 'resource='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.iamClient.testIamPermissions = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects( + client.testIamPermissions(request, expectedOptions), + expectedError + ); + assert( + (client.iamClient.testIamPermissions as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + }); + describe('getLocation', () => { + it('invokes getLocation without error', async () => { + const client = new networkservicesModule.v1.NetworkServicesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + 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 networkservicesModule.v1.NetworkServicesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + 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 networkservicesModule.v1.NetworkServicesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + 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 networkservicesModule.v1.NetworkServicesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + 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 networkservicesModule.v1.NetworkServicesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + 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 networkservicesModule.v1.NetworkServicesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + 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 networkservicesModule.v1.NetworkServicesClient({ + 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); + } + } + ); + }); + 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 networkservicesModule.v1.NetworkServicesClient({ + 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 networkservicesModule.v1.NetworkServicesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + 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 networkservicesModule.v1.NetworkServicesClient({ + 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); + } + } + ); + }); + 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 networkservicesModule.v1.NetworkServicesClient({ + 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 networkservicesModule.v1.NetworkServicesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + 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 networkservicesModule.v1.NetworkServicesClient({ + 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); + } + } + ); + }); + 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 networkservicesModule.v1.NetworkServicesClient({ + 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 networkservicesModule.v1.NetworkServicesClient({ + 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.ListOperationsResponse[] = + []; + 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 networkservicesModule.v1.NetworkServicesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + 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.ListOperationsResponse[] = + []; + 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('endpointPolicy', () => { + const fakePath = '/rendered/path/endpointPolicy'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + endpoint_policy: 'endpointPolicyValue', + }; + const client = new networkservicesModule.v1.NetworkServicesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.endpointPolicyPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.endpointPolicyPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('endpointPolicyPath', () => { + const result = client.endpointPolicyPath( + 'projectValue', + 'locationValue', + 'endpointPolicyValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.endpointPolicyPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromEndpointPolicyName', () => { + const result = client.matchProjectFromEndpointPolicyName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.endpointPolicyPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromEndpointPolicyName', () => { + const result = client.matchLocationFromEndpointPolicyName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.endpointPolicyPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchEndpointPolicyFromEndpointPolicyName', () => { + const result = + client.matchEndpointPolicyFromEndpointPolicyName(fakePath); + assert.strictEqual(result, 'endpointPolicyValue'); + assert( + (client.pathTemplates.endpointPolicyPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('gateway', () => { + const fakePath = '/rendered/path/gateway'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + gateway: 'gatewayValue', + }; + const client = new networkservicesModule.v1.NetworkServicesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.gatewayPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.gatewayPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('gatewayPath', () => { + const result = client.gatewayPath( + 'projectValue', + 'locationValue', + 'gatewayValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.gatewayPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromGatewayName', () => { + const result = client.matchProjectFromGatewayName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.gatewayPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromGatewayName', () => { + const result = client.matchLocationFromGatewayName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.gatewayPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchGatewayFromGatewayName', () => { + const result = client.matchGatewayFromGatewayName(fakePath); + assert.strictEqual(result, 'gatewayValue'); + assert( + (client.pathTemplates.gatewayPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('grpcRoute', () => { + const fakePath = '/rendered/path/grpcRoute'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + grpc_route: 'grpcRouteValue', + }; + const client = new networkservicesModule.v1.NetworkServicesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.grpcRoutePathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.grpcRoutePathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('grpcRoutePath', () => { + const result = client.grpcRoutePath( + 'projectValue', + 'locationValue', + 'grpcRouteValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.grpcRoutePathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromGrpcRouteName', () => { + const result = client.matchProjectFromGrpcRouteName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.grpcRoutePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromGrpcRouteName', () => { + const result = client.matchLocationFromGrpcRouteName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.grpcRoutePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchGrpcRouteFromGrpcRouteName', () => { + const result = client.matchGrpcRouteFromGrpcRouteName(fakePath); + assert.strictEqual(result, 'grpcRouteValue'); + assert( + (client.pathTemplates.grpcRoutePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('httpRoute', () => { + const fakePath = '/rendered/path/httpRoute'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + http_route: 'httpRouteValue', + }; + const client = new networkservicesModule.v1.NetworkServicesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.httpRoutePathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.httpRoutePathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('httpRoutePath', () => { + const result = client.httpRoutePath( + 'projectValue', + 'locationValue', + 'httpRouteValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.httpRoutePathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromHttpRouteName', () => { + const result = client.matchProjectFromHttpRouteName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.httpRoutePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromHttpRouteName', () => { + const result = client.matchLocationFromHttpRouteName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.httpRoutePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchHttpRouteFromHttpRouteName', () => { + const result = client.matchHttpRouteFromHttpRouteName(fakePath); + assert.strictEqual(result, 'httpRouteValue'); + assert( + (client.pathTemplates.httpRoutePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('mesh', () => { + const fakePath = '/rendered/path/mesh'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + mesh: 'meshValue', + }; + const client = new networkservicesModule.v1.NetworkServicesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.meshPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.meshPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('meshPath', () => { + const result = client.meshPath( + 'projectValue', + 'locationValue', + 'meshValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.meshPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromMeshName', () => { + const result = client.matchProjectFromMeshName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.meshPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromMeshName', () => { + const result = client.matchLocationFromMeshName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.meshPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchMeshFromMeshName', () => { + const result = client.matchMeshFromMeshName(fakePath); + assert.strictEqual(result, 'meshValue'); + assert( + (client.pathTemplates.meshPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('serviceBinding', () => { + const fakePath = '/rendered/path/serviceBinding'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + service_binding: 'serviceBindingValue', + }; + const client = new networkservicesModule.v1.NetworkServicesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.serviceBindingPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.serviceBindingPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('serviceBindingPath', () => { + const result = client.serviceBindingPath( + 'projectValue', + 'locationValue', + 'serviceBindingValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.serviceBindingPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromServiceBindingName', () => { + const result = client.matchProjectFromServiceBindingName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.serviceBindingPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromServiceBindingName', () => { + const result = client.matchLocationFromServiceBindingName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.serviceBindingPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchServiceBindingFromServiceBindingName', () => { + const result = + client.matchServiceBindingFromServiceBindingName(fakePath); + assert.strictEqual(result, 'serviceBindingValue'); + assert( + (client.pathTemplates.serviceBindingPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('tcpRoute', () => { + const fakePath = '/rendered/path/tcpRoute'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + tcp_route: 'tcpRouteValue', + }; + const client = new networkservicesModule.v1.NetworkServicesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.tcpRoutePathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.tcpRoutePathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('tcpRoutePath', () => { + const result = client.tcpRoutePath( + 'projectValue', + 'locationValue', + 'tcpRouteValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.tcpRoutePathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromTcpRouteName', () => { + const result = client.matchProjectFromTcpRouteName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.tcpRoutePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromTcpRouteName', () => { + const result = client.matchLocationFromTcpRouteName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.tcpRoutePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchTcpRouteFromTcpRouteName', () => { + const result = client.matchTcpRouteFromTcpRouteName(fakePath); + assert.strictEqual(result, 'tcpRouteValue'); + assert( + (client.pathTemplates.tcpRoutePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('tlsRoute', () => { + const fakePath = '/rendered/path/tlsRoute'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + tls_route: 'tlsRouteValue', + }; + const client = new networkservicesModule.v1.NetworkServicesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.tlsRoutePathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.tlsRoutePathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('tlsRoutePath', () => { + const result = client.tlsRoutePath( + 'projectValue', + 'locationValue', + 'tlsRouteValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.tlsRoutePathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromTlsRouteName', () => { + const result = client.matchProjectFromTlsRouteName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.tlsRoutePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromTlsRouteName', () => { + const result = client.matchLocationFromTlsRouteName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.tlsRoutePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchTlsRouteFromTlsRouteName', () => { + const result = client.matchTlsRouteFromTlsRouteName(fakePath); + assert.strictEqual(result, 'tlsRouteValue'); + assert( + (client.pathTemplates.tlsRoutePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + }); +}); diff --git a/packages/google-cloud-networkservices/test/gapic_network_services_v1beta1.ts b/packages/google-cloud-networkservices/test/gapic_network_services_v1beta1.ts new file mode 100644 index 00000000000..567ca157103 --- /dev/null +++ b/packages/google-cloud-networkservices/test/gapic_network_services_v1beta1.ts @@ -0,0 +1,1380 @@ +// Copyright 2023 Google LLC +// +// Licensed under the Apache License, Version 2.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 networkservicesModule 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 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('v1beta1.NetworkServicesClient', () => { + describe('Common methods', () => { + it('has servicePath', () => { + const servicePath = + networkservicesModule.v1beta1.NetworkServicesClient.servicePath; + assert(servicePath); + }); + + it('has apiEndpoint', () => { + const apiEndpoint = + networkservicesModule.v1beta1.NetworkServicesClient.apiEndpoint; + assert(apiEndpoint); + }); + + it('has port', () => { + const port = networkservicesModule.v1beta1.NetworkServicesClient.port; + assert(port); + assert(typeof port === 'number'); + }); + + it('should create a client with no option', () => { + const client = new networkservicesModule.v1beta1.NetworkServicesClient(); + assert(client); + }); + + it('should create a client with gRPC fallback', () => { + const client = new networkservicesModule.v1beta1.NetworkServicesClient({ + fallback: true, + }); + assert(client); + }); + + it('has initialize method and supports deferred initialization', async () => { + const client = new networkservicesModule.v1beta1.NetworkServicesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + assert.strictEqual(client.networkServicesStub, undefined); + await client.initialize(); + assert(client.networkServicesStub); + }); + + it('has close method for the initialized client', done => { + const client = new networkservicesModule.v1beta1.NetworkServicesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + assert(client.networkServicesStub); + client.close().then(() => { + done(); + }); + }); + + it('has close method for the non-initialized client', done => { + const client = new networkservicesModule.v1beta1.NetworkServicesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + assert.strictEqual(client.networkServicesStub, undefined); + client.close().then(() => { + done(); + }); + }); + + it('has getProjectId method', async () => { + const fakeProjectId = 'fake-project-id'; + const client = new networkservicesModule.v1beta1.NetworkServicesClient({ + 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 networkservicesModule.v1beta1.NetworkServicesClient({ + 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('getEndpointPolicy', () => { + it('invokes getEndpointPolicy without error', async () => { + const client = new networkservicesModule.v1beta1.NetworkServicesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.networkservices.v1beta1.GetEndpointPolicyRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.networkservices.v1beta1.GetEndpointPolicyRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.networkservices.v1beta1.EndpointPolicy() + ); + client.innerApiCalls.getEndpointPolicy = stubSimpleCall(expectedResponse); + const [response] = await client.getEndpointPolicy(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.getEndpointPolicy as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getEndpointPolicy as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getEndpointPolicy without error using callback', async () => { + const client = new networkservicesModule.v1beta1.NetworkServicesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.networkservices.v1beta1.GetEndpointPolicyRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.networkservices.v1beta1.GetEndpointPolicyRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.networkservices.v1beta1.EndpointPolicy() + ); + client.innerApiCalls.getEndpointPolicy = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getEndpointPolicy( + request, + ( + err?: Error | null, + result?: protos.google.cloud.networkservices.v1beta1.IEndpointPolicy | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.getEndpointPolicy as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getEndpointPolicy as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getEndpointPolicy with error', async () => { + const client = new networkservicesModule.v1beta1.NetworkServicesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.networkservices.v1beta1.GetEndpointPolicyRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.networkservices.v1beta1.GetEndpointPolicyRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.getEndpointPolicy = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.getEndpointPolicy(request), expectedError); + const actualRequest = ( + client.innerApiCalls.getEndpointPolicy as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getEndpointPolicy as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getEndpointPolicy with closed client', async () => { + const client = new networkservicesModule.v1beta1.NetworkServicesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.networkservices.v1beta1.GetEndpointPolicyRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.networkservices.v1beta1.GetEndpointPolicyRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.getEndpointPolicy(request), expectedError); + }); + }); + + describe('createEndpointPolicy', () => { + it('invokes createEndpointPolicy without error', async () => { + const client = new networkservicesModule.v1beta1.NetworkServicesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.networkservices.v1beta1.CreateEndpointPolicyRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.networkservices.v1beta1.CreateEndpointPolicyRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.createEndpointPolicy = + stubLongRunningCall(expectedResponse); + const [operation] = await client.createEndpointPolicy(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.createEndpointPolicy as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createEndpointPolicy as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createEndpointPolicy without error using callback', async () => { + const client = new networkservicesModule.v1beta1.NetworkServicesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.networkservices.v1beta1.CreateEndpointPolicyRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.networkservices.v1beta1.CreateEndpointPolicyRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.createEndpointPolicy = + stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.createEndpointPolicy( + request, + ( + err?: Error | null, + result?: LROperation< + protos.google.cloud.networkservices.v1beta1.IEndpointPolicy, + protos.google.cloud.networkservices.v1beta1.IOperationMetadata + > | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const operation = (await promise) as LROperation< + protos.google.cloud.networkservices.v1beta1.IEndpointPolicy, + protos.google.cloud.networkservices.v1beta1.IOperationMetadata + >; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.createEndpointPolicy as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createEndpointPolicy as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createEndpointPolicy with call error', async () => { + const client = new networkservicesModule.v1beta1.NetworkServicesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.networkservices.v1beta1.CreateEndpointPolicyRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.networkservices.v1beta1.CreateEndpointPolicyRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.createEndpointPolicy = stubLongRunningCall( + undefined, + expectedError + ); + await assert.rejects(client.createEndpointPolicy(request), expectedError); + const actualRequest = ( + client.innerApiCalls.createEndpointPolicy as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createEndpointPolicy as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createEndpointPolicy with LRO error', async () => { + const client = new networkservicesModule.v1beta1.NetworkServicesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.networkservices.v1beta1.CreateEndpointPolicyRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.networkservices.v1beta1.CreateEndpointPolicyRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.createEndpointPolicy = stubLongRunningCall( + undefined, + undefined, + expectedError + ); + const [operation] = await client.createEndpointPolicy(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = ( + client.innerApiCalls.createEndpointPolicy as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createEndpointPolicy as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkCreateEndpointPolicyProgress without error', async () => { + const client = new networkservicesModule.v1beta1.NetworkServicesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + 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.checkCreateEndpointPolicyProgress( + expectedResponse.name + ); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkCreateEndpointPolicyProgress with error', async () => { + const client = new networkservicesModule.v1beta1.NetworkServicesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const expectedError = new Error('expected'); + + client.operationsClient.getOperation = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects( + client.checkCreateEndpointPolicyProgress(''), + expectedError + ); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + }); + + describe('updateEndpointPolicy', () => { + it('invokes updateEndpointPolicy without error', async () => { + const client = new networkservicesModule.v1beta1.NetworkServicesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.networkservices.v1beta1.UpdateEndpointPolicyRequest() + ); + request.endpointPolicy ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.networkservices.v1beta1.UpdateEndpointPolicyRequest', + ['endpointPolicy', 'name'] + ); + request.endpointPolicy.name = defaultValue1; + const expectedHeaderRequestParams = `endpoint_policy.name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.updateEndpointPolicy = + stubLongRunningCall(expectedResponse); + const [operation] = await client.updateEndpointPolicy(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.updateEndpointPolicy as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateEndpointPolicy as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateEndpointPolicy without error using callback', async () => { + const client = new networkservicesModule.v1beta1.NetworkServicesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.networkservices.v1beta1.UpdateEndpointPolicyRequest() + ); + request.endpointPolicy ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.networkservices.v1beta1.UpdateEndpointPolicyRequest', + ['endpointPolicy', 'name'] + ); + request.endpointPolicy.name = defaultValue1; + const expectedHeaderRequestParams = `endpoint_policy.name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.updateEndpointPolicy = + stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.updateEndpointPolicy( + request, + ( + err?: Error | null, + result?: LROperation< + protos.google.cloud.networkservices.v1beta1.IEndpointPolicy, + protos.google.cloud.networkservices.v1beta1.IOperationMetadata + > | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const operation = (await promise) as LROperation< + protos.google.cloud.networkservices.v1beta1.IEndpointPolicy, + protos.google.cloud.networkservices.v1beta1.IOperationMetadata + >; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.updateEndpointPolicy as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateEndpointPolicy as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateEndpointPolicy with call error', async () => { + const client = new networkservicesModule.v1beta1.NetworkServicesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.networkservices.v1beta1.UpdateEndpointPolicyRequest() + ); + request.endpointPolicy ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.networkservices.v1beta1.UpdateEndpointPolicyRequest', + ['endpointPolicy', 'name'] + ); + request.endpointPolicy.name = defaultValue1; + const expectedHeaderRequestParams = `endpoint_policy.name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.updateEndpointPolicy = stubLongRunningCall( + undefined, + expectedError + ); + await assert.rejects(client.updateEndpointPolicy(request), expectedError); + const actualRequest = ( + client.innerApiCalls.updateEndpointPolicy as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateEndpointPolicy as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateEndpointPolicy with LRO error', async () => { + const client = new networkservicesModule.v1beta1.NetworkServicesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.networkservices.v1beta1.UpdateEndpointPolicyRequest() + ); + request.endpointPolicy ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.networkservices.v1beta1.UpdateEndpointPolicyRequest', + ['endpointPolicy', 'name'] + ); + request.endpointPolicy.name = defaultValue1; + const expectedHeaderRequestParams = `endpoint_policy.name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.updateEndpointPolicy = stubLongRunningCall( + undefined, + undefined, + expectedError + ); + const [operation] = await client.updateEndpointPolicy(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = ( + client.innerApiCalls.updateEndpointPolicy as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateEndpointPolicy as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkUpdateEndpointPolicyProgress without error', async () => { + const client = new networkservicesModule.v1beta1.NetworkServicesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + 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.checkUpdateEndpointPolicyProgress( + expectedResponse.name + ); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkUpdateEndpointPolicyProgress with error', async () => { + const client = new networkservicesModule.v1beta1.NetworkServicesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const expectedError = new Error('expected'); + + client.operationsClient.getOperation = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects( + client.checkUpdateEndpointPolicyProgress(''), + expectedError + ); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + }); + + describe('deleteEndpointPolicy', () => { + it('invokes deleteEndpointPolicy without error', async () => { + const client = new networkservicesModule.v1beta1.NetworkServicesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.networkservices.v1beta1.DeleteEndpointPolicyRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.networkservices.v1beta1.DeleteEndpointPolicyRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.deleteEndpointPolicy = + stubLongRunningCall(expectedResponse); + const [operation] = await client.deleteEndpointPolicy(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.deleteEndpointPolicy as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteEndpointPolicy as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteEndpointPolicy without error using callback', async () => { + const client = new networkservicesModule.v1beta1.NetworkServicesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.networkservices.v1beta1.DeleteEndpointPolicyRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.networkservices.v1beta1.DeleteEndpointPolicyRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.deleteEndpointPolicy = + stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.deleteEndpointPolicy( + request, + ( + err?: Error | null, + result?: LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.networkservices.v1beta1.IOperationMetadata + > | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const operation = (await promise) as LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.networkservices.v1beta1.IOperationMetadata + >; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.deleteEndpointPolicy as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteEndpointPolicy as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteEndpointPolicy with call error', async () => { + const client = new networkservicesModule.v1beta1.NetworkServicesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.networkservices.v1beta1.DeleteEndpointPolicyRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.networkservices.v1beta1.DeleteEndpointPolicyRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteEndpointPolicy = stubLongRunningCall( + undefined, + expectedError + ); + await assert.rejects(client.deleteEndpointPolicy(request), expectedError); + const actualRequest = ( + client.innerApiCalls.deleteEndpointPolicy as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteEndpointPolicy as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteEndpointPolicy with LRO error', async () => { + const client = new networkservicesModule.v1beta1.NetworkServicesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.networkservices.v1beta1.DeleteEndpointPolicyRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.networkservices.v1beta1.DeleteEndpointPolicyRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteEndpointPolicy = stubLongRunningCall( + undefined, + undefined, + expectedError + ); + const [operation] = await client.deleteEndpointPolicy(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = ( + client.innerApiCalls.deleteEndpointPolicy as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteEndpointPolicy as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkDeleteEndpointPolicyProgress without error', async () => { + const client = new networkservicesModule.v1beta1.NetworkServicesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + 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.checkDeleteEndpointPolicyProgress( + expectedResponse.name + ); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkDeleteEndpointPolicyProgress with error', async () => { + const client = new networkservicesModule.v1beta1.NetworkServicesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const expectedError = new Error('expected'); + + client.operationsClient.getOperation = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects( + client.checkDeleteEndpointPolicyProgress(''), + expectedError + ); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + }); + + describe('listEndpointPolicies', () => { + it('invokes listEndpointPolicies without error', async () => { + const client = new networkservicesModule.v1beta1.NetworkServicesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.networkservices.v1beta1.ListEndpointPoliciesRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.networkservices.v1beta1.ListEndpointPoliciesRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.networkservices.v1beta1.EndpointPolicy() + ), + generateSampleMessage( + new protos.google.cloud.networkservices.v1beta1.EndpointPolicy() + ), + generateSampleMessage( + new protos.google.cloud.networkservices.v1beta1.EndpointPolicy() + ), + ]; + client.innerApiCalls.listEndpointPolicies = + stubSimpleCall(expectedResponse); + const [response] = await client.listEndpointPolicies(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.listEndpointPolicies as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listEndpointPolicies as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listEndpointPolicies without error using callback', async () => { + const client = new networkservicesModule.v1beta1.NetworkServicesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.networkservices.v1beta1.ListEndpointPoliciesRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.networkservices.v1beta1.ListEndpointPoliciesRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.networkservices.v1beta1.EndpointPolicy() + ), + generateSampleMessage( + new protos.google.cloud.networkservices.v1beta1.EndpointPolicy() + ), + generateSampleMessage( + new protos.google.cloud.networkservices.v1beta1.EndpointPolicy() + ), + ]; + client.innerApiCalls.listEndpointPolicies = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.listEndpointPolicies( + request, + ( + err?: Error | null, + result?: + | protos.google.cloud.networkservices.v1beta1.IEndpointPolicy[] + | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.listEndpointPolicies as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listEndpointPolicies as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listEndpointPolicies with error', async () => { + const client = new networkservicesModule.v1beta1.NetworkServicesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.networkservices.v1beta1.ListEndpointPoliciesRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.networkservices.v1beta1.ListEndpointPoliciesRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.listEndpointPolicies = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.listEndpointPolicies(request), expectedError); + const actualRequest = ( + client.innerApiCalls.listEndpointPolicies as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listEndpointPolicies as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listEndpointPoliciesStream without error', async () => { + const client = new networkservicesModule.v1beta1.NetworkServicesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.networkservices.v1beta1.ListEndpointPoliciesRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.networkservices.v1beta1.ListEndpointPoliciesRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.networkservices.v1beta1.EndpointPolicy() + ), + generateSampleMessage( + new protos.google.cloud.networkservices.v1beta1.EndpointPolicy() + ), + generateSampleMessage( + new protos.google.cloud.networkservices.v1beta1.EndpointPolicy() + ), + ]; + client.descriptors.page.listEndpointPolicies.createStream = + stubPageStreamingCall(expectedResponse); + const stream = client.listEndpointPoliciesStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.networkservices.v1beta1.EndpointPolicy[] = + []; + stream.on( + 'data', + ( + response: protos.google.cloud.networkservices.v1beta1.EndpointPolicy + ) => { + 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.listEndpointPolicies.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.listEndpointPolicies, request) + ); + assert( + (client.descriptors.page.listEndpointPolicies.createStream as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('invokes listEndpointPoliciesStream with error', async () => { + const client = new networkservicesModule.v1beta1.NetworkServicesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.networkservices.v1beta1.ListEndpointPoliciesRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.networkservices.v1beta1.ListEndpointPoliciesRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.descriptors.page.listEndpointPolicies.createStream = + stubPageStreamingCall(undefined, expectedError); + const stream = client.listEndpointPoliciesStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.networkservices.v1beta1.EndpointPolicy[] = + []; + stream.on( + 'data', + ( + response: protos.google.cloud.networkservices.v1beta1.EndpointPolicy + ) => { + responses.push(response); + } + ); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert( + (client.descriptors.page.listEndpointPolicies.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.listEndpointPolicies, request) + ); + assert( + (client.descriptors.page.listEndpointPolicies.createStream as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listEndpointPolicies without error', async () => { + const client = new networkservicesModule.v1beta1.NetworkServicesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.networkservices.v1beta1.ListEndpointPoliciesRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.networkservices.v1beta1.ListEndpointPoliciesRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.networkservices.v1beta1.EndpointPolicy() + ), + generateSampleMessage( + new protos.google.cloud.networkservices.v1beta1.EndpointPolicy() + ), + generateSampleMessage( + new protos.google.cloud.networkservices.v1beta1.EndpointPolicy() + ), + ]; + client.descriptors.page.listEndpointPolicies.asyncIterate = + stubAsyncIterationCall(expectedResponse); + const responses: protos.google.cloud.networkservices.v1beta1.IEndpointPolicy[] = + []; + const iterable = client.listEndpointPoliciesAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + ( + client.descriptors.page.listEndpointPolicies.asyncIterate as SinonStub + ).getCall(0).args[1], + request + ); + assert( + (client.descriptors.page.listEndpointPolicies.asyncIterate as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listEndpointPolicies with error', async () => { + const client = new networkservicesModule.v1beta1.NetworkServicesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.networkservices.v1beta1.ListEndpointPoliciesRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.networkservices.v1beta1.ListEndpointPoliciesRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.descriptors.page.listEndpointPolicies.asyncIterate = + stubAsyncIterationCall(undefined, expectedError); + const iterable = client.listEndpointPoliciesAsync(request); + await assert.rejects(async () => { + const responses: protos.google.cloud.networkservices.v1beta1.IEndpointPolicy[] = + []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + ( + client.descriptors.page.listEndpointPolicies.asyncIterate as SinonStub + ).getCall(0).args[1], + request + ); + assert( + (client.descriptors.page.listEndpointPolicies.asyncIterate as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + }); + + describe('Path templates', () => { + describe('endpointPolicy', () => { + const fakePath = '/rendered/path/endpointPolicy'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + endpoint_policy: 'endpointPolicyValue', + }; + const client = new networkservicesModule.v1beta1.NetworkServicesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.endpointPolicyPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.endpointPolicyPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('endpointPolicyPath', () => { + const result = client.endpointPolicyPath( + 'projectValue', + 'locationValue', + 'endpointPolicyValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.endpointPolicyPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromEndpointPolicyName', () => { + const result = client.matchProjectFromEndpointPolicyName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.endpointPolicyPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromEndpointPolicyName', () => { + const result = client.matchLocationFromEndpointPolicyName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.endpointPolicyPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchEndpointPolicyFromEndpointPolicyName', () => { + const result = + client.matchEndpointPolicyFromEndpointPolicyName(fakePath); + assert.strictEqual(result, 'endpointPolicyValue'); + assert( + (client.pathTemplates.endpointPolicyPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + }); +}); diff --git a/packages/google-cloud-networkservices/tsconfig.json b/packages/google-cloud-networkservices/tsconfig.json new file mode 100644 index 00000000000..c78f1c884ef --- /dev/null +++ b/packages/google-cloud-networkservices/tsconfig.json @@ -0,0 +1,19 @@ +{ + "extends": "./node_modules/gts/tsconfig-google.json", + "compilerOptions": { + "rootDir": ".", + "outDir": "build", + "resolveJsonModule": true, + "lib": [ + "es2018", + "dom" + ] + }, + "include": [ + "src/*.ts", + "src/**/*.ts", + "test/*.ts", + "test/**/*.ts", + "system-test/*.ts" + ] +} diff --git a/packages/google-cloud-networkservices/webpack.config.js b/packages/google-cloud-networkservices/webpack.config.js new file mode 100644 index 00000000000..9c87213d15c --- /dev/null +++ b/packages/google-cloud-networkservices/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: 'NetworkServices', + filename: './network-services.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/google-cloud-policysimulator/.OwlBot.yaml b/packages/google-cloud-policysimulator/.OwlBot.yaml new file mode 100644 index 00000000000..242a98887de --- /dev/null +++ b/packages/google-cloud-policysimulator/.OwlBot.yaml @@ -0,0 +1,19 @@ +# 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. + +deep-copy-regex: + - source: /google/cloud/policysimulator/(.*)/.*-nodejs + dest: /owl-bot-staging/google-cloud-policysimulator/$1 + +api-name: policysimulator \ No newline at end of file diff --git a/packages/google-cloud-policysimulator/.eslintignore b/packages/google-cloud-policysimulator/.eslintignore new file mode 100644 index 00000000000..ea5b04aebe6 --- /dev/null +++ b/packages/google-cloud-policysimulator/.eslintignore @@ -0,0 +1,7 @@ +**/node_modules +**/coverage +test/fixtures +build/ +docs/ +protos/ +samples/generated/ diff --git a/packages/google-cloud-policysimulator/.eslintrc.json b/packages/google-cloud-policysimulator/.eslintrc.json new file mode 100644 index 00000000000..78215349546 --- /dev/null +++ b/packages/google-cloud-policysimulator/.eslintrc.json @@ -0,0 +1,3 @@ +{ + "extends": "./node_modules/gts" +} diff --git a/packages/google-cloud-policysimulator/.gitattributes b/packages/google-cloud-policysimulator/.gitattributes new file mode 100644 index 00000000000..33739cb74e4 --- /dev/null +++ b/packages/google-cloud-policysimulator/.gitattributes @@ -0,0 +1,4 @@ +*.ts text eol=lf +*.js text eol=lf +protos/* linguist-generated +**/api-extractor.json linguist-language=JSON-with-Comments diff --git a/packages/google-cloud-policysimulator/.gitignore b/packages/google-cloud-policysimulator/.gitignore new file mode 100644 index 00000000000..d4f03a0df2e --- /dev/null +++ b/packages/google-cloud-policysimulator/.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/google-cloud-policysimulator/.jsdoc.js b/packages/google-cloud-policysimulator/.jsdoc.js new file mode 100644 index 00000000000..13755c919f7 --- /dev/null +++ b/packages/google-cloud-policysimulator/.jsdoc.js @@ -0,0 +1,55 @@ +// Copyright 2023 Google LLC +// +// Licensed under the Apache License, Version 2.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 2023 Google LLC', + includeDate: false, + sourceFiles: false, + systemName: '@google-cloud/policysimulator', + theme: 'lumen', + default: { + outputSourceFiles: false + } + }, + markdown: { + idInHeadings: true + } +}; diff --git a/packages/google-cloud-policysimulator/.mocharc.js b/packages/google-cloud-policysimulator/.mocharc.js new file mode 100644 index 00000000000..49e7e228701 --- /dev/null +++ b/packages/google-cloud-policysimulator/.mocharc.js @@ -0,0 +1,29 @@ +// Copyright 2023 Google LLC +// +// Licensed under the Apache License, Version 2.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. +const config = { + "enable-source-maps": true, + "throw-deprecation": true, + "timeout": 10000, + "recursive": true +} +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/google-cloud-policysimulator/.nycrc b/packages/google-cloud-policysimulator/.nycrc new file mode 100644 index 00000000000..b18d5472b62 --- /dev/null +++ b/packages/google-cloud-policysimulator/.nycrc @@ -0,0 +1,24 @@ +{ + "report-dir": "./.coverage", + "reporter": ["text", "lcov"], + "exclude": [ + "**/*-test", + "**/.coverage", + "**/apis", + "**/benchmark", + "**/conformance", + "**/docs", + "**/samples", + "**/scripts", + "**/protos", + "**/test", + "**/*.d.ts", + ".jsdoc.js", + "**/.jsdoc.js", + "karma.conf.js", + "webpack-tests.config.js", + "webpack.config.js" + ], + "exclude-after-remap": false, + "all": true +} diff --git a/packages/google-cloud-policysimulator/.prettierignore b/packages/google-cloud-policysimulator/.prettierignore new file mode 100644 index 00000000000..9340ad9b86d --- /dev/null +++ b/packages/google-cloud-policysimulator/.prettierignore @@ -0,0 +1,6 @@ +**/node_modules +**/coverage +test/fixtures +build/ +docs/ +protos/ diff --git a/packages/google-cloud-policysimulator/.prettierrc.js b/packages/google-cloud-policysimulator/.prettierrc.js new file mode 100644 index 00000000000..1e6cec783e4 --- /dev/null +++ b/packages/google-cloud-policysimulator/.prettierrc.js @@ -0,0 +1,17 @@ +// Copyright 2023 Google LLC +// +// Licensed under the Apache License, Version 2.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. + +module.exports = { + ...require('gts/.prettierrc.json') +} diff --git a/packages/google-cloud-policysimulator/.repo-metadata.json b/packages/google-cloud-policysimulator/.repo-metadata.json new file mode 100644 index 00000000000..135f1078398 --- /dev/null +++ b/packages/google-cloud-policysimulator/.repo-metadata.json @@ -0,0 +1,17 @@ +{ + "name": "policysimulator", + "name_pretty": "Policy Simulator API", + "product_documentation": "https://cloud.google.com/policy-intelligence/docs/iam-simulator-overview", + "client_documentation": "https://cloud.google.com/nodejs/docs/reference/policysimulator/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/policysimulator", + "api_id": "policysimulator.googleapis.com", + "default_version": "v1", + "requires_billing": true, + "library_type": "GAPIC_AUTO", + "api_shortname": "policysimulator" +} + diff --git a/packages/google-cloud-policysimulator/CHANGELOG.md b/packages/google-cloud-policysimulator/CHANGELOG.md new file mode 100644 index 00000000000..c49e17be5fe --- /dev/null +++ b/packages/google-cloud-policysimulator/CHANGELOG.md @@ -0,0 +1,8 @@ +# Changelog + +## 0.1.0 (2023-09-14) + + +### Features + +* Add initial files for google.cloud.policysimulator.v1 ([#4642](https://github.com/googleapis/google-cloud-node/issues/4642)) ([21bc46a](https://github.com/googleapis/google-cloud-node/commit/21bc46a9615e0c54538ad852ea4478797be7c453)) diff --git a/packages/google-cloud-policysimulator/CODE_OF_CONDUCT.md b/packages/google-cloud-policysimulator/CODE_OF_CONDUCT.md new file mode 100644 index 00000000000..2add2547a81 --- /dev/null +++ b/packages/google-cloud-policysimulator/CODE_OF_CONDUCT.md @@ -0,0 +1,94 @@ + +# Code of Conduct + +## Our Pledge + +In the interest of fostering an open and welcoming environment, we as +contributors and maintainers pledge to making participation in our project and +our community a harassment-free experience for everyone, regardless of age, body +size, disability, ethnicity, gender identity and expression, level of +experience, education, socio-economic status, nationality, personal appearance, +race, religion, or sexual identity and orientation. + +## Our Standards + +Examples of behavior that contributes to creating a positive environment +include: + +* Using welcoming and inclusive language +* Being respectful of differing viewpoints and experiences +* Gracefully accepting constructive criticism +* Focusing on what is best for the community +* Showing empathy towards other community members + +Examples of unacceptable behavior by participants include: + +* The use of sexualized language or imagery and unwelcome sexual attention or + advances +* Trolling, insulting/derogatory comments, and personal or political attacks +* Public or private harassment +* Publishing others' private information, such as a physical or electronic + address, without explicit permission +* Other conduct which could reasonably be considered inappropriate in a + professional setting + +## Our Responsibilities + +Project maintainers are responsible for clarifying the standards of acceptable +behavior and are expected to take appropriate and fair corrective action in +response to any instances of unacceptable behavior. + +Project maintainers have the right and responsibility to remove, edit, or reject +comments, commits, code, wiki edits, issues, and other contributions that are +not aligned to this Code of Conduct, or to ban temporarily or permanently any +contributor for other behaviors that they deem inappropriate, threatening, +offensive, or harmful. + +## Scope + +This Code of Conduct applies both within project spaces and in public spaces +when an individual is representing the project or its community. Examples of +representing a project or community include using an official project e-mail +address, posting via an official social media account, or acting as an appointed +representative at an online or offline event. Representation of a project may be +further defined and clarified by project maintainers. + +This Code of Conduct also applies outside the project spaces when the Project +Steward has a reasonable belief that an individual's behavior may have a +negative impact on the project or its community. + +## Conflict Resolution + +We do not believe that all conflict is bad; healthy debate and disagreement +often yield positive results. However, it is never okay to be disrespectful or +to engage in behavior that violates the project’s code of conduct. + +If you see someone violating the code of conduct, you are encouraged to address +the behavior directly with those involved. Many issues can be resolved quickly +and easily, and this gives people more control over the outcome of their +dispute. If you are unable to resolve the matter for any reason, or if the +behavior is threatening or harassing, report it. We are dedicated to providing +an environment where participants feel welcome and safe. + +Reports should be directed to *googleapis-stewards@google.com*, the +Project Steward(s) for *Google Cloud Client Libraries*. It is the Project Steward’s duty to +receive and address reported violations of the code of conduct. They will then +work with a committee consisting of representatives from the Open Source +Programs Office and the Google Open Source Strategy team. If for any reason you +are uncomfortable reaching out to the Project Steward, please email +opensource@google.com. + +We will investigate every complaint, but you may not receive a direct response. +We will use our discretion in determining when and how to follow up on reported +incidents, which may range from not taking action to permanent expulsion from +the project and project-sponsored spaces. We will notify the accused of the +report and provide them an opportunity to discuss it before any action is taken. +The identity of the reporter will be omitted from the details of the report +supplied to the accused. In potentially harmful situations, such as ongoing +harassment or threats to anyone's safety, we may take action without notice. + +## Attribution + +This Code of Conduct is adapted from the Contributor Covenant, version 1.4, +available at +https://www.contributor-covenant.org/version/1/4/code-of-conduct.html \ No newline at end of file diff --git a/packages/google-cloud-policysimulator/CONTRIBUTING.md b/packages/google-cloud-policysimulator/CONTRIBUTING.md new file mode 100644 index 00000000000..872a94a57d2 --- /dev/null +++ b/packages/google-cloud-policysimulator/CONTRIBUTING.md @@ -0,0 +1,76 @@ +# How to become a contributor and submit your own code + +**Table of contents** + +* [Contributor License Agreements](#contributor-license-agreements) +* [Contributing a patch](#contributing-a-patch) +* [Running the tests](#running-the-tests) +* [Releasing the library](#releasing-the-library) + +## Contributor License Agreements + +We'd love to accept your sample apps and patches! Before we can take them, we +have to jump a couple of legal hurdles. + +Please fill out either the individual or corporate Contributor License Agreement +(CLA). + + * If you are an individual writing original source code and you're sure you + own the intellectual property, then you'll need to sign an [individual CLA](https://developers.google.com/open-source/cla/individual). + * If you work for a company that wants to allow you to contribute your work, + then you'll need to sign a [corporate CLA](https://developers.google.com/open-source/cla/corporate). + +Follow either of the two links above to access the appropriate CLA and +instructions for how to sign and return it. Once we receive it, we'll be able to +accept your pull requests. + +## Contributing A Patch + +1. Submit an issue describing your proposed change to the repo in question. +1. The repo owner will respond to your issue promptly. +1. If your proposed change is accepted, and you haven't already done so, sign a + Contributor License Agreement (see details above). +1. Fork the desired repo, develop and test your code changes. +1. Ensure that your code adheres to the existing style in the code to which + you are contributing. +1. Ensure that your code has an appropriate set of tests which all pass. +1. Title your pull request following [Conventional Commits](https://www.conventionalcommits.org/) styling. +1. Submit a pull request. + +### Before you begin + +1. [Select or create a Cloud Platform project][projects]. +1. [Enable billing for your project][billing]. +1. [Enable the Policy Simulator API API][enable_api]. +1. [Set up authentication with a service account][auth] so you can access the + API from your local workstation. + + +## Running the tests + +1. [Prepare your environment for Node.js setup][setup]. + +1. Install dependencies: + + npm install + +1. Run the tests: + + # Run unit tests. + npm test + + # Run sample integration tests. + npm run samples-test + + # Run all system tests. + npm run system-test + +1. Lint (and maybe fix) any changes: + + npm run fix + +[setup]: https://cloud.google.com/nodejs/docs/setup +[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=policysimulator.googleapis.com +[auth]: https://cloud.google.com/docs/authentication/getting-started \ No newline at end of file diff --git a/packages/google-cloud-policysimulator/LICENSE b/packages/google-cloud-policysimulator/LICENSE new file mode 100644 index 00000000000..d6456956733 --- /dev/null +++ b/packages/google-cloud-policysimulator/LICENSE @@ -0,0 +1,202 @@ + + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright [yyyy] [name of copyright owner] + + Licensed under the Apache License, Version 2.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. diff --git a/packages/google-cloud-policysimulator/README.md b/packages/google-cloud-policysimulator/README.md new file mode 100644 index 00000000000..2bd348edaaf --- /dev/null +++ b/packages/google-cloud-policysimulator/README.md @@ -0,0 +1,196 @@ +[//]: # "This README.md file is auto-generated, all changes to this file will be lost." +[//]: # "To regenerate it, use `python -m synthtool`." +Google Cloud Platform logo + +# [Policy Simulator API: Node.js Client](https://github.com/googleapis/google-cloud-node/tree/main/packages/google-cloud-policysimulator) + +[![release level](https://img.shields.io/badge/release%20level-preview-yellow.svg?style=flat)](https://cloud.google.com/terms/launch-stages) +[![npm version](https://img.shields.io/npm/v/@google-cloud/policysimulator.svg)](https://www.npmjs.org/package/@google-cloud/policysimulator) + + + + +Policy Simulator API client for Node.js + + +A comprehensive list of changes in each version may be found in +[the CHANGELOG](https://github.com/googleapis/google-cloud-node/tree/main/packages/google-cloud-policysimulator/CHANGELOG.md). + +* [Policy Simulator API Node.js Client API Reference][client-docs] +* [Policy Simulator API Documentation][product-docs] +* [github.com/googleapis/google-cloud-node/packages/google-cloud-policysimulator](https://github.com/googleapis/google-cloud-node/tree/main/packages/google-cloud-policysimulator) + +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) + * [Using the client library](#using-the-client-library) +* [Samples](#samples) +* [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 Policy Simulator API API][enable_api]. +1. [Set up authentication with a service account][auth] so you can access the + API from your local workstation. + +### Installing the client library + +```bash +npm install @google-cloud/policysimulator +``` + + +### Using the client library + +```javascript +/** + * 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 Replay google.cloud.policysimulator.v1.Replay whose + * results are listed, in the following format: + * `{projects|folders|organizations}/{resource-id}/locations/global/replays/{replay-id}` + * Example: + * `projects/my-project/locations/global/replays/506a5f7f-38ce-4d7d-8e03-479ce1833c36` + */ +// const parent = 'abc123' +/** + * The maximum number of + * ReplayResult google.cloud.policysimulator.v1.ReplayResult objects to + * return. Defaults to 5000. + * The maximum value is 5000; values above 5000 are rounded down to 5000. + */ +// const pageSize = 1234 +/** + * A page token, received from a previous + * Simulator.ListReplayResults google.cloud.policysimulator.v1.Simulator.ListReplayResults + * call. Provide this token to retrieve the next page of results. + * When paginating, all other parameters provided to + * Simulator.ListReplayResults must match the call that provided the page + * token. + */ +// const pageToken = 'abc123' + +// Imports the Policysimulator library +const {SimulatorClient} = require('@google-cloud/policysimulator').v1; + +// Instantiates a client +const policysimulatorClient = new SimulatorClient(); + +async function callListReplayResults() { + // Construct request + const request = { + parent, + }; + + // Run request + const iterable = await policysimulatorClient.listReplayResultsAsync( + request + ); + for await (const response of iterable) { + console.log(response); + } +} + +callListReplayResults(); + +``` + + + +## Samples + +Samples are in the [`samples/`](https://github.com/googleapis/google-cloud-node/tree/main/packages/google-cloud-policysimulator/samples) directory. Each sample's `README.md` has instructions for running its sample. + +| Sample | Source Code | Try it | +| --------------------------- | --------------------------------- | ------ | +| Simulator.create_replay | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-policysimulator/samples/generated/v1/simulator.create_replay.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-cloud-policysimulator/samples/generated/v1/simulator.create_replay.js,packages/google-cloud-policysimulator/samples/README.md) | +| Simulator.get_replay | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-policysimulator/samples/generated/v1/simulator.get_replay.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-cloud-policysimulator/samples/generated/v1/simulator.get_replay.js,packages/google-cloud-policysimulator/samples/README.md) | +| Simulator.list_replay_results | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-policysimulator/samples/generated/v1/simulator.list_replay_results.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-cloud-policysimulator/samples/generated/v1/simulator.list_replay_results.js,packages/google-cloud-policysimulator/samples/README.md) | +| Quickstart | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-policysimulator/samples/quickstart.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-cloud-policysimulator/samples/quickstart.js,packages/google-cloud-policysimulator/samples/README.md) | + + + +The [Policy Simulator API Node.js Client API Reference][client-docs] documentation +also contains 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/policysimulator@legacy-8` installs client libraries +for versions compatible with Node.js 8. + +## Versioning + +This library follows [Semantic Versioning](http://semver.org/). + + + + + + + +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. + + +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](https://github.com/googleapis/google-cloud-node/blob/main/CONTRIBUTING.md). + +Please note that this `README.md`, the `samples/README.md`, +and a variety of configuration files in this repository (including `.nycrc` and `tsconfig.json`) +are generated from a central template. To edit one of these files, make an edit +to its templates in +[directory](https://github.com/googleapis/synthtool). + +## License + +Apache Version 2.0 + +See [LICENSE](https://github.com/googleapis/google-cloud-node/blob/main/LICENSE) + +[client-docs]: https://cloud.google.com/nodejs/docs/reference/policysimulator/latest +[product-docs]: https://cloud.google.com/policy-intelligence/docs/iam-simulator-overview +[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=policysimulator.googleapis.com +[auth]: https://cloud.google.com/docs/authentication/getting-started diff --git a/packages/google-cloud-policysimulator/package.json b/packages/google-cloud-policysimulator/package.json new file mode 100644 index 00000000000..cb7dbeb875f --- /dev/null +++ b/packages/google-cloud-policysimulator/package.json @@ -0,0 +1,70 @@ +{ + "name": "@google-cloud/policysimulator", + "version": "0.1.0", + "description": "Policy Simulator API client for Node.js", + "repository": { + "type": "git", + "url": "https://github.com/googleapis/google-cloud-node.git", + "directory": "packages/google-cloud-policysimulator" + }, + "license": "Apache-2.0", + "author": "Google LLC", + "main": "build/src/index.js", + "files": [ + "build/src", + "build/protos" + ], + "homepage": "https://github.com/googleapis/google-cloud-node/tree/main/packages/google-cloud-policysimulator", + "keywords": [ + "google apis client", + "google api client", + "google apis", + "google api", + "google", + "google cloud platform", + "google cloud", + "cloud", + "google policysimulator", + "policysimulator", + "Policy Simulator API" + ], + "scripts": { + "clean": "gts clean", + "compile": "tsc -p . && cp -r protos build/", + "compile-protos": "compileProtos src", + "docs": "jsdoc -c .jsdoc.js", + "predocs-test": "npm run docs", + "docs-test": "linkinator docs", + "fix": "gts fix", + "lint": "gts check", + "postpack": "minifyProtoJson", + "prepare": "npm run compile-protos && npm run compile", + "system-test": "c8 mocha build/system-test", + "test": "c8 mocha build/test", + "samples-test": "cd samples/ && npm link ../ && npm i && npm test", + "prelint": "cd samples; npm link ../; npm i" + }, + "dependencies": { + "google-gax": "^4.0.3" + }, + "devDependencies": { + "@types/mocha": "^9.0.0", + "@types/node": "^20.4.5", + "@types/sinon": "^10.0.0", + "c8": "^8.0.1", + "gapic-tools": "^0.1.8", + "gts": "^5.0.0", + "jsdoc": "^4.0.0", + "jsdoc-fresh": "^3.0.0", + "jsdoc-region-tag": "^3.0.0", + "linkinator": "4.1.2", + "long": "^5.2.3", + "mocha": "^9.2.2", + "pack-n-play": "^1.0.0-2", + "sinon": "^15.0.0", + "typescript": "^5.1.6" + }, + "engines": { + "node": ">=14.0.0" + } +} diff --git a/packages/google-cloud-policysimulator/protos/google/cloud/policysimulator/v1/explanations.proto b/packages/google-cloud-policysimulator/protos/google/cloud/policysimulator/v1/explanations.proto new file mode 100644 index 00000000000..8999b4dc6da --- /dev/null +++ b/packages/google-cloud-policysimulator/protos/google/cloud/policysimulator/v1/explanations.proto @@ -0,0 +1,260 @@ +// Copyright 2023 Google LLC +// +// Licensed under the Apache License, Version 2.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.policysimulator.v1; + +import "google/api/field_behavior.proto"; +import "google/iam/v1/policy.proto"; +import "google/type/expr.proto"; + +option cc_enable_arenas = true; +option csharp_namespace = "Google.Cloud.PolicySimulator.V1"; +option go_package = "cloud.google.com/go/policysimulator/apiv1/policysimulatorpb;policysimulatorpb"; +option java_multiple_files = true; +option java_outer_classname = "ExplanationsProto"; +option java_package = "com.google.cloud.policysimulator.v1"; +option php_namespace = "Google\\Cloud\\PolicySimulator\\V1"; +option ruby_package = "Google::Cloud::PolicySimulator::V1"; + +// Whether a principal has a permission for a resource. +enum AccessState { + // Default value. This value is unused. + ACCESS_STATE_UNSPECIFIED = 0; + + // The principal has the permission. + GRANTED = 1; + + // The principal does not have the permission. + NOT_GRANTED = 2; + + // The principal has the permission only if a condition expression evaluates + // to `true`. + UNKNOWN_CONDITIONAL = 3; + + // The user who created the + // [Replay][google.cloud.policysimulator.v1.Replay] does not have + // access to all of the policies that Policy Simulator needs to evaluate. + UNKNOWN_INFO_DENIED = 4; +} + +// The extent to which a single data point, such as the existence of a binding +// or whether a binding includes a specific principal, contributes to an overall +// determination. +enum HeuristicRelevance { + // Default value. This value is unused. + HEURISTIC_RELEVANCE_UNSPECIFIED = 0; + + // The data point has a limited effect on the result. Changing the data point + // is unlikely to affect the overall determination. + NORMAL = 1; + + // The data point has a strong effect on the result. Changing the data point + // is likely to affect the overall determination. + HIGH = 2; +} + +// Information about the principal, resource, and permission to check. +message AccessTuple { + // Required. The principal whose access you want to check, in the form of + // the email address that represents that principal. For example, + // `alice@example.com` or + // `my-service-account@my-project.iam.gserviceaccount.com`. + // + // The principal must be a Google Account or a service account. Other types of + // principals are not supported. + string principal = 1 [(google.api.field_behavior) = REQUIRED]; + + // Required. The full resource name that identifies the resource. For example, + // `//compute.googleapis.com/projects/my-project/zones/us-central1-a/instances/my-instance`. + // + // For examples of full resource names for Google Cloud services, see + // https://cloud.google.com/iam/help/troubleshooter/full-resource-names. + string full_resource_name = 2 [(google.api.field_behavior) = REQUIRED]; + + // Required. The IAM permission to check for the specified principal and + // resource. + // + // For a complete list of IAM permissions, see + // https://cloud.google.com/iam/help/permissions/reference. + // + // For a complete list of predefined IAM roles and the permissions in each + // role, see https://cloud.google.com/iam/help/roles/reference. + string permission = 3 [(google.api.field_behavior) = REQUIRED]; +} + +// Details about how a specific IAM [Policy][google.iam.v1.Policy] contributed +// to the access check. +message ExplainedPolicy { + // Indicates whether _this policy_ provides the specified permission to the + // specified principal for the specified resource. + // + // This field does _not_ indicate whether the principal actually has the + // permission for the resource. There might be another policy that overrides + // this policy. To determine whether the principal actually has the + // permission, use the `access` field in the + // [TroubleshootIamPolicyResponse][IamChecker.TroubleshootIamPolicyResponse]. + AccessState access = 1; + + // The full resource name that identifies the resource. For example, + // `//compute.googleapis.com/projects/my-project/zones/us-central1-a/instances/my-instance`. + // + // If the user who created the + // [Replay][google.cloud.policysimulator.v1.Replay] does not have + // access to the policy, this field is omitted. + // + // For examples of full resource names for Google Cloud services, see + // https://cloud.google.com/iam/help/troubleshooter/full-resource-names. + string full_resource_name = 2; + + // The IAM policy attached to the resource. + // + // If the user who created the + // [Replay][google.cloud.policysimulator.v1.Replay] does not have + // access to the policy, this field is empty. + google.iam.v1.Policy policy = 3; + + // Details about how each binding in the policy affects the principal's + // ability, or inability, to use the permission for the resource. + // + // If the user who created the + // [Replay][google.cloud.policysimulator.v1.Replay] does not have + // access to the policy, this field is omitted. + repeated BindingExplanation binding_explanations = 4; + + // The relevance of this policy to the overall determination in the + // [TroubleshootIamPolicyResponse][IamChecker.TroubleshootIamPolicyResponse]. + // + // If the user who created the + // [Replay][google.cloud.policysimulator.v1.Replay] does not have + // access to the policy, this field is omitted. + HeuristicRelevance relevance = 5; +} + +// Details about how a binding in a policy affects a principal's ability to use +// a permission. +message BindingExplanation { + // Details about whether the binding includes the principal. + message AnnotatedMembership { + // Indicates whether the binding includes the principal. + Membership membership = 1; + + // The relevance of the principal's status to the overall determination for + // the binding. + HeuristicRelevance relevance = 2; + } + + // Whether a role includes a specific permission. + enum RolePermission { + // Default value. This value is unused. + ROLE_PERMISSION_UNSPECIFIED = 0; + + // The permission is included in the role. + ROLE_PERMISSION_INCLUDED = 1; + + // The permission is not included in the role. + ROLE_PERMISSION_NOT_INCLUDED = 2; + + // The user who created the + // [Replay][google.cloud.policysimulator.v1.Replay] is not + // allowed to access the binding. + ROLE_PERMISSION_UNKNOWN_INFO_DENIED = 3; + } + + // Whether the binding includes the principal. + enum Membership { + // Default value. This value is unused. + MEMBERSHIP_UNSPECIFIED = 0; + + // The binding includes the principal. The principal can be included + // directly or indirectly. For example: + // + // * A principal is included directly if that principal is listed in the + // binding. + // * A principal is included indirectly if that principal is in a Google + // group or Google Workspace domain that is listed in the binding. + MEMBERSHIP_INCLUDED = 1; + + // The binding does not include the principal. + MEMBERSHIP_NOT_INCLUDED = 2; + + // The user who created the + // [Replay][google.cloud.policysimulator.v1.Replay] is not + // allowed to access the binding. + MEMBERSHIP_UNKNOWN_INFO_DENIED = 3; + + // The principal is an unsupported type. Only Google Accounts and service + // accounts are supported. + MEMBERSHIP_UNKNOWN_UNSUPPORTED = 4; + } + + // Required. Indicates whether _this binding_ provides the specified + // permission to the specified principal for the specified resource. + // + // This field does _not_ indicate whether the principal actually has the + // permission for the resource. There might be another binding that overrides + // this binding. To determine whether the principal actually has the + // permission, use the `access` field in the + // [TroubleshootIamPolicyResponse][IamChecker.TroubleshootIamPolicyResponse]. + AccessState access = 1 [(google.api.field_behavior) = REQUIRED]; + + // The role that this binding grants. For example, + // `roles/compute.serviceAgent`. + // + // For a complete list of predefined IAM roles, as well as the permissions in + // each role, see https://cloud.google.com/iam/help/roles/reference. + string role = 2; + + // Indicates whether the role granted by this binding contains the specified + // permission. + RolePermission role_permission = 3; + + // The relevance of the permission's existence, or nonexistence, in the role + // to the overall determination for the entire policy. + HeuristicRelevance role_permission_relevance = 4; + + // Indicates whether each principal in the binding includes the principal + // specified in the request, either directly or indirectly. Each key + // identifies a principal in the binding, and each value indicates whether the + // principal in the binding includes the principal in the request. + // + // For example, suppose that a binding includes the following principals: + // + // * `user:alice@example.com` + // * `group:product-eng@example.com` + // + // The principal in the replayed access tuple is `user:bob@example.com`. This + // user is a principal of the group `group:product-eng@example.com`. + // + // For the first principal in the binding, the key is + // `user:alice@example.com`, and the `membership` field in the value is set to + // `MEMBERSHIP_NOT_INCLUDED`. + // + // For the second principal in the binding, the key is + // `group:product-eng@example.com`, and the `membership` field in the value is + // set to `MEMBERSHIP_INCLUDED`. + map memberships = 5; + + // The relevance of this binding to the overall determination for the entire + // policy. + HeuristicRelevance relevance = 6; + + // A condition expression that prevents this binding from granting access + // unless the expression evaluates to `true`. + // + // To learn about IAM Conditions, see + // https://cloud.google.com/iam/docs/conditions-overview. + google.type.Expr condition = 7; +} diff --git a/packages/google-cloud-policysimulator/protos/google/cloud/policysimulator/v1/simulator.proto b/packages/google-cloud-policysimulator/protos/google/cloud/policysimulator/v1/simulator.proto new file mode 100644 index 00000000000..217e6e24728 --- /dev/null +++ b/packages/google-cloud-policysimulator/protos/google/cloud/policysimulator/v1/simulator.proto @@ -0,0 +1,461 @@ +// Copyright 2023 Google LLC +// +// Licensed under the Apache License, Version 2.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.policysimulator.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/policysimulator/v1/explanations.proto"; +import "google/iam/v1/policy.proto"; +import "google/longrunning/operations.proto"; +import "google/protobuf/timestamp.proto"; +import "google/rpc/status.proto"; +import "google/type/date.proto"; + +option cc_enable_arenas = true; +option csharp_namespace = "Google.Cloud.PolicySimulator.V1"; +option go_package = "cloud.google.com/go/policysimulator/apiv1/policysimulatorpb;policysimulatorpb"; +option java_multiple_files = true; +option java_outer_classname = "SimulatorProto"; +option java_package = "com.google.cloud.policysimulator.v1"; +option php_namespace = "Google\\Cloud\\PolicySimulator\\V1"; +option ruby_package = "Google::Cloud::PolicySimulator::V1"; + +// Policy Simulator API service. +// +// Policy Simulator is a collection of endpoints for creating, running, and +// viewing a [Replay][google.cloud.policysimulator.v1.Replay]. A +// [Replay][google.cloud.policysimulator.v1.Replay] is a type of simulation that +// lets you see how your principals' access to resources might change if you +// changed your IAM policy. +// +// During a [Replay][google.cloud.policysimulator.v1.Replay], Policy Simulator +// re-evaluates, or replays, past access attempts under both the current policy +// and your proposed policy, and compares those results to determine how your +// principals' access might change under the proposed policy. +service Simulator { + option (google.api.default_host) = "policysimulator.googleapis.com"; + option (google.api.oauth_scopes) = + "https://www.googleapis.com/auth/cloud-platform"; + + // Gets the specified [Replay][google.cloud.policysimulator.v1.Replay]. Each + // `Replay` is available for at least 7 days. + rpc GetReplay(GetReplayRequest) returns (Replay) { + option (google.api.http) = { + get: "/v1/{name=projects/*/locations/*/replays/*}" + additional_bindings { get: "/v1/{name=folders/*/locations/*/replays/*}" } + additional_bindings { + get: "/v1/{name=organizations/*/locations/*/replays/*}" + } + }; + option (google.api.method_signature) = "name"; + } + + // Creates and starts a [Replay][google.cloud.policysimulator.v1.Replay] using + // the given [ReplayConfig][google.cloud.policysimulator.v1.ReplayConfig]. + rpc CreateReplay(CreateReplayRequest) returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v1/{parent=projects/*/locations/*}/replays" + body: "replay" + additional_bindings { + post: "/v1/{parent=folders/*/locations/*}/replays" + body: "replay" + } + additional_bindings { + post: "/v1/{parent=organizations/*/locations/*}/replays" + body: "replay" + } + }; + option (google.api.method_signature) = "parent,replay"; + option (google.longrunning.operation_info) = { + response_type: "Replay" + metadata_type: "ReplayOperationMetadata" + }; + } + + // Lists the results of running a + // [Replay][google.cloud.policysimulator.v1.Replay]. + rpc ListReplayResults(ListReplayResultsRequest) + returns (ListReplayResultsResponse) { + option (google.api.http) = { + get: "/v1/{parent=projects/*/locations/*/replays/*}/results" + additional_bindings { + get: "/v1/{parent=folders/*/locations/*/replays/*}/results" + } + additional_bindings { + get: "/v1/{parent=organizations/*/locations/*/replays/*}/results" + } + }; + option (google.api.method_signature) = "parent"; + } +} + +// A resource describing a `Replay`, or simulation. +message Replay { + option (google.api.resource) = { + type: "policysimulator.googleapis.com/Replay" + pattern: "projects/{project}/locations/{location}/replays/{replay}" + pattern: "folders/{folder}/locations/{location}/replays/{replay}" + pattern: "organizations/{organization}/locations/{location}/replays/{replay}" + }; + + // Summary statistics about the replayed log entries. + message ResultsSummary { + // The total number of log entries replayed. + int32 log_count = 1; + + // The number of replayed log entries with no difference between + // baseline and simulated policies. + int32 unchanged_count = 2; + + // The number of replayed log entries with a difference between baseline and + // simulated policies. + int32 difference_count = 3; + + // The number of log entries that could not be replayed. + int32 error_count = 4; + + // The date of the oldest log entry replayed. + google.type.Date oldest_date = 5; + + // The date of the newest log entry replayed. + google.type.Date newest_date = 6; + } + + // The current state of the [Replay][google.cloud.policysimulator.v1.Replay]. + enum State { + // Default value. This value is unused. + STATE_UNSPECIFIED = 0; + + // The `Replay` has not started yet. + PENDING = 1; + + // The `Replay` is currently running. + RUNNING = 2; + + // The `Replay` has successfully completed. + SUCCEEDED = 3; + + // The `Replay` has finished with an error. + FAILED = 4; + } + + // Output only. The resource name of the `Replay`, which has the following + // format: + // + // `{projects|folders|organizations}/{resource-id}/locations/global/replays/{replay-id}`, + // where `{resource-id}` is the ID of the project, folder, or organization + // that owns the Replay. + // + // Example: + // `projects/my-example-project/locations/global/replays/506a5f7f-38ce-4d7d-8e03-479ce1833c36` + string name = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The current state of the `Replay`. + State state = 2 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Required. The configuration used for the `Replay`. + ReplayConfig config = 3 [(google.api.field_behavior) = REQUIRED]; + + // Output only. Summary statistics about the replayed log entries. + ResultsSummary results_summary = 5 + [(google.api.field_behavior) = OUTPUT_ONLY]; +} + +// The result of replaying a single access tuple against a simulated state. +message ReplayResult { + option (google.api.resource) = { + type: "policysimulator.googleapis.com/ReplayResult" + pattern: "projects/{project}/locations/{location}/replays/{replay}/results/{replay_result}" + pattern: "folders/{folder}/locations/{location}/replays/{replay}/results/{replay_result}" + pattern: "organizations/{organization}/locations/{location}/replays/{replay}/results/{replay_result}" + }; + + // The result of replaying the access tuple. + oneof result { + // The difference between the principal's access under the current + // (baseline) policies and the principal's access under the proposed + // (simulated) policies. + // + // This field is only included for access tuples that were successfully + // replayed and had different results under the current policies and the + // proposed policies. + ReplayDiff diff = 5; + + // The error that caused the access tuple replay to fail. + // + // This field is only included for access tuples that were not replayed + // successfully. + google.rpc.Status error = 6; + } + + // The resource name of the `ReplayResult`, in the following format: + // + // `{projects|folders|organizations}/{resource-id}/locations/global/replays/{replay-id}/results/{replay-result-id}`, + // where `{resource-id}` is the ID of the project, folder, or organization + // that owns the [Replay][google.cloud.policysimulator.v1.Replay]. + // + // Example: + // `projects/my-example-project/locations/global/replays/506a5f7f-38ce-4d7d-8e03-479ce1833c36/results/1234` + string name = 1; + + // The [Replay][google.cloud.policysimulator.v1.Replay] that the access tuple + // was included in. + string parent = 2 [(google.api.resource_reference) = { + type: "policysimulator.googleapis.com/Replay" + }]; + + // The access tuple that was replayed. This field includes information about + // the principal, resource, and permission that were involved in the access + // attempt. + AccessTuple access_tuple = 3; + + // The latest date this access tuple was seen in the logs. + google.type.Date last_seen_date = 4; +} + +// Request message for +// [Simulator.CreateReplay][google.cloud.policysimulator.v1.Simulator.CreateReplay]. +message CreateReplayRequest { + // Required. The parent resource where this + // [Replay][google.cloud.policysimulator.v1.Replay] will be created. This + // resource must be a project, folder, or organization with a location. + // + // Example: `projects/my-example-project/locations/global` + string parent = 1 [(google.api.field_behavior) = REQUIRED]; + + // Required. The [Replay][google.cloud.policysimulator.v1.Replay] to create. + // Set `Replay.ReplayConfig` to configure the replay. + Replay replay = 2 [(google.api.field_behavior) = REQUIRED]; +} + +// Metadata about a Replay operation. +message ReplayOperationMetadata { + // Time when the request was received. + google.protobuf.Timestamp start_time = 1; +} + +// Request message for +// [Simulator.GetReplay][google.cloud.policysimulator.v1.Simulator.GetReplay]. +message GetReplayRequest { + // Required. The name of the [Replay][google.cloud.policysimulator.v1.Replay] + // to retrieve, in the following format: + // + // `{projects|folders|organizations}/{resource-id}/locations/global/replays/{replay-id}`, + // where `{resource-id}` is the ID of the project, folder, or organization + // that owns the `Replay`. + // + // Example: + // `projects/my-example-project/locations/global/replays/506a5f7f-38ce-4d7d-8e03-479ce1833c36` + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "policysimulator.googleapis.com/Replay" + } + ]; +} + +// Request message for +// [Simulator.ListReplayResults][google.cloud.policysimulator.v1.Simulator.ListReplayResults]. +message ListReplayResultsRequest { + // Required. The [Replay][google.cloud.policysimulator.v1.Replay] whose + // results are listed, in the following format: + // + // `{projects|folders|organizations}/{resource-id}/locations/global/replays/{replay-id}` + // + // Example: + // `projects/my-project/locations/global/replays/506a5f7f-38ce-4d7d-8e03-479ce1833c36` + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "policysimulator.googleapis.com/Replay" + } + ]; + + // The maximum number of + // [ReplayResult][google.cloud.policysimulator.v1.ReplayResult] objects to + // return. Defaults to 5000. + // + // The maximum value is 5000; values above 5000 are rounded down to 5000. + int32 page_size = 2; + + // A page token, received from a previous + // [Simulator.ListReplayResults][google.cloud.policysimulator.v1.Simulator.ListReplayResults] + // call. Provide this token to retrieve the next page of results. + // + // When paginating, all other parameters provided to + // [Simulator.ListReplayResults[] must match the call that provided the page + // token. + string page_token = 3; +} + +// Response message for +// [Simulator.ListReplayResults][google.cloud.policysimulator.v1.Simulator.ListReplayResults]. +message ListReplayResultsResponse { + // The results of running a [Replay][google.cloud.policysimulator.v1.Replay]. + repeated ReplayResult replay_results = 1; + + // A token that you can use to retrieve the next page of + // [ReplayResult][google.cloud.policysimulator.v1.ReplayResult] objects. If + // this field is omitted, there are no subsequent pages. + string next_page_token = 2; +} + +// The configuration used for a +// [Replay][google.cloud.policysimulator.v1.Replay]. +message ReplayConfig { + // The source of the logs to use for a + // [Replay][google.cloud.policysimulator.v1.Replay]. + enum LogSource { + // An unspecified log source. + // If the log source is unspecified, the + // [Replay][google.cloud.policysimulator.v1.Replay] defaults to using + // `RECENT_ACCESSES`. + LOG_SOURCE_UNSPECIFIED = 0; + + // All access logs from the last 90 days. These logs may not include logs + // from the most recent 7 days. + RECENT_ACCESSES = 1; + } + + // A mapping of the resources that you want to simulate policies for and the + // policies that you want to simulate. + // + // Keys are the full resource names for the resources. For example, + // `//cloudresourcemanager.googleapis.com/projects/my-project`. + // For examples of full resource names for Google Cloud services, see + // https://cloud.google.com/iam/help/troubleshooter/full-resource-names. + // + // Values are [Policy][google.iam.v1.Policy] objects representing the policies + // that you want to simulate. + // + // Replays automatically take into account any IAM policies inherited through + // the resource hierarchy, and any policies set on descendant resources. You + // do not need to include these policies in the policy overlay. + map policy_overlay = 1; + + // The logs to use as input for the + // [Replay][google.cloud.policysimulator.v1.Replay]. + LogSource log_source = 2; +} + +// The difference between the results of evaluating an access tuple under +// the current (baseline) policies and under the proposed (simulated) policies. +// This difference explains how a principal's access could change if the +// proposed policies were applied. +message ReplayDiff { + // A summary and comparison of the principal's access under the current + // (baseline) policies and the proposed (simulated) policies for a single + // access tuple. + // + // The evaluation of the principal's access is reported in the + // [AccessState][google.cloud.policysimulator.v1.AccessState] field. + AccessStateDiff access_diff = 2; +} + +// A summary and comparison of the principal's access under the current +// (baseline) policies and the proposed (simulated) policies for a single +// access tuple. +message AccessStateDiff { + // How the principal's access, specified in the AccessState field, changed + // between the current (baseline) policies and proposed (simulated) policies. + enum AccessChangeType { + // Default value. This value is unused. + ACCESS_CHANGE_TYPE_UNSPECIFIED = 0; + + // The principal's access did not change. + // This includes the case where both baseline and simulated are UNKNOWN, + // but the unknown information is equivalent. + NO_CHANGE = 1; + + // The principal's access under both the current policies and the proposed + // policies is `UNKNOWN`, but the unknown information differs between them. + UNKNOWN_CHANGE = 2; + + // The principal had access under the current policies (`GRANTED`), but will + // no longer have access after the proposed changes (`NOT_GRANTED`). + ACCESS_REVOKED = 3; + + // The principal did not have access under the current policies + // (`NOT_GRANTED`), but will have access after the proposed changes + // (`GRANTED`). + ACCESS_GAINED = 4; + + // This result can occur for the following reasons: + // + // * The principal had access under the current policies (`GRANTED`), but + // their access after the proposed changes is `UNKNOWN`. + // + // * The principal's access under the current policies is `UNKNOWN`, but + // they + // will not have access after the proposed changes (`NOT_GRANTED`). + ACCESS_MAYBE_REVOKED = 5; + + // This result can occur for the following reasons: + // + // * The principal did not have access under the current policies + // (`NOT_GRANTED`), but their access after the proposed changes is + // `UNKNOWN`. + // + // * The principal's access under the current policies is `UNKNOWN`, but + // they will have access after the proposed changes (`GRANTED`). + ACCESS_MAYBE_GAINED = 6; + } + + // The results of evaluating the access tuple under the current (baseline) + // policies. + // + // If the [AccessState][google.cloud.policysimulator.v1.AccessState] couldn't + // be fully evaluated, this field explains why. + ExplainedAccess baseline = 1; + + // The results of evaluating the access tuple under the proposed (simulated) + // policies. + // + // If the AccessState couldn't be fully evaluated, this field explains why. + ExplainedAccess simulated = 2; + + // How the principal's access, specified in the AccessState field, changed + // between the current (baseline) policies and proposed (simulated) policies. + AccessChangeType access_change = 3; +} + +// Details about how a set of policies, listed in +// [ExplainedPolicy][google.cloud.policysimulator.v1.ExplainedPolicy], resulted +// in a certain [AccessState][google.cloud.policysimulator.v1.AccessState] when +// replaying an access tuple. +message ExplainedAccess { + // Whether the principal in the access tuple has permission to access the + // resource in the access tuple under the given policies. + AccessState access_state = 1; + + // If the [AccessState][google.cloud.policysimulator.v1.AccessState] is + // `UNKNOWN`, this field contains the policies that led to that result. + // + // If the `AccessState` is `GRANTED` or `NOT_GRANTED`, this field is + // omitted. + repeated ExplainedPolicy policies = 2; + + // If the [AccessState][google.cloud.policysimulator.v1.AccessState] is + // `UNKNOWN`, this field contains a list of errors explaining why the result + // is `UNKNOWN`. + // + // If the `AccessState` is `GRANTED` or `NOT_GRANTED`, this field is + // omitted. + repeated google.rpc.Status errors = 3; +} diff --git a/packages/google-cloud-policysimulator/protos/protos.d.ts b/packages/google-cloud-policysimulator/protos/protos.d.ts new file mode 100644 index 00000000000..5d7fccae10a --- /dev/null +++ b/packages/google-cloud-policysimulator/protos/protos.d.ts @@ -0,0 +1,9940 @@ +// Copyright 2023 Google LLC +// +// Licensed under the Apache License, Version 2.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 policysimulator. */ + namespace policysimulator { + + /** Namespace v1. */ + namespace v1 { + + /** AccessState enum. */ + enum AccessState { + ACCESS_STATE_UNSPECIFIED = 0, + GRANTED = 1, + NOT_GRANTED = 2, + UNKNOWN_CONDITIONAL = 3, + UNKNOWN_INFO_DENIED = 4 + } + + /** HeuristicRelevance enum. */ + enum HeuristicRelevance { + HEURISTIC_RELEVANCE_UNSPECIFIED = 0, + NORMAL = 1, + HIGH = 2 + } + + /** Properties of an AccessTuple. */ + interface IAccessTuple { + + /** AccessTuple principal */ + principal?: (string|null); + + /** AccessTuple fullResourceName */ + fullResourceName?: (string|null); + + /** AccessTuple permission */ + permission?: (string|null); + } + + /** Represents an AccessTuple. */ + class AccessTuple implements IAccessTuple { + + /** + * Constructs a new AccessTuple. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.policysimulator.v1.IAccessTuple); + + /** AccessTuple principal. */ + public principal: string; + + /** AccessTuple fullResourceName. */ + public fullResourceName: string; + + /** AccessTuple permission. */ + public permission: string; + + /** + * Creates a new AccessTuple instance using the specified properties. + * @param [properties] Properties to set + * @returns AccessTuple instance + */ + public static create(properties?: google.cloud.policysimulator.v1.IAccessTuple): google.cloud.policysimulator.v1.AccessTuple; + + /** + * Encodes the specified AccessTuple message. Does not implicitly {@link google.cloud.policysimulator.v1.AccessTuple.verify|verify} messages. + * @param message AccessTuple message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.policysimulator.v1.IAccessTuple, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified AccessTuple message, length delimited. Does not implicitly {@link google.cloud.policysimulator.v1.AccessTuple.verify|verify} messages. + * @param message AccessTuple message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.policysimulator.v1.IAccessTuple, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an AccessTuple message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns AccessTuple + * @throws {Error} If the payload is not 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.policysimulator.v1.AccessTuple; + + /** + * Decodes an AccessTuple message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns AccessTuple + * @throws {Error} If the payload 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.policysimulator.v1.AccessTuple; + + /** + * Verifies an AccessTuple message. + * @param message Plain 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 AccessTuple message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns AccessTuple + */ + public static fromObject(object: { [k: string]: any }): google.cloud.policysimulator.v1.AccessTuple; + + /** + * Creates a plain object from an AccessTuple message. Also converts values to other types if specified. + * @param message AccessTuple + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.policysimulator.v1.AccessTuple, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this AccessTuple to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for AccessTuple + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an ExplainedPolicy. */ + interface IExplainedPolicy { + + /** ExplainedPolicy access */ + access?: (google.cloud.policysimulator.v1.AccessState|keyof typeof google.cloud.policysimulator.v1.AccessState|null); + + /** ExplainedPolicy fullResourceName */ + fullResourceName?: (string|null); + + /** ExplainedPolicy policy */ + policy?: (google.iam.v1.IPolicy|null); + + /** ExplainedPolicy bindingExplanations */ + bindingExplanations?: (google.cloud.policysimulator.v1.IBindingExplanation[]|null); + + /** ExplainedPolicy relevance */ + relevance?: (google.cloud.policysimulator.v1.HeuristicRelevance|keyof typeof google.cloud.policysimulator.v1.HeuristicRelevance|null); + } + + /** Represents an ExplainedPolicy. */ + class ExplainedPolicy implements IExplainedPolicy { + + /** + * Constructs a new ExplainedPolicy. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.policysimulator.v1.IExplainedPolicy); + + /** ExplainedPolicy access. */ + public access: (google.cloud.policysimulator.v1.AccessState|keyof typeof google.cloud.policysimulator.v1.AccessState); + + /** ExplainedPolicy fullResourceName. */ + public fullResourceName: string; + + /** ExplainedPolicy policy. */ + public policy?: (google.iam.v1.IPolicy|null); + + /** ExplainedPolicy bindingExplanations. */ + public bindingExplanations: google.cloud.policysimulator.v1.IBindingExplanation[]; + + /** ExplainedPolicy relevance. */ + public relevance: (google.cloud.policysimulator.v1.HeuristicRelevance|keyof typeof google.cloud.policysimulator.v1.HeuristicRelevance); + + /** + * Creates a new ExplainedPolicy instance using the specified properties. + * @param [properties] Properties to set + * @returns ExplainedPolicy instance + */ + public static create(properties?: google.cloud.policysimulator.v1.IExplainedPolicy): google.cloud.policysimulator.v1.ExplainedPolicy; + + /** + * Encodes the specified ExplainedPolicy message. Does not implicitly {@link google.cloud.policysimulator.v1.ExplainedPolicy.verify|verify} messages. + * @param message ExplainedPolicy message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.policysimulator.v1.IExplainedPolicy, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ExplainedPolicy message, length delimited. Does not implicitly {@link google.cloud.policysimulator.v1.ExplainedPolicy.verify|verify} messages. + * @param message ExplainedPolicy message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.policysimulator.v1.IExplainedPolicy, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an ExplainedPolicy message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ExplainedPolicy + * @throws {Error} If the payload is not 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.policysimulator.v1.ExplainedPolicy; + + /** + * Decodes an ExplainedPolicy message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ExplainedPolicy + * @throws {Error} If the payload 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.policysimulator.v1.ExplainedPolicy; + + /** + * Verifies an ExplainedPolicy message. + * @param message Plain 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 ExplainedPolicy message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ExplainedPolicy + */ + public static fromObject(object: { [k: string]: any }): google.cloud.policysimulator.v1.ExplainedPolicy; + + /** + * Creates a plain object from an ExplainedPolicy message. Also converts values to other types if specified. + * @param message ExplainedPolicy + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.policysimulator.v1.ExplainedPolicy, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ExplainedPolicy to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ExplainedPolicy + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a BindingExplanation. */ + interface IBindingExplanation { + + /** BindingExplanation access */ + access?: (google.cloud.policysimulator.v1.AccessState|keyof typeof google.cloud.policysimulator.v1.AccessState|null); + + /** BindingExplanation role */ + role?: (string|null); + + /** BindingExplanation rolePermission */ + rolePermission?: (google.cloud.policysimulator.v1.BindingExplanation.RolePermission|keyof typeof google.cloud.policysimulator.v1.BindingExplanation.RolePermission|null); + + /** BindingExplanation rolePermissionRelevance */ + rolePermissionRelevance?: (google.cloud.policysimulator.v1.HeuristicRelevance|keyof typeof google.cloud.policysimulator.v1.HeuristicRelevance|null); + + /** BindingExplanation memberships */ + memberships?: ({ [k: string]: google.cloud.policysimulator.v1.BindingExplanation.IAnnotatedMembership }|null); + + /** BindingExplanation relevance */ + relevance?: (google.cloud.policysimulator.v1.HeuristicRelevance|keyof typeof google.cloud.policysimulator.v1.HeuristicRelevance|null); + + /** BindingExplanation condition */ + condition?: (google.type.IExpr|null); + } + + /** Represents a BindingExplanation. */ + class BindingExplanation implements IBindingExplanation { + + /** + * Constructs a new BindingExplanation. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.policysimulator.v1.IBindingExplanation); + + /** BindingExplanation access. */ + public access: (google.cloud.policysimulator.v1.AccessState|keyof typeof google.cloud.policysimulator.v1.AccessState); + + /** BindingExplanation role. */ + public role: string; + + /** BindingExplanation rolePermission. */ + public rolePermission: (google.cloud.policysimulator.v1.BindingExplanation.RolePermission|keyof typeof google.cloud.policysimulator.v1.BindingExplanation.RolePermission); + + /** BindingExplanation rolePermissionRelevance. */ + public rolePermissionRelevance: (google.cloud.policysimulator.v1.HeuristicRelevance|keyof typeof google.cloud.policysimulator.v1.HeuristicRelevance); + + /** BindingExplanation memberships. */ + public memberships: { [k: string]: google.cloud.policysimulator.v1.BindingExplanation.IAnnotatedMembership }; + + /** BindingExplanation relevance. */ + public relevance: (google.cloud.policysimulator.v1.HeuristicRelevance|keyof typeof google.cloud.policysimulator.v1.HeuristicRelevance); + + /** BindingExplanation condition. */ + public condition?: (google.type.IExpr|null); + + /** + * Creates a new BindingExplanation instance using the specified properties. + * @param [properties] Properties to set + * @returns BindingExplanation instance + */ + public static create(properties?: google.cloud.policysimulator.v1.IBindingExplanation): google.cloud.policysimulator.v1.BindingExplanation; + + /** + * Encodes the specified BindingExplanation message. Does not implicitly {@link google.cloud.policysimulator.v1.BindingExplanation.verify|verify} messages. + * @param message BindingExplanation message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.policysimulator.v1.IBindingExplanation, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified BindingExplanation message, length delimited. Does not implicitly {@link google.cloud.policysimulator.v1.BindingExplanation.verify|verify} messages. + * @param message BindingExplanation message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.policysimulator.v1.IBindingExplanation, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a BindingExplanation message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns BindingExplanation + * @throws {Error} If the payload is not 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.policysimulator.v1.BindingExplanation; + + /** + * Decodes a BindingExplanation message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns BindingExplanation + * @throws {Error} If the payload 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.policysimulator.v1.BindingExplanation; + + /** + * Verifies a BindingExplanation message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a BindingExplanation message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns BindingExplanation + */ + public static fromObject(object: { [k: string]: any }): google.cloud.policysimulator.v1.BindingExplanation; + + /** + * Creates a plain object from a BindingExplanation message. Also converts values to other types if specified. + * @param message BindingExplanation + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.policysimulator.v1.BindingExplanation, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this BindingExplanation to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for BindingExplanation + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace BindingExplanation { + + /** Properties of an AnnotatedMembership. */ + interface IAnnotatedMembership { + + /** AnnotatedMembership membership */ + membership?: (google.cloud.policysimulator.v1.BindingExplanation.Membership|keyof typeof google.cloud.policysimulator.v1.BindingExplanation.Membership|null); + + /** AnnotatedMembership relevance */ + relevance?: (google.cloud.policysimulator.v1.HeuristicRelevance|keyof typeof google.cloud.policysimulator.v1.HeuristicRelevance|null); + } + + /** Represents an AnnotatedMembership. */ + class AnnotatedMembership implements IAnnotatedMembership { + + /** + * Constructs a new AnnotatedMembership. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.policysimulator.v1.BindingExplanation.IAnnotatedMembership); + + /** AnnotatedMembership membership. */ + public membership: (google.cloud.policysimulator.v1.BindingExplanation.Membership|keyof typeof google.cloud.policysimulator.v1.BindingExplanation.Membership); + + /** AnnotatedMembership relevance. */ + public relevance: (google.cloud.policysimulator.v1.HeuristicRelevance|keyof typeof google.cloud.policysimulator.v1.HeuristicRelevance); + + /** + * Creates a new AnnotatedMembership instance using the specified properties. + * @param [properties] Properties to set + * @returns AnnotatedMembership instance + */ + public static create(properties?: google.cloud.policysimulator.v1.BindingExplanation.IAnnotatedMembership): google.cloud.policysimulator.v1.BindingExplanation.AnnotatedMembership; + + /** + * Encodes the specified AnnotatedMembership message. Does not implicitly {@link google.cloud.policysimulator.v1.BindingExplanation.AnnotatedMembership.verify|verify} messages. + * @param message AnnotatedMembership message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.policysimulator.v1.BindingExplanation.IAnnotatedMembership, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified AnnotatedMembership message, length delimited. Does not implicitly {@link google.cloud.policysimulator.v1.BindingExplanation.AnnotatedMembership.verify|verify} messages. + * @param message AnnotatedMembership message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.policysimulator.v1.BindingExplanation.IAnnotatedMembership, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an AnnotatedMembership message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns AnnotatedMembership + * @throws {Error} If the payload is not 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.policysimulator.v1.BindingExplanation.AnnotatedMembership; + + /** + * Decodes an AnnotatedMembership message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns AnnotatedMembership + * @throws {Error} If the payload 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.policysimulator.v1.BindingExplanation.AnnotatedMembership; + + /** + * Verifies an AnnotatedMembership message. + * @param message Plain 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 AnnotatedMembership message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns AnnotatedMembership + */ + public static fromObject(object: { [k: string]: any }): google.cloud.policysimulator.v1.BindingExplanation.AnnotatedMembership; + + /** + * Creates a plain object from an AnnotatedMembership message. Also converts values to other types if specified. + * @param message AnnotatedMembership + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.policysimulator.v1.BindingExplanation.AnnotatedMembership, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this AnnotatedMembership to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for AnnotatedMembership + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** RolePermission enum. */ + enum RolePermission { + ROLE_PERMISSION_UNSPECIFIED = 0, + ROLE_PERMISSION_INCLUDED = 1, + ROLE_PERMISSION_NOT_INCLUDED = 2, + ROLE_PERMISSION_UNKNOWN_INFO_DENIED = 3 + } + + /** Membership enum. */ + enum Membership { + MEMBERSHIP_UNSPECIFIED = 0, + MEMBERSHIP_INCLUDED = 1, + MEMBERSHIP_NOT_INCLUDED = 2, + MEMBERSHIP_UNKNOWN_INFO_DENIED = 3, + MEMBERSHIP_UNKNOWN_UNSUPPORTED = 4 + } + } + + /** Represents a Simulator */ + class Simulator extends $protobuf.rpc.Service { + + /** + * Constructs a new Simulator 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 Simulator 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): Simulator; + + /** + * Calls GetReplay. + * @param request GetReplayRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Replay + */ + public getReplay(request: google.cloud.policysimulator.v1.IGetReplayRequest, callback: google.cloud.policysimulator.v1.Simulator.GetReplayCallback): void; + + /** + * Calls GetReplay. + * @param request GetReplayRequest message or plain object + * @returns Promise + */ + public getReplay(request: google.cloud.policysimulator.v1.IGetReplayRequest): Promise; + + /** + * Calls CreateReplay. + * @param request CreateReplayRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public createReplay(request: google.cloud.policysimulator.v1.ICreateReplayRequest, callback: google.cloud.policysimulator.v1.Simulator.CreateReplayCallback): void; + + /** + * Calls CreateReplay. + * @param request CreateReplayRequest message or plain object + * @returns Promise + */ + public createReplay(request: google.cloud.policysimulator.v1.ICreateReplayRequest): Promise; + + /** + * Calls ListReplayResults. + * @param request ListReplayResultsRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ListReplayResultsResponse + */ + public listReplayResults(request: google.cloud.policysimulator.v1.IListReplayResultsRequest, callback: google.cloud.policysimulator.v1.Simulator.ListReplayResultsCallback): void; + + /** + * Calls ListReplayResults. + * @param request ListReplayResultsRequest message or plain object + * @returns Promise + */ + public listReplayResults(request: google.cloud.policysimulator.v1.IListReplayResultsRequest): Promise; + } + + namespace Simulator { + + /** + * Callback as used by {@link google.cloud.policysimulator.v1.Simulator|getReplay}. + * @param error Error, if any + * @param [response] Replay + */ + type GetReplayCallback = (error: (Error|null), response?: google.cloud.policysimulator.v1.Replay) => void; + + /** + * Callback as used by {@link google.cloud.policysimulator.v1.Simulator|createReplay}. + * @param error Error, if any + * @param [response] Operation + */ + type CreateReplayCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.cloud.policysimulator.v1.Simulator|listReplayResults}. + * @param error Error, if any + * @param [response] ListReplayResultsResponse + */ + type ListReplayResultsCallback = (error: (Error|null), response?: google.cloud.policysimulator.v1.ListReplayResultsResponse) => void; + } + + /** Properties of a Replay. */ + interface IReplay { + + /** Replay name */ + name?: (string|null); + + /** Replay state */ + state?: (google.cloud.policysimulator.v1.Replay.State|keyof typeof google.cloud.policysimulator.v1.Replay.State|null); + + /** Replay config */ + config?: (google.cloud.policysimulator.v1.IReplayConfig|null); + + /** Replay resultsSummary */ + resultsSummary?: (google.cloud.policysimulator.v1.Replay.IResultsSummary|null); + } + + /** Represents a Replay. */ + class Replay implements IReplay { + + /** + * Constructs a new Replay. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.policysimulator.v1.IReplay); + + /** Replay name. */ + public name: string; + + /** Replay state. */ + public state: (google.cloud.policysimulator.v1.Replay.State|keyof typeof google.cloud.policysimulator.v1.Replay.State); + + /** Replay config. */ + public config?: (google.cloud.policysimulator.v1.IReplayConfig|null); + + /** Replay resultsSummary. */ + public resultsSummary?: (google.cloud.policysimulator.v1.Replay.IResultsSummary|null); + + /** + * Creates a new Replay instance using the specified properties. + * @param [properties] Properties to set + * @returns Replay instance + */ + public static create(properties?: google.cloud.policysimulator.v1.IReplay): google.cloud.policysimulator.v1.Replay; + + /** + * Encodes the specified Replay message. Does not implicitly {@link google.cloud.policysimulator.v1.Replay.verify|verify} messages. + * @param message Replay message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.policysimulator.v1.IReplay, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Replay message, length delimited. Does not implicitly {@link google.cloud.policysimulator.v1.Replay.verify|verify} messages. + * @param message Replay message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.policysimulator.v1.IReplay, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Replay message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Replay + * @throws {Error} If the payload is not 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.policysimulator.v1.Replay; + + /** + * Decodes a Replay message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Replay + * @throws {Error} If the payload 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.policysimulator.v1.Replay; + + /** + * Verifies a Replay message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Replay message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Replay + */ + public static fromObject(object: { [k: string]: any }): google.cloud.policysimulator.v1.Replay; + + /** + * Creates a plain object from a Replay message. Also converts values to other types if specified. + * @param message Replay + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.policysimulator.v1.Replay, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Replay to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Replay + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace Replay { + + /** Properties of a ResultsSummary. */ + interface IResultsSummary { + + /** ResultsSummary logCount */ + logCount?: (number|null); + + /** ResultsSummary unchangedCount */ + unchangedCount?: (number|null); + + /** ResultsSummary differenceCount */ + differenceCount?: (number|null); + + /** ResultsSummary errorCount */ + errorCount?: (number|null); + + /** ResultsSummary oldestDate */ + oldestDate?: (google.type.IDate|null); + + /** ResultsSummary newestDate */ + newestDate?: (google.type.IDate|null); + } + + /** Represents a ResultsSummary. */ + class ResultsSummary implements IResultsSummary { + + /** + * Constructs a new ResultsSummary. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.policysimulator.v1.Replay.IResultsSummary); + + /** ResultsSummary logCount. */ + public logCount: number; + + /** ResultsSummary unchangedCount. */ + public unchangedCount: number; + + /** ResultsSummary differenceCount. */ + public differenceCount: number; + + /** ResultsSummary errorCount. */ + public errorCount: number; + + /** ResultsSummary oldestDate. */ + public oldestDate?: (google.type.IDate|null); + + /** ResultsSummary newestDate. */ + public newestDate?: (google.type.IDate|null); + + /** + * Creates a new ResultsSummary instance using the specified properties. + * @param [properties] Properties to set + * @returns ResultsSummary instance + */ + public static create(properties?: google.cloud.policysimulator.v1.Replay.IResultsSummary): google.cloud.policysimulator.v1.Replay.ResultsSummary; + + /** + * Encodes the specified ResultsSummary message. Does not implicitly {@link google.cloud.policysimulator.v1.Replay.ResultsSummary.verify|verify} messages. + * @param message ResultsSummary message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.policysimulator.v1.Replay.IResultsSummary, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ResultsSummary message, length delimited. Does not implicitly {@link google.cloud.policysimulator.v1.Replay.ResultsSummary.verify|verify} messages. + * @param message ResultsSummary message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.policysimulator.v1.Replay.IResultsSummary, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ResultsSummary message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ResultsSummary + * @throws {Error} If the payload is not 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.policysimulator.v1.Replay.ResultsSummary; + + /** + * Decodes a ResultsSummary message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ResultsSummary + * @throws {Error} If the payload 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.policysimulator.v1.Replay.ResultsSummary; + + /** + * Verifies a ResultsSummary message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ResultsSummary message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ResultsSummary + */ + public static fromObject(object: { [k: string]: any }): google.cloud.policysimulator.v1.Replay.ResultsSummary; + + /** + * Creates a plain object from a ResultsSummary message. Also converts values to other types if specified. + * @param message ResultsSummary + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.policysimulator.v1.Replay.ResultsSummary, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ResultsSummary to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ResultsSummary + * @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, + PENDING = 1, + RUNNING = 2, + SUCCEEDED = 3, + FAILED = 4 + } + } + + /** Properties of a ReplayResult. */ + interface IReplayResult { + + /** ReplayResult diff */ + diff?: (google.cloud.policysimulator.v1.IReplayDiff|null); + + /** ReplayResult error */ + error?: (google.rpc.IStatus|null); + + /** ReplayResult name */ + name?: (string|null); + + /** ReplayResult parent */ + parent?: (string|null); + + /** ReplayResult accessTuple */ + accessTuple?: (google.cloud.policysimulator.v1.IAccessTuple|null); + + /** ReplayResult lastSeenDate */ + lastSeenDate?: (google.type.IDate|null); + } + + /** Represents a ReplayResult. */ + class ReplayResult implements IReplayResult { + + /** + * Constructs a new ReplayResult. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.policysimulator.v1.IReplayResult); + + /** ReplayResult diff. */ + public diff?: (google.cloud.policysimulator.v1.IReplayDiff|null); + + /** ReplayResult error. */ + public error?: (google.rpc.IStatus|null); + + /** ReplayResult name. */ + public name: string; + + /** ReplayResult parent. */ + public parent: string; + + /** ReplayResult accessTuple. */ + public accessTuple?: (google.cloud.policysimulator.v1.IAccessTuple|null); + + /** ReplayResult lastSeenDate. */ + public lastSeenDate?: (google.type.IDate|null); + + /** ReplayResult result. */ + public result?: ("diff"|"error"); + + /** + * Creates a new ReplayResult instance using the specified properties. + * @param [properties] Properties to set + * @returns ReplayResult instance + */ + public static create(properties?: google.cloud.policysimulator.v1.IReplayResult): google.cloud.policysimulator.v1.ReplayResult; + + /** + * Encodes the specified ReplayResult message. Does not implicitly {@link google.cloud.policysimulator.v1.ReplayResult.verify|verify} messages. + * @param message ReplayResult message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.policysimulator.v1.IReplayResult, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ReplayResult message, length delimited. Does not implicitly {@link google.cloud.policysimulator.v1.ReplayResult.verify|verify} messages. + * @param message ReplayResult message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.policysimulator.v1.IReplayResult, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ReplayResult message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ReplayResult + * @throws {Error} If the payload is not 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.policysimulator.v1.ReplayResult; + + /** + * Decodes a ReplayResult message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ReplayResult + * @throws {Error} If the payload 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.policysimulator.v1.ReplayResult; + + /** + * Verifies a ReplayResult message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ReplayResult message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ReplayResult + */ + public static fromObject(object: { [k: string]: any }): google.cloud.policysimulator.v1.ReplayResult; + + /** + * Creates a plain object from a ReplayResult message. Also converts values to other types if specified. + * @param message ReplayResult + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.policysimulator.v1.ReplayResult, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ReplayResult to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ReplayResult + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a CreateReplayRequest. */ + interface ICreateReplayRequest { + + /** CreateReplayRequest parent */ + parent?: (string|null); + + /** CreateReplayRequest replay */ + replay?: (google.cloud.policysimulator.v1.IReplay|null); + } + + /** Represents a CreateReplayRequest. */ + class CreateReplayRequest implements ICreateReplayRequest { + + /** + * Constructs a new CreateReplayRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.policysimulator.v1.ICreateReplayRequest); + + /** CreateReplayRequest parent. */ + public parent: string; + + /** CreateReplayRequest replay. */ + public replay?: (google.cloud.policysimulator.v1.IReplay|null); + + /** + * Creates a new CreateReplayRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns CreateReplayRequest instance + */ + public static create(properties?: google.cloud.policysimulator.v1.ICreateReplayRequest): google.cloud.policysimulator.v1.CreateReplayRequest; + + /** + * Encodes the specified CreateReplayRequest message. Does not implicitly {@link google.cloud.policysimulator.v1.CreateReplayRequest.verify|verify} messages. + * @param message CreateReplayRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.policysimulator.v1.ICreateReplayRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CreateReplayRequest message, length delimited. Does not implicitly {@link google.cloud.policysimulator.v1.CreateReplayRequest.verify|verify} messages. + * @param message CreateReplayRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.policysimulator.v1.ICreateReplayRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CreateReplayRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CreateReplayRequest + * @throws {Error} If the payload is not 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.policysimulator.v1.CreateReplayRequest; + + /** + * Decodes a CreateReplayRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CreateReplayRequest + * @throws {Error} If the payload 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.policysimulator.v1.CreateReplayRequest; + + /** + * Verifies a CreateReplayRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CreateReplayRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CreateReplayRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.policysimulator.v1.CreateReplayRequest; + + /** + * Creates a plain object from a CreateReplayRequest message. Also converts values to other types if specified. + * @param message CreateReplayRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.policysimulator.v1.CreateReplayRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CreateReplayRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CreateReplayRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ReplayOperationMetadata. */ + interface IReplayOperationMetadata { + + /** ReplayOperationMetadata startTime */ + startTime?: (google.protobuf.ITimestamp|null); + } + + /** Represents a ReplayOperationMetadata. */ + class ReplayOperationMetadata implements IReplayOperationMetadata { + + /** + * Constructs a new ReplayOperationMetadata. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.policysimulator.v1.IReplayOperationMetadata); + + /** ReplayOperationMetadata startTime. */ + public startTime?: (google.protobuf.ITimestamp|null); + + /** + * Creates a new ReplayOperationMetadata instance using the specified properties. + * @param [properties] Properties to set + * @returns ReplayOperationMetadata instance + */ + public static create(properties?: google.cloud.policysimulator.v1.IReplayOperationMetadata): google.cloud.policysimulator.v1.ReplayOperationMetadata; + + /** + * Encodes the specified ReplayOperationMetadata message. Does not implicitly {@link google.cloud.policysimulator.v1.ReplayOperationMetadata.verify|verify} messages. + * @param message ReplayOperationMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.policysimulator.v1.IReplayOperationMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ReplayOperationMetadata message, length delimited. Does not implicitly {@link google.cloud.policysimulator.v1.ReplayOperationMetadata.verify|verify} messages. + * @param message ReplayOperationMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.policysimulator.v1.IReplayOperationMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ReplayOperationMetadata message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ReplayOperationMetadata + * @throws {Error} If the payload is not 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.policysimulator.v1.ReplayOperationMetadata; + + /** + * Decodes a ReplayOperationMetadata message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ReplayOperationMetadata + * @throws {Error} If the payload 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.policysimulator.v1.ReplayOperationMetadata; + + /** + * Verifies a ReplayOperationMetadata message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ReplayOperationMetadata message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ReplayOperationMetadata + */ + public static fromObject(object: { [k: string]: any }): google.cloud.policysimulator.v1.ReplayOperationMetadata; + + /** + * Creates a plain object from a ReplayOperationMetadata message. Also converts values to other types if specified. + * @param message ReplayOperationMetadata + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.policysimulator.v1.ReplayOperationMetadata, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ReplayOperationMetadata to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ReplayOperationMetadata + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a GetReplayRequest. */ + interface IGetReplayRequest { + + /** GetReplayRequest name */ + name?: (string|null); + } + + /** Represents a GetReplayRequest. */ + class GetReplayRequest implements IGetReplayRequest { + + /** + * Constructs a new GetReplayRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.policysimulator.v1.IGetReplayRequest); + + /** GetReplayRequest name. */ + public name: string; + + /** + * Creates a new GetReplayRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GetReplayRequest instance + */ + public static create(properties?: google.cloud.policysimulator.v1.IGetReplayRequest): google.cloud.policysimulator.v1.GetReplayRequest; + + /** + * Encodes the specified GetReplayRequest message. Does not implicitly {@link google.cloud.policysimulator.v1.GetReplayRequest.verify|verify} messages. + * @param message GetReplayRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.policysimulator.v1.IGetReplayRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GetReplayRequest message, length delimited. Does not implicitly {@link google.cloud.policysimulator.v1.GetReplayRequest.verify|verify} messages. + * @param message GetReplayRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.policysimulator.v1.IGetReplayRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GetReplayRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GetReplayRequest + * @throws {Error} If the payload is not 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.policysimulator.v1.GetReplayRequest; + + /** + * Decodes a GetReplayRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GetReplayRequest + * @throws {Error} If the payload 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.policysimulator.v1.GetReplayRequest; + + /** + * Verifies a GetReplayRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GetReplayRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GetReplayRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.policysimulator.v1.GetReplayRequest; + + /** + * Creates a plain object from a GetReplayRequest message. Also converts values to other types if specified. + * @param message GetReplayRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.policysimulator.v1.GetReplayRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GetReplayRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GetReplayRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListReplayResultsRequest. */ + interface IListReplayResultsRequest { + + /** ListReplayResultsRequest parent */ + parent?: (string|null); + + /** ListReplayResultsRequest pageSize */ + pageSize?: (number|null); + + /** ListReplayResultsRequest pageToken */ + pageToken?: (string|null); + } + + /** Represents a ListReplayResultsRequest. */ + class ListReplayResultsRequest implements IListReplayResultsRequest { + + /** + * Constructs a new ListReplayResultsRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.policysimulator.v1.IListReplayResultsRequest); + + /** ListReplayResultsRequest parent. */ + public parent: string; + + /** ListReplayResultsRequest pageSize. */ + public pageSize: number; + + /** ListReplayResultsRequest pageToken. */ + public pageToken: string; + + /** + * Creates a new ListReplayResultsRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ListReplayResultsRequest instance + */ + public static create(properties?: google.cloud.policysimulator.v1.IListReplayResultsRequest): google.cloud.policysimulator.v1.ListReplayResultsRequest; + + /** + * Encodes the specified ListReplayResultsRequest message. Does not implicitly {@link google.cloud.policysimulator.v1.ListReplayResultsRequest.verify|verify} messages. + * @param message ListReplayResultsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.policysimulator.v1.IListReplayResultsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListReplayResultsRequest message, length delimited. Does not implicitly {@link google.cloud.policysimulator.v1.ListReplayResultsRequest.verify|verify} messages. + * @param message ListReplayResultsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.policysimulator.v1.IListReplayResultsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListReplayResultsRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListReplayResultsRequest + * @throws {Error} If the payload is not 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.policysimulator.v1.ListReplayResultsRequest; + + /** + * Decodes a ListReplayResultsRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListReplayResultsRequest + * @throws {Error} If the payload 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.policysimulator.v1.ListReplayResultsRequest; + + /** + * Verifies a ListReplayResultsRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListReplayResultsRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListReplayResultsRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.policysimulator.v1.ListReplayResultsRequest; + + /** + * Creates a plain object from a ListReplayResultsRequest message. Also converts values to other types if specified. + * @param message ListReplayResultsRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.policysimulator.v1.ListReplayResultsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListReplayResultsRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListReplayResultsRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListReplayResultsResponse. */ + interface IListReplayResultsResponse { + + /** ListReplayResultsResponse replayResults */ + replayResults?: (google.cloud.policysimulator.v1.IReplayResult[]|null); + + /** ListReplayResultsResponse nextPageToken */ + nextPageToken?: (string|null); + } + + /** Represents a ListReplayResultsResponse. */ + class ListReplayResultsResponse implements IListReplayResultsResponse { + + /** + * Constructs a new ListReplayResultsResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.policysimulator.v1.IListReplayResultsResponse); + + /** ListReplayResultsResponse replayResults. */ + public replayResults: google.cloud.policysimulator.v1.IReplayResult[]; + + /** ListReplayResultsResponse nextPageToken. */ + public nextPageToken: string; + + /** + * Creates a new ListReplayResultsResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ListReplayResultsResponse instance + */ + public static create(properties?: google.cloud.policysimulator.v1.IListReplayResultsResponse): google.cloud.policysimulator.v1.ListReplayResultsResponse; + + /** + * Encodes the specified ListReplayResultsResponse message. Does not implicitly {@link google.cloud.policysimulator.v1.ListReplayResultsResponse.verify|verify} messages. + * @param message ListReplayResultsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.policysimulator.v1.IListReplayResultsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListReplayResultsResponse message, length delimited. Does not implicitly {@link google.cloud.policysimulator.v1.ListReplayResultsResponse.verify|verify} messages. + * @param message ListReplayResultsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.policysimulator.v1.IListReplayResultsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListReplayResultsResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListReplayResultsResponse + * @throws {Error} If the payload is not 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.policysimulator.v1.ListReplayResultsResponse; + + /** + * Decodes a ListReplayResultsResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListReplayResultsResponse + * @throws {Error} If the payload 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.policysimulator.v1.ListReplayResultsResponse; + + /** + * Verifies a ListReplayResultsResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListReplayResultsResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListReplayResultsResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.policysimulator.v1.ListReplayResultsResponse; + + /** + * Creates a plain object from a ListReplayResultsResponse message. Also converts values to other types if specified. + * @param message ListReplayResultsResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.policysimulator.v1.ListReplayResultsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListReplayResultsResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListReplayResultsResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ReplayConfig. */ + interface IReplayConfig { + + /** ReplayConfig policyOverlay */ + policyOverlay?: ({ [k: string]: google.iam.v1.IPolicy }|null); + + /** ReplayConfig logSource */ + logSource?: (google.cloud.policysimulator.v1.ReplayConfig.LogSource|keyof typeof google.cloud.policysimulator.v1.ReplayConfig.LogSource|null); + } + + /** Represents a ReplayConfig. */ + class ReplayConfig implements IReplayConfig { + + /** + * Constructs a new ReplayConfig. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.policysimulator.v1.IReplayConfig); + + /** ReplayConfig policyOverlay. */ + public policyOverlay: { [k: string]: google.iam.v1.IPolicy }; + + /** ReplayConfig logSource. */ + public logSource: (google.cloud.policysimulator.v1.ReplayConfig.LogSource|keyof typeof google.cloud.policysimulator.v1.ReplayConfig.LogSource); + + /** + * Creates a new ReplayConfig instance using the specified properties. + * @param [properties] Properties to set + * @returns ReplayConfig instance + */ + public static create(properties?: google.cloud.policysimulator.v1.IReplayConfig): google.cloud.policysimulator.v1.ReplayConfig; + + /** + * Encodes the specified ReplayConfig message. Does not implicitly {@link google.cloud.policysimulator.v1.ReplayConfig.verify|verify} messages. + * @param message ReplayConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.policysimulator.v1.IReplayConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ReplayConfig message, length delimited. Does not implicitly {@link google.cloud.policysimulator.v1.ReplayConfig.verify|verify} messages. + * @param message ReplayConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.policysimulator.v1.IReplayConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ReplayConfig message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ReplayConfig + * @throws {Error} If the payload is not 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.policysimulator.v1.ReplayConfig; + + /** + * Decodes a ReplayConfig message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ReplayConfig + * @throws {Error} If the payload 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.policysimulator.v1.ReplayConfig; + + /** + * Verifies a ReplayConfig message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ReplayConfig message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ReplayConfig + */ + public static fromObject(object: { [k: string]: any }): google.cloud.policysimulator.v1.ReplayConfig; + + /** + * Creates a plain object from a ReplayConfig message. Also converts values to other types if specified. + * @param message ReplayConfig + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.policysimulator.v1.ReplayConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ReplayConfig to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ReplayConfig + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace ReplayConfig { + + /** LogSource enum. */ + enum LogSource { + LOG_SOURCE_UNSPECIFIED = 0, + RECENT_ACCESSES = 1 + } + } + + /** Properties of a ReplayDiff. */ + interface IReplayDiff { + + /** ReplayDiff accessDiff */ + accessDiff?: (google.cloud.policysimulator.v1.IAccessStateDiff|null); + } + + /** Represents a ReplayDiff. */ + class ReplayDiff implements IReplayDiff { + + /** + * Constructs a new ReplayDiff. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.policysimulator.v1.IReplayDiff); + + /** ReplayDiff accessDiff. */ + public accessDiff?: (google.cloud.policysimulator.v1.IAccessStateDiff|null); + + /** + * Creates a new ReplayDiff instance using the specified properties. + * @param [properties] Properties to set + * @returns ReplayDiff instance + */ + public static create(properties?: google.cloud.policysimulator.v1.IReplayDiff): google.cloud.policysimulator.v1.ReplayDiff; + + /** + * Encodes the specified ReplayDiff message. Does not implicitly {@link google.cloud.policysimulator.v1.ReplayDiff.verify|verify} messages. + * @param message ReplayDiff message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.policysimulator.v1.IReplayDiff, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ReplayDiff message, length delimited. Does not implicitly {@link google.cloud.policysimulator.v1.ReplayDiff.verify|verify} messages. + * @param message ReplayDiff message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.policysimulator.v1.IReplayDiff, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ReplayDiff message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ReplayDiff + * @throws {Error} If the payload is not 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.policysimulator.v1.ReplayDiff; + + /** + * Decodes a ReplayDiff message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ReplayDiff + * @throws {Error} If the payload 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.policysimulator.v1.ReplayDiff; + + /** + * Verifies a ReplayDiff message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ReplayDiff message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ReplayDiff + */ + public static fromObject(object: { [k: string]: any }): google.cloud.policysimulator.v1.ReplayDiff; + + /** + * Creates a plain object from a ReplayDiff message. Also converts values to other types if specified. + * @param message ReplayDiff + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.policysimulator.v1.ReplayDiff, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ReplayDiff to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ReplayDiff + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an AccessStateDiff. */ + interface IAccessStateDiff { + + /** AccessStateDiff baseline */ + baseline?: (google.cloud.policysimulator.v1.IExplainedAccess|null); + + /** AccessStateDiff simulated */ + simulated?: (google.cloud.policysimulator.v1.IExplainedAccess|null); + + /** AccessStateDiff accessChange */ + accessChange?: (google.cloud.policysimulator.v1.AccessStateDiff.AccessChangeType|keyof typeof google.cloud.policysimulator.v1.AccessStateDiff.AccessChangeType|null); + } + + /** Represents an AccessStateDiff. */ + class AccessStateDiff implements IAccessStateDiff { + + /** + * Constructs a new AccessStateDiff. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.policysimulator.v1.IAccessStateDiff); + + /** AccessStateDiff baseline. */ + public baseline?: (google.cloud.policysimulator.v1.IExplainedAccess|null); + + /** AccessStateDiff simulated. */ + public simulated?: (google.cloud.policysimulator.v1.IExplainedAccess|null); + + /** AccessStateDiff accessChange. */ + public accessChange: (google.cloud.policysimulator.v1.AccessStateDiff.AccessChangeType|keyof typeof google.cloud.policysimulator.v1.AccessStateDiff.AccessChangeType); + + /** + * Creates a new AccessStateDiff instance using the specified properties. + * @param [properties] Properties to set + * @returns AccessStateDiff instance + */ + public static create(properties?: google.cloud.policysimulator.v1.IAccessStateDiff): google.cloud.policysimulator.v1.AccessStateDiff; + + /** + * Encodes the specified AccessStateDiff message. Does not implicitly {@link google.cloud.policysimulator.v1.AccessStateDiff.verify|verify} messages. + * @param message AccessStateDiff message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.policysimulator.v1.IAccessStateDiff, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified AccessStateDiff message, length delimited. Does not implicitly {@link google.cloud.policysimulator.v1.AccessStateDiff.verify|verify} messages. + * @param message AccessStateDiff message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.policysimulator.v1.IAccessStateDiff, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an AccessStateDiff message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns AccessStateDiff + * @throws {Error} If the payload is not 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.policysimulator.v1.AccessStateDiff; + + /** + * Decodes an AccessStateDiff message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns AccessStateDiff + * @throws {Error} If the payload 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.policysimulator.v1.AccessStateDiff; + + /** + * Verifies an AccessStateDiff message. + * @param message Plain 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 AccessStateDiff message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns AccessStateDiff + */ + public static fromObject(object: { [k: string]: any }): google.cloud.policysimulator.v1.AccessStateDiff; + + /** + * Creates a plain object from an AccessStateDiff message. Also converts values to other types if specified. + * @param message AccessStateDiff + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.policysimulator.v1.AccessStateDiff, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this AccessStateDiff to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for AccessStateDiff + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace AccessStateDiff { + + /** AccessChangeType enum. */ + enum AccessChangeType { + ACCESS_CHANGE_TYPE_UNSPECIFIED = 0, + NO_CHANGE = 1, + UNKNOWN_CHANGE = 2, + ACCESS_REVOKED = 3, + ACCESS_GAINED = 4, + ACCESS_MAYBE_REVOKED = 5, + ACCESS_MAYBE_GAINED = 6 + } + } + + /** Properties of an ExplainedAccess. */ + interface IExplainedAccess { + + /** ExplainedAccess accessState */ + accessState?: (google.cloud.policysimulator.v1.AccessState|keyof typeof google.cloud.policysimulator.v1.AccessState|null); + + /** ExplainedAccess policies */ + policies?: (google.cloud.policysimulator.v1.IExplainedPolicy[]|null); + + /** ExplainedAccess errors */ + errors?: (google.rpc.IStatus[]|null); + } + + /** Represents an ExplainedAccess. */ + class ExplainedAccess implements IExplainedAccess { + + /** + * Constructs a new ExplainedAccess. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.policysimulator.v1.IExplainedAccess); + + /** ExplainedAccess accessState. */ + public accessState: (google.cloud.policysimulator.v1.AccessState|keyof typeof google.cloud.policysimulator.v1.AccessState); + + /** ExplainedAccess policies. */ + public policies: google.cloud.policysimulator.v1.IExplainedPolicy[]; + + /** ExplainedAccess errors. */ + public errors: google.rpc.IStatus[]; + + /** + * Creates a new ExplainedAccess instance using the specified properties. + * @param [properties] Properties to set + * @returns ExplainedAccess instance + */ + public static create(properties?: google.cloud.policysimulator.v1.IExplainedAccess): google.cloud.policysimulator.v1.ExplainedAccess; + + /** + * Encodes the specified ExplainedAccess message. Does not implicitly {@link google.cloud.policysimulator.v1.ExplainedAccess.verify|verify} messages. + * @param message ExplainedAccess message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.policysimulator.v1.IExplainedAccess, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ExplainedAccess message, length delimited. Does not implicitly {@link google.cloud.policysimulator.v1.ExplainedAccess.verify|verify} messages. + * @param message ExplainedAccess message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.policysimulator.v1.IExplainedAccess, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an ExplainedAccess message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ExplainedAccess + * @throws {Error} If the payload is not 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.policysimulator.v1.ExplainedAccess; + + /** + * Decodes an ExplainedAccess message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ExplainedAccess + * @throws {Error} If the payload 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.policysimulator.v1.ExplainedAccess; + + /** + * Verifies an ExplainedAccess message. + * @param message Plain 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 ExplainedAccess message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ExplainedAccess + */ + public static fromObject(object: { [k: string]: any }): google.cloud.policysimulator.v1.ExplainedAccess; + + /** + * Creates a plain object from an ExplainedAccess message. Also converts values to other types if specified. + * @param message ExplainedAccess + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.policysimulator.v1.ExplainedAccess, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ExplainedAccess to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ExplainedAccess + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + } + } + + /** 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 + } + + /** 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); + } + + /** 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[]; + + /** + * 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); + } + + /** 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); + + /** + * 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); + } + + /** 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); + + /** + * 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 + } + + /** 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 + } + + /** 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; + } + + /** 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?: (string|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: string; + + /** + * 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); + } + + /** 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[]; + + /** + * 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; + } + + /** 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_REQUIRED = 2, + LABEL_REPEATED = 3 + } + } + + /** 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 phpGenericServices */ + phpGenericServices?: (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 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 phpGenericServices. */ + public phpGenericServices: 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 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 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 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 target */ + target?: (google.protobuf.FieldOptions.OptionTargetType|keyof typeof google.protobuf.FieldOptions.OptionTargetType|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 target. */ + public target: (google.protobuf.FieldOptions.OptionTargetType|keyof typeof google.protobuf.FieldOptions.OptionTargetType); + + /** 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 OneofOptions. */ + interface IOneofOptions { + + /** 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 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 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 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 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 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 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); + } + + /** Represents a ServiceOptions. */ + class ServiceOptions implements IServiceOptions { + + /** + * Constructs a new ServiceOptions. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IServiceOptions); + + /** 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 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 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|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|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 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|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|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; + } + } + + /** Namespace iam. */ + namespace iam { + + /** Namespace v1. */ + namespace v1 { + + /** Properties of a Policy. */ + interface IPolicy { + + /** Policy version */ + version?: (number|null); + + /** Policy bindings */ + bindings?: (google.iam.v1.IBinding[]|null); + + /** Policy auditConfigs */ + auditConfigs?: (google.iam.v1.IAuditConfig[]|null); + + /** Policy etag */ + etag?: (Uint8Array|string|null); + } + + /** Represents a Policy. */ + class Policy implements IPolicy { + + /** + * Constructs a new Policy. + * @param [properties] Properties to set + */ + constructor(properties?: google.iam.v1.IPolicy); + + /** Policy version. */ + public version: number; + + /** Policy bindings. */ + public bindings: google.iam.v1.IBinding[]; + + /** Policy auditConfigs. */ + public auditConfigs: google.iam.v1.IAuditConfig[]; + + /** Policy etag. */ + public etag: (Uint8Array|string); + + /** + * Creates a new Policy instance using the specified properties. + * @param [properties] Properties to set + * @returns Policy instance + */ + public static create(properties?: google.iam.v1.IPolicy): google.iam.v1.Policy; + + /** + * Encodes the specified Policy message. Does not implicitly {@link google.iam.v1.Policy.verify|verify} messages. + * @param message Policy message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.iam.v1.IPolicy, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Policy message, length delimited. Does not implicitly {@link google.iam.v1.Policy.verify|verify} messages. + * @param message Policy message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.iam.v1.IPolicy, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Policy message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Policy + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.iam.v1.Policy; + + /** + * Decodes a Policy message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Policy + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.iam.v1.Policy; + + /** + * Verifies a Policy message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Policy message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Policy + */ + public static fromObject(object: { [k: string]: any }): google.iam.v1.Policy; + + /** + * Creates a plain object from a Policy message. Also converts values to other types if specified. + * @param message Policy + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.iam.v1.Policy, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Policy to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Policy + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Binding. */ + interface IBinding { + + /** Binding role */ + role?: (string|null); + + /** Binding members */ + members?: (string[]|null); + + /** Binding condition */ + condition?: (google.type.IExpr|null); + } + + /** Represents a Binding. */ + class Binding implements IBinding { + + /** + * Constructs a new Binding. + * @param [properties] Properties to set + */ + constructor(properties?: google.iam.v1.IBinding); + + /** Binding role. */ + public role: string; + + /** Binding members. */ + public members: string[]; + + /** Binding condition. */ + public condition?: (google.type.IExpr|null); + + /** + * Creates a new Binding instance using the specified properties. + * @param [properties] Properties to set + * @returns Binding instance + */ + public static create(properties?: google.iam.v1.IBinding): google.iam.v1.Binding; + + /** + * Encodes the specified Binding message. Does not implicitly {@link google.iam.v1.Binding.verify|verify} messages. + * @param message Binding message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.iam.v1.IBinding, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Binding message, length delimited. Does not implicitly {@link google.iam.v1.Binding.verify|verify} messages. + * @param message Binding message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.iam.v1.IBinding, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Binding message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Binding + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.iam.v1.Binding; + + /** + * Decodes a Binding message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Binding + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.iam.v1.Binding; + + /** + * Verifies a Binding message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Binding message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Binding + */ + public static fromObject(object: { [k: string]: any }): google.iam.v1.Binding; + + /** + * Creates a plain object from a Binding message. Also converts values to other types if specified. + * @param message Binding + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.iam.v1.Binding, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Binding to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Binding + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an AuditConfig. */ + interface IAuditConfig { + + /** AuditConfig service */ + service?: (string|null); + + /** AuditConfig auditLogConfigs */ + auditLogConfigs?: (google.iam.v1.IAuditLogConfig[]|null); + } + + /** Represents an AuditConfig. */ + class AuditConfig implements IAuditConfig { + + /** + * Constructs a new AuditConfig. + * @param [properties] Properties to set + */ + constructor(properties?: google.iam.v1.IAuditConfig); + + /** AuditConfig service. */ + public service: string; + + /** AuditConfig auditLogConfigs. */ + public auditLogConfigs: google.iam.v1.IAuditLogConfig[]; + + /** + * Creates a new AuditConfig instance using the specified properties. + * @param [properties] Properties to set + * @returns AuditConfig instance + */ + public static create(properties?: google.iam.v1.IAuditConfig): google.iam.v1.AuditConfig; + + /** + * Encodes the specified AuditConfig message. Does not implicitly {@link google.iam.v1.AuditConfig.verify|verify} messages. + * @param message AuditConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.iam.v1.IAuditConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified AuditConfig message, length delimited. Does not implicitly {@link google.iam.v1.AuditConfig.verify|verify} messages. + * @param message AuditConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.iam.v1.IAuditConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an AuditConfig message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns AuditConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.iam.v1.AuditConfig; + + /** + * Decodes an AuditConfig message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns AuditConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.iam.v1.AuditConfig; + + /** + * Verifies an AuditConfig message. + * @param message Plain 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 AuditConfig message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns AuditConfig + */ + public static fromObject(object: { [k: string]: any }): google.iam.v1.AuditConfig; + + /** + * Creates a plain object from an AuditConfig message. Also converts values to other types if specified. + * @param message AuditConfig + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.iam.v1.AuditConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this AuditConfig to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for AuditConfig + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an AuditLogConfig. */ + interface IAuditLogConfig { + + /** AuditLogConfig logType */ + logType?: (google.iam.v1.AuditLogConfig.LogType|keyof typeof google.iam.v1.AuditLogConfig.LogType|null); + + /** AuditLogConfig exemptedMembers */ + exemptedMembers?: (string[]|null); + } + + /** Represents an AuditLogConfig. */ + class AuditLogConfig implements IAuditLogConfig { + + /** + * Constructs a new AuditLogConfig. + * @param [properties] Properties to set + */ + constructor(properties?: google.iam.v1.IAuditLogConfig); + + /** AuditLogConfig logType. */ + public logType: (google.iam.v1.AuditLogConfig.LogType|keyof typeof google.iam.v1.AuditLogConfig.LogType); + + /** AuditLogConfig exemptedMembers. */ + public exemptedMembers: string[]; + + /** + * Creates a new AuditLogConfig instance using the specified properties. + * @param [properties] Properties to set + * @returns AuditLogConfig instance + */ + public static create(properties?: google.iam.v1.IAuditLogConfig): google.iam.v1.AuditLogConfig; + + /** + * Encodes the specified AuditLogConfig message. Does not implicitly {@link google.iam.v1.AuditLogConfig.verify|verify} messages. + * @param message AuditLogConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.iam.v1.IAuditLogConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified AuditLogConfig message, length delimited. Does not implicitly {@link google.iam.v1.AuditLogConfig.verify|verify} messages. + * @param message AuditLogConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.iam.v1.IAuditLogConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an AuditLogConfig message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns AuditLogConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.iam.v1.AuditLogConfig; + + /** + * Decodes an AuditLogConfig message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns AuditLogConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.iam.v1.AuditLogConfig; + + /** + * Verifies an AuditLogConfig message. + * @param message Plain 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 AuditLogConfig message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns AuditLogConfig + */ + public static fromObject(object: { [k: string]: any }): google.iam.v1.AuditLogConfig; + + /** + * Creates a plain object from an AuditLogConfig message. Also converts values to other types if specified. + * @param message AuditLogConfig + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.iam.v1.AuditLogConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this AuditLogConfig to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for AuditLogConfig + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace AuditLogConfig { + + /** LogType enum. */ + enum LogType { + LOG_TYPE_UNSPECIFIED = 0, + ADMIN_READ = 1, + DATA_WRITE = 2, + DATA_READ = 3 + } + } + + /** Properties of a PolicyDelta. */ + interface IPolicyDelta { + + /** PolicyDelta bindingDeltas */ + bindingDeltas?: (google.iam.v1.IBindingDelta[]|null); + + /** PolicyDelta auditConfigDeltas */ + auditConfigDeltas?: (google.iam.v1.IAuditConfigDelta[]|null); + } + + /** Represents a PolicyDelta. */ + class PolicyDelta implements IPolicyDelta { + + /** + * Constructs a new PolicyDelta. + * @param [properties] Properties to set + */ + constructor(properties?: google.iam.v1.IPolicyDelta); + + /** PolicyDelta bindingDeltas. */ + public bindingDeltas: google.iam.v1.IBindingDelta[]; + + /** PolicyDelta auditConfigDeltas. */ + public auditConfigDeltas: google.iam.v1.IAuditConfigDelta[]; + + /** + * Creates a new PolicyDelta instance using the specified properties. + * @param [properties] Properties to set + * @returns PolicyDelta instance + */ + public static create(properties?: google.iam.v1.IPolicyDelta): google.iam.v1.PolicyDelta; + + /** + * Encodes the specified PolicyDelta message. Does not implicitly {@link google.iam.v1.PolicyDelta.verify|verify} messages. + * @param message PolicyDelta message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.iam.v1.IPolicyDelta, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified PolicyDelta message, length delimited. Does not implicitly {@link google.iam.v1.PolicyDelta.verify|verify} messages. + * @param message PolicyDelta message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.iam.v1.IPolicyDelta, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a PolicyDelta message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns PolicyDelta + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.iam.v1.PolicyDelta; + + /** + * Decodes a PolicyDelta message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns PolicyDelta + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.iam.v1.PolicyDelta; + + /** + * Verifies a PolicyDelta message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a PolicyDelta message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns PolicyDelta + */ + public static fromObject(object: { [k: string]: any }): google.iam.v1.PolicyDelta; + + /** + * Creates a plain object from a PolicyDelta message. Also converts values to other types if specified. + * @param message PolicyDelta + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.iam.v1.PolicyDelta, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this PolicyDelta to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for PolicyDelta + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a BindingDelta. */ + interface IBindingDelta { + + /** BindingDelta action */ + action?: (google.iam.v1.BindingDelta.Action|keyof typeof google.iam.v1.BindingDelta.Action|null); + + /** BindingDelta role */ + role?: (string|null); + + /** BindingDelta member */ + member?: (string|null); + + /** BindingDelta condition */ + condition?: (google.type.IExpr|null); + } + + /** Represents a BindingDelta. */ + class BindingDelta implements IBindingDelta { + + /** + * Constructs a new BindingDelta. + * @param [properties] Properties to set + */ + constructor(properties?: google.iam.v1.IBindingDelta); + + /** BindingDelta action. */ + public action: (google.iam.v1.BindingDelta.Action|keyof typeof google.iam.v1.BindingDelta.Action); + + /** BindingDelta role. */ + public role: string; + + /** BindingDelta member. */ + public member: string; + + /** BindingDelta condition. */ + public condition?: (google.type.IExpr|null); + + /** + * Creates a new BindingDelta instance using the specified properties. + * @param [properties] Properties to set + * @returns BindingDelta instance + */ + public static create(properties?: google.iam.v1.IBindingDelta): google.iam.v1.BindingDelta; + + /** + * Encodes the specified BindingDelta message. Does not implicitly {@link google.iam.v1.BindingDelta.verify|verify} messages. + * @param message BindingDelta message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.iam.v1.IBindingDelta, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified BindingDelta message, length delimited. Does not implicitly {@link google.iam.v1.BindingDelta.verify|verify} messages. + * @param message BindingDelta message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.iam.v1.IBindingDelta, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a BindingDelta message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns BindingDelta + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.iam.v1.BindingDelta; + + /** + * Decodes a BindingDelta message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns BindingDelta + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.iam.v1.BindingDelta; + + /** + * Verifies a BindingDelta message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a BindingDelta message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns BindingDelta + */ + public static fromObject(object: { [k: string]: any }): google.iam.v1.BindingDelta; + + /** + * Creates a plain object from a BindingDelta message. Also converts values to other types if specified. + * @param message BindingDelta + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.iam.v1.BindingDelta, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this BindingDelta to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for BindingDelta + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace BindingDelta { + + /** Action enum. */ + enum Action { + ACTION_UNSPECIFIED = 0, + ADD = 1, + REMOVE = 2 + } + } + + /** Properties of an AuditConfigDelta. */ + interface IAuditConfigDelta { + + /** AuditConfigDelta action */ + action?: (google.iam.v1.AuditConfigDelta.Action|keyof typeof google.iam.v1.AuditConfigDelta.Action|null); + + /** AuditConfigDelta service */ + service?: (string|null); + + /** AuditConfigDelta exemptedMember */ + exemptedMember?: (string|null); + + /** AuditConfigDelta logType */ + logType?: (string|null); + } + + /** Represents an AuditConfigDelta. */ + class AuditConfigDelta implements IAuditConfigDelta { + + /** + * Constructs a new AuditConfigDelta. + * @param [properties] Properties to set + */ + constructor(properties?: google.iam.v1.IAuditConfigDelta); + + /** AuditConfigDelta action. */ + public action: (google.iam.v1.AuditConfigDelta.Action|keyof typeof google.iam.v1.AuditConfigDelta.Action); + + /** AuditConfigDelta service. */ + public service: string; + + /** AuditConfigDelta exemptedMember. */ + public exemptedMember: string; + + /** AuditConfigDelta logType. */ + public logType: string; + + /** + * Creates a new AuditConfigDelta instance using the specified properties. + * @param [properties] Properties to set + * @returns AuditConfigDelta instance + */ + public static create(properties?: google.iam.v1.IAuditConfigDelta): google.iam.v1.AuditConfigDelta; + + /** + * Encodes the specified AuditConfigDelta message. Does not implicitly {@link google.iam.v1.AuditConfigDelta.verify|verify} messages. + * @param message AuditConfigDelta message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.iam.v1.IAuditConfigDelta, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified AuditConfigDelta message, length delimited. Does not implicitly {@link google.iam.v1.AuditConfigDelta.verify|verify} messages. + * @param message AuditConfigDelta message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.iam.v1.IAuditConfigDelta, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an AuditConfigDelta message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns AuditConfigDelta + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.iam.v1.AuditConfigDelta; + + /** + * Decodes an AuditConfigDelta message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns AuditConfigDelta + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.iam.v1.AuditConfigDelta; + + /** + * Verifies an AuditConfigDelta message. + * @param message Plain 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 AuditConfigDelta message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns AuditConfigDelta + */ + public static fromObject(object: { [k: string]: any }): google.iam.v1.AuditConfigDelta; + + /** + * Creates a plain object from an AuditConfigDelta message. Also converts values to other types if specified. + * @param message AuditConfigDelta + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.iam.v1.AuditConfigDelta, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this AuditConfigDelta to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for AuditConfigDelta + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace AuditConfigDelta { + + /** Action enum. */ + enum Action { + ACTION_UNSPECIFIED = 0, + ADD = 1, + REMOVE = 2 + } + } + } + } + + /** Namespace type. */ + namespace type { + + /** Properties of an Expr. */ + interface IExpr { + + /** Expr expression */ + expression?: (string|null); + + /** Expr title */ + title?: (string|null); + + /** Expr description */ + description?: (string|null); + + /** Expr location */ + location?: (string|null); + } + + /** Represents an Expr. */ + class Expr implements IExpr { + + /** + * Constructs a new Expr. + * @param [properties] Properties to set + */ + constructor(properties?: google.type.IExpr); + + /** Expr expression. */ + public expression: string; + + /** Expr title. */ + public title: string; + + /** Expr description. */ + public description: string; + + /** Expr location. */ + public location: string; + + /** + * Creates a new Expr instance using the specified properties. + * @param [properties] Properties to set + * @returns Expr instance + */ + public static create(properties?: google.type.IExpr): google.type.Expr; + + /** + * Encodes the specified Expr message. Does not implicitly {@link google.type.Expr.verify|verify} messages. + * @param message Expr message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.type.IExpr, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Expr message, length delimited. Does not implicitly {@link google.type.Expr.verify|verify} messages. + * @param message Expr message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.type.IExpr, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an Expr message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Expr + * @throws {Error} If the payload is not 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.Expr; + + /** + * Decodes an Expr message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Expr + * @throws {Error} If the payload 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.Expr; + + /** + * Verifies an Expr message. + * @param message Plain 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 Expr message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Expr + */ + public static fromObject(object: { [k: string]: any }): google.type.Expr; + + /** + * Creates a plain object from an Expr message. Also converts values to other types if specified. + * @param message Expr + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.type.Expr, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Expr to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Expr + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Date. */ + interface IDate { + + /** Date year */ + year?: (number|null); + + /** Date month */ + month?: (number|null); + + /** Date day */ + day?: (number|null); + } + + /** Represents a Date. */ + class Date implements IDate { + + /** + * Constructs a new Date. + * @param [properties] Properties to set + */ + constructor(properties?: google.type.IDate); + + /** Date year. */ + public year: number; + + /** Date month. */ + public month: number; + + /** Date day. */ + public day: number; + + /** + * Creates a new Date instance using the specified properties. + * @param [properties] Properties to set + * @returns Date instance + */ + public static create(properties?: google.type.IDate): google.type.Date; + + /** + * Encodes the specified Date message. Does not implicitly {@link google.type.Date.verify|verify} messages. + * @param message Date message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.type.IDate, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Date message, length delimited. Does not implicitly {@link google.type.Date.verify|verify} messages. + * @param message Date message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.type.IDate, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Date message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Date + * @throws {Error} If the payload is not 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.Date; + + /** + * Decodes a Date message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Date + * @throws {Error} If the payload 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.Date; + + /** + * Verifies a Date message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Date message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Date + */ + public static fromObject(object: { [k: string]: any }): google.type.Date; + + /** + * Creates a plain object from a Date message. Also converts values to other types if specified. + * @param message Date + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.type.Date, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Date to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Date + * @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/google-cloud-policysimulator/protos/protos.js b/packages/google-cloud-policysimulator/protos/protos.js new file mode 100644 index 00000000000..b704e51d4c0 --- /dev/null +++ b/packages/google-cloud-policysimulator/protos/protos.js @@ -0,0 +1,25906 @@ +// Copyright 2023 Google LLC +// +// Licensed under the Apache License, Version 2.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_policysimulator_protos || ($protobuf.roots._google_cloud_policysimulator_protos = {}); + + $root.google = (function() { + + /** + * Namespace google. + * @exports google + * @namespace + */ + var google = {}; + + google.cloud = (function() { + + /** + * Namespace cloud. + * @memberof google + * @namespace + */ + var cloud = {}; + + cloud.policysimulator = (function() { + + /** + * Namespace policysimulator. + * @memberof google.cloud + * @namespace + */ + var policysimulator = {}; + + policysimulator.v1 = (function() { + + /** + * Namespace v1. + * @memberof google.cloud.policysimulator + * @namespace + */ + var v1 = {}; + + /** + * AccessState enum. + * @name google.cloud.policysimulator.v1.AccessState + * @enum {number} + * @property {number} ACCESS_STATE_UNSPECIFIED=0 ACCESS_STATE_UNSPECIFIED value + * @property {number} GRANTED=1 GRANTED value + * @property {number} NOT_GRANTED=2 NOT_GRANTED value + * @property {number} UNKNOWN_CONDITIONAL=3 UNKNOWN_CONDITIONAL value + * @property {number} UNKNOWN_INFO_DENIED=4 UNKNOWN_INFO_DENIED value + */ + v1.AccessState = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "ACCESS_STATE_UNSPECIFIED"] = 0; + values[valuesById[1] = "GRANTED"] = 1; + values[valuesById[2] = "NOT_GRANTED"] = 2; + values[valuesById[3] = "UNKNOWN_CONDITIONAL"] = 3; + values[valuesById[4] = "UNKNOWN_INFO_DENIED"] = 4; + return values; + })(); + + /** + * HeuristicRelevance enum. + * @name google.cloud.policysimulator.v1.HeuristicRelevance + * @enum {number} + * @property {number} HEURISTIC_RELEVANCE_UNSPECIFIED=0 HEURISTIC_RELEVANCE_UNSPECIFIED value + * @property {number} NORMAL=1 NORMAL value + * @property {number} HIGH=2 HIGH value + */ + v1.HeuristicRelevance = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "HEURISTIC_RELEVANCE_UNSPECIFIED"] = 0; + values[valuesById[1] = "NORMAL"] = 1; + values[valuesById[2] = "HIGH"] = 2; + return values; + })(); + + v1.AccessTuple = (function() { + + /** + * Properties of an AccessTuple. + * @memberof google.cloud.policysimulator.v1 + * @interface IAccessTuple + * @property {string|null} [principal] AccessTuple principal + * @property {string|null} [fullResourceName] AccessTuple fullResourceName + * @property {string|null} [permission] AccessTuple permission + */ + + /** + * Constructs a new AccessTuple. + * @memberof google.cloud.policysimulator.v1 + * @classdesc Represents an AccessTuple. + * @implements IAccessTuple + * @constructor + * @param {google.cloud.policysimulator.v1.IAccessTuple=} [properties] Properties to set + */ + function AccessTuple(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * AccessTuple principal. + * @member {string} principal + * @memberof google.cloud.policysimulator.v1.AccessTuple + * @instance + */ + AccessTuple.prototype.principal = ""; + + /** + * AccessTuple fullResourceName. + * @member {string} fullResourceName + * @memberof google.cloud.policysimulator.v1.AccessTuple + * @instance + */ + AccessTuple.prototype.fullResourceName = ""; + + /** + * AccessTuple permission. + * @member {string} permission + * @memberof google.cloud.policysimulator.v1.AccessTuple + * @instance + */ + AccessTuple.prototype.permission = ""; + + /** + * Creates a new AccessTuple instance using the specified properties. + * @function create + * @memberof google.cloud.policysimulator.v1.AccessTuple + * @static + * @param {google.cloud.policysimulator.v1.IAccessTuple=} [properties] Properties to set + * @returns {google.cloud.policysimulator.v1.AccessTuple} AccessTuple instance + */ + AccessTuple.create = function create(properties) { + return new AccessTuple(properties); + }; + + /** + * Encodes the specified AccessTuple message. Does not implicitly {@link google.cloud.policysimulator.v1.AccessTuple.verify|verify} messages. + * @function encode + * @memberof google.cloud.policysimulator.v1.AccessTuple + * @static + * @param {google.cloud.policysimulator.v1.IAccessTuple} message AccessTuple message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AccessTuple.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.principal != null && Object.hasOwnProperty.call(message, "principal")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.principal); + if (message.fullResourceName != null && Object.hasOwnProperty.call(message, "fullResourceName")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.fullResourceName); + if (message.permission != null && Object.hasOwnProperty.call(message, "permission")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.permission); + return writer; + }; + + /** + * Encodes the specified AccessTuple message, length delimited. Does not implicitly {@link google.cloud.policysimulator.v1.AccessTuple.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.policysimulator.v1.AccessTuple + * @static + * @param {google.cloud.policysimulator.v1.IAccessTuple} message AccessTuple message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AccessTuple.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an AccessTuple message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.policysimulator.v1.AccessTuple + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.policysimulator.v1.AccessTuple} AccessTuple + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AccessTuple.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.policysimulator.v1.AccessTuple(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.principal = reader.string(); + break; + } + case 2: { + message.fullResourceName = reader.string(); + break; + } + case 3: { + message.permission = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an AccessTuple message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.policysimulator.v1.AccessTuple + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.policysimulator.v1.AccessTuple} AccessTuple + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AccessTuple.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an AccessTuple message. + * @function verify + * @memberof google.cloud.policysimulator.v1.AccessTuple + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + AccessTuple.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.principal != null && message.hasOwnProperty("principal")) + if (!$util.isString(message.principal)) + return "principal: string expected"; + if (message.fullResourceName != null && message.hasOwnProperty("fullResourceName")) + if (!$util.isString(message.fullResourceName)) + return "fullResourceName: string expected"; + if (message.permission != null && message.hasOwnProperty("permission")) + if (!$util.isString(message.permission)) + return "permission: string expected"; + return null; + }; + + /** + * Creates an AccessTuple message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.policysimulator.v1.AccessTuple + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.policysimulator.v1.AccessTuple} AccessTuple + */ + AccessTuple.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.policysimulator.v1.AccessTuple) + return object; + var message = new $root.google.cloud.policysimulator.v1.AccessTuple(); + if (object.principal != null) + message.principal = String(object.principal); + if (object.fullResourceName != null) + message.fullResourceName = String(object.fullResourceName); + if (object.permission != null) + message.permission = String(object.permission); + return message; + }; + + /** + * Creates a plain object from an AccessTuple message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.policysimulator.v1.AccessTuple + * @static + * @param {google.cloud.policysimulator.v1.AccessTuple} message AccessTuple + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + AccessTuple.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.principal = ""; + object.fullResourceName = ""; + object.permission = ""; + } + if (message.principal != null && message.hasOwnProperty("principal")) + object.principal = message.principal; + if (message.fullResourceName != null && message.hasOwnProperty("fullResourceName")) + object.fullResourceName = message.fullResourceName; + if (message.permission != null && message.hasOwnProperty("permission")) + object.permission = message.permission; + return object; + }; + + /** + * Converts this AccessTuple to JSON. + * @function toJSON + * @memberof google.cloud.policysimulator.v1.AccessTuple + * @instance + * @returns {Object.} JSON object + */ + AccessTuple.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for AccessTuple + * @function getTypeUrl + * @memberof google.cloud.policysimulator.v1.AccessTuple + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + AccessTuple.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.policysimulator.v1.AccessTuple"; + }; + + return AccessTuple; + })(); + + v1.ExplainedPolicy = (function() { + + /** + * Properties of an ExplainedPolicy. + * @memberof google.cloud.policysimulator.v1 + * @interface IExplainedPolicy + * @property {google.cloud.policysimulator.v1.AccessState|null} [access] ExplainedPolicy access + * @property {string|null} [fullResourceName] ExplainedPolicy fullResourceName + * @property {google.iam.v1.IPolicy|null} [policy] ExplainedPolicy policy + * @property {Array.|null} [bindingExplanations] ExplainedPolicy bindingExplanations + * @property {google.cloud.policysimulator.v1.HeuristicRelevance|null} [relevance] ExplainedPolicy relevance + */ + + /** + * Constructs a new ExplainedPolicy. + * @memberof google.cloud.policysimulator.v1 + * @classdesc Represents an ExplainedPolicy. + * @implements IExplainedPolicy + * @constructor + * @param {google.cloud.policysimulator.v1.IExplainedPolicy=} [properties] Properties to set + */ + function ExplainedPolicy(properties) { + this.bindingExplanations = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ExplainedPolicy access. + * @member {google.cloud.policysimulator.v1.AccessState} access + * @memberof google.cloud.policysimulator.v1.ExplainedPolicy + * @instance + */ + ExplainedPolicy.prototype.access = 0; + + /** + * ExplainedPolicy fullResourceName. + * @member {string} fullResourceName + * @memberof google.cloud.policysimulator.v1.ExplainedPolicy + * @instance + */ + ExplainedPolicy.prototype.fullResourceName = ""; + + /** + * ExplainedPolicy policy. + * @member {google.iam.v1.IPolicy|null|undefined} policy + * @memberof google.cloud.policysimulator.v1.ExplainedPolicy + * @instance + */ + ExplainedPolicy.prototype.policy = null; + + /** + * ExplainedPolicy bindingExplanations. + * @member {Array.} bindingExplanations + * @memberof google.cloud.policysimulator.v1.ExplainedPolicy + * @instance + */ + ExplainedPolicy.prototype.bindingExplanations = $util.emptyArray; + + /** + * ExplainedPolicy relevance. + * @member {google.cloud.policysimulator.v1.HeuristicRelevance} relevance + * @memberof google.cloud.policysimulator.v1.ExplainedPolicy + * @instance + */ + ExplainedPolicy.prototype.relevance = 0; + + /** + * Creates a new ExplainedPolicy instance using the specified properties. + * @function create + * @memberof google.cloud.policysimulator.v1.ExplainedPolicy + * @static + * @param {google.cloud.policysimulator.v1.IExplainedPolicy=} [properties] Properties to set + * @returns {google.cloud.policysimulator.v1.ExplainedPolicy} ExplainedPolicy instance + */ + ExplainedPolicy.create = function create(properties) { + return new ExplainedPolicy(properties); + }; + + /** + * Encodes the specified ExplainedPolicy message. Does not implicitly {@link google.cloud.policysimulator.v1.ExplainedPolicy.verify|verify} messages. + * @function encode + * @memberof google.cloud.policysimulator.v1.ExplainedPolicy + * @static + * @param {google.cloud.policysimulator.v1.IExplainedPolicy} message ExplainedPolicy message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ExplainedPolicy.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.access != null && Object.hasOwnProperty.call(message, "access")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.access); + if (message.fullResourceName != null && Object.hasOwnProperty.call(message, "fullResourceName")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.fullResourceName); + if (message.policy != null && Object.hasOwnProperty.call(message, "policy")) + $root.google.iam.v1.Policy.encode(message.policy, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.bindingExplanations != null && message.bindingExplanations.length) + for (var i = 0; i < message.bindingExplanations.length; ++i) + $root.google.cloud.policysimulator.v1.BindingExplanation.encode(message.bindingExplanations[i], writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.relevance != null && Object.hasOwnProperty.call(message, "relevance")) + writer.uint32(/* id 5, wireType 0 =*/40).int32(message.relevance); + return writer; + }; + + /** + * Encodes the specified ExplainedPolicy message, length delimited. Does not implicitly {@link google.cloud.policysimulator.v1.ExplainedPolicy.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.policysimulator.v1.ExplainedPolicy + * @static + * @param {google.cloud.policysimulator.v1.IExplainedPolicy} message ExplainedPolicy message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ExplainedPolicy.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an ExplainedPolicy message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.policysimulator.v1.ExplainedPolicy + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.policysimulator.v1.ExplainedPolicy} ExplainedPolicy + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ExplainedPolicy.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.policysimulator.v1.ExplainedPolicy(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.access = reader.int32(); + break; + } + case 2: { + message.fullResourceName = reader.string(); + break; + } + case 3: { + message.policy = $root.google.iam.v1.Policy.decode(reader, reader.uint32()); + break; + } + case 4: { + if (!(message.bindingExplanations && message.bindingExplanations.length)) + message.bindingExplanations = []; + message.bindingExplanations.push($root.google.cloud.policysimulator.v1.BindingExplanation.decode(reader, reader.uint32())); + break; + } + case 5: { + message.relevance = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an ExplainedPolicy message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.policysimulator.v1.ExplainedPolicy + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.policysimulator.v1.ExplainedPolicy} ExplainedPolicy + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ExplainedPolicy.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an ExplainedPolicy message. + * @function verify + * @memberof google.cloud.policysimulator.v1.ExplainedPolicy + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ExplainedPolicy.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.access != null && message.hasOwnProperty("access")) + switch (message.access) { + default: + return "access: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + break; + } + if (message.fullResourceName != null && message.hasOwnProperty("fullResourceName")) + if (!$util.isString(message.fullResourceName)) + return "fullResourceName: string expected"; + if (message.policy != null && message.hasOwnProperty("policy")) { + var error = $root.google.iam.v1.Policy.verify(message.policy); + if (error) + return "policy." + error; + } + if (message.bindingExplanations != null && message.hasOwnProperty("bindingExplanations")) { + if (!Array.isArray(message.bindingExplanations)) + return "bindingExplanations: array expected"; + for (var i = 0; i < message.bindingExplanations.length; ++i) { + var error = $root.google.cloud.policysimulator.v1.BindingExplanation.verify(message.bindingExplanations[i]); + if (error) + return "bindingExplanations." + error; + } + } + if (message.relevance != null && message.hasOwnProperty("relevance")) + switch (message.relevance) { + default: + return "relevance: enum value expected"; + case 0: + case 1: + case 2: + break; + } + return null; + }; + + /** + * Creates an ExplainedPolicy message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.policysimulator.v1.ExplainedPolicy + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.policysimulator.v1.ExplainedPolicy} ExplainedPolicy + */ + ExplainedPolicy.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.policysimulator.v1.ExplainedPolicy) + return object; + var message = new $root.google.cloud.policysimulator.v1.ExplainedPolicy(); + switch (object.access) { + default: + if (typeof object.access === "number") { + message.access = object.access; + break; + } + break; + case "ACCESS_STATE_UNSPECIFIED": + case 0: + message.access = 0; + break; + case "GRANTED": + case 1: + message.access = 1; + break; + case "NOT_GRANTED": + case 2: + message.access = 2; + break; + case "UNKNOWN_CONDITIONAL": + case 3: + message.access = 3; + break; + case "UNKNOWN_INFO_DENIED": + case 4: + message.access = 4; + break; + } + if (object.fullResourceName != null) + message.fullResourceName = String(object.fullResourceName); + if (object.policy != null) { + if (typeof object.policy !== "object") + throw TypeError(".google.cloud.policysimulator.v1.ExplainedPolicy.policy: object expected"); + message.policy = $root.google.iam.v1.Policy.fromObject(object.policy); + } + if (object.bindingExplanations) { + if (!Array.isArray(object.bindingExplanations)) + throw TypeError(".google.cloud.policysimulator.v1.ExplainedPolicy.bindingExplanations: array expected"); + message.bindingExplanations = []; + for (var i = 0; i < object.bindingExplanations.length; ++i) { + if (typeof object.bindingExplanations[i] !== "object") + throw TypeError(".google.cloud.policysimulator.v1.ExplainedPolicy.bindingExplanations: object expected"); + message.bindingExplanations[i] = $root.google.cloud.policysimulator.v1.BindingExplanation.fromObject(object.bindingExplanations[i]); + } + } + switch (object.relevance) { + default: + if (typeof object.relevance === "number") { + message.relevance = object.relevance; + break; + } + break; + case "HEURISTIC_RELEVANCE_UNSPECIFIED": + case 0: + message.relevance = 0; + break; + case "NORMAL": + case 1: + message.relevance = 1; + break; + case "HIGH": + case 2: + message.relevance = 2; + break; + } + return message; + }; + + /** + * Creates a plain object from an ExplainedPolicy message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.policysimulator.v1.ExplainedPolicy + * @static + * @param {google.cloud.policysimulator.v1.ExplainedPolicy} message ExplainedPolicy + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ExplainedPolicy.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.bindingExplanations = []; + if (options.defaults) { + object.access = options.enums === String ? "ACCESS_STATE_UNSPECIFIED" : 0; + object.fullResourceName = ""; + object.policy = null; + object.relevance = options.enums === String ? "HEURISTIC_RELEVANCE_UNSPECIFIED" : 0; + } + if (message.access != null && message.hasOwnProperty("access")) + object.access = options.enums === String ? $root.google.cloud.policysimulator.v1.AccessState[message.access] === undefined ? message.access : $root.google.cloud.policysimulator.v1.AccessState[message.access] : message.access; + if (message.fullResourceName != null && message.hasOwnProperty("fullResourceName")) + object.fullResourceName = message.fullResourceName; + if (message.policy != null && message.hasOwnProperty("policy")) + object.policy = $root.google.iam.v1.Policy.toObject(message.policy, options); + if (message.bindingExplanations && message.bindingExplanations.length) { + object.bindingExplanations = []; + for (var j = 0; j < message.bindingExplanations.length; ++j) + object.bindingExplanations[j] = $root.google.cloud.policysimulator.v1.BindingExplanation.toObject(message.bindingExplanations[j], options); + } + if (message.relevance != null && message.hasOwnProperty("relevance")) + object.relevance = options.enums === String ? $root.google.cloud.policysimulator.v1.HeuristicRelevance[message.relevance] === undefined ? message.relevance : $root.google.cloud.policysimulator.v1.HeuristicRelevance[message.relevance] : message.relevance; + return object; + }; + + /** + * Converts this ExplainedPolicy to JSON. + * @function toJSON + * @memberof google.cloud.policysimulator.v1.ExplainedPolicy + * @instance + * @returns {Object.} JSON object + */ + ExplainedPolicy.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ExplainedPolicy + * @function getTypeUrl + * @memberof google.cloud.policysimulator.v1.ExplainedPolicy + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ExplainedPolicy.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.policysimulator.v1.ExplainedPolicy"; + }; + + return ExplainedPolicy; + })(); + + v1.BindingExplanation = (function() { + + /** + * Properties of a BindingExplanation. + * @memberof google.cloud.policysimulator.v1 + * @interface IBindingExplanation + * @property {google.cloud.policysimulator.v1.AccessState|null} [access] BindingExplanation access + * @property {string|null} [role] BindingExplanation role + * @property {google.cloud.policysimulator.v1.BindingExplanation.RolePermission|null} [rolePermission] BindingExplanation rolePermission + * @property {google.cloud.policysimulator.v1.HeuristicRelevance|null} [rolePermissionRelevance] BindingExplanation rolePermissionRelevance + * @property {Object.|null} [memberships] BindingExplanation memberships + * @property {google.cloud.policysimulator.v1.HeuristicRelevance|null} [relevance] BindingExplanation relevance + * @property {google.type.IExpr|null} [condition] BindingExplanation condition + */ + + /** + * Constructs a new BindingExplanation. + * @memberof google.cloud.policysimulator.v1 + * @classdesc Represents a BindingExplanation. + * @implements IBindingExplanation + * @constructor + * @param {google.cloud.policysimulator.v1.IBindingExplanation=} [properties] Properties to set + */ + function BindingExplanation(properties) { + this.memberships = {}; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * BindingExplanation access. + * @member {google.cloud.policysimulator.v1.AccessState} access + * @memberof google.cloud.policysimulator.v1.BindingExplanation + * @instance + */ + BindingExplanation.prototype.access = 0; + + /** + * BindingExplanation role. + * @member {string} role + * @memberof google.cloud.policysimulator.v1.BindingExplanation + * @instance + */ + BindingExplanation.prototype.role = ""; + + /** + * BindingExplanation rolePermission. + * @member {google.cloud.policysimulator.v1.BindingExplanation.RolePermission} rolePermission + * @memberof google.cloud.policysimulator.v1.BindingExplanation + * @instance + */ + BindingExplanation.prototype.rolePermission = 0; + + /** + * BindingExplanation rolePermissionRelevance. + * @member {google.cloud.policysimulator.v1.HeuristicRelevance} rolePermissionRelevance + * @memberof google.cloud.policysimulator.v1.BindingExplanation + * @instance + */ + BindingExplanation.prototype.rolePermissionRelevance = 0; + + /** + * BindingExplanation memberships. + * @member {Object.} memberships + * @memberof google.cloud.policysimulator.v1.BindingExplanation + * @instance + */ + BindingExplanation.prototype.memberships = $util.emptyObject; + + /** + * BindingExplanation relevance. + * @member {google.cloud.policysimulator.v1.HeuristicRelevance} relevance + * @memberof google.cloud.policysimulator.v1.BindingExplanation + * @instance + */ + BindingExplanation.prototype.relevance = 0; + + /** + * BindingExplanation condition. + * @member {google.type.IExpr|null|undefined} condition + * @memberof google.cloud.policysimulator.v1.BindingExplanation + * @instance + */ + BindingExplanation.prototype.condition = null; + + /** + * Creates a new BindingExplanation instance using the specified properties. + * @function create + * @memberof google.cloud.policysimulator.v1.BindingExplanation + * @static + * @param {google.cloud.policysimulator.v1.IBindingExplanation=} [properties] Properties to set + * @returns {google.cloud.policysimulator.v1.BindingExplanation} BindingExplanation instance + */ + BindingExplanation.create = function create(properties) { + return new BindingExplanation(properties); + }; + + /** + * Encodes the specified BindingExplanation message. Does not implicitly {@link google.cloud.policysimulator.v1.BindingExplanation.verify|verify} messages. + * @function encode + * @memberof google.cloud.policysimulator.v1.BindingExplanation + * @static + * @param {google.cloud.policysimulator.v1.IBindingExplanation} message BindingExplanation message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BindingExplanation.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.access != null && Object.hasOwnProperty.call(message, "access")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.access); + if (message.role != null && Object.hasOwnProperty.call(message, "role")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.role); + if (message.rolePermission != null && Object.hasOwnProperty.call(message, "rolePermission")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.rolePermission); + if (message.rolePermissionRelevance != null && Object.hasOwnProperty.call(message, "rolePermissionRelevance")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.rolePermissionRelevance); + if (message.memberships != null && Object.hasOwnProperty.call(message, "memberships")) + for (var keys = Object.keys(message.memberships), i = 0; i < keys.length; ++i) { + writer.uint32(/* id 5, wireType 2 =*/42).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]); + $root.google.cloud.policysimulator.v1.BindingExplanation.AnnotatedMembership.encode(message.memberships[keys[i]], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim().ldelim(); + } + if (message.relevance != null && Object.hasOwnProperty.call(message, "relevance")) + writer.uint32(/* id 6, wireType 0 =*/48).int32(message.relevance); + if (message.condition != null && Object.hasOwnProperty.call(message, "condition")) + $root.google.type.Expr.encode(message.condition, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified BindingExplanation message, length delimited. Does not implicitly {@link google.cloud.policysimulator.v1.BindingExplanation.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.policysimulator.v1.BindingExplanation + * @static + * @param {google.cloud.policysimulator.v1.IBindingExplanation} message BindingExplanation message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BindingExplanation.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a BindingExplanation message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.policysimulator.v1.BindingExplanation + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.policysimulator.v1.BindingExplanation} BindingExplanation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BindingExplanation.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.policysimulator.v1.BindingExplanation(), key, value; + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.access = reader.int32(); + break; + } + case 2: { + message.role = reader.string(); + break; + } + case 3: { + message.rolePermission = reader.int32(); + break; + } + case 4: { + message.rolePermissionRelevance = reader.int32(); + break; + } + case 5: { + if (message.memberships === $util.emptyObject) + message.memberships = {}; + 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.policysimulator.v1.BindingExplanation.AnnotatedMembership.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag2 & 7); + break; + } + } + message.memberships[key] = value; + break; + } + case 6: { + message.relevance = reader.int32(); + break; + } + case 7: { + message.condition = $root.google.type.Expr.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a BindingExplanation message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.policysimulator.v1.BindingExplanation + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.policysimulator.v1.BindingExplanation} BindingExplanation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BindingExplanation.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a BindingExplanation message. + * @function verify + * @memberof google.cloud.policysimulator.v1.BindingExplanation + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + BindingExplanation.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.access != null && message.hasOwnProperty("access")) + switch (message.access) { + default: + return "access: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + break; + } + if (message.role != null && message.hasOwnProperty("role")) + if (!$util.isString(message.role)) + return "role: string expected"; + if (message.rolePermission != null && message.hasOwnProperty("rolePermission")) + switch (message.rolePermission) { + default: + return "rolePermission: enum value expected"; + case 0: + case 1: + case 2: + case 3: + break; + } + if (message.rolePermissionRelevance != null && message.hasOwnProperty("rolePermissionRelevance")) + switch (message.rolePermissionRelevance) { + default: + return "rolePermissionRelevance: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.memberships != null && message.hasOwnProperty("memberships")) { + if (!$util.isObject(message.memberships)) + return "memberships: object expected"; + var key = Object.keys(message.memberships); + for (var i = 0; i < key.length; ++i) { + var error = $root.google.cloud.policysimulator.v1.BindingExplanation.AnnotatedMembership.verify(message.memberships[key[i]]); + if (error) + return "memberships." + error; + } + } + if (message.relevance != null && message.hasOwnProperty("relevance")) + switch (message.relevance) { + default: + return "relevance: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.condition != null && message.hasOwnProperty("condition")) { + var error = $root.google.type.Expr.verify(message.condition); + if (error) + return "condition." + error; + } + return null; + }; + + /** + * Creates a BindingExplanation message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.policysimulator.v1.BindingExplanation + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.policysimulator.v1.BindingExplanation} BindingExplanation + */ + BindingExplanation.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.policysimulator.v1.BindingExplanation) + return object; + var message = new $root.google.cloud.policysimulator.v1.BindingExplanation(); + switch (object.access) { + default: + if (typeof object.access === "number") { + message.access = object.access; + break; + } + break; + case "ACCESS_STATE_UNSPECIFIED": + case 0: + message.access = 0; + break; + case "GRANTED": + case 1: + message.access = 1; + break; + case "NOT_GRANTED": + case 2: + message.access = 2; + break; + case "UNKNOWN_CONDITIONAL": + case 3: + message.access = 3; + break; + case "UNKNOWN_INFO_DENIED": + case 4: + message.access = 4; + break; + } + if (object.role != null) + message.role = String(object.role); + switch (object.rolePermission) { + default: + if (typeof object.rolePermission === "number") { + message.rolePermission = object.rolePermission; + break; + } + break; + case "ROLE_PERMISSION_UNSPECIFIED": + case 0: + message.rolePermission = 0; + break; + case "ROLE_PERMISSION_INCLUDED": + case 1: + message.rolePermission = 1; + break; + case "ROLE_PERMISSION_NOT_INCLUDED": + case 2: + message.rolePermission = 2; + break; + case "ROLE_PERMISSION_UNKNOWN_INFO_DENIED": + case 3: + message.rolePermission = 3; + break; + } + switch (object.rolePermissionRelevance) { + default: + if (typeof object.rolePermissionRelevance === "number") { + message.rolePermissionRelevance = object.rolePermissionRelevance; + break; + } + break; + case "HEURISTIC_RELEVANCE_UNSPECIFIED": + case 0: + message.rolePermissionRelevance = 0; + break; + case "NORMAL": + case 1: + message.rolePermissionRelevance = 1; + break; + case "HIGH": + case 2: + message.rolePermissionRelevance = 2; + break; + } + if (object.memberships) { + if (typeof object.memberships !== "object") + throw TypeError(".google.cloud.policysimulator.v1.BindingExplanation.memberships: object expected"); + message.memberships = {}; + for (var keys = Object.keys(object.memberships), i = 0; i < keys.length; ++i) { + if (typeof object.memberships[keys[i]] !== "object") + throw TypeError(".google.cloud.policysimulator.v1.BindingExplanation.memberships: object expected"); + message.memberships[keys[i]] = $root.google.cloud.policysimulator.v1.BindingExplanation.AnnotatedMembership.fromObject(object.memberships[keys[i]]); + } + } + switch (object.relevance) { + default: + if (typeof object.relevance === "number") { + message.relevance = object.relevance; + break; + } + break; + case "HEURISTIC_RELEVANCE_UNSPECIFIED": + case 0: + message.relevance = 0; + break; + case "NORMAL": + case 1: + message.relevance = 1; + break; + case "HIGH": + case 2: + message.relevance = 2; + break; + } + if (object.condition != null) { + if (typeof object.condition !== "object") + throw TypeError(".google.cloud.policysimulator.v1.BindingExplanation.condition: object expected"); + message.condition = $root.google.type.Expr.fromObject(object.condition); + } + return message; + }; + + /** + * Creates a plain object from a BindingExplanation message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.policysimulator.v1.BindingExplanation + * @static + * @param {google.cloud.policysimulator.v1.BindingExplanation} message BindingExplanation + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + BindingExplanation.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.objects || options.defaults) + object.memberships = {}; + if (options.defaults) { + object.access = options.enums === String ? "ACCESS_STATE_UNSPECIFIED" : 0; + object.role = ""; + object.rolePermission = options.enums === String ? "ROLE_PERMISSION_UNSPECIFIED" : 0; + object.rolePermissionRelevance = options.enums === String ? "HEURISTIC_RELEVANCE_UNSPECIFIED" : 0; + object.relevance = options.enums === String ? "HEURISTIC_RELEVANCE_UNSPECIFIED" : 0; + object.condition = null; + } + if (message.access != null && message.hasOwnProperty("access")) + object.access = options.enums === String ? $root.google.cloud.policysimulator.v1.AccessState[message.access] === undefined ? message.access : $root.google.cloud.policysimulator.v1.AccessState[message.access] : message.access; + if (message.role != null && message.hasOwnProperty("role")) + object.role = message.role; + if (message.rolePermission != null && message.hasOwnProperty("rolePermission")) + object.rolePermission = options.enums === String ? $root.google.cloud.policysimulator.v1.BindingExplanation.RolePermission[message.rolePermission] === undefined ? message.rolePermission : $root.google.cloud.policysimulator.v1.BindingExplanation.RolePermission[message.rolePermission] : message.rolePermission; + if (message.rolePermissionRelevance != null && message.hasOwnProperty("rolePermissionRelevance")) + object.rolePermissionRelevance = options.enums === String ? $root.google.cloud.policysimulator.v1.HeuristicRelevance[message.rolePermissionRelevance] === undefined ? message.rolePermissionRelevance : $root.google.cloud.policysimulator.v1.HeuristicRelevance[message.rolePermissionRelevance] : message.rolePermissionRelevance; + var keys2; + if (message.memberships && (keys2 = Object.keys(message.memberships)).length) { + object.memberships = {}; + for (var j = 0; j < keys2.length; ++j) + object.memberships[keys2[j]] = $root.google.cloud.policysimulator.v1.BindingExplanation.AnnotatedMembership.toObject(message.memberships[keys2[j]], options); + } + if (message.relevance != null && message.hasOwnProperty("relevance")) + object.relevance = options.enums === String ? $root.google.cloud.policysimulator.v1.HeuristicRelevance[message.relevance] === undefined ? message.relevance : $root.google.cloud.policysimulator.v1.HeuristicRelevance[message.relevance] : message.relevance; + if (message.condition != null && message.hasOwnProperty("condition")) + object.condition = $root.google.type.Expr.toObject(message.condition, options); + return object; + }; + + /** + * Converts this BindingExplanation to JSON. + * @function toJSON + * @memberof google.cloud.policysimulator.v1.BindingExplanation + * @instance + * @returns {Object.} JSON object + */ + BindingExplanation.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for BindingExplanation + * @function getTypeUrl + * @memberof google.cloud.policysimulator.v1.BindingExplanation + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + BindingExplanation.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.policysimulator.v1.BindingExplanation"; + }; + + BindingExplanation.AnnotatedMembership = (function() { + + /** + * Properties of an AnnotatedMembership. + * @memberof google.cloud.policysimulator.v1.BindingExplanation + * @interface IAnnotatedMembership + * @property {google.cloud.policysimulator.v1.BindingExplanation.Membership|null} [membership] AnnotatedMembership membership + * @property {google.cloud.policysimulator.v1.HeuristicRelevance|null} [relevance] AnnotatedMembership relevance + */ + + /** + * Constructs a new AnnotatedMembership. + * @memberof google.cloud.policysimulator.v1.BindingExplanation + * @classdesc Represents an AnnotatedMembership. + * @implements IAnnotatedMembership + * @constructor + * @param {google.cloud.policysimulator.v1.BindingExplanation.IAnnotatedMembership=} [properties] Properties to set + */ + function AnnotatedMembership(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * AnnotatedMembership membership. + * @member {google.cloud.policysimulator.v1.BindingExplanation.Membership} membership + * @memberof google.cloud.policysimulator.v1.BindingExplanation.AnnotatedMembership + * @instance + */ + AnnotatedMembership.prototype.membership = 0; + + /** + * AnnotatedMembership relevance. + * @member {google.cloud.policysimulator.v1.HeuristicRelevance} relevance + * @memberof google.cloud.policysimulator.v1.BindingExplanation.AnnotatedMembership + * @instance + */ + AnnotatedMembership.prototype.relevance = 0; + + /** + * Creates a new AnnotatedMembership instance using the specified properties. + * @function create + * @memberof google.cloud.policysimulator.v1.BindingExplanation.AnnotatedMembership + * @static + * @param {google.cloud.policysimulator.v1.BindingExplanation.IAnnotatedMembership=} [properties] Properties to set + * @returns {google.cloud.policysimulator.v1.BindingExplanation.AnnotatedMembership} AnnotatedMembership instance + */ + AnnotatedMembership.create = function create(properties) { + return new AnnotatedMembership(properties); + }; + + /** + * Encodes the specified AnnotatedMembership message. Does not implicitly {@link google.cloud.policysimulator.v1.BindingExplanation.AnnotatedMembership.verify|verify} messages. + * @function encode + * @memberof google.cloud.policysimulator.v1.BindingExplanation.AnnotatedMembership + * @static + * @param {google.cloud.policysimulator.v1.BindingExplanation.IAnnotatedMembership} message AnnotatedMembership message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AnnotatedMembership.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.membership != null && Object.hasOwnProperty.call(message, "membership")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.membership); + if (message.relevance != null && Object.hasOwnProperty.call(message, "relevance")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.relevance); + return writer; + }; + + /** + * Encodes the specified AnnotatedMembership message, length delimited. Does not implicitly {@link google.cloud.policysimulator.v1.BindingExplanation.AnnotatedMembership.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.policysimulator.v1.BindingExplanation.AnnotatedMembership + * @static + * @param {google.cloud.policysimulator.v1.BindingExplanation.IAnnotatedMembership} message AnnotatedMembership message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AnnotatedMembership.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an AnnotatedMembership message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.policysimulator.v1.BindingExplanation.AnnotatedMembership + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.policysimulator.v1.BindingExplanation.AnnotatedMembership} AnnotatedMembership + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AnnotatedMembership.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.policysimulator.v1.BindingExplanation.AnnotatedMembership(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.membership = reader.int32(); + break; + } + case 2: { + message.relevance = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an AnnotatedMembership message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.policysimulator.v1.BindingExplanation.AnnotatedMembership + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.policysimulator.v1.BindingExplanation.AnnotatedMembership} AnnotatedMembership + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AnnotatedMembership.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an AnnotatedMembership message. + * @function verify + * @memberof google.cloud.policysimulator.v1.BindingExplanation.AnnotatedMembership + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + AnnotatedMembership.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.membership != null && message.hasOwnProperty("membership")) + switch (message.membership) { + default: + return "membership: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + break; + } + if (message.relevance != null && message.hasOwnProperty("relevance")) + switch (message.relevance) { + default: + return "relevance: enum value expected"; + case 0: + case 1: + case 2: + break; + } + return null; + }; + + /** + * Creates an AnnotatedMembership message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.policysimulator.v1.BindingExplanation.AnnotatedMembership + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.policysimulator.v1.BindingExplanation.AnnotatedMembership} AnnotatedMembership + */ + AnnotatedMembership.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.policysimulator.v1.BindingExplanation.AnnotatedMembership) + return object; + var message = new $root.google.cloud.policysimulator.v1.BindingExplanation.AnnotatedMembership(); + switch (object.membership) { + default: + if (typeof object.membership === "number") { + message.membership = object.membership; + break; + } + break; + case "MEMBERSHIP_UNSPECIFIED": + case 0: + message.membership = 0; + break; + case "MEMBERSHIP_INCLUDED": + case 1: + message.membership = 1; + break; + case "MEMBERSHIP_NOT_INCLUDED": + case 2: + message.membership = 2; + break; + case "MEMBERSHIP_UNKNOWN_INFO_DENIED": + case 3: + message.membership = 3; + break; + case "MEMBERSHIP_UNKNOWN_UNSUPPORTED": + case 4: + message.membership = 4; + break; + } + switch (object.relevance) { + default: + if (typeof object.relevance === "number") { + message.relevance = object.relevance; + break; + } + break; + case "HEURISTIC_RELEVANCE_UNSPECIFIED": + case 0: + message.relevance = 0; + break; + case "NORMAL": + case 1: + message.relevance = 1; + break; + case "HIGH": + case 2: + message.relevance = 2; + break; + } + return message; + }; + + /** + * Creates a plain object from an AnnotatedMembership message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.policysimulator.v1.BindingExplanation.AnnotatedMembership + * @static + * @param {google.cloud.policysimulator.v1.BindingExplanation.AnnotatedMembership} message AnnotatedMembership + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + AnnotatedMembership.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.membership = options.enums === String ? "MEMBERSHIP_UNSPECIFIED" : 0; + object.relevance = options.enums === String ? "HEURISTIC_RELEVANCE_UNSPECIFIED" : 0; + } + if (message.membership != null && message.hasOwnProperty("membership")) + object.membership = options.enums === String ? $root.google.cloud.policysimulator.v1.BindingExplanation.Membership[message.membership] === undefined ? message.membership : $root.google.cloud.policysimulator.v1.BindingExplanation.Membership[message.membership] : message.membership; + if (message.relevance != null && message.hasOwnProperty("relevance")) + object.relevance = options.enums === String ? $root.google.cloud.policysimulator.v1.HeuristicRelevance[message.relevance] === undefined ? message.relevance : $root.google.cloud.policysimulator.v1.HeuristicRelevance[message.relevance] : message.relevance; + return object; + }; + + /** + * Converts this AnnotatedMembership to JSON. + * @function toJSON + * @memberof google.cloud.policysimulator.v1.BindingExplanation.AnnotatedMembership + * @instance + * @returns {Object.} JSON object + */ + AnnotatedMembership.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for AnnotatedMembership + * @function getTypeUrl + * @memberof google.cloud.policysimulator.v1.BindingExplanation.AnnotatedMembership + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + AnnotatedMembership.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.policysimulator.v1.BindingExplanation.AnnotatedMembership"; + }; + + return AnnotatedMembership; + })(); + + /** + * RolePermission enum. + * @name google.cloud.policysimulator.v1.BindingExplanation.RolePermission + * @enum {number} + * @property {number} ROLE_PERMISSION_UNSPECIFIED=0 ROLE_PERMISSION_UNSPECIFIED value + * @property {number} ROLE_PERMISSION_INCLUDED=1 ROLE_PERMISSION_INCLUDED value + * @property {number} ROLE_PERMISSION_NOT_INCLUDED=2 ROLE_PERMISSION_NOT_INCLUDED value + * @property {number} ROLE_PERMISSION_UNKNOWN_INFO_DENIED=3 ROLE_PERMISSION_UNKNOWN_INFO_DENIED value + */ + BindingExplanation.RolePermission = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "ROLE_PERMISSION_UNSPECIFIED"] = 0; + values[valuesById[1] = "ROLE_PERMISSION_INCLUDED"] = 1; + values[valuesById[2] = "ROLE_PERMISSION_NOT_INCLUDED"] = 2; + values[valuesById[3] = "ROLE_PERMISSION_UNKNOWN_INFO_DENIED"] = 3; + return values; + })(); + + /** + * Membership enum. + * @name google.cloud.policysimulator.v1.BindingExplanation.Membership + * @enum {number} + * @property {number} MEMBERSHIP_UNSPECIFIED=0 MEMBERSHIP_UNSPECIFIED value + * @property {number} MEMBERSHIP_INCLUDED=1 MEMBERSHIP_INCLUDED value + * @property {number} MEMBERSHIP_NOT_INCLUDED=2 MEMBERSHIP_NOT_INCLUDED value + * @property {number} MEMBERSHIP_UNKNOWN_INFO_DENIED=3 MEMBERSHIP_UNKNOWN_INFO_DENIED value + * @property {number} MEMBERSHIP_UNKNOWN_UNSUPPORTED=4 MEMBERSHIP_UNKNOWN_UNSUPPORTED value + */ + BindingExplanation.Membership = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "MEMBERSHIP_UNSPECIFIED"] = 0; + values[valuesById[1] = "MEMBERSHIP_INCLUDED"] = 1; + values[valuesById[2] = "MEMBERSHIP_NOT_INCLUDED"] = 2; + values[valuesById[3] = "MEMBERSHIP_UNKNOWN_INFO_DENIED"] = 3; + values[valuesById[4] = "MEMBERSHIP_UNKNOWN_UNSUPPORTED"] = 4; + return values; + })(); + + return BindingExplanation; + })(); + + v1.Simulator = (function() { + + /** + * Constructs a new Simulator service. + * @memberof google.cloud.policysimulator.v1 + * @classdesc Represents a Simulator + * @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 Simulator(rpcImpl, requestDelimited, responseDelimited) { + $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); + } + + (Simulator.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = Simulator; + + /** + * Creates new Simulator service using the specified rpc implementation. + * @function create + * @memberof google.cloud.policysimulator.v1.Simulator + * @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 {Simulator} RPC service. Useful where requests and/or responses are streamed. + */ + Simulator.create = function create(rpcImpl, requestDelimited, responseDelimited) { + return new this(rpcImpl, requestDelimited, responseDelimited); + }; + + /** + * Callback as used by {@link google.cloud.policysimulator.v1.Simulator|getReplay}. + * @memberof google.cloud.policysimulator.v1.Simulator + * @typedef GetReplayCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.policysimulator.v1.Replay} [response] Replay + */ + + /** + * Calls GetReplay. + * @function getReplay + * @memberof google.cloud.policysimulator.v1.Simulator + * @instance + * @param {google.cloud.policysimulator.v1.IGetReplayRequest} request GetReplayRequest message or plain object + * @param {google.cloud.policysimulator.v1.Simulator.GetReplayCallback} callback Node-style callback called with the error, if any, and Replay + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Simulator.prototype.getReplay = function getReplay(request, callback) { + return this.rpcCall(getReplay, $root.google.cloud.policysimulator.v1.GetReplayRequest, $root.google.cloud.policysimulator.v1.Replay, request, callback); + }, "name", { value: "GetReplay" }); + + /** + * Calls GetReplay. + * @function getReplay + * @memberof google.cloud.policysimulator.v1.Simulator + * @instance + * @param {google.cloud.policysimulator.v1.IGetReplayRequest} request GetReplayRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.policysimulator.v1.Simulator|createReplay}. + * @memberof google.cloud.policysimulator.v1.Simulator + * @typedef CreateReplayCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls CreateReplay. + * @function createReplay + * @memberof google.cloud.policysimulator.v1.Simulator + * @instance + * @param {google.cloud.policysimulator.v1.ICreateReplayRequest} request CreateReplayRequest message or plain object + * @param {google.cloud.policysimulator.v1.Simulator.CreateReplayCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Simulator.prototype.createReplay = function createReplay(request, callback) { + return this.rpcCall(createReplay, $root.google.cloud.policysimulator.v1.CreateReplayRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "CreateReplay" }); + + /** + * Calls CreateReplay. + * @function createReplay + * @memberof google.cloud.policysimulator.v1.Simulator + * @instance + * @param {google.cloud.policysimulator.v1.ICreateReplayRequest} request CreateReplayRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.policysimulator.v1.Simulator|listReplayResults}. + * @memberof google.cloud.policysimulator.v1.Simulator + * @typedef ListReplayResultsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.policysimulator.v1.ListReplayResultsResponse} [response] ListReplayResultsResponse + */ + + /** + * Calls ListReplayResults. + * @function listReplayResults + * @memberof google.cloud.policysimulator.v1.Simulator + * @instance + * @param {google.cloud.policysimulator.v1.IListReplayResultsRequest} request ListReplayResultsRequest message or plain object + * @param {google.cloud.policysimulator.v1.Simulator.ListReplayResultsCallback} callback Node-style callback called with the error, if any, and ListReplayResultsResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Simulator.prototype.listReplayResults = function listReplayResults(request, callback) { + return this.rpcCall(listReplayResults, $root.google.cloud.policysimulator.v1.ListReplayResultsRequest, $root.google.cloud.policysimulator.v1.ListReplayResultsResponse, request, callback); + }, "name", { value: "ListReplayResults" }); + + /** + * Calls ListReplayResults. + * @function listReplayResults + * @memberof google.cloud.policysimulator.v1.Simulator + * @instance + * @param {google.cloud.policysimulator.v1.IListReplayResultsRequest} request ListReplayResultsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + return Simulator; + })(); + + v1.Replay = (function() { + + /** + * Properties of a Replay. + * @memberof google.cloud.policysimulator.v1 + * @interface IReplay + * @property {string|null} [name] Replay name + * @property {google.cloud.policysimulator.v1.Replay.State|null} [state] Replay state + * @property {google.cloud.policysimulator.v1.IReplayConfig|null} [config] Replay config + * @property {google.cloud.policysimulator.v1.Replay.IResultsSummary|null} [resultsSummary] Replay resultsSummary + */ + + /** + * Constructs a new Replay. + * @memberof google.cloud.policysimulator.v1 + * @classdesc Represents a Replay. + * @implements IReplay + * @constructor + * @param {google.cloud.policysimulator.v1.IReplay=} [properties] Properties to set + */ + function Replay(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Replay name. + * @member {string} name + * @memberof google.cloud.policysimulator.v1.Replay + * @instance + */ + Replay.prototype.name = ""; + + /** + * Replay state. + * @member {google.cloud.policysimulator.v1.Replay.State} state + * @memberof google.cloud.policysimulator.v1.Replay + * @instance + */ + Replay.prototype.state = 0; + + /** + * Replay config. + * @member {google.cloud.policysimulator.v1.IReplayConfig|null|undefined} config + * @memberof google.cloud.policysimulator.v1.Replay + * @instance + */ + Replay.prototype.config = null; + + /** + * Replay resultsSummary. + * @member {google.cloud.policysimulator.v1.Replay.IResultsSummary|null|undefined} resultsSummary + * @memberof google.cloud.policysimulator.v1.Replay + * @instance + */ + Replay.prototype.resultsSummary = null; + + /** + * Creates a new Replay instance using the specified properties. + * @function create + * @memberof google.cloud.policysimulator.v1.Replay + * @static + * @param {google.cloud.policysimulator.v1.IReplay=} [properties] Properties to set + * @returns {google.cloud.policysimulator.v1.Replay} Replay instance + */ + Replay.create = function create(properties) { + return new Replay(properties); + }; + + /** + * Encodes the specified Replay message. Does not implicitly {@link google.cloud.policysimulator.v1.Replay.verify|verify} messages. + * @function encode + * @memberof google.cloud.policysimulator.v1.Replay + * @static + * @param {google.cloud.policysimulator.v1.IReplay} message Replay message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Replay.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.state != null && Object.hasOwnProperty.call(message, "state")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.state); + if (message.config != null && Object.hasOwnProperty.call(message, "config")) + $root.google.cloud.policysimulator.v1.ReplayConfig.encode(message.config, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.resultsSummary != null && Object.hasOwnProperty.call(message, "resultsSummary")) + $root.google.cloud.policysimulator.v1.Replay.ResultsSummary.encode(message.resultsSummary, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified Replay message, length delimited. Does not implicitly {@link google.cloud.policysimulator.v1.Replay.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.policysimulator.v1.Replay + * @static + * @param {google.cloud.policysimulator.v1.IReplay} message Replay message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Replay.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Replay message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.policysimulator.v1.Replay + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.policysimulator.v1.Replay} Replay + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Replay.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.policysimulator.v1.Replay(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.state = reader.int32(); + break; + } + case 3: { + message.config = $root.google.cloud.policysimulator.v1.ReplayConfig.decode(reader, reader.uint32()); + break; + } + case 5: { + message.resultsSummary = $root.google.cloud.policysimulator.v1.Replay.ResultsSummary.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Replay message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.policysimulator.v1.Replay + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.policysimulator.v1.Replay} Replay + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Replay.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Replay message. + * @function verify + * @memberof google.cloud.policysimulator.v1.Replay + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Replay.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.state != null && message.hasOwnProperty("state")) + switch (message.state) { + default: + return "state: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + break; + } + if (message.config != null && message.hasOwnProperty("config")) { + var error = $root.google.cloud.policysimulator.v1.ReplayConfig.verify(message.config); + if (error) + return "config." + error; + } + if (message.resultsSummary != null && message.hasOwnProperty("resultsSummary")) { + var error = $root.google.cloud.policysimulator.v1.Replay.ResultsSummary.verify(message.resultsSummary); + if (error) + return "resultsSummary." + error; + } + return null; + }; + + /** + * Creates a Replay message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.policysimulator.v1.Replay + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.policysimulator.v1.Replay} Replay + */ + Replay.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.policysimulator.v1.Replay) + return object; + var message = new $root.google.cloud.policysimulator.v1.Replay(); + if (object.name != null) + message.name = String(object.name); + 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 "PENDING": + case 1: + message.state = 1; + break; + case "RUNNING": + case 2: + message.state = 2; + break; + case "SUCCEEDED": + case 3: + message.state = 3; + break; + case "FAILED": + case 4: + message.state = 4; + break; + } + if (object.config != null) { + if (typeof object.config !== "object") + throw TypeError(".google.cloud.policysimulator.v1.Replay.config: object expected"); + message.config = $root.google.cloud.policysimulator.v1.ReplayConfig.fromObject(object.config); + } + if (object.resultsSummary != null) { + if (typeof object.resultsSummary !== "object") + throw TypeError(".google.cloud.policysimulator.v1.Replay.resultsSummary: object expected"); + message.resultsSummary = $root.google.cloud.policysimulator.v1.Replay.ResultsSummary.fromObject(object.resultsSummary); + } + return message; + }; + + /** + * Creates a plain object from a Replay message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.policysimulator.v1.Replay + * @static + * @param {google.cloud.policysimulator.v1.Replay} message Replay + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Replay.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.state = options.enums === String ? "STATE_UNSPECIFIED" : 0; + object.config = null; + object.resultsSummary = null; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.state != null && message.hasOwnProperty("state")) + object.state = options.enums === String ? $root.google.cloud.policysimulator.v1.Replay.State[message.state] === undefined ? message.state : $root.google.cloud.policysimulator.v1.Replay.State[message.state] : message.state; + if (message.config != null && message.hasOwnProperty("config")) + object.config = $root.google.cloud.policysimulator.v1.ReplayConfig.toObject(message.config, options); + if (message.resultsSummary != null && message.hasOwnProperty("resultsSummary")) + object.resultsSummary = $root.google.cloud.policysimulator.v1.Replay.ResultsSummary.toObject(message.resultsSummary, options); + return object; + }; + + /** + * Converts this Replay to JSON. + * @function toJSON + * @memberof google.cloud.policysimulator.v1.Replay + * @instance + * @returns {Object.} JSON object + */ + Replay.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Replay + * @function getTypeUrl + * @memberof google.cloud.policysimulator.v1.Replay + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Replay.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.policysimulator.v1.Replay"; + }; + + Replay.ResultsSummary = (function() { + + /** + * Properties of a ResultsSummary. + * @memberof google.cloud.policysimulator.v1.Replay + * @interface IResultsSummary + * @property {number|null} [logCount] ResultsSummary logCount + * @property {number|null} [unchangedCount] ResultsSummary unchangedCount + * @property {number|null} [differenceCount] ResultsSummary differenceCount + * @property {number|null} [errorCount] ResultsSummary errorCount + * @property {google.type.IDate|null} [oldestDate] ResultsSummary oldestDate + * @property {google.type.IDate|null} [newestDate] ResultsSummary newestDate + */ + + /** + * Constructs a new ResultsSummary. + * @memberof google.cloud.policysimulator.v1.Replay + * @classdesc Represents a ResultsSummary. + * @implements IResultsSummary + * @constructor + * @param {google.cloud.policysimulator.v1.Replay.IResultsSummary=} [properties] Properties to set + */ + function ResultsSummary(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ResultsSummary logCount. + * @member {number} logCount + * @memberof google.cloud.policysimulator.v1.Replay.ResultsSummary + * @instance + */ + ResultsSummary.prototype.logCount = 0; + + /** + * ResultsSummary unchangedCount. + * @member {number} unchangedCount + * @memberof google.cloud.policysimulator.v1.Replay.ResultsSummary + * @instance + */ + ResultsSummary.prototype.unchangedCount = 0; + + /** + * ResultsSummary differenceCount. + * @member {number} differenceCount + * @memberof google.cloud.policysimulator.v1.Replay.ResultsSummary + * @instance + */ + ResultsSummary.prototype.differenceCount = 0; + + /** + * ResultsSummary errorCount. + * @member {number} errorCount + * @memberof google.cloud.policysimulator.v1.Replay.ResultsSummary + * @instance + */ + ResultsSummary.prototype.errorCount = 0; + + /** + * ResultsSummary oldestDate. + * @member {google.type.IDate|null|undefined} oldestDate + * @memberof google.cloud.policysimulator.v1.Replay.ResultsSummary + * @instance + */ + ResultsSummary.prototype.oldestDate = null; + + /** + * ResultsSummary newestDate. + * @member {google.type.IDate|null|undefined} newestDate + * @memberof google.cloud.policysimulator.v1.Replay.ResultsSummary + * @instance + */ + ResultsSummary.prototype.newestDate = null; + + /** + * Creates a new ResultsSummary instance using the specified properties. + * @function create + * @memberof google.cloud.policysimulator.v1.Replay.ResultsSummary + * @static + * @param {google.cloud.policysimulator.v1.Replay.IResultsSummary=} [properties] Properties to set + * @returns {google.cloud.policysimulator.v1.Replay.ResultsSummary} ResultsSummary instance + */ + ResultsSummary.create = function create(properties) { + return new ResultsSummary(properties); + }; + + /** + * Encodes the specified ResultsSummary message. Does not implicitly {@link google.cloud.policysimulator.v1.Replay.ResultsSummary.verify|verify} messages. + * @function encode + * @memberof google.cloud.policysimulator.v1.Replay.ResultsSummary + * @static + * @param {google.cloud.policysimulator.v1.Replay.IResultsSummary} message ResultsSummary message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ResultsSummary.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.logCount != null && Object.hasOwnProperty.call(message, "logCount")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.logCount); + if (message.unchangedCount != null && Object.hasOwnProperty.call(message, "unchangedCount")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.unchangedCount); + if (message.differenceCount != null && Object.hasOwnProperty.call(message, "differenceCount")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.differenceCount); + if (message.errorCount != null && Object.hasOwnProperty.call(message, "errorCount")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.errorCount); + if (message.oldestDate != null && Object.hasOwnProperty.call(message, "oldestDate")) + $root.google.type.Date.encode(message.oldestDate, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.newestDate != null && Object.hasOwnProperty.call(message, "newestDate")) + $root.google.type.Date.encode(message.newestDate, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified ResultsSummary message, length delimited. Does not implicitly {@link google.cloud.policysimulator.v1.Replay.ResultsSummary.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.policysimulator.v1.Replay.ResultsSummary + * @static + * @param {google.cloud.policysimulator.v1.Replay.IResultsSummary} message ResultsSummary message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ResultsSummary.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ResultsSummary message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.policysimulator.v1.Replay.ResultsSummary + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.policysimulator.v1.Replay.ResultsSummary} ResultsSummary + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ResultsSummary.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.policysimulator.v1.Replay.ResultsSummary(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.logCount = reader.int32(); + break; + } + case 2: { + message.unchangedCount = reader.int32(); + break; + } + case 3: { + message.differenceCount = reader.int32(); + break; + } + case 4: { + message.errorCount = reader.int32(); + break; + } + case 5: { + message.oldestDate = $root.google.type.Date.decode(reader, reader.uint32()); + break; + } + case 6: { + message.newestDate = $root.google.type.Date.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ResultsSummary message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.policysimulator.v1.Replay.ResultsSummary + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.policysimulator.v1.Replay.ResultsSummary} ResultsSummary + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ResultsSummary.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ResultsSummary message. + * @function verify + * @memberof google.cloud.policysimulator.v1.Replay.ResultsSummary + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ResultsSummary.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.logCount != null && message.hasOwnProperty("logCount")) + if (!$util.isInteger(message.logCount)) + return "logCount: integer expected"; + if (message.unchangedCount != null && message.hasOwnProperty("unchangedCount")) + if (!$util.isInteger(message.unchangedCount)) + return "unchangedCount: integer expected"; + if (message.differenceCount != null && message.hasOwnProperty("differenceCount")) + if (!$util.isInteger(message.differenceCount)) + return "differenceCount: integer expected"; + if (message.errorCount != null && message.hasOwnProperty("errorCount")) + if (!$util.isInteger(message.errorCount)) + return "errorCount: integer expected"; + if (message.oldestDate != null && message.hasOwnProperty("oldestDate")) { + var error = $root.google.type.Date.verify(message.oldestDate); + if (error) + return "oldestDate." + error; + } + if (message.newestDate != null && message.hasOwnProperty("newestDate")) { + var error = $root.google.type.Date.verify(message.newestDate); + if (error) + return "newestDate." + error; + } + return null; + }; + + /** + * Creates a ResultsSummary message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.policysimulator.v1.Replay.ResultsSummary + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.policysimulator.v1.Replay.ResultsSummary} ResultsSummary + */ + ResultsSummary.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.policysimulator.v1.Replay.ResultsSummary) + return object; + var message = new $root.google.cloud.policysimulator.v1.Replay.ResultsSummary(); + if (object.logCount != null) + message.logCount = object.logCount | 0; + if (object.unchangedCount != null) + message.unchangedCount = object.unchangedCount | 0; + if (object.differenceCount != null) + message.differenceCount = object.differenceCount | 0; + if (object.errorCount != null) + message.errorCount = object.errorCount | 0; + if (object.oldestDate != null) { + if (typeof object.oldestDate !== "object") + throw TypeError(".google.cloud.policysimulator.v1.Replay.ResultsSummary.oldestDate: object expected"); + message.oldestDate = $root.google.type.Date.fromObject(object.oldestDate); + } + if (object.newestDate != null) { + if (typeof object.newestDate !== "object") + throw TypeError(".google.cloud.policysimulator.v1.Replay.ResultsSummary.newestDate: object expected"); + message.newestDate = $root.google.type.Date.fromObject(object.newestDate); + } + return message; + }; + + /** + * Creates a plain object from a ResultsSummary message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.policysimulator.v1.Replay.ResultsSummary + * @static + * @param {google.cloud.policysimulator.v1.Replay.ResultsSummary} message ResultsSummary + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ResultsSummary.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.logCount = 0; + object.unchangedCount = 0; + object.differenceCount = 0; + object.errorCount = 0; + object.oldestDate = null; + object.newestDate = null; + } + if (message.logCount != null && message.hasOwnProperty("logCount")) + object.logCount = message.logCount; + if (message.unchangedCount != null && message.hasOwnProperty("unchangedCount")) + object.unchangedCount = message.unchangedCount; + if (message.differenceCount != null && message.hasOwnProperty("differenceCount")) + object.differenceCount = message.differenceCount; + if (message.errorCount != null && message.hasOwnProperty("errorCount")) + object.errorCount = message.errorCount; + if (message.oldestDate != null && message.hasOwnProperty("oldestDate")) + object.oldestDate = $root.google.type.Date.toObject(message.oldestDate, options); + if (message.newestDate != null && message.hasOwnProperty("newestDate")) + object.newestDate = $root.google.type.Date.toObject(message.newestDate, options); + return object; + }; + + /** + * Converts this ResultsSummary to JSON. + * @function toJSON + * @memberof google.cloud.policysimulator.v1.Replay.ResultsSummary + * @instance + * @returns {Object.} JSON object + */ + ResultsSummary.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ResultsSummary + * @function getTypeUrl + * @memberof google.cloud.policysimulator.v1.Replay.ResultsSummary + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ResultsSummary.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.policysimulator.v1.Replay.ResultsSummary"; + }; + + return ResultsSummary; + })(); + + /** + * State enum. + * @name google.cloud.policysimulator.v1.Replay.State + * @enum {number} + * @property {number} STATE_UNSPECIFIED=0 STATE_UNSPECIFIED value + * @property {number} PENDING=1 PENDING value + * @property {number} RUNNING=2 RUNNING value + * @property {number} SUCCEEDED=3 SUCCEEDED value + * @property {number} FAILED=4 FAILED value + */ + Replay.State = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "STATE_UNSPECIFIED"] = 0; + values[valuesById[1] = "PENDING"] = 1; + values[valuesById[2] = "RUNNING"] = 2; + values[valuesById[3] = "SUCCEEDED"] = 3; + values[valuesById[4] = "FAILED"] = 4; + return values; + })(); + + return Replay; + })(); + + v1.ReplayResult = (function() { + + /** + * Properties of a ReplayResult. + * @memberof google.cloud.policysimulator.v1 + * @interface IReplayResult + * @property {google.cloud.policysimulator.v1.IReplayDiff|null} [diff] ReplayResult diff + * @property {google.rpc.IStatus|null} [error] ReplayResult error + * @property {string|null} [name] ReplayResult name + * @property {string|null} [parent] ReplayResult parent + * @property {google.cloud.policysimulator.v1.IAccessTuple|null} [accessTuple] ReplayResult accessTuple + * @property {google.type.IDate|null} [lastSeenDate] ReplayResult lastSeenDate + */ + + /** + * Constructs a new ReplayResult. + * @memberof google.cloud.policysimulator.v1 + * @classdesc Represents a ReplayResult. + * @implements IReplayResult + * @constructor + * @param {google.cloud.policysimulator.v1.IReplayResult=} [properties] Properties to set + */ + function ReplayResult(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ReplayResult diff. + * @member {google.cloud.policysimulator.v1.IReplayDiff|null|undefined} diff + * @memberof google.cloud.policysimulator.v1.ReplayResult + * @instance + */ + ReplayResult.prototype.diff = null; + + /** + * ReplayResult error. + * @member {google.rpc.IStatus|null|undefined} error + * @memberof google.cloud.policysimulator.v1.ReplayResult + * @instance + */ + ReplayResult.prototype.error = null; + + /** + * ReplayResult name. + * @member {string} name + * @memberof google.cloud.policysimulator.v1.ReplayResult + * @instance + */ + ReplayResult.prototype.name = ""; + + /** + * ReplayResult parent. + * @member {string} parent + * @memberof google.cloud.policysimulator.v1.ReplayResult + * @instance + */ + ReplayResult.prototype.parent = ""; + + /** + * ReplayResult accessTuple. + * @member {google.cloud.policysimulator.v1.IAccessTuple|null|undefined} accessTuple + * @memberof google.cloud.policysimulator.v1.ReplayResult + * @instance + */ + ReplayResult.prototype.accessTuple = null; + + /** + * ReplayResult lastSeenDate. + * @member {google.type.IDate|null|undefined} lastSeenDate + * @memberof google.cloud.policysimulator.v1.ReplayResult + * @instance + */ + ReplayResult.prototype.lastSeenDate = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * ReplayResult result. + * @member {"diff"|"error"|undefined} result + * @memberof google.cloud.policysimulator.v1.ReplayResult + * @instance + */ + Object.defineProperty(ReplayResult.prototype, "result", { + get: $util.oneOfGetter($oneOfFields = ["diff", "error"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new ReplayResult instance using the specified properties. + * @function create + * @memberof google.cloud.policysimulator.v1.ReplayResult + * @static + * @param {google.cloud.policysimulator.v1.IReplayResult=} [properties] Properties to set + * @returns {google.cloud.policysimulator.v1.ReplayResult} ReplayResult instance + */ + ReplayResult.create = function create(properties) { + return new ReplayResult(properties); + }; + + /** + * Encodes the specified ReplayResult message. Does not implicitly {@link google.cloud.policysimulator.v1.ReplayResult.verify|verify} messages. + * @function encode + * @memberof google.cloud.policysimulator.v1.ReplayResult + * @static + * @param {google.cloud.policysimulator.v1.IReplayResult} message ReplayResult message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ReplayResult.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.parent != null && Object.hasOwnProperty.call(message, "parent")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.parent); + if (message.accessTuple != null && Object.hasOwnProperty.call(message, "accessTuple")) + $root.google.cloud.policysimulator.v1.AccessTuple.encode(message.accessTuple, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.lastSeenDate != null && Object.hasOwnProperty.call(message, "lastSeenDate")) + $root.google.type.Date.encode(message.lastSeenDate, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.diff != null && Object.hasOwnProperty.call(message, "diff")) + $root.google.cloud.policysimulator.v1.ReplayDiff.encode(message.diff, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.error != null && Object.hasOwnProperty.call(message, "error")) + $root.google.rpc.Status.encode(message.error, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified ReplayResult message, length delimited. Does not implicitly {@link google.cloud.policysimulator.v1.ReplayResult.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.policysimulator.v1.ReplayResult + * @static + * @param {google.cloud.policysimulator.v1.IReplayResult} message ReplayResult message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ReplayResult.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ReplayResult message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.policysimulator.v1.ReplayResult + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.policysimulator.v1.ReplayResult} ReplayResult + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ReplayResult.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.policysimulator.v1.ReplayResult(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 5: { + message.diff = $root.google.cloud.policysimulator.v1.ReplayDiff.decode(reader, reader.uint32()); + break; + } + case 6: { + message.error = $root.google.rpc.Status.decode(reader, reader.uint32()); + break; + } + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.parent = reader.string(); + break; + } + case 3: { + message.accessTuple = $root.google.cloud.policysimulator.v1.AccessTuple.decode(reader, reader.uint32()); + break; + } + case 4: { + message.lastSeenDate = $root.google.type.Date.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ReplayResult message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.policysimulator.v1.ReplayResult + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.policysimulator.v1.ReplayResult} ReplayResult + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ReplayResult.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ReplayResult message. + * @function verify + * @memberof google.cloud.policysimulator.v1.ReplayResult + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ReplayResult.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.diff != null && message.hasOwnProperty("diff")) { + properties.result = 1; + { + var error = $root.google.cloud.policysimulator.v1.ReplayDiff.verify(message.diff); + if (error) + return "diff." + error; + } + } + if (message.error != null && message.hasOwnProperty("error")) { + if (properties.result === 1) + return "result: multiple values"; + properties.result = 1; + { + var error = $root.google.rpc.Status.verify(message.error); + if (error) + return "error." + error; + } + } + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + if (message.accessTuple != null && message.hasOwnProperty("accessTuple")) { + var error = $root.google.cloud.policysimulator.v1.AccessTuple.verify(message.accessTuple); + if (error) + return "accessTuple." + error; + } + if (message.lastSeenDate != null && message.hasOwnProperty("lastSeenDate")) { + var error = $root.google.type.Date.verify(message.lastSeenDate); + if (error) + return "lastSeenDate." + error; + } + return null; + }; + + /** + * Creates a ReplayResult message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.policysimulator.v1.ReplayResult + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.policysimulator.v1.ReplayResult} ReplayResult + */ + ReplayResult.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.policysimulator.v1.ReplayResult) + return object; + var message = new $root.google.cloud.policysimulator.v1.ReplayResult(); + if (object.diff != null) { + if (typeof object.diff !== "object") + throw TypeError(".google.cloud.policysimulator.v1.ReplayResult.diff: object expected"); + message.diff = $root.google.cloud.policysimulator.v1.ReplayDiff.fromObject(object.diff); + } + if (object.error != null) { + if (typeof object.error !== "object") + throw TypeError(".google.cloud.policysimulator.v1.ReplayResult.error: object expected"); + message.error = $root.google.rpc.Status.fromObject(object.error); + } + if (object.name != null) + message.name = String(object.name); + if (object.parent != null) + message.parent = String(object.parent); + if (object.accessTuple != null) { + if (typeof object.accessTuple !== "object") + throw TypeError(".google.cloud.policysimulator.v1.ReplayResult.accessTuple: object expected"); + message.accessTuple = $root.google.cloud.policysimulator.v1.AccessTuple.fromObject(object.accessTuple); + } + if (object.lastSeenDate != null) { + if (typeof object.lastSeenDate !== "object") + throw TypeError(".google.cloud.policysimulator.v1.ReplayResult.lastSeenDate: object expected"); + message.lastSeenDate = $root.google.type.Date.fromObject(object.lastSeenDate); + } + return message; + }; + + /** + * Creates a plain object from a ReplayResult message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.policysimulator.v1.ReplayResult + * @static + * @param {google.cloud.policysimulator.v1.ReplayResult} message ReplayResult + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ReplayResult.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.parent = ""; + object.accessTuple = null; + object.lastSeenDate = null; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.accessTuple != null && message.hasOwnProperty("accessTuple")) + object.accessTuple = $root.google.cloud.policysimulator.v1.AccessTuple.toObject(message.accessTuple, options); + if (message.lastSeenDate != null && message.hasOwnProperty("lastSeenDate")) + object.lastSeenDate = $root.google.type.Date.toObject(message.lastSeenDate, options); + if (message.diff != null && message.hasOwnProperty("diff")) { + object.diff = $root.google.cloud.policysimulator.v1.ReplayDiff.toObject(message.diff, options); + if (options.oneofs) + object.result = "diff"; + } + if (message.error != null && message.hasOwnProperty("error")) { + object.error = $root.google.rpc.Status.toObject(message.error, options); + if (options.oneofs) + object.result = "error"; + } + return object; + }; + + /** + * Converts this ReplayResult to JSON. + * @function toJSON + * @memberof google.cloud.policysimulator.v1.ReplayResult + * @instance + * @returns {Object.} JSON object + */ + ReplayResult.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ReplayResult + * @function getTypeUrl + * @memberof google.cloud.policysimulator.v1.ReplayResult + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ReplayResult.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.policysimulator.v1.ReplayResult"; + }; + + return ReplayResult; + })(); + + v1.CreateReplayRequest = (function() { + + /** + * Properties of a CreateReplayRequest. + * @memberof google.cloud.policysimulator.v1 + * @interface ICreateReplayRequest + * @property {string|null} [parent] CreateReplayRequest parent + * @property {google.cloud.policysimulator.v1.IReplay|null} [replay] CreateReplayRequest replay + */ + + /** + * Constructs a new CreateReplayRequest. + * @memberof google.cloud.policysimulator.v1 + * @classdesc Represents a CreateReplayRequest. + * @implements ICreateReplayRequest + * @constructor + * @param {google.cloud.policysimulator.v1.ICreateReplayRequest=} [properties] Properties to set + */ + function CreateReplayRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * CreateReplayRequest parent. + * @member {string} parent + * @memberof google.cloud.policysimulator.v1.CreateReplayRequest + * @instance + */ + CreateReplayRequest.prototype.parent = ""; + + /** + * CreateReplayRequest replay. + * @member {google.cloud.policysimulator.v1.IReplay|null|undefined} replay + * @memberof google.cloud.policysimulator.v1.CreateReplayRequest + * @instance + */ + CreateReplayRequest.prototype.replay = null; + + /** + * Creates a new CreateReplayRequest instance using the specified properties. + * @function create + * @memberof google.cloud.policysimulator.v1.CreateReplayRequest + * @static + * @param {google.cloud.policysimulator.v1.ICreateReplayRequest=} [properties] Properties to set + * @returns {google.cloud.policysimulator.v1.CreateReplayRequest} CreateReplayRequest instance + */ + CreateReplayRequest.create = function create(properties) { + return new CreateReplayRequest(properties); + }; + + /** + * Encodes the specified CreateReplayRequest message. Does not implicitly {@link google.cloud.policysimulator.v1.CreateReplayRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.policysimulator.v1.CreateReplayRequest + * @static + * @param {google.cloud.policysimulator.v1.ICreateReplayRequest} message CreateReplayRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateReplayRequest.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.replay != null && Object.hasOwnProperty.call(message, "replay")) + $root.google.cloud.policysimulator.v1.Replay.encode(message.replay, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified CreateReplayRequest message, length delimited. Does not implicitly {@link google.cloud.policysimulator.v1.CreateReplayRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.policysimulator.v1.CreateReplayRequest + * @static + * @param {google.cloud.policysimulator.v1.ICreateReplayRequest} message CreateReplayRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateReplayRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CreateReplayRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.policysimulator.v1.CreateReplayRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.policysimulator.v1.CreateReplayRequest} CreateReplayRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateReplayRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.policysimulator.v1.CreateReplayRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.replay = $root.google.cloud.policysimulator.v1.Replay.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CreateReplayRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.policysimulator.v1.CreateReplayRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.policysimulator.v1.CreateReplayRequest} CreateReplayRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateReplayRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CreateReplayRequest message. + * @function verify + * @memberof google.cloud.policysimulator.v1.CreateReplayRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CreateReplayRequest.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.replay != null && message.hasOwnProperty("replay")) { + var error = $root.google.cloud.policysimulator.v1.Replay.verify(message.replay); + if (error) + return "replay." + error; + } + return null; + }; + + /** + * Creates a CreateReplayRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.policysimulator.v1.CreateReplayRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.policysimulator.v1.CreateReplayRequest} CreateReplayRequest + */ + CreateReplayRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.policysimulator.v1.CreateReplayRequest) + return object; + var message = new $root.google.cloud.policysimulator.v1.CreateReplayRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.replay != null) { + if (typeof object.replay !== "object") + throw TypeError(".google.cloud.policysimulator.v1.CreateReplayRequest.replay: object expected"); + message.replay = $root.google.cloud.policysimulator.v1.Replay.fromObject(object.replay); + } + return message; + }; + + /** + * Creates a plain object from a CreateReplayRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.policysimulator.v1.CreateReplayRequest + * @static + * @param {google.cloud.policysimulator.v1.CreateReplayRequest} message CreateReplayRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CreateReplayRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.replay = null; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.replay != null && message.hasOwnProperty("replay")) + object.replay = $root.google.cloud.policysimulator.v1.Replay.toObject(message.replay, options); + return object; + }; + + /** + * Converts this CreateReplayRequest to JSON. + * @function toJSON + * @memberof google.cloud.policysimulator.v1.CreateReplayRequest + * @instance + * @returns {Object.} JSON object + */ + CreateReplayRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CreateReplayRequest + * @function getTypeUrl + * @memberof google.cloud.policysimulator.v1.CreateReplayRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CreateReplayRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.policysimulator.v1.CreateReplayRequest"; + }; + + return CreateReplayRequest; + })(); + + v1.ReplayOperationMetadata = (function() { + + /** + * Properties of a ReplayOperationMetadata. + * @memberof google.cloud.policysimulator.v1 + * @interface IReplayOperationMetadata + * @property {google.protobuf.ITimestamp|null} [startTime] ReplayOperationMetadata startTime + */ + + /** + * Constructs a new ReplayOperationMetadata. + * @memberof google.cloud.policysimulator.v1 + * @classdesc Represents a ReplayOperationMetadata. + * @implements IReplayOperationMetadata + * @constructor + * @param {google.cloud.policysimulator.v1.IReplayOperationMetadata=} [properties] Properties to set + */ + function ReplayOperationMetadata(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ReplayOperationMetadata startTime. + * @member {google.protobuf.ITimestamp|null|undefined} startTime + * @memberof google.cloud.policysimulator.v1.ReplayOperationMetadata + * @instance + */ + ReplayOperationMetadata.prototype.startTime = null; + + /** + * Creates a new ReplayOperationMetadata instance using the specified properties. + * @function create + * @memberof google.cloud.policysimulator.v1.ReplayOperationMetadata + * @static + * @param {google.cloud.policysimulator.v1.IReplayOperationMetadata=} [properties] Properties to set + * @returns {google.cloud.policysimulator.v1.ReplayOperationMetadata} ReplayOperationMetadata instance + */ + ReplayOperationMetadata.create = function create(properties) { + return new ReplayOperationMetadata(properties); + }; + + /** + * Encodes the specified ReplayOperationMetadata message. Does not implicitly {@link google.cloud.policysimulator.v1.ReplayOperationMetadata.verify|verify} messages. + * @function encode + * @memberof google.cloud.policysimulator.v1.ReplayOperationMetadata + * @static + * @param {google.cloud.policysimulator.v1.IReplayOperationMetadata} message ReplayOperationMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ReplayOperationMetadata.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(); + return writer; + }; + + /** + * Encodes the specified ReplayOperationMetadata message, length delimited. Does not implicitly {@link google.cloud.policysimulator.v1.ReplayOperationMetadata.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.policysimulator.v1.ReplayOperationMetadata + * @static + * @param {google.cloud.policysimulator.v1.IReplayOperationMetadata} message ReplayOperationMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ReplayOperationMetadata.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ReplayOperationMetadata message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.policysimulator.v1.ReplayOperationMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.policysimulator.v1.ReplayOperationMetadata} ReplayOperationMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ReplayOperationMetadata.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.policysimulator.v1.ReplayOperationMetadata(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.startTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ReplayOperationMetadata message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.policysimulator.v1.ReplayOperationMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.policysimulator.v1.ReplayOperationMetadata} ReplayOperationMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ReplayOperationMetadata.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ReplayOperationMetadata message. + * @function verify + * @memberof google.cloud.policysimulator.v1.ReplayOperationMetadata + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ReplayOperationMetadata.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; + } + return null; + }; + + /** + * Creates a ReplayOperationMetadata message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.policysimulator.v1.ReplayOperationMetadata + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.policysimulator.v1.ReplayOperationMetadata} ReplayOperationMetadata + */ + ReplayOperationMetadata.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.policysimulator.v1.ReplayOperationMetadata) + return object; + var message = new $root.google.cloud.policysimulator.v1.ReplayOperationMetadata(); + if (object.startTime != null) { + if (typeof object.startTime !== "object") + throw TypeError(".google.cloud.policysimulator.v1.ReplayOperationMetadata.startTime: object expected"); + message.startTime = $root.google.protobuf.Timestamp.fromObject(object.startTime); + } + return message; + }; + + /** + * Creates a plain object from a ReplayOperationMetadata message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.policysimulator.v1.ReplayOperationMetadata + * @static + * @param {google.cloud.policysimulator.v1.ReplayOperationMetadata} message ReplayOperationMetadata + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ReplayOperationMetadata.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.startTime = null; + if (message.startTime != null && message.hasOwnProperty("startTime")) + object.startTime = $root.google.protobuf.Timestamp.toObject(message.startTime, options); + return object; + }; + + /** + * Converts this ReplayOperationMetadata to JSON. + * @function toJSON + * @memberof google.cloud.policysimulator.v1.ReplayOperationMetadata + * @instance + * @returns {Object.} JSON object + */ + ReplayOperationMetadata.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ReplayOperationMetadata + * @function getTypeUrl + * @memberof google.cloud.policysimulator.v1.ReplayOperationMetadata + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ReplayOperationMetadata.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.policysimulator.v1.ReplayOperationMetadata"; + }; + + return ReplayOperationMetadata; + })(); + + v1.GetReplayRequest = (function() { + + /** + * Properties of a GetReplayRequest. + * @memberof google.cloud.policysimulator.v1 + * @interface IGetReplayRequest + * @property {string|null} [name] GetReplayRequest name + */ + + /** + * Constructs a new GetReplayRequest. + * @memberof google.cloud.policysimulator.v1 + * @classdesc Represents a GetReplayRequest. + * @implements IGetReplayRequest + * @constructor + * @param {google.cloud.policysimulator.v1.IGetReplayRequest=} [properties] Properties to set + */ + function GetReplayRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetReplayRequest name. + * @member {string} name + * @memberof google.cloud.policysimulator.v1.GetReplayRequest + * @instance + */ + GetReplayRequest.prototype.name = ""; + + /** + * Creates a new GetReplayRequest instance using the specified properties. + * @function create + * @memberof google.cloud.policysimulator.v1.GetReplayRequest + * @static + * @param {google.cloud.policysimulator.v1.IGetReplayRequest=} [properties] Properties to set + * @returns {google.cloud.policysimulator.v1.GetReplayRequest} GetReplayRequest instance + */ + GetReplayRequest.create = function create(properties) { + return new GetReplayRequest(properties); + }; + + /** + * Encodes the specified GetReplayRequest message. Does not implicitly {@link google.cloud.policysimulator.v1.GetReplayRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.policysimulator.v1.GetReplayRequest + * @static + * @param {google.cloud.policysimulator.v1.IGetReplayRequest} message GetReplayRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetReplayRequest.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 GetReplayRequest message, length delimited. Does not implicitly {@link google.cloud.policysimulator.v1.GetReplayRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.policysimulator.v1.GetReplayRequest + * @static + * @param {google.cloud.policysimulator.v1.IGetReplayRequest} message GetReplayRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetReplayRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetReplayRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.policysimulator.v1.GetReplayRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.policysimulator.v1.GetReplayRequest} GetReplayRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetReplayRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.policysimulator.v1.GetReplayRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetReplayRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.policysimulator.v1.GetReplayRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.policysimulator.v1.GetReplayRequest} GetReplayRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetReplayRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetReplayRequest message. + * @function verify + * @memberof google.cloud.policysimulator.v1.GetReplayRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetReplayRequest.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 GetReplayRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.policysimulator.v1.GetReplayRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.policysimulator.v1.GetReplayRequest} GetReplayRequest + */ + GetReplayRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.policysimulator.v1.GetReplayRequest) + return object; + var message = new $root.google.cloud.policysimulator.v1.GetReplayRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a GetReplayRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.policysimulator.v1.GetReplayRequest + * @static + * @param {google.cloud.policysimulator.v1.GetReplayRequest} message GetReplayRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetReplayRequest.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 GetReplayRequest to JSON. + * @function toJSON + * @memberof google.cloud.policysimulator.v1.GetReplayRequest + * @instance + * @returns {Object.} JSON object + */ + GetReplayRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GetReplayRequest + * @function getTypeUrl + * @memberof google.cloud.policysimulator.v1.GetReplayRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GetReplayRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.policysimulator.v1.GetReplayRequest"; + }; + + return GetReplayRequest; + })(); + + v1.ListReplayResultsRequest = (function() { + + /** + * Properties of a ListReplayResultsRequest. + * @memberof google.cloud.policysimulator.v1 + * @interface IListReplayResultsRequest + * @property {string|null} [parent] ListReplayResultsRequest parent + * @property {number|null} [pageSize] ListReplayResultsRequest pageSize + * @property {string|null} [pageToken] ListReplayResultsRequest pageToken + */ + + /** + * Constructs a new ListReplayResultsRequest. + * @memberof google.cloud.policysimulator.v1 + * @classdesc Represents a ListReplayResultsRequest. + * @implements IListReplayResultsRequest + * @constructor + * @param {google.cloud.policysimulator.v1.IListReplayResultsRequest=} [properties] Properties to set + */ + function ListReplayResultsRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListReplayResultsRequest parent. + * @member {string} parent + * @memberof google.cloud.policysimulator.v1.ListReplayResultsRequest + * @instance + */ + ListReplayResultsRequest.prototype.parent = ""; + + /** + * ListReplayResultsRequest pageSize. + * @member {number} pageSize + * @memberof google.cloud.policysimulator.v1.ListReplayResultsRequest + * @instance + */ + ListReplayResultsRequest.prototype.pageSize = 0; + + /** + * ListReplayResultsRequest pageToken. + * @member {string} pageToken + * @memberof google.cloud.policysimulator.v1.ListReplayResultsRequest + * @instance + */ + ListReplayResultsRequest.prototype.pageToken = ""; + + /** + * Creates a new ListReplayResultsRequest instance using the specified properties. + * @function create + * @memberof google.cloud.policysimulator.v1.ListReplayResultsRequest + * @static + * @param {google.cloud.policysimulator.v1.IListReplayResultsRequest=} [properties] Properties to set + * @returns {google.cloud.policysimulator.v1.ListReplayResultsRequest} ListReplayResultsRequest instance + */ + ListReplayResultsRequest.create = function create(properties) { + return new ListReplayResultsRequest(properties); + }; + + /** + * Encodes the specified ListReplayResultsRequest message. Does not implicitly {@link google.cloud.policysimulator.v1.ListReplayResultsRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.policysimulator.v1.ListReplayResultsRequest + * @static + * @param {google.cloud.policysimulator.v1.IListReplayResultsRequest} message ListReplayResultsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListReplayResultsRequest.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 ListReplayResultsRequest message, length delimited. Does not implicitly {@link google.cloud.policysimulator.v1.ListReplayResultsRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.policysimulator.v1.ListReplayResultsRequest + * @static + * @param {google.cloud.policysimulator.v1.IListReplayResultsRequest} message ListReplayResultsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListReplayResultsRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListReplayResultsRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.policysimulator.v1.ListReplayResultsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.policysimulator.v1.ListReplayResultsRequest} ListReplayResultsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListReplayResultsRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.policysimulator.v1.ListReplayResultsRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + 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 ListReplayResultsRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.policysimulator.v1.ListReplayResultsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.policysimulator.v1.ListReplayResultsRequest} ListReplayResultsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListReplayResultsRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListReplayResultsRequest message. + * @function verify + * @memberof google.cloud.policysimulator.v1.ListReplayResultsRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListReplayResultsRequest.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 ListReplayResultsRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.policysimulator.v1.ListReplayResultsRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.policysimulator.v1.ListReplayResultsRequest} ListReplayResultsRequest + */ + ListReplayResultsRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.policysimulator.v1.ListReplayResultsRequest) + return object; + var message = new $root.google.cloud.policysimulator.v1.ListReplayResultsRequest(); + 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 ListReplayResultsRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.policysimulator.v1.ListReplayResultsRequest + * @static + * @param {google.cloud.policysimulator.v1.ListReplayResultsRequest} message ListReplayResultsRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListReplayResultsRequest.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 ListReplayResultsRequest to JSON. + * @function toJSON + * @memberof google.cloud.policysimulator.v1.ListReplayResultsRequest + * @instance + * @returns {Object.} JSON object + */ + ListReplayResultsRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListReplayResultsRequest + * @function getTypeUrl + * @memberof google.cloud.policysimulator.v1.ListReplayResultsRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListReplayResultsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.policysimulator.v1.ListReplayResultsRequest"; + }; + + return ListReplayResultsRequest; + })(); + + v1.ListReplayResultsResponse = (function() { + + /** + * Properties of a ListReplayResultsResponse. + * @memberof google.cloud.policysimulator.v1 + * @interface IListReplayResultsResponse + * @property {Array.|null} [replayResults] ListReplayResultsResponse replayResults + * @property {string|null} [nextPageToken] ListReplayResultsResponse nextPageToken + */ + + /** + * Constructs a new ListReplayResultsResponse. + * @memberof google.cloud.policysimulator.v1 + * @classdesc Represents a ListReplayResultsResponse. + * @implements IListReplayResultsResponse + * @constructor + * @param {google.cloud.policysimulator.v1.IListReplayResultsResponse=} [properties] Properties to set + */ + function ListReplayResultsResponse(properties) { + this.replayResults = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListReplayResultsResponse replayResults. + * @member {Array.} replayResults + * @memberof google.cloud.policysimulator.v1.ListReplayResultsResponse + * @instance + */ + ListReplayResultsResponse.prototype.replayResults = $util.emptyArray; + + /** + * ListReplayResultsResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.cloud.policysimulator.v1.ListReplayResultsResponse + * @instance + */ + ListReplayResultsResponse.prototype.nextPageToken = ""; + + /** + * Creates a new ListReplayResultsResponse instance using the specified properties. + * @function create + * @memberof google.cloud.policysimulator.v1.ListReplayResultsResponse + * @static + * @param {google.cloud.policysimulator.v1.IListReplayResultsResponse=} [properties] Properties to set + * @returns {google.cloud.policysimulator.v1.ListReplayResultsResponse} ListReplayResultsResponse instance + */ + ListReplayResultsResponse.create = function create(properties) { + return new ListReplayResultsResponse(properties); + }; + + /** + * Encodes the specified ListReplayResultsResponse message. Does not implicitly {@link google.cloud.policysimulator.v1.ListReplayResultsResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.policysimulator.v1.ListReplayResultsResponse + * @static + * @param {google.cloud.policysimulator.v1.IListReplayResultsResponse} message ListReplayResultsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListReplayResultsResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.replayResults != null && message.replayResults.length) + for (var i = 0; i < message.replayResults.length; ++i) + $root.google.cloud.policysimulator.v1.ReplayResult.encode(message.replayResults[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 ListReplayResultsResponse message, length delimited. Does not implicitly {@link google.cloud.policysimulator.v1.ListReplayResultsResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.policysimulator.v1.ListReplayResultsResponse + * @static + * @param {google.cloud.policysimulator.v1.IListReplayResultsResponse} message ListReplayResultsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListReplayResultsResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListReplayResultsResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.policysimulator.v1.ListReplayResultsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.policysimulator.v1.ListReplayResultsResponse} ListReplayResultsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListReplayResultsResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.policysimulator.v1.ListReplayResultsResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.replayResults && message.replayResults.length)) + message.replayResults = []; + message.replayResults.push($root.google.cloud.policysimulator.v1.ReplayResult.decode(reader, reader.uint32())); + break; + } + case 2: { + message.nextPageToken = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListReplayResultsResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.policysimulator.v1.ListReplayResultsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.policysimulator.v1.ListReplayResultsResponse} ListReplayResultsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListReplayResultsResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListReplayResultsResponse message. + * @function verify + * @memberof google.cloud.policysimulator.v1.ListReplayResultsResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListReplayResultsResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.replayResults != null && message.hasOwnProperty("replayResults")) { + if (!Array.isArray(message.replayResults)) + return "replayResults: array expected"; + for (var i = 0; i < message.replayResults.length; ++i) { + var error = $root.google.cloud.policysimulator.v1.ReplayResult.verify(message.replayResults[i]); + if (error) + return "replayResults." + error; + } + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + return null; + }; + + /** + * Creates a ListReplayResultsResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.policysimulator.v1.ListReplayResultsResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.policysimulator.v1.ListReplayResultsResponse} ListReplayResultsResponse + */ + ListReplayResultsResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.policysimulator.v1.ListReplayResultsResponse) + return object; + var message = new $root.google.cloud.policysimulator.v1.ListReplayResultsResponse(); + if (object.replayResults) { + if (!Array.isArray(object.replayResults)) + throw TypeError(".google.cloud.policysimulator.v1.ListReplayResultsResponse.replayResults: array expected"); + message.replayResults = []; + for (var i = 0; i < object.replayResults.length; ++i) { + if (typeof object.replayResults[i] !== "object") + throw TypeError(".google.cloud.policysimulator.v1.ListReplayResultsResponse.replayResults: object expected"); + message.replayResults[i] = $root.google.cloud.policysimulator.v1.ReplayResult.fromObject(object.replayResults[i]); + } + } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + return message; + }; + + /** + * Creates a plain object from a ListReplayResultsResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.policysimulator.v1.ListReplayResultsResponse + * @static + * @param {google.cloud.policysimulator.v1.ListReplayResultsResponse} message ListReplayResultsResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListReplayResultsResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.replayResults = []; + if (options.defaults) + object.nextPageToken = ""; + if (message.replayResults && message.replayResults.length) { + object.replayResults = []; + for (var j = 0; j < message.replayResults.length; ++j) + object.replayResults[j] = $root.google.cloud.policysimulator.v1.ReplayResult.toObject(message.replayResults[j], options); + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + object.nextPageToken = message.nextPageToken; + return object; + }; + + /** + * Converts this ListReplayResultsResponse to JSON. + * @function toJSON + * @memberof google.cloud.policysimulator.v1.ListReplayResultsResponse + * @instance + * @returns {Object.} JSON object + */ + ListReplayResultsResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListReplayResultsResponse + * @function getTypeUrl + * @memberof google.cloud.policysimulator.v1.ListReplayResultsResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListReplayResultsResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.policysimulator.v1.ListReplayResultsResponse"; + }; + + return ListReplayResultsResponse; + })(); + + v1.ReplayConfig = (function() { + + /** + * Properties of a ReplayConfig. + * @memberof google.cloud.policysimulator.v1 + * @interface IReplayConfig + * @property {Object.|null} [policyOverlay] ReplayConfig policyOverlay + * @property {google.cloud.policysimulator.v1.ReplayConfig.LogSource|null} [logSource] ReplayConfig logSource + */ + + /** + * Constructs a new ReplayConfig. + * @memberof google.cloud.policysimulator.v1 + * @classdesc Represents a ReplayConfig. + * @implements IReplayConfig + * @constructor + * @param {google.cloud.policysimulator.v1.IReplayConfig=} [properties] Properties to set + */ + function ReplayConfig(properties) { + this.policyOverlay = {}; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ReplayConfig policyOverlay. + * @member {Object.} policyOverlay + * @memberof google.cloud.policysimulator.v1.ReplayConfig + * @instance + */ + ReplayConfig.prototype.policyOverlay = $util.emptyObject; + + /** + * ReplayConfig logSource. + * @member {google.cloud.policysimulator.v1.ReplayConfig.LogSource} logSource + * @memberof google.cloud.policysimulator.v1.ReplayConfig + * @instance + */ + ReplayConfig.prototype.logSource = 0; + + /** + * Creates a new ReplayConfig instance using the specified properties. + * @function create + * @memberof google.cloud.policysimulator.v1.ReplayConfig + * @static + * @param {google.cloud.policysimulator.v1.IReplayConfig=} [properties] Properties to set + * @returns {google.cloud.policysimulator.v1.ReplayConfig} ReplayConfig instance + */ + ReplayConfig.create = function create(properties) { + return new ReplayConfig(properties); + }; + + /** + * Encodes the specified ReplayConfig message. Does not implicitly {@link google.cloud.policysimulator.v1.ReplayConfig.verify|verify} messages. + * @function encode + * @memberof google.cloud.policysimulator.v1.ReplayConfig + * @static + * @param {google.cloud.policysimulator.v1.IReplayConfig} message ReplayConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ReplayConfig.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.policyOverlay != null && Object.hasOwnProperty.call(message, "policyOverlay")) + for (var keys = Object.keys(message.policyOverlay), 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.iam.v1.Policy.encode(message.policyOverlay[keys[i]], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim().ldelim(); + } + if (message.logSource != null && Object.hasOwnProperty.call(message, "logSource")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.logSource); + return writer; + }; + + /** + * Encodes the specified ReplayConfig message, length delimited. Does not implicitly {@link google.cloud.policysimulator.v1.ReplayConfig.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.policysimulator.v1.ReplayConfig + * @static + * @param {google.cloud.policysimulator.v1.IReplayConfig} message ReplayConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ReplayConfig.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ReplayConfig message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.policysimulator.v1.ReplayConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.policysimulator.v1.ReplayConfig} ReplayConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ReplayConfig.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.policysimulator.v1.ReplayConfig(), key, value; + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (message.policyOverlay === $util.emptyObject) + message.policyOverlay = {}; + 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.iam.v1.Policy.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag2 & 7); + break; + } + } + message.policyOverlay[key] = value; + break; + } + case 2: { + message.logSource = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ReplayConfig message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.policysimulator.v1.ReplayConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.policysimulator.v1.ReplayConfig} ReplayConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ReplayConfig.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ReplayConfig message. + * @function verify + * @memberof google.cloud.policysimulator.v1.ReplayConfig + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ReplayConfig.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.policyOverlay != null && message.hasOwnProperty("policyOverlay")) { + if (!$util.isObject(message.policyOverlay)) + return "policyOverlay: object expected"; + var key = Object.keys(message.policyOverlay); + for (var i = 0; i < key.length; ++i) { + var error = $root.google.iam.v1.Policy.verify(message.policyOverlay[key[i]]); + if (error) + return "policyOverlay." + error; + } + } + if (message.logSource != null && message.hasOwnProperty("logSource")) + switch (message.logSource) { + default: + return "logSource: enum value expected"; + case 0: + case 1: + break; + } + return null; + }; + + /** + * Creates a ReplayConfig message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.policysimulator.v1.ReplayConfig + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.policysimulator.v1.ReplayConfig} ReplayConfig + */ + ReplayConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.policysimulator.v1.ReplayConfig) + return object; + var message = new $root.google.cloud.policysimulator.v1.ReplayConfig(); + if (object.policyOverlay) { + if (typeof object.policyOverlay !== "object") + throw TypeError(".google.cloud.policysimulator.v1.ReplayConfig.policyOverlay: object expected"); + message.policyOverlay = {}; + for (var keys = Object.keys(object.policyOverlay), i = 0; i < keys.length; ++i) { + if (typeof object.policyOverlay[keys[i]] !== "object") + throw TypeError(".google.cloud.policysimulator.v1.ReplayConfig.policyOverlay: object expected"); + message.policyOverlay[keys[i]] = $root.google.iam.v1.Policy.fromObject(object.policyOverlay[keys[i]]); + } + } + switch (object.logSource) { + default: + if (typeof object.logSource === "number") { + message.logSource = object.logSource; + break; + } + break; + case "LOG_SOURCE_UNSPECIFIED": + case 0: + message.logSource = 0; + break; + case "RECENT_ACCESSES": + case 1: + message.logSource = 1; + break; + } + return message; + }; + + /** + * Creates a plain object from a ReplayConfig message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.policysimulator.v1.ReplayConfig + * @static + * @param {google.cloud.policysimulator.v1.ReplayConfig} message ReplayConfig + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ReplayConfig.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.objects || options.defaults) + object.policyOverlay = {}; + if (options.defaults) + object.logSource = options.enums === String ? "LOG_SOURCE_UNSPECIFIED" : 0; + var keys2; + if (message.policyOverlay && (keys2 = Object.keys(message.policyOverlay)).length) { + object.policyOverlay = {}; + for (var j = 0; j < keys2.length; ++j) + object.policyOverlay[keys2[j]] = $root.google.iam.v1.Policy.toObject(message.policyOverlay[keys2[j]], options); + } + if (message.logSource != null && message.hasOwnProperty("logSource")) + object.logSource = options.enums === String ? $root.google.cloud.policysimulator.v1.ReplayConfig.LogSource[message.logSource] === undefined ? message.logSource : $root.google.cloud.policysimulator.v1.ReplayConfig.LogSource[message.logSource] : message.logSource; + return object; + }; + + /** + * Converts this ReplayConfig to JSON. + * @function toJSON + * @memberof google.cloud.policysimulator.v1.ReplayConfig + * @instance + * @returns {Object.} JSON object + */ + ReplayConfig.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ReplayConfig + * @function getTypeUrl + * @memberof google.cloud.policysimulator.v1.ReplayConfig + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ReplayConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.policysimulator.v1.ReplayConfig"; + }; + + /** + * LogSource enum. + * @name google.cloud.policysimulator.v1.ReplayConfig.LogSource + * @enum {number} + * @property {number} LOG_SOURCE_UNSPECIFIED=0 LOG_SOURCE_UNSPECIFIED value + * @property {number} RECENT_ACCESSES=1 RECENT_ACCESSES value + */ + ReplayConfig.LogSource = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "LOG_SOURCE_UNSPECIFIED"] = 0; + values[valuesById[1] = "RECENT_ACCESSES"] = 1; + return values; + })(); + + return ReplayConfig; + })(); + + v1.ReplayDiff = (function() { + + /** + * Properties of a ReplayDiff. + * @memberof google.cloud.policysimulator.v1 + * @interface IReplayDiff + * @property {google.cloud.policysimulator.v1.IAccessStateDiff|null} [accessDiff] ReplayDiff accessDiff + */ + + /** + * Constructs a new ReplayDiff. + * @memberof google.cloud.policysimulator.v1 + * @classdesc Represents a ReplayDiff. + * @implements IReplayDiff + * @constructor + * @param {google.cloud.policysimulator.v1.IReplayDiff=} [properties] Properties to set + */ + function ReplayDiff(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ReplayDiff accessDiff. + * @member {google.cloud.policysimulator.v1.IAccessStateDiff|null|undefined} accessDiff + * @memberof google.cloud.policysimulator.v1.ReplayDiff + * @instance + */ + ReplayDiff.prototype.accessDiff = null; + + /** + * Creates a new ReplayDiff instance using the specified properties. + * @function create + * @memberof google.cloud.policysimulator.v1.ReplayDiff + * @static + * @param {google.cloud.policysimulator.v1.IReplayDiff=} [properties] Properties to set + * @returns {google.cloud.policysimulator.v1.ReplayDiff} ReplayDiff instance + */ + ReplayDiff.create = function create(properties) { + return new ReplayDiff(properties); + }; + + /** + * Encodes the specified ReplayDiff message. Does not implicitly {@link google.cloud.policysimulator.v1.ReplayDiff.verify|verify} messages. + * @function encode + * @memberof google.cloud.policysimulator.v1.ReplayDiff + * @static + * @param {google.cloud.policysimulator.v1.IReplayDiff} message ReplayDiff message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ReplayDiff.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.accessDiff != null && Object.hasOwnProperty.call(message, "accessDiff")) + $root.google.cloud.policysimulator.v1.AccessStateDiff.encode(message.accessDiff, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified ReplayDiff message, length delimited. Does not implicitly {@link google.cloud.policysimulator.v1.ReplayDiff.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.policysimulator.v1.ReplayDiff + * @static + * @param {google.cloud.policysimulator.v1.IReplayDiff} message ReplayDiff message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ReplayDiff.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ReplayDiff message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.policysimulator.v1.ReplayDiff + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.policysimulator.v1.ReplayDiff} ReplayDiff + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ReplayDiff.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.policysimulator.v1.ReplayDiff(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 2: { + message.accessDiff = $root.google.cloud.policysimulator.v1.AccessStateDiff.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ReplayDiff message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.policysimulator.v1.ReplayDiff + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.policysimulator.v1.ReplayDiff} ReplayDiff + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ReplayDiff.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ReplayDiff message. + * @function verify + * @memberof google.cloud.policysimulator.v1.ReplayDiff + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ReplayDiff.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.accessDiff != null && message.hasOwnProperty("accessDiff")) { + var error = $root.google.cloud.policysimulator.v1.AccessStateDiff.verify(message.accessDiff); + if (error) + return "accessDiff." + error; + } + return null; + }; + + /** + * Creates a ReplayDiff message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.policysimulator.v1.ReplayDiff + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.policysimulator.v1.ReplayDiff} ReplayDiff + */ + ReplayDiff.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.policysimulator.v1.ReplayDiff) + return object; + var message = new $root.google.cloud.policysimulator.v1.ReplayDiff(); + if (object.accessDiff != null) { + if (typeof object.accessDiff !== "object") + throw TypeError(".google.cloud.policysimulator.v1.ReplayDiff.accessDiff: object expected"); + message.accessDiff = $root.google.cloud.policysimulator.v1.AccessStateDiff.fromObject(object.accessDiff); + } + return message; + }; + + /** + * Creates a plain object from a ReplayDiff message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.policysimulator.v1.ReplayDiff + * @static + * @param {google.cloud.policysimulator.v1.ReplayDiff} message ReplayDiff + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ReplayDiff.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.accessDiff = null; + if (message.accessDiff != null && message.hasOwnProperty("accessDiff")) + object.accessDiff = $root.google.cloud.policysimulator.v1.AccessStateDiff.toObject(message.accessDiff, options); + return object; + }; + + /** + * Converts this ReplayDiff to JSON. + * @function toJSON + * @memberof google.cloud.policysimulator.v1.ReplayDiff + * @instance + * @returns {Object.} JSON object + */ + ReplayDiff.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ReplayDiff + * @function getTypeUrl + * @memberof google.cloud.policysimulator.v1.ReplayDiff + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ReplayDiff.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.policysimulator.v1.ReplayDiff"; + }; + + return ReplayDiff; + })(); + + v1.AccessStateDiff = (function() { + + /** + * Properties of an AccessStateDiff. + * @memberof google.cloud.policysimulator.v1 + * @interface IAccessStateDiff + * @property {google.cloud.policysimulator.v1.IExplainedAccess|null} [baseline] AccessStateDiff baseline + * @property {google.cloud.policysimulator.v1.IExplainedAccess|null} [simulated] AccessStateDiff simulated + * @property {google.cloud.policysimulator.v1.AccessStateDiff.AccessChangeType|null} [accessChange] AccessStateDiff accessChange + */ + + /** + * Constructs a new AccessStateDiff. + * @memberof google.cloud.policysimulator.v1 + * @classdesc Represents an AccessStateDiff. + * @implements IAccessStateDiff + * @constructor + * @param {google.cloud.policysimulator.v1.IAccessStateDiff=} [properties] Properties to set + */ + function AccessStateDiff(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * AccessStateDiff baseline. + * @member {google.cloud.policysimulator.v1.IExplainedAccess|null|undefined} baseline + * @memberof google.cloud.policysimulator.v1.AccessStateDiff + * @instance + */ + AccessStateDiff.prototype.baseline = null; + + /** + * AccessStateDiff simulated. + * @member {google.cloud.policysimulator.v1.IExplainedAccess|null|undefined} simulated + * @memberof google.cloud.policysimulator.v1.AccessStateDiff + * @instance + */ + AccessStateDiff.prototype.simulated = null; + + /** + * AccessStateDiff accessChange. + * @member {google.cloud.policysimulator.v1.AccessStateDiff.AccessChangeType} accessChange + * @memberof google.cloud.policysimulator.v1.AccessStateDiff + * @instance + */ + AccessStateDiff.prototype.accessChange = 0; + + /** + * Creates a new AccessStateDiff instance using the specified properties. + * @function create + * @memberof google.cloud.policysimulator.v1.AccessStateDiff + * @static + * @param {google.cloud.policysimulator.v1.IAccessStateDiff=} [properties] Properties to set + * @returns {google.cloud.policysimulator.v1.AccessStateDiff} AccessStateDiff instance + */ + AccessStateDiff.create = function create(properties) { + return new AccessStateDiff(properties); + }; + + /** + * Encodes the specified AccessStateDiff message. Does not implicitly {@link google.cloud.policysimulator.v1.AccessStateDiff.verify|verify} messages. + * @function encode + * @memberof google.cloud.policysimulator.v1.AccessStateDiff + * @static + * @param {google.cloud.policysimulator.v1.IAccessStateDiff} message AccessStateDiff message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AccessStateDiff.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.baseline != null && Object.hasOwnProperty.call(message, "baseline")) + $root.google.cloud.policysimulator.v1.ExplainedAccess.encode(message.baseline, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.simulated != null && Object.hasOwnProperty.call(message, "simulated")) + $root.google.cloud.policysimulator.v1.ExplainedAccess.encode(message.simulated, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.accessChange != null && Object.hasOwnProperty.call(message, "accessChange")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.accessChange); + return writer; + }; + + /** + * Encodes the specified AccessStateDiff message, length delimited. Does not implicitly {@link google.cloud.policysimulator.v1.AccessStateDiff.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.policysimulator.v1.AccessStateDiff + * @static + * @param {google.cloud.policysimulator.v1.IAccessStateDiff} message AccessStateDiff message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AccessStateDiff.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an AccessStateDiff message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.policysimulator.v1.AccessStateDiff + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.policysimulator.v1.AccessStateDiff} AccessStateDiff + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AccessStateDiff.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.policysimulator.v1.AccessStateDiff(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.baseline = $root.google.cloud.policysimulator.v1.ExplainedAccess.decode(reader, reader.uint32()); + break; + } + case 2: { + message.simulated = $root.google.cloud.policysimulator.v1.ExplainedAccess.decode(reader, reader.uint32()); + break; + } + case 3: { + message.accessChange = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an AccessStateDiff message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.policysimulator.v1.AccessStateDiff + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.policysimulator.v1.AccessStateDiff} AccessStateDiff + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AccessStateDiff.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an AccessStateDiff message. + * @function verify + * @memberof google.cloud.policysimulator.v1.AccessStateDiff + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + AccessStateDiff.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.baseline != null && message.hasOwnProperty("baseline")) { + var error = $root.google.cloud.policysimulator.v1.ExplainedAccess.verify(message.baseline); + if (error) + return "baseline." + error; + } + if (message.simulated != null && message.hasOwnProperty("simulated")) { + var error = $root.google.cloud.policysimulator.v1.ExplainedAccess.verify(message.simulated); + if (error) + return "simulated." + error; + } + if (message.accessChange != null && message.hasOwnProperty("accessChange")) + switch (message.accessChange) { + default: + return "accessChange: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + case 5: + case 6: + break; + } + return null; + }; + + /** + * Creates an AccessStateDiff message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.policysimulator.v1.AccessStateDiff + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.policysimulator.v1.AccessStateDiff} AccessStateDiff + */ + AccessStateDiff.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.policysimulator.v1.AccessStateDiff) + return object; + var message = new $root.google.cloud.policysimulator.v1.AccessStateDiff(); + if (object.baseline != null) { + if (typeof object.baseline !== "object") + throw TypeError(".google.cloud.policysimulator.v1.AccessStateDiff.baseline: object expected"); + message.baseline = $root.google.cloud.policysimulator.v1.ExplainedAccess.fromObject(object.baseline); + } + if (object.simulated != null) { + if (typeof object.simulated !== "object") + throw TypeError(".google.cloud.policysimulator.v1.AccessStateDiff.simulated: object expected"); + message.simulated = $root.google.cloud.policysimulator.v1.ExplainedAccess.fromObject(object.simulated); + } + switch (object.accessChange) { + default: + if (typeof object.accessChange === "number") { + message.accessChange = object.accessChange; + break; + } + break; + case "ACCESS_CHANGE_TYPE_UNSPECIFIED": + case 0: + message.accessChange = 0; + break; + case "NO_CHANGE": + case 1: + message.accessChange = 1; + break; + case "UNKNOWN_CHANGE": + case 2: + message.accessChange = 2; + break; + case "ACCESS_REVOKED": + case 3: + message.accessChange = 3; + break; + case "ACCESS_GAINED": + case 4: + message.accessChange = 4; + break; + case "ACCESS_MAYBE_REVOKED": + case 5: + message.accessChange = 5; + break; + case "ACCESS_MAYBE_GAINED": + case 6: + message.accessChange = 6; + break; + } + return message; + }; + + /** + * Creates a plain object from an AccessStateDiff message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.policysimulator.v1.AccessStateDiff + * @static + * @param {google.cloud.policysimulator.v1.AccessStateDiff} message AccessStateDiff + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + AccessStateDiff.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.baseline = null; + object.simulated = null; + object.accessChange = options.enums === String ? "ACCESS_CHANGE_TYPE_UNSPECIFIED" : 0; + } + if (message.baseline != null && message.hasOwnProperty("baseline")) + object.baseline = $root.google.cloud.policysimulator.v1.ExplainedAccess.toObject(message.baseline, options); + if (message.simulated != null && message.hasOwnProperty("simulated")) + object.simulated = $root.google.cloud.policysimulator.v1.ExplainedAccess.toObject(message.simulated, options); + if (message.accessChange != null && message.hasOwnProperty("accessChange")) + object.accessChange = options.enums === String ? $root.google.cloud.policysimulator.v1.AccessStateDiff.AccessChangeType[message.accessChange] === undefined ? message.accessChange : $root.google.cloud.policysimulator.v1.AccessStateDiff.AccessChangeType[message.accessChange] : message.accessChange; + return object; + }; + + /** + * Converts this AccessStateDiff to JSON. + * @function toJSON + * @memberof google.cloud.policysimulator.v1.AccessStateDiff + * @instance + * @returns {Object.} JSON object + */ + AccessStateDiff.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for AccessStateDiff + * @function getTypeUrl + * @memberof google.cloud.policysimulator.v1.AccessStateDiff + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + AccessStateDiff.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.policysimulator.v1.AccessStateDiff"; + }; + + /** + * AccessChangeType enum. + * @name google.cloud.policysimulator.v1.AccessStateDiff.AccessChangeType + * @enum {number} + * @property {number} ACCESS_CHANGE_TYPE_UNSPECIFIED=0 ACCESS_CHANGE_TYPE_UNSPECIFIED value + * @property {number} NO_CHANGE=1 NO_CHANGE value + * @property {number} UNKNOWN_CHANGE=2 UNKNOWN_CHANGE value + * @property {number} ACCESS_REVOKED=3 ACCESS_REVOKED value + * @property {number} ACCESS_GAINED=4 ACCESS_GAINED value + * @property {number} ACCESS_MAYBE_REVOKED=5 ACCESS_MAYBE_REVOKED value + * @property {number} ACCESS_MAYBE_GAINED=6 ACCESS_MAYBE_GAINED value + */ + AccessStateDiff.AccessChangeType = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "ACCESS_CHANGE_TYPE_UNSPECIFIED"] = 0; + values[valuesById[1] = "NO_CHANGE"] = 1; + values[valuesById[2] = "UNKNOWN_CHANGE"] = 2; + values[valuesById[3] = "ACCESS_REVOKED"] = 3; + values[valuesById[4] = "ACCESS_GAINED"] = 4; + values[valuesById[5] = "ACCESS_MAYBE_REVOKED"] = 5; + values[valuesById[6] = "ACCESS_MAYBE_GAINED"] = 6; + return values; + })(); + + return AccessStateDiff; + })(); + + v1.ExplainedAccess = (function() { + + /** + * Properties of an ExplainedAccess. + * @memberof google.cloud.policysimulator.v1 + * @interface IExplainedAccess + * @property {google.cloud.policysimulator.v1.AccessState|null} [accessState] ExplainedAccess accessState + * @property {Array.|null} [policies] ExplainedAccess policies + * @property {Array.|null} [errors] ExplainedAccess errors + */ + + /** + * Constructs a new ExplainedAccess. + * @memberof google.cloud.policysimulator.v1 + * @classdesc Represents an ExplainedAccess. + * @implements IExplainedAccess + * @constructor + * @param {google.cloud.policysimulator.v1.IExplainedAccess=} [properties] Properties to set + */ + function ExplainedAccess(properties) { + this.policies = []; + this.errors = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ExplainedAccess accessState. + * @member {google.cloud.policysimulator.v1.AccessState} accessState + * @memberof google.cloud.policysimulator.v1.ExplainedAccess + * @instance + */ + ExplainedAccess.prototype.accessState = 0; + + /** + * ExplainedAccess policies. + * @member {Array.} policies + * @memberof google.cloud.policysimulator.v1.ExplainedAccess + * @instance + */ + ExplainedAccess.prototype.policies = $util.emptyArray; + + /** + * ExplainedAccess errors. + * @member {Array.} errors + * @memberof google.cloud.policysimulator.v1.ExplainedAccess + * @instance + */ + ExplainedAccess.prototype.errors = $util.emptyArray; + + /** + * Creates a new ExplainedAccess instance using the specified properties. + * @function create + * @memberof google.cloud.policysimulator.v1.ExplainedAccess + * @static + * @param {google.cloud.policysimulator.v1.IExplainedAccess=} [properties] Properties to set + * @returns {google.cloud.policysimulator.v1.ExplainedAccess} ExplainedAccess instance + */ + ExplainedAccess.create = function create(properties) { + return new ExplainedAccess(properties); + }; + + /** + * Encodes the specified ExplainedAccess message. Does not implicitly {@link google.cloud.policysimulator.v1.ExplainedAccess.verify|verify} messages. + * @function encode + * @memberof google.cloud.policysimulator.v1.ExplainedAccess + * @static + * @param {google.cloud.policysimulator.v1.IExplainedAccess} message ExplainedAccess message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ExplainedAccess.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.accessState != null && Object.hasOwnProperty.call(message, "accessState")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.accessState); + if (message.policies != null && message.policies.length) + for (var i = 0; i < message.policies.length; ++i) + $root.google.cloud.policysimulator.v1.ExplainedPolicy.encode(message.policies[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.errors != null && message.errors.length) + for (var i = 0; i < message.errors.length; ++i) + $root.google.rpc.Status.encode(message.errors[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified ExplainedAccess message, length delimited. Does not implicitly {@link google.cloud.policysimulator.v1.ExplainedAccess.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.policysimulator.v1.ExplainedAccess + * @static + * @param {google.cloud.policysimulator.v1.IExplainedAccess} message ExplainedAccess message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ExplainedAccess.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an ExplainedAccess message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.policysimulator.v1.ExplainedAccess + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.policysimulator.v1.ExplainedAccess} ExplainedAccess + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ExplainedAccess.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.policysimulator.v1.ExplainedAccess(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.accessState = reader.int32(); + break; + } + case 2: { + if (!(message.policies && message.policies.length)) + message.policies = []; + message.policies.push($root.google.cloud.policysimulator.v1.ExplainedPolicy.decode(reader, reader.uint32())); + break; + } + case 3: { + if (!(message.errors && message.errors.length)) + message.errors = []; + message.errors.push($root.google.rpc.Status.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an ExplainedAccess message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.policysimulator.v1.ExplainedAccess + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.policysimulator.v1.ExplainedAccess} ExplainedAccess + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ExplainedAccess.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an ExplainedAccess message. + * @function verify + * @memberof google.cloud.policysimulator.v1.ExplainedAccess + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ExplainedAccess.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.accessState != null && message.hasOwnProperty("accessState")) + switch (message.accessState) { + default: + return "accessState: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + break; + } + if (message.policies != null && message.hasOwnProperty("policies")) { + if (!Array.isArray(message.policies)) + return "policies: array expected"; + for (var i = 0; i < message.policies.length; ++i) { + var error = $root.google.cloud.policysimulator.v1.ExplainedPolicy.verify(message.policies[i]); + if (error) + return "policies." + error; + } + } + if (message.errors != null && message.hasOwnProperty("errors")) { + if (!Array.isArray(message.errors)) + return "errors: array expected"; + for (var i = 0; i < message.errors.length; ++i) { + var error = $root.google.rpc.Status.verify(message.errors[i]); + if (error) + return "errors." + error; + } + } + return null; + }; + + /** + * Creates an ExplainedAccess message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.policysimulator.v1.ExplainedAccess + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.policysimulator.v1.ExplainedAccess} ExplainedAccess + */ + ExplainedAccess.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.policysimulator.v1.ExplainedAccess) + return object; + var message = new $root.google.cloud.policysimulator.v1.ExplainedAccess(); + switch (object.accessState) { + default: + if (typeof object.accessState === "number") { + message.accessState = object.accessState; + break; + } + break; + case "ACCESS_STATE_UNSPECIFIED": + case 0: + message.accessState = 0; + break; + case "GRANTED": + case 1: + message.accessState = 1; + break; + case "NOT_GRANTED": + case 2: + message.accessState = 2; + break; + case "UNKNOWN_CONDITIONAL": + case 3: + message.accessState = 3; + break; + case "UNKNOWN_INFO_DENIED": + case 4: + message.accessState = 4; + break; + } + if (object.policies) { + if (!Array.isArray(object.policies)) + throw TypeError(".google.cloud.policysimulator.v1.ExplainedAccess.policies: array expected"); + message.policies = []; + for (var i = 0; i < object.policies.length; ++i) { + if (typeof object.policies[i] !== "object") + throw TypeError(".google.cloud.policysimulator.v1.ExplainedAccess.policies: object expected"); + message.policies[i] = $root.google.cloud.policysimulator.v1.ExplainedPolicy.fromObject(object.policies[i]); + } + } + if (object.errors) { + if (!Array.isArray(object.errors)) + throw TypeError(".google.cloud.policysimulator.v1.ExplainedAccess.errors: array expected"); + message.errors = []; + for (var i = 0; i < object.errors.length; ++i) { + if (typeof object.errors[i] !== "object") + throw TypeError(".google.cloud.policysimulator.v1.ExplainedAccess.errors: object expected"); + message.errors[i] = $root.google.rpc.Status.fromObject(object.errors[i]); + } + } + return message; + }; + + /** + * Creates a plain object from an ExplainedAccess message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.policysimulator.v1.ExplainedAccess + * @static + * @param {google.cloud.policysimulator.v1.ExplainedAccess} message ExplainedAccess + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ExplainedAccess.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.policies = []; + object.errors = []; + } + if (options.defaults) + object.accessState = options.enums === String ? "ACCESS_STATE_UNSPECIFIED" : 0; + if (message.accessState != null && message.hasOwnProperty("accessState")) + object.accessState = options.enums === String ? $root.google.cloud.policysimulator.v1.AccessState[message.accessState] === undefined ? message.accessState : $root.google.cloud.policysimulator.v1.AccessState[message.accessState] : message.accessState; + if (message.policies && message.policies.length) { + object.policies = []; + for (var j = 0; j < message.policies.length; ++j) + object.policies[j] = $root.google.cloud.policysimulator.v1.ExplainedPolicy.toObject(message.policies[j], options); + } + if (message.errors && message.errors.length) { + object.errors = []; + for (var j = 0; j < message.errors.length; ++j) + object.errors[j] = $root.google.rpc.Status.toObject(message.errors[j], options); + } + return object; + }; + + /** + * Converts this ExplainedAccess to JSON. + * @function toJSON + * @memberof google.cloud.policysimulator.v1.ExplainedAccess + * @instance + * @returns {Object.} JSON object + */ + ExplainedAccess.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ExplainedAccess + * @function getTypeUrl + * @memberof google.cloud.policysimulator.v1.ExplainedAccess + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ExplainedAccess.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.policysimulator.v1.ExplainedAccess"; + }; + + return ExplainedAccess; + })(); + + return v1; + })(); + + return policysimulator; + })(); + + return cloud; + })(); + + google.api = (function() { + + /** + * Namespace api. + * @memberof google + * @namespace + */ + var api = {}; + + /** + * 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 + */ + 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; + return values; + })(); + + 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) { + 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(); + 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) { + 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(); + 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) { + 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(); + 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) { + 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(); + 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) { + 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(); + 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 + */ + + /** + * 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; + + /** + * 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(); + 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) { + 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(); + 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; + } + 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: + 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; + } + } + 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; + } + 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]); + } + } + 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; + } + 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); + } + 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) { + 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(); + 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) { + 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(); + 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) { + 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(); + 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) { + 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(); + 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) { + 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(); + 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 + */ + + /** + * 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) { + if (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; + + /** + * 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(); + 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) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.DotnetSettings(); + while (reader.pos < end) { + var tag = reader.uint32(); + 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 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; + } + 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); + } + 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.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 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) { + 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(); + 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) { + 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(); + 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 + */ + + /** + * 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) { + if (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; + + /** + * 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(); + 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) { + 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(); + switch (tag >>> 3) { + case 1: { + message.selector = reader.string(); + break; + } + case 2: { + message.longRunning = $root.google.api.MethodSettings.LongRunning.decode(reader, reader.uint32()); + 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; + } + 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); + } + 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.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); + 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) { + 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(); + 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 + */ + 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; + 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; + })(); + + 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) { + 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(); + 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) { + 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(); + 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) { + 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(); + 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; + })(); + + 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 {string|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 {string} edition + * @memberof google.protobuf.FileDescriptorProto + * @instance + */ + FileDescriptorProto.prototype.edition = ""; + + /** + * 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 13, wireType 2 =*/106).string(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) { + 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(); + 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 13: { + message.edition = reader.string(); + 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")) + if (!$util.isString(message.edition)) + return "edition: string expected"; + 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); + if (object.edition != null) + message.edition = String(object.edition); + 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 = ""; + } + 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 = 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) { + 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(); + 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) { + 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(); + 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) { + 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(); + 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 + */ + + /** + * 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 = []; + if (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; + + /** + * 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.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) { + 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(); + 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; + } + 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; + } + } + 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]); + } + } + 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.uninterpretedOption = []; + 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"; + }; + + 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) { + 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(); + 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 2: + case 3: + 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_REQUIRED": + case 2: + message.label = 2; + break; + case "LABEL_REPEATED": + case 3: + message.label = 3; + 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_REQUIRED=2 LABEL_REQUIRED value + * @property {number} LABEL_REPEATED=3 LABEL_REPEATED value + */ + FieldDescriptorProto.Label = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[1] = "LABEL_OPTIONAL"] = 1; + values[valuesById[2] = "LABEL_REQUIRED"] = 2; + values[valuesById[3] = "LABEL_REPEATED"] = 3; + 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) { + 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(); + 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) { + 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(); + 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) { + 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(); + 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) { + 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(); + 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) { + 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(); + 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) { + 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(); + 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} [phpGenericServices] FileOptions phpGenericServices + * @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 {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 phpGenericServices. + * @member {boolean} phpGenericServices + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.phpGenericServices = 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 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.phpGenericServices != null && Object.hasOwnProperty.call(message, "phpGenericServices")) + writer.uint32(/* id 42, wireType 0 =*/336).bool(message.phpGenericServices); + 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.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) { + 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(); + 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 42: { + message.phpGenericServices = 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 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.phpGenericServices != null && message.hasOwnProperty("phpGenericServices")) + if (typeof message.phpGenericServices !== "boolean") + return "phpGenericServices: 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.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.phpGenericServices != null) + message.phpGenericServices = Boolean(object.phpGenericServices); + 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.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.phpGenericServices = false; + object.phpMetadataNamespace = ""; + object.rubyPackage = ""; + } + 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.phpGenericServices != null && message.hasOwnProperty("phpGenericServices")) + object.phpGenericServices = message.phpGenericServices; + if (message.phpMetadataNamespace != null && message.hasOwnProperty("phpMetadataNamespace")) + object.phpMetadataNamespace = message.phpMetadataNamespace; + if (message.rubyPackage != null && message.hasOwnProperty("rubyPackage")) + object.rubyPackage = message.rubyPackage; + 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 {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 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.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) { + 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(); + 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 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.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.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[".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.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 {google.protobuf.FieldOptions.OptionTargetType|null} [target] FieldOptions target + * @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.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 target. + * @member {google.protobuf.FieldOptions.OptionTargetType} target + * @memberof google.protobuf.FieldOptions + * @instance + */ + FieldOptions.prototype.target = 0; + + /** + * 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.target != null && Object.hasOwnProperty.call(message, "target")) + writer.uint32(/* id 18, wireType 0 =*/144).int32(message.target); + 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) { + writer.uint32(/* id 1052, wireType 2 =*/8418).fork(); + for (var i = 0; i < message[".google.api.fieldBehavior"].length; ++i) + writer.int32(message[".google.api.fieldBehavior"][i]); + writer.ldelim(); + } + 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) { + 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(); + 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 18: { + message.target = reader.int32(); + 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.target != null && message.hasOwnProperty("target")) + switch (message.target) { + default: + return "target: 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.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: + 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; + } + switch (object.target) { + default: + if (typeof object.target === "number") { + message.target = object.target; + break; + } + break; + case "TARGET_TYPE_UNKNOWN": + case 0: + message.target = 0; + break; + case "TARGET_TYPE_FILE": + case 1: + message.target = 1; + break; + case "TARGET_TYPE_EXTENSION_RANGE": + case 2: + message.target = 2; + break; + case "TARGET_TYPE_MESSAGE": + case 3: + message.target = 3; + break; + case "TARGET_TYPE_FIELD": + case 4: + message.target = 4; + break; + case "TARGET_TYPE_ONEOF": + case 5: + message.target = 5; + break; + case "TARGET_TYPE_ENUM": + case 6: + message.target = 6; + break; + case "TARGET_TYPE_ENUM_ENTRY": + case 7: + message.target = 7; + break; + case "TARGET_TYPE_SERVICE": + case 8: + message.target = 8; + break; + case "TARGET_TYPE_METHOD": + case 9: + message.target = 9; + break; + } + 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; + } + } + 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.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.target = options.enums === String ? "TARGET_TYPE_UNKNOWN" : 0; + 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.target != null && message.hasOwnProperty("target")) + object.target = options.enums === String ? $root.google.protobuf.FieldOptions.OptionTargetType[message.target] === undefined ? message.target : $root.google.protobuf.FieldOptions.OptionTargetType[message.target] : message.target; + 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; + })(); + + return FieldOptions; + })(); + + protobuf.OneofOptions = (function() { + + /** + * Properties of an OneofOptions. + * @memberof google.protobuf + * @interface IOneofOptions + * @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 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.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) { + 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(); + 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; + } + 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.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.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 (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 {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 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.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) { + 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(); + 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 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.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.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; + } + 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.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 {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 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.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) { + 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(); + switch (tag >>> 3) { + case 1: { + 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; + } + 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.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.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; + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + object.deprecated = message.deprecated; + 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 {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 + */ + + /** + * 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 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"] = ""; + + /** + * 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.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"]); + 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) { + 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(); + switch (tag >>> 3) { + 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; + } + 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.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"; + 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.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"]); + 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[".google.api.defaultHost"] = ""; + object[".google.api.oauthScopes"] = ""; + } + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + object.deprecated = message.deprecated; + 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"]; + 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 {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 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.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) { + 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(); + switch (tag >>> 3) { + case 33: { + message.deprecated = reader.bool(); + break; + } + case 34: { + message.idempotencyLevel = reader.int32(); + 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.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.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[".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.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) { + 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(); + 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) { + 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(); + 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.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) { + 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(); + 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) { + 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(); + 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) { + 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(); + 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) { + 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(); + 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) { + 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(); + 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) { + 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(); + 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) { + 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(); + 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) { + 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(); + 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.iam = (function() { + + /** + * Namespace iam. + * @memberof google + * @namespace + */ + var iam = {}; + + iam.v1 = (function() { + + /** + * Namespace v1. + * @memberof google.iam + * @namespace + */ + var v1 = {}; + + v1.Policy = (function() { + + /** + * Properties of a Policy. + * @memberof google.iam.v1 + * @interface IPolicy + * @property {number|null} [version] Policy version + * @property {Array.|null} [bindings] Policy bindings + * @property {Array.|null} [auditConfigs] Policy auditConfigs + * @property {Uint8Array|null} [etag] Policy etag + */ + + /** + * Constructs a new Policy. + * @memberof google.iam.v1 + * @classdesc Represents a Policy. + * @implements IPolicy + * @constructor + * @param {google.iam.v1.IPolicy=} [properties] Properties to set + */ + function Policy(properties) { + this.bindings = []; + this.auditConfigs = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Policy version. + * @member {number} version + * @memberof google.iam.v1.Policy + * @instance + */ + Policy.prototype.version = 0; + + /** + * Policy bindings. + * @member {Array.} bindings + * @memberof google.iam.v1.Policy + * @instance + */ + Policy.prototype.bindings = $util.emptyArray; + + /** + * Policy auditConfigs. + * @member {Array.} auditConfigs + * @memberof google.iam.v1.Policy + * @instance + */ + Policy.prototype.auditConfigs = $util.emptyArray; + + /** + * Policy etag. + * @member {Uint8Array} etag + * @memberof google.iam.v1.Policy + * @instance + */ + Policy.prototype.etag = $util.newBuffer([]); + + /** + * Creates a new Policy instance using the specified properties. + * @function create + * @memberof google.iam.v1.Policy + * @static + * @param {google.iam.v1.IPolicy=} [properties] Properties to set + * @returns {google.iam.v1.Policy} Policy instance + */ + Policy.create = function create(properties) { + return new Policy(properties); + }; + + /** + * Encodes the specified Policy message. Does not implicitly {@link google.iam.v1.Policy.verify|verify} messages. + * @function encode + * @memberof google.iam.v1.Policy + * @static + * @param {google.iam.v1.IPolicy} message Policy message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Policy.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.version != null && Object.hasOwnProperty.call(message, "version")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.version); + if (message.etag != null && Object.hasOwnProperty.call(message, "etag")) + writer.uint32(/* id 3, wireType 2 =*/26).bytes(message.etag); + if (message.bindings != null && message.bindings.length) + for (var i = 0; i < message.bindings.length; ++i) + $root.google.iam.v1.Binding.encode(message.bindings[i], writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.auditConfigs != null && message.auditConfigs.length) + for (var i = 0; i < message.auditConfigs.length; ++i) + $root.google.iam.v1.AuditConfig.encode(message.auditConfigs[i], writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified Policy message, length delimited. Does not implicitly {@link google.iam.v1.Policy.verify|verify} messages. + * @function encodeDelimited + * @memberof google.iam.v1.Policy + * @static + * @param {google.iam.v1.IPolicy} message Policy message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Policy.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Policy message from the specified reader or buffer. + * @function decode + * @memberof google.iam.v1.Policy + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.iam.v1.Policy} Policy + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Policy.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.iam.v1.Policy(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.version = reader.int32(); + break; + } + case 4: { + if (!(message.bindings && message.bindings.length)) + message.bindings = []; + message.bindings.push($root.google.iam.v1.Binding.decode(reader, reader.uint32())); + break; + } + case 6: { + if (!(message.auditConfigs && message.auditConfigs.length)) + message.auditConfigs = []; + message.auditConfigs.push($root.google.iam.v1.AuditConfig.decode(reader, reader.uint32())); + break; + } + case 3: { + message.etag = reader.bytes(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Policy message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.iam.v1.Policy + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.iam.v1.Policy} Policy + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Policy.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Policy message. + * @function verify + * @memberof google.iam.v1.Policy + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Policy.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.version != null && message.hasOwnProperty("version")) + if (!$util.isInteger(message.version)) + return "version: integer expected"; + if (message.bindings != null && message.hasOwnProperty("bindings")) { + if (!Array.isArray(message.bindings)) + return "bindings: array expected"; + for (var i = 0; i < message.bindings.length; ++i) { + var error = $root.google.iam.v1.Binding.verify(message.bindings[i]); + if (error) + return "bindings." + error; + } + } + if (message.auditConfigs != null && message.hasOwnProperty("auditConfigs")) { + if (!Array.isArray(message.auditConfigs)) + return "auditConfigs: array expected"; + for (var i = 0; i < message.auditConfigs.length; ++i) { + var error = $root.google.iam.v1.AuditConfig.verify(message.auditConfigs[i]); + if (error) + return "auditConfigs." + error; + } + } + if (message.etag != null && message.hasOwnProperty("etag")) + if (!(message.etag && typeof message.etag.length === "number" || $util.isString(message.etag))) + return "etag: buffer expected"; + return null; + }; + + /** + * Creates a Policy message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.iam.v1.Policy + * @static + * @param {Object.} object Plain object + * @returns {google.iam.v1.Policy} Policy + */ + Policy.fromObject = function fromObject(object) { + if (object instanceof $root.google.iam.v1.Policy) + return object; + var message = new $root.google.iam.v1.Policy(); + if (object.version != null) + message.version = object.version | 0; + if (object.bindings) { + if (!Array.isArray(object.bindings)) + throw TypeError(".google.iam.v1.Policy.bindings: array expected"); + message.bindings = []; + for (var i = 0; i < object.bindings.length; ++i) { + if (typeof object.bindings[i] !== "object") + throw TypeError(".google.iam.v1.Policy.bindings: object expected"); + message.bindings[i] = $root.google.iam.v1.Binding.fromObject(object.bindings[i]); + } + } + if (object.auditConfigs) { + if (!Array.isArray(object.auditConfigs)) + throw TypeError(".google.iam.v1.Policy.auditConfigs: array expected"); + message.auditConfigs = []; + for (var i = 0; i < object.auditConfigs.length; ++i) { + if (typeof object.auditConfigs[i] !== "object") + throw TypeError(".google.iam.v1.Policy.auditConfigs: object expected"); + message.auditConfigs[i] = $root.google.iam.v1.AuditConfig.fromObject(object.auditConfigs[i]); + } + } + if (object.etag != null) + if (typeof object.etag === "string") + $util.base64.decode(object.etag, message.etag = $util.newBuffer($util.base64.length(object.etag)), 0); + else if (object.etag.length >= 0) + message.etag = object.etag; + return message; + }; + + /** + * Creates a plain object from a Policy message. Also converts values to other types if specified. + * @function toObject + * @memberof google.iam.v1.Policy + * @static + * @param {google.iam.v1.Policy} message Policy + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Policy.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.bindings = []; + object.auditConfigs = []; + } + if (options.defaults) { + object.version = 0; + if (options.bytes === String) + object.etag = ""; + else { + object.etag = []; + if (options.bytes !== Array) + object.etag = $util.newBuffer(object.etag); + } + } + if (message.version != null && message.hasOwnProperty("version")) + object.version = message.version; + if (message.etag != null && message.hasOwnProperty("etag")) + object.etag = options.bytes === String ? $util.base64.encode(message.etag, 0, message.etag.length) : options.bytes === Array ? Array.prototype.slice.call(message.etag) : message.etag; + if (message.bindings && message.bindings.length) { + object.bindings = []; + for (var j = 0; j < message.bindings.length; ++j) + object.bindings[j] = $root.google.iam.v1.Binding.toObject(message.bindings[j], options); + } + if (message.auditConfigs && message.auditConfigs.length) { + object.auditConfigs = []; + for (var j = 0; j < message.auditConfigs.length; ++j) + object.auditConfigs[j] = $root.google.iam.v1.AuditConfig.toObject(message.auditConfigs[j], options); + } + return object; + }; + + /** + * Converts this Policy to JSON. + * @function toJSON + * @memberof google.iam.v1.Policy + * @instance + * @returns {Object.} JSON object + */ + Policy.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Policy + * @function getTypeUrl + * @memberof google.iam.v1.Policy + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Policy.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.iam.v1.Policy"; + }; + + return Policy; + })(); + + v1.Binding = (function() { + + /** + * Properties of a Binding. + * @memberof google.iam.v1 + * @interface IBinding + * @property {string|null} [role] Binding role + * @property {Array.|null} [members] Binding members + * @property {google.type.IExpr|null} [condition] Binding condition + */ + + /** + * Constructs a new Binding. + * @memberof google.iam.v1 + * @classdesc Represents a Binding. + * @implements IBinding + * @constructor + * @param {google.iam.v1.IBinding=} [properties] Properties to set + */ + function Binding(properties) { + this.members = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Binding role. + * @member {string} role + * @memberof google.iam.v1.Binding + * @instance + */ + Binding.prototype.role = ""; + + /** + * Binding members. + * @member {Array.} members + * @memberof google.iam.v1.Binding + * @instance + */ + Binding.prototype.members = $util.emptyArray; + + /** + * Binding condition. + * @member {google.type.IExpr|null|undefined} condition + * @memberof google.iam.v1.Binding + * @instance + */ + Binding.prototype.condition = null; + + /** + * Creates a new Binding instance using the specified properties. + * @function create + * @memberof google.iam.v1.Binding + * @static + * @param {google.iam.v1.IBinding=} [properties] Properties to set + * @returns {google.iam.v1.Binding} Binding instance + */ + Binding.create = function create(properties) { + return new Binding(properties); + }; + + /** + * Encodes the specified Binding message. Does not implicitly {@link google.iam.v1.Binding.verify|verify} messages. + * @function encode + * @memberof google.iam.v1.Binding + * @static + * @param {google.iam.v1.IBinding} message Binding message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Binding.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.role != null && Object.hasOwnProperty.call(message, "role")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.role); + if (message.members != null && message.members.length) + for (var i = 0; i < message.members.length; ++i) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.members[i]); + if (message.condition != null && Object.hasOwnProperty.call(message, "condition")) + $root.google.type.Expr.encode(message.condition, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified Binding message, length delimited. Does not implicitly {@link google.iam.v1.Binding.verify|verify} messages. + * @function encodeDelimited + * @memberof google.iam.v1.Binding + * @static + * @param {google.iam.v1.IBinding} message Binding message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Binding.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Binding message from the specified reader or buffer. + * @function decode + * @memberof google.iam.v1.Binding + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.iam.v1.Binding} Binding + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Binding.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.iam.v1.Binding(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.role = reader.string(); + break; + } + case 2: { + if (!(message.members && message.members.length)) + message.members = []; + message.members.push(reader.string()); + break; + } + case 3: { + message.condition = $root.google.type.Expr.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Binding message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.iam.v1.Binding + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.iam.v1.Binding} Binding + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Binding.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Binding message. + * @function verify + * @memberof google.iam.v1.Binding + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Binding.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.role != null && message.hasOwnProperty("role")) + if (!$util.isString(message.role)) + return "role: string expected"; + if (message.members != null && message.hasOwnProperty("members")) { + if (!Array.isArray(message.members)) + return "members: array expected"; + for (var i = 0; i < message.members.length; ++i) + if (!$util.isString(message.members[i])) + return "members: string[] expected"; + } + if (message.condition != null && message.hasOwnProperty("condition")) { + var error = $root.google.type.Expr.verify(message.condition); + if (error) + return "condition." + error; + } + return null; + }; + + /** + * Creates a Binding message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.iam.v1.Binding + * @static + * @param {Object.} object Plain object + * @returns {google.iam.v1.Binding} Binding + */ + Binding.fromObject = function fromObject(object) { + if (object instanceof $root.google.iam.v1.Binding) + return object; + var message = new $root.google.iam.v1.Binding(); + if (object.role != null) + message.role = String(object.role); + if (object.members) { + if (!Array.isArray(object.members)) + throw TypeError(".google.iam.v1.Binding.members: array expected"); + message.members = []; + for (var i = 0; i < object.members.length; ++i) + message.members[i] = String(object.members[i]); + } + if (object.condition != null) { + if (typeof object.condition !== "object") + throw TypeError(".google.iam.v1.Binding.condition: object expected"); + message.condition = $root.google.type.Expr.fromObject(object.condition); + } + return message; + }; + + /** + * Creates a plain object from a Binding message. Also converts values to other types if specified. + * @function toObject + * @memberof google.iam.v1.Binding + * @static + * @param {google.iam.v1.Binding} message Binding + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Binding.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.members = []; + if (options.defaults) { + object.role = ""; + object.condition = null; + } + if (message.role != null && message.hasOwnProperty("role")) + object.role = message.role; + if (message.members && message.members.length) { + object.members = []; + for (var j = 0; j < message.members.length; ++j) + object.members[j] = message.members[j]; + } + if (message.condition != null && message.hasOwnProperty("condition")) + object.condition = $root.google.type.Expr.toObject(message.condition, options); + return object; + }; + + /** + * Converts this Binding to JSON. + * @function toJSON + * @memberof google.iam.v1.Binding + * @instance + * @returns {Object.} JSON object + */ + Binding.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Binding + * @function getTypeUrl + * @memberof google.iam.v1.Binding + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Binding.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.iam.v1.Binding"; + }; + + return Binding; + })(); + + v1.AuditConfig = (function() { + + /** + * Properties of an AuditConfig. + * @memberof google.iam.v1 + * @interface IAuditConfig + * @property {string|null} [service] AuditConfig service + * @property {Array.|null} [auditLogConfigs] AuditConfig auditLogConfigs + */ + + /** + * Constructs a new AuditConfig. + * @memberof google.iam.v1 + * @classdesc Represents an AuditConfig. + * @implements IAuditConfig + * @constructor + * @param {google.iam.v1.IAuditConfig=} [properties] Properties to set + */ + function AuditConfig(properties) { + this.auditLogConfigs = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * AuditConfig service. + * @member {string} service + * @memberof google.iam.v1.AuditConfig + * @instance + */ + AuditConfig.prototype.service = ""; + + /** + * AuditConfig auditLogConfigs. + * @member {Array.} auditLogConfigs + * @memberof google.iam.v1.AuditConfig + * @instance + */ + AuditConfig.prototype.auditLogConfigs = $util.emptyArray; + + /** + * Creates a new AuditConfig instance using the specified properties. + * @function create + * @memberof google.iam.v1.AuditConfig + * @static + * @param {google.iam.v1.IAuditConfig=} [properties] Properties to set + * @returns {google.iam.v1.AuditConfig} AuditConfig instance + */ + AuditConfig.create = function create(properties) { + return new AuditConfig(properties); + }; + + /** + * Encodes the specified AuditConfig message. Does not implicitly {@link google.iam.v1.AuditConfig.verify|verify} messages. + * @function encode + * @memberof google.iam.v1.AuditConfig + * @static + * @param {google.iam.v1.IAuditConfig} message AuditConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AuditConfig.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.service != null && Object.hasOwnProperty.call(message, "service")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.service); + if (message.auditLogConfigs != null && message.auditLogConfigs.length) + for (var i = 0; i < message.auditLogConfigs.length; ++i) + $root.google.iam.v1.AuditLogConfig.encode(message.auditLogConfigs[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified AuditConfig message, length delimited. Does not implicitly {@link google.iam.v1.AuditConfig.verify|verify} messages. + * @function encodeDelimited + * @memberof google.iam.v1.AuditConfig + * @static + * @param {google.iam.v1.IAuditConfig} message AuditConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AuditConfig.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an AuditConfig message from the specified reader or buffer. + * @function decode + * @memberof google.iam.v1.AuditConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.iam.v1.AuditConfig} AuditConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AuditConfig.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.iam.v1.AuditConfig(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.service = reader.string(); + break; + } + case 3: { + if (!(message.auditLogConfigs && message.auditLogConfigs.length)) + message.auditLogConfigs = []; + message.auditLogConfigs.push($root.google.iam.v1.AuditLogConfig.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an AuditConfig message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.iam.v1.AuditConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.iam.v1.AuditConfig} AuditConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AuditConfig.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an AuditConfig message. + * @function verify + * @memberof google.iam.v1.AuditConfig + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + AuditConfig.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.service != null && message.hasOwnProperty("service")) + if (!$util.isString(message.service)) + return "service: string expected"; + if (message.auditLogConfigs != null && message.hasOwnProperty("auditLogConfigs")) { + if (!Array.isArray(message.auditLogConfigs)) + return "auditLogConfigs: array expected"; + for (var i = 0; i < message.auditLogConfigs.length; ++i) { + var error = $root.google.iam.v1.AuditLogConfig.verify(message.auditLogConfigs[i]); + if (error) + return "auditLogConfigs." + error; + } + } + return null; + }; + + /** + * Creates an AuditConfig message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.iam.v1.AuditConfig + * @static + * @param {Object.} object Plain object + * @returns {google.iam.v1.AuditConfig} AuditConfig + */ + AuditConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.iam.v1.AuditConfig) + return object; + var message = new $root.google.iam.v1.AuditConfig(); + if (object.service != null) + message.service = String(object.service); + if (object.auditLogConfigs) { + if (!Array.isArray(object.auditLogConfigs)) + throw TypeError(".google.iam.v1.AuditConfig.auditLogConfigs: array expected"); + message.auditLogConfigs = []; + for (var i = 0; i < object.auditLogConfigs.length; ++i) { + if (typeof object.auditLogConfigs[i] !== "object") + throw TypeError(".google.iam.v1.AuditConfig.auditLogConfigs: object expected"); + message.auditLogConfigs[i] = $root.google.iam.v1.AuditLogConfig.fromObject(object.auditLogConfigs[i]); + } + } + return message; + }; + + /** + * Creates a plain object from an AuditConfig message. Also converts values to other types if specified. + * @function toObject + * @memberof google.iam.v1.AuditConfig + * @static + * @param {google.iam.v1.AuditConfig} message AuditConfig + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + AuditConfig.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.auditLogConfigs = []; + if (options.defaults) + object.service = ""; + if (message.service != null && message.hasOwnProperty("service")) + object.service = message.service; + if (message.auditLogConfigs && message.auditLogConfigs.length) { + object.auditLogConfigs = []; + for (var j = 0; j < message.auditLogConfigs.length; ++j) + object.auditLogConfigs[j] = $root.google.iam.v1.AuditLogConfig.toObject(message.auditLogConfigs[j], options); + } + return object; + }; + + /** + * Converts this AuditConfig to JSON. + * @function toJSON + * @memberof google.iam.v1.AuditConfig + * @instance + * @returns {Object.} JSON object + */ + AuditConfig.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for AuditConfig + * @function getTypeUrl + * @memberof google.iam.v1.AuditConfig + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + AuditConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.iam.v1.AuditConfig"; + }; + + return AuditConfig; + })(); + + v1.AuditLogConfig = (function() { + + /** + * Properties of an AuditLogConfig. + * @memberof google.iam.v1 + * @interface IAuditLogConfig + * @property {google.iam.v1.AuditLogConfig.LogType|null} [logType] AuditLogConfig logType + * @property {Array.|null} [exemptedMembers] AuditLogConfig exemptedMembers + */ + + /** + * Constructs a new AuditLogConfig. + * @memberof google.iam.v1 + * @classdesc Represents an AuditLogConfig. + * @implements IAuditLogConfig + * @constructor + * @param {google.iam.v1.IAuditLogConfig=} [properties] Properties to set + */ + function AuditLogConfig(properties) { + this.exemptedMembers = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * AuditLogConfig logType. + * @member {google.iam.v1.AuditLogConfig.LogType} logType + * @memberof google.iam.v1.AuditLogConfig + * @instance + */ + AuditLogConfig.prototype.logType = 0; + + /** + * AuditLogConfig exemptedMembers. + * @member {Array.} exemptedMembers + * @memberof google.iam.v1.AuditLogConfig + * @instance + */ + AuditLogConfig.prototype.exemptedMembers = $util.emptyArray; + + /** + * Creates a new AuditLogConfig instance using the specified properties. + * @function create + * @memberof google.iam.v1.AuditLogConfig + * @static + * @param {google.iam.v1.IAuditLogConfig=} [properties] Properties to set + * @returns {google.iam.v1.AuditLogConfig} AuditLogConfig instance + */ + AuditLogConfig.create = function create(properties) { + return new AuditLogConfig(properties); + }; + + /** + * Encodes the specified AuditLogConfig message. Does not implicitly {@link google.iam.v1.AuditLogConfig.verify|verify} messages. + * @function encode + * @memberof google.iam.v1.AuditLogConfig + * @static + * @param {google.iam.v1.IAuditLogConfig} message AuditLogConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AuditLogConfig.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.logType != null && Object.hasOwnProperty.call(message, "logType")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.logType); + if (message.exemptedMembers != null && message.exemptedMembers.length) + for (var i = 0; i < message.exemptedMembers.length; ++i) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.exemptedMembers[i]); + return writer; + }; + + /** + * Encodes the specified AuditLogConfig message, length delimited. Does not implicitly {@link google.iam.v1.AuditLogConfig.verify|verify} messages. + * @function encodeDelimited + * @memberof google.iam.v1.AuditLogConfig + * @static + * @param {google.iam.v1.IAuditLogConfig} message AuditLogConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AuditLogConfig.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an AuditLogConfig message from the specified reader or buffer. + * @function decode + * @memberof google.iam.v1.AuditLogConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.iam.v1.AuditLogConfig} AuditLogConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AuditLogConfig.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.iam.v1.AuditLogConfig(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.logType = reader.int32(); + break; + } + case 2: { + if (!(message.exemptedMembers && message.exemptedMembers.length)) + message.exemptedMembers = []; + message.exemptedMembers.push(reader.string()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an AuditLogConfig message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.iam.v1.AuditLogConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.iam.v1.AuditLogConfig} AuditLogConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AuditLogConfig.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an AuditLogConfig message. + * @function verify + * @memberof google.iam.v1.AuditLogConfig + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + AuditLogConfig.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.logType != null && message.hasOwnProperty("logType")) + switch (message.logType) { + default: + return "logType: enum value expected"; + case 0: + case 1: + case 2: + case 3: + break; + } + if (message.exemptedMembers != null && message.hasOwnProperty("exemptedMembers")) { + if (!Array.isArray(message.exemptedMembers)) + return "exemptedMembers: array expected"; + for (var i = 0; i < message.exemptedMembers.length; ++i) + if (!$util.isString(message.exemptedMembers[i])) + return "exemptedMembers: string[] expected"; + } + return null; + }; + + /** + * Creates an AuditLogConfig message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.iam.v1.AuditLogConfig + * @static + * @param {Object.} object Plain object + * @returns {google.iam.v1.AuditLogConfig} AuditLogConfig + */ + AuditLogConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.iam.v1.AuditLogConfig) + return object; + var message = new $root.google.iam.v1.AuditLogConfig(); + switch (object.logType) { + default: + if (typeof object.logType === "number") { + message.logType = object.logType; + break; + } + break; + case "LOG_TYPE_UNSPECIFIED": + case 0: + message.logType = 0; + break; + case "ADMIN_READ": + case 1: + message.logType = 1; + break; + case "DATA_WRITE": + case 2: + message.logType = 2; + break; + case "DATA_READ": + case 3: + message.logType = 3; + break; + } + if (object.exemptedMembers) { + if (!Array.isArray(object.exemptedMembers)) + throw TypeError(".google.iam.v1.AuditLogConfig.exemptedMembers: array expected"); + message.exemptedMembers = []; + for (var i = 0; i < object.exemptedMembers.length; ++i) + message.exemptedMembers[i] = String(object.exemptedMembers[i]); + } + return message; + }; + + /** + * Creates a plain object from an AuditLogConfig message. Also converts values to other types if specified. + * @function toObject + * @memberof google.iam.v1.AuditLogConfig + * @static + * @param {google.iam.v1.AuditLogConfig} message AuditLogConfig + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + AuditLogConfig.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.exemptedMembers = []; + if (options.defaults) + object.logType = options.enums === String ? "LOG_TYPE_UNSPECIFIED" : 0; + if (message.logType != null && message.hasOwnProperty("logType")) + object.logType = options.enums === String ? $root.google.iam.v1.AuditLogConfig.LogType[message.logType] === undefined ? message.logType : $root.google.iam.v1.AuditLogConfig.LogType[message.logType] : message.logType; + if (message.exemptedMembers && message.exemptedMembers.length) { + object.exemptedMembers = []; + for (var j = 0; j < message.exemptedMembers.length; ++j) + object.exemptedMembers[j] = message.exemptedMembers[j]; + } + return object; + }; + + /** + * Converts this AuditLogConfig to JSON. + * @function toJSON + * @memberof google.iam.v1.AuditLogConfig + * @instance + * @returns {Object.} JSON object + */ + AuditLogConfig.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for AuditLogConfig + * @function getTypeUrl + * @memberof google.iam.v1.AuditLogConfig + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + AuditLogConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.iam.v1.AuditLogConfig"; + }; + + /** + * LogType enum. + * @name google.iam.v1.AuditLogConfig.LogType + * @enum {number} + * @property {number} LOG_TYPE_UNSPECIFIED=0 LOG_TYPE_UNSPECIFIED value + * @property {number} ADMIN_READ=1 ADMIN_READ value + * @property {number} DATA_WRITE=2 DATA_WRITE value + * @property {number} DATA_READ=3 DATA_READ value + */ + AuditLogConfig.LogType = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "LOG_TYPE_UNSPECIFIED"] = 0; + values[valuesById[1] = "ADMIN_READ"] = 1; + values[valuesById[2] = "DATA_WRITE"] = 2; + values[valuesById[3] = "DATA_READ"] = 3; + return values; + })(); + + return AuditLogConfig; + })(); + + v1.PolicyDelta = (function() { + + /** + * Properties of a PolicyDelta. + * @memberof google.iam.v1 + * @interface IPolicyDelta + * @property {Array.|null} [bindingDeltas] PolicyDelta bindingDeltas + * @property {Array.|null} [auditConfigDeltas] PolicyDelta auditConfigDeltas + */ + + /** + * Constructs a new PolicyDelta. + * @memberof google.iam.v1 + * @classdesc Represents a PolicyDelta. + * @implements IPolicyDelta + * @constructor + * @param {google.iam.v1.IPolicyDelta=} [properties] Properties to set + */ + function PolicyDelta(properties) { + this.bindingDeltas = []; + this.auditConfigDeltas = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * PolicyDelta bindingDeltas. + * @member {Array.} bindingDeltas + * @memberof google.iam.v1.PolicyDelta + * @instance + */ + PolicyDelta.prototype.bindingDeltas = $util.emptyArray; + + /** + * PolicyDelta auditConfigDeltas. + * @member {Array.} auditConfigDeltas + * @memberof google.iam.v1.PolicyDelta + * @instance + */ + PolicyDelta.prototype.auditConfigDeltas = $util.emptyArray; + + /** + * Creates a new PolicyDelta instance using the specified properties. + * @function create + * @memberof google.iam.v1.PolicyDelta + * @static + * @param {google.iam.v1.IPolicyDelta=} [properties] Properties to set + * @returns {google.iam.v1.PolicyDelta} PolicyDelta instance + */ + PolicyDelta.create = function create(properties) { + return new PolicyDelta(properties); + }; + + /** + * Encodes the specified PolicyDelta message. Does not implicitly {@link google.iam.v1.PolicyDelta.verify|verify} messages. + * @function encode + * @memberof google.iam.v1.PolicyDelta + * @static + * @param {google.iam.v1.IPolicyDelta} message PolicyDelta message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PolicyDelta.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.bindingDeltas != null && message.bindingDeltas.length) + for (var i = 0; i < message.bindingDeltas.length; ++i) + $root.google.iam.v1.BindingDelta.encode(message.bindingDeltas[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.auditConfigDeltas != null && message.auditConfigDeltas.length) + for (var i = 0; i < message.auditConfigDeltas.length; ++i) + $root.google.iam.v1.AuditConfigDelta.encode(message.auditConfigDeltas[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified PolicyDelta message, length delimited. Does not implicitly {@link google.iam.v1.PolicyDelta.verify|verify} messages. + * @function encodeDelimited + * @memberof google.iam.v1.PolicyDelta + * @static + * @param {google.iam.v1.IPolicyDelta} message PolicyDelta message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PolicyDelta.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a PolicyDelta message from the specified reader or buffer. + * @function decode + * @memberof google.iam.v1.PolicyDelta + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.iam.v1.PolicyDelta} PolicyDelta + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PolicyDelta.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.iam.v1.PolicyDelta(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.bindingDeltas && message.bindingDeltas.length)) + message.bindingDeltas = []; + message.bindingDeltas.push($root.google.iam.v1.BindingDelta.decode(reader, reader.uint32())); + break; + } + case 2: { + if (!(message.auditConfigDeltas && message.auditConfigDeltas.length)) + message.auditConfigDeltas = []; + message.auditConfigDeltas.push($root.google.iam.v1.AuditConfigDelta.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a PolicyDelta message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.iam.v1.PolicyDelta + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.iam.v1.PolicyDelta} PolicyDelta + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PolicyDelta.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a PolicyDelta message. + * @function verify + * @memberof google.iam.v1.PolicyDelta + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + PolicyDelta.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.bindingDeltas != null && message.hasOwnProperty("bindingDeltas")) { + if (!Array.isArray(message.bindingDeltas)) + return "bindingDeltas: array expected"; + for (var i = 0; i < message.bindingDeltas.length; ++i) { + var error = $root.google.iam.v1.BindingDelta.verify(message.bindingDeltas[i]); + if (error) + return "bindingDeltas." + error; + } + } + if (message.auditConfigDeltas != null && message.hasOwnProperty("auditConfigDeltas")) { + if (!Array.isArray(message.auditConfigDeltas)) + return "auditConfigDeltas: array expected"; + for (var i = 0; i < message.auditConfigDeltas.length; ++i) { + var error = $root.google.iam.v1.AuditConfigDelta.verify(message.auditConfigDeltas[i]); + if (error) + return "auditConfigDeltas." + error; + } + } + return null; + }; + + /** + * Creates a PolicyDelta message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.iam.v1.PolicyDelta + * @static + * @param {Object.} object Plain object + * @returns {google.iam.v1.PolicyDelta} PolicyDelta + */ + PolicyDelta.fromObject = function fromObject(object) { + if (object instanceof $root.google.iam.v1.PolicyDelta) + return object; + var message = new $root.google.iam.v1.PolicyDelta(); + if (object.bindingDeltas) { + if (!Array.isArray(object.bindingDeltas)) + throw TypeError(".google.iam.v1.PolicyDelta.bindingDeltas: array expected"); + message.bindingDeltas = []; + for (var i = 0; i < object.bindingDeltas.length; ++i) { + if (typeof object.bindingDeltas[i] !== "object") + throw TypeError(".google.iam.v1.PolicyDelta.bindingDeltas: object expected"); + message.bindingDeltas[i] = $root.google.iam.v1.BindingDelta.fromObject(object.bindingDeltas[i]); + } + } + if (object.auditConfigDeltas) { + if (!Array.isArray(object.auditConfigDeltas)) + throw TypeError(".google.iam.v1.PolicyDelta.auditConfigDeltas: array expected"); + message.auditConfigDeltas = []; + for (var i = 0; i < object.auditConfigDeltas.length; ++i) { + if (typeof object.auditConfigDeltas[i] !== "object") + throw TypeError(".google.iam.v1.PolicyDelta.auditConfigDeltas: object expected"); + message.auditConfigDeltas[i] = $root.google.iam.v1.AuditConfigDelta.fromObject(object.auditConfigDeltas[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a PolicyDelta message. Also converts values to other types if specified. + * @function toObject + * @memberof google.iam.v1.PolicyDelta + * @static + * @param {google.iam.v1.PolicyDelta} message PolicyDelta + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + PolicyDelta.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.bindingDeltas = []; + object.auditConfigDeltas = []; + } + if (message.bindingDeltas && message.bindingDeltas.length) { + object.bindingDeltas = []; + for (var j = 0; j < message.bindingDeltas.length; ++j) + object.bindingDeltas[j] = $root.google.iam.v1.BindingDelta.toObject(message.bindingDeltas[j], options); + } + if (message.auditConfigDeltas && message.auditConfigDeltas.length) { + object.auditConfigDeltas = []; + for (var j = 0; j < message.auditConfigDeltas.length; ++j) + object.auditConfigDeltas[j] = $root.google.iam.v1.AuditConfigDelta.toObject(message.auditConfigDeltas[j], options); + } + return object; + }; + + /** + * Converts this PolicyDelta to JSON. + * @function toJSON + * @memberof google.iam.v1.PolicyDelta + * @instance + * @returns {Object.} JSON object + */ + PolicyDelta.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for PolicyDelta + * @function getTypeUrl + * @memberof google.iam.v1.PolicyDelta + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + PolicyDelta.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.iam.v1.PolicyDelta"; + }; + + return PolicyDelta; + })(); + + v1.BindingDelta = (function() { + + /** + * Properties of a BindingDelta. + * @memberof google.iam.v1 + * @interface IBindingDelta + * @property {google.iam.v1.BindingDelta.Action|null} [action] BindingDelta action + * @property {string|null} [role] BindingDelta role + * @property {string|null} [member] BindingDelta member + * @property {google.type.IExpr|null} [condition] BindingDelta condition + */ + + /** + * Constructs a new BindingDelta. + * @memberof google.iam.v1 + * @classdesc Represents a BindingDelta. + * @implements IBindingDelta + * @constructor + * @param {google.iam.v1.IBindingDelta=} [properties] Properties to set + */ + function BindingDelta(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * BindingDelta action. + * @member {google.iam.v1.BindingDelta.Action} action + * @memberof google.iam.v1.BindingDelta + * @instance + */ + BindingDelta.prototype.action = 0; + + /** + * BindingDelta role. + * @member {string} role + * @memberof google.iam.v1.BindingDelta + * @instance + */ + BindingDelta.prototype.role = ""; + + /** + * BindingDelta member. + * @member {string} member + * @memberof google.iam.v1.BindingDelta + * @instance + */ + BindingDelta.prototype.member = ""; + + /** + * BindingDelta condition. + * @member {google.type.IExpr|null|undefined} condition + * @memberof google.iam.v1.BindingDelta + * @instance + */ + BindingDelta.prototype.condition = null; + + /** + * Creates a new BindingDelta instance using the specified properties. + * @function create + * @memberof google.iam.v1.BindingDelta + * @static + * @param {google.iam.v1.IBindingDelta=} [properties] Properties to set + * @returns {google.iam.v1.BindingDelta} BindingDelta instance + */ + BindingDelta.create = function create(properties) { + return new BindingDelta(properties); + }; + + /** + * Encodes the specified BindingDelta message. Does not implicitly {@link google.iam.v1.BindingDelta.verify|verify} messages. + * @function encode + * @memberof google.iam.v1.BindingDelta + * @static + * @param {google.iam.v1.IBindingDelta} message BindingDelta message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BindingDelta.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.action != null && Object.hasOwnProperty.call(message, "action")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.action); + if (message.role != null && Object.hasOwnProperty.call(message, "role")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.role); + if (message.member != null && Object.hasOwnProperty.call(message, "member")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.member); + if (message.condition != null && Object.hasOwnProperty.call(message, "condition")) + $root.google.type.Expr.encode(message.condition, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified BindingDelta message, length delimited. Does not implicitly {@link google.iam.v1.BindingDelta.verify|verify} messages. + * @function encodeDelimited + * @memberof google.iam.v1.BindingDelta + * @static + * @param {google.iam.v1.IBindingDelta} message BindingDelta message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BindingDelta.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a BindingDelta message from the specified reader or buffer. + * @function decode + * @memberof google.iam.v1.BindingDelta + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.iam.v1.BindingDelta} BindingDelta + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BindingDelta.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.iam.v1.BindingDelta(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.action = reader.int32(); + break; + } + case 2: { + message.role = reader.string(); + break; + } + case 3: { + message.member = reader.string(); + break; + } + case 4: { + message.condition = $root.google.type.Expr.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a BindingDelta message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.iam.v1.BindingDelta + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.iam.v1.BindingDelta} BindingDelta + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BindingDelta.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a BindingDelta message. + * @function verify + * @memberof google.iam.v1.BindingDelta + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + BindingDelta.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.action != null && message.hasOwnProperty("action")) + switch (message.action) { + default: + return "action: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.role != null && message.hasOwnProperty("role")) + if (!$util.isString(message.role)) + return "role: string expected"; + if (message.member != null && message.hasOwnProperty("member")) + if (!$util.isString(message.member)) + return "member: string expected"; + if (message.condition != null && message.hasOwnProperty("condition")) { + var error = $root.google.type.Expr.verify(message.condition); + if (error) + return "condition." + error; + } + return null; + }; + + /** + * Creates a BindingDelta message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.iam.v1.BindingDelta + * @static + * @param {Object.} object Plain object + * @returns {google.iam.v1.BindingDelta} BindingDelta + */ + BindingDelta.fromObject = function fromObject(object) { + if (object instanceof $root.google.iam.v1.BindingDelta) + return object; + var message = new $root.google.iam.v1.BindingDelta(); + switch (object.action) { + default: + if (typeof object.action === "number") { + message.action = object.action; + break; + } + break; + case "ACTION_UNSPECIFIED": + case 0: + message.action = 0; + break; + case "ADD": + case 1: + message.action = 1; + break; + case "REMOVE": + case 2: + message.action = 2; + break; + } + if (object.role != null) + message.role = String(object.role); + if (object.member != null) + message.member = String(object.member); + if (object.condition != null) { + if (typeof object.condition !== "object") + throw TypeError(".google.iam.v1.BindingDelta.condition: object expected"); + message.condition = $root.google.type.Expr.fromObject(object.condition); + } + return message; + }; + + /** + * Creates a plain object from a BindingDelta message. Also converts values to other types if specified. + * @function toObject + * @memberof google.iam.v1.BindingDelta + * @static + * @param {google.iam.v1.BindingDelta} message BindingDelta + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + BindingDelta.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.action = options.enums === String ? "ACTION_UNSPECIFIED" : 0; + object.role = ""; + object.member = ""; + object.condition = null; + } + if (message.action != null && message.hasOwnProperty("action")) + object.action = options.enums === String ? $root.google.iam.v1.BindingDelta.Action[message.action] === undefined ? message.action : $root.google.iam.v1.BindingDelta.Action[message.action] : message.action; + if (message.role != null && message.hasOwnProperty("role")) + object.role = message.role; + if (message.member != null && message.hasOwnProperty("member")) + object.member = message.member; + if (message.condition != null && message.hasOwnProperty("condition")) + object.condition = $root.google.type.Expr.toObject(message.condition, options); + return object; + }; + + /** + * Converts this BindingDelta to JSON. + * @function toJSON + * @memberof google.iam.v1.BindingDelta + * @instance + * @returns {Object.} JSON object + */ + BindingDelta.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for BindingDelta + * @function getTypeUrl + * @memberof google.iam.v1.BindingDelta + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + BindingDelta.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.iam.v1.BindingDelta"; + }; + + /** + * Action enum. + * @name google.iam.v1.BindingDelta.Action + * @enum {number} + * @property {number} ACTION_UNSPECIFIED=0 ACTION_UNSPECIFIED value + * @property {number} ADD=1 ADD value + * @property {number} REMOVE=2 REMOVE value + */ + BindingDelta.Action = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "ACTION_UNSPECIFIED"] = 0; + values[valuesById[1] = "ADD"] = 1; + values[valuesById[2] = "REMOVE"] = 2; + return values; + })(); + + return BindingDelta; + })(); + + v1.AuditConfigDelta = (function() { + + /** + * Properties of an AuditConfigDelta. + * @memberof google.iam.v1 + * @interface IAuditConfigDelta + * @property {google.iam.v1.AuditConfigDelta.Action|null} [action] AuditConfigDelta action + * @property {string|null} [service] AuditConfigDelta service + * @property {string|null} [exemptedMember] AuditConfigDelta exemptedMember + * @property {string|null} [logType] AuditConfigDelta logType + */ + + /** + * Constructs a new AuditConfigDelta. + * @memberof google.iam.v1 + * @classdesc Represents an AuditConfigDelta. + * @implements IAuditConfigDelta + * @constructor + * @param {google.iam.v1.IAuditConfigDelta=} [properties] Properties to set + */ + function AuditConfigDelta(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * AuditConfigDelta action. + * @member {google.iam.v1.AuditConfigDelta.Action} action + * @memberof google.iam.v1.AuditConfigDelta + * @instance + */ + AuditConfigDelta.prototype.action = 0; + + /** + * AuditConfigDelta service. + * @member {string} service + * @memberof google.iam.v1.AuditConfigDelta + * @instance + */ + AuditConfigDelta.prototype.service = ""; + + /** + * AuditConfigDelta exemptedMember. + * @member {string} exemptedMember + * @memberof google.iam.v1.AuditConfigDelta + * @instance + */ + AuditConfigDelta.prototype.exemptedMember = ""; + + /** + * AuditConfigDelta logType. + * @member {string} logType + * @memberof google.iam.v1.AuditConfigDelta + * @instance + */ + AuditConfigDelta.prototype.logType = ""; + + /** + * Creates a new AuditConfigDelta instance using the specified properties. + * @function create + * @memberof google.iam.v1.AuditConfigDelta + * @static + * @param {google.iam.v1.IAuditConfigDelta=} [properties] Properties to set + * @returns {google.iam.v1.AuditConfigDelta} AuditConfigDelta instance + */ + AuditConfigDelta.create = function create(properties) { + return new AuditConfigDelta(properties); + }; + + /** + * Encodes the specified AuditConfigDelta message. Does not implicitly {@link google.iam.v1.AuditConfigDelta.verify|verify} messages. + * @function encode + * @memberof google.iam.v1.AuditConfigDelta + * @static + * @param {google.iam.v1.IAuditConfigDelta} message AuditConfigDelta message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AuditConfigDelta.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.action != null && Object.hasOwnProperty.call(message, "action")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.action); + if (message.service != null && Object.hasOwnProperty.call(message, "service")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.service); + if (message.exemptedMember != null && Object.hasOwnProperty.call(message, "exemptedMember")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.exemptedMember); + if (message.logType != null && Object.hasOwnProperty.call(message, "logType")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.logType); + return writer; + }; + + /** + * Encodes the specified AuditConfigDelta message, length delimited. Does not implicitly {@link google.iam.v1.AuditConfigDelta.verify|verify} messages. + * @function encodeDelimited + * @memberof google.iam.v1.AuditConfigDelta + * @static + * @param {google.iam.v1.IAuditConfigDelta} message AuditConfigDelta message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AuditConfigDelta.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an AuditConfigDelta message from the specified reader or buffer. + * @function decode + * @memberof google.iam.v1.AuditConfigDelta + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.iam.v1.AuditConfigDelta} AuditConfigDelta + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AuditConfigDelta.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.iam.v1.AuditConfigDelta(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.action = reader.int32(); + break; + } + case 2: { + message.service = reader.string(); + break; + } + case 3: { + message.exemptedMember = reader.string(); + break; + } + case 4: { + message.logType = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an AuditConfigDelta message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.iam.v1.AuditConfigDelta + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.iam.v1.AuditConfigDelta} AuditConfigDelta + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AuditConfigDelta.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an AuditConfigDelta message. + * @function verify + * @memberof google.iam.v1.AuditConfigDelta + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + AuditConfigDelta.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.action != null && message.hasOwnProperty("action")) + switch (message.action) { + default: + return "action: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.service != null && message.hasOwnProperty("service")) + if (!$util.isString(message.service)) + return "service: string expected"; + if (message.exemptedMember != null && message.hasOwnProperty("exemptedMember")) + if (!$util.isString(message.exemptedMember)) + return "exemptedMember: string expected"; + if (message.logType != null && message.hasOwnProperty("logType")) + if (!$util.isString(message.logType)) + return "logType: string expected"; + return null; + }; + + /** + * Creates an AuditConfigDelta message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.iam.v1.AuditConfigDelta + * @static + * @param {Object.} object Plain object + * @returns {google.iam.v1.AuditConfigDelta} AuditConfigDelta + */ + AuditConfigDelta.fromObject = function fromObject(object) { + if (object instanceof $root.google.iam.v1.AuditConfigDelta) + return object; + var message = new $root.google.iam.v1.AuditConfigDelta(); + switch (object.action) { + default: + if (typeof object.action === "number") { + message.action = object.action; + break; + } + break; + case "ACTION_UNSPECIFIED": + case 0: + message.action = 0; + break; + case "ADD": + case 1: + message.action = 1; + break; + case "REMOVE": + case 2: + message.action = 2; + break; + } + if (object.service != null) + message.service = String(object.service); + if (object.exemptedMember != null) + message.exemptedMember = String(object.exemptedMember); + if (object.logType != null) + message.logType = String(object.logType); + return message; + }; + + /** + * Creates a plain object from an AuditConfigDelta message. Also converts values to other types if specified. + * @function toObject + * @memberof google.iam.v1.AuditConfigDelta + * @static + * @param {google.iam.v1.AuditConfigDelta} message AuditConfigDelta + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + AuditConfigDelta.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.action = options.enums === String ? "ACTION_UNSPECIFIED" : 0; + object.service = ""; + object.exemptedMember = ""; + object.logType = ""; + } + if (message.action != null && message.hasOwnProperty("action")) + object.action = options.enums === String ? $root.google.iam.v1.AuditConfigDelta.Action[message.action] === undefined ? message.action : $root.google.iam.v1.AuditConfigDelta.Action[message.action] : message.action; + if (message.service != null && message.hasOwnProperty("service")) + object.service = message.service; + if (message.exemptedMember != null && message.hasOwnProperty("exemptedMember")) + object.exemptedMember = message.exemptedMember; + if (message.logType != null && message.hasOwnProperty("logType")) + object.logType = message.logType; + return object; + }; + + /** + * Converts this AuditConfigDelta to JSON. + * @function toJSON + * @memberof google.iam.v1.AuditConfigDelta + * @instance + * @returns {Object.} JSON object + */ + AuditConfigDelta.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for AuditConfigDelta + * @function getTypeUrl + * @memberof google.iam.v1.AuditConfigDelta + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + AuditConfigDelta.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.iam.v1.AuditConfigDelta"; + }; + + /** + * Action enum. + * @name google.iam.v1.AuditConfigDelta.Action + * @enum {number} + * @property {number} ACTION_UNSPECIFIED=0 ACTION_UNSPECIFIED value + * @property {number} ADD=1 ADD value + * @property {number} REMOVE=2 REMOVE value + */ + AuditConfigDelta.Action = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "ACTION_UNSPECIFIED"] = 0; + values[valuesById[1] = "ADD"] = 1; + values[valuesById[2] = "REMOVE"] = 2; + return values; + })(); + + return AuditConfigDelta; + })(); + + return v1; + })(); + + return iam; + })(); + + google.type = (function() { + + /** + * Namespace type. + * @memberof google + * @namespace + */ + var type = {}; + + type.Expr = (function() { + + /** + * Properties of an Expr. + * @memberof google.type + * @interface IExpr + * @property {string|null} [expression] Expr expression + * @property {string|null} [title] Expr title + * @property {string|null} [description] Expr description + * @property {string|null} [location] Expr location + */ + + /** + * Constructs a new Expr. + * @memberof google.type + * @classdesc Represents an Expr. + * @implements IExpr + * @constructor + * @param {google.type.IExpr=} [properties] Properties to set + */ + function Expr(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Expr expression. + * @member {string} expression + * @memberof google.type.Expr + * @instance + */ + Expr.prototype.expression = ""; + + /** + * Expr title. + * @member {string} title + * @memberof google.type.Expr + * @instance + */ + Expr.prototype.title = ""; + + /** + * Expr description. + * @member {string} description + * @memberof google.type.Expr + * @instance + */ + Expr.prototype.description = ""; + + /** + * Expr location. + * @member {string} location + * @memberof google.type.Expr + * @instance + */ + Expr.prototype.location = ""; + + /** + * Creates a new Expr instance using the specified properties. + * @function create + * @memberof google.type.Expr + * @static + * @param {google.type.IExpr=} [properties] Properties to set + * @returns {google.type.Expr} Expr instance + */ + Expr.create = function create(properties) { + return new Expr(properties); + }; + + /** + * Encodes the specified Expr message. Does not implicitly {@link google.type.Expr.verify|verify} messages. + * @function encode + * @memberof google.type.Expr + * @static + * @param {google.type.IExpr} message Expr message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Expr.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.expression != null && Object.hasOwnProperty.call(message, "expression")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.expression); + if (message.title != null && Object.hasOwnProperty.call(message, "title")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.title); + if (message.description != null && Object.hasOwnProperty.call(message, "description")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.description); + if (message.location != null && Object.hasOwnProperty.call(message, "location")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.location); + return writer; + }; + + /** + * Encodes the specified Expr message, length delimited. Does not implicitly {@link google.type.Expr.verify|verify} messages. + * @function encodeDelimited + * @memberof google.type.Expr + * @static + * @param {google.type.IExpr} message Expr message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Expr.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an Expr message from the specified reader or buffer. + * @function decode + * @memberof google.type.Expr + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.type.Expr} Expr + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Expr.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.type.Expr(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.expression = reader.string(); + break; + } + case 2: { + message.title = reader.string(); + break; + } + case 3: { + message.description = reader.string(); + break; + } + case 4: { + message.location = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an Expr message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.type.Expr + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.type.Expr} Expr + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Expr.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an Expr message. + * @function verify + * @memberof google.type.Expr + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Expr.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.expression != null && message.hasOwnProperty("expression")) + if (!$util.isString(message.expression)) + return "expression: string expected"; + if (message.title != null && message.hasOwnProperty("title")) + if (!$util.isString(message.title)) + return "title: string expected"; + if (message.description != null && message.hasOwnProperty("description")) + if (!$util.isString(message.description)) + return "description: string expected"; + if (message.location != null && message.hasOwnProperty("location")) + if (!$util.isString(message.location)) + return "location: string expected"; + return null; + }; + + /** + * Creates an Expr message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.type.Expr + * @static + * @param {Object.} object Plain object + * @returns {google.type.Expr} Expr + */ + Expr.fromObject = function fromObject(object) { + if (object instanceof $root.google.type.Expr) + return object; + var message = new $root.google.type.Expr(); + if (object.expression != null) + message.expression = String(object.expression); + if (object.title != null) + message.title = String(object.title); + if (object.description != null) + message.description = String(object.description); + if (object.location != null) + message.location = String(object.location); + return message; + }; + + /** + * Creates a plain object from an Expr message. Also converts values to other types if specified. + * @function toObject + * @memberof google.type.Expr + * @static + * @param {google.type.Expr} message Expr + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Expr.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.expression = ""; + object.title = ""; + object.description = ""; + object.location = ""; + } + if (message.expression != null && message.hasOwnProperty("expression")) + object.expression = message.expression; + if (message.title != null && message.hasOwnProperty("title")) + object.title = message.title; + if (message.description != null && message.hasOwnProperty("description")) + object.description = message.description; + if (message.location != null && message.hasOwnProperty("location")) + object.location = message.location; + return object; + }; + + /** + * Converts this Expr to JSON. + * @function toJSON + * @memberof google.type.Expr + * @instance + * @returns {Object.} JSON object + */ + Expr.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Expr + * @function getTypeUrl + * @memberof google.type.Expr + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Expr.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.type.Expr"; + }; + + return Expr; + })(); + + type.Date = (function() { + + /** + * Properties of a Date. + * @memberof google.type + * @interface IDate + * @property {number|null} [year] Date year + * @property {number|null} [month] Date month + * @property {number|null} [day] Date day + */ + + /** + * Constructs a new Date. + * @memberof google.type + * @classdesc Represents a Date. + * @implements IDate + * @constructor + * @param {google.type.IDate=} [properties] Properties to set + */ + function Date(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Date year. + * @member {number} year + * @memberof google.type.Date + * @instance + */ + Date.prototype.year = 0; + + /** + * Date month. + * @member {number} month + * @memberof google.type.Date + * @instance + */ + Date.prototype.month = 0; + + /** + * Date day. + * @member {number} day + * @memberof google.type.Date + * @instance + */ + Date.prototype.day = 0; + + /** + * Creates a new Date instance using the specified properties. + * @function create + * @memberof google.type.Date + * @static + * @param {google.type.IDate=} [properties] Properties to set + * @returns {google.type.Date} Date instance + */ + Date.create = function create(properties) { + return new Date(properties); + }; + + /** + * Encodes the specified Date message. Does not implicitly {@link google.type.Date.verify|verify} messages. + * @function encode + * @memberof google.type.Date + * @static + * @param {google.type.IDate} message Date message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Date.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.year != null && Object.hasOwnProperty.call(message, "year")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.year); + if (message.month != null && Object.hasOwnProperty.call(message, "month")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.month); + if (message.day != null && Object.hasOwnProperty.call(message, "day")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.day); + return writer; + }; + + /** + * Encodes the specified Date message, length delimited. Does not implicitly {@link google.type.Date.verify|verify} messages. + * @function encodeDelimited + * @memberof google.type.Date + * @static + * @param {google.type.IDate} message Date message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Date.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Date message from the specified reader or buffer. + * @function decode + * @memberof google.type.Date + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.type.Date} Date + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Date.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.type.Date(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.year = reader.int32(); + break; + } + case 2: { + message.month = reader.int32(); + break; + } + case 3: { + message.day = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Date message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.type.Date + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.type.Date} Date + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Date.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Date message. + * @function verify + * @memberof google.type.Date + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Date.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.year != null && message.hasOwnProperty("year")) + if (!$util.isInteger(message.year)) + return "year: integer expected"; + if (message.month != null && message.hasOwnProperty("month")) + if (!$util.isInteger(message.month)) + return "month: integer expected"; + if (message.day != null && message.hasOwnProperty("day")) + if (!$util.isInteger(message.day)) + return "day: integer expected"; + return null; + }; + + /** + * Creates a Date message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.type.Date + * @static + * @param {Object.} object Plain object + * @returns {google.type.Date} Date + */ + Date.fromObject = function fromObject(object) { + if (object instanceof $root.google.type.Date) + return object; + var message = new $root.google.type.Date(); + if (object.year != null) + message.year = object.year | 0; + if (object.month != null) + message.month = object.month | 0; + if (object.day != null) + message.day = object.day | 0; + return message; + }; + + /** + * Creates a plain object from a Date message. Also converts values to other types if specified. + * @function toObject + * @memberof google.type.Date + * @static + * @param {google.type.Date} message Date + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Date.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.year = 0; + object.month = 0; + object.day = 0; + } + if (message.year != null && message.hasOwnProperty("year")) + object.year = message.year; + if (message.month != null && message.hasOwnProperty("month")) + object.month = message.month; + if (message.day != null && message.hasOwnProperty("day")) + object.day = message.day; + return object; + }; + + /** + * Converts this Date to JSON. + * @function toJSON + * @memberof google.type.Date + * @instance + * @returns {Object.} JSON object + */ + Date.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Date + * @function getTypeUrl + * @memberof google.type.Date + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Date.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.type.Date"; + }; + + return Date; + })(); + + return type; + })(); + + 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) { + 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(); + 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) { + 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(); + 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) { + 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(); + 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) { + 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(); + 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) { + 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(); + 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) { + 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(); + 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) { + 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(); + 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) { + 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(); + 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) { + 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(); + 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/google-cloud-policysimulator/protos/protos.json b/packages/google-cloud-policysimulator/protos/protos.json new file mode 100644 index 00000000000..c492ef6bde5 --- /dev/null +++ b/packages/google-cloud-policysimulator/protos/protos.json @@ -0,0 +1,2461 @@ +{ + "nested": { + "google": { + "nested": { + "cloud": { + "nested": { + "policysimulator": { + "nested": { + "v1": { + "options": { + "cc_enable_arenas": true, + "csharp_namespace": "Google.Cloud.PolicySimulator.V1", + "go_package": "cloud.google.com/go/policysimulator/apiv1/policysimulatorpb;policysimulatorpb", + "java_multiple_files": true, + "java_outer_classname": "SimulatorProto", + "java_package": "com.google.cloud.policysimulator.v1", + "php_namespace": "Google\\Cloud\\PolicySimulator\\V1", + "ruby_package": "Google::Cloud::PolicySimulator::V1" + }, + "nested": { + "AccessState": { + "values": { + "ACCESS_STATE_UNSPECIFIED": 0, + "GRANTED": 1, + "NOT_GRANTED": 2, + "UNKNOWN_CONDITIONAL": 3, + "UNKNOWN_INFO_DENIED": 4 + } + }, + "HeuristicRelevance": { + "values": { + "HEURISTIC_RELEVANCE_UNSPECIFIED": 0, + "NORMAL": 1, + "HIGH": 2 + } + }, + "AccessTuple": { + "fields": { + "principal": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "fullResourceName": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "permission": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "ExplainedPolicy": { + "fields": { + "access": { + "type": "AccessState", + "id": 1 + }, + "fullResourceName": { + "type": "string", + "id": 2 + }, + "policy": { + "type": "google.iam.v1.Policy", + "id": 3 + }, + "bindingExplanations": { + "rule": "repeated", + "type": "BindingExplanation", + "id": 4 + }, + "relevance": { + "type": "HeuristicRelevance", + "id": 5 + } + } + }, + "BindingExplanation": { + "fields": { + "access": { + "type": "AccessState", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "role": { + "type": "string", + "id": 2 + }, + "rolePermission": { + "type": "RolePermission", + "id": 3 + }, + "rolePermissionRelevance": { + "type": "HeuristicRelevance", + "id": 4 + }, + "memberships": { + "keyType": "string", + "type": "AnnotatedMembership", + "id": 5 + }, + "relevance": { + "type": "HeuristicRelevance", + "id": 6 + }, + "condition": { + "type": "google.type.Expr", + "id": 7 + } + }, + "nested": { + "AnnotatedMembership": { + "fields": { + "membership": { + "type": "Membership", + "id": 1 + }, + "relevance": { + "type": "HeuristicRelevance", + "id": 2 + } + } + }, + "RolePermission": { + "values": { + "ROLE_PERMISSION_UNSPECIFIED": 0, + "ROLE_PERMISSION_INCLUDED": 1, + "ROLE_PERMISSION_NOT_INCLUDED": 2, + "ROLE_PERMISSION_UNKNOWN_INFO_DENIED": 3 + } + }, + "Membership": { + "values": { + "MEMBERSHIP_UNSPECIFIED": 0, + "MEMBERSHIP_INCLUDED": 1, + "MEMBERSHIP_NOT_INCLUDED": 2, + "MEMBERSHIP_UNKNOWN_INFO_DENIED": 3, + "MEMBERSHIP_UNKNOWN_UNSUPPORTED": 4 + } + } + } + }, + "Simulator": { + "options": { + "(google.api.default_host)": "policysimulator.googleapis.com", + "(google.api.oauth_scopes)": "https://www.googleapis.com/auth/cloud-platform" + }, + "methods": { + "GetReplay": { + "requestType": "GetReplayRequest", + "responseType": "Replay", + "options": { + "(google.api.http).get": "/v1/{name=projects/*/locations/*/replays/*}", + "(google.api.http).additional_bindings.get": "/v1/{name=organizations/*/locations/*/replays/*}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1/{name=projects/*/locations/*/replays/*}", + "additional_bindings": [ + { + "get": "/v1/{name=folders/*/locations/*/replays/*}" + }, + { + "get": "/v1/{name=organizations/*/locations/*/replays/*}" + } + ] + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "CreateReplay": { + "requestType": "CreateReplayRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).post": "/v1/{parent=projects/*/locations/*}/replays", + "(google.api.http).body": "replay", + "(google.api.http).additional_bindings.post": "/v1/{parent=organizations/*/locations/*}/replays", + "(google.api.http).additional_bindings.body": "replay", + "(google.api.method_signature)": "parent,replay", + "(google.longrunning.operation_info).response_type": "Replay", + "(google.longrunning.operation_info).metadata_type": "ReplayOperationMetadata" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1/{parent=projects/*/locations/*}/replays", + "body": "replay", + "additional_bindings": [ + { + "post": "/v1/{parent=folders/*/locations/*}/replays", + "body": "replay" + }, + { + "post": "/v1/{parent=organizations/*/locations/*}/replays", + "body": "replay" + } + ] + } + }, + { + "(google.api.method_signature)": "parent,replay" + }, + { + "(google.longrunning.operation_info)": { + "response_type": "Replay", + "metadata_type": "ReplayOperationMetadata" + } + } + ] + }, + "ListReplayResults": { + "requestType": "ListReplayResultsRequest", + "responseType": "ListReplayResultsResponse", + "options": { + "(google.api.http).get": "/v1/{parent=projects/*/locations/*/replays/*}/results", + "(google.api.http).additional_bindings.get": "/v1/{parent=organizations/*/locations/*/replays/*}/results", + "(google.api.method_signature)": "parent" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1/{parent=projects/*/locations/*/replays/*}/results", + "additional_bindings": [ + { + "get": "/v1/{parent=folders/*/locations/*/replays/*}/results" + }, + { + "get": "/v1/{parent=organizations/*/locations/*/replays/*}/results" + } + ] + } + }, + { + "(google.api.method_signature)": "parent" + } + ] + } + } + }, + "Replay": { + "options": { + "(google.api.resource).type": "policysimulator.googleapis.com/Replay", + "(google.api.resource).pattern": "organizations/{organization}/locations/{location}/replays/{replay}" + }, + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "state": { + "type": "State", + "id": 2, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "config": { + "type": "ReplayConfig", + "id": 3, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "resultsSummary": { + "type": "ResultsSummary", + "id": 5, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + } + }, + "nested": { + "ResultsSummary": { + "fields": { + "logCount": { + "type": "int32", + "id": 1 + }, + "unchangedCount": { + "type": "int32", + "id": 2 + }, + "differenceCount": { + "type": "int32", + "id": 3 + }, + "errorCount": { + "type": "int32", + "id": 4 + }, + "oldestDate": { + "type": "google.type.Date", + "id": 5 + }, + "newestDate": { + "type": "google.type.Date", + "id": 6 + } + } + }, + "State": { + "values": { + "STATE_UNSPECIFIED": 0, + "PENDING": 1, + "RUNNING": 2, + "SUCCEEDED": 3, + "FAILED": 4 + } + } + } + }, + "ReplayResult": { + "options": { + "(google.api.resource).type": "policysimulator.googleapis.com/ReplayResult", + "(google.api.resource).pattern": "organizations/{organization}/locations/{location}/replays/{replay}/results/{replay_result}" + }, + "oneofs": { + "result": { + "oneof": [ + "diff", + "error" + ] + } + }, + "fields": { + "diff": { + "type": "ReplayDiff", + "id": 5 + }, + "error": { + "type": "google.rpc.Status", + "id": 6 + }, + "name": { + "type": "string", + "id": 1 + }, + "parent": { + "type": "string", + "id": 2, + "options": { + "(google.api.resource_reference).type": "policysimulator.googleapis.com/Replay" + } + }, + "accessTuple": { + "type": "AccessTuple", + "id": 3 + }, + "lastSeenDate": { + "type": "google.type.Date", + "id": 4 + } + } + }, + "CreateReplayRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "replay": { + "type": "Replay", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "ReplayOperationMetadata": { + "fields": { + "startTime": { + "type": "google.protobuf.Timestamp", + "id": 1 + } + } + }, + "GetReplayRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "policysimulator.googleapis.com/Replay" + } + } + } + }, + "ListReplayResultsRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "policysimulator.googleapis.com/Replay" + } + }, + "pageSize": { + "type": "int32", + "id": 2 + }, + "pageToken": { + "type": "string", + "id": 3 + } + } + }, + "ListReplayResultsResponse": { + "fields": { + "replayResults": { + "rule": "repeated", + "type": "ReplayResult", + "id": 1 + }, + "nextPageToken": { + "type": "string", + "id": 2 + } + } + }, + "ReplayConfig": { + "fields": { + "policyOverlay": { + "keyType": "string", + "type": "google.iam.v1.Policy", + "id": 1 + }, + "logSource": { + "type": "LogSource", + "id": 2 + } + }, + "nested": { + "LogSource": { + "values": { + "LOG_SOURCE_UNSPECIFIED": 0, + "RECENT_ACCESSES": 1 + } + } + } + }, + "ReplayDiff": { + "fields": { + "accessDiff": { + "type": "AccessStateDiff", + "id": 2 + } + } + }, + "AccessStateDiff": { + "fields": { + "baseline": { + "type": "ExplainedAccess", + "id": 1 + }, + "simulated": { + "type": "ExplainedAccess", + "id": 2 + }, + "accessChange": { + "type": "AccessChangeType", + "id": 3 + } + }, + "nested": { + "AccessChangeType": { + "values": { + "ACCESS_CHANGE_TYPE_UNSPECIFIED": 0, + "NO_CHANGE": 1, + "UNKNOWN_CHANGE": 2, + "ACCESS_REVOKED": 3, + "ACCESS_GAINED": 4, + "ACCESS_MAYBE_REVOKED": 5, + "ACCESS_MAYBE_GAINED": 6 + } + } + } + }, + "ExplainedAccess": { + "fields": { + "accessState": { + "type": "AccessState", + "id": 1 + }, + "policies": { + "rule": "repeated", + "type": "ExplainedPolicy", + "id": 2 + }, + "errors": { + "rule": "repeated", + "type": "google.rpc.Status", + "id": 3 + } + } + } + } + } + } + } + } + }, + "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": { + "fieldBehavior": { + "rule": "repeated", + "type": "google.api.FieldBehavior", + "id": 1052, + "extend": "google.protobuf.FieldOptions" + }, + "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 + } + }, + "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" + }, + "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 + } + } + }, + "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 + } + } + }, + "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 + } + }, + "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 + } + }, + "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 + } + }, + "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": { + "fields": { + "file": { + "rule": "repeated", + "type": "FileDescriptorProto", + "id": 1 + } + } + }, + "FileDescriptorProto": { + "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, + "options": { + "packed": false + } + }, + "weakDependency": { + "rule": "repeated", + "type": "int32", + "id": 11, + "options": { + "packed": false + } + }, + "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": "string", + "id": 13 + } + } + }, + "DescriptorProto": { + "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": { + "fields": { + "uninterpretedOption": { + "rule": "repeated", + "type": "UninterpretedOption", + "id": 999 + } + }, + "extensions": [ + [ + 1000, + 536870911 + ] + ] + }, + "FieldDescriptorProto": { + "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_REQUIRED": 2, + "LABEL_REPEATED": 3 + } + } + } + }, + "OneofDescriptorProto": { + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "options": { + "type": "OneofOptions", + "id": 2 + } + } + }, + "EnumDescriptorProto": { + "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": { + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "number": { + "type": "int32", + "id": 2 + }, + "options": { + "type": "EnumValueOptions", + "id": 3 + } + } + }, + "ServiceDescriptorProto": { + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "method": { + "rule": "repeated", + "type": "MethodDescriptorProto", + "id": 2 + }, + "options": { + "type": "ServiceOptions", + "id": 3 + } + } + }, + "MethodDescriptorProto": { + "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": { + "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 + } + }, + "phpGenericServices": { + "type": "bool", + "id": 42, + "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 + }, + "uninterpretedOption": { + "rule": "repeated", + "type": "UninterpretedOption", + "id": 999 + } + }, + "extensions": [ + [ + 1000, + 536870911 + ] + ], + "reserved": [ + [ + 38, + 38 + ] + ], + "nested": { + "OptimizeMode": { + "values": { + "SPEED": 1, + "CODE_SIZE": 2, + "LITE_RUNTIME": 3 + } + } + } + }, + "MessageOptions": { + "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 + } + }, + "uninterpretedOption": { + "rule": "repeated", + "type": "UninterpretedOption", + "id": 999 + } + }, + "extensions": [ + [ + 1000, + 536870911 + ] + ], + "reserved": [ + [ + 4, + 4 + ], + [ + 5, + 5 + ], + [ + 6, + 6 + ], + [ + 8, + 8 + ], + [ + 9, + 9 + ] + ] + }, + "FieldOptions": { + "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 + }, + "target": { + "type": "OptionTargetType", + "id": 18 + }, + "uninterpretedOption": { + "rule": "repeated", + "type": "UninterpretedOption", + "id": 999 + } + }, + "extensions": [ + [ + 1000, + 536870911 + ] + ], + "reserved": [ + [ + 4, + 4 + ] + ], + "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 + } + } + } + }, + "OneofOptions": { + "fields": { + "uninterpretedOption": { + "rule": "repeated", + "type": "UninterpretedOption", + "id": 999 + } + }, + "extensions": [ + [ + 1000, + 536870911 + ] + ] + }, + "EnumOptions": { + "fields": { + "allowAlias": { + "type": "bool", + "id": 2 + }, + "deprecated": { + "type": "bool", + "id": 3, + "options": { + "default": false + } + }, + "deprecatedLegacyJsonFieldConflicts": { + "type": "bool", + "id": 6, + "options": { + "deprecated": true + } + }, + "uninterpretedOption": { + "rule": "repeated", + "type": "UninterpretedOption", + "id": 999 + } + }, + "extensions": [ + [ + 1000, + 536870911 + ] + ], + "reserved": [ + [ + 5, + 5 + ] + ] + }, + "EnumValueOptions": { + "fields": { + "deprecated": { + "type": "bool", + "id": 1, + "options": { + "default": false + } + }, + "uninterpretedOption": { + "rule": "repeated", + "type": "UninterpretedOption", + "id": 999 + } + }, + "extensions": [ + [ + 1000, + 536870911 + ] + ] + }, + "ServiceOptions": { + "fields": { + "deprecated": { + "type": "bool", + "id": 33, + "options": { + "default": false + } + }, + "uninterpretedOption": { + "rule": "repeated", + "type": "UninterpretedOption", + "id": 999 + } + }, + "extensions": [ + [ + 1000, + 536870911 + ] + ] + }, + "MethodOptions": { + "fields": { + "deprecated": { + "type": "bool", + "id": 33, + "options": { + "default": false + } + }, + "idempotencyLevel": { + "type": "IdempotencyLevel", + "id": 34, + "options": { + "default": "IDEMPOTENCY_UNKNOWN" + } + }, + "uninterpretedOption": { + "rule": "repeated", + "type": "UninterpretedOption", + "id": 999 + } + }, + "extensions": [ + [ + 1000, + 536870911 + ] + ], + "nested": { + "IdempotencyLevel": { + "values": { + "IDEMPOTENCY_UNKNOWN": 0, + "NO_SIDE_EFFECTS": 1, + "IDEMPOTENT": 2 + } + } + } + }, + "UninterpretedOption": { + "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 + } + } + } + } + }, + "SourceCodeInfo": { + "fields": { + "location": { + "rule": "repeated", + "type": "Location", + "id": 1 + } + }, + "nested": { + "Location": { + "fields": { + "path": { + "rule": "repeated", + "type": "int32", + "id": 1 + }, + "span": { + "rule": "repeated", + "type": "int32", + "id": 2 + }, + "leadingComments": { + "type": "string", + "id": 3 + }, + "trailingComments": { + "type": "string", + "id": 4 + }, + "leadingDetachedComments": { + "rule": "repeated", + "type": "string", + "id": 6 + } + } + } + } + }, + "GeneratedCodeInfo": { + "fields": { + "annotation": { + "rule": "repeated", + "type": "Annotation", + "id": 1 + } + }, + "nested": { + "Annotation": { + "fields": { + "path": { + "rule": "repeated", + "type": "int32", + "id": 1 + }, + "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 + } + } + } + } + }, + "iam": { + "nested": { + "v1": { + "options": { + "cc_enable_arenas": true, + "csharp_namespace": "Google.Cloud.Iam.V1", + "go_package": "google.golang.org/genproto/googleapis/iam/v1;iam", + "java_multiple_files": true, + "java_outer_classname": "PolicyProto", + "java_package": "com.google.iam.v1", + "php_namespace": "Google\\Cloud\\Iam\\V1" + }, + "nested": { + "Policy": { + "fields": { + "version": { + "type": "int32", + "id": 1 + }, + "bindings": { + "rule": "repeated", + "type": "Binding", + "id": 4 + }, + "auditConfigs": { + "rule": "repeated", + "type": "AuditConfig", + "id": 6 + }, + "etag": { + "type": "bytes", + "id": 3 + } + } + }, + "Binding": { + "fields": { + "role": { + "type": "string", + "id": 1 + }, + "members": { + "rule": "repeated", + "type": "string", + "id": 2 + }, + "condition": { + "type": "google.type.Expr", + "id": 3 + } + } + }, + "AuditConfig": { + "fields": { + "service": { + "type": "string", + "id": 1 + }, + "auditLogConfigs": { + "rule": "repeated", + "type": "AuditLogConfig", + "id": 3 + } + } + }, + "AuditLogConfig": { + "fields": { + "logType": { + "type": "LogType", + "id": 1 + }, + "exemptedMembers": { + "rule": "repeated", + "type": "string", + "id": 2 + } + }, + "nested": { + "LogType": { + "values": { + "LOG_TYPE_UNSPECIFIED": 0, + "ADMIN_READ": 1, + "DATA_WRITE": 2, + "DATA_READ": 3 + } + } + } + }, + "PolicyDelta": { + "fields": { + "bindingDeltas": { + "rule": "repeated", + "type": "BindingDelta", + "id": 1 + }, + "auditConfigDeltas": { + "rule": "repeated", + "type": "AuditConfigDelta", + "id": 2 + } + } + }, + "BindingDelta": { + "fields": { + "action": { + "type": "Action", + "id": 1 + }, + "role": { + "type": "string", + "id": 2 + }, + "member": { + "type": "string", + "id": 3 + }, + "condition": { + "type": "google.type.Expr", + "id": 4 + } + }, + "nested": { + "Action": { + "values": { + "ACTION_UNSPECIFIED": 0, + "ADD": 1, + "REMOVE": 2 + } + } + } + }, + "AuditConfigDelta": { + "fields": { + "action": { + "type": "Action", + "id": 1 + }, + "service": { + "type": "string", + "id": 2 + }, + "exemptedMember": { + "type": "string", + "id": 3 + }, + "logType": { + "type": "string", + "id": 4 + } + }, + "nested": { + "Action": { + "values": { + "ACTION_UNSPECIFIED": 0, + "ADD": 1, + "REMOVE": 2 + } + } + } + } + } + } + } + }, + "type": { + "options": { + "go_package": "google.golang.org/genproto/googleapis/type/date;date", + "java_multiple_files": true, + "java_outer_classname": "DateProto", + "java_package": "com.google.type", + "objc_class_prefix": "GTP", + "cc_enable_arenas": true + }, + "nested": { + "Expr": { + "fields": { + "expression": { + "type": "string", + "id": 1 + }, + "title": { + "type": "string", + "id": 2 + }, + "description": { + "type": "string", + "id": 3 + }, + "location": { + "type": "string", + "id": 4 + } + } + }, + "Date": { + "fields": { + "year": { + "type": "int32", + "id": 1 + }, + "month": { + "type": "int32", + "id": 2 + }, + "day": { + "type": "int32", + "id": 3 + } + } + } + } + }, + "longrunning": { + "options": { + "cc_enable_arenas": true, + "csharp_namespace": "Google.LongRunning", + "go_package": "google.golang.org/genproto/googleapis/longrunning;longrunning", + "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/google-cloud-policysimulator/samples/README.md b/packages/google-cloud-policysimulator/samples/README.md new file mode 100644 index 00000000000..a46637b118d --- /dev/null +++ b/packages/google-cloud-policysimulator/samples/README.md @@ -0,0 +1,104 @@ +[//]: # "This README.md file is auto-generated, all changes to this file will be lost." +[//]: # "To regenerate it, use `python -m synthtool`." +Google Cloud Platform logo + +# [Policy Simulator API: Node.js Samples](https://github.com/googleapis/google-cloud-node) + +[![Open in Cloud Shell][shell_img]][shell_link] + + + +## Table of Contents + +* [Before you begin](#before-you-begin) +* [Samples](#samples) + * [Simulator.create_replay](#simulator.create_replay) + * [Simulator.get_replay](#simulator.get_replay) + * [Simulator.list_replay_results](#simulator.list_replay_results) + * [Quickstart](#quickstart) + +## Before you begin + +Before running the samples, make sure you've followed the steps outlined in +[Using the client library](https://github.com/googleapis/google-cloud-node#using-the-client-library). + +`cd samples` + +`npm install` + +`cd ..` + +## Samples + + + +### Simulator.create_replay + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-policysimulator/samples/generated/v1/simulator.create_replay.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-cloud-policysimulator/samples/generated/v1/simulator.create_replay.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-policysimulator/samples/generated/v1/simulator.create_replay.js` + + +----- + + + + +### Simulator.get_replay + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-policysimulator/samples/generated/v1/simulator.get_replay.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-cloud-policysimulator/samples/generated/v1/simulator.get_replay.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-policysimulator/samples/generated/v1/simulator.get_replay.js` + + +----- + + + + +### Simulator.list_replay_results + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-policysimulator/samples/generated/v1/simulator.list_replay_results.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-cloud-policysimulator/samples/generated/v1/simulator.list_replay_results.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-policysimulator/samples/generated/v1/simulator.list_replay_results.js` + + +----- + + + + +### Quickstart + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-policysimulator/samples/quickstart.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-cloud-policysimulator/samples/quickstart.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-policysimulator/samples/quickstart.js` + + + + + + +[shell_img]: https://gstatic.com/cloudssh/images/open-btn.png +[shell_link]: https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=samples/README.md +[product-docs]: https://cloud.google.com/policy-intelligence/docs/iam-simulator-overview diff --git a/packages/google-cloud-policysimulator/samples/generated/v1/simulator.create_replay.js b/packages/google-cloud-policysimulator/samples/generated/v1/simulator.create_replay.js new file mode 100644 index 00000000000..f8820267382 --- /dev/null +++ b/packages/google-cloud-policysimulator/samples/generated/v1/simulator.create_replay.js @@ -0,0 +1,71 @@ +// Copyright 2023 Google LLC +// +// Licensed under the Apache License, Version 2.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, replay) { + // [START policysimulator_v1_generated_Simulator_CreateReplay_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 + * Replay google.cloud.policysimulator.v1.Replay will be created. This + * resource must be a project, folder, or organization with a location. + * Example: `projects/my-example-project/locations/global` + */ + // const parent = 'abc123' + /** + * Required. The Replay google.cloud.policysimulator.v1.Replay to create. + * Set `Replay.ReplayConfig` to configure the replay. + */ + // const replay = {} + + // Imports the Policysimulator library + const {SimulatorClient} = require('@google-cloud/policysimulator').v1; + + // Instantiates a client + const policysimulatorClient = new SimulatorClient(); + + async function callCreateReplay() { + // Construct request + const request = { + parent, + replay, + }; + + // Run request + const [operation] = await policysimulatorClient.createReplay(request); + const [response] = await operation.promise(); + console.log(response); + } + + callCreateReplay(); + // [END policysimulator_v1_generated_Simulator_CreateReplay_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-policysimulator/samples/generated/v1/simulator.get_replay.js b/packages/google-cloud-policysimulator/samples/generated/v1/simulator.get_replay.js new file mode 100644 index 00000000000..bcdf2f968b6 --- /dev/null +++ b/packages/google-cloud-policysimulator/samples/generated/v1/simulator.get_replay.js @@ -0,0 +1,67 @@ +// Copyright 2023 Google LLC +// +// Licensed under the Apache License, Version 2.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 policysimulator_v1_generated_Simulator_GetReplay_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 Replay google.cloud.policysimulator.v1.Replay + * to retrieve, in the following format: + * `{projects|folders|organizations}/{resource-id}/locations/global/replays/{replay-id}`, + * where `{resource-id}` is the ID of the project, folder, or organization + * that owns the `Replay`. + * Example: + * `projects/my-example-project/locations/global/replays/506a5f7f-38ce-4d7d-8e03-479ce1833c36` + */ + // const name = 'abc123' + + // Imports the Policysimulator library + const {SimulatorClient} = require('@google-cloud/policysimulator').v1; + + // Instantiates a client + const policysimulatorClient = new SimulatorClient(); + + async function callGetReplay() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await policysimulatorClient.getReplay(request); + console.log(response); + } + + callGetReplay(); + // [END policysimulator_v1_generated_Simulator_GetReplay_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-policysimulator/samples/generated/v1/simulator.list_replay_results.js b/packages/google-cloud-policysimulator/samples/generated/v1/simulator.list_replay_results.js new file mode 100644 index 00000000000..6a7ef8075ed --- /dev/null +++ b/packages/google-cloud-policysimulator/samples/generated/v1/simulator.list_replay_results.js @@ -0,0 +1,83 @@ +// Copyright 2023 Google LLC +// +// Licensed under the Apache License, Version 2.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 policysimulator_v1_generated_Simulator_ListReplayResults_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 Replay google.cloud.policysimulator.v1.Replay whose + * results are listed, in the following format: + * `{projects|folders|organizations}/{resource-id}/locations/global/replays/{replay-id}` + * Example: + * `projects/my-project/locations/global/replays/506a5f7f-38ce-4d7d-8e03-479ce1833c36` + */ + // const parent = 'abc123' + /** + * The maximum number of + * ReplayResult google.cloud.policysimulator.v1.ReplayResult objects to + * return. Defaults to 5000. + * The maximum value is 5000; values above 5000 are rounded down to 5000. + */ + // const pageSize = 1234 + /** + * A page token, received from a previous + * Simulator.ListReplayResults google.cloud.policysimulator.v1.Simulator.ListReplayResults + * call. Provide this token to retrieve the next page of results. + * When paginating, all other parameters provided to + * Simulator.ListReplayResults must match the call that provided the page + * token. + */ + // const pageToken = 'abc123' + + // Imports the Policysimulator library + const {SimulatorClient} = require('@google-cloud/policysimulator').v1; + + // Instantiates a client + const policysimulatorClient = new SimulatorClient(); + + async function callListReplayResults() { + // Construct request + const request = { + parent, + }; + + // Run request + const iterable = await policysimulatorClient.listReplayResultsAsync(request); + for await (const response of iterable) { + console.log(response); + } + } + + callListReplayResults(); + // [END policysimulator_v1_generated_Simulator_ListReplayResults_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-policysimulator/samples/generated/v1/snippet_metadata_google.cloud.policysimulator.v1.json b/packages/google-cloud-policysimulator/samples/generated/v1/snippet_metadata_google.cloud.policysimulator.v1.json new file mode 100644 index 00000000000..488a377257c --- /dev/null +++ b/packages/google-cloud-policysimulator/samples/generated/v1/snippet_metadata_google.cloud.policysimulator.v1.json @@ -0,0 +1,147 @@ +{ + "clientLibrary": { + "name": "nodejs-policysimulator", + "version": "0.1.0", + "language": "TYPESCRIPT", + "apis": [ + { + "id": "google.cloud.policysimulator.v1", + "version": "v1" + } + ] + }, + "snippets": [ + { + "regionTag": "policysimulator_v1_generated_Simulator_GetReplay_async", + "title": "Simulator getReplay Sample", + "origin": "API_DEFINITION", + "description": " Gets the specified [Replay][google.cloud.policysimulator.v1.Replay]. Each `Replay` is available for at least 7 days.", + "canonical": true, + "file": "simulator.get_replay.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 59, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "GetReplay", + "fullName": "google.cloud.policysimulator.v1.Simulator.GetReplay", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.policysimulator.v1.Replay", + "client": { + "shortName": "SimulatorClient", + "fullName": "google.cloud.policysimulator.v1.SimulatorClient" + }, + "method": { + "shortName": "GetReplay", + "fullName": "google.cloud.policysimulator.v1.Simulator.GetReplay", + "service": { + "shortName": "Simulator", + "fullName": "google.cloud.policysimulator.v1.Simulator" + } + } + } + }, + { + "regionTag": "policysimulator_v1_generated_Simulator_CreateReplay_async", + "title": "Simulator createReplay Sample", + "origin": "API_DEFINITION", + "description": " Creates and starts a [Replay][google.cloud.policysimulator.v1.Replay] using the given [ReplayConfig][google.cloud.policysimulator.v1.ReplayConfig].", + "canonical": true, + "file": "simulator.create_replay.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 63, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "CreateReplay", + "fullName": "google.cloud.policysimulator.v1.Simulator.CreateReplay", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "replay", + "type": ".google.cloud.policysimulator.v1.Replay" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "SimulatorClient", + "fullName": "google.cloud.policysimulator.v1.SimulatorClient" + }, + "method": { + "shortName": "CreateReplay", + "fullName": "google.cloud.policysimulator.v1.Simulator.CreateReplay", + "service": { + "shortName": "Simulator", + "fullName": "google.cloud.policysimulator.v1.Simulator" + } + } + } + }, + { + "regionTag": "policysimulator_v1_generated_Simulator_ListReplayResults_async", + "title": "Simulator listReplayResults Sample", + "origin": "API_DEFINITION", + "description": " Lists the results of running a [Replay][google.cloud.policysimulator.v1.Replay].", + "canonical": true, + "file": "simulator.list_replay_results.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 75, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "ListReplayResults", + "fullName": "google.cloud.policysimulator.v1.Simulator.ListReplayResults", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "page_size", + "type": "TYPE_INT32" + }, + { + "name": "page_token", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.policysimulator.v1.ListReplayResultsResponse", + "client": { + "shortName": "SimulatorClient", + "fullName": "google.cloud.policysimulator.v1.SimulatorClient" + }, + "method": { + "shortName": "ListReplayResults", + "fullName": "google.cloud.policysimulator.v1.Simulator.ListReplayResults", + "service": { + "shortName": "Simulator", + "fullName": "google.cloud.policysimulator.v1.Simulator" + } + } + } + } + ] +} \ No newline at end of file diff --git a/packages/google-cloud-policysimulator/samples/package.json b/packages/google-cloud-policysimulator/samples/package.json new file mode 100644 index 00000000000..b06350531a5 --- /dev/null +++ b/packages/google-cloud-policysimulator/samples/package.json @@ -0,0 +1,24 @@ +{ + "name": "policysimulator-samples", + "private": true, + "license": "Apache-2.0", + "author": "Google LLC", + "engines": { + "node": ">=14.0.0" + }, + "files": [ + "*.js" + ], + "scripts": { + "test": "c8 mocha --timeout 600000 test/*.js", + "publish": "echo 'sample test; do not publish'" + }, + "dependencies": { + "@google-cloud/policysimulator": "^0.1.0" + }, + "devDependencies": { + "c8": "^8.0.0", + "chai": "^4.2.0", + "mocha": "^8.0.0" + } +} diff --git a/packages/google-cloud-policysimulator/samples/quickstart.js b/packages/google-cloud-policysimulator/samples/quickstart.js new file mode 100644 index 00000000000..471263ee819 --- /dev/null +++ b/packages/google-cloud-policysimulator/samples/quickstart.js @@ -0,0 +1,83 @@ +// Copyright 2023 Google LLC +// +// Licensed under the Apache License, Version 2.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 policysimulator_quickstart] + /** + * 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 Replay google.cloud.policysimulator.v1.Replay whose + * results are listed, in the following format: + * `{projects|folders|organizations}/{resource-id}/locations/global/replays/{replay-id}` + * Example: + * `projects/my-project/locations/global/replays/506a5f7f-38ce-4d7d-8e03-479ce1833c36` + */ + // const parent = 'abc123' + /** + * The maximum number of + * ReplayResult google.cloud.policysimulator.v1.ReplayResult objects to + * return. Defaults to 5000. + * The maximum value is 5000; values above 5000 are rounded down to 5000. + */ + // const pageSize = 1234 + /** + * A page token, received from a previous + * Simulator.ListReplayResults google.cloud.policysimulator.v1.Simulator.ListReplayResults + * call. Provide this token to retrieve the next page of results. + * When paginating, all other parameters provided to + * Simulator.ListReplayResults must match the call that provided the page + * token. + */ + // const pageToken = 'abc123' + + // Imports the Policysimulator library + const {SimulatorClient} = require('@google-cloud/policysimulator').v1; + + // Instantiates a client + const policysimulatorClient = new SimulatorClient(); + + async function callListReplayResults() { + // Construct request + const request = { + parent, + }; + + // Run request + const iterable = await policysimulatorClient.listReplayResultsAsync( + request + ); + for await (const response of iterable) { + console.log(response); + } + } + + callListReplayResults(); + // [END policysimulator_quickstart] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-policysimulator/samples/test/quickstart.js b/packages/google-cloud-policysimulator/samples/test/quickstart.js new file mode 100644 index 00000000000..315dabe7da4 --- /dev/null +++ b/packages/google-cloud-policysimulator/samples/test/quickstart.js @@ -0,0 +1,44 @@ +// Copyright 2023 Google LLC +// +// Licensed under the Apache License, Version 2.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. + +'use strict'; + +// const assert = require('assert'); +// const path = require('path'); +// const cp = require('child_process'); +const {describe, it, before} = require('mocha'); +// const {SimulatorClient} = require('@google-cloud/policysimulator').v1; +// const policysimulatorClient = new SimulatorClient(); + +// const execSync = cmd => cp.execSync(cmd, {encoding: 'utf-8'}); + +// const cwd = path.join(__dirname, '..'); + +describe('Quickstart', () => { + // let projectId; + + before(async () => { + // projectId = await policysimulatorClient.getProjectId(); + }); + + it('should run quickstart', async () => { + // Skipping this test since it requires creating resources, which makes + // the test more likely to be flaky + // const output = execSync( + // `node ./quickstart.js projects/${projectId}/locations/global/replays/`, + // {cwd} + // ); + // assert(output !== null); + }); +}); diff --git a/packages/google-cloud-policysimulator/src/index.ts b/packages/google-cloud-policysimulator/src/index.ts new file mode 100644 index 00000000000..e684d4cd5e2 --- /dev/null +++ b/packages/google-cloud-policysimulator/src/index.ts @@ -0,0 +1,27 @@ +// Copyright 2023 Google LLC +// +// Licensed under the Apache License, Version 2.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. ** + +import * as v1 from './v1'; + +const SimulatorClient = v1.SimulatorClient; +type SimulatorClient = v1.SimulatorClient; + +export {v1, SimulatorClient}; +export default {v1, SimulatorClient}; +import * as protos from '../protos/protos'; +export {protos}; diff --git a/packages/google-cloud-policysimulator/src/v1/gapic_metadata.json b/packages/google-cloud-policysimulator/src/v1/gapic_metadata.json new file mode 100644 index 00000000000..391dc0085e8 --- /dev/null +++ b/packages/google-cloud-policysimulator/src/v1/gapic_metadata.json @@ -0,0 +1,57 @@ +{ + "schema": "1.0", + "comment": "This file maps proto services/RPCs to the corresponding library clients/methods", + "language": "typescript", + "protoPackage": "google.cloud.policysimulator.v1", + "libraryPackage": "@google-cloud/policysimulator", + "services": { + "Simulator": { + "clients": { + "grpc": { + "libraryClient": "SimulatorClient", + "rpcs": { + "GetReplay": { + "methods": [ + "getReplay" + ] + }, + "CreateReplay": { + "methods": [ + "createReplay" + ] + }, + "ListReplayResults": { + "methods": [ + "listReplayResults", + "listReplayResultsStream", + "listReplayResultsAsync" + ] + } + } + }, + "grpc-fallback": { + "libraryClient": "SimulatorClient", + "rpcs": { + "GetReplay": { + "methods": [ + "getReplay" + ] + }, + "CreateReplay": { + "methods": [ + "createReplay" + ] + }, + "ListReplayResults": { + "methods": [ + "listReplayResults", + "listReplayResultsStream", + "listReplayResultsAsync" + ] + } + } + } + } + } + } +} diff --git a/packages/google-cloud-policysimulator/src/v1/index.ts b/packages/google-cloud-policysimulator/src/v1/index.ts new file mode 100644 index 00000000000..7027e5eb8a0 --- /dev/null +++ b/packages/google-cloud-policysimulator/src/v1/index.ts @@ -0,0 +1,19 @@ +// Copyright 2023 Google LLC +// +// Licensed under the Apache License, Version 2.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 {SimulatorClient} from './simulator_client'; diff --git a/packages/google-cloud-policysimulator/src/v1/simulator_client.ts b/packages/google-cloud-policysimulator/src/v1/simulator_client.ts new file mode 100644 index 00000000000..815c3026ab1 --- /dev/null +++ b/packages/google-cloud-policysimulator/src/v1/simulator_client.ts @@ -0,0 +1,1526 @@ +// Copyright 2023 Google LLC +// +// Licensed under the Apache License, Version 2.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, +} from 'google-gax'; +import {Transform} from 'stream'; +import * as protos from '../../protos/protos'; +import jsonProtos = require('../../protos/protos.json'); +/** + * Client JSON configuration object, loaded from + * `src/v1/simulator_client_config.json`. + * This file defines retry strategy and timeouts for all API methods in this library. + */ +import * as gapicConfig from './simulator_client_config.json'; +const version = require('../../../package.json').version; + +/** + * Policy Simulator API service. + * + * Policy Simulator is a collection of endpoints for creating, running, and + * viewing a {@link protos.google.cloud.policysimulator.v1.Replay|Replay}. A + * {@link protos.google.cloud.policysimulator.v1.Replay|Replay} is a type of simulation that + * lets you see how your principals' access to resources might change if you + * changed your IAM policy. + * + * During a {@link protos.google.cloud.policysimulator.v1.Replay|Replay}, Policy Simulator + * re-evaluates, or replays, past access attempts under both the current policy + * and your proposed policy, and compares those results to determine how your + * principals' access might change under the proposed policy. + * @class + * @memberof v1 + */ +export class SimulatorClient { + 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}; + 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; + simulatorStub?: Promise<{[name: string]: Function}>; + + /** + * Construct an instance of SimulatorClient. + * + * @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://developers.google.com/identity/protocols/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 SimulatorClient({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 SimulatorClient; + const servicePath = + opts?.servicePath || opts?.apiEndpoint || staticMembers.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 !== staticMembers.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 = staticMembers.servicePath; + + // Set the default scopes in auth client if needed. + if (servicePath === staticMembers.servicePath) { + this.auth.defaultScopes = staticMembers.scopes; + } + + // Determine the client header string. + const clientHeader = [`gax/${this._gaxModule.version}`, `gapic/${version}`]; + if (typeof process !== 'undefined' && '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 = { + folderLocationReplayPathTemplate: new this._gaxModule.PathTemplate( + 'folders/{folder}/locations/{location}/replays/{replay}' + ), + folderLocationReplayReplayResultPathTemplate: + new this._gaxModule.PathTemplate( + 'folders/{folder}/locations/{location}/replays/{replay}/results/{replay_result}' + ), + organizationLocationReplayPathTemplate: new this._gaxModule.PathTemplate( + 'organizations/{organization}/locations/{location}/replays/{replay}' + ), + organizationLocationReplayReplayResultPathTemplate: + new this._gaxModule.PathTemplate( + 'organizations/{organization}/locations/{location}/replays/{replay}/results/{replay_result}' + ), + projectLocationReplayPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/replays/{replay}' + ), + projectLocationReplayReplayResultPathTemplate: + new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/replays/{replay}/results/{replay_result}' + ), + }; + + // 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 = { + listReplayResults: new this._gaxModule.PageDescriptor( + 'pageToken', + 'nextPageToken', + 'replayResults' + ), + }; + + const protoFilesRoot = this._gaxModule.protobuf.Root.fromJSON(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/{name=operations/**}', + additional_bindings: [ + {get: '/v1/{name=projects/*/locations/*/replays/*/operations/**}'}, + {get: '/v1/{name=folders/*/locations/*/replays/*/operations/**}'}, + { + get: '/v1/{name=organizations/*/locations/*/replays/*/operations/**}', + }, + ], + }, + { + selector: 'google.longrunning.Operations.ListOperations', + get: '/v1/{name=operations}', + additional_bindings: [ + {get: '/v1/{name=projects/*/locations/*/replays/*/operations}'}, + {get: '/v1/{name=folders/*/locations/*/replays/*/operations}'}, + { + get: '/v1/{name=organizations/*/locations/*/replays/*/operations}', + }, + ], + }, + ]; + } + this.operationsClient = this._gaxModule + .lro(lroOptions) + .operationsClient(opts); + const createReplayResponse = protoFilesRoot.lookup( + '.google.cloud.policysimulator.v1.Replay' + ) as gax.protobuf.Type; + const createReplayMetadata = protoFilesRoot.lookup( + '.google.cloud.policysimulator.v1.ReplayOperationMetadata' + ) as gax.protobuf.Type; + + this.descriptors.longrunning = { + createReplay: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + createReplayResponse.decode.bind(createReplayResponse), + createReplayMetadata.decode.bind(createReplayMetadata) + ), + }; + + // Put together the default options sent with requests. + this._defaults = this._gaxGrpc.constructSettings( + 'google.cloud.policysimulator.v1.Simulator', + 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.simulatorStub) { + return this.simulatorStub; + } + + // Put together the "service stub" for + // google.cloud.policysimulator.v1.Simulator. + this.simulatorStub = this._gaxGrpc.createStub( + this._opts.fallback + ? (this._protos as protobuf.Root).lookupService( + 'google.cloud.policysimulator.v1.Simulator' + ) + : // eslint-disable-next-line @typescript-eslint/no-explicit-any + (this._protos as any).google.cloud.policysimulator.v1.Simulator, + 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 simulatorStubMethods = [ + 'getReplay', + 'createReplay', + 'listReplayResults', + ]; + for (const methodName of simulatorStubMethods) { + const callPromise = this.simulatorStub.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] || + this.descriptors.longrunning[methodName] || + undefined; + const apiCall = this._gaxModule.createApiCall( + callPromise, + this._defaults[methodName], + descriptor, + this._opts.fallback + ); + + this.innerApiCalls[methodName] = apiCall; + } + + return this.simulatorStub; + } + + /** + * The DNS address for this API service. + * @returns {string} The DNS address for this service. + */ + static get servicePath() { + return 'policysimulator.googleapis.com'; + } + + /** + * The DNS address for this API service - same as servicePath(), + * exists for compatibility reasons. + * @returns {string} The DNS address for this service. + */ + static get apiEndpoint() { + return 'policysimulator.googleapis.com'; + } + + /** + * 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 -- + // ------------------- + /** + * Gets the specified {@link protos.google.cloud.policysimulator.v1.Replay|Replay}. Each + * `Replay` is available for at least 7 days. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The name of the {@link protos.google.cloud.policysimulator.v1.Replay|Replay} + * to retrieve, in the following format: + * + * `{projects|folders|organizations}/{resource-id}/locations/global/replays/{replay-id}`, + * where `{resource-id}` is the ID of the project, folder, or organization + * that owns the `Replay`. + * + * Example: + * `projects/my-example-project/locations/global/replays/506a5f7f-38ce-4d7d-8e03-479ce1833c36` + * @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.policysimulator.v1.Replay|Replay}. + * 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/simulator.get_replay.js + * region_tag:policysimulator_v1_generated_Simulator_GetReplay_async + */ + getReplay( + request?: protos.google.cloud.policysimulator.v1.IGetReplayRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.policysimulator.v1.IReplay, + protos.google.cloud.policysimulator.v1.IGetReplayRequest | undefined, + {} | undefined, + ] + >; + getReplay( + request: protos.google.cloud.policysimulator.v1.IGetReplayRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.policysimulator.v1.IReplay, + | protos.google.cloud.policysimulator.v1.IGetReplayRequest + | null + | undefined, + {} | null | undefined + > + ): void; + getReplay( + request: protos.google.cloud.policysimulator.v1.IGetReplayRequest, + callback: Callback< + protos.google.cloud.policysimulator.v1.IReplay, + | protos.google.cloud.policysimulator.v1.IGetReplayRequest + | null + | undefined, + {} | null | undefined + > + ): void; + getReplay( + request?: protos.google.cloud.policysimulator.v1.IGetReplayRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.policysimulator.v1.IReplay, + | protos.google.cloud.policysimulator.v1.IGetReplayRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.policysimulator.v1.IReplay, + | protos.google.cloud.policysimulator.v1.IGetReplayRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.policysimulator.v1.IReplay, + protos.google.cloud.policysimulator.v1.IGetReplayRequest | 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(); + return this.innerApiCalls.getReplay(request, options, callback); + } + + /** + * Creates and starts a {@link protos.google.cloud.policysimulator.v1.Replay|Replay} using + * the given {@link protos.google.cloud.policysimulator.v1.ReplayConfig|ReplayConfig}. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The parent resource where this + * {@link protos.google.cloud.policysimulator.v1.Replay|Replay} will be created. This + * resource must be a project, folder, or organization with a location. + * + * Example: `projects/my-example-project/locations/global` + * @param {google.cloud.policysimulator.v1.Replay} request.replay + * Required. The {@link protos.google.cloud.policysimulator.v1.Replay|Replay} to create. + * Set `Replay.ReplayConfig` to configure the replay. + * @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/simulator.create_replay.js + * region_tag:policysimulator_v1_generated_Simulator_CreateReplay_async + */ + createReplay( + request?: protos.google.cloud.policysimulator.v1.ICreateReplayRequest, + options?: CallOptions + ): Promise< + [ + LROperation< + protos.google.cloud.policysimulator.v1.IReplay, + protos.google.cloud.policysimulator.v1.IReplayOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined, + ] + >; + createReplay( + request: protos.google.cloud.policysimulator.v1.ICreateReplayRequest, + options: CallOptions, + callback: Callback< + LROperation< + protos.google.cloud.policysimulator.v1.IReplay, + protos.google.cloud.policysimulator.v1.IReplayOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + createReplay( + request: protos.google.cloud.policysimulator.v1.ICreateReplayRequest, + callback: Callback< + LROperation< + protos.google.cloud.policysimulator.v1.IReplay, + protos.google.cloud.policysimulator.v1.IReplayOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + createReplay( + request?: protos.google.cloud.policysimulator.v1.ICreateReplayRequest, + optionsOrCallback?: + | CallOptions + | Callback< + LROperation< + protos.google.cloud.policysimulator.v1.IReplay, + protos.google.cloud.policysimulator.v1.IReplayOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + callback?: Callback< + LROperation< + protos.google.cloud.policysimulator.v1.IReplay, + protos.google.cloud.policysimulator.v1.IReplayOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): Promise< + [ + LROperation< + protos.google.cloud.policysimulator.v1.IReplay, + protos.google.cloud.policysimulator.v1.IReplayOperationMetadata + >, + 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(); + return this.innerApiCalls.createReplay(request, options, callback); + } + /** + * Check the status of the long running operation returned by `createReplay()`. + * @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/simulator.create_replay.js + * region_tag:policysimulator_v1_generated_Simulator_CreateReplay_async + */ + async checkCreateReplayProgress( + name: string + ): Promise< + LROperation< + protos.google.cloud.policysimulator.v1.Replay, + protos.google.cloud.policysimulator.v1.ReplayOperationMetadata + > + > { + 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.createReplay, + this._gaxModule.createDefaultBackoffSettings() + ); + return decodeOperation as LROperation< + protos.google.cloud.policysimulator.v1.Replay, + protos.google.cloud.policysimulator.v1.ReplayOperationMetadata + >; + } + /** + * Lists the results of running a + * {@link protos.google.cloud.policysimulator.v1.Replay|Replay}. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The {@link protos.google.cloud.policysimulator.v1.Replay|Replay} whose + * results are listed, in the following format: + * + * `{projects|folders|organizations}/{resource-id}/locations/global/replays/{replay-id}` + * + * Example: + * `projects/my-project/locations/global/replays/506a5f7f-38ce-4d7d-8e03-479ce1833c36` + * @param {number} request.pageSize + * The maximum number of + * {@link protos.google.cloud.policysimulator.v1.ReplayResult|ReplayResult} objects to + * return. Defaults to 5000. + * + * The maximum value is 5000; values above 5000 are rounded down to 5000. + * @param {string} request.pageToken + * A page token, received from a previous + * {@link protos.google.cloud.policysimulator.v1.Simulator.ListReplayResults|Simulator.ListReplayResults} + * call. Provide this token to retrieve the next page of results. + * + * When paginating, all other parameters provided to + * [Simulator.ListReplayResults[] 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.policysimulator.v1.ReplayResult|ReplayResult}. + * 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 `listReplayResultsAsync()` + * 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. + */ + listReplayResults( + request?: protos.google.cloud.policysimulator.v1.IListReplayResultsRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.policysimulator.v1.IReplayResult[], + protos.google.cloud.policysimulator.v1.IListReplayResultsRequest | null, + protos.google.cloud.policysimulator.v1.IListReplayResultsResponse, + ] + >; + listReplayResults( + request: protos.google.cloud.policysimulator.v1.IListReplayResultsRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.cloud.policysimulator.v1.IListReplayResultsRequest, + | protos.google.cloud.policysimulator.v1.IListReplayResultsResponse + | null + | undefined, + protos.google.cloud.policysimulator.v1.IReplayResult + > + ): void; + listReplayResults( + request: protos.google.cloud.policysimulator.v1.IListReplayResultsRequest, + callback: PaginationCallback< + protos.google.cloud.policysimulator.v1.IListReplayResultsRequest, + | protos.google.cloud.policysimulator.v1.IListReplayResultsResponse + | null + | undefined, + protos.google.cloud.policysimulator.v1.IReplayResult + > + ): void; + listReplayResults( + request?: protos.google.cloud.policysimulator.v1.IListReplayResultsRequest, + optionsOrCallback?: + | CallOptions + | PaginationCallback< + protos.google.cloud.policysimulator.v1.IListReplayResultsRequest, + | protos.google.cloud.policysimulator.v1.IListReplayResultsResponse + | null + | undefined, + protos.google.cloud.policysimulator.v1.IReplayResult + >, + callback?: PaginationCallback< + protos.google.cloud.policysimulator.v1.IListReplayResultsRequest, + | protos.google.cloud.policysimulator.v1.IListReplayResultsResponse + | null + | undefined, + protos.google.cloud.policysimulator.v1.IReplayResult + > + ): Promise< + [ + protos.google.cloud.policysimulator.v1.IReplayResult[], + protos.google.cloud.policysimulator.v1.IListReplayResultsRequest | null, + protos.google.cloud.policysimulator.v1.IListReplayResultsResponse, + ] + > | 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(); + return this.innerApiCalls.listReplayResults(request, options, callback); + } + + /** + * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The {@link protos.google.cloud.policysimulator.v1.Replay|Replay} whose + * results are listed, in the following format: + * + * `{projects|folders|organizations}/{resource-id}/locations/global/replays/{replay-id}` + * + * Example: + * `projects/my-project/locations/global/replays/506a5f7f-38ce-4d7d-8e03-479ce1833c36` + * @param {number} request.pageSize + * The maximum number of + * {@link protos.google.cloud.policysimulator.v1.ReplayResult|ReplayResult} objects to + * return. Defaults to 5000. + * + * The maximum value is 5000; values above 5000 are rounded down to 5000. + * @param {string} request.pageToken + * A page token, received from a previous + * {@link protos.google.cloud.policysimulator.v1.Simulator.ListReplayResults|Simulator.ListReplayResults} + * call. Provide this token to retrieve the next page of results. + * + * When paginating, all other parameters provided to + * [Simulator.ListReplayResults[] 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.policysimulator.v1.ReplayResult|ReplayResult} 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 `listReplayResultsAsync()` + * 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. + */ + listReplayResultsStream( + request?: protos.google.cloud.policysimulator.v1.IListReplayResultsRequest, + 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['listReplayResults']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.listReplayResults.createStream( + this.innerApiCalls.listReplayResults as GaxCall, + request, + callSettings + ); + } + + /** + * Equivalent to `listReplayResults`, 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 {@link protos.google.cloud.policysimulator.v1.Replay|Replay} whose + * results are listed, in the following format: + * + * `{projects|folders|organizations}/{resource-id}/locations/global/replays/{replay-id}` + * + * Example: + * `projects/my-project/locations/global/replays/506a5f7f-38ce-4d7d-8e03-479ce1833c36` + * @param {number} request.pageSize + * The maximum number of + * {@link protos.google.cloud.policysimulator.v1.ReplayResult|ReplayResult} objects to + * return. Defaults to 5000. + * + * The maximum value is 5000; values above 5000 are rounded down to 5000. + * @param {string} request.pageToken + * A page token, received from a previous + * {@link protos.google.cloud.policysimulator.v1.Simulator.ListReplayResults|Simulator.ListReplayResults} + * call. Provide this token to retrieve the next page of results. + * + * When paginating, all other parameters provided to + * [Simulator.ListReplayResults[] 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.policysimulator.v1.ReplayResult|ReplayResult}. 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/simulator.list_replay_results.js + * region_tag:policysimulator_v1_generated_Simulator_ListReplayResults_async + */ + listReplayResultsAsync( + request?: protos.google.cloud.policysimulator.v1.IListReplayResultsRequest, + 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['listReplayResults']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.listReplayResults.asyncIterate( + this.innerApiCalls['listReplayResults'] as GaxCall, + request as {}, + callSettings + ) as AsyncIterable; + } + /** + * 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, + options?: + | 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]> { + 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 { + 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, + options?: + | gax.CallOptions + | Callback< + protos.google.protobuf.Empty, + protos.google.longrunning.CancelOperationRequest, + {} | undefined | null + >, + callback?: Callback< + protos.google.longrunning.CancelOperationRequest, + protos.google.protobuf.Empty, + {} | undefined | null + > + ): Promise { + 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, + options?: + | 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 { + return this.operationsClient.deleteOperation(request, options, callback); + } + + // -------------------- + // -- Path templates -- + // -------------------- + + /** + * Return a fully-qualified folderLocationReplay resource name string. + * + * @param {string} folder + * @param {string} location + * @param {string} replay + * @returns {string} Resource name string. + */ + folderLocationReplayPath(folder: string, location: string, replay: string) { + return this.pathTemplates.folderLocationReplayPathTemplate.render({ + folder: folder, + location: location, + replay: replay, + }); + } + + /** + * Parse the folder from FolderLocationReplay resource. + * + * @param {string} folderLocationReplayName + * A fully-qualified path representing folder_location_replay resource. + * @returns {string} A string representing the folder. + */ + matchFolderFromFolderLocationReplayName(folderLocationReplayName: string) { + return this.pathTemplates.folderLocationReplayPathTemplate.match( + folderLocationReplayName + ).folder; + } + + /** + * Parse the location from FolderLocationReplay resource. + * + * @param {string} folderLocationReplayName + * A fully-qualified path representing folder_location_replay resource. + * @returns {string} A string representing the location. + */ + matchLocationFromFolderLocationReplayName(folderLocationReplayName: string) { + return this.pathTemplates.folderLocationReplayPathTemplate.match( + folderLocationReplayName + ).location; + } + + /** + * Parse the replay from FolderLocationReplay resource. + * + * @param {string} folderLocationReplayName + * A fully-qualified path representing folder_location_replay resource. + * @returns {string} A string representing the replay. + */ + matchReplayFromFolderLocationReplayName(folderLocationReplayName: string) { + return this.pathTemplates.folderLocationReplayPathTemplate.match( + folderLocationReplayName + ).replay; + } + + /** + * Return a fully-qualified folderLocationReplayReplayResult resource name string. + * + * @param {string} folder + * @param {string} location + * @param {string} replay + * @param {string} replay_result + * @returns {string} Resource name string. + */ + folderLocationReplayReplayResultPath( + folder: string, + location: string, + replay: string, + replayResult: string + ) { + return this.pathTemplates.folderLocationReplayReplayResultPathTemplate.render( + { + folder: folder, + location: location, + replay: replay, + replay_result: replayResult, + } + ); + } + + /** + * Parse the folder from FolderLocationReplayReplayResult resource. + * + * @param {string} folderLocationReplayReplayResultName + * A fully-qualified path representing folder_location_replay_replay_result resource. + * @returns {string} A string representing the folder. + */ + matchFolderFromFolderLocationReplayReplayResultName( + folderLocationReplayReplayResultName: string + ) { + return this.pathTemplates.folderLocationReplayReplayResultPathTemplate.match( + folderLocationReplayReplayResultName + ).folder; + } + + /** + * Parse the location from FolderLocationReplayReplayResult resource. + * + * @param {string} folderLocationReplayReplayResultName + * A fully-qualified path representing folder_location_replay_replay_result resource. + * @returns {string} A string representing the location. + */ + matchLocationFromFolderLocationReplayReplayResultName( + folderLocationReplayReplayResultName: string + ) { + return this.pathTemplates.folderLocationReplayReplayResultPathTemplate.match( + folderLocationReplayReplayResultName + ).location; + } + + /** + * Parse the replay from FolderLocationReplayReplayResult resource. + * + * @param {string} folderLocationReplayReplayResultName + * A fully-qualified path representing folder_location_replay_replay_result resource. + * @returns {string} A string representing the replay. + */ + matchReplayFromFolderLocationReplayReplayResultName( + folderLocationReplayReplayResultName: string + ) { + return this.pathTemplates.folderLocationReplayReplayResultPathTemplate.match( + folderLocationReplayReplayResultName + ).replay; + } + + /** + * Parse the replay_result from FolderLocationReplayReplayResult resource. + * + * @param {string} folderLocationReplayReplayResultName + * A fully-qualified path representing folder_location_replay_replay_result resource. + * @returns {string} A string representing the replay_result. + */ + matchReplayResultFromFolderLocationReplayReplayResultName( + folderLocationReplayReplayResultName: string + ) { + return this.pathTemplates.folderLocationReplayReplayResultPathTemplate.match( + folderLocationReplayReplayResultName + ).replay_result; + } + + /** + * Return a fully-qualified organizationLocationReplay resource name string. + * + * @param {string} organization + * @param {string} location + * @param {string} replay + * @returns {string} Resource name string. + */ + organizationLocationReplayPath( + organization: string, + location: string, + replay: string + ) { + return this.pathTemplates.organizationLocationReplayPathTemplate.render({ + organization: organization, + location: location, + replay: replay, + }); + } + + /** + * Parse the organization from OrganizationLocationReplay resource. + * + * @param {string} organizationLocationReplayName + * A fully-qualified path representing organization_location_replay resource. + * @returns {string} A string representing the organization. + */ + matchOrganizationFromOrganizationLocationReplayName( + organizationLocationReplayName: string + ) { + return this.pathTemplates.organizationLocationReplayPathTemplate.match( + organizationLocationReplayName + ).organization; + } + + /** + * Parse the location from OrganizationLocationReplay resource. + * + * @param {string} organizationLocationReplayName + * A fully-qualified path representing organization_location_replay resource. + * @returns {string} A string representing the location. + */ + matchLocationFromOrganizationLocationReplayName( + organizationLocationReplayName: string + ) { + return this.pathTemplates.organizationLocationReplayPathTemplate.match( + organizationLocationReplayName + ).location; + } + + /** + * Parse the replay from OrganizationLocationReplay resource. + * + * @param {string} organizationLocationReplayName + * A fully-qualified path representing organization_location_replay resource. + * @returns {string} A string representing the replay. + */ + matchReplayFromOrganizationLocationReplayName( + organizationLocationReplayName: string + ) { + return this.pathTemplates.organizationLocationReplayPathTemplate.match( + organizationLocationReplayName + ).replay; + } + + /** + * Return a fully-qualified organizationLocationReplayReplayResult resource name string. + * + * @param {string} organization + * @param {string} location + * @param {string} replay + * @param {string} replay_result + * @returns {string} Resource name string. + */ + organizationLocationReplayReplayResultPath( + organization: string, + location: string, + replay: string, + replayResult: string + ) { + return this.pathTemplates.organizationLocationReplayReplayResultPathTemplate.render( + { + organization: organization, + location: location, + replay: replay, + replay_result: replayResult, + } + ); + } + + /** + * Parse the organization from OrganizationLocationReplayReplayResult resource. + * + * @param {string} organizationLocationReplayReplayResultName + * A fully-qualified path representing organization_location_replay_replay_result resource. + * @returns {string} A string representing the organization. + */ + matchOrganizationFromOrganizationLocationReplayReplayResultName( + organizationLocationReplayReplayResultName: string + ) { + return this.pathTemplates.organizationLocationReplayReplayResultPathTemplate.match( + organizationLocationReplayReplayResultName + ).organization; + } + + /** + * Parse the location from OrganizationLocationReplayReplayResult resource. + * + * @param {string} organizationLocationReplayReplayResultName + * A fully-qualified path representing organization_location_replay_replay_result resource. + * @returns {string} A string representing the location. + */ + matchLocationFromOrganizationLocationReplayReplayResultName( + organizationLocationReplayReplayResultName: string + ) { + return this.pathTemplates.organizationLocationReplayReplayResultPathTemplate.match( + organizationLocationReplayReplayResultName + ).location; + } + + /** + * Parse the replay from OrganizationLocationReplayReplayResult resource. + * + * @param {string} organizationLocationReplayReplayResultName + * A fully-qualified path representing organization_location_replay_replay_result resource. + * @returns {string} A string representing the replay. + */ + matchReplayFromOrganizationLocationReplayReplayResultName( + organizationLocationReplayReplayResultName: string + ) { + return this.pathTemplates.organizationLocationReplayReplayResultPathTemplate.match( + organizationLocationReplayReplayResultName + ).replay; + } + + /** + * Parse the replay_result from OrganizationLocationReplayReplayResult resource. + * + * @param {string} organizationLocationReplayReplayResultName + * A fully-qualified path representing organization_location_replay_replay_result resource. + * @returns {string} A string representing the replay_result. + */ + matchReplayResultFromOrganizationLocationReplayReplayResultName( + organizationLocationReplayReplayResultName: string + ) { + return this.pathTemplates.organizationLocationReplayReplayResultPathTemplate.match( + organizationLocationReplayReplayResultName + ).replay_result; + } + + /** + * Return a fully-qualified projectLocationReplay resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} replay + * @returns {string} Resource name string. + */ + projectLocationReplayPath(project: string, location: string, replay: string) { + return this.pathTemplates.projectLocationReplayPathTemplate.render({ + project: project, + location: location, + replay: replay, + }); + } + + /** + * Parse the project from ProjectLocationReplay resource. + * + * @param {string} projectLocationReplayName + * A fully-qualified path representing project_location_replay resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectLocationReplayName(projectLocationReplayName: string) { + return this.pathTemplates.projectLocationReplayPathTemplate.match( + projectLocationReplayName + ).project; + } + + /** + * Parse the location from ProjectLocationReplay resource. + * + * @param {string} projectLocationReplayName + * A fully-qualified path representing project_location_replay resource. + * @returns {string} A string representing the location. + */ + matchLocationFromProjectLocationReplayName( + projectLocationReplayName: string + ) { + return this.pathTemplates.projectLocationReplayPathTemplate.match( + projectLocationReplayName + ).location; + } + + /** + * Parse the replay from ProjectLocationReplay resource. + * + * @param {string} projectLocationReplayName + * A fully-qualified path representing project_location_replay resource. + * @returns {string} A string representing the replay. + */ + matchReplayFromProjectLocationReplayName(projectLocationReplayName: string) { + return this.pathTemplates.projectLocationReplayPathTemplate.match( + projectLocationReplayName + ).replay; + } + + /** + * Return a fully-qualified projectLocationReplayReplayResult resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} replay + * @param {string} replay_result + * @returns {string} Resource name string. + */ + projectLocationReplayReplayResultPath( + project: string, + location: string, + replay: string, + replayResult: string + ) { + return this.pathTemplates.projectLocationReplayReplayResultPathTemplate.render( + { + project: project, + location: location, + replay: replay, + replay_result: replayResult, + } + ); + } + + /** + * Parse the project from ProjectLocationReplayReplayResult resource. + * + * @param {string} projectLocationReplayReplayResultName + * A fully-qualified path representing project_location_replay_replay_result resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectLocationReplayReplayResultName( + projectLocationReplayReplayResultName: string + ) { + return this.pathTemplates.projectLocationReplayReplayResultPathTemplate.match( + projectLocationReplayReplayResultName + ).project; + } + + /** + * Parse the location from ProjectLocationReplayReplayResult resource. + * + * @param {string} projectLocationReplayReplayResultName + * A fully-qualified path representing project_location_replay_replay_result resource. + * @returns {string} A string representing the location. + */ + matchLocationFromProjectLocationReplayReplayResultName( + projectLocationReplayReplayResultName: string + ) { + return this.pathTemplates.projectLocationReplayReplayResultPathTemplate.match( + projectLocationReplayReplayResultName + ).location; + } + + /** + * Parse the replay from ProjectLocationReplayReplayResult resource. + * + * @param {string} projectLocationReplayReplayResultName + * A fully-qualified path representing project_location_replay_replay_result resource. + * @returns {string} A string representing the replay. + */ + matchReplayFromProjectLocationReplayReplayResultName( + projectLocationReplayReplayResultName: string + ) { + return this.pathTemplates.projectLocationReplayReplayResultPathTemplate.match( + projectLocationReplayReplayResultName + ).replay; + } + + /** + * Parse the replay_result from ProjectLocationReplayReplayResult resource. + * + * @param {string} projectLocationReplayReplayResultName + * A fully-qualified path representing project_location_replay_replay_result resource. + * @returns {string} A string representing the replay_result. + */ + matchReplayResultFromProjectLocationReplayReplayResultName( + projectLocationReplayReplayResultName: string + ) { + return this.pathTemplates.projectLocationReplayReplayResultPathTemplate.match( + projectLocationReplayReplayResultName + ).replay_result; + } + + /** + * 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.simulatorStub && !this._terminated) { + return this.simulatorStub.then(stub => { + this._terminated = true; + stub.close(); + this.operationsClient.close(); + }); + } + return Promise.resolve(); + } +} diff --git a/packages/google-cloud-policysimulator/src/v1/simulator_client_config.json b/packages/google-cloud-policysimulator/src/v1/simulator_client_config.json new file mode 100644 index 00000000000..f145073d183 --- /dev/null +++ b/packages/google-cloud-policysimulator/src/v1/simulator_client_config.json @@ -0,0 +1,53 @@ +{ + "interfaces": { + "google.cloud.policysimulator.v1.Simulator": { + "retry_codes": { + "non_idempotent": [], + "idempotent": [ + "DEADLINE_EXCEEDED", + "UNAVAILABLE" + ], + "unavailable": [ + "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 + }, + "ce5b960a6ed052e690863808e4f0deff3dc7d49f": { + "initial_retry_delay_millis": 1000, + "retry_delay_multiplier": 1.3, + "max_retry_delay_millis": 10000, + "initial_rpc_timeout_millis": 60000, + "rpc_timeout_multiplier": 1, + "max_rpc_timeout_millis": 60000, + "total_timeout_millis": 600000 + } + }, + "methods": { + "GetReplay": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "ce5b960a6ed052e690863808e4f0deff3dc7d49f" + }, + "CreateReplay": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "ListReplayResults": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "ce5b960a6ed052e690863808e4f0deff3dc7d49f" + } + } + } + } +} diff --git a/packages/google-cloud-policysimulator/src/v1/simulator_proto_list.json b/packages/google-cloud-policysimulator/src/v1/simulator_proto_list.json new file mode 100644 index 00000000000..f7d7a0dedce --- /dev/null +++ b/packages/google-cloud-policysimulator/src/v1/simulator_proto_list.json @@ -0,0 +1,4 @@ +[ + "../../protos/google/cloud/policysimulator/v1/explanations.proto", + "../../protos/google/cloud/policysimulator/v1/simulator.proto" +] diff --git a/packages/google-cloud-policysimulator/system-test/fixtures/sample/src/index.js b/packages/google-cloud-policysimulator/system-test/fixtures/sample/src/index.js new file mode 100644 index 00000000000..161e0d2cf7b --- /dev/null +++ b/packages/google-cloud-policysimulator/system-test/fixtures/sample/src/index.js @@ -0,0 +1,26 @@ +// Copyright 2023 Google LLC +// +// Licensed under the Apache License, Version 2.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 policysimulator = require('@google-cloud/policysimulator'); + +function main() { + const simulatorClient = new policysimulator.SimulatorClient(); +} + +main(); diff --git a/packages/google-cloud-policysimulator/system-test/fixtures/sample/src/index.ts b/packages/google-cloud-policysimulator/system-test/fixtures/sample/src/index.ts new file mode 100644 index 00000000000..f8a695bf345 --- /dev/null +++ b/packages/google-cloud-policysimulator/system-test/fixtures/sample/src/index.ts @@ -0,0 +1,32 @@ +// Copyright 2023 Google LLC +// +// Licensed under the Apache License, Version 2.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 {SimulatorClient} from '@google-cloud/policysimulator'; + +// check that the client class type name can be used +function doStuffWithSimulatorClient(client: SimulatorClient) { + client.close(); +} + +function main() { + // check that the client instance can be created + const simulatorClient = new SimulatorClient(); + doStuffWithSimulatorClient(simulatorClient); +} + +main(); diff --git a/packages/google-cloud-policysimulator/system-test/install.ts b/packages/google-cloud-policysimulator/system-test/install.ts new file mode 100644 index 00000000000..f61fe236476 --- /dev/null +++ b/packages/google-cloud-policysimulator/system-test/install.ts @@ -0,0 +1,51 @@ +// Copyright 2023 Google LLC +// +// Licensed under the Apache License, Version 2.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/google-cloud-policysimulator/test/gapic_simulator_v1.ts b/packages/google-cloud-policysimulator/test/gapic_simulator_v1.ts new file mode 100644 index 00000000000..079d3513f42 --- /dev/null +++ b/packages/google-cloud-policysimulator/test/gapic_simulator_v1.ts @@ -0,0 +1,1751 @@ +// Copyright 2023 Google LLC +// +// Licensed under the Apache License, Version 2.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 simulatorModule 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 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('v1.SimulatorClient', () => { + describe('Common methods', () => { + it('has servicePath', () => { + const servicePath = simulatorModule.v1.SimulatorClient.servicePath; + assert(servicePath); + }); + + it('has apiEndpoint', () => { + const apiEndpoint = simulatorModule.v1.SimulatorClient.apiEndpoint; + assert(apiEndpoint); + }); + + it('has port', () => { + const port = simulatorModule.v1.SimulatorClient.port; + assert(port); + assert(typeof port === 'number'); + }); + + it('should create a client with no option', () => { + const client = new simulatorModule.v1.SimulatorClient(); + assert(client); + }); + + it('should create a client with gRPC fallback', () => { + const client = new simulatorModule.v1.SimulatorClient({ + fallback: true, + }); + assert(client); + }); + + it('has initialize method and supports deferred initialization', async () => { + const client = new simulatorModule.v1.SimulatorClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + assert.strictEqual(client.simulatorStub, undefined); + await client.initialize(); + assert(client.simulatorStub); + }); + + it('has close method for the initialized client', done => { + const client = new simulatorModule.v1.SimulatorClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + assert(client.simulatorStub); + client.close().then(() => { + done(); + }); + }); + + it('has close method for the non-initialized client', done => { + const client = new simulatorModule.v1.SimulatorClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + assert.strictEqual(client.simulatorStub, undefined); + client.close().then(() => { + done(); + }); + }); + + it('has getProjectId method', async () => { + const fakeProjectId = 'fake-project-id'; + const client = new simulatorModule.v1.SimulatorClient({ + 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 simulatorModule.v1.SimulatorClient({ + 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('getReplay', () => { + it('invokes getReplay without error', async () => { + const client = new simulatorModule.v1.SimulatorClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.policysimulator.v1.GetReplayRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.policysimulator.v1.GetReplayRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.policysimulator.v1.Replay() + ); + client.innerApiCalls.getReplay = stubSimpleCall(expectedResponse); + const [response] = await client.getReplay(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.getReplay as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getReplay as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getReplay without error using callback', async () => { + const client = new simulatorModule.v1.SimulatorClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.policysimulator.v1.GetReplayRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.policysimulator.v1.GetReplayRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.policysimulator.v1.Replay() + ); + client.innerApiCalls.getReplay = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getReplay( + request, + ( + err?: Error | null, + result?: protos.google.cloud.policysimulator.v1.IReplay | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.getReplay as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getReplay as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getReplay with error', async () => { + const client = new simulatorModule.v1.SimulatorClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.policysimulator.v1.GetReplayRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.policysimulator.v1.GetReplayRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.getReplay = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.getReplay(request), expectedError); + const actualRequest = ( + client.innerApiCalls.getReplay as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getReplay as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getReplay with closed client', async () => { + const client = new simulatorModule.v1.SimulatorClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.policysimulator.v1.GetReplayRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.policysimulator.v1.GetReplayRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.getReplay(request), expectedError); + }); + }); + + describe('createReplay', () => { + it('invokes createReplay without error', async () => { + const client = new simulatorModule.v1.SimulatorClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.policysimulator.v1.CreateReplayRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.policysimulator.v1.CreateReplayRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.createReplay = stubLongRunningCall(expectedResponse); + const [operation] = await client.createReplay(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.createReplay as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createReplay as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createReplay without error using callback', async () => { + const client = new simulatorModule.v1.SimulatorClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.policysimulator.v1.CreateReplayRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.policysimulator.v1.CreateReplayRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.createReplay = + stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.createReplay( + request, + ( + err?: Error | null, + result?: LROperation< + protos.google.cloud.policysimulator.v1.IReplay, + protos.google.cloud.policysimulator.v1.IReplayOperationMetadata + > | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const operation = (await promise) as LROperation< + protos.google.cloud.policysimulator.v1.IReplay, + protos.google.cloud.policysimulator.v1.IReplayOperationMetadata + >; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.createReplay as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createReplay as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createReplay with call error', async () => { + const client = new simulatorModule.v1.SimulatorClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.policysimulator.v1.CreateReplayRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.policysimulator.v1.CreateReplayRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.createReplay = stubLongRunningCall( + undefined, + expectedError + ); + await assert.rejects(client.createReplay(request), expectedError); + const actualRequest = ( + client.innerApiCalls.createReplay as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createReplay as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createReplay with LRO error', async () => { + const client = new simulatorModule.v1.SimulatorClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.policysimulator.v1.CreateReplayRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.policysimulator.v1.CreateReplayRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.createReplay = stubLongRunningCall( + undefined, + undefined, + expectedError + ); + const [operation] = await client.createReplay(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = ( + client.innerApiCalls.createReplay as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createReplay as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkCreateReplayProgress without error', async () => { + const client = new simulatorModule.v1.SimulatorClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + 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.checkCreateReplayProgress( + expectedResponse.name + ); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkCreateReplayProgress with error', async () => { + const client = new simulatorModule.v1.SimulatorClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const expectedError = new Error('expected'); + + client.operationsClient.getOperation = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.checkCreateReplayProgress(''), expectedError); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + }); + + describe('listReplayResults', () => { + it('invokes listReplayResults without error', async () => { + const client = new simulatorModule.v1.SimulatorClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.policysimulator.v1.ListReplayResultsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.policysimulator.v1.ListReplayResultsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.policysimulator.v1.ReplayResult() + ), + generateSampleMessage( + new protos.google.cloud.policysimulator.v1.ReplayResult() + ), + generateSampleMessage( + new protos.google.cloud.policysimulator.v1.ReplayResult() + ), + ]; + client.innerApiCalls.listReplayResults = stubSimpleCall(expectedResponse); + const [response] = await client.listReplayResults(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.listReplayResults as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listReplayResults as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listReplayResults without error using callback', async () => { + const client = new simulatorModule.v1.SimulatorClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.policysimulator.v1.ListReplayResultsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.policysimulator.v1.ListReplayResultsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.policysimulator.v1.ReplayResult() + ), + generateSampleMessage( + new protos.google.cloud.policysimulator.v1.ReplayResult() + ), + generateSampleMessage( + new protos.google.cloud.policysimulator.v1.ReplayResult() + ), + ]; + client.innerApiCalls.listReplayResults = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.listReplayResults( + request, + ( + err?: Error | null, + result?: + | protos.google.cloud.policysimulator.v1.IReplayResult[] + | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.listReplayResults as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listReplayResults as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listReplayResults with error', async () => { + const client = new simulatorModule.v1.SimulatorClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.policysimulator.v1.ListReplayResultsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.policysimulator.v1.ListReplayResultsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.listReplayResults = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.listReplayResults(request), expectedError); + const actualRequest = ( + client.innerApiCalls.listReplayResults as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listReplayResults as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listReplayResultsStream without error', async () => { + const client = new simulatorModule.v1.SimulatorClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.policysimulator.v1.ListReplayResultsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.policysimulator.v1.ListReplayResultsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.policysimulator.v1.ReplayResult() + ), + generateSampleMessage( + new protos.google.cloud.policysimulator.v1.ReplayResult() + ), + generateSampleMessage( + new protos.google.cloud.policysimulator.v1.ReplayResult() + ), + ]; + client.descriptors.page.listReplayResults.createStream = + stubPageStreamingCall(expectedResponse); + const stream = client.listReplayResultsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.policysimulator.v1.ReplayResult[] = + []; + stream.on( + 'data', + (response: protos.google.cloud.policysimulator.v1.ReplayResult) => { + 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.listReplayResults.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.listReplayResults, request) + ); + assert( + (client.descriptors.page.listReplayResults.createStream as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('invokes listReplayResultsStream with error', async () => { + const client = new simulatorModule.v1.SimulatorClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.policysimulator.v1.ListReplayResultsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.policysimulator.v1.ListReplayResultsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.descriptors.page.listReplayResults.createStream = + stubPageStreamingCall(undefined, expectedError); + const stream = client.listReplayResultsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.policysimulator.v1.ReplayResult[] = + []; + stream.on( + 'data', + (response: protos.google.cloud.policysimulator.v1.ReplayResult) => { + responses.push(response); + } + ); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert( + (client.descriptors.page.listReplayResults.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.listReplayResults, request) + ); + assert( + (client.descriptors.page.listReplayResults.createStream as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listReplayResults without error', async () => { + const client = new simulatorModule.v1.SimulatorClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.policysimulator.v1.ListReplayResultsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.policysimulator.v1.ListReplayResultsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.policysimulator.v1.ReplayResult() + ), + generateSampleMessage( + new protos.google.cloud.policysimulator.v1.ReplayResult() + ), + generateSampleMessage( + new protos.google.cloud.policysimulator.v1.ReplayResult() + ), + ]; + client.descriptors.page.listReplayResults.asyncIterate = + stubAsyncIterationCall(expectedResponse); + const responses: protos.google.cloud.policysimulator.v1.IReplayResult[] = + []; + const iterable = client.listReplayResultsAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + ( + client.descriptors.page.listReplayResults.asyncIterate as SinonStub + ).getCall(0).args[1], + request + ); + assert( + (client.descriptors.page.listReplayResults.asyncIterate as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listReplayResults with error', async () => { + const client = new simulatorModule.v1.SimulatorClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.policysimulator.v1.ListReplayResultsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.policysimulator.v1.ListReplayResultsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.descriptors.page.listReplayResults.asyncIterate = + stubAsyncIterationCall(undefined, expectedError); + const iterable = client.listReplayResultsAsync(request); + await assert.rejects(async () => { + const responses: protos.google.cloud.policysimulator.v1.IReplayResult[] = + []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + ( + client.descriptors.page.listReplayResults.asyncIterate as SinonStub + ).getCall(0).args[1], + request + ); + assert( + (client.descriptors.page.listReplayResults.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 simulatorModule.v1.SimulatorClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + 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 simulatorModule.v1.SimulatorClient({ + 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); + } + } + ); + }); + 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 simulatorModule.v1.SimulatorClient({ + 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 simulatorModule.v1.SimulatorClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + 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 simulatorModule.v1.SimulatorClient({ + 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); + } + } + ); + }); + 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 simulatorModule.v1.SimulatorClient({ + 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 simulatorModule.v1.SimulatorClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + 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 simulatorModule.v1.SimulatorClient({ + 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); + } + } + ); + }); + 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 simulatorModule.v1.SimulatorClient({ + 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 simulatorModule.v1.SimulatorClient({ + 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.ListOperationsResponse[] = + []; + 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 simulatorModule.v1.SimulatorClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + 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.ListOperationsResponse[] = + []; + 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('folderLocationReplay', () => { + const fakePath = '/rendered/path/folderLocationReplay'; + const expectedParameters = { + folder: 'folderValue', + location: 'locationValue', + replay: 'replayValue', + }; + const client = new simulatorModule.v1.SimulatorClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.folderLocationReplayPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.folderLocationReplayPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('folderLocationReplayPath', () => { + const result = client.folderLocationReplayPath( + 'folderValue', + 'locationValue', + 'replayValue' + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates.folderLocationReplayPathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchFolderFromFolderLocationReplayName', () => { + const result = client.matchFolderFromFolderLocationReplayName(fakePath); + assert.strictEqual(result, 'folderValue'); + assert( + ( + client.pathTemplates.folderLocationReplayPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromFolderLocationReplayName', () => { + const result = + client.matchLocationFromFolderLocationReplayName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + ( + client.pathTemplates.folderLocationReplayPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchReplayFromFolderLocationReplayName', () => { + const result = client.matchReplayFromFolderLocationReplayName(fakePath); + assert.strictEqual(result, 'replayValue'); + assert( + ( + client.pathTemplates.folderLocationReplayPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('folderLocationReplayReplayResult', () => { + const fakePath = '/rendered/path/folderLocationReplayReplayResult'; + const expectedParameters = { + folder: 'folderValue', + location: 'locationValue', + replay: 'replayValue', + replay_result: 'replayResultValue', + }; + const client = new simulatorModule.v1.SimulatorClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.folderLocationReplayReplayResultPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.folderLocationReplayReplayResultPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('folderLocationReplayReplayResultPath', () => { + const result = client.folderLocationReplayReplayResultPath( + 'folderValue', + 'locationValue', + 'replayValue', + 'replayResultValue' + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates.folderLocationReplayReplayResultPathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchFolderFromFolderLocationReplayReplayResultName', () => { + const result = + client.matchFolderFromFolderLocationReplayReplayResultName(fakePath); + assert.strictEqual(result, 'folderValue'); + assert( + ( + client.pathTemplates.folderLocationReplayReplayResultPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromFolderLocationReplayReplayResultName', () => { + const result = + client.matchLocationFromFolderLocationReplayReplayResultName( + fakePath + ); + assert.strictEqual(result, 'locationValue'); + assert( + ( + client.pathTemplates.folderLocationReplayReplayResultPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchReplayFromFolderLocationReplayReplayResultName', () => { + const result = + client.matchReplayFromFolderLocationReplayReplayResultName(fakePath); + assert.strictEqual(result, 'replayValue'); + assert( + ( + client.pathTemplates.folderLocationReplayReplayResultPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchReplayResultFromFolderLocationReplayReplayResultName', () => { + const result = + client.matchReplayResultFromFolderLocationReplayReplayResultName( + fakePath + ); + assert.strictEqual(result, 'replayResultValue'); + assert( + ( + client.pathTemplates.folderLocationReplayReplayResultPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('organizationLocationReplay', () => { + const fakePath = '/rendered/path/organizationLocationReplay'; + const expectedParameters = { + organization: 'organizationValue', + location: 'locationValue', + replay: 'replayValue', + }; + const client = new simulatorModule.v1.SimulatorClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.organizationLocationReplayPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.organizationLocationReplayPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('organizationLocationReplayPath', () => { + const result = client.organizationLocationReplayPath( + 'organizationValue', + 'locationValue', + 'replayValue' + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates.organizationLocationReplayPathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchOrganizationFromOrganizationLocationReplayName', () => { + const result = + client.matchOrganizationFromOrganizationLocationReplayName(fakePath); + assert.strictEqual(result, 'organizationValue'); + assert( + ( + client.pathTemplates.organizationLocationReplayPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromOrganizationLocationReplayName', () => { + const result = + client.matchLocationFromOrganizationLocationReplayName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + ( + client.pathTemplates.organizationLocationReplayPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchReplayFromOrganizationLocationReplayName', () => { + const result = + client.matchReplayFromOrganizationLocationReplayName(fakePath); + assert.strictEqual(result, 'replayValue'); + assert( + ( + client.pathTemplates.organizationLocationReplayPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('organizationLocationReplayReplayResult', () => { + const fakePath = '/rendered/path/organizationLocationReplayReplayResult'; + const expectedParameters = { + organization: 'organizationValue', + location: 'locationValue', + replay: 'replayValue', + replay_result: 'replayResultValue', + }; + const client = new simulatorModule.v1.SimulatorClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.organizationLocationReplayReplayResultPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.organizationLocationReplayReplayResultPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('organizationLocationReplayReplayResultPath', () => { + const result = client.organizationLocationReplayReplayResultPath( + 'organizationValue', + 'locationValue', + 'replayValue', + 'replayResultValue' + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates + .organizationLocationReplayReplayResultPathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchOrganizationFromOrganizationLocationReplayReplayResultName', () => { + const result = + client.matchOrganizationFromOrganizationLocationReplayReplayResultName( + fakePath + ); + assert.strictEqual(result, 'organizationValue'); + assert( + ( + client.pathTemplates + .organizationLocationReplayReplayResultPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromOrganizationLocationReplayReplayResultName', () => { + const result = + client.matchLocationFromOrganizationLocationReplayReplayResultName( + fakePath + ); + assert.strictEqual(result, 'locationValue'); + assert( + ( + client.pathTemplates + .organizationLocationReplayReplayResultPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchReplayFromOrganizationLocationReplayReplayResultName', () => { + const result = + client.matchReplayFromOrganizationLocationReplayReplayResultName( + fakePath + ); + assert.strictEqual(result, 'replayValue'); + assert( + ( + client.pathTemplates + .organizationLocationReplayReplayResultPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchReplayResultFromOrganizationLocationReplayReplayResultName', () => { + const result = + client.matchReplayResultFromOrganizationLocationReplayReplayResultName( + fakePath + ); + assert.strictEqual(result, 'replayResultValue'); + assert( + ( + client.pathTemplates + .organizationLocationReplayReplayResultPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('projectLocationReplay', () => { + const fakePath = '/rendered/path/projectLocationReplay'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + replay: 'replayValue', + }; + const client = new simulatorModule.v1.SimulatorClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.projectLocationReplayPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.projectLocationReplayPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('projectLocationReplayPath', () => { + const result = client.projectLocationReplayPath( + 'projectValue', + 'locationValue', + 'replayValue' + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates.projectLocationReplayPathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromProjectLocationReplayName', () => { + const result = + client.matchProjectFromProjectLocationReplayName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + ( + client.pathTemplates.projectLocationReplayPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromProjectLocationReplayName', () => { + const result = + client.matchLocationFromProjectLocationReplayName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + ( + client.pathTemplates.projectLocationReplayPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchReplayFromProjectLocationReplayName', () => { + const result = + client.matchReplayFromProjectLocationReplayName(fakePath); + assert.strictEqual(result, 'replayValue'); + assert( + ( + client.pathTemplates.projectLocationReplayPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('projectLocationReplayReplayResult', () => { + const fakePath = '/rendered/path/projectLocationReplayReplayResult'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + replay: 'replayValue', + replay_result: 'replayResultValue', + }; + const client = new simulatorModule.v1.SimulatorClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.projectLocationReplayReplayResultPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.projectLocationReplayReplayResultPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('projectLocationReplayReplayResultPath', () => { + const result = client.projectLocationReplayReplayResultPath( + 'projectValue', + 'locationValue', + 'replayValue', + 'replayResultValue' + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates.projectLocationReplayReplayResultPathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromProjectLocationReplayReplayResultName', () => { + const result = + client.matchProjectFromProjectLocationReplayReplayResultName( + fakePath + ); + assert.strictEqual(result, 'projectValue'); + assert( + ( + client.pathTemplates.projectLocationReplayReplayResultPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromProjectLocationReplayReplayResultName', () => { + const result = + client.matchLocationFromProjectLocationReplayReplayResultName( + fakePath + ); + assert.strictEqual(result, 'locationValue'); + assert( + ( + client.pathTemplates.projectLocationReplayReplayResultPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchReplayFromProjectLocationReplayReplayResultName', () => { + const result = + client.matchReplayFromProjectLocationReplayReplayResultName(fakePath); + assert.strictEqual(result, 'replayValue'); + assert( + ( + client.pathTemplates.projectLocationReplayReplayResultPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchReplayResultFromProjectLocationReplayReplayResultName', () => { + const result = + client.matchReplayResultFromProjectLocationReplayReplayResultName( + fakePath + ); + assert.strictEqual(result, 'replayResultValue'); + assert( + ( + client.pathTemplates.projectLocationReplayReplayResultPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + }); +}); diff --git a/packages/google-cloud-policysimulator/tsconfig.json b/packages/google-cloud-policysimulator/tsconfig.json new file mode 100644 index 00000000000..c78f1c884ef --- /dev/null +++ b/packages/google-cloud-policysimulator/tsconfig.json @@ -0,0 +1,19 @@ +{ + "extends": "./node_modules/gts/tsconfig-google.json", + "compilerOptions": { + "rootDir": ".", + "outDir": "build", + "resolveJsonModule": true, + "lib": [ + "es2018", + "dom" + ] + }, + "include": [ + "src/*.ts", + "src/**/*.ts", + "test/*.ts", + "test/**/*.ts", + "system-test/*.ts" + ] +} diff --git a/packages/google-cloud-policysimulator/webpack.config.js b/packages/google-cloud-policysimulator/webpack.config.js new file mode 100644 index 00000000000..ec8b9ef7841 --- /dev/null +++ b/packages/google-cloud-policysimulator/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: 'Simulator', + filename: './simulator.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/google-cloud-policytroubleshooter-iam/CHANGELOG.md b/packages/google-cloud-policytroubleshooter-iam/CHANGELOG.md index fb752c378b0..1ad9983da34 100644 --- a/packages/google-cloud-policytroubleshooter-iam/CHANGELOG.md +++ b/packages/google-cloud-policytroubleshooter-iam/CHANGELOG.md @@ -1,5 +1,12 @@ # Changelog +## [0.2.1](https://github.com/googleapis/google-cloud-node/compare/policy-troubleshooter-iam-v0.2.0...policy-troubleshooter-iam-v0.2.1) (2023-09-11) + + +### Bug Fixes + +* Publication issues with containeranalysis and policytroubleshooter ([#4628](https://github.com/googleapis/google-cloud-node/issues/4628)) ([2ba7b48](https://github.com/googleapis/google-cloud-node/commit/2ba7b489e6109e5bf3d5e7276a0b94558ebd48d0)) + ## [0.2.0](https://github.com/googleapis/google-cloud-node/compare/policy-troubleshooter-iam-v0.1.0...policy-troubleshooter-iam-v0.2.0) (2023-09-06) diff --git a/packages/google-cloud-policytroubleshooter-iam/README.md b/packages/google-cloud-policytroubleshooter-iam/README.md index d1ae23dd944..775c145ece8 100644 --- a/packages/google-cloud-policytroubleshooter-iam/README.md +++ b/packages/google-cloud-policytroubleshooter-iam/README.md @@ -2,7 +2,7 @@ [//]: # "To regenerate it, use `python -m synthtool`." Google Cloud Platform logo -# [Policy Troubleshooter API: Node.js Client](googleapis/nodejs-iam) +# [Policy Troubleshooter API: Node.js Client](https://github.com/googleapis/google-cloud-node/tree/main/packages/google-cloud-policytroubleshooter-iam) [![release level](https://img.shields.io/badge/release%20level-preview-yellow.svg?style=flat)](https://cloud.google.com/terms/launch-stages) [![npm version](https://img.shields.io/npm/v/@google-cloud/policy-troubleshooter-iam.svg)](https://www.npmjs.org/package/@google-cloud/policy-troubleshooter-iam) @@ -14,11 +14,11 @@ Iam client for Node.js A comprehensive list of changes in each version may be found in -[the CHANGELOG](googleapis/nodejs-iam/CHANGELOG.md). +[the CHANGELOG](https://github.com/googleapis/google-cloud-node/tree/main/packages/google-cloud-policytroubleshooter-iam/CHANGELOG.md). * [Policy Troubleshooter API Node.js Client API Reference][client-docs] * [Policy Troubleshooter API Documentation][product-docs] -* [github.com/googleapis/nodejs-iam](googleapis/nodejs-iam) +* [github.com/googleapis/google-cloud-node/packages/google-cloud-policytroubleshooter-iam](https://github.com/googleapis/google-cloud-node/tree/main/packages/google-cloud-policytroubleshooter-iam) Read more about the client libraries for Cloud APIs, including the older Google APIs Client Libraries, in [Client Libraries Explained][explained]. @@ -89,13 +89,13 @@ callTroubleshootIamPolicy(); ## Samples -Samples are in the [`samples/`](googleapis/nodejs-iam/samples) directory. Each sample's `README.md` has instructions for running its sample. +Samples are in the [`samples/`](https://github.com/googleapis/google-cloud-node/tree/main/packages/google-cloud-policytroubleshooter-iam/samples) directory. Each sample's `README.md` has instructions for running its sample. | Sample | Source Code | Try it | | --------------------------- | --------------------------------- | ------ | -| Policy_troubleshooter.troubleshoot_iam_policy | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-policytroubleshooter-iam/samples/generated/v3/policy_troubleshooter.troubleshoot_iam_policy.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-cloud-policytroubleshooter-iam/samples/generated/v3/policy_troubleshooter.troubleshoot_iam_policy.js,googleapis/nodejs-iam/samples/README.md) | -| Policy_troubleshooter.troubleshoot_iam_policy | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-policytroubleshooter-iam/samples/generated/v3beta/policy_troubleshooter.troubleshoot_iam_policy.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-cloud-policytroubleshooter-iam/samples/generated/v3beta/policy_troubleshooter.troubleshoot_iam_policy.js,googleapis/nodejs-iam/samples/README.md) | -| Quickstart | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-policytroubleshooter-iam/samples/quickstart.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-cloud-policytroubleshooter-iam/samples/quickstart.js,googleapis/nodejs-iam/samples/README.md) | +| Policy_troubleshooter.troubleshoot_iam_policy | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-policytroubleshooter-iam/samples/generated/v3/policy_troubleshooter.troubleshoot_iam_policy.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-cloud-policytroubleshooter-iam/samples/generated/v3/policy_troubleshooter.troubleshoot_iam_policy.js,packages/google-cloud-policytroubleshooter-iam/samples/README.md) | +| Policy_troubleshooter.troubleshoot_iam_policy | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-policytroubleshooter-iam/samples/generated/v3beta/policy_troubleshooter.troubleshoot_iam_policy.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-cloud-policytroubleshooter-iam/samples/generated/v3beta/policy_troubleshooter.troubleshoot_iam_policy.js,packages/google-cloud-policytroubleshooter-iam/samples/README.md) | +| Quickstart | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-policytroubleshooter-iam/samples/quickstart.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-cloud-policytroubleshooter-iam/samples/quickstart.js,packages/google-cloud-policytroubleshooter-iam/samples/README.md) | diff --git a/packages/google-cloud-policytroubleshooter-iam/package.json b/packages/google-cloud-policytroubleshooter-iam/package.json index 6db43cc6291..12747485601 100644 --- a/packages/google-cloud-policytroubleshooter-iam/package.json +++ b/packages/google-cloud-policytroubleshooter-iam/package.json @@ -1,8 +1,12 @@ { "name": "@google-cloud/policy-troubleshooter-iam", - "version": "0.2.0", + "version": "0.2.1", "description": "Iam client for Node.js", - "repository": "googleapis/nodejs-iam", + "repository": { + "type": "git", + "directory": "packages/google-cloud-policytroubleshooter-iam", + "url": "https://github.com/googleapis/google-cloud-node.git" + }, "license": "Apache-2.0", "author": "Google LLC", "main": "build/src/index.js", @@ -24,6 +28,7 @@ "policies", "policy troubleshooter" ], + "homepage": "https://github.com/googleapis/google-cloud-node/tree/main/packages/google-cloud-policytroubleshooter-iam", "scripts": { "clean": "gts clean", "compile": "tsc -p . && cp -r protos build/ && minifyProtoJson", diff --git a/packages/google-cloud-policytroubleshooter-iam/samples/generated/v3/snippet_metadata_google.cloud.policytroubleshooter.iam.v3.json b/packages/google-cloud-policytroubleshooter-iam/samples/generated/v3/snippet_metadata_google.cloud.policytroubleshooter.iam.v3.json index 3e253204127..393b2789cf4 100644 --- a/packages/google-cloud-policytroubleshooter-iam/samples/generated/v3/snippet_metadata_google.cloud.policytroubleshooter.iam.v3.json +++ b/packages/google-cloud-policytroubleshooter-iam/samples/generated/v3/snippet_metadata_google.cloud.policytroubleshooter.iam.v3.json @@ -1,7 +1,7 @@ { "clientLibrary": { "name": "nodejs-iam", - "version": "0.2.0", + "version": "0.2.1", "language": "TYPESCRIPT", "apis": [ { diff --git a/packages/google-cloud-policytroubleshooter-iam/samples/generated/v3beta/snippet_metadata_google.cloud.policytroubleshooter.iam.v3beta.json b/packages/google-cloud-policytroubleshooter-iam/samples/generated/v3beta/snippet_metadata_google.cloud.policytroubleshooter.iam.v3beta.json index 9e99e68cd2a..fb83a6b525a 100644 --- a/packages/google-cloud-policytroubleshooter-iam/samples/generated/v3beta/snippet_metadata_google.cloud.policytroubleshooter.iam.v3beta.json +++ b/packages/google-cloud-policytroubleshooter-iam/samples/generated/v3beta/snippet_metadata_google.cloud.policytroubleshooter.iam.v3beta.json @@ -1,7 +1,7 @@ { "clientLibrary": { "name": "nodejs-iam", - "version": "0.2.0", + "version": "0.2.1", "language": "TYPESCRIPT", "apis": [ { diff --git a/packages/google-cloud-policytroubleshooter-iam/samples/package.json b/packages/google-cloud-policytroubleshooter-iam/samples/package.json index 37b068e5c5c..061092336e7 100644 --- a/packages/google-cloud-policytroubleshooter-iam/samples/package.json +++ b/packages/google-cloud-policytroubleshooter-iam/samples/package.json @@ -14,7 +14,7 @@ "publish": "echo 'sample test; do not publish'" }, "dependencies": { - "@google-cloud/policy-troubleshooter-iam": "^0.2.0" + "@google-cloud/policy-troubleshooter-iam": "^0.2.1" }, "devDependencies": { "c8": "^7.1.0", diff --git a/packages/google-cloud-rapidmigrationassessment/protos/google/cloud/rapidmigrationassessment/v1/rapidmigrationassessment.proto b/packages/google-cloud-rapidmigrationassessment/protos/google/cloud/rapidmigrationassessment/v1/rapidmigrationassessment.proto index 4e4026efe04..580fd4e6b04 100644 --- a/packages/google-cloud-rapidmigrationassessment/protos/google/cloud/rapidmigrationassessment/v1/rapidmigrationassessment.proto +++ b/packages/google-cloud-rapidmigrationassessment/protos/google/cloud/rapidmigrationassessment/v1/rapidmigrationassessment.proto @@ -33,7 +33,7 @@ option java_package = "com.google.cloud.rapidmigrationassessment.v1"; option php_namespace = "Google\\Cloud\\RapidMigrationAssessment\\V1"; option ruby_package = "Google::Cloud::RapidMigrationAssessment::V1"; -// Rapid Migration Assessment service +// Service describing handlers for resources. service RapidMigrationAssessment { option (google.api.default_host) = "rapidmigrationassessment.googleapis.com"; option (google.api.oauth_scopes) = @@ -63,7 +63,7 @@ service RapidMigrationAssessment { }; option (google.api.method_signature) = "parent,annotation"; option (google.longrunning.operation_info) = { - response_type: "google.cloud.rapidmigrationassessment.v1.Annotation" + response_type: "Annotation" metadata_type: "OperationMetadata" }; } @@ -107,6 +107,7 @@ service RapidMigrationAssessment { } // Deletes a single Collector - changes state of collector to "Deleting". + // Background jobs does final deletion thorugh producer api. rpc DeleteCollector(DeleteCollectorRequest) returns (google.longrunning.Operation) { option (google.api.http) = { diff --git a/packages/google-cloud-rapidmigrationassessment/protos/protos.json b/packages/google-cloud-rapidmigrationassessment/protos/protos.json index 63ec32546ce..07b3f5111a1 100644 --- a/packages/google-cloud-rapidmigrationassessment/protos/protos.json +++ b/packages/google-cloud-rapidmigrationassessment/protos/protos.json @@ -223,7 +223,7 @@ "(google.api.http).post": "/v1/{parent=projects/*/locations/*}/annotations", "(google.api.http).body": "annotation", "(google.api.method_signature)": "parent,annotation", - "(google.longrunning.operation_info).response_type": "google.cloud.rapidmigrationassessment.v1.Annotation", + "(google.longrunning.operation_info).response_type": "Annotation", "(google.longrunning.operation_info).metadata_type": "OperationMetadata" }, "parsedOptions": [ @@ -238,7 +238,7 @@ }, { "(google.longrunning.operation_info)": { - "response_type": "google.cloud.rapidmigrationassessment.v1.Annotation", + "response_type": "Annotation", "metadata_type": "OperationMetadata" } } diff --git a/packages/google-cloud-rapidmigrationassessment/samples/generated/v1/snippet_metadata_google.cloud.rapidmigrationassessment.v1.json b/packages/google-cloud-rapidmigrationassessment/samples/generated/v1/snippet_metadata_google.cloud.rapidmigrationassessment.v1.json index ccc54b53ad5..3a7b234292e 100644 --- a/packages/google-cloud-rapidmigrationassessment/samples/generated/v1/snippet_metadata_google.cloud.rapidmigrationassessment.v1.json +++ b/packages/google-cloud-rapidmigrationassessment/samples/generated/v1/snippet_metadata_google.cloud.rapidmigrationassessment.v1.json @@ -299,7 +299,7 @@ "regionTag": "rapidmigrationassessment_v1_generated_RapidMigrationAssessment_DeleteCollector_async", "title": "RapidMigrationAssessment deleteCollector Sample", "origin": "API_DEFINITION", - "description": " Deletes a single Collector - changes state of collector to \"Deleting\".", + "description": " Deletes a single Collector - changes state of collector to \"Deleting\". Background jobs does final deletion thorugh producer api.", "canonical": true, "file": "rapid_migration_assessment.delete_collector.js", "language": "JAVASCRIPT", diff --git a/packages/google-cloud-rapidmigrationassessment/src/v1/rapid_migration_assessment_client.ts b/packages/google-cloud-rapidmigrationassessment/src/v1/rapid_migration_assessment_client.ts index 2a62e3a25df..9914bf74fda 100644 --- a/packages/google-cloud-rapidmigrationassessment/src/v1/rapid_migration_assessment_client.ts +++ b/packages/google-cloud-rapidmigrationassessment/src/v1/rapid_migration_assessment_client.ts @@ -42,7 +42,7 @@ import * as gapicConfig from './rapid_migration_assessment_client_config.json'; const version = require('../../../package.json').version; /** - * Rapid Migration Assessment service + * Service describing handlers for resources. * @class * @memberof v1 */ @@ -1113,6 +1113,7 @@ export class RapidMigrationAssessmentClient { } /** * Deletes a single Collector - changes state of collector to "Deleting". + * Background jobs does final deletion thorugh producer api. * * @param {Object} request * The request object that will be sent. diff --git a/packages/google-cloud-sql/package.json b/packages/google-cloud-sql/package.json index fee52d58b69..c01885cda14 100644 --- a/packages/google-cloud-sql/package.json +++ b/packages/google-cloud-sql/package.json @@ -54,7 +54,7 @@ "c8": "^7.3.5", "gts": "^5.0.1", "jsdoc": "^4.0.0", - "jsdoc-fresh": "^2.0.0", + "jsdoc-fresh": "^3.0.0", "jsdoc-region-tag": "^3.0.0", "long": "^5.2.3", "linkinator": "4.1.2", diff --git a/packages/google-cloud-tpu/CHANGELOG.md b/packages/google-cloud-tpu/CHANGELOG.md index a2d9880e8ea..7ea8e515dfd 100644 --- a/packages/google-cloud-tpu/CHANGELOG.md +++ b/packages/google-cloud-tpu/CHANGELOG.md @@ -1,5 +1,12 @@ # Changelog +## [3.2.0](https://github.com/googleapis/google-cloud-node/compare/tpu-v3.1.0...tpu-v3.2.0) (2023-09-20) + + +### Features + +* [tpu] added new WAITING_FOR_RESOURCES state for QueuedResourceState ([#4682](https://github.com/googleapis/google-cloud-node/issues/4682)) ([f8dcd67](https://github.com/googleapis/google-cloud-node/commit/f8dcd673bbc0c28e2b2d08acd1bca1183781951b)) + ## [3.1.0](https://github.com/googleapis/google-cloud-node/compare/tpu-v3.0.0...tpu-v3.1.0) (2023-09-06) diff --git a/packages/google-cloud-tpu/package.json b/packages/google-cloud-tpu/package.json index dff54c94df2..15a5f96fe73 100644 --- a/packages/google-cloud-tpu/package.json +++ b/packages/google-cloud-tpu/package.json @@ -1,6 +1,6 @@ { "name": "@google-cloud/tpu", - "version": "3.1.0", + "version": "3.2.0", "description": "tpu client for Node.js", "repository": { "type": "git", diff --git a/packages/google-cloud-tpu/protos/google/cloud/tpu/v2alpha1/cloud_tpu.proto b/packages/google-cloud-tpu/protos/google/cloud/tpu/v2alpha1/cloud_tpu.proto index 7bead65aa97..574806b457e 100644 --- a/packages/google-cloud-tpu/protos/google/cloud/tpu/v2alpha1/cloud_tpu.proto +++ b/packages/google-cloud-tpu/protos/google/cloud/tpu/v2alpha1/cloud_tpu.proto @@ -723,6 +723,17 @@ message QueuedResourceState { // The resources specified in the QueuedResource request have been // deleted. SUSPENDED = 8; + + // The QueuedResource request has passed initial validation and has been + // persisted in the queue. It will remain in this state until there are + // sufficient free resources to begin provisioning your request. Wait times + // will vary significantly depending on demand levels. When demand is high, + // not all requests can be immediately provisioned. If you + // need more reliable obtainability of TPUs consider purchasing a + // reservation. To put a limit on how long you are willing to wait, use + // [timing + // constraints](https://cloud.google.com/tpu/docs/queued-resources#request_a_queued_resource_before_a_specified_time). + WAITING_FOR_RESOURCES = 9; } // Further data for the creating state. diff --git a/packages/google-cloud-tpu/protos/protos.d.ts b/packages/google-cloud-tpu/protos/protos.d.ts index 5d9efda95b9..790d76195f1 100644 --- a/packages/google-cloud-tpu/protos/protos.d.ts +++ b/packages/google-cloud-tpu/protos/protos.d.ts @@ -9551,7 +9551,8 @@ export namespace google { DELETING = 5, ACTIVE = 6, SUSPENDING = 7, - SUSPENDED = 8 + SUSPENDED = 8, + WAITING_FOR_RESOURCES = 9 } /** Properties of a CreatingData. */ diff --git a/packages/google-cloud-tpu/protos/protos.js b/packages/google-cloud-tpu/protos/protos.js index eba88c05991..2541a798eb6 100644 --- a/packages/google-cloud-tpu/protos/protos.js +++ b/packages/google-cloud-tpu/protos/protos.js @@ -22874,6 +22874,7 @@ case 6: case 7: case 8: + case 9: break; } if (message.creatingData != null && message.hasOwnProperty("creatingData")) { @@ -23021,6 +23022,10 @@ case 8: message.state = 8; break; + case "WAITING_FOR_RESOURCES": + case 9: + message.state = 9; + break; } if (object.creatingData != null) { if (typeof object.creatingData !== "object") @@ -23188,6 +23193,7 @@ * @property {number} ACTIVE=6 ACTIVE value * @property {number} SUSPENDING=7 SUSPENDING value * @property {number} SUSPENDED=8 SUSPENDED value + * @property {number} WAITING_FOR_RESOURCES=9 WAITING_FOR_RESOURCES value */ QueuedResourceState.State = (function() { var valuesById = {}, values = Object.create(valuesById); @@ -23200,6 +23206,7 @@ values[valuesById[6] = "ACTIVE"] = 6; values[valuesById[7] = "SUSPENDING"] = 7; values[valuesById[8] = "SUSPENDED"] = 8; + values[valuesById[9] = "WAITING_FOR_RESOURCES"] = 9; return values; })(); diff --git a/packages/google-cloud-tpu/protos/protos.json b/packages/google-cloud-tpu/protos/protos.json index 4803129243d..665e4f47e31 100644 --- a/packages/google-cloud-tpu/protos/protos.json +++ b/packages/google-cloud-tpu/protos/protos.json @@ -2811,7 +2811,8 @@ "DELETING": 5, "ACTIVE": 6, "SUSPENDING": 7, - "SUSPENDED": 8 + "SUSPENDED": 8, + "WAITING_FOR_RESOURCES": 9 } }, "CreatingData": { diff --git a/packages/google-cloud-tpu/samples/generated/v1/snippet_metadata.google.cloud.tpu.v1.json b/packages/google-cloud-tpu/samples/generated/v1/snippet_metadata.google.cloud.tpu.v1.json index 736ecc12343..0d0cf98cafb 100644 --- a/packages/google-cloud-tpu/samples/generated/v1/snippet_metadata.google.cloud.tpu.v1.json +++ b/packages/google-cloud-tpu/samples/generated/v1/snippet_metadata.google.cloud.tpu.v1.json @@ -1,7 +1,7 @@ { "clientLibrary": { "name": "nodejs-tpu", - "version": "3.1.0", + "version": "3.2.0", "language": "TYPESCRIPT", "apis": [ { diff --git a/packages/google-cloud-tpu/samples/generated/v1/snippet_metadata_google.cloud.tpu.v1.json b/packages/google-cloud-tpu/samples/generated/v1/snippet_metadata_google.cloud.tpu.v1.json index 736ecc12343..0d0cf98cafb 100644 --- a/packages/google-cloud-tpu/samples/generated/v1/snippet_metadata_google.cloud.tpu.v1.json +++ b/packages/google-cloud-tpu/samples/generated/v1/snippet_metadata_google.cloud.tpu.v1.json @@ -1,7 +1,7 @@ { "clientLibrary": { "name": "nodejs-tpu", - "version": "3.1.0", + "version": "3.2.0", "language": "TYPESCRIPT", "apis": [ { diff --git a/packages/google-cloud-tpu/samples/generated/v2/snippet_metadata.google.cloud.tpu.v2.json b/packages/google-cloud-tpu/samples/generated/v2/snippet_metadata.google.cloud.tpu.v2.json index 25806f5f080..9bc5adf45f4 100644 --- a/packages/google-cloud-tpu/samples/generated/v2/snippet_metadata.google.cloud.tpu.v2.json +++ b/packages/google-cloud-tpu/samples/generated/v2/snippet_metadata.google.cloud.tpu.v2.json @@ -1,7 +1,7 @@ { "clientLibrary": { "name": "nodejs-tpu", - "version": "3.1.0", + "version": "3.2.0", "language": "TYPESCRIPT", "apis": [ { diff --git a/packages/google-cloud-tpu/samples/generated/v2/snippet_metadata_google.cloud.tpu.v2.json b/packages/google-cloud-tpu/samples/generated/v2/snippet_metadata_google.cloud.tpu.v2.json index 25806f5f080..9bc5adf45f4 100644 --- a/packages/google-cloud-tpu/samples/generated/v2/snippet_metadata_google.cloud.tpu.v2.json +++ b/packages/google-cloud-tpu/samples/generated/v2/snippet_metadata_google.cloud.tpu.v2.json @@ -1,7 +1,7 @@ { "clientLibrary": { "name": "nodejs-tpu", - "version": "3.1.0", + "version": "3.2.0", "language": "TYPESCRIPT", "apis": [ { diff --git a/packages/google-cloud-tpu/samples/generated/v2alpha1/snippet_metadata.google.cloud.tpu.v2alpha1.json b/packages/google-cloud-tpu/samples/generated/v2alpha1/snippet_metadata.google.cloud.tpu.v2alpha1.json index 93403c3a6c2..01da856703b 100644 --- a/packages/google-cloud-tpu/samples/generated/v2alpha1/snippet_metadata.google.cloud.tpu.v2alpha1.json +++ b/packages/google-cloud-tpu/samples/generated/v2alpha1/snippet_metadata.google.cloud.tpu.v2alpha1.json @@ -1,7 +1,7 @@ { "clientLibrary": { "name": "nodejs-tpu", - "version": "3.1.0", + "version": "3.2.0", "language": "TYPESCRIPT", "apis": [ { diff --git a/packages/google-cloud-tpu/samples/generated/v2alpha1/snippet_metadata_google.cloud.tpu.v2alpha1.json b/packages/google-cloud-tpu/samples/generated/v2alpha1/snippet_metadata_google.cloud.tpu.v2alpha1.json index 2adc8796a24..fa153d2879f 100644 --- a/packages/google-cloud-tpu/samples/generated/v2alpha1/snippet_metadata_google.cloud.tpu.v2alpha1.json +++ b/packages/google-cloud-tpu/samples/generated/v2alpha1/snippet_metadata_google.cloud.tpu.v2alpha1.json @@ -1,7 +1,7 @@ { "clientLibrary": { "name": "nodejs-tpu", - "version": "3.1.0", + "version": "3.2.0", "language": "TYPESCRIPT", "apis": [ { diff --git a/packages/google-cloud-tpu/samples/package.json b/packages/google-cloud-tpu/samples/package.json index efaf6b96914..f4457011325 100644 --- a/packages/google-cloud-tpu/samples/package.json +++ b/packages/google-cloud-tpu/samples/package.json @@ -13,7 +13,7 @@ "test": "c8 mocha --timeout 600000 test/*.js" }, "dependencies": { - "@google-cloud/tpu": "^3.1.0" + "@google-cloud/tpu": "^3.2.0" }, "devDependencies": { "c8": "^7.1.0", diff --git a/packages/google-cloud-workflows-executions/.repo-metadata.json b/packages/google-cloud-workflows-executions/.repo-metadata.json index dc6d0f90e11..e3180f1c481 100644 --- a/packages/google-cloud-workflows-executions/.repo-metadata.json +++ b/packages/google-cloud-workflows-executions/.repo-metadata.json @@ -1,6 +1,6 @@ { - "name": "workflows", - "name_pretty": "Workflows", + "name": "workflowexecutions", + "name_pretty": "Workflow Executions", "product_documentation": "https://cloud.google.com/workflows/docs/", "client_documentation": "https://cloud.google.com/nodejs/docs/reference/workflows/latest", "issue_tracker": "https://github.com/googleapis/google-cloud-node/issues", @@ -8,10 +8,10 @@ "language": "nodejs", "repo": "googleapis/google-cloud-node", "distribution_name": "@google-cloud/workflows", - "api_id": "workflows.googleapis.com", + "api_id": "workflowexecutions.googleapis.com", "requires_billing": true, "default_version": "v1", - "api_shortname": "workflows", + "api_shortname": "workflowexecutions", "library_type": "GAPIC_AUTO", "codeowner_team": "@googleapis/aap-dpes" } diff --git a/packages/google-cloud-workflows-executions/CONTRIBUTING.md b/packages/google-cloud-workflows-executions/CONTRIBUTING.md index fd92ab325b7..932ff795c6a 100644 --- a/packages/google-cloud-workflows-executions/CONTRIBUTING.md +++ b/packages/google-cloud-workflows-executions/CONTRIBUTING.md @@ -41,7 +41,7 @@ accept your pull requests. 1. [Select or create a Cloud Platform project][projects]. 1. [Enable billing for your project][billing]. -1. [Enable the Workflows API][enable_api]. +1. [Enable the Workflow Executions API][enable_api]. 1. [Set up authentication with a service account][auth] so you can access the API from your local workstation. @@ -72,5 +72,5 @@ accept your pull requests. [setup]: https://cloud.google.com/nodejs/docs/setup [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=workflows.googleapis.com +[enable_api]: https://console.cloud.google.com/flows/enableapi?apiid=workflowexecutions.googleapis.com [auth]: https://cloud.google.com/docs/authentication/getting-started \ No newline at end of file diff --git a/packages/google-cloud-workflows-executions/README.md b/packages/google-cloud-workflows-executions/README.md index c7f606ed37b..a5453331978 100644 --- a/packages/google-cloud-workflows-executions/README.md +++ b/packages/google-cloud-workflows-executions/README.md @@ -2,7 +2,7 @@ [//]: # "To regenerate it, use `python -m synthtool`." Google Cloud Platform logo -# [Workflows: Node.js Client](https://github.com/googleapis/google-cloud-node/tree/main/packages/google-cloud-workflows-executions) +# [Workflow Executions: Node.js Client](https://github.com/googleapis/google-cloud-node/tree/main/packages/google-cloud-workflows-executions) [![release level](https://img.shields.io/badge/release%20level-stable-brightgreen.svg?style=flat)](https://cloud.google.com/terms/launch-stages) [![npm version](https://img.shields.io/npm/v/@google-cloud/workflows.svg)](https://www.npmjs.org/package/@google-cloud/workflows) @@ -16,8 +16,8 @@ Workflows client for Node.js A comprehensive list of changes in each version may be found in [the CHANGELOG](https://github.com/googleapis/google-cloud-node/tree/main/packages/google-cloud-workflows-executions/CHANGELOG.md). -* [Workflows Node.js Client API Reference][client-docs] -* [Workflows Documentation][product-docs] +* [Workflow Executions Node.js Client API Reference][client-docs] +* [Workflow Executions Documentation][product-docs] * [github.com/googleapis/google-cloud-node/packages/google-cloud-workflows-executions](https://github.com/googleapis/google-cloud-node/tree/main/packages/google-cloud-workflows-executions) Read more about the client libraries for Cloud APIs, including the older @@ -43,7 +43,7 @@ Google APIs Client Libraries, in [Client Libraries Explained][explained]. 1. [Select or create a Cloud Platform project][projects]. 1. [Enable billing for your project][billing]. -1. [Enable the Workflows API][enable_api]. +1. [Enable the Workflow Executions API][enable_api]. 1. [Set up authentication with a service account][auth] so you can access the API from your local workstation. @@ -106,7 +106,7 @@ Samples are in the [`samples/`](https://github.com/googleapis/google-cloud-node/ -The [Workflows Node.js Client API Reference][client-docs] documentation +The [Workflow Executions Node.js Client API Reference][client-docs] documentation also contains samples. ## Supported Node.js Versions @@ -171,5 +171,5 @@ See [LICENSE](https://github.com/googleapis/google-cloud-node/blob/main/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=workflows.googleapis.com +[enable_api]: https://console.cloud.google.com/flows/enableapi?apiid=workflowexecutions.googleapis.com [auth]: https://cloud.google.com/docs/authentication/getting-started diff --git a/packages/google-cloud-workflows-executions/samples/README.md b/packages/google-cloud-workflows-executions/samples/README.md index 81be23af808..62f7d14ba8e 100644 --- a/packages/google-cloud-workflows-executions/samples/README.md +++ b/packages/google-cloud-workflows-executions/samples/README.md @@ -2,7 +2,7 @@ [//]: # "To regenerate it, use `python -m synthtool`." Google Cloud Platform logo -# [Workflows: Node.js Samples](https://github.com/googleapis/google-cloud-node) +# [Workflow Executions: Node.js Samples](https://github.com/googleapis/google-cloud-node) [![Open in Cloud Shell][shell_img]][shell_link] diff --git a/packages/google-container/CHANGELOG.md b/packages/google-container/CHANGELOG.md index 2452d69fc59..9489b678810 100644 --- a/packages/google-container/CHANGELOG.md +++ b/packages/google-container/CHANGELOG.md @@ -4,6 +4,13 @@ [1]: https://www.npmjs.com/package/@google-cloud/container?activeTab=versions +## [5.3.0](https://github.com/googleapis/google-cloud-node/compare/container-v5.2.0...container-v5.3.0) (2023-09-19) + + +### Features + +* [container] add SecurityPostureConfig Enterprise vuln mode to allow customers to enable Advanced Vulnerability Scanning for their clusters ([#4666](https://github.com/googleapis/google-cloud-node/issues/4666)) ([9876892](https://github.com/googleapis/google-cloud-node/commit/9876892176c305a67b64af4c8481563ee1633576)) + ## [5.2.0](https://github.com/googleapis/google-cloud-node/compare/container-v5.1.0...container-v5.2.0) (2023-09-06) diff --git a/packages/google-container/package.json b/packages/google-container/package.json index e2fe2dc8a0d..2530e4b611d 100644 --- a/packages/google-container/package.json +++ b/packages/google-container/package.json @@ -1,7 +1,7 @@ { "name": "@google-cloud/container", "description": "Google Container Engine API client for Node.js", - "version": "5.2.0", + "version": "5.3.0", "license": "Apache-2.0", "author": "Google Inc", "engines": { diff --git a/packages/google-container/protos/google/container/v1beta1/cluster_service.proto b/packages/google-container/protos/google/container/v1beta1/cluster_service.proto index 54bb8303bd8..4b122939c8c 100644 --- a/packages/google-container/protos/google/container/v1beta1/cluster_service.proto +++ b/packages/google-container/protos/google/container/v1beta1/cluster_service.proto @@ -832,6 +832,12 @@ message NodeConfig { // HostMaintenancePolicy contains the desired maintenance policy for the // Google Compute Engine hosts. HostMaintenancePolicy host_maintenance_policy = 44; + + // Optional. Enable confidential storage on Hyperdisk. + // boot_disk_kms_key is required when enable_confidential_storage is true. + // This is only available for private preview. + bool enable_confidential_storage = 46 + [(google.api.field_behavior) = OPTIONAL]; } // Specifies options for controlling advanced machine features. @@ -2185,8 +2191,9 @@ message Cluster { // in autopilot clusters and node auto-provisioning enabled clusters. NodePoolAutoConfig node_pool_auto_config = 136; + // Deprecated: Use SecurityPostureConfig instead. // Enable/Disable Protect API features for the cluster. - optional ProtectConfig protect_config = 137; + optional ProtectConfig protect_config = 137 [deprecated = true]; // This checksum is computed by the server based on the value of cluster // fields, and may be sent on update requests to ensure the client has an @@ -2282,6 +2289,10 @@ message SecurityPostureConfig { // Applies basic vulnerability scanning on the cluster. VULNERABILITY_BASIC = 2; + + // Applies the Security Posture's vulnerability on cluster Enterprise level + // features. + VULNERABILITY_ENTERPRISE = 3; } // Sets which mode to use for Security Posture features. @@ -2509,8 +2520,9 @@ message ClusterUpdate { // in autopilot clusters and node auto-provisioning enabled clusters. NetworkTags desired_node_pool_auto_config_network_tags = 110; + // Deprecated: Use DesiredSecurityPostureConfig instead. // Enable/Disable Protect API features for the cluster. - optional ProtectConfig desired_protect_config = 112; + optional ProtectConfig desired_protect_config = 112 [deprecated = true]; // The desired config of Gateway API on this cluster. GatewayAPIConfig desired_gateway_api_config = 114; diff --git a/packages/google-container/protos/protos.d.ts b/packages/google-container/protos/protos.d.ts index 275baed4c8c..4f81f620385 100644 --- a/packages/google-container/protos/protos.d.ts +++ b/packages/google-container/protos/protos.d.ts @@ -22325,6 +22325,9 @@ export namespace google { /** NodeConfig hostMaintenancePolicy */ hostMaintenancePolicy?: (google.container.v1beta1.IHostMaintenancePolicy|null); + + /** NodeConfig enableConfidentialStorage */ + enableConfidentialStorage?: (boolean|null); } /** Represents a NodeConfig. */ @@ -22444,6 +22447,9 @@ export namespace google { /** NodeConfig hostMaintenancePolicy. */ public hostMaintenancePolicy?: (google.container.v1beta1.IHostMaintenancePolicy|null); + /** NodeConfig enableConfidentialStorage. */ + public enableConfidentialStorage: boolean; + /** NodeConfig _fastSocket. */ public _fastSocket?: "fastSocket"; @@ -28891,7 +28897,8 @@ export namespace google { enum VulnerabilityMode { VULNERABILITY_MODE_UNSPECIFIED = 0, VULNERABILITY_DISABLED = 1, - VULNERABILITY_BASIC = 2 + VULNERABILITY_BASIC = 2, + VULNERABILITY_ENTERPRISE = 3 } } diff --git a/packages/google-container/protos/protos.js b/packages/google-container/protos/protos.js index f975d5bf248..51ca38452f3 100644 --- a/packages/google-container/protos/protos.js +++ b/packages/google-container/protos/protos.js @@ -55767,6 +55767,7 @@ * @property {google.container.v1beta1.IEphemeralStorageLocalSsdConfig|null} [ephemeralStorageLocalSsdConfig] NodeConfig ephemeralStorageLocalSsdConfig * @property {google.container.v1beta1.ISoleTenantConfig|null} [soleTenantConfig] NodeConfig soleTenantConfig * @property {google.container.v1beta1.IHostMaintenancePolicy|null} [hostMaintenancePolicy] NodeConfig hostMaintenancePolicy + * @property {boolean|null} [enableConfidentialStorage] NodeConfig enableConfidentialStorage */ /** @@ -56079,6 +56080,14 @@ */ NodeConfig.prototype.hostMaintenancePolicy = null; + /** + * NodeConfig enableConfidentialStorage. + * @member {boolean} enableConfidentialStorage + * @memberof google.container.v1beta1.NodeConfig + * @instance + */ + NodeConfig.prototype.enableConfidentialStorage = false; + // OneOf field names bound to virtual getters and setters var $oneOfFields; @@ -56196,6 +56205,8 @@ $root.google.container.v1beta1.SoleTenantConfig.encode(message.soleTenantConfig, writer.uint32(/* id 42, wireType 2 =*/338).fork()).ldelim(); if (message.hostMaintenancePolicy != null && Object.hasOwnProperty.call(message, "hostMaintenancePolicy")) $root.google.container.v1beta1.HostMaintenancePolicy.encode(message.hostMaintenancePolicy, writer.uint32(/* id 44, wireType 2 =*/354).fork()).ldelim(); + if (message.enableConfidentialStorage != null && Object.hasOwnProperty.call(message, "enableConfidentialStorage")) + writer.uint32(/* id 46, wireType 0 =*/368).bool(message.enableConfidentialStorage); return writer; }; @@ -56439,6 +56450,10 @@ message.hostMaintenancePolicy = $root.google.container.v1beta1.HostMaintenancePolicy.decode(reader, reader.uint32()); break; } + case 46: { + message.enableConfidentialStorage = reader.bool(); + break; + } default: reader.skipType(tag & 7); break; @@ -56657,6 +56672,9 @@ if (error) return "hostMaintenancePolicy." + error; } + if (message.enableConfidentialStorage != null && message.hasOwnProperty("enableConfidentialStorage")) + if (typeof message.enableConfidentialStorage !== "boolean") + return "enableConfidentialStorage: boolean expected"; return null; }; @@ -56839,6 +56857,8 @@ throw TypeError(".google.container.v1beta1.NodeConfig.hostMaintenancePolicy: object expected"); message.hostMaintenancePolicy = $root.google.container.v1beta1.HostMaintenancePolicy.fromObject(object.hostMaintenancePolicy); } + if (object.enableConfidentialStorage != null) + message.enableConfidentialStorage = Boolean(object.enableConfidentialStorage); return message; }; @@ -56895,6 +56915,7 @@ object.ephemeralStorageLocalSsdConfig = null; object.soleTenantConfig = null; object.hostMaintenancePolicy = null; + object.enableConfidentialStorage = false; } if (message.machineType != null && message.hasOwnProperty("machineType")) object.machineType = message.machineType; @@ -56993,6 +57014,8 @@ object.soleTenantConfig = $root.google.container.v1beta1.SoleTenantConfig.toObject(message.soleTenantConfig, options); if (message.hostMaintenancePolicy != null && message.hasOwnProperty("hostMaintenancePolicy")) object.hostMaintenancePolicy = $root.google.container.v1beta1.HostMaintenancePolicy.toObject(message.hostMaintenancePolicy, options); + if (message.enableConfidentialStorage != null && message.hasOwnProperty("enableConfidentialStorage")) + object.enableConfidentialStorage = message.enableConfidentialStorage; return object; }; @@ -73048,6 +73071,7 @@ case 0: case 1: case 2: + case 3: break; } } @@ -73105,6 +73129,10 @@ case 2: message.vulnerabilityMode = 2; break; + case "VULNERABILITY_ENTERPRISE": + case 3: + message.vulnerabilityMode = 3; + break; } return message; }; @@ -73184,12 +73212,14 @@ * @property {number} VULNERABILITY_MODE_UNSPECIFIED=0 VULNERABILITY_MODE_UNSPECIFIED value * @property {number} VULNERABILITY_DISABLED=1 VULNERABILITY_DISABLED value * @property {number} VULNERABILITY_BASIC=2 VULNERABILITY_BASIC value + * @property {number} VULNERABILITY_ENTERPRISE=3 VULNERABILITY_ENTERPRISE value */ SecurityPostureConfig.VulnerabilityMode = (function() { var valuesById = {}, values = Object.create(valuesById); values[valuesById[0] = "VULNERABILITY_MODE_UNSPECIFIED"] = 0; values[valuesById[1] = "VULNERABILITY_DISABLED"] = 1; values[valuesById[2] = "VULNERABILITY_BASIC"] = 2; + values[valuesById[3] = "VULNERABILITY_ENTERPRISE"] = 3; return values; })(); diff --git a/packages/google-container/protos/protos.json b/packages/google-container/protos/protos.json index a6469cde7c5..243594b432b 100644 --- a/packages/google-container/protos/protos.json +++ b/packages/google-container/protos/protos.json @@ -6701,6 +6701,13 @@ "hostMaintenancePolicy": { "type": "HostMaintenancePolicy", "id": 44 + }, + "enableConfidentialStorage": { + "type": "bool", + "id": 46, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } } } }, @@ -8007,6 +8014,7 @@ "type": "ProtectConfig", "id": 137, "options": { + "deprecated": true, "proto3_optional": true } }, @@ -8163,7 +8171,8 @@ "values": { "VULNERABILITY_MODE_UNSPECIFIED": 0, "VULNERABILITY_DISABLED": 1, - "VULNERABILITY_BASIC": 2 + "VULNERABILITY_BASIC": 2, + "VULNERABILITY_ENTERPRISE": 3 } } } @@ -8395,6 +8404,7 @@ "type": "ProtectConfig", "id": 112, "options": { + "deprecated": true, "proto3_optional": true } }, diff --git a/packages/google-container/samples/generated/v1/snippet_metadata.google.container.v1.json b/packages/google-container/samples/generated/v1/snippet_metadata.google.container.v1.json index a54464f063b..2befcb6cab3 100644 --- a/packages/google-container/samples/generated/v1/snippet_metadata.google.container.v1.json +++ b/packages/google-container/samples/generated/v1/snippet_metadata.google.container.v1.json @@ -1,7 +1,7 @@ { "clientLibrary": { "name": "nodejs-container", - "version": "5.2.0", + "version": "5.3.0", "language": "TYPESCRIPT", "apis": [ { diff --git a/packages/google-container/samples/generated/v1/snippet_metadata_google.container.v1.json b/packages/google-container/samples/generated/v1/snippet_metadata_google.container.v1.json index 5527bd20dbd..15741880ec0 100644 --- a/packages/google-container/samples/generated/v1/snippet_metadata_google.container.v1.json +++ b/packages/google-container/samples/generated/v1/snippet_metadata_google.container.v1.json @@ -1,7 +1,7 @@ { "clientLibrary": { "name": "nodejs-container", - "version": "5.2.0", + "version": "5.3.0", "language": "TYPESCRIPT", "apis": [ { diff --git a/packages/google-container/samples/generated/v1beta1/snippet_metadata.google.container.v1beta1.json b/packages/google-container/samples/generated/v1beta1/snippet_metadata.google.container.v1beta1.json index 41c81cd315e..15b6548b481 100644 --- a/packages/google-container/samples/generated/v1beta1/snippet_metadata.google.container.v1beta1.json +++ b/packages/google-container/samples/generated/v1beta1/snippet_metadata.google.container.v1beta1.json @@ -1,7 +1,7 @@ { "clientLibrary": { "name": "nodejs-container", - "version": "5.2.0", + "version": "5.3.0", "language": "TYPESCRIPT", "apis": [ { diff --git a/packages/google-container/samples/generated/v1beta1/snippet_metadata_google.container.v1beta1.json b/packages/google-container/samples/generated/v1beta1/snippet_metadata_google.container.v1beta1.json index 9936fcad830..3ff9a60430a 100644 --- a/packages/google-container/samples/generated/v1beta1/snippet_metadata_google.container.v1beta1.json +++ b/packages/google-container/samples/generated/v1beta1/snippet_metadata_google.container.v1beta1.json @@ -1,7 +1,7 @@ { "clientLibrary": { "name": "nodejs-container", - "version": "5.2.0", + "version": "5.3.0", "language": "TYPESCRIPT", "apis": [ { diff --git a/packages/google-container/samples/package.json b/packages/google-container/samples/package.json index f6bd7dcf985..e6e6293684a 100644 --- a/packages/google-container/samples/package.json +++ b/packages/google-container/samples/package.json @@ -14,7 +14,7 @@ "test": "mocha test --timeout 1000000" }, "dependencies": { - "@google-cloud/container": "^5.2.0", + "@google-cloud/container": "^5.3.0", "uuid": "^9.0.0" }, "devDependencies": { diff --git a/packages/google-devtools-cloudprofiler/.OwlBot.yaml b/packages/google-devtools-cloudprofiler/.OwlBot.yaml new file mode 100644 index 00000000000..309481eba93 --- /dev/null +++ b/packages/google-devtools-cloudprofiler/.OwlBot.yaml @@ -0,0 +1,19 @@ +# 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. + +deep-copy-regex: + - source: /google/devtools/cloudprofiler/(.*)/.*-nodejs + dest: /owl-bot-staging/google-devtools-cloudprofiler/$1 + +api-name: cloudprofiler \ No newline at end of file diff --git a/packages/google-devtools-cloudprofiler/.eslintignore b/packages/google-devtools-cloudprofiler/.eslintignore new file mode 100644 index 00000000000..ea5b04aebe6 --- /dev/null +++ b/packages/google-devtools-cloudprofiler/.eslintignore @@ -0,0 +1,7 @@ +**/node_modules +**/coverage +test/fixtures +build/ +docs/ +protos/ +samples/generated/ diff --git a/packages/google-devtools-cloudprofiler/.eslintrc.json b/packages/google-devtools-cloudprofiler/.eslintrc.json new file mode 100644 index 00000000000..78215349546 --- /dev/null +++ b/packages/google-devtools-cloudprofiler/.eslintrc.json @@ -0,0 +1,3 @@ +{ + "extends": "./node_modules/gts" +} diff --git a/packages/google-devtools-cloudprofiler/.gitattributes b/packages/google-devtools-cloudprofiler/.gitattributes new file mode 100644 index 00000000000..33739cb74e4 --- /dev/null +++ b/packages/google-devtools-cloudprofiler/.gitattributes @@ -0,0 +1,4 @@ +*.ts text eol=lf +*.js text eol=lf +protos/* linguist-generated +**/api-extractor.json linguist-language=JSON-with-Comments diff --git a/packages/google-devtools-cloudprofiler/.gitignore b/packages/google-devtools-cloudprofiler/.gitignore new file mode 100644 index 00000000000..d4f03a0df2e --- /dev/null +++ b/packages/google-devtools-cloudprofiler/.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/google-devtools-cloudprofiler/.jsdoc.js b/packages/google-devtools-cloudprofiler/.jsdoc.js new file mode 100644 index 00000000000..eb125b3a78d --- /dev/null +++ b/packages/google-devtools-cloudprofiler/.jsdoc.js @@ -0,0 +1,55 @@ +// Copyright 2023 Google LLC +// +// Licensed under the Apache License, Version 2.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 2023 Google LLC', + includeDate: false, + sourceFiles: false, + systemName: '@google-cloud/cloudprofiler', + theme: 'lumen', + default: { + outputSourceFiles: false + } + }, + markdown: { + idInHeadings: true + } +}; diff --git a/packages/google-devtools-cloudprofiler/.mocharc.js b/packages/google-devtools-cloudprofiler/.mocharc.js new file mode 100644 index 00000000000..49e7e228701 --- /dev/null +++ b/packages/google-devtools-cloudprofiler/.mocharc.js @@ -0,0 +1,29 @@ +// Copyright 2023 Google LLC +// +// Licensed under the Apache License, Version 2.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. +const config = { + "enable-source-maps": true, + "throw-deprecation": true, + "timeout": 10000, + "recursive": true +} +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/google-devtools-cloudprofiler/.nycrc b/packages/google-devtools-cloudprofiler/.nycrc new file mode 100644 index 00000000000..b18d5472b62 --- /dev/null +++ b/packages/google-devtools-cloudprofiler/.nycrc @@ -0,0 +1,24 @@ +{ + "report-dir": "./.coverage", + "reporter": ["text", "lcov"], + "exclude": [ + "**/*-test", + "**/.coverage", + "**/apis", + "**/benchmark", + "**/conformance", + "**/docs", + "**/samples", + "**/scripts", + "**/protos", + "**/test", + "**/*.d.ts", + ".jsdoc.js", + "**/.jsdoc.js", + "karma.conf.js", + "webpack-tests.config.js", + "webpack.config.js" + ], + "exclude-after-remap": false, + "all": true +} diff --git a/packages/google-devtools-cloudprofiler/.prettierignore b/packages/google-devtools-cloudprofiler/.prettierignore new file mode 100644 index 00000000000..9340ad9b86d --- /dev/null +++ b/packages/google-devtools-cloudprofiler/.prettierignore @@ -0,0 +1,6 @@ +**/node_modules +**/coverage +test/fixtures +build/ +docs/ +protos/ diff --git a/packages/google-devtools-cloudprofiler/.prettierrc.js b/packages/google-devtools-cloudprofiler/.prettierrc.js new file mode 100644 index 00000000000..1e6cec783e4 --- /dev/null +++ b/packages/google-devtools-cloudprofiler/.prettierrc.js @@ -0,0 +1,17 @@ +// Copyright 2023 Google LLC +// +// Licensed under the Apache License, Version 2.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. + +module.exports = { + ...require('gts/.prettierrc.json') +} diff --git a/packages/google-devtools-cloudprofiler/.repo-metadata.json b/packages/google-devtools-cloudprofiler/.repo-metadata.json new file mode 100644 index 00000000000..96467123eb6 --- /dev/null +++ b/packages/google-devtools-cloudprofiler/.repo-metadata.json @@ -0,0 +1,17 @@ +{ + "name": "cloudprofiler", + "name_pretty": "Cloud Profiler API", + "product_documentation": "cloud.google.com/profiler/", + "client_documentation": "https://cloud.google.com/nodejs/docs/reference/cloudprofiler/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/cloudprofiler", + "api_id": "cloudprofiler.googleapis.com", + "default_version": "v2", + "requires_billing": true, + "library_type": "GAPIC_AUTO", + "api_shortname": "cloudprofiler" +} + diff --git a/packages/google-devtools-cloudprofiler/CHANGELOG.md b/packages/google-devtools-cloudprofiler/CHANGELOG.md new file mode 100644 index 00000000000..2a947379a48 --- /dev/null +++ b/packages/google-devtools-cloudprofiler/CHANGELOG.md @@ -0,0 +1,8 @@ +# Changelog + +## 0.1.0 (2023-09-14) + + +### Features + +* Add initial files for google.devtools.cloudprofiler.v2 ([#4647](https://github.com/googleapis/google-cloud-node/issues/4647)) ([3814097](https://github.com/googleapis/google-cloud-node/commit/38140975dcfc5936032d05083eb3f7b9bfe93a7c)) diff --git a/packages/google-devtools-cloudprofiler/CODE_OF_CONDUCT.md b/packages/google-devtools-cloudprofiler/CODE_OF_CONDUCT.md new file mode 100644 index 00000000000..2add2547a81 --- /dev/null +++ b/packages/google-devtools-cloudprofiler/CODE_OF_CONDUCT.md @@ -0,0 +1,94 @@ + +# Code of Conduct + +## Our Pledge + +In the interest of fostering an open and welcoming environment, we as +contributors and maintainers pledge to making participation in our project and +our community a harassment-free experience for everyone, regardless of age, body +size, disability, ethnicity, gender identity and expression, level of +experience, education, socio-economic status, nationality, personal appearance, +race, religion, or sexual identity and orientation. + +## Our Standards + +Examples of behavior that contributes to creating a positive environment +include: + +* Using welcoming and inclusive language +* Being respectful of differing viewpoints and experiences +* Gracefully accepting constructive criticism +* Focusing on what is best for the community +* Showing empathy towards other community members + +Examples of unacceptable behavior by participants include: + +* The use of sexualized language or imagery and unwelcome sexual attention or + advances +* Trolling, insulting/derogatory comments, and personal or political attacks +* Public or private harassment +* Publishing others' private information, such as a physical or electronic + address, without explicit permission +* Other conduct which could reasonably be considered inappropriate in a + professional setting + +## Our Responsibilities + +Project maintainers are responsible for clarifying the standards of acceptable +behavior and are expected to take appropriate and fair corrective action in +response to any instances of unacceptable behavior. + +Project maintainers have the right and responsibility to remove, edit, or reject +comments, commits, code, wiki edits, issues, and other contributions that are +not aligned to this Code of Conduct, or to ban temporarily or permanently any +contributor for other behaviors that they deem inappropriate, threatening, +offensive, or harmful. + +## Scope + +This Code of Conduct applies both within project spaces and in public spaces +when an individual is representing the project or its community. Examples of +representing a project or community include using an official project e-mail +address, posting via an official social media account, or acting as an appointed +representative at an online or offline event. Representation of a project may be +further defined and clarified by project maintainers. + +This Code of Conduct also applies outside the project spaces when the Project +Steward has a reasonable belief that an individual's behavior may have a +negative impact on the project or its community. + +## Conflict Resolution + +We do not believe that all conflict is bad; healthy debate and disagreement +often yield positive results. However, it is never okay to be disrespectful or +to engage in behavior that violates the project’s code of conduct. + +If you see someone violating the code of conduct, you are encouraged to address +the behavior directly with those involved. Many issues can be resolved quickly +and easily, and this gives people more control over the outcome of their +dispute. If you are unable to resolve the matter for any reason, or if the +behavior is threatening or harassing, report it. We are dedicated to providing +an environment where participants feel welcome and safe. + +Reports should be directed to *googleapis-stewards@google.com*, the +Project Steward(s) for *Google Cloud Client Libraries*. It is the Project Steward’s duty to +receive and address reported violations of the code of conduct. They will then +work with a committee consisting of representatives from the Open Source +Programs Office and the Google Open Source Strategy team. If for any reason you +are uncomfortable reaching out to the Project Steward, please email +opensource@google.com. + +We will investigate every complaint, but you may not receive a direct response. +We will use our discretion in determining when and how to follow up on reported +incidents, which may range from not taking action to permanent expulsion from +the project and project-sponsored spaces. We will notify the accused of the +report and provide them an opportunity to discuss it before any action is taken. +The identity of the reporter will be omitted from the details of the report +supplied to the accused. In potentially harmful situations, such as ongoing +harassment or threats to anyone's safety, we may take action without notice. + +## Attribution + +This Code of Conduct is adapted from the Contributor Covenant, version 1.4, +available at +https://www.contributor-covenant.org/version/1/4/code-of-conduct.html \ No newline at end of file diff --git a/packages/google-devtools-cloudprofiler/CONTRIBUTING.md b/packages/google-devtools-cloudprofiler/CONTRIBUTING.md new file mode 100644 index 00000000000..dab08fd3066 --- /dev/null +++ b/packages/google-devtools-cloudprofiler/CONTRIBUTING.md @@ -0,0 +1,76 @@ +# How to become a contributor and submit your own code + +**Table of contents** + +* [Contributor License Agreements](#contributor-license-agreements) +* [Contributing a patch](#contributing-a-patch) +* [Running the tests](#running-the-tests) +* [Releasing the library](#releasing-the-library) + +## Contributor License Agreements + +We'd love to accept your sample apps and patches! Before we can take them, we +have to jump a couple of legal hurdles. + +Please fill out either the individual or corporate Contributor License Agreement +(CLA). + + * If you are an individual writing original source code and you're sure you + own the intellectual property, then you'll need to sign an [individual CLA](https://developers.google.com/open-source/cla/individual). + * If you work for a company that wants to allow you to contribute your work, + then you'll need to sign a [corporate CLA](https://developers.google.com/open-source/cla/corporate). + +Follow either of the two links above to access the appropriate CLA and +instructions for how to sign and return it. Once we receive it, we'll be able to +accept your pull requests. + +## Contributing A Patch + +1. Submit an issue describing your proposed change to the repo in question. +1. The repo owner will respond to your issue promptly. +1. If your proposed change is accepted, and you haven't already done so, sign a + Contributor License Agreement (see details above). +1. Fork the desired repo, develop and test your code changes. +1. Ensure that your code adheres to the existing style in the code to which + you are contributing. +1. Ensure that your code has an appropriate set of tests which all pass. +1. Title your pull request following [Conventional Commits](https://www.conventionalcommits.org/) styling. +1. Submit a pull request. + +### Before you begin + +1. [Select or create a Cloud Platform project][projects]. +1. [Enable billing for your project][billing]. +1. [Enable the Cloud Profiler API API][enable_api]. +1. [Set up authentication with a service account][auth] so you can access the + API from your local workstation. + + +## Running the tests + +1. [Prepare your environment for Node.js setup][setup]. + +1. Install dependencies: + + npm install + +1. Run the tests: + + # Run unit tests. + npm test + + # Run sample integration tests. + npm run samples-test + + # Run all system tests. + npm run system-test + +1. Lint (and maybe fix) any changes: + + npm run fix + +[setup]: https://cloud.google.com/nodejs/docs/setup +[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=cloudprofiler.googleapis.com +[auth]: https://cloud.google.com/docs/authentication/getting-started \ No newline at end of file diff --git a/packages/google-devtools-cloudprofiler/LICENSE b/packages/google-devtools-cloudprofiler/LICENSE new file mode 100644 index 00000000000..d6456956733 --- /dev/null +++ b/packages/google-devtools-cloudprofiler/LICENSE @@ -0,0 +1,202 @@ + + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright [yyyy] [name of copyright owner] + + Licensed under the Apache License, Version 2.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. diff --git a/packages/google-devtools-cloudprofiler/README.md b/packages/google-devtools-cloudprofiler/README.md new file mode 100644 index 00000000000..4c193c154e4 --- /dev/null +++ b/packages/google-devtools-cloudprofiler/README.md @@ -0,0 +1,182 @@ +[//]: # "This README.md file is auto-generated, all changes to this file will be lost." +[//]: # "To regenerate it, use `python -m synthtool`." +Google Cloud Platform logo + +# [Cloud Profiler API: Node.js Client](https://github.com/googleapis/google-cloud-node/tree/main/packages/google-devtools-cloudprofiler) + +[![release level](https://img.shields.io/badge/release%20level-preview-yellow.svg?style=flat)](https://cloud.google.com/terms/launch-stages) +[![npm version](https://img.shields.io/npm/v/@google-cloud/cloudprofiler.svg)](https://www.npmjs.org/package/@google-cloud/cloudprofiler) + + + + +Cloud Profiler API client for Node.js + + +A comprehensive list of changes in each version may be found in +[the CHANGELOG](https://github.com/googleapis/google-cloud-node/tree/main/packages/google-devtools-cloudprofiler/CHANGELOG.md). + +* [Cloud Profiler API Node.js Client API Reference][client-docs] +* [Cloud Profiler API Documentation][product-docs] +* [github.com/googleapis/google-cloud-node/packages/google-devtools-cloudprofiler](https://github.com/googleapis/google-cloud-node/tree/main/packages/google-devtools-cloudprofiler) + +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) + * [Using the client library](#using-the-client-library) +* [Samples](#samples) +* [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 Cloud Profiler API API][enable_api]. +1. [Set up authentication with a service account][auth] so you can access the + API from your local workstation. + +### Installing the client library + +```bash +npm install @google-cloud/cloudprofiler +``` + + +### Using the client library + +```javascript +/** + * 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. + */ +/** + * Parent project to create the profile in. + */ +// const parent = 'abc123' +/** + * Deployment details. + */ +// const deployment = {} +/** + * One or more profile types that the agent is capable of providing. + */ +// const profileType = [1,2,3,4] + +// Imports the Cloudprofiler library +const {ProfilerServiceClient} = require('@google-cloud/cloudprofiler').v2; + +// Instantiates a client +const cloudprofilerClient = new ProfilerServiceClient(); + +async function callCreateProfile() { + // Construct request + const request = { + project, + deployment: {projectId, target}, + profileType: [profileType], + }; + + // Run request + const response = await cloudprofilerClient.createProfile(request); + console.log(response); +} + +callCreateProfile(); + +``` + + + +## Samples + +Samples are in the [`samples/`](https://github.com/googleapis/google-cloud-node/tree/main/packages/google-devtools-cloudprofiler/samples) directory. Each sample's `README.md` has instructions for running its sample. + +| Sample | Source Code | Try it | +| --------------------------- | --------------------------------- | ------ | +| Profiler_service.create_offline_profile | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-devtools-cloudprofiler/samples/generated/v2/profiler_service.create_offline_profile.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-devtools-cloudprofiler/samples/generated/v2/profiler_service.create_offline_profile.js,packages/google-devtools-cloudprofiler/samples/README.md) | +| Profiler_service.create_profile | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-devtools-cloudprofiler/samples/generated/v2/profiler_service.create_profile.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-devtools-cloudprofiler/samples/generated/v2/profiler_service.create_profile.js,packages/google-devtools-cloudprofiler/samples/README.md) | +| Profiler_service.update_profile | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-devtools-cloudprofiler/samples/generated/v2/profiler_service.update_profile.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-devtools-cloudprofiler/samples/generated/v2/profiler_service.update_profile.js,packages/google-devtools-cloudprofiler/samples/README.md) | +| Quickstart | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-devtools-cloudprofiler/samples/quickstart.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-devtools-cloudprofiler/samples/quickstart.js,packages/google-devtools-cloudprofiler/samples/README.md) | + + + +The [Cloud Profiler API Node.js Client API Reference][client-docs] documentation +also contains 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/cloudprofiler@legacy-8` installs client libraries +for versions compatible with Node.js 8. + +## Versioning + +This library follows [Semantic Versioning](http://semver.org/). + + + + + + + +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. + + +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](https://github.com/googleapis/google-cloud-node/blob/main/CONTRIBUTING.md). + +Please note that this `README.md`, the `samples/README.md`, +and a variety of configuration files in this repository (including `.nycrc` and `tsconfig.json`) +are generated from a central template. To edit one of these files, make an edit +to its templates in +[directory](https://github.com/googleapis/synthtool). + +## License + +Apache Version 2.0 + +See [LICENSE](https://github.com/googleapis/google-cloud-node/blob/main/LICENSE) + +[client-docs]: https://cloud.google.com/nodejs/docs/reference/cloudprofiler/latest +[product-docs]: cloud.google.com/profiler/ +[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=cloudprofiler.googleapis.com +[auth]: https://cloud.google.com/docs/authentication/getting-started diff --git a/packages/google-devtools-cloudprofiler/package.json b/packages/google-devtools-cloudprofiler/package.json new file mode 100644 index 00000000000..49229b351e0 --- /dev/null +++ b/packages/google-devtools-cloudprofiler/package.json @@ -0,0 +1,70 @@ +{ + "name": "@google-cloud/cloudprofiler", + "version": "0.1.0", + "description": "Cloud Profiler API client for Node.js", + "repository": { + "type": "git", + "url": "https://github.com/googleapis/google-cloud-node.git", + "directory": "packages/google-devtools-cloudprofiler" + }, + "license": "Apache-2.0", + "author": "Google LLC", + "main": "build/src/index.js", + "files": [ + "build/src", + "build/protos" + ], + "homepage": "https://github.com/googleapis/google-cloud-node/tree/main/packages/google-devtools-cloudprofiler", + "keywords": [ + "google apis client", + "google api client", + "google apis", + "google api", + "google", + "google cloud platform", + "google cloud", + "cloud", + "google cloudprofiler", + "cloudprofiler", + "Cloud Profiler API" + ], + "scripts": { + "clean": "gts clean", + "compile": "tsc -p . && cp -r protos build/", + "compile-protos": "compileProtos src", + "docs": "jsdoc -c .jsdoc.js", + "predocs-test": "npm run docs", + "docs-test": "linkinator docs", + "fix": "gts fix", + "lint": "gts check", + "postpack": "minifyProtoJson", + "prepare": "npm run compile-protos && npm run compile", + "system-test": "c8 mocha build/system-test", + "test": "c8 mocha build/test", + "samples-test": "cd samples/ && npm link ../ && npm i && npm test", + "prelint": "cd samples; npm link ../; npm i" + }, + "dependencies": { + "google-gax": "^4.0.3" + }, + "devDependencies": { + "@types/mocha": "^9.0.0", + "@types/node": "^20.4.5", + "@types/sinon": "^10.0.0", + "c8": "^8.0.1", + "gapic-tools": "^0.1.8", + "gts": "^5.0.0", + "jsdoc": "^4.0.0", + "jsdoc-fresh": "^3.0.0", + "jsdoc-region-tag": "^3.0.0", + "linkinator": "4.1.2", + "long": "^5.2.3", + "mocha": "^9.2.2", + "pack-n-play": "^1.0.0-2", + "sinon": "^15.0.0", + "typescript": "^5.1.6" + }, + "engines": { + "node": ">=14.0.0" + } +} diff --git a/packages/google-devtools-cloudprofiler/protos/google/devtools/cloudprofiler/v2/profiler.proto b/packages/google-devtools-cloudprofiler/protos/google/devtools/cloudprofiler/v2/profiler.proto new file mode 100644 index 00000000000..9f60891924b --- /dev/null +++ b/packages/google-devtools-cloudprofiler/protos/google/devtools/cloudprofiler/v2/profiler.proto @@ -0,0 +1,233 @@ +// Copyright 2023 Google LLC +// +// Licensed under the Apache License, Version 2.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.devtools.cloudprofiler.v2; + +import "google/api/annotations.proto"; +import "google/api/client.proto"; +import "google/api/field_behavior.proto"; +import "google/api/resource.proto"; +import "google/protobuf/duration.proto"; +import "google/protobuf/field_mask.proto"; + +option csharp_namespace = "Google.Cloud.Profiler.V2"; +option go_package = "google.golang.org/genproto/googleapis/devtools/cloudprofiler/v2;cloudprofiler"; +option java_multiple_files = true; +option java_outer_classname = "ProfilerProto"; +option java_package = "com.google.devtools.cloudprofiler.v2"; +option php_namespace = "Google\\Cloud\\Profiler\\V2"; +option ruby_package = "Google::Cloud::Profiler::V2"; + +// Manage the collection of continuous profiling data provided by profiling +// agents running in the cloud or by an offline provider of profiling data. +// +// General guidelines: +// * Profiles for a single deployment must be created in ascending time order. +// * Profiles can be created in either online or offline mode, see below. +service ProfilerService { + option (google.api.default_host) = "cloudprofiler.googleapis.com"; + option (google.api.oauth_scopes) = + "https://www.googleapis.com/auth/cloud-platform," + "https://www.googleapis.com/auth/monitoring," + "https://www.googleapis.com/auth/monitoring.write"; + + // CreateProfile creates a new profile resource in the online mode. + // + // The server ensures that the new profiles are created at a constant rate per + // deployment, so the creation request may hang for some time until the next + // profile session is available. + // + // The request may fail with ABORTED error if the creation is not available + // within ~1m, the response will indicate the duration of the backoff the + // client should take before attempting creating a profile again. The backoff + // duration is returned in google.rpc.RetryInfo extension on the response + // status. To a gRPC client, the extension will be return as a + // binary-serialized proto in the trailing metadata item named + // "google.rpc.retryinfo-bin". + // + rpc CreateProfile(CreateProfileRequest) returns (Profile) { + option (google.api.http) = { + post: "/v2/{parent=projects/*}/profiles" + body: "*" + }; + } + + // CreateOfflineProfile creates a new profile resource in the offline mode. + // The client provides the profile to create along with the profile bytes, the + // server records it. + rpc CreateOfflineProfile(CreateOfflineProfileRequest) returns (Profile) { + option (google.api.http) = { + post: "/v2/{parent=projects/*}/profiles:createOffline" + body: "profile" + }; + option (google.api.method_signature) = "parent,profile"; + } + + // UpdateProfile updates the profile bytes and labels on the profile resource + // created in the online mode. Updating the bytes for profiles created in the + // offline mode is currently not supported: the profile content must be + // provided at the time of the profile creation. + rpc UpdateProfile(UpdateProfileRequest) returns (Profile) { + option (google.api.http) = { + patch: "/v2/{profile.name=projects/*/profiles/*}" + body: "profile" + }; + option (google.api.method_signature) = "profile,update_mask"; + } +} + +// CreateProfileRequest describes a profile resource online creation request. +// The deployment field must be populated. The profile_type specifies the list +// of profile types supported by the agent. The creation call will hang until a +// profile of one of these types needs to be collected. +// +message CreateProfileRequest { + // Parent project to create the profile in. + string parent = 4 [(google.api.resource_reference) = { + type: "cloudresourcemanager.googleapis.com/Project" + }]; + + // Deployment details. + Deployment deployment = 1; + + // One or more profile types that the agent is capable of providing. + repeated ProfileType profile_type = 2; +} + +// CreateOfflineProfileRequest describes a profile resource offline creation +// request. +message CreateOfflineProfileRequest { + // Parent project to create the profile in. + string parent = 1 [(google.api.resource_reference) = { + type: "cloudresourcemanager.googleapis.com/Project" + }]; + + // Contents of the profile to create. + Profile profile = 2; +} + +// UpdateProfileRequest contains the profile to update. +message UpdateProfileRequest { + // Profile to update. + Profile profile = 1; + + // Field mask used to specify the fields to be overwritten. Currently only + // profile_bytes and labels fields are supported by UpdateProfile, so only + // those fields can be specified in the mask. When no mask is provided, all + // fields are overwritten. + google.protobuf.FieldMask update_mask = 2; +} + +// Profile resource. +message Profile { + option (google.api.resource) = { + type: "cloudprofiler.googleapis.com/Profile" + pattern: "projects/{project}/profiles/{profile}" + }; + + // Output only. Opaque, server-assigned, unique ID for this profile. + string name = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Type of profile. + // For offline mode, this must be specified when creating the profile. For + // online mode it is assigned and returned by the server. + ProfileType profile_type = 2; + + // Deployment this profile corresponds to. + Deployment deployment = 3; + + // Duration of the profiling session. + // Input (for the offline mode) or output (for the online mode). + // The field represents requested profiling duration. It may slightly differ + // from the effective profiling duration, which is recorded in the profile + // data, in case the profiling can't be stopped immediately (e.g. in case + // stopping the profiling is handled asynchronously). + google.protobuf.Duration duration = 4; + + // Input only. Profile bytes, as a gzip compressed serialized proto, the + // format is https://github.com/google/pprof/blob/master/proto/profile.proto. + bytes profile_bytes = 5 [(google.api.field_behavior) = INPUT_ONLY]; + + // Input only. Labels associated to this specific profile. These labels will + // get merged with the deployment labels for the final data set. See + // documentation on deployment labels for validation rules and limits. + map labels = 6 [(google.api.field_behavior) = INPUT_ONLY]; +} + +// Deployment contains the deployment identification information. +message Deployment { + // Project ID is the ID of a cloud project. + // Validation regex: `^[a-z][-a-z0-9:.]{4,61}[a-z0-9]$`. + string project_id = 1; + + // Target is the service name used to group related deployments: + // * Service name for App Engine Flex / Standard. + // * Cluster and container name for GKE. + // * User-specified string for direct Compute Engine profiling (e.g. Java). + // * Job name for Dataflow. + // Validation regex: `^[a-z0-9]([-a-z0-9_.]{0,253}[a-z0-9])?$`. + string target = 2; + + // Labels identify the deployment within the user universe and same target. + // Validation regex for label names: `^[a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?$`. + // Value for an individual label must be <= 512 bytes, the total + // size of all label names and values must be <= 1024 bytes. + // + // Label named "language" can be used to record the programming language of + // the profiled deployment. The standard choices for the value include "java", + // "go", "python", "ruby", "nodejs", "php", "dotnet". + // + // For deployments running on Google Cloud Platform, "zone" or "region" label + // should be present describing the deployment location. An example of a zone + // is "us-central1-a", an example of a region is "us-central1" or + // "us-central". + map labels = 3; +} + +// ProfileType is type of profiling data. +// NOTE: the enumeration member names are used (in lowercase) as unique string +// identifiers of profile types, so they must not be renamed. +enum ProfileType { + // Unspecified profile type. + PROFILE_TYPE_UNSPECIFIED = 0; + + // Thread CPU time sampling. + CPU = 1; + + // Wallclock time sampling. More expensive as stops all threads. + WALL = 2; + + // In-use heap profile. Represents a snapshot of the allocations that are + // live at the time of the profiling. + HEAP = 3; + + // Single-shot collection of all thread stacks. + THREADS = 4; + + // Synchronization contention profile. + CONTENTION = 5; + + // Peak heap profile. + PEAK_HEAP = 6; + + // Heap allocation profile. It represents the aggregation of all allocations + // made over the duration of the profile. All allocations are included, + // including those that might have been freed by the end of the profiling + // interval. The profile is in particular useful for garbage collecting + // languages to understand which parts of the code create most of the garbage + // collection pressure to see if those can be optimized. + HEAP_ALLOC = 7; +} diff --git a/packages/google-devtools-cloudprofiler/protos/protos.d.ts b/packages/google-devtools-cloudprofiler/protos/protos.d.ts new file mode 100644 index 00000000000..415c93af6fa --- /dev/null +++ b/packages/google-devtools-cloudprofiler/protos/protos.d.ts @@ -0,0 +1,6349 @@ +// Copyright 2023 Google LLC +// +// Licensed under the Apache License, Version 2.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 devtools. */ + namespace devtools { + + /** Namespace cloudprofiler. */ + namespace cloudprofiler { + + /** Namespace v2. */ + namespace v2 { + + /** Represents a ProfilerService */ + class ProfilerService extends $protobuf.rpc.Service { + + /** + * Constructs a new ProfilerService 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 ProfilerService 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): ProfilerService; + + /** + * Calls CreateProfile. + * @param request CreateProfileRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Profile + */ + public createProfile(request: google.devtools.cloudprofiler.v2.ICreateProfileRequest, callback: google.devtools.cloudprofiler.v2.ProfilerService.CreateProfileCallback): void; + + /** + * Calls CreateProfile. + * @param request CreateProfileRequest message or plain object + * @returns Promise + */ + public createProfile(request: google.devtools.cloudprofiler.v2.ICreateProfileRequest): Promise; + + /** + * Calls CreateOfflineProfile. + * @param request CreateOfflineProfileRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Profile + */ + public createOfflineProfile(request: google.devtools.cloudprofiler.v2.ICreateOfflineProfileRequest, callback: google.devtools.cloudprofiler.v2.ProfilerService.CreateOfflineProfileCallback): void; + + /** + * Calls CreateOfflineProfile. + * @param request CreateOfflineProfileRequest message or plain object + * @returns Promise + */ + public createOfflineProfile(request: google.devtools.cloudprofiler.v2.ICreateOfflineProfileRequest): Promise; + + /** + * Calls UpdateProfile. + * @param request UpdateProfileRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Profile + */ + public updateProfile(request: google.devtools.cloudprofiler.v2.IUpdateProfileRequest, callback: google.devtools.cloudprofiler.v2.ProfilerService.UpdateProfileCallback): void; + + /** + * Calls UpdateProfile. + * @param request UpdateProfileRequest message or plain object + * @returns Promise + */ + public updateProfile(request: google.devtools.cloudprofiler.v2.IUpdateProfileRequest): Promise; + } + + namespace ProfilerService { + + /** + * Callback as used by {@link google.devtools.cloudprofiler.v2.ProfilerService|createProfile}. + * @param error Error, if any + * @param [response] Profile + */ + type CreateProfileCallback = (error: (Error|null), response?: google.devtools.cloudprofiler.v2.Profile) => void; + + /** + * Callback as used by {@link google.devtools.cloudprofiler.v2.ProfilerService|createOfflineProfile}. + * @param error Error, if any + * @param [response] Profile + */ + type CreateOfflineProfileCallback = (error: (Error|null), response?: google.devtools.cloudprofiler.v2.Profile) => void; + + /** + * Callback as used by {@link google.devtools.cloudprofiler.v2.ProfilerService|updateProfile}. + * @param error Error, if any + * @param [response] Profile + */ + type UpdateProfileCallback = (error: (Error|null), response?: google.devtools.cloudprofiler.v2.Profile) => void; + } + + /** Properties of a CreateProfileRequest. */ + interface ICreateProfileRequest { + + /** CreateProfileRequest parent */ + parent?: (string|null); + + /** CreateProfileRequest deployment */ + deployment?: (google.devtools.cloudprofiler.v2.IDeployment|null); + + /** CreateProfileRequest profileType */ + profileType?: (google.devtools.cloudprofiler.v2.ProfileType[]|null); + } + + /** Represents a CreateProfileRequest. */ + class CreateProfileRequest implements ICreateProfileRequest { + + /** + * Constructs a new CreateProfileRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.devtools.cloudprofiler.v2.ICreateProfileRequest); + + /** CreateProfileRequest parent. */ + public parent: string; + + /** CreateProfileRequest deployment. */ + public deployment?: (google.devtools.cloudprofiler.v2.IDeployment|null); + + /** CreateProfileRequest profileType. */ + public profileType: google.devtools.cloudprofiler.v2.ProfileType[]; + + /** + * Creates a new CreateProfileRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns CreateProfileRequest instance + */ + public static create(properties?: google.devtools.cloudprofiler.v2.ICreateProfileRequest): google.devtools.cloudprofiler.v2.CreateProfileRequest; + + /** + * Encodes the specified CreateProfileRequest message. Does not implicitly {@link google.devtools.cloudprofiler.v2.CreateProfileRequest.verify|verify} messages. + * @param message CreateProfileRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.devtools.cloudprofiler.v2.ICreateProfileRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CreateProfileRequest message, length delimited. Does not implicitly {@link google.devtools.cloudprofiler.v2.CreateProfileRequest.verify|verify} messages. + * @param message CreateProfileRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.devtools.cloudprofiler.v2.ICreateProfileRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CreateProfileRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CreateProfileRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.devtools.cloudprofiler.v2.CreateProfileRequest; + + /** + * Decodes a CreateProfileRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CreateProfileRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.devtools.cloudprofiler.v2.CreateProfileRequest; + + /** + * Verifies a CreateProfileRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CreateProfileRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CreateProfileRequest + */ + public static fromObject(object: { [k: string]: any }): google.devtools.cloudprofiler.v2.CreateProfileRequest; + + /** + * Creates a plain object from a CreateProfileRequest message. Also converts values to other types if specified. + * @param message CreateProfileRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.devtools.cloudprofiler.v2.CreateProfileRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CreateProfileRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CreateProfileRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a CreateOfflineProfileRequest. */ + interface ICreateOfflineProfileRequest { + + /** CreateOfflineProfileRequest parent */ + parent?: (string|null); + + /** CreateOfflineProfileRequest profile */ + profile?: (google.devtools.cloudprofiler.v2.IProfile|null); + } + + /** Represents a CreateOfflineProfileRequest. */ + class CreateOfflineProfileRequest implements ICreateOfflineProfileRequest { + + /** + * Constructs a new CreateOfflineProfileRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.devtools.cloudprofiler.v2.ICreateOfflineProfileRequest); + + /** CreateOfflineProfileRequest parent. */ + public parent: string; + + /** CreateOfflineProfileRequest profile. */ + public profile?: (google.devtools.cloudprofiler.v2.IProfile|null); + + /** + * Creates a new CreateOfflineProfileRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns CreateOfflineProfileRequest instance + */ + public static create(properties?: google.devtools.cloudprofiler.v2.ICreateOfflineProfileRequest): google.devtools.cloudprofiler.v2.CreateOfflineProfileRequest; + + /** + * Encodes the specified CreateOfflineProfileRequest message. Does not implicitly {@link google.devtools.cloudprofiler.v2.CreateOfflineProfileRequest.verify|verify} messages. + * @param message CreateOfflineProfileRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.devtools.cloudprofiler.v2.ICreateOfflineProfileRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CreateOfflineProfileRequest message, length delimited. Does not implicitly {@link google.devtools.cloudprofiler.v2.CreateOfflineProfileRequest.verify|verify} messages. + * @param message CreateOfflineProfileRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.devtools.cloudprofiler.v2.ICreateOfflineProfileRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CreateOfflineProfileRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CreateOfflineProfileRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.devtools.cloudprofiler.v2.CreateOfflineProfileRequest; + + /** + * Decodes a CreateOfflineProfileRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CreateOfflineProfileRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.devtools.cloudprofiler.v2.CreateOfflineProfileRequest; + + /** + * Verifies a CreateOfflineProfileRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CreateOfflineProfileRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CreateOfflineProfileRequest + */ + public static fromObject(object: { [k: string]: any }): google.devtools.cloudprofiler.v2.CreateOfflineProfileRequest; + + /** + * Creates a plain object from a CreateOfflineProfileRequest message. Also converts values to other types if specified. + * @param message CreateOfflineProfileRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.devtools.cloudprofiler.v2.CreateOfflineProfileRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CreateOfflineProfileRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CreateOfflineProfileRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an UpdateProfileRequest. */ + interface IUpdateProfileRequest { + + /** UpdateProfileRequest profile */ + profile?: (google.devtools.cloudprofiler.v2.IProfile|null); + + /** UpdateProfileRequest updateMask */ + updateMask?: (google.protobuf.IFieldMask|null); + } + + /** Represents an UpdateProfileRequest. */ + class UpdateProfileRequest implements IUpdateProfileRequest { + + /** + * Constructs a new UpdateProfileRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.devtools.cloudprofiler.v2.IUpdateProfileRequest); + + /** UpdateProfileRequest profile. */ + public profile?: (google.devtools.cloudprofiler.v2.IProfile|null); + + /** UpdateProfileRequest updateMask. */ + public updateMask?: (google.protobuf.IFieldMask|null); + + /** + * Creates a new UpdateProfileRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns UpdateProfileRequest instance + */ + public static create(properties?: google.devtools.cloudprofiler.v2.IUpdateProfileRequest): google.devtools.cloudprofiler.v2.UpdateProfileRequest; + + /** + * Encodes the specified UpdateProfileRequest message. Does not implicitly {@link google.devtools.cloudprofiler.v2.UpdateProfileRequest.verify|verify} messages. + * @param message UpdateProfileRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.devtools.cloudprofiler.v2.IUpdateProfileRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified UpdateProfileRequest message, length delimited. Does not implicitly {@link google.devtools.cloudprofiler.v2.UpdateProfileRequest.verify|verify} messages. + * @param message UpdateProfileRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.devtools.cloudprofiler.v2.IUpdateProfileRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an UpdateProfileRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns UpdateProfileRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.devtools.cloudprofiler.v2.UpdateProfileRequest; + + /** + * Decodes an UpdateProfileRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns UpdateProfileRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.devtools.cloudprofiler.v2.UpdateProfileRequest; + + /** + * Verifies an UpdateProfileRequest message. + * @param message Plain 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 UpdateProfileRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns UpdateProfileRequest + */ + public static fromObject(object: { [k: string]: any }): google.devtools.cloudprofiler.v2.UpdateProfileRequest; + + /** + * Creates a plain object from an UpdateProfileRequest message. Also converts values to other types if specified. + * @param message UpdateProfileRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.devtools.cloudprofiler.v2.UpdateProfileRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this UpdateProfileRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for UpdateProfileRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Profile. */ + interface IProfile { + + /** Profile name */ + name?: (string|null); + + /** Profile profileType */ + profileType?: (google.devtools.cloudprofiler.v2.ProfileType|keyof typeof google.devtools.cloudprofiler.v2.ProfileType|null); + + /** Profile deployment */ + deployment?: (google.devtools.cloudprofiler.v2.IDeployment|null); + + /** Profile duration */ + duration?: (google.protobuf.IDuration|null); + + /** Profile profileBytes */ + profileBytes?: (Uint8Array|string|null); + + /** Profile labels */ + labels?: ({ [k: string]: string }|null); + } + + /** Represents a Profile. */ + class Profile implements IProfile { + + /** + * Constructs a new Profile. + * @param [properties] Properties to set + */ + constructor(properties?: google.devtools.cloudprofiler.v2.IProfile); + + /** Profile name. */ + public name: string; + + /** Profile profileType. */ + public profileType: (google.devtools.cloudprofiler.v2.ProfileType|keyof typeof google.devtools.cloudprofiler.v2.ProfileType); + + /** Profile deployment. */ + public deployment?: (google.devtools.cloudprofiler.v2.IDeployment|null); + + /** Profile duration. */ + public duration?: (google.protobuf.IDuration|null); + + /** Profile profileBytes. */ + public profileBytes: (Uint8Array|string); + + /** Profile labels. */ + public labels: { [k: string]: string }; + + /** + * Creates a new Profile instance using the specified properties. + * @param [properties] Properties to set + * @returns Profile instance + */ + public static create(properties?: google.devtools.cloudprofiler.v2.IProfile): google.devtools.cloudprofiler.v2.Profile; + + /** + * Encodes the specified Profile message. Does not implicitly {@link google.devtools.cloudprofiler.v2.Profile.verify|verify} messages. + * @param message Profile message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.devtools.cloudprofiler.v2.IProfile, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Profile message, length delimited. Does not implicitly {@link google.devtools.cloudprofiler.v2.Profile.verify|verify} messages. + * @param message Profile message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.devtools.cloudprofiler.v2.IProfile, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Profile message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Profile + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.devtools.cloudprofiler.v2.Profile; + + /** + * Decodes a Profile message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Profile + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.devtools.cloudprofiler.v2.Profile; + + /** + * Verifies a Profile message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Profile message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Profile + */ + public static fromObject(object: { [k: string]: any }): google.devtools.cloudprofiler.v2.Profile; + + /** + * Creates a plain object from a Profile message. Also converts values to other types if specified. + * @param message Profile + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.devtools.cloudprofiler.v2.Profile, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Profile to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Profile + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Deployment. */ + interface IDeployment { + + /** Deployment projectId */ + projectId?: (string|null); + + /** Deployment target */ + target?: (string|null); + + /** Deployment labels */ + labels?: ({ [k: string]: string }|null); + } + + /** Represents a Deployment. */ + class Deployment implements IDeployment { + + /** + * Constructs a new Deployment. + * @param [properties] Properties to set + */ + constructor(properties?: google.devtools.cloudprofiler.v2.IDeployment); + + /** Deployment projectId. */ + public projectId: string; + + /** Deployment target. */ + public target: string; + + /** Deployment labels. */ + public labels: { [k: string]: string }; + + /** + * Creates a new Deployment instance using the specified properties. + * @param [properties] Properties to set + * @returns Deployment instance + */ + public static create(properties?: google.devtools.cloudprofiler.v2.IDeployment): google.devtools.cloudprofiler.v2.Deployment; + + /** + * Encodes the specified Deployment message. Does not implicitly {@link google.devtools.cloudprofiler.v2.Deployment.verify|verify} messages. + * @param message Deployment message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.devtools.cloudprofiler.v2.IDeployment, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Deployment message, length delimited. Does not implicitly {@link google.devtools.cloudprofiler.v2.Deployment.verify|verify} messages. + * @param message Deployment message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.devtools.cloudprofiler.v2.IDeployment, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Deployment message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Deployment + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.devtools.cloudprofiler.v2.Deployment; + + /** + * Decodes a Deployment message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Deployment + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.devtools.cloudprofiler.v2.Deployment; + + /** + * Verifies a Deployment message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Deployment message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Deployment + */ + public static fromObject(object: { [k: string]: any }): google.devtools.cloudprofiler.v2.Deployment; + + /** + * Creates a plain object from a Deployment message. Also converts values to other types if specified. + * @param message Deployment + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.devtools.cloudprofiler.v2.Deployment, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Deployment to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Deployment + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** ProfileType enum. */ + enum ProfileType { + PROFILE_TYPE_UNSPECIFIED = 0, + CPU = 1, + WALL = 2, + HEAP = 3, + THREADS = 4, + CONTENTION = 5, + PEAK_HEAP = 6, + HEAP_ALLOC = 7 + } + } + } + } + + /** 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); + } + + /** 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[]; + + /** + * 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); + } + + /** 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); + + /** + * 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); + } + + /** 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); + + /** + * 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 + } + + /** 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 + } + + /** 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; + } + + /** 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?: (string|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: string; + + /** + * 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); + } + + /** 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[]; + + /** + * 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; + } + + /** 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_REQUIRED = 2, + LABEL_REPEATED = 3 + } + } + + /** 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 phpGenericServices */ + phpGenericServices?: (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 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 phpGenericServices. */ + public phpGenericServices: 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 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 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 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 target */ + target?: (google.protobuf.FieldOptions.OptionTargetType|keyof typeof google.protobuf.FieldOptions.OptionTargetType|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 target. */ + public target: (google.protobuf.FieldOptions.OptionTargetType|keyof typeof google.protobuf.FieldOptions.OptionTargetType); + + /** 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 OneofOptions. */ + interface IOneofOptions { + + /** 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 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 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 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 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 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 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); + } + + /** Represents a ServiceOptions. */ + class ServiceOptions implements IServiceOptions { + + /** + * Constructs a new ServiceOptions. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IServiceOptions); + + /** 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 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); + } + + /** 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 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|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|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 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 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; + } + } +} diff --git a/packages/google-devtools-cloudprofiler/protos/protos.js b/packages/google-devtools-cloudprofiler/protos/protos.js new file mode 100644 index 00000000000..935d17058d8 --- /dev/null +++ b/packages/google-devtools-cloudprofiler/protos/protos.js @@ -0,0 +1,17131 @@ +// Copyright 2023 Google LLC +// +// Licensed under the Apache License, Version 2.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_cloudprofiler_protos || ($protobuf.roots._google_cloud_cloudprofiler_protos = {}); + + $root.google = (function() { + + /** + * Namespace google. + * @exports google + * @namespace + */ + var google = {}; + + google.devtools = (function() { + + /** + * Namespace devtools. + * @memberof google + * @namespace + */ + var devtools = {}; + + devtools.cloudprofiler = (function() { + + /** + * Namespace cloudprofiler. + * @memberof google.devtools + * @namespace + */ + var cloudprofiler = {}; + + cloudprofiler.v2 = (function() { + + /** + * Namespace v2. + * @memberof google.devtools.cloudprofiler + * @namespace + */ + var v2 = {}; + + v2.ProfilerService = (function() { + + /** + * Constructs a new ProfilerService service. + * @memberof google.devtools.cloudprofiler.v2 + * @classdesc Represents a ProfilerService + * @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 ProfilerService(rpcImpl, requestDelimited, responseDelimited) { + $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); + } + + (ProfilerService.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = ProfilerService; + + /** + * Creates new ProfilerService service using the specified rpc implementation. + * @function create + * @memberof google.devtools.cloudprofiler.v2.ProfilerService + * @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 {ProfilerService} RPC service. Useful where requests and/or responses are streamed. + */ + ProfilerService.create = function create(rpcImpl, requestDelimited, responseDelimited) { + return new this(rpcImpl, requestDelimited, responseDelimited); + }; + + /** + * Callback as used by {@link google.devtools.cloudprofiler.v2.ProfilerService|createProfile}. + * @memberof google.devtools.cloudprofiler.v2.ProfilerService + * @typedef CreateProfileCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.devtools.cloudprofiler.v2.Profile} [response] Profile + */ + + /** + * Calls CreateProfile. + * @function createProfile + * @memberof google.devtools.cloudprofiler.v2.ProfilerService + * @instance + * @param {google.devtools.cloudprofiler.v2.ICreateProfileRequest} request CreateProfileRequest message or plain object + * @param {google.devtools.cloudprofiler.v2.ProfilerService.CreateProfileCallback} callback Node-style callback called with the error, if any, and Profile + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(ProfilerService.prototype.createProfile = function createProfile(request, callback) { + return this.rpcCall(createProfile, $root.google.devtools.cloudprofiler.v2.CreateProfileRequest, $root.google.devtools.cloudprofiler.v2.Profile, request, callback); + }, "name", { value: "CreateProfile" }); + + /** + * Calls CreateProfile. + * @function createProfile + * @memberof google.devtools.cloudprofiler.v2.ProfilerService + * @instance + * @param {google.devtools.cloudprofiler.v2.ICreateProfileRequest} request CreateProfileRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.devtools.cloudprofiler.v2.ProfilerService|createOfflineProfile}. + * @memberof google.devtools.cloudprofiler.v2.ProfilerService + * @typedef CreateOfflineProfileCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.devtools.cloudprofiler.v2.Profile} [response] Profile + */ + + /** + * Calls CreateOfflineProfile. + * @function createOfflineProfile + * @memberof google.devtools.cloudprofiler.v2.ProfilerService + * @instance + * @param {google.devtools.cloudprofiler.v2.ICreateOfflineProfileRequest} request CreateOfflineProfileRequest message or plain object + * @param {google.devtools.cloudprofiler.v2.ProfilerService.CreateOfflineProfileCallback} callback Node-style callback called with the error, if any, and Profile + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(ProfilerService.prototype.createOfflineProfile = function createOfflineProfile(request, callback) { + return this.rpcCall(createOfflineProfile, $root.google.devtools.cloudprofiler.v2.CreateOfflineProfileRequest, $root.google.devtools.cloudprofiler.v2.Profile, request, callback); + }, "name", { value: "CreateOfflineProfile" }); + + /** + * Calls CreateOfflineProfile. + * @function createOfflineProfile + * @memberof google.devtools.cloudprofiler.v2.ProfilerService + * @instance + * @param {google.devtools.cloudprofiler.v2.ICreateOfflineProfileRequest} request CreateOfflineProfileRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.devtools.cloudprofiler.v2.ProfilerService|updateProfile}. + * @memberof google.devtools.cloudprofiler.v2.ProfilerService + * @typedef UpdateProfileCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.devtools.cloudprofiler.v2.Profile} [response] Profile + */ + + /** + * Calls UpdateProfile. + * @function updateProfile + * @memberof google.devtools.cloudprofiler.v2.ProfilerService + * @instance + * @param {google.devtools.cloudprofiler.v2.IUpdateProfileRequest} request UpdateProfileRequest message or plain object + * @param {google.devtools.cloudprofiler.v2.ProfilerService.UpdateProfileCallback} callback Node-style callback called with the error, if any, and Profile + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(ProfilerService.prototype.updateProfile = function updateProfile(request, callback) { + return this.rpcCall(updateProfile, $root.google.devtools.cloudprofiler.v2.UpdateProfileRequest, $root.google.devtools.cloudprofiler.v2.Profile, request, callback); + }, "name", { value: "UpdateProfile" }); + + /** + * Calls UpdateProfile. + * @function updateProfile + * @memberof google.devtools.cloudprofiler.v2.ProfilerService + * @instance + * @param {google.devtools.cloudprofiler.v2.IUpdateProfileRequest} request UpdateProfileRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + return ProfilerService; + })(); + + v2.CreateProfileRequest = (function() { + + /** + * Properties of a CreateProfileRequest. + * @memberof google.devtools.cloudprofiler.v2 + * @interface ICreateProfileRequest + * @property {string|null} [parent] CreateProfileRequest parent + * @property {google.devtools.cloudprofiler.v2.IDeployment|null} [deployment] CreateProfileRequest deployment + * @property {Array.|null} [profileType] CreateProfileRequest profileType + */ + + /** + * Constructs a new CreateProfileRequest. + * @memberof google.devtools.cloudprofiler.v2 + * @classdesc Represents a CreateProfileRequest. + * @implements ICreateProfileRequest + * @constructor + * @param {google.devtools.cloudprofiler.v2.ICreateProfileRequest=} [properties] Properties to set + */ + function CreateProfileRequest(properties) { + this.profileType = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * CreateProfileRequest parent. + * @member {string} parent + * @memberof google.devtools.cloudprofiler.v2.CreateProfileRequest + * @instance + */ + CreateProfileRequest.prototype.parent = ""; + + /** + * CreateProfileRequest deployment. + * @member {google.devtools.cloudprofiler.v2.IDeployment|null|undefined} deployment + * @memberof google.devtools.cloudprofiler.v2.CreateProfileRequest + * @instance + */ + CreateProfileRequest.prototype.deployment = null; + + /** + * CreateProfileRequest profileType. + * @member {Array.} profileType + * @memberof google.devtools.cloudprofiler.v2.CreateProfileRequest + * @instance + */ + CreateProfileRequest.prototype.profileType = $util.emptyArray; + + /** + * Creates a new CreateProfileRequest instance using the specified properties. + * @function create + * @memberof google.devtools.cloudprofiler.v2.CreateProfileRequest + * @static + * @param {google.devtools.cloudprofiler.v2.ICreateProfileRequest=} [properties] Properties to set + * @returns {google.devtools.cloudprofiler.v2.CreateProfileRequest} CreateProfileRequest instance + */ + CreateProfileRequest.create = function create(properties) { + return new CreateProfileRequest(properties); + }; + + /** + * Encodes the specified CreateProfileRequest message. Does not implicitly {@link google.devtools.cloudprofiler.v2.CreateProfileRequest.verify|verify} messages. + * @function encode + * @memberof google.devtools.cloudprofiler.v2.CreateProfileRequest + * @static + * @param {google.devtools.cloudprofiler.v2.ICreateProfileRequest} message CreateProfileRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateProfileRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.deployment != null && Object.hasOwnProperty.call(message, "deployment")) + $root.google.devtools.cloudprofiler.v2.Deployment.encode(message.deployment, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.profileType != null && message.profileType.length) { + writer.uint32(/* id 2, wireType 2 =*/18).fork(); + for (var i = 0; i < message.profileType.length; ++i) + writer.int32(message.profileType[i]); + writer.ldelim(); + } + if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.parent); + return writer; + }; + + /** + * Encodes the specified CreateProfileRequest message, length delimited. Does not implicitly {@link google.devtools.cloudprofiler.v2.CreateProfileRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.devtools.cloudprofiler.v2.CreateProfileRequest + * @static + * @param {google.devtools.cloudprofiler.v2.ICreateProfileRequest} message CreateProfileRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateProfileRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CreateProfileRequest message from the specified reader or buffer. + * @function decode + * @memberof google.devtools.cloudprofiler.v2.CreateProfileRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.devtools.cloudprofiler.v2.CreateProfileRequest} CreateProfileRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateProfileRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.devtools.cloudprofiler.v2.CreateProfileRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 4: { + message.parent = reader.string(); + break; + } + case 1: { + message.deployment = $root.google.devtools.cloudprofiler.v2.Deployment.decode(reader, reader.uint32()); + break; + } + case 2: { + if (!(message.profileType && message.profileType.length)) + message.profileType = []; + if ((tag & 7) === 2) { + var end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) + message.profileType.push(reader.int32()); + } else + message.profileType.push(reader.int32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CreateProfileRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.devtools.cloudprofiler.v2.CreateProfileRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.devtools.cloudprofiler.v2.CreateProfileRequest} CreateProfileRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateProfileRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CreateProfileRequest message. + * @function verify + * @memberof google.devtools.cloudprofiler.v2.CreateProfileRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CreateProfileRequest.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.deployment != null && message.hasOwnProperty("deployment")) { + var error = $root.google.devtools.cloudprofiler.v2.Deployment.verify(message.deployment); + if (error) + return "deployment." + error; + } + if (message.profileType != null && message.hasOwnProperty("profileType")) { + if (!Array.isArray(message.profileType)) + return "profileType: array expected"; + for (var i = 0; i < message.profileType.length; ++i) + switch (message.profileType[i]) { + default: + return "profileType: enum value[] expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + case 5: + case 6: + case 7: + break; + } + } + return null; + }; + + /** + * Creates a CreateProfileRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.devtools.cloudprofiler.v2.CreateProfileRequest + * @static + * @param {Object.} object Plain object + * @returns {google.devtools.cloudprofiler.v2.CreateProfileRequest} CreateProfileRequest + */ + CreateProfileRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.devtools.cloudprofiler.v2.CreateProfileRequest) + return object; + var message = new $root.google.devtools.cloudprofiler.v2.CreateProfileRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.deployment != null) { + if (typeof object.deployment !== "object") + throw TypeError(".google.devtools.cloudprofiler.v2.CreateProfileRequest.deployment: object expected"); + message.deployment = $root.google.devtools.cloudprofiler.v2.Deployment.fromObject(object.deployment); + } + if (object.profileType) { + if (!Array.isArray(object.profileType)) + throw TypeError(".google.devtools.cloudprofiler.v2.CreateProfileRequest.profileType: array expected"); + message.profileType = []; + for (var i = 0; i < object.profileType.length; ++i) + switch (object.profileType[i]) { + default: + if (typeof object.profileType[i] === "number") { + message.profileType[i] = object.profileType[i]; + break; + } + case "PROFILE_TYPE_UNSPECIFIED": + case 0: + message.profileType[i] = 0; + break; + case "CPU": + case 1: + message.profileType[i] = 1; + break; + case "WALL": + case 2: + message.profileType[i] = 2; + break; + case "HEAP": + case 3: + message.profileType[i] = 3; + break; + case "THREADS": + case 4: + message.profileType[i] = 4; + break; + case "CONTENTION": + case 5: + message.profileType[i] = 5; + break; + case "PEAK_HEAP": + case 6: + message.profileType[i] = 6; + break; + case "HEAP_ALLOC": + case 7: + message.profileType[i] = 7; + break; + } + } + return message; + }; + + /** + * Creates a plain object from a CreateProfileRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.devtools.cloudprofiler.v2.CreateProfileRequest + * @static + * @param {google.devtools.cloudprofiler.v2.CreateProfileRequest} message CreateProfileRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CreateProfileRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.profileType = []; + if (options.defaults) { + object.deployment = null; + object.parent = ""; + } + if (message.deployment != null && message.hasOwnProperty("deployment")) + object.deployment = $root.google.devtools.cloudprofiler.v2.Deployment.toObject(message.deployment, options); + if (message.profileType && message.profileType.length) { + object.profileType = []; + for (var j = 0; j < message.profileType.length; ++j) + object.profileType[j] = options.enums === String ? $root.google.devtools.cloudprofiler.v2.ProfileType[message.profileType[j]] === undefined ? message.profileType[j] : $root.google.devtools.cloudprofiler.v2.ProfileType[message.profileType[j]] : message.profileType[j]; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + return object; + }; + + /** + * Converts this CreateProfileRequest to JSON. + * @function toJSON + * @memberof google.devtools.cloudprofiler.v2.CreateProfileRequest + * @instance + * @returns {Object.} JSON object + */ + CreateProfileRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CreateProfileRequest + * @function getTypeUrl + * @memberof google.devtools.cloudprofiler.v2.CreateProfileRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CreateProfileRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.devtools.cloudprofiler.v2.CreateProfileRequest"; + }; + + return CreateProfileRequest; + })(); + + v2.CreateOfflineProfileRequest = (function() { + + /** + * Properties of a CreateOfflineProfileRequest. + * @memberof google.devtools.cloudprofiler.v2 + * @interface ICreateOfflineProfileRequest + * @property {string|null} [parent] CreateOfflineProfileRequest parent + * @property {google.devtools.cloudprofiler.v2.IProfile|null} [profile] CreateOfflineProfileRequest profile + */ + + /** + * Constructs a new CreateOfflineProfileRequest. + * @memberof google.devtools.cloudprofiler.v2 + * @classdesc Represents a CreateOfflineProfileRequest. + * @implements ICreateOfflineProfileRequest + * @constructor + * @param {google.devtools.cloudprofiler.v2.ICreateOfflineProfileRequest=} [properties] Properties to set + */ + function CreateOfflineProfileRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * CreateOfflineProfileRequest parent. + * @member {string} parent + * @memberof google.devtools.cloudprofiler.v2.CreateOfflineProfileRequest + * @instance + */ + CreateOfflineProfileRequest.prototype.parent = ""; + + /** + * CreateOfflineProfileRequest profile. + * @member {google.devtools.cloudprofiler.v2.IProfile|null|undefined} profile + * @memberof google.devtools.cloudprofiler.v2.CreateOfflineProfileRequest + * @instance + */ + CreateOfflineProfileRequest.prototype.profile = null; + + /** + * Creates a new CreateOfflineProfileRequest instance using the specified properties. + * @function create + * @memberof google.devtools.cloudprofiler.v2.CreateOfflineProfileRequest + * @static + * @param {google.devtools.cloudprofiler.v2.ICreateOfflineProfileRequest=} [properties] Properties to set + * @returns {google.devtools.cloudprofiler.v2.CreateOfflineProfileRequest} CreateOfflineProfileRequest instance + */ + CreateOfflineProfileRequest.create = function create(properties) { + return new CreateOfflineProfileRequest(properties); + }; + + /** + * Encodes the specified CreateOfflineProfileRequest message. Does not implicitly {@link google.devtools.cloudprofiler.v2.CreateOfflineProfileRequest.verify|verify} messages. + * @function encode + * @memberof google.devtools.cloudprofiler.v2.CreateOfflineProfileRequest + * @static + * @param {google.devtools.cloudprofiler.v2.ICreateOfflineProfileRequest} message CreateOfflineProfileRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateOfflineProfileRequest.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.profile != null && Object.hasOwnProperty.call(message, "profile")) + $root.google.devtools.cloudprofiler.v2.Profile.encode(message.profile, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified CreateOfflineProfileRequest message, length delimited. Does not implicitly {@link google.devtools.cloudprofiler.v2.CreateOfflineProfileRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.devtools.cloudprofiler.v2.CreateOfflineProfileRequest + * @static + * @param {google.devtools.cloudprofiler.v2.ICreateOfflineProfileRequest} message CreateOfflineProfileRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateOfflineProfileRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CreateOfflineProfileRequest message from the specified reader or buffer. + * @function decode + * @memberof google.devtools.cloudprofiler.v2.CreateOfflineProfileRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.devtools.cloudprofiler.v2.CreateOfflineProfileRequest} CreateOfflineProfileRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateOfflineProfileRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.devtools.cloudprofiler.v2.CreateOfflineProfileRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.profile = $root.google.devtools.cloudprofiler.v2.Profile.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CreateOfflineProfileRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.devtools.cloudprofiler.v2.CreateOfflineProfileRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.devtools.cloudprofiler.v2.CreateOfflineProfileRequest} CreateOfflineProfileRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateOfflineProfileRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CreateOfflineProfileRequest message. + * @function verify + * @memberof google.devtools.cloudprofiler.v2.CreateOfflineProfileRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CreateOfflineProfileRequest.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.profile != null && message.hasOwnProperty("profile")) { + var error = $root.google.devtools.cloudprofiler.v2.Profile.verify(message.profile); + if (error) + return "profile." + error; + } + return null; + }; + + /** + * Creates a CreateOfflineProfileRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.devtools.cloudprofiler.v2.CreateOfflineProfileRequest + * @static + * @param {Object.} object Plain object + * @returns {google.devtools.cloudprofiler.v2.CreateOfflineProfileRequest} CreateOfflineProfileRequest + */ + CreateOfflineProfileRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.devtools.cloudprofiler.v2.CreateOfflineProfileRequest) + return object; + var message = new $root.google.devtools.cloudprofiler.v2.CreateOfflineProfileRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.profile != null) { + if (typeof object.profile !== "object") + throw TypeError(".google.devtools.cloudprofiler.v2.CreateOfflineProfileRequest.profile: object expected"); + message.profile = $root.google.devtools.cloudprofiler.v2.Profile.fromObject(object.profile); + } + return message; + }; + + /** + * Creates a plain object from a CreateOfflineProfileRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.devtools.cloudprofiler.v2.CreateOfflineProfileRequest + * @static + * @param {google.devtools.cloudprofiler.v2.CreateOfflineProfileRequest} message CreateOfflineProfileRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CreateOfflineProfileRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.profile = null; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.profile != null && message.hasOwnProperty("profile")) + object.profile = $root.google.devtools.cloudprofiler.v2.Profile.toObject(message.profile, options); + return object; + }; + + /** + * Converts this CreateOfflineProfileRequest to JSON. + * @function toJSON + * @memberof google.devtools.cloudprofiler.v2.CreateOfflineProfileRequest + * @instance + * @returns {Object.} JSON object + */ + CreateOfflineProfileRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CreateOfflineProfileRequest + * @function getTypeUrl + * @memberof google.devtools.cloudprofiler.v2.CreateOfflineProfileRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CreateOfflineProfileRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.devtools.cloudprofiler.v2.CreateOfflineProfileRequest"; + }; + + return CreateOfflineProfileRequest; + })(); + + v2.UpdateProfileRequest = (function() { + + /** + * Properties of an UpdateProfileRequest. + * @memberof google.devtools.cloudprofiler.v2 + * @interface IUpdateProfileRequest + * @property {google.devtools.cloudprofiler.v2.IProfile|null} [profile] UpdateProfileRequest profile + * @property {google.protobuf.IFieldMask|null} [updateMask] UpdateProfileRequest updateMask + */ + + /** + * Constructs a new UpdateProfileRequest. + * @memberof google.devtools.cloudprofiler.v2 + * @classdesc Represents an UpdateProfileRequest. + * @implements IUpdateProfileRequest + * @constructor + * @param {google.devtools.cloudprofiler.v2.IUpdateProfileRequest=} [properties] Properties to set + */ + function UpdateProfileRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * UpdateProfileRequest profile. + * @member {google.devtools.cloudprofiler.v2.IProfile|null|undefined} profile + * @memberof google.devtools.cloudprofiler.v2.UpdateProfileRequest + * @instance + */ + UpdateProfileRequest.prototype.profile = null; + + /** + * UpdateProfileRequest updateMask. + * @member {google.protobuf.IFieldMask|null|undefined} updateMask + * @memberof google.devtools.cloudprofiler.v2.UpdateProfileRequest + * @instance + */ + UpdateProfileRequest.prototype.updateMask = null; + + /** + * Creates a new UpdateProfileRequest instance using the specified properties. + * @function create + * @memberof google.devtools.cloudprofiler.v2.UpdateProfileRequest + * @static + * @param {google.devtools.cloudprofiler.v2.IUpdateProfileRequest=} [properties] Properties to set + * @returns {google.devtools.cloudprofiler.v2.UpdateProfileRequest} UpdateProfileRequest instance + */ + UpdateProfileRequest.create = function create(properties) { + return new UpdateProfileRequest(properties); + }; + + /** + * Encodes the specified UpdateProfileRequest message. Does not implicitly {@link google.devtools.cloudprofiler.v2.UpdateProfileRequest.verify|verify} messages. + * @function encode + * @memberof google.devtools.cloudprofiler.v2.UpdateProfileRequest + * @static + * @param {google.devtools.cloudprofiler.v2.IUpdateProfileRequest} message UpdateProfileRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateProfileRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.profile != null && Object.hasOwnProperty.call(message, "profile")) + $root.google.devtools.cloudprofiler.v2.Profile.encode(message.profile, 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 UpdateProfileRequest message, length delimited. Does not implicitly {@link google.devtools.cloudprofiler.v2.UpdateProfileRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.devtools.cloudprofiler.v2.UpdateProfileRequest + * @static + * @param {google.devtools.cloudprofiler.v2.IUpdateProfileRequest} message UpdateProfileRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateProfileRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an UpdateProfileRequest message from the specified reader or buffer. + * @function decode + * @memberof google.devtools.cloudprofiler.v2.UpdateProfileRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.devtools.cloudprofiler.v2.UpdateProfileRequest} UpdateProfileRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateProfileRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.devtools.cloudprofiler.v2.UpdateProfileRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.profile = $root.google.devtools.cloudprofiler.v2.Profile.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 UpdateProfileRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.devtools.cloudprofiler.v2.UpdateProfileRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.devtools.cloudprofiler.v2.UpdateProfileRequest} UpdateProfileRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateProfileRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an UpdateProfileRequest message. + * @function verify + * @memberof google.devtools.cloudprofiler.v2.UpdateProfileRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + UpdateProfileRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.profile != null && message.hasOwnProperty("profile")) { + var error = $root.google.devtools.cloudprofiler.v2.Profile.verify(message.profile); + if (error) + return "profile." + 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 UpdateProfileRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.devtools.cloudprofiler.v2.UpdateProfileRequest + * @static + * @param {Object.} object Plain object + * @returns {google.devtools.cloudprofiler.v2.UpdateProfileRequest} UpdateProfileRequest + */ + UpdateProfileRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.devtools.cloudprofiler.v2.UpdateProfileRequest) + return object; + var message = new $root.google.devtools.cloudprofiler.v2.UpdateProfileRequest(); + if (object.profile != null) { + if (typeof object.profile !== "object") + throw TypeError(".google.devtools.cloudprofiler.v2.UpdateProfileRequest.profile: object expected"); + message.profile = $root.google.devtools.cloudprofiler.v2.Profile.fromObject(object.profile); + } + if (object.updateMask != null) { + if (typeof object.updateMask !== "object") + throw TypeError(".google.devtools.cloudprofiler.v2.UpdateProfileRequest.updateMask: object expected"); + message.updateMask = $root.google.protobuf.FieldMask.fromObject(object.updateMask); + } + return message; + }; + + /** + * Creates a plain object from an UpdateProfileRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.devtools.cloudprofiler.v2.UpdateProfileRequest + * @static + * @param {google.devtools.cloudprofiler.v2.UpdateProfileRequest} message UpdateProfileRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + UpdateProfileRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.profile = null; + object.updateMask = null; + } + if (message.profile != null && message.hasOwnProperty("profile")) + object.profile = $root.google.devtools.cloudprofiler.v2.Profile.toObject(message.profile, options); + if (message.updateMask != null && message.hasOwnProperty("updateMask")) + object.updateMask = $root.google.protobuf.FieldMask.toObject(message.updateMask, options); + return object; + }; + + /** + * Converts this UpdateProfileRequest to JSON. + * @function toJSON + * @memberof google.devtools.cloudprofiler.v2.UpdateProfileRequest + * @instance + * @returns {Object.} JSON object + */ + UpdateProfileRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for UpdateProfileRequest + * @function getTypeUrl + * @memberof google.devtools.cloudprofiler.v2.UpdateProfileRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + UpdateProfileRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.devtools.cloudprofiler.v2.UpdateProfileRequest"; + }; + + return UpdateProfileRequest; + })(); + + v2.Profile = (function() { + + /** + * Properties of a Profile. + * @memberof google.devtools.cloudprofiler.v2 + * @interface IProfile + * @property {string|null} [name] Profile name + * @property {google.devtools.cloudprofiler.v2.ProfileType|null} [profileType] Profile profileType + * @property {google.devtools.cloudprofiler.v2.IDeployment|null} [deployment] Profile deployment + * @property {google.protobuf.IDuration|null} [duration] Profile duration + * @property {Uint8Array|null} [profileBytes] Profile profileBytes + * @property {Object.|null} [labels] Profile labels + */ + + /** + * Constructs a new Profile. + * @memberof google.devtools.cloudprofiler.v2 + * @classdesc Represents a Profile. + * @implements IProfile + * @constructor + * @param {google.devtools.cloudprofiler.v2.IProfile=} [properties] Properties to set + */ + function Profile(properties) { + this.labels = {}; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Profile name. + * @member {string} name + * @memberof google.devtools.cloudprofiler.v2.Profile + * @instance + */ + Profile.prototype.name = ""; + + /** + * Profile profileType. + * @member {google.devtools.cloudprofiler.v2.ProfileType} profileType + * @memberof google.devtools.cloudprofiler.v2.Profile + * @instance + */ + Profile.prototype.profileType = 0; + + /** + * Profile deployment. + * @member {google.devtools.cloudprofiler.v2.IDeployment|null|undefined} deployment + * @memberof google.devtools.cloudprofiler.v2.Profile + * @instance + */ + Profile.prototype.deployment = null; + + /** + * Profile duration. + * @member {google.protobuf.IDuration|null|undefined} duration + * @memberof google.devtools.cloudprofiler.v2.Profile + * @instance + */ + Profile.prototype.duration = null; + + /** + * Profile profileBytes. + * @member {Uint8Array} profileBytes + * @memberof google.devtools.cloudprofiler.v2.Profile + * @instance + */ + Profile.prototype.profileBytes = $util.newBuffer([]); + + /** + * Profile labels. + * @member {Object.} labels + * @memberof google.devtools.cloudprofiler.v2.Profile + * @instance + */ + Profile.prototype.labels = $util.emptyObject; + + /** + * Creates a new Profile instance using the specified properties. + * @function create + * @memberof google.devtools.cloudprofiler.v2.Profile + * @static + * @param {google.devtools.cloudprofiler.v2.IProfile=} [properties] Properties to set + * @returns {google.devtools.cloudprofiler.v2.Profile} Profile instance + */ + Profile.create = function create(properties) { + return new Profile(properties); + }; + + /** + * Encodes the specified Profile message. Does not implicitly {@link google.devtools.cloudprofiler.v2.Profile.verify|verify} messages. + * @function encode + * @memberof google.devtools.cloudprofiler.v2.Profile + * @static + * @param {google.devtools.cloudprofiler.v2.IProfile} message Profile message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Profile.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.profileType != null && Object.hasOwnProperty.call(message, "profileType")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.profileType); + if (message.deployment != null && Object.hasOwnProperty.call(message, "deployment")) + $root.google.devtools.cloudprofiler.v2.Deployment.encode(message.deployment, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.duration != null && Object.hasOwnProperty.call(message, "duration")) + $root.google.protobuf.Duration.encode(message.duration, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.profileBytes != null && Object.hasOwnProperty.call(message, "profileBytes")) + writer.uint32(/* id 5, wireType 2 =*/42).bytes(message.profileBytes); + if (message.labels != null && Object.hasOwnProperty.call(message, "labels")) + for (var keys = Object.keys(message.labels), i = 0; i < keys.length; ++i) + writer.uint32(/* id 6, wireType 2 =*/50).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.labels[keys[i]]).ldelim(); + return writer; + }; + + /** + * Encodes the specified Profile message, length delimited. Does not implicitly {@link google.devtools.cloudprofiler.v2.Profile.verify|verify} messages. + * @function encodeDelimited + * @memberof google.devtools.cloudprofiler.v2.Profile + * @static + * @param {google.devtools.cloudprofiler.v2.IProfile} message Profile message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Profile.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Profile message from the specified reader or buffer. + * @function decode + * @memberof google.devtools.cloudprofiler.v2.Profile + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.devtools.cloudprofiler.v2.Profile} Profile + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Profile.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.devtools.cloudprofiler.v2.Profile(), key, value; + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.profileType = reader.int32(); + break; + } + case 3: { + message.deployment = $root.google.devtools.cloudprofiler.v2.Deployment.decode(reader, reader.uint32()); + break; + } + case 4: { + message.duration = $root.google.protobuf.Duration.decode(reader, reader.uint32()); + break; + } + case 5: { + message.profileBytes = reader.bytes(); + break; + } + case 6: { + if (message.labels === $util.emptyObject) + message.labels = {}; + 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.labels[key] = value; + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Profile message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.devtools.cloudprofiler.v2.Profile + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.devtools.cloudprofiler.v2.Profile} Profile + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Profile.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Profile message. + * @function verify + * @memberof google.devtools.cloudprofiler.v2.Profile + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Profile.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.profileType != null && message.hasOwnProperty("profileType")) + switch (message.profileType) { + default: + return "profileType: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + case 5: + case 6: + case 7: + break; + } + if (message.deployment != null && message.hasOwnProperty("deployment")) { + var error = $root.google.devtools.cloudprofiler.v2.Deployment.verify(message.deployment); + if (error) + return "deployment." + error; + } + if (message.duration != null && message.hasOwnProperty("duration")) { + var error = $root.google.protobuf.Duration.verify(message.duration); + if (error) + return "duration." + error; + } + if (message.profileBytes != null && message.hasOwnProperty("profileBytes")) + if (!(message.profileBytes && typeof message.profileBytes.length === "number" || $util.isString(message.profileBytes))) + return "profileBytes: buffer expected"; + if (message.labels != null && message.hasOwnProperty("labels")) { + if (!$util.isObject(message.labels)) + return "labels: object expected"; + var key = Object.keys(message.labels); + for (var i = 0; i < key.length; ++i) + if (!$util.isString(message.labels[key[i]])) + return "labels: string{k:string} expected"; + } + return null; + }; + + /** + * Creates a Profile message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.devtools.cloudprofiler.v2.Profile + * @static + * @param {Object.} object Plain object + * @returns {google.devtools.cloudprofiler.v2.Profile} Profile + */ + Profile.fromObject = function fromObject(object) { + if (object instanceof $root.google.devtools.cloudprofiler.v2.Profile) + return object; + var message = new $root.google.devtools.cloudprofiler.v2.Profile(); + if (object.name != null) + message.name = String(object.name); + switch (object.profileType) { + default: + if (typeof object.profileType === "number") { + message.profileType = object.profileType; + break; + } + break; + case "PROFILE_TYPE_UNSPECIFIED": + case 0: + message.profileType = 0; + break; + case "CPU": + case 1: + message.profileType = 1; + break; + case "WALL": + case 2: + message.profileType = 2; + break; + case "HEAP": + case 3: + message.profileType = 3; + break; + case "THREADS": + case 4: + message.profileType = 4; + break; + case "CONTENTION": + case 5: + message.profileType = 5; + break; + case "PEAK_HEAP": + case 6: + message.profileType = 6; + break; + case "HEAP_ALLOC": + case 7: + message.profileType = 7; + break; + } + if (object.deployment != null) { + if (typeof object.deployment !== "object") + throw TypeError(".google.devtools.cloudprofiler.v2.Profile.deployment: object expected"); + message.deployment = $root.google.devtools.cloudprofiler.v2.Deployment.fromObject(object.deployment); + } + if (object.duration != null) { + if (typeof object.duration !== "object") + throw TypeError(".google.devtools.cloudprofiler.v2.Profile.duration: object expected"); + message.duration = $root.google.protobuf.Duration.fromObject(object.duration); + } + if (object.profileBytes != null) + if (typeof object.profileBytes === "string") + $util.base64.decode(object.profileBytes, message.profileBytes = $util.newBuffer($util.base64.length(object.profileBytes)), 0); + else if (object.profileBytes.length >= 0) + message.profileBytes = object.profileBytes; + if (object.labels) { + if (typeof object.labels !== "object") + throw TypeError(".google.devtools.cloudprofiler.v2.Profile.labels: object expected"); + message.labels = {}; + for (var keys = Object.keys(object.labels), i = 0; i < keys.length; ++i) + message.labels[keys[i]] = String(object.labels[keys[i]]); + } + return message; + }; + + /** + * Creates a plain object from a Profile message. Also converts values to other types if specified. + * @function toObject + * @memberof google.devtools.cloudprofiler.v2.Profile + * @static + * @param {google.devtools.cloudprofiler.v2.Profile} message Profile + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Profile.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.objects || options.defaults) + object.labels = {}; + if (options.defaults) { + object.name = ""; + object.profileType = options.enums === String ? "PROFILE_TYPE_UNSPECIFIED" : 0; + object.deployment = null; + object.duration = null; + if (options.bytes === String) + object.profileBytes = ""; + else { + object.profileBytes = []; + if (options.bytes !== Array) + object.profileBytes = $util.newBuffer(object.profileBytes); + } + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.profileType != null && message.hasOwnProperty("profileType")) + object.profileType = options.enums === String ? $root.google.devtools.cloudprofiler.v2.ProfileType[message.profileType] === undefined ? message.profileType : $root.google.devtools.cloudprofiler.v2.ProfileType[message.profileType] : message.profileType; + if (message.deployment != null && message.hasOwnProperty("deployment")) + object.deployment = $root.google.devtools.cloudprofiler.v2.Deployment.toObject(message.deployment, options); + if (message.duration != null && message.hasOwnProperty("duration")) + object.duration = $root.google.protobuf.Duration.toObject(message.duration, options); + if (message.profileBytes != null && message.hasOwnProperty("profileBytes")) + object.profileBytes = options.bytes === String ? $util.base64.encode(message.profileBytes, 0, message.profileBytes.length) : options.bytes === Array ? Array.prototype.slice.call(message.profileBytes) : message.profileBytes; + var keys2; + if (message.labels && (keys2 = Object.keys(message.labels)).length) { + object.labels = {}; + for (var j = 0; j < keys2.length; ++j) + object.labels[keys2[j]] = message.labels[keys2[j]]; + } + return object; + }; + + /** + * Converts this Profile to JSON. + * @function toJSON + * @memberof google.devtools.cloudprofiler.v2.Profile + * @instance + * @returns {Object.} JSON object + */ + Profile.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Profile + * @function getTypeUrl + * @memberof google.devtools.cloudprofiler.v2.Profile + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Profile.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.devtools.cloudprofiler.v2.Profile"; + }; + + return Profile; + })(); + + v2.Deployment = (function() { + + /** + * Properties of a Deployment. + * @memberof google.devtools.cloudprofiler.v2 + * @interface IDeployment + * @property {string|null} [projectId] Deployment projectId + * @property {string|null} [target] Deployment target + * @property {Object.|null} [labels] Deployment labels + */ + + /** + * Constructs a new Deployment. + * @memberof google.devtools.cloudprofiler.v2 + * @classdesc Represents a Deployment. + * @implements IDeployment + * @constructor + * @param {google.devtools.cloudprofiler.v2.IDeployment=} [properties] Properties to set + */ + function Deployment(properties) { + this.labels = {}; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Deployment projectId. + * @member {string} projectId + * @memberof google.devtools.cloudprofiler.v2.Deployment + * @instance + */ + Deployment.prototype.projectId = ""; + + /** + * Deployment target. + * @member {string} target + * @memberof google.devtools.cloudprofiler.v2.Deployment + * @instance + */ + Deployment.prototype.target = ""; + + /** + * Deployment labels. + * @member {Object.} labels + * @memberof google.devtools.cloudprofiler.v2.Deployment + * @instance + */ + Deployment.prototype.labels = $util.emptyObject; + + /** + * Creates a new Deployment instance using the specified properties. + * @function create + * @memberof google.devtools.cloudprofiler.v2.Deployment + * @static + * @param {google.devtools.cloudprofiler.v2.IDeployment=} [properties] Properties to set + * @returns {google.devtools.cloudprofiler.v2.Deployment} Deployment instance + */ + Deployment.create = function create(properties) { + return new Deployment(properties); + }; + + /** + * Encodes the specified Deployment message. Does not implicitly {@link google.devtools.cloudprofiler.v2.Deployment.verify|verify} messages. + * @function encode + * @memberof google.devtools.cloudprofiler.v2.Deployment + * @static + * @param {google.devtools.cloudprofiler.v2.IDeployment} message Deployment message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Deployment.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.projectId != null && Object.hasOwnProperty.call(message, "projectId")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.projectId); + if (message.target != null && Object.hasOwnProperty.call(message, "target")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.target); + if (message.labels != null && Object.hasOwnProperty.call(message, "labels")) + for (var keys = Object.keys(message.labels), 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.labels[keys[i]]).ldelim(); + return writer; + }; + + /** + * Encodes the specified Deployment message, length delimited. Does not implicitly {@link google.devtools.cloudprofiler.v2.Deployment.verify|verify} messages. + * @function encodeDelimited + * @memberof google.devtools.cloudprofiler.v2.Deployment + * @static + * @param {google.devtools.cloudprofiler.v2.IDeployment} message Deployment message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Deployment.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Deployment message from the specified reader or buffer. + * @function decode + * @memberof google.devtools.cloudprofiler.v2.Deployment + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.devtools.cloudprofiler.v2.Deployment} Deployment + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Deployment.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.devtools.cloudprofiler.v2.Deployment(), key, value; + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.projectId = reader.string(); + break; + } + case 2: { + message.target = reader.string(); + break; + } + case 3: { + if (message.labels === $util.emptyObject) + message.labels = {}; + 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.labels[key] = value; + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Deployment message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.devtools.cloudprofiler.v2.Deployment + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.devtools.cloudprofiler.v2.Deployment} Deployment + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Deployment.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Deployment message. + * @function verify + * @memberof google.devtools.cloudprofiler.v2.Deployment + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Deployment.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.projectId != null && message.hasOwnProperty("projectId")) + if (!$util.isString(message.projectId)) + return "projectId: string expected"; + if (message.target != null && message.hasOwnProperty("target")) + if (!$util.isString(message.target)) + return "target: string expected"; + if (message.labels != null && message.hasOwnProperty("labels")) { + if (!$util.isObject(message.labels)) + return "labels: object expected"; + var key = Object.keys(message.labels); + for (var i = 0; i < key.length; ++i) + if (!$util.isString(message.labels[key[i]])) + return "labels: string{k:string} expected"; + } + return null; + }; + + /** + * Creates a Deployment message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.devtools.cloudprofiler.v2.Deployment + * @static + * @param {Object.} object Plain object + * @returns {google.devtools.cloudprofiler.v2.Deployment} Deployment + */ + Deployment.fromObject = function fromObject(object) { + if (object instanceof $root.google.devtools.cloudprofiler.v2.Deployment) + return object; + var message = new $root.google.devtools.cloudprofiler.v2.Deployment(); + if (object.projectId != null) + message.projectId = String(object.projectId); + if (object.target != null) + message.target = String(object.target); + if (object.labels) { + if (typeof object.labels !== "object") + throw TypeError(".google.devtools.cloudprofiler.v2.Deployment.labels: object expected"); + message.labels = {}; + for (var keys = Object.keys(object.labels), i = 0; i < keys.length; ++i) + message.labels[keys[i]] = String(object.labels[keys[i]]); + } + return message; + }; + + /** + * Creates a plain object from a Deployment message. Also converts values to other types if specified. + * @function toObject + * @memberof google.devtools.cloudprofiler.v2.Deployment + * @static + * @param {google.devtools.cloudprofiler.v2.Deployment} message Deployment + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Deployment.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.objects || options.defaults) + object.labels = {}; + if (options.defaults) { + object.projectId = ""; + object.target = ""; + } + if (message.projectId != null && message.hasOwnProperty("projectId")) + object.projectId = message.projectId; + if (message.target != null && message.hasOwnProperty("target")) + object.target = message.target; + var keys2; + if (message.labels && (keys2 = Object.keys(message.labels)).length) { + object.labels = {}; + for (var j = 0; j < keys2.length; ++j) + object.labels[keys2[j]] = message.labels[keys2[j]]; + } + return object; + }; + + /** + * Converts this Deployment to JSON. + * @function toJSON + * @memberof google.devtools.cloudprofiler.v2.Deployment + * @instance + * @returns {Object.} JSON object + */ + Deployment.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Deployment + * @function getTypeUrl + * @memberof google.devtools.cloudprofiler.v2.Deployment + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Deployment.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.devtools.cloudprofiler.v2.Deployment"; + }; + + return Deployment; + })(); + + /** + * ProfileType enum. + * @name google.devtools.cloudprofiler.v2.ProfileType + * @enum {number} + * @property {number} PROFILE_TYPE_UNSPECIFIED=0 PROFILE_TYPE_UNSPECIFIED value + * @property {number} CPU=1 CPU value + * @property {number} WALL=2 WALL value + * @property {number} HEAP=3 HEAP value + * @property {number} THREADS=4 THREADS value + * @property {number} CONTENTION=5 CONTENTION value + * @property {number} PEAK_HEAP=6 PEAK_HEAP value + * @property {number} HEAP_ALLOC=7 HEAP_ALLOC value + */ + v2.ProfileType = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "PROFILE_TYPE_UNSPECIFIED"] = 0; + values[valuesById[1] = "CPU"] = 1; + values[valuesById[2] = "WALL"] = 2; + values[valuesById[3] = "HEAP"] = 3; + values[valuesById[4] = "THREADS"] = 4; + values[valuesById[5] = "CONTENTION"] = 5; + values[valuesById[6] = "PEAK_HEAP"] = 6; + values[valuesById[7] = "HEAP_ALLOC"] = 7; + return values; + })(); + + return v2; + })(); + + return cloudprofiler; + })(); + + return devtools; + })(); + + 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) { + 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(); + 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) { + 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(); + 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) { + 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(); + 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) { + 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(); + 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) { + 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(); + 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 + */ + + /** + * 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; + + /** + * 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(); + 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) { + 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(); + 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; + } + 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: + 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; + } + } + 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; + } + 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]); + } + } + 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; + } + 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); + } + 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) { + 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(); + 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) { + 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(); + 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) { + 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(); + 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) { + 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(); + 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) { + 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(); + 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 + */ + + /** + * 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) { + if (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; + + /** + * 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(); + 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) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.DotnetSettings(); + while (reader.pos < end) { + var tag = reader.uint32(); + 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 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; + } + 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); + } + 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.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 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) { + 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(); + 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) { + 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(); + 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 + */ + + /** + * 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) { + if (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; + + /** + * 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(); + 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) { + 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(); + switch (tag >>> 3) { + case 1: { + message.selector = reader.string(); + break; + } + case 2: { + message.longRunning = $root.google.api.MethodSettings.LongRunning.decode(reader, reader.uint32()); + 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; + } + 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); + } + 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.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); + 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) { + 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(); + 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 + */ + 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; + 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 + */ + 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; + 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) { + 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(); + 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) { + 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(); + 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) { + 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(); + 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; + })(); + + 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 {string|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 {string} edition + * @memberof google.protobuf.FileDescriptorProto + * @instance + */ + FileDescriptorProto.prototype.edition = ""; + + /** + * 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 13, wireType 2 =*/106).string(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) { + 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(); + 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 13: { + message.edition = reader.string(); + 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")) + if (!$util.isString(message.edition)) + return "edition: string expected"; + 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); + if (object.edition != null) + message.edition = String(object.edition); + 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 = ""; + } + 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 = 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) { + 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(); + 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) { + 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(); + 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) { + 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(); + 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 + */ + + /** + * 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 = []; + if (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; + + /** + * 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.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) { + 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(); + 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; + } + 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; + } + } + 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]); + } + } + 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.uninterpretedOption = []; + 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"; + }; + + 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) { + 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(); + 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 2: + case 3: + 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_REQUIRED": + case 2: + message.label = 2; + break; + case "LABEL_REPEATED": + case 3: + message.label = 3; + 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_REQUIRED=2 LABEL_REQUIRED value + * @property {number} LABEL_REPEATED=3 LABEL_REPEATED value + */ + FieldDescriptorProto.Label = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[1] = "LABEL_OPTIONAL"] = 1; + values[valuesById[2] = "LABEL_REQUIRED"] = 2; + values[valuesById[3] = "LABEL_REPEATED"] = 3; + 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) { + 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(); + 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) { + 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(); + 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) { + 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(); + 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) { + 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(); + 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) { + 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(); + 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) { + 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(); + 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} [phpGenericServices] FileOptions phpGenericServices + * @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 {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 phpGenericServices. + * @member {boolean} phpGenericServices + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.phpGenericServices = 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 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.phpGenericServices != null && Object.hasOwnProperty.call(message, "phpGenericServices")) + writer.uint32(/* id 42, wireType 0 =*/336).bool(message.phpGenericServices); + 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.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) { + 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(); + 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 42: { + message.phpGenericServices = 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 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.phpGenericServices != null && message.hasOwnProperty("phpGenericServices")) + if (typeof message.phpGenericServices !== "boolean") + return "phpGenericServices: 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.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.phpGenericServices != null) + message.phpGenericServices = Boolean(object.phpGenericServices); + 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.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.phpGenericServices = false; + object.phpMetadataNamespace = ""; + object.rubyPackage = ""; + } + 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.phpGenericServices != null && message.hasOwnProperty("phpGenericServices")) + object.phpGenericServices = message.phpGenericServices; + if (message.phpMetadataNamespace != null && message.hasOwnProperty("phpMetadataNamespace")) + object.phpMetadataNamespace = message.phpMetadataNamespace; + if (message.rubyPackage != null && message.hasOwnProperty("rubyPackage")) + object.rubyPackage = message.rubyPackage; + 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 {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 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.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) { + 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(); + 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 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.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.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[".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.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 {google.protobuf.FieldOptions.OptionTargetType|null} [target] FieldOptions target + * @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.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 target. + * @member {google.protobuf.FieldOptions.OptionTargetType} target + * @memberof google.protobuf.FieldOptions + * @instance + */ + FieldOptions.prototype.target = 0; + + /** + * 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.target != null && Object.hasOwnProperty.call(message, "target")) + writer.uint32(/* id 18, wireType 0 =*/144).int32(message.target); + 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) { + writer.uint32(/* id 1052, wireType 2 =*/8418).fork(); + for (var i = 0; i < message[".google.api.fieldBehavior"].length; ++i) + writer.int32(message[".google.api.fieldBehavior"][i]); + writer.ldelim(); + } + 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) { + 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(); + 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 18: { + message.target = reader.int32(); + 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.target != null && message.hasOwnProperty("target")) + switch (message.target) { + default: + return "target: 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.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: + 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; + } + switch (object.target) { + default: + if (typeof object.target === "number") { + message.target = object.target; + break; + } + break; + case "TARGET_TYPE_UNKNOWN": + case 0: + message.target = 0; + break; + case "TARGET_TYPE_FILE": + case 1: + message.target = 1; + break; + case "TARGET_TYPE_EXTENSION_RANGE": + case 2: + message.target = 2; + break; + case "TARGET_TYPE_MESSAGE": + case 3: + message.target = 3; + break; + case "TARGET_TYPE_FIELD": + case 4: + message.target = 4; + break; + case "TARGET_TYPE_ONEOF": + case 5: + message.target = 5; + break; + case "TARGET_TYPE_ENUM": + case 6: + message.target = 6; + break; + case "TARGET_TYPE_ENUM_ENTRY": + case 7: + message.target = 7; + break; + case "TARGET_TYPE_SERVICE": + case 8: + message.target = 8; + break; + case "TARGET_TYPE_METHOD": + case 9: + message.target = 9; + break; + } + 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; + } + } + 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.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.target = options.enums === String ? "TARGET_TYPE_UNKNOWN" : 0; + 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.target != null && message.hasOwnProperty("target")) + object.target = options.enums === String ? $root.google.protobuf.FieldOptions.OptionTargetType[message.target] === undefined ? message.target : $root.google.protobuf.FieldOptions.OptionTargetType[message.target] : message.target; + 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; + })(); + + return FieldOptions; + })(); + + protobuf.OneofOptions = (function() { + + /** + * Properties of an OneofOptions. + * @memberof google.protobuf + * @interface IOneofOptions + * @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 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.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) { + 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(); + 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; + } + 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.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.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 (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 {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 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.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) { + 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(); + 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 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.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.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; + } + 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.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 {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 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.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) { + 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(); + switch (tag >>> 3) { + case 1: { + 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; + } + 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.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.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; + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + object.deprecated = message.deprecated; + 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 {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 + */ + + /** + * 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 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"] = ""; + + /** + * 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.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"]); + 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) { + 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(); + switch (tag >>> 3) { + 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; + } + 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.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"; + 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.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"]); + 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[".google.api.defaultHost"] = ""; + object[".google.api.oauthScopes"] = ""; + } + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + object.deprecated = message.deprecated; + 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"]; + 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 {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 + */ + + /** + * 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 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; + + /** + * 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.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.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) { + 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(); + switch (tag >>> 3) { + case 33: { + message.deprecated = reader.bool(); + break; + } + case 34: { + message.idempotencyLevel = reader.int32(); + 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; + } + 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.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"; + } + 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.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]); + } + 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[".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.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.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) { + 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(); + 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) { + 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(); + 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.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) { + 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(); + 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) { + 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(); + 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) { + 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(); + 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) { + 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(); + 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) { + 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(); + 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.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) { + 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(); + 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; + })(); + + return google; + })(); + + return $root; +}); diff --git a/packages/google-devtools-cloudprofiler/protos/protos.json b/packages/google-devtools-cloudprofiler/protos/protos.json new file mode 100644 index 00000000000..4a2c58ef701 --- /dev/null +++ b/packages/google-devtools-cloudprofiler/protos/protos.json @@ -0,0 +1,1667 @@ +{ + "nested": { + "google": { + "nested": { + "devtools": { + "nested": { + "cloudprofiler": { + "nested": { + "v2": { + "options": { + "csharp_namespace": "Google.Cloud.Profiler.V2", + "go_package": "google.golang.org/genproto/googleapis/devtools/cloudprofiler/v2;cloudprofiler", + "java_multiple_files": true, + "java_outer_classname": "ProfilerProto", + "java_package": "com.google.devtools.cloudprofiler.v2", + "php_namespace": "Google\\Cloud\\Profiler\\V2", + "ruby_package": "Google::Cloud::Profiler::V2" + }, + "nested": { + "ProfilerService": { + "options": { + "(google.api.default_host)": "cloudprofiler.googleapis.com", + "(google.api.oauth_scopes)": "https://www.googleapis.com/auth/cloud-platform,https://www.googleapis.com/auth/monitoring,https://www.googleapis.com/auth/monitoring.write" + }, + "methods": { + "CreateProfile": { + "requestType": "CreateProfileRequest", + "responseType": "Profile", + "options": { + "(google.api.http).post": "/v2/{parent=projects/*}/profiles", + "(google.api.http).body": "*" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v2/{parent=projects/*}/profiles", + "body": "*" + } + } + ] + }, + "CreateOfflineProfile": { + "requestType": "CreateOfflineProfileRequest", + "responseType": "Profile", + "options": { + "(google.api.http).post": "/v2/{parent=projects/*}/profiles:createOffline", + "(google.api.http).body": "profile", + "(google.api.method_signature)": "parent,profile" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v2/{parent=projects/*}/profiles:createOffline", + "body": "profile" + } + }, + { + "(google.api.method_signature)": "parent,profile" + } + ] + }, + "UpdateProfile": { + "requestType": "UpdateProfileRequest", + "responseType": "Profile", + "options": { + "(google.api.http).patch": "/v2/{profile.name=projects/*/profiles/*}", + "(google.api.http).body": "profile", + "(google.api.method_signature)": "profile,update_mask" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "patch": "/v2/{profile.name=projects/*/profiles/*}", + "body": "profile" + } + }, + { + "(google.api.method_signature)": "profile,update_mask" + } + ] + } + } + }, + "CreateProfileRequest": { + "fields": { + "parent": { + "type": "string", + "id": 4, + "options": { + "(google.api.resource_reference).type": "cloudresourcemanager.googleapis.com/Project" + } + }, + "deployment": { + "type": "Deployment", + "id": 1 + }, + "profileType": { + "rule": "repeated", + "type": "ProfileType", + "id": 2 + } + } + }, + "CreateOfflineProfileRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.resource_reference).type": "cloudresourcemanager.googleapis.com/Project" + } + }, + "profile": { + "type": "Profile", + "id": 2 + } + } + }, + "UpdateProfileRequest": { + "fields": { + "profile": { + "type": "Profile", + "id": 1 + }, + "updateMask": { + "type": "google.protobuf.FieldMask", + "id": 2 + } + } + }, + "Profile": { + "options": { + "(google.api.resource).type": "cloudprofiler.googleapis.com/Profile", + "(google.api.resource).pattern": "projects/{project}/profiles/{profile}" + }, + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "profileType": { + "type": "ProfileType", + "id": 2 + }, + "deployment": { + "type": "Deployment", + "id": 3 + }, + "duration": { + "type": "google.protobuf.Duration", + "id": 4 + }, + "profileBytes": { + "type": "bytes", + "id": 5, + "options": { + "(google.api.field_behavior)": "INPUT_ONLY" + } + }, + "labels": { + "keyType": "string", + "type": "string", + "id": 6, + "options": { + "(google.api.field_behavior)": "INPUT_ONLY" + } + } + } + }, + "Deployment": { + "fields": { + "projectId": { + "type": "string", + "id": 1 + }, + "target": { + "type": "string", + "id": 2 + }, + "labels": { + "keyType": "string", + "type": "string", + "id": 3 + } + } + }, + "ProfileType": { + "values": { + "PROFILE_TYPE_UNSPECIFIED": 0, + "CPU": 1, + "WALL": 2, + "HEAP": 3, + "THREADS": 4, + "CONTENTION": 5, + "PEAK_HEAP": 6, + "HEAP_ALLOC": 7 + } + } + } + } + } + } + } + }, + "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" + }, + "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 + } + } + }, + "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 + } + } + }, + "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 + } + }, + "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 + } + }, + "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" + }, + "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 + } + }, + "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": { + "fields": { + "file": { + "rule": "repeated", + "type": "FileDescriptorProto", + "id": 1 + } + } + }, + "FileDescriptorProto": { + "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, + "options": { + "packed": false + } + }, + "weakDependency": { + "rule": "repeated", + "type": "int32", + "id": 11, + "options": { + "packed": false + } + }, + "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": "string", + "id": 13 + } + } + }, + "DescriptorProto": { + "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": { + "fields": { + "uninterpretedOption": { + "rule": "repeated", + "type": "UninterpretedOption", + "id": 999 + } + }, + "extensions": [ + [ + 1000, + 536870911 + ] + ] + }, + "FieldDescriptorProto": { + "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_REQUIRED": 2, + "LABEL_REPEATED": 3 + } + } + } + }, + "OneofDescriptorProto": { + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "options": { + "type": "OneofOptions", + "id": 2 + } + } + }, + "EnumDescriptorProto": { + "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": { + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "number": { + "type": "int32", + "id": 2 + }, + "options": { + "type": "EnumValueOptions", + "id": 3 + } + } + }, + "ServiceDescriptorProto": { + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "method": { + "rule": "repeated", + "type": "MethodDescriptorProto", + "id": 2 + }, + "options": { + "type": "ServiceOptions", + "id": 3 + } + } + }, + "MethodDescriptorProto": { + "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": { + "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 + } + }, + "phpGenericServices": { + "type": "bool", + "id": 42, + "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 + }, + "uninterpretedOption": { + "rule": "repeated", + "type": "UninterpretedOption", + "id": 999 + } + }, + "extensions": [ + [ + 1000, + 536870911 + ] + ], + "reserved": [ + [ + 38, + 38 + ] + ], + "nested": { + "OptimizeMode": { + "values": { + "SPEED": 1, + "CODE_SIZE": 2, + "LITE_RUNTIME": 3 + } + } + } + }, + "MessageOptions": { + "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 + } + }, + "uninterpretedOption": { + "rule": "repeated", + "type": "UninterpretedOption", + "id": 999 + } + }, + "extensions": [ + [ + 1000, + 536870911 + ] + ], + "reserved": [ + [ + 4, + 4 + ], + [ + 5, + 5 + ], + [ + 6, + 6 + ], + [ + 8, + 8 + ], + [ + 9, + 9 + ] + ] + }, + "FieldOptions": { + "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 + }, + "target": { + "type": "OptionTargetType", + "id": 18 + }, + "uninterpretedOption": { + "rule": "repeated", + "type": "UninterpretedOption", + "id": 999 + } + }, + "extensions": [ + [ + 1000, + 536870911 + ] + ], + "reserved": [ + [ + 4, + 4 + ] + ], + "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 + } + } + } + }, + "OneofOptions": { + "fields": { + "uninterpretedOption": { + "rule": "repeated", + "type": "UninterpretedOption", + "id": 999 + } + }, + "extensions": [ + [ + 1000, + 536870911 + ] + ] + }, + "EnumOptions": { + "fields": { + "allowAlias": { + "type": "bool", + "id": 2 + }, + "deprecated": { + "type": "bool", + "id": 3, + "options": { + "default": false + } + }, + "deprecatedLegacyJsonFieldConflicts": { + "type": "bool", + "id": 6, + "options": { + "deprecated": true + } + }, + "uninterpretedOption": { + "rule": "repeated", + "type": "UninterpretedOption", + "id": 999 + } + }, + "extensions": [ + [ + 1000, + 536870911 + ] + ], + "reserved": [ + [ + 5, + 5 + ] + ] + }, + "EnumValueOptions": { + "fields": { + "deprecated": { + "type": "bool", + "id": 1, + "options": { + "default": false + } + }, + "uninterpretedOption": { + "rule": "repeated", + "type": "UninterpretedOption", + "id": 999 + } + }, + "extensions": [ + [ + 1000, + 536870911 + ] + ] + }, + "ServiceOptions": { + "fields": { + "deprecated": { + "type": "bool", + "id": 33, + "options": { + "default": false + } + }, + "uninterpretedOption": { + "rule": "repeated", + "type": "UninterpretedOption", + "id": 999 + } + }, + "extensions": [ + [ + 1000, + 536870911 + ] + ] + }, + "MethodOptions": { + "fields": { + "deprecated": { + "type": "bool", + "id": 33, + "options": { + "default": false + } + }, + "idempotencyLevel": { + "type": "IdempotencyLevel", + "id": 34, + "options": { + "default": "IDEMPOTENCY_UNKNOWN" + } + }, + "uninterpretedOption": { + "rule": "repeated", + "type": "UninterpretedOption", + "id": 999 + } + }, + "extensions": [ + [ + 1000, + 536870911 + ] + ], + "nested": { + "IdempotencyLevel": { + "values": { + "IDEMPOTENCY_UNKNOWN": 0, + "NO_SIDE_EFFECTS": 1, + "IDEMPOTENT": 2 + } + } + } + }, + "UninterpretedOption": { + "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 + } + } + } + } + }, + "SourceCodeInfo": { + "fields": { + "location": { + "rule": "repeated", + "type": "Location", + "id": 1 + } + }, + "nested": { + "Location": { + "fields": { + "path": { + "rule": "repeated", + "type": "int32", + "id": 1 + }, + "span": { + "rule": "repeated", + "type": "int32", + "id": 2 + }, + "leadingComments": { + "type": "string", + "id": 3 + }, + "trailingComments": { + "type": "string", + "id": 4 + }, + "leadingDetachedComments": { + "rule": "repeated", + "type": "string", + "id": 6 + } + } + } + } + }, + "GeneratedCodeInfo": { + "fields": { + "annotation": { + "rule": "repeated", + "type": "Annotation", + "id": 1 + } + }, + "nested": { + "Annotation": { + "fields": { + "path": { + "rule": "repeated", + "type": "int32", + "id": 1 + }, + "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 + } + } + }, + "FieldMask": { + "fields": { + "paths": { + "rule": "repeated", + "type": "string", + "id": 1 + } + } + } + } + } + } + } + } +} \ No newline at end of file diff --git a/packages/google-devtools-cloudprofiler/samples/README.md b/packages/google-devtools-cloudprofiler/samples/README.md new file mode 100644 index 00000000000..58aa89dc161 --- /dev/null +++ b/packages/google-devtools-cloudprofiler/samples/README.md @@ -0,0 +1,104 @@ +[//]: # "This README.md file is auto-generated, all changes to this file will be lost." +[//]: # "To regenerate it, use `python -m synthtool`." +Google Cloud Platform logo + +# [Cloud Profiler API: Node.js Samples](https://github.com/googleapis/google-cloud-node) + +[![Open in Cloud Shell][shell_img]][shell_link] + + + +## Table of Contents + +* [Before you begin](#before-you-begin) +* [Samples](#samples) + * [Profiler_service.create_offline_profile](#profiler_service.create_offline_profile) + * [Profiler_service.create_profile](#profiler_service.create_profile) + * [Profiler_service.update_profile](#profiler_service.update_profile) + * [Quickstart](#quickstart) + +## Before you begin + +Before running the samples, make sure you've followed the steps outlined in +[Using the client library](https://github.com/googleapis/google-cloud-node#using-the-client-library). + +`cd samples` + +`npm install` + +`cd ..` + +## Samples + + + +### Profiler_service.create_offline_profile + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-devtools-cloudprofiler/samples/generated/v2/profiler_service.create_offline_profile.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-devtools-cloudprofiler/samples/generated/v2/profiler_service.create_offline_profile.js,samples/README.md) + +__Usage:__ + + +`node packages/google-devtools-cloudprofiler/samples/generated/v2/profiler_service.create_offline_profile.js` + + +----- + + + + +### Profiler_service.create_profile + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-devtools-cloudprofiler/samples/generated/v2/profiler_service.create_profile.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-devtools-cloudprofiler/samples/generated/v2/profiler_service.create_profile.js,samples/README.md) + +__Usage:__ + + +`node packages/google-devtools-cloudprofiler/samples/generated/v2/profiler_service.create_profile.js` + + +----- + + + + +### Profiler_service.update_profile + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-devtools-cloudprofiler/samples/generated/v2/profiler_service.update_profile.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-devtools-cloudprofiler/samples/generated/v2/profiler_service.update_profile.js,samples/README.md) + +__Usage:__ + + +`node packages/google-devtools-cloudprofiler/samples/generated/v2/profiler_service.update_profile.js` + + +----- + + + + +### Quickstart + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-devtools-cloudprofiler/samples/quickstart.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-devtools-cloudprofiler/samples/quickstart.js,samples/README.md) + +__Usage:__ + + +`node packages/google-devtools-cloudprofiler/samples/quickstart.js` + + + + + + +[shell_img]: https://gstatic.com/cloudssh/images/open-btn.png +[shell_link]: https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=samples/README.md +[product-docs]: cloud.google.com/profiler/ diff --git a/packages/google-devtools-cloudprofiler/samples/generated/v2/profiler_service.create_offline_profile.js b/packages/google-devtools-cloudprofiler/samples/generated/v2/profiler_service.create_offline_profile.js new file mode 100644 index 00000000000..4d930a0bc27 --- /dev/null +++ b/packages/google-devtools-cloudprofiler/samples/generated/v2/profiler_service.create_offline_profile.js @@ -0,0 +1,64 @@ +// Copyright 2023 Google LLC +// +// Licensed under the Apache License, Version 2.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 cloudprofiler_v2_generated_ProfilerService_CreateOfflineProfile_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. + */ + /** + * Parent project to create the profile in. + */ + // const parent = 'abc123' + /** + * Contents of the profile to create. + */ + // const profile = {} + + // Imports the Cloudprofiler library + const {ProfilerServiceClient} = require('@google-cloud/cloudprofiler').v2; + + // Instantiates a client + const cloudprofilerClient = new ProfilerServiceClient(); + + async function callCreateOfflineProfile() { + // Construct request + const request = { + }; + + // Run request + const response = await cloudprofilerClient.createOfflineProfile(request); + console.log(response); + } + + callCreateOfflineProfile(); + // [END cloudprofiler_v2_generated_ProfilerService_CreateOfflineProfile_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-devtools-cloudprofiler/samples/generated/v2/profiler_service.create_profile.js b/packages/google-devtools-cloudprofiler/samples/generated/v2/profiler_service.create_profile.js new file mode 100644 index 00000000000..93f85bcb19c --- /dev/null +++ b/packages/google-devtools-cloudprofiler/samples/generated/v2/profiler_service.create_profile.js @@ -0,0 +1,68 @@ +// Copyright 2023 Google LLC +// +// Licensed under the Apache License, Version 2.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 cloudprofiler_v2_generated_ProfilerService_CreateProfile_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. + */ + /** + * Parent project to create the profile in. + */ + // const parent = 'abc123' + /** + * Deployment details. + */ + // const deployment = {} + /** + * One or more profile types that the agent is capable of providing. + */ + // const profileType = [1,2,3,4] + + // Imports the Cloudprofiler library + const {ProfilerServiceClient} = require('@google-cloud/cloudprofiler').v2; + + // Instantiates a client + const cloudprofilerClient = new ProfilerServiceClient(); + + async function callCreateProfile() { + // Construct request + const request = { + }; + + // Run request + const response = await cloudprofilerClient.createProfile(request); + console.log(response); + } + + callCreateProfile(); + // [END cloudprofiler_v2_generated_ProfilerService_CreateProfile_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-devtools-cloudprofiler/samples/generated/v2/profiler_service.update_profile.js b/packages/google-devtools-cloudprofiler/samples/generated/v2/profiler_service.update_profile.js new file mode 100644 index 00000000000..cb84e62d01e --- /dev/null +++ b/packages/google-devtools-cloudprofiler/samples/generated/v2/profiler_service.update_profile.js @@ -0,0 +1,67 @@ +// Copyright 2023 Google LLC +// +// Licensed under the Apache License, Version 2.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 cloudprofiler_v2_generated_ProfilerService_UpdateProfile_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. + */ + /** + * Profile to update. + */ + // const profile = {} + /** + * Field mask used to specify the fields to be overwritten. Currently only + * profile_bytes and labels fields are supported by UpdateProfile, so only + * those fields can be specified in the mask. When no mask is provided, all + * fields are overwritten. + */ + // const updateMask = {} + + // Imports the Cloudprofiler library + const {ProfilerServiceClient} = require('@google-cloud/cloudprofiler').v2; + + // Instantiates a client + const cloudprofilerClient = new ProfilerServiceClient(); + + async function callUpdateProfile() { + // Construct request + const request = { + }; + + // Run request + const response = await cloudprofilerClient.updateProfile(request); + console.log(response); + } + + callUpdateProfile(); + // [END cloudprofiler_v2_generated_ProfilerService_UpdateProfile_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-devtools-cloudprofiler/samples/generated/v2/snippet_metadata_google.devtools.cloudprofiler.v2.json b/packages/google-devtools-cloudprofiler/samples/generated/v2/snippet_metadata_google.devtools.cloudprofiler.v2.json new file mode 100644 index 00000000000..56d4a204eb5 --- /dev/null +++ b/packages/google-devtools-cloudprofiler/samples/generated/v2/snippet_metadata_google.devtools.cloudprofiler.v2.json @@ -0,0 +1,151 @@ +{ + "clientLibrary": { + "name": "nodejs-cloudprofiler", + "version": "0.1.0", + "language": "TYPESCRIPT", + "apis": [ + { + "id": "google.devtools.cloudprofiler.v2", + "version": "v2" + } + ] + }, + "snippets": [ + { + "regionTag": "cloudprofiler_v2_generated_ProfilerService_CreateProfile_async", + "title": "ProfilerService createProfile Sample", + "origin": "API_DEFINITION", + "description": " CreateProfile creates a new profile resource in the online mode. The server ensures that the new profiles are created at a constant rate per deployment, so the creation request may hang for some time until the next profile session is available. The request may fail with ABORTED error if the creation is not available within ~1m, the response will indicate the duration of the backoff the client should take before attempting creating a profile again. The backoff duration is returned in google.rpc.RetryInfo extension on the response status. To a gRPC client, the extension will be return as a binary-serialized proto in the trailing metadata item named \"google.rpc.retryinfo-bin\".", + "canonical": true, + "file": "profiler_service.create_profile.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 60, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "CreateProfile", + "fullName": "google.devtools.cloudprofiler.v2.ProfilerService.CreateProfile", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "deployment", + "type": ".google.devtools.cloudprofiler.v2.Deployment" + }, + { + "name": "profile_type", + "type": "TYPE_ENUM[]" + } + ], + "resultType": ".google.devtools.cloudprofiler.v2.Profile", + "client": { + "shortName": "ProfilerServiceClient", + "fullName": "google.devtools.cloudprofiler.v2.ProfilerServiceClient" + }, + "method": { + "shortName": "CreateProfile", + "fullName": "google.devtools.cloudprofiler.v2.ProfilerService.CreateProfile", + "service": { + "shortName": "ProfilerService", + "fullName": "google.devtools.cloudprofiler.v2.ProfilerService" + } + } + } + }, + { + "regionTag": "cloudprofiler_v2_generated_ProfilerService_CreateOfflineProfile_async", + "title": "ProfilerService createOfflineProfile Sample", + "origin": "API_DEFINITION", + "description": " CreateOfflineProfile creates a new profile resource in the offline mode. The client provides the profile to create along with the profile bytes, the server records it.", + "canonical": true, + "file": "profiler_service.create_offline_profile.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 56, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "CreateOfflineProfile", + "fullName": "google.devtools.cloudprofiler.v2.ProfilerService.CreateOfflineProfile", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "profile", + "type": ".google.devtools.cloudprofiler.v2.Profile" + } + ], + "resultType": ".google.devtools.cloudprofiler.v2.Profile", + "client": { + "shortName": "ProfilerServiceClient", + "fullName": "google.devtools.cloudprofiler.v2.ProfilerServiceClient" + }, + "method": { + "shortName": "CreateOfflineProfile", + "fullName": "google.devtools.cloudprofiler.v2.ProfilerService.CreateOfflineProfile", + "service": { + "shortName": "ProfilerService", + "fullName": "google.devtools.cloudprofiler.v2.ProfilerService" + } + } + } + }, + { + "regionTag": "cloudprofiler_v2_generated_ProfilerService_UpdateProfile_async", + "title": "ProfilerService updateProfile Sample", + "origin": "API_DEFINITION", + "description": " UpdateProfile updates the profile bytes and labels on the profile resource created in the online mode. Updating the bytes for profiles created in the offline mode is currently not supported: the profile content must be provided at the time of the profile creation.", + "canonical": true, + "file": "profiler_service.update_profile.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 59, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "UpdateProfile", + "fullName": "google.devtools.cloudprofiler.v2.ProfilerService.UpdateProfile", + "async": true, + "parameters": [ + { + "name": "profile", + "type": ".google.devtools.cloudprofiler.v2.Profile" + }, + { + "name": "update_mask", + "type": ".google.protobuf.FieldMask" + } + ], + "resultType": ".google.devtools.cloudprofiler.v2.Profile", + "client": { + "shortName": "ProfilerServiceClient", + "fullName": "google.devtools.cloudprofiler.v2.ProfilerServiceClient" + }, + "method": { + "shortName": "UpdateProfile", + "fullName": "google.devtools.cloudprofiler.v2.ProfilerService.UpdateProfile", + "service": { + "shortName": "ProfilerService", + "fullName": "google.devtools.cloudprofiler.v2.ProfilerService" + } + } + } + } + ] +} \ No newline at end of file diff --git a/packages/google-devtools-cloudprofiler/samples/package.json b/packages/google-devtools-cloudprofiler/samples/package.json new file mode 100644 index 00000000000..fe5aae64782 --- /dev/null +++ b/packages/google-devtools-cloudprofiler/samples/package.json @@ -0,0 +1,24 @@ +{ + "name": "cloudprofiler-samples", + "private": true, + "license": "Apache-2.0", + "author": "Google LLC", + "engines": { + "node": ">=14.0.0" + }, + "files": [ + "*.js" + ], + "scripts": { + "test": "c8 mocha --timeout 600000 test/*.js", + "publish": "echo 'sample test; do not publish'" + }, + "dependencies": { + "@google-cloud/cloudprofiler": "^0.1.0" + }, + "devDependencies": { + "c8": "^8.0.0", + "chai": "^4.2.0", + "mocha": "^8.0.0" + } +} diff --git a/packages/google-devtools-cloudprofiler/samples/quickstart.js b/packages/google-devtools-cloudprofiler/samples/quickstart.js new file mode 100644 index 00000000000..f4cfd3af9a3 --- /dev/null +++ b/packages/google-devtools-cloudprofiler/samples/quickstart.js @@ -0,0 +1,69 @@ +// Copyright 2023 Google LLC +// +// Licensed under the Apache License, Version 2.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(project, projectId, target, profileType) { + // [START cloudprofiler_quickstart] + /** + * 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. + */ + /** + * Parent project to create the profile in. + */ + // const parent = 'abc123' + /** + * Deployment details. + */ + // const deployment = {} + /** + * One or more profile types that the agent is capable of providing. + */ + // const profileType = [1,2,3,4] + + // Imports the Cloudprofiler library + const {ProfilerServiceClient} = require('@google-cloud/cloudprofiler').v2; + + // Instantiates a client + const cloudprofilerClient = new ProfilerServiceClient(); + + async function callCreateProfile() { + // Construct request + const request = { + project, + deployment: {projectId, target}, + profileType: [profileType], + }; + + // Run request + const response = await cloudprofilerClient.createProfile(request); + console.log(response); + } + + callCreateProfile(); + // [END cloudprofiler_quickstart] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-devtools-cloudprofiler/samples/test/quickstart.js b/packages/google-devtools-cloudprofiler/samples/test/quickstart.js new file mode 100644 index 00000000000..6edfced4394 --- /dev/null +++ b/packages/google-devtools-cloudprofiler/samples/test/quickstart.js @@ -0,0 +1,45 @@ +// Copyright 2023 Google LLC +// +// Licensed under the Apache License, Version 2.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. + +'use strict'; + +// const assert = require('assert'); +// const path = require('path'); +// const cp = require('child_process'); +const {describe, it, before} = require('mocha'); +// const {ProfilerServiceClient} = require('@google-cloud/cloudprofiler').v2; +// const cloudprofilerClient = new ProfilerServiceClient(); + +// const execSync = cmd => cp.execSync(cmd, {encoding: 'utf-8'}); + +// const cwd = path.join(__dirname, '..'); + +describe('Quickstart', () => { + // let projectId; + + before(async () => { + // projectId = await cloudprofilerClient.getProjectId(); + }); + + it('should run quickstart', async () => { + // This library doesn't contain a list method, which would + // make testing the API least resource-intensive. We're going to + // skip for now. + // const output = execSync( + // `node ./quickstart.js projects/${projectId}/locations/us-central1`, + // {cwd} + // ); + // assert(output !== null); + }); +}); diff --git a/packages/google-devtools-cloudprofiler/src/index.ts b/packages/google-devtools-cloudprofiler/src/index.ts new file mode 100644 index 00000000000..0a7306cf57c --- /dev/null +++ b/packages/google-devtools-cloudprofiler/src/index.ts @@ -0,0 +1,27 @@ +// Copyright 2023 Google LLC +// +// Licensed under the Apache License, Version 2.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. ** + +import * as v2 from './v2'; + +const ProfilerServiceClient = v2.ProfilerServiceClient; +type ProfilerServiceClient = v2.ProfilerServiceClient; + +export {v2, ProfilerServiceClient}; +export default {v2, ProfilerServiceClient}; +import * as protos from '../protos/protos'; +export {protos}; diff --git a/packages/google-devtools-cloudprofiler/src/v2/gapic_metadata.json b/packages/google-devtools-cloudprofiler/src/v2/gapic_metadata.json new file mode 100644 index 00000000000..ff1aaafaa77 --- /dev/null +++ b/packages/google-devtools-cloudprofiler/src/v2/gapic_metadata.json @@ -0,0 +1,53 @@ +{ + "schema": "1.0", + "comment": "This file maps proto services/RPCs to the corresponding library clients/methods", + "language": "typescript", + "protoPackage": "google.devtools.cloudprofiler.v2", + "libraryPackage": "@google-cloud/cloudprofiler", + "services": { + "ProfilerService": { + "clients": { + "grpc": { + "libraryClient": "ProfilerServiceClient", + "rpcs": { + "CreateProfile": { + "methods": [ + "createProfile" + ] + }, + "CreateOfflineProfile": { + "methods": [ + "createOfflineProfile" + ] + }, + "UpdateProfile": { + "methods": [ + "updateProfile" + ] + } + } + }, + "grpc-fallback": { + "libraryClient": "ProfilerServiceClient", + "rpcs": { + "CreateProfile": { + "methods": [ + "createProfile" + ] + }, + "CreateOfflineProfile": { + "methods": [ + "createOfflineProfile" + ] + }, + "UpdateProfile": { + "methods": [ + "updateProfile" + ] + } + } + } + } + } + } +} diff --git a/packages/google-devtools-cloudprofiler/src/v2/index.ts b/packages/google-devtools-cloudprofiler/src/v2/index.ts new file mode 100644 index 00000000000..0897b883dd0 --- /dev/null +++ b/packages/google-devtools-cloudprofiler/src/v2/index.ts @@ -0,0 +1,19 @@ +// Copyright 2023 Google LLC +// +// Licensed under the Apache License, Version 2.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 {ProfilerServiceClient} from './profiler_service_client'; diff --git a/packages/google-devtools-cloudprofiler/src/v2/profiler_service_client.ts b/packages/google-devtools-cloudprofiler/src/v2/profiler_service_client.ts new file mode 100644 index 00000000000..37bc4b6cbc5 --- /dev/null +++ b/packages/google-devtools-cloudprofiler/src/v2/profiler_service_client.ts @@ -0,0 +1,716 @@ +// Copyright 2023 Google LLC +// +// Licensed under the Apache License, Version 2.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, +} from 'google-gax'; + +import * as protos from '../../protos/protos'; +import jsonProtos = require('../../protos/protos.json'); +/** + * Client JSON configuration object, loaded from + * `src/v2/profiler_service_client_config.json`. + * This file defines retry strategy and timeouts for all API methods in this library. + */ +import * as gapicConfig from './profiler_service_client_config.json'; +const version = require('../../../package.json').version; + +/** + * Manage the collection of continuous profiling data provided by profiling + * agents running in the cloud or by an offline provider of profiling data. + * + * General guidelines: + * * Profiles for a single deployment must be created in ascending time order. + * * Profiles can be created in either online or offline mode, see below. + * @class + * @memberof v2 + */ +export class ProfilerServiceClient { + 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}; + 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}; + profilerServiceStub?: Promise<{[name: string]: Function}>; + + /** + * Construct an instance of ProfilerServiceClient. + * + * @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://developers.google.com/identity/protocols/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 ProfilerServiceClient({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 ProfilerServiceClient; + const servicePath = + opts?.servicePath || opts?.apiEndpoint || staticMembers.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 !== staticMembers.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 = staticMembers.servicePath; + + // Set the default scopes in auth client if needed. + if (servicePath === staticMembers.servicePath) { + this.auth.defaultScopes = staticMembers.scopes; + } + + // Determine the client header string. + const clientHeader = [`gax/${this._gaxModule.version}`, `gapic/${version}`]; + if (typeof process !== 'undefined' && '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 = { + profilePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/profiles/{profile}' + ), + projectPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}' + ), + }; + + // Put together the default options sent with requests. + this._defaults = this._gaxGrpc.constructSettings( + 'google.devtools.cloudprofiler.v2.ProfilerService', + 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.profilerServiceStub) { + return this.profilerServiceStub; + } + + // Put together the "service stub" for + // google.devtools.cloudprofiler.v2.ProfilerService. + this.profilerServiceStub = this._gaxGrpc.createStub( + this._opts.fallback + ? (this._protos as protobuf.Root).lookupService( + 'google.devtools.cloudprofiler.v2.ProfilerService' + ) + : // eslint-disable-next-line @typescript-eslint/no-explicit-any + (this._protos as any).google.devtools.cloudprofiler.v2 + .ProfilerService, + 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 profilerServiceStubMethods = [ + 'createProfile', + 'createOfflineProfile', + 'updateProfile', + ]; + for (const methodName of profilerServiceStubMethods) { + const callPromise = this.profilerServiceStub.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 = undefined; + const apiCall = this._gaxModule.createApiCall( + callPromise, + this._defaults[methodName], + descriptor, + this._opts.fallback + ); + + this.innerApiCalls[methodName] = apiCall; + } + + return this.profilerServiceStub; + } + + /** + * The DNS address for this API service. + * @returns {string} The DNS address for this service. + */ + static get servicePath() { + return 'cloudprofiler.googleapis.com'; + } + + /** + * The DNS address for this API service - same as servicePath(), + * exists for compatibility reasons. + * @returns {string} The DNS address for this service. + */ + static get apiEndpoint() { + return 'cloudprofiler.googleapis.com'; + } + + /** + * 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', + 'https://www.googleapis.com/auth/monitoring', + 'https://www.googleapis.com/auth/monitoring.write', + ]; + } + + 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 -- + // ------------------- + /** + * CreateProfile creates a new profile resource in the online mode. + * + * The server ensures that the new profiles are created at a constant rate per + * deployment, so the creation request may hang for some time until the next + * profile session is available. + * + * The request may fail with ABORTED error if the creation is not available + * within ~1m, the response will indicate the duration of the backoff the + * client should take before attempting creating a profile again. The backoff + * duration is returned in google.rpc.RetryInfo extension on the response + * status. To a gRPC client, the extension will be return as a + * binary-serialized proto in the trailing metadata item named + * "google.rpc.retryinfo-bin". + * + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Parent project to create the profile in. + * @param {google.devtools.cloudprofiler.v2.Deployment} request.deployment + * Deployment details. + * @param {number[]} request.profileType + * One or more profile types that the agent is capable of providing. + * @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.devtools.cloudprofiler.v2.Profile|Profile}. + * 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/profiler_service.create_profile.js + * region_tag:cloudprofiler_v2_generated_ProfilerService_CreateProfile_async + */ + createProfile( + request?: protos.google.devtools.cloudprofiler.v2.ICreateProfileRequest, + options?: CallOptions + ): Promise< + [ + protos.google.devtools.cloudprofiler.v2.IProfile, + protos.google.devtools.cloudprofiler.v2.ICreateProfileRequest | undefined, + {} | undefined, + ] + >; + createProfile( + request: protos.google.devtools.cloudprofiler.v2.ICreateProfileRequest, + options: CallOptions, + callback: Callback< + protos.google.devtools.cloudprofiler.v2.IProfile, + | protos.google.devtools.cloudprofiler.v2.ICreateProfileRequest + | null + | undefined, + {} | null | undefined + > + ): void; + createProfile( + request: protos.google.devtools.cloudprofiler.v2.ICreateProfileRequest, + callback: Callback< + protos.google.devtools.cloudprofiler.v2.IProfile, + | protos.google.devtools.cloudprofiler.v2.ICreateProfileRequest + | null + | undefined, + {} | null | undefined + > + ): void; + createProfile( + request?: protos.google.devtools.cloudprofiler.v2.ICreateProfileRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.devtools.cloudprofiler.v2.IProfile, + | protos.google.devtools.cloudprofiler.v2.ICreateProfileRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.devtools.cloudprofiler.v2.IProfile, + | protos.google.devtools.cloudprofiler.v2.ICreateProfileRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.devtools.cloudprofiler.v2.IProfile, + protos.google.devtools.cloudprofiler.v2.ICreateProfileRequest | 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(); + return this.innerApiCalls.createProfile(request, options, callback); + } + /** + * CreateOfflineProfile creates a new profile resource in the offline mode. + * The client provides the profile to create along with the profile bytes, the + * server records it. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Parent project to create the profile in. + * @param {google.devtools.cloudprofiler.v2.Profile} request.profile + * Contents of the profile 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.devtools.cloudprofiler.v2.Profile|Profile}. + * 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/profiler_service.create_offline_profile.js + * region_tag:cloudprofiler_v2_generated_ProfilerService_CreateOfflineProfile_async + */ + createOfflineProfile( + request?: protos.google.devtools.cloudprofiler.v2.ICreateOfflineProfileRequest, + options?: CallOptions + ): Promise< + [ + protos.google.devtools.cloudprofiler.v2.IProfile, + ( + | protos.google.devtools.cloudprofiler.v2.ICreateOfflineProfileRequest + | undefined + ), + {} | undefined, + ] + >; + createOfflineProfile( + request: protos.google.devtools.cloudprofiler.v2.ICreateOfflineProfileRequest, + options: CallOptions, + callback: Callback< + protos.google.devtools.cloudprofiler.v2.IProfile, + | protos.google.devtools.cloudprofiler.v2.ICreateOfflineProfileRequest + | null + | undefined, + {} | null | undefined + > + ): void; + createOfflineProfile( + request: protos.google.devtools.cloudprofiler.v2.ICreateOfflineProfileRequest, + callback: Callback< + protos.google.devtools.cloudprofiler.v2.IProfile, + | protos.google.devtools.cloudprofiler.v2.ICreateOfflineProfileRequest + | null + | undefined, + {} | null | undefined + > + ): void; + createOfflineProfile( + request?: protos.google.devtools.cloudprofiler.v2.ICreateOfflineProfileRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.devtools.cloudprofiler.v2.IProfile, + | protos.google.devtools.cloudprofiler.v2.ICreateOfflineProfileRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.devtools.cloudprofiler.v2.IProfile, + | protos.google.devtools.cloudprofiler.v2.ICreateOfflineProfileRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.devtools.cloudprofiler.v2.IProfile, + ( + | protos.google.devtools.cloudprofiler.v2.ICreateOfflineProfileRequest + | 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(); + return this.innerApiCalls.createOfflineProfile(request, options, callback); + } + /** + * UpdateProfile updates the profile bytes and labels on the profile resource + * created in the online mode. Updating the bytes for profiles created in the + * offline mode is currently not supported: the profile content must be + * provided at the time of the profile creation. + * + * @param {Object} request + * The request object that will be sent. + * @param {google.devtools.cloudprofiler.v2.Profile} request.profile + * Profile to update. + * @param {google.protobuf.FieldMask} request.updateMask + * Field mask used to specify the fields to be overwritten. Currently only + * profile_bytes and labels fields are supported by UpdateProfile, so only + * those fields can be specified in the mask. When no mask is provided, all + * fields are overwritten. + * @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.devtools.cloudprofiler.v2.Profile|Profile}. + * 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/profiler_service.update_profile.js + * region_tag:cloudprofiler_v2_generated_ProfilerService_UpdateProfile_async + */ + updateProfile( + request?: protos.google.devtools.cloudprofiler.v2.IUpdateProfileRequest, + options?: CallOptions + ): Promise< + [ + protos.google.devtools.cloudprofiler.v2.IProfile, + protos.google.devtools.cloudprofiler.v2.IUpdateProfileRequest | undefined, + {} | undefined, + ] + >; + updateProfile( + request: protos.google.devtools.cloudprofiler.v2.IUpdateProfileRequest, + options: CallOptions, + callback: Callback< + protos.google.devtools.cloudprofiler.v2.IProfile, + | protos.google.devtools.cloudprofiler.v2.IUpdateProfileRequest + | null + | undefined, + {} | null | undefined + > + ): void; + updateProfile( + request: protos.google.devtools.cloudprofiler.v2.IUpdateProfileRequest, + callback: Callback< + protos.google.devtools.cloudprofiler.v2.IProfile, + | protos.google.devtools.cloudprofiler.v2.IUpdateProfileRequest + | null + | undefined, + {} | null | undefined + > + ): void; + updateProfile( + request?: protos.google.devtools.cloudprofiler.v2.IUpdateProfileRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.devtools.cloudprofiler.v2.IProfile, + | protos.google.devtools.cloudprofiler.v2.IUpdateProfileRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.devtools.cloudprofiler.v2.IProfile, + | protos.google.devtools.cloudprofiler.v2.IUpdateProfileRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.devtools.cloudprofiler.v2.IProfile, + protos.google.devtools.cloudprofiler.v2.IUpdateProfileRequest | 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({ + 'profile.name': request.profile!.name ?? '', + }); + this.initialize(); + return this.innerApiCalls.updateProfile(request, options, callback); + } + + // -------------------- + // -- Path templates -- + // -------------------- + + /** + * Return a fully-qualified profile resource name string. + * + * @param {string} project + * @param {string} profile + * @returns {string} Resource name string. + */ + profilePath(project: string, profile: string) { + return this.pathTemplates.profilePathTemplate.render({ + project: project, + profile: profile, + }); + } + + /** + * Parse the project from Profile resource. + * + * @param {string} profileName + * A fully-qualified path representing Profile resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProfileName(profileName: string) { + return this.pathTemplates.profilePathTemplate.match(profileName).project; + } + + /** + * Parse the profile from Profile resource. + * + * @param {string} profileName + * A fully-qualified path representing Profile resource. + * @returns {string} A string representing the profile. + */ + matchProfileFromProfileName(profileName: string) { + return this.pathTemplates.profilePathTemplate.match(profileName).profile; + } + + /** + * 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.profilerServiceStub && !this._terminated) { + return this.profilerServiceStub.then(stub => { + this._terminated = true; + stub.close(); + }); + } + return Promise.resolve(); + } +} diff --git a/packages/google-devtools-cloudprofiler/src/v2/profiler_service_client_config.json b/packages/google-devtools-cloudprofiler/src/v2/profiler_service_client_config.json new file mode 100644 index 00000000000..c3f785cb2eb --- /dev/null +++ b/packages/google-devtools-cloudprofiler/src/v2/profiler_service_client_config.json @@ -0,0 +1,41 @@ +{ + "interfaces": { + "google.devtools.cloudprofiler.v2.ProfilerService": { + "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": { + "CreateProfile": { + "timeout_millis": 3610000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "CreateOfflineProfile": { + "timeout_millis": 30000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "UpdateProfile": { + "timeout_millis": 30000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + } + } + } + } +} diff --git a/packages/google-devtools-cloudprofiler/src/v2/profiler_service_proto_list.json b/packages/google-devtools-cloudprofiler/src/v2/profiler_service_proto_list.json new file mode 100644 index 00000000000..aac88076ece --- /dev/null +++ b/packages/google-devtools-cloudprofiler/src/v2/profiler_service_proto_list.json @@ -0,0 +1,3 @@ +[ + "../../protos/google/devtools/cloudprofiler/v2/profiler.proto" +] diff --git a/packages/google-devtools-cloudprofiler/system-test/fixtures/sample/src/index.js b/packages/google-devtools-cloudprofiler/system-test/fixtures/sample/src/index.js new file mode 100644 index 00000000000..327c865aebd --- /dev/null +++ b/packages/google-devtools-cloudprofiler/system-test/fixtures/sample/src/index.js @@ -0,0 +1,26 @@ +// Copyright 2023 Google LLC +// +// Licensed under the Apache License, Version 2.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 cloudprofiler = require('@google-cloud/cloudprofiler'); + +function main() { + const profilerServiceClient = new cloudprofiler.ProfilerServiceClient(); +} + +main(); diff --git a/packages/google-devtools-cloudprofiler/system-test/fixtures/sample/src/index.ts b/packages/google-devtools-cloudprofiler/system-test/fixtures/sample/src/index.ts new file mode 100644 index 00000000000..603a528d2b8 --- /dev/null +++ b/packages/google-devtools-cloudprofiler/system-test/fixtures/sample/src/index.ts @@ -0,0 +1,32 @@ +// Copyright 2023 Google LLC +// +// Licensed under the Apache License, Version 2.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 {ProfilerServiceClient} from '@google-cloud/cloudprofiler'; + +// check that the client class type name can be used +function doStuffWithProfilerServiceClient(client: ProfilerServiceClient) { + client.close(); +} + +function main() { + // check that the client instance can be created + const profilerServiceClient = new ProfilerServiceClient(); + doStuffWithProfilerServiceClient(profilerServiceClient); +} + +main(); diff --git a/packages/google-devtools-cloudprofiler/system-test/install.ts b/packages/google-devtools-cloudprofiler/system-test/install.ts new file mode 100644 index 00000000000..f61fe236476 --- /dev/null +++ b/packages/google-devtools-cloudprofiler/system-test/install.ts @@ -0,0 +1,51 @@ +// Copyright 2023 Google LLC +// +// Licensed under the Apache License, Version 2.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/google-devtools-cloudprofiler/test/gapic_profiler_service_v2.ts b/packages/google-devtools-cloudprofiler/test/gapic_profiler_service_v2.ts new file mode 100644 index 00000000000..9397a0052be --- /dev/null +++ b/packages/google-devtools-cloudprofiler/test/gapic_profiler_service_v2.ts @@ -0,0 +1,650 @@ +// Copyright 2023 Google LLC +// +// Licensed under the Apache License, Version 2.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 profilerserviceModule from '../src'; + +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); +} + +describe('v2.ProfilerServiceClient', () => { + describe('Common methods', () => { + it('has servicePath', () => { + const servicePath = + profilerserviceModule.v2.ProfilerServiceClient.servicePath; + assert(servicePath); + }); + + it('has apiEndpoint', () => { + const apiEndpoint = + profilerserviceModule.v2.ProfilerServiceClient.apiEndpoint; + assert(apiEndpoint); + }); + + it('has port', () => { + const port = profilerserviceModule.v2.ProfilerServiceClient.port; + assert(port); + assert(typeof port === 'number'); + }); + + it('should create a client with no option', () => { + const client = new profilerserviceModule.v2.ProfilerServiceClient(); + assert(client); + }); + + it('should create a client with gRPC fallback', () => { + const client = new profilerserviceModule.v2.ProfilerServiceClient({ + fallback: true, + }); + assert(client); + }); + + it('has initialize method and supports deferred initialization', async () => { + const client = new profilerserviceModule.v2.ProfilerServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + assert.strictEqual(client.profilerServiceStub, undefined); + await client.initialize(); + assert(client.profilerServiceStub); + }); + + it('has close method for the initialized client', done => { + const client = new profilerserviceModule.v2.ProfilerServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + assert(client.profilerServiceStub); + client.close().then(() => { + done(); + }); + }); + + it('has close method for the non-initialized client', done => { + const client = new profilerserviceModule.v2.ProfilerServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + assert.strictEqual(client.profilerServiceStub, undefined); + client.close().then(() => { + done(); + }); + }); + + it('has getProjectId method', async () => { + const fakeProjectId = 'fake-project-id'; + const client = new profilerserviceModule.v2.ProfilerServiceClient({ + 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 profilerserviceModule.v2.ProfilerServiceClient({ + 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('createProfile', () => { + it('invokes createProfile without error', async () => { + const client = new profilerserviceModule.v2.ProfilerServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.devtools.cloudprofiler.v2.CreateProfileRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.devtools.cloudprofiler.v2.CreateProfileRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.devtools.cloudprofiler.v2.Profile() + ); + client.innerApiCalls.createProfile = stubSimpleCall(expectedResponse); + const [response] = await client.createProfile(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.createProfile as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createProfile as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createProfile without error using callback', async () => { + const client = new profilerserviceModule.v2.ProfilerServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.devtools.cloudprofiler.v2.CreateProfileRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.devtools.cloudprofiler.v2.CreateProfileRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.devtools.cloudprofiler.v2.Profile() + ); + client.innerApiCalls.createProfile = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.createProfile( + request, + ( + err?: Error | null, + result?: protos.google.devtools.cloudprofiler.v2.IProfile | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.createProfile as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createProfile as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createProfile with error', async () => { + const client = new profilerserviceModule.v2.ProfilerServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.devtools.cloudprofiler.v2.CreateProfileRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.devtools.cloudprofiler.v2.CreateProfileRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.createProfile = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.createProfile(request), expectedError); + const actualRequest = ( + client.innerApiCalls.createProfile as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createProfile as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createProfile with closed client', async () => { + const client = new profilerserviceModule.v2.ProfilerServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.devtools.cloudprofiler.v2.CreateProfileRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.devtools.cloudprofiler.v2.CreateProfileRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.createProfile(request), expectedError); + }); + }); + + describe('createOfflineProfile', () => { + it('invokes createOfflineProfile without error', async () => { + const client = new profilerserviceModule.v2.ProfilerServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.devtools.cloudprofiler.v2.CreateOfflineProfileRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.devtools.cloudprofiler.v2.CreateOfflineProfileRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.devtools.cloudprofiler.v2.Profile() + ); + client.innerApiCalls.createOfflineProfile = + stubSimpleCall(expectedResponse); + const [response] = await client.createOfflineProfile(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.createOfflineProfile as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createOfflineProfile as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createOfflineProfile without error using callback', async () => { + const client = new profilerserviceModule.v2.ProfilerServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.devtools.cloudprofiler.v2.CreateOfflineProfileRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.devtools.cloudprofiler.v2.CreateOfflineProfileRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.devtools.cloudprofiler.v2.Profile() + ); + client.innerApiCalls.createOfflineProfile = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.createOfflineProfile( + request, + ( + err?: Error | null, + result?: protos.google.devtools.cloudprofiler.v2.IProfile | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.createOfflineProfile as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createOfflineProfile as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createOfflineProfile with error', async () => { + const client = new profilerserviceModule.v2.ProfilerServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.devtools.cloudprofiler.v2.CreateOfflineProfileRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.devtools.cloudprofiler.v2.CreateOfflineProfileRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.createOfflineProfile = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.createOfflineProfile(request), expectedError); + const actualRequest = ( + client.innerApiCalls.createOfflineProfile as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createOfflineProfile as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createOfflineProfile with closed client', async () => { + const client = new profilerserviceModule.v2.ProfilerServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.devtools.cloudprofiler.v2.CreateOfflineProfileRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.devtools.cloudprofiler.v2.CreateOfflineProfileRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.createOfflineProfile(request), expectedError); + }); + }); + + describe('updateProfile', () => { + it('invokes updateProfile without error', async () => { + const client = new profilerserviceModule.v2.ProfilerServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.devtools.cloudprofiler.v2.UpdateProfileRequest() + ); + request.profile ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.devtools.cloudprofiler.v2.UpdateProfileRequest', + ['profile', 'name'] + ); + request.profile.name = defaultValue1; + const expectedHeaderRequestParams = `profile.name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.devtools.cloudprofiler.v2.Profile() + ); + client.innerApiCalls.updateProfile = stubSimpleCall(expectedResponse); + const [response] = await client.updateProfile(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.updateProfile as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateProfile as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateProfile without error using callback', async () => { + const client = new profilerserviceModule.v2.ProfilerServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.devtools.cloudprofiler.v2.UpdateProfileRequest() + ); + request.profile ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.devtools.cloudprofiler.v2.UpdateProfileRequest', + ['profile', 'name'] + ); + request.profile.name = defaultValue1; + const expectedHeaderRequestParams = `profile.name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.devtools.cloudprofiler.v2.Profile() + ); + client.innerApiCalls.updateProfile = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.updateProfile( + request, + ( + err?: Error | null, + result?: protos.google.devtools.cloudprofiler.v2.IProfile | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.updateProfile as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateProfile as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateProfile with error', async () => { + const client = new profilerserviceModule.v2.ProfilerServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.devtools.cloudprofiler.v2.UpdateProfileRequest() + ); + request.profile ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.devtools.cloudprofiler.v2.UpdateProfileRequest', + ['profile', 'name'] + ); + request.profile.name = defaultValue1; + const expectedHeaderRequestParams = `profile.name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.updateProfile = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.updateProfile(request), expectedError); + const actualRequest = ( + client.innerApiCalls.updateProfile as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateProfile as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateProfile with closed client', async () => { + const client = new profilerserviceModule.v2.ProfilerServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.devtools.cloudprofiler.v2.UpdateProfileRequest() + ); + request.profile ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.devtools.cloudprofiler.v2.UpdateProfileRequest', + ['profile', 'name'] + ); + request.profile.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.updateProfile(request), expectedError); + }); + }); + + describe('Path templates', () => { + describe('profile', () => { + const fakePath = '/rendered/path/profile'; + const expectedParameters = { + project: 'projectValue', + profile: 'profileValue', + }; + const client = new profilerserviceModule.v2.ProfilerServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.profilePathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.profilePathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('profilePath', () => { + const result = client.profilePath('projectValue', 'profileValue'); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.profilePathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromProfileName', () => { + const result = client.matchProjectFromProfileName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.profilePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchProfileFromProfileName', () => { + const result = client.matchProfileFromProfileName(fakePath); + assert.strictEqual(result, 'profileValue'); + assert( + (client.pathTemplates.profilePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('project', () => { + const fakePath = '/rendered/path/project'; + const expectedParameters = { + project: 'projectValue', + }; + const client = new profilerserviceModule.v2.ProfilerServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + 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/google-devtools-cloudprofiler/tsconfig.json b/packages/google-devtools-cloudprofiler/tsconfig.json new file mode 100644 index 00000000000..c78f1c884ef --- /dev/null +++ b/packages/google-devtools-cloudprofiler/tsconfig.json @@ -0,0 +1,19 @@ +{ + "extends": "./node_modules/gts/tsconfig-google.json", + "compilerOptions": { + "rootDir": ".", + "outDir": "build", + "resolveJsonModule": true, + "lib": [ + "es2018", + "dom" + ] + }, + "include": [ + "src/*.ts", + "src/**/*.ts", + "test/*.ts", + "test/**/*.ts", + "system-test/*.ts" + ] +} diff --git a/packages/google-devtools-cloudprofiler/webpack.config.js b/packages/google-devtools-cloudprofiler/webpack.config.js new file mode 100644 index 00000000000..7ebf5d52b99 --- /dev/null +++ b/packages/google-devtools-cloudprofiler/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: 'ProfilerService', + filename: './profiler-service.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/google-devtools-containeranalysis/CHANGELOG.md b/packages/google-devtools-containeranalysis/CHANGELOG.md index 375e13d27ff..85557f34596 100644 --- a/packages/google-devtools-containeranalysis/CHANGELOG.md +++ b/packages/google-devtools-containeranalysis/CHANGELOG.md @@ -4,6 +4,13 @@ [1]: https://www.npmjs.com/package/@google-cloud/containeranalysis?activeTab=versions +## [5.1.1](https://github.com/googleapis/google-cloud-node/compare/containeranalysis-v5.1.0...containeranalysis-v5.1.1) (2023-09-11) + + +### Bug Fixes + +* Publication issues with containeranalysis and policytroubleshooter ([#4628](https://github.com/googleapis/google-cloud-node/issues/4628)) ([2ba7b48](https://github.com/googleapis/google-cloud-node/commit/2ba7b489e6109e5bf3d5e7276a0b94558ebd48d0)) + ## [5.1.0](https://github.com/googleapis/google-cloud-node/compare/containeranalysis-v5.0.1...containeranalysis-v5.1.0) (2023-09-06) diff --git a/packages/google-devtools-containeranalysis/README.md b/packages/google-devtools-containeranalysis/README.md index 4c91f95c91f..7007e4cd2a7 100644 --- a/packages/google-devtools-containeranalysis/README.md +++ b/packages/google-devtools-containeranalysis/README.md @@ -2,7 +2,7 @@ [//]: # "To regenerate it, use `python -m synthtool`." Google Cloud Platform logo -# [Google Container Analysis: Node.js Client](googleapis/nodejs-containeranalysis) +# [Google Container Analysis: Node.js Client](https://github.com/googleapis/google-cloud-node/tree/main/packages/google-devtools-containeranalysis) [![release level](https://img.shields.io/badge/release%20level-stable-brightgreen.svg?style=flat)](https://cloud.google.com/terms/launch-stages) [![npm version](https://img.shields.io/npm/v/@google-cloud/containeranalysis.svg)](https://www.npmjs.org/package/@google-cloud/containeranalysis) @@ -14,11 +14,11 @@ Containeranalysis client for Node.js A comprehensive list of changes in each version may be found in -[the CHANGELOG](googleapis/nodejs-containeranalysis/CHANGELOG.md). +[the CHANGELOG](https://github.com/googleapis/google-cloud-node/tree/main/packages/google-devtools-containeranalysis/CHANGELOG.md). * [Google Container Analysis Node.js Client API Reference][client-docs] * [Google Container Analysis Documentation][product-docs] -* [github.com/googleapis/nodejs-containeranalysis](googleapis/nodejs-containeranalysis) +* [github.com/googleapis/google-cloud-node/packages/google-devtools-containeranalysis](https://github.com/googleapis/google-cloud-node/tree/main/packages/google-devtools-containeranalysis) Read more about the client libraries for Cloud APIs, including the older Google APIs Client Libraries, in [Client Libraries Explained][explained]. @@ -58,52 +58,52 @@ npm install @google-cloud/containeranalysis ## Samples -Samples are in the [`samples/`](googleapis/nodejs-containeranalysis/samples) directory. Each sample's `README.md` has instructions for running its sample. +Samples are in the [`samples/`](https://github.com/googleapis/google-cloud-node/tree/main/packages/google-devtools-containeranalysis/samples) directory. Each sample's `README.md` has instructions for running its sample. | Sample | Source Code | Try it | | --------------------------- | --------------------------------- | ------ | -| Container_analysis.get_iam_policy | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-devtools-containeranalysis/samples/generated/v1/container_analysis.get_iam_policy.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-devtools-containeranalysis/samples/generated/v1/container_analysis.get_iam_policy.js,googleapis/nodejs-containeranalysis/samples/README.md) | -| Container_analysis.get_vulnerability_occurrences_summary | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-devtools-containeranalysis/samples/generated/v1/container_analysis.get_vulnerability_occurrences_summary.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-devtools-containeranalysis/samples/generated/v1/container_analysis.get_vulnerability_occurrences_summary.js,googleapis/nodejs-containeranalysis/samples/README.md) | -| Container_analysis.set_iam_policy | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-devtools-containeranalysis/samples/generated/v1/container_analysis.set_iam_policy.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-devtools-containeranalysis/samples/generated/v1/container_analysis.set_iam_policy.js,googleapis/nodejs-containeranalysis/samples/README.md) | -| Container_analysis.test_iam_permissions | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-devtools-containeranalysis/samples/generated/v1/container_analysis.test_iam_permissions.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-devtools-containeranalysis/samples/generated/v1/container_analysis.test_iam_permissions.js,googleapis/nodejs-containeranalysis/samples/README.md) | -| Grafeas.batch_create_notes | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-devtools-containeranalysis/samples/generated/v1/grafeas.batch_create_notes.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-devtools-containeranalysis/samples/generated/v1/grafeas.batch_create_notes.js,googleapis/nodejs-containeranalysis/samples/README.md) | -| Grafeas.batch_create_occurrences | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-devtools-containeranalysis/samples/generated/v1/grafeas.batch_create_occurrences.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-devtools-containeranalysis/samples/generated/v1/grafeas.batch_create_occurrences.js,googleapis/nodejs-containeranalysis/samples/README.md) | -| Grafeas.create_note | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-devtools-containeranalysis/samples/generated/v1/grafeas.create_note.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-devtools-containeranalysis/samples/generated/v1/grafeas.create_note.js,googleapis/nodejs-containeranalysis/samples/README.md) | -| Grafeas.create_occurrence | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-devtools-containeranalysis/samples/generated/v1/grafeas.create_occurrence.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-devtools-containeranalysis/samples/generated/v1/grafeas.create_occurrence.js,googleapis/nodejs-containeranalysis/samples/README.md) | -| Grafeas.delete_note | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-devtools-containeranalysis/samples/generated/v1/grafeas.delete_note.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-devtools-containeranalysis/samples/generated/v1/grafeas.delete_note.js,googleapis/nodejs-containeranalysis/samples/README.md) | -| Grafeas.delete_occurrence | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-devtools-containeranalysis/samples/generated/v1/grafeas.delete_occurrence.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-devtools-containeranalysis/samples/generated/v1/grafeas.delete_occurrence.js,googleapis/nodejs-containeranalysis/samples/README.md) | -| Grafeas.get_note | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-devtools-containeranalysis/samples/generated/v1/grafeas.get_note.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-devtools-containeranalysis/samples/generated/v1/grafeas.get_note.js,googleapis/nodejs-containeranalysis/samples/README.md) | -| Grafeas.get_occurrence | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-devtools-containeranalysis/samples/generated/v1/grafeas.get_occurrence.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-devtools-containeranalysis/samples/generated/v1/grafeas.get_occurrence.js,googleapis/nodejs-containeranalysis/samples/README.md) | -| Grafeas.get_occurrence_note | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-devtools-containeranalysis/samples/generated/v1/grafeas.get_occurrence_note.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-devtools-containeranalysis/samples/generated/v1/grafeas.get_occurrence_note.js,googleapis/nodejs-containeranalysis/samples/README.md) | -| Grafeas.list_note_occurrences | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-devtools-containeranalysis/samples/generated/v1/grafeas.list_note_occurrences.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-devtools-containeranalysis/samples/generated/v1/grafeas.list_note_occurrences.js,googleapis/nodejs-containeranalysis/samples/README.md) | -| Grafeas.list_notes | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-devtools-containeranalysis/samples/generated/v1/grafeas.list_notes.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-devtools-containeranalysis/samples/generated/v1/grafeas.list_notes.js,googleapis/nodejs-containeranalysis/samples/README.md) | -| Grafeas.list_occurrences | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-devtools-containeranalysis/samples/generated/v1/grafeas.list_occurrences.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-devtools-containeranalysis/samples/generated/v1/grafeas.list_occurrences.js,googleapis/nodejs-containeranalysis/samples/README.md) | -| Grafeas.update_note | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-devtools-containeranalysis/samples/generated/v1/grafeas.update_note.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-devtools-containeranalysis/samples/generated/v1/grafeas.update_note.js,googleapis/nodejs-containeranalysis/samples/README.md) | -| Grafeas.update_occurrence | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-devtools-containeranalysis/samples/generated/v1/grafeas.update_occurrence.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-devtools-containeranalysis/samples/generated/v1/grafeas.update_occurrence.js,googleapis/nodejs-containeranalysis/samples/README.md) | -| Container_analysis_v1_beta1.export_s_b_o_m | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-devtools-containeranalysis/samples/generated/v1beta1/container_analysis_v1_beta1.export_s_b_o_m.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-devtools-containeranalysis/samples/generated/v1beta1/container_analysis_v1_beta1.export_s_b_o_m.js,googleapis/nodejs-containeranalysis/samples/README.md) | -| Container_analysis_v1_beta1.generate_packages_summary | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-devtools-containeranalysis/samples/generated/v1beta1/container_analysis_v1_beta1.generate_packages_summary.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-devtools-containeranalysis/samples/generated/v1beta1/container_analysis_v1_beta1.generate_packages_summary.js,googleapis/nodejs-containeranalysis/samples/README.md) | -| Container_analysis_v1_beta1.get_iam_policy | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-devtools-containeranalysis/samples/generated/v1beta1/container_analysis_v1_beta1.get_iam_policy.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-devtools-containeranalysis/samples/generated/v1beta1/container_analysis_v1_beta1.get_iam_policy.js,googleapis/nodejs-containeranalysis/samples/README.md) | -| Container_analysis_v1_beta1.get_scan_config | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-devtools-containeranalysis/samples/generated/v1beta1/container_analysis_v1_beta1.get_scan_config.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-devtools-containeranalysis/samples/generated/v1beta1/container_analysis_v1_beta1.get_scan_config.js,googleapis/nodejs-containeranalysis/samples/README.md) | -| Container_analysis_v1_beta1.list_scan_configs | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-devtools-containeranalysis/samples/generated/v1beta1/container_analysis_v1_beta1.list_scan_configs.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-devtools-containeranalysis/samples/generated/v1beta1/container_analysis_v1_beta1.list_scan_configs.js,googleapis/nodejs-containeranalysis/samples/README.md) | -| Container_analysis_v1_beta1.set_iam_policy | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-devtools-containeranalysis/samples/generated/v1beta1/container_analysis_v1_beta1.set_iam_policy.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-devtools-containeranalysis/samples/generated/v1beta1/container_analysis_v1_beta1.set_iam_policy.js,googleapis/nodejs-containeranalysis/samples/README.md) | -| Container_analysis_v1_beta1.test_iam_permissions | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-devtools-containeranalysis/samples/generated/v1beta1/container_analysis_v1_beta1.test_iam_permissions.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-devtools-containeranalysis/samples/generated/v1beta1/container_analysis_v1_beta1.test_iam_permissions.js,googleapis/nodejs-containeranalysis/samples/README.md) | -| Container_analysis_v1_beta1.update_scan_config | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-devtools-containeranalysis/samples/generated/v1beta1/container_analysis_v1_beta1.update_scan_config.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-devtools-containeranalysis/samples/generated/v1beta1/container_analysis_v1_beta1.update_scan_config.js,googleapis/nodejs-containeranalysis/samples/README.md) | -| Grafeas_v1_beta1.batch_create_notes | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-devtools-containeranalysis/samples/generated/v1beta1/grafeas_v1_beta1.batch_create_notes.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-devtools-containeranalysis/samples/generated/v1beta1/grafeas_v1_beta1.batch_create_notes.js,googleapis/nodejs-containeranalysis/samples/README.md) | -| Grafeas_v1_beta1.batch_create_occurrences | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-devtools-containeranalysis/samples/generated/v1beta1/grafeas_v1_beta1.batch_create_occurrences.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-devtools-containeranalysis/samples/generated/v1beta1/grafeas_v1_beta1.batch_create_occurrences.js,googleapis/nodejs-containeranalysis/samples/README.md) | -| Grafeas_v1_beta1.create_note | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-devtools-containeranalysis/samples/generated/v1beta1/grafeas_v1_beta1.create_note.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-devtools-containeranalysis/samples/generated/v1beta1/grafeas_v1_beta1.create_note.js,googleapis/nodejs-containeranalysis/samples/README.md) | -| Grafeas_v1_beta1.create_occurrence | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-devtools-containeranalysis/samples/generated/v1beta1/grafeas_v1_beta1.create_occurrence.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-devtools-containeranalysis/samples/generated/v1beta1/grafeas_v1_beta1.create_occurrence.js,googleapis/nodejs-containeranalysis/samples/README.md) | -| Grafeas_v1_beta1.delete_note | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-devtools-containeranalysis/samples/generated/v1beta1/grafeas_v1_beta1.delete_note.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-devtools-containeranalysis/samples/generated/v1beta1/grafeas_v1_beta1.delete_note.js,googleapis/nodejs-containeranalysis/samples/README.md) | -| Grafeas_v1_beta1.delete_occurrence | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-devtools-containeranalysis/samples/generated/v1beta1/grafeas_v1_beta1.delete_occurrence.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-devtools-containeranalysis/samples/generated/v1beta1/grafeas_v1_beta1.delete_occurrence.js,googleapis/nodejs-containeranalysis/samples/README.md) | -| Grafeas_v1_beta1.get_note | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-devtools-containeranalysis/samples/generated/v1beta1/grafeas_v1_beta1.get_note.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-devtools-containeranalysis/samples/generated/v1beta1/grafeas_v1_beta1.get_note.js,googleapis/nodejs-containeranalysis/samples/README.md) | -| Grafeas_v1_beta1.get_occurrence | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-devtools-containeranalysis/samples/generated/v1beta1/grafeas_v1_beta1.get_occurrence.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-devtools-containeranalysis/samples/generated/v1beta1/grafeas_v1_beta1.get_occurrence.js,googleapis/nodejs-containeranalysis/samples/README.md) | -| Grafeas_v1_beta1.get_occurrence_note | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-devtools-containeranalysis/samples/generated/v1beta1/grafeas_v1_beta1.get_occurrence_note.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-devtools-containeranalysis/samples/generated/v1beta1/grafeas_v1_beta1.get_occurrence_note.js,googleapis/nodejs-containeranalysis/samples/README.md) | -| Grafeas_v1_beta1.get_vulnerability_occurrences_summary | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-devtools-containeranalysis/samples/generated/v1beta1/grafeas_v1_beta1.get_vulnerability_occurrences_summary.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-devtools-containeranalysis/samples/generated/v1beta1/grafeas_v1_beta1.get_vulnerability_occurrences_summary.js,googleapis/nodejs-containeranalysis/samples/README.md) | -| Grafeas_v1_beta1.list_note_occurrences | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-devtools-containeranalysis/samples/generated/v1beta1/grafeas_v1_beta1.list_note_occurrences.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-devtools-containeranalysis/samples/generated/v1beta1/grafeas_v1_beta1.list_note_occurrences.js,googleapis/nodejs-containeranalysis/samples/README.md) | -| Grafeas_v1_beta1.list_notes | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-devtools-containeranalysis/samples/generated/v1beta1/grafeas_v1_beta1.list_notes.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-devtools-containeranalysis/samples/generated/v1beta1/grafeas_v1_beta1.list_notes.js,googleapis/nodejs-containeranalysis/samples/README.md) | -| Grafeas_v1_beta1.list_occurrences | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-devtools-containeranalysis/samples/generated/v1beta1/grafeas_v1_beta1.list_occurrences.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-devtools-containeranalysis/samples/generated/v1beta1/grafeas_v1_beta1.list_occurrences.js,googleapis/nodejs-containeranalysis/samples/README.md) | -| Grafeas_v1_beta1.update_note | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-devtools-containeranalysis/samples/generated/v1beta1/grafeas_v1_beta1.update_note.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-devtools-containeranalysis/samples/generated/v1beta1/grafeas_v1_beta1.update_note.js,googleapis/nodejs-containeranalysis/samples/README.md) | -| Grafeas_v1_beta1.update_occurrence | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-devtools-containeranalysis/samples/generated/v1beta1/grafeas_v1_beta1.update_occurrence.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-devtools-containeranalysis/samples/generated/v1beta1/grafeas_v1_beta1.update_occurrence.js,googleapis/nodejs-containeranalysis/samples/README.md) | -| Quickstart | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-devtools-containeranalysis/samples/quickstart.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-devtools-containeranalysis/samples/quickstart.js,googleapis/nodejs-containeranalysis/samples/README.md) | +| Container_analysis.get_iam_policy | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-devtools-containeranalysis/samples/generated/v1/container_analysis.get_iam_policy.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-devtools-containeranalysis/samples/generated/v1/container_analysis.get_iam_policy.js,packages/google-devtools-containeranalysis/samples/README.md) | +| Container_analysis.get_vulnerability_occurrences_summary | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-devtools-containeranalysis/samples/generated/v1/container_analysis.get_vulnerability_occurrences_summary.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-devtools-containeranalysis/samples/generated/v1/container_analysis.get_vulnerability_occurrences_summary.js,packages/google-devtools-containeranalysis/samples/README.md) | +| Container_analysis.set_iam_policy | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-devtools-containeranalysis/samples/generated/v1/container_analysis.set_iam_policy.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-devtools-containeranalysis/samples/generated/v1/container_analysis.set_iam_policy.js,packages/google-devtools-containeranalysis/samples/README.md) | +| Container_analysis.test_iam_permissions | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-devtools-containeranalysis/samples/generated/v1/container_analysis.test_iam_permissions.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-devtools-containeranalysis/samples/generated/v1/container_analysis.test_iam_permissions.js,packages/google-devtools-containeranalysis/samples/README.md) | +| Grafeas.batch_create_notes | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-devtools-containeranalysis/samples/generated/v1/grafeas.batch_create_notes.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-devtools-containeranalysis/samples/generated/v1/grafeas.batch_create_notes.js,packages/google-devtools-containeranalysis/samples/README.md) | +| Grafeas.batch_create_occurrences | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-devtools-containeranalysis/samples/generated/v1/grafeas.batch_create_occurrences.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-devtools-containeranalysis/samples/generated/v1/grafeas.batch_create_occurrences.js,packages/google-devtools-containeranalysis/samples/README.md) | +| Grafeas.create_note | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-devtools-containeranalysis/samples/generated/v1/grafeas.create_note.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-devtools-containeranalysis/samples/generated/v1/grafeas.create_note.js,packages/google-devtools-containeranalysis/samples/README.md) | +| Grafeas.create_occurrence | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-devtools-containeranalysis/samples/generated/v1/grafeas.create_occurrence.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-devtools-containeranalysis/samples/generated/v1/grafeas.create_occurrence.js,packages/google-devtools-containeranalysis/samples/README.md) | +| Grafeas.delete_note | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-devtools-containeranalysis/samples/generated/v1/grafeas.delete_note.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-devtools-containeranalysis/samples/generated/v1/grafeas.delete_note.js,packages/google-devtools-containeranalysis/samples/README.md) | +| Grafeas.delete_occurrence | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-devtools-containeranalysis/samples/generated/v1/grafeas.delete_occurrence.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-devtools-containeranalysis/samples/generated/v1/grafeas.delete_occurrence.js,packages/google-devtools-containeranalysis/samples/README.md) | +| Grafeas.get_note | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-devtools-containeranalysis/samples/generated/v1/grafeas.get_note.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-devtools-containeranalysis/samples/generated/v1/grafeas.get_note.js,packages/google-devtools-containeranalysis/samples/README.md) | +| Grafeas.get_occurrence | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-devtools-containeranalysis/samples/generated/v1/grafeas.get_occurrence.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-devtools-containeranalysis/samples/generated/v1/grafeas.get_occurrence.js,packages/google-devtools-containeranalysis/samples/README.md) | +| Grafeas.get_occurrence_note | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-devtools-containeranalysis/samples/generated/v1/grafeas.get_occurrence_note.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-devtools-containeranalysis/samples/generated/v1/grafeas.get_occurrence_note.js,packages/google-devtools-containeranalysis/samples/README.md) | +| Grafeas.list_note_occurrences | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-devtools-containeranalysis/samples/generated/v1/grafeas.list_note_occurrences.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-devtools-containeranalysis/samples/generated/v1/grafeas.list_note_occurrences.js,packages/google-devtools-containeranalysis/samples/README.md) | +| Grafeas.list_notes | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-devtools-containeranalysis/samples/generated/v1/grafeas.list_notes.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-devtools-containeranalysis/samples/generated/v1/grafeas.list_notes.js,packages/google-devtools-containeranalysis/samples/README.md) | +| Grafeas.list_occurrences | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-devtools-containeranalysis/samples/generated/v1/grafeas.list_occurrences.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-devtools-containeranalysis/samples/generated/v1/grafeas.list_occurrences.js,packages/google-devtools-containeranalysis/samples/README.md) | +| Grafeas.update_note | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-devtools-containeranalysis/samples/generated/v1/grafeas.update_note.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-devtools-containeranalysis/samples/generated/v1/grafeas.update_note.js,packages/google-devtools-containeranalysis/samples/README.md) | +| Grafeas.update_occurrence | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-devtools-containeranalysis/samples/generated/v1/grafeas.update_occurrence.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-devtools-containeranalysis/samples/generated/v1/grafeas.update_occurrence.js,packages/google-devtools-containeranalysis/samples/README.md) | +| Container_analysis_v1_beta1.export_s_b_o_m | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-devtools-containeranalysis/samples/generated/v1beta1/container_analysis_v1_beta1.export_s_b_o_m.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-devtools-containeranalysis/samples/generated/v1beta1/container_analysis_v1_beta1.export_s_b_o_m.js,packages/google-devtools-containeranalysis/samples/README.md) | +| Container_analysis_v1_beta1.generate_packages_summary | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-devtools-containeranalysis/samples/generated/v1beta1/container_analysis_v1_beta1.generate_packages_summary.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-devtools-containeranalysis/samples/generated/v1beta1/container_analysis_v1_beta1.generate_packages_summary.js,packages/google-devtools-containeranalysis/samples/README.md) | +| Container_analysis_v1_beta1.get_iam_policy | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-devtools-containeranalysis/samples/generated/v1beta1/container_analysis_v1_beta1.get_iam_policy.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-devtools-containeranalysis/samples/generated/v1beta1/container_analysis_v1_beta1.get_iam_policy.js,packages/google-devtools-containeranalysis/samples/README.md) | +| Container_analysis_v1_beta1.get_scan_config | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-devtools-containeranalysis/samples/generated/v1beta1/container_analysis_v1_beta1.get_scan_config.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-devtools-containeranalysis/samples/generated/v1beta1/container_analysis_v1_beta1.get_scan_config.js,packages/google-devtools-containeranalysis/samples/README.md) | +| Container_analysis_v1_beta1.list_scan_configs | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-devtools-containeranalysis/samples/generated/v1beta1/container_analysis_v1_beta1.list_scan_configs.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-devtools-containeranalysis/samples/generated/v1beta1/container_analysis_v1_beta1.list_scan_configs.js,packages/google-devtools-containeranalysis/samples/README.md) | +| Container_analysis_v1_beta1.set_iam_policy | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-devtools-containeranalysis/samples/generated/v1beta1/container_analysis_v1_beta1.set_iam_policy.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-devtools-containeranalysis/samples/generated/v1beta1/container_analysis_v1_beta1.set_iam_policy.js,packages/google-devtools-containeranalysis/samples/README.md) | +| Container_analysis_v1_beta1.test_iam_permissions | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-devtools-containeranalysis/samples/generated/v1beta1/container_analysis_v1_beta1.test_iam_permissions.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-devtools-containeranalysis/samples/generated/v1beta1/container_analysis_v1_beta1.test_iam_permissions.js,packages/google-devtools-containeranalysis/samples/README.md) | +| Container_analysis_v1_beta1.update_scan_config | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-devtools-containeranalysis/samples/generated/v1beta1/container_analysis_v1_beta1.update_scan_config.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-devtools-containeranalysis/samples/generated/v1beta1/container_analysis_v1_beta1.update_scan_config.js,packages/google-devtools-containeranalysis/samples/README.md) | +| Grafeas_v1_beta1.batch_create_notes | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-devtools-containeranalysis/samples/generated/v1beta1/grafeas_v1_beta1.batch_create_notes.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-devtools-containeranalysis/samples/generated/v1beta1/grafeas_v1_beta1.batch_create_notes.js,packages/google-devtools-containeranalysis/samples/README.md) | +| Grafeas_v1_beta1.batch_create_occurrences | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-devtools-containeranalysis/samples/generated/v1beta1/grafeas_v1_beta1.batch_create_occurrences.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-devtools-containeranalysis/samples/generated/v1beta1/grafeas_v1_beta1.batch_create_occurrences.js,packages/google-devtools-containeranalysis/samples/README.md) | +| Grafeas_v1_beta1.create_note | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-devtools-containeranalysis/samples/generated/v1beta1/grafeas_v1_beta1.create_note.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-devtools-containeranalysis/samples/generated/v1beta1/grafeas_v1_beta1.create_note.js,packages/google-devtools-containeranalysis/samples/README.md) | +| Grafeas_v1_beta1.create_occurrence | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-devtools-containeranalysis/samples/generated/v1beta1/grafeas_v1_beta1.create_occurrence.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-devtools-containeranalysis/samples/generated/v1beta1/grafeas_v1_beta1.create_occurrence.js,packages/google-devtools-containeranalysis/samples/README.md) | +| Grafeas_v1_beta1.delete_note | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-devtools-containeranalysis/samples/generated/v1beta1/grafeas_v1_beta1.delete_note.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-devtools-containeranalysis/samples/generated/v1beta1/grafeas_v1_beta1.delete_note.js,packages/google-devtools-containeranalysis/samples/README.md) | +| Grafeas_v1_beta1.delete_occurrence | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-devtools-containeranalysis/samples/generated/v1beta1/grafeas_v1_beta1.delete_occurrence.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-devtools-containeranalysis/samples/generated/v1beta1/grafeas_v1_beta1.delete_occurrence.js,packages/google-devtools-containeranalysis/samples/README.md) | +| Grafeas_v1_beta1.get_note | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-devtools-containeranalysis/samples/generated/v1beta1/grafeas_v1_beta1.get_note.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-devtools-containeranalysis/samples/generated/v1beta1/grafeas_v1_beta1.get_note.js,packages/google-devtools-containeranalysis/samples/README.md) | +| Grafeas_v1_beta1.get_occurrence | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-devtools-containeranalysis/samples/generated/v1beta1/grafeas_v1_beta1.get_occurrence.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-devtools-containeranalysis/samples/generated/v1beta1/grafeas_v1_beta1.get_occurrence.js,packages/google-devtools-containeranalysis/samples/README.md) | +| Grafeas_v1_beta1.get_occurrence_note | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-devtools-containeranalysis/samples/generated/v1beta1/grafeas_v1_beta1.get_occurrence_note.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-devtools-containeranalysis/samples/generated/v1beta1/grafeas_v1_beta1.get_occurrence_note.js,packages/google-devtools-containeranalysis/samples/README.md) | +| Grafeas_v1_beta1.get_vulnerability_occurrences_summary | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-devtools-containeranalysis/samples/generated/v1beta1/grafeas_v1_beta1.get_vulnerability_occurrences_summary.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-devtools-containeranalysis/samples/generated/v1beta1/grafeas_v1_beta1.get_vulnerability_occurrences_summary.js,packages/google-devtools-containeranalysis/samples/README.md) | +| Grafeas_v1_beta1.list_note_occurrences | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-devtools-containeranalysis/samples/generated/v1beta1/grafeas_v1_beta1.list_note_occurrences.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-devtools-containeranalysis/samples/generated/v1beta1/grafeas_v1_beta1.list_note_occurrences.js,packages/google-devtools-containeranalysis/samples/README.md) | +| Grafeas_v1_beta1.list_notes | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-devtools-containeranalysis/samples/generated/v1beta1/grafeas_v1_beta1.list_notes.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-devtools-containeranalysis/samples/generated/v1beta1/grafeas_v1_beta1.list_notes.js,packages/google-devtools-containeranalysis/samples/README.md) | +| Grafeas_v1_beta1.list_occurrences | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-devtools-containeranalysis/samples/generated/v1beta1/grafeas_v1_beta1.list_occurrences.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-devtools-containeranalysis/samples/generated/v1beta1/grafeas_v1_beta1.list_occurrences.js,packages/google-devtools-containeranalysis/samples/README.md) | +| Grafeas_v1_beta1.update_note | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-devtools-containeranalysis/samples/generated/v1beta1/grafeas_v1_beta1.update_note.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-devtools-containeranalysis/samples/generated/v1beta1/grafeas_v1_beta1.update_note.js,packages/google-devtools-containeranalysis/samples/README.md) | +| Grafeas_v1_beta1.update_occurrence | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-devtools-containeranalysis/samples/generated/v1beta1/grafeas_v1_beta1.update_occurrence.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-devtools-containeranalysis/samples/generated/v1beta1/grafeas_v1_beta1.update_occurrence.js,packages/google-devtools-containeranalysis/samples/README.md) | +| Quickstart | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-devtools-containeranalysis/samples/quickstart.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-devtools-containeranalysis/samples/quickstart.js,packages/google-devtools-containeranalysis/samples/README.md) | diff --git a/packages/google-devtools-containeranalysis/package.json b/packages/google-devtools-containeranalysis/package.json index bf2ec42d2bf..7c3e9572f89 100644 --- a/packages/google-devtools-containeranalysis/package.json +++ b/packages/google-devtools-containeranalysis/package.json @@ -1,8 +1,13 @@ { "name": "@google-cloud/containeranalysis", - "version": "5.1.0", + "version": "5.1.1", "description": "Containeranalysis client for Node.js", - "repository": "googleapis/nodejs-containeranalysis", + "repository": { + "type": "git", + "directory": "packages/google-devtools-containeranalysis", + "url": "https://github.com/googleapis/google-cloud-node.git" + }, + "homepage": "https://github.com/googleapis/google-cloud-node/tree/main/packages/google-devtools-containeranalysis", "license": "Apache-2.0", "author": "Google LLC", "main": "build/src/index.js", diff --git a/packages/google-devtools-containeranalysis/samples/generated/v1/snippet_metadata.google.devtools.containeranalysis.v1.json b/packages/google-devtools-containeranalysis/samples/generated/v1/snippet_metadata.google.devtools.containeranalysis.v1.json index 5c14b476af8..abea96f3efe 100644 --- a/packages/google-devtools-containeranalysis/samples/generated/v1/snippet_metadata.google.devtools.containeranalysis.v1.json +++ b/packages/google-devtools-containeranalysis/samples/generated/v1/snippet_metadata.google.devtools.containeranalysis.v1.json @@ -1,7 +1,7 @@ { "clientLibrary": { "name": "nodejs-containeranalysis", - "version": "5.1.0", + "version": "5.1.1", "language": "TYPESCRIPT", "apis": [ { diff --git a/packages/google-devtools-containeranalysis/samples/generated/v1/snippet_metadata_google.devtools.containeranalysis.v1.json b/packages/google-devtools-containeranalysis/samples/generated/v1/snippet_metadata_google.devtools.containeranalysis.v1.json index 5c14b476af8..abea96f3efe 100644 --- a/packages/google-devtools-containeranalysis/samples/generated/v1/snippet_metadata_google.devtools.containeranalysis.v1.json +++ b/packages/google-devtools-containeranalysis/samples/generated/v1/snippet_metadata_google.devtools.containeranalysis.v1.json @@ -1,7 +1,7 @@ { "clientLibrary": { "name": "nodejs-containeranalysis", - "version": "5.1.0", + "version": "5.1.1", "language": "TYPESCRIPT", "apis": [ { diff --git a/packages/google-devtools-containeranalysis/samples/generated/v1beta1/snippet_metadata.google.devtools.containeranalysis.v1beta1.json b/packages/google-devtools-containeranalysis/samples/generated/v1beta1/snippet_metadata.google.devtools.containeranalysis.v1beta1.json index 5ba4e6690a2..bf2f68654bb 100644 --- a/packages/google-devtools-containeranalysis/samples/generated/v1beta1/snippet_metadata.google.devtools.containeranalysis.v1beta1.json +++ b/packages/google-devtools-containeranalysis/samples/generated/v1beta1/snippet_metadata.google.devtools.containeranalysis.v1beta1.json @@ -1,7 +1,7 @@ { "clientLibrary": { "name": "nodejs-containeranalysis", - "version": "5.1.0", + "version": "5.1.1", "language": "TYPESCRIPT", "apis": [ { diff --git a/packages/google-devtools-containeranalysis/samples/generated/v1beta1/snippet_metadata_google.devtools.containeranalysis.v1beta1.json b/packages/google-devtools-containeranalysis/samples/generated/v1beta1/snippet_metadata_google.devtools.containeranalysis.v1beta1.json index 46289e47d98..16b6cf1c5e3 100644 --- a/packages/google-devtools-containeranalysis/samples/generated/v1beta1/snippet_metadata_google.devtools.containeranalysis.v1beta1.json +++ b/packages/google-devtools-containeranalysis/samples/generated/v1beta1/snippet_metadata_google.devtools.containeranalysis.v1beta1.json @@ -1,7 +1,7 @@ { "clientLibrary": { "name": "nodejs-containeranalysis", - "version": "5.1.0", + "version": "5.1.1", "language": "TYPESCRIPT", "apis": [ { diff --git a/packages/google-devtools-containeranalysis/samples/package.json b/packages/google-devtools-containeranalysis/samples/package.json index 3c3d298e216..7ce53ce1eb1 100644 --- a/packages/google-devtools-containeranalysis/samples/package.json +++ b/packages/google-devtools-containeranalysis/samples/package.json @@ -14,7 +14,7 @@ "test": "mocha --timeout 100000 test/**.test.js" }, "dependencies": { - "@google-cloud/containeranalysis": "^5.1.0" + "@google-cloud/containeranalysis": "^5.1.1" }, "devDependencies": { "chai": "^4.2.0", diff --git a/release-please-config.json b/release-please-config.json index b29fb7c37bf..824ba0b62a9 100644 --- a/release-please-config.json +++ b/release-please-config.json @@ -1,6 +1,7 @@ { "initial-version": "0.1.0", "packages": { + "packages/google-ai-generativelanguage": {}, "packages/google-analytics-admin": {}, "packages/google-analytics-data": {}, "packages/google-api-apikeys": {}, @@ -10,11 +11,15 @@ "packages/google-appengine": {}, "packages/google-area120-tables": {}, "packages/google-cloud-accessapproval": {}, + "packages/google-cloud-advisorynotifications": {}, "packages/google-cloud-aiplatform": {}, + "packages/google-cloud-alloydb": {}, "packages/google-cloud-apigateway": {}, "packages/google-cloud-apigeeconnect": {}, + "packages/google-cloud-apigeeregistry": {}, "packages/google-cloud-asset": {}, "packages/google-cloud-assuredworkloads": {}, + "packages/google-cloud-automl": {}, "packages/google-cloud-baremetalsolution": {}, "packages/google-cloud-batch": {}, "packages/google-cloud-beyondcorp-appconnections": {}, @@ -34,7 +39,11 @@ "packages/google-cloud-certificatemanager": {}, "packages/google-cloud-channel": {}, "packages/google-cloud-clouddms": {}, + "packages/google-cloud-commerce-consumer-procurement": {}, "packages/google-cloud-compute": {}, + "packages/google-cloud-confidentialcomputing": {}, + "packages/google-cloud-config": {}, + "packages/google-cloud-connectors": {}, "packages/google-cloud-contactcenterinsights": {}, "packages/google-cloud-contentwarehouse": {}, "packages/google-cloud-datacatalog": {}, @@ -50,8 +59,10 @@ "packages/google-cloud-dialogflow": {}, "packages/google-cloud-dialogflow-cx": {}, "packages/google-cloud-discoveryengine": {}, + "packages/google-cloud-dns": {}, "packages/google-cloud-documentai": {}, "packages/google-cloud-domains": {}, + "packages/google-cloud-edgecontainer": {}, "packages/google-cloud-essentialcontacts": {}, "packages/google-cloud-eventarc": {}, "packages/google-cloud-eventarc-publishing": {}, @@ -66,16 +77,20 @@ "packages/google-cloud-ids": {}, "packages/google-cloud-iot": {}, "packages/google-cloud-kms": {}, + "packages/google-cloud-kms-inventory": {}, "packages/google-cloud-language": {}, "packages/google-cloud-lifesciences": {}, "packages/google-cloud-managedidentities": {}, "packages/google-cloud-mediatranslation": {}, "packages/google-cloud-memcache": {}, "packages/google-cloud-metastore": {}, + "packages/google-cloud-migrationcenter": {}, "packages/google-cloud-monitoring": {}, + "packages/google-cloud-netapp": {}, "packages/google-cloud-networkconnectivity": {}, "packages/google-cloud-networkmanagement": {}, "packages/google-cloud-networksecurity": {}, + "packages/google-cloud-networkservices": {}, "packages/google-cloud-notebooks": {}, "packages/google-cloud-optimization": {}, "packages/google-cloud-orchestration-airflow-service": {}, @@ -83,8 +98,11 @@ "packages/google-cloud-osconfig": {}, "packages/google-cloud-oslogin": {}, "packages/google-cloud-phishingprotection": {}, + "packages/google-cloud-policysimulator": {}, "packages/google-cloud-policytroubleshooter": {}, + "packages/google-cloud-policytroubleshooter-iam": {}, "packages/google-cloud-privatecatalog": {}, + "packages/google-cloud-rapidmigrationassessment": {}, "packages/google-cloud-recaptchaenterprise": {}, "packages/google-cloud-recommender": {}, "packages/google-cloud-redis": {}, @@ -100,6 +118,9 @@ "packages/google-cloud-servicedirectory": {}, "packages/google-cloud-shell": {}, "packages/google-cloud-speech": {}, + "packages/google-cloud-sql": {}, + "packages/google-cloud-storageinsights": {}, + "packages/google-cloud-support": {}, "packages/google-cloud-talent": {}, "packages/google-cloud-tasks": {}, "packages/google-cloud-texttospeech": {}, @@ -116,38 +137,25 @@ "packages/google-cloud-webrisk": {}, "packages/google-cloud-websecurityscanner": {}, "packages/google-cloud-workflows-executions": {}, + "packages/google-cloud-workstations": {}, "packages/google-container": {}, "packages/google-dataflow": {}, "packages/google-devtools-artifactregistry": {}, "packages/google-devtools-cloudbuild": {}, + "packages/google-devtools-cloudprofiler": {}, "packages/google-devtools-containeranalysis": {}, "packages/google-iam": {}, "packages/google-iam-credentials": {}, "packages/google-identity-accesscontextmanager": {}, "packages/google-maps-addressvalidation": {}, "packages/google-maps-mapsplatformdatasets": {}, + "packages/google-maps-places": {}, "packages/google-maps-routing": {}, "packages/google-monitoring-dashboard": {}, "packages/google-privacy-dlp": {}, "packages/google-storagetransfer": {}, "packages/grafeas": {}, - "packages/google-cloud-kms-inventory": {}, - "packages/google-cloud-advisorynotifications": {}, - "packages/typeless-sample-bot": {}, - "packages/google-cloud-alloydb": {}, - "packages/google-cloud-workstations": {}, - "packages/google-cloud-confidentialcomputing": {}, - "packages/google-ai-generativelanguage": {}, - "packages/google-cloud-storageinsights": {}, - "packages/google-cloud-support": {}, - "packages/google-maps-places": {}, - "packages/google-cloud-rapidmigrationassessment": {}, - "packages/google-cloud-migrationcenter": {}, - "packages/google-cloud-sql": {}, - "packages/google-cloud-commerce-consumer-procurement": {}, - "packages/google-cloud-policytroubleshooter-iam": {}, - "packages/google-cloud-config": {}, - "packages/google-cloud-netapp": {} + "packages/typeless-sample-bot": {} }, "plugins": [ {